From 3a32c6655c2938b713be3d8043e79ca24912d49d Mon Sep 17 00:00:00 2001
From: "Alex Ellis (OpenFaaS Ltd)"
Date: Fri, 22 Nov 2024 08:57:03 +0000
Subject: [PATCH] Update internal dependencies and to Go 1.23
Signed-off-by: Alex Ellis (OpenFaaS Ltd)
---
Dockerfile | 2 +-
go.mod | 134 +-
go.sum | 145 +
vendor/cloud.google.com/go/auth/CHANGES.md | 336 +
vendor/cloud.google.com/go/auth/LICENSE | 202 +
vendor/cloud.google.com/go/auth/README.md | 40 +
vendor/cloud.google.com/go/auth/auth.go | 608 +
.../go/auth/credentials/compute.go | 86 +
.../go/auth/credentials/detect.go | 262 +
.../go/auth/credentials/doc.go | 45 +
.../go/auth/credentials/filetypes.go | 225 +
.../internal/externalaccount/aws_provider.go | 520 +
.../externalaccount/executable_provider.go | 284 +
.../externalaccount/externalaccount.go | 407 +
.../internal/externalaccount/file_provider.go | 78 +
.../internal/externalaccount/info.go | 74 +
.../externalaccount/programmatic_provider.go} | 25 +-
.../internal/externalaccount/url_provider.go | 88 +
.../internal/externalaccount/x509_provider.go | 63 +
.../externalaccountuser.go | 110 +
.../go/auth/credentials/internal/gdch/gdch.go | 184 +
.../internal/impersonate/impersonate.go | 146 +
.../internal/stsexchange/sts_exchange.go | 161 +
.../go/auth/credentials/selfsignedjwt.go | 85 +
.../go/auth/httptransport/httptransport.go | 232 +
.../go/auth/httptransport/trace.go | 93 +
.../go/auth/httptransport/transport.go | 248 +
.../go/auth/internal/credsfile/credsfile.go | 107 +
.../go/auth/internal/credsfile/filetype.go | 157 +
.../go/auth/internal/credsfile/parse.go | 98 +
.../go/auth/internal/internal.go | 216 +
.../go/auth/internal/jwt/jwt.go | 171 +
.../go/auth/internal/transport/cba.go | 366 +
.../internal/transport/cert/default_cert.go | 65 +
.../transport/cert/enterprise_cert.go | 54 +
.../transport/cert/secureconnect_cert.go | 124 +
.../internal/transport/cert/workload_cert.go | 114 +
.../go/auth/internal/transport/s2a.go | 134 +
.../go/auth/internal/transport/transport.go | 105 +
.../go/auth/oauth2adapt/CHANGES.md | 68 +
.../go/auth/oauth2adapt/LICENSE | 202 +
.../go/auth/oauth2adapt/oauth2adapt.go | 200 +
.../cloud.google.com/go/auth/threelegged.go | 368 +
.../go/compute/metadata/CHANGES.md | 33 +
.../go/compute/metadata/metadata.go | 384 +-
.../go/compute/metadata/retry_linux.go | 9 +-
.../go/compute/metadata/syscheck.go} | 22 +-
.../go/compute/metadata/syscheck_linux.go} | 20 +-
.../go/compute/metadata/syscheck_windows.go | 38 +
.../azure-sdk-for-go/sdk/azcore/CHANGELOG.md | 107 +
.../internal/resource/resource_identifier.go | 2 +-
.../sdk/azcore/arm/policy/policy.go | 10 +
.../sdk/azcore/arm/runtime/pipeline.go | 13 +-
.../azcore/arm/runtime/policy_bearer_token.go | 49 +-
.../azcore/arm/runtime/policy_register_rp.go | 45 +-
.../Azure/azure-sdk-for-go/sdk/azcore/ci.yml | 4 +-
.../Azure/azure-sdk-for-go/sdk/azcore/core.go | 21 +-
.../azure-sdk-for-go/sdk/azcore/errors.go | 3 +
.../Azure/azure-sdk-for-go/sdk/azcore/etag.go | 9 +
.../sdk/azcore/internal/exported/request.go | 133 +-
.../internal/exported/response_error.go | 74 +-
.../sdk/azcore/internal/log/log.go | 22 +-
.../azcore/internal/pollers/async/async.go | 4 +-
.../sdk/azcore/internal/pollers/body/body.go | 4 +-
.../sdk/azcore/internal/pollers/fake/fake.go | 4 +-
.../sdk/azcore/internal/pollers/loc/loc.go | 8 +-
.../sdk/azcore/internal/pollers/op/op.go | 13 +-
.../sdk/azcore/internal/pollers/util.go | 29 +-
.../sdk/azcore/internal/shared/constants.go | 2 +-
.../azure-sdk-for-go/sdk/azcore/log/log.go | 5 +
.../sdk/azcore/policy/policy.go | 33 +-
.../sdk/azcore/runtime/errors.go | 8 +
.../sdk/azcore/runtime/pager.go | 13 +-
.../sdk/azcore/runtime/policy_bearer_token.go | 147 +-
.../sdk/azcore/runtime/policy_http_trace.go | 19 +-
.../azcore/runtime/policy_key_credential.go | 21 +-
.../sdk/azcore/runtime/policy_retry.go | 31 +-
.../azcore/runtime/policy_sas_credential.go | 20 +-
.../sdk/azcore/runtime/poller.go | 9 +-
.../sdk/azcore/runtime/request.go | 132 +-
.../sdk/azcore/runtime/response.go | 4 +-
.../sdk/azcore/streaming/progress.go | 14 +
.../sdk/azidentity/.gitignore | 4 +
.../sdk/azidentity/BREAKING_CHANGES.md | 10 +
.../sdk/azidentity/CHANGELOG.md | 134 +-
.../sdk/azidentity/MIGRATION.md | 4 +-
.../azure-sdk-for-go/sdk/azidentity/README.md | 34 +-
.../sdk/azidentity/TOKEN_CACHING.MD | 51 +-
.../sdk/azidentity/TROUBLESHOOTING.md | 42 +-
.../sdk/azidentity/assets.json | 2 +-
.../sdk/azidentity/authentication_record.go | 18 +-
.../sdk/azidentity/azidentity.go | 13 +-
.../sdk/azidentity/azure_cli_credential.go | 33 +-
.../azidentity/azure_pipelines_credential.go | 157 +
.../azidentity/chained_token_credential.go | 18 +-
.../azure-sdk-for-go/sdk/azidentity/ci.yml | 50 +-
.../azidentity/client_assertion_credential.go | 18 +-
.../client_certificate_credential.go | 27 +-
.../azidentity/client_secret_credential.go | 14 +-
.../sdk/azidentity/confidential_client.go | 20 +-
.../azidentity/default_azure_credential.go | 60 +-
.../azidentity/developer_credential_util.go | 2 +-
.../sdk/azidentity/device_code_credential.go | 40 +-
.../sdk/azidentity/environment_credential.go | 5 +-
.../azure-sdk-for-go/sdk/azidentity/errors.go | 74 +-
.../sdk/azidentity/go.work.sum | 39 -
.../interactive_browser_credential.go | 40 +-
.../sdk/azidentity/internal/cache.go | 86 +
.../sdk/azidentity/internal/exported.go | 18 -
.../sdk/azidentity/internal/internal.go | 31 -
.../azidentity/managed-identity-matrix.json | 17 +
.../sdk/azidentity/managed_identity_client.go | 249 +-
.../azidentity/managed_identity_credential.go | 59 +-
.../sdk/azidentity/on_behalf_of_credential.go | 16 +-
.../sdk/azidentity/public_client.go | 21 +-
.../sdk/azidentity/test-resources-post.ps1 | 126 +
.../sdk/azidentity/test-resources-pre.ps1 | 20 +-
.../sdk/azidentity/test-resources.bicep | 229 +-
.../username_password_credential.go | 28 +-
.../sdk/azidentity/version.go | 2 +-
.../sdk/azidentity/workload_identity.go | 10 +
.../sdk/internal/exported/exported.go | 5 +
.../apps/confidential/confidential.go | 13 +-
.../apps/internal/base/base.go | 30 +-
.../apps/internal/json/json.go | 54 +-
.../apps/internal/local/server.go | 3 +-
.../apps/internal/oauth/oauth.go | 5 +-
.../internal/oauth/ops/authority/authority.go | 109 +-
.../internal/oauth/ops/internal/comm/comm.go | 11 +-
.../apps/internal/oauth/resolvers.go | 17 +-
.../apps/public/public.go | 8 +
.../aws/aws-sdk-go/aws/endpoints/defaults.go | 4610 +-
.../aws/aws-sdk-go/aws/request/waiter.go | 13 +-
.../github.com/aws/aws-sdk-go/aws/version.go | 2 +-
.../protocol/query/queryutil/queryutil.go | 4 +-
.../aws/aws-sdk-go/service/ec2/api.go | 5636 +-
.../aws/aws-sdk-go/service/ec2/doc.go | 27 +-
.../aws/aws-sdk-go/service/ssooidc/api.go | 162 +-
.../aws/aws-sdk-go/service/ssooidc/errors.go | 8 +
vendor/github.com/cespare/xxhash/v2/README.md | 2 +
vendor/github.com/cespare/xxhash/v2/xxhash.go | 29 +-
.../cespare/xxhash/v2/xxhash_asm.go | 2 +-
.../cespare/xxhash/v2/xxhash_other.go | 2 +-
.../cespare/xxhash/v2/xxhash_safe.go | 2 +-
.../cespare/xxhash/v2/xxhash_unsafe.go | 2 +-
.../github.com/digitalocean/godo/CHANGELOG.md | 124 +
.../github.com/digitalocean/godo/apps.gen.go | 219 +-
vendor/github.com/digitalocean/godo/apps.go | 108 +
.../digitalocean/godo/apps_accessors.go | 432 +
.../digitalocean/godo/certificates.go | 35 +
.../github.com/digitalocean/godo/databases.go | 559 +-
.../digitalocean/godo/droplet_actions.go | 38 +
.../digitalocean/godo/droplet_autoscale.go | 258 +
.../github.com/digitalocean/godo/droplets.go | 184 +-
vendor/github.com/digitalocean/godo/godo.go | 6 +-
.../digitalocean/godo/kubernetes.go | 45 +-
.../digitalocean/godo/load_balancers.go | 115 +-
.../digitalocean/godo/monitoring.go | 196 +-
.../github.com/digitalocean/godo/registry.go | 120 +
vendor/github.com/digitalocean/godo/sizes.go | 48 +-
.../github.com/digitalocean/godo/strings.go | 24 +
.../digitalocean/godo/vpc_peerings.go | 199 +
vendor/github.com/digitalocean/godo/vpcs.go | 8 +
.../emicklei/go-restful/v3/CHANGES.md | 20 +-
.../emicklei/go-restful/v3/README.md | 1 -
.../emicklei/go-restful/v3/compress.go | 10 +
.../emicklei/go-restful/v3/curly.go | 48 +-
.../emicklei/go-restful/v3/jsr311.go | 2 +-
.../github.com/fxamacker/cbor/v2/.gitignore | 12 +
.../fxamacker/cbor/v2/.golangci.yml | 104 +
.../fxamacker/cbor/v2/CODE_OF_CONDUCT.md | 133 +
.../fxamacker/cbor/v2/CONTRIBUTING.md | 41 +
vendor/github.com/fxamacker/cbor/v2/LICENSE | 21 +
vendor/github.com/fxamacker/cbor/v2/README.md | 691 +
.../github.com/fxamacker/cbor/v2/SECURITY.md | 7 +
.../fxamacker/cbor/v2/bytestring.go | 63 +
vendor/github.com/fxamacker/cbor/v2/cache.go | 363 +
vendor/github.com/fxamacker/cbor/v2/common.go | 182 +
vendor/github.com/fxamacker/cbor/v2/decode.go | 3187 +
.../github.com/fxamacker/cbor/v2/diagnose.go | 724 +
vendor/github.com/fxamacker/cbor/v2/doc.go | 129 +
vendor/github.com/fxamacker/cbor/v2/encode.go | 1989 +
.../fxamacker/cbor/v2/encode_map.go | 94 +
.../fxamacker/cbor/v2/encode_map_go117.go | 60 +
.../fxamacker/cbor/v2/simplevalue.go | 69 +
vendor/github.com/fxamacker/cbor/v2/stream.go | 277 +
.../fxamacker/cbor/v2/structfields.go | 260 +
vendor/github.com/fxamacker/cbor/v2/tag.go | 299 +
vendor/github.com/fxamacker/cbor/v2/valid.go | 394 +
vendor/github.com/go-logr/logr/README.md | 1 +
vendor/github.com/go-logr/logr/funcr/funcr.go | 169 +-
.../go-openapi/jsonpointer/pointer.go | 2 +-
.../github.com/go-openapi/swag/BENCHMARK.md | 52 +
.../go-openapi/swag/initialism_index.go | 139 +-
.../github.com/go-openapi/swag/name_lexem.go | 70 +-
vendor/github.com/go-openapi/swag/split.go | 470 +-
.../go-openapi/swag/string_bytes.go | 8 +
vendor/github.com/go-openapi/swag/util.go | 198 +-
vendor/github.com/go-openapi/swag/yaml.go | 3 +-
.../github.com/go-resty/resty/v2/.gitignore | 3 +-
.../github.com/go-resty/resty/v2/BUILD.bazel | 18 +-
vendor/github.com/go-resty/resty/v2/LICENSE | 2 +-
vendor/github.com/go-resty/resty/v2/README.md | 51 +-
vendor/github.com/go-resty/resty/v2/WORKSPACE | 8 +-
vendor/github.com/go-resty/resty/v2/client.go | 615 +-
vendor/github.com/go-resty/resty/v2/digest.go | 100 +-
.../go-resty/resty/v2/middleware.go | 62 +-
.../github.com/go-resty/resty/v2/redirect.go | 33 +-
.../github.com/go-resty/resty/v2/request.go | 415 +-
.../github.com/go-resty/resty/v2/response.go | 54 +-
vendor/github.com/go-resty/resty/v2/resty.go | 8 +-
vendor/github.com/go-resty/resty/v2/retry.go | 14 +-
.../go-resty/resty/v2/shellescape/BUILD.bazel | 14 +
.../resty/v2/shellescape/shellescape.go | 40 +
vendor/github.com/go-resty/resty/v2/trace.go | 32 +-
.../github.com/go-resty/resty/v2/transport.go | 2 +-
.../go-resty/resty/v2/transport112.go | 2 +-
vendor/github.com/go-resty/resty/v2/util.go | 71 +-
.../github.com/go-resty/resty/v2/util_curl.go | 78 +
vendor/github.com/golang-jwt/jwt/v5/ecdsa.go | 4 +-
vendor/github.com/golang-jwt/jwt/v5/hmac.go | 4 +-
.../golang/protobuf/jsonpb/decode.go | 530 -
.../golang/protobuf/jsonpb/encode.go | 559 -
.../github.com/golang/protobuf/jsonpb/json.go | 69 -
.../github.com/golang/protobuf/ptypes/any.go | 179 -
.../golang/protobuf/ptypes/any/any.pb.go | 62 -
.../github.com/golang/protobuf/ptypes/doc.go | 10 -
.../golang/protobuf/ptypes/duration.go | 76 -
.../protobuf/ptypes/duration/duration.pb.go | 63 -
.../golang/protobuf/ptypes/timestamp.go | 112 -
.../protobuf/ptypes/timestamp/timestamp.pb.go | 64 -
.../proto/common_go_proto/common.pb.go | 99 +-
.../s2a_context_go_proto/s2a_context.pb.go | 6 +-
.../internal/proto/s2a_go_proto/s2a.pb.go | 28 +-
.../proto/s2a_go_proto/s2a_grpc.pb.go | 13 +-
.../proto/v2/common_go_proto/common.pb.go | 296 +-
.../v2/s2a_context_go_proto/s2a_context.pb.go | 73 +-
.../internal/proto/v2/s2a_go_proto/s2a.pb.go | 772 +-
.../proto/v2/s2a_go_proto/s2a_grpc.pb.go | 13 +-
.../google/s2a-go/internal/record/record.go | 34 +-
.../internal/tokenmanager/tokenmanager.go | 15 +-
.../google/s2a-go/internal/v2/s2av2.go | 40 +-
.../v2/tlsconfigstore/tlsconfigstore.go | 15 +-
vendor/github.com/google/s2a-go/s2a.go | 103 +-
.../github.com/google/s2a-go/s2a_options.go | 28 +-
vendor/github.com/google/uuid/CHANGELOG.md | 13 +
vendor/github.com/google/uuid/hash.go | 6 +
vendor/github.com/google/uuid/version7.go | 39 +-
.../gax-go/v2/.release-please-manifest.json | 2 +-
.../googleapis/gax-go/v2/CHANGES.md | 49 +
.../googleapis/gax-go/v2/apierror/apierror.go | 4 +-
.../googleapis/gax-go/v2/callctx/callctx.go | 26 +
.../github.com/googleapis/gax-go/v2/header.go | 42 +-
.../googleapis/gax-go/v2/internal/version.go | 2 +-
.../v2/internallog/internal/internal.go | 134 +
.../gax-go/v2/internallog/internallog.go | 154 +
.../googleapis/gax-go/v2/proto_json_stream.go | 3 +-
.../hashicorp/go-retryablehttp/.go-version | 1 +
.../hashicorp/go-retryablehttp/CHANGELOG.md | 26 +-
.../hashicorp/go-retryablehttp/CODEOWNERS | 2 +-
.../hashicorp/go-retryablehttp/Makefile | 2 +-
.../hashicorp/go-retryablehttp/README.md | 2 +-
.../go-retryablehttp/cert_error_go119.go | 14 +
.../go-retryablehttp/cert_error_go120.go | 14 +
.../hashicorp/go-retryablehttp/client.go | 132 +-
.../hetznercloud/hcloud-go/hcloud/action.go | 167 -
.../hcloud-go/hcloud/action_waiter.go | 119 +
.../hcloud-go/hcloud/action_watch.go | 131 +
.../hetznercloud/hcloud-go/hcloud/client.go | 10 +
.../hetznercloud/hcloud-go/hcloud/error.go | 11 +-
.../hetznercloud/hcloud-go/hcloud/firewall.go | 1 +
.../hetznercloud/hcloud-go/hcloud/hcloud.go | 2 +-
.../hetznercloud/hcloud-go/hcloud/network.go | 7 +-
.../hetznercloud/hcloud-go/hcloud/pricing.go | 18 +-
.../hetznercloud/hcloud-go/hcloud/schema.go | 38 +-
.../hcloud-go/hcloud/schema/error.go | 2 +-
.../hcloud-go/hcloud/schema/firewall.go | 22 +-
.../hcloud-go/hcloud/schema/pricing.go | 20 +-
.../hcloud-go/hcloud/schema/server_type.go | 21 +-
.../hcloud-go/hcloud/schema/volume.go | 1 +
.../hetznercloud/hcloud-go/hcloud/server.go | 1 +
.../hcloud-go/hcloud/server_type.go | 4 +-
.../hetznercloud/hcloud-go/hcloud/volume.go | 6 +
.../github.com/imdario/mergo/.deepsource.toml | 12 +
vendor/github.com/imdario/mergo/.travis.yml | 5 +
.../github.com/imdario/mergo/CONTRIBUTING.md | 112 +
vendor/github.com/imdario/mergo/README.md | 92 +-
vendor/github.com/imdario/mergo/SECURITY.md | 14 +
vendor/github.com/imdario/mergo/doc.go | 141 +-
vendor/github.com/imdario/mergo/map.go | 8 +-
vendor/github.com/imdario/mergo/merge.go | 215 +-
vendor/github.com/imdario/mergo/mergo.go | 34 +-
.../inlets/cloud-provision/provision/civo.go | 267 -
.../provision/equinix_metal.go | 128 -
.../klauspost/compress/.gitattributes | 2 +
.../packngo => klauspost/compress}/.gitignore | 12 +-
.../klauspost/compress/.goreleaser.yml | 123 +
vendor/github.com/klauspost/compress/LICENSE | 304 +
.../github.com/klauspost/compress/README.md | 721 +
.../github.com/klauspost/compress/SECURITY.md | 25 +
.../klauspost/compress/compressible.go | 85 +
.../klauspost/compress/fse/README.md | 79 +
.../klauspost/compress/fse/bitreader.go | 122 +
.../klauspost/compress/fse/bitwriter.go | 167 +
.../klauspost/compress/fse/bytereader.go | 47 +
.../klauspost/compress/fse/compress.go | 683 +
.../klauspost/compress/fse/decompress.go | 376 +
.../github.com/klauspost/compress/fse/fse.go | 144 +
vendor/github.com/klauspost/compress/gen.sh | 4 +
.../klauspost/compress/huff0/.gitignore | 1 +
.../klauspost/compress/huff0/README.md | 89 +
.../klauspost/compress/huff0/bitreader.go | 229 +
.../klauspost/compress/huff0/bitwriter.go | 102 +
.../klauspost/compress/huff0/compress.go | 742 +
.../klauspost/compress/huff0/decompress.go | 1167 +
.../compress/huff0/decompress_amd64.go | 226 +
.../compress/huff0/decompress_amd64.s | 830 +
.../compress/huff0/decompress_generic.go | 299 +
.../klauspost/compress/huff0/huff0.go | 337 +
.../compress/internal/cpuinfo/cpuinfo.go | 34 +
.../internal/cpuinfo/cpuinfo_amd64.go | 11 +
.../compress/internal/cpuinfo/cpuinfo_amd64.s | 36 +
.../compress/internal/snapref/LICENSE} | 31 +-
.../compress/internal/snapref/decode.go | 264 +
.../compress/internal/snapref/decode_other.go | 113 +
.../compress/internal/snapref/encode.go | 289 +
.../compress/internal/snapref/encode_other.go | 250 +
.../compress/internal/snapref/snappy.go | 98 +
vendor/github.com/klauspost/compress/s2sx.mod | 4 +
vendor/github.com/klauspost/compress/s2sx.sum | 0
.../klauspost/compress/zstd/README.md | 441 +
.../klauspost/compress/zstd/bitreader.go | 136 +
.../klauspost/compress/zstd/bitwriter.go | 112 +
.../klauspost/compress/zstd/blockdec.go | 731 +
.../klauspost/compress/zstd/blockenc.go | 909 +
.../compress/zstd/blocktype_string.go | 85 +
.../klauspost/compress/zstd/bytebuf.go | 131 +
.../klauspost/compress/zstd/bytereader.go | 82 +
.../klauspost/compress/zstd/decodeheader.go | 261 +
.../klauspost/compress/zstd/decoder.go | 948 +
.../compress/zstd/decoder_options.go | 169 +
.../klauspost/compress/zstd/dict.go | 565 +
.../klauspost/compress/zstd/enc_base.go | 173 +
.../klauspost/compress/zstd/enc_best.go | 560 +
.../klauspost/compress/zstd/enc_better.go | 1252 +
.../klauspost/compress/zstd/enc_dfast.go | 1123 +
.../klauspost/compress/zstd/enc_fast.go | 891 +
.../klauspost/compress/zstd/encoder.go | 642 +
.../compress/zstd/encoder_options.go | 339 +
.../klauspost/compress/zstd/framedec.go | 415 +
.../klauspost/compress/zstd/frameenc.go | 137 +
.../klauspost/compress/zstd/fse_decoder.go | 307 +
.../compress/zstd/fse_decoder_amd64.go | 65 +
.../compress/zstd/fse_decoder_amd64.s | 126 +
.../compress/zstd/fse_decoder_generic.go | 73 +
.../klauspost/compress/zstd/fse_encoder.go | 701 +
.../klauspost/compress/zstd/fse_predefined.go | 158 +
.../klauspost/compress/zstd/hash.go | 35 +
.../klauspost/compress/zstd/history.go | 116 +
.../compress/zstd/internal/xxhash/LICENSE.txt | 22 +
.../compress/zstd/internal/xxhash/README.md | 71 +
.../compress/zstd/internal/xxhash/xxhash.go | 230 +
.../zstd/internal/xxhash/xxhash_amd64.s | 210 +
.../zstd/internal/xxhash/xxhash_arm64.s | 184 +
.../zstd/internal/xxhash/xxhash_asm.go | 16 +
.../zstd/internal/xxhash/xxhash_other.go | 76 +
.../zstd/internal/xxhash/xxhash_safe.go | 11 +
.../klauspost/compress/zstd/matchlen_amd64.go | 16 +
.../klauspost/compress/zstd/matchlen_amd64.s | 66 +
.../compress/zstd/matchlen_generic.go | 33 +
.../klauspost/compress/zstd/seqdec.go | 503 +
.../klauspost/compress/zstd/seqdec_amd64.go | 394 +
.../klauspost/compress/zstd/seqdec_amd64.s | 4151 +
.../klauspost/compress/zstd/seqdec_generic.go | 237 +
.../klauspost/compress/zstd/seqenc.go | 114 +
.../klauspost/compress/zstd/snappy.go | 434 +
.../github.com/klauspost/compress/zstd/zip.go | 141 +
.../klauspost/compress/zstd/zstd.go | 125 +
vendor/github.com/linode/linodego/.gitignore | 1 +
vendor/github.com/linode/linodego/.gitmodules | 6 +-
.../github.com/linode/linodego/.golangci.yml | 27 +-
vendor/github.com/linode/linodego/Makefile | 5 +-
vendor/github.com/linode/linodego/README.md | 58 +-
vendor/github.com/linode/linodego/account.go | 78 +-
.../linode/linodego/account_agreements.go | 37 +
.../linode/linodego/account_availability.go | 46 +-
.../linode/linodego/account_betas.go | 49 +-
.../linode/linodego/account_child.go | 47 +
.../linode/linodego/account_events.go | 105 +-
.../linode/linodego/account_invoices.go | 82 +-
.../linode/linodego/account_logins.go | 34 +-
.../linode/linodego/account_maintenance.go | 51 +
.../linode/linodego/account_notifications.go | 27 +-
.../linode/linodego/account_oauth_client.go | 69 +-
.../linodego/account_payment_methods.go | 165 +
.../linode/linodego/account_payments.go | 47 +-
.../linode/linodego/account_promo_credits.go | 67 +
.../linode/linodego/account_settings.go | 18 +-
.../linode/linodego/account_transfer.go | 6 +-
.../linode/linodego/account_user_grants.go | 24 +-
.../linode/linodego/account_users.go | 102 +-
.../github.com/linode/linodego/base_types.go | 29 +
vendor/github.com/linode/linodego/betas.go | 38 +-
vendor/github.com/linode/linodego/client.go | 372 +-
.../github.com/linode/linodego/client_http.go | 56 +
vendor/github.com/linode/linodego/config.go | 2 +-
.../github.com/linode/linodego/databases.go | 132 +-
.../linode/linodego/domain_records.go | 100 +-
vendor/github.com/linode/linodego/domains.go | 70 +-
vendor/github.com/linode/linodego/errors.go | 86 +-
.../linode/linodego/firewall_devices.go | 53 +-
.../linode/linodego/firewall_rules.go | 21 +-
.../github.com/linode/linodego/firewalls.go | 61 +-
vendor/github.com/linode/linodego/go.work | 2 +-
vendor/github.com/linode/linodego/go.work.sum | 204 +-
vendor/github.com/linode/linodego/images.go | 240 +-
.../linodego/instance_config_interfaces.go | 90 +-
.../linode/linodego/instance_configs.go | 66 +-
.../linode/linodego/instance_disks.go | 97 +-
.../linode/linodego/instance_firewalls.go | 30 +-
.../linode/linodego/instance_ips.go | 84 +-
.../linode/linodego/instance_nodebalancers.go | 10 +
.../linode/linodego/instance_snapshots.go | 46 +-
.../linode/linodego/instance_stats.go | 17 +-
.../linode/linodego/instance_volumes.go | 31 +-
.../github.com/linode/linodego/instances.go | 267 +-
.../linodego/internal/duration/duration.go | 2 +-
vendor/github.com/linode/linodego/kernels.go | 43 +-
.../linode/linodego/lke_cluster_pools.go | 3 -
.../linode/linodego/lke_clusters.go | 215 +-
.../linodego/lke_clusters_control_plane.go | 99 +
.../linode/linodego/lke_node_pools.go | 144 +-
.../github.com/linode/linodego/lke_types.go | 47 +
vendor/github.com/linode/linodego/logger.go | 51 +
vendor/github.com/linode/linodego/longview.go | 78 +-
.../linode/linodego/longview_subscriptions.go | 40 +-
vendor/github.com/linode/linodego/mysql.go | 129 +-
.../github.com/linode/linodego/network_ips.go | 71 +-
.../linode/linodego/network_pools.go | 40 +-
.../linode/linodego/network_ranges.go | 57 +-
.../linode/linodego/network_reserved_ips.go | 54 +
.../linodego/network_transfer_prices.go | 45 +
.../linode/linodego/nodebalancer.go | 62 +-
.../linodego/nodebalancer_config_nodes.go | 67 +-
.../linode/linodego/nodebalancer_configs.go | 119 +-
.../linode/linodego/nodebalancer_firewalls.go | 30 +-
.../linode/linodego/nodebalancer_stats.go | 8 +-
.../linode/linodego/nodebalancer_types.go | 45 +
.../linode/linodego/object_storage.go | 7 +-
.../linodego/object_storage_bucket_certs.go | 38 +-
.../linode/linodego/object_storage_buckets.go | 123 +-
.../linodego/object_storage_clusters.go | 41 +-
.../linode/linodego/object_storage_keys.go | 94 +-
.../linode/linodego/object_storage_object.go | 43 +-
.../linode/linodego/paged_response_structs.go | 180 +
.../github.com/linode/linodego/pagination.go | 43 +-
.../linode/linodego/placement_groups.go | 161 +
.../linode/linodego/pointer_helpers.go | 25 +
vendor/github.com/linode/linodego/postgres.go | 159 +-
vendor/github.com/linode/linodego/profile.go | 46 +-
.../linode/linodego/profile_grants_list.go | 8 +-
.../linode/linodego/profile_logins.go | 41 +-
.../linode/linodego/profile_phone_number.go | 19 +-
.../linodego/profile_security_questions.go | 16 +-
.../linode/linodego/profile_sshkeys.go | 63 +-
.../github.com/linode/linodego/profile_tfa.go | 17 +-
.../linode/linodego/profile_tokens.go | 65 +-
vendor/github.com/linode/linodego/regions.go | 96 +-
.../linode/linodego/regions_availability.go | 44 +-
.../linode/linodego/request_helpers.go | 220 +
vendor/github.com/linode/linodego/retries.go | 4 +-
.../linode/linodego/retries_http.go | 127 +
.../linode/linodego/stackscripts.go | 73 +-
vendor/github.com/linode/linodego/support.go | 42 +-
vendor/github.com/linode/linodego/tags.go | 83 +-
vendor/github.com/linode/linodego/types.go | 42 +-
vendor/github.com/linode/linodego/vlans.go | 31 +-
vendor/github.com/linode/linodego/volumes.go | 121 +-
.../linode/linodego/volumes_types.go | 45 +
vendor/github.com/linode/linodego/vpc.go | 74 +-
vendor/github.com/linode/linodego/vpc_ips.go | 20 +
.../github.com/linode/linodego/vpc_subnet.go | 80 +-
vendor/github.com/linode/linodego/waitfor.go | 38 +-
.../ovh/go-ovh/ovh/configuration.go | 63 +-
vendor/github.com/ovh/go-ovh/ovh/ovh.go | 99 +-
.../packethost/packngo/CHANGELOG.md | 12 -
.../packethost/packngo/CONTRIBUTING.md | 119 -
vendor/github.com/packethost/packngo/DCO | 37 -
vendor/github.com/packethost/packngo/Makefile | 24 -
.../github.com/packethost/packngo/OWNERS.md | 24 -
.../github.com/packethost/packngo/README.md | 155 -
.../github.com/packethost/packngo/RELEASE.md | 40 -
.../github.com/packethost/packngo/SUPPORT.md | 17 -
.../packethost/packngo/api_call_options.go | 222 -
.../github.com/packethost/packngo/apikeys.go | 191 -
.../github.com/packethost/packngo/batches.go | 118 -
.../packethost/packngo/bgp_configs.go | 94 -
.../packethost/packngo/bgp_sessions.go | 131 -
.../packethost/packngo/billing_address.go | 7 -
.../packethost/packngo/capacities.go | 103 -
.../packethost/packngo/clientopt.go | 55 -
.../packethost/packngo/code-of-conduct.md | 3 -
.../packethost/packngo/connections.go | 331 -
.../packethost/packngo/device_ports.go | 332 -
.../github.com/packethost/packngo/devices.go | 692 -
vendor/github.com/packethost/packngo/doc.go | 3 -
vendor/github.com/packethost/packngo/email.go | 98 -
.../github.com/packethost/packngo/events.go | 84 -
.../packngo/fabric_service_tokens.go | 42 -
.../packethost/packngo/facilities.go | 67 -
.../packngo/hardware_reservations.go | 104 -
.../packethost/packngo/invitations.go | 155 -
vendor/github.com/packethost/packngo/ip.go | 391 -
.../github.com/packethost/packngo/members.go | 66 -
.../packethost/packngo/metal_gateway.go | 136 -
.../github.com/packethost/packngo/metros.go | 42 -
.../packethost/packngo/notifications.go | 100 -
.../packethost/packngo/operatingsystems.go | 42 -
.../packethost/packngo/organizations.go | 186 -
.../github.com/packethost/packngo/packngo.go | 468 -
.../packethost/packngo/payment_methods.go | 71 -
vendor/github.com/packethost/packngo/plans.go | 201 -
vendor/github.com/packethost/packngo/ports.go | 248 -
.../github.com/packethost/packngo/projects.go | 222 -
vendor/github.com/packethost/packngo/rate.go | 12 -
.../packethost/packngo/renovate.json | 6 -
.../packethost/packngo/spotmarket.go | 92 -
.../packethost/packngo/spotmarketrequest.go | 132 -
.../github.com/packethost/packngo/sshkeys.go | 155 -
.../packethost/packngo/timestamp.go | 38 -
.../packethost/packngo/two_factor_auth.go | 56 -
vendor/github.com/packethost/packngo/user.go | 199 -
vendor/github.com/packethost/packngo/utils.go | 166 -
.../github.com/packethost/packngo/version.go | 36 -
.../packethost/packngo/virtualcircuits.go | 186 -
.../packethost/packngo/virtualnetworks.go | 117 -
.../packethost/packngo/vlan_assignments.go | 215 -
.../github.com/packethost/packngo/volumes.go | 264 -
vendor/github.com/packethost/packngo/vrf.go | 187 -
.../prometheus/client_golang/NOTICE | 5 -
.../internal/github.com/golang/gddo/LICENSE | 27 +
.../golang/gddo/httputil/header/header.go | 145 +
.../golang/gddo/httputil/negotiate.go | 36 +
.../client_golang/prometheus/go_collector.go | 55 +-
.../prometheus/go_collector_latest.go | 19 +-
.../client_golang/prometheus/histogram.go | 268 +-
.../internal/go_collector_options.go | 2 +
.../client_golang/prometheus/metric.go | 2 +-
.../prometheus/process_collector.go | 29 +-
.../prometheus/process_collector_other.go | 14 +
.../prometheus/promhttp/delegator.go | 6 +
.../client_golang/prometheus/promhttp/http.go | 113 +-
.../client_golang/prometheus/registry.go | 17 +-
.../client_golang/prometheus/summary.go | 42 +
.../client_golang/prometheus/vec.go | 2 +-
.../prometheus/client_model/go/metrics.pb.go | 195 +-
.../prometheus/common/expfmt/decode.go | 10 +-
.../prometheus/common/expfmt/encode.go | 82 +-
.../prometheus/common/expfmt/expfmt.go | 184 +-
.../common/expfmt/openmetrics_create.go | 283 +-
.../prometheus/common/expfmt/text_create.go | 118 +-
.../prometheus/common/expfmt/text_parse.go | 162 +-
.../bitbucket.org/ww/goautoneg/README.txt | 67 -
.../bitbucket.org/ww/goautoneg/autoneg.go | 160 -
.../prometheus/common/model/alert.go | 27 +-
.../prometheus/common/model/labels.go | 25 +-
.../prometheus/common/model/labelset.go | 11 -
.../common/model/labelset_string.go | 43 +
.../prometheus/common/model/metric.go | 366 +-
.../prometheus/procfs/.golangci.yml | 7 +
.../prometheus/procfs/MAINTAINERS.md | 3 +-
.../prometheus/procfs/Makefile.common | 26 +-
vendor/github.com/prometheus/procfs/arp.go | 6 +-
.../github.com/prometheus/procfs/buddyinfo.go | 6 +-
.../github.com/prometheus/procfs/cpuinfo.go | 4 +-
vendor/github.com/prometheus/procfs/crypto.go | 6 +-
.../github.com/prometheus/procfs/fscache.go | 4 +-
vendor/github.com/prometheus/procfs/ipvs.go | 6 +-
.../github.com/prometheus/procfs/loadavg.go | 2 +-
vendor/github.com/prometheus/procfs/mdstat.go | 60 +-
.../github.com/prometheus/procfs/meminfo.go | 220 +-
.../github.com/prometheus/procfs/mountinfo.go | 2 +-
.../prometheus/procfs/mountstats.go | 11 +-
.../prometheus/procfs/net_conntrackstat.go | 4 +-
.../prometheus/procfs/net_ip_socket.go | 46 +-
.../prometheus/procfs/net_sockstat.go | 4 +-
.../prometheus/procfs/net_softnet.go | 2 +-
.../prometheus/procfs/net_tls_stat.go | 119 +
.../github.com/prometheus/procfs/net_unix.go | 14 +-
.../prometheus/procfs/net_wireless.go | 22 +-
vendor/github.com/prometheus/procfs/proc.go | 8 +-
.../prometheus/procfs/proc_limits.go | 2 +-
.../github.com/prometheus/procfs/proc_ns.go | 4 +-
.../github.com/prometheus/procfs/proc_psi.go | 2 +-
.../prometheus/procfs/proc_smaps.go | 2 +-
.../github.com/prometheus/procfs/proc_stat.go | 7 +
.../prometheus/procfs/proc_status.go | 29 +-
.../github.com/prometheus/procfs/proc_sys.go | 2 +-
.../github.com/prometheus/procfs/softirqs.go | 22 +-
vendor/github.com/prometheus/procfs/stat.go | 22 +-
vendor/github.com/prometheus/procfs/swaps.go | 6 +-
vendor/github.com/prometheus/procfs/thread.go | 2 +-
.../github.com/prometheus/procfs/zoneinfo.go | 4 +-
.../api/block/v1alpha1/block_sdk.go | 319 +-
.../api/block/v1alpha1/snapshot_utils.go | 1 -
.../api/block/v1alpha1/volume_utils.go | 1 -
.../api/instance/v1/image_utils.go | 1 -
.../api/instance/v1/instance_metadata_sdk.go | 65 +-
.../api/instance/v1/instance_sdk.go | 343 +-
.../api/instance/v1/instance_utils.go | 163 +-
.../api/instance/v1/server_utils.go | 40 +-
.../api/instance/v1/snapshot_utils.go | 1 -
.../api/instance/v1/volume_utils.go | 10 +-
.../api/marketplace/v1/marketplace_sdk.go | 221 -
.../api/marketplace/v1/marketplace_utils.go | 93 -
.../api/marketplace/v2/marketplace_sdk.go | 711 +
.../api/marketplace/v2/marketplace_utils.go | 85 +
.../scaleway-sdk-go/internal/async/wait.go | 1 -
.../scaleway-sdk-go/internal/auth/jwt.go | 2 +-
.../scaleway-sdk-go/internal/auth/no_auth.go | 3 +-
.../scaleway-sdk-go/logger/default_logger.go | 20 +-
.../namegenerator/name_generator.go | 4 +-
.../scaleway/scaleway-sdk-go/scw/README.md | 22 +-
.../scaleway/scaleway-sdk-go/scw/client.go | 27 +-
.../scaleway/scaleway-sdk-go/scw/config.go | 16 +-
.../scaleway-sdk-go/scw/custom_types.go | 18 +-
.../scaleway/scaleway-sdk-go/scw/env.go | 34 +-
.../scaleway/scaleway-sdk-go/scw/errors.go | 38 +-
.../scaleway/scaleway-sdk-go/scw/locality.go | 40 +-
.../scaleway/scaleway-sdk-go/scw/path.go | 11 +-
.../scaleway/scaleway-sdk-go/scw/transport.go | 16 +-
.../scaleway/scaleway-sdk-go/scw/version.go | 32 +-
vendor/github.com/x448/float16/.travis.yml | 13 +
vendor/github.com/x448/float16/LICENSE | 22 +
vendor/github.com/x448/float16/README.md | 133 +
vendor/github.com/x448/float16/float16.go | 302 +
.../net/http/otelhttp/client.go | 15 +-
.../net/http/otelhttp/common.go | 21 +-
.../net/http/otelhttp/config.go | 30 +-
.../instrumentation/net/http/otelhttp/doc.go | 13 +-
.../net/http/otelhttp/handler.go | 161 +-
.../otelhttp/internal/request/body_wrapper.go | 75 +
.../internal/request/resp_writer_wrapper.go | 119 +
.../net/http/otelhttp/internal/semconv/env.go | 227 +
.../otelhttp/internal/semconv/httpconv.go | 348 +
.../http/otelhttp/internal/semconv/util.go | 98 +
.../http/otelhttp/internal/semconv/v1.20.0.go | 274 +
.../http/otelhttp/internal/semconvutil/gen.go | 13 +-
.../otelhttp/internal/semconvutil/httpconv.go | 309 +-
.../otelhttp/internal/semconvutil/netconv.go | 193 +-
.../net/http/otelhttp/labeler.go | 21 +-
.../net/http/otelhttp/start_time_context.go | 29 +
.../net/http/otelhttp/transport.go | 136 +-
.../net/http/otelhttp/version.go | 15 +-
.../instrumentation/net/http/otelhttp/wrap.go | 99 -
.../go.opentelemetry.io/otel/.codespellignore | 4 +
vendor/go.opentelemetry.io/otel/.codespellrc | 2 +-
vendor/go.opentelemetry.io/otel/.gitignore | 8 -
vendor/go.opentelemetry.io/otel/.gitmodules | 3 -
vendor/go.opentelemetry.io/otel/.golangci.yml | 21 +-
vendor/go.opentelemetry.io/otel/CHANGELOG.md | 459 +-
vendor/go.opentelemetry.io/otel/CODEOWNERS | 6 +-
.../go.opentelemetry.io/otel/CONTRIBUTING.md | 64 +-
vendor/go.opentelemetry.io/otel/Makefile | 107 +-
vendor/go.opentelemetry.io/otel/README.md | 61 +-
vendor/go.opentelemetry.io/otel/RELEASING.md | 24 +-
.../otel/attribute/README.md | 3 +
.../go.opentelemetry.io/otel/attribute/doc.go | 13 +-
.../otel/attribute/encoder.go | 13 +-
.../otel/attribute/filter.go | 13 +-
.../otel/attribute/iterator.go | 13 +-
.../go.opentelemetry.io/otel/attribute/key.go | 13 +-
.../go.opentelemetry.io/otel/attribute/kv.go | 13 +-
.../go.opentelemetry.io/otel/attribute/set.go | 262 +-
.../otel/attribute/value.go | 31 +-
.../otel/baggage/README.md | 3 +
.../otel/baggage/baggage.go | 640 +-
.../otel/baggage/context.go | 13 +-
.../go.opentelemetry.io/otel/baggage/doc.go | 13 +-
.../go.opentelemetry.io/otel/codes/README.md | 3 +
.../go.opentelemetry.io/otel/codes/codes.go | 15 +-
vendor/go.opentelemetry.io/otel/codes/doc.go | 13 +-
vendor/go.opentelemetry.io/otel/doc.go | 17 +-
.../go.opentelemetry.io/otel/error_handler.go | 13 +-
.../go.opentelemetry.io/otel/get_main_pkgs.sh | 13 +-
vendor/go.opentelemetry.io/otel/handler.go | 25 +-
.../otel/internal/attribute/attribute.go | 37 +-
.../otel/internal/baggage/baggage.go | 13 +-
.../otel/internal/baggage/context.go | 13 +-
.../go.opentelemetry.io/otel/internal/gen.go | 13 +-
.../otel/internal/global/handler.go | 84 +-
.../otel/internal/global/instruments.go | 79 +-
.../otel/internal/global/internal_logging.go | 39 +-
.../otel/internal/global/meter.go | 406 +-
.../otel/internal/global/propagator.go | 13 +-
.../otel/internal/global/state.go | 73 +-
.../otel/internal/global/trace.go | 20 +-
.../otel/internal/rawhelpers.go | 25 +-
.../otel/internal_logging.go | 13 +-
vendor/go.opentelemetry.io/otel/metric.go | 13 +-
.../go.opentelemetry.io/otel/metric/README.md | 3 +
.../otel/metric/asyncfloat64.go | 21 +-
.../otel/metric/asyncint64.go | 15 +-
.../go.opentelemetry.io/otel/metric/config.go | 13 +-
vendor/go.opentelemetry.io/otel/metric/doc.go | 31 +-
.../otel/metric/embedded/README.md | 3 +
.../otel/metric/embedded/embedded.go | 33 +-
.../otel/metric/instrument.go | 37 +-
.../go.opentelemetry.io/otel/metric/meter.go | 90 +-
.../otel/metric/noop/README.md | 3 +
.../otel/metric/noop/noop.go | 281 +
.../otel/metric/syncfloat64.go | 73 +-
.../otel/metric/syncint64.go | 67 +-
.../go.opentelemetry.io/otel/propagation.go | 13 +-
.../otel/propagation/README.md | 3 +
.../otel/propagation/baggage.go | 13 +-
.../otel/propagation/doc.go | 13 +-
.../otel/propagation/propagation.go | 13 +-
.../otel/propagation/trace_context.go | 109 +-
vendor/go.opentelemetry.io/otel/renovate.json | 32 +
.../go.opentelemetry.io/otel/requirements.txt | 2 +-
.../otel/semconv/v1.17.0/schema.go | 20 -
.../otel/semconv/v1.20.0/README.md | 3 +
.../otel/semconv/v1.20.0/attribute_group.go | 1198 +
.../otel/semconv/v1.20.0/doc.go | 9 +
.../semconv/{v1.17.0 => v1.20.0}/event.go | 15 +-
.../otel/semconv/v1.20.0/exception.go | 9 +
.../otel/semconv/v1.20.0/http.go | 10 +
.../semconv/{v1.17.0 => v1.20.0}/resource.go | 310 +-
.../otel/semconv/v1.20.0/schema.go | 9 +
.../semconv/{v1.17.0 => v1.20.0}/trace.go | 1746 +-
.../otel/semconv/v1.26.0/README.md | 3 +
.../otel/semconv/v1.26.0/attribute_group.go | 8996 +
.../otel/semconv/v1.26.0/doc.go | 9 +
.../otel/semconv/v1.26.0/exception.go | 9 +
.../otel/semconv/v1.26.0/metric.go | 1307 +
.../otel/semconv/v1.26.0/schema.go | 9 +
vendor/go.opentelemetry.io/otel/trace.go | 13 +-
.../go.opentelemetry.io/otel/trace/README.md | 3 +
.../go.opentelemetry.io/otel/trace/config.go | 13 +-
.../go.opentelemetry.io/otel/trace/context.go | 19 +-
vendor/go.opentelemetry.io/otel/trace/doc.go | 15 +-
.../otel/trace/embedded/README.md | 3 +
.../otel/trace/embedded/embedded.go | 13 +-
.../otel/trace/nonrecording.go | 13 +-
vendor/go.opentelemetry.io/otel/trace/noop.go | 20 +-
.../otel/trace/provider.go | 59 +
vendor/go.opentelemetry.io/otel/trace/span.go | 177 +
.../go.opentelemetry.io/otel/trace/trace.go | 256 +-
.../go.opentelemetry.io/otel/trace/tracer.go | 37 +
.../otel/trace/tracestate.go | 220 +-
.../otel/verify_examples.sh | 85 -
.../otel/verify_readmes.sh | 21 +
.../otel/verify_released_changelog.sh | 42 +
vendor/go.opentelemetry.io/otel/version.go | 15 +-
vendor/go.opentelemetry.io/otel/versions.yaml | 44 +-
vendor/golang.org/x/crypto/LICENSE | 4 +-
.../x/crypto/chacha20/chacha_noasm.go | 2 +-
.../{chacha_ppc64le.go => chacha_ppc64x.go} | 2 +-
.../{chacha_ppc64le.s => chacha_ppc64x.s} | 114 +-
.../chacha20poly1305/chacha20poly1305.go | 2 +-
.../chacha20poly1305/chacha20poly1305_amd64.s | 11503 +-
.../x/crypto/cryptobyte/asn1/asn1.go | 2 +-
.../golang.org/x/crypto/cryptobyte/string.go | 2 +-
vendor/golang.org/x/crypto/hkdf/hkdf.go | 2 +-
.../x/crypto/internal/poly1305/mac_noasm.go | 2 +-
.../x/crypto/internal/poly1305/sum_amd64.s | 133 +-
.../{sum_ppc64le.go => sum_ppc64x.go} | 2 +-
.../poly1305/{sum_ppc64le.s => sum_ppc64x.s} | 30 +-
vendor/golang.org/x/mod/LICENSE | 4 +-
vendor/golang.org/x/mod/module/module.go | 2 -
vendor/golang.org/x/net/LICENSE | 4 +-
.../x/net/http2/client_conn_pool.go | 8 +-
vendor/golang.org/x/net/http2/config.go | 122 +
vendor/golang.org/x/net/http2/config_go124.go | 61 +
.../x/net/http2/config_pre_go124.go | 16 +
vendor/golang.org/x/net/http2/http2.go | 53 +-
vendor/golang.org/x/net/http2/server.go | 215 +-
vendor/golang.org/x/net/http2/transport.go | 389 +-
vendor/golang.org/x/net/http2/unencrypted.go | 32 +
vendor/golang.org/x/net/http2/write.go | 10 +
vendor/golang.org/x/oauth2/LICENSE | 4 +-
vendor/golang.org/x/oauth2/README.md | 15 +-
.../clientcredentials/clientcredentials.go | 124 +
vendor/golang.org/x/oauth2/token.go | 7 +
vendor/golang.org/x/sync/LICENSE | 27 +
vendor/golang.org/x/sync/PATENTS | 22 +
vendor/golang.org/x/sync/errgroup/errgroup.go | 135 +
vendor/golang.org/x/sync/errgroup/go120.go | 13 +
.../golang.org/x/sync/errgroup/pre_go120.go | 14 +
vendor/golang.org/x/sys/LICENSE | 4 +-
.../golang.org/x/sys/cpu/asm_darwin_x86_gc.s | 17 +
vendor/golang.org/x/sys/cpu/cpu.go | 21 +
vendor/golang.org/x/sys/cpu/cpu_arm64.go | 12 +
vendor/golang.org/x/sys/cpu/cpu_darwin_x86.go | 61 +
vendor/golang.org/x/sys/cpu/cpu_gc_x86.go | 4 +-
.../x/sys/cpu/{cpu_x86.s => cpu_gc_x86.s} | 2 +-
vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go | 6 -
.../golang.org/x/sys/cpu/cpu_linux_arm64.go | 4 +
.../golang.org/x/sys/cpu/cpu_linux_noinit.go | 2 +-
.../golang.org/x/sys/cpu/cpu_linux_riscv64.go | 137 +
vendor/golang.org/x/sys/cpu/cpu_other_x86.go | 11 +
vendor/golang.org/x/sys/cpu/cpu_riscv64.go | 11 +-
vendor/golang.org/x/sys/cpu/cpu_x86.go | 6 +-
.../x/sys/cpu/syscall_darwin_x86_gc.go | 98 +
vendor/golang.org/x/sys/unix/README.md | 2 +-
vendor/golang.org/x/sys/unix/ioctl_linux.go | 96 +
vendor/golang.org/x/sys/unix/mkerrors.sh | 18 +-
vendor/golang.org/x/sys/unix/mremap.go | 5 +
vendor/golang.org/x/sys/unix/syscall_aix.go | 2 +-
.../golang.org/x/sys/unix/syscall_darwin.go | 61 +
vendor/golang.org/x/sys/unix/syscall_hurd.go | 1 +
vendor/golang.org/x/sys/unix/syscall_linux.go | 65 +-
.../x/sys/unix/syscall_linux_arm64.go | 2 +
.../x/sys/unix/syscall_linux_loong64.go | 2 +
.../x/sys/unix/syscall_linux_riscv64.go | 2 +
.../golang.org/x/sys/unix/syscall_openbsd.go | 1 +
vendor/golang.org/x/sys/unix/syscall_unix.go | 9 +
.../x/sys/unix/syscall_zos_s390x.go | 104 +-
.../golang.org/x/sys/unix/vgetrandom_linux.go | 13 +
.../x/sys/unix/vgetrandom_unsupported.go | 11 +
.../x/sys/unix/zerrors_darwin_amd64.go | 12 +
.../x/sys/unix/zerrors_darwin_arm64.go | 12 +
vendor/golang.org/x/sys/unix/zerrors_linux.go | 73 +-
.../x/sys/unix/zerrors_linux_386.go | 21 +
.../x/sys/unix/zerrors_linux_amd64.go | 21 +
.../x/sys/unix/zerrors_linux_arm.go | 21 +
.../x/sys/unix/zerrors_linux_arm64.go | 21 +
.../x/sys/unix/zerrors_linux_loong64.go | 21 +
.../x/sys/unix/zerrors_linux_mips.go | 21 +
.../x/sys/unix/zerrors_linux_mips64.go | 21 +
.../x/sys/unix/zerrors_linux_mips64le.go | 21 +
.../x/sys/unix/zerrors_linux_mipsle.go | 21 +
.../x/sys/unix/zerrors_linux_ppc.go | 21 +
.../x/sys/unix/zerrors_linux_ppc64.go | 21 +
.../x/sys/unix/zerrors_linux_ppc64le.go | 21 +
.../x/sys/unix/zerrors_linux_riscv64.go | 21 +
.../x/sys/unix/zerrors_linux_s390x.go | 21 +
.../x/sys/unix/zerrors_linux_sparc64.go | 21 +
.../x/sys/unix/zerrors_zos_s390x.go | 2 +
.../x/sys/unix/zsyscall_darwin_amd64.go | 101 +
.../x/sys/unix/zsyscall_darwin_amd64.s | 25 +
.../x/sys/unix/zsyscall_darwin_arm64.go | 101 +
.../x/sys/unix/zsyscall_darwin_arm64.s | 25 +
.../golang.org/x/sys/unix/zsyscall_linux.go | 43 +-
.../x/sys/unix/zsyscall_openbsd_386.go | 24 +
.../x/sys/unix/zsyscall_openbsd_386.s | 5 +
.../x/sys/unix/zsyscall_openbsd_amd64.go | 24 +
.../x/sys/unix/zsyscall_openbsd_amd64.s | 5 +
.../x/sys/unix/zsyscall_openbsd_arm.go | 24 +
.../x/sys/unix/zsyscall_openbsd_arm.s | 5 +
.../x/sys/unix/zsyscall_openbsd_arm64.go | 24 +
.../x/sys/unix/zsyscall_openbsd_arm64.s | 5 +
.../x/sys/unix/zsyscall_openbsd_mips64.go | 24 +
.../x/sys/unix/zsyscall_openbsd_mips64.s | 5 +
.../x/sys/unix/zsyscall_openbsd_ppc64.go | 24 +
.../x/sys/unix/zsyscall_openbsd_ppc64.s | 6 +
.../x/sys/unix/zsyscall_openbsd_riscv64.go | 24 +
.../x/sys/unix/zsyscall_openbsd_riscv64.s | 5 +
.../x/sys/unix/zsysnum_linux_386.go | 1 +
.../x/sys/unix/zsysnum_linux_amd64.go | 2 +
.../x/sys/unix/zsysnum_linux_arm.go | 1 +
.../x/sys/unix/zsysnum_linux_arm64.go | 3 +-
.../x/sys/unix/zsysnum_linux_loong64.go | 3 +
.../x/sys/unix/zsysnum_linux_mips.go | 1 +
.../x/sys/unix/zsysnum_linux_mips64.go | 1 +
.../x/sys/unix/zsysnum_linux_mips64le.go | 1 +
.../x/sys/unix/zsysnum_linux_mipsle.go | 1 +
.../x/sys/unix/zsysnum_linux_ppc.go | 1 +
.../x/sys/unix/zsysnum_linux_ppc64.go | 1 +
.../x/sys/unix/zsysnum_linux_ppc64le.go | 1 +
.../x/sys/unix/zsysnum_linux_riscv64.go | 3 +-
.../x/sys/unix/zsysnum_linux_s390x.go | 1 +
.../x/sys/unix/zsysnum_linux_sparc64.go | 1 +
.../x/sys/unix/ztypes_darwin_amd64.go | 13 +
.../x/sys/unix/ztypes_darwin_arm64.go | 13 +
.../x/sys/unix/ztypes_freebsd_386.go | 1 +
.../x/sys/unix/ztypes_freebsd_amd64.go | 1 +
.../x/sys/unix/ztypes_freebsd_arm.go | 1 +
.../x/sys/unix/ztypes_freebsd_arm64.go | 1 +
.../x/sys/unix/ztypes_freebsd_riscv64.go | 1 +
vendor/golang.org/x/sys/unix/ztypes_linux.go | 216 +-
.../x/sys/unix/ztypes_linux_riscv64.go | 33 +
.../golang.org/x/sys/unix/ztypes_zos_s390x.go | 6 +
.../golang.org/x/sys/windows/dll_windows.go | 2 +-
.../golang.org/x/sys/windows/registry/key.go | 205 +
.../x/sys/windows/registry/mksyscall.go | 9 +
.../x/sys/windows/registry/syscall.go | 32 +
.../x/sys/windows/registry/value.go | 386 +
.../sys/windows/registry/zsyscall_windows.go | 117 +
.../x/sys/windows/security_windows.go | 24 +-
.../x/sys/windows/syscall_windows.go | 50 +-
.../golang.org/x/sys/windows/types_windows.go | 198 +-
.../x/sys/windows/zsyscall_windows.go | 133 +
vendor/golang.org/x/term/LICENSE | 4 +-
vendor/golang.org/x/term/README.md | 11 +-
vendor/golang.org/x/term/term_windows.go | 1 +
vendor/golang.org/x/text/LICENSE | 4 +-
vendor/golang.org/x/time/LICENSE | 4 +-
vendor/golang.org/x/time/rate/rate.go | 17 +-
vendor/golang.org/x/tools/LICENSE | 4 +-
.../x/tools/go/ast/astutil/enclosing.go | 24 +-
.../x/tools/go/ast/astutil/imports.go | 5 +
.../golang.org/x/tools/go/ast/astutil/util.go | 11 +-
.../x/tools/go/gcexportdata/gcexportdata.go | 245 +
.../x/tools/go/gcexportdata/importer.go | 75 +
vendor/golang.org/x/tools/go/packages/doc.go | 251 +
.../x/tools/go/packages/external.go | 156 +
.../golang.org/x/tools/go/packages/golist.go | 1080 +
.../x/tools/go/packages/golist_overlay.go | 83 +
.../x/tools/go/packages/loadmode_string.go | 54 +
.../x/tools/go/packages/packages.go | 1562 +
.../golang.org/x/tools/go/packages/visit.go | 68 +
.../x/tools/go/types/objectpath/objectpath.go | 817 +
.../x/tools/go/types/typeutil/callee.go | 68 +
.../x/tools/go/types/typeutil/imports.go | 30 +
.../x/tools/go/types/typeutil/map.go | 517 +
.../tools/go/types/typeutil/methodsetcache.go | 71 +
.../x/tools/go/types/typeutil/ui.go | 53 +
.../x/tools/internal/aliases/aliases.go | 38 +
.../x/tools/internal/aliases/aliases_go122.go | 80 +
.../x/tools/internal/gcimporter/bimport.go | 89 +
.../x/tools/internal/gcimporter/exportdata.go | 99 +
.../x/tools/internal/gcimporter/gcimporter.go | 271 +
.../x/tools/internal/gcimporter/iexport.go | 1588 +
.../x/tools/internal/gcimporter/iimport.go | 1113 +
.../internal/gcimporter/iimport_go122.go | 53 +
.../tools/internal/gcimporter/predeclared.go | 91 +
.../tools/internal/gcimporter/ureader_yes.go | 754 +
.../x/tools/internal/gocommand/invoke.go | 37 +-
.../x/tools/internal/imports/fix.go | 521 +-
.../x/tools/internal/imports/imports.go | 33 +-
.../x/tools/internal/imports/mod.go | 17 +-
.../x/tools/internal/imports/source.go | 63 +
.../x/tools/internal/imports/source_env.go | 125 +
.../internal/packagesinternal/packages.go | 22 +
.../x/tools/internal/pkgbits/codes.go | 77 +
.../x/tools/internal/pkgbits/decoder.go | 519 +
.../x/tools/internal/pkgbits/doc.go | 32 +
.../x/tools/internal/pkgbits/encoder.go | 392 +
.../x/tools/internal/pkgbits/flags.go | 9 +
.../x/tools/internal/pkgbits/reloc.go | 42 +
.../x/tools/internal/pkgbits/support.go | 17 +
.../x/tools/internal/pkgbits/sync.go | 136 +
.../internal/pkgbits/syncmarker_string.go | 92 +
.../x/tools/internal/pkgbits/version.go | 85 +
.../x/tools/internal/stdlib/manifest.go | 111 +
.../x/tools/internal/typeparams/common.go | 140 +
.../x/tools/internal/typeparams/coretype.go | 150 +
.../x/tools/internal/typeparams/free.go | 131 +
.../x/tools/internal/typeparams/normalize.go | 218 +
.../x/tools/internal/typeparams/termlist.go | 163 +
.../x/tools/internal/typeparams/typeterm.go | 169 +
.../x/tools/internal/typesinternal/element.go | 133 +
.../tools/internal/typesinternal/errorcode.go | 1560 +
.../typesinternal/errorcode_string.go | 179 +
.../x/tools/internal/typesinternal/recv.go | 41 +
.../x/tools/internal/typesinternal/toonew.go | 89 +
.../x/tools/internal/typesinternal/types.go | 121 +
.../x/tools/internal/versions/constraint.go | 13 +
.../internal/versions/constraint_go121.go | 14 +
.../x/tools/internal/versions/features.go | 43 +
.../x/tools/internal/versions/gover.go | 172 +
.../x/tools/internal/versions/types.go | 33 +
.../x/tools/internal/versions/versions.go | 57 +
.../api/compute/v1/compute-api.json | 21252 +-
.../api/compute/v1/compute-gen.go | 226263 +++------------
.../api/compute/v1/compute2-gen.go | 58398 ++++
.../api/compute/v1/compute3-gen.go | 49911 ++++
.../api/googleapi/googleapi.go | 15 +
vendor/google.golang.org/api/internal/cba.go | 72 +-
.../google.golang.org/api/internal/creds.go | 139 +-
.../api/internal/gensupport/media.go | 19 +-
.../api/internal/gensupport/params.go | 21 +
.../api/internal/gensupport/resumable.go | 32 +-
.../api/internal/gensupport/retry.go | 34 +-
.../internal/gensupport/retryable_linux.go | 16 -
.../api/internal/gensupport/send.go | 24 +-
.../api/internal/settings.go | 93 +-
.../google.golang.org/api/internal/version.go | 2 +-
.../option/internaloption/internaloption.go | 16 +
vendor/google.golang.org/api/option/option.go | 31 +-
.../api/transport/http/dial.go | 95 +
.../genproto/googleapis/rpc/code/code.pb.go | 4 +-
.../rpc/errdetails/error_details.pb.go | 4 +-
.../googleapis/rpc/status/status.pb.go | 4 +-
vendor/google.golang.org/grpc/CONTRIBUTING.md | 18 +-
vendor/google.golang.org/grpc/MAINTAINERS.md | 34 +-
vendor/google.golang.org/grpc/Makefile | 7 +-
vendor/google.golang.org/grpc/README.md | 2 +-
vendor/google.golang.org/grpc/SECURITY.md | 2 +-
.../google.golang.org/grpc/backoff/backoff.go | 2 +-
.../grpc/balancer/balancer.go | 45 +-
.../grpc/balancer/base/balancer.go | 6 +-
.../pickfirst/internal/internal.go} | 17 +-
.../{ => balancer/pickfirst}/pickfirst.go | 92 +-
.../pickfirst/pickfirstleaf/pickfirstleaf.go | 625 +
.../grpc/balancer/roundrobin/roundrobin.go | 4 +-
.../grpc/balancer_wrapper.go | 159 +-
.../grpc_binarylog_v1/binarylog.pb.go | 26 +-
vendor/google.golang.org/grpc/clientconn.go | 505 +-
vendor/google.golang.org/grpc/codec.go | 69 +-
vendor/google.golang.org/grpc/codegen.sh | 17 -
vendor/google.golang.org/grpc/codes/codes.go | 2 +-
.../grpc/credentials/credentials.go | 4 +-
.../grpc/credentials/insecure/insecure.go | 2 +-
.../google.golang.org/grpc/credentials/tls.go | 63 +-
vendor/google.golang.org/grpc/dialoptions.go | 127 +-
vendor/google.golang.org/grpc/doc.go | 2 +-
.../grpc/encoding/encoding.go | 5 +-
.../grpc/encoding/encoding_v2.go | 81 +
.../grpc/encoding/proto/proto.go | 68 +-
.../grpc/experimental/stats/metricregistry.go | 269 +
.../grpc/experimental/stats/metrics.go | 114 +
.../grpc/grpclog/component.go | 10 +-
.../google.golang.org/grpc/grpclog/grpclog.go | 104 +-
.../grpc/grpclog/internal/grpclog.go | 26 +
.../grpc/grpclog/internal/logger.go | 87 +
.../internal/loggerv2.go} | 178 +-
.../google.golang.org/grpc/grpclog/logger.go | 59 +-
.../grpc/grpclog/loggerv2.go | 181 +-
.../grpc/internal/backoff/backoff.go | 4 +-
.../balancer/gracefulswitch/config.go | 84 +
.../balancer/gracefulswitch/gracefulswitch.go | 44 +-
.../grpc/internal/binarylog/method_logger.go | 17 +-
.../grpc/internal/binarylog/sink.go | 2 +-
.../grpc/internal/channelz/channel.go | 270 +
.../grpc/internal/channelz/channelmap.go | 395 +
.../grpc/internal/channelz/funcs.go | 697 +-
.../grpc/internal/channelz/id.go | 75 -
.../grpc/internal/channelz/logging.go | 28 +-
.../grpc/internal/channelz/server.go | 121 +
.../grpc/internal/channelz/socket.go | 137 +
.../grpc/internal/channelz/subchannel.go | 153 +
.../{types_linux.go => syscall_linux.go} | 14 +
...{types_nonlinux.go => syscall_nonlinux.go} | 8 +-
.../grpc/internal/channelz/trace.go | 213 +
.../grpc/internal/channelz/types.go | 727 -
.../grpc/internal/envconfig/envconfig.go | 18 +-
.../grpc/internal/experimental.go | 8 +-
.../{prefixLogger.go => prefix_logger.go} | 40 +-
.../grpc/internal/grpcrand/grpcrand.go | 95 -
.../internal/grpcsync/callback_serializer.go | 24 +-
.../grpc/internal/grpcsync/pubsub.go | 4 +-
.../grpc/internal/grpcutil/compressor.go | 5 -
.../grpc/internal/grpcutil/method.go | 2 +-
.../grpc/internal/idle/idle.go | 4 +-
.../grpc/internal/internal.go | 59 +-
.../grpc/internal/pretty/pretty.go | 35 +-
.../internal/resolver/dns/dns_resolver.go | 59 +-
.../resolver/dns/internal/internal.go | 19 +-
.../resolver/passthrough/passthrough.go | 2 +-
.../grpc/internal/resolver/unix/unix.go | 4 +
.../grpc/internal/stats/labels.go | 42 +
.../internal/stats/metrics_recorder_list.go | 105 +
.../grpc/internal/status/status.go | 50 +-
.../grpc/internal/syscall/syscall_nonlinux.go | 6 +-
...ive_nonunix.go => tcp_keepalive_others.go} | 2 +-
.../grpc/internal/tcp_keepalive_unix.go | 2 +-
.../grpc/internal/tcp_keepalive_windows.go | 54 +
.../grpc/internal/transport/controlbuf.go | 292 +-
.../grpc/internal/transport/handler_server.go | 64 +-
.../grpc/internal/transport/http2_client.go | 283 +-
.../grpc/internal/transport/http2_server.go | 184 +-
.../grpc/internal/transport/http_util.go | 27 +-
.../grpc/internal/transport/proxy.go | 10 +-
.../grpc/internal/transport/transport.go | 290 +-
.../grpc/internal/xds_handshake_cluster.go | 40 -
.../grpc/keepalive/keepalive.go | 20 +-
.../google.golang.org/grpc/mem/buffer_pool.go | 194 +
.../grpc/mem/buffer_slice.go | 226 +
vendor/google.golang.org/grpc/mem/buffers.go | 268 +
.../grpc/metadata/metadata.go | 20 +-
vendor/google.golang.org/grpc/peer/peer.go | 30 +
.../google.golang.org/grpc/picker_wrapper.go | 84 +-
vendor/google.golang.org/grpc/preloader.go | 28 +-
vendor/google.golang.org/grpc/regenerate.sh | 123 -
.../grpc/resolver/dns/dns_resolver.go | 30 +-
.../grpc/resolver/resolver.go | 24 +-
.../grpc/resolver_wrapper.go | 18 +-
vendor/google.golang.org/grpc/rpc_util.go | 361 +-
vendor/google.golang.org/grpc/server.go | 259 +-
.../google.golang.org/grpc/service_config.go | 69 +-
.../grpc/shared_buffer_pool.go | 154 -
vendor/google.golang.org/grpc/stats/stats.go | 12 +-
vendor/google.golang.org/grpc/stream.go | 231 +-
.../grpc/stream_interfaces.go | 238 +
vendor/google.golang.org/grpc/trace.go | 26 +-
.../google.golang.org/grpc/trace_notrace.go | 52 +
.../util_linux.go => trace_withtrace.go} | 32 +-
vendor/google.golang.org/grpc/version.go | 2 +-
vendor/google.golang.org/grpc/vet.sh | 192 -
.../protobuf/encoding/protojson/decode.go | 6 +-
.../protobuf/encoding/protojson/encode.go | 24 +-
.../encoding/protojson/well_known_types.go | 10 +-
.../protobuf/encoding/prototext/decode.go | 4 +-
.../protobuf/encoding/prototext/encode.go | 20 +-
.../protobuf/internal/descfmt/stringer.go | 1 +
.../protobuf/internal/descopts/options.go | 20 +-
.../internal/editiondefaults/defaults.go | 12 +
.../editiondefaults/editions_defaults.binpb | Bin 0 -> 99 bytes
.../internal/editionssupport/editions.go | 18 +
.../protobuf/internal/encoding/json/decode.go | 4 +-
.../protobuf/internal/encoding/tag/tag.go | 4 +-
.../protobuf/internal/encoding/text/decode.go | 2 +-
.../protobuf/internal/errors/errors.go | 21 +-
.../protobuf/internal/filedesc/desc.go | 150 +-
.../protobuf/internal/filedesc/desc_init.go | 91 +-
.../protobuf/internal/filedesc/desc_lazy.go | 47 +-
.../internal/filedesc/desc_list_gen.go | 11 +
.../protobuf/internal/filedesc/editions.go | 160 +
.../protobuf/internal/filedesc/placeholder.go | 1 +
.../protobuf/internal/filetype/build.go | 4 +-
.../protobuf/internal/genid/descriptor_gen.go | 201 +-
.../protobuf/internal/genid/doc.go | 2 +-
.../internal/genid/go_features_gen.go | 53 +
.../protobuf/internal/genid/map_entry.go | 2 +-
.../protobuf/internal/genid/struct_gen.go | 5 +
.../protobuf/internal/genid/type_gen.go | 38 +
.../protobuf/internal/genid/wrappers.go | 2 +-
.../protobuf/internal/impl/api_export.go | 6 +-
.../protobuf/internal/impl/checkinit.go | 2 +-
.../protobuf/internal/impl/codec_extension.go | 55 +-
.../protobuf/internal/impl/codec_field.go | 67 +-
.../protobuf/internal/impl/codec_map.go | 15 +-
.../protobuf/internal/impl/codec_message.go | 3 +
.../internal/impl/codec_messageset.go | 22 +
.../protobuf/internal/impl/codec_reflect.go | 210 -
.../protobuf/internal/impl/codec_tables.go | 2 +-
.../protobuf/internal/impl/codec_unsafe.go | 3 -
.../protobuf/internal/impl/convert.go | 4 +-
.../protobuf/internal/impl/convert_list.go | 2 +-
.../protobuf/internal/impl/convert_map.go | 2 +-
.../protobuf/internal/impl/encode.go | 50 +-
.../protobuf/internal/impl/equal.go | 224 +
.../protobuf/internal/impl/extension.go | 8 +-
.../protobuf/internal/impl/legacy_enum.go | 3 +-
.../internal/impl/legacy_extension.go | 3 +-
.../protobuf/internal/impl/legacy_file.go | 4 +-
.../protobuf/internal/impl/legacy_message.go | 14 +-
.../protobuf/internal/impl/message.go | 12 +-
.../protobuf/internal/impl/message_reflect.go | 45 +-
.../internal/impl/message_reflect_field.go | 2 +-
.../internal/impl/message_reflect_gen.go | 146 +-
.../protobuf/internal/impl/pointer_reflect.go | 215 -
.../protobuf/internal/impl/pointer_unsafe.go | 7 +-
.../protobuf/internal/order/range.go | 4 +-
.../protobuf/internal/strs/strings.go | 2 +-
.../protobuf/internal/strs/strings_pure.go | 28 -
.../internal/strs/strings_unsafe_go120.go | 3 +-
.../internal/strs/strings_unsafe_go121.go | 3 +-
.../protobuf/internal/version/version.go | 4 +-
.../protobuf/proto/decode.go | 2 +
.../protobuf/proto/encode.go | 44 +-
.../google.golang.org/protobuf/proto/equal.go | 9 +
.../protobuf/proto/extension.go | 88 +-
.../protobuf/proto/messageset.go | 7 +-
.../google.golang.org/protobuf/proto/size.go | 2 +
.../protobuf/protoadapt/convert.go | 31 +
.../protobuf/reflect/protodesc/desc.go | 23 +-
.../protobuf/reflect/protodesc/desc_init.go | 65 +-
.../reflect/protodesc/desc_resolve.go | 9 +-
.../reflect/protodesc/desc_validate.go | 75 +-
.../protobuf/reflect/protodesc/editions.go | 147 +-
.../reflect/protodesc/editions_defaults.binpb | 4 -
.../protobuf/reflect/protodesc/proto.go | 22 +
.../protobuf/reflect/protoreflect/methods.go | 10 +
.../protobuf/reflect/protoreflect/proto.go | 4 +-
.../reflect/protoreflect/source_gen.go | 23 +-
.../protobuf/reflect/protoreflect/type.go | 12 +-
.../reflect/protoreflect/value_pure.go | 60 -
.../reflect/protoreflect/value_union.go | 14 +-
.../protoreflect/value_unsafe_go120.go | 9 +-
.../protoreflect/value_unsafe_go121.go | 11 +-
.../reflect/protoregistry/registry.go | 14 +-
.../protobuf/runtime/protoiface/methods.go | 18 +
.../types/descriptorpb/descriptor.pb.go | 2243 +-
.../types/gofeaturespb/go_features.pb.go | 256 +
.../protobuf/types/known/anypb/any.pb.go | 26 +-
.../types/known/durationpb/duration.pb.go | 26 +-
.../types/known/timestamppb/timestamp.pb.go | 26 +-
.../evanphx/json-patch.v4}/.gitignore | 0
.../evanphx/json-patch.v4}/LICENSE | 0
.../evanphx/json-patch.v4}/README.md | 4 +-
.../evanphx/json-patch.v4}/errors.go | 0
.../evanphx/json-patch.v4}/merge.go | 0
.../evanphx/json-patch.v4}/patch.go | 4 +-
.../api/admissionregistration/v1/doc.go | 1 +
.../admissionregistration/v1/generated.pb.go | 6011 +-
.../admissionregistration/v1/generated.proto | 583 +-
.../api/admissionregistration/v1/register.go | 4 +
.../api/admissionregistration/v1/types.go | 610 +-
.../v1/types_swagger_doc_generated.go | 178 +-
.../v1/zz_generated.deepcopy.go | 432 +
.../v1/zz_generated.prerelease-lifecycle.go | 70 +
.../v1alpha1/generated.pb.go | 235 +-
.../v1alpha1/generated.proto | 18 +-
.../admissionregistration/v1alpha1/types.go | 4 +-
.../v1beta1/generated.pb.go | 309 +-
.../v1beta1/generated.proto | 53 +-
.../admissionregistration/v1beta1/types.go | 19 +-
.../v1beta1/types_swagger_doc_generated.go | 4 +-
vendor/k8s.io/api/apidiscovery/v2/doc.go | 23 +
.../api/apidiscovery/v2/generated.pb.go | 1742 +
.../api/apidiscovery/v2/generated.proto | 156 +
vendor/k8s.io/api/apidiscovery/v2/register.go | 56 +
vendor/k8s.io/api/apidiscovery/v2/types.go | 157 +
.../apidiscovery/v2/zz_generated.deepcopy.go | 190 +
.../v2/zz_generated.prerelease-lifecycle.go | 34 +
.../api/apidiscovery/v2beta1/generated.pb.go | 113 +-
.../api/apidiscovery/v2beta1/generated.proto | 10 +-
.../v1alpha1/generated.pb.go | 119 +-
.../v1alpha1/generated.proto | 7 +-
.../api/apiserverinternal/v1alpha1/types.go | 1 -
vendor/k8s.io/api/apps/v1/doc.go | 1 +
vendor/k8s.io/api/apps/v1/generated.pb.go | 341 +-
vendor/k8s.io/api/apps/v1/generated.proto | 76 +-
vendor/k8s.io/api/apps/v1/types.go | 26 +-
.../apps/v1/types_swagger_doc_generated.go | 4 +-
.../v1/zz_generated.prerelease-lifecycle.go | 82 +
.../k8s.io/api/apps/v1beta1/generated.pb.go | 299 +-
.../k8s.io/api/apps/v1beta1/generated.proto | 47 +-
vendor/k8s.io/api/apps/v1beta1/types.go | 9 +-
.../v1beta1/types_swagger_doc_generated.go | 2 +-
.../k8s.io/api/apps/v1beta2/generated.pb.go | 365 +-
.../k8s.io/api/apps/v1beta2/generated.proto | 75 +-
vendor/k8s.io/api/apps/v1beta2/types.go | 13 +-
.../v1beta2/types_swagger_doc_generated.go | 2 +-
vendor/k8s.io/api/authentication/v1/doc.go | 1 +
.../api/authentication/v1/generated.pb.go | 154 +-
.../api/authentication/v1/generated.proto | 12 +-
vendor/k8s.io/api/authentication/v1/types.go | 7 +
.../v1/zz_generated.prerelease-lifecycle.go | 40 +
.../authentication/v1alpha1/generated.pb.go | 59 +-
.../authentication/v1alpha1/generated.proto | 4 +-
.../authentication/v1beta1/generated.pb.go | 117 +-
.../authentication/v1beta1/generated.proto | 9 +-
.../api/authentication/v1beta1/types.go | 3 +
vendor/k8s.io/api/authorization/v1/doc.go | 2 +-
.../api/authorization/v1/generated.pb.go | 737 +-
.../api/authorization/v1/generated.proto | 85 +-
vendor/k8s.io/api/authorization/v1/types.go | 79 +
.../v1/types_swagger_doc_generated.go | 38 +-
.../authorization/v1/zz_generated.deepcopy.go | 61 +-
.../v1/zz_generated.prerelease-lifecycle.go | 46 +
.../api/authorization/v1beta1/generated.pb.go | 294 +-
.../api/authorization/v1beta1/generated.proto | 26 +-
.../k8s.io/api/authorization/v1beta1/types.go | 16 +
.../v1beta1/types_swagger_doc_generated.go | 18 +-
.../v1beta1/zz_generated.deepcopy.go | 15 +-
vendor/k8s.io/api/autoscaling/v1/doc.go | 1 +
.../k8s.io/api/autoscaling/v1/generated.pb.go | 255 +-
.../k8s.io/api/autoscaling/v1/generated.proto | 50 +-
vendor/k8s.io/api/autoscaling/v1/types.go | 3 +
.../v1/zz_generated.prerelease-lifecycle.go | 40 +
vendor/k8s.io/api/autoscaling/v2/doc.go | 1 +
.../k8s.io/api/autoscaling/v2/generated.pb.go | 243 +-
.../k8s.io/api/autoscaling/v2/generated.proto | 18 +-
vendor/k8s.io/api/autoscaling/v2/types.go | 2 +
.../v2/zz_generated.prerelease-lifecycle.go | 34 +
.../api/autoscaling/v2beta1/generated.pb.go | 243 +-
.../api/autoscaling/v2beta1/generated.proto | 51 +-
.../k8s.io/api/autoscaling/v2beta1/types.go | 3 +
.../api/autoscaling/v2beta2/generated.pb.go | 255 +-
.../api/autoscaling/v2beta2/generated.proto | 22 +-
.../k8s.io/api/autoscaling/v2beta2/types.go | 4 +
vendor/k8s.io/api/batch/v1/doc.go | 2 +-
vendor/k8s.io/api/batch/v1/generated.pb.go | 747 +-
vendor/k8s.io/api/batch/v1/generated.proto | 131 +-
vendor/k8s.io/api/batch/v1/types.go | 129 +-
.../batch/v1/types_swagger_doc_generated.go | 41 +-
.../api/batch/v1/zz_generated.deepcopy.go | 59 +
.../v1/zz_generated.prerelease-lifecycle.go | 46 +
.../k8s.io/api/batch/v1beta1/generated.pb.go | 115 +-
.../k8s.io/api/batch/v1beta1/generated.proto | 14 +-
vendor/k8s.io/api/certificates/v1/doc.go | 2 +-
.../api/certificates/v1/generated.pb.go | 133 +-
.../api/certificates/v1/generated.proto | 8 +-
vendor/k8s.io/api/certificates/v1/types.go | 2 +
.../v1/zz_generated.prerelease-lifecycle.go | 34 +
.../api/certificates/v1alpha1/generated.pb.go | 74 +-
.../api/certificates/v1alpha1/generated.proto | 4 +-
.../api/certificates/v1beta1/generated.pb.go | 135 +-
.../api/certificates/v1beta1/generated.proto | 8 +-
vendor/k8s.io/api/coordination/v1/doc.go | 1 +
.../api/coordination/v1/generated.pb.go | 179 +-
.../api/coordination/v1/generated.proto | 26 +-
vendor/k8s.io/api/coordination/v1/types.go | 30 +-
.../v1/types_swagger_doc_generated.go | 6 +-
.../coordination/v1/zz_generated.deepcopy.go | 10 +
.../v1/zz_generated.prerelease-lifecycle.go | 34 +
.../k8s.io/api/coordination/v1alpha1/doc.go | 24 +
.../api/coordination/v1alpha1/generated.pb.go | 1036 +
.../api/coordination/v1alpha1/generated.proto | 105 +
.../api/coordination/v1alpha1/register.go | 53 +
.../k8s.io/api/coordination/v1alpha1/types.go | 100 +
.../v1alpha1/types_swagger_doc_generated.go | 64 +
.../v1alpha1/zz_generated.deepcopy.go | 116 +
.../zz_generated.prerelease-lifecycle.go | 58 +
.../api/coordination/v1beta1/generated.pb.go | 182 +-
.../api/coordination/v1beta1/generated.proto | 23 +-
.../k8s.io/api/coordination/v1beta1/types.go | 13 +
.../v1beta1/types_swagger_doc_generated.go | 4 +-
.../v1beta1/zz_generated.deepcopy.go | 11 +
.../api/core/v1/annotation_key_constants.go | 21 +-
vendor/k8s.io/api/core/v1/doc.go | 2 +
vendor/k8s.io/api/core/v1/generated.pb.go | 7210 +-
vendor/k8s.io/api/core/v1/generated.proto | 728 +-
vendor/k8s.io/api/core/v1/types.go | 666 +-
.../core/v1/types_swagger_doc_generated.go | 238 +-
.../api/core/v1/zz_generated.deepcopy.go | 300 +-
.../v1/zz_generated.prerelease-lifecycle.go | 274 +
vendor/k8s.io/api/discovery/v1/doc.go | 1 +
.../k8s.io/api/discovery/v1/generated.pb.go | 137 +-
.../k8s.io/api/discovery/v1/generated.proto | 6 +-
vendor/k8s.io/api/discovery/v1/types.go | 2 +
.../v1/zz_generated.prerelease-lifecycle.go | 34 +
.../api/discovery/v1beta1/generated.pb.go | 135 +-
.../api/discovery/v1beta1/generated.proto | 6 +-
vendor/k8s.io/api/events/v1/doc.go | 2 +-
vendor/k8s.io/api/events/v1/generated.pb.go | 111 +-
vendor/k8s.io/api/events/v1/generated.proto | 18 +-
vendor/k8s.io/api/events/v1/types.go | 2 +
.../v1/zz_generated.prerelease-lifecycle.go | 34 +
.../k8s.io/api/events/v1beta1/generated.pb.go | 111 +-
.../k8s.io/api/events/v1beta1/generated.proto | 18 +-
.../api/extensions/v1beta1/generated.pb.go | 447 +-
.../api/extensions/v1beta1/generated.proto | 81 +-
vendor/k8s.io/api/extensions/v1beta1/types.go | 21 +-
vendor/k8s.io/api/flowcontrol/v1/doc.go | 1 +
.../k8s.io/api/flowcontrol/v1/generated.pb.go | 257 +-
.../k8s.io/api/flowcontrol/v1/generated.proto | 12 +-
vendor/k8s.io/api/flowcontrol/v1/types.go | 4 +
.../v1/zz_generated.prerelease-lifecycle.go | 46 +
.../api/flowcontrol/v1beta1/generated.pb.go | 249 +-
.../api/flowcontrol/v1beta1/generated.proto | 12 +-
.../api/flowcontrol/v1beta2/generated.pb.go | 261 +-
.../api/flowcontrol/v1beta2/generated.proto | 12 +-
.../api/flowcontrol/v1beta3/generated.pb.go | 259 +-
.../api/flowcontrol/v1beta3/generated.proto | 12 +-
vendor/k8s.io/api/networking/v1/doc.go | 1 +
.../k8s.io/api/networking/v1/generated.pb.go | 275 +-
.../k8s.io/api/networking/v1/generated.proto | 32 +-
vendor/k8s.io/api/networking/v1/types.go | 18 +-
.../v1/zz_generated.prerelease-lifecycle.go | 58 +
.../api/networking/v1alpha1/generated.pb.go | 109 +-
.../api/networking/v1alpha1/generated.proto | 14 +-
.../k8s.io/api/networking/v1alpha1/types.go | 4 +
.../v1alpha1/types_swagger_doc_generated.go | 2 +-
.../api/networking/v1beta1/generated.pb.go | 3212 +-
.../api/networking/v1beta1/generated.proto | 126 +-
.../k8s.io/api/networking/v1beta1/register.go | 4 +
vendor/k8s.io/api/networking/v1beta1/types.go | 137 +-
.../v1beta1/types_swagger_doc_generated.go | 80 +
.../networking/v1beta1/well_known_labels.go | 33 +
.../v1beta1/zz_generated.deepcopy.go | 203 +
.../zz_generated.prerelease-lifecycle.go | 72 +
vendor/k8s.io/api/node/v1/doc.go | 2 +-
vendor/k8s.io/api/node/v1/generated.pb.go | 99 +-
vendor/k8s.io/api/node/v1/generated.proto | 8 +-
vendor/k8s.io/api/node/v1/types.go | 2 +
.../v1/zz_generated.prerelease-lifecycle.go | 34 +
.../k8s.io/api/node/v1alpha1/generated.pb.go | 103 +-
.../k8s.io/api/node/v1alpha1/generated.proto | 8 +-
.../k8s.io/api/node/v1beta1/generated.pb.go | 99 +-
.../k8s.io/api/node/v1beta1/generated.proto | 8 +-
vendor/k8s.io/api/policy/v1/doc.go | 1 +
vendor/k8s.io/api/policy/v1/generated.pb.go | 125 +-
vendor/k8s.io/api/policy/v1/generated.proto | 18 +-
vendor/k8s.io/api/policy/v1/types.go | 3 +
.../v1/zz_generated.prerelease-lifecycle.go | 40 +
.../k8s.io/api/policy/v1beta1/generated.pb.go | 125 +-
.../k8s.io/api/policy/v1beta1/generated.proto | 18 +-
vendor/k8s.io/api/rbac/v1/doc.go | 2 +-
vendor/k8s.io/api/rbac/v1/generated.pb.go | 137 +-
vendor/k8s.io/api/rbac/v1/generated.proto | 28 +-
vendor/k8s.io/api/rbac/v1/types.go | 20 +-
.../v1/zz_generated.prerelease-lifecycle.go | 70 +
.../k8s.io/api/rbac/v1alpha1/generated.pb.go | 141 +-
.../k8s.io/api/rbac/v1alpha1/generated.proto | 28 +-
vendor/k8s.io/api/rbac/v1alpha1/types.go | 12 +-
.../k8s.io/api/rbac/v1beta1/generated.pb.go | 137 +-
.../k8s.io/api/rbac/v1beta1/generated.proto | 28 +-
vendor/k8s.io/api/rbac/v1beta1/types.go | 12 +-
.../api/resource/v1alpha2/generated.pb.go | 4817 -
.../api/resource/v1alpha2/generated.proto | 400 -
vendor/k8s.io/api/resource/v1alpha2/types.go | 462 -
.../v1alpha2/types_swagger_doc_generated.go | 232 -
.../v1alpha2/zz_generated.deepcopy.go | 498 -
.../resource/{v1alpha2 => v1alpha3}/doc.go | 4 +-
.../api/resource/v1alpha3/generated.pb.go | 8987 +
.../api/resource/v1alpha3/generated.proto | 912 +
.../{v1alpha2 => v1alpha3}/register.go | 13 +-
vendor/k8s.io/api/resource/v1alpha3/types.go | 1048 +
.../v1alpha3/types_swagger_doc_generated.go | 404 +
.../v1alpha3/zz_generated.deepcopy.go | 927 +
vendor/k8s.io/api/scheduling/v1/doc.go | 2 +-
.../k8s.io/api/scheduling/v1/generated.pb.go | 73 +-
.../k8s.io/api/scheduling/v1/generated.proto | 4 +-
vendor/k8s.io/api/scheduling/v1/types.go | 2 +
.../v1/zz_generated.prerelease-lifecycle.go | 34 +
.../api/scheduling/v1alpha1/generated.pb.go | 71 +-
.../api/scheduling/v1alpha1/generated.proto | 4 +-
.../api/scheduling/v1beta1/generated.pb.go | 73 +-
.../api/scheduling/v1beta1/generated.proto | 4 +-
vendor/k8s.io/api/storage/v1/doc.go | 1 +
vendor/k8s.io/api/storage/v1/generated.pb.go | 259 +-
vendor/k8s.io/api/storage/v1/generated.proto | 42 +-
vendor/k8s.io/api/storage/v1/types.go | 20 +-
.../storage/v1/types_swagger_doc_generated.go | 4 +-
.../v1/zz_generated.prerelease-lifecycle.go | 82 +
.../api/storage/v1alpha1/generated.pb.go | 160 +-
.../api/storage/v1alpha1/generated.proto | 24 +-
vendor/k8s.io/api/storage/v1alpha1/types.go | 2 -
.../api/storage/v1beta1/generated.pb.go | 866 +-
.../api/storage/v1beta1/generated.proto | 79 +-
vendor/k8s.io/api/storage/v1beta1/register.go | 3 +
vendor/k8s.io/api/storage/v1beta1/types.go | 59 +-
.../v1beta1/types_swagger_doc_generated.go | 21 +
.../storage/v1beta1/zz_generated.deepcopy.go | 66 +
.../zz_generated.prerelease-lifecycle.go | 36 +
.../api/storagemigration/v1alpha1/doc.go | 23 +
.../storagemigration/v1alpha1/generated.pb.go | 1688 +
.../storagemigration/v1alpha1/generated.proto | 127 +
.../api/storagemigration/v1alpha1/register.go | 58 +
.../api/storagemigration/v1alpha1/types.go | 131 +
.../v1alpha1/types_swagger_doc_generated.go | 95 +
.../v1alpha1/zz_generated.deepcopy.go | 160 +
.../zz_generated.prerelease-lifecycle.go | 58 +
.../meta/testrestmapper/test_restmapper.go | 165 +
.../pkg/api/resource/generated.pb.go | 43 +-
.../apimachinery/pkg/api/resource/quantity.go | 29 +
.../apimachinery/pkg/api/validation/OWNERS | 11 +
.../internalversion/validation/validation.go | 76 +
.../pkg/apis/meta/v1/controller_ref.go | 13 +-
.../pkg/apis/meta/v1/generated.pb.go | 708 +-
.../pkg/apis/meta/v1/generated.proto | 45 +-
.../apimachinery/pkg/apis/meta/v1/helpers.go | 83 +-
.../pkg/apis/meta/v1/micro_time.go | 28 +
.../apimachinery/pkg/apis/meta/v1/time.go | 29 +
.../apimachinery/pkg/apis/meta/v1/types.go | 62 +
.../meta/v1/types_swagger_doc_generated.go | 11 +
.../pkg/apis/meta/v1/validation/validation.go | 41 +-
.../pkg/apis/meta/v1/zz_generated.deepcopy.go | 21 +
.../pkg/apis/meta/v1beta1/generated.pb.go | 45 +-
.../pkg/apis/meta/v1beta1/generated.proto | 4 +-
.../apimachinery/pkg/labels/selector.go | 20 +
.../apimachinery/pkg/runtime/extension.go | 100 +-
.../apimachinery/pkg/runtime/generated.pb.go | 65 +-
.../k8s.io/apimachinery/pkg/runtime/helper.go | 12 +-
.../pkg/runtime/schema/generated.pb.go | 31 +-
.../runtime/serializer/cbor/direct/direct.go | 36 +
.../serializer/cbor/internal/modes/buffers.go | 65 +
.../serializer/cbor/internal/modes/custom.go | 422 +
.../serializer/cbor/internal/modes/decode.go | 158 +
.../cbor/internal/modes/diagnostic.go | 36 +
.../serializer/cbor/internal/modes/encode.go | 155 +
.../k8s.io/apimachinery/pkg/runtime/types.go | 1 +
.../apimachinery/pkg/util/framer/framer.go | 18 +-
.../pkg/util/intstr/generated.pb.go | 47 +-
.../apimachinery/pkg/util/intstr/intstr.go | 26 +
.../pkg/util/managedfields/node.yaml | 2 +-
.../apimachinery/pkg/util/runtime/runtime.go | 135 +-
.../k8s.io/apimachinery/pkg/util/sets/doc.go | 2 +-
.../apimachinery/pkg/util/sets/ordered.go | 53 -
.../k8s.io/apimachinery/pkg/util/sets/set.go | 17 +-
.../pkg/util/strategicpatch/patch.go | 4 +
.../apimachinery/pkg/util/validation/OWNERS | 11 +
.../pkg/util/validation/validation.go | 56 +-
vendor/k8s.io/apimachinery/pkg/watch/watch.go | 40 +-
.../v1/auditannotation.go | 48 +
.../v1/expressionwarning.go | 48 +
.../v1/matchcondition.go | 4 +-
.../v1/matchresources.go | 90 +
.../v1/mutatingwebhook.go | 4 +-
.../v1/mutatingwebhookconfiguration.go | 10 +-
.../v1/namedrulewithoperations.go | 94 +
.../admissionregistration/v1/paramkind.go | 48 +
.../admissionregistration/v1/paramref.go | 71 +
.../admissionregistration/v1/rule.go | 4 +-
.../v1/rulewithoperations.go | 4 +-
.../v1/servicereference.go | 4 +-
.../admissionregistration/v1/typechecking.go | 44 +
.../v1/validatingadmissionpolicy.go | 262 +
.../v1/validatingadmissionpolicybinding.go | 253 +
.../validatingadmissionpolicybindingspec.go | 72 +
.../v1/validatingadmissionpolicyspec.go | 117 +
.../v1/validatingadmissionpolicystatus.go | 66 +
.../v1/validatingwebhook.go | 4 +-
.../v1/validatingwebhookconfiguration.go | 10 +-
.../admissionregistration/v1/validation.go | 70 +
.../admissionregistration/v1/variable.go | 48 +
.../v1/webhookclientconfig.go | 4 +-
.../v1alpha1/auditannotation.go | 4 +-
.../v1alpha1/expressionwarning.go | 4 +-
.../v1alpha1/matchcondition.go | 4 +-
.../v1alpha1/matchresources.go | 4 +-
.../v1alpha1/namedrulewithoperations.go | 4 +-
.../v1alpha1/paramkind.go | 4 +-
.../v1alpha1/paramref.go | 4 +-
.../v1alpha1/typechecking.go | 4 +-
.../v1alpha1/validatingadmissionpolicy.go | 10 +-
.../validatingadmissionpolicybinding.go | 10 +-
.../validatingadmissionpolicybindingspec.go | 4 +-
.../v1alpha1/validatingadmissionpolicyspec.go | 4 +-
.../validatingadmissionpolicystatus.go | 4 +-
.../v1alpha1/validation.go | 4 +-
.../v1alpha1/variable.go | 4 +-
.../v1beta1/auditannotation.go | 4 +-
.../v1beta1/expressionwarning.go | 4 +-
.../v1beta1/matchcondition.go | 4 +-
.../v1beta1/matchresources.go | 4 +-
.../v1beta1/mutatingwebhook.go | 4 +-
.../v1beta1/mutatingwebhookconfiguration.go | 10 +-
.../v1beta1/namedrulewithoperations.go | 4 +-
.../v1beta1/paramkind.go | 4 +-
.../admissionregistration/v1beta1/paramref.go | 4 +-
.../v1beta1/servicereference.go | 4 +-
.../v1beta1/typechecking.go | 4 +-
.../v1beta1/validatingadmissionpolicy.go | 10 +-
.../validatingadmissionpolicybinding.go | 10 +-
.../validatingadmissionpolicybindingspec.go | 4 +-
.../v1beta1/validatingadmissionpolicyspec.go | 4 +-
.../validatingadmissionpolicystatus.go | 4 +-
.../v1beta1/validatingwebhook.go | 4 +-
.../v1beta1/validatingwebhookconfiguration.go | 10 +-
.../v1beta1/validation.go | 4 +-
.../admissionregistration/v1beta1/variable.go | 4 +-
.../v1beta1/webhookclientconfig.go | 4 +-
.../v1alpha1/serverstorageversion.go | 4 +-
.../v1alpha1/storageversion.go | 10 +-
.../v1alpha1/storageversioncondition.go | 4 +-
.../v1alpha1/storageversionstatus.go | 4 +-
.../apps/v1/controllerrevision.go | 10 +-
.../applyconfigurations/apps/v1/daemonset.go | 10 +-
.../apps/v1/daemonsetcondition.go | 4 +-
.../apps/v1/daemonsetspec.go | 4 +-
.../apps/v1/daemonsetstatus.go | 4 +-
.../apps/v1/daemonsetupdatestrategy.go | 4 +-
.../applyconfigurations/apps/v1/deployment.go | 10 +-
.../apps/v1/deploymentcondition.go | 4 +-
.../apps/v1/deploymentspec.go | 4 +-
.../apps/v1/deploymentstatus.go | 4 +-
.../apps/v1/deploymentstrategy.go | 4 +-
.../applyconfigurations/apps/v1/replicaset.go | 10 +-
.../apps/v1/replicasetcondition.go | 4 +-
.../apps/v1/replicasetspec.go | 4 +-
.../apps/v1/replicasetstatus.go | 4 +-
.../apps/v1/rollingupdatedaemonset.go | 4 +-
.../apps/v1/rollingupdatedeployment.go | 4 +-
.../v1/rollingupdatestatefulsetstrategy.go | 4 +-
.../apps/v1/statefulset.go | 10 +-
.../apps/v1/statefulsetcondition.go | 4 +-
.../apps/v1/statefulsetordinals.go | 4 +-
...setpersistentvolumeclaimretentionpolicy.go | 4 +-
.../apps/v1/statefulsetspec.go | 4 +-
.../apps/v1/statefulsetstatus.go | 4 +-
.../apps/v1/statefulsetupdatestrategy.go | 4 +-
.../apps/v1beta1/controllerrevision.go | 10 +-
.../apps/v1beta1/deployment.go | 10 +-
.../apps/v1beta1/deploymentcondition.go | 4 +-
.../apps/v1beta1/deploymentspec.go | 4 +-
.../apps/v1beta1/deploymentstatus.go | 4 +-
.../apps/v1beta1/deploymentstrategy.go | 4 +-
.../apps/v1beta1/rollbackconfig.go | 4 +-
.../apps/v1beta1/rollingupdatedeployment.go | 4 +-
.../rollingupdatestatefulsetstrategy.go | 4 +-
.../apps/v1beta1/statefulset.go | 10 +-
.../apps/v1beta1/statefulsetcondition.go | 4 +-
.../apps/v1beta1/statefulsetordinals.go | 4 +-
...setpersistentvolumeclaimretentionpolicy.go | 4 +-
.../apps/v1beta1/statefulsetspec.go | 4 +-
.../apps/v1beta1/statefulsetstatus.go | 4 +-
.../apps/v1beta1/statefulsetupdatestrategy.go | 4 +-
.../apps/v1beta2/controllerrevision.go | 10 +-
.../apps/v1beta2/daemonset.go | 10 +-
.../apps/v1beta2/daemonsetcondition.go | 4 +-
.../apps/v1beta2/daemonsetspec.go | 4 +-
.../apps/v1beta2/daemonsetstatus.go | 4 +-
.../apps/v1beta2/daemonsetupdatestrategy.go | 4 +-
.../apps/v1beta2/deployment.go | 10 +-
.../apps/v1beta2/deploymentcondition.go | 4 +-
.../apps/v1beta2/deploymentspec.go | 4 +-
.../apps/v1beta2/deploymentstatus.go | 4 +-
.../apps/v1beta2/deploymentstrategy.go | 4 +-
.../apps/v1beta2/replicaset.go | 10 +-
.../apps/v1beta2/replicasetcondition.go | 4 +-
.../apps/v1beta2/replicasetspec.go | 4 +-
.../apps/v1beta2/replicasetstatus.go | 4 +-
.../apps/v1beta2/rollingupdatedaemonset.go | 4 +-
.../apps/v1beta2/rollingupdatedeployment.go | 4 +-
.../rollingupdatestatefulsetstrategy.go | 4 +-
.../applyconfigurations/apps/v1beta2/scale.go | 10 +-
.../apps/v1beta2/statefulset.go | 10 +-
.../apps/v1beta2/statefulsetcondition.go | 4 +-
.../apps/v1beta2/statefulsetordinals.go | 4 +-
...setpersistentvolumeclaimretentionpolicy.go | 4 +-
.../apps/v1beta2/statefulsetspec.go | 4 +-
.../apps/v1beta2/statefulsetstatus.go | 4 +-
.../apps/v1beta2/statefulsetupdatestrategy.go | 4 +-
.../v1/crossversionobjectreference.go | 4 +-
.../autoscaling/v1/horizontalpodautoscaler.go | 10 +-
.../v1/horizontalpodautoscalerspec.go | 4 +-
.../v1/horizontalpodautoscalerstatus.go | 4 +-
.../autoscaling/v1/scale.go | 10 +-
.../autoscaling/v1/scalespec.go | 4 +-
.../autoscaling/v1/scalestatus.go | 4 +-
.../v2/containerresourcemetricsource.go | 4 +-
.../v2/containerresourcemetricstatus.go | 4 +-
.../v2/crossversionobjectreference.go | 4 +-
.../autoscaling/v2/externalmetricsource.go | 4 +-
.../autoscaling/v2/externalmetricstatus.go | 4 +-
.../autoscaling/v2/horizontalpodautoscaler.go | 10 +-
.../v2/horizontalpodautoscalerbehavior.go | 4 +-
.../v2/horizontalpodautoscalercondition.go | 4 +-
.../v2/horizontalpodautoscalerspec.go | 4 +-
.../v2/horizontalpodautoscalerstatus.go | 4 +-
.../autoscaling/v2/hpascalingpolicy.go | 4 +-
.../autoscaling/v2/hpascalingrules.go | 4 +-
.../autoscaling/v2/metricidentifier.go | 4 +-
.../autoscaling/v2/metricspec.go | 4 +-
.../autoscaling/v2/metricstatus.go | 4 +-
.../autoscaling/v2/metrictarget.go | 4 +-
.../autoscaling/v2/metricvaluestatus.go | 4 +-
.../autoscaling/v2/objectmetricsource.go | 4 +-
.../autoscaling/v2/objectmetricstatus.go | 4 +-
.../autoscaling/v2/podsmetricsource.go | 4 +-
.../autoscaling/v2/podsmetricstatus.go | 4 +-
.../autoscaling/v2/resourcemetricsource.go | 4 +-
.../autoscaling/v2/resourcemetricstatus.go | 4 +-
.../v2beta1/containerresourcemetricsource.go | 4 +-
.../v2beta1/containerresourcemetricstatus.go | 4 +-
.../v2beta1/crossversionobjectreference.go | 4 +-
.../v2beta1/externalmetricsource.go | 4 +-
.../v2beta1/externalmetricstatus.go | 4 +-
.../v2beta1/horizontalpodautoscaler.go | 10 +-
.../horizontalpodautoscalercondition.go | 4 +-
.../v2beta1/horizontalpodautoscalerspec.go | 4 +-
.../v2beta1/horizontalpodautoscalerstatus.go | 4 +-
.../autoscaling/v2beta1/metricspec.go | 4 +-
.../autoscaling/v2beta1/metricstatus.go | 4 +-
.../autoscaling/v2beta1/objectmetricsource.go | 4 +-
.../autoscaling/v2beta1/objectmetricstatus.go | 4 +-
.../autoscaling/v2beta1/podsmetricsource.go | 4 +-
.../autoscaling/v2beta1/podsmetricstatus.go | 4 +-
.../v2beta1/resourcemetricsource.go | 4 +-
.../v2beta1/resourcemetricstatus.go | 4 +-
.../v2beta2/containerresourcemetricsource.go | 4 +-
.../v2beta2/containerresourcemetricstatus.go | 4 +-
.../v2beta2/crossversionobjectreference.go | 4 +-
.../v2beta2/externalmetricsource.go | 4 +-
.../v2beta2/externalmetricstatus.go | 4 +-
.../v2beta2/horizontalpodautoscaler.go | 10 +-
.../horizontalpodautoscalerbehavior.go | 4 +-
.../horizontalpodautoscalercondition.go | 4 +-
.../v2beta2/horizontalpodautoscalerspec.go | 4 +-
.../v2beta2/horizontalpodautoscalerstatus.go | 4 +-
.../autoscaling/v2beta2/hpascalingpolicy.go | 4 +-
.../autoscaling/v2beta2/hpascalingrules.go | 4 +-
.../autoscaling/v2beta2/metricidentifier.go | 4 +-
.../autoscaling/v2beta2/metricspec.go | 4 +-
.../autoscaling/v2beta2/metricstatus.go | 4 +-
.../autoscaling/v2beta2/metrictarget.go | 4 +-
.../autoscaling/v2beta2/metricvaluestatus.go | 4 +-
.../autoscaling/v2beta2/objectmetricsource.go | 4 +-
.../autoscaling/v2beta2/objectmetricstatus.go | 4 +-
.../autoscaling/v2beta2/podsmetricsource.go | 4 +-
.../autoscaling/v2beta2/podsmetricstatus.go | 4 +-
.../v2beta2/resourcemetricsource.go | 4 +-
.../v2beta2/resourcemetricstatus.go | 4 +-
.../applyconfigurations/batch/v1/cronjob.go | 10 +-
.../batch/v1/cronjobspec.go | 4 +-
.../batch/v1/cronjobstatus.go | 4 +-
.../applyconfigurations/batch/v1/job.go | 10 +-
.../batch/v1/jobcondition.go | 4 +-
.../applyconfigurations/batch/v1/jobspec.go | 22 +-
.../applyconfigurations/batch/v1/jobstatus.go | 4 +-
.../batch/v1/jobtemplatespec.go | 10 +-
.../batch/v1/podfailurepolicy.go | 4 +-
.../podfailurepolicyonexitcodesrequirement.go | 4 +-
.../podfailurepolicyonpodconditionspattern.go | 4 +-
.../batch/v1/podfailurepolicyrule.go | 4 +-
.../batch/v1/successpolicy.go | 44 +
.../batch/v1/successpolicyrule.go | 48 +
.../batch/v1/uncountedterminatedpods.go | 4 +-
.../batch/v1beta1/cronjob.go | 10 +-
.../batch/v1beta1/cronjobspec.go | 4 +-
.../batch/v1beta1/cronjobstatus.go | 4 +-
.../batch/v1beta1/jobtemplatespec.go | 10 +-
.../v1/certificatesigningrequest.go | 10 +-
.../v1/certificatesigningrequestcondition.go | 4 +-
.../v1/certificatesigningrequestspec.go | 4 +-
.../v1/certificatesigningrequeststatus.go | 4 +-
.../v1alpha1/clustertrustbundle.go | 10 +-
.../v1alpha1/clustertrustbundlespec.go | 4 +-
.../v1beta1/certificatesigningrequest.go | 10 +-
.../certificatesigningrequestcondition.go | 4 +-
.../v1beta1/certificatesigningrequestspec.go | 4 +-
.../certificatesigningrequeststatus.go | 4 +-
.../coordination/v1/lease.go | 10 +-
.../coordination/v1/leasespec.go | 33 +-
.../coordination/v1alpha1/leasecandidate.go | 255 +
.../v1alpha1/leasecandidatespec.go | 91 +
.../coordination/v1beta1/lease.go | 10 +-
.../coordination/v1beta1/leasespec.go | 33 +-
.../applyconfigurations/core/v1/affinity.go | 4 +-
.../core/v1/apparmorprofile.go | 52 +
.../core/v1/attachedvolume.go | 4 +-
.../v1/awselasticblockstorevolumesource.go | 4 +-
.../core/v1/azurediskvolumesource.go | 4 +-
.../v1/azurefilepersistentvolumesource.go | 4 +-
.../core/v1/azurefilevolumesource.go | 4 +-
.../core/v1/capabilities.go | 4 +-
.../core/v1/cephfspersistentvolumesource.go | 4 +-
.../core/v1/cephfsvolumesource.go | 4 +-
.../core/v1/cinderpersistentvolumesource.go | 4 +-
.../core/v1/cindervolumesource.go | 4 +-
.../core/v1/claimsource.go | 48 -
.../core/v1/clientipconfig.go | 4 +-
.../core/v1/clustertrustbundleprojection.go | 4 +-
.../core/v1/componentcondition.go | 4 +-
.../core/v1/componentstatus.go | 10 +-
.../applyconfigurations/core/v1/configmap.go | 10 +-
.../core/v1/configmapenvsource.go | 4 +-
.../core/v1/configmapkeyselector.go | 4 +-
.../core/v1/configmapnodeconfigsource.go | 4 +-
.../core/v1/configmapprojection.go | 4 +-
.../core/v1/configmapvolumesource.go | 4 +-
.../applyconfigurations/core/v1/container.go | 4 +-
.../core/v1/containerimage.go | 4 +-
.../core/v1/containerport.go | 4 +-
.../core/v1/containerresizepolicy.go | 4 +-
.../core/v1/containerstate.go | 4 +-
.../core/v1/containerstaterunning.go | 4 +-
.../core/v1/containerstateterminated.go | 4 +-
.../core/v1/containerstatewaiting.go | 4 +-
.../core/v1/containerstatus.go | 67 +-
.../core/v1/containeruser.go | 39 +
.../core/v1/csipersistentvolumesource.go | 4 +-
.../core/v1/csivolumesource.go | 4 +-
.../core/v1/daemonendpoint.go | 4 +-
.../core/v1/downwardapiprojection.go | 4 +-
.../core/v1/downwardapivolumefile.go | 4 +-
.../core/v1/downwardapivolumesource.go | 4 +-
.../core/v1/emptydirvolumesource.go | 4 +-
.../core/v1/endpointaddress.go | 4 +-
.../core/v1/endpointport.go | 4 +-
.../applyconfigurations/core/v1/endpoints.go | 10 +-
.../core/v1/endpointsubset.go | 4 +-
.../core/v1/envfromsource.go | 4 +-
.../applyconfigurations/core/v1/envvar.go | 4 +-
.../core/v1/envvarsource.go | 4 +-
.../core/v1/ephemeralcontainer.go | 4 +-
.../core/v1/ephemeralcontainercommon.go | 4 +-
.../core/v1/ephemeralvolumesource.go | 4 +-
.../applyconfigurations/core/v1/event.go | 10 +-
.../core/v1/eventseries.go | 4 +-
.../core/v1/eventsource.go | 4 +-
.../applyconfigurations/core/v1/execaction.go | 4 +-
.../core/v1/fcvolumesource.go | 4 +-
.../core/v1/flexpersistentvolumesource.go | 4 +-
.../core/v1/flexvolumesource.go | 4 +-
.../core/v1/flockervolumesource.go | 4 +-
.../core/v1/gcepersistentdiskvolumesource.go | 4 +-
.../core/v1/gitrepovolumesource.go | 4 +-
.../v1/glusterfspersistentvolumesource.go | 4 +-
.../core/v1/glusterfsvolumesource.go | 4 +-
.../applyconfigurations/core/v1/grpcaction.go | 4 +-
.../applyconfigurations/core/v1/hostalias.go | 4 +-
.../applyconfigurations/core/v1/hostip.go | 4 +-
.../core/v1/hostpathvolumesource.go | 4 +-
.../core/v1/httpgetaction.go | 4 +-
.../applyconfigurations/core/v1/httpheader.go | 4 +-
.../core/v1/imagevolumesource.go | 52 +
.../core/v1/iscsipersistentvolumesource.go | 4 +-
.../core/v1/iscsivolumesource.go | 4 +-
.../applyconfigurations/core/v1/keytopath.go | 4 +-
.../applyconfigurations/core/v1/lifecycle.go | 4 +-
.../core/v1/lifecyclehandler.go | 4 +-
.../applyconfigurations/core/v1/limitrange.go | 10 +-
.../core/v1/limitrangeitem.go | 4 +-
.../core/v1/limitrangespec.go | 4 +-
.../core/v1/linuxcontaineruser.go | 59 +
.../core/v1/loadbalanceringress.go | 4 +-
.../core/v1/loadbalancerstatus.go | 4 +-
.../core/v1/localobjectreference.go | 4 +-
.../core/v1/localvolumesource.go | 4 +-
.../core/v1/modifyvolumestatus.go | 4 +-
.../applyconfigurations/core/v1/namespace.go | 10 +-
.../core/v1/namespacecondition.go | 4 +-
.../core/v1/namespacespec.go | 4 +-
.../core/v1/namespacestatus.go | 4 +-
.../core/v1/nfsvolumesource.go | 4 +-
.../applyconfigurations/core/v1/node.go | 10 +-
.../core/v1/nodeaddress.go | 4 +-
.../core/v1/nodeaffinity.go | 4 +-
.../core/v1/nodecondition.go | 4 +-
.../core/v1/nodeconfigsource.go | 4 +-
.../core/v1/nodeconfigstatus.go | 4 +-
.../core/v1/nodedaemonendpoints.go | 4 +-
.../core/v1/nodefeatures.go | 39 +
.../core/v1/noderuntimehandler.go | 48 +
.../core/v1/noderuntimehandlerfeatures.go | 48 +
.../core/v1/nodeselector.go | 4 +-
.../core/v1/nodeselectorrequirement.go | 4 +-
.../core/v1/nodeselectorterm.go | 4 +-
.../applyconfigurations/core/v1/nodespec.go | 4 +-
.../applyconfigurations/core/v1/nodestatus.go | 27 +-
.../core/v1/nodesysteminfo.go | 4 +-
.../core/v1/objectfieldselector.go | 4 +-
.../core/v1/objectreference.go | 4 +-
.../core/v1/persistentvolume.go | 10 +-
.../core/v1/persistentvolumeclaim.go | 10 +-
.../core/v1/persistentvolumeclaimcondition.go | 4 +-
.../core/v1/persistentvolumeclaimspec.go | 4 +-
.../core/v1/persistentvolumeclaimstatus.go | 4 +-
.../core/v1/persistentvolumeclaimtemplate.go | 10 +-
.../v1/persistentvolumeclaimvolumesource.go | 4 +-
.../core/v1/persistentvolumesource.go | 4 +-
.../core/v1/persistentvolumespec.go | 4 +-
.../core/v1/persistentvolumestatus.go | 4 +-
.../v1/photonpersistentdiskvolumesource.go | 4 +-
.../applyconfigurations/core/v1/pod.go | 10 +-
.../core/v1/podaffinity.go | 4 +-
.../core/v1/podaffinityterm.go | 4 +-
.../core/v1/podantiaffinity.go | 4 +-
.../core/v1/podcondition.go | 4 +-
.../core/v1/poddnsconfig.go | 4 +-
.../core/v1/poddnsconfigoption.go | 4 +-
.../applyconfigurations/core/v1/podip.go | 4 +-
.../applyconfigurations/core/v1/podos.go | 4 +-
.../core/v1/podreadinessgate.go | 4 +-
.../core/v1/podresourceclaim.go | 25 +-
.../core/v1/podresourceclaimstatus.go | 4 +-
.../core/v1/podschedulinggate.go | 4 +-
.../core/v1/podsecuritycontext.go | 42 +-
.../applyconfigurations/core/v1/podspec.go | 4 +-
.../applyconfigurations/core/v1/podstatus.go | 4 +-
.../core/v1/podtemplate.go | 10 +-
.../core/v1/podtemplatespec.go | 10 +-
.../applyconfigurations/core/v1/portstatus.go | 4 +-
.../core/v1/portworxvolumesource.go | 4 +-
.../core/v1/preferredschedulingterm.go | 4 +-
.../applyconfigurations/core/v1/probe.go | 4 +-
.../core/v1/probehandler.go | 4 +-
.../core/v1/projectedvolumesource.go | 4 +-
.../core/v1/quobytevolumesource.go | 4 +-
.../core/v1/rbdpersistentvolumesource.go | 4 +-
.../core/v1/rbdvolumesource.go | 4 +-
.../core/v1/replicationcontroller.go | 10 +-
.../core/v1/replicationcontrollercondition.go | 4 +-
.../core/v1/replicationcontrollerspec.go | 4 +-
.../core/v1/replicationcontrollerstatus.go | 4 +-
.../core/v1/resourceclaim.go | 15 +-
.../core/v1/resourcefieldselector.go | 4 +-
.../core/v1/resourcehealth.go | 52 +
.../core/v1/resourcequota.go | 10 +-
.../core/v1/resourcequotaspec.go | 4 +-
.../core/v1/resourcequotastatus.go | 4 +-
.../core/v1/resourcerequirements.go | 4 +-
.../core/v1/resourcestatus.go | 57 +
.../core/v1/scaleiopersistentvolumesource.go | 4 +-
.../core/v1/scaleiovolumesource.go | 4 +-
.../v1/scopedresourceselectorrequirement.go | 4 +-
.../core/v1/scopeselector.go | 4 +-
.../core/v1/seccompprofile.go | 4 +-
.../applyconfigurations/core/v1/secret.go | 10 +-
.../core/v1/secretenvsource.go | 4 +-
.../core/v1/secretkeyselector.go | 4 +-
.../core/v1/secretprojection.go | 4 +-
.../core/v1/secretreference.go | 4 +-
.../core/v1/secretvolumesource.go | 4 +-
.../core/v1/securitycontext.go | 13 +-
.../core/v1/selinuxoptions.go | 4 +-
.../applyconfigurations/core/v1/service.go | 10 +-
.../core/v1/serviceaccount.go | 10 +-
.../core/v1/serviceaccounttokenprojection.go | 4 +-
.../core/v1/serviceport.go | 4 +-
.../core/v1/servicespec.go | 13 +-
.../core/v1/servicestatus.go | 4 +-
.../core/v1/sessionaffinityconfig.go | 4 +-
.../core/v1/sleepaction.go | 4 +-
.../v1/storageospersistentvolumesource.go | 4 +-
.../core/v1/storageosvolumesource.go | 4 +-
.../applyconfigurations/core/v1/sysctl.go | 4 +-
.../applyconfigurations/core/v1/taint.go | 4 +-
.../core/v1/tcpsocketaction.go | 4 +-
.../applyconfigurations/core/v1/toleration.go | 4 +-
.../v1/topologyselectorlabelrequirement.go | 4 +-
.../core/v1/topologyselectorterm.go | 4 +-
.../core/v1/topologyspreadconstraint.go | 4 +-
.../core/v1/typedlocalobjectreference.go | 4 +-
.../core/v1/typedobjectreference.go | 4 +-
.../applyconfigurations/core/v1/volume.go | 12 +-
.../core/v1/volumedevice.go | 4 +-
.../core/v1/volumemount.go | 25 +-
.../core/v1/volumemountstatus.go | 70 +
.../core/v1/volumenodeaffinity.go | 4 +-
.../core/v1/volumeprojection.go | 4 +-
.../core/v1/volumeresourcerequirements.go | 4 +-
.../core/v1/volumesource.go | 13 +-
.../core/v1/vspherevirtualdiskvolumesource.go | 4 +-
.../core/v1/weightedpodaffinityterm.go | 4 +-
.../core/v1/windowssecuritycontextoptions.go | 4 +-
.../discovery/v1/endpoint.go | 4 +-
.../discovery/v1/endpointconditions.go | 4 +-
.../discovery/v1/endpointhints.go | 4 +-
.../discovery/v1/endpointport.go | 4 +-
.../discovery/v1/endpointslice.go | 10 +-
.../discovery/v1/forzone.go | 4 +-
.../discovery/v1beta1/endpoint.go | 4 +-
.../discovery/v1beta1/endpointconditions.go | 4 +-
.../discovery/v1beta1/endpointhints.go | 4 +-
.../discovery/v1beta1/endpointport.go | 4 +-
.../discovery/v1beta1/endpointslice.go | 10 +-
.../discovery/v1beta1/forzone.go | 4 +-
.../applyconfigurations/events/v1/event.go | 10 +-
.../events/v1/eventseries.go | 4 +-
.../events/v1beta1/event.go | 10 +-
.../events/v1beta1/eventseries.go | 4 +-
.../extensions/v1beta1/daemonset.go | 10 +-
.../extensions/v1beta1/daemonsetcondition.go | 4 +-
.../extensions/v1beta1/daemonsetspec.go | 4 +-
.../extensions/v1beta1/daemonsetstatus.go | 4 +-
.../v1beta1/daemonsetupdatestrategy.go | 4 +-
.../extensions/v1beta1/deployment.go | 10 +-
.../extensions/v1beta1/deploymentcondition.go | 4 +-
.../extensions/v1beta1/deploymentspec.go | 4 +-
.../extensions/v1beta1/deploymentstatus.go | 4 +-
.../extensions/v1beta1/deploymentstrategy.go | 4 +-
.../extensions/v1beta1/httpingresspath.go | 4 +-
.../v1beta1/httpingressrulevalue.go | 4 +-
.../extensions/v1beta1/ingress.go | 10 +-
.../extensions/v1beta1/ingressbackend.go | 4 +-
.../v1beta1/ingressloadbalanceringress.go | 4 +-
.../v1beta1/ingressloadbalancerstatus.go | 4 +-
.../extensions/v1beta1/ingressportstatus.go | 4 +-
.../extensions/v1beta1/ingressrule.go | 6 +-
.../extensions/v1beta1/ingressrulevalue.go | 4 +-
.../extensions/v1beta1/ingressspec.go | 4 +-
.../extensions/v1beta1/ingressstatus.go | 4 +-
.../extensions/v1beta1/ingresstls.go | 4 +-
.../extensions/v1beta1/ipblock.go | 4 +-
.../extensions/v1beta1/networkpolicy.go | 10 +-
.../v1beta1/networkpolicyegressrule.go | 4 +-
.../v1beta1/networkpolicyingressrule.go | 4 +-
.../extensions/v1beta1/networkpolicypeer.go | 4 +-
.../extensions/v1beta1/networkpolicyport.go | 4 +-
.../extensions/v1beta1/networkpolicyspec.go | 4 +-
.../extensions/v1beta1/replicaset.go | 10 +-
.../extensions/v1beta1/replicasetcondition.go | 4 +-
.../extensions/v1beta1/replicasetspec.go | 4 +-
.../extensions/v1beta1/replicasetstatus.go | 4 +-
.../extensions/v1beta1/rollbackconfig.go | 4 +-
.../v1beta1/rollingupdatedaemonset.go | 4 +-
.../v1beta1/rollingupdatedeployment.go | 4 +-
.../extensions/v1beta1/scale.go | 10 +-
.../v1/exemptprioritylevelconfiguration.go | 4 +-
.../flowcontrol/v1/flowdistinguishermethod.go | 4 +-
.../flowcontrol/v1/flowschema.go | 10 +-
.../flowcontrol/v1/flowschemacondition.go | 4 +-
.../flowcontrol/v1/flowschemaspec.go | 4 +-
.../flowcontrol/v1/flowschemastatus.go | 4 +-
.../flowcontrol/v1/groupsubject.go | 4 +-
.../v1/limitedprioritylevelconfiguration.go | 4 +-
.../flowcontrol/v1/limitresponse.go | 4 +-
.../flowcontrol/v1/nonresourcepolicyrule.go | 4 +-
.../flowcontrol/v1/policyruleswithsubjects.go | 4 +-
.../v1/prioritylevelconfiguration.go | 10 +-
.../v1/prioritylevelconfigurationcondition.go | 4 +-
.../v1/prioritylevelconfigurationreference.go | 4 +-
.../v1/prioritylevelconfigurationspec.go | 4 +-
.../v1/prioritylevelconfigurationstatus.go | 4 +-
.../flowcontrol/v1/queuingconfiguration.go | 4 +-
.../flowcontrol/v1/resourcepolicyrule.go | 4 +-
.../flowcontrol/v1/serviceaccountsubject.go | 4 +-
.../flowcontrol/v1/subject.go | 4 +-
.../flowcontrol/v1/usersubject.go | 4 +-
.../exemptprioritylevelconfiguration.go | 4 +-
.../v1beta1/flowdistinguishermethod.go | 4 +-
.../flowcontrol/v1beta1/flowschema.go | 10 +-
.../v1beta1/flowschemacondition.go | 4 +-
.../flowcontrol/v1beta1/flowschemaspec.go | 4 +-
.../flowcontrol/v1beta1/flowschemastatus.go | 4 +-
.../flowcontrol/v1beta1/groupsubject.go | 4 +-
.../limitedprioritylevelconfiguration.go | 4 +-
.../flowcontrol/v1beta1/limitresponse.go | 4 +-
.../v1beta1/nonresourcepolicyrule.go | 4 +-
.../v1beta1/policyruleswithsubjects.go | 4 +-
.../v1beta1/prioritylevelconfiguration.go | 10 +-
.../prioritylevelconfigurationcondition.go | 4 +-
.../prioritylevelconfigurationreference.go | 4 +-
.../v1beta1/prioritylevelconfigurationspec.go | 4 +-
.../prioritylevelconfigurationstatus.go | 4 +-
.../v1beta1/queuingconfiguration.go | 4 +-
.../flowcontrol/v1beta1/resourcepolicyrule.go | 4 +-
.../v1beta1/serviceaccountsubject.go | 4 +-
.../flowcontrol/v1beta1/subject.go | 4 +-
.../flowcontrol/v1beta1/usersubject.go | 4 +-
.../exemptprioritylevelconfiguration.go | 4 +-
.../v1beta2/flowdistinguishermethod.go | 4 +-
.../flowcontrol/v1beta2/flowschema.go | 10 +-
.../v1beta2/flowschemacondition.go | 4 +-
.../flowcontrol/v1beta2/flowschemaspec.go | 4 +-
.../flowcontrol/v1beta2/flowschemastatus.go | 4 +-
.../flowcontrol/v1beta2/groupsubject.go | 4 +-
.../limitedprioritylevelconfiguration.go | 4 +-
.../flowcontrol/v1beta2/limitresponse.go | 4 +-
.../v1beta2/nonresourcepolicyrule.go | 4 +-
.../v1beta2/policyruleswithsubjects.go | 4 +-
.../v1beta2/prioritylevelconfiguration.go | 10 +-
.../prioritylevelconfigurationcondition.go | 4 +-
.../prioritylevelconfigurationreference.go | 4 +-
.../v1beta2/prioritylevelconfigurationspec.go | 4 +-
.../prioritylevelconfigurationstatus.go | 4 +-
.../v1beta2/queuingconfiguration.go | 4 +-
.../flowcontrol/v1beta2/resourcepolicyrule.go | 4 +-
.../v1beta2/serviceaccountsubject.go | 4 +-
.../flowcontrol/v1beta2/subject.go | 4 +-
.../flowcontrol/v1beta2/usersubject.go | 4 +-
.../exemptprioritylevelconfiguration.go | 4 +-
.../v1beta3/flowdistinguishermethod.go | 4 +-
.../flowcontrol/v1beta3/flowschema.go | 10 +-
.../v1beta3/flowschemacondition.go | 4 +-
.../flowcontrol/v1beta3/flowschemaspec.go | 4 +-
.../flowcontrol/v1beta3/flowschemastatus.go | 4 +-
.../flowcontrol/v1beta3/groupsubject.go | 4 +-
.../limitedprioritylevelconfiguration.go | 4 +-
.../flowcontrol/v1beta3/limitresponse.go | 4 +-
.../v1beta3/nonresourcepolicyrule.go | 4 +-
.../v1beta3/policyruleswithsubjects.go | 4 +-
.../v1beta3/prioritylevelconfiguration.go | 10 +-
.../prioritylevelconfigurationcondition.go | 4 +-
.../prioritylevelconfigurationreference.go | 4 +-
.../v1beta3/prioritylevelconfigurationspec.go | 4 +-
.../prioritylevelconfigurationstatus.go | 4 +-
.../v1beta3/queuingconfiguration.go | 4 +-
.../flowcontrol/v1beta3/resourcepolicyrule.go | 4 +-
.../v1beta3/serviceaccountsubject.go | 4 +-
.../flowcontrol/v1beta3/subject.go | 4 +-
.../flowcontrol/v1beta3/usersubject.go | 4 +-
.../applyconfigurations/internal/internal.go | 1136 +-
.../applyconfigurations/meta/v1/condition.go | 4 +-
.../meta/v1/deleteoptions.go | 4 +-
.../meta/v1/labelselector.go | 4 +-
.../meta/v1/labelselectorrequirement.go | 4 +-
.../meta/v1/managedfieldsentry.go | 4 +-
.../applyconfigurations/meta/v1/objectmeta.go | 9 +-
.../meta/v1/ownerreference.go | 4 +-
.../meta/v1/preconditions.go | 4 +-
.../applyconfigurations/meta/v1/typemeta.go | 4 +-
.../networking/v1/httpingresspath.go | 4 +-
.../networking/v1/httpingressrulevalue.go | 4 +-
.../networking/v1/ingress.go | 10 +-
.../networking/v1/ingressbackend.go | 4 +-
.../networking/v1/ingressclass.go | 10 +-
.../v1/ingressclassparametersreference.go | 4 +-
.../networking/v1/ingressclassspec.go | 4 +-
.../v1/ingressloadbalanceringress.go | 4 +-
.../v1/ingressloadbalancerstatus.go | 4 +-
.../networking/v1/ingressportstatus.go | 4 +-
.../networking/v1/ingressrule.go | 6 +-
.../networking/v1/ingressrulevalue.go | 4 +-
.../networking/v1/ingressservicebackend.go | 4 +-
.../networking/v1/ingressspec.go | 4 +-
.../networking/v1/ingressstatus.go | 4 +-
.../networking/v1/ingresstls.go | 4 +-
.../networking/v1/ipblock.go | 4 +-
.../networking/v1/networkpolicy.go | 10 +-
.../networking/v1/networkpolicyegressrule.go | 4 +-
.../networking/v1/networkpolicyingressrule.go | 4 +-
.../networking/v1/networkpolicypeer.go | 4 +-
.../networking/v1/networkpolicyport.go | 4 +-
.../networking/v1/networkpolicyspec.go | 4 +-
.../networking/v1/servicebackendport.go | 4 +-
.../networking/v1alpha1/ipaddress.go | 10 +-
.../networking/v1alpha1/ipaddressspec.go | 4 +-
.../networking/v1alpha1/parentreference.go | 4 +-
.../networking/v1alpha1/servicecidr.go | 10 +-
.../networking/v1alpha1/servicecidrspec.go | 4 +-
.../networking/v1alpha1/servicecidrstatus.go | 4 +-
.../networking/v1beta1/httpingresspath.go | 4 +-
.../v1beta1/httpingressrulevalue.go | 4 +-
.../networking/v1beta1/ingress.go | 10 +-
.../networking/v1beta1/ingressbackend.go | 4 +-
.../networking/v1beta1/ingressclass.go | 10 +-
.../ingressclassparametersreference.go | 4 +-
.../networking/v1beta1/ingressclassspec.go | 4 +-
.../v1beta1/ingressloadbalanceringress.go | 4 +-
.../v1beta1/ingressloadbalancerstatus.go | 4 +-
.../networking/v1beta1/ingressportstatus.go | 4 +-
.../networking/v1beta1/ingressrule.go | 6 +-
.../networking/v1beta1/ingressrulevalue.go | 4 +-
.../networking/v1beta1/ingressspec.go | 4 +-
.../networking/v1beta1/ingressstatus.go | 4 +-
.../networking/v1beta1/ingresstls.go | 4 +-
.../networking/v1beta1/ipaddress.go | 253 +
.../networking/v1beta1/ipaddressspec.go | 39 +
.../v1beta1/parentreference.go} | 50 +-
.../networking/v1beta1/servicecidr.go | 262 +
.../networking/v1beta1/servicecidrspec.go | 41 +
.../networking/v1beta1/servicecidrstatus.go | 48 +
.../applyconfigurations/node/v1/overhead.go | 4 +-
.../node/v1/runtimeclass.go | 10 +-
.../applyconfigurations/node/v1/scheduling.go | 4 +-
.../node/v1alpha1/overhead.go | 4 +-
.../node/v1alpha1/runtimeclass.go | 10 +-
.../node/v1alpha1/runtimeclassspec.go | 4 +-
.../node/v1alpha1/scheduling.go | 4 +-
.../node/v1beta1/overhead.go | 4 +-
.../node/v1beta1/runtimeclass.go | 10 +-
.../node/v1beta1/scheduling.go | 4 +-
.../applyconfigurations/policy/v1/eviction.go | 10 +-
.../policy/v1/poddisruptionbudget.go | 10 +-
.../policy/v1/poddisruptionbudgetspec.go | 4 +-
.../policy/v1/poddisruptionbudgetstatus.go | 4 +-
.../policy/v1beta1/eviction.go | 10 +-
.../policy/v1beta1/poddisruptionbudget.go | 10 +-
.../policy/v1beta1/poddisruptionbudgetspec.go | 4 +-
.../v1beta1/poddisruptionbudgetstatus.go | 4 +-
.../rbac/v1/aggregationrule.go | 4 +-
.../rbac/v1/clusterrole.go | 10 +-
.../rbac/v1/clusterrolebinding.go | 10 +-
.../applyconfigurations/rbac/v1/policyrule.go | 4 +-
.../applyconfigurations/rbac/v1/role.go | 10 +-
.../rbac/v1/rolebinding.go | 10 +-
.../applyconfigurations/rbac/v1/roleref.go | 4 +-
.../applyconfigurations/rbac/v1/subject.go | 4 +-
.../rbac/v1alpha1/aggregationrule.go | 4 +-
.../rbac/v1alpha1/clusterrole.go | 10 +-
.../rbac/v1alpha1/clusterrolebinding.go | 10 +-
.../rbac/v1alpha1/policyrule.go | 4 +-
.../applyconfigurations/rbac/v1alpha1/role.go | 10 +-
.../rbac/v1alpha1/rolebinding.go | 10 +-
.../rbac/v1alpha1/roleref.go | 4 +-
.../rbac/v1alpha1/subject.go | 4 +-
.../rbac/v1beta1/aggregationrule.go | 4 +-
.../rbac/v1beta1/clusterrole.go | 10 +-
.../rbac/v1beta1/clusterrolebinding.go | 10 +-
.../rbac/v1beta1/policyrule.go | 4 +-
.../applyconfigurations/rbac/v1beta1/role.go | 10 +-
.../rbac/v1beta1/rolebinding.go | 10 +-
.../rbac/v1beta1/roleref.go | 4 +-
.../rbac/v1beta1/subject.go | 4 +-
.../resource/v1alpha2/allocationresult.go | 66 -
.../resourceclaimparametersreference.go | 57 -
.../resource/v1alpha2/resourceclaimspec.go | 61 -
.../resource/v1alpha2/resourcehandle.go | 48 -
.../resource/v1alpha3/allocationresult.go | 61 +
.../resource/v1alpha3/basicdevice.go | 65 +
.../resource/v1alpha3/celdeviceselector.go | 39 +
.../resource/v1alpha3/device.go | 48 +
.../v1alpha3/deviceallocationconfiguration.go | 63 +
.../v1alpha3/deviceallocationresult.go | 58 +
.../resource/v1alpha3/deviceattribute.go | 66 +
.../resource/v1alpha3/deviceclaim.go | 72 +
.../v1alpha3/deviceclaimconfiguration.go | 50 +
.../resource/v1alpha3/deviceclass.go | 253 +
.../v1alpha3/deviceclassconfiguration.go | 39 +
.../resource/v1alpha3/deviceclassspec.go | 71 +
.../resource/v1alpha3/deviceconfiguration.go | 39 +
.../resource/v1alpha3/deviceconstraint.go | 54 +
.../resource/v1alpha3/devicerequest.go | 93 +
.../v1alpha3/devicerequestallocationresult.go | 66 +
.../resource/v1alpha3/deviceselector.go | 39 +
.../v1alpha3/opaquedeviceconfiguration.go | 52 +
.../podschedulingcontext.go | 26 +-
.../podschedulingcontextspec.go | 6 +-
.../podschedulingcontextstatus.go | 6 +-
.../{v1alpha2 => v1alpha3}/resourceclaim.go | 26 +-
.../resourceclaimconsumerreference.go | 6 +-
.../resourceclaimschedulingstatus.go | 6 +-
.../resource/v1alpha3/resourceclaimspec.go | 48 +
.../resourceclaimstatus.go | 15 +-
.../resourceclaimtemplate.go | 26 +-
.../resourceclaimtemplatespec.go | 12 +-
.../resource/v1alpha3/resourcepool.go | 57 +
.../resourceslice.go} | 113 +-
.../resource/v1alpha3/resourceslicespec.go | 93 +
.../scheduling/v1/priorityclass.go | 10 +-
.../scheduling/v1alpha1/priorityclass.go | 10 +-
.../scheduling/v1beta1/priorityclass.go | 10 +-
.../storage/v1/csidriver.go | 10 +-
.../storage/v1/csidriverspec.go | 4 +-
.../applyconfigurations/storage/v1/csinode.go | 10 +-
.../storage/v1/csinodedriver.go | 4 +-
.../storage/v1/csinodespec.go | 4 +-
.../storage/v1/csistoragecapacity.go | 10 +-
.../storage/v1/storageclass.go | 10 +-
.../storage/v1/tokenrequest.go | 4 +-
.../storage/v1/volumeattachment.go | 10 +-
.../storage/v1/volumeattachmentsource.go | 4 +-
.../storage/v1/volumeattachmentspec.go | 4 +-
.../storage/v1/volumeattachmentstatus.go | 4 +-
.../storage/v1/volumeerror.go | 4 +-
.../storage/v1/volumenoderesources.go | 4 +-
.../storage/v1alpha1/csistoragecapacity.go | 10 +-
.../storage/v1alpha1/volumeattachment.go | 10 +-
.../v1alpha1/volumeattachmentsource.go | 4 +-
.../storage/v1alpha1/volumeattachmentspec.go | 4 +-
.../v1alpha1/volumeattachmentstatus.go | 4 +-
.../storage/v1alpha1/volumeattributesclass.go | 10 +-
.../storage/v1alpha1/volumeerror.go | 4 +-
.../storage/v1beta1/csidriver.go | 10 +-
.../storage/v1beta1/csidriverspec.go | 4 +-
.../storage/v1beta1/csinode.go | 10 +-
.../storage/v1beta1/csinodedriver.go | 4 +-
.../storage/v1beta1/csinodespec.go | 4 +-
.../storage/v1beta1/csistoragecapacity.go | 10 +-
.../storage/v1beta1/storageclass.go | 10 +-
.../storage/v1beta1/tokenrequest.go | 4 +-
.../storage/v1beta1/volumeattachment.go | 10 +-
.../storage/v1beta1/volumeattachmentsource.go | 4 +-
.../storage/v1beta1/volumeattachmentspec.go | 4 +-
.../storage/v1beta1/volumeattachmentstatus.go | 4 +-
.../storage/v1beta1/volumeattributesclass.go | 268 +
.../storage/v1beta1/volumeerror.go | 4 +-
.../storage/v1beta1/volumenoderesources.go | 4 +-
.../v1alpha1/groupversionresource.go | 57 +
.../v1alpha1/migrationcondition.go | 81 +
.../v1alpha1/storageversionmigration.go | 262 +
.../v1alpha1/storageversionmigrationspec.go | 48 +
.../v1alpha1/storageversionmigrationstatus.go | 53 +
.../discovery/aggregated_discovery.go | 124 +-
.../client-go/discovery/discovery_client.go | 29 +-
.../client-go/discovery/fake/discovery.go | 12 +-
vendor/k8s.io/client-go/features/envvar.go | 188 +
vendor/k8s.io/client-go/features/features.go | 143 +
.../client-go/features/known_features.go | 54 +
vendor/k8s.io/client-go/gentype/type.go | 360 +
.../admissionregistration/v1/interface.go | 14 +
.../v1/validatingadmissionpolicy.go | 89 +
.../v1/validatingadmissionpolicybinding.go | 89 +
.../informers/coordination/interface.go | 8 +
.../coordination/v1alpha1/interface.go | 45 +
.../coordination/v1alpha1/leasecandidate.go | 90 +
vendor/k8s.io/client-go/informers/doc.go | 2 +-
vendor/k8s.io/client-go/informers/factory.go | 7 +
vendor/k8s.io/client-go/informers/generic.go | 42 +-
.../informers/networking/v1beta1/interface.go | 14 +
.../informers/networking/v1beta1/ipaddress.go | 89 +
.../networking/v1beta1/servicecidr.go | 89 +
.../client-go/informers/resource/interface.go | 12 +-
.../resource/v1alpha3/deviceclass.go | 89 +
.../{v1alpha2 => v1alpha3}/interface.go | 19 +-
.../podschedulingcontext.go | 20 +-
.../{v1alpha2 => v1alpha3}/resourceclaim.go | 20 +-
.../resourceclaimtemplate.go | 20 +-
.../resourceslice.go} | 44 +-
.../informers/storage/v1beta1/interface.go | 7 +
.../storage/v1beta1/volumeattributesclass.go | 89 +
.../informers/storagemigration/interface.go | 46 +
.../storagemigration/v1alpha1/interface.go | 45 +
.../v1alpha1/storageversionmigration.go | 89 +
.../k8s.io/client-go/kubernetes/clientset.go | 42 +-
vendor/k8s.io/client-go/kubernetes/doc.go | 2 +-
.../client-go/kubernetes/scheme/register.go | 8 +-
.../v1/admissionregistration_client.go | 10 +
.../v1/generated_expansion.go | 4 +
.../v1/mutatingwebhookconfiguration.go | 146 +-
.../v1/validatingadmissionpolicy.go | 73 +
.../v1/validatingadmissionpolicybinding.go | 69 +
.../v1/validatingwebhookconfiguration.go | 146 +-
.../v1alpha1/validatingadmissionpolicy.go | 192 +-
.../validatingadmissionpolicybinding.go | 148 +-
.../v1beta1/mutatingwebhookconfiguration.go | 146 +-
.../v1beta1/validatingadmissionpolicy.go | 192 +-
.../validatingadmissionpolicybinding.go | 148 +-
.../v1beta1/validatingwebhookconfiguration.go | 148 +-
.../v1alpha1/storageversion.go | 192 +-
.../typed/apps/v1/controllerrevision.go | 157 +-
.../kubernetes/typed/apps/v1/daemonset.go | 205 +-
.../kubernetes/typed/apps/v1/deployment.go | 215 +-
.../kubernetes/typed/apps/v1/replicaset.go | 215 +-
.../kubernetes/typed/apps/v1/statefulset.go | 215 +-
.../typed/apps/v1beta1/controllerrevision.go | 157 +-
.../typed/apps/v1beta1/deployment.go | 205 +-
.../typed/apps/v1beta1/statefulset.go | 205 +-
.../typed/apps/v1beta2/controllerrevision.go | 157 +-
.../typed/apps/v1beta2/daemonset.go | 205 +-
.../typed/apps/v1beta2/deployment.go | 205 +-
.../typed/apps/v1beta2/replicaset.go | 205 +-
.../typed/apps/v1beta2/statefulset.go | 215 +-
.../authentication/v1/selfsubjectreview.go | 23 +-
.../typed/authentication/v1/tokenreview.go | 23 +-
.../v1alpha1/selfsubjectreview.go | 23 +-
.../v1beta1/selfsubjectreview.go | 23 +-
.../authentication/v1beta1/tokenreview.go | 23 +-
.../v1/localsubjectaccessreview.go | 26 +-
.../v1/selfsubjectaccessreview.go | 23 +-
.../v1/selfsubjectrulesreview.go | 23 +-
.../authorization/v1/subjectaccessreview.go | 23 +-
.../v1beta1/localsubjectaccessreview.go | 26 +-
.../v1beta1/selfsubjectaccessreview.go | 23 +-
.../v1beta1/selfsubjectrulesreview.go | 23 +-
.../v1beta1/subjectaccessreview.go | 23 +-
.../autoscaling/v1/horizontalpodautoscaler.go | 205 +-
.../autoscaling/v2/horizontalpodautoscaler.go | 205 +-
.../v2beta1/horizontalpodautoscaler.go | 205 +-
.../v2beta2/horizontalpodautoscaler.go | 205 +-
.../kubernetes/typed/batch/v1/cronjob.go | 205 +-
.../kubernetes/typed/batch/v1/job.go | 205 +-
.../kubernetes/typed/batch/v1beta1/cronjob.go | 205 +-
.../v1/certificatesigningrequest.go | 194 +-
.../v1alpha1/clustertrustbundle.go | 146 +-
.../v1beta1/certificatesigningrequest.go | 192 +-
.../certificatesigningrequest_expansion.go | 2 +-
.../kubernetes/typed/coordination/v1/lease.go | 157 +-
.../v1alpha1/coordination_client.go | 107 +
.../v1alpha2 => coordination/v1alpha1}/doc.go | 2 +-
.../v1alpha1/generated_expansion.go | 21 +
.../coordination/v1alpha1/leasecandidate.go | 69 +
.../typed/coordination/v1beta1/lease.go | 157 +-
.../typed/core/v1/componentstatus.go | 146 +-
.../kubernetes/typed/core/v1/configmap.go | 157 +-
.../kubernetes/typed/core/v1/endpoints.go | 157 +-
.../kubernetes/typed/core/v1/event.go | 157 +-
.../typed/core/v1/event_expansion.go | 22 +-
.../kubernetes/typed/core/v1/limitrange.go | 157 +-
.../kubernetes/typed/core/v1/namespace.go | 177 +-
.../typed/core/v1/namespace_expansion.go | 2 +-
.../kubernetes/typed/core/v1/node.go | 192 +-
.../typed/core/v1/node_expansion.go | 2 +-
.../typed/core/v1/persistentvolume.go | 192 +-
.../typed/core/v1/persistentvolumeclaim.go | 205 +-
.../client-go/kubernetes/typed/core/v1/pod.go | 209 +-
.../kubernetes/typed/core/v1/pod_expansion.go | 14 +-
.../kubernetes/typed/core/v1/podtemplate.go | 157 +-
.../typed/core/v1/replicationcontroller.go | 213 +-
.../kubernetes/typed/core/v1/resourcequota.go | 205 +-
.../kubernetes/typed/core/v1/secret.go | 157 +-
.../kubernetes/typed/core/v1/service.go | 189 +-
.../typed/core/v1/service_expansion.go | 4 +-
.../typed/core/v1/serviceaccount.go | 161 +-
.../typed/discovery/v1/endpointslice.go | 157 +-
.../typed/discovery/v1beta1/endpointslice.go | 157 +-
.../kubernetes/typed/events/v1/event.go | 157 +-
.../kubernetes/typed/events/v1beta1/event.go | 157 +-
.../typed/events/v1beta1/event_expansion.go | 18 +-
.../typed/extensions/v1beta1/daemonset.go | 205 +-
.../typed/extensions/v1beta1/deployment.go | 215 +-
.../v1beta1/deployment_expansion.go | 2 +-
.../typed/extensions/v1beta1/ingress.go | 205 +-
.../typed/extensions/v1beta1/networkpolicy.go | 157 +-
.../typed/extensions/v1beta1/replicaset.go | 215 +-
.../typed/flowcontrol/v1/flowschema.go | 192 +-
.../v1/prioritylevelconfiguration.go | 192 +-
.../typed/flowcontrol/v1beta1/flowschema.go | 192 +-
.../v1beta1/prioritylevelconfiguration.go | 192 +-
.../typed/flowcontrol/v1beta2/flowschema.go | 192 +-
.../v1beta2/prioritylevelconfiguration.go | 192 +-
.../typed/flowcontrol/v1beta3/flowschema.go | 192 +-
.../v1beta3/prioritylevelconfiguration.go | 192 +-
.../kubernetes/typed/networking/v1/ingress.go | 205 +-
.../typed/networking/v1/ingressclass.go | 146 +-
.../typed/networking/v1/networkpolicy.go | 157 +-
.../typed/networking/v1alpha1/ipaddress.go | 146 +-
.../typed/networking/v1alpha1/servicecidr.go | 192 +-
.../networking/v1beta1/generated_expansion.go | 4 +
.../typed/networking/v1beta1/ingress.go | 205 +-
.../typed/networking/v1beta1/ingressclass.go | 146 +-
.../typed/networking/v1beta1/ipaddress.go | 69 +
.../networking/v1beta1/networking_client.go | 10 +
.../typed/networking/v1beta1/servicecidr.go | 73 +
.../kubernetes/typed/node/v1/runtimeclass.go | 146 +-
.../typed/node/v1alpha1/runtimeclass.go | 146 +-
.../typed/node/v1beta1/runtimeclass.go | 146 +-
.../kubernetes/typed/policy/v1/eviction.go | 15 +-
.../typed/policy/v1/eviction_expansion.go | 2 +-
.../typed/policy/v1/poddisruptionbudget.go | 205 +-
.../typed/policy/v1beta1/eviction.go | 15 +-
.../policy/v1beta1/eviction_expansion.go | 2 +-
.../policy/v1beta1/poddisruptionbudget.go | 205 +-
.../kubernetes/typed/rbac/v1/clusterrole.go | 146 +-
.../typed/rbac/v1/clusterrolebinding.go | 146 +-
.../kubernetes/typed/rbac/v1/role.go | 157 +-
.../kubernetes/typed/rbac/v1/rolebinding.go | 157 +-
.../typed/rbac/v1alpha1/clusterrole.go | 146 +-
.../typed/rbac/v1alpha1/clusterrolebinding.go | 146 +-
.../kubernetes/typed/rbac/v1alpha1/role.go | 157 +-
.../typed/rbac/v1alpha1/rolebinding.go | 157 +-
.../typed/rbac/v1beta1/clusterrole.go | 146 +-
.../typed/rbac/v1beta1/clusterrolebinding.go | 146 +-
.../kubernetes/typed/rbac/v1beta1/role.go | 157 +-
.../typed/rbac/v1beta1/rolebinding.go | 157 +-
.../resource/v1alpha2/podschedulingcontext.go | 256 -
.../typed/resource/v1alpha2/resourceclaim.go | 256 -
.../v1alpha2/resourceclaimtemplate.go | 208 -
.../typed/resource/v1alpha2/resourceclass.go | 197 -
.../typed/resource/v1alpha3/deviceclass.go | 69 +
.../kubernetes/typed/resource/v1alpha3/doc.go | 20 +
.../generated_expansion.go | 6 +-
.../resource/v1alpha3/podschedulingcontext.go | 73 +
.../{v1alpha2 => v1alpha3}/resource_client.go | 51 +-
.../typed/resource/v1alpha3/resourceclaim.go | 73 +
.../v1alpha3/resourceclaimtemplate.go | 69 +
.../typed/resource/v1alpha3/resourceslice.go | 69 +
.../typed/scheduling/v1/priorityclass.go | 146 +-
.../scheduling/v1alpha1/priorityclass.go | 146 +-
.../typed/scheduling/v1beta1/priorityclass.go | 146 +-
.../kubernetes/typed/storage/v1/csidriver.go | 146 +-
.../kubernetes/typed/storage/v1/csinode.go | 146 +-
.../typed/storage/v1/csistoragecapacity.go | 157 +-
.../typed/storage/v1/storageclass.go | 146 +-
.../typed/storage/v1/volumeattachment.go | 192 +-
.../storage/v1alpha1/csistoragecapacity.go | 157 +-
.../storage/v1alpha1/volumeattachment.go | 192 +-
.../storage/v1alpha1/volumeattributesclass.go | 146 +-
.../typed/storage/v1beta1/csidriver.go | 146 +-
.../typed/storage/v1beta1/csinode.go | 146 +-
.../storage/v1beta1/csistoragecapacity.go | 157 +-
.../storage/v1beta1/generated_expansion.go | 2 +
.../typed/storage/v1beta1/storage_client.go | 5 +
.../typed/storage/v1beta1/storageclass.go | 146 +-
.../typed/storage/v1beta1/volumeattachment.go | 192 +-
.../storage/v1beta1/volumeattributesclass.go | 69 +
.../typed/storagemigration/v1alpha1/doc.go | 20 +
.../v1alpha1/generated_expansion.go | 21 +
.../v1alpha1/storagemigration_client.go | 107 +
.../v1alpha1/storageversionmigration.go | 73 +
.../v1/expansion_generated.go | 8 +
.../v1/mutatingwebhookconfiguration.go | 26 +-
.../v1/validatingadmissionpolicy.go | 48 +
.../v1/validatingadmissionpolicybinding.go | 48 +
.../v1/validatingwebhookconfiguration.go | 26 +-
.../v1alpha1/validatingadmissionpolicy.go | 26 +-
.../validatingadmissionpolicybinding.go | 26 +-
.../v1beta1/mutatingwebhookconfiguration.go | 26 +-
.../v1beta1/validatingadmissionpolicy.go | 26 +-
.../validatingadmissionpolicybinding.go | 26 +-
.../v1beta1/validatingwebhookconfiguration.go | 26 +-
.../v1alpha1/storageversion.go | 26 +-
.../listers/apps/v1/controllerrevision.go | 39 +-
.../client-go/listers/apps/v1/daemonset.go | 39 +-
.../client-go/listers/apps/v1/deployment.go | 39 +-
.../client-go/listers/apps/v1/replicaset.go | 39 +-
.../client-go/listers/apps/v1/statefulset.go | 39 +-
.../apps/v1beta1/controllerrevision.go | 39 +-
.../listers/apps/v1beta1/deployment.go | 39 +-
.../listers/apps/v1beta1/statefulset.go | 39 +-
.../apps/v1beta2/controllerrevision.go | 39 +-
.../listers/apps/v1beta2/daemonset.go | 39 +-
.../listers/apps/v1beta2/deployment.go | 39 +-
.../listers/apps/v1beta2/replicaset.go | 39 +-
.../listers/apps/v1beta2/statefulset.go | 39 +-
.../autoscaling/v1/horizontalpodautoscaler.go | 39 +-
.../autoscaling/v2/horizontalpodautoscaler.go | 39 +-
.../v2beta1/horizontalpodautoscaler.go | 39 +-
.../v2beta2/horizontalpodautoscaler.go | 39 +-
.../client-go/listers/batch/v1/cronjob.go | 39 +-
.../k8s.io/client-go/listers/batch/v1/job.go | 39 +-
.../listers/batch/v1beta1/cronjob.go | 39 +-
.../v1/certificatesigningrequest.go | 26 +-
.../v1alpha1/clustertrustbundle.go | 26 +-
.../v1beta1/certificatesigningrequest.go | 26 +-
.../listers/coordination/v1/lease.go | 39 +-
.../v1alpha1/expansion_generated.go | 27 +
.../coordination/v1alpha1/leasecandidate.go | 70 +
.../listers/coordination/v1beta1/lease.go | 39 +-
.../listers/core/v1/componentstatus.go | 26 +-
.../client-go/listers/core/v1/configmap.go | 39 +-
.../client-go/listers/core/v1/endpoints.go | 39 +-
.../k8s.io/client-go/listers/core/v1/event.go | 39 +-
.../client-go/listers/core/v1/limitrange.go | 39 +-
.../client-go/listers/core/v1/namespace.go | 26 +-
.../k8s.io/client-go/listers/core/v1/node.go | 26 +-
.../listers/core/v1/persistentvolume.go | 26 +-
.../listers/core/v1/persistentvolumeclaim.go | 39 +-
.../k8s.io/client-go/listers/core/v1/pod.go | 39 +-
.../client-go/listers/core/v1/podtemplate.go | 39 +-
.../listers/core/v1/replicationcontroller.go | 39 +-
.../listers/core/v1/resourcequota.go | 39 +-
.../client-go/listers/core/v1/secret.go | 39 +-
.../client-go/listers/core/v1/service.go | 39 +-
.../listers/core/v1/serviceaccount.go | 39 +-
.../listers/discovery/v1/endpointslice.go | 39 +-
.../discovery/v1beta1/endpointslice.go | 39 +-
vendor/k8s.io/client-go/listers/doc.go | 18 +
.../client-go/listers/events/v1/event.go | 39 +-
.../client-go/listers/events/v1beta1/event.go | 39 +-
.../listers/extensions/v1beta1/daemonset.go | 39 +-
.../listers/extensions/v1beta1/deployment.go | 39 +-
.../listers/extensions/v1beta1/ingress.go | 39 +-
.../extensions/v1beta1/networkpolicy.go | 39 +-
.../listers/extensions/v1beta1/replicaset.go | 39 +-
.../listers/flowcontrol/v1/flowschema.go | 26 +-
.../v1/prioritylevelconfiguration.go | 26 +-
.../listers/flowcontrol/v1beta1/flowschema.go | 26 +-
.../v1beta1/prioritylevelconfiguration.go | 26 +-
.../listers/flowcontrol/v1beta2/flowschema.go | 26 +-
.../v1beta2/prioritylevelconfiguration.go | 26 +-
.../listers/flowcontrol/v1beta3/flowschema.go | 26 +-
.../v1beta3/prioritylevelconfiguration.go | 26 +-
.../client-go/listers/generic_helpers.go | 72 +
.../listers/networking/v1/ingress.go | 39 +-
.../listers/networking/v1/ingressclass.go | 26 +-
.../listers/networking/v1/networkpolicy.go | 39 +-
.../listers/networking/v1alpha1/ipaddress.go | 26 +-
.../networking/v1alpha1/servicecidr.go | 26 +-
.../networking/v1beta1/expansion_generated.go | 8 +
.../listers/networking/v1beta1/ingress.go | 39 +-
.../networking/v1beta1/ingressclass.go | 26 +-
.../listers/networking/v1beta1/ipaddress.go | 48 +
.../listers/networking/v1beta1/servicecidr.go | 48 +
.../client-go/listers/node/v1/runtimeclass.go | 26 +-
.../listers/node/v1alpha1/runtimeclass.go | 26 +-
.../listers/node/v1beta1/runtimeclass.go | 26 +-
.../client-go/listers/policy/v1/eviction.go | 39 +-
.../listers/policy/v1/poddisruptionbudget.go | 39 +-
.../listers/policy/v1beta1/eviction.go | 39 +-
.../policy/v1beta1/poddisruptionbudget.go | 39 +-
.../client-go/listers/rbac/v1/clusterrole.go | 26 +-
.../listers/rbac/v1/clusterrolebinding.go | 26 +-
.../k8s.io/client-go/listers/rbac/v1/role.go | 39 +-
.../client-go/listers/rbac/v1/rolebinding.go | 39 +-
.../listers/rbac/v1alpha1/clusterrole.go | 26 +-
.../rbac/v1alpha1/clusterrolebinding.go | 26 +-
.../client-go/listers/rbac/v1alpha1/role.go | 39 +-
.../listers/rbac/v1alpha1/rolebinding.go | 39 +-
.../listers/rbac/v1beta1/clusterrole.go | 26 +-
.../rbac/v1beta1/clusterrolebinding.go | 26 +-
.../client-go/listers/rbac/v1beta1/role.go | 39 +-
.../listers/rbac/v1beta1/rolebinding.go | 39 +-
.../resource/v1alpha2/resourceclass.go | 68 -
.../listers/resource/v1alpha3/deviceclass.go | 48 +
.../expansion_generated.go | 12 +-
.../podschedulingcontext.go | 49 +-
.../{v1alpha2 => v1alpha3}/resourceclaim.go | 49 +-
.../resourceclaimtemplate.go | 49 +-
.../resource/v1alpha3/resourceslice.go | 48 +
.../listers/scheduling/v1/priorityclass.go | 26 +-
.../scheduling/v1alpha1/priorityclass.go | 26 +-
.../scheduling/v1beta1/priorityclass.go | 26 +-
.../client-go/listers/storage/v1/csidriver.go | 26 +-
.../client-go/listers/storage/v1/csinode.go | 26 +-
.../listers/storage/v1/csistoragecapacity.go | 39 +-
.../listers/storage/v1/storageclass.go | 26 +-
.../listers/storage/v1/volumeattachment.go | 26 +-
.../storage/v1alpha1/csistoragecapacity.go | 39 +-
.../storage/v1alpha1/volumeattachment.go | 26 +-
.../storage/v1alpha1/volumeattributesclass.go | 26 +-
.../listers/storage/v1beta1/csidriver.go | 26 +-
.../listers/storage/v1beta1/csinode.go | 26 +-
.../storage/v1beta1/csistoragecapacity.go | 39 +-
.../storage/v1beta1/expansion_generated.go | 4 +
.../listers/storage/v1beta1/storageclass.go | 26 +-
.../storage/v1beta1/volumeattachment.go | 26 +-
.../storage/v1beta1/volumeattributesclass.go | 48 +
.../v1alpha1/expansion_generated.go | 23 +
.../v1alpha1/storageversionmigration.go | 48 +
vendor/k8s.io/client-go/rest/request.go | 146 +
vendor/k8s.io/client-go/rest/watch/decoder.go | 2 +-
vendor/k8s.io/client-go/testing/actions.go | 235 +-
vendor/k8s.io/client-go/testing/fixture.go | 670 +-
.../client-go/tools/cache/controller.go | 142 +-
.../client-go/tools/cache/delta_fifo.go | 53 +-
vendor/k8s.io/client-go/tools/cache/index.go | 3 +-
.../k8s.io/client-go/tools/cache/listers.go | 6 +-
.../k8s.io/client-go/tools/cache/listwatch.go | 4 +
.../k8s.io/client-go/tools/cache/reflector.go | 265 +-
.../reflector_data_consistency_detector.go | 94 +-
.../client-go/tools/cache/shared_informer.go | 10 +-
.../tools/cache/thread_safe_store.go | 92 +-
.../client-go/tools/clientcmd/api/doc.go | 2 +-
.../client-go/tools/clientcmd/api/helpers.go | 5 +-
.../client-go/tools/clientcmd/api/v1/doc.go | 2 +-
.../tools/clientcmd/client_config.go | 49 +-
.../client-go/tools/clientcmd/config.go | 3 +-
vendor/k8s.io/client-go/tools/record/event.go | 23 +-
.../client-go/transport/cert_rotation.go | 7 +-
.../data_consistency_detector.go | 146 +
.../list_data_consistency_detector.go | 70 +
.../watch_list_data_consistency_detector.go | 54 +
.../client-go/util/flowcontrol/backoff.go | 3 +-
.../client-go/util/watchlist/watch_list.go | 82 +
.../util/workqueue/default_rate_limiters.go | 139 +-
.../util/workqueue/delaying_queue.go | 66 +-
.../k8s.io/client-go/util/workqueue/queue.go | 153 +-
.../util/workqueue/rate_limiting_queue.go | 64 +-
.../cmd/client-gen/args/args.go | 95 +-
.../cmd/client-gen/args/gvpackages.go | 4 +-
.../client-gen/generators/client_generator.go | 235 +-
.../generators/fake/fake_client_generator.go | 98 +-
.../fake/generator_fake_for_clientset.go | 73 +-
.../fake/generator_fake_for_group.go | 18 +-
.../fake/generator_fake_for_type.go | 183 +-
.../generators/generator_for_clientset.go | 17 +-
.../generators/generator_for_expansion.go | 6 +-
.../generators/generator_for_group.go | 42 +-
.../generators/generator_for_type.go | 496 +-
.../generators/scheme/generator_for_scheme.go | 24 +-
.../cmd/client-gen/generators/util/tags.go | 4 +-
.../cmd/client-gen/path/path.go | 31 -
.../cmd/client-gen/types/helpers.go | 8 +-
.../cmd/client-gen/types/types.go | 16 +-
.../code-generator/pkg/namer/tag-override.go | 7 +-
.../k8s.io/code-generator/pkg/util/build.go | 60 -
.../pkg/util/plural_exceptions.go | 37 -
vendor/k8s.io/gengo/args/args.go | 199 -
.../gengo/generator/default_generator.go | 62 -
.../k8s.io/gengo/generator/default_package.go | 75 -
.../gengo/generator/transitive_closure.go | 65 -
vendor/k8s.io/gengo/parser/parse.go | 925 -
vendor/k8s.io/gengo/types/flatten.go | 57 -
vendor/k8s.io/gengo/{ => v2}/LICENSE | 0
vendor/k8s.io/gengo/v2/Makefile | 14 +
vendor/k8s.io/gengo/v2/README.md | 53 +
vendor/k8s.io/gengo/{types => v2}/comments.go | 21 +-
vendor/k8s.io/gengo/v2/execute.go | 98 +
vendor/k8s.io/gengo/{ => v2}/generator/doc.go | 2 +-
.../gengo/{ => v2}/generator/error_tracker.go | 0
.../gengo/{ => v2}/generator/execute.go | 162 +-
.../gengo/{ => v2}/generator/generator.go | 123 +-
.../k8s.io/gengo/v2/generator/go_generator.go | 61 +
.../{ => v2}/generator/import_tracker.go | 25 +-
.../gengo/v2/generator/simple_target.go | 77 +
.../{ => v2}/generator/snippet_writer.go | 56 +-
vendor/k8s.io/gengo/{ => v2}/namer/doc.go | 2 +-
.../gengo/{ => v2}/namer/import_tracker.go | 4 +-
vendor/k8s.io/gengo/{ => v2}/namer/namer.go | 18 +-
vendor/k8s.io/gengo/{ => v2}/namer/order.go | 2 +-
.../gengo/{ => v2}/namer/plural_namer.go | 2 +-
vendor/k8s.io/gengo/{ => v2}/parser/doc.go | 2 +-
vendor/k8s.io/gengo/v2/parser/parse.go | 876 +
vendor/k8s.io/gengo/v2/parser/parse_122.go | 33 +
.../k8s.io/gengo/v2/parser/parse_pre_122.go | 30 +
vendor/k8s.io/gengo/{ => v2}/types/doc.go | 2 +-
vendor/k8s.io/gengo/{ => v2}/types/types.go | 32 +-
vendor/k8s.io/klog/v2/klog.go | 76 +-
.../kube-openapi/pkg/util/proto/document.go | 2 +-
vendor/k8s.io/utils/integer/integer.go | 73 -
vendor/k8s.io/utils/net/multi_listen.go | 195 +
vendor/k8s.io/utils/trace/trace.go | 2 +-
vendor/modules.txt | 327 +-
vendor/sigs.k8s.io/json/Makefile | 2 +-
vendor/sigs.k8s.io/json/OWNERS | 2 +-
.../internal/golang/encoding/json/decode.go | 140 +-
.../internal/golang/encoding/json/encode.go | 490 +-
.../internal/golang/encoding/json/fold.go | 150 +-
.../internal/golang/encoding/json/indent.go | 119 +-
.../internal/golang/encoding/json/scanner.go | 4 +-
.../internal/golang/encoding/json/stream.go | 41 +-
.../structured-merge-diff/v4/fieldpath/set.go | 277 +
.../structured-merge-diff/v4/merge/update.go | 68 +-
.../structured-merge-diff/v4/typed/compare.go | 10 +
.../structured-merge-diff/v4/typed/parser.go | 2 +-
.../v4/value/reflectcache.go | 63 +-
.../structured-merge-diff/v4/value/value.go | 2 +-
2648 files changed, 346965 insertions(+), 276432 deletions(-)
create mode 100644 vendor/cloud.google.com/go/auth/CHANGES.md
create mode 100644 vendor/cloud.google.com/go/auth/LICENSE
create mode 100644 vendor/cloud.google.com/go/auth/README.md
create mode 100644 vendor/cloud.google.com/go/auth/auth.go
create mode 100644 vendor/cloud.google.com/go/auth/credentials/compute.go
create mode 100644 vendor/cloud.google.com/go/auth/credentials/detect.go
create mode 100644 vendor/cloud.google.com/go/auth/credentials/doc.go
create mode 100644 vendor/cloud.google.com/go/auth/credentials/filetypes.go
create mode 100644 vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/aws_provider.go
create mode 100644 vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/executable_provider.go
create mode 100644 vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/externalaccount.go
create mode 100644 vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/file_provider.go
create mode 100644 vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/info.go
rename vendor/{go.opentelemetry.io/otel/semconv/v1.17.0/http.go => cloud.google.com/go/auth/credentials/internal/externalaccount/programmatic_provider.go} (54%)
create mode 100644 vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/url_provider.go
create mode 100644 vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/x509_provider.go
create mode 100644 vendor/cloud.google.com/go/auth/credentials/internal/externalaccountuser/externalaccountuser.go
create mode 100644 vendor/cloud.google.com/go/auth/credentials/internal/gdch/gdch.go
create mode 100644 vendor/cloud.google.com/go/auth/credentials/internal/impersonate/impersonate.go
create mode 100644 vendor/cloud.google.com/go/auth/credentials/internal/stsexchange/sts_exchange.go
create mode 100644 vendor/cloud.google.com/go/auth/credentials/selfsignedjwt.go
create mode 100644 vendor/cloud.google.com/go/auth/httptransport/httptransport.go
create mode 100644 vendor/cloud.google.com/go/auth/httptransport/trace.go
create mode 100644 vendor/cloud.google.com/go/auth/httptransport/transport.go
create mode 100644 vendor/cloud.google.com/go/auth/internal/credsfile/credsfile.go
create mode 100644 vendor/cloud.google.com/go/auth/internal/credsfile/filetype.go
create mode 100644 vendor/cloud.google.com/go/auth/internal/credsfile/parse.go
create mode 100644 vendor/cloud.google.com/go/auth/internal/internal.go
create mode 100644 vendor/cloud.google.com/go/auth/internal/jwt/jwt.go
create mode 100644 vendor/cloud.google.com/go/auth/internal/transport/cba.go
create mode 100644 vendor/cloud.google.com/go/auth/internal/transport/cert/default_cert.go
create mode 100644 vendor/cloud.google.com/go/auth/internal/transport/cert/enterprise_cert.go
create mode 100644 vendor/cloud.google.com/go/auth/internal/transport/cert/secureconnect_cert.go
create mode 100644 vendor/cloud.google.com/go/auth/internal/transport/cert/workload_cert.go
create mode 100644 vendor/cloud.google.com/go/auth/internal/transport/s2a.go
create mode 100644 vendor/cloud.google.com/go/auth/internal/transport/transport.go
create mode 100644 vendor/cloud.google.com/go/auth/oauth2adapt/CHANGES.md
create mode 100644 vendor/cloud.google.com/go/auth/oauth2adapt/LICENSE
create mode 100644 vendor/cloud.google.com/go/auth/oauth2adapt/oauth2adapt.go
create mode 100644 vendor/cloud.google.com/go/auth/threelegged.go
rename vendor/{go.opentelemetry.io/otel/semconv/v1.17.0/doc.go => cloud.google.com/go/compute/metadata/syscheck.go} (53%)
rename vendor/{go.opentelemetry.io/otel/semconv/v1.17.0/exception.go => cloud.google.com/go/compute/metadata/syscheck_linux.go} (60%)
create mode 100644 vendor/cloud.google.com/go/compute/metadata/syscheck_windows.go
create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/.gitignore
create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/BREAKING_CHANGES.md
create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_pipelines_credential.go
delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/go.work.sum
create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/internal/cache.go
delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/internal/exported.go
delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/internal/internal.go
create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed-identity-matrix.json
create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources-post.ps1
create mode 100644 vendor/github.com/digitalocean/godo/droplet_autoscale.go
create mode 100644 vendor/github.com/digitalocean/godo/vpc_peerings.go
create mode 100644 vendor/github.com/fxamacker/cbor/v2/.gitignore
create mode 100644 vendor/github.com/fxamacker/cbor/v2/.golangci.yml
create mode 100644 vendor/github.com/fxamacker/cbor/v2/CODE_OF_CONDUCT.md
create mode 100644 vendor/github.com/fxamacker/cbor/v2/CONTRIBUTING.md
create mode 100644 vendor/github.com/fxamacker/cbor/v2/LICENSE
create mode 100644 vendor/github.com/fxamacker/cbor/v2/README.md
create mode 100644 vendor/github.com/fxamacker/cbor/v2/SECURITY.md
create mode 100644 vendor/github.com/fxamacker/cbor/v2/bytestring.go
create mode 100644 vendor/github.com/fxamacker/cbor/v2/cache.go
create mode 100644 vendor/github.com/fxamacker/cbor/v2/common.go
create mode 100644 vendor/github.com/fxamacker/cbor/v2/decode.go
create mode 100644 vendor/github.com/fxamacker/cbor/v2/diagnose.go
create mode 100644 vendor/github.com/fxamacker/cbor/v2/doc.go
create mode 100644 vendor/github.com/fxamacker/cbor/v2/encode.go
create mode 100644 vendor/github.com/fxamacker/cbor/v2/encode_map.go
create mode 100644 vendor/github.com/fxamacker/cbor/v2/encode_map_go117.go
create mode 100644 vendor/github.com/fxamacker/cbor/v2/simplevalue.go
create mode 100644 vendor/github.com/fxamacker/cbor/v2/stream.go
create mode 100644 vendor/github.com/fxamacker/cbor/v2/structfields.go
create mode 100644 vendor/github.com/fxamacker/cbor/v2/tag.go
create mode 100644 vendor/github.com/fxamacker/cbor/v2/valid.go
create mode 100644 vendor/github.com/go-openapi/swag/BENCHMARK.md
create mode 100644 vendor/github.com/go-openapi/swag/string_bytes.go
create mode 100644 vendor/github.com/go-resty/resty/v2/shellescape/BUILD.bazel
create mode 100644 vendor/github.com/go-resty/resty/v2/shellescape/shellescape.go
create mode 100644 vendor/github.com/go-resty/resty/v2/util_curl.go
delete mode 100644 vendor/github.com/golang/protobuf/jsonpb/decode.go
delete mode 100644 vendor/github.com/golang/protobuf/jsonpb/encode.go
delete mode 100644 vendor/github.com/golang/protobuf/jsonpb/json.go
delete mode 100644 vendor/github.com/golang/protobuf/ptypes/any.go
delete mode 100644 vendor/github.com/golang/protobuf/ptypes/any/any.pb.go
delete mode 100644 vendor/github.com/golang/protobuf/ptypes/doc.go
delete mode 100644 vendor/github.com/golang/protobuf/ptypes/duration.go
delete mode 100644 vendor/github.com/golang/protobuf/ptypes/duration/duration.pb.go
delete mode 100644 vendor/github.com/golang/protobuf/ptypes/timestamp.go
delete mode 100644 vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.pb.go
create mode 100644 vendor/github.com/googleapis/gax-go/v2/internallog/internal/internal.go
create mode 100644 vendor/github.com/googleapis/gax-go/v2/internallog/internallog.go
create mode 100644 vendor/github.com/hashicorp/go-retryablehttp/.go-version
create mode 100644 vendor/github.com/hashicorp/go-retryablehttp/cert_error_go119.go
create mode 100644 vendor/github.com/hashicorp/go-retryablehttp/cert_error_go120.go
create mode 100644 vendor/github.com/hetznercloud/hcloud-go/hcloud/action_waiter.go
create mode 100644 vendor/github.com/hetznercloud/hcloud-go/hcloud/action_watch.go
create mode 100644 vendor/github.com/imdario/mergo/.deepsource.toml
create mode 100644 vendor/github.com/imdario/mergo/CONTRIBUTING.md
create mode 100644 vendor/github.com/imdario/mergo/SECURITY.md
delete mode 100644 vendor/github.com/inlets/cloud-provision/provision/civo.go
delete mode 100644 vendor/github.com/inlets/cloud-provision/provision/equinix_metal.go
create mode 100644 vendor/github.com/klauspost/compress/.gitattributes
rename vendor/github.com/{packethost/packngo => klauspost/compress}/.gitignore (74%)
create mode 100644 vendor/github.com/klauspost/compress/.goreleaser.yml
create mode 100644 vendor/github.com/klauspost/compress/LICENSE
create mode 100644 vendor/github.com/klauspost/compress/README.md
create mode 100644 vendor/github.com/klauspost/compress/SECURITY.md
create mode 100644 vendor/github.com/klauspost/compress/compressible.go
create mode 100644 vendor/github.com/klauspost/compress/fse/README.md
create mode 100644 vendor/github.com/klauspost/compress/fse/bitreader.go
create mode 100644 vendor/github.com/klauspost/compress/fse/bitwriter.go
create mode 100644 vendor/github.com/klauspost/compress/fse/bytereader.go
create mode 100644 vendor/github.com/klauspost/compress/fse/compress.go
create mode 100644 vendor/github.com/klauspost/compress/fse/decompress.go
create mode 100644 vendor/github.com/klauspost/compress/fse/fse.go
create mode 100644 vendor/github.com/klauspost/compress/gen.sh
create mode 100644 vendor/github.com/klauspost/compress/huff0/.gitignore
create mode 100644 vendor/github.com/klauspost/compress/huff0/README.md
create mode 100644 vendor/github.com/klauspost/compress/huff0/bitreader.go
create mode 100644 vendor/github.com/klauspost/compress/huff0/bitwriter.go
create mode 100644 vendor/github.com/klauspost/compress/huff0/compress.go
create mode 100644 vendor/github.com/klauspost/compress/huff0/decompress.go
create mode 100644 vendor/github.com/klauspost/compress/huff0/decompress_amd64.go
create mode 100644 vendor/github.com/klauspost/compress/huff0/decompress_amd64.s
create mode 100644 vendor/github.com/klauspost/compress/huff0/decompress_generic.go
create mode 100644 vendor/github.com/klauspost/compress/huff0/huff0.go
create mode 100644 vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo.go
create mode 100644 vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.go
create mode 100644 vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.s
rename vendor/github.com/{packethost/packngo/LICENSE.txt => klauspost/compress/internal/snapref/LICENSE} (52%)
create mode 100644 vendor/github.com/klauspost/compress/internal/snapref/decode.go
create mode 100644 vendor/github.com/klauspost/compress/internal/snapref/decode_other.go
create mode 100644 vendor/github.com/klauspost/compress/internal/snapref/encode.go
create mode 100644 vendor/github.com/klauspost/compress/internal/snapref/encode_other.go
create mode 100644 vendor/github.com/klauspost/compress/internal/snapref/snappy.go
create mode 100644 vendor/github.com/klauspost/compress/s2sx.mod
create mode 100644 vendor/github.com/klauspost/compress/s2sx.sum
create mode 100644 vendor/github.com/klauspost/compress/zstd/README.md
create mode 100644 vendor/github.com/klauspost/compress/zstd/bitreader.go
create mode 100644 vendor/github.com/klauspost/compress/zstd/bitwriter.go
create mode 100644 vendor/github.com/klauspost/compress/zstd/blockdec.go
create mode 100644 vendor/github.com/klauspost/compress/zstd/blockenc.go
create mode 100644 vendor/github.com/klauspost/compress/zstd/blocktype_string.go
create mode 100644 vendor/github.com/klauspost/compress/zstd/bytebuf.go
create mode 100644 vendor/github.com/klauspost/compress/zstd/bytereader.go
create mode 100644 vendor/github.com/klauspost/compress/zstd/decodeheader.go
create mode 100644 vendor/github.com/klauspost/compress/zstd/decoder.go
create mode 100644 vendor/github.com/klauspost/compress/zstd/decoder_options.go
create mode 100644 vendor/github.com/klauspost/compress/zstd/dict.go
create mode 100644 vendor/github.com/klauspost/compress/zstd/enc_base.go
create mode 100644 vendor/github.com/klauspost/compress/zstd/enc_best.go
create mode 100644 vendor/github.com/klauspost/compress/zstd/enc_better.go
create mode 100644 vendor/github.com/klauspost/compress/zstd/enc_dfast.go
create mode 100644 vendor/github.com/klauspost/compress/zstd/enc_fast.go
create mode 100644 vendor/github.com/klauspost/compress/zstd/encoder.go
create mode 100644 vendor/github.com/klauspost/compress/zstd/encoder_options.go
create mode 100644 vendor/github.com/klauspost/compress/zstd/framedec.go
create mode 100644 vendor/github.com/klauspost/compress/zstd/frameenc.go
create mode 100644 vendor/github.com/klauspost/compress/zstd/fse_decoder.go
create mode 100644 vendor/github.com/klauspost/compress/zstd/fse_decoder_amd64.go
create mode 100644 vendor/github.com/klauspost/compress/zstd/fse_decoder_amd64.s
create mode 100644 vendor/github.com/klauspost/compress/zstd/fse_decoder_generic.go
create mode 100644 vendor/github.com/klauspost/compress/zstd/fse_encoder.go
create mode 100644 vendor/github.com/klauspost/compress/zstd/fse_predefined.go
create mode 100644 vendor/github.com/klauspost/compress/zstd/hash.go
create mode 100644 vendor/github.com/klauspost/compress/zstd/history.go
create mode 100644 vendor/github.com/klauspost/compress/zstd/internal/xxhash/LICENSE.txt
create mode 100644 vendor/github.com/klauspost/compress/zstd/internal/xxhash/README.md
create mode 100644 vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash.go
create mode 100644 vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_amd64.s
create mode 100644 vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_arm64.s
create mode 100644 vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_asm.go
create mode 100644 vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_other.go
create mode 100644 vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_safe.go
create mode 100644 vendor/github.com/klauspost/compress/zstd/matchlen_amd64.go
create mode 100644 vendor/github.com/klauspost/compress/zstd/matchlen_amd64.s
create mode 100644 vendor/github.com/klauspost/compress/zstd/matchlen_generic.go
create mode 100644 vendor/github.com/klauspost/compress/zstd/seqdec.go
create mode 100644 vendor/github.com/klauspost/compress/zstd/seqdec_amd64.go
create mode 100644 vendor/github.com/klauspost/compress/zstd/seqdec_amd64.s
create mode 100644 vendor/github.com/klauspost/compress/zstd/seqdec_generic.go
create mode 100644 vendor/github.com/klauspost/compress/zstd/seqenc.go
create mode 100644 vendor/github.com/klauspost/compress/zstd/snappy.go
create mode 100644 vendor/github.com/klauspost/compress/zstd/zip.go
create mode 100644 vendor/github.com/klauspost/compress/zstd/zstd.go
create mode 100644 vendor/github.com/linode/linodego/account_agreements.go
create mode 100644 vendor/github.com/linode/linodego/account_child.go
create mode 100644 vendor/github.com/linode/linodego/account_maintenance.go
create mode 100644 vendor/github.com/linode/linodego/account_payment_methods.go
create mode 100644 vendor/github.com/linode/linodego/account_promo_credits.go
create mode 100644 vendor/github.com/linode/linodego/base_types.go
create mode 100644 vendor/github.com/linode/linodego/client_http.go
create mode 100644 vendor/github.com/linode/linodego/instance_nodebalancers.go
create mode 100644 vendor/github.com/linode/linodego/lke_clusters_control_plane.go
create mode 100644 vendor/github.com/linode/linodego/lke_types.go
create mode 100644 vendor/github.com/linode/linodego/logger.go
create mode 100644 vendor/github.com/linode/linodego/network_reserved_ips.go
create mode 100644 vendor/github.com/linode/linodego/network_transfer_prices.go
create mode 100644 vendor/github.com/linode/linodego/nodebalancer_types.go
create mode 100644 vendor/github.com/linode/linodego/paged_response_structs.go
create mode 100644 vendor/github.com/linode/linodego/placement_groups.go
create mode 100644 vendor/github.com/linode/linodego/pointer_helpers.go
create mode 100644 vendor/github.com/linode/linodego/request_helpers.go
create mode 100644 vendor/github.com/linode/linodego/retries_http.go
create mode 100644 vendor/github.com/linode/linodego/volumes_types.go
create mode 100644 vendor/github.com/linode/linodego/vpc_ips.go
delete mode 100644 vendor/github.com/packethost/packngo/CHANGELOG.md
delete mode 100644 vendor/github.com/packethost/packngo/CONTRIBUTING.md
delete mode 100644 vendor/github.com/packethost/packngo/DCO
delete mode 100644 vendor/github.com/packethost/packngo/Makefile
delete mode 100644 vendor/github.com/packethost/packngo/OWNERS.md
delete mode 100644 vendor/github.com/packethost/packngo/README.md
delete mode 100644 vendor/github.com/packethost/packngo/RELEASE.md
delete mode 100644 vendor/github.com/packethost/packngo/SUPPORT.md
delete mode 100644 vendor/github.com/packethost/packngo/api_call_options.go
delete mode 100644 vendor/github.com/packethost/packngo/apikeys.go
delete mode 100644 vendor/github.com/packethost/packngo/batches.go
delete mode 100644 vendor/github.com/packethost/packngo/bgp_configs.go
delete mode 100644 vendor/github.com/packethost/packngo/bgp_sessions.go
delete mode 100644 vendor/github.com/packethost/packngo/billing_address.go
delete mode 100644 vendor/github.com/packethost/packngo/capacities.go
delete mode 100644 vendor/github.com/packethost/packngo/clientopt.go
delete mode 100644 vendor/github.com/packethost/packngo/code-of-conduct.md
delete mode 100644 vendor/github.com/packethost/packngo/connections.go
delete mode 100644 vendor/github.com/packethost/packngo/device_ports.go
delete mode 100644 vendor/github.com/packethost/packngo/devices.go
delete mode 100644 vendor/github.com/packethost/packngo/doc.go
delete mode 100644 vendor/github.com/packethost/packngo/email.go
delete mode 100644 vendor/github.com/packethost/packngo/events.go
delete mode 100644 vendor/github.com/packethost/packngo/fabric_service_tokens.go
delete mode 100644 vendor/github.com/packethost/packngo/facilities.go
delete mode 100644 vendor/github.com/packethost/packngo/hardware_reservations.go
delete mode 100644 vendor/github.com/packethost/packngo/invitations.go
delete mode 100644 vendor/github.com/packethost/packngo/ip.go
delete mode 100644 vendor/github.com/packethost/packngo/members.go
delete mode 100644 vendor/github.com/packethost/packngo/metal_gateway.go
delete mode 100644 vendor/github.com/packethost/packngo/metros.go
delete mode 100644 vendor/github.com/packethost/packngo/notifications.go
delete mode 100644 vendor/github.com/packethost/packngo/operatingsystems.go
delete mode 100644 vendor/github.com/packethost/packngo/organizations.go
delete mode 100644 vendor/github.com/packethost/packngo/packngo.go
delete mode 100644 vendor/github.com/packethost/packngo/payment_methods.go
delete mode 100644 vendor/github.com/packethost/packngo/plans.go
delete mode 100644 vendor/github.com/packethost/packngo/ports.go
delete mode 100644 vendor/github.com/packethost/packngo/projects.go
delete mode 100644 vendor/github.com/packethost/packngo/rate.go
delete mode 100644 vendor/github.com/packethost/packngo/renovate.json
delete mode 100644 vendor/github.com/packethost/packngo/spotmarket.go
delete mode 100644 vendor/github.com/packethost/packngo/spotmarketrequest.go
delete mode 100644 vendor/github.com/packethost/packngo/sshkeys.go
delete mode 100644 vendor/github.com/packethost/packngo/timestamp.go
delete mode 100644 vendor/github.com/packethost/packngo/two_factor_auth.go
delete mode 100644 vendor/github.com/packethost/packngo/user.go
delete mode 100644 vendor/github.com/packethost/packngo/utils.go
delete mode 100644 vendor/github.com/packethost/packngo/version.go
delete mode 100644 vendor/github.com/packethost/packngo/virtualcircuits.go
delete mode 100644 vendor/github.com/packethost/packngo/virtualnetworks.go
delete mode 100644 vendor/github.com/packethost/packngo/vlan_assignments.go
delete mode 100644 vendor/github.com/packethost/packngo/volumes.go
delete mode 100644 vendor/github.com/packethost/packngo/vrf.go
create mode 100644 vendor/github.com/prometheus/client_golang/internal/github.com/golang/gddo/LICENSE
create mode 100644 vendor/github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil/header/header.go
create mode 100644 vendor/github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil/negotiate.go
delete mode 100644 vendor/github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg/README.txt
delete mode 100644 vendor/github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg/autoneg.go
create mode 100644 vendor/github.com/prometheus/common/model/labelset_string.go
create mode 100644 vendor/github.com/prometheus/procfs/net_tls_stat.go
delete mode 100644 vendor/github.com/scaleway/scaleway-sdk-go/api/marketplace/v1/marketplace_sdk.go
delete mode 100644 vendor/github.com/scaleway/scaleway-sdk-go/api/marketplace/v1/marketplace_utils.go
create mode 100644 vendor/github.com/scaleway/scaleway-sdk-go/api/marketplace/v2/marketplace_sdk.go
create mode 100644 vendor/github.com/scaleway/scaleway-sdk-go/api/marketplace/v2/marketplace_utils.go
create mode 100644 vendor/github.com/x448/float16/.travis.yml
create mode 100644 vendor/github.com/x448/float16/LICENSE
create mode 100644 vendor/github.com/x448/float16/README.md
create mode 100644 vendor/github.com/x448/float16/float16.go
create mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request/body_wrapper.go
create mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request/resp_writer_wrapper.go
create mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/env.go
create mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/httpconv.go
create mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/util.go
create mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/v1.20.0.go
create mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/start_time_context.go
delete mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/wrap.go
delete mode 100644 vendor/go.opentelemetry.io/otel/.gitmodules
create mode 100644 vendor/go.opentelemetry.io/otel/attribute/README.md
create mode 100644 vendor/go.opentelemetry.io/otel/baggage/README.md
create mode 100644 vendor/go.opentelemetry.io/otel/codes/README.md
create mode 100644 vendor/go.opentelemetry.io/otel/metric/README.md
create mode 100644 vendor/go.opentelemetry.io/otel/metric/embedded/README.md
create mode 100644 vendor/go.opentelemetry.io/otel/metric/noop/README.md
create mode 100644 vendor/go.opentelemetry.io/otel/metric/noop/noop.go
create mode 100644 vendor/go.opentelemetry.io/otel/propagation/README.md
create mode 100644 vendor/go.opentelemetry.io/otel/renovate.json
delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.17.0/schema.go
create mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.20.0/README.md
create mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.20.0/attribute_group.go
create mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.20.0/doc.go
rename vendor/go.opentelemetry.io/otel/semconv/{v1.17.0 => v1.20.0}/event.go (92%)
create mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.20.0/exception.go
create mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.20.0/http.go
rename vendor/go.opentelemetry.io/otel/semconv/{v1.17.0 => v1.20.0}/resource.go (92%)
create mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.20.0/schema.go
rename vendor/go.opentelemetry.io/otel/semconv/{v1.17.0 => v1.20.0}/trace.go (63%)
create mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.26.0/README.md
create mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.26.0/attribute_group.go
create mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.26.0/doc.go
create mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.26.0/exception.go
create mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.26.0/metric.go
create mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.26.0/schema.go
create mode 100644 vendor/go.opentelemetry.io/otel/trace/README.md
create mode 100644 vendor/go.opentelemetry.io/otel/trace/embedded/README.md
create mode 100644 vendor/go.opentelemetry.io/otel/trace/provider.go
create mode 100644 vendor/go.opentelemetry.io/otel/trace/span.go
create mode 100644 vendor/go.opentelemetry.io/otel/trace/tracer.go
delete mode 100644 vendor/go.opentelemetry.io/otel/verify_examples.sh
create mode 100644 vendor/go.opentelemetry.io/otel/verify_readmes.sh
create mode 100644 vendor/go.opentelemetry.io/otel/verify_released_changelog.sh
rename vendor/golang.org/x/crypto/chacha20/{chacha_ppc64le.go => chacha_ppc64x.go} (89%)
rename vendor/golang.org/x/crypto/chacha20/{chacha_ppc64le.s => chacha_ppc64x.s} (76%)
rename vendor/golang.org/x/crypto/internal/poly1305/{sum_ppc64le.go => sum_ppc64x.go} (95%)
rename vendor/golang.org/x/crypto/internal/poly1305/{sum_ppc64le.s => sum_ppc64x.s} (89%)
create mode 100644 vendor/golang.org/x/net/http2/config.go
create mode 100644 vendor/golang.org/x/net/http2/config_go124.go
create mode 100644 vendor/golang.org/x/net/http2/config_pre_go124.go
create mode 100644 vendor/golang.org/x/net/http2/unencrypted.go
create mode 100644 vendor/golang.org/x/oauth2/clientcredentials/clientcredentials.go
create mode 100644 vendor/golang.org/x/sync/LICENSE
create mode 100644 vendor/golang.org/x/sync/PATENTS
create mode 100644 vendor/golang.org/x/sync/errgroup/errgroup.go
create mode 100644 vendor/golang.org/x/sync/errgroup/go120.go
create mode 100644 vendor/golang.org/x/sync/errgroup/pre_go120.go
create mode 100644 vendor/golang.org/x/sys/cpu/asm_darwin_x86_gc.s
create mode 100644 vendor/golang.org/x/sys/cpu/cpu_darwin_x86.go
rename vendor/golang.org/x/sys/cpu/{cpu_x86.s => cpu_gc_x86.s} (94%)
create mode 100644 vendor/golang.org/x/sys/cpu/cpu_linux_riscv64.go
create mode 100644 vendor/golang.org/x/sys/cpu/cpu_other_x86.go
create mode 100644 vendor/golang.org/x/sys/cpu/syscall_darwin_x86_gc.go
create mode 100644 vendor/golang.org/x/sys/unix/vgetrandom_linux.go
create mode 100644 vendor/golang.org/x/sys/unix/vgetrandom_unsupported.go
create mode 100644 vendor/golang.org/x/sys/windows/registry/key.go
create mode 100644 vendor/golang.org/x/sys/windows/registry/mksyscall.go
create mode 100644 vendor/golang.org/x/sys/windows/registry/syscall.go
create mode 100644 vendor/golang.org/x/sys/windows/registry/value.go
create mode 100644 vendor/golang.org/x/sys/windows/registry/zsyscall_windows.go
create mode 100644 vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go
create mode 100644 vendor/golang.org/x/tools/go/gcexportdata/importer.go
create mode 100644 vendor/golang.org/x/tools/go/packages/doc.go
create mode 100644 vendor/golang.org/x/tools/go/packages/external.go
create mode 100644 vendor/golang.org/x/tools/go/packages/golist.go
create mode 100644 vendor/golang.org/x/tools/go/packages/golist_overlay.go
create mode 100644 vendor/golang.org/x/tools/go/packages/loadmode_string.go
create mode 100644 vendor/golang.org/x/tools/go/packages/packages.go
create mode 100644 vendor/golang.org/x/tools/go/packages/visit.go
create mode 100644 vendor/golang.org/x/tools/go/types/objectpath/objectpath.go
create mode 100644 vendor/golang.org/x/tools/go/types/typeutil/callee.go
create mode 100644 vendor/golang.org/x/tools/go/types/typeutil/imports.go
create mode 100644 vendor/golang.org/x/tools/go/types/typeutil/map.go
create mode 100644 vendor/golang.org/x/tools/go/types/typeutil/methodsetcache.go
create mode 100644 vendor/golang.org/x/tools/go/types/typeutil/ui.go
create mode 100644 vendor/golang.org/x/tools/internal/aliases/aliases.go
create mode 100644 vendor/golang.org/x/tools/internal/aliases/aliases_go122.go
create mode 100644 vendor/golang.org/x/tools/internal/gcimporter/bimport.go
create mode 100644 vendor/golang.org/x/tools/internal/gcimporter/exportdata.go
create mode 100644 vendor/golang.org/x/tools/internal/gcimporter/gcimporter.go
create mode 100644 vendor/golang.org/x/tools/internal/gcimporter/iexport.go
create mode 100644 vendor/golang.org/x/tools/internal/gcimporter/iimport.go
create mode 100644 vendor/golang.org/x/tools/internal/gcimporter/iimport_go122.go
create mode 100644 vendor/golang.org/x/tools/internal/gcimporter/predeclared.go
create mode 100644 vendor/golang.org/x/tools/internal/gcimporter/ureader_yes.go
create mode 100644 vendor/golang.org/x/tools/internal/imports/source.go
create mode 100644 vendor/golang.org/x/tools/internal/imports/source_env.go
create mode 100644 vendor/golang.org/x/tools/internal/packagesinternal/packages.go
create mode 100644 vendor/golang.org/x/tools/internal/pkgbits/codes.go
create mode 100644 vendor/golang.org/x/tools/internal/pkgbits/decoder.go
create mode 100644 vendor/golang.org/x/tools/internal/pkgbits/doc.go
create mode 100644 vendor/golang.org/x/tools/internal/pkgbits/encoder.go
create mode 100644 vendor/golang.org/x/tools/internal/pkgbits/flags.go
create mode 100644 vendor/golang.org/x/tools/internal/pkgbits/reloc.go
create mode 100644 vendor/golang.org/x/tools/internal/pkgbits/support.go
create mode 100644 vendor/golang.org/x/tools/internal/pkgbits/sync.go
create mode 100644 vendor/golang.org/x/tools/internal/pkgbits/syncmarker_string.go
create mode 100644 vendor/golang.org/x/tools/internal/pkgbits/version.go
create mode 100644 vendor/golang.org/x/tools/internal/typeparams/common.go
create mode 100644 vendor/golang.org/x/tools/internal/typeparams/coretype.go
create mode 100644 vendor/golang.org/x/tools/internal/typeparams/free.go
create mode 100644 vendor/golang.org/x/tools/internal/typeparams/normalize.go
create mode 100644 vendor/golang.org/x/tools/internal/typeparams/termlist.go
create mode 100644 vendor/golang.org/x/tools/internal/typeparams/typeterm.go
create mode 100644 vendor/golang.org/x/tools/internal/typesinternal/element.go
create mode 100644 vendor/golang.org/x/tools/internal/typesinternal/errorcode.go
create mode 100644 vendor/golang.org/x/tools/internal/typesinternal/errorcode_string.go
create mode 100644 vendor/golang.org/x/tools/internal/typesinternal/recv.go
create mode 100644 vendor/golang.org/x/tools/internal/typesinternal/toonew.go
create mode 100644 vendor/golang.org/x/tools/internal/typesinternal/types.go
create mode 100644 vendor/golang.org/x/tools/internal/versions/constraint.go
create mode 100644 vendor/golang.org/x/tools/internal/versions/constraint_go121.go
create mode 100644 vendor/golang.org/x/tools/internal/versions/features.go
create mode 100644 vendor/golang.org/x/tools/internal/versions/gover.go
create mode 100644 vendor/golang.org/x/tools/internal/versions/types.go
create mode 100644 vendor/golang.org/x/tools/internal/versions/versions.go
create mode 100644 vendor/google.golang.org/api/compute/v1/compute2-gen.go
create mode 100644 vendor/google.golang.org/api/compute/v1/compute3-gen.go
delete mode 100644 vendor/google.golang.org/api/internal/gensupport/retryable_linux.go
rename vendor/google.golang.org/grpc/{internal/channelz/util_nonlinux.go => balancer/pickfirst/internal/internal.go} (71%)
rename vendor/google.golang.org/grpc/{ => balancer/pickfirst}/pickfirst.go (69%)
create mode 100644 vendor/google.golang.org/grpc/balancer/pickfirst/pickfirstleaf/pickfirstleaf.go
delete mode 100644 vendor/google.golang.org/grpc/codegen.sh
create mode 100644 vendor/google.golang.org/grpc/encoding/encoding_v2.go
create mode 100644 vendor/google.golang.org/grpc/experimental/stats/metricregistry.go
create mode 100644 vendor/google.golang.org/grpc/experimental/stats/metrics.go
create mode 100644 vendor/google.golang.org/grpc/grpclog/internal/grpclog.go
create mode 100644 vendor/google.golang.org/grpc/grpclog/internal/logger.go
rename vendor/google.golang.org/grpc/{internal/grpclog/grpclog.go => grpclog/internal/loggerv2.go} (52%)
create mode 100644 vendor/google.golang.org/grpc/internal/balancer/gracefulswitch/config.go
create mode 100644 vendor/google.golang.org/grpc/internal/channelz/channel.go
create mode 100644 vendor/google.golang.org/grpc/internal/channelz/channelmap.go
delete mode 100644 vendor/google.golang.org/grpc/internal/channelz/id.go
create mode 100644 vendor/google.golang.org/grpc/internal/channelz/server.go
create mode 100644 vendor/google.golang.org/grpc/internal/channelz/socket.go
create mode 100644 vendor/google.golang.org/grpc/internal/channelz/subchannel.go
rename vendor/google.golang.org/grpc/internal/channelz/{types_linux.go => syscall_linux.go} (83%)
rename vendor/google.golang.org/grpc/internal/channelz/{types_nonlinux.go => syscall_nonlinux.go} (87%)
create mode 100644 vendor/google.golang.org/grpc/internal/channelz/trace.go
delete mode 100644 vendor/google.golang.org/grpc/internal/channelz/types.go
rename vendor/google.golang.org/grpc/internal/grpclog/{prefixLogger.go => prefix_logger.go} (63%)
delete mode 100644 vendor/google.golang.org/grpc/internal/grpcrand/grpcrand.go
create mode 100644 vendor/google.golang.org/grpc/internal/stats/labels.go
create mode 100644 vendor/google.golang.org/grpc/internal/stats/metrics_recorder_list.go
rename vendor/google.golang.org/grpc/internal/{tcp_keepalive_nonunix.go => tcp_keepalive_others.go} (96%)
create mode 100644 vendor/google.golang.org/grpc/internal/tcp_keepalive_windows.go
delete mode 100644 vendor/google.golang.org/grpc/internal/xds_handshake_cluster.go
create mode 100644 vendor/google.golang.org/grpc/mem/buffer_pool.go
create mode 100644 vendor/google.golang.org/grpc/mem/buffer_slice.go
create mode 100644 vendor/google.golang.org/grpc/mem/buffers.go
delete mode 100644 vendor/google.golang.org/grpc/regenerate.sh
delete mode 100644 vendor/google.golang.org/grpc/shared_buffer_pool.go
create mode 100644 vendor/google.golang.org/grpc/stream_interfaces.go
create mode 100644 vendor/google.golang.org/grpc/trace_notrace.go
rename vendor/google.golang.org/grpc/{internal/channelz/util_linux.go => trace_withtrace.go} (59%)
delete mode 100644 vendor/google.golang.org/grpc/vet.sh
create mode 100644 vendor/google.golang.org/protobuf/internal/editiondefaults/defaults.go
create mode 100644 vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb
create mode 100644 vendor/google.golang.org/protobuf/internal/editionssupport/editions.go
create mode 100644 vendor/google.golang.org/protobuf/internal/filedesc/editions.go
create mode 100644 vendor/google.golang.org/protobuf/internal/genid/go_features_gen.go
delete mode 100644 vendor/google.golang.org/protobuf/internal/impl/codec_reflect.go
create mode 100644 vendor/google.golang.org/protobuf/internal/impl/equal.go
delete mode 100644 vendor/google.golang.org/protobuf/internal/impl/pointer_reflect.go
delete mode 100644 vendor/google.golang.org/protobuf/internal/strs/strings_pure.go
create mode 100644 vendor/google.golang.org/protobuf/protoadapt/convert.go
delete mode 100644 vendor/google.golang.org/protobuf/reflect/protodesc/editions_defaults.binpb
delete mode 100644 vendor/google.golang.org/protobuf/reflect/protoreflect/value_pure.go
create mode 100644 vendor/google.golang.org/protobuf/types/gofeaturespb/go_features.pb.go
rename vendor/{github.com/evanphx/json-patch => gopkg.in/evanphx/json-patch.v4}/.gitignore (100%)
rename vendor/{github.com/evanphx/json-patch => gopkg.in/evanphx/json-patch.v4}/LICENSE (100%)
rename vendor/{github.com/evanphx/json-patch => gopkg.in/evanphx/json-patch.v4}/README.md (97%)
rename vendor/{github.com/evanphx/json-patch => gopkg.in/evanphx/json-patch.v4}/errors.go (100%)
rename vendor/{github.com/evanphx/json-patch => gopkg.in/evanphx/json-patch.v4}/merge.go (100%)
rename vendor/{github.com/evanphx/json-patch => gopkg.in/evanphx/json-patch.v4}/patch.go (99%)
create mode 100644 vendor/k8s.io/api/admissionregistration/v1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/apidiscovery/v2/doc.go
create mode 100644 vendor/k8s.io/api/apidiscovery/v2/generated.pb.go
create mode 100644 vendor/k8s.io/api/apidiscovery/v2/generated.proto
create mode 100644 vendor/k8s.io/api/apidiscovery/v2/register.go
create mode 100644 vendor/k8s.io/api/apidiscovery/v2/types.go
create mode 100644 vendor/k8s.io/api/apidiscovery/v2/zz_generated.deepcopy.go
create mode 100644 vendor/k8s.io/api/apidiscovery/v2/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/apps/v1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/authentication/v1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/authorization/v1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/autoscaling/v1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/autoscaling/v2/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/batch/v1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/certificates/v1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/coordination/v1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/coordination/v1alpha1/doc.go
create mode 100644 vendor/k8s.io/api/coordination/v1alpha1/generated.pb.go
create mode 100644 vendor/k8s.io/api/coordination/v1alpha1/generated.proto
create mode 100644 vendor/k8s.io/api/coordination/v1alpha1/register.go
create mode 100644 vendor/k8s.io/api/coordination/v1alpha1/types.go
create mode 100644 vendor/k8s.io/api/coordination/v1alpha1/types_swagger_doc_generated.go
create mode 100644 vendor/k8s.io/api/coordination/v1alpha1/zz_generated.deepcopy.go
create mode 100644 vendor/k8s.io/api/coordination/v1alpha1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/core/v1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/discovery/v1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/events/v1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/flowcontrol/v1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/networking/v1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/networking/v1beta1/well_known_labels.go
create mode 100644 vendor/k8s.io/api/node/v1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/policy/v1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/rbac/v1/zz_generated.prerelease-lifecycle.go
delete mode 100644 vendor/k8s.io/api/resource/v1alpha2/generated.pb.go
delete mode 100644 vendor/k8s.io/api/resource/v1alpha2/generated.proto
delete mode 100644 vendor/k8s.io/api/resource/v1alpha2/types.go
delete mode 100644 vendor/k8s.io/api/resource/v1alpha2/types_swagger_doc_generated.go
delete mode 100644 vendor/k8s.io/api/resource/v1alpha2/zz_generated.deepcopy.go
rename vendor/k8s.io/api/resource/{v1alpha2 => v1alpha3}/doc.go (84%)
create mode 100644 vendor/k8s.io/api/resource/v1alpha3/generated.pb.go
create mode 100644 vendor/k8s.io/api/resource/v1alpha3/generated.proto
rename vendor/k8s.io/api/resource/{v1alpha2 => v1alpha3}/register.go (92%)
create mode 100644 vendor/k8s.io/api/resource/v1alpha3/types.go
create mode 100644 vendor/k8s.io/api/resource/v1alpha3/types_swagger_doc_generated.go
create mode 100644 vendor/k8s.io/api/resource/v1alpha3/zz_generated.deepcopy.go
create mode 100644 vendor/k8s.io/api/scheduling/v1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/storage/v1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/storagemigration/v1alpha1/doc.go
create mode 100644 vendor/k8s.io/api/storagemigration/v1alpha1/generated.pb.go
create mode 100644 vendor/k8s.io/api/storagemigration/v1alpha1/generated.proto
create mode 100644 vendor/k8s.io/api/storagemigration/v1alpha1/register.go
create mode 100644 vendor/k8s.io/api/storagemigration/v1alpha1/types.go
create mode 100644 vendor/k8s.io/api/storagemigration/v1alpha1/types_swagger_doc_generated.go
create mode 100644 vendor/k8s.io/api/storagemigration/v1alpha1/zz_generated.deepcopy.go
create mode 100644 vendor/k8s.io/api/storagemigration/v1alpha1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/api/meta/testrestmapper/test_restmapper.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/api/validation/OWNERS
create mode 100644 vendor/k8s.io/apimachinery/pkg/apis/meta/internalversion/validation/validation.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/direct/direct.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/buffers.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/custom.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/decode.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/diagnostic.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/encode.go
delete mode 100644 vendor/k8s.io/apimachinery/pkg/util/sets/ordered.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/util/validation/OWNERS
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/auditannotation.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/expressionwarning.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/matchresources.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/namedrulewithoperations.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/paramkind.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/paramref.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/typechecking.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/validatingadmissionpolicy.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/validatingadmissionpolicybinding.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/validatingadmissionpolicybindingspec.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/validatingadmissionpolicyspec.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/validatingadmissionpolicystatus.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/validation.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/variable.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/batch/v1/successpolicy.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/batch/v1/successpolicyrule.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/coordination/v1alpha1/leasecandidate.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/coordination/v1alpha1/leasecandidatespec.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/apparmorprofile.go
delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/claimsource.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/containeruser.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/imagevolumesource.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/linuxcontaineruser.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/nodefeatures.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/noderuntimehandler.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/noderuntimehandlerfeatures.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/resourcehealth.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/resourcestatus.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/volumemountstatus.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ipaddress.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ipaddressspec.go
rename vendor/k8s.io/client-go/applyconfigurations/{resource/v1alpha2/resourceclassparametersreference.go => networking/v1beta1/parentreference.go} (51%)
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/servicecidr.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/servicecidrspec.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/servicecidrstatus.go
delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/allocationresult.go
delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaimparametersreference.go
delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourceclaimspec.go
delete mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha2/resourcehandle.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/allocationresult.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/basicdevice.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/celdeviceselector.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/device.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceallocationconfiguration.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceallocationresult.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceattribute.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceclaim.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceclaimconfiguration.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceclass.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceclassconfiguration.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceclassspec.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceconfiguration.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceconstraint.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicerequest.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicerequestallocationresult.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/deviceselector.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/opaquedeviceconfiguration.go
rename vendor/k8s.io/client-go/applyconfigurations/resource/{v1alpha2 => v1alpha3}/podschedulingcontext.go (93%)
rename vendor/k8s.io/client-go/applyconfigurations/resource/{v1alpha2 => v1alpha3}/podschedulingcontextspec.go (87%)
rename vendor/k8s.io/client-go/applyconfigurations/resource/{v1alpha2 => v1alpha3}/podschedulingcontextstatus.go (84%)
rename vendor/k8s.io/client-go/applyconfigurations/resource/{v1alpha2 => v1alpha3}/resourceclaim.go (93%)
rename vendor/k8s.io/client-go/applyconfigurations/resource/{v1alpha2 => v1alpha3}/resourceclaimconsumerreference.go (94%)
rename vendor/k8s.io/client-go/applyconfigurations/resource/{v1alpha2 => v1alpha3}/resourceclaimschedulingstatus.go (86%)
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourceclaimspec.go
rename vendor/k8s.io/client-go/applyconfigurations/resource/{v1alpha2 => v1alpha3}/resourceclaimstatus.go (77%)
rename vendor/k8s.io/client-go/applyconfigurations/resource/{v1alpha2 => v1alpha3}/resourceclaimtemplate.go (93%)
rename vendor/k8s.io/client-go/applyconfigurations/resource/{v1alpha2 => v1alpha3}/resourceclaimtemplatespec.go (94%)
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourcepool.go
rename vendor/k8s.io/client-go/applyconfigurations/resource/{v1alpha2/resourceclass.go => v1alpha3/resourceslice.go} (61%)
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourceslicespec.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/volumeattributesclass.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/storagemigration/v1alpha1/groupversionresource.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/storagemigration/v1alpha1/migrationcondition.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/storagemigration/v1alpha1/storageversionmigration.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/storagemigration/v1alpha1/storageversionmigrationspec.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/storagemigration/v1alpha1/storageversionmigrationstatus.go
create mode 100644 vendor/k8s.io/client-go/features/envvar.go
create mode 100644 vendor/k8s.io/client-go/features/features.go
create mode 100644 vendor/k8s.io/client-go/features/known_features.go
create mode 100644 vendor/k8s.io/client-go/gentype/type.go
create mode 100644 vendor/k8s.io/client-go/informers/admissionregistration/v1/validatingadmissionpolicy.go
create mode 100644 vendor/k8s.io/client-go/informers/admissionregistration/v1/validatingadmissionpolicybinding.go
create mode 100644 vendor/k8s.io/client-go/informers/coordination/v1alpha1/interface.go
create mode 100644 vendor/k8s.io/client-go/informers/coordination/v1alpha1/leasecandidate.go
create mode 100644 vendor/k8s.io/client-go/informers/networking/v1beta1/ipaddress.go
create mode 100644 vendor/k8s.io/client-go/informers/networking/v1beta1/servicecidr.go
create mode 100644 vendor/k8s.io/client-go/informers/resource/v1alpha3/deviceclass.go
rename vendor/k8s.io/client-go/informers/resource/{v1alpha2 => v1alpha3}/interface.go (80%)
rename vendor/k8s.io/client-go/informers/resource/{v1alpha2 => v1alpha3}/podschedulingcontext.go (86%)
rename vendor/k8s.io/client-go/informers/resource/{v1alpha2 => v1alpha3}/resourceclaim.go (85%)
rename vendor/k8s.io/client-go/informers/resource/{v1alpha2 => v1alpha3}/resourceclaimtemplate.go (86%)
rename vendor/k8s.io/client-go/informers/resource/{v1alpha2/resourceclass.go => v1alpha3/resourceslice.go} (64%)
create mode 100644 vendor/k8s.io/client-go/informers/storage/v1beta1/volumeattributesclass.go
create mode 100644 vendor/k8s.io/client-go/informers/storagemigration/interface.go
create mode 100644 vendor/k8s.io/client-go/informers/storagemigration/v1alpha1/interface.go
create mode 100644 vendor/k8s.io/client-go/informers/storagemigration/v1alpha1/storageversionmigration.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicy.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicybinding.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/coordination/v1alpha1/coordination_client.go
rename vendor/k8s.io/client-go/kubernetes/typed/{resource/v1alpha2 => coordination/v1alpha1}/doc.go (97%)
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/coordination/v1alpha1/generated_expansion.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/coordination/v1alpha1/leasecandidate.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/ipaddress.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/servicecidr.go
delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/podschedulingcontext.go
delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/resourceclaim.go
delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/resourceclaimtemplate.go
delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha2/resourceclass.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/deviceclass.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/doc.go
rename vendor/k8s.io/client-go/kubernetes/typed/resource/{v1alpha2 => v1alpha3}/generated_expansion.go (88%)
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/podschedulingcontext.go
rename vendor/k8s.io/client-go/kubernetes/typed/resource/{v1alpha2 => v1alpha3}/resource_client.go (65%)
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/resourceclaim.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/resourceclaimtemplate.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha3/resourceslice.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/volumeattributesclass.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1/generated_expansion.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1/storagemigration_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1alpha1/storageversionmigration.go
create mode 100644 vendor/k8s.io/client-go/listers/admissionregistration/v1/validatingadmissionpolicy.go
create mode 100644 vendor/k8s.io/client-go/listers/admissionregistration/v1/validatingadmissionpolicybinding.go
create mode 100644 vendor/k8s.io/client-go/listers/coordination/v1alpha1/expansion_generated.go
create mode 100644 vendor/k8s.io/client-go/listers/coordination/v1alpha1/leasecandidate.go
create mode 100644 vendor/k8s.io/client-go/listers/doc.go
create mode 100644 vendor/k8s.io/client-go/listers/generic_helpers.go
create mode 100644 vendor/k8s.io/client-go/listers/networking/v1beta1/ipaddress.go
create mode 100644 vendor/k8s.io/client-go/listers/networking/v1beta1/servicecidr.go
delete mode 100644 vendor/k8s.io/client-go/listers/resource/v1alpha2/resourceclass.go
create mode 100644 vendor/k8s.io/client-go/listers/resource/v1alpha3/deviceclass.go
rename vendor/k8s.io/client-go/listers/resource/{v1alpha2 => v1alpha3}/expansion_generated.go (85%)
rename vendor/k8s.io/client-go/listers/resource/{v1alpha2 => v1alpha3}/podschedulingcontext.go (59%)
rename vendor/k8s.io/client-go/listers/resource/{v1alpha2 => v1alpha3}/resourceclaim.go (58%)
rename vendor/k8s.io/client-go/listers/resource/{v1alpha2 => v1alpha3}/resourceclaimtemplate.go (59%)
create mode 100644 vendor/k8s.io/client-go/listers/resource/v1alpha3/resourceslice.go
create mode 100644 vendor/k8s.io/client-go/listers/storage/v1beta1/volumeattributesclass.go
create mode 100644 vendor/k8s.io/client-go/listers/storagemigration/v1alpha1/expansion_generated.go
create mode 100644 vendor/k8s.io/client-go/listers/storagemigration/v1alpha1/storageversionmigration.go
create mode 100644 vendor/k8s.io/client-go/util/consistencydetector/data_consistency_detector.go
create mode 100644 vendor/k8s.io/client-go/util/consistencydetector/list_data_consistency_detector.go
create mode 100644 vendor/k8s.io/client-go/util/consistencydetector/watch_list_data_consistency_detector.go
create mode 100644 vendor/k8s.io/client-go/util/watchlist/watch_list.go
delete mode 100644 vendor/k8s.io/code-generator/cmd/client-gen/path/path.go
delete mode 100644 vendor/k8s.io/code-generator/pkg/util/build.go
delete mode 100644 vendor/k8s.io/code-generator/pkg/util/plural_exceptions.go
delete mode 100644 vendor/k8s.io/gengo/args/args.go
delete mode 100644 vendor/k8s.io/gengo/generator/default_generator.go
delete mode 100644 vendor/k8s.io/gengo/generator/default_package.go
delete mode 100644 vendor/k8s.io/gengo/generator/transitive_closure.go
delete mode 100644 vendor/k8s.io/gengo/parser/parse.go
delete mode 100644 vendor/k8s.io/gengo/types/flatten.go
rename vendor/k8s.io/gengo/{ => v2}/LICENSE (100%)
create mode 100644 vendor/k8s.io/gengo/v2/Makefile
create mode 100644 vendor/k8s.io/gengo/v2/README.md
rename vendor/k8s.io/gengo/{types => v2}/comments.go (86%)
create mode 100644 vendor/k8s.io/gengo/v2/execute.go
rename vendor/k8s.io/gengo/{ => v2}/generator/doc.go (96%)
rename vendor/k8s.io/gengo/{ => v2}/generator/error_tracker.go (100%)
rename vendor/k8s.io/gengo/{ => v2}/generator/execute.go (54%)
rename vendor/k8s.io/gengo/{ => v2}/generator/generator.go (63%)
create mode 100644 vendor/k8s.io/gengo/v2/generator/go_generator.go
rename vendor/k8s.io/gengo/{ => v2}/generator/import_tracker.go (76%)
create mode 100644 vendor/k8s.io/gengo/v2/generator/simple_target.go
rename vendor/k8s.io/gengo/{ => v2}/generator/snippet_writer.go (76%)
rename vendor/k8s.io/gengo/{ => v2}/namer/doc.go (96%)
rename vendor/k8s.io/gengo/{ => v2}/namer/import_tracker.go (98%)
rename vendor/k8s.io/gengo/{ => v2}/namer/namer.go (96%)
rename vendor/k8s.io/gengo/{ => v2}/namer/order.go (98%)
rename vendor/k8s.io/gengo/{ => v2}/namer/plural_namer.go (99%)
rename vendor/k8s.io/gengo/{ => v2}/parser/doc.go (92%)
create mode 100644 vendor/k8s.io/gengo/v2/parser/parse.go
create mode 100644 vendor/k8s.io/gengo/v2/parser/parse_122.go
create mode 100644 vendor/k8s.io/gengo/v2/parser/parse_pre_122.go
rename vendor/k8s.io/gengo/{ => v2}/types/doc.go (93%)
rename vendor/k8s.io/gengo/{ => v2}/types/types.go (96%)
delete mode 100644 vendor/k8s.io/utils/integer/integer.go
create mode 100644 vendor/k8s.io/utils/net/multi_listen.go
diff --git a/Dockerfile b/Dockerfile
index 5f666bae..79035c77 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,5 +1,5 @@
FROM --platform=${BUILDPLATFORM:-linux/amd64} ghcr.io/openfaas/license-check:0.4.1 as license-check
-FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.22 as builder
+FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.23 as builder
ARG TARGETPLATFORM
ARG BUILDPLATFORM
diff --git a/go.mod b/go.mod
index e06bfc34..3083f080 100644
--- a/go.mod
+++ b/go.mod
@@ -1,107 +1,115 @@
module github.com/inlets/inlets-operator
-go 1.22
+go 1.23
require (
github.com/google/go-cmp v0.6.0
- github.com/inlets/cloud-provision v0.6.9
- github.com/sethvargo/go-password v0.3.0
- k8s.io/api v0.29.1
- k8s.io/apimachinery v0.29.1
- k8s.io/client-go v0.29.1
- k8s.io/code-generator v0.29.1
+ github.com/inlets/cloud-provision v0.7.0
+ github.com/sethvargo/go-password v0.3.1
+ k8s.io/api v0.31.3
+ k8s.io/apimachinery v0.31.3
+ k8s.io/client-go v0.31.3
+ k8s.io/code-generator v0.31.3
k8s.io/klog v1.0.0
)
require (
- cloud.google.com/go/compute/metadata v0.3.0 // indirect
- github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.1 // indirect
- github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1 // indirect
- github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.1 // indirect
+ cloud.google.com/go/auth v0.11.0 // indirect
+ cloud.google.com/go/auth/oauth2adapt v0.2.6 // indirect
+ cloud.google.com/go/compute/metadata v0.5.2 // indirect
+ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0 // indirect
+ github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0 // indirect
+ github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute v1.0.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork v1.1.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 // indirect
- github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1 // indirect
- github.com/aws/aws-sdk-go v1.50.0 // indirect
+ github.com/AzureAD/microsoft-authentication-library-for-go v1.3.2 // indirect
+ github.com/aws/aws-sdk-go v1.55.5 // indirect
github.com/beorn7/perks v1.0.1 // indirect
- github.com/cespare/xxhash/v2 v2.2.0 // indirect
- github.com/davecgh/go-spew v1.1.1 // indirect
- github.com/digitalocean/godo v1.108.0 // indirect
+ github.com/cespare/xxhash/v2 v2.3.0 // indirect
+ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
+ github.com/digitalocean/godo v1.130.0 // indirect
github.com/dimchansky/utfbom v1.1.1 // indirect
github.com/dirien/ovh-go-sdk v0.2.0 // indirect
- github.com/emicklei/go-restful/v3 v3.11.2 // indirect
- github.com/evanphx/json-patch v5.8.1+incompatible // indirect
+ github.com/emicklei/go-restful/v3 v3.12.1 // indirect
+ github.com/evanphx/json-patch v5.9.0+incompatible // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
- github.com/go-logr/logr v1.4.1 // indirect
+ github.com/fxamacker/cbor/v2 v2.7.0 // indirect
+ github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
- github.com/go-openapi/jsonpointer v0.20.2 // indirect
- github.com/go-openapi/jsonreference v0.20.4 // indirect
- github.com/go-openapi/swag v0.22.7 // indirect
- github.com/go-resty/resty/v2 v2.11.0 // indirect
+ github.com/go-openapi/jsonpointer v0.21.0 // indirect
+ github.com/go-openapi/jsonreference v0.21.0 // indirect
+ github.com/go-openapi/swag v0.23.0 // indirect
+ github.com/go-resty/resty/v2 v2.16.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
- github.com/golang-jwt/jwt/v5 v5.2.0 // indirect
+ github.com/golang-jwt/jwt/v5 v5.2.1 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/mock v1.6.0 // indirect
- github.com/golang/protobuf v1.5.3 // indirect
+ github.com/golang/protobuf v1.5.4 // indirect
github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
- github.com/google/s2a-go v0.1.7 // indirect
- github.com/google/uuid v1.5.0 // indirect
- github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
- github.com/googleapis/gax-go/v2 v2.12.0 // indirect
+ github.com/google/s2a-go v0.1.8 // indirect
+ github.com/google/uuid v1.6.0 // indirect
+ github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect
+ github.com/googleapis/gax-go/v2 v2.14.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
- github.com/hashicorp/go-retryablehttp v0.7.5 // indirect
- github.com/hetznercloud/hcloud-go v1.53.0 // indirect
- github.com/imdario/mergo v0.3.6 // indirect
+ github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
+ github.com/hetznercloud/hcloud-go v1.59.1 // indirect
+ github.com/imdario/mergo v0.3.16 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
+ github.com/klauspost/compress v1.17.11 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
- github.com/linode/linodego v1.27.1 // indirect
+ github.com/linode/linodego v1.43.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
- github.com/ovh/go-ovh v1.4.3 // indirect
+ github.com/ovh/go-ovh v1.6.0 // indirect
github.com/packethost/packngo v0.31.0 // indirect
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
github.com/pkg/errors v0.9.1 // indirect
- github.com/prometheus/client_golang v1.18.0 // indirect
- github.com/prometheus/client_model v0.5.0 // indirect
- github.com/prometheus/common v0.46.0 // indirect
- github.com/prometheus/procfs v0.12.0 // indirect
- github.com/scaleway/scaleway-sdk-go v1.0.0-beta.22 // indirect
+ github.com/prometheus/client_golang v1.20.5 // indirect
+ github.com/prometheus/client_model v0.6.1 // indirect
+ github.com/prometheus/common v0.60.1 // indirect
+ github.com/prometheus/procfs v0.15.1 // indirect
+ github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/vultr/govultr/v2 v2.17.2 // indirect
+ github.com/x448/float16 v0.8.4 // indirect
go.opencensus.io v0.24.0 // indirect
- go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect
- go.opentelemetry.io/otel v1.21.0 // indirect
- go.opentelemetry.io/otel/metric v1.21.0 // indirect
- go.opentelemetry.io/otel/trace v1.21.0 // indirect
- golang.org/x/crypto v0.24.0 // indirect
- golang.org/x/mod v0.18.0 // indirect
- golang.org/x/net v0.26.0 // indirect
- golang.org/x/oauth2 v0.21.0 // indirect
- golang.org/x/sys v0.21.0 // indirect
- golang.org/x/term v0.21.0 // indirect
- golang.org/x/text v0.16.0 // indirect
- golang.org/x/time v0.5.0 // indirect
- golang.org/x/tools v0.22.0 // indirect
- google.golang.org/api v0.157.0 // indirect
- google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac // indirect
- google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac // indirect
- google.golang.org/grpc v1.60.1 // indirect
- google.golang.org/protobuf v1.32.0 // indirect
+ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.57.0 // indirect
+ go.opentelemetry.io/otel v1.32.0 // indirect
+ go.opentelemetry.io/otel/metric v1.32.0 // indirect
+ go.opentelemetry.io/otel/trace v1.32.0 // indirect
+ golang.org/x/crypto v0.29.0 // indirect
+ golang.org/x/mod v0.22.0 // indirect
+ golang.org/x/net v0.31.0 // indirect
+ golang.org/x/oauth2 v0.24.0 // indirect
+ golang.org/x/sync v0.9.0 // indirect
+ golang.org/x/sys v0.27.0 // indirect
+ golang.org/x/term v0.26.0 // indirect
+ golang.org/x/text v0.20.0 // indirect
+ golang.org/x/time v0.8.0 // indirect
+ golang.org/x/tools v0.27.0 // indirect
+ google.golang.org/api v0.209.0 // indirect
+ google.golang.org/genproto v0.0.0-20241113202542-65e8d215514f // indirect
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20241118233622-e639e219e697 // indirect
+ google.golang.org/grpc v1.68.0 // indirect
+ google.golang.org/protobuf v1.35.2 // indirect
+ gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
- k8s.io/gengo v0.0.0-20240110203215-22eea95d1e7a // indirect
- k8s.io/klog/v2 v2.120.1 // indirect
- k8s.io/kube-openapi v0.0.0-20240117194847-208609032b15 // indirect
- k8s.io/utils v0.0.0-20240102154912-e7106e64919e // indirect
- sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
- sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
+ k8s.io/gengo v0.0.0-20240911193312-2b36238f13e9 // indirect
+ k8s.io/gengo/v2 v2.0.0-20240911193312-2b36238f13e9 // indirect
+ k8s.io/klog/v2 v2.130.1 // indirect
+ k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f // indirect
+ k8s.io/utils v0.0.0-20241104163129-6fe5fd82f078 // indirect
+ sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
+ sigs.k8s.io/structured-merge-diff/v4 v4.4.3 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)
diff --git a/go.sum b/go.sum
index 914445f9..d7fc7862 100644
--- a/go.sum
+++ b/go.sum
@@ -1,12 +1,26 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
+cloud.google.com/go v0.116.0 h1:B3fRrSDkLRt5qSHWe40ERJvhvnQwdZiHu0bJOpldweE=
+cloud.google.com/go v0.116.0/go.mod h1:cEPSRWPzZEswwdr9BxE6ChEn01dWlTaF05LiC2Xs70U=
+cloud.google.com/go/auth v0.11.0 h1:Ic5SZz2lsvbYcWT5dfjNWgw6tTlGi2Wc8hyQSC9BstA=
+cloud.google.com/go/auth v0.11.0/go.mod h1:xxA5AqpDrvS+Gkmo9RqrGGRh6WSNKKOXhY3zNOr38tI=
+cloud.google.com/go/auth/oauth2adapt v0.2.6 h1:V6a6XDu2lTwPZWOawrAa9HUK+DB2zfJyTuciBG5hFkU=
+cloud.google.com/go/auth/oauth2adapt v0.2.6/go.mod h1:AlmsELtlEBnaNTL7jCj8VQFLy6mbZv0s4Q7NGBeQ5E8=
cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc=
cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k=
+cloud.google.com/go/compute/metadata v0.5.2 h1:UxK4uu/Tn+I3p2dYWTfiX4wva7aYlKixAHn3fyqngqo=
+cloud.google.com/go/compute/metadata v0.5.2/go.mod h1:C66sj2AluDcIqakBq/M8lw8/ybHgOZqin2obFxa/E5k=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.1 h1:lGlwhPtrX6EVml1hO0ivjkUxsSyl4dsiw9qcA1k/3IQ=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.1/go.mod h1:RKUqNu35KJYcVG/fqTRqmuXJZYNhYkBrnC/hX7yGbTA=
+github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0 h1:JZg6HRh6W6U4OLl6lk7BZ7BLisIzM9dG1R50zUk9C/M=
+github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0/go.mod h1:YL1xnZ6QejvQHWJrX/AvhFl4WW4rqHVoKspWNVwFk0M=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1 h1:sO0/P7g68FrryJzljemN+6GTssUXdANk6aJ7T1ZxnsQ=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1/go.mod h1:h8hyGFDsU5HMivxiS2iYFZsgDbU9OnnJ163x5UGVKYo=
+github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0 h1:B/dfvscEQtew9dVuoxqxrUKKv8Ih2f55PydknDamU+g=
+github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0/go.mod h1:fiPSssYvltE08HJchL04dOy+RD4hgrjph0cwGGMntdI=
github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.1 h1:6oNBlSdi1QqM1PNW7FPA6xOGA5UNsXnkaYZz9vdPGhA=
github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.1/go.mod h1:s4kgfzA0covAXNicZHDMN58jExvcng2mC/DepXiF1EI=
+github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY=
+github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute v1.0.0 h1:/Di3vB4sNeQ+7A8efjUVENvyB945Wruvstucqp7ZArg=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute v1.0.0/go.mod h1:gM3K25LQlsET3QR+4V74zxCsFAy0r6xMNN9n80SZn+4=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.0.0 h1:lMW1lD/17LUA5z1XTURo7LcVG2ICBPlyMHjIUrcFZNQ=
@@ -21,21 +35,31 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0/go.mod h1:5kakwfW5CjC9KK+Q4wjXAg+ShuIm2mBMua0ZFj2C8PE=
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1 h1:DzHpqpoJVaCgOUdVHxE8QB52S6NiVdDQvGlny1qvPqA=
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI=
+github.com/AzureAD/microsoft-authentication-library-for-go v1.3.2 h1:kYRSnvJju5gYVyhkij+RTJ/VR6QIUaCfWeaFm2ycsjQ=
+github.com/AzureAD/microsoft-authentication-library-for-go v1.3.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/aws/aws-sdk-go v1.50.0 h1:HBtrLeO+QyDKnc3t1+5DR1RxodOHCGr8ZcrHudpv7jI=
github.com/aws/aws-sdk-go v1.50.0/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk=
+github.com/aws/aws-sdk-go v1.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU=
+github.com/aws/aws-sdk-go v1.55.5/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
+github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
+github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
+github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/digitalocean/godo v1.108.0 h1:fWyMENvtxpCpva1UbKzOFnyAS04N1FNuBWWfPeTGquQ=
github.com/digitalocean/godo v1.108.0/go.mod h1:R6EmmWI8CT1+fCtjWY9UCB+L5uufuZH13wk3YhxycCs=
+github.com/digitalocean/godo v1.130.0 h1:DbJg0wvBxTkYjY5Q9S1mwzAZLd5Wht3r57yFH4yeMCk=
+github.com/digitalocean/godo v1.130.0/go.mod h1:PU8JB6I1XYkQIdHFop8lLAY9ojp6M0XcU0TWaQSxbrc=
github.com/dimchansky/utfbom v1.1.1 h1:vV6w1AhK4VMnhBno/TPVCoK9U/LP0PkLCS9tbxHdi/U=
github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/j0mACtrfE=
github.com/dirien/ovh-go-sdk v0.2.0 h1:hIL39yxXnUNEUw1gn3g2cA9QKj2cHdbbowAyq8tHug4=
@@ -44,35 +68,54 @@ github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI=
github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ=
github.com/emicklei/go-restful/v3 v3.11.2 h1:1onLa9DcsMYO9P+CXaL0dStDqQ2EHHXLiz+BtnqkLAU=
github.com/emicklei/go-restful/v3 v3.11.2/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
+github.com/emicklei/go-restful/v3 v3.12.1 h1:PJMDIM/ak7btuL8Ex0iYET9hxM3CI2sjZtzpL63nKAU=
+github.com/emicklei/go-restful/v3 v3.12.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/evanphx/json-patch v5.8.1+incompatible h1:2toJaoe7/rNa1zpeQx0UnVEjqk6z2ecyA20V/zg8vTU=
github.com/evanphx/json-patch v5.8.1+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
+github.com/evanphx/json-patch v5.9.0+incompatible h1:fBXyNpNMuTTDdquAq/uisOr2lShz4oaXpDTX2bLe7ls=
+github.com/evanphx/json-patch v5.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
+github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E=
+github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ=
github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
+github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
+github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-openapi/jsonpointer v0.20.2 h1:mQc3nmndL8ZBzStEo3JYF8wzmeWffDH4VbXz58sAx6Q=
github.com/go-openapi/jsonpointer v0.20.2/go.mod h1:bHen+N0u1KEO3YlmqOjTT9Adn1RfD91Ar825/PuiRVs=
+github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ=
+github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY=
github.com/go-openapi/jsonreference v0.20.4 h1:bKlDxQxQJgwpUSgOENiMPzCTBVuc7vTdXSSgNeAhojU=
github.com/go-openapi/jsonreference v0.20.4/go.mod h1:5pZJyJP2MnYCpoeoMAql78cCHauHj0V9Lhc506VOpw4=
+github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ=
+github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4=
github.com/go-openapi/swag v0.22.7 h1:JWrc1uc/P9cSomxfnsFSVWoE1FW6bNbrVPmpQYpCcR8=
github.com/go-openapi/swag v0.22.7/go.mod h1:Gl91UqO+btAM0plGGxHqJcQZ1ZTy6jbmridBTsDy8A0=
+github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE=
+github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ=
github.com/go-resty/resty/v2 v2.11.0 h1:i7jMfNOJYMp69lq7qozJP+bjgzfAzeOhuGlyDrqxT/8=
github.com/go-resty/resty/v2 v2.11.0/go.mod h1:iiP/OpA0CkcL3IGt1O0+/SIItFUbkkyw5BGXiVdTu+A=
+github.com/go-resty/resty/v2 v2.16.2 h1:CpRqTjIzq/rweXUt9+GxzzQdlkqMdt8Lm/fuK/CAbAg=
+github.com/go-resty/resty/v2 v2.16.2/go.mod h1:0fHAoK7JoBy/Ch36N8VFeMsK7xQOHhvWaC3iOktwmIU=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
+github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY=
github.com/golang-jwt/jwt/v5 v5.2.0 h1:d/ix8ftRUorsN+5eMIlF4T6J8CAt9rch3My2winC1Jw=
github.com/golang-jwt/jwt/v5 v5.2.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
+github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk=
+github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
@@ -92,6 +135,8 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
+github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
+github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 h1:0VpGH+cDhbDtdcweoyCVsF3fhN8kejK6rFe/2FFX2nU=
github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49/go.mod h1:BkkQ4L1KS1xMt2aWSPStnn55ChGC0DPOn2FQYj+f25M=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
@@ -116,27 +161,44 @@ github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJY
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o=
github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw=
+github.com/google/s2a-go v0.1.8 h1:zZDs9gcbt9ZPLV0ndSyQk6Kacx2g/X+SKYovpnz3SMM=
+github.com/google/s2a-go v0.1.8/go.mod h1:6iNWHTpQ+nfNRN5E00MSdfDwVesa8hhS32PhPO8deJA=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU=
github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
+github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs=
github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0=
+github.com/googleapis/enterprise-certificate-proxy v0.3.4 h1:XYIDZApgAnrN1c855gTgghdIA6Stxb52D5RnLI1SLyw=
+github.com/googleapis/enterprise-certificate-proxy v0.3.4/go.mod h1:YKe7cfqYXjKGpGvmSg28/fFvhNzinZQm8DGnaburhGA=
github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas=
github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU=
+github.com/googleapis/gax-go/v2 v2.14.0 h1:f+jMrjBPl+DL9nI4IQzLUxMq7XrAqFYB7hBPqMNIe8o=
+github.com/googleapis/gax-go/v2 v2.14.0/go.mod h1:lhBCnjdLrWRaPvLWhmc8IS24m9mr07qSYnHncrgo+zk=
github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
github.com/hashicorp/go-hclog v0.9.2 h1:CG6TE5H9/JXsFWJCfoIVpKFIkFe6ysEuHirp4DxCsHI=
github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT9yvm0e+Nd5M=
github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8=
+github.com/hashicorp/go-retryablehttp v0.7.7 h1:C8hUCYzor8PIfXHa4UrZkU4VvK8o9ISHxT2Q8+VepXU=
+github.com/hashicorp/go-retryablehttp v0.7.7/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk=
github.com/hetznercloud/hcloud-go v1.53.0 h1:xThhlJc6MdpvDAqVB7bAw+nAQuCpQMwsf3yanCis4rM=
github.com/hetznercloud/hcloud-go v1.53.0/go.mod h1:VzDWThl47lOnZXY0q5/LPFD+M62pfe/52TV+mOrpp9Q=
+github.com/hetznercloud/hcloud-go v1.59.1 h1:YwRRO4KemQZWsyL3Yp3cUH0Z7MQQ94keiBJ/VaTmlsM=
+github.com/hetznercloud/hcloud-go v1.59.1/go.mod h1:oTebZCjd+osj75jlI76Z+zjN1sTxmMiQ1MWoO8aRl1c=
github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28=
github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
+github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4=
+github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY=
github.com/inlets/cloud-provision v0.6.9 h1:x2UUucTKNAGI69vLxggCcxuYEHFGNehOakHd2UJfKdM=
github.com/inlets/cloud-provision v0.6.9/go.mod h1:VRZaOMJD/edkEfKrRtU8LGMwqhXn3eJ6i8YDdoe5jPs=
+github.com/inlets/cloud-provision v0.7.0 h1:ci0OjyN+u9VE/SIuyt68yp4nn2+VOJQPnz0DA2MsEmM=
+github.com/inlets/cloud-provision v0.7.0/go.mod h1:UE/q1bx3Bl0Kxxsrgn4TmpC+PiHanolR7Y8PJihVHfI=
github.com/jarcoal/httpmock v1.3.0 h1:2RJ8GP0IIaWwcC9Fp2BmVi8Kog3v2Hn7VXM3fTd+nuc=
github.com/jarcoal/httpmock v1.3.0/go.mod h1:3yb8rc4BI7TCBhFY8ng0gjuLKJNquuDNiPaZjnENuYg=
+github.com/jarcoal/httpmock v1.3.1 h1:iUx3whfZWVf3jT01hQTO/Eo5sAYtB2/rqaUuOtpInww=
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
@@ -147,6 +209,8 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
+github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc=
+github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
@@ -158,6 +222,8 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/linode/linodego v1.27.1 h1:KoQm5g2fppw8qIClJqUEL0yKH0+f+7te3Mewagb5QKE=
github.com/linode/linodego v1.27.1/go.mod h1:5oAsx+uinHtVo6U77nXXXtox7MWzUW6aEkTOKXxA9uo=
+github.com/linode/linodego v1.43.0 h1:sGeBB3caZt7vKBoPS5p4AVzmlG4JoqQOdigIibx3egk=
+github.com/linode/linodego v1.43.0/go.mod h1:n4TMFu1UVNala+icHqrTEFFaicYSF74cSAUG5zkTwfA=
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/maxatome/go-testdeep v1.12.0 h1:Ql7Go8Tg0C1D/uMMX59LAoYK7LffeJQ6X2T04nTH68g=
@@ -176,6 +242,8 @@ github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg=
github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ=
github.com/ovh/go-ovh v1.4.3 h1:Gs3V823zwTFpzgGLZNI6ILS4rmxZgJwJCz54Er9LwD0=
github.com/ovh/go-ovh v1.4.3/go.mod h1:AkPXVtgwB6xlKblMjRKJJmjRp+ogrE7fz2lVgcQY8SY=
+github.com/ovh/go-ovh v1.6.0 h1:ixLOwxQdzYDx296sXcgS35TOPEahJkpjMGtzPadCjQI=
+github.com/ovh/go-ovh v1.6.0/go.mod h1:cTVDnl94z4tl8pP1uZ/8jlVxntjSIf09bNcQ5TJSC7c=
github.com/packethost/packngo v0.31.0 h1:LLH90ardhULWbagBIc3I3nl2uU75io0a7AwY6hyi0S4=
github.com/packethost/packngo v0.31.0/go.mod h1:Io6VJqzkiqmIEQbpOjeIw9v8q9PfcTEq8TEY/tMQsfw=
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ=
@@ -186,19 +254,31 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk=
github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA=
+github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y=
+github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw=
github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI=
+github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
+github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y=
github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ=
+github.com/prometheus/common v0.60.1 h1:FUas6GcOw66yB/73KC+BOZoFJmbo/1pojoILArPAaSc=
+github.com/prometheus/common v0.60.1/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw=
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
+github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
+github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.22 h1:wJrcTdddKOI8TFxs8cemnhKP2EmKy3yfUKHj3ZdfzYo=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.22/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
+github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30 h1:yoKAVkEVwAqbGbR8n87rHQ1dulL25rKloGadb3vm770=
+github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30/go.mod h1:sH0u6fq6x4R5M7WxkoQFY/o7UaiItec0o1LinLCJNq8=
github.com/sethvargo/go-password v0.3.0 h1:OLFHZ91Z7NiNP3dnaPxLxCDXlb6TBuxFzMvv6bu+Ptw=
github.com/sethvargo/go-password v0.3.0/go.mod h1:p6we8DZ0eyYXof9pon7Cqrw98N4KTaYiadDml1dUEEw=
+github.com/sethvargo/go-password v0.3.1 h1:WqrLTjo7X6AcVYfC6R7GtSyuUQR9hGyAj/f1PYQZCJU=
+github.com/sethvargo/go-password v0.3.1/go.mod h1:rXofC1zT54N7R8K/h1WDUdkf9BOx5OptoxrMBcrXzvs=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
@@ -214,6 +294,8 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/vultr/govultr/v2 v2.17.2 h1:gej/rwr91Puc/tgh+j33p/BLR16UrIPnSr+AIwYWZQs=
github.com/vultr/govultr/v2 v2.17.2/go.mod h1:ZFOKGWmgjytfyjeyAdhQlSWwTjh2ig+X49cAp50dzXI=
+github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
+github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
@@ -222,12 +304,20 @@ go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 h1:aFJWCqJMNjENlcleuuOkGAPH82y0yULBScfXcIEdS24=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1/go.mod h1:sEGXWArGqc3tVa+ekntsN65DmVbVeW+7lTKTjZF3/Fo=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.57.0 h1:DheMAlT6POBP+gh8RUH19EOTnQIor5QE0uSRPtzCpSw=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.57.0/go.mod h1:wZcGmeVO9nzP67aYSLDqXNWK87EZWhi7JWj1v7ZXf94=
go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc=
go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo=
+go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U=
+go.opentelemetry.io/otel v1.32.0/go.mod h1:00DCVSB0RQcnzlwyTfqtxSm+DRr9hpYrHjNGiBHVQIg=
go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4=
go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM=
+go.opentelemetry.io/otel/metric v1.32.0 h1:xV2umtmNcThh2/a/aCP+h64Xx5wsj8qqnkYZktzNa0M=
+go.opentelemetry.io/otel/metric v1.32.0/go.mod h1:jH7CIbbK6SH2V2wE16W05BHCtIDzauciCRLoc/SyMv8=
go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc=
go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ=
+go.opentelemetry.io/otel/trace v1.32.0 h1:WIC9mYrXf8TmY/EXuULKc8hR17vE+Hjv2cssQDe03fM=
+go.opentelemetry.io/otel/trace v1.32.0/go.mod h1:+i4rkvCraA+tG6AzwloGaCtkx53Fa+L+V8e9a7YvhT8=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200420201142-3c4aac89819a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
@@ -236,6 +326,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI=
golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM=
+golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ=
+golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg=
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=
@@ -247,6 +339,8 @@ golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0=
golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
+golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4=
+golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
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=
@@ -264,9 +358,13 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ=
golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE=
+golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo=
+golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs=
golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
+golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE=
+golang.org/x/oauth2 v0.24.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
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-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -277,6 +375,8 @@ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
+golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ=
+golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -293,6 +393,8 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s=
+golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
@@ -300,6 +402,8 @@ golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA=
golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0=
+golang.org/x/term v0.26.0 h1:WEQa6V3Gja/BhNxg540hBip/kkaYtRg3cxg4oXSw4AU=
+golang.org/x/term v0.26.0/go.mod h1:Si5m1o57C5nBNQo5z1iq+XDijt21BDBDp2bK0QI8e3E=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
@@ -308,9 +412,13 @@ golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
+golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug=
+golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4=
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
+golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg=
+golang.org/x/time v0.8.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/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=
@@ -325,12 +433,16 @@ golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA=
golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c=
+golang.org/x/tools v0.27.0 h1:qEKojBykQkQ4EynWy4S8Weg69NumxKdn40Fce3uc/8o=
+golang.org/x/tools v0.27.0/go.mod h1:sUi0ZgbwW9ZPAq26Ekut+weQPR5eIM6GQLQ1Yjm1H0Q=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/api v0.157.0 h1:ORAeqmbrrozeyw5NjnMxh7peHO0UzV4wWYSwZeCUb20=
google.golang.org/api v0.157.0/go.mod h1:+z4v4ufbZ1WEpld6yMGHyggs+PmAHiaLNj5ytP3N01g=
+google.golang.org/api v0.209.0 h1:Ja2OXNlyRlWCWu8o+GgI4yUn/wz9h/5ZfFbKz+dQX+w=
+google.golang.org/api v0.209.0/go.mod h1:I53S168Yr/PNDNMi5yPnDc0/LGRZO6o7PoEbl/HY3CM=
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/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
@@ -338,10 +450,15 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac h1:ZL/Teoy/ZGnzyrqK/Optxxp2pmVh+fmJ97slxSRyzUg=
google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:+Rvu7ElI+aLzyDQhpHMFMMltsD6m7nqpuWDd2CwJw3k=
+google.golang.org/genproto v0.0.0-20241113202542-65e8d215514f h1:zDoHYmMzMacIdjNe+P2XiTmPsLawi/pCbSPfxt6lTfw=
+google.golang.org/genproto v0.0.0-20241113202542-65e8d215514f/go.mod h1:Q5m6g8b5KaFFzsQFIGdJkSJDGeJiybVenoYFMMa3ohI=
google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917 h1:rcS6EyEaoCO52hQDupoSfrxI3R6C2Tq741is7X8OvnM=
google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917/go.mod h1:CmlNWB9lSezaYELKS5Ym1r44VrrbPUa7JTvw+6MbpJ0=
+google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28 h1:M0KvPgPmDZHPlbRbaNU1APr28TvwvvdUPlSv7PUvy8g=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac h1:nUQEQmH/csSvFECKYRv6HWEyypysidKl2I6Qpsglq/0=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:daQN87bsDqDoe316QbbvX60nMoJQa4r6Ds0ZuoAe5yA=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20241118233622-e639e219e697 h1:LWZqQOEjDyONlF1H6afSWpAL/znlREo2tHfLoe+8LMA=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20241118233622-e639e219e697/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
@@ -349,6 +466,8 @@ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU=
google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM=
+google.golang.org/grpc v1.68.0 h1:aHQeeJbo8zAkAa3pRzrVjZlbz6uSfeOXlJNQM0RAbz0=
+google.golang.org/grpc v1.68.0/go.mod h1:fmSPC5AsjSBCK54MyHRx48kpOti1/jRfOlwEWywNjWA=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
@@ -362,10 +481,14 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
+google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io=
+google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
+gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4=
+gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
@@ -380,27 +503,49 @@ honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWh
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
k8s.io/api v0.29.1 h1:DAjwWX/9YT7NQD4INu49ROJuZAAAP/Ijki48GUPzxqw=
k8s.io/api v0.29.1/go.mod h1:7Kl10vBRUXhnQQI8YR/R327zXC8eJ7887/+Ybta+RoQ=
+k8s.io/api v0.31.3 h1:umzm5o8lFbdN/hIXbrK9oRpOproJO62CV1zqxXrLgk8=
+k8s.io/api v0.31.3/go.mod h1:UJrkIp9pnMOI9K2nlL6vwpxRzzEX5sWgn8kGQe92kCE=
k8s.io/apimachinery v0.29.1 h1:KY4/E6km/wLBguvCZv8cKTeOwwOBqFNjwJIdMkMbbRc=
k8s.io/apimachinery v0.29.1/go.mod h1:6HVkd1FwxIagpYrHSwJlQqZI3G9LfYWRPAkUvLnXTKU=
+k8s.io/apimachinery v0.31.3 h1:6l0WhcYgasZ/wk9ktLq5vLaoXJJr5ts6lkaQzgeYPq4=
+k8s.io/apimachinery v0.31.3/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo=
k8s.io/client-go v0.29.1 h1:19B/+2NGEwnFLzt0uB5kNJnfTsbV8w6TgQRz9l7ti7A=
k8s.io/client-go v0.29.1/go.mod h1:TDG/psL9hdet0TI9mGyHJSgRkW3H9JZk2dNEUS7bRks=
+k8s.io/client-go v0.31.3 h1:CAlZuM+PH2cm+86LOBemaJI/lQ5linJ6UFxKX/SoG+4=
+k8s.io/client-go v0.31.3/go.mod h1:2CgjPUTpv3fE5dNygAr2NcM8nhHzXvxB8KL5gYc3kJs=
k8s.io/code-generator v0.29.1 h1:8ba8BdtSmAVHgAMpzThb/fuyQeTRtN7NtN7VjMcDLew=
k8s.io/code-generator v0.29.1/go.mod h1:FwFi3C9jCrmbPjekhaCYcYG1n07CYiW1+PAPCockaos=
+k8s.io/code-generator v0.31.3 h1:Pj0fYOBms+ZrsulLi4DMsCEx1jG8fWKRLy44onHsLBI=
+k8s.io/code-generator v0.31.3/go.mod h1:/umCIlT84g1+Yu5ZXtP1KGSRTnGiIzzX5AzUAxsNlts=
k8s.io/gengo v0.0.0-20240110203215-22eea95d1e7a h1:zCwpCC6Ghs+RstFfEJZ3arc7dLZ9z0tlmLHDXGCkINY=
k8s.io/gengo v0.0.0-20240110203215-22eea95d1e7a/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E=
+k8s.io/gengo v0.0.0-20240911193312-2b36238f13e9 h1:B0l8GxRsVc/tP/uCLBQdAjf2nBARx6u/r2OGuL/CyXQ=
+k8s.io/gengo v0.0.0-20240911193312-2b36238f13e9/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E=
+k8s.io/gengo/v2 v2.0.0-20240911193312-2b36238f13e9 h1:si3PfKm8dDYxgfbeA6orqrtLkvvIeH8UqffFJDl0bz4=
+k8s.io/gengo/v2 v2.0.0-20240911193312-2b36238f13e9/go.mod h1:EJykeLsmFC60UQbYJezXkEsG2FLrt0GPNkU5iK5GWxU=
k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8=
k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I=
k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y=
k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw=
k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
+k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
+k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
k8s.io/kube-openapi v0.0.0-20240117194847-208609032b15 h1:m6dl1pkxz3HuE2mP9MUYPCCGyy6IIFlv/vTlLBDxIwA=
k8s.io/kube-openapi v0.0.0-20240117194847-208609032b15/go.mod h1:Pa1PvrP7ACSkuX6I7KYomY6cmMA0Tx86waBhDUgoKPw=
+k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f h1:GA7//TjRY9yWGy1poLzYYJJ4JRdzg3+O6e8I+e+8T5Y=
+k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f/go.mod h1:R/HEjbvWI0qdfb8viZUeVZm0X6IZnxAydC7YU42CMw4=
k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ=
k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
+k8s.io/utils v0.0.0-20241104163129-6fe5fd82f078 h1:jGnCPejIetjiy2gqaJ5V0NLwTpF4wbQ6cZIItJCSHno=
+k8s.io/utils v0.0.0-20241104163129-6fe5fd82f078/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
+sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 h1:gBQPwqORJ8d8/YNZWEjoZs7npUVDpVXUUOFfW6CgAqE=
+sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg=
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4=
sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08=
+sigs.k8s.io/structured-merge-diff/v4 v4.4.3 h1:sCP7Vv3xx/CWIuTPVN38lUPx0uw0lcLfzaiDa8Ja01A=
+sigs.k8s.io/structured-merge-diff/v4 v4.4.3/go.mod h1:N8f93tFZh9U6vpxwRArLiikrE5/2tiu1w1AGfACIGE4=
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
diff --git a/vendor/cloud.google.com/go/auth/CHANGES.md b/vendor/cloud.google.com/go/auth/CHANGES.md
new file mode 100644
index 00000000..351392de
--- /dev/null
+++ b/vendor/cloud.google.com/go/auth/CHANGES.md
@@ -0,0 +1,336 @@
+# Changelog
+
+## [0.11.0](https://github.com/googleapis/google-cloud-go/compare/auth/v0.10.2...auth/v0.11.0) (2024-11-21)
+
+
+### Features
+
+* **auth:** Add universe domain support to mTLS ([#11159](https://github.com/googleapis/google-cloud-go/issues/11159)) ([117748b](https://github.com/googleapis/google-cloud-go/commit/117748ba1cfd4ae62a6a4feb7e30951cb2bc9344))
+
+## [0.10.2](https://github.com/googleapis/google-cloud-go/compare/auth/v0.10.1...auth/v0.10.2) (2024-11-12)
+
+
+### Bug Fixes
+
+* **auth:** Restore use of grpc.Dial ([#11118](https://github.com/googleapis/google-cloud-go/issues/11118)) ([2456b94](https://github.com/googleapis/google-cloud-go/commit/2456b943b7b8aaabd4d8bfb7572c0f477ae0db45)), refs [#7556](https://github.com/googleapis/google-cloud-go/issues/7556)
+
+## [0.10.1](https://github.com/googleapis/google-cloud-go/compare/auth/v0.10.0...auth/v0.10.1) (2024-11-06)
+
+
+### Bug Fixes
+
+* **auth:** Restore Application Default Credentials support to idtoken ([#11083](https://github.com/googleapis/google-cloud-go/issues/11083)) ([8771f2e](https://github.com/googleapis/google-cloud-go/commit/8771f2ea9807ab822083808e0678392edff3b4f2))
+* **auth:** Skip impersonate universe domain check if empty ([#11086](https://github.com/googleapis/google-cloud-go/issues/11086)) ([87159c1](https://github.com/googleapis/google-cloud-go/commit/87159c1059d4a18d1367ce62746a838a94964ab6))
+
+## [0.10.0](https://github.com/googleapis/google-cloud-go/compare/auth/v0.9.9...auth/v0.10.0) (2024-10-30)
+
+
+### Features
+
+* **auth:** Add universe domain support to credentials/impersonate ([#10953](https://github.com/googleapis/google-cloud-go/issues/10953)) ([e06cb64](https://github.com/googleapis/google-cloud-go/commit/e06cb6499f7eda3aef08ab18ff197016f667684b))
+
+## [0.9.9](https://github.com/googleapis/google-cloud-go/compare/auth/v0.9.8...auth/v0.9.9) (2024-10-22)
+
+
+### Bug Fixes
+
+* **auth:** Fallback cert lookups for missing files ([#11013](https://github.com/googleapis/google-cloud-go/issues/11013)) ([bd76695](https://github.com/googleapis/google-cloud-go/commit/bd766957ec238b7c40ddbabb369e612dc9b07313)), refs [#10844](https://github.com/googleapis/google-cloud-go/issues/10844)
+* **auth:** Replace MDS endpoint universe_domain with universe-domain ([#11000](https://github.com/googleapis/google-cloud-go/issues/11000)) ([6a1586f](https://github.com/googleapis/google-cloud-go/commit/6a1586f2ce9974684affaea84e7b629313b4d114))
+
+## [0.9.8](https://github.com/googleapis/google-cloud-go/compare/auth/v0.9.7...auth/v0.9.8) (2024-10-09)
+
+
+### Bug Fixes
+
+* **auth:** Restore OpenTelemetry handling in transports ([#10968](https://github.com/googleapis/google-cloud-go/issues/10968)) ([08c6d04](https://github.com/googleapis/google-cloud-go/commit/08c6d04901c1a20e219b2d86df41dbaa6d7d7b55)), refs [#10962](https://github.com/googleapis/google-cloud-go/issues/10962)
+* **auth:** Try talk to plaintext S2A if credentials can not be found for mTLS-S2A ([#10941](https://github.com/googleapis/google-cloud-go/issues/10941)) ([0f0bf2d](https://github.com/googleapis/google-cloud-go/commit/0f0bf2d18c97dd8b65bcf0099f0802b5631c6287))
+
+## [0.9.7](https://github.com/googleapis/google-cloud-go/compare/auth/v0.9.6...auth/v0.9.7) (2024-10-01)
+
+
+### Bug Fixes
+
+* **auth:** Restore support for non-default service accounts for DirectPath ([#10937](https://github.com/googleapis/google-cloud-go/issues/10937)) ([a38650e](https://github.com/googleapis/google-cloud-go/commit/a38650edbf420223077498cafa537aec74b37aad)), refs [#10907](https://github.com/googleapis/google-cloud-go/issues/10907)
+
+## [0.9.6](https://github.com/googleapis/google-cloud-go/compare/auth/v0.9.5...auth/v0.9.6) (2024-09-30)
+
+
+### Bug Fixes
+
+* **auth:** Make aws credentials provider retrieve fresh credentials ([#10920](https://github.com/googleapis/google-cloud-go/issues/10920)) ([250fbf8](https://github.com/googleapis/google-cloud-go/commit/250fbf87d858d865e399a241b7e537c4ff0c3dd8))
+
+## [0.9.5](https://github.com/googleapis/google-cloud-go/compare/auth/v0.9.4...auth/v0.9.5) (2024-09-25)
+
+
+### Bug Fixes
+
+* **auth:** Restore support for GOOGLE_CLOUD_UNIVERSE_DOMAIN env ([#10915](https://github.com/googleapis/google-cloud-go/issues/10915)) ([94caaaa](https://github.com/googleapis/google-cloud-go/commit/94caaaa061362d0e00ef6214afcc8a0a3e7ebfb2))
+* **auth:** Skip directpath credentials overwrite when it's not on GCE ([#10833](https://github.com/googleapis/google-cloud-go/issues/10833)) ([7e5e8d1](https://github.com/googleapis/google-cloud-go/commit/7e5e8d10b761b0a6e43e19a028528db361bc07b1))
+* **auth:** Use new context for non-blocking token refresh ([#10919](https://github.com/googleapis/google-cloud-go/issues/10919)) ([cf7102d](https://github.com/googleapis/google-cloud-go/commit/cf7102d33a21be1e5a9d47a49456b3a57c43b350))
+
+## [0.9.4](https://github.com/googleapis/google-cloud-go/compare/auth/v0.9.3...auth/v0.9.4) (2024-09-11)
+
+
+### Bug Fixes
+
+* **auth:** Enable self-signed JWT for non-GDU universe domain ([#10831](https://github.com/googleapis/google-cloud-go/issues/10831)) ([f9869f7](https://github.com/googleapis/google-cloud-go/commit/f9869f7903cfd34d1b97c25d0dc5669d2c5138e6))
+
+## [0.9.3](https://github.com/googleapis/google-cloud-go/compare/auth/v0.9.2...auth/v0.9.3) (2024-09-03)
+
+
+### Bug Fixes
+
+* **auth:** Choose quota project envvar over file when both present ([#10807](https://github.com/googleapis/google-cloud-go/issues/10807)) ([2d8dd77](https://github.com/googleapis/google-cloud-go/commit/2d8dd7700eff92d4b95027be55e26e1e7aa79181)), refs [#10804](https://github.com/googleapis/google-cloud-go/issues/10804)
+
+## [0.9.2](https://github.com/googleapis/google-cloud-go/compare/auth/v0.9.1...auth/v0.9.2) (2024-08-30)
+
+
+### Bug Fixes
+
+* **auth:** Handle non-Transport DefaultTransport ([#10733](https://github.com/googleapis/google-cloud-go/issues/10733)) ([98d91dc](https://github.com/googleapis/google-cloud-go/commit/98d91dc8316b247498fab41ab35e57a0446fe556)), refs [#10742](https://github.com/googleapis/google-cloud-go/issues/10742)
+* **auth:** Make sure quota option takes precedence over env/file ([#10797](https://github.com/googleapis/google-cloud-go/issues/10797)) ([f1b050d](https://github.com/googleapis/google-cloud-go/commit/f1b050d56d804b245cab048c2980d32b0eaceb4e)), refs [#10795](https://github.com/googleapis/google-cloud-go/issues/10795)
+
+
+### Documentation
+
+* **auth:** Fix Go doc comment link ([#10751](https://github.com/googleapis/google-cloud-go/issues/10751)) ([015acfa](https://github.com/googleapis/google-cloud-go/commit/015acfab4d172650928bb1119bc2cd6307b9a437))
+
+## [0.9.1](https://github.com/googleapis/google-cloud-go/compare/auth/v0.9.0...auth/v0.9.1) (2024-08-22)
+
+
+### Bug Fixes
+
+* **auth:** Setting expireEarly to default when the value is 0 ([#10732](https://github.com/googleapis/google-cloud-go/issues/10732)) ([5e67869](https://github.com/googleapis/google-cloud-go/commit/5e67869a31e9e8ecb4eeebd2cfa11a761c3b1948))
+
+## [0.9.0](https://github.com/googleapis/google-cloud-go/compare/auth/v0.8.1...auth/v0.9.0) (2024-08-16)
+
+
+### Features
+
+* **auth:** Auth library can talk to S2A over mTLS ([#10634](https://github.com/googleapis/google-cloud-go/issues/10634)) ([5250a13](https://github.com/googleapis/google-cloud-go/commit/5250a13ec95b8d4eefbe0158f82857ff2189cb45))
+
+## [0.8.1](https://github.com/googleapis/google-cloud-go/compare/auth/v0.8.0...auth/v0.8.1) (2024-08-13)
+
+
+### Bug Fixes
+
+* **auth:** Make default client creation more lenient ([#10669](https://github.com/googleapis/google-cloud-go/issues/10669)) ([1afb9ee](https://github.com/googleapis/google-cloud-go/commit/1afb9ee1ee9de9810722800018133304a0ca34d1)), refs [#10638](https://github.com/googleapis/google-cloud-go/issues/10638)
+
+## [0.8.0](https://github.com/googleapis/google-cloud-go/compare/auth/v0.7.3...auth/v0.8.0) (2024-08-07)
+
+
+### Features
+
+* **auth:** Adds support for X509 workload identity federation ([#10373](https://github.com/googleapis/google-cloud-go/issues/10373)) ([5d07505](https://github.com/googleapis/google-cloud-go/commit/5d075056cbe27bb1da4072a26070c41f8999eb9b))
+
+## [0.7.3](https://github.com/googleapis/google-cloud-go/compare/auth/v0.7.2...auth/v0.7.3) (2024-08-01)
+
+
+### Bug Fixes
+
+* **auth/oauth2adapt:** Update dependencies ([257c40b](https://github.com/googleapis/google-cloud-go/commit/257c40bd6d7e59730017cf32bda8823d7a232758))
+* **auth:** Disable automatic universe domain check for MDS ([#10620](https://github.com/googleapis/google-cloud-go/issues/10620)) ([7cea5ed](https://github.com/googleapis/google-cloud-go/commit/7cea5edd5a0c1e6bca558696f5607879141910e8))
+* **auth:** Update dependencies ([257c40b](https://github.com/googleapis/google-cloud-go/commit/257c40bd6d7e59730017cf32bda8823d7a232758))
+
+## [0.7.2](https://github.com/googleapis/google-cloud-go/compare/auth/v0.7.1...auth/v0.7.2) (2024-07-22)
+
+
+### Bug Fixes
+
+* **auth:** Use default client for universe metadata lookup ([#10551](https://github.com/googleapis/google-cloud-go/issues/10551)) ([d9046fd](https://github.com/googleapis/google-cloud-go/commit/d9046fdd1435d1ce48f374806c1def4cb5ac6cd3)), refs [#10544](https://github.com/googleapis/google-cloud-go/issues/10544)
+
+## [0.7.1](https://github.com/googleapis/google-cloud-go/compare/auth/v0.7.0...auth/v0.7.1) (2024-07-10)
+
+
+### Bug Fixes
+
+* **auth:** Bump google.golang.org/grpc@v1.64.1 ([8ecc4e9](https://github.com/googleapis/google-cloud-go/commit/8ecc4e9622e5bbe9b90384d5848ab816027226c5))
+
+## [0.7.0](https://github.com/googleapis/google-cloud-go/compare/auth/v0.6.1...auth/v0.7.0) (2024-07-09)
+
+
+### Features
+
+* **auth:** Add workload X509 cert provider as a default cert provider ([#10479](https://github.com/googleapis/google-cloud-go/issues/10479)) ([c51ee6c](https://github.com/googleapis/google-cloud-go/commit/c51ee6cf65ce05b4d501083e49d468c75ac1ea63))
+
+
+### Bug Fixes
+
+* **auth/oauth2adapt:** Bump google.golang.org/api@v0.187.0 ([8fa9e39](https://github.com/googleapis/google-cloud-go/commit/8fa9e398e512fd8533fd49060371e61b5725a85b))
+* **auth:** Bump google.golang.org/api@v0.187.0 ([8fa9e39](https://github.com/googleapis/google-cloud-go/commit/8fa9e398e512fd8533fd49060371e61b5725a85b))
+* **auth:** Check len of slices, not non-nil ([#10483](https://github.com/googleapis/google-cloud-go/issues/10483)) ([0a966a1](https://github.com/googleapis/google-cloud-go/commit/0a966a183e5f0e811977216d736d875b7233e942))
+
+## [0.6.1](https://github.com/googleapis/google-cloud-go/compare/auth/v0.6.0...auth/v0.6.1) (2024-07-01)
+
+
+### Bug Fixes
+
+* **auth:** Support gRPC API keys ([#10460](https://github.com/googleapis/google-cloud-go/issues/10460)) ([daa6646](https://github.com/googleapis/google-cloud-go/commit/daa6646d2af5d7fb5b30489f4934c7db89868c7c))
+* **auth:** Update http and grpc transports to support token exchange over mTLS ([#10397](https://github.com/googleapis/google-cloud-go/issues/10397)) ([c6dfdcf](https://github.com/googleapis/google-cloud-go/commit/c6dfdcf893c3f971eba15026c12db0a960ae81f2))
+
+## [0.6.0](https://github.com/googleapis/google-cloud-go/compare/auth/v0.5.2...auth/v0.6.0) (2024-06-25)
+
+
+### Features
+
+* **auth:** Add non-blocking token refresh for compute MDS ([#10263](https://github.com/googleapis/google-cloud-go/issues/10263)) ([9ac350d](https://github.com/googleapis/google-cloud-go/commit/9ac350da11a49b8e2174d3fc5b1a5070fec78b4e))
+
+
+### Bug Fixes
+
+* **auth:** Return error if envvar detected file returns an error ([#10431](https://github.com/googleapis/google-cloud-go/issues/10431)) ([e52b9a7](https://github.com/googleapis/google-cloud-go/commit/e52b9a7c45468827f5d220ab00965191faeb9d05))
+
+## [0.5.2](https://github.com/googleapis/google-cloud-go/compare/auth/v0.5.1...auth/v0.5.2) (2024-06-24)
+
+
+### Bug Fixes
+
+* **auth:** Fetch initial token when CachedTokenProviderOptions.DisableAutoRefresh is true ([#10415](https://github.com/googleapis/google-cloud-go/issues/10415)) ([3266763](https://github.com/googleapis/google-cloud-go/commit/32667635ca2efad05cd8c087c004ca07d7406913)), refs [#10414](https://github.com/googleapis/google-cloud-go/issues/10414)
+
+## [0.5.1](https://github.com/googleapis/google-cloud-go/compare/auth/v0.5.0...auth/v0.5.1) (2024-05-31)
+
+
+### Bug Fixes
+
+* **auth:** Pass through client to 2LO and 3LO flows ([#10290](https://github.com/googleapis/google-cloud-go/issues/10290)) ([685784e](https://github.com/googleapis/google-cloud-go/commit/685784ea84358c15e9214bdecb307d37aa3b6d2f))
+
+## [0.5.0](https://github.com/googleapis/google-cloud-go/compare/auth/v0.4.2...auth/v0.5.0) (2024-05-28)
+
+
+### Features
+
+* **auth:** Adds X509 workload certificate provider ([#10233](https://github.com/googleapis/google-cloud-go/issues/10233)) ([17a9db7](https://github.com/googleapis/google-cloud-go/commit/17a9db73af35e3d1a7a25ac4fd1377a103de6150))
+
+## [0.4.2](https://github.com/googleapis/google-cloud-go/compare/auth/v0.4.1...auth/v0.4.2) (2024-05-16)
+
+
+### Bug Fixes
+
+* **auth:** Enable client certificates by default only for GDU ([#10151](https://github.com/googleapis/google-cloud-go/issues/10151)) ([7c52978](https://github.com/googleapis/google-cloud-go/commit/7c529786275a39b7e00525f7d5e7be0d963e9e15))
+* **auth:** Handle non-Transport DefaultTransport ([#10162](https://github.com/googleapis/google-cloud-go/issues/10162)) ([fa3bfdb](https://github.com/googleapis/google-cloud-go/commit/fa3bfdb23aaa45b34394a8b61e753b3587506782)), refs [#10159](https://github.com/googleapis/google-cloud-go/issues/10159)
+* **auth:** Have refresh time match docs ([#10147](https://github.com/googleapis/google-cloud-go/issues/10147)) ([bcb5568](https://github.com/googleapis/google-cloud-go/commit/bcb5568c07a54dd3d2e869d15f502b0741a609e8))
+* **auth:** Update compute token fetching error with named prefix ([#10180](https://github.com/googleapis/google-cloud-go/issues/10180)) ([4573504](https://github.com/googleapis/google-cloud-go/commit/4573504828d2928bebedc875d87650ba227829ea))
+
+## [0.4.1](https://github.com/googleapis/google-cloud-go/compare/auth/v0.4.0...auth/v0.4.1) (2024-05-09)
+
+
+### Bug Fixes
+
+* **auth:** Don't try to detect default creds it opt configured ([#10143](https://github.com/googleapis/google-cloud-go/issues/10143)) ([804632e](https://github.com/googleapis/google-cloud-go/commit/804632e7c5b0b85ff522f7951114485e256eb5bc))
+
+## [0.4.0](https://github.com/googleapis/google-cloud-go/compare/auth/v0.3.0...auth/v0.4.0) (2024-05-07)
+
+
+### Features
+
+* **auth:** Enable client certificates by default ([#10102](https://github.com/googleapis/google-cloud-go/issues/10102)) ([9013e52](https://github.com/googleapis/google-cloud-go/commit/9013e5200a6ec0f178ed91acb255481ffb073a2c))
+
+
+### Bug Fixes
+
+* **auth:** Get s2a logic up to date ([#10093](https://github.com/googleapis/google-cloud-go/issues/10093)) ([4fe9ae4](https://github.com/googleapis/google-cloud-go/commit/4fe9ae4b7101af2a5221d6d6b2e77b479305bb06))
+
+## [0.3.0](https://github.com/googleapis/google-cloud-go/compare/auth/v0.2.2...auth/v0.3.0) (2024-04-23)
+
+
+### Features
+
+* **auth/httptransport:** Add ability to customize transport ([#10023](https://github.com/googleapis/google-cloud-go/issues/10023)) ([72c7f6b](https://github.com/googleapis/google-cloud-go/commit/72c7f6bbec3136cc7a62788fc7186bc33ef6c3b3)), refs [#9812](https://github.com/googleapis/google-cloud-go/issues/9812) [#9814](https://github.com/googleapis/google-cloud-go/issues/9814)
+
+
+### Bug Fixes
+
+* **auth/credentials:** Error on bad file name if explicitly set ([#10018](https://github.com/googleapis/google-cloud-go/issues/10018)) ([55beaa9](https://github.com/googleapis/google-cloud-go/commit/55beaa993aaf052d8be39766afc6777c3c2a0bdd)), refs [#9809](https://github.com/googleapis/google-cloud-go/issues/9809)
+
+## [0.2.2](https://github.com/googleapis/google-cloud-go/compare/auth/v0.2.1...auth/v0.2.2) (2024-04-19)
+
+
+### Bug Fixes
+
+* **auth:** Add internal opt to skip validation on transports ([#9999](https://github.com/googleapis/google-cloud-go/issues/9999)) ([9e20ef8](https://github.com/googleapis/google-cloud-go/commit/9e20ef89f6287d6bd03b8697d5898dc43b4a77cf)), refs [#9823](https://github.com/googleapis/google-cloud-go/issues/9823)
+* **auth:** Set secure flag for gRPC conn pools ([#10002](https://github.com/googleapis/google-cloud-go/issues/10002)) ([14e3956](https://github.com/googleapis/google-cloud-go/commit/14e3956dfd736399731b5ee8d9b178ae085cf7ba)), refs [#9833](https://github.com/googleapis/google-cloud-go/issues/9833)
+
+## [0.2.1](https://github.com/googleapis/google-cloud-go/compare/auth/v0.2.0...auth/v0.2.1) (2024-04-18)
+
+
+### Bug Fixes
+
+* **auth:** Default gRPC token type to Bearer if not set ([#9800](https://github.com/googleapis/google-cloud-go/issues/9800)) ([5284066](https://github.com/googleapis/google-cloud-go/commit/5284066670b6fe65d79089cfe0199c9660f87fc7))
+
+## [0.2.0](https://github.com/googleapis/google-cloud-go/compare/auth/v0.1.1...auth/v0.2.0) (2024-04-15)
+
+### Breaking Changes
+
+In the below mentioned commits there were a few large breaking changes since the
+last release of the module.
+
+1. The `Credentials` type has been moved to the root of the module as it is
+ becoming the core abstraction for the whole module.
+2. Because of the above mentioned change many functions that previously
+ returned a `TokenProvider` now return `Credentials`. Similarly, these
+ functions have been renamed to be more specific.
+3. Most places that used to take an optional `TokenProvider` now accept
+ `Credentials`. You can make a `Credentials` from a `TokenProvider` using the
+ constructor found in the `auth` package.
+4. The `detect` package has been renamed to `credentials`. With this change some
+ function signatures were also updated for better readability.
+5. Derivative auth flows like `impersonate` and `downscope` have been moved to
+ be under the new `credentials` package.
+
+Although these changes are disruptive we think that they are for the best of the
+long-term health of the module. We do not expect any more large breaking changes
+like these in future revisions, even before 1.0.0. This version will be the
+first version of the auth library that our client libraries start to use and
+depend on.
+
+### Features
+
+* **auth/credentials/externalaccount:** Add default TokenURL ([#9700](https://github.com/googleapis/google-cloud-go/issues/9700)) ([81830e6](https://github.com/googleapis/google-cloud-go/commit/81830e6848ceefd055aa4d08f933d1154455a0f6))
+* **auth:** Add downscope.Options.UniverseDomain ([#9634](https://github.com/googleapis/google-cloud-go/issues/9634)) ([52cf7d7](https://github.com/googleapis/google-cloud-go/commit/52cf7d780853594291c4e34302d618299d1f5a1d))
+* **auth:** Add universe domain to grpctransport and httptransport ([#9663](https://github.com/googleapis/google-cloud-go/issues/9663)) ([67d353b](https://github.com/googleapis/google-cloud-go/commit/67d353beefe3b607c08c891876fbd95ab89e5fe3)), refs [#9670](https://github.com/googleapis/google-cloud-go/issues/9670)
+* **auth:** Add UniverseDomain to DetectOptions ([#9536](https://github.com/googleapis/google-cloud-go/issues/9536)) ([3618d3f](https://github.com/googleapis/google-cloud-go/commit/3618d3f7061615c0e189f376c75abc201203b501))
+* **auth:** Make package externalaccount public ([#9633](https://github.com/googleapis/google-cloud-go/issues/9633)) ([a0978d8](https://github.com/googleapis/google-cloud-go/commit/a0978d8e96968399940ebd7d092539772bf9caac))
+* **auth:** Move credentials to base auth package ([#9590](https://github.com/googleapis/google-cloud-go/issues/9590)) ([1a04baf](https://github.com/googleapis/google-cloud-go/commit/1a04bafa83c27342b9308d785645e1e5423ea10d))
+* **auth:** Refactor public sigs to use Credentials ([#9603](https://github.com/googleapis/google-cloud-go/issues/9603)) ([69cb240](https://github.com/googleapis/google-cloud-go/commit/69cb240c530b1f7173a9af2555c19e9a1beb56c5))
+
+
+### Bug Fixes
+
+* **auth/oauth2adapt:** Update protobuf dep to v1.33.0 ([30b038d](https://github.com/googleapis/google-cloud-go/commit/30b038d8cac0b8cd5dd4761c87f3f298760dd33a))
+* **auth:** Fix uint32 conversion ([9221c7f](https://github.com/googleapis/google-cloud-go/commit/9221c7fa12cef9d5fb7ddc92f41f1d6204971c7b))
+* **auth:** Port sts expires fix ([#9618](https://github.com/googleapis/google-cloud-go/issues/9618)) ([7bec97b](https://github.com/googleapis/google-cloud-go/commit/7bec97b2f51ed3ac4f9b88bf100d301da3f5d1bd))
+* **auth:** Read universe_domain from all credentials files ([#9632](https://github.com/googleapis/google-cloud-go/issues/9632)) ([16efbb5](https://github.com/googleapis/google-cloud-go/commit/16efbb52e39ea4a319e5ee1e95c0e0305b6d9824))
+* **auth:** Remove content-type header from idms get requests ([#9508](https://github.com/googleapis/google-cloud-go/issues/9508)) ([8589f41](https://github.com/googleapis/google-cloud-go/commit/8589f41599d265d7c3d46a3d86c9fab2329cbdd9))
+* **auth:** Update protobuf dep to v1.33.0 ([30b038d](https://github.com/googleapis/google-cloud-go/commit/30b038d8cac0b8cd5dd4761c87f3f298760dd33a))
+
+## [0.1.1](https://github.com/googleapis/google-cloud-go/compare/auth/v0.1.0...auth/v0.1.1) (2024-03-10)
+
+
+### Bug Fixes
+
+* **auth/impersonate:** Properly send default detect params ([#9529](https://github.com/googleapis/google-cloud-go/issues/9529)) ([5b6b8be](https://github.com/googleapis/google-cloud-go/commit/5b6b8bef577f82707e51f5cc5d258d5bdf90218f)), refs [#9136](https://github.com/googleapis/google-cloud-go/issues/9136)
+* **auth:** Update grpc-go to v1.56.3 ([343cea8](https://github.com/googleapis/google-cloud-go/commit/343cea8c43b1e31ae21ad50ad31d3b0b60143f8c))
+* **auth:** Update grpc-go to v1.59.0 ([81a97b0](https://github.com/googleapis/google-cloud-go/commit/81a97b06cb28b25432e4ece595c55a9857e960b7))
+
+## 0.1.0 (2023-10-18)
+
+
+### Features
+
+* **auth:** Add base auth package ([#8465](https://github.com/googleapis/google-cloud-go/issues/8465)) ([6a45f26](https://github.com/googleapis/google-cloud-go/commit/6a45f26b809b64edae21f312c18d4205f96b180e))
+* **auth:** Add cert support to httptransport ([#8569](https://github.com/googleapis/google-cloud-go/issues/8569)) ([37e3435](https://github.com/googleapis/google-cloud-go/commit/37e3435f8e98595eafab481bdfcb31a4c56fa993))
+* **auth:** Add Credentials.UniverseDomain() ([#8654](https://github.com/googleapis/google-cloud-go/issues/8654)) ([af0aa1e](https://github.com/googleapis/google-cloud-go/commit/af0aa1ed8015bc8fe0dd87a7549ae029107cbdb8))
+* **auth:** Add detect package ([#8491](https://github.com/googleapis/google-cloud-go/issues/8491)) ([d977419](https://github.com/googleapis/google-cloud-go/commit/d977419a3269f6acc193df77a2136a6eb4b4add7))
+* **auth:** Add downscope package ([#8532](https://github.com/googleapis/google-cloud-go/issues/8532)) ([dda9bff](https://github.com/googleapis/google-cloud-go/commit/dda9bff8ec70e6d104901b4105d13dcaa4e2404c))
+* **auth:** Add grpctransport package ([#8625](https://github.com/googleapis/google-cloud-go/issues/8625)) ([69a8347](https://github.com/googleapis/google-cloud-go/commit/69a83470bdcc7ed10c6c36d1abc3b7cfdb8a0ee5))
+* **auth:** Add httptransport package ([#8567](https://github.com/googleapis/google-cloud-go/issues/8567)) ([6898597](https://github.com/googleapis/google-cloud-go/commit/6898597d2ea95d630fcd00fd15c58c75ea843bff))
+* **auth:** Add idtoken package ([#8580](https://github.com/googleapis/google-cloud-go/issues/8580)) ([a79e693](https://github.com/googleapis/google-cloud-go/commit/a79e693e97e4e3e1c6742099af3dbc58866d88fe))
+* **auth:** Add impersonate package ([#8578](https://github.com/googleapis/google-cloud-go/issues/8578)) ([e29ba0c](https://github.com/googleapis/google-cloud-go/commit/e29ba0cb7bd3888ab9e808087027dc5a32474c04))
+* **auth:** Add support for external accounts in detect ([#8508](https://github.com/googleapis/google-cloud-go/issues/8508)) ([62210d5](https://github.com/googleapis/google-cloud-go/commit/62210d5d3e56e8e9f35db8e6ac0defec19582507))
+* **auth:** Port external account changes ([#8697](https://github.com/googleapis/google-cloud-go/issues/8697)) ([5823db5](https://github.com/googleapis/google-cloud-go/commit/5823db5d633069999b58b9131a7f9cd77e82c899))
+
+
+### Bug Fixes
+
+* **auth/oauth2adapt:** Update golang.org/x/net to v0.17.0 ([174da47](https://github.com/googleapis/google-cloud-go/commit/174da47254fefb12921bbfc65b7829a453af6f5d))
+* **auth:** Update golang.org/x/net to v0.17.0 ([174da47](https://github.com/googleapis/google-cloud-go/commit/174da47254fefb12921bbfc65b7829a453af6f5d))
diff --git a/vendor/cloud.google.com/go/auth/LICENSE b/vendor/cloud.google.com/go/auth/LICENSE
new file mode 100644
index 00000000..d6456956
--- /dev/null
+++ b/vendor/cloud.google.com/go/auth/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ 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.
diff --git a/vendor/cloud.google.com/go/auth/README.md b/vendor/cloud.google.com/go/auth/README.md
new file mode 100644
index 00000000..6fe4f076
--- /dev/null
+++ b/vendor/cloud.google.com/go/auth/README.md
@@ -0,0 +1,40 @@
+# Google Auth Library for Go
+
+[![Go Reference](https://pkg.go.dev/badge/cloud.google.com/go/auth.svg)](https://pkg.go.dev/cloud.google.com/go/auth)
+
+## Install
+
+``` bash
+go get cloud.google.com/go/auth@latest
+```
+
+## Usage
+
+The most common way this library is used is transitively, by default, from any
+of our Go client libraries.
+
+### Notable use-cases
+
+- To create a credential directly please see examples in the
+ [credentials](https://pkg.go.dev/cloud.google.com/go/auth/credentials)
+ package.
+- To create a authenticated HTTP client please see examples in the
+ [httptransport](https://pkg.go.dev/cloud.google.com/go/auth/httptransport)
+ package.
+- To create a authenticated gRPC connection please see examples in the
+ [grpctransport](https://pkg.go.dev/cloud.google.com/go/auth/grpctransport)
+ package.
+- To create an ID token please see examples in the
+ [idtoken](https://pkg.go.dev/cloud.google.com/go/auth/credentials/idtoken)
+ package.
+
+## Contributing
+
+Contributions are welcome. Please, see the
+[CONTRIBUTING](https://github.com/GoogleCloudPlatform/google-cloud-go/blob/main/CONTRIBUTING.md)
+document for details.
+
+Please note that this project is released with a Contributor Code of Conduct.
+By participating in this project you agree to abide by its terms.
+See [Contributor Code of Conduct](https://github.com/GoogleCloudPlatform/google-cloud-go/blob/main/CONTRIBUTING.md#contributor-code-of-conduct)
+for more information.
diff --git a/vendor/cloud.google.com/go/auth/auth.go b/vendor/cloud.google.com/go/auth/auth.go
new file mode 100644
index 00000000..a7fa84f6
--- /dev/null
+++ b/vendor/cloud.google.com/go/auth/auth.go
@@ -0,0 +1,608 @@
+// Copyright 2023 Google LLC
+//
+// 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 auth provides utilities for managing Google Cloud credentials,
+// including functionality for creating, caching, and refreshing OAuth2 tokens.
+// It offers customizable options for different OAuth2 flows, such as 2-legged
+// (2LO) and 3-legged (3LO) OAuth, along with support for PKCE and automatic
+// token management.
+package auth
+
+import (
+ "context"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "net/http"
+ "net/url"
+ "strings"
+ "sync"
+ "time"
+
+ "cloud.google.com/go/auth/internal"
+ "cloud.google.com/go/auth/internal/jwt"
+)
+
+const (
+ // Parameter keys for AuthCodeURL method to support PKCE.
+ codeChallengeKey = "code_challenge"
+ codeChallengeMethodKey = "code_challenge_method"
+
+ // Parameter key for Exchange method to support PKCE.
+ codeVerifierKey = "code_verifier"
+
+ // 3 minutes and 45 seconds before expiration. The shortest MDS cache is 4 minutes,
+ // so we give it 15 seconds to refresh it's cache before attempting to refresh a token.
+ defaultExpiryDelta = 225 * time.Second
+
+ universeDomainDefault = "googleapis.com"
+)
+
+// tokenState represents different states for a [Token].
+type tokenState int
+
+const (
+ // fresh indicates that the [Token] is valid. It is not expired or close to
+ // expired, or the token has no expiry.
+ fresh tokenState = iota
+ // stale indicates that the [Token] is close to expired, and should be
+ // refreshed. The token can be used normally.
+ stale
+ // invalid indicates that the [Token] is expired or invalid. The token
+ // cannot be used for a normal operation.
+ invalid
+)
+
+var (
+ defaultGrantType = "urn:ietf:params:oauth:grant-type:jwt-bearer"
+ defaultHeader = &jwt.Header{Algorithm: jwt.HeaderAlgRSA256, Type: jwt.HeaderType}
+
+ // for testing
+ timeNow = time.Now
+)
+
+// TokenProvider specifies an interface for anything that can return a token.
+type TokenProvider interface {
+ // Token returns a Token or an error.
+ // The Token returned must be safe to use
+ // concurrently.
+ // The returned Token must not be modified.
+ // The context provided must be sent along to any requests that are made in
+ // the implementing code.
+ Token(context.Context) (*Token, error)
+}
+
+// Token holds the credential token used to authorized requests. All fields are
+// considered read-only.
+type Token struct {
+ // Value is the token used to authorize requests. It is usually an access
+ // token but may be other types of tokens such as ID tokens in some flows.
+ Value string
+ // Type is the type of token Value is. If uninitialized, it should be
+ // assumed to be a "Bearer" token.
+ Type string
+ // Expiry is the time the token is set to expire.
+ Expiry time.Time
+ // Metadata may include, but is not limited to, the body of the token
+ // response returned by the server.
+ Metadata map[string]interface{} // TODO(codyoss): maybe make a method to flatten metadata to avoid []string for url.Values
+}
+
+// IsValid reports that a [Token] is non-nil, has a [Token.Value], and has not
+// expired. A token is considered expired if [Token.Expiry] has passed or will
+// pass in the next 225 seconds.
+func (t *Token) IsValid() bool {
+ return t.isValidWithEarlyExpiry(defaultExpiryDelta)
+}
+
+// MetadataString is a convenience method for accessing string values in the
+// token's metadata. Returns an empty string if the metadata is nil or the value
+// for the given key cannot be cast to a string.
+func (t *Token) MetadataString(k string) string {
+ if t.Metadata == nil {
+ return ""
+ }
+ s, ok := t.Metadata[k].(string)
+ if !ok {
+ return ""
+ }
+ return s
+}
+
+func (t *Token) isValidWithEarlyExpiry(earlyExpiry time.Duration) bool {
+ if t.isEmpty() {
+ return false
+ }
+ if t.Expiry.IsZero() {
+ return true
+ }
+ return !t.Expiry.Round(0).Add(-earlyExpiry).Before(timeNow())
+}
+
+func (t *Token) isEmpty() bool {
+ return t == nil || t.Value == ""
+}
+
+// Credentials holds Google credentials, including
+// [Application Default Credentials].
+//
+// [Application Default Credentials]: https://developers.google.com/accounts/docs/application-default-credentials
+type Credentials struct {
+ json []byte
+ projectID CredentialsPropertyProvider
+ quotaProjectID CredentialsPropertyProvider
+ // universeDomain is the default service domain for a given Cloud universe.
+ universeDomain CredentialsPropertyProvider
+
+ TokenProvider
+}
+
+// JSON returns the bytes associated with the the file used to source
+// credentials if one was used.
+func (c *Credentials) JSON() []byte {
+ return c.json
+}
+
+// ProjectID returns the associated project ID from the underlying file or
+// environment.
+func (c *Credentials) ProjectID(ctx context.Context) (string, error) {
+ if c.projectID == nil {
+ return internal.GetProjectID(c.json, ""), nil
+ }
+ v, err := c.projectID.GetProperty(ctx)
+ if err != nil {
+ return "", err
+ }
+ return internal.GetProjectID(c.json, v), nil
+}
+
+// QuotaProjectID returns the associated quota project ID from the underlying
+// file or environment.
+func (c *Credentials) QuotaProjectID(ctx context.Context) (string, error) {
+ if c.quotaProjectID == nil {
+ return internal.GetQuotaProject(c.json, ""), nil
+ }
+ v, err := c.quotaProjectID.GetProperty(ctx)
+ if err != nil {
+ return "", err
+ }
+ return internal.GetQuotaProject(c.json, v), nil
+}
+
+// UniverseDomain returns the default service domain for a given Cloud universe.
+// The default value is "googleapis.com".
+func (c *Credentials) UniverseDomain(ctx context.Context) (string, error) {
+ if c.universeDomain == nil {
+ return universeDomainDefault, nil
+ }
+ v, err := c.universeDomain.GetProperty(ctx)
+ if err != nil {
+ return "", err
+ }
+ if v == "" {
+ return universeDomainDefault, nil
+ }
+ return v, err
+}
+
+// CredentialsPropertyProvider provides an implementation to fetch a property
+// value for [Credentials].
+type CredentialsPropertyProvider interface {
+ GetProperty(context.Context) (string, error)
+}
+
+// CredentialsPropertyFunc is a type adapter to allow the use of ordinary
+// functions as a [CredentialsPropertyProvider].
+type CredentialsPropertyFunc func(context.Context) (string, error)
+
+// GetProperty loads the properly value provided the given context.
+func (p CredentialsPropertyFunc) GetProperty(ctx context.Context) (string, error) {
+ return p(ctx)
+}
+
+// CredentialsOptions are used to configure [Credentials].
+type CredentialsOptions struct {
+ // TokenProvider is a means of sourcing a token for the credentials. Required.
+ TokenProvider TokenProvider
+ // JSON is the raw contents of the credentials file if sourced from a file.
+ JSON []byte
+ // ProjectIDProvider resolves the project ID associated with the
+ // credentials.
+ ProjectIDProvider CredentialsPropertyProvider
+ // QuotaProjectIDProvider resolves the quota project ID associated with the
+ // credentials.
+ QuotaProjectIDProvider CredentialsPropertyProvider
+ // UniverseDomainProvider resolves the universe domain with the credentials.
+ UniverseDomainProvider CredentialsPropertyProvider
+}
+
+// NewCredentials returns new [Credentials] from the provided options.
+func NewCredentials(opts *CredentialsOptions) *Credentials {
+ creds := &Credentials{
+ TokenProvider: opts.TokenProvider,
+ json: opts.JSON,
+ projectID: opts.ProjectIDProvider,
+ quotaProjectID: opts.QuotaProjectIDProvider,
+ universeDomain: opts.UniverseDomainProvider,
+ }
+
+ return creds
+}
+
+// CachedTokenProviderOptions provides options for configuring a cached
+// [TokenProvider].
+type CachedTokenProviderOptions struct {
+ // DisableAutoRefresh makes the TokenProvider always return the same token,
+ // even if it is expired. The default is false. Optional.
+ DisableAutoRefresh bool
+ // ExpireEarly configures the amount of time before a token expires, that it
+ // should be refreshed. If unset, the default value is 3 minutes and 45
+ // seconds. Optional.
+ ExpireEarly time.Duration
+ // DisableAsyncRefresh configures a synchronous workflow that refreshes
+ // tokens in a blocking manner. The default is false. Optional.
+ DisableAsyncRefresh bool
+}
+
+func (ctpo *CachedTokenProviderOptions) autoRefresh() bool {
+ if ctpo == nil {
+ return true
+ }
+ return !ctpo.DisableAutoRefresh
+}
+
+func (ctpo *CachedTokenProviderOptions) expireEarly() time.Duration {
+ if ctpo == nil || ctpo.ExpireEarly == 0 {
+ return defaultExpiryDelta
+ }
+ return ctpo.ExpireEarly
+}
+
+func (ctpo *CachedTokenProviderOptions) blockingRefresh() bool {
+ if ctpo == nil {
+ return false
+ }
+ return ctpo.DisableAsyncRefresh
+}
+
+// NewCachedTokenProvider wraps a [TokenProvider] to cache the tokens returned
+// by the underlying provider. By default it will refresh tokens asynchronously
+// a few minutes before they expire.
+func NewCachedTokenProvider(tp TokenProvider, opts *CachedTokenProviderOptions) TokenProvider {
+ if ctp, ok := tp.(*cachedTokenProvider); ok {
+ return ctp
+ }
+ return &cachedTokenProvider{
+ tp: tp,
+ autoRefresh: opts.autoRefresh(),
+ expireEarly: opts.expireEarly(),
+ blockingRefresh: opts.blockingRefresh(),
+ }
+}
+
+type cachedTokenProvider struct {
+ tp TokenProvider
+ autoRefresh bool
+ expireEarly time.Duration
+ blockingRefresh bool
+
+ mu sync.Mutex
+ cachedToken *Token
+ // isRefreshRunning ensures that the non-blocking refresh will only be
+ // attempted once, even if multiple callers enter the Token method.
+ isRefreshRunning bool
+ // isRefreshErr ensures that the non-blocking refresh will only be attempted
+ // once per refresh window if an error is encountered.
+ isRefreshErr bool
+}
+
+func (c *cachedTokenProvider) Token(ctx context.Context) (*Token, error) {
+ if c.blockingRefresh {
+ return c.tokenBlocking(ctx)
+ }
+ return c.tokenNonBlocking(ctx)
+}
+
+func (c *cachedTokenProvider) tokenNonBlocking(ctx context.Context) (*Token, error) {
+ switch c.tokenState() {
+ case fresh:
+ c.mu.Lock()
+ defer c.mu.Unlock()
+ return c.cachedToken, nil
+ case stale:
+ // Call tokenAsync with a new Context because the user-provided context
+ // may have a short timeout incompatible with async token refresh.
+ c.tokenAsync(context.Background())
+ // Return the stale token immediately to not block customer requests to Cloud services.
+ c.mu.Lock()
+ defer c.mu.Unlock()
+ return c.cachedToken, nil
+ default: // invalid
+ return c.tokenBlocking(ctx)
+ }
+}
+
+// tokenState reports the token's validity.
+func (c *cachedTokenProvider) tokenState() tokenState {
+ c.mu.Lock()
+ defer c.mu.Unlock()
+ t := c.cachedToken
+ now := timeNow()
+ if t == nil || t.Value == "" {
+ return invalid
+ } else if t.Expiry.IsZero() {
+ return fresh
+ } else if now.After(t.Expiry.Round(0)) {
+ return invalid
+ } else if now.After(t.Expiry.Round(0).Add(-c.expireEarly)) {
+ return stale
+ }
+ return fresh
+}
+
+// tokenAsync uses a bool to ensure that only one non-blocking token refresh
+// happens at a time, even if multiple callers have entered this function
+// concurrently. This avoids creating an arbitrary number of concurrent
+// goroutines. Retries should be attempted and managed within the Token method.
+// If the refresh attempt fails, no further attempts are made until the refresh
+// window expires and the token enters the invalid state, at which point the
+// blocking call to Token should likely return the same error on the main goroutine.
+func (c *cachedTokenProvider) tokenAsync(ctx context.Context) {
+ fn := func() {
+ c.mu.Lock()
+ c.isRefreshRunning = true
+ c.mu.Unlock()
+ t, err := c.tp.Token(ctx)
+ c.mu.Lock()
+ defer c.mu.Unlock()
+ c.isRefreshRunning = false
+ if err != nil {
+ // Discard errors from the non-blocking refresh, but prevent further
+ // attempts.
+ c.isRefreshErr = true
+ return
+ }
+ c.cachedToken = t
+ }
+ c.mu.Lock()
+ defer c.mu.Unlock()
+ if !c.isRefreshRunning && !c.isRefreshErr {
+ go fn()
+ }
+}
+
+func (c *cachedTokenProvider) tokenBlocking(ctx context.Context) (*Token, error) {
+ c.mu.Lock()
+ defer c.mu.Unlock()
+ c.isRefreshErr = false
+ if c.cachedToken.IsValid() || (!c.autoRefresh && !c.cachedToken.isEmpty()) {
+ return c.cachedToken, nil
+ }
+ t, err := c.tp.Token(ctx)
+ if err != nil {
+ return nil, err
+ }
+ c.cachedToken = t
+ return t, nil
+}
+
+// Error is a error associated with retrieving a [Token]. It can hold useful
+// additional details for debugging.
+type Error struct {
+ // Response is the HTTP response associated with error. The body will always
+ // be already closed and consumed.
+ Response *http.Response
+ // Body is the HTTP response body.
+ Body []byte
+ // Err is the underlying wrapped error.
+ Err error
+
+ // code returned in the token response
+ code string
+ // description returned in the token response
+ description string
+ // uri returned in the token response
+ uri string
+}
+
+func (e *Error) Error() string {
+ if e.code != "" {
+ s := fmt.Sprintf("auth: %q", e.code)
+ if e.description != "" {
+ s += fmt.Sprintf(" %q", e.description)
+ }
+ if e.uri != "" {
+ s += fmt.Sprintf(" %q", e.uri)
+ }
+ return s
+ }
+ return fmt.Sprintf("auth: cannot fetch token: %v\nResponse: %s", e.Response.StatusCode, e.Body)
+}
+
+// Temporary returns true if the error is considered temporary and may be able
+// to be retried.
+func (e *Error) Temporary() bool {
+ if e.Response == nil {
+ return false
+ }
+ sc := e.Response.StatusCode
+ return sc == http.StatusInternalServerError || sc == http.StatusServiceUnavailable || sc == http.StatusRequestTimeout || sc == http.StatusTooManyRequests
+}
+
+func (e *Error) Unwrap() error {
+ return e.Err
+}
+
+// Style describes how the token endpoint wants to receive the ClientID and
+// ClientSecret.
+type Style int
+
+const (
+ // StyleUnknown means the value has not been initiated. Sending this in
+ // a request will cause the token exchange to fail.
+ StyleUnknown Style = iota
+ // StyleInParams sends client info in the body of a POST request.
+ StyleInParams
+ // StyleInHeader sends client info using Basic Authorization header.
+ StyleInHeader
+)
+
+// Options2LO is the configuration settings for doing a 2-legged JWT OAuth2 flow.
+type Options2LO struct {
+ // Email is the OAuth2 client ID. This value is set as the "iss" in the
+ // JWT.
+ Email string
+ // PrivateKey contains the contents of an RSA private key or the
+ // contents of a PEM file that contains a private key. It is used to sign
+ // the JWT created.
+ PrivateKey []byte
+ // TokenURL is th URL the JWT is sent to. Required.
+ TokenURL string
+ // PrivateKeyID is the ID of the key used to sign the JWT. It is used as the
+ // "kid" in the JWT header. Optional.
+ PrivateKeyID string
+ // Subject is the used for to impersonate a user. It is used as the "sub" in
+ // the JWT.m Optional.
+ Subject string
+ // Scopes specifies requested permissions for the token. Optional.
+ Scopes []string
+ // Expires specifies the lifetime of the token. Optional.
+ Expires time.Duration
+ // Audience specifies the "aud" in the JWT. Optional.
+ Audience string
+ // PrivateClaims allows specifying any custom claims for the JWT. Optional.
+ PrivateClaims map[string]interface{}
+
+ // Client is the client to be used to make the underlying token requests.
+ // Optional.
+ Client *http.Client
+ // UseIDToken requests that the token returned be an ID token if one is
+ // returned from the server. Optional.
+ UseIDToken bool
+}
+
+func (o *Options2LO) client() *http.Client {
+ if o.Client != nil {
+ return o.Client
+ }
+ return internal.DefaultClient()
+}
+
+func (o *Options2LO) validate() error {
+ if o == nil {
+ return errors.New("auth: options must be provided")
+ }
+ if o.Email == "" {
+ return errors.New("auth: email must be provided")
+ }
+ if len(o.PrivateKey) == 0 {
+ return errors.New("auth: private key must be provided")
+ }
+ if o.TokenURL == "" {
+ return errors.New("auth: token URL must be provided")
+ }
+ return nil
+}
+
+// New2LOTokenProvider returns a [TokenProvider] from the provided options.
+func New2LOTokenProvider(opts *Options2LO) (TokenProvider, error) {
+ if err := opts.validate(); err != nil {
+ return nil, err
+ }
+ return tokenProvider2LO{opts: opts, Client: opts.client()}, nil
+}
+
+type tokenProvider2LO struct {
+ opts *Options2LO
+ Client *http.Client
+}
+
+func (tp tokenProvider2LO) Token(ctx context.Context) (*Token, error) {
+ pk, err := internal.ParseKey(tp.opts.PrivateKey)
+ if err != nil {
+ return nil, err
+ }
+ claimSet := &jwt.Claims{
+ Iss: tp.opts.Email,
+ Scope: strings.Join(tp.opts.Scopes, " "),
+ Aud: tp.opts.TokenURL,
+ AdditionalClaims: tp.opts.PrivateClaims,
+ Sub: tp.opts.Subject,
+ }
+ if t := tp.opts.Expires; t > 0 {
+ claimSet.Exp = time.Now().Add(t).Unix()
+ }
+ if aud := tp.opts.Audience; aud != "" {
+ claimSet.Aud = aud
+ }
+ h := *defaultHeader
+ h.KeyID = tp.opts.PrivateKeyID
+ payload, err := jwt.EncodeJWS(&h, claimSet, pk)
+ if err != nil {
+ return nil, err
+ }
+ v := url.Values{}
+ v.Set("grant_type", defaultGrantType)
+ v.Set("assertion", payload)
+ req, err := http.NewRequestWithContext(ctx, "POST", tp.opts.TokenURL, strings.NewReader(v.Encode()))
+ if err != nil {
+ return nil, err
+ }
+ req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
+ resp, body, err := internal.DoRequest(tp.Client, req)
+ if err != nil {
+ return nil, fmt.Errorf("auth: cannot fetch token: %w", err)
+ }
+ if c := resp.StatusCode; c < http.StatusOK || c >= http.StatusMultipleChoices {
+ return nil, &Error{
+ Response: resp,
+ Body: body,
+ }
+ }
+ // tokenRes is the JSON response body.
+ var tokenRes struct {
+ AccessToken string `json:"access_token"`
+ TokenType string `json:"token_type"`
+ IDToken string `json:"id_token"`
+ ExpiresIn int64 `json:"expires_in"`
+ }
+ if err := json.Unmarshal(body, &tokenRes); err != nil {
+ return nil, fmt.Errorf("auth: cannot fetch token: %w", err)
+ }
+ token := &Token{
+ Value: tokenRes.AccessToken,
+ Type: tokenRes.TokenType,
+ }
+ token.Metadata = make(map[string]interface{})
+ json.Unmarshal(body, &token.Metadata) // no error checks for optional fields
+
+ if secs := tokenRes.ExpiresIn; secs > 0 {
+ token.Expiry = time.Now().Add(time.Duration(secs) * time.Second)
+ }
+ if v := tokenRes.IDToken; v != "" {
+ // decode returned id token to get expiry
+ claimSet, err := jwt.DecodeJWS(v)
+ if err != nil {
+ return nil, fmt.Errorf("auth: error decoding JWT token: %w", err)
+ }
+ token.Expiry = time.Unix(claimSet.Exp, 0)
+ }
+ if tp.opts.UseIDToken {
+ if tokenRes.IDToken == "" {
+ return nil, fmt.Errorf("auth: response doesn't have JWT token")
+ }
+ token.Value = tokenRes.IDToken
+ }
+ return token, nil
+}
diff --git a/vendor/cloud.google.com/go/auth/credentials/compute.go b/vendor/cloud.google.com/go/auth/credentials/compute.go
new file mode 100644
index 00000000..6f70fa35
--- /dev/null
+++ b/vendor/cloud.google.com/go/auth/credentials/compute.go
@@ -0,0 +1,86 @@
+// Copyright 2023 Google LLC
+//
+// 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 credentials
+
+import (
+ "context"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "net/url"
+ "strings"
+ "time"
+
+ "cloud.google.com/go/auth"
+ "cloud.google.com/go/compute/metadata"
+)
+
+var (
+ computeTokenMetadata = map[string]interface{}{
+ "auth.google.tokenSource": "compute-metadata",
+ "auth.google.serviceAccount": "default",
+ }
+ computeTokenURI = "instance/service-accounts/default/token"
+)
+
+// computeTokenProvider creates a [cloud.google.com/go/auth.TokenProvider] that
+// uses the metadata service to retrieve tokens.
+func computeTokenProvider(opts *DetectOptions) auth.TokenProvider {
+ return auth.NewCachedTokenProvider(computeProvider{scopes: opts.Scopes}, &auth.CachedTokenProviderOptions{
+ ExpireEarly: opts.EarlyTokenRefresh,
+ DisableAsyncRefresh: opts.DisableAsyncRefresh,
+ })
+}
+
+// computeProvider fetches tokens from the google cloud metadata service.
+type computeProvider struct {
+ scopes []string
+}
+
+type metadataTokenResp struct {
+ AccessToken string `json:"access_token"`
+ ExpiresInSec int `json:"expires_in"`
+ TokenType string `json:"token_type"`
+}
+
+func (cs computeProvider) Token(ctx context.Context) (*auth.Token, error) {
+ tokenURI, err := url.Parse(computeTokenURI)
+ if err != nil {
+ return nil, err
+ }
+ if len(cs.scopes) > 0 {
+ v := url.Values{}
+ v.Set("scopes", strings.Join(cs.scopes, ","))
+ tokenURI.RawQuery = v.Encode()
+ }
+ tokenJSON, err := metadata.GetWithContext(ctx, tokenURI.String())
+ if err != nil {
+ return nil, fmt.Errorf("credentials: cannot fetch token: %w", err)
+ }
+ var res metadataTokenResp
+ if err := json.NewDecoder(strings.NewReader(tokenJSON)).Decode(&res); err != nil {
+ return nil, fmt.Errorf("credentials: invalid token JSON from metadata: %w", err)
+ }
+ if res.ExpiresInSec == 0 || res.AccessToken == "" {
+ return nil, errors.New("credentials: incomplete token received from metadata")
+ }
+ return &auth.Token{
+ Value: res.AccessToken,
+ Type: res.TokenType,
+ Expiry: time.Now().Add(time.Duration(res.ExpiresInSec) * time.Second),
+ Metadata: computeTokenMetadata,
+ }, nil
+
+}
diff --git a/vendor/cloud.google.com/go/auth/credentials/detect.go b/vendor/cloud.google.com/go/auth/credentials/detect.go
new file mode 100644
index 00000000..010afc37
--- /dev/null
+++ b/vendor/cloud.google.com/go/auth/credentials/detect.go
@@ -0,0 +1,262 @@
+// Copyright 2023 Google LLC
+//
+// 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 credentials
+
+import (
+ "context"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "net/http"
+ "os"
+ "time"
+
+ "cloud.google.com/go/auth"
+ "cloud.google.com/go/auth/internal"
+ "cloud.google.com/go/auth/internal/credsfile"
+ "cloud.google.com/go/compute/metadata"
+)
+
+const (
+ // jwtTokenURL is Google's OAuth 2.0 token URL to use with the JWT(2LO) flow.
+ jwtTokenURL = "https://oauth2.googleapis.com/token"
+
+ // Google's OAuth 2.0 default endpoints.
+ googleAuthURL = "https://accounts.google.com/o/oauth2/auth"
+ googleTokenURL = "https://oauth2.googleapis.com/token"
+
+ // GoogleMTLSTokenURL is Google's default OAuth2.0 mTLS endpoint.
+ GoogleMTLSTokenURL = "https://oauth2.mtls.googleapis.com/token"
+
+ // Help on default credentials
+ adcSetupURL = "https://cloud.google.com/docs/authentication/external/set-up-adc"
+)
+
+var (
+ // for testing
+ allowOnGCECheck = true
+)
+
+// OnGCE reports whether this process is running in Google Cloud.
+func OnGCE() bool {
+ // TODO(codyoss): once all libs use this auth lib move metadata check here
+ return allowOnGCECheck && metadata.OnGCE()
+}
+
+// DetectDefault searches for "Application Default Credentials" and returns
+// a credential based on the [DetectOptions] provided.
+//
+// It looks for credentials in the following places, preferring the first
+// location found:
+//
+// - A JSON file whose path is specified by the GOOGLE_APPLICATION_CREDENTIALS
+// environment variable. For workload identity federation, refer to
+// https://cloud.google.com/iam/docs/how-to#using-workload-identity-federation
+// on how to generate the JSON configuration file for on-prem/non-Google
+// cloud platforms.
+// - A JSON file in a location known to the gcloud command-line tool. On
+// Windows, this is %APPDATA%/gcloud/application_default_credentials.json. On
+// other systems, $HOME/.config/gcloud/application_default_credentials.json.
+// - On Google Compute Engine, Google App Engine standard second generation
+// runtimes, and Google App Engine flexible environment, it fetches
+// credentials from the metadata server.
+func DetectDefault(opts *DetectOptions) (*auth.Credentials, error) {
+ if err := opts.validate(); err != nil {
+ return nil, err
+ }
+ if len(opts.CredentialsJSON) > 0 {
+ return readCredentialsFileJSON(opts.CredentialsJSON, opts)
+ }
+ if opts.CredentialsFile != "" {
+ return readCredentialsFile(opts.CredentialsFile, opts)
+ }
+ if filename := os.Getenv(credsfile.GoogleAppCredsEnvVar); filename != "" {
+ creds, err := readCredentialsFile(filename, opts)
+ if err != nil {
+ return nil, err
+ }
+ return creds, nil
+ }
+
+ fileName := credsfile.GetWellKnownFileName()
+ if b, err := os.ReadFile(fileName); err == nil {
+ return readCredentialsFileJSON(b, opts)
+ }
+
+ if OnGCE() {
+ return auth.NewCredentials(&auth.CredentialsOptions{
+ TokenProvider: computeTokenProvider(opts),
+ ProjectIDProvider: auth.CredentialsPropertyFunc(func(ctx context.Context) (string, error) {
+ return metadata.ProjectIDWithContext(ctx)
+ }),
+ UniverseDomainProvider: &internal.ComputeUniverseDomainProvider{},
+ }), nil
+ }
+
+ return nil, fmt.Errorf("credentials: could not find default credentials. See %v for more information", adcSetupURL)
+}
+
+// DetectOptions provides configuration for [DetectDefault].
+type DetectOptions struct {
+ // Scopes that credentials tokens should have. Example:
+ // https://www.googleapis.com/auth/cloud-platform. Required if Audience is
+ // not provided.
+ Scopes []string
+ // Audience that credentials tokens should have. Only applicable for 2LO
+ // flows with service accounts. If specified, scopes should not be provided.
+ Audience string
+ // Subject is the user email used for [domain wide delegation](https://developers.google.com/identity/protocols/oauth2/service-account#delegatingauthority).
+ // Optional.
+ Subject string
+ // EarlyTokenRefresh configures how early before a token expires that it
+ // should be refreshed. Once the token’s time until expiration has entered
+ // this refresh window the token is considered valid but stale. If unset,
+ // the default value is 3 minutes and 45 seconds. Optional.
+ EarlyTokenRefresh time.Duration
+ // DisableAsyncRefresh configures a synchronous workflow that refreshes
+ // stale tokens while blocking. The default is false. Optional.
+ DisableAsyncRefresh bool
+ // AuthHandlerOptions configures an authorization handler and other options
+ // for 3LO flows. It is required, and only used, for client credential
+ // flows.
+ AuthHandlerOptions *auth.AuthorizationHandlerOptions
+ // TokenURL allows to set the token endpoint for user credential flows. If
+ // unset the default value is: https://oauth2.googleapis.com/token.
+ // Optional.
+ TokenURL string
+ // STSAudience is the audience sent to when retrieving an STS token.
+ // Currently this only used for GDCH auth flow, for which it is required.
+ STSAudience string
+ // CredentialsFile overrides detection logic and sources a credential file
+ // from the provided filepath. If provided, CredentialsJSON must not be.
+ // Optional.
+ CredentialsFile string
+ // CredentialsJSON overrides detection logic and uses the JSON bytes as the
+ // source for the credential. If provided, CredentialsFile must not be.
+ // Optional.
+ CredentialsJSON []byte
+ // UseSelfSignedJWT directs service account based credentials to create a
+ // self-signed JWT with the private key found in the file, skipping any
+ // network requests that would normally be made. Optional.
+ UseSelfSignedJWT bool
+ // Client configures the underlying client used to make network requests
+ // when fetching tokens. Optional.
+ Client *http.Client
+ // UniverseDomain is the default service domain for a given Cloud universe.
+ // The default value is "googleapis.com". This option is ignored for
+ // authentication flows that do not support universe domain. Optional.
+ UniverseDomain string
+}
+
+func (o *DetectOptions) validate() error {
+ if o == nil {
+ return errors.New("credentials: options must be provided")
+ }
+ if len(o.Scopes) > 0 && o.Audience != "" {
+ return errors.New("credentials: both scopes and audience were provided")
+ }
+ if len(o.CredentialsJSON) > 0 && o.CredentialsFile != "" {
+ return errors.New("credentials: both credentials file and JSON were provided")
+ }
+ return nil
+}
+
+func (o *DetectOptions) tokenURL() string {
+ if o.TokenURL != "" {
+ return o.TokenURL
+ }
+ return googleTokenURL
+}
+
+func (o *DetectOptions) scopes() []string {
+ scopes := make([]string, len(o.Scopes))
+ copy(scopes, o.Scopes)
+ return scopes
+}
+
+func (o *DetectOptions) client() *http.Client {
+ if o.Client != nil {
+ return o.Client
+ }
+ return internal.DefaultClient()
+}
+
+func readCredentialsFile(filename string, opts *DetectOptions) (*auth.Credentials, error) {
+ b, err := os.ReadFile(filename)
+ if err != nil {
+ return nil, err
+ }
+ return readCredentialsFileJSON(b, opts)
+}
+
+func readCredentialsFileJSON(b []byte, opts *DetectOptions) (*auth.Credentials, error) {
+ // attempt to parse jsonData as a Google Developers Console client_credentials.json.
+ config := clientCredConfigFromJSON(b, opts)
+ if config != nil {
+ if config.AuthHandlerOpts == nil {
+ return nil, errors.New("credentials: auth handler must be specified for this credential filetype")
+ }
+ tp, err := auth.New3LOTokenProvider(config)
+ if err != nil {
+ return nil, err
+ }
+ return auth.NewCredentials(&auth.CredentialsOptions{
+ TokenProvider: tp,
+ JSON: b,
+ }), nil
+ }
+ return fileCredentials(b, opts)
+}
+
+func clientCredConfigFromJSON(b []byte, opts *DetectOptions) *auth.Options3LO {
+ var creds credsfile.ClientCredentialsFile
+ var c *credsfile.Config3LO
+ if err := json.Unmarshal(b, &creds); err != nil {
+ return nil
+ }
+ switch {
+ case creds.Web != nil:
+ c = creds.Web
+ case creds.Installed != nil:
+ c = creds.Installed
+ default:
+ return nil
+ }
+ if len(c.RedirectURIs) < 1 {
+ return nil
+ }
+ var handleOpts *auth.AuthorizationHandlerOptions
+ if opts.AuthHandlerOptions != nil {
+ handleOpts = &auth.AuthorizationHandlerOptions{
+ Handler: opts.AuthHandlerOptions.Handler,
+ State: opts.AuthHandlerOptions.State,
+ PKCEOpts: opts.AuthHandlerOptions.PKCEOpts,
+ }
+ }
+ return &auth.Options3LO{
+ ClientID: c.ClientID,
+ ClientSecret: c.ClientSecret,
+ RedirectURL: c.RedirectURIs[0],
+ Scopes: opts.scopes(),
+ AuthURL: c.AuthURI,
+ TokenURL: c.TokenURI,
+ Client: opts.client(),
+ EarlyTokenExpiry: opts.EarlyTokenRefresh,
+ AuthHandlerOpts: handleOpts,
+ // TODO(codyoss): refactor this out. We need to add in auto-detection
+ // for this use case.
+ AuthStyle: auth.StyleInParams,
+ }
+}
diff --git a/vendor/cloud.google.com/go/auth/credentials/doc.go b/vendor/cloud.google.com/go/auth/credentials/doc.go
new file mode 100644
index 00000000..1dbb2866
--- /dev/null
+++ b/vendor/cloud.google.com/go/auth/credentials/doc.go
@@ -0,0 +1,45 @@
+// Copyright 2023 Google LLC
+//
+// 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 credentials provides support for making OAuth2 authorized and
+// authenticated HTTP requests to Google APIs. It supports the Web server flow,
+// client-side credentials, service accounts, Google Compute Engine service
+// accounts, Google App Engine service accounts and workload identity federation
+// from non-Google cloud platforms.
+//
+// A brief overview of the package follows. For more information, please read
+// https://developers.google.com/accounts/docs/OAuth2
+// and
+// https://developers.google.com/accounts/docs/application-default-credentials.
+// For more information on using workload identity federation, refer to
+// https://cloud.google.com/iam/docs/how-to#using-workload-identity-federation.
+//
+// # Credentials
+//
+// The [cloud.google.com/go/auth.Credentials] type represents Google
+// credentials, including Application Default Credentials.
+//
+// Use [DetectDefault] to obtain Application Default Credentials.
+//
+// Application Default Credentials support workload identity federation to
+// access Google Cloud resources from non-Google Cloud platforms including Amazon
+// Web Services (AWS), Microsoft Azure or any identity provider that supports
+// OpenID Connect (OIDC). Workload identity federation is recommended for
+// non-Google Cloud environments as it avoids the need to download, manage, and
+// store service account private keys locally.
+//
+// # Workforce Identity Federation
+//
+// For more information on this feature see [cloud.google.com/go/auth/credentials/externalaccount].
+package credentials
diff --git a/vendor/cloud.google.com/go/auth/credentials/filetypes.go b/vendor/cloud.google.com/go/auth/credentials/filetypes.go
new file mode 100644
index 00000000..6591b181
--- /dev/null
+++ b/vendor/cloud.google.com/go/auth/credentials/filetypes.go
@@ -0,0 +1,225 @@
+// Copyright 2023 Google LLC
+//
+// 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 credentials
+
+import (
+ "errors"
+ "fmt"
+
+ "cloud.google.com/go/auth"
+ "cloud.google.com/go/auth/credentials/internal/externalaccount"
+ "cloud.google.com/go/auth/credentials/internal/externalaccountuser"
+ "cloud.google.com/go/auth/credentials/internal/gdch"
+ "cloud.google.com/go/auth/credentials/internal/impersonate"
+ internalauth "cloud.google.com/go/auth/internal"
+ "cloud.google.com/go/auth/internal/credsfile"
+)
+
+func fileCredentials(b []byte, opts *DetectOptions) (*auth.Credentials, error) {
+ fileType, err := credsfile.ParseFileType(b)
+ if err != nil {
+ return nil, err
+ }
+
+ var projectID, universeDomain string
+ var tp auth.TokenProvider
+ switch fileType {
+ case credsfile.ServiceAccountKey:
+ f, err := credsfile.ParseServiceAccount(b)
+ if err != nil {
+ return nil, err
+ }
+ tp, err = handleServiceAccount(f, opts)
+ if err != nil {
+ return nil, err
+ }
+ projectID = f.ProjectID
+ universeDomain = resolveUniverseDomain(opts.UniverseDomain, f.UniverseDomain)
+ case credsfile.UserCredentialsKey:
+ f, err := credsfile.ParseUserCredentials(b)
+ if err != nil {
+ return nil, err
+ }
+ tp, err = handleUserCredential(f, opts)
+ if err != nil {
+ return nil, err
+ }
+ universeDomain = f.UniverseDomain
+ case credsfile.ExternalAccountKey:
+ f, err := credsfile.ParseExternalAccount(b)
+ if err != nil {
+ return nil, err
+ }
+ tp, err = handleExternalAccount(f, opts)
+ if err != nil {
+ return nil, err
+ }
+ universeDomain = resolveUniverseDomain(opts.UniverseDomain, f.UniverseDomain)
+ case credsfile.ExternalAccountAuthorizedUserKey:
+ f, err := credsfile.ParseExternalAccountAuthorizedUser(b)
+ if err != nil {
+ return nil, err
+ }
+ tp, err = handleExternalAccountAuthorizedUser(f, opts)
+ if err != nil {
+ return nil, err
+ }
+ universeDomain = f.UniverseDomain
+ case credsfile.ImpersonatedServiceAccountKey:
+ f, err := credsfile.ParseImpersonatedServiceAccount(b)
+ if err != nil {
+ return nil, err
+ }
+ tp, err = handleImpersonatedServiceAccount(f, opts)
+ if err != nil {
+ return nil, err
+ }
+ universeDomain = resolveUniverseDomain(opts.UniverseDomain, f.UniverseDomain)
+ case credsfile.GDCHServiceAccountKey:
+ f, err := credsfile.ParseGDCHServiceAccount(b)
+ if err != nil {
+ return nil, err
+ }
+ tp, err = handleGDCHServiceAccount(f, opts)
+ if err != nil {
+ return nil, err
+ }
+ projectID = f.Project
+ universeDomain = f.UniverseDomain
+ default:
+ return nil, fmt.Errorf("credentials: unsupported filetype %q", fileType)
+ }
+ return auth.NewCredentials(&auth.CredentialsOptions{
+ TokenProvider: auth.NewCachedTokenProvider(tp, &auth.CachedTokenProviderOptions{
+ ExpireEarly: opts.EarlyTokenRefresh,
+ }),
+ JSON: b,
+ ProjectIDProvider: internalauth.StaticCredentialsProperty(projectID),
+ // TODO(codyoss): only set quota project here if there was a user override
+ UniverseDomainProvider: internalauth.StaticCredentialsProperty(universeDomain),
+ }), nil
+}
+
+// resolveUniverseDomain returns optsUniverseDomain if non-empty, in order to
+// support configuring universe-specific credentials in code. Auth flows
+// unsupported for universe domain should not use this func, but should instead
+// simply set the file universe domain on the credentials.
+func resolveUniverseDomain(optsUniverseDomain, fileUniverseDomain string) string {
+ if optsUniverseDomain != "" {
+ return optsUniverseDomain
+ }
+ return fileUniverseDomain
+}
+
+func handleServiceAccount(f *credsfile.ServiceAccountFile, opts *DetectOptions) (auth.TokenProvider, error) {
+ ud := resolveUniverseDomain(opts.UniverseDomain, f.UniverseDomain)
+ if opts.UseSelfSignedJWT {
+ return configureSelfSignedJWT(f, opts)
+ } else if ud != "" && ud != internalauth.DefaultUniverseDomain {
+ // For non-GDU universe domains, token exchange is impossible and services
+ // must support self-signed JWTs.
+ opts.UseSelfSignedJWT = true
+ return configureSelfSignedJWT(f, opts)
+ }
+ opts2LO := &auth.Options2LO{
+ Email: f.ClientEmail,
+ PrivateKey: []byte(f.PrivateKey),
+ PrivateKeyID: f.PrivateKeyID,
+ Scopes: opts.scopes(),
+ TokenURL: f.TokenURL,
+ Subject: opts.Subject,
+ Client: opts.client(),
+ }
+ if opts2LO.TokenURL == "" {
+ opts2LO.TokenURL = jwtTokenURL
+ }
+ return auth.New2LOTokenProvider(opts2LO)
+}
+
+func handleUserCredential(f *credsfile.UserCredentialsFile, opts *DetectOptions) (auth.TokenProvider, error) {
+ opts3LO := &auth.Options3LO{
+ ClientID: f.ClientID,
+ ClientSecret: f.ClientSecret,
+ Scopes: opts.scopes(),
+ AuthURL: googleAuthURL,
+ TokenURL: opts.tokenURL(),
+ AuthStyle: auth.StyleInParams,
+ EarlyTokenExpiry: opts.EarlyTokenRefresh,
+ RefreshToken: f.RefreshToken,
+ Client: opts.client(),
+ }
+ return auth.New3LOTokenProvider(opts3LO)
+}
+
+func handleExternalAccount(f *credsfile.ExternalAccountFile, opts *DetectOptions) (auth.TokenProvider, error) {
+ externalOpts := &externalaccount.Options{
+ Audience: f.Audience,
+ SubjectTokenType: f.SubjectTokenType,
+ TokenURL: f.TokenURL,
+ TokenInfoURL: f.TokenInfoURL,
+ ServiceAccountImpersonationURL: f.ServiceAccountImpersonationURL,
+ ClientSecret: f.ClientSecret,
+ ClientID: f.ClientID,
+ CredentialSource: f.CredentialSource,
+ QuotaProjectID: f.QuotaProjectID,
+ Scopes: opts.scopes(),
+ WorkforcePoolUserProject: f.WorkforcePoolUserProject,
+ Client: opts.client(),
+ IsDefaultClient: opts.Client == nil,
+ }
+ if f.ServiceAccountImpersonation != nil {
+ externalOpts.ServiceAccountImpersonationLifetimeSeconds = f.ServiceAccountImpersonation.TokenLifetimeSeconds
+ }
+ return externalaccount.NewTokenProvider(externalOpts)
+}
+
+func handleExternalAccountAuthorizedUser(f *credsfile.ExternalAccountAuthorizedUserFile, opts *DetectOptions) (auth.TokenProvider, error) {
+ externalOpts := &externalaccountuser.Options{
+ Audience: f.Audience,
+ RefreshToken: f.RefreshToken,
+ TokenURL: f.TokenURL,
+ TokenInfoURL: f.TokenInfoURL,
+ ClientID: f.ClientID,
+ ClientSecret: f.ClientSecret,
+ Scopes: opts.scopes(),
+ Client: opts.client(),
+ }
+ return externalaccountuser.NewTokenProvider(externalOpts)
+}
+
+func handleImpersonatedServiceAccount(f *credsfile.ImpersonatedServiceAccountFile, opts *DetectOptions) (auth.TokenProvider, error) {
+ if f.ServiceAccountImpersonationURL == "" || f.CredSource == nil {
+ return nil, errors.New("missing 'source_credentials' field or 'service_account_impersonation_url' in credentials")
+ }
+
+ tp, err := fileCredentials(f.CredSource, opts)
+ if err != nil {
+ return nil, err
+ }
+ return impersonate.NewTokenProvider(&impersonate.Options{
+ URL: f.ServiceAccountImpersonationURL,
+ Scopes: opts.scopes(),
+ Tp: tp,
+ Delegates: f.Delegates,
+ Client: opts.client(),
+ })
+}
+
+func handleGDCHServiceAccount(f *credsfile.GDCHServiceAccountFile, opts *DetectOptions) (auth.TokenProvider, error) {
+ return gdch.NewTokenProvider(f, &gdch.Options{
+ STSAudience: opts.STSAudience,
+ Client: opts.client(),
+ })
+}
diff --git a/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/aws_provider.go b/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/aws_provider.go
new file mode 100644
index 00000000..d8b5d4fd
--- /dev/null
+++ b/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/aws_provider.go
@@ -0,0 +1,520 @@
+// Copyright 2023 Google LLC
+//
+// 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 externalaccount
+
+import (
+ "bytes"
+ "context"
+ "crypto/hmac"
+ "crypto/sha256"
+ "encoding/hex"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "net/http"
+ "net/url"
+ "os"
+ "path"
+ "sort"
+ "strings"
+ "time"
+
+ "cloud.google.com/go/auth/internal"
+)
+
+var (
+ // getenv aliases os.Getenv for testing
+ getenv = os.Getenv
+)
+
+const (
+ // AWS Signature Version 4 signing algorithm identifier.
+ awsAlgorithm = "AWS4-HMAC-SHA256"
+
+ // The termination string for the AWS credential scope value as defined in
+ // https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html
+ awsRequestType = "aws4_request"
+
+ // The AWS authorization header name for the security session token if available.
+ awsSecurityTokenHeader = "x-amz-security-token"
+
+ // The name of the header containing the session token for metadata endpoint calls
+ awsIMDSv2SessionTokenHeader = "X-aws-ec2-metadata-token"
+
+ awsIMDSv2SessionTTLHeader = "X-aws-ec2-metadata-token-ttl-seconds"
+
+ awsIMDSv2SessionTTL = "300"
+
+ // The AWS authorization header name for the auto-generated date.
+ awsDateHeader = "x-amz-date"
+
+ defaultRegionalCredentialVerificationURL = "https://sts.{region}.amazonaws.com?Action=GetCallerIdentity&Version=2011-06-15"
+
+ // Supported AWS configuration environment variables.
+ awsAccessKeyIDEnvVar = "AWS_ACCESS_KEY_ID"
+ awsDefaultRegionEnvVar = "AWS_DEFAULT_REGION"
+ awsRegionEnvVar = "AWS_REGION"
+ awsSecretAccessKeyEnvVar = "AWS_SECRET_ACCESS_KEY"
+ awsSessionTokenEnvVar = "AWS_SESSION_TOKEN"
+
+ awsTimeFormatLong = "20060102T150405Z"
+ awsTimeFormatShort = "20060102"
+ awsProviderType = "aws"
+)
+
+type awsSubjectProvider struct {
+ EnvironmentID string
+ RegionURL string
+ RegionalCredVerificationURL string
+ CredVerificationURL string
+ IMDSv2SessionTokenURL string
+ TargetResource string
+ requestSigner *awsRequestSigner
+ region string
+ securityCredentialsProvider AwsSecurityCredentialsProvider
+ reqOpts *RequestOptions
+
+ Client *http.Client
+}
+
+func (sp *awsSubjectProvider) subjectToken(ctx context.Context) (string, error) {
+ // Set Defaults
+ if sp.RegionalCredVerificationURL == "" {
+ sp.RegionalCredVerificationURL = defaultRegionalCredentialVerificationURL
+ }
+ headers := make(map[string]string)
+ if sp.shouldUseMetadataServer() {
+ awsSessionToken, err := sp.getAWSSessionToken(ctx)
+ if err != nil {
+ return "", err
+ }
+
+ if awsSessionToken != "" {
+ headers[awsIMDSv2SessionTokenHeader] = awsSessionToken
+ }
+ }
+
+ awsSecurityCredentials, err := sp.getSecurityCredentials(ctx, headers)
+ if err != nil {
+ return "", err
+ }
+ if sp.region, err = sp.getRegion(ctx, headers); err != nil {
+ return "", err
+ }
+ sp.requestSigner = &awsRequestSigner{
+ RegionName: sp.region,
+ AwsSecurityCredentials: awsSecurityCredentials,
+ }
+
+ // Generate the signed request to AWS STS GetCallerIdentity API.
+ // Use the required regional endpoint. Otherwise, the request will fail.
+ req, err := http.NewRequestWithContext(ctx, "POST", strings.Replace(sp.RegionalCredVerificationURL, "{region}", sp.region, 1), nil)
+ if err != nil {
+ return "", err
+ }
+ // The full, canonical resource name of the workload identity pool
+ // provider, with or without the HTTPS prefix.
+ // Including this header as part of the signature is recommended to
+ // ensure data integrity.
+ if sp.TargetResource != "" {
+ req.Header.Set("x-goog-cloud-target-resource", sp.TargetResource)
+ }
+ sp.requestSigner.signRequest(req)
+
+ /*
+ The GCP STS endpoint expects the headers to be formatted as:
+ # [
+ # {key: 'x-amz-date', value: '...'},
+ # {key: 'Authorization', value: '...'},
+ # ...
+ # ]
+ # And then serialized as:
+ # quote(json.dumps({
+ # url: '...',
+ # method: 'POST',
+ # headers: [{key: 'x-amz-date', value: '...'}, ...]
+ # }))
+ */
+
+ awsSignedReq := awsRequest{
+ URL: req.URL.String(),
+ Method: "POST",
+ }
+ for headerKey, headerList := range req.Header {
+ for _, headerValue := range headerList {
+ awsSignedReq.Headers = append(awsSignedReq.Headers, awsRequestHeader{
+ Key: headerKey,
+ Value: headerValue,
+ })
+ }
+ }
+ sort.Slice(awsSignedReq.Headers, func(i, j int) bool {
+ headerCompare := strings.Compare(awsSignedReq.Headers[i].Key, awsSignedReq.Headers[j].Key)
+ if headerCompare == 0 {
+ return strings.Compare(awsSignedReq.Headers[i].Value, awsSignedReq.Headers[j].Value) < 0
+ }
+ return headerCompare < 0
+ })
+
+ result, err := json.Marshal(awsSignedReq)
+ if err != nil {
+ return "", err
+ }
+ return url.QueryEscape(string(result)), nil
+}
+
+func (sp *awsSubjectProvider) providerType() string {
+ if sp.securityCredentialsProvider != nil {
+ return programmaticProviderType
+ }
+ return awsProviderType
+}
+
+func (sp *awsSubjectProvider) getAWSSessionToken(ctx context.Context) (string, error) {
+ if sp.IMDSv2SessionTokenURL == "" {
+ return "", nil
+ }
+ req, err := http.NewRequestWithContext(ctx, "PUT", sp.IMDSv2SessionTokenURL, nil)
+ if err != nil {
+ return "", err
+ }
+ req.Header.Set(awsIMDSv2SessionTTLHeader, awsIMDSv2SessionTTL)
+
+ resp, body, err := internal.DoRequest(sp.Client, req)
+ if err != nil {
+ return "", err
+ }
+ if resp.StatusCode != http.StatusOK {
+ return "", fmt.Errorf("credentials: unable to retrieve AWS session token: %s", body)
+ }
+ return string(body), nil
+}
+
+func (sp *awsSubjectProvider) getRegion(ctx context.Context, headers map[string]string) (string, error) {
+ if sp.securityCredentialsProvider != nil {
+ return sp.securityCredentialsProvider.AwsRegion(ctx, sp.reqOpts)
+ }
+ if canRetrieveRegionFromEnvironment() {
+ if envAwsRegion := getenv(awsRegionEnvVar); envAwsRegion != "" {
+ return envAwsRegion, nil
+ }
+ return getenv(awsDefaultRegionEnvVar), nil
+ }
+
+ if sp.RegionURL == "" {
+ return "", errors.New("credentials: unable to determine AWS region")
+ }
+
+ req, err := http.NewRequestWithContext(ctx, "GET", sp.RegionURL, nil)
+ if err != nil {
+ return "", err
+ }
+
+ for name, value := range headers {
+ req.Header.Add(name, value)
+ }
+ resp, body, err := internal.DoRequest(sp.Client, req)
+ if err != nil {
+ return "", err
+ }
+ if resp.StatusCode != http.StatusOK {
+ return "", fmt.Errorf("credentials: unable to retrieve AWS region - %s", body)
+ }
+
+ // This endpoint will return the region in format: us-east-2b.
+ // Only the us-east-2 part should be used.
+ bodyLen := len(body)
+ if bodyLen == 0 {
+ return "", nil
+ }
+ return string(body[:bodyLen-1]), nil
+}
+
+func (sp *awsSubjectProvider) getSecurityCredentials(ctx context.Context, headers map[string]string) (result *AwsSecurityCredentials, err error) {
+ if sp.securityCredentialsProvider != nil {
+ return sp.securityCredentialsProvider.AwsSecurityCredentials(ctx, sp.reqOpts)
+ }
+ if canRetrieveSecurityCredentialFromEnvironment() {
+ return &AwsSecurityCredentials{
+ AccessKeyID: getenv(awsAccessKeyIDEnvVar),
+ SecretAccessKey: getenv(awsSecretAccessKeyEnvVar),
+ SessionToken: getenv(awsSessionTokenEnvVar),
+ }, nil
+ }
+
+ roleName, err := sp.getMetadataRoleName(ctx, headers)
+ if err != nil {
+ return
+ }
+ credentials, err := sp.getMetadataSecurityCredentials(ctx, roleName, headers)
+ if err != nil {
+ return
+ }
+
+ if credentials.AccessKeyID == "" {
+ return result, errors.New("credentials: missing AccessKeyId credential")
+ }
+ if credentials.SecretAccessKey == "" {
+ return result, errors.New("credentials: missing SecretAccessKey credential")
+ }
+
+ return credentials, nil
+}
+
+func (sp *awsSubjectProvider) getMetadataSecurityCredentials(ctx context.Context, roleName string, headers map[string]string) (*AwsSecurityCredentials, error) {
+ var result *AwsSecurityCredentials
+
+ req, err := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("%s/%s", sp.CredVerificationURL, roleName), nil)
+ if err != nil {
+ return result, err
+ }
+ for name, value := range headers {
+ req.Header.Add(name, value)
+ }
+ resp, body, err := internal.DoRequest(sp.Client, req)
+ if err != nil {
+ return result, err
+ }
+ if resp.StatusCode != http.StatusOK {
+ return result, fmt.Errorf("credentials: unable to retrieve AWS security credentials - %s", body)
+ }
+ if err := json.Unmarshal(body, &result); err != nil {
+ return nil, err
+ }
+ return result, nil
+}
+
+func (sp *awsSubjectProvider) getMetadataRoleName(ctx context.Context, headers map[string]string) (string, error) {
+ if sp.CredVerificationURL == "" {
+ return "", errors.New("credentials: unable to determine the AWS metadata server security credentials endpoint")
+ }
+ req, err := http.NewRequestWithContext(ctx, "GET", sp.CredVerificationURL, nil)
+ if err != nil {
+ return "", err
+ }
+ for name, value := range headers {
+ req.Header.Add(name, value)
+ }
+
+ resp, body, err := internal.DoRequest(sp.Client, req)
+ if err != nil {
+ return "", err
+ }
+ if resp.StatusCode != http.StatusOK {
+ return "", fmt.Errorf("credentials: unable to retrieve AWS role name - %s", body)
+ }
+ return string(body), nil
+}
+
+// awsRequestSigner is a utility class to sign http requests using a AWS V4 signature.
+type awsRequestSigner struct {
+ RegionName string
+ AwsSecurityCredentials *AwsSecurityCredentials
+}
+
+// signRequest adds the appropriate headers to an http.Request
+// or returns an error if something prevented this.
+func (rs *awsRequestSigner) signRequest(req *http.Request) error {
+ // req is assumed non-nil
+ signedRequest := cloneRequest(req)
+ timestamp := Now()
+ signedRequest.Header.Set("host", requestHost(req))
+ if rs.AwsSecurityCredentials.SessionToken != "" {
+ signedRequest.Header.Set(awsSecurityTokenHeader, rs.AwsSecurityCredentials.SessionToken)
+ }
+ if signedRequest.Header.Get("date") == "" {
+ signedRequest.Header.Set(awsDateHeader, timestamp.Format(awsTimeFormatLong))
+ }
+ authorizationCode, err := rs.generateAuthentication(signedRequest, timestamp)
+ if err != nil {
+ return err
+ }
+ signedRequest.Header.Set("Authorization", authorizationCode)
+ req.Header = signedRequest.Header
+ return nil
+}
+
+func (rs *awsRequestSigner) generateAuthentication(req *http.Request, timestamp time.Time) (string, error) {
+ canonicalHeaderColumns, canonicalHeaderData := canonicalHeaders(req)
+ dateStamp := timestamp.Format(awsTimeFormatShort)
+ serviceName := ""
+
+ if splitHost := strings.Split(requestHost(req), "."); len(splitHost) > 0 {
+ serviceName = splitHost[0]
+ }
+ credentialScope := strings.Join([]string{dateStamp, rs.RegionName, serviceName, awsRequestType}, "/")
+ requestString, err := canonicalRequest(req, canonicalHeaderColumns, canonicalHeaderData)
+ if err != nil {
+ return "", err
+ }
+ requestHash, err := getSha256([]byte(requestString))
+ if err != nil {
+ return "", err
+ }
+
+ stringToSign := strings.Join([]string{awsAlgorithm, timestamp.Format(awsTimeFormatLong), credentialScope, requestHash}, "\n")
+ signingKey := []byte("AWS4" + rs.AwsSecurityCredentials.SecretAccessKey)
+ for _, signingInput := range []string{
+ dateStamp, rs.RegionName, serviceName, awsRequestType, stringToSign,
+ } {
+ signingKey, err = getHmacSha256(signingKey, []byte(signingInput))
+ if err != nil {
+ return "", err
+ }
+ }
+
+ return fmt.Sprintf("%s Credential=%s/%s, SignedHeaders=%s, Signature=%s", awsAlgorithm, rs.AwsSecurityCredentials.AccessKeyID, credentialScope, canonicalHeaderColumns, hex.EncodeToString(signingKey)), nil
+}
+
+func getSha256(input []byte) (string, error) {
+ hash := sha256.New()
+ if _, err := hash.Write(input); err != nil {
+ return "", err
+ }
+ return hex.EncodeToString(hash.Sum(nil)), nil
+}
+
+func getHmacSha256(key, input []byte) ([]byte, error) {
+ hash := hmac.New(sha256.New, key)
+ if _, err := hash.Write(input); err != nil {
+ return nil, err
+ }
+ return hash.Sum(nil), nil
+}
+
+func cloneRequest(r *http.Request) *http.Request {
+ r2 := new(http.Request)
+ *r2 = *r
+ if r.Header != nil {
+ r2.Header = make(http.Header, len(r.Header))
+
+ // Find total number of values.
+ headerCount := 0
+ for _, headerValues := range r.Header {
+ headerCount += len(headerValues)
+ }
+ copiedHeaders := make([]string, headerCount) // shared backing array for headers' values
+
+ for headerKey, headerValues := range r.Header {
+ headerCount = copy(copiedHeaders, headerValues)
+ r2.Header[headerKey] = copiedHeaders[:headerCount:headerCount]
+ copiedHeaders = copiedHeaders[headerCount:]
+ }
+ }
+ return r2
+}
+
+func canonicalPath(req *http.Request) string {
+ result := req.URL.EscapedPath()
+ if result == "" {
+ return "/"
+ }
+ return path.Clean(result)
+}
+
+func canonicalQuery(req *http.Request) string {
+ queryValues := req.URL.Query()
+ for queryKey := range queryValues {
+ sort.Strings(queryValues[queryKey])
+ }
+ return queryValues.Encode()
+}
+
+func canonicalHeaders(req *http.Request) (string, string) {
+ // Header keys need to be sorted alphabetically.
+ var headers []string
+ lowerCaseHeaders := make(http.Header)
+ for k, v := range req.Header {
+ k := strings.ToLower(k)
+ if _, ok := lowerCaseHeaders[k]; ok {
+ // include additional values
+ lowerCaseHeaders[k] = append(lowerCaseHeaders[k], v...)
+ } else {
+ headers = append(headers, k)
+ lowerCaseHeaders[k] = v
+ }
+ }
+ sort.Strings(headers)
+
+ var fullHeaders bytes.Buffer
+ for _, header := range headers {
+ headerValue := strings.Join(lowerCaseHeaders[header], ",")
+ fullHeaders.WriteString(header)
+ fullHeaders.WriteRune(':')
+ fullHeaders.WriteString(headerValue)
+ fullHeaders.WriteRune('\n')
+ }
+
+ return strings.Join(headers, ";"), fullHeaders.String()
+}
+
+func requestDataHash(req *http.Request) (string, error) {
+ var requestData []byte
+ if req.Body != nil {
+ requestBody, err := req.GetBody()
+ if err != nil {
+ return "", err
+ }
+ defer requestBody.Close()
+
+ requestData, err = internal.ReadAll(requestBody)
+ if err != nil {
+ return "", err
+ }
+ }
+
+ return getSha256(requestData)
+}
+
+func requestHost(req *http.Request) string {
+ if req.Host != "" {
+ return req.Host
+ }
+ return req.URL.Host
+}
+
+func canonicalRequest(req *http.Request, canonicalHeaderColumns, canonicalHeaderData string) (string, error) {
+ dataHash, err := requestDataHash(req)
+ if err != nil {
+ return "", err
+ }
+ return fmt.Sprintf("%s\n%s\n%s\n%s\n%s\n%s", req.Method, canonicalPath(req), canonicalQuery(req), canonicalHeaderData, canonicalHeaderColumns, dataHash), nil
+}
+
+type awsRequestHeader struct {
+ Key string `json:"key"`
+ Value string `json:"value"`
+}
+
+type awsRequest struct {
+ URL string `json:"url"`
+ Method string `json:"method"`
+ Headers []awsRequestHeader `json:"headers"`
+}
+
+// The AWS region can be provided through AWS_REGION or AWS_DEFAULT_REGION. Only one is
+// required.
+func canRetrieveRegionFromEnvironment() bool {
+ return getenv(awsRegionEnvVar) != "" || getenv(awsDefaultRegionEnvVar) != ""
+}
+
+// Check if both AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are available.
+func canRetrieveSecurityCredentialFromEnvironment() bool {
+ return getenv(awsAccessKeyIDEnvVar) != "" && getenv(awsSecretAccessKeyEnvVar) != ""
+}
+
+func (sp *awsSubjectProvider) shouldUseMetadataServer() bool {
+ return sp.securityCredentialsProvider == nil && (!canRetrieveRegionFromEnvironment() || !canRetrieveSecurityCredentialFromEnvironment())
+}
diff --git a/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/executable_provider.go b/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/executable_provider.go
new file mode 100644
index 00000000..d5765c47
--- /dev/null
+++ b/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/executable_provider.go
@@ -0,0 +1,284 @@
+// Copyright 2023 Google LLC
+//
+// 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 externalaccount
+
+import (
+ "bytes"
+ "context"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "net/http"
+ "os"
+ "os/exec"
+ "regexp"
+ "strings"
+ "time"
+
+ "cloud.google.com/go/auth/internal"
+)
+
+const (
+ executableSupportedMaxVersion = 1
+ executableDefaultTimeout = 30 * time.Second
+ executableSource = "response"
+ executableProviderType = "executable"
+ outputFileSource = "output file"
+
+ allowExecutablesEnvVar = "GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES"
+
+ jwtTokenType = "urn:ietf:params:oauth:token-type:jwt"
+ idTokenType = "urn:ietf:params:oauth:token-type:id_token"
+ saml2TokenType = "urn:ietf:params:oauth:token-type:saml2"
+)
+
+var (
+ serviceAccountImpersonationRE = regexp.MustCompile(`https://iamcredentials..+/v1/projects/-/serviceAccounts/(.*@.*):generateAccessToken`)
+)
+
+type nonCacheableError struct {
+ message string
+}
+
+func (nce nonCacheableError) Error() string {
+ return nce.message
+}
+
+// environment is a contract for testing
+type environment interface {
+ existingEnv() []string
+ getenv(string) string
+ run(ctx context.Context, command string, env []string) ([]byte, error)
+ now() time.Time
+}
+
+type runtimeEnvironment struct{}
+
+func (r runtimeEnvironment) existingEnv() []string {
+ return os.Environ()
+}
+func (r runtimeEnvironment) getenv(key string) string {
+ return os.Getenv(key)
+}
+func (r runtimeEnvironment) now() time.Time {
+ return time.Now().UTC()
+}
+
+func (r runtimeEnvironment) run(ctx context.Context, command string, env []string) ([]byte, error) {
+ splitCommand := strings.Fields(command)
+ cmd := exec.CommandContext(ctx, splitCommand[0], splitCommand[1:]...)
+ cmd.Env = env
+
+ var stdout, stderr bytes.Buffer
+ cmd.Stdout = &stdout
+ cmd.Stderr = &stderr
+
+ if err := cmd.Run(); err != nil {
+ if ctx.Err() == context.DeadlineExceeded {
+ return nil, context.DeadlineExceeded
+ }
+ if exitError, ok := err.(*exec.ExitError); ok {
+ return nil, exitCodeError(exitError)
+ }
+ return nil, executableError(err)
+ }
+
+ bytesStdout := bytes.TrimSpace(stdout.Bytes())
+ if len(bytesStdout) > 0 {
+ return bytesStdout, nil
+ }
+ return bytes.TrimSpace(stderr.Bytes()), nil
+}
+
+type executableSubjectProvider struct {
+ Command string
+ Timeout time.Duration
+ OutputFile string
+ client *http.Client
+ opts *Options
+ env environment
+}
+
+type executableResponse struct {
+ Version int `json:"version,omitempty"`
+ Success *bool `json:"success,omitempty"`
+ TokenType string `json:"token_type,omitempty"`
+ ExpirationTime int64 `json:"expiration_time,omitempty"`
+ IDToken string `json:"id_token,omitempty"`
+ SamlResponse string `json:"saml_response,omitempty"`
+ Code string `json:"code,omitempty"`
+ Message string `json:"message,omitempty"`
+}
+
+func (sp *executableSubjectProvider) parseSubjectTokenFromSource(response []byte, source string, now int64) (string, error) {
+ var result executableResponse
+ if err := json.Unmarshal(response, &result); err != nil {
+ return "", jsonParsingError(source, string(response))
+ }
+ // Validate
+ if result.Version == 0 {
+ return "", missingFieldError(source, "version")
+ }
+ if result.Success == nil {
+ return "", missingFieldError(source, "success")
+ }
+ if !*result.Success {
+ if result.Code == "" || result.Message == "" {
+ return "", malformedFailureError()
+ }
+ return "", userDefinedError(result.Code, result.Message)
+ }
+ if result.Version > executableSupportedMaxVersion || result.Version < 0 {
+ return "", unsupportedVersionError(source, result.Version)
+ }
+ if result.ExpirationTime == 0 && sp.OutputFile != "" {
+ return "", missingFieldError(source, "expiration_time")
+ }
+ if result.TokenType == "" {
+ return "", missingFieldError(source, "token_type")
+ }
+ if result.ExpirationTime != 0 && result.ExpirationTime < now {
+ return "", tokenExpiredError()
+ }
+
+ switch result.TokenType {
+ case jwtTokenType, idTokenType:
+ if result.IDToken == "" {
+ return "", missingFieldError(source, "id_token")
+ }
+ return result.IDToken, nil
+ case saml2TokenType:
+ if result.SamlResponse == "" {
+ return "", missingFieldError(source, "saml_response")
+ }
+ return result.SamlResponse, nil
+ default:
+ return "", tokenTypeError(source)
+ }
+}
+
+func (sp *executableSubjectProvider) subjectToken(ctx context.Context) (string, error) {
+ if token, err := sp.getTokenFromOutputFile(); token != "" || err != nil {
+ return token, err
+ }
+ return sp.getTokenFromExecutableCommand(ctx)
+}
+
+func (sp *executableSubjectProvider) providerType() string {
+ return executableProviderType
+}
+
+func (sp *executableSubjectProvider) getTokenFromOutputFile() (token string, err error) {
+ if sp.OutputFile == "" {
+ // This ExecutableCredentialSource doesn't use an OutputFile.
+ return "", nil
+ }
+
+ file, err := os.Open(sp.OutputFile)
+ if err != nil {
+ // No OutputFile found. Hasn't been created yet, so skip it.
+ return "", nil
+ }
+ defer file.Close()
+
+ data, err := internal.ReadAll(file)
+ if err != nil || len(data) == 0 {
+ // Cachefile exists, but no data found. Get new credential.
+ return "", nil
+ }
+
+ token, err = sp.parseSubjectTokenFromSource(data, outputFileSource, sp.env.now().Unix())
+ if err != nil {
+ if _, ok := err.(nonCacheableError); ok {
+ // If the cached token is expired we need a new token,
+ // and if the cache contains a failure, we need to try again.
+ return "", nil
+ }
+
+ // There was an error in the cached token, and the developer should be aware of it.
+ return "", err
+ }
+ // Token parsing succeeded. Use found token.
+ return token, nil
+}
+
+func (sp *executableSubjectProvider) executableEnvironment() []string {
+ result := sp.env.existingEnv()
+ result = append(result, fmt.Sprintf("GOOGLE_EXTERNAL_ACCOUNT_AUDIENCE=%v", sp.opts.Audience))
+ result = append(result, fmt.Sprintf("GOOGLE_EXTERNAL_ACCOUNT_TOKEN_TYPE=%v", sp.opts.SubjectTokenType))
+ result = append(result, "GOOGLE_EXTERNAL_ACCOUNT_INTERACTIVE=0")
+ if sp.opts.ServiceAccountImpersonationURL != "" {
+ matches := serviceAccountImpersonationRE.FindStringSubmatch(sp.opts.ServiceAccountImpersonationURL)
+ if matches != nil {
+ result = append(result, fmt.Sprintf("GOOGLE_EXTERNAL_ACCOUNT_IMPERSONATED_EMAIL=%v", matches[1]))
+ }
+ }
+ if sp.OutputFile != "" {
+ result = append(result, fmt.Sprintf("GOOGLE_EXTERNAL_ACCOUNT_OUTPUT_FILE=%v", sp.OutputFile))
+ }
+ return result
+}
+
+func (sp *executableSubjectProvider) getTokenFromExecutableCommand(ctx context.Context) (string, error) {
+ // For security reasons, we need our consumers to set this environment variable to allow executables to be run.
+ if sp.env.getenv(allowExecutablesEnvVar) != "1" {
+ return "", errors.New("credentials: executables need to be explicitly allowed (set GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES to '1') to run")
+ }
+
+ ctx, cancel := context.WithDeadline(ctx, sp.env.now().Add(sp.Timeout))
+ defer cancel()
+
+ output, err := sp.env.run(ctx, sp.Command, sp.executableEnvironment())
+ if err != nil {
+ return "", err
+ }
+ return sp.parseSubjectTokenFromSource(output, executableSource, sp.env.now().Unix())
+}
+
+func missingFieldError(source, field string) error {
+ return fmt.Errorf("credentials: %q missing %q field", source, field)
+}
+
+func jsonParsingError(source, data string) error {
+ return fmt.Errorf("credentials: unable to parse %q: %v", source, data)
+}
+
+func malformedFailureError() error {
+ return nonCacheableError{"credentials: response must include `error` and `message` fields when unsuccessful"}
+}
+
+func userDefinedError(code, message string) error {
+ return nonCacheableError{fmt.Sprintf("credentials: response contains unsuccessful response: (%v) %v", code, message)}
+}
+
+func unsupportedVersionError(source string, version int) error {
+ return fmt.Errorf("credentials: %v contains unsupported version: %v", source, version)
+}
+
+func tokenExpiredError() error {
+ return nonCacheableError{"credentials: the token returned by the executable is expired"}
+}
+
+func tokenTypeError(source string) error {
+ return fmt.Errorf("credentials: %v contains unsupported token type", source)
+}
+
+func exitCodeError(err *exec.ExitError) error {
+ return fmt.Errorf("credentials: executable command failed with exit code %v: %w", err.ExitCode(), err)
+}
+
+func executableError(err error) error {
+ return fmt.Errorf("credentials: executable command failed: %w", err)
+}
diff --git a/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/externalaccount.go b/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/externalaccount.go
new file mode 100644
index 00000000..112186a9
--- /dev/null
+++ b/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/externalaccount.go
@@ -0,0 +1,407 @@
+// Copyright 2023 Google LLC
+//
+// 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 externalaccount
+
+import (
+ "context"
+ "errors"
+ "fmt"
+ "net/http"
+ "regexp"
+ "strconv"
+ "strings"
+ "time"
+
+ "cloud.google.com/go/auth"
+ "cloud.google.com/go/auth/credentials/internal/impersonate"
+ "cloud.google.com/go/auth/credentials/internal/stsexchange"
+ "cloud.google.com/go/auth/internal/credsfile"
+)
+
+const (
+ timeoutMinimum = 5 * time.Second
+ timeoutMaximum = 120 * time.Second
+
+ universeDomainPlaceholder = "UNIVERSE_DOMAIN"
+ defaultTokenURL = "https://sts.UNIVERSE_DOMAIN/v1/token"
+ defaultUniverseDomain = "googleapis.com"
+)
+
+var (
+ // Now aliases time.Now for testing
+ Now = func() time.Time {
+ return time.Now().UTC()
+ }
+ validWorkforceAudiencePattern *regexp.Regexp = regexp.MustCompile(`//iam\.googleapis\.com/locations/[^/]+/workforcePools/`)
+)
+
+// Options stores the configuration for fetching tokens with external credentials.
+type Options struct {
+ // Audience is the Secure Token Service (STS) audience which contains the resource name for the workload
+ // identity pool or the workforce pool and the provider identifier in that pool.
+ Audience string
+ // SubjectTokenType is the STS token type based on the Oauth2.0 token exchange spec
+ // e.g. `urn:ietf:params:oauth:token-type:jwt`.
+ SubjectTokenType string
+ // TokenURL is the STS token exchange endpoint.
+ TokenURL string
+ // TokenInfoURL is the token_info endpoint used to retrieve the account related information (
+ // user attributes like account identifier, eg. email, username, uid, etc). This is
+ // needed for gCloud session account identification.
+ TokenInfoURL string
+ // ServiceAccountImpersonationURL is the URL for the service account impersonation request. This is only
+ // required for workload identity pools when APIs to be accessed have not integrated with UberMint.
+ ServiceAccountImpersonationURL string
+ // ServiceAccountImpersonationLifetimeSeconds is the number of seconds the service account impersonation
+ // token will be valid for.
+ ServiceAccountImpersonationLifetimeSeconds int
+ // ClientSecret is currently only required if token_info endpoint also
+ // needs to be called with the generated GCP access token. When provided, STS will be
+ // called with additional basic authentication using client_id as username and client_secret as password.
+ ClientSecret string
+ // ClientID is only required in conjunction with ClientSecret, as described above.
+ ClientID string
+ // CredentialSource contains the necessary information to retrieve the token itself, as well
+ // as some environmental information.
+ CredentialSource *credsfile.CredentialSource
+ // QuotaProjectID is injected by gCloud. If the value is non-empty, the Auth libraries
+ // will set the x-goog-user-project which overrides the project associated with the credentials.
+ QuotaProjectID string
+ // Scopes contains the desired scopes for the returned access token.
+ Scopes []string
+ // WorkforcePoolUserProject should be set when it is a workforce pool and
+ // not a workload identity pool. The underlying principal must still have
+ // serviceusage.services.use IAM permission to use the project for
+ // billing/quota. Optional.
+ WorkforcePoolUserProject string
+ // UniverseDomain is the default service domain for a given Cloud universe.
+ // This value will be used in the default STS token URL. The default value
+ // is "googleapis.com". It will not be used if TokenURL is set. Optional.
+ UniverseDomain string
+ // SubjectTokenProvider is an optional token provider for OIDC/SAML
+ // credentials. One of SubjectTokenProvider, AWSSecurityCredentialProvider
+ // or CredentialSource must be provided. Optional.
+ SubjectTokenProvider SubjectTokenProvider
+ // AwsSecurityCredentialsProvider is an AWS Security Credential provider
+ // for AWS credentials. One of SubjectTokenProvider,
+ // AWSSecurityCredentialProvider or CredentialSource must be provided. Optional.
+ AwsSecurityCredentialsProvider AwsSecurityCredentialsProvider
+ // Client for token request.
+ Client *http.Client
+ // IsDefaultClient marks whether the client passed in is a default client that can be overriden.
+ // This is important for X509 credentials which should create a new client if the default was used
+ // but should respect a client explicitly passed in by the user.
+ IsDefaultClient bool
+}
+
+// SubjectTokenProvider can be used to supply a subject token to exchange for a
+// GCP access token.
+type SubjectTokenProvider interface {
+ // SubjectToken should return a valid subject token or an error.
+ // The external account token provider does not cache the returned subject
+ // token, so caching logic should be implemented in the provider to prevent
+ // multiple requests for the same subject token.
+ SubjectToken(ctx context.Context, opts *RequestOptions) (string, error)
+}
+
+// RequestOptions contains information about the requested subject token or AWS
+// security credentials from the Google external account credential.
+type RequestOptions struct {
+ // Audience is the requested audience for the external account credential.
+ Audience string
+ // Subject token type is the requested subject token type for the external
+ // account credential. Expected values include:
+ // “urn:ietf:params:oauth:token-type:jwt”
+ // “urn:ietf:params:oauth:token-type:id-token”
+ // “urn:ietf:params:oauth:token-type:saml2”
+ // “urn:ietf:params:aws:token-type:aws4_request”
+ SubjectTokenType string
+}
+
+// AwsSecurityCredentialsProvider can be used to supply AwsSecurityCredentials
+// and an AWS Region to exchange for a GCP access token.
+type AwsSecurityCredentialsProvider interface {
+ // AwsRegion should return the AWS region or an error.
+ AwsRegion(ctx context.Context, opts *RequestOptions) (string, error)
+ // GetAwsSecurityCredentials should return a valid set of
+ // AwsSecurityCredentials or an error. The external account token provider
+ // does not cache the returned security credentials, so caching logic should
+ // be implemented in the provider to prevent multiple requests for the
+ // same security credentials.
+ AwsSecurityCredentials(ctx context.Context, opts *RequestOptions) (*AwsSecurityCredentials, error)
+}
+
+// AwsSecurityCredentials models AWS security credentials.
+type AwsSecurityCredentials struct {
+ // AccessKeyId is the AWS Access Key ID - Required.
+ AccessKeyID string `json:"AccessKeyID"`
+ // SecretAccessKey is the AWS Secret Access Key - Required.
+ SecretAccessKey string `json:"SecretAccessKey"`
+ // SessionToken is the AWS Session token. This should be provided for
+ // temporary AWS security credentials - Optional.
+ SessionToken string `json:"Token"`
+}
+
+func (o *Options) validate() error {
+ if o.Audience == "" {
+ return fmt.Errorf("externalaccount: Audience must be set")
+ }
+ if o.SubjectTokenType == "" {
+ return fmt.Errorf("externalaccount: Subject token type must be set")
+ }
+ if o.WorkforcePoolUserProject != "" {
+ if valid := validWorkforceAudiencePattern.MatchString(o.Audience); !valid {
+ return fmt.Errorf("externalaccount: workforce_pool_user_project should not be set for non-workforce pool credentials")
+ }
+ }
+ count := 0
+ if o.CredentialSource != nil {
+ count++
+ }
+ if o.SubjectTokenProvider != nil {
+ count++
+ }
+ if o.AwsSecurityCredentialsProvider != nil {
+ count++
+ }
+ if count == 0 {
+ return fmt.Errorf("externalaccount: one of CredentialSource, SubjectTokenProvider, or AwsSecurityCredentialsProvider must be set")
+ }
+ if count > 1 {
+ return fmt.Errorf("externalaccount: only one of CredentialSource, SubjectTokenProvider, or AwsSecurityCredentialsProvider must be set")
+ }
+ return nil
+}
+
+// client returns the http client that should be used for the token exchange. If a non-default client
+// is provided, then the client configured in the options will always be returned. If a default client
+// is provided and the options are configured for X509 credentials, a new client will be created.
+func (o *Options) client() (*http.Client, error) {
+ // If a client was provided and no override certificate config location was provided, use the provided client.
+ if o.CredentialSource == nil || o.CredentialSource.Certificate == nil || (!o.IsDefaultClient && o.CredentialSource.Certificate.CertificateConfigLocation == "") {
+ return o.Client, nil
+ }
+
+ // If a new client should be created, validate and use the certificate source to create a new mTLS client.
+ cert := o.CredentialSource.Certificate
+ if !cert.UseDefaultCertificateConfig && cert.CertificateConfigLocation == "" {
+ return nil, errors.New("credentials: \"certificate\" object must either specify a certificate_config_location or use_default_certificate_config should be true")
+ }
+ if cert.UseDefaultCertificateConfig && cert.CertificateConfigLocation != "" {
+ return nil, errors.New("credentials: \"certificate\" object cannot specify both a certificate_config_location and use_default_certificate_config=true")
+ }
+ return createX509Client(cert.CertificateConfigLocation)
+}
+
+// resolveTokenURL sets the default STS token endpoint with the configured
+// universe domain.
+func (o *Options) resolveTokenURL() {
+ if o.TokenURL != "" {
+ return
+ } else if o.UniverseDomain != "" {
+ o.TokenURL = strings.Replace(defaultTokenURL, universeDomainPlaceholder, o.UniverseDomain, 1)
+ } else {
+ o.TokenURL = strings.Replace(defaultTokenURL, universeDomainPlaceholder, defaultUniverseDomain, 1)
+ }
+}
+
+// NewTokenProvider returns a [cloud.google.com/go/auth.TokenProvider]
+// configured with the provided options.
+func NewTokenProvider(opts *Options) (auth.TokenProvider, error) {
+ if err := opts.validate(); err != nil {
+ return nil, err
+ }
+ opts.resolveTokenURL()
+ stp, err := newSubjectTokenProvider(opts)
+ if err != nil {
+ return nil, err
+ }
+
+ client, err := opts.client()
+ if err != nil {
+ return nil, err
+ }
+
+ tp := &tokenProvider{
+ client: client,
+ opts: opts,
+ stp: stp,
+ }
+
+ if opts.ServiceAccountImpersonationURL == "" {
+ return auth.NewCachedTokenProvider(tp, nil), nil
+ }
+
+ scopes := make([]string, len(opts.Scopes))
+ copy(scopes, opts.Scopes)
+ // needed for impersonation
+ tp.opts.Scopes = []string{"https://www.googleapis.com/auth/cloud-platform"}
+ imp, err := impersonate.NewTokenProvider(&impersonate.Options{
+ Client: client,
+ URL: opts.ServiceAccountImpersonationURL,
+ Scopes: scopes,
+ Tp: auth.NewCachedTokenProvider(tp, nil),
+ TokenLifetimeSeconds: opts.ServiceAccountImpersonationLifetimeSeconds,
+ })
+ if err != nil {
+ return nil, err
+ }
+ return auth.NewCachedTokenProvider(imp, nil), nil
+}
+
+type subjectTokenProvider interface {
+ subjectToken(ctx context.Context) (string, error)
+ providerType() string
+}
+
+// tokenProvider is the provider that handles external credentials. It is used to retrieve Tokens.
+type tokenProvider struct {
+ client *http.Client
+ opts *Options
+ stp subjectTokenProvider
+}
+
+func (tp *tokenProvider) Token(ctx context.Context) (*auth.Token, error) {
+ subjectToken, err := tp.stp.subjectToken(ctx)
+ if err != nil {
+ return nil, err
+ }
+
+ stsRequest := &stsexchange.TokenRequest{
+ GrantType: stsexchange.GrantType,
+ Audience: tp.opts.Audience,
+ Scope: tp.opts.Scopes,
+ RequestedTokenType: stsexchange.TokenType,
+ SubjectToken: subjectToken,
+ SubjectTokenType: tp.opts.SubjectTokenType,
+ }
+ header := make(http.Header)
+ header.Set("Content-Type", "application/x-www-form-urlencoded")
+ header.Add("x-goog-api-client", getGoogHeaderValue(tp.opts, tp.stp))
+ clientAuth := stsexchange.ClientAuthentication{
+ AuthStyle: auth.StyleInHeader,
+ ClientID: tp.opts.ClientID,
+ ClientSecret: tp.opts.ClientSecret,
+ }
+ var options map[string]interface{}
+ // Do not pass workforce_pool_user_project when client authentication is used.
+ // The client ID is sufficient for determining the user project.
+ if tp.opts.WorkforcePoolUserProject != "" && tp.opts.ClientID == "" {
+ options = map[string]interface{}{
+ "userProject": tp.opts.WorkforcePoolUserProject,
+ }
+ }
+ stsResp, err := stsexchange.ExchangeToken(ctx, &stsexchange.Options{
+ Client: tp.client,
+ Endpoint: tp.opts.TokenURL,
+ Request: stsRequest,
+ Authentication: clientAuth,
+ Headers: header,
+ ExtraOpts: options,
+ })
+ if err != nil {
+ return nil, err
+ }
+
+ tok := &auth.Token{
+ Value: stsResp.AccessToken,
+ Type: stsResp.TokenType,
+ }
+ // The RFC8693 doesn't define the explicit 0 of "expires_in" field behavior.
+ if stsResp.ExpiresIn <= 0 {
+ return nil, fmt.Errorf("credentials: got invalid expiry from security token service")
+ }
+ tok.Expiry = Now().Add(time.Duration(stsResp.ExpiresIn) * time.Second)
+ return tok, nil
+}
+
+// newSubjectTokenProvider determines the type of credsfile.CredentialSource needed to create a
+// subjectTokenProvider
+func newSubjectTokenProvider(o *Options) (subjectTokenProvider, error) {
+ reqOpts := &RequestOptions{Audience: o.Audience, SubjectTokenType: o.SubjectTokenType}
+ if o.AwsSecurityCredentialsProvider != nil {
+ return &awsSubjectProvider{
+ securityCredentialsProvider: o.AwsSecurityCredentialsProvider,
+ TargetResource: o.Audience,
+ reqOpts: reqOpts,
+ }, nil
+ } else if o.SubjectTokenProvider != nil {
+ return &programmaticProvider{stp: o.SubjectTokenProvider, opts: reqOpts}, nil
+ } else if len(o.CredentialSource.EnvironmentID) > 3 && o.CredentialSource.EnvironmentID[:3] == "aws" {
+ if awsVersion, err := strconv.Atoi(o.CredentialSource.EnvironmentID[3:]); err == nil {
+ if awsVersion != 1 {
+ return nil, fmt.Errorf("credentials: aws version '%d' is not supported in the current build", awsVersion)
+ }
+
+ awsProvider := &awsSubjectProvider{
+ EnvironmentID: o.CredentialSource.EnvironmentID,
+ RegionURL: o.CredentialSource.RegionURL,
+ RegionalCredVerificationURL: o.CredentialSource.RegionalCredVerificationURL,
+ CredVerificationURL: o.CredentialSource.URL,
+ TargetResource: o.Audience,
+ Client: o.Client,
+ }
+ if o.CredentialSource.IMDSv2SessionTokenURL != "" {
+ awsProvider.IMDSv2SessionTokenURL = o.CredentialSource.IMDSv2SessionTokenURL
+ }
+
+ return awsProvider, nil
+ }
+ } else if o.CredentialSource.File != "" {
+ return &fileSubjectProvider{File: o.CredentialSource.File, Format: o.CredentialSource.Format}, nil
+ } else if o.CredentialSource.URL != "" {
+ return &urlSubjectProvider{URL: o.CredentialSource.URL, Headers: o.CredentialSource.Headers, Format: o.CredentialSource.Format, Client: o.Client}, nil
+ } else if o.CredentialSource.Executable != nil {
+ ec := o.CredentialSource.Executable
+ if ec.Command == "" {
+ return nil, errors.New("credentials: missing `command` field — executable command must be provided")
+ }
+
+ execProvider := &executableSubjectProvider{}
+ execProvider.Command = ec.Command
+ if ec.TimeoutMillis == 0 {
+ execProvider.Timeout = executableDefaultTimeout
+ } else {
+ execProvider.Timeout = time.Duration(ec.TimeoutMillis) * time.Millisecond
+ if execProvider.Timeout < timeoutMinimum || execProvider.Timeout > timeoutMaximum {
+ return nil, fmt.Errorf("credentials: invalid `timeout_millis` field — executable timeout must be between %v and %v seconds", timeoutMinimum.Seconds(), timeoutMaximum.Seconds())
+ }
+ }
+ execProvider.OutputFile = ec.OutputFile
+ execProvider.client = o.Client
+ execProvider.opts = o
+ execProvider.env = runtimeEnvironment{}
+ return execProvider, nil
+ } else if o.CredentialSource.Certificate != nil {
+ cert := o.CredentialSource.Certificate
+ if !cert.UseDefaultCertificateConfig && cert.CertificateConfigLocation == "" {
+ return nil, errors.New("credentials: \"certificate\" object must either specify a certificate_config_location or use_default_certificate_config should be true")
+ }
+ if cert.UseDefaultCertificateConfig && cert.CertificateConfigLocation != "" {
+ return nil, errors.New("credentials: \"certificate\" object cannot specify both a certificate_config_location and use_default_certificate_config=true")
+ }
+ return &x509Provider{}, nil
+ }
+ return nil, errors.New("credentials: unable to parse credential source")
+}
+
+func getGoogHeaderValue(conf *Options, p subjectTokenProvider) string {
+ return fmt.Sprintf("gl-go/%s auth/%s google-byoid-sdk source/%s sa-impersonation/%t config-lifetime/%t",
+ goVersion(),
+ "unknown",
+ p.providerType(),
+ conf.ServiceAccountImpersonationURL != "",
+ conf.ServiceAccountImpersonationLifetimeSeconds != 0)
+}
diff --git a/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/file_provider.go b/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/file_provider.go
new file mode 100644
index 00000000..8186939f
--- /dev/null
+++ b/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/file_provider.go
@@ -0,0 +1,78 @@
+// Copyright 2023 Google LLC
+//
+// 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 externalaccount
+
+import (
+ "bytes"
+ "context"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "os"
+
+ "cloud.google.com/go/auth/internal"
+ "cloud.google.com/go/auth/internal/credsfile"
+)
+
+const (
+ fileProviderType = "file"
+)
+
+type fileSubjectProvider struct {
+ File string
+ Format *credsfile.Format
+}
+
+func (sp *fileSubjectProvider) subjectToken(context.Context) (string, error) {
+ tokenFile, err := os.Open(sp.File)
+ if err != nil {
+ return "", fmt.Errorf("credentials: failed to open credential file %q: %w", sp.File, err)
+ }
+ defer tokenFile.Close()
+ tokenBytes, err := internal.ReadAll(tokenFile)
+ if err != nil {
+ return "", fmt.Errorf("credentials: failed to read credential file: %w", err)
+ }
+ tokenBytes = bytes.TrimSpace(tokenBytes)
+
+ if sp.Format == nil {
+ return string(tokenBytes), nil
+ }
+ switch sp.Format.Type {
+ case fileTypeJSON:
+ jsonData := make(map[string]interface{})
+ err = json.Unmarshal(tokenBytes, &jsonData)
+ if err != nil {
+ return "", fmt.Errorf("credentials: failed to unmarshal subject token file: %w", err)
+ }
+ val, ok := jsonData[sp.Format.SubjectTokenFieldName]
+ if !ok {
+ return "", errors.New("credentials: provided subject_token_field_name not found in credentials")
+ }
+ token, ok := val.(string)
+ if !ok {
+ return "", errors.New("credentials: improperly formatted subject token")
+ }
+ return token, nil
+ case fileTypeText:
+ return string(tokenBytes), nil
+ default:
+ return "", errors.New("credentials: invalid credential_source file format type: " + sp.Format.Type)
+ }
+}
+
+func (sp *fileSubjectProvider) providerType() string {
+ return fileProviderType
+}
diff --git a/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/info.go b/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/info.go
new file mode 100644
index 00000000..8e4b4379
--- /dev/null
+++ b/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/info.go
@@ -0,0 +1,74 @@
+// Copyright 2023 Google LLC
+//
+// 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 externalaccount
+
+import (
+ "runtime"
+ "strings"
+ "unicode"
+)
+
+var (
+ // version is a package internal global variable for testing purposes.
+ version = runtime.Version
+)
+
+// versionUnknown is only used when the runtime version cannot be determined.
+const versionUnknown = "UNKNOWN"
+
+// goVersion returns a Go runtime version derived from the runtime environment
+// that is modified to be suitable for reporting in a header, meaning it has no
+// whitespace. If it is unable to determine the Go runtime version, it returns
+// versionUnknown.
+func goVersion() string {
+ const develPrefix = "devel +"
+
+ s := version()
+ if strings.HasPrefix(s, develPrefix) {
+ s = s[len(develPrefix):]
+ if p := strings.IndexFunc(s, unicode.IsSpace); p >= 0 {
+ s = s[:p]
+ }
+ return s
+ } else if p := strings.IndexFunc(s, unicode.IsSpace); p >= 0 {
+ s = s[:p]
+ }
+
+ notSemverRune := func(r rune) bool {
+ return !strings.ContainsRune("0123456789.", r)
+ }
+
+ if strings.HasPrefix(s, "go1") {
+ s = s[2:]
+ var prerelease string
+ if p := strings.IndexFunc(s, notSemverRune); p >= 0 {
+ s, prerelease = s[:p], s[p:]
+ }
+ if strings.HasSuffix(s, ".") {
+ s += "0"
+ } else if strings.Count(s, ".") < 2 {
+ s += ".0"
+ }
+ if prerelease != "" {
+ // Some release candidates already have a dash in them.
+ if !strings.HasPrefix(prerelease, "-") {
+ prerelease = "-" + prerelease
+ }
+ s += prerelease
+ }
+ return s
+ }
+ return versionUnknown
+}
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/http.go b/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/programmatic_provider.go
similarity index 54%
rename from vendor/go.opentelemetry.io/otel/semconv/v1.17.0/http.go
rename to vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/programmatic_provider.go
index d5c4b5c1..be3c8735 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/http.go
+++ b/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/programmatic_provider.go
@@ -1,10 +1,10 @@
-// Copyright The OpenTelemetry Authors
+// Copyright 2024 Google LLC
//
// 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
+// 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,
@@ -12,10 +12,19 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-package semconv // import "go.opentelemetry.io/otel/semconv/v1.17.0"
+package externalaccount
-// HTTP scheme attributes.
-var (
- HTTPSchemeHTTP = HTTPSchemeKey.String("http")
- HTTPSchemeHTTPS = HTTPSchemeKey.String("https")
-)
+import "context"
+
+type programmaticProvider struct {
+ opts *RequestOptions
+ stp SubjectTokenProvider
+}
+
+func (pp *programmaticProvider) providerType() string {
+ return programmaticProviderType
+}
+
+func (pp *programmaticProvider) subjectToken(ctx context.Context) (string, error) {
+ return pp.stp.SubjectToken(ctx, pp.opts)
+}
diff --git a/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/url_provider.go b/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/url_provider.go
new file mode 100644
index 00000000..0a020599
--- /dev/null
+++ b/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/url_provider.go
@@ -0,0 +1,88 @@
+// Copyright 2023 Google LLC
+//
+// 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 externalaccount
+
+import (
+ "context"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "net/http"
+
+ "cloud.google.com/go/auth/internal"
+ "cloud.google.com/go/auth/internal/credsfile"
+)
+
+const (
+ fileTypeText = "text"
+ fileTypeJSON = "json"
+ urlProviderType = "url"
+ programmaticProviderType = "programmatic"
+ x509ProviderType = "x509"
+)
+
+type urlSubjectProvider struct {
+ URL string
+ Headers map[string]string
+ Format *credsfile.Format
+ Client *http.Client
+}
+
+func (sp *urlSubjectProvider) subjectToken(ctx context.Context) (string, error) {
+ req, err := http.NewRequestWithContext(ctx, "GET", sp.URL, nil)
+ if err != nil {
+ return "", fmt.Errorf("credentials: HTTP request for URL-sourced credential failed: %w", err)
+ }
+
+ for key, val := range sp.Headers {
+ req.Header.Add(key, val)
+ }
+ resp, body, err := internal.DoRequest(sp.Client, req)
+ if err != nil {
+ return "", fmt.Errorf("credentials: invalid response when retrieving subject token: %w", err)
+ }
+ if c := resp.StatusCode; c < http.StatusOK || c >= http.StatusMultipleChoices {
+ return "", fmt.Errorf("credentials: status code %d: %s", c, body)
+ }
+
+ if sp.Format == nil {
+ return string(body), nil
+ }
+ switch sp.Format.Type {
+ case "json":
+ jsonData := make(map[string]interface{})
+ err = json.Unmarshal(body, &jsonData)
+ if err != nil {
+ return "", fmt.Errorf("credentials: failed to unmarshal subject token file: %w", err)
+ }
+ val, ok := jsonData[sp.Format.SubjectTokenFieldName]
+ if !ok {
+ return "", errors.New("credentials: provided subject_token_field_name not found in credentials")
+ }
+ token, ok := val.(string)
+ if !ok {
+ return "", errors.New("credentials: improperly formatted subject token")
+ }
+ return token, nil
+ case fileTypeText:
+ return string(body), nil
+ default:
+ return "", errors.New("credentials: invalid credential_source file format type: " + sp.Format.Type)
+ }
+}
+
+func (sp *urlSubjectProvider) providerType() string {
+ return urlProviderType
+}
diff --git a/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/x509_provider.go b/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/x509_provider.go
new file mode 100644
index 00000000..115df588
--- /dev/null
+++ b/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/x509_provider.go
@@ -0,0 +1,63 @@
+// Copyright 2024 Google LLC
+//
+// 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 externalaccount
+
+import (
+ "context"
+ "crypto/tls"
+ "net/http"
+ "time"
+
+ "cloud.google.com/go/auth/internal/transport/cert"
+)
+
+// x509Provider implements the subjectTokenProvider type for
+// x509 workload identity credentials. Because x509 credentials
+// rely on an mTLS connection to represent the 3rd party identity
+// rather than a subject token, this provider will always return
+// an empty string when a subject token is requested by the external account
+// token provider.
+type x509Provider struct {
+}
+
+func (xp *x509Provider) providerType() string {
+ return x509ProviderType
+}
+
+func (xp *x509Provider) subjectToken(ctx context.Context) (string, error) {
+ return "", nil
+}
+
+// createX509Client creates a new client that is configured with mTLS, using the
+// certificate configuration specified in the credential source.
+func createX509Client(certificateConfigLocation string) (*http.Client, error) {
+ certProvider, err := cert.NewWorkloadX509CertProvider(certificateConfigLocation)
+ if err != nil {
+ return nil, err
+ }
+ trans := http.DefaultTransport.(*http.Transport).Clone()
+
+ trans.TLSClientConfig = &tls.Config{
+ GetClientCertificate: certProvider,
+ }
+
+ // Create a client with default settings plus the X509 workload cert and key.
+ client := &http.Client{
+ Transport: trans,
+ Timeout: 30 * time.Second,
+ }
+
+ return client, nil
+}
diff --git a/vendor/cloud.google.com/go/auth/credentials/internal/externalaccountuser/externalaccountuser.go b/vendor/cloud.google.com/go/auth/credentials/internal/externalaccountuser/externalaccountuser.go
new file mode 100644
index 00000000..0d788547
--- /dev/null
+++ b/vendor/cloud.google.com/go/auth/credentials/internal/externalaccountuser/externalaccountuser.go
@@ -0,0 +1,110 @@
+// Copyright 2023 Google LLC
+//
+// 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 externalaccountuser
+
+import (
+ "context"
+ "errors"
+ "net/http"
+ "time"
+
+ "cloud.google.com/go/auth"
+ "cloud.google.com/go/auth/credentials/internal/stsexchange"
+ "cloud.google.com/go/auth/internal"
+)
+
+// Options stores the configuration for fetching tokens with external authorized
+// user credentials.
+type Options struct {
+ // Audience is the Secure Token Service (STS) audience which contains the
+ // resource name for the workforce pool and the provider identifier in that
+ // pool.
+ Audience string
+ // RefreshToken is the OAuth 2.0 refresh token.
+ RefreshToken string
+ // TokenURL is the STS token exchange endpoint for refresh.
+ TokenURL string
+ // TokenInfoURL is the STS endpoint URL for token introspection. Optional.
+ TokenInfoURL string
+ // ClientID is only required in conjunction with ClientSecret, as described
+ // below.
+ ClientID string
+ // ClientSecret is currently only required if token_info endpoint also needs
+ // to be called with the generated a cloud access token. When provided, STS
+ // will be called with additional basic authentication using client_id as
+ // username and client_secret as password.
+ ClientSecret string
+ // Scopes contains the desired scopes for the returned access token.
+ Scopes []string
+
+ // Client for token request.
+ Client *http.Client
+}
+
+func (c *Options) validate() bool {
+ return c.ClientID != "" && c.ClientSecret != "" && c.RefreshToken != "" && c.TokenURL != ""
+}
+
+// NewTokenProvider returns a [cloud.google.com/go/auth.TokenProvider]
+// configured with the provided options.
+func NewTokenProvider(opts *Options) (auth.TokenProvider, error) {
+ if !opts.validate() {
+ return nil, errors.New("credentials: invalid external_account_authorized_user configuration")
+ }
+
+ tp := &tokenProvider{
+ o: opts,
+ }
+ return auth.NewCachedTokenProvider(tp, nil), nil
+}
+
+type tokenProvider struct {
+ o *Options
+}
+
+func (tp *tokenProvider) Token(ctx context.Context) (*auth.Token, error) {
+ opts := tp.o
+
+ clientAuth := stsexchange.ClientAuthentication{
+ AuthStyle: auth.StyleInHeader,
+ ClientID: opts.ClientID,
+ ClientSecret: opts.ClientSecret,
+ }
+ headers := make(http.Header)
+ headers.Set("Content-Type", "application/x-www-form-urlencoded")
+ stsResponse, err := stsexchange.RefreshAccessToken(ctx, &stsexchange.Options{
+ Client: opts.Client,
+ Endpoint: opts.TokenURL,
+ RefreshToken: opts.RefreshToken,
+ Authentication: clientAuth,
+ Headers: headers,
+ })
+ if err != nil {
+ return nil, err
+ }
+ if stsResponse.ExpiresIn < 0 {
+ return nil, errors.New("credentials: invalid expiry from security token service")
+ }
+
+ // guarded by the wrapping with CachedTokenProvider
+ if stsResponse.RefreshToken != "" {
+ opts.RefreshToken = stsResponse.RefreshToken
+ }
+ return &auth.Token{
+ Value: stsResponse.AccessToken,
+ Expiry: time.Now().UTC().Add(time.Duration(stsResponse.ExpiresIn) * time.Second),
+ Type: internal.TokenTypeBearer,
+ }, nil
+}
diff --git a/vendor/cloud.google.com/go/auth/credentials/internal/gdch/gdch.go b/vendor/cloud.google.com/go/auth/credentials/internal/gdch/gdch.go
new file mode 100644
index 00000000..720045d3
--- /dev/null
+++ b/vendor/cloud.google.com/go/auth/credentials/internal/gdch/gdch.go
@@ -0,0 +1,184 @@
+// Copyright 2023 Google LLC
+//
+// 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 gdch
+
+import (
+ "context"
+ "crypto/rsa"
+ "crypto/tls"
+ "crypto/x509"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "net/http"
+ "net/url"
+ "os"
+ "strings"
+ "time"
+
+ "cloud.google.com/go/auth"
+ "cloud.google.com/go/auth/internal"
+ "cloud.google.com/go/auth/internal/credsfile"
+ "cloud.google.com/go/auth/internal/jwt"
+)
+
+const (
+ // GrantType is the grant type for the token request.
+ GrantType = "urn:ietf:params:oauth:token-type:token-exchange"
+ requestTokenType = "urn:ietf:params:oauth:token-type:access_token"
+ subjectTokenType = "urn:k8s:params:oauth:token-type:serviceaccount"
+)
+
+var (
+ gdchSupportFormatVersions map[string]bool = map[string]bool{
+ "1": true,
+ }
+)
+
+// Options for [NewTokenProvider].
+type Options struct {
+ STSAudience string
+ Client *http.Client
+}
+
+// NewTokenProvider returns a [cloud.google.com/go/auth.TokenProvider] from a
+// GDCH cred file.
+func NewTokenProvider(f *credsfile.GDCHServiceAccountFile, o *Options) (auth.TokenProvider, error) {
+ if !gdchSupportFormatVersions[f.FormatVersion] {
+ return nil, fmt.Errorf("credentials: unsupported gdch_service_account format %q", f.FormatVersion)
+ }
+ if o.STSAudience == "" {
+ return nil, errors.New("credentials: STSAudience must be set for the GDCH auth flows")
+ }
+ pk, err := internal.ParseKey([]byte(f.PrivateKey))
+ if err != nil {
+ return nil, err
+ }
+ certPool, err := loadCertPool(f.CertPath)
+ if err != nil {
+ return nil, err
+ }
+
+ tp := gdchProvider{
+ serviceIdentity: fmt.Sprintf("system:serviceaccount:%s:%s", f.Project, f.Name),
+ tokenURL: f.TokenURL,
+ aud: o.STSAudience,
+ pk: pk,
+ pkID: f.PrivateKeyID,
+ certPool: certPool,
+ client: o.Client,
+ }
+ return tp, nil
+}
+
+func loadCertPool(path string) (*x509.CertPool, error) {
+ pool := x509.NewCertPool()
+ pem, err := os.ReadFile(path)
+ if err != nil {
+ return nil, fmt.Errorf("credentials: failed to read certificate: %w", err)
+ }
+ pool.AppendCertsFromPEM(pem)
+ return pool, nil
+}
+
+type gdchProvider struct {
+ serviceIdentity string
+ tokenURL string
+ aud string
+ pk *rsa.PrivateKey
+ pkID string
+ certPool *x509.CertPool
+
+ client *http.Client
+}
+
+func (g gdchProvider) Token(ctx context.Context) (*auth.Token, error) {
+ addCertToTransport(g.client, g.certPool)
+ iat := time.Now()
+ exp := iat.Add(time.Hour)
+ claims := jwt.Claims{
+ Iss: g.serviceIdentity,
+ Sub: g.serviceIdentity,
+ Aud: g.tokenURL,
+ Iat: iat.Unix(),
+ Exp: exp.Unix(),
+ }
+ h := jwt.Header{
+ Algorithm: jwt.HeaderAlgRSA256,
+ Type: jwt.HeaderType,
+ KeyID: string(g.pkID),
+ }
+ payload, err := jwt.EncodeJWS(&h, &claims, g.pk)
+ if err != nil {
+ return nil, err
+ }
+ v := url.Values{}
+ v.Set("grant_type", GrantType)
+ v.Set("audience", g.aud)
+ v.Set("requested_token_type", requestTokenType)
+ v.Set("subject_token", payload)
+ v.Set("subject_token_type", subjectTokenType)
+
+ req, err := http.NewRequestWithContext(ctx, "POST", g.tokenURL, strings.NewReader(v.Encode()))
+ if err != nil {
+ return nil, err
+ }
+ req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
+ resp, body, err := internal.DoRequest(g.client, req)
+ if err != nil {
+ return nil, fmt.Errorf("credentials: cannot fetch token: %w", err)
+ }
+ if c := resp.StatusCode; c < http.StatusOK || c > http.StatusMultipleChoices {
+ return nil, &auth.Error{
+ Response: resp,
+ Body: body,
+ }
+ }
+
+ var tokenRes struct {
+ AccessToken string `json:"access_token"`
+ TokenType string `json:"token_type"`
+ ExpiresIn int64 `json:"expires_in"` // relative seconds from now
+ }
+ if err := json.Unmarshal(body, &tokenRes); err != nil {
+ return nil, fmt.Errorf("credentials: cannot fetch token: %w", err)
+ }
+ token := &auth.Token{
+ Value: tokenRes.AccessToken,
+ Type: tokenRes.TokenType,
+ }
+ raw := make(map[string]interface{})
+ json.Unmarshal(body, &raw) // no error checks for optional fields
+ token.Metadata = raw
+
+ if secs := tokenRes.ExpiresIn; secs > 0 {
+ token.Expiry = time.Now().Add(time.Duration(secs) * time.Second)
+ }
+ return token, nil
+}
+
+// addCertToTransport makes a best effort attempt at adding in the cert info to
+// the client. It tries to keep all configured transport settings if the
+// underlying transport is an http.Transport. Or else it overwrites the
+// transport with defaults adding in the certs.
+func addCertToTransport(hc *http.Client, certPool *x509.CertPool) {
+ trans, ok := hc.Transport.(*http.Transport)
+ if !ok {
+ trans = http.DefaultTransport.(*http.Transport).Clone()
+ }
+ trans.TLSClientConfig = &tls.Config{
+ RootCAs: certPool,
+ }
+}
diff --git a/vendor/cloud.google.com/go/auth/credentials/internal/impersonate/impersonate.go b/vendor/cloud.google.com/go/auth/credentials/internal/impersonate/impersonate.go
new file mode 100644
index 00000000..ed53afa5
--- /dev/null
+++ b/vendor/cloud.google.com/go/auth/credentials/internal/impersonate/impersonate.go
@@ -0,0 +1,146 @@
+// Copyright 2023 Google LLC
+//
+// 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 impersonate
+
+import (
+ "bytes"
+ "context"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "net/http"
+ "time"
+
+ "cloud.google.com/go/auth"
+ "cloud.google.com/go/auth/internal"
+)
+
+const (
+ defaultTokenLifetime = "3600s"
+ authHeaderKey = "Authorization"
+)
+
+// generateAccesstokenReq is used for service account impersonation
+type generateAccessTokenReq struct {
+ Delegates []string `json:"delegates,omitempty"`
+ Lifetime string `json:"lifetime,omitempty"`
+ Scope []string `json:"scope,omitempty"`
+}
+
+type impersonateTokenResponse struct {
+ AccessToken string `json:"accessToken"`
+ ExpireTime string `json:"expireTime"`
+}
+
+// NewTokenProvider uses a source credential, stored in Ts, to request an access token to the provided URL.
+// Scopes can be defined when the access token is requested.
+func NewTokenProvider(opts *Options) (auth.TokenProvider, error) {
+ if err := opts.validate(); err != nil {
+ return nil, err
+ }
+ return opts, nil
+}
+
+// Options for [NewTokenProvider].
+type Options struct {
+ // Tp is the source credential used to generate a token on the
+ // impersonated service account. Required.
+ Tp auth.TokenProvider
+
+ // URL is the endpoint to call to generate a token
+ // on behalf of the service account. Required.
+ URL string
+ // Scopes that the impersonated credential should have. Required.
+ Scopes []string
+ // Delegates are the service account email addresses in a delegation chain.
+ // Each service account must be granted roles/iam.serviceAccountTokenCreator
+ // on the next service account in the chain. Optional.
+ Delegates []string
+ // TokenLifetimeSeconds is the number of seconds the impersonation token will
+ // be valid for. Defaults to 1 hour if unset. Optional.
+ TokenLifetimeSeconds int
+ // Client configures the underlying client used to make network requests
+ // when fetching tokens. Required.
+ Client *http.Client
+}
+
+func (o *Options) validate() error {
+ if o.Tp == nil {
+ return errors.New("credentials: missing required 'source_credentials' field in impersonated credentials")
+ }
+ if o.URL == "" {
+ return errors.New("credentials: missing required 'service_account_impersonation_url' field in impersonated credentials")
+ }
+ return nil
+}
+
+// Token performs the exchange to get a temporary service account token to allow access to GCP.
+func (o *Options) Token(ctx context.Context) (*auth.Token, error) {
+ lifetime := defaultTokenLifetime
+ if o.TokenLifetimeSeconds != 0 {
+ lifetime = fmt.Sprintf("%ds", o.TokenLifetimeSeconds)
+ }
+ reqBody := generateAccessTokenReq{
+ Lifetime: lifetime,
+ Scope: o.Scopes,
+ Delegates: o.Delegates,
+ }
+ b, err := json.Marshal(reqBody)
+ if err != nil {
+ return nil, fmt.Errorf("credentials: unable to marshal request: %w", err)
+ }
+ req, err := http.NewRequestWithContext(ctx, "POST", o.URL, bytes.NewReader(b))
+ if err != nil {
+ return nil, fmt.Errorf("credentials: unable to create impersonation request: %w", err)
+ }
+ req.Header.Set("Content-Type", "application/json")
+ if err := setAuthHeader(ctx, o.Tp, req); err != nil {
+ return nil, err
+ }
+ resp, body, err := internal.DoRequest(o.Client, req)
+ if err != nil {
+ return nil, fmt.Errorf("credentials: unable to generate access token: %w", err)
+ }
+ if c := resp.StatusCode; c < http.StatusOK || c >= http.StatusMultipleChoices {
+ return nil, fmt.Errorf("credentials: status code %d: %s", c, body)
+ }
+
+ var accessTokenResp impersonateTokenResponse
+ if err := json.Unmarshal(body, &accessTokenResp); err != nil {
+ return nil, fmt.Errorf("credentials: unable to parse response: %w", err)
+ }
+ expiry, err := time.Parse(time.RFC3339, accessTokenResp.ExpireTime)
+ if err != nil {
+ return nil, fmt.Errorf("credentials: unable to parse expiry: %w", err)
+ }
+ return &auth.Token{
+ Value: accessTokenResp.AccessToken,
+ Expiry: expiry,
+ Type: internal.TokenTypeBearer,
+ }, nil
+}
+
+func setAuthHeader(ctx context.Context, tp auth.TokenProvider, r *http.Request) error {
+ t, err := tp.Token(ctx)
+ if err != nil {
+ return err
+ }
+ typ := t.Type
+ if typ == "" {
+ typ = internal.TokenTypeBearer
+ }
+ r.Header.Set(authHeaderKey, typ+" "+t.Value)
+ return nil
+}
diff --git a/vendor/cloud.google.com/go/auth/credentials/internal/stsexchange/sts_exchange.go b/vendor/cloud.google.com/go/auth/credentials/internal/stsexchange/sts_exchange.go
new file mode 100644
index 00000000..768a9daf
--- /dev/null
+++ b/vendor/cloud.google.com/go/auth/credentials/internal/stsexchange/sts_exchange.go
@@ -0,0 +1,161 @@
+// Copyright 2023 Google LLC
+//
+// 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 stsexchange
+
+import (
+ "context"
+ "encoding/base64"
+ "encoding/json"
+ "fmt"
+ "net/http"
+ "net/url"
+ "strconv"
+ "strings"
+
+ "cloud.google.com/go/auth"
+ "cloud.google.com/go/auth/internal"
+)
+
+const (
+ // GrantType for a sts exchange.
+ GrantType = "urn:ietf:params:oauth:grant-type:token-exchange"
+ // TokenType for a sts exchange.
+ TokenType = "urn:ietf:params:oauth:token-type:access_token"
+
+ jwtTokenType = "urn:ietf:params:oauth:token-type:jwt"
+)
+
+// Options stores the configuration for making an sts exchange request.
+type Options struct {
+ Client *http.Client
+ Endpoint string
+ Request *TokenRequest
+ Authentication ClientAuthentication
+ Headers http.Header
+ // ExtraOpts are optional fields marshalled into the `options` field of the
+ // request body.
+ ExtraOpts map[string]interface{}
+ RefreshToken string
+}
+
+// RefreshAccessToken performs the token exchange using a refresh token flow.
+func RefreshAccessToken(ctx context.Context, opts *Options) (*TokenResponse, error) {
+ data := url.Values{}
+ data.Set("grant_type", "refresh_token")
+ data.Set("refresh_token", opts.RefreshToken)
+ return doRequest(ctx, opts, data)
+}
+
+// ExchangeToken performs an oauth2 token exchange with the provided endpoint.
+func ExchangeToken(ctx context.Context, opts *Options) (*TokenResponse, error) {
+ data := url.Values{}
+ data.Set("audience", opts.Request.Audience)
+ data.Set("grant_type", GrantType)
+ data.Set("requested_token_type", TokenType)
+ data.Set("subject_token_type", opts.Request.SubjectTokenType)
+ data.Set("subject_token", opts.Request.SubjectToken)
+ data.Set("scope", strings.Join(opts.Request.Scope, " "))
+ if opts.ExtraOpts != nil {
+ opts, err := json.Marshal(opts.ExtraOpts)
+ if err != nil {
+ return nil, fmt.Errorf("credentials: failed to marshal additional options: %w", err)
+ }
+ data.Set("options", string(opts))
+ }
+ return doRequest(ctx, opts, data)
+}
+
+func doRequest(ctx context.Context, opts *Options, data url.Values) (*TokenResponse, error) {
+ opts.Authentication.InjectAuthentication(data, opts.Headers)
+ encodedData := data.Encode()
+
+ req, err := http.NewRequestWithContext(ctx, "POST", opts.Endpoint, strings.NewReader(encodedData))
+ if err != nil {
+ return nil, fmt.Errorf("credentials: failed to properly build http request: %w", err)
+
+ }
+ for key, list := range opts.Headers {
+ for _, val := range list {
+ req.Header.Add(key, val)
+ }
+ }
+ req.Header.Set("Content-Length", strconv.Itoa(len(encodedData)))
+
+ resp, body, err := internal.DoRequest(opts.Client, req)
+ if err != nil {
+ return nil, fmt.Errorf("credentials: invalid response from Secure Token Server: %w", err)
+ }
+ if c := resp.StatusCode; c < http.StatusOK || c > http.StatusMultipleChoices {
+ return nil, fmt.Errorf("credentials: status code %d: %s", c, body)
+ }
+ var stsResp TokenResponse
+ if err := json.Unmarshal(body, &stsResp); err != nil {
+ return nil, fmt.Errorf("credentials: failed to unmarshal response body from Secure Token Server: %w", err)
+ }
+
+ return &stsResp, nil
+}
+
+// TokenRequest contains fields necessary to make an oauth2 token
+// exchange.
+type TokenRequest struct {
+ ActingParty struct {
+ ActorToken string
+ ActorTokenType string
+ }
+ GrantType string
+ Resource string
+ Audience string
+ Scope []string
+ RequestedTokenType string
+ SubjectToken string
+ SubjectTokenType string
+}
+
+// TokenResponse is used to decode the remote server response during
+// an oauth2 token exchange.
+type TokenResponse struct {
+ AccessToken string `json:"access_token"`
+ IssuedTokenType string `json:"issued_token_type"`
+ TokenType string `json:"token_type"`
+ ExpiresIn int `json:"expires_in"`
+ Scope string `json:"scope"`
+ RefreshToken string `json:"refresh_token"`
+}
+
+// ClientAuthentication represents an OAuth client ID and secret and the
+// mechanism for passing these credentials as stated in rfc6749#2.3.1.
+type ClientAuthentication struct {
+ AuthStyle auth.Style
+ ClientID string
+ ClientSecret string
+}
+
+// InjectAuthentication is used to add authentication to a Secure Token Service
+// exchange request. It modifies either the passed url.Values or http.Header
+// depending on the desired authentication format.
+func (c *ClientAuthentication) InjectAuthentication(values url.Values, headers http.Header) {
+ if c.ClientID == "" || c.ClientSecret == "" || values == nil || headers == nil {
+ return
+ }
+ switch c.AuthStyle {
+ case auth.StyleInHeader:
+ plainHeader := c.ClientID + ":" + c.ClientSecret
+ headers.Set("Authorization", "Basic "+base64.StdEncoding.EncodeToString([]byte(plainHeader)))
+ default:
+ values.Set("client_id", c.ClientID)
+ values.Set("client_secret", c.ClientSecret)
+ }
+}
diff --git a/vendor/cloud.google.com/go/auth/credentials/selfsignedjwt.go b/vendor/cloud.google.com/go/auth/credentials/selfsignedjwt.go
new file mode 100644
index 00000000..6ae29de6
--- /dev/null
+++ b/vendor/cloud.google.com/go/auth/credentials/selfsignedjwt.go
@@ -0,0 +1,85 @@
+// Copyright 2023 Google LLC
+//
+// 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 credentials
+
+import (
+ "context"
+ "crypto/rsa"
+ "errors"
+ "fmt"
+ "strings"
+ "time"
+
+ "cloud.google.com/go/auth"
+ "cloud.google.com/go/auth/internal"
+ "cloud.google.com/go/auth/internal/credsfile"
+ "cloud.google.com/go/auth/internal/jwt"
+)
+
+var (
+ // for testing
+ now func() time.Time = time.Now
+)
+
+// configureSelfSignedJWT uses the private key in the service account to create
+// a JWT without making a network call.
+func configureSelfSignedJWT(f *credsfile.ServiceAccountFile, opts *DetectOptions) (auth.TokenProvider, error) {
+ if len(opts.scopes()) == 0 && opts.Audience == "" {
+ return nil, errors.New("credentials: both scopes and audience are empty")
+ }
+ pk, err := internal.ParseKey([]byte(f.PrivateKey))
+ if err != nil {
+ return nil, fmt.Errorf("credentials: could not parse key: %w", err)
+ }
+ return &selfSignedTokenProvider{
+ email: f.ClientEmail,
+ audience: opts.Audience,
+ scopes: opts.scopes(),
+ pk: pk,
+ pkID: f.PrivateKeyID,
+ }, nil
+}
+
+type selfSignedTokenProvider struct {
+ email string
+ audience string
+ scopes []string
+ pk *rsa.PrivateKey
+ pkID string
+}
+
+func (tp *selfSignedTokenProvider) Token(context.Context) (*auth.Token, error) {
+ iat := now()
+ exp := iat.Add(time.Hour)
+ scope := strings.Join(tp.scopes, " ")
+ c := &jwt.Claims{
+ Iss: tp.email,
+ Sub: tp.email,
+ Aud: tp.audience,
+ Scope: scope,
+ Iat: iat.Unix(),
+ Exp: exp.Unix(),
+ }
+ h := &jwt.Header{
+ Algorithm: jwt.HeaderAlgRSA256,
+ Type: jwt.HeaderType,
+ KeyID: string(tp.pkID),
+ }
+ msg, err := jwt.EncodeJWS(h, c, tp.pk)
+ if err != nil {
+ return nil, fmt.Errorf("credentials: could not encode JWT: %w", err)
+ }
+ return &auth.Token{Value: msg, Type: internal.TokenTypeBearer, Expiry: exp}, nil
+}
diff --git a/vendor/cloud.google.com/go/auth/httptransport/httptransport.go b/vendor/cloud.google.com/go/auth/httptransport/httptransport.go
new file mode 100644
index 00000000..cbe5a7a4
--- /dev/null
+++ b/vendor/cloud.google.com/go/auth/httptransport/httptransport.go
@@ -0,0 +1,232 @@
+// Copyright 2023 Google LLC
+//
+// 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 httptransport provides functionality for managing HTTP client
+// connections to Google Cloud services.
+package httptransport
+
+import (
+ "crypto/tls"
+ "errors"
+ "fmt"
+ "net/http"
+
+ "cloud.google.com/go/auth"
+ detect "cloud.google.com/go/auth/credentials"
+ "cloud.google.com/go/auth/internal"
+ "cloud.google.com/go/auth/internal/transport"
+)
+
+// ClientCertProvider is a function that returns a TLS client certificate to be
+// used when opening TLS connections. It follows the same semantics as
+// [crypto/tls.Config.GetClientCertificate].
+type ClientCertProvider = func(*tls.CertificateRequestInfo) (*tls.Certificate, error)
+
+// Options used to configure a [net/http.Client] from [NewClient].
+type Options struct {
+ // DisableTelemetry disables default telemetry (OpenTelemetry). An example
+ // reason to do so would be to bind custom telemetry that overrides the
+ // defaults.
+ DisableTelemetry bool
+ // DisableAuthentication specifies that no authentication should be used. It
+ // is suitable only for testing and for accessing public resources, like
+ // public Google Cloud Storage buckets.
+ DisableAuthentication bool
+ // Headers are extra HTTP headers that will be appended to every outgoing
+ // request.
+ Headers http.Header
+ // BaseRoundTripper overrides the base transport used for serving requests.
+ // If specified ClientCertProvider is ignored.
+ BaseRoundTripper http.RoundTripper
+ // Endpoint overrides the default endpoint to be used for a service.
+ Endpoint string
+ // APIKey specifies an API key to be used as the basis for authentication.
+ // If set DetectOpts are ignored.
+ APIKey string
+ // Credentials used to add Authorization header to all requests. If set
+ // DetectOpts are ignored.
+ Credentials *auth.Credentials
+ // ClientCertProvider is a function that returns a TLS client certificate to
+ // be used when opening TLS connections. It follows the same semantics as
+ // crypto/tls.Config.GetClientCertificate.
+ ClientCertProvider ClientCertProvider
+ // DetectOpts configures settings for detect Application Default
+ // Credentials.
+ DetectOpts *detect.DetectOptions
+ // UniverseDomain is the default service domain for a given Cloud universe.
+ // The default value is "googleapis.com". This is the universe domain
+ // configured for the client, which will be compared to the universe domain
+ // that is separately configured for the credentials.
+ UniverseDomain string
+
+ // InternalOptions are NOT meant to be set directly by consumers of this
+ // package, they should only be set by generated client code.
+ InternalOptions *InternalOptions
+}
+
+func (o *Options) validate() error {
+ if o == nil {
+ return errors.New("httptransport: opts required to be non-nil")
+ }
+ if o.InternalOptions != nil && o.InternalOptions.SkipValidation {
+ return nil
+ }
+ hasCreds := o.APIKey != "" ||
+ o.Credentials != nil ||
+ (o.DetectOpts != nil && len(o.DetectOpts.CredentialsJSON) > 0) ||
+ (o.DetectOpts != nil && o.DetectOpts.CredentialsFile != "")
+ if o.DisableAuthentication && hasCreds {
+ return errors.New("httptransport: DisableAuthentication is incompatible with options that set or detect credentials")
+ }
+ return nil
+}
+
+// client returns the client a user set for the detect options or nil if one was
+// not set.
+func (o *Options) client() *http.Client {
+ if o.DetectOpts != nil && o.DetectOpts.Client != nil {
+ return o.DetectOpts.Client
+ }
+ return nil
+}
+
+func (o *Options) resolveDetectOptions() *detect.DetectOptions {
+ io := o.InternalOptions
+ // soft-clone these so we are not updating a ref the user holds and may reuse
+ do := transport.CloneDetectOptions(o.DetectOpts)
+
+ // If scoped JWTs are enabled user provided an aud, allow self-signed JWT.
+ if (io != nil && io.EnableJWTWithScope) || do.Audience != "" {
+ do.UseSelfSignedJWT = true
+ }
+ // Only default scopes if user did not also set an audience.
+ if len(do.Scopes) == 0 && do.Audience == "" && io != nil && len(io.DefaultScopes) > 0 {
+ do.Scopes = make([]string, len(io.DefaultScopes))
+ copy(do.Scopes, io.DefaultScopes)
+ }
+ if len(do.Scopes) == 0 && do.Audience == "" && io != nil {
+ do.Audience = o.InternalOptions.DefaultAudience
+ }
+ if o.ClientCertProvider != nil {
+ tlsConfig := &tls.Config{
+ GetClientCertificate: o.ClientCertProvider,
+ }
+ do.Client = transport.DefaultHTTPClientWithTLS(tlsConfig)
+ do.TokenURL = detect.GoogleMTLSTokenURL
+ }
+ return do
+}
+
+// InternalOptions are only meant to be set by generated client code. These are
+// not meant to be set directly by consumers of this package. Configuration in
+// this type is considered EXPERIMENTAL and may be removed at any time in the
+// future without warning.
+type InternalOptions struct {
+ // EnableJWTWithScope specifies if scope can be used with self-signed JWT.
+ EnableJWTWithScope bool
+ // DefaultAudience specifies a default audience to be used as the audience
+ // field ("aud") for the JWT token authentication.
+ DefaultAudience string
+ // DefaultEndpointTemplate combined with UniverseDomain specifies the
+ // default endpoint.
+ DefaultEndpointTemplate string
+ // DefaultMTLSEndpoint specifies the default mTLS endpoint.
+ DefaultMTLSEndpoint string
+ // DefaultScopes specifies the default OAuth2 scopes to be used for a
+ // service.
+ DefaultScopes []string
+ // SkipValidation bypasses validation on Options. It should only be used
+ // internally for clients that need more control over their transport.
+ SkipValidation bool
+ // SkipUniverseDomainValidation skips the verification that the universe
+ // domain configured for the client matches the universe domain configured
+ // for the credentials. It should only be used internally for clients that
+ // need more control over their transport. The default is false.
+ SkipUniverseDomainValidation bool
+}
+
+// AddAuthorizationMiddleware adds a middleware to the provided client's
+// transport that sets the Authorization header with the value produced by the
+// provided [cloud.google.com/go/auth.Credentials]. An error is returned only
+// if client or creds is nil.
+//
+// This function does not support setting a universe domain value on the client.
+func AddAuthorizationMiddleware(client *http.Client, creds *auth.Credentials) error {
+ if client == nil || creds == nil {
+ return fmt.Errorf("httptransport: client and tp must not be nil")
+ }
+ base := client.Transport
+ if base == nil {
+ if dt, ok := http.DefaultTransport.(*http.Transport); ok {
+ base = dt.Clone()
+ } else {
+ // Directly reuse the DefaultTransport if the application has
+ // replaced it with an implementation of RoundTripper other than
+ // http.Transport.
+ base = http.DefaultTransport
+ }
+ }
+ client.Transport = &authTransport{
+ creds: creds,
+ base: base,
+ }
+ return nil
+}
+
+// NewClient returns a [net/http.Client] that can be used to communicate with a
+// Google cloud service, configured with the provided [Options]. It
+// automatically appends Authorization headers to all outgoing requests.
+func NewClient(opts *Options) (*http.Client, error) {
+ if err := opts.validate(); err != nil {
+ return nil, err
+ }
+
+ tOpts := &transport.Options{
+ Endpoint: opts.Endpoint,
+ ClientCertProvider: opts.ClientCertProvider,
+ Client: opts.client(),
+ UniverseDomain: opts.UniverseDomain,
+ }
+ if io := opts.InternalOptions; io != nil {
+ tOpts.DefaultEndpointTemplate = io.DefaultEndpointTemplate
+ tOpts.DefaultMTLSEndpoint = io.DefaultMTLSEndpoint
+ }
+ clientCertProvider, dialTLSContext, err := transport.GetHTTPTransportConfig(tOpts)
+ if err != nil {
+ return nil, err
+ }
+ baseRoundTripper := opts.BaseRoundTripper
+ if baseRoundTripper == nil {
+ baseRoundTripper = defaultBaseTransport(clientCertProvider, dialTLSContext)
+ }
+ // Ensure the token exchange transport uses the same ClientCertProvider as the API transport.
+ opts.ClientCertProvider = clientCertProvider
+ trans, err := newTransport(baseRoundTripper, opts)
+ if err != nil {
+ return nil, err
+ }
+ return &http.Client{
+ Transport: trans,
+ }, nil
+}
+
+// SetAuthHeader uses the provided token to set the Authorization header on a
+// request. If the token.Type is empty, the type is assumed to be Bearer.
+func SetAuthHeader(token *auth.Token, req *http.Request) {
+ typ := token.Type
+ if typ == "" {
+ typ = internal.TokenTypeBearer
+ }
+ req.Header.Set("Authorization", typ+" "+token.Value)
+}
diff --git a/vendor/cloud.google.com/go/auth/httptransport/trace.go b/vendor/cloud.google.com/go/auth/httptransport/trace.go
new file mode 100644
index 00000000..467c477c
--- /dev/null
+++ b/vendor/cloud.google.com/go/auth/httptransport/trace.go
@@ -0,0 +1,93 @@
+// Copyright 2023 Google LLC
+//
+// 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 httptransport
+
+import (
+ "encoding/binary"
+ "encoding/hex"
+ "fmt"
+ "net/http"
+ "strconv"
+ "strings"
+
+ "go.opencensus.io/trace"
+ "go.opencensus.io/trace/propagation"
+)
+
+const (
+ httpHeaderMaxSize = 200
+ cloudTraceHeader = `X-Cloud-Trace-Context`
+)
+
+// asserts the httpFormat fulfills this foreign interface
+var _ propagation.HTTPFormat = (*httpFormat)(nil)
+
+// httpFormat implements propagation.httpFormat to propagate
+// traces in HTTP headers for Google Cloud Platform and Cloud Trace.
+type httpFormat struct{}
+
+// SpanContextFromRequest extracts a Cloud Trace span context from incoming requests.
+func (f *httpFormat) SpanContextFromRequest(req *http.Request) (sc trace.SpanContext, ok bool) {
+ h := req.Header.Get(cloudTraceHeader)
+ // See https://cloud.google.com/trace/docs/faq for the header HTTPFormat.
+ // Return if the header is empty or missing, or if the header is unreasonably
+ // large, to avoid making unnecessary copies of a large string.
+ if h == "" || len(h) > httpHeaderMaxSize {
+ return trace.SpanContext{}, false
+ }
+
+ // Parse the trace id field.
+ slash := strings.Index(h, `/`)
+ if slash == -1 {
+ return trace.SpanContext{}, false
+ }
+ tid, h := h[:slash], h[slash+1:]
+
+ buf, err := hex.DecodeString(tid)
+ if err != nil {
+ return trace.SpanContext{}, false
+ }
+ copy(sc.TraceID[:], buf)
+
+ // Parse the span id field.
+ spanstr := h
+ semicolon := strings.Index(h, `;`)
+ if semicolon != -1 {
+ spanstr, h = h[:semicolon], h[semicolon+1:]
+ }
+ sid, err := strconv.ParseUint(spanstr, 10, 64)
+ if err != nil {
+ return trace.SpanContext{}, false
+ }
+ binary.BigEndian.PutUint64(sc.SpanID[:], sid)
+
+ // Parse the options field, options field is optional.
+ if !strings.HasPrefix(h, "o=") {
+ return sc, true
+ }
+ o, err := strconv.ParseUint(h[2:], 10, 32)
+ if err != nil {
+ return trace.SpanContext{}, false
+ }
+ sc.TraceOptions = trace.TraceOptions(o)
+ return sc, true
+}
+
+// SpanContextToRequest modifies the given request to include a Cloud Trace header.
+func (f *httpFormat) SpanContextToRequest(sc trace.SpanContext, req *http.Request) {
+ sid := binary.BigEndian.Uint64(sc.SpanID[:])
+ header := fmt.Sprintf("%s/%d;o=%d", hex.EncodeToString(sc.TraceID[:]), sid, int64(sc.TraceOptions))
+ req.Header.Set(cloudTraceHeader, header)
+}
diff --git a/vendor/cloud.google.com/go/auth/httptransport/transport.go b/vendor/cloud.google.com/go/auth/httptransport/transport.go
new file mode 100644
index 00000000..1d139b9d
--- /dev/null
+++ b/vendor/cloud.google.com/go/auth/httptransport/transport.go
@@ -0,0 +1,248 @@
+// Copyright 2023 Google LLC
+//
+// 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 httptransport
+
+import (
+ "context"
+ "crypto/tls"
+ "net"
+ "net/http"
+ "os"
+ "time"
+
+ "cloud.google.com/go/auth"
+ "cloud.google.com/go/auth/credentials"
+ "cloud.google.com/go/auth/internal"
+ "cloud.google.com/go/auth/internal/transport"
+ "cloud.google.com/go/auth/internal/transport/cert"
+ "go.opencensus.io/plugin/ochttp"
+ "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
+ "golang.org/x/net/http2"
+)
+
+const (
+ quotaProjectHeaderKey = "X-goog-user-project"
+)
+
+func newTransport(base http.RoundTripper, opts *Options) (http.RoundTripper, error) {
+ var headers = opts.Headers
+ ht := &headerTransport{
+ base: base,
+ headers: headers,
+ }
+ var trans http.RoundTripper = ht
+ // Give OpenTelemetry precedence over OpenCensus in case user configuration
+ // causes both to write the same header (`X-Cloud-Trace-Context`).
+ trans = addOpenTelemetryTransport(trans, opts)
+ trans = addOCTransport(trans, opts)
+ switch {
+ case opts.DisableAuthentication:
+ // Do nothing.
+ case opts.APIKey != "":
+ qp := internal.GetQuotaProject(nil, opts.Headers.Get(quotaProjectHeaderKey))
+ if qp != "" {
+ if headers == nil {
+ headers = make(map[string][]string, 1)
+ }
+ headers.Set(quotaProjectHeaderKey, qp)
+ }
+ trans = &apiKeyTransport{
+ Transport: trans,
+ Key: opts.APIKey,
+ }
+ default:
+ var creds *auth.Credentials
+ if opts.Credentials != nil {
+ creds = opts.Credentials
+ } else {
+ var err error
+ creds, err = credentials.DetectDefault(opts.resolveDetectOptions())
+ if err != nil {
+ return nil, err
+ }
+ }
+ qp, err := creds.QuotaProjectID(context.Background())
+ if err != nil {
+ return nil, err
+ }
+ if qp != "" {
+ if headers == nil {
+ headers = make(map[string][]string, 1)
+ }
+ // Don't overwrite user specified quota
+ if v := headers.Get(quotaProjectHeaderKey); v == "" {
+ headers.Set(quotaProjectHeaderKey, qp)
+ }
+ }
+ var skipUD bool
+ if iOpts := opts.InternalOptions; iOpts != nil {
+ skipUD = iOpts.SkipUniverseDomainValidation
+ }
+ creds.TokenProvider = auth.NewCachedTokenProvider(creds.TokenProvider, nil)
+ trans = &authTransport{
+ base: trans,
+ creds: creds,
+ clientUniverseDomain: opts.UniverseDomain,
+ skipUniverseDomainValidation: skipUD,
+ }
+ }
+ return trans, nil
+}
+
+// defaultBaseTransport returns the base HTTP transport.
+// On App Engine, this is urlfetch.Transport.
+// Otherwise, use a default transport, taking most defaults from
+// http.DefaultTransport.
+// If TLSCertificate is available, set TLSClientConfig as well.
+func defaultBaseTransport(clientCertSource cert.Provider, dialTLSContext func(context.Context, string, string) (net.Conn, error)) http.RoundTripper {
+ defaultTransport, ok := http.DefaultTransport.(*http.Transport)
+ if !ok {
+ defaultTransport = transport.BaseTransport()
+ }
+ trans := defaultTransport.Clone()
+ trans.MaxIdleConnsPerHost = 100
+
+ if clientCertSource != nil {
+ trans.TLSClientConfig = &tls.Config{
+ GetClientCertificate: clientCertSource,
+ }
+ }
+ if dialTLSContext != nil {
+ // If DialTLSContext is set, TLSClientConfig wil be ignored
+ trans.DialTLSContext = dialTLSContext
+ }
+
+ // Configures the ReadIdleTimeout HTTP/2 option for the
+ // transport. This allows broken idle connections to be pruned more quickly,
+ // preventing the client from attempting to re-use connections that will no
+ // longer work.
+ http2Trans, err := http2.ConfigureTransports(trans)
+ if err == nil {
+ http2Trans.ReadIdleTimeout = time.Second * 31
+ }
+
+ return trans
+}
+
+type apiKeyTransport struct {
+ // Key is the API Key to set on requests.
+ Key string
+ // Transport is the underlying HTTP transport.
+ // If nil, http.DefaultTransport is used.
+ Transport http.RoundTripper
+}
+
+func (t *apiKeyTransport) RoundTrip(req *http.Request) (*http.Response, error) {
+ newReq := *req
+ args := newReq.URL.Query()
+ args.Set("key", t.Key)
+ newReq.URL.RawQuery = args.Encode()
+ return t.Transport.RoundTrip(&newReq)
+}
+
+type headerTransport struct {
+ headers http.Header
+ base http.RoundTripper
+}
+
+func (t *headerTransport) RoundTrip(req *http.Request) (*http.Response, error) {
+ rt := t.base
+ newReq := *req
+ newReq.Header = make(http.Header)
+ for k, vv := range req.Header {
+ newReq.Header[k] = vv
+ }
+
+ for k, v := range t.headers {
+ newReq.Header[k] = v
+ }
+
+ return rt.RoundTrip(&newReq)
+}
+
+func addOpenTelemetryTransport(trans http.RoundTripper, opts *Options) http.RoundTripper {
+ if opts.DisableTelemetry {
+ return trans
+ }
+ return otelhttp.NewTransport(trans)
+}
+
+func addOCTransport(trans http.RoundTripper, opts *Options) http.RoundTripper {
+ if opts.DisableTelemetry {
+ return trans
+ }
+ return &ochttp.Transport{
+ Base: trans,
+ Propagation: &httpFormat{},
+ }
+}
+
+type authTransport struct {
+ creds *auth.Credentials
+ base http.RoundTripper
+ clientUniverseDomain string
+ skipUniverseDomainValidation bool
+}
+
+// getClientUniverseDomain returns the default service domain for a given Cloud
+// universe, with the following precedence:
+//
+// 1. A non-empty option.WithUniverseDomain or similar client option.
+// 2. A non-empty environment variable GOOGLE_CLOUD_UNIVERSE_DOMAIN.
+// 3. The default value "googleapis.com".
+//
+// This is the universe domain configured for the client, which will be compared
+// to the universe domain that is separately configured for the credentials.
+func (t *authTransport) getClientUniverseDomain() string {
+ if t.clientUniverseDomain != "" {
+ return t.clientUniverseDomain
+ }
+ if envUD := os.Getenv(internal.UniverseDomainEnvVar); envUD != "" {
+ return envUD
+ }
+ return internal.DefaultUniverseDomain
+}
+
+// RoundTrip authorizes and authenticates the request with an
+// access token from Transport's Source. Per the RoundTripper contract we must
+// not modify the initial request, so we clone it, and we must close the body
+// on any errors that happens during our token logic.
+func (t *authTransport) RoundTrip(req *http.Request) (*http.Response, error) {
+ reqBodyClosed := false
+ if req.Body != nil {
+ defer func() {
+ if !reqBodyClosed {
+ req.Body.Close()
+ }
+ }()
+ }
+ token, err := t.creds.Token(req.Context())
+ if err != nil {
+ return nil, err
+ }
+ if !t.skipUniverseDomainValidation && token.MetadataString("auth.google.tokenSource") != "compute-metadata" {
+ credentialsUniverseDomain, err := t.creds.UniverseDomain(req.Context())
+ if err != nil {
+ return nil, err
+ }
+ if err := transport.ValidateUniverseDomain(t.getClientUniverseDomain(), credentialsUniverseDomain); err != nil {
+ return nil, err
+ }
+ }
+ req2 := req.Clone(req.Context())
+ SetAuthHeader(token, req2)
+ reqBodyClosed = true
+ return t.base.RoundTrip(req2)
+}
diff --git a/vendor/cloud.google.com/go/auth/internal/credsfile/credsfile.go b/vendor/cloud.google.com/go/auth/internal/credsfile/credsfile.go
new file mode 100644
index 00000000..9cd4bed6
--- /dev/null
+++ b/vendor/cloud.google.com/go/auth/internal/credsfile/credsfile.go
@@ -0,0 +1,107 @@
+// Copyright 2023 Google LLC
+//
+// 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 credsfile is meant to hide implementation details from the pubic
+// surface of the detect package. It should not import any other packages in
+// this module. It is located under the main internal package so other
+// sub-packages can use these parsed types as well.
+package credsfile
+
+import (
+ "os"
+ "os/user"
+ "path/filepath"
+ "runtime"
+)
+
+const (
+ // GoogleAppCredsEnvVar is the environment variable for setting the
+ // application default credentials.
+ GoogleAppCredsEnvVar = "GOOGLE_APPLICATION_CREDENTIALS"
+ userCredsFilename = "application_default_credentials.json"
+)
+
+// CredentialType represents different credential filetypes Google credentials
+// can be.
+type CredentialType int
+
+const (
+ // UnknownCredType is an unidentified file type.
+ UnknownCredType CredentialType = iota
+ // UserCredentialsKey represents a user creds file type.
+ UserCredentialsKey
+ // ServiceAccountKey represents a service account file type.
+ ServiceAccountKey
+ // ImpersonatedServiceAccountKey represents a impersonated service account
+ // file type.
+ ImpersonatedServiceAccountKey
+ // ExternalAccountKey represents a external account file type.
+ ExternalAccountKey
+ // GDCHServiceAccountKey represents a GDCH file type.
+ GDCHServiceAccountKey
+ // ExternalAccountAuthorizedUserKey represents a external account authorized
+ // user file type.
+ ExternalAccountAuthorizedUserKey
+)
+
+// parseCredentialType returns the associated filetype based on the parsed
+// typeString provided.
+func parseCredentialType(typeString string) CredentialType {
+ switch typeString {
+ case "service_account":
+ return ServiceAccountKey
+ case "authorized_user":
+ return UserCredentialsKey
+ case "impersonated_service_account":
+ return ImpersonatedServiceAccountKey
+ case "external_account":
+ return ExternalAccountKey
+ case "external_account_authorized_user":
+ return ExternalAccountAuthorizedUserKey
+ case "gdch_service_account":
+ return GDCHServiceAccountKey
+ default:
+ return UnknownCredType
+ }
+}
+
+// GetFileNameFromEnv returns the override if provided or detects a filename
+// from the environment.
+func GetFileNameFromEnv(override string) string {
+ if override != "" {
+ return override
+ }
+ return os.Getenv(GoogleAppCredsEnvVar)
+}
+
+// GetWellKnownFileName tries to locate the filepath for the user credential
+// file based on the environment.
+func GetWellKnownFileName() string {
+ if runtime.GOOS == "windows" {
+ return filepath.Join(os.Getenv("APPDATA"), "gcloud", userCredsFilename)
+ }
+ return filepath.Join(guessUnixHomeDir(), ".config", "gcloud", userCredsFilename)
+}
+
+// guessUnixHomeDir default to checking for HOME, but not all unix systems have
+// this set, do have a fallback.
+func guessUnixHomeDir() string {
+ if v := os.Getenv("HOME"); v != "" {
+ return v
+ }
+ if u, err := user.Current(); err == nil {
+ return u.HomeDir
+ }
+ return ""
+}
diff --git a/vendor/cloud.google.com/go/auth/internal/credsfile/filetype.go b/vendor/cloud.google.com/go/auth/internal/credsfile/filetype.go
new file mode 100644
index 00000000..3be6e5bb
--- /dev/null
+++ b/vendor/cloud.google.com/go/auth/internal/credsfile/filetype.go
@@ -0,0 +1,157 @@
+// Copyright 2023 Google LLC
+//
+// 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 credsfile
+
+import (
+ "encoding/json"
+)
+
+// Config3LO is the internals of a client creds file.
+type Config3LO struct {
+ ClientID string `json:"client_id"`
+ ClientSecret string `json:"client_secret"`
+ RedirectURIs []string `json:"redirect_uris"`
+ AuthURI string `json:"auth_uri"`
+ TokenURI string `json:"token_uri"`
+}
+
+// ClientCredentialsFile representation.
+type ClientCredentialsFile struct {
+ Web *Config3LO `json:"web"`
+ Installed *Config3LO `json:"installed"`
+ UniverseDomain string `json:"universe_domain"`
+}
+
+// ServiceAccountFile representation.
+type ServiceAccountFile struct {
+ Type string `json:"type"`
+ ProjectID string `json:"project_id"`
+ PrivateKeyID string `json:"private_key_id"`
+ PrivateKey string `json:"private_key"`
+ ClientEmail string `json:"client_email"`
+ ClientID string `json:"client_id"`
+ AuthURL string `json:"auth_uri"`
+ TokenURL string `json:"token_uri"`
+ UniverseDomain string `json:"universe_domain"`
+}
+
+// UserCredentialsFile representation.
+type UserCredentialsFile struct {
+ Type string `json:"type"`
+ ClientID string `json:"client_id"`
+ ClientSecret string `json:"client_secret"`
+ QuotaProjectID string `json:"quota_project_id"`
+ RefreshToken string `json:"refresh_token"`
+ UniverseDomain string `json:"universe_domain"`
+}
+
+// ExternalAccountFile representation.
+type ExternalAccountFile struct {
+ Type string `json:"type"`
+ ClientID string `json:"client_id"`
+ ClientSecret string `json:"client_secret"`
+ Audience string `json:"audience"`
+ SubjectTokenType string `json:"subject_token_type"`
+ ServiceAccountImpersonationURL string `json:"service_account_impersonation_url"`
+ TokenURL string `json:"token_url"`
+ CredentialSource *CredentialSource `json:"credential_source,omitempty"`
+ TokenInfoURL string `json:"token_info_url"`
+ ServiceAccountImpersonation *ServiceAccountImpersonationInfo `json:"service_account_impersonation,omitempty"`
+ QuotaProjectID string `json:"quota_project_id"`
+ WorkforcePoolUserProject string `json:"workforce_pool_user_project"`
+ UniverseDomain string `json:"universe_domain"`
+}
+
+// ExternalAccountAuthorizedUserFile representation.
+type ExternalAccountAuthorizedUserFile struct {
+ Type string `json:"type"`
+ Audience string `json:"audience"`
+ ClientID string `json:"client_id"`
+ ClientSecret string `json:"client_secret"`
+ RefreshToken string `json:"refresh_token"`
+ TokenURL string `json:"token_url"`
+ TokenInfoURL string `json:"token_info_url"`
+ RevokeURL string `json:"revoke_url"`
+ QuotaProjectID string `json:"quota_project_id"`
+ UniverseDomain string `json:"universe_domain"`
+}
+
+// CredentialSource stores the information necessary to retrieve the credentials for the STS exchange.
+//
+// One field amongst File, URL, Certificate, and Executable should be filled, depending on the kind of credential in question.
+// The EnvironmentID should start with AWS if being used for an AWS credential.
+type CredentialSource struct {
+ File string `json:"file"`
+ URL string `json:"url"`
+ Headers map[string]string `json:"headers"`
+ Executable *ExecutableConfig `json:"executable,omitempty"`
+ Certificate *CertificateConfig `json:"certificate"`
+ EnvironmentID string `json:"environment_id"` // TODO: Make type for this
+ RegionURL string `json:"region_url"`
+ RegionalCredVerificationURL string `json:"regional_cred_verification_url"`
+ CredVerificationURL string `json:"cred_verification_url"`
+ IMDSv2SessionTokenURL string `json:"imdsv2_session_token_url"`
+ Format *Format `json:"format,omitempty"`
+}
+
+// Format describes the format of a [CredentialSource].
+type Format struct {
+ // Type is either "text" or "json". When not provided "text" type is assumed.
+ Type string `json:"type"`
+ // SubjectTokenFieldName is only required for JSON format. This would be "access_token" for azure.
+ SubjectTokenFieldName string `json:"subject_token_field_name"`
+}
+
+// ExecutableConfig represents the command to run for an executable
+// [CredentialSource].
+type ExecutableConfig struct {
+ Command string `json:"command"`
+ TimeoutMillis int `json:"timeout_millis"`
+ OutputFile string `json:"output_file"`
+}
+
+// CertificateConfig represents the options used to set up X509 based workload
+// [CredentialSource]
+type CertificateConfig struct {
+ UseDefaultCertificateConfig bool `json:"use_default_certificate_config"`
+ CertificateConfigLocation string `json:"certificate_config_location"`
+}
+
+// ServiceAccountImpersonationInfo has impersonation configuration.
+type ServiceAccountImpersonationInfo struct {
+ TokenLifetimeSeconds int `json:"token_lifetime_seconds"`
+}
+
+// ImpersonatedServiceAccountFile representation.
+type ImpersonatedServiceAccountFile struct {
+ Type string `json:"type"`
+ ServiceAccountImpersonationURL string `json:"service_account_impersonation_url"`
+ Delegates []string `json:"delegates"`
+ CredSource json.RawMessage `json:"source_credentials"`
+ UniverseDomain string `json:"universe_domain"`
+}
+
+// GDCHServiceAccountFile represents the Google Distributed Cloud Hosted (GDCH) service identity file.
+type GDCHServiceAccountFile struct {
+ Type string `json:"type"`
+ FormatVersion string `json:"format_version"`
+ Project string `json:"project"`
+ Name string `json:"name"`
+ CertPath string `json:"ca_cert_path"`
+ PrivateKeyID string `json:"private_key_id"`
+ PrivateKey string `json:"private_key"`
+ TokenURL string `json:"token_uri"`
+ UniverseDomain string `json:"universe_domain"`
+}
diff --git a/vendor/cloud.google.com/go/auth/internal/credsfile/parse.go b/vendor/cloud.google.com/go/auth/internal/credsfile/parse.go
new file mode 100644
index 00000000..a02b9f5d
--- /dev/null
+++ b/vendor/cloud.google.com/go/auth/internal/credsfile/parse.go
@@ -0,0 +1,98 @@
+// Copyright 2023 Google LLC
+//
+// 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 credsfile
+
+import (
+ "encoding/json"
+)
+
+// ParseServiceAccount parses bytes into a [ServiceAccountFile].
+func ParseServiceAccount(b []byte) (*ServiceAccountFile, error) {
+ var f *ServiceAccountFile
+ if err := json.Unmarshal(b, &f); err != nil {
+ return nil, err
+ }
+ return f, nil
+}
+
+// ParseClientCredentials parses bytes into a
+// [credsfile.ClientCredentialsFile].
+func ParseClientCredentials(b []byte) (*ClientCredentialsFile, error) {
+ var f *ClientCredentialsFile
+ if err := json.Unmarshal(b, &f); err != nil {
+ return nil, err
+ }
+ return f, nil
+}
+
+// ParseUserCredentials parses bytes into a [UserCredentialsFile].
+func ParseUserCredentials(b []byte) (*UserCredentialsFile, error) {
+ var f *UserCredentialsFile
+ if err := json.Unmarshal(b, &f); err != nil {
+ return nil, err
+ }
+ return f, nil
+}
+
+// ParseExternalAccount parses bytes into a [ExternalAccountFile].
+func ParseExternalAccount(b []byte) (*ExternalAccountFile, error) {
+ var f *ExternalAccountFile
+ if err := json.Unmarshal(b, &f); err != nil {
+ return nil, err
+ }
+ return f, nil
+}
+
+// ParseExternalAccountAuthorizedUser parses bytes into a
+// [ExternalAccountAuthorizedUserFile].
+func ParseExternalAccountAuthorizedUser(b []byte) (*ExternalAccountAuthorizedUserFile, error) {
+ var f *ExternalAccountAuthorizedUserFile
+ if err := json.Unmarshal(b, &f); err != nil {
+ return nil, err
+ }
+ return f, nil
+}
+
+// ParseImpersonatedServiceAccount parses bytes into a
+// [ImpersonatedServiceAccountFile].
+func ParseImpersonatedServiceAccount(b []byte) (*ImpersonatedServiceAccountFile, error) {
+ var f *ImpersonatedServiceAccountFile
+ if err := json.Unmarshal(b, &f); err != nil {
+ return nil, err
+ }
+ return f, nil
+}
+
+// ParseGDCHServiceAccount parses bytes into a [GDCHServiceAccountFile].
+func ParseGDCHServiceAccount(b []byte) (*GDCHServiceAccountFile, error) {
+ var f *GDCHServiceAccountFile
+ if err := json.Unmarshal(b, &f); err != nil {
+ return nil, err
+ }
+ return f, nil
+}
+
+type fileTypeChecker struct {
+ Type string `json:"type"`
+}
+
+// ParseFileType determines the [CredentialType] based on bytes provided.
+func ParseFileType(b []byte) (CredentialType, error) {
+ var f fileTypeChecker
+ if err := json.Unmarshal(b, &f); err != nil {
+ return 0, err
+ }
+ return parseCredentialType(f.Type), nil
+}
diff --git a/vendor/cloud.google.com/go/auth/internal/internal.go b/vendor/cloud.google.com/go/auth/internal/internal.go
new file mode 100644
index 00000000..d8c16119
--- /dev/null
+++ b/vendor/cloud.google.com/go/auth/internal/internal.go
@@ -0,0 +1,216 @@
+// Copyright 2023 Google LLC
+//
+// 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 internal
+
+import (
+ "context"
+ "crypto/rsa"
+ "crypto/x509"
+ "encoding/json"
+ "encoding/pem"
+ "errors"
+ "fmt"
+ "io"
+ "net/http"
+ "os"
+ "sync"
+ "time"
+
+ "cloud.google.com/go/compute/metadata"
+)
+
+const (
+ // TokenTypeBearer is the auth header prefix for bearer tokens.
+ TokenTypeBearer = "Bearer"
+
+ // QuotaProjectEnvVar is the environment variable for setting the quota
+ // project.
+ QuotaProjectEnvVar = "GOOGLE_CLOUD_QUOTA_PROJECT"
+ // UniverseDomainEnvVar is the environment variable for setting the default
+ // service domain for a given Cloud universe.
+ UniverseDomainEnvVar = "GOOGLE_CLOUD_UNIVERSE_DOMAIN"
+ projectEnvVar = "GOOGLE_CLOUD_PROJECT"
+ maxBodySize = 1 << 20
+
+ // DefaultUniverseDomain is the default value for universe domain.
+ // Universe domain is the default service domain for a given Cloud universe.
+ DefaultUniverseDomain = "googleapis.com"
+)
+
+type clonableTransport interface {
+ Clone() *http.Transport
+}
+
+// DefaultClient returns an [http.Client] with some defaults set. If
+// the current [http.DefaultTransport] is a [clonableTransport], as
+// is the case for an [*http.Transport], the clone will be used.
+// Otherwise the [http.DefaultTransport] is used directly.
+func DefaultClient() *http.Client {
+ if transport, ok := http.DefaultTransport.(clonableTransport); ok {
+ return &http.Client{
+ Transport: transport.Clone(),
+ Timeout: 30 * time.Second,
+ }
+ }
+
+ return &http.Client{
+ Transport: http.DefaultTransport,
+ Timeout: 30 * time.Second,
+ }
+}
+
+// ParseKey converts the binary contents of a private key file
+// to an *rsa.PrivateKey. It detects whether the private key is in a
+// PEM container or not. If so, it extracts the the private key
+// from PEM container before conversion. It only supports PEM
+// containers with no passphrase.
+func ParseKey(key []byte) (*rsa.PrivateKey, error) {
+ block, _ := pem.Decode(key)
+ if block != nil {
+ key = block.Bytes
+ }
+ parsedKey, err := x509.ParsePKCS8PrivateKey(key)
+ if err != nil {
+ parsedKey, err = x509.ParsePKCS1PrivateKey(key)
+ if err != nil {
+ return nil, fmt.Errorf("private key should be a PEM or plain PKCS1 or PKCS8: %w", err)
+ }
+ }
+ parsed, ok := parsedKey.(*rsa.PrivateKey)
+ if !ok {
+ return nil, errors.New("private key is invalid")
+ }
+ return parsed, nil
+}
+
+// GetQuotaProject retrieves quota project with precedence being: override,
+// environment variable, creds json file.
+func GetQuotaProject(b []byte, override string) string {
+ if override != "" {
+ return override
+ }
+ if env := os.Getenv(QuotaProjectEnvVar); env != "" {
+ return env
+ }
+ if b == nil {
+ return ""
+ }
+ var v struct {
+ QuotaProject string `json:"quota_project_id"`
+ }
+ if err := json.Unmarshal(b, &v); err != nil {
+ return ""
+ }
+ return v.QuotaProject
+}
+
+// GetProjectID retrieves project with precedence being: override,
+// environment variable, creds json file.
+func GetProjectID(b []byte, override string) string {
+ if override != "" {
+ return override
+ }
+ if env := os.Getenv(projectEnvVar); env != "" {
+ return env
+ }
+ if b == nil {
+ return ""
+ }
+ var v struct {
+ ProjectID string `json:"project_id"` // standard service account key
+ Project string `json:"project"` // gdch key
+ }
+ if err := json.Unmarshal(b, &v); err != nil {
+ return ""
+ }
+ if v.ProjectID != "" {
+ return v.ProjectID
+ }
+ return v.Project
+}
+
+// DoRequest executes the provided req with the client. It reads the response
+// body, closes it, and returns it.
+func DoRequest(client *http.Client, req *http.Request) (*http.Response, []byte, error) {
+ resp, err := client.Do(req)
+ if err != nil {
+ return nil, nil, err
+ }
+ defer resp.Body.Close()
+ body, err := ReadAll(io.LimitReader(resp.Body, maxBodySize))
+ if err != nil {
+ return nil, nil, err
+ }
+ return resp, body, nil
+}
+
+// ReadAll consumes the whole reader and safely reads the content of its body
+// with some overflow protection.
+func ReadAll(r io.Reader) ([]byte, error) {
+ return io.ReadAll(io.LimitReader(r, maxBodySize))
+}
+
+// StaticCredentialsProperty is a helper for creating static credentials
+// properties.
+func StaticCredentialsProperty(s string) StaticProperty {
+ return StaticProperty(s)
+}
+
+// StaticProperty always returns that value of the underlying string.
+type StaticProperty string
+
+// GetProperty loads the properly value provided the given context.
+func (p StaticProperty) GetProperty(context.Context) (string, error) {
+ return string(p), nil
+}
+
+// ComputeUniverseDomainProvider fetches the credentials universe domain from
+// the google cloud metadata service.
+type ComputeUniverseDomainProvider struct {
+ universeDomainOnce sync.Once
+ universeDomain string
+ universeDomainErr error
+}
+
+// GetProperty fetches the credentials universe domain from the google cloud
+// metadata service.
+func (c *ComputeUniverseDomainProvider) GetProperty(ctx context.Context) (string, error) {
+ c.universeDomainOnce.Do(func() {
+ c.universeDomain, c.universeDomainErr = getMetadataUniverseDomain(ctx)
+ })
+ if c.universeDomainErr != nil {
+ return "", c.universeDomainErr
+ }
+ return c.universeDomain, nil
+}
+
+// httpGetMetadataUniverseDomain is a package var for unit test substitution.
+var httpGetMetadataUniverseDomain = func(ctx context.Context) (string, error) {
+ ctx, cancel := context.WithTimeout(ctx, 1*time.Second)
+ defer cancel()
+ return metadata.GetWithContext(ctx, "universe/universe-domain")
+}
+
+func getMetadataUniverseDomain(ctx context.Context) (string, error) {
+ universeDomain, err := httpGetMetadataUniverseDomain(ctx)
+ if err == nil {
+ return universeDomain, nil
+ }
+ if _, ok := err.(metadata.NotDefinedError); ok {
+ // http.StatusNotFound (404)
+ return DefaultUniverseDomain, nil
+ }
+ return "", err
+}
diff --git a/vendor/cloud.google.com/go/auth/internal/jwt/jwt.go b/vendor/cloud.google.com/go/auth/internal/jwt/jwt.go
new file mode 100644
index 00000000..dc28b3c3
--- /dev/null
+++ b/vendor/cloud.google.com/go/auth/internal/jwt/jwt.go
@@ -0,0 +1,171 @@
+// Copyright 2023 Google LLC
+//
+// 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 jwt
+
+import (
+ "bytes"
+ "crypto"
+ "crypto/rand"
+ "crypto/rsa"
+ "crypto/sha256"
+ "encoding/base64"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "strings"
+ "time"
+)
+
+const (
+ // HeaderAlgRSA256 is the RS256 [Header.Algorithm].
+ HeaderAlgRSA256 = "RS256"
+ // HeaderAlgES256 is the ES256 [Header.Algorithm].
+ HeaderAlgES256 = "ES256"
+ // HeaderType is the standard [Header.Type].
+ HeaderType = "JWT"
+)
+
+// Header represents a JWT header.
+type Header struct {
+ Algorithm string `json:"alg"`
+ Type string `json:"typ"`
+ KeyID string `json:"kid"`
+}
+
+func (h *Header) encode() (string, error) {
+ b, err := json.Marshal(h)
+ if err != nil {
+ return "", err
+ }
+ return base64.RawURLEncoding.EncodeToString(b), nil
+}
+
+// Claims represents the claims set of a JWT.
+type Claims struct {
+ // Iss is the issuer JWT claim.
+ Iss string `json:"iss"`
+ // Scope is the scope JWT claim.
+ Scope string `json:"scope,omitempty"`
+ // Exp is the expiry JWT claim. If unset, default is in one hour from now.
+ Exp int64 `json:"exp"`
+ // Iat is the subject issued at claim. If unset, default is now.
+ Iat int64 `json:"iat"`
+ // Aud is the audience JWT claim. Optional.
+ Aud string `json:"aud"`
+ // Sub is the subject JWT claim. Optional.
+ Sub string `json:"sub,omitempty"`
+ // AdditionalClaims contains any additional non-standard JWT claims. Optional.
+ AdditionalClaims map[string]interface{} `json:"-"`
+}
+
+func (c *Claims) encode() (string, error) {
+ // Compensate for skew
+ now := time.Now().Add(-10 * time.Second)
+ if c.Iat == 0 {
+ c.Iat = now.Unix()
+ }
+ if c.Exp == 0 {
+ c.Exp = now.Add(time.Hour).Unix()
+ }
+ if c.Exp < c.Iat {
+ return "", fmt.Errorf("jwt: invalid Exp = %d; must be later than Iat = %d", c.Exp, c.Iat)
+ }
+
+ b, err := json.Marshal(c)
+ if err != nil {
+ return "", err
+ }
+
+ if len(c.AdditionalClaims) == 0 {
+ return base64.RawURLEncoding.EncodeToString(b), nil
+ }
+
+ // Marshal private claim set and then append it to b.
+ prv, err := json.Marshal(c.AdditionalClaims)
+ if err != nil {
+ return "", fmt.Errorf("invalid map of additional claims %v: %w", c.AdditionalClaims, err)
+ }
+
+ // Concatenate public and private claim JSON objects.
+ if !bytes.HasSuffix(b, []byte{'}'}) {
+ return "", fmt.Errorf("invalid JSON %s", b)
+ }
+ if !bytes.HasPrefix(prv, []byte{'{'}) {
+ return "", fmt.Errorf("invalid JSON %s", prv)
+ }
+ b[len(b)-1] = ',' // Replace closing curly brace with a comma.
+ b = append(b, prv[1:]...) // Append private claims.
+ return base64.RawURLEncoding.EncodeToString(b), nil
+}
+
+// EncodeJWS encodes the data using the provided key as a JSON web signature.
+func EncodeJWS(header *Header, c *Claims, key *rsa.PrivateKey) (string, error) {
+ head, err := header.encode()
+ if err != nil {
+ return "", err
+ }
+ claims, err := c.encode()
+ if err != nil {
+ return "", err
+ }
+ ss := fmt.Sprintf("%s.%s", head, claims)
+ h := sha256.New()
+ h.Write([]byte(ss))
+ sig, err := rsa.SignPKCS1v15(rand.Reader, key, crypto.SHA256, h.Sum(nil))
+ if err != nil {
+ return "", err
+ }
+ return fmt.Sprintf("%s.%s", ss, base64.RawURLEncoding.EncodeToString(sig)), nil
+}
+
+// DecodeJWS decodes a claim set from a JWS payload.
+func DecodeJWS(payload string) (*Claims, error) {
+ // decode returned id token to get expiry
+ s := strings.Split(payload, ".")
+ if len(s) < 2 {
+ return nil, errors.New("invalid token received")
+ }
+ decoded, err := base64.RawURLEncoding.DecodeString(s[1])
+ if err != nil {
+ return nil, err
+ }
+ c := &Claims{}
+ if err := json.NewDecoder(bytes.NewBuffer(decoded)).Decode(c); err != nil {
+ return nil, err
+ }
+ if err := json.NewDecoder(bytes.NewBuffer(decoded)).Decode(&c.AdditionalClaims); err != nil {
+ return nil, err
+ }
+ return c, err
+}
+
+// VerifyJWS tests whether the provided JWT token's signature was produced by
+// the private key associated with the provided public key.
+func VerifyJWS(token string, key *rsa.PublicKey) error {
+ parts := strings.Split(token, ".")
+ if len(parts) != 3 {
+ return errors.New("jwt: invalid token received, token must have 3 parts")
+ }
+
+ signedContent := parts[0] + "." + parts[1]
+ signatureString, err := base64.RawURLEncoding.DecodeString(parts[2])
+ if err != nil {
+ return err
+ }
+
+ h := sha256.New()
+ h.Write([]byte(signedContent))
+ return rsa.VerifyPKCS1v15(key, crypto.SHA256, h.Sum(nil), signatureString)
+}
diff --git a/vendor/cloud.google.com/go/auth/internal/transport/cba.go b/vendor/cloud.google.com/go/auth/internal/transport/cba.go
new file mode 100644
index 00000000..c879611a
--- /dev/null
+++ b/vendor/cloud.google.com/go/auth/internal/transport/cba.go
@@ -0,0 +1,366 @@
+// Copyright 2023 Google LLC
+//
+// 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 transport
+
+import (
+ "context"
+ "crypto/tls"
+ "crypto/x509"
+ "errors"
+ "log"
+ "net"
+ "net/http"
+ "net/url"
+ "os"
+ "strconv"
+ "strings"
+
+ "cloud.google.com/go/auth/internal"
+ "cloud.google.com/go/auth/internal/transport/cert"
+ "github.com/google/s2a-go"
+ "github.com/google/s2a-go/fallback"
+ "google.golang.org/grpc/credentials"
+)
+
+const (
+ mTLSModeAlways = "always"
+ mTLSModeNever = "never"
+ mTLSModeAuto = "auto"
+
+ // Experimental: if true, the code will try MTLS with S2A as the default for transport security. Default value is false.
+ googleAPIUseS2AEnv = "EXPERIMENTAL_GOOGLE_API_USE_S2A"
+ googleAPIUseCertSource = "GOOGLE_API_USE_CLIENT_CERTIFICATE"
+ googleAPIUseMTLS = "GOOGLE_API_USE_MTLS_ENDPOINT"
+ googleAPIUseMTLSOld = "GOOGLE_API_USE_MTLS"
+
+ universeDomainPlaceholder = "UNIVERSE_DOMAIN"
+
+ mtlsMDSRoot = "/run/google-mds-mtls/root.crt"
+ mtlsMDSKey = "/run/google-mds-mtls/client.key"
+)
+
+// Options is a struct that is duplicated information from the individual
+// transport packages in order to avoid cyclic deps. It correlates 1:1 with
+// fields on httptransport.Options and grpctransport.Options.
+type Options struct {
+ Endpoint string
+ DefaultEndpointTemplate string
+ DefaultMTLSEndpoint string
+ ClientCertProvider cert.Provider
+ Client *http.Client
+ UniverseDomain string
+ EnableDirectPath bool
+ EnableDirectPathXds bool
+}
+
+// getUniverseDomain returns the default service domain for a given Cloud
+// universe.
+func (o *Options) getUniverseDomain() string {
+ if o.UniverseDomain == "" {
+ return internal.DefaultUniverseDomain
+ }
+ return o.UniverseDomain
+}
+
+// isUniverseDomainGDU returns true if the universe domain is the default Google
+// universe.
+func (o *Options) isUniverseDomainGDU() bool {
+ return o.getUniverseDomain() == internal.DefaultUniverseDomain
+}
+
+// defaultEndpoint returns the DefaultEndpointTemplate merged with the
+// universe domain if the DefaultEndpointTemplate is set, otherwise returns an
+// empty string.
+func (o *Options) defaultEndpoint() string {
+ if o.DefaultEndpointTemplate == "" {
+ return ""
+ }
+ return strings.Replace(o.DefaultEndpointTemplate, universeDomainPlaceholder, o.getUniverseDomain(), 1)
+}
+
+// defaultMTLSEndpoint returns the DefaultMTLSEndpointTemplate merged with the
+// universe domain if the DefaultMTLSEndpointTemplate is set, otherwise returns an
+// empty string.
+func (o *Options) defaultMTLSEndpoint() string {
+ if o.DefaultMTLSEndpoint == "" {
+ return ""
+ }
+ return strings.Replace(o.DefaultMTLSEndpoint, universeDomainPlaceholder, o.getUniverseDomain(), 1)
+}
+
+// mergedEndpoint merges a user-provided Endpoint of format host[:port] with the
+// default endpoint.
+func (o *Options) mergedEndpoint() (string, error) {
+ defaultEndpoint := o.defaultEndpoint()
+ u, err := url.Parse(fixScheme(defaultEndpoint))
+ if err != nil {
+ return "", err
+ }
+ return strings.Replace(defaultEndpoint, u.Host, o.Endpoint, 1), nil
+}
+
+func fixScheme(baseURL string) string {
+ if !strings.Contains(baseURL, "://") {
+ baseURL = "https://" + baseURL
+ }
+ return baseURL
+}
+
+// GetGRPCTransportCredsAndEndpoint returns an instance of
+// [google.golang.org/grpc/credentials.TransportCredentials], and the
+// corresponding endpoint to use for GRPC client.
+func GetGRPCTransportCredsAndEndpoint(opts *Options) (credentials.TransportCredentials, string, error) {
+ config, err := getTransportConfig(opts)
+ if err != nil {
+ return nil, "", err
+ }
+
+ defaultTransportCreds := credentials.NewTLS(&tls.Config{
+ GetClientCertificate: config.clientCertSource,
+ })
+
+ var s2aAddr string
+ var transportCredsForS2A credentials.TransportCredentials
+
+ if config.mtlsS2AAddress != "" {
+ s2aAddr = config.mtlsS2AAddress
+ transportCredsForS2A, err = loadMTLSMDSTransportCreds(mtlsMDSRoot, mtlsMDSKey)
+ if err != nil {
+ log.Printf("Loading MTLS MDS credentials failed: %v", err)
+ if config.s2aAddress != "" {
+ s2aAddr = config.s2aAddress
+ } else {
+ return defaultTransportCreds, config.endpoint, nil
+ }
+ }
+ } else if config.s2aAddress != "" {
+ s2aAddr = config.s2aAddress
+ } else {
+ return defaultTransportCreds, config.endpoint, nil
+ }
+
+ var fallbackOpts *s2a.FallbackOptions
+ // In case of S2A failure, fall back to the endpoint that would've been used without S2A.
+ if fallbackHandshake, err := fallback.DefaultFallbackClientHandshakeFunc(config.endpoint); err == nil {
+ fallbackOpts = &s2a.FallbackOptions{
+ FallbackClientHandshakeFunc: fallbackHandshake,
+ }
+ }
+
+ s2aTransportCreds, err := s2a.NewClientCreds(&s2a.ClientOptions{
+ S2AAddress: s2aAddr,
+ TransportCreds: transportCredsForS2A,
+ FallbackOpts: fallbackOpts,
+ })
+ if err != nil {
+ // Use default if we cannot initialize S2A client transport credentials.
+ return defaultTransportCreds, config.endpoint, nil
+ }
+ return s2aTransportCreds, config.s2aMTLSEndpoint, nil
+}
+
+// GetHTTPTransportConfig returns a client certificate source and a function for
+// dialing MTLS with S2A.
+func GetHTTPTransportConfig(opts *Options) (cert.Provider, func(context.Context, string, string) (net.Conn, error), error) {
+ config, err := getTransportConfig(opts)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ var s2aAddr string
+ var transportCredsForS2A credentials.TransportCredentials
+
+ if config.mtlsS2AAddress != "" {
+ s2aAddr = config.mtlsS2AAddress
+ transportCredsForS2A, err = loadMTLSMDSTransportCreds(mtlsMDSRoot, mtlsMDSKey)
+ if err != nil {
+ log.Printf("Loading MTLS MDS credentials failed: %v", err)
+ if config.s2aAddress != "" {
+ s2aAddr = config.s2aAddress
+ } else {
+ return config.clientCertSource, nil, nil
+ }
+ }
+ } else if config.s2aAddress != "" {
+ s2aAddr = config.s2aAddress
+ } else {
+ return config.clientCertSource, nil, nil
+ }
+
+ var fallbackOpts *s2a.FallbackOptions
+ // In case of S2A failure, fall back to the endpoint that would've been used without S2A.
+ if fallbackURL, err := url.Parse(config.endpoint); err == nil {
+ if fallbackDialer, fallbackServerAddr, err := fallback.DefaultFallbackDialerAndAddress(fallbackURL.Hostname()); err == nil {
+ fallbackOpts = &s2a.FallbackOptions{
+ FallbackDialer: &s2a.FallbackDialer{
+ Dialer: fallbackDialer,
+ ServerAddr: fallbackServerAddr,
+ },
+ }
+ }
+ }
+
+ dialTLSContextFunc := s2a.NewS2ADialTLSContextFunc(&s2a.ClientOptions{
+ S2AAddress: s2aAddr,
+ TransportCreds: transportCredsForS2A,
+ FallbackOpts: fallbackOpts,
+ })
+ return nil, dialTLSContextFunc, nil
+}
+
+func loadMTLSMDSTransportCreds(mtlsMDSRootFile, mtlsMDSKeyFile string) (credentials.TransportCredentials, error) {
+ rootPEM, err := os.ReadFile(mtlsMDSRootFile)
+ if err != nil {
+ return nil, err
+ }
+ caCertPool := x509.NewCertPool()
+ ok := caCertPool.AppendCertsFromPEM(rootPEM)
+ if !ok {
+ return nil, errors.New("failed to load MTLS MDS root certificate")
+ }
+ // The mTLS MDS credentials are formatted as the concatenation of a PEM-encoded certificate chain
+ // followed by a PEM-encoded private key. For this reason, the concatenation is passed in to the
+ // tls.X509KeyPair function as both the certificate chain and private key arguments.
+ cert, err := tls.LoadX509KeyPair(mtlsMDSKeyFile, mtlsMDSKeyFile)
+ if err != nil {
+ return nil, err
+ }
+ tlsConfig := tls.Config{
+ RootCAs: caCertPool,
+ Certificates: []tls.Certificate{cert},
+ MinVersion: tls.VersionTLS13,
+ }
+ return credentials.NewTLS(&tlsConfig), nil
+}
+
+func getTransportConfig(opts *Options) (*transportConfig, error) {
+ clientCertSource, err := GetClientCertificateProvider(opts)
+ if err != nil {
+ return nil, err
+ }
+ endpoint, err := getEndpoint(opts, clientCertSource)
+ if err != nil {
+ return nil, err
+ }
+ defaultTransportConfig := transportConfig{
+ clientCertSource: clientCertSource,
+ endpoint: endpoint,
+ }
+
+ if !shouldUseS2A(clientCertSource, opts) {
+ return &defaultTransportConfig, nil
+ }
+
+ s2aAddress := GetS2AAddress()
+ mtlsS2AAddress := GetMTLSS2AAddress()
+ if s2aAddress == "" && mtlsS2AAddress == "" {
+ return &defaultTransportConfig, nil
+ }
+ return &transportConfig{
+ clientCertSource: clientCertSource,
+ endpoint: endpoint,
+ s2aAddress: s2aAddress,
+ mtlsS2AAddress: mtlsS2AAddress,
+ s2aMTLSEndpoint: opts.defaultMTLSEndpoint(),
+ }, nil
+}
+
+// GetClientCertificateProvider returns a default client certificate source, if
+// not provided by the user.
+//
+// A nil default source can be returned if the source does not exist. Any exceptions
+// encountered while initializing the default source will be reported as client
+// error (ex. corrupt metadata file).
+func GetClientCertificateProvider(opts *Options) (cert.Provider, error) {
+ if !isClientCertificateEnabled(opts) {
+ return nil, nil
+ } else if opts.ClientCertProvider != nil {
+ return opts.ClientCertProvider, nil
+ }
+ return cert.DefaultProvider()
+
+}
+
+// isClientCertificateEnabled returns true by default for all GDU universe domain, unless explicitly overridden by env var
+func isClientCertificateEnabled(opts *Options) bool {
+ if value, ok := os.LookupEnv(googleAPIUseCertSource); ok {
+ // error as false is OK
+ b, _ := strconv.ParseBool(value)
+ return b
+ }
+ return opts.isUniverseDomainGDU()
+}
+
+type transportConfig struct {
+ // The client certificate source.
+ clientCertSource cert.Provider
+ // The corresponding endpoint to use based on client certificate source.
+ endpoint string
+ // The plaintext S2A address if it can be used, otherwise an empty string.
+ s2aAddress string
+ // The MTLS S2A address if it can be used, otherwise an empty string.
+ mtlsS2AAddress string
+ // The MTLS endpoint to use with S2A.
+ s2aMTLSEndpoint string
+}
+
+// getEndpoint returns the endpoint for the service, taking into account the
+// user-provided endpoint override "settings.Endpoint".
+//
+// If no endpoint override is specified, we will either return the default
+// endpoint or the default mTLS endpoint if a client certificate is available.
+//
+// You can override the default endpoint choice (mTLS vs. regular) by setting
+// the GOOGLE_API_USE_MTLS_ENDPOINT environment variable.
+//
+// If the endpoint override is an address (host:port) rather than full base
+// URL (ex. https://...), then the user-provided address will be merged into
+// the default endpoint. For example, WithEndpoint("myhost:8000") and
+// DefaultEndpointTemplate("https://UNIVERSE_DOMAIN/bar/baz") will return
+// "https://myhost:8080/bar/baz". Note that this does not apply to the mTLS
+// endpoint.
+func getEndpoint(opts *Options, clientCertSource cert.Provider) (string, error) {
+ if opts.Endpoint == "" {
+ mtlsMode := getMTLSMode()
+ if mtlsMode == mTLSModeAlways || (clientCertSource != nil && mtlsMode == mTLSModeAuto) {
+ return opts.defaultMTLSEndpoint(), nil
+ }
+ return opts.defaultEndpoint(), nil
+ }
+ if strings.Contains(opts.Endpoint, "://") {
+ // User passed in a full URL path, use it verbatim.
+ return opts.Endpoint, nil
+ }
+ if opts.defaultEndpoint() == "" {
+ // If DefaultEndpointTemplate is not configured,
+ // use the user provided endpoint verbatim. This allows a naked
+ // "host[:port]" URL to be used with GRPC Direct Path.
+ return opts.Endpoint, nil
+ }
+
+ // Assume user-provided endpoint is host[:port], merge it with the default endpoint.
+ return opts.mergedEndpoint()
+}
+
+func getMTLSMode() string {
+ mode := os.Getenv(googleAPIUseMTLS)
+ if mode == "" {
+ mode = os.Getenv(googleAPIUseMTLSOld) // Deprecated.
+ }
+ if mode == "" {
+ return mTLSModeAuto
+ }
+ return strings.ToLower(mode)
+}
diff --git a/vendor/cloud.google.com/go/auth/internal/transport/cert/default_cert.go b/vendor/cloud.google.com/go/auth/internal/transport/cert/default_cert.go
new file mode 100644
index 00000000..5cedc50f
--- /dev/null
+++ b/vendor/cloud.google.com/go/auth/internal/transport/cert/default_cert.go
@@ -0,0 +1,65 @@
+// Copyright 2023 Google LLC
+//
+// 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 cert
+
+import (
+ "crypto/tls"
+ "errors"
+ "sync"
+)
+
+// defaultCertData holds all the variables pertaining to
+// the default certificate provider created by [DefaultProvider].
+//
+// A singleton model is used to allow the provider to be reused
+// by the transport layer. As mentioned in [DefaultProvider] (provider nil, nil)
+// may be returned to indicate a default provider could not be found, which
+// will skip extra tls config in the transport layer .
+type defaultCertData struct {
+ once sync.Once
+ provider Provider
+ err error
+}
+
+var (
+ defaultCert defaultCertData
+)
+
+// Provider is a function that can be passed into crypto/tls.Config.GetClientCertificate.
+type Provider func(*tls.CertificateRequestInfo) (*tls.Certificate, error)
+
+// errSourceUnavailable is a sentinel error to indicate certificate source is unavailable.
+var errSourceUnavailable = errors.New("certificate source is unavailable")
+
+// DefaultProvider returns a certificate source using the preferred EnterpriseCertificateProxySource.
+// If EnterpriseCertificateProxySource is not available, fall back to the legacy SecureConnectSource.
+//
+// If neither source is available (due to missing configurations), a nil Source and a nil Error are
+// returned to indicate that a default certificate source is unavailable.
+func DefaultProvider() (Provider, error) {
+ defaultCert.once.Do(func() {
+ defaultCert.provider, defaultCert.err = NewWorkloadX509CertProvider("")
+ if errors.Is(defaultCert.err, errSourceUnavailable) {
+ defaultCert.provider, defaultCert.err = NewEnterpriseCertificateProxyProvider("")
+ if errors.Is(defaultCert.err, errSourceUnavailable) {
+ defaultCert.provider, defaultCert.err = NewSecureConnectProvider("")
+ if errors.Is(defaultCert.err, errSourceUnavailable) {
+ defaultCert.provider, defaultCert.err = nil, nil
+ }
+ }
+ }
+ })
+ return defaultCert.provider, defaultCert.err
+}
diff --git a/vendor/cloud.google.com/go/auth/internal/transport/cert/enterprise_cert.go b/vendor/cloud.google.com/go/auth/internal/transport/cert/enterprise_cert.go
new file mode 100644
index 00000000..6c954ae1
--- /dev/null
+++ b/vendor/cloud.google.com/go/auth/internal/transport/cert/enterprise_cert.go
@@ -0,0 +1,54 @@
+// Copyright 2023 Google LLC
+//
+// 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 cert
+
+import (
+ "crypto/tls"
+
+ "github.com/googleapis/enterprise-certificate-proxy/client"
+)
+
+type ecpSource struct {
+ key *client.Key
+}
+
+// NewEnterpriseCertificateProxyProvider creates a certificate source
+// using the Enterprise Certificate Proxy client, which delegates
+// certifcate related operations to an OS-specific "signer binary"
+// that communicates with the native keystore (ex. keychain on MacOS).
+//
+// The configFilePath points to a config file containing relevant parameters
+// such as the certificate issuer and the location of the signer binary.
+// If configFilePath is empty, the client will attempt to load the config from
+// a well-known gcloud location.
+func NewEnterpriseCertificateProxyProvider(configFilePath string) (Provider, error) {
+ key, err := client.Cred(configFilePath)
+ if err != nil {
+ // TODO(codyoss): once this is fixed upstream can handle this error a
+ // little better here. But be safe for now and assume unavailable.
+ return nil, errSourceUnavailable
+ }
+
+ return (&ecpSource{
+ key: key,
+ }).getClientCertificate, nil
+}
+
+func (s *ecpSource) getClientCertificate(info *tls.CertificateRequestInfo) (*tls.Certificate, error) {
+ var cert tls.Certificate
+ cert.PrivateKey = s.key
+ cert.Certificate = s.key.CertificateChain()
+ return &cert, nil
+}
diff --git a/vendor/cloud.google.com/go/auth/internal/transport/cert/secureconnect_cert.go b/vendor/cloud.google.com/go/auth/internal/transport/cert/secureconnect_cert.go
new file mode 100644
index 00000000..738cb216
--- /dev/null
+++ b/vendor/cloud.google.com/go/auth/internal/transport/cert/secureconnect_cert.go
@@ -0,0 +1,124 @@
+// Copyright 2023 Google LLC
+//
+// 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 cert
+
+import (
+ "crypto/tls"
+ "crypto/x509"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "os"
+ "os/exec"
+ "os/user"
+ "path/filepath"
+ "sync"
+ "time"
+)
+
+const (
+ metadataPath = ".secureConnect"
+ metadataFile = "context_aware_metadata.json"
+)
+
+type secureConnectSource struct {
+ metadata secureConnectMetadata
+
+ // Cache the cert to avoid executing helper command repeatedly.
+ cachedCertMutex sync.Mutex
+ cachedCert *tls.Certificate
+}
+
+type secureConnectMetadata struct {
+ Cmd []string `json:"cert_provider_command"`
+}
+
+// NewSecureConnectProvider creates a certificate source using
+// the Secure Connect Helper and its associated metadata file.
+//
+// The configFilePath points to the location of the context aware metadata file.
+// If configFilePath is empty, use the default context aware metadata location.
+func NewSecureConnectProvider(configFilePath string) (Provider, error) {
+ if configFilePath == "" {
+ user, err := user.Current()
+ if err != nil {
+ // Error locating the default config means Secure Connect is not supported.
+ return nil, errSourceUnavailable
+ }
+ configFilePath = filepath.Join(user.HomeDir, metadataPath, metadataFile)
+ }
+
+ file, err := os.ReadFile(configFilePath)
+ if err != nil {
+ // Config file missing means Secure Connect is not supported.
+ // There are non-os.ErrNotExist errors that may be returned.
+ // (e.g. if the home directory is /dev/null, *nix systems will
+ // return ENOTDIR instead of ENOENT)
+ return nil, errSourceUnavailable
+ }
+
+ var metadata secureConnectMetadata
+ if err := json.Unmarshal(file, &metadata); err != nil {
+ return nil, fmt.Errorf("cert: could not parse JSON in %q: %w", configFilePath, err)
+ }
+ if err := validateMetadata(metadata); err != nil {
+ return nil, fmt.Errorf("cert: invalid config in %q: %w", configFilePath, err)
+ }
+ return (&secureConnectSource{
+ metadata: metadata,
+ }).getClientCertificate, nil
+}
+
+func validateMetadata(metadata secureConnectMetadata) error {
+ if len(metadata.Cmd) == 0 {
+ return errors.New("empty cert_provider_command")
+ }
+ return nil
+}
+
+func (s *secureConnectSource) getClientCertificate(info *tls.CertificateRequestInfo) (*tls.Certificate, error) {
+ s.cachedCertMutex.Lock()
+ defer s.cachedCertMutex.Unlock()
+ if s.cachedCert != nil && !isCertificateExpired(s.cachedCert) {
+ return s.cachedCert, nil
+ }
+ // Expand OS environment variables in the cert provider command such as "$HOME".
+ for i := 0; i < len(s.metadata.Cmd); i++ {
+ s.metadata.Cmd[i] = os.ExpandEnv(s.metadata.Cmd[i])
+ }
+ command := s.metadata.Cmd
+ data, err := exec.Command(command[0], command[1:]...).Output()
+ if err != nil {
+ return nil, err
+ }
+ cert, err := tls.X509KeyPair(data, data)
+ if err != nil {
+ return nil, err
+ }
+ s.cachedCert = &cert
+ return &cert, nil
+}
+
+// isCertificateExpired returns true if the given cert is expired or invalid.
+func isCertificateExpired(cert *tls.Certificate) bool {
+ if len(cert.Certificate) == 0 {
+ return true
+ }
+ parsed, err := x509.ParseCertificate(cert.Certificate[0])
+ if err != nil {
+ return true
+ }
+ return time.Now().After(parsed.NotAfter)
+}
diff --git a/vendor/cloud.google.com/go/auth/internal/transport/cert/workload_cert.go b/vendor/cloud.google.com/go/auth/internal/transport/cert/workload_cert.go
new file mode 100644
index 00000000..347aaced
--- /dev/null
+++ b/vendor/cloud.google.com/go/auth/internal/transport/cert/workload_cert.go
@@ -0,0 +1,114 @@
+// Copyright 2024 Google LLC
+//
+// 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 cert
+
+import (
+ "crypto/tls"
+ "encoding/json"
+ "errors"
+ "io"
+ "os"
+
+ "github.com/googleapis/enterprise-certificate-proxy/client/util"
+)
+
+type certConfigs struct {
+ Workload *workloadSource `json:"workload"`
+}
+
+type workloadSource struct {
+ CertPath string `json:"cert_path"`
+ KeyPath string `json:"key_path"`
+}
+
+type certificateConfig struct {
+ CertConfigs certConfigs `json:"cert_configs"`
+}
+
+// NewWorkloadX509CertProvider creates a certificate source
+// that reads a certificate and private key file from the local file system.
+// This is intended to be used for workload identity federation.
+//
+// The configFilePath points to a config file containing relevant parameters
+// such as the certificate and key file paths.
+// If configFilePath is empty, the client will attempt to load the config from
+// a well-known gcloud location.
+func NewWorkloadX509CertProvider(configFilePath string) (Provider, error) {
+ if configFilePath == "" {
+ envFilePath := util.GetConfigFilePathFromEnv()
+ if envFilePath != "" {
+ configFilePath = envFilePath
+ } else {
+ configFilePath = util.GetDefaultConfigFilePath()
+ }
+ }
+
+ certFile, keyFile, err := getCertAndKeyFiles(configFilePath)
+ if err != nil {
+ return nil, err
+ }
+
+ source := &workloadSource{
+ CertPath: certFile,
+ KeyPath: keyFile,
+ }
+ return source.getClientCertificate, nil
+}
+
+// getClientCertificate attempts to load the certificate and key from the files specified in the
+// certificate config.
+func (s *workloadSource) getClientCertificate(info *tls.CertificateRequestInfo) (*tls.Certificate, error) {
+ cert, err := tls.LoadX509KeyPair(s.CertPath, s.KeyPath)
+ if err != nil {
+ return nil, err
+ }
+ return &cert, nil
+}
+
+// getCertAndKeyFiles attempts to read the provided config file and return the certificate and private
+// key file paths.
+func getCertAndKeyFiles(configFilePath string) (string, string, error) {
+ jsonFile, err := os.Open(configFilePath)
+ if err != nil {
+ return "", "", errSourceUnavailable
+ }
+
+ byteValue, err := io.ReadAll(jsonFile)
+ if err != nil {
+ return "", "", err
+ }
+
+ var config certificateConfig
+ if err := json.Unmarshal(byteValue, &config); err != nil {
+ return "", "", err
+ }
+
+ if config.CertConfigs.Workload == nil {
+ return "", "", errSourceUnavailable
+ }
+
+ certFile := config.CertConfigs.Workload.CertPath
+ keyFile := config.CertConfigs.Workload.KeyPath
+
+ if certFile == "" {
+ return "", "", errors.New("certificate configuration is missing the certificate file location")
+ }
+
+ if keyFile == "" {
+ return "", "", errors.New("certificate configuration is missing the key file location")
+ }
+
+ return certFile, keyFile, nil
+}
diff --git a/vendor/cloud.google.com/go/auth/internal/transport/s2a.go b/vendor/cloud.google.com/go/auth/internal/transport/s2a.go
new file mode 100644
index 00000000..37894bfc
--- /dev/null
+++ b/vendor/cloud.google.com/go/auth/internal/transport/s2a.go
@@ -0,0 +1,134 @@
+// Copyright 2023 Google LLC
+//
+// 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 transport
+
+import (
+ "context"
+ "encoding/json"
+ "fmt"
+ "log"
+ "os"
+ "strconv"
+ "sync"
+
+ "cloud.google.com/go/auth/internal/transport/cert"
+ "cloud.google.com/go/compute/metadata"
+)
+
+const (
+ configEndpointSuffix = "instance/platform-security/auto-mtls-configuration"
+)
+
+var (
+ mtlsConfiguration *mtlsConfig
+
+ mtlsOnce sync.Once
+)
+
+// GetS2AAddress returns the S2A address to be reached via plaintext connection.
+// Returns empty string if not set or invalid.
+func GetS2AAddress() string {
+ getMetadataMTLSAutoConfig()
+ if !mtlsConfiguration.valid() {
+ return ""
+ }
+ return mtlsConfiguration.S2A.PlaintextAddress
+}
+
+// GetMTLSS2AAddress returns the S2A address to be reached via MTLS connection.
+// Returns empty string if not set or invalid.
+func GetMTLSS2AAddress() string {
+ getMetadataMTLSAutoConfig()
+ if !mtlsConfiguration.valid() {
+ return ""
+ }
+ return mtlsConfiguration.S2A.MTLSAddress
+}
+
+// mtlsConfig contains the configuration for establishing MTLS connections with Google APIs.
+type mtlsConfig struct {
+ S2A *s2aAddresses `json:"s2a"`
+}
+
+func (c *mtlsConfig) valid() bool {
+ return c != nil && c.S2A != nil
+}
+
+// s2aAddresses contains the plaintext and/or MTLS S2A addresses.
+type s2aAddresses struct {
+ // PlaintextAddress is the plaintext address to reach S2A
+ PlaintextAddress string `json:"plaintext_address"`
+ // MTLSAddress is the MTLS address to reach S2A
+ MTLSAddress string `json:"mtls_address"`
+}
+
+func getMetadataMTLSAutoConfig() {
+ var err error
+ mtlsOnce.Do(func() {
+ mtlsConfiguration, err = queryConfig()
+ if err != nil {
+ log.Printf("Getting MTLS config failed: %v", err)
+ }
+ })
+}
+
+var httpGetMetadataMTLSConfig = func() (string, error) {
+ return metadata.GetWithContext(context.Background(), configEndpointSuffix)
+}
+
+func queryConfig() (*mtlsConfig, error) {
+ resp, err := httpGetMetadataMTLSConfig()
+ if err != nil {
+ return nil, fmt.Errorf("querying MTLS config from MDS endpoint failed: %w", err)
+ }
+ var config mtlsConfig
+ err = json.Unmarshal([]byte(resp), &config)
+ if err != nil {
+ return nil, fmt.Errorf("unmarshalling MTLS config from MDS endpoint failed: %w", err)
+ }
+ if config.S2A == nil {
+ return nil, fmt.Errorf("returned MTLS config from MDS endpoint is invalid: %v", config)
+ }
+ return &config, nil
+}
+
+func shouldUseS2A(clientCertSource cert.Provider, opts *Options) bool {
+ // If client cert is found, use that over S2A.
+ if clientCertSource != nil {
+ return false
+ }
+ // If EXPERIMENTAL_GOOGLE_API_USE_S2A is not set to true, skip S2A.
+ if !isGoogleS2AEnabled() {
+ return false
+ }
+ // If DefaultMTLSEndpoint is not set or has endpoint override, skip S2A.
+ if opts.DefaultMTLSEndpoint == "" || opts.Endpoint != "" {
+ return false
+ }
+ // If custom HTTP client is provided, skip S2A.
+ if opts.Client != nil {
+ return false
+ }
+ // If directPath is enabled, skip S2A.
+ return !opts.EnableDirectPath && !opts.EnableDirectPathXds
+}
+
+func isGoogleS2AEnabled() bool {
+ b, err := strconv.ParseBool(os.Getenv(googleAPIUseS2AEnv))
+ if err != nil {
+ return false
+ }
+ return b
+}
diff --git a/vendor/cloud.google.com/go/auth/internal/transport/transport.go b/vendor/cloud.google.com/go/auth/internal/transport/transport.go
new file mode 100644
index 00000000..cc586ec5
--- /dev/null
+++ b/vendor/cloud.google.com/go/auth/internal/transport/transport.go
@@ -0,0 +1,105 @@
+// Copyright 2023 Google LLC
+//
+// 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 transport provided internal helpers for the two transport packages
+// (grpctransport and httptransport).
+package transport
+
+import (
+ "crypto/tls"
+ "fmt"
+ "net"
+ "net/http"
+ "time"
+
+ "cloud.google.com/go/auth/credentials"
+)
+
+// CloneDetectOptions clones a user set detect option into some new memory that
+// we can internally manipulate before sending onto the detect package.
+func CloneDetectOptions(oldDo *credentials.DetectOptions) *credentials.DetectOptions {
+ if oldDo == nil {
+ // it is valid for users not to set this, but we will need to to default
+ // some options for them in this case so return some initialized memory
+ // to work with.
+ return &credentials.DetectOptions{}
+ }
+ newDo := &credentials.DetectOptions{
+ // Simple types
+ Audience: oldDo.Audience,
+ Subject: oldDo.Subject,
+ EarlyTokenRefresh: oldDo.EarlyTokenRefresh,
+ TokenURL: oldDo.TokenURL,
+ STSAudience: oldDo.STSAudience,
+ CredentialsFile: oldDo.CredentialsFile,
+ UseSelfSignedJWT: oldDo.UseSelfSignedJWT,
+ UniverseDomain: oldDo.UniverseDomain,
+
+ // These fields are are pointer types that we just want to use exactly
+ // as the user set, copy the ref
+ Client: oldDo.Client,
+ AuthHandlerOptions: oldDo.AuthHandlerOptions,
+ }
+
+ // Smartly size this memory and copy below.
+ if len(oldDo.CredentialsJSON) > 0 {
+ newDo.CredentialsJSON = make([]byte, len(oldDo.CredentialsJSON))
+ copy(newDo.CredentialsJSON, oldDo.CredentialsJSON)
+ }
+ if len(oldDo.Scopes) > 0 {
+ newDo.Scopes = make([]string, len(oldDo.Scopes))
+ copy(newDo.Scopes, oldDo.Scopes)
+ }
+
+ return newDo
+}
+
+// ValidateUniverseDomain verifies that the universe domain configured for the
+// client matches the universe domain configured for the credentials.
+func ValidateUniverseDomain(clientUniverseDomain, credentialsUniverseDomain string) error {
+ if clientUniverseDomain != credentialsUniverseDomain {
+ return fmt.Errorf(
+ "the configured universe domain (%q) does not match the universe "+
+ "domain found in the credentials (%q). If you haven't configured "+
+ "the universe domain explicitly, \"googleapis.com\" is the default",
+ clientUniverseDomain,
+ credentialsUniverseDomain)
+ }
+ return nil
+}
+
+// DefaultHTTPClientWithTLS constructs an HTTPClient using the provided tlsConfig, to support mTLS.
+func DefaultHTTPClientWithTLS(tlsConfig *tls.Config) *http.Client {
+ trans := BaseTransport()
+ trans.TLSClientConfig = tlsConfig
+ return &http.Client{Transport: trans}
+}
+
+// BaseTransport returns a default [http.Transport] which can be used if
+// [http.DefaultTransport] has been overwritten.
+func BaseTransport() *http.Transport {
+ return &http.Transport{
+ Proxy: http.ProxyFromEnvironment,
+ DialContext: (&net.Dialer{
+ Timeout: 30 * time.Second,
+ KeepAlive: 30 * time.Second,
+ DualStack: true,
+ }).DialContext,
+ MaxIdleConns: 100,
+ MaxIdleConnsPerHost: 100,
+ IdleConnTimeout: 90 * time.Second,
+ TLSHandshakeTimeout: 10 * time.Second,
+ ExpectContinueTimeout: 1 * time.Second,
+ }
+}
diff --git a/vendor/cloud.google.com/go/auth/oauth2adapt/CHANGES.md b/vendor/cloud.google.com/go/auth/oauth2adapt/CHANGES.md
new file mode 100644
index 00000000..a1ef2923
--- /dev/null
+++ b/vendor/cloud.google.com/go/auth/oauth2adapt/CHANGES.md
@@ -0,0 +1,68 @@
+# Changelog
+
+## [0.2.6](https://github.com/googleapis/google-cloud-go/compare/auth/oauth2adapt/v0.2.5...auth/oauth2adapt/v0.2.6) (2024-11-21)
+
+
+### Bug Fixes
+
+* **auth/oauth2adapt:** Copy map in tokenSourceAdapter.Token ([#11164](https://github.com/googleapis/google-cloud-go/issues/11164)) ([8cb0cbc](https://github.com/googleapis/google-cloud-go/commit/8cb0cbccdc32886dfb3af49fee04012937d114d2)), refs [#11161](https://github.com/googleapis/google-cloud-go/issues/11161)
+
+## [0.2.5](https://github.com/googleapis/google-cloud-go/compare/auth/oauth2adapt/v0.2.4...auth/oauth2adapt/v0.2.5) (2024-10-30)
+
+
+### Bug Fixes
+
+* **auth/oauth2adapt:** Convert token metadata where possible ([#11062](https://github.com/googleapis/google-cloud-go/issues/11062)) ([34bf1c1](https://github.com/googleapis/google-cloud-go/commit/34bf1c164465d66745c0cfdf7cd10a8e2da92e52))
+
+## [0.2.4](https://github.com/googleapis/google-cloud-go/compare/auth/oauth2adapt/v0.2.3...auth/oauth2adapt/v0.2.4) (2024-08-08)
+
+
+### Bug Fixes
+
+* **auth/oauth2adapt:** Update dependencies ([257c40b](https://github.com/googleapis/google-cloud-go/commit/257c40bd6d7e59730017cf32bda8823d7a232758))
+
+## [0.2.3](https://github.com/googleapis/google-cloud-go/compare/auth/oauth2adapt/v0.2.2...auth/oauth2adapt/v0.2.3) (2024-07-10)
+
+
+### Bug Fixes
+
+* **auth/oauth2adapt:** Bump google.golang.org/api@v0.187.0 ([8fa9e39](https://github.com/googleapis/google-cloud-go/commit/8fa9e398e512fd8533fd49060371e61b5725a85b))
+
+## [0.2.2](https://github.com/googleapis/google-cloud-go/compare/auth/oauth2adapt/v0.2.1...auth/oauth2adapt/v0.2.2) (2024-04-23)
+
+
+### Bug Fixes
+
+* **auth/oauth2adapt:** Bump x/net to v0.24.0 ([ba31ed5](https://github.com/googleapis/google-cloud-go/commit/ba31ed5fda2c9664f2e1cf972469295e63deb5b4))
+
+## [0.2.1](https://github.com/googleapis/google-cloud-go/compare/auth/oauth2adapt/v0.2.0...auth/oauth2adapt/v0.2.1) (2024-04-18)
+
+
+### Bug Fixes
+
+* **auth/oauth2adapt:** Adapt Token Types to be translated ([#9801](https://github.com/googleapis/google-cloud-go/issues/9801)) ([70f4115](https://github.com/googleapis/google-cloud-go/commit/70f411555ebbf2b71e6d425cc8d2030644c6b438)), refs [#9800](https://github.com/googleapis/google-cloud-go/issues/9800)
+
+## [0.2.0](https://github.com/googleapis/google-cloud-go/compare/auth/oauth2adapt/v0.1.0...auth/oauth2adapt/v0.2.0) (2024-04-16)
+
+
+### Features
+
+* **auth/oauth2adapt:** Add helpers for working with credentials types ([#9694](https://github.com/googleapis/google-cloud-go/issues/9694)) ([cf33b55](https://github.com/googleapis/google-cloud-go/commit/cf33b5514423a2ac5c2a323a1cd99aac34fd4233))
+
+
+### Bug Fixes
+
+* **auth/oauth2adapt:** Update protobuf dep to v1.33.0 ([30b038d](https://github.com/googleapis/google-cloud-go/commit/30b038d8cac0b8cd5dd4761c87f3f298760dd33a))
+
+## 0.1.0 (2023-10-19)
+
+
+### Features
+
+* **auth/oauth2adapt:** Adds a new module to translate types ([#8595](https://github.com/googleapis/google-cloud-go/issues/8595)) ([6933c5a](https://github.com/googleapis/google-cloud-go/commit/6933c5a0c1fc8e58cbfff8bbca439d671b94672f))
+* **auth/oauth2adapt:** Fixup deps for release ([#8747](https://github.com/googleapis/google-cloud-go/issues/8747)) ([749d243](https://github.com/googleapis/google-cloud-go/commit/749d243862b025a6487a4d2d339219889b4cfe70))
+
+
+### Bug Fixes
+
+* **auth/oauth2adapt:** Update golang.org/x/net to v0.17.0 ([174da47](https://github.com/googleapis/google-cloud-go/commit/174da47254fefb12921bbfc65b7829a453af6f5d))
diff --git a/vendor/cloud.google.com/go/auth/oauth2adapt/LICENSE b/vendor/cloud.google.com/go/auth/oauth2adapt/LICENSE
new file mode 100644
index 00000000..d6456956
--- /dev/null
+++ b/vendor/cloud.google.com/go/auth/oauth2adapt/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ 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.
diff --git a/vendor/cloud.google.com/go/auth/oauth2adapt/oauth2adapt.go b/vendor/cloud.google.com/go/auth/oauth2adapt/oauth2adapt.go
new file mode 100644
index 00000000..9cc33e5e
--- /dev/null
+++ b/vendor/cloud.google.com/go/auth/oauth2adapt/oauth2adapt.go
@@ -0,0 +1,200 @@
+// Copyright 2023 Google LLC
+//
+// 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 oauth2adapt helps converts types used in [cloud.google.com/go/auth]
+// and [golang.org/x/oauth2].
+package oauth2adapt
+
+import (
+ "context"
+ "encoding/json"
+ "errors"
+
+ "cloud.google.com/go/auth"
+ "golang.org/x/oauth2"
+ "golang.org/x/oauth2/google"
+)
+
+const (
+ oauth2TokenSourceKey = "oauth2.google.tokenSource"
+ oauth2ServiceAccountKey = "oauth2.google.serviceAccount"
+ authTokenSourceKey = "auth.google.tokenSource"
+ authServiceAccountKey = "auth.google.serviceAccount"
+)
+
+// TokenProviderFromTokenSource converts any [golang.org/x/oauth2.TokenSource]
+// into a [cloud.google.com/go/auth.TokenProvider].
+func TokenProviderFromTokenSource(ts oauth2.TokenSource) auth.TokenProvider {
+ return &tokenProviderAdapter{ts: ts}
+}
+
+type tokenProviderAdapter struct {
+ ts oauth2.TokenSource
+}
+
+// Token fulfills the [cloud.google.com/go/auth.TokenProvider] interface. It
+// is a light wrapper around the underlying TokenSource.
+func (tp *tokenProviderAdapter) Token(context.Context) (*auth.Token, error) {
+ tok, err := tp.ts.Token()
+ if err != nil {
+ var err2 *oauth2.RetrieveError
+ if ok := errors.As(err, &err2); ok {
+ return nil, AuthErrorFromRetrieveError(err2)
+ }
+ return nil, err
+ }
+ // Preserve compute token metadata, for both types of tokens.
+ metadata := map[string]interface{}{}
+ if val, ok := tok.Extra(oauth2TokenSourceKey).(string); ok {
+ metadata[authTokenSourceKey] = val
+ metadata[oauth2TokenSourceKey] = val
+ }
+ if val, ok := tok.Extra(oauth2ServiceAccountKey).(string); ok {
+ metadata[authServiceAccountKey] = val
+ metadata[oauth2ServiceAccountKey] = val
+ }
+ return &auth.Token{
+ Value: tok.AccessToken,
+ Type: tok.Type(),
+ Expiry: tok.Expiry,
+ Metadata: metadata,
+ }, nil
+}
+
+// TokenSourceFromTokenProvider converts any
+// [cloud.google.com/go/auth.TokenProvider] into a
+// [golang.org/x/oauth2.TokenSource].
+func TokenSourceFromTokenProvider(tp auth.TokenProvider) oauth2.TokenSource {
+ return &tokenSourceAdapter{tp: tp}
+}
+
+type tokenSourceAdapter struct {
+ tp auth.TokenProvider
+}
+
+// Token fulfills the [golang.org/x/oauth2.TokenSource] interface. It
+// is a light wrapper around the underlying TokenProvider.
+func (ts *tokenSourceAdapter) Token() (*oauth2.Token, error) {
+ tok, err := ts.tp.Token(context.Background())
+ if err != nil {
+ var err2 *auth.Error
+ if ok := errors.As(err, &err2); ok {
+ return nil, AddRetrieveErrorToAuthError(err2)
+ }
+ return nil, err
+ }
+ tok2 := &oauth2.Token{
+ AccessToken: tok.Value,
+ TokenType: tok.Type,
+ Expiry: tok.Expiry,
+ }
+ // Preserve token metadata.
+ m := tok.Metadata
+ if m != nil {
+ // Copy map to avoid concurrent map writes error (#11161).
+ metadata := make(map[string]interface{}, len(m)+2)
+ for k, v := range m {
+ metadata[k] = v
+ }
+ // Append compute token metadata in converted form.
+ if val, ok := metadata[authTokenSourceKey].(string); ok && val != "" {
+ metadata[oauth2TokenSourceKey] = val
+ }
+ if val, ok := metadata[authServiceAccountKey].(string); ok && val != "" {
+ metadata[oauth2ServiceAccountKey] = val
+ }
+ tok2 = tok2.WithExtra(metadata)
+ }
+ return tok2, nil
+}
+
+// AuthCredentialsFromOauth2Credentials converts a [golang.org/x/oauth2/google.Credentials]
+// to a [cloud.google.com/go/auth.Credentials].
+func AuthCredentialsFromOauth2Credentials(creds *google.Credentials) *auth.Credentials {
+ if creds == nil {
+ return nil
+ }
+ return auth.NewCredentials(&auth.CredentialsOptions{
+ TokenProvider: TokenProviderFromTokenSource(creds.TokenSource),
+ JSON: creds.JSON,
+ ProjectIDProvider: auth.CredentialsPropertyFunc(func(ctx context.Context) (string, error) {
+ return creds.ProjectID, nil
+ }),
+ UniverseDomainProvider: auth.CredentialsPropertyFunc(func(ctx context.Context) (string, error) {
+ return creds.GetUniverseDomain()
+ }),
+ })
+}
+
+// Oauth2CredentialsFromAuthCredentials converts a [cloud.google.com/go/auth.Credentials]
+// to a [golang.org/x/oauth2/google.Credentials].
+func Oauth2CredentialsFromAuthCredentials(creds *auth.Credentials) *google.Credentials {
+ if creds == nil {
+ return nil
+ }
+ // Throw away errors as old credentials are not request aware. Also, no
+ // network requests are currently happening for this use case.
+ projectID, _ := creds.ProjectID(context.Background())
+
+ return &google.Credentials{
+ TokenSource: TokenSourceFromTokenProvider(creds.TokenProvider),
+ ProjectID: projectID,
+ JSON: creds.JSON(),
+ UniverseDomainProvider: func() (string, error) {
+ return creds.UniverseDomain(context.Background())
+ },
+ }
+}
+
+type oauth2Error struct {
+ ErrorCode string `json:"error"`
+ ErrorDescription string `json:"error_description"`
+ ErrorURI string `json:"error_uri"`
+}
+
+// AddRetrieveErrorToAuthError returns the same error provided and adds a
+// [golang.org/x/oauth2.RetrieveError] to the error chain by setting the `Err` field on the
+// [cloud.google.com/go/auth.Error].
+func AddRetrieveErrorToAuthError(err *auth.Error) *auth.Error {
+ if err == nil {
+ return nil
+ }
+ e := &oauth2.RetrieveError{
+ Response: err.Response,
+ Body: err.Body,
+ }
+ err.Err = e
+ if len(err.Body) > 0 {
+ var oErr oauth2Error
+ // ignore the error as it only fills in extra details
+ json.Unmarshal(err.Body, &oErr)
+ e.ErrorCode = oErr.ErrorCode
+ e.ErrorDescription = oErr.ErrorDescription
+ e.ErrorURI = oErr.ErrorURI
+ }
+ return err
+}
+
+// AuthErrorFromRetrieveError returns an [cloud.google.com/go/auth.Error] that
+// wraps the provided [golang.org/x/oauth2.RetrieveError].
+func AuthErrorFromRetrieveError(err *oauth2.RetrieveError) *auth.Error {
+ if err == nil {
+ return nil
+ }
+ return &auth.Error{
+ Response: err.Response,
+ Body: err.Body,
+ Err: err,
+ }
+}
diff --git a/vendor/cloud.google.com/go/auth/threelegged.go b/vendor/cloud.google.com/go/auth/threelegged.go
new file mode 100644
index 00000000..97a57f46
--- /dev/null
+++ b/vendor/cloud.google.com/go/auth/threelegged.go
@@ -0,0 +1,368 @@
+// Copyright 2023 Google LLC
+//
+// 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 auth
+
+import (
+ "bytes"
+ "context"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "mime"
+ "net/http"
+ "net/url"
+ "strconv"
+ "strings"
+ "time"
+
+ "cloud.google.com/go/auth/internal"
+)
+
+// AuthorizationHandler is a 3-legged-OAuth helper that prompts the user for
+// OAuth consent at the specified auth code URL and returns an auth code and
+// state upon approval.
+type AuthorizationHandler func(authCodeURL string) (code string, state string, err error)
+
+// Options3LO are the options for doing a 3-legged OAuth2 flow.
+type Options3LO struct {
+ // ClientID is the application's ID.
+ ClientID string
+ // ClientSecret is the application's secret. Not required if AuthHandlerOpts
+ // is set.
+ ClientSecret string
+ // AuthURL is the URL for authenticating.
+ AuthURL string
+ // TokenURL is the URL for retrieving a token.
+ TokenURL string
+ // AuthStyle is used to describe how to client info in the token request.
+ AuthStyle Style
+ // RefreshToken is the token used to refresh the credential. Not required
+ // if AuthHandlerOpts is set.
+ RefreshToken string
+ // RedirectURL is the URL to redirect users to. Optional.
+ RedirectURL string
+ // Scopes specifies requested permissions for the Token. Optional.
+ Scopes []string
+
+ // URLParams are the set of values to apply to the token exchange. Optional.
+ URLParams url.Values
+ // Client is the client to be used to make the underlying token requests.
+ // Optional.
+ Client *http.Client
+ // EarlyTokenExpiry is the time before the token expires that it should be
+ // refreshed. If not set the default value is 3 minutes and 45 seconds.
+ // Optional.
+ EarlyTokenExpiry time.Duration
+
+ // AuthHandlerOpts provides a set of options for doing a
+ // 3-legged OAuth2 flow with a custom [AuthorizationHandler]. Optional.
+ AuthHandlerOpts *AuthorizationHandlerOptions
+}
+
+func (o *Options3LO) validate() error {
+ if o == nil {
+ return errors.New("auth: options must be provided")
+ }
+ if o.ClientID == "" {
+ return errors.New("auth: client ID must be provided")
+ }
+ if o.AuthHandlerOpts == nil && o.ClientSecret == "" {
+ return errors.New("auth: client secret must be provided")
+ }
+ if o.AuthURL == "" {
+ return errors.New("auth: auth URL must be provided")
+ }
+ if o.TokenURL == "" {
+ return errors.New("auth: token URL must be provided")
+ }
+ if o.AuthStyle == StyleUnknown {
+ return errors.New("auth: auth style must be provided")
+ }
+ if o.AuthHandlerOpts == nil && o.RefreshToken == "" {
+ return errors.New("auth: refresh token must be provided")
+ }
+ return nil
+}
+
+// PKCEOptions holds parameters to support PKCE.
+type PKCEOptions struct {
+ // Challenge is the un-padded, base64-url-encoded string of the encrypted code verifier.
+ Challenge string // The un-padded, base64-url-encoded string of the encrypted code verifier.
+ // ChallengeMethod is the encryption method (ex. S256).
+ ChallengeMethod string
+ // Verifier is the original, non-encrypted secret.
+ Verifier string // The original, non-encrypted secret.
+}
+
+type tokenJSON struct {
+ AccessToken string `json:"access_token"`
+ TokenType string `json:"token_type"`
+ RefreshToken string `json:"refresh_token"`
+ ExpiresIn int `json:"expires_in"`
+ // error fields
+ ErrorCode string `json:"error"`
+ ErrorDescription string `json:"error_description"`
+ ErrorURI string `json:"error_uri"`
+}
+
+func (e *tokenJSON) expiry() (t time.Time) {
+ if v := e.ExpiresIn; v != 0 {
+ return time.Now().Add(time.Duration(v) * time.Second)
+ }
+ return
+}
+
+func (o *Options3LO) client() *http.Client {
+ if o.Client != nil {
+ return o.Client
+ }
+ return internal.DefaultClient()
+}
+
+// authCodeURL returns a URL that points to a OAuth2 consent page.
+func (o *Options3LO) authCodeURL(state string, values url.Values) string {
+ var buf bytes.Buffer
+ buf.WriteString(o.AuthURL)
+ v := url.Values{
+ "response_type": {"code"},
+ "client_id": {o.ClientID},
+ }
+ if o.RedirectURL != "" {
+ v.Set("redirect_uri", o.RedirectURL)
+ }
+ if len(o.Scopes) > 0 {
+ v.Set("scope", strings.Join(o.Scopes, " "))
+ }
+ if state != "" {
+ v.Set("state", state)
+ }
+ if o.AuthHandlerOpts != nil {
+ if o.AuthHandlerOpts.PKCEOpts != nil &&
+ o.AuthHandlerOpts.PKCEOpts.Challenge != "" {
+ v.Set(codeChallengeKey, o.AuthHandlerOpts.PKCEOpts.Challenge)
+ }
+ if o.AuthHandlerOpts.PKCEOpts != nil &&
+ o.AuthHandlerOpts.PKCEOpts.ChallengeMethod != "" {
+ v.Set(codeChallengeMethodKey, o.AuthHandlerOpts.PKCEOpts.ChallengeMethod)
+ }
+ }
+ for k := range values {
+ v.Set(k, v.Get(k))
+ }
+ if strings.Contains(o.AuthURL, "?") {
+ buf.WriteByte('&')
+ } else {
+ buf.WriteByte('?')
+ }
+ buf.WriteString(v.Encode())
+ return buf.String()
+}
+
+// New3LOTokenProvider returns a [TokenProvider] based on the 3-legged OAuth2
+// configuration. The TokenProvider is caches and auto-refreshes tokens by
+// default.
+func New3LOTokenProvider(opts *Options3LO) (TokenProvider, error) {
+ if err := opts.validate(); err != nil {
+ return nil, err
+ }
+ if opts.AuthHandlerOpts != nil {
+ return new3LOTokenProviderWithAuthHandler(opts), nil
+ }
+ return NewCachedTokenProvider(&tokenProvider3LO{opts: opts, refreshToken: opts.RefreshToken, client: opts.client()}, &CachedTokenProviderOptions{
+ ExpireEarly: opts.EarlyTokenExpiry,
+ }), nil
+}
+
+// AuthorizationHandlerOptions provides a set of options to specify for doing a
+// 3-legged OAuth2 flow with a custom [AuthorizationHandler].
+type AuthorizationHandlerOptions struct {
+ // AuthorizationHandler specifies the handler used to for the authorization
+ // part of the flow.
+ Handler AuthorizationHandler
+ // State is used verify that the "state" is identical in the request and
+ // response before exchanging the auth code for OAuth2 token.
+ State string
+ // PKCEOpts allows setting configurations for PKCE. Optional.
+ PKCEOpts *PKCEOptions
+}
+
+func new3LOTokenProviderWithAuthHandler(opts *Options3LO) TokenProvider {
+ return NewCachedTokenProvider(&tokenProviderWithHandler{opts: opts, state: opts.AuthHandlerOpts.State}, &CachedTokenProviderOptions{
+ ExpireEarly: opts.EarlyTokenExpiry,
+ })
+}
+
+// exchange handles the final exchange portion of the 3lo flow. Returns a Token,
+// refreshToken, and error.
+func (o *Options3LO) exchange(ctx context.Context, code string) (*Token, string, error) {
+ // Build request
+ v := url.Values{
+ "grant_type": {"authorization_code"},
+ "code": {code},
+ }
+ if o.RedirectURL != "" {
+ v.Set("redirect_uri", o.RedirectURL)
+ }
+ if o.AuthHandlerOpts != nil &&
+ o.AuthHandlerOpts.PKCEOpts != nil &&
+ o.AuthHandlerOpts.PKCEOpts.Verifier != "" {
+ v.Set(codeVerifierKey, o.AuthHandlerOpts.PKCEOpts.Verifier)
+ }
+ for k := range o.URLParams {
+ v.Set(k, o.URLParams.Get(k))
+ }
+ return fetchToken(ctx, o, v)
+}
+
+// This struct is not safe for concurrent access alone, but the way it is used
+// in this package by wrapping it with a cachedTokenProvider makes it so.
+type tokenProvider3LO struct {
+ opts *Options3LO
+ client *http.Client
+ refreshToken string
+}
+
+func (tp *tokenProvider3LO) Token(ctx context.Context) (*Token, error) {
+ if tp.refreshToken == "" {
+ return nil, errors.New("auth: token expired and refresh token is not set")
+ }
+ v := url.Values{
+ "grant_type": {"refresh_token"},
+ "refresh_token": {tp.refreshToken},
+ }
+ for k := range tp.opts.URLParams {
+ v.Set(k, tp.opts.URLParams.Get(k))
+ }
+
+ tk, rt, err := fetchToken(ctx, tp.opts, v)
+ if err != nil {
+ return nil, err
+ }
+ if tp.refreshToken != rt && rt != "" {
+ tp.refreshToken = rt
+ }
+ return tk, err
+}
+
+type tokenProviderWithHandler struct {
+ opts *Options3LO
+ state string
+}
+
+func (tp tokenProviderWithHandler) Token(ctx context.Context) (*Token, error) {
+ url := tp.opts.authCodeURL(tp.state, nil)
+ code, state, err := tp.opts.AuthHandlerOpts.Handler(url)
+ if err != nil {
+ return nil, err
+ }
+ if state != tp.state {
+ return nil, errors.New("auth: state mismatch in 3-legged-OAuth flow")
+ }
+ tok, _, err := tp.opts.exchange(ctx, code)
+ return tok, err
+}
+
+// fetchToken returns a Token, refresh token, and/or an error.
+func fetchToken(ctx context.Context, o *Options3LO, v url.Values) (*Token, string, error) {
+ var refreshToken string
+ if o.AuthStyle == StyleInParams {
+ if o.ClientID != "" {
+ v.Set("client_id", o.ClientID)
+ }
+ if o.ClientSecret != "" {
+ v.Set("client_secret", o.ClientSecret)
+ }
+ }
+ req, err := http.NewRequestWithContext(ctx, "POST", o.TokenURL, strings.NewReader(v.Encode()))
+ if err != nil {
+ return nil, refreshToken, err
+ }
+ req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
+ if o.AuthStyle == StyleInHeader {
+ req.SetBasicAuth(url.QueryEscape(o.ClientID), url.QueryEscape(o.ClientSecret))
+ }
+
+ // Make request
+ resp, body, err := internal.DoRequest(o.client(), req)
+ if err != nil {
+ return nil, refreshToken, err
+ }
+ failureStatus := resp.StatusCode < 200 || resp.StatusCode > 299
+ tokError := &Error{
+ Response: resp,
+ Body: body,
+ }
+
+ var token *Token
+ // errors ignored because of default switch on content
+ content, _, _ := mime.ParseMediaType(resp.Header.Get("Content-Type"))
+ switch content {
+ case "application/x-www-form-urlencoded", "text/plain":
+ // some endpoints return a query string
+ vals, err := url.ParseQuery(string(body))
+ if err != nil {
+ if failureStatus {
+ return nil, refreshToken, tokError
+ }
+ return nil, refreshToken, fmt.Errorf("auth: cannot parse response: %w", err)
+ }
+ tokError.code = vals.Get("error")
+ tokError.description = vals.Get("error_description")
+ tokError.uri = vals.Get("error_uri")
+ token = &Token{
+ Value: vals.Get("access_token"),
+ Type: vals.Get("token_type"),
+ Metadata: make(map[string]interface{}, len(vals)),
+ }
+ for k, v := range vals {
+ token.Metadata[k] = v
+ }
+ refreshToken = vals.Get("refresh_token")
+ e := vals.Get("expires_in")
+ expires, _ := strconv.Atoi(e)
+ if expires != 0 {
+ token.Expiry = time.Now().Add(time.Duration(expires) * time.Second)
+ }
+ default:
+ var tj tokenJSON
+ if err = json.Unmarshal(body, &tj); err != nil {
+ if failureStatus {
+ return nil, refreshToken, tokError
+ }
+ return nil, refreshToken, fmt.Errorf("auth: cannot parse json: %w", err)
+ }
+ tokError.code = tj.ErrorCode
+ tokError.description = tj.ErrorDescription
+ tokError.uri = tj.ErrorURI
+ token = &Token{
+ Value: tj.AccessToken,
+ Type: tj.TokenType,
+ Expiry: tj.expiry(),
+ Metadata: make(map[string]interface{}),
+ }
+ json.Unmarshal(body, &token.Metadata) // optional field, skip err check
+ refreshToken = tj.RefreshToken
+ }
+ // according to spec, servers should respond status 400 in error case
+ // https://www.rfc-editor.org/rfc/rfc6749#section-5.2
+ // but some unorthodox servers respond 200 in error case
+ if failureStatus || tokError.code != "" {
+ return nil, refreshToken, tokError
+ }
+ if token.Value == "" {
+ return nil, refreshToken, errors.New("auth: server response missing access_token")
+ }
+ return token, refreshToken, nil
+}
diff --git a/vendor/cloud.google.com/go/compute/metadata/CHANGES.md b/vendor/cloud.google.com/go/compute/metadata/CHANGES.md
index 967e0607..da7db19b 100644
--- a/vendor/cloud.google.com/go/compute/metadata/CHANGES.md
+++ b/vendor/cloud.google.com/go/compute/metadata/CHANGES.md
@@ -1,5 +1,38 @@
# Changes
+## [0.5.2](https://github.com/googleapis/google-cloud-go/compare/compute/metadata/v0.5.1...compute/metadata/v0.5.2) (2024-09-20)
+
+
+### Bug Fixes
+
+* **compute/metadata:** Close Response Body for failed request ([#10891](https://github.com/googleapis/google-cloud-go/issues/10891)) ([e91d45e](https://github.com/googleapis/google-cloud-go/commit/e91d45e4757a9e354114509ba9800085d9e0ff1f))
+
+## [0.5.1](https://github.com/googleapis/google-cloud-go/compare/compute/metadata/v0.5.0...compute/metadata/v0.5.1) (2024-09-12)
+
+
+### Bug Fixes
+
+* **compute/metadata:** Check error chain for retryable error ([#10840](https://github.com/googleapis/google-cloud-go/issues/10840)) ([2bdedef](https://github.com/googleapis/google-cloud-go/commit/2bdedeff621b223d63cebc4355fcf83bc68412cd))
+
+## [0.5.0](https://github.com/googleapis/google-cloud-go/compare/compute/metadata/v0.4.0...compute/metadata/v0.5.0) (2024-07-10)
+
+
+### Features
+
+* **compute/metadata:** Add sys check for windows OnGCE ([#10521](https://github.com/googleapis/google-cloud-go/issues/10521)) ([3b9a830](https://github.com/googleapis/google-cloud-go/commit/3b9a83063960d2a2ac20beb47cc15818a68bd302))
+
+## [0.4.0](https://github.com/googleapis/google-cloud-go/compare/compute/metadata/v0.3.0...compute/metadata/v0.4.0) (2024-07-01)
+
+
+### Features
+
+* **compute/metadata:** Add context for all functions/methods ([#10370](https://github.com/googleapis/google-cloud-go/issues/10370)) ([66b8efe](https://github.com/googleapis/google-cloud-go/commit/66b8efe7ad877e052b2987bb4475477e38c67bb3))
+
+
+### Documentation
+
+* **compute/metadata:** Update OnGCE description ([#10408](https://github.com/googleapis/google-cloud-go/issues/10408)) ([6a46dca](https://github.com/googleapis/google-cloud-go/commit/6a46dca4eae4f88ec6f88822e01e5bf8aeca787f))
+
## [0.3.0](https://github.com/googleapis/google-cloud-go/compare/compute/metadata/v0.2.3...compute/metadata/v0.3.0) (2024-04-15)
diff --git a/vendor/cloud.google.com/go/compute/metadata/metadata.go b/vendor/cloud.google.com/go/compute/metadata/metadata.go
index f67e3c7e..c160b478 100644
--- a/vendor/cloud.google.com/go/compute/metadata/metadata.go
+++ b/vendor/cloud.google.com/go/compute/metadata/metadata.go
@@ -28,7 +28,6 @@ import (
"net/http"
"net/url"
"os"
- "runtime"
"strings"
"sync"
"time"
@@ -88,16 +87,16 @@ func (suffix NotDefinedError) Error() string {
return fmt.Sprintf("metadata: GCE metadata %q not defined", string(suffix))
}
-func (c *cachedValue) get(cl *Client) (v string, err error) {
+func (c *cachedValue) get(ctx context.Context, cl *Client) (v string, err error) {
defer c.mu.Unlock()
c.mu.Lock()
if c.v != "" {
return c.v, nil
}
if c.trim {
- v, err = cl.getTrimmed(context.Background(), c.k)
+ v, err = cl.getTrimmed(ctx, c.k)
} else {
- v, err = cl.GetWithContext(context.Background(), c.k)
+ v, err = cl.GetWithContext(ctx, c.k)
}
if err == nil {
c.v = v
@@ -110,7 +109,9 @@ var (
onGCE bool
)
-// OnGCE reports whether this process is running on Google Compute Engine.
+// OnGCE reports whether this process is running on Google Compute Platforms.
+// NOTE: True returned from `OnGCE` does not guarantee that the metadata server
+// is accessible from this process and have all the metadata defined.
func OnGCE() bool {
onGCEOnce.Do(initOnGCE)
return onGCE
@@ -188,21 +189,9 @@ func testOnGCE() bool {
return <-resc
}
-// systemInfoSuggestsGCE reports whether the local system (without
-// doing network requests) suggests that we're running on GCE. If this
-// returns true, testOnGCE tries a bit harder to reach its metadata
-// server.
-func systemInfoSuggestsGCE() bool {
- if runtime.GOOS != "linux" {
- // We don't have any non-Linux clues available, at least yet.
- return false
- }
- slurp, _ := os.ReadFile("/sys/class/dmi/id/product_name")
- name := strings.TrimSpace(string(slurp))
- return name == "Google" || name == "Google Compute Engine"
-}
-
// Subscribe calls Client.SubscribeWithContext on the default client.
+//
+// Deprecated: Please use the context aware variant [SubscribeWithContext].
func Subscribe(suffix string, fn func(v string, ok bool) error) error {
return defaultClient.SubscribeWithContext(context.Background(), suffix, func(ctx context.Context, v string, ok bool) error { return fn(v, ok) })
}
@@ -225,55 +214,188 @@ func GetWithContext(ctx context.Context, suffix string) (string, error) {
}
// ProjectID returns the current instance's project ID string.
-func ProjectID() (string, error) { return defaultClient.ProjectID() }
+//
+// Deprecated: Please use the context aware variant [ProjectIDWithContext].
+func ProjectID() (string, error) {
+ return defaultClient.ProjectIDWithContext(context.Background())
+}
+
+// ProjectIDWithContext returns the current instance's project ID string.
+func ProjectIDWithContext(ctx context.Context) (string, error) {
+ return defaultClient.ProjectIDWithContext(ctx)
+}
// NumericProjectID returns the current instance's numeric project ID.
-func NumericProjectID() (string, error) { return defaultClient.NumericProjectID() }
+//
+// Deprecated: Please use the context aware variant [NumericProjectIDWithContext].
+func NumericProjectID() (string, error) {
+ return defaultClient.NumericProjectIDWithContext(context.Background())
+}
+
+// NumericProjectIDWithContext returns the current instance's numeric project ID.
+func NumericProjectIDWithContext(ctx context.Context) (string, error) {
+ return defaultClient.NumericProjectIDWithContext(ctx)
+}
// InternalIP returns the instance's primary internal IP address.
-func InternalIP() (string, error) { return defaultClient.InternalIP() }
+//
+// Deprecated: Please use the context aware variant [InternalIPWithContext].
+func InternalIP() (string, error) {
+ return defaultClient.InternalIPWithContext(context.Background())
+}
+
+// InternalIPWithContext returns the instance's primary internal IP address.
+func InternalIPWithContext(ctx context.Context) (string, error) {
+ return defaultClient.InternalIPWithContext(ctx)
+}
// ExternalIP returns the instance's primary external (public) IP address.
-func ExternalIP() (string, error) { return defaultClient.ExternalIP() }
+//
+// Deprecated: Please use the context aware variant [ExternalIPWithContext].
+func ExternalIP() (string, error) {
+ return defaultClient.ExternalIPWithContext(context.Background())
+}
-// Email calls Client.Email on the default client.
-func Email(serviceAccount string) (string, error) { return defaultClient.Email(serviceAccount) }
+// ExternalIPWithContext returns the instance's primary external (public) IP address.
+func ExternalIPWithContext(ctx context.Context) (string, error) {
+ return defaultClient.ExternalIPWithContext(ctx)
+}
+
+// Email calls Client.EmailWithContext on the default client.
+//
+// Deprecated: Please use the context aware variant [EmailWithContext].
+func Email(serviceAccount string) (string, error) {
+ return defaultClient.EmailWithContext(context.Background(), serviceAccount)
+}
+
+// EmailWithContext calls Client.EmailWithContext on the default client.
+func EmailWithContext(ctx context.Context, serviceAccount string) (string, error) {
+ return defaultClient.EmailWithContext(ctx, serviceAccount)
+}
// Hostname returns the instance's hostname. This will be of the form
// ".c..internal".
-func Hostname() (string, error) { return defaultClient.Hostname() }
+//
+// Deprecated: Please use the context aware variant [HostnameWithContext].
+func Hostname() (string, error) {
+ return defaultClient.HostnameWithContext(context.Background())
+}
+
+// HostnameWithContext returns the instance's hostname. This will be of the form
+// ".c..internal".
+func HostnameWithContext(ctx context.Context) (string, error) {
+ return defaultClient.HostnameWithContext(ctx)
+}
// InstanceTags returns the list of user-defined instance tags,
// assigned when initially creating a GCE instance.
-func InstanceTags() ([]string, error) { return defaultClient.InstanceTags() }
+//
+// Deprecated: Please use the context aware variant [InstanceTagsWithContext].
+func InstanceTags() ([]string, error) {
+ return defaultClient.InstanceTagsWithContext(context.Background())
+}
+
+// InstanceTagsWithContext returns the list of user-defined instance tags,
+// assigned when initially creating a GCE instance.
+func InstanceTagsWithContext(ctx context.Context) ([]string, error) {
+ return defaultClient.InstanceTagsWithContext(ctx)
+}
// InstanceID returns the current VM's numeric instance ID.
-func InstanceID() (string, error) { return defaultClient.InstanceID() }
+//
+// Deprecated: Please use the context aware variant [InstanceIDWithContext].
+func InstanceID() (string, error) {
+ return defaultClient.InstanceIDWithContext(context.Background())
+}
+
+// InstanceIDWithContext returns the current VM's numeric instance ID.
+func InstanceIDWithContext(ctx context.Context) (string, error) {
+ return defaultClient.InstanceIDWithContext(ctx)
+}
// InstanceName returns the current VM's instance ID string.
-func InstanceName() (string, error) { return defaultClient.InstanceName() }
+//
+// Deprecated: Please use the context aware variant [InstanceNameWithContext].
+func InstanceName() (string, error) {
+ return defaultClient.InstanceNameWithContext(context.Background())
+}
+
+// InstanceNameWithContext returns the current VM's instance ID string.
+func InstanceNameWithContext(ctx context.Context) (string, error) {
+ return defaultClient.InstanceNameWithContext(ctx)
+}
// Zone returns the current VM's zone, such as "us-central1-b".
-func Zone() (string, error) { return defaultClient.Zone() }
+//
+// Deprecated: Please use the context aware variant [ZoneWithContext].
+func Zone() (string, error) {
+ return defaultClient.ZoneWithContext(context.Background())
+}
+
+// ZoneWithContext returns the current VM's zone, such as "us-central1-b".
+func ZoneWithContext(ctx context.Context) (string, error) {
+ return defaultClient.ZoneWithContext(ctx)
+}
-// InstanceAttributes calls Client.InstanceAttributes on the default client.
-func InstanceAttributes() ([]string, error) { return defaultClient.InstanceAttributes() }
+// InstanceAttributes calls Client.InstanceAttributesWithContext on the default client.
+//
+// Deprecated: Please use the context aware variant [InstanceAttributesWithContext.
+func InstanceAttributes() ([]string, error) {
+ return defaultClient.InstanceAttributesWithContext(context.Background())
+}
+
+// InstanceAttributesWithContext calls Client.ProjectAttributesWithContext on the default client.
+func InstanceAttributesWithContext(ctx context.Context) ([]string, error) {
+ return defaultClient.InstanceAttributesWithContext(ctx)
+}
-// ProjectAttributes calls Client.ProjectAttributes on the default client.
-func ProjectAttributes() ([]string, error) { return defaultClient.ProjectAttributes() }
+// ProjectAttributes calls Client.ProjectAttributesWithContext on the default client.
+//
+// Deprecated: Please use the context aware variant [ProjectAttributesWithContext].
+func ProjectAttributes() ([]string, error) {
+ return defaultClient.ProjectAttributesWithContext(context.Background())
+}
+
+// ProjectAttributesWithContext calls Client.ProjectAttributesWithContext on the default client.
+func ProjectAttributesWithContext(ctx context.Context) ([]string, error) {
+ return defaultClient.ProjectAttributesWithContext(ctx)
+}
-// InstanceAttributeValue calls Client.InstanceAttributeValue on the default client.
+// InstanceAttributeValue calls Client.InstanceAttributeValueWithContext on the default client.
+//
+// Deprecated: Please use the context aware variant [InstanceAttributeValueWithContext].
func InstanceAttributeValue(attr string) (string, error) {
- return defaultClient.InstanceAttributeValue(attr)
+ return defaultClient.InstanceAttributeValueWithContext(context.Background(), attr)
+}
+
+// InstanceAttributeValueWithContext calls Client.InstanceAttributeValueWithContext on the default client.
+func InstanceAttributeValueWithContext(ctx context.Context, attr string) (string, error) {
+ return defaultClient.InstanceAttributeValueWithContext(ctx, attr)
}
-// ProjectAttributeValue calls Client.ProjectAttributeValue on the default client.
+// ProjectAttributeValue calls Client.ProjectAttributeValueWithContext on the default client.
+//
+// Deprecated: Please use the context aware variant [ProjectAttributeValueWithContext].
func ProjectAttributeValue(attr string) (string, error) {
- return defaultClient.ProjectAttributeValue(attr)
+ return defaultClient.ProjectAttributeValueWithContext(context.Background(), attr)
}
-// Scopes calls Client.Scopes on the default client.
-func Scopes(serviceAccount string) ([]string, error) { return defaultClient.Scopes(serviceAccount) }
+// ProjectAttributeValueWithContext calls Client.ProjectAttributeValueWithContext on the default client.
+func ProjectAttributeValueWithContext(ctx context.Context, attr string) (string, error) {
+ return defaultClient.ProjectAttributeValueWithContext(ctx, attr)
+}
+
+// Scopes calls Client.ScopesWithContext on the default client.
+//
+// Deprecated: Please use the context aware variant [ScopesWithContext].
+func Scopes(serviceAccount string) ([]string, error) {
+ return defaultClient.ScopesWithContext(context.Background(), serviceAccount)
+}
+
+// ScopesWithContext calls Client.ScopesWithContext on the default client.
+func ScopesWithContext(ctx context.Context, serviceAccount string) ([]string, error) {
+ return defaultClient.ScopesWithContext(ctx, serviceAccount)
+}
func strsContains(ss []string, s string) bool {
for _, v := range ss {
@@ -296,7 +418,6 @@ func NewClient(c *http.Client) *Client {
if c == nil {
return defaultClient
}
-
return &Client{hc: c}
}
@@ -335,6 +456,9 @@ func (c *Client) getETag(ctx context.Context, suffix string) (value, etag string
code = res.StatusCode
}
if delay, shouldRetry := retryer.Retry(code, reqErr); shouldRetry {
+ if res != nil && res.Body != nil {
+ res.Body.Close()
+ }
if err := sleep(ctx, delay); err != nil {
return "", "", err
}
@@ -381,6 +505,10 @@ func (c *Client) Get(suffix string) (string, error) {
//
// If the requested metadata is not defined, the returned error will
// be of type NotDefinedError.
+//
+// NOTE: Without an extra deadline in the context this call can take in the
+// worst case, with internal backoff retries, up to 15 seconds (e.g. when server
+// is responding slowly). Pass context with additional timeouts when needed.
func (c *Client) GetWithContext(ctx context.Context, suffix string) (string, error) {
val, _, err := c.getETag(ctx, suffix)
return val, err
@@ -392,8 +520,8 @@ func (c *Client) getTrimmed(ctx context.Context, suffix string) (s string, err e
return
}
-func (c *Client) lines(suffix string) ([]string, error) {
- j, err := c.GetWithContext(context.Background(), suffix)
+func (c *Client) lines(ctx context.Context, suffix string) ([]string, error) {
+ j, err := c.GetWithContext(ctx, suffix)
if err != nil {
return nil, err
}
@@ -405,45 +533,104 @@ func (c *Client) lines(suffix string) ([]string, error) {
}
// ProjectID returns the current instance's project ID string.
-func (c *Client) ProjectID() (string, error) { return projID.get(c) }
+//
+// Deprecated: Please use the context aware variant [Client.ProjectIDWithContext].
+func (c *Client) ProjectID() (string, error) { return c.ProjectIDWithContext(context.Background()) }
+
+// ProjectIDWithContext returns the current instance's project ID string.
+func (c *Client) ProjectIDWithContext(ctx context.Context) (string, error) { return projID.get(ctx, c) }
// NumericProjectID returns the current instance's numeric project ID.
-func (c *Client) NumericProjectID() (string, error) { return projNum.get(c) }
+//
+// Deprecated: Please use the context aware variant [Client.NumericProjectIDWithContext].
+func (c *Client) NumericProjectID() (string, error) {
+ return c.NumericProjectIDWithContext(context.Background())
+}
+
+// NumericProjectIDWithContext returns the current instance's numeric project ID.
+func (c *Client) NumericProjectIDWithContext(ctx context.Context) (string, error) {
+ return projNum.get(ctx, c)
+}
// InstanceID returns the current VM's numeric instance ID.
-func (c *Client) InstanceID() (string, error) { return instID.get(c) }
+//
+// Deprecated: Please use the context aware variant [Client.InstanceIDWithContext].
+func (c *Client) InstanceID() (string, error) {
+ return c.InstanceIDWithContext(context.Background())
+}
+
+// InstanceIDWithContext returns the current VM's numeric instance ID.
+func (c *Client) InstanceIDWithContext(ctx context.Context) (string, error) {
+ return instID.get(ctx, c)
+}
// InternalIP returns the instance's primary internal IP address.
+//
+// Deprecated: Please use the context aware variant [Client.InternalIPWithContext].
func (c *Client) InternalIP() (string, error) {
- return c.getTrimmed(context.Background(), "instance/network-interfaces/0/ip")
+ return c.InternalIPWithContext(context.Background())
+}
+
+// InternalIPWithContext returns the instance's primary internal IP address.
+func (c *Client) InternalIPWithContext(ctx context.Context) (string, error) {
+ return c.getTrimmed(ctx, "instance/network-interfaces/0/ip")
}
// Email returns the email address associated with the service account.
-// The account may be empty or the string "default" to use the instance's
-// main account.
+//
+// Deprecated: Please use the context aware variant [Client.EmailWithContext].
func (c *Client) Email(serviceAccount string) (string, error) {
+ return c.EmailWithContext(context.Background(), serviceAccount)
+}
+
+// EmailWithContext returns the email address associated with the service account.
+// The serviceAccount parameter default value (empty string or "default" value)
+// will use the instance's main account.
+func (c *Client) EmailWithContext(ctx context.Context, serviceAccount string) (string, error) {
if serviceAccount == "" {
serviceAccount = "default"
}
- return c.getTrimmed(context.Background(), "instance/service-accounts/"+serviceAccount+"/email")
+ return c.getTrimmed(ctx, "instance/service-accounts/"+serviceAccount+"/email")
}
// ExternalIP returns the instance's primary external (public) IP address.
+//
+// Deprecated: Please use the context aware variant [Client.ExternalIPWithContext].
func (c *Client) ExternalIP() (string, error) {
- return c.getTrimmed(context.Background(), "instance/network-interfaces/0/access-configs/0/external-ip")
+ return c.ExternalIPWithContext(context.Background())
+}
+
+// ExternalIPWithContext returns the instance's primary external (public) IP address.
+func (c *Client) ExternalIPWithContext(ctx context.Context) (string, error) {
+ return c.getTrimmed(ctx, "instance/network-interfaces/0/access-configs/0/external-ip")
}
// Hostname returns the instance's hostname. This will be of the form
// ".c..internal".
+//
+// Deprecated: Please use the context aware variant [Client.HostnameWithContext].
func (c *Client) Hostname() (string, error) {
- return c.getTrimmed(context.Background(), "instance/hostname")
+ return c.HostnameWithContext(context.Background())
}
-// InstanceTags returns the list of user-defined instance tags,
-// assigned when initially creating a GCE instance.
+// HostnameWithContext returns the instance's hostname. This will be of the form
+// ".c..internal".
+func (c *Client) HostnameWithContext(ctx context.Context) (string, error) {
+ return c.getTrimmed(ctx, "instance/hostname")
+}
+
+// InstanceTags returns the list of user-defined instance tags.
+//
+// Deprecated: Please use the context aware variant [Client.InstanceTagsWithContext].
func (c *Client) InstanceTags() ([]string, error) {
+ return c.InstanceTagsWithContext(context.Background())
+}
+
+// InstanceTagsWithContext returns the list of user-defined instance tags,
+// assigned when initially creating a GCE instance.
+func (c *Client) InstanceTagsWithContext(ctx context.Context) ([]string, error) {
var s []string
- j, err := c.GetWithContext(context.Background(), "instance/tags")
+ j, err := c.GetWithContext(ctx, "instance/tags")
if err != nil {
return nil, err
}
@@ -454,13 +641,27 @@ func (c *Client) InstanceTags() ([]string, error) {
}
// InstanceName returns the current VM's instance ID string.
+//
+// Deprecated: Please use the context aware variant [Client.InstanceNameWithContext].
func (c *Client) InstanceName() (string, error) {
- return c.getTrimmed(context.Background(), "instance/name")
+ return c.InstanceNameWithContext(context.Background())
+}
+
+// InstanceNameWithContext returns the current VM's instance ID string.
+func (c *Client) InstanceNameWithContext(ctx context.Context) (string, error) {
+ return c.getTrimmed(ctx, "instance/name")
}
// Zone returns the current VM's zone, such as "us-central1-b".
+//
+// Deprecated: Please use the context aware variant [Client.ZoneWithContext].
func (c *Client) Zone() (string, error) {
- zone, err := c.getTrimmed(context.Background(), "instance/zone")
+ return c.ZoneWithContext(context.Background())
+}
+
+// ZoneWithContext returns the current VM's zone, such as "us-central1-b".
+func (c *Client) ZoneWithContext(ctx context.Context) (string, error) {
+ zone, err := c.getTrimmed(ctx, "instance/zone")
// zone is of the form "projects//zones/".
if err != nil {
return "", err
@@ -471,12 +672,34 @@ func (c *Client) Zone() (string, error) {
// InstanceAttributes returns the list of user-defined attributes,
// assigned when initially creating a GCE VM instance. The value of an
// attribute can be obtained with InstanceAttributeValue.
-func (c *Client) InstanceAttributes() ([]string, error) { return c.lines("instance/attributes/") }
+//
+// Deprecated: Please use the context aware variant [Client.InstanceAttributesWithContext].
+func (c *Client) InstanceAttributes() ([]string, error) {
+ return c.InstanceAttributesWithContext(context.Background())
+}
+
+// InstanceAttributesWithContext returns the list of user-defined attributes,
+// assigned when initially creating a GCE VM instance. The value of an
+// attribute can be obtained with InstanceAttributeValue.
+func (c *Client) InstanceAttributesWithContext(ctx context.Context) ([]string, error) {
+ return c.lines(ctx, "instance/attributes/")
+}
// ProjectAttributes returns the list of user-defined attributes
// applying to the project as a whole, not just this VM. The value of
// an attribute can be obtained with ProjectAttributeValue.
-func (c *Client) ProjectAttributes() ([]string, error) { return c.lines("project/attributes/") }
+//
+// Deprecated: Please use the context aware variant [Client.ProjectAttributesWithContext].
+func (c *Client) ProjectAttributes() ([]string, error) {
+ return c.ProjectAttributesWithContext(context.Background())
+}
+
+// ProjectAttributesWithContext returns the list of user-defined attributes
+// applying to the project as a whole, not just this VM. The value of
+// an attribute can be obtained with ProjectAttributeValue.
+func (c *Client) ProjectAttributesWithContext(ctx context.Context) ([]string, error) {
+ return c.lines(ctx, "project/attributes/")
+}
// InstanceAttributeValue returns the value of the provided VM
// instance attribute.
@@ -486,8 +709,22 @@ func (c *Client) ProjectAttributes() ([]string, error) { return c.lines("project
//
// InstanceAttributeValue may return ("", nil) if the attribute was
// defined to be the empty string.
+//
+// Deprecated: Please use the context aware variant [Client.InstanceAttributeValueWithContext].
func (c *Client) InstanceAttributeValue(attr string) (string, error) {
- return c.GetWithContext(context.Background(), "instance/attributes/"+attr)
+ return c.InstanceAttributeValueWithContext(context.Background(), attr)
+}
+
+// InstanceAttributeValueWithContext returns the value of the provided VM
+// instance attribute.
+//
+// If the requested attribute is not defined, the returned error will
+// be of type NotDefinedError.
+//
+// InstanceAttributeValue may return ("", nil) if the attribute was
+// defined to be the empty string.
+func (c *Client) InstanceAttributeValueWithContext(ctx context.Context, attr string) (string, error) {
+ return c.GetWithContext(ctx, "instance/attributes/"+attr)
}
// ProjectAttributeValue returns the value of the provided
@@ -498,18 +735,41 @@ func (c *Client) InstanceAttributeValue(attr string) (string, error) {
//
// ProjectAttributeValue may return ("", nil) if the attribute was
// defined to be the empty string.
+//
+// Deprecated: Please use the context aware variant [Client.ProjectAttributeValueWithContext].
func (c *Client) ProjectAttributeValue(attr string) (string, error) {
- return c.GetWithContext(context.Background(), "project/attributes/"+attr)
+ return c.ProjectAttributeValueWithContext(context.Background(), attr)
+}
+
+// ProjectAttributeValueWithContext returns the value of the provided
+// project attribute.
+//
+// If the requested attribute is not defined, the returned error will
+// be of type NotDefinedError.
+//
+// ProjectAttributeValue may return ("", nil) if the attribute was
+// defined to be the empty string.
+func (c *Client) ProjectAttributeValueWithContext(ctx context.Context, attr string) (string, error) {
+ return c.GetWithContext(ctx, "project/attributes/"+attr)
}
// Scopes returns the service account scopes for the given account.
// The account may be empty or the string "default" to use the instance's
// main account.
+//
+// Deprecated: Please use the context aware variant [Client.ScopesWithContext].
func (c *Client) Scopes(serviceAccount string) ([]string, error) {
+ return c.ScopesWithContext(context.Background(), serviceAccount)
+}
+
+// ScopesWithContext returns the service account scopes for the given account.
+// The account may be empty or the string "default" to use the instance's
+// main account.
+func (c *Client) ScopesWithContext(ctx context.Context, serviceAccount string) ([]string, error) {
if serviceAccount == "" {
serviceAccount = "default"
}
- return c.lines("instance/service-accounts/" + serviceAccount + "/scopes")
+ return c.lines(ctx, "instance/service-accounts/"+serviceAccount+"/scopes")
}
// Subscribe subscribes to a value from the metadata service.
diff --git a/vendor/cloud.google.com/go/compute/metadata/retry_linux.go b/vendor/cloud.google.com/go/compute/metadata/retry_linux.go
index bb412f89..2e53f012 100644
--- a/vendor/cloud.google.com/go/compute/metadata/retry_linux.go
+++ b/vendor/cloud.google.com/go/compute/metadata/retry_linux.go
@@ -17,10 +17,15 @@
package metadata
-import "syscall"
+import (
+ "errors"
+ "syscall"
+)
func init() {
// Initialize syscallRetryable to return true on transient socket-level
// errors. These errors are specific to Linux.
- syscallRetryable = func(err error) bool { return err == syscall.ECONNRESET || err == syscall.ECONNREFUSED }
+ syscallRetryable = func(err error) bool {
+ return errors.Is(err, syscall.ECONNRESET) || errors.Is(err, syscall.ECONNREFUSED)
+ }
}
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/doc.go b/vendor/cloud.google.com/go/compute/metadata/syscheck.go
similarity index 53%
rename from vendor/go.opentelemetry.io/otel/semconv/v1.17.0/doc.go
rename to vendor/cloud.google.com/go/compute/metadata/syscheck.go
index 71a1f774..e0704fa6 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/doc.go
+++ b/vendor/cloud.google.com/go/compute/metadata/syscheck.go
@@ -1,10 +1,10 @@
-// Copyright The OpenTelemetry Authors
+// Copyright 2024 Google LLC
//
// 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
+// 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,
@@ -12,9 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Package semconv implements OpenTelemetry semantic conventions.
-//
-// OpenTelemetry semantic conventions are agreed standardized naming
-// patterns for OpenTelemetry things. This package represents the conventions
-// as of the v1.17.0 version of the OpenTelemetry specification.
-package semconv // import "go.opentelemetry.io/otel/semconv/v1.17.0"
+//go:build !windows && !linux
+
+package metadata
+
+// systemInfoSuggestsGCE reports whether the local system (without
+// doing network requests) suggests that we're running on GCE. If this
+// returns true, testOnGCE tries a bit harder to reach its metadata
+// server.
+func systemInfoSuggestsGCE() bool {
+ // We don't currently have checks for other GOOS
+ return false
+}
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/exception.go b/vendor/cloud.google.com/go/compute/metadata/syscheck_linux.go
similarity index 60%
rename from vendor/go.opentelemetry.io/otel/semconv/v1.17.0/exception.go
rename to vendor/cloud.google.com/go/compute/metadata/syscheck_linux.go
index 9b8c559d..74689acb 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/exception.go
+++ b/vendor/cloud.google.com/go/compute/metadata/syscheck_linux.go
@@ -1,10 +1,10 @@
-// Copyright The OpenTelemetry Authors
+// Copyright 2024 Google LLC
//
// 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
+// 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,
@@ -12,9 +12,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-package semconv // import "go.opentelemetry.io/otel/semconv/v1.17.0"
+//go:build linux
-const (
- // ExceptionEventName is the name of the Span event representing an exception.
- ExceptionEventName = "exception"
+package metadata
+
+import (
+ "os"
+ "strings"
)
+
+func systemInfoSuggestsGCE() bool {
+ b, _ := os.ReadFile("/sys/class/dmi/id/product_name")
+ name := strings.TrimSpace(string(b))
+ return name == "Google" || name == "Google Compute Engine"
+}
diff --git a/vendor/cloud.google.com/go/compute/metadata/syscheck_windows.go b/vendor/cloud.google.com/go/compute/metadata/syscheck_windows.go
new file mode 100644
index 00000000..c0ce6278
--- /dev/null
+++ b/vendor/cloud.google.com/go/compute/metadata/syscheck_windows.go
@@ -0,0 +1,38 @@
+// Copyright 2024 Google LLC
+//
+// 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.
+
+//go:build windows
+
+package metadata
+
+import (
+ "strings"
+
+ "golang.org/x/sys/windows/registry"
+)
+
+func systemInfoSuggestsGCE() bool {
+ k, err := registry.OpenKey(registry.LOCAL_MACHINE, `SYSTEM\HardwareConfig\Current`, registry.QUERY_VALUE)
+ if err != nil {
+ return false
+ }
+ defer k.Close()
+
+ s, _, err := k.GetStringValue("SystemProductName")
+ if err != nil {
+ return false
+ }
+ s = strings.TrimSpace(s)
+ return strings.HasPrefix(s, "Google")
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md
index 5c8411cb..f88b277a 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md
@@ -1,5 +1,112 @@
# Release History
+## 1.16.0 (2024-10-17)
+
+### Features Added
+
+* Added field `Kind` to `runtime.StartSpanOptions` to allow a kind to be set when starting a span.
+
+### Bugs Fixed
+
+* `BearerTokenPolicy` now rewinds request bodies before retrying
+
+## 1.15.0 (2024-10-14)
+
+### Features Added
+
+* `BearerTokenPolicy` handles CAE claims challenges
+
+### Bugs Fixed
+
+* Omit the `ResponseError.RawResponse` field from JSON marshaling so instances can be marshaled.
+* Fixed an integer overflow in the retry policy.
+
+### Other Changes
+
+* Update dependencies.
+
+## 1.14.0 (2024-08-07)
+
+### Features Added
+
+* Added field `Attributes` to `runtime.StartSpanOptions` to simplify creating spans with attributes.
+
+### Other Changes
+
+* Include the HTTP verb and URL in `log.EventRetryPolicy` log entries so it's clear which operation is being retried.
+
+## 1.13.0 (2024-07-16)
+
+### Features Added
+
+- Added runtime.NewRequestFromRequest(), allowing for a policy.Request to be created from an existing *http.Request.
+
+## 1.12.0 (2024-06-06)
+
+### Features Added
+
+* Added field `StatusCodes` to `runtime.FetcherForNextLinkOptions` allowing for additional HTTP status codes indicating success.
+* Added func `NewUUID` to the `runtime` package for generating UUIDs.
+
+### Bugs Fixed
+
+* Fixed an issue that prevented pollers using the `Operation-Location` strategy from unmarshaling the final result in some cases.
+
+### Other Changes
+
+* Updated dependencies.
+
+## 1.11.1 (2024-04-02)
+
+### Bugs Fixed
+
+* Pollers that use the `Location` header won't consider `http.StatusRequestTimeout` a terminal failure.
+* `runtime.Poller[T].Result` won't consider non-terminal error responses as terminal.
+
+## 1.11.0 (2024-04-01)
+
+### Features Added
+
+* Added `StatusCodes` to `arm/policy.RegistrationOptions` to allow supporting non-standard HTTP status codes during registration.
+* Added field `InsecureAllowCredentialWithHTTP` to `azcore.ClientOptions` and dependent authentication pipeline policies.
+* Added type `MultipartContent` to the `streaming` package to support multipart/form payloads with custom Content-Type and file name.
+
+### Bugs Fixed
+
+* `runtime.SetMultipartFormData` won't try to stringify `[]byte` values.
+* Pollers that use the `Location` header won't consider `http.StatusTooManyRequests` a terminal failure.
+
+### Other Changes
+
+* Update dependencies.
+
+## 1.10.0 (2024-02-29)
+
+### Features Added
+
+* Added logging event `log.EventResponseError` that will contain the contents of `ResponseError.Error()` whenever an `azcore.ResponseError` is created.
+* Added `runtime.NewResponseErrorWithErrorCode` for creating an `azcore.ResponseError` with a caller-supplied error code.
+* Added type `MatchConditions` for use in conditional requests.
+
+### Bugs Fixed
+
+* Fixed a potential race condition between `NullValue` and `IsNullValue`.
+* `runtime.EncodeQueryParams` will escape semicolons before calling `url.ParseQuery`.
+
+### Other Changes
+
+* Update dependencies.
+
+## 1.9.2 (2024-02-06)
+
+### Bugs Fixed
+
+* `runtime.MarshalAsByteArray` and `runtime.MarshalAsJSON` will preserve the preexisting value of the `Content-Type` header.
+
+### Other Changes
+
+* Update to latest version of `internal`.
+
## 1.9.1 (2023-12-11)
### Bugs Fixed
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource/resource_identifier.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource/resource_identifier.go
index 187fe82b..00f2d5a0 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource/resource_identifier.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource/resource_identifier.go
@@ -192,7 +192,7 @@ func appendNext(parent *ResourceID, parts []string, id string) (*ResourceID, err
}
if strings.EqualFold(parts[0], providersKey) && (len(parts) == 2 || strings.EqualFold(parts[2], providersKey)) {
- //provider resource can only be on a tenant or a subscription parent
+ // provider resource can only be on a tenant or a subscription parent
if parent.ResourceType.String() != SubscriptionResourceType.String() && parent.ResourceType.String() != TenantResourceType.String() {
return nil, fmt.Errorf("invalid resource ID: %s", id)
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy/policy.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy/policy.go
index 83cf91e3..f18caf84 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy/policy.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy/policy.go
@@ -20,6 +20,11 @@ type BearerTokenOptions struct {
// policy's credential must support multitenant authentication.
AuxiliaryTenants []string
+ // InsecureAllowCredentialWithHTTP enables authenticated requests over HTTP.
+ // By default, authenticated requests to an HTTP endpoint are rejected by the client.
+ // WARNING: setting this to true will allow sending the authentication key in clear text. Use with caution.
+ InsecureAllowCredentialWithHTTP bool
+
// Scopes contains the list of permission scopes required for the token.
Scopes []string
}
@@ -44,6 +49,11 @@ type RegistrationOptions struct {
// The default valule is 5 minutes.
// NOTE: Setting this to a small value might cause the policy to prematurely fail.
PollingDuration time.Duration
+
+ // StatusCodes contains the slice of custom HTTP status codes to use instead
+ // of the default http.StatusConflict. This should only be set if a service
+ // returns a non-standard HTTP status code when unregistered.
+ StatusCodes []int
}
// ClientOptions contains configuration settings for a client's pipeline.
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/pipeline.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/pipeline.go
index 302c19cd..6a7c916b 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/pipeline.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/pipeline.go
@@ -30,21 +30,26 @@ func NewPipeline(module, version string, cred azcore.TokenCredential, plOpts azr
return azruntime.Pipeline{}, err
}
authPolicy := NewBearerTokenPolicy(cred, &armpolicy.BearerTokenOptions{
- AuxiliaryTenants: options.AuxiliaryTenants,
- Scopes: []string{conf.Audience + "/.default"},
+ AuxiliaryTenants: options.AuxiliaryTenants,
+ InsecureAllowCredentialWithHTTP: options.InsecureAllowCredentialWithHTTP,
+ Scopes: []string{conf.Audience + "/.default"},
})
+ // we don't want to modify the underlying array in plOpts.PerRetry
perRetry := make([]azpolicy.Policy, len(plOpts.PerRetry), len(plOpts.PerRetry)+1)
copy(perRetry, plOpts.PerRetry)
- plOpts.PerRetry = append(perRetry, authPolicy, exported.PolicyFunc(httpTraceNamespacePolicy))
+ perRetry = append(perRetry, authPolicy, exported.PolicyFunc(httpTraceNamespacePolicy))
+ plOpts.PerRetry = perRetry
if !options.DisableRPRegistration {
regRPOpts := armpolicy.RegistrationOptions{ClientOptions: options.ClientOptions}
regPolicy, err := NewRPRegistrationPolicy(cred, ®RPOpts)
if err != nil {
return azruntime.Pipeline{}, err
}
+ // we don't want to modify the underlying array in plOpts.PerCall
perCall := make([]azpolicy.Policy, len(plOpts.PerCall), len(plOpts.PerCall)+1)
copy(perCall, plOpts.PerCall)
- plOpts.PerCall = append(perCall, regPolicy)
+ perCall = append(perCall, regPolicy)
+ plOpts.PerCall = perCall
}
if plOpts.APIVersion.Name == "" {
plOpts.APIVersion.Name = "api-version"
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_bearer_token.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_bearer_token.go
index 54b3bb78..8ad3d540 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_bearer_token.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_bearer_token.go
@@ -5,7 +5,6 @@ package runtime
import (
"context"
- "encoding/base64"
"fmt"
"net/http"
"strings"
@@ -64,32 +63,18 @@ func NewBearerTokenPolicy(cred azcore.TokenCredential, opts *armpolicy.BearerTok
p.scopes = make([]string, len(opts.Scopes))
copy(p.scopes, opts.Scopes)
p.btp = azruntime.NewBearerTokenPolicy(cred, opts.Scopes, &azpolicy.BearerTokenOptions{
+ InsecureAllowCredentialWithHTTP: opts.InsecureAllowCredentialWithHTTP,
AuthorizationHandler: azpolicy.AuthorizationHandler{
- OnChallenge: p.onChallenge,
- OnRequest: p.onRequest,
+ OnRequest: p.onRequest,
},
})
return p
}
-func (b *BearerTokenPolicy) onChallenge(req *azpolicy.Request, res *http.Response, authNZ func(azpolicy.TokenRequestOptions) error) error {
- challenge := res.Header.Get(shared.HeaderWWWAuthenticate)
- claims, err := parseChallenge(challenge)
- if err != nil {
- // the challenge contains claims we can't parse
- return err
- } else if claims != "" {
- // request a new token having the specified claims, send the request again
- return authNZ(azpolicy.TokenRequestOptions{Claims: claims, EnableCAE: true, Scopes: b.scopes})
- }
- // auth challenge didn't include claims, so this is a simple authorization failure
- return azruntime.NewResponseError(res)
-}
-
// onRequest authorizes requests with one or more bearer tokens
func (b *BearerTokenPolicy) onRequest(req *azpolicy.Request, authNZ func(azpolicy.TokenRequestOptions) error) error {
// authorize the request with a token for the primary tenant
- err := authNZ(azpolicy.TokenRequestOptions{EnableCAE: true, Scopes: b.scopes})
+ err := authNZ(azpolicy.TokenRequestOptions{Scopes: b.scopes})
if err != nil || len(b.auxResources) == 0 {
return err
}
@@ -115,31 +100,3 @@ func (b *BearerTokenPolicy) onRequest(req *azpolicy.Request, authNZ func(azpolic
func (b *BearerTokenPolicy) Do(req *azpolicy.Request) (*http.Response, error) {
return b.btp.Do(req)
}
-
-// parseChallenge parses claims from an authentication challenge issued by ARM so a client can request a token
-// that will satisfy conditional access policies. It returns a non-nil error when the given value contains
-// claims it can't parse. If the value contains no claims, it returns an empty string and a nil error.
-func parseChallenge(wwwAuthenticate string) (string, error) {
- claims := ""
- var err error
- for _, param := range strings.Split(wwwAuthenticate, ",") {
- if _, after, found := strings.Cut(param, "claims="); found {
- if claims != "" {
- // The header contains multiple challenges, at least two of which specify claims. The specs allow this
- // but it's unclear what a client should do in this case and there's as yet no concrete example of it.
- err = fmt.Errorf("found multiple claims challenges in %q", wwwAuthenticate)
- break
- }
- // trim stuff that would get an error from RawURLEncoding; claims may or may not be padded
- claims = strings.Trim(after, `\"=`)
- // we don't return this error because it's something unhelpful like "illegal base64 data at input byte 42"
- if b, decErr := base64.RawURLEncoding.DecodeString(claims); decErr == nil {
- claims = string(b)
- } else {
- err = fmt.Errorf("failed to parse claims from %q", wwwAuthenticate)
- break
- }
- }
- }
- return claims, err
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_register_rp.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_register_rp.go
index 83e15949..810ac9d9 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_register_rp.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_register_rp.go
@@ -8,7 +8,6 @@ package runtime
import (
"context"
- "errors"
"fmt"
"net/http"
"net/url"
@@ -16,6 +15,7 @@ import (
"time"
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource"
armpolicy "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared"
@@ -45,6 +45,9 @@ func setDefaults(r *armpolicy.RegistrationOptions) {
if r.PollingDuration == 0 {
r.PollingDuration = 5 * time.Minute
}
+ if len(r.StatusCodes) == 0 {
+ r.StatusCodes = []int{http.StatusConflict}
+ }
}
// NewRPRegistrationPolicy creates a policy object configured using the specified options.
@@ -88,7 +91,7 @@ func (r *rpRegistrationPolicy) Do(req *azpolicy.Request) (*http.Response, error)
// make the original request
resp, err = req.Next()
// getting a 409 is the first indication that the RP might need to be registered, check error response
- if err != nil || resp.StatusCode != http.StatusConflict {
+ if err != nil || !runtime.HasStatusCode(resp, r.options.StatusCodes...) {
return resp, err
}
var reqErr requestError
@@ -105,17 +108,12 @@ func (r *rpRegistrationPolicy) Do(req *azpolicy.Request) (*http.Response, error)
// to the caller so its error unmarshalling will kick in
return resp, err
}
- // RP needs to be registered. start by getting the subscription ID from the original request
- subID, err := getSubscription(req.Raw().URL.Path)
- if err != nil {
- return resp, err
- }
- // now get the RP from the error
- rp, err = getProvider(reqErr)
+ res, err := resource.ParseResourceID(req.Raw().URL.Path)
if err != nil {
return resp, err
}
- logRegistrationExit := func(v interface{}) {
+ rp = res.ResourceType.Namespace
+ logRegistrationExit := func(v any) {
log.Writef(LogRPRegistration, "END registration for %s: %v", rp, v)
}
log.Writef(LogRPRegistration, "BEGIN registration for %s", rp)
@@ -124,7 +122,7 @@ func (r *rpRegistrationPolicy) Do(req *azpolicy.Request) (*http.Response, error)
rpOps := &providersOperations{
p: r.pipeline,
u: r.endpoint,
- subID: subID,
+ subID: res.SubscriptionID,
}
if _, err = rpOps.Register(&shared.ContextWithDeniedValues{Context: req.Raw().Context()}, rp); err != nil {
logRegistrationExit(err)
@@ -189,36 +187,13 @@ func isUnregisteredRPCode(errorCode string) bool {
return false
}
-func getSubscription(path string) (string, error) {
- parts := strings.Split(path, "/")
- for i, v := range parts {
- if v == "subscriptions" && (i+1) < len(parts) {
- return parts[i+1], nil
- }
- }
- return "", fmt.Errorf("failed to obtain subscription ID from %s", path)
-}
-
-func getProvider(re requestError) (string, error) {
- if len(re.ServiceError.Details) > 0 {
- return re.ServiceError.Details[0].Target, nil
- }
- return "", errors.New("unexpected empty Details")
-}
-
// minimal error definitions to simplify detection
type requestError struct {
ServiceError *serviceError `json:"error"`
}
type serviceError struct {
- Code string `json:"code"`
- Details []serviceErrorDetails `json:"details"`
-}
-
-type serviceErrorDetails struct {
- Code string `json:"code"`
- Target string `json:"target"`
+ Code string `json:"code"`
}
///////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/ci.yml b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/ci.yml
index aab92185..99348527 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/ci.yml
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/ci.yml
@@ -23,7 +23,7 @@ pr:
- sdk/azcore/
- eng/
-stages:
-- template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml
+extends:
+ template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml
parameters:
ServiceDirectory: azcore
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/core.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/core.go
index 8eef8633..9d1c2f0c 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/core.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/core.go
@@ -8,6 +8,7 @@ package azcore
import (
"reflect"
+ "sync"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared"
@@ -41,13 +42,28 @@ func NewSASCredential(sas string) *SASCredential {
}
// holds sentinel values used to send nulls
-var nullables map[reflect.Type]interface{} = map[reflect.Type]interface{}{}
+var nullables map[reflect.Type]any = map[reflect.Type]any{}
+var nullablesMu sync.RWMutex
// NullValue is used to send an explicit 'null' within a request.
// This is typically used in JSON-MERGE-PATCH operations to delete a value.
func NullValue[T any]() T {
t := shared.TypeOfT[T]()
+
+ nullablesMu.RLock()
v, found := nullables[t]
+ nullablesMu.RUnlock()
+
+ if found {
+ // return the sentinel object
+ return v.(T)
+ }
+
+ // promote to exclusive lock and check again (double-checked locking pattern)
+ nullablesMu.Lock()
+ defer nullablesMu.Unlock()
+ v, found = nullables[t]
+
if !found {
var o reflect.Value
if k := t.Kind(); k == reflect.Map {
@@ -72,6 +88,9 @@ func NullValue[T any]() T {
func IsNullValue[T any](v T) bool {
// see if our map has a sentinel object for this *T
t := reflect.TypeOf(v)
+ nullablesMu.RLock()
+ defer nullablesMu.RUnlock()
+
if o, found := nullables[t]; found {
o1 := reflect.ValueOf(o)
v1 := reflect.ValueOf(v)
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/errors.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/errors.go
index 17bd50c6..03cb227d 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/errors.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/errors.go
@@ -11,4 +11,7 @@ import "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported"
// ResponseError is returned when a request is made to a service and
// the service returns a non-success HTTP status code.
// Use errors.As() to access this type in the error chain.
+//
+// When marshaling instances, the RawResponse field will be omitted.
+// However, the contents returned by Error() will be preserved.
type ResponseError = exported.ResponseError
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/etag.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/etag.go
index 23ea7e7c..2b19d01f 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/etag.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/etag.go
@@ -46,3 +46,12 @@ func (e ETag) WeakEquals(other ETag) bool {
func (e ETag) IsWeak() bool {
return len(e) >= 4 && strings.HasPrefix(string(e), "W/\"") && strings.HasSuffix(string(e), "\"")
}
+
+// MatchConditions specifies HTTP options for conditional requests.
+type MatchConditions struct {
+ // Optionally limit requests to resources that have a matching ETag.
+ IfMatch *ETag
+
+ // Optionally limit requests to resources that do not match the ETag.
+ IfNoneMatch *ETag
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/request.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/request.go
index 659f2a7d..e3e2d4e5 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/request.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/request.go
@@ -7,6 +7,7 @@
package exported
import (
+ "bytes"
"context"
"encoding/base64"
"errors"
@@ -51,15 +52,15 @@ type Request struct {
values opValues
}
-type opValues map[reflect.Type]interface{}
+type opValues map[reflect.Type]any
// Set adds/changes a value
-func (ov opValues) set(value interface{}) {
+func (ov opValues) set(value any) {
ov[reflect.TypeOf(value)] = value
}
// Get looks for a value set by SetValue first
-func (ov opValues) get(value interface{}) bool {
+func (ov opValues) get(value any) bool {
v, ok := ov[reflect.ValueOf(value).Elem().Type()]
if ok {
reflect.ValueOf(value).Elem().Set(reflect.ValueOf(v))
@@ -67,6 +68,42 @@ func (ov opValues) get(value interface{}) bool {
return ok
}
+// NewRequestFromRequest creates a new policy.Request with an existing *http.Request
+// Exported as runtime.NewRequestFromRequest().
+func NewRequestFromRequest(req *http.Request) (*Request, error) {
+ policyReq := &Request{req: req}
+
+ if req.Body != nil {
+ // we can avoid a body copy here if the underlying stream is already a
+ // ReadSeekCloser.
+ readSeekCloser, isReadSeekCloser := req.Body.(io.ReadSeekCloser)
+
+ if !isReadSeekCloser {
+ // since this is an already populated http.Request we want to copy
+ // over its body, if it has one.
+ bodyBytes, err := io.ReadAll(req.Body)
+
+ if err != nil {
+ return nil, err
+ }
+
+ if err := req.Body.Close(); err != nil {
+ return nil, err
+ }
+
+ readSeekCloser = NopCloser(bytes.NewReader(bodyBytes))
+ }
+
+ // SetBody also takes care of updating the http.Request's body
+ // as well, so they should stay in-sync from this point.
+ if err := policyReq.SetBody(readSeekCloser, req.Header.Get("Content-Type")); err != nil {
+ return nil, err
+ }
+ }
+
+ return policyReq, nil
+}
+
// NewRequest creates a new Request with the specified input.
// Exported as runtime.NewRequest().
func NewRequest(ctx context.Context, httpMethod string, endpoint string) (*Request, error) {
@@ -108,7 +145,7 @@ func (req *Request) Next() (*http.Response, error) {
}
// SetOperationValue adds/changes a mutable key/value associated with a single operation.
-func (req *Request) SetOperationValue(value interface{}) {
+func (req *Request) SetOperationValue(value any) {
if req.values == nil {
req.values = opValues{}
}
@@ -116,7 +153,7 @@ func (req *Request) SetOperationValue(value interface{}) {
}
// OperationValue looks for a value set by SetOperationValue().
-func (req *Request) OperationValue(value interface{}) bool {
+func (req *Request) OperationValue(value any) bool {
if req.values == nil {
return false
}
@@ -125,46 +162,11 @@ func (req *Request) OperationValue(value interface{}) bool {
// SetBody sets the specified ReadSeekCloser as the HTTP request body, and sets Content-Type and Content-Length
// accordingly. If the ReadSeekCloser is nil or empty, Content-Length won't be set. If contentType is "",
-// Content-Type won't be set.
+// Content-Type won't be set, and if it was set, will be deleted.
// Use streaming.NopCloser to turn an io.ReadSeeker into an io.ReadSeekCloser.
func (req *Request) SetBody(body io.ReadSeekCloser, contentType string) error {
- var err error
- var size int64
- if body != nil {
- size, err = body.Seek(0, io.SeekEnd) // Seek to the end to get the stream's size
- if err != nil {
- return err
- }
- }
- if size == 0 {
- // treat an empty stream the same as a nil one: assign req a nil body
- body = nil
- // RFC 9110 specifies a client shouldn't set Content-Length on a request containing no content
- // (Del is a no-op when the header has no value)
- req.req.Header.Del(shared.HeaderContentLength)
- } else {
- _, err = body.Seek(0, io.SeekStart)
- if err != nil {
- return err
- }
- req.req.Header.Set(shared.HeaderContentLength, strconv.FormatInt(size, 10))
- req.Raw().GetBody = func() (io.ReadCloser, error) {
- _, err := body.Seek(0, io.SeekStart) // Seek back to the beginning of the stream
- return body, err
- }
- }
- // keep a copy of the body argument. this is to handle cases
- // where req.Body is replaced, e.g. httputil.DumpRequest and friends.
- req.body = body
- req.req.Body = body
- req.req.ContentLength = size
- if contentType == "" {
- // Del is a no-op when the header has no value
- req.req.Header.Del(shared.HeaderContentType)
- } else {
- req.req.Header.Set(shared.HeaderContentType, contentType)
- }
- return nil
+ // clobber the existing Content-Type to preserve behavior
+ return SetBody(req, body, contentType, true)
}
// RewindBody seeks the request's Body stream back to the beginning so it can be resent when retrying an operation.
@@ -211,3 +213,48 @@ type PolicyFunc func(*Request) (*http.Response, error)
func (pf PolicyFunc) Do(req *Request) (*http.Response, error) {
return pf(req)
}
+
+// SetBody sets the specified ReadSeekCloser as the HTTP request body, and sets Content-Type and Content-Length accordingly.
+// - req is the request to modify
+// - body is the request body; if nil or empty, Content-Length won't be set
+// - contentType is the value for the Content-Type header; if empty, Content-Type will be deleted
+// - clobberContentType when true, will overwrite the existing value of Content-Type with contentType
+func SetBody(req *Request, body io.ReadSeekCloser, contentType string, clobberContentType bool) error {
+ var err error
+ var size int64
+ if body != nil {
+ size, err = body.Seek(0, io.SeekEnd) // Seek to the end to get the stream's size
+ if err != nil {
+ return err
+ }
+ }
+ if size == 0 {
+ // treat an empty stream the same as a nil one: assign req a nil body
+ body = nil
+ // RFC 9110 specifies a client shouldn't set Content-Length on a request containing no content
+ // (Del is a no-op when the header has no value)
+ req.req.Header.Del(shared.HeaderContentLength)
+ } else {
+ _, err = body.Seek(0, io.SeekStart)
+ if err != nil {
+ return err
+ }
+ req.req.Header.Set(shared.HeaderContentLength, strconv.FormatInt(size, 10))
+ req.Raw().GetBody = func() (io.ReadCloser, error) {
+ _, err := body.Seek(0, io.SeekStart) // Seek back to the beginning of the stream
+ return body, err
+ }
+ }
+ // keep a copy of the body argument. this is to handle cases
+ // where req.Body is replaced, e.g. httputil.DumpRequest and friends.
+ req.body = body
+ req.req.Body = body
+ req.req.ContentLength = size
+ if contentType == "" {
+ // Del is a no-op when the header has no value
+ req.req.Header.Del(shared.HeaderContentType)
+ } else if req.req.Header.Get(shared.HeaderContentType) == "" || clobberContentType {
+ req.req.Header.Set(shared.HeaderContentType, contentType)
+ }
+ return nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/response_error.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/response_error.go
index f2435528..8aec256b 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/response_error.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/response_error.go
@@ -13,6 +13,7 @@ import (
"net/http"
"regexp"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared"
"github.com/Azure/azure-sdk-for-go/sdk/internal/exported"
)
@@ -20,36 +21,45 @@ import (
// NewResponseError creates a new *ResponseError from the provided HTTP response.
// Exported as runtime.NewResponseError().
func NewResponseError(resp *http.Response) error {
- respErr := &ResponseError{
- StatusCode: resp.StatusCode,
- RawResponse: resp,
- }
-
// prefer the error code in the response header
if ec := resp.Header.Get(shared.HeaderXMSErrorCode); ec != "" {
- respErr.ErrorCode = ec
- return respErr
+ return NewResponseErrorWithErrorCode(resp, ec)
}
// if we didn't get x-ms-error-code, check in the response body
body, err := exported.Payload(resp, nil)
if err != nil {
+ // since we're not returning the ResponseError in this
+ // case we also don't want to write it to the log.
return err
}
+ var errorCode string
if len(body) > 0 {
- if code := extractErrorCodeJSON(body); code != "" {
- respErr.ErrorCode = code
- } else if code := extractErrorCodeXML(body); code != "" {
- respErr.ErrorCode = code
+ if fromJSON := extractErrorCodeJSON(body); fromJSON != "" {
+ errorCode = fromJSON
+ } else if fromXML := extractErrorCodeXML(body); fromXML != "" {
+ errorCode = fromXML
}
}
+ return NewResponseErrorWithErrorCode(resp, errorCode)
+}
+
+// NewResponseErrorWithErrorCode creates an *azcore.ResponseError from the provided HTTP response and errorCode.
+// Exported as runtime.NewResponseErrorWithErrorCode().
+func NewResponseErrorWithErrorCode(resp *http.Response, errorCode string) error {
+ respErr := &ResponseError{
+ ErrorCode: errorCode,
+ StatusCode: resp.StatusCode,
+ RawResponse: resp,
+ }
+ log.Write(log.EventResponseError, respErr.Error())
return respErr
}
func extractErrorCodeJSON(body []byte) string {
- var rawObj map[string]interface{}
+ var rawObj map[string]any
if err := json.Unmarshal(body, &rawObj); err != nil {
// not a JSON object
return ""
@@ -58,7 +68,7 @@ func extractErrorCodeJSON(body []byte) string {
// check if this is a wrapped error, i.e. { "error": { ... } }
// if so then unwrap it
if wrapped, ok := rawObj["error"]; ok {
- unwrapped, ok := wrapped.(map[string]interface{})
+ unwrapped, ok := wrapped.(map[string]any)
if !ok {
return ""
}
@@ -107,12 +117,18 @@ type ResponseError struct {
StatusCode int
// RawResponse is the underlying HTTP response.
- RawResponse *http.Response
+ RawResponse *http.Response `json:"-"`
+
+ errMsg string
}
// Error implements the error interface for type ResponseError.
// Note that the message contents are not contractual and can change over time.
func (e *ResponseError) Error() string {
+ if e.errMsg != "" {
+ return e.errMsg
+ }
+
const separator = "--------------------------------------------------------------------------------"
// write the request method and URL with response status code
msg := &bytes.Buffer{}
@@ -153,5 +169,33 @@ func (e *ResponseError) Error() string {
}
fmt.Fprintln(msg, separator)
- return msg.String()
+ e.errMsg = msg.String()
+ return e.errMsg
+}
+
+// internal type used for marshaling/unmarshaling
+type responseError struct {
+ ErrorCode string `json:"errorCode"`
+ StatusCode int `json:"statusCode"`
+ ErrorMessage string `json:"errorMessage"`
+}
+
+func (e ResponseError) MarshalJSON() ([]byte, error) {
+ return json.Marshal(responseError{
+ ErrorCode: e.ErrorCode,
+ StatusCode: e.StatusCode,
+ ErrorMessage: e.Error(),
+ })
+}
+
+func (e *ResponseError) UnmarshalJSON(data []byte) error {
+ re := responseError{}
+ if err := json.Unmarshal(data, &re); err != nil {
+ return err
+ }
+
+ e.ErrorCode = re.ErrorCode
+ e.StatusCode = re.StatusCode
+ e.errMsg = re.ErrorMessage
+ return nil
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/log/log.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/log/log.go
index 0684cb31..6fc6d140 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/log/log.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/log/log.go
@@ -15,24 +15,36 @@ import (
type Event = log.Event
const (
- EventRequest = azlog.EventRequest
- EventResponse = azlog.EventResponse
- EventRetryPolicy = azlog.EventRetryPolicy
- EventLRO = azlog.EventLRO
+ EventRequest = azlog.EventRequest
+ EventResponse = azlog.EventResponse
+ EventResponseError = azlog.EventResponseError
+ EventRetryPolicy = azlog.EventRetryPolicy
+ EventLRO = azlog.EventLRO
)
+// Write invokes the underlying listener with the specified event and message.
+// If the event shouldn't be logged or there is no listener then Write does nothing.
func Write(cls log.Event, msg string) {
log.Write(cls, msg)
}
-func Writef(cls log.Event, format string, a ...interface{}) {
+// Writef invokes the underlying listener with the specified event and formatted message.
+// If the event shouldn't be logged or there is no listener then Writef does nothing.
+func Writef(cls log.Event, format string, a ...any) {
log.Writef(cls, format, a...)
}
+// SetListener will set the Logger to write to the specified listener.
func SetListener(lst func(Event, string)) {
log.SetListener(lst)
}
+// Should returns true if the specified log event should be written to the log.
+// By default all log events will be logged. Call SetEvents() to limit
+// the log events for logging.
+// If no listener has been set this will return false.
+// Calling this method is useful when the message to log is computationally expensive
+// and you want to avoid the overhead if its log event is not enabled.
func Should(cls log.Event) bool {
return log.Should(cls)
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/async/async.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/async/async.go
index b05bd8b3..a5346276 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/async/async.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/async/async.go
@@ -27,7 +27,7 @@ func Applicable(resp *http.Response) bool {
}
// CanResume returns true if the token can rehydrate this poller type.
-func CanResume(token map[string]interface{}) bool {
+func CanResume(token map[string]any) bool {
_, ok := token["asyncURL"]
return ok
}
@@ -155,5 +155,5 @@ func (p *Poller[T]) Result(ctx context.Context, out *T) error {
p.resp = resp
}
- return pollers.ResultHelper(p.resp, poller.Failed(p.CurState), out)
+ return pollers.ResultHelper(p.resp, poller.Failed(p.CurState), "", out)
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/body/body.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/body/body.go
index 2bb9e105..8751b051 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/body/body.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/body/body.go
@@ -29,7 +29,7 @@ func Applicable(resp *http.Response) bool {
}
// CanResume returns true if the token can rehydrate this poller type.
-func CanResume(token map[string]interface{}) bool {
+func CanResume(token map[string]any) bool {
t, ok := token["type"]
if !ok {
return false
@@ -131,5 +131,5 @@ func (p *Poller[T]) Poll(ctx context.Context) (*http.Response, error) {
}
func (p *Poller[T]) Result(ctx context.Context, out *T) error {
- return pollers.ResultHelper(p.resp, poller.Failed(p.CurState), out)
+ return pollers.ResultHelper(p.resp, poller.Failed(p.CurState), "", out)
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/fake/fake.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/fake/fake.go
index 25983471..7f8d11b8 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/fake/fake.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/fake/fake.go
@@ -26,7 +26,7 @@ func Applicable(resp *http.Response) bool {
}
// CanResume returns true if the token can rehydrate this poller type.
-func CanResume(token map[string]interface{}) bool {
+func CanResume(token map[string]any) bool {
_, ok := token["fakeURL"]
return ok
}
@@ -124,7 +124,7 @@ func (p *Poller[T]) Result(ctx context.Context, out *T) error {
return exported.NewResponseError(p.resp)
}
- return pollers.ResultHelper(p.resp, poller.Failed(p.FakeStatus), out)
+ return pollers.ResultHelper(p.resp, poller.Failed(p.FakeStatus), "", out)
}
// SanitizePollerPath removes any fake-appended suffix from a URL's path.
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/loc/loc.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/loc/loc.go
index d6be8987..04828527 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/loc/loc.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/loc/loc.go
@@ -28,7 +28,7 @@ func Applicable(resp *http.Response) bool {
}
// CanResume returns true if the token can rehydrate this poller type.
-func CanResume(token map[string]interface{}) bool {
+func CanResume(token map[string]any) bool {
t, ok := token["type"]
if !ok {
return false
@@ -103,6 +103,10 @@ func (p *Poller[T]) Poll(ctx context.Context) (*http.Response, error) {
} else if resp.StatusCode > 199 && resp.StatusCode < 300 {
// any 2xx other than a 202 indicates success
p.CurState = poller.StatusSucceeded
+ } else if pollers.IsNonTerminalHTTPStatusCode(resp) {
+ // the request timed out or is being throttled.
+ // DO NOT include this as a terminal failure. preserve
+ // the existing state and return the response.
} else {
p.CurState = poller.StatusFailed
}
@@ -115,5 +119,5 @@ func (p *Poller[T]) Poll(ctx context.Context) (*http.Response, error) {
}
func (p *Poller[T]) Result(ctx context.Context, out *T) error {
- return pollers.ResultHelper(p.resp, poller.Failed(p.CurState), out)
+ return pollers.ResultHelper(p.resp, poller.Failed(p.CurState), "", out)
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/op/op.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/op/op.go
index 1bc7ad0a..03699fd7 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/op/op.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/op/op.go
@@ -25,7 +25,7 @@ func Applicable(resp *http.Response) bool {
}
// CanResume returns true if the token can rehydrate this poller type.
-func CanResume(token map[string]interface{}) bool {
+func CanResume(token map[string]any) bool {
_, ok := token["oplocURL"]
return ok
}
@@ -115,10 +115,13 @@ func (p *Poller[T]) Poll(ctx context.Context) (*http.Response, error) {
func (p *Poller[T]) Result(ctx context.Context, out *T) error {
var req *exported.Request
var err error
+
+ // when the payload is included with the status monitor on
+ // terminal success it's in the "result" JSON property
+ payloadPath := "result"
+
if p.FinalState == pollers.FinalStateViaLocation && p.LocURL != "" {
req, err = exported.NewRequest(ctx, http.MethodGet, p.LocURL)
- } else if p.FinalState == pollers.FinalStateViaOpLocation && p.Method == http.MethodPost {
- // no final GET required, terminal response should have it
} else if rl, rlErr := poller.GetResourceLocation(p.resp); rlErr != nil && !errors.Is(rlErr, poller.ErrNoBody) {
return rlErr
} else if rl != "" {
@@ -134,6 +137,8 @@ func (p *Poller[T]) Result(ctx context.Context, out *T) error {
// if a final GET request has been created, execute it
if req != nil {
+ // no JSON path when making a final GET request
+ payloadPath = ""
resp, err := p.pl.Do(req)
if err != nil {
return err
@@ -141,5 +146,5 @@ func (p *Poller[T]) Result(ctx context.Context, out *T) error {
p.resp = resp
}
- return pollers.ResultHelper(p.resp, poller.Failed(p.CurState), out)
+ return pollers.ResultHelper(p.resp, poller.Failed(p.CurState), payloadPath, out)
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/util.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/util.go
index d8d86a46..6a7a32e0 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/util.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/util.go
@@ -74,7 +74,7 @@ func ExtractToken(token string) ([]byte, error) {
// IsTokenValid returns an error if the specified token isn't applicable for generic type T.
func IsTokenValid[T any](token string) error {
- raw := map[string]interface{}{}
+ raw := map[string]any{}
if err := json.Unmarshal([]byte(token), &raw); err != nil {
return err
}
@@ -159,7 +159,7 @@ func PollHelper(ctx context.Context, endpoint string, pl azexported.Pipeline, up
// ResultHelper processes the response as success or failure.
// In the success case, it unmarshals the payload into either a new instance of T or out.
// In the failure case, it creates an *azcore.Response error from the response.
-func ResultHelper[T any](resp *http.Response, failed bool, out *T) error {
+func ResultHelper[T any](resp *http.Response, failed bool, jsonPath string, out *T) error {
// short-circuit the simple success case with no response body to unmarshal
if resp.StatusCode == http.StatusNoContent {
return nil
@@ -176,6 +176,18 @@ func ResultHelper[T any](resp *http.Response, failed bool, out *T) error {
if err != nil {
return err
}
+
+ if jsonPath != "" && len(payload) > 0 {
+ // extract the payload from the specified JSON path.
+ // do this before the zero-length check in case there
+ // is no payload.
+ jsonBody := map[string]json.RawMessage{}
+ if err = json.Unmarshal(payload, &jsonBody); err != nil {
+ return err
+ }
+ payload = jsonBody[jsonPath]
+ }
+
if len(payload) == 0 {
return nil
}
@@ -185,3 +197,16 @@ func ResultHelper[T any](resp *http.Response, failed bool, out *T) error {
}
return nil
}
+
+// IsNonTerminalHTTPStatusCode returns true if the HTTP status code should be
+// considered non-terminal thus eligible for retry.
+func IsNonTerminalHTTPStatusCode(resp *http.Response) bool {
+ return exported.HasStatusCode(resp,
+ http.StatusRequestTimeout, // 408
+ http.StatusTooManyRequests, // 429
+ http.StatusInternalServerError, // 500
+ http.StatusBadGateway, // 502
+ http.StatusServiceUnavailable, // 503
+ http.StatusGatewayTimeout, // 504
+ )
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go
index bb93daee..9f53770e 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go
@@ -40,5 +40,5 @@ const (
Module = "azcore"
// Version is the semantic version (see http://semver.org) of this module.
- Version = "v1.9.1"
+ Version = "v1.16.0"
)
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/log/log.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/log/log.go
index 7bde29d0..f260dac3 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/log/log.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/log/log.go
@@ -23,6 +23,11 @@ const (
// This includes information like the HTTP status code, headers, and request URL.
EventResponse Event = "Response"
+ // EventResponseError entries contain information about HTTP responses that returned
+ // an *azcore.ResponseError (i.e. responses with a non 2xx HTTP status code).
+ // This includes the contents of ResponseError.Error().
+ EventResponseError Event = "ResponseError"
+
// EventRetryPolicy entries contain information specific to the retry policy in use.
EventRetryPolicy Event = "Retry"
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/policy/policy.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/policy/policy.go
index d934f1dc..bb37a5ef 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/policy/policy.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/policy/policy.go
@@ -39,6 +39,11 @@ type ClientOptions struct {
// Cloud specifies a cloud for the client. The default is Azure Public Cloud.
Cloud cloud.Configuration
+ // InsecureAllowCredentialWithHTTP enables authenticated requests over HTTP.
+ // By default, authenticated requests to an HTTP endpoint are rejected by the client.
+ // WARNING: setting this to true will allow sending the credential in clear text. Use with caution.
+ InsecureAllowCredentialWithHTTP bool
+
// Logging configures the built-in logging policy.
Logging LogOptions
@@ -147,23 +152,29 @@ type BearerTokenOptions struct {
// When this field isn't set, the policy follows its default behavior of authorizing every request with a bearer token from
// its given credential.
AuthorizationHandler AuthorizationHandler
+
+ // InsecureAllowCredentialWithHTTP enables authenticated requests over HTTP.
+ // By default, authenticated requests to an HTTP endpoint are rejected by the client.
+ // WARNING: setting this to true will allow sending the bearer token in clear text. Use with caution.
+ InsecureAllowCredentialWithHTTP bool
}
// AuthorizationHandler allows SDK developers to insert custom logic that runs when BearerTokenPolicy must authorize a request.
type AuthorizationHandler struct {
- // OnRequest is called each time the policy receives a request. Its func parameter authorizes the request with a token
- // from the policy's given credential. Implementations that need to perform I/O should use the Request's context,
- // available from Request.Raw().Context(). When OnRequest returns an error, the policy propagates that error and doesn't
- // send the request. When OnRequest is nil, the policy follows its default behavior, authorizing the request with a
- // token from its credential according to its configuration.
+ // OnRequest provides TokenRequestOptions the policy can use to acquire a token for a request. The policy calls OnRequest
+ // whenever it needs a token and may call it multiple times for the same request. Its func parameter authorizes the request
+ // with a token from the policy's credential. Implementations that need to perform I/O should use the Request's context,
+ // available from Request.Raw().Context(). When OnRequest returns an error, the policy propagates that error and doesn't send
+ // the request. When OnRequest is nil, the policy follows its default behavior, which is to authorize the request with a token
+ // from its credential according to its configuration.
OnRequest func(*Request, func(TokenRequestOptions) error) error
- // OnChallenge is called when the policy receives a 401 response, allowing the AuthorizationHandler to re-authorize the
- // request according to an authentication challenge (the Response's WWW-Authenticate header). OnChallenge is responsible
- // for parsing parameters from the challenge. Its func parameter will authorize the request with a token from the policy's
- // given credential. Implementations that need to perform I/O should use the Request's context, available from
- // Request.Raw().Context(). When OnChallenge returns nil, the policy will send the request again. When OnChallenge is nil,
- // the policy will return any 401 response to the client.
+ // OnChallenge allows clients to implement custom HTTP authentication challenge handling. BearerTokenPolicy calls it upon
+ // receiving a 401 response containing multiple Bearer challenges or a challenge BearerTokenPolicy itself can't handle.
+ // OnChallenge is responsible for parsing challenge(s) (the Response's WWW-Authenticate header) and reauthorizing the
+ // Request accordingly. Its func argument authorizes the Request with a token from the policy's credential using the given
+ // TokenRequestOptions. OnChallenge should honor the Request's context, available from Request.Raw().Context(). When
+ // OnChallenge returns nil, the policy will send the Request again.
OnChallenge func(*Request, *http.Response, func(TokenRequestOptions) error) error
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/errors.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/errors.go
index 6d03b291..c0d56158 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/errors.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/errors.go
@@ -14,6 +14,14 @@ import (
// NewResponseError creates an *azcore.ResponseError from the provided HTTP response.
// Call this when a service request returns a non-successful status code.
+// The error code will be extracted from the *http.Response, either from the x-ms-error-code
+// header (preferred) or attempted to be parsed from the response body.
func NewResponseError(resp *http.Response) error {
return exported.NewResponseError(resp)
}
+
+// NewResponseErrorWithErrorCode creates an *azcore.ResponseError from the provided HTTP response and errorCode.
+// Use this variant when the error code is in a non-standard location.
+func NewResponseErrorWithErrorCode(resp *http.Response, errorCode string) error {
+ return exported.NewResponseErrorWithErrorCode(resp, errorCode)
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/pager.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/pager.go
index cffe692d..b960cff0 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/pager.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/pager.go
@@ -94,6 +94,10 @@ type FetcherForNextLinkOptions struct {
// NextReq is the func to be called when requesting subsequent pages.
// Used for paged operations that have a custom next link operation.
NextReq func(context.Context, string) (*policy.Request, error)
+
+ // StatusCodes contains additional HTTP status codes indicating success.
+ // The default value is http.StatusOK.
+ StatusCodes []int
}
// FetcherForNextLink is a helper containing boilerplate code to simplify creating a PagingHandler[T].Fetcher from a next link URL.
@@ -105,10 +109,13 @@ type FetcherForNextLinkOptions struct {
func FetcherForNextLink(ctx context.Context, pl Pipeline, nextLink string, firstReq func(context.Context) (*policy.Request, error), options *FetcherForNextLinkOptions) (*http.Response, error) {
var req *policy.Request
var err error
+ if options == nil {
+ options = &FetcherForNextLinkOptions{}
+ }
if nextLink == "" {
req, err = firstReq(ctx)
} else if nextLink, err = EncodeQueryParams(nextLink); err == nil {
- if options != nil && options.NextReq != nil {
+ if options.NextReq != nil {
req, err = options.NextReq(ctx, nextLink)
} else {
req, err = NewRequest(ctx, http.MethodGet, nextLink)
@@ -121,7 +128,9 @@ func FetcherForNextLink(ctx context.Context, pl Pipeline, nextLink string, first
if err != nil {
return nil, err
}
- if !HasStatusCode(resp, http.StatusOK) {
+ successCodes := []int{http.StatusOK}
+ successCodes = append(successCodes, options.StatusCodes...)
+ if !HasStatusCode(resp, successCodes...) {
return nil, NewResponseError(resp)
}
return resp, nil
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_bearer_token.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_bearer_token.go
index f0f28035..b26db920 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_bearer_token.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_bearer_token.go
@@ -4,9 +4,12 @@
package runtime
import (
+ "encoding/base64"
"errors"
"net/http"
+ "regexp"
"strings"
+ "sync"
"time"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported"
@@ -17,6 +20,11 @@ import (
)
// BearerTokenPolicy authorizes requests with bearer tokens acquired from a TokenCredential.
+// It handles [Continuous Access Evaluation] (CAE) challenges. Clients needing to handle
+// additional authentication challenges, or needing more control over authorization, should
+// provide a [policy.AuthorizationHandler] in [policy.BearerTokenOptions].
+//
+// [Continuous Access Evaluation]: https://learn.microsoft.com/entra/identity/conditional-access/concept-continuous-access-evaluation
type BearerTokenPolicy struct {
// mainResource is the resource to be retreived using the tenant specified in the credential
mainResource *temporal.Resource[exported.AccessToken, acquiringResourceState]
@@ -24,6 +32,7 @@ type BearerTokenPolicy struct {
authzHandler policy.AuthorizationHandler
cred exported.TokenCredential
scopes []string
+ allowHTTP bool
}
type acquiringResourceState struct {
@@ -50,17 +59,29 @@ func NewBearerTokenPolicy(cred exported.TokenCredential, scopes []string, opts *
if opts == nil {
opts = &policy.BearerTokenOptions{}
}
+ ah := opts.AuthorizationHandler
+ if ah.OnRequest == nil {
+ // Set a default OnRequest that simply requests a token with the given scopes. OnChallenge
+ // doesn't get a default so the policy can use a nil check to determine whether the caller
+ // provided an implementation.
+ ah.OnRequest = func(_ *policy.Request, authNZ func(policy.TokenRequestOptions) error) error {
+ // authNZ sets EnableCAE: true in all cases, no need to duplicate that here
+ return authNZ(policy.TokenRequestOptions{Scopes: scopes})
+ }
+ }
return &BearerTokenPolicy{
- authzHandler: opts.AuthorizationHandler,
+ authzHandler: ah,
cred: cred,
scopes: scopes,
mainResource: temporal.NewResource(acquire),
+ allowHTTP: opts.InsecureAllowCredentialWithHTTP,
}
}
// authenticateAndAuthorize returns a function which authorizes req with a token from the policy's credential
func (b *BearerTokenPolicy) authenticateAndAuthorize(req *policy.Request) func(policy.TokenRequestOptions) error {
return func(tro policy.TokenRequestOptions) error {
+ tro.EnableCAE = true
as := acquiringResourceState{p: b, req: req, tro: tro}
tk, err := b.mainResource.Get(as)
if err != nil {
@@ -80,16 +101,11 @@ func (b *BearerTokenPolicy) Do(req *policy.Request) (*http.Response, error) {
return req.Next()
}
- if err := checkHTTPSForAuth(req); err != nil {
+ if err := checkHTTPSForAuth(req, b.allowHTTP); err != nil {
return nil, err
}
- var err error
- if b.authzHandler.OnRequest != nil {
- err = b.authzHandler.OnRequest(req, b.authenticateAndAuthorize(req))
- } else {
- err = b.authenticateAndAuthorize(req)(policy.TokenRequestOptions{Scopes: b.scopes})
- }
+ err := b.authzHandler.OnRequest(req, b.authenticateAndAuthorize(req))
if err != nil {
return nil, errorinfo.NonRetriableError(err)
}
@@ -99,23 +115,122 @@ func (b *BearerTokenPolicy) Do(req *policy.Request) (*http.Response, error) {
return nil, err
}
+ res, err = b.handleChallenge(req, res, false)
+ return res, err
+}
+
+// handleChallenge handles authentication challenges either directly (for CAE challenges) or by calling
+// the AuthorizationHandler. It's a no-op when the response doesn't include an authentication challenge.
+// It will recurse at most once, to handle a CAE challenge following a non-CAE challenge handled by the
+// AuthorizationHandler.
+func (b *BearerTokenPolicy) handleChallenge(req *policy.Request, res *http.Response, recursed bool) (*http.Response, error) {
+ var err error
if res.StatusCode == http.StatusUnauthorized {
b.mainResource.Expire()
- if res.Header.Get("WWW-Authenticate") != "" && b.authzHandler.OnChallenge != nil {
- if err = b.authzHandler.OnChallenge(req, res, b.authenticateAndAuthorize(req)); err == nil {
- res, err = req.Next()
+ if res.Header.Get(shared.HeaderWWWAuthenticate) != "" {
+ caeChallenge, parseErr := parseCAEChallenge(res)
+ if parseErr != nil {
+ return res, parseErr
+ }
+ switch {
+ case caeChallenge != nil:
+ authNZ := func(tro policy.TokenRequestOptions) error {
+ // Take the TokenRequestOptions provided by OnRequest and add the challenge claims. The value
+ // will be empty at time of writing because CAE is the only feature involving claims. If in
+ // the future some client needs to specify unrelated claims, this function may need to merge
+ // them with the challenge claims.
+ tro.Claims = caeChallenge.params["claims"]
+ return b.authenticateAndAuthorize(req)(tro)
+ }
+ if err = b.authzHandler.OnRequest(req, authNZ); err == nil {
+ if err = req.RewindBody(); err == nil {
+ res, err = req.Next()
+ }
+ }
+ case b.authzHandler.OnChallenge != nil && !recursed:
+ if err = b.authzHandler.OnChallenge(req, res, b.authenticateAndAuthorize(req)); err == nil {
+ if err = req.RewindBody(); err == nil {
+ if res, err = req.Next(); err == nil {
+ res, err = b.handleChallenge(req, res, true)
+ }
+ }
+ } else {
+ // don't retry challenge handling errors
+ err = errorinfo.NonRetriableError(err)
+ }
+ default:
+ // return the response to the pipeline
}
}
}
- if err != nil {
- err = errorinfo.NonRetriableError(err)
- }
return res, err
}
-func checkHTTPSForAuth(req *policy.Request) error {
- if strings.ToLower(req.Raw().URL.Scheme) != "https" {
+func checkHTTPSForAuth(req *policy.Request, allowHTTP bool) error {
+ if strings.ToLower(req.Raw().URL.Scheme) != "https" && !allowHTTP {
return errorinfo.NonRetriableError(errors.New("authenticated requests are not permitted for non TLS protected (https) endpoints"))
}
return nil
}
+
+// parseCAEChallenge returns a *authChallenge representing Response's CAE challenge (nil when Response has none).
+// If Response includes a CAE challenge having invalid claims, it returns a NonRetriableError.
+func parseCAEChallenge(res *http.Response) (*authChallenge, error) {
+ var (
+ caeChallenge *authChallenge
+ err error
+ )
+ for _, c := range parseChallenges(res) {
+ if c.scheme == "Bearer" {
+ if claims := c.params["claims"]; claims != "" && c.params["error"] == "insufficient_claims" {
+ if b, de := base64.StdEncoding.DecodeString(claims); de == nil {
+ c.params["claims"] = string(b)
+ caeChallenge = &c
+ } else {
+ // don't include the decoding error because it's something
+ // unhelpful like "illegal base64 data at input byte 42"
+ err = errorinfo.NonRetriableError(errors.New("authentication challenge contains invalid claims: " + claims))
+ }
+ break
+ }
+ }
+ }
+ return caeChallenge, err
+}
+
+var (
+ challenge, challengeParams *regexp.Regexp
+ once = &sync.Once{}
+)
+
+type authChallenge struct {
+ scheme string
+ params map[string]string
+}
+
+// parseChallenges assumes authentication challenges have quoted parameter values
+func parseChallenges(res *http.Response) []authChallenge {
+ once.Do(func() {
+ // matches challenges having quoted parameters, capturing scheme and parameters
+ challenge = regexp.MustCompile(`(?:(\w+) ((?:\w+="[^"]*",?\s*)+))`)
+ // captures parameter names and values in a match of the above expression
+ challengeParams = regexp.MustCompile(`(\w+)="([^"]*)"`)
+ })
+ parsed := []authChallenge{}
+ // WWW-Authenticate can have multiple values, each containing multiple challenges
+ for _, h := range res.Header.Values(shared.HeaderWWWAuthenticate) {
+ for _, sm := range challenge.FindAllStringSubmatch(h, -1) {
+ // sm is [challenge, scheme, params] (see regexp documentation on submatches)
+ c := authChallenge{
+ params: make(map[string]string),
+ scheme: sm[1],
+ }
+ for _, sm := range challengeParams.FindAllStringSubmatch(sm[2], -1) {
+ // sm is [key="value", key, value] (see regexp documentation on submatches)
+ c.params[sm[1]] = sm[2]
+ }
+ parsed = append(parsed, c)
+ }
+ }
+ return parsed
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_http_trace.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_http_trace.go
index 3df1c121..f375195c 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_http_trace.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_http_trace.go
@@ -96,7 +96,10 @@ func (h *httpTracePolicy) Do(req *policy.Request) (resp *http.Response, err erro
// StartSpanOptions contains the optional values for StartSpan.
type StartSpanOptions struct {
- // for future expansion
+ // Kind indicates the kind of Span.
+ Kind tracing.SpanKind
+ // Attributes contains key-value pairs of attributes for the span.
+ Attributes []tracing.Attribute
}
// StartSpan starts a new tracing span.
@@ -114,7 +117,6 @@ func StartSpan(ctx context.Context, name string, tracer tracing.Tracer, options
// we MUST propagate the active tracer before returning so that the trace policy can access it
ctx = context.WithValue(ctx, shared.CtxWithTracingTracer{}, tracer)
- const newSpanKind = tracing.SpanKindInternal
if activeSpan := ctx.Value(ctxActiveSpan{}); activeSpan != nil {
// per the design guidelines, if a SDK method Foo() calls SDK method Bar(),
// then the span for Bar() must be suppressed. however, if Bar() makes a REST
@@ -126,10 +128,19 @@ func StartSpan(ctx context.Context, name string, tracer tracing.Tracer, options
return ctx, func(err error) {}
}
}
+
+ if options == nil {
+ options = &StartSpanOptions{}
+ }
+ if options.Kind == 0 {
+ options.Kind = tracing.SpanKindInternal
+ }
+
ctx, span := tracer.Start(ctx, name, &tracing.SpanOptions{
- Kind: newSpanKind,
+ Kind: options.Kind,
+ Attributes: options.Attributes,
})
- ctx = context.WithValue(ctx, ctxActiveSpan{}, newSpanKind)
+ ctx = context.WithValue(ctx, ctxActiveSpan{}, options.Kind)
return ctx, func(err error) {
if err != nil {
errType := strings.Replace(fmt.Sprintf("%T", err), "*exported.", "*azcore.", 1)
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_key_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_key_credential.go
index 6f577fa7..eeb1c09c 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_key_credential.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_key_credential.go
@@ -12,13 +12,19 @@ import (
// KeyCredentialPolicy authorizes requests with a [azcore.KeyCredential].
type KeyCredentialPolicy struct {
- cred *exported.KeyCredential
- header string
- prefix string
+ cred *exported.KeyCredential
+ header string
+ prefix string
+ allowHTTP bool
}
// KeyCredentialPolicyOptions contains the optional values configuring [KeyCredentialPolicy].
type KeyCredentialPolicyOptions struct {
+ // InsecureAllowCredentialWithHTTP enables authenticated requests over HTTP.
+ // By default, authenticated requests to an HTTP endpoint are rejected by the client.
+ // WARNING: setting this to true will allow sending the authentication key in clear text. Use with caution.
+ InsecureAllowCredentialWithHTTP bool
+
// Prefix is used if the key requires a prefix before it's inserted into the HTTP request.
Prefix string
}
@@ -32,9 +38,10 @@ func NewKeyCredentialPolicy(cred *exported.KeyCredential, header string, options
options = &KeyCredentialPolicyOptions{}
}
return &KeyCredentialPolicy{
- cred: cred,
- header: header,
- prefix: options.Prefix,
+ cred: cred,
+ header: header,
+ prefix: options.Prefix,
+ allowHTTP: options.InsecureAllowCredentialWithHTTP,
}
}
@@ -44,7 +51,7 @@ func (k *KeyCredentialPolicy) Do(req *policy.Request) (*http.Response, error) {
// this prevents a panic that might be hard to diagnose and allows testing
// against http endpoints that don't require authentication.
if k.cred != nil {
- if err := checkHTTPSForAuth(req); err != nil {
+ if err := checkHTTPSForAuth(req, k.allowHTTP); err != nil {
return nil, err
}
val := exported.KeyCredentialGet(k.cred)
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_retry.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_retry.go
index 04d7bb4e..4c3a31fe 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_retry.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_retry.go
@@ -59,13 +59,33 @@ func setDefaults(o *policy.RetryOptions) {
}
func calcDelay(o policy.RetryOptions, try int32) time.Duration { // try is >=1; never 0
- delay := time.Duration((1< o.MaxRetryDelay {
+ delayFloat := float64(delay) * jitterMultiplier
+ if delayFloat > float64(math.MaxInt64) {
+ // the jitter pushed us over MaxInt64, so just use MaxInt64
+ delay = time.Duration(math.MaxInt64)
+ } else {
+ delay = time.Duration(delayFloat)
+ }
+
+ if delay > o.MaxRetryDelay { // MaxRetryDelay is backfilled with non-negative value
delay = o.MaxRetryDelay
}
+
return delay
}
@@ -102,7 +122,8 @@ func (p *retryPolicy) Do(req *policy.Request) (resp *http.Response, err error) {
try := int32(1)
for {
resp = nil // reset
- log.Writef(log.EventRetryPolicy, "=====> Try=%d", try)
+ // unfortunately we don't have access to the custom allow-list of query params, so we'll redact everything but the default allowed QPs
+ log.Writef(log.EventRetryPolicy, "=====> Try=%d for %s %s", try, req.Raw().Method, getSanitizedURL(*req.Raw().URL, getAllowedQueryParams(nil)))
// For each try, seek to the beginning of the Body stream. We do this even for the 1st try because
// the stream may not be at offset 0 when we first get it and we want the same behavior for the
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_sas_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_sas_credential.go
index ebe2b777..3964beea 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_sas_credential.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_sas_credential.go
@@ -12,13 +12,17 @@ import (
// SASCredentialPolicy authorizes requests with a [azcore.SASCredential].
type SASCredentialPolicy struct {
- cred *exported.SASCredential
- header string
+ cred *exported.SASCredential
+ header string
+ allowHTTP bool
}
// SASCredentialPolicyOptions contains the optional values configuring [SASCredentialPolicy].
type SASCredentialPolicyOptions struct {
- // placeholder for future optional values
+ // InsecureAllowCredentialWithHTTP enables authenticated requests over HTTP.
+ // By default, authenticated requests to an HTTP endpoint are rejected by the client.
+ // WARNING: setting this to true will allow sending the authentication key in clear text. Use with caution.
+ InsecureAllowCredentialWithHTTP bool
}
// NewSASCredentialPolicy creates a new instance of [SASCredentialPolicy].
@@ -26,9 +30,13 @@ type SASCredentialPolicyOptions struct {
// - header is the name of the HTTP request header in which the shared access signature is placed
// - options contains optional configuration, pass nil to accept the default values
func NewSASCredentialPolicy(cred *exported.SASCredential, header string, options *SASCredentialPolicyOptions) *SASCredentialPolicy {
+ if options == nil {
+ options = &SASCredentialPolicyOptions{}
+ }
return &SASCredentialPolicy{
- cred: cred,
- header: header,
+ cred: cred,
+ header: header,
+ allowHTTP: options.InsecureAllowCredentialWithHTTP,
}
}
@@ -38,7 +46,7 @@ func (k *SASCredentialPolicy) Do(req *policy.Request) (*http.Response, error) {
// this prevents a panic that might be hard to diagnose and allows testing
// against http endpoints that don't require authentication.
if k.cred != nil {
- if err := checkHTTPSForAuth(req); err != nil {
+ if err := checkHTTPSForAuth(req, k.allowHTTP); err != nil {
return nil, err
}
req.Raw().Header.Add(k.header, exported.SASCredentialGet(k.cred))
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/poller.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/poller.go
index c373f689..03f76c9a 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/poller.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/poller.go
@@ -154,7 +154,7 @@ func NewPollerFromResumeToken[T any](token string, pl exported.Pipeline, options
if err != nil {
return nil, err
}
- var asJSON map[string]interface{}
+ var asJSON map[string]any
if err := json.Unmarshal(raw, &asJSON); err != nil {
return nil, err
}
@@ -240,7 +240,7 @@ func (p *Poller[T]) PollUntilDone(ctx context.Context, options *PollUntilDoneOpt
}
start := time.Now()
- logPollUntilDoneExit := func(v interface{}) {
+ logPollUntilDoneExit := func(v any) {
log.Writef(log.EventLRO, "END PollUntilDone() for %T: %v, total time: %s", p.op, v, time.Since(start))
}
log.Writef(log.EventLRO, "BEGIN PollUntilDone() for %T", p.op)
@@ -334,6 +334,11 @@ func (p *Poller[T]) Result(ctx context.Context) (res T, err error) {
err = p.op.Result(ctx, p.result)
var respErr *exported.ResponseError
if errors.As(err, &respErr) {
+ if pollers.IsNonTerminalHTTPStatusCode(respErr.RawResponse) {
+ // the request failed in a non-terminal way.
+ // don't cache the error or mark the Poller as done
+ return
+ }
// the LRO failed. record the error
p.err = err
} else if err != nil {
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/request.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/request.go
index e97223da..7d34b780 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/request.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/request.go
@@ -11,9 +11,12 @@ import (
"context"
"encoding/json"
"encoding/xml"
+ "errors"
"fmt"
"io"
"mime/multipart"
+ "net/http"
+ "net/textproto"
"net/url"
"path"
"strings"
@@ -21,6 +24,8 @@ import (
"github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming"
+ "github.com/Azure/azure-sdk-for-go/sdk/internal/uuid"
)
// Base64Encoding is usesd to specify which base-64 encoder/decoder to use when
@@ -41,13 +46,25 @@ func NewRequest(ctx context.Context, httpMethod string, endpoint string) (*polic
return exported.NewRequest(ctx, httpMethod, endpoint)
}
+// NewRequestFromRequest creates a new policy.Request with an existing *http.Request
+func NewRequestFromRequest(req *http.Request) (*policy.Request, error) {
+ return exported.NewRequestFromRequest(req)
+}
+
// EncodeQueryParams will parse and encode any query parameters in the specified URL.
+// Any semicolons will automatically be escaped.
func EncodeQueryParams(u string) (string, error) {
before, after, found := strings.Cut(u, "?")
if !found {
return u, nil
}
- qp, err := url.ParseQuery(after)
+ // starting in Go 1.17, url.ParseQuery will reject semicolons in query params.
+ // so, we must escape them first. note that this assumes that semicolons aren't
+ // being used as query param separators which is per the current RFC.
+ // for more info:
+ // https://github.com/golang/go/issues/25192
+ // https://github.com/golang/go/issues/50034
+ qp, err := url.ParseQuery(strings.ReplaceAll(after, ";", "%3B"))
if err != nil {
return "", err
}
@@ -97,20 +114,22 @@ func EncodeByteArray(v []byte, format Base64Encoding) string {
func MarshalAsByteArray(req *policy.Request, v []byte, format Base64Encoding) error {
// send as a JSON string
encode := fmt.Sprintf("\"%s\"", EncodeByteArray(v, format))
- return req.SetBody(exported.NopCloser(strings.NewReader(encode)), shared.ContentTypeAppJSON)
+ // tsp generated code can set Content-Type so we must prefer that
+ return exported.SetBody(req, exported.NopCloser(strings.NewReader(encode)), shared.ContentTypeAppJSON, false)
}
// MarshalAsJSON calls json.Marshal() to get the JSON encoding of v then calls SetBody.
-func MarshalAsJSON(req *policy.Request, v interface{}) error {
+func MarshalAsJSON(req *policy.Request, v any) error {
b, err := json.Marshal(v)
if err != nil {
return fmt.Errorf("error marshalling type %T: %s", v, err)
}
- return req.SetBody(exported.NopCloser(bytes.NewReader(b)), shared.ContentTypeAppJSON)
+ // tsp generated code can set Content-Type so we must prefer that
+ return exported.SetBody(req, exported.NopCloser(bytes.NewReader(b)), shared.ContentTypeAppJSON, false)
}
// MarshalAsXML calls xml.Marshal() to get the XML encoding of v then calls SetBody.
-func MarshalAsXML(req *policy.Request, v interface{}) error {
+func MarshalAsXML(req *policy.Request, v any) error {
b, err := xml.Marshal(v)
if err != nil {
return fmt.Errorf("error marshalling type %T: %s", v, err)
@@ -120,10 +139,10 @@ func MarshalAsXML(req *policy.Request, v interface{}) error {
return req.SetBody(exported.NopCloser(bytes.NewReader(b)), shared.ContentTypeAppXML)
}
-// SetMultipartFormData writes the specified keys/values as multi-part form
-// fields with the specified value. File content must be specified as a ReadSeekCloser.
-// All other values are treated as string values.
-func SetMultipartFormData(req *policy.Request, formData map[string]interface{}) error {
+// SetMultipartFormData writes the specified keys/values as multi-part form fields with the specified value.
+// File content must be specified as an [io.ReadSeekCloser] or [streaming.MultipartContent].
+// Byte slices will be treated as JSON. All other values are treated as string values.
+func SetMultipartFormData(req *policy.Request, formData map[string]any) error {
body := bytes.Buffer{}
writer := multipart.NewWriter(&body)
@@ -139,6 +158,60 @@ func SetMultipartFormData(req *policy.Request, formData map[string]interface{})
return nil
}
+ quoteEscaper := strings.NewReplacer("\\", "\\\\", `"`, "\\\"")
+
+ writeMultipartContent := func(fieldname string, mpc streaming.MultipartContent) error {
+ if mpc.Body == nil {
+ return errors.New("streaming.MultipartContent.Body cannot be nil")
+ }
+
+ // use fieldname for the file name when unspecified
+ filename := fieldname
+
+ if mpc.ContentType == "" && mpc.Filename == "" {
+ return writeContent(fieldname, filename, mpc.Body)
+ }
+ if mpc.Filename != "" {
+ filename = mpc.Filename
+ }
+ // this is pretty much copied from multipart.Writer.CreateFormFile
+ // but lets us set the caller provided Content-Type and filename
+ h := make(textproto.MIMEHeader)
+ h.Set("Content-Disposition",
+ fmt.Sprintf(`form-data; name="%s"; filename="%s"`,
+ quoteEscaper.Replace(fieldname), quoteEscaper.Replace(filename)))
+ contentType := "application/octet-stream"
+ if mpc.ContentType != "" {
+ contentType = mpc.ContentType
+ }
+ h.Set("Content-Type", contentType)
+ fd, err := writer.CreatePart(h)
+ if err != nil {
+ return err
+ }
+ // copy the data to the form file
+ if _, err = io.Copy(fd, mpc.Body); err != nil {
+ return err
+ }
+ return nil
+ }
+
+ // the same as multipart.Writer.WriteField but lets us specify the Content-Type
+ writeField := func(fieldname, contentType string, value string) error {
+ h := make(textproto.MIMEHeader)
+ h.Set("Content-Disposition",
+ fmt.Sprintf(`form-data; name="%s"`, quoteEscaper.Replace(fieldname)))
+ h.Set("Content-Type", contentType)
+ fd, err := writer.CreatePart(h)
+ if err != nil {
+ return err
+ }
+ if _, err = fd.Write([]byte(value)); err != nil {
+ return err
+ }
+ return nil
+ }
+
for k, v := range formData {
if rsc, ok := v.(io.ReadSeekCloser); ok {
if err := writeContent(k, k, rsc); err != nil {
@@ -152,13 +225,35 @@ func SetMultipartFormData(req *policy.Request, formData map[string]interface{})
}
}
continue
+ } else if mpc, ok := v.(streaming.MultipartContent); ok {
+ if err := writeMultipartContent(k, mpc); err != nil {
+ return err
+ }
+ continue
+ } else if mpcs, ok := v.([]streaming.MultipartContent); ok {
+ for _, mpc := range mpcs {
+ if err := writeMultipartContent(k, mpc); err != nil {
+ return err
+ }
+ }
+ continue
}
- // ensure the value is in string format
- s, ok := v.(string)
- if !ok {
- s = fmt.Sprintf("%v", v)
+
+ var content string
+ contentType := shared.ContentTypeTextPlain
+ switch tt := v.(type) {
+ case []byte:
+ // JSON, don't quote it
+ content = string(tt)
+ contentType = shared.ContentTypeAppJSON
+ case string:
+ content = tt
+ default:
+ // ensure the value is in string format
+ content = fmt.Sprintf("%v", v)
}
- if err := writer.WriteField(k, s); err != nil {
+
+ if err := writeField(k, contentType, content); err != nil {
return err
}
}
@@ -175,3 +270,12 @@ func SkipBodyDownload(req *policy.Request) {
// CtxAPINameKey is used as a context key for adding/retrieving the API name.
type CtxAPINameKey = shared.CtxAPINameKey
+
+// NewUUID returns a new UUID using the RFC4122 algorithm.
+func NewUUID() (string, error) {
+ u, err := uuid.New()
+ if err != nil {
+ return "", err
+ }
+ return u.String(), nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/response.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/response.go
index 003c875b..048566e0 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/response.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/response.go
@@ -40,7 +40,7 @@ func UnmarshalAsByteArray(resp *http.Response, v *[]byte, format Base64Encoding)
}
// UnmarshalAsJSON calls json.Unmarshal() to unmarshal the received payload into the value pointed to by v.
-func UnmarshalAsJSON(resp *http.Response, v interface{}) error {
+func UnmarshalAsJSON(resp *http.Response, v any) error {
payload, err := Payload(resp)
if err != nil {
return err
@@ -61,7 +61,7 @@ func UnmarshalAsJSON(resp *http.Response, v interface{}) error {
}
// UnmarshalAsXML calls xml.Unmarshal() to unmarshal the received payload into the value pointed to by v.
-func UnmarshalAsXML(resp *http.Response, v interface{}) error {
+func UnmarshalAsXML(resp *http.Response, v any) error {
payload, err := Payload(resp)
if err != nil {
return err
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming/progress.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming/progress.go
index fbcd4831..2468540b 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming/progress.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming/progress.go
@@ -73,3 +73,17 @@ func (p *progress) Seek(offset int64, whence int) (int64, error) {
func (p *progress) Close() error {
return p.rc.Close()
}
+
+// MultipartContent contains streaming content used in multipart/form payloads.
+type MultipartContent struct {
+ // Body contains the required content body.
+ Body io.ReadSeekCloser
+
+ // ContentType optionally specifies the HTTP Content-Type for this Body.
+ // The default value is application/octet-stream.
+ ContentType string
+
+ // Filename optionally specifies the filename for this Body.
+ // The default value is the field name for the multipart/form section.
+ Filename string
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/.gitignore b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/.gitignore
new file mode 100644
index 00000000..8cdb9103
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/.gitignore
@@ -0,0 +1,4 @@
+# live test artifacts
+Dockerfile
+k8s.yaml
+sshkey*
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/BREAKING_CHANGES.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/BREAKING_CHANGES.md
new file mode 100644
index 00000000..ea267e4f
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/BREAKING_CHANGES.md
@@ -0,0 +1,10 @@
+# Breaking Changes
+
+## v1.6.0
+
+### Behavioral change to `DefaultAzureCredential` in IMDS managed identity scenarios
+
+As of `azidentity` v1.6.0, `DefaultAzureCredential` makes a minor behavioral change when it uses IMDS managed
+identity. It sends its first request to IMDS without the "Metadata" header, to expedite validating whether the endpoint
+is available. This precedes the credential's first token request and is guaranteed to fail with a 400 error. This error
+response can appear in logs but doesn't indicate authentication failed.
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/CHANGELOG.md
index 71dcb5f3..e35f5ad9 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/CHANGELOG.md
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/CHANGELOG.md
@@ -1,5 +1,137 @@
# Release History
+## 1.8.0 (2024-10-08)
+
+### Other Changes
+* `AzurePipelinesCredential` sets an additional OIDC request header so that it
+ receives a 401 instead of a 302 after presenting an invalid system access token
+* Allow logging of debugging headers for `AzurePipelinesCredential` and include
+ them in error messages
+
+## 1.8.0-beta.3 (2024-09-17)
+
+### Features Added
+* Added `ObjectID` type for `ManagedIdentityCredentialOptions.ID`
+
+### Other Changes
+* Removed redundant content from error messages
+
+## 1.8.0-beta.2 (2024-08-06)
+
+### Breaking Changes
+* `NewManagedIdentityCredential` now returns an error when a user-assigned identity
+ is specified on a platform whose managed identity API doesn't support that.
+ `ManagedIdentityCredential.GetToken()` formerly logged a warning in these cases.
+ Returning an error instead prevents the credential authenticating an unexpected
+ identity, causing a client to act with unexpected privileges. The affected
+ platforms are:
+ * Azure Arc
+ * Azure ML (when a resource ID is specified; client IDs are supported)
+ * Cloud Shell
+ * Service Fabric
+
+### Other Changes
+* If `DefaultAzureCredential` receives a non-JSON response when probing IMDS before
+ attempting to authenticate a managed identity, it continues to the next credential
+ in the chain instead of immediately returning an error.
+
+## 1.8.0-beta.1 (2024-07-17)
+
+### Features Added
+* Restored persistent token caching feature
+
+### Breaking Changes
+> These changes affect only code written against a beta version such as v1.7.0-beta.1
+* Redesigned the persistent caching API. Encryption is now required in all cases
+ and persistent cache construction is separate from credential construction.
+ The `PersistentUserAuthentication` example in the package docs has been updated
+ to demonstrate the new API.
+
+## 1.7.0 (2024-06-20)
+
+### Features Added
+* `AzurePipelinesCredential` authenticates an Azure Pipelines service connection with
+ workload identity federation
+
+### Breaking Changes
+> These changes affect only code written against a beta version such as v1.7.0-beta.1
+* Removed the persistent token caching API. It will return in v1.8.0-beta.1
+
+## 1.7.0-beta.1 (2024-06-10)
+
+### Features Added
+* Restored `AzurePipelinesCredential` and persistent token caching API
+
+## Breaking Changes
+> These changes affect only code written against a beta version such as v1.6.0-beta.4
+* Values which `NewAzurePipelinesCredential` read from environment variables in
+ prior versions are now parameters
+* Renamed `AzurePipelinesServiceConnectionCredentialOptions` to `AzurePipelinesCredentialOptions`
+
+### Bugs Fixed
+* Managed identity bug fixes
+
+## 1.6.0 (2024-06-10)
+
+### Features Added
+* `NewOnBehalfOfCredentialWithClientAssertions` creates an on-behalf-of credential
+ that authenticates with client assertions such as federated credentials
+
+### Breaking Changes
+> These changes affect only code written against a beta version such as v1.6.0-beta.4
+* Removed `AzurePipelinesCredential` and the persistent token caching API.
+ They will return in v1.7.0-beta.1
+
+### Bugs Fixed
+* Managed identity bug fixes
+
+## 1.6.0-beta.4 (2024-05-14)
+
+### Features Added
+* `AzurePipelinesCredential` authenticates an Azure Pipeline service connection with
+ workload identity federation
+
+## 1.6.0-beta.3 (2024-04-09)
+
+### Breaking Changes
+* `DefaultAzureCredential` now sends a probe request with no retries for IMDS managed identity
+ environments to avoid excessive retry delays when the IMDS endpoint is not available. This
+ should improve credential chain resolution for local development scenarios.
+
+### Bugs Fixed
+* `ManagedIdentityCredential` now specifies resource IDs correctly for Azure Container Instances
+
+## 1.5.2 (2024-04-09)
+
+### Bugs Fixed
+* `ManagedIdentityCredential` now specifies resource IDs correctly for Azure Container Instances
+
+### Other Changes
+* Restored v1.4.0 error behavior for empty tenant IDs
+* Upgraded dependencies
+
+## 1.6.0-beta.2 (2024-02-06)
+
+### Breaking Changes
+> These changes affect only code written against a beta version such as v1.6.0-beta.1
+* Replaced `ErrAuthenticationRequired` with `AuthenticationRequiredError`, a struct
+ type that carries the `TokenRequestOptions` passed to the `GetToken` call which
+ returned the error.
+
+### Bugs Fixed
+* Fixed more cases in which credential chains like `DefaultAzureCredential`
+ should try their next credential after attempting managed identity
+ authentication in a Docker Desktop container
+
+### Other Changes
+* `AzureCLICredential` uses the CLI's `expires_on` value for token expiration
+
+## 1.6.0-beta.1 (2024-01-17)
+
+### Features Added
+* Restored persistent token caching API first added in v1.5.0-beta.1
+* Added `AzureCLICredentialOptions.Subscription`
+
## 1.5.1 (2024-01-17)
### Bugs Fixed
@@ -126,7 +258,7 @@
### Features Added
* By default, credentials set client capability "CP1" to enable support for
- [Continuous Access Evaluation (CAE)](https://docs.microsoft.com/azure/active-directory/develop/app-resilience-continuous-access-evaluation).
+ [Continuous Access Evaluation (CAE)](https://learn.microsoft.com/entra/identity-platform/app-resilience-continuous-access-evaluation).
This indicates to Microsoft Entra ID that your application can handle CAE claims challenges.
You can disable this behavior by setting the environment variable "AZURE_IDENTITY_DISABLE_CP1" to "true".
* `InteractiveBrowserCredentialOptions.LoginHint` enables pre-populating the login
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/MIGRATION.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/MIGRATION.md
index 1a649202..4404be82 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/MIGRATION.md
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/MIGRATION.md
@@ -1,6 +1,6 @@
# Migrating from autorest/adal to azidentity
-`azidentity` provides Microsoft Entra ID ([formerly Azure Active Directory](https://learn.microsoft.com/azure/active-directory/fundamentals/new-name)) authentication for the newest Azure SDK modules (`github.com/azure-sdk-for-go/sdk/...`). Older Azure SDK packages (`github.com/azure-sdk-for-go/services/...`) use types from `github.com/go-autorest/autorest/adal` instead.
+`azidentity` provides Microsoft Entra ID ([formerly Azure Active Directory](https://learn.microsoft.com/entra/fundamentals/new-name)) authentication for the newest Azure SDK modules (`github.com/azure-sdk-for-go/sdk/...`). Older Azure SDK packages (`github.com/azure-sdk-for-go/services/...`) use types from `github.com/go-autorest/autorest/adal` instead.
This guide shows common authentication code using `autorest/adal` and its equivalent using `azidentity`.
@@ -284,7 +284,7 @@ if err == nil {
}
```
-Note that `azidentity` credentials use the Microsoft Entra endpoint, which requires OAuth 2 scopes instead of the resource identifiers `autorest/adal` expects. For more information, see [Microsoft Entra ID documentation](https://learn.microsoft.com/azure/active-directory/develop/permissions-consent-overview).
+Note that `azidentity` credentials use the Microsoft Entra endpoint, which requires OAuth 2 scopes instead of the resource identifiers `autorest/adal` expects. For more information, see [Microsoft Entra ID documentation](https://learn.microsoft.com/entra/identity-platform/permissions-consent-overview).
## Use azidentity credentials with older packages
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/README.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/README.md
index b6ad2d39..96f30b25 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/README.md
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/README.md
@@ -1,9 +1,9 @@
# Azure Identity Client Module for Go
-The Azure Identity module provides Microsoft Entra ID ([formerly Azure Active Directory](https://learn.microsoft.com/azure/active-directory/fundamentals/new-name)) token authentication support across the Azure SDK. It includes a set of `TokenCredential` implementations, which can be used with Azure SDK clients supporting token authentication.
+The Azure Identity module provides Microsoft Entra ID ([formerly Azure Active Directory](https://learn.microsoft.com/entra/fundamentals/new-name)) token authentication support across the Azure SDK. It includes a set of `TokenCredential` implementations, which can be used with Azure SDK clients supporting token authentication.
[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/azidentity)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity)
-| [Microsoft Entra ID documentation](https://learn.microsoft.com/azure/active-directory/)
+| [Microsoft Entra ID documentation](https://learn.microsoft.com/entra/identity/)
| [Source code](https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/azidentity)
# Getting started
@@ -30,7 +30,7 @@ When debugging and executing code locally, developers typically use their own ac
#### Authenticating via the Azure CLI
`DefaultAzureCredential` and `AzureCLICredential` can authenticate as the user
-signed in to the [Azure CLI](https://docs.microsoft.com/cli/azure). To sign in to the Azure CLI, run `az login`. On a system with a default web browser, the Azure CLI will launch the browser to authenticate a user.
+signed in to the [Azure CLI](https://learn.microsoft.com/cli/azure). To sign in to the Azure CLI, run `az login`. On a system with a default web browser, the Azure CLI will launch the browser to authenticate a user.
When no default browser is available, `az login` will use the device code
authentication flow. This can also be selected manually by running `az login --use-device-code`.
@@ -54,7 +54,7 @@ The `azidentity` module focuses on OAuth authentication with Microsoft Entra ID.
### DefaultAzureCredential
-`DefaultAzureCredential` is appropriate for most apps that will be deployed to Azure. It combines common production credentials with development credentials. It attempts to authenticate via the following mechanisms in this order, stopping when one succeeds:
+`DefaultAzureCredential` simplifies authentication while developing applications that deploy to Azure by combining credentials used in Azure hosting environments and credentials used in local development. In production, it's better to use a specific credential type so authentication is more predictable and easier to debug. `DefaultAzureCredential` attempts to authenticate via the following mechanisms in this order, stopping when one succeeds:
![DefaultAzureCredential authentication flow](img/mermaidjs/DefaultAzureCredentialAuthFlow.svg)
@@ -69,14 +69,14 @@ The `azidentity` module focuses on OAuth authentication with Microsoft Entra ID.
## Managed Identity
`DefaultAzureCredential` and `ManagedIdentityCredential` support
-[managed identity authentication](https://docs.microsoft.com/azure/active-directory/managed-identities-azure-resources/overview)
+[managed identity authentication](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/overview)
in any hosting environment which supports managed identities, such as (this list is not exhaustive):
-* [Azure App Service](https://docs.microsoft.com/azure/app-service/overview-managed-identity)
-* [Azure Arc](https://docs.microsoft.com/azure/azure-arc/servers/managed-identity-authentication)
-* [Azure Cloud Shell](https://docs.microsoft.com/azure/cloud-shell/msi-authorization)
-* [Azure Kubernetes Service](https://docs.microsoft.com/azure/aks/use-managed-identity)
-* [Azure Service Fabric](https://docs.microsoft.com/azure/service-fabric/concepts-managed-identity)
-* [Azure Virtual Machines](https://docs.microsoft.com/azure/active-directory/managed-identities-azure-resources/how-to-use-vm-token)
+* [Azure App Service](https://learn.microsoft.com/azure/app-service/overview-managed-identity)
+* [Azure Arc](https://learn.microsoft.com/azure/azure-arc/servers/managed-identity-authentication)
+* [Azure Cloud Shell](https://learn.microsoft.com/azure/cloud-shell/msi-authorization)
+* [Azure Kubernetes Service](https://learn.microsoft.com/azure/aks/use-managed-identity)
+* [Azure Service Fabric](https://learn.microsoft.com/azure/service-fabric/concepts-managed-identity)
+* [Azure Virtual Machines](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/how-to-use-vm-token)
## Examples
@@ -126,12 +126,17 @@ client := armresources.NewResourceGroupsClient("subscription ID", chain, nil)
## Credential Types
-### Authenticating Azure Hosted Applications
+### Credential chains
|Credential|Usage
|-|-
|[DefaultAzureCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#DefaultAzureCredential)|Simplified authentication experience for getting started developing Azure apps
|[ChainedTokenCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#ChainedTokenCredential)|Define custom authentication flows, composing multiple credentials
+
+### Authenticating Azure-Hosted Applications
+
+|Credential|Usage
+|-|-
|[EnvironmentCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#EnvironmentCredential)|Authenticate a service principal or user configured by environment variables
|[ManagedIdentityCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#ManagedIdentityCredential)|Authenticate the managed identity of an Azure resource
|[WorkloadIdentityCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#WorkloadIdentityCredential)|Authenticate a workload identity on Kubernetes
@@ -140,6 +145,7 @@ client := armresources.NewResourceGroupsClient("subscription ID", chain, nil)
|Credential|Usage
|-|-
+|[AzurePipelinesCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#AzurePipelinesCredential)|Authenticate an Azure Pipelines [service connection](https://learn.microsoft.com/azure/devops/pipelines/library/service-endpoints?view=azure-devops&tabs=yaml)
|[ClientAssertionCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#ClientAssertionCredential)|Authenticate a service principal with a signed client assertion
|[ClientCertificateCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#ClientCertificateCredential)|Authenticate a service principal with a certificate
|[ClientSecretCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#ClientSecretCredential)|Authenticate a service principal with a secret
@@ -157,7 +163,7 @@ client := armresources.NewResourceGroupsClient("subscription ID", chain, nil)
|Credential|Usage
|-|-
|[AzureCLICredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#AzureCLICredential)|Authenticate as the user signed in to the Azure CLI
-|[`AzureDeveloperCLICredential`](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#AzureDeveloperCLICredential)|Authenticates as the user signed in to the Azure Developer CLI
+|[AzureDeveloperCLICredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#AzureDeveloperCLICredential)|Authenticates as the user signed in to the Azure Developer CLI
## Environment Variables
@@ -207,7 +213,7 @@ For more details, see the [token caching documentation](https://aka.ms/azsdk/go/
Credentials return an `error` when they fail to authenticate or lack data they require to authenticate. For guidance on resolving errors from specific credential types, see the [troubleshooting guide](https://aka.ms/azsdk/go/identity/troubleshoot).
-For more details on handling specific Microsoft Entra errors, see the Microsoft Entra [error code documentation](https://learn.microsoft.com/azure/active-directory/develop/reference-error-codes).
+For more details on handling specific Microsoft Entra errors, see the Microsoft Entra [error code documentation](https://learn.microsoft.com/entra/identity-platform/reference-error-codes).
### Logging
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TOKEN_CACHING.MD b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TOKEN_CACHING.MD
index c0d66014..e0bd09c6 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TOKEN_CACHING.MD
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TOKEN_CACHING.MD
@@ -1,62 +1,46 @@
## Token caching in the Azure Identity client module
-*Token caching* is a feature provided by the Azure Identity library that allows apps to:
+Token caching helps apps:
- Improve their resilience and performance.
-- Reduce the number of requests made to Microsoft Entra ID to obtain access tokens.
-- Reduce the number of times the user is prompted to authenticate.
+- Reduce the number of requests sent to Microsoft Entra ID to obtain access tokens.
+- Reduce the number of times users are prompted to authenticate.
-When an app needs to access a protected Azure resource, it typically needs to obtain an access token from Entra ID. Obtaining that token involves sending a request to Entra ID and may also involve prompting the user. Entra ID then validates the credentials provided in the request and issues an access token.
+When an app needs to access a protected Azure resource, it typically needs to obtain an access token from Entra ID by sending an HTTP request and sometimes prompting a user to authenticate interactively. Credentials with caches (see [the below table](#credentials-supporting-token-caching) for a list) store access tokens either [in memory](#in-memory-token-caching) or, optionally, [on disk](#persistent-token-caching). These credentials return cached tokens whenever possible, to avoid unnecessary token requests or user interaction. Both cache implementations are safe for concurrent use.
-Token caching, via the Azure Identity library, allows the app to store this access token [in memory](#in-memory-token-caching), where it's accessible to the current process, or [on disk](#persistent-token-caching) where it can be accessed across application or process invocations. The token can then be retrieved quickly and easily the next time the app needs to access the same resource. The app can avoid making another request to Entra ID, which reduces network traffic and improves resilience. Additionally, in scenarios where the app is authenticating users, token caching also avoids prompting the user each time new tokens are requested.
+#### Caching can't be disabled
-### In-memory token caching
-
-*In-memory token caching* is the default option provided by the Azure Identity library. This caching approach allows apps to store access tokens in memory. With in-memory token caching, the library first determines if a valid access token for the requested resource is already stored in memory. If a valid token is found, it's returned to the app without the need to make another request to Entra ID. If a valid token isn't found, the library will automatically acquire a token by sending a request to Entra ID. The in-memory token cache provided by the Azure Identity library is thread-safe.
-
-**Note:** When Azure Identity library credentials are used with Azure service libraries (for example, Azure Blob Storage), the in-memory token caching is active in the `Pipeline` layer as well. All `TokenCredential` implementations are supported there, including custom implementations external to the Azure Identity library.
+Whether a credential caches tokens isn't configurable. If a credential has a cache of either kind, it requests a new token only when it can't provide one from its cache. Azure SDK service clients have an additional, independent layer of in-memory token caching, to prevent redundant token requests. This cache works with any credential type, even a custom implementation defined outside the Azure SDK, and can't be disabled. Disabling token caching is therefore impossible when using Azure SDK clients or most `azidentity` credential types. However, in-memory caches can be cleared by constructing new credential and client instances.
-#### Caching cannot be disabled
+### In-memory token caching
-As there are many levels of caching, it's not possible disable in-memory caching. However, the in-memory cache may be cleared by creating a new credential instance.
+Credential types that support caching store tokens in memory by default and require no configuration to do so. Each instance of these types has its own cache, and two credential instances never share an in-memory cache.
### Persistent token caching
-> Only azidentity v1.5.0-beta versions support persistent token caching
+Some credential types support opt-in persistent token caching (see [the below table](#credentials-supporting-token-caching) for a list). This feature enables credentials to store and retrieve tokens across process executions, so an application doesn't need to authenticate every time it runs.
-*Persistent disk token caching* is an opt-in feature in the Azure Identity library. The feature allows apps to cache access tokens in an encrypted, persistent storage mechanism. As indicated in the following table, the storage mechanism differs across operating systems.
+Persistent caches are encrypted at rest using a mechanism that depends on the operating system:
-| Operating system | Storage mechanism |
+| Operating system | Encryption facility |
|------------------|---------------------------------------|
| Linux | kernel key retention service (keyctl) |
| macOS | Keychain |
-| Windows | DPAPI |
-
-By default the token cache will protect any data which is persisted using the user data protection APIs available on the current platform.
-However, there are cases where no data protection is available, and applications may choose to allow storing the token cache in an unencrypted state by setting `TokenCachePersistenceOptions.AllowUnencryptedStorage` to `true`. This allows a credential to fall back to unencrypted storage if it can't encrypt the cache. However, we do not recommend using this storage method due to its significantly lower security measures. In addition, tokens are not encrypted solely to the current user, which could potentially allow unauthorized access to the cache by individuals with machine access.
+| Windows | Data Protection API (DPAPI) |
-With persistent disk token caching enabled, the library first determines if a valid access token for the requested resource is already stored in the persistent cache. If a valid token is found, it's returned to the app without the need to make another request to Entra ID. Additionally, the tokens are preserved across app runs, which:
-
-- Makes the app more resilient to failures.
-- Ensures the app can continue to function during an Entra ID outage or disruption.
-- Avoids having to prompt users to authenticate each time the process is restarted.
-
->IMPORTANT! The token cache contains sensitive data and **MUST** be protected to prevent compromising accounts. All application decisions regarding the persistence of the token cache must consider that a breach of its content will fully compromise all the accounts it contains.
-
-#### Example code
-
-See the [package documentation](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity@v1.5.0-beta.1#pkg-overview) for code examples demonstrating how to configure persistent caching and access cached data.
+Persistent caching requires encryption. When the required encryption facility is unuseable, or the application is running on an unsupported OS, the persistent cache constructor returns an error. This doesn't mean that authentication is impossible, only that credentials can't persist authentication data and the application will need to reauthenticate the next time it runs. See the [package documentation][example] for example code showing how to configure persistent caching and access cached data.
### Credentials supporting token caching
The following table indicates the state of in-memory and persistent caching in each credential type.
-**Note:** In-memory caching is activated by default. Persistent token caching needs to be enabled as shown in [this example](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity@v1.5.0-beta.1#example-package-PersistentCache).
+**Note:** in-memory caching is enabled by default for every type supporting it. Persistent token caching must be enabled explicitly. See the [package documentation][user_example] for an example showing how to do this for credential types authenticating users. For types that authenticate service principals, set the `Cache` field on the constructor's options as shown in [this example][sp_example].
| Credential | In-memory token caching | Persistent token caching |
|--------------------------------|---------------------------------------------------------------------|--------------------------|
| `AzureCLICredential` | Not Supported | Not Supported |
| `AzureDeveloperCLICredential` | Not Supported | Not Supported |
+| `AzurePipelinesCredential` | Supported | Supported |
| `ClientAssertionCredential` | Supported | Supported |
| `ClientCertificateCredential` | Supported | Supported |
| `ClientSecretCredential` | Supported | Supported |
@@ -65,6 +49,9 @@ The following table indicates the state of in-memory and persistent caching in e
| `EnvironmentCredential` | Supported | Not Supported |
| `InteractiveBrowserCredential` | Supported | Supported |
| `ManagedIdentityCredential` | Supported | Not Supported |
-| `OnBehalfOfCredential` | Supported | Supported |
+| `OnBehalfOfCredential` | Supported | Not Supported |
| `UsernamePasswordCredential` | Supported | Supported |
| `WorkloadIdentityCredential` | Supported | Supported |
+
+[sp_example]: https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#example-package-PersistentServicePrincipalAuthentication
+[user_example]: https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#example-package-PersistentUserAuthentication
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TROUBLESHOOTING.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TROUBLESHOOTING.md
index 832c599e..c24f67e8 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TROUBLESHOOTING.md
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TROUBLESHOOTING.md
@@ -10,6 +10,7 @@ This troubleshooting guide covers failure investigation techniques, common error
- [Enable and configure logging](#enable-and-configure-logging)
- [Troubleshoot AzureCLICredential authentication issues](#troubleshoot-azureclicredential-authentication-issues)
- [Troubleshoot AzureDeveloperCLICredential authentication issues](#troubleshoot-azuredeveloperclicredential-authentication-issues)
+- [Troubleshoot AzurePipelinesCredential authentication issues](#troubleshoot-azurepipelinescredential-authentication-issues)
- [Troubleshoot ClientCertificateCredential authentication issues](#troubleshoot-clientcertificatecredential-authentication-issues)
- [Troubleshoot ClientSecretCredential authentication issues](#troubleshoot-clientsecretcredential-authentication-issues)
- [Troubleshoot DefaultAzureCredential authentication issues](#troubleshoot-defaultazurecredential-authentication-issues)
@@ -58,7 +59,7 @@ This error contains several pieces of information:
- __Failing Credential Type__: The type of credential that failed to authenticate. This can be helpful when diagnosing issues with chained credential types such as `DefaultAzureCredential` or `ChainedTokenCredential`.
-- __Microsoft Entra ID Error Code and Message__: The error code and message returned by Microsoft Entra ID. This can give insight into the specific reason the request failed. For instance, in this case authentication failed because the provided client secret is incorrect. [Microsoft Entra ID documentation](https://learn.microsoft.com/azure/active-directory/develop/reference-error-codes#aadsts-error-codes) has more information on AADSTS error codes.
+- __Microsoft Entra ID Error Code and Message__: The error code and message returned by Microsoft Entra ID. This can give insight into the specific reason the request failed. For instance, in this case authentication failed because the provided client secret is incorrect. [Microsoft Entra ID documentation](https://learn.microsoft.com/entra/identity-platform/reference-error-codes#aadsts-error-codes) has more information on AADSTS error codes.
- __Correlation ID and Timestamp__: The correlation ID and timestamp identify the request in server-side logs. This information can be useful to support engineers diagnosing unexpected Microsoft Entra failures.
@@ -97,17 +98,17 @@ azlog.SetEvents(azidentity.EventAuthentication)
| Error Code | Issue | Mitigation |
|---|---|---|
-|AADSTS7000215|An invalid client secret was provided.|Ensure the secret provided to the credential constructor is valid. If unsure, create a new client secret using the Azure portal. Details on creating a new client secret are in [Microsoft Entra ID documentation](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal#option-2-create-a-new-application-secret).|
-|AADSTS7000222|An expired client secret was provided.|Create a new client secret using the Azure portal. Details on creating a new client secret are in [Microsoft Entra ID documentation](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal#option-2-create-a-new-application-secret).|
-|AADSTS700016|The specified application wasn't found in the specified tenant.|Ensure the client and tenant IDs provided to the credential constructor are correct for your application registration. For multi-tenant apps, ensure the application has been added to the desired tenant by a tenant admin. To add a new application in the desired tenant, follow the [Microsoft Entra ID instructions](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal).|
+|AADSTS7000215|An invalid client secret was provided.|Ensure the secret provided to the credential constructor is valid. If unsure, create a new client secret using the Azure portal. Details on creating a new client secret are in [Microsoft Entra ID documentation](https://learn.microsoft.com/entra/identity-platform/howto-create-service-principal-portal#option-2-create-a-new-application-secret).|
+|AADSTS7000222|An expired client secret was provided.|Create a new client secret using the Azure portal. Details on creating a new client secret are in [Microsoft Entra ID documentation](https://learn.microsoft.com/entra/identity-platform/howto-create-service-principal-portal#option-2-create-a-new-application-secret).|
+|AADSTS700016|The specified application wasn't found in the specified tenant.|Ensure the client and tenant IDs provided to the credential constructor are correct for your application registration. For multi-tenant apps, ensure the application has been added to the desired tenant by a tenant admin. To add a new application in the desired tenant, follow the [Microsoft Entra ID instructions](https://learn.microsoft.com/entra/identity-platform/howto-create-service-principal-portal).|
## Troubleshoot ClientCertificateCredential authentication issues
| Error Code | Description | Mitigation |
|---|---|---|
-|AADSTS700027|Client assertion contains an invalid signature.|Ensure the specified certificate has been uploaded to the application registration as described in [Microsoft Entra ID documentation](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal#option-1-upload-a-certificate).|
-|AADSTS700016|The specified application wasn't found in the specified tenant.|Ensure the client and tenant IDs provided to the credential constructor are correct for your application registration. For multi-tenant apps, ensure the application has been added to the desired tenant by a tenant admin. To add a new application in the desired tenant, follow the [Microsoft Entra ID instructions](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal).|
+|AADSTS700027|Client assertion contains an invalid signature.|Ensure the specified certificate has been uploaded to the application registration as described in [Microsoft Entra ID documentation](https://learn.microsoft.com/entra/identity-platform/howto-create-service-principal-portal#option-1-upload-a-certificate).|
+|AADSTS700016|The specified application wasn't found in the specified tenant.|Ensure the client and tenant IDs provided to the credential constructor are correct for your application registration. For multi-tenant apps, ensure the application has been added to the desired tenant by a tenant admin. To add a new application in the desired tenant, follow the [Microsoft Entra ID instructions](https://learn.microsoft.com/entra/identity-platform/howto-create-service-principal-portal).|
## Troubleshoot UsernamePasswordCredential authentication issues
@@ -123,20 +124,20 @@ azlog.SetEvents(azidentity.EventAuthentication)
|Host Environment| | |
|---|---|---|
-|Azure Virtual Machines and Scale Sets|[Configuration](https://docs.microsoft.com/azure/active-directory/managed-identities-azure-resources/qs-configure-portal-windows-vm)|[Troubleshooting](#azure-virtual-machine-managed-identity)|
-|Azure App Service and Azure Functions|[Configuration](https://docs.microsoft.com/azure/app-service/overview-managed-identity)|[Troubleshooting](#azure-app-service-and-azure-functions-managed-identity)|
+|Azure Virtual Machines and Scale Sets|[Configuration](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/qs-configure-portal-windows-vm)|[Troubleshooting](#azure-virtual-machine-managed-identity)|
+|Azure App Service and Azure Functions|[Configuration](https://learn.microsoft.com/azure/app-service/overview-managed-identity)|[Troubleshooting](#azure-app-service-and-azure-functions-managed-identity)|
|Azure Kubernetes Service|[Configuration](https://azure.github.io/aad-pod-identity/docs/)|[Troubleshooting](#azure-kubernetes-service-managed-identity)|
-|Azure Arc|[Configuration](https://docs.microsoft.com/azure/azure-arc/servers/managed-identity-authentication)||
-|Azure Service Fabric|[Configuration](https://docs.microsoft.com/azure/service-fabric/concepts-managed-identity)||
+|Azure Arc|[Configuration](https://learn.microsoft.com/azure/azure-arc/servers/managed-identity-authentication)||
+|Azure Service Fabric|[Configuration](https://learn.microsoft.com/azure/service-fabric/concepts-managed-identity)||
### Azure Virtual Machine managed identity
| Error Message |Description| Mitigation |
|---|---|---|
-|The requested identity hasn’t been assigned to this resource.|The IMDS endpoint responded with a status code of 400, indicating the requested identity isn’t assigned to the VM.|If using a user assigned identity, ensure the specified ID is correct.If using a system assigned identity, make sure it has been enabled as described in [managed identity documentation](https://docs.microsoft.com/azure/active-directory/managed-identities-azure-resources/qs-configure-portal-windows-vm#enable-system-assigned-managed-identity-on-an-existing-vm).|
+|The requested identity hasn’t been assigned to this resource.|The IMDS endpoint responded with a status code of 400, indicating the requested identity isn’t assigned to the VM.|If using a user assigned identity, ensure the specified ID is correct.If using a system assigned identity, make sure it has been enabled as described in [managed identity documentation](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/qs-configure-portal-windows-vm#enable-system-assigned-managed-identity-on-an-existing-vm).|
|The request failed due to a gateway error.|The request to the IMDS endpoint failed due to a gateway error, 502 or 504 status code.|IMDS doesn't support requests via proxy or gateway. Disable proxies or gateways running on the VM for requests to the IMDS endpoint `http://169.254.169.254`|
-|No response received from the managed identity endpoint.|No response was received for the request to IMDS or the request timed out.|- Ensure the VM is configured for managed identity as described in [managed identity documentation](https://docs.microsoft.com/azure/active-directory/managed-identities-azure-resources/qs-configure-portal-windows-vm).
- Verify the IMDS endpoint is reachable on the VM. See [below](#verify-imds-is-available-on-the-vm) for instructions.
|
-|Multiple attempts failed to obtain a token from the managed identity endpoint.|The credential has exhausted its retries for a token request.|- Refer to the error message for more details on specific failures.
- Ensure the VM is configured for managed identity as described in [managed identity documentation](https://docs.microsoft.com/azure/active-directory/managed-identities-azure-resources/qs-configure-portal-windows-vm).
- Verify the IMDS endpoint is reachable on the VM. See [below](#verify-imds-is-available-on-the-vm) for instructions.
|
+|No response received from the managed identity endpoint.|No response was received for the request to IMDS or the request timed out.|- Ensure the VM is configured for managed identity as described in [managed identity documentation](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/qs-configure-portal-windows-vm).
- Verify the IMDS endpoint is reachable on the VM. See [below](#verify-imds-is-available-on-the-vm) for instructions.
|
+|Multiple attempts failed to obtain a token from the managed identity endpoint.|The credential has exhausted its retries for a token request.|- Refer to the error message for more details on specific failures.
- Ensure the VM is configured for managed identity as described in [managed identity documentation](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/qs-configure-portal-windows-vm).
- Verify the IMDS endpoint is reachable on the VM. See [below](#verify-imds-is-available-on-the-vm) for instructions.
|
#### Verify IMDS is available on the VM
@@ -152,7 +153,7 @@ curl 'http://169.254.169.254/metadata/identity/oauth2/token?resource=https://man
| Error Message |Description| Mitigation |
|---|---|---|
-|Get "`http://169.254.169.254/...`" i/o timeout|The App Service host hasn't set environment variables for managed identity configuration.|- Ensure the App Service is configured for managed identity as described in [App Service documentation](https://docs.microsoft.com/azure/app-service/overview-managed-identity).
- Verify the App Service environment is properly configured and the managed identity endpoint is available. See [below](#verify-the-app-service-managed-identity-endpoint-is-available) for instructions.
|
+|Get "`http://169.254.169.254/...`" i/o timeout|The App Service host hasn't set environment variables for managed identity configuration.|- Ensure the App Service is configured for managed identity as described in [App Service documentation](https://learn.microsoft.com/azure/app-service/overview-managed-identity).
- Verify the App Service environment is properly configured and the managed identity endpoint is available. See [below](#verify-the-app-service-managed-identity-endpoint-is-available) for instructions.
|
#### Verify the App Service managed identity endpoint is available
@@ -177,8 +178,8 @@ curl "$IDENTITY_ENDPOINT?resource=https://management.core.windows.net&api-versio
| Error Message |Description| Mitigation |
|---|---|---|
-|Azure CLI not found on path|The Azure CLI isn’t installed or isn't on the application's path.|- Ensure the Azure CLI is installed as described in [Azure CLI documentation](https://docs.microsoft.com/cli/azure/install-azure-cli).
- Validate the installation location is in the application's `PATH` environment variable.
|
-|Please run 'az login' to set up account|No account is currently logged into the Azure CLI, or the login has expired.|- Run `az login` to log into the Azure CLI. More information about Azure CLI authentication is available in the [Azure CLI documentation](https://docs.microsoft.com/cli/azure/authenticate-azure-cli).
- Verify that the Azure CLI can obtain tokens. See [below](#verify-the-azure-cli-can-obtain-tokens) for instructions.
|
+|Azure CLI not found on path|The Azure CLI isn’t installed or isn't on the application's path.|- Ensure the Azure CLI is installed as described in [Azure CLI documentation](https://learn.microsoft.com/cli/azure/install-azure-cli).
- Validate the installation location is in the application's `PATH` environment variable.
|
+|Please run 'az login' to set up account|No account is currently logged into the Azure CLI, or the login has expired.|- Run `az login` to log into the Azure CLI. More information about Azure CLI authentication is available in the [Azure CLI documentation](https://learn.microsoft.com/cli/azure/authenticate-azure-cli).
- Verify that the Azure CLI can obtain tokens. See [below](#verify-the-azure-cli-can-obtain-tokens) for instructions.
|
#### Verify the Azure CLI can obtain tokens
@@ -226,6 +227,15 @@ azd auth token --output json --scope https://management.core.windows.net/.defaul
|---|---|---|
|no client ID/tenant ID/token file specified|Incomplete configuration|In most cases these values are provided via environment variables set by Azure Workload Identity.- If your application runs on Azure Kubernetes Servide (AKS) or a cluster that has deployed the Azure Workload Identity admission webhook, check pod labels and service account configuration. See the [AKS documentation](https://learn.microsoft.com/azure/aks/workload-identity-deploy-cluster#disable-workload-identity) and [Azure Workload Identity troubleshooting guide](https://azure.github.io/azure-workload-identity/docs/troubleshooting.html) for more details.
- If your application isn't running on AKS or your cluster hasn't deployed the Workload Identity admission webhook, set these values in `WorkloadIdentityCredentialOptions`
+
+## Troubleshoot AzurePipelinesCredential authentication issues
+
+| Error Message |Description| Mitigation |
+|---|---|---|
+| AADSTS900023: Specified tenant identifier 'some tenant ID' is neither a valid DNS name, nor a valid external domain.|The `tenantID` argument to `NewAzurePipelinesCredential` is incorrect| Verify the tenant ID. It must identify the tenant of the user-assigned managed identity or service principal configured for the service connection.|
+| No service connection found with identifier |The `serviceConnectionID` argument to `NewAzurePipelinesCredential` is incorrect| Verify the service connection ID. This parameter refers to the `resourceId` of the Azure Service Connection. It can also be found in the query string of the service connection's configuration in Azure DevOps. [Azure Pipelines documentation](https://learn.microsoft.com/azure/devops/pipelines/library/service-endpoints?view=azure-devops&tabs=yaml) has more information about service connections.|
+|401 (Unauthorized) response from OIDC endpoint|The `systemAccessToken` argument to `NewAzurePipelinesCredential` is incorrect|Check pipeline configuration. This value comes from the predefined variable `System.AccessToken` [as described in Azure Pipelines documentation](https://learn.microsoft.com/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml#systemaccesstoken).|
+
## Get additional help
Additional information on ways to reach out for support can be found in [SUPPORT.md](https://github.com/Azure/azure-sdk-for-go/blob/main/SUPPORT.md).
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/assets.json b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/assets.json
index 173ce2b3..045f87ac 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/assets.json
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/assets.json
@@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "go",
"TagPrefix": "go/azidentity",
- "Tag": "go/azidentity_db4a26f583"
+ "Tag": "go/azidentity_c55452bbf6"
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/authentication_record.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/authentication_record.go
index ada4d650..840a7146 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/authentication_record.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/authentication_record.go
@@ -18,10 +18,10 @@ import (
var supportedAuthRecordVersions = []string{"1.0"}
-// authenticationRecord is non-secret account information about an authenticated user that user credentials such as
+// AuthenticationRecord is non-secret account information about an authenticated user that user credentials such as
// [DeviceCodeCredential] and [InteractiveBrowserCredential] can use to access previously cached authentication
-// data. Call these credentials' Authenticate method to get an authenticationRecord for a user.
-type authenticationRecord struct {
+// data. Call these credentials' Authenticate method to get an AuthenticationRecord for a user.
+type AuthenticationRecord struct {
// Authority is the URL of the authority that issued the token.
Authority string `json:"authority"`
@@ -42,11 +42,11 @@ type authenticationRecord struct {
}
// UnmarshalJSON implements json.Unmarshaler for AuthenticationRecord
-func (a *authenticationRecord) UnmarshalJSON(b []byte) error {
+func (a *AuthenticationRecord) UnmarshalJSON(b []byte) error {
// Default unmarshaling is fine but we want to return an error if the record's version isn't supported i.e., we
// want to inspect the unmarshalled values before deciding whether to return an error. Unmarshaling a formally
// different type enables this by assigning all the fields without recursing into this method.
- type r authenticationRecord
+ type r AuthenticationRecord
err := json.Unmarshal(b, (*r)(a))
if err != nil {
return err
@@ -63,7 +63,7 @@ func (a *authenticationRecord) UnmarshalJSON(b []byte) error {
}
// account returns the AuthenticationRecord as an MSAL Account. The account is zero-valued when the AuthenticationRecord is zero-valued.
-func (a *authenticationRecord) account() public.Account {
+func (a *AuthenticationRecord) account() public.Account {
return public.Account{
Environment: a.Authority,
HomeAccountID: a.HomeAccountID,
@@ -71,10 +71,10 @@ func (a *authenticationRecord) account() public.Account {
}
}
-func newAuthenticationRecord(ar public.AuthResult) (authenticationRecord, error) {
+func newAuthenticationRecord(ar public.AuthResult) (AuthenticationRecord, error) {
u, err := url.Parse(ar.IDToken.Issuer)
if err != nil {
- return authenticationRecord{}, fmt.Errorf("Authenticate expected a URL issuer but got %q", ar.IDToken.Issuer)
+ return AuthenticationRecord{}, fmt.Errorf("Authenticate expected a URL issuer but got %q", ar.IDToken.Issuer)
}
tenant := ar.IDToken.TenantID
if tenant == "" {
@@ -84,7 +84,7 @@ func newAuthenticationRecord(ar public.AuthResult) (authenticationRecord, error)
if username == "" {
username = ar.IDToken.UPN
}
- return authenticationRecord{
+ return AuthenticationRecord{
Authority: fmt.Sprintf("%s://%s", u.Scheme, u.Host),
ClientID: ar.IDToken.Audience,
HomeAccountID: ar.Account.HomeAccountID,
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azidentity.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azidentity.go
index c3bcfb56..ce55dc65 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azidentity.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azidentity.go
@@ -53,8 +53,14 @@ var (
errInvalidTenantID = errors.New("invalid tenantID. You can locate your tenantID by following the instructions listed here: https://learn.microsoft.com/partner-center/find-ids-and-domain-names")
)
-// tokenCachePersistenceOptions contains options for persistent token caching
-type tokenCachePersistenceOptions = internal.TokenCachePersistenceOptions
+// Cache represents a persistent cache that makes authentication data available across processes.
+// Construct one with [github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache.New]. This package's
+// [persistent user authentication example] shows how to use a persistent cache to reuse user
+// logins across application runs. For service principal credential types such as
+// [ClientCertificateCredential], simply set the Cache field on the credential options.
+//
+// [persistent user authentication example]: https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#example-package-PersistentUserAuthentication
+type Cache = internal.Cache
// setAuthorityHost initializes the authority host for credentials. Precedence is:
// 1. cloud.Configuration.ActiveDirectoryAuthorityHost value set by user
@@ -121,6 +127,9 @@ func alphanumeric(r rune) bool {
}
func validTenantID(tenantID string) bool {
+ if len(tenantID) < 1 {
+ return false
+ }
for _, r := range tenantID {
if !(alphanumeric(r) || r == '.' || r == '-') {
return false
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_cli_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_cli_credential.go
index 43577ab3..b9976f5f 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_cli_credential.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_cli_credential.go
@@ -35,9 +35,9 @@ type AzureCLICredentialOptions struct {
// logged in account can access.
AdditionallyAllowedTenants []string
- // subscription is the name or ID of a subscription. Set this to acquire tokens for an account other
+ // Subscription is the name or ID of a subscription. Set this to acquire tokens for an account other
// than the Azure CLI's current account.
- subscription string
+ Subscription string
// TenantID identifies the tenant the credential should authenticate in.
// Defaults to the CLI's default tenant, which is typically the home tenant of the logged in user.
@@ -68,9 +68,9 @@ func NewAzureCLICredential(options *AzureCLICredentialOptions) (*AzureCLICredent
if options != nil {
cp = *options
}
- for _, r := range cp.subscription {
+ for _, r := range cp.Subscription {
if !(alphanumeric(r) || r == '-' || r == '_' || r == ' ' || r == '.') {
- return nil, fmt.Errorf("%s: invalid Subscription %q", credNameAzureCLI, cp.subscription)
+ return nil, fmt.Errorf("%s: invalid Subscription %q", credNameAzureCLI, cp.Subscription)
}
}
if cp.TenantID != "" && !validTenantID(cp.TenantID) {
@@ -97,7 +97,7 @@ func (c *AzureCLICredential) GetToken(ctx context.Context, opts policy.TokenRequ
}
c.mu.Lock()
defer c.mu.Unlock()
- b, err := c.opts.tokenProvider(ctx, opts.Scopes, tenant, c.opts.subscription)
+ b, err := c.opts.tokenProvider(ctx, opts.Scopes, tenant, c.opts.Subscription)
if err == nil {
at, err = c.createAccessToken(b)
}
@@ -163,26 +163,21 @@ var defaultAzTokenProvider azTokenProvider = func(ctx context.Context, scopes []
func (c *AzureCLICredential) createAccessToken(tk []byte) (azcore.AccessToken, error) {
t := struct {
- AccessToken string `json:"accessToken"`
- Authority string `json:"_authority"`
- ClientID string `json:"_clientId"`
- ExpiresOn string `json:"expiresOn"`
- IdentityProvider string `json:"identityProvider"`
- IsMRRT bool `json:"isMRRT"`
- RefreshToken string `json:"refreshToken"`
- Resource string `json:"resource"`
- TokenType string `json:"tokenType"`
- UserID string `json:"userId"`
+ AccessToken string `json:"accessToken"`
+ Expires_On int64 `json:"expires_on"`
+ ExpiresOn string `json:"expiresOn"`
}{}
err := json.Unmarshal(tk, &t)
if err != nil {
return azcore.AccessToken{}, err
}
- // the Azure CLI's "expiresOn" is local time
- exp, err := time.ParseInLocation("2006-01-02 15:04:05.999999", t.ExpiresOn, time.Local)
- if err != nil {
- return azcore.AccessToken{}, fmt.Errorf("Error parsing token expiration time %q: %v", t.ExpiresOn, err)
+ exp := time.Unix(t.Expires_On, 0)
+ if t.Expires_On == 0 {
+ exp, err = time.ParseInLocation("2006-01-02 15:04:05.999999", t.ExpiresOn, time.Local)
+ if err != nil {
+ return azcore.AccessToken{}, fmt.Errorf("%s: error parsing token expiration time %q: %v", credNameAzureCLI, t.ExpiresOn, err)
+ }
}
converted := azcore.AccessToken{
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_pipelines_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_pipelines_credential.go
new file mode 100644
index 00000000..a4b8ab6f
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_pipelines_credential.go
@@ -0,0 +1,157 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package azidentity
+
+import (
+ "context"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "net/http"
+ "os"
+
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+)
+
+const (
+ credNameAzurePipelines = "AzurePipelinesCredential"
+ oidcAPIVersion = "7.1"
+ systemOIDCRequestURI = "SYSTEM_OIDCREQUESTURI"
+ xMsEdgeRef = "x-msedge-ref"
+ xVssE2eId = "x-vss-e2eid"
+)
+
+// AzurePipelinesCredential authenticates with workload identity federation in an Azure Pipeline. See
+// [Azure Pipelines documentation] for more information.
+//
+// [Azure Pipelines documentation]: https://learn.microsoft.com/azure/devops/pipelines/library/connect-to-azure?view=azure-devops#create-an-azure-resource-manager-service-connection-that-uses-workload-identity-federation
+type AzurePipelinesCredential struct {
+ connectionID, oidcURI, systemAccessToken string
+ cred *ClientAssertionCredential
+}
+
+// AzurePipelinesCredentialOptions contains optional parameters for AzurePipelinesCredential.
+type AzurePipelinesCredentialOptions struct {
+ azcore.ClientOptions
+
+ // AdditionallyAllowedTenants specifies additional tenants for which the credential may acquire tokens.
+ // Add the wildcard value "*" to allow the credential to acquire tokens for any tenant in which the
+ // application is registered.
+ AdditionallyAllowedTenants []string
+
+ // Cache is a persistent cache the credential will use to store the tokens it acquires, making
+ // them available to other processes and credential instances. The default, zero value means the
+ // credential will store tokens in memory and not share them with any other credential instance.
+ Cache Cache
+
+ // DisableInstanceDiscovery should be set true only by applications authenticating in disconnected clouds, or
+ // private clouds such as Azure Stack. It determines whether the credential requests Microsoft Entra instance metadata
+ // from https://login.microsoft.com before authenticating. Setting this to true will skip this request, making
+ // the application responsible for ensuring the configured authority is valid and trustworthy.
+ DisableInstanceDiscovery bool
+}
+
+// NewAzurePipelinesCredential is the constructor for AzurePipelinesCredential.
+//
+// - tenantID: tenant ID of the service principal federated with the service connection
+// - clientID: client ID of that service principal
+// - serviceConnectionID: ID of the service connection to authenticate
+// - systemAccessToken: security token for the running build. See [Azure Pipelines documentation] for
+// an example showing how to get this value.
+//
+// [Azure Pipelines documentation]: https://learn.microsoft.com/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml#systemaccesstoken
+func NewAzurePipelinesCredential(tenantID, clientID, serviceConnectionID, systemAccessToken string, options *AzurePipelinesCredentialOptions) (*AzurePipelinesCredential, error) {
+ if !validTenantID(tenantID) {
+ return nil, errInvalidTenantID
+ }
+ if clientID == "" {
+ return nil, errors.New("no client ID specified")
+ }
+ if serviceConnectionID == "" {
+ return nil, errors.New("no service connection ID specified")
+ }
+ if systemAccessToken == "" {
+ return nil, errors.New("no system access token specified")
+ }
+ u := os.Getenv(systemOIDCRequestURI)
+ if u == "" {
+ return nil, fmt.Errorf("no value for environment variable %s. This should be set by Azure Pipelines", systemOIDCRequestURI)
+ }
+ a := AzurePipelinesCredential{
+ connectionID: serviceConnectionID,
+ oidcURI: u,
+ systemAccessToken: systemAccessToken,
+ }
+ if options == nil {
+ options = &AzurePipelinesCredentialOptions{}
+ }
+ // these headers are useful to the DevOps team when debugging OIDC error responses
+ options.ClientOptions.Logging.AllowedHeaders = append(options.ClientOptions.Logging.AllowedHeaders, xMsEdgeRef, xVssE2eId)
+ caco := ClientAssertionCredentialOptions{
+ AdditionallyAllowedTenants: options.AdditionallyAllowedTenants,
+ Cache: options.Cache,
+ ClientOptions: options.ClientOptions,
+ DisableInstanceDiscovery: options.DisableInstanceDiscovery,
+ }
+ cred, err := NewClientAssertionCredential(tenantID, clientID, a.getAssertion, &caco)
+ if err != nil {
+ return nil, err
+ }
+ cred.client.name = credNameAzurePipelines
+ a.cred = cred
+ return &a, nil
+}
+
+// GetToken requests an access token from Microsoft Entra ID. Azure SDK clients call this method automatically.
+func (a *AzurePipelinesCredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) {
+ var err error
+ ctx, endSpan := runtime.StartSpan(ctx, credNameAzurePipelines+"."+traceOpGetToken, a.cred.client.azClient.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ tk, err := a.cred.GetToken(ctx, opts)
+ return tk, err
+}
+
+func (a *AzurePipelinesCredential) getAssertion(ctx context.Context) (string, error) {
+ url := a.oidcURI + "?api-version=" + oidcAPIVersion + "&serviceConnectionId=" + a.connectionID
+ url, err := runtime.EncodeQueryParams(url)
+ if err != nil {
+ return "", newAuthenticationFailedError(credNameAzurePipelines, "couldn't encode OIDC URL: "+err.Error(), nil)
+ }
+ req, err := http.NewRequestWithContext(ctx, http.MethodPost, url, nil)
+ if err != nil {
+ return "", newAuthenticationFailedError(credNameAzurePipelines, "couldn't create OIDC token request: "+err.Error(), nil)
+ }
+ req.Header.Set("Authorization", "Bearer "+a.systemAccessToken)
+ // instruct endpoint to return 401 instead of 302, if the system access token is invalid
+ req.Header.Set("X-TFS-FedAuthRedirect", "Suppress")
+ res, err := doForClient(a.cred.client.azClient, req)
+ if err != nil {
+ return "", newAuthenticationFailedError(credNameAzurePipelines, "couldn't send OIDC token request: "+err.Error(), nil)
+ }
+ if res.StatusCode != http.StatusOK {
+ msg := res.Status + " response from the OIDC endpoint. Check service connection ID and Pipeline configuration."
+ for _, h := range []string{xMsEdgeRef, xVssE2eId} {
+ if v := res.Header.Get(h); v != "" {
+ msg += fmt.Sprintf("\n%s: %s", h, v)
+ }
+ }
+ // include the response because its body, if any, probably contains an error message.
+ // OK responses aren't included with errors because they probably contain secrets
+ return "", newAuthenticationFailedError(credNameAzurePipelines, msg, res)
+ }
+ b, err := runtime.Payload(res)
+ if err != nil {
+ return "", newAuthenticationFailedError(credNameAzurePipelines, "couldn't read OIDC response content: "+err.Error(), nil)
+ }
+ var r struct {
+ OIDCToken string `json:"oidcToken"`
+ }
+ err = json.Unmarshal(b, &r)
+ if err != nil {
+ return "", newAuthenticationFailedError(credNameAzurePipelines, "unexpected response from OIDC endpoint", nil)
+ }
+ return r.OIDCToken, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/chained_token_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/chained_token_credential.go
index dc855edf..2460f66e 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/chained_token_credential.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/chained_token_credential.go
@@ -86,7 +86,7 @@ func (c *ChainedTokenCredential) GetToken(ctx context.Context, opts policy.Token
errs []error
successfulCredential azcore.TokenCredential
token azcore.AccessToken
- unavailableErr *credentialUnavailableError
+ unavailableErr credentialUnavailable
)
for _, cred := range c.sources {
token, err = cred.GetToken(ctx, opts)
@@ -113,11 +113,19 @@ func (c *ChainedTokenCredential) GetToken(ctx context.Context, opts policy.Token
if err != nil {
// return credentialUnavailableError iff all sources did so; return AuthenticationFailedError otherwise
msg := createChainedErrorMessage(errs)
- if errors.As(err, &unavailableErr) {
+ var authFailedErr *AuthenticationFailedError
+ switch {
+ case errors.As(err, &authFailedErr):
+ err = newAuthenticationFailedError(c.name, msg, authFailedErr.RawResponse)
+ if af, ok := err.(*AuthenticationFailedError); ok {
+ // stop Error() printing the response again; it's already in msg
+ af.omitResponse = true
+ }
+ case errors.As(err, &unavailableErr):
err = newCredentialUnavailableError(c.name, msg)
- } else {
+ default:
res := getResponseFromError(err)
- err = newAuthenticationFailedError(c.name, msg, res, err)
+ err = newAuthenticationFailedError(c.name, msg, res)
}
}
return token, err
@@ -126,7 +134,7 @@ func (c *ChainedTokenCredential) GetToken(ctx context.Context, opts policy.Token
func createChainedErrorMessage(errs []error) string {
msg := "failed to acquire a token.\nAttempted credentials:"
for _, err := range errs {
- msg += fmt.Sprintf("\n\t%s", err.Error())
+ msg += fmt.Sprintf("\n\t%s", strings.ReplaceAll(err.Error(), "\n", "\n\t\t"))
}
return msg
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/ci.yml b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/ci.yml
index d077682c..62c12b54 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/ci.yml
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/ci.yml
@@ -8,7 +8,7 @@ trigger:
- release/*
paths:
include:
- - sdk/azidentity/
+ - sdk/azidentity/
pr:
branches:
@@ -19,17 +19,39 @@ pr:
- release/*
paths:
include:
- - sdk/azidentity/
+ - sdk/azidentity/
-stages:
-- template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml
- parameters:
- RunLiveTests: true
- UsePipelineProxy: false
- ServiceDirectory: 'azidentity'
- CloudConfig:
- Public:
- SubscriptionConfigurations:
- - $(sub-config-azure-cloud-test-resources)
- # Contains alternate tenant, AAD app and cert info for testing
- - $(sub-config-identity-test-resources)
+extends:
+ template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml
+ parameters:
+ CloudConfig:
+ Public:
+ ServiceConnection: azure-sdk-tests
+ SubscriptionConfigurationFilePaths:
+ - eng/common/TestResources/sub-config/AzurePublicMsft.json
+ SubscriptionConfigurations:
+ - $(sub-config-azure-cloud-test-resources)
+ - $(sub-config-identity-test-resources)
+ EnableRaceDetector: true
+ RunLiveTests: true
+ ServiceDirectory: azidentity
+ UsePipelineProxy: false
+
+ ${{ if endsWith(variables['Build.DefinitionName'], 'weekly') }}:
+ PreSteps:
+ - task: AzureCLI@2
+ displayName: Set OIDC token
+ inputs:
+ addSpnToEnvironment: true
+ azureSubscription: azure-sdk-tests
+ inlineScript: Write-Host "##vso[task.setvariable variable=OIDC_TOKEN;]$($env:idToken)"
+ scriptLocation: inlineScript
+ scriptType: pscore
+ MatrixConfigs:
+ - Name: managed_identity_matrix
+ GenerateVMJobs: true
+ Path: sdk/azidentity/managed-identity-matrix.json
+ Selection: sparse
+ MatrixReplace:
+ - Pool=.*LINUXPOOL.*/azsdk-pool-mms-ubuntu-2204-identitymsi
+ - OSVmImage=.*LINUXNEXTVMIMAGE.*/azsdk-pool-mms-ubuntu-2204-1espt
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_assertion_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_assertion_credential.go
index fc3df68e..2307da86 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_assertion_credential.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_assertion_credential.go
@@ -23,7 +23,7 @@ const credNameAssertion = "ClientAssertionCredential"
// the most common assertion scenario, authenticating a service principal with a certificate. See
// [Microsoft Entra ID documentation] for details of the assertion format.
//
-// [Microsoft Entra ID documentation]: https://learn.microsoft.com/azure/active-directory/develop/active-directory-certificate-credentials#assertion-format
+// [Microsoft Entra ID documentation]: https://learn.microsoft.com/entra/identity-platform/certificate-credentials#assertion-format
type ClientAssertionCredential struct {
client *confidentialClient
}
@@ -37,14 +37,16 @@ type ClientAssertionCredentialOptions struct {
// application is registered.
AdditionallyAllowedTenants []string
+ // Cache is a persistent cache the credential will use to store the tokens it acquires, making
+ // them available to other processes and credential instances. The default, zero value means the
+ // credential will store tokens in memory and not share them with any other credential instance.
+ Cache Cache
+
// DisableInstanceDiscovery should be set true only by applications authenticating in disconnected clouds, or
// private clouds such as Azure Stack. It determines whether the credential requests Microsoft Entra instance metadata
// from https://login.microsoft.com before authenticating. Setting this to true will skip this request, making
// the application responsible for ensuring the configured authority is valid and trustworthy.
DisableInstanceDiscovery bool
-
- // tokenCachePersistenceOptions enables persistent token caching when not nil.
- tokenCachePersistenceOptions *tokenCachePersistenceOptions
}
// NewClientAssertionCredential constructs a ClientAssertionCredential. The getAssertion function must be thread safe. Pass nil for options to accept defaults.
@@ -61,10 +63,10 @@ func NewClientAssertionCredential(tenantID, clientID string, getAssertion func(c
},
)
msalOpts := confidentialClientOptions{
- AdditionallyAllowedTenants: options.AdditionallyAllowedTenants,
- ClientOptions: options.ClientOptions,
- DisableInstanceDiscovery: options.DisableInstanceDiscovery,
- tokenCachePersistenceOptions: options.tokenCachePersistenceOptions,
+ AdditionallyAllowedTenants: options.AdditionallyAllowedTenants,
+ Cache: options.Cache,
+ ClientOptions: options.ClientOptions,
+ DisableInstanceDiscovery: options.DisableInstanceDiscovery,
}
c, err := newConfidentialClient(tenantID, clientID, credNameAssertion, cred, msalOpts)
if err != nil {
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_certificate_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_certificate_credential.go
index 607533f4..9e6bca1c 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_certificate_credential.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_certificate_credential.go
@@ -31,6 +31,11 @@ type ClientCertificateCredentialOptions struct {
// application is registered.
AdditionallyAllowedTenants []string
+ // Cache is a persistent cache the credential will use to store the tokens it acquires, making
+ // them available to other processes and credential instances. The default, zero value means the
+ // credential will store tokens in memory and not share them with any other credential instance.
+ Cache Cache
+
// DisableInstanceDiscovery should be set true only by applications authenticating in disconnected clouds, or
// private clouds such as Azure Stack. It determines whether the credential requests Microsoft Entra instance metadata
// from https://login.microsoft.com before authenticating. Setting this to true will skip this request, making
@@ -41,9 +46,6 @@ type ClientCertificateCredentialOptions struct {
// header of each token request's JWT. This is required for Subject Name/Issuer (SNI) authentication.
// Defaults to False.
SendCertificateChain bool
-
- // tokenCachePersistenceOptions enables persistent token caching when not nil.
- tokenCachePersistenceOptions *tokenCachePersistenceOptions
}
// ClientCertificateCredential authenticates a service principal with a certificate.
@@ -51,7 +53,8 @@ type ClientCertificateCredential struct {
client *confidentialClient
}
-// NewClientCertificateCredential constructs a ClientCertificateCredential. Pass nil for options to accept defaults.
+// NewClientCertificateCredential constructs a ClientCertificateCredential. Pass nil for options to accept defaults. See
+// [ParseCertificates] for help loading a certificate.
func NewClientCertificateCredential(tenantID string, clientID string, certs []*x509.Certificate, key crypto.PrivateKey, options *ClientCertificateCredentialOptions) (*ClientCertificateCredential, error) {
if len(certs) == 0 {
return nil, errors.New("at least one certificate is required")
@@ -64,11 +67,11 @@ func NewClientCertificateCredential(tenantID string, clientID string, certs []*x
return nil, err
}
msalOpts := confidentialClientOptions{
- AdditionallyAllowedTenants: options.AdditionallyAllowedTenants,
- ClientOptions: options.ClientOptions,
- DisableInstanceDiscovery: options.DisableInstanceDiscovery,
- SendX5C: options.SendCertificateChain,
- tokenCachePersistenceOptions: options.tokenCachePersistenceOptions,
+ AdditionallyAllowedTenants: options.AdditionallyAllowedTenants,
+ Cache: options.Cache,
+ ClientOptions: options.ClientOptions,
+ DisableInstanceDiscovery: options.DisableInstanceDiscovery,
+ SendX5C: options.SendCertificateChain,
}
c, err := newConfidentialClient(tenantID, clientID, credNameCert, cred, msalOpts)
if err != nil {
@@ -86,8 +89,10 @@ func (c *ClientCertificateCredential) GetToken(ctx context.Context, opts policy.
return tk, err
}
-// ParseCertificates loads certificates and a private key, in PEM or PKCS12 format, for use with NewClientCertificateCredential.
-// Pass nil for password if the private key isn't encrypted. This function can't decrypt keys in PEM format.
+// ParseCertificates loads certificates and a private key, in PEM or PKCS#12 format, for use with [NewClientCertificateCredential].
+// Pass nil for password if the private key isn't encrypted. This function has limitations, for example it can't decrypt keys in
+// PEM format or PKCS#12 certificates that use SHA256 for message authentication. If you encounter such limitations, consider
+// using another module to load the certificate and private key.
func ParseCertificates(certData []byte, password []byte) ([]*x509.Certificate, crypto.PrivateKey, error) {
var blocks []*pem.Block
var err error
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_secret_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_secret_credential.go
index 9e6772e9..f0890fe1 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_secret_credential.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_secret_credential.go
@@ -32,8 +32,10 @@ type ClientSecretCredentialOptions struct {
// the application responsible for ensuring the configured authority is valid and trustworthy.
DisableInstanceDiscovery bool
- // tokenCachePersistenceOptions enables persistent token caching when not nil.
- tokenCachePersistenceOptions *tokenCachePersistenceOptions
+ // Cache is a persistent cache the credential will use to store the tokens it acquires, making
+ // them available to other processes and credential instances. The default, zero value means the
+ // credential will store tokens in memory and not share them with any other credential instance.
+ Cache Cache
}
// ClientSecretCredential authenticates an application with a client secret.
@@ -51,10 +53,10 @@ func NewClientSecretCredential(tenantID string, clientID string, clientSecret st
return nil, err
}
msalOpts := confidentialClientOptions{
- AdditionallyAllowedTenants: options.AdditionallyAllowedTenants,
- ClientOptions: options.ClientOptions,
- DisableInstanceDiscovery: options.DisableInstanceDiscovery,
- tokenCachePersistenceOptions: options.tokenCachePersistenceOptions,
+ AdditionallyAllowedTenants: options.AdditionallyAllowedTenants,
+ Cache: options.Cache,
+ ClientOptions: options.ClientOptions,
+ DisableInstanceDiscovery: options.DisableInstanceDiscovery,
}
c, err := newConfidentialClient(tenantID, clientID, credNameSecret, cred, msalOpts)
if err != nil {
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/confidential_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/confidential_client.go
index 854267bd..7059a510 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/confidential_client.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/confidential_client.go
@@ -29,8 +29,8 @@ type confidentialClientOptions struct {
AdditionallyAllowedTenants []string
// Assertion for on-behalf-of authentication
Assertion string
+ Cache Cache
DisableInstanceDiscovery, SendX5C bool
- tokenCachePersistenceOptions *tokenCachePersistenceOptions
}
// confidentialClient wraps the MSAL confidential client
@@ -91,7 +91,7 @@ func (c *confidentialClient) GetToken(ctx context.Context, tro policy.TokenReque
}
tro.TenantID = tenant
}
- client, mu, err := c.client(ctx, tro)
+ client, mu, err := c.client(tro)
if err != nil {
return azcore.AccessToken{}, err
}
@@ -107,12 +107,12 @@ func (c *confidentialClient) GetToken(ctx context.Context, tro policy.TokenReque
}
}
if err != nil {
- // We could get a credentialUnavailableError from managed identity authentication because in that case the error comes from our code.
- // We return it directly because it affects the behavior of credential chains. Otherwise, we return AuthenticationFailedError.
- var unavailableErr *credentialUnavailableError
- if !errors.As(err, &unavailableErr) {
- res := getResponseFromError(err)
- err = newAuthenticationFailedError(c.name, err.Error(), res, err)
+ var (
+ authFailedErr *AuthenticationFailedError
+ unavailableErr credentialUnavailable
+ )
+ if !(errors.As(err, &unavailableErr) || errors.As(err, &authFailedErr)) {
+ err = newAuthenticationFailedErrorFromMSAL(c.name, err)
}
} else {
msg := fmt.Sprintf("%s.GetToken() acquired a token for scope %q", c.name, strings.Join(ar.GrantedScopes, ", "))
@@ -121,7 +121,7 @@ func (c *confidentialClient) GetToken(ctx context.Context, tro policy.TokenReque
return azcore.AccessToken{Token: ar.AccessToken, ExpiresOn: ar.ExpiresOn.UTC()}, err
}
-func (c *confidentialClient) client(ctx context.Context, tro policy.TokenRequestOptions) (msalConfidentialClient, *sync.Mutex, error) {
+func (c *confidentialClient) client(tro policy.TokenRequestOptions) (msalConfidentialClient, *sync.Mutex, error) {
c.clientMu.Lock()
defer c.clientMu.Unlock()
if tro.EnableCAE {
@@ -145,7 +145,7 @@ func (c *confidentialClient) client(ctx context.Context, tro policy.TokenRequest
}
func (c *confidentialClient) newMSALClient(enableCAE bool) (msalConfidentialClient, error) {
- cache, err := internal.NewCache(c.opts.tokenCachePersistenceOptions, enableCAE)
+ cache, err := internal.ExportReplace(c.opts.Cache, enableCAE)
if err != nil {
return nil, err
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/default_azure_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/default_azure_credential.go
index 35aeef86..3cfc0f7b 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/default_azure_credential.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/default_azure_credential.go
@@ -8,10 +8,8 @@ package azidentity
import (
"context"
- "errors"
"os"
"strings"
- "time"
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
@@ -38,10 +36,13 @@ type DefaultAzureCredentialOptions struct {
TenantID string
}
-// DefaultAzureCredential is a default credential chain for applications that will deploy to Azure.
-// It combines credentials suitable for deployment with credentials suitable for local development.
-// It attempts to authenticate with each of these credential types, in the following order, stopping
-// when one provides a token:
+// DefaultAzureCredential simplifies authentication while developing applications that deploy to Azure by
+// combining credentials used in Azure hosting environments and credentials used in local development. In
+// production, it's better to use a specific credential type so authentication is more predictable and easier
+// to debug.
+//
+// DefaultAzureCredential attempts to authenticate with each of these credential types, in the following order,
+// stopping when one provides a token:
//
// - [EnvironmentCredential]
// - [WorkloadIdentityCredential], if environment variable configuration is set by the Azure workload
@@ -98,13 +99,13 @@ func NewDefaultAzureCredential(options *DefaultAzureCredentialOptions) (*Default
creds = append(creds, &defaultCredentialErrorReporter{credType: credNameWorkloadIdentity, err: err})
}
- o := &ManagedIdentityCredentialOptions{ClientOptions: options.ClientOptions}
+ o := &ManagedIdentityCredentialOptions{ClientOptions: options.ClientOptions, dac: true}
if ID, ok := os.LookupEnv(azureClientID); ok {
o.ID = ClientID(ID)
}
miCred, err := NewManagedIdentityCredential(o)
if err == nil {
- creds = append(creds, &timeoutWrapper{mic: miCred, timeout: time.Second})
+ creds = append(creds, miCred)
} else {
errorMessages = append(errorMessages, credNameManagedIdentity+": "+err.Error())
creds = append(creds, &defaultCredentialErrorReporter{credType: credNameManagedIdentity, err: err})
@@ -158,51 +159,10 @@ type defaultCredentialErrorReporter struct {
}
func (d *defaultCredentialErrorReporter) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) {
- if _, ok := d.err.(*credentialUnavailableError); ok {
+ if _, ok := d.err.(credentialUnavailable); ok {
return azcore.AccessToken{}, d.err
}
return azcore.AccessToken{}, newCredentialUnavailableError(d.credType, d.err.Error())
}
var _ azcore.TokenCredential = (*defaultCredentialErrorReporter)(nil)
-
-// timeoutWrapper prevents a potentially very long timeout when managed identity isn't available
-type timeoutWrapper struct {
- mic *ManagedIdentityCredential
- // timeout applies to all auth attempts until one doesn't time out
- timeout time.Duration
-}
-
-// GetToken wraps DefaultAzureCredential's initial managed identity auth attempt with a short timeout
-// because managed identity may not be available and connecting to IMDS can take several minutes to time out.
-func (w *timeoutWrapper) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) {
- var tk azcore.AccessToken
- var err error
- // no need to synchronize around this value because it's written only within ChainedTokenCredential's critical section
- if w.timeout > 0 {
- c, cancel := context.WithTimeout(ctx, w.timeout)
- defer cancel()
- tk, err = w.mic.GetToken(c, opts)
- if isAuthFailedDueToContext(err) {
- err = newCredentialUnavailableError(credNameManagedIdentity, "managed identity timed out. See https://aka.ms/azsdk/go/identity/troubleshoot#dac for more information")
- } else {
- // some managed identity implementation is available, so don't apply the timeout to future calls
- w.timeout = 0
- }
- } else {
- tk, err = w.mic.GetToken(ctx, opts)
- }
- return tk, err
-}
-
-// unwraps nested AuthenticationFailedErrors to get the root error
-func isAuthFailedDueToContext(err error) bool {
- for {
- var authFailedErr *AuthenticationFailedError
- if !errors.As(err, &authFailedErr) {
- break
- }
- err = authFailedErr.err
- }
- return errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded)
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/developer_credential_util.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/developer_credential_util.go
index d8b952f5..be963d3a 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/developer_credential_util.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/developer_credential_util.go
@@ -19,7 +19,7 @@ const cliTimeout = 10 * time.Second
// the next credential in its chain (another developer credential).
func unavailableIfInChain(err error, inDefaultChain bool) error {
if err != nil && inDefaultChain {
- var unavailableErr *credentialUnavailableError
+ var unavailableErr credentialUnavailable
if !errors.As(err, &unavailableErr) {
err = newCredentialUnavailableError(credNameAzureDeveloperCLI, err.Error())
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/device_code_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/device_code_credential.go
index 1b7a2837..53c4c728 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/device_code_credential.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/device_code_credential.go
@@ -25,18 +25,26 @@ type DeviceCodeCredentialOptions struct {
// tokens. Add the wildcard value "*" to allow the credential to acquire tokens for any tenant.
AdditionallyAllowedTenants []string
- // authenticationRecord returned by a call to a credential's Authenticate method. Set this option
+ // AuthenticationRecord returned by a call to a credential's Authenticate method. Set this option
// to enable the credential to use data from a previous authentication.
- authenticationRecord authenticationRecord
-
- // ClientID is the ID of the application users will authenticate to.
- // Defaults to the ID of an Azure development application.
+ AuthenticationRecord AuthenticationRecord
+
+ // Cache is a persistent cache the credential will use to store the tokens it acquires, making
+ // them available to other processes and credential instances. The default, zero value means the
+ // credential will store tokens in memory and not share them with any other credential instance.
+ Cache Cache
+
+ // ClientID is the ID of the application to which users will authenticate. When not set, users
+ // will authenticate to an Azure development application, which isn't recommended for production
+ // scenarios. In production, developers should instead register their applications and assign
+ // appropriate roles. See https://aka.ms/azsdk/identity/AppRegistrationAndRoleAssignment for more
+ // information.
ClientID string
- // disableAutomaticAuthentication prevents the credential from automatically prompting the user to authenticate.
- // When this option is true, [DeviceCodeCredential.GetToken] will return [ErrAuthenticationRequired] when user
- // interaction is necessary to acquire a token.
- disableAutomaticAuthentication bool
+ // DisableAutomaticAuthentication prevents the credential from automatically prompting the user to authenticate.
+ // When this option is true, GetToken will return AuthenticationRequiredError when user interaction is necessary
+ // to acquire a token.
+ DisableAutomaticAuthentication bool
// DisableInstanceDiscovery should be set true only by applications authenticating in disconnected clouds, or
// private clouds such as Azure Stack. It determines whether the credential requests Microsoft Entra instance metadata
@@ -49,9 +57,6 @@ type DeviceCodeCredentialOptions struct {
// applications.
TenantID string
- // tokenCachePersistenceOptions enables persistent token caching when not nil.
- tokenCachePersistenceOptions *tokenCachePersistenceOptions
-
// UserPrompt controls how the credential presents authentication instructions. The credential calls
// this function with authentication details when it receives a device code. By default, the credential
// prints these details to stdout.
@@ -101,12 +106,12 @@ func NewDeviceCodeCredential(options *DeviceCodeCredentialOptions) (*DeviceCodeC
cp.init()
msalOpts := publicClientOptions{
AdditionallyAllowedTenants: cp.AdditionallyAllowedTenants,
+ Cache: cp.Cache,
ClientOptions: cp.ClientOptions,
DeviceCodePrompt: cp.UserPrompt,
- DisableAutomaticAuthentication: cp.disableAutomaticAuthentication,
+ DisableAutomaticAuthentication: cp.DisableAutomaticAuthentication,
DisableInstanceDiscovery: cp.DisableInstanceDiscovery,
- Record: cp.authenticationRecord,
- TokenCachePersistenceOptions: cp.tokenCachePersistenceOptions,
+ Record: cp.AuthenticationRecord,
}
c, err := newPublicClient(cp.TenantID, cp.ClientID, credNameDeviceCode, msalOpts)
if err != nil {
@@ -116,8 +121,9 @@ func NewDeviceCodeCredential(options *DeviceCodeCredentialOptions) (*DeviceCodeC
return &DeviceCodeCredential{client: c}, nil
}
-// Authenticate a user via the device code flow. Subsequent calls to GetToken will automatically use the returned AuthenticationRecord.
-func (c *DeviceCodeCredential) authenticate(ctx context.Context, opts *policy.TokenRequestOptions) (authenticationRecord, error) {
+// Authenticate prompts a user to log in via the device code flow. Subsequent
+// GetToken calls will automatically use the returned AuthenticationRecord.
+func (c *DeviceCodeCredential) Authenticate(ctx context.Context, opts *policy.TokenRequestOptions) (AuthenticationRecord, error) {
var err error
ctx, endSpan := runtime.StartSpan(ctx, credNameDeviceCode+"."+traceOpAuthenticate, c.client.azClient.Tracer(), nil)
defer func() { endSpan(err) }()
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/environment_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/environment_credential.go
index 42f84875..b30f5474 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/environment_credential.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/environment_credential.go
@@ -57,6 +57,9 @@ type EnvironmentCredentialOptions struct {
//
// AZURE_CLIENT_CERTIFICATE_PASSWORD: (optional) password for the certificate file.
//
+// Note that this credential uses [ParseCertificates] to load the certificate and key from the file. If this
+// function isn't able to parse your certificate, use [ClientCertificateCredential] instead.
+//
// # User with username and password
//
// AZURE_TENANT_ID: (optional) tenant to authenticate in. Defaults to "organizations".
@@ -121,7 +124,7 @@ func NewEnvironmentCredential(options *EnvironmentCredentialOptions) (*Environme
}
certs, key, err := ParseCertificates(certData, password)
if err != nil {
- return nil, fmt.Errorf(`failed to load certificate from "%s": %v`, certPath, err)
+ return nil, fmt.Errorf("failed to parse %q due to error %q. This may be due to a limitation of this module's certificate loader. Consider calling NewClientCertificateCredential instead", certPath, err.Error())
}
o := &ClientCertificateCredentialOptions{
AdditionallyAllowedTenants: additionalTenants,
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/errors.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/errors.go
index 335d2b7d..b05cb035 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/errors.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/errors.go
@@ -13,15 +13,12 @@ import (
"fmt"
"net/http"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
"github.com/Azure/azure-sdk-for-go/sdk/internal/errorinfo"
msal "github.com/AzureAD/microsoft-authentication-library-for-go/apps/errors"
)
-// errAuthenticationRequired indicates a credential's Authenticate method must be called to acquire a token
-// because user interaction is required and the credential is configured not to automatically prompt the user.
-var errAuthenticationRequired error = &credentialUnavailableError{"can't acquire a token without user interaction. Call Authenticate to interactively authenticate a user"}
-
// getResponseFromError retrieves the response carried by
// an AuthenticationFailedError or MSAL CallErr, if any
func getResponseFromError(err error) *http.Response {
@@ -41,22 +38,34 @@ type AuthenticationFailedError struct {
// RawResponse is the HTTP response motivating the error, if available.
RawResponse *http.Response
- credType string
- message string
- err error
+ credType, message string
+ omitResponse bool
+}
+
+func newAuthenticationFailedError(credType, message string, resp *http.Response) error {
+ return &AuthenticationFailedError{credType: credType, message: message, RawResponse: resp}
}
-func newAuthenticationFailedError(credType string, message string, resp *http.Response, err error) error {
- return &AuthenticationFailedError{credType: credType, message: message, RawResponse: resp, err: err}
+// newAuthenticationFailedErrorFromMSAL creates an AuthenticationFailedError from an MSAL error.
+// If the error is an MSAL CallErr, the new error includes an HTTP response and not the MSAL error
+// message, because that message is redundant given the response. If the original error isn't a
+// CallErr, the returned error incorporates its message.
+func newAuthenticationFailedErrorFromMSAL(credType string, err error) error {
+ msg := ""
+ res := getResponseFromError(err)
+ if res == nil {
+ msg = err.Error()
+ }
+ return newAuthenticationFailedError(credType, msg, res)
}
// Error implements the error interface. Note that the message contents are not contractual and can change over time.
func (e *AuthenticationFailedError) Error() string {
- if e.RawResponse == nil {
+ if e.RawResponse == nil || e.omitResponse {
return e.credType + ": " + e.message
}
msg := &bytes.Buffer{}
- fmt.Fprintf(msg, e.credType+" authentication failed\n")
+ fmt.Fprintf(msg, "%s authentication failed. %s\n", e.credType, e.message)
if e.RawResponse.Request != nil {
fmt.Fprintf(msg, "%s %s://%s%s\n", e.RawResponse.Request.Method, e.RawResponse.Request.URL.Scheme, e.RawResponse.Request.URL.Host, e.RawResponse.Request.URL.Path)
} else {
@@ -65,7 +74,7 @@ func (e *AuthenticationFailedError) Error() string {
fmt.Fprintln(msg, "Request information not available")
}
fmt.Fprintln(msg, "--------------------------------------------------------------------------------")
- fmt.Fprintf(msg, "RESPONSE %s\n", e.RawResponse.Status)
+ fmt.Fprintf(msg, "RESPONSE %d: %s\n", e.RawResponse.StatusCode, e.RawResponse.Status)
fmt.Fprintln(msg, "--------------------------------------------------------------------------------")
body, err := runtime.Payload(e.RawResponse)
switch {
@@ -86,6 +95,8 @@ func (e *AuthenticationFailedError) Error() string {
anchor = "azure-cli"
case credNameAzureDeveloperCLI:
anchor = "azd"
+ case credNameAzurePipelines:
+ anchor = "apc"
case credNameCert:
anchor = "client-cert"
case credNameSecret:
@@ -110,8 +121,34 @@ func (*AuthenticationFailedError) NonRetriable() {
var _ errorinfo.NonRetriable = (*AuthenticationFailedError)(nil)
-// credentialUnavailableError indicates a credential can't attempt authentication because it lacks required
-// data or state
+// AuthenticationRequiredError indicates a credential's Authenticate method must be called to acquire a token
+// because the credential requires user interaction and is configured not to request it automatically.
+type AuthenticationRequiredError struct {
+ credentialUnavailableError
+
+ // TokenRequestOptions for the required token. Pass this to the credential's Authenticate method.
+ TokenRequestOptions policy.TokenRequestOptions
+}
+
+func newAuthenticationRequiredError(credType string, tro policy.TokenRequestOptions) error {
+ return &AuthenticationRequiredError{
+ credentialUnavailableError: credentialUnavailableError{
+ credType + " can't acquire a token without user interaction. Call Authenticate to authenticate a user interactively",
+ },
+ TokenRequestOptions: tro,
+ }
+}
+
+var (
+ _ credentialUnavailable = (*AuthenticationRequiredError)(nil)
+ _ errorinfo.NonRetriable = (*AuthenticationRequiredError)(nil)
+)
+
+type credentialUnavailable interface {
+ error
+ credentialUnavailable()
+}
+
type credentialUnavailableError struct {
message string
}
@@ -135,6 +172,11 @@ func (e *credentialUnavailableError) Error() string {
}
// NonRetriable is a marker method indicating this error should not be retried. It has no implementation.
-func (e *credentialUnavailableError) NonRetriable() {}
+func (*credentialUnavailableError) NonRetriable() {}
-var _ errorinfo.NonRetriable = (*credentialUnavailableError)(nil)
+func (*credentialUnavailableError) credentialUnavailable() {}
+
+var (
+ _ credentialUnavailable = (*credentialUnavailableError)(nil)
+ _ errorinfo.NonRetriable = (*credentialUnavailableError)(nil)
+)
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/go.work.sum b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/go.work.sum
deleted file mode 100644
index 7cd86b00..00000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/go.work.sum
+++ /dev/null
@@ -1,39 +0,0 @@
-github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.0-beta.1 h1:ODs3brnqQM99Tq1PffODpAViYv3Bf8zOg464MU7p5ew=
-github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.0-beta.1/go.mod h1:3Ug6Qzto9anB6mGlEdgYMDF5zHQ+wwhEaYR4s17PHMw=
-github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.0 h1:fb8kj/Dh4CSwgsOzHeZY4Xh68cFVbzXx+ONXGMY//4w=
-github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.0/go.mod h1:uReU2sSxZExRPBAg3qKzmAucSi51+SP1OhohieR821Q=
-github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM=
-github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1 h1:DzHpqpoJVaCgOUdVHxE8QB52S6NiVdDQvGlny1qvPqA=
-github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI=
-github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
-github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
-github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
-github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
-github.com/montanaflynn/stats v0.7.0/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow=
-github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
-github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
-github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
-github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
-github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
-github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
-golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
-golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
-golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
-golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
-golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
-golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
-golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY=
-golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
-golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o=
-golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU=
-golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
-golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
-golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0=
-golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
-golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
-gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
-gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/interactive_browser_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/interactive_browser_credential.go
index bd829698..848db16e 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/interactive_browser_credential.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/interactive_browser_credential.go
@@ -24,18 +24,26 @@ type InteractiveBrowserCredentialOptions struct {
// tokens. Add the wildcard value "*" to allow the credential to acquire tokens for any tenant.
AdditionallyAllowedTenants []string
- // authenticationRecord returned by a call to a credential's Authenticate method. Set this option
+ // AuthenticationRecord returned by a call to a credential's Authenticate method. Set this option
// to enable the credential to use data from a previous authentication.
- authenticationRecord authenticationRecord
-
- // ClientID is the ID of the application users will authenticate to.
- // Defaults to the ID of an Azure development application.
+ AuthenticationRecord AuthenticationRecord
+
+ // Cache is a persistent cache the credential will use to store the tokens it acquires, making
+ // them available to other processes and credential instances. The default, zero value means the
+ // credential will store tokens in memory and not share them with any other credential instance.
+ Cache Cache
+
+ // ClientID is the ID of the application to which users will authenticate. When not set, users
+ // will authenticate to an Azure development application, which isn't recommended for production
+ // scenarios. In production, developers should instead register their applications and assign
+ // appropriate roles. See https://aka.ms/azsdk/identity/AppRegistrationAndRoleAssignment for more
+ // information.
ClientID string
- // disableAutomaticAuthentication prevents the credential from automatically prompting the user to authenticate.
- // When this option is true, [InteractiveBrowserCredential.GetToken] will return [ErrAuthenticationRequired] when
- // user interaction is necessary to acquire a token.
- disableAutomaticAuthentication bool
+ // DisableAutomaticAuthentication prevents the credential from automatically prompting the user to authenticate.
+ // When this option is true, GetToken will return AuthenticationRequiredError when user interaction is necessary
+ // to acquire a token.
+ DisableAutomaticAuthentication bool
// DisableInstanceDiscovery should be set true only by applications authenticating in disconnected clouds, or
// private clouds such as Azure Stack. It determines whether the credential requests Microsoft Entra instance metadata
@@ -54,9 +62,6 @@ type InteractiveBrowserCredentialOptions struct {
// TenantID is the Microsoft Entra tenant the credential authenticates in. Defaults to the
// "organizations" tenant, which can authenticate work and school accounts.
TenantID string
-
- // tokenCachePersistenceOptions enables persistent token caching when not nil.
- tokenCachePersistenceOptions *tokenCachePersistenceOptions
}
func (o *InteractiveBrowserCredentialOptions) init() {
@@ -82,13 +87,13 @@ func NewInteractiveBrowserCredential(options *InteractiveBrowserCredentialOption
cp.init()
msalOpts := publicClientOptions{
AdditionallyAllowedTenants: cp.AdditionallyAllowedTenants,
+ Cache: cp.Cache,
ClientOptions: cp.ClientOptions,
- DisableAutomaticAuthentication: cp.disableAutomaticAuthentication,
+ DisableAutomaticAuthentication: cp.DisableAutomaticAuthentication,
DisableInstanceDiscovery: cp.DisableInstanceDiscovery,
LoginHint: cp.LoginHint,
- Record: cp.authenticationRecord,
+ Record: cp.AuthenticationRecord,
RedirectURL: cp.RedirectURL,
- TokenCachePersistenceOptions: cp.tokenCachePersistenceOptions,
}
c, err := newPublicClient(cp.TenantID, cp.ClientID, credNameBrowser, msalOpts)
if err != nil {
@@ -97,8 +102,9 @@ func NewInteractiveBrowserCredential(options *InteractiveBrowserCredentialOption
return &InteractiveBrowserCredential{client: c}, nil
}
-// Authenticate a user via the default browser. Subsequent calls to GetToken will automatically use the returned AuthenticationRecord.
-func (c *InteractiveBrowserCredential) authenticate(ctx context.Context, opts *policy.TokenRequestOptions) (authenticationRecord, error) {
+// Authenticate opens the default browser so a user can log in. Subsequent
+// GetToken calls will automatically use the returned AuthenticationRecord.
+func (c *InteractiveBrowserCredential) Authenticate(ctx context.Context, opts *policy.TokenRequestOptions) (AuthenticationRecord, error) {
var err error
ctx, endSpan := runtime.StartSpan(ctx, credNameBrowser+"."+traceOpAuthenticate, c.client.azClient.Tracer(), nil)
defer func() { endSpan(err) }()
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/internal/cache.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/internal/cache.go
new file mode 100644
index 00000000..c0cfe760
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/internal/cache.go
@@ -0,0 +1,86 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package internal
+
+import (
+ "sync"
+
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/cache"
+)
+
+// Cache represents a persistent cache that makes authentication data available across processes.
+// Construct one with [github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache.New]. This package's
+// [persistent user authentication example] shows how to use a persistent cache to reuse user
+// logins across application runs. For service principal credential types such as
+// [ClientCertificateCredential], simply set the Cache field on the credential options.
+//
+// [persistent user authentication example]: https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#example-package-PersistentUserAuthentication
+type Cache struct {
+ // impl is a pointer so a Cache can carry persistent state across copies
+ impl *impl
+}
+
+// impl is a Cache's private implementation
+type impl struct {
+ // factory constructs storage implementations
+ factory func(bool) (cache.ExportReplace, error)
+ // cae and noCAE are previously constructed storage implementations. CAE
+ // and non-CAE tokens must be stored separately because MSAL's cache doesn't
+ // observe token claims. If a single storage implementation held both kinds
+ // of tokens, it could create a reauthentication or error loop by returning
+ // a non-CAE token lacking a required claim.
+ cae, noCAE cache.ExportReplace
+ // mu synchronizes around cae and noCAE
+ mu *sync.RWMutex
+}
+
+func (i *impl) exportReplace(cae bool) (cache.ExportReplace, error) {
+ if i == nil {
+ // zero-value Cache: return a nil ExportReplace and MSAL will cache in memory
+ return nil, nil
+ }
+ var (
+ err error
+ xr cache.ExportReplace
+ )
+ i.mu.RLock()
+ xr = i.cae
+ if !cae {
+ xr = i.noCAE
+ }
+ i.mu.RUnlock()
+ if xr != nil {
+ return xr, nil
+ }
+ i.mu.Lock()
+ defer i.mu.Unlock()
+ if cae {
+ if i.cae == nil {
+ if xr, err = i.factory(cae); err == nil {
+ i.cae = xr
+ }
+ }
+ return i.cae, err
+ }
+ if i.noCAE == nil {
+ if xr, err = i.factory(cae); err == nil {
+ i.noCAE = xr
+ }
+ }
+ return i.noCAE, err
+}
+
+// NewCache is the constructor for Cache. It takes a factory instead of an instance
+// because it doesn't know whether the Cache will store both CAE and non-CAE tokens.
+func NewCache(factory func(cae bool) (cache.ExportReplace, error)) Cache {
+ return Cache{&impl{factory: factory, mu: &sync.RWMutex{}}}
+}
+
+// ExportReplace returns an implementation satisfying MSAL's ExportReplace interface.
+// It's a function instead of a method on Cache so packages in azidentity and
+// azidentity/cache can call it while applications can't. "cae" declares whether the
+// caller intends this implementation to store CAE tokens.
+func ExportReplace(c Cache, cae bool) (cache.ExportReplace, error) {
+ return c.impl.exportReplace(cae)
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/internal/exported.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/internal/exported.go
deleted file mode 100644
index b1b4d5c8..00000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/internal/exported.go
+++ /dev/null
@@ -1,18 +0,0 @@
-//go:build go1.18
-// +build go1.18
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-package internal
-
-// TokenCachePersistenceOptions contains options for persistent token caching
-type TokenCachePersistenceOptions struct {
- // AllowUnencryptedStorage controls whether the cache should fall back to storing its data in plain text
- // when encryption isn't possible. Setting this true doesn't disable encryption. The cache always attempts
- // encryption before falling back to plaintext storage.
- AllowUnencryptedStorage bool
-
- // Name identifies the cache. Set this to isolate data from other applications.
- Name string
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/internal/internal.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/internal/internal.go
deleted file mode 100644
index c1498b46..00000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/internal/internal.go
+++ /dev/null
@@ -1,31 +0,0 @@
-//go:build go1.18
-// +build go1.18
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-package internal
-
-import (
- "errors"
-
- "github.com/AzureAD/microsoft-authentication-library-for-go/apps/cache"
-)
-
-var errMissingImport = errors.New("import github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache to enable persistent caching")
-
-// NewCache constructs a persistent token cache when "o" isn't nil. Applications that intend to
-// use a persistent cache must first import the cache module, which will replace this function
-// with a platform-specific implementation.
-var NewCache = func(o *TokenCachePersistenceOptions, enableCAE bool) (cache.ExportReplace, error) {
- if o == nil {
- return nil, nil
- }
- return nil, errMissingImport
-}
-
-// CacheFilePath returns the path to the cache file for the given name.
-// Defining it in this package makes it available to azidentity tests.
-var CacheFilePath = func(name string) (string, error) {
- return "", errMissingImport
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed-identity-matrix.json b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed-identity-matrix.json
new file mode 100644
index 00000000..1c379177
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed-identity-matrix.json
@@ -0,0 +1,17 @@
+{
+ "include": [
+ {
+ "Agent": {
+ "msi_image": {
+ "ArmTemplateParameters": "@{deployResources = $true}",
+ "OSVmImage": "env:LINUXNEXTVMIMAGE",
+ "Pool": "env:LINUXPOOL"
+ }
+ },
+ "GoVersion": [
+ "1.22.1"
+ ],
+ "IDENTITY_IMDS_AVAILABLE": "1"
+ }
+ ]
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_client.go
index 7c25cb8b..4c657a92 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_client.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_client.go
@@ -14,13 +14,15 @@ import (
"net/http"
"net/url"
"os"
+ "path/filepath"
+ "runtime"
"strconv"
"strings"
"time"
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
- "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ azruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming"
"github.com/Azure/azure-sdk-for-go/sdk/internal/log"
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential"
@@ -34,16 +36,18 @@ const (
identityServerThumbprint = "IDENTITY_SERVER_THUMBPRINT"
headerMetadata = "Metadata"
imdsEndpoint = "http://169.254.169.254/metadata/identity/oauth2/token"
+ miResID = "mi_res_id"
msiEndpoint = "MSI_ENDPOINT"
+ msiResID = "msi_res_id"
msiSecret = "MSI_SECRET"
imdsAPIVersion = "2018-02-01"
azureArcAPIVersion = "2019-08-15"
+ qpClientID = "client_id"
serviceFabricAPIVersion = "2019-07-01-preview"
-
- qpClientID = "client_id"
- qpResID = "mi_res_id"
)
+var imdsProbeTimeout = time.Second
+
type msiType int
const (
@@ -55,13 +59,28 @@ const (
msiTypeServiceFabric
)
-// managedIdentityClient provides the base for authenticating in managed identity environments
-// This type includes an runtime.Pipeline and TokenCredentialOptions.
type managedIdentityClient struct {
- azClient *azcore.Client
- msiType msiType
- endpoint string
- id ManagedIDKind
+ azClient *azcore.Client
+ endpoint string
+ id ManagedIDKind
+ msiType msiType
+ probeIMDS bool
+}
+
+// arcKeyDirectory returns the directory expected to contain Azure Arc keys
+var arcKeyDirectory = func() (string, error) {
+ switch runtime.GOOS {
+ case "linux":
+ return "/var/opt/azcmagent/tokens", nil
+ case "windows":
+ pd := os.Getenv("ProgramData")
+ if pd == "" {
+ return "", errors.New("environment variable ProgramData has no value")
+ }
+ return filepath.Join(pd, "AzureConnectedMachineAgent", "Tokens"), nil
+ default:
+ return "", fmt.Errorf("unsupported OS %q", runtime.GOOS)
+ }
}
type wrappedNumber json.Number
@@ -88,7 +107,7 @@ func setIMDSRetryOptionDefaults(o *policy.RetryOptions) {
if o.StatusCodes == nil {
o.StatusCodes = []int{
// IMDS docs recommend retrying 404, 410, 429 and 5xx
- // https://learn.microsoft.com/azure/active-directory/managed-identities-azure-resources/how-to-use-vm-token#error-handling
+ // https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/how-to-use-vm-token#error-handling
http.StatusNotFound, // 404
http.StatusGone, // 410
http.StatusTooManyRequests, // 429
@@ -124,6 +143,9 @@ func newManagedIdentityClient(options *ManagedIdentityCredentialOptions) (*manag
if endpoint, ok := os.LookupEnv(identityEndpoint); ok {
if _, ok := os.LookupEnv(identityHeader); ok {
if _, ok := os.LookupEnv(identityServerThumbprint); ok {
+ if options.ID != nil {
+ return nil, errors.New("the Service Fabric API doesn't support specifying a user-assigned managed identity at runtime")
+ }
env = "Service Fabric"
c.endpoint = endpoint
c.msiType = msiTypeServiceFabric
@@ -133,6 +155,9 @@ func newManagedIdentityClient(options *ManagedIdentityCredentialOptions) (*manag
c.msiType = msiTypeAppService
}
} else if _, ok := os.LookupEnv(arcIMDSEndpoint); ok {
+ if options.ID != nil {
+ return nil, errors.New("the Azure Arc API doesn't support specifying a user-assigned managed identity at runtime")
+ }
env = "Azure Arc"
c.endpoint = endpoint
c.msiType = msiTypeAzureArc
@@ -140,18 +165,25 @@ func newManagedIdentityClient(options *ManagedIdentityCredentialOptions) (*manag
} else if endpoint, ok := os.LookupEnv(msiEndpoint); ok {
c.endpoint = endpoint
if _, ok := os.LookupEnv(msiSecret); ok {
+ if options.ID != nil && options.ID.idKind() != miClientID {
+ return nil, errors.New("the Azure ML API supports specifying a user-assigned managed identity by client ID only")
+ }
env = "Azure ML"
c.msiType = msiTypeAzureML
} else {
+ if options.ID != nil {
+ return nil, errors.New("the Cloud Shell API doesn't support user-assigned managed identities")
+ }
env = "Cloud Shell"
c.msiType = msiTypeCloudShell
}
} else {
+ c.probeIMDS = options.dac
setIMDSRetryOptionDefaults(&cp.Retry)
}
- client, err := azcore.NewClient(module, version, runtime.PipelineOptions{
- Tracing: runtime.TracingOptions{
+ client, err := azcore.NewClient(module, version, azruntime.PipelineOptions{
+ Tracing: azruntime.TracingOptions{
Namespace: traceNamespace,
},
}, &cp)
@@ -180,6 +212,37 @@ func (c *managedIdentityClient) provideToken(ctx context.Context, params confide
// authenticate acquires an access token
func (c *managedIdentityClient) authenticate(ctx context.Context, id ManagedIDKind, scopes []string) (azcore.AccessToken, error) {
+ // no need to synchronize around this value because it's true only when DefaultAzureCredential constructed the client,
+ // and in that case ChainedTokenCredential.GetToken synchronizes goroutines that would execute this block
+ if c.probeIMDS {
+ cx, cancel := context.WithTimeout(ctx, imdsProbeTimeout)
+ defer cancel()
+ cx = policy.WithRetryOptions(cx, policy.RetryOptions{MaxRetries: -1})
+ req, err := azruntime.NewRequest(cx, http.MethodGet, c.endpoint)
+ if err != nil {
+ return azcore.AccessToken{}, fmt.Errorf("failed to create IMDS probe request: %s", err)
+ }
+ res, err := c.azClient.Pipeline().Do(req)
+ if err != nil {
+ msg := err.Error()
+ if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
+ msg = "managed identity timed out. See https://aka.ms/azsdk/go/identity/troubleshoot#dac for more information"
+ }
+ return azcore.AccessToken{}, newCredentialUnavailableError(credNameManagedIdentity, msg)
+ }
+ // because IMDS always responds with JSON, assume a non-JSON response is from something else, such
+ // as a proxy, and return credentialUnavailableError so DefaultAzureCredential continues iterating
+ b, err := azruntime.Payload(res)
+ if err != nil {
+ return azcore.AccessToken{}, newCredentialUnavailableError(credNameManagedIdentity, fmt.Sprintf("failed to read IMDS probe response: %s", err))
+ }
+ if !json.Valid(b) {
+ return azcore.AccessToken{}, newCredentialUnavailableError(credNameManagedIdentity, "unexpected response to IMDS probe")
+ }
+ // send normal token requests from now on because IMDS responded
+ c.probeIMDS = false
+ }
+
msg, err := c.createAuthRequest(ctx, id, scopes)
if err != nil {
return azcore.AccessToken{}, err
@@ -187,10 +250,10 @@ func (c *managedIdentityClient) authenticate(ctx context.Context, id ManagedIDKi
resp, err := c.azClient.Pipeline().Do(msg)
if err != nil {
- return azcore.AccessToken{}, newAuthenticationFailedError(credNameManagedIdentity, err.Error(), nil, err)
+ return azcore.AccessToken{}, newAuthenticationFailedError(credNameManagedIdentity, err.Error(), nil)
}
- if runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) {
+ if azruntime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) {
return c.createAccessToken(resp)
}
@@ -198,24 +261,24 @@ func (c *managedIdentityClient) authenticate(ctx context.Context, id ManagedIDKi
switch resp.StatusCode {
case http.StatusBadRequest:
if id != nil {
- return azcore.AccessToken{}, newAuthenticationFailedError(credNameManagedIdentity, "the requested identity isn't assigned to this resource", resp, nil)
+ return azcore.AccessToken{}, newAuthenticationFailedError(credNameManagedIdentity, "the requested identity isn't assigned to this resource", resp)
}
msg := "failed to authenticate a system assigned identity"
- if body, err := runtime.Payload(resp); err == nil && len(body) > 0 {
+ if body, err := azruntime.Payload(resp); err == nil && len(body) > 0 {
msg += fmt.Sprintf(". The endpoint responded with %s", body)
}
return azcore.AccessToken{}, newCredentialUnavailableError(credNameManagedIdentity, msg)
case http.StatusForbidden:
// Docker Desktop runs a proxy that responds 403 to IMDS token requests. If we get that response,
// we return credentialUnavailableError so credential chains continue to their next credential
- body, err := runtime.Payload(resp)
- if err == nil && strings.Contains(string(body), "A socket operation was attempted to an unreachable network") {
+ body, err := azruntime.Payload(resp)
+ if err == nil && strings.Contains(string(body), "unreachable") {
return azcore.AccessToken{}, newCredentialUnavailableError(credNameManagedIdentity, fmt.Sprintf("unexpected response %q", string(body)))
}
}
}
- return azcore.AccessToken{}, newAuthenticationFailedError(credNameManagedIdentity, "authentication failed", resp, nil)
+ return azcore.AccessToken{}, newAuthenticationFailedError(credNameManagedIdentity, "", resp)
}
func (c *managedIdentityClient) createAccessToken(res *http.Response) (azcore.AccessToken, error) {
@@ -226,7 +289,7 @@ func (c *managedIdentityClient) createAccessToken(res *http.Response) (azcore.Ac
ExpiresIn wrappedNumber `json:"expires_in,omitempty"` // this field should always return the number of seconds for which a token is valid
ExpiresOn interface{} `json:"expires_on,omitempty"` // the value returned in this field varies between a number and a date string
}{}
- if err := runtime.UnmarshalAsJSON(res, &value); err != nil {
+ if err := azruntime.UnmarshalAsJSON(res, &value); err != nil {
return azcore.AccessToken{}, fmt.Errorf("internal AccessToken: %v", err)
}
if value.ExpiresIn != "" {
@@ -243,10 +306,10 @@ func (c *managedIdentityClient) createAccessToken(res *http.Response) (azcore.Ac
if expiresOn, err := strconv.Atoi(v); err == nil {
return azcore.AccessToken{Token: value.Token, ExpiresOn: time.Unix(int64(expiresOn), 0).UTC()}, nil
}
- return azcore.AccessToken{}, newAuthenticationFailedError(credNameManagedIdentity, "unexpected expires_on value: "+v, res, nil)
+ return azcore.AccessToken{}, newAuthenticationFailedError(credNameManagedIdentity, "unexpected expires_on value: "+v, res)
default:
msg := fmt.Sprintf("unsupported type received in expires_on: %T, %v", v, v)
- return azcore.AccessToken{}, newAuthenticationFailedError(credNameManagedIdentity, msg, res, nil)
+ return azcore.AccessToken{}, newAuthenticationFailedError(credNameManagedIdentity, msg, res)
}
}
@@ -261,34 +324,37 @@ func (c *managedIdentityClient) createAuthRequest(ctx context.Context, id Manage
key, err := c.getAzureArcSecretKey(ctx, scopes)
if err != nil {
msg := fmt.Sprintf("failed to retreive secret key from the identity endpoint: %v", err)
- return nil, newAuthenticationFailedError(credNameManagedIdentity, msg, nil, err)
+ return nil, newAuthenticationFailedError(credNameManagedIdentity, msg, nil)
}
- return c.createAzureArcAuthRequest(ctx, id, scopes, key)
+ return c.createAzureArcAuthRequest(ctx, scopes, key)
case msiTypeAzureML:
return c.createAzureMLAuthRequest(ctx, id, scopes)
case msiTypeServiceFabric:
- return c.createServiceFabricAuthRequest(ctx, id, scopes)
+ return c.createServiceFabricAuthRequest(ctx, scopes)
case msiTypeCloudShell:
- return c.createCloudShellAuthRequest(ctx, id, scopes)
+ return c.createCloudShellAuthRequest(ctx, scopes)
default:
return nil, newCredentialUnavailableError(credNameManagedIdentity, "managed identity isn't supported in this environment")
}
}
func (c *managedIdentityClient) createIMDSAuthRequest(ctx context.Context, id ManagedIDKind, scopes []string) (*policy.Request, error) {
- request, err := runtime.NewRequest(ctx, http.MethodGet, c.endpoint)
+ request, err := azruntime.NewRequest(ctx, http.MethodGet, c.endpoint)
if err != nil {
return nil, err
}
request.Raw().Header.Set(headerMetadata, "true")
q := request.Raw().URL.Query()
- q.Add("api-version", imdsAPIVersion)
- q.Add("resource", strings.Join(scopes, " "))
+ q.Set("api-version", imdsAPIVersion)
+ q.Set("resource", strings.Join(scopes, " "))
if id != nil {
- if id.idKind() == miResourceID {
- q.Add(qpResID, id.String())
- } else {
- q.Add(qpClientID, id.String())
+ switch id.idKind() {
+ case miClientID:
+ q.Set(qpClientID, id.String())
+ case miObjectID:
+ q.Set("object_id", id.String())
+ case miResourceID:
+ q.Set(msiResID, id.String())
}
}
request.Raw().URL.RawQuery = q.Encode()
@@ -296,19 +362,22 @@ func (c *managedIdentityClient) createIMDSAuthRequest(ctx context.Context, id Ma
}
func (c *managedIdentityClient) createAppServiceAuthRequest(ctx context.Context, id ManagedIDKind, scopes []string) (*policy.Request, error) {
- request, err := runtime.NewRequest(ctx, http.MethodGet, c.endpoint)
+ request, err := azruntime.NewRequest(ctx, http.MethodGet, c.endpoint)
if err != nil {
return nil, err
}
request.Raw().Header.Set("X-IDENTITY-HEADER", os.Getenv(identityHeader))
q := request.Raw().URL.Query()
- q.Add("api-version", "2019-08-01")
- q.Add("resource", scopes[0])
+ q.Set("api-version", "2019-08-01")
+ q.Set("resource", scopes[0])
if id != nil {
- if id.idKind() == miResourceID {
- q.Add(qpResID, id.String())
- } else {
- q.Add(qpClientID, id.String())
+ switch id.idKind() {
+ case miClientID:
+ q.Set(qpClientID, id.String())
+ case miObjectID:
+ q.Set("principal_id", id.String())
+ case miResourceID:
+ q.Set(miResID, id.String())
}
}
request.Raw().URL.RawQuery = q.Encode()
@@ -316,60 +385,53 @@ func (c *managedIdentityClient) createAppServiceAuthRequest(ctx context.Context,
}
func (c *managedIdentityClient) createAzureMLAuthRequest(ctx context.Context, id ManagedIDKind, scopes []string) (*policy.Request, error) {
- request, err := runtime.NewRequest(ctx, http.MethodGet, c.endpoint)
+ request, err := azruntime.NewRequest(ctx, http.MethodGet, c.endpoint)
if err != nil {
return nil, err
}
request.Raw().Header.Set("secret", os.Getenv(msiSecret))
q := request.Raw().URL.Query()
- q.Add("api-version", "2017-09-01")
- q.Add("resource", strings.Join(scopes, " "))
- q.Add("clientid", os.Getenv(defaultIdentityClientID))
+ q.Set("api-version", "2017-09-01")
+ q.Set("resource", strings.Join(scopes, " "))
+ q.Set("clientid", os.Getenv(defaultIdentityClientID))
if id != nil {
- if id.idKind() == miResourceID {
- log.Write(EventAuthentication, "WARNING: Azure ML doesn't support specifying a managed identity by resource ID")
- q.Set("clientid", "")
- q.Set(qpResID, id.String())
- } else {
+ switch id.idKind() {
+ case miClientID:
q.Set("clientid", id.String())
+ case miObjectID:
+ return nil, newAuthenticationFailedError(credNameManagedIdentity, "Azure ML doesn't support specifying a managed identity by object ID", nil)
+ case miResourceID:
+ return nil, newAuthenticationFailedError(credNameManagedIdentity, "Azure ML doesn't support specifying a managed identity by resource ID", nil)
}
}
request.Raw().URL.RawQuery = q.Encode()
return request, nil
}
-func (c *managedIdentityClient) createServiceFabricAuthRequest(ctx context.Context, id ManagedIDKind, scopes []string) (*policy.Request, error) {
- request, err := runtime.NewRequest(ctx, http.MethodGet, c.endpoint)
+func (c *managedIdentityClient) createServiceFabricAuthRequest(ctx context.Context, scopes []string) (*policy.Request, error) {
+ request, err := azruntime.NewRequest(ctx, http.MethodGet, c.endpoint)
if err != nil {
return nil, err
}
q := request.Raw().URL.Query()
request.Raw().Header.Set("Accept", "application/json")
request.Raw().Header.Set("Secret", os.Getenv(identityHeader))
- q.Add("api-version", serviceFabricAPIVersion)
- q.Add("resource", strings.Join(scopes, " "))
- if id != nil {
- log.Write(EventAuthentication, "WARNING: Service Fabric doesn't support selecting a user-assigned identity at runtime")
- if id.idKind() == miResourceID {
- q.Add(qpResID, id.String())
- } else {
- q.Add(qpClientID, id.String())
- }
- }
+ q.Set("api-version", serviceFabricAPIVersion)
+ q.Set("resource", strings.Join(scopes, " "))
request.Raw().URL.RawQuery = q.Encode()
return request, nil
}
func (c *managedIdentityClient) getAzureArcSecretKey(ctx context.Context, resources []string) (string, error) {
// create the request to retreive the secret key challenge provided by the HIMDS service
- request, err := runtime.NewRequest(ctx, http.MethodGet, c.endpoint)
+ request, err := azruntime.NewRequest(ctx, http.MethodGet, c.endpoint)
if err != nil {
return "", err
}
request.Raw().Header.Set(headerMetadata, "true")
q := request.Raw().URL.Query()
- q.Add("api-version", azureArcAPIVersion)
- q.Add("resource", strings.Join(resources, " "))
+ q.Set("api-version", azureArcAPIVersion)
+ q.Set("resource", strings.Join(resources, " "))
request.Raw().URL.RawQuery = q.Encode()
// send the initial request to get the short-lived secret key
response, err := c.azClient.Pipeline().Do(request)
@@ -380,48 +442,54 @@ func (c *managedIdentityClient) getAzureArcSecretKey(ctx context.Context, resour
// of the secret key file. Any other status code indicates an error in the request.
if response.StatusCode != 401 {
msg := fmt.Sprintf("expected a 401 response, received %d", response.StatusCode)
- return "", newAuthenticationFailedError(credNameManagedIdentity, msg, response, nil)
+ return "", newAuthenticationFailedError(credNameManagedIdentity, msg, response)
}
header := response.Header.Get("WWW-Authenticate")
if len(header) == 0 {
- return "", errors.New("did not receive a value from WWW-Authenticate header")
+ return "", newAuthenticationFailedError(credNameManagedIdentity, "HIMDS response has no WWW-Authenticate header", nil)
}
// the WWW-Authenticate header is expected in the following format: Basic realm=/some/file/path.key
- pos := strings.LastIndex(header, "=")
- if pos == -1 {
- return "", fmt.Errorf("did not receive a correct value from WWW-Authenticate header: %s", header)
+ _, p, found := strings.Cut(header, "=")
+ if !found {
+ return "", newAuthenticationFailedError(credNameManagedIdentity, "unexpected WWW-Authenticate header from HIMDS: "+header, nil)
}
- key, err := os.ReadFile(header[pos+1:])
+ expected, err := arcKeyDirectory()
if err != nil {
- return "", fmt.Errorf("could not read file (%s) contents: %v", header[pos+1:], err)
+ return "", err
+ }
+ if filepath.Dir(p) != expected || !strings.HasSuffix(p, ".key") {
+ return "", newAuthenticationFailedError(credNameManagedIdentity, "unexpected file path from HIMDS service: "+p, nil)
+ }
+ f, err := os.Stat(p)
+ if err != nil {
+ return "", newAuthenticationFailedError(credNameManagedIdentity, fmt.Sprintf("could not stat %q: %v", p, err), nil)
+ }
+ if s := f.Size(); s > 4096 {
+ return "", newAuthenticationFailedError(credNameManagedIdentity, fmt.Sprintf("key is too large (%d bytes)", s), nil)
+ }
+ key, err := os.ReadFile(p)
+ if err != nil {
+ return "", newAuthenticationFailedError(credNameManagedIdentity, fmt.Sprintf("could not read %q: %v", p, err), nil)
}
return string(key), nil
}
-func (c *managedIdentityClient) createAzureArcAuthRequest(ctx context.Context, id ManagedIDKind, resources []string, key string) (*policy.Request, error) {
- request, err := runtime.NewRequest(ctx, http.MethodGet, c.endpoint)
+func (c *managedIdentityClient) createAzureArcAuthRequest(ctx context.Context, resources []string, key string) (*policy.Request, error) {
+ request, err := azruntime.NewRequest(ctx, http.MethodGet, c.endpoint)
if err != nil {
return nil, err
}
request.Raw().Header.Set(headerMetadata, "true")
request.Raw().Header.Set("Authorization", fmt.Sprintf("Basic %s", key))
q := request.Raw().URL.Query()
- q.Add("api-version", azureArcAPIVersion)
- q.Add("resource", strings.Join(resources, " "))
- if id != nil {
- log.Write(EventAuthentication, "WARNING: Azure Arc doesn't support user-assigned managed identities")
- if id.idKind() == miResourceID {
- q.Add(qpResID, id.String())
- } else {
- q.Add(qpClientID, id.String())
- }
- }
+ q.Set("api-version", azureArcAPIVersion)
+ q.Set("resource", strings.Join(resources, " "))
request.Raw().URL.RawQuery = q.Encode()
return request, nil
}
-func (c *managedIdentityClient) createCloudShellAuthRequest(ctx context.Context, id ManagedIDKind, scopes []string) (*policy.Request, error) {
- request, err := runtime.NewRequest(ctx, http.MethodPost, c.endpoint)
+func (c *managedIdentityClient) createCloudShellAuthRequest(ctx context.Context, scopes []string) (*policy.Request, error) {
+ request, err := azruntime.NewRequest(ctx, http.MethodPost, c.endpoint)
if err != nil {
return nil, err
}
@@ -433,14 +501,5 @@ func (c *managedIdentityClient) createCloudShellAuthRequest(ctx context.Context,
if err := request.SetBody(body, "application/x-www-form-urlencoded"); err != nil {
return nil, err
}
- if id != nil {
- log.Write(EventAuthentication, "WARNING: Cloud Shell doesn't support user-assigned managed identities")
- q := request.Raw().URL.Query()
- if id.idKind() == miResourceID {
- q.Add(qpResID, id.String())
- } else {
- q.Add(qpClientID, id.String())
- }
- }
return request, nil
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_credential.go
index dcd278be..1d53579c 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_credential.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_credential.go
@@ -22,8 +22,9 @@ const credNameManagedIdentity = "ManagedIdentityCredential"
type managedIdentityIDKind int
const (
- miClientID managedIdentityIDKind = 0
- miResourceID managedIdentityIDKind = 1
+ miClientID managedIdentityIDKind = iota
+ miObjectID
+ miResourceID
)
// ManagedIDKind identifies the ID of a managed identity as either a client or resource ID
@@ -32,7 +33,12 @@ type ManagedIDKind interface {
idKind() managedIdentityIDKind
}
-// ClientID is the client ID of a user-assigned managed identity.
+// ClientID is the client ID of a user-assigned managed identity. [NewManagedIdentityCredential]
+// returns an error when a ClientID is specified on the following platforms:
+//
+// - Azure Arc
+// - Cloud Shell
+// - Service Fabric
type ClientID string
func (ClientID) idKind() managedIdentityIDKind {
@@ -44,7 +50,31 @@ func (c ClientID) String() string {
return string(c)
}
-// ResourceID is the resource ID of a user-assigned managed identity.
+// ObjectID is the object ID of a user-assigned managed identity. [NewManagedIdentityCredential]
+// returns an error when an ObjectID is specified on the following platforms:
+//
+// - Azure Arc
+// - Azure ML
+// - Cloud Shell
+// - Service Fabric
+type ObjectID string
+
+func (ObjectID) idKind() managedIdentityIDKind {
+ return miObjectID
+}
+
+// String returns the string value of the ID.
+func (o ObjectID) String() string {
+ return string(o)
+}
+
+// ResourceID is the resource ID of a user-assigned managed identity. [NewManagedIdentityCredential]
+// returns an error when a ResourceID is specified on the following platforms:
+//
+// - Azure Arc
+// - Azure ML
+// - Cloud Shell
+// - Service Fabric
type ResourceID string
func (ResourceID) idKind() managedIdentityIDKind {
@@ -60,16 +90,25 @@ func (r ResourceID) String() string {
type ManagedIdentityCredentialOptions struct {
azcore.ClientOptions
- // ID is the ID of a managed identity the credential should authenticate. Set this field to use a specific identity
- // instead of the hosting environment's default. The value may be the identity's client ID or resource ID, but note that
- // some platforms don't accept resource IDs.
+ // ID of a managed identity the credential should authenticate. Set this field to use a specific identity instead of
+ // the hosting environment's default. The value may be the identity's client, object, or resource ID.
+ // NewManagedIdentityCredential returns an error when the hosting environment doesn't support user-assigned managed
+ // identities, or the specified kind of ID.
ID ManagedIDKind
+
+ // dac indicates whether the credential is part of DefaultAzureCredential. When true, and the environment doesn't have
+ // configuration for a specific managed identity API, the credential tries to determine whether IMDS is available before
+ // sending its first token request. It does this by sending a malformed request with a short timeout. Any response to that
+ // request is taken to mean IMDS is available, in which case the credential will send ordinary token requests thereafter
+ // with no special timeout. The purpose of this behavior is to prevent a very long timeout when IMDS isn't available.
+ dac bool
}
-// ManagedIdentityCredential authenticates an Azure managed identity in any hosting environment supporting managed identities.
+// ManagedIdentityCredential authenticates an [Azure managed identity] in any hosting environment supporting managed identities.
// This credential authenticates a system-assigned identity by default. Use ManagedIdentityCredentialOptions.ID to specify a
-// user-assigned identity. See Microsoft Entra ID documentation for more information about managed identities:
-// https://learn.microsoft.com/azure/active-directory/managed-identities-azure-resources/overview
+// user-assigned identity.
+//
+// [Azure managed identity]: https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/overview
type ManagedIdentityCredential struct {
client *confidentialClient
mic *managedIdentityClient
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/on_behalf_of_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/on_behalf_of_credential.go
index 5e67cf02..9dcc82f0 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/on_behalf_of_credential.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/on_behalf_of_credential.go
@@ -10,6 +10,7 @@ import (
"context"
"crypto"
"crypto/x509"
+ "errors"
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
@@ -24,7 +25,7 @@ const credNameOBO = "OnBehalfOfCredential"
// is not an interactive authentication flow, an application using it must have admin consent for any delegated
// permissions before requesting tokens for them. See [Microsoft Entra ID documentation] for more details.
//
-// [Microsoft Entra ID documentation]: https://learn.microsoft.com/azure/active-directory/develop/v2-oauth2-on-behalf-of-flow
+// [Microsoft Entra ID documentation]: https://learn.microsoft.com/entra/identity-platform/v2-oauth2-on-behalf-of-flow
type OnBehalfOfCredential struct {
client *confidentialClient
}
@@ -60,6 +61,19 @@ func NewOnBehalfOfCredentialWithCertificate(tenantID, clientID, userAssertion st
return newOnBehalfOfCredential(tenantID, clientID, userAssertion, cred, options)
}
+// NewOnBehalfOfCredentialWithClientAssertions constructs an OnBehalfOfCredential that authenticates with client assertions.
+// userAssertion is the user's access token for the application. The getAssertion function should return client assertions
+// that authenticate the application to Microsoft Entra ID, such as federated credentials.
+func NewOnBehalfOfCredentialWithClientAssertions(tenantID, clientID, userAssertion string, getAssertion func(context.Context) (string, error), options *OnBehalfOfCredentialOptions) (*OnBehalfOfCredential, error) {
+ if getAssertion == nil {
+ return nil, errors.New("getAssertion can't be nil. It must be a function that returns client assertions")
+ }
+ cred := confidential.NewCredFromAssertionCallback(func(ctx context.Context, _ confidential.AssertionRequestOptions) (string, error) {
+ return getAssertion(ctx)
+ })
+ return newOnBehalfOfCredential(tenantID, clientID, userAssertion, cred, options)
+}
+
// NewOnBehalfOfCredentialWithSecret constructs an OnBehalfOfCredential that authenticates with a client secret.
func NewOnBehalfOfCredentialWithSecret(tenantID, clientID, userAssertion, clientSecret string, options *OnBehalfOfCredentialOptions) (*OnBehalfOfCredential, error) {
cred, err := confidential.NewCredFromSecret(clientSecret)
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/public_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/public_client.go
index 63c31190..73363e1c 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/public_client.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/public_client.go
@@ -30,12 +30,12 @@ type publicClientOptions struct {
azcore.ClientOptions
AdditionallyAllowedTenants []string
+ Cache Cache
DeviceCodePrompt func(context.Context, DeviceCodeMessage) error
DisableAutomaticAuthentication bool
DisableInstanceDiscovery bool
LoginHint, RedirectURL string
- Record authenticationRecord
- TokenCachePersistenceOptions *tokenCachePersistenceOptions
+ Record AuthenticationRecord
Username, Password string
}
@@ -48,7 +48,7 @@ type publicClient struct {
host string
name string
opts publicClientOptions
- record authenticationRecord
+ record AuthenticationRecord
azClient *azcore.Client
}
@@ -107,19 +107,19 @@ func newPublicClient(tenantID, clientID, name string, o publicClientOptions) (*p
}, nil
}
-func (p *publicClient) Authenticate(ctx context.Context, tro *policy.TokenRequestOptions) (authenticationRecord, error) {
+func (p *publicClient) Authenticate(ctx context.Context, tro *policy.TokenRequestOptions) (AuthenticationRecord, error) {
if tro == nil {
tro = &policy.TokenRequestOptions{}
}
if len(tro.Scopes) == 0 {
if p.defaultScope == nil {
- return authenticationRecord{}, errScopeRequired
+ return AuthenticationRecord{}, errScopeRequired
}
tro.Scopes = p.defaultScope
}
client, mu, err := p.client(*tro)
if err != nil {
- return authenticationRecord{}, err
+ return AuthenticationRecord{}, err
}
mu.Lock()
defer mu.Unlock()
@@ -152,7 +152,7 @@ func (p *publicClient) GetToken(ctx context.Context, tro policy.TokenRequestOpti
return p.token(ar, err)
}
if p.opts.DisableAutomaticAuthentication {
- return azcore.AccessToken{}, errAuthenticationRequired
+ return azcore.AccessToken{}, newAuthenticationRequiredError(p.name, tro)
}
at, err := p.reqToken(ctx, client, tro)
if err == nil {
@@ -222,13 +222,13 @@ func (p *publicClient) client(tro policy.TokenRequestOptions) (msalPublicClient,
}
func (p *publicClient) newMSALClient(enableCAE bool) (msalPublicClient, error) {
- cache, err := internal.NewCache(p.opts.TokenCachePersistenceOptions, enableCAE)
+ c, err := internal.ExportReplace(p.opts.Cache, enableCAE)
if err != nil {
return nil, err
}
o := []public.Option{
public.WithAuthority(runtime.JoinPaths(p.host, p.tenantID)),
- public.WithCache(cache),
+ public.WithCache(c),
public.WithHTTPClient(p),
}
if enableCAE {
@@ -244,8 +244,7 @@ func (p *publicClient) token(ar public.AuthResult, err error) (azcore.AccessToke
if err == nil {
p.record, err = newAuthenticationRecord(ar)
} else {
- res := getResponseFromError(err)
- err = newAuthenticationFailedError(p.name, err.Error(), res, err)
+ err = newAuthenticationFailedErrorFromMSAL(p.name, err)
}
return azcore.AccessToken{Token: ar.AccessToken, ExpiresOn: ar.ExpiresOn.UTC()}, err
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources-post.ps1 b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources-post.ps1
new file mode 100644
index 00000000..1a07fede
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources-post.ps1
@@ -0,0 +1,126 @@
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License.
+
+# IMPORTANT: Do not invoke this file directly. Please instead run eng/common/TestResources/New-TestResources.ps1 from the repository root.
+
+param (
+ [hashtable] $AdditionalParameters = @{},
+ [hashtable] $DeploymentOutputs,
+
+ [Parameter(ParameterSetName = 'Provisioner', Mandatory = $true)]
+ [ValidateNotNullOrEmpty()]
+ [string] $TenantId,
+
+ [Parameter()]
+ [ValidatePattern('^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$')]
+ [string] $TestApplicationId,
+
+ # Captures any arguments from eng/New-TestResources.ps1 not declared here (no parameter errors).
+ [Parameter(ValueFromRemainingArguments = $true)]
+ $RemainingArguments
+)
+
+$ErrorActionPreference = 'Stop'
+$PSNativeCommandUseErrorActionPreference = $true
+
+if ($CI) {
+ if (!$AdditionalParameters['deployResources']) {
+ Write-Host "Skipping post-provisioning script because resources weren't deployed"
+ return
+ }
+ az login --federated-token $env:OIDC_TOKEN --service-principal -t $TenantId -u $TestApplicationId
+ az account set --subscription $DeploymentOutputs['AZIDENTITY_SUBSCRIPTION_ID']
+}
+
+Write-Host "Building container"
+$image = "$($DeploymentOutputs['AZIDENTITY_ACR_LOGIN_SERVER'])/azidentity-managed-id-test"
+Set-Content -Path "$PSScriptRoot/Dockerfile" -Value @"
+FROM mcr.microsoft.com/oss/go/microsoft/golang:latest AS builder
+ENV GOARCH=amd64 GOWORK=off
+COPY . /azidentity
+WORKDIR /azidentity/testdata/managed-id-test
+RUN go mod tidy
+RUN go build -o /build/managed-id-test .
+RUN GOOS=windows go build -o /build/managed-id-test.exe .
+
+FROM mcr.microsoft.com/mirror/docker/library/alpine:3.16
+RUN apk add gcompat
+COPY --from=builder /build/* .
+RUN chmod +x managed-id-test
+CMD ["./managed-id-test"]
+"@
+# build from sdk/azidentity because we need that dir in the context (because the test app uses local azidentity)
+docker build -t $image "$PSScriptRoot"
+az acr login -n $DeploymentOutputs['AZIDENTITY_ACR_NAME']
+docker push $image
+
+$rg = $DeploymentOutputs['AZIDENTITY_RESOURCE_GROUP']
+
+# ACI is easier to provision here than in the bicep file because the image isn't available before now
+Write-Host "Deploying Azure Container Instance"
+$aciName = "azidentity-test"
+az container create -g $rg -n $aciName --image $image `
+ --acr-identity $($DeploymentOutputs['AZIDENTITY_USER_ASSIGNED_IDENTITY']) `
+ --assign-identity [system] $($DeploymentOutputs['AZIDENTITY_USER_ASSIGNED_IDENTITY']) `
+ --role "Storage Blob Data Reader" `
+ --scope $($DeploymentOutputs['AZIDENTITY_STORAGE_ID']) `
+ -e AZIDENTITY_STORAGE_NAME=$($DeploymentOutputs['AZIDENTITY_STORAGE_NAME']) `
+ AZIDENTITY_STORAGE_NAME_USER_ASSIGNED=$($DeploymentOutputs['AZIDENTITY_STORAGE_NAME_USER_ASSIGNED']) `
+ AZIDENTITY_USER_ASSIGNED_IDENTITY=$($DeploymentOutputs['AZIDENTITY_USER_ASSIGNED_IDENTITY']) `
+ AZIDENTITY_USER_ASSIGNED_IDENTITY_CLIENT_ID=$($DeploymentOutputs['AZIDENTITY_USER_ASSIGNED_IDENTITY_CLIENT_ID']) `
+ AZIDENTITY_USER_ASSIGNED_IDENTITY_OBJECT_ID=$($DeploymentOutputs['AZIDENTITY_USER_ASSIGNED_IDENTITY_OBJECT_ID']) `
+ FUNCTIONS_CUSTOMHANDLER_PORT=80
+Write-Host "##vso[task.setvariable variable=AZIDENTITY_ACI_NAME;]$aciName"
+
+# Azure Functions deployment: copy the Windows binary from the Docker image, deploy it in a zip
+Write-Host "Deploying to Azure Functions"
+$container = docker create $image
+docker cp ${container}:managed-id-test.exe "$PSScriptRoot/testdata/managed-id-test/"
+docker rm -v $container
+Compress-Archive -Path "$PSScriptRoot/testdata/managed-id-test/*" -DestinationPath func.zip -Force
+az functionapp deploy -g $rg -n $DeploymentOutputs['AZIDENTITY_FUNCTION_NAME'] --src-path func.zip --type zip
+
+Write-Host "Creating federated identity"
+$aksName = $DeploymentOutputs['AZIDENTITY_AKS_NAME']
+$idName = $DeploymentOutputs['AZIDENTITY_USER_ASSIGNED_IDENTITY_NAME']
+$issuer = az aks show -g $rg -n $aksName --query "oidcIssuerProfile.issuerUrl" -otsv
+$podName = "azidentity-test"
+$serviceAccountName = "workload-identity-sa"
+az identity federated-credential create -g $rg --identity-name $idName --issuer $issuer --name $idName --subject system:serviceaccount:default:$serviceAccountName
+Write-Host "Deploying to AKS"
+az aks get-credentials -g $rg -n $aksName
+az aks update --attach-acr $DeploymentOutputs['AZIDENTITY_ACR_NAME'] -g $rg -n $aksName
+Set-Content -Path "$PSScriptRoot/k8s.yaml" -Value @"
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+ annotations:
+ azure.workload.identity/client-id: $($DeploymentOutputs['AZIDENTITY_USER_ASSIGNED_IDENTITY_CLIENT_ID'])
+ name: $serviceAccountName
+ namespace: default
+---
+apiVersion: v1
+kind: Pod
+metadata:
+ name: $podName
+ namespace: default
+ labels:
+ app: $podName
+ azure.workload.identity/use: "true"
+spec:
+ serviceAccountName: $serviceAccountName
+ containers:
+ - name: $podName
+ image: $image
+ env:
+ - name: AZIDENTITY_STORAGE_NAME
+ value: $($DeploymentOutputs['AZIDENTITY_STORAGE_NAME_USER_ASSIGNED'])
+ - name: AZIDENTITY_USE_WORKLOAD_IDENTITY
+ value: "true"
+ - name: FUNCTIONS_CUSTOMHANDLER_PORT
+ value: "80"
+ nodeSelector:
+ kubernetes.io/os: linux
+"@
+kubectl apply -f "$PSScriptRoot/k8s.yaml"
+Write-Host "##vso[task.setvariable variable=AZIDENTITY_POD_NAME;]$podName"
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources-pre.ps1 b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources-pre.ps1
index fe0183ad..58766d0a 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources-pre.ps1
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources-pre.ps1
@@ -1,36 +1,44 @@
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License.
+
+# IMPORTANT: Do not invoke this file directly. Please instead run eng/common/TestResources/New-TestResources.ps1 from the repository root.
+
[CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'Medium')]
param (
+ [hashtable] $AdditionalParameters = @{},
+
# Captures any arguments from eng/New-TestResources.ps1 not declared here (no parameter errors).
[Parameter(ValueFromRemainingArguments = $true)]
$RemainingArguments
)
+if (-not (Test-Path "$PSScriptRoot/sshkey.pub")) {
+ ssh-keygen -t rsa -b 4096 -f "$PSScriptRoot/sshkey" -N '' -C ''
+}
+$templateFileParameters['sshPubKey'] = Get-Content "$PSScriptRoot/sshkey.pub"
+
if (!$CI) {
# TODO: Remove this once auto-cloud config downloads are supported locally
Write-Host "Skipping cert setup in local testing mode"
return
}
-if ($EnvironmentVariables -eq $null -or $EnvironmentVariables.Count -eq 0) {
+if ($null -eq $EnvironmentVariables -or $EnvironmentVariables.Count -eq 0) {
throw "EnvironmentVariables must be set in the calling script New-TestResources.ps1"
}
$tmp = $env:TEMP ? $env:TEMP : [System.IO.Path]::GetTempPath()
$pfxPath = Join-Path $tmp "test.pfx"
$pemPath = Join-Path $tmp "test.pem"
-$sniPath = Join-Path $tmp "testsni.pfx"
-Write-Host "Creating identity test files: $pfxPath $pemPath $sniPath"
+Write-Host "Creating identity test files: $pfxPath $pemPath"
[System.Convert]::FromBase64String($EnvironmentVariables['PFX_CONTENTS']) | Set-Content -Path $pfxPath -AsByteStream
Set-Content -Path $pemPath -Value $EnvironmentVariables['PEM_CONTENTS']
-[System.Convert]::FromBase64String($EnvironmentVariables['SNI_CONTENTS']) | Set-Content -Path $sniPath -AsByteStream
# Set for pipeline
Write-Host "##vso[task.setvariable variable=IDENTITY_SP_CERT_PFX;]$pfxPath"
Write-Host "##vso[task.setvariable variable=IDENTITY_SP_CERT_PEM;]$pemPath"
-Write-Host "##vso[task.setvariable variable=IDENTITY_SP_CERT_SNI;]$sniPath"
# Set for local
$env:IDENTITY_SP_CERT_PFX = $pfxPath
$env:IDENTITY_SP_CERT_PEM = $pemPath
-$env:IDENTITY_SP_CERT_SNI = $sniPath
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources.bicep b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources.bicep
index b3490d3b..135feb01 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources.bicep
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources.bicep
@@ -1 +1,228 @@
-param baseName string
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+@description('Kubernetes cluster admin user name.')
+param adminUser string = 'azureuser'
+
+@minLength(6)
+@maxLength(23)
+@description('The base resource name.')
+param baseName string = resourceGroup().name
+
+@description('Whether to deploy resources. When set to false, this file deploys nothing.')
+param deployResources bool = false
+
+param sshPubKey string = ''
+
+@description('The location of the resource. By default, this is the same as the resource group.')
+param location string = resourceGroup().location
+
+// https://learn.microsoft.com/azure/role-based-access-control/built-in-roles
+var acrPull = subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '7f951dda-4ed3-4680-a7ca-43fe172d538d')
+var blobReader = subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '2a2b9908-6ea1-4ae2-8e65-a410df84e7d1')
+
+resource sa 'Microsoft.Storage/storageAccounts@2021-08-01' = if (deployResources) {
+ kind: 'StorageV2'
+ location: location
+ name: 'sa${uniqueString(baseName)}'
+ properties: {
+ accessTier: 'Hot'
+ }
+ sku: {
+ name: 'Standard_LRS'
+ }
+}
+
+resource saUserAssigned 'Microsoft.Storage/storageAccounts@2021-08-01' = if (deployResources) {
+ kind: 'StorageV2'
+ location: location
+ name: 'sa2${uniqueString(baseName)}'
+ properties: {
+ accessTier: 'Hot'
+ }
+ sku: {
+ name: 'Standard_LRS'
+ }
+}
+
+resource usermgdid 'Microsoft.ManagedIdentity/userAssignedIdentities@2018-11-30' = if (deployResources) {
+ location: location
+ name: baseName
+}
+
+resource acrPullContainerInstance 'Microsoft.Authorization/roleAssignments@2022-04-01' = if (deployResources) {
+ name: guid(resourceGroup().id, acrPull, 'containerInstance')
+ properties: {
+ principalId: deployResources ? usermgdid.properties.principalId : ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionId: acrPull
+ }
+ scope: containerRegistry
+}
+
+resource blobRoleUserAssigned 'Microsoft.Authorization/roleAssignments@2022-04-01' = if (deployResources) {
+ scope: saUserAssigned
+ name: guid(resourceGroup().id, blobReader, usermgdid.id)
+ properties: {
+ principalId: deployResources ? usermgdid.properties.principalId : ''
+ principalType: 'ServicePrincipal'
+ roleDefinitionId: blobReader
+ }
+}
+
+resource blobRoleFunc 'Microsoft.Authorization/roleAssignments@2022-04-01' = if (deployResources) {
+ name: guid(resourceGroup().id, blobReader, 'azfunc')
+ properties: {
+ principalId: deployResources ? azfunc.identity.principalId : ''
+ roleDefinitionId: blobReader
+ principalType: 'ServicePrincipal'
+ }
+ scope: sa
+}
+
+resource containerRegistry 'Microsoft.ContainerRegistry/registries@2023-01-01-preview' = if (deployResources) {
+ location: location
+ name: uniqueString(resourceGroup().id)
+ properties: {
+ adminUserEnabled: true
+ }
+ sku: {
+ name: 'Basic'
+ }
+}
+
+resource farm 'Microsoft.Web/serverfarms@2021-03-01' = if (deployResources) {
+ kind: 'app'
+ location: location
+ name: '${baseName}_asp'
+ properties: {}
+ sku: {
+ capacity: 1
+ family: 'B'
+ name: 'B1'
+ size: 'B1'
+ tier: 'Basic'
+ }
+}
+
+resource azfunc 'Microsoft.Web/sites@2021-03-01' = if (deployResources) {
+ identity: {
+ type: 'SystemAssigned, UserAssigned'
+ userAssignedIdentities: {
+ '${deployResources ? usermgdid.id : ''}': {}
+ }
+ }
+ kind: 'functionapp'
+ location: location
+ name: '${baseName}func'
+ properties: {
+ enabled: true
+ httpsOnly: true
+ keyVaultReferenceIdentity: 'SystemAssigned'
+ serverFarmId: farm.id
+ siteConfig: {
+ alwaysOn: true
+ appSettings: [
+ {
+ name: 'AZIDENTITY_STORAGE_NAME'
+ value: deployResources ? sa.name : null
+ }
+ {
+ name: 'AZIDENTITY_STORAGE_NAME_USER_ASSIGNED'
+ value: deployResources ? saUserAssigned.name : null
+ }
+ {
+ name: 'AZIDENTITY_USER_ASSIGNED_IDENTITY'
+ value: deployResources ? usermgdid.id : null
+ }
+ {
+ name: 'AZIDENTITY_USER_ASSIGNED_IDENTITY_CLIENT_ID'
+ value: deployResources ? usermgdid.properties.clientId : null
+ }
+ {
+ name: 'AZIDENTITY_USER_ASSIGNED_IDENTITY_OBJECT_ID'
+ value: deployResources ? usermgdid.properties.principalId : null
+ }
+ {
+ name: 'AzureWebJobsStorage'
+ value: 'DefaultEndpointsProtocol=https;AccountName=${deployResources ? sa.name : ''};EndpointSuffix=${deployResources ? environment().suffixes.storage : ''};AccountKey=${deployResources ? sa.listKeys().keys[0].value : ''}'
+ }
+ {
+ name: 'FUNCTIONS_EXTENSION_VERSION'
+ value: '~4'
+ }
+ {
+ name: 'FUNCTIONS_WORKER_RUNTIME'
+ value: 'custom'
+ }
+ {
+ name: 'WEBSITE_CONTENTAZUREFILECONNECTIONSTRING'
+ value: 'DefaultEndpointsProtocol=https;AccountName=${deployResources ? sa.name : ''};EndpointSuffix=${deployResources ? environment().suffixes.storage : ''};AccountKey=${deployResources ? sa.listKeys().keys[0].value : ''}'
+ }
+ {
+ name: 'WEBSITE_CONTENTSHARE'
+ value: toLower('${baseName}-func')
+ }
+ ]
+ http20Enabled: true
+ minTlsVersion: '1.2'
+ }
+ }
+}
+
+resource aks 'Microsoft.ContainerService/managedClusters@2023-06-01' = if (deployResources) {
+ name: baseName
+ location: location
+ identity: {
+ type: 'SystemAssigned'
+ }
+ properties: {
+ agentPoolProfiles: [
+ {
+ count: 1
+ enableAutoScaling: false
+ kubeletDiskType: 'OS'
+ mode: 'System'
+ name: 'agentpool'
+ osDiskSizeGB: 128
+ osDiskType: 'Managed'
+ osSKU: 'Ubuntu'
+ osType: 'Linux'
+ type: 'VirtualMachineScaleSets'
+ vmSize: 'Standard_D2s_v3'
+ }
+ ]
+ dnsPrefix: 'identitytest'
+ enableRBAC: true
+ linuxProfile: {
+ adminUsername: adminUser
+ ssh: {
+ publicKeys: [
+ {
+ keyData: sshPubKey
+ }
+ ]
+ }
+ }
+ oidcIssuerProfile: {
+ enabled: true
+ }
+ securityProfile: {
+ workloadIdentity: {
+ enabled: true
+ }
+ }
+ }
+}
+
+output AZIDENTITY_ACR_LOGIN_SERVER string = deployResources ? containerRegistry.properties.loginServer : ''
+output AZIDENTITY_ACR_NAME string = deployResources ? containerRegistry.name : ''
+output AZIDENTITY_AKS_NAME string = deployResources ? aks.name : ''
+output AZIDENTITY_FUNCTION_NAME string = deployResources ? azfunc.name : ''
+output AZIDENTITY_STORAGE_ID string = deployResources ? sa.id : ''
+output AZIDENTITY_STORAGE_NAME string = deployResources ? sa.name : ''
+output AZIDENTITY_STORAGE_NAME_USER_ASSIGNED string = deployResources ? saUserAssigned.name : ''
+output AZIDENTITY_USER_ASSIGNED_IDENTITY string = deployResources ? usermgdid.id : ''
+output AZIDENTITY_USER_ASSIGNED_IDENTITY_CLIENT_ID string = deployResources ? usermgdid.properties.clientId : ''
+output AZIDENTITY_USER_ASSIGNED_IDENTITY_NAME string = deployResources ? usermgdid.name : ''
+output AZIDENTITY_USER_ASSIGNED_IDENTITY_OBJECT_ID string = deployResources ? usermgdid.properties.principalId : ''
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/username_password_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/username_password_credential.go
index 294ed81e..740abd47 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/username_password_credential.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/username_password_credential.go
@@ -25,18 +25,20 @@ type UsernamePasswordCredentialOptions struct {
// application is registered.
AdditionallyAllowedTenants []string
- // authenticationRecord returned by a call to a credential's Authenticate method. Set this option
+ // AuthenticationRecord returned by a call to a credential's Authenticate method. Set this option
// to enable the credential to use data from a previous authentication.
- authenticationRecord authenticationRecord
+ AuthenticationRecord AuthenticationRecord
+
+ // Cache is a persistent cache the credential will use to store the tokens it acquires, making
+ // them available to other processes and credential instances. The default, zero value means the
+ // credential will store tokens in memory and not share them with any other credential instance.
+ Cache Cache
// DisableInstanceDiscovery should be set true only by applications authenticating in disconnected clouds, or
// private clouds such as Azure Stack. It determines whether the credential requests Microsoft Entra instance metadata
// from https://login.microsoft.com before authenticating. Setting this to true will skip this request, making
// the application responsible for ensuring the configured authority is valid and trustworthy.
DisableInstanceDiscovery bool
-
- // tokenCachePersistenceOptions enables persistent token caching when not nil.
- tokenCachePersistenceOptions *tokenCachePersistenceOptions
}
// UsernamePasswordCredential authenticates a user with a password. Microsoft doesn't recommend this kind of authentication,
@@ -54,13 +56,13 @@ func NewUsernamePasswordCredential(tenantID string, clientID string, username st
options = &UsernamePasswordCredentialOptions{}
}
opts := publicClientOptions{
- AdditionallyAllowedTenants: options.AdditionallyAllowedTenants,
- ClientOptions: options.ClientOptions,
- DisableInstanceDiscovery: options.DisableInstanceDiscovery,
- Password: password,
- Record: options.authenticationRecord,
- TokenCachePersistenceOptions: options.tokenCachePersistenceOptions,
- Username: username,
+ AdditionallyAllowedTenants: options.AdditionallyAllowedTenants,
+ Cache: options.Cache,
+ ClientOptions: options.ClientOptions,
+ DisableInstanceDiscovery: options.DisableInstanceDiscovery,
+ Password: password,
+ Record: options.AuthenticationRecord,
+ Username: username,
}
c, err := newPublicClient(tenantID, clientID, credNameUserPassword, opts)
if err != nil {
@@ -70,7 +72,7 @@ func NewUsernamePasswordCredential(tenantID string, clientID string, username st
}
// Authenticate the user. Subsequent calls to GetToken will automatically use the returned AuthenticationRecord.
-func (c *UsernamePasswordCredential) authenticate(ctx context.Context, opts *policy.TokenRequestOptions) (authenticationRecord, error) {
+func (c *UsernamePasswordCredential) Authenticate(ctx context.Context, opts *policy.TokenRequestOptions) (AuthenticationRecord, error) {
var err error
ctx, endSpan := runtime.StartSpan(ctx, credNameUserPassword+"."+traceOpAuthenticate, c.client.azClient.Tracer(), nil)
defer func() { endSpan(err) }()
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/version.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/version.go
index e8caeea7..4fa22dcc 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/version.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/version.go
@@ -14,5 +14,5 @@ const (
module = "github.com/Azure/azure-sdk-for-go/sdk/" + component
// Version is the semantic version (see http://semver.org) of this module.
- version = "v1.5.1"
+ version = "v1.8.0"
)
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/workload_identity.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/workload_identity.go
index 3e43e788..6fecada2 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/workload_identity.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/workload_identity.go
@@ -39,15 +39,24 @@ type WorkloadIdentityCredentialOptions struct {
// Add the wildcard value "*" to allow the credential to acquire tokens for any tenant in which the
// application is registered.
AdditionallyAllowedTenants []string
+
+ // Cache is a persistent cache the credential will use to store the tokens it acquires, making
+ // them available to other processes and credential instances. The default, zero value means the
+ // credential will store tokens in memory and not share them with any other credential instance.
+ Cache Cache
+
// ClientID of the service principal. Defaults to the value of the environment variable AZURE_CLIENT_ID.
ClientID string
+
// DisableInstanceDiscovery should be set true only by applications authenticating in disconnected clouds, or
// private clouds such as Azure Stack. It determines whether the credential requests Microsoft Entra instance metadata
// from https://login.microsoft.com before authenticating. Setting this to true will skip this request, making
// the application responsible for ensuring the configured authority is valid and trustworthy.
DisableInstanceDiscovery bool
+
// TenantID of the service principal. Defaults to the value of the environment variable AZURE_TENANT_ID.
TenantID string
+
// TokenFilePath is the path of a file containing a Kubernetes service account token. Defaults to the value of the
// environment variable AZURE_FEDERATED_TOKEN_FILE.
TokenFilePath string
@@ -81,6 +90,7 @@ func NewWorkloadIdentityCredential(options *WorkloadIdentityCredentialOptions) (
w := WorkloadIdentityCredential{file: file, mtx: &sync.RWMutex{}}
caco := ClientAssertionCredentialOptions{
AdditionallyAllowedTenants: options.AdditionallyAllowedTenants,
+ Cache: options.Cache,
ClientOptions: options.ClientOptions,
DisableInstanceDiscovery: options.DisableInstanceDiscovery,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/exported/exported.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/exported/exported.go
index d4ed6ccc..9948f604 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/exported/exported.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/exported/exported.go
@@ -39,6 +39,11 @@ type PayloadOptions struct {
// Subsequent reads will access the cached value.
// Exported as runtime.Payload() WITHOUT the opts parameter.
func Payload(resp *http.Response, opts *PayloadOptions) ([]byte, error) {
+ if resp.Body == nil {
+ // this shouldn't happen in real-world scenarios as a
+ // response with no body should set it to http.NoBody
+ return nil, nil
+ }
modifyBytes := func(b []byte) []byte { return b }
if opts != nil && opts.BytesModifier != nil {
modifyBytes = opts.BytesModifier
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential/confidential.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential/confidential.go
index 1841d146..57d0e277 100644
--- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential/confidential.go
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential/confidential.go
@@ -18,6 +18,8 @@ import (
"encoding/pem"
"errors"
"fmt"
+ "os"
+ "strings"
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/cache"
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base"
@@ -48,8 +50,8 @@ duplication.
.Net People, Take note on X509:
This uses x509.Certificates and private keys. x509 does not store private keys. .Net
-has some x509.Certificate2 thing that has private keys, but that is just some bullcrap that .Net
-added, it doesn't exist in real life. As such I've put a PEM decoder into here.
+has a x509.Certificate2 abstraction that has private keys, but that just a strange invention.
+As such I've put a PEM decoder into here.
*/
// TODO(msal): This should have example code for each method on client using Go's example doc framework.
@@ -315,16 +317,21 @@ func New(authority, clientID string, cred Credential, options ...Option) (Client
if err != nil {
return Client{}, err
}
-
+ autoEnabledRegion := os.Getenv("MSAL_FORCE_REGION")
opts := clientOptions{
authority: authority,
// if the caller specified a token provider, it will handle all details of authentication, using Client only as a token cache
disableInstanceDiscovery: cred.tokenProvider != nil,
httpClient: shared.DefaultClient,
+ azureRegion: autoEnabledRegion,
}
for _, o := range options {
o(&opts)
}
+ if strings.EqualFold(opts.azureRegion, "DisableMsalForceRegion") {
+ opts.azureRegion = ""
+ }
+
baseOpts := []base.Option{
base.WithCacheAccessor(opts.accessor),
base.WithClientCapabilities(opts.capabilities),
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/base.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/base.go
index 09a0d92f..e473d126 100644
--- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/base.go
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/base.go
@@ -89,8 +89,23 @@ type AuthResult struct {
ExpiresOn time.Time
GrantedScopes []string
DeclinedScopes []string
+ Metadata AuthResultMetadata
}
+// AuthResultMetadata which contains meta data for the AuthResult
+type AuthResultMetadata struct {
+ TokenSource TokenSource
+}
+
+type TokenSource int
+
+// These are all the types of token flows.
+const (
+ SourceUnknown TokenSource = 0
+ IdentityProvider TokenSource = 1
+ Cache TokenSource = 2
+)
+
// AuthResultFromStorage creates an AuthResult from a storage token response (which is generated from the cache).
func AuthResultFromStorage(storageTokenResponse storage.TokenResponse) (AuthResult, error) {
if err := storageTokenResponse.AccessToken.Validate(); err != nil {
@@ -109,7 +124,17 @@ func AuthResultFromStorage(storageTokenResponse storage.TokenResponse) (AuthResu
return AuthResult{}, fmt.Errorf("problem decoding JWT token: %w", err)
}
}
- return AuthResult{account, idToken, accessToken, storageTokenResponse.AccessToken.ExpiresOn.T, grantedScopes, nil}, nil
+ return AuthResult{
+ Account: account,
+ IDToken: idToken,
+ AccessToken: accessToken,
+ ExpiresOn: storageTokenResponse.AccessToken.ExpiresOn.T,
+ GrantedScopes: grantedScopes,
+ DeclinedScopes: nil,
+ Metadata: AuthResultMetadata{
+ TokenSource: Cache,
+ },
+ }, nil
}
// NewAuthResult creates an AuthResult.
@@ -123,6 +148,9 @@ func NewAuthResult(tokenResponse accesstokens.TokenResponse, account shared.Acco
AccessToken: tokenResponse.AccessToken,
ExpiresOn: tokenResponse.ExpiresOn.T,
GrantedScopes: tokenResponse.GrantedScopes.Slice,
+ Metadata: AuthResultMetadata{
+ TokenSource: IdentityProvider,
+ },
}, nil
}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/json.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/json.go
index 2238521f..2134e57c 100644
--- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/json.go
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/json.go
@@ -18,10 +18,6 @@ import (
)
const addField = "AdditionalFields"
-const (
- marshalJSON = "MarshalJSON"
- unmarshalJSON = "UnmarshalJSON"
-)
var (
leftBrace = []byte("{")[0]
@@ -106,48 +102,38 @@ func delimIs(got json.Token, want rune) bool {
// hasMarshalJSON will determine if the value or a pointer to this value has
// the MarshalJSON method.
func hasMarshalJSON(v reflect.Value) bool {
- if method := v.MethodByName(marshalJSON); method.Kind() != reflect.Invalid {
- _, ok := v.Interface().(json.Marshaler)
- return ok
- }
-
- if v.Kind() == reflect.Ptr {
- v = v.Elem()
- } else {
- if !v.CanAddr() {
- return false
+ ok := false
+ if _, ok = v.Interface().(json.Marshaler); !ok {
+ var i any
+ if v.Kind() == reflect.Ptr {
+ i = v.Elem().Interface()
+ } else if v.CanAddr() {
+ i = v.Addr().Interface()
}
- v = v.Addr()
- }
-
- if method := v.MethodByName(marshalJSON); method.Kind() != reflect.Invalid {
- _, ok := v.Interface().(json.Marshaler)
- return ok
+ _, ok = i.(json.Marshaler)
}
- return false
+ return ok
}
// callMarshalJSON will call MarshalJSON() method on the value or a pointer to this value.
// This will panic if the method is not defined.
func callMarshalJSON(v reflect.Value) ([]byte, error) {
- if method := v.MethodByName(marshalJSON); method.Kind() != reflect.Invalid {
- marsh := v.Interface().(json.Marshaler)
+ if marsh, ok := v.Interface().(json.Marshaler); ok {
return marsh.MarshalJSON()
}
if v.Kind() == reflect.Ptr {
- v = v.Elem()
+ if marsh, ok := v.Elem().Interface().(json.Marshaler); ok {
+ return marsh.MarshalJSON()
+ }
} else {
if v.CanAddr() {
- v = v.Addr()
+ if marsh, ok := v.Addr().Interface().(json.Marshaler); ok {
+ return marsh.MarshalJSON()
+ }
}
}
- if method := v.MethodByName(unmarshalJSON); method.Kind() != reflect.Invalid {
- marsh := v.Interface().(json.Marshaler)
- return marsh.MarshalJSON()
- }
-
panic(fmt.Sprintf("callMarshalJSON called on type %T that does not have MarshalJSON defined", v.Interface()))
}
@@ -162,12 +148,8 @@ func hasUnmarshalJSON(v reflect.Value) bool {
v = v.Addr()
}
- if method := v.MethodByName(unmarshalJSON); method.Kind() != reflect.Invalid {
- _, ok := v.Interface().(json.Unmarshaler)
- return ok
- }
-
- return false
+ _, ok := v.Interface().(json.Unmarshaler)
+ return ok
}
// hasOmitEmpty indicates if the field has instructed us to not output
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/local/server.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/local/server.go
index 04236ff3..fda5d7dd 100644
--- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/local/server.go
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/local/server.go
@@ -7,6 +7,7 @@ package local
import (
"context"
"fmt"
+ "html"
"net"
"net/http"
"strconv"
@@ -141,7 +142,7 @@ func (s *Server) handler(w http.ResponseWriter, r *http.Request) {
headerErr := q.Get("error")
if headerErr != "" {
- desc := q.Get("error_description")
+ desc := html.EscapeString(q.Get("error_description"))
// Note: It is a little weird we handle some errors by not going to the failPage. If they all should,
// change this to s.error() and make s.error() write the failPage instead of an error code.
_, _ = w.Write([]byte(fmt.Sprintf(failPage, headerErr, desc)))
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/oauth.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/oauth.go
index ef8d908a..e0653134 100644
--- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/oauth.go
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/oauth.go
@@ -10,6 +10,8 @@ import (
"io"
"time"
+ "github.com/google/uuid"
+
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/errors"
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/exported"
internalTime "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/types/time"
@@ -18,7 +20,6 @@ import (
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority"
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust"
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs"
- "github.com/google/uuid"
)
// ResolveEndpointer contains the methods for resolving authority endpoints.
@@ -331,7 +332,7 @@ func (t *Client) DeviceCode(ctx context.Context, authParams authority.AuthParams
func (t *Client) resolveEndpoint(ctx context.Context, authParams *authority.AuthParams, userPrincipalName string) error {
endpoints, err := t.Resolver.ResolveEndpoints(ctx, authParams.AuthorityInfo, userPrincipalName)
if err != nil {
- return fmt.Errorf("unable to resolve an endpoint: %s", err)
+ return fmt.Errorf("unable to resolve an endpoint: %w", err)
}
authParams.Endpoints = endpoints
return nil
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority/authority.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority/authority.go
index 9d60734f..c3c4a96f 100644
--- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority/authority.go
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority/authority.go
@@ -23,7 +23,7 @@ import (
const (
authorizationEndpoint = "https://%v/%v/oauth2/v2.0/authorize"
- instanceDiscoveryEndpoint = "https://%v/common/discovery/instance"
+ aadInstanceDiscoveryEndpoint = "https://%v/common/discovery/instance"
tenantDiscoveryEndpointWithRegion = "https://%s.%s/%s/v2.0/.well-known/openid-configuration"
regionName = "REGION_NAME"
defaultAPIVersion = "2021-10-01"
@@ -47,13 +47,12 @@ type jsonCaller interface {
}
var aadTrustedHostList = map[string]bool{
- "login.windows.net": true, // Microsoft Azure Worldwide - Used in validation scenarios where host is not this list
- "login.chinacloudapi.cn": true, // Microsoft Azure China
- "login.microsoftonline.de": true, // Microsoft Azure Blackforest
- "login-us.microsoftonline.com": true, // Microsoft Azure US Government - Legacy
- "login.microsoftonline.us": true, // Microsoft Azure US Government
- "login.microsoftonline.com": true, // Microsoft Azure Worldwide
- "login.cloudgovapi.us": true, // Microsoft Azure US Government
+ "login.windows.net": true, // Microsoft Azure Worldwide - Used in validation scenarios where host is not this list
+ "login.partner.microsoftonline.cn": true, // Microsoft Azure China
+ "login.microsoftonline.de": true, // Microsoft Azure Blackforest
+ "login-us.microsoftonline.com": true, // Microsoft Azure US Government - Legacy
+ "login.microsoftonline.us": true, // Microsoft Azure US Government
+ "login.microsoftonline.com": true, // Microsoft Azure Worldwide
}
// TrustedHost checks if an AAD host is trusted/valid.
@@ -137,8 +136,12 @@ const (
const (
AAD = "MSSTS"
ADFS = "ADFS"
+ DSTS = "DSTS"
)
+// DSTSTenant is referenced throughout multiple files, let us use a const in case we ever need to change it.
+const DSTSTenant = "7a433bfc-2514-4697-b467-e0933190487f"
+
// AuthenticationScheme is an extensibility mechanism designed to be used only by Azure Arc for proof of possession access tokens.
type AuthenticationScheme interface {
// Extra parameters that are added to the request to the /token endpoint.
@@ -236,23 +239,26 @@ func NewAuthParams(clientID string, authorityInfo Info) AuthParams {
// - the client is configured to authenticate only Microsoft accounts via the "consumers" endpoint
// - the resulting authority URL is invalid
func (p AuthParams) WithTenant(ID string) (AuthParams, error) {
- switch ID {
- case "", p.AuthorityInfo.Tenant:
- // keep the default tenant because the caller didn't override it
+ if ID == "" || ID == p.AuthorityInfo.Tenant {
return p, nil
- case "common", "consumers", "organizations":
- if p.AuthorityInfo.AuthorityType == AAD {
+ }
+
+ var authority string
+ switch p.AuthorityInfo.AuthorityType {
+ case AAD:
+ if ID == "common" || ID == "consumers" || ID == "organizations" {
return p, fmt.Errorf(`tenant ID must be a specific tenant, not "%s"`, ID)
}
- // else we'll return a better error below
- }
- if p.AuthorityInfo.AuthorityType != AAD {
- return p, errors.New("the authority doesn't support tenants")
- }
- if p.AuthorityInfo.Tenant == "consumers" {
- return p, errors.New(`client is configured to authenticate only personal Microsoft accounts, via the "consumers" endpoint`)
+ if p.AuthorityInfo.Tenant == "consumers" {
+ return p, errors.New(`client is configured to authenticate only personal Microsoft accounts, via the "consumers" endpoint`)
+ }
+ authority = "https://" + path.Join(p.AuthorityInfo.Host, ID)
+ case ADFS:
+ return p, errors.New("ADFS authority doesn't support tenants")
+ case DSTS:
+ return p, errors.New("dSTS authority doesn't support tenants")
}
- authority := "https://" + path.Join(p.AuthorityInfo.Host, ID)
+
info, err := NewInfoFromAuthorityURI(authority, p.AuthorityInfo.ValidateAuthority, p.AuthorityInfo.InstanceDiscoveryDisabled)
if err == nil {
info.Region = p.AuthorityInfo.Region
@@ -344,44 +350,57 @@ type Info struct {
Host string
CanonicalAuthorityURI string
AuthorityType string
- UserRealmURIPrefix string
ValidateAuthority bool
Tenant string
Region string
InstanceDiscoveryDisabled bool
}
-func firstPathSegment(u *url.URL) (string, error) {
- pathParts := strings.Split(u.EscapedPath(), "/")
- if len(pathParts) >= 2 {
- return pathParts[1], nil
- }
-
- return "", errors.New(`authority must be an https URL such as "https://login.microsoftonline.com/"`)
-}
-
// NewInfoFromAuthorityURI creates an AuthorityInfo instance from the authority URL provided.
func NewInfoFromAuthorityURI(authority string, validateAuthority bool, instanceDiscoveryDisabled bool) (Info, error) {
- u, err := url.Parse(strings.ToLower(authority))
- if err != nil || u.Scheme != "https" {
- return Info{}, errors.New(`authority must be an https URL such as "https://login.microsoftonline.com/"`)
+
+ cannonicalAuthority := authority
+
+ // suffix authority with / if it doesn't have one
+ if !strings.HasSuffix(cannonicalAuthority, "/") {
+ cannonicalAuthority += "/"
}
- tenant, err := firstPathSegment(u)
+ u, err := url.Parse(strings.ToLower(cannonicalAuthority))
+
if err != nil {
- return Info{}, err
+ return Info{}, fmt.Errorf("couldn't parse authority url: %w", err)
+ }
+ if u.Scheme != "https" {
+ return Info{}, errors.New("authority url scheme must be https")
+ }
+
+ pathParts := strings.Split(u.EscapedPath(), "/")
+ if len(pathParts) < 3 {
+ return Info{}, errors.New(`authority must be an URL such as "https://login.microsoftonline.com/"`)
}
+
authorityType := AAD
- if tenant == "adfs" {
+ tenant := pathParts[1]
+ switch tenant {
+ case "adfs":
authorityType = ADFS
+ case "dstsv2":
+ if len(pathParts) != 4 {
+ return Info{}, fmt.Errorf("dSTS authority must be an https URL such as https:///dstsv2/%s", DSTSTenant)
+ }
+ if pathParts[2] != DSTSTenant {
+ return Info{}, fmt.Errorf("dSTS authority only accepts a single tenant %q", DSTSTenant)
+ }
+ authorityType = DSTS
+ tenant = DSTSTenant
}
// u.Host includes the port, if any, which is required for private cloud deployments
return Info{
Host: u.Host,
- CanonicalAuthorityURI: fmt.Sprintf("https://%v/%v/", u.Host, tenant),
+ CanonicalAuthorityURI: cannonicalAuthority,
AuthorityType: authorityType,
- UserRealmURIPrefix: fmt.Sprintf("https://%v/common/userrealm/", u.Hostname()),
ValidateAuthority: validateAuthority,
Tenant: tenant,
InstanceDiscoveryDisabled: instanceDiscoveryDisabled,
@@ -525,7 +544,7 @@ func (c Client) AADInstanceDiscovery(ctx context.Context, authorityInfo Info) (I
discoveryHost = authorityInfo.Host
}
- endpoint := fmt.Sprintf(instanceDiscoveryEndpoint, discoveryHost)
+ endpoint := fmt.Sprintf(aadInstanceDiscoveryEndpoint, discoveryHost)
err = c.Comm.JSONCall(ctx, endpoint, http.Header{}, qv, nil, &resp)
}
return resp, err
@@ -543,17 +562,19 @@ func detectRegion(ctx context.Context) string {
client := http.Client{
Timeout: time.Duration(2 * time.Second),
}
- req, _ := http.NewRequest("GET", imdsEndpoint, nil)
+ req, _ := http.NewRequestWithContext(ctx, http.MethodGet, imdsEndpoint, nil)
req.Header.Set("Metadata", "true")
resp, err := client.Do(req)
+ if err == nil {
+ defer resp.Body.Close()
+ }
// If the request times out or there is an error, it is retried once
- if err != nil || resp.StatusCode != 200 {
+ if err != nil || resp.StatusCode != http.StatusOK {
resp, err = client.Do(req)
- if err != nil || resp.StatusCode != 200 {
+ if err != nil || resp.StatusCode != http.StatusOK {
return ""
}
}
- defer resp.Body.Close()
response, err := io.ReadAll(resp.Body)
if err != nil {
return ""
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/internal/comm/comm.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/internal/comm/comm.go
index 7d9ec7cd..d62aac74 100644
--- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/internal/comm/comm.go
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/internal/comm/comm.go
@@ -18,10 +18,11 @@ import (
"strings"
"time"
+ "github.com/google/uuid"
+
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/errors"
customJSON "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json"
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/version"
- "github.com/google/uuid"
)
// HTTPClient represents an HTTP client.
@@ -70,15 +71,13 @@ func (c *Client) JSONCall(ctx context.Context, endpoint string, headers http.Hea
unmarshal = customJSON.Unmarshal
}
- u, err := url.Parse(endpoint)
+ req, err := http.NewRequestWithContext(ctx, http.MethodGet, fmt.Sprintf("%s?%s", endpoint, qv.Encode()), nil)
if err != nil {
- return fmt.Errorf("could not parse path URL(%s): %w", endpoint, err)
+ return fmt.Errorf("could not create request: %w", err)
}
- u.RawQuery = qv.Encode()
addStdHeaders(headers)
-
- req := &http.Request{Method: http.MethodGet, URL: u, Header: headers}
+ req.Header = headers
if body != nil {
// Note: In case your wondering why we are not gzip encoding....
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/resolvers.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/resolvers.go
index 0ade4117..4030ec8d 100644
--- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/resolvers.go
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/resolvers.go
@@ -18,9 +18,6 @@ import (
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority"
)
-// ADFS is an active directory federation service authority type.
-const ADFS = "ADFS"
-
type cacheEntry struct {
Endpoints authority.Endpoints
ValidForDomainsInList map[string]bool
@@ -51,7 +48,7 @@ func (m *authorityEndpoint) ResolveEndpoints(ctx context.Context, authorityInfo
return endpoints, nil
}
- endpoint, err := m.openIDConfigurationEndpoint(ctx, authorityInfo, userPrincipalName)
+ endpoint, err := m.openIDConfigurationEndpoint(ctx, authorityInfo)
if err != nil {
return authority.Endpoints{}, err
}
@@ -83,7 +80,7 @@ func (m *authorityEndpoint) cachedEndpoints(authorityInfo authority.Info, userPr
defer m.mu.Unlock()
if cacheEntry, ok := m.cache[authorityInfo.CanonicalAuthorityURI]; ok {
- if authorityInfo.AuthorityType == ADFS {
+ if authorityInfo.AuthorityType == authority.ADFS {
domain, err := adfsDomainFromUpn(userPrincipalName)
if err == nil {
if _, ok := cacheEntry.ValidForDomainsInList[domain]; ok {
@@ -102,7 +99,7 @@ func (m *authorityEndpoint) addCachedEndpoints(authorityInfo authority.Info, use
updatedCacheEntry := createcacheEntry(endpoints)
- if authorityInfo.AuthorityType == ADFS {
+ if authorityInfo.AuthorityType == authority.ADFS {
// Since we're here, we've made a call to the backend. We want to ensure we're caching
// the latest values from the server.
if cacheEntry, ok := m.cache[authorityInfo.CanonicalAuthorityURI]; ok {
@@ -119,9 +116,12 @@ func (m *authorityEndpoint) addCachedEndpoints(authorityInfo authority.Info, use
m.cache[authorityInfo.CanonicalAuthorityURI] = updatedCacheEntry
}
-func (m *authorityEndpoint) openIDConfigurationEndpoint(ctx context.Context, authorityInfo authority.Info, userPrincipalName string) (string, error) {
- if authorityInfo.Tenant == "adfs" {
+func (m *authorityEndpoint) openIDConfigurationEndpoint(ctx context.Context, authorityInfo authority.Info) (string, error) {
+ if authorityInfo.AuthorityType == authority.ADFS {
return fmt.Sprintf("https://%s/adfs/.well-known/openid-configuration", authorityInfo.Host), nil
+ } else if authorityInfo.AuthorityType == authority.DSTS {
+ return fmt.Sprintf("https://%s/dstsv2/%s/v2.0/.well-known/openid-configuration", authorityInfo.Host, authority.DSTSTenant), nil
+
} else if authorityInfo.ValidateAuthority && !authority.TrustedHost(authorityInfo.Host) {
resp, err := m.rest.Authority().AADInstanceDiscovery(ctx, authorityInfo)
if err != nil {
@@ -134,7 +134,6 @@ func (m *authorityEndpoint) openIDConfigurationEndpoint(ctx context.Context, aut
return "", err
}
return resp.TenantDiscoveryEndpoint, nil
-
}
return authorityInfo.CanonicalAuthorityURI + "v2.0/.well-known/openid-configuration", nil
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/public/public.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/public/public.go
index e346ff3d..392e5e43 100644
--- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/public/public.go
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/public/public.go
@@ -217,11 +217,13 @@ func WithClaims(claims string) interface {
func WithAuthenticationScheme(authnScheme AuthenticationScheme) interface {
AcquireSilentOption
AcquireInteractiveOption
+ AcquireByUsernamePasswordOption
options.CallOption
} {
return struct {
AcquireSilentOption
AcquireInteractiveOption
+ AcquireByUsernamePasswordOption
options.CallOption
}{
CallOption: options.NewCallOption(
@@ -231,6 +233,8 @@ func WithAuthenticationScheme(authnScheme AuthenticationScheme) interface {
t.authnScheme = authnScheme
case *interactiveAuthOptions:
t.authnScheme = authnScheme
+ case *acquireTokenByUsernamePasswordOptions:
+ t.authnScheme = authnScheme
default:
return fmt.Errorf("unexpected options type %T", a)
}
@@ -349,6 +353,7 @@ func (pca Client) AcquireTokenSilent(ctx context.Context, scopes []string, opts
// acquireTokenByUsernamePasswordOptions contains optional configuration for AcquireTokenByUsernamePassword
type acquireTokenByUsernamePasswordOptions struct {
claims, tenantID string
+ authnScheme AuthenticationScheme
}
// AcquireByUsernamePasswordOption is implemented by options for AcquireTokenByUsernamePassword
@@ -374,6 +379,9 @@ func (pca Client) AcquireTokenByUsernamePassword(ctx context.Context, scopes []s
authParams.Claims = o.claims
authParams.Username = username
authParams.Password = password
+ if o.authnScheme != nil {
+ authParams.AuthnScheme = o.authnScheme
+ }
token, err := pca.base.Token.UsernamePassword(ctx, authParams)
if err != nil {
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go
index 6bd64494..c3516e01 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go
@@ -74,7 +74,9 @@ const (
)
// AWS ISOE (Europe) partition's regions.
-const ()
+const (
+ EuIsoeWest1RegionID = "eu-isoe-west-1" // EU ISOE West.
+)
// AWS ISOF partition's regions.
const ()
@@ -244,13 +246,6 @@ var awsPartition = partition{
},
},
Services: services{
- "a4b": service{
- Endpoints: serviceEndpoints{
- endpointKey{
- Region: "us-east-1",
- }: endpoint{},
- },
- },
"access-analyzer": service{
Endpoints: serviceEndpoints{
endpointKey{
@@ -298,6 +293,12 @@ var awsPartition = partition{
endpointKey{
Region: "ca-west-1",
}: endpoint{},
+ endpointKey{
+ Region: "ca-west-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "access-analyzer-fips.ca-west-1.amazonaws.com",
+ },
endpointKey{
Region: "eu-central-1",
}: endpoint{},
@@ -331,6 +332,15 @@ var awsPartition = partition{
},
Deprecated: boxedTrue,
},
+ endpointKey{
+ Region: "fips-ca-west-1",
+ }: endpoint{
+ Hostname: "access-analyzer-fips.ca-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-west-1",
+ },
+ Deprecated: boxedTrue,
+ },
endpointKey{
Region: "fips-us-east-1",
}: endpoint{
@@ -661,6 +671,15 @@ var awsPartition = partition{
}: endpoint{
Hostname: "acm-pca-fips.ca-central-1.amazonaws.com",
},
+ endpointKey{
+ Region: "ca-west-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "ca-west-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "acm-pca-fips.ca-west-1.amazonaws.com",
+ },
endpointKey{
Region: "eu-central-1",
}: endpoint{},
@@ -694,6 +713,15 @@ var awsPartition = partition{
},
Deprecated: boxedTrue,
},
+ endpointKey{
+ Region: "fips-ca-west-1",
+ }: endpoint{
+ Hostname: "acm-pca-fips.ca-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-west-1",
+ },
+ Deprecated: boxedTrue,
+ },
endpointKey{
Region: "fips-us-east-1",
}: endpoint{
@@ -789,30 +817,60 @@ var awsPartition = partition{
},
"airflow": service{
Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "af-south-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "ap-east-1",
+ }: endpoint{},
endpointKey{
Region: "ap-northeast-1",
}: endpoint{},
endpointKey{
Region: "ap-northeast-2",
}: endpoint{},
+ endpointKey{
+ Region: "ap-northeast-3",
+ }: endpoint{},
endpointKey{
Region: "ap-south-1",
}: endpoint{},
+ endpointKey{
+ Region: "ap-south-2",
+ }: endpoint{},
endpointKey{
Region: "ap-southeast-1",
}: endpoint{},
endpointKey{
Region: "ap-southeast-2",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-3",
+ }: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "ca-west-1",
+ }: endpoint{},
endpointKey{
Region: "eu-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-central-2",
+ }: endpoint{},
endpointKey{
Region: "eu-north-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-south-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "eu-south-2",
+ }: endpoint{},
endpointKey{
Region: "eu-west-1",
}: endpoint{},
@@ -822,6 +880,15 @@ var awsPartition = partition{
endpointKey{
Region: "eu-west-3",
}: endpoint{},
+ endpointKey{
+ Region: "il-central-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "me-central-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "me-south-1",
+ }: endpoint{},
endpointKey{
Region: "sa-east-1",
}: endpoint{},
@@ -831,6 +898,9 @@ var awsPartition = partition{
endpointKey{
Region: "us-east-2",
}: endpoint{},
+ endpointKey{
+ Region: "us-west-1",
+ }: endpoint{},
endpointKey{
Region: "us-west-2",
}: endpoint{},
@@ -847,6 +917,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-northeast-2",
}: endpoint{},
+ endpointKey{
+ Region: "ap-northeast-3",
+ }: endpoint{},
endpointKey{
Region: "ap-south-1",
}: endpoint{},
@@ -905,6 +978,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-northeast-2",
}: endpoint{},
+ endpointKey{
+ Region: "ap-northeast-3",
+ }: endpoint{},
endpointKey{
Region: "ap-south-1",
}: endpoint{},
@@ -963,6 +1039,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-northeast-2",
}: endpoint{},
+ endpointKey{
+ Region: "ap-northeast-3",
+ }: endpoint{},
endpointKey{
Region: "ap-south-1",
}: endpoint{},
@@ -1018,18 +1097,33 @@ var awsPartition = partition{
endpointKey{
Region: "ap-northeast-1",
}: endpoint{},
+ endpointKey{
+ Region: "ap-south-1",
+ }: endpoint{},
endpointKey{
Region: "ap-southeast-1",
}: endpoint{},
endpointKey{
Region: "ap-southeast-2",
}: endpoint{},
+ endpointKey{
+ Region: "ca-central-1",
+ }: endpoint{},
endpointKey{
Region: "eu-central-1",
}: endpoint{},
endpointKey{
Region: "eu-west-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-west-2",
+ }: endpoint{},
+ endpointKey{
+ Region: "eu-west-3",
+ }: endpoint{},
+ endpointKey{
+ Region: "sa-east-1",
+ }: endpoint{},
endpointKey{
Region: "us-east-1",
}: endpoint{},
@@ -1882,6 +1976,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-south-1",
}: endpoint{},
+ endpointKey{
+ Region: "ap-south-2",
+ }: endpoint{},
endpointKey{
Region: "ap-southeast-1",
}: endpoint{},
@@ -1906,6 +2003,9 @@ var awsPartition = partition{
endpointKey{
Region: "eu-west-3",
}: endpoint{},
+ endpointKey{
+ Region: "me-central-1",
+ }: endpoint{},
endpointKey{
Region: "sa-east-1",
}: endpoint{},
@@ -3758,6 +3858,15 @@ var awsPartition = partition{
}: endpoint{
Hostname: "athena.ca-central-1.api.aws",
},
+ endpointKey{
+ Region: "ca-west-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "ca-west-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "athena.ca-west-1.api.aws",
+ },
endpointKey{
Region: "eu-central-1",
}: endpoint{},
@@ -4017,15 +4126,75 @@ var awsPartition = partition{
endpointKey{
Region: "us-east-1",
}: endpoint{},
+ endpointKey{
+ Region: "us-east-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "auditmanager-fips.us-east-1.amazonaws.com",
+ },
+ endpointKey{
+ Region: "us-east-1-fips",
+ }: endpoint{
+ Hostname: "auditmanager-fips.us-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-1",
+ },
+ Deprecated: boxedTrue,
+ },
endpointKey{
Region: "us-east-2",
}: endpoint{},
+ endpointKey{
+ Region: "us-east-2",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "auditmanager-fips.us-east-2.amazonaws.com",
+ },
+ endpointKey{
+ Region: "us-east-2-fips",
+ }: endpoint{
+ Hostname: "auditmanager-fips.us-east-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-2",
+ },
+ Deprecated: boxedTrue,
+ },
endpointKey{
Region: "us-west-1",
}: endpoint{},
+ endpointKey{
+ Region: "us-west-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "auditmanager-fips.us-west-1.amazonaws.com",
+ },
+ endpointKey{
+ Region: "us-west-1-fips",
+ }: endpoint{
+ Hostname: "auditmanager-fips.us-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-1",
+ },
+ Deprecated: boxedTrue,
+ },
endpointKey{
Region: "us-west-2",
}: endpoint{},
+ endpointKey{
+ Region: "us-west-2",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "auditmanager-fips.us-west-2.amazonaws.com",
+ },
+ endpointKey{
+ Region: "us-west-2-fips",
+ }: endpoint{
+ Hostname: "auditmanager-fips.us-west-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-2",
+ },
+ Deprecated: boxedTrue,
+ },
},
},
"autoscaling": service{
@@ -4327,6 +4496,9 @@ var awsPartition = partition{
endpointKey{
Region: "ca-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "ca-west-1",
+ }: endpoint{},
endpointKey{
Region: "eu-central-1",
}: endpoint{},
@@ -4444,91 +4616,6 @@ var awsPartition = partition{
}: endpoint{},
},
},
- "backupstorage": service{
- Endpoints: serviceEndpoints{
- endpointKey{
- Region: "af-south-1",
- }: endpoint{},
- endpointKey{
- Region: "ap-east-1",
- }: endpoint{},
- endpointKey{
- Region: "ap-northeast-1",
- }: endpoint{},
- endpointKey{
- Region: "ap-northeast-2",
- }: endpoint{},
- endpointKey{
- Region: "ap-northeast-3",
- }: endpoint{},
- endpointKey{
- Region: "ap-south-1",
- }: endpoint{},
- endpointKey{
- Region: "ap-south-2",
- }: endpoint{},
- endpointKey{
- Region: "ap-southeast-1",
- }: endpoint{},
- endpointKey{
- Region: "ap-southeast-2",
- }: endpoint{},
- endpointKey{
- Region: "ap-southeast-3",
- }: endpoint{},
- endpointKey{
- Region: "ap-southeast-4",
- }: endpoint{},
- endpointKey{
- Region: "ca-central-1",
- }: endpoint{},
- endpointKey{
- Region: "eu-central-1",
- }: endpoint{},
- endpointKey{
- Region: "eu-central-2",
- }: endpoint{},
- endpointKey{
- Region: "eu-north-1",
- }: endpoint{},
- endpointKey{
- Region: "eu-south-1",
- }: endpoint{},
- endpointKey{
- Region: "eu-south-2",
- }: endpoint{},
- endpointKey{
- Region: "eu-west-1",
- }: endpoint{},
- endpointKey{
- Region: "eu-west-2",
- }: endpoint{},
- endpointKey{
- Region: "eu-west-3",
- }: endpoint{},
- endpointKey{
- Region: "me-central-1",
- }: endpoint{},
- endpointKey{
- Region: "me-south-1",
- }: endpoint{},
- endpointKey{
- Region: "sa-east-1",
- }: endpoint{},
- endpointKey{
- Region: "us-east-1",
- }: endpoint{},
- endpointKey{
- Region: "us-east-2",
- }: endpoint{},
- endpointKey{
- Region: "us-west-1",
- }: endpoint{},
- endpointKey{
- Region: "us-west-2",
- }: endpoint{},
- },
- },
"batch": service{
Defaults: endpointDefaults{
defaultKey{}: endpoint{},
@@ -4693,9 +4780,15 @@ var awsPartition = partition{
endpointKey{
Region: "ap-northeast-1",
}: endpoint{},
+ endpointKey{
+ Region: "ap-south-1",
+ }: endpoint{},
endpointKey{
Region: "ap-southeast-1",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-2",
+ }: endpoint{},
endpointKey{
Region: "bedrock-ap-northeast-1",
}: endpoint{
@@ -4704,6 +4797,14 @@ var awsPartition = partition{
Region: "ap-northeast-1",
},
},
+ endpointKey{
+ Region: "bedrock-ap-south-1",
+ }: endpoint{
+ Hostname: "bedrock.ap-south-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ap-south-1",
+ },
+ },
endpointKey{
Region: "bedrock-ap-southeast-1",
}: endpoint{
@@ -4712,6 +4813,22 @@ var awsPartition = partition{
Region: "ap-southeast-1",
},
},
+ endpointKey{
+ Region: "bedrock-ap-southeast-2",
+ }: endpoint{
+ Hostname: "bedrock.ap-southeast-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ap-southeast-2",
+ },
+ },
+ endpointKey{
+ Region: "bedrock-ca-central-1",
+ }: endpoint{
+ Hostname: "bedrock.ca-central-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-central-1",
+ },
+ },
endpointKey{
Region: "bedrock-eu-central-1",
}: endpoint{
@@ -4720,6 +4837,38 @@ var awsPartition = partition{
Region: "eu-central-1",
},
},
+ endpointKey{
+ Region: "bedrock-eu-west-1",
+ }: endpoint{
+ Hostname: "bedrock.eu-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "eu-west-1",
+ },
+ },
+ endpointKey{
+ Region: "bedrock-eu-west-2",
+ }: endpoint{
+ Hostname: "bedrock.eu-west-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "eu-west-2",
+ },
+ },
+ endpointKey{
+ Region: "bedrock-eu-west-3",
+ }: endpoint{
+ Hostname: "bedrock.eu-west-3.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "eu-west-3",
+ },
+ },
+ endpointKey{
+ Region: "bedrock-fips-ca-central-1",
+ }: endpoint{
+ Hostname: "bedrock-fips.ca-central-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-central-1",
+ },
+ },
endpointKey{
Region: "bedrock-fips-us-east-1",
}: endpoint{
@@ -4744,6 +4893,14 @@ var awsPartition = partition{
Region: "ap-northeast-1",
},
},
+ endpointKey{
+ Region: "bedrock-runtime-ap-south-1",
+ }: endpoint{
+ Hostname: "bedrock-runtime.ap-south-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ap-south-1",
+ },
+ },
endpointKey{
Region: "bedrock-runtime-ap-southeast-1",
}: endpoint{
@@ -4752,6 +4909,22 @@ var awsPartition = partition{
Region: "ap-southeast-1",
},
},
+ endpointKey{
+ Region: "bedrock-runtime-ap-southeast-2",
+ }: endpoint{
+ Hostname: "bedrock-runtime.ap-southeast-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ap-southeast-2",
+ },
+ },
+ endpointKey{
+ Region: "bedrock-runtime-ca-central-1",
+ }: endpoint{
+ Hostname: "bedrock-runtime.ca-central-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-central-1",
+ },
+ },
endpointKey{
Region: "bedrock-runtime-eu-central-1",
}: endpoint{
@@ -4760,6 +4933,38 @@ var awsPartition = partition{
Region: "eu-central-1",
},
},
+ endpointKey{
+ Region: "bedrock-runtime-eu-west-1",
+ }: endpoint{
+ Hostname: "bedrock-runtime.eu-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "eu-west-1",
+ },
+ },
+ endpointKey{
+ Region: "bedrock-runtime-eu-west-2",
+ }: endpoint{
+ Hostname: "bedrock-runtime.eu-west-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "eu-west-2",
+ },
+ },
+ endpointKey{
+ Region: "bedrock-runtime-eu-west-3",
+ }: endpoint{
+ Hostname: "bedrock-runtime.eu-west-3.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "eu-west-3",
+ },
+ },
+ endpointKey{
+ Region: "bedrock-runtime-fips-ca-central-1",
+ }: endpoint{
+ Hostname: "bedrock-runtime-fips.ca-central-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-central-1",
+ },
+ },
endpointKey{
Region: "bedrock-runtime-fips-us-east-1",
}: endpoint{
@@ -4776,6 +4981,14 @@ var awsPartition = partition{
Region: "us-west-2",
},
},
+ endpointKey{
+ Region: "bedrock-runtime-sa-east-1",
+ }: endpoint{
+ Hostname: "bedrock-runtime.sa-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "sa-east-1",
+ },
+ },
endpointKey{
Region: "bedrock-runtime-us-east-1",
}: endpoint{
@@ -4792,6 +5005,14 @@ var awsPartition = partition{
Region: "us-west-2",
},
},
+ endpointKey{
+ Region: "bedrock-sa-east-1",
+ }: endpoint{
+ Hostname: "bedrock.sa-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "sa-east-1",
+ },
+ },
endpointKey{
Region: "bedrock-us-east-1",
}: endpoint{
@@ -4808,9 +5029,24 @@ var awsPartition = partition{
Region: "us-west-2",
},
},
+ endpointKey{
+ Region: "ca-central-1",
+ }: endpoint{},
endpointKey{
Region: "eu-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-west-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "eu-west-2",
+ }: endpoint{},
+ endpointKey{
+ Region: "eu-west-3",
+ }: endpoint{},
+ endpointKey{
+ Region: "sa-east-1",
+ }: endpoint{},
endpointKey{
Region: "us-east-1",
}: endpoint{},
@@ -4835,6 +5071,9 @@ var awsPartition = partition{
},
"braket": service{
Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "eu-north-1",
+ }: endpoint{},
endpointKey{
Region: "eu-west-2",
}: endpoint{},
@@ -4865,6 +5104,12 @@ var awsPartition = partition{
},
"cases": service{
Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "ap-northeast-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "ap-northeast-2",
+ }: endpoint{},
endpointKey{
Region: "ap-southeast-1",
}: endpoint{},
@@ -5079,69 +5324,262 @@ var awsPartition = partition{
endpointKey{
Region: "af-south-1",
}: endpoint{},
+ endpointKey{
+ Region: "af-south-1",
+ Variant: dualStackVariant,
+ }: endpoint{},
endpointKey{
Region: "ap-east-1",
}: endpoint{},
+ endpointKey{
+ Region: "ap-east-1",
+ Variant: dualStackVariant,
+ }: endpoint{},
endpointKey{
Region: "ap-northeast-1",
}: endpoint{},
+ endpointKey{
+ Region: "ap-northeast-1",
+ Variant: dualStackVariant,
+ }: endpoint{},
endpointKey{
Region: "ap-northeast-2",
}: endpoint{},
+ endpointKey{
+ Region: "ap-northeast-2",
+ Variant: dualStackVariant,
+ }: endpoint{},
endpointKey{
Region: "ap-northeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-northeast-3",
+ Variant: dualStackVariant,
+ }: endpoint{},
endpointKey{
Region: "ap-south-1",
}: endpoint{},
+ endpointKey{
+ Region: "ap-south-1",
+ Variant: dualStackVariant,
+ }: endpoint{},
endpointKey{
Region: "ap-southeast-1",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-1",
+ Variant: dualStackVariant,
+ }: endpoint{},
endpointKey{
Region: "ap-southeast-2",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-2",
+ Variant: dualStackVariant,
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "ca-central-1",
+ Variant: dualStackVariant,
+ }: endpoint{},
+ endpointKey{
+ Region: "ca-central-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "cloud9-fips.ca-central-1.amazonaws.com",
+ },
+ endpointKey{
+ Region: "ca-central-1",
+ Variant: fipsVariant | dualStackVariant,
+ }: endpoint{
+ Hostname: "cloud9-fips.ca-central-1.api.aws",
+ },
endpointKey{
Region: "eu-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-central-1",
+ Variant: dualStackVariant,
+ }: endpoint{},
endpointKey{
Region: "eu-north-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-north-1",
+ Variant: dualStackVariant,
+ }: endpoint{},
endpointKey{
Region: "eu-south-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-south-1",
+ Variant: dualStackVariant,
+ }: endpoint{},
endpointKey{
Region: "eu-west-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-west-1",
+ Variant: dualStackVariant,
+ }: endpoint{},
endpointKey{
Region: "eu-west-2",
}: endpoint{},
+ endpointKey{
+ Region: "eu-west-2",
+ Variant: dualStackVariant,
+ }: endpoint{},
endpointKey{
Region: "eu-west-3",
}: endpoint{},
+ endpointKey{
+ Region: "eu-west-3",
+ Variant: dualStackVariant,
+ }: endpoint{},
+ endpointKey{
+ Region: "fips-ca-central-1",
+ }: endpoint{
+ Hostname: "cloud9-fips.ca-central-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-central-1",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "fips-us-east-1",
+ }: endpoint{
+ Hostname: "cloud9-fips.us-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-1",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "fips-us-east-2",
+ }: endpoint{
+ Hostname: "cloud9-fips.us-east-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-2",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "fips-us-west-1",
+ }: endpoint{
+ Hostname: "cloud9-fips.us-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-1",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "fips-us-west-2",
+ }: endpoint{
+ Hostname: "cloud9-fips.us-west-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-2",
+ },
+ Deprecated: boxedTrue,
+ },
endpointKey{
Region: "il-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "il-central-1",
+ Variant: dualStackVariant,
+ }: endpoint{},
endpointKey{
Region: "me-south-1",
}: endpoint{},
+ endpointKey{
+ Region: "me-south-1",
+ Variant: dualStackVariant,
+ }: endpoint{},
endpointKey{
Region: "sa-east-1",
}: endpoint{},
+ endpointKey{
+ Region: "sa-east-1",
+ Variant: dualStackVariant,
+ }: endpoint{},
endpointKey{
Region: "us-east-1",
}: endpoint{},
+ endpointKey{
+ Region: "us-east-1",
+ Variant: dualStackVariant,
+ }: endpoint{},
+ endpointKey{
+ Region: "us-east-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "cloud9-fips.us-east-1.amazonaws.com",
+ },
+ endpointKey{
+ Region: "us-east-1",
+ Variant: fipsVariant | dualStackVariant,
+ }: endpoint{
+ Hostname: "cloud9-fips.us-east-1.api.aws",
+ },
endpointKey{
Region: "us-east-2",
}: endpoint{},
+ endpointKey{
+ Region: "us-east-2",
+ Variant: dualStackVariant,
+ }: endpoint{},
+ endpointKey{
+ Region: "us-east-2",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "cloud9-fips.us-east-2.amazonaws.com",
+ },
+ endpointKey{
+ Region: "us-east-2",
+ Variant: fipsVariant | dualStackVariant,
+ }: endpoint{
+ Hostname: "cloud9-fips.us-east-2.api.aws",
+ },
endpointKey{
Region: "us-west-1",
}: endpoint{},
+ endpointKey{
+ Region: "us-west-1",
+ Variant: dualStackVariant,
+ }: endpoint{},
+ endpointKey{
+ Region: "us-west-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "cloud9-fips.us-west-1.amazonaws.com",
+ },
+ endpointKey{
+ Region: "us-west-1",
+ Variant: fipsVariant | dualStackVariant,
+ }: endpoint{
+ Hostname: "cloud9-fips.us-west-1.api.aws",
+ },
endpointKey{
Region: "us-west-2",
}: endpoint{},
+ endpointKey{
+ Region: "us-west-2",
+ Variant: dualStackVariant,
+ }: endpoint{},
+ endpointKey{
+ Region: "us-west-2",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "cloud9-fips.us-west-2.amazonaws.com",
+ },
+ endpointKey{
+ Region: "us-west-2",
+ Variant: fipsVariant | dualStackVariant,
+ }: endpoint{
+ Hostname: "cloud9-fips.us-west-2.api.aws",
+ },
},
},
"cloudcontrolapi": service{
@@ -5149,78 +5587,216 @@ var awsPartition = partition{
endpointKey{
Region: "af-south-1",
}: endpoint{},
+ endpointKey{
+ Region: "af-south-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi.af-south-1.api.aws",
+ },
endpointKey{
Region: "ap-east-1",
}: endpoint{},
+ endpointKey{
+ Region: "ap-east-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi.ap-east-1.api.aws",
+ },
endpointKey{
Region: "ap-northeast-1",
}: endpoint{},
+ endpointKey{
+ Region: "ap-northeast-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi.ap-northeast-1.api.aws",
+ },
endpointKey{
Region: "ap-northeast-2",
}: endpoint{},
+ endpointKey{
+ Region: "ap-northeast-2",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi.ap-northeast-2.api.aws",
+ },
endpointKey{
Region: "ap-northeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-northeast-3",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi.ap-northeast-3.api.aws",
+ },
endpointKey{
Region: "ap-south-1",
}: endpoint{},
+ endpointKey{
+ Region: "ap-south-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi.ap-south-1.api.aws",
+ },
endpointKey{
Region: "ap-south-2",
}: endpoint{},
+ endpointKey{
+ Region: "ap-south-2",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi.ap-south-2.api.aws",
+ },
endpointKey{
Region: "ap-southeast-1",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi.ap-southeast-1.api.aws",
+ },
endpointKey{
Region: "ap-southeast-2",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-2",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi.ap-southeast-2.api.aws",
+ },
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-3",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi.ap-southeast-3.api.aws",
+ },
endpointKey{
Region: "ap-southeast-4",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi.ap-southeast-4.api.aws",
+ },
endpointKey{
Region: "ca-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "ca-central-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi.ca-central-1.api.aws",
+ },
endpointKey{
Region: "ca-central-1",
Variant: fipsVariant,
}: endpoint{
Hostname: "cloudcontrolapi-fips.ca-central-1.amazonaws.com",
},
+ endpointKey{
+ Region: "ca-central-1",
+ Variant: fipsVariant | dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi-fips.ca-central-1.api.aws",
+ },
endpointKey{
Region: "ca-west-1",
}: endpoint{},
+ endpointKey{
+ Region: "ca-west-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi.ca-west-1.api.aws",
+ },
endpointKey{
Region: "ca-west-1",
Variant: fipsVariant,
}: endpoint{
Hostname: "cloudcontrolapi-fips.ca-west-1.amazonaws.com",
},
+ endpointKey{
+ Region: "ca-west-1",
+ Variant: fipsVariant | dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi-fips.ca-west-1.api.aws",
+ },
endpointKey{
Region: "eu-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-central-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi.eu-central-1.api.aws",
+ },
endpointKey{
Region: "eu-central-2",
}: endpoint{},
+ endpointKey{
+ Region: "eu-central-2",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi.eu-central-2.api.aws",
+ },
endpointKey{
Region: "eu-north-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-north-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi.eu-north-1.api.aws",
+ },
endpointKey{
Region: "eu-south-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-south-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi.eu-south-1.api.aws",
+ },
endpointKey{
Region: "eu-south-2",
}: endpoint{},
+ endpointKey{
+ Region: "eu-south-2",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi.eu-south-2.api.aws",
+ },
endpointKey{
Region: "eu-west-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-west-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi.eu-west-1.api.aws",
+ },
endpointKey{
Region: "eu-west-2",
}: endpoint{},
+ endpointKey{
+ Region: "eu-west-2",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi.eu-west-2.api.aws",
+ },
endpointKey{
Region: "eu-west-3",
}: endpoint{},
+ endpointKey{
+ Region: "eu-west-3",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi.eu-west-3.api.aws",
+ },
endpointKey{
Region: "fips-ca-central-1",
}: endpoint{
@@ -5278,51 +5854,123 @@ var awsPartition = partition{
endpointKey{
Region: "il-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "il-central-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi.il-central-1.api.aws",
+ },
endpointKey{
Region: "me-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "me-central-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi.me-central-1.api.aws",
+ },
endpointKey{
Region: "me-south-1",
}: endpoint{},
+ endpointKey{
+ Region: "me-south-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi.me-south-1.api.aws",
+ },
endpointKey{
Region: "sa-east-1",
}: endpoint{},
+ endpointKey{
+ Region: "sa-east-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi.sa-east-1.api.aws",
+ },
endpointKey{
Region: "us-east-1",
}: endpoint{},
+ endpointKey{
+ Region: "us-east-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi.us-east-1.api.aws",
+ },
endpointKey{
Region: "us-east-1",
Variant: fipsVariant,
}: endpoint{
Hostname: "cloudcontrolapi-fips.us-east-1.amazonaws.com",
},
+ endpointKey{
+ Region: "us-east-1",
+ Variant: fipsVariant | dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi-fips.us-east-1.api.aws",
+ },
endpointKey{
Region: "us-east-2",
}: endpoint{},
+ endpointKey{
+ Region: "us-east-2",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi.us-east-2.api.aws",
+ },
endpointKey{
Region: "us-east-2",
Variant: fipsVariant,
}: endpoint{
Hostname: "cloudcontrolapi-fips.us-east-2.amazonaws.com",
},
+ endpointKey{
+ Region: "us-east-2",
+ Variant: fipsVariant | dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi-fips.us-east-2.api.aws",
+ },
endpointKey{
Region: "us-west-1",
}: endpoint{},
+ endpointKey{
+ Region: "us-west-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi.us-west-1.api.aws",
+ },
endpointKey{
Region: "us-west-1",
Variant: fipsVariant,
}: endpoint{
Hostname: "cloudcontrolapi-fips.us-west-1.amazonaws.com",
},
+ endpointKey{
+ Region: "us-west-1",
+ Variant: fipsVariant | dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi-fips.us-west-1.api.aws",
+ },
endpointKey{
Region: "us-west-2",
}: endpoint{},
+ endpointKey{
+ Region: "us-west-2",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi.us-west-2.api.aws",
+ },
endpointKey{
Region: "us-west-2",
Variant: fipsVariant,
}: endpoint{
Hostname: "cloudcontrolapi-fips.us-west-2.amazonaws.com",
},
+ endpointKey{
+ Region: "us-west-2",
+ Variant: fipsVariant | dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi-fips.us-west-2.api.aws",
+ },
},
},
"clouddirectory": service{
@@ -5853,6 +6501,9 @@ var awsPartition = partition{
endpointKey{
Region: "eu-west-3",
}: endpoint{},
+ endpointKey{
+ Region: "me-central-1",
+ }: endpoint{},
endpointKey{
Region: "me-south-1",
}: endpoint{},
@@ -6747,6 +7398,9 @@ var awsPartition = partition{
endpointKey{
Region: "af-south-1",
}: endpoint{},
+ endpointKey{
+ Region: "ap-east-1",
+ }: endpoint{},
endpointKey{
Region: "ap-northeast-1",
}: endpoint{},
@@ -6759,6 +7413,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-south-1",
}: endpoint{},
+ endpointKey{
+ Region: "ap-south-2",
+ }: endpoint{},
endpointKey{
Region: "ap-southeast-1",
}: endpoint{},
@@ -6768,18 +7425,30 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "ca-west-1",
+ }: endpoint{},
endpointKey{
Region: "eu-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-central-2",
+ }: endpoint{},
endpointKey{
Region: "eu-north-1",
}: endpoint{},
endpointKey{
Region: "eu-south-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-south-2",
+ }: endpoint{},
endpointKey{
Region: "eu-west-1",
}: endpoint{},
@@ -6828,6 +7497,9 @@ var awsPartition = partition{
endpointKey{
Region: "il-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "me-central-1",
+ }: endpoint{},
endpointKey{
Region: "me-south-1",
}: endpoint{},
@@ -6877,6 +7549,9 @@ var awsPartition = partition{
endpointKey{
Region: "af-south-1",
}: endpoint{},
+ endpointKey{
+ Region: "ap-east-1",
+ }: endpoint{},
endpointKey{
Region: "ap-northeast-1",
}: endpoint{},
@@ -6889,6 +7564,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-south-1",
}: endpoint{},
+ endpointKey{
+ Region: "ap-south-2",
+ }: endpoint{},
endpointKey{
Region: "ap-southeast-1",
}: endpoint{},
@@ -6898,18 +7576,30 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "ca-west-1",
+ }: endpoint{},
endpointKey{
Region: "eu-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-central-2",
+ }: endpoint{},
endpointKey{
Region: "eu-north-1",
}: endpoint{},
endpointKey{
Region: "eu-south-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-south-2",
+ }: endpoint{},
endpointKey{
Region: "eu-west-1",
}: endpoint{},
@@ -6958,6 +7648,9 @@ var awsPartition = partition{
endpointKey{
Region: "il-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "me-central-1",
+ }: endpoint{},
endpointKey{
Region: "me-south-1",
}: endpoint{},
@@ -7137,12 +7830,27 @@ var awsPartition = partition{
endpointKey{
Region: "ca-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "ca-central-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "comprehendmedical-fips.ca-central-1.amazonaws.com",
+ },
endpointKey{
Region: "eu-west-1",
}: endpoint{},
endpointKey{
Region: "eu-west-2",
}: endpoint{},
+ endpointKey{
+ Region: "fips-ca-central-1",
+ }: endpoint{
+ Hostname: "comprehendmedical-fips.ca-central-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-central-1",
+ },
+ Deprecated: boxedTrue,
+ },
endpointKey{
Region: "fips-us-east-1",
}: endpoint{
@@ -7781,6 +8489,24 @@ var awsPartition = partition{
},
Deprecated: boxedTrue,
},
+ endpointKey{
+ Region: "ca-west-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "ca-west-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "controltower-fips.ca-west-1.amazonaws.com",
+ },
+ endpointKey{
+ Region: "ca-west-1-fips",
+ }: endpoint{
+ Hostname: "controltower-fips.ca-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-west-1",
+ },
+ Deprecated: boxedTrue,
+ },
endpointKey{
Region: "eu-central-1",
}: endpoint{},
@@ -8777,6 +9503,12 @@ var awsPartition = partition{
endpointKey{
Region: "eu-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-north-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "eu-south-2",
+ }: endpoint{},
endpointKey{
Region: "eu-west-1",
}: endpoint{},
@@ -8980,9 +9712,21 @@ var awsPartition = partition{
endpointKey{
Region: "ca-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "ca-central-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "directconnect-fips.ca-central-1.amazonaws.com",
+ },
endpointKey{
Region: "ca-west-1",
}: endpoint{},
+ endpointKey{
+ Region: "ca-west-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "directconnect-fips.ca-west-1.amazonaws.com",
+ },
endpointKey{
Region: "eu-central-1",
}: endpoint{},
@@ -9007,6 +9751,24 @@ var awsPartition = partition{
endpointKey{
Region: "eu-west-3",
}: endpoint{},
+ endpointKey{
+ Region: "fips-ca-central-1",
+ }: endpoint{
+ Hostname: "directconnect-fips.ca-central-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-central-1",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "fips-ca-west-1",
+ }: endpoint{
+ Hostname: "directconnect-fips.ca-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-west-1",
+ },
+ Deprecated: boxedTrue,
+ },
endpointKey{
Region: "fips-us-east-1",
}: endpoint{
@@ -10263,6 +11025,15 @@ var awsPartition = partition{
}: endpoint{
Hostname: "ec2-fips.ca-central-1.amazonaws.com",
},
+ endpointKey{
+ Region: "ca-west-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "ca-west-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "ec2-fips.ca-west-1.amazonaws.com",
+ },
endpointKey{
Region: "eu-central-1",
}: endpoint{},
@@ -10302,6 +11073,15 @@ var awsPartition = partition{
},
Deprecated: boxedTrue,
},
+ endpointKey{
+ Region: "fips-ca-west-1",
+ }: endpoint{
+ Hostname: "ec2-fips.ca-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-west-1",
+ },
+ Deprecated: boxedTrue,
+ },
endpointKey{
Region: "fips-us-east-1",
}: endpoint{
@@ -11310,6 +12090,15 @@ var awsPartition = partition{
}: endpoint{
Hostname: "elasticfilesystem-fips.ca-central-1.amazonaws.com",
},
+ endpointKey{
+ Region: "ca-west-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "ca-west-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "elasticfilesystem-fips.ca-west-1.amazonaws.com",
+ },
endpointKey{
Region: "eu-central-1",
}: endpoint{},
@@ -11490,6 +12279,15 @@ var awsPartition = partition{
},
Deprecated: boxedTrue,
},
+ endpointKey{
+ Region: "fips-ca-west-1",
+ }: endpoint{
+ Hostname: "elasticfilesystem-fips.ca-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-west-1",
+ },
+ Deprecated: boxedTrue,
+ },
endpointKey{
Region: "fips-eu-central-1",
}: endpoint{
@@ -12276,12 +13074,18 @@ var awsPartition = partition{
endpointKey{
Region: "eu-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-central-2",
+ }: endpoint{},
endpointKey{
Region: "eu-north-1",
}: endpoint{},
endpointKey{
Region: "eu-south-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-south-2",
+ }: endpoint{},
endpointKey{
Region: "eu-west-1",
}: endpoint{},
@@ -12430,6 +13234,9 @@ var awsPartition = partition{
endpointKey{
Region: "eu-south-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-south-2",
+ }: endpoint{},
endpointKey{
Region: "eu-west-1",
}: endpoint{},
@@ -13374,6 +14181,15 @@ var awsPartition = partition{
}: endpoint{
Hostname: "fms-fips.ca-central-1.amazonaws.com",
},
+ endpointKey{
+ Region: "ca-west-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "ca-west-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "fms-fips.ca-west-1.amazonaws.com",
+ },
endpointKey{
Region: "eu-central-1",
}: endpoint{},
@@ -13500,6 +14316,15 @@ var awsPartition = partition{
},
Deprecated: boxedTrue,
},
+ endpointKey{
+ Region: "fips-ca-west-1",
+ }: endpoint{
+ Hostname: "fms-fips.ca-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-west-1",
+ },
+ Deprecated: boxedTrue,
+ },
endpointKey{
Region: "fips-eu-central-1",
}: endpoint{
@@ -13885,6 +14710,15 @@ var awsPartition = partition{
}: endpoint{
Hostname: "fsx-fips.ca-central-1.amazonaws.com",
},
+ endpointKey{
+ Region: "ca-west-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "ca-west-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "fsx-fips.ca-west-1.amazonaws.com",
+ },
endpointKey{
Region: "eu-central-1",
}: endpoint{},
@@ -13918,6 +14752,15 @@ var awsPartition = partition{
},
Deprecated: boxedTrue,
},
+ endpointKey{
+ Region: "fips-ca-west-1",
+ }: endpoint{
+ Hostname: "fsx-fips.ca-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-west-1",
+ },
+ Deprecated: boxedTrue,
+ },
endpointKey{
Region: "fips-prod-ca-central-1",
}: endpoint{
@@ -13927,6 +14770,15 @@ var awsPartition = partition{
},
Deprecated: boxedTrue,
},
+ endpointKey{
+ Region: "fips-prod-ca-west-1",
+ }: endpoint{
+ Hostname: "fsx-fips.ca-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-west-1",
+ },
+ Deprecated: boxedTrue,
+ },
endpointKey{
Region: "fips-prod-us-east-1",
}: endpoint{
@@ -14026,6 +14878,24 @@ var awsPartition = partition{
},
Deprecated: boxedTrue,
},
+ endpointKey{
+ Region: "prod-ca-west-1",
+ }: endpoint{
+ CredentialScope: credentialScope{
+ Region: "ca-west-1",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "prod-ca-west-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "fsx-fips.ca-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-west-1",
+ },
+ Deprecated: boxedTrue,
+ },
endpointKey{
Region: "prod-us-east-1",
}: endpoint{
@@ -14399,6 +15269,18 @@ var awsPartition = partition{
},
},
},
+ "globalaccelerator": service{
+ Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "fips-us-west-2",
+ }: endpoint{
+ Hostname: "globalaccelerator-fips.us-west-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-2",
+ },
+ },
+ },
+ },
"glue": service{
Endpoints: serviceEndpoints{
endpointKey{
@@ -14437,6 +15319,9 @@ var awsPartition = partition{
endpointKey{
Region: "ca-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "ca-west-1",
+ }: endpoint{},
endpointKey{
Region: "eu-central-1",
}: endpoint{},
@@ -14866,6 +15751,9 @@ var awsPartition = partition{
endpointKey{
Region: "ca-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "ca-west-1",
+ }: endpoint{},
endpointKey{
Region: "eu-central-1",
}: endpoint{},
@@ -15044,13 +15932,6 @@ var awsPartition = partition{
}: endpoint{},
},
},
- "honeycode": service{
- Endpoints: serviceEndpoints{
- endpointKey{
- Region: "us-west-2",
- }: endpoint{},
- },
- },
"iam": service{
PartitionEndpoint: "aws-global",
IsRegionalized: boxedFalse,
@@ -15155,6 +16036,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-south-1",
}: endpoint{},
+ endpointKey{
+ Region: "ap-south-2",
+ }: endpoint{},
endpointKey{
Region: "ap-southeast-1",
}: endpoint{},
@@ -15170,6 +16054,9 @@ var awsPartition = partition{
endpointKey{
Region: "ca-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "ca-west-1",
+ }: endpoint{},
endpointKey{
Region: "eu-central-1",
}: endpoint{},
@@ -15182,6 +16069,9 @@ var awsPartition = partition{
endpointKey{
Region: "eu-south-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-south-2",
+ }: endpoint{},
endpointKey{
Region: "eu-west-1",
}: endpoint{},
@@ -16198,16 +17088,6 @@ var awsPartition = partition{
}: endpoint{},
},
},
- "iotroborunner": service{
- Endpoints: serviceEndpoints{
- endpointKey{
- Region: "eu-central-1",
- }: endpoint{},
- endpointKey{
- Region: "us-east-1",
- }: endpoint{},
- },
- },
"iotsecuredtunneling": service{
Defaults: endpointDefaults{
defaultKey{}: endpoint{},
@@ -16875,6 +17755,15 @@ var awsPartition = partition{
}: endpoint{
Hostname: "kafka-fips.ca-central-1.amazonaws.com",
},
+ endpointKey{
+ Region: "ca-west-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "ca-west-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "kafka-fips.ca-west-1.amazonaws.com",
+ },
endpointKey{
Region: "eu-central-1",
}: endpoint{},
@@ -16908,6 +17797,15 @@ var awsPartition = partition{
},
Deprecated: boxedTrue,
},
+ endpointKey{
+ Region: "fips-ca-west-1",
+ }: endpoint{
+ Hostname: "kafka-fips.ca-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-west-1",
+ },
+ Deprecated: boxedTrue,
+ },
endpointKey{
Region: "fips-us-east-1",
}: endpoint{
@@ -17063,12 +17961,27 @@ var awsPartition = partition{
endpointKey{
Region: "ca-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "ca-central-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "kendra-fips.ca-central-1.amazonaws.com",
+ },
endpointKey{
Region: "eu-west-1",
}: endpoint{},
endpointKey{
Region: "eu-west-2",
}: endpoint{},
+ endpointKey{
+ Region: "fips-ca-central-1",
+ }: endpoint{
+ Hostname: "kendra-fips.ca-central-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-central-1",
+ },
+ Deprecated: boxedTrue,
+ },
endpointKey{
Region: "fips-us-east-1",
}: endpoint{
@@ -17488,6 +18401,9 @@ var awsPartition = partition{
endpointKey{
Region: "ca-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "ca-west-1",
+ }: endpoint{},
endpointKey{
Region: "eu-central-1",
}: endpoint{},
@@ -18163,6 +19079,9 @@ var awsPartition = partition{
endpointKey{
Region: "ca-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "ca-west-1",
+ }: endpoint{},
endpointKey{
Region: "eu-central-1",
}: endpoint{},
@@ -18636,6 +19555,9 @@ var awsPartition = partition{
endpointKey{
Region: "ca-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "ca-west-1",
+ }: endpoint{},
endpointKey{
Region: "eu-central-1",
}: endpoint{},
@@ -18935,6 +19857,9 @@ var awsPartition = partition{
endpointKey{
Region: "ca-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "ca-west-1",
+ }: endpoint{},
endpointKey{
Region: "eu-central-1",
}: endpoint{},
@@ -19096,66 +20021,222 @@ var awsPartition = partition{
endpointKey{
Region: "af-south-1",
}: endpoint{},
+ endpointKey{
+ Region: "af-south-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "logs.af-south-1.api.aws",
+ },
endpointKey{
Region: "ap-east-1",
}: endpoint{},
+ endpointKey{
+ Region: "ap-east-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "logs.ap-east-1.api.aws",
+ },
endpointKey{
Region: "ap-northeast-1",
}: endpoint{},
+ endpointKey{
+ Region: "ap-northeast-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "logs.ap-northeast-1.api.aws",
+ },
endpointKey{
Region: "ap-northeast-2",
}: endpoint{},
+ endpointKey{
+ Region: "ap-northeast-2",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "logs.ap-northeast-2.api.aws",
+ },
endpointKey{
Region: "ap-northeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-northeast-3",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "logs.ap-northeast-3.api.aws",
+ },
endpointKey{
Region: "ap-south-1",
}: endpoint{},
+ endpointKey{
+ Region: "ap-south-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "logs.ap-south-1.api.aws",
+ },
endpointKey{
Region: "ap-south-2",
}: endpoint{},
+ endpointKey{
+ Region: "ap-south-2",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "logs.ap-south-2.api.aws",
+ },
endpointKey{
Region: "ap-southeast-1",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "logs.ap-southeast-1.api.aws",
+ },
endpointKey{
Region: "ap-southeast-2",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-2",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "logs.ap-southeast-2.api.aws",
+ },
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-3",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "logs.ap-southeast-3.api.aws",
+ },
endpointKey{
Region: "ap-southeast-4",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "logs.ap-southeast-4.api.aws",
+ },
endpointKey{
Region: "ca-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "ca-central-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "logs.ca-central-1.api.aws",
+ },
+ endpointKey{
+ Region: "ca-central-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "logs-fips.ca-central-1.amazonaws.com",
+ },
endpointKey{
Region: "ca-west-1",
}: endpoint{},
+ endpointKey{
+ Region: "ca-west-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "logs.ca-west-1.api.aws",
+ },
+ endpointKey{
+ Region: "ca-west-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "logs-fips.ca-west-1.amazonaws.com",
+ },
endpointKey{
Region: "eu-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-central-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "logs.eu-central-1.api.aws",
+ },
endpointKey{
Region: "eu-central-2",
}: endpoint{},
+ endpointKey{
+ Region: "eu-central-2",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "logs.eu-central-2.api.aws",
+ },
endpointKey{
Region: "eu-north-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-north-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "logs.eu-north-1.api.aws",
+ },
endpointKey{
Region: "eu-south-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-south-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "logs.eu-south-1.api.aws",
+ },
endpointKey{
Region: "eu-south-2",
}: endpoint{},
+ endpointKey{
+ Region: "eu-south-2",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "logs.eu-south-2.api.aws",
+ },
endpointKey{
Region: "eu-west-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-west-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "logs.eu-west-1.api.aws",
+ },
endpointKey{
Region: "eu-west-2",
}: endpoint{},
+ endpointKey{
+ Region: "eu-west-2",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "logs.eu-west-2.api.aws",
+ },
endpointKey{
Region: "eu-west-3",
}: endpoint{},
+ endpointKey{
+ Region: "eu-west-3",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "logs.eu-west-3.api.aws",
+ },
+ endpointKey{
+ Region: "fips-ca-central-1",
+ }: endpoint{
+ Hostname: "logs-fips.ca-central-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-central-1",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "fips-ca-west-1",
+ }: endpoint{
+ Hostname: "logs-fips.ca-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-west-1",
+ },
+ Deprecated: boxedTrue,
+ },
endpointKey{
Region: "fips-us-east-1",
}: endpoint{
@@ -19195,18 +20276,48 @@ var awsPartition = partition{
endpointKey{
Region: "il-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "il-central-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "logs.il-central-1.api.aws",
+ },
endpointKey{
Region: "me-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "me-central-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "logs.me-central-1.api.aws",
+ },
endpointKey{
Region: "me-south-1",
}: endpoint{},
+ endpointKey{
+ Region: "me-south-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "logs.me-south-1.api.aws",
+ },
endpointKey{
Region: "sa-east-1",
}: endpoint{},
+ endpointKey{
+ Region: "sa-east-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "logs.sa-east-1.api.aws",
+ },
endpointKey{
Region: "us-east-1",
}: endpoint{},
+ endpointKey{
+ Region: "us-east-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "logs.us-east-1.api.aws",
+ },
endpointKey{
Region: "us-east-1",
Variant: fipsVariant,
@@ -19216,6 +20327,12 @@ var awsPartition = partition{
endpointKey{
Region: "us-east-2",
}: endpoint{},
+ endpointKey{
+ Region: "us-east-2",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "logs.us-east-2.api.aws",
+ },
endpointKey{
Region: "us-east-2",
Variant: fipsVariant,
@@ -19225,6 +20342,12 @@ var awsPartition = partition{
endpointKey{
Region: "us-west-1",
}: endpoint{},
+ endpointKey{
+ Region: "us-west-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "logs.us-west-1.api.aws",
+ },
endpointKey{
Region: "us-west-1",
Variant: fipsVariant,
@@ -19234,6 +20357,12 @@ var awsPartition = partition{
endpointKey{
Region: "us-west-2",
}: endpoint{},
+ endpointKey{
+ Region: "us-west-2",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "logs.us-west-2.api.aws",
+ },
endpointKey{
Region: "us-west-2",
Variant: fipsVariant,
@@ -19350,6 +20479,9 @@ var awsPartition = partition{
endpointKey{
Region: "eu-south-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-south-2",
+ }: endpoint{},
endpointKey{
Region: "eu-west-1",
}: endpoint{},
@@ -19389,6 +20521,9 @@ var awsPartition = partition{
Deprecated: boxedTrue,
},
+ endpointKey{
+ Region: "il-central-1",
+ }: endpoint{},
endpointKey{
Region: "sa-east-1",
}: endpoint{},
@@ -19600,12 +20735,30 @@ var awsPartition = partition{
},
"media-pipelines-chime": service{
Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "ap-northeast-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "ap-northeast-2",
+ }: endpoint{},
+ endpointKey{
+ Region: "ap-south-1",
+ }: endpoint{},
endpointKey{
Region: "ap-southeast-1",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-2",
+ }: endpoint{},
+ endpointKey{
+ Region: "ca-central-1",
+ }: endpoint{},
endpointKey{
Region: "eu-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-west-2",
+ }: endpoint{},
endpointKey{
Region: "us-east-1",
}: endpoint{},
@@ -19809,6 +20962,9 @@ var awsPartition = partition{
},
Deprecated: boxedTrue,
},
+ endpointKey{
+ Region: "me-central-1",
+ }: endpoint{},
endpointKey{
Region: "sa-east-1",
}: endpoint{},
@@ -19858,15 +21014,27 @@ var awsPartition = partition{
endpointKey{
Region: "ap-northeast-2",
}: endpoint{},
+ endpointKey{
+ Region: "ap-northeast-3",
+ }: endpoint{},
endpointKey{
Region: "ap-south-1",
}: endpoint{},
+ endpointKey{
+ Region: "ap-south-2",
+ }: endpoint{},
endpointKey{
Region: "ap-southeast-1",
}: endpoint{},
endpointKey{
Region: "ap-southeast-2",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
+ endpointKey{
+ Region: "ca-central-1",
+ }: endpoint{},
endpointKey{
Region: "eu-central-1",
}: endpoint{},
@@ -19909,6 +21077,9 @@ var awsPartition = partition{
},
Deprecated: boxedTrue,
},
+ endpointKey{
+ Region: "me-central-1",
+ }: endpoint{},
endpointKey{
Region: "sa-east-1",
}: endpoint{},
@@ -20148,6 +21319,9 @@ var awsPartition = partition{
},
"meetings-chime": service{
Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "af-south-1",
+ }: endpoint{},
endpointKey{
Region: "ap-northeast-1",
}: endpoint{},
@@ -20166,6 +21340,21 @@ var awsPartition = partition{
endpointKey{
Region: "ca-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "ca-central-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "meetings-chime-fips.ca-central-1.amazonaws.com",
+ },
+ endpointKey{
+ Region: "ca-central-1-fips",
+ }: endpoint{
+ Hostname: "meetings-chime-fips.ca-central-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-central-1",
+ },
+ Deprecated: boxedTrue,
+ },
endpointKey{
Region: "eu-central-1",
}: endpoint{},
@@ -21024,6 +22213,9 @@ var awsPartition = partition{
endpointKey{
Region: "ca-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "ca-west-1",
+ }: endpoint{},
endpointKey{
Region: "eu-central-1",
}: endpoint{},
@@ -21339,6 +22531,9 @@ var awsPartition = partition{
}: endpoint{
Hostname: "network-firewall-fips.ca-central-1.amazonaws.com",
},
+ endpointKey{
+ Region: "ca-west-1",
+ }: endpoint{},
endpointKey{
Region: "eu-central-1",
}: endpoint{},
@@ -21668,6 +22863,14 @@ var awsPartition = partition{
Region: "ap-south-1",
},
},
+ endpointKey{
+ Region: "ap-south-2",
+ }: endpoint{
+ Hostname: "oidc.ap-south-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ap-south-2",
+ },
+ },
endpointKey{
Region: "ap-southeast-1",
}: endpoint{
@@ -21692,6 +22895,14 @@ var awsPartition = partition{
Region: "ap-southeast-3",
},
},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{
+ Hostname: "oidc.ap-southeast-4.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ap-southeast-4",
+ },
+ },
endpointKey{
Region: "ca-central-1",
}: endpoint{
@@ -21700,6 +22911,14 @@ var awsPartition = partition{
Region: "ca-central-1",
},
},
+ endpointKey{
+ Region: "ca-west-1",
+ }: endpoint{
+ Hostname: "oidc.ca-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-west-1",
+ },
+ },
endpointKey{
Region: "eu-central-1",
}: endpoint{
@@ -21732,6 +22951,14 @@ var awsPartition = partition{
Region: "eu-south-1",
},
},
+ endpointKey{
+ Region: "eu-south-2",
+ }: endpoint{
+ Hostname: "oidc.eu-south-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "eu-south-2",
+ },
+ },
endpointKey{
Region: "eu-west-1",
}: endpoint{
@@ -22053,12 +23280,18 @@ var awsPartition = partition{
endpointKey{
Region: "eu-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-north-1",
+ }: endpoint{},
endpointKey{
Region: "eu-west-1",
}: endpoint{},
endpointKey{
Region: "eu-west-2",
}: endpoint{},
+ endpointKey{
+ Region: "sa-east-1",
+ }: endpoint{},
endpointKey{
Region: "us-east-1",
}: endpoint{},
@@ -22329,91 +23562,490 @@ var awsPartition = partition{
Endpoints: serviceEndpoints{
endpointKey{
Region: "af-south-1",
- }: endpoint{},
+ }: endpoint{
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "af-south-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "pi.af-south-1.api.aws",
+ Protocols: []string{"https"},
+ },
endpointKey{
Region: "ap-east-1",
- }: endpoint{},
+ }: endpoint{
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "ap-east-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "pi.ap-east-1.api.aws",
+ Protocols: []string{"https"},
+ },
endpointKey{
Region: "ap-northeast-1",
- }: endpoint{},
+ }: endpoint{
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "ap-northeast-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "pi.ap-northeast-1.api.aws",
+ Protocols: []string{"https"},
+ },
endpointKey{
Region: "ap-northeast-2",
- }: endpoint{},
+ }: endpoint{
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "ap-northeast-2",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "pi.ap-northeast-2.api.aws",
+ Protocols: []string{"https"},
+ },
endpointKey{
Region: "ap-northeast-3",
- }: endpoint{},
+ }: endpoint{
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "ap-northeast-3",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "pi.ap-northeast-3.api.aws",
+ Protocols: []string{"https"},
+ },
endpointKey{
Region: "ap-south-1",
- }: endpoint{},
+ }: endpoint{
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "ap-south-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "pi.ap-south-1.api.aws",
+ Protocols: []string{"https"},
+ },
endpointKey{
Region: "ap-south-2",
- }: endpoint{},
+ }: endpoint{
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "ap-south-2",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "pi.ap-south-2.api.aws",
+ Protocols: []string{"https"},
+ },
endpointKey{
Region: "ap-southeast-1",
- }: endpoint{},
+ }: endpoint{
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "ap-southeast-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "pi.ap-southeast-1.api.aws",
+ Protocols: []string{"https"},
+ },
endpointKey{
Region: "ap-southeast-2",
- }: endpoint{},
+ }: endpoint{
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "ap-southeast-2",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "pi.ap-southeast-2.api.aws",
+ Protocols: []string{"https"},
+ },
endpointKey{
Region: "ap-southeast-3",
- }: endpoint{},
+ }: endpoint{
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "ap-southeast-3",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "pi.ap-southeast-3.api.aws",
+ Protocols: []string{"https"},
+ },
endpointKey{
Region: "ap-southeast-4",
- }: endpoint{},
+ }: endpoint{
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "ap-southeast-4",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "pi.ap-southeast-4.api.aws",
+ Protocols: []string{"https"},
+ },
endpointKey{
Region: "ca-central-1",
- }: endpoint{},
+ }: endpoint{
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "ca-central-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "pi.ca-central-1.api.aws",
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "ca-central-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "pi-fips.ca-central-1.amazonaws.com",
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "ca-central-1",
+ Variant: fipsVariant | dualStackVariant,
+ }: endpoint{
+ Hostname: "pi-fips.ca-central-1.api.aws",
+ Protocols: []string{"https"},
+ },
endpointKey{
Region: "ca-west-1",
- }: endpoint{},
+ }: endpoint{
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "ca-west-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "pi.ca-west-1.api.aws",
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "ca-west-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "pi-fips.ca-west-1.amazonaws.com",
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "ca-west-1",
+ Variant: fipsVariant | dualStackVariant,
+ }: endpoint{
+ Hostname: "pi-fips.ca-west-1.api.aws",
+ Protocols: []string{"https"},
+ },
endpointKey{
Region: "eu-central-1",
- }: endpoint{},
+ }: endpoint{
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "eu-central-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "pi.eu-central-1.api.aws",
+ Protocols: []string{"https"},
+ },
endpointKey{
Region: "eu-central-2",
- }: endpoint{},
+ }: endpoint{
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "eu-central-2",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "pi.eu-central-2.api.aws",
+ Protocols: []string{"https"},
+ },
endpointKey{
Region: "eu-north-1",
- }: endpoint{},
+ }: endpoint{
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "eu-north-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "pi.eu-north-1.api.aws",
+ Protocols: []string{"https"},
+ },
endpointKey{
Region: "eu-south-1",
- }: endpoint{},
+ }: endpoint{
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "eu-south-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "pi.eu-south-1.api.aws",
+ Protocols: []string{"https"},
+ },
endpointKey{
Region: "eu-south-2",
- }: endpoint{},
+ }: endpoint{
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "eu-south-2",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "pi.eu-south-2.api.aws",
+ Protocols: []string{"https"},
+ },
endpointKey{
Region: "eu-west-1",
- }: endpoint{},
+ }: endpoint{
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "eu-west-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "pi.eu-west-1.api.aws",
+ Protocols: []string{"https"},
+ },
endpointKey{
Region: "eu-west-2",
- }: endpoint{},
+ }: endpoint{
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "eu-west-2",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "pi.eu-west-2.api.aws",
+ Protocols: []string{"https"},
+ },
endpointKey{
Region: "eu-west-3",
- }: endpoint{},
+ }: endpoint{
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "eu-west-3",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "pi.eu-west-3.api.aws",
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "fips-ca-central-1",
+ }: endpoint{
+ Hostname: "pi-fips.ca-central-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-central-1",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "fips-ca-west-1",
+ }: endpoint{
+ Hostname: "pi-fips.ca-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-west-1",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "fips-us-east-1",
+ }: endpoint{
+ Hostname: "pi-fips.us-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-1",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "fips-us-east-2",
+ }: endpoint{
+ Hostname: "pi-fips.us-east-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-2",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "fips-us-west-1",
+ }: endpoint{
+ Hostname: "pi-fips.us-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-1",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "fips-us-west-2",
+ }: endpoint{
+ Hostname: "pi-fips.us-west-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-2",
+ },
+ Deprecated: boxedTrue,
+ },
endpointKey{
Region: "il-central-1",
- }: endpoint{},
+ }: endpoint{
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "il-central-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "pi.il-central-1.api.aws",
+ Protocols: []string{"https"},
+ },
endpointKey{
Region: "me-central-1",
- }: endpoint{},
+ }: endpoint{
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "me-central-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "pi.me-central-1.api.aws",
+ Protocols: []string{"https"},
+ },
endpointKey{
Region: "me-south-1",
- }: endpoint{},
+ }: endpoint{
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "me-south-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "pi.me-south-1.api.aws",
+ Protocols: []string{"https"},
+ },
endpointKey{
Region: "sa-east-1",
- }: endpoint{},
+ }: endpoint{
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "sa-east-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "pi.sa-east-1.api.aws",
+ Protocols: []string{"https"},
+ },
endpointKey{
Region: "us-east-1",
- }: endpoint{},
+ }: endpoint{
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "us-east-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "pi.us-east-1.api.aws",
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "us-east-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "pi-fips.us-east-1.amazonaws.com",
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "us-east-1",
+ Variant: fipsVariant | dualStackVariant,
+ }: endpoint{
+ Hostname: "pi-fips.us-east-1.api.aws",
+ Protocols: []string{"https"},
+ },
endpointKey{
Region: "us-east-2",
- }: endpoint{},
+ }: endpoint{
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "us-east-2",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "pi.us-east-2.api.aws",
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "us-east-2",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "pi-fips.us-east-2.amazonaws.com",
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "us-east-2",
+ Variant: fipsVariant | dualStackVariant,
+ }: endpoint{
+ Hostname: "pi-fips.us-east-2.api.aws",
+ Protocols: []string{"https"},
+ },
endpointKey{
Region: "us-west-1",
- }: endpoint{},
+ }: endpoint{
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "us-west-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "pi.us-west-1.api.aws",
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "us-west-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "pi-fips.us-west-1.amazonaws.com",
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "us-west-1",
+ Variant: fipsVariant | dualStackVariant,
+ }: endpoint{
+ Hostname: "pi-fips.us-west-1.api.aws",
+ Protocols: []string{"https"},
+ },
endpointKey{
Region: "us-west-2",
- }: endpoint{},
+ }: endpoint{
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "us-west-2",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "pi.us-west-2.api.aws",
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "us-west-2",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "pi-fips.us-west-2.amazonaws.com",
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "us-west-2",
+ Variant: fipsVariant | dualStackVariant,
+ }: endpoint{
+ Hostname: "pi-fips.us-west-2.api.aws",
+ Protocols: []string{"https"},
+ },
},
},
"pinpoint": service{
@@ -22811,6 +24443,14 @@ var awsPartition = partition{
Region: "ap-south-1",
},
},
+ endpointKey{
+ Region: "ap-south-2",
+ }: endpoint{
+ Hostname: "portal.sso.ap-south-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ap-south-2",
+ },
+ },
endpointKey{
Region: "ap-southeast-1",
}: endpoint{
@@ -22835,6 +24475,14 @@ var awsPartition = partition{
Region: "ap-southeast-3",
},
},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{
+ Hostname: "portal.sso.ap-southeast-4.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ap-southeast-4",
+ },
+ },
endpointKey{
Region: "ca-central-1",
}: endpoint{
@@ -22843,6 +24491,14 @@ var awsPartition = partition{
Region: "ca-central-1",
},
},
+ endpointKey{
+ Region: "ca-west-1",
+ }: endpoint{
+ Hostname: "portal.sso.ca-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-west-1",
+ },
+ },
endpointKey{
Region: "eu-central-1",
}: endpoint{
@@ -22875,6 +24531,14 @@ var awsPartition = partition{
Region: "eu-south-1",
},
},
+ endpointKey{
+ Region: "eu-south-2",
+ }: endpoint{
+ Hostname: "portal.sso.eu-south-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "eu-south-2",
+ },
+ },
endpointKey{
Region: "eu-west-1",
}: endpoint{
@@ -22965,6 +24629,19 @@ var awsPartition = partition{
},
},
},
+ "private-networks": service{
+ Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "us-east-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "us-east-2",
+ }: endpoint{},
+ endpointKey{
+ Region: "us-west-2",
+ }: endpoint{},
+ },
+ },
"profile": service{
Endpoints: serviceEndpoints{
endpointKey{
@@ -23365,6 +25042,9 @@ var awsPartition = partition{
},
"quicksight": service{
Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "af-south-1",
+ }: endpoint{},
endpointKey{
Region: "ap-northeast-1",
}: endpoint{},
@@ -23380,15 +25060,27 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-2",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-3",
+ }: endpoint{},
+ endpointKey{
+ Region: "api",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
endpointKey{
Region: "eu-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-central-2",
+ }: endpoint{},
endpointKey{
Region: "eu-north-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-south-1",
+ }: endpoint{},
endpointKey{
Region: "eu-west-1",
}: endpoint{},
@@ -24427,12 +26119,24 @@ var awsPartition = partition{
endpointKey{
Region: "ca-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "ca-central-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "redshift-serverless-fips.ca-central-1.amazonaws.com",
+ },
endpointKey{
Region: "eu-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-central-2",
+ }: endpoint{},
endpointKey{
Region: "eu-north-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-south-2",
+ }: endpoint{},
endpointKey{
Region: "eu-west-1",
}: endpoint{},
@@ -24442,18 +26146,93 @@ var awsPartition = partition{
endpointKey{
Region: "eu-west-3",
}: endpoint{},
+ endpointKey{
+ Region: "fips-ca-central-1",
+ }: endpoint{
+ Hostname: "redshift-serverless-fips.ca-central-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-central-1",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "fips-us-east-1",
+ }: endpoint{
+ Hostname: "redshift-serverless-fips.us-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-1",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "fips-us-east-2",
+ }: endpoint{
+ Hostname: "redshift-serverless-fips.us-east-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-2",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "fips-us-west-1",
+ }: endpoint{
+ Hostname: "redshift-serverless-fips.us-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-1",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "fips-us-west-2",
+ }: endpoint{
+ Hostname: "redshift-serverless-fips.us-west-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-2",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "me-central-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "sa-east-1",
+ }: endpoint{},
endpointKey{
Region: "us-east-1",
}: endpoint{},
+ endpointKey{
+ Region: "us-east-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "redshift-serverless-fips.us-east-1.amazonaws.com",
+ },
endpointKey{
Region: "us-east-2",
}: endpoint{},
+ endpointKey{
+ Region: "us-east-2",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "redshift-serverless-fips.us-east-2.amazonaws.com",
+ },
endpointKey{
Region: "us-west-1",
}: endpoint{},
+ endpointKey{
+ Region: "us-west-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "redshift-serverless-fips.us-west-1.amazonaws.com",
+ },
endpointKey{
Region: "us-west-2",
}: endpoint{},
+ endpointKey{
+ Region: "us-west-2",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "redshift-serverless-fips.us-west-2.amazonaws.com",
+ },
},
},
"rekognition": service{
@@ -24777,156 +26556,273 @@ var awsPartition = partition{
},
},
"resource-explorer-2": service{
- Defaults: endpointDefaults{
- defaultKey{}: endpoint{
- DNSSuffix: "api.aws",
- },
- defaultKey{
- Variant: fipsVariant,
- }: endpoint{
- Hostname: "{service}-fips.{region}.{dnsSuffix}",
- DNSSuffix: "api.aws",
- },
+ Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "af-south-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "ap-east-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "ap-northeast-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "ap-northeast-2",
+ }: endpoint{},
+ endpointKey{
+ Region: "ap-northeast-3",
+ }: endpoint{},
+ endpointKey{
+ Region: "ap-south-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "ap-south-2",
+ }: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-2",
+ }: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-3",
+ }: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
+ endpointKey{
+ Region: "ca-central-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "ca-west-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "eu-central-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "eu-central-2",
+ }: endpoint{},
+ endpointKey{
+ Region: "eu-north-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "eu-south-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "eu-south-2",
+ }: endpoint{},
+ endpointKey{
+ Region: "eu-west-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "eu-west-2",
+ }: endpoint{},
+ endpointKey{
+ Region: "eu-west-3",
+ }: endpoint{},
+ endpointKey{
+ Region: "il-central-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "me-central-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "me-south-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "sa-east-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "us-east-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "us-east-2",
+ }: endpoint{},
+ endpointKey{
+ Region: "us-west-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "us-west-2",
+ }: endpoint{},
},
+ },
+ "resource-groups": service{
Endpoints: serviceEndpoints{
endpointKey{
Region: "af-south-1",
- }: endpoint{
- Hostname: "resource-explorer-2.af-south-1.api.aws",
- },
+ }: endpoint{},
endpointKey{
Region: "ap-east-1",
- }: endpoint{
- Hostname: "resource-explorer-2.ap-east-1.api.aws",
- },
+ }: endpoint{},
endpointKey{
Region: "ap-northeast-1",
- }: endpoint{
- Hostname: "resource-explorer-2.ap-northeast-1.api.aws",
- },
+ }: endpoint{},
endpointKey{
Region: "ap-northeast-2",
- }: endpoint{
- Hostname: "resource-explorer-2.ap-northeast-2.api.aws",
- },
+ }: endpoint{},
endpointKey{
Region: "ap-northeast-3",
- }: endpoint{
- Hostname: "resource-explorer-2.ap-northeast-3.api.aws",
- },
+ }: endpoint{},
endpointKey{
Region: "ap-south-1",
- }: endpoint{
- Hostname: "resource-explorer-2.ap-south-1.api.aws",
- },
+ }: endpoint{},
endpointKey{
Region: "ap-south-2",
- }: endpoint{
- Hostname: "resource-explorer-2.ap-south-2.api.aws",
- },
+ }: endpoint{},
endpointKey{
Region: "ap-southeast-1",
- }: endpoint{
- Hostname: "resource-explorer-2.ap-southeast-1.api.aws",
- },
+ }: endpoint{},
endpointKey{
Region: "ap-southeast-2",
- }: endpoint{
- Hostname: "resource-explorer-2.ap-southeast-2.api.aws",
- },
+ }: endpoint{},
endpointKey{
Region: "ap-southeast-3",
- }: endpoint{
- Hostname: "resource-explorer-2.ap-southeast-3.api.aws",
- },
+ }: endpoint{},
endpointKey{
Region: "ap-southeast-4",
- }: endpoint{
- Hostname: "resource-explorer-2.ap-southeast-4.api.aws",
- },
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
- }: endpoint{
- Hostname: "resource-explorer-2.ca-central-1.api.aws",
- },
+ }: endpoint{},
+ endpointKey{
+ Region: "ca-west-1",
+ }: endpoint{},
endpointKey{
Region: "eu-central-1",
- }: endpoint{
- Hostname: "resource-explorer-2.eu-central-1.api.aws",
- },
+ }: endpoint{},
endpointKey{
Region: "eu-central-2",
- }: endpoint{
- Hostname: "resource-explorer-2.eu-central-2.api.aws",
- },
+ }: endpoint{},
endpointKey{
Region: "eu-north-1",
- }: endpoint{
- Hostname: "resource-explorer-2.eu-north-1.api.aws",
- },
+ }: endpoint{},
endpointKey{
Region: "eu-south-1",
- }: endpoint{
- Hostname: "resource-explorer-2.eu-south-1.api.aws",
- },
+ }: endpoint{},
+ endpointKey{
+ Region: "eu-south-2",
+ }: endpoint{},
endpointKey{
Region: "eu-west-1",
- }: endpoint{
- Hostname: "resource-explorer-2.eu-west-1.api.aws",
- },
+ }: endpoint{},
endpointKey{
Region: "eu-west-2",
- }: endpoint{
- Hostname: "resource-explorer-2.eu-west-2.api.aws",
- },
+ }: endpoint{},
endpointKey{
Region: "eu-west-3",
+ }: endpoint{},
+ endpointKey{
+ Region: "fips-us-east-1",
}: endpoint{
- Hostname: "resource-explorer-2.eu-west-3.api.aws",
+ Hostname: "resource-groups-fips.us-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-1",
+ },
+ Deprecated: boxedTrue,
},
endpointKey{
- Region: "il-central-1",
+ Region: "fips-us-east-2",
}: endpoint{
- Hostname: "resource-explorer-2.il-central-1.api.aws",
+ Hostname: "resource-groups-fips.us-east-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-2",
+ },
+ Deprecated: boxedTrue,
},
endpointKey{
- Region: "me-central-1",
+ Region: "fips-us-west-1",
}: endpoint{
- Hostname: "resource-explorer-2.me-central-1.api.aws",
+ Hostname: "resource-groups-fips.us-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-1",
+ },
+ Deprecated: boxedTrue,
},
endpointKey{
- Region: "me-south-1",
+ Region: "fips-us-west-2",
}: endpoint{
- Hostname: "resource-explorer-2.me-south-1.api.aws",
+ Hostname: "resource-groups-fips.us-west-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-2",
+ },
+ Deprecated: boxedTrue,
},
+ endpointKey{
+ Region: "il-central-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "me-central-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "me-south-1",
+ }: endpoint{},
endpointKey{
Region: "sa-east-1",
- }: endpoint{
- Hostname: "resource-explorer-2.sa-east-1.api.aws",
- },
+ }: endpoint{},
endpointKey{
Region: "us-east-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "us-east-1",
+ Variant: fipsVariant,
}: endpoint{
- Hostname: "resource-explorer-2.us-east-1.api.aws",
+ Hostname: "resource-groups-fips.us-east-1.amazonaws.com",
},
endpointKey{
Region: "us-east-2",
+ }: endpoint{},
+ endpointKey{
+ Region: "us-east-2",
+ Variant: fipsVariant,
}: endpoint{
- Hostname: "resource-explorer-2.us-east-2.api.aws",
+ Hostname: "resource-groups-fips.us-east-2.amazonaws.com",
},
endpointKey{
Region: "us-west-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "us-west-1",
+ Variant: fipsVariant,
}: endpoint{
- Hostname: "resource-explorer-2.us-west-1.api.aws",
+ Hostname: "resource-groups-fips.us-west-1.amazonaws.com",
},
endpointKey{
Region: "us-west-2",
+ }: endpoint{},
+ endpointKey{
+ Region: "us-west-2",
+ Variant: fipsVariant,
}: endpoint{
- Hostname: "resource-explorer-2.us-west-2.api.aws",
+ Hostname: "resource-groups-fips.us-west-2.amazonaws.com",
},
},
},
- "resource-groups": service{
+ "robomaker": service{
+ Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "ap-northeast-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "eu-central-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "eu-west-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "us-east-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "us-east-2",
+ }: endpoint{},
+ endpointKey{
+ Region: "us-west-2",
+ }: endpoint{},
+ },
+ },
+ "rolesanywhere": service{
Endpoints: serviceEndpoints{
endpointKey{
Region: "af-south-1",
@@ -24991,179 +26887,6 @@ var awsPartition = partition{
endpointKey{
Region: "eu-west-3",
}: endpoint{},
- endpointKey{
- Region: "fips-us-east-1",
- }: endpoint{
- Hostname: "resource-groups-fips.us-east-1.amazonaws.com",
- CredentialScope: credentialScope{
- Region: "us-east-1",
- },
- Deprecated: boxedTrue,
- },
- endpointKey{
- Region: "fips-us-east-2",
- }: endpoint{
- Hostname: "resource-groups-fips.us-east-2.amazonaws.com",
- CredentialScope: credentialScope{
- Region: "us-east-2",
- },
- Deprecated: boxedTrue,
- },
- endpointKey{
- Region: "fips-us-west-1",
- }: endpoint{
- Hostname: "resource-groups-fips.us-west-1.amazonaws.com",
- CredentialScope: credentialScope{
- Region: "us-west-1",
- },
- Deprecated: boxedTrue,
- },
- endpointKey{
- Region: "fips-us-west-2",
- }: endpoint{
- Hostname: "resource-groups-fips.us-west-2.amazonaws.com",
- CredentialScope: credentialScope{
- Region: "us-west-2",
- },
- Deprecated: boxedTrue,
- },
- endpointKey{
- Region: "il-central-1",
- }: endpoint{},
- endpointKey{
- Region: "me-central-1",
- }: endpoint{},
- endpointKey{
- Region: "me-south-1",
- }: endpoint{},
- endpointKey{
- Region: "sa-east-1",
- }: endpoint{},
- endpointKey{
- Region: "us-east-1",
- }: endpoint{},
- endpointKey{
- Region: "us-east-1",
- Variant: fipsVariant,
- }: endpoint{
- Hostname: "resource-groups-fips.us-east-1.amazonaws.com",
- },
- endpointKey{
- Region: "us-east-2",
- }: endpoint{},
- endpointKey{
- Region: "us-east-2",
- Variant: fipsVariant,
- }: endpoint{
- Hostname: "resource-groups-fips.us-east-2.amazonaws.com",
- },
- endpointKey{
- Region: "us-west-1",
- }: endpoint{},
- endpointKey{
- Region: "us-west-1",
- Variant: fipsVariant,
- }: endpoint{
- Hostname: "resource-groups-fips.us-west-1.amazonaws.com",
- },
- endpointKey{
- Region: "us-west-2",
- }: endpoint{},
- endpointKey{
- Region: "us-west-2",
- Variant: fipsVariant,
- }: endpoint{
- Hostname: "resource-groups-fips.us-west-2.amazonaws.com",
- },
- },
- },
- "robomaker": service{
- Endpoints: serviceEndpoints{
- endpointKey{
- Region: "ap-northeast-1",
- }: endpoint{},
- endpointKey{
- Region: "ap-southeast-1",
- }: endpoint{},
- endpointKey{
- Region: "eu-central-1",
- }: endpoint{},
- endpointKey{
- Region: "eu-west-1",
- }: endpoint{},
- endpointKey{
- Region: "us-east-1",
- }: endpoint{},
- endpointKey{
- Region: "us-east-2",
- }: endpoint{},
- endpointKey{
- Region: "us-west-2",
- }: endpoint{},
- },
- },
- "rolesanywhere": service{
- Endpoints: serviceEndpoints{
- endpointKey{
- Region: "af-south-1",
- }: endpoint{},
- endpointKey{
- Region: "ap-east-1",
- }: endpoint{},
- endpointKey{
- Region: "ap-northeast-1",
- }: endpoint{},
- endpointKey{
- Region: "ap-northeast-2",
- }: endpoint{},
- endpointKey{
- Region: "ap-northeast-3",
- }: endpoint{},
- endpointKey{
- Region: "ap-south-1",
- }: endpoint{},
- endpointKey{
- Region: "ap-south-2",
- }: endpoint{},
- endpointKey{
- Region: "ap-southeast-1",
- }: endpoint{},
- endpointKey{
- Region: "ap-southeast-2",
- }: endpoint{},
- endpointKey{
- Region: "ap-southeast-3",
- }: endpoint{},
- endpointKey{
- Region: "ap-southeast-4",
- }: endpoint{},
- endpointKey{
- Region: "ca-central-1",
- }: endpoint{},
- endpointKey{
- Region: "eu-central-1",
- }: endpoint{},
- endpointKey{
- Region: "eu-central-2",
- }: endpoint{},
- endpointKey{
- Region: "eu-north-1",
- }: endpoint{},
- endpointKey{
- Region: "eu-south-1",
- }: endpoint{},
- endpointKey{
- Region: "eu-south-2",
- }: endpoint{},
- endpointKey{
- Region: "eu-west-1",
- }: endpoint{},
- endpointKey{
- Region: "eu-west-2",
- }: endpoint{},
- endpointKey{
- Region: "eu-west-3",
- }: endpoint{},
endpointKey{
Region: "fips-us-east-1",
}: endpoint{
@@ -25399,33 +27122,81 @@ var awsPartition = partition{
},
"rum": service{
Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "af-south-1",
+ }: endpoint{},
endpointKey{
Region: "ap-northeast-1",
}: endpoint{},
+ endpointKey{
+ Region: "ap-northeast-2",
+ }: endpoint{},
+ endpointKey{
+ Region: "ap-northeast-3",
+ }: endpoint{},
+ endpointKey{
+ Region: "ap-south-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "ap-south-2",
+ }: endpoint{},
endpointKey{
Region: "ap-southeast-1",
}: endpoint{},
endpointKey{
Region: "ap-southeast-2",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-3",
+ }: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
+ endpointKey{
+ Region: "ca-central-1",
+ }: endpoint{},
endpointKey{
Region: "eu-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-central-2",
+ }: endpoint{},
endpointKey{
Region: "eu-north-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-south-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "eu-south-2",
+ }: endpoint{},
endpointKey{
Region: "eu-west-1",
}: endpoint{},
endpointKey{
Region: "eu-west-2",
}: endpoint{},
+ endpointKey{
+ Region: "eu-west-3",
+ }: endpoint{},
+ endpointKey{
+ Region: "me-central-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "me-south-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "sa-east-1",
+ }: endpoint{},
endpointKey{
Region: "us-east-1",
}: endpoint{},
endpointKey{
Region: "us-east-2",
}: endpoint{},
+ endpointKey{
+ Region: "us-west-1",
+ }: endpoint{},
endpointKey{
Region: "us-west-2",
}: endpoint{},
@@ -26195,6 +27966,44 @@ var awsPartition = partition{
},
},
Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "af-south-1",
+ }: endpoint{
+ Hostname: "s3-control.af-south-1.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "af-south-1",
+ },
+ },
+ endpointKey{
+ Region: "af-south-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "s3-control.dualstack.af-south-1.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "af-south-1",
+ },
+ },
+ endpointKey{
+ Region: "ap-east-1",
+ }: endpoint{
+ Hostname: "s3-control.ap-east-1.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "ap-east-1",
+ },
+ },
+ endpointKey{
+ Region: "ap-east-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "s3-control.dualstack.ap-east-1.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "ap-east-1",
+ },
+ },
endpointKey{
Region: "ap-northeast-1",
}: endpoint{
@@ -26271,6 +28080,25 @@ var awsPartition = partition{
Region: "ap-south-1",
},
},
+ endpointKey{
+ Region: "ap-south-2",
+ }: endpoint{
+ Hostname: "s3-control.ap-south-2.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "ap-south-2",
+ },
+ },
+ endpointKey{
+ Region: "ap-south-2",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "s3-control.dualstack.ap-south-2.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "ap-south-2",
+ },
+ },
endpointKey{
Region: "ap-southeast-1",
}: endpoint{
@@ -26309,6 +28137,44 @@ var awsPartition = partition{
Region: "ap-southeast-2",
},
},
+ endpointKey{
+ Region: "ap-southeast-3",
+ }: endpoint{
+ Hostname: "s3-control.ap-southeast-3.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "ap-southeast-3",
+ },
+ },
+ endpointKey{
+ Region: "ap-southeast-3",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "s3-control.dualstack.ap-southeast-3.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "ap-southeast-3",
+ },
+ },
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{
+ Hostname: "s3-control.ap-southeast-4.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "ap-southeast-4",
+ },
+ },
+ endpointKey{
+ Region: "ap-southeast-4",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "s3-control.dualstack.ap-southeast-4.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "ap-southeast-4",
+ },
+ },
endpointKey{
Region: "ca-central-1",
}: endpoint{
@@ -26358,6 +28224,55 @@ var awsPartition = partition{
},
Deprecated: boxedTrue,
},
+ endpointKey{
+ Region: "ca-west-1",
+ }: endpoint{
+ Hostname: "s3-control.ca-west-1.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "ca-west-1",
+ },
+ },
+ endpointKey{
+ Region: "ca-west-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "s3-control.dualstack.ca-west-1.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "ca-west-1",
+ },
+ },
+ endpointKey{
+ Region: "ca-west-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "s3-control-fips.ca-west-1.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "ca-west-1",
+ },
+ },
+ endpointKey{
+ Region: "ca-west-1",
+ Variant: fipsVariant | dualStackVariant,
+ }: endpoint{
+ Hostname: "s3-control-fips.dualstack.ca-west-1.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "ca-west-1",
+ },
+ },
+ endpointKey{
+ Region: "ca-west-1-fips",
+ }: endpoint{
+ Hostname: "s3-control-fips.ca-west-1.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "ca-west-1",
+ },
+ Deprecated: boxedTrue,
+ },
endpointKey{
Region: "eu-central-1",
}: endpoint{
@@ -26377,6 +28292,25 @@ var awsPartition = partition{
Region: "eu-central-1",
},
},
+ endpointKey{
+ Region: "eu-central-2",
+ }: endpoint{
+ Hostname: "s3-control.eu-central-2.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "eu-central-2",
+ },
+ },
+ endpointKey{
+ Region: "eu-central-2",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "s3-control.dualstack.eu-central-2.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "eu-central-2",
+ },
+ },
endpointKey{
Region: "eu-north-1",
}: endpoint{
@@ -26396,6 +28330,44 @@ var awsPartition = partition{
Region: "eu-north-1",
},
},
+ endpointKey{
+ Region: "eu-south-1",
+ }: endpoint{
+ Hostname: "s3-control.eu-south-1.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "eu-south-1",
+ },
+ },
+ endpointKey{
+ Region: "eu-south-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "s3-control.dualstack.eu-south-1.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "eu-south-1",
+ },
+ },
+ endpointKey{
+ Region: "eu-south-2",
+ }: endpoint{
+ Hostname: "s3-control.eu-south-2.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "eu-south-2",
+ },
+ },
+ endpointKey{
+ Region: "eu-south-2",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "s3-control.dualstack.eu-south-2.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "eu-south-2",
+ },
+ },
endpointKey{
Region: "eu-west-1",
}: endpoint{
@@ -26453,6 +28425,63 @@ var awsPartition = partition{
Region: "eu-west-3",
},
},
+ endpointKey{
+ Region: "il-central-1",
+ }: endpoint{
+ Hostname: "s3-control.il-central-1.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "il-central-1",
+ },
+ },
+ endpointKey{
+ Region: "il-central-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "s3-control.dualstack.il-central-1.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "il-central-1",
+ },
+ },
+ endpointKey{
+ Region: "me-central-1",
+ }: endpoint{
+ Hostname: "s3-control.me-central-1.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "me-central-1",
+ },
+ },
+ endpointKey{
+ Region: "me-central-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "s3-control.dualstack.me-central-1.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "me-central-1",
+ },
+ },
+ endpointKey{
+ Region: "me-south-1",
+ }: endpoint{
+ Hostname: "s3-control.me-south-1.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "me-south-1",
+ },
+ },
+ endpointKey{
+ Region: "me-south-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "s3-control.dualstack.me-south-1.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "me-south-1",
+ },
+ },
endpointKey{
Region: "sa-east-1",
}: endpoint{
@@ -27765,21 +29794,85 @@ var awsPartition = partition{
}: endpoint{
Protocols: []string{"https"},
},
+ endpointKey{
+ Region: "us-east-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "serverlessrepo-fips.us-east-1.amazonaws.com",
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "us-east-1-fips",
+ }: endpoint{
+ Hostname: "serverlessrepo-fips.us-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-1",
+ },
+ Deprecated: boxedTrue,
+ },
endpointKey{
Region: "us-east-2",
}: endpoint{
Protocols: []string{"https"},
},
+ endpointKey{
+ Region: "us-east-2",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "serverlessrepo-fips.us-east-2.amazonaws.com",
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "us-east-2-fips",
+ }: endpoint{
+ Hostname: "serverlessrepo-fips.us-east-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-2",
+ },
+ Deprecated: boxedTrue,
+ },
endpointKey{
Region: "us-west-1",
}: endpoint{
Protocols: []string{"https"},
},
+ endpointKey{
+ Region: "us-west-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "serverlessrepo-fips.us-west-1.amazonaws.com",
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "us-west-1-fips",
+ }: endpoint{
+ Hostname: "serverlessrepo-fips.us-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-1",
+ },
+ Deprecated: boxedTrue,
+ },
endpointKey{
Region: "us-west-2",
}: endpoint{
Protocols: []string{"https"},
},
+ endpointKey{
+ Region: "us-west-2",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "serverlessrepo-fips.us-west-2.amazonaws.com",
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "us-west-2-fips",
+ }: endpoint{
+ Hostname: "serverlessrepo-fips.us-west-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-2",
+ },
+ Deprecated: boxedTrue,
+ },
},
},
"servicecatalog": service{
@@ -28227,6 +30320,36 @@ var awsPartition = partition{
},
Deprecated: boxedTrue,
},
+ endpointKey{
+ Region: "ca-west-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "ca-west-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "servicediscovery.ca-west-1.api.aws",
+ },
+ endpointKey{
+ Region: "ca-west-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "servicediscovery-fips.ca-west-1.amazonaws.com",
+ },
+ endpointKey{
+ Region: "ca-west-1",
+ Variant: fipsVariant | dualStackVariant,
+ }: endpoint{
+ Hostname: "servicediscovery-fips.ca-west-1.api.aws",
+ },
+ endpointKey{
+ Region: "ca-west-1-fips",
+ }: endpoint{
+ Hostname: "servicediscovery-fips.ca-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-west-1",
+ },
+ Deprecated: boxedTrue,
+ },
endpointKey{
Region: "eu-central-1",
}: endpoint{},
@@ -29041,18 +31164,36 @@ var awsPartition = partition{
},
"sms-voice": service{
Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "af-south-1",
+ }: endpoint{},
endpointKey{
Region: "ap-northeast-1",
}: endpoint{},
+ endpointKey{
+ Region: "ap-northeast-2",
+ }: endpoint{},
+ endpointKey{
+ Region: "ap-northeast-3",
+ }: endpoint{},
endpointKey{
Region: "ap-south-1",
}: endpoint{},
+ endpointKey{
+ Region: "ap-south-2",
+ }: endpoint{},
endpointKey{
Region: "ap-southeast-1",
}: endpoint{},
endpointKey{
Region: "ap-southeast-2",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-3",
+ }: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
@@ -29062,15 +31203,33 @@ var awsPartition = partition{
}: endpoint{
Hostname: "sms-voice-fips.ca-central-1.amazonaws.com",
},
+ endpointKey{
+ Region: "ca-west-1",
+ }: endpoint{},
endpointKey{
Region: "eu-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-central-2",
+ }: endpoint{},
+ endpointKey{
+ Region: "eu-north-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "eu-south-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "eu-south-2",
+ }: endpoint{},
endpointKey{
Region: "eu-west-1",
}: endpoint{},
endpointKey{
Region: "eu-west-2",
}: endpoint{},
+ endpointKey{
+ Region: "eu-west-3",
+ }: endpoint{},
endpointKey{
Region: "fips-ca-central-1",
}: endpoint{
@@ -29089,6 +31248,24 @@ var awsPartition = partition{
},
Deprecated: boxedTrue,
},
+ endpointKey{
+ Region: "fips-us-east-2",
+ }: endpoint{
+ Hostname: "sms-voice-fips.us-east-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-2",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "fips-us-west-1",
+ }: endpoint{
+ Hostname: "sms-voice-fips.us-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-1",
+ },
+ Deprecated: boxedTrue,
+ },
endpointKey{
Region: "fips-us-west-2",
}: endpoint{
@@ -29098,6 +31275,18 @@ var awsPartition = partition{
},
Deprecated: boxedTrue,
},
+ endpointKey{
+ Region: "il-central-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "me-central-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "me-south-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "sa-east-1",
+ }: endpoint{},
endpointKey{
Region: "us-east-1",
}: endpoint{},
@@ -29107,6 +31296,24 @@ var awsPartition = partition{
}: endpoint{
Hostname: "sms-voice-fips.us-east-1.amazonaws.com",
},
+ endpointKey{
+ Region: "us-east-2",
+ }: endpoint{},
+ endpointKey{
+ Region: "us-east-2",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "sms-voice-fips.us-east-2.amazonaws.com",
+ },
+ endpointKey{
+ Region: "us-west-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "us-west-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "sms-voice-fips.us-west-1.amazonaws.com",
+ },
endpointKey{
Region: "us-west-2",
}: endpoint{},
@@ -29378,6 +31585,9 @@ var awsPartition = partition{
},
Deprecated: boxedTrue,
},
+ endpointKey{
+ Region: "il-central-1",
+ }: endpoint{},
endpointKey{
Region: "me-central-1",
}: endpoint{},
@@ -30344,6 +32554,9 @@ var awsPartition = partition{
endpointKey{
Region: "ap-south-1",
}: endpoint{},
+ endpointKey{
+ Region: "ap-south-2",
+ }: endpoint{},
endpointKey{
Region: "ap-southeast-1",
}: endpoint{},
@@ -30353,9 +32566,15 @@ var awsPartition = partition{
endpointKey{
Region: "ap-southeast-3",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-4",
+ }: endpoint{},
endpointKey{
Region: "ca-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "ca-west-1",
+ }: endpoint{},
endpointKey{
Region: "eu-central-1",
}: endpoint{},
@@ -30368,6 +32587,9 @@ var awsPartition = partition{
endpointKey{
Region: "eu-south-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-south-2",
+ }: endpoint{},
endpointKey{
Region: "eu-west-1",
}: endpoint{},
@@ -30607,6 +32829,24 @@ var awsPartition = partition{
},
Deprecated: boxedTrue,
},
+ endpointKey{
+ Region: "ca-west-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "ca-west-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "storagegateway-fips.ca-west-1.amazonaws.com",
+ },
+ endpointKey{
+ Region: "ca-west-1-fips",
+ }: endpoint{
+ Hostname: "storagegateway-fips.ca-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-west-1",
+ },
+ Deprecated: boxedTrue,
+ },
endpointKey{
Region: "eu-central-1",
}: endpoint{},
@@ -31404,41 +33644,115 @@ var awsPartition = partition{
}: endpoint{},
},
},
+ "tax": service{
+ PartitionEndpoint: "aws-global",
+ IsRegionalized: boxedFalse,
+ Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "aws-global",
+ }: endpoint{
+ Hostname: "tax.us-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-1",
+ },
+ },
+ },
+ },
"textract": service{
Endpoints: serviceEndpoints{
endpointKey{
Region: "ap-northeast-2",
}: endpoint{},
+ endpointKey{
+ Region: "ap-northeast-2",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "textract.ap-northeast-2.api.aws",
+ },
endpointKey{
Region: "ap-south-1",
}: endpoint{},
+ endpointKey{
+ Region: "ap-south-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "textract.ap-south-1.api.aws",
+ },
endpointKey{
Region: "ap-southeast-1",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "textract.ap-southeast-1.api.aws",
+ },
endpointKey{
Region: "ap-southeast-2",
}: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-2",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "textract.ap-southeast-2.api.aws",
+ },
endpointKey{
Region: "ca-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "ca-central-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "textract.ca-central-1.api.aws",
+ },
endpointKey{
Region: "ca-central-1",
Variant: fipsVariant,
}: endpoint{
Hostname: "textract-fips.ca-central-1.amazonaws.com",
},
+ endpointKey{
+ Region: "ca-central-1",
+ Variant: fipsVariant | dualStackVariant,
+ }: endpoint{
+ Hostname: "textract-fips.ca-central-1.api.aws",
+ },
endpointKey{
Region: "eu-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-central-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "textract.eu-central-1.api.aws",
+ },
endpointKey{
Region: "eu-west-1",
}: endpoint{},
+ endpointKey{
+ Region: "eu-west-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "textract.eu-west-1.api.aws",
+ },
endpointKey{
Region: "eu-west-2",
}: endpoint{},
+ endpointKey{
+ Region: "eu-west-2",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "textract.eu-west-2.api.aws",
+ },
endpointKey{
Region: "eu-west-3",
}: endpoint{},
+ endpointKey{
+ Region: "eu-west-3",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "textract.eu-west-3.api.aws",
+ },
endpointKey{
Region: "fips-ca-central-1",
}: endpoint{
@@ -31487,39 +33801,87 @@ var awsPartition = partition{
endpointKey{
Region: "us-east-1",
}: endpoint{},
+ endpointKey{
+ Region: "us-east-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "textract.us-east-1.api.aws",
+ },
endpointKey{
Region: "us-east-1",
Variant: fipsVariant,
}: endpoint{
Hostname: "textract-fips.us-east-1.amazonaws.com",
},
+ endpointKey{
+ Region: "us-east-1",
+ Variant: fipsVariant | dualStackVariant,
+ }: endpoint{
+ Hostname: "textract-fips.us-east-1.api.aws",
+ },
endpointKey{
Region: "us-east-2",
}: endpoint{},
+ endpointKey{
+ Region: "us-east-2",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "textract.us-east-2.api.aws",
+ },
endpointKey{
Region: "us-east-2",
Variant: fipsVariant,
}: endpoint{
Hostname: "textract-fips.us-east-2.amazonaws.com",
},
+ endpointKey{
+ Region: "us-east-2",
+ Variant: fipsVariant | dualStackVariant,
+ }: endpoint{
+ Hostname: "textract-fips.us-east-2.api.aws",
+ },
endpointKey{
Region: "us-west-1",
}: endpoint{},
+ endpointKey{
+ Region: "us-west-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "textract.us-west-1.api.aws",
+ },
endpointKey{
Region: "us-west-1",
Variant: fipsVariant,
}: endpoint{
Hostname: "textract-fips.us-west-1.amazonaws.com",
},
+ endpointKey{
+ Region: "us-west-1",
+ Variant: fipsVariant | dualStackVariant,
+ }: endpoint{
+ Hostname: "textract-fips.us-west-1.api.aws",
+ },
endpointKey{
Region: "us-west-2",
}: endpoint{},
+ endpointKey{
+ Region: "us-west-2",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "textract.us-west-2.api.aws",
+ },
endpointKey{
Region: "us-west-2",
Variant: fipsVariant,
}: endpoint{
Hostname: "textract-fips.us-west-2.amazonaws.com",
},
+ endpointKey{
+ Region: "us-west-2",
+ Variant: fipsVariant | dualStackVariant,
+ }: endpoint{
+ Hostname: "textract-fips.us-west-2.api.aws",
+ },
},
},
"thinclient": service{
@@ -31926,6 +34288,15 @@ var awsPartition = partition{
}: endpoint{
Hostname: "transfer-fips.ca-central-1.amazonaws.com",
},
+ endpointKey{
+ Region: "ca-west-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "ca-west-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "transfer-fips.ca-west-1.amazonaws.com",
+ },
endpointKey{
Region: "eu-central-1",
}: endpoint{},
@@ -31959,6 +34330,15 @@ var awsPartition = partition{
},
Deprecated: boxedTrue,
},
+ endpointKey{
+ Region: "fips-ca-west-1",
+ }: endpoint{
+ Hostname: "transfer-fips.ca-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-west-1",
+ },
+ Deprecated: boxedTrue,
+ },
endpointKey{
Region: "fips-us-east-1",
}: endpoint{
@@ -32127,6 +34507,21 @@ var awsPartition = partition{
endpointKey{
Region: "us-west-1",
}: endpoint{},
+ endpointKey{
+ Region: "us-west-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "translate-fips.us-west-1.amazonaws.com",
+ },
+ endpointKey{
+ Region: "us-west-1-fips",
+ }: endpoint{
+ Hostname: "translate-fips.us-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-1",
+ },
+ Deprecated: boxedTrue,
+ },
endpointKey{
Region: "us-west-2",
}: endpoint{},
@@ -32185,6 +34580,21 @@ var awsPartition = partition{
endpointKey{
Region: "ca-central-1",
}: endpoint{},
+ endpointKey{
+ Region: "ca-central-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "verifiedpermissions-fips.ca-central-1.amazonaws.com",
+ },
+ endpointKey{
+ Region: "ca-west-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "ca-west-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "verifiedpermissions-fips.ca-west-1.amazonaws.com",
+ },
endpointKey{
Region: "eu-central-1",
}: endpoint{},
@@ -32209,6 +34619,63 @@ var awsPartition = partition{
endpointKey{
Region: "eu-west-3",
}: endpoint{},
+ endpointKey{
+ Region: "fips-ca-central-1",
+ }: endpoint{
+ Hostname: "verifiedpermissions-fips.ca-central-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-central-1",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "fips-ca-west-1",
+ }: endpoint{
+ Hostname: "verifiedpermissions-fips.ca-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-west-1",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "fips-us-east-1",
+ }: endpoint{
+ Hostname: "verifiedpermissions-fips.us-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-1",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "fips-us-east-2",
+ }: endpoint{
+ Hostname: "verifiedpermissions-fips.us-east-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-2",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "fips-us-west-1",
+ }: endpoint{
+ Hostname: "verifiedpermissions-fips.us-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-1",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "fips-us-west-2",
+ }: endpoint{
+ Hostname: "verifiedpermissions-fips.us-west-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-2",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "il-central-1",
+ }: endpoint{},
endpointKey{
Region: "me-central-1",
}: endpoint{},
@@ -32221,15 +34688,39 @@ var awsPartition = partition{
endpointKey{
Region: "us-east-1",
}: endpoint{},
+ endpointKey{
+ Region: "us-east-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "verifiedpermissions-fips.us-east-1.amazonaws.com",
+ },
endpointKey{
Region: "us-east-2",
}: endpoint{},
+ endpointKey{
+ Region: "us-east-2",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "verifiedpermissions-fips.us-east-2.amazonaws.com",
+ },
endpointKey{
Region: "us-west-1",
}: endpoint{},
+ endpointKey{
+ Region: "us-west-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "verifiedpermissions-fips.us-west-1.amazonaws.com",
+ },
endpointKey{
Region: "us-west-2",
}: endpoint{},
+ endpointKey{
+ Region: "us-west-2",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "verifiedpermissions-fips.us-west-2.amazonaws.com",
+ },
},
},
"voice-chime": service{
@@ -32389,6 +34880,12 @@ var awsPartition = partition{
endpointKey{
Region: "ap-northeast-1",
}: endpoint{},
+ endpointKey{
+ Region: "ap-northeast-2",
+ }: endpoint{},
+ endpointKey{
+ Region: "ap-south-1",
+ }: endpoint{},
endpointKey{
Region: "ap-southeast-1",
}: endpoint{},
@@ -32410,12 +34907,21 @@ var awsPartition = partition{
endpointKey{
Region: "eu-west-2",
}: endpoint{},
+ endpointKey{
+ Region: "eu-west-3",
+ }: endpoint{},
+ endpointKey{
+ Region: "sa-east-1",
+ }: endpoint{},
endpointKey{
Region: "us-east-1",
}: endpoint{},
endpointKey{
Region: "us-east-2",
}: endpoint{},
+ endpointKey{
+ Region: "us-west-1",
+ }: endpoint{},
endpointKey{
Region: "us-west-2",
}: endpoint{},
@@ -33418,6 +35924,23 @@ var awsPartition = partition{
Region: "ca-central-1",
},
},
+ endpointKey{
+ Region: "ca-west-1",
+ }: endpoint{
+ Hostname: "wafv2.ca-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-west-1",
+ },
+ },
+ endpointKey{
+ Region: "ca-west-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "wafv2-fips.ca-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-west-1",
+ },
+ },
endpointKey{
Region: "eu-central-1",
}: endpoint{
@@ -33662,6 +36185,15 @@ var awsPartition = partition{
},
Deprecated: boxedTrue,
},
+ endpointKey{
+ Region: "fips-ca-west-1",
+ }: endpoint{
+ Hostname: "wafv2-fips.ca-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-west-1",
+ },
+ Deprecated: boxedTrue,
+ },
endpointKey{
Region: "fips-eu-central-1",
}: endpoint{
@@ -34007,9 +36539,18 @@ var awsPartition = partition{
endpointKey{
Region: "ap-northeast-1",
}: endpoint{},
+ endpointKey{
+ Region: "ap-northeast-2",
+ }: endpoint{},
+ endpointKey{
+ Region: "ap-southeast-1",
+ }: endpoint{},
endpointKey{
Region: "ap-southeast-2",
}: endpoint{},
+ endpointKey{
+ Region: "ca-central-1",
+ }: endpoint{},
endpointKey{
Region: "eu-central-1",
}: endpoint{},
@@ -34031,9 +36572,18 @@ var awsPartition = partition{
endpointKey{
Region: "ui-ap-northeast-1",
}: endpoint{},
+ endpointKey{
+ Region: "ui-ap-northeast-2",
+ }: endpoint{},
+ endpointKey{
+ Region: "ui-ap-southeast-1",
+ }: endpoint{},
endpointKey{
Region: "ui-ap-southeast-2",
}: endpoint{},
+ endpointKey{
+ Region: "ui-ca-central-1",
+ }: endpoint{},
endpointKey{
Region: "ui-eu-central-1",
}: endpoint{},
@@ -34485,6 +37035,21 @@ var awscnPartition = partition{
}: endpoint{},
},
},
+ "acm-pca": service{
+ Defaults: endpointDefaults{
+ defaultKey{}: endpoint{
+ Protocols: []string{"https"},
+ },
+ },
+ Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "cn-north-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "cn-northwest-1",
+ }: endpoint{},
+ },
+ },
"airflow": service{
Endpoints: serviceEndpoints{
endpointKey{
@@ -34708,16 +37273,6 @@ var awscnPartition = partition{
}: endpoint{},
},
},
- "backupstorage": service{
- Endpoints: serviceEndpoints{
- endpointKey{
- Region: "cn-north-1",
- }: endpoint{},
- endpointKey{
- Region: "cn-northwest-1",
- }: endpoint{},
- },
- },
"batch": service{
Endpoints: serviceEndpoints{
endpointKey{
@@ -34771,9 +37326,21 @@ var awscnPartition = partition{
endpointKey{
Region: "cn-north-1",
}: endpoint{},
+ endpointKey{
+ Region: "cn-north-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi.cn-north-1.api.amazonwebservices.com.cn",
+ },
endpointKey{
Region: "cn-northwest-1",
}: endpoint{},
+ endpointKey{
+ Region: "cn-northwest-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi.cn-northwest-1.api.amazonwebservices.com.cn",
+ },
},
},
"cloudformation": service{
@@ -35245,6 +37812,19 @@ var awscnPartition = partition{
}: endpoint{},
},
},
+ "entitlement.marketplace": service{
+ Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "cn-northwest-1",
+ }: endpoint{
+ Hostname: "entitlement-marketplace.cn-northwest-1.amazonaws.com.cn",
+ Protocols: []string{"https"},
+ CredentialScope: credentialScope{
+ Region: "cn-northwest-1",
+ },
+ },
+ },
+ },
"es": service{
Endpoints: serviceEndpoints{
endpointKey{
@@ -35432,6 +38012,16 @@ var awscnPartition = partition{
}: endpoint{},
},
},
+ "inspector2": service{
+ Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "cn-north-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "cn-northwest-1",
+ }: endpoint{},
+ },
+ },
"internetmonitor": service{
Defaults: endpointDefaults{
defaultKey{}: endpoint{
@@ -35672,7 +38262,7 @@ var awscnPartition = partition{
endpointKey{
Region: "cn-northwest-1",
}: endpoint{
- Hostname: "subscribe.mediaconvert.cn-northwest-1.amazonaws.com.cn",
+ Hostname: "mediaconvert.cn-northwest-1.amazonaws.com.cn",
CredentialScope: credentialScope{
Region: "cn-northwest-1",
},
@@ -35744,6 +38334,16 @@ var awscnPartition = partition{
},
},
},
+ "network-firewall": service{
+ Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "cn-north-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "cn-northwest-1",
+ }: endpoint{},
+ },
+ },
"oam": service{
Endpoints: serviceEndpoints{
endpointKey{
@@ -35799,10 +38399,28 @@ var awscnPartition = partition{
Endpoints: serviceEndpoints{
endpointKey{
Region: "cn-north-1",
- }: endpoint{},
+ }: endpoint{
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "cn-north-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "pi.cn-north-1.api.amazonwebservices.com.cn",
+ Protocols: []string{"https"},
+ },
endpointKey{
Region: "cn-northwest-1",
- }: endpoint{},
+ }: endpoint{
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "cn-northwest-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "pi.cn-northwest-1.api.amazonwebservices.com.cn",
+ Protocols: []string{"https"},
+ },
},
},
"pipes": service{
@@ -35867,6 +38485,13 @@ var awscnPartition = partition{
},
},
},
+ "quicksight": service{
+ Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "cn-north-1",
+ }: endpoint{},
+ },
+ },
"ram": service{
Endpoints: serviceEndpoints{
endpointKey{
@@ -35912,31 +38537,9 @@ var awscnPartition = partition{
endpointKey{
Region: "cn-north-1",
}: endpoint{},
- },
- },
- "resource-explorer-2": service{
- Defaults: endpointDefaults{
- defaultKey{}: endpoint{
- DNSSuffix: "api.amazonwebservices.com.cn",
- },
- defaultKey{
- Variant: fipsVariant,
- }: endpoint{
- Hostname: "{service}-fips.{region}.{dnsSuffix}",
- DNSSuffix: "api.amazonwebservices.com.cn",
- },
- },
- Endpoints: serviceEndpoints{
- endpointKey{
- Region: "cn-north-1",
- }: endpoint{
- Hostname: "resource-explorer-2.cn-north-1.api.amazonwebservices.com.cn",
- },
endpointKey{
Region: "cn-northwest-1",
- }: endpoint{
- Hostname: "resource-explorer-2.cn-northwest-1.api.amazonwebservices.com.cn",
- },
+ }: endpoint{},
},
},
"resource-groups": service{
@@ -37407,13 +40010,37 @@ var awsusgovPartition = partition{
Endpoints: serviceEndpoints{
endpointKey{
Region: "us-gov-east-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "us-gov-east-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "autoscaling-plans.us-gov-east-1.amazonaws.com",
+ },
+ endpointKey{
+ Region: "us-gov-east-1-fips",
}: endpoint{
+ Hostname: "autoscaling-plans.us-gov-east-1.amazonaws.com",
Protocols: []string{"http", "https"},
+
+ Deprecated: boxedTrue,
},
endpointKey{
Region: "us-gov-west-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "us-gov-west-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "autoscaling-plans.us-gov-west-1.amazonaws.com",
+ },
+ endpointKey{
+ Region: "us-gov-west-1-fips",
}: endpoint{
+ Hostname: "autoscaling-plans.us-gov-west-1.amazonaws.com",
Protocols: []string{"http", "https"},
+
+ Deprecated: boxedTrue,
},
},
},
@@ -37437,16 +40064,6 @@ var awsusgovPartition = partition{
}: endpoint{},
},
},
- "backupstorage": service{
- Endpoints: serviceEndpoints{
- endpointKey{
- Region: "us-gov-east-1",
- }: endpoint{},
- endpointKey{
- Region: "us-gov-west-1",
- }: endpoint{},
- },
- },
"batch": service{
Defaults: endpointDefaults{
defaultKey{}: endpoint{},
@@ -37497,6 +40114,38 @@ var awsusgovPartition = partition{
},
"bedrock": service{
Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "bedrock-fips-us-gov-west-1",
+ }: endpoint{
+ Hostname: "bedrock-fips.us-gov-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-west-1",
+ },
+ },
+ endpointKey{
+ Region: "bedrock-runtime-fips-us-gov-west-1",
+ }: endpoint{
+ Hostname: "bedrock-runtime-fips.us-gov-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-west-1",
+ },
+ },
+ endpointKey{
+ Region: "bedrock-runtime-us-gov-west-1",
+ }: endpoint{
+ Hostname: "bedrock-runtime.us-gov-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-west-1",
+ },
+ },
+ endpointKey{
+ Region: "bedrock-us-gov-west-1",
+ }: endpoint{
+ Hostname: "bedrock.us-gov-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-west-1",
+ },
+ },
endpointKey{
Region: "us-gov-west-1",
}: endpoint{},
@@ -37581,21 +40230,45 @@ var awsusgovPartition = partition{
endpointKey{
Region: "us-gov-east-1",
}: endpoint{},
+ endpointKey{
+ Region: "us-gov-east-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi.us-gov-east-1.api.aws",
+ },
endpointKey{
Region: "us-gov-east-1",
Variant: fipsVariant,
}: endpoint{
Hostname: "cloudcontrolapi-fips.us-gov-east-1.amazonaws.com",
},
+ endpointKey{
+ Region: "us-gov-east-1",
+ Variant: fipsVariant | dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi-fips.us-gov-east-1.api.aws",
+ },
endpointKey{
Region: "us-gov-west-1",
}: endpoint{},
+ endpointKey{
+ Region: "us-gov-west-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi.us-gov-west-1.api.aws",
+ },
endpointKey{
Region: "us-gov-west-1",
Variant: fipsVariant,
}: endpoint{
Hostname: "cloudcontrolapi-fips.us-gov-west-1.amazonaws.com",
},
+ endpointKey{
+ Region: "us-gov-west-1",
+ Variant: fipsVariant | dualStackVariant,
+ }: endpoint{
+ Hostname: "cloudcontrolapi-fips.us-gov-west-1.api.aws",
+ },
},
},
"clouddirectory": service{
@@ -38112,9 +40785,39 @@ var awsusgovPartition = partition{
endpointKey{
Region: "us-gov-east-1",
}: endpoint{},
+ endpointKey{
+ Region: "us-gov-east-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "controltower-fips.us-gov-east-1.amazonaws.com",
+ },
+ endpointKey{
+ Region: "us-gov-east-1-fips",
+ }: endpoint{
+ Hostname: "controltower-fips.us-gov-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-east-1",
+ },
+ Deprecated: boxedTrue,
+ },
endpointKey{
Region: "us-gov-west-1",
}: endpoint{},
+ endpointKey{
+ Region: "us-gov-west-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "controltower-fips.us-gov-west-1.amazonaws.com",
+ },
+ endpointKey{
+ Region: "us-gov-west-1-fips",
+ }: endpoint{
+ Hostname: "controltower-fips.us-gov-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-west-1",
+ },
+ Deprecated: boxedTrue,
+ },
},
},
"data-ats.iot": service{
@@ -38295,20 +40998,40 @@ var awsusgovPartition = partition{
"directconnect": service{
Endpoints: serviceEndpoints{
endpointKey{
- Region: "us-gov-east-1",
+ Region: "fips-us-gov-east-1",
}: endpoint{
- Hostname: "directconnect.us-gov-east-1.amazonaws.com",
+ Hostname: "directconnect-fips.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
+ Deprecated: boxedTrue,
},
endpointKey{
- Region: "us-gov-west-1",
+ Region: "fips-us-gov-west-1",
}: endpoint{
- Hostname: "directconnect.us-gov-west-1.amazonaws.com",
+ Hostname: "directconnect-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "us-gov-east-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "us-gov-east-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "directconnect-fips.us-gov-east-1.amazonaws.com",
+ },
+ endpointKey{
+ Region: "us-gov-west-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "us-gov-west-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "directconnect-fips.us-gov-west-1.amazonaws.com",
},
},
},
@@ -38994,6 +41717,15 @@ var awsusgovPartition = partition{
},
"email": service{
Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "fips-us-gov-east-1",
+ }: endpoint{
+ Hostname: "email-fips.us-gov-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-east-1",
+ },
+ Deprecated: boxedTrue,
+ },
endpointKey{
Region: "fips-us-gov-west-1",
}: endpoint{
@@ -39003,6 +41735,15 @@ var awsusgovPartition = partition{
},
Deprecated: boxedTrue,
},
+ endpointKey{
+ Region: "us-gov-east-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "us-gov-east-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "email-fips.us-gov-east-1.amazonaws.com",
+ },
endpointKey{
Region: "us-gov-west-1",
}: endpoint{},
@@ -39016,12 +41757,82 @@ var awsusgovPartition = partition{
},
"emr-containers": service{
Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "fips-us-gov-east-1",
+ }: endpoint{
+ Hostname: "emr-containers.us-gov-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-east-1",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "fips-us-gov-west-1",
+ }: endpoint{
+ Hostname: "emr-containers.us-gov-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-west-1",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "us-gov-east-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "us-gov-east-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "emr-containers.us-gov-east-1.amazonaws.com",
+ },
+ endpointKey{
+ Region: "us-gov-west-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "us-gov-west-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "emr-containers.us-gov-west-1.amazonaws.com",
+ },
+ },
+ },
+ "emr-serverless": service{
+ Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "fips-us-gov-east-1",
+ }: endpoint{
+ Hostname: "emr-serverless.us-gov-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-east-1",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "fips-us-gov-west-1",
+ }: endpoint{
+ Hostname: "emr-serverless.us-gov-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-west-1",
+ },
+ Deprecated: boxedTrue,
+ },
endpointKey{
Region: "us-gov-east-1",
}: endpoint{},
+ endpointKey{
+ Region: "us-gov-east-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "emr-serverless.us-gov-east-1.amazonaws.com",
+ },
endpointKey{
Region: "us-gov-west-1",
}: endpoint{},
+ endpointKey{
+ Region: "us-gov-west-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "emr-serverless.us-gov-west-1.amazonaws.com",
+ },
},
},
"es": service{
@@ -40207,6 +43018,62 @@ var awsusgovPartition = partition{
}: endpoint{},
},
},
+ "kinesisvideo": service{
+ Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "fips-us-gov-east-1",
+ }: endpoint{
+ Hostname: "kinesisvideo-fips.us-gov-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-east-1",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "fips-us-gov-west-1",
+ }: endpoint{
+ Hostname: "kinesisvideo-fips.us-gov-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-west-1",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "us-gov-east-1",
+ }: endpoint{
+ Hostname: "kinesisvideo-fips.us-gov-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-east-1",
+ },
+ },
+ endpointKey{
+ Region: "us-gov-east-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "kinesisvideo-fips.us-gov-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-east-1",
+ },
+ },
+ endpointKey{
+ Region: "us-gov-west-1",
+ }: endpoint{
+ Hostname: "kinesisvideo-fips.us-gov-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-west-1",
+ },
+ },
+ endpointKey{
+ Region: "us-gov-west-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "kinesisvideo-fips.us-gov-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-west-1",
+ },
+ },
+ },
+ },
"kms": service{
Endpoints: serviceEndpoints{
endpointKey{
@@ -40422,6 +43289,16 @@ var awsusgovPartition = partition{
}: endpoint{},
},
},
+ "license-manager-user-subscriptions": service{
+ Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "us-gov-east-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "us-gov-west-1",
+ }: endpoint{},
+ },
+ },
"logs": service{
Endpoints: serviceEndpoints{
endpointKey{
@@ -40628,6 +43505,13 @@ var awsusgovPartition = partition{
},
},
},
+ "models-v2-lex": service{
+ Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "us-gov-west-1",
+ }: endpoint{},
+ },
+ },
"models.lex": service{
Defaults: endpointDefaults{
defaultKey{}: endpoint{
@@ -40961,12 +43845,76 @@ var awsusgovPartition = partition{
},
"pi": service{
Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "fips-us-gov-east-1",
+ }: endpoint{
+ Hostname: "pi-fips.us-gov-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-east-1",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "fips-us-gov-west-1",
+ }: endpoint{
+ Hostname: "pi-fips.us-gov-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-west-1",
+ },
+ Deprecated: boxedTrue,
+ },
endpointKey{
Region: "us-gov-east-1",
- }: endpoint{},
+ }: endpoint{
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "us-gov-east-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "pi.us-gov-east-1.api.aws",
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "us-gov-east-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "pi-fips.us-gov-east-1.amazonaws.com",
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "us-gov-east-1",
+ Variant: fipsVariant | dualStackVariant,
+ }: endpoint{
+ Hostname: "pi-fips.us-gov-east-1.api.aws",
+ Protocols: []string{"https"},
+ },
endpointKey{
Region: "us-gov-west-1",
- }: endpoint{},
+ }: endpoint{
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "us-gov-west-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "pi.us-gov-west-1.api.aws",
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "us-gov-west-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "pi-fips.us-gov-west-1.amazonaws.com",
+ Protocols: []string{"https"},
+ },
+ endpointKey{
+ Region: "us-gov-west-1",
+ Variant: fipsVariant | dualStackVariant,
+ }: endpoint{
+ Hostname: "pi-fips.us-gov-west-1.api.aws",
+ Protocols: []string{"https"},
+ },
},
},
"pinpoint": service{
@@ -41354,31 +44302,6 @@ var awsusgovPartition = partition{
},
},
},
- "resource-explorer-2": service{
- Defaults: endpointDefaults{
- defaultKey{}: endpoint{
- DNSSuffix: "api.aws",
- },
- defaultKey{
- Variant: fipsVariant,
- }: endpoint{
- Hostname: "{service}-fips.{region}.{dnsSuffix}",
- DNSSuffix: "api.aws",
- },
- },
- Endpoints: serviceEndpoints{
- endpointKey{
- Region: "us-gov-east-1",
- }: endpoint{
- Hostname: "resource-explorer-2.us-gov-east-1.api.aws",
- },
- endpointKey{
- Region: "us-gov-west-1",
- }: endpoint{
- Hostname: "resource-explorer-2.us-gov-west-1.api.aws",
- },
- },
- },
"resource-groups": service{
Defaults: endpointDefaults{
defaultKey{}: endpoint{},
@@ -41542,6 +44465,13 @@ var awsusgovPartition = partition{
},
},
},
+ "runtime-v2-lex": service{
+ Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "us-gov-west-1",
+ }: endpoint{},
+ },
+ },
"runtime.lex": service{
Defaults: endpointDefaults{
defaultKey{}: endpoint{
@@ -41949,6 +44879,46 @@ var awsusgovPartition = partition{
},
},
},
+ "securitylake": service{
+ Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "us-gov-east-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "us-gov-east-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "securitylake.us-gov-east-1.amazonaws.com",
+ },
+ endpointKey{
+ Region: "us-gov-east-1-fips",
+ }: endpoint{
+ Hostname: "securitylake.us-gov-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-east-1",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "us-gov-west-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "us-gov-west-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "securitylake.us-gov-west-1.amazonaws.com",
+ },
+ endpointKey{
+ Region: "us-gov-west-1-fips",
+ }: endpoint{
+ Hostname: "securitylake.us-gov-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-west-1",
+ },
+ Deprecated: boxedTrue,
+ },
+ },
+ },
"serverlessrepo": service{
Defaults: endpointDefaults{
defaultKey{}: endpoint{
@@ -42200,6 +45170,78 @@ var awsusgovPartition = partition{
},
},
},
+ "signer": service{
+ Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "fips-us-gov-east-1",
+ }: endpoint{
+ Hostname: "signer-fips.us-gov-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-east-1",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "fips-us-gov-west-1",
+ }: endpoint{
+ Hostname: "signer-fips.us-gov-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-west-1",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "fips-verification-us-gov-east-1",
+ }: endpoint{
+ Hostname: "verification.signer-fips.us-gov-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-east-1",
+ },
+ },
+ endpointKey{
+ Region: "fips-verification-us-gov-west-1",
+ }: endpoint{
+ Hostname: "verification.signer-fips.us-gov-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-west-1",
+ },
+ },
+ endpointKey{
+ Region: "us-gov-east-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "us-gov-east-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "signer-fips.us-gov-east-1.amazonaws.com",
+ },
+ endpointKey{
+ Region: "us-gov-west-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "us-gov-west-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "signer-fips.us-gov-west-1.amazonaws.com",
+ },
+ endpointKey{
+ Region: "verification-us-gov-east-1",
+ }: endpoint{
+ Hostname: "verification.signer.us-gov-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-east-1",
+ },
+ },
+ endpointKey{
+ Region: "verification-us-gov-west-1",
+ }: endpoint{
+ Hostname: "verification.signer.us-gov-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-west-1",
+ },
+ },
+ },
+ },
"simspaceweaver": service{
Endpoints: serviceEndpoints{
endpointKey{
@@ -42264,6 +45306,15 @@ var awsusgovPartition = partition{
},
"sms-voice": service{
Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "fips-us-gov-east-1",
+ }: endpoint{
+ Hostname: "sms-voice-fips.us-gov-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-east-1",
+ },
+ Deprecated: boxedTrue,
+ },
endpointKey{
Region: "fips-us-gov-west-1",
}: endpoint{
@@ -42273,6 +45324,15 @@ var awsusgovPartition = partition{
},
Deprecated: boxedTrue,
},
+ endpointKey{
+ Region: "us-gov-east-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "us-gov-east-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "sms-voice-fips.us-gov-east-1.amazonaws.com",
+ },
endpointKey{
Region: "us-gov-west-1",
}: endpoint{},
@@ -42862,21 +45922,45 @@ var awsusgovPartition = partition{
endpointKey{
Region: "us-gov-east-1",
}: endpoint{},
+ endpointKey{
+ Region: "us-gov-east-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "textract.us-gov-east-1.api.aws",
+ },
endpointKey{
Region: "us-gov-east-1",
Variant: fipsVariant,
}: endpoint{
Hostname: "textract-fips.us-gov-east-1.amazonaws.com",
},
+ endpointKey{
+ Region: "us-gov-east-1",
+ Variant: fipsVariant | dualStackVariant,
+ }: endpoint{
+ Hostname: "textract-fips.us-gov-east-1.api.aws",
+ },
endpointKey{
Region: "us-gov-west-1",
}: endpoint{},
+ endpointKey{
+ Region: "us-gov-west-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "textract.us-gov-west-1.api.aws",
+ },
endpointKey{
Region: "us-gov-west-1",
Variant: fipsVariant,
}: endpoint{
Hostname: "textract-fips.us-gov-west-1.amazonaws.com",
},
+ endpointKey{
+ Region: "us-gov-west-1",
+ Variant: fipsVariant | dualStackVariant,
+ }: endpoint{
+ Hostname: "textract-fips.us-gov-west-1.api.aws",
+ },
},
},
"transcribe": service{
@@ -43007,6 +46091,46 @@ var awsusgovPartition = partition{
},
},
},
+ "verifiedpermissions": service{
+ Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "fips-us-gov-east-1",
+ }: endpoint{
+ Hostname: "verifiedpermissions-fips.us-gov-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-east-1",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "fips-us-gov-west-1",
+ }: endpoint{
+ Hostname: "verifiedpermissions-fips.us-gov-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-west-1",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "us-gov-east-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "us-gov-east-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "verifiedpermissions-fips.us-gov-east-1.amazonaws.com",
+ },
+ endpointKey{
+ Region: "us-gov-west-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "us-gov-west-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "verifiedpermissions-fips.us-gov-west-1.amazonaws.com",
+ },
+ },
+ },
"waf-regional": service{
Endpoints: serviceEndpoints{
endpointKey{
@@ -43271,6 +46395,20 @@ var awsisoPartition = partition{
},
},
},
+ "api.pricing": service{
+ Defaults: endpointDefaults{
+ defaultKey{}: endpoint{
+ CredentialScope: credentialScope{
+ Service: "pricing",
+ },
+ },
+ },
+ Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "us-iso-east-1",
+ }: endpoint{},
+ },
+ },
"api.sagemaker": service{
Endpoints: serviceEndpoints{
endpointKey{
@@ -43283,6 +46421,9 @@ var awsisoPartition = partition{
endpointKey{
Region: "us-iso-east-1",
}: endpoint{},
+ endpointKey{
+ Region: "us-iso-west-1",
+ }: endpoint{},
},
},
"appconfig": service{
@@ -43320,6 +46461,16 @@ var awsisoPartition = partition{
}: endpoint{},
},
},
+ "arc-zonal-shift": service{
+ Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "us-iso-east-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "us-iso-west-1",
+ }: endpoint{},
+ },
+ },
"athena": service{
Endpoints: serviceEndpoints{
endpointKey{
@@ -43410,6 +46561,15 @@ var awsisoPartition = partition{
},
"datasync": service{
Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "fips-us-iso-east-1",
+ }: endpoint{
+ Hostname: "datasync-fips.us-iso-east-1.c2s.ic.gov",
+ CredentialScope: credentialScope{
+ Region: "us-iso-east-1",
+ },
+ Deprecated: boxedTrue,
+ },
endpointKey{
Region: "fips-us-iso-west-1",
}: endpoint{
@@ -43419,6 +46579,15 @@ var awsisoPartition = partition{
},
Deprecated: boxedTrue,
},
+ endpointKey{
+ Region: "us-iso-east-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "us-iso-east-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "datasync-fips.us-iso-east-1.c2s.ic.gov",
+ },
endpointKey{
Region: "us-iso-west-1",
}: endpoint{},
@@ -43727,6 +46896,55 @@ var awsisoPartition = partition{
}: endpoint{},
},
},
+ "fsx": service{
+ Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "fips-prod-us-iso-east-1",
+ }: endpoint{
+ Hostname: "fsx-fips.us-iso-east-1.c2s.ic.gov",
+ CredentialScope: credentialScope{
+ Region: "us-iso-east-1",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "fips-us-iso-east-1",
+ }: endpoint{
+ Hostname: "fsx-fips.us-iso-east-1.c2s.ic.gov",
+ CredentialScope: credentialScope{
+ Region: "us-iso-east-1",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "prod-us-iso-east-1",
+ }: endpoint{
+ CredentialScope: credentialScope{
+ Region: "us-iso-east-1",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "prod-us-iso-east-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "fsx-fips.us-iso-east-1.c2s.ic.gov",
+ CredentialScope: credentialScope{
+ Region: "us-iso-east-1",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "us-iso-east-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "us-iso-east-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "fsx-fips.us-iso-east-1.c2s.ic.gov",
+ },
+ },
+ },
"glacier": service{
Endpoints: serviceEndpoints{
endpointKey{
@@ -43909,42 +47127,12 @@ var awsisoPartition = partition{
},
"ram": service{
Endpoints: serviceEndpoints{
- endpointKey{
- Region: "fips-us-iso-east-1",
- }: endpoint{
- Hostname: "ram-fips.us-iso-east-1.c2s.ic.gov",
- CredentialScope: credentialScope{
- Region: "us-iso-east-1",
- },
- Deprecated: boxedTrue,
- },
- endpointKey{
- Region: "fips-us-iso-west-1",
- }: endpoint{
- Hostname: "ram-fips.us-iso-west-1.c2s.ic.gov",
- CredentialScope: credentialScope{
- Region: "us-iso-west-1",
- },
- Deprecated: boxedTrue,
- },
endpointKey{
Region: "us-iso-east-1",
}: endpoint{},
- endpointKey{
- Region: "us-iso-east-1",
- Variant: fipsVariant,
- }: endpoint{
- Hostname: "ram-fips.us-iso-east-1.c2s.ic.gov",
- },
endpointKey{
Region: "us-iso-west-1",
}: endpoint{},
- endpointKey{
- Region: "us-iso-west-1",
- Variant: fipsVariant,
- }: endpoint{
- Hostname: "ram-fips.us-iso-west-1.c2s.ic.gov",
- },
},
},
"rbin": service{
@@ -43989,37 +47177,10 @@ var awsisoPartition = partition{
},
"rds": service{
Endpoints: serviceEndpoints{
- endpointKey{
- Region: "rds-fips.us-iso-east-1",
- }: endpoint{
- Hostname: "rds-fips.us-iso-east-1.c2s.ic.gov",
- CredentialScope: credentialScope{
- Region: "us-iso-east-1",
- },
- Deprecated: boxedTrue,
- },
- endpointKey{
- Region: "rds-fips.us-iso-west-1",
- }: endpoint{
- Hostname: "rds-fips.us-iso-west-1.c2s.ic.gov",
- CredentialScope: credentialScope{
- Region: "us-iso-west-1",
- },
- Deprecated: boxedTrue,
- },
endpointKey{
Region: "rds.us-iso-east-1",
}: endpoint{
- CredentialScope: credentialScope{
- Region: "us-iso-east-1",
- },
- Deprecated: boxedTrue,
- },
- endpointKey{
- Region: "rds.us-iso-east-1",
- Variant: fipsVariant,
- }: endpoint{
- Hostname: "rds-fips.us-iso-east-1.c2s.ic.gov",
+ Hostname: "rds.us-iso-east-1.c2s.ic.gov",
CredentialScope: credentialScope{
Region: "us-iso-east-1",
},
@@ -44028,16 +47189,7 @@ var awsisoPartition = partition{
endpointKey{
Region: "rds.us-iso-west-1",
}: endpoint{
- CredentialScope: credentialScope{
- Region: "us-iso-west-1",
- },
- Deprecated: boxedTrue,
- },
- endpointKey{
- Region: "rds.us-iso-west-1",
- Variant: fipsVariant,
- }: endpoint{
- Hostname: "rds-fips.us-iso-west-1.c2s.ic.gov",
+ Hostname: "rds.us-iso-west-1.c2s.ic.gov",
CredentialScope: credentialScope{
Region: "us-iso-west-1",
},
@@ -44050,12 +47202,12 @@ var awsisoPartition = partition{
Region: "us-iso-east-1",
Variant: fipsVariant,
}: endpoint{
- Hostname: "rds-fips.us-iso-east-1.c2s.ic.gov",
+ Hostname: "rds.us-iso-east-1.c2s.ic.gov",
},
endpointKey{
Region: "us-iso-east-1-fips",
}: endpoint{
- Hostname: "rds-fips.us-iso-east-1.c2s.ic.gov",
+ Hostname: "rds.us-iso-east-1.c2s.ic.gov",
CredentialScope: credentialScope{
Region: "us-iso-east-1",
},
@@ -44068,12 +47220,12 @@ var awsisoPartition = partition{
Region: "us-iso-west-1",
Variant: fipsVariant,
}: endpoint{
- Hostname: "rds-fips.us-iso-west-1.c2s.ic.gov",
+ Hostname: "rds.us-iso-west-1.c2s.ic.gov",
},
endpointKey{
Region: "us-iso-west-1-fips",
}: endpoint{
- Hostname: "rds-fips.us-iso-west-1.c2s.ic.gov",
+ Hostname: "rds.us-iso-west-1.c2s.ic.gov",
CredentialScope: credentialScope{
Region: "us-iso-west-1",
},
@@ -44084,40 +47236,20 @@ var awsisoPartition = partition{
"redshift": service{
Endpoints: serviceEndpoints{
endpointKey{
- Region: "fips-us-iso-east-1",
+ Region: "us-iso-east-1",
}: endpoint{
- Hostname: "redshift-fips.us-iso-east-1.c2s.ic.gov",
+ Hostname: "redshift.us-iso-east-1.c2s.ic.gov",
CredentialScope: credentialScope{
Region: "us-iso-east-1",
},
- Deprecated: boxedTrue,
},
endpointKey{
- Region: "fips-us-iso-west-1",
+ Region: "us-iso-west-1",
}: endpoint{
- Hostname: "redshift-fips.us-iso-west-1.c2s.ic.gov",
+ Hostname: "redshift.us-iso-west-1.c2s.ic.gov",
CredentialScope: credentialScope{
Region: "us-iso-west-1",
},
- Deprecated: boxedTrue,
- },
- endpointKey{
- Region: "us-iso-east-1",
- }: endpoint{},
- endpointKey{
- Region: "us-iso-east-1",
- Variant: fipsVariant,
- }: endpoint{
- Hostname: "redshift-fips.us-iso-east-1.c2s.ic.gov",
- },
- endpointKey{
- Region: "us-iso-west-1",
- }: endpoint{},
- endpointKey{
- Region: "us-iso-west-1",
- Variant: fipsVariant,
- }: endpoint{
- Hostname: "redshift-fips.us-iso-west-1.c2s.ic.gov",
},
},
},
@@ -44226,6 +47358,131 @@ var awsisoPartition = partition{
},
},
},
+ "s3-control": service{
+ Defaults: endpointDefaults{
+ defaultKey{}: endpoint{
+ Protocols: []string{"https"},
+ SignatureVersions: []string{"s3v4"},
+ },
+ },
+ Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "us-iso-east-1",
+ }: endpoint{
+ Hostname: "s3-control.us-iso-east-1.c2s.ic.gov",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "us-iso-east-1",
+ },
+ },
+ endpointKey{
+ Region: "us-iso-east-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "s3-control.dualstack.us-iso-east-1.c2s.ic.gov",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "us-iso-east-1",
+ },
+ },
+ endpointKey{
+ Region: "us-iso-east-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "s3-control-fips.us-iso-east-1.c2s.ic.gov",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "us-iso-east-1",
+ },
+ },
+ endpointKey{
+ Region: "us-iso-east-1",
+ Variant: fipsVariant | dualStackVariant,
+ }: endpoint{
+ Hostname: "s3-control-fips.dualstack.us-iso-east-1.c2s.ic.gov",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "us-iso-east-1",
+ },
+ },
+ endpointKey{
+ Region: "us-iso-east-1-fips",
+ }: endpoint{
+ Hostname: "s3-control-fips.us-iso-east-1.c2s.ic.gov",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "us-iso-east-1",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "us-iso-west-1",
+ }: endpoint{
+ Hostname: "s3-control.us-iso-west-1.c2s.ic.gov",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "us-iso-west-1",
+ },
+ },
+ endpointKey{
+ Region: "us-iso-west-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "s3-control.dualstack.us-iso-west-1.c2s.ic.gov",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "us-iso-west-1",
+ },
+ },
+ endpointKey{
+ Region: "us-iso-west-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "s3-control-fips.us-iso-west-1.c2s.ic.gov",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "us-iso-west-1",
+ },
+ },
+ endpointKey{
+ Region: "us-iso-west-1",
+ Variant: fipsVariant | dualStackVariant,
+ }: endpoint{
+ Hostname: "s3-control-fips.dualstack.us-iso-west-1.c2s.ic.gov",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "us-iso-west-1",
+ },
+ },
+ endpointKey{
+ Region: "us-iso-west-1-fips",
+ }: endpoint{
+ Hostname: "s3-control-fips.us-iso-west-1.c2s.ic.gov",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "us-iso-west-1",
+ },
+ Deprecated: boxedTrue,
+ },
+ },
+ },
+ "s3-outposts": service{
+ Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "fips-us-iso-east-1",
+ }: endpoint{
+
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "us-iso-east-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "us-iso-east-1",
+ Variant: fipsVariant,
+ }: endpoint{},
+ },
+ },
"secretsmanager": service{
Endpoints: serviceEndpoints{
endpointKey{
@@ -44241,6 +47498,9 @@ var awsisoPartition = partition{
endpointKey{
Region: "us-iso-east-1",
}: endpoint{},
+ endpointKey{
+ Region: "us-iso-west-1",
+ }: endpoint{},
},
},
"sns": service{
@@ -44357,6 +47617,13 @@ var awsisoPartition = partition{
}: endpoint{},
},
},
+ "textract": service{
+ Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "us-iso-east-1",
+ }: endpoint{},
+ },
+ },
"transcribe": service{
Defaults: endpointDefaults{
defaultKey{}: endpoint{
@@ -44449,6 +47716,20 @@ var awsisobPartition = partition{
},
},
},
+ "api.pricing": service{
+ Defaults: endpointDefaults{
+ defaultKey{}: endpoint{
+ CredentialScope: credentialScope{
+ Service: "pricing",
+ },
+ },
+ },
+ Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "us-isob-east-1",
+ }: endpoint{},
+ },
+ },
"api.sagemaker": service{
Endpoints: serviceEndpoints{
endpointKey{
@@ -44456,6 +47737,13 @@ var awsisobPartition = partition{
}: endpoint{},
},
},
+ "apigateway": service{
+ Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "us-isob-east-1",
+ }: endpoint{},
+ },
+ },
"appconfig": service{
Endpoints: serviceEndpoints{
endpointKey{
@@ -44482,6 +47770,13 @@ var awsisobPartition = partition{
}: endpoint{},
},
},
+ "arc-zonal-shift": service{
+ Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "us-isob-east-1",
+ }: endpoint{},
+ },
+ },
"autoscaling": service{
Defaults: endpointDefaults{
defaultKey{}: endpoint{
@@ -44731,6 +48026,13 @@ var awsisobPartition = partition{
}: endpoint{},
},
},
+ "firehose": service{
+ Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "us-isob-east-1",
+ }: endpoint{},
+ },
+ },
"glacier": service{
Endpoints: serviceEndpoints{
endpointKey{
@@ -44818,6 +48120,20 @@ var awsisobPartition = partition{
}: endpoint{},
},
},
+ "medialive": service{
+ Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "us-isob-east-1",
+ }: endpoint{},
+ },
+ },
+ "mediapackage": service{
+ Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "us-isob-east-1",
+ }: endpoint{},
+ },
+ },
"metering.marketplace": service{
Defaults: endpointDefaults{
defaultKey{}: endpoint{
@@ -44855,24 +48171,9 @@ var awsisobPartition = partition{
},
"ram": service{
Endpoints: serviceEndpoints{
- endpointKey{
- Region: "fips-us-isob-east-1",
- }: endpoint{
- Hostname: "ram-fips.us-isob-east-1.sc2s.sgov.gov",
- CredentialScope: credentialScope{
- Region: "us-isob-east-1",
- },
- Deprecated: boxedTrue,
- },
endpointKey{
Region: "us-isob-east-1",
}: endpoint{},
- endpointKey{
- Region: "us-isob-east-1",
- Variant: fipsVariant,
- }: endpoint{
- Hostname: "ram-fips.us-isob-east-1.sc2s.sgov.gov",
- },
},
},
"rbin": service{
@@ -44899,28 +48200,10 @@ var awsisobPartition = partition{
},
"rds": service{
Endpoints: serviceEndpoints{
- endpointKey{
- Region: "rds-fips.us-isob-east-1",
- }: endpoint{
- Hostname: "rds-fips.us-isob-east-1.sc2s.sgov.gov",
- CredentialScope: credentialScope{
- Region: "us-isob-east-1",
- },
- Deprecated: boxedTrue,
- },
endpointKey{
Region: "rds.us-isob-east-1",
}: endpoint{
- CredentialScope: credentialScope{
- Region: "us-isob-east-1",
- },
- Deprecated: boxedTrue,
- },
- endpointKey{
- Region: "rds.us-isob-east-1",
- Variant: fipsVariant,
- }: endpoint{
- Hostname: "rds-fips.us-isob-east-1.sc2s.sgov.gov",
+ Hostname: "rds.us-isob-east-1.sc2s.sgov.gov",
CredentialScope: credentialScope{
Region: "us-isob-east-1",
},
@@ -44933,12 +48216,12 @@ var awsisobPartition = partition{
Region: "us-isob-east-1",
Variant: fipsVariant,
}: endpoint{
- Hostname: "rds-fips.us-isob-east-1.sc2s.sgov.gov",
+ Hostname: "rds.us-isob-east-1.sc2s.sgov.gov",
},
endpointKey{
Region: "us-isob-east-1-fips",
}: endpoint{
- Hostname: "rds-fips.us-isob-east-1.sc2s.sgov.gov",
+ Hostname: "rds.us-isob-east-1.sc2s.sgov.gov",
CredentialScope: credentialScope{
Region: "us-isob-east-1",
},
@@ -44949,22 +48232,12 @@ var awsisobPartition = partition{
"redshift": service{
Endpoints: serviceEndpoints{
endpointKey{
- Region: "fips-us-isob-east-1",
+ Region: "us-isob-east-1",
}: endpoint{
- Hostname: "redshift-fips.us-isob-east-1.sc2s.sgov.gov",
+ Hostname: "redshift.us-isob-east-1.sc2s.sgov.gov",
CredentialScope: credentialScope{
Region: "us-isob-east-1",
},
- Deprecated: boxedTrue,
- },
- endpointKey{
- Region: "us-isob-east-1",
- }: endpoint{},
- endpointKey{
- Region: "us-isob-east-1",
- Variant: fipsVariant,
- }: endpoint{
- Hostname: "redshift-fips.us-isob-east-1.sc2s.sgov.gov",
},
},
},
@@ -45037,6 +48310,82 @@ var awsisobPartition = partition{
},
},
},
+ "s3-control": service{
+ Defaults: endpointDefaults{
+ defaultKey{}: endpoint{
+ Protocols: []string{"https"},
+ SignatureVersions: []string{"s3v4"},
+ },
+ },
+ Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "us-isob-east-1",
+ }: endpoint{
+ Hostname: "s3-control.us-isob-east-1.sc2s.sgov.gov",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "us-isob-east-1",
+ },
+ },
+ endpointKey{
+ Region: "us-isob-east-1",
+ Variant: dualStackVariant,
+ }: endpoint{
+ Hostname: "s3-control.dualstack.us-isob-east-1.sc2s.sgov.gov",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "us-isob-east-1",
+ },
+ },
+ endpointKey{
+ Region: "us-isob-east-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "s3-control-fips.us-isob-east-1.sc2s.sgov.gov",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "us-isob-east-1",
+ },
+ },
+ endpointKey{
+ Region: "us-isob-east-1",
+ Variant: fipsVariant | dualStackVariant,
+ }: endpoint{
+ Hostname: "s3-control-fips.dualstack.us-isob-east-1.sc2s.sgov.gov",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "us-isob-east-1",
+ },
+ },
+ endpointKey{
+ Region: "us-isob-east-1-fips",
+ }: endpoint{
+ Hostname: "s3-control-fips.us-isob-east-1.sc2s.sgov.gov",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "us-isob-east-1",
+ },
+ Deprecated: boxedTrue,
+ },
+ },
+ },
+ "s3-outposts": service{
+ Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "fips-us-isob-east-1",
+ }: endpoint{
+
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "us-isob-east-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "us-isob-east-1",
+ Variant: fipsVariant,
+ }: endpoint{},
+ },
+ },
"secretsmanager": service{
Endpoints: serviceEndpoints{
endpointKey{
@@ -45090,6 +48439,37 @@ var awsisobPartition = partition{
}: endpoint{},
},
},
+ "storagegateway": service{
+ Endpoints: serviceEndpoints{
+ endpointKey{
+ Region: "fips",
+ }: endpoint{
+ Hostname: "storagegateway-fips.us-isob-east-1.sc2s.sgov.gov",
+ CredentialScope: credentialScope{
+ Region: "us-isob-east-1",
+ },
+ Deprecated: boxedTrue,
+ },
+ endpointKey{
+ Region: "us-isob-east-1",
+ }: endpoint{},
+ endpointKey{
+ Region: "us-isob-east-1",
+ Variant: fipsVariant,
+ }: endpoint{
+ Hostname: "storagegateway-fips.us-isob-east-1.sc2s.sgov.gov",
+ },
+ endpointKey{
+ Region: "us-isob-east-1-fips",
+ }: endpoint{
+ Hostname: "storagegateway-fips.us-isob-east-1.sc2s.sgov.gov",
+ CredentialScope: credentialScope{
+ Region: "us-isob-east-1",
+ },
+ Deprecated: boxedTrue,
+ },
+ },
+ },
"streams.dynamodb": service{
Defaults: endpointDefaults{
defaultKey{}: endpoint{
@@ -45186,7 +48566,11 @@ var awsisoePartition = partition{
SignatureVersions: []string{"v4"},
},
},
- Regions: regions{},
+ Regions: regions{
+ "eu-isoe-west-1": region{
+ Description: "EU ISOE West",
+ },
+ },
Services: services{},
}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/waiter.go b/vendor/github.com/aws/aws-sdk-go/aws/request/waiter.go
index 4601f883..992ed046 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/request/waiter.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/request/waiter.go
@@ -256,8 +256,17 @@ func (a *WaiterAcceptor) match(name string, l aws.Logger, req *Request, err erro
s := a.Expected.(int)
result = s == req.HTTPResponse.StatusCode
case ErrorWaiterMatch:
- if aerr, ok := err.(awserr.Error); ok {
- result = aerr.Code() == a.Expected.(string)
+ switch ex := a.Expected.(type) {
+ case string:
+ if aerr, ok := err.(awserr.Error); ok {
+ result = aerr.Code() == ex
+ }
+ case bool:
+ if ex {
+ result = err != nil
+ } else {
+ result = err == nil
+ }
}
default:
waiterLogf(l, "WARNING: Waiter %s encountered unexpected matcher: %s",
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/version.go b/vendor/github.com/aws/aws-sdk-go/aws/version.go
index 945a8b45..d15e3c84 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/version.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/version.go
@@ -5,4 +5,4 @@ package aws
const SDKName = "aws-sdk-go"
// SDKVersion is the version of this SDK
-const SDKVersion = "1.50.0"
+const SDKVersion = "1.55.5"
diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/queryutil/queryutil.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/queryutil/queryutil.go
index 05833405..2ca0b19d 100644
--- a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/queryutil/queryutil.go
+++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/queryutil/queryutil.go
@@ -122,8 +122,8 @@ func (q *queryParser) parseStruct(v url.Values, value reflect.Value, prefix stri
}
func (q *queryParser) parseList(v url.Values, value reflect.Value, prefix string, tag reflect.StructTag) error {
- // If it's empty, generate an empty value
- if !value.IsNil() && value.Len() == 0 {
+ // If it's empty, and not ec2, generate an empty value
+ if !value.IsNil() && value.Len() == 0 && !q.isEC2 {
v.Set(prefix, "")
return nil
}
diff --git a/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go b/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go
index 3ec976ab..38db957a 100644
--- a/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go
+++ b/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go
@@ -58,7 +58,7 @@ func (c *EC2) AcceptAddressTransferRequest(input *AcceptAddressTransferInput) (r
//
// Accepts an Elastic IP address transfer. For more information, see Accept
// a transferred Elastic IP address (https://docs.aws.amazon.com/vpc/latest/userguide/vpc-eips.html#using-instance-addressing-eips-transfer-accept)
-// in the Amazon Virtual Private Cloud User Guide.
+// in the Amazon VPC User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -681,7 +681,7 @@ func (c *EC2) AllocateAddressRequest(input *AllocateAddressInput) (req *request.
// that you have brought to Amazon Web Services for use with your Amazon Web
// Services resources using bring your own IP addresses (BYOIP). For more information,
// see Bring Your Own IP Addresses (BYOIP) (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// in the Amazon EC2 User Guide.
//
// If you release an Elastic IP address, you might be able to recover it. You
// cannot recover an Elastic IP address that you released after it is allocated
@@ -689,7 +689,7 @@ func (c *EC2) AllocateAddressRequest(input *AllocateAddressInput) (req *request.
// IP address that you released, specify it in this operation.
//
// For more information, see Elastic IP Addresses (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// in the Amazon EC2 User Guide.
//
// You can allocate a carrier IP address which is a public IP address from a
// telecommunication carrier, to a network interface which resides in a subnet
@@ -1003,18 +1003,15 @@ func (c *EC2) AssignIpv6AddressesRequest(input *AssignIpv6AddressesInput) (req *
// of IPv6 addresses to be automatically assigned from within the subnet's IPv6
// CIDR block range. You can assign as many IPv6 addresses to a network interface
// as you can assign private IPv4 addresses, and the limit varies per instance
-// type. For information, see IP Addresses Per Network Interface Per Instance
-// Type (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI)
-// in the Amazon Elastic Compute Cloud User Guide.
+// type.
//
// You must specify either the IPv6 addresses or the IPv6 address count in the
// request.
//
// You can optionally use Prefix Delegation on the network interface. You must
// specify either the IPV6 Prefix Delegation prefixes, or the IPv6 Prefix Delegation
-// count. For information, see Assigning prefixes to Amazon EC2 network interfaces
-// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-prefix-eni.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// count. For information, see Assigning prefixes to network interfaces (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-prefix-eni.html)
+// in the Amazon EC2 User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -1093,11 +1090,9 @@ func (c *EC2) AssignPrivateIpAddressesRequest(input *AssignPrivateIpAddressesInp
// You can specify one or more specific secondary IP addresses, or you can specify
// the number of secondary IP addresses to be automatically assigned within
// the subnet's CIDR block range. The number of secondary IP addresses that
-// you can assign to an instance varies by instance type. For information about
-// instance types, see Instance Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html)
-// in the Amazon Elastic Compute Cloud User Guide. For more information about
-// Elastic IP addresses, see Elastic IP Addresses (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// you can assign to an instance varies by instance type. For more information
+// about Elastic IP addresses, see Elastic IP Addresses (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html)
+// in the Amazon EC2 User Guide.
//
// When you move a secondary private IP address to another network interface,
// any Elastic IP address that is associated with the IP address is also moved.
@@ -1110,9 +1105,8 @@ func (c *EC2) AssignPrivateIpAddressesRequest(input *AssignPrivateIpAddressesInp
//
// You can optionally use Prefix Delegation on the network interface. You must
// specify either the IPv4 Prefix Delegation prefixes, or the IPv4 Prefix Delegation
-// count. For information, see Assigning prefixes to Amazon EC2 network interfaces
-// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-prefix-eni.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// count. For information, see Assigning prefixes to network interfaces (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-prefix-eni.html)
+// in the Amazon EC2 User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -1185,8 +1179,8 @@ func (c *EC2) AssignPrivateNatGatewayAddressRequest(input *AssignPrivateNatGatew
// AssignPrivateNatGatewayAddress API operation for Amazon Elastic Compute Cloud.
//
-// Assigns one or more private IPv4 addresses to a private NAT gateway. For
-// more information, see Work with NAT gateways (https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-working-with)
+// Assigns private IPv4 addresses to a private NAT gateway. For more information,
+// see Work with NAT gateways (https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-working-with)
// in the Amazon VPC User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -1446,7 +1440,7 @@ func (c *EC2) AssociateDhcpOptionsRequest(input *AssociateDhcpOptionsInput) (req
// its DHCP lease. You can explicitly renew the lease using the operating system
// on the instance.
//
-// For more information, see DHCP options sets (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_DHCP_Options.html)
+// For more information, see DHCP option sets (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_DHCP_Options.html)
// in the Amazon VPC User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -2391,8 +2385,8 @@ func (c *EC2) AssociateTrunkInterfaceRequest(input *AssociateTrunkInterfaceInput
//
// Associates a branch network interface with a trunk network interface.
//
-// Before you create the association, run the create-network-interface (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html)
-// command and set --interface-type to trunk. You must also create a network
+// Before you create the association, use CreateNetworkInterface (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html)
+// command and set the interface type to trunk. You must also create a network
// interface for each branch network interface that you want to associate with
// the trunk network interface.
//
@@ -2864,11 +2858,11 @@ func (c *EC2) AttachVolumeRequest(input *AttachVolumeInput) (req *request.Reques
// the instance with the specified device name.
//
// Encrypted EBS volumes must be attached to instances that support Amazon EBS
-// encryption. For more information, see Amazon EBS encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// encryption. For more information, see Amazon EBS encryption (https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption.html)
+// in the Amazon EBS User Guide.
//
// After you attach an EBS volume, you must make it available. For more information,
-// see Make an EBS volume available for use (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-using-volumes.html).
+// see Make an EBS volume available for use (https://docs.aws.amazon.com/ebs/latest/userguide/ebs-using-volumes.html).
//
// If a volume has an Amazon Web Services Marketplace product code:
//
@@ -2883,8 +2877,8 @@ func (c *EC2) AttachVolumeRequest(input *AttachVolumeInput) (req *request.Reques
// the product. For example, you can't detach a volume from a Windows instance
// and attach it to a Linux instance.
//
-// For more information, see Attach an Amazon EBS volume to an instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-attaching-volume.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// For more information, see Attach an Amazon EBS volume to an instance (https://docs.aws.amazon.com/ebs/latest/userguide/ebs-attaching-volume.html)
+// in the Amazon EBS User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -3110,29 +3104,28 @@ func (c *EC2) AuthorizeSecurityGroupEgressRequest(input *AuthorizeSecurityGroupE
// AuthorizeSecurityGroupEgress API operation for Amazon Elastic Compute Cloud.
//
-// Adds the specified outbound (egress) rules to a security group for use with
-// a VPC.
+// Adds the specified outbound (egress) rules to a security group.
//
// An outbound rule permits instances to send traffic to the specified IPv4
-// or IPv6 CIDR address ranges, or to the instances that are associated with
-// the specified source security groups. When specifying an outbound rule for
-// your security group in a VPC, the IpPermissions must include a destination
-// for the traffic.
+// or IPv6 address ranges, the IP address ranges specified by a prefix list,
+// or the instances that are associated with a source security group. For more
+// information, see Security group rules (https://docs.aws.amazon.com/vpc/latest/userguide/security-group-rules.html).
//
-// You specify a protocol for each rule (for example, TCP). For the TCP and
-// UDP protocols, you must also specify the destination port or port range.
-// For the ICMP protocol, you must also specify the ICMP type and code. You
-// can use -1 for the type or code to mean all types or all codes.
+// You must specify exactly one of the following destinations: an IPv4 or IPv6
+// address range, a prefix list, or a security group. You must specify a protocol
+// for each rule (for example, TCP). If the protocol is TCP or UDP, you must
+// also specify a port or port range. If the protocol is ICMP or ICMPv6, you
+// must also specify the ICMP type and code.
//
-// Rule changes are propagated to affected instances as quickly as possible.
-// However, a small delay might occur.
+// Rule changes are propagated to instances associated with the security group
+// as quickly as possible. However, a small delay might occur.
//
-// For information about VPC security group quotas, see Amazon VPC quotas (https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html).
+// For examples of rules that you can add to security groups for specific access
+// scenarios, see Security group rules for different use cases (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-rules-reference.html)
+// in the Amazon EC2 User Guide.
//
-// If you want to reference a security group across VPCs attached to a transit
-// gateway using the security group referencing feature (https://docs.aws.amazon.com/vpc/latest/tgw/tgw-transit-gateways.html#create-tgw),
-// note that you can only reference security groups for ingress rules. You cannot
-// reference a security group for egress rules.
+// For information about security group quotas, see Amazon VPC quotas (https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html)
+// in the Amazon VPC User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -3208,21 +3201,25 @@ func (c *EC2) AuthorizeSecurityGroupIngressRequest(input *AuthorizeSecurityGroup
// Adds the specified inbound (ingress) rules to a security group.
//
// An inbound rule permits instances to receive traffic from the specified IPv4
-// or IPv6 CIDR address range, or from the instances that are associated with
-// the specified destination security groups. When specifying an inbound rule
-// for your security group in a VPC, the IpPermissions must include a source
-// for the traffic.
+// or IPv6 address range, the IP address ranges that are specified by a prefix
+// list, or the instances that are associated with a destination security group.
+// For more information, see Security group rules (https://docs.aws.amazon.com/vpc/latest/userguide/security-group-rules.html).
//
-// You specify a protocol for each rule (for example, TCP). For TCP and UDP,
-// you must also specify the destination port or port range. For ICMP/ICMPv6,
-// you must also specify the ICMP/ICMPv6 type and code. You can use -1 to mean
-// all types or all codes.
+// You must specify exactly one of the following sources: an IPv4 or IPv6 address
+// range, a prefix list, or a security group. You must specify a protocol for
+// each rule (for example, TCP). If the protocol is TCP or UDP, you must also
+// specify a port or port range. If the protocol is ICMP or ICMPv6, you must
+// also specify the ICMP/ICMPv6 type and code.
//
-// Rule changes are propagated to instances within the security group as quickly
-// as possible. However, a small delay might occur.
+// Rule changes are propagated to instances associated with the security group
+// as quickly as possible. However, a small delay might occur.
//
-// For more information about VPC security group quotas, see Amazon VPC quotas
-// (https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html).
+// For examples of rules that you can add to security groups for specific access
+// scenarios, see Security group rules for different use cases (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-rules-reference.html)
+// in the Amazon EC2 User Guide.
+//
+// For more information about security group quotas, see Amazon VPC quotas (https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html)
+// in the Amazon VPC User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -3919,7 +3916,7 @@ func (c *EC2) CancelReservedInstancesListingRequest(input *CancelReservedInstanc
// Cancels the specified Reserved Instance listing in the Reserved Instance
// Marketplace.
//
-// For more information, see Reserved Instance Marketplace (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html)
+// For more information, see Sell in the Reserved Instance Marketplace (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html)
// in the Amazon EC2 User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -4003,6 +4000,11 @@ func (c *EC2) CancelSpotFleetRequestsRequest(input *CancelSpotFleetRequestsInput
// enters the cancelled_running state and the instances continue to run until
// they are interrupted or you terminate them manually.
//
+// Restrictions
+//
+// - You can delete up to 100 fleets in a single request. If you exceed the
+// specified number, no fleets are deleted.
+//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
@@ -4316,8 +4318,8 @@ func (c *EC2) CopyImageRequest(input *CopyImageInput) (req *request.Request, out
// by default using the default encryption key for the Region, or a different
// key that you specify in the request using KmsKeyId. Outposts do not support
// unencrypted snapshots. For more information, Amazon EBS local snapshots on
-// Outposts (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshots-outposts.html#ami)
-// in the Amazon EC2 User Guide.
+// Outposts (https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html#ami)
+// in the Amazon EBS User Guide.
//
// For more information about the prerequisites and limits when copying an AMI,
// see Copy an AMI (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/CopyingAMIs.html)
@@ -4404,22 +4406,21 @@ func (c *EC2) CopySnapshotRequest(input *CopySnapshotInput) (req *request.Reques
// When copying snapshots to a Region, copies of encrypted EBS snapshots remain
// encrypted. Copies of unencrypted snapshots remain unencrypted, unless you
// enable encryption for the snapshot copy operation. By default, encrypted
-// snapshot copies use the default Key Management Service (KMS) KMS key; however,
-// you can specify a different KMS key. To copy an encrypted snapshot that has
-// been shared from another account, you must have permissions for the KMS key
-// used to encrypt the snapshot.
+// snapshot copies use the default KMS key; however, you can specify a different
+// KMS key. To copy an encrypted snapshot that has been shared from another
+// account, you must have permissions for the KMS key used to encrypt the snapshot.
//
// Snapshots copied to an Outpost are encrypted by default using the default
// encryption key for the Region, or a different key that you specify in the
// request using KmsKeyId. Outposts do not support unencrypted snapshots. For
-// more information, Amazon EBS local snapshots on Outposts (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshots-outposts.html#ami)
-// in the Amazon Elastic Compute Cloud User Guide.
+// more information, Amazon EBS local snapshots on Outposts (https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html#ami)
+// in the Amazon EBS User Guide.
//
// Snapshots created by copying another snapshot have an arbitrary volume ID
// that should not be used for any purpose.
//
-// For more information, see Copy an Amazon EBS snapshot (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-copy-snapshot.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// For more information, see Copy an Amazon EBS snapshot (https://docs.aws.amazon.com/ebs/latest/userguide/ebs-copy-snapshot.html)
+// in the Amazon EBS User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -5281,45 +5282,48 @@ func (c *EC2) CreateDhcpOptionsRequest(input *CreateDhcpOptionsInput) (req *requ
// CreateDhcpOptions API operation for Amazon Elastic Compute Cloud.
//
-// Creates a set of DHCP options for your VPC. After creating the set, you must
-// associate it with the VPC, causing all existing and new instances that you
-// launch in the VPC to use this set of DHCP options. The following are the
-// individual DHCP options you can specify. For more information about the options,
-// see RFC 2132 (http://www.ietf.org/rfc/rfc2132.txt).
+// Creates a custom set of DHCP options. After you create a DHCP option set,
+// you associate it with a VPC. After you associate a DHCP option set with a
+// VPC, all existing and newly launched instances in the VPC use this set of
+// DHCP options.
//
-// - domain-name-servers - The IP addresses of up to four domain name servers,
-// or AmazonProvidedDNS. The default DHCP option set specifies AmazonProvidedDNS.
-// If specifying more than one domain name server, specify the IP addresses
-// in a single parameter, separated by commas. To have your instance receive
-// a custom DNS hostname as specified in domain-name, you must set domain-name-servers
-// to a custom DNS server.
+// The following are the individual DHCP options you can specify. For more information,
+// see DHCP option sets (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_DHCP_Options.html)
+// in the Amazon VPC User Guide.
//
// - domain-name - If you're using AmazonProvidedDNS in us-east-1, specify
-// ec2.internal. If you're using AmazonProvidedDNS in another Region, specify
-// region.compute.internal (for example, ap-northeast-1.compute.internal).
-// Otherwise, specify a domain name (for example, ExampleCompany.com). This
-// value is used to complete unqualified DNS hostnames. Important: Some Linux
-// operating systems accept multiple domain names separated by spaces. However,
-// Windows and other Linux operating systems treat the value as a single
-// domain, which results in unexpected behavior. If your DHCP options set
-// is associated with a VPC that has instances with multiple operating systems,
-// specify only one domain name.
-//
-// - ntp-servers - The IP addresses of up to four Network Time Protocol (NTP)
-// servers.
+// ec2.internal. If you're using AmazonProvidedDNS in any other Region, specify
+// region.compute.internal. Otherwise, specify a custom domain name. This
+// value is used to complete unqualified DNS hostnames. Some Linux operating
+// systems accept multiple domain names separated by spaces. However, Windows
+// and other Linux operating systems treat the value as a single domain,
+// which results in unexpected behavior. If your DHCP option set is associated
+// with a VPC that has instances running operating systems that treat the
+// value as a single domain, specify only one domain name.
+//
+// - domain-name-servers - The IP addresses of up to four DNS servers, or
+// AmazonProvidedDNS. To specify multiple domain name servers in a single
+// parameter, separate the IP addresses using commas. To have your instances
+// receive custom DNS hostnames as specified in domain-name, you must specify
+// a custom DNS server.
+//
+// - ntp-servers - The IP addresses of up to eight Network Time Protocol
+// (NTP) servers (four IPv4 addresses and four IPv6 addresses).
//
// - netbios-name-servers - The IP addresses of up to four NetBIOS name servers.
//
// - netbios-node-type - The NetBIOS node type (1, 2, 4, or 8). We recommend
-// that you specify 2 (broadcast and multicast are not currently supported).
-// For more information about these node types, see RFC 2132 (http://www.ietf.org/rfc/rfc2132.txt).
-//
-// Your VPC automatically starts out with a set of DHCP options that includes
-// only a DNS server that we provide (AmazonProvidedDNS). If you create a set
-// of options, and if your VPC has an internet gateway, make sure to set the
-// domain-name-servers option either to AmazonProvidedDNS or to a domain name
-// server of your choice. For more information, see DHCP options sets (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_DHCP_Options.html)
-// in the Amazon VPC User Guide.
+// that you specify 2. Broadcast and multicast are not supported. For more
+// information about NetBIOS node types, see RFC 2132 (https://www.ietf.org/rfc/rfc2132.txt).
+//
+// - ipv6-address-preferred-lease-time - A value (in seconds, minutes, hours,
+// or years) for how frequently a running instance with an IPv6 assigned
+// to it goes through DHCPv6 lease renewal. Acceptable values are between
+// 140 and 2147483647 seconds (approximately 68 years). If no value is entered,
+// the default lease time is 140 seconds. If you use long-term addressing
+// for EC2 instances, you can increase the lease time and avoid frequent
+// lease renewal requests. Lease renewal typically occurs when half of the
+// lease time has elapsed.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -5555,7 +5559,7 @@ func (c *EC2) CreateFlowLogsRequest(input *CreateFlowLogsInput) (req *request.Re
// Flow log data for a monitored network interface is recorded as flow log records,
// which are log events consisting of fields that describe the traffic flow.
// For more information, see Flow log records (https://docs.aws.amazon.com/vpc/latest/userguide/flow-logs.html#flow-log-records)
-// in the Amazon Virtual Private Cloud User Guide.
+// in the Amazon VPC User Guide.
//
// When publishing to CloudWatch Logs, flow log records are published to a log
// group, and each network interface has a unique log stream in the log group.
@@ -5564,7 +5568,7 @@ func (c *EC2) CreateFlowLogsRequest(input *CreateFlowLogsInput) (req *request.Re
// specified bucket.
//
// For more information, see VPC Flow Logs (https://docs.aws.amazon.com/vpc/latest/userguide/flow-logs.html)
-// in the Amazon Virtual Private Cloud User Guide.
+// in the Amazon VPC User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -6168,6 +6172,83 @@ func (c *EC2) CreateIpamWithContext(ctx aws.Context, input *CreateIpamInput, opt
return out, req.Send()
}
+const opCreateIpamExternalResourceVerificationToken = "CreateIpamExternalResourceVerificationToken"
+
+// CreateIpamExternalResourceVerificationTokenRequest generates a "aws/request.Request" representing the
+// client's request for the CreateIpamExternalResourceVerificationToken operation. The "output" return
+// value will be populated with the request's response once the request completes
+// successfully.
+//
+// Use "Send" method on the returned Request to send the API call to the service.
+// the "output" return value is not valid until after Send returns without error.
+//
+// See CreateIpamExternalResourceVerificationToken for more information on using the CreateIpamExternalResourceVerificationToken
+// API call, and error handling.
+//
+// This method is useful when you want to inject custom logic or configuration
+// into the SDK's request lifecycle. Such as custom headers, or retry logic.
+//
+// // Example sending a request using the CreateIpamExternalResourceVerificationTokenRequest method.
+// req, resp := client.CreateIpamExternalResourceVerificationTokenRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateIpamExternalResourceVerificationToken
+func (c *EC2) CreateIpamExternalResourceVerificationTokenRequest(input *CreateIpamExternalResourceVerificationTokenInput) (req *request.Request, output *CreateIpamExternalResourceVerificationTokenOutput) {
+ op := &request.Operation{
+ Name: opCreateIpamExternalResourceVerificationToken,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &CreateIpamExternalResourceVerificationTokenInput{}
+ }
+
+ output = &CreateIpamExternalResourceVerificationTokenOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// CreateIpamExternalResourceVerificationToken API operation for Amazon Elastic Compute Cloud.
+//
+// Create a verification token. A verification token is an Amazon Web Services-generated
+// random value that you can use to prove ownership of an external resource.
+// For example, you can use a verification token to validate that you control
+// a public IP address range when you bring an IP address range to Amazon Web
+// Services (BYOIP).
+//
+// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
+// with awserr.Error's Code and Message methods to get detailed information about
+// the error.
+//
+// See the AWS API reference guide for Amazon Elastic Compute Cloud's
+// API operation CreateIpamExternalResourceVerificationToken for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateIpamExternalResourceVerificationToken
+func (c *EC2) CreateIpamExternalResourceVerificationToken(input *CreateIpamExternalResourceVerificationTokenInput) (*CreateIpamExternalResourceVerificationTokenOutput, error) {
+ req, out := c.CreateIpamExternalResourceVerificationTokenRequest(input)
+ return out, req.Send()
+}
+
+// CreateIpamExternalResourceVerificationTokenWithContext is the same as CreateIpamExternalResourceVerificationToken with the addition of
+// the ability to pass a context and additional request options.
+//
+// See CreateIpamExternalResourceVerificationToken for details on how to use this API operation.
+//
+// The context must be non-nil and will be used for request cancellation. If
+// the context is nil a panic will occur. In the future the SDK may create
+// sub-contexts for http.Requests. See https://golang.org/pkg/context/
+// for more information on using Contexts.
+func (c *EC2) CreateIpamExternalResourceVerificationTokenWithContext(ctx aws.Context, input *CreateIpamExternalResourceVerificationTokenInput, opts ...request.Option) (*CreateIpamExternalResourceVerificationTokenOutput, error) {
+ req, out := c.CreateIpamExternalResourceVerificationTokenRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opCreateIpamPool = "CreateIpamPool"
// CreateIpamPoolRequest generates a "aws/request.Request" representing the
@@ -6540,13 +6621,13 @@ func (c *EC2) CreateLaunchTemplateRequest(input *CreateLaunchTemplateInput) (req
// launch an instance using RunInstances, you can specify a launch template
// instead of providing the launch parameters in the request. For more information,
// see Launch an instance from a launch template (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// in the Amazon EC2 User Guide.
//
-// If you want to clone an existing launch template as the basis for creating
-// a new launch template, you can use the Amazon EC2 console. The API, SDKs,
-// and CLI do not support cloning a template. For more information, see Create
-// a launch template from an existing launch template (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html#create-launch-template-from-existing-launch-template)
-// in the Amazon Elastic Compute Cloud User Guide.
+// To clone an existing launch template as the basis for a new launch template,
+// use the Amazon EC2 console. The API, SDKs, and CLI do not support cloning
+// a template. For more information, see Create a launch template from an existing
+// launch template (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html#create-launch-template-from-existing-launch-template)
+// in the Amazon EC2 User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -6619,19 +6700,21 @@ func (c *EC2) CreateLaunchTemplateVersionRequest(input *CreateLaunchTemplateVers
// CreateLaunchTemplateVersion API operation for Amazon Elastic Compute Cloud.
//
-// Creates a new version of a launch template. You can specify an existing version
-// of launch template from which to base the new version.
+// Creates a new version of a launch template. You must specify an existing
+// launch template, either by name or ID. You can determine whether the new
+// version inherits parameters from a source version, and add or overwrite parameters
+// as needed.
//
// Launch template versions are numbered in the order in which they are created.
-// You cannot specify, change, or replace the numbering of launch template versions.
+// You can't specify, change, or replace the numbering of launch template versions.
//
// Launch templates are immutable; after you create a launch template, you can't
// modify it. Instead, you can create a new version of the launch template that
-// includes any changes you require.
+// includes the changes that you require.
//
// For more information, see Modify a launch template (manage launch template
// versions) (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html#manage-launch-template-versions)
-// in the Amazon Elastic Compute Cloud User Guide.
+// in the Amazon EC2 User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -7499,13 +7582,11 @@ func (c *EC2) CreateNetworkInterfaceRequest(input *CreateNetworkInterfaceInput)
// Creates a network interface in the specified subnet.
//
// The number of IP addresses you can assign to a network interface varies by
-// instance type. For more information, see IP Addresses Per ENI Per Instance
-// Type (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI)
-// in the Amazon Virtual Private Cloud User Guide.
+// instance type.
//
// For more information about network interfaces, see Elastic network interfaces
// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html) in the
-// Amazon Elastic Compute Cloud User Guide.
+// Amazon EC2 User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -7822,7 +7903,7 @@ func (c *EC2) CreateReplaceRootVolumeTaskRequest(input *CreateReplaceRootVolumeT
// from an AMI that has the same key characteristics as that of the instance.
//
// For more information, see Replace a root volume (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/replace-root.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// in the Amazon EC2 User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -7916,7 +7997,7 @@ func (c *EC2) CreateReservedInstancesListingRequest(input *CreateReservedInstanc
// for purchase. To view the details of your Standard Reserved Instance listing,
// you can use the DescribeReservedInstancesListings operation.
//
-// For more information, see Reserved Instance Marketplace (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html)
+// For more information, see Sell in the Reserved Instance Marketplace (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html)
// in the Amazon EC2 User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -8368,11 +8449,11 @@ func (c *EC2) CreateSnapshotRequest(input *CreateSnapshotInput) (req *request.Re
//
// You can tag your snapshots during creation. For more information, see Tag
// your Amazon EC2 resources (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// in the Amazon EC2 User Guide.
//
-// For more information, see Amazon Elastic Block Store (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AmazonEBS.html)
-// and Amazon EBS encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// For more information, see Amazon EBS (https://docs.aws.amazon.com/ebs/latest/userguide/what-is-ebs.html)
+// and Amazon EBS encryption (https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption.html)
+// in the Amazon EBS User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -8533,7 +8614,7 @@ func (c *EC2) CreateSpotDatafeedSubscriptionRequest(input *CreateSpotDatafeedSub
// Creates a data feed for Spot Instances, enabling you to view Spot Instance
// usage logs. You can create one data feed per Amazon Web Services account.
// For more information, see Spot Instance data feed (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-data-feeds.html)
-// in the Amazon EC2 User Guide for Linux Instances.
+// in the Amazon EC2 User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -8786,9 +8867,8 @@ func (c *EC2) CreateSubnetCidrReservationRequest(input *CreateSubnetCidrReservat
//
// Creates a subnet CIDR reservation. For more information, see Subnet CIDR
// reservations (https://docs.aws.amazon.com/vpc/latest/userguide/subnet-cidr-reservation.html)
-// in the Amazon Virtual Private Cloud User Guide and Assign prefixes to network
-// interfaces (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-prefix-eni.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// in the Amazon VPC User Guide and Assign prefixes to network interfaces (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-prefix-eni.html)
+// in the Amazon EC2 User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -9448,7 +9528,7 @@ func (c *EC2) CreateTransitGatewayConnectPeerRequest(input *CreateTransitGateway
// family (IPv4 or IPv6).
//
// For more information, see Connect peers (https://docs.aws.amazon.com/vpc/latest/tgw/tgw-connect.html#tgw-connect-peer)
-// in the Transit Gateways Guide.
+// in the Amazon Web Services Transit Gateways Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -10435,15 +10515,15 @@ func (c *EC2) CreateVolumeRequest(input *CreateVolumeInput) (req *request.Reques
// You can create encrypted volumes. Encrypted volumes must be attached to instances
// that support Amazon EBS encryption. Volumes that are created from encrypted
// snapshots are also automatically encrypted. For more information, see Amazon
-// EBS encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// EBS encryption (https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption.html)
+// in the Amazon EBS User Guide.
//
// You can tag your volumes during creation. For more information, see Tag your
// Amazon EC2 resources (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// in the Amazon EC2 User Guide.
//
-// For more information, see Create an Amazon EBS volume (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-creating-volume.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// For more information, see Create an Amazon EBS volume (https://docs.aws.amazon.com/ebs/latest/userguide/ebs-creating-volume.html)
+// in the Amazon EBS User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -10686,8 +10766,8 @@ func (c *EC2) CreateVpcEndpointConnectionNotificationRequest(input *CreateVpcEnd
// Creates a connection notification for a specified VPC endpoint or VPC endpoint
// service. A connection notification notifies you of specific endpoint events.
// You must create an SNS topic to receive notifications. For more information,
-// see Create a Topic (https://docs.aws.amazon.com/sns/latest/dg/CreateTopic.html)
-// in the Amazon Simple Notification Service Developer Guide.
+// see Creating an Amazon SNS topic (https://docs.aws.amazon.com/sns/latest/dg/CreateTopic.html)
+// in the Amazon SNS Developer Guide.
//
// You can create a connection notification for interface endpoints only.
//
@@ -10858,8 +10938,8 @@ func (c *EC2) CreateVpcPeeringConnectionRequest(input *CreateVpcPeeringConnectio
// overlapping CIDR blocks.
//
// Limitations and rules apply to a VPC peering connection. For more information,
-// see the limitations (https://docs.aws.amazon.com/vpc/latest/peering/vpc-peering-basics.html#vpc-peering-limitations)
-// section in the VPC Peering Guide.
+// see the VPC peering limitations (https://docs.aws.amazon.com/vpc/latest/peering/vpc-peering-basics.html#vpc-peering-limitations)
+// in the VPC Peering Guide.
//
// The owner of the accepter VPC must accept the peering request to activate
// the peering connection. The VPC peering connection request expires after
@@ -11798,17 +11878,22 @@ func (c *EC2) DeleteFleetsRequest(input *DeleteFleetsInput) (req *request.Reques
// manually.
//
// For instant fleets, EC2 Fleet must terminate the instances when the fleet
-// is deleted. A deleted instant fleet with running instances is not supported.
+// is deleted. Up to 1000 instances can be terminated in a single request to
+// delete instant fleets. A deleted instant fleet with running instances is
+// not supported.
//
// Restrictions
//
-// - You can delete up to 25 instant fleets in a single request. If you exceed
-// this number, no instant fleets are deleted and an error is returned. There
-// is no restriction on the number of fleets of type maintain or request
-// that can be deleted in a single request.
+// - You can delete up to 25 fleets of type instant in a single request.
+//
+// - You can delete up to 100 fleets of type maintain or request in a single
+// request.
//
-// - Up to 1000 instances can be terminated in a single request to delete
-// instant fleets.
+// - You can delete up to 125 fleets in a single request, provided you do
+// not exceed the quota for each fleet type, as specified above.
+//
+// - If you exceed the specified number of fleets to delete, no fleets are
+// deleted.
//
// For more information, see Delete an EC2 Fleet (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/manage-ec2-fleet.html#delete-fleet)
// in the Amazon EC2 User Guide.
@@ -12288,6 +12373,83 @@ func (c *EC2) DeleteIpamWithContext(ctx aws.Context, input *DeleteIpamInput, opt
return out, req.Send()
}
+const opDeleteIpamExternalResourceVerificationToken = "DeleteIpamExternalResourceVerificationToken"
+
+// DeleteIpamExternalResourceVerificationTokenRequest generates a "aws/request.Request" representing the
+// client's request for the DeleteIpamExternalResourceVerificationToken operation. The "output" return
+// value will be populated with the request's response once the request completes
+// successfully.
+//
+// Use "Send" method on the returned Request to send the API call to the service.
+// the "output" return value is not valid until after Send returns without error.
+//
+// See DeleteIpamExternalResourceVerificationToken for more information on using the DeleteIpamExternalResourceVerificationToken
+// API call, and error handling.
+//
+// This method is useful when you want to inject custom logic or configuration
+// into the SDK's request lifecycle. Such as custom headers, or retry logic.
+//
+// // Example sending a request using the DeleteIpamExternalResourceVerificationTokenRequest method.
+// req, resp := client.DeleteIpamExternalResourceVerificationTokenRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteIpamExternalResourceVerificationToken
+func (c *EC2) DeleteIpamExternalResourceVerificationTokenRequest(input *DeleteIpamExternalResourceVerificationTokenInput) (req *request.Request, output *DeleteIpamExternalResourceVerificationTokenOutput) {
+ op := &request.Operation{
+ Name: opDeleteIpamExternalResourceVerificationToken,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &DeleteIpamExternalResourceVerificationTokenInput{}
+ }
+
+ output = &DeleteIpamExternalResourceVerificationTokenOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DeleteIpamExternalResourceVerificationToken API operation for Amazon Elastic Compute Cloud.
+//
+// Delete a verification token. A verification token is an Amazon Web Services-generated
+// random value that you can use to prove ownership of an external resource.
+// For example, you can use a verification token to validate that you control
+// a public IP address range when you bring an IP address range to Amazon Web
+// Services (BYOIP).
+//
+// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
+// with awserr.Error's Code and Message methods to get detailed information about
+// the error.
+//
+// See the AWS API reference guide for Amazon Elastic Compute Cloud's
+// API operation DeleteIpamExternalResourceVerificationToken for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteIpamExternalResourceVerificationToken
+func (c *EC2) DeleteIpamExternalResourceVerificationToken(input *DeleteIpamExternalResourceVerificationTokenInput) (*DeleteIpamExternalResourceVerificationTokenOutput, error) {
+ req, out := c.DeleteIpamExternalResourceVerificationTokenRequest(input)
+ return out, req.Send()
+}
+
+// DeleteIpamExternalResourceVerificationTokenWithContext is the same as DeleteIpamExternalResourceVerificationToken with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DeleteIpamExternalResourceVerificationToken for details on how to use this API operation.
+//
+// The context must be non-nil and will be used for request cancellation. If
+// the context is nil a panic will occur. In the future the SDK may create
+// sub-contexts for http.Requests. See https://golang.org/pkg/context/
+// for more information on using Contexts.
+func (c *EC2) DeleteIpamExternalResourceVerificationTokenWithContext(ctx aws.Context, input *DeleteIpamExternalResourceVerificationTokenInput, opts ...request.Option) (*DeleteIpamExternalResourceVerificationTokenOutput, error) {
+ req, out := c.DeleteIpamExternalResourceVerificationTokenRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opDeleteIpamPool = "DeleteIpamPool"
// DeleteIpamPoolRequest generates a "aws/request.Request" representing the
@@ -12721,7 +12883,7 @@ func (c *EC2) DeleteLaunchTemplateVersionsRequest(input *DeleteLaunchTemplateVer
// which deletes the launch template and all of its versions.
//
// For more information, see Delete a launch template version (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/manage-launch-template-versions.html#delete-launch-template-version)
-// in the EC2 User Guide.
+// in the Amazon EC2 User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -14297,8 +14459,8 @@ func (c *EC2) DeleteSnapshotRequest(input *DeleteSnapshotInput) (req *request.Re
// a registered AMI. You must first de-register the AMI before you can delete
// the snapshot.
//
-// For more information, see Delete an Amazon EBS snapshot (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-deleting-snapshot.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// For more information, see Delete an Amazon EBS snapshot (https://docs.aws.amazon.com/ebs/latest/userguide/ebs-deleting-snapshot.html)
+// in the Amazon EBS User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -15555,9 +15717,10 @@ func (c *EC2) DeleteTransitGatewayRouteTableRequest(input *DeleteTransitGatewayR
// DeleteTransitGatewayRouteTable API operation for Amazon Elastic Compute Cloud.
//
-// Deletes the specified transit gateway route table. You must disassociate
-// the route table from any transit gateway route tables before you can delete
-// it.
+// Deletes the specified transit gateway route table. If there are any route
+// tables associated with the transit gateway route table, you must first run
+// DisassociateRouteTable before you can delete the transit gateway route table.
+// This removes any route tables associated with the transit gateway route table.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -16074,8 +16237,8 @@ func (c *EC2) DeleteVolumeRequest(input *DeleteVolumeInput) (req *request.Reques
//
// The volume can remain in the deleting state for several minutes.
//
-// For more information, see Delete an Amazon EBS volume (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-deleting-volume.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// For more information, see Delete an Amazon EBS volume (https://docs.aws.amazon.com/ebs/latest/userguide/ebs-deleting-volume.html)
+// in the Amazon EBS User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -17415,6 +17578,10 @@ func (c *EC2) DescribeAccountAttributesRequest(input *DescribeAccountAttributesI
// - vpc-max-security-groups-per-interface: The maximum number of security
// groups that you can assign to a network interface.
//
+// The order of the elements in the response, including those within nested
+// structures, might vary. Applications should not assume the elements appear
+// in a particular order.
+//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
@@ -17494,7 +17661,7 @@ func (c *EC2) DescribeAddressTransfersRequest(input *DescribeAddressTransfersInp
//
// Describes an Elastic IP address transfer. For more information, see Transfer
// Elastic IP addresses (https://docs.aws.amazon.com/vpc/latest/userguide/vpc-eips.html#transfer-EIPs-intro)
-// in the Amazon Virtual Private Cloud User Guide.
+// in the Amazon VPC User Guide.
//
// When you transfer an Elastic IP address, there is a two-step handshake between
// the source and transfer Amazon Web Services accounts. When the source account
@@ -17924,7 +18091,11 @@ func (c *EC2) DescribeAvailabilityZonesRequest(input *DescribeAvailabilityZonesI
//
// For more information about Availability Zones, Local Zones, and Wavelength
// Zones, see Regions and zones (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// in the Amazon EC2 User Guide.
+//
+// The order of the elements in the response, including those within nested
+// structures, might vary. Applications should not assume the elements appear
+// in a particular order.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -18134,6 +18305,10 @@ func (c *EC2) DescribeBundleTasksRequest(input *DescribeBundleTasksInput) (req *
// use RegisterImage with the Amazon S3 bucket name and image manifest name
// you provided to the bundle task.
//
+// The order of the elements in the response, including those within nested
+// structures, might vary. Applications should not assume the elements appear
+// in a particular order.
+//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
@@ -18344,8 +18519,9 @@ func (c *EC2) DescribeCapacityBlockOfferingsRequest(input *DescribeCapacityBlock
// DescribeCapacityBlockOfferings API operation for Amazon Elastic Compute Cloud.
//
-// Describes Capacity Block offerings available for purchase. With Capacity
-// Blocks, you purchase a specific instance type for a period of time.
+// Describes Capacity Block offerings available for purchase in the Amazon Web
+// Services Region that you're currently using. With Capacity Blocks, you purchase
+// a specific instance type for a period of time.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -18869,10 +19045,9 @@ func (c *EC2) DescribeClassicLinkInstancesRequest(input *DescribeClassicLinkInst
//
// This action is deprecated.
//
-// Describes one or more of your linked EC2-Classic instances. This request
-// only returns information about EC2-Classic instances linked to a VPC through
-// ClassicLink. You cannot use this request to return information about other
-// instances.
+// Describes your linked EC2-Classic instances. This request only returns information
+// about EC2-Classic instances linked to a VPC through ClassicLink. You cannot
+// use this request to return information about other instances.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -19937,9 +20112,12 @@ func (c *EC2) DescribeDhcpOptionsRequest(input *DescribeDhcpOptionsInput) (req *
// DescribeDhcpOptions API operation for Amazon Elastic Compute Cloud.
//
-// Describes one or more of your DHCP options sets.
+// Describes your DHCP option sets. The default is to describe all your DHCP
+// option sets. Alternatively, you can specify specific DHCP option set IDs
+// or filter the results to include only the DHCP option sets that match specific
+// criteria.
//
-// For more information, see DHCP options sets (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_DHCP_Options.html)
+// For more information, see DHCP option sets (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_DHCP_Options.html)
// in the Amazon VPC User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -20070,7 +20248,10 @@ func (c *EC2) DescribeEgressOnlyInternetGatewaysRequest(input *DescribeEgressOnl
// DescribeEgressOnlyInternetGateways API operation for Amazon Elastic Compute Cloud.
//
-// Describes one or more of your egress-only internet gateways.
+// Describes your egress-only internet gateways. The default is to describe
+// all your egress-only internet gateways. Alternatively, you can specify specific
+// egress-only internet gateway IDs or filter the results to include only the
+// egress-only internet gateways that match specific criteria.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -20194,9 +20375,11 @@ func (c *EC2) DescribeElasticGpusRequest(input *DescribeElasticGpusInput) (req *
// DescribeElasticGpus API operation for Amazon Elastic Compute Cloud.
//
+// Amazon Elastic Graphics reached end of life on January 8, 2024. For workloads
+// that require graphics acceleration, we recommend that you use Amazon EC2
+// G4, G5, or G6 instances.
+//
// Describes the Elastic Graphics accelerator associated with your instances.
-// For more information about Elastic Graphics, see Amazon Elastic Graphics
-// (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/elastic-graphics.html).
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -20815,7 +20998,10 @@ func (c *EC2) DescribeFleetInstancesRequest(input *DescribeFleetInstancesInput)
//
// Describes the running instances for the specified EC2 Fleet.
//
-// For more information, see Monitor your EC2 Fleet (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/manage-ec2-fleet.html#monitor-ec2-fleet)
+// Currently, DescribeFleetInstances does not support fleets of type instant.
+// Instead, use DescribeFleets, specifying the instant fleet ID in the request.
+//
+// For more information, see Describe your EC2 Fleet (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/manage-ec2-fleet.html#monitor-ec2-fleet)
// in the Amazon EC2 User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -20895,9 +21081,12 @@ func (c *EC2) DescribeFleetsRequest(input *DescribeFleetsInput) (req *request.Re
// DescribeFleets API operation for Amazon Elastic Compute Cloud.
//
-// Describes the specified EC2 Fleets or all of your EC2 Fleets.
+// Describes the specified EC2 Fleet or all of your EC2 Fleets.
+//
+// If a fleet is of type instant, you must specify the fleet ID in the request,
+// otherwise the fleet does not appear in the response.
//
-// For more information, see Monitor your EC2 Fleet (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/manage-ec2-fleet.html#monitor-ec2-fleet)
+// For more information, see Describe your EC2 Fleet (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/manage-ec2-fleet.html#monitor-ec2-fleet)
// in the Amazon EC2 User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -22077,6 +22266,10 @@ func (c *EC2) DescribeImageAttributeRequest(input *DescribeImageAttributeInput)
// Describes the specified attribute of the specified AMI. You can specify only
// one attribute at a time.
//
+// The order of the elements in the response, including those within nested
+// structures, might vary. Applications should not assume the elements appear
+// in a particular order.
+//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
@@ -22166,6 +22359,13 @@ func (c *EC2) DescribeImagesRequest(input *DescribeImagesInput) (req *request.Re
// AMI are terminated, specifying the ID of the image will eventually return
// an error indicating that the AMI ID cannot be found.
//
+// We strongly recommend using only paginated requests. Unpaginated requests
+// are susceptible to throttling and timeouts.
+//
+// The order of the elements in the response, including those within nested
+// structures, might vary. Applications should not assume the elements appear
+// in a particular order.
+//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
@@ -23153,6 +23353,10 @@ func (c *EC2) DescribeInstanceStatusRequest(input *DescribeInstanceStatusInput)
// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html)
// in the Amazon EC2 User Guide.
//
+// The order of the elements in the response, including those within nested
+// structures, might vary. Applications should not assume the elements appear
+// in a particular order.
+//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
@@ -23426,9 +23630,9 @@ func (c *EC2) DescribeInstanceTypeOfferingsRequest(input *DescribeInstanceTypeOf
// DescribeInstanceTypeOfferings API operation for Amazon Elastic Compute Cloud.
//
-// Returns a list of all instance types offered. The results can be filtered
-// by location (Region or Availability Zone). If no location is specified, the
-// instance types offered in the current Region are returned.
+// Lists the instance types that are offered for the specified location. If
+// no location is specified, the default is to list the instance types that
+// are offered in the current Region.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -23558,8 +23762,8 @@ func (c *EC2) DescribeInstanceTypesRequest(input *DescribeInstanceTypesInput) (r
// DescribeInstanceTypes API operation for Amazon Elastic Compute Cloud.
//
-// Describes the details of the instance types that are offered in a location.
-// The results can be filtered by the attributes of the instance types.
+// Describes the specified instance types. By default, all instance types for
+// the current Region are described. Alternatively, you can filter the results.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -23710,6 +23914,13 @@ func (c *EC2) DescribeInstancesRequest(input *DescribeInstancesInput) (req *requ
// If you describe instances and specify only instance IDs that are in an unaffected
// zone, the call works normally.
//
+// We strongly recommend using only paginated requests. Unpaginated requests
+// are susceptible to throttling and timeouts.
+//
+// The order of the elements in the response, including those within nested
+// structures, might vary. Applications should not assume the elements appear
+// in a particular order.
+//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
@@ -23838,7 +24049,10 @@ func (c *EC2) DescribeInternetGatewaysRequest(input *DescribeInternetGatewaysInp
// DescribeInternetGateways API operation for Amazon Elastic Compute Cloud.
//
-// Describes one or more of your internet gateways.
+// Describes your internet gateways. The default is to describe all your internet
+// gateways. Alternatively, you can specify specific internet gateway IDs or
+// filter the results to include only the internet gateways that match specific
+// criteria.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -23995,6 +24209,83 @@ func (c *EC2) DescribeIpamByoasnWithContext(ctx aws.Context, input *DescribeIpam
return out, req.Send()
}
+const opDescribeIpamExternalResourceVerificationTokens = "DescribeIpamExternalResourceVerificationTokens"
+
+// DescribeIpamExternalResourceVerificationTokensRequest generates a "aws/request.Request" representing the
+// client's request for the DescribeIpamExternalResourceVerificationTokens operation. The "output" return
+// value will be populated with the request's response once the request completes
+// successfully.
+//
+// Use "Send" method on the returned Request to send the API call to the service.
+// the "output" return value is not valid until after Send returns without error.
+//
+// See DescribeIpamExternalResourceVerificationTokens for more information on using the DescribeIpamExternalResourceVerificationTokens
+// API call, and error handling.
+//
+// This method is useful when you want to inject custom logic or configuration
+// into the SDK's request lifecycle. Such as custom headers, or retry logic.
+//
+// // Example sending a request using the DescribeIpamExternalResourceVerificationTokensRequest method.
+// req, resp := client.DescribeIpamExternalResourceVerificationTokensRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeIpamExternalResourceVerificationTokens
+func (c *EC2) DescribeIpamExternalResourceVerificationTokensRequest(input *DescribeIpamExternalResourceVerificationTokensInput) (req *request.Request, output *DescribeIpamExternalResourceVerificationTokensOutput) {
+ op := &request.Operation{
+ Name: opDescribeIpamExternalResourceVerificationTokens,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &DescribeIpamExternalResourceVerificationTokensInput{}
+ }
+
+ output = &DescribeIpamExternalResourceVerificationTokensOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DescribeIpamExternalResourceVerificationTokens API operation for Amazon Elastic Compute Cloud.
+//
+// Describe verification tokens. A verification token is an Amazon Web Services-generated
+// random value that you can use to prove ownership of an external resource.
+// For example, you can use a verification token to validate that you control
+// a public IP address range when you bring an IP address range to Amazon Web
+// Services (BYOIP).
+//
+// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
+// with awserr.Error's Code and Message methods to get detailed information about
+// the error.
+//
+// See the AWS API reference guide for Amazon Elastic Compute Cloud's
+// API operation DescribeIpamExternalResourceVerificationTokens for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeIpamExternalResourceVerificationTokens
+func (c *EC2) DescribeIpamExternalResourceVerificationTokens(input *DescribeIpamExternalResourceVerificationTokensInput) (*DescribeIpamExternalResourceVerificationTokensOutput, error) {
+ req, out := c.DescribeIpamExternalResourceVerificationTokensRequest(input)
+ return out, req.Send()
+}
+
+// DescribeIpamExternalResourceVerificationTokensWithContext is the same as DescribeIpamExternalResourceVerificationTokens with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DescribeIpamExternalResourceVerificationTokens for details on how to use this API operation.
+//
+// The context must be non-nil and will be used for request cancellation. If
+// the context is nil a panic will occur. In the future the SDK may create
+// sub-contexts for http.Requests. See https://golang.org/pkg/context/
+// for more information on using Contexts.
+func (c *EC2) DescribeIpamExternalResourceVerificationTokensWithContext(ctx aws.Context, input *DescribeIpamExternalResourceVerificationTokensInput, opts ...request.Option) (*DescribeIpamExternalResourceVerificationTokensOutput, error) {
+ req, out := c.DescribeIpamExternalResourceVerificationTokensRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opDescribeIpamPools = "DescribeIpamPools"
// DescribeIpamPoolsRequest generates a "aws/request.Request" representing the
@@ -25978,6 +26269,137 @@ func (c *EC2) DescribeLockedSnapshotsWithContext(ctx aws.Context, input *Describ
return out, req.Send()
}
+const opDescribeMacHosts = "DescribeMacHosts"
+
+// DescribeMacHostsRequest generates a "aws/request.Request" representing the
+// client's request for the DescribeMacHosts operation. The "output" return
+// value will be populated with the request's response once the request completes
+// successfully.
+//
+// Use "Send" method on the returned Request to send the API call to the service.
+// the "output" return value is not valid until after Send returns without error.
+//
+// See DescribeMacHosts for more information on using the DescribeMacHosts
+// API call, and error handling.
+//
+// This method is useful when you want to inject custom logic or configuration
+// into the SDK's request lifecycle. Such as custom headers, or retry logic.
+//
+// // Example sending a request using the DescribeMacHostsRequest method.
+// req, resp := client.DescribeMacHostsRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeMacHosts
+func (c *EC2) DescribeMacHostsRequest(input *DescribeMacHostsInput) (req *request.Request, output *DescribeMacHostsOutput) {
+ op := &request.Operation{
+ Name: opDescribeMacHosts,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
+ }
+
+ if input == nil {
+ input = &DescribeMacHostsInput{}
+ }
+
+ output = &DescribeMacHostsOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DescribeMacHosts API operation for Amazon Elastic Compute Cloud.
+//
+// Describes the specified EC2 Mac Dedicated Host or all of your EC2 Mac Dedicated
+// Hosts.
+//
+// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
+// with awserr.Error's Code and Message methods to get detailed information about
+// the error.
+//
+// See the AWS API reference guide for Amazon Elastic Compute Cloud's
+// API operation DescribeMacHosts for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeMacHosts
+func (c *EC2) DescribeMacHosts(input *DescribeMacHostsInput) (*DescribeMacHostsOutput, error) {
+ req, out := c.DescribeMacHostsRequest(input)
+ return out, req.Send()
+}
+
+// DescribeMacHostsWithContext is the same as DescribeMacHosts with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DescribeMacHosts for details on how to use this API operation.
+//
+// The context must be non-nil and will be used for request cancellation. If
+// the context is nil a panic will occur. In the future the SDK may create
+// sub-contexts for http.Requests. See https://golang.org/pkg/context/
+// for more information on using Contexts.
+func (c *EC2) DescribeMacHostsWithContext(ctx aws.Context, input *DescribeMacHostsInput, opts ...request.Option) (*DescribeMacHostsOutput, error) {
+ req, out := c.DescribeMacHostsRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+// DescribeMacHostsPages iterates over the pages of a DescribeMacHosts operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeMacHosts method for more information on how to use this operation.
+//
+// Note: This operation can generate multiple requests to a service.
+//
+// // Example iterating over at most 3 pages of a DescribeMacHosts operation.
+// pageNum := 0
+// err := client.DescribeMacHostsPages(params,
+// func(page *ec2.DescribeMacHostsOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+func (c *EC2) DescribeMacHostsPages(input *DescribeMacHostsInput, fn func(*DescribeMacHostsOutput, bool) bool) error {
+ return c.DescribeMacHostsPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeMacHostsPagesWithContext same as DescribeMacHostsPages except
+// it takes a Context and allows setting request options on the pages.
+//
+// The context must be non-nil and will be used for request cancellation. If
+// the context is nil a panic will occur. In the future the SDK may create
+// sub-contexts for http.Requests. See https://golang.org/pkg/context/
+// for more information on using Contexts.
+func (c *EC2) DescribeMacHostsPagesWithContext(ctx aws.Context, input *DescribeMacHostsInput, fn func(*DescribeMacHostsOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeMacHostsInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeMacHostsRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ for p.Next() {
+ if !fn(p.Page().(*DescribeMacHostsOutput), !p.HasNextPage()) {
+ break
+ }
+ }
+
+ return p.Err()
+}
+
const opDescribeManagedPrefixLists = "DescribeManagedPrefixLists"
// DescribeManagedPrefixListsRequest generates a "aws/request.Request" representing the
@@ -26294,7 +26716,9 @@ func (c *EC2) DescribeNatGatewaysRequest(input *DescribeNatGatewaysInput) (req *
// DescribeNatGateways API operation for Amazon Elastic Compute Cloud.
//
-// Describes one or more of your NAT gateways.
+// Describes your NAT gateways. The default is to describe all your NAT gateways.
+// Alternatively, you can specify specific NAT gateway IDs or filter the results
+// to include only the NAT gateways that match specific criteria.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -26424,7 +26848,9 @@ func (c *EC2) DescribeNetworkAclsRequest(input *DescribeNetworkAclsInput) (req *
// DescribeNetworkAcls API operation for Amazon Elastic Compute Cloud.
//
-// Describes one or more of your network ACLs.
+// Describes your network ACLs. The default is to describe all your network
+// ACLs. Alternatively, you can specify specific network ACL IDs or filter the
+// results to include only the network ACLs that match specific criteria.
//
// For more information, see Network ACLs (https://docs.aws.amazon.com/vpc/latest/userguide/vpc-network-acls.html)
// in the Amazon VPC User Guide.
@@ -27287,6 +27713,9 @@ func (c *EC2) DescribeNetworkInterfacesRequest(input *DescribeNetworkInterfacesI
// you use pagination or one of the following filters: group-id, mac-address,
// private-dns-name, private-ip-address, private-dns-name, subnet-id, or vpc-id.
//
+// We strongly recommend using only paginated requests. Unpaginated requests
+// are susceptible to throttling and timeouts.
+//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
@@ -27410,6 +27839,12 @@ func (c *EC2) DescribePlacementGroupsRequest(input *DescribePlacementGroupsInput
// DescribePlacementGroups API operation for Amazon Elastic Compute Cloud.
//
// Describes the specified placement groups or all of your placement groups.
+//
+// To describe a specific placement group that is shared with your account,
+// you must specify the ID of the placement group using the GroupId parameter.
+// Specifying the name of a shared placement group using the GroupNames parameter
+// will result in an error.
+//
// For more information, see Placement groups (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html)
// in the Amazon EC2 User Guide.
//
@@ -27894,12 +28329,16 @@ func (c *EC2) DescribeRegionsRequest(input *DescribeRegionsInput) (req *request.
//
// Describes the Regions that are enabled for your account, or all Regions.
//
-// For a list of the Regions supported by Amazon EC2, see Amazon Elastic Compute
-// Cloud endpoints and quotas (https://docs.aws.amazon.com/general/latest/gr/ec2-service.html).
+// For a list of the Regions supported by Amazon EC2, see Amazon EC2 service
+// endpoints (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-endpoints.html).
//
// For information about enabling and disabling Regions for your account, see
-// Managing Amazon Web Services Regions (https://docs.aws.amazon.com/general/latest/gr/rande-manage.html)
-// in the Amazon Web Services General Reference.
+// Specify which Amazon Web Services Regions your account can use (https://docs.aws.amazon.com/accounts/latest/reference/manage-acct-regions.html)
+// in the Amazon Web Services Account Management Reference Guide.
+//
+// The order of the elements in the response, including those within nested
+// structures, might vary. Applications should not assume the elements appear
+// in a particular order.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -27980,7 +28419,7 @@ func (c *EC2) DescribeReplaceRootVolumeTasksRequest(input *DescribeReplaceRootVo
//
// Describes a root volume replacement task. For more information, see Replace
// a root volume (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/replace-root.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// in the Amazon EC2 User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -28109,6 +28548,10 @@ func (c *EC2) DescribeReservedInstancesRequest(input *DescribeReservedInstancesI
// For more information about Reserved Instances, see Reserved Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts-on-demand-reserved-instances.html)
// in the Amazon EC2 User Guide.
//
+// The order of the elements in the response, including those within nested
+// structures, might vary. Applications should not assume the elements appear
+// in a particular order.
+//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
@@ -28200,9 +28643,13 @@ func (c *EC2) DescribeReservedInstancesListingsRequest(input *DescribeReservedIn
// demand is met. You are charged based on the total price of all of the listings
// that you purchase.
//
-// For more information, see Reserved Instance Marketplace (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html)
+// For more information, see Sell in the Reserved Instance Marketplace (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html)
// in the Amazon EC2 User Guide.
//
+// The order of the elements in the response, including those within nested
+// structures, might vary. Applications should not assume the elements appear
+// in a particular order.
+//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
@@ -28285,9 +28732,13 @@ func (c *EC2) DescribeReservedInstancesModificationsRequest(input *DescribeReser
// requests is returned. If a modification ID is specified, only information
// about the specific modification is returned.
//
-// For more information, see Modifying Reserved Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-modifying.html)
+// For more information, see Modify Reserved Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-modifying.html)
// in the Amazon EC2 User Guide.
//
+// The order of the elements in the response, including those within nested
+// structures, might vary. Applications should not assume the elements appear
+// in a particular order.
+//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
@@ -28426,9 +28877,13 @@ func (c *EC2) DescribeReservedInstancesOfferingsRequest(input *DescribeReservedI
// Marketplace, they will be excluded from these results. This is to ensure
// that you do not purchase your own Reserved Instances.
//
-// For more information, see Reserved Instance Marketplace (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html)
+// For more information, see Sell in the Reserved Instance Marketplace (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html)
// in the Amazon EC2 User Guide.
//
+// The order of the elements in the response, including those within nested
+// structures, might vary. Applications should not assume the elements appear
+// in a particular order.
+//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
@@ -28557,7 +29012,9 @@ func (c *EC2) DescribeRouteTablesRequest(input *DescribeRouteTablesInput) (req *
// DescribeRouteTables API operation for Amazon Elastic Compute Cloud.
//
-// Describes one or more of your route tables.
+// Describes your route tables. The default is to describe all your route tables.
+// Alternatively, you can specify specific route table IDs or filter the results
+// to include only the route tables that match specific criteria.
//
// Each subnet in your VPC must be associated with a route table. If a subnet
// is not explicitly associated with any route table, it is implicitly associated
@@ -28957,9 +29414,8 @@ func (c *EC2) DescribeSecurityGroupReferencesRequest(input *DescribeSecurityGrou
// DescribeSecurityGroupReferences API operation for Amazon Elastic Compute Cloud.
//
-// Describes the VPCs on the other side of a VPC peering connection or the VPCs
-// attached to a transit gateway that are referencing the security groups you've
-// specified in this request.
+// Describes the VPCs on the other side of a VPC peering connection that are
+// referencing the security groups you've specified in this request.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -29295,8 +29751,8 @@ func (c *EC2) DescribeSnapshotAttributeRequest(input *DescribeSnapshotAttributeI
// Describes the specified attribute of the specified snapshot. You can specify
// only one attribute at a time.
//
-// For more information about EBS snapshots, see Amazon EBS snapshots (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSSnapshots.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// For more information about EBS snapshots, see Amazon EBS snapshots (https://docs.aws.amazon.com/ebs/latest/userguide/ebs-snapshots.html)
+// in the Amazon EBS User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -29551,8 +30007,11 @@ func (c *EC2) DescribeSnapshotsRequest(input *DescribeSnapshotsInput) (req *requ
//
// To get the state of fast snapshot restores for a snapshot, use DescribeFastSnapshotRestores.
//
-// For more information about EBS snapshots, see Amazon EBS snapshots (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSSnapshots.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// For more information about EBS snapshots, see Amazon EBS snapshots (https://docs.aws.amazon.com/ebs/latest/userguide/ebs-snapshots.html)
+// in the Amazon EBS User Guide.
+//
+// We strongly recommend using only paginated requests. Unpaginated requests
+// are susceptible to throttling and timeouts.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -29678,7 +30137,7 @@ func (c *EC2) DescribeSpotDatafeedSubscriptionRequest(input *DescribeSpotDatafee
//
// Describes the data feed for Spot Instances. For more information, see Spot
// Instance data feed (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-data-feeds.html)
-// in the Amazon EC2 User Guide for Linux Instances.
+// in the Amazon EC2 User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -30192,7 +30651,7 @@ func (c *EC2) DescribeSpotPriceHistoryRequest(input *DescribeSpotPriceHistoryInp
//
// Describes the Spot price history. For more information, see Spot Instance
// pricing history (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-spot-instances-history.html)
-// in the Amazon EC2 User Guide for Linux Instances.
+// in the Amazon EC2 User Guide.
//
// When you specify a start and end time, the operation returns the prices of
// the instance types within that time range. It also returns the last price
@@ -30329,12 +30788,8 @@ func (c *EC2) DescribeStaleSecurityGroupsRequest(input *DescribeStaleSecurityGro
//
// Describes the stale security group rules for security groups in a specified
// VPC. Rules are stale when they reference a deleted security group in the
-// same VPC, peered VPC, or in separate VPCs attached to a transit gateway (with
-// security group referencing support (https://docs.aws.amazon.com/vpc/latest/tgw/tgw-transit-gateways.html#create-tgw)
-// enabled). Rules can also be stale if they reference a security group in a
-// peer VPC for which the VPC peering connection has been deleted or if they
-// reference a security group in a VPC that has been detached from a transit
-// gateway.
+// same VPC or peered VPC. Rules can also be stale if they reference a security
+// group in a peer VPC for which the VPC peering connection has been deleted.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -30610,7 +31065,9 @@ func (c *EC2) DescribeSubnetsRequest(input *DescribeSubnetsInput) (req *request.
// DescribeSubnets API operation for Amazon Elastic Compute Cloud.
//
-// Describes one or more of your subnets.
+// Describes your subnets. The default is to describe all your subnets. Alternatively,
+// you can specify specific subnet IDs or filter the results to include only
+// the subnets that match specific criteria.
//
// For more information, see Subnets (https://docs.aws.amazon.com/vpc/latest/userguide/configure-subnets.html)
// in the Amazon VPC User Guide.
@@ -30748,6 +31205,13 @@ func (c *EC2) DescribeTagsRequest(input *DescribeTagsInput) (req *request.Reques
// For more information about tags, see Tag your Amazon EC2 resources (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
+// We strongly recommend using only paginated requests. Unpaginated requests
+// are susceptible to throttling and timeouts.
+//
+// The order of the elements in the response, including those within nested
+// structures, might vary. Applications should not assume the elements appear
+// in a particular order.
+//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
@@ -30827,6 +31291,79 @@ func (c *EC2) DescribeTagsPagesWithContext(ctx aws.Context, input *DescribeTagsI
return p.Err()
}
+const opDescribeTrafficMirrorFilterRules = "DescribeTrafficMirrorFilterRules"
+
+// DescribeTrafficMirrorFilterRulesRequest generates a "aws/request.Request" representing the
+// client's request for the DescribeTrafficMirrorFilterRules operation. The "output" return
+// value will be populated with the request's response once the request completes
+// successfully.
+//
+// Use "Send" method on the returned Request to send the API call to the service.
+// the "output" return value is not valid until after Send returns without error.
+//
+// See DescribeTrafficMirrorFilterRules for more information on using the DescribeTrafficMirrorFilterRules
+// API call, and error handling.
+//
+// This method is useful when you want to inject custom logic or configuration
+// into the SDK's request lifecycle. Such as custom headers, or retry logic.
+//
+// // Example sending a request using the DescribeTrafficMirrorFilterRulesRequest method.
+// req, resp := client.DescribeTrafficMirrorFilterRulesRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTrafficMirrorFilterRules
+func (c *EC2) DescribeTrafficMirrorFilterRulesRequest(input *DescribeTrafficMirrorFilterRulesInput) (req *request.Request, output *DescribeTrafficMirrorFilterRulesOutput) {
+ op := &request.Operation{
+ Name: opDescribeTrafficMirrorFilterRules,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &DescribeTrafficMirrorFilterRulesInput{}
+ }
+
+ output = &DescribeTrafficMirrorFilterRulesOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DescribeTrafficMirrorFilterRules API operation for Amazon Elastic Compute Cloud.
+//
+// Describe traffic mirror filters that determine the traffic that is mirrored.
+//
+// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
+// with awserr.Error's Code and Message methods to get detailed information about
+// the error.
+//
+// See the AWS API reference guide for Amazon Elastic Compute Cloud's
+// API operation DescribeTrafficMirrorFilterRules for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTrafficMirrorFilterRules
+func (c *EC2) DescribeTrafficMirrorFilterRules(input *DescribeTrafficMirrorFilterRulesInput) (*DescribeTrafficMirrorFilterRulesOutput, error) {
+ req, out := c.DescribeTrafficMirrorFilterRulesRequest(input)
+ return out, req.Send()
+}
+
+// DescribeTrafficMirrorFilterRulesWithContext is the same as DescribeTrafficMirrorFilterRules with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DescribeTrafficMirrorFilterRules for details on how to use this API operation.
+//
+// The context must be non-nil and will be used for request cancellation. If
+// the context is nil a panic will occur. In the future the SDK may create
+// sub-contexts for http.Requests. See https://golang.org/pkg/context/
+// for more information on using Contexts.
+func (c *EC2) DescribeTrafficMirrorFilterRulesWithContext(ctx aws.Context, input *DescribeTrafficMirrorFilterRulesInput, opts ...request.Option) (*DescribeTrafficMirrorFilterRulesOutput, error) {
+ req, out := c.DescribeTrafficMirrorFilterRulesRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opDescribeTrafficMirrorFilters = "DescribeTrafficMirrorFilters"
// DescribeTrafficMirrorFiltersRequest generates a "aws/request.Request" representing the
@@ -33350,8 +33887,8 @@ func (c *EC2) DescribeVolumeAttributeRequest(input *DescribeVolumeAttributeInput
// Describes the specified attribute of the specified volume. You can specify
// only one attribute at a time.
//
-// For more information about EBS volumes, see Amazon EBS volumes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumes.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// For more information about EBS volumes, see Amazon EBS volumes (https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volumes.html)
+// in the Amazon EBS User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -33448,8 +33985,8 @@ func (c *EC2) DescribeVolumeStatusRequest(input *DescribeVolumeStatusInput) (req
// If the status is insufficient-data, then the checks might still be taking
// place on your volume at the time. We recommend that you retry the request.
// For more information about volume status, see Monitor the status of your
-// volumes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-volume-status.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// volumes (https://docs.aws.amazon.com/ebs/latest/userguide/monitoring-volume-status.html)
+// in the Amazon EBS User Guide.
//
// Events: Reflect the cause of a volume status and might require you to take
// action. For example, if your volume returns an impaired status, then the
@@ -33467,6 +34004,10 @@ func (c *EC2) DescribeVolumeStatusRequest(input *DescribeVolumeStatusInput) (req
// the volume state. Therefore, volume status does not indicate volumes in the
// error state (for example, when a volume is incapable of accepting I/O.)
//
+// The order of the elements in the response, including those within nested
+// structures, might vary. Applications should not assume the elements appear
+// in a particular order.
+//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
@@ -33601,8 +34142,15 @@ func (c *EC2) DescribeVolumesRequest(input *DescribeVolumesInput) (req *request.
// the output to make the list more manageable. For more information, see Pagination
// (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination).
//
-// For more information about EBS volumes, see Amazon EBS volumes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumes.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// For more information about EBS volumes, see Amazon EBS volumes (https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volumes.html)
+// in the Amazon EBS User Guide.
+//
+// We strongly recommend using only paginated requests. Unpaginated requests
+// are susceptible to throttling and timeouts.
+//
+// The order of the elements in the response, including those within nested
+// structures, might vary. Applications should not assume the elements appear
+// in a particular order.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -33735,15 +34283,8 @@ func (c *EC2) DescribeVolumesModificationsRequest(input *DescribeVolumesModifica
// Describes the most recent volume modification request for the specified EBS
// volumes.
//
-// If a volume has never been modified, some information in the output will
-// be null. If a volume has been modified more than once, the output includes
-// only the most recent modification request.
-//
-// You can also use CloudWatch Events to check the status of a modification
-// to an EBS volume. For information about CloudWatch Events, see the Amazon
-// CloudWatch Events User Guide (https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/).
-// For more information, see Monitor the progress of volume modifications (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-volume-modifications.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// For more information, see Monitor the progress of volume modifications (https://docs.aws.amazon.com/ebs/latest/userguide/monitoring-volume-modifications.html)
+// in the Amazon EBS User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -34761,7 +35302,9 @@ func (c *EC2) DescribeVpcEndpointsRequest(input *DescribeVpcEndpointsInput) (req
// DescribeVpcEndpoints API operation for Amazon Elastic Compute Cloud.
//
-// Describes your VPC endpoints.
+// Describes your VPC endpoints. The default is to describe all your VPC endpoints.
+// Alternatively, you can specify specific VPC endpoint IDs or filter the results
+// to include only the VPC endpoints that match specific criteria.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -34891,7 +35434,10 @@ func (c *EC2) DescribeVpcPeeringConnectionsRequest(input *DescribeVpcPeeringConn
// DescribeVpcPeeringConnections API operation for Amazon Elastic Compute Cloud.
//
-// Describes one or more of your VPC peering connections.
+// Describes your VPC peering connections. The default is to describe all your
+// VPC peering connections. Alternatively, you can specify specific VPC peering
+// connection IDs or filter the results to include only the VPC peering connections
+// that match specific criteria.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -35021,7 +35567,9 @@ func (c *EC2) DescribeVpcsRequest(input *DescribeVpcsInput) (req *request.Reques
// DescribeVpcs API operation for Amazon Elastic Compute Cloud.
//
-// Describes one or more of your VPCs.
+// Describes your VPCs. The default is to describe all your VPCs. Alternatively,
+// you can specify specific VPC IDs or filter the results to include only the
+// VPCs that match specific criteria.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -35614,8 +36162,8 @@ func (c *EC2) DetachVolumeRequest(input *DetachVolumeInput) (req *request.Reques
// or Fargate tasks. Attempting to do this results in the UnsupportedOperationException
// exception with the Unable to detach volume attached to ECS tasks error message.
//
-// For more information, see Detach an Amazon EBS volume (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-detaching-volume.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// For more information, see Detach an Amazon EBS volume (https://docs.aws.amazon.com/ebs/latest/userguide/ebs-detaching-volume.html)
+// in the Amazon EBS User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -35771,7 +36319,7 @@ func (c *EC2) DisableAddressTransferRequest(input *DisableAddressTransferInput)
//
// Disables Elastic IP address transfer. For more information, see Transfer
// Elastic IP addresses (https://docs.aws.amazon.com/vpc/latest/userguide/vpc-eips.html#transfer-EIPs-intro)
-// in the Amazon Virtual Private Cloud User Guide.
+// in the Amazon VPC User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -35925,8 +36473,8 @@ func (c *EC2) DisableEbsEncryptionByDefaultRequest(input *DisableEbsEncryptionBy
// Disabling encryption by default does not change the encryption status of
// your existing volumes.
//
-// For more information, see Amazon EBS encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// For more information, see Amazon EBS encryption (https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption.html)
+// in the Amazon EBS User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -36357,6 +36905,87 @@ func (c *EC2) DisableImageDeprecationWithContext(ctx aws.Context, input *Disable
return out, req.Send()
}
+const opDisableImageDeregistrationProtection = "DisableImageDeregistrationProtection"
+
+// DisableImageDeregistrationProtectionRequest generates a "aws/request.Request" representing the
+// client's request for the DisableImageDeregistrationProtection operation. The "output" return
+// value will be populated with the request's response once the request completes
+// successfully.
+//
+// Use "Send" method on the returned Request to send the API call to the service.
+// the "output" return value is not valid until after Send returns without error.
+//
+// See DisableImageDeregistrationProtection for more information on using the DisableImageDeregistrationProtection
+// API call, and error handling.
+//
+// This method is useful when you want to inject custom logic or configuration
+// into the SDK's request lifecycle. Such as custom headers, or retry logic.
+//
+// // Example sending a request using the DisableImageDeregistrationProtectionRequest method.
+// req, resp := client.DisableImageDeregistrationProtectionRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableImageDeregistrationProtection
+func (c *EC2) DisableImageDeregistrationProtectionRequest(input *DisableImageDeregistrationProtectionInput) (req *request.Request, output *DisableImageDeregistrationProtectionOutput) {
+ op := &request.Operation{
+ Name: opDisableImageDeregistrationProtection,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &DisableImageDeregistrationProtectionInput{}
+ }
+
+ output = &DisableImageDeregistrationProtectionOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DisableImageDeregistrationProtection API operation for Amazon Elastic Compute Cloud.
+//
+// Disables deregistration protection for an AMI. When deregistration protection
+// is disabled, the AMI can be deregistered.
+//
+// If you chose to include a 24-hour cooldown period when you enabled deregistration
+// protection for the AMI, then, when you disable deregistration protection,
+// you won’t immediately be able to deregister the AMI.
+//
+// For more information, see Protect an AMI from deregistration (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/deregister-ami.html#ami-deregistration-protection)
+// in the Amazon EC2 User Guide.
+//
+// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
+// with awserr.Error's Code and Message methods to get detailed information about
+// the error.
+//
+// See the AWS API reference guide for Amazon Elastic Compute Cloud's
+// API operation DisableImageDeregistrationProtection for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableImageDeregistrationProtection
+func (c *EC2) DisableImageDeregistrationProtection(input *DisableImageDeregistrationProtectionInput) (*DisableImageDeregistrationProtectionOutput, error) {
+ req, out := c.DisableImageDeregistrationProtectionRequest(input)
+ return out, req.Send()
+}
+
+// DisableImageDeregistrationProtectionWithContext is the same as DisableImageDeregistrationProtection with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DisableImageDeregistrationProtection for details on how to use this API operation.
+//
+// The context must be non-nil and will be used for request cancellation. If
+// the context is nil a panic will occur. In the future the SDK may create
+// sub-contexts for http.Requests. See https://golang.org/pkg/context/
+// for more information on using Contexts.
+func (c *EC2) DisableImageDeregistrationProtectionWithContext(ctx aws.Context, input *DisableImageDeregistrationProtectionInput, opts ...request.Option) (*DisableImageDeregistrationProtectionOutput, error) {
+ req, out := c.DisableImageDeregistrationProtectionRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opDisableIpamOrganizationAdminAccount = "DisableIpamOrganizationAdminAccount"
// DisableIpamOrganizationAdminAccountRequest generates a "aws/request.Request" representing the
@@ -36561,8 +37190,8 @@ func (c *EC2) DisableSnapshotBlockPublicAccessRequest(input *DisableSnapshotBloc
// block public access, all snapshots that were previously publicly shared are
// no longer treated as private and they become publicly accessible again.
//
-// For more information, see Block public access for snapshots (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-public-access-snapshots.html)
-// in the Amazon Elastic Compute Cloud User Guide .
+// For more information, see Block public access for snapshots (https://docs.aws.amazon.com/ebs/latest/userguide/block-public-access-snapshots.html)
+// in the Amazon EBS User Guide .
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -38095,7 +38724,7 @@ func (c *EC2) EnableAddressTransferRequest(input *EnableAddressTransferInput) (r
//
// Enables Elastic IP address transfer. For more information, see Transfer Elastic
// IP addresses (https://docs.aws.amazon.com/vpc/latest/userguide/vpc-eips.html#transfer-EIPs-intro)
-// in the Amazon Virtual Private Cloud User Guide.
+// in the Amazon VPC User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -38246,8 +38875,8 @@ func (c *EC2) EnableEbsEncryptionByDefaultRequest(input *EnableEbsEncryptionByDe
// After you enable encryption by default, the EBS volumes that you create are
// always encrypted, either using the default KMS key or the KMS key that you
// specified when you created each volume. For more information, see Amazon
-// EBS encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// EBS encryption (https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption.html)
+// in the Amazon EBS User Guide.
//
// You can specify the default KMS key for encryption by default using ModifyEbsDefaultKmsKeyId
// or ResetEbsDefaultKmsKeyId.
@@ -38257,7 +38886,7 @@ func (c *EC2) EnableEbsEncryptionByDefaultRequest(input *EnableEbsEncryptionByDe
//
// After you enable encryption by default, you can no longer launch instances
// using instance types that do not support encryption. For more information,
-// see Supported instance types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#EBSEncryption_supported_instances).
+// see Supported instance types (https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption-requirements.html#ebs-encryption_supported_instances).
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -38418,8 +39047,8 @@ func (c *EC2) EnableFastSnapshotRestoresRequest(input *EnableFastSnapshotRestore
// state. To get the current state of fast snapshot restores, use DescribeFastSnapshotRestores.
// To disable fast snapshot restores, use DisableFastSnapshotRestores.
//
-// For more information, see Amazon EBS fast snapshot restore (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-fast-snapshot-restore.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// For more information, see Amazon EBS fast snapshot restore (https://docs.aws.amazon.com/ebs/latest/userguide/ebs-fast-snapshot-restore.html)
+// in the Amazon EBS User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -38690,6 +39319,86 @@ func (c *EC2) EnableImageDeprecationWithContext(ctx aws.Context, input *EnableIm
return out, req.Send()
}
+const opEnableImageDeregistrationProtection = "EnableImageDeregistrationProtection"
+
+// EnableImageDeregistrationProtectionRequest generates a "aws/request.Request" representing the
+// client's request for the EnableImageDeregistrationProtection operation. The "output" return
+// value will be populated with the request's response once the request completes
+// successfully.
+//
+// Use "Send" method on the returned Request to send the API call to the service.
+// the "output" return value is not valid until after Send returns without error.
+//
+// See EnableImageDeregistrationProtection for more information on using the EnableImageDeregistrationProtection
+// API call, and error handling.
+//
+// This method is useful when you want to inject custom logic or configuration
+// into the SDK's request lifecycle. Such as custom headers, or retry logic.
+//
+// // Example sending a request using the EnableImageDeregistrationProtectionRequest method.
+// req, resp := client.EnableImageDeregistrationProtectionRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableImageDeregistrationProtection
+func (c *EC2) EnableImageDeregistrationProtectionRequest(input *EnableImageDeregistrationProtectionInput) (req *request.Request, output *EnableImageDeregistrationProtectionOutput) {
+ op := &request.Operation{
+ Name: opEnableImageDeregistrationProtection,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &EnableImageDeregistrationProtectionInput{}
+ }
+
+ output = &EnableImageDeregistrationProtectionOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// EnableImageDeregistrationProtection API operation for Amazon Elastic Compute Cloud.
+//
+// Enables deregistration protection for an AMI. When deregistration protection
+// is enabled, the AMI can't be deregistered.
+//
+// To allow the AMI to be deregistered, you must first disable deregistration
+// protection using DisableImageDeregistrationProtection.
+//
+// For more information, see Protect an AMI from deregistration (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/deregister-ami.html#ami-deregistration-protection)
+// in the Amazon EC2 User Guide.
+//
+// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
+// with awserr.Error's Code and Message methods to get detailed information about
+// the error.
+//
+// See the AWS API reference guide for Amazon Elastic Compute Cloud's
+// API operation EnableImageDeregistrationProtection for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableImageDeregistrationProtection
+func (c *EC2) EnableImageDeregistrationProtection(input *EnableImageDeregistrationProtectionInput) (*EnableImageDeregistrationProtectionOutput, error) {
+ req, out := c.EnableImageDeregistrationProtectionRequest(input)
+ return out, req.Send()
+}
+
+// EnableImageDeregistrationProtectionWithContext is the same as EnableImageDeregistrationProtection with the addition of
+// the ability to pass a context and additional request options.
+//
+// See EnableImageDeregistrationProtection for details on how to use this API operation.
+//
+// The context must be non-nil and will be used for request cancellation. If
+// the context is nil a panic will occur. In the future the SDK may create
+// sub-contexts for http.Requests. See https://golang.org/pkg/context/
+// for more information on using Contexts.
+func (c *EC2) EnableImageDeregistrationProtectionWithContext(ctx aws.Context, input *EnableImageDeregistrationProtectionInput, opts ...request.Option) (*EnableImageDeregistrationProtectionOutput, error) {
+ req, out := c.EnableImageDeregistrationProtectionRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opEnableIpamOrganizationAdminAccount = "EnableIpamOrganizationAdminAccount"
// EnableIpamOrganizationAdminAccountRequest generates a "aws/request.Request" representing the
@@ -38976,8 +39685,8 @@ func (c *EC2) EnableSnapshotBlockPublicAccessRequest(input *EnableSnapshotBlockP
// shared are no longer treated as private and they become publicly accessible
// again.
//
-// For more information, see Block public access for snapshots (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-public-access-snapshots.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// For more information, see Block public access for snapshots (https://docs.aws.amazon.com/ebs/latest/userguide/block-public-access-snapshots.html)
+// in the Amazon EBS User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -39665,8 +40374,8 @@ func (c *EC2) ExportTransitGatewayRoutesRequest(input *ExportTransitGatewayRoute
// by CIDR range.
//
// The routes are saved to the specified bucket in a JSON file. For more information,
-// see Export Route Tables to Amazon S3 (https://docs.aws.amazon.com/vpc/latest/tgw/tgw-route-tables.html#tgw-export-route-tables)
-// in Transit Gateways.
+// see Export route tables to Amazon S3 (https://docs.aws.amazon.com/vpc/latest/tgw/tgw-route-tables.html#tgw-export-route-tables)
+// in the Amazon Web Services Transit Gateways Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -40233,15 +40942,6 @@ func (c *EC2) GetConsoleOutputRequest(input *GetConsoleOutputInput) (req *reques
// instances, the instance console output includes the last three system event
// log errors.
//
-// By default, the console output returns buffered information that was posted
-// shortly after an instance transition state (start, stop, reboot, or terminate).
-// This information is available for at least one hour after the most recent
-// post. Only the most recent 64 KB of console output is available.
-//
-// You can optionally retrieve the latest serial console output at any time
-// during the instance lifecycle. This option is supported on instance types
-// that use the Nitro hypervisor.
-//
// For more information, see Instance console output (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-console.html#instance-console-console-output)
// in the Amazon EC2 User Guide.
//
@@ -40320,6 +41020,9 @@ func (c *EC2) GetConsoleScreenshotRequest(input *GetConsoleScreenshotInput) (req
//
// The returned content is Base64-encoded.
//
+// For more information, see Instance console output (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/troubleshoot-unreachable-instance.html#instance-console-console-output)
+// in the Amazon EC2 User Guide.
+//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
@@ -40472,8 +41175,8 @@ func (c *EC2) GetEbsDefaultKmsKeyIdRequest(input *GetEbsDefaultKmsKeyIdInput) (r
// in this Region. You can change the default KMS key for encryption by default
// using ModifyEbsDefaultKmsKeyId or ResetEbsDefaultKmsKeyId.
//
-// For more information, see Amazon EBS encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// For more information, see Amazon EBS encryption (https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption.html)
+// in the Amazon EBS User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -40549,8 +41252,8 @@ func (c *EC2) GetEbsEncryptionByDefaultRequest(input *GetEbsEncryptionByDefaultI
// Describes whether EBS encryption by default is enabled for your account in
// the current Region.
//
-// For more information, see Amazon EBS encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// For more information, see Amazon EBS encryption (https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption.html)
+// in the Amazon EBS User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -40954,6 +41657,158 @@ func (c *EC2) GetImageBlockPublicAccessStateWithContext(ctx aws.Context, input *
return out, req.Send()
}
+const opGetInstanceMetadataDefaults = "GetInstanceMetadataDefaults"
+
+// GetInstanceMetadataDefaultsRequest generates a "aws/request.Request" representing the
+// client's request for the GetInstanceMetadataDefaults operation. The "output" return
+// value will be populated with the request's response once the request completes
+// successfully.
+//
+// Use "Send" method on the returned Request to send the API call to the service.
+// the "output" return value is not valid until after Send returns without error.
+//
+// See GetInstanceMetadataDefaults for more information on using the GetInstanceMetadataDefaults
+// API call, and error handling.
+//
+// This method is useful when you want to inject custom logic or configuration
+// into the SDK's request lifecycle. Such as custom headers, or retry logic.
+//
+// // Example sending a request using the GetInstanceMetadataDefaultsRequest method.
+// req, resp := client.GetInstanceMetadataDefaultsRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetInstanceMetadataDefaults
+func (c *EC2) GetInstanceMetadataDefaultsRequest(input *GetInstanceMetadataDefaultsInput) (req *request.Request, output *GetInstanceMetadataDefaultsOutput) {
+ op := &request.Operation{
+ Name: opGetInstanceMetadataDefaults,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &GetInstanceMetadataDefaultsInput{}
+ }
+
+ output = &GetInstanceMetadataDefaultsOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// GetInstanceMetadataDefaults API operation for Amazon Elastic Compute Cloud.
+//
+// Gets the default instance metadata service (IMDS) settings that are set at
+// the account level in the specified Amazon Web Services Region.
+//
+// For more information, see Order of precedence for instance metadata options
+// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-options.html#instance-metadata-options-order-of-precedence)
+// in the Amazon EC2 User Guide.
+//
+// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
+// with awserr.Error's Code and Message methods to get detailed information about
+// the error.
+//
+// See the AWS API reference guide for Amazon Elastic Compute Cloud's
+// API operation GetInstanceMetadataDefaults for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetInstanceMetadataDefaults
+func (c *EC2) GetInstanceMetadataDefaults(input *GetInstanceMetadataDefaultsInput) (*GetInstanceMetadataDefaultsOutput, error) {
+ req, out := c.GetInstanceMetadataDefaultsRequest(input)
+ return out, req.Send()
+}
+
+// GetInstanceMetadataDefaultsWithContext is the same as GetInstanceMetadataDefaults with the addition of
+// the ability to pass a context and additional request options.
+//
+// See GetInstanceMetadataDefaults for details on how to use this API operation.
+//
+// The context must be non-nil and will be used for request cancellation. If
+// the context is nil a panic will occur. In the future the SDK may create
+// sub-contexts for http.Requests. See https://golang.org/pkg/context/
+// for more information on using Contexts.
+func (c *EC2) GetInstanceMetadataDefaultsWithContext(ctx aws.Context, input *GetInstanceMetadataDefaultsInput, opts ...request.Option) (*GetInstanceMetadataDefaultsOutput, error) {
+ req, out := c.GetInstanceMetadataDefaultsRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opGetInstanceTpmEkPub = "GetInstanceTpmEkPub"
+
+// GetInstanceTpmEkPubRequest generates a "aws/request.Request" representing the
+// client's request for the GetInstanceTpmEkPub operation. The "output" return
+// value will be populated with the request's response once the request completes
+// successfully.
+//
+// Use "Send" method on the returned Request to send the API call to the service.
+// the "output" return value is not valid until after Send returns without error.
+//
+// See GetInstanceTpmEkPub for more information on using the GetInstanceTpmEkPub
+// API call, and error handling.
+//
+// This method is useful when you want to inject custom logic or configuration
+// into the SDK's request lifecycle. Such as custom headers, or retry logic.
+//
+// // Example sending a request using the GetInstanceTpmEkPubRequest method.
+// req, resp := client.GetInstanceTpmEkPubRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetInstanceTpmEkPub
+func (c *EC2) GetInstanceTpmEkPubRequest(input *GetInstanceTpmEkPubInput) (req *request.Request, output *GetInstanceTpmEkPubOutput) {
+ op := &request.Operation{
+ Name: opGetInstanceTpmEkPub,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &GetInstanceTpmEkPubInput{}
+ }
+
+ output = &GetInstanceTpmEkPubOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// GetInstanceTpmEkPub API operation for Amazon Elastic Compute Cloud.
+//
+// Gets the public endorsement key associated with the Nitro Trusted Platform
+// Module (NitroTPM) for the specified instance.
+//
+// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
+// with awserr.Error's Code and Message methods to get detailed information about
+// the error.
+//
+// See the AWS API reference guide for Amazon Elastic Compute Cloud's
+// API operation GetInstanceTpmEkPub for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetInstanceTpmEkPub
+func (c *EC2) GetInstanceTpmEkPub(input *GetInstanceTpmEkPubInput) (*GetInstanceTpmEkPubOutput, error) {
+ req, out := c.GetInstanceTpmEkPubRequest(input)
+ return out, req.Send()
+}
+
+// GetInstanceTpmEkPubWithContext is the same as GetInstanceTpmEkPub with the addition of
+// the ability to pass a context and additional request options.
+//
+// See GetInstanceTpmEkPub for details on how to use this API operation.
+//
+// The context must be non-nil and will be used for request cancellation. If
+// the context is nil a panic will occur. In the future the SDK may create
+// sub-contexts for http.Requests. See https://golang.org/pkg/context/
+// for more information on using Contexts.
+func (c *EC2) GetInstanceTpmEkPubWithContext(ctx aws.Context, input *GetInstanceTpmEkPubInput, opts ...request.Option) (*GetInstanceTpmEkPubOutput, error) {
+ req, out := c.GetInstanceTpmEkPubRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opGetInstanceTypesFromInstanceRequirements = "GetInstanceTypesFromInstanceRequirements"
// GetInstanceTypesFromInstanceRequirementsRequest generates a "aws/request.Request" representing the
@@ -41712,7 +42567,7 @@ func (c *EC2) GetIpamPoolAllocationsRequest(input *GetIpamPoolAllocationsInput)
//
// If you use this action after AllocateIpamPoolCidr (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_AllocateIpamPoolCidr.html)
// or ReleaseIpamPoolAllocation (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ReleaseIpamPoolAllocation.html),
-// note that all EC2 API actions follow an eventual consistency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/query-api-troubleshooting.html#eventual-consistency)
+// note that all EC2 API actions follow an eventual consistency (https://docs.aws.amazon.com/ec2/latest/devguide/eventual-consistency.html)
// model.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -42107,8 +42962,8 @@ func (c *EC2) GetLaunchTemplateDataRequest(input *GetLaunchTemplateDataInput) (r
// This action calls on other describe actions to get instance information.
// Depending on your instance configuration, you may need to allow the following
// actions in your IAM policy: DescribeSpotInstanceRequests, DescribeInstanceCreditSpecifications,
-// DescribeVolumes, DescribeInstanceAttribute, and DescribeElasticGpus. Or,
-// you can allow describe* depending on your instance requirements.
+// DescribeVolumes, and DescribeInstanceAttribute. Or, you can allow describe*
+// depending on your instance requirements.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -42649,8 +43504,8 @@ func (c *EC2) GetPasswordDataRequest(input *GetPasswordDataInput) (req *request.
//
// The Windows password is generated at boot by the EC2Config service or EC2Launch
// scripts (Windows Server 2016 and later). This usually only happens the first
-// time an instance is launched. For more information, see EC2Config (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/UsingConfig_WinAMI.html)
-// and EC2Launch (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2launch.html)
+// time an instance is launched. For more information, see EC2Config (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UsingConfig_WinAMI.html)
+// and EC2Launch (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2launch.html)
// in the Amazon EC2 User Guide.
//
// For the EC2Config service, the password is not generated for rebundled AMIs
@@ -43022,8 +43877,8 @@ func (c *EC2) GetSnapshotBlockPublicAccessStateRequest(input *GetSnapshotBlockPu
// Gets the current state of block public access for snapshots setting for the
// account and Region.
//
-// For more information, see Block public access for snapshots (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-public-access-snapshots.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// For more information, see Block public access for snapshots (https://docs.aws.amazon.com/ebs/latest/userguide/block-public-access-snapshots.html)
+// in the Amazon EBS User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -45516,11 +46371,7 @@ func (c *EC2) ModifyAvailabilityZoneGroupRequest(input *ModifyAvailabilityZoneGr
// ModifyAvailabilityZoneGroup API operation for Amazon Elastic Compute Cloud.
//
-// Changes the opt-in status of the Local Zone and Wavelength Zone group for
-// your account.
-//
-// Use DescribeAvailabilityZones (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeAvailabilityZones.html)
-// to view the value for GroupName.
+// Changes the opt-in status of the specified zone group for your account.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -45925,8 +46776,8 @@ func (c *EC2) ModifyEbsDefaultKmsKeyIdRequest(input *ModifyEbsDefaultKmsKeyIdInp
// If you delete or disable the customer managed KMS key that you specified
// for use with encryption by default, your instances will fail to launch.
//
-// For more information, see Amazon EBS encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// For more information, see Amazon EBS encryption (https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption.html)
+// in the Amazon EBS User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -46963,6 +47814,86 @@ func (c *EC2) ModifyInstanceMaintenanceOptionsWithContext(ctx aws.Context, input
return out, req.Send()
}
+const opModifyInstanceMetadataDefaults = "ModifyInstanceMetadataDefaults"
+
+// ModifyInstanceMetadataDefaultsRequest generates a "aws/request.Request" representing the
+// client's request for the ModifyInstanceMetadataDefaults operation. The "output" return
+// value will be populated with the request's response once the request completes
+// successfully.
+//
+// Use "Send" method on the returned Request to send the API call to the service.
+// the "output" return value is not valid until after Send returns without error.
+//
+// See ModifyInstanceMetadataDefaults for more information on using the ModifyInstanceMetadataDefaults
+// API call, and error handling.
+//
+// This method is useful when you want to inject custom logic or configuration
+// into the SDK's request lifecycle. Such as custom headers, or retry logic.
+//
+// // Example sending a request using the ModifyInstanceMetadataDefaultsRequest method.
+// req, resp := client.ModifyInstanceMetadataDefaultsRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstanceMetadataDefaults
+func (c *EC2) ModifyInstanceMetadataDefaultsRequest(input *ModifyInstanceMetadataDefaultsInput) (req *request.Request, output *ModifyInstanceMetadataDefaultsOutput) {
+ op := &request.Operation{
+ Name: opModifyInstanceMetadataDefaults,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &ModifyInstanceMetadataDefaultsInput{}
+ }
+
+ output = &ModifyInstanceMetadataDefaultsOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// ModifyInstanceMetadataDefaults API operation for Amazon Elastic Compute Cloud.
+//
+// Modifies the default instance metadata service (IMDS) settings at the account
+// level in the specified Amazon Web Services Region.
+//
+// To remove a parameter's account-level default setting, specify no-preference.
+// If an account-level setting is cleared with no-preference, then the instance
+// launch considers the other instance metadata settings. For more information,
+// see Order of precedence for instance metadata options (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-options.html#instance-metadata-options-order-of-precedence)
+// in the Amazon EC2 User Guide.
+//
+// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
+// with awserr.Error's Code and Message methods to get detailed information about
+// the error.
+//
+// See the AWS API reference guide for Amazon Elastic Compute Cloud's
+// API operation ModifyInstanceMetadataDefaults for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstanceMetadataDefaults
+func (c *EC2) ModifyInstanceMetadataDefaults(input *ModifyInstanceMetadataDefaultsInput) (*ModifyInstanceMetadataDefaultsOutput, error) {
+ req, out := c.ModifyInstanceMetadataDefaultsRequest(input)
+ return out, req.Send()
+}
+
+// ModifyInstanceMetadataDefaultsWithContext is the same as ModifyInstanceMetadataDefaults with the addition of
+// the ability to pass a context and additional request options.
+//
+// See ModifyInstanceMetadataDefaults for details on how to use this API operation.
+//
+// The context must be non-nil and will be used for request cancellation. If
+// the context is nil a panic will occur. In the future the SDK may create
+// sub-contexts for http.Requests. See https://golang.org/pkg/context/
+// for more information on using Contexts.
+func (c *EC2) ModifyInstanceMetadataDefaultsWithContext(ctx aws.Context, input *ModifyInstanceMetadataDefaultsInput, opts ...request.Option) (*ModifyInstanceMetadataDefaultsOutput, error) {
+ req, out := c.ModifyInstanceMetadataDefaultsRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opModifyInstanceMetadataOptions = "ModifyInstanceMetadataOptions"
// ModifyInstanceMetadataOptionsRequest generates a "aws/request.Request" representing the
@@ -47091,7 +48022,7 @@ func (c *EC2) ModifyInstancePlacementRequest(input *ModifyInstancePlacementInput
//
// - Modify the affinity between an instance and a Dedicated Host (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-overview.html).
// When affinity is set to host and the instance is not associated with a
-// specific Dedicated Host, the next time the instance is launched, it is
+// specific Dedicated Host, the next time the instance is started, it is
// automatically associated with the host on which it lands. If the instance
// is restarted or rebooted, this relationship persists.
//
@@ -47938,7 +48869,7 @@ func (c *EC2) ModifyReservedInstancesRequest(input *ModifyReservedInstancesInput
// must be identical, except for Availability Zone, network platform, and instance
// type.
//
-// For more information, see Modifying Reserved Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-modifying.html)
+// For more information, see Modify Reserved Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-modifying.html)
// in the Amazon EC2 User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -48098,8 +49029,8 @@ func (c *EC2) ModifySnapshotAttributeRequest(input *ModifySnapshotAttributeInput
// cannot be shared with other accounts.
//
// For more information about modifying snapshot permissions, see Share a snapshot
-// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-modifying-snapshot-permissions.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// (https://docs.aws.amazon.com/ebs/latest/userguide/ebs-modifying-snapshot-permissions.html)
+// in the Amazon EBS User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -48176,8 +49107,8 @@ func (c *EC2) ModifySnapshotTierRequest(input *ModifySnapshotTierInput) (req *re
// to a full snapshot that includes all of the blocks of data that were written
// to the volume at the time the snapshot was created, and moved from the standard
// tier to the archive tier. For more information, see Archive Amazon EBS snapshots
-// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshot-archive.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// (https://docs.aws.amazon.com/ebs/latest/userguide/snapshot-archive.html)
+// in the Amazon EBS User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -49410,21 +50341,15 @@ func (c *EC2) ModifyVolumeRequest(input *ModifyVolumeInput) (req *request.Reques
// size, volume type, and IOPS capacity. If your EBS volume is attached to a
// current-generation EC2 instance type, you might be able to apply these changes
// without stopping the instance or detaching the volume from it. For more information
-// about modifying EBS volumes, see Amazon EBS Elastic Volumes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-modify-volume.html)
-// (Linux instances) or Amazon EBS Elastic Volumes (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ebs-modify-volume.html)
-// (Windows instances).
+// about modifying EBS volumes, see Amazon EBS Elastic Volumes (https://docs.aws.amazon.com/ebs/latest/userguide/ebs-modify-volume.html)
+// in the Amazon EBS User Guide.
//
// When you complete a resize operation on your volume, you need to extend the
// volume's file-system size to take advantage of the new storage capacity.
-// For more information, see Extend a Linux file system (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html#recognize-expanded-volume-linux)
-// or Extend a Windows file system (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ebs-expand-volume.html#recognize-expanded-volume-windows).
+// For more information, see Extend the file system (https://docs.aws.amazon.com/ebs/latest/userguide/recognize-expanded-volume-linux.html).
//
-// You can use CloudWatch Events to check the status of a modification to an
-// EBS volume. For information about CloudWatch Events, see the Amazon CloudWatch
-// Events User Guide (https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/).
-// You can also track the status of a modification using DescribeVolumesModifications.
-// For information about tracking status changes using either method, see Monitor
-// the progress of volume modifications (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-volume-modifications.html).
+// For more information, see Monitor the progress of volume modifications (https://docs.aws.amazon.com/ebs/latest/userguide/monitoring-volume-modifications.html)
+// in the Amazon EBS User Guide.
//
// With previous-generation instance types, resizing an EBS volume might require
// detaching and reattaching the volume or stopping and restarting the instance.
@@ -50802,7 +51727,7 @@ func (c *EC2) ProvisionByoipCidrRequest(input *ProvisionByoipCidrInput) (req *re
// you and that you created an RPKI ROA to authorize Amazon ASNs 16509 and 14618
// to advertise the address range. For more information, see Bring your own
// IP addresses (BYOIP) (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// in the Amazon EC2 User Guide.
//
// Provisioning an address range is an asynchronous operation, so the call returns
// immediately, but the address range is not ready to use until its status changes
@@ -51275,7 +52200,7 @@ func (c *EC2) PurchaseReservedInstancesOfferingRequest(input *PurchaseReservedIn
// If you do not specify a purchase time, the default is the current time.
//
// For more information, see Reserved Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts-on-demand-reserved-instances.html)
-// and Reserved Instance Marketplace (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html)
+// and Sell in the Reserved Instance Marketplace (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html)
// in the Amazon EC2 User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -51517,9 +52442,9 @@ func (c *EC2) RegisterImageRequest(input *RegisterImageInput) (req *request.Requ
// RegisterImage API operation for Amazon Elastic Compute Cloud.
//
-// Registers an AMI. When you're creating an AMI, this is the final step you
-// must complete before you can launch an instance from the AMI. For more information
-// about creating AMIs, see Create your own AMI (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami.html)
+// Registers an AMI. When you're creating an instance-store backed AMI, registering
+// the AMI is the final step in the creation process. For more information about
+// creating AMIs, see Create your own AMI (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// For Amazon EBS-backed instances, CreateImage creates and registers the AMI
@@ -51720,9 +52645,9 @@ func (c *EC2) RegisterTransitGatewayMulticastGroupMembersRequest(input *Register
//
// Registers members (network interfaces) with the transit gateway multicast
// group. A member is a network interface associated with a supported EC2 instance
-// that receives multicast traffic. For information about supported instances,
-// see Multicast Consideration (https://docs.aws.amazon.com/vpc/latest/tgw/transit-gateway-limits.html#multicast-limits)
-// in Amazon VPC Transit Gateways.
+// that receives multicast traffic. For more information, see Multicast on transit
+// gateways (https://docs.aws.amazon.com/vpc/latest/tgw/tgw-multicast-overview.html)
+// in the Amazon Web Services Transit Gateways Guide.
//
// After you add the members, use SearchTransitGatewayMulticastGroups (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_SearchTransitGatewayMulticastGroups.html)
// to verify that the members were added to the transit gateway multicast group.
@@ -51802,9 +52727,9 @@ func (c *EC2) RegisterTransitGatewayMulticastGroupSourcesRequest(input *Register
// multicast group.
//
// A multicast source is a network interface attached to a supported instance
-// that sends multicast traffic. For information about supported instances,
-// see Multicast Considerations (https://docs.aws.amazon.com/vpc/latest/tgw/transit-gateway-limits.html#multicast-limits)
-// in Amazon VPC Transit Gateways.
+// that sends multicast traffic. For more information about supported instances,
+// see Multicast on transit gateways (https://docs.aws.amazon.com/vpc/latest/tgw/tgw-multicast-overview.html)
+// in the Amazon Web Services Transit Gateways Guide.
//
// After you add the source, use SearchTransitGatewayMulticastGroups (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_SearchTransitGatewayMulticastGroups.html)
// to verify that the source was added to the multicast group.
@@ -52437,7 +53362,7 @@ func (c *EC2) ReleaseIpamPoolAllocationRequest(input *ReleaseIpamPoolAllocationI
// For more information, see Release an allocation (https://docs.aws.amazon.com/vpc/latest/ipam/release-alloc-ipam.html)
// in the Amazon VPC IPAM User Guide.
//
-// All EC2 API actions follow an eventual consistency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/query-api-troubleshooting.html#eventual-consistency)
+// All EC2 API actions follow an eventual consistency (https://docs.aws.amazon.com/ec2/latest/devguide/eventual-consistency.html)
// model.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -53235,13 +54160,13 @@ func (c *EC2) RequestSpotInstancesRequest(input *RequestSpotInstancesInput) (req
//
// Creates a Spot Instance request.
//
-// For more information, see Spot Instance requests (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-requests.html)
-// in the Amazon EC2 User Guide for Linux Instances.
+// For more information, see Work with Spot Instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-requests.html)
+// in the Amazon EC2 User Guide.
//
// We strongly discourage using the RequestSpotInstances API because it is a
// legacy API with no planned investment. For options for requesting Spot Instances,
// see Which is the best Spot request method to use? (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-best-practices.html#which-spot-request-method-to-use)
-// in the Amazon EC2 User Guide for Linux Instances.
+// in the Amazon EC2 User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -53394,8 +54319,8 @@ func (c *EC2) ResetEbsDefaultKmsKeyIdRequest(input *ResetEbsDefaultKmsKeyIdInput
// After resetting the default KMS key to the Amazon Web Services managed KMS
// key, you can continue to encrypt by a customer managed KMS key by specifying
// it when you create the volume. For more information, see Amazon EBS encryption
-// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// (https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption.html) in
+// the Amazon EBS User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -53624,7 +54549,7 @@ func (c *EC2) ResetInstanceAttributeRequest(input *ResetInstanceAttributeInput)
// The sourceDestCheck attribute controls whether source/destination checking
// is enabled. The default value is true, which means checking is enabled. This
// value must be false for a NAT instance to perform NAT. For more information,
-// see NAT Instances (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_NAT_Instance.html)
+// see NAT instances (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_NAT_Instance.html)
// in the Amazon VPC User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -53777,8 +54702,8 @@ func (c *EC2) ResetSnapshotAttributeRequest(input *ResetSnapshotAttributeInput)
// Resets permission settings for the specified snapshot.
//
// For more information about modifying snapshot permissions, see Share a snapshot
-// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-modifying-snapshot-permissions.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// (https://docs.aws.amazon.com/ebs/latest/userguide/ebs-modifying-snapshot-permissions.html)
+// in the Amazon EBS User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -54079,8 +55004,8 @@ func (c *EC2) RestoreSnapshotFromRecycleBinRequest(input *RestoreSnapshotFromRec
// RestoreSnapshotFromRecycleBin API operation for Amazon Elastic Compute Cloud.
//
// Restores a snapshot from the Recycle Bin. For more information, see Restore
-// snapshots from the Recycle Bin (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recycle-bin-working-with-snaps.html#recycle-bin-restore-snaps)
-// in the Amazon Elastic Compute Cloud User Guide.
+// snapshots from the Recycle Bin (https://docs.aws.amazon.com/ebs/latest/userguide/recycle-bin-working-with-snaps.html#recycle-bin-restore-snaps)
+// in the Amazon EBS User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -54157,10 +55082,10 @@ func (c *EC2) RestoreSnapshotTierRequest(input *RestoreSnapshotTierInput) (req *
// or modifies the restore period or restore type for a snapshot that was previously
// temporarily restored.
//
-// For more information see Restore an archived snapshot (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/working-with-snapshot-archiving.html#restore-archived-snapshot)
+// For more information see Restore an archived snapshot (https://docs.aws.amazon.com/ebs/latest/userguide/working-with-snapshot-archiving.html#restore-archived-snapshot)
// and modify the restore period or restore type for a temporarily restored
-// snapshot (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/working-with-snapshot-archiving.html#modify-temp-restore-period)
-// in the Amazon Elastic Compute Cloud User Guide.
+// snapshot (https://docs.aws.amazon.com/ebs/latest/userguide/working-with-snapshot-archiving.html#modify-temp-restore-period)
+// in the Amazon EBS User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -54513,7 +55438,7 @@ func (c *EC2) RunInstancesRequest(input *RunInstancesInput) (req *request.Reques
// see Instance types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html).
//
// - If you don't specify a security group ID, we use the default security
-// group. For more information, see Security groups (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html).
+// group for the VPC. For more information, see Security groups (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html).
//
// - If any of the AMIs have a product code attached for which the user has
// not subscribed, the request fails.
@@ -54527,6 +55452,9 @@ func (c *EC2) RunInstancesRequest(input *RunInstancesInput) (req *request.Reques
// batches. For example, create five separate launch requests for 100 instances
// each instead of one launch request for 500 instances.
//
+// RunInstances is subject to both request rate limiting and resource rate limiting.
+// For more information, see Request throttling (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-throttling.html).
+//
// An instance is ready for you to use when it's in the running state. You can
// check the state of your instance using DescribeInstances. You can tag instances
// and EBS volumes during launch, after launch, or both. For more information,
@@ -54620,9 +55548,7 @@ func (c *EC2) RunScheduledInstancesRequest(input *RunScheduledInstancesInput) (r
// You must launch a Scheduled Instance during its scheduled time period. You
// can't stop or reboot a Scheduled Instance, but you can terminate it as needed.
// If you terminate a Scheduled Instance before the current scheduled time period
-// ends, you can launch it again after a few minutes. For more information,
-// see Scheduled Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-scheduled-instances.html)
-// in the Amazon EC2 User Guide.
+// ends, you can launch it again after a few minutes.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -55046,8 +55972,7 @@ func (c *EC2) SendDiagnosticInterruptRequest(input *SendDiagnosticInterruptInput
// For more information about configuring your operating system to generate
// a crash dump when a kernel panic or stop error occurs, see Send a diagnostic
// interrupt (for advanced users) (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/diagnostic-interrupt.html)
-// (Linux instances) or Send a diagnostic interrupt (for advanced users) (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/diagnostic-interrupt.html)
-// (Windows instances).
+// in the Amazon EC2 User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -55137,12 +56062,12 @@ func (c *EC2) StartInstancesRequest(input *StartInstancesInput) (req *request.Re
// Performing this operation on an instance that uses an instance store as its
// root device returns an error.
//
-// If you attempt to start a T3 instance with host tenancy and the unlimted
+// If you attempt to start a T3 instance with host tenancy and the unlimited
// CPU credit option, the request fails. The unlimited CPU credit option is
// not supported on Dedicated Hosts. Before you start the instance, either change
// its CPU credit option to standard, or change its tenancy to default or dedicated.
//
-// For more information, see Stop and start your instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html)
+// For more information, see Stop and start Amazon EC2 instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html)
// in the Amazon EC2 User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -55444,13 +56369,13 @@ func (c *EC2) StopInstancesRequest(input *StopInstancesInput) (req *request.Requ
// StopInstances API operation for Amazon Elastic Compute Cloud.
//
// Stops an Amazon EBS-backed instance. For more information, see Stop and start
-// your instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html)
+// Amazon EC2 instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html)
// in the Amazon EC2 User Guide.
//
// You can use the Stop action to hibernate an instance if the instance is enabled
// for hibernation (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/enabling-hibernation.html)
// and it meets the hibernation prerequisites (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hibernating-prerequisites.html).
-// For more information, see Hibernate your instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html)
+// For more information, see Hibernate your Amazon EC2 instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html)
// in the Amazon EC2 User Guide.
//
// We don't charge usage for a stopped instance, or data transfer fees; however,
@@ -57942,7 +58867,7 @@ func (s *AddressAttribute) SetPublicIp(v string) *AddressAttribute {
// Details on the Elastic IP address transfer. For more information, see Transfer
// Elastic IP addresses (https://docs.aws.amazon.com/vpc/latest/userguide/vpc-eips.html#transfer-EIPs-intro)
-// in the Amazon Virtual Private Cloud User Guide.
+// in the Amazon VPC User Guide.
type AddressTransfer struct {
_ struct{} `type:"structure"`
@@ -58170,9 +59095,6 @@ type AllocateAddressInput struct {
// which Amazon Web Services advertises IP addresses. Use this parameter to
// limit the IP address to this location. IP addresses cannot move between network
// border groups.
- //
- // Use DescribeAvailabilityZones (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeAvailabilityZones.html)
- // to view the network border groups.
NetworkBorderGroup *string `type:"string"`
// The ID of an address pool that you own. Use this parameter to let Amazon
@@ -58362,7 +59284,7 @@ type AllocateHostsInput struct {
// see Understanding auto-placement and affinity (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/how-dedicated-hosts-work.html#dedicated-hosts-understanding)
// in the Amazon EC2 User Guide.
//
- // Default: on
+ // Default: off
AutoPlacement *string `locationName:"autoPlacement" type:"string" enum:"AutoPlacement"`
// The Availability Zone in which to allocate the Dedicated Host.
@@ -58574,7 +59496,7 @@ type AllocateIpamPoolCidrInput struct {
Cidr *string `type:"string"`
// A unique, case-sensitive identifier that you provide to ensure the idempotency
- // of the request. For more information, see Ensuring Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // of the request. For more information, see Ensuring idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// A description for the allocation.
@@ -60194,7 +61116,7 @@ type AssociateClientVpnTargetNetworkInput struct {
_ struct{} `type:"structure"`
// Unique, case-sensitive identifier that you provide to ensure the idempotency
- // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // of the request. For more information, see Ensuring idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// The ID of the Client VPN endpoint.
@@ -61635,7 +62557,7 @@ type AssociateTrunkInterfaceInput struct {
BranchInterfaceId *string `type:"string" required:"true"`
// Unique, case-sensitive identifier that you provide to ensure the idempotency
- // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html).
+ // of the request. For more information, see Ensuring idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// Checks whether you have the required permissions for the action, without
@@ -61730,7 +62652,7 @@ type AssociateTrunkInterfaceOutput struct {
_ struct{} `type:"structure"`
// Unique, case-sensitive identifier that you provide to ensure the idempotency
- // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html).
+ // of the request. For more information, see Ensuring idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `locationName:"clientToken" type:"string"`
// Information about the association between the trunk network interface and
@@ -61974,12 +62896,12 @@ type AssociatedRole struct {
// The name of the Amazon S3 bucket in which the Amazon S3 object is stored.
CertificateS3BucketName *string `locationName:"certificateS3BucketName" type:"string"`
- // The key of the Amazon S3 object ey where the certificate, certificate chain,
- // and encrypted private key bundle is stored. The object key is formated as
- // follows: role_arn/certificate_arn.
+ // The key of the Amazon S3 object where the certificate, certificate chain,
+ // and encrypted private key bundle are stored. The object key is formatted
+ // as follows: role_arn/certificate_arn.
CertificateS3ObjectKey *string `locationName:"certificateS3ObjectKey" type:"string"`
- // The ID of the KMS customer master key (CMK) used to encrypt the private key.
+ // The ID of the KMS key used to encrypt the private key.
EncryptionKmsKeyId *string `locationName:"encryptionKmsKeyId" type:"string"`
}
@@ -62552,8 +63474,8 @@ type AttachVerifiedAccessTrustProviderInput struct {
_ struct{} `type:"structure"`
// A unique, case-sensitive token that you provide to ensure idempotency of
- // your modification request. For more information, see Ensuring Idempotency
- // (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // your modification request. For more information, see Ensuring idempotency
+ // (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// Checks whether you have the required permissions for the action, without
@@ -63110,7 +64032,7 @@ type AuthorizeClientVpnIngressInput struct {
AuthorizeAllGroups *bool `type:"boolean"`
// Unique, case-sensitive identifier that you provide to ensure the idempotency
- // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // of the request. For more information, see Ensuring idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// The ID of the Client VPN endpoint.
@@ -63244,7 +64166,7 @@ func (s *AuthorizeClientVpnIngressOutput) SetStatus(v *ClientVpnAuthorizationRul
type AuthorizeSecurityGroupEgressInput struct {
_ struct{} `type:"structure"`
- // Not supported. Use a set of IP permissions to specify the CIDR.
+ // Not supported. Use IP permissions instead.
CidrIp *string `locationName:"cidrIp" type:"string"`
// Checks whether you have the required permissions for the action, without
@@ -63253,7 +64175,7 @@ type AuthorizeSecurityGroupEgressInput struct {
// it is UnauthorizedOperation.
DryRun *bool `locationName:"dryRun" type:"boolean"`
- // Not supported. Use a set of IP permissions to specify the port.
+ // Not supported. Use IP permissions instead.
FromPort *int64 `locationName:"fromPort" type:"integer"`
// The ID of the security group.
@@ -63261,26 +64183,22 @@ type AuthorizeSecurityGroupEgressInput struct {
// GroupId is a required field
GroupId *string `locationName:"groupId" type:"string" required:"true"`
- // The sets of IP permissions. You can't specify a destination security group
- // and a CIDR IP address range in the same set of permissions.
+ // The permissions for the security group rules.
IpPermissions []*IpPermission `locationName:"ipPermissions" locationNameList:"item" type:"list"`
- // Not supported. Use a set of IP permissions to specify the protocol name or
- // number.
+ // Not supported. Use IP permissions instead.
IpProtocol *string `locationName:"ipProtocol" type:"string"`
- // Not supported. Use a set of IP permissions to specify a destination security
- // group.
+ // Not supported. Use IP permissions instead.
SourceSecurityGroupName *string `locationName:"sourceSecurityGroupName" type:"string"`
- // Not supported. Use a set of IP permissions to specify a destination security
- // group.
+ // Not supported. Use IP permissions instead.
SourceSecurityGroupOwnerId *string `locationName:"sourceSecurityGroupOwnerId" type:"string"`
// The tags applied to the security group rule.
TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"`
- // Not supported. Use a set of IP permissions to specify the port.
+ // Not supported. Use IP permissions instead.
ToPort *int64 `locationName:"toPort" type:"integer"`
}
@@ -63418,12 +64336,12 @@ func (s *AuthorizeSecurityGroupEgressOutput) SetSecurityGroupRules(v []*Security
type AuthorizeSecurityGroupIngressInput struct {
_ struct{} `type:"structure"`
- // The IPv4 address range, in CIDR format. You can't specify this parameter
- // when specifying a source security group. To specify an IPv6 address range,
- // use a set of IP permissions.
+ // The IPv4 address range, in CIDR format.
+ //
+ // To specify an IPv6 address range, use IP permissions instead.
//
- // Alternatively, use a set of IP permissions to specify multiple rules and
- // a description for the rule.
+ // To specify multiple rules and descriptions for the rules, use IP permissions
+ // instead.
CidrIp *string `type:"string"`
// Checks whether you have the required permissions for the action, without
@@ -63433,63 +64351,58 @@ type AuthorizeSecurityGroupIngressInput struct {
DryRun *bool `locationName:"dryRun" type:"boolean"`
// If the protocol is TCP or UDP, this is the start of the port range. If the
- // protocol is ICMP, this is the type number. A value of -1 indicates all ICMP
- // types. If you specify all ICMP types, you must specify all ICMP codes.
+ // protocol is ICMP, this is the ICMP type or -1 (all ICMP types).
//
- // Alternatively, use a set of IP permissions to specify multiple rules and
- // a description for the rule.
+ // To specify multiple rules and descriptions for the rules, use IP permissions
+ // instead.
FromPort *int64 `type:"integer"`
- // The ID of the security group. You must specify either the security group
- // ID or the security group name in the request. For security groups in a nondefault
- // VPC, you must specify the security group ID.
+ // The ID of the security group.
GroupId *string `type:"string"`
- // [Default VPC] The name of the security group. You must specify either the
- // security group ID or the security group name in the request. For security
- // groups in a nondefault VPC, you must specify the security group ID.
+ // [Default VPC] The name of the security group. For security groups for a default
+ // VPC you can specify either the ID or the name of the security group. For
+ // security groups for a nondefault VPC, you must specify the ID of the security
+ // group.
GroupName *string `type:"string"`
- // The sets of IP permissions.
+ // The permissions for the security group rules.
IpPermissions []*IpPermission `locationNameList:"item" type:"list"`
// The IP protocol name (tcp, udp, icmp) or number (see Protocol Numbers (http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml)).
- // To specify icmpv6, use a set of IP permissions.
+ // To specify all protocols, use -1.
//
- // Use -1 to specify all protocols. If you specify -1 or a protocol other than
- // tcp, udp, or icmp, traffic on all ports is allowed, regardless of any ports
- // you specify.
+ // To specify icmpv6, use IP permissions instead.
//
- // Alternatively, use a set of IP permissions to specify multiple rules and
- // a description for the rule.
+ // If you specify a protocol other than one of the supported values, traffic
+ // is allowed on all ports, regardless of any ports that you specify.
+ //
+ // To specify multiple rules and descriptions for the rules, use IP permissions
+ // instead.
IpProtocol *string `type:"string"`
- // [Default VPC] The name of the source security group. You can't specify this
- // parameter in combination with the following parameters: the CIDR IP address
- // range, the start of the port range, the IP protocol, and the end of the port
- // range. Creates rules that grant full ICMP, UDP, and TCP access. To create
- // a rule with a specific IP protocol and port range, use a set of IP permissions
- // instead. The source security group must be in the same VPC.
+ // [Default VPC] The name of the source security group.
+ //
+ // The rule grants full ICMP, UDP, and TCP access. To create a rule with a specific
+ // protocol and port range, specify a set of IP permissions instead.
SourceSecurityGroupName *string `type:"string"`
- // [Nondefault VPC] The Amazon Web Services account ID for the source security
- // group, if the source security group is in a different account. You can't
- // specify this parameter in combination with the following parameters: the
- // CIDR IP address range, the IP protocol, the start of the port range, and
- // the end of the port range. Creates rules that grant full ICMP, UDP, and TCP
- // access. To create a rule with a specific IP protocol and port range, use
- // a set of IP permissions instead.
+ // The Amazon Web Services account ID for the source security group, if the
+ // source security group is in a different account.
+ //
+ // The rule grants full ICMP, UDP, and TCP access. To create a rule with a specific
+ // protocol and port range, use IP permissions instead.
SourceSecurityGroupOwnerId *string `type:"string"`
- // [VPC Only] The tags applied to the security group rule.
+ // The tags applied to the security group rule.
TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"`
// If the protocol is TCP or UDP, this is the end of the port range. If the
- // protocol is ICMP, this is the code. A value of -1 indicates all ICMP codes.
- // If you specify all ICMP types, you must specify all ICMP codes.
+ // protocol is ICMP, this is the ICMP code or -1 (all ICMP codes). If the start
+ // port is -1 (all ICMP types), then the end port must be -1 (all ICMP codes).
//
- // Alternatively, use a set of IP permissions to specify multiple rules and
- // a description for the rule.
+ // To specify multiple rules and descriptions for the rules, use IP permissions
+ // instead.
ToPort *int64 `type:"integer"`
}
@@ -64037,12 +64950,8 @@ type BundleInstanceInput struct {
// The ID of the instance to bundle.
//
- // Type: String
- //
// Default: None
//
- // Required: Yes
- //
// InstanceId is a required field
InstanceId *string `type:"string" required:"true"`
@@ -64366,7 +65275,30 @@ type ByoipCidr struct {
// this time.
NetworkBorderGroup *string `locationName:"networkBorderGroup" type:"string"`
- // The state of the address pool.
+ // The state of the address range.
+ //
+ // * advertised: The address range is being advertised to the internet by
+ // Amazon Web Services.
+ //
+ // * deprovisioned: The address range is deprovisioned.
+ //
+ // * failed-deprovision: The request to deprovision the address range was
+ // unsuccessful. Ensure that all EIPs from the range have been deallocated
+ // and try again.
+ //
+ // * failed-provision: The request to provision the address range was unsuccessful.
+ //
+ // * pending-deprovision: You’ve submitted a request to deprovision an
+ // address range and it's pending.
+ //
+ // * pending-provision: You’ve submitted a request to provision an address
+ // range and it's pending.
+ //
+ // * provisioned: The address range is provisioned and can be advertised.
+ // The range is not currently advertised.
+ //
+ // * provisioned-not-publicly-advertisable: The address range is provisioned
+ // and cannot be advertised.
State *string `locationName:"state" type:"string" enum:"ByoipCidrState"`
// Upon success, contains the ID of the address pool. Otherwise, contains an
@@ -65269,6 +66201,8 @@ type CancelSpotFleetRequestsInput struct {
// The IDs of the Spot Fleet requests.
//
+ // Constraint: You can specify up to 100 IDs in a single request.
+ //
// SpotFleetRequestIds is a required field
SpotFleetRequestIds []*string `locationName:"spotFleetRequestId" locationNameList:"item" type:"list" required:"true"`
@@ -66722,7 +67656,7 @@ func (s *CertificateAuthenticationRequest) SetClientRootCertificateChainArn(v st
// Provides authorization for Amazon to bring a specific IP address range to
// a specific Amazon Web Services account using bring your own IP addresses
// (BYOIP). For more information, see Configuring your BYOIP address range (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html#prepare-for-byoip)
-// in the Amazon Elastic Compute Cloud User Guide.
+// in the Amazon EC2 User Guide.
type CidrAuthorizationContext struct {
_ struct{} `type:"structure"`
@@ -68710,7 +69644,7 @@ func (s *ConnectionNotification) SetVpcEndpointId(v string) *ConnectionNotificat
// A security group connection tracking configuration that enables you to set
// the idle timeout for connection tracking on an Elastic network interface.
// For more information, see Connection tracking timeouts (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-connection-tracking.html#connection-tracking-timeouts)
-// in the Amazon Elastic Compute Cloud User Guide.
+// in the Amazon EC2 User Guide.
type ConnectionTrackingConfiguration struct {
_ struct{} `type:"structure"`
@@ -68769,7 +69703,7 @@ func (s *ConnectionTrackingConfiguration) SetUdpTimeout(v int64) *ConnectionTrac
// A security group connection tracking specification that enables you to set
// the idle timeout for connection tracking on an Elastic network interface.
// For more information, see Connection tracking timeouts (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-connection-tracking.html#connection-tracking-timeouts)
-// in the Amazon Elastic Compute Cloud User Guide.
+// in the Amazon EC2 User Guide.
type ConnectionTrackingSpecification struct {
_ struct{} `type:"structure"`
@@ -68828,7 +69762,7 @@ func (s *ConnectionTrackingSpecification) SetUdpTimeout(v int64) *ConnectionTrac
// A security group connection tracking specification request that enables you
// to set the idle timeout for connection tracking on an Elastic network interface.
// For more information, see Connection tracking timeouts (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-connection-tracking.html#connection-tracking-timeouts)
-// in the Amazon Elastic Compute Cloud User Guide.
+// in the Amazon EC2 User Guide.
type ConnectionTrackingSpecificationRequest struct {
_ struct{} `type:"structure"`
@@ -68887,7 +69821,7 @@ func (s *ConnectionTrackingSpecificationRequest) SetUdpTimeout(v int64) *Connect
// A security group connection tracking specification response that enables
// you to set the idle timeout for connection tracking on an Elastic network
// interface. For more information, see Connection tracking timeouts (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-connection-tracking.html#connection-tracking-timeouts)
-// in the Amazon Elastic Compute Cloud User Guide.
+// in the Amazon EC2 User Guide.
type ConnectionTrackingSpecificationResponse struct {
_ struct{} `type:"structure"`
@@ -69036,7 +69970,7 @@ type CopyFpgaImageInput struct {
_ struct{} `type:"structure"`
// Unique, case-sensitive identifier that you provide to ensure the idempotency
- // of the request. For more information, see Ensuring idempotency (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html).
+ // of the request. For more information, see Ensuring idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string"`
// The description for the new AFI.
@@ -69195,8 +70129,8 @@ type CopyImageInput struct {
// or within the same Outpost.
//
// For more information, see Copy AMIs from an Amazon Web Services Region to
- // an Outpost (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshots-outposts.html#copy-amis)
- // in the Amazon EC2 User Guide.
+ // an Outpost (https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html#copy-amis)
+ // in the Amazon EBS User Guide.
DestinationOutpostArn *string `type:"string"`
// Checks whether you have the required permissions for the action, without
@@ -69210,8 +70144,8 @@ type CopyImageInput struct {
// create an unencrypted copy of an encrypted snapshot. The default KMS key
// for Amazon EBS is used unless you specify a non-default Key Management Service
// (KMS) KMS key using KmsKeyId. For more information, see Amazon EBS encryption
- // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html)
- // in the Amazon EC2 User Guide.
+ // (https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption.html) in
+ // the Amazon EBS User Guide.
Encrypted *bool `locationName:"encrypted" type:"boolean"`
// The identifier of the symmetric Key Management Service (KMS) KMS key to use
@@ -69252,6 +70186,19 @@ type CopyImageInput struct {
//
// SourceRegion is a required field
SourceRegion *string `type:"string" required:"true"`
+
+ // The tags to apply to the new AMI and new snapshots. You can tag the AMI,
+ // the snapshots, or both.
+ //
+ // * To tag the new AMI, the value for ResourceType must be image.
+ //
+ // * To tag the new snapshots, the value for ResourceType must be snapshot.
+ // The same tag is applied to all the new snapshots.
+ //
+ // If you specify other values for ResourceType, the request fails.
+ //
+ // To tag an AMI or snapshot after it has been created, see CreateTags (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html).
+ TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"`
}
// String returns the string representation.
@@ -69351,6 +70298,12 @@ func (s *CopyImageInput) SetSourceRegion(v string) *CopyImageInput {
return s
}
+// SetTagSpecifications sets the TagSpecifications field's value.
+func (s *CopyImageInput) SetTagSpecifications(v []*TagSpecification) *CopyImageInput {
+ s.TagSpecifications = v
+ return s
+}
+
// Contains the output of CopyImage.
type CopyImageOutput struct {
_ struct{} `type:"structure"`
@@ -69396,8 +70349,8 @@ type CopySnapshotInput struct {
// Outpost to another, or within the same Outpost.
//
// For more information, see Copy snapshots from an Amazon Web Services Region
- // to an Outpost (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshots-outposts.html#copy-snapshots)
- // in the Amazon Elastic Compute Cloud User Guide.
+ // to an Outpost (https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html#copy-snapshots)
+ // in the Amazon EBS User Guide.
DestinationOutpostArn *string `type:"string"`
// The destination Region to use in the PresignedUrl parameter of a snapshot
@@ -69420,13 +70373,13 @@ type CopySnapshotInput struct {
// not enabled, enable encryption using this parameter. Otherwise, omit this
// parameter. Encrypted snapshots are encrypted, even if you omit this parameter
// and encryption by default is not enabled. You cannot set this parameter to
- // false. For more information, see Amazon EBS encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html)
- // in the Amazon Elastic Compute Cloud User Guide.
+ // false. For more information, see Amazon EBS encryption (https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption.html)
+ // in the Amazon EBS User Guide.
Encrypted *bool `locationName:"encrypted" type:"boolean"`
- // The identifier of the Key Management Service (KMS) KMS key to use for Amazon
- // EBS encryption. If this parameter is not specified, your KMS key for Amazon
- // EBS is used. If KmsKeyId is specified, the encrypted state must be true.
+ // The identifier of the KMS key to use for Amazon EBS encryption. If this parameter
+ // is not specified, your KMS key for Amazon EBS is used. If KmsKeyId is specified,
+ // the encrypted state must be true.
//
// You can specify the KMS key using any of the following:
//
@@ -69454,9 +70407,9 @@ type CopySnapshotInput struct {
// for this parameter uses the same logic that is described in Authenticating
// Requests: Using Query Parameters (Amazon Web Services Signature Version 4)
// (https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html)
- // in the Amazon Simple Storage Service API Reference. An invalid or improperly
- // signed PresignedUrl will cause the copy operation to fail asynchronously,
- // and the snapshot will move to an error state.
+ // in the Amazon S3 API Reference. An invalid or improperly signed PresignedUrl
+ // will cause the copy operation to fail asynchronously, and the snapshot will
+ // move to an error state.
//
// PresignedUrl is a sensitive parameter and its value will be
// replaced with "sensitive" in string returned by CopySnapshotInput's
@@ -70291,7 +71244,7 @@ type CreateCarrierGatewayInput struct {
_ struct{} `type:"structure"`
// Unique, case-sensitive identifier that you provide to ensure the idempotency
- // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html).
+ // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// Checks whether you have the required permissions for the action, without
@@ -70421,7 +71374,7 @@ type CreateClientVpnEndpointInput struct {
ClientLoginBannerOptions *ClientLoginBannerOptions `type:"structure"`
// Unique, case-sensitive identifier that you provide to ensure the idempotency
- // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // of the request. For more information, see Ensuring idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// Information about the client connection logging options.
@@ -70707,7 +71660,7 @@ type CreateClientVpnRouteInput struct {
_ struct{} `type:"structure"`
// Unique, case-sensitive identifier that you provide to ensure the idempotency
- // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // of the request. For more information, see Ensuring idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// The ID of the Client VPN endpoint to which to add the route.
@@ -71056,11 +72009,22 @@ func (s *CreateCoipPoolOutput) SetCoipPool(v *CoipPool) *CreateCoipPoolOutput {
type CreateCustomerGatewayInput struct {
_ struct{} `type:"structure"`
- // For devices that support BGP, the customer gateway's BGP ASN.
+ // For customer gateway devices that support BGP, specify the device's ASN.
+ // You must specify either BgpAsn or BgpAsnExtended when creating the customer
+ // gateway. If the ASN is larger than 2,147,483,647, you must use BgpAsnExtended.
//
// Default: 65000
+ //
+ // Valid values: 1 to 2,147,483,647
BgpAsn *int64 `type:"integer"`
+ // For customer gateway devices that support BGP, specify the device's ASN.
+ // You must specify either BgpAsn or BgpAsnExtended when creating the customer
+ // gateway. If the ASN is larger than 2,147,483,647, you must use BgpAsnExtended.
+ //
+ // Valid values: 2,147,483,648 to 4,294,967,295
+ BgpAsnExtended *int64 `type:"long"`
+
// The Amazon Resource Name (ARN) for the customer gateway certificate.
CertificateArn *string `type:"string"`
@@ -71076,7 +72040,9 @@ type CreateCustomerGatewayInput struct {
DryRun *bool `locationName:"dryRun" type:"boolean"`
// IPv4 address for the customer gateway device's outside interface. The address
- // must be static.
+ // must be static. If OutsideIpAddressType in your VPN connection options is
+ // set to PrivateIpv4, you can use an RFC6598 or RFC1918 private IPv4 address.
+ // If OutsideIpAddressType is set to PublicIpv4, you can use a public IPv4 address.
IpAddress *string `type:"string"`
// This member has been deprecated. The Internet-routable IP address for the
@@ -71129,6 +72095,12 @@ func (s *CreateCustomerGatewayInput) SetBgpAsn(v int64) *CreateCustomerGatewayIn
return s
}
+// SetBgpAsnExtended sets the BgpAsnExtended field's value.
+func (s *CreateCustomerGatewayInput) SetBgpAsnExtended(v int64) *CreateCustomerGatewayInput {
+ s.BgpAsnExtended = &v
+ return s
+}
+
// SetCertificateArn sets the CertificateArn field's value.
func (s *CreateCustomerGatewayInput) SetCertificateArn(v string) *CreateCustomerGatewayInput {
s.CertificateArn = &v
@@ -71470,7 +72442,7 @@ type CreateEgressOnlyInternetGatewayInput struct {
_ struct{} `type:"structure"`
// Unique, case-sensitive identifier that you provide to ensure the idempotency
- // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html).
+ // of the request. For more information, see Ensuring idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string"`
// Checks whether you have the required permissions for the action, without
@@ -71589,11 +72561,11 @@ type CreateFleetError struct {
_ struct{} `type:"structure"`
// The error code that indicates why the instance could not be launched. For
- // more information about error codes, see Error codes (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html.html).
+ // more information about error codes, see Error codes (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html).
ErrorCode *string `locationName:"errorCode" type:"string"`
// The error message that describes why the instance could not be launched.
- // For more information about error messages, see Error codes (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html.html).
+ // For more information about error messages, see Error codes (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html).
ErrorMessage *string `locationName:"errorMessage" type:"string"`
// The launch templates and overrides that were used for launching the instances.
@@ -71996,18 +72968,19 @@ type CreateFlowLogsInput struct {
_ struct{} `type:"structure"`
// Unique, case-sensitive identifier that you provide to ensure the idempotency
- // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html).
+ // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string"`
// The ARN of the IAM role that allows Amazon EC2 to publish flow logs across
// accounts.
DeliverCrossAccountRole *string `type:"string"`
- // The ARN of the IAM role that allows Amazon EC2 to publish flow logs to a
- // CloudWatch Logs log group in your account.
+ // The ARN of the IAM role that allows Amazon EC2 to publish flow logs to the
+ // log destination.
//
- // This parameter is required if the destination type is cloud-watch-logs and
- // unsupported otherwise.
+ // This parameter is required if the destination type is cloud-watch-logs, or
+ // if the destination type is kinesis-data-firehose and the delivery stream
+ // and the resources to monitor are in different accounts.
DeliverLogsPermissionArn *string `type:"string"`
// The destination options.
@@ -72061,7 +73034,7 @@ type CreateFlowLogsInput struct {
// minute) or 600 seconds (10 minutes). This parameter must be 60 seconds for
// transit gateway resource types.
//
- // When a network interface is attached to a Nitro-based instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances),
+ // When a network interface is attached to a Nitro-based instance (https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html),
// the aggregation interval is always 60 seconds or less, regardless of the
// value that you specify.
//
@@ -72263,7 +73236,7 @@ type CreateFpgaImageInput struct {
_ struct{} `type:"structure"`
// Unique, case-sensitive identifier that you provide to ensure the idempotency
- // of the request. For more information, see Ensuring Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html).
+ // of the request. For more information, see Ensuring Idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string"`
// A description for the AFI.
@@ -72600,15 +73573,14 @@ type CreateInstanceConnectEndpointInput struct {
// it is UnauthorizedOperation.
DryRun *bool `type:"boolean"`
- // Indicates whether your client's IP address is preserved as the source. The
- // value is true or false.
+ // Indicates whether the client IP address is preserved as the source. The following
+ // are the possible values.
//
- // * If true, your client's IP address is used when you connect to a resource.
+ // * true - Use the client IP address as the source.
//
- // * If false, the elastic network interface IP address is used when you
- // connect to a resource.
+ // * false - Use the network interface IP address as the source.
//
- // Default: true
+ // Default: false
PreserveClientIp *bool `type:"boolean"`
// One or more security groups to associate with the endpoint. If you don't
@@ -73054,11 +74026,119 @@ func (s *CreateInternetGatewayOutput) SetInternetGateway(v *InternetGateway) *Cr
return s
}
+type CreateIpamExternalResourceVerificationTokenInput struct {
+ _ struct{} `type:"structure"`
+
+ // A unique, case-sensitive identifier that you provide to ensure the idempotency
+ // of the request. For more information, see Ensuring idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
+ ClientToken *string `type:"string" idempotencyToken:"true"`
+
+ // A check for whether you have the required permissions for the action without
+ // actually making the request and provides an error response. If you have the
+ // required permissions, the error response is DryRunOperation. Otherwise, it
+ // is UnauthorizedOperation.
+ DryRun *bool `type:"boolean"`
+
+ // The ID of the IPAM that will create the token.
+ //
+ // IpamId is a required field
+ IpamId *string `type:"string" required:"true"`
+
+ // Token tags.
+ TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"`
+}
+
+// String returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s CreateIpamExternalResourceVerificationTokenInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s CreateIpamExternalResourceVerificationTokenInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *CreateIpamExternalResourceVerificationTokenInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "CreateIpamExternalResourceVerificationTokenInput"}
+ if s.IpamId == nil {
+ invalidParams.Add(request.NewErrParamRequired("IpamId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetClientToken sets the ClientToken field's value.
+func (s *CreateIpamExternalResourceVerificationTokenInput) SetClientToken(v string) *CreateIpamExternalResourceVerificationTokenInput {
+ s.ClientToken = &v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *CreateIpamExternalResourceVerificationTokenInput) SetDryRun(v bool) *CreateIpamExternalResourceVerificationTokenInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetIpamId sets the IpamId field's value.
+func (s *CreateIpamExternalResourceVerificationTokenInput) SetIpamId(v string) *CreateIpamExternalResourceVerificationTokenInput {
+ s.IpamId = &v
+ return s
+}
+
+// SetTagSpecifications sets the TagSpecifications field's value.
+func (s *CreateIpamExternalResourceVerificationTokenInput) SetTagSpecifications(v []*TagSpecification) *CreateIpamExternalResourceVerificationTokenInput {
+ s.TagSpecifications = v
+ return s
+}
+
+type CreateIpamExternalResourceVerificationTokenOutput struct {
+ _ struct{} `type:"structure"`
+
+ // The verification token.
+ IpamExternalResourceVerificationToken *IpamExternalResourceVerificationToken `locationName:"ipamExternalResourceVerificationToken" type:"structure"`
+}
+
+// String returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s CreateIpamExternalResourceVerificationTokenOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s CreateIpamExternalResourceVerificationTokenOutput) GoString() string {
+ return s.String()
+}
+
+// SetIpamExternalResourceVerificationToken sets the IpamExternalResourceVerificationToken field's value.
+func (s *CreateIpamExternalResourceVerificationTokenOutput) SetIpamExternalResourceVerificationToken(v *IpamExternalResourceVerificationToken) *CreateIpamExternalResourceVerificationTokenOutput {
+ s.IpamExternalResourceVerificationToken = v
+ return s
+}
+
type CreateIpamInput struct {
_ struct{} `type:"structure"`
// A unique, case-sensitive identifier that you provide to ensure the idempotency
- // of the request. For more information, see Ensuring Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // of the request. For more information, see Ensuring idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// A description for the IPAM.
@@ -73228,7 +74308,7 @@ type CreateIpamPoolInput struct {
AwsService *string `type:"string" enum:"IpamPoolAwsService"`
// A unique, case-sensitive identifier that you provide to ensure the idempotency
- // of the request. For more information, see Ensuring Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // of the request. For more information, see Ensuring idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// A description for the IPAM pool.
@@ -73245,15 +74325,21 @@ type CreateIpamPoolInput struct {
// IpamScopeId is a required field
IpamScopeId *string `type:"string" required:"true"`
- // In IPAM, the locale is the Amazon Web Services Region where you want to make
- // an IPAM pool available for allocations. Only resources in the same Region
- // as the locale of the pool can get IP address allocations from the pool. You
- // can only allocate a CIDR for a VPC, for example, from an IPAM pool that shares
- // a locale with the VPC’s Region. Note that once you choose a Locale for
- // a pool, you cannot modify it. If you do not choose a locale, resources in
- // Regions others than the IPAM's home region cannot use CIDRs from this pool.
+ // The locale for the pool should be one of the following:
+ //
+ // * An Amazon Web Services Region where you want this IPAM pool to be available
+ // for allocations.
+ //
+ // * The network border group for an Amazon Web Services Local Zone where
+ // you want this IPAM pool to be available for allocations (supported Local
+ // Zones (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html#byoip-zone-avail)).
+ // This option is only available for IPAM IPv4 pools in the public scope.
//
- // Possible values: Any Amazon Web Services Region, such as us-east-1.
+ // If you do not choose a locale, resources in Regions others than the IPAM's
+ // home region cannot use CIDRs from this pool.
+ //
+ // Possible values: Any Amazon Web Services Region or supported Amazon Web Services
+ // Local Zone.
Locale *string `type:"string"`
// The IP address source for pools in the public scope. Only used for provisioning
@@ -73559,7 +74645,7 @@ type CreateIpamScopeInput struct {
_ struct{} `type:"structure"`
// A unique, case-sensitive identifier that you provide to ensure the idempotency
- // of the request. For more information, see Ensuring Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // of the request. For more information, see Ensuring idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// A description for the scope you're creating.
@@ -74023,29 +75109,35 @@ type CreateLaunchTemplateVersionInput struct {
// The ID of the launch template.
//
- // You must specify either the LaunchTemplateId or the LaunchTemplateName, but
- // not both.
+ // You must specify either the launch template ID or the launch template name,
+ // but not both.
LaunchTemplateId *string `type:"string"`
// The name of the launch template.
//
- // You must specify the LaunchTemplateName or the LaunchTemplateId, but not
- // both.
+ // You must specify either the launch template ID or the launch template name,
+ // but not both.
LaunchTemplateName *string `min:"3" type:"string"`
// If true, and if a Systems Manager parameter is specified for ImageId, the
// AMI ID is displayed in the response for imageID. For more information, see
// Use a Systems Manager parameter instead of an AMI ID (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html#use-an-ssm-parameter-instead-of-an-ami-id)
- // in the Amazon Elastic Compute Cloud User Guide.
+ // in the Amazon EC2 User Guide.
//
// Default: false
ResolveAlias *bool `type:"boolean"`
- // The version number of the launch template version on which to base the new
- // version. The new version inherits the same launch parameters as the source
- // version, except for parameters that you specify in LaunchTemplateData. Snapshots
+ // The version of the launch template on which to base the new version. Snapshots
// applied to the block device mapping are ignored when creating a new version
// unless they are explicitly included.
+ //
+ // If you specify this parameter, the new version inherits the launch parameters
+ // from the source version. If you specify additional launch parameters for
+ // the new version, they overwrite any corresponding launch parameters inherited
+ // from the source version.
+ //
+ // If you omit this parameter, the new version contains only the launch parameters
+ // that you specify for the new version.
SourceVersion *string `type:"string"`
// A description for the version of the launch template.
@@ -74652,7 +75744,7 @@ type CreateManagedPrefixListInput struct {
AddressFamily *string `type:"string" required:"true"`
// Unique, case-sensitive identifier you provide to ensure the idempotency of
- // the request. For more information, see Ensuring Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // the request. For more information, see Ensuring idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
//
// Constraints: Up to 255 UTF-8 characters in length.
ClientToken *string `type:"string" idempotencyToken:"true"`
@@ -74812,7 +75904,7 @@ type CreateNatGatewayInput struct {
AllocationId *string `type:"string"`
// Unique, case-sensitive identifier that you provide to ensure the idempotency
- // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // of the request. For more information, see Ensuring idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
//
// Constraint: Maximum 64 ASCII characters.
ClientToken *string `type:"string" idempotencyToken:"true"`
@@ -75181,6 +76273,10 @@ func (s CreateNetworkAclEntryOutput) GoString() string {
type CreateNetworkAclInput struct {
_ struct{} `type:"structure"`
+ // Unique, case-sensitive identifier that you provide to ensure the idempotency
+ // of the request. For more information, see Ensuring idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
+ ClientToken *string `type:"string" idempotencyToken:"true"`
+
// Checks whether you have the required permissions for the action, without
// actually making the request, and provides an error response. If you have
// the required permissions, the error response is DryRunOperation. Otherwise,
@@ -75227,6 +76323,12 @@ func (s *CreateNetworkAclInput) Validate() error {
return nil
}
+// SetClientToken sets the ClientToken field's value.
+func (s *CreateNetworkAclInput) SetClientToken(v string) *CreateNetworkAclInput {
+ s.ClientToken = &v
+ return s
+}
+
// SetDryRun sets the DryRun field's value.
func (s *CreateNetworkAclInput) SetDryRun(v bool) *CreateNetworkAclInput {
s.DryRun = &v
@@ -75248,6 +76350,10 @@ func (s *CreateNetworkAclInput) SetVpcId(v string) *CreateNetworkAclInput {
type CreateNetworkAclOutput struct {
_ struct{} `type:"structure"`
+ // Unique, case-sensitive identifier to ensure the idempotency of the request.
+ // Only returned if a client token was provided in the request.
+ ClientToken *string `locationName:"clientToken" type:"string"`
+
// Information about the network ACL.
NetworkAcl *NetworkAcl `locationName:"networkAcl" type:"structure"`
}
@@ -75270,6 +76376,12 @@ func (s CreateNetworkAclOutput) GoString() string {
return s.String()
}
+// SetClientToken sets the ClientToken field's value.
+func (s *CreateNetworkAclOutput) SetClientToken(v string) *CreateNetworkAclOutput {
+ s.ClientToken = &v
+ return s
+}
+
// SetNetworkAcl sets the NetworkAcl field's value.
func (s *CreateNetworkAclOutput) SetNetworkAcl(v *NetworkAcl) *CreateNetworkAclOutput {
s.NetworkAcl = v
@@ -75280,7 +76392,7 @@ type CreateNetworkInsightsAccessScopeInput struct {
_ struct{} `type:"structure"`
// Unique, case-sensitive identifier that you provide to ensure the idempotency
- // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// Checks whether you have the required permissions for the action, without
@@ -75391,7 +76503,7 @@ type CreateNetworkInsightsPathInput struct {
_ struct{} `type:"structure"`
// Unique, case-sensitive identifier that you provide to ensure the idempotency
- // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// The ID or ARN of the destination. If the resource is in another account,
@@ -75573,7 +76685,7 @@ type CreateNetworkInterfaceInput struct {
_ struct{} `type:"structure"`
// Unique, case-sensitive identifier that you provide to ensure the idempotency
- // of the request. For more information, see Ensuring Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // of the request. For more information, see Ensuring idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// A connection tracking specification for the network interface.
@@ -76120,6 +77232,13 @@ type CreatePublicIpv4PoolInput struct {
// is UnauthorizedOperation.
DryRun *bool `type:"boolean"`
+ // The Availability Zone (AZ) or Local Zone (LZ) network border group that the
+ // resource that the IP address is assigned to is in. Defaults to an AZ network
+ // border group. For more information on available Local Zones, see Local Zone
+ // availability (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html#byoip-zone-avail)
+ // in the Amazon EC2 User Guide.
+ NetworkBorderGroup *string `type:"string"`
+
// The key/value combination of a tag assigned to the resource. Use the tag
// key in the filter name and the tag value as the filter value. For example,
// to find all resources that have a tag with the key Owner and the value TeamA,
@@ -76151,6 +77270,12 @@ func (s *CreatePublicIpv4PoolInput) SetDryRun(v bool) *CreatePublicIpv4PoolInput
return s
}
+// SetNetworkBorderGroup sets the NetworkBorderGroup field's value.
+func (s *CreatePublicIpv4PoolInput) SetNetworkBorderGroup(v string) *CreatePublicIpv4PoolInput {
+ s.NetworkBorderGroup = &v
+ return s
+}
+
// SetTagSpecifications sets the TagSpecifications field's value.
func (s *CreatePublicIpv4PoolInput) SetTagSpecifications(v []*TagSpecification) *CreatePublicIpv4PoolInput {
s.TagSpecifications = v
@@ -76194,7 +77319,7 @@ type CreateReplaceRootVolumeTaskInput struct {
// Unique, case-sensitive identifier you provide to ensure the idempotency of
// the request. If you do not specify a client token, a randomly generated token
// is used for the request to ensure idempotency. For more information, see
- // Ensuring idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // Ensuring idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// Indicates whether to automatically delete the original root volume after
@@ -76822,6 +77947,10 @@ func (s *CreateRouteOutput) SetReturn(v bool) *CreateRouteOutput {
type CreateRouteTableInput struct {
_ struct{} `type:"structure"`
+ // Unique, case-sensitive identifier that you provide to ensure the idempotency
+ // of the request. For more information, see Ensuring idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
+ ClientToken *string `type:"string" idempotencyToken:"true"`
+
// Checks whether you have the required permissions for the action, without
// actually making the request, and provides an error response. If you have
// the required permissions, the error response is DryRunOperation. Otherwise,
@@ -76868,6 +77997,12 @@ func (s *CreateRouteTableInput) Validate() error {
return nil
}
+// SetClientToken sets the ClientToken field's value.
+func (s *CreateRouteTableInput) SetClientToken(v string) *CreateRouteTableInput {
+ s.ClientToken = &v
+ return s
+}
+
// SetDryRun sets the DryRun field's value.
func (s *CreateRouteTableInput) SetDryRun(v bool) *CreateRouteTableInput {
s.DryRun = &v
@@ -76889,6 +78024,10 @@ func (s *CreateRouteTableInput) SetVpcId(v string) *CreateRouteTableInput {
type CreateRouteTableOutput struct {
_ struct{} `type:"structure"`
+ // Unique, case-sensitive identifier to ensure the idempotency of the request.
+ // Only returned if a client token was provided in the request.
+ ClientToken *string `locationName:"clientToken" type:"string"`
+
// Information about the route table.
RouteTable *RouteTable `locationName:"routeTable" type:"structure"`
}
@@ -76911,6 +78050,12 @@ func (s CreateRouteTableOutput) GoString() string {
return s.String()
}
+// SetClientToken sets the ClientToken field's value.
+func (s *CreateRouteTableOutput) SetClientToken(v string) *CreateRouteTableOutput {
+ s.ClientToken = &v
+ return s
+}
+
// SetRouteTable sets the RouteTable field's value.
func (s *CreateRouteTableOutput) SetRouteTable(v *RouteTable) *CreateRouteTableOutput {
s.RouteTable = v
@@ -77082,8 +78227,8 @@ type CreateSnapshotInput struct {
// must be created on the same Outpost as the volume.
//
// For more information, see Create local snapshots from volumes on an Outpost
- // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshots-outposts.html#create-snapshot)
- // in the Amazon Elastic Compute Cloud User Guide.
+ // (https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html#create-snapshot)
+ // in the Amazon EBS User Guide.
OutpostArn *string `type:"string"`
// The tags to apply to the snapshot during creation.
@@ -77191,8 +78336,8 @@ type CreateSnapshotsInput struct {
// must be created on the same Outpost as the instance.
//
// For more information, see Create multi-volume local snapshots from instances
- // on an Outpost (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshots-outposts.html#create-multivol-snapshot)
- // in the Amazon Elastic Compute Cloud User Guide.
+ // on an Outpost (https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html#create-multivol-snapshot)
+ // in the Amazon EBS User Guide.
OutpostArn *string `type:"string"`
// Tags to apply to every snapshot specified by the instance.
@@ -77672,7 +78817,7 @@ type CreateSubnetInput struct {
//
// To create a subnet in a Local Zone, set this value to the Local Zone ID,
// for example us-west-2-lax-1a. For information about the Regions that support
- // Local Zones, see Local Zones locations (http://aws.amazon.com/about-aws/global-infrastructure/localzones/locations/).
+ // Local Zones, see Available Local Zones (https://docs.aws.amazon.com/local-zones/latest/ug/available-local-zones.html).
//
// To create a subnet in an Outpost, set this value to the Availability Zone
// for the Outpost and specify the Outpost ARN.
@@ -77969,7 +79114,7 @@ type CreateTrafficMirrorFilterInput struct {
_ struct{} `type:"structure"`
// Unique, case-sensitive identifier that you provide to ensure the idempotency
- // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// The description of the Traffic Mirror filter.
@@ -78031,7 +79176,7 @@ type CreateTrafficMirrorFilterOutput struct {
_ struct{} `type:"structure"`
// Unique, case-sensitive identifier that you provide to ensure the idempotency
- // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `locationName:"clientToken" type:"string"`
// Information about the Traffic Mirror filter.
@@ -78072,7 +79217,7 @@ type CreateTrafficMirrorFilterRuleInput struct {
_ struct{} `type:"structure"`
// Unique, case-sensitive identifier that you provide to ensure the idempotency
- // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// The description of the Traffic Mirror rule.
@@ -78118,6 +79263,9 @@ type CreateTrafficMirrorFilterRuleInput struct {
// The source port range.
SourcePortRange *TrafficMirrorPortRangeRequest `type:"structure"`
+ // Traffic Mirroring tags specifications.
+ TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"`
+
// The type of traffic.
//
// TrafficDirection is a required field
@@ -78235,6 +79383,12 @@ func (s *CreateTrafficMirrorFilterRuleInput) SetSourcePortRange(v *TrafficMirror
return s
}
+// SetTagSpecifications sets the TagSpecifications field's value.
+func (s *CreateTrafficMirrorFilterRuleInput) SetTagSpecifications(v []*TagSpecification) *CreateTrafficMirrorFilterRuleInput {
+ s.TagSpecifications = v
+ return s
+}
+
// SetTrafficDirection sets the TrafficDirection field's value.
func (s *CreateTrafficMirrorFilterRuleInput) SetTrafficDirection(v string) *CreateTrafficMirrorFilterRuleInput {
s.TrafficDirection = &v
@@ -78251,7 +79405,7 @@ type CreateTrafficMirrorFilterRuleOutput struct {
_ struct{} `type:"structure"`
// Unique, case-sensitive identifier that you provide to ensure the idempotency
- // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `locationName:"clientToken" type:"string"`
// The Traffic Mirror rule.
@@ -78292,7 +79446,7 @@ type CreateTrafficMirrorSessionInput struct {
_ struct{} `type:"structure"`
// Unique, case-sensitive identifier that you provide to ensure the idempotency
- // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// The description of the Traffic Mirror session.
@@ -78346,9 +79500,9 @@ type CreateTrafficMirrorSessionInput struct {
TrafficMirrorTargetId *string `type:"string" required:"true"`
// The VXLAN ID for the Traffic Mirror session. For more information about the
- // VXLAN protocol, see RFC 7348 (https://tools.ietf.org/html/rfc7348). If you
- // do not specify a VirtualNetworkId, an account-wide unique id is chosen at
- // random.
+ // VXLAN protocol, see RFC 7348 (https://datatracker.ietf.org/doc/html/rfc7348).
+ // If you do not specify a VirtualNetworkId, an account-wide unique ID is chosen
+ // at random.
VirtualNetworkId *int64 `type:"integer"`
}
@@ -78456,7 +79610,7 @@ type CreateTrafficMirrorSessionOutput struct {
_ struct{} `type:"structure"`
// Unique, case-sensitive identifier that you provide to ensure the idempotency
- // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `locationName:"clientToken" type:"string"`
// Information about the Traffic Mirror session.
@@ -78497,7 +79651,7 @@ type CreateTrafficMirrorTargetInput struct {
_ struct{} `type:"structure"`
// Unique, case-sensitive identifier that you provide to ensure the idempotency
- // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// The description of the Traffic Mirror target.
@@ -78587,7 +79741,7 @@ type CreateTrafficMirrorTargetOutput struct {
_ struct{} `type:"structure"`
// Unique, case-sensitive identifier that you provide to ensure the idempotency
- // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `locationName:"clientToken" type:"string"`
// Information about the Traffic Mirror target.
@@ -80080,22 +81234,20 @@ type CreateTransitGatewayVpcAttachmentRequestOptions struct {
// Enable or disable IPv6 support. The default is disable.
Ipv6Support *string `type:"string" enum:"Ipv6SupportValue"`
+ //
+ // This parameter is in preview and may not be available for your account.
+ //
// Enables you to reference a security group across VPCs attached to a transit
- // gateway (TGW). Use this option to simplify security group management and
- // control of instance-to-instance traffic across VPCs that are connected by
- // transit gateway. You can also use this option to migrate from VPC peering
- // (which was the only option that supported security group referencing) to
- // transit gateways (which now also support security group referencing). This
- // option is disabled by default and there are no additional costs to use this
- // feature.
+ // gateway. Use this option to simplify security group management and control
+ // of instance-to-instance traffic across VPCs that are connected by transit
+ // gateway. You can also use this option to migrate from VPC peering (which
+ // was the only option that supported security group referencing) to transit
+ // gateways (which now also support security group referencing). This option
+ // is disabled by default and there are no additional costs to use this feature.
//
// If you don't enable or disable SecurityGroupReferencingSupport in the request,
// the attachment will inherit the security group referencing support setting
// on the transit gateway.
- //
- // For important information about this feature, see Create a transit gateway
- // attachment to a VPC (https://docs.aws.amazon.com/vpc/latest/tgw/tgw-vpc-attachments.html#create-vpc-attachment)
- // in the Amazon Web Services Transit Gateway Guide.
SecurityGroupReferencingSupport *string `type:"string" enum:"SecurityGroupReferencingSupportValue"`
}
@@ -80219,8 +81371,8 @@ type CreateVerifiedAccessEndpointInput struct {
AttachmentType *string `type:"string" required:"true" enum:"VerifiedAccessEndpointAttachmentType"`
// A unique, case-sensitive token that you provide to ensure idempotency of
- // your modification request. For more information, see Ensuring Idempotency
- // (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // your modification request. For more information, see Ensuring idempotency
+ // (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// A description for the Verified Access endpoint.
@@ -80531,8 +81683,8 @@ type CreateVerifiedAccessGroupInput struct {
_ struct{} `type:"structure"`
// A unique, case-sensitive token that you provide to ensure idempotency of
- // your modification request. For more information, see Ensuring Idempotency
- // (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // your modification request. For more information, see Ensuring idempotency
+ // (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// A description for the Verified Access group.
@@ -80667,8 +81819,8 @@ type CreateVerifiedAccessInstanceInput struct {
_ struct{} `type:"structure"`
// A unique, case-sensitive token that you provide to ensure idempotency of
- // your modification request. For more information, see Ensuring Idempotency
- // (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // your modification request. For more information, see Ensuring idempotency
+ // (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// A description for the Verified Access instance.
@@ -80814,8 +81966,8 @@ type CreateVerifiedAccessTrustProviderInput struct {
_ struct{} `type:"structure"`
// A unique, case-sensitive token that you provide to ensure idempotency of
- // your modification request. For more information, see Ensuring Idempotency
- // (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // your modification request. For more information, see Ensuring idempotency
+ // (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// A description for the Verified Access trust provider.
@@ -81094,7 +82246,7 @@ type CreateVolumeInput struct {
AvailabilityZone *string `type:"string" required:"true"`
// Unique, case-sensitive identifier that you provide to ensure the idempotency
- // of the request. For more information, see Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // of the request. For more information, see Ensure Idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// Checks whether you have the required permissions for the action, without
@@ -81106,11 +82258,11 @@ type CreateVolumeInput struct {
// Indicates whether the volume should be encrypted. The effect of setting the
// encryption state to true depends on the volume origin (new or from a snapshot),
// starting encryption state, ownership, and whether encryption by default is
- // enabled. For more information, see Encryption by default (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#encryption-by-default)
- // in the Amazon Elastic Compute Cloud User Guide.
+ // enabled. For more information, see Encryption by default (https://docs.aws.amazon.com/ebs/latest/userguide/work-with-ebs-encr.html#encryption-by-default)
+ // in the Amazon EBS User Guide.
//
// Encrypted Amazon EBS volumes must be attached to instances that support Amazon
- // EBS encryption. For more information, see Supported instance types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#EBSEncryption_supported_instances).
+ // EBS encryption. For more information, see Supported instance types (https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption-requirements.html#ebs-encryption_supported_instances).
Encrypted *bool `locationName:"encrypted" type:"boolean"`
// The number of I/O operations per second (IOPS). For gp3, io1, and io2 volumes,
@@ -81127,7 +82279,7 @@ type CreateVolumeInput struct {
// * io2: 100 - 256,000 IOPS
//
// For io2 volumes, you can achieve up to 256,000 IOPS on instances built on
- // the Nitro System (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances).
+ // the Nitro System (https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html).
// On other instances, you can achieve performance up to 32,000 IOPS.
//
// This parameter is required for io1 and io2 volumes. The default for gp3 volumes
@@ -81135,9 +82287,9 @@ type CreateVolumeInput struct {
// volumes.
Iops *int64 `type:"integer"`
- // The identifier of the Key Management Service (KMS) KMS key to use for Amazon
- // EBS encryption. If this parameter is not specified, your KMS key for Amazon
- // EBS is used. If KmsKeyId is specified, the encrypted state must be true.
+ // The identifier of the KMS key to use for Amazon EBS encryption. If this parameter
+ // is not specified, your KMS key for Amazon EBS is used. If KmsKeyId is specified,
+ // the encrypted state must be true.
//
// You can specify the KMS key using any of the following:
//
@@ -81156,13 +82308,18 @@ type CreateVolumeInput struct {
// Indicates whether to enable Amazon EBS Multi-Attach. If you enable Multi-Attach,
// you can attach the volume to up to 16 Instances built on the Nitro System
- // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances)
+ // (https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html)
// in the same Availability Zone. This parameter is supported with io1 and io2
- // volumes only. For more information, see Amazon EBS Multi-Attach (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volumes-multi.html)
- // in the Amazon Elastic Compute Cloud User Guide.
+ // volumes only. For more information, see Amazon EBS Multi-Attach (https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volumes-multi.html)
+ // in the Amazon EBS User Guide.
MultiAttachEnabled *bool `type:"boolean"`
- // The Amazon Resource Name (ARN) of the Outpost.
+ // The Amazon Resource Name (ARN) of the Outpost on which to create the volume.
+ //
+ // If you intend to use a volume with an instance running on an outpost, then
+ // you must create the volume on the same outpost as the instance. You can't
+ // use a volume created in an Amazon Web Services Region with an instance on
+ // an Amazon Web Services outpost, or the other way around.
OutpostArn *string `type:"string"`
// The size of the volume, in GiBs. You must specify either a snapshot ID or
@@ -81212,8 +82369,8 @@ type CreateVolumeInput struct {
// Throughput Optimized HDD (st1) and Cold HDD (sc1) volumes can't be used as
// boot volumes.
//
- // For more information, see Amazon EBS volume types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html)
- // in the Amazon Elastic Compute Cloud User Guide.
+ // For more information, see Amazon EBS volume types (https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volume-types.html)
+ // in the Amazon EBS User Guide.
//
// Default: gp2
VolumeType *string `type:"string" enum:"VolumeType"`
@@ -81415,7 +82572,7 @@ type CreateVpcEndpointConnectionNotificationInput struct {
_ struct{} `type:"structure"`
// Unique, case-sensitive identifier that you provide to ensure the idempotency
- // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string"`
// The endpoint events for which to receive notifications. Valid values are
@@ -81557,7 +82714,7 @@ type CreateVpcEndpointInput struct {
_ struct{} `type:"structure"`
// Unique, case-sensitive identifier that you provide to ensure the idempotency
- // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string"`
// The DNS options for the endpoint.
@@ -81795,7 +82952,7 @@ type CreateVpcEndpointServiceConfigurationInput struct {
AcceptanceRequired *bool `type:"boolean"`
// Unique, case-sensitive identifier that you provide to ensure the idempotency
- // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html).
+ // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string"`
// Checks whether you have the required permissions for the action, without
@@ -82691,10 +83848,18 @@ func (s *CreditSpecificationRequest) SetCpuCredits(v string) *CreditSpecificatio
type CustomerGateway struct {
_ struct{} `type:"structure"`
- // The customer gateway's Border Gateway Protocol (BGP) Autonomous System Number
- // (ASN).
+ // The customer gateway device's Border Gateway Protocol (BGP) Autonomous System
+ // Number (ASN).
+ //
+ // Valid values: 1 to 2,147,483,647
BgpAsn *string `locationName:"bgpAsn" type:"string"`
+ // The customer gateway device's Border Gateway Protocol (BGP) Autonomous System
+ // Number (ASN).
+ //
+ // Valid values: 2,147,483,648 to 4,294,967,295
+ BgpAsnExtended *string `locationName:"bgpAsnExtended" type:"string"`
+
// The Amazon Resource Name (ARN) for the customer gateway certificate.
CertificateArn *string `locationName:"certificateArn" type:"string"`
@@ -82704,7 +83869,10 @@ type CustomerGateway struct {
// The name of customer gateway device.
DeviceName *string `locationName:"deviceName" type:"string"`
- // The IP address of the customer gateway device's outside interface.
+ // IPv4 address for the customer gateway device's outside interface. The address
+ // must be static. If OutsideIpAddressType in your VPN connection options is
+ // set to PrivateIpv4, you can use an RFC6598 or RFC1918 private IPv4 address.
+ // If OutsideIpAddressType is set to PublicIpv4, you can use a public IPv4 address.
IpAddress *string `locationName:"ipAddress" type:"string"`
// The current state of the customer gateway (pending | available | deleting
@@ -82742,6 +83910,12 @@ func (s *CustomerGateway) SetBgpAsn(v string) *CustomerGateway {
return s
}
+// SetBgpAsnExtended sets the BgpAsnExtended field's value.
+func (s *CustomerGateway) SetBgpAsnExtended(v string) *CustomerGateway {
+ s.BgpAsnExtended = &v
+ return s
+}
+
// SetCertificateArn sets the CertificateArn field's value.
func (s *CustomerGateway) SetCertificateArn(v string) *CustomerGateway {
s.CertificateArn = &v
@@ -83833,6 +85007,9 @@ type DeleteFleetsInput struct {
// The IDs of the EC2 Fleets.
//
+ // Constraints: In a single request, you can specify up to 25 instant fleet
+ // IDs and up to 100 maintain or request fleet IDs.
+ //
// FleetIds is a required field
FleetIds []*string `locationName:"FleetId" type:"list" required:"true"`
@@ -84389,6 +85566,95 @@ func (s DeleteInternetGatewayOutput) GoString() string {
return s.String()
}
+type DeleteIpamExternalResourceVerificationTokenInput struct {
+ _ struct{} `type:"structure"`
+
+ // A check for whether you have the required permissions for the action without
+ // actually making the request and provides an error response. If you have the
+ // required permissions, the error response is DryRunOperation. Otherwise, it
+ // is UnauthorizedOperation.
+ DryRun *bool `type:"boolean"`
+
+ // The token ID.
+ //
+ // IpamExternalResourceVerificationTokenId is a required field
+ IpamExternalResourceVerificationTokenId *string `type:"string" required:"true"`
+}
+
+// String returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s DeleteIpamExternalResourceVerificationTokenInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s DeleteIpamExternalResourceVerificationTokenInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DeleteIpamExternalResourceVerificationTokenInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DeleteIpamExternalResourceVerificationTokenInput"}
+ if s.IpamExternalResourceVerificationTokenId == nil {
+ invalidParams.Add(request.NewErrParamRequired("IpamExternalResourceVerificationTokenId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *DeleteIpamExternalResourceVerificationTokenInput) SetDryRun(v bool) *DeleteIpamExternalResourceVerificationTokenInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetIpamExternalResourceVerificationTokenId sets the IpamExternalResourceVerificationTokenId field's value.
+func (s *DeleteIpamExternalResourceVerificationTokenInput) SetIpamExternalResourceVerificationTokenId(v string) *DeleteIpamExternalResourceVerificationTokenInput {
+ s.IpamExternalResourceVerificationTokenId = &v
+ return s
+}
+
+type DeleteIpamExternalResourceVerificationTokenOutput struct {
+ _ struct{} `type:"structure"`
+
+ // The verification token.
+ IpamExternalResourceVerificationToken *IpamExternalResourceVerificationToken `locationName:"ipamExternalResourceVerificationToken" type:"structure"`
+}
+
+// String returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s DeleteIpamExternalResourceVerificationTokenOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s DeleteIpamExternalResourceVerificationTokenOutput) GoString() string {
+ return s.String()
+}
+
+// SetIpamExternalResourceVerificationToken sets the IpamExternalResourceVerificationToken field's value.
+func (s *DeleteIpamExternalResourceVerificationTokenOutput) SetIpamExternalResourceVerificationToken(v *IpamExternalResourceVerificationToken) *DeleteIpamExternalResourceVerificationTokenOutput {
+ s.IpamExternalResourceVerificationToken = v
+ return s
+}
+
type DeleteIpamInput struct {
_ struct{} `type:"structure"`
@@ -84887,14 +86153,14 @@ type DeleteLaunchTemplateInput struct {
// The ID of the launch template.
//
- // You must specify either the LaunchTemplateId or the LaunchTemplateName, but
- // not both.
+ // You must specify either the launch template ID or the launch template name,
+ // but not both.
LaunchTemplateId *string `type:"string"`
// The name of the launch template.
//
- // You must specify either the LaunchTemplateName or the LaunchTemplateId, but
- // not both.
+ // You must specify either the launch template ID or the launch template name,
+ // but not both.
LaunchTemplateName *string `min:"3" type:"string"`
}
@@ -84989,14 +86255,14 @@ type DeleteLaunchTemplateVersionsInput struct {
// The ID of the launch template.
//
- // You must specify either the LaunchTemplateId or the LaunchTemplateName, but
- // not both.
+ // You must specify either the launch template ID or the launch template name,
+ // but not both.
LaunchTemplateId *string `type:"string"`
// The name of the launch template.
//
- // You must specify either the LaunchTemplateName or the LaunchTemplateId, but
- // not both.
+ // You must specify either the launch template ID or the launch template name,
+ // but not both.
LaunchTemplateName *string `min:"3" type:"string"`
// The version numbers of one or more launch template versions to delete. You
@@ -86581,6 +87847,13 @@ type DeletePublicIpv4PoolInput struct {
// is UnauthorizedOperation.
DryRun *bool `type:"boolean"`
+ // The Availability Zone (AZ) or Local Zone (LZ) network border group that the
+ // resource that the IP address is assigned to is in. Defaults to an AZ network
+ // border group. For more information on available Local Zones, see Local Zone
+ // availability (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html#byoip-zone-avail)
+ // in the Amazon EC2 User Guide.
+ NetworkBorderGroup *string `type:"string"`
+
// The ID of the public IPv4 pool you want to delete.
//
// PoolId is a required field
@@ -86624,6 +87897,12 @@ func (s *DeletePublicIpv4PoolInput) SetDryRun(v bool) *DeletePublicIpv4PoolInput
return s
}
+// SetNetworkBorderGroup sets the NetworkBorderGroup field's value.
+func (s *DeletePublicIpv4PoolInput) SetNetworkBorderGroup(v string) *DeletePublicIpv4PoolInput {
+ s.NetworkBorderGroup = &v
+ return s
+}
+
// SetPoolId sets the PoolId field's value.
func (s *DeletePublicIpv4PoolInput) SetPoolId(v string) *DeletePublicIpv4PoolInput {
s.PoolId = &v
@@ -88844,8 +90123,8 @@ type DeleteVerifiedAccessEndpointInput struct {
_ struct{} `type:"structure"`
// A unique, case-sensitive token that you provide to ensure idempotency of
- // your modification request. For more information, see Ensuring Idempotency
- // (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // your modification request. For more information, see Ensuring idempotency
+ // (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// Checks whether you have the required permissions for the action, without
@@ -88944,8 +90223,8 @@ type DeleteVerifiedAccessGroupInput struct {
_ struct{} `type:"structure"`
// A unique, case-sensitive token that you provide to ensure idempotency of
- // your modification request. For more information, see Ensuring Idempotency
- // (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // your modification request. For more information, see Ensuring idempotency
+ // (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// Checks whether you have the required permissions for the action, without
@@ -89044,8 +90323,8 @@ type DeleteVerifiedAccessInstanceInput struct {
_ struct{} `type:"structure"`
// A unique, case-sensitive token that you provide to ensure idempotency of
- // your modification request. For more information, see Ensuring Idempotency
- // (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // your modification request. For more information, see Ensuring idempotency
+ // (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// Checks whether you have the required permissions for the action, without
@@ -89144,8 +90423,8 @@ type DeleteVerifiedAccessTrustProviderInput struct {
_ struct{} `type:"structure"`
// A unique, case-sensitive token that you provide to ensure idempotency of
- // your modification request. For more information, see Ensuring Idempotency
- // (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // your modification request. For more information, see Ensuring idempotency
+ // (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// Checks whether you have the required permissions for the action, without
@@ -91343,16 +92622,16 @@ type DescribeAvailabilityZonesInput struct {
// * group-name - For Availability Zones, use the Region name. For Local
// Zones, use the name of the group associated with the Local Zone (for example,
// us-west-2-lax-1) For Wavelength Zones, use the name of the group associated
- // with the Wavelength Zone (for example, us-east-1-wl1-bos-wlz-1).
+ // with the Wavelength Zone (for example, us-east-1-wl1).
//
// * message - The Zone message.
//
// * opt-in-status - The opt-in status (opted-in | not-opted-in | opt-in-not-required).
//
- // * parent-zoneID - The ID of the zone that handles some of the Local Zone
+ // * parent-zone-id - The ID of the zone that handles some of the Local Zone
// and Wavelength Zone control plane operations, such as API calls.
//
- // * parent-zoneName - The ID of the zone that handles some of the Local
+ // * parent-zone-name - The ID of the zone that handles some of the Local
// Zone and Wavelength Zone control plane operations, such as API calls.
//
// * region-name - The name of the Region for the Zone (for example, us-east-1).
@@ -93568,9 +94847,7 @@ func (s *DescribeCustomerGatewaysOutput) SetCustomerGateways(v []*CustomerGatewa
type DescribeDhcpOptionsInput struct {
_ struct{} `type:"structure"`
- // The IDs of one or more DHCP options sets.
- //
- // Default: Describes all your DHCP options sets.
+ // The IDs of DHCP option sets.
DhcpOptionsIds []*string `locationName:"DhcpOptionsId" locationNameList:"DhcpOptionsId" type:"list"`
// Checks whether you have the required permissions for the action, without
@@ -93675,7 +94952,7 @@ func (s *DescribeDhcpOptionsInput) SetNextToken(v string) *DescribeDhcpOptionsIn
type DescribeDhcpOptionsOutput struct {
_ struct{} `type:"structure"`
- // Information about one or more DHCP options sets.
+ // Information about the DHCP options sets.
DhcpOptions []*DhcpOptions `locationName:"dhcpOptionsSet" locationNameList:"item" type:"list"`
// The token to include in another request to get the next page of items. This
@@ -96417,6 +97694,9 @@ type DescribeImageAttributeOutput struct {
// The boot mode.
BootMode *AttributeValue `locationName:"bootMode" type:"structure"`
+ // Indicates whether deregistration protection is enabled for the AMI.
+ DeregistrationProtection *AttributeValue `locationName:"deregistrationProtection" type:"structure"`
+
// A description for the AMI.
Description *AttributeValue `locationName:"description" type:"structure"`
@@ -96496,6 +97776,12 @@ func (s *DescribeImageAttributeOutput) SetBootMode(v *AttributeValue) *DescribeI
return s
}
+// SetDeregistrationProtection sets the DeregistrationProtection field's value.
+func (s *DescribeImageAttributeOutput) SetDeregistrationProtection(v *AttributeValue) *DescribeImageAttributeOutput {
+ s.DeregistrationProtection = v
+ return s
+}
+
// SetDescription sets the Description field's value.
func (s *DescribeImageAttributeOutput) SetDescription(v *AttributeValue) *DescribeImageAttributeOutput {
s.Description = v
@@ -98170,14 +99456,26 @@ type DescribeInstanceTypeOfferingsInput struct {
// One or more filters. Filter names and values are case-sensitive.
//
- // * location - This depends on the location type. For example, if the location
- // type is region (default), the location is the Region code (for example,
- // us-east-2.)
+ // * instance-type - The instance type. For a list of possible values, see
+ // Instance (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_Instance.html).
//
- // * instance-type - The instance type. For example, c5.2xlarge.
+ // * location - The location. For a list of possible identifiers, see Regions
+ // and Zones (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html).
Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"`
// The location type.
+ //
+ // * availability-zone - The Availability Zone. When you specify a location
+ // filter, it must be an Availability Zone for the current Region.
+ //
+ // * availability-zone-id - The AZ ID. When you specify a location filter,
+ // it must be an AZ ID for the current Region.
+ //
+ // * outpost - The Outpost ARN. When you specify a location filter, it must
+ // be an Outpost ARN for the current Region.
+ //
+ // * region - The current Region. If you specify a location filter, it must
+ // match the current Region.
LocationType *string `type:"string" enum:"LocationType"`
// The maximum number of items to return for this request. To get the next page
@@ -98254,7 +99552,7 @@ func (s *DescribeInstanceTypeOfferingsInput) SetNextToken(v string) *DescribeIns
type DescribeInstanceTypeOfferingsOutput struct {
_ struct{} `type:"structure"`
- // The instance types offered.
+ // The instance types offered in the location.
InstanceTypeOfferings []*InstanceTypeOffering `locationName:"instanceTypeOfferingSet" locationNameList:"item" type:"list"`
// The token to include in another request to get the next page of items. This
@@ -98446,8 +99744,7 @@ type DescribeInstanceTypesInput struct {
// can be configured for the instance type. For example, "1" or "1,2".
Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"`
- // The instance types. For more information, see Instance types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html)
- // in the Amazon EC2 User Guide.
+ // The instance types.
InstanceTypes []*string `locationName:"InstanceType" type:"list" enum:"InstanceType"`
// The maximum number of items to return for this request. To get the next page
@@ -98524,8 +99821,7 @@ func (s *DescribeInstanceTypesInput) SetNextToken(v string) *DescribeInstanceTyp
type DescribeInstanceTypesOutput struct {
_ struct{} `type:"structure"`
- // The instance type. For more information, see Instance types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html)
- // in the Amazon EC2 User Guide.
+ // The instance type.
InstanceTypes []*InstanceTypeInfo `locationName:"instanceTypeSet" locationNameList:"item" type:"list"`
// The token to include in another request to get the next page of items. This
@@ -98889,7 +100185,10 @@ type DescribeInstancesInput struct {
// * private-dns-name-options.hostname-type - The type of hostname (ip-name
// | resource-name).
//
- // * private-ip-address - The private IPv4 address of the instance.
+ // * private-ip-address - The private IPv4 address of the instance. This
+ // can only be used to filter by the primary IP address of the network interface
+ // attached to the instance. To filter by additional IP addresses assigned
+ // to the network interface, use the filter network-interface.addresses.private-ip-address.
//
// * product-code - The product code associated with the AMI used to launch
// the instance.
@@ -99181,7 +100480,7 @@ func (s *DescribeInternetGatewaysInput) SetNextToken(v string) *DescribeInternet
type DescribeInternetGatewaysOutput struct {
_ struct{} `type:"structure"`
- // Information about one or more internet gateways.
+ // Information about the internet gateways.
InternetGateways []*InternetGateway `locationName:"internetGatewaySet" locationNameList:"item" type:"list"`
// The token to include in another request to get the next page of items. This
@@ -99326,6 +100625,151 @@ func (s *DescribeIpamByoasnOutput) SetNextToken(v string) *DescribeIpamByoasnOut
return s
}
+type DescribeIpamExternalResourceVerificationTokensInput struct {
+ _ struct{} `type:"structure"`
+
+ // A check for whether you have the required permissions for the action without
+ // actually making the request and provides an error response. If you have the
+ // required permissions, the error response is DryRunOperation. Otherwise, it
+ // is UnauthorizedOperation.
+ DryRun *bool `type:"boolean"`
+
+ // One or more filters for the request. For more information about filtering,
+ // see Filtering CLI output (https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-filter.html).
+ //
+ // Available filters:
+ //
+ // * ipam-arn
+ //
+ // * ipam-external-resource-verification-token-arn
+ //
+ // * ipam-external-resource-verification-token-id
+ //
+ // * ipam-id
+ //
+ // * ipam-region
+ //
+ // * state
+ //
+ // * status
+ //
+ // * token-name
+ //
+ // * token-value
+ Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"`
+
+ // Verification token IDs.
+ IpamExternalResourceVerificationTokenIds []*string `locationName:"IpamExternalResourceVerificationTokenId" locationNameList:"item" type:"list"`
+
+ // The maximum number of tokens to return in one page of results.
+ MaxResults *int64 `min:"5" type:"integer"`
+
+ // The token for the next page of results.
+ NextToken *string `type:"string"`
+}
+
+// String returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s DescribeIpamExternalResourceVerificationTokensInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s DescribeIpamExternalResourceVerificationTokensInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DescribeIpamExternalResourceVerificationTokensInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DescribeIpamExternalResourceVerificationTokensInput"}
+ if s.MaxResults != nil && *s.MaxResults < 5 {
+ invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *DescribeIpamExternalResourceVerificationTokensInput) SetDryRun(v bool) *DescribeIpamExternalResourceVerificationTokensInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetFilters sets the Filters field's value.
+func (s *DescribeIpamExternalResourceVerificationTokensInput) SetFilters(v []*Filter) *DescribeIpamExternalResourceVerificationTokensInput {
+ s.Filters = v
+ return s
+}
+
+// SetIpamExternalResourceVerificationTokenIds sets the IpamExternalResourceVerificationTokenIds field's value.
+func (s *DescribeIpamExternalResourceVerificationTokensInput) SetIpamExternalResourceVerificationTokenIds(v []*string) *DescribeIpamExternalResourceVerificationTokensInput {
+ s.IpamExternalResourceVerificationTokenIds = v
+ return s
+}
+
+// SetMaxResults sets the MaxResults field's value.
+func (s *DescribeIpamExternalResourceVerificationTokensInput) SetMaxResults(v int64) *DescribeIpamExternalResourceVerificationTokensInput {
+ s.MaxResults = &v
+ return s
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeIpamExternalResourceVerificationTokensInput) SetNextToken(v string) *DescribeIpamExternalResourceVerificationTokensInput {
+ s.NextToken = &v
+ return s
+}
+
+type DescribeIpamExternalResourceVerificationTokensOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Verification tokens.
+ IpamExternalResourceVerificationTokens []*IpamExternalResourceVerificationToken `locationName:"ipamExternalResourceVerificationTokenSet" locationNameList:"item" type:"list"`
+
+ // The token to use to retrieve the next page of results. This value is null
+ // when there are no more results to return.
+ NextToken *string `locationName:"nextToken" type:"string"`
+}
+
+// String returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s DescribeIpamExternalResourceVerificationTokensOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s DescribeIpamExternalResourceVerificationTokensOutput) GoString() string {
+ return s.String()
+}
+
+// SetIpamExternalResourceVerificationTokens sets the IpamExternalResourceVerificationTokens field's value.
+func (s *DescribeIpamExternalResourceVerificationTokensOutput) SetIpamExternalResourceVerificationTokens(v []*IpamExternalResourceVerificationToken) *DescribeIpamExternalResourceVerificationTokensOutput {
+ s.IpamExternalResourceVerificationTokens = v
+ return s
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeIpamExternalResourceVerificationTokensOutput) SetNextToken(v string) *DescribeIpamExternalResourceVerificationTokensOutput {
+ s.NextToken = &v
+ return s
+}
+
type DescribeIpamPoolsInput struct {
_ struct{} `type:"structure"`
@@ -100257,7 +101701,8 @@ type DescribeLaunchTemplateVersionsInput struct {
// The ID of the launch template.
//
// To describe one or more versions of a specified launch template, you must
- // specify either the LaunchTemplateId or the LaunchTemplateName, but not both.
+ // specify either the launch template ID or the launch template name, but not
+ // both.
//
// To describe all the latest or default launch template versions in your account,
// you must omit this parameter.
@@ -100266,7 +101711,8 @@ type DescribeLaunchTemplateVersionsInput struct {
// The name of the launch template.
//
// To describe one or more versions of a specified launch template, you must
- // specify either the LaunchTemplateName or the LaunchTemplateId, but not both.
+ // specify either the launch template name or the launch template ID, but not
+ // both.
//
// To describe all the latest or default launch template versions in your account,
// you must omit this parameter.
@@ -100294,7 +101740,7 @@ type DescribeLaunchTemplateVersionsInput struct {
//
// For more information, see Use a Systems Manager parameter instead of an AMI
// ID (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html#use-an-ssm-parameter-instead-of-an-ami-id)
- // in the Amazon Elastic Compute Cloud User Guide.
+ // in the Amazon EC2 User Guide.
//
// Default: false
ResolveAlias *bool `type:"boolean"`
@@ -101560,6 +103006,125 @@ func (s *DescribeLockedSnapshotsOutput) SetSnapshots(v []*LockedSnapshotsInfo) *
return s
}
+type DescribeMacHostsInput struct {
+ _ struct{} `type:"structure"`
+
+ // The filters.
+ //
+ // * availability-zone - The Availability Zone of the EC2 Mac Dedicated Host.
+ //
+ // * instance-type - The instance type size that the EC2 Mac Dedicated Host
+ // is configured to support.
+ Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"`
+
+ // The IDs of the EC2 Mac Dedicated Hosts.
+ HostIds []*string `locationName:"HostId" locationNameList:"item" type:"list"`
+
+ // The maximum number of results to return for the request in a single page.
+ // The remaining results can be seen by sending another request with the returned
+ // nextToken value. This value can be between 5 and 500. If maxResults is given
+ // a larger value than 500, you receive an error.
+ MaxResults *int64 `min:"5" type:"integer"`
+
+ // The token to use to retrieve the next page of results.
+ NextToken *string `type:"string"`
+}
+
+// String returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s DescribeMacHostsInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s DescribeMacHostsInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DescribeMacHostsInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DescribeMacHostsInput"}
+ if s.MaxResults != nil && *s.MaxResults < 5 {
+ invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetFilters sets the Filters field's value.
+func (s *DescribeMacHostsInput) SetFilters(v []*Filter) *DescribeMacHostsInput {
+ s.Filters = v
+ return s
+}
+
+// SetHostIds sets the HostIds field's value.
+func (s *DescribeMacHostsInput) SetHostIds(v []*string) *DescribeMacHostsInput {
+ s.HostIds = v
+ return s
+}
+
+// SetMaxResults sets the MaxResults field's value.
+func (s *DescribeMacHostsInput) SetMaxResults(v int64) *DescribeMacHostsInput {
+ s.MaxResults = &v
+ return s
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeMacHostsInput) SetNextToken(v string) *DescribeMacHostsInput {
+ s.NextToken = &v
+ return s
+}
+
+type DescribeMacHostsOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Information about the EC2 Mac Dedicated Hosts.
+ MacHosts []*MacHost `locationName:"macHostSet" locationNameList:"item" type:"list"`
+
+ // The token to use to retrieve the next page of results.
+ NextToken *string `locationName:"nextToken" type:"string"`
+}
+
+// String returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s DescribeMacHostsOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s DescribeMacHostsOutput) GoString() string {
+ return s.String()
+}
+
+// SetMacHosts sets the MacHosts field's value.
+func (s *DescribeMacHostsOutput) SetMacHosts(v []*MacHost) *DescribeMacHostsOutput {
+ s.MacHosts = v
+ return s
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeMacHostsOutput) SetNextToken(v string) *DescribeMacHostsOutput {
+ s.NextToken = &v
+ return s
+}
+
type DescribeManagedPrefixListsInput struct {
_ struct{} `type:"structure"`
@@ -102038,8 +103603,6 @@ type DescribeNetworkAclsInput struct {
MaxResults *int64 `min:"5" type:"integer"`
// The IDs of the network ACLs.
- //
- // Default: Describes all your network ACLs.
NetworkAclIds []*string `locationName:"NetworkAclId" locationNameList:"item" type:"list"`
// The token returned from a previous paginated request. Pagination continues
@@ -102111,7 +103674,7 @@ func (s *DescribeNetworkAclsInput) SetNextToken(v string) *DescribeNetworkAclsIn
type DescribeNetworkAclsOutput struct {
_ struct{} `type:"structure"`
- // Information about one or more network ACLs.
+ // Information about the network ACLs.
NetworkAcls []*NetworkAcl `locationName:"networkAclSet" locationNameList:"item" type:"list"`
// The token to include in another request to get the next page of items. This
@@ -102811,6 +104374,11 @@ func (s *DescribeNetworkInterfaceAttributeInput) SetNetworkInterfaceId(v string)
type DescribeNetworkInterfaceAttributeOutput struct {
_ struct{} `type:"structure"`
+ // Indicates whether to assign a public IPv4 address to a network interface.
+ // This option can be enabled for any network interface but will only apply
+ // to the primary network interface (eth0).
+ AssociatePublicIpAddress *bool `locationName:"associatePublicIpAddress" type:"boolean"`
+
// The attachment (if any) of the network interface.
Attachment *NetworkInterfaceAttachment `locationName:"attachment" type:"structure"`
@@ -102845,6 +104413,12 @@ func (s DescribeNetworkInterfaceAttributeOutput) GoString() string {
return s.String()
}
+// SetAssociatePublicIpAddress sets the AssociatePublicIpAddress field's value.
+func (s *DescribeNetworkInterfaceAttributeOutput) SetAssociatePublicIpAddress(v bool) *DescribeNetworkInterfaceAttributeOutput {
+ s.AssociatePublicIpAddress = &v
+ return s
+}
+
// SetAttachment sets the Attachment field's value.
func (s *DescribeNetworkInterfaceAttributeOutput) SetAttachment(v *NetworkInterfaceAttachment) *DescribeNetworkInterfaceAttributeOutput {
s.Attachment = v
@@ -103206,7 +104780,7 @@ func (s *DescribeNetworkInterfacesInput) SetNextToken(v string) *DescribeNetwork
type DescribeNetworkInterfacesOutput struct {
_ struct{} `type:"structure"`
- // Information about one or more network interfaces.
+ // Information about the network interfaces.
NetworkInterfaces []*NetworkInterface `locationName:"networkInterfaceSet" locationNameList:"item" type:"list"`
// The token to include in another request to get the next page of items. This
@@ -103282,7 +104856,13 @@ type DescribePlacementGroupsInput struct {
// The names of the placement groups.
//
- // Default: Describes all your placement groups, or only those otherwise specified.
+ // Constraints:
+ //
+ // * You can specify a name only if the placement group is owned by your
+ // account.
+ //
+ // * If a placement group is shared with your account, specifying the name
+ // results in an error. You must use the GroupId parameter instead.
GroupNames []*string `locationName:"groupName" type:"list"`
}
@@ -104340,7 +105920,7 @@ type DescribeReservedInstancesOfferingsInput struct {
InstanceTenancy *string `locationName:"instanceTenancy" type:"string" enum:"Tenancy"`
// The instance type that the reservation will cover (for example, m1.small).
- // For more information, see Instance types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html)
+ // For more information, see Amazon EC2 instance types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html)
// in the Amazon EC2 User Guide.
InstanceType *string `type:"string" enum:"InstanceType"`
@@ -104578,6 +106158,8 @@ type DescribeRouteTablesInput struct {
// The filters.
//
+ // * association.gateway-id - The ID of the gateway involved in the association.
+ //
// * association.route-table-association-id - The ID of an association ID
// for the route table.
//
@@ -104653,8 +106235,6 @@ type DescribeRouteTablesInput struct {
NextToken *string `type:"string"`
// The IDs of the route tables.
- //
- // Default: Describes all your route tables.
RouteTableIds []*string `locationName:"RouteTableId" locationNameList:"item" type:"list"`
}
@@ -104727,7 +106307,7 @@ type DescribeRouteTablesOutput struct {
// value is null when there are no more items to return.
NextToken *string `locationName:"nextToken" type:"string"`
- // Information about one or more route tables.
+ // Information about the route tables.
RouteTables []*RouteTable `locationName:"routeTableSet" locationNameList:"item" type:"list"`
}
@@ -105803,11 +107383,9 @@ type DescribeSnapshotsInput struct {
// * volume-size - The size of the volume, in GiB.
Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"`
- // The maximum number of snapshots to return for this request. This value can
- // be between 5 and 1,000; if this value is larger than 1,000, only 1,000 results
- // are returned. If this parameter is not used, then the request returns all
- // snapshots. You cannot specify this parameter and the snapshot IDs parameter
- // in the same request. For more information, see Pagination (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination).
+ // The maximum number of items to return for this request. To get the next page
+ // of items, make another request with the token returned in the output. For
+ // more information, see Pagination (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination).
MaxResults *int64 `type:"integer"`
// The token returned from a previous paginated request. Pagination continues
@@ -105891,8 +107469,8 @@ func (s *DescribeSnapshotsInput) SetSnapshotIds(v []*string) *DescribeSnapshotsI
type DescribeSnapshotsOutput struct {
_ struct{} `type:"structure"`
- // The token to include in another request to return the next page of snapshots.
- // This value is null when there are no more snapshots to return.
+ // The token to include in another request to get the next page of items. This
+ // value is null when there are no more items to return.
NextToken *string `locationName:"nextToken" type:"string"`
// Information about the snapshots.
@@ -106509,7 +108087,7 @@ type DescribeSpotInstanceRequestsInput struct {
// | cancelled | failed). Spot request status information can help you track
// your Amazon EC2 Spot Instance requests. For more information, see Spot
// request status (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-request-status.html)
- // in the Amazon EC2 User Guide for Linux Instances.
+ // in the Amazon EC2 User Guide.
//
// * status-code - The short code describing the most recent evaluation of
// your Spot Instance request.
@@ -106771,7 +108349,7 @@ type DescribeSpotPriceHistoryOutput struct {
_ struct{} `type:"structure"`
// The token to include in another request to get the next page of items. This
- // value is null when there are no more items to return.
+ // value is an empty string ("") or null when there are no more items to return.
NextToken *string `locationName:"nextToken" type:"string"`
// The historical Spot prices.
@@ -107252,7 +108830,7 @@ type DescribeSubnetsOutput struct {
// value is null when there are no more items to return.
NextToken *string `locationName:"nextToken" type:"string"`
- // Information about one or more subnets.
+ // Information about the subnets.
Subnets []*Subnet `locationName:"subnetSet" locationNameList:"item" type:"list"`
}
@@ -107301,13 +108879,8 @@ type DescribeTagsInput struct {
//
// * resource-id - The ID of the resource.
//
- // * resource-type - The resource type (customer-gateway | dedicated-host
- // | dhcp-options | elastic-ip | fleet | fpga-image | host-reservation |
- // image | instance | internet-gateway | key-pair | launch-template | natgateway
- // | network-acl | network-interface | placement-group | reserved-instances
- // | route-table | security-group | snapshot | spot-instances-request | subnet
- // | volume | vpc | vpc-endpoint | vpc-endpoint-service | vpc-peering-connection
- // | vpn-connection | vpn-gateway).
+ // * resource-type - The resource type. For a list of possible values, see
+ // TagSpecification (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_TagSpecification.html).
//
// * tag: - The key/value combination of the tag. For example, specify
// "tag:Owner" for the filter name and "TeamA" for the filter value to find
@@ -107409,6 +108982,164 @@ func (s *DescribeTagsOutput) SetTags(v []*TagDescription) *DescribeTagsOutput {
return s
}
+type DescribeTrafficMirrorFilterRulesInput struct {
+ _ struct{} `type:"structure"`
+
+ // Checks whether you have the required permissions for the action, without
+ // actually making the request, and provides an error response. If you have
+ // the required permissions, the error response is DryRunOperation. Otherwise,
+ // it is UnauthorizedOperation.
+ DryRun *bool `type:"boolean"`
+
+ // Traffic mirror filters.
+ //
+ // * traffic-mirror-filter-rule-id: The ID of the Traffic Mirror rule.
+ //
+ // * traffic-mirror-filter-id: The ID of the filter that this rule is associated
+ // with.
+ //
+ // * rule-number: The number of the Traffic Mirror rule.
+ //
+ // * rule-action: The action taken on the filtered traffic. Possible actions
+ // are accept and reject.
+ //
+ // * traffic-direction: The traffic direction. Possible directions are ingress
+ // and egress.
+ //
+ // * protocol: The protocol, for example UDP, assigned to the Traffic Mirror
+ // rule.
+ //
+ // * source-cidr-block: The source CIDR block assigned to the Traffic Mirror
+ // rule.
+ //
+ // * destination-cidr-block: The destination CIDR block assigned to the Traffic
+ // Mirror rule.
+ //
+ // * description: The description of the Traffic Mirror rule.
+ Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"`
+
+ // The maximum number of results to return with a single call. To retrieve the
+ // remaining results, make another call with the returned nextToken value.
+ MaxResults *int64 `min:"5" type:"integer"`
+
+ // The token for the next page of results.
+ NextToken *string `type:"string"`
+
+ // Traffic filter ID.
+ TrafficMirrorFilterId *string `type:"string"`
+
+ // Traffic filter rule IDs.
+ TrafficMirrorFilterRuleIds []*string `locationName:"TrafficMirrorFilterRuleId" locationNameList:"item" type:"list"`
+}
+
+// String returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s DescribeTrafficMirrorFilterRulesInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s DescribeTrafficMirrorFilterRulesInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DescribeTrafficMirrorFilterRulesInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DescribeTrafficMirrorFilterRulesInput"}
+ if s.MaxResults != nil && *s.MaxResults < 5 {
+ invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *DescribeTrafficMirrorFilterRulesInput) SetDryRun(v bool) *DescribeTrafficMirrorFilterRulesInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetFilters sets the Filters field's value.
+func (s *DescribeTrafficMirrorFilterRulesInput) SetFilters(v []*Filter) *DescribeTrafficMirrorFilterRulesInput {
+ s.Filters = v
+ return s
+}
+
+// SetMaxResults sets the MaxResults field's value.
+func (s *DescribeTrafficMirrorFilterRulesInput) SetMaxResults(v int64) *DescribeTrafficMirrorFilterRulesInput {
+ s.MaxResults = &v
+ return s
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeTrafficMirrorFilterRulesInput) SetNextToken(v string) *DescribeTrafficMirrorFilterRulesInput {
+ s.NextToken = &v
+ return s
+}
+
+// SetTrafficMirrorFilterId sets the TrafficMirrorFilterId field's value.
+func (s *DescribeTrafficMirrorFilterRulesInput) SetTrafficMirrorFilterId(v string) *DescribeTrafficMirrorFilterRulesInput {
+ s.TrafficMirrorFilterId = &v
+ return s
+}
+
+// SetTrafficMirrorFilterRuleIds sets the TrafficMirrorFilterRuleIds field's value.
+func (s *DescribeTrafficMirrorFilterRulesInput) SetTrafficMirrorFilterRuleIds(v []*string) *DescribeTrafficMirrorFilterRulesInput {
+ s.TrafficMirrorFilterRuleIds = v
+ return s
+}
+
+type DescribeTrafficMirrorFilterRulesOutput struct {
+ _ struct{} `type:"structure"`
+
+ // The token to use to retrieve the next page of results. The value is null
+ // when there are no more results to return.
+ NextToken *string `locationName:"nextToken" type:"string"`
+
+ // Traffic mirror rules.
+ TrafficMirrorFilterRules []*TrafficMirrorFilterRule `locationName:"trafficMirrorFilterRuleSet" locationNameList:"item" type:"list"`
+}
+
+// String returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s DescribeTrafficMirrorFilterRulesOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s DescribeTrafficMirrorFilterRulesOutput) GoString() string {
+ return s.String()
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeTrafficMirrorFilterRulesOutput) SetNextToken(v string) *DescribeTrafficMirrorFilterRulesOutput {
+ s.NextToken = &v
+ return s
+}
+
+// SetTrafficMirrorFilterRules sets the TrafficMirrorFilterRules field's value.
+func (s *DescribeTrafficMirrorFilterRulesOutput) SetTrafficMirrorFilterRules(v []*TrafficMirrorFilterRule) *DescribeTrafficMirrorFilterRulesOutput {
+ s.TrafficMirrorFilterRules = v
+ return s
+}
+
type DescribeTrafficMirrorFiltersInput struct {
_ struct{} `type:"structure"`
@@ -109085,6 +110816,12 @@ type DescribeTransitGatewaysInput struct {
// | modifying | pending).
//
// * transit-gateway-id - The ID of the transit gateway.
+ //
+ // * tag-key - The key/value combination of a tag assigned to the resource.
+ // Use the tag key in the filter name and the tag value as the filter value.
+ // For example, to find all resources that have a tag with the key Owner
+ // and the value TeamA, specify tag:Owner for the filter name and TeamA for
+ // the filter value.
Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"`
// The maximum number of results to return with a single call. To retrieve the
@@ -110146,11 +111883,8 @@ type DescribeVolumeStatusInput struct {
Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"`
// The maximum number of items to return for this request. To get the next page
- // of items, make another request with the token returned in the output. This
- // value can be between 5 and 1,000; if the value is larger than 1,000, only
- // 1,000 results are returned. If this parameter is not used, then all items
- // are returned. You cannot specify this parameter and the volume IDs parameter
- // in the same request. For more information, see Pagination (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination).
+ // of items, make another request with the token returned in the output. For
+ // more information, see Pagination (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination).
MaxResults *int64 `type:"integer"`
// The token returned from a previous paginated request. Pagination continues
@@ -110311,18 +112045,16 @@ type DescribeVolumesInput struct {
// | sc1| standard)
Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"`
- // The maximum number of volumes to return for this request. This value can
- // be between 5 and 500; if you specify a value larger than 500, only 500 items
- // are returned. If this parameter is not used, then all items are returned.
- // You cannot specify this parameter and the volume IDs parameter in the same
- // request. For more information, see Pagination (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination).
+ // The maximum number of items to return for this request. To get the next page
+ // of items, make another request with the token returned in the output. For
+ // more information, see Pagination (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination).
MaxResults *int64 `locationName:"maxResults" type:"integer"`
// The token returned from a previous paginated request. Pagination continues
- // from the end of the items returned from the previous request.
+ // from the end of the items returned by the previous request.
NextToken *string `locationName:"nextToken" type:"string"`
- // The volume IDs.
+ // The volume IDs. If not specified, then all volumes are included in the response.
VolumeIds []*string `locationName:"VolumeId" locationNameList:"VolumeId" type:"list"`
}
@@ -110417,7 +112149,7 @@ type DescribeVolumesModificationsInput struct {
// paginated request. For more information, see Pagination (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination).
MaxResults *int64 `type:"integer"`
- // The token returned by a previous paginated request. Pagination continues
+ // The token returned from a previous paginated request. Pagination continues
// from the end of the items returned by the previous request.
NextToken *string `type:"string"`
@@ -110477,7 +112209,7 @@ type DescribeVolumesModificationsOutput struct {
_ struct{} `type:"structure"`
// The token to include in another request to get the next page of items. This
- // value is null if there are no more items to return.
+ // value is null when there are no more items to return.
NextToken *string `locationName:"nextToken" type:"string"`
// Information about the volume modifications.
@@ -111656,7 +113388,7 @@ type DescribeVpcEndpointsOutput struct {
// items to return, the string is empty.
NextToken *string `locationName:"nextToken" type:"string"`
- // Information about the endpoints.
+ // Information about the VPC endpoints.
VpcEndpoints []*VpcEndpoint `locationName:"vpcEndpointSet" locationNameList:"item" type:"list"`
}
@@ -111922,8 +113654,6 @@ type DescribeVpcsInput struct {
NextToken *string `type:"string"`
// The IDs of the VPCs.
- //
- // Default: Describes all your VPCs.
VpcIds []*string `locationName:"VpcId" locationNameList:"VpcId" type:"list"`
}
@@ -111995,7 +113725,7 @@ type DescribeVpcsOutput struct {
// value is null when there are no more items to return.
NextToken *string `locationName:"nextToken" type:"string"`
- // Information about one or more VPCs.
+ // Information about the VPCs.
Vpcs []*Vpc `locationName:"vpcSet" locationNameList:"item" type:"list"`
}
@@ -112679,8 +114409,8 @@ type DetachVerifiedAccessTrustProviderInput struct {
_ struct{} `type:"structure"`
// A unique, case-sensitive token that you provide to ensure idempotency of
- // your modification request. For more information, see Ensuring Idempotency
- // (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // your modification request. For more information, see Ensuring idempotency
+ // (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// Checks whether you have the required permissions for the action, without
@@ -114149,6 +115879,95 @@ func (s *DisableImageDeprecationOutput) SetReturn(v bool) *DisableImageDeprecati
return s
}
+type DisableImageDeregistrationProtectionInput struct {
+ _ struct{} `type:"structure"`
+
+ // Checks whether you have the required permissions for the action, without
+ // actually making the request, and provides an error response. If you have
+ // the required permissions, the error response is DryRunOperation. Otherwise,
+ // it is UnauthorizedOperation.
+ DryRun *bool `type:"boolean"`
+
+ // The ID of the AMI.
+ //
+ // ImageId is a required field
+ ImageId *string `type:"string" required:"true"`
+}
+
+// String returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s DisableImageDeregistrationProtectionInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s DisableImageDeregistrationProtectionInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DisableImageDeregistrationProtectionInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DisableImageDeregistrationProtectionInput"}
+ if s.ImageId == nil {
+ invalidParams.Add(request.NewErrParamRequired("ImageId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *DisableImageDeregistrationProtectionInput) SetDryRun(v bool) *DisableImageDeregistrationProtectionInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetImageId sets the ImageId field's value.
+func (s *DisableImageDeregistrationProtectionInput) SetImageId(v string) *DisableImageDeregistrationProtectionInput {
+ s.ImageId = &v
+ return s
+}
+
+type DisableImageDeregistrationProtectionOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Returns true if the request succeeds; otherwise, it returns an error.
+ Return *string `locationName:"return" type:"string"`
+}
+
+// String returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s DisableImageDeregistrationProtectionOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s DisableImageDeregistrationProtectionOutput) GoString() string {
+ return s.String()
+}
+
+// SetReturn sets the Return field's value.
+func (s *DisableImageDeregistrationProtectionOutput) SetReturn(v string) *DisableImageDeregistrationProtectionOutput {
+ s.Return = &v
+ return s
+}
+
type DisableImageInput struct {
_ struct{} `type:"structure"`
@@ -116099,7 +117918,7 @@ type DisassociateTrunkInterfaceInput struct {
AssociationId *string `type:"string" required:"true"`
// Unique, case-sensitive identifier that you provide to ensure the idempotency
- // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html).
+ // of the request. For more information, see Ensuring idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// Checks whether you have the required permissions for the action, without
@@ -116162,7 +117981,7 @@ type DisassociateTrunkInterfaceOutput struct {
_ struct{} `type:"structure"`
// Unique, case-sensitive identifier that you provide to ensure the idempotency
- // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html).
+ // of the request. For more information, see Ensuring idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `locationName:"clientToken" type:"string"`
// Returns true if the request succeeds; otherwise, it returns an error.
@@ -116795,13 +118614,13 @@ type EbsBlockDevice struct {
// being restored from a backing snapshot. The effect of setting the encryption
// state to true depends on the volume origin (new or from a snapshot), starting
// encryption state, ownership, and whether encryption by default is enabled.
- // For more information, see Amazon EBS encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#encryption-parameters)
- // in the Amazon EC2 User Guide.
+ // For more information, see Amazon EBS encryption (https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption.html#encryption-parameters)
+ // in the Amazon EBS User Guide.
//
// In no case can you remove encryption from an encrypted volume.
//
// Encrypted volumes can only be attached to instances that support Amazon EBS
- // encryption. For more information, see Supported instance types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#EBSEncryption_supported_instances).
+ // encryption. For more information, see Supported instance types (https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption-requirements.html#ebs-encryption_supported_instances).
//
// This parameter is not returned by DescribeImageAttribute.
//
@@ -116894,8 +118713,8 @@ type EbsBlockDevice struct {
// * standard: 1 - 1024 GiB
VolumeSize *int64 `locationName:"volumeSize" type:"integer"`
- // The volume type. For more information, see Amazon EBS volume types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html)
- // in the Amazon EC2 User Guide.
+ // The volume type. For more information, see Amazon EBS volume types (https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volume-types.html)
+ // in the Amazon EBS User Guide.
VolumeType *string `locationName:"volumeType" type:"string" enum:"VolumeType"`
}
@@ -117489,6 +119308,10 @@ func (s *EgressOnlyInternetGateway) SetTags(v []*Tag) *EgressOnlyInternetGateway
return s
}
+// Amazon Elastic Graphics reached end of life on January 8, 2024. For workloads
+// that require graphics acceleration, we recommend that you use Amazon EC2
+// G4, G5, or G6 instances.
+//
// Describes the association between an instance and an Elastic Graphics accelerator.
type ElasticGpuAssociation struct {
_ struct{} `type:"structure"`
@@ -117549,6 +119372,10 @@ func (s *ElasticGpuAssociation) SetElasticGpuId(v string) *ElasticGpuAssociation
return s
}
+// Amazon Elastic Graphics reached end of life on January 8, 2024. For workloads
+// that require graphics acceleration, we recommend that you use Amazon EC2
+// G4, G5, or G6 instances.
+//
// Describes the status of an Elastic Graphics accelerator.
type ElasticGpuHealth struct {
_ struct{} `type:"structure"`
@@ -117581,14 +119408,15 @@ func (s *ElasticGpuHealth) SetStatus(v string) *ElasticGpuHealth {
return s
}
+// Amazon Elastic Graphics reached end of life on January 8, 2024. For workloads
+// that require graphics acceleration, we recommend that you use Amazon EC2
+// G4, G5, or G6 instances.
+//
// A specification for an Elastic Graphics accelerator.
type ElasticGpuSpecification struct {
_ struct{} `type:"structure"`
- // The type of Elastic Graphics accelerator. For more information about the
- // values to specify for Type, see Elastic Graphics Basics (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/elastic-graphics.html#elastic-graphics-basics),
- // specifically the Elastic Graphics accelerator column, in the Amazon Elastic
- // Compute Cloud User Guide for Windows Instances.
+ // The type of Elastic Graphics accelerator.
//
// Type is a required field
Type *string `type:"string" required:"true"`
@@ -117631,11 +119459,19 @@ func (s *ElasticGpuSpecification) SetType(v string) *ElasticGpuSpecification {
return s
}
-// Describes an elastic GPU.
+// Deprecated.
+//
+// Amazon Elastic Graphics reached end of life on January 8, 2024. For workloads
+// that require graphics acceleration, we recommend that you use Amazon EC2
+// G4ad, G4dn, or G5 instances.
type ElasticGpuSpecificationResponse struct {
_ struct{} `type:"structure"`
- // The elastic GPU type.
+ // Deprecated.
+ //
+ // Amazon Elastic Graphics reached end of life on January 8, 2024. For workloads
+ // that require graphics acceleration, we recommend that you use Amazon EC2
+ // G4ad, G4dn, or G5 instances.
Type *string `locationName:"type" type:"string"`
}
@@ -117663,6 +119499,10 @@ func (s *ElasticGpuSpecificationResponse) SetType(v string) *ElasticGpuSpecifica
return s
}
+// Amazon Elastic Graphics reached end of life on January 8, 2024. For workloads
+// that require graphics acceleration, we recommend that you use Amazon EC2
+// G4, G5, or G6 instances.
+//
// Describes an Elastic Graphics accelerator.
type ElasticGpus struct {
_ struct{} `type:"structure"`
@@ -118144,8 +119984,9 @@ func (s *EnableAddressTransferOutput) SetAddressTransfer(v *AddressTransfer) *En
type EnableAwsNetworkPerformanceMetricSubscriptionInput struct {
_ struct{} `type:"structure"`
- // The target Region or Availability Zone that the metric subscription is enabled
- // for. For example, eu-west-1.
+ // The target Region (like us-east-2) or Availability Zone ID (like use2-az2)
+ // that the metric subscription is enabled for. If you use Availability Zone
+ // IDs, the Source and Destination Availability Zones must be in the same Region.
Destination *string `type:"string"`
// Checks whether you have the required permissions for the action, without
@@ -118157,8 +119998,9 @@ type EnableAwsNetworkPerformanceMetricSubscriptionInput struct {
// The metric used for the enabled subscription.
Metric *string `type:"string" enum:"MetricType"`
- // The source Region or Availability Zone that the metric subscription is enabled
- // for. For example, us-east-1.
+ // The source Region (like us-east-1) or Availability Zone ID (like use1-az1)
+ // that the metric subscription is enabled for. If you use Availability Zone
+ // IDs, the Source and Destination Availability Zones must be in the same Region.
Source *string `type:"string"`
// The statistic used for the enabled subscription.
@@ -119095,6 +120937,105 @@ func (s *EnableImageDeprecationOutput) SetReturn(v bool) *EnableImageDeprecation
return s
}
+type EnableImageDeregistrationProtectionInput struct {
+ _ struct{} `type:"structure"`
+
+ // Checks whether you have the required permissions for the action, without
+ // actually making the request, and provides an error response. If you have
+ // the required permissions, the error response is DryRunOperation. Otherwise,
+ // it is UnauthorizedOperation.
+ DryRun *bool `type:"boolean"`
+
+ // The ID of the AMI.
+ //
+ // ImageId is a required field
+ ImageId *string `type:"string" required:"true"`
+
+ // If true, enforces deregistration protection for 24 hours after deregistration
+ // protection is disabled.
+ WithCooldown *bool `type:"boolean"`
+}
+
+// String returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s EnableImageDeregistrationProtectionInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s EnableImageDeregistrationProtectionInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *EnableImageDeregistrationProtectionInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "EnableImageDeregistrationProtectionInput"}
+ if s.ImageId == nil {
+ invalidParams.Add(request.NewErrParamRequired("ImageId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *EnableImageDeregistrationProtectionInput) SetDryRun(v bool) *EnableImageDeregistrationProtectionInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetImageId sets the ImageId field's value.
+func (s *EnableImageDeregistrationProtectionInput) SetImageId(v string) *EnableImageDeregistrationProtectionInput {
+ s.ImageId = &v
+ return s
+}
+
+// SetWithCooldown sets the WithCooldown field's value.
+func (s *EnableImageDeregistrationProtectionInput) SetWithCooldown(v bool) *EnableImageDeregistrationProtectionInput {
+ s.WithCooldown = &v
+ return s
+}
+
+type EnableImageDeregistrationProtectionOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Returns true if the request succeeds; otherwise, it returns an error.
+ Return *string `locationName:"return" type:"string"`
+}
+
+// String returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s EnableImageDeregistrationProtectionOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s EnableImageDeregistrationProtectionOutput) GoString() string {
+ return s.String()
+}
+
+// SetReturn sets the Return field's value.
+func (s *EnableImageDeregistrationProtectionOutput) SetReturn(v string) *EnableImageDeregistrationProtectionOutput {
+ s.Return = &v
+ return s
+}
+
type EnableImageInput struct {
_ struct{} `type:"structure"`
@@ -122759,9 +124700,38 @@ type FleetLaunchTemplateOverrides struct {
// The Availability Zone in which to launch the instances.
AvailabilityZone *string `locationName:"availabilityZone" type:"string"`
- // The ID of the AMI. An AMI is required to launch an instance. This parameter
- // is only available for fleets of type instant. For fleets of type maintain
- // and request, you must specify the AMI ID in the launch template.
+ // The ID of the AMI in the format ami-17characters00000.
+ //
+ // Alternatively, you can specify a Systems Manager parameter, using one of
+ // the following formats. The Systems Manager parameter will resolve to an AMI
+ // ID on launch.
+ //
+ // To reference a public parameter:
+ //
+ // * resolve:ssm:public-parameter
+ //
+ // To reference a parameter stored in the same account:
+ //
+ // * resolve:ssm:parameter-name
+ //
+ // * resolve:ssm:parameter-name:version-number
+ //
+ // * resolve:ssm:parameter-name:label
+ //
+ // To reference a parameter shared from another Amazon Web Services account:
+ //
+ // * resolve:ssm:parameter-ARN
+ //
+ // * resolve:ssm:parameter-ARN:version-number
+ //
+ // * resolve:ssm:parameter-ARN:label
+ //
+ // For more information, see Use a Systems Manager parameter instead of an AMI
+ // ID (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-launch-template.html#use-an-ssm-parameter-instead-of-an-ami-id)
+ // in the Amazon EC2 User Guide.
+ //
+ // This parameter is only available for fleets of type instant. For fleets of
+ // type maintain and request, you must specify the AMI ID in the launch template.
ImageId *string `locationName:"imageId" type:"string"`
// The attributes for the instance types. When you specify instance attributes,
@@ -122809,7 +124779,19 @@ type FleetLaunchTemplateOverrides struct {
// The ID of the subnet in which to launch the instances.
SubnetId *string `locationName:"subnetId" type:"string"`
- // The number of units provided by the specified instance type.
+ // The number of units provided by the specified instance type. These are the
+ // same units that you chose to set the target capacity in terms of instances,
+ // or a performance characteristic such as vCPUs, memory, or I/O.
+ //
+ // If the target capacity divided by this value is not a whole number, Amazon
+ // EC2 rounds the number of instances to the next whole number. If this value
+ // is not specified, the default is 1.
+ //
+ // When specifying weights, the price used in the lowest-price and price-capacity-optimized
+ // allocation strategies is per unit hour (where the instance price is divided
+ // by the specified weight). However, if all the specified weights are above
+ // the requested TargetCapacity, resulting in only 1 instance being launched,
+ // the price used is per instance hour.
WeightedCapacity *float64 `locationName:"weightedCapacity" type:"double"`
}
@@ -122892,9 +124874,38 @@ type FleetLaunchTemplateOverridesRequest struct {
// The Availability Zone in which to launch the instances.
AvailabilityZone *string `type:"string"`
- // The ID of the AMI. An AMI is required to launch an instance. This parameter
- // is only available for fleets of type instant. For fleets of type maintain
- // and request, you must specify the AMI ID in the launch template.
+ // The ID of the AMI in the format ami-17characters00000.
+ //
+ // Alternatively, you can specify a Systems Manager parameter, using one of
+ // the following formats. The Systems Manager parameter will resolve to an AMI
+ // ID on launch.
+ //
+ // To reference a public parameter:
+ //
+ // * resolve:ssm:public-parameter
+ //
+ // To reference a parameter stored in the same account:
+ //
+ // * resolve:ssm:parameter-name
+ //
+ // * resolve:ssm:parameter-name:version-number
+ //
+ // * resolve:ssm:parameter-name:label
+ //
+ // To reference a parameter shared from another Amazon Web Services account:
+ //
+ // * resolve:ssm:parameter-ARN
+ //
+ // * resolve:ssm:parameter-ARN:version-number
+ //
+ // * resolve:ssm:parameter-ARN:label
+ //
+ // For more information, see Use a Systems Manager parameter instead of an AMI
+ // ID (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-launch-template.html#use-an-ssm-parameter-instead-of-an-ami-id)
+ // in the Amazon EC2 User Guide.
+ //
+ // This parameter is only available for fleets of type instant. For fleets of
+ // type maintain and request, you must specify the AMI ID in the launch template.
ImageId *string `type:"string"`
// The attributes for the instance types. When you specify instance attributes,
@@ -122944,7 +124955,19 @@ type FleetLaunchTemplateOverridesRequest struct {
// A request of type instant can have only one subnet ID.
SubnetId *string `type:"string"`
- // The number of units provided by the specified instance type.
+ // The number of units provided by the specified instance type. These are the
+ // same units that you chose to set the target capacity in terms of instances,
+ // or a performance characteristic such as vCPUs, memory, or I/O.
+ //
+ // If the target capacity divided by this value is not a whole number, Amazon
+ // EC2 rounds the number of instances to the next whole number. If this value
+ // is not specified, the default is 1.
+ //
+ // When specifying weights, the price used in the lowest-price and price-capacity-optimized
+ // allocation strategies is per unit hour (where the instance price is divided
+ // by the specified weight). However, if all the specified weights are above
+ // the requested TargetCapacity, resulting in only 1 instance being launched,
+ // the price used is per instance hour.
WeightedCapacity *float64 `type:"double"`
}
@@ -123439,7 +125462,7 @@ type FlowLog struct {
// The maximum interval of time, in seconds, during which a flow of packets
// is captured and aggregated into a flow log record.
//
- // When a network interface is attached to a Nitro-based instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances),
+ // When a network interface is attached to a Nitro-based instance (https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html),
// the aggregation interval is always 60 seconds (1 minute) or less, regardless
// of the specified value.
//
@@ -125562,6 +127585,220 @@ func (s *GetImageBlockPublicAccessStateOutput) SetImageBlockPublicAccessState(v
return s
}
+type GetInstanceMetadataDefaultsInput struct {
+ _ struct{} `type:"structure"`
+
+ // Checks whether you have the required permissions for the action, without
+ // actually making the request, and provides an error response. If you have
+ // the required permissions, the error response is DryRunOperation. Otherwise,
+ // it is UnauthorizedOperation.
+ DryRun *bool `type:"boolean"`
+}
+
+// String returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s GetInstanceMetadataDefaultsInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s GetInstanceMetadataDefaultsInput) GoString() string {
+ return s.String()
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *GetInstanceMetadataDefaultsInput) SetDryRun(v bool) *GetInstanceMetadataDefaultsInput {
+ s.DryRun = &v
+ return s
+}
+
+type GetInstanceMetadataDefaultsOutput struct {
+ _ struct{} `type:"structure"`
+
+ // The account-level default IMDS settings.
+ AccountLevel *InstanceMetadataDefaultsResponse `locationName:"accountLevel" type:"structure"`
+}
+
+// String returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s GetInstanceMetadataDefaultsOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s GetInstanceMetadataDefaultsOutput) GoString() string {
+ return s.String()
+}
+
+// SetAccountLevel sets the AccountLevel field's value.
+func (s *GetInstanceMetadataDefaultsOutput) SetAccountLevel(v *InstanceMetadataDefaultsResponse) *GetInstanceMetadataDefaultsOutput {
+ s.AccountLevel = v
+ return s
+}
+
+type GetInstanceTpmEkPubInput struct {
+ _ struct{} `type:"structure"`
+
+ // Specify this parameter to verify whether the request will succeed, without
+ // actually making the request. If the request will succeed, the response is
+ // DryRunOperation. Otherwise, the response is UnauthorizedOperation.
+ DryRun *bool `type:"boolean"`
+
+ // The ID of the instance for which to get the public endorsement key.
+ //
+ // InstanceId is a required field
+ InstanceId *string `type:"string" required:"true"`
+
+ // The required public endorsement key format. Specify der for a DER-encoded
+ // public key that is compatible with OpenSSL. Specify tpmt for a TPM 2.0 format
+ // that is compatible with tpm2-tools. The returned key is base64 encoded.
+ //
+ // KeyFormat is a required field
+ KeyFormat *string `type:"string" required:"true" enum:"EkPubKeyFormat"`
+
+ // The required public endorsement key type.
+ //
+ // KeyType is a required field
+ KeyType *string `type:"string" required:"true" enum:"EkPubKeyType"`
+}
+
+// String returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s GetInstanceTpmEkPubInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s GetInstanceTpmEkPubInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *GetInstanceTpmEkPubInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "GetInstanceTpmEkPubInput"}
+ if s.InstanceId == nil {
+ invalidParams.Add(request.NewErrParamRequired("InstanceId"))
+ }
+ if s.KeyFormat == nil {
+ invalidParams.Add(request.NewErrParamRequired("KeyFormat"))
+ }
+ if s.KeyType == nil {
+ invalidParams.Add(request.NewErrParamRequired("KeyType"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *GetInstanceTpmEkPubInput) SetDryRun(v bool) *GetInstanceTpmEkPubInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetInstanceId sets the InstanceId field's value.
+func (s *GetInstanceTpmEkPubInput) SetInstanceId(v string) *GetInstanceTpmEkPubInput {
+ s.InstanceId = &v
+ return s
+}
+
+// SetKeyFormat sets the KeyFormat field's value.
+func (s *GetInstanceTpmEkPubInput) SetKeyFormat(v string) *GetInstanceTpmEkPubInput {
+ s.KeyFormat = &v
+ return s
+}
+
+// SetKeyType sets the KeyType field's value.
+func (s *GetInstanceTpmEkPubInput) SetKeyType(v string) *GetInstanceTpmEkPubInput {
+ s.KeyType = &v
+ return s
+}
+
+type GetInstanceTpmEkPubOutput struct {
+ _ struct{} `type:"structure"`
+
+ // The ID of the instance.
+ InstanceId *string `locationName:"instanceId" type:"string"`
+
+ // The public endorsement key format.
+ KeyFormat *string `locationName:"keyFormat" type:"string" enum:"EkPubKeyFormat"`
+
+ // The public endorsement key type.
+ KeyType *string `locationName:"keyType" type:"string" enum:"EkPubKeyType"`
+
+ // The public endorsement key material.
+ //
+ // KeyValue is a sensitive parameter and its value will be
+ // replaced with "sensitive" in string returned by GetInstanceTpmEkPubOutput's
+ // String and GoString methods.
+ KeyValue *string `locationName:"keyValue" type:"string" sensitive:"true"`
+}
+
+// String returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s GetInstanceTpmEkPubOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s GetInstanceTpmEkPubOutput) GoString() string {
+ return s.String()
+}
+
+// SetInstanceId sets the InstanceId field's value.
+func (s *GetInstanceTpmEkPubOutput) SetInstanceId(v string) *GetInstanceTpmEkPubOutput {
+ s.InstanceId = &v
+ return s
+}
+
+// SetKeyFormat sets the KeyFormat field's value.
+func (s *GetInstanceTpmEkPubOutput) SetKeyFormat(v string) *GetInstanceTpmEkPubOutput {
+ s.KeyFormat = &v
+ return s
+}
+
+// SetKeyType sets the KeyType field's value.
+func (s *GetInstanceTpmEkPubOutput) SetKeyType(v string) *GetInstanceTpmEkPubOutput {
+ s.KeyType = &v
+ return s
+}
+
+// SetKeyValue sets the KeyValue field's value.
+func (s *GetInstanceTpmEkPubOutput) SetKeyValue(v string) *GetInstanceTpmEkPubOutput {
+ s.KeyValue = &v
+ return s
+}
+
type GetInstanceTypesFromInstanceRequirementsInput struct {
_ struct{} `type:"structure"`
@@ -130078,7 +132315,7 @@ func (s *GroupIdentifier) SetGroupName(v string) *GroupIdentifier {
// Indicates whether your instance is configured for hibernation. This parameter
// is valid only if the instance meets the hibernation prerequisites (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hibernating-prerequisites.html).
-// For more information, see Hibernate your instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html)
+// For more information, see Hibernate your Amazon EC2 instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html)
// in the Amazon EC2 User Guide.
type HibernationOptions struct {
_ struct{} `type:"structure"`
@@ -130114,7 +132351,7 @@ func (s *HibernationOptions) SetConfigured(v bool) *HibernationOptions {
// Indicates whether your instance is configured for hibernation. This parameter
// is valid only if the instance meets the hibernation prerequisites (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hibernating-prerequisites.html).
-// For more information, see Hibernate your instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html)
+// For more information, see Hibernate your Amazon EC2 instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html)
// in the Amazon EC2 User Guide.
type HibernationOptionsRequest struct {
_ struct{} `type:"structure"`
@@ -131167,6 +133404,9 @@ type Image struct {
// the seconds to the nearest minute.
DeprecationTime *string `locationName:"deprecationTime" type:"string"`
+ // Indicates whether deregistration protection is enabled for the AMI.
+ DeregistrationProtection *string `locationName:"deregistrationProtection" type:"string"`
+
// The description of the AMI that was provided during image creation.
Description *string `locationName:"description" type:"string"`
@@ -131182,8 +133422,7 @@ type Image struct {
// The location of the AMI.
ImageLocation *string `locationName:"imageLocation" type:"string"`
- // The Amazon Web Services account alias (for example, amazon, self) or the
- // Amazon Web Services account ID of the AMI owner.
+ // The owner alias (amazon | aws-marketplace).
ImageOwnerAlias *string `locationName:"imageOwnerAlias" type:"string"`
// The type of image.
@@ -131201,6 +133440,13 @@ type Image struct {
// images.
KernelId *string `locationName:"kernelId" type:"string"`
+ // The date and time, in ISO 8601 date-time format (http://www.iso.org/iso/iso8601),
+ // when the AMI was last used to launch an EC2 instance. When the AMI is used
+ // to launch an instance, there is a 24-hour delay before that usage is reported.
+ //
+ // lastLaunchedTime data is available starting April 2017.
+ LastLaunchedTime *string `locationName:"lastLaunchedTime" type:"string"`
+
// The name of the AMI that was provided during image creation.
Name *string `locationName:"name" type:"string"`
@@ -131320,6 +133566,12 @@ func (s *Image) SetDeprecationTime(v string) *Image {
return s
}
+// SetDeregistrationProtection sets the DeregistrationProtection field's value.
+func (s *Image) SetDeregistrationProtection(v string) *Image {
+ s.DeregistrationProtection = &v
+ return s
+}
+
// SetDescription sets the Description field's value.
func (s *Image) SetDescription(v string) *Image {
s.Description = &v
@@ -131374,6 +133626,12 @@ func (s *Image) SetKernelId(v string) *Image {
return s
}
+// SetLastLaunchedTime sets the LastLaunchedTime field's value.
+func (s *Image) SetLastLaunchedTime(v string) *Image {
+ s.LastLaunchedTime = &v
+ return s
+}
+
// SetName sets the Name field's value.
func (s *Image) SetName(v string) *Image {
s.Name = &v
@@ -133554,7 +135812,11 @@ type Instance struct {
// Optimized instance.
EbsOptimized *bool `locationName:"ebsOptimized" type:"boolean"`
- // The Elastic GPU associated with the instance.
+ // Deprecated.
+ //
+ // Amazon Elastic Graphics reached end of life on January 8, 2024. For workloads
+ // that require graphics acceleration, we recommend that you use Amazon EC2
+ // G4ad, G4dn, or G5 instances.
ElasticGpuAssociations []*ElasticGpuAssociation `locationName:"elasticGpuAssociationSet" locationNameList:"item" type:"list"`
// The elastic inference accelerator associated with the instance.
@@ -135202,6 +137464,76 @@ func (s *InstanceMarketOptionsRequest) SetSpotOptions(v *SpotMarketOptions) *Ins
return s
}
+// The default instance metadata service (IMDS) settings that were set at the
+// account level in the specified Amazon Web Services Region.
+type InstanceMetadataDefaultsResponse struct {
+ _ struct{} `type:"structure"`
+
+ // Indicates whether the IMDS endpoint for an instance is enabled or disabled.
+ // When disabled, the instance metadata can't be accessed.
+ HttpEndpoint *string `locationName:"httpEndpoint" type:"string" enum:"InstanceMetadataEndpointState"`
+
+ // The maximum number of hops that the metadata token can travel.
+ HttpPutResponseHopLimit *int64 `locationName:"httpPutResponseHopLimit" type:"integer"`
+
+ // Indicates whether IMDSv2 is required.
+ //
+ // * optional – IMDSv2 is optional, which means that you can use either
+ // IMDSv2 or IMDSv1.
+ //
+ // * required – IMDSv2 is required, which means that IMDSv1 is disabled,
+ // and you must use IMDSv2.
+ HttpTokens *string `locationName:"httpTokens" type:"string" enum:"HttpTokensState"`
+
+ // Indicates whether access to instance tags from the instance metadata is enabled
+ // or disabled. For more information, see Work with instance tags using the
+ // instance metadata (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#work-with-tags-in-IMDS)
+ // in the Amazon EC2 User Guide.
+ InstanceMetadataTags *string `locationName:"instanceMetadataTags" type:"string" enum:"InstanceMetadataTagsState"`
+}
+
+// String returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s InstanceMetadataDefaultsResponse) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s InstanceMetadataDefaultsResponse) GoString() string {
+ return s.String()
+}
+
+// SetHttpEndpoint sets the HttpEndpoint field's value.
+func (s *InstanceMetadataDefaultsResponse) SetHttpEndpoint(v string) *InstanceMetadataDefaultsResponse {
+ s.HttpEndpoint = &v
+ return s
+}
+
+// SetHttpPutResponseHopLimit sets the HttpPutResponseHopLimit field's value.
+func (s *InstanceMetadataDefaultsResponse) SetHttpPutResponseHopLimit(v int64) *InstanceMetadataDefaultsResponse {
+ s.HttpPutResponseHopLimit = &v
+ return s
+}
+
+// SetHttpTokens sets the HttpTokens field's value.
+func (s *InstanceMetadataDefaultsResponse) SetHttpTokens(v string) *InstanceMetadataDefaultsResponse {
+ s.HttpTokens = &v
+ return s
+}
+
+// SetInstanceMetadataTags sets the InstanceMetadataTags field's value.
+func (s *InstanceMetadataDefaultsResponse) SetInstanceMetadataTags(v string) *InstanceMetadataDefaultsResponse {
+ s.InstanceMetadataTags = &v
+ return s
+}
+
// The metadata options for the instance.
type InstanceMetadataOptionsRequest struct {
_ struct{} `type:"structure"`
@@ -135214,31 +137546,37 @@ type InstanceMetadataOptionsRequest struct {
HttpEndpoint *string `type:"string" enum:"InstanceMetadataEndpointState"`
// Enables or disables the IPv6 endpoint for the instance metadata service.
+ //
+ // Default: disabled
HttpProtocolIpv6 *string `type:"string" enum:"InstanceMetadataProtocolState"`
- // The desired HTTP PUT response hop limit for instance metadata requests. The
- // larger the number, the further instance metadata requests can travel.
- //
- // Default: 1
+ // The maximum number of hops that the metadata token can travel.
//
// Possible values: Integers from 1 to 64
HttpPutResponseHopLimit *int64 `type:"integer"`
// Indicates whether IMDSv2 is required.
//
- // * optional - IMDSv2 is optional. You can choose whether to send a session
- // token in your instance metadata retrieval requests. If you retrieve IAM
- // role credentials without a session token, you receive the IMDSv1 role
- // credentials. If you retrieve IAM role credentials using a valid session
- // token, you receive the IMDSv2 role credentials.
+ // * optional - IMDSv2 is optional, which means that you can use either IMDSv2
+ // or IMDSv1.
//
- // * required - IMDSv2 is required. You must send a session token in your
- // instance metadata retrieval requests. With this option, retrieving the
- // IAM role credentials always returns IMDSv2 credentials; IMDSv1 credentials
- // are not available.
+ // * required - IMDSv2 is required, which means that IMDSv1 is disabled,
+ // and you must use IMDSv2.
//
- // Default: If the value of ImdsSupport for the Amazon Machine Image (AMI) for
- // your instance is v2.0, the default is required.
+ // Default:
+ //
+ // * If the value of ImdsSupport for the Amazon Machine Image (AMI) for your
+ // instance is v2.0 and the account level default is set to no-preference,
+ // the default is required.
+ //
+ // * If the value of ImdsSupport for the Amazon Machine Image (AMI) for your
+ // instance is v2.0, but the account level default is set to V1 or V2, the
+ // default is optional.
+ //
+ // The default value can also be affected by other combinations of parameters.
+ // For more information, see Order of precedence for instance metadata options
+ // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-options.html#instance-metadata-options-order-of-precedence)
+ // in the Amazon EC2 User Guide.
HttpTokens *string `type:"string" enum:"HttpTokensState"`
// Set to enabled to allow access to instance tags from the instance metadata.
@@ -135310,28 +137648,22 @@ type InstanceMetadataOptionsResponse struct {
// Indicates whether the IPv6 endpoint for the instance metadata service is
// enabled or disabled.
+ //
+ // Default: disabled
HttpProtocolIpv6 *string `locationName:"httpProtocolIpv6" type:"string" enum:"InstanceMetadataProtocolState"`
- // The desired HTTP PUT response hop limit for instance metadata requests. The
- // larger the number, the further instance metadata requests can travel.
- //
- // Default: 1
+ // The maximum number of hops that the metadata token can travel.
//
// Possible values: Integers from 1 to 64
HttpPutResponseHopLimit *int64 `locationName:"httpPutResponseHopLimit" type:"integer"`
// Indicates whether IMDSv2 is required.
//
- // * optional - IMDSv2 is optional. You can choose whether to send a session
- // token in your instance metadata retrieval requests. If you retrieve IAM
- // role credentials without a session token, you receive the IMDSv1 role
- // credentials. If you retrieve IAM role credentials using a valid session
- // token, you receive the IMDSv2 role credentials.
+ // * optional - IMDSv2 is optional, which means that you can use either IMDSv2
+ // or IMDSv1.
//
- // * required - IMDSv2 is required. You must send a session token in your
- // instance metadata retrieval requests. With this option, retrieving the
- // IAM role credentials always returns IMDSv2 credentials; IMDSv1 credentials
- // are not available.
+ // * required - IMDSv2 is required, which means that IMDSv1 is disabled,
+ // and you must use IMDSv2.
HttpTokens *string `locationName:"httpTokens" type:"string" enum:"HttpTokensState"`
// Indicates whether access to instance tags from the instance metadata is enabled
@@ -135457,7 +137789,7 @@ type InstanceNetworkInterface struct {
// A security group connection tracking configuration that enables you to set
// the timeout for connection tracking on an Elastic network interface. For
// more information, see Connection tracking timeouts (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-connection-tracking.html#connection-tracking-timeouts)
- // in the Amazon Elastic Compute Cloud User Guide.
+ // in the Amazon EC2 User Guide.
ConnectionTrackingConfiguration *ConnectionTrackingSpecificationResponse `locationName:"connectionTrackingConfiguration" type:"structure"`
// The description.
@@ -135816,16 +138148,16 @@ type InstanceNetworkInterfaceSpecification struct {
// one. You cannot specify more than one network interface in the request. If
// launching into a default subnet, the default value is true.
//
- // Starting on February 1, 2024, Amazon Web Services will charge for all public
- // IPv4 addresses, including public IPv4 addresses associated with running instances
- // and Elastic IP addresses. For more information, see the Public IPv4 Address
- // tab on the Amazon VPC pricing page (http://aws.amazon.com/vpc/pricing/).
+ // Amazon Web Services charges for all public IPv4 addresses, including public
+ // IPv4 addresses associated with running instances and Elastic IP addresses.
+ // For more information, see the Public IPv4 Address tab on the Amazon VPC pricing
+ // page (http://aws.amazon.com/vpc/pricing/).
AssociatePublicIpAddress *bool `locationName:"associatePublicIpAddress" type:"boolean"`
// A security group connection tracking specification that enables you to set
// the timeout for connection tracking on an Elastic network interface. For
// more information, see Connection tracking timeouts (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-connection-tracking.html#connection-tracking-timeouts)
- // in the Amazon Elastic Compute Cloud User Guide.
+ // in the Amazon EC2 User Guide.
ConnectionTrackingSpecification *ConnectionTrackingSpecificationRequest `type:"structure"`
// If set to true, the interface is deleted when the instance is terminated.
@@ -136365,6 +138697,30 @@ type InstanceRequirements struct {
// Default: hdd and ssd
LocalStorageTypes []*string `locationName:"localStorageTypeSet" locationNameList:"item" type:"list" enum:"LocalStorageType"`
+ // [Price protection] The price protection threshold for Spot Instances, as
+ // a percentage of an identified On-Demand price. The identified On-Demand price
+ // is the price of the lowest priced current generation C, M, or R instance
+ // type with your specified attributes. If no current generation C, M, or R
+ // instance type matches your attributes, then the identified price is from
+ // the lowest priced current generation instance types, and failing that, from
+ // the lowest priced previous generation instance types that match your attributes.
+ // When Amazon EC2 selects instance types with your attributes, it will exclude
+ // instance types whose price exceeds your specified threshold.
+ //
+ // The parameter accepts an integer, which Amazon EC2 interprets as a percentage.
+ //
+ // If you set TargetCapacityUnitType to vcpu or memory-mib, the price protection
+ // threshold is based on the per vCPU or per memory price instead of the per
+ // instance price.
+ //
+ // Only one of SpotMaxPricePercentageOverLowestPrice or MaxSpotPriceAsPercentageOfOptimalOnDemandPrice
+ // can be specified. If you don't specify either, Amazon EC2 will automatically
+ // apply optimal price protection to consistently select from a wide range of
+ // instance types. To indicate no price protection threshold for Spot Instances,
+ // meaning you want to consider all instance types that match your attributes,
+ // include one of these parameters and specify a high value, such as 999999.
+ MaxSpotPriceAsPercentageOfOptimalOnDemandPrice *int64 `locationName:"maxSpotPriceAsPercentageOfOptimalOnDemandPrice" type:"integer"`
+
// The minimum and maximum amount of memory per vCPU, in GiB.
//
// Default: No minimum or maximum limits
@@ -136384,11 +138740,12 @@ type InstanceRequirements struct {
// Default: No minimum or maximum limits
NetworkInterfaceCount *NetworkInterfaceCount `locationName:"networkInterfaceCount" type:"structure"`
- // The price protection threshold for On-Demand Instances. This is the maximum
- // you’ll pay for an On-Demand Instance, expressed as a percentage above the
- // least expensive current generation M, C, or R instance type with your specified
- // attributes. When Amazon EC2 selects instance types with your attributes,
- // it excludes instance types priced above your threshold.
+ // [Price protection] The price protection threshold for On-Demand Instances,
+ // as a percentage higher than an identified On-Demand price. The identified
+ // On-Demand price is the price of the lowest priced current generation C, M,
+ // or R instance type with your specified attributes. When Amazon EC2 selects
+ // instance types with your attributes, it will exclude instance types whose
+ // price exceeds your specified threshold.
//
// The parameter accepts an integer, which Amazon EC2 interprets as a percentage.
//
@@ -136411,22 +138768,31 @@ type InstanceRequirements struct {
// Default: false
RequireHibernateSupport *bool `locationName:"requireHibernateSupport" type:"boolean"`
- // The price protection threshold for Spot Instances. This is the maximum you’ll
- // pay for a Spot Instance, expressed as a percentage above the least expensive
- // current generation M, C, or R instance type with your specified attributes.
- // When Amazon EC2 selects instance types with your attributes, it excludes
- // instance types priced above your threshold.
+ // [Price protection] The price protection threshold for Spot Instances, as
+ // a percentage higher than an identified Spot price. The identified Spot price
+ // is the Spot price of the lowest priced current generation C, M, or R instance
+ // type with your specified attributes. If no current generation C, M, or R
+ // instance type matches your attributes, then the identified Spot price is
+ // from the lowest priced current generation instance types, and failing that,
+ // from the lowest priced previous generation instance types that match your
+ // attributes. When Amazon EC2 selects instance types with your attributes,
+ // it will exclude instance types whose Spot price exceeds your specified threshold.
//
// The parameter accepts an integer, which Amazon EC2 interprets as a percentage.
//
- // To turn off price protection, specify a high value, such as 999999.
+ // If you set TargetCapacityUnitType to vcpu or memory-mib, the price protection
+ // threshold is applied based on the per-vCPU or per-memory price instead of
+ // the per-instance price.
//
// This parameter is not supported for GetSpotPlacementScores (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetSpotPlacementScores.html)
// and GetInstanceTypesFromInstanceRequirements (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetInstanceTypesFromInstanceRequirements.html).
//
- // If you set TargetCapacityUnitType to vcpu or memory-mib, the price protection
- // threshold is applied based on the per-vCPU or per-memory price instead of
- // the per-instance price.
+ // Only one of SpotMaxPricePercentageOverLowestPrice or MaxSpotPriceAsPercentageOfOptimalOnDemandPrice
+ // can be specified. If you don't specify either, Amazon EC2 will automatically
+ // apply optimal price protection to consistently select from a wide range of
+ // instance types. To indicate no price protection threshold for Spot Instances,
+ // meaning you want to consider all instance types that match your attributes,
+ // include one of these parameters and specify a high value, such as 999999.
//
// Default: 100
SpotMaxPricePercentageOverLowestPrice *int64 `locationName:"spotMaxPricePercentageOverLowestPrice" type:"integer"`
@@ -136542,6 +138908,12 @@ func (s *InstanceRequirements) SetLocalStorageTypes(v []*string) *InstanceRequir
return s
}
+// SetMaxSpotPriceAsPercentageOfOptimalOnDemandPrice sets the MaxSpotPriceAsPercentageOfOptimalOnDemandPrice field's value.
+func (s *InstanceRequirements) SetMaxSpotPriceAsPercentageOfOptimalOnDemandPrice(v int64) *InstanceRequirements {
+ s.MaxSpotPriceAsPercentageOfOptimalOnDemandPrice = &v
+ return s
+}
+
// SetMemoryGiBPerVCpu sets the MemoryGiBPerVCpu field's value.
func (s *InstanceRequirements) SetMemoryGiBPerVCpu(v *MemoryGiBPerVCpu) *InstanceRequirements {
s.MemoryGiBPerVCpu = v
@@ -136817,6 +139189,30 @@ type InstanceRequirementsRequest struct {
// Default: hdd and ssd
LocalStorageTypes []*string `locationName:"LocalStorageType" locationNameList:"item" type:"list" enum:"LocalStorageType"`
+ // [Price protection] The price protection threshold for Spot Instances, as
+ // a percentage of an identified On-Demand price. The identified On-Demand price
+ // is the price of the lowest priced current generation C, M, or R instance
+ // type with your specified attributes. If no current generation C, M, or R
+ // instance type matches your attributes, then the identified price is from
+ // the lowest priced current generation instance types, and failing that, from
+ // the lowest priced previous generation instance types that match your attributes.
+ // When Amazon EC2 selects instance types with your attributes, it will exclude
+ // instance types whose price exceeds your specified threshold.
+ //
+ // The parameter accepts an integer, which Amazon EC2 interprets as a percentage.
+ //
+ // If you set TargetCapacityUnitType to vcpu or memory-mib, the price protection
+ // threshold is based on the per vCPU or per memory price instead of the per
+ // instance price.
+ //
+ // Only one of SpotMaxPricePercentageOverLowestPrice or MaxSpotPriceAsPercentageOfOptimalOnDemandPrice
+ // can be specified. If you don't specify either, Amazon EC2 will automatically
+ // apply optimal price protection to consistently select from a wide range of
+ // instance types. To indicate no price protection threshold for Spot Instances,
+ // meaning you want to consider all instance types that match your attributes,
+ // include one of these parameters and specify a high value, such as 999999.
+ MaxSpotPriceAsPercentageOfOptimalOnDemandPrice *int64 `type:"integer"`
+
// The minimum and maximum amount of memory per vCPU, in GiB.
//
// Default: No minimum or maximum limits
@@ -136840,15 +139236,17 @@ type InstanceRequirementsRequest struct {
// Default: No minimum or maximum limits
NetworkInterfaceCount *NetworkInterfaceCountRequest `type:"structure"`
- // The price protection threshold for On-Demand Instances. This is the maximum
- // you’ll pay for an On-Demand Instance, expressed as a percentage above the
- // least expensive current generation M, C, or R instance type with your specified
- // attributes. When Amazon EC2 selects instance types with your attributes,
- // it excludes instance types priced above your threshold.
+ // [Price protection] The price protection threshold for On-Demand Instances,
+ // as a percentage higher than an identified On-Demand price. The identified
+ // On-Demand price is the price of the lowest priced current generation C, M,
+ // or R instance type with your specified attributes. When Amazon EC2 selects
+ // instance types with your attributes, it will exclude instance types whose
+ // price exceeds your specified threshold.
//
// The parameter accepts an integer, which Amazon EC2 interprets as a percentage.
//
- // To turn off price protection, specify a high value, such as 999999.
+ // To indicate no price protection threshold, specify a high value, such as
+ // 999999.
//
// This parameter is not supported for GetSpotPlacementScores (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetSpotPlacementScores.html)
// and GetInstanceTypesFromInstanceRequirements (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetInstanceTypesFromInstanceRequirements.html).
@@ -136867,22 +139265,31 @@ type InstanceRequirementsRequest struct {
// Default: false
RequireHibernateSupport *bool `type:"boolean"`
- // The price protection threshold for Spot Instance. This is the maximum you’ll
- // pay for an Spot Instance, expressed as a percentage above the least expensive
- // current generation M, C, or R instance type with your specified attributes.
- // When Amazon EC2 selects instance types with your attributes, it excludes
- // instance types priced above your threshold.
+ // [Price protection] The price protection threshold for Spot Instances, as
+ // a percentage higher than an identified Spot price. The identified Spot price
+ // is the Spot price of the lowest priced current generation C, M, or R instance
+ // type with your specified attributes. If no current generation C, M, or R
+ // instance type matches your attributes, then the identified Spot price is
+ // from the lowest priced current generation instance types, and failing that,
+ // from the lowest priced previous generation instance types that match your
+ // attributes. When Amazon EC2 selects instance types with your attributes,
+ // it will exclude instance types whose Spot price exceeds your specified threshold.
//
// The parameter accepts an integer, which Amazon EC2 interprets as a percentage.
//
- // To turn off price protection, specify a high value, such as 999999.
+ // If you set TargetCapacityUnitType to vcpu or memory-mib, the price protection
+ // threshold is applied based on the per-vCPU or per-memory price instead of
+ // the per-instance price.
//
// This parameter is not supported for GetSpotPlacementScores (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetSpotPlacementScores.html)
// and GetInstanceTypesFromInstanceRequirements (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetInstanceTypesFromInstanceRequirements.html).
//
- // If you set TargetCapacityUnitType to vcpu or memory-mib, the price protection
- // threshold is applied based on the per-vCPU or per-memory price instead of
- // the per-instance price.
+ // Only one of SpotMaxPricePercentageOverLowestPrice or MaxSpotPriceAsPercentageOfOptimalOnDemandPrice
+ // can be specified. If you don't specify either, Amazon EC2 will automatically
+ // apply optimal price protection to consistently select from a wide range of
+ // instance types. To indicate no price protection threshold for Spot Instances,
+ // meaning you want to consider all instance types that match your attributes,
+ // include one of these parameters and specify a high value, such as 999999.
//
// Default: 100
SpotMaxPricePercentageOverLowestPrice *int64 `type:"integer"`
@@ -137026,6 +139433,12 @@ func (s *InstanceRequirementsRequest) SetLocalStorageTypes(v []*string) *Instanc
return s
}
+// SetMaxSpotPriceAsPercentageOfOptimalOnDemandPrice sets the MaxSpotPriceAsPercentageOfOptimalOnDemandPrice field's value.
+func (s *InstanceRequirementsRequest) SetMaxSpotPriceAsPercentageOfOptimalOnDemandPrice(v int64) *InstanceRequirementsRequest {
+ s.MaxSpotPriceAsPercentageOfOptimalOnDemandPrice = &v
+ return s
+}
+
// SetMemoryGiBPerVCpu sets the MemoryGiBPerVCpu field's value.
func (s *InstanceRequirementsRequest) SetMemoryGiBPerVCpu(v *MemoryGiBPerVCpuRequest) *InstanceRequirementsRequest {
s.MemoryGiBPerVCpu = v
@@ -137719,7 +140132,7 @@ type InstanceTopology struct {
InstanceType *string `locationName:"instanceType" type:"string"`
// The network nodes. The nodes are hashed based on your account. Instances
- // from different accounts running under the same droplet will return a different
+ // from different accounts running under the same server will return a different
// hashed list of strings.
NetworkNodes []*string `locationName:"networkNodeSet" locationNameList:"item" type:"list"`
@@ -137832,12 +140245,18 @@ type InstanceTypeInfo struct {
// in the Amazon EC2 User Guide.
InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"`
+ // Describes the media accelerator settings for the instance type.
+ MediaAcceleratorInfo *MediaAcceleratorInfo `locationName:"mediaAcceleratorInfo" type:"structure"`
+
// Describes the memory for the instance type.
MemoryInfo *MemoryInfo `locationName:"memoryInfo" type:"structure"`
// Describes the network settings for the instance type.
NetworkInfo *NetworkInfo `locationName:"networkInfo" type:"structure"`
+ // Describes the Neuron accelerator settings for the instance type.
+ NeuronInfo *NeuronInfo `locationName:"neuronInfo" type:"structure"`
+
// Indicates whether Nitro Enclaves is supported.
NitroEnclavesSupport *string `locationName:"nitroEnclavesSupport" type:"string" enum:"NitroEnclavesSupport"`
@@ -137847,6 +140266,10 @@ type InstanceTypeInfo struct {
// Indicates whether NitroTPM is supported.
NitroTpmSupport *string `locationName:"nitroTpmSupport" type:"string" enum:"NitroTpmSupport"`
+ // Indicates whether a local Precision Time Protocol (PTP) hardware clock (PHC)
+ // is supported.
+ PhcSupport *string `locationName:"phcSupport" type:"string" enum:"PhcSupport"`
+
// Describes the placement group settings for the instance type.
PlacementGroupInfo *PlacementGroupInfo `locationName:"placementGroupInfo" type:"structure"`
@@ -137978,6 +140401,12 @@ func (s *InstanceTypeInfo) SetInstanceType(v string) *InstanceTypeInfo {
return s
}
+// SetMediaAcceleratorInfo sets the MediaAcceleratorInfo field's value.
+func (s *InstanceTypeInfo) SetMediaAcceleratorInfo(v *MediaAcceleratorInfo) *InstanceTypeInfo {
+ s.MediaAcceleratorInfo = v
+ return s
+}
+
// SetMemoryInfo sets the MemoryInfo field's value.
func (s *InstanceTypeInfo) SetMemoryInfo(v *MemoryInfo) *InstanceTypeInfo {
s.MemoryInfo = v
@@ -137990,6 +140419,12 @@ func (s *InstanceTypeInfo) SetNetworkInfo(v *NetworkInfo) *InstanceTypeInfo {
return s
}
+// SetNeuronInfo sets the NeuronInfo field's value.
+func (s *InstanceTypeInfo) SetNeuronInfo(v *NeuronInfo) *InstanceTypeInfo {
+ s.NeuronInfo = v
+ return s
+}
+
// SetNitroEnclavesSupport sets the NitroEnclavesSupport field's value.
func (s *InstanceTypeInfo) SetNitroEnclavesSupport(v string) *InstanceTypeInfo {
s.NitroEnclavesSupport = &v
@@ -138008,6 +140443,12 @@ func (s *InstanceTypeInfo) SetNitroTpmSupport(v string) *InstanceTypeInfo {
return s
}
+// SetPhcSupport sets the PhcSupport field's value.
+func (s *InstanceTypeInfo) SetPhcSupport(v string) *InstanceTypeInfo {
+ s.PhcSupport = &v
+ return s
+}
+
// SetPlacementGroupInfo sets the PlacementGroupInfo field's value.
func (s *InstanceTypeInfo) SetPlacementGroupInfo(v *PlacementGroupInfo) *InstanceTypeInfo {
s.PlacementGroupInfo = v
@@ -138335,14 +140776,12 @@ func (s *InternetGatewayAttachment) SetVpcId(v string) *InternetGatewayAttachmen
return s
}
-// Describes a set of permissions for a security group rule.
+// Describes the permissions for a security group rule.
type IpPermission struct {
_ struct{} `type:"structure"`
// If the protocol is TCP or UDP, this is the start of the port range. If the
- // protocol is ICMP or ICMPv6, this is the type number. A value of -1 indicates
- // all ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6 types, you must specify
- // all ICMP/ICMPv6 codes.
+ // protocol is ICMP or ICMPv6, this is the ICMP type or -1 (all ICMP types).
FromPort *int64 `locationName:"fromPort" type:"integer"`
// The IP protocol name (tcp, udp, icmp, icmpv6) or number (see Protocol Numbers
@@ -138355,19 +140794,19 @@ type IpPermission struct {
// if you omit the port range, traffic for all types and codes is allowed.
IpProtocol *string `locationName:"ipProtocol" type:"string"`
- // The IPv4 ranges.
+ // The IPv4 address ranges.
IpRanges []*IpRange `locationName:"ipRanges" locationNameList:"item" type:"list"`
- // The IPv6 ranges.
+ // The IPv6 address ranges.
Ipv6Ranges []*Ipv6Range `locationName:"ipv6Ranges" locationNameList:"item" type:"list"`
// The prefix list IDs.
PrefixListIds []*PrefixListId `locationName:"prefixListIds" locationNameList:"item" type:"list"`
// If the protocol is TCP or UDP, this is the end of the port range. If the
- // protocol is ICMP or ICMPv6, this is the code. A value of -1 indicates all
- // ICMP/ICMPv6 codes. If you specify all ICMP/ICMPv6 types, you must specify
- // all ICMP/ICMPv6 codes.
+ // protocol is ICMP or ICMPv6, this is the ICMP code or -1 (all ICMP codes).
+ // If the start port is -1 (all ICMP types), then the end port must be -1 (all
+ // ICMP codes).
ToPort *int64 `locationName:"toPort" type:"integer"`
// The security group and Amazon Web Services account ID pairs.
@@ -138434,11 +140873,11 @@ func (s *IpPermission) SetUserIdGroupPairs(v []*UserIdGroupPair) *IpPermission {
return s
}
-// Describes an IPv4 range.
+// Describes an IPv4 address range.
type IpRange struct {
_ struct{} `type:"structure"`
- // The IPv4 CIDR range. You can either specify a CIDR range or a source security
+ // The IPv4 address range. You can either specify a CIDR block or a source security
// group, not both. To specify a single IPv4 address, use the /32 prefix length.
CidrIp *string `locationName:"cidrIp" type:"string"`
@@ -138941,8 +141380,11 @@ type IpamDiscoveredPublicAddress struct {
// The resource discovery ID.
IpamResourceDiscoveryId *string `locationName:"ipamResourceDiscoveryId" type:"string"`
- // The network border group that the resource that the IP address is assigned
- // to is in.
+ // The Availability Zone (AZ) or Local Zone (LZ) network border group that the
+ // resource that the IP address is assigned to is in. Defaults to an AZ network
+ // border group. For more information on available Local Zones, see Local Zone
+ // availability (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html#byoip-zone-avail)
+ // in the Amazon EC2 User Guide.
NetworkBorderGroup *string `locationName:"networkBorderGroup" type:"string"`
// The description of the network interface that IP address is assigned to.
@@ -139118,6 +141560,9 @@ func (s *IpamDiscoveredPublicAddress) SetVpcId(v string) *IpamDiscoveredPublicAd
type IpamDiscoveredResourceCidr struct {
_ struct{} `type:"structure"`
+ // The Availability Zone ID.
+ AvailabilityZoneId *string `locationName:"availabilityZoneId" type:"string"`
+
// The percentage of IP address space in use. To convert the decimal to a percentage,
// multiply the decimal by 100. Note the following:
//
@@ -139138,6 +141583,10 @@ type IpamDiscoveredResourceCidr struct {
// The resource discovery ID.
IpamResourceDiscoveryId *string `locationName:"ipamResourceDiscoveryId" type:"string"`
+ // For elastic network interfaces, this is the status of whether or not the
+ // elastic network interface is attached.
+ NetworkInterfaceAttachmentStatus *string `locationName:"networkInterfaceAttachmentStatus" type:"string" enum:"IpamNetworkInterfaceAttachmentStatus"`
+
// The resource CIDR.
ResourceCidr *string `locationName:"resourceCidr" type:"string"`
@@ -139181,6 +141630,12 @@ func (s IpamDiscoveredResourceCidr) GoString() string {
return s.String()
}
+// SetAvailabilityZoneId sets the AvailabilityZoneId field's value.
+func (s *IpamDiscoveredResourceCidr) SetAvailabilityZoneId(v string) *IpamDiscoveredResourceCidr {
+ s.AvailabilityZoneId = &v
+ return s
+}
+
// SetIpUsage sets the IpUsage field's value.
func (s *IpamDiscoveredResourceCidr) SetIpUsage(v float64) *IpamDiscoveredResourceCidr {
s.IpUsage = &v
@@ -139193,6 +141648,12 @@ func (s *IpamDiscoveredResourceCidr) SetIpamResourceDiscoveryId(v string) *IpamD
return s
}
+// SetNetworkInterfaceAttachmentStatus sets the NetworkInterfaceAttachmentStatus field's value.
+func (s *IpamDiscoveredResourceCidr) SetNetworkInterfaceAttachmentStatus(v string) *IpamDiscoveredResourceCidr {
+ s.NetworkInterfaceAttachmentStatus = &v
+ return s
+}
+
// SetResourceCidr sets the ResourceCidr field's value.
func (s *IpamDiscoveredResourceCidr) SetResourceCidr(v string) *IpamDiscoveredResourceCidr {
s.ResourceCidr = &v
@@ -139296,6 +141757,131 @@ func (s *IpamDiscoveryFailureReason) SetMessage(v string) *IpamDiscoveryFailureR
return s
}
+// A verification token is an Amazon Web Services-generated random value that
+// you can use to prove ownership of an external resource. For example, you
+// can use a verification token to validate that you control a public IP address
+// range when you bring an IP address range to Amazon Web Services (BYOIP).
+type IpamExternalResourceVerificationToken struct {
+ _ struct{} `type:"structure"`
+
+ // ARN of the IPAM that created the token.
+ IpamArn *string `locationName:"ipamArn" min:"1" type:"string"`
+
+ // Token ARN.
+ IpamExternalResourceVerificationTokenArn *string `locationName:"ipamExternalResourceVerificationTokenArn" min:"1" type:"string"`
+
+ // The ID of the token.
+ IpamExternalResourceVerificationTokenId *string `locationName:"ipamExternalResourceVerificationTokenId" type:"string"`
+
+ // The ID of the IPAM that created the token.
+ IpamId *string `locationName:"ipamId" type:"string"`
+
+ // Region of the IPAM that created the token.
+ IpamRegion *string `locationName:"ipamRegion" type:"string"`
+
+ // Token expiration.
+ NotAfter *time.Time `locationName:"notAfter" type:"timestamp"`
+
+ // Token state.
+ State *string `locationName:"state" type:"string" enum:"IpamExternalResourceVerificationTokenState"`
+
+ // Token status.
+ Status *string `locationName:"status" type:"string" enum:"TokenState"`
+
+ // Token tags.
+ Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"`
+
+ // Token name.
+ TokenName *string `locationName:"tokenName" type:"string"`
+
+ // Token value.
+ TokenValue *string `locationName:"tokenValue" type:"string"`
+}
+
+// String returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s IpamExternalResourceVerificationToken) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s IpamExternalResourceVerificationToken) GoString() string {
+ return s.String()
+}
+
+// SetIpamArn sets the IpamArn field's value.
+func (s *IpamExternalResourceVerificationToken) SetIpamArn(v string) *IpamExternalResourceVerificationToken {
+ s.IpamArn = &v
+ return s
+}
+
+// SetIpamExternalResourceVerificationTokenArn sets the IpamExternalResourceVerificationTokenArn field's value.
+func (s *IpamExternalResourceVerificationToken) SetIpamExternalResourceVerificationTokenArn(v string) *IpamExternalResourceVerificationToken {
+ s.IpamExternalResourceVerificationTokenArn = &v
+ return s
+}
+
+// SetIpamExternalResourceVerificationTokenId sets the IpamExternalResourceVerificationTokenId field's value.
+func (s *IpamExternalResourceVerificationToken) SetIpamExternalResourceVerificationTokenId(v string) *IpamExternalResourceVerificationToken {
+ s.IpamExternalResourceVerificationTokenId = &v
+ return s
+}
+
+// SetIpamId sets the IpamId field's value.
+func (s *IpamExternalResourceVerificationToken) SetIpamId(v string) *IpamExternalResourceVerificationToken {
+ s.IpamId = &v
+ return s
+}
+
+// SetIpamRegion sets the IpamRegion field's value.
+func (s *IpamExternalResourceVerificationToken) SetIpamRegion(v string) *IpamExternalResourceVerificationToken {
+ s.IpamRegion = &v
+ return s
+}
+
+// SetNotAfter sets the NotAfter field's value.
+func (s *IpamExternalResourceVerificationToken) SetNotAfter(v time.Time) *IpamExternalResourceVerificationToken {
+ s.NotAfter = &v
+ return s
+}
+
+// SetState sets the State field's value.
+func (s *IpamExternalResourceVerificationToken) SetState(v string) *IpamExternalResourceVerificationToken {
+ s.State = &v
+ return s
+}
+
+// SetStatus sets the Status field's value.
+func (s *IpamExternalResourceVerificationToken) SetStatus(v string) *IpamExternalResourceVerificationToken {
+ s.Status = &v
+ return s
+}
+
+// SetTags sets the Tags field's value.
+func (s *IpamExternalResourceVerificationToken) SetTags(v []*Tag) *IpamExternalResourceVerificationToken {
+ s.Tags = v
+ return s
+}
+
+// SetTokenName sets the TokenName field's value.
+func (s *IpamExternalResourceVerificationToken) SetTokenName(v string) *IpamExternalResourceVerificationToken {
+ s.TokenName = &v
+ return s
+}
+
+// SetTokenValue sets the TokenValue field's value.
+func (s *IpamExternalResourceVerificationToken) SetTokenValue(v string) *IpamExternalResourceVerificationToken {
+ s.TokenValue = &v
+ return s
+}
+
// The operating Regions for an IPAM. Operating Regions are Amazon Web Services
// Regions where the IPAM is allowed to manage IP address CIDRs. IPAM only discovers
// and monitors resources in the Amazon Web Services Regions you select as operating
@@ -139412,14 +141998,20 @@ type IpamPool struct {
// overlap or conflict.
IpamScopeType *string `locationName:"ipamScopeType" type:"string" enum:"IpamScopeType"`
- // The locale of the IPAM pool. In IPAM, the locale is the Amazon Web Services
- // Region where you want to make an IPAM pool available for allocations. Only
- // resources in the same Region as the locale of the pool can get IP address
- // allocations from the pool. You can only allocate a CIDR for a VPC, for example,
- // from an IPAM pool that shares a locale with the VPC’s Region. Note that
- // once you choose a Locale for a pool, you cannot modify it. If you choose
- // an Amazon Web Services Region for locale that has not been configured as
- // an operating Region for the IPAM, you'll get an error.
+ // The locale of the IPAM pool.
+ //
+ // The locale for the pool should be one of the following:
+ //
+ // * An Amazon Web Services Region where you want this IPAM pool to be available
+ // for allocations.
+ //
+ // * The network border group for an Amazon Web Services Local Zone where
+ // you want this IPAM pool to be available for allocations (supported Local
+ // Zones (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html#byoip-zone-avail)).
+ // This option is only available for IPAM IPv4 pools in the public scope.
+ //
+ // If you choose an Amazon Web Services Region for locale that has not been
+ // configured as an operating Region for the IPAM, you'll get an error.
Locale *string `locationName:"locale" type:"string"`
// The Amazon Web Services account ID of the owner of the IPAM pool.
@@ -140066,6 +142658,9 @@ func (s *IpamPublicAddressTags) SetEipTags(v []*IpamPublicAddressTag) *IpamPubli
type IpamResourceCidr struct {
_ struct{} `type:"structure"`
+ // The Availability Zone ID.
+ AvailabilityZoneId *string `locationName:"availabilityZoneId" type:"string"`
+
// The compliance status of the IPAM resource. For more information on compliance
// statuses, see Monitor CIDR usage by resource (https://docs.aws.amazon.com/vpc/latest/ipam/monitor-cidr-compliance-ipam.html)
// in the Amazon VPC IPAM User Guide.
@@ -140151,6 +142746,12 @@ func (s IpamResourceCidr) GoString() string {
return s.String()
}
+// SetAvailabilityZoneId sets the AvailabilityZoneId field's value.
+func (s *IpamResourceCidr) SetAvailabilityZoneId(v string) *IpamResourceCidr {
+ s.AvailabilityZoneId = &v
+ return s
+}
+
// SetComplianceStatus sets the ComplianceStatus field's value.
func (s *IpamResourceCidr) SetComplianceStatus(v string) *IpamResourceCidr {
s.ComplianceStatus = &v
@@ -140718,9 +143319,9 @@ func (s *IpamScope) SetTags(v []*Tag) *IpamScope {
type Ipv4PrefixSpecification struct {
_ struct{} `type:"structure"`
- // The IPv4 prefix. For information, see Assigning prefixes to Amazon EC2 network
- // interfaces (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-prefix-eni.html)
- // in the Amazon Elastic Compute Cloud User Guide.
+ // The IPv4 prefix. For information, see Assigning prefixes to network interfaces
+ // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-prefix-eni.html)
+ // in the Amazon EC2 User Guide.
Ipv4Prefix *string `locationName:"ipv4Prefix" type:"string"`
}
@@ -140752,9 +143353,9 @@ func (s *Ipv4PrefixSpecification) SetIpv4Prefix(v string) *Ipv4PrefixSpecificati
type Ipv4PrefixSpecificationRequest struct {
_ struct{} `type:"structure"`
- // The IPv4 prefix. For information, see Assigning prefixes to Amazon EC2 network
- // interfaces (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-prefix-eni.html)
- // in the Amazon Elastic Compute Cloud User Guide.
+ // The IPv4 prefix. For information, see Assigning prefixes to network interfaces
+ // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-prefix-eni.html)
+ // in the Amazon EC2 User Guide.
Ipv4Prefix *string `type:"string"`
}
@@ -141042,11 +143643,11 @@ func (s *Ipv6PrefixSpecificationResponse) SetIpv6Prefix(v string) *Ipv6PrefixSpe
return s
}
-// Describes an IPv6 range.
+// Describes an IPv6 address range.
type Ipv6Range struct {
_ struct{} `type:"structure"`
- // The IPv6 CIDR range. You can either specify a CIDR range or a source security
+ // The IPv6 address range. You can either specify a CIDR block or a source security
// group, not both. To specify a single IPv6 address, use the /128 prefix length.
CidrIpv6 *string `locationName:"cidrIpv6" type:"string"`
@@ -142180,8 +144781,8 @@ type LaunchTemplateEbsBlockDeviceRequest struct {
// * standard: 1 - 1024 GiB
VolumeSize *int64 `type:"integer"`
- // The volume type. For more information, see Amazon EBS volume types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html)
- // in the Amazon Elastic Compute Cloud User Guide.
+ // The volume type. For more information, see Amazon EBS volume types (https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volume-types.html)
+ // in the Amazon EBS User Guide.
VolumeType *string `type:"string" enum:"VolumeType"`
}
@@ -142815,7 +145416,7 @@ func (s *LaunchTemplateInstanceMarketOptionsRequest) SetSpotOptions(v *LaunchTem
// The metadata options for the instance. For more information, see Instance
// metadata and user data (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// in the Amazon EC2 User Guide.
type LaunchTemplateInstanceMetadataOptions struct {
_ struct{} `type:"structure"`
@@ -142926,7 +145527,7 @@ func (s *LaunchTemplateInstanceMetadataOptions) SetState(v string) *LaunchTempla
// The metadata options for the instance. For more information, see Instance
// metadata and user data (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// in the Amazon EC2 User Guide.
type LaunchTemplateInstanceMetadataOptionsRequest struct {
_ struct{} `type:"structure"`
@@ -143040,16 +145641,16 @@ type LaunchTemplateInstanceNetworkInterfaceSpecification struct {
// Indicates whether to associate a public IPv4 address with eth0 for a new
// network interface.
//
- // Starting on February 1, 2024, Amazon Web Services will charge for all public
- // IPv4 addresses, including public IPv4 addresses associated with running instances
- // and Elastic IP addresses. For more information, see the Public IPv4 Address
- // tab on the Amazon VPC pricing page (http://aws.amazon.com/vpc/pricing/).
+ // Amazon Web Services charges for all public IPv4 addresses, including public
+ // IPv4 addresses associated with running instances and Elastic IP addresses.
+ // For more information, see the Public IPv4 Address tab on the Amazon VPC pricing
+ // page (http://aws.amazon.com/vpc/pricing/).
AssociatePublicIpAddress *bool `locationName:"associatePublicIpAddress" type:"boolean"`
// A security group connection tracking specification that enables you to set
// the timeout for connection tracking on an Elastic network interface. For
- // more information, see Connection tracking timeouts (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-connection-tracking.html#connection-tracking-timeouts)
- // in the Amazon Elastic Compute Cloud User Guide.
+ // more information, see Idle connection tracking timeout (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-connection-tracking.html#connection-tracking-timeouts)
+ // in the Amazon EC2 User Guide.
ConnectionTrackingSpecification *ConnectionTrackingSpecification `locationName:"connectionTrackingSpecification" type:"structure"`
// Indicates whether the network interface is deleted when the instance is terminated.
@@ -143281,16 +145882,16 @@ type LaunchTemplateInstanceNetworkInterfaceSpecificationRequest struct {
// Associates a public IPv4 address with eth0 for a new network interface.
//
- // Starting on February 1, 2024, Amazon Web Services will charge for all public
- // IPv4 addresses, including public IPv4 addresses associated with running instances
- // and Elastic IP addresses. For more information, see the Public IPv4 Address
- // tab on the Amazon VPC pricing page (http://aws.amazon.com/vpc/pricing/).
+ // Amazon Web Services charges for all public IPv4 addresses, including public
+ // IPv4 addresses associated with running instances and Elastic IP addresses.
+ // For more information, see the Public IPv4 Address tab on the Amazon VPC pricing
+ // page (http://aws.amazon.com/vpc/pricing/).
AssociatePublicIpAddress *bool `type:"boolean"`
// A security group connection tracking specification that enables you to set
// the timeout for connection tracking on an Elastic network interface. For
- // more information, see Connection tracking timeouts (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-connection-tracking.html#connection-tracking-timeouts)
- // in the Amazon Elastic Compute Cloud User Guide.
+ // more information, see Idle connection tracking timeout (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-connection-tracking.html#connection-tracking-timeouts)
+ // in the Amazon EC2 User Guide.
ConnectionTrackingSpecification *ConnectionTrackingSpecificationRequest `type:"structure"`
// Indicates whether the network interface is deleted when the instance is terminated.
@@ -143299,7 +145900,11 @@ type LaunchTemplateInstanceNetworkInterfaceSpecificationRequest struct {
// A description for the network interface.
Description *string `type:"string"`
- // The device index for the network interface attachment.
+ // The device index for the network interface attachment. Each network interface
+ // requires a device index. If you create a launch template that includes secondary
+ // network interfaces but not a primary network interface, then you must add
+ // a primary network interface as a launch parameter when you launch an instance
+ // from the template.
DeviceIndex *int64 `type:"integer"`
// Configure ENA Express settings for your launch template.
@@ -143310,7 +145915,7 @@ type LaunchTemplateInstanceNetworkInterfaceSpecificationRequest struct {
// The type of network interface. To create an Elastic Fabric Adapter (EFA),
// specify efa. For more information, see Elastic Fabric Adapter (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/efa.html)
- // in the Amazon Elastic Compute Cloud User Guide.
+ // in the Amazon EC2 User Guide.
//
// If you are not creating an EFA, specify interface or omit this parameter.
//
@@ -143631,7 +146236,19 @@ type LaunchTemplateOverrides struct {
// The ID of the subnet in which to launch the instances.
SubnetId *string `locationName:"subnetId" type:"string"`
- // The number of units provided by the specified instance type.
+ // The number of units provided by the specified instance type. These are the
+ // same units that you chose to set the target capacity in terms of instances,
+ // or a performance characteristic such as vCPUs, memory, or I/O.
+ //
+ // If the target capacity divided by this value is not a whole number, Amazon
+ // EC2 rounds the number of instances to the next whole number. If this value
+ // is not specified, the default is 1.
+ //
+ // When specifying weights, the price used in the lowestPrice and priceCapacityOptimized
+ // allocation strategies is per unit hour (where the instance price is divided
+ // by the specified weight). However, if all the specified weights are above
+ // the requested TargetCapacity, resulting in only 1 instance being launched,
+ // the price used is per instance hour.
WeightedCapacity *float64 `locationName:"weightedCapacity" type:"double"`
}
@@ -144019,30 +146636,27 @@ func (s *LaunchTemplatePrivateDnsNameOptionsRequest) SetHostnameType(v string) *
return s
}
-// The launch template to use. You must specify either the launch template ID
-// or launch template name in the request, but not both.
+// Describes the launch template to use.
type LaunchTemplateSpecification struct {
_ struct{} `type:"structure"`
// The ID of the launch template.
//
- // You must specify the LaunchTemplateId or the LaunchTemplateName, but not
- // both.
+ // You must specify either the launch template ID or the launch template name,
+ // but not both.
LaunchTemplateId *string `type:"string"`
// The name of the launch template.
//
- // You must specify the LaunchTemplateName or the LaunchTemplateId, but not
- // both.
+ // You must specify either the launch template ID or the launch template name,
+ // but not both.
LaunchTemplateName *string `type:"string"`
// The launch template version number, $Latest, or $Default.
//
- // If the value is $Latest, Amazon EC2 uses the latest version of the launch
- // template.
+ // A value of $Latest uses the latest version of the launch template.
//
- // If the value is $Default, Amazon EC2 uses the default version of the launch
- // template.
+ // A value of $Default uses the default version of the launch template.
//
// Default: The default version of the launch template.
Version *string `type:"string"`
@@ -144295,10 +146909,9 @@ type LaunchTemplateTagSpecificationRequest struct {
//
// Valid Values lists all resource types for Amazon EC2 that can be tagged.
// When you create a launch template, you can specify tags for the following
- // resource types only: instance | volume | elastic-gpu | network-interface
- // | spot-instances-request. If the instance does not include the resource type
- // that you specify, the instance launch fails. For example, not all instance
- // types include an Elastic GPU.
+ // resource types only: instance | volume | network-interface | spot-instances-request.
+ // If the instance does not include the resource type that you specify, the
+ // instance launch fails. For example, not all instance types include a volume.
//
// To tag a resource after it has been created, see CreateTags (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html).
ResourceType *string `type:"string" enum:"ResourceType"`
@@ -146032,6 +148645,48 @@ func (s *LockedSnapshotsInfo) SetSnapshotId(v string) *LockedSnapshotsInfo {
return s
}
+// Information about the EC2 Mac Dedicated Host.
+type MacHost struct {
+ _ struct{} `type:"structure"`
+
+ // The EC2 Mac Dedicated Host ID.
+ HostId *string `locationName:"hostId" type:"string"`
+
+ // The latest macOS versions that the EC2 Mac Dedicated Host can launch without
+ // being upgraded.
+ MacOSLatestSupportedVersions []*string `locationName:"macOSLatestSupportedVersionSet" locationNameList:"item" type:"list"`
+}
+
+// String returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s MacHost) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s MacHost) GoString() string {
+ return s.String()
+}
+
+// SetHostId sets the HostId field's value.
+func (s *MacHost) SetHostId(v string) *MacHost {
+ s.HostId = &v
+ return s
+}
+
+// SetMacOSLatestSupportedVersions sets the MacOSLatestSupportedVersions field's value.
+func (s *MacHost) SetMacOSLatestSupportedVersions(v []*string) *MacHost {
+ s.MacOSLatestSupportedVersions = v
+ return s
+}
+
// Details for Site-to-Site VPN tunnel endpoint maintenance events.
type MaintenanceDetails struct {
_ struct{} `type:"structure"`
@@ -146195,6 +148850,139 @@ func (s *ManagedPrefixList) SetVersion(v int64) *ManagedPrefixList {
return s
}
+// Describes the media accelerators for the instance type.
+type MediaAcceleratorInfo struct {
+ _ struct{} `type:"structure"`
+
+ // Describes the media accelerators for the instance type.
+ Accelerators []*MediaDeviceInfo `locationName:"accelerators" locationNameList:"item" type:"list"`
+
+ // The total size of the memory for the media accelerators for the instance
+ // type, in MiB.
+ TotalMediaMemoryInMiB *int64 `locationName:"totalMediaMemoryInMiB" type:"integer"`
+}
+
+// String returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s MediaAcceleratorInfo) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s MediaAcceleratorInfo) GoString() string {
+ return s.String()
+}
+
+// SetAccelerators sets the Accelerators field's value.
+func (s *MediaAcceleratorInfo) SetAccelerators(v []*MediaDeviceInfo) *MediaAcceleratorInfo {
+ s.Accelerators = v
+ return s
+}
+
+// SetTotalMediaMemoryInMiB sets the TotalMediaMemoryInMiB field's value.
+func (s *MediaAcceleratorInfo) SetTotalMediaMemoryInMiB(v int64) *MediaAcceleratorInfo {
+ s.TotalMediaMemoryInMiB = &v
+ return s
+}
+
+// Describes the media accelerators for the instance type.
+type MediaDeviceInfo struct {
+ _ struct{} `type:"structure"`
+
+ // The number of media accelerators for the instance type.
+ Count *int64 `locationName:"count" type:"integer"`
+
+ // The manufacturer of the media accelerator.
+ Manufacturer *string `locationName:"manufacturer" type:"string"`
+
+ // Describes the memory available to the media accelerator.
+ MemoryInfo *MediaDeviceMemoryInfo `locationName:"memoryInfo" type:"structure"`
+
+ // The name of the media accelerator.
+ Name *string `locationName:"name" type:"string"`
+}
+
+// String returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s MediaDeviceInfo) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s MediaDeviceInfo) GoString() string {
+ return s.String()
+}
+
+// SetCount sets the Count field's value.
+func (s *MediaDeviceInfo) SetCount(v int64) *MediaDeviceInfo {
+ s.Count = &v
+ return s
+}
+
+// SetManufacturer sets the Manufacturer field's value.
+func (s *MediaDeviceInfo) SetManufacturer(v string) *MediaDeviceInfo {
+ s.Manufacturer = &v
+ return s
+}
+
+// SetMemoryInfo sets the MemoryInfo field's value.
+func (s *MediaDeviceInfo) SetMemoryInfo(v *MediaDeviceMemoryInfo) *MediaDeviceInfo {
+ s.MemoryInfo = v
+ return s
+}
+
+// SetName sets the Name field's value.
+func (s *MediaDeviceInfo) SetName(v string) *MediaDeviceInfo {
+ s.Name = &v
+ return s
+}
+
+// Describes the memory available to the media accelerator.
+type MediaDeviceMemoryInfo struct {
+ _ struct{} `type:"structure"`
+
+ // The size of the memory available to each media accelerator, in MiB.
+ SizeInMiB *int64 `locationName:"sizeInMiB" type:"integer"`
+}
+
+// String returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s MediaDeviceMemoryInfo) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s MediaDeviceMemoryInfo) GoString() string {
+ return s.String()
+}
+
+// SetSizeInMiB sets the SizeInMiB field's value.
+func (s *MediaDeviceMemoryInfo) SetSizeInMiB(v int64) *MediaDeviceMemoryInfo {
+ s.SizeInMiB = &v
+ return s
+}
+
// The minimum and maximum amount of memory per vCPU, in GiB.
type MemoryGiBPerVCpu struct {
_ struct{} `type:"structure"`
@@ -146590,10 +149378,9 @@ type ModifyAvailabilityZoneGroupInput struct {
// GroupName is a required field
GroupName *string `type:"string" required:"true"`
- // Indicates whether you are opted in to the Local Zone group or Wavelength
- // Zone group. The only valid value is opted-in. You must contact Amazon Web
- // Services Support (https://console.aws.amazon.com/support/home#/case/create%3FissueType=customer-service%26serviceCode=general-info%26getting-started%26categoryCode=using-aws%26services)
- // to opt out of a Local Zone or Wavelength Zone group.
+ // Indicates whether to opt in to the zone group. The only valid value is opted-in.
+ // You must contact Amazon Web Services Support to opt out of a Local Zone or
+ // Wavelength Zone group.
//
// OptInStatus is a required field
OptInStatus *string `type:"string" required:"true" enum:"ModifyAvailabilityZoneOptInStatus"`
@@ -147306,9 +150093,9 @@ type ModifyEbsDefaultKmsKeyIdInput struct {
// it is UnauthorizedOperation.
DryRun *bool `type:"boolean"`
- // The identifier of the Key Management Service (KMS) KMS key to use for Amazon
- // EBS encryption. If this parameter is not specified, your KMS key for Amazon
- // EBS is used. If KmsKeyId is specified, the encrypted state must be true.
+ // The identifier of the KMS key to use for Amazon EBS encryption. If this parameter
+ // is not specified, your KMS key for Amazon EBS is used. If KmsKeyId is specified,
+ // the encrypted state must be true.
//
// You can specify the KMS key using any of the following:
//
@@ -148280,7 +151067,7 @@ type ModifyInstanceAttributeInput struct {
BlockDeviceMappings []*InstanceBlockDeviceMappingSpecification `locationName:"blockDeviceMapping" locationNameList:"item" type:"list"`
// Indicates whether an instance is enabled for stop protection. For more information,
- // see Stop Protection (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html#Using_StopProtection).
+ // see Enable stop protection for your instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-stop-protection.html).
DisableApiStop *AttributeBooleanValue `type:"structure"`
// If the value is true, you can't terminate the instance using the Amazon EC2
@@ -148355,10 +151142,10 @@ type ModifyInstanceAttributeInput struct {
// a PV instance can make it unreachable.
SriovNetSupport *AttributeValue `locationName:"sriovNetSupport" type:"structure"`
- // Changes the instance's user data to the specified value. If you are using
- // an Amazon Web Services SDK or command line tool, base64-encoding is performed
- // for you, and you can load the text from a file. Otherwise, you must provide
- // base64-encoded text.
+ // Changes the instance's user data to the specified value. User data must be
+ // base64-encoded. Depending on the tool or SDK that you're using, the base64-encoding
+ // might be performed for you. For more information, see Work with instance
+ // user data (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-add-user-data.html).
UserData *BlobAttributeValue `locationName:"userData" type:"structure"`
// A new value for the attribute. Use only with the kernel, ramdisk, userData,
@@ -149105,6 +151892,121 @@ func (s *ModifyInstanceMaintenanceOptionsOutput) SetInstanceId(v string) *Modify
return s
}
+type ModifyInstanceMetadataDefaultsInput struct {
+ _ struct{} `type:"structure"`
+
+ // Checks whether you have the required permissions for the action, without
+ // actually making the request, and provides an error response. If you have
+ // the required permissions, the error response is DryRunOperation. Otherwise,
+ // it is UnauthorizedOperation.
+ DryRun *bool `type:"boolean"`
+
+ // Enables or disables the IMDS endpoint on an instance. When disabled, the
+ // instance metadata can't be accessed.
+ HttpEndpoint *string `type:"string" enum:"DefaultInstanceMetadataEndpointState"`
+
+ // The maximum number of hops that the metadata token can travel. To indicate
+ // no preference, specify -1.
+ //
+ // Possible values: Integers from 1 to 64, and -1 to indicate no preference
+ HttpPutResponseHopLimit *int64 `type:"integer"`
+
+ // Indicates whether IMDSv2 is required.
+ //
+ // * optional – IMDSv2 is optional, which means that you can use either
+ // IMDSv2 or IMDSv1.
+ //
+ // * required – IMDSv2 is required, which means that IMDSv1 is disabled,
+ // and you must use IMDSv2.
+ HttpTokens *string `type:"string" enum:"MetadataDefaultHttpTokensState"`
+
+ // Enables or disables access to an instance's tags from the instance metadata.
+ // For more information, see Work with instance tags using the instance metadata
+ // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#work-with-tags-in-IMDS)
+ // in the Amazon EC2 User Guide.
+ InstanceMetadataTags *string `type:"string" enum:"DefaultInstanceMetadataTagsState"`
+}
+
+// String returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s ModifyInstanceMetadataDefaultsInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s ModifyInstanceMetadataDefaultsInput) GoString() string {
+ return s.String()
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *ModifyInstanceMetadataDefaultsInput) SetDryRun(v bool) *ModifyInstanceMetadataDefaultsInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetHttpEndpoint sets the HttpEndpoint field's value.
+func (s *ModifyInstanceMetadataDefaultsInput) SetHttpEndpoint(v string) *ModifyInstanceMetadataDefaultsInput {
+ s.HttpEndpoint = &v
+ return s
+}
+
+// SetHttpPutResponseHopLimit sets the HttpPutResponseHopLimit field's value.
+func (s *ModifyInstanceMetadataDefaultsInput) SetHttpPutResponseHopLimit(v int64) *ModifyInstanceMetadataDefaultsInput {
+ s.HttpPutResponseHopLimit = &v
+ return s
+}
+
+// SetHttpTokens sets the HttpTokens field's value.
+func (s *ModifyInstanceMetadataDefaultsInput) SetHttpTokens(v string) *ModifyInstanceMetadataDefaultsInput {
+ s.HttpTokens = &v
+ return s
+}
+
+// SetInstanceMetadataTags sets the InstanceMetadataTags field's value.
+func (s *ModifyInstanceMetadataDefaultsInput) SetInstanceMetadataTags(v string) *ModifyInstanceMetadataDefaultsInput {
+ s.InstanceMetadataTags = &v
+ return s
+}
+
+type ModifyInstanceMetadataDefaultsOutput struct {
+ _ struct{} `type:"structure"`
+
+ // If the request succeeds, the response returns true. If the request fails,
+ // no response is returned, and instead an error message is returned.
+ Return *bool `locationName:"return" type:"boolean"`
+}
+
+// String returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s ModifyInstanceMetadataDefaultsOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s ModifyInstanceMetadataDefaultsOutput) GoString() string {
+ return s.String()
+}
+
+// SetReturn sets the Return field's value.
+func (s *ModifyInstanceMetadataDefaultsOutput) SetReturn(v bool) *ModifyInstanceMetadataDefaultsOutput {
+ s.Return = &v
+ return s
+}
+
type ModifyInstanceMetadataOptionsInput struct {
_ struct{} `type:"structure"`
@@ -149144,8 +152046,20 @@ type ModifyInstanceMetadataOptionsInput struct {
// IAM role credentials always returns IMDSv2 credentials; IMDSv1 credentials
// are not available.
//
- // Default: If the value of ImdsSupport for the Amazon Machine Image (AMI) for
- // your instance is v2.0, the default is required.
+ // Default:
+ //
+ // * If the value of ImdsSupport for the Amazon Machine Image (AMI) for your
+ // instance is v2.0 and the account level default is set to no-preference,
+ // the default is required.
+ //
+ // * If the value of ImdsSupport for the Amazon Machine Image (AMI) for your
+ // instance is v2.0, but the account level default is set to V1 or V2, the
+ // default is optional.
+ //
+ // The default value can also be affected by other combinations of parameters.
+ // For more information, see Order of precedence for instance metadata options
+ // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-options.html#instance-metadata-options-order-of-precedence)
+ // in the Amazon EC2 User Guide.
HttpTokens *string `type:"string" enum:"HttpTokensState"`
// The ID of the instance.
@@ -149157,8 +152071,6 @@ type ModifyInstanceMetadataOptionsInput struct {
// Set to disabled to turn off access to instance tags from the instance metadata.
// For more information, see Work with instance tags using the instance metadata
// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#work-with-tags-in-IMDS).
- //
- // Default: disabled
InstanceMetadataTags *string `type:"string" enum:"InstanceMetadataTagsState"`
}
@@ -149278,7 +152190,9 @@ func (s *ModifyInstanceMetadataOptionsOutput) SetInstanceMetadataOptions(v *Inst
type ModifyInstancePlacementInput struct {
_ struct{} `type:"structure"`
- // The affinity setting for the instance.
+ // The affinity setting for the instance. For more information, see Host affinity
+ // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/how-dedicated-hosts-work.html#dedicated-hosts-affinity)
+ // in the Amazon EC2 User Guide.
Affinity *string `locationName:"affinity" type:"string" enum:"Affinity"`
// The Group Id of a placement group. You must specify the Placement Group Group
@@ -150135,14 +153049,14 @@ type ModifyLaunchTemplateInput struct {
// The ID of the launch template.
//
- // You must specify either the LaunchTemplateId or the LaunchTemplateName, but
- // not both.
+ // You must specify either the launch template ID or the launch template name,
+ // but not both.
LaunchTemplateId *string `type:"string"`
// The name of the launch template.
//
- // You must specify either the LaunchTemplateName or the LaunchTemplateId, but
- // not both.
+ // You must specify either the launch template ID or the launch template name,
+ // but not both.
LaunchTemplateName *string `min:"3" type:"string"`
}
@@ -150530,6 +153444,11 @@ func (s *ModifyManagedPrefixListOutput) SetPrefixList(v *ManagedPrefixList) *Mod
type ModifyNetworkInterfaceAttributeInput struct {
_ struct{} `type:"structure"`
+ // Indicates whether to assign a public IPv4 address to a network interface.
+ // This option can be enabled for any network interface but will only apply
+ // to the primary network interface (eth0).
+ AssociatePublicIpAddress *bool `type:"boolean"`
+
// Information about the interface attachment. If modifying the delete on termination
// attribute, you must specify the ID of the interface attachment.
Attachment *NetworkInterfaceAttachmentChanges `locationName:"attachment" type:"structure"`
@@ -150616,6 +153535,12 @@ func (s *ModifyNetworkInterfaceAttributeInput) Validate() error {
return nil
}
+// SetAssociatePublicIpAddress sets the AssociatePublicIpAddress field's value.
+func (s *ModifyNetworkInterfaceAttributeInput) SetAssociatePublicIpAddress(v bool) *ModifyNetworkInterfaceAttributeInput {
+ s.AssociatePublicIpAddress = &v
+ return s
+}
+
// SetAttachment sets the Attachment field's value.
func (s *ModifyNetworkInterfaceAttributeInput) SetAttachment(v *NetworkInterfaceAttachmentChanges) *ModifyNetworkInterfaceAttributeInput {
s.Attachment = v
@@ -151454,6 +154379,11 @@ type ModifySubnetAttributeInput struct {
// Specify true to indicate that network interfaces attached to instances created
// in the specified subnet should be assigned a public IPv4 address.
+ //
+ // Amazon Web Services charges for all public IPv4 addresses, including public
+ // IPv4 addresses associated with running instances and Elastic IP addresses.
+ // For more information, see the Public IPv4 Address tab on the Amazon VPC pricing
+ // page (http://aws.amazon.com/vpc/pricing/).
MapPublicIpOnLaunch *AttributeBooleanValue `type:"structure"`
// The type of hostname to assign to instances in the subnet at launch. For
@@ -151851,7 +154781,10 @@ func (s *ModifyTrafficMirrorFilterRuleInput) SetTrafficMirrorFilterRuleId(v stri
type ModifyTrafficMirrorFilterRuleOutput struct {
_ struct{} `type:"structure"`
- // Modifies a Traffic Mirror rule.
+ //
+ // Tags are not returned for ModifyTrafficMirrorFilterRule.
+ //
+ // A Traffic Mirror rule.
TrafficMirrorFilterRule *TrafficMirrorFilterRule `locationName:"trafficMirrorFilterRule" type:"structure"`
}
@@ -152163,18 +155096,16 @@ type ModifyTransitGatewayOptions struct {
// Removes CIDR blocks for the transit gateway.
RemoveTransitGatewayCidrBlocks []*string `locationNameList:"item" type:"list"`
+ //
+ // This parameter is in preview and may not be available for your account.
+ //
// Enables you to reference a security group across VPCs attached to a transit
- // gateway (TGW). Use this option to simplify security group management and
- // control of instance-to-instance traffic across VPCs that are connected by
- // transit gateway. You can also use this option to migrate from VPC peering
- // (which was the only option that supported security group referencing) to
- // transit gateways (which now also support security group referencing). This
- // option is disabled by default and there are no additional costs to use this
- // feature.
- //
- // For important information about this feature, see Create a transit gateway
- // (https://docs.aws.amazon.com/vpc/latest/tgw/tgw-transit-gateways.html#create-tgw)
- // in the Amazon Web Services Transit Gateway Guide.
+ // gateway. Use this option to simplify security group management and control
+ // of instance-to-instance traffic across VPCs that are connected by transit
+ // gateway. You can also use this option to migrate from VPC peering (which
+ // was the only option that supported security group referencing) to transit
+ // gateways (which now also support security group referencing). This option
+ // is disabled by default and there are no additional costs to use this feature.
SecurityGroupReferencingSupport *string `type:"string" enum:"SecurityGroupReferencingSupportValue"`
// Enable or disable Equal Cost Multipath Protocol support.
@@ -152549,18 +155480,16 @@ type ModifyTransitGatewayVpcAttachmentRequestOptions struct {
// Enable or disable IPv6 support. The default is enable.
Ipv6Support *string `type:"string" enum:"Ipv6SupportValue"`
+ //
+ // This parameter is in preview and may not be available for your account.
+ //
// Enables you to reference a security group across VPCs attached to a transit
- // gateway (TGW). Use this option to simplify security group management and
- // control of instance-to-instance traffic across VPCs that are connected by
- // transit gateway. You can also use this option to migrate from VPC peering
- // (which was the only option that supported security group referencing) to
- // transit gateways (which now also support security group referencing). This
- // option is disabled by default and there are no additional costs to use this
- // feature.
- //
- // For important information about this feature, see Create a transit gateway
- // attachment to a VPC (https://docs.aws.amazon.com/vpc/latest/tgw/tgw-vpc-attachments.html#create-vpc-attachment)
- // in the Amazon Web Services Transit Gateway Guide.
+ // gateway. Use this option to simplify security group management and control
+ // of instance-to-instance traffic across VPCs that are connected by transit
+ // gateway. You can also use this option to migrate from VPC peering (which
+ // was the only option that supported security group referencing) to transit
+ // gateways (which now also support security group referencing). This option
+ // is disabled by default and there are no additional costs to use this feature.
SecurityGroupReferencingSupport *string `type:"string" enum:"SecurityGroupReferencingSupportValue"`
}
@@ -152665,8 +155594,8 @@ type ModifyVerifiedAccessEndpointInput struct {
_ struct{} `type:"structure"`
// A unique, case-sensitive token that you provide to ensure idempotency of
- // your modification request. For more information, see Ensuring Idempotency
- // (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // your modification request. For more information, see Ensuring idempotency
+ // (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// A description for the Verified Access endpoint.
@@ -152875,8 +155804,8 @@ type ModifyVerifiedAccessEndpointPolicyInput struct {
_ struct{} `type:"structure"`
// A unique, case-sensitive token that you provide to ensure idempotency of
- // your modification request. For more information, see Ensuring Idempotency
- // (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // your modification request. For more information, see Ensuring idempotency
+ // (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// Checks whether you have the required permissions for the action, without
@@ -153020,8 +155949,8 @@ type ModifyVerifiedAccessGroupInput struct {
_ struct{} `type:"structure"`
// A unique, case-sensitive token that you provide to ensure idempotency of
- // your modification request. For more information, see Ensuring Idempotency
- // (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // your modification request. For more information, see Ensuring idempotency
+ // (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// A description for the Verified Access group.
@@ -153138,8 +156067,8 @@ type ModifyVerifiedAccessGroupPolicyInput struct {
_ struct{} `type:"structure"`
// A unique, case-sensitive token that you provide to ensure idempotency of
- // your modification request. For more information, see Ensuring Idempotency
- // (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // your modification request. For more information, see Ensuring idempotency
+ // (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// Checks whether you have the required permissions for the action, without
@@ -153283,8 +156212,8 @@ type ModifyVerifiedAccessInstanceInput struct {
_ struct{} `type:"structure"`
// A unique, case-sensitive token that you provide to ensure idempotency of
- // your modification request. For more information, see Ensuring Idempotency
- // (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // your modification request. For more information, see Ensuring idempotency
+ // (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// A description for the Verified Access instance.
@@ -153366,8 +156295,8 @@ type ModifyVerifiedAccessInstanceLoggingConfigurationInput struct {
AccessLogs *VerifiedAccessLogOptions `type:"structure" required:"true"`
// A unique, case-sensitive token that you provide to ensure idempotency of
- // your modification request. For more information, see Ensuring Idempotency
- // (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // your modification request. For more information, see Ensuring idempotency
+ // (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// Checks whether you have the required permissions for the action, without
@@ -153545,8 +156474,8 @@ type ModifyVerifiedAccessTrustProviderInput struct {
_ struct{} `type:"structure"`
// A unique, case-sensitive token that you provide to ensure idempotency of
- // your modification request. For more information, see Ensuring Idempotency
- // (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // your modification request. For more information, see Ensuring idempotency
+ // (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// A description for the Verified Access trust provider.
@@ -153880,7 +156809,7 @@ type ModifyVolumeInput struct {
// * io2: 100 - 256,000 IOPS
//
// For io2 volumes, you can achieve up to 256,000 IOPS on instances built on
- // the Nitro System (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances).
+ // the Nitro System (https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html).
// On other instances, you can achieve performance up to 32,000 IOPS.
//
// Default: The existing value is retained if you keep the same volume type.
@@ -153888,10 +156817,10 @@ type ModifyVolumeInput struct {
Iops *int64 `type:"integer"`
// Specifies whether to enable Amazon EBS Multi-Attach. If you enable Multi-Attach,
- // you can attach the volume to up to 16 Nitro-based instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances)
+ // you can attach the volume to up to 16 Nitro-based instances (https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html)
// in the same Availability Zone. This parameter is supported with io1 and io2
- // volumes only. For more information, see Amazon EBS Multi-Attach (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volumes-multi.html)
- // in the Amazon Elastic Compute Cloud User Guide.
+ // volumes only. For more information, see Amazon EBS Multi-Attach (https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volumes-multi.html)
+ // in the Amazon EBS User Guide.
MultiAttachEnabled *bool `type:"boolean"`
// The target size of the volume, in GiB. The target volume size must be greater
@@ -153927,8 +156856,8 @@ type ModifyVolumeInput struct {
VolumeId *string `type:"string" required:"true"`
// The target EBS volume type of the volume. For more information, see Amazon
- // EBS volume types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html)
- // in the Amazon Elastic Compute Cloud User Guide.
+ // EBS volume types (https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volume-types.html)
+ // in the Amazon EBS User Guide.
//
// Default: The existing type is retained.
VolumeType *string `type:"string" enum:"VolumeType"`
@@ -155673,7 +158602,7 @@ type ModifyVpnTunnelOptionsSpecification struct {
//
// Constraints: A value between 60 and half of Phase2LifetimeSeconds.
//
- // Default: 540
+ // Default: 270
RekeyMarginTimeSeconds *int64 `type:"integer"`
// The number of packets in an IKE replay window.
@@ -156288,8 +159217,8 @@ type NatGateway struct {
NatGatewayId *string `locationName:"natGatewayId" type:"string"`
// Reserved. If you need to sustain traffic greater than the documented limits
- // (https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html),
- // contact us through the Support Center (https://console.aws.amazon.com/support/home?).
+ // (https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html#vpc-limits-gateways),
+ // contact Amazon Web Services Support.
ProvisionedBandwidth *ProvisionedBandwidth `locationName:"provisionedBandwidth" type:"structure"`
// The state of the NAT gateway.
@@ -156513,7 +159442,7 @@ func (s *NatGatewayAddress) SetStatus(v string) *NatGatewayAddress {
type NetworkAcl struct {
_ struct{} `type:"structure"`
- // Any associations between the network ACL and one or more subnets
+ // Any associations between the network ACL and your subnets
Associations []*NetworkAclAssociation `locationName:"associationSet" locationNameList:"item" type:"list"`
// The entries (rules) in the network ACL.
@@ -157631,7 +160560,7 @@ type NetworkInterface struct {
// A security group connection tracking configuration that enables you to set
// the timeout for connection tracking on an Elastic network interface. For
// more information, see Connection tracking timeouts (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-connection-tracking.html#connection-tracking-timeouts)
- // in the Amazon Elastic Compute Cloud User Guide.
+ // in the Amazon EC2 User Guide.
ConnectionTrackingConfiguration *ConnectionTrackingConfiguration `locationName:"connectionTrackingConfiguration" type:"structure"`
// Indicates whether a network interface with an IPv6 address is unreachable
@@ -158436,11 +161365,188 @@ func (s *NetworkInterfacePrivateIpAddress) SetPrivateIpAddress(v string) *Networ
return s
}
+// Describes the cores available to the neuron accelerator.
+type NeuronDeviceCoreInfo struct {
+ _ struct{} `type:"structure"`
+
+ // The number of cores available to the neuron accelerator.
+ Count *int64 `locationName:"count" type:"integer"`
+
+ // The version of the neuron accelerator.
+ Version *int64 `locationName:"version" type:"integer"`
+}
+
+// String returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s NeuronDeviceCoreInfo) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s NeuronDeviceCoreInfo) GoString() string {
+ return s.String()
+}
+
+// SetCount sets the Count field's value.
+func (s *NeuronDeviceCoreInfo) SetCount(v int64) *NeuronDeviceCoreInfo {
+ s.Count = &v
+ return s
+}
+
+// SetVersion sets the Version field's value.
+func (s *NeuronDeviceCoreInfo) SetVersion(v int64) *NeuronDeviceCoreInfo {
+ s.Version = &v
+ return s
+}
+
+// Describes the neuron accelerators for the instance type.
+type NeuronDeviceInfo struct {
+ _ struct{} `type:"structure"`
+
+ // Describes the cores available to each neuron accelerator.
+ CoreInfo *NeuronDeviceCoreInfo `locationName:"coreInfo" type:"structure"`
+
+ // The number of neuron accelerators for the instance type.
+ Count *int64 `locationName:"count" type:"integer"`
+
+ // Describes the memory available to each neuron accelerator.
+ MemoryInfo *NeuronDeviceMemoryInfo `locationName:"memoryInfo" type:"structure"`
+
+ // The name of the neuron accelerator.
+ Name *string `locationName:"name" type:"string"`
+}
+
+// String returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s NeuronDeviceInfo) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s NeuronDeviceInfo) GoString() string {
+ return s.String()
+}
+
+// SetCoreInfo sets the CoreInfo field's value.
+func (s *NeuronDeviceInfo) SetCoreInfo(v *NeuronDeviceCoreInfo) *NeuronDeviceInfo {
+ s.CoreInfo = v
+ return s
+}
+
+// SetCount sets the Count field's value.
+func (s *NeuronDeviceInfo) SetCount(v int64) *NeuronDeviceInfo {
+ s.Count = &v
+ return s
+}
+
+// SetMemoryInfo sets the MemoryInfo field's value.
+func (s *NeuronDeviceInfo) SetMemoryInfo(v *NeuronDeviceMemoryInfo) *NeuronDeviceInfo {
+ s.MemoryInfo = v
+ return s
+}
+
+// SetName sets the Name field's value.
+func (s *NeuronDeviceInfo) SetName(v string) *NeuronDeviceInfo {
+ s.Name = &v
+ return s
+}
+
+// Describes the memory available to the neuron accelerator.
+type NeuronDeviceMemoryInfo struct {
+ _ struct{} `type:"structure"`
+
+ // The size of the memory available to the neuron accelerator, in MiB.
+ SizeInMiB *int64 `locationName:"sizeInMiB" type:"integer"`
+}
+
+// String returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s NeuronDeviceMemoryInfo) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s NeuronDeviceMemoryInfo) GoString() string {
+ return s.String()
+}
+
+// SetSizeInMiB sets the SizeInMiB field's value.
+func (s *NeuronDeviceMemoryInfo) SetSizeInMiB(v int64) *NeuronDeviceMemoryInfo {
+ s.SizeInMiB = &v
+ return s
+}
+
+// Describes the neuron accelerators for the instance type.
+type NeuronInfo struct {
+ _ struct{} `type:"structure"`
+
+ // Describes the neuron accelerators for the instance type.
+ NeuronDevices []*NeuronDeviceInfo `locationName:"neuronDevices" locationNameList:"item" type:"list"`
+
+ // The total size of the memory for the neuron accelerators for the instance
+ // type, in MiB.
+ TotalNeuronDeviceMemoryInMiB *int64 `locationName:"totalNeuronDeviceMemoryInMiB" type:"integer"`
+}
+
+// String returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s NeuronInfo) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s NeuronInfo) GoString() string {
+ return s.String()
+}
+
+// SetNeuronDevices sets the NeuronDevices field's value.
+func (s *NeuronInfo) SetNeuronDevices(v []*NeuronDeviceInfo) *NeuronInfo {
+ s.NeuronDevices = v
+ return s
+}
+
+// SetTotalNeuronDeviceMemoryInMiB sets the TotalNeuronDeviceMemoryInMiB field's value.
+func (s *NeuronInfo) SetTotalNeuronDeviceMemoryInMiB(v int64) *NeuronInfo {
+ s.TotalNeuronDeviceMemoryInMiB = &v
+ return s
+}
+
+// Describes a DHCP configuration option.
type NewDhcpConfiguration struct {
_ struct{} `type:"structure"`
- Key *string `locationName:"key" type:"string"`
+ // The name of a DHCP option.
+ Key *string `type:"string"`
+ // The values for the DHCP option.
Values []*string `locationName:"Value" locationNameList:"item" type:"list"`
}
@@ -158628,13 +161734,13 @@ type OnDemandOptions struct {
// credits, and, if you use surplus credits, your final cost might be higher
// than what you specified for maxTotalPrice. For more information, see Surplus
// credits can incur charges (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances-unlimited-mode-concepts.html#unlimited-mode-surplus-credits)
- // in the EC2 User Guide.
+ // in the Amazon EC2 User Guide.
MaxTotalPrice *string `locationName:"maxTotalPrice" type:"string"`
- // The minimum target capacity for On-Demand Instances in the fleet. If the
- // minimum target capacity is not reached, the fleet launches no instances.
+ // The minimum target capacity for On-Demand Instances in the fleet. If this
+ // minimum capacity isn't reached, no instances are launched.
//
- // Supported only for fleets of type instant.
+ // Constraints: Maximum value of 1000. Supported only for fleets of type instant.
//
// At least one of the following must be specified: SingleAvailabilityZone |
// SingleInstanceType
@@ -158738,13 +161844,13 @@ type OnDemandOptionsRequest struct {
// credits, and, if you use surplus credits, your final cost might be higher
// than what you specified for MaxTotalPrice. For more information, see Surplus
// credits can incur charges (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances-unlimited-mode-concepts.html#unlimited-mode-surplus-credits)
- // in the EC2 User Guide.
+ // in the Amazon EC2 User Guide.
MaxTotalPrice *string `type:"string"`
- // The minimum target capacity for On-Demand Instances in the fleet. If the
- // minimum target capacity is not reached, the fleet launches no instances.
+ // The minimum target capacity for On-Demand Instances in the fleet. If this
+ // minimum capacity isn't reached, no instances are launched.
//
- // Supported only for fleets of type instant.
+ // Constraints: Maximum value of 1000. Supported only for fleets of type instant.
//
// At least one of the following must be specified: SingleAvailabilityZone |
// SingleInstanceType
@@ -161226,9 +164332,10 @@ type ProvisionByoipCidrInput struct {
_ struct{} `type:"structure"`
// The public IPv4 or IPv6 address range, in CIDR notation. The most specific
- // IPv4 prefix that you can specify is /24. The most specific IPv6 prefix you
- // can specify is /56. The address range cannot overlap with another address
- // range that you've brought to this or another Region.
+ // IPv4 prefix that you can specify is /24. The most specific IPv6 address range
+ // that you can bring is /48 for CIDRs that are publicly advertisable and /56
+ // for CIDRs that are not publicly advertisable. The address range cannot overlap
+ // with another address range that you've brought to this or another Region.
//
// Cidr is a required field
Cidr *string `type:"string" required:"true"`
@@ -161524,12 +164631,12 @@ type ProvisionIpamPoolCidrInput struct {
Cidr *string `type:"string"`
// A signed document that proves that you are authorized to bring a specified
- // IP address range to Amazon using BYOIP. This option applies to public pools
- // only.
+ // IP address range to Amazon using BYOIP. This option only applies to IPv4
+ // and IPv6 pools in the public scope.
CidrAuthorizationContext *IpamCidrAuthorizationContext `type:"structure"`
// A unique, case-sensitive identifier that you provide to ensure the idempotency
- // of the request. For more information, see Ensuring Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // of the request. For more information, see Ensuring idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// A check for whether you have the required permissions for the action without
@@ -161538,6 +164645,10 @@ type ProvisionIpamPoolCidrInput struct {
// is UnauthorizedOperation.
DryRun *bool `type:"boolean"`
+ // Verification token ID. This option only applies to IPv4 and IPv6 pools in
+ // the public scope.
+ IpamExternalResourceVerificationTokenId *string `type:"string"`
+
// The ID of the IPAM pool to which you want to assign a CIDR.
//
// IpamPoolId is a required field
@@ -161548,6 +164659,11 @@ type ProvisionIpamPoolCidrInput struct {
// provisioning CIDRs to pools with source pools. Cannot be used to provision
// BYOIP CIDRs to top-level pools. Either "NetmaskLength" or "Cidr" is required.
NetmaskLength *int64 `type:"integer"`
+
+ // The method for verifying control of a public IP address range. Defaults to
+ // remarks-x509 if not specified. This option only applies to IPv4 and IPv6
+ // pools in the public scope.
+ VerificationMethod *string `type:"string" enum:"VerificationMethod"`
}
// String returns the string representation.
@@ -161605,6 +164721,12 @@ func (s *ProvisionIpamPoolCidrInput) SetDryRun(v bool) *ProvisionIpamPoolCidrInp
return s
}
+// SetIpamExternalResourceVerificationTokenId sets the IpamExternalResourceVerificationTokenId field's value.
+func (s *ProvisionIpamPoolCidrInput) SetIpamExternalResourceVerificationTokenId(v string) *ProvisionIpamPoolCidrInput {
+ s.IpamExternalResourceVerificationTokenId = &v
+ return s
+}
+
// SetIpamPoolId sets the IpamPoolId field's value.
func (s *ProvisionIpamPoolCidrInput) SetIpamPoolId(v string) *ProvisionIpamPoolCidrInput {
s.IpamPoolId = &v
@@ -161617,6 +164739,12 @@ func (s *ProvisionIpamPoolCidrInput) SetNetmaskLength(v int64) *ProvisionIpamPoo
return s
}
+// SetVerificationMethod sets the VerificationMethod field's value.
+func (s *ProvisionIpamPoolCidrInput) SetVerificationMethod(v string) *ProvisionIpamPoolCidrInput {
+ s.VerificationMethod = &v
+ return s
+}
+
type ProvisionIpamPoolCidrOutput struct {
_ struct{} `type:"structure"`
@@ -161668,6 +164796,13 @@ type ProvisionPublicIpv4PoolCidrInput struct {
// NetmaskLength is a required field
NetmaskLength *int64 `type:"integer" required:"true"`
+ // The Availability Zone (AZ) or Local Zone (LZ) network border group that the
+ // resource that the IP address is assigned to is in. Defaults to an AZ network
+ // border group. For more information on available Local Zones, see Local Zone
+ // availability (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html#byoip-zone-avail)
+ // in the Amazon EC2 User Guide.
+ NetworkBorderGroup *string `type:"string"`
+
// The ID of the public IPv4 pool you would like to use for this CIDR.
//
// PoolId is a required field
@@ -161729,6 +164864,12 @@ func (s *ProvisionPublicIpv4PoolCidrInput) SetNetmaskLength(v int64) *ProvisionP
return s
}
+// SetNetworkBorderGroup sets the NetworkBorderGroup field's value.
+func (s *ProvisionPublicIpv4PoolCidrInput) SetNetworkBorderGroup(v string) *ProvisionPublicIpv4PoolCidrInput {
+ s.NetworkBorderGroup = &v
+ return s
+}
+
// SetPoolId sets the PoolId field's value.
func (s *ProvisionPublicIpv4PoolCidrInput) SetPoolId(v string) *ProvisionPublicIpv4PoolCidrInput {
s.PoolId = &v
@@ -161776,34 +164917,24 @@ func (s *ProvisionPublicIpv4PoolCidrOutput) SetPoolId(v string) *ProvisionPublic
}
// Reserved. If you need to sustain traffic greater than the documented limits
-// (https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html),
-// contact us through the Support Center (https://console.aws.amazon.com/support/home?).
+// (https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html#vpc-limits-gateways),
+// contact Amazon Web Services Support.
type ProvisionedBandwidth struct {
_ struct{} `type:"structure"`
- // Reserved. If you need to sustain traffic greater than the documented limits
- // (https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html),
- // contact us through the Support Center (https://console.aws.amazon.com/support/home?).
+ // Reserved.
ProvisionTime *time.Time `locationName:"provisionTime" type:"timestamp"`
- // Reserved. If you need to sustain traffic greater than the documented limits
- // (https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html),
- // contact us through the Support Center (https://console.aws.amazon.com/support/home?).
+ // Reserved.
Provisioned *string `locationName:"provisioned" type:"string"`
- // Reserved. If you need to sustain traffic greater than the documented limits
- // (https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html),
- // contact us through the Support Center (https://console.aws.amazon.com/support/home?).
+ // Reserved.
RequestTime *time.Time `locationName:"requestTime" type:"timestamp"`
- // Reserved. If you need to sustain traffic greater than the documented limits
- // (https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html),
- // contact us through the Support Center (https://console.aws.amazon.com/support/home?).
+ // Reserved.
Requested *string `locationName:"requested" type:"string"`
- // Reserved. If you need to sustain traffic greater than the documented limits
- // (https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html),
- // contact us through the Support Center (https://console.aws.amazon.com/support/home?).
+ // Reserved.
Status *string `locationName:"status" type:"string"`
}
@@ -162595,7 +165726,7 @@ type PurchaseReservedInstancesOfferingOutput struct {
// The IDs of the purchased Reserved Instances. If your purchase crosses into
// a discounted pricing tier, the final Reserved Instances IDs might change.
// For more information, see Crossing pricing tiers (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts-reserved-instances-application.html#crossing-pricing-tiers)
- // in the Amazon Elastic Compute Cloud User Guide.
+ // in the Amazon EC2 User Guide.
ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string"`
}
@@ -163007,8 +166138,8 @@ type RegisterImageInput struct {
// If you create an AMI on an Outpost, then all backing snapshots must be on
// the same Outpost or in the Region of that Outpost. AMIs on an Outpost that
// include local snapshots can be used to launch instances on the same Outpost
- // only. For more information, Amazon EBS local snapshots on Outposts (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshots-outposts.html#ami)
- // in the Amazon EC2 User Guide.
+ // only. For more information, Amazon EBS local snapshots on Outposts (https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html#ami)
+ // in the Amazon EBS User Guide.
BlockDeviceMappings []*BlockDeviceMapping `locationName:"BlockDeviceMapping" locationNameList:"BlockDeviceMapping" type:"list"`
// The boot mode of the AMI. A value of uefi-preferred indicates that the AMI
@@ -163082,6 +166213,14 @@ type RegisterImageInput struct {
// PV AMI can make instances launched from the AMI unreachable.
SriovNetSupport *string `locationName:"sriovNetSupport" type:"string"`
+ // The tags to apply to the AMI.
+ //
+ // To tag the AMI, the value for ResourceType must be image. If you specify
+ // another value for ResourceType, the request fails.
+ //
+ // To tag an AMI after it has been registered, see CreateTags (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html).
+ TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"`
+
// Set to v2.0 to enable Trusted Platform Module (TPM) support. For more information,
// see NitroTPM (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitrotpm.html)
// in the Amazon EC2 User Guide.
@@ -163216,6 +166355,12 @@ func (s *RegisterImageInput) SetSriovNetSupport(v string) *RegisterImageInput {
return s
}
+// SetTagSpecifications sets the TagSpecifications field's value.
+func (s *RegisterImageInput) SetTagSpecifications(v []*TagSpecification) *RegisterImageInput {
+ s.TagSpecifications = v
+ return s
+}
+
// SetTpmSupport sets the TpmSupport field's value.
func (s *RegisterImageInput) SetTpmSupport(v string) *RegisterImageInput {
s.TpmSupport = &v
@@ -165782,17 +168927,17 @@ type RequestLaunchTemplateData struct {
// type, platform, Availability Zone).
CapacityReservationSpecification *LaunchTemplateCapacityReservationSpecificationRequest `type:"structure"`
- // The CPU options for the instance. For more information, see Optimizing CPU
- // Options (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html)
- // in the Amazon Elastic Compute Cloud User Guide.
+ // The CPU options for the instance. For more information, see Optimize CPU
+ // options (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html)
+ // in the Amazon EC2 User Guide.
CpuOptions *LaunchTemplateCpuOptionsRequest `type:"structure"`
// The credit option for CPU usage of the instance. Valid only for T instances.
CreditSpecification *CreditSpecificationRequest `type:"structure"`
// Indicates whether to enable the instance for stop protection. For more information,
- // see Stop protection (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html#Using_StopProtection)
- // in the Amazon Elastic Compute Cloud User Guide.
+ // see Enable stop protection for your instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-stop-protection.html)
+ // in the Amazon EC2 User Guide.
DisableApiStop *bool `type:"boolean"`
// If you set this parameter to true, you can't terminate the instance using
@@ -165809,7 +168954,11 @@ type RequestLaunchTemplateData struct {
// an EBS-optimized instance.
EbsOptimized *bool `type:"boolean"`
- // An elastic GPU to associate with the instance.
+ // Deprecated.
+ //
+ // Amazon Elastic Graphics reached end of life on January 8, 2024. For workloads
+ // that require graphics acceleration, we recommend that you use Amazon EC2
+ // G4ad, G4dn, or G5 instances.
ElasticGpuSpecifications []*ElasticGpuSpecification `locationName:"ElasticGpuSpecification" locationNameList:"ElasticGpuSpecification" type:"list"`
// An elastic inference accelerator to associate with the instance. Elastic
@@ -165837,19 +168986,24 @@ type RequestLaunchTemplateData struct {
// Indicates whether an instance is enabled for hibernation. This parameter
// is valid only if the instance meets the hibernation prerequisites (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hibernating-prerequisites.html).
- // For more information, see Hibernate your instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html)
- // in the Amazon Elastic Compute Cloud User Guide.
+ // For more information, see Hibernate your Amazon EC2 instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html)
+ // in the Amazon EC2 User Guide.
HibernationOptions *LaunchTemplateHibernationOptionsRequest `type:"structure"`
// The name or Amazon Resource Name (ARN) of an IAM instance profile.
IamInstanceProfile *LaunchTemplateIamInstanceProfileSpecificationRequest `type:"structure"`
- // The ID of the AMI. Alternatively, you can specify a Systems Manager parameter,
- // which will resolve to an AMI ID on launch.
+ // The ID of the AMI in the format ami-17characters00000.
+ //
+ // Alternatively, you can specify a Systems Manager parameter, using one of
+ // the following formats. The Systems Manager parameter will resolve to an AMI
+ // ID on launch.
//
- // Valid formats:
+ // To reference a public parameter:
//
- // * ami-17characters00000
+ // * resolve:ssm:public-parameter
+ //
+ // To reference a parameter stored in the same account:
//
// * resolve:ssm:parameter-name
//
@@ -165857,15 +169011,26 @@ type RequestLaunchTemplateData struct {
//
// * resolve:ssm:parameter-name:label
//
- // * resolve:ssm:public-parameter
+ // To reference a parameter shared from another Amazon Web Services account:
+ //
+ // * resolve:ssm:parameter-ARN
//
- // Currently, EC2 Fleet and Spot Fleet do not support specifying a Systems Manager
- // parameter. If the launch template will be used by an EC2 Fleet or Spot Fleet,
- // you must specify the AMI ID.
+ // * resolve:ssm:parameter-ARN:version-number
+ //
+ // * resolve:ssm:parameter-ARN:label
//
// For more information, see Use a Systems Manager parameter instead of an AMI
// ID (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-launch-template.html#use-an-ssm-parameter-instead-of-an-ami-id)
- // in the Amazon Elastic Compute Cloud User Guide.
+ // in the Amazon EC2 User Guide.
+ //
+ // If the launch template will be used for an EC2 Fleet or Spot Fleet, note
+ // the following:
+ //
+ // * Only EC2 Fleets of type instant support specifying a Systems Manager
+ // parameter.
+ //
+ // * For EC2 Fleets of type maintain or request, or for Spot Fleets, you
+ // must specify the AMI ID.
ImageId *string `type:"string"`
// Indicates whether an instance stops or terminates when you initiate shutdown
@@ -165913,8 +169078,8 @@ type RequestLaunchTemplateData struct {
// in the Amazon EC2 User Guide.
InstanceRequirements *InstanceRequirementsRequest `type:"structure"`
- // The instance type. For more information, see Instance types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html)
- // in the Amazon Elastic Compute Cloud User Guide.
+ // The instance type. For more information, see Amazon EC2 instance types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html)
+ // in the Amazon EC2 User Guide.
//
// If you specify InstanceType, you can't specify InstanceRequirements.
InstanceType *string `type:"string" enum:"InstanceType"`
@@ -165923,7 +169088,7 @@ type RequestLaunchTemplateData struct {
//
// We recommend that you use PV-GRUB instead of kernels and RAM disks. For more
// information, see User provided kernels (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html)
- // in the Amazon Elastic Compute Cloud User Guide.
+ // in the Amazon EC2 User Guide.
KernelId *string `type:"string"`
// The name of the key pair. You can create a key pair using CreateKeyPair (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateKeyPair.html)
@@ -165941,14 +169106,13 @@ type RequestLaunchTemplateData struct {
// The metadata options for the instance. For more information, see Instance
// metadata and user data (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html)
- // in the Amazon Elastic Compute Cloud User Guide.
+ // in the Amazon EC2 User Guide.
MetadataOptions *LaunchTemplateInstanceMetadataOptionsRequest `type:"structure"`
// The monitoring for the instance.
Monitoring *LaunchTemplatesMonitoringRequest `type:"structure"`
- // One or more network interfaces. If you specify a network interface, you must
- // specify any security groups and subnets as part of the network interface.
+ // The network interfaces for the instance.
NetworkInterfaces []*LaunchTemplateInstanceNetworkInterfaceSpecificationRequest `locationName:"NetworkInterface" locationNameList:"InstanceNetworkInterfaceSpecification" type:"list"`
// The placement for the instance.
@@ -165962,15 +169126,20 @@ type RequestLaunchTemplateData struct {
//
// We recommend that you use PV-GRUB instead of kernels and RAM disks. For more
// information, see User provided kernels (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html)
- // in the Amazon Elastic Compute Cloud User Guide.
+ // in the Amazon EC2 User Guide.
RamDiskId *string `type:"string"`
- // One or more security group IDs. You can create a security group using CreateSecurityGroup
- // (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateSecurityGroup.html).
+ // The IDs of the security groups.
+ //
+ // If you specify a network interface, you must specify any security groups
+ // as part of the network interface instead of using this parameter.
SecurityGroupIds []*string `locationName:"SecurityGroupId" locationNameList:"SecurityGroupId" type:"list"`
- // One or more security group names. For a nondefault VPC, you must use security
+ // The names of the security groups. For a nondefault VPC, you must use security
// group IDs instead.
+ //
+ // If you specify a network interface, you must specify any security groups
+ // as part of the network interface instead of using this parameter.
SecurityGroups []*string `locationName:"SecurityGroup" locationNameList:"SecurityGroup" type:"list"`
// The tags to apply to the resources that are created during instance launch.
@@ -165979,9 +169148,8 @@ type RequestLaunchTemplateData struct {
// The user data to make available to the instance. You must provide base64-encoded
// text. User data is limited to 16 KB. For more information, see Run commands
- // on your Linux instance at launch (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html)
- // (Linux) or Work with instance user data (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/instancedata-add-user-data.html)
- // (Windows) in the Amazon Elastic Compute Cloud User Guide.
+ // on your Amazon EC2 instance at launch (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html)
+ // in the Amazon EC2 User Guide.
//
// If you are creating the launch template for use with Batch, the user data
// must be provided in the MIME multi-part archive format (https://cloudinit.readthedocs.io/en/latest/topics/format.html#mime-multi-part-archive).
@@ -166363,8 +169531,9 @@ type RequestSpotInstancesInput struct {
BlockDurationMinutes *int64 `locationName:"blockDurationMinutes" type:"integer"`
// Unique, case-sensitive identifier that you provide to ensure the idempotency
- // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html)
- // in the Amazon EC2 User Guide for Linux Instances.
+ // of the request. For more information, see Ensuring idempotency in Amazon
+ // EC2 API requests (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html)
+ // in the Amazon EC2 User Guide.
ClientToken *string `locationName:"clientToken" type:"string"`
// Checks whether you have the required permissions for the action, without
@@ -168598,17 +171767,17 @@ type ResponseLaunchTemplateData struct {
// Information about the Capacity Reservation targeting option.
CapacityReservationSpecification *LaunchTemplateCapacityReservationSpecificationResponse `locationName:"capacityReservationSpecification" type:"structure"`
- // The CPU options for the instance. For more information, see Optimizing CPU
+ // The CPU options for the instance. For more information, see Optimize CPU
// options (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html)
- // in the Amazon Elastic Compute Cloud User Guide.
+ // in the Amazon EC2 User Guide.
CpuOptions *LaunchTemplateCpuOptions `locationName:"cpuOptions" type:"structure"`
// The credit option for CPU usage of the instance.
CreditSpecification *CreditSpecification `locationName:"creditSpecification" type:"structure"`
// Indicates whether the instance is enabled for stop protection. For more information,
- // see Stop protection (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html#Using_StopProtection)
- // in the Amazon Elastic Compute Cloud User Guide.
+ // see Enable stop protection for your instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-stop-protection.html)
+ // in the Amazon EC2 User Guide.
DisableApiStop *bool `locationName:"disableApiStop" type:"boolean"`
// If set to true, indicates that the instance cannot be terminated using the
@@ -168618,7 +171787,11 @@ type ResponseLaunchTemplateData struct {
// Indicates whether the instance is optimized for Amazon EBS I/O.
EbsOptimized *bool `locationName:"ebsOptimized" type:"boolean"`
- // The elastic GPU specification.
+ // Deprecated.
+ //
+ // Amazon Elastic Graphics reached end of life on January 8, 2024. For workloads
+ // that require graphics acceleration, we recommend that you use Amazon EC2
+ // G4ad, G4dn, or G5 instances.
ElasticGpuSpecifications []*ElasticGpuSpecificationResponse `locationName:"elasticGpuSpecificationSet" locationNameList:"item" type:"list"`
// An elastic inference accelerator to associate with the instance. Elastic
@@ -168640,8 +171813,8 @@ type ResponseLaunchTemplateData struct {
EnclaveOptions *LaunchTemplateEnclaveOptions `locationName:"enclaveOptions" type:"structure"`
// Indicates whether an instance is configured for hibernation. For more information,
- // see Hibernate your instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html)
- // in the Amazon Elastic Compute Cloud User Guide.
+ // see Hibernate your Amazon EC2 instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html)
+ // in the Amazon EC2 User Guide.
HibernationOptions *LaunchTemplateHibernationOptions `locationName:"hibernationOptions" type:"structure"`
// The IAM instance profile.
@@ -168664,7 +171837,7 @@ type ResponseLaunchTemplateData struct {
//
// For more information, see Use a Systems Manager parameter instead of an AMI
// ID (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html#use-an-ssm-parameter-instead-of-an-ami-id)
- // in the Amazon Elastic Compute Cloud User Guide.
+ // in the Amazon EC2 User Guide.
ImageId *string `locationName:"imageId" type:"string"`
// Indicates whether an instance stops or terminates when you initiate shutdown
@@ -168697,7 +171870,7 @@ type ResponseLaunchTemplateData struct {
// The metadata options for the instance. For more information, see Instance
// metadata and user data (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html)
- // in the Amazon Elastic Compute Cloud User Guide.
+ // in the Amazon EC2 User Guide.
MetadataOptions *LaunchTemplateInstanceMetadataOptions `locationName:"metadataOptions" type:"structure"`
// The monitoring for the instance.
@@ -169309,8 +172482,8 @@ type RestoreSnapshotFromRecycleBinOutput struct {
Encrypted *bool `locationName:"encrypted" type:"boolean"`
// The ARN of the Outpost on which the snapshot is stored. For more information,
- // see Amazon EBS local snapshots on Outposts (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshots-outposts.html)
- // in the Amazon Elastic Compute Cloud User Guide.
+ // see Amazon EBS local snapshots on Outposts (https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html)
+ // in the Amazon EBS User Guide.
OutpostArn *string `locationName:"outpostArn" type:"string"`
// The ID of the Amazon Web Services account that owns the EBS snapshot.
@@ -169876,8 +173049,7 @@ type RevokeSecurityGroupIngressInput struct {
DryRun *bool `locationName:"dryRun" type:"boolean"`
// If the protocol is TCP or UDP, this is the start of the port range. If the
- // protocol is ICMP, this is the type number. A value of -1 indicates all ICMP
- // types.
+ // protocol is ICMP, this is the ICMP type or -1 (all ICMP types).
FromPort *int64 `type:"integer"`
// The ID of the security group.
@@ -169910,7 +173082,7 @@ type RevokeSecurityGroupIngressInput struct {
SourceSecurityGroupOwnerId *string `type:"string"`
// If the protocol is TCP or UDP, this is the end of the port range. If the
- // protocol is ICMP, this is the code. A value of -1 indicates all ICMP codes.
+ // protocol is ICMP, this is the ICMP code or -1 (all ICMP codes).
ToPort *int64 `type:"integer"`
}
@@ -170219,7 +173391,7 @@ func (s *Route) SetVpcPeeringConnectionId(v string) *Route {
type RouteTable struct {
_ struct{} `type:"structure"`
- // The associations between the route table and one or more subnets or a gateway.
+ // The associations between the route table and your subnets or gateways.
Associations []*RouteTableAssociation `locationName:"associationSet" locationNameList:"item" type:"list"`
// The ID of the Amazon Web Services account that owns the route table.
@@ -170614,25 +173786,15 @@ type RunInstancesInput struct {
// Default: false
EbsOptimized *bool `locationName:"ebsOptimized" type:"boolean"`
- // An elastic GPU to associate with the instance. An Elastic GPU is a GPU resource
- // that you can attach to your Windows instance to accelerate the graphics performance
- // of your applications. For more information, see Amazon EC2 Elastic GPUs (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/elastic-graphics.html)
- // in the Amazon EC2 User Guide.
+ // An elastic GPU to associate with the instance.
+ //
+ // Amazon Elastic Graphics reached end of life on January 8, 2024.
ElasticGpuSpecification []*ElasticGpuSpecification `locationNameList:"item" type:"list"`
- // An elastic inference accelerator to associate with the instance. Elastic
- // inference accelerators are a resource you can attach to your Amazon EC2 instances
- // to accelerate your Deep Learning (DL) inference workloads.
- //
- // You cannot specify accelerators from different generations in the same request.
+ // An elastic inference accelerator to associate with the instance.
//
- // Starting April 15, 2023, Amazon Web Services will not onboard new customers
- // to Amazon Elastic Inference (EI), and will help current customers migrate
- // their workloads to options that offer better price and performance. After
- // April 15, 2023, new customers will not be able to launch instances with Amazon
- // EI accelerators in Amazon SageMaker, Amazon ECS, or Amazon EC2. However,
- // customers who have used Amazon EI at least once during the past 30-day period
- // are considered current customers and will be able to continue using the service.
+ // Amazon Elastic Inference (EI) is no longer available to new customers. For
+ // more information, see Amazon Elastic Inference FAQs (http://aws.amazon.com/machine-learning/elastic-inference/faqs/).
ElasticInferenceAccelerators []*ElasticInferenceAccelerator `locationName:"ElasticInferenceAccelerator" locationNameList:"item" type:"list"`
// If you’re launching an instance into a dual-stack or IPv6-only subnet,
@@ -170660,7 +173822,7 @@ type RunInstancesInput struct {
// Indicates whether an instance is enabled for hibernation. This parameter
// is valid only if the instance meets the hibernation prerequisites (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hibernating-prerequisites.html).
- // For more information, see Hibernate your instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html)
+ // For more information, see Hibernate your Amazon EC2 instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html)
// in the Amazon EC2 User Guide.
//
// You can't enable hibernation and Amazon Web Services Nitro Enclaves on the
@@ -170686,7 +173848,7 @@ type RunInstancesInput struct {
// InstanceInterruptionBehavior is set to either hibernate or stop.
InstanceMarketOptions *InstanceMarketOptionsRequest `type:"structure"`
- // The instance type. For more information, see Instance types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html)
+ // The instance type. For more information, see Amazon EC2 instance types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html)
// in the Amazon EC2 User Guide.
InstanceType *string `type:"string" enum:"InstanceType"`
@@ -170723,9 +173885,8 @@ type RunInstancesInput struct {
// you choose an AMI that is configured to allow users another way to log in.
KeyName *string `type:"string"`
- // The launch template to use to launch the instances. Any parameters that you
- // specify in RunInstances override the same parameters in the launch template.
- // You can specify either the name or ID of a launch template, but not both.
+ // The launch template. Any additional parameters that you specify for the new
+ // instance overwrite the corresponding parameters included in the launch template.
LaunchTemplate *LaunchTemplateSpecification `type:"structure"`
// The license configurations.
@@ -170734,14 +173895,14 @@ type RunInstancesInput struct {
// The maintenance and recovery options for the instance.
MaintenanceOptions *InstanceMaintenanceOptionsRequest `type:"structure"`
- // The maximum number of instances to launch. If you specify more instances
- // than Amazon EC2 can launch in the target Availability Zone, Amazon EC2 launches
- // the largest possible number of instances above MinCount.
+ // The maximum number of instances to launch. If you specify a value that is
+ // more capacity than Amazon EC2 can launch in the target Availability Zone,
+ // Amazon EC2 launches the largest possible number of instances above the specified
+ // minimum count.
//
- // Constraints: Between 1 and the maximum number you're allowed for the specified
- // instance type. For more information about the default limits, and how to
- // request an increase, see How many instances can I run in Amazon EC2 (http://aws.amazon.com/ec2/faqs/#How_many_instances_can_I_run_in_Amazon_EC2)
- // in the Amazon EC2 FAQ.
+ // Constraints: Between 1 and the quota for the specified instance type for
+ // your account for this Region. For more information, see Amazon EC2 instance
+ // type quotas (https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-instance-quotas.html).
//
// MaxCount is a required field
MaxCount *int64 `type:"integer" required:"true"`
@@ -170750,14 +173911,13 @@ type RunInstancesInput struct {
// metadata and user data (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html).
MetadataOptions *InstanceMetadataOptionsRequest `type:"structure"`
- // The minimum number of instances to launch. If you specify a minimum that
- // is more instances than Amazon EC2 can launch in the target Availability Zone,
- // Amazon EC2 launches no instances.
+ // The minimum number of instances to launch. If you specify a value that is
+ // more capacity than Amazon EC2 can provide in the target Availability Zone,
+ // Amazon EC2 does not launch any instances.
//
- // Constraints: Between 1 and the maximum number you're allowed for the specified
- // instance type. For more information about the default limits, and how to
- // request an increase, see How many instances can I run in Amazon EC2 (http://aws.amazon.com/ec2/faqs/#How_many_instances_can_I_run_in_Amazon_EC2)
- // in the Amazon EC2 General FAQ.
+ // Constraints: Between 1 and the quota for the specified instance type for
+ // your account for this Region. For more information, see Amazon EC2 instance
+ // type quotas (https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-instance-quotas.html).
//
// MinCount is a required field
MinCount *int64 `type:"integer" required:"true"`
@@ -170765,9 +173925,7 @@ type RunInstancesInput struct {
// Specifies whether detailed monitoring is enabled for the instance.
Monitoring *RunInstancesMonitoringEnabled `type:"structure"`
- // The network interfaces to associate with the instance. If you specify a network
- // interface, you must specify any security groups and subnets as part of the
- // network interface.
+ // The network interfaces to associate with the instance.
NetworkInterfaces []*InstanceNetworkInterfaceSpecification `locationName:"networkInterface" locationNameList:"item" type:"list"`
// The placement for the instance.
@@ -170804,13 +173962,13 @@ type RunInstancesInput struct {
// (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateSecurityGroup.html).
//
// If you specify a network interface, you must specify any security groups
- // as part of the network interface.
+ // as part of the network interface instead of using this parameter.
SecurityGroupIds []*string `locationName:"SecurityGroupId" locationNameList:"SecurityGroupId" type:"list"`
// [Default VPC] The names of the security groups.
//
// If you specify a network interface, you must specify any security groups
- // as part of the network interface.
+ // as part of the network interface instead of using this parameter.
//
// Default: Amazon EC2 uses the default security group.
SecurityGroups []*string `locationName:"SecurityGroup" locationNameList:"SecurityGroup" type:"list"`
@@ -170818,7 +173976,7 @@ type RunInstancesInput struct {
// The ID of the subnet to launch the instance into.
//
// If you specify a network interface, you must specify any subnets as part
- // of the network interface.
+ // of the network interface instead of using this parameter.
SubnetId *string `type:"string"`
// The tags to apply to the resources that are created during instance launch.
@@ -170829,8 +173987,6 @@ type RunInstancesInput struct {
//
// * Volumes
//
- // * Elastic graphics
- //
// * Spot Instance requests
//
// * Network interfaces
@@ -170838,12 +173994,10 @@ type RunInstancesInput struct {
// To tag a resource after it has been created, see CreateTags (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html).
TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"`
- // The user data script to make available to the instance. For more information,
- // see Run commands on your Linux instance at launch (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html)
- // and Run commands on your Windows instance at launch (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2-windows-user-data.html).
- // If you are using a command line tool, base64-encoding is performed for you,
- // and you can load the text from a file. Otherwise, you must provide base64-encoded
- // text. User data is limited to 16 KB.
+ // The user data to make available to the instance. User data must be base64-encoded.
+ // Depending on the tool or SDK that you're using, the base64-encoding might
+ // be performed for you. For more information, see Work with instance user data
+ // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-add-user-data.html).
//
// UserData is a sensitive parameter and its value will be
// replaced with "sensitive" in string returned by RunInstancesInput's
@@ -172362,10 +175516,10 @@ type ScheduledInstancesNetworkInterface struct {
// one. You cannot specify more than one network interface in the request. If
// launching into a default subnet, the default value is true.
//
- // Starting on February 1, 2024, Amazon Web Services will charge for all public
- // IPv4 addresses, including public IPv4 addresses associated with running instances
- // and Elastic IP addresses. For more information, see the Public IPv4 Address
- // tab on the Amazon VPC pricing page (http://aws.amazon.com/vpc/pricing/).
+ // Amazon Web Services charges for all public IPv4 addresses, including public
+ // IPv4 addresses associated with running instances and Elastic IP addresses.
+ // For more information, see the Public IPv4 Address tab on the Amazon VPC pricing
+ // page (http://aws.amazon.com/vpc/pricing/).
AssociatePublicIpAddress *bool `type:"boolean"`
// Indicates whether to delete the interface when the instance is terminated.
@@ -172914,7 +176068,8 @@ type SearchTransitGatewayRoutesInput struct {
// Filters is a required field
Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list" required:"true"`
- // The maximum number of routes to return.
+ // The maximum number of routes to return. If a value is not provided, the default
+ // is 1000.
MaxResults *int64 `min:"5" type:"integer"`
// The ID of the transit gateway route table.
@@ -173247,15 +176402,15 @@ type SecurityGroupReference struct {
// The ID of the VPC with the referencing security group.
ReferencingVpcId *string `locationName:"referencingVpcId" type:"string"`
- // The ID of the transit gateway (if applicable). For more information about
- // security group referencing for transit gateways, see Create a transit gateway
- // attachment to a VPC (https://docs.aws.amazon.com/tgw/tgw-vpc-attachments.html#create-vpc-attachment)
- // in the Amazon Web Services Transit Gateway Guide.
+ //
+ // This parameter is in preview and may not be available for your account.
+ //
+ // The ID of the transit gateway (if applicable).
TransitGatewayId *string `locationName:"transitGatewayId" type:"string"`
// The ID of the VPC peering connection (if applicable). For more information
// about security group referencing for peering connections, see Update your
- // security groups to reference peer security groups (https://docs.aws.amazon.com/peering/vpc-peering-security-groups.html)
+ // security groups to reference peer security groups (https://docs.aws.amazon.com/vpc/latest/peering/vpc-peering-security-groups.html)
// in the VPC Peering Guide.
VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string"`
}
@@ -173316,9 +176471,7 @@ type SecurityGroupRule struct {
Description *string `locationName:"description" type:"string"`
// If the protocol is TCP or UDP, this is the start of the port range. If the
- // protocol is ICMP or ICMPv6, this is the type number. A value of -1 indicates
- // all ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6 types, you must specify
- // all ICMP/ICMPv6 codes.
+ // protocol is ICMP or ICMPv6, this is the ICMP type or -1 (all ICMP types).
FromPort *int64 `locationName:"fromPort" type:"integer"`
// The ID of the security group.
@@ -173349,9 +176502,9 @@ type SecurityGroupRule struct {
Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"`
// If the protocol is TCP or UDP, this is the end of the port range. If the
- // protocol is ICMP or ICMPv6, this is the type number. A value of -1 indicates
- // all ICMP/ICMPv6 codes. If you specify all ICMP/ICMPv6 types, you must specify
- // all ICMP/ICMPv6 codes.
+ // protocol is ICMP or ICMPv6, this is the ICMP code or -1 (all ICMP codes).
+ // If the start port is -1 (all ICMP types), then the end port must be -1 (all
+ // ICMP codes).
ToPort *int64 `locationName:"toPort" type:"integer"`
}
@@ -173526,9 +176679,7 @@ type SecurityGroupRuleRequest struct {
Description *string `type:"string"`
// If the protocol is TCP or UDP, this is the start of the port range. If the
- // protocol is ICMP or ICMPv6, this is the type number. A value of -1 indicates
- // all ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6 types, you must specify
- // all ICMP/ICMPv6 codes.
+ // protocol is ICMP or ICMPv6, this is the ICMP type or -1 (all ICMP types).
FromPort *int64 `type:"integer"`
// The IP protocol name (tcp, udp, icmp, icmpv6) or number (see Protocol Numbers
@@ -173544,9 +176695,9 @@ type SecurityGroupRuleRequest struct {
ReferencedGroupId *string `type:"string"`
// If the protocol is TCP or UDP, this is the end of the port range. If the
- // protocol is ICMP or ICMPv6, this is the code. A value of -1 indicates all
- // ICMP/ICMPv6 codes. If you specify all ICMP/ICMPv6 types, you must specify
- // all ICMP/ICMPv6 codes.
+ // protocol is ICMP or ICMPv6, this is the ICMP code or -1 (all ICMP codes).
+ // If the start port is -1 (all ICMP types), then the end port must be -1 (all
+ // ICMP codes).
ToPort *int64 `type:"integer"`
}
@@ -174230,13 +177381,13 @@ type Snapshot struct {
// Indicates whether the snapshot is encrypted.
Encrypted *bool `locationName:"encrypted" type:"boolean"`
- // The Amazon Resource Name (ARN) of the Key Management Service (KMS) KMS key
- // that was used to protect the volume encryption key for the parent volume.
+ // The Amazon Resource Name (ARN) of the KMS key that was used to protect the
+ // volume encryption key for the parent volume.
KmsKeyId *string `locationName:"kmsKeyId" type:"string"`
// The ARN of the Outpost on which the snapshot is stored. For more information,
- // see Amazon EBS local snapshots on Outposts (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshots-outposts.html)
- // in the Amazon Elastic Compute Cloud User Guide.
+ // see Amazon EBS local snapshots on Outposts (https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html)
+ // in the Amazon EBS User Guide.
OutpostArn *string `locationName:"outpostArn" type:"string"`
// The Amazon Web Services owner alias, from an Amazon-maintained list (amazon).
@@ -174269,10 +177420,9 @@ type Snapshot struct {
State *string `locationName:"status" type:"string" enum:"SnapshotState"`
// Encrypted Amazon EBS snapshots are copied asynchronously. If a snapshot copy
- // operation fails (for example, if the proper Key Management Service (KMS)
- // permissions are not obtained) this field displays error state details to
- // help you diagnose why the error occurred. This parameter is only returned
- // by DescribeSnapshots.
+ // operation fails (for example, if the proper KMS permissions are not obtained)
+ // this field displays error state details to help you diagnose why the error
+ // occurred. This parameter is only returned by DescribeSnapshots.
StateMessage *string `locationName:"statusMessage" type:"string"`
// The storage tier in which the snapshot is stored. standard indicates that
@@ -174614,8 +177764,8 @@ type SnapshotInfo struct {
Encrypted *bool `locationName:"encrypted" type:"boolean"`
// The ARN of the Outpost on which the snapshot is stored. For more information,
- // see Amazon EBS local snapshots on Outposts (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshots-outposts.html)
- // in the Amazon Elastic Compute Cloud User Guide.
+ // see Amazon EBS local snapshots on Outposts (https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html)
+ // in the Amazon EBS User Guide.
OutpostArn *string `locationName:"outpostArn" type:"string"`
// Account id used when creating this snapshot.
@@ -175071,7 +178221,7 @@ func (s *SnapshotTierStatus) SetVolumeId(v string) *SnapshotTierStatus {
// The Spot Instance replacement strategy to use when Amazon EC2 emits a signal
// that your Spot Instance is at an elevated risk of being interrupted. For
// more information, see Capacity rebalancing (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-capacity-rebalance.html)
-// in the Amazon EC2 User Guide for Linux Instances.
+// in the Amazon EC2 User Guide.
type SpotCapacityRebalance struct {
_ struct{} `type:"structure"`
@@ -175248,11 +178398,11 @@ type SpotFleetLaunchSpecification struct {
// Enable or disable monitoring for the instances.
Monitoring *SpotFleetMonitoring `locationName:"monitoring" type:"structure"`
- // One or more network interfaces. If you specify a network interface, you must
- // specify subnet IDs and security group IDs using the network interface.
+ // The network interfaces.
//
- // SpotFleetLaunchSpecification currently does not support Elastic Fabric Adapter
- // (EFA). To specify an EFA, you must use LaunchTemplateConfig (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_LaunchTemplateConfig.html).
+ // SpotFleetLaunchSpecification does not support Elastic Fabric Adapter (EFA).
+ // You must use LaunchTemplateConfig (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_LaunchTemplateConfig.html)
+ // instead.
NetworkInterfaces []*InstanceNetworkInterfaceSpecification `locationName:"networkInterfaceSet" locationNameList:"item" type:"list"`
// The placement information.
@@ -175265,6 +178415,9 @@ type SpotFleetLaunchSpecification struct {
RamdiskId *string `locationName:"ramdiskId" type:"string"`
// The security groups.
+ //
+ // If you specify a network interface, you must specify any security groups
+ // as part of the network interface instead of using this parameter.
SecurityGroups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"`
// The maximum price per unit hour that you are willing to pay for a Spot Instance.
@@ -175279,6 +178432,9 @@ type SpotFleetLaunchSpecification struct {
// The IDs of the subnets in which to launch the instances. To specify multiple
// subnets, separate them using commas; for example, "subnet-1234abcdeexample1,
// subnet-0987cdef6example2".
+ //
+ // If you specify a network interface, you must specify any subnets as part
+ // of the network interface instead of using this parameter.
SubnetId *string `locationName:"subnetId" type:"string"`
// The tags to apply during creation.
@@ -175299,6 +178455,12 @@ type SpotFleetLaunchSpecification struct {
// If the target capacity divided by this value is not a whole number, Amazon
// EC2 rounds the number of instances to the next whole number. If this value
// is not specified, the default is 1.
+ //
+ // When specifying weights, the price used in the lowestPrice and priceCapacityOptimized
+ // allocation strategies is per unit hour (where the instance price is divided
+ // by the specified weight). However, if all the specified weights are above
+ // the requested TargetCapacity, resulting in only 1 instance being launched,
+ // the price used is per instance hour.
WeightedCapacity *float64 `locationName:"weightedCapacity" type:"double"`
}
@@ -175585,7 +178747,10 @@ type SpotFleetRequestConfigData struct {
// Spot Fleet requests instances from all of the Spot Instance pools that you
// specify.
//
- // lowestPrice
+ // lowestPrice (not recommended)
+ //
+ // We don't recommend the lowestPrice allocation strategy because it has the
+ // highest risk of interruption for your Spot Instances.
//
// Spot Fleet requests instances from the lowest priced Spot Instance pool that
// has available capacity. If the lowest priced pool doesn't have available
@@ -175652,6 +178817,10 @@ type SpotFleetRequestConfigData struct {
// The launch specifications for the Spot Fleet request. If you specify LaunchSpecifications,
// you can't specify LaunchTemplateConfigs. If you include On-Demand capacity
// in your request, you must use LaunchTemplateConfigs.
+ //
+ // If an AMI specified in a launch specification is deregistered or disabled,
+ // no new instances can be launched from the AMI. For fleets of type maintain,
+ // the target capacity will not be maintained.
LaunchSpecifications []*SpotFleetLaunchSpecification `locationName:"launchSpecifications" locationNameList:"item" type:"list"`
// The launch template and overrides. If you specify LaunchTemplateConfigs,
@@ -175695,7 +178864,7 @@ type SpotFleetRequestConfigData struct {
// for surplus credits, and, if you use surplus credits, your final cost might
// be higher than what you specified for onDemandMaxTotalPrice. For more information,
// see Surplus credits can incur charges (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances-unlimited-mode-concepts.html#unlimited-mode-surplus-credits)
- // in the EC2 User Guide.
+ // in the Amazon EC2 User Guide.
OnDemandMaxTotalPrice *string `locationName:"onDemandMaxTotalPrice" type:"string"`
// The number of On-Demand units to request. You can choose to set the target
@@ -175727,7 +178896,7 @@ type SpotFleetRequestConfigData struct {
// surplus credits, and, if you use surplus credits, your final cost might be
// higher than what you specified for spotMaxTotalPrice. For more information,
// see Surplus credits can incur charges (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances-unlimited-mode-concepts.html#unlimited-mode-surplus-credits)
- // in the EC2 User Guide.
+ // in the Amazon EC2 User Guide.
SpotMaxTotalPrice *string `locationName:"spotMaxTotalPrice" type:"string"`
// The maximum price per unit hour that you are willing to pay for a Spot Instance.
@@ -176094,7 +179263,7 @@ type SpotInstanceRequest struct {
// The state of the Spot Instance request. Spot request status information helps
// track your Spot Instance requests. For more information, see Spot request
// status (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-request-status.html)
- // in the Amazon EC2 User Guide for Linux Instances.
+ // in the Amazon EC2 User Guide.
State *string `locationName:"state" type:"string" enum:"SpotInstanceState"`
// The status code and status message describing the Spot Instance request.
@@ -176302,7 +179471,7 @@ type SpotInstanceStatus struct {
// The status code. For a list of status codes, see Spot request status codes
// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-request-status.html#spot-instance-request-status-understand)
- // in the Amazon EC2 User Guide for Linux Instances.
+ // in the Amazon EC2 User Guide.
Code *string `locationName:"code" type:"string"`
// The description for the status code.
@@ -176357,7 +179526,7 @@ type SpotMaintenanceStrategies struct {
// The Spot Instance replacement strategy to use when Amazon EC2 emits a signal
// that your Spot Instance is at an elevated risk of being interrupted. For
// more information, see Capacity rebalancing (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-capacity-rebalance.html)
- // in the Amazon EC2 User Guide for Linux Instances.
+ // in the Amazon EC2 User Guide.
CapacityRebalance *SpotCapacityRebalance `locationName:"capacityRebalance" type:"structure"`
}
@@ -176516,7 +179685,10 @@ type SpotOptions struct {
// EC2 Fleet requests instances from all of the Spot Instance pools that you
// specify.
//
- // lowest-price
+ // lowest-price (not recommended)
+ //
+ // We don't recommend the lowest-price allocation strategy because it has the
+ // highest risk of interruption for your Spot Instances.
//
// EC2 Fleet requests instances from the lowest priced Spot Instance pool that
// has available capacity. If the lowest priced pool doesn't have available
@@ -176569,13 +179741,13 @@ type SpotOptions struct {
// credits, and, if you use surplus credits, your final cost might be higher
// than what you specified for maxTotalPrice. For more information, see Surplus
// credits can incur charges (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances-unlimited-mode-concepts.html#unlimited-mode-surplus-credits)
- // in the EC2 User Guide.
+ // in the Amazon EC2 User Guide.
MaxTotalPrice *string `locationName:"maxTotalPrice" type:"string"`
- // The minimum target capacity for Spot Instances in the fleet. If the minimum
- // target capacity is not reached, the fleet launches no instances.
+ // The minimum target capacity for Spot Instances in the fleet. If this minimum
+ // capacity isn't reached, no instances are launched.
//
- // Supported only for fleets of type instant.
+ // Constraints: Maximum value of 1000. Supported only for fleets of type instant.
//
// At least one of the following must be specified: SingleAvailabilityZone |
// SingleInstanceType
@@ -176696,7 +179868,10 @@ type SpotOptionsRequest struct {
// EC2 Fleet requests instances from all of the Spot Instance pools that you
// specify.
//
- // lowest-price
+ // lowest-price (not recommended)
+ //
+ // We don't recommend the lowest-price allocation strategy because it has the
+ // highest risk of interruption for your Spot Instances.
//
// EC2 Fleet requests instances from the lowest priced Spot Instance pool that
// has available capacity. If the lowest priced pool doesn't have available
@@ -176749,13 +179924,13 @@ type SpotOptionsRequest struct {
// credits, and, if you use surplus credits, your final cost might be higher
// than what you specified for MaxTotalPrice. For more information, see Surplus
// credits can incur charges (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances-unlimited-mode-concepts.html#unlimited-mode-surplus-credits)
- // in the EC2 User Guide.
+ // in the Amazon EC2 User Guide.
MaxTotalPrice *string `type:"string"`
- // The minimum target capacity for Spot Instances in the fleet. If the minimum
- // target capacity is not reached, the fleet launches no instances.
+ // The minimum target capacity for Spot Instances in the fleet. If this minimum
+ // capacity isn't reached, no instances are launched.
//
- // Supported only for fleets of type instant.
+ // Constraints: Maximum value of 1000. Supported only for fleets of type instant.
//
// At least one of the following must be specified: SingleAvailabilityZone |
// SingleInstanceType
@@ -177034,11 +180209,11 @@ func (s *SpotPrice) SetTimestamp(v time.Time) *SpotPrice {
type StaleIpPermission struct {
_ struct{} `type:"structure"`
- // The start of the port range for the TCP and UDP protocols, or an ICMP type
- // number. A value of -1 indicates all ICMP types.
+ // If the protocol is TCP or UDP, this is the start of the port range. If the
+ // protocol is ICMP or ICMPv6, this is the ICMP type or -1 (all ICMP types).
FromPort *int64 `locationName:"fromPort" type:"integer"`
- // The IP protocol name (for tcp, udp, and icmp) or number (see Protocol Numbers)
+ // The IP protocol name (tcp, udp, icmp, icmpv6) or number (see Protocol Numbers)
// (http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml).
IpProtocol *string `locationName:"ipProtocol" type:"string"`
@@ -177048,8 +180223,8 @@ type StaleIpPermission struct {
// The prefix list IDs. Not applicable for stale security group rules.
PrefixListIds []*string `locationName:"prefixListIds" locationNameList:"item" type:"list"`
- // The end of the port range for the TCP and UDP protocols, or an ICMP type
- // number. A value of -1 indicates all ICMP types.
+ // If the protocol is TCP or UDP, this is the end of the port range. If the
+ // protocol is ICMP or ICMPv6, this is the ICMP code or -1 (all ICMP codes).
ToPort *int64 `locationName:"toPort" type:"integer"`
// The security group pairs. Returns the ID of the referenced security group
@@ -177290,7 +180465,7 @@ type StartNetworkInsightsAccessScopeAnalysisInput struct {
_ struct{} `type:"structure"`
// Unique, case-sensitive identifier that you provide to ensure the idempotency
- // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// Checks whether you have the required permissions for the action, without
@@ -177401,7 +180576,7 @@ type StartNetworkInsightsAnalysisInput struct {
AdditionalAccounts []*string `locationName:"AdditionalAccount" locationNameList:"item" type:"list"`
// Unique, case-sensitive identifier that you provide to ensure the idempotency
- // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// Checks whether you have the required permissions for the action, without
@@ -178014,6 +181189,11 @@ type Subnet struct {
// Indicates whether instances launched in this subnet receive a public IPv4
// address.
+ //
+ // Amazon Web Services charges for all public IPv4 addresses, including public
+ // IPv4 addresses associated with running instances and Elastic IP addresses.
+ // For more information, see the Public IPv4 Address tab on the Amazon VPC pricing
+ // page (http://aws.amazon.com/vpc/pricing/).
MapPublicIpOnLaunch *bool `locationName:"mapPublicIpOnLaunch" type:"boolean"`
// The Amazon Resource Name (ARN) of the Outpost.
@@ -179764,6 +182944,9 @@ type TrafficMirrorFilterRule struct {
// The source port range assigned to the Traffic Mirror rule.
SourcePortRange *TrafficMirrorPortRange `locationName:"sourcePortRange" type:"structure"`
+ // Tags on Traffic Mirroring filter rules.
+ Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"`
+
// The traffic direction assigned to the Traffic Mirror rule.
TrafficDirection *string `locationName:"trafficDirection" type:"string" enum:"TrafficDirection"`
@@ -179840,6 +183023,12 @@ func (s *TrafficMirrorFilterRule) SetSourcePortRange(v *TrafficMirrorPortRange)
return s
}
+// SetTags sets the Tags field's value.
+func (s *TrafficMirrorFilterRule) SetTags(v []*Tag) *TrafficMirrorFilterRule {
+ s.Tags = v
+ return s
+}
+
// SetTrafficDirection sets the TrafficDirection field's value.
func (s *TrafficMirrorFilterRule) SetTrafficDirection(v string) *TrafficMirrorFilterRule {
s.TrafficDirection = &v
@@ -181533,18 +184722,16 @@ type TransitGatewayOptions struct {
// The ID of the default propagation route table.
PropagationDefaultRouteTableId *string `locationName:"propagationDefaultRouteTableId" type:"string"`
+ //
+ // This parameter is in preview and may not be available for your account.
+ //
// Enables you to reference a security group across VPCs attached to a transit
- // gateway (TGW). Use this option to simplify security group management and
- // control of instance-to-instance traffic across VPCs that are connected by
- // transit gateway. You can also use this option to migrate from VPC peering
- // (which was the only option that supported security group referencing) to
- // transit gateways (which now also support security group referencing). This
- // option is disabled by default and there are no additional costs to use this
- // feature.
- //
- // For important information about this feature, see Create a transit gateway
- // (https://docs.aws.amazon.com/vpc/latest/tgw/tgw-transit-gateways.html#create-tgw)
- // in the Amazon Web Services Transit Gateway Guide.
+ // gateway. Use this option to simplify security group management and control
+ // of instance-to-instance traffic across VPCs that are connected by transit
+ // gateway. You can also use this option to migrate from VPC peering (which
+ // was the only option that supported security group referencing) to transit
+ // gateways (which now also support security group referencing). This option
+ // is disabled by default and there are no additional costs to use this feature.
SecurityGroupReferencingSupport *string `locationName:"securityGroupReferencingSupport" type:"string" enum:"SecurityGroupReferencingSupportValue"`
// The transit gateway CIDR blocks.
@@ -182313,18 +185500,16 @@ type TransitGatewayRequestOptions struct {
// Indicates whether multicast is enabled on the transit gateway
MulticastSupport *string `type:"string" enum:"MulticastSupportValue"`
+ //
+ // This parameter is in preview and may not be available for your account.
+ //
// Enables you to reference a security group across VPCs attached to a transit
- // gateway (TGW). Use this option to simplify security group management and
- // control of instance-to-instance traffic across VPCs that are connected by
- // transit gateway. You can also use this option to migrate from VPC peering
- // (which was the only option that supported security group referencing) to
- // transit gateways (which now also support security group referencing). This
- // option is disabled by default and there are no additional costs to use this
- // feature.
- //
- // For important information about this feature, see Create a transit gateway
- // (https://docs.aws.amazon.com/vpc/latest/tgw/tgw-transit-gateways.html#create-tgw)
- // in the Amazon Web Services Transit Gateway Guide.
+ // gateway. Use this option to simplify security group management and control
+ // of instance-to-instance traffic across VPCs that are connected by transit
+ // gateway. You can also use this option to migrate from VPC peering (which
+ // was the only option that supported security group referencing) to transit
+ // gateways (which now also support security group referencing). This option
+ // is disabled by default and there are no additional costs to use this feature.
SecurityGroupReferencingSupport *string `type:"string" enum:"SecurityGroupReferencingSupportValue"`
// One or more IPv4 or IPv6 CIDR blocks for the transit gateway. Must be a size
@@ -183080,9 +186265,16 @@ type TransitGatewayVpcAttachmentOptions struct {
// Indicates whether IPv6 support is disabled.
Ipv6Support *string `locationName:"ipv6Support" type:"string" enum:"Ipv6SupportValue"`
- // For important information about this feature, see Create a transit gateway
- // attachment to a VPC (https://docs.aws.amazon.com/vpc/latest/tgw/tgw-vpc-attachments.html#create-vpc-attachment)
- // in the Amazon Web Services Transit Gateway Guide.
+ //
+ // This parameter is in preview and may not be available for your account.
+ //
+ // Enables you to reference a security group across VPCs attached to a transit
+ // gateway. Use this option to simplify security group management and control
+ // of instance-to-instance traffic across VPCs that are connected by transit
+ // gateway. You can also use this option to migrate from VPC peering (which
+ // was the only option that supported security group referencing) to transit
+ // gateways (which now also support security group referencing). This option
+ // is disabled by default and there are no additional costs to use this feature.
SecurityGroupReferencingSupport *string `locationName:"securityGroupReferencingSupport" type:"string" enum:"SecurityGroupReferencingSupportValue"`
}
@@ -186306,6 +189498,9 @@ func (s *VgwTelemetry) SetStatusMessage(v string) *VgwTelemetry {
type Volume struct {
_ struct{} `type:"structure"`
+ //
+ // This parameter is not returned by CreateVolume.
+ //
// Information about the volume attachments.
Attachments []*VolumeAttachment `locationName:"attachmentSet" locationNameList:"item" type:"list"`
@@ -186318,6 +189513,9 @@ type Volume struct {
// Indicates whether the volume is encrypted.
Encrypted *bool `locationName:"encrypted" type:"boolean"`
+ //
+ // This parameter is not returned by CreateVolume.
+ //
// Indicates whether the volume was created using fast snapshot restore.
FastRestored *bool `locationName:"fastRestored" type:"boolean"`
@@ -186327,8 +189525,8 @@ type Volume struct {
// rate at which the volume accumulates I/O credits for bursting.
Iops *int64 `locationName:"iops" type:"integer"`
- // The Amazon Resource Name (ARN) of the Key Management Service (KMS) KMS key
- // that was used to protect the volume encryption key for the volume.
+ // The Amazon Resource Name (ARN) of the KMS key that was used to protect the
+ // volume encryption key for the volume.
KmsKeyId *string `locationName:"kmsKeyId" type:"string"`
// Indicates whether Amazon EBS Multi-Attach is enabled.
@@ -186343,6 +189541,9 @@ type Volume struct {
// The snapshot from which the volume was created, if applicable.
SnapshotId *string `locationName:"snapshotId" type:"string"`
+ //
+ // This parameter is not returned by CreateVolume.
+ //
// Reserved for future use.
SseType *string `locationName:"sseType" type:"string" enum:"SSEType"`
@@ -186633,16 +189834,13 @@ func (s *VolumeDetail) SetSize(v int64) *VolumeDetail {
}
// Describes the modification status of an EBS volume.
-//
-// If the volume has never been modified, some element values will be null.
type VolumeModification struct {
_ struct{} `type:"structure"`
// The modification completion or failure time.
EndTime *time.Time `locationName:"endTime" type:"timestamp"`
- // The current modification state. The modification state is null for unmodified
- // volumes.
+ // The current modification state.
ModificationState *string `locationName:"modificationState" type:"string" enum:"VolumeModificationState"`
// The original IOPS rate of the volume.
@@ -188884,7 +192082,7 @@ type VpnTunnelOptionsSpecification struct {
//
// Constraints: A value between 60 and half of Phase2LifetimeSeconds.
//
- // Default: 540
+ // Default: 270
RekeyMarginTimeSeconds *int64 `type:"integer"`
// The number of packets in an IKE replay window.
@@ -189772,6 +192970,9 @@ const (
// AvailabilityZoneStateUnavailable is a AvailabilityZoneState enum value
AvailabilityZoneStateUnavailable = "unavailable"
+
+ // AvailabilityZoneStateConstrained is a AvailabilityZoneState enum value
+ AvailabilityZoneStateConstrained = "constrained"
)
// AvailabilityZoneState_Values returns all elements of the AvailabilityZoneState enum
@@ -189781,6 +192982,7 @@ func AvailabilityZoneState_Values() []string {
AvailabilityZoneStateInformation,
AvailabilityZoneStateImpaired,
AvailabilityZoneStateUnavailable,
+ AvailabilityZoneStateConstrained,
}
}
@@ -190564,6 +193766,46 @@ func DatafeedSubscriptionState_Values() []string {
}
}
+const (
+ // DefaultInstanceMetadataEndpointStateDisabled is a DefaultInstanceMetadataEndpointState enum value
+ DefaultInstanceMetadataEndpointStateDisabled = "disabled"
+
+ // DefaultInstanceMetadataEndpointStateEnabled is a DefaultInstanceMetadataEndpointState enum value
+ DefaultInstanceMetadataEndpointStateEnabled = "enabled"
+
+ // DefaultInstanceMetadataEndpointStateNoPreference is a DefaultInstanceMetadataEndpointState enum value
+ DefaultInstanceMetadataEndpointStateNoPreference = "no-preference"
+)
+
+// DefaultInstanceMetadataEndpointState_Values returns all elements of the DefaultInstanceMetadataEndpointState enum
+func DefaultInstanceMetadataEndpointState_Values() []string {
+ return []string{
+ DefaultInstanceMetadataEndpointStateDisabled,
+ DefaultInstanceMetadataEndpointStateEnabled,
+ DefaultInstanceMetadataEndpointStateNoPreference,
+ }
+}
+
+const (
+ // DefaultInstanceMetadataTagsStateDisabled is a DefaultInstanceMetadataTagsState enum value
+ DefaultInstanceMetadataTagsStateDisabled = "disabled"
+
+ // DefaultInstanceMetadataTagsStateEnabled is a DefaultInstanceMetadataTagsState enum value
+ DefaultInstanceMetadataTagsStateEnabled = "enabled"
+
+ // DefaultInstanceMetadataTagsStateNoPreference is a DefaultInstanceMetadataTagsState enum value
+ DefaultInstanceMetadataTagsStateNoPreference = "no-preference"
+)
+
+// DefaultInstanceMetadataTagsState_Values returns all elements of the DefaultInstanceMetadataTagsState enum
+func DefaultInstanceMetadataTagsState_Values() []string {
+ return []string{
+ DefaultInstanceMetadataTagsStateDisabled,
+ DefaultInstanceMetadataTagsStateEnabled,
+ DefaultInstanceMetadataTagsStateNoPreference,
+ }
+}
+
const (
// DefaultRouteTableAssociationValueEnable is a DefaultRouteTableAssociationValue enum value
DefaultRouteTableAssociationValueEnable = "enable"
@@ -190928,6 +194170,38 @@ func Ec2InstanceConnectEndpointState_Values() []string {
}
}
+const (
+ // EkPubKeyFormatDer is a EkPubKeyFormat enum value
+ EkPubKeyFormatDer = "der"
+
+ // EkPubKeyFormatTpmt is a EkPubKeyFormat enum value
+ EkPubKeyFormatTpmt = "tpmt"
+)
+
+// EkPubKeyFormat_Values returns all elements of the EkPubKeyFormat enum
+func EkPubKeyFormat_Values() []string {
+ return []string{
+ EkPubKeyFormatDer,
+ EkPubKeyFormatTpmt,
+ }
+}
+
+const (
+ // EkPubKeyTypeRsa2048 is a EkPubKeyType enum value
+ EkPubKeyTypeRsa2048 = "rsa-2048"
+
+ // EkPubKeyTypeEccSecP384 is a EkPubKeyType enum value
+ EkPubKeyTypeEccSecP384 = "ecc-sec-p384"
+)
+
+// EkPubKeyType_Values returns all elements of the EkPubKeyType enum
+func EkPubKeyType_Values() []string {
+ return []string{
+ EkPubKeyTypeRsa2048,
+ EkPubKeyTypeEccSecP384,
+ }
+}
+
const (
// ElasticGpuStateAttached is a ElasticGpuState enum value
ElasticGpuStateAttached = "ATTACHED"
@@ -191545,6 +194819,9 @@ func HostRecovery_Values() []string {
}
const (
+ // HostTenancyDefault is a HostTenancy enum value
+ HostTenancyDefault = "default"
+
// HostTenancyDedicated is a HostTenancy enum value
HostTenancyDedicated = "dedicated"
@@ -191555,6 +194832,7 @@ const (
// HostTenancy_Values returns all elements of the HostTenancy enum
func HostTenancy_Values() []string {
return []string{
+ HostTenancyDefault,
HostTenancyDedicated,
HostTenancyHost,
}
@@ -191684,6 +194962,9 @@ const (
// ImageAttributeNameImdsSupport is a ImageAttributeName enum value
ImageAttributeNameImdsSupport = "imdsSupport"
+
+ // ImageAttributeNameDeregistrationProtection is a ImageAttributeName enum value
+ ImageAttributeNameDeregistrationProtection = "deregistrationProtection"
)
// ImageAttributeName_Values returns all elements of the ImageAttributeName enum
@@ -191701,6 +194982,7 @@ func ImageAttributeName_Values() []string {
ImageAttributeNameUefiData,
ImageAttributeNameLastLaunchedTime,
ImageAttributeNameImdsSupport,
+ ImageAttributeNameDeregistrationProtection,
}
}
@@ -194493,6 +197775,117 @@ const (
// InstanceTypeR7izMetal32xl is a InstanceType enum value
InstanceTypeR7izMetal32xl = "r7iz.metal-32xl"
+
+ // InstanceTypeC7gdMetal is a InstanceType enum value
+ InstanceTypeC7gdMetal = "c7gd.metal"
+
+ // InstanceTypeM7gdMetal is a InstanceType enum value
+ InstanceTypeM7gdMetal = "m7gd.metal"
+
+ // InstanceTypeR7gdMetal is a InstanceType enum value
+ InstanceTypeR7gdMetal = "r7gd.metal"
+
+ // InstanceTypeG6Xlarge is a InstanceType enum value
+ InstanceTypeG6Xlarge = "g6.xlarge"
+
+ // InstanceTypeG62xlarge is a InstanceType enum value
+ InstanceTypeG62xlarge = "g6.2xlarge"
+
+ // InstanceTypeG64xlarge is a InstanceType enum value
+ InstanceTypeG64xlarge = "g6.4xlarge"
+
+ // InstanceTypeG68xlarge is a InstanceType enum value
+ InstanceTypeG68xlarge = "g6.8xlarge"
+
+ // InstanceTypeG612xlarge is a InstanceType enum value
+ InstanceTypeG612xlarge = "g6.12xlarge"
+
+ // InstanceTypeG616xlarge is a InstanceType enum value
+ InstanceTypeG616xlarge = "g6.16xlarge"
+
+ // InstanceTypeG624xlarge is a InstanceType enum value
+ InstanceTypeG624xlarge = "g6.24xlarge"
+
+ // InstanceTypeG648xlarge is a InstanceType enum value
+ InstanceTypeG648xlarge = "g6.48xlarge"
+
+ // InstanceTypeGr64xlarge is a InstanceType enum value
+ InstanceTypeGr64xlarge = "gr6.4xlarge"
+
+ // InstanceTypeGr68xlarge is a InstanceType enum value
+ InstanceTypeGr68xlarge = "gr6.8xlarge"
+
+ // InstanceTypeC7iFlexLarge is a InstanceType enum value
+ InstanceTypeC7iFlexLarge = "c7i-flex.large"
+
+ // InstanceTypeC7iFlexXlarge is a InstanceType enum value
+ InstanceTypeC7iFlexXlarge = "c7i-flex.xlarge"
+
+ // InstanceTypeC7iFlex2xlarge is a InstanceType enum value
+ InstanceTypeC7iFlex2xlarge = "c7i-flex.2xlarge"
+
+ // InstanceTypeC7iFlex4xlarge is a InstanceType enum value
+ InstanceTypeC7iFlex4xlarge = "c7i-flex.4xlarge"
+
+ // InstanceTypeC7iFlex8xlarge is a InstanceType enum value
+ InstanceTypeC7iFlex8xlarge = "c7i-flex.8xlarge"
+
+ // InstanceTypeU7i12tb224xlarge is a InstanceType enum value
+ InstanceTypeU7i12tb224xlarge = "u7i-12tb.224xlarge"
+
+ // InstanceTypeU7in16tb224xlarge is a InstanceType enum value
+ InstanceTypeU7in16tb224xlarge = "u7in-16tb.224xlarge"
+
+ // InstanceTypeU7in24tb224xlarge is a InstanceType enum value
+ InstanceTypeU7in24tb224xlarge = "u7in-24tb.224xlarge"
+
+ // InstanceTypeU7in32tb224xlarge is a InstanceType enum value
+ InstanceTypeU7in32tb224xlarge = "u7in-32tb.224xlarge"
+
+ // InstanceTypeU7ib12tb224xlarge is a InstanceType enum value
+ InstanceTypeU7ib12tb224xlarge = "u7ib-12tb.224xlarge"
+
+ // InstanceTypeC7gnMetal is a InstanceType enum value
+ InstanceTypeC7gnMetal = "c7gn.metal"
+
+ // InstanceTypeR8gMedium is a InstanceType enum value
+ InstanceTypeR8gMedium = "r8g.medium"
+
+ // InstanceTypeR8gLarge is a InstanceType enum value
+ InstanceTypeR8gLarge = "r8g.large"
+
+ // InstanceTypeR8gXlarge is a InstanceType enum value
+ InstanceTypeR8gXlarge = "r8g.xlarge"
+
+ // InstanceTypeR8g2xlarge is a InstanceType enum value
+ InstanceTypeR8g2xlarge = "r8g.2xlarge"
+
+ // InstanceTypeR8g4xlarge is a InstanceType enum value
+ InstanceTypeR8g4xlarge = "r8g.4xlarge"
+
+ // InstanceTypeR8g8xlarge is a InstanceType enum value
+ InstanceTypeR8g8xlarge = "r8g.8xlarge"
+
+ // InstanceTypeR8g12xlarge is a InstanceType enum value
+ InstanceTypeR8g12xlarge = "r8g.12xlarge"
+
+ // InstanceTypeR8g16xlarge is a InstanceType enum value
+ InstanceTypeR8g16xlarge = "r8g.16xlarge"
+
+ // InstanceTypeR8g24xlarge is a InstanceType enum value
+ InstanceTypeR8g24xlarge = "r8g.24xlarge"
+
+ // InstanceTypeR8g48xlarge is a InstanceType enum value
+ InstanceTypeR8g48xlarge = "r8g.48xlarge"
+
+ // InstanceTypeR8gMetal24xl is a InstanceType enum value
+ InstanceTypeR8gMetal24xl = "r8g.metal-24xl"
+
+ // InstanceTypeR8gMetal48xl is a InstanceType enum value
+ InstanceTypeR8gMetal48xl = "r8g.metal-48xl"
+
+ // InstanceTypeMac2M1ultraMetal is a InstanceType enum value
+ InstanceTypeMac2M1ultraMetal = "mac2-m1ultra.metal"
)
// InstanceType_Values returns all elements of the InstanceType enum
@@ -195281,6 +198674,43 @@ func InstanceType_Values() []string {
InstanceTypeR7iMetal48xl,
InstanceTypeR7izMetal16xl,
InstanceTypeR7izMetal32xl,
+ InstanceTypeC7gdMetal,
+ InstanceTypeM7gdMetal,
+ InstanceTypeR7gdMetal,
+ InstanceTypeG6Xlarge,
+ InstanceTypeG62xlarge,
+ InstanceTypeG64xlarge,
+ InstanceTypeG68xlarge,
+ InstanceTypeG612xlarge,
+ InstanceTypeG616xlarge,
+ InstanceTypeG624xlarge,
+ InstanceTypeG648xlarge,
+ InstanceTypeGr64xlarge,
+ InstanceTypeGr68xlarge,
+ InstanceTypeC7iFlexLarge,
+ InstanceTypeC7iFlexXlarge,
+ InstanceTypeC7iFlex2xlarge,
+ InstanceTypeC7iFlex4xlarge,
+ InstanceTypeC7iFlex8xlarge,
+ InstanceTypeU7i12tb224xlarge,
+ InstanceTypeU7in16tb224xlarge,
+ InstanceTypeU7in24tb224xlarge,
+ InstanceTypeU7in32tb224xlarge,
+ InstanceTypeU7ib12tb224xlarge,
+ InstanceTypeC7gnMetal,
+ InstanceTypeR8gMedium,
+ InstanceTypeR8gLarge,
+ InstanceTypeR8gXlarge,
+ InstanceTypeR8g2xlarge,
+ InstanceTypeR8g4xlarge,
+ InstanceTypeR8g8xlarge,
+ InstanceTypeR8g12xlarge,
+ InstanceTypeR8g16xlarge,
+ InstanceTypeR8g24xlarge,
+ InstanceTypeR8g48xlarge,
+ InstanceTypeR8gMetal24xl,
+ InstanceTypeR8gMetal48xl,
+ InstanceTypeMac2M1ultraMetal,
}
}
@@ -195440,6 +198870,38 @@ func IpamDiscoveryFailureCode_Values() []string {
}
}
+const (
+ // IpamExternalResourceVerificationTokenStateCreateInProgress is a IpamExternalResourceVerificationTokenState enum value
+ IpamExternalResourceVerificationTokenStateCreateInProgress = "create-in-progress"
+
+ // IpamExternalResourceVerificationTokenStateCreateComplete is a IpamExternalResourceVerificationTokenState enum value
+ IpamExternalResourceVerificationTokenStateCreateComplete = "create-complete"
+
+ // IpamExternalResourceVerificationTokenStateCreateFailed is a IpamExternalResourceVerificationTokenState enum value
+ IpamExternalResourceVerificationTokenStateCreateFailed = "create-failed"
+
+ // IpamExternalResourceVerificationTokenStateDeleteInProgress is a IpamExternalResourceVerificationTokenState enum value
+ IpamExternalResourceVerificationTokenStateDeleteInProgress = "delete-in-progress"
+
+ // IpamExternalResourceVerificationTokenStateDeleteComplete is a IpamExternalResourceVerificationTokenState enum value
+ IpamExternalResourceVerificationTokenStateDeleteComplete = "delete-complete"
+
+ // IpamExternalResourceVerificationTokenStateDeleteFailed is a IpamExternalResourceVerificationTokenState enum value
+ IpamExternalResourceVerificationTokenStateDeleteFailed = "delete-failed"
+)
+
+// IpamExternalResourceVerificationTokenState_Values returns all elements of the IpamExternalResourceVerificationTokenState enum
+func IpamExternalResourceVerificationTokenState_Values() []string {
+ return []string{
+ IpamExternalResourceVerificationTokenStateCreateInProgress,
+ IpamExternalResourceVerificationTokenStateCreateComplete,
+ IpamExternalResourceVerificationTokenStateCreateFailed,
+ IpamExternalResourceVerificationTokenStateDeleteInProgress,
+ IpamExternalResourceVerificationTokenStateDeleteComplete,
+ IpamExternalResourceVerificationTokenStateDeleteFailed,
+ }
+}
+
const (
// IpamManagementStateManaged is a IpamManagementState enum value
IpamManagementStateManaged = "managed"
@@ -195460,6 +198922,22 @@ func IpamManagementState_Values() []string {
}
}
+const (
+ // IpamNetworkInterfaceAttachmentStatusAvailable is a IpamNetworkInterfaceAttachmentStatus enum value
+ IpamNetworkInterfaceAttachmentStatusAvailable = "available"
+
+ // IpamNetworkInterfaceAttachmentStatusInUse is a IpamNetworkInterfaceAttachmentStatus enum value
+ IpamNetworkInterfaceAttachmentStatusInUse = "in-use"
+)
+
+// IpamNetworkInterfaceAttachmentStatus_Values returns all elements of the IpamNetworkInterfaceAttachmentStatus enum
+func IpamNetworkInterfaceAttachmentStatus_Values() []string {
+ return []string{
+ IpamNetworkInterfaceAttachmentStatusAvailable,
+ IpamNetworkInterfaceAttachmentStatusInUse,
+ }
+}
+
const (
// IpamOverlapStatusOverlapping is a IpamOverlapStatus enum value
IpamOverlapStatusOverlapping = "overlapping"
@@ -196460,6 +199938,26 @@ func MembershipType_Values() []string {
}
}
+const (
+ // MetadataDefaultHttpTokensStateOptional is a MetadataDefaultHttpTokensState enum value
+ MetadataDefaultHttpTokensStateOptional = "optional"
+
+ // MetadataDefaultHttpTokensStateRequired is a MetadataDefaultHttpTokensState enum value
+ MetadataDefaultHttpTokensStateRequired = "required"
+
+ // MetadataDefaultHttpTokensStateNoPreference is a MetadataDefaultHttpTokensState enum value
+ MetadataDefaultHttpTokensStateNoPreference = "no-preference"
+)
+
+// MetadataDefaultHttpTokensState_Values returns all elements of the MetadataDefaultHttpTokensState enum
+func MetadataDefaultHttpTokensState_Values() []string {
+ return []string{
+ MetadataDefaultHttpTokensStateOptional,
+ MetadataDefaultHttpTokensStateRequired,
+ MetadataDefaultHttpTokensStateNoPreference,
+ }
+}
+
const (
// MetricTypeAggregateLatency is a MetricType enum value
MetricTypeAggregateLatency = "aggregate-latency"
@@ -196616,6 +200114,9 @@ const (
// NetworkInterfaceAttributeAttachment is a NetworkInterfaceAttribute enum value
NetworkInterfaceAttributeAttachment = "attachment"
+
+ // NetworkInterfaceAttributeAssociatePublicIpAddress is a NetworkInterfaceAttribute enum value
+ NetworkInterfaceAttributeAssociatePublicIpAddress = "associatePublicIpAddress"
)
// NetworkInterfaceAttribute_Values returns all elements of the NetworkInterfaceAttribute enum
@@ -196625,6 +200126,7 @@ func NetworkInterfaceAttribute_Values() []string {
NetworkInterfaceAttributeGroupSet,
NetworkInterfaceAttributeSourceDestCheck,
NetworkInterfaceAttributeAttachment,
+ NetworkInterfaceAttributeAssociatePublicIpAddress,
}
}
@@ -196988,6 +200490,22 @@ func PermissionGroup_Values() []string {
}
}
+const (
+ // PhcSupportUnsupported is a PhcSupport enum value
+ PhcSupportUnsupported = "unsupported"
+
+ // PhcSupportSupported is a PhcSupport enum value
+ PhcSupportSupported = "supported"
+)
+
+// PhcSupport_Values returns all elements of the PhcSupport enum
+func PhcSupport_Values() []string {
+ return []string{
+ PhcSupportUnsupported,
+ PhcSupportSupported,
+ }
+}
+
const (
// PlacementGroupStatePending is a PlacementGroupState enum value
PlacementGroupStatePending = "pending"
@@ -197678,6 +201196,9 @@ const (
// ResourceTypeInstanceConnectEndpoint is a ResourceType enum value
ResourceTypeInstanceConnectEndpoint = "instance-connect-endpoint"
+
+ // ResourceTypeIpamExternalResourceVerificationToken is a ResourceType enum value
+ ResourceTypeIpamExternalResourceVerificationToken = "ipam-external-resource-verification-token"
)
// ResourceType_Values returns all elements of the ResourceType enum
@@ -197769,6 +201290,7 @@ func ResourceType_Values() []string {
ResourceTypeIpamResourceDiscovery,
ResourceTypeIpamResourceDiscoveryAssociation,
ResourceTypeInstanceConnectEndpoint,
+ ResourceTypeIpamExternalResourceVerificationToken,
}
}
@@ -198386,6 +201908,9 @@ const (
// SubnetStateAvailable is a SubnetState enum value
SubnetStateAvailable = "available"
+
+ // SubnetStateUnavailable is a SubnetState enum value
+ SubnetStateUnavailable = "unavailable"
)
// SubnetState_Values returns all elements of the SubnetState enum
@@ -198393,6 +201918,7 @@ func SubnetState_Values() []string {
return []string{
SubnetStatePending,
SubnetStateAvailable,
+ SubnetStateUnavailable,
}
}
@@ -198548,6 +202074,22 @@ func TieringOperationStatus_Values() []string {
}
}
+const (
+ // TokenStateValid is a TokenState enum value
+ TokenStateValid = "valid"
+
+ // TokenStateExpired is a TokenState enum value
+ TokenStateExpired = "expired"
+)
+
+// TokenState_Values returns all elements of the TokenState enum
+func TokenState_Values() []string {
+ return []string{
+ TokenStateValid,
+ TokenStateExpired,
+ }
+}
+
const (
// TpmSupportValuesV20 is a TpmSupportValues enum value
TpmSupportValuesV20 = "v2.0"
@@ -199236,6 +202778,22 @@ func UserTrustProviderType_Values() []string {
}
}
+const (
+ // VerificationMethodRemarksX509 is a VerificationMethod enum value
+ VerificationMethodRemarksX509 = "remarks-x509"
+
+ // VerificationMethodDnsToken is a VerificationMethod enum value
+ VerificationMethodDnsToken = "dns-token"
+)
+
+// VerificationMethod_Values returns all elements of the VerificationMethod enum
+func VerificationMethod_Values() []string {
+ return []string{
+ VerificationMethodRemarksX509,
+ VerificationMethodDnsToken,
+ }
+}
+
const (
// VerifiedAccessEndpointAttachmentTypeVpc is a VerifiedAccessEndpointAttachmentType enum value
VerifiedAccessEndpointAttachmentTypeVpc = "vpc"
diff --git a/vendor/github.com/aws/aws-sdk-go/service/ec2/doc.go b/vendor/github.com/aws/aws-sdk-go/service/ec2/doc.go
index 770e43bd..7cd39176 100644
--- a/vendor/github.com/aws/aws-sdk-go/service/ec2/doc.go
+++ b/vendor/github.com/aws/aws-sdk-go/service/ec2/doc.go
@@ -3,30 +3,9 @@
// Package ec2 provides the client and types for making API
// requests to Amazon Elastic Compute Cloud.
//
-// Amazon Elastic Compute Cloud (Amazon EC2) provides secure and resizable computing
-// capacity in the Amazon Web Services Cloud. Using Amazon EC2 eliminates the
-// need to invest in hardware up front, so you can develop and deploy applications
-// faster. Amazon Virtual Private Cloud (Amazon VPC) enables you to provision
-// a logically isolated section of the Amazon Web Services Cloud where you can
-// launch Amazon Web Services resources in a virtual network that you've defined.
-// Amazon Elastic Block Store (Amazon EBS) provides block level storage volumes
-// for use with EC2 instances. EBS volumes are highly available and reliable
-// storage volumes that can be attached to any running instance and used like
-// a hard drive.
-//
-// To learn more, see the following resources:
-//
-// - Amazon EC2: Amazon EC2 product page (http://aws.amazon.com/ec2), Amazon
-// EC2 documentation (https://docs.aws.amazon.com/ec2/index.html)
-//
-// - Amazon EBS: Amazon EBS product page (http://aws.amazon.com/ebs), Amazon
-// EBS documentation (https://docs.aws.amazon.com/ebs/index.html)
-//
-// - Amazon VPC: Amazon VPC product page (http://aws.amazon.com/vpc), Amazon
-// VPC documentation (https://docs.aws.amazon.com/vpc/index.html)
-//
-// - VPN: VPN product page (http://aws.amazon.com/vpn), VPN documentation
-// (https://docs.aws.amazon.com/vpn/index.html)
+// You can access the features of Amazon Elastic Compute Cloud (Amazon EC2)
+// programmatically. For more information, see the Amazon EC2 Developer Guide
+// (https://docs.aws.amazon.com/ec2/latest/devguide).
//
// See https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15 for more information on this service.
//
diff --git a/vendor/github.com/aws/aws-sdk-go/service/ssooidc/api.go b/vendor/github.com/aws/aws-sdk-go/service/ssooidc/api.go
index 04f6c811..827bd519 100644
--- a/vendor/github.com/aws/aws-sdk-go/service/ssooidc/api.go
+++ b/vendor/github.com/aws/aws-sdk-go/service/ssooidc/api.go
@@ -179,8 +179,8 @@ func (c *SSOOIDC) CreateTokenWithIAMRequest(input *CreateTokenWithIAMInput) (req
//
// Creates and returns access and refresh tokens for clients and applications
// that are authenticated using IAM entities. The access token can be used to
-// fetch short-term credentials for the assigned AWS accounts or to access application
-// APIs using bearer authentication.
+// fetch short-term credentials for the assigned Amazon Web Services accounts
+// or to access application APIs using bearer authentication.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
@@ -331,6 +331,13 @@ func (c *SSOOIDC) RegisterClientRequest(input *RegisterClientInput) (req *reques
// Indicates that an error from the service occurred while trying to process
// a request.
//
+// - InvalidRedirectUriException
+// Indicates that one or more redirect URI in the request is not supported for
+// this operation.
+//
+// - UnsupportedGrantTypeException
+// Indicates that the grant type in the request is not supported by the service.
+//
// See also, https://docs.aws.amazon.com/goto/WebAPI/sso-oidc-2019-06-10/RegisterClient
func (c *SSOOIDC) RegisterClient(input *RegisterClientInput) (*RegisterClientOutput, error) {
req, out := c.RegisterClientRequest(input)
@@ -619,6 +626,15 @@ type CreateTokenInput struct {
// type is currently unsupported for the CreateToken API.
Code *string `locationName:"code" type:"string"`
+ // Used only when calling this API for the Authorization Code grant type. This
+ // value is generated by the client and presented to validate the original code
+ // challenge value the client passed at authorization time.
+ //
+ // CodeVerifier is a sensitive parameter and its value will be
+ // replaced with "sensitive" in string returned by CreateTokenInput's
+ // String and GoString methods.
+ CodeVerifier *string `locationName:"codeVerifier" type:"string" sensitive:"true"`
+
// Used only when calling this API for the Device Code grant type. This short-term
// code is used to identify this authorization request. This comes from the
// result of the StartDeviceAuthorization API.
@@ -718,6 +734,12 @@ func (s *CreateTokenInput) SetCode(v string) *CreateTokenInput {
return s
}
+// SetCodeVerifier sets the CodeVerifier field's value.
+func (s *CreateTokenInput) SetCodeVerifier(v string) *CreateTokenInput {
+ s.CodeVerifier = &v
+ return s
+}
+
// SetDeviceCode sets the DeviceCode field's value.
func (s *CreateTokenInput) SetDeviceCode(v string) *CreateTokenInput {
s.DeviceCode = &v
@@ -751,7 +773,8 @@ func (s *CreateTokenInput) SetScope(v []*string) *CreateTokenInput {
type CreateTokenOutput struct {
_ struct{} `type:"structure"`
- // A bearer token to access AWS accounts and applications assigned to a user.
+ // A bearer token to access Amazon Web Services accounts and applications assigned
+ // to a user.
//
// AccessToken is a sensitive parameter and its value will be
// replaced with "sensitive" in string returned by CreateTokenOutput's
@@ -863,6 +886,15 @@ type CreateTokenWithIAMInput struct {
// persisted in the Authorization Code GrantOptions for the application.
Code *string `locationName:"code" type:"string"`
+ // Used only when calling this API for the Authorization Code grant type. This
+ // value is generated by the client and presented to validate the original code
+ // challenge value the client passed at authorization time.
+ //
+ // CodeVerifier is a sensitive parameter and its value will be
+ // replaced with "sensitive" in string returned by CreateTokenWithIAMInput's
+ // String and GoString methods.
+ CodeVerifier *string `locationName:"codeVerifier" type:"string" sensitive:"true"`
+
// Supports the following OAuth grant types: Authorization Code, Refresh Token,
// JWT Bearer, and Token Exchange. Specify one of the following values, depending
// on the grant type that you want:
@@ -982,6 +1014,12 @@ func (s *CreateTokenWithIAMInput) SetCode(v string) *CreateTokenWithIAMInput {
return s
}
+// SetCodeVerifier sets the CodeVerifier field's value.
+func (s *CreateTokenWithIAMInput) SetCodeVerifier(v string) *CreateTokenWithIAMInput {
+ s.CodeVerifier = &v
+ return s
+}
+
// SetGrantType sets the GrantType field's value.
func (s *CreateTokenWithIAMInput) SetGrantType(v string) *CreateTokenWithIAMInput {
s.GrantType = &v
@@ -1027,7 +1065,8 @@ func (s *CreateTokenWithIAMInput) SetSubjectTokenType(v string) *CreateTokenWith
type CreateTokenWithIAMOutput struct {
_ struct{} `type:"structure"`
- // A bearer token to access AWS accounts and applications assigned to a user.
+ // A bearer token to access Amazon Web Services accounts and applications assigned
+ // to a user.
//
// AccessToken is a sensitive parameter and its value will be
// replaced with "sensitive" in string returned by CreateTokenWithIAMOutput's
@@ -1495,6 +1534,78 @@ func (s *InvalidGrantException) RequestID() string {
return s.RespMetadata.RequestID
}
+// Indicates that one or more redirect URI in the request is not supported for
+// this operation.
+type InvalidRedirectUriException struct {
+ _ struct{} `type:"structure"`
+ RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
+
+ // Single error code. For this exception the value will be invalid_redirect_uri.
+ Error_ *string `locationName:"error" type:"string"`
+
+ // Human-readable text providing additional information, used to assist the
+ // client developer in understanding the error that occurred.
+ Error_description *string `locationName:"error_description" type:"string"`
+
+ Message_ *string `locationName:"message" type:"string"`
+}
+
+// String returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s InvalidRedirectUriException) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation.
+//
+// API parameter values that are decorated as "sensitive" in the API will not
+// be included in the string output. The member name will be present, but the
+// value will be replaced with "sensitive".
+func (s InvalidRedirectUriException) GoString() string {
+ return s.String()
+}
+
+func newErrorInvalidRedirectUriException(v protocol.ResponseMetadata) error {
+ return &InvalidRedirectUriException{
+ RespMetadata: v,
+ }
+}
+
+// Code returns the exception type name.
+func (s *InvalidRedirectUriException) Code() string {
+ return "InvalidRedirectUriException"
+}
+
+// Message returns the exception's message.
+func (s *InvalidRedirectUriException) Message() string {
+ if s.Message_ != nil {
+ return *s.Message_
+ }
+ return ""
+}
+
+// OrigErr always returns nil, satisfies awserr.Error interface.
+func (s *InvalidRedirectUriException) OrigErr() error {
+ return nil
+}
+
+func (s *InvalidRedirectUriException) Error() string {
+ return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String())
+}
+
+// Status code returns the HTTP status code for the request's response error.
+func (s *InvalidRedirectUriException) StatusCode() int {
+ return s.RespMetadata.StatusCode
+}
+
+// RequestID returns the service's response RequestID for request.
+func (s *InvalidRedirectUriException) RequestID() string {
+ return s.RespMetadata.RequestID
+}
+
// Indicates that something is wrong with the input to the request. For example,
// a required parameter might be missing or out of range.
type InvalidRequestException struct {
@@ -1731,6 +1842,25 @@ type RegisterClientInput struct {
// ClientType is a required field
ClientType *string `locationName:"clientType" type:"string" required:"true"`
+ // This IAM Identity Center application ARN is used to define administrator-managed
+ // configuration for public client access to resources. At authorization, the
+ // scopes, grants, and redirect URI available to this client will be restricted
+ // by this application resource.
+ EntitledApplicationArn *string `locationName:"entitledApplicationArn" type:"string"`
+
+ // The list of OAuth 2.0 grant types that are defined by the client. This list
+ // is used to restrict the token granting flows available to the client.
+ GrantTypes []*string `locationName:"grantTypes" type:"list"`
+
+ // The IAM Identity Center Issuer URL associated with an instance of IAM Identity
+ // Center. This value is needed for user access to resources through the client.
+ IssuerUrl *string `locationName:"issuerUrl" type:"string"`
+
+ // The list of redirect URI that are defined by the client. At completion of
+ // authorization, this list is used to restrict what locations the user agent
+ // can be redirected back to.
+ RedirectUris []*string `locationName:"redirectUris" type:"list"`
+
// The list of scopes that are defined by the client. Upon authorization, this
// list is used to restrict permissions when granting an access token.
Scopes []*string `locationName:"scopes" type:"list"`
@@ -1782,6 +1912,30 @@ func (s *RegisterClientInput) SetClientType(v string) *RegisterClientInput {
return s
}
+// SetEntitledApplicationArn sets the EntitledApplicationArn field's value.
+func (s *RegisterClientInput) SetEntitledApplicationArn(v string) *RegisterClientInput {
+ s.EntitledApplicationArn = &v
+ return s
+}
+
+// SetGrantTypes sets the GrantTypes field's value.
+func (s *RegisterClientInput) SetGrantTypes(v []*string) *RegisterClientInput {
+ s.GrantTypes = v
+ return s
+}
+
+// SetIssuerUrl sets the IssuerUrl field's value.
+func (s *RegisterClientInput) SetIssuerUrl(v string) *RegisterClientInput {
+ s.IssuerUrl = &v
+ return s
+}
+
+// SetRedirectUris sets the RedirectUris field's value.
+func (s *RegisterClientInput) SetRedirectUris(v []*string) *RegisterClientInput {
+ s.RedirectUris = v
+ return s
+}
+
// SetScopes sets the Scopes field's value.
func (s *RegisterClientInput) SetScopes(v []*string) *RegisterClientInput {
s.Scopes = v
diff --git a/vendor/github.com/aws/aws-sdk-go/service/ssooidc/errors.go b/vendor/github.com/aws/aws-sdk-go/service/ssooidc/errors.go
index e6242e49..cadf4584 100644
--- a/vendor/github.com/aws/aws-sdk-go/service/ssooidc/errors.go
+++ b/vendor/github.com/aws/aws-sdk-go/service/ssooidc/errors.go
@@ -57,6 +57,13 @@ const (
// makes a CreateToken request with an invalid grant type.
ErrCodeInvalidGrantException = "InvalidGrantException"
+ // ErrCodeInvalidRedirectUriException for service response error code
+ // "InvalidRedirectUriException".
+ //
+ // Indicates that one or more redirect URI in the request is not supported for
+ // this operation.
+ ErrCodeInvalidRedirectUriException = "InvalidRedirectUriException"
+
// ErrCodeInvalidRequestException for service response error code
// "InvalidRequestException".
//
@@ -106,6 +113,7 @@ var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{
"InvalidClientException": newErrorInvalidClientException,
"InvalidClientMetadataException": newErrorInvalidClientMetadataException,
"InvalidGrantException": newErrorInvalidGrantException,
+ "InvalidRedirectUriException": newErrorInvalidRedirectUriException,
"InvalidRequestException": newErrorInvalidRequestException,
"InvalidRequestRegionException": newErrorInvalidRequestRegionException,
"InvalidScopeException": newErrorInvalidScopeException,
diff --git a/vendor/github.com/cespare/xxhash/v2/README.md b/vendor/github.com/cespare/xxhash/v2/README.md
index 8bf0e5b7..33c88305 100644
--- a/vendor/github.com/cespare/xxhash/v2/README.md
+++ b/vendor/github.com/cespare/xxhash/v2/README.md
@@ -70,3 +70,5 @@ benchstat <(go test -benchtime 500ms -count 15 -bench 'Sum64$')
- [VictoriaMetrics](https://github.com/VictoriaMetrics/VictoriaMetrics)
- [FreeCache](https://github.com/coocood/freecache)
- [FastCache](https://github.com/VictoriaMetrics/fastcache)
+- [Ristretto](https://github.com/dgraph-io/ristretto)
+- [Badger](https://github.com/dgraph-io/badger)
diff --git a/vendor/github.com/cespare/xxhash/v2/xxhash.go b/vendor/github.com/cespare/xxhash/v2/xxhash.go
index a9e0d45c..78bddf1c 100644
--- a/vendor/github.com/cespare/xxhash/v2/xxhash.go
+++ b/vendor/github.com/cespare/xxhash/v2/xxhash.go
@@ -19,10 +19,13 @@ const (
// Store the primes in an array as well.
//
// The consts are used when possible in Go code to avoid MOVs but we need a
-// contiguous array of the assembly code.
+// contiguous array for the assembly code.
var primes = [...]uint64{prime1, prime2, prime3, prime4, prime5}
// Digest implements hash.Hash64.
+//
+// Note that a zero-valued Digest is not ready to receive writes.
+// Call Reset or create a Digest using New before calling other methods.
type Digest struct {
v1 uint64
v2 uint64
@@ -33,19 +36,31 @@ type Digest struct {
n int // how much of mem is used
}
-// New creates a new Digest that computes the 64-bit xxHash algorithm.
+// New creates a new Digest with a zero seed.
func New() *Digest {
+ return NewWithSeed(0)
+}
+
+// NewWithSeed creates a new Digest with the given seed.
+func NewWithSeed(seed uint64) *Digest {
var d Digest
- d.Reset()
+ d.ResetWithSeed(seed)
return &d
}
// Reset clears the Digest's state so that it can be reused.
+// It uses a seed value of zero.
func (d *Digest) Reset() {
- d.v1 = primes[0] + prime2
- d.v2 = prime2
- d.v3 = 0
- d.v4 = -primes[0]
+ d.ResetWithSeed(0)
+}
+
+// ResetWithSeed clears the Digest's state so that it can be reused.
+// It uses the given seed to initialize the state.
+func (d *Digest) ResetWithSeed(seed uint64) {
+ d.v1 = seed + prime1 + prime2
+ d.v2 = seed + prime2
+ d.v3 = seed
+ d.v4 = seed - prime1
d.total = 0
d.n = 0
}
diff --git a/vendor/github.com/cespare/xxhash/v2/xxhash_asm.go b/vendor/github.com/cespare/xxhash/v2/xxhash_asm.go
index 9216e0a4..78f95f25 100644
--- a/vendor/github.com/cespare/xxhash/v2/xxhash_asm.go
+++ b/vendor/github.com/cespare/xxhash/v2/xxhash_asm.go
@@ -6,7 +6,7 @@
package xxhash
-// Sum64 computes the 64-bit xxHash digest of b.
+// Sum64 computes the 64-bit xxHash digest of b with a zero seed.
//
//go:noescape
func Sum64(b []byte) uint64
diff --git a/vendor/github.com/cespare/xxhash/v2/xxhash_other.go b/vendor/github.com/cespare/xxhash/v2/xxhash_other.go
index 26df13bb..118e49e8 100644
--- a/vendor/github.com/cespare/xxhash/v2/xxhash_other.go
+++ b/vendor/github.com/cespare/xxhash/v2/xxhash_other.go
@@ -3,7 +3,7 @@
package xxhash
-// Sum64 computes the 64-bit xxHash digest of b.
+// Sum64 computes the 64-bit xxHash digest of b with a zero seed.
func Sum64(b []byte) uint64 {
// A simpler version would be
// d := New()
diff --git a/vendor/github.com/cespare/xxhash/v2/xxhash_safe.go b/vendor/github.com/cespare/xxhash/v2/xxhash_safe.go
index e86f1b5f..05f5e7df 100644
--- a/vendor/github.com/cespare/xxhash/v2/xxhash_safe.go
+++ b/vendor/github.com/cespare/xxhash/v2/xxhash_safe.go
@@ -5,7 +5,7 @@
package xxhash
-// Sum64String computes the 64-bit xxHash digest of s.
+// Sum64String computes the 64-bit xxHash digest of s with a zero seed.
func Sum64String(s string) uint64 {
return Sum64([]byte(s))
}
diff --git a/vendor/github.com/cespare/xxhash/v2/xxhash_unsafe.go b/vendor/github.com/cespare/xxhash/v2/xxhash_unsafe.go
index 1c1638fd..cf9d42ae 100644
--- a/vendor/github.com/cespare/xxhash/v2/xxhash_unsafe.go
+++ b/vendor/github.com/cespare/xxhash/v2/xxhash_unsafe.go
@@ -33,7 +33,7 @@ import (
//
// See https://github.com/golang/go/issues/42739 for discussion.
-// Sum64String computes the 64-bit xxHash digest of s.
+// Sum64String computes the 64-bit xxHash digest of s with a zero seed.
// It may be faster than Sum64([]byte(s)) by avoiding a copy.
func Sum64String(s string) uint64 {
b := *(*[]byte)(unsafe.Pointer(&sliceHeader{s, len(s)}))
diff --git a/vendor/github.com/digitalocean/godo/CHANGELOG.md b/vendor/github.com/digitalocean/godo/CHANGELOG.md
index eb84bc9a..68e7d48f 100644
--- a/vendor/github.com/digitalocean/godo/CHANGELOG.md
+++ b/vendor/github.com/digitalocean/godo/CHANGELOG.md
@@ -1,5 +1,129 @@
# Change Log
+## [v1.130.0] - 2024-11-14
+
+- #755 - @vsharma6855 - Add Missing Database Configs for Postgresql and MYSQL
+- #754 - @blesswinsamuel - APPS-9858 Add method to obtain websocket URL to get console access into components
+
+## [v1.129.0] - 2024-11-06
+
+- #752 - @andrewsomething - Support maps in Stringify
+- #749 - @loosla - [droplets]: add droplet backup policies
+- #730 - @rak16 - DOCR-1201: Add new RegistriesService to support methods for multiple-registry open beta
+- #748 - @andrewsomething - Support Droplet GPU information
+
+## [v1.128.0] - 2024-10-24
+
+- #746 - @blesswinsamuel - Add archive field to AppSpec to archive/restore apps
+- #745 - @asaha2 - Add load balancer monitoring endpoints
+- #744 - @asaha2 - Adjust delete dangerous
+- #743 - @asaha2 - Introduce droplet autoscale godo methods
+- #740 - @blesswinsamuel - Add maintenance field to AppSpec to enable/disable maintenance mode
+- #739 - @markusthoemmes - Add protocol to AppSpec and pending to detect responses
+
+## [v1.127.0] - 2024-10-18
+
+- #737 - @loosla - [databases]: change Opensearch ism_history_max_docs type to int64 to …
+- #735 - @loosla - [databases]: add a missing field to Opensearch advanced configuration
+- #729 - @loosla - [databases]: add support for Opensearch advanced configuration
+
+## [v1.126.0] - 2024-09-25
+
+- #732 - @gottwald - DOKS: add custom CIDR fields
+- #727 - @loosla - [databases]: add support for Kafka advanced configuration
+
+## [v1.125.0] - 2024-09-17
+
+- #726 - @loosla - [databases]: add support for MongoDB advanced configuration
+- #724 - @andrewsomething - Bump go version to 1.22
+- #723 - @jauderho - Update Go dependencies and remove replace statements
+
+## [v1.124.0] - 2024-09-10
+
+- #721 - @vsharma6855 - [DBAAS] | Add API endpoint for applying cluster patches
+
+## [v1.123.0] - 2024-09-06
+
+- #719 - @andrewsomething - apps: mark ListTiers and GetTier as deprecated
+
+## [v1.122.0] - 2024-09-04
+
+- #717 - @danaelhe - DB: Fix Logsink Attribute Types
+- #716 - @bhardwajRahul - Databases: Add support for OpenSearch ACL
+
+## [v1.121.0] - 2024-08-20
+
+- #715 - @danaelhe - Databases: Bring back Logsink Support
+- #710 - @bhardwajRahul - Update GODO to include new Openseach index crud changes
+- #712 - @danaelhe - Database: Namespace logsink
+- #711 - @danaelhe - Databases: Add Logsinks CRUD support
+
+## [v1.120.0] - 2024-08-08
+
+- #708 - @markusthoemmes - APPS-9201 Add `UpdateAllSourceVersions` parameter to update app calls
+- #706 - @andrewsomething - database: Add Size to DatabaseReplica struct
+
+## [v1.119.0] - 2024-07-24
+
+- #704 - @ElanHasson - APPS-9133 - Add support for OPENSEARCH as a database engine option
+- #703 - @dependabot[bot] - Bump github.com/hashicorp/go-retryablehttp from 0.7.4 to 0.7.7
+- #699 - @ElanHasson - APPS-8790 Add support to App Platform Log Forwarding for an OpenSearch DBaaS cluster destination.
+
+## [v1.118.0] - 2024-06-04
+
+**Note**: This release contains features in closed beta (#700).
+
+- #701 - @llDrLove - Rename control plane permission to control plane firewall
+- #700 - @bbassingthwaite - Add ProxyProtocol to LoadBalancer HealthCheck
+
+## [v1.117.0] - 2024-06-04
+
+- #696 - @llDrLove - Support specifying control plane firewall rules when creating or updating DOKS clusters
+- #697 - @asaha2 - Add support for lb internal network type
+- #695 - @ElanHasson - APPS-8732 - Update documentation on App Platform OpenSearch endpoint structure.
+- #692 - @ElanHasson - APPS-8732 - Add OpenSearch as a Log Destination for App Platform.
+
+## [v1.116.0] - 2024-05-16
+
+- #693 - @guptado - Introduce VPC peering methods
+
+## [v1.115.0] - 2024-05-08
+
+- #688 - @asaha2 - load balancers: support glb active-passive fail-over settings, currently in closed beta
+
+## [v1.114.0] - 2024-04-12
+
+- #686 - @greeshmapill - APPS-8386: Add comments to mark deprecation of unused instance size fields
+- #685 - @jcodybaker - APPS-8711: container termination controls
+- #682 - @dependabot[bot] - Bump golang.org/x/net from 0.17.0 to 0.23.0
+
+## [v1.113.0] - 2024-04-12
+
+- #679 - @bhardwajRahul - Enable ui_connection parameter for Opensearch
+- #678 - @bhardwajRahul - Enable Opensearch option in Godo
+
+## [v1.112.0] - 2024-04-08
+
+- #672 - @dependabot[bot] - Bump google.golang.org/protobuf from 1.28.0 to 1.33.0
+- #675 - @bhardwajRahul - Add ListDatabaseEvents to Godo
+
+## [v1.111.0] - 2024-04-02
+
+- #674 - @asaha2 - load balancers: introduce glb settings in godo, currently in closed beta
+
+## [v1.110.0] - 2024-03-14
+
+- #667 - @dwilsondo - Include DBaaS metrics credential endpoint operations
+- #670 - @guptado - [NETPROD-3583] Added name param in ListOption to get resource by name
+- #671 - @greeshmapill - APPS-8383: Add deprecation intent and bandwidth allowance to app instance size spec
+
+## [v1.109.0] - 2024-02-09
+
+- #668 - @greeshmapill - APPS-8315: Update app instance size spec
+- #665 - @jcodybaker - APPS-8263: methods for managing App Platform dev DBs
+- #663 - @dwilsondo - Include replica connection info on DBaaS clusters & DBaaS PG pools
+- #662 - @ddatta-do - load balancer : add regional network as new LB type
+
## [v1.108.0] - 2024-01-17
- #660 - @dweinshenker - Enable CRUD operations for replicas with storage_size_mib
diff --git a/vendor/github.com/digitalocean/godo/apps.gen.go b/vendor/github.com/digitalocean/godo/apps.gen.go
index 7ec24c33..0232ae94 100644
--- a/vendor/github.com/digitalocean/godo/apps.gen.go
+++ b/vendor/github.com/digitalocean/godo/apps.gen.go
@@ -98,6 +98,8 @@ type App struct {
BuildConfig *AppBuildConfig `json:"build_config,omitempty"`
// The id of the project for the app. This will be empty if there is a fleet (project) lookup failure.
ProjectID string `json:"project_id,omitempty"`
+ // The dedicated egress ip addresses associated with the app.
+ DedicatedIps []*AppDedicatedIp `json:"dedicated_ips,omitempty"`
}
// AppAlertSpec Configuration of an alert for the app or a individual component.
@@ -191,7 +193,7 @@ type AppBuildConfigCNBVersioning struct {
// AppDatabaseSpec struct for AppDatabaseSpec
type AppDatabaseSpec struct {
- // The name. Must be unique across all components within the same app.
+ // The database's name. The name must be unique across all components within the same app and cannot use capital letters.
Name string `json:"name"`
Engine AppDatabaseSpecEngine `json:"engine,omitempty"`
Version string `json:"version,omitempty"`
@@ -214,11 +216,33 @@ type AppDatabaseSpecEngine string
// List of AppDatabaseSpecEngine
const (
- AppDatabaseSpecEngine_Unset AppDatabaseSpecEngine = "UNSET"
- AppDatabaseSpecEngine_MySQL AppDatabaseSpecEngine = "MYSQL"
- AppDatabaseSpecEngine_PG AppDatabaseSpecEngine = "PG"
- AppDatabaseSpecEngine_Redis AppDatabaseSpecEngine = "REDIS"
- AppDatabaseSpecEngine_MongoDB AppDatabaseSpecEngine = "MONGODB"
+ AppDatabaseSpecEngine_Unset AppDatabaseSpecEngine = "UNSET"
+ AppDatabaseSpecEngine_MySQL AppDatabaseSpecEngine = "MYSQL"
+ AppDatabaseSpecEngine_PG AppDatabaseSpecEngine = "PG"
+ AppDatabaseSpecEngine_Redis AppDatabaseSpecEngine = "REDIS"
+ AppDatabaseSpecEngine_MongoDB AppDatabaseSpecEngine = "MONGODB"
+ AppDatabaseSpecEngine_Kafka AppDatabaseSpecEngine = "KAFKA"
+ AppDatabaseSpecEngine_Opensearch AppDatabaseSpecEngine = "OPENSEARCH"
+)
+
+// AppDedicatedIp Represents a dedicated egress ip.
+type AppDedicatedIp struct {
+ // The ip address of the dedicated egress ip.
+ Ip string `json:"ip,omitempty"`
+ // The id of the dedictated egress ip.
+ ID string `json:"id,omitempty"`
+ Status AppDedicatedIpStatus `json:"status,omitempty"`
+}
+
+// AppDedicatedIpStatus the model 'AppDedicatedIpStatus'
+type AppDedicatedIpStatus string
+
+// List of AppDedicatedIPStatus
+const (
+ APPDEDICATEDIPSTATUS_Unknown AppDedicatedIpStatus = "UNKNOWN"
+ APPDEDICATEDIPSTATUS_Assigning AppDedicatedIpStatus = "ASSIGNING"
+ APPDEDICATEDIPSTATUS_Assigned AppDedicatedIpStatus = "ASSIGNED"
+ APPDEDICATEDIPSTATUS_Removed AppDedicatedIpStatus = "REMOVED"
)
// AppDomainSpec struct for AppDomainSpec
@@ -366,6 +390,7 @@ type AppJobSpec struct {
Alerts []*AppAlertSpec `json:"alerts,omitempty"`
// A list of configured log forwarding destinations.
LogDestinations []*AppLogDestinationSpec `json:"log_destinations,omitempty"`
+ Termination *AppJobSpecTermination `json:"termination,omitempty"`
}
// AppJobSpecKind - UNSPECIFIED: Default job type, will auto-complete to POST_DEPLOY kind. - PRE_DEPLOY: Indicates a job that runs before an app deployment. - POST_DEPLOY: Indicates a job that runs after an app deployment. - FAILED_DEPLOY: Indicates a job that runs after a component fails to deploy.
@@ -379,6 +404,12 @@ const (
AppJobSpecKind_FailedDeploy AppJobSpecKind = "FAILED_DEPLOY"
)
+// AppJobSpecTermination struct for AppJobSpecTermination
+type AppJobSpecTermination struct {
+ // The number of seconds to wait between sending a TERM signal to a container and issuing a KILL which causes immediate shutdown. Default: 120, Minimum 1, Maximum 600.
+ GracePeriodSeconds int32 `json:"grace_period_seconds,omitempty"`
+}
+
// AppLogDestinationSpec struct for AppLogDestinationSpec
type AppLogDestinationSpec struct {
// Name of the log destination.
@@ -386,6 +417,7 @@ type AppLogDestinationSpec struct {
Papertrail *AppLogDestinationSpecPapertrail `json:"papertrail,omitempty"`
Datadog *AppLogDestinationSpecDataDog `json:"datadog,omitempty"`
Logtail *AppLogDestinationSpecLogtail `json:"logtail,omitempty"`
+ OpenSearch *AppLogDestinationSpecOpenSearch `json:"open_search,omitempty"`
Endpoint string `json:"endpoint,omitempty"`
TLSInsecure bool `json:"tls_insecure,omitempty"`
Headers []*AppLogDestinationSpecHeader `json:"headers,omitempty"`
@@ -413,12 +445,32 @@ type AppLogDestinationSpecLogtail struct {
Token string `json:"token"`
}
+// AppLogDestinationSpecOpenSearch OpenSearch configuration.
+type AppLogDestinationSpecOpenSearch struct {
+ // OpenSearch API Endpoint. Only HTTPS is supported. Format: https://:. Cannot be specified if `cluster_name` is also specified.
+ Endpoint string `json:"endpoint,omitempty"`
+ BasicAuth *OpenSearchBasicAuth `json:"basic_auth,omitempty"`
+ // The index name to use for the logs. If not set, the default index name is \"logs\".
+ IndexName string `json:"index_name,omitempty"`
+ // The name of a DigitalOcean DBaaS OpenSearch cluster to use as a log forwarding destination. Cannot be specified if `endpoint` is also specified.
+ ClusterName string `json:"cluster_name,omitempty"`
+}
+
// AppLogDestinationSpecPapertrail Papertrail configuration.
type AppLogDestinationSpecPapertrail struct {
// Papertrail syslog endpoint.
Endpoint string `json:"endpoint"`
}
+// AppMaintenanceSpec struct for AppMaintenanceSpec
+type AppMaintenanceSpec struct {
+ // Indicates whether maintenance mode should be enabled for the app.
+ Enabled bool `json:"enabled,omitempty"`
+ // Indicates whether the app should be archived. Setting this to true implies that enabled is set to true.
+ // Note that this feature is currently in closed beta.
+ Archive bool `json:"archive,omitempty"`
+}
+
// AppRouteSpec struct for AppRouteSpec
type AppRouteSpec struct {
// (Deprecated) An HTTP path prefix. Paths must start with / and must be unique across all components within an app.
@@ -452,7 +504,8 @@ type AppServiceSpec struct {
InstanceCount int64 `json:"instance_count,omitempty"`
Autoscaling *AppAutoscalingSpec `json:"autoscaling,omitempty"`
// The internal port on which this service's run command will listen. Default: 8080 If there is not an environment variable with the name `PORT`, one will be automatically added with its value set to the value of this field.
- HTTPPort int64 `json:"http_port,omitempty"`
+ HTTPPort int64 `json:"http_port,omitempty"`
+ Protocol ServingProtocol `json:"protocol,omitempty"`
// (Deprecated) A list of HTTP routes that should be routed to this component.
Routes []*AppRouteSpec `json:"routes,omitempty"`
HealthCheck *AppServiceSpecHealthCheck `json:"health_check,omitempty"`
@@ -462,22 +515,23 @@ type AppServiceSpec struct {
// A list of configured alerts which apply to the component.
Alerts []*AppAlertSpec `json:"alerts,omitempty"`
// A list of configured log forwarding destinations.
- LogDestinations []*AppLogDestinationSpec `json:"log_destinations,omitempty"`
+ LogDestinations []*AppLogDestinationSpec `json:"log_destinations,omitempty"`
+ Termination *AppServiceSpecTermination `json:"termination,omitempty"`
}
// AppServiceSpecHealthCheck struct for AppServiceSpecHealthCheck
type AppServiceSpecHealthCheck struct {
// Deprecated. Use http_path instead.
Path string `json:"path,omitempty"`
- // The number of seconds to wait before beginning health checks. Default: 0 seconds; start health checks as soon as the service starts.
+ // The number of seconds to wait before beginning health checks. Default: 0 seconds, Minimum 0, Maximum 3600.
InitialDelaySeconds int32 `json:"initial_delay_seconds,omitempty"`
- // The number of seconds to wait between health checks. Default: 10 seconds.
+ // The number of seconds to wait between health checks. Default: 10 seconds, Minimum 1, Maximum 300.
PeriodSeconds int32 `json:"period_seconds,omitempty"`
- // The number of seconds after which the check times out. Default: 1 second.
+ // The number of seconds after which the check times out. Default: 1 second, Minimum 1, Maximum 120.
TimeoutSeconds int32 `json:"timeout_seconds,omitempty"`
- // The number of successful health checks before considered healthy. Default: 1.
+ // The number of successful health checks before considered healthy. Default: 1, Minimum 1, Maximum 50.
SuccessThreshold int32 `json:"success_threshold,omitempty"`
- // The number of failed health checks before considered unhealthy. Default: 9.
+ // The number of failed health checks before considered unhealthy. Default: 9, Minimum 1, Maximum 50.
FailureThreshold int32 `json:"failure_threshold,omitempty"`
// The route path used for the HTTP health check ping. If not set, the HTTP health check will be disabled and a TCP health check used instead.
HTTPPath string `json:"http_path,omitempty"`
@@ -485,6 +539,14 @@ type AppServiceSpecHealthCheck struct {
Port int64 `json:"port,omitempty"`
}
+// AppServiceSpecTermination struct for AppServiceSpecTermination
+type AppServiceSpecTermination struct {
+ // The number of seconds to wait between selecting a container instance for termination and issuing the TERM signal. Selecting a container instance for termination begins an asynchronous drain of new requests on upstream load-balancers. Default: 15 seconds, Minimum 1, Maximum 110.
+ DrainSeconds int32 `json:"drain_seconds,omitempty"`
+ // The number of seconds to wait between sending a TERM signal to a container and issuing a KILL which causes immediate shutdown. Default: 120, Minimum 1, Maximum 600.
+ GracePeriodSeconds int32 `json:"grace_period_seconds,omitempty"`
+}
+
// AppSpec The desired configuration of an application.
type AppSpec struct {
// The name of the app. Must be unique across all apps in the same account.
@@ -507,10 +569,11 @@ type AppSpec struct {
// A list of environment variables made available to all components in the app.
Envs []*AppVariableDefinition `json:"envs,omitempty"`
// A list of alerts which apply to the app.
- Alerts []*AppAlertSpec `json:"alerts,omitempty"`
- Ingress *AppIngressSpec `json:"ingress,omitempty"`
- Egress *AppEgressSpec `json:"egress,omitempty"`
- Features []string `json:"features,omitempty"`
+ Alerts []*AppAlertSpec `json:"alerts,omitempty"`
+ Ingress *AppIngressSpec `json:"ingress,omitempty"`
+ Egress *AppEgressSpec `json:"egress,omitempty"`
+ Features []string `json:"features,omitempty"`
+ Maintenance *AppMaintenanceSpec `json:"maintenance,omitempty"`
}
// AppStaticSiteSpec struct for AppStaticSiteSpec
@@ -579,7 +642,14 @@ type AppWorkerSpec struct {
// A list of configured alerts which apply to the component.
Alerts []*AppAlertSpec `json:"alerts,omitempty"`
// A list of configured log forwarding destinations.
- LogDestinations []*AppLogDestinationSpec `json:"log_destinations,omitempty"`
+ LogDestinations []*AppLogDestinationSpec `json:"log_destinations,omitempty"`
+ Termination *AppWorkerSpecTermination `json:"termination,omitempty"`
+}
+
+// AppWorkerSpecTermination struct for AppWorkerSpecTermination
+type AppWorkerSpecTermination struct {
+ // The number of seconds to wait between sending a TERM signal to a container and issuing a KILL which causes immediate shutdown. Default: 120, Minimum 1, Maximum 600.
+ GracePeriodSeconds int32 `json:"grace_period_seconds,omitempty"`
}
// Buildpack struct for Buildpack
@@ -858,6 +928,8 @@ type DetectResponse struct {
TemplateFound bool `json:"template_found,omitempty"`
TemplateValid bool `json:"template_valid,omitempty"`
TemplateError string `json:"template_error,omitempty"`
+ // Whether or not the underlying detection is still pending. If true, the request can be retried as-is until this field is false and the response contains the detection result.
+ Pending bool `json:"pending,omitempty"`
}
// DetectResponseComponent struct for DetectResponseComponent
@@ -997,6 +1069,41 @@ type AppDomainValidation struct {
TXTValue string `json:"txt_value,omitempty"`
}
+// GetAppDatabaseConnectionDetailsResponse struct for GetAppDatabaseConnectionDetailsResponse
+type GetAppDatabaseConnectionDetailsResponse struct {
+ ConnectionDetails []*GetDatabaseConnectionDetailsResponse `json:"connection_details,omitempty"`
+}
+
+// GetDatabaseConnectionDetailsResponse struct for GetDatabaseConnectionDetailsResponse
+type GetDatabaseConnectionDetailsResponse struct {
+ Host string `json:"host,omitempty"`
+ Port int64 `json:"port,omitempty"`
+ Username string `json:"username,omitempty"`
+ Password string `json:"password,omitempty"`
+ DatabaseName string `json:"database_name,omitempty"`
+ SslMode string `json:"ssl_mode,omitempty"`
+ DatabaseURL string `json:"database_url,omitempty"`
+ ComponentName string `json:"component_name,omitempty"`
+ Pools []*GetDatabaseConnectionDetailsResponsePool `json:"pools,omitempty"`
+}
+
+// GetDatabaseConnectionDetailsResponsePool struct for GetDatabaseConnectionDetailsResponsePool
+type GetDatabaseConnectionDetailsResponsePool struct {
+ PoolName string `json:"pool_name,omitempty"`
+ Host string `json:"host,omitempty"`
+ Port int64 `json:"port,omitempty"`
+ Username string `json:"username,omitempty"`
+ Password string `json:"password,omitempty"`
+ DatabaseName string `json:"database_name,omitempty"`
+ SslMode string `json:"ssl_mode,omitempty"`
+ DatabaseURL string `json:"database_url,omitempty"`
+}
+
+// GetDatabaseTrustedSourceResponse struct for GetDatabaseTrustedSourceResponse
+type GetDatabaseTrustedSourceResponse struct {
+ IsEnabled bool `json:"is_enabled,omitempty"`
+}
+
// GitHubSourceSpec struct for GitHubSourceSpec
type GitHubSourceSpec struct {
Repo string `json:"repo,omitempty"`
@@ -1052,16 +1159,28 @@ const (
// AppInstanceSize struct for AppInstanceSize
type AppInstanceSize struct {
- Name string `json:"name,omitempty"`
- Slug string `json:"slug,omitempty"`
- CPUType AppInstanceSizeCPUType `json:"cpu_type,omitempty"`
- CPUs string `json:"cpus,omitempty"`
- MemoryBytes string `json:"memory_bytes,omitempty"`
- USDPerMonth string `json:"usd_per_month,omitempty"`
- USDPerSecond string `json:"usd_per_second,omitempty"`
- TierSlug string `json:"tier_slug,omitempty"`
- TierUpgradeTo string `json:"tier_upgrade_to,omitempty"`
- TierDowngradeTo string `json:"tier_downgrade_to,omitempty"`
+ Name string `json:"name,omitempty"`
+ Slug string `json:"slug,omitempty"`
+ CPUType AppInstanceSizeCPUType `json:"cpu_type,omitempty"`
+ CPUs string `json:"cpus,omitempty"`
+ MemoryBytes string `json:"memory_bytes,omitempty"`
+ USDPerMonth string `json:"usd_per_month,omitempty"`
+ USDPerSecond string `json:"usd_per_second,omitempty"`
+ TierSlug string `json:"tier_slug,omitempty"`
+ // (Deprecated) The slug of the corresponding upgradable instance size on the higher tier.
+ TierUpgradeTo string `json:"tier_upgrade_to,omitempty"`
+ // (Deprecated) The slug of the corresponding downgradable instance size on the lower tier.
+ TierDowngradeTo string `json:"tier_downgrade_to,omitempty"`
+ // Indicates if the tier instance size can enable autoscaling.
+ Scalable bool `json:"scalable,omitempty"`
+ // (Deprecated) Indicates if the tier instance size is in feature preview state.
+ FeaturePreview bool `json:"feature_preview,omitempty"`
+ // Indicates if the tier instance size allows more than one instance.
+ SingleInstanceOnly bool `json:"single_instance_only,omitempty"`
+ // Indicates if the tier instance size is intended for deprecation.
+ DeprecationIntent bool `json:"deprecation_intent,omitempty"`
+ // The bandwidth allowance in GiB for the tier instance size.
+ BandwidthAllowanceGib string `json:"bandwidth_allowance_gib,omitempty"`
}
// AppInstanceSizeCPUType the model 'AppInstanceSizeCPUType'
@@ -1080,6 +1199,14 @@ type ListBuildpacksResponse struct {
Buildpacks []*Buildpack `json:"buildpacks,omitempty"`
}
+// OpenSearchBasicAuth Configure Username and/or Password for Basic authentication.
+type OpenSearchBasicAuth struct {
+ // Username to authenticate with. Only required when `endpoint` is set. Defaults to `doadmin` when `cluster_name` is set.
+ User string `json:"user,omitempty"`
+ // Password for user defined in User. Is required when `endpoint` is set. Cannot be set if using a DigitalOcean DBaaS OpenSearch cluster.
+ Password string `json:"password,omitempty"`
+}
+
// AppProposeRequest struct for AppProposeRequest
type AppProposeRequest struct {
Spec *AppSpec `json:"spec"`
@@ -1102,9 +1229,9 @@ type AppProposeResponse struct {
Spec *AppSpec `json:"spec,omitempty"`
// The monthly cost of the proposed app in USD.
AppCost float32 `json:"app_cost,omitempty"`
- // The monthly cost of the proposed app in USD using the next pricing plan tier. For example, if you propose an app that uses the Basic tier, the `app_tier_upgrade_cost` field displays the monthly cost of the app if it were to use the Professional tier. If the proposed app already uses the most expensive tier, the field is empty.
+ // (Deprecated) The monthly cost of the proposed app in USD using the next pricing plan tier. For example, if you propose an app that uses the Basic tier, the `app_tier_upgrade_cost` field displays the monthly cost of the app if it were to use the Professional tier. If the proposed app already uses the most expensive tier, the field is empty.
AppTierUpgradeCost float32 `json:"app_tier_upgrade_cost,omitempty"`
- // The monthly cost of the proposed app in USD using the previous pricing plan tier. For example, if you propose an app that uses the Professional tier, the `app_tier_downgrade_cost` field displays the monthly cost of the app if it were to use the Basic tier. If the proposed app already uses the lest expensive tier, the field is empty.
+ // (Deprecated) The monthly cost of the proposed app in USD using the previous pricing plan tier. For example, if you propose an app that uses the Professional tier, the `app_tier_downgrade_cost` field displays the monthly cost of the app if it were to use the Basic tier. If the proposed app already uses the lest expensive tier, the field is empty.
AppTierDowngradeCost float32 `json:"app_tier_downgrade_cost,omitempty"`
// The number of existing starter tier apps the account has.
ExistingStarterApps string `json:"existing_starter_apps,omitempty"`
@@ -1127,6 +1254,26 @@ type AppRegion struct {
Default bool `json:"default,omitempty"`
}
+// ResetDatabasePasswordRequest struct for ResetDatabasePasswordRequest
+type ResetDatabasePasswordRequest struct {
+ AppID string `json:"app_id,omitempty"`
+ ComponentName string `json:"component_name,omitempty"`
+}
+
+// ResetDatabasePasswordResponse struct for ResetDatabasePasswordResponse
+type ResetDatabasePasswordResponse struct {
+ Deployment *Deployment `json:"deployment,omitempty"`
+}
+
+// ServingProtocol - HTTP: The app is serving the HTTP protocol. Default. - HTTP2: The app is serving the HTTP/2 protocol. Currently, this needs to be implemented in the service by serving HTTP/2 with prior knowledge.
+type ServingProtocol string
+
+// List of ServingProtocol
+const (
+ SERVINGPROTOCOL_HTTP ServingProtocol = "HTTP"
+ SERVINGPROTOCOL_HTTP2 ServingProtocol = "HTTP2"
+)
+
// AppStringMatch struct for AppStringMatch
type AppStringMatch struct {
// Exact string match. Only 1 of `exact`, `prefix`, or `regex` must be set.
@@ -1144,6 +1291,18 @@ type AppTier struct {
BuildSeconds string `json:"build_seconds,omitempty"`
}
+// ToggleDatabaseTrustedSourceRequest struct for ToggleDatabaseTrustedSourceRequest
+type ToggleDatabaseTrustedSourceRequest struct {
+ AppID string `json:"app_id,omitempty"`
+ ComponentName string `json:"component_name,omitempty"`
+ Enable bool `json:"enable,omitempty"`
+}
+
+// ToggleDatabaseTrustedSourceResponse struct for ToggleDatabaseTrustedSourceResponse
+type ToggleDatabaseTrustedSourceResponse struct {
+ IsEnabled bool `json:"is_enabled,omitempty"`
+}
+
// UpgradeBuildpackResponse struct for UpgradeBuildpackResponse
type UpgradeBuildpackResponse struct {
// The components that were affected by the upgrade.
diff --git a/vendor/github.com/digitalocean/godo/apps.go b/vendor/github.com/digitalocean/godo/apps.go
index 880ce092..24fe738e 100644
--- a/vendor/github.com/digitalocean/godo/apps.go
+++ b/vendor/github.com/digitalocean/godo/apps.go
@@ -40,6 +40,7 @@ type AppsService interface {
CreateDeployment(ctx context.Context, appID string, create ...*DeploymentCreateRequest) (*Deployment, *Response, error)
GetLogs(ctx context.Context, appID, deploymentID, component string, logType AppLogType, follow bool, tailLines int) (*AppLogs, *Response, error)
+ GetExec(ctx context.Context, appID, deploymentID, component string) (*AppExec, *Response, error)
ListRegions(ctx context.Context) ([]*AppRegion, *Response, error)
@@ -56,6 +57,19 @@ type AppsService interface {
ListBuildpacks(ctx context.Context) ([]*Buildpack, *Response, error)
UpgradeBuildpack(ctx context.Context, appID string, opts UpgradeBuildpackOptions) (*UpgradeBuildpackResponse, *Response, error)
+
+ GetAppDatabaseConnectionDetails(ctx context.Context, appID string) ([]*GetDatabaseConnectionDetailsResponse, *Response, error)
+ ResetDatabasePassword(ctx context.Context, appID string, component string) (*Deployment, *Response, error)
+ ToggleDatabaseTrustedSource(
+ ctx context.Context,
+ appID string,
+ component string,
+ opts ToggleDatabaseTrustedSourceOptions,
+ ) (
+ *ToggleDatabaseTrustedSourceResponse,
+ *Response,
+ error,
+ )
}
// AppLogs represent app logs.
@@ -64,9 +78,16 @@ type AppLogs struct {
HistoricURLs []string `json:"historic_urls"`
}
+// AppExec represents the websocket URL used for sending/receiving console input and output.
+type AppExec struct {
+ URL string `json:"url"`
+}
+
// AppUpdateRequest represents a request to update an app.
type AppUpdateRequest struct {
Spec *AppSpec `json:"spec"`
+ // Whether or not to update the source versions (for example fetching a new commit or image digest) of all components. By default (when this is false) only newly added sources will be updated to avoid changes like updating the scale of a component from also updating the respective code.
+ UpdateAllSourceVersions bool `json:"update_all_source_versions"`
}
// DeploymentCreateRequest represents a request to create a deployment.
@@ -90,6 +111,12 @@ type UpgradeBuildpackOptions struct {
TriggerDeployment bool `json:"trigger_deployment,omitempty"`
}
+// ToggleDatabaseTrustedSourceOptions provides optional parameters for ToggleDatabaseTrustedSource.
+type ToggleDatabaseTrustedSourceOptions struct {
+ // Enable, if true, indicates the database should enable the trusted sources firewall.
+ Enable bool
+}
+
type appRoot struct {
App *App `json:"app"`
}
@@ -347,6 +374,27 @@ func (s *AppsServiceOp) GetLogs(ctx context.Context, appID, deploymentID, compon
return logs, resp, nil
}
+// GetExec retrieves the websocket URL used for sending/receiving console input and output.
+func (s *AppsServiceOp) GetExec(ctx context.Context, appID, deploymentID, component string) (*AppExec, *Response, error) {
+ var url string
+ if deploymentID == "" {
+ url = fmt.Sprintf("%s/%s/components/%s/exec", appsBasePath, appID, component)
+ } else {
+ url = fmt.Sprintf("%s/%s/deployments/%s/components/%s/exec", appsBasePath, appID, deploymentID, component)
+ }
+
+ req, err := s.client.NewRequest(ctx, http.MethodGet, url, nil)
+ if err != nil {
+ return nil, nil, err
+ }
+ logs := new(AppExec)
+ resp, err := s.client.Do(ctx, req, logs)
+ if err != nil {
+ return nil, resp, err
+ }
+ return logs, resp, nil
+}
+
// ListRegions lists all regions supported by App Platform.
func (s *AppsServiceOp) ListRegions(ctx context.Context) ([]*AppRegion, *Response, error) {
path := fmt.Sprintf("%s/regions", appsBasePath)
@@ -363,6 +411,9 @@ func (s *AppsServiceOp) ListRegions(ctx context.Context) ([]*AppRegion, *Respons
}
// ListTiers lists available app tiers.
+//
+// Deprecated: The '/v2/apps/tiers' endpoint has been deprecated as app tiers
+// are no longer tied to instance sizes. The concept of tiers is being retired.
func (s *AppsServiceOp) ListTiers(ctx context.Context) ([]*AppTier, *Response, error) {
path := fmt.Sprintf("%s/tiers", appsBasePath)
req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil)
@@ -378,6 +429,9 @@ func (s *AppsServiceOp) ListTiers(ctx context.Context) ([]*AppTier, *Response, e
}
// GetTier retrieves information about a specific app tier.
+//
+// Deprecated: The '/v2/apps/tiers/{slug}' endpoints have been deprecated as app
+// tiers are no longer tied to instance sizes. The concept of tiers is being retired.
func (s *AppsServiceOp) GetTier(ctx context.Context, slug string) (*AppTier, *Response, error) {
path := fmt.Sprintf("%s/tiers/%s", appsBasePath, slug)
req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil)
@@ -498,6 +552,60 @@ func (s *AppsServiceOp) UpgradeBuildpack(ctx context.Context, appID string, opts
return root, resp, nil
}
+// GetAppDatabaseConnectionDetails retrieves credentials for databases associated with the app.
+func (s *AppsServiceOp) GetAppDatabaseConnectionDetails(ctx context.Context, appID string) ([]*GetDatabaseConnectionDetailsResponse, *Response, error) {
+ path := fmt.Sprintf("%s/%s/database_connection_details", appsBasePath, appID)
+ req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil)
+ if err != nil {
+ return nil, nil, err
+ }
+ root := new(GetAppDatabaseConnectionDetailsResponse)
+ resp, err := s.client.Do(ctx, req, root)
+ if err != nil {
+ return nil, resp, err
+ }
+ return root.ConnectionDetails, resp, nil
+}
+
+// ResetDatabasePassword resets credentials for a database component associated with the app.
+func (s *AppsServiceOp) ResetDatabasePassword(ctx context.Context, appID string, component string) (*Deployment, *Response, error) {
+ path := fmt.Sprintf("%s/%s/components/%s/reset_password", appsBasePath, appID, component)
+ req, err := s.client.NewRequest(ctx, http.MethodPost, path, nil)
+ if err != nil {
+ return nil, nil, err
+ }
+ root := new(deploymentRoot)
+ resp, err := s.client.Do(ctx, req, root)
+ if err != nil {
+ return nil, resp, err
+ }
+ return root.Deployment, resp, nil
+}
+
+// ToggleDatabaseTrustedSource enables/disables trusted sources on the specified dev database component.
+func (s *AppsServiceOp) ToggleDatabaseTrustedSource(
+ ctx context.Context,
+ appID string,
+ component string,
+ opts ToggleDatabaseTrustedSourceOptions,
+) (
+ *ToggleDatabaseTrustedSourceResponse,
+ *Response,
+ error,
+) {
+ path := fmt.Sprintf("%s/%s/components/%s/trusted_sources", appsBasePath, appID, component)
+ req, err := s.client.NewRequest(ctx, http.MethodPost, path, opts)
+ if err != nil {
+ return nil, nil, err
+ }
+ root := new(ToggleDatabaseTrustedSourceResponse)
+ resp, err := s.client.Do(ctx, req, root)
+ if err != nil {
+ return nil, resp, err
+ }
+ return root, resp, nil
+}
+
// AppComponentType is an app component type.
type AppComponentType string
diff --git a/vendor/github.com/digitalocean/godo/apps_accessors.go b/vendor/github.com/digitalocean/godo/apps_accessors.go
index 059d6473..02e7c4b1 100644
--- a/vendor/github.com/digitalocean/godo/apps_accessors.go
+++ b/vendor/github.com/digitalocean/godo/apps_accessors.go
@@ -37,6 +37,14 @@ func (a *App) GetCreatedAt() time.Time {
return a.CreatedAt
}
+// GetDedicatedIps returns the DedicatedIps field.
+func (a *App) GetDedicatedIps() []*AppDedicatedIp {
+ if a == nil {
+ return nil
+ }
+ return a.DedicatedIps
+}
+
// GetDefaultIngress returns the DefaultIngress field.
func (a *App) GetDefaultIngress() string {
if a == nil {
@@ -557,6 +565,30 @@ func (a *AppDatabaseSpec) GetVersion() string {
return a.Version
}
+// GetID returns the ID field.
+func (a *AppDedicatedIp) GetID() string {
+ if a == nil {
+ return ""
+ }
+ return a.ID
+}
+
+// GetIp returns the Ip field.
+func (a *AppDedicatedIp) GetIp() string {
+ if a == nil {
+ return ""
+ }
+ return a.Ip
+}
+
+// GetStatus returns the Status field.
+func (a *AppDedicatedIp) GetStatus() AppDedicatedIpStatus {
+ if a == nil {
+ return ""
+ }
+ return a.Status
+}
+
// GetCertificateExpiresAt returns the CertificateExpiresAt field.
func (a *AppDomain) GetCertificateExpiresAt() time.Time {
if a == nil {
@@ -981,6 +1013,14 @@ func (a *AppIngressSpecRuleStringMatch) GetPrefix() string {
return a.Prefix
}
+// GetBandwidthAllowanceGib returns the BandwidthAllowanceGib field.
+func (a *AppInstanceSize) GetBandwidthAllowanceGib() string {
+ if a == nil {
+ return ""
+ }
+ return a.BandwidthAllowanceGib
+}
+
// GetCPUs returns the CPUs field.
func (a *AppInstanceSize) GetCPUs() string {
if a == nil {
@@ -997,6 +1037,22 @@ func (a *AppInstanceSize) GetCPUType() AppInstanceSizeCPUType {
return a.CPUType
}
+// GetDeprecationIntent returns the DeprecationIntent field.
+func (a *AppInstanceSize) GetDeprecationIntent() bool {
+ if a == nil {
+ return false
+ }
+ return a.DeprecationIntent
+}
+
+// GetFeaturePreview returns the FeaturePreview field.
+func (a *AppInstanceSize) GetFeaturePreview() bool {
+ if a == nil {
+ return false
+ }
+ return a.FeaturePreview
+}
+
// GetMemoryBytes returns the MemoryBytes field.
func (a *AppInstanceSize) GetMemoryBytes() string {
if a == nil {
@@ -1013,6 +1069,22 @@ func (a *AppInstanceSize) GetName() string {
return a.Name
}
+// GetScalable returns the Scalable field.
+func (a *AppInstanceSize) GetScalable() bool {
+ if a == nil {
+ return false
+ }
+ return a.Scalable
+}
+
+// GetSingleInstanceOnly returns the SingleInstanceOnly field.
+func (a *AppInstanceSize) GetSingleInstanceOnly() bool {
+ if a == nil {
+ return false
+ }
+ return a.SingleInstanceOnly
+}
+
// GetSlug returns the Slug field.
func (a *AppInstanceSize) GetSlug() string {
if a == nil {
@@ -1189,6 +1261,22 @@ func (a *AppJobSpec) GetSourceDir() string {
return a.SourceDir
}
+// GetTermination returns the Termination field.
+func (a *AppJobSpec) GetTermination() *AppJobSpecTermination {
+ if a == nil {
+ return nil
+ }
+ return a.Termination
+}
+
+// GetGracePeriodSeconds returns the GracePeriodSeconds field.
+func (a *AppJobSpecTermination) GetGracePeriodSeconds() int32 {
+ if a == nil {
+ return 0
+ }
+ return a.GracePeriodSeconds
+}
+
// GetDatadog returns the Datadog field.
func (a *AppLogDestinationSpec) GetDatadog() *AppLogDestinationSpecDataDog {
if a == nil {
@@ -1229,6 +1317,14 @@ func (a *AppLogDestinationSpec) GetName() string {
return a.Name
}
+// GetOpenSearch returns the OpenSearch field.
+func (a *AppLogDestinationSpec) GetOpenSearch() *AppLogDestinationSpecOpenSearch {
+ if a == nil {
+ return nil
+ }
+ return a.OpenSearch
+}
+
// GetPapertrail returns the Papertrail field.
func (a *AppLogDestinationSpec) GetPapertrail() *AppLogDestinationSpecPapertrail {
if a == nil {
@@ -1285,6 +1381,38 @@ func (a *AppLogDestinationSpecLogtail) GetToken() string {
return a.Token
}
+// GetBasicAuth returns the BasicAuth field.
+func (a *AppLogDestinationSpecOpenSearch) GetBasicAuth() *OpenSearchBasicAuth {
+ if a == nil {
+ return nil
+ }
+ return a.BasicAuth
+}
+
+// GetClusterName returns the ClusterName field.
+func (a *AppLogDestinationSpecOpenSearch) GetClusterName() string {
+ if a == nil {
+ return ""
+ }
+ return a.ClusterName
+}
+
+// GetEndpoint returns the Endpoint field.
+func (a *AppLogDestinationSpecOpenSearch) GetEndpoint() string {
+ if a == nil {
+ return ""
+ }
+ return a.Endpoint
+}
+
+// GetIndexName returns the IndexName field.
+func (a *AppLogDestinationSpecOpenSearch) GetIndexName() string {
+ if a == nil {
+ return ""
+ }
+ return a.IndexName
+}
+
// GetEndpoint returns the Endpoint field.
func (a *AppLogDestinationSpecPapertrail) GetEndpoint() string {
if a == nil {
@@ -1293,6 +1421,22 @@ func (a *AppLogDestinationSpecPapertrail) GetEndpoint() string {
return a.Endpoint
}
+// GetArchive returns the Archive field.
+func (a *AppMaintenanceSpec) GetArchive() bool {
+ if a == nil {
+ return false
+ }
+ return a.Archive
+}
+
+// GetEnabled returns the Enabled field.
+func (a *AppMaintenanceSpec) GetEnabled() bool {
+ if a == nil {
+ return false
+ }
+ return a.Enabled
+}
+
// GetAppID returns the AppID field.
func (a *AppProposeRequest) GetAppID() string {
if a == nil {
@@ -1629,6 +1773,14 @@ func (a *AppServiceSpec) GetName() string {
return a.Name
}
+// GetProtocol returns the Protocol field.
+func (a *AppServiceSpec) GetProtocol() ServingProtocol {
+ if a == nil {
+ return ""
+ }
+ return a.Protocol
+}
+
// GetRoutes returns the Routes field.
func (a *AppServiceSpec) GetRoutes() []*AppRouteSpec {
if a == nil {
@@ -1653,6 +1805,14 @@ func (a *AppServiceSpec) GetSourceDir() string {
return a.SourceDir
}
+// GetTermination returns the Termination field.
+func (a *AppServiceSpec) GetTermination() *AppServiceSpecTermination {
+ if a == nil {
+ return nil
+ }
+ return a.Termination
+}
+
// GetFailureThreshold returns the FailureThreshold field.
func (a *AppServiceSpecHealthCheck) GetFailureThreshold() int32 {
if a == nil {
@@ -1717,6 +1877,22 @@ func (a *AppServiceSpecHealthCheck) GetTimeoutSeconds() int32 {
return a.TimeoutSeconds
}
+// GetDrainSeconds returns the DrainSeconds field.
+func (a *AppServiceSpecTermination) GetDrainSeconds() int32 {
+ if a == nil {
+ return 0
+ }
+ return a.DrainSeconds
+}
+
+// GetGracePeriodSeconds returns the GracePeriodSeconds field.
+func (a *AppServiceSpecTermination) GetGracePeriodSeconds() int32 {
+ if a == nil {
+ return 0
+ }
+ return a.GracePeriodSeconds
+}
+
// GetAlerts returns the Alerts field.
func (a *AppSpec) GetAlerts() []*AppAlertSpec {
if a == nil {
@@ -1789,6 +1965,14 @@ func (a *AppSpec) GetJobs() []*AppJobSpec {
return a.Jobs
}
+// GetMaintenance returns the Maintenance field.
+func (a *AppSpec) GetMaintenance() *AppMaintenanceSpec {
+ if a == nil {
+ return nil
+ }
+ return a.Maintenance
+}
+
// GetName returns the Name field.
func (a *AppSpec) GetName() string {
if a == nil {
@@ -2165,6 +2349,22 @@ func (a *AppWorkerSpec) GetSourceDir() string {
return a.SourceDir
}
+// GetTermination returns the Termination field.
+func (a *AppWorkerSpec) GetTermination() *AppWorkerSpecTermination {
+ if a == nil {
+ return nil
+ }
+ return a.Termination
+}
+
+// GetGracePeriodSeconds returns the GracePeriodSeconds field.
+func (a *AppWorkerSpecTermination) GetGracePeriodSeconds() int32 {
+ if a == nil {
+ return 0
+ }
+ return a.GracePeriodSeconds
+}
+
// GetDescription returns the Description field.
func (b *Buildpack) GetDescription() []string {
if b == nil {
@@ -2925,6 +3125,14 @@ func (d *DetectResponse) GetComponents() []*DetectResponseComponent {
return d.Components
}
+// GetPending returns the Pending field.
+func (d *DetectResponse) GetPending() bool {
+ if d == nil {
+ return false
+ }
+ return d.Pending
+}
+
// GetTemplate returns the Template field.
func (d *DetectResponse) GetTemplate() *DeployTemplate {
if d == nil {
@@ -3117,6 +3325,158 @@ func (d *DetectResponseServerlessPackage) GetName() string {
return d.Name
}
+// GetConnectionDetails returns the ConnectionDetails field.
+func (g *GetAppDatabaseConnectionDetailsResponse) GetConnectionDetails() []*GetDatabaseConnectionDetailsResponse {
+ if g == nil {
+ return nil
+ }
+ return g.ConnectionDetails
+}
+
+// GetComponentName returns the ComponentName field.
+func (g *GetDatabaseConnectionDetailsResponse) GetComponentName() string {
+ if g == nil {
+ return ""
+ }
+ return g.ComponentName
+}
+
+// GetDatabaseName returns the DatabaseName field.
+func (g *GetDatabaseConnectionDetailsResponse) GetDatabaseName() string {
+ if g == nil {
+ return ""
+ }
+ return g.DatabaseName
+}
+
+// GetDatabaseURL returns the DatabaseURL field.
+func (g *GetDatabaseConnectionDetailsResponse) GetDatabaseURL() string {
+ if g == nil {
+ return ""
+ }
+ return g.DatabaseURL
+}
+
+// GetHost returns the Host field.
+func (g *GetDatabaseConnectionDetailsResponse) GetHost() string {
+ if g == nil {
+ return ""
+ }
+ return g.Host
+}
+
+// GetPassword returns the Password field.
+func (g *GetDatabaseConnectionDetailsResponse) GetPassword() string {
+ if g == nil {
+ return ""
+ }
+ return g.Password
+}
+
+// GetPools returns the Pools field.
+func (g *GetDatabaseConnectionDetailsResponse) GetPools() []*GetDatabaseConnectionDetailsResponsePool {
+ if g == nil {
+ return nil
+ }
+ return g.Pools
+}
+
+// GetPort returns the Port field.
+func (g *GetDatabaseConnectionDetailsResponse) GetPort() int64 {
+ if g == nil {
+ return 0
+ }
+ return g.Port
+}
+
+// GetSslMode returns the SslMode field.
+func (g *GetDatabaseConnectionDetailsResponse) GetSslMode() string {
+ if g == nil {
+ return ""
+ }
+ return g.SslMode
+}
+
+// GetUsername returns the Username field.
+func (g *GetDatabaseConnectionDetailsResponse) GetUsername() string {
+ if g == nil {
+ return ""
+ }
+ return g.Username
+}
+
+// GetDatabaseName returns the DatabaseName field.
+func (g *GetDatabaseConnectionDetailsResponsePool) GetDatabaseName() string {
+ if g == nil {
+ return ""
+ }
+ return g.DatabaseName
+}
+
+// GetDatabaseURL returns the DatabaseURL field.
+func (g *GetDatabaseConnectionDetailsResponsePool) GetDatabaseURL() string {
+ if g == nil {
+ return ""
+ }
+ return g.DatabaseURL
+}
+
+// GetHost returns the Host field.
+func (g *GetDatabaseConnectionDetailsResponsePool) GetHost() string {
+ if g == nil {
+ return ""
+ }
+ return g.Host
+}
+
+// GetPassword returns the Password field.
+func (g *GetDatabaseConnectionDetailsResponsePool) GetPassword() string {
+ if g == nil {
+ return ""
+ }
+ return g.Password
+}
+
+// GetPoolName returns the PoolName field.
+func (g *GetDatabaseConnectionDetailsResponsePool) GetPoolName() string {
+ if g == nil {
+ return ""
+ }
+ return g.PoolName
+}
+
+// GetPort returns the Port field.
+func (g *GetDatabaseConnectionDetailsResponsePool) GetPort() int64 {
+ if g == nil {
+ return 0
+ }
+ return g.Port
+}
+
+// GetSslMode returns the SslMode field.
+func (g *GetDatabaseConnectionDetailsResponsePool) GetSslMode() string {
+ if g == nil {
+ return ""
+ }
+ return g.SslMode
+}
+
+// GetUsername returns the Username field.
+func (g *GetDatabaseConnectionDetailsResponsePool) GetUsername() string {
+ if g == nil {
+ return ""
+ }
+ return g.Username
+}
+
+// GetIsEnabled returns the IsEnabled field.
+func (g *GetDatabaseTrustedSourceResponse) GetIsEnabled() bool {
+ if g == nil {
+ return false
+ }
+ return g.IsEnabled
+}
+
// GetBranch returns the Branch field.
func (g *GitHubSourceSpec) GetBranch() string {
if g == nil {
@@ -3253,6 +3613,78 @@ func (l *ListBuildpacksResponse) GetBuildpacks() []*Buildpack {
return l.Buildpacks
}
+// GetPassword returns the Password field.
+func (o *OpenSearchBasicAuth) GetPassword() string {
+ if o == nil {
+ return ""
+ }
+ return o.Password
+}
+
+// GetUser returns the User field.
+func (o *OpenSearchBasicAuth) GetUser() string {
+ if o == nil {
+ return ""
+ }
+ return o.User
+}
+
+// GetAppID returns the AppID field.
+func (r *ResetDatabasePasswordRequest) GetAppID() string {
+ if r == nil {
+ return ""
+ }
+ return r.AppID
+}
+
+// GetComponentName returns the ComponentName field.
+func (r *ResetDatabasePasswordRequest) GetComponentName() string {
+ if r == nil {
+ return ""
+ }
+ return r.ComponentName
+}
+
+// GetDeployment returns the Deployment field.
+func (r *ResetDatabasePasswordResponse) GetDeployment() *Deployment {
+ if r == nil {
+ return nil
+ }
+ return r.Deployment
+}
+
+// GetAppID returns the AppID field.
+func (t *ToggleDatabaseTrustedSourceRequest) GetAppID() string {
+ if t == nil {
+ return ""
+ }
+ return t.AppID
+}
+
+// GetComponentName returns the ComponentName field.
+func (t *ToggleDatabaseTrustedSourceRequest) GetComponentName() string {
+ if t == nil {
+ return ""
+ }
+ return t.ComponentName
+}
+
+// GetEnable returns the Enable field.
+func (t *ToggleDatabaseTrustedSourceRequest) GetEnable() bool {
+ if t == nil {
+ return false
+ }
+ return t.Enable
+}
+
+// GetIsEnabled returns the IsEnabled field.
+func (t *ToggleDatabaseTrustedSourceResponse) GetIsEnabled() bool {
+ if t == nil {
+ return false
+ }
+ return t.IsEnabled
+}
+
// GetAffectedComponents returns the AffectedComponents field.
func (u *UpgradeBuildpackResponse) GetAffectedComponents() []string {
if u == nil {
diff --git a/vendor/github.com/digitalocean/godo/certificates.go b/vendor/github.com/digitalocean/godo/certificates.go
index faf26a3e..7612acf0 100644
--- a/vendor/github.com/digitalocean/godo/certificates.go
+++ b/vendor/github.com/digitalocean/godo/certificates.go
@@ -2,6 +2,7 @@ package godo
import (
"context"
+ "fmt"
"net/http"
"path"
)
@@ -13,6 +14,7 @@ const certificatesBasePath = "/v2/certificates"
type CertificatesService interface {
Get(context.Context, string) (*Certificate, *Response, error)
List(context.Context, *ListOptions) ([]Certificate, *Response, error)
+ ListByName(context.Context, string, *ListOptions) ([]Certificate, *Response, error)
Create(context.Context, *CertificateRequest) (*Certificate, *Response, error)
Delete(context.Context, string) (*Response, error)
}
@@ -101,6 +103,39 @@ func (c *CertificatesServiceOp) List(ctx context.Context, opt *ListOptions) ([]C
return root.Certificates, resp, nil
}
+func (c *CertificatesServiceOp) ListByName(ctx context.Context, name string, opt *ListOptions) ([]Certificate, *Response, error) {
+
+ if len(name) < 1 {
+ return nil, nil, NewArgError("name", "cannot be an empty string")
+ }
+
+ path := fmt.Sprintf("%s?name=%s", certificatesBasePath, name)
+ urlStr, err := addOptions(path, opt)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ req, err := c.client.NewRequest(ctx, http.MethodGet, urlStr, nil)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ root := new(certificatesRoot)
+ resp, err := c.client.Do(ctx, req, root)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ if l := root.Links; l != nil {
+ resp.Links = l
+ }
+ if m := root.Meta; m != nil {
+ resp.Meta = m
+ }
+
+ return root.Certificates, resp, err
+}
+
// Create a new certificate with provided configuration.
func (c *CertificatesServiceOp) Create(ctx context.Context, cr *CertificateRequest) (*Certificate, *Response, error) {
req, err := c.client.NewRequest(ctx, http.MethodPost, certificatesBasePath, cr)
diff --git a/vendor/github.com/digitalocean/godo/databases.go b/vendor/github.com/digitalocean/godo/databases.go
index c0a4510a..e2a7d567 100644
--- a/vendor/github.com/digitalocean/godo/databases.go
+++ b/vendor/github.com/digitalocean/godo/databases.go
@@ -3,6 +3,7 @@ package godo
import (
"context"
"fmt"
+ "math/big"
"net/http"
"strings"
"time"
@@ -16,6 +17,7 @@ const (
databaseResizePath = databaseBasePath + "/%s/resize"
databaseMigratePath = databaseBasePath + "/%s/migrate"
databaseMaintenancePath = databaseBasePath + "/%s/maintenance"
+ databaseUpdateInstallationPath = databaseBasePath + "/%s/install_update"
databaseBackupsPath = databaseBasePath + "/%s/backups"
databaseUsersPath = databaseBasePath + "/%s/users"
databaseUserPath = databaseBasePath + "/%s/users/%s"
@@ -34,6 +36,12 @@ const (
databasePromoteReplicaToPrimaryPath = databaseReplicaPath + "/promote"
databaseTopicPath = databaseBasePath + "/%s/topics/%s"
databaseTopicsPath = databaseBasePath + "/%s/topics"
+ databaseMetricsCredentialsPath = databaseBasePath + "/metrics/credentials"
+ databaseEvents = databaseBasePath + "/%s/events"
+ databaseIndexesPath = databaseBasePath + "/%s/indexes"
+ databaseIndexPath = databaseBasePath + "/%s/indexes/%s"
+ databaseLogsinkPath = databaseBasePath + "/%s/logsink/%s"
+ databaseLogsinksPath = databaseBasePath + "/%s/logsink"
)
// SQL Mode constants allow for MySQL-specific SQL flavor configuration.
@@ -114,6 +122,7 @@ type DatabasesService interface {
Resize(context.Context, string, *DatabaseResizeRequest) (*Response, error)
Migrate(context.Context, string, *DatabaseMigrateRequest) (*Response, error)
UpdateMaintenance(context.Context, string, *DatabaseUpdateMaintenanceRequest) (*Response, error)
+ InstallUpdate(context.Context, string) (*Response, error)
ListBackups(context.Context, string, *ListOptions) ([]DatabaseBackup, *Response, error)
GetUser(context.Context, string, string) (*DatabaseUser, *Response, error)
ListUsers(context.Context, string, *ListOptions) ([]DatabaseUser, *Response, error)
@@ -144,9 +153,15 @@ type DatabasesService interface {
GetPostgreSQLConfig(context.Context, string) (*PostgreSQLConfig, *Response, error)
GetRedisConfig(context.Context, string) (*RedisConfig, *Response, error)
GetMySQLConfig(context.Context, string) (*MySQLConfig, *Response, error)
+ GetMongoDBConfig(context.Context, string) (*MongoDBConfig, *Response, error)
+ GetOpensearchConfig(context.Context, string) (*OpensearchConfig, *Response, error)
+ GetKafkaConfig(context.Context, string) (*KafkaConfig, *Response, error)
UpdatePostgreSQLConfig(context.Context, string, *PostgreSQLConfig) (*Response, error)
UpdateRedisConfig(context.Context, string, *RedisConfig) (*Response, error)
UpdateMySQLConfig(context.Context, string, *MySQLConfig) (*Response, error)
+ UpdateMongoDBConfig(context.Context, string, *MongoDBConfig) (*Response, error)
+ UpdateOpensearchConfig(context.Context, string, *OpensearchConfig) (*Response, error)
+ UpdateKafkaConfig(context.Context, string, *KafkaConfig) (*Response, error)
ListOptions(todo context.Context) (*DatabaseOptions, *Response, error)
UpgradeMajorVersion(context.Context, string, *UpgradeVersionRequest) (*Response, error)
ListTopics(context.Context, string, *ListOptions) ([]DatabaseTopic, *Response, error)
@@ -154,6 +169,16 @@ type DatabasesService interface {
GetTopic(context.Context, string, string) (*DatabaseTopic, *Response, error)
DeleteTopic(context.Context, string, string) (*Response, error)
UpdateTopic(context.Context, string, string, *DatabaseUpdateTopicRequest) (*Response, error)
+ GetMetricsCredentials(context.Context) (*DatabaseMetricsCredentials, *Response, error)
+ UpdateMetricsCredentials(context.Context, *DatabaseUpdateMetricsCredentialsRequest) (*Response, error)
+ ListDatabaseEvents(context.Context, string, *ListOptions) ([]DatabaseEvent, *Response, error)
+ ListIndexes(context.Context, string, *ListOptions) ([]DatabaseIndex, *Response, error)
+ DeleteIndex(context.Context, string, string) (*Response, error)
+ CreateLogsink(ctx context.Context, databaseID string, createLogsink *DatabaseCreateLogsinkRequest) (*DatabaseLogsink, *Response, error)
+ GetLogsink(ctx context.Context, databaseID string, logsinkID string) (*DatabaseLogsink, *Response, error)
+ ListLogsinks(ctx context.Context, databaseID string, opts *ListOptions) ([]DatabaseLogsink, *Response, error)
+ UpdateLogsink(ctx context.Context, databaseID string, logsinkID string, updateLogsink *DatabaseUpdateLogsinkRequest) (*Response, error)
+ DeleteLogsink(ctx context.Context, databaseID, logsinkID string) (*Response, error)
}
// DatabasesServiceOp handles communication with the Databases related methods
@@ -170,24 +195,28 @@ var _ DatabasesService = &DatabasesServiceOp{}
// "pg", "mysql" or "redis". A Database also includes connection information and other
// properties of the service like region, size and current status.
type Database struct {
- ID string `json:"id,omitempty"`
- Name string `json:"name,omitempty"`
- EngineSlug string `json:"engine,omitempty"`
- VersionSlug string `json:"version,omitempty"`
- Connection *DatabaseConnection `json:"connection,omitempty"`
- PrivateConnection *DatabaseConnection `json:"private_connection,omitempty"`
- Users []DatabaseUser `json:"users,omitempty"`
- NumNodes int `json:"num_nodes,omitempty"`
- SizeSlug string `json:"size,omitempty"`
- DBNames []string `json:"db_names,omitempty"`
- RegionSlug string `json:"region,omitempty"`
- Status string `json:"status,omitempty"`
- MaintenanceWindow *DatabaseMaintenanceWindow `json:"maintenance_window,omitempty"`
- CreatedAt time.Time `json:"created_at,omitempty"`
- PrivateNetworkUUID string `json:"private_network_uuid,omitempty"`
- Tags []string `json:"tags,omitempty"`
- ProjectID string `json:"project_id,omitempty"`
- StorageSizeMib uint64 `json:"storage_size_mib,omitempty"`
+ ID string `json:"id,omitempty"`
+ Name string `json:"name,omitempty"`
+ EngineSlug string `json:"engine,omitempty"`
+ VersionSlug string `json:"version,omitempty"`
+ Connection *DatabaseConnection `json:"connection,omitempty"`
+ UIConnection *DatabaseConnection `json:"ui_connection,omitempty"`
+ PrivateConnection *DatabaseConnection `json:"private_connection,omitempty"`
+ StandbyConnection *DatabaseConnection `json:"standby_connection,omitempty"`
+ StandbyPrivateConnection *DatabaseConnection `json:"standby_private_connection,omitempty"`
+ Users []DatabaseUser `json:"users,omitempty"`
+ NumNodes int `json:"num_nodes,omitempty"`
+ SizeSlug string `json:"size,omitempty"`
+ DBNames []string `json:"db_names,omitempty"`
+ RegionSlug string `json:"region,omitempty"`
+ Status string `json:"status,omitempty"`
+ MaintenanceWindow *DatabaseMaintenanceWindow `json:"maintenance_window,omitempty"`
+ CreatedAt time.Time `json:"created_at,omitempty"`
+ PrivateNetworkUUID string `json:"private_network_uuid,omitempty"`
+ Tags []string `json:"tags,omitempty"`
+ ProjectID string `json:"project_id,omitempty"`
+ StorageSizeMib uint64 `json:"storage_size_mib,omitempty"`
+ MetricsEndpoints []*ServiceAddress `json:"metrics_endpoints,omitempty"`
}
// DatabaseCA represents a database ca.
@@ -208,6 +237,12 @@ type DatabaseConnection struct {
ApplicationPorts map[string]uint32 `json:"application_ports,omitempty"`
}
+// ServiceAddress represents a host:port for a generic service (e.g. metrics endpoint)
+type ServiceAddress struct {
+ Host string `json:"host"`
+ Port int `json:"port"`
+}
+
// DatabaseUser represents a user in the database
type DatabaseUser struct {
Name string `json:"name,omitempty"`
@@ -226,9 +261,16 @@ type KafkaACL struct {
Topic string `json:"topic,omitempty"`
}
-// DatabaseUserSettings contains Kafka-specific user settings
+// OpenSearchACL contains OpenSearch specific user access control information
+type OpenSearchACL struct {
+ Permission string `json:"permission,omitempty"`
+ Index string `json:"index,omitempty"`
+}
+
+// DatabaseUserSettings contains user settings
type DatabaseUserSettings struct {
- ACL []*KafkaACL `json:"acl,omitempty"`
+ ACL []*KafkaACL `json:"acl,omitempty"`
+ OpenSearchACL []*OpenSearchACL `json:"opensearch_acl,omitempty"`
}
// DatabaseMySQLUserSettings contains MySQL-specific user settings
@@ -308,6 +350,14 @@ type DatabaseTopic struct {
Config *TopicConfig `json:"config,omitempty"`
}
+// DatabaseLogsink represents a logsink
+type DatabaseLogsink struct {
+ ID string `json:"sink_id"`
+ Name string `json:"sink_name,omitempty"`
+ Type string `json:"sink_type,omitempty"`
+ Config *DatabaseLogsinkConfig `json:"config,omitempty"`
+}
+
// TopicPartition represents the state of a Kafka topic partition
type TopicPartition struct {
EarliestOffset uint64 `json:"earliest_offset,omitempty"`
@@ -377,17 +427,20 @@ type DatabaseReplica struct {
PrivateNetworkUUID string `json:"private_network_uuid,omitempty"`
Tags []string `json:"tags,omitempty"`
StorageSizeMib uint64 `json:"storage_size_mib,omitempty"`
+ Size string `json:"size"`
}
// DatabasePool represents a database connection pool
type DatabasePool struct {
- User string `json:"user"`
- Name string `json:"name"`
- Size int `json:"size"`
- Database string `json:"db"`
- Mode string `json:"mode"`
- Connection *DatabaseConnection `json:"connection"`
- PrivateConnection *DatabaseConnection `json:"private_connection,omitempty"`
+ User string `json:"user"`
+ Name string `json:"name"`
+ Size int `json:"size"`
+ Database string `json:"db"`
+ Mode string `json:"mode"`
+ Connection *DatabaseConnection `json:"connection"`
+ PrivateConnection *DatabaseConnection `json:"private_connection,omitempty"`
+ StandbyConnection *DatabaseConnection `json:"standby_connection,omitempty"`
+ StandbyPrivateConnection *DatabaseConnection `json:"standby_private_connection,omitempty"`
}
// DatabaseCreatePoolRequest is used to create a new database connection pool
@@ -454,6 +507,35 @@ type DatabaseFirewallRule struct {
CreatedAt time.Time `json:"created_at"`
}
+// DatabaseCreateLogsinkRequest is used to create logsink for a database cluster
+type DatabaseCreateLogsinkRequest struct {
+ Name string `json:"sink_name"`
+ Type string `json:"sink_type"`
+ Config *DatabaseLogsinkConfig `json:"config"`
+}
+
+// DatabaseUpdateLogsinkRequest is used to update logsink for a database cluster
+type DatabaseUpdateLogsinkRequest struct {
+ Config *DatabaseLogsinkConfig `json:"config"`
+}
+
+// DatabaseLogsinkConfig represents one of the configurable options (rsyslog_logsink, elasticsearch_logsink, or opensearch_logsink) for a logsink.
+type DatabaseLogsinkConfig struct {
+ URL string `json:"url,omitempty"`
+ IndexPrefix string `json:"index_prefix,omitempty"`
+ IndexDaysMax int `json:"index_days_max,omitempty"`
+ Timeout float32 `json:"timeout,omitempty"`
+ Server string `json:"server,omitempty"`
+ Port int `json:"port,omitempty"`
+ TLS bool `json:"tls,omitempty"`
+ Format string `json:"format,omitempty"`
+ Logline string `json:"logline,omitempty"`
+ SD string `json:"sd,omitempty"`
+ CA string `json:"ca,omitempty"`
+ Key string `json:"key,omitempty"`
+ Cert string `json:"cert,omitempty"`
+}
+
// PostgreSQLConfig holds advanced configurations for PostgreSQL database clusters.
type PostgreSQLConfig struct {
AutovacuumFreezeMaxAge *int `json:"autovacuum_freeze_max_age,omitempty"`
@@ -507,6 +589,9 @@ type PostgreSQLConfig struct {
BackupMinute *int `json:"backup_minute,omitempty"`
WorkMem *int `json:"work_mem,omitempty"`
TimeScaleDB *PostgreSQLTimeScaleDBConfig `json:"timescaledb,omitempty"`
+ SynchronousReplication *string `json:"synchronous_replication,omitempty"`
+ StatMonitorEnable *bool `json:"stat_monitor_enable,omitempty"`
+ MaxFailoverReplicationTimeLag *int64 `json:"max_failover_replication_time_lag,omitempty"`
}
// PostgreSQLBouncerConfig configuration
@@ -571,6 +656,85 @@ type MySQLConfig struct {
BackupHour *int `json:"backup_hour,omitempty"`
BackupMinute *int `json:"backup_minute,omitempty"`
BinlogRetentionPeriod *int `json:"binlog_retention_period,omitempty"`
+ InnodbChangeBufferMaxSize *int `json:"innodb_change_buffer_max_size,omitempty"`
+ InnodbFlushNeighbors *int `json:"innodb_flush_neighbors,omitempty"`
+ InnodbReadIoThreads *int `json:"innodb_read_io_threads,omitempty"`
+ InnodbThreadConcurrency *int `json:"innodb_thread_concurrency,omitempty"`
+ InnodbWriteIoThreads *int `json:"innodb_write_io_threads,omitempty"`
+ NetBufferLength *int `json:"net_buffer_length,omitempty"`
+ LogOutput *string `json:"log_output,omitempty"`
+}
+
+// MongoDBConfig holds advanced configurations for MongoDB database clusters.
+type MongoDBConfig struct {
+ DefaultReadConcern *string `json:"default_read_concern,omitempty"`
+ DefaultWriteConcern *string `json:"default_write_concern,omitempty"`
+ TransactionLifetimeLimitSeconds *int `json:"transaction_lifetime_limit_seconds,omitempty"`
+ SlowOpThresholdMs *int `json:"slow_op_threshold_ms,omitempty"`
+ Verbosity *int `json:"verbosity,omitempty"`
+}
+
+// KafkaConfig holds advanced configurations for Kafka database clusters.
+type KafkaConfig struct {
+ GroupInitialRebalanceDelayMs *int `json:"group_initial_rebalance_delay_ms,omitempty"`
+ GroupMinSessionTimeoutMs *int `json:"group_min_session_timeout_ms,omitempty"`
+ GroupMaxSessionTimeoutMs *int `json:"group_max_session_timeout_ms,omitempty"`
+ MessageMaxBytes *int `json:"message_max_bytes,omitempty"`
+ LogCleanerDeleteRetentionMs *int64 `json:"log_cleaner_delete_retention_ms,omitempty"`
+ LogCleanerMinCompactionLagMs *uint64 `json:"log_cleaner_min_compaction_lag_ms,omitempty"`
+ LogFlushIntervalMs *uint64 `json:"log_flush_interval_ms,omitempty"`
+ LogIndexIntervalBytes *int `json:"log_index_interval_bytes,omitempty"`
+ LogMessageDownconversionEnable *bool `json:"log_message_downconversion_enable,omitempty"`
+ LogMessageTimestampDifferenceMaxMs *uint64 `json:"log_message_timestamp_difference_max_ms,omitempty"`
+ LogPreallocate *bool `json:"log_preallocate,omitempty"`
+ LogRetentionBytes *big.Int `json:"log_retention_bytes,omitempty"`
+ LogRetentionHours *int `json:"log_retention_hours,omitempty"`
+ LogRetentionMs *big.Int `json:"log_retention_ms,omitempty"`
+ LogRollJitterMs *uint64 `json:"log_roll_jitter_ms,omitempty"`
+ LogSegmentDeleteDelayMs *int `json:"log_segment_delete_delay_ms,omitempty"`
+ AutoCreateTopicsEnable *bool `json:"auto_create_topics_enable,omitempty"`
+}
+
+// OpensearchConfig holds advanced configurations for Opensearch database clusters.
+type OpensearchConfig struct {
+ HttpMaxContentLengthBytes *int `json:"http_max_content_length_bytes,omitempty"`
+ HttpMaxHeaderSizeBytes *int `json:"http_max_header_size_bytes,omitempty"`
+ HttpMaxInitialLineLengthBytes *int `json:"http_max_initial_line_length_bytes,omitempty"`
+ IndicesQueryBoolMaxClauseCount *int `json:"indices_query_bool_max_clause_count,omitempty"`
+ IndicesFielddataCacheSizePercentage *int `json:"indices_fielddata_cache_size_percentage,omitempty"`
+ IndicesMemoryIndexBufferSizePercentage *int `json:"indices_memory_index_buffer_size_percentage,omitempty"`
+ IndicesMemoryMinIndexBufferSizeMb *int `json:"indices_memory_min_index_buffer_size_mb,omitempty"`
+ IndicesMemoryMaxIndexBufferSizeMb *int `json:"indices_memory_max_index_buffer_size_mb,omitempty"`
+ IndicesQueriesCacheSizePercentage *int `json:"indices_queries_cache_size_percentage,omitempty"`
+ IndicesRecoveryMaxMbPerSec *int `json:"indices_recovery_max_mb_per_sec,omitempty"`
+ IndicesRecoveryMaxConcurrentFileChunks *int `json:"indices_recovery_max_concurrent_file_chunks,omitempty"`
+ ThreadPoolSearchSize *int `json:"thread_pool_search_size,omitempty"`
+ ThreadPoolSearchThrottledSize *int `json:"thread_pool_search_throttled_size,omitempty"`
+ ThreadPoolGetSize *int `json:"thread_pool_get_size,omitempty"`
+ ThreadPoolAnalyzeSize *int `json:"thread_pool_analyze_size,omitempty"`
+ ThreadPoolWriteSize *int `json:"thread_pool_write_size,omitempty"`
+ ThreadPoolForceMergeSize *int `json:"thread_pool_force_merge_size,omitempty"`
+ ThreadPoolSearchQueueSize *int `json:"thread_pool_search_queue_size,omitempty"`
+ ThreadPoolSearchThrottledQueueSize *int `json:"thread_pool_search_throttled_queue_size,omitempty"`
+ ThreadPoolGetQueueSize *int `json:"thread_pool_get_queue_size,omitempty"`
+ ThreadPoolAnalyzeQueueSize *int `json:"thread_pool_analyze_queue_size,omitempty"`
+ ThreadPoolWriteQueueSize *int `json:"thread_pool_write_queue_size,omitempty"`
+ IsmEnabled *bool `json:"ism_enabled,omitempty"`
+ IsmHistoryEnabled *bool `json:"ism_history_enabled,omitempty"`
+ IsmHistoryMaxAgeHours *int `json:"ism_history_max_age_hours,omitempty"`
+ IsmHistoryMaxDocs *int64 `json:"ism_history_max_docs,omitempty"`
+ IsmHistoryRolloverCheckPeriodHours *int `json:"ism_history_rollover_check_period_hours,omitempty"`
+ IsmHistoryRolloverRetentionPeriodDays *int `json:"ism_history_rollover_retention_period_days,omitempty"`
+ SearchMaxBuckets *int `json:"search_max_buckets,omitempty"`
+ ActionAutoCreateIndexEnabled *bool `json:"action_auto_create_index_enabled,omitempty"`
+ EnableSecurityAudit *bool `json:"enable_security_audit,omitempty"`
+ ActionDestructiveRequiresName *bool `json:"action_destructive_requires_name,omitempty"`
+ ClusterMaxShardsPerNode *int `json:"cluster_max_shards_per_node,omitempty"`
+ OverrideMainResponseVersion *bool `json:"override_main_response_version,omitempty"`
+ ScriptMaxCompilationsRate *string `json:"script_max_compilations_rate,omitempty"`
+ ClusterRoutingAllocationNodeConcurrentRecoveries *int `json:"cluster_routing_allocation_node_concurrent_recoveries,omitempty"`
+ ReindexRemoteWhitelist []string `json:"reindex_remote_whitelist,omitempty"`
+ PluginsAlertingFilterByBackendRolesEnabled *bool `json:"plugins_alerting_filter_by_backend_roles_enabled,omitempty"`
}
type databaseUserRoot struct {
@@ -613,6 +777,18 @@ type databaseMySQLConfigRoot struct {
Config *MySQLConfig `json:"config"`
}
+type databaseMongoDBConfigRoot struct {
+ Config *MongoDBConfig `json:"config"`
+}
+
+type databaseOpensearchConfigRoot struct {
+ Config *OpensearchConfig `json:"config"`
+}
+
+type databaseKafkaConfigRoot struct {
+ Config *KafkaConfig `json:"config"`
+}
+
type databaseBackupsRoot struct {
Backups []DatabaseBackup `json:"backups"`
}
@@ -662,6 +838,23 @@ type databaseTopicsRoot struct {
Topics []DatabaseTopic `json:"topics"`
}
+type databaseLogsinksRoot struct {
+ Sinks []DatabaseLogsink `json:"sinks"`
+}
+
+type databaseMetricsCredentialsRoot struct {
+ Credentials *DatabaseMetricsCredentials `json:"credentials"`
+}
+
+type DatabaseMetricsCredentials struct {
+ BasicAuthUsername string `json:"basic_auth_username"`
+ BasicAuthPassword string `json:"basic_auth_password"`
+}
+
+type DatabaseUpdateMetricsCredentialsRequest struct {
+ Credentials *DatabaseMetricsCredentials `json:"credentials"`
+}
+
// DatabaseOptions represents the available database engines
type DatabaseOptions struct {
MongoDBOptions DatabaseEngineOptions `json:"mongodb"`
@@ -669,6 +862,7 @@ type DatabaseOptions struct {
PostgresSQLOptions DatabaseEngineOptions `json:"pg"`
RedisOptions DatabaseEngineOptions `json:"redis"`
KafkaOptions DatabaseEngineOptions `json:"kafka"`
+ OpensearchOptions DatabaseEngineOptions `json:"opensearch"`
}
// DatabaseEngineOptions represents the configuration options that are available for a given database engine
@@ -684,6 +878,45 @@ type DatabaseLayout struct {
Sizes []string `json:"sizes"`
}
+// ListDatabaseEvents contains a list of project events.
+type ListDatabaseEvents struct {
+ Events []DatabaseEvent `json:"events"`
+}
+
+// DatbaseEvent contains the information about a Datbase event.
+type DatabaseEvent struct {
+ ID string `json:"id"`
+ ServiceName string `json:"cluster_name"`
+ EventType string `json:"event_type"`
+ CreateTime string `json:"create_time"`
+}
+
+type ListDatabaseEventsRoot struct {
+ Events []DatabaseEvent `json:"events"`
+}
+
+type DatabaseIndex struct {
+ IndexName string `json:"index_name"`
+ NumberofShards uint64 `json:"number_of_shards"`
+ NumberofReplicas uint64 `json:"number_of_replicas"`
+ Size int64 `json:"size,omitempty"`
+ Health string `json:"health,omitempty"`
+ Status string `json:"status,omitempty"`
+ Docs int64 `json:"docs,omitempty"`
+ CreateTime string `json:"create_time"`
+ Replication *IndexReplication `json:"replication,omitempty"`
+}
+
+type IndexReplication struct {
+ LeaderIndex string `json:"leader_index,omitempty"`
+ LeaderProject string `json:"leader_project,omitempty"`
+ LeaderService string `json:"leader_service,omitempty"`
+}
+
+type databaseIndexesRoot struct {
+ Indexes []DatabaseIndex `json:"indexes"`
+}
+
// URN returns a URN identifier for the database
func (d Database) URN() string {
return ToURN("dbaas", d.ID)
@@ -810,6 +1043,20 @@ func (svc *DatabasesServiceOp) UpdateMaintenance(ctx context.Context, databaseID
return resp, nil
}
+// InstallUpdate starts installation of updates
+func (svc *DatabasesServiceOp) InstallUpdate(ctx context.Context, databaseID string) (*Response, error) {
+ path := fmt.Sprintf(databaseUpdateInstallationPath, databaseID)
+ req, err := svc.client.NewRequest(ctx, http.MethodPut, path, nil)
+ if err != nil {
+ return nil, err
+ }
+ resp, err := svc.client.Do(ctx, req, nil)
+ if err != nil {
+ return resp, err
+ }
+ return resp, nil
+}
+
// ListBackups returns a list of the current backups of a database
func (svc *DatabasesServiceOp) ListBackups(ctx context.Context, databaseID string, opts *ListOptions) ([]DatabaseBackup, *Response, error) {
path := fmt.Sprintf(databaseBackupsPath, databaseID)
@@ -1353,6 +1600,102 @@ func (svc *DatabasesServiceOp) UpdateMySQLConfig(ctx context.Context, databaseID
return resp, nil
}
+// GetMongoDBConfig retrieves the config for a MongoDB database cluster.
+func (svc *DatabasesServiceOp) GetMongoDBConfig(ctx context.Context, databaseID string) (*MongoDBConfig, *Response, error) {
+ path := fmt.Sprintf(databaseConfigPath, databaseID)
+ req, err := svc.client.NewRequest(ctx, http.MethodGet, path, nil)
+ if err != nil {
+ return nil, nil, err
+ }
+ root := new(databaseMongoDBConfigRoot)
+ resp, err := svc.client.Do(ctx, req, root)
+ if err != nil {
+ return nil, resp, err
+ }
+ return root.Config, resp, nil
+}
+
+// UpdateMongoDBConfig updates the config for a MongoDB database cluster.
+func (svc *DatabasesServiceOp) UpdateMongoDBConfig(ctx context.Context, databaseID string, config *MongoDBConfig) (*Response, error) {
+ path := fmt.Sprintf(databaseConfigPath, databaseID)
+ root := &databaseMongoDBConfigRoot{
+ Config: config,
+ }
+ req, err := svc.client.NewRequest(ctx, http.MethodPatch, path, root)
+ if err != nil {
+ return nil, err
+ }
+ resp, err := svc.client.Do(ctx, req, nil)
+ if err != nil {
+ return resp, err
+ }
+ return resp, nil
+}
+
+// GetKafkaConfig retrieves the config for a Kafka database cluster.
+func (svc *DatabasesServiceOp) GetKafkaConfig(ctx context.Context, databaseID string) (*KafkaConfig, *Response, error) {
+ path := fmt.Sprintf(databaseConfigPath, databaseID)
+ req, err := svc.client.NewRequest(ctx, http.MethodGet, path, nil)
+ if err != nil {
+ return nil, nil, err
+ }
+ root := new(databaseKafkaConfigRoot)
+ resp, err := svc.client.Do(ctx, req, root)
+ if err != nil {
+ return nil, resp, err
+ }
+ return root.Config, resp, nil
+}
+
+// UpdateKafkaConfig updates the config for a Kafka database cluster.
+func (svc *DatabasesServiceOp) UpdateKafkaConfig(ctx context.Context, databaseID string, config *KafkaConfig) (*Response, error) {
+ path := fmt.Sprintf(databaseConfigPath, databaseID)
+ root := &databaseKafkaConfigRoot{
+ Config: config,
+ }
+ req, err := svc.client.NewRequest(ctx, http.MethodPatch, path, root)
+ if err != nil {
+ return nil, err
+ }
+ resp, err := svc.client.Do(ctx, req, nil)
+ if err != nil {
+ return resp, err
+ }
+ return resp, nil
+}
+
+// GetOpensearchConfig retrieves the config for a Opensearch database cluster.
+func (svc *DatabasesServiceOp) GetOpensearchConfig(ctx context.Context, databaseID string) (*OpensearchConfig, *Response, error) {
+ path := fmt.Sprintf(databaseConfigPath, databaseID)
+ req, err := svc.client.NewRequest(ctx, http.MethodGet, path, nil)
+ if err != nil {
+ return nil, nil, err
+ }
+ root := new(databaseOpensearchConfigRoot)
+ resp, err := svc.client.Do(ctx, req, root)
+ if err != nil {
+ return nil, resp, err
+ }
+ return root.Config, resp, nil
+}
+
+// UpdateOpensearchConfig updates the config for a Opensearch database cluster.
+func (svc *DatabasesServiceOp) UpdateOpensearchConfig(ctx context.Context, databaseID string, config *OpensearchConfig) (*Response, error) {
+ path := fmt.Sprintf(databaseConfigPath, databaseID)
+ root := &databaseOpensearchConfigRoot{
+ Config: config,
+ }
+ req, err := svc.client.NewRequest(ctx, http.MethodPatch, path, root)
+ if err != nil {
+ return nil, err
+ }
+ resp, err := svc.client.Do(ctx, req, nil)
+ if err != nil {
+ return resp, err
+ }
+ return resp, nil
+}
+
// ListOptions gets the database options available.
func (svc *DatabasesServiceOp) ListOptions(ctx context.Context) (*DatabaseOptions, *Response, error) {
root := new(databaseOptionsRoot)
@@ -1462,3 +1805,165 @@ func (svc *DatabasesServiceOp) DeleteTopic(ctx context.Context, databaseID, name
}
return resp, nil
}
+
+// GetMetricsCredentials gets the credentials required to access a user's metrics endpoints
+func (svc *DatabasesServiceOp) GetMetricsCredentials(ctx context.Context) (*DatabaseMetricsCredentials, *Response, error) {
+ req, err := svc.client.NewRequest(ctx, http.MethodGet, databaseMetricsCredentialsPath, nil)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ root := new(databaseMetricsCredentialsRoot)
+ resp, err := svc.client.Do(ctx, req, root)
+ if err != nil {
+ return nil, resp, err
+ }
+ return root.Credentials, resp, nil
+}
+
+// UpdateMetricsAuth updates the credentials required to access a user's metrics endpoints
+func (svc *DatabasesServiceOp) UpdateMetricsCredentials(ctx context.Context, updateCreds *DatabaseUpdateMetricsCredentialsRequest) (*Response, error) {
+ req, err := svc.client.NewRequest(ctx, http.MethodPut, databaseMetricsCredentialsPath, updateCreds)
+ if err != nil {
+ return nil, err
+ }
+ resp, err := svc.client.Do(ctx, req, nil)
+ if err != nil {
+ return resp, err
+ }
+ return resp, nil
+}
+
+// ListDatabaseEvents returns all the events for a given cluster
+func (svc *DatabasesServiceOp) ListDatabaseEvents(ctx context.Context, databaseID string, opts *ListOptions) ([]DatabaseEvent, *Response, error) {
+ path := fmt.Sprintf(databaseEvents, databaseID)
+ path, err := addOptions(path, opts)
+ if err != nil {
+ return nil, nil, err
+ }
+ root := new(ListDatabaseEventsRoot)
+ req, err := svc.client.NewRequest(ctx, http.MethodGet, path, nil)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ resp, err := svc.client.Do(ctx, req, root)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return root.Events, resp, nil
+}
+
+// ListIndexes returns all indexes for a given opensearch cluster
+func (svc *DatabasesServiceOp) ListIndexes(ctx context.Context, databaseID string, opts *ListOptions) ([]DatabaseIndex, *Response, error) {
+ path := fmt.Sprintf(databaseIndexesPath, databaseID)
+ path, err := addOptions(path, opts)
+ if err != nil {
+ return nil, nil, err
+ }
+ req, err := svc.client.NewRequest(ctx, http.MethodGet, path, nil)
+ if err != nil {
+ return nil, nil, err
+ }
+ root := new(databaseIndexesRoot)
+ resp, err := svc.client.Do(ctx, req, root)
+ if err != nil {
+ return nil, resp, err
+ }
+ return root.Indexes, resp, nil
+}
+
+// DeleteIndex will delete an existing opensearch index
+func (svc *DatabasesServiceOp) DeleteIndex(ctx context.Context, databaseID, name string) (*Response, error) {
+ path := fmt.Sprintf(databaseIndexPath, databaseID, name)
+ req, err := svc.client.NewRequest(ctx, http.MethodDelete, path, nil)
+ if err != nil {
+ return nil, err
+ }
+ resp, err := svc.client.Do(ctx, req, nil)
+ if err != nil {
+ return resp, err
+ }
+ return resp, nil
+}
+
+// CreateLogsink creates a new logsink for a database
+func (svc *DatabasesServiceOp) CreateLogsink(ctx context.Context, databaseID string, createLogsink *DatabaseCreateLogsinkRequest) (*DatabaseLogsink, *Response, error) {
+ path := fmt.Sprintf(databaseLogsinksPath, databaseID)
+ req, err := svc.client.NewRequest(ctx, http.MethodPost, path, createLogsink)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ root := new(DatabaseLogsink)
+ resp, err := svc.client.Do(ctx, req, root)
+ if err != nil {
+ return nil, resp, err
+ }
+ return root, resp, nil
+}
+
+// GetLogsink gets a logsink for a database
+func (svc *DatabasesServiceOp) GetLogsink(ctx context.Context, databaseID string, logsinkID string) (*DatabaseLogsink, *Response, error) {
+ path := fmt.Sprintf(databaseLogsinkPath, databaseID, logsinkID)
+ req, err := svc.client.NewRequest(ctx, http.MethodGet, path, nil)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ root := new(DatabaseLogsink)
+ resp, err := svc.client.Do(ctx, req, root)
+ if err != nil {
+ return nil, resp, err
+ }
+ return root, resp, nil
+}
+
+// ListTopics returns all topics for a given kafka cluster
+func (svc *DatabasesServiceOp) ListLogsinks(ctx context.Context, databaseID string, opts *ListOptions) ([]DatabaseLogsink, *Response, error) {
+ path := fmt.Sprintf(databaseLogsinksPath, databaseID)
+ path, err := addOptions(path, opts)
+ if err != nil {
+ return nil, nil, err
+ }
+ req, err := svc.client.NewRequest(ctx, http.MethodGet, path, nil)
+ if err != nil {
+ return nil, nil, err
+ }
+ root := new(databaseLogsinksRoot)
+ resp, err := svc.client.Do(ctx, req, root)
+ if err != nil {
+ return nil, resp, err
+ }
+ return root.Sinks, resp, nil
+}
+
+// UpdateLogsink updates a logsink for a database cluster
+func (svc *DatabasesServiceOp) UpdateLogsink(ctx context.Context, databaseID string, logsinkID string, updateLogsink *DatabaseUpdateLogsinkRequest) (*Response, error) {
+ path := fmt.Sprintf(databaseLogsinkPath, databaseID, logsinkID)
+ req, err := svc.client.NewRequest(ctx, http.MethodPut, path, updateLogsink)
+ if err != nil {
+ return nil, err
+ }
+
+ resp, err := svc.client.Do(ctx, req, nil)
+ if err != nil {
+ return resp, err
+ }
+ return resp, nil
+}
+
+// DeleteLogsink deletes a logsink for a database cluster
+func (svc *DatabasesServiceOp) DeleteLogsink(ctx context.Context, databaseID, logsinkID string) (*Response, error) {
+ path := fmt.Sprintf(databaseLogsinkPath, databaseID, logsinkID)
+ req, err := svc.client.NewRequest(ctx, http.MethodDelete, path, nil)
+ if err != nil {
+ return nil, err
+ }
+ resp, err := svc.client.Do(ctx, req, nil)
+ if err != nil {
+ return resp, err
+ }
+ return resp, nil
+}
diff --git a/vendor/github.com/digitalocean/godo/droplet_actions.go b/vendor/github.com/digitalocean/godo/droplet_actions.go
index 2e09d0c5..ed0f583c 100644
--- a/vendor/github.com/digitalocean/godo/droplet_actions.go
+++ b/vendor/github.com/digitalocean/godo/droplet_actions.go
@@ -30,6 +30,8 @@ type DropletActionsService interface {
SnapshotByTag(context.Context, string, string) ([]Action, *Response, error)
EnableBackups(context.Context, int) (*Action, *Response, error)
EnableBackupsByTag(context.Context, string) ([]Action, *Response, error)
+ EnableBackupsWithPolicy(context.Context, int, *DropletBackupPolicyRequest) (*Action, *Response, error)
+ ChangeBackupPolicy(context.Context, int, *DropletBackupPolicyRequest) (*Action, *Response, error)
DisableBackups(context.Context, int) (*Action, *Response, error)
DisableBackupsByTag(context.Context, string) ([]Action, *Response, error)
PasswordReset(context.Context, int) (*Action, *Response, error)
@@ -169,6 +171,42 @@ func (s *DropletActionsServiceOp) EnableBackupsByTag(ctx context.Context, tag st
return s.doActionByTag(ctx, tag, request)
}
+// EnableBackupsWithPolicy enables droplet's backup with a backup policy applied.
+func (s *DropletActionsServiceOp) EnableBackupsWithPolicy(ctx context.Context, id int, policy *DropletBackupPolicyRequest) (*Action, *Response, error) {
+ if policy == nil {
+ return nil, nil, NewArgError("policy", "policy can't be nil")
+ }
+
+ policyMap := map[string]interface{}{
+ "plan": policy.Plan,
+ "weekday": policy.Weekday,
+ }
+ if policy.Hour != nil {
+ policyMap["hour"] = policy.Hour
+ }
+
+ request := &ActionRequest{"type": "enable_backups", "backup_policy": policyMap}
+ return s.doAction(ctx, id, request)
+}
+
+// ChangeBackupPolicy updates a backup policy when backups are enabled.
+func (s *DropletActionsServiceOp) ChangeBackupPolicy(ctx context.Context, id int, policy *DropletBackupPolicyRequest) (*Action, *Response, error) {
+ if policy == nil {
+ return nil, nil, NewArgError("policy", "policy can't be nil")
+ }
+
+ policyMap := map[string]interface{}{
+ "plan": policy.Plan,
+ "weekday": policy.Weekday,
+ }
+ if policy.Hour != nil {
+ policyMap["hour"] = policy.Hour
+ }
+
+ request := &ActionRequest{"type": "change_backup_policy", "backup_policy": policyMap}
+ return s.doAction(ctx, id, request)
+}
+
// DisableBackups disables backups for a Droplet.
func (s *DropletActionsServiceOp) DisableBackups(ctx context.Context, id int) (*Action, *Response, error) {
request := &ActionRequest{"type": "disable_backups"}
diff --git a/vendor/github.com/digitalocean/godo/droplet_autoscale.go b/vendor/github.com/digitalocean/godo/droplet_autoscale.go
new file mode 100644
index 00000000..4ef9dff8
--- /dev/null
+++ b/vendor/github.com/digitalocean/godo/droplet_autoscale.go
@@ -0,0 +1,258 @@
+package godo
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "time"
+)
+
+const (
+ dropletAutoscaleBasePath = "/v2/droplets/autoscale"
+)
+
+// DropletAutoscaleService defines an interface for managing droplet autoscale pools through DigitalOcean API
+type DropletAutoscaleService interface {
+ Create(context.Context, *DropletAutoscalePoolRequest) (*DropletAutoscalePool, *Response, error)
+ Get(context.Context, string) (*DropletAutoscalePool, *Response, error)
+ List(context.Context, *ListOptions) ([]*DropletAutoscalePool, *Response, error)
+ ListMembers(context.Context, string, *ListOptions) ([]*DropletAutoscaleResource, *Response, error)
+ ListHistory(context.Context, string, *ListOptions) ([]*DropletAutoscaleHistoryEvent, *Response, error)
+ Update(context.Context, string, *DropletAutoscalePoolRequest) (*DropletAutoscalePool, *Response, error)
+ Delete(context.Context, string) (*Response, error)
+ DeleteDangerous(context.Context, string) (*Response, error)
+}
+
+// DropletAutoscalePool represents a DigitalOcean droplet autoscale pool
+type DropletAutoscalePool struct {
+ ID string `json:"id"`
+ Name string `json:"name"`
+ Config *DropletAutoscaleConfiguration `json:"config"`
+ DropletTemplate *DropletAutoscaleResourceTemplate `json:"droplet_template"`
+ CreatedAt time.Time `json:"created_at"`
+ UpdatedAt time.Time `json:"updated_at"`
+ CurrentUtilization *DropletAutoscaleResourceUtilization `json:"current_utilization,omitempty"`
+ Status string `json:"status"`
+}
+
+// DropletAutoscaleConfiguration represents a DigitalOcean droplet autoscale pool configuration
+type DropletAutoscaleConfiguration struct {
+ MinInstances uint64 `json:"min_instances,omitempty"`
+ MaxInstances uint64 `json:"max_instances,omitempty"`
+ TargetCPUUtilization float64 `json:"target_cpu_utilization,omitempty"`
+ TargetMemoryUtilization float64 `json:"target_memory_utilization,omitempty"`
+ CooldownMinutes uint32 `json:"cooldown_minutes,omitempty"`
+ TargetNumberInstances uint64 `json:"target_number_instances,omitempty"`
+}
+
+// DropletAutoscaleResourceTemplate represents a DigitalOcean droplet autoscale pool resource template
+type DropletAutoscaleResourceTemplate struct {
+ Size string `json:"size"`
+ Region string `json:"region"`
+ Image string `json:"image"`
+ Tags []string `json:"tags"`
+ SSHKeys []string `json:"ssh_keys"`
+ VpcUUID string `json:"vpc_uuid"`
+ WithDropletAgent bool `json:"with_droplet_agent"`
+ ProjectID string `json:"project_id"`
+ IPV6 bool `json:"ipv6"`
+ UserData string `json:"user_data"`
+}
+
+// DropletAutoscaleResourceUtilization represents a DigitalOcean droplet autoscale pool resource utilization
+type DropletAutoscaleResourceUtilization struct {
+ Memory float64 `json:"memory,omitempty"`
+ CPU float64 `json:"cpu,omitempty"`
+}
+
+// DropletAutoscaleResource represents a DigitalOcean droplet autoscale pool resource
+type DropletAutoscaleResource struct {
+ DropletID uint64 `json:"droplet_id"`
+ CreatedAt time.Time `json:"created_at"`
+ UpdatedAt time.Time `json:"updated_at"`
+ HealthStatus string `json:"health_status"`
+ UnhealthyReason string `json:"unhealthy_reason,omitempty"`
+ Status string `json:"status"`
+ CurrentUtilization *DropletAutoscaleResourceUtilization `json:"current_utilization,omitempty"`
+}
+
+// DropletAutoscaleHistoryEvent represents a DigitalOcean droplet autoscale pool history event
+type DropletAutoscaleHistoryEvent struct {
+ HistoryEventID string `json:"history_event_id"`
+ CurrentInstanceCount uint64 `json:"current_instance_count"`
+ DesiredInstanceCount uint64 `json:"desired_instance_count"`
+ Reason string `json:"reason"`
+ Status string `json:"status"`
+ ErrorReason string `json:"error_reason,omitempty"`
+ CreatedAt time.Time `json:"created_at"`
+ UpdatedAt time.Time `json:"updated_at"`
+}
+
+// DropletAutoscalePoolRequest represents a DigitalOcean droplet autoscale pool create/update request
+type DropletAutoscalePoolRequest struct {
+ Name string `json:"name"`
+ Config *DropletAutoscaleConfiguration `json:"config"`
+ DropletTemplate *DropletAutoscaleResourceTemplate `json:"droplet_template"`
+}
+
+type dropletAutoscalePoolRoot struct {
+ AutoscalePool *DropletAutoscalePool `json:"autoscale_pool"`
+}
+
+type dropletAutoscalePoolsRoot struct {
+ AutoscalePools []*DropletAutoscalePool `json:"autoscale_pools"`
+ Links *Links `json:"links"`
+ Meta *Meta `json:"meta"`
+}
+
+type dropletAutoscaleMembersRoot struct {
+ Droplets []*DropletAutoscaleResource `json:"droplets"`
+ Links *Links `json:"links"`
+ Meta *Meta `json:"meta"`
+}
+
+type dropletAutoscaleHistoryEventsRoot struct {
+ History []*DropletAutoscaleHistoryEvent `json:"history"`
+ Links *Links `json:"links"`
+ Meta *Meta `json:"meta"`
+}
+
+// DropletAutoscaleServiceOp handles communication with droplet autoscale-related methods of the DigitalOcean API
+type DropletAutoscaleServiceOp struct {
+ client *Client
+}
+
+var _ DropletAutoscaleService = &DropletAutoscaleServiceOp{}
+
+// Create a new droplet autoscale pool
+func (d *DropletAutoscaleServiceOp) Create(ctx context.Context, createReq *DropletAutoscalePoolRequest) (*DropletAutoscalePool, *Response, error) {
+ req, err := d.client.NewRequest(ctx, http.MethodPost, dropletAutoscaleBasePath, createReq)
+ if err != nil {
+ return nil, nil, err
+ }
+ root := new(dropletAutoscalePoolRoot)
+ resp, err := d.client.Do(ctx, req, root)
+ if err != nil {
+ return nil, nil, err
+ }
+ return root.AutoscalePool, resp, nil
+}
+
+// Get an existing droplet autoscale pool
+func (d *DropletAutoscaleServiceOp) Get(ctx context.Context, id string) (*DropletAutoscalePool, *Response, error) {
+ req, err := d.client.NewRequest(ctx, http.MethodGet, fmt.Sprintf("%s/%s", dropletAutoscaleBasePath, id), nil)
+ if err != nil {
+ return nil, nil, err
+ }
+ root := new(dropletAutoscalePoolRoot)
+ resp, err := d.client.Do(ctx, req, root)
+ if err != nil {
+ return nil, nil, err
+ }
+ return root.AutoscalePool, resp, err
+}
+
+// List all existing droplet autoscale pools
+func (d *DropletAutoscaleServiceOp) List(ctx context.Context, opts *ListOptions) ([]*DropletAutoscalePool, *Response, error) {
+ path, err := addOptions(dropletAutoscaleBasePath, opts)
+ if err != nil {
+ return nil, nil, err
+ }
+ req, err := d.client.NewRequest(ctx, http.MethodGet, path, nil)
+ if err != nil {
+ return nil, nil, err
+ }
+ root := new(dropletAutoscalePoolsRoot)
+ resp, err := d.client.Do(ctx, req, root)
+ if err != nil {
+ return nil, nil, err
+ }
+ if root.Links != nil {
+ resp.Links = root.Links
+ }
+ if root.Meta != nil {
+ resp.Meta = root.Meta
+ }
+ return root.AutoscalePools, resp, err
+}
+
+// ListMembers all members for an existing droplet autoscale pool
+func (d *DropletAutoscaleServiceOp) ListMembers(ctx context.Context, id string, opts *ListOptions) ([]*DropletAutoscaleResource, *Response, error) {
+ path, err := addOptions(fmt.Sprintf("%s/%s/members", dropletAutoscaleBasePath, id), opts)
+ if err != nil {
+ return nil, nil, err
+ }
+ req, err := d.client.NewRequest(ctx, http.MethodGet, path, nil)
+ if err != nil {
+ return nil, nil, err
+ }
+ root := new(dropletAutoscaleMembersRoot)
+ resp, err := d.client.Do(ctx, req, root)
+ if err != nil {
+ return nil, nil, err
+ }
+ if root.Links != nil {
+ resp.Links = root.Links
+ }
+ if root.Meta != nil {
+ resp.Meta = root.Meta
+ }
+ return root.Droplets, resp, err
+}
+
+// ListHistory all history events for an existing droplet autoscale pool
+func (d *DropletAutoscaleServiceOp) ListHistory(ctx context.Context, id string, opts *ListOptions) ([]*DropletAutoscaleHistoryEvent, *Response, error) {
+ path, err := addOptions(fmt.Sprintf("%s/%s/history", dropletAutoscaleBasePath, id), opts)
+ if err != nil {
+ return nil, nil, err
+ }
+ req, err := d.client.NewRequest(ctx, http.MethodGet, path, nil)
+ if err != nil {
+ return nil, nil, err
+ }
+ root := new(dropletAutoscaleHistoryEventsRoot)
+ resp, err := d.client.Do(ctx, req, root)
+ if err != nil {
+ return nil, nil, err
+ }
+ if root.Links != nil {
+ resp.Links = root.Links
+ }
+ if root.Meta != nil {
+ resp.Meta = root.Meta
+ }
+ return root.History, resp, err
+}
+
+// Update an existing autoscale pool
+func (d *DropletAutoscaleServiceOp) Update(ctx context.Context, id string, updateReq *DropletAutoscalePoolRequest) (*DropletAutoscalePool, *Response, error) {
+ req, err := d.client.NewRequest(ctx, http.MethodPut, fmt.Sprintf("%s/%s", dropletAutoscaleBasePath, id), updateReq)
+ if err != nil {
+ return nil, nil, err
+ }
+ root := new(dropletAutoscalePoolRoot)
+ resp, err := d.client.Do(ctx, req, root)
+ if err != nil {
+ return nil, nil, err
+ }
+ return root.AutoscalePool, resp, nil
+}
+
+// Delete an existing autoscale pool
+func (d *DropletAutoscaleServiceOp) Delete(ctx context.Context, id string) (*Response, error) {
+ req, err := d.client.NewRequest(ctx, http.MethodDelete, fmt.Sprintf("%s/%s", dropletAutoscaleBasePath, id), nil)
+ if err != nil {
+ return nil, err
+ }
+ return d.client.Do(ctx, req, nil)
+}
+
+// DeleteDangerous deletes an existing autoscale pool with all underlying resources
+func (d *DropletAutoscaleServiceOp) DeleteDangerous(ctx context.Context, id string) (*Response, error) {
+ req, err := d.client.NewRequest(ctx, http.MethodDelete, fmt.Sprintf("%s/%s/dangerous", dropletAutoscaleBasePath, id), nil)
+ req.Header.Set("X-Dangerous", "true")
+ if err != nil {
+ return nil, err
+ }
+ return d.client.Do(ctx, req, nil)
+}
diff --git a/vendor/github.com/digitalocean/godo/droplets.go b/vendor/github.com/digitalocean/godo/droplets.go
index 5f198636..2ddd7d6b 100644
--- a/vendor/github.com/digitalocean/godo/droplets.go
+++ b/vendor/github.com/digitalocean/godo/droplets.go
@@ -17,6 +17,7 @@ var errNoNetworks = errors.New("no networks have been defined")
// See: https://docs.digitalocean.com/reference/api/api-reference/#tag/Droplets
type DropletsService interface {
List(context.Context, *ListOptions) ([]Droplet, *Response, error)
+ ListWithGPUs(context.Context, *ListOptions) ([]Droplet, *Response, error)
ListByName(context.Context, string, *ListOptions) ([]Droplet, *Response, error)
ListByTag(context.Context, string, *ListOptions) ([]Droplet, *Response, error)
Get(context.Context, int) (*Droplet, *Response, error)
@@ -29,6 +30,9 @@ type DropletsService interface {
Backups(context.Context, int, *ListOptions) ([]Image, *Response, error)
Actions(context.Context, int, *ListOptions) ([]Action, *Response, error)
Neighbors(context.Context, int) ([]Droplet, *Response, error)
+ GetBackupPolicy(context.Context, int) (*DropletBackupPolicy, *Response, error)
+ ListBackupPolicies(context.Context, *ListOptions) (map[int]*DropletBackupPolicy, *Response, error)
+ ListSupportedBackupPolicies(context.Context) ([]*SupportedBackupPolicy, *Response, error)
}
// DropletsServiceOp handles communication with the Droplet related methods of the
@@ -217,37 +221,46 @@ func (d DropletCreateSSHKey) MarshalJSON() ([]byte, error) {
// DropletCreateRequest represents a request to create a Droplet.
type DropletCreateRequest struct {
- Name string `json:"name"`
- Region string `json:"region"`
- Size string `json:"size"`
- Image DropletCreateImage `json:"image"`
- SSHKeys []DropletCreateSSHKey `json:"ssh_keys"`
- Backups bool `json:"backups"`
- IPv6 bool `json:"ipv6"`
- PrivateNetworking bool `json:"private_networking"`
- Monitoring bool `json:"monitoring"`
- UserData string `json:"user_data,omitempty"`
- Volumes []DropletCreateVolume `json:"volumes,omitempty"`
- Tags []string `json:"tags"`
- VPCUUID string `json:"vpc_uuid,omitempty"`
- WithDropletAgent *bool `json:"with_droplet_agent,omitempty"`
+ Name string `json:"name"`
+ Region string `json:"region"`
+ Size string `json:"size"`
+ Image DropletCreateImage `json:"image"`
+ SSHKeys []DropletCreateSSHKey `json:"ssh_keys"`
+ Backups bool `json:"backups"`
+ IPv6 bool `json:"ipv6"`
+ PrivateNetworking bool `json:"private_networking"`
+ Monitoring bool `json:"monitoring"`
+ UserData string `json:"user_data,omitempty"`
+ Volumes []DropletCreateVolume `json:"volumes,omitempty"`
+ Tags []string `json:"tags"`
+ VPCUUID string `json:"vpc_uuid,omitempty"`
+ WithDropletAgent *bool `json:"with_droplet_agent,omitempty"`
+ BackupPolicy *DropletBackupPolicyRequest `json:"backup_policy,omitempty"`
}
// DropletMultiCreateRequest is a request to create multiple Droplets.
type DropletMultiCreateRequest struct {
- Names []string `json:"names"`
- Region string `json:"region"`
- Size string `json:"size"`
- Image DropletCreateImage `json:"image"`
- SSHKeys []DropletCreateSSHKey `json:"ssh_keys"`
- Backups bool `json:"backups"`
- IPv6 bool `json:"ipv6"`
- PrivateNetworking bool `json:"private_networking"`
- Monitoring bool `json:"monitoring"`
- UserData string `json:"user_data,omitempty"`
- Tags []string `json:"tags"`
- VPCUUID string `json:"vpc_uuid,omitempty"`
- WithDropletAgent *bool `json:"with_droplet_agent,omitempty"`
+ Names []string `json:"names"`
+ Region string `json:"region"`
+ Size string `json:"size"`
+ Image DropletCreateImage `json:"image"`
+ SSHKeys []DropletCreateSSHKey `json:"ssh_keys"`
+ Backups bool `json:"backups"`
+ IPv6 bool `json:"ipv6"`
+ PrivateNetworking bool `json:"private_networking"`
+ Monitoring bool `json:"monitoring"`
+ UserData string `json:"user_data,omitempty"`
+ Tags []string `json:"tags"`
+ VPCUUID string `json:"vpc_uuid,omitempty"`
+ WithDropletAgent *bool `json:"with_droplet_agent,omitempty"`
+ BackupPolicy *DropletBackupPolicyRequest `json:"backup_policy,omitempty"`
+}
+
+// DropletBackupPolicyRequest defines the backup policy when creating a Droplet.
+type DropletBackupPolicyRequest struct {
+ Plan string `json:"plan,omitempty"`
+ Weekday string `json:"weekday,omitempty"`
+ Hour *int `json:"hour,omitempty"`
}
func (d DropletCreateRequest) String() string {
@@ -321,6 +334,17 @@ func (s *DropletsServiceOp) List(ctx context.Context, opt *ListOptions) ([]Dropl
return s.list(ctx, path)
}
+// ListWithGPUs lists all Droplets with GPUs.
+func (s *DropletsServiceOp) ListWithGPUs(ctx context.Context, opt *ListOptions) ([]Droplet, *Response, error) {
+ path := fmt.Sprintf("%s?type=gpus", dropletBasePath)
+ path, err := addOptions(path, opt)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ return s.list(ctx, path)
+}
+
// ListByName lists all Droplets filtered by name returning only exact matches.
// It is case-insensitive
func (s *DropletsServiceOp) ListByName(ctx context.Context, name string, opt *ListOptions) ([]Droplet, *Response, error) {
@@ -606,3 +630,109 @@ func (s *DropletsServiceOp) dropletActionStatus(ctx context.Context, uri string)
return action.Status, nil
}
+
+// DropletBackupPolicy defines the information about a droplet's backup policy.
+type DropletBackupPolicy struct {
+ DropletID int `json:"droplet_id,omitempty"`
+ BackupEnabled bool `json:"backup_enabled,omitempty"`
+ BackupPolicy *DropletBackupPolicyConfig `json:"backup_policy,omitempty"`
+ NextBackupWindow *BackupWindow `json:"next_backup_window,omitempty"`
+}
+
+// DropletBackupPolicyConfig defines the backup policy for a Droplet.
+type DropletBackupPolicyConfig struct {
+ Plan string `json:"plan,omitempty"`
+ Weekday string `json:"weekday,omitempty"`
+ Hour int `json:"hour,omitempty"`
+ WindowLengthHours int `json:"window_length_hours,omitempty"`
+ RetentionPeriodDays int `json:"retention_period_days,omitempty"`
+}
+
+// dropletBackupPolicyRoot represents a DropletBackupPolicy root
+type dropletBackupPolicyRoot struct {
+ DropletBackupPolicy *DropletBackupPolicy `json:"policy,omitempty"`
+}
+
+type dropletBackupPoliciesRoot struct {
+ DropletBackupPolicies map[int]*DropletBackupPolicy `json:"policies,omitempty"`
+ Links *Links `json:"links,omitempty"`
+ Meta *Meta `json:"meta"`
+}
+
+// Get individual droplet backup policy.
+func (s *DropletsServiceOp) GetBackupPolicy(ctx context.Context, dropletID int) (*DropletBackupPolicy, *Response, error) {
+ if dropletID < 1 {
+ return nil, nil, NewArgError("dropletID", "cannot be less than 1")
+ }
+
+ path := fmt.Sprintf("%s/%d/backups/policy", dropletBasePath, dropletID)
+
+ req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ root := new(dropletBackupPolicyRoot)
+ resp, err := s.client.Do(ctx, req, root)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return root.DropletBackupPolicy, resp, err
+}
+
+// List all droplet backup policies.
+func (s *DropletsServiceOp) ListBackupPolicies(ctx context.Context, opt *ListOptions) (map[int]*DropletBackupPolicy, *Response, error) {
+ path := fmt.Sprintf("%s/backups/policies", dropletBasePath)
+ path, err := addOptions(path, opt)
+ if err != nil {
+ return nil, nil, err
+ }
+ req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ root := new(dropletBackupPoliciesRoot)
+ resp, err := s.client.Do(ctx, req, root)
+ if err != nil {
+ return nil, resp, err
+ }
+ if l := root.Links; l != nil {
+ resp.Links = l
+ }
+ if m := root.Meta; m != nil {
+ resp.Meta = m
+ }
+
+ return root.DropletBackupPolicies, resp, nil
+}
+
+type SupportedBackupPolicy struct {
+ Name string `json:"name,omitempty"`
+ PossibleWindowStarts []int `json:"possible_window_starts,omitempty"`
+ WindowLengthHours int `json:"window_length_hours,omitempty"`
+ RetentionPeriodDays int `json:"retention_period_days,omitempty"`
+ PossibleDays []string `json:"possible_days,omitempty"`
+}
+
+type dropletSupportedBackupPoliciesRoot struct {
+ SupportedBackupPolicies []*SupportedBackupPolicy `json:"supported_policies,omitempty"`
+}
+
+// List supported droplet backup policies.
+func (s *DropletsServiceOp) ListSupportedBackupPolicies(ctx context.Context) ([]*SupportedBackupPolicy, *Response, error) {
+ path := fmt.Sprintf("%s/backups/supported_policies", dropletBasePath)
+ req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ root := new(dropletSupportedBackupPoliciesRoot)
+ resp, err := s.client.Do(ctx, req, root)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return root.SupportedBackupPolicies, resp, nil
+}
diff --git a/vendor/github.com/digitalocean/godo/godo.go b/vendor/github.com/digitalocean/godo/godo.go
index 95d20323..4b9ad6b6 100644
--- a/vendor/github.com/digitalocean/godo/godo.go
+++ b/vendor/github.com/digitalocean/godo/godo.go
@@ -21,7 +21,7 @@ import (
)
const (
- libraryVersion = "1.108.0"
+ libraryVersion = "1.130.0"
defaultBaseURL = "https://api.digitalocean.com/"
userAgent = "godo/" + libraryVersion
mediaType = "application/json"
@@ -65,6 +65,7 @@ type Client struct {
Domains DomainsService
Droplets DropletsService
DropletActions DropletActionsService
+ DropletAutoscale DropletAutoscaleService
Firewalls FirewallsService
FloatingIPs FloatingIPsService
FloatingIPActions FloatingIPActionsService
@@ -80,6 +81,7 @@ type Client struct {
Projects ProjectsService
Regions RegionsService
Registry RegistryService
+ Registries RegistriesService
ReservedIPs ReservedIPsService
ReservedIPActions ReservedIPActionsService
Sizes SizesService
@@ -275,6 +277,7 @@ func NewClient(httpClient *http.Client) *Client {
c.Domains = &DomainsServiceOp{client: c}
c.Droplets = &DropletsServiceOp{client: c}
c.DropletActions = &DropletActionsServiceOp{client: c}
+ c.DropletAutoscale = &DropletAutoscaleServiceOp{client: c}
c.Firewalls = &FirewallsServiceOp{client: c}
c.FloatingIPs = &FloatingIPsServiceOp{client: c}
c.FloatingIPActions = &FloatingIPActionsServiceOp{client: c}
@@ -290,6 +293,7 @@ func NewClient(httpClient *http.Client) *Client {
c.Projects = &ProjectsServiceOp{client: c}
c.Regions = &RegionsServiceOp{client: c}
c.Registry = &RegistryServiceOp{client: c}
+ c.Registries = &RegistriesServiceOp{client: c}
c.ReservedIPs = &ReservedIPsServiceOp{client: c}
c.ReservedIPActions = &ReservedIPActionsServiceOp{client: c}
c.Sizes = &SizesServiceOp{client: c}
diff --git a/vendor/github.com/digitalocean/godo/kubernetes.go b/vendor/github.com/digitalocean/godo/kubernetes.go
index 38c380a5..9b3bcfa1 100644
--- a/vendor/github.com/digitalocean/godo/kubernetes.go
+++ b/vendor/github.com/digitalocean/godo/kubernetes.go
@@ -65,29 +65,33 @@ type KubernetesServiceOp struct {
// KubernetesClusterCreateRequest represents a request to create a Kubernetes cluster.
type KubernetesClusterCreateRequest struct {
- Name string `json:"name,omitempty"`
- RegionSlug string `json:"region,omitempty"`
- VersionSlug string `json:"version,omitempty"`
- Tags []string `json:"tags,omitempty"`
- VPCUUID string `json:"vpc_uuid,omitempty"`
+ Name string `json:"name,omitempty"`
+ RegionSlug string `json:"region,omitempty"`
+ VersionSlug string `json:"version,omitempty"`
+ Tags []string `json:"tags,omitempty"`
+ VPCUUID string `json:"vpc_uuid,omitempty"`
+ ClusterSubnet string `json:"cluster_subnet,omitempty"`
+ ServiceSubnet string `json:"service_subnet,omitempty"`
// Create cluster with highly available control plane
HA bool `json:"ha"`
NodePools []*KubernetesNodePoolCreateRequest `json:"node_pools,omitempty"`
- MaintenancePolicy *KubernetesMaintenancePolicy `json:"maintenance_policy"`
- AutoUpgrade bool `json:"auto_upgrade"`
- SurgeUpgrade bool `json:"surge_upgrade"`
+ MaintenancePolicy *KubernetesMaintenancePolicy `json:"maintenance_policy"`
+ AutoUpgrade bool `json:"auto_upgrade"`
+ SurgeUpgrade bool `json:"surge_upgrade"`
+ ControlPlaneFirewall *KubernetesControlPlaneFirewall `json:"control_plane_firewall,omitempty"`
}
// KubernetesClusterUpdateRequest represents a request to update a Kubernetes cluster.
type KubernetesClusterUpdateRequest struct {
- Name string `json:"name,omitempty"`
- Tags []string `json:"tags,omitempty"`
- MaintenancePolicy *KubernetesMaintenancePolicy `json:"maintenance_policy,omitempty"`
- AutoUpgrade *bool `json:"auto_upgrade,omitempty"`
- SurgeUpgrade bool `json:"surge_upgrade,omitempty"`
+ Name string `json:"name,omitempty"`
+ Tags []string `json:"tags,omitempty"`
+ MaintenancePolicy *KubernetesMaintenancePolicy `json:"maintenance_policy,omitempty"`
+ AutoUpgrade *bool `json:"auto_upgrade,omitempty"`
+ SurgeUpgrade bool `json:"surge_upgrade,omitempty"`
+ ControlPlaneFirewall *KubernetesControlPlaneFirewall `json:"control_plane_firewall,omitempty"`
// Convert cluster to run highly available control plane
HA *bool `json:"ha,omitempty"`
@@ -201,10 +205,11 @@ type KubernetesCluster struct {
NodePools []*KubernetesNodePool `json:"node_pools,omitempty"`
- MaintenancePolicy *KubernetesMaintenancePolicy `json:"maintenance_policy,omitempty"`
- AutoUpgrade bool `json:"auto_upgrade,omitempty"`
- SurgeUpgrade bool `json:"surge_upgrade,omitempty"`
- RegistryEnabled bool `json:"registry_enabled,omitempty"`
+ MaintenancePolicy *KubernetesMaintenancePolicy `json:"maintenance_policy,omitempty"`
+ AutoUpgrade bool `json:"auto_upgrade,omitempty"`
+ SurgeUpgrade bool `json:"surge_upgrade,omitempty"`
+ RegistryEnabled bool `json:"registry_enabled,omitempty"`
+ ControlPlaneFirewall *KubernetesControlPlaneFirewall `json:"control_plane_firewall,omitempty"`
Status *KubernetesClusterStatus `json:"status,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
@@ -240,6 +245,12 @@ type KubernetesMaintenancePolicy struct {
Day KubernetesMaintenancePolicyDay `json:"day"`
}
+// KubernetesControlPlaneFirewall represents Kubernetes cluster control plane firewall.
+type KubernetesControlPlaneFirewall struct {
+ Enabled *bool `json:"enabled"`
+ AllowedAddresses []string `json:"allowed_addresses"`
+}
+
// KubernetesMaintenancePolicyDay represents the possible days of a maintenance
// window
type KubernetesMaintenancePolicyDay int
diff --git a/vendor/github.com/digitalocean/godo/load_balancers.go b/vendor/github.com/digitalocean/godo/load_balancers.go
index 7e1cfc16..a24952b7 100644
--- a/vendor/github.com/digitalocean/godo/load_balancers.go
+++ b/vendor/github.com/digitalocean/godo/load_balancers.go
@@ -7,15 +7,21 @@ import (
)
const (
+ cachePath = "cache"
dropletsPath = "droplets"
forwardingRulesPath = "forwarding_rules"
loadBalancersBasePath = "/v2/load_balancers"
)
-// Load Balancer types.
const (
- LoadBalancerTypeGlobal = "GLOBAL"
- LoadBalancerTypeRegional = "REGIONAL"
+ // Load Balancer types
+ LoadBalancerTypeGlobal = "GLOBAL"
+ LoadBalancerTypeRegional = "REGIONAL"
+ LoadBalancerTypeRegionalNetwork = "REGIONAL_NETWORK"
+
+ // Load Balancer network types
+ LoadBalancerNetworkTypeExternal = "EXTERNAL"
+ LoadBalancerNetworkTypeInternal = "INTERNAL"
)
// LoadBalancersService is an interface for managing load balancers with the DigitalOcean API.
@@ -30,6 +36,7 @@ type LoadBalancersService interface {
RemoveDroplets(ctx context.Context, lbID string, dropletIDs ...int) (*Response, error)
AddForwardingRules(ctx context.Context, lbID string, rules ...ForwardingRule) (*Response, error)
RemoveForwardingRules(ctx context.Context, lbID string, rules ...ForwardingRule) (*Response, error)
+ PurgeCache(ctx context.Context, lbID string) (*Response, error)
}
// LoadBalancer represents a DigitalOcean load balancer configuration.
@@ -62,6 +69,10 @@ type LoadBalancer struct {
ProjectID string `json:"project_id,omitempty"`
HTTPIdleTimeoutSeconds *uint64 `json:"http_idle_timeout_seconds,omitempty"`
Firewall *LBFirewall `json:"firewall,omitempty"`
+ Domains []*LBDomain `json:"domains,omitempty"`
+ GLBSettings *GLBSettings `json:"glb_settings,omitempty"`
+ TargetLoadBalancerIDs []string `json:"target_load_balancer_ids,omitempty"`
+ Network string `json:"network,omitempty"`
}
// String creates a human-readable description of a LoadBalancer.
@@ -89,12 +100,13 @@ func (l LoadBalancer) AsRequest() *LoadBalancerRequest {
RedirectHttpToHttps: l.RedirectHttpToHttps,
EnableProxyProtocol: l.EnableProxyProtocol,
EnableBackendKeepalive: l.EnableBackendKeepalive,
- HealthCheck: l.HealthCheck,
VPCUUID: l.VPCUUID,
DisableLetsEncryptDNSRecords: l.DisableLetsEncryptDNSRecords,
ValidateOnly: l.ValidateOnly,
ProjectID: l.ProjectID,
HTTPIdleTimeoutSeconds: l.HTTPIdleTimeoutSeconds,
+ TargetLoadBalancerIDs: append([]string(nil), l.TargetLoadBalancerIDs...),
+ Network: l.Network,
}
if l.DisableLetsEncryptDNSRecords != nil {
@@ -105,10 +117,12 @@ func (l LoadBalancer) AsRequest() *LoadBalancerRequest {
r.HealthCheck = &HealthCheck{}
*r.HealthCheck = *l.HealthCheck
}
+
if l.StickySessions != nil {
r.StickySessions = &StickySessions{}
*r.StickySessions = *l.StickySessions
}
+
if l.Region != nil {
r.Region = l.Region.Slug
}
@@ -117,6 +131,18 @@ func (l LoadBalancer) AsRequest() *LoadBalancerRequest {
r.Firewall = l.Firewall.deepCopy()
}
+ for _, domain := range l.Domains {
+ lbDomain := &LBDomain{}
+ *lbDomain = *domain
+ lbDomain.VerificationErrorReasons = append([]string(nil), domain.VerificationErrorReasons...)
+ lbDomain.SSLValidationErrorReasons = append([]string(nil), domain.SSLValidationErrorReasons...)
+ r.Domains = append(r.Domains, lbDomain)
+ }
+
+ if l.GLBSettings != nil {
+ r.GLBSettings = l.GLBSettings.deepCopy()
+ }
+
return &r
}
@@ -144,6 +170,7 @@ type HealthCheck struct {
ResponseTimeoutSeconds int `json:"response_timeout_seconds,omitempty"`
HealthyThreshold int `json:"healthy_threshold,omitempty"`
UnhealthyThreshold int `json:"unhealthy_threshold,omitempty"`
+ ProxyProtocol *bool `json:"proxy_protocol,omitempty"`
}
// String creates a human-readable description of a HealthCheck.
@@ -215,6 +242,10 @@ type LoadBalancerRequest struct {
ProjectID string `json:"project_id,omitempty"`
HTTPIdleTimeoutSeconds *uint64 `json:"http_idle_timeout_seconds,omitempty"`
Firewall *LBFirewall `json:"firewall,omitempty"`
+ Domains []*LBDomain `json:"domains,omitempty"`
+ GLBSettings *GLBSettings `json:"glb_settings,omitempty"`
+ TargetLoadBalancerIDs []string `json:"target_load_balancer_ids,omitempty"`
+ Network string `json:"network,omitempty"`
}
// String creates a human-readable description of a LoadBalancerRequest.
@@ -238,6 +269,70 @@ func (l dropletIDsRequest) String() string {
return Stringify(l)
}
+// LBDomain defines domain names required to ingress traffic to a Global LB
+type LBDomain struct {
+ // Name defines the domain fqdn
+ Name string `json:"name"`
+ // IsManaged indicates if the domain is DO-managed
+ IsManaged bool `json:"is_managed"`
+ // CertificateID indicates ID of a TLS certificate
+ CertificateID string `json:"certificate_id,omitempty"`
+ // Status indicates the domain validation status
+ Status string `json:"status,omitempty"`
+ // VerificationErrorReasons indicates any domain verification errors
+ VerificationErrorReasons []string `json:"verification_error_reasons,omitempty"`
+ // SSLValidationErrorReasons indicates any domain SSL validation errors
+ SSLValidationErrorReasons []string `json:"ssl_validation_error_reasons,omitempty"`
+}
+
+// String creates a human-readable description of a LBDomain
+func (d LBDomain) String() string {
+ return Stringify(d)
+}
+
+// GLBSettings define settings for configuring a Global LB
+type GLBSettings struct {
+ // TargetProtocol is the outgoing traffic protocol.
+ TargetProtocol string `json:"target_protocol"`
+ // EntryPort is the outgoing traffic port.
+ TargetPort uint32 `json:"target_port"`
+ // CDNSettings is the CDN configurations
+ CDN *CDNSettings `json:"cdn"`
+ // RegionPriorities embeds regional priority information for regional active-passive failover policy
+ RegionPriorities map[string]uint32 `json:"region_priorities,omitempty"`
+ // FailoverThreshold embeds failover threshold percentage for regional active-passive failover policy
+ FailoverThreshold uint32 `json:"failover_threshold,omitempty"`
+}
+
+// String creates a human-readable description of a GLBSettings
+func (s GLBSettings) String() string {
+ return Stringify(s)
+}
+
+func (s GLBSettings) deepCopy() *GLBSettings {
+ settings := &GLBSettings{
+ TargetProtocol: s.TargetProtocol,
+ TargetPort: s.TargetPort,
+ RegionPriorities: s.RegionPriorities,
+ FailoverThreshold: s.FailoverThreshold,
+ }
+ if s.CDN != nil {
+ settings.CDN = &CDNSettings{IsEnabled: s.CDN.IsEnabled}
+ }
+ return settings
+}
+
+// CDNSettings define CDN settings for a Global LB
+type CDNSettings struct {
+ // IsEnabled is the caching enabled flag
+ IsEnabled bool `json:"is_enabled"`
+}
+
+// String creates a human-readable description of a CDNSettings
+func (c CDNSettings) String() string {
+ return Stringify(c)
+}
+
type loadBalancersRoot struct {
LoadBalancers []LoadBalancer `json:"load_balancers"`
Links *Links `json:"links"`
@@ -393,3 +488,15 @@ func (l *LoadBalancersServiceOp) RemoveForwardingRules(ctx context.Context, lbID
return l.client.Do(ctx, req, nil)
}
+
+// PurgeCache purges the CDN cache of a global load balancer by its identifier.
+func (l *LoadBalancersServiceOp) PurgeCache(ctx context.Context, ldID string) (*Response, error) {
+ path := fmt.Sprintf("%s/%s/%s", loadBalancersBasePath, ldID, cachePath)
+
+ req, err := l.client.NewRequest(ctx, http.MethodDelete, path, nil)
+ if err != nil {
+ return nil, err
+ }
+
+ return l.client.Do(ctx, req, nil)
+}
diff --git a/vendor/github.com/digitalocean/godo/monitoring.go b/vendor/github.com/digitalocean/godo/monitoring.go
index 937bb8d9..00feb256 100644
--- a/vendor/github.com/digitalocean/godo/monitoring.go
+++ b/vendor/github.com/digitalocean/godo/monitoring.go
@@ -10,9 +10,10 @@ import (
)
const (
- monitoringBasePath = "v2/monitoring"
- alertPolicyBasePath = monitoringBasePath + "/alerts"
- dropletMetricsBasePath = monitoringBasePath + "/metrics/droplet"
+ monitoringBasePath = "v2/monitoring"
+ alertPolicyBasePath = monitoringBasePath + "/alerts"
+ dropletMetricsBasePath = monitoringBasePath + "/metrics/droplet"
+ loadBalancerMetricsBasePath = monitoringBasePath + "/metrics/load_balancer"
DropletCPUUtilizationPercent = "v1/insights/droplet/cpu"
DropletMemoryUtilizationPercent = "v1/insights/droplet/memory_utilization_percent"
@@ -67,6 +68,34 @@ type MonitoringService interface {
GetDropletCachedMemory(context.Context, *DropletMetricsRequest) (*MetricsResponse, *Response, error)
GetDropletFreeMemory(context.Context, *DropletMetricsRequest) (*MetricsResponse, *Response, error)
GetDropletTotalMemory(context.Context, *DropletMetricsRequest) (*MetricsResponse, *Response, error)
+
+ GetLoadBalancerFrontendHttpRequestsPerSecond(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
+ GetLoadBalancerFrontendConnectionsCurrent(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
+ GetLoadBalancerFrontendConnectionsLimit(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
+ GetLoadBalancerFrontendCpuUtilization(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
+ GetLoadBalancerFrontendNetworkThroughputHttp(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
+ GetLoadBalancerFrontendNetworkThroughputUdp(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
+ GetLoadBalancerFrontendNetworkThroughputTcp(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
+ GetLoadBalancerFrontendNlbTcpNetworkThroughput(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
+ GetLoadBalancerFrontendNlbUdpNetworkThroughput(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
+ GetLoadBalancerFrontendFirewallDroppedBytes(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
+ GetLoadBalancerFrontendFirewallDroppedPackets(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
+ GetLoadBalancerFrontendHttpResponses(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
+ GetLoadBalancerFrontendTlsConnectionsCurrent(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
+ GetLoadBalancerFrontendTlsConnectionsLimit(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
+ GetLoadBalancerFrontendTlsConnectionsExceedingRateLimit(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
+ GetLoadBalancerDropletsHttpSessionDurationAvg(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
+ GetLoadBalancerDropletsHttpSessionDuration50P(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
+ GetLoadBalancerDropletsHttpSessionDuration95P(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
+ GetLoadBalancerDropletsHttpResponseTimeAvg(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
+ GetLoadBalancerDropletsHttpResponseTime50P(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
+ GetLoadBalancerDropletsHttpResponseTime95P(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
+ GetLoadBalancerDropletsHttpResponseTime99P(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
+ GetLoadBalancerDropletsQueueSize(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
+ GetLoadBalancerDropletsHttpResponses(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
+ GetLoadBalancerDropletsConnections(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
+ GetLoadBalancerDropletsHealthChecks(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
+ GetLoadBalancerDropletsDowntime(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error)
}
// MonitoringServiceOp handles communication with monitoring related methods of the
@@ -163,6 +192,13 @@ type DropletBandwidthMetricsRequest struct {
Direction string
}
+// LoadBalancerMetricsRequest holds the information needed to retrieve Load Balancer various metrics.
+type LoadBalancerMetricsRequest struct {
+ LoadBalancerID string
+ Start time.Time
+ End time.Time
+}
+
// MetricsResponse holds a Metrics query response.
type MetricsResponse struct {
Status string `json:"status"`
@@ -372,3 +408,157 @@ func (s *MonitoringServiceOp) getDropletMetrics(ctx context.Context, path string
return root, resp, err
}
+
+// GetLoadBalancerFrontendHttpRequestsPerSecond retrieves frontend HTTP requests per second for a given load balancer.
+func (s *MonitoringServiceOp) GetLoadBalancerFrontendHttpRequestsPerSecond(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error) {
+ return s.getLoadBalancerMetrics(ctx, "/frontend_http_requests_per_second", args)
+}
+
+// GetLoadBalancerFrontendConnectionsCurrent retrieves frontend total current active connections for a given load balancer.
+func (s *MonitoringServiceOp) GetLoadBalancerFrontendConnectionsCurrent(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error) {
+ return s.getLoadBalancerMetrics(ctx, "/frontend_connections_current", args)
+}
+
+// GetLoadBalancerFrontendConnectionsLimit retrieves frontend max connections limit for a given load balancer.
+func (s *MonitoringServiceOp) GetLoadBalancerFrontendConnectionsLimit(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error) {
+ return s.getLoadBalancerMetrics(ctx, "/frontend_connections_limit", args)
+}
+
+// GetLoadBalancerFrontendCpuUtilization retrieves frontend average percentage cpu utilization for a given load balancer.
+func (s *MonitoringServiceOp) GetLoadBalancerFrontendCpuUtilization(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error) {
+ return s.getLoadBalancerMetrics(ctx, "/frontend_cpu_utilization", args)
+}
+
+// GetLoadBalancerFrontendNetworkThroughputHttp retrieves frontend HTTP throughput for a given load balancer.
+func (s *MonitoringServiceOp) GetLoadBalancerFrontendNetworkThroughputHttp(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error) {
+ return s.getLoadBalancerMetrics(ctx, "/frontend_network_throughput_http", args)
+}
+
+// GetLoadBalancerFrontendNetworkThroughputUdp retrieves frontend UDP throughput for a given load balancer.
+func (s *MonitoringServiceOp) GetLoadBalancerFrontendNetworkThroughputUdp(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error) {
+ return s.getLoadBalancerMetrics(ctx, "/frontend_network_throughput_udp", args)
+}
+
+// GetLoadBalancerFrontendNetworkThroughputTcp retrieves frontend TCP throughput for a given load balancer.
+func (s *MonitoringServiceOp) GetLoadBalancerFrontendNetworkThroughputTcp(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error) {
+ return s.getLoadBalancerMetrics(ctx, "/frontend_network_throughput_tcp", args)
+}
+
+// GetLoadBalancerFrontendNlbTcpNetworkThroughput retrieves frontend TCP throughput for a given network load balancer.
+func (s *MonitoringServiceOp) GetLoadBalancerFrontendNlbTcpNetworkThroughput(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error) {
+ return s.getLoadBalancerMetrics(ctx, "/frontend_nlb_tcp_network_throughput", args)
+}
+
+// GetLoadBalancerFrontendNlbUdpNetworkThroughput retrieves frontend UDP throughput for a given network load balancer.
+func (s *MonitoringServiceOp) GetLoadBalancerFrontendNlbUdpNetworkThroughput(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error) {
+ return s.getLoadBalancerMetrics(ctx, "/frontend_nlb_udp_network_throughput", args)
+}
+
+// GetLoadBalancerFrontendFirewallDroppedBytes retrieves firewall dropped bytes for a given load balancer.
+func (s *MonitoringServiceOp) GetLoadBalancerFrontendFirewallDroppedBytes(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error) {
+ return s.getLoadBalancerMetrics(ctx, "/frontend_firewall_dropped_bytes", args)
+}
+
+// GetLoadBalancerFrontendFirewallDroppedPackets retrieves firewall dropped packets for a given load balancer.
+func (s *MonitoringServiceOp) GetLoadBalancerFrontendFirewallDroppedPackets(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error) {
+ return s.getLoadBalancerMetrics(ctx, "/frontend_firewall_dropped_packets", args)
+}
+
+// GetLoadBalancerFrontendHttpResponses retrieves frontend HTTP rate of response code for a given load balancer.
+func (s *MonitoringServiceOp) GetLoadBalancerFrontendHttpResponses(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error) {
+ return s.getLoadBalancerMetrics(ctx, "/frontend_http_responses", args)
+}
+
+// GetLoadBalancerFrontendTlsConnectionsCurrent retrieves frontend current TLS connections rate for a given load balancer.
+func (s *MonitoringServiceOp) GetLoadBalancerFrontendTlsConnectionsCurrent(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error) {
+ return s.getLoadBalancerMetrics(ctx, "/frontend_tls_connections_current", args)
+}
+
+// GetLoadBalancerFrontendTlsConnectionsLimit retrieves frontend max TLS connections limit for a given load balancer.
+func (s *MonitoringServiceOp) GetLoadBalancerFrontendTlsConnectionsLimit(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error) {
+ return s.getLoadBalancerMetrics(ctx, "/frontend_tls_connections_limit", args)
+}
+
+// GetLoadBalancerFrontendTlsConnectionsExceedingRateLimit retrieves frontend closed TLS connections for exceeded rate limit for a given load balancer.
+func (s *MonitoringServiceOp) GetLoadBalancerFrontendTlsConnectionsExceedingRateLimit(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error) {
+ return s.getLoadBalancerMetrics(ctx, "/frontend_tls_connections_exceeding_rate_limit", args)
+}
+
+// GetLoadBalancerDropletsHttpSessionDurationAvg retrieves droplet average HTTP session duration for a given load balancer.
+func (s *MonitoringServiceOp) GetLoadBalancerDropletsHttpSessionDurationAvg(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error) {
+ return s.getLoadBalancerMetrics(ctx, "/droplets_http_session_duration_avg", args)
+}
+
+// GetLoadBalancerDropletsHttpSessionDuration50P retrieves droplet 50th percentile HTTP session duration for a given load balancer.
+func (s *MonitoringServiceOp) GetLoadBalancerDropletsHttpSessionDuration50P(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error) {
+ return s.getLoadBalancerMetrics(ctx, "/droplets_http_session_duration_50p", args)
+}
+
+// GetLoadBalancerDropletsHttpSessionDuration95P retrieves droplet 95th percentile HTTP session duration for a given load balancer.
+func (s *MonitoringServiceOp) GetLoadBalancerDropletsHttpSessionDuration95P(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error) {
+ return s.getLoadBalancerMetrics(ctx, "/droplets_http_session_duration_95p", args)
+}
+
+// GetLoadBalancerDropletsHttpResponseTimeAvg retrieves droplet average HTTP response time for a given load balancer.
+func (s *MonitoringServiceOp) GetLoadBalancerDropletsHttpResponseTimeAvg(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error) {
+ return s.getLoadBalancerMetrics(ctx, "/droplets_http_response_time_avg", args)
+}
+
+// GetLoadBalancerDropletsHttpResponseTime50P retrieves droplet 50th percentile HTTP response time for a given load balancer.
+func (s *MonitoringServiceOp) GetLoadBalancerDropletsHttpResponseTime50P(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error) {
+ return s.getLoadBalancerMetrics(ctx, "/droplets_http_response_time_50p", args)
+}
+
+// GetLoadBalancerDropletsHttpResponseTime95P retrieves droplet 95th percentile HTTP response time for a given load balancer.
+func (s *MonitoringServiceOp) GetLoadBalancerDropletsHttpResponseTime95P(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error) {
+ return s.getLoadBalancerMetrics(ctx, "/droplets_http_response_time_95p", args)
+}
+
+// GetLoadBalancerDropletsHttpResponseTime99P retrieves droplet 99th percentile HTTP response time for a given load balancer.
+func (s *MonitoringServiceOp) GetLoadBalancerDropletsHttpResponseTime99P(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error) {
+ return s.getLoadBalancerMetrics(ctx, "/droplets_http_response_time_99p", args)
+}
+
+// GetLoadBalancerDropletsQueueSize retrieves droplet queue size for a given load balancer.
+func (s *MonitoringServiceOp) GetLoadBalancerDropletsQueueSize(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error) {
+ return s.getLoadBalancerMetrics(ctx, "/droplets_queue_size", args)
+}
+
+// GetLoadBalancerDropletsHttpResponses retrieves droplet HTTP rate of response code for a given load balancer.
+func (s *MonitoringServiceOp) GetLoadBalancerDropletsHttpResponses(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error) {
+ return s.getLoadBalancerMetrics(ctx, "/droplets_http_responses", args)
+}
+
+// GetLoadBalancerDropletsConnections retrieves droplet active connections for a given load balancer.
+func (s *MonitoringServiceOp) GetLoadBalancerDropletsConnections(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error) {
+ return s.getLoadBalancerMetrics(ctx, "/droplets_connections", args)
+}
+
+// GetLoadBalancerDropletsHealthChecks retrieves droplet health check status for a given load balancer.
+func (s *MonitoringServiceOp) GetLoadBalancerDropletsHealthChecks(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error) {
+ return s.getLoadBalancerMetrics(ctx, "/droplets_health_checks", args)
+}
+
+// GetLoadBalancerDropletsDowntime retrieves droplet downtime status for a given load balancer.
+func (s *MonitoringServiceOp) GetLoadBalancerDropletsDowntime(ctx context.Context, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error) {
+ return s.getLoadBalancerMetrics(ctx, "/droplets_downtime", args)
+}
+
+func (s *MonitoringServiceOp) getLoadBalancerMetrics(ctx context.Context, path string, args *LoadBalancerMetricsRequest) (*MetricsResponse, *Response, error) {
+ fullPath := loadBalancerMetricsBasePath + path
+ req, err := s.client.NewRequest(ctx, http.MethodGet, fullPath, nil)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ q := req.URL.Query()
+ q.Add("lb_id", args.LoadBalancerID)
+ q.Add("start", fmt.Sprintf("%d", args.Start.Unix()))
+ q.Add("end", fmt.Sprintf("%d", args.End.Unix()))
+ req.URL.RawQuery = q.Encode()
+
+ root := new(MetricsResponse)
+ resp, err := s.client.Do(ctx, req, root)
+
+ return root, resp, err
+}
diff --git a/vendor/github.com/digitalocean/godo/registry.go b/vendor/github.com/digitalocean/godo/registry.go
index b0c24328..e6482268 100644
--- a/vendor/github.com/digitalocean/godo/registry.go
+++ b/vendor/github.com/digitalocean/godo/registry.go
@@ -14,6 +14,9 @@ const (
registryPath = "/v2/registry"
// RegistryServer is the hostname of the DigitalOcean registry service
RegistryServer = "registry.digitalocean.com"
+
+ // Multi-registry Open Beta API constants
+ registriesPath = "/v2/registries"
)
// RegistryService is an interface for interfacing with the Registry endpoints
@@ -240,6 +243,19 @@ type RegistryValidateNameRequest struct {
Name string `json:"name"`
}
+// Multi-registry Open Beta API structs
+
+type registriesRoot struct {
+ Registries []*Registry `json:"registries,omitempty"`
+ TotalStorageUsageBytes uint64 `json:"total_storage_usage_bytes,omitempty"`
+}
+
+// RegistriesCreateRequest represents a request to create a secondary registry.
+type RegistriesCreateRequest struct {
+ Name string `json:"name,omitempty"`
+ Region string `json:"region,omitempty"`
+}
+
// Get retrieves the details of a Registry.
func (svc *RegistryServiceOp) Get(ctx context.Context) (*Registry, *Response, error) {
req, err := svc.client.NewRequest(ctx, http.MethodGet, registryPath, nil)
@@ -610,3 +626,107 @@ func (svc *RegistryServiceOp) ValidateName(ctx context.Context, request *Registr
}
return resp, nil
}
+
+// RegistriesService is an interface for interfacing with the new multiple-registry beta endpoints
+// of the DigitalOcean API.
+//
+// We are creating a separate Service in alignment with the new /v2/registries endpoints.
+type RegistriesService interface {
+ Get(context.Context, string) (*Registry, *Response, error)
+ List(context.Context) ([]*Registry, *Response, error)
+ Create(context.Context, *RegistriesCreateRequest) (*Registry, *Response, error)
+ Delete(context.Context, string) (*Response, error)
+ DockerCredentials(context.Context, string, *RegistryDockerCredentialsRequest) (*DockerCredentials, *Response, error)
+}
+
+var _ RegistriesService = &RegistriesServiceOp{}
+
+// RegistriesServiceOp handles communication with the multiple-registry beta methods.
+type RegistriesServiceOp struct {
+ client *Client
+}
+
+// Get returns the details of a named Registry.
+func (svc *RegistriesServiceOp) Get(ctx context.Context, registry string) (*Registry, *Response, error) {
+ path := fmt.Sprintf("%s/%s", registriesPath, registry)
+ req, err := svc.client.NewRequest(ctx, http.MethodGet, path, nil)
+ if err != nil {
+ return nil, nil, err
+ }
+ root := new(registryRoot)
+ resp, err := svc.client.Do(ctx, req, root)
+ if err != nil {
+ return nil, resp, err
+ }
+ return root.Registry, resp, nil
+}
+
+// List returns a list of the named Registries.
+func (svc *RegistriesServiceOp) List(ctx context.Context) ([]*Registry, *Response, error) {
+ req, err := svc.client.NewRequest(ctx, http.MethodGet, registriesPath, nil)
+ if err != nil {
+ return nil, nil, err
+ }
+ root := new(registriesRoot)
+ resp, err := svc.client.Do(ctx, req, root)
+ if err != nil {
+ return nil, resp, err
+ }
+ return root.Registries, resp, nil
+}
+
+// Create creates a named Registry.
+func (svc *RegistriesServiceOp) Create(ctx context.Context, create *RegistriesCreateRequest) (*Registry, *Response, error) {
+ req, err := svc.client.NewRequest(ctx, http.MethodPost, registriesPath, create)
+ if err != nil {
+ return nil, nil, err
+ }
+ root := new(registryRoot)
+ resp, err := svc.client.Do(ctx, req, root)
+ if err != nil {
+ return nil, resp, err
+ }
+ return root.Registry, resp, nil
+}
+
+// Delete deletes a named Registry. There is no way to recover a Registry once it has
+// been destroyed.
+func (svc *RegistriesServiceOp) Delete(ctx context.Context, registry string) (*Response, error) {
+ path := fmt.Sprintf("%s/%s", registriesPath, registry)
+ req, err := svc.client.NewRequest(ctx, http.MethodDelete, path, nil)
+ if err != nil {
+ return nil, err
+ }
+ resp, err := svc.client.Do(ctx, req, nil)
+ if err != nil {
+ return resp, err
+ }
+ return resp, nil
+}
+
+// DockerCredentials retrieves a Docker config file containing named Registry's credentials.
+func (svc *RegistriesServiceOp) DockerCredentials(ctx context.Context, registry string, request *RegistryDockerCredentialsRequest) (*DockerCredentials, *Response, error) {
+ path := fmt.Sprintf("%s/%s/%s", registriesPath, registry, "docker-credentials")
+ req, err := svc.client.NewRequest(ctx, http.MethodGet, path, nil)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ q := req.URL.Query()
+ q.Add("read_write", strconv.FormatBool(request.ReadWrite))
+ if request.ExpirySeconds != nil {
+ q.Add("expiry_seconds", strconv.Itoa(*request.ExpirySeconds))
+ }
+ req.URL.RawQuery = q.Encode()
+
+ var buf bytes.Buffer
+ resp, err := svc.client.Do(ctx, req, &buf)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ dc := &DockerCredentials{
+ DockerConfigJSON: buf.Bytes(),
+ }
+ return dc, resp, nil
+}
diff --git a/vendor/github.com/digitalocean/godo/sizes.go b/vendor/github.com/digitalocean/godo/sizes.go
index a3cb7452..72d5321c 100644
--- a/vendor/github.com/digitalocean/godo/sizes.go
+++ b/vendor/github.com/digitalocean/godo/sizes.go
@@ -22,16 +22,44 @@ var _ SizesService = &SizesServiceOp{}
// Size represents a DigitalOcean Size
type Size struct {
- Slug string `json:"slug,omitempty"`
- Memory int `json:"memory,omitempty"`
- Vcpus int `json:"vcpus,omitempty"`
- Disk int `json:"disk,omitempty"`
- PriceMonthly float64 `json:"price_monthly,omitempty"`
- PriceHourly float64 `json:"price_hourly,omitempty"`
- Regions []string `json:"regions,omitempty"`
- Available bool `json:"available,omitempty"`
- Transfer float64 `json:"transfer,omitempty"`
- Description string `json:"description,omitempty"`
+ Slug string `json:"slug,omitempty"`
+ Memory int `json:"memory,omitempty"`
+ Vcpus int `json:"vcpus,omitempty"`
+ Disk int `json:"disk,omitempty"`
+ PriceMonthly float64 `json:"price_monthly,omitempty"`
+ PriceHourly float64 `json:"price_hourly,omitempty"`
+ Regions []string `json:"regions,omitempty"`
+ Available bool `json:"available,omitempty"`
+ Transfer float64 `json:"transfer,omitempty"`
+ Description string `json:"description,omitempty"`
+ GPUInfo *GPUInfo `json:"gpu_info,omitempty"`
+ DiskInfo []DiskInfo `json:"disk_info,omitempty"`
+}
+
+// DiskInfo containing information about the disks available to Droplets created
+// with this size.
+type DiskInfo struct {
+ Type string `json:"type,omitempty"`
+ Size *DiskSize `json:"size,omitempty"`
+}
+
+// DiskSize provides information about the size of a disk.
+type DiskSize struct {
+ Amount int `json:"amount,omitempty"`
+ Unit string `json:"unit,omitempty"`
+}
+
+// GPUInfo provides information about the GPU available to Droplets created with this size.
+type GPUInfo struct {
+ Count int `json:"count,omitempty"`
+ VRAM *VRAM `json:"vram,omitempty"`
+ Model string `json:"model,omitempty"`
+}
+
+// VRAM provides information about the amount of VRAM available to the GPU.
+type VRAM struct {
+ Amount int `json:"amount,omitempty"`
+ Unit string `json:"unit,omitempty"`
}
func (s Size) String() string {
diff --git a/vendor/github.com/digitalocean/godo/strings.go b/vendor/github.com/digitalocean/godo/strings.go
index f92893ed..5a258131 100644
--- a/vendor/github.com/digitalocean/godo/strings.go
+++ b/vendor/github.com/digitalocean/godo/strings.go
@@ -5,6 +5,7 @@ import (
"fmt"
"io"
"reflect"
+ "sort"
"strings"
)
@@ -46,6 +47,8 @@ func stringifyValue(w io.Writer, val reflect.Value) {
return
case reflect.Struct:
stringifyStruct(w, v)
+ case reflect.Map:
+ stringifyMap(w, v)
default:
if v.CanInterface() {
fmt.Fprint(w, v.Interface())
@@ -66,6 +69,27 @@ func stringifySlice(w io.Writer, v reflect.Value) {
_, _ = w.Write([]byte{']'})
}
+func stringifyMap(w io.Writer, v reflect.Value) {
+ _, _ = w.Write([]byte("map["))
+
+ // Sort the keys so that the output is stable
+ keys := v.MapKeys()
+ sort.Slice(keys, func(i, j int) bool {
+ return fmt.Sprintf("%v", keys[i]) < fmt.Sprintf("%v", keys[j])
+ })
+
+ for i, key := range keys {
+ stringifyValue(w, key)
+ _, _ = w.Write([]byte{':'})
+ stringifyValue(w, v.MapIndex(key))
+ if i < len(keys)-1 {
+ _, _ = w.Write([]byte(", "))
+ }
+ }
+
+ _, _ = w.Write([]byte("]"))
+}
+
func stringifyStruct(w io.Writer, v reflect.Value) {
if v.Type().Name() != "" {
_, _ = w.Write([]byte(v.Type().String()))
diff --git a/vendor/github.com/digitalocean/godo/vpc_peerings.go b/vendor/github.com/digitalocean/godo/vpc_peerings.go
new file mode 100644
index 00000000..e6dfc043
--- /dev/null
+++ b/vendor/github.com/digitalocean/godo/vpc_peerings.go
@@ -0,0 +1,199 @@
+package godo
+
+import (
+ "context"
+ "net/http"
+ "time"
+)
+
+const vpcPeeringsPath = "/v2/vpc_peerings"
+
+type vpcPeeringRoot struct {
+ VPCPeering *VPCPeering `json:"vpc_peering"`
+}
+
+type vpcPeeringsRoot struct {
+ VPCPeerings []*VPCPeering `json:"vpc_peerings"`
+ Links *Links `json:"links"`
+ Meta *Meta `json:"meta"`
+}
+
+// VPCPeering represents a DigitalOcean Virtual Private Cloud Peering configuration.
+type VPCPeering struct {
+ // ID is the generated ID of the VPC Peering
+ ID string `json:"id"`
+ // Name is the name of the VPC Peering
+ Name string `json:"name"`
+ // VPCIDs is the IDs of the pair of VPCs between which a peering is created
+ VPCIDs []string `json:"vpc_ids"`
+ // CreatedAt is time when this VPC Peering was first created
+ CreatedAt time.Time `json:"created_at"`
+ // Status is the status of the VPC Peering
+ Status string `json:"status"`
+}
+
+// VPCPeeringCreateRequest represents a request to create a Virtual Private Cloud Peering
+// for a list of associated VPC IDs.
+type VPCPeeringCreateRequest struct {
+ // Name is the name of the VPC Peering
+ Name string `json:"name"`
+ // VPCIDs is the IDs of the pair of VPCs between which a peering is created
+ VPCIDs []string `json:"vpc_ids"`
+}
+
+// VPCPeeringUpdateRequest represents a request to update a Virtual Private Cloud Peering.
+type VPCPeeringUpdateRequest struct {
+ // Name is the name of the VPC Peering
+ Name string `json:"name"`
+}
+
+// VPCPeeringCreateRequestByVPCID represents a request to create a Virtual Private Cloud Peering
+// for an associated VPC ID.
+type VPCPeeringCreateRequestByVPCID struct {
+ // Name is the name of the VPC Peering
+ Name string `json:"name"`
+ // VPCID is the ID of one of the VPCs with which the peering has to be created
+ VPCID string `json:"vpc_id"`
+}
+
+// CreateVPCPeering creates a new Virtual Private Cloud Peering.
+func (v *VPCsServiceOp) CreateVPCPeering(ctx context.Context, create *VPCPeeringCreateRequest) (*VPCPeering, *Response, error) {
+ path := vpcPeeringsPath
+ req, err := v.client.NewRequest(ctx, http.MethodPost, path, create)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ root := new(vpcPeeringRoot)
+ resp, err := v.client.Do(ctx, req, root)
+ if err != nil {
+ return nil, resp, err
+ }
+ return root.VPCPeering, resp, nil
+}
+
+// GetVPCPeering retrieves a Virtual Private Cloud Peering.
+func (v *VPCsServiceOp) GetVPCPeering(ctx context.Context, id string) (*VPCPeering, *Response, error) {
+ path := vpcPeeringsPath + "/" + id
+ req, err := v.client.NewRequest(ctx, http.MethodGet, path, nil)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ root := new(vpcPeeringRoot)
+ resp, err := v.client.Do(ctx, req, root)
+ if err != nil {
+ return nil, resp, err
+ }
+ return root.VPCPeering, resp, nil
+}
+
+// ListVPCPeerings lists all Virtual Private Cloud Peerings.
+func (v *VPCsServiceOp) ListVPCPeerings(ctx context.Context, opt *ListOptions) ([]*VPCPeering, *Response, error) {
+ path, err := addOptions(vpcPeeringsPath, opt)
+ if err != nil {
+ return nil, nil, err
+ }
+ req, err := v.client.NewRequest(ctx, http.MethodGet, path, nil)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ root := new(vpcPeeringsRoot)
+ resp, err := v.client.Do(ctx, req, root)
+ if err != nil {
+ return nil, resp, err
+ }
+ if l := root.Links; l != nil {
+ resp.Links = l
+ }
+ if m := root.Meta; m != nil {
+ resp.Meta = m
+ }
+ return root.VPCPeerings, resp, nil
+}
+
+// UpdateVPCPeering updates a Virtual Private Cloud Peering.
+func (v *VPCsServiceOp) UpdateVPCPeering(ctx context.Context, id string, update *VPCPeeringUpdateRequest) (*VPCPeering, *Response, error) {
+ path := vpcPeeringsPath + "/" + id
+ req, err := v.client.NewRequest(ctx, http.MethodPatch, path, update)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ root := new(vpcPeeringRoot)
+ resp, err := v.client.Do(ctx, req, root)
+ if err != nil {
+ return nil, resp, err
+ }
+ return root.VPCPeering, resp, nil
+}
+
+// DeleteVPCPeering deletes a Virtual Private Cloud Peering.
+func (v *VPCsServiceOp) DeleteVPCPeering(ctx context.Context, id string) (*Response, error) {
+ path := vpcPeeringsPath + "/" + id
+ req, err := v.client.NewRequest(ctx, http.MethodDelete, path, nil)
+ if err != nil {
+ return nil, err
+ }
+
+ resp, err := v.client.Do(ctx, req, nil)
+ if err != nil {
+ return resp, err
+ }
+ return resp, nil
+}
+
+// CreateVPCPeeringByVPCID creates a new Virtual Private Cloud Peering for requested VPC ID.
+func (v *VPCsServiceOp) CreateVPCPeeringByVPCID(ctx context.Context, id string, create *VPCPeeringCreateRequestByVPCID) (*VPCPeering, *Response, error) {
+ path := vpcsBasePath + "/" + id + "/peerings"
+ req, err := v.client.NewRequest(ctx, http.MethodPost, path, create)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ root := new(vpcPeeringRoot)
+ resp, err := v.client.Do(ctx, req, root)
+ if err != nil {
+ return nil, resp, err
+ }
+ return root.VPCPeering, resp, nil
+}
+
+// ListVPCPeeringsByVPCID lists all Virtual Private Cloud Peerings for requested VPC ID.
+func (v *VPCsServiceOp) ListVPCPeeringsByVPCID(ctx context.Context, id string, opt *ListOptions) ([]*VPCPeering, *Response, error) {
+ path, err := addOptions(vpcsBasePath+"/"+id+"/peerings", opt)
+ req, err := v.client.NewRequest(ctx, http.MethodGet, path, nil)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ root := new(vpcPeeringsRoot)
+ resp, err := v.client.Do(ctx, req, root)
+ if err != nil {
+ return nil, resp, err
+ }
+ if l := root.Links; l != nil {
+ resp.Links = l
+ }
+ if m := root.Meta; m != nil {
+ resp.Meta = m
+ }
+ return root.VPCPeerings, resp, nil
+}
+
+// UpdateVPCPeeringByVPCID updates a Virtual Private Cloud Peering for requested VPC ID.
+func (v *VPCsServiceOp) UpdateVPCPeeringByVPCID(ctx context.Context, vpcID, peerID string, update *VPCPeeringUpdateRequest) (*VPCPeering, *Response, error) {
+ path := vpcsBasePath + "/" + vpcID + "/peerings" + "/" + peerID
+ req, err := v.client.NewRequest(ctx, http.MethodPatch, path, update)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ root := new(vpcPeeringRoot)
+ resp, err := v.client.Do(ctx, req, root)
+ if err != nil {
+ return nil, resp, err
+ }
+ return root.VPCPeering, resp, nil
+}
diff --git a/vendor/github.com/digitalocean/godo/vpcs.go b/vendor/github.com/digitalocean/godo/vpcs.go
index f4f22e18..67525190 100644
--- a/vendor/github.com/digitalocean/godo/vpcs.go
+++ b/vendor/github.com/digitalocean/godo/vpcs.go
@@ -19,6 +19,14 @@ type VPCsService interface {
Update(context.Context, string, *VPCUpdateRequest) (*VPC, *Response, error)
Set(context.Context, string, ...VPCSetField) (*VPC, *Response, error)
Delete(context.Context, string) (*Response, error)
+ CreateVPCPeering(context.Context, *VPCPeeringCreateRequest) (*VPCPeering, *Response, error)
+ GetVPCPeering(context.Context, string) (*VPCPeering, *Response, error)
+ ListVPCPeerings(context.Context, *ListOptions) ([]*VPCPeering, *Response, error)
+ UpdateVPCPeering(context.Context, string, *VPCPeeringUpdateRequest) (*VPCPeering, *Response, error)
+ DeleteVPCPeering(context.Context, string) (*Response, error)
+ CreateVPCPeeringByVPCID(context.Context, string, *VPCPeeringCreateRequestByVPCID) (*VPCPeering, *Response, error)
+ ListVPCPeeringsByVPCID(context.Context, string, *ListOptions) ([]*VPCPeering, *Response, error)
+ UpdateVPCPeeringByVPCID(context.Context, string, string, *VPCPeeringUpdateRequest) (*VPCPeering, *Response, error)
}
var _ VPCsService = &VPCsServiceOp{}
diff --git a/vendor/github.com/emicklei/go-restful/v3/CHANGES.md b/vendor/github.com/emicklei/go-restful/v3/CHANGES.md
index 5edd5a7c..92b78048 100644
--- a/vendor/github.com/emicklei/go-restful/v3/CHANGES.md
+++ b/vendor/github.com/emicklei/go-restful/v3/CHANGES.md
@@ -1,6 +1,24 @@
# Change history of go-restful
-## [v3.11.0] - 2023-08-19
+
+## [v3.12.1] - 2024-05-28
+
+- fix misroute when dealing multiple webservice with regex (#549) (thanks Haitao Chen)
+
+## [v3.12.0] - 2024-03-11
+
+- add Flush method #529 (#538)
+- fix: Improper handling of empty POST requests (#543)
+
+## [v3.11.3] - 2024-01-09
+
+- better not have 2 tags on one commit
+
+## [v3.11.1, v3.11.2] - 2024-01-09
+
+- fix by restoring custom JSON handler functions (Mike Beaumont #540)
+
+## [v3.12.0] - 2023-08-19
- restored behavior as <= v3.9.0 with option to change path strategy using TrimRightSlashEnabled.
diff --git a/vendor/github.com/emicklei/go-restful/v3/README.md b/vendor/github.com/emicklei/go-restful/v3/README.md
index 95a05a08..7234604e 100644
--- a/vendor/github.com/emicklei/go-restful/v3/README.md
+++ b/vendor/github.com/emicklei/go-restful/v3/README.md
@@ -2,7 +2,6 @@ go-restful
==========
package for building REST-style Web Services using Google Go
-[![Build Status](https://travis-ci.org/emicklei/go-restful.png)](https://travis-ci.org/emicklei/go-restful)
[![Go Report Card](https://goreportcard.com/badge/github.com/emicklei/go-restful)](https://goreportcard.com/report/github.com/emicklei/go-restful)
[![GoDoc](https://godoc.org/github.com/emicklei/go-restful?status.svg)](https://pkg.go.dev/github.com/emicklei/go-restful)
[![codecov](https://codecov.io/gh/emicklei/go-restful/branch/master/graph/badge.svg)](https://codecov.io/gh/emicklei/go-restful)
diff --git a/vendor/github.com/emicklei/go-restful/v3/compress.go b/vendor/github.com/emicklei/go-restful/v3/compress.go
index 1ff239f9..80adf55f 100644
--- a/vendor/github.com/emicklei/go-restful/v3/compress.go
+++ b/vendor/github.com/emicklei/go-restful/v3/compress.go
@@ -49,6 +49,16 @@ func (c *CompressingResponseWriter) CloseNotify() <-chan bool {
return c.writer.(http.CloseNotifier).CloseNotify()
}
+// Flush is part of http.Flusher interface. Noop if the underlying writer doesn't support it.
+func (c *CompressingResponseWriter) Flush() {
+ flusher, ok := c.writer.(http.Flusher)
+ if !ok {
+ // writer doesn't support http.Flusher interface
+ return
+ }
+ flusher.Flush()
+}
+
// Close the underlying compressor
func (c *CompressingResponseWriter) Close() error {
if c.isCompressorClosed() {
diff --git a/vendor/github.com/emicklei/go-restful/v3/curly.go b/vendor/github.com/emicklei/go-restful/v3/curly.go
index ba1fc5d5..6fd2bcd5 100644
--- a/vendor/github.com/emicklei/go-restful/v3/curly.go
+++ b/vendor/github.com/emicklei/go-restful/v3/curly.go
@@ -46,10 +46,10 @@ func (c CurlyRouter) SelectRoute(
// selectRoutes return a collection of Route from a WebService that matches the path tokens from the request.
func (c CurlyRouter) selectRoutes(ws *WebService, requestTokens []string) sortableCurlyRoutes {
candidates := make(sortableCurlyRoutes, 0, 8)
- for _, each := range ws.routes {
- matches, paramCount, staticCount := c.matchesRouteByPathTokens(each.pathParts, requestTokens, each.hasCustomVerb)
+ for _, eachRoute := range ws.routes {
+ matches, paramCount, staticCount := c.matchesRouteByPathTokens(eachRoute.pathParts, requestTokens, eachRoute.hasCustomVerb)
if matches {
- candidates.add(curlyRoute{each, paramCount, staticCount}) // TODO make sure Routes() return pointers?
+ candidates.add(curlyRoute{eachRoute, paramCount, staticCount}) // TODO make sure Routes() return pointers?
}
}
sort.Sort(candidates)
@@ -72,7 +72,7 @@ func (c CurlyRouter) matchesRouteByPathTokens(routeTokens, requestTokens []strin
return false, 0, 0
}
requestToken := requestTokens[i]
- if routeHasCustomVerb && hasCustomVerb(routeToken){
+ if routeHasCustomVerb && hasCustomVerb(routeToken) {
if !isMatchCustomVerb(routeToken, requestToken) {
return false, 0, 0
}
@@ -129,44 +129,52 @@ func (c CurlyRouter) detectRoute(candidateRoutes sortableCurlyRoutes, httpReques
// detectWebService returns the best matching webService given the list of path tokens.
// see also computeWebserviceScore
func (c CurlyRouter) detectWebService(requestTokens []string, webServices []*WebService) *WebService {
- var best *WebService
+ var bestWs *WebService
score := -1
- for _, each := range webServices {
- matches, eachScore := c.computeWebserviceScore(requestTokens, each.pathExpr.tokens)
+ for _, eachWS := range webServices {
+ matches, eachScore := c.computeWebserviceScore(requestTokens, eachWS.pathExpr.tokens)
if matches && (eachScore > score) {
- best = each
+ bestWs = eachWS
score = eachScore
}
}
- return best
+ return bestWs
}
// computeWebserviceScore returns whether tokens match and
// the weighted score of the longest matching consecutive tokens from the beginning.
-func (c CurlyRouter) computeWebserviceScore(requestTokens []string, tokens []string) (bool, int) {
- if len(tokens) > len(requestTokens) {
+func (c CurlyRouter) computeWebserviceScore(requestTokens []string, routeTokens []string) (bool, int) {
+ if len(routeTokens) > len(requestTokens) {
return false, 0
}
score := 0
- for i := 0; i < len(tokens); i++ {
- each := requestTokens[i]
- other := tokens[i]
- if len(each) == 0 && len(other) == 0 {
+ for i := 0; i < len(routeTokens); i++ {
+ eachRequestToken := requestTokens[i]
+ eachRouteToken := routeTokens[i]
+ if len(eachRequestToken) == 0 && len(eachRouteToken) == 0 {
score++
continue
}
- if len(other) > 0 && strings.HasPrefix(other, "{") {
+ if len(eachRouteToken) > 0 && strings.HasPrefix(eachRouteToken, "{") {
// no empty match
- if len(each) == 0 {
+ if len(eachRequestToken) == 0 {
return false, score
}
- score += 1
+ score++
+
+ if colon := strings.Index(eachRouteToken, ":"); colon != -1 {
+ // match by regex
+ matchesToken, _ := c.regularMatchesPathToken(eachRouteToken, colon, eachRequestToken)
+ if matchesToken {
+ score++ // extra score for regex match
+ }
+ }
} else {
// not a parameter
- if each != other {
+ if eachRequestToken != eachRouteToken {
return false, score
}
- score += (len(tokens) - i) * 10 //fuzzy
+ score += (len(routeTokens) - i) * 10 //fuzzy
}
}
return true, score
diff --git a/vendor/github.com/emicklei/go-restful/v3/jsr311.go b/vendor/github.com/emicklei/go-restful/v3/jsr311.go
index 07a0c91e..a9b3faaa 100644
--- a/vendor/github.com/emicklei/go-restful/v3/jsr311.go
+++ b/vendor/github.com/emicklei/go-restful/v3/jsr311.go
@@ -155,7 +155,7 @@ func (r RouterJSR311) detectRoute(routes []Route, httpRequest *http.Request) (*R
method, length := httpRequest.Method, httpRequest.Header.Get("Content-Length")
if (method == http.MethodPost ||
method == http.MethodPut ||
- method == http.MethodPatch) && length == "" {
+ method == http.MethodPatch) && (length == "" || length == "0") {
return nil, NewError(
http.StatusUnsupportedMediaType,
fmt.Sprintf("415: Unsupported Media Type\n\nAvailable representations: %s", strings.Join(available, ", ")),
diff --git a/vendor/github.com/fxamacker/cbor/v2/.gitignore b/vendor/github.com/fxamacker/cbor/v2/.gitignore
new file mode 100644
index 00000000..f1c181ec
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/.gitignore
@@ -0,0 +1,12 @@
+# Binaries for programs and plugins
+*.exe
+*.exe~
+*.dll
+*.so
+*.dylib
+
+# Test binary, build with `go test -c`
+*.test
+
+# Output of the go coverage tool, specifically when used with LiteIDE
+*.out
diff --git a/vendor/github.com/fxamacker/cbor/v2/.golangci.yml b/vendor/github.com/fxamacker/cbor/v2/.golangci.yml
new file mode 100644
index 00000000..38cb9ae1
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/.golangci.yml
@@ -0,0 +1,104 @@
+# Do not delete linter settings. Linters like gocritic can be enabled on the command line.
+
+linters-settings:
+ depguard:
+ rules:
+ prevent_unmaintained_packages:
+ list-mode: strict
+ files:
+ - $all
+ - "!$test"
+ allow:
+ - $gostd
+ - github.com/x448/float16
+ deny:
+ - pkg: io/ioutil
+ desc: "replaced by io and os packages since Go 1.16: https://tip.golang.org/doc/go1.16#ioutil"
+ dupl:
+ threshold: 100
+ funlen:
+ lines: 100
+ statements: 50
+ goconst:
+ ignore-tests: true
+ min-len: 2
+ min-occurrences: 3
+ gocritic:
+ enabled-tags:
+ - diagnostic
+ - experimental
+ - opinionated
+ - performance
+ - style
+ disabled-checks:
+ - commentedOutCode
+ - dupImport # https://github.com/go-critic/go-critic/issues/845
+ - ifElseChain
+ - octalLiteral
+ - paramTypeCombine
+ - whyNoLint
+ gofmt:
+ simplify: false
+ goimports:
+ local-prefixes: github.com/fxamacker/cbor
+ golint:
+ min-confidence: 0
+ govet:
+ check-shadowing: true
+ lll:
+ line-length: 140
+ maligned:
+ suggest-new: true
+ misspell:
+ locale: US
+ staticcheck:
+ checks: ["all"]
+
+linters:
+ disable-all: true
+ enable:
+ - asciicheck
+ - bidichk
+ - depguard
+ - errcheck
+ - exportloopref
+ - goconst
+ - gocritic
+ - gocyclo
+ - gofmt
+ - goimports
+ - goprintffuncname
+ - gosec
+ - gosimple
+ - govet
+ - ineffassign
+ - misspell
+ - nilerr
+ - revive
+ - staticcheck
+ - stylecheck
+ - typecheck
+ - unconvert
+ - unused
+
+issues:
+ # max-issues-per-linter default is 50. Set to 0 to disable limit.
+ max-issues-per-linter: 0
+ # max-same-issues default is 3. Set to 0 to disable limit.
+ max-same-issues: 0
+
+ exclude-rules:
+ - path: decode.go
+ text: "string ` overflows ` has (\\d+) occurrences, make it a constant"
+ - path: decode.go
+ text: "string ` \\(range is \\[` has (\\d+) occurrences, make it a constant"
+ - path: decode.go
+ text: "string `, ` has (\\d+) occurrences, make it a constant"
+ - path: decode.go
+ text: "string ` overflows Go's int64` has (\\d+) occurrences, make it a constant"
+ - path: decode.go
+ text: "string `\\]\\)` has (\\d+) occurrences, make it a constant"
+ - path: valid.go
+ text: "string ` for type ` has (\\d+) occurrences, make it a constant"
+ - path: valid.go
+ text: "string `cbor: ` has (\\d+) occurrences, make it a constant"
diff --git a/vendor/github.com/fxamacker/cbor/v2/CODE_OF_CONDUCT.md b/vendor/github.com/fxamacker/cbor/v2/CODE_OF_CONDUCT.md
new file mode 100644
index 00000000..c794b2b0
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/CODE_OF_CONDUCT.md
@@ -0,0 +1,133 @@
+
+# Contributor Covenant Code of Conduct
+
+## Our Pledge
+
+We as members, contributors, and leaders pledge to make participation in our
+community a harassment-free experience for everyone, regardless of age, body
+size, visible or invisible disability, ethnicity, sex characteristics, gender
+identity and expression, level of experience, education, socio-economic status,
+nationality, personal appearance, race, caste, color, religion, or sexual
+identity and orientation.
+
+We pledge to act and interact in ways that contribute to an open, welcoming,
+diverse, inclusive, and healthy community.
+
+## Our Standards
+
+Examples of behavior that contributes to a positive environment for our
+community include:
+
+* Demonstrating empathy and kindness toward other people
+* Being respectful of differing opinions, viewpoints, and experiences
+* Giving and gracefully accepting constructive feedback
+* Accepting responsibility and apologizing to those affected by our mistakes,
+ and learning from the experience
+* Focusing on what is best not just for us as individuals, but for the overall
+ community
+
+Examples of unacceptable behavior include:
+
+* The use of sexualized language or imagery, and sexual attention or advances of
+ any kind
+* Trolling, insulting or derogatory comments, and personal or political attacks
+* Public or private harassment
+* Publishing others' private information, such as a physical or email address,
+ without their explicit permission
+* Other conduct which could reasonably be considered inappropriate in a
+ professional setting
+
+## Enforcement Responsibilities
+
+Community leaders are responsible for clarifying and enforcing our standards of
+acceptable behavior and will take appropriate and fair corrective action in
+response to any behavior that they deem inappropriate, threatening, offensive,
+or harmful.
+
+Community leaders have the right and responsibility to remove, edit, or reject
+comments, commits, code, wiki edits, issues, and other contributions that are
+not aligned to this Code of Conduct, and will communicate reasons for moderation
+decisions when appropriate.
+
+## Scope
+
+This Code of Conduct applies within all community spaces, and also applies when
+an individual is officially representing the community in public spaces.
+Examples of representing our community include using an official e-mail address,
+posting via an official social media account, or acting as an appointed
+representative at an online or offline event.
+
+## Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be
+reported to the community leaders responsible for enforcement at
+faye.github@gmail.com.
+All complaints will be reviewed and investigated promptly and fairly.
+
+All community leaders are obligated to respect the privacy and security of the
+reporter of any incident.
+
+## Enforcement Guidelines
+
+Community leaders will follow these Community Impact Guidelines in determining
+the consequences for any action they deem in violation of this Code of Conduct:
+
+### 1. Correction
+
+**Community Impact**: Use of inappropriate language or other behavior deemed
+unprofessional or unwelcome in the community.
+
+**Consequence**: A private, written warning from community leaders, providing
+clarity around the nature of the violation and an explanation of why the
+behavior was inappropriate. A public apology may be requested.
+
+### 2. Warning
+
+**Community Impact**: A violation through a single incident or series of
+actions.
+
+**Consequence**: A warning with consequences for continued behavior. No
+interaction with the people involved, including unsolicited interaction with
+those enforcing the Code of Conduct, for a specified period of time. This
+includes avoiding interactions in community spaces as well as external channels
+like social media. Violating these terms may lead to a temporary or permanent
+ban.
+
+### 3. Temporary Ban
+
+**Community Impact**: A serious violation of community standards, including
+sustained inappropriate behavior.
+
+**Consequence**: A temporary ban from any sort of interaction or public
+communication with the community for a specified period of time. No public or
+private interaction with the people involved, including unsolicited interaction
+with those enforcing the Code of Conduct, is allowed during this period.
+Violating these terms may lead to a permanent ban.
+
+### 4. Permanent Ban
+
+**Community Impact**: Demonstrating a pattern of violation of community
+standards, including sustained inappropriate behavior, harassment of an
+individual, or aggression toward or disparagement of classes of individuals.
+
+**Consequence**: A permanent ban from any sort of public interaction within the
+community.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage],
+version 2.1, available at
+[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
+
+Community Impact Guidelines were inspired by
+[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
+
+For answers to common questions about this code of conduct, see the FAQ at
+[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
+[https://www.contributor-covenant.org/translations][translations].
+
+[homepage]: https://www.contributor-covenant.org
+[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
+[Mozilla CoC]: https://github.com/mozilla/diversity
+[FAQ]: https://www.contributor-covenant.org/faq
+[translations]: https://www.contributor-covenant.org/translations
diff --git a/vendor/github.com/fxamacker/cbor/v2/CONTRIBUTING.md b/vendor/github.com/fxamacker/cbor/v2/CONTRIBUTING.md
new file mode 100644
index 00000000..de0965e1
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/CONTRIBUTING.md
@@ -0,0 +1,41 @@
+# How to contribute
+
+You can contribute by using the library, opening issues, or opening pull requests.
+
+## Bug reports and security vulnerabilities
+
+Most issues are tracked publicly on [GitHub](https://github.com/fxamacker/cbor/issues).
+
+To report security vulnerabilities, please email faye.github@gmail.com and allow time for the problem to be resolved before disclosing it to the public. For more info, see [Security Policy](https://github.com/fxamacker/cbor#security-policy).
+
+Please do not send data that might contain personally identifiable information, even if you think you have permission. That type of support requires payment and a signed contract where I'm indemnified, held harmless, and defended by you for any data you send to me.
+
+## Pull requests
+
+Please [create an issue](https://github.com/fxamacker/cbor/issues/new/choose) before you begin work on a PR. The improvement may have already been considered, etc.
+
+Pull requests have signing requirements and must not be anonymous. Exceptions are usually made for docs and CI scripts.
+
+See the [Pull Request Template](https://github.com/fxamacker/cbor/blob/master/.github/pull_request_template.md) for details.
+
+Pull requests have a greater chance of being approved if:
+- it does not reduce speed, increase memory use, reduce security, etc. for people not using the new option or feature.
+- it has > 97% code coverage.
+
+## Describe your issue
+
+Clearly describe the issue:
+* If it's a bug, please provide: **version of this library** and **Go** (`go version`), **unmodified error message**, and describe **how to reproduce it**. Also state **what you expected to happen** instead of the error.
+* If you propose a change or addition, try to give an example how the improved code could look like or how to use it.
+* If you found a compilation error, please confirm you're using a supported version of Go. If you are, then provide the output of `go version` first, followed by the complete error message.
+
+## Please don't
+
+Please don't send data containing personally identifiable information, even if you think you have permission. That type of support requires payment and a contract where I'm indemnified, held harmless, and defended for any data you send to me.
+
+Please don't send CBOR data larger than 1024 bytes by email. If you want to send crash-producing CBOR data > 1024 bytes by email, please get my permission before sending it to me.
+
+## Credits
+
+- This guide used nlohmann/json contribution guidelines for inspiration as suggested in issue #22.
+- Special thanks to @lukseven for pointing out the contribution guidelines didn't mention signing requirements.
diff --git a/vendor/github.com/fxamacker/cbor/v2/LICENSE b/vendor/github.com/fxamacker/cbor/v2/LICENSE
new file mode 100644
index 00000000..eaa85049
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2019-present Faye Amacker
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/vendor/github.com/fxamacker/cbor/v2/README.md b/vendor/github.com/fxamacker/cbor/v2/README.md
new file mode 100644
index 00000000..af0a7950
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/README.md
@@ -0,0 +1,691 @@
+# CBOR Codec in Go
+
+
+
+[fxamacker/cbor](https://github.com/fxamacker/cbor) is a library for encoding and decoding [CBOR](https://www.rfc-editor.org/info/std94) and [CBOR Sequences](https://www.rfc-editor.org/rfc/rfc8742.html).
+
+CBOR is a [trusted alternative](https://www.rfc-editor.org/rfc/rfc8949.html#name-comparison-of-other-binary-) to JSON, MessagePack, Protocol Buffers, etc. CBOR is an Internet Standard defined by [IETF STD 94 (RFC 8949)](https://www.rfc-editor.org/info/std94) and is designed to be relevant for decades.
+
+`fxamacker/cbor` is used in projects by Arm Ltd., Cisco, EdgeX Foundry, Flow Foundation, Fraunhofer‑AISEC, Kubernetes, Let's Encrypt (ISRG), Linux Foundation, Microsoft, Mozilla, Oasis Protocol, Tailscale, Teleport, [etc](https://github.com/fxamacker/cbor#who-uses-fxamackercbor).
+
+See [Quick Start](#quick-start) and [Releases](https://github.com/fxamacker/cbor/releases/). 🆕 `UnmarshalFirst` and `DiagnoseFirst` can decode CBOR Sequences. `cbor.MarshalToBuffer()` and `UserBufferEncMode` accepts user-specified buffer.
+
+## fxamacker/cbor
+
+[![](https://github.com/fxamacker/cbor/workflows/ci/badge.svg)](https://github.com/fxamacker/cbor/actions?query=workflow%3Aci)
+[![](https://github.com/fxamacker/cbor/workflows/cover%20%E2%89%A596%25/badge.svg)](https://github.com/fxamacker/cbor/actions?query=workflow%3A%22cover+%E2%89%A596%25%22)
+[![CodeQL](https://github.com/fxamacker/cbor/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/fxamacker/cbor/actions/workflows/codeql-analysis.yml)
+[![](https://img.shields.io/badge/fuzzing-passing-44c010)](#fuzzing-and-code-coverage)
+[![Go Report Card](https://goreportcard.com/badge/github.com/fxamacker/cbor)](https://goreportcard.com/report/github.com/fxamacker/cbor)
+
+`fxamacker/cbor` is a CBOR codec in full conformance with [IETF STD 94 (RFC 8949)](https://www.rfc-editor.org/info/std94). It also supports CBOR Sequences ([RFC 8742](https://www.rfc-editor.org/rfc/rfc8742.html)) and Extended Diagnostic Notation ([Appendix G of RFC 8610](https://www.rfc-editor.org/rfc/rfc8610.html#appendix-G)).
+
+Features include full support for CBOR tags, [Core Deterministic Encoding](https://www.rfc-editor.org/rfc/rfc8949.html#name-core-deterministic-encoding), duplicate map key detection, etc.
+
+Design balances trade-offs between security, speed, concurrency, encoded data size, usability, etc.
+
+
Highlights
+
+__🚀 Speed__
+
+Encoding and decoding is fast without using Go's `unsafe` package. Slower settings are opt-in. Default limits allow very fast and memory efficient rejection of malformed CBOR data.
+
+__🔒 Security__
+
+Decoder has configurable limits that defend against malicious inputs. Duplicate map key detection is supported. By contrast, `encoding/gob` is [not designed to be hardened against adversarial inputs](https://pkg.go.dev/encoding/gob#hdr-Security).
+
+Codec passed multiple confidential security assessments in 2022. No vulnerabilities found in subset of codec in a [nonconfidential security assessment](https://github.com/veraison/go-cose/blob/v1.0.0-rc.1/reports/NCC_Microsoft-go-cose-Report_2022-05-26_v1.0.pdf) prepared by NCC Group for Microsoft Corporation.
+
+__🗜️ Data Size__
+
+Struct tags (`toarray`, `keyasint`, `omitempty`) automatically reduce size of encoded structs. Encoding optionally shrinks float64→32→16 when values fit.
+
+__:jigsaw: Usability__
+
+API is mostly same as `encoding/json` plus interfaces that simplify concurrency for CBOR options. Encoding and decoding modes can be created at startup and reused by any goroutines.
+
+Presets include Core Deterministic Encoding, Preferred Serialization, CTAP2 Canonical CBOR, etc.
+
+__📆 Extensibility__
+
+Features include CBOR [extension points](https://www.rfc-editor.org/rfc/rfc8949.html#section-7.1) (e.g. CBOR tags) and extensive settings. API has interfaces that allow users to create custom encoding and decoding without modifying this library.
+
+
+
+
+
+### Secure Decoding with Configurable Settings
+
+`fxamacker/cbor` has configurable limits, etc. that defend against malicious CBOR data.
+
+By contrast, `encoding/gob` is [not designed to be hardened against adversarial inputs](https://pkg.go.dev/encoding/gob#hdr-Security).
+
+Example decoding with encoding/gob 💥 fatal error (out of memory)
+
+```Go
+// Example of encoding/gob having "fatal error: runtime: out of memory"
+// while decoding 181 bytes.
+package main
+import (
+ "bytes"
+ "encoding/gob"
+ "encoding/hex"
+ "fmt"
+)
+
+// Example data is from https://github.com/golang/go/issues/24446
+// (shortened to 181 bytes).
+const data = "4dffb503010102303001ff30000109010130010800010130010800010130" +
+ "01ffb80001014a01ffb60001014b01ff860001013001ff860001013001ff" +
+ "860001013001ff860001013001ffb80000001eff850401010e3030303030" +
+ "30303030303030303001ff3000010c0104000016ffb70201010830303030" +
+ "3030303001ff3000010c000030ffb6040405fcff00303030303030303030" +
+ "303030303030303030303030303030303030303030303030303030303030" +
+ "30"
+
+type X struct {
+ J *X
+ K map[string]int
+}
+
+func main() {
+ raw, _ := hex.DecodeString(data)
+ decoder := gob.NewDecoder(bytes.NewReader(raw))
+
+ var x X
+ decoder.Decode(&x) // fatal error: runtime: out of memory
+ fmt.Println("Decoding finished.")
+}
+```
+
+
+
+
+
+`fxamacker/cbor` is fast at rejecting malformed CBOR data. E.g. attempts to
+decode 10 bytes of malicious CBOR data to `[]byte` (with default settings):
+
+| Codec | Speed (ns/op) | Memory | Allocs |
+| :---- | ------------: | -----: | -----: |
+| fxamacker/cbor 2.5.0 | 44 ± 5% | 32 B/op | 2 allocs/op |
+| ugorji/go 1.2.11 | 5353261 ± 4% | 67111321 B/op | 13 allocs/op |
+
+Benchmark details
+
+Latest comparison used:
+- Input: `[]byte{0x9B, 0x00, 0x00, 0x42, 0xFA, 0x42, 0xFA, 0x42, 0xFA, 0x42}`
+- go1.19.10, linux/amd64, i5-13600K (disabled all e-cores, DDR4 @2933)
+- go test -bench=. -benchmem -count=20
+
+#### Prior comparisons
+
+| Codec | Speed (ns/op) | Memory | Allocs |
+| :---- | ------------: | -----: | -----: |
+| fxamacker/cbor 2.5.0-beta2 | 44.33 ± 2% | 32 B/op | 2 allocs/op |
+| fxamacker/cbor 0.1.0 - 2.4.0 | ~44.68 ± 6% | 32 B/op | 2 allocs/op |
+| ugorji/go 1.2.10 | 5524792.50 ± 3% | 67110491 B/op | 12 allocs/op |
+| ugorji/go 1.1.0 - 1.2.6 | 💥 runtime: | out of memory: | cannot allocate |
+
+- Input: `[]byte{0x9B, 0x00, 0x00, 0x42, 0xFA, 0x42, 0xFA, 0x42, 0xFA, 0x42}`
+- go1.19.6, linux/amd64, i5-13600K (DDR4)
+- go test -bench=. -benchmem -count=20
+
+
+
+
+
+### Smaller Encodings with Struct Tags
+
+Struct tags (`toarray`, `keyasint`, `omitempty`) reduce encoded size of structs.
+
+Example encoding 3-level nested Go struct to 1 byte CBOR
+
+https://go.dev/play/p/YxwvfPdFQG2
+
+```Go
+// Example encoding nested struct (with omitempty tag)
+// - encoding/json: 18 byte JSON
+// - fxamacker/cbor: 1 byte CBOR
+package main
+
+import (
+ "encoding/hex"
+ "encoding/json"
+ "fmt"
+
+ "github.com/fxamacker/cbor/v2"
+)
+
+type GrandChild struct {
+ Quux int `json:",omitempty"`
+}
+
+type Child struct {
+ Baz int `json:",omitempty"`
+ Qux GrandChild `json:",omitempty"`
+}
+
+type Parent struct {
+ Foo Child `json:",omitempty"`
+ Bar int `json:",omitempty"`
+}
+
+func cb() {
+ results, _ := cbor.Marshal(Parent{})
+ fmt.Println("hex(CBOR): " + hex.EncodeToString(results))
+
+ text, _ := cbor.Diagnose(results) // Diagnostic Notation
+ fmt.Println("DN: " + text)
+}
+
+func js() {
+ results, _ := json.Marshal(Parent{})
+ fmt.Println("hex(JSON): " + hex.EncodeToString(results))
+
+ text := string(results) // JSON
+ fmt.Println("JSON: " + text)
+}
+
+func main() {
+ cb()
+ fmt.Println("-------------")
+ js()
+}
+```
+
+Output (DN is Diagnostic Notation):
+```
+hex(CBOR): a0
+DN: {}
+-------------
+hex(JSON): 7b22466f6f223a7b22517578223a7b7d7d7d
+JSON: {"Foo":{"Qux":{}}}
+```
+
+
+
+
+
+Example using different struct tags together:
+
+![alt text](https://github.com/fxamacker/images/raw/master/cbor/v2.3.0/cbor_struct_tags_api.svg?sanitize=1 "CBOR API and Go Struct Tags")
+
+API is mostly same as `encoding/json`, plus interfaces that simplify concurrency for CBOR options.
+
+## Quick Start
+
+__Install__: `go get github.com/fxamacker/cbor/v2` and `import "github.com/fxamacker/cbor/v2"`.
+
+### Key Points
+
+This library can encode and decode CBOR (RFC 8949) and CBOR Sequences (RFC 8742).
+
+- __CBOR data item__ is a single piece of CBOR data and its structure may contain 0 or more nested data items.
+- __CBOR sequence__ is a concatenation of 0 or more encoded CBOR data items.
+
+Configurable limits and options can be used to balance trade-offs.
+
+- Encoding and decoding modes are created from options (settings).
+- Modes can be created at startup and reused.
+- Modes are safe for concurrent use.
+
+### Default Mode
+
+Package level functions only use this library's default settings.
+They provide the "default mode" of encoding and decoding.
+
+```go
+// API matches encoding/json for Marshal, Unmarshal, Encode, Decode, etc.
+b, err = cbor.Marshal(v) // encode v to []byte b
+err = cbor.Unmarshal(b, &v) // decode []byte b to v
+decoder = cbor.NewDecoder(r) // create decoder with io.Reader r
+err = decoder.Decode(&v) // decode a CBOR data item to v
+
+// v2.7.0 added MarshalToBuffer() and UserBufferEncMode interface.
+err = cbor.MarshalToBuffer(v, b) // encode v to b instead of using built-in buf pool.
+
+// v2.5.0 added new functions that return remaining bytes.
+
+// UnmarshalFirst decodes first CBOR data item and returns remaining bytes.
+rest, err = cbor.UnmarshalFirst(b, &v) // decode []byte b to v
+
+// DiagnoseFirst translates first CBOR data item to text and returns remaining bytes.
+text, rest, err = cbor.DiagnoseFirst(b) // decode []byte b to Diagnostic Notation text
+
+// NOTE: Unmarshal returns ExtraneousDataError if there are remaining bytes,
+// but new funcs UnmarshalFirst and DiagnoseFirst do not.
+```
+
+__IMPORTANT__: 👉 CBOR settings allow trade-offs between speed, security, encoding size, etc.
+
+- Different CBOR libraries may use different default settings.
+- CBOR-based formats or protocols usually require specific settings.
+
+For example, WebAuthn uses "CTAP2 Canonical CBOR" which is available as a preset.
+
+### Presets
+
+Presets can be used as-is or as a starting point for custom settings.
+
+```go
+// EncOptions is a struct of encoder settings.
+func CoreDetEncOptions() EncOptions // RFC 8949 Core Deterministic Encoding
+func PreferredUnsortedEncOptions() EncOptions // RFC 8949 Preferred Serialization
+func CanonicalEncOptions() EncOptions // RFC 7049 Canonical CBOR
+func CTAP2EncOptions() EncOptions // FIDO2 CTAP2 Canonical CBOR
+```
+
+Presets are used to create custom modes.
+
+### Custom Modes
+
+Modes are created from settings. Once created, modes have immutable settings.
+
+💡 Create the mode at startup and reuse it. It is safe for concurrent use.
+
+```Go
+// Create encoding mode.
+opts := cbor.CoreDetEncOptions() // use preset options as a starting point
+opts.Time = cbor.TimeUnix // change any settings if needed
+em, err := opts.EncMode() // create an immutable encoding mode
+
+// Reuse the encoding mode. It is safe for concurrent use.
+
+// API matches encoding/json.
+b, err := em.Marshal(v) // encode v to []byte b
+encoder := em.NewEncoder(w) // create encoder with io.Writer w
+err := encoder.Encode(v) // encode v to io.Writer w
+```
+
+Default mode and custom modes automatically apply struct tags.
+
+### User Specified Buffer for Encoding (v2.7.0)
+
+`UserBufferEncMode` interface extends `EncMode` interface to add `MarshalToBuffer()`. It accepts a user-specified buffer instead of using built-in buffer pool.
+
+```Go
+em, err := myEncOptions.UserBufferEncMode() // create UserBufferEncMode mode
+
+var buf bytes.Buffer
+err = em.MarshalToBuffer(v, &buf) // encode v to provided buf
+```
+
+### Struct Tags
+
+Struct tags (`toarray`, `keyasint`, `omitempty`) reduce encoded size of structs.
+
+Example encoding 3-level nested Go struct to 1 byte CBOR
+
+https://go.dev/play/p/YxwvfPdFQG2
+
+```Go
+// Example encoding nested struct (with omitempty tag)
+// - encoding/json: 18 byte JSON
+// - fxamacker/cbor: 1 byte CBOR
+package main
+
+import (
+ "encoding/hex"
+ "encoding/json"
+ "fmt"
+
+ "github.com/fxamacker/cbor/v2"
+)
+
+type GrandChild struct {
+ Quux int `json:",omitempty"`
+}
+
+type Child struct {
+ Baz int `json:",omitempty"`
+ Qux GrandChild `json:",omitempty"`
+}
+
+type Parent struct {
+ Foo Child `json:",omitempty"`
+ Bar int `json:",omitempty"`
+}
+
+func cb() {
+ results, _ := cbor.Marshal(Parent{})
+ fmt.Println("hex(CBOR): " + hex.EncodeToString(results))
+
+ text, _ := cbor.Diagnose(results) // Diagnostic Notation
+ fmt.Println("DN: " + text)
+}
+
+func js() {
+ results, _ := json.Marshal(Parent{})
+ fmt.Println("hex(JSON): " + hex.EncodeToString(results))
+
+ text := string(results) // JSON
+ fmt.Println("JSON: " + text)
+}
+
+func main() {
+ cb()
+ fmt.Println("-------------")
+ js()
+}
+```
+
+Output (DN is Diagnostic Notation):
+```
+hex(CBOR): a0
+DN: {}
+-------------
+hex(JSON): 7b22466f6f223a7b22517578223a7b7d7d7d
+JSON: {"Foo":{"Qux":{}}}
+```
+
+
+
+
+
+Example using several struct tags
+
+![alt text](https://github.com/fxamacker/images/raw/master/cbor/v2.3.0/cbor_struct_tags_api.svg?sanitize=1 "CBOR API and Go Struct Tags")
+
+
+
+Struct tags simplify use of CBOR-based protocols that require CBOR arrays or maps with integer keys.
+
+### CBOR Tags
+
+CBOR tags are specified in a `TagSet`.
+
+Custom modes can be created with a `TagSet` to handle CBOR tags.
+
+```go
+em, err := opts.EncMode() // no CBOR tags
+em, err := opts.EncModeWithTags(ts) // immutable CBOR tags
+em, err := opts.EncModeWithSharedTags(ts) // mutable shared CBOR tags
+```
+
+`TagSet` and modes using it are safe for concurrent use. Equivalent API is available for `DecMode`.
+
+Example using TagSet and TagOptions
+
+```go
+// Use signedCWT struct defined in "Decoding CWT" example.
+
+// Create TagSet (safe for concurrency).
+tags := cbor.NewTagSet()
+// Register tag COSE_Sign1 18 with signedCWT type.
+tags.Add(
+ cbor.TagOptions{EncTag: cbor.EncTagRequired, DecTag: cbor.DecTagRequired},
+ reflect.TypeOf(signedCWT{}),
+ 18)
+
+// Create DecMode with immutable tags.
+dm, _ := cbor.DecOptions{}.DecModeWithTags(tags)
+
+// Unmarshal to signedCWT with tag support.
+var v signedCWT
+if err := dm.Unmarshal(data, &v); err != nil {
+ return err
+}
+
+// Create EncMode with immutable tags.
+em, _ := cbor.EncOptions{}.EncModeWithTags(tags)
+
+// Marshal signedCWT with tag number.
+if data, err := cbor.Marshal(v); err != nil {
+ return err
+}
+```
+
+
+
+### Functions and Interfaces
+
+Functions and interfaces at a glance
+
+Common functions with same API as `encoding/json`:
+- `Marshal`, `Unmarshal`
+- `NewEncoder`, `(*Encoder).Encode`
+- `NewDecoder`, `(*Decoder).Decode`
+
+NOTE: `Unmarshal` will return `ExtraneousDataError` if there are remaining bytes
+because RFC 8949 treats CBOR data item with remaining bytes as malformed.
+- 💡 Use `UnmarshalFirst` to decode first CBOR data item and return any remaining bytes.
+
+Other useful functions:
+- `Diagnose`, `DiagnoseFirst` produce human-readable [Extended Diagnostic Notation](https://www.rfc-editor.org/rfc/rfc8610.html#appendix-G) from CBOR data.
+- `UnmarshalFirst` decodes first CBOR data item and return any remaining bytes.
+- `Wellformed` returns true if the the CBOR data item is well-formed.
+
+Interfaces identical or comparable to Go `encoding` packages include:
+`Marshaler`, `Unmarshaler`, `BinaryMarshaler`, and `BinaryUnmarshaler`.
+
+The `RawMessage` type can be used to delay CBOR decoding or precompute CBOR encoding.
+
+
+
+### Security Tips
+
+🔒 Use Go's `io.LimitReader` to limit size when decoding very large or indefinite size data.
+
+Default limits may need to be increased for systems handling very large data (e.g. blockchains).
+
+`DecOptions` can be used to modify default limits for `MaxArrayElements`, `MaxMapPairs`, and `MaxNestedLevels`.
+
+## Status
+
+v2.7.0 (June 23, 2024) adds features and improvements that help large projects (e.g. Kubernetes) use CBOR as an alternative to JSON and Protocol Buffers. Other improvements include speedups, improved memory use, bug fixes, new serialization options, etc. It passed fuzz tests (5+ billion executions) and is production quality.
+
+For more details, see [release notes](https://github.com/fxamacker/cbor/releases).
+
+### Prior Release
+
+[v2.6.0](https://github.com/fxamacker/cbor/releases/tag/v2.6.0) (February 2024) adds important new features, optimizations, and bug fixes. It is especially useful to systems that need to convert data between CBOR and JSON. New options and optimizations improve handling of bignum, integers, maps, and strings.
+
+v2.5.0 was released on Sunday, August 13, 2023 with new features and important bug fixes. It is fuzz tested and production quality after extended beta [v2.5.0-beta](https://github.com/fxamacker/cbor/releases/tag/v2.5.0-beta) (Dec 2022) -> [v2.5.0](https://github.com/fxamacker/cbor/releases/tag/v2.5.0) (Aug 2023).
+
+__IMPORTANT__: 👉 Before upgrading from v2.4 or older release, please read the notable changes highlighted in the release notes. v2.5.0 is a large release with bug fixes to error handling for extraneous data in `Unmarshal`, etc. that should be reviewed before upgrading.
+
+See [v2.5.0 release notes](https://github.com/fxamacker/cbor/releases/tag/v2.5.0) for list of new features, improvements, and bug fixes.
+
+See ["Version and API Changes"](https://github.com/fxamacker/cbor#versions-and-api-changes) section for more info about version numbering, etc.
+
+
+
+## Who uses fxamacker/cbor
+
+`fxamacker/cbor` is used in projects by Arm Ltd., Berlin Institute of Health at Charité, Chainlink, Cisco, Confidential Computing Consortium, ConsenSys, Dapper Labs, EdgeX Foundry, F5, FIDO Alliance, Fraunhofer‑AISEC, Kubernetes, Let's Encrypt (ISRG), Linux Foundation, Matrix.org, Microsoft, Mozilla, National Cybersecurity Agency of France (govt), Netherlands (govt), Oasis Protocol, Smallstep, Tailscale, Taurus SA, Teleport, TIBCO, and others.
+
+`fxamacker/cbor` passed multiple confidential security assessments. A [nonconfidential security assessment](https://github.com/veraison/go-cose/blob/v1.0.0-rc.1/reports/NCC_Microsoft-go-cose-Report_2022-05-26_v1.0.pdf) (prepared by NCC Group for Microsoft Corporation) includes a subset of fxamacker/cbor v2.4.0 in its scope.
+
+## Standards
+
+`fxamacker/cbor` is a CBOR codec in full conformance with [IETF STD 94 (RFC 8949)](https://www.rfc-editor.org/info/std94). It also supports CBOR Sequences ([RFC 8742](https://www.rfc-editor.org/rfc/rfc8742.html)) and Extended Diagnostic Notation ([Appendix G of RFC 8610](https://www.rfc-editor.org/rfc/rfc8610.html#appendix-G)).
+
+Notable CBOR features include:
+
+| CBOR Feature | Description |
+| :--- | :--- |
+| CBOR tags | API supports built-in and user-defined tags. |
+| Preferred serialization | Integers encode to fewest bytes. Optional float64 → float32 → float16. |
+| Map key sorting | Unsorted, length-first (Canonical CBOR), and bytewise-lexicographic (CTAP2). |
+| Duplicate map keys | Always forbid for encoding and option to allow/forbid for decoding. |
+| Indefinite length data | Option to allow/forbid for encoding and decoding. |
+| Well-formedness | Always checked and enforced. |
+| Basic validity checks | Optionally check UTF-8 validity and duplicate map keys. |
+| Security considerations | Prevent integer overflow and resource exhaustion (RFC 8949 Section 10). |
+
+Known limitations are noted in the [Limitations section](#limitations).
+
+Go nil values for slices, maps, pointers, etc. are encoded as CBOR null. Empty slices, maps, etc. are encoded as empty CBOR arrays and maps.
+
+Decoder checks for all required well-formedness errors, including all "subkinds" of syntax errors and too little data.
+
+After well-formedness is verified, basic validity errors are handled as follows:
+
+* Invalid UTF-8 string: Decoder has option to check and return invalid UTF-8 string error. This check is enabled by default.
+* Duplicate keys in a map: Decoder has options to ignore or enforce rejection of duplicate map keys.
+
+When decoding well-formed CBOR arrays and maps, decoder saves the first error it encounters and continues with the next item. Options to handle this differently may be added in the future.
+
+By default, decoder treats time values of floating-point NaN and Infinity as if they are CBOR Null or CBOR Undefined.
+
+__Click to expand topic:__
+
+
+ Duplicate Map Keys
+
+This library provides options for fast detection and rejection of duplicate map keys based on applying a Go-specific data model to CBOR's extended generic data model in order to determine duplicate vs distinct map keys. Detection relies on whether the CBOR map key would be a duplicate "key" when decoded and applied to the user-provided Go map or struct.
+
+`DupMapKeyQuiet` turns off detection of duplicate map keys. It tries to use a "keep fastest" method by choosing either "keep first" or "keep last" depending on the Go data type.
+
+`DupMapKeyEnforcedAPF` enforces detection and rejection of duplidate map keys. Decoding stops immediately and returns `DupMapKeyError` when the first duplicate key is detected. The error includes the duplicate map key and the index number.
+
+APF suffix means "Allow Partial Fill" so the destination map or struct can contain some decoded values at the time of error. It is the caller's responsibility to respond to the `DupMapKeyError` by discarding the partially filled result if that's required by their protocol.
+
+
+
+
+ Tag Validity
+
+This library checks tag validity for built-in tags (currently tag numbers 0, 1, 2, 3, and 55799):
+
+* Inadmissible type for tag content
+* Inadmissible value for tag content
+
+Unknown tag data items (not tag number 0, 1, 2, 3, or 55799) are handled in two ways:
+
+* When decoding into an empty interface, unknown tag data item will be decoded into `cbor.Tag` data type, which contains tag number and tag content. The tag content will be decoded into the default Go data type for the CBOR data type.
+* When decoding into other Go types, unknown tag data item is decoded into the specified Go type. If Go type is registered with a tag number, the tag number can optionally be verified.
+
+Decoder also has an option to forbid tag data items (treat any tag data item as error) which is specified by protocols such as CTAP2 Canonical CBOR.
+
+For more information, see [decoding options](#decoding-options-1) and [tag options](#tag-options).
+
+
+
+## Limitations
+
+If any of these limitations prevent you from using this library, please open an issue along with a link to your project.
+
+* CBOR `Undefined` (0xf7) value decodes to Go's `nil` value. CBOR `Null` (0xf6) more closely matches Go's `nil`.
+* CBOR map keys with data types not supported by Go for map keys are ignored and an error is returned after continuing to decode remaining items.
+* When decoding registered CBOR tag data to interface type, decoder creates a pointer to registered Go type matching CBOR tag number. Requiring a pointer for this is a Go limitation.
+
+## Fuzzing and Code Coverage
+
+__Code coverage__ is always 95% or higher (with `go test -cover`) when tagging a release.
+
+__Coverage-guided fuzzing__ must pass billions of execs using before tagging a release. Fuzzing is done using nonpublic code which may eventually get merged into this project. Until then, reports like OpenSSF Scorecard can't detect fuzz tests being used by this project.
+
+
+
+## Versions and API Changes
+This project uses [Semantic Versioning](https://semver.org), so the API is always backwards compatible unless the major version number changes.
+
+These functions have signatures identical to encoding/json and their API will continue to match `encoding/json` even after major new releases:
+`Marshal`, `Unmarshal`, `NewEncoder`, `NewDecoder`, `(*Encoder).Encode`, and `(*Decoder).Decode`.
+
+Exclusions from SemVer:
+- Newly added API documented as "subject to change".
+- Newly added API in the master branch that has never been tagged in non-beta release.
+- If function parameters are unchanged, bug fixes that change behavior (e.g. return error for edge case was missed in prior version). We try to highlight these in the release notes and add extended beta period. E.g. [v2.5.0-beta](https://github.com/fxamacker/cbor/releases/tag/v2.5.0-beta) (Dec 2022) -> [v2.5.0](https://github.com/fxamacker/cbor/releases/tag/v2.5.0) (Aug 2023).
+
+This project avoids breaking changes to behavior of encoding and decoding functions unless required to improve conformance with supported RFCs (e.g. RFC 8949, RFC 8742, etc.) Visible changes that don't improve conformance to standards are typically made available as new opt-in settings or new functions.
+
+## Code of Conduct
+
+This project has adopted the [Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.md). Contact [faye.github@gmail.com](mailto:faye.github@gmail.com) with any questions or comments.
+
+## Contributing
+
+Please open an issue before beginning work on a PR. The improvement may have already been considered, etc.
+
+For more info, see [How to Contribute](CONTRIBUTING.md).
+
+## Security Policy
+
+Security fixes are provided for the latest released version of fxamacker/cbor.
+
+For the full text of the Security Policy, see [SECURITY.md](SECURITY.md).
+
+## Acknowledgements
+
+Many thanks to all the contributors on this project!
+
+I'm especially grateful to Bastian Müller and Dieter Shirley for suggesting and collaborating on CBOR stream mode, and much more.
+
+I'm very grateful to Stefan Tatschner, Yawning Angel, Jernej Kos, x448, ZenGround0, and Jakob Borg for their contributions or support in the very early days.
+
+Big thanks to Ben Luddy for his contributions in v2.6.0 and v2.7.0.
+
+This library clearly wouldn't be possible without Carsten Bormann authoring CBOR RFCs.
+
+Special thanks to Laurence Lundblade and Jeffrey Yasskin for their help on IETF mailing list or at [7049bis](https://github.com/cbor-wg/CBORbis).
+
+Huge thanks to The Go Authors for creating a fun and practical programming language with batteries included!
+
+This library uses `x448/float16` which used to be included. As a standalone package, `x448/float16` is useful to other projects as well.
+
+## License
+
+Copyright © 2019-2024 [Faye Amacker](https://github.com/fxamacker).
+
+fxamacker/cbor is licensed under the MIT License. See [LICENSE](LICENSE) for the full license text.
+
+
diff --git a/vendor/github.com/fxamacker/cbor/v2/SECURITY.md b/vendor/github.com/fxamacker/cbor/v2/SECURITY.md
new file mode 100644
index 00000000..9c05146d
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/SECURITY.md
@@ -0,0 +1,7 @@
+# Security Policy
+
+Security fixes are provided for the latest released version of fxamacker/cbor.
+
+If the security vulnerability is already known to the public, then you can open an issue as a bug report.
+
+To report security vulnerabilities not yet known to the public, please email faye.github@gmail.com and allow time for the problem to be resolved before reporting it to the public.
diff --git a/vendor/github.com/fxamacker/cbor/v2/bytestring.go b/vendor/github.com/fxamacker/cbor/v2/bytestring.go
new file mode 100644
index 00000000..823bff12
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/bytestring.go
@@ -0,0 +1,63 @@
+// Copyright (c) Faye Amacker. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+package cbor
+
+import (
+ "errors"
+)
+
+// ByteString represents CBOR byte string (major type 2). ByteString can be used
+// when using a Go []byte is not possible or convenient. For example, Go doesn't
+// allow []byte as map key, so ByteString can be used to support data formats
+// having CBOR map with byte string keys. ByteString can also be used to
+// encode invalid UTF-8 string as CBOR byte string.
+// See DecOption.MapKeyByteStringMode for more details.
+type ByteString string
+
+// Bytes returns bytes representing ByteString.
+func (bs ByteString) Bytes() []byte {
+ return []byte(bs)
+}
+
+// MarshalCBOR encodes ByteString as CBOR byte string (major type 2).
+func (bs ByteString) MarshalCBOR() ([]byte, error) {
+ e := getEncodeBuffer()
+ defer putEncodeBuffer(e)
+
+ // Encode length
+ encodeHead(e, byte(cborTypeByteString), uint64(len(bs)))
+
+ // Encode data
+ buf := make([]byte, e.Len()+len(bs))
+ n := copy(buf, e.Bytes())
+ copy(buf[n:], bs)
+
+ return buf, nil
+}
+
+// UnmarshalCBOR decodes CBOR byte string (major type 2) to ByteString.
+// Decoding CBOR null and CBOR undefined sets ByteString to be empty.
+func (bs *ByteString) UnmarshalCBOR(data []byte) error {
+ if bs == nil {
+ return errors.New("cbor.ByteString: UnmarshalCBOR on nil pointer")
+ }
+
+ // Decoding CBOR null and CBOR undefined to ByteString resets data.
+ // This behavior is similar to decoding CBOR null and CBOR undefined to []byte.
+ if len(data) == 1 && (data[0] == 0xf6 || data[0] == 0xf7) {
+ *bs = ""
+ return nil
+ }
+
+ d := decoder{data: data, dm: defaultDecMode}
+
+ // Check if CBOR data type is byte string
+ if typ := d.nextCBORType(); typ != cborTypeByteString {
+ return &UnmarshalTypeError{CBORType: typ.String(), GoType: typeByteString.String()}
+ }
+
+ b, _ := d.parseByteString()
+ *bs = ByteString(b)
+ return nil
+}
diff --git a/vendor/github.com/fxamacker/cbor/v2/cache.go b/vendor/github.com/fxamacker/cbor/v2/cache.go
new file mode 100644
index 00000000..ea0f39e2
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/cache.go
@@ -0,0 +1,363 @@
+// Copyright (c) Faye Amacker. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+package cbor
+
+import (
+ "bytes"
+ "errors"
+ "fmt"
+ "reflect"
+ "sort"
+ "strconv"
+ "strings"
+ "sync"
+)
+
+type encodeFuncs struct {
+ ef encodeFunc
+ ief isEmptyFunc
+}
+
+var (
+ decodingStructTypeCache sync.Map // map[reflect.Type]*decodingStructType
+ encodingStructTypeCache sync.Map // map[reflect.Type]*encodingStructType
+ encodeFuncCache sync.Map // map[reflect.Type]encodeFuncs
+ typeInfoCache sync.Map // map[reflect.Type]*typeInfo
+)
+
+type specialType int
+
+const (
+ specialTypeNone specialType = iota
+ specialTypeUnmarshalerIface
+ specialTypeEmptyIface
+ specialTypeIface
+ specialTypeTag
+ specialTypeTime
+)
+
+type typeInfo struct {
+ elemTypeInfo *typeInfo
+ keyTypeInfo *typeInfo
+ typ reflect.Type
+ kind reflect.Kind
+ nonPtrType reflect.Type
+ nonPtrKind reflect.Kind
+ spclType specialType
+}
+
+func newTypeInfo(t reflect.Type) *typeInfo {
+ tInfo := typeInfo{typ: t, kind: t.Kind()}
+
+ for t.Kind() == reflect.Ptr {
+ t = t.Elem()
+ }
+
+ k := t.Kind()
+
+ tInfo.nonPtrType = t
+ tInfo.nonPtrKind = k
+
+ if k == reflect.Interface {
+ if t.NumMethod() == 0 {
+ tInfo.spclType = specialTypeEmptyIface
+ } else {
+ tInfo.spclType = specialTypeIface
+ }
+ } else if t == typeTag {
+ tInfo.spclType = specialTypeTag
+ } else if t == typeTime {
+ tInfo.spclType = specialTypeTime
+ } else if reflect.PtrTo(t).Implements(typeUnmarshaler) {
+ tInfo.spclType = specialTypeUnmarshalerIface
+ }
+
+ switch k {
+ case reflect.Array, reflect.Slice:
+ tInfo.elemTypeInfo = getTypeInfo(t.Elem())
+ case reflect.Map:
+ tInfo.keyTypeInfo = getTypeInfo(t.Key())
+ tInfo.elemTypeInfo = getTypeInfo(t.Elem())
+ }
+
+ return &tInfo
+}
+
+type decodingStructType struct {
+ fields fields
+ fieldIndicesByName map[string]int
+ err error
+ toArray bool
+}
+
+// The stdlib errors.Join was introduced in Go 1.20, and we still support Go 1.17, so instead,
+// here's a very basic implementation of an aggregated error.
+type multierror []error
+
+func (m multierror) Error() string {
+ var sb strings.Builder
+ for i, err := range m {
+ sb.WriteString(err.Error())
+ if i < len(m)-1 {
+ sb.WriteString(", ")
+ }
+ }
+ return sb.String()
+}
+
+func getDecodingStructType(t reflect.Type) *decodingStructType {
+ if v, _ := decodingStructTypeCache.Load(t); v != nil {
+ return v.(*decodingStructType)
+ }
+
+ flds, structOptions := getFields(t)
+
+ toArray := hasToArrayOption(structOptions)
+
+ var errs []error
+ for i := 0; i < len(flds); i++ {
+ if flds[i].keyAsInt {
+ nameAsInt, numErr := strconv.Atoi(flds[i].name)
+ if numErr != nil {
+ errs = append(errs, errors.New("cbor: failed to parse field name \""+flds[i].name+"\" to int ("+numErr.Error()+")"))
+ break
+ }
+ flds[i].nameAsInt = int64(nameAsInt)
+ }
+
+ flds[i].typInfo = getTypeInfo(flds[i].typ)
+ }
+
+ fieldIndicesByName := make(map[string]int, len(flds))
+ for i, fld := range flds {
+ if _, ok := fieldIndicesByName[fld.name]; ok {
+ errs = append(errs, fmt.Errorf("cbor: two or more fields of %v have the same name %q", t, fld.name))
+ continue
+ }
+ fieldIndicesByName[fld.name] = i
+ }
+
+ var err error
+ {
+ var multi multierror
+ for _, each := range errs {
+ if each != nil {
+ multi = append(multi, each)
+ }
+ }
+ if len(multi) == 1 {
+ err = multi[0]
+ } else if len(multi) > 1 {
+ err = multi
+ }
+ }
+
+ structType := &decodingStructType{
+ fields: flds,
+ fieldIndicesByName: fieldIndicesByName,
+ err: err,
+ toArray: toArray,
+ }
+ decodingStructTypeCache.Store(t, structType)
+ return structType
+}
+
+type encodingStructType struct {
+ fields fields
+ bytewiseFields fields
+ lengthFirstFields fields
+ omitEmptyFieldsIdx []int
+ err error
+ toArray bool
+}
+
+func (st *encodingStructType) getFields(em *encMode) fields {
+ switch em.sort {
+ case SortNone, SortFastShuffle:
+ return st.fields
+ case SortLengthFirst:
+ return st.lengthFirstFields
+ default:
+ return st.bytewiseFields
+ }
+}
+
+type bytewiseFieldSorter struct {
+ fields fields
+}
+
+func (x *bytewiseFieldSorter) Len() int {
+ return len(x.fields)
+}
+
+func (x *bytewiseFieldSorter) Swap(i, j int) {
+ x.fields[i], x.fields[j] = x.fields[j], x.fields[i]
+}
+
+func (x *bytewiseFieldSorter) Less(i, j int) bool {
+ return bytes.Compare(x.fields[i].cborName, x.fields[j].cborName) <= 0
+}
+
+type lengthFirstFieldSorter struct {
+ fields fields
+}
+
+func (x *lengthFirstFieldSorter) Len() int {
+ return len(x.fields)
+}
+
+func (x *lengthFirstFieldSorter) Swap(i, j int) {
+ x.fields[i], x.fields[j] = x.fields[j], x.fields[i]
+}
+
+func (x *lengthFirstFieldSorter) Less(i, j int) bool {
+ if len(x.fields[i].cborName) != len(x.fields[j].cborName) {
+ return len(x.fields[i].cborName) < len(x.fields[j].cborName)
+ }
+ return bytes.Compare(x.fields[i].cborName, x.fields[j].cborName) <= 0
+}
+
+func getEncodingStructType(t reflect.Type) (*encodingStructType, error) {
+ if v, _ := encodingStructTypeCache.Load(t); v != nil {
+ structType := v.(*encodingStructType)
+ return structType, structType.err
+ }
+
+ flds, structOptions := getFields(t)
+
+ if hasToArrayOption(structOptions) {
+ return getEncodingStructToArrayType(t, flds)
+ }
+
+ var err error
+ var hasKeyAsInt bool
+ var hasKeyAsStr bool
+ var omitEmptyIdx []int
+ e := getEncodeBuffer()
+ for i := 0; i < len(flds); i++ {
+ // Get field's encodeFunc
+ flds[i].ef, flds[i].ief = getEncodeFunc(flds[i].typ)
+ if flds[i].ef == nil {
+ err = &UnsupportedTypeError{t}
+ break
+ }
+
+ // Encode field name
+ if flds[i].keyAsInt {
+ nameAsInt, numErr := strconv.Atoi(flds[i].name)
+ if numErr != nil {
+ err = errors.New("cbor: failed to parse field name \"" + flds[i].name + "\" to int (" + numErr.Error() + ")")
+ break
+ }
+ flds[i].nameAsInt = int64(nameAsInt)
+ if nameAsInt >= 0 {
+ encodeHead(e, byte(cborTypePositiveInt), uint64(nameAsInt))
+ } else {
+ n := nameAsInt*(-1) - 1
+ encodeHead(e, byte(cborTypeNegativeInt), uint64(n))
+ }
+ flds[i].cborName = make([]byte, e.Len())
+ copy(flds[i].cborName, e.Bytes())
+ e.Reset()
+
+ hasKeyAsInt = true
+ } else {
+ encodeHead(e, byte(cborTypeTextString), uint64(len(flds[i].name)))
+ flds[i].cborName = make([]byte, e.Len()+len(flds[i].name))
+ n := copy(flds[i].cborName, e.Bytes())
+ copy(flds[i].cborName[n:], flds[i].name)
+ e.Reset()
+
+ // If cborName contains a text string, then cborNameByteString contains a
+ // string that has the byte string major type but is otherwise identical to
+ // cborName.
+ flds[i].cborNameByteString = make([]byte, len(flds[i].cborName))
+ copy(flds[i].cborNameByteString, flds[i].cborName)
+ // Reset encoded CBOR type to byte string, preserving the "additional
+ // information" bits:
+ flds[i].cborNameByteString[0] = byte(cborTypeByteString) |
+ getAdditionalInformation(flds[i].cborNameByteString[0])
+
+ hasKeyAsStr = true
+ }
+
+ // Check if field can be omitted when empty
+ if flds[i].omitEmpty {
+ omitEmptyIdx = append(omitEmptyIdx, i)
+ }
+ }
+ putEncodeBuffer(e)
+
+ if err != nil {
+ structType := &encodingStructType{err: err}
+ encodingStructTypeCache.Store(t, structType)
+ return structType, structType.err
+ }
+
+ // Sort fields by canonical order
+ bytewiseFields := make(fields, len(flds))
+ copy(bytewiseFields, flds)
+ sort.Sort(&bytewiseFieldSorter{bytewiseFields})
+
+ lengthFirstFields := bytewiseFields
+ if hasKeyAsInt && hasKeyAsStr {
+ lengthFirstFields = make(fields, len(flds))
+ copy(lengthFirstFields, flds)
+ sort.Sort(&lengthFirstFieldSorter{lengthFirstFields})
+ }
+
+ structType := &encodingStructType{
+ fields: flds,
+ bytewiseFields: bytewiseFields,
+ lengthFirstFields: lengthFirstFields,
+ omitEmptyFieldsIdx: omitEmptyIdx,
+ }
+
+ encodingStructTypeCache.Store(t, structType)
+ return structType, structType.err
+}
+
+func getEncodingStructToArrayType(t reflect.Type, flds fields) (*encodingStructType, error) {
+ for i := 0; i < len(flds); i++ {
+ // Get field's encodeFunc
+ flds[i].ef, flds[i].ief = getEncodeFunc(flds[i].typ)
+ if flds[i].ef == nil {
+ structType := &encodingStructType{err: &UnsupportedTypeError{t}}
+ encodingStructTypeCache.Store(t, structType)
+ return structType, structType.err
+ }
+ }
+
+ structType := &encodingStructType{
+ fields: flds,
+ toArray: true,
+ }
+ encodingStructTypeCache.Store(t, structType)
+ return structType, structType.err
+}
+
+func getEncodeFunc(t reflect.Type) (encodeFunc, isEmptyFunc) {
+ if v, _ := encodeFuncCache.Load(t); v != nil {
+ fs := v.(encodeFuncs)
+ return fs.ef, fs.ief
+ }
+ ef, ief := getEncodeFuncInternal(t)
+ encodeFuncCache.Store(t, encodeFuncs{ef, ief})
+ return ef, ief
+}
+
+func getTypeInfo(t reflect.Type) *typeInfo {
+ if v, _ := typeInfoCache.Load(t); v != nil {
+ return v.(*typeInfo)
+ }
+ tInfo := newTypeInfo(t)
+ typeInfoCache.Store(t, tInfo)
+ return tInfo
+}
+
+func hasToArrayOption(tag string) bool {
+ s := ",toarray"
+ idx := strings.Index(tag, s)
+ return idx >= 0 && (len(tag) == idx+len(s) || tag[idx+len(s)] == ',')
+}
diff --git a/vendor/github.com/fxamacker/cbor/v2/common.go b/vendor/github.com/fxamacker/cbor/v2/common.go
new file mode 100644
index 00000000..ec038a49
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/common.go
@@ -0,0 +1,182 @@
+// Copyright (c) Faye Amacker. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+package cbor
+
+import (
+ "fmt"
+ "strconv"
+)
+
+type cborType uint8
+
+const (
+ cborTypePositiveInt cborType = 0x00
+ cborTypeNegativeInt cborType = 0x20
+ cborTypeByteString cborType = 0x40
+ cborTypeTextString cborType = 0x60
+ cborTypeArray cborType = 0x80
+ cborTypeMap cborType = 0xa0
+ cborTypeTag cborType = 0xc0
+ cborTypePrimitives cborType = 0xe0
+)
+
+func (t cborType) String() string {
+ switch t {
+ case cborTypePositiveInt:
+ return "positive integer"
+ case cborTypeNegativeInt:
+ return "negative integer"
+ case cborTypeByteString:
+ return "byte string"
+ case cborTypeTextString:
+ return "UTF-8 text string"
+ case cborTypeArray:
+ return "array"
+ case cborTypeMap:
+ return "map"
+ case cborTypeTag:
+ return "tag"
+ case cborTypePrimitives:
+ return "primitives"
+ default:
+ return "Invalid type " + strconv.Itoa(int(t))
+ }
+}
+
+type additionalInformation uint8
+
+const (
+ maxAdditionalInformationWithoutArgument = 23
+ additionalInformationWith1ByteArgument = 24
+ additionalInformationWith2ByteArgument = 25
+ additionalInformationWith4ByteArgument = 26
+ additionalInformationWith8ByteArgument = 27
+
+ // For major type 7.
+ additionalInformationAsFalse = 20
+ additionalInformationAsTrue = 21
+ additionalInformationAsNull = 22
+ additionalInformationAsUndefined = 23
+ additionalInformationAsFloat16 = 25
+ additionalInformationAsFloat32 = 26
+ additionalInformationAsFloat64 = 27
+
+ // For major type 2, 3, 4, 5.
+ additionalInformationAsIndefiniteLengthFlag = 31
+)
+
+const (
+ maxSimpleValueInAdditionalInformation = 23
+ minSimpleValueIn1ByteArgument = 32
+)
+
+func (ai additionalInformation) isIndefiniteLength() bool {
+ return ai == additionalInformationAsIndefiniteLengthFlag
+}
+
+const (
+ // From RFC 8949 Section 3:
+ // "The initial byte of each encoded data item contains both information about the major type
+ // (the high-order 3 bits, described in Section 3.1) and additional information
+ // (the low-order 5 bits)."
+
+ // typeMask is used to extract major type in initial byte of encoded data item.
+ typeMask = 0xe0
+
+ // additionalInformationMask is used to extract additional information in initial byte of encoded data item.
+ additionalInformationMask = 0x1f
+)
+
+func getType(raw byte) cborType {
+ return cborType(raw & typeMask)
+}
+
+func getAdditionalInformation(raw byte) byte {
+ return raw & additionalInformationMask
+}
+
+func isBreakFlag(raw byte) bool {
+ return raw == cborBreakFlag
+}
+
+func parseInitialByte(b byte) (t cborType, ai byte) {
+ return getType(b), getAdditionalInformation(b)
+}
+
+const (
+ tagNumRFC3339Time = 0
+ tagNumEpochTime = 1
+ tagNumUnsignedBignum = 2
+ tagNumNegativeBignum = 3
+ tagNumExpectedLaterEncodingBase64URL = 21
+ tagNumExpectedLaterEncodingBase64 = 22
+ tagNumExpectedLaterEncodingBase16 = 23
+ tagNumSelfDescribedCBOR = 55799
+)
+
+const (
+ cborBreakFlag = byte(0xff)
+ cborByteStringWithIndefiniteLengthHead = byte(0x5f)
+ cborTextStringWithIndefiniteLengthHead = byte(0x7f)
+ cborArrayWithIndefiniteLengthHead = byte(0x9f)
+ cborMapWithIndefiniteLengthHead = byte(0xbf)
+)
+
+var (
+ cborFalse = []byte{0xf4}
+ cborTrue = []byte{0xf5}
+ cborNil = []byte{0xf6}
+ cborNaN = []byte{0xf9, 0x7e, 0x00}
+ cborPositiveInfinity = []byte{0xf9, 0x7c, 0x00}
+ cborNegativeInfinity = []byte{0xf9, 0xfc, 0x00}
+)
+
+// validBuiltinTag checks that supported built-in tag numbers are followed by expected content types.
+func validBuiltinTag(tagNum uint64, contentHead byte) error {
+ t := getType(contentHead)
+ switch tagNum {
+ case tagNumRFC3339Time:
+ // Tag content (date/time text string in RFC 3339 format) must be string type.
+ if t != cborTypeTextString {
+ return newInadmissibleTagContentTypeError(
+ tagNumRFC3339Time,
+ "text string",
+ t.String())
+ }
+ return nil
+
+ case tagNumEpochTime:
+ // Tag content (epoch date/time) must be uint, int, or float type.
+ if t != cborTypePositiveInt && t != cborTypeNegativeInt && (contentHead < 0xf9 || contentHead > 0xfb) {
+ return newInadmissibleTagContentTypeError(
+ tagNumEpochTime,
+ "integer or floating-point number",
+ t.String())
+ }
+ return nil
+
+ case tagNumUnsignedBignum, tagNumNegativeBignum:
+ // Tag content (bignum) must be byte type.
+ if t != cborTypeByteString {
+ return newInadmissibleTagContentTypeErrorf(
+ fmt.Sprintf(
+ "tag number %d or %d must be followed by byte string, got %s",
+ tagNumUnsignedBignum,
+ tagNumNegativeBignum,
+ t.String(),
+ ))
+ }
+ return nil
+
+ case tagNumExpectedLaterEncodingBase64URL, tagNumExpectedLaterEncodingBase64, tagNumExpectedLaterEncodingBase16:
+ // From RFC 8949 3.4.5.2:
+ // The data item tagged can be a byte string or any other data item. In the latter
+ // case, the tag applies to all of the byte string data items contained in the data
+ // item, except for those contained in a nested data item tagged with an expected
+ // conversion.
+ return nil
+ }
+
+ return nil
+}
diff --git a/vendor/github.com/fxamacker/cbor/v2/decode.go b/vendor/github.com/fxamacker/cbor/v2/decode.go
new file mode 100644
index 00000000..85842ac7
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/decode.go
@@ -0,0 +1,3187 @@
+// Copyright (c) Faye Amacker. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+package cbor
+
+import (
+ "encoding"
+ "encoding/base64"
+ "encoding/binary"
+ "encoding/hex"
+ "errors"
+ "fmt"
+ "io"
+ "math"
+ "math/big"
+ "reflect"
+ "strconv"
+ "strings"
+ "time"
+ "unicode/utf8"
+
+ "github.com/x448/float16"
+)
+
+// Unmarshal parses the CBOR-encoded data into the value pointed to by v
+// using default decoding options. If v is nil, not a pointer, or
+// a nil pointer, Unmarshal returns an error.
+//
+// To unmarshal CBOR into a value implementing the Unmarshaler interface,
+// Unmarshal calls that value's UnmarshalCBOR method with a valid
+// CBOR value.
+//
+// To unmarshal CBOR byte string into a value implementing the
+// encoding.BinaryUnmarshaler interface, Unmarshal calls that value's
+// UnmarshalBinary method with decoded CBOR byte string.
+//
+// To unmarshal CBOR into a pointer, Unmarshal sets the pointer to nil
+// if CBOR data is null (0xf6) or undefined (0xf7). Otherwise, Unmarshal
+// unmarshals CBOR into the value pointed to by the pointer. If the
+// pointer is nil, Unmarshal creates a new value for it to point to.
+//
+// To unmarshal CBOR into an empty interface value, Unmarshal uses the
+// following rules:
+//
+// CBOR booleans decode to bool.
+// CBOR positive integers decode to uint64.
+// CBOR negative integers decode to int64 (big.Int if value overflows).
+// CBOR floating points decode to float64.
+// CBOR byte strings decode to []byte.
+// CBOR text strings decode to string.
+// CBOR arrays decode to []interface{}.
+// CBOR maps decode to map[interface{}]interface{}.
+// CBOR null and undefined values decode to nil.
+// CBOR times (tag 0 and 1) decode to time.Time.
+// CBOR bignums (tag 2 and 3) decode to big.Int.
+// CBOR tags with an unrecognized number decode to cbor.Tag
+//
+// To unmarshal a CBOR array into a slice, Unmarshal allocates a new slice
+// if the CBOR array is empty or slice capacity is less than CBOR array length.
+// Otherwise Unmarshal overwrites existing elements, and sets slice length
+// to CBOR array length.
+//
+// To unmarshal a CBOR array into a Go array, Unmarshal decodes CBOR array
+// elements into Go array elements. If the Go array is smaller than the
+// CBOR array, the extra CBOR array elements are discarded. If the CBOR
+// array is smaller than the Go array, the extra Go array elements are
+// set to zero values.
+//
+// To unmarshal a CBOR array into a struct, struct must have a special field "_"
+// with struct tag `cbor:",toarray"`. Go array elements are decoded into struct
+// fields. Any "omitempty" struct field tag option is ignored in this case.
+//
+// To unmarshal a CBOR map into a map, Unmarshal allocates a new map only if the
+// map is nil. Otherwise Unmarshal reuses the existing map and keeps existing
+// entries. Unmarshal stores key-value pairs from the CBOR map into Go map.
+// See DecOptions.DupMapKey to enable duplicate map key detection.
+//
+// To unmarshal a CBOR map into a struct, Unmarshal matches CBOR map keys to the
+// keys in the following priority:
+//
+// 1. "cbor" key in struct field tag,
+// 2. "json" key in struct field tag,
+// 3. struct field name.
+//
+// Unmarshal tries an exact match for field name, then a case-insensitive match.
+// Map key-value pairs without corresponding struct fields are ignored. See
+// DecOptions.ExtraReturnErrors to return error at unknown field.
+//
+// To unmarshal a CBOR text string into a time.Time value, Unmarshal parses text
+// string formatted in RFC3339. To unmarshal a CBOR integer/float into a
+// time.Time value, Unmarshal creates an unix time with integer/float as seconds
+// and fractional seconds since January 1, 1970 UTC. As a special case, Infinite
+// and NaN float values decode to time.Time's zero value.
+//
+// To unmarshal CBOR null (0xf6) and undefined (0xf7) values into a
+// slice/map/pointer, Unmarshal sets Go value to nil. Because null is often
+// used to mean "not present", unmarshalling CBOR null and undefined value
+// into any other Go type has no effect and returns no error.
+//
+// Unmarshal supports CBOR tag 55799 (self-describe CBOR), tag 0 and 1 (time),
+// and tag 2 and 3 (bignum).
+//
+// Unmarshal returns ExtraneousDataError error (without decoding into v)
+// if there are any remaining bytes following the first valid CBOR data item.
+// See UnmarshalFirst, if you want to unmarshal only the first
+// CBOR data item without ExtraneousDataError caused by remaining bytes.
+func Unmarshal(data []byte, v interface{}) error {
+ return defaultDecMode.Unmarshal(data, v)
+}
+
+// UnmarshalFirst parses the first CBOR data item into the value pointed to by v
+// using default decoding options. Any remaining bytes are returned in rest.
+//
+// If v is nil, not a pointer, or a nil pointer, UnmarshalFirst returns an error.
+//
+// See the documentation for Unmarshal for details.
+func UnmarshalFirst(data []byte, v interface{}) (rest []byte, err error) {
+ return defaultDecMode.UnmarshalFirst(data, v)
+}
+
+// Valid checks whether data is a well-formed encoded CBOR data item and
+// that it complies with default restrictions such as MaxNestedLevels,
+// MaxArrayElements, MaxMapPairs, etc.
+//
+// If there are any remaining bytes after the CBOR data item,
+// an ExtraneousDataError is returned.
+//
+// WARNING: Valid doesn't check if encoded CBOR data item is valid (i.e. validity)
+// and RFC 8949 distinctly defines what is "Valid" and what is "Well-formed".
+//
+// Deprecated: Valid is kept for compatibility and should not be used.
+// Use Wellformed instead because it has a more appropriate name.
+func Valid(data []byte) error {
+ return defaultDecMode.Valid(data)
+}
+
+// Wellformed checks whether data is a well-formed encoded CBOR data item and
+// that it complies with default restrictions such as MaxNestedLevels,
+// MaxArrayElements, MaxMapPairs, etc.
+//
+// If there are any remaining bytes after the CBOR data item,
+// an ExtraneousDataError is returned.
+func Wellformed(data []byte) error {
+ return defaultDecMode.Wellformed(data)
+}
+
+// Unmarshaler is the interface implemented by types that wish to unmarshal
+// CBOR data themselves. The input is a valid CBOR value. UnmarshalCBOR
+// must copy the CBOR data if it needs to use it after returning.
+type Unmarshaler interface {
+ UnmarshalCBOR([]byte) error
+}
+
+// InvalidUnmarshalError describes an invalid argument passed to Unmarshal.
+type InvalidUnmarshalError struct {
+ s string
+}
+
+func (e *InvalidUnmarshalError) Error() string {
+ return e.s
+}
+
+// UnmarshalTypeError describes a CBOR value that can't be decoded to a Go type.
+type UnmarshalTypeError struct {
+ CBORType string // type of CBOR value
+ GoType string // type of Go value it could not be decoded into
+ StructFieldName string // name of the struct field holding the Go value (optional)
+ errorMsg string // additional error message (optional)
+}
+
+func (e *UnmarshalTypeError) Error() string {
+ var s string
+ if e.StructFieldName != "" {
+ s = "cbor: cannot unmarshal " + e.CBORType + " into Go struct field " + e.StructFieldName + " of type " + e.GoType
+ } else {
+ s = "cbor: cannot unmarshal " + e.CBORType + " into Go value of type " + e.GoType
+ }
+ if e.errorMsg != "" {
+ s += " (" + e.errorMsg + ")"
+ }
+ return s
+}
+
+// InvalidMapKeyTypeError describes invalid Go map key type when decoding CBOR map.
+// For example, Go doesn't allow slice as map key.
+type InvalidMapKeyTypeError struct {
+ GoType string
+}
+
+func (e *InvalidMapKeyTypeError) Error() string {
+ return "cbor: invalid map key type: " + e.GoType
+}
+
+// DupMapKeyError describes detected duplicate map key in CBOR map.
+type DupMapKeyError struct {
+ Key interface{}
+ Index int
+}
+
+func (e *DupMapKeyError) Error() string {
+ return fmt.Sprintf("cbor: found duplicate map key \"%v\" at map element index %d", e.Key, e.Index)
+}
+
+// UnknownFieldError describes detected unknown field in CBOR map when decoding to Go struct.
+type UnknownFieldError struct {
+ Index int
+}
+
+func (e *UnknownFieldError) Error() string {
+ return fmt.Sprintf("cbor: found unknown field at map element index %d", e.Index)
+}
+
+// UnacceptableDataItemError is returned when unmarshaling a CBOR input that contains a data item
+// that is not acceptable to a specific CBOR-based application protocol ("invalid or unexpected" as
+// described in RFC 8949 Section 5 Paragraph 3).
+type UnacceptableDataItemError struct {
+ CBORType string
+ Message string
+}
+
+func (e UnacceptableDataItemError) Error() string {
+ return fmt.Sprintf("cbor: data item of cbor type %s is not accepted by protocol: %s", e.CBORType, e.Message)
+}
+
+// ByteStringExpectedFormatError is returned when unmarshaling CBOR byte string fails when
+// using non-default ByteStringExpectedFormat decoding option that makes decoder expect
+// a specified format such as base64, hex, etc.
+type ByteStringExpectedFormatError struct {
+ expectedFormatOption ByteStringExpectedFormatMode
+ err error
+}
+
+func newByteStringExpectedFormatError(expectedFormatOption ByteStringExpectedFormatMode, err error) *ByteStringExpectedFormatError {
+ return &ByteStringExpectedFormatError{expectedFormatOption, err}
+}
+
+func (e *ByteStringExpectedFormatError) Error() string {
+ switch e.expectedFormatOption {
+ case ByteStringExpectedBase64URL:
+ return fmt.Sprintf("cbor: failed to decode base64url from byte string: %s", e.err)
+
+ case ByteStringExpectedBase64:
+ return fmt.Sprintf("cbor: failed to decode base64 from byte string: %s", e.err)
+
+ case ByteStringExpectedBase16:
+ return fmt.Sprintf("cbor: failed to decode hex from byte string: %s", e.err)
+
+ default:
+ return fmt.Sprintf("cbor: failed to decode byte string in expected format %d: %s", e.expectedFormatOption, e.err)
+ }
+}
+
+func (e *ByteStringExpectedFormatError) Unwrap() error {
+ return e.err
+}
+
+// InadmissibleTagContentTypeError is returned when unmarshaling built-in CBOR tags
+// fails because of inadmissible type for tag content. Currently, the built-in
+// CBOR tags in this codec are tags 0-3 and 21-23.
+// See "Tag validity" in RFC 8949 Section 5.3.2.
+type InadmissibleTagContentTypeError struct {
+ s string
+ tagNum int
+ expectedTagContentType string
+ gotTagContentType string
+}
+
+func newInadmissibleTagContentTypeError(
+ tagNum int,
+ expectedTagContentType string,
+ gotTagContentType string,
+) *InadmissibleTagContentTypeError {
+ return &InadmissibleTagContentTypeError{
+ tagNum: tagNum,
+ expectedTagContentType: expectedTagContentType,
+ gotTagContentType: gotTagContentType,
+ }
+}
+
+func newInadmissibleTagContentTypeErrorf(s string) *InadmissibleTagContentTypeError {
+ return &InadmissibleTagContentTypeError{s: "cbor: " + s} //nolint:goconst // ignore "cbor"
+}
+
+func (e *InadmissibleTagContentTypeError) Error() string {
+ if e.s == "" {
+ return fmt.Sprintf(
+ "cbor: tag number %d must be followed by %s, got %s",
+ e.tagNum,
+ e.expectedTagContentType,
+ e.gotTagContentType,
+ )
+ }
+ return e.s
+}
+
+// DupMapKeyMode specifies how to enforce duplicate map key. Two map keys are considered duplicates if:
+// 1. When decoding into a struct, both keys match the same struct field. The keys are also
+// considered duplicates if neither matches any field and decoding to interface{} would produce
+// equal (==) values for both keys.
+// 2. When decoding into a map, both keys are equal (==) when decoded into values of the
+// destination map's key type.
+type DupMapKeyMode int
+
+const (
+ // DupMapKeyQuiet doesn't enforce duplicate map key. Decoder quietly (no error)
+ // uses faster of "keep first" or "keep last" depending on Go data type and other factors.
+ DupMapKeyQuiet DupMapKeyMode = iota
+
+ // DupMapKeyEnforcedAPF enforces detection and rejection of duplicate map keys.
+ // APF means "Allow Partial Fill" and the destination map or struct can be partially filled.
+ // If a duplicate map key is detected, DupMapKeyError is returned without further decoding
+ // of the map. It's the caller's responsibility to respond to DupMapKeyError by
+ // discarding the partially filled result if their protocol requires it.
+ // WARNING: using DupMapKeyEnforcedAPF will decrease performance and increase memory use.
+ DupMapKeyEnforcedAPF
+
+ maxDupMapKeyMode
+)
+
+func (dmkm DupMapKeyMode) valid() bool {
+ return dmkm >= 0 && dmkm < maxDupMapKeyMode
+}
+
+// IndefLengthMode specifies whether to allow indefinite length items.
+type IndefLengthMode int
+
+const (
+ // IndefLengthAllowed allows indefinite length items.
+ IndefLengthAllowed IndefLengthMode = iota
+
+ // IndefLengthForbidden disallows indefinite length items.
+ IndefLengthForbidden
+
+ maxIndefLengthMode
+)
+
+func (m IndefLengthMode) valid() bool {
+ return m >= 0 && m < maxIndefLengthMode
+}
+
+// TagsMode specifies whether to allow CBOR tags.
+type TagsMode int
+
+const (
+ // TagsAllowed allows CBOR tags.
+ TagsAllowed TagsMode = iota
+
+ // TagsForbidden disallows CBOR tags.
+ TagsForbidden
+
+ maxTagsMode
+)
+
+func (tm TagsMode) valid() bool {
+ return tm >= 0 && tm < maxTagsMode
+}
+
+// IntDecMode specifies which Go type (int64, uint64, or big.Int) should
+// be used when decoding CBOR integers (major type 0 and 1) to Go interface{}.
+type IntDecMode int
+
+const (
+ // IntDecConvertNone affects how CBOR integers (major type 0 and 1) decode to Go interface{}.
+ // It decodes CBOR unsigned integer (major type 0) to:
+ // - uint64
+ // It decodes CBOR negative integer (major type 1) to:
+ // - int64 if value fits
+ // - big.Int or *big.Int (see BigIntDecMode) if value doesn't fit into int64
+ IntDecConvertNone IntDecMode = iota
+
+ // IntDecConvertSigned affects how CBOR integers (major type 0 and 1) decode to Go interface{}.
+ // It decodes CBOR integers (major type 0 and 1) to:
+ // - int64 if value fits
+ // - big.Int or *big.Int (see BigIntDecMode) if value < math.MinInt64
+ // - return UnmarshalTypeError if value > math.MaxInt64
+ // Deprecated: IntDecConvertSigned should not be used.
+ // Please use other options, such as IntDecConvertSignedOrError, IntDecConvertSignedOrBigInt, IntDecConvertNone.
+ IntDecConvertSigned
+
+ // IntDecConvertSignedOrFail affects how CBOR integers (major type 0 and 1) decode to Go interface{}.
+ // It decodes CBOR integers (major type 0 and 1) to:
+ // - int64 if value fits
+ // - return UnmarshalTypeError if value doesn't fit into int64
+ IntDecConvertSignedOrFail
+
+ // IntDecConvertSigned affects how CBOR integers (major type 0 and 1) decode to Go interface{}.
+ // It makes CBOR integers (major type 0 and 1) decode to:
+ // - int64 if value fits
+ // - big.Int or *big.Int (see BigIntDecMode) if value doesn't fit into int64
+ IntDecConvertSignedOrBigInt
+
+ maxIntDec
+)
+
+func (idm IntDecMode) valid() bool {
+ return idm >= 0 && idm < maxIntDec
+}
+
+// MapKeyByteStringMode specifies how to decode CBOR byte string (major type 2)
+// as Go map key when decoding CBOR map key into an empty Go interface value.
+// Specifically, this option applies when decoding CBOR map into
+// - Go empty interface, or
+// - Go map with empty interface as key type.
+// The CBOR map key types handled by this option are
+// - byte string
+// - tagged byte string
+// - nested tagged byte string
+type MapKeyByteStringMode int
+
+const (
+ // MapKeyByteStringAllowed allows CBOR byte string to be decoded as Go map key.
+ // Since Go doesn't allow []byte as map key, CBOR byte string is decoded to
+ // ByteString which has underlying string type.
+ // This is the default setting.
+ MapKeyByteStringAllowed MapKeyByteStringMode = iota
+
+ // MapKeyByteStringForbidden forbids CBOR byte string being decoded as Go map key.
+ // Attempting to decode CBOR byte string as map key into empty interface value
+ // returns a decoding error.
+ MapKeyByteStringForbidden
+
+ maxMapKeyByteStringMode
+)
+
+func (mkbsm MapKeyByteStringMode) valid() bool {
+ return mkbsm >= 0 && mkbsm < maxMapKeyByteStringMode
+}
+
+// ExtraDecErrorCond specifies extra conditions that should be treated as errors.
+type ExtraDecErrorCond uint
+
+// ExtraDecErrorNone indicates no extra error condition.
+const ExtraDecErrorNone ExtraDecErrorCond = 0
+
+const (
+ // ExtraDecErrorUnknownField indicates error condition when destination
+ // Go struct doesn't have a field matching a CBOR map key.
+ ExtraDecErrorUnknownField ExtraDecErrorCond = 1 << iota
+
+ maxExtraDecError
+)
+
+func (ec ExtraDecErrorCond) valid() bool {
+ return ec < maxExtraDecError
+}
+
+// UTF8Mode option specifies if decoder should
+// decode CBOR Text containing invalid UTF-8 string.
+type UTF8Mode int
+
+const (
+ // UTF8RejectInvalid rejects CBOR Text containing
+ // invalid UTF-8 string.
+ UTF8RejectInvalid UTF8Mode = iota
+
+ // UTF8DecodeInvalid allows decoding CBOR Text containing
+ // invalid UTF-8 string.
+ UTF8DecodeInvalid
+
+ maxUTF8Mode
+)
+
+func (um UTF8Mode) valid() bool {
+ return um >= 0 && um < maxUTF8Mode
+}
+
+// FieldNameMatchingMode specifies how string keys in CBOR maps are matched to Go struct field names.
+type FieldNameMatchingMode int
+
+const (
+ // FieldNameMatchingPreferCaseSensitive prefers to decode map items into struct fields whose names (or tag
+ // names) exactly match the item's key. If there is no such field, a map item will be decoded into a field whose
+ // name is a case-insensitive match for the item's key.
+ FieldNameMatchingPreferCaseSensitive FieldNameMatchingMode = iota
+
+ // FieldNameMatchingCaseSensitive decodes map items only into a struct field whose name (or tag name) is an
+ // exact match for the item's key.
+ FieldNameMatchingCaseSensitive
+
+ maxFieldNameMatchingMode
+)
+
+func (fnmm FieldNameMatchingMode) valid() bool {
+ return fnmm >= 0 && fnmm < maxFieldNameMatchingMode
+}
+
+// BigIntDecMode specifies how to decode CBOR bignum to Go interface{}.
+type BigIntDecMode int
+
+const (
+ // BigIntDecodeValue makes CBOR bignum decode to big.Int (instead of *big.Int)
+ // when unmarshalling into a Go interface{}.
+ BigIntDecodeValue BigIntDecMode = iota
+
+ // BigIntDecodePointer makes CBOR bignum decode to *big.Int when
+ // unmarshalling into a Go interface{}.
+ BigIntDecodePointer
+
+ maxBigIntDecMode
+)
+
+func (bidm BigIntDecMode) valid() bool {
+ return bidm >= 0 && bidm < maxBigIntDecMode
+}
+
+// ByteStringToStringMode specifies the behavior when decoding a CBOR byte string into a Go string.
+type ByteStringToStringMode int
+
+const (
+ // ByteStringToStringForbidden generates an error on an attempt to decode a CBOR byte string into a Go string.
+ ByteStringToStringForbidden ByteStringToStringMode = iota
+
+ // ByteStringToStringAllowed permits decoding a CBOR byte string into a Go string.
+ ByteStringToStringAllowed
+
+ // ByteStringToStringAllowedWithExpectedLaterEncoding permits decoding a CBOR byte string
+ // into a Go string. Also, if the byte string is enclosed (directly or indirectly) by one of
+ // the "expected later encoding" tags (numbers 21 through 23), the destination string will
+ // be populated by applying the designated text encoding to the contents of the input byte
+ // string.
+ ByteStringToStringAllowedWithExpectedLaterEncoding
+
+ maxByteStringToStringMode
+)
+
+func (bstsm ByteStringToStringMode) valid() bool {
+ return bstsm >= 0 && bstsm < maxByteStringToStringMode
+}
+
+// FieldNameByteStringMode specifies the behavior when decoding a CBOR byte string map key as a Go struct field name.
+type FieldNameByteStringMode int
+
+const (
+ // FieldNameByteStringForbidden generates an error on an attempt to decode a CBOR byte string map key as a Go struct field name.
+ FieldNameByteStringForbidden FieldNameByteStringMode = iota
+
+ // FieldNameByteStringAllowed permits CBOR byte string map keys to be recognized as Go struct field names.
+ FieldNameByteStringAllowed
+
+ maxFieldNameByteStringMode
+)
+
+func (fnbsm FieldNameByteStringMode) valid() bool {
+ return fnbsm >= 0 && fnbsm < maxFieldNameByteStringMode
+}
+
+// UnrecognizedTagToAnyMode specifies how to decode unrecognized CBOR tag into an empty interface (any).
+// Currently, recognized CBOR tag numbers are 0, 1, 2, 3, or registered by TagSet.
+type UnrecognizedTagToAnyMode int
+
+const (
+ // UnrecognizedTagNumAndContentToAny decodes CBOR tag number and tag content to cbor.Tag
+ // when decoding unrecognized CBOR tag into an empty interface.
+ UnrecognizedTagNumAndContentToAny UnrecognizedTagToAnyMode = iota
+
+ // UnrecognizedTagContentToAny decodes only CBOR tag content (into its default type)
+ // when decoding unrecognized CBOR tag into an empty interface.
+ UnrecognizedTagContentToAny
+
+ maxUnrecognizedTagToAny
+)
+
+func (uttam UnrecognizedTagToAnyMode) valid() bool {
+ return uttam >= 0 && uttam < maxUnrecognizedTagToAny
+}
+
+// TimeTagToAnyMode specifies how to decode CBOR tag 0 and 1 into an empty interface (any).
+// Based on the specified mode, Unmarshal can return a time.Time value or a time string in a specific format.
+type TimeTagToAnyMode int
+
+const (
+ // TimeTagToTime decodes CBOR tag 0 and 1 into a time.Time value
+ // when decoding tag 0 or 1 into an empty interface.
+ TimeTagToTime TimeTagToAnyMode = iota
+
+ // TimeTagToRFC3339 decodes CBOR tag 0 and 1 into a time string in RFC3339 format
+ // when decoding tag 0 or 1 into an empty interface.
+ TimeTagToRFC3339
+
+ // TimeTagToRFC3339Nano decodes CBOR tag 0 and 1 into a time string in RFC3339Nano format
+ // when decoding tag 0 or 1 into an empty interface.
+ TimeTagToRFC3339Nano
+
+ maxTimeTagToAnyMode
+)
+
+func (tttam TimeTagToAnyMode) valid() bool {
+ return tttam >= 0 && tttam < maxTimeTagToAnyMode
+}
+
+// SimpleValueRegistry is a registry of unmarshaling behaviors for each possible CBOR simple value
+// number (0...23 and 32...255).
+type SimpleValueRegistry struct {
+ rejected [256]bool
+}
+
+// WithRejectedSimpleValue registers the given simple value as rejected. If the simple value is
+// encountered in a CBOR input during unmarshaling, an UnacceptableDataItemError is returned.
+func WithRejectedSimpleValue(sv SimpleValue) func(*SimpleValueRegistry) error {
+ return func(r *SimpleValueRegistry) error {
+ if sv >= 24 && sv <= 31 {
+ return fmt.Errorf("cbor: cannot set analog for reserved simple value %d", sv)
+ }
+ r.rejected[sv] = true
+ return nil
+ }
+}
+
+// Creates a new SimpleValueRegistry. The registry state is initialized by executing the provided
+// functions in order against a registry that is pre-populated with the defaults for all well-formed
+// simple value numbers.
+func NewSimpleValueRegistryFromDefaults(fns ...func(*SimpleValueRegistry) error) (*SimpleValueRegistry, error) {
+ var r SimpleValueRegistry
+ for _, fn := range fns {
+ if err := fn(&r); err != nil {
+ return nil, err
+ }
+ }
+ return &r, nil
+}
+
+// NaNMode specifies how to decode floating-point values (major type 7, additional information 25
+// through 27) representing NaN (not-a-number).
+type NaNMode int
+
+const (
+ // NaNDecodeAllowed will decode NaN values to Go float32 or float64.
+ NaNDecodeAllowed NaNMode = iota
+
+ // NaNDecodeForbidden will return an UnacceptableDataItemError on an attempt to decode a NaN value.
+ NaNDecodeForbidden
+
+ maxNaNDecode
+)
+
+func (ndm NaNMode) valid() bool {
+ return ndm >= 0 && ndm < maxNaNDecode
+}
+
+// InfMode specifies how to decode floating-point values (major type 7, additional information 25
+// through 27) representing positive or negative infinity.
+type InfMode int
+
+const (
+ // InfDecodeAllowed will decode infinite values to Go float32 or float64.
+ InfDecodeAllowed InfMode = iota
+
+ // InfDecodeForbidden will return an UnacceptableDataItemError on an attempt to decode an
+ // infinite value.
+ InfDecodeForbidden
+
+ maxInfDecode
+)
+
+func (idm InfMode) valid() bool {
+ return idm >= 0 && idm < maxInfDecode
+}
+
+// ByteStringToTimeMode specifies the behavior when decoding a CBOR byte string into a Go time.Time.
+type ByteStringToTimeMode int
+
+const (
+ // ByteStringToTimeForbidden generates an error on an attempt to decode a CBOR byte string into a Go time.Time.
+ ByteStringToTimeForbidden ByteStringToTimeMode = iota
+
+ // ByteStringToTimeAllowed permits decoding a CBOR byte string into a Go time.Time.
+ ByteStringToTimeAllowed
+
+ maxByteStringToTimeMode
+)
+
+func (bttm ByteStringToTimeMode) valid() bool {
+ return bttm >= 0 && bttm < maxByteStringToTimeMode
+}
+
+// ByteStringExpectedFormatMode specifies how to decode CBOR byte string into Go byte slice
+// when the byte string is NOT enclosed in CBOR tag 21, 22, or 23. An error is returned if
+// the CBOR byte string does not contain the expected format (e.g. base64) specified.
+// For tags 21-23, see "Expected Later Encoding for CBOR-to-JSON Converters"
+// in RFC 8949 Section 3.4.5.2.
+type ByteStringExpectedFormatMode int
+
+const (
+ // ByteStringExpectedFormatNone copies the unmodified CBOR byte string into Go byte slice
+ // if the byte string is not tagged by CBOR tag 21-23.
+ ByteStringExpectedFormatNone ByteStringExpectedFormatMode = iota
+
+ // ByteStringExpectedBase64URL expects CBOR byte strings to contain base64url-encoded bytes
+ // if the byte string is not tagged by CBOR tag 21-23. The decoder will attempt to decode
+ // the base64url-encoded bytes into Go slice.
+ ByteStringExpectedBase64URL
+
+ // ByteStringExpectedBase64 expects CBOR byte strings to contain base64-encoded bytes
+ // if the byte string is not tagged by CBOR tag 21-23. The decoder will attempt to decode
+ // the base64-encoded bytes into Go slice.
+ ByteStringExpectedBase64
+
+ // ByteStringExpectedBase16 expects CBOR byte strings to contain base16-encoded bytes
+ // if the byte string is not tagged by CBOR tag 21-23. The decoder will attempt to decode
+ // the base16-encoded bytes into Go slice.
+ ByteStringExpectedBase16
+
+ maxByteStringExpectedFormatMode
+)
+
+func (bsefm ByteStringExpectedFormatMode) valid() bool {
+ return bsefm >= 0 && bsefm < maxByteStringExpectedFormatMode
+}
+
+// BignumTagMode specifies whether or not the "bignum" tags 2 and 3 (RFC 8949 Section 3.4.3) can be
+// decoded.
+type BignumTagMode int
+
+const (
+ // BignumTagAllowed allows bignum tags to be decoded.
+ BignumTagAllowed BignumTagMode = iota
+
+ // BignumTagForbidden produces an UnacceptableDataItemError during Unmarshal if a bignum tag
+ // is encountered in the input.
+ BignumTagForbidden
+
+ maxBignumTag
+)
+
+func (btm BignumTagMode) valid() bool {
+ return btm >= 0 && btm < maxBignumTag
+}
+
+// BinaryUnmarshalerMode specifies how to decode into types that implement
+// encoding.BinaryUnmarshaler.
+type BinaryUnmarshalerMode int
+
+const (
+ // BinaryUnmarshalerByteString will invoke UnmarshalBinary on the contents of a CBOR byte
+ // string when decoding into a value that implements BinaryUnmarshaler.
+ BinaryUnmarshalerByteString BinaryUnmarshalerMode = iota
+
+ // BinaryUnmarshalerNone does not recognize BinaryUnmarshaler implementations during decode.
+ BinaryUnmarshalerNone
+
+ maxBinaryUnmarshalerMode
+)
+
+func (bum BinaryUnmarshalerMode) valid() bool {
+ return bum >= 0 && bum < maxBinaryUnmarshalerMode
+}
+
+// DecOptions specifies decoding options.
+type DecOptions struct {
+ // DupMapKey specifies whether to enforce duplicate map key.
+ DupMapKey DupMapKeyMode
+
+ // TimeTag specifies whether or not untagged data items, or tags other
+ // than tag 0 and tag 1, can be decoded to time.Time. If tag 0 or tag 1
+ // appears in an input, the type of its content is always validated as
+ // specified in RFC 8949. That behavior is not controlled by this
+ // option. The behavior of the supported modes are:
+ //
+ // DecTagIgnored (default): Untagged text strings and text strings
+ // enclosed in tags other than 0 and 1 are decoded as though enclosed
+ // in tag 0. Untagged unsigned integers, negative integers, and
+ // floating-point numbers (or those enclosed in tags other than 0 and
+ // 1) are decoded as though enclosed in tag 1. Decoding a tag other
+ // than 0 or 1 enclosing simple values null or undefined into a
+ // time.Time does not modify the destination value.
+ //
+ // DecTagOptional: Untagged text strings are decoded as though
+ // enclosed in tag 0. Untagged unsigned integers, negative integers,
+ // and floating-point numbers are decoded as though enclosed in tag
+ // 1. Tags other than 0 and 1 will produce an error on attempts to
+ // decode them into a time.Time.
+ //
+ // DecTagRequired: Only tags 0 and 1 can be decoded to time.Time. Any
+ // other input will produce an error.
+ TimeTag DecTagMode
+
+ // MaxNestedLevels specifies the max nested levels allowed for any combination of CBOR array, maps, and tags.
+ // Default is 32 levels and it can be set to [4, 65535]. Note that higher maximum levels of nesting can
+ // require larger amounts of stack to deserialize. Don't increase this higher than you require.
+ MaxNestedLevels int
+
+ // MaxArrayElements specifies the max number of elements for CBOR arrays.
+ // Default is 128*1024=131072 and it can be set to [16, 2147483647]
+ MaxArrayElements int
+
+ // MaxMapPairs specifies the max number of key-value pairs for CBOR maps.
+ // Default is 128*1024=131072 and it can be set to [16, 2147483647]
+ MaxMapPairs int
+
+ // IndefLength specifies whether to allow indefinite length CBOR items.
+ IndefLength IndefLengthMode
+
+ // TagsMd specifies whether to allow CBOR tags (major type 6).
+ TagsMd TagsMode
+
+ // IntDec specifies which Go integer type (int64 or uint64) to use
+ // when decoding CBOR int (major type 0 and 1) to Go interface{}.
+ IntDec IntDecMode
+
+ // MapKeyByteString specifies how to decode CBOR byte string as map key
+ // when decoding CBOR map with byte string key into an empty interface value.
+ // By default, an error is returned when attempting to decode CBOR byte string
+ // as map key because Go doesn't allow []byte as map key.
+ MapKeyByteString MapKeyByteStringMode
+
+ // ExtraReturnErrors specifies extra conditions that should be treated as errors.
+ ExtraReturnErrors ExtraDecErrorCond
+
+ // DefaultMapType specifies Go map type to create and decode to
+ // when unmarshalling CBOR into an empty interface value.
+ // By default, unmarshal uses map[interface{}]interface{}.
+ DefaultMapType reflect.Type
+
+ // UTF8 specifies if decoder should decode CBOR Text containing invalid UTF-8.
+ // By default, unmarshal rejects CBOR text containing invalid UTF-8.
+ UTF8 UTF8Mode
+
+ // FieldNameMatching specifies how string keys in CBOR maps are matched to Go struct field names.
+ FieldNameMatching FieldNameMatchingMode
+
+ // BigIntDec specifies how to decode CBOR bignum to Go interface{}.
+ BigIntDec BigIntDecMode
+
+ // DefaultByteStringType is the Go type that should be produced when decoding a CBOR byte
+ // string into an empty interface value. Types to which a []byte is convertible are valid
+ // for this option, except for array and pointer-to-array types. If nil, the default is
+ // []byte.
+ DefaultByteStringType reflect.Type
+
+ // ByteStringToString specifies the behavior when decoding a CBOR byte string into a Go string.
+ ByteStringToString ByteStringToStringMode
+
+ // FieldNameByteString specifies the behavior when decoding a CBOR byte string map key as a
+ // Go struct field name.
+ FieldNameByteString FieldNameByteStringMode
+
+ // UnrecognizedTagToAny specifies how to decode unrecognized CBOR tag into an empty interface.
+ // Currently, recognized CBOR tag numbers are 0, 1, 2, 3, or registered by TagSet.
+ UnrecognizedTagToAny UnrecognizedTagToAnyMode
+
+ // TimeTagToAny specifies how to decode CBOR tag 0 and 1 into an empty interface (any).
+ // Based on the specified mode, Unmarshal can return a time.Time value or a time string in a specific format.
+ TimeTagToAny TimeTagToAnyMode
+
+ // SimpleValues is an immutable mapping from each CBOR simple value to a corresponding
+ // unmarshal behavior. If nil, the simple values false, true, null, and undefined are mapped
+ // to the Go analog values false, true, nil, and nil, respectively, and all other simple
+ // values N (except the reserved simple values 24 through 31) are mapped to
+ // cbor.SimpleValue(N). In other words, all well-formed simple values can be decoded.
+ //
+ // Users may provide a custom SimpleValueRegistry constructed via
+ // NewSimpleValueRegistryFromDefaults.
+ SimpleValues *SimpleValueRegistry
+
+ // NaN specifies how to decode floating-point values (major type 7, additional information
+ // 25 through 27) representing NaN (not-a-number).
+ NaN NaNMode
+
+ // Inf specifies how to decode floating-point values (major type 7, additional information
+ // 25 through 27) representing positive or negative infinity.
+ Inf InfMode
+
+ // ByteStringToTime specifies how to decode CBOR byte string into Go time.Time.
+ ByteStringToTime ByteStringToTimeMode
+
+ // ByteStringExpectedFormat specifies how to decode CBOR byte string into Go byte slice
+ // when the byte string is NOT enclosed in CBOR tag 21, 22, or 23. An error is returned if
+ // the CBOR byte string does not contain the expected format (e.g. base64) specified.
+ // For tags 21-23, see "Expected Later Encoding for CBOR-to-JSON Converters"
+ // in RFC 8949 Section 3.4.5.2.
+ ByteStringExpectedFormat ByteStringExpectedFormatMode
+
+ // BignumTag specifies whether or not the "bignum" tags 2 and 3 (RFC 8949 Section 3.4.3) can
+ // be decoded. Unlike BigIntDec, this option applies to all bignum tags encountered in a
+ // CBOR input, independent of the type of the destination value of a particular Unmarshal
+ // operation.
+ BignumTag BignumTagMode
+
+ // BinaryUnmarshaler specifies how to decode into types that implement
+ // encoding.BinaryUnmarshaler.
+ BinaryUnmarshaler BinaryUnmarshalerMode
+}
+
+// DecMode returns DecMode with immutable options and no tags (safe for concurrency).
+func (opts DecOptions) DecMode() (DecMode, error) { //nolint:gocritic // ignore hugeParam
+ return opts.decMode()
+}
+
+// validForTags checks that the provided tag set is compatible with these options and returns a
+// non-nil error if and only if the provided tag set is incompatible.
+func (opts DecOptions) validForTags(tags TagSet) error { //nolint:gocritic // ignore hugeParam
+ if opts.TagsMd == TagsForbidden {
+ return errors.New("cbor: cannot create DecMode with TagSet when TagsMd is TagsForbidden")
+ }
+ if tags == nil {
+ return errors.New("cbor: cannot create DecMode with nil value as TagSet")
+ }
+ if opts.ByteStringToString == ByteStringToStringAllowedWithExpectedLaterEncoding ||
+ opts.ByteStringExpectedFormat != ByteStringExpectedFormatNone {
+ for _, tagNum := range []uint64{
+ tagNumExpectedLaterEncodingBase64URL,
+ tagNumExpectedLaterEncodingBase64,
+ tagNumExpectedLaterEncodingBase16,
+ } {
+ if rt := tags.getTypeFromTagNum([]uint64{tagNum}); rt != nil {
+ return fmt.Errorf("cbor: DecMode with non-default StringExpectedEncoding or ByteSliceExpectedEncoding treats tag %d as built-in and conflicts with the provided TagSet's registration of %v", tagNum, rt)
+ }
+ }
+
+ }
+ return nil
+}
+
+// DecModeWithTags returns DecMode with options and tags that are both immutable (safe for concurrency).
+func (opts DecOptions) DecModeWithTags(tags TagSet) (DecMode, error) { //nolint:gocritic // ignore hugeParam
+ if err := opts.validForTags(tags); err != nil {
+ return nil, err
+ }
+ dm, err := opts.decMode()
+ if err != nil {
+ return nil, err
+ }
+
+ // Copy tags
+ ts := tagSet(make(map[reflect.Type]*tagItem))
+ syncTags := tags.(*syncTagSet)
+ syncTags.RLock()
+ for contentType, tag := range syncTags.t {
+ if tag.opts.DecTag != DecTagIgnored {
+ ts[contentType] = tag
+ }
+ }
+ syncTags.RUnlock()
+
+ if len(ts) > 0 {
+ dm.tags = ts
+ }
+
+ return dm, nil
+}
+
+// DecModeWithSharedTags returns DecMode with immutable options and mutable shared tags (safe for concurrency).
+func (opts DecOptions) DecModeWithSharedTags(tags TagSet) (DecMode, error) { //nolint:gocritic // ignore hugeParam
+ if err := opts.validForTags(tags); err != nil {
+ return nil, err
+ }
+ dm, err := opts.decMode()
+ if err != nil {
+ return nil, err
+ }
+ dm.tags = tags
+ return dm, nil
+}
+
+const (
+ defaultMaxArrayElements = 131072
+ minMaxArrayElements = 16
+ maxMaxArrayElements = 2147483647
+
+ defaultMaxMapPairs = 131072
+ minMaxMapPairs = 16
+ maxMaxMapPairs = 2147483647
+
+ defaultMaxNestedLevels = 32
+ minMaxNestedLevels = 4
+ maxMaxNestedLevels = 65535
+)
+
+var defaultSimpleValues = func() *SimpleValueRegistry {
+ registry, err := NewSimpleValueRegistryFromDefaults()
+ if err != nil {
+ panic(err)
+ }
+ return registry
+}()
+
+//nolint:gocyclo // Each option comes with some manageable boilerplate
+func (opts DecOptions) decMode() (*decMode, error) { //nolint:gocritic // ignore hugeParam
+ if !opts.DupMapKey.valid() {
+ return nil, errors.New("cbor: invalid DupMapKey " + strconv.Itoa(int(opts.DupMapKey)))
+ }
+
+ if !opts.TimeTag.valid() {
+ return nil, errors.New("cbor: invalid TimeTag " + strconv.Itoa(int(opts.TimeTag)))
+ }
+
+ if !opts.IndefLength.valid() {
+ return nil, errors.New("cbor: invalid IndefLength " + strconv.Itoa(int(opts.IndefLength)))
+ }
+
+ if !opts.TagsMd.valid() {
+ return nil, errors.New("cbor: invalid TagsMd " + strconv.Itoa(int(opts.TagsMd)))
+ }
+
+ if !opts.IntDec.valid() {
+ return nil, errors.New("cbor: invalid IntDec " + strconv.Itoa(int(opts.IntDec)))
+ }
+
+ if !opts.MapKeyByteString.valid() {
+ return nil, errors.New("cbor: invalid MapKeyByteString " + strconv.Itoa(int(opts.MapKeyByteString)))
+ }
+
+ if opts.MaxNestedLevels == 0 {
+ opts.MaxNestedLevels = defaultMaxNestedLevels
+ } else if opts.MaxNestedLevels < minMaxNestedLevels || opts.MaxNestedLevels > maxMaxNestedLevels {
+ return nil, errors.New("cbor: invalid MaxNestedLevels " + strconv.Itoa(opts.MaxNestedLevels) +
+ " (range is [" + strconv.Itoa(minMaxNestedLevels) + ", " + strconv.Itoa(maxMaxNestedLevels) + "])")
+ }
+
+ if opts.MaxArrayElements == 0 {
+ opts.MaxArrayElements = defaultMaxArrayElements
+ } else if opts.MaxArrayElements < minMaxArrayElements || opts.MaxArrayElements > maxMaxArrayElements {
+ return nil, errors.New("cbor: invalid MaxArrayElements " + strconv.Itoa(opts.MaxArrayElements) +
+ " (range is [" + strconv.Itoa(minMaxArrayElements) + ", " + strconv.Itoa(maxMaxArrayElements) + "])")
+ }
+
+ if opts.MaxMapPairs == 0 {
+ opts.MaxMapPairs = defaultMaxMapPairs
+ } else if opts.MaxMapPairs < minMaxMapPairs || opts.MaxMapPairs > maxMaxMapPairs {
+ return nil, errors.New("cbor: invalid MaxMapPairs " + strconv.Itoa(opts.MaxMapPairs) +
+ " (range is [" + strconv.Itoa(minMaxMapPairs) + ", " + strconv.Itoa(maxMaxMapPairs) + "])")
+ }
+
+ if !opts.ExtraReturnErrors.valid() {
+ return nil, errors.New("cbor: invalid ExtraReturnErrors " + strconv.Itoa(int(opts.ExtraReturnErrors)))
+ }
+
+ if opts.DefaultMapType != nil && opts.DefaultMapType.Kind() != reflect.Map {
+ return nil, fmt.Errorf("cbor: invalid DefaultMapType %s", opts.DefaultMapType)
+ }
+
+ if !opts.UTF8.valid() {
+ return nil, errors.New("cbor: invalid UTF8 " + strconv.Itoa(int(opts.UTF8)))
+ }
+
+ if !opts.FieldNameMatching.valid() {
+ return nil, errors.New("cbor: invalid FieldNameMatching " + strconv.Itoa(int(opts.FieldNameMatching)))
+ }
+
+ if !opts.BigIntDec.valid() {
+ return nil, errors.New("cbor: invalid BigIntDec " + strconv.Itoa(int(opts.BigIntDec)))
+ }
+
+ if opts.DefaultByteStringType != nil &&
+ opts.DefaultByteStringType.Kind() != reflect.String &&
+ (opts.DefaultByteStringType.Kind() != reflect.Slice || opts.DefaultByteStringType.Elem().Kind() != reflect.Uint8) {
+ return nil, fmt.Errorf("cbor: invalid DefaultByteStringType: %s is not of kind string or []uint8", opts.DefaultByteStringType)
+ }
+
+ if !opts.ByteStringToString.valid() {
+ return nil, errors.New("cbor: invalid ByteStringToString " + strconv.Itoa(int(opts.ByteStringToString)))
+ }
+
+ if !opts.FieldNameByteString.valid() {
+ return nil, errors.New("cbor: invalid FieldNameByteString " + strconv.Itoa(int(opts.FieldNameByteString)))
+ }
+
+ if !opts.UnrecognizedTagToAny.valid() {
+ return nil, errors.New("cbor: invalid UnrecognizedTagToAnyMode " + strconv.Itoa(int(opts.UnrecognizedTagToAny)))
+ }
+ simpleValues := opts.SimpleValues
+ if simpleValues == nil {
+ simpleValues = defaultSimpleValues
+ }
+
+ if !opts.TimeTagToAny.valid() {
+ return nil, errors.New("cbor: invalid TimeTagToAny " + strconv.Itoa(int(opts.TimeTagToAny)))
+ }
+
+ if !opts.NaN.valid() {
+ return nil, errors.New("cbor: invalid NaNDec " + strconv.Itoa(int(opts.NaN)))
+ }
+
+ if !opts.Inf.valid() {
+ return nil, errors.New("cbor: invalid InfDec " + strconv.Itoa(int(opts.Inf)))
+ }
+
+ if !opts.ByteStringToTime.valid() {
+ return nil, errors.New("cbor: invalid ByteStringToTime " + strconv.Itoa(int(opts.ByteStringToTime)))
+ }
+
+ if !opts.ByteStringExpectedFormat.valid() {
+ return nil, errors.New("cbor: invalid ByteStringExpectedFormat " + strconv.Itoa(int(opts.ByteStringExpectedFormat)))
+ }
+
+ if !opts.BignumTag.valid() {
+ return nil, errors.New("cbor: invalid BignumTag " + strconv.Itoa(int(opts.BignumTag)))
+ }
+
+ if !opts.BinaryUnmarshaler.valid() {
+ return nil, errors.New("cbor: invalid BinaryUnmarshaler " + strconv.Itoa(int(opts.BinaryUnmarshaler)))
+ }
+
+ dm := decMode{
+ dupMapKey: opts.DupMapKey,
+ timeTag: opts.TimeTag,
+ maxNestedLevels: opts.MaxNestedLevels,
+ maxArrayElements: opts.MaxArrayElements,
+ maxMapPairs: opts.MaxMapPairs,
+ indefLength: opts.IndefLength,
+ tagsMd: opts.TagsMd,
+ intDec: opts.IntDec,
+ mapKeyByteString: opts.MapKeyByteString,
+ extraReturnErrors: opts.ExtraReturnErrors,
+ defaultMapType: opts.DefaultMapType,
+ utf8: opts.UTF8,
+ fieldNameMatching: opts.FieldNameMatching,
+ bigIntDec: opts.BigIntDec,
+ defaultByteStringType: opts.DefaultByteStringType,
+ byteStringToString: opts.ByteStringToString,
+ fieldNameByteString: opts.FieldNameByteString,
+ unrecognizedTagToAny: opts.UnrecognizedTagToAny,
+ timeTagToAny: opts.TimeTagToAny,
+ simpleValues: simpleValues,
+ nanDec: opts.NaN,
+ infDec: opts.Inf,
+ byteStringToTime: opts.ByteStringToTime,
+ byteStringExpectedFormat: opts.ByteStringExpectedFormat,
+ bignumTag: opts.BignumTag,
+ binaryUnmarshaler: opts.BinaryUnmarshaler,
+ }
+
+ return &dm, nil
+}
+
+// DecMode is the main interface for CBOR decoding.
+type DecMode interface {
+ // Unmarshal parses the CBOR-encoded data into the value pointed to by v
+ // using the decoding mode. If v is nil, not a pointer, or a nil pointer,
+ // Unmarshal returns an error.
+ //
+ // See the documentation for Unmarshal for details.
+ Unmarshal(data []byte, v interface{}) error
+
+ // UnmarshalFirst parses the first CBOR data item into the value pointed to by v
+ // using the decoding mode. Any remaining bytes are returned in rest.
+ //
+ // If v is nil, not a pointer, or a nil pointer, UnmarshalFirst returns an error.
+ //
+ // See the documentation for Unmarshal for details.
+ UnmarshalFirst(data []byte, v interface{}) (rest []byte, err error)
+
+ // Valid checks whether data is a well-formed encoded CBOR data item and
+ // that it complies with configurable restrictions such as MaxNestedLevels,
+ // MaxArrayElements, MaxMapPairs, etc.
+ //
+ // If there are any remaining bytes after the CBOR data item,
+ // an ExtraneousDataError is returned.
+ //
+ // WARNING: Valid doesn't check if encoded CBOR data item is valid (i.e. validity)
+ // and RFC 8949 distinctly defines what is "Valid" and what is "Well-formed".
+ //
+ // Deprecated: Valid is kept for compatibility and should not be used.
+ // Use Wellformed instead because it has a more appropriate name.
+ Valid(data []byte) error
+
+ // Wellformed checks whether data is a well-formed encoded CBOR data item and
+ // that it complies with configurable restrictions such as MaxNestedLevels,
+ // MaxArrayElements, MaxMapPairs, etc.
+ //
+ // If there are any remaining bytes after the CBOR data item,
+ // an ExtraneousDataError is returned.
+ Wellformed(data []byte) error
+
+ // NewDecoder returns a new decoder that reads from r using dm DecMode.
+ NewDecoder(r io.Reader) *Decoder
+
+ // DecOptions returns user specified options used to create this DecMode.
+ DecOptions() DecOptions
+}
+
+type decMode struct {
+ tags tagProvider
+ dupMapKey DupMapKeyMode
+ timeTag DecTagMode
+ maxNestedLevels int
+ maxArrayElements int
+ maxMapPairs int
+ indefLength IndefLengthMode
+ tagsMd TagsMode
+ intDec IntDecMode
+ mapKeyByteString MapKeyByteStringMode
+ extraReturnErrors ExtraDecErrorCond
+ defaultMapType reflect.Type
+ utf8 UTF8Mode
+ fieldNameMatching FieldNameMatchingMode
+ bigIntDec BigIntDecMode
+ defaultByteStringType reflect.Type
+ byteStringToString ByteStringToStringMode
+ fieldNameByteString FieldNameByteStringMode
+ unrecognizedTagToAny UnrecognizedTagToAnyMode
+ timeTagToAny TimeTagToAnyMode
+ simpleValues *SimpleValueRegistry
+ nanDec NaNMode
+ infDec InfMode
+ byteStringToTime ByteStringToTimeMode
+ byteStringExpectedFormat ByteStringExpectedFormatMode
+ bignumTag BignumTagMode
+ binaryUnmarshaler BinaryUnmarshalerMode
+}
+
+var defaultDecMode, _ = DecOptions{}.decMode()
+
+// DecOptions returns user specified options used to create this DecMode.
+func (dm *decMode) DecOptions() DecOptions {
+ simpleValues := dm.simpleValues
+ if simpleValues == defaultSimpleValues {
+ // Users can't explicitly set this to defaultSimpleValues. It must have been nil in
+ // the original DecOptions.
+ simpleValues = nil
+ }
+
+ return DecOptions{
+ DupMapKey: dm.dupMapKey,
+ TimeTag: dm.timeTag,
+ MaxNestedLevels: dm.maxNestedLevels,
+ MaxArrayElements: dm.maxArrayElements,
+ MaxMapPairs: dm.maxMapPairs,
+ IndefLength: dm.indefLength,
+ TagsMd: dm.tagsMd,
+ IntDec: dm.intDec,
+ MapKeyByteString: dm.mapKeyByteString,
+ ExtraReturnErrors: dm.extraReturnErrors,
+ DefaultMapType: dm.defaultMapType,
+ UTF8: dm.utf8,
+ FieldNameMatching: dm.fieldNameMatching,
+ BigIntDec: dm.bigIntDec,
+ DefaultByteStringType: dm.defaultByteStringType,
+ ByteStringToString: dm.byteStringToString,
+ FieldNameByteString: dm.fieldNameByteString,
+ UnrecognizedTagToAny: dm.unrecognizedTagToAny,
+ TimeTagToAny: dm.timeTagToAny,
+ SimpleValues: simpleValues,
+ NaN: dm.nanDec,
+ Inf: dm.infDec,
+ ByteStringToTime: dm.byteStringToTime,
+ ByteStringExpectedFormat: dm.byteStringExpectedFormat,
+ BignumTag: dm.bignumTag,
+ BinaryUnmarshaler: dm.binaryUnmarshaler,
+ }
+}
+
+// Unmarshal parses the CBOR-encoded data into the value pointed to by v
+// using dm decoding mode. If v is nil, not a pointer, or a nil pointer,
+// Unmarshal returns an error.
+//
+// See the documentation for Unmarshal for details.
+func (dm *decMode) Unmarshal(data []byte, v interface{}) error {
+ d := decoder{data: data, dm: dm}
+
+ // Check well-formedness.
+ off := d.off // Save offset before data validation
+ err := d.wellformed(false, false) // don't allow any extra data after valid data item.
+ d.off = off // Restore offset
+ if err != nil {
+ return err
+ }
+
+ return d.value(v)
+}
+
+// UnmarshalFirst parses the first CBOR data item into the value pointed to by v
+// using dm decoding mode. Any remaining bytes are returned in rest.
+//
+// If v is nil, not a pointer, or a nil pointer, UnmarshalFirst returns an error.
+//
+// See the documentation for Unmarshal for details.
+func (dm *decMode) UnmarshalFirst(data []byte, v interface{}) (rest []byte, err error) {
+ d := decoder{data: data, dm: dm}
+
+ // check well-formedness.
+ off := d.off // Save offset before data validation
+ err = d.wellformed(true, false) // allow extra data after well-formed data item
+ d.off = off // Restore offset
+
+ // If it is well-formed, parse the value. This is structured like this to allow
+ // better test coverage
+ if err == nil {
+ err = d.value(v)
+ }
+
+ // If either wellformed or value returned an error, do not return rest bytes
+ if err != nil {
+ return nil, err
+ }
+
+ // Return the rest of the data slice (which might be len 0)
+ return d.data[d.off:], nil
+}
+
+// Valid checks whether data is a well-formed encoded CBOR data item and
+// that it complies with configurable restrictions such as MaxNestedLevels,
+// MaxArrayElements, MaxMapPairs, etc.
+//
+// If there are any remaining bytes after the CBOR data item,
+// an ExtraneousDataError is returned.
+//
+// WARNING: Valid doesn't check if encoded CBOR data item is valid (i.e. validity)
+// and RFC 8949 distinctly defines what is "Valid" and what is "Well-formed".
+//
+// Deprecated: Valid is kept for compatibility and should not be used.
+// Use Wellformed instead because it has a more appropriate name.
+func (dm *decMode) Valid(data []byte) error {
+ return dm.Wellformed(data)
+}
+
+// Wellformed checks whether data is a well-formed encoded CBOR data item and
+// that it complies with configurable restrictions such as MaxNestedLevels,
+// MaxArrayElements, MaxMapPairs, etc.
+//
+// If there are any remaining bytes after the CBOR data item,
+// an ExtraneousDataError is returned.
+func (dm *decMode) Wellformed(data []byte) error {
+ d := decoder{data: data, dm: dm}
+ return d.wellformed(false, false)
+}
+
+// NewDecoder returns a new decoder that reads from r using dm DecMode.
+func (dm *decMode) NewDecoder(r io.Reader) *Decoder {
+ return &Decoder{r: r, d: decoder{dm: dm}}
+}
+
+type decoder struct {
+ data []byte
+ off int // next read offset in data
+ dm *decMode
+
+ // expectedLaterEncodingTags stores a stack of encountered "Expected Later Encoding" tags,
+ // if any.
+ //
+ // The "Expected Later Encoding" tags (21 to 23) are valid for any data item. When decoding
+ // byte strings, the effective encoding comes from the tag nearest to the byte string being
+ // decoded. For example, the effective encoding of the byte string 21(22(h'41')) would be
+ // controlled by tag 22,and in the data item 23(h'42', 22([21(h'43')])]) the effective
+ // encoding of the byte strings h'42' and h'43' would be controlled by tag 23 and 21,
+ // respectively.
+ expectedLaterEncodingTags []uint64
+}
+
+// value decodes CBOR data item into the value pointed to by v.
+// If CBOR data item fails to be decoded into v,
+// error is returned and offset is moved to the next CBOR data item.
+// Precondition: d.data contains at least one well-formed CBOR data item.
+func (d *decoder) value(v interface{}) error {
+ // v can't be nil, non-pointer, or nil pointer value.
+ if v == nil {
+ return &InvalidUnmarshalError{"cbor: Unmarshal(nil)"}
+ }
+ rv := reflect.ValueOf(v)
+ if rv.Kind() != reflect.Ptr {
+ return &InvalidUnmarshalError{"cbor: Unmarshal(non-pointer " + rv.Type().String() + ")"}
+ } else if rv.IsNil() {
+ return &InvalidUnmarshalError{"cbor: Unmarshal(nil " + rv.Type().String() + ")"}
+ }
+ rv = rv.Elem()
+ return d.parseToValue(rv, getTypeInfo(rv.Type()))
+}
+
+// parseToValue decodes CBOR data to value. It assumes data is well-formed,
+// and does not perform bounds checking.
+func (d *decoder) parseToValue(v reflect.Value, tInfo *typeInfo) error { //nolint:gocyclo
+
+ // Decode CBOR nil or CBOR undefined to pointer value by setting pointer value to nil.
+ if d.nextCBORNil() && v.Kind() == reflect.Ptr {
+ d.skip()
+ v.Set(reflect.Zero(v.Type()))
+ return nil
+ }
+
+ if tInfo.spclType == specialTypeIface {
+ if !v.IsNil() {
+ // Use value type
+ v = v.Elem()
+ tInfo = getTypeInfo(v.Type())
+ } else { //nolint:gocritic
+ // Create and use registered type if CBOR data is registered tag
+ if d.dm.tags != nil && d.nextCBORType() == cborTypeTag {
+
+ off := d.off
+ var tagNums []uint64
+ for d.nextCBORType() == cborTypeTag {
+ _, _, tagNum := d.getHead()
+ tagNums = append(tagNums, tagNum)
+ }
+ d.off = off
+
+ registeredType := d.dm.tags.getTypeFromTagNum(tagNums)
+ if registeredType != nil {
+ if registeredType.Implements(tInfo.nonPtrType) ||
+ reflect.PtrTo(registeredType).Implements(tInfo.nonPtrType) {
+ v.Set(reflect.New(registeredType))
+ v = v.Elem()
+ tInfo = getTypeInfo(registeredType)
+ }
+ }
+ }
+ }
+ }
+
+ // Create new value for the pointer v to point to.
+ // At this point, CBOR value is not nil/undefined if v is a pointer.
+ for v.Kind() == reflect.Ptr {
+ if v.IsNil() {
+ if !v.CanSet() {
+ d.skip()
+ return errors.New("cbor: cannot set new value for " + v.Type().String())
+ }
+ v.Set(reflect.New(v.Type().Elem()))
+ }
+ v = v.Elem()
+ }
+
+ // Strip self-described CBOR tag number.
+ for d.nextCBORType() == cborTypeTag {
+ off := d.off
+ _, _, tagNum := d.getHead()
+ if tagNum != tagNumSelfDescribedCBOR {
+ d.off = off
+ break
+ }
+ }
+
+ // Check validity of supported built-in tags.
+ off := d.off
+ for d.nextCBORType() == cborTypeTag {
+ _, _, tagNum := d.getHead()
+ if err := validBuiltinTag(tagNum, d.data[d.off]); err != nil {
+ d.skip()
+ return err
+ }
+ }
+ d.off = off
+
+ if tInfo.spclType != specialTypeNone {
+ switch tInfo.spclType {
+ case specialTypeEmptyIface:
+ iv, err := d.parse(false) // Skipped self-described CBOR tag number already.
+ if iv != nil {
+ v.Set(reflect.ValueOf(iv))
+ }
+ return err
+
+ case specialTypeTag:
+ return d.parseToTag(v)
+
+ case specialTypeTime:
+ if d.nextCBORNil() {
+ // Decoding CBOR null and undefined to time.Time is no-op.
+ d.skip()
+ return nil
+ }
+ tm, ok, err := d.parseToTime()
+ if err != nil {
+ return err
+ }
+ if ok {
+ v.Set(reflect.ValueOf(tm))
+ }
+ return nil
+
+ case specialTypeUnmarshalerIface:
+ return d.parseToUnmarshaler(v)
+ }
+ }
+
+ // Check registered tag number
+ if tagItem := d.getRegisteredTagItem(tInfo.nonPtrType); tagItem != nil {
+ t := d.nextCBORType()
+ if t != cborTypeTag {
+ if tagItem.opts.DecTag == DecTagRequired {
+ d.skip() // Required tag number is absent, skip entire tag
+ return &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: tInfo.typ.String(),
+ errorMsg: "expect CBOR tag value"}
+ }
+ } else if err := d.validRegisteredTagNums(tagItem); err != nil {
+ d.skip() // Skip tag content
+ return err
+ }
+ }
+
+ t := d.nextCBORType()
+
+ switch t {
+ case cborTypePositiveInt:
+ _, _, val := d.getHead()
+ return fillPositiveInt(t, val, v)
+
+ case cborTypeNegativeInt:
+ _, _, val := d.getHead()
+ if val > math.MaxInt64 {
+ // CBOR negative integer overflows int64, use big.Int to store value.
+ bi := new(big.Int)
+ bi.SetUint64(val)
+ bi.Add(bi, big.NewInt(1))
+ bi.Neg(bi)
+
+ if tInfo.nonPtrType == typeBigInt {
+ v.Set(reflect.ValueOf(*bi))
+ return nil
+ }
+ return &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: tInfo.nonPtrType.String(),
+ errorMsg: bi.String() + " overflows Go's int64",
+ }
+ }
+ nValue := int64(-1) ^ int64(val)
+ return fillNegativeInt(t, nValue, v)
+
+ case cborTypeByteString:
+ b, copied := d.parseByteString()
+ b, converted, err := d.applyByteStringTextConversion(b, v.Type())
+ if err != nil {
+ return err
+ }
+ copied = copied || converted
+ return fillByteString(t, b, !copied, v, d.dm.byteStringToString, d.dm.binaryUnmarshaler)
+
+ case cborTypeTextString:
+ b, err := d.parseTextString()
+ if err != nil {
+ return err
+ }
+ return fillTextString(t, b, v)
+
+ case cborTypePrimitives:
+ _, ai, val := d.getHead()
+ switch ai {
+ case additionalInformationAsFloat16:
+ f := float64(float16.Frombits(uint16(val)).Float32())
+ return fillFloat(t, f, v)
+
+ case additionalInformationAsFloat32:
+ f := float64(math.Float32frombits(uint32(val)))
+ return fillFloat(t, f, v)
+
+ case additionalInformationAsFloat64:
+ f := math.Float64frombits(val)
+ return fillFloat(t, f, v)
+
+ default: // ai <= 24
+ if d.dm.simpleValues.rejected[SimpleValue(val)] {
+ return &UnacceptableDataItemError{
+ CBORType: t.String(),
+ Message: "simple value " + strconv.FormatInt(int64(val), 10) + " is not recognized",
+ }
+ }
+
+ switch ai {
+ case additionalInformationAsFalse,
+ additionalInformationAsTrue:
+ return fillBool(t, ai == additionalInformationAsTrue, v)
+
+ case additionalInformationAsNull,
+ additionalInformationAsUndefined:
+ return fillNil(t, v)
+
+ default:
+ return fillPositiveInt(t, val, v)
+ }
+ }
+
+ case cborTypeTag:
+ _, _, tagNum := d.getHead()
+ switch tagNum {
+ case tagNumUnsignedBignum:
+ // Bignum (tag 2) can be decoded to uint, int, float, slice, array, or big.Int.
+ b, copied := d.parseByteString()
+ bi := new(big.Int).SetBytes(b)
+
+ if tInfo.nonPtrType == typeBigInt {
+ v.Set(reflect.ValueOf(*bi))
+ return nil
+ }
+ if tInfo.nonPtrKind == reflect.Slice || tInfo.nonPtrKind == reflect.Array {
+ return fillByteString(t, b, !copied, v, ByteStringToStringForbidden, d.dm.binaryUnmarshaler)
+ }
+ if bi.IsUint64() {
+ return fillPositiveInt(t, bi.Uint64(), v)
+ }
+ return &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: tInfo.nonPtrType.String(),
+ errorMsg: bi.String() + " overflows " + v.Type().String(),
+ }
+
+ case tagNumNegativeBignum:
+ // Bignum (tag 3) can be decoded to int, float, slice, array, or big.Int.
+ b, copied := d.parseByteString()
+ bi := new(big.Int).SetBytes(b)
+ bi.Add(bi, big.NewInt(1))
+ bi.Neg(bi)
+
+ if tInfo.nonPtrType == typeBigInt {
+ v.Set(reflect.ValueOf(*bi))
+ return nil
+ }
+ if tInfo.nonPtrKind == reflect.Slice || tInfo.nonPtrKind == reflect.Array {
+ return fillByteString(t, b, !copied, v, ByteStringToStringForbidden, d.dm.binaryUnmarshaler)
+ }
+ if bi.IsInt64() {
+ return fillNegativeInt(t, bi.Int64(), v)
+ }
+ return &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: tInfo.nonPtrType.String(),
+ errorMsg: bi.String() + " overflows " + v.Type().String(),
+ }
+
+ case tagNumExpectedLaterEncodingBase64URL, tagNumExpectedLaterEncodingBase64, tagNumExpectedLaterEncodingBase16:
+ // If conversion for interoperability with text encodings is not configured,
+ // treat tags 21-23 as unregistered tags.
+ if d.dm.byteStringToString == ByteStringToStringAllowedWithExpectedLaterEncoding || d.dm.byteStringExpectedFormat != ByteStringExpectedFormatNone {
+ d.expectedLaterEncodingTags = append(d.expectedLaterEncodingTags, tagNum)
+ defer func() {
+ d.expectedLaterEncodingTags = d.expectedLaterEncodingTags[:len(d.expectedLaterEncodingTags)-1]
+ }()
+ }
+ }
+
+ return d.parseToValue(v, tInfo)
+
+ case cborTypeArray:
+ if tInfo.nonPtrKind == reflect.Slice {
+ return d.parseArrayToSlice(v, tInfo)
+ } else if tInfo.nonPtrKind == reflect.Array {
+ return d.parseArrayToArray(v, tInfo)
+ } else if tInfo.nonPtrKind == reflect.Struct {
+ return d.parseArrayToStruct(v, tInfo)
+ }
+ d.skip()
+ return &UnmarshalTypeError{CBORType: t.String(), GoType: tInfo.nonPtrType.String()}
+
+ case cborTypeMap:
+ if tInfo.nonPtrKind == reflect.Struct {
+ return d.parseMapToStruct(v, tInfo)
+ } else if tInfo.nonPtrKind == reflect.Map {
+ return d.parseMapToMap(v, tInfo)
+ }
+ d.skip()
+ return &UnmarshalTypeError{CBORType: t.String(), GoType: tInfo.nonPtrType.String()}
+ }
+
+ return nil
+}
+
+func (d *decoder) parseToTag(v reflect.Value) error {
+ if d.nextCBORNil() {
+ // Decoding CBOR null and undefined to cbor.Tag is no-op.
+ d.skip()
+ return nil
+ }
+
+ t := d.nextCBORType()
+ if t != cborTypeTag {
+ d.skip()
+ return &UnmarshalTypeError{CBORType: t.String(), GoType: typeTag.String()}
+ }
+
+ // Unmarshal tag number
+ _, _, num := d.getHead()
+
+ // Unmarshal tag content
+ content, err := d.parse(false)
+ if err != nil {
+ return err
+ }
+
+ v.Set(reflect.ValueOf(Tag{num, content}))
+ return nil
+}
+
+// parseToTime decodes the current data item as a time.Time. The bool return value is false if and
+// only if the destination value should remain unmodified.
+func (d *decoder) parseToTime() (time.Time, bool, error) {
+ // Verify that tag number or absence of tag number is acceptable to specified timeTag.
+ if t := d.nextCBORType(); t == cborTypeTag {
+ if d.dm.timeTag == DecTagIgnored {
+ // Skip all enclosing tags
+ for t == cborTypeTag {
+ d.getHead()
+ t = d.nextCBORType()
+ }
+ if d.nextCBORNil() {
+ d.skip()
+ return time.Time{}, false, nil
+ }
+ } else {
+ // Read tag number
+ _, _, tagNum := d.getHead()
+ if tagNum != 0 && tagNum != 1 {
+ d.skip() // skip tag content
+ return time.Time{}, false, errors.New("cbor: wrong tag number for time.Time, got " + strconv.Itoa(int(tagNum)) + ", expect 0 or 1")
+ }
+ }
+ } else {
+ if d.dm.timeTag == DecTagRequired {
+ d.skip()
+ return time.Time{}, false, &UnmarshalTypeError{CBORType: t.String(), GoType: typeTime.String(), errorMsg: "expect CBOR tag value"}
+ }
+ }
+
+ switch t := d.nextCBORType(); t {
+ case cborTypeByteString:
+ if d.dm.byteStringToTime == ByteStringToTimeAllowed {
+ b, _ := d.parseByteString()
+ t, err := time.Parse(time.RFC3339, string(b))
+ if err != nil {
+ return time.Time{}, false, fmt.Errorf("cbor: cannot set %q for time.Time: %w", string(b), err)
+ }
+ return t, true, nil
+ }
+ return time.Time{}, false, &UnmarshalTypeError{CBORType: t.String(), GoType: typeTime.String()}
+
+ case cborTypeTextString:
+ s, err := d.parseTextString()
+ if err != nil {
+ return time.Time{}, false, err
+ }
+ t, err := time.Parse(time.RFC3339, string(s))
+ if err != nil {
+ return time.Time{}, false, errors.New("cbor: cannot set " + string(s) + " for time.Time: " + err.Error())
+ }
+ return t, true, nil
+
+ case cborTypePositiveInt:
+ _, _, val := d.getHead()
+ if val > math.MaxInt64 {
+ return time.Time{}, false, &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: typeTime.String(),
+ errorMsg: fmt.Sprintf("%d overflows Go's int64", val),
+ }
+ }
+ return time.Unix(int64(val), 0), true, nil
+
+ case cborTypeNegativeInt:
+ _, _, val := d.getHead()
+ if val > math.MaxInt64 {
+ if val == math.MaxUint64 {
+ // Maximum absolute value representable by negative integer is 2^64,
+ // not 2^64-1, so it overflows uint64.
+ return time.Time{}, false, &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: typeTime.String(),
+ errorMsg: "-18446744073709551616 overflows Go's int64",
+ }
+ }
+ return time.Time{}, false, &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: typeTime.String(),
+ errorMsg: fmt.Sprintf("-%d overflows Go's int64", val+1),
+ }
+ }
+ return time.Unix(int64(-1)^int64(val), 0), true, nil
+
+ case cborTypePrimitives:
+ _, ai, val := d.getHead()
+ var f float64
+ switch ai {
+ case additionalInformationAsFloat16:
+ f = float64(float16.Frombits(uint16(val)).Float32())
+
+ case additionalInformationAsFloat32:
+ f = float64(math.Float32frombits(uint32(val)))
+
+ case additionalInformationAsFloat64:
+ f = math.Float64frombits(val)
+
+ default:
+ return time.Time{}, false, &UnmarshalTypeError{CBORType: t.String(), GoType: typeTime.String()}
+ }
+
+ if math.IsNaN(f) || math.IsInf(f, 0) {
+ // https://www.rfc-editor.org/rfc/rfc8949.html#section-3.4.2-6
+ return time.Time{}, true, nil
+ }
+ seconds, fractional := math.Modf(f)
+ return time.Unix(int64(seconds), int64(fractional*1e9)), true, nil
+
+ default:
+ return time.Time{}, false, &UnmarshalTypeError{CBORType: t.String(), GoType: typeTime.String()}
+ }
+}
+
+// parseToUnmarshaler parses CBOR data to value implementing Unmarshaler interface.
+// It assumes data is well-formed, and does not perform bounds checking.
+func (d *decoder) parseToUnmarshaler(v reflect.Value) error {
+ if d.nextCBORNil() && v.Kind() == reflect.Ptr && v.IsNil() {
+ d.skip()
+ return nil
+ }
+
+ if v.Kind() != reflect.Ptr && v.CanAddr() {
+ v = v.Addr()
+ }
+ if u, ok := v.Interface().(Unmarshaler); ok {
+ start := d.off
+ d.skip()
+ return u.UnmarshalCBOR(d.data[start:d.off])
+ }
+ d.skip()
+ return errors.New("cbor: failed to assert " + v.Type().String() + " as cbor.Unmarshaler")
+}
+
+// parse parses CBOR data and returns value in default Go type.
+// It assumes data is well-formed, and does not perform bounds checking.
+func (d *decoder) parse(skipSelfDescribedTag bool) (interface{}, error) { //nolint:gocyclo
+ // Strip self-described CBOR tag number.
+ if skipSelfDescribedTag {
+ for d.nextCBORType() == cborTypeTag {
+ off := d.off
+ _, _, tagNum := d.getHead()
+ if tagNum != tagNumSelfDescribedCBOR {
+ d.off = off
+ break
+ }
+ }
+ }
+
+ // Check validity of supported built-in tags.
+ off := d.off
+ for d.nextCBORType() == cborTypeTag {
+ _, _, tagNum := d.getHead()
+ if err := validBuiltinTag(tagNum, d.data[d.off]); err != nil {
+ d.skip()
+ return nil, err
+ }
+ }
+ d.off = off
+
+ t := d.nextCBORType()
+ switch t {
+ case cborTypePositiveInt:
+ _, _, val := d.getHead()
+
+ switch d.dm.intDec {
+ case IntDecConvertNone:
+ return val, nil
+
+ case IntDecConvertSigned, IntDecConvertSignedOrFail:
+ if val > math.MaxInt64 {
+ return nil, &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: reflect.TypeOf(int64(0)).String(),
+ errorMsg: strconv.FormatUint(val, 10) + " overflows Go's int64",
+ }
+ }
+
+ return int64(val), nil
+
+ case IntDecConvertSignedOrBigInt:
+ if val > math.MaxInt64 {
+ bi := new(big.Int).SetUint64(val)
+ if d.dm.bigIntDec == BigIntDecodePointer {
+ return bi, nil
+ }
+ return *bi, nil
+ }
+
+ return int64(val), nil
+
+ default:
+ // not reachable
+ }
+
+ case cborTypeNegativeInt:
+ _, _, val := d.getHead()
+
+ if val > math.MaxInt64 {
+ // CBOR negative integer value overflows Go int64, use big.Int instead.
+ bi := new(big.Int).SetUint64(val)
+ bi.Add(bi, big.NewInt(1))
+ bi.Neg(bi)
+
+ if d.dm.intDec == IntDecConvertSignedOrFail {
+ return nil, &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: reflect.TypeOf(int64(0)).String(),
+ errorMsg: bi.String() + " overflows Go's int64",
+ }
+ }
+
+ if d.dm.bigIntDec == BigIntDecodePointer {
+ return bi, nil
+ }
+ return *bi, nil
+ }
+
+ nValue := int64(-1) ^ int64(val)
+ return nValue, nil
+
+ case cborTypeByteString:
+ b, copied := d.parseByteString()
+ var effectiveByteStringType = d.dm.defaultByteStringType
+ if effectiveByteStringType == nil {
+ effectiveByteStringType = typeByteSlice
+ }
+ b, converted, err := d.applyByteStringTextConversion(b, effectiveByteStringType)
+ if err != nil {
+ return nil, err
+ }
+ copied = copied || converted
+
+ switch effectiveByteStringType {
+ case typeByteSlice:
+ if copied {
+ return b, nil
+ }
+ clone := make([]byte, len(b))
+ copy(clone, b)
+ return clone, nil
+
+ case typeString:
+ return string(b), nil
+
+ default:
+ if copied || d.dm.defaultByteStringType.Kind() == reflect.String {
+ // Avoid an unnecessary copy since the conversion to string must
+ // copy the underlying bytes.
+ return reflect.ValueOf(b).Convert(d.dm.defaultByteStringType).Interface(), nil
+ }
+ clone := make([]byte, len(b))
+ copy(clone, b)
+ return reflect.ValueOf(clone).Convert(d.dm.defaultByteStringType).Interface(), nil
+ }
+
+ case cborTypeTextString:
+ b, err := d.parseTextString()
+ if err != nil {
+ return nil, err
+ }
+ return string(b), nil
+
+ case cborTypeTag:
+ tagOff := d.off
+ _, _, tagNum := d.getHead()
+ contentOff := d.off
+
+ switch tagNum {
+ case tagNumRFC3339Time, tagNumEpochTime:
+ d.off = tagOff
+ tm, _, err := d.parseToTime()
+ if err != nil {
+ return nil, err
+ }
+
+ switch d.dm.timeTagToAny {
+ case TimeTagToTime:
+ return tm, nil
+
+ case TimeTagToRFC3339:
+ if tagNum == 1 {
+ tm = tm.UTC()
+ }
+ // Call time.MarshalText() to format decoded time to RFC3339 format,
+ // and return error on time value that cannot be represented in
+ // RFC3339 format. E.g. year cannot exceed 9999, etc.
+ text, err := tm.Truncate(time.Second).MarshalText()
+ if err != nil {
+ return nil, fmt.Errorf("cbor: decoded time cannot be represented in RFC3339 format: %v", err)
+ }
+ return string(text), nil
+
+ case TimeTagToRFC3339Nano:
+ if tagNum == 1 {
+ tm = tm.UTC()
+ }
+ // Call time.MarshalText() to format decoded time to RFC3339 format,
+ // and return error on time value that cannot be represented in
+ // RFC3339 format with sub-second precision.
+ text, err := tm.MarshalText()
+ if err != nil {
+ return nil, fmt.Errorf("cbor: decoded time cannot be represented in RFC3339 format with sub-second precision: %v", err)
+ }
+ return string(text), nil
+
+ default:
+ // not reachable
+ }
+
+ case tagNumUnsignedBignum:
+ b, _ := d.parseByteString()
+ bi := new(big.Int).SetBytes(b)
+
+ if d.dm.bigIntDec == BigIntDecodePointer {
+ return bi, nil
+ }
+ return *bi, nil
+
+ case tagNumNegativeBignum:
+ b, _ := d.parseByteString()
+ bi := new(big.Int).SetBytes(b)
+ bi.Add(bi, big.NewInt(1))
+ bi.Neg(bi)
+
+ if d.dm.bigIntDec == BigIntDecodePointer {
+ return bi, nil
+ }
+ return *bi, nil
+
+ case tagNumExpectedLaterEncodingBase64URL, tagNumExpectedLaterEncodingBase64, tagNumExpectedLaterEncodingBase16:
+ // If conversion for interoperability with text encodings is not configured,
+ // treat tags 21-23 as unregistered tags.
+ if d.dm.byteStringToString == ByteStringToStringAllowedWithExpectedLaterEncoding ||
+ d.dm.byteStringExpectedFormat != ByteStringExpectedFormatNone {
+ d.expectedLaterEncodingTags = append(d.expectedLaterEncodingTags, tagNum)
+ defer func() {
+ d.expectedLaterEncodingTags = d.expectedLaterEncodingTags[:len(d.expectedLaterEncodingTags)-1]
+ }()
+ return d.parse(false)
+ }
+ }
+
+ if d.dm.tags != nil {
+ // Parse to specified type if tag number is registered.
+ tagNums := []uint64{tagNum}
+ for d.nextCBORType() == cborTypeTag {
+ _, _, num := d.getHead()
+ tagNums = append(tagNums, num)
+ }
+ registeredType := d.dm.tags.getTypeFromTagNum(tagNums)
+ if registeredType != nil {
+ d.off = tagOff
+ rv := reflect.New(registeredType)
+ if err := d.parseToValue(rv.Elem(), getTypeInfo(registeredType)); err != nil {
+ return nil, err
+ }
+ return rv.Elem().Interface(), nil
+ }
+ }
+
+ // Parse tag content
+ d.off = contentOff
+ content, err := d.parse(false)
+ if err != nil {
+ return nil, err
+ }
+ if d.dm.unrecognizedTagToAny == UnrecognizedTagContentToAny {
+ return content, nil
+ }
+ return Tag{tagNum, content}, nil
+
+ case cborTypePrimitives:
+ _, ai, val := d.getHead()
+ if ai <= 24 && d.dm.simpleValues.rejected[SimpleValue(val)] {
+ return nil, &UnacceptableDataItemError{
+ CBORType: t.String(),
+ Message: "simple value " + strconv.FormatInt(int64(val), 10) + " is not recognized",
+ }
+ }
+ if ai < 20 || ai == 24 {
+ return SimpleValue(val), nil
+ }
+
+ switch ai {
+ case additionalInformationAsFalse,
+ additionalInformationAsTrue:
+ return (ai == additionalInformationAsTrue), nil
+
+ case additionalInformationAsNull,
+ additionalInformationAsUndefined:
+ return nil, nil
+
+ case additionalInformationAsFloat16:
+ f := float64(float16.Frombits(uint16(val)).Float32())
+ return f, nil
+
+ case additionalInformationAsFloat32:
+ f := float64(math.Float32frombits(uint32(val)))
+ return f, nil
+
+ case additionalInformationAsFloat64:
+ f := math.Float64frombits(val)
+ return f, nil
+ }
+
+ case cborTypeArray:
+ return d.parseArray()
+
+ case cborTypeMap:
+ if d.dm.defaultMapType != nil {
+ m := reflect.New(d.dm.defaultMapType)
+ err := d.parseToValue(m, getTypeInfo(m.Elem().Type()))
+ if err != nil {
+ return nil, err
+ }
+ return m.Elem().Interface(), nil
+ }
+ return d.parseMap()
+ }
+
+ return nil, nil
+}
+
+// parseByteString parses a CBOR encoded byte string. The returned byte slice
+// may be backed directly by the input. The second return value will be true if
+// and only if the slice is backed by a copy of the input. Callers are
+// responsible for making a copy if necessary.
+func (d *decoder) parseByteString() ([]byte, bool) {
+ _, _, val, indefiniteLength := d.getHeadWithIndefiniteLengthFlag()
+ if !indefiniteLength {
+ b := d.data[d.off : d.off+int(val)]
+ d.off += int(val)
+ return b, false
+ }
+ // Process indefinite length string chunks.
+ b := []byte{}
+ for !d.foundBreak() {
+ _, _, val = d.getHead()
+ b = append(b, d.data[d.off:d.off+int(val)]...)
+ d.off += int(val)
+ }
+ return b, true
+}
+
+// applyByteStringTextConversion converts bytes read from a byte string to or from a configured text
+// encoding. If no transformation was performed (because it was not required), the original byte
+// slice is returned and the bool return value is false. Otherwise, a new slice containing the
+// converted bytes is returned along with the bool value true.
+func (d *decoder) applyByteStringTextConversion(
+ src []byte,
+ dstType reflect.Type,
+) (
+ dst []byte,
+ transformed bool,
+ err error,
+) {
+ switch dstType.Kind() {
+ case reflect.String:
+ if d.dm.byteStringToString != ByteStringToStringAllowedWithExpectedLaterEncoding || len(d.expectedLaterEncodingTags) == 0 {
+ return src, false, nil
+ }
+
+ switch d.expectedLaterEncodingTags[len(d.expectedLaterEncodingTags)-1] {
+ case tagNumExpectedLaterEncodingBase64URL:
+ encoded := make([]byte, base64.RawURLEncoding.EncodedLen(len(src)))
+ base64.RawURLEncoding.Encode(encoded, src)
+ return encoded, true, nil
+
+ case tagNumExpectedLaterEncodingBase64:
+ encoded := make([]byte, base64.StdEncoding.EncodedLen(len(src)))
+ base64.StdEncoding.Encode(encoded, src)
+ return encoded, true, nil
+
+ case tagNumExpectedLaterEncodingBase16:
+ encoded := make([]byte, hex.EncodedLen(len(src)))
+ hex.Encode(encoded, src)
+ return encoded, true, nil
+
+ default:
+ // If this happens, there is a bug: the decoder has pushed an invalid
+ // "expected later encoding" tag to the stack.
+ panic(fmt.Sprintf("unrecognized expected later encoding tag: %d", d.expectedLaterEncodingTags))
+ }
+
+ case reflect.Slice:
+ if dstType.Elem().Kind() != reflect.Uint8 || len(d.expectedLaterEncodingTags) > 0 {
+ // Either the destination is not a slice of bytes, or the encoder that
+ // produced the input indicated an expected text encoding tag and therefore
+ // the content of the byte string has NOT been text encoded.
+ return src, false, nil
+ }
+
+ switch d.dm.byteStringExpectedFormat {
+ case ByteStringExpectedBase64URL:
+ decoded := make([]byte, base64.RawURLEncoding.DecodedLen(len(src)))
+ n, err := base64.RawURLEncoding.Decode(decoded, src)
+ if err != nil {
+ return nil, false, newByteStringExpectedFormatError(ByteStringExpectedBase64URL, err)
+ }
+ return decoded[:n], true, nil
+
+ case ByteStringExpectedBase64:
+ decoded := make([]byte, base64.StdEncoding.DecodedLen(len(src)))
+ n, err := base64.StdEncoding.Decode(decoded, src)
+ if err != nil {
+ return nil, false, newByteStringExpectedFormatError(ByteStringExpectedBase64, err)
+ }
+ return decoded[:n], true, nil
+
+ case ByteStringExpectedBase16:
+ decoded := make([]byte, hex.DecodedLen(len(src)))
+ n, err := hex.Decode(decoded, src)
+ if err != nil {
+ return nil, false, newByteStringExpectedFormatError(ByteStringExpectedBase16, err)
+ }
+ return decoded[:n], true, nil
+ }
+ }
+
+ return src, false, nil
+}
+
+// parseTextString parses CBOR encoded text string. It returns a byte slice
+// to prevent creating an extra copy of string. Caller should wrap returned
+// byte slice as string when needed.
+func (d *decoder) parseTextString() ([]byte, error) {
+ _, _, val, indefiniteLength := d.getHeadWithIndefiniteLengthFlag()
+ if !indefiniteLength {
+ b := d.data[d.off : d.off+int(val)]
+ d.off += int(val)
+ if d.dm.utf8 == UTF8RejectInvalid && !utf8.Valid(b) {
+ return nil, &SemanticError{"cbor: invalid UTF-8 string"}
+ }
+ return b, nil
+ }
+ // Process indefinite length string chunks.
+ b := []byte{}
+ for !d.foundBreak() {
+ _, _, val = d.getHead()
+ x := d.data[d.off : d.off+int(val)]
+ d.off += int(val)
+ if d.dm.utf8 == UTF8RejectInvalid && !utf8.Valid(x) {
+ for !d.foundBreak() {
+ d.skip() // Skip remaining chunk on error
+ }
+ return nil, &SemanticError{"cbor: invalid UTF-8 string"}
+ }
+ b = append(b, x...)
+ }
+ return b, nil
+}
+
+func (d *decoder) parseArray() ([]interface{}, error) {
+ _, _, val, indefiniteLength := d.getHeadWithIndefiniteLengthFlag()
+ hasSize := !indefiniteLength
+ count := int(val)
+ if !hasSize {
+ count = d.numOfItemsUntilBreak() // peek ahead to get array size to preallocate slice for better performance
+ }
+ v := make([]interface{}, count)
+ var e interface{}
+ var err, lastErr error
+ for i := 0; (hasSize && i < count) || (!hasSize && !d.foundBreak()); i++ {
+ if e, lastErr = d.parse(true); lastErr != nil {
+ if err == nil {
+ err = lastErr
+ }
+ continue
+ }
+ v[i] = e
+ }
+ return v, err
+}
+
+func (d *decoder) parseArrayToSlice(v reflect.Value, tInfo *typeInfo) error {
+ _, _, val, indefiniteLength := d.getHeadWithIndefiniteLengthFlag()
+ hasSize := !indefiniteLength
+ count := int(val)
+ if !hasSize {
+ count = d.numOfItemsUntilBreak() // peek ahead to get array size to preallocate slice for better performance
+ }
+ if v.IsNil() || v.Cap() < count || count == 0 {
+ v.Set(reflect.MakeSlice(tInfo.nonPtrType, count, count))
+ }
+ v.SetLen(count)
+ var err error
+ for i := 0; (hasSize && i < count) || (!hasSize && !d.foundBreak()); i++ {
+ if lastErr := d.parseToValue(v.Index(i), tInfo.elemTypeInfo); lastErr != nil {
+ if err == nil {
+ err = lastErr
+ }
+ }
+ }
+ return err
+}
+
+func (d *decoder) parseArrayToArray(v reflect.Value, tInfo *typeInfo) error {
+ _, _, val, indefiniteLength := d.getHeadWithIndefiniteLengthFlag()
+ hasSize := !indefiniteLength
+ count := int(val)
+ gi := 0
+ vLen := v.Len()
+ var err error
+ for ci := 0; (hasSize && ci < count) || (!hasSize && !d.foundBreak()); ci++ {
+ if gi < vLen {
+ // Read CBOR array element and set array element
+ if lastErr := d.parseToValue(v.Index(gi), tInfo.elemTypeInfo); lastErr != nil {
+ if err == nil {
+ err = lastErr
+ }
+ }
+ gi++
+ } else {
+ d.skip() // Skip remaining CBOR array element
+ }
+ }
+ // Set remaining Go array elements to zero values.
+ if gi < vLen {
+ zeroV := reflect.Zero(tInfo.elemTypeInfo.typ)
+ for ; gi < vLen; gi++ {
+ v.Index(gi).Set(zeroV)
+ }
+ }
+ return err
+}
+
+func (d *decoder) parseMap() (interface{}, error) {
+ _, _, val, indefiniteLength := d.getHeadWithIndefiniteLengthFlag()
+ hasSize := !indefiniteLength
+ count := int(val)
+ m := make(map[interface{}]interface{})
+ var k, e interface{}
+ var err, lastErr error
+ keyCount := 0
+ for i := 0; (hasSize && i < count) || (!hasSize && !d.foundBreak()); i++ {
+ // Parse CBOR map key.
+ if k, lastErr = d.parse(true); lastErr != nil {
+ if err == nil {
+ err = lastErr
+ }
+ d.skip()
+ continue
+ }
+
+ // Detect if CBOR map key can be used as Go map key.
+ rv := reflect.ValueOf(k)
+ if !isHashableValue(rv) {
+ var converted bool
+ if d.dm.mapKeyByteString == MapKeyByteStringAllowed {
+ k, converted = convertByteSliceToByteString(k)
+ }
+ if !converted {
+ if err == nil {
+ err = &InvalidMapKeyTypeError{rv.Type().String()}
+ }
+ d.skip()
+ continue
+ }
+ }
+
+ // Parse CBOR map value.
+ if e, lastErr = d.parse(true); lastErr != nil {
+ if err == nil {
+ err = lastErr
+ }
+ continue
+ }
+
+ // Add key-value pair to Go map.
+ m[k] = e
+
+ // Detect duplicate map key.
+ if d.dm.dupMapKey == DupMapKeyEnforcedAPF {
+ newKeyCount := len(m)
+ if newKeyCount == keyCount {
+ m[k] = nil
+ err = &DupMapKeyError{k, i}
+ i++
+ // skip the rest of the map
+ for ; (hasSize && i < count) || (!hasSize && !d.foundBreak()); i++ {
+ d.skip() // Skip map key
+ d.skip() // Skip map value
+ }
+ return m, err
+ }
+ keyCount = newKeyCount
+ }
+ }
+ return m, err
+}
+
+func (d *decoder) parseMapToMap(v reflect.Value, tInfo *typeInfo) error { //nolint:gocyclo
+ _, _, val, indefiniteLength := d.getHeadWithIndefiniteLengthFlag()
+ hasSize := !indefiniteLength
+ count := int(val)
+ if v.IsNil() {
+ mapsize := count
+ if !hasSize {
+ mapsize = 0
+ }
+ v.Set(reflect.MakeMapWithSize(tInfo.nonPtrType, mapsize))
+ }
+ keyType, eleType := tInfo.keyTypeInfo.typ, tInfo.elemTypeInfo.typ
+ reuseKey, reuseEle := isImmutableKind(tInfo.keyTypeInfo.kind), isImmutableKind(tInfo.elemTypeInfo.kind)
+ var keyValue, eleValue, zeroKeyValue, zeroEleValue reflect.Value
+ keyIsInterfaceType := keyType == typeIntf // If key type is interface{}, need to check if key value is hashable.
+ var err, lastErr error
+ keyCount := v.Len()
+ var existingKeys map[interface{}]bool // Store existing map keys, used for detecting duplicate map key.
+ if d.dm.dupMapKey == DupMapKeyEnforcedAPF {
+ existingKeys = make(map[interface{}]bool, keyCount)
+ if keyCount > 0 {
+ vKeys := v.MapKeys()
+ for i := 0; i < len(vKeys); i++ {
+ existingKeys[vKeys[i].Interface()] = true
+ }
+ }
+ }
+ for i := 0; (hasSize && i < count) || (!hasSize && !d.foundBreak()); i++ {
+ // Parse CBOR map key.
+ if !keyValue.IsValid() {
+ keyValue = reflect.New(keyType).Elem()
+ } else if !reuseKey {
+ if !zeroKeyValue.IsValid() {
+ zeroKeyValue = reflect.Zero(keyType)
+ }
+ keyValue.Set(zeroKeyValue)
+ }
+ if lastErr = d.parseToValue(keyValue, tInfo.keyTypeInfo); lastErr != nil {
+ if err == nil {
+ err = lastErr
+ }
+ d.skip()
+ continue
+ }
+
+ // Detect if CBOR map key can be used as Go map key.
+ if keyIsInterfaceType && keyValue.Elem().IsValid() {
+ if !isHashableValue(keyValue.Elem()) {
+ var converted bool
+ if d.dm.mapKeyByteString == MapKeyByteStringAllowed {
+ var k interface{}
+ k, converted = convertByteSliceToByteString(keyValue.Elem().Interface())
+ if converted {
+ keyValue.Set(reflect.ValueOf(k))
+ }
+ }
+ if !converted {
+ if err == nil {
+ err = &InvalidMapKeyTypeError{keyValue.Elem().Type().String()}
+ }
+ d.skip()
+ continue
+ }
+ }
+ }
+
+ // Parse CBOR map value.
+ if !eleValue.IsValid() {
+ eleValue = reflect.New(eleType).Elem()
+ } else if !reuseEle {
+ if !zeroEleValue.IsValid() {
+ zeroEleValue = reflect.Zero(eleType)
+ }
+ eleValue.Set(zeroEleValue)
+ }
+ if lastErr := d.parseToValue(eleValue, tInfo.elemTypeInfo); lastErr != nil {
+ if err == nil {
+ err = lastErr
+ }
+ continue
+ }
+
+ // Add key-value pair to Go map.
+ v.SetMapIndex(keyValue, eleValue)
+
+ // Detect duplicate map key.
+ if d.dm.dupMapKey == DupMapKeyEnforcedAPF {
+ newKeyCount := v.Len()
+ if newKeyCount == keyCount {
+ kvi := keyValue.Interface()
+ if !existingKeys[kvi] {
+ v.SetMapIndex(keyValue, reflect.New(eleType).Elem())
+ err = &DupMapKeyError{kvi, i}
+ i++
+ // skip the rest of the map
+ for ; (hasSize && i < count) || (!hasSize && !d.foundBreak()); i++ {
+ d.skip() // skip map key
+ d.skip() // skip map value
+ }
+ return err
+ }
+ delete(existingKeys, kvi)
+ }
+ keyCount = newKeyCount
+ }
+ }
+ return err
+}
+
+func (d *decoder) parseArrayToStruct(v reflect.Value, tInfo *typeInfo) error {
+ structType := getDecodingStructType(tInfo.nonPtrType)
+ if structType.err != nil {
+ return structType.err
+ }
+
+ if !structType.toArray {
+ t := d.nextCBORType()
+ d.skip()
+ return &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: tInfo.nonPtrType.String(),
+ errorMsg: "cannot decode CBOR array to struct without toarray option",
+ }
+ }
+
+ start := d.off
+ _, _, val, indefiniteLength := d.getHeadWithIndefiniteLengthFlag()
+ hasSize := !indefiniteLength
+ count := int(val)
+ if !hasSize {
+ count = d.numOfItemsUntilBreak() // peek ahead to get array size
+ }
+ if count != len(structType.fields) {
+ d.off = start
+ d.skip()
+ return &UnmarshalTypeError{
+ CBORType: cborTypeArray.String(),
+ GoType: tInfo.typ.String(),
+ errorMsg: "cannot decode CBOR array to struct with different number of elements",
+ }
+ }
+ var err, lastErr error
+ for i := 0; (hasSize && i < count) || (!hasSize && !d.foundBreak()); i++ {
+ f := structType.fields[i]
+
+ // Get field value by index
+ var fv reflect.Value
+ if len(f.idx) == 1 {
+ fv = v.Field(f.idx[0])
+ } else {
+ fv, lastErr = getFieldValue(v, f.idx, func(v reflect.Value) (reflect.Value, error) {
+ // Return a new value for embedded field null pointer to point to, or return error.
+ if !v.CanSet() {
+ return reflect.Value{}, errors.New("cbor: cannot set embedded pointer to unexported struct: " + v.Type().String())
+ }
+ v.Set(reflect.New(v.Type().Elem()))
+ return v, nil
+ })
+ if lastErr != nil && err == nil {
+ err = lastErr
+ }
+ if !fv.IsValid() {
+ d.skip()
+ continue
+ }
+ }
+
+ if lastErr = d.parseToValue(fv, f.typInfo); lastErr != nil {
+ if err == nil {
+ if typeError, ok := lastErr.(*UnmarshalTypeError); ok {
+ typeError.StructFieldName = tInfo.typ.String() + "." + f.name
+ err = typeError
+ } else {
+ err = lastErr
+ }
+ }
+ }
+ }
+ return err
+}
+
+// parseMapToStruct needs to be fast so gocyclo can be ignored for now.
+func (d *decoder) parseMapToStruct(v reflect.Value, tInfo *typeInfo) error { //nolint:gocyclo
+ structType := getDecodingStructType(tInfo.nonPtrType)
+ if structType.err != nil {
+ return structType.err
+ }
+
+ if structType.toArray {
+ t := d.nextCBORType()
+ d.skip()
+ return &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: tInfo.nonPtrType.String(),
+ errorMsg: "cannot decode CBOR map to struct with toarray option",
+ }
+ }
+
+ var err, lastErr error
+
+ // Get CBOR map size
+ _, _, val, indefiniteLength := d.getHeadWithIndefiniteLengthFlag()
+ hasSize := !indefiniteLength
+ count := int(val)
+
+ // Keeps track of matched struct fields
+ var foundFldIdx []bool
+ {
+ const maxStackFields = 128
+ if nfields := len(structType.fields); nfields <= maxStackFields {
+ // For structs with typical field counts, expect that this can be
+ // stack-allocated.
+ var a [maxStackFields]bool
+ foundFldIdx = a[:nfields]
+ } else {
+ foundFldIdx = make([]bool, len(structType.fields))
+ }
+ }
+
+ // Keeps track of CBOR map keys to detect duplicate map key
+ keyCount := 0
+ var mapKeys map[interface{}]struct{}
+
+ errOnUnknownField := (d.dm.extraReturnErrors & ExtraDecErrorUnknownField) > 0
+
+MapEntryLoop:
+ for j := 0; (hasSize && j < count) || (!hasSize && !d.foundBreak()); j++ {
+ var f *field
+
+ // If duplicate field detection is enabled and the key at index j did not match any
+ // field, k will hold the map key.
+ var k interface{}
+
+ t := d.nextCBORType()
+ if t == cborTypeTextString || (t == cborTypeByteString && d.dm.fieldNameByteString == FieldNameByteStringAllowed) {
+ var keyBytes []byte
+ if t == cborTypeTextString {
+ keyBytes, lastErr = d.parseTextString()
+ if lastErr != nil {
+ if err == nil {
+ err = lastErr
+ }
+ d.skip() // skip value
+ continue
+ }
+ } else { // cborTypeByteString
+ keyBytes, _ = d.parseByteString()
+ }
+
+ // Check for exact match on field name.
+ if i, ok := structType.fieldIndicesByName[string(keyBytes)]; ok {
+ fld := structType.fields[i]
+
+ if !foundFldIdx[i] {
+ f = fld
+ foundFldIdx[i] = true
+ } else if d.dm.dupMapKey == DupMapKeyEnforcedAPF {
+ err = &DupMapKeyError{fld.name, j}
+ d.skip() // skip value
+ j++
+ // skip the rest of the map
+ for ; (hasSize && j < count) || (!hasSize && !d.foundBreak()); j++ {
+ d.skip()
+ d.skip()
+ }
+ return err
+ } else {
+ // discard repeated match
+ d.skip()
+ continue MapEntryLoop
+ }
+ }
+
+ // Find field with case-insensitive match
+ if f == nil && d.dm.fieldNameMatching == FieldNameMatchingPreferCaseSensitive {
+ keyLen := len(keyBytes)
+ keyString := string(keyBytes)
+ for i := 0; i < len(structType.fields); i++ {
+ fld := structType.fields[i]
+ if len(fld.name) == keyLen && strings.EqualFold(fld.name, keyString) {
+ if !foundFldIdx[i] {
+ f = fld
+ foundFldIdx[i] = true
+ } else if d.dm.dupMapKey == DupMapKeyEnforcedAPF {
+ err = &DupMapKeyError{keyString, j}
+ d.skip() // skip value
+ j++
+ // skip the rest of the map
+ for ; (hasSize && j < count) || (!hasSize && !d.foundBreak()); j++ {
+ d.skip()
+ d.skip()
+ }
+ return err
+ } else {
+ // discard repeated match
+ d.skip()
+ continue MapEntryLoop
+ }
+ break
+ }
+ }
+ }
+
+ if d.dm.dupMapKey == DupMapKeyEnforcedAPF && f == nil {
+ k = string(keyBytes)
+ }
+ } else if t <= cborTypeNegativeInt { // uint/int
+ var nameAsInt int64
+
+ if t == cborTypePositiveInt {
+ _, _, val := d.getHead()
+ nameAsInt = int64(val)
+ } else {
+ _, _, val := d.getHead()
+ if val > math.MaxInt64 {
+ if err == nil {
+ err = &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: reflect.TypeOf(int64(0)).String(),
+ errorMsg: "-1-" + strconv.FormatUint(val, 10) + " overflows Go's int64",
+ }
+ }
+ d.skip() // skip value
+ continue
+ }
+ nameAsInt = int64(-1) ^ int64(val)
+ }
+
+ // Find field
+ for i := 0; i < len(structType.fields); i++ {
+ fld := structType.fields[i]
+ if fld.keyAsInt && fld.nameAsInt == nameAsInt {
+ if !foundFldIdx[i] {
+ f = fld
+ foundFldIdx[i] = true
+ } else if d.dm.dupMapKey == DupMapKeyEnforcedAPF {
+ err = &DupMapKeyError{nameAsInt, j}
+ d.skip() // skip value
+ j++
+ // skip the rest of the map
+ for ; (hasSize && j < count) || (!hasSize && !d.foundBreak()); j++ {
+ d.skip()
+ d.skip()
+ }
+ return err
+ } else {
+ // discard repeated match
+ d.skip()
+ continue MapEntryLoop
+ }
+ break
+ }
+ }
+
+ if d.dm.dupMapKey == DupMapKeyEnforcedAPF && f == nil {
+ k = nameAsInt
+ }
+ } else {
+ if err == nil {
+ err = &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: reflect.TypeOf("").String(),
+ errorMsg: "map key is of type " + t.String() + " and cannot be used to match struct field name",
+ }
+ }
+ if d.dm.dupMapKey == DupMapKeyEnforcedAPF {
+ // parse key
+ k, lastErr = d.parse(true)
+ if lastErr != nil {
+ d.skip() // skip value
+ continue
+ }
+ // Detect if CBOR map key can be used as Go map key.
+ if !isHashableValue(reflect.ValueOf(k)) {
+ d.skip() // skip value
+ continue
+ }
+ } else {
+ d.skip() // skip key
+ }
+ }
+
+ if f == nil {
+ if errOnUnknownField {
+ err = &UnknownFieldError{j}
+ d.skip() // Skip value
+ j++
+ // skip the rest of the map
+ for ; (hasSize && j < count) || (!hasSize && !d.foundBreak()); j++ {
+ d.skip()
+ d.skip()
+ }
+ return err
+ }
+
+ // Two map keys that match the same struct field are immediately considered
+ // duplicates. This check detects duplicates between two map keys that do
+ // not match a struct field. If unknown field errors are enabled, then this
+ // check is never reached.
+ if d.dm.dupMapKey == DupMapKeyEnforcedAPF {
+ if mapKeys == nil {
+ mapKeys = make(map[interface{}]struct{}, 1)
+ }
+ mapKeys[k] = struct{}{}
+ newKeyCount := len(mapKeys)
+ if newKeyCount == keyCount {
+ err = &DupMapKeyError{k, j}
+ d.skip() // skip value
+ j++
+ // skip the rest of the map
+ for ; (hasSize && j < count) || (!hasSize && !d.foundBreak()); j++ {
+ d.skip()
+ d.skip()
+ }
+ return err
+ }
+ keyCount = newKeyCount
+ }
+
+ d.skip() // Skip value
+ continue
+ }
+
+ // Get field value by index
+ var fv reflect.Value
+ if len(f.idx) == 1 {
+ fv = v.Field(f.idx[0])
+ } else {
+ fv, lastErr = getFieldValue(v, f.idx, func(v reflect.Value) (reflect.Value, error) {
+ // Return a new value for embedded field null pointer to point to, or return error.
+ if !v.CanSet() {
+ return reflect.Value{}, errors.New("cbor: cannot set embedded pointer to unexported struct: " + v.Type().String())
+ }
+ v.Set(reflect.New(v.Type().Elem()))
+ return v, nil
+ })
+ if lastErr != nil && err == nil {
+ err = lastErr
+ }
+ if !fv.IsValid() {
+ d.skip()
+ continue
+ }
+ }
+
+ if lastErr = d.parseToValue(fv, f.typInfo); lastErr != nil {
+ if err == nil {
+ if typeError, ok := lastErr.(*UnmarshalTypeError); ok {
+ typeError.StructFieldName = tInfo.nonPtrType.String() + "." + f.name
+ err = typeError
+ } else {
+ err = lastErr
+ }
+ }
+ }
+ }
+ return err
+}
+
+// validRegisteredTagNums verifies that tag numbers match registered tag numbers of type t.
+// validRegisteredTagNums assumes next CBOR data type is tag. It scans all tag numbers, and stops at tag content.
+func (d *decoder) validRegisteredTagNums(registeredTag *tagItem) error {
+ // Scan until next cbor data is tag content.
+ tagNums := make([]uint64, 0, 1)
+ for d.nextCBORType() == cborTypeTag {
+ _, _, val := d.getHead()
+ tagNums = append(tagNums, val)
+ }
+
+ if !registeredTag.equalTagNum(tagNums) {
+ return &WrongTagError{registeredTag.contentType, registeredTag.num, tagNums}
+ }
+ return nil
+}
+
+func (d *decoder) getRegisteredTagItem(vt reflect.Type) *tagItem {
+ if d.dm.tags != nil {
+ return d.dm.tags.getTagItemFromType(vt)
+ }
+ return nil
+}
+
+// skip moves data offset to the next item. skip assumes data is well-formed,
+// and does not perform bounds checking.
+func (d *decoder) skip() {
+ t, _, val, indefiniteLength := d.getHeadWithIndefiniteLengthFlag()
+
+ if indefiniteLength {
+ switch t {
+ case cborTypeByteString, cborTypeTextString, cborTypeArray, cborTypeMap:
+ for {
+ if isBreakFlag(d.data[d.off]) {
+ d.off++
+ return
+ }
+ d.skip()
+ }
+ }
+ }
+
+ switch t {
+ case cborTypeByteString, cborTypeTextString:
+ d.off += int(val)
+
+ case cborTypeArray:
+ for i := 0; i < int(val); i++ {
+ d.skip()
+ }
+
+ case cborTypeMap:
+ for i := 0; i < int(val)*2; i++ {
+ d.skip()
+ }
+
+ case cborTypeTag:
+ d.skip()
+ }
+}
+
+func (d *decoder) getHeadWithIndefiniteLengthFlag() (
+ t cborType,
+ ai byte,
+ val uint64,
+ indefiniteLength bool,
+) {
+ t, ai, val = d.getHead()
+ indefiniteLength = additionalInformation(ai).isIndefiniteLength()
+ return
+}
+
+// getHead assumes data is well-formed, and does not perform bounds checking.
+func (d *decoder) getHead() (t cborType, ai byte, val uint64) {
+ t, ai = parseInitialByte(d.data[d.off])
+ val = uint64(ai)
+ d.off++
+
+ if ai <= maxAdditionalInformationWithoutArgument {
+ return
+ }
+
+ if ai == additionalInformationWith1ByteArgument {
+ val = uint64(d.data[d.off])
+ d.off++
+ return
+ }
+
+ if ai == additionalInformationWith2ByteArgument {
+ const argumentSize = 2
+ val = uint64(binary.BigEndian.Uint16(d.data[d.off : d.off+argumentSize]))
+ d.off += argumentSize
+ return
+ }
+
+ if ai == additionalInformationWith4ByteArgument {
+ const argumentSize = 4
+ val = uint64(binary.BigEndian.Uint32(d.data[d.off : d.off+argumentSize]))
+ d.off += argumentSize
+ return
+ }
+
+ if ai == additionalInformationWith8ByteArgument {
+ const argumentSize = 8
+ val = binary.BigEndian.Uint64(d.data[d.off : d.off+argumentSize])
+ d.off += argumentSize
+ return
+ }
+ return
+}
+
+func (d *decoder) numOfItemsUntilBreak() int {
+ savedOff := d.off
+ i := 0
+ for !d.foundBreak() {
+ d.skip()
+ i++
+ }
+ d.off = savedOff
+ return i
+}
+
+// foundBreak returns true if next byte is CBOR break code and moves cursor by 1,
+// otherwise it returns false.
+// foundBreak assumes data is well-formed, and does not perform bounds checking.
+func (d *decoder) foundBreak() bool {
+ if isBreakFlag(d.data[d.off]) {
+ d.off++
+ return true
+ }
+ return false
+}
+
+func (d *decoder) reset(data []byte) {
+ d.data = data
+ d.off = 0
+ d.expectedLaterEncodingTags = d.expectedLaterEncodingTags[:0]
+}
+
+func (d *decoder) nextCBORType() cborType {
+ return getType(d.data[d.off])
+}
+
+func (d *decoder) nextCBORNil() bool {
+ return d.data[d.off] == 0xf6 || d.data[d.off] == 0xf7
+}
+
+var (
+ typeIntf = reflect.TypeOf([]interface{}(nil)).Elem()
+ typeTime = reflect.TypeOf(time.Time{})
+ typeBigInt = reflect.TypeOf(big.Int{})
+ typeUnmarshaler = reflect.TypeOf((*Unmarshaler)(nil)).Elem()
+ typeBinaryUnmarshaler = reflect.TypeOf((*encoding.BinaryUnmarshaler)(nil)).Elem()
+ typeString = reflect.TypeOf("")
+ typeByteSlice = reflect.TypeOf([]byte(nil))
+)
+
+func fillNil(_ cborType, v reflect.Value) error {
+ switch v.Kind() {
+ case reflect.Slice, reflect.Map, reflect.Interface, reflect.Ptr:
+ v.Set(reflect.Zero(v.Type()))
+ return nil
+ }
+ return nil
+}
+
+func fillPositiveInt(t cborType, val uint64, v reflect.Value) error {
+ switch v.Kind() {
+ case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+ if val > math.MaxInt64 {
+ return &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: v.Type().String(),
+ errorMsg: strconv.FormatUint(val, 10) + " overflows " + v.Type().String(),
+ }
+ }
+ if v.OverflowInt(int64(val)) {
+ return &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: v.Type().String(),
+ errorMsg: strconv.FormatUint(val, 10) + " overflows " + v.Type().String(),
+ }
+ }
+ v.SetInt(int64(val))
+ return nil
+
+ case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
+ if v.OverflowUint(val) {
+ return &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: v.Type().String(),
+ errorMsg: strconv.FormatUint(val, 10) + " overflows " + v.Type().String(),
+ }
+ }
+ v.SetUint(val)
+ return nil
+
+ case reflect.Float32, reflect.Float64:
+ f := float64(val)
+ v.SetFloat(f)
+ return nil
+ }
+
+ if v.Type() == typeBigInt {
+ i := new(big.Int).SetUint64(val)
+ v.Set(reflect.ValueOf(*i))
+ return nil
+ }
+ return &UnmarshalTypeError{CBORType: t.String(), GoType: v.Type().String()}
+}
+
+func fillNegativeInt(t cborType, val int64, v reflect.Value) error {
+ switch v.Kind() {
+ case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+ if v.OverflowInt(val) {
+ return &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: v.Type().String(),
+ errorMsg: strconv.FormatInt(val, 10) + " overflows " + v.Type().String(),
+ }
+ }
+ v.SetInt(val)
+ return nil
+
+ case reflect.Float32, reflect.Float64:
+ f := float64(val)
+ v.SetFloat(f)
+ return nil
+ }
+ if v.Type() == typeBigInt {
+ i := new(big.Int).SetInt64(val)
+ v.Set(reflect.ValueOf(*i))
+ return nil
+ }
+ return &UnmarshalTypeError{CBORType: t.String(), GoType: v.Type().String()}
+}
+
+func fillBool(t cborType, val bool, v reflect.Value) error {
+ if v.Kind() == reflect.Bool {
+ v.SetBool(val)
+ return nil
+ }
+ return &UnmarshalTypeError{CBORType: t.String(), GoType: v.Type().String()}
+}
+
+func fillFloat(t cborType, val float64, v reflect.Value) error {
+ switch v.Kind() {
+ case reflect.Float32, reflect.Float64:
+ if v.OverflowFloat(val) {
+ return &UnmarshalTypeError{
+ CBORType: t.String(),
+ GoType: v.Type().String(),
+ errorMsg: strconv.FormatFloat(val, 'E', -1, 64) + " overflows " + v.Type().String(),
+ }
+ }
+ v.SetFloat(val)
+ return nil
+ }
+ return &UnmarshalTypeError{CBORType: t.String(), GoType: v.Type().String()}
+}
+
+func fillByteString(t cborType, val []byte, shared bool, v reflect.Value, bsts ByteStringToStringMode, bum BinaryUnmarshalerMode) error {
+ if bum == BinaryUnmarshalerByteString && reflect.PtrTo(v.Type()).Implements(typeBinaryUnmarshaler) {
+ if v.CanAddr() {
+ v = v.Addr()
+ if u, ok := v.Interface().(encoding.BinaryUnmarshaler); ok {
+ // The contract of BinaryUnmarshaler forbids
+ // retaining the input bytes, so no copying is
+ // required even if val is shared.
+ return u.UnmarshalBinary(val)
+ }
+ }
+ return errors.New("cbor: cannot set new value for " + v.Type().String())
+ }
+ if bsts != ByteStringToStringForbidden && v.Kind() == reflect.String {
+ v.SetString(string(val))
+ return nil
+ }
+ if v.Kind() == reflect.Slice && v.Type().Elem().Kind() == reflect.Uint8 {
+ src := val
+ if shared {
+ // SetBytes shares the underlying bytes of the source slice.
+ src = make([]byte, len(val))
+ copy(src, val)
+ }
+ v.SetBytes(src)
+ return nil
+ }
+ if v.Kind() == reflect.Array && v.Type().Elem().Kind() == reflect.Uint8 {
+ vLen := v.Len()
+ i := 0
+ for ; i < vLen && i < len(val); i++ {
+ v.Index(i).SetUint(uint64(val[i]))
+ }
+ // Set remaining Go array elements to zero values.
+ if i < vLen {
+ zeroV := reflect.Zero(reflect.TypeOf(byte(0)))
+ for ; i < vLen; i++ {
+ v.Index(i).Set(zeroV)
+ }
+ }
+ return nil
+ }
+ return &UnmarshalTypeError{CBORType: t.String(), GoType: v.Type().String()}
+}
+
+func fillTextString(t cborType, val []byte, v reflect.Value) error {
+ if v.Kind() == reflect.String {
+ v.SetString(string(val))
+ return nil
+ }
+ return &UnmarshalTypeError{CBORType: t.String(), GoType: v.Type().String()}
+}
+
+func isImmutableKind(k reflect.Kind) bool {
+ switch k {
+ case reflect.Bool,
+ reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64,
+ reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64,
+ reflect.Float32, reflect.Float64,
+ reflect.String:
+ return true
+
+ default:
+ return false
+ }
+}
+
+func isHashableValue(rv reflect.Value) bool {
+ switch rv.Kind() {
+ case reflect.Slice, reflect.Map, reflect.Func:
+ return false
+
+ case reflect.Struct:
+ switch rv.Type() {
+ case typeTag:
+ tag := rv.Interface().(Tag)
+ return isHashableValue(reflect.ValueOf(tag.Content))
+ case typeBigInt:
+ return false
+ }
+ }
+ return true
+}
+
+// convertByteSliceToByteString converts []byte to ByteString if
+// - v is []byte type, or
+// - v is Tag type and tag content type is []byte
+// This function also handles nested tags.
+// CBOR data is already verified to be well-formed before this function is used,
+// so the recursion won't exceed max nested levels.
+func convertByteSliceToByteString(v interface{}) (interface{}, bool) {
+ switch v := v.(type) {
+ case []byte:
+ return ByteString(v), true
+
+ case Tag:
+ content, converted := convertByteSliceToByteString(v.Content)
+ if converted {
+ return Tag{Number: v.Number, Content: content}, true
+ }
+ }
+ return v, false
+}
diff --git a/vendor/github.com/fxamacker/cbor/v2/diagnose.go b/vendor/github.com/fxamacker/cbor/v2/diagnose.go
new file mode 100644
index 00000000..44afb866
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/diagnose.go
@@ -0,0 +1,724 @@
+// Copyright (c) Faye Amacker. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+package cbor
+
+import (
+ "bytes"
+ "encoding/base32"
+ "encoding/base64"
+ "encoding/hex"
+ "errors"
+ "fmt"
+ "io"
+ "math"
+ "math/big"
+ "strconv"
+ "unicode/utf16"
+ "unicode/utf8"
+
+ "github.com/x448/float16"
+)
+
+// DiagMode is the main interface for CBOR diagnostic notation.
+type DiagMode interface {
+ // Diagnose returns extended diagnostic notation (EDN) of CBOR data items using this DiagMode.
+ Diagnose([]byte) (string, error)
+
+ // DiagnoseFirst returns extended diagnostic notation (EDN) of the first CBOR data item using the DiagMode. Any remaining bytes are returned in rest.
+ DiagnoseFirst([]byte) (string, []byte, error)
+
+ // DiagOptions returns user specified options used to create this DiagMode.
+ DiagOptions() DiagOptions
+}
+
+// ByteStringEncoding specifies the base encoding that byte strings are notated.
+type ByteStringEncoding uint8
+
+const (
+ // ByteStringBase16Encoding encodes byte strings in base16, without padding.
+ ByteStringBase16Encoding ByteStringEncoding = iota
+
+ // ByteStringBase32Encoding encodes byte strings in base32, without padding.
+ ByteStringBase32Encoding
+
+ // ByteStringBase32HexEncoding encodes byte strings in base32hex, without padding.
+ ByteStringBase32HexEncoding
+
+ // ByteStringBase64Encoding encodes byte strings in base64url, without padding.
+ ByteStringBase64Encoding
+
+ maxByteStringEncoding
+)
+
+func (bse ByteStringEncoding) valid() error {
+ if bse >= maxByteStringEncoding {
+ return errors.New("cbor: invalid ByteStringEncoding " + strconv.Itoa(int(bse)))
+ }
+ return nil
+}
+
+// DiagOptions specifies Diag options.
+type DiagOptions struct {
+ // ByteStringEncoding specifies the base encoding that byte strings are notated.
+ // Default is ByteStringBase16Encoding.
+ ByteStringEncoding ByteStringEncoding
+
+ // ByteStringHexWhitespace specifies notating with whitespace in byte string
+ // when ByteStringEncoding is ByteStringBase16Encoding.
+ ByteStringHexWhitespace bool
+
+ // ByteStringText specifies notating with text in byte string
+ // if it is a valid UTF-8 text.
+ ByteStringText bool
+
+ // ByteStringEmbeddedCBOR specifies notating embedded CBOR in byte string
+ // if it is a valid CBOR bytes.
+ ByteStringEmbeddedCBOR bool
+
+ // CBORSequence specifies notating CBOR sequences.
+ // otherwise, it returns an error if there are more bytes after the first CBOR.
+ CBORSequence bool
+
+ // FloatPrecisionIndicator specifies appending a suffix to indicate float precision.
+ // Refer to https://www.rfc-editor.org/rfc/rfc8949.html#name-encoding-indicators.
+ FloatPrecisionIndicator bool
+
+ // MaxNestedLevels specifies the max nested levels allowed for any combination of CBOR array, maps, and tags.
+ // Default is 32 levels and it can be set to [4, 65535]. Note that higher maximum levels of nesting can
+ // require larger amounts of stack to deserialize. Don't increase this higher than you require.
+ MaxNestedLevels int
+
+ // MaxArrayElements specifies the max number of elements for CBOR arrays.
+ // Default is 128*1024=131072 and it can be set to [16, 2147483647]
+ MaxArrayElements int
+
+ // MaxMapPairs specifies the max number of key-value pairs for CBOR maps.
+ // Default is 128*1024=131072 and it can be set to [16, 2147483647]
+ MaxMapPairs int
+}
+
+// DiagMode returns a DiagMode with immutable options.
+func (opts DiagOptions) DiagMode() (DiagMode, error) {
+ return opts.diagMode()
+}
+
+func (opts DiagOptions) diagMode() (*diagMode, error) {
+ if err := opts.ByteStringEncoding.valid(); err != nil {
+ return nil, err
+ }
+
+ decMode, err := DecOptions{
+ MaxNestedLevels: opts.MaxNestedLevels,
+ MaxArrayElements: opts.MaxArrayElements,
+ MaxMapPairs: opts.MaxMapPairs,
+ }.decMode()
+ if err != nil {
+ return nil, err
+ }
+
+ return &diagMode{
+ byteStringEncoding: opts.ByteStringEncoding,
+ byteStringHexWhitespace: opts.ByteStringHexWhitespace,
+ byteStringText: opts.ByteStringText,
+ byteStringEmbeddedCBOR: opts.ByteStringEmbeddedCBOR,
+ cborSequence: opts.CBORSequence,
+ floatPrecisionIndicator: opts.FloatPrecisionIndicator,
+ decMode: decMode,
+ }, nil
+}
+
+type diagMode struct {
+ byteStringEncoding ByteStringEncoding
+ byteStringHexWhitespace bool
+ byteStringText bool
+ byteStringEmbeddedCBOR bool
+ cborSequence bool
+ floatPrecisionIndicator bool
+ decMode *decMode
+}
+
+// DiagOptions returns user specified options used to create this DiagMode.
+func (dm *diagMode) DiagOptions() DiagOptions {
+ return DiagOptions{
+ ByteStringEncoding: dm.byteStringEncoding,
+ ByteStringHexWhitespace: dm.byteStringHexWhitespace,
+ ByteStringText: dm.byteStringText,
+ ByteStringEmbeddedCBOR: dm.byteStringEmbeddedCBOR,
+ CBORSequence: dm.cborSequence,
+ FloatPrecisionIndicator: dm.floatPrecisionIndicator,
+ MaxNestedLevels: dm.decMode.maxNestedLevels,
+ MaxArrayElements: dm.decMode.maxArrayElements,
+ MaxMapPairs: dm.decMode.maxMapPairs,
+ }
+}
+
+// Diagnose returns extended diagnostic notation (EDN) of CBOR data items using the DiagMode.
+func (dm *diagMode) Diagnose(data []byte) (string, error) {
+ return newDiagnose(data, dm.decMode, dm).diag(dm.cborSequence)
+}
+
+// DiagnoseFirst returns extended diagnostic notation (EDN) of the first CBOR data item using the DiagMode. Any remaining bytes are returned in rest.
+func (dm *diagMode) DiagnoseFirst(data []byte) (diagNotation string, rest []byte, err error) {
+ return newDiagnose(data, dm.decMode, dm).diagFirst()
+}
+
+var defaultDiagMode, _ = DiagOptions{}.diagMode()
+
+// Diagnose returns extended diagnostic notation (EDN) of CBOR data items
+// using the default diagnostic mode.
+//
+// Refer to https://www.rfc-editor.org/rfc/rfc8949.html#name-diagnostic-notation.
+func Diagnose(data []byte) (string, error) {
+ return defaultDiagMode.Diagnose(data)
+}
+
+// Diagnose returns extended diagnostic notation (EDN) of the first CBOR data item using the DiagMode. Any remaining bytes are returned in rest.
+func DiagnoseFirst(data []byte) (diagNotation string, rest []byte, err error) {
+ return defaultDiagMode.DiagnoseFirst(data)
+}
+
+type diagnose struct {
+ dm *diagMode
+ d *decoder
+ w *bytes.Buffer
+}
+
+func newDiagnose(data []byte, decm *decMode, diagm *diagMode) *diagnose {
+ return &diagnose{
+ dm: diagm,
+ d: &decoder{data: data, dm: decm},
+ w: &bytes.Buffer{},
+ }
+}
+
+func (di *diagnose) diag(cborSequence bool) (string, error) {
+ // CBOR Sequence
+ firstItem := true
+ for {
+ switch err := di.wellformed(cborSequence); err {
+ case nil:
+ if !firstItem {
+ di.w.WriteString(", ")
+ }
+ firstItem = false
+ if itemErr := di.item(); itemErr != nil {
+ return di.w.String(), itemErr
+ }
+
+ case io.EOF:
+ if firstItem {
+ return di.w.String(), err
+ }
+ return di.w.String(), nil
+
+ default:
+ return di.w.String(), err
+ }
+ }
+}
+
+func (di *diagnose) diagFirst() (diagNotation string, rest []byte, err error) {
+ err = di.wellformed(true)
+ if err == nil {
+ err = di.item()
+ }
+
+ if err == nil {
+ // Return EDN and the rest of the data slice (which might be len 0)
+ return di.w.String(), di.d.data[di.d.off:], nil
+ }
+
+ return di.w.String(), nil, err
+}
+
+func (di *diagnose) wellformed(allowExtraData bool) error {
+ off := di.d.off
+ err := di.d.wellformed(allowExtraData, false)
+ di.d.off = off
+ return err
+}
+
+func (di *diagnose) item() error { //nolint:gocyclo
+ initialByte := di.d.data[di.d.off]
+ switch initialByte {
+ case cborByteStringWithIndefiniteLengthHead,
+ cborTextStringWithIndefiniteLengthHead: // indefinite-length byte/text string
+ di.d.off++
+ if isBreakFlag(di.d.data[di.d.off]) {
+ di.d.off++
+ switch initialByte {
+ case cborByteStringWithIndefiniteLengthHead:
+ // indefinite-length bytes with no chunks.
+ di.w.WriteString(`''_`)
+ return nil
+ case cborTextStringWithIndefiniteLengthHead:
+ // indefinite-length text with no chunks.
+ di.w.WriteString(`""_`)
+ return nil
+ }
+ }
+
+ di.w.WriteString("(_ ")
+
+ i := 0
+ for !di.d.foundBreak() {
+ if i > 0 {
+ di.w.WriteString(", ")
+ }
+
+ i++
+ // wellformedIndefiniteString() already checked that the next item is a byte/text string.
+ if err := di.item(); err != nil {
+ return err
+ }
+ }
+
+ di.w.WriteByte(')')
+ return nil
+
+ case cborArrayWithIndefiniteLengthHead: // indefinite-length array
+ di.d.off++
+ di.w.WriteString("[_ ")
+
+ i := 0
+ for !di.d.foundBreak() {
+ if i > 0 {
+ di.w.WriteString(", ")
+ }
+
+ i++
+ if err := di.item(); err != nil {
+ return err
+ }
+ }
+
+ di.w.WriteByte(']')
+ return nil
+
+ case cborMapWithIndefiniteLengthHead: // indefinite-length map
+ di.d.off++
+ di.w.WriteString("{_ ")
+
+ i := 0
+ for !di.d.foundBreak() {
+ if i > 0 {
+ di.w.WriteString(", ")
+ }
+
+ i++
+ // key
+ if err := di.item(); err != nil {
+ return err
+ }
+
+ di.w.WriteString(": ")
+
+ // value
+ if err := di.item(); err != nil {
+ return err
+ }
+ }
+
+ di.w.WriteByte('}')
+ return nil
+ }
+
+ t := di.d.nextCBORType()
+ switch t {
+ case cborTypePositiveInt:
+ _, _, val := di.d.getHead()
+ di.w.WriteString(strconv.FormatUint(val, 10))
+ return nil
+
+ case cborTypeNegativeInt:
+ _, _, val := di.d.getHead()
+ if val > math.MaxInt64 {
+ // CBOR negative integer overflows int64, use big.Int to store value.
+ bi := new(big.Int)
+ bi.SetUint64(val)
+ bi.Add(bi, big.NewInt(1))
+ bi.Neg(bi)
+ di.w.WriteString(bi.String())
+ return nil
+ }
+
+ nValue := int64(-1) ^ int64(val)
+ di.w.WriteString(strconv.FormatInt(nValue, 10))
+ return nil
+
+ case cborTypeByteString:
+ b, _ := di.d.parseByteString()
+ return di.encodeByteString(b)
+
+ case cborTypeTextString:
+ b, err := di.d.parseTextString()
+ if err != nil {
+ return err
+ }
+ return di.encodeTextString(string(b), '"')
+
+ case cborTypeArray:
+ _, _, val := di.d.getHead()
+ count := int(val)
+ di.w.WriteByte('[')
+
+ for i := 0; i < count; i++ {
+ if i > 0 {
+ di.w.WriteString(", ")
+ }
+ if err := di.item(); err != nil {
+ return err
+ }
+ }
+ di.w.WriteByte(']')
+ return nil
+
+ case cborTypeMap:
+ _, _, val := di.d.getHead()
+ count := int(val)
+ di.w.WriteByte('{')
+
+ for i := 0; i < count; i++ {
+ if i > 0 {
+ di.w.WriteString(", ")
+ }
+ // key
+ if err := di.item(); err != nil {
+ return err
+ }
+ di.w.WriteString(": ")
+ // value
+ if err := di.item(); err != nil {
+ return err
+ }
+ }
+ di.w.WriteByte('}')
+ return nil
+
+ case cborTypeTag:
+ _, _, tagNum := di.d.getHead()
+ switch tagNum {
+ case tagNumUnsignedBignum:
+ if nt := di.d.nextCBORType(); nt != cborTypeByteString {
+ return newInadmissibleTagContentTypeError(
+ tagNumUnsignedBignum,
+ "byte string",
+ nt.String())
+ }
+
+ b, _ := di.d.parseByteString()
+ bi := new(big.Int).SetBytes(b)
+ di.w.WriteString(bi.String())
+ return nil
+
+ case tagNumNegativeBignum:
+ if nt := di.d.nextCBORType(); nt != cborTypeByteString {
+ return newInadmissibleTagContentTypeError(
+ tagNumNegativeBignum,
+ "byte string",
+ nt.String(),
+ )
+ }
+
+ b, _ := di.d.parseByteString()
+ bi := new(big.Int).SetBytes(b)
+ bi.Add(bi, big.NewInt(1))
+ bi.Neg(bi)
+ di.w.WriteString(bi.String())
+ return nil
+
+ default:
+ di.w.WriteString(strconv.FormatUint(tagNum, 10))
+ di.w.WriteByte('(')
+ if err := di.item(); err != nil {
+ return err
+ }
+ di.w.WriteByte(')')
+ return nil
+ }
+
+ case cborTypePrimitives:
+ _, ai, val := di.d.getHead()
+ switch ai {
+ case additionalInformationAsFalse:
+ di.w.WriteString("false")
+ return nil
+
+ case additionalInformationAsTrue:
+ di.w.WriteString("true")
+ return nil
+
+ case additionalInformationAsNull:
+ di.w.WriteString("null")
+ return nil
+
+ case additionalInformationAsUndefined:
+ di.w.WriteString("undefined")
+ return nil
+
+ case additionalInformationAsFloat16,
+ additionalInformationAsFloat32,
+ additionalInformationAsFloat64:
+ return di.encodeFloat(ai, val)
+
+ default:
+ di.w.WriteString("simple(")
+ di.w.WriteString(strconv.FormatUint(val, 10))
+ di.w.WriteByte(')')
+ return nil
+ }
+ }
+
+ return nil
+}
+
+// writeU16 format a rune as "\uxxxx"
+func (di *diagnose) writeU16(val rune) {
+ di.w.WriteString("\\u")
+ var in [2]byte
+ in[0] = byte(val >> 8)
+ in[1] = byte(val)
+ sz := hex.EncodedLen(len(in))
+ di.w.Grow(sz)
+ dst := di.w.Bytes()[di.w.Len() : di.w.Len()+sz]
+ hex.Encode(dst, in[:])
+ di.w.Write(dst)
+}
+
+var rawBase32Encoding = base32.StdEncoding.WithPadding(base32.NoPadding)
+var rawBase32HexEncoding = base32.HexEncoding.WithPadding(base32.NoPadding)
+
+func (di *diagnose) encodeByteString(val []byte) error {
+ if len(val) > 0 {
+ if di.dm.byteStringText && utf8.Valid(val) {
+ return di.encodeTextString(string(val), '\'')
+ }
+
+ if di.dm.byteStringEmbeddedCBOR {
+ di2 := newDiagnose(val, di.dm.decMode, di.dm)
+ // should always notating embedded CBOR sequence.
+ if str, err := di2.diag(true); err == nil {
+ di.w.WriteString("<<")
+ di.w.WriteString(str)
+ di.w.WriteString(">>")
+ return nil
+ }
+ }
+ }
+
+ switch di.dm.byteStringEncoding {
+ case ByteStringBase16Encoding:
+ di.w.WriteString("h'")
+ if di.dm.byteStringHexWhitespace {
+ sz := hex.EncodedLen(len(val))
+ if len(val) > 0 {
+ sz += len(val) - 1
+ }
+ di.w.Grow(sz)
+
+ dst := di.w.Bytes()[di.w.Len():]
+ for i := range val {
+ if i > 0 {
+ dst = append(dst, ' ')
+ }
+ hex.Encode(dst[len(dst):len(dst)+2], val[i:i+1])
+ dst = dst[:len(dst)+2]
+ }
+ di.w.Write(dst)
+ } else {
+ sz := hex.EncodedLen(len(val))
+ di.w.Grow(sz)
+ dst := di.w.Bytes()[di.w.Len() : di.w.Len()+sz]
+ hex.Encode(dst, val)
+ di.w.Write(dst)
+ }
+ di.w.WriteByte('\'')
+ return nil
+
+ case ByteStringBase32Encoding:
+ di.w.WriteString("b32'")
+ sz := rawBase32Encoding.EncodedLen(len(val))
+ di.w.Grow(sz)
+ dst := di.w.Bytes()[di.w.Len() : di.w.Len()+sz]
+ rawBase32Encoding.Encode(dst, val)
+ di.w.Write(dst)
+ di.w.WriteByte('\'')
+ return nil
+
+ case ByteStringBase32HexEncoding:
+ di.w.WriteString("h32'")
+ sz := rawBase32HexEncoding.EncodedLen(len(val))
+ di.w.Grow(sz)
+ dst := di.w.Bytes()[di.w.Len() : di.w.Len()+sz]
+ rawBase32HexEncoding.Encode(dst, val)
+ di.w.Write(dst)
+ di.w.WriteByte('\'')
+ return nil
+
+ case ByteStringBase64Encoding:
+ di.w.WriteString("b64'")
+ sz := base64.RawURLEncoding.EncodedLen(len(val))
+ di.w.Grow(sz)
+ dst := di.w.Bytes()[di.w.Len() : di.w.Len()+sz]
+ base64.RawURLEncoding.Encode(dst, val)
+ di.w.Write(dst)
+ di.w.WriteByte('\'')
+ return nil
+
+ default:
+ // It should not be possible for users to construct a *diagMode with an invalid byte
+ // string encoding.
+ panic(fmt.Sprintf("diagmode has invalid ByteStringEncoding %v", di.dm.byteStringEncoding))
+ }
+}
+
+const utf16SurrSelf = rune(0x10000)
+
+// quote should be either `'` or `"`
+func (di *diagnose) encodeTextString(val string, quote byte) error {
+ di.w.WriteByte(quote)
+
+ for i := 0; i < len(val); {
+ if b := val[i]; b < utf8.RuneSelf {
+ switch {
+ case b == '\t', b == '\n', b == '\r', b == '\\', b == quote:
+ di.w.WriteByte('\\')
+
+ switch b {
+ case '\t':
+ b = 't'
+ case '\n':
+ b = 'n'
+ case '\r':
+ b = 'r'
+ }
+ di.w.WriteByte(b)
+
+ case b >= ' ' && b <= '~':
+ di.w.WriteByte(b)
+
+ default:
+ di.writeU16(rune(b))
+ }
+
+ i++
+ continue
+ }
+
+ c, size := utf8.DecodeRuneInString(val[i:])
+ switch {
+ case c == utf8.RuneError:
+ return &SemanticError{"cbor: invalid UTF-8 string"}
+
+ case c < utf16SurrSelf:
+ di.writeU16(c)
+
+ default:
+ c1, c2 := utf16.EncodeRune(c)
+ di.writeU16(c1)
+ di.writeU16(c2)
+ }
+
+ i += size
+ }
+
+ di.w.WriteByte(quote)
+ return nil
+}
+
+func (di *diagnose) encodeFloat(ai byte, val uint64) error {
+ f64 := float64(0)
+ switch ai {
+ case additionalInformationAsFloat16:
+ f16 := float16.Frombits(uint16(val))
+ switch {
+ case f16.IsNaN():
+ di.w.WriteString("NaN")
+ return nil
+ case f16.IsInf(1):
+ di.w.WriteString("Infinity")
+ return nil
+ case f16.IsInf(-1):
+ di.w.WriteString("-Infinity")
+ return nil
+ default:
+ f64 = float64(f16.Float32())
+ }
+
+ case additionalInformationAsFloat32:
+ f32 := math.Float32frombits(uint32(val))
+ switch {
+ case f32 != f32:
+ di.w.WriteString("NaN")
+ return nil
+ case f32 > math.MaxFloat32:
+ di.w.WriteString("Infinity")
+ return nil
+ case f32 < -math.MaxFloat32:
+ di.w.WriteString("-Infinity")
+ return nil
+ default:
+ f64 = float64(f32)
+ }
+
+ case additionalInformationAsFloat64:
+ f64 = math.Float64frombits(val)
+ switch {
+ case f64 != f64:
+ di.w.WriteString("NaN")
+ return nil
+ case f64 > math.MaxFloat64:
+ di.w.WriteString("Infinity")
+ return nil
+ case f64 < -math.MaxFloat64:
+ di.w.WriteString("-Infinity")
+ return nil
+ }
+ }
+ // Use ES6 number to string conversion which should match most JSON generators.
+ // Inspired by https://github.com/golang/go/blob/4df10fba1687a6d4f51d7238a403f8f2298f6a16/src/encoding/json/encode.go#L585
+ const bitSize = 64
+ b := make([]byte, 0, 32)
+ if abs := math.Abs(f64); abs != 0 && (abs < 1e-6 || abs >= 1e21) {
+ b = strconv.AppendFloat(b, f64, 'e', -1, bitSize)
+ // clean up e-09 to e-9
+ n := len(b)
+ if n >= 4 && string(b[n-4:n-1]) == "e-0" {
+ b = append(b[:n-2], b[n-1])
+ }
+ } else {
+ b = strconv.AppendFloat(b, f64, 'f', -1, bitSize)
+ }
+
+ // add decimal point and trailing zero if needed
+ if bytes.IndexByte(b, '.') < 0 {
+ if i := bytes.IndexByte(b, 'e'); i < 0 {
+ b = append(b, '.', '0')
+ } else {
+ b = append(b[:i+2], b[i:]...)
+ b[i] = '.'
+ b[i+1] = '0'
+ }
+ }
+
+ di.w.WriteString(string(b))
+
+ if di.dm.floatPrecisionIndicator {
+ switch ai {
+ case additionalInformationAsFloat16:
+ di.w.WriteString("_1")
+ return nil
+
+ case additionalInformationAsFloat32:
+ di.w.WriteString("_2")
+ return nil
+
+ case additionalInformationAsFloat64:
+ di.w.WriteString("_3")
+ return nil
+ }
+ }
+
+ return nil
+}
diff --git a/vendor/github.com/fxamacker/cbor/v2/doc.go b/vendor/github.com/fxamacker/cbor/v2/doc.go
new file mode 100644
index 00000000..23f68b98
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/doc.go
@@ -0,0 +1,129 @@
+// Copyright (c) Faye Amacker. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+/*
+Package cbor is a modern CBOR codec (RFC 8949 & RFC 7049) with CBOR tags,
+Go struct tags (toarray/keyasint/omitempty), Core Deterministic Encoding,
+CTAP2, Canonical CBOR, float64->32->16, and duplicate map key detection.
+
+Encoding options allow "preferred serialization" by encoding integers and floats
+to their smallest forms (e.g. float16) when values fit.
+
+Struct tags like "keyasint", "toarray" and "omitempty" make CBOR data smaller
+and easier to use with structs.
+
+For example, "toarray" tag makes struct fields encode to CBOR array elements. And
+"keyasint" makes a field encode to an element of CBOR map with specified int key.
+
+Latest docs can be viewed at https://github.com/fxamacker/cbor#cbor-library-in-go
+
+# Basics
+
+The Quick Start guide is at https://github.com/fxamacker/cbor#quick-start
+
+Function signatures identical to encoding/json include:
+
+ Marshal, Unmarshal, NewEncoder, NewDecoder, (*Encoder).Encode, (*Decoder).Decode.
+
+Standard interfaces include:
+
+ BinaryMarshaler, BinaryUnmarshaler, Marshaler, and Unmarshaler.
+
+Custom encoding and decoding is possible by implementing standard interfaces for
+user-defined Go types.
+
+Codec functions are available at package-level (using defaults options) or by
+creating modes from options at runtime.
+
+"Mode" in this API means definite way of encoding (EncMode) or decoding (DecMode).
+
+EncMode and DecMode interfaces are created from EncOptions or DecOptions structs.
+
+ em, err := cbor.EncOptions{...}.EncMode()
+ em, err := cbor.CanonicalEncOptions().EncMode()
+ em, err := cbor.CTAP2EncOptions().EncMode()
+
+Modes use immutable options to avoid side-effects and simplify concurrency. Behavior of
+modes won't accidentally change at runtime after they're created.
+
+Modes are intended to be reused and are safe for concurrent use.
+
+EncMode and DecMode Interfaces
+
+ // EncMode interface uses immutable options and is safe for concurrent use.
+ type EncMode interface {
+ Marshal(v interface{}) ([]byte, error)
+ NewEncoder(w io.Writer) *Encoder
+ EncOptions() EncOptions // returns copy of options
+ }
+
+ // DecMode interface uses immutable options and is safe for concurrent use.
+ type DecMode interface {
+ Unmarshal(data []byte, v interface{}) error
+ NewDecoder(r io.Reader) *Decoder
+ DecOptions() DecOptions // returns copy of options
+ }
+
+Using Default Encoding Mode
+
+ b, err := cbor.Marshal(v)
+
+ encoder := cbor.NewEncoder(w)
+ err = encoder.Encode(v)
+
+Using Default Decoding Mode
+
+ err := cbor.Unmarshal(b, &v)
+
+ decoder := cbor.NewDecoder(r)
+ err = decoder.Decode(&v)
+
+Creating and Using Encoding Modes
+
+ // Create EncOptions using either struct literal or a function.
+ opts := cbor.CanonicalEncOptions()
+
+ // If needed, modify encoding options
+ opts.Time = cbor.TimeUnix
+
+ // Create reusable EncMode interface with immutable options, safe for concurrent use.
+ em, err := opts.EncMode()
+
+ // Use EncMode like encoding/json, with same function signatures.
+ b, err := em.Marshal(v)
+ // or
+ encoder := em.NewEncoder(w)
+ err := encoder.Encode(v)
+
+ // NOTE: Both em.Marshal(v) and encoder.Encode(v) use encoding options
+ // specified during creation of em (encoding mode).
+
+# CBOR Options
+
+Predefined Encoding Options: https://github.com/fxamacker/cbor#predefined-encoding-options
+
+Encoding Options: https://github.com/fxamacker/cbor#encoding-options
+
+Decoding Options: https://github.com/fxamacker/cbor#decoding-options
+
+# Struct Tags
+
+Struct tags like `cbor:"name,omitempty"` and `json:"name,omitempty"` work as expected.
+If both struct tags are specified then `cbor` is used.
+
+Struct tags like "keyasint", "toarray", and "omitempty" make it easy to use
+very compact formats like COSE and CWT (CBOR Web Tokens) with structs.
+
+For example, "toarray" makes struct fields encode to array elements. And "keyasint"
+makes struct fields encode to elements of CBOR map with int keys.
+
+https://raw.githubusercontent.com/fxamacker/images/master/cbor/v2.0.0/cbor_easy_api.png
+
+Struct tags are listed at https://github.com/fxamacker/cbor#struct-tags-1
+
+# Tests and Fuzzing
+
+Over 375 tests are included in this package. Cover-guided fuzzing is handled by
+a private fuzzer that replaced fxamacker/cbor-fuzz years ago.
+*/
+package cbor
diff --git a/vendor/github.com/fxamacker/cbor/v2/encode.go b/vendor/github.com/fxamacker/cbor/v2/encode.go
new file mode 100644
index 00000000..6508e291
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/encode.go
@@ -0,0 +1,1989 @@
+// Copyright (c) Faye Amacker. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+package cbor
+
+import (
+ "bytes"
+ "encoding"
+ "encoding/binary"
+ "errors"
+ "fmt"
+ "io"
+ "math"
+ "math/big"
+ "math/rand"
+ "reflect"
+ "sort"
+ "strconv"
+ "sync"
+ "time"
+
+ "github.com/x448/float16"
+)
+
+// Marshal returns the CBOR encoding of v using default encoding options.
+// See EncOptions for encoding options.
+//
+// Marshal uses the following encoding rules:
+//
+// If value implements the Marshaler interface, Marshal calls its
+// MarshalCBOR method.
+//
+// If value implements encoding.BinaryMarshaler, Marhsal calls its
+// MarshalBinary method and encode it as CBOR byte string.
+//
+// Boolean values encode as CBOR booleans (type 7).
+//
+// Positive integer values encode as CBOR positive integers (type 0).
+//
+// Negative integer values encode as CBOR negative integers (type 1).
+//
+// Floating point values encode as CBOR floating points (type 7).
+//
+// String values encode as CBOR text strings (type 3).
+//
+// []byte values encode as CBOR byte strings (type 2).
+//
+// Array and slice values encode as CBOR arrays (type 4).
+//
+// Map values encode as CBOR maps (type 5).
+//
+// Struct values encode as CBOR maps (type 5). Each exported struct field
+// becomes a pair with field name encoded as CBOR text string (type 3) and
+// field value encoded based on its type. See struct tag option "keyasint"
+// to encode field name as CBOR integer (type 0 and 1). Also see struct
+// tag option "toarray" for special field "_" to encode struct values as
+// CBOR array (type 4).
+//
+// Marshal supports format string stored under the "cbor" key in the struct
+// field's tag. CBOR format string can specify the name of the field,
+// "omitempty" and "keyasint" options, and special case "-" for field omission.
+// If "cbor" key is absent, Marshal uses "json" key.
+//
+// Struct field name is treated as integer if it has "keyasint" option in
+// its format string. The format string must specify an integer as its
+// field name.
+//
+// Special struct field "_" is used to specify struct level options, such as
+// "toarray". "toarray" option enables Go struct to be encoded as CBOR array.
+// "omitempty" is disabled by "toarray" to ensure that the same number
+// of elements are encoded every time.
+//
+// Anonymous struct fields are marshaled as if their exported fields
+// were fields in the outer struct. Marshal follows the same struct fields
+// visibility rules used by JSON encoding package.
+//
+// time.Time values encode as text strings specified in RFC3339 or numerical
+// representation of seconds since January 1, 1970 UTC depending on
+// EncOptions.Time setting. Also See EncOptions.TimeTag to encode
+// time.Time as CBOR tag with tag number 0 or 1.
+//
+// big.Int values encode as CBOR integers (type 0 and 1) if values fit.
+// Otherwise, big.Int values encode as CBOR bignums (tag 2 and 3). See
+// EncOptions.BigIntConvert to always encode big.Int values as CBOR
+// bignums.
+//
+// Pointer values encode as the value pointed to.
+//
+// Interface values encode as the value stored in the interface.
+//
+// Nil slice/map/pointer/interface values encode as CBOR nulls (type 7).
+//
+// Values of other types cannot be encoded in CBOR. Attempting
+// to encode such a value causes Marshal to return an UnsupportedTypeError.
+func Marshal(v interface{}) ([]byte, error) {
+ return defaultEncMode.Marshal(v)
+}
+
+// MarshalToBuffer encodes v into provided buffer (instead of using built-in buffer pool)
+// and uses default encoding options.
+//
+// NOTE: Unlike Marshal, the buffer provided to MarshalToBuffer can contain
+// partially encoded data if error is returned.
+//
+// See Marshal for more details.
+func MarshalToBuffer(v interface{}, buf *bytes.Buffer) error {
+ return defaultEncMode.MarshalToBuffer(v, buf)
+}
+
+// Marshaler is the interface implemented by types that can marshal themselves
+// into valid CBOR.
+type Marshaler interface {
+ MarshalCBOR() ([]byte, error)
+}
+
+// MarshalerError represents error from checking encoded CBOR data item
+// returned from MarshalCBOR for well-formedness and some very limited tag validation.
+type MarshalerError struct {
+ typ reflect.Type
+ err error
+}
+
+func (e *MarshalerError) Error() string {
+ return "cbor: error calling MarshalCBOR for type " +
+ e.typ.String() +
+ ": " + e.err.Error()
+}
+
+func (e *MarshalerError) Unwrap() error {
+ return e.err
+}
+
+// UnsupportedTypeError is returned by Marshal when attempting to encode value
+// of an unsupported type.
+type UnsupportedTypeError struct {
+ Type reflect.Type
+}
+
+func (e *UnsupportedTypeError) Error() string {
+ return "cbor: unsupported type: " + e.Type.String()
+}
+
+// UnsupportedValueError is returned by Marshal when attempting to encode an
+// unsupported value.
+type UnsupportedValueError struct {
+ msg string
+}
+
+func (e *UnsupportedValueError) Error() string {
+ return "cbor: unsupported value: " + e.msg
+}
+
+// SortMode identifies supported sorting order.
+type SortMode int
+
+const (
+ // SortNone encodes map pairs and struct fields in an arbitrary order.
+ SortNone SortMode = 0
+
+ // SortLengthFirst causes map keys or struct fields to be sorted such that:
+ // - If two keys have different lengths, the shorter one sorts earlier;
+ // - If two keys have the same length, the one with the lower value in
+ // (byte-wise) lexical order sorts earlier.
+ // It is used in "Canonical CBOR" encoding in RFC 7049 3.9.
+ SortLengthFirst SortMode = 1
+
+ // SortBytewiseLexical causes map keys or struct fields to be sorted in the
+ // bytewise lexicographic order of their deterministic CBOR encodings.
+ // It is used in "CTAP2 Canonical CBOR" and "Core Deterministic Encoding"
+ // in RFC 7049bis.
+ SortBytewiseLexical SortMode = 2
+
+ // SortShuffle encodes map pairs and struct fields in a shuffled
+ // order. This mode does not guarantee an unbiased permutation, but it
+ // does guarantee that the runtime of the shuffle algorithm used will be
+ // constant.
+ SortFastShuffle SortMode = 3
+
+ // SortCanonical is used in "Canonical CBOR" encoding in RFC 7049 3.9.
+ SortCanonical SortMode = SortLengthFirst
+
+ // SortCTAP2 is used in "CTAP2 Canonical CBOR".
+ SortCTAP2 SortMode = SortBytewiseLexical
+
+ // SortCoreDeterministic is used in "Core Deterministic Encoding" in RFC 7049bis.
+ SortCoreDeterministic SortMode = SortBytewiseLexical
+
+ maxSortMode SortMode = 4
+)
+
+func (sm SortMode) valid() bool {
+ return sm >= 0 && sm < maxSortMode
+}
+
+// StringMode specifies how to encode Go string values.
+type StringMode int
+
+const (
+ // StringToTextString encodes Go string to CBOR text string (major type 3).
+ StringToTextString StringMode = iota
+
+ // StringToByteString encodes Go string to CBOR byte string (major type 2).
+ StringToByteString
+)
+
+func (st StringMode) cborType() (cborType, error) {
+ switch st {
+ case StringToTextString:
+ return cborTypeTextString, nil
+
+ case StringToByteString:
+ return cborTypeByteString, nil
+ }
+ return 0, errors.New("cbor: invalid StringType " + strconv.Itoa(int(st)))
+}
+
+// ShortestFloatMode specifies which floating-point format should
+// be used as the shortest possible format for CBOR encoding.
+// It is not used for encoding Infinity and NaN values.
+type ShortestFloatMode int
+
+const (
+ // ShortestFloatNone makes float values encode without any conversion.
+ // This is the default for ShortestFloatMode in v1.
+ // E.g. a float32 in Go will encode to CBOR float32. And
+ // a float64 in Go will encode to CBOR float64.
+ ShortestFloatNone ShortestFloatMode = iota
+
+ // ShortestFloat16 specifies float16 as the shortest form that preserves value.
+ // E.g. if float64 can convert to float32 while preserving value, then
+ // encoding will also try to convert float32 to float16. So a float64 might
+ // encode as CBOR float64, float32 or float16 depending on the value.
+ ShortestFloat16
+
+ maxShortestFloat
+)
+
+func (sfm ShortestFloatMode) valid() bool {
+ return sfm >= 0 && sfm < maxShortestFloat
+}
+
+// NaNConvertMode specifies how to encode NaN and overrides ShortestFloatMode.
+// ShortestFloatMode is not used for encoding Infinity and NaN values.
+type NaNConvertMode int
+
+const (
+ // NaNConvert7e00 always encodes NaN to 0xf97e00 (CBOR float16 = 0x7e00).
+ NaNConvert7e00 NaNConvertMode = iota
+
+ // NaNConvertNone never modifies or converts NaN to other representations
+ // (float64 NaN stays float64, etc. even if it can use float16 without losing
+ // any bits).
+ NaNConvertNone
+
+ // NaNConvertPreserveSignal converts NaN to the smallest form that preserves
+ // value (quiet bit + payload) as described in RFC 7049bis Draft 12.
+ NaNConvertPreserveSignal
+
+ // NaNConvertQuiet always forces quiet bit = 1 and shortest form that preserves
+ // NaN payload.
+ NaNConvertQuiet
+
+ // NaNConvertReject returns UnsupportedValueError on attempts to encode a NaN value.
+ NaNConvertReject
+
+ maxNaNConvert
+)
+
+func (ncm NaNConvertMode) valid() bool {
+ return ncm >= 0 && ncm < maxNaNConvert
+}
+
+// InfConvertMode specifies how to encode Infinity and overrides ShortestFloatMode.
+// ShortestFloatMode is not used for encoding Infinity and NaN values.
+type InfConvertMode int
+
+const (
+ // InfConvertFloat16 always converts Inf to lossless IEEE binary16 (float16).
+ InfConvertFloat16 InfConvertMode = iota
+
+ // InfConvertNone never converts (used by CTAP2 Canonical CBOR).
+ InfConvertNone
+
+ // InfConvertReject returns UnsupportedValueError on attempts to encode an infinite value.
+ InfConvertReject
+
+ maxInfConvert
+)
+
+func (icm InfConvertMode) valid() bool {
+ return icm >= 0 && icm < maxInfConvert
+}
+
+// TimeMode specifies how to encode time.Time values.
+type TimeMode int
+
+const (
+ // TimeUnix causes time.Time to be encoded as epoch time in integer with second precision.
+ TimeUnix TimeMode = iota
+
+ // TimeUnixMicro causes time.Time to be encoded as epoch time in float-point rounded to microsecond precision.
+ TimeUnixMicro
+
+ // TimeUnixDynamic causes time.Time to be encoded as integer if time.Time doesn't have fractional seconds,
+ // otherwise float-point rounded to microsecond precision.
+ TimeUnixDynamic
+
+ // TimeRFC3339 causes time.Time to be encoded as RFC3339 formatted string with second precision.
+ TimeRFC3339
+
+ // TimeRFC3339Nano causes time.Time to be encoded as RFC3339 formatted string with nanosecond precision.
+ TimeRFC3339Nano
+
+ maxTimeMode
+)
+
+func (tm TimeMode) valid() bool {
+ return tm >= 0 && tm < maxTimeMode
+}
+
+// BigIntConvertMode specifies how to encode big.Int values.
+type BigIntConvertMode int
+
+const (
+ // BigIntConvertShortest makes big.Int encode to CBOR integer if value fits.
+ // E.g. if big.Int value can be converted to CBOR integer while preserving
+ // value, encoder will encode it to CBOR integer (major type 0 or 1).
+ BigIntConvertShortest BigIntConvertMode = iota
+
+ // BigIntConvertNone makes big.Int encode to CBOR bignum (tag 2 or 3) without
+ // converting it to another CBOR type.
+ BigIntConvertNone
+
+ // BigIntConvertReject returns an UnsupportedTypeError instead of marshaling a big.Int.
+ BigIntConvertReject
+
+ maxBigIntConvert
+)
+
+func (bim BigIntConvertMode) valid() bool {
+ return bim >= 0 && bim < maxBigIntConvert
+}
+
+// NilContainersMode specifies how to encode nil slices and maps.
+type NilContainersMode int
+
+const (
+ // NilContainerAsNull encodes nil slices and maps as CBOR null.
+ // This is the default.
+ NilContainerAsNull NilContainersMode = iota
+
+ // NilContainerAsEmpty encodes nil slices and maps as
+ // empty container (CBOR bytestring, array, or map).
+ NilContainerAsEmpty
+
+ maxNilContainersMode
+)
+
+func (m NilContainersMode) valid() bool {
+ return m >= 0 && m < maxNilContainersMode
+}
+
+// OmitEmptyMode specifies how to encode struct fields with omitempty tag.
+// The default behavior omits if field value would encode as empty CBOR value.
+type OmitEmptyMode int
+
+const (
+ // OmitEmptyCBORValue specifies that struct fields tagged with "omitempty"
+ // should be omitted from encoding if the field would be encoded as an empty
+ // CBOR value, such as CBOR false, 0, 0.0, nil, empty byte, empty string,
+ // empty array, or empty map.
+ OmitEmptyCBORValue OmitEmptyMode = iota
+
+ // OmitEmptyGoValue specifies that struct fields tagged with "omitempty"
+ // should be omitted from encoding if the field has an empty Go value,
+ // defined as false, 0, 0.0, a nil pointer, a nil interface value, and
+ // any empty array, slice, map, or string.
+ // This behavior is the same as the current (aka v1) encoding/json package
+ // included in Go.
+ OmitEmptyGoValue
+
+ maxOmitEmptyMode
+)
+
+func (om OmitEmptyMode) valid() bool {
+ return om >= 0 && om < maxOmitEmptyMode
+}
+
+// FieldNameMode specifies the CBOR type to use when encoding struct field names.
+type FieldNameMode int
+
+const (
+ // FieldNameToTextString encodes struct fields to CBOR text string (major type 3).
+ FieldNameToTextString FieldNameMode = iota
+
+ // FieldNameToTextString encodes struct fields to CBOR byte string (major type 2).
+ FieldNameToByteString
+
+ maxFieldNameMode
+)
+
+func (fnm FieldNameMode) valid() bool {
+ return fnm >= 0 && fnm < maxFieldNameMode
+}
+
+// ByteSliceLaterFormatMode specifies which later format conversion hint (CBOR tag 21-23)
+// to include (if any) when encoding Go byte slice to CBOR byte string. The encoder will
+// always encode unmodified bytes from the byte slice and just wrap it within
+// CBOR tag 21, 22, or 23 if specified.
+// See "Expected Later Encoding for CBOR-to-JSON Converters" in RFC 8949 Section 3.4.5.2.
+type ByteSliceLaterFormatMode int
+
+const (
+ // ByteSliceLaterFormatNone encodes unmodified bytes from Go byte slice to CBOR byte string (major type 2)
+ // without adding CBOR tag 21, 22, or 23.
+ ByteSliceLaterFormatNone ByteSliceLaterFormatMode = iota
+
+ // ByteSliceLaterFormatBase64URL encodes unmodified bytes from Go byte slice to CBOR byte string (major type 2)
+ // inside CBOR tag 21 (expected later conversion to base64url encoding, see RFC 8949 Section 3.4.5.2).
+ ByteSliceLaterFormatBase64URL
+
+ // ByteSliceLaterFormatBase64 encodes unmodified bytes from Go byte slice to CBOR byte string (major type 2)
+ // inside CBOR tag 22 (expected later conversion to base64 encoding, see RFC 8949 Section 3.4.5.2).
+ ByteSliceLaterFormatBase64
+
+ // ByteSliceLaterFormatBase16 encodes unmodified bytes from Go byte slice to CBOR byte string (major type 2)
+ // inside CBOR tag 23 (expected later conversion to base16 encoding, see RFC 8949 Section 3.4.5.2).
+ ByteSliceLaterFormatBase16
+)
+
+func (bsefm ByteSliceLaterFormatMode) encodingTag() (uint64, error) {
+ switch bsefm {
+ case ByteSliceLaterFormatNone:
+ return 0, nil
+
+ case ByteSliceLaterFormatBase64URL:
+ return tagNumExpectedLaterEncodingBase64URL, nil
+
+ case ByteSliceLaterFormatBase64:
+ return tagNumExpectedLaterEncodingBase64, nil
+
+ case ByteSliceLaterFormatBase16:
+ return tagNumExpectedLaterEncodingBase16, nil
+ }
+ return 0, errors.New("cbor: invalid ByteSliceLaterFormat " + strconv.Itoa(int(bsefm)))
+}
+
+// ByteArrayMode specifies how to encode byte arrays.
+type ByteArrayMode int
+
+const (
+ // ByteArrayToByteSlice encodes byte arrays the same way that a byte slice with identical
+ // length and contents is encoded.
+ ByteArrayToByteSlice ByteArrayMode = iota
+
+ // ByteArrayToArray encodes byte arrays to the CBOR array type with one unsigned integer
+ // item for each byte in the array.
+ ByteArrayToArray
+
+ maxByteArrayMode
+)
+
+func (bam ByteArrayMode) valid() bool {
+ return bam >= 0 && bam < maxByteArrayMode
+}
+
+// BinaryMarshalerMode specifies how to encode types that implement encoding.BinaryMarshaler.
+type BinaryMarshalerMode int
+
+const (
+ // BinaryMarshalerByteString encodes the output of MarshalBinary to a CBOR byte string.
+ BinaryMarshalerByteString BinaryMarshalerMode = iota
+
+ // BinaryMarshalerNone does not recognize BinaryMarshaler implementations during encode.
+ BinaryMarshalerNone
+
+ maxBinaryMarshalerMode
+)
+
+func (bmm BinaryMarshalerMode) valid() bool {
+ return bmm >= 0 && bmm < maxBinaryMarshalerMode
+}
+
+// EncOptions specifies encoding options.
+type EncOptions struct {
+ // Sort specifies sorting order.
+ Sort SortMode
+
+ // ShortestFloat specifies the shortest floating-point encoding that preserves
+ // the value being encoded.
+ ShortestFloat ShortestFloatMode
+
+ // NaNConvert specifies how to encode NaN and it overrides ShortestFloatMode.
+ NaNConvert NaNConvertMode
+
+ // InfConvert specifies how to encode Inf and it overrides ShortestFloatMode.
+ InfConvert InfConvertMode
+
+ // BigIntConvert specifies how to encode big.Int values.
+ BigIntConvert BigIntConvertMode
+
+ // Time specifies how to encode time.Time.
+ Time TimeMode
+
+ // TimeTag allows time.Time to be encoded with a tag number.
+ // RFC3339 format gets tag number 0, and numeric epoch time tag number 1.
+ TimeTag EncTagMode
+
+ // IndefLength specifies whether to allow indefinite length CBOR items.
+ IndefLength IndefLengthMode
+
+ // NilContainers specifies how to encode nil slices and maps.
+ NilContainers NilContainersMode
+
+ // TagsMd specifies whether to allow CBOR tags (major type 6).
+ TagsMd TagsMode
+
+ // OmitEmptyMode specifies how to encode struct fields with omitempty tag.
+ OmitEmpty OmitEmptyMode
+
+ // String specifies which CBOR type to use when encoding Go strings.
+ // - CBOR text string (major type 3) is default
+ // - CBOR byte string (major type 2)
+ String StringMode
+
+ // FieldName specifies the CBOR type to use when encoding struct field names.
+ FieldName FieldNameMode
+
+ // ByteSliceLaterFormat specifies which later format conversion hint (CBOR tag 21-23)
+ // to include (if any) when encoding Go byte slice to CBOR byte string. The encoder will
+ // always encode unmodified bytes from the byte slice and just wrap it within
+ // CBOR tag 21, 22, or 23 if specified.
+ // See "Expected Later Encoding for CBOR-to-JSON Converters" in RFC 8949 Section 3.4.5.2.
+ ByteSliceLaterFormat ByteSliceLaterFormatMode
+
+ // ByteArray specifies how to encode byte arrays.
+ ByteArray ByteArrayMode
+
+ // BinaryMarshaler specifies how to encode types that implement encoding.BinaryMarshaler.
+ BinaryMarshaler BinaryMarshalerMode
+}
+
+// CanonicalEncOptions returns EncOptions for "Canonical CBOR" encoding,
+// defined in RFC 7049 Section 3.9 with the following rules:
+//
+// 1. "Integers must be as small as possible."
+// 2. "The expression of lengths in major types 2 through 5 must be as short as possible."
+// 3. The keys in every map must be sorted in length-first sorting order.
+// See SortLengthFirst for details.
+// 4. "Indefinite-length items must be made into definite-length items."
+// 5. "If a protocol allows for IEEE floats, then additional canonicalization rules might
+// need to be added. One example rule might be to have all floats start as a 64-bit
+// float, then do a test conversion to a 32-bit float; if the result is the same numeric
+// value, use the shorter value and repeat the process with a test conversion to a
+// 16-bit float. (This rule selects 16-bit float for positive and negative Infinity
+// as well.) Also, there are many representations for NaN. If NaN is an allowed value,
+// it must always be represented as 0xf97e00."
+func CanonicalEncOptions() EncOptions {
+ return EncOptions{
+ Sort: SortCanonical,
+ ShortestFloat: ShortestFloat16,
+ NaNConvert: NaNConvert7e00,
+ InfConvert: InfConvertFloat16,
+ IndefLength: IndefLengthForbidden,
+ }
+}
+
+// CTAP2EncOptions returns EncOptions for "CTAP2 Canonical CBOR" encoding,
+// defined in CTAP specification, with the following rules:
+//
+// 1. "Integers must be encoded as small as possible."
+// 2. "The representations of any floating-point values are not changed."
+// 3. "The expression of lengths in major types 2 through 5 must be as short as possible."
+// 4. "Indefinite-length items must be made into definite-length items.""
+// 5. The keys in every map must be sorted in bytewise lexicographic order.
+// See SortBytewiseLexical for details.
+// 6. "Tags as defined in Section 2.4 in [RFC7049] MUST NOT be present."
+func CTAP2EncOptions() EncOptions {
+ return EncOptions{
+ Sort: SortCTAP2,
+ ShortestFloat: ShortestFloatNone,
+ NaNConvert: NaNConvertNone,
+ InfConvert: InfConvertNone,
+ IndefLength: IndefLengthForbidden,
+ TagsMd: TagsForbidden,
+ }
+}
+
+// CoreDetEncOptions returns EncOptions for "Core Deterministic" encoding,
+// defined in RFC 7049bis with the following rules:
+//
+// 1. "Preferred serialization MUST be used. In particular, this means that arguments
+// (see Section 3) for integers, lengths in major types 2 through 5, and tags MUST
+// be as short as possible"
+// "Floating point values also MUST use the shortest form that preserves the value"
+// 2. "Indefinite-length items MUST NOT appear."
+// 3. "The keys in every map MUST be sorted in the bytewise lexicographic order of
+// their deterministic encodings."
+func CoreDetEncOptions() EncOptions {
+ return EncOptions{
+ Sort: SortCoreDeterministic,
+ ShortestFloat: ShortestFloat16,
+ NaNConvert: NaNConvert7e00,
+ InfConvert: InfConvertFloat16,
+ IndefLength: IndefLengthForbidden,
+ }
+}
+
+// PreferredUnsortedEncOptions returns EncOptions for "Preferred Serialization" encoding,
+// defined in RFC 7049bis with the following rules:
+//
+// 1. "The preferred serialization always uses the shortest form of representing the argument
+// (Section 3);"
+// 2. "it also uses the shortest floating-point encoding that preserves the value being
+// encoded (see Section 5.5)."
+// "The preferred encoding for a floating-point value is the shortest floating-point encoding
+// that preserves its value, e.g., 0xf94580 for the number 5.5, and 0xfa45ad9c00 for the
+// number 5555.5, unless the CBOR-based protocol specifically excludes the use of the shorter
+// floating-point encodings. For NaN values, a shorter encoding is preferred if zero-padding
+// the shorter significand towards the right reconstitutes the original NaN value (for many
+// applications, the single NaN encoding 0xf97e00 will suffice)."
+// 3. "Definite length encoding is preferred whenever the length is known at the time the
+// serialization of the item starts."
+func PreferredUnsortedEncOptions() EncOptions {
+ return EncOptions{
+ Sort: SortNone,
+ ShortestFloat: ShortestFloat16,
+ NaNConvert: NaNConvert7e00,
+ InfConvert: InfConvertFloat16,
+ }
+}
+
+// EncMode returns EncMode with immutable options and no tags (safe for concurrency).
+func (opts EncOptions) EncMode() (EncMode, error) { //nolint:gocritic // ignore hugeParam
+ return opts.encMode()
+}
+
+// UserBufferEncMode returns UserBufferEncMode with immutable options and no tags (safe for concurrency).
+func (opts EncOptions) UserBufferEncMode() (UserBufferEncMode, error) { //nolint:gocritic // ignore hugeParam
+ return opts.encMode()
+}
+
+// EncModeWithTags returns EncMode with options and tags that are both immutable (safe for concurrency).
+func (opts EncOptions) EncModeWithTags(tags TagSet) (EncMode, error) { //nolint:gocritic // ignore hugeParam
+ return opts.UserBufferEncModeWithTags(tags)
+}
+
+// UserBufferEncModeWithTags returns UserBufferEncMode with options and tags that are both immutable (safe for concurrency).
+func (opts EncOptions) UserBufferEncModeWithTags(tags TagSet) (UserBufferEncMode, error) { //nolint:gocritic // ignore hugeParam
+ if opts.TagsMd == TagsForbidden {
+ return nil, errors.New("cbor: cannot create EncMode with TagSet when TagsMd is TagsForbidden")
+ }
+ if tags == nil {
+ return nil, errors.New("cbor: cannot create EncMode with nil value as TagSet")
+ }
+ em, err := opts.encMode()
+ if err != nil {
+ return nil, err
+ }
+ // Copy tags
+ ts := tagSet(make(map[reflect.Type]*tagItem))
+ syncTags := tags.(*syncTagSet)
+ syncTags.RLock()
+ for contentType, tag := range syncTags.t {
+ if tag.opts.EncTag != EncTagNone {
+ ts[contentType] = tag
+ }
+ }
+ syncTags.RUnlock()
+ if len(ts) > 0 {
+ em.tags = ts
+ }
+ return em, nil
+}
+
+// EncModeWithSharedTags returns EncMode with immutable options and mutable shared tags (safe for concurrency).
+func (opts EncOptions) EncModeWithSharedTags(tags TagSet) (EncMode, error) { //nolint:gocritic // ignore hugeParam
+ return opts.UserBufferEncModeWithSharedTags(tags)
+}
+
+// UserBufferEncModeWithSharedTags returns UserBufferEncMode with immutable options and mutable shared tags (safe for concurrency).
+func (opts EncOptions) UserBufferEncModeWithSharedTags(tags TagSet) (UserBufferEncMode, error) { //nolint:gocritic // ignore hugeParam
+ if opts.TagsMd == TagsForbidden {
+ return nil, errors.New("cbor: cannot create EncMode with TagSet when TagsMd is TagsForbidden")
+ }
+ if tags == nil {
+ return nil, errors.New("cbor: cannot create EncMode with nil value as TagSet")
+ }
+ em, err := opts.encMode()
+ if err != nil {
+ return nil, err
+ }
+ em.tags = tags
+ return em, nil
+}
+
+func (opts EncOptions) encMode() (*encMode, error) { //nolint:gocritic // ignore hugeParam
+ if !opts.Sort.valid() {
+ return nil, errors.New("cbor: invalid SortMode " + strconv.Itoa(int(opts.Sort)))
+ }
+ if !opts.ShortestFloat.valid() {
+ return nil, errors.New("cbor: invalid ShortestFloatMode " + strconv.Itoa(int(opts.ShortestFloat)))
+ }
+ if !opts.NaNConvert.valid() {
+ return nil, errors.New("cbor: invalid NaNConvertMode " + strconv.Itoa(int(opts.NaNConvert)))
+ }
+ if !opts.InfConvert.valid() {
+ return nil, errors.New("cbor: invalid InfConvertMode " + strconv.Itoa(int(opts.InfConvert)))
+ }
+ if !opts.BigIntConvert.valid() {
+ return nil, errors.New("cbor: invalid BigIntConvertMode " + strconv.Itoa(int(opts.BigIntConvert)))
+ }
+ if !opts.Time.valid() {
+ return nil, errors.New("cbor: invalid TimeMode " + strconv.Itoa(int(opts.Time)))
+ }
+ if !opts.TimeTag.valid() {
+ return nil, errors.New("cbor: invalid TimeTag " + strconv.Itoa(int(opts.TimeTag)))
+ }
+ if !opts.IndefLength.valid() {
+ return nil, errors.New("cbor: invalid IndefLength " + strconv.Itoa(int(opts.IndefLength)))
+ }
+ if !opts.NilContainers.valid() {
+ return nil, errors.New("cbor: invalid NilContainers " + strconv.Itoa(int(opts.NilContainers)))
+ }
+ if !opts.TagsMd.valid() {
+ return nil, errors.New("cbor: invalid TagsMd " + strconv.Itoa(int(opts.TagsMd)))
+ }
+ if opts.TagsMd == TagsForbidden && opts.TimeTag == EncTagRequired {
+ return nil, errors.New("cbor: cannot set TagsMd to TagsForbidden when TimeTag is EncTagRequired")
+ }
+ if !opts.OmitEmpty.valid() {
+ return nil, errors.New("cbor: invalid OmitEmpty " + strconv.Itoa(int(opts.OmitEmpty)))
+ }
+ stringMajorType, err := opts.String.cborType()
+ if err != nil {
+ return nil, err
+ }
+ if !opts.FieldName.valid() {
+ return nil, errors.New("cbor: invalid FieldName " + strconv.Itoa(int(opts.FieldName)))
+ }
+ byteSliceLaterEncodingTag, err := opts.ByteSliceLaterFormat.encodingTag()
+ if err != nil {
+ return nil, err
+ }
+ if !opts.ByteArray.valid() {
+ return nil, errors.New("cbor: invalid ByteArray " + strconv.Itoa(int(opts.ByteArray)))
+ }
+ if !opts.BinaryMarshaler.valid() {
+ return nil, errors.New("cbor: invalid BinaryMarshaler " + strconv.Itoa(int(opts.BinaryMarshaler)))
+ }
+ em := encMode{
+ sort: opts.Sort,
+ shortestFloat: opts.ShortestFloat,
+ nanConvert: opts.NaNConvert,
+ infConvert: opts.InfConvert,
+ bigIntConvert: opts.BigIntConvert,
+ time: opts.Time,
+ timeTag: opts.TimeTag,
+ indefLength: opts.IndefLength,
+ nilContainers: opts.NilContainers,
+ tagsMd: opts.TagsMd,
+ omitEmpty: opts.OmitEmpty,
+ stringType: opts.String,
+ stringMajorType: stringMajorType,
+ fieldName: opts.FieldName,
+ byteSliceLaterFormat: opts.ByteSliceLaterFormat,
+ byteSliceLaterEncodingTag: byteSliceLaterEncodingTag,
+ byteArray: opts.ByteArray,
+ binaryMarshaler: opts.BinaryMarshaler,
+ }
+ return &em, nil
+}
+
+// EncMode is the main interface for CBOR encoding.
+type EncMode interface {
+ Marshal(v interface{}) ([]byte, error)
+ NewEncoder(w io.Writer) *Encoder
+ EncOptions() EncOptions
+}
+
+// UserBufferEncMode is an interface for CBOR encoding, which extends EncMode by
+// adding MarshalToBuffer to support user specified buffer rather than encoding
+// into the built-in buffer pool.
+type UserBufferEncMode interface {
+ EncMode
+ MarshalToBuffer(v interface{}, buf *bytes.Buffer) error
+
+ // This private method is to prevent users implementing
+ // this interface and so future additions to it will
+ // not be breaking changes.
+ // See https://go.dev/blog/module-compatibility
+ unexport()
+}
+
+type encMode struct {
+ tags tagProvider
+ sort SortMode
+ shortestFloat ShortestFloatMode
+ nanConvert NaNConvertMode
+ infConvert InfConvertMode
+ bigIntConvert BigIntConvertMode
+ time TimeMode
+ timeTag EncTagMode
+ indefLength IndefLengthMode
+ nilContainers NilContainersMode
+ tagsMd TagsMode
+ omitEmpty OmitEmptyMode
+ stringType StringMode
+ stringMajorType cborType
+ fieldName FieldNameMode
+ byteSliceLaterFormat ByteSliceLaterFormatMode
+ byteSliceLaterEncodingTag uint64
+ byteArray ByteArrayMode
+ binaryMarshaler BinaryMarshalerMode
+}
+
+var defaultEncMode, _ = EncOptions{}.encMode()
+
+// These four decoding modes are used by getMarshalerDecMode.
+// maxNestedLevels, maxArrayElements, and maxMapPairs are
+// set to max allowed limits to avoid rejecting Marshaler
+// output that would have been the allowable output of a
+// non-Marshaler object that exceeds default limits.
+var (
+ marshalerForbidIndefLengthForbidTagsDecMode = decMode{
+ maxNestedLevels: maxMaxNestedLevels,
+ maxArrayElements: maxMaxArrayElements,
+ maxMapPairs: maxMaxMapPairs,
+ indefLength: IndefLengthForbidden,
+ tagsMd: TagsForbidden,
+ }
+
+ marshalerAllowIndefLengthForbidTagsDecMode = decMode{
+ maxNestedLevels: maxMaxNestedLevels,
+ maxArrayElements: maxMaxArrayElements,
+ maxMapPairs: maxMaxMapPairs,
+ indefLength: IndefLengthAllowed,
+ tagsMd: TagsForbidden,
+ }
+
+ marshalerForbidIndefLengthAllowTagsDecMode = decMode{
+ maxNestedLevels: maxMaxNestedLevels,
+ maxArrayElements: maxMaxArrayElements,
+ maxMapPairs: maxMaxMapPairs,
+ indefLength: IndefLengthForbidden,
+ tagsMd: TagsAllowed,
+ }
+
+ marshalerAllowIndefLengthAllowTagsDecMode = decMode{
+ maxNestedLevels: maxMaxNestedLevels,
+ maxArrayElements: maxMaxArrayElements,
+ maxMapPairs: maxMaxMapPairs,
+ indefLength: IndefLengthAllowed,
+ tagsMd: TagsAllowed,
+ }
+)
+
+// getMarshalerDecMode returns one of four existing decoding modes
+// which can be reused (safe for parallel use) for the purpose of
+// checking if data returned by Marshaler is well-formed.
+func getMarshalerDecMode(indefLength IndefLengthMode, tagsMd TagsMode) *decMode {
+ switch {
+ case indefLength == IndefLengthAllowed && tagsMd == TagsAllowed:
+ return &marshalerAllowIndefLengthAllowTagsDecMode
+
+ case indefLength == IndefLengthAllowed && tagsMd == TagsForbidden:
+ return &marshalerAllowIndefLengthForbidTagsDecMode
+
+ case indefLength == IndefLengthForbidden && tagsMd == TagsAllowed:
+ return &marshalerForbidIndefLengthAllowTagsDecMode
+
+ case indefLength == IndefLengthForbidden && tagsMd == TagsForbidden:
+ return &marshalerForbidIndefLengthForbidTagsDecMode
+
+ default:
+ // This should never happen, unless we add new options to
+ // IndefLengthMode or TagsMode without updating this function.
+ return &decMode{
+ maxNestedLevels: maxMaxNestedLevels,
+ maxArrayElements: maxMaxArrayElements,
+ maxMapPairs: maxMaxMapPairs,
+ indefLength: indefLength,
+ tagsMd: tagsMd,
+ }
+ }
+}
+
+// EncOptions returns user specified options used to create this EncMode.
+func (em *encMode) EncOptions() EncOptions {
+ return EncOptions{
+ Sort: em.sort,
+ ShortestFloat: em.shortestFloat,
+ NaNConvert: em.nanConvert,
+ InfConvert: em.infConvert,
+ BigIntConvert: em.bigIntConvert,
+ Time: em.time,
+ TimeTag: em.timeTag,
+ IndefLength: em.indefLength,
+ NilContainers: em.nilContainers,
+ TagsMd: em.tagsMd,
+ OmitEmpty: em.omitEmpty,
+ String: em.stringType,
+ FieldName: em.fieldName,
+ ByteSliceLaterFormat: em.byteSliceLaterFormat,
+ ByteArray: em.byteArray,
+ BinaryMarshaler: em.binaryMarshaler,
+ }
+}
+
+func (em *encMode) unexport() {}
+
+func (em *encMode) encTagBytes(t reflect.Type) []byte {
+ if em.tags != nil {
+ if tagItem := em.tags.getTagItemFromType(t); tagItem != nil {
+ return tagItem.cborTagNum
+ }
+ }
+ return nil
+}
+
+// Marshal returns the CBOR encoding of v using em encoding mode.
+//
+// See the documentation for Marshal for details.
+func (em *encMode) Marshal(v interface{}) ([]byte, error) {
+ e := getEncodeBuffer()
+
+ if err := encode(e, em, reflect.ValueOf(v)); err != nil {
+ putEncodeBuffer(e)
+ return nil, err
+ }
+
+ buf := make([]byte, e.Len())
+ copy(buf, e.Bytes())
+
+ putEncodeBuffer(e)
+ return buf, nil
+}
+
+// MarshalToBuffer encodes v into provided buffer (instead of using built-in buffer pool)
+// and uses em encoding mode.
+//
+// NOTE: Unlike Marshal, the buffer provided to MarshalToBuffer can contain
+// partially encoded data if error is returned.
+//
+// See Marshal for more details.
+func (em *encMode) MarshalToBuffer(v interface{}, buf *bytes.Buffer) error {
+ if buf == nil {
+ return fmt.Errorf("cbor: encoding buffer provided by user is nil")
+ }
+ return encode(buf, em, reflect.ValueOf(v))
+}
+
+// NewEncoder returns a new encoder that writes to w using em EncMode.
+func (em *encMode) NewEncoder(w io.Writer) *Encoder {
+ return &Encoder{w: w, em: em}
+}
+
+// encodeBufferPool caches unused bytes.Buffer objects for later reuse.
+var encodeBufferPool = sync.Pool{
+ New: func() interface{} {
+ e := new(bytes.Buffer)
+ e.Grow(32) // TODO: make this configurable
+ return e
+ },
+}
+
+func getEncodeBuffer() *bytes.Buffer {
+ return encodeBufferPool.Get().(*bytes.Buffer)
+}
+
+func putEncodeBuffer(e *bytes.Buffer) {
+ e.Reset()
+ encodeBufferPool.Put(e)
+}
+
+type encodeFunc func(e *bytes.Buffer, em *encMode, v reflect.Value) error
+type isEmptyFunc func(em *encMode, v reflect.Value) (empty bool, err error)
+
+func encode(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if !v.IsValid() {
+ // v is zero value
+ e.Write(cborNil)
+ return nil
+ }
+ vt := v.Type()
+ f, _ := getEncodeFunc(vt)
+ if f == nil {
+ return &UnsupportedTypeError{vt}
+ }
+
+ return f(e, em, v)
+}
+
+func encodeBool(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if b := em.encTagBytes(v.Type()); b != nil {
+ e.Write(b)
+ }
+ b := cborFalse
+ if v.Bool() {
+ b = cborTrue
+ }
+ e.Write(b)
+ return nil
+}
+
+func encodeInt(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if b := em.encTagBytes(v.Type()); b != nil {
+ e.Write(b)
+ }
+ i := v.Int()
+ if i >= 0 {
+ encodeHead(e, byte(cborTypePositiveInt), uint64(i))
+ return nil
+ }
+ i = i*(-1) - 1
+ encodeHead(e, byte(cborTypeNegativeInt), uint64(i))
+ return nil
+}
+
+func encodeUint(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if b := em.encTagBytes(v.Type()); b != nil {
+ e.Write(b)
+ }
+ encodeHead(e, byte(cborTypePositiveInt), v.Uint())
+ return nil
+}
+
+func encodeFloat(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if b := em.encTagBytes(v.Type()); b != nil {
+ e.Write(b)
+ }
+ f64 := v.Float()
+ if math.IsNaN(f64) {
+ return encodeNaN(e, em, v)
+ }
+ if math.IsInf(f64, 0) {
+ return encodeInf(e, em, v)
+ }
+ fopt := em.shortestFloat
+ if v.Kind() == reflect.Float64 && (fopt == ShortestFloatNone || cannotFitFloat32(f64)) {
+ // Encode float64
+ // Don't use encodeFloat64() because it cannot be inlined.
+ const argumentSize = 8
+ const headSize = 1 + argumentSize
+ var scratch [headSize]byte
+ scratch[0] = byte(cborTypePrimitives) | byte(additionalInformationAsFloat64)
+ binary.BigEndian.PutUint64(scratch[1:], math.Float64bits(f64))
+ e.Write(scratch[:])
+ return nil
+ }
+
+ f32 := float32(f64)
+ if fopt == ShortestFloat16 {
+ var f16 float16.Float16
+ p := float16.PrecisionFromfloat32(f32)
+ if p == float16.PrecisionExact {
+ // Roundtrip float32->float16->float32 test isn't needed.
+ f16 = float16.Fromfloat32(f32)
+ } else if p == float16.PrecisionUnknown {
+ // Try roundtrip float32->float16->float32 to determine if float32 can fit into float16.
+ f16 = float16.Fromfloat32(f32)
+ if f16.Float32() == f32 {
+ p = float16.PrecisionExact
+ }
+ }
+ if p == float16.PrecisionExact {
+ // Encode float16
+ // Don't use encodeFloat16() because it cannot be inlined.
+ const argumentSize = 2
+ const headSize = 1 + argumentSize
+ var scratch [headSize]byte
+ scratch[0] = byte(cborTypePrimitives) | additionalInformationAsFloat16
+ binary.BigEndian.PutUint16(scratch[1:], uint16(f16))
+ e.Write(scratch[:])
+ return nil
+ }
+ }
+
+ // Encode float32
+ // Don't use encodeFloat32() because it cannot be inlined.
+ const argumentSize = 4
+ const headSize = 1 + argumentSize
+ var scratch [headSize]byte
+ scratch[0] = byte(cborTypePrimitives) | additionalInformationAsFloat32
+ binary.BigEndian.PutUint32(scratch[1:], math.Float32bits(f32))
+ e.Write(scratch[:])
+ return nil
+}
+
+func encodeInf(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ f64 := v.Float()
+ switch em.infConvert {
+ case InfConvertReject:
+ return &UnsupportedValueError{msg: "floating-point infinity"}
+
+ case InfConvertFloat16:
+ if f64 > 0 {
+ e.Write(cborPositiveInfinity)
+ } else {
+ e.Write(cborNegativeInfinity)
+ }
+ return nil
+ }
+ if v.Kind() == reflect.Float64 {
+ return encodeFloat64(e, f64)
+ }
+ return encodeFloat32(e, float32(f64))
+}
+
+func encodeNaN(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ switch em.nanConvert {
+ case NaNConvert7e00:
+ e.Write(cborNaN)
+ return nil
+
+ case NaNConvertNone:
+ if v.Kind() == reflect.Float64 {
+ return encodeFloat64(e, v.Float())
+ }
+ f32 := float32NaNFromReflectValue(v)
+ return encodeFloat32(e, f32)
+
+ case NaNConvertReject:
+ return &UnsupportedValueError{msg: "floating-point NaN"}
+
+ default: // NaNConvertPreserveSignal, NaNConvertQuiet
+ if v.Kind() == reflect.Float64 {
+ f64 := v.Float()
+ f64bits := math.Float64bits(f64)
+ if em.nanConvert == NaNConvertQuiet && f64bits&(1<<51) == 0 {
+ f64bits |= 1 << 51 // Set quiet bit = 1
+ f64 = math.Float64frombits(f64bits)
+ }
+ // The lower 29 bits are dropped when converting from float64 to float32.
+ if f64bits&0x1fffffff != 0 {
+ // Encode NaN as float64 because dropped coef bits from float64 to float32 are not all 0s.
+ return encodeFloat64(e, f64)
+ }
+ // Create float32 from float64 manually because float32(f64) always turns on NaN's quiet bits.
+ sign := uint32(f64bits>>32) & (1 << 31)
+ exp := uint32(0x7f800000)
+ coef := uint32((f64bits & 0xfffffffffffff) >> 29)
+ f32bits := sign | exp | coef
+ f32 := math.Float32frombits(f32bits)
+ // The lower 13 bits are dropped when converting from float32 to float16.
+ if f32bits&0x1fff != 0 {
+ // Encode NaN as float32 because dropped coef bits from float32 to float16 are not all 0s.
+ return encodeFloat32(e, f32)
+ }
+ // Encode NaN as float16
+ f16, _ := float16.FromNaN32ps(f32) // Ignore err because it only returns error when f32 is not a NaN.
+ return encodeFloat16(e, f16)
+ }
+
+ f32 := float32NaNFromReflectValue(v)
+ f32bits := math.Float32bits(f32)
+ if em.nanConvert == NaNConvertQuiet && f32bits&(1<<22) == 0 {
+ f32bits |= 1 << 22 // Set quiet bit = 1
+ f32 = math.Float32frombits(f32bits)
+ }
+ // The lower 13 bits are dropped coef bits when converting from float32 to float16.
+ if f32bits&0x1fff != 0 {
+ // Encode NaN as float32 because dropped coef bits from float32 to float16 are not all 0s.
+ return encodeFloat32(e, f32)
+ }
+ f16, _ := float16.FromNaN32ps(f32) // Ignore err because it only returns error when f32 is not a NaN.
+ return encodeFloat16(e, f16)
+ }
+}
+
+func encodeFloat16(e *bytes.Buffer, f16 float16.Float16) error {
+ const argumentSize = 2
+ const headSize = 1 + argumentSize
+ var scratch [headSize]byte
+ scratch[0] = byte(cborTypePrimitives) | additionalInformationAsFloat16
+ binary.BigEndian.PutUint16(scratch[1:], uint16(f16))
+ e.Write(scratch[:])
+ return nil
+}
+
+func encodeFloat32(e *bytes.Buffer, f32 float32) error {
+ const argumentSize = 4
+ const headSize = 1 + argumentSize
+ var scratch [headSize]byte
+ scratch[0] = byte(cborTypePrimitives) | additionalInformationAsFloat32
+ binary.BigEndian.PutUint32(scratch[1:], math.Float32bits(f32))
+ e.Write(scratch[:])
+ return nil
+}
+
+func encodeFloat64(e *bytes.Buffer, f64 float64) error {
+ const argumentSize = 8
+ const headSize = 1 + argumentSize
+ var scratch [headSize]byte
+ scratch[0] = byte(cborTypePrimitives) | additionalInformationAsFloat64
+ binary.BigEndian.PutUint64(scratch[1:], math.Float64bits(f64))
+ e.Write(scratch[:])
+ return nil
+}
+
+func encodeByteString(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ vk := v.Kind()
+ if vk == reflect.Slice && v.IsNil() && em.nilContainers == NilContainerAsNull {
+ e.Write(cborNil)
+ return nil
+ }
+ if vk == reflect.Slice && v.Type().Elem().Kind() == reflect.Uint8 && em.byteSliceLaterEncodingTag != 0 {
+ encodeHead(e, byte(cborTypeTag), em.byteSliceLaterEncodingTag)
+ }
+ if b := em.encTagBytes(v.Type()); b != nil {
+ e.Write(b)
+ }
+ slen := v.Len()
+ if slen == 0 {
+ return e.WriteByte(byte(cborTypeByteString))
+ }
+ encodeHead(e, byte(cborTypeByteString), uint64(slen))
+ if vk == reflect.Array {
+ for i := 0; i < slen; i++ {
+ e.WriteByte(byte(v.Index(i).Uint()))
+ }
+ return nil
+ }
+ e.Write(v.Bytes())
+ return nil
+}
+
+func encodeString(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if b := em.encTagBytes(v.Type()); b != nil {
+ e.Write(b)
+ }
+ s := v.String()
+ encodeHead(e, byte(em.stringMajorType), uint64(len(s)))
+ e.WriteString(s)
+ return nil
+}
+
+type arrayEncodeFunc struct {
+ f encodeFunc
+}
+
+func (ae arrayEncodeFunc) encode(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if em.byteArray == ByteArrayToByteSlice && v.Type().Elem().Kind() == reflect.Uint8 {
+ return encodeByteString(e, em, v)
+ }
+ if v.Kind() == reflect.Slice && v.IsNil() && em.nilContainers == NilContainerAsNull {
+ e.Write(cborNil)
+ return nil
+ }
+ if b := em.encTagBytes(v.Type()); b != nil {
+ e.Write(b)
+ }
+ alen := v.Len()
+ if alen == 0 {
+ return e.WriteByte(byte(cborTypeArray))
+ }
+ encodeHead(e, byte(cborTypeArray), uint64(alen))
+ for i := 0; i < alen; i++ {
+ if err := ae.f(e, em, v.Index(i)); err != nil {
+ return err
+ }
+ }
+ return nil
+}
+
+// encodeKeyValueFunc encodes key/value pairs in map (v).
+// If kvs is provided (having the same length as v), length of encoded key and value are stored in kvs.
+// kvs is used for canonical encoding of map.
+type encodeKeyValueFunc func(e *bytes.Buffer, em *encMode, v reflect.Value, kvs []keyValue) error
+
+type mapEncodeFunc struct {
+ e encodeKeyValueFunc
+}
+
+func (me mapEncodeFunc) encode(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if v.IsNil() && em.nilContainers == NilContainerAsNull {
+ e.Write(cborNil)
+ return nil
+ }
+ if b := em.encTagBytes(v.Type()); b != nil {
+ e.Write(b)
+ }
+ mlen := v.Len()
+ if mlen == 0 {
+ return e.WriteByte(byte(cborTypeMap))
+ }
+
+ encodeHead(e, byte(cborTypeMap), uint64(mlen))
+ if em.sort == SortNone || em.sort == SortFastShuffle || mlen <= 1 {
+ return me.e(e, em, v, nil)
+ }
+
+ kvsp := getKeyValues(v.Len()) // for sorting keys
+ defer putKeyValues(kvsp)
+ kvs := *kvsp
+
+ kvBeginOffset := e.Len()
+ if err := me.e(e, em, v, kvs); err != nil {
+ return err
+ }
+ kvTotalLen := e.Len() - kvBeginOffset
+
+ // Use the capacity at the tail of the encode buffer as a staging area to rearrange the
+ // encoded pairs into sorted order.
+ e.Grow(kvTotalLen)
+ tmp := e.Bytes()[e.Len() : e.Len()+kvTotalLen] // Can use e.AvailableBuffer() in Go 1.21+.
+ dst := e.Bytes()[kvBeginOffset:]
+
+ if em.sort == SortBytewiseLexical {
+ sort.Sort(&bytewiseKeyValueSorter{kvs: kvs, data: dst})
+ } else {
+ sort.Sort(&lengthFirstKeyValueSorter{kvs: kvs, data: dst})
+ }
+
+ // This is where the encoded bytes are actually rearranged in the output buffer to reflect
+ // the desired order.
+ sortedOffset := 0
+ for _, kv := range kvs {
+ copy(tmp[sortedOffset:], dst[kv.offset:kv.nextOffset])
+ sortedOffset += kv.nextOffset - kv.offset
+ }
+ copy(dst, tmp[:kvTotalLen])
+
+ return nil
+
+}
+
+// keyValue is the position of an encoded pair in a buffer. All offsets are zero-based and relative
+// to the first byte of the first encoded pair.
+type keyValue struct {
+ offset int
+ valueOffset int
+ nextOffset int
+}
+
+type bytewiseKeyValueSorter struct {
+ kvs []keyValue
+ data []byte
+}
+
+func (x *bytewiseKeyValueSorter) Len() int {
+ return len(x.kvs)
+}
+
+func (x *bytewiseKeyValueSorter) Swap(i, j int) {
+ x.kvs[i], x.kvs[j] = x.kvs[j], x.kvs[i]
+}
+
+func (x *bytewiseKeyValueSorter) Less(i, j int) bool {
+ kvi, kvj := x.kvs[i], x.kvs[j]
+ return bytes.Compare(x.data[kvi.offset:kvi.valueOffset], x.data[kvj.offset:kvj.valueOffset]) <= 0
+}
+
+type lengthFirstKeyValueSorter struct {
+ kvs []keyValue
+ data []byte
+}
+
+func (x *lengthFirstKeyValueSorter) Len() int {
+ return len(x.kvs)
+}
+
+func (x *lengthFirstKeyValueSorter) Swap(i, j int) {
+ x.kvs[i], x.kvs[j] = x.kvs[j], x.kvs[i]
+}
+
+func (x *lengthFirstKeyValueSorter) Less(i, j int) bool {
+ kvi, kvj := x.kvs[i], x.kvs[j]
+ if keyLengthDifference := (kvi.valueOffset - kvi.offset) - (kvj.valueOffset - kvj.offset); keyLengthDifference != 0 {
+ return keyLengthDifference < 0
+ }
+ return bytes.Compare(x.data[kvi.offset:kvi.valueOffset], x.data[kvj.offset:kvj.valueOffset]) <= 0
+}
+
+var keyValuePool = sync.Pool{}
+
+func getKeyValues(length int) *[]keyValue {
+ v := keyValuePool.Get()
+ if v == nil {
+ y := make([]keyValue, length)
+ return &y
+ }
+ x := v.(*[]keyValue)
+ if cap(*x) >= length {
+ *x = (*x)[:length]
+ return x
+ }
+ // []keyValue from the pool does not have enough capacity.
+ // Return it back to the pool and create a new one.
+ keyValuePool.Put(x)
+ y := make([]keyValue, length)
+ return &y
+}
+
+func putKeyValues(x *[]keyValue) {
+ *x = (*x)[:0]
+ keyValuePool.Put(x)
+}
+
+func encodeStructToArray(e *bytes.Buffer, em *encMode, v reflect.Value) (err error) {
+ structType, err := getEncodingStructType(v.Type())
+ if err != nil {
+ return err
+ }
+
+ if b := em.encTagBytes(v.Type()); b != nil {
+ e.Write(b)
+ }
+
+ flds := structType.fields
+
+ encodeHead(e, byte(cborTypeArray), uint64(len(flds)))
+ for i := 0; i < len(flds); i++ {
+ f := flds[i]
+
+ var fv reflect.Value
+ if len(f.idx) == 1 {
+ fv = v.Field(f.idx[0])
+ } else {
+ // Get embedded field value. No error is expected.
+ fv, _ = getFieldValue(v, f.idx, func(reflect.Value) (reflect.Value, error) {
+ // Write CBOR nil for null pointer to embedded struct
+ e.Write(cborNil)
+ return reflect.Value{}, nil
+ })
+ if !fv.IsValid() {
+ continue
+ }
+ }
+
+ if err := f.ef(e, em, fv); err != nil {
+ return err
+ }
+ }
+ return nil
+}
+
+func encodeStruct(e *bytes.Buffer, em *encMode, v reflect.Value) (err error) {
+ structType, err := getEncodingStructType(v.Type())
+ if err != nil {
+ return err
+ }
+
+ flds := structType.getFields(em)
+
+ start := 0
+ if em.sort == SortFastShuffle && len(flds) > 0 {
+ start = rand.Intn(len(flds)) //nolint:gosec // Don't need a CSPRNG for deck cutting.
+ }
+
+ if b := em.encTagBytes(v.Type()); b != nil {
+ e.Write(b)
+ }
+
+ // Encode head with struct field count.
+ // Head is rewritten later if actual encoded field count is different from struct field count.
+ encodedHeadLen := encodeHead(e, byte(cborTypeMap), uint64(len(flds)))
+
+ kvbegin := e.Len()
+ kvcount := 0
+ for offset := 0; offset < len(flds); offset++ {
+ f := flds[(start+offset)%len(flds)]
+
+ var fv reflect.Value
+ if len(f.idx) == 1 {
+ fv = v.Field(f.idx[0])
+ } else {
+ // Get embedded field value. No error is expected.
+ fv, _ = getFieldValue(v, f.idx, func(reflect.Value) (reflect.Value, error) {
+ // Skip null pointer to embedded struct
+ return reflect.Value{}, nil
+ })
+ if !fv.IsValid() {
+ continue
+ }
+ }
+ if f.omitEmpty {
+ empty, err := f.ief(em, fv)
+ if err != nil {
+ return err
+ }
+ if empty {
+ continue
+ }
+ }
+
+ if !f.keyAsInt && em.fieldName == FieldNameToByteString {
+ e.Write(f.cborNameByteString)
+ } else { // int or text string
+ e.Write(f.cborName)
+ }
+
+ if err := f.ef(e, em, fv); err != nil {
+ return err
+ }
+
+ kvcount++
+ }
+
+ if len(flds) == kvcount {
+ // Encoded element count in head is the same as actual element count.
+ return nil
+ }
+
+ // Overwrite the bytes that were reserved for the head before encoding the map entries.
+ var actualHeadLen int
+ {
+ headbuf := *bytes.NewBuffer(e.Bytes()[kvbegin-encodedHeadLen : kvbegin-encodedHeadLen : kvbegin])
+ actualHeadLen = encodeHead(&headbuf, byte(cborTypeMap), uint64(kvcount))
+ }
+
+ if actualHeadLen == encodedHeadLen {
+ // The bytes reserved for the encoded head were exactly the right size, so the
+ // encoded entries are already in their final positions.
+ return nil
+ }
+
+ // We reserved more bytes than needed for the encoded head, based on the number of fields
+ // encoded. The encoded entries are offset to the right by the number of excess reserved
+ // bytes. Shift the entries left to remove the gap.
+ excessReservedBytes := encodedHeadLen - actualHeadLen
+ dst := e.Bytes()[kvbegin-excessReservedBytes : e.Len()-excessReservedBytes]
+ src := e.Bytes()[kvbegin:e.Len()]
+ copy(dst, src)
+
+ // After shifting, the excess bytes are at the end of the output buffer and they are
+ // garbage.
+ e.Truncate(e.Len() - excessReservedBytes)
+ return nil
+}
+
+func encodeIntf(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if v.IsNil() {
+ e.Write(cborNil)
+ return nil
+ }
+ return encode(e, em, v.Elem())
+}
+
+func encodeTime(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ t := v.Interface().(time.Time)
+ if t.IsZero() {
+ e.Write(cborNil) // Even if tag is required, encode as CBOR null.
+ return nil
+ }
+ if em.timeTag == EncTagRequired {
+ tagNumber := 1
+ if em.time == TimeRFC3339 || em.time == TimeRFC3339Nano {
+ tagNumber = 0
+ }
+ encodeHead(e, byte(cborTypeTag), uint64(tagNumber))
+ }
+ switch em.time {
+ case TimeUnix:
+ secs := t.Unix()
+ return encodeInt(e, em, reflect.ValueOf(secs))
+
+ case TimeUnixMicro:
+ t = t.UTC().Round(time.Microsecond)
+ f := float64(t.UnixNano()) / 1e9
+ return encodeFloat(e, em, reflect.ValueOf(f))
+
+ case TimeUnixDynamic:
+ t = t.UTC().Round(time.Microsecond)
+ secs, nsecs := t.Unix(), uint64(t.Nanosecond())
+ if nsecs == 0 {
+ return encodeInt(e, em, reflect.ValueOf(secs))
+ }
+ f := float64(secs) + float64(nsecs)/1e9
+ return encodeFloat(e, em, reflect.ValueOf(f))
+
+ case TimeRFC3339:
+ s := t.Format(time.RFC3339)
+ return encodeString(e, em, reflect.ValueOf(s))
+
+ default: // TimeRFC3339Nano
+ s := t.Format(time.RFC3339Nano)
+ return encodeString(e, em, reflect.ValueOf(s))
+ }
+}
+
+func encodeBigInt(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if em.bigIntConvert == BigIntConvertReject {
+ return &UnsupportedTypeError{Type: typeBigInt}
+ }
+
+ vbi := v.Interface().(big.Int)
+ sign := vbi.Sign()
+ bi := new(big.Int).SetBytes(vbi.Bytes()) // bi is absolute value of v
+ if sign < 0 {
+ // For negative number, convert to CBOR encoded number (-v-1).
+ bi.Sub(bi, big.NewInt(1))
+ }
+
+ if em.bigIntConvert == BigIntConvertShortest {
+ if bi.IsUint64() {
+ if sign >= 0 {
+ // Encode as CBOR pos int (major type 0)
+ encodeHead(e, byte(cborTypePositiveInt), bi.Uint64())
+ return nil
+ }
+ // Encode as CBOR neg int (major type 1)
+ encodeHead(e, byte(cborTypeNegativeInt), bi.Uint64())
+ return nil
+ }
+ }
+
+ tagNum := 2
+ if sign < 0 {
+ tagNum = 3
+ }
+ // Write tag number
+ encodeHead(e, byte(cborTypeTag), uint64(tagNum))
+ // Write bignum byte string
+ b := bi.Bytes()
+ encodeHead(e, byte(cborTypeByteString), uint64(len(b)))
+ e.Write(b)
+ return nil
+}
+
+type binaryMarshalerEncoder struct {
+ alternateEncode encodeFunc
+ alternateIsEmpty isEmptyFunc
+}
+
+func (bme binaryMarshalerEncoder) encode(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if em.binaryMarshaler != BinaryMarshalerByteString {
+ return bme.alternateEncode(e, em, v)
+ }
+
+ vt := v.Type()
+ m, ok := v.Interface().(encoding.BinaryMarshaler)
+ if !ok {
+ pv := reflect.New(vt)
+ pv.Elem().Set(v)
+ m = pv.Interface().(encoding.BinaryMarshaler)
+ }
+ data, err := m.MarshalBinary()
+ if err != nil {
+ return err
+ }
+ if b := em.encTagBytes(vt); b != nil {
+ e.Write(b)
+ }
+ encodeHead(e, byte(cborTypeByteString), uint64(len(data)))
+ e.Write(data)
+ return nil
+}
+
+func (bme binaryMarshalerEncoder) isEmpty(em *encMode, v reflect.Value) (bool, error) {
+ if em.binaryMarshaler != BinaryMarshalerByteString {
+ return bme.alternateIsEmpty(em, v)
+ }
+
+ m, ok := v.Interface().(encoding.BinaryMarshaler)
+ if !ok {
+ pv := reflect.New(v.Type())
+ pv.Elem().Set(v)
+ m = pv.Interface().(encoding.BinaryMarshaler)
+ }
+ data, err := m.MarshalBinary()
+ if err != nil {
+ return false, err
+ }
+ return len(data) == 0, nil
+}
+
+func encodeMarshalerType(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if em.tagsMd == TagsForbidden && v.Type() == typeRawTag {
+ return errors.New("cbor: cannot encode cbor.RawTag when TagsMd is TagsForbidden")
+ }
+ m, ok := v.Interface().(Marshaler)
+ if !ok {
+ pv := reflect.New(v.Type())
+ pv.Elem().Set(v)
+ m = pv.Interface().(Marshaler)
+ }
+ data, err := m.MarshalCBOR()
+ if err != nil {
+ return err
+ }
+
+ // Verify returned CBOR data item from MarshalCBOR() is well-formed and passes tag validity for builtin tags 0-3.
+ d := decoder{data: data, dm: getMarshalerDecMode(em.indefLength, em.tagsMd)}
+ err = d.wellformed(false, true)
+ if err != nil {
+ return &MarshalerError{typ: v.Type(), err: err}
+ }
+
+ e.Write(data)
+ return nil
+}
+
+func encodeTag(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if em.tagsMd == TagsForbidden {
+ return errors.New("cbor: cannot encode cbor.Tag when TagsMd is TagsForbidden")
+ }
+
+ t := v.Interface().(Tag)
+
+ if t.Number == 0 && t.Content == nil {
+ // Marshal uninitialized cbor.Tag
+ e.Write(cborNil)
+ return nil
+ }
+
+ // Marshal tag number
+ encodeHead(e, byte(cborTypeTag), t.Number)
+
+ vem := *em // shallow copy
+
+ // For built-in tags, disable settings that may introduce tag validity errors when
+ // marshaling certain Content values.
+ switch t.Number {
+ case tagNumRFC3339Time:
+ vem.stringType = StringToTextString
+ vem.stringMajorType = cborTypeTextString
+ case tagNumUnsignedBignum, tagNumNegativeBignum:
+ vem.byteSliceLaterFormat = ByteSliceLaterFormatNone
+ vem.byteSliceLaterEncodingTag = 0
+ }
+
+ // Marshal tag content
+ return encode(e, &vem, reflect.ValueOf(t.Content))
+}
+
+// encodeHead writes CBOR head of specified type t and returns number of bytes written.
+func encodeHead(e *bytes.Buffer, t byte, n uint64) int {
+ if n <= maxAdditionalInformationWithoutArgument {
+ const headSize = 1
+ e.WriteByte(t | byte(n))
+ return headSize
+ }
+
+ if n <= math.MaxUint8 {
+ const headSize = 2
+ scratch := [headSize]byte{
+ t | byte(additionalInformationWith1ByteArgument),
+ byte(n),
+ }
+ e.Write(scratch[:])
+ return headSize
+ }
+
+ if n <= math.MaxUint16 {
+ const headSize = 3
+ var scratch [headSize]byte
+ scratch[0] = t | byte(additionalInformationWith2ByteArgument)
+ binary.BigEndian.PutUint16(scratch[1:], uint16(n))
+ e.Write(scratch[:])
+ return headSize
+ }
+
+ if n <= math.MaxUint32 {
+ const headSize = 5
+ var scratch [headSize]byte
+ scratch[0] = t | byte(additionalInformationWith4ByteArgument)
+ binary.BigEndian.PutUint32(scratch[1:], uint32(n))
+ e.Write(scratch[:])
+ return headSize
+ }
+
+ const headSize = 9
+ var scratch [headSize]byte
+ scratch[0] = t | byte(additionalInformationWith8ByteArgument)
+ binary.BigEndian.PutUint64(scratch[1:], n)
+ e.Write(scratch[:])
+ return headSize
+}
+
+var (
+ typeMarshaler = reflect.TypeOf((*Marshaler)(nil)).Elem()
+ typeBinaryMarshaler = reflect.TypeOf((*encoding.BinaryMarshaler)(nil)).Elem()
+ typeRawMessage = reflect.TypeOf(RawMessage(nil))
+ typeByteString = reflect.TypeOf(ByteString(""))
+)
+
+func getEncodeFuncInternal(t reflect.Type) (ef encodeFunc, ief isEmptyFunc) {
+ k := t.Kind()
+ if k == reflect.Ptr {
+ return getEncodeIndirectValueFunc(t), isEmptyPtr
+ }
+ switch t {
+ case typeSimpleValue:
+ return encodeMarshalerType, isEmptyUint
+
+ case typeTag:
+ return encodeTag, alwaysNotEmpty
+
+ case typeTime:
+ return encodeTime, alwaysNotEmpty
+
+ case typeBigInt:
+ return encodeBigInt, alwaysNotEmpty
+
+ case typeRawMessage:
+ return encodeMarshalerType, isEmptySlice
+
+ case typeByteString:
+ return encodeMarshalerType, isEmptyString
+ }
+ if reflect.PtrTo(t).Implements(typeMarshaler) {
+ return encodeMarshalerType, alwaysNotEmpty
+ }
+ if reflect.PtrTo(t).Implements(typeBinaryMarshaler) {
+ defer func() {
+ // capture encoding method used for modes that disable BinaryMarshaler
+ bme := binaryMarshalerEncoder{
+ alternateEncode: ef,
+ alternateIsEmpty: ief,
+ }
+ ef = bme.encode
+ ief = bme.isEmpty
+ }()
+ }
+ switch k {
+ case reflect.Bool:
+ return encodeBool, isEmptyBool
+
+ case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+ return encodeInt, isEmptyInt
+
+ case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
+ return encodeUint, isEmptyUint
+
+ case reflect.Float32, reflect.Float64:
+ return encodeFloat, isEmptyFloat
+
+ case reflect.String:
+ return encodeString, isEmptyString
+
+ case reflect.Slice:
+ if t.Elem().Kind() == reflect.Uint8 {
+ return encodeByteString, isEmptySlice
+ }
+ fallthrough
+
+ case reflect.Array:
+ f, _ := getEncodeFunc(t.Elem())
+ if f == nil {
+ return nil, nil
+ }
+ return arrayEncodeFunc{f: f}.encode, isEmptySlice
+
+ case reflect.Map:
+ f := getEncodeMapFunc(t)
+ if f == nil {
+ return nil, nil
+ }
+ return f, isEmptyMap
+
+ case reflect.Struct:
+ // Get struct's special field "_" tag options
+ if f, ok := t.FieldByName("_"); ok {
+ tag := f.Tag.Get("cbor")
+ if tag != "-" {
+ if hasToArrayOption(tag) {
+ return encodeStructToArray, isEmptyStruct
+ }
+ }
+ }
+ return encodeStruct, isEmptyStruct
+
+ case reflect.Interface:
+ return encodeIntf, isEmptyIntf
+ }
+ return nil, nil
+}
+
+func getEncodeIndirectValueFunc(t reflect.Type) encodeFunc {
+ for t.Kind() == reflect.Ptr {
+ t = t.Elem()
+ }
+ f, _ := getEncodeFunc(t)
+ if f == nil {
+ return nil
+ }
+ return func(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ for v.Kind() == reflect.Ptr && !v.IsNil() {
+ v = v.Elem()
+ }
+ if v.Kind() == reflect.Ptr && v.IsNil() {
+ e.Write(cborNil)
+ return nil
+ }
+ return f(e, em, v)
+ }
+}
+
+func alwaysNotEmpty(_ *encMode, _ reflect.Value) (empty bool, err error) {
+ return false, nil
+}
+
+func isEmptyBool(_ *encMode, v reflect.Value) (bool, error) {
+ return !v.Bool(), nil
+}
+
+func isEmptyInt(_ *encMode, v reflect.Value) (bool, error) {
+ return v.Int() == 0, nil
+}
+
+func isEmptyUint(_ *encMode, v reflect.Value) (bool, error) {
+ return v.Uint() == 0, nil
+}
+
+func isEmptyFloat(_ *encMode, v reflect.Value) (bool, error) {
+ return v.Float() == 0.0, nil
+}
+
+func isEmptyString(_ *encMode, v reflect.Value) (bool, error) {
+ return v.Len() == 0, nil
+}
+
+func isEmptySlice(_ *encMode, v reflect.Value) (bool, error) {
+ return v.Len() == 0, nil
+}
+
+func isEmptyMap(_ *encMode, v reflect.Value) (bool, error) {
+ return v.Len() == 0, nil
+}
+
+func isEmptyPtr(_ *encMode, v reflect.Value) (bool, error) {
+ return v.IsNil(), nil
+}
+
+func isEmptyIntf(_ *encMode, v reflect.Value) (bool, error) {
+ return v.IsNil(), nil
+}
+
+func isEmptyStruct(em *encMode, v reflect.Value) (bool, error) {
+ structType, err := getEncodingStructType(v.Type())
+ if err != nil {
+ return false, err
+ }
+
+ if em.omitEmpty == OmitEmptyGoValue {
+ return false, nil
+ }
+
+ if structType.toArray {
+ return len(structType.fields) == 0, nil
+ }
+
+ if len(structType.fields) > len(structType.omitEmptyFieldsIdx) {
+ return false, nil
+ }
+
+ for _, i := range structType.omitEmptyFieldsIdx {
+ f := structType.fields[i]
+
+ // Get field value
+ var fv reflect.Value
+ if len(f.idx) == 1 {
+ fv = v.Field(f.idx[0])
+ } else {
+ // Get embedded field value. No error is expected.
+ fv, _ = getFieldValue(v, f.idx, func(reflect.Value) (reflect.Value, error) {
+ // Skip null pointer to embedded struct
+ return reflect.Value{}, nil
+ })
+ if !fv.IsValid() {
+ continue
+ }
+ }
+
+ empty, err := f.ief(em, fv)
+ if err != nil {
+ return false, err
+ }
+ if !empty {
+ return false, nil
+ }
+ }
+ return true, nil
+}
+
+func cannotFitFloat32(f64 float64) bool {
+ f32 := float32(f64)
+ return float64(f32) != f64
+}
+
+// float32NaNFromReflectValue extracts float32 NaN from reflect.Value while preserving NaN's quiet bit.
+func float32NaNFromReflectValue(v reflect.Value) float32 {
+ // Keith Randall's workaround for issue https://github.com/golang/go/issues/36400
+ p := reflect.New(v.Type())
+ p.Elem().Set(v)
+ f32 := p.Convert(reflect.TypeOf((*float32)(nil))).Elem().Interface().(float32)
+ return f32
+}
diff --git a/vendor/github.com/fxamacker/cbor/v2/encode_map.go b/vendor/github.com/fxamacker/cbor/v2/encode_map.go
new file mode 100644
index 00000000..8b4b4bbc
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/encode_map.go
@@ -0,0 +1,94 @@
+// Copyright (c) Faye Amacker. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+//go:build go1.20
+
+package cbor
+
+import (
+ "bytes"
+ "reflect"
+ "sync"
+)
+
+type mapKeyValueEncodeFunc struct {
+ kf, ef encodeFunc
+ kpool, vpool sync.Pool
+}
+
+func (me *mapKeyValueEncodeFunc) encodeKeyValues(e *bytes.Buffer, em *encMode, v reflect.Value, kvs []keyValue) error {
+ iterk := me.kpool.Get().(*reflect.Value)
+ defer func() {
+ iterk.SetZero()
+ me.kpool.Put(iterk)
+ }()
+ iterv := me.vpool.Get().(*reflect.Value)
+ defer func() {
+ iterv.SetZero()
+ me.vpool.Put(iterv)
+ }()
+
+ if kvs == nil {
+ for i, iter := 0, v.MapRange(); iter.Next(); i++ {
+ iterk.SetIterKey(iter)
+ iterv.SetIterValue(iter)
+
+ if err := me.kf(e, em, *iterk); err != nil {
+ return err
+ }
+ if err := me.ef(e, em, *iterv); err != nil {
+ return err
+ }
+ }
+ return nil
+ }
+
+ initial := e.Len()
+ for i, iter := 0, v.MapRange(); iter.Next(); i++ {
+ iterk.SetIterKey(iter)
+ iterv.SetIterValue(iter)
+
+ offset := e.Len()
+ if err := me.kf(e, em, *iterk); err != nil {
+ return err
+ }
+ valueOffset := e.Len()
+ if err := me.ef(e, em, *iterv); err != nil {
+ return err
+ }
+ kvs[i] = keyValue{
+ offset: offset - initial,
+ valueOffset: valueOffset - initial,
+ nextOffset: e.Len() - initial,
+ }
+ }
+
+ return nil
+}
+
+func getEncodeMapFunc(t reflect.Type) encodeFunc {
+ kf, _ := getEncodeFunc(t.Key())
+ ef, _ := getEncodeFunc(t.Elem())
+ if kf == nil || ef == nil {
+ return nil
+ }
+ mkv := &mapKeyValueEncodeFunc{
+ kf: kf,
+ ef: ef,
+ kpool: sync.Pool{
+ New: func() interface{} {
+ rk := reflect.New(t.Key()).Elem()
+ return &rk
+ },
+ },
+ vpool: sync.Pool{
+ New: func() interface{} {
+ rv := reflect.New(t.Elem()).Elem()
+ return &rv
+ },
+ },
+ }
+ return mapEncodeFunc{
+ e: mkv.encodeKeyValues,
+ }.encode
+}
diff --git a/vendor/github.com/fxamacker/cbor/v2/encode_map_go117.go b/vendor/github.com/fxamacker/cbor/v2/encode_map_go117.go
new file mode 100644
index 00000000..31c39336
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/encode_map_go117.go
@@ -0,0 +1,60 @@
+// Copyright (c) Faye Amacker. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+//go:build !go1.20
+
+package cbor
+
+import (
+ "bytes"
+ "reflect"
+)
+
+type mapKeyValueEncodeFunc struct {
+ kf, ef encodeFunc
+}
+
+func (me *mapKeyValueEncodeFunc) encodeKeyValues(e *bytes.Buffer, em *encMode, v reflect.Value, kvs []keyValue) error {
+ if kvs == nil {
+ for i, iter := 0, v.MapRange(); iter.Next(); i++ {
+ if err := me.kf(e, em, iter.Key()); err != nil {
+ return err
+ }
+ if err := me.ef(e, em, iter.Value()); err != nil {
+ return err
+ }
+ }
+ return nil
+ }
+
+ initial := e.Len()
+ for i, iter := 0, v.MapRange(); iter.Next(); i++ {
+ offset := e.Len()
+ if err := me.kf(e, em, iter.Key()); err != nil {
+ return err
+ }
+ valueOffset := e.Len()
+ if err := me.ef(e, em, iter.Value()); err != nil {
+ return err
+ }
+ kvs[i] = keyValue{
+ offset: offset - initial,
+ valueOffset: valueOffset - initial,
+ nextOffset: e.Len() - initial,
+ }
+ }
+
+ return nil
+}
+
+func getEncodeMapFunc(t reflect.Type) encodeFunc {
+ kf, _ := getEncodeFunc(t.Key())
+ ef, _ := getEncodeFunc(t.Elem())
+ if kf == nil || ef == nil {
+ return nil
+ }
+ mkv := &mapKeyValueEncodeFunc{kf: kf, ef: ef}
+ return mapEncodeFunc{
+ e: mkv.encodeKeyValues,
+ }.encode
+}
diff --git a/vendor/github.com/fxamacker/cbor/v2/simplevalue.go b/vendor/github.com/fxamacker/cbor/v2/simplevalue.go
new file mode 100644
index 00000000..de175cee
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/simplevalue.go
@@ -0,0 +1,69 @@
+package cbor
+
+import (
+ "errors"
+ "fmt"
+ "reflect"
+)
+
+// SimpleValue represents CBOR simple value.
+// CBOR simple value is:
+// - an extension point like CBOR tag.
+// - a subset of CBOR major type 7 that isn't floating-point.
+// - "identified by a number between 0 and 255, but distinct from that number itself".
+// For example, "a simple value 2 is not equivalent to an integer 2" as a CBOR map key.
+//
+// CBOR simple values identified by 20..23 are: "false", "true" , "null", and "undefined".
+// Other CBOR simple values are currently unassigned/reserved by IANA.
+type SimpleValue uint8
+
+var (
+ typeSimpleValue = reflect.TypeOf(SimpleValue(0))
+)
+
+// MarshalCBOR encodes SimpleValue as CBOR simple value (major type 7).
+func (sv SimpleValue) MarshalCBOR() ([]byte, error) {
+ // RFC 8949 3.3. Floating-Point Numbers and Values with No Content says:
+ // "An encoder MUST NOT issue two-byte sequences that start with 0xf8
+ // (major type 7, additional information 24) and continue with a byte
+ // less than 0x20 (32 decimal). Such sequences are not well-formed.
+ // (This implies that an encoder cannot encode false, true, null, or
+ // undefined in two-byte sequences and that only the one-byte variants
+ // of these are well-formed; more generally speaking, each simple value
+ // only has a single representation variant)."
+
+ switch {
+ case sv <= maxSimpleValueInAdditionalInformation:
+ return []byte{byte(cborTypePrimitives) | byte(sv)}, nil
+
+ case sv >= minSimpleValueIn1ByteArgument:
+ return []byte{byte(cborTypePrimitives) | additionalInformationWith1ByteArgument, byte(sv)}, nil
+
+ default:
+ return nil, &UnsupportedValueError{msg: fmt.Sprintf("SimpleValue(%d)", sv)}
+ }
+}
+
+// UnmarshalCBOR decodes CBOR simple value (major type 7) to SimpleValue.
+func (sv *SimpleValue) UnmarshalCBOR(data []byte) error {
+ if sv == nil {
+ return errors.New("cbor.SimpleValue: UnmarshalCBOR on nil pointer")
+ }
+
+ d := decoder{data: data, dm: defaultDecMode}
+
+ typ, ai, val := d.getHead()
+
+ if typ != cborTypePrimitives {
+ return &UnmarshalTypeError{CBORType: typ.String(), GoType: "SimpleValue"}
+ }
+ if ai > additionalInformationWith1ByteArgument {
+ return &UnmarshalTypeError{CBORType: typ.String(), GoType: "SimpleValue", errorMsg: "not simple values"}
+ }
+
+ // It is safe to cast val to uint8 here because
+ // - data is already verified to be well-formed CBOR simple value and
+ // - val is <= math.MaxUint8.
+ *sv = SimpleValue(val)
+ return nil
+}
diff --git a/vendor/github.com/fxamacker/cbor/v2/stream.go b/vendor/github.com/fxamacker/cbor/v2/stream.go
new file mode 100644
index 00000000..507ab6c1
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/stream.go
@@ -0,0 +1,277 @@
+// Copyright (c) Faye Amacker. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+package cbor
+
+import (
+ "bytes"
+ "errors"
+ "io"
+ "reflect"
+)
+
+// Decoder reads and decodes CBOR values from io.Reader.
+type Decoder struct {
+ r io.Reader
+ d decoder
+ buf []byte
+ off int // next read offset in buf
+ bytesRead int
+}
+
+// NewDecoder returns a new decoder that reads and decodes from r using
+// the default decoding options.
+func NewDecoder(r io.Reader) *Decoder {
+ return defaultDecMode.NewDecoder(r)
+}
+
+// Decode reads CBOR value and decodes it into the value pointed to by v.
+func (dec *Decoder) Decode(v interface{}) error {
+ _, err := dec.readNext()
+ if err != nil {
+ // Return validation error or read error.
+ return err
+ }
+
+ dec.d.reset(dec.buf[dec.off:])
+ err = dec.d.value(v)
+
+ // Increment dec.off even if decoding err is not nil because
+ // dec.d.off points to the next CBOR data item if current
+ // CBOR data item is valid but failed to be decoded into v.
+ // This allows next CBOR data item to be decoded in next
+ // call to this function.
+ dec.off += dec.d.off
+ dec.bytesRead += dec.d.off
+
+ return err
+}
+
+// Skip skips to the next CBOR data item (if there is any),
+// otherwise it returns error such as io.EOF, io.UnexpectedEOF, etc.
+func (dec *Decoder) Skip() error {
+ n, err := dec.readNext()
+ if err != nil {
+ // Return validation error or read error.
+ return err
+ }
+
+ dec.off += n
+ dec.bytesRead += n
+ return nil
+}
+
+// NumBytesRead returns the number of bytes read.
+func (dec *Decoder) NumBytesRead() int {
+ return dec.bytesRead
+}
+
+// Buffered returns a reader for data remaining in Decoder's buffer.
+// Returned reader is valid until the next call to Decode or Skip.
+func (dec *Decoder) Buffered() io.Reader {
+ return bytes.NewReader(dec.buf[dec.off:])
+}
+
+// readNext() reads next CBOR data item from Reader to buffer.
+// It returns the size of next CBOR data item.
+// It also returns validation error or read error if any.
+func (dec *Decoder) readNext() (int, error) {
+ var readErr error
+ var validErr error
+
+ for {
+ // Process any unread data in dec.buf.
+ if dec.off < len(dec.buf) {
+ dec.d.reset(dec.buf[dec.off:])
+ off := dec.off // Save offset before data validation
+ validErr = dec.d.wellformed(true, false)
+ dec.off = off // Restore offset
+
+ if validErr == nil {
+ return dec.d.off, nil
+ }
+
+ if validErr != io.ErrUnexpectedEOF {
+ return 0, validErr
+ }
+
+ // Process last read error on io.ErrUnexpectedEOF.
+ if readErr != nil {
+ if readErr == io.EOF {
+ // current CBOR data item is incomplete.
+ return 0, io.ErrUnexpectedEOF
+ }
+ return 0, readErr
+ }
+ }
+
+ // More data is needed and there was no read error.
+ var n int
+ for n == 0 {
+ n, readErr = dec.read()
+ if n == 0 && readErr != nil {
+ // No more data can be read and read error is encountered.
+ // At this point, validErr is either nil or io.ErrUnexpectedEOF.
+ if readErr == io.EOF {
+ if validErr == io.ErrUnexpectedEOF {
+ // current CBOR data item is incomplete.
+ return 0, io.ErrUnexpectedEOF
+ }
+ }
+ return 0, readErr
+ }
+ }
+
+ // At this point, dec.buf contains new data from last read (n > 0).
+ }
+}
+
+// read() reads data from Reader to buffer.
+// It returns number of bytes read and any read error encountered.
+// Postconditions:
+// - dec.buf contains previously unread data and new data.
+// - dec.off is 0.
+func (dec *Decoder) read() (int, error) {
+ // Grow buf if needed.
+ const minRead = 512
+ if cap(dec.buf)-len(dec.buf)+dec.off < minRead {
+ oldUnreadBuf := dec.buf[dec.off:]
+ dec.buf = make([]byte, len(dec.buf)-dec.off, 2*cap(dec.buf)+minRead)
+ dec.overwriteBuf(oldUnreadBuf)
+ }
+
+ // Copy unread data over read data and reset off to 0.
+ if dec.off > 0 {
+ dec.overwriteBuf(dec.buf[dec.off:])
+ }
+
+ // Read from reader and reslice buf.
+ n, err := dec.r.Read(dec.buf[len(dec.buf):cap(dec.buf)])
+ dec.buf = dec.buf[0 : len(dec.buf)+n]
+ return n, err
+}
+
+func (dec *Decoder) overwriteBuf(newBuf []byte) {
+ n := copy(dec.buf, newBuf)
+ dec.buf = dec.buf[:n]
+ dec.off = 0
+}
+
+// Encoder writes CBOR values to io.Writer.
+type Encoder struct {
+ w io.Writer
+ em *encMode
+ indefTypes []cborType
+}
+
+// NewEncoder returns a new encoder that writes to w using the default encoding options.
+func NewEncoder(w io.Writer) *Encoder {
+ return defaultEncMode.NewEncoder(w)
+}
+
+// Encode writes the CBOR encoding of v.
+func (enc *Encoder) Encode(v interface{}) error {
+ if len(enc.indefTypes) > 0 && v != nil {
+ indefType := enc.indefTypes[len(enc.indefTypes)-1]
+ if indefType == cborTypeTextString {
+ k := reflect.TypeOf(v).Kind()
+ if k != reflect.String {
+ return errors.New("cbor: cannot encode item type " + k.String() + " for indefinite-length text string")
+ }
+ } else if indefType == cborTypeByteString {
+ t := reflect.TypeOf(v)
+ k := t.Kind()
+ if (k != reflect.Array && k != reflect.Slice) || t.Elem().Kind() != reflect.Uint8 {
+ return errors.New("cbor: cannot encode item type " + k.String() + " for indefinite-length byte string")
+ }
+ }
+ }
+
+ buf := getEncodeBuffer()
+
+ err := encode(buf, enc.em, reflect.ValueOf(v))
+ if err == nil {
+ _, err = enc.w.Write(buf.Bytes())
+ }
+
+ putEncodeBuffer(buf)
+ return err
+}
+
+// StartIndefiniteByteString starts byte string encoding of indefinite length.
+// Subsequent calls of (*Encoder).Encode() encodes definite length byte strings
+// ("chunks") as one contiguous string until EndIndefinite is called.
+func (enc *Encoder) StartIndefiniteByteString() error {
+ return enc.startIndefinite(cborTypeByteString)
+}
+
+// StartIndefiniteTextString starts text string encoding of indefinite length.
+// Subsequent calls of (*Encoder).Encode() encodes definite length text strings
+// ("chunks") as one contiguous string until EndIndefinite is called.
+func (enc *Encoder) StartIndefiniteTextString() error {
+ return enc.startIndefinite(cborTypeTextString)
+}
+
+// StartIndefiniteArray starts array encoding of indefinite length.
+// Subsequent calls of (*Encoder).Encode() encodes elements of the array
+// until EndIndefinite is called.
+func (enc *Encoder) StartIndefiniteArray() error {
+ return enc.startIndefinite(cborTypeArray)
+}
+
+// StartIndefiniteMap starts array encoding of indefinite length.
+// Subsequent calls of (*Encoder).Encode() encodes elements of the map
+// until EndIndefinite is called.
+func (enc *Encoder) StartIndefiniteMap() error {
+ return enc.startIndefinite(cborTypeMap)
+}
+
+// EndIndefinite closes last opened indefinite length value.
+func (enc *Encoder) EndIndefinite() error {
+ if len(enc.indefTypes) == 0 {
+ return errors.New("cbor: cannot encode \"break\" code outside indefinite length values")
+ }
+ _, err := enc.w.Write([]byte{cborBreakFlag})
+ if err == nil {
+ enc.indefTypes = enc.indefTypes[:len(enc.indefTypes)-1]
+ }
+ return err
+}
+
+var cborIndefHeader = map[cborType][]byte{
+ cborTypeByteString: {cborByteStringWithIndefiniteLengthHead},
+ cborTypeTextString: {cborTextStringWithIndefiniteLengthHead},
+ cborTypeArray: {cborArrayWithIndefiniteLengthHead},
+ cborTypeMap: {cborMapWithIndefiniteLengthHead},
+}
+
+func (enc *Encoder) startIndefinite(typ cborType) error {
+ if enc.em.indefLength == IndefLengthForbidden {
+ return &IndefiniteLengthError{typ}
+ }
+ _, err := enc.w.Write(cborIndefHeader[typ])
+ if err == nil {
+ enc.indefTypes = append(enc.indefTypes, typ)
+ }
+ return err
+}
+
+// RawMessage is a raw encoded CBOR value.
+type RawMessage []byte
+
+// MarshalCBOR returns m or CBOR nil if m is nil.
+func (m RawMessage) MarshalCBOR() ([]byte, error) {
+ if len(m) == 0 {
+ return cborNil, nil
+ }
+ return m, nil
+}
+
+// UnmarshalCBOR creates a copy of data and saves to *m.
+func (m *RawMessage) UnmarshalCBOR(data []byte) error {
+ if m == nil {
+ return errors.New("cbor.RawMessage: UnmarshalCBOR on nil pointer")
+ }
+ *m = append((*m)[0:0], data...)
+ return nil
+}
diff --git a/vendor/github.com/fxamacker/cbor/v2/structfields.go b/vendor/github.com/fxamacker/cbor/v2/structfields.go
new file mode 100644
index 00000000..81228acf
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/structfields.go
@@ -0,0 +1,260 @@
+// Copyright (c) Faye Amacker. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+package cbor
+
+import (
+ "reflect"
+ "sort"
+ "strings"
+)
+
+type field struct {
+ name string
+ nameAsInt int64 // used to decoder to match field name with CBOR int
+ cborName []byte
+ cborNameByteString []byte // major type 2 name encoding iff cborName has major type 3
+ idx []int
+ typ reflect.Type
+ ef encodeFunc
+ ief isEmptyFunc
+ typInfo *typeInfo // used to decoder to reuse type info
+ tagged bool // used to choose dominant field (at the same level tagged fields dominate untagged fields)
+ omitEmpty bool // used to skip empty field
+ keyAsInt bool // used to encode/decode field name as int
+}
+
+type fields []*field
+
+// indexFieldSorter sorts fields by field idx at each level, breaking ties with idx depth.
+type indexFieldSorter struct {
+ fields fields
+}
+
+func (x *indexFieldSorter) Len() int {
+ return len(x.fields)
+}
+
+func (x *indexFieldSorter) Swap(i, j int) {
+ x.fields[i], x.fields[j] = x.fields[j], x.fields[i]
+}
+
+func (x *indexFieldSorter) Less(i, j int) bool {
+ iIdx, jIdx := x.fields[i].idx, x.fields[j].idx
+ for k := 0; k < len(iIdx) && k < len(jIdx); k++ {
+ if iIdx[k] != jIdx[k] {
+ return iIdx[k] < jIdx[k]
+ }
+ }
+ return len(iIdx) <= len(jIdx)
+}
+
+// nameLevelAndTagFieldSorter sorts fields by field name, idx depth, and presence of tag.
+type nameLevelAndTagFieldSorter struct {
+ fields fields
+}
+
+func (x *nameLevelAndTagFieldSorter) Len() int {
+ return len(x.fields)
+}
+
+func (x *nameLevelAndTagFieldSorter) Swap(i, j int) {
+ x.fields[i], x.fields[j] = x.fields[j], x.fields[i]
+}
+
+func (x *nameLevelAndTagFieldSorter) Less(i, j int) bool {
+ fi, fj := x.fields[i], x.fields[j]
+ if fi.name != fj.name {
+ return fi.name < fj.name
+ }
+ if len(fi.idx) != len(fj.idx) {
+ return len(fi.idx) < len(fj.idx)
+ }
+ if fi.tagged != fj.tagged {
+ return fi.tagged
+ }
+ return i < j // Field i and j have the same name, depth, and tagged status. Nothing else matters.
+}
+
+// getFields returns visible fields of struct type t following visibility rules for JSON encoding.
+func getFields(t reflect.Type) (flds fields, structOptions string) {
+ // Get special field "_" tag options
+ if f, ok := t.FieldByName("_"); ok {
+ tag := f.Tag.Get("cbor")
+ if tag != "-" {
+ structOptions = tag
+ }
+ }
+
+ // nTypes contains next level anonymous fields' types and indexes
+ // (there can be multiple fields of the same type at the same level)
+ flds, nTypes := appendFields(t, nil, nil, nil)
+
+ if len(nTypes) > 0 {
+
+ var cTypes map[reflect.Type][][]int // current level anonymous fields' types and indexes
+ vTypes := map[reflect.Type]bool{t: true} // visited field types at less nested levels
+
+ for len(nTypes) > 0 {
+ cTypes, nTypes = nTypes, nil
+
+ for t, idx := range cTypes {
+ // If there are multiple anonymous fields of the same struct type at the same level, all are ignored.
+ if len(idx) > 1 {
+ continue
+ }
+
+ // Anonymous field of the same type at deeper nested level is ignored.
+ if vTypes[t] {
+ continue
+ }
+ vTypes[t] = true
+
+ flds, nTypes = appendFields(t, idx[0], flds, nTypes)
+ }
+ }
+ }
+
+ sort.Sort(&nameLevelAndTagFieldSorter{flds})
+
+ // Keep visible fields.
+ j := 0 // index of next unique field
+ for i := 0; i < len(flds); {
+ name := flds[i].name
+ if i == len(flds)-1 || // last field
+ name != flds[i+1].name || // field i has unique field name
+ len(flds[i].idx) < len(flds[i+1].idx) || // field i is at a less nested level than field i+1
+ (flds[i].tagged && !flds[i+1].tagged) { // field i is tagged while field i+1 is not
+ flds[j] = flds[i]
+ j++
+ }
+
+ // Skip fields with the same field name.
+ for i++; i < len(flds) && name == flds[i].name; i++ { //nolint:revive
+ }
+ }
+ if j != len(flds) {
+ flds = flds[:j]
+ }
+
+ // Sort fields by field index
+ sort.Sort(&indexFieldSorter{flds})
+
+ return flds, structOptions
+}
+
+// appendFields appends type t's exportable fields to flds and anonymous struct fields to nTypes .
+func appendFields(
+ t reflect.Type,
+ idx []int,
+ flds fields,
+ nTypes map[reflect.Type][][]int,
+) (
+ _flds fields,
+ _nTypes map[reflect.Type][][]int,
+) {
+ for i := 0; i < t.NumField(); i++ {
+ f := t.Field(i)
+
+ ft := f.Type
+ for ft.Kind() == reflect.Ptr {
+ ft = ft.Elem()
+ }
+
+ if !isFieldExportable(f, ft.Kind()) {
+ continue
+ }
+
+ tag := f.Tag.Get("cbor")
+ if tag == "" {
+ tag = f.Tag.Get("json")
+ }
+ if tag == "-" {
+ continue
+ }
+
+ tagged := tag != ""
+
+ // Parse field tag options
+ var tagFieldName string
+ var omitempty, keyasint bool
+ for j := 0; tag != ""; j++ {
+ var token string
+ idx := strings.IndexByte(tag, ',')
+ if idx == -1 {
+ token, tag = tag, ""
+ } else {
+ token, tag = tag[:idx], tag[idx+1:]
+ }
+ if j == 0 {
+ tagFieldName = token
+ } else {
+ switch token {
+ case "omitempty":
+ omitempty = true
+ case "keyasint":
+ keyasint = true
+ }
+ }
+ }
+
+ fieldName := tagFieldName
+ if tagFieldName == "" {
+ fieldName = f.Name
+ }
+
+ fIdx := make([]int, len(idx)+1)
+ copy(fIdx, idx)
+ fIdx[len(fIdx)-1] = i
+
+ if !f.Anonymous || ft.Kind() != reflect.Struct || tagFieldName != "" {
+ flds = append(flds, &field{
+ name: fieldName,
+ idx: fIdx,
+ typ: f.Type,
+ omitEmpty: omitempty,
+ keyAsInt: keyasint,
+ tagged: tagged})
+ } else {
+ if nTypes == nil {
+ nTypes = make(map[reflect.Type][][]int)
+ }
+ nTypes[ft] = append(nTypes[ft], fIdx)
+ }
+ }
+
+ return flds, nTypes
+}
+
+// isFieldExportable returns true if f is an exportable (regular or anonymous) field or
+// a nonexportable anonymous field of struct type.
+// Nonexportable anonymous field of struct type can contain exportable fields.
+func isFieldExportable(f reflect.StructField, fk reflect.Kind) bool { //nolint:gocritic // ignore hugeParam
+ exportable := f.PkgPath == ""
+ return exportable || (f.Anonymous && fk == reflect.Struct)
+}
+
+type embeddedFieldNullPtrFunc func(reflect.Value) (reflect.Value, error)
+
+// getFieldValue returns field value of struct v by index. When encountering null pointer
+// to anonymous (embedded) struct field, f is called with the last traversed field value.
+func getFieldValue(v reflect.Value, idx []int, f embeddedFieldNullPtrFunc) (fv reflect.Value, err error) {
+ fv = v
+ for i, n := range idx {
+ fv = fv.Field(n)
+
+ if i < len(idx)-1 {
+ if fv.Kind() == reflect.Ptr && fv.Type().Elem().Kind() == reflect.Struct {
+ if fv.IsNil() {
+ // Null pointer to embedded struct field
+ fv, err = f(fv)
+ if err != nil || !fv.IsValid() {
+ return fv, err
+ }
+ }
+ fv = fv.Elem()
+ }
+ }
+ }
+ return fv, nil
+}
diff --git a/vendor/github.com/fxamacker/cbor/v2/tag.go b/vendor/github.com/fxamacker/cbor/v2/tag.go
new file mode 100644
index 00000000..5c4d2b7a
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/tag.go
@@ -0,0 +1,299 @@
+package cbor
+
+import (
+ "errors"
+ "fmt"
+ "reflect"
+ "sync"
+)
+
+// Tag represents CBOR tag data, including tag number and unmarshaled tag content. Marshaling and
+// unmarshaling of tag content is subject to any encode and decode options that would apply to
+// enclosed data item if it were to appear outside of a tag.
+type Tag struct {
+ Number uint64
+ Content interface{}
+}
+
+// RawTag represents CBOR tag data, including tag number and raw tag content.
+// RawTag implements Unmarshaler and Marshaler interfaces.
+type RawTag struct {
+ Number uint64
+ Content RawMessage
+}
+
+// UnmarshalCBOR sets *t with tag number and raw tag content copied from data.
+func (t *RawTag) UnmarshalCBOR(data []byte) error {
+ if t == nil {
+ return errors.New("cbor.RawTag: UnmarshalCBOR on nil pointer")
+ }
+
+ // Decoding CBOR null and undefined to cbor.RawTag is no-op.
+ if len(data) == 1 && (data[0] == 0xf6 || data[0] == 0xf7) {
+ return nil
+ }
+
+ d := decoder{data: data, dm: defaultDecMode}
+
+ // Unmarshal tag number.
+ typ, _, num := d.getHead()
+ if typ != cborTypeTag {
+ return &UnmarshalTypeError{CBORType: typ.String(), GoType: typeRawTag.String()}
+ }
+ t.Number = num
+
+ // Unmarshal tag content.
+ c := d.data[d.off:]
+ t.Content = make([]byte, len(c))
+ copy(t.Content, c)
+ return nil
+}
+
+// MarshalCBOR returns CBOR encoding of t.
+func (t RawTag) MarshalCBOR() ([]byte, error) {
+ if t.Number == 0 && len(t.Content) == 0 {
+ // Marshal uninitialized cbor.RawTag
+ b := make([]byte, len(cborNil))
+ copy(b, cborNil)
+ return b, nil
+ }
+
+ e := getEncodeBuffer()
+
+ encodeHead(e, byte(cborTypeTag), t.Number)
+
+ content := t.Content
+ if len(content) == 0 {
+ content = cborNil
+ }
+
+ buf := make([]byte, len(e.Bytes())+len(content))
+ n := copy(buf, e.Bytes())
+ copy(buf[n:], content)
+
+ putEncodeBuffer(e)
+ return buf, nil
+}
+
+// DecTagMode specifies how decoder handles tag number.
+type DecTagMode int
+
+const (
+ // DecTagIgnored makes decoder ignore tag number (skips if present).
+ DecTagIgnored DecTagMode = iota
+
+ // DecTagOptional makes decoder verify tag number if it's present.
+ DecTagOptional
+
+ // DecTagRequired makes decoder verify tag number and tag number must be present.
+ DecTagRequired
+
+ maxDecTagMode
+)
+
+func (dtm DecTagMode) valid() bool {
+ return dtm >= 0 && dtm < maxDecTagMode
+}
+
+// EncTagMode specifies how encoder handles tag number.
+type EncTagMode int
+
+const (
+ // EncTagNone makes encoder not encode tag number.
+ EncTagNone EncTagMode = iota
+
+ // EncTagRequired makes encoder encode tag number.
+ EncTagRequired
+
+ maxEncTagMode
+)
+
+func (etm EncTagMode) valid() bool {
+ return etm >= 0 && etm < maxEncTagMode
+}
+
+// TagOptions specifies how encoder and decoder handle tag number.
+type TagOptions struct {
+ DecTag DecTagMode
+ EncTag EncTagMode
+}
+
+// TagSet is an interface to add and remove tag info. It is used by EncMode and DecMode
+// to provide CBOR tag support.
+type TagSet interface {
+ // Add adds given tag number(s), content type, and tag options to TagSet.
+ Add(opts TagOptions, contentType reflect.Type, num uint64, nestedNum ...uint64) error
+
+ // Remove removes given tag content type from TagSet.
+ Remove(contentType reflect.Type)
+
+ tagProvider
+}
+
+type tagProvider interface {
+ getTagItemFromType(t reflect.Type) *tagItem
+ getTypeFromTagNum(num []uint64) reflect.Type
+}
+
+type tagItem struct {
+ num []uint64
+ cborTagNum []byte
+ contentType reflect.Type
+ opts TagOptions
+}
+
+func (t *tagItem) equalTagNum(num []uint64) bool {
+ // Fast path to compare 1 tag number
+ if len(t.num) == 1 && len(num) == 1 && t.num[0] == num[0] {
+ return true
+ }
+
+ if len(t.num) != len(num) {
+ return false
+ }
+
+ for i := 0; i < len(t.num); i++ {
+ if t.num[i] != num[i] {
+ return false
+ }
+ }
+
+ return true
+}
+
+type (
+ tagSet map[reflect.Type]*tagItem
+
+ syncTagSet struct {
+ sync.RWMutex
+ t tagSet
+ }
+)
+
+func (t tagSet) getTagItemFromType(typ reflect.Type) *tagItem {
+ return t[typ]
+}
+
+func (t tagSet) getTypeFromTagNum(num []uint64) reflect.Type {
+ for typ, tag := range t {
+ if tag.equalTagNum(num) {
+ return typ
+ }
+ }
+ return nil
+}
+
+// NewTagSet returns TagSet (safe for concurrency).
+func NewTagSet() TagSet {
+ return &syncTagSet{t: make(map[reflect.Type]*tagItem)}
+}
+
+// Add adds given tag number(s), content type, and tag options to TagSet.
+func (t *syncTagSet) Add(opts TagOptions, contentType reflect.Type, num uint64, nestedNum ...uint64) error {
+ if contentType == nil {
+ return errors.New("cbor: cannot add nil content type to TagSet")
+ }
+ for contentType.Kind() == reflect.Ptr {
+ contentType = contentType.Elem()
+ }
+ tag, err := newTagItem(opts, contentType, num, nestedNum...)
+ if err != nil {
+ return err
+ }
+ t.Lock()
+ defer t.Unlock()
+ for typ, ti := range t.t {
+ if typ == contentType {
+ return errors.New("cbor: content type " + contentType.String() + " already exists in TagSet")
+ }
+ if ti.equalTagNum(tag.num) {
+ return fmt.Errorf("cbor: tag number %v already exists in TagSet", tag.num)
+ }
+ }
+ t.t[contentType] = tag
+ return nil
+}
+
+// Remove removes given tag content type from TagSet.
+func (t *syncTagSet) Remove(contentType reflect.Type) {
+ for contentType.Kind() == reflect.Ptr {
+ contentType = contentType.Elem()
+ }
+ t.Lock()
+ delete(t.t, contentType)
+ t.Unlock()
+}
+
+func (t *syncTagSet) getTagItemFromType(typ reflect.Type) *tagItem {
+ t.RLock()
+ ti := t.t[typ]
+ t.RUnlock()
+ return ti
+}
+
+func (t *syncTagSet) getTypeFromTagNum(num []uint64) reflect.Type {
+ t.RLock()
+ rt := t.t.getTypeFromTagNum(num)
+ t.RUnlock()
+ return rt
+}
+
+func newTagItem(opts TagOptions, contentType reflect.Type, num uint64, nestedNum ...uint64) (*tagItem, error) {
+ if opts.DecTag == DecTagIgnored && opts.EncTag == EncTagNone {
+ return nil, errors.New("cbor: cannot add tag with DecTagIgnored and EncTagNone options to TagSet")
+ }
+ if contentType.PkgPath() == "" || contentType.Kind() == reflect.Interface {
+ return nil, errors.New("cbor: can only add named types to TagSet, got " + contentType.String())
+ }
+ if contentType == typeTime {
+ return nil, errors.New("cbor: cannot add time.Time to TagSet, use EncOptions.TimeTag and DecOptions.TimeTag instead")
+ }
+ if contentType == typeBigInt {
+ return nil, errors.New("cbor: cannot add big.Int to TagSet, it's built-in and supported automatically")
+ }
+ if contentType == typeTag {
+ return nil, errors.New("cbor: cannot add cbor.Tag to TagSet")
+ }
+ if contentType == typeRawTag {
+ return nil, errors.New("cbor: cannot add cbor.RawTag to TagSet")
+ }
+ if num == 0 || num == 1 {
+ return nil, errors.New("cbor: cannot add tag number 0 or 1 to TagSet, use EncOptions.TimeTag and DecOptions.TimeTag instead")
+ }
+ if num == 2 || num == 3 {
+ return nil, errors.New("cbor: cannot add tag number 2 or 3 to TagSet, it's built-in and supported automatically")
+ }
+ if num == tagNumSelfDescribedCBOR {
+ return nil, errors.New("cbor: cannot add tag number 55799 to TagSet, it's built-in and ignored automatically")
+ }
+
+ te := tagItem{num: []uint64{num}, opts: opts, contentType: contentType}
+ te.num = append(te.num, nestedNum...)
+
+ // Cache encoded tag numbers
+ e := getEncodeBuffer()
+ for _, n := range te.num {
+ encodeHead(e, byte(cborTypeTag), n)
+ }
+ te.cborTagNum = make([]byte, e.Len())
+ copy(te.cborTagNum, e.Bytes())
+ putEncodeBuffer(e)
+
+ return &te, nil
+}
+
+var (
+ typeTag = reflect.TypeOf(Tag{})
+ typeRawTag = reflect.TypeOf(RawTag{})
+)
+
+// WrongTagError describes mismatch between CBOR tag and registered tag.
+type WrongTagError struct {
+ RegisteredType reflect.Type
+ RegisteredTagNum []uint64
+ TagNum []uint64
+}
+
+func (e *WrongTagError) Error() string {
+ return fmt.Sprintf("cbor: wrong tag number for %s, got %v, expected %v", e.RegisteredType.String(), e.TagNum, e.RegisteredTagNum)
+}
diff --git a/vendor/github.com/fxamacker/cbor/v2/valid.go b/vendor/github.com/fxamacker/cbor/v2/valid.go
new file mode 100644
index 00000000..b40793b9
--- /dev/null
+++ b/vendor/github.com/fxamacker/cbor/v2/valid.go
@@ -0,0 +1,394 @@
+// Copyright (c) Faye Amacker. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+package cbor
+
+import (
+ "encoding/binary"
+ "errors"
+ "io"
+ "math"
+ "strconv"
+
+ "github.com/x448/float16"
+)
+
+// SyntaxError is a description of a CBOR syntax error.
+type SyntaxError struct {
+ msg string
+}
+
+func (e *SyntaxError) Error() string { return e.msg }
+
+// SemanticError is a description of a CBOR semantic error.
+type SemanticError struct {
+ msg string
+}
+
+func (e *SemanticError) Error() string { return e.msg }
+
+// MaxNestedLevelError indicates exceeded max nested level of any combination of CBOR arrays/maps/tags.
+type MaxNestedLevelError struct {
+ maxNestedLevels int
+}
+
+func (e *MaxNestedLevelError) Error() string {
+ return "cbor: exceeded max nested level " + strconv.Itoa(e.maxNestedLevels)
+}
+
+// MaxArrayElementsError indicates exceeded max number of elements for CBOR arrays.
+type MaxArrayElementsError struct {
+ maxArrayElements int
+}
+
+func (e *MaxArrayElementsError) Error() string {
+ return "cbor: exceeded max number of elements " + strconv.Itoa(e.maxArrayElements) + " for CBOR array"
+}
+
+// MaxMapPairsError indicates exceeded max number of key-value pairs for CBOR maps.
+type MaxMapPairsError struct {
+ maxMapPairs int
+}
+
+func (e *MaxMapPairsError) Error() string {
+ return "cbor: exceeded max number of key-value pairs " + strconv.Itoa(e.maxMapPairs) + " for CBOR map"
+}
+
+// IndefiniteLengthError indicates found disallowed indefinite length items.
+type IndefiniteLengthError struct {
+ t cborType
+}
+
+func (e *IndefiniteLengthError) Error() string {
+ return "cbor: indefinite-length " + e.t.String() + " isn't allowed"
+}
+
+// TagsMdError indicates found disallowed CBOR tags.
+type TagsMdError struct {
+}
+
+func (e *TagsMdError) Error() string {
+ return "cbor: CBOR tag isn't allowed"
+}
+
+// ExtraneousDataError indicates found extraneous data following well-formed CBOR data item.
+type ExtraneousDataError struct {
+ numOfBytes int // number of bytes of extraneous data
+ index int // location of extraneous data
+}
+
+func (e *ExtraneousDataError) Error() string {
+ return "cbor: " + strconv.Itoa(e.numOfBytes) + " bytes of extraneous data starting at index " + strconv.Itoa(e.index)
+}
+
+// wellformed checks whether the CBOR data item is well-formed.
+// allowExtraData indicates if extraneous data is allowed after the CBOR data item.
+// - use allowExtraData = true when using Decoder.Decode()
+// - use allowExtraData = false when using Unmarshal()
+func (d *decoder) wellformed(allowExtraData bool, checkBuiltinTags bool) error {
+ if len(d.data) == d.off {
+ return io.EOF
+ }
+ _, err := d.wellformedInternal(0, checkBuiltinTags)
+ if err == nil {
+ if !allowExtraData && d.off != len(d.data) {
+ err = &ExtraneousDataError{len(d.data) - d.off, d.off}
+ }
+ }
+ return err
+}
+
+// wellformedInternal checks data's well-formedness and returns max depth and error.
+func (d *decoder) wellformedInternal(depth int, checkBuiltinTags bool) (int, error) { //nolint:gocyclo
+ t, _, val, indefiniteLength, err := d.wellformedHeadWithIndefiniteLengthFlag()
+ if err != nil {
+ return 0, err
+ }
+
+ switch t {
+ case cborTypeByteString, cborTypeTextString:
+ if indefiniteLength {
+ if d.dm.indefLength == IndefLengthForbidden {
+ return 0, &IndefiniteLengthError{t}
+ }
+ return d.wellformedIndefiniteString(t, depth, checkBuiltinTags)
+ }
+ valInt := int(val)
+ if valInt < 0 {
+ // Detect integer overflow
+ return 0, errors.New("cbor: " + t.String() + " length " + strconv.FormatUint(val, 10) + " is too large, causing integer overflow")
+ }
+ if len(d.data)-d.off < valInt { // valInt+off may overflow integer
+ return 0, io.ErrUnexpectedEOF
+ }
+ d.off += valInt
+
+ case cborTypeArray, cborTypeMap:
+ depth++
+ if depth > d.dm.maxNestedLevels {
+ return 0, &MaxNestedLevelError{d.dm.maxNestedLevels}
+ }
+
+ if indefiniteLength {
+ if d.dm.indefLength == IndefLengthForbidden {
+ return 0, &IndefiniteLengthError{t}
+ }
+ return d.wellformedIndefiniteArrayOrMap(t, depth, checkBuiltinTags)
+ }
+
+ valInt := int(val)
+ if valInt < 0 {
+ // Detect integer overflow
+ return 0, errors.New("cbor: " + t.String() + " length " + strconv.FormatUint(val, 10) + " is too large, it would cause integer overflow")
+ }
+
+ if t == cborTypeArray {
+ if valInt > d.dm.maxArrayElements {
+ return 0, &MaxArrayElementsError{d.dm.maxArrayElements}
+ }
+ } else {
+ if valInt > d.dm.maxMapPairs {
+ return 0, &MaxMapPairsError{d.dm.maxMapPairs}
+ }
+ }
+
+ count := 1
+ if t == cborTypeMap {
+ count = 2
+ }
+ maxDepth := depth
+ for j := 0; j < count; j++ {
+ for i := 0; i < valInt; i++ {
+ var dpt int
+ if dpt, err = d.wellformedInternal(depth, checkBuiltinTags); err != nil {
+ return 0, err
+ }
+ if dpt > maxDepth {
+ maxDepth = dpt // Save max depth
+ }
+ }
+ }
+ depth = maxDepth
+
+ case cborTypeTag:
+ if d.dm.tagsMd == TagsForbidden {
+ return 0, &TagsMdError{}
+ }
+
+ tagNum := val
+
+ // Scan nested tag numbers to avoid recursion.
+ for {
+ if len(d.data) == d.off { // Tag number must be followed by tag content.
+ return 0, io.ErrUnexpectedEOF
+ }
+ if checkBuiltinTags {
+ err = validBuiltinTag(tagNum, d.data[d.off])
+ if err != nil {
+ return 0, err
+ }
+ }
+ if d.dm.bignumTag == BignumTagForbidden && (tagNum == 2 || tagNum == 3) {
+ return 0, &UnacceptableDataItemError{
+ CBORType: cborTypeTag.String(),
+ Message: "bignum",
+ }
+ }
+ if getType(d.data[d.off]) != cborTypeTag {
+ break
+ }
+ if _, _, tagNum, err = d.wellformedHead(); err != nil {
+ return 0, err
+ }
+ depth++
+ if depth > d.dm.maxNestedLevels {
+ return 0, &MaxNestedLevelError{d.dm.maxNestedLevels}
+ }
+ }
+ // Check tag content.
+ return d.wellformedInternal(depth, checkBuiltinTags)
+ }
+
+ return depth, nil
+}
+
+// wellformedIndefiniteString checks indefinite length byte/text string's well-formedness and returns max depth and error.
+func (d *decoder) wellformedIndefiniteString(t cborType, depth int, checkBuiltinTags bool) (int, error) {
+ var err error
+ for {
+ if len(d.data) == d.off {
+ return 0, io.ErrUnexpectedEOF
+ }
+ if isBreakFlag(d.data[d.off]) {
+ d.off++
+ break
+ }
+ // Peek ahead to get next type and indefinite length status.
+ nt, ai := parseInitialByte(d.data[d.off])
+ if t != nt {
+ return 0, &SyntaxError{"cbor: wrong element type " + nt.String() + " for indefinite-length " + t.String()}
+ }
+ if additionalInformation(ai).isIndefiniteLength() {
+ return 0, &SyntaxError{"cbor: indefinite-length " + t.String() + " chunk is not definite-length"}
+ }
+ if depth, err = d.wellformedInternal(depth, checkBuiltinTags); err != nil {
+ return 0, err
+ }
+ }
+ return depth, nil
+}
+
+// wellformedIndefiniteArrayOrMap checks indefinite length array/map's well-formedness and returns max depth and error.
+func (d *decoder) wellformedIndefiniteArrayOrMap(t cborType, depth int, checkBuiltinTags bool) (int, error) {
+ var err error
+ maxDepth := depth
+ i := 0
+ for {
+ if len(d.data) == d.off {
+ return 0, io.ErrUnexpectedEOF
+ }
+ if isBreakFlag(d.data[d.off]) {
+ d.off++
+ break
+ }
+ var dpt int
+ if dpt, err = d.wellformedInternal(depth, checkBuiltinTags); err != nil {
+ return 0, err
+ }
+ if dpt > maxDepth {
+ maxDepth = dpt
+ }
+ i++
+ if t == cborTypeArray {
+ if i > d.dm.maxArrayElements {
+ return 0, &MaxArrayElementsError{d.dm.maxArrayElements}
+ }
+ } else {
+ if i%2 == 0 && i/2 > d.dm.maxMapPairs {
+ return 0, &MaxMapPairsError{d.dm.maxMapPairs}
+ }
+ }
+ }
+ if t == cborTypeMap && i%2 == 1 {
+ return 0, &SyntaxError{"cbor: unexpected \"break\" code"}
+ }
+ return maxDepth, nil
+}
+
+func (d *decoder) wellformedHeadWithIndefiniteLengthFlag() (
+ t cborType,
+ ai byte,
+ val uint64,
+ indefiniteLength bool,
+ err error,
+) {
+ t, ai, val, err = d.wellformedHead()
+ if err != nil {
+ return
+ }
+ indefiniteLength = additionalInformation(ai).isIndefiniteLength()
+ return
+}
+
+func (d *decoder) wellformedHead() (t cborType, ai byte, val uint64, err error) {
+ dataLen := len(d.data) - d.off
+ if dataLen == 0 {
+ return 0, 0, 0, io.ErrUnexpectedEOF
+ }
+
+ t, ai = parseInitialByte(d.data[d.off])
+ val = uint64(ai)
+ d.off++
+ dataLen--
+
+ if ai <= maxAdditionalInformationWithoutArgument {
+ return t, ai, val, nil
+ }
+
+ if ai == additionalInformationWith1ByteArgument {
+ const argumentSize = 1
+ if dataLen < argumentSize {
+ return 0, 0, 0, io.ErrUnexpectedEOF
+ }
+ val = uint64(d.data[d.off])
+ d.off++
+ if t == cborTypePrimitives && val < 32 {
+ return 0, 0, 0, &SyntaxError{"cbor: invalid simple value " + strconv.Itoa(int(val)) + " for type " + t.String()}
+ }
+ return t, ai, val, nil
+ }
+
+ if ai == additionalInformationWith2ByteArgument {
+ const argumentSize = 2
+ if dataLen < argumentSize {
+ return 0, 0, 0, io.ErrUnexpectedEOF
+ }
+ val = uint64(binary.BigEndian.Uint16(d.data[d.off : d.off+argumentSize]))
+ d.off += argumentSize
+ if t == cborTypePrimitives {
+ if err := d.acceptableFloat(float64(float16.Frombits(uint16(val)).Float32())); err != nil {
+ return 0, 0, 0, err
+ }
+ }
+ return t, ai, val, nil
+ }
+
+ if ai == additionalInformationWith4ByteArgument {
+ const argumentSize = 4
+ if dataLen < argumentSize {
+ return 0, 0, 0, io.ErrUnexpectedEOF
+ }
+ val = uint64(binary.BigEndian.Uint32(d.data[d.off : d.off+argumentSize]))
+ d.off += argumentSize
+ if t == cborTypePrimitives {
+ if err := d.acceptableFloat(float64(math.Float32frombits(uint32(val)))); err != nil {
+ return 0, 0, 0, err
+ }
+ }
+ return t, ai, val, nil
+ }
+
+ if ai == additionalInformationWith8ByteArgument {
+ const argumentSize = 8
+ if dataLen < argumentSize {
+ return 0, 0, 0, io.ErrUnexpectedEOF
+ }
+ val = binary.BigEndian.Uint64(d.data[d.off : d.off+argumentSize])
+ d.off += argumentSize
+ if t == cborTypePrimitives {
+ if err := d.acceptableFloat(math.Float64frombits(val)); err != nil {
+ return 0, 0, 0, err
+ }
+ }
+ return t, ai, val, nil
+ }
+
+ if additionalInformation(ai).isIndefiniteLength() {
+ switch t {
+ case cborTypePositiveInt, cborTypeNegativeInt, cborTypeTag:
+ return 0, 0, 0, &SyntaxError{"cbor: invalid additional information " + strconv.Itoa(int(ai)) + " for type " + t.String()}
+ case cborTypePrimitives: // 0xff (break code) should not be outside wellformedIndefinite().
+ return 0, 0, 0, &SyntaxError{"cbor: unexpected \"break\" code"}
+ }
+ return t, ai, val, nil
+ }
+
+ // ai == 28, 29, 30
+ return 0, 0, 0, &SyntaxError{"cbor: invalid additional information " + strconv.Itoa(int(ai)) + " for type " + t.String()}
+}
+
+func (d *decoder) acceptableFloat(f float64) error {
+ switch {
+ case d.dm.nanDec == NaNDecodeForbidden && math.IsNaN(f):
+ return &UnacceptableDataItemError{
+ CBORType: cborTypePrimitives.String(),
+ Message: "floating-point NaN",
+ }
+ case d.dm.infDec == InfDecodeForbidden && math.IsInf(f, 0):
+ return &UnacceptableDataItemError{
+ CBORType: cborTypePrimitives.String(),
+ Message: "floating-point infinity",
+ }
+ }
+ return nil
+}
diff --git a/vendor/github.com/go-logr/logr/README.md b/vendor/github.com/go-logr/logr/README.md
index 8969526a..7c7f0c69 100644
--- a/vendor/github.com/go-logr/logr/README.md
+++ b/vendor/github.com/go-logr/logr/README.md
@@ -1,6 +1,7 @@
# A minimal logging API for Go
[![Go Reference](https://pkg.go.dev/badge/github.com/go-logr/logr.svg)](https://pkg.go.dev/github.com/go-logr/logr)
+[![Go Report Card](https://goreportcard.com/badge/github.com/go-logr/logr)](https://goreportcard.com/report/github.com/go-logr/logr)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/go-logr/logr/badge)](https://securityscorecards.dev/viewer/?platform=github.com&org=go-logr&repo=logr)
logr offers an(other) opinion on how Go programs and libraries can do logging
diff --git a/vendor/github.com/go-logr/logr/funcr/funcr.go b/vendor/github.com/go-logr/logr/funcr/funcr.go
index fb2f866f..30568e76 100644
--- a/vendor/github.com/go-logr/logr/funcr/funcr.go
+++ b/vendor/github.com/go-logr/logr/funcr/funcr.go
@@ -236,15 +236,14 @@ func newFormatter(opts Options, outfmt outputFormat) Formatter {
// implementation. It should be constructed with NewFormatter. Some of
// its methods directly implement logr.LogSink.
type Formatter struct {
- outputFormat outputFormat
- prefix string
- values []any
- valuesStr string
- parentValuesStr string
- depth int
- opts *Options
- group string // for slog groups
- groupDepth int
+ outputFormat outputFormat
+ prefix string
+ values []any
+ valuesStr string
+ depth int
+ opts *Options
+ groupName string // for slog groups
+ groups []groupDef
}
// outputFormat indicates which outputFormat to use.
@@ -257,6 +256,13 @@ const (
outputJSON
)
+// groupDef represents a saved group. The values may be empty, but we don't
+// know if we need to render the group until the final record is rendered.
+type groupDef struct {
+ name string
+ values string
+}
+
// PseudoStruct is a list of key-value pairs that gets logged as a struct.
type PseudoStruct []any
@@ -264,76 +270,102 @@ type PseudoStruct []any
func (f Formatter) render(builtins, args []any) string {
// Empirically bytes.Buffer is faster than strings.Builder for this.
buf := bytes.NewBuffer(make([]byte, 0, 1024))
+
if f.outputFormat == outputJSON {
- buf.WriteByte('{') // for the whole line
+ buf.WriteByte('{') // for the whole record
}
+ // Render builtins
vals := builtins
if hook := f.opts.RenderBuiltinsHook; hook != nil {
vals = hook(f.sanitize(vals))
}
- f.flatten(buf, vals, false, false) // keys are ours, no need to escape
+ f.flatten(buf, vals, false) // keys are ours, no need to escape
continuing := len(builtins) > 0
- if f.parentValuesStr != "" {
- if continuing {
- buf.WriteByte(f.comma())
+ // Turn the inner-most group into a string
+ argsStr := func() string {
+ buf := bytes.NewBuffer(make([]byte, 0, 1024))
+
+ vals = args
+ if hook := f.opts.RenderArgsHook; hook != nil {
+ vals = hook(f.sanitize(vals))
}
- buf.WriteString(f.parentValuesStr)
- continuing = true
- }
+ f.flatten(buf, vals, true) // escape user-provided keys
- groupDepth := f.groupDepth
- if f.group != "" {
- if f.valuesStr != "" || len(args) != 0 {
- if continuing {
- buf.WriteByte(f.comma())
- }
- buf.WriteString(f.quoted(f.group, true)) // escape user-provided keys
- buf.WriteByte(f.colon())
- buf.WriteByte('{') // for the group
- continuing = false
- } else {
- // The group was empty
- groupDepth--
+ return buf.String()
+ }()
+
+ // Render the stack of groups from the inside out.
+ bodyStr := f.renderGroup(f.groupName, f.valuesStr, argsStr)
+ for i := len(f.groups) - 1; i >= 0; i-- {
+ grp := &f.groups[i]
+ if grp.values == "" && bodyStr == "" {
+ // no contents, so we must elide the whole group
+ continue
}
+ bodyStr = f.renderGroup(grp.name, grp.values, bodyStr)
}
- if f.valuesStr != "" {
+ if bodyStr != "" {
if continuing {
buf.WriteByte(f.comma())
}
- buf.WriteString(f.valuesStr)
- continuing = true
+ buf.WriteString(bodyStr)
}
- vals = args
- if hook := f.opts.RenderArgsHook; hook != nil {
- vals = hook(f.sanitize(vals))
+ if f.outputFormat == outputJSON {
+ buf.WriteByte('}') // for the whole record
}
- f.flatten(buf, vals, continuing, true) // escape user-provided keys
- for i := 0; i < groupDepth; i++ {
- buf.WriteByte('}') // for the groups
+ return buf.String()
+}
+
+// renderGroup returns a string representation of the named group with rendered
+// values and args. If the name is empty, this will return the values and args,
+// joined. If the name is not empty, this will return a single key-value pair,
+// where the value is a grouping of the values and args. If the values and
+// args are both empty, this will return an empty string, even if the name was
+// specified.
+func (f Formatter) renderGroup(name string, values string, args string) string {
+ buf := bytes.NewBuffer(make([]byte, 0, 1024))
+
+ needClosingBrace := false
+ if name != "" && (values != "" || args != "") {
+ buf.WriteString(f.quoted(name, true)) // escape user-provided keys
+ buf.WriteByte(f.colon())
+ buf.WriteByte('{')
+ needClosingBrace = true
}
- if f.outputFormat == outputJSON {
- buf.WriteByte('}') // for the whole line
+ continuing := false
+ if values != "" {
+ buf.WriteString(values)
+ continuing = true
+ }
+
+ if args != "" {
+ if continuing {
+ buf.WriteByte(f.comma())
+ }
+ buf.WriteString(args)
+ }
+
+ if needClosingBrace {
+ buf.WriteByte('}')
}
return buf.String()
}
-// flatten renders a list of key-value pairs into a buffer. If continuing is
-// true, it assumes that the buffer has previous values and will emit a
-// separator (which depends on the output format) before the first pair it
-// writes. If escapeKeys is true, the keys are assumed to have
-// non-JSON-compatible characters in them and must be evaluated for escapes.
+// flatten renders a list of key-value pairs into a buffer. If escapeKeys is
+// true, the keys are assumed to have non-JSON-compatible characters in them
+// and must be evaluated for escapes.
//
// This function returns a potentially modified version of kvList, which
// ensures that there is a value for every key (adding a value if needed) and
// that each key is a string (substituting a key if needed).
-func (f Formatter) flatten(buf *bytes.Buffer, kvList []any, continuing bool, escapeKeys bool) []any {
+func (f Formatter) flatten(buf *bytes.Buffer, kvList []any, escapeKeys bool) []any {
// This logic overlaps with sanitize() but saves one type-cast per key,
// which can be measurable.
if len(kvList)%2 != 0 {
@@ -354,7 +386,7 @@ func (f Formatter) flatten(buf *bytes.Buffer, kvList []any, continuing bool, esc
}
v := kvList[i+1]
- if i > 0 || continuing {
+ if i > 0 {
if f.outputFormat == outputJSON {
buf.WriteByte(f.comma())
} else {
@@ -766,46 +798,17 @@ func (f Formatter) sanitize(kvList []any) []any {
// startGroup opens a new group scope (basically a sub-struct), which locks all
// the current saved values and starts them anew. This is needed to satisfy
// slog.
-func (f *Formatter) startGroup(group string) {
+func (f *Formatter) startGroup(name string) {
// Unnamed groups are just inlined.
- if group == "" {
+ if name == "" {
return
}
- // Any saved values can no longer be changed.
- buf := bytes.NewBuffer(make([]byte, 0, 1024))
- continuing := false
-
- if f.parentValuesStr != "" {
- buf.WriteString(f.parentValuesStr)
- continuing = true
- }
-
- if f.group != "" && f.valuesStr != "" {
- if continuing {
- buf.WriteByte(f.comma())
- }
- buf.WriteString(f.quoted(f.group, true)) // escape user-provided keys
- buf.WriteByte(f.colon())
- buf.WriteByte('{') // for the group
- continuing = false
- }
-
- if f.valuesStr != "" {
- if continuing {
- buf.WriteByte(f.comma())
- }
- buf.WriteString(f.valuesStr)
- }
-
- // NOTE: We don't close the scope here - that's done later, when a log line
- // is actually rendered (because we have N scopes to close).
-
- f.parentValuesStr = buf.String()
+ n := len(f.groups)
+ f.groups = append(f.groups[:n:n], groupDef{f.groupName, f.valuesStr})
// Start collecting new values.
- f.group = group
- f.groupDepth++
+ f.groupName = name
f.valuesStr = ""
f.values = nil
}
@@ -900,7 +903,7 @@ func (f *Formatter) AddValues(kvList []any) {
// Pre-render values, so we don't have to do it on each Info/Error call.
buf := bytes.NewBuffer(make([]byte, 0, 1024))
- f.flatten(buf, vals, false, true) // escape user-provided keys
+ f.flatten(buf, vals, true) // escape user-provided keys
f.valuesStr = buf.String()
}
diff --git a/vendor/github.com/go-openapi/jsonpointer/pointer.go b/vendor/github.com/go-openapi/jsonpointer/pointer.go
index d975773d..d970c7cf 100644
--- a/vendor/github.com/go-openapi/jsonpointer/pointer.go
+++ b/vendor/github.com/go-openapi/jsonpointer/pointer.go
@@ -264,7 +264,7 @@ func (p *Pointer) set(node, data any, nameProvider *swag.NameProvider) error {
knd := reflect.ValueOf(node).Kind()
if knd != reflect.Ptr && knd != reflect.Struct && knd != reflect.Map && knd != reflect.Slice && knd != reflect.Array {
- return fmt.Errorf("only structs, pointers, maps and slices are supported for setting values")
+ return errors.New("only structs, pointers, maps and slices are supported for setting values")
}
if nameProvider == nil {
diff --git a/vendor/github.com/go-openapi/swag/BENCHMARK.md b/vendor/github.com/go-openapi/swag/BENCHMARK.md
new file mode 100644
index 00000000..e7f28ed6
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/BENCHMARK.md
@@ -0,0 +1,52 @@
+# Benchmarks
+
+## Name mangling utilities
+
+```bash
+go test -bench XXX -run XXX -benchtime 30s
+```
+
+### Benchmarks at b3e7a5386f996177e4808f11acb2aa93a0f660df
+
+```
+goos: linux
+goarch: amd64
+pkg: github.com/go-openapi/swag
+cpu: Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
+BenchmarkToXXXName/ToGoName-4 862623 44101 ns/op 10450 B/op 732 allocs/op
+BenchmarkToXXXName/ToVarName-4 853656 40728 ns/op 10468 B/op 734 allocs/op
+BenchmarkToXXXName/ToFileName-4 1268312 27813 ns/op 9785 B/op 617 allocs/op
+BenchmarkToXXXName/ToCommandName-4 1276322 27903 ns/op 9785 B/op 617 allocs/op
+BenchmarkToXXXName/ToHumanNameLower-4 895334 40354 ns/op 10472 B/op 731 allocs/op
+BenchmarkToXXXName/ToHumanNameTitle-4 882441 40678 ns/op 10566 B/op 749 allocs/op
+```
+
+### Benchmarks after PR #79
+
+~ x10 performance improvement and ~ /100 memory allocations.
+
+```
+goos: linux
+goarch: amd64
+pkg: github.com/go-openapi/swag
+cpu: Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
+BenchmarkToXXXName/ToGoName-4 9595830 3991 ns/op 42 B/op 5 allocs/op
+BenchmarkToXXXName/ToVarName-4 9194276 3984 ns/op 62 B/op 7 allocs/op
+BenchmarkToXXXName/ToFileName-4 17002711 2123 ns/op 147 B/op 7 allocs/op
+BenchmarkToXXXName/ToCommandName-4 16772926 2111 ns/op 147 B/op 7 allocs/op
+BenchmarkToXXXName/ToHumanNameLower-4 9788331 3749 ns/op 92 B/op 6 allocs/op
+BenchmarkToXXXName/ToHumanNameTitle-4 9188260 3941 ns/op 104 B/op 6 allocs/op
+```
+
+```
+goos: linux
+goarch: amd64
+pkg: github.com/go-openapi/swag
+cpu: AMD Ryzen 7 5800X 8-Core Processor
+BenchmarkToXXXName/ToGoName-16 18527378 1972 ns/op 42 B/op 5 allocs/op
+BenchmarkToXXXName/ToVarName-16 15552692 2093 ns/op 62 B/op 7 allocs/op
+BenchmarkToXXXName/ToFileName-16 32161176 1117 ns/op 147 B/op 7 allocs/op
+BenchmarkToXXXName/ToCommandName-16 32256634 1137 ns/op 147 B/op 7 allocs/op
+BenchmarkToXXXName/ToHumanNameLower-16 18599661 1946 ns/op 92 B/op 6 allocs/op
+BenchmarkToXXXName/ToHumanNameTitle-16 17581353 2054 ns/op 105 B/op 6 allocs/op
+```
diff --git a/vendor/github.com/go-openapi/swag/initialism_index.go b/vendor/github.com/go-openapi/swag/initialism_index.go
index 03555184..20a359bb 100644
--- a/vendor/github.com/go-openapi/swag/initialism_index.go
+++ b/vendor/github.com/go-openapi/swag/initialism_index.go
@@ -16,9 +16,130 @@ package swag
import (
"sort"
+ "strings"
"sync"
)
+var (
+ // commonInitialisms are common acronyms that are kept as whole uppercased words.
+ commonInitialisms *indexOfInitialisms
+
+ // initialisms is a slice of sorted initialisms
+ initialisms []string
+
+ // a copy of initialisms pre-baked as []rune
+ initialismsRunes [][]rune
+ initialismsUpperCased [][]rune
+
+ isInitialism func(string) bool
+
+ maxAllocMatches int
+)
+
+func init() {
+ // Taken from https://github.com/golang/lint/blob/3390df4df2787994aea98de825b964ac7944b817/lint.go#L732-L769
+ configuredInitialisms := map[string]bool{
+ "ACL": true,
+ "API": true,
+ "ASCII": true,
+ "CPU": true,
+ "CSS": true,
+ "DNS": true,
+ "EOF": true,
+ "GUID": true,
+ "HTML": true,
+ "HTTPS": true,
+ "HTTP": true,
+ "ID": true,
+ "IP": true,
+ "IPv4": true,
+ "IPv6": true,
+ "JSON": true,
+ "LHS": true,
+ "OAI": true,
+ "QPS": true,
+ "RAM": true,
+ "RHS": true,
+ "RPC": true,
+ "SLA": true,
+ "SMTP": true,
+ "SQL": true,
+ "SSH": true,
+ "TCP": true,
+ "TLS": true,
+ "TTL": true,
+ "UDP": true,
+ "UI": true,
+ "UID": true,
+ "UUID": true,
+ "URI": true,
+ "URL": true,
+ "UTF8": true,
+ "VM": true,
+ "XML": true,
+ "XMPP": true,
+ "XSRF": true,
+ "XSS": true,
+ }
+
+ // a thread-safe index of initialisms
+ commonInitialisms = newIndexOfInitialisms().load(configuredInitialisms)
+ initialisms = commonInitialisms.sorted()
+ initialismsRunes = asRunes(initialisms)
+ initialismsUpperCased = asUpperCased(initialisms)
+ maxAllocMatches = maxAllocHeuristic(initialismsRunes)
+
+ // a test function
+ isInitialism = commonInitialisms.isInitialism
+}
+
+func asRunes(in []string) [][]rune {
+ out := make([][]rune, len(in))
+ for i, initialism := range in {
+ out[i] = []rune(initialism)
+ }
+
+ return out
+}
+
+func asUpperCased(in []string) [][]rune {
+ out := make([][]rune, len(in))
+
+ for i, initialism := range in {
+ out[i] = []rune(upper(trim(initialism)))
+ }
+
+ return out
+}
+
+func maxAllocHeuristic(in [][]rune) int {
+ heuristic := make(map[rune]int)
+ for _, initialism := range in {
+ heuristic[initialism[0]]++
+ }
+
+ var maxAlloc int
+ for _, val := range heuristic {
+ if val > maxAlloc {
+ maxAlloc = val
+ }
+ }
+
+ return maxAlloc
+}
+
+// AddInitialisms add additional initialisms
+func AddInitialisms(words ...string) {
+ for _, word := range words {
+ // commonInitialisms[upper(word)] = true
+ commonInitialisms.add(upper(word))
+ }
+ // sort again
+ initialisms = commonInitialisms.sorted()
+ initialismsRunes = asRunes(initialisms)
+ initialismsUpperCased = asUpperCased(initialisms)
+}
+
// indexOfInitialisms is a thread-safe implementation of the sorted index of initialisms.
// Since go1.9, this may be implemented with sync.Map.
type indexOfInitialisms struct {
@@ -55,7 +176,7 @@ func (m *indexOfInitialisms) add(key string) *indexOfInitialisms {
func (m *indexOfInitialisms) sorted() (result []string) {
m.sortMutex.Lock()
defer m.sortMutex.Unlock()
- m.index.Range(func(key, value interface{}) bool {
+ m.index.Range(func(key, _ interface{}) bool {
k := key.(string)
result = append(result, k)
return true
@@ -63,3 +184,19 @@ func (m *indexOfInitialisms) sorted() (result []string) {
sort.Sort(sort.Reverse(byInitialism(result)))
return
}
+
+type byInitialism []string
+
+func (s byInitialism) Len() int {
+ return len(s)
+}
+func (s byInitialism) Swap(i, j int) {
+ s[i], s[j] = s[j], s[i]
+}
+func (s byInitialism) Less(i, j int) bool {
+ if len(s[i]) != len(s[j]) {
+ return len(s[i]) < len(s[j])
+ }
+
+ return strings.Compare(s[i], s[j]) > 0
+}
diff --git a/vendor/github.com/go-openapi/swag/name_lexem.go b/vendor/github.com/go-openapi/swag/name_lexem.go
index aa7f6a9b..8bb64ac3 100644
--- a/vendor/github.com/go-openapi/swag/name_lexem.go
+++ b/vendor/github.com/go-openapi/swag/name_lexem.go
@@ -14,74 +14,80 @@
package swag
-import "unicode"
+import (
+ "unicode"
+ "unicode/utf8"
+)
type (
- nameLexem interface {
- GetUnsafeGoName() string
- GetOriginal() string
- IsInitialism() bool
- }
+ lexemKind uint8
- initialismNameLexem struct {
+ nameLexem struct {
original string
matchedInitialism string
+ kind lexemKind
}
+)
- casualNameLexem struct {
- original string
- }
+const (
+ lexemKindCasualName lexemKind = iota
+ lexemKindInitialismName
)
-func newInitialismNameLexem(original, matchedInitialism string) *initialismNameLexem {
- return &initialismNameLexem{
+func newInitialismNameLexem(original, matchedInitialism string) nameLexem {
+ return nameLexem{
+ kind: lexemKindInitialismName,
original: original,
matchedInitialism: matchedInitialism,
}
}
-func newCasualNameLexem(original string) *casualNameLexem {
- return &casualNameLexem{
+func newCasualNameLexem(original string) nameLexem {
+ return nameLexem{
+ kind: lexemKindCasualName,
original: original,
}
}
-func (l *initialismNameLexem) GetUnsafeGoName() string {
- return l.matchedInitialism
-}
+func (l nameLexem) GetUnsafeGoName() string {
+ if l.kind == lexemKindInitialismName {
+ return l.matchedInitialism
+ }
+
+ var (
+ first rune
+ rest string
+ )
-func (l *casualNameLexem) GetUnsafeGoName() string {
- var first rune
- var rest string
for i, orig := range l.original {
if i == 0 {
first = orig
continue
}
+
if i > 0 {
rest = l.original[i:]
break
}
}
+
if len(l.original) > 1 {
- return string(unicode.ToUpper(first)) + lower(rest)
+ b := poolOfBuffers.BorrowBuffer(utf8.UTFMax + len(rest))
+ defer func() {
+ poolOfBuffers.RedeemBuffer(b)
+ }()
+ b.WriteRune(unicode.ToUpper(first))
+ b.WriteString(lower(rest))
+ return b.String()
}
return l.original
}
-func (l *initialismNameLexem) GetOriginal() string {
+func (l nameLexem) GetOriginal() string {
return l.original
}
-func (l *casualNameLexem) GetOriginal() string {
- return l.original
-}
-
-func (l *initialismNameLexem) IsInitialism() bool {
- return true
-}
-
-func (l *casualNameLexem) IsInitialism() bool {
- return false
+func (l nameLexem) IsInitialism() bool {
+ return l.kind == lexemKindInitialismName
}
diff --git a/vendor/github.com/go-openapi/swag/split.go b/vendor/github.com/go-openapi/swag/split.go
index a1825fb7..274727a8 100644
--- a/vendor/github.com/go-openapi/swag/split.go
+++ b/vendor/github.com/go-openapi/swag/split.go
@@ -15,124 +15,269 @@
package swag
import (
+ "bytes"
+ "sync"
"unicode"
+ "unicode/utf8"
)
-var nameReplaceTable = map[rune]string{
- '@': "At ",
- '&': "And ",
- '|': "Pipe ",
- '$': "Dollar ",
- '!': "Bang ",
- '-': "",
- '_': "",
-}
-
type (
splitter struct {
- postSplitInitialismCheck bool
initialisms []string
+ initialismsRunes [][]rune
+ initialismsUpperCased [][]rune // initialisms cached in their trimmed, upper-cased version
+ postSplitInitialismCheck bool
+ }
+
+ splitterOption func(*splitter)
+
+ initialismMatch struct {
+ body []rune
+ start, end int
+ complete bool
+ }
+ initialismMatches []initialismMatch
+)
+
+type (
+ // memory pools of temporary objects.
+ //
+ // These are used to recycle temporarily allocated objects
+ // and relieve the GC from undue pressure.
+
+ matchesPool struct {
+ *sync.Pool
}
- splitterOption func(*splitter) *splitter
+ buffersPool struct {
+ *sync.Pool
+ }
+
+ lexemsPool struct {
+ *sync.Pool
+ }
+
+ splittersPool struct {
+ *sync.Pool
+ }
)
-// split calls the splitter; splitter provides more control and post options
+var (
+ // poolOfMatches holds temporary slices for recycling during the initialism match process
+ poolOfMatches = matchesPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ s := make(initialismMatches, 0, maxAllocMatches)
+
+ return &s
+ },
+ },
+ }
+
+ poolOfBuffers = buffersPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ return new(bytes.Buffer)
+ },
+ },
+ }
+
+ poolOfLexems = lexemsPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ s := make([]nameLexem, 0, maxAllocMatches)
+
+ return &s
+ },
+ },
+ }
+
+ poolOfSplitters = splittersPool{
+ Pool: &sync.Pool{
+ New: func() any {
+ s := newSplitter()
+
+ return &s
+ },
+ },
+ }
+)
+
+// nameReplaceTable finds a word representation for special characters.
+func nameReplaceTable(r rune) (string, bool) {
+ switch r {
+ case '@':
+ return "At ", true
+ case '&':
+ return "And ", true
+ case '|':
+ return "Pipe ", true
+ case '$':
+ return "Dollar ", true
+ case '!':
+ return "Bang ", true
+ case '-':
+ return "", true
+ case '_':
+ return "", true
+ default:
+ return "", false
+ }
+}
+
+// split calls the splitter.
+//
+// Use newSplitter for more control and options
func split(str string) []string {
- lexems := newSplitter().split(str)
- result := make([]string, 0, len(lexems))
+ s := poolOfSplitters.BorrowSplitter()
+ lexems := s.split(str)
+ result := make([]string, 0, len(*lexems))
- for _, lexem := range lexems {
+ for _, lexem := range *lexems {
result = append(result, lexem.GetOriginal())
}
+ poolOfLexems.RedeemLexems(lexems)
+ poolOfSplitters.RedeemSplitter(s)
return result
}
-func (s *splitter) split(str string) []nameLexem {
- return s.toNameLexems(str)
-}
-
-func newSplitter(options ...splitterOption) *splitter {
- splitter := &splitter{
+func newSplitter(options ...splitterOption) splitter {
+ s := splitter{
postSplitInitialismCheck: false,
initialisms: initialisms,
+ initialismsRunes: initialismsRunes,
+ initialismsUpperCased: initialismsUpperCased,
}
for _, option := range options {
- splitter = option(splitter)
+ option(&s)
}
- return splitter
+ return s
}
// withPostSplitInitialismCheck allows to catch initialisms after main split process
-func withPostSplitInitialismCheck(s *splitter) *splitter {
+func withPostSplitInitialismCheck(s *splitter) {
s.postSplitInitialismCheck = true
+}
+
+func (p matchesPool) BorrowMatches() *initialismMatches {
+ s := p.Get().(*initialismMatches)
+ *s = (*s)[:0] // reset slice, keep allocated capacity
+
return s
}
-type (
- initialismMatch struct {
- start, end int
- body []rune
- complete bool
+func (p buffersPool) BorrowBuffer(size int) *bytes.Buffer {
+ s := p.Get().(*bytes.Buffer)
+ s.Reset()
+
+ if s.Cap() < size {
+ s.Grow(size)
}
- initialismMatches []*initialismMatch
-)
-func (s *splitter) toNameLexems(name string) []nameLexem {
+ return s
+}
+
+func (p lexemsPool) BorrowLexems() *[]nameLexem {
+ s := p.Get().(*[]nameLexem)
+ *s = (*s)[:0] // reset slice, keep allocated capacity
+
+ return s
+}
+
+func (p splittersPool) BorrowSplitter(options ...splitterOption) *splitter {
+ s := p.Get().(*splitter)
+ s.postSplitInitialismCheck = false // reset options
+ for _, apply := range options {
+ apply(s)
+ }
+
+ return s
+}
+
+func (p matchesPool) RedeemMatches(s *initialismMatches) {
+ p.Put(s)
+}
+
+func (p buffersPool) RedeemBuffer(s *bytes.Buffer) {
+ p.Put(s)
+}
+
+func (p lexemsPool) RedeemLexems(s *[]nameLexem) {
+ p.Put(s)
+}
+
+func (p splittersPool) RedeemSplitter(s *splitter) {
+ p.Put(s)
+}
+
+func (m initialismMatch) isZero() bool {
+ return m.start == 0 && m.end == 0
+}
+
+func (s splitter) split(name string) *[]nameLexem {
nameRunes := []rune(name)
matches := s.gatherInitialismMatches(nameRunes)
+ if matches == nil {
+ return poolOfLexems.BorrowLexems()
+ }
+
return s.mapMatchesToNameLexems(nameRunes, matches)
}
-func (s *splitter) gatherInitialismMatches(nameRunes []rune) initialismMatches {
- matches := make(initialismMatches, 0)
+func (s splitter) gatherInitialismMatches(nameRunes []rune) *initialismMatches {
+ var matches *initialismMatches
for currentRunePosition, currentRune := range nameRunes {
- newMatches := make(initialismMatches, 0, len(matches))
+ // recycle these allocations as we loop over runes
+ // with such recycling, only 2 slices should be allocated per call
+ // instead of o(n).
+ newMatches := poolOfMatches.BorrowMatches()
// check current initialism matches
- for _, match := range matches {
- if keepCompleteMatch := match.complete; keepCompleteMatch {
- newMatches = append(newMatches, match)
- continue
- }
+ if matches != nil { // skip first iteration
+ for _, match := range *matches {
+ if keepCompleteMatch := match.complete; keepCompleteMatch {
+ *newMatches = append(*newMatches, match)
+ continue
+ }
- // drop failed match
- currentMatchRune := match.body[currentRunePosition-match.start]
- if !s.initialismRuneEqual(currentMatchRune, currentRune) {
- continue
- }
+ // drop failed match
+ currentMatchRune := match.body[currentRunePosition-match.start]
+ if currentMatchRune != currentRune {
+ continue
+ }
- // try to complete ongoing match
- if currentRunePosition-match.start == len(match.body)-1 {
- // we are close; the next step is to check the symbol ahead
- // if it is a small letter, then it is not the end of match
- // but beginning of the next word
-
- if currentRunePosition < len(nameRunes)-1 {
- nextRune := nameRunes[currentRunePosition+1]
- if newWord := unicode.IsLower(nextRune); newWord {
- // oh ok, it was the start of a new word
- continue
+ // try to complete ongoing match
+ if currentRunePosition-match.start == len(match.body)-1 {
+ // we are close; the next step is to check the symbol ahead
+ // if it is a small letter, then it is not the end of match
+ // but beginning of the next word
+
+ if currentRunePosition < len(nameRunes)-1 {
+ nextRune := nameRunes[currentRunePosition+1]
+ if newWord := unicode.IsLower(nextRune); newWord {
+ // oh ok, it was the start of a new word
+ continue
+ }
}
+
+ match.complete = true
+ match.end = currentRunePosition
}
- match.complete = true
- match.end = currentRunePosition
+ *newMatches = append(*newMatches, match)
}
-
- newMatches = append(newMatches, match)
}
// check for new initialism matches
- for _, initialism := range s.initialisms {
- initialismRunes := []rune(initialism)
- if s.initialismRuneEqual(initialismRunes[0], currentRune) {
- newMatches = append(newMatches, &initialismMatch{
+ for i := range s.initialisms {
+ initialismRunes := s.initialismsRunes[i]
+ if initialismRunes[0] == currentRune {
+ *newMatches = append(*newMatches, initialismMatch{
start: currentRunePosition,
body: initialismRunes,
complete: false,
@@ -140,24 +285,28 @@ func (s *splitter) gatherInitialismMatches(nameRunes []rune) initialismMatches {
}
}
+ if matches != nil {
+ poolOfMatches.RedeemMatches(matches)
+ }
matches = newMatches
}
+ // up to the caller to redeem this last slice
return matches
}
-func (s *splitter) mapMatchesToNameLexems(nameRunes []rune, matches initialismMatches) []nameLexem {
- nameLexems := make([]nameLexem, 0)
+func (s splitter) mapMatchesToNameLexems(nameRunes []rune, matches *initialismMatches) *[]nameLexem {
+ nameLexems := poolOfLexems.BorrowLexems()
- var lastAcceptedMatch *initialismMatch
- for _, match := range matches {
+ var lastAcceptedMatch initialismMatch
+ for _, match := range *matches {
if !match.complete {
continue
}
- if firstMatch := lastAcceptedMatch == nil; firstMatch {
- nameLexems = append(nameLexems, s.breakCasualString(nameRunes[:match.start])...)
- nameLexems = append(nameLexems, s.breakInitialism(string(match.body)))
+ if firstMatch := lastAcceptedMatch.isZero(); firstMatch {
+ s.appendBrokenDownCasualString(nameLexems, nameRunes[:match.start])
+ *nameLexems = append(*nameLexems, s.breakInitialism(string(match.body)))
lastAcceptedMatch = match
@@ -169,63 +318,66 @@ func (s *splitter) mapMatchesToNameLexems(nameRunes []rune, matches initialismMa
}
middle := nameRunes[lastAcceptedMatch.end+1 : match.start]
- nameLexems = append(nameLexems, s.breakCasualString(middle)...)
- nameLexems = append(nameLexems, s.breakInitialism(string(match.body)))
+ s.appendBrokenDownCasualString(nameLexems, middle)
+ *nameLexems = append(*nameLexems, s.breakInitialism(string(match.body)))
lastAcceptedMatch = match
}
// we have not found any accepted matches
- if lastAcceptedMatch == nil {
- return s.breakCasualString(nameRunes)
- }
-
- if lastAcceptedMatch.end+1 != len(nameRunes) {
+ if lastAcceptedMatch.isZero() {
+ *nameLexems = (*nameLexems)[:0]
+ s.appendBrokenDownCasualString(nameLexems, nameRunes)
+ } else if lastAcceptedMatch.end+1 != len(nameRunes) {
rest := nameRunes[lastAcceptedMatch.end+1:]
- nameLexems = append(nameLexems, s.breakCasualString(rest)...)
+ s.appendBrokenDownCasualString(nameLexems, rest)
}
- return nameLexems
-}
+ poolOfMatches.RedeemMatches(matches)
-func (s *splitter) initialismRuneEqual(a, b rune) bool {
- return a == b
+ return nameLexems
}
-func (s *splitter) breakInitialism(original string) nameLexem {
+func (s splitter) breakInitialism(original string) nameLexem {
return newInitialismNameLexem(original, original)
}
-func (s *splitter) breakCasualString(str []rune) []nameLexem {
- segments := make([]nameLexem, 0)
- currentSegment := ""
+func (s splitter) appendBrokenDownCasualString(segments *[]nameLexem, str []rune) {
+ currentSegment := poolOfBuffers.BorrowBuffer(len(str)) // unlike strings.Builder, bytes.Buffer initial storage can reused
+ defer func() {
+ poolOfBuffers.RedeemBuffer(currentSegment)
+ }()
addCasualNameLexem := func(original string) {
- segments = append(segments, newCasualNameLexem(original))
+ *segments = append(*segments, newCasualNameLexem(original))
}
addInitialismNameLexem := func(original, match string) {
- segments = append(segments, newInitialismNameLexem(original, match))
+ *segments = append(*segments, newInitialismNameLexem(original, match))
}
- addNameLexem := func(original string) {
- if s.postSplitInitialismCheck {
- for _, initialism := range s.initialisms {
- if upper(initialism) == upper(original) {
- addInitialismNameLexem(original, initialism)
+ var addNameLexem func(string)
+ if s.postSplitInitialismCheck {
+ addNameLexem = func(original string) {
+ for i := range s.initialisms {
+ if isEqualFoldIgnoreSpace(s.initialismsUpperCased[i], original) {
+ addInitialismNameLexem(original, s.initialisms[i])
+
return
}
}
- }
- addCasualNameLexem(original)
+ addCasualNameLexem(original)
+ }
+ } else {
+ addNameLexem = addCasualNameLexem
}
- for _, rn := range string(str) {
- if replace, found := nameReplaceTable[rn]; found {
- if currentSegment != "" {
- addNameLexem(currentSegment)
- currentSegment = ""
+ for _, rn := range str {
+ if replace, found := nameReplaceTable(rn); found {
+ if currentSegment.Len() > 0 {
+ addNameLexem(currentSegment.String())
+ currentSegment.Reset()
}
if replace != "" {
@@ -236,27 +388,121 @@ func (s *splitter) breakCasualString(str []rune) []nameLexem {
}
if !unicode.In(rn, unicode.L, unicode.M, unicode.N, unicode.Pc) {
- if currentSegment != "" {
- addNameLexem(currentSegment)
- currentSegment = ""
+ if currentSegment.Len() > 0 {
+ addNameLexem(currentSegment.String())
+ currentSegment.Reset()
}
continue
}
if unicode.IsUpper(rn) {
- if currentSegment != "" {
- addNameLexem(currentSegment)
+ if currentSegment.Len() > 0 {
+ addNameLexem(currentSegment.String())
}
- currentSegment = ""
+ currentSegment.Reset()
}
- currentSegment += string(rn)
+ currentSegment.WriteRune(rn)
+ }
+
+ if currentSegment.Len() > 0 {
+ addNameLexem(currentSegment.String())
}
+}
+
+// isEqualFoldIgnoreSpace is the same as strings.EqualFold, but
+// it ignores leading and trailing blank spaces in the compared
+// string.
+//
+// base is assumed to be composed of upper-cased runes, and be already
+// trimmed.
+//
+// This code is heavily inspired from strings.EqualFold.
+func isEqualFoldIgnoreSpace(base []rune, str string) bool {
+ var i, baseIndex int
+ // equivalent to b := []byte(str), but without data copy
+ b := hackStringBytes(str)
+
+ for i < len(b) {
+ if c := b[i]; c < utf8.RuneSelf {
+ // fast path for ASCII
+ if c != ' ' && c != '\t' {
+ break
+ }
+ i++
+
+ continue
+ }
+
+ // unicode case
+ r, size := utf8.DecodeRune(b[i:])
+ if !unicode.IsSpace(r) {
+ break
+ }
+ i += size
+ }
+
+ if i >= len(b) {
+ return len(base) == 0
+ }
+
+ for _, baseRune := range base {
+ if i >= len(b) {
+ break
+ }
+
+ if c := b[i]; c < utf8.RuneSelf {
+ // single byte rune case (ASCII)
+ if baseRune >= utf8.RuneSelf {
+ return false
+ }
+
+ baseChar := byte(baseRune)
+ if c != baseChar &&
+ !('a' <= c && c <= 'z' && c-'a'+'A' == baseChar) {
+ return false
+ }
+
+ baseIndex++
+ i++
+
+ continue
+ }
+
+ // unicode case
+ r, size := utf8.DecodeRune(b[i:])
+ if unicode.ToUpper(r) != baseRune {
+ return false
+ }
+ baseIndex++
+ i += size
+ }
+
+ if baseIndex != len(base) {
+ return false
+ }
+
+ // all passed: now we should only have blanks
+ for i < len(b) {
+ if c := b[i]; c < utf8.RuneSelf {
+ // fast path for ASCII
+ if c != ' ' && c != '\t' {
+ return false
+ }
+ i++
+
+ continue
+ }
+
+ // unicode case
+ r, size := utf8.DecodeRune(b[i:])
+ if !unicode.IsSpace(r) {
+ return false
+ }
- if currentSegment != "" {
- addNameLexem(currentSegment)
+ i += size
}
- return segments
+ return true
}
diff --git a/vendor/github.com/go-openapi/swag/string_bytes.go b/vendor/github.com/go-openapi/swag/string_bytes.go
new file mode 100644
index 00000000..90745d5c
--- /dev/null
+++ b/vendor/github.com/go-openapi/swag/string_bytes.go
@@ -0,0 +1,8 @@
+package swag
+
+import "unsafe"
+
+// hackStringBytes returns the (unsafe) underlying bytes slice of a string.
+func hackStringBytes(str string) []byte {
+ return unsafe.Slice(unsafe.StringData(str), len(str))
+}
diff --git a/vendor/github.com/go-openapi/swag/util.go b/vendor/github.com/go-openapi/swag/util.go
index 0413f744..5051401c 100644
--- a/vendor/github.com/go-openapi/swag/util.go
+++ b/vendor/github.com/go-openapi/swag/util.go
@@ -18,76 +18,25 @@ import (
"reflect"
"strings"
"unicode"
+ "unicode/utf8"
)
-// commonInitialisms are common acronyms that are kept as whole uppercased words.
-var commonInitialisms *indexOfInitialisms
-
-// initialisms is a slice of sorted initialisms
-var initialisms []string
-
-var isInitialism func(string) bool
-
// GoNamePrefixFunc sets an optional rule to prefix go names
// which do not start with a letter.
//
+// The prefix function is assumed to return a string that starts with an upper case letter.
+//
// e.g. to help convert "123" into "{prefix}123"
//
// The default is to prefix with "X"
var GoNamePrefixFunc func(string) string
-func init() {
- // Taken from https://github.com/golang/lint/blob/3390df4df2787994aea98de825b964ac7944b817/lint.go#L732-L769
- var configuredInitialisms = map[string]bool{
- "ACL": true,
- "API": true,
- "ASCII": true,
- "CPU": true,
- "CSS": true,
- "DNS": true,
- "EOF": true,
- "GUID": true,
- "HTML": true,
- "HTTPS": true,
- "HTTP": true,
- "ID": true,
- "IP": true,
- "IPv4": true,
- "IPv6": true,
- "JSON": true,
- "LHS": true,
- "OAI": true,
- "QPS": true,
- "RAM": true,
- "RHS": true,
- "RPC": true,
- "SLA": true,
- "SMTP": true,
- "SQL": true,
- "SSH": true,
- "TCP": true,
- "TLS": true,
- "TTL": true,
- "UDP": true,
- "UI": true,
- "UID": true,
- "UUID": true,
- "URI": true,
- "URL": true,
- "UTF8": true,
- "VM": true,
- "XML": true,
- "XMPP": true,
- "XSRF": true,
- "XSS": true,
+func prefixFunc(name, in string) string {
+ if GoNamePrefixFunc == nil {
+ return "X" + in
}
- // a thread-safe index of initialisms
- commonInitialisms = newIndexOfInitialisms().load(configuredInitialisms)
- initialisms = commonInitialisms.sorted()
-
- // a test function
- isInitialism = commonInitialisms.isInitialism
+ return GoNamePrefixFunc(name) + in
}
const (
@@ -156,22 +105,6 @@ func SplitByFormat(data, format string) []string {
return result
}
-type byInitialism []string
-
-func (s byInitialism) Len() int {
- return len(s)
-}
-func (s byInitialism) Swap(i, j int) {
- s[i], s[j] = s[j], s[i]
-}
-func (s byInitialism) Less(i, j int) bool {
- if len(s[i]) != len(s[j]) {
- return len(s[i]) < len(s[j])
- }
-
- return strings.Compare(s[i], s[j]) > 0
-}
-
// Removes leading whitespaces
func trim(str string) string {
return strings.TrimSpace(str)
@@ -188,15 +121,20 @@ func lower(str string) string {
}
// Camelize an uppercased word
-func Camelize(word string) (camelized string) {
+func Camelize(word string) string {
+ camelized := poolOfBuffers.BorrowBuffer(len(word))
+ defer func() {
+ poolOfBuffers.RedeemBuffer(camelized)
+ }()
+
for pos, ru := range []rune(word) {
if pos > 0 {
- camelized += string(unicode.ToLower(ru))
+ camelized.WriteRune(unicode.ToLower(ru))
} else {
- camelized += string(unicode.ToUpper(ru))
+ camelized.WriteRune(unicode.ToUpper(ru))
}
}
- return
+ return camelized.String()
}
// ToFileName lowercases and underscores a go type name
@@ -224,26 +162,31 @@ func ToCommandName(name string) string {
// ToHumanNameLower represents a code name as a human series of words
func ToHumanNameLower(name string) string {
- in := newSplitter(withPostSplitInitialismCheck).split(name)
- out := make([]string, 0, len(in))
+ s := poolOfSplitters.BorrowSplitter(withPostSplitInitialismCheck)
+ in := s.split(name)
+ poolOfSplitters.RedeemSplitter(s)
+ out := make([]string, 0, len(*in))
- for _, w := range in {
+ for _, w := range *in {
if !w.IsInitialism() {
out = append(out, lower(w.GetOriginal()))
} else {
out = append(out, trim(w.GetOriginal()))
}
}
+ poolOfLexems.RedeemLexems(in)
return strings.Join(out, " ")
}
// ToHumanNameTitle represents a code name as a human series of words with the first letters titleized
func ToHumanNameTitle(name string) string {
- in := newSplitter(withPostSplitInitialismCheck).split(name)
+ s := poolOfSplitters.BorrowSplitter(withPostSplitInitialismCheck)
+ in := s.split(name)
+ poolOfSplitters.RedeemSplitter(s)
- out := make([]string, 0, len(in))
- for _, w := range in {
+ out := make([]string, 0, len(*in))
+ for _, w := range *in {
original := trim(w.GetOriginal())
if !w.IsInitialism() {
out = append(out, Camelize(original))
@@ -251,6 +194,8 @@ func ToHumanNameTitle(name string) string {
out = append(out, original)
}
}
+ poolOfLexems.RedeemLexems(in)
+
return strings.Join(out, " ")
}
@@ -283,35 +228,70 @@ func ToVarName(name string) string {
// ToGoName translates a swagger name which can be underscored or camel cased to a name that golint likes
func ToGoName(name string) string {
- lexems := newSplitter(withPostSplitInitialismCheck).split(name)
+ s := poolOfSplitters.BorrowSplitter(withPostSplitInitialismCheck)
+ lexems := s.split(name)
+ poolOfSplitters.RedeemSplitter(s)
+ defer func() {
+ poolOfLexems.RedeemLexems(lexems)
+ }()
+ lexemes := *lexems
+
+ if len(lexemes) == 0 {
+ return ""
+ }
+
+ result := poolOfBuffers.BorrowBuffer(len(name))
+ defer func() {
+ poolOfBuffers.RedeemBuffer(result)
+ }()
+
+ // check if not starting with a letter, upper case
+ firstPart := lexemes[0].GetUnsafeGoName()
+ if lexemes[0].IsInitialism() {
+ firstPart = upper(firstPart)
+ }
+
+ if c := firstPart[0]; c < utf8.RuneSelf {
+ // ASCII
+ switch {
+ case 'A' <= c && c <= 'Z':
+ result.WriteString(firstPart)
+ case 'a' <= c && c <= 'z':
+ result.WriteByte(c - 'a' + 'A')
+ result.WriteString(firstPart[1:])
+ default:
+ result.WriteString(prefixFunc(name, firstPart))
+ // NOTE: no longer check if prefixFunc returns a string that starts with uppercase:
+ // assume this is always the case
+ }
+ } else {
+ // unicode
+ firstRune, _ := utf8.DecodeRuneInString(firstPart)
+ switch {
+ case !unicode.IsLetter(firstRune):
+ result.WriteString(prefixFunc(name, firstPart))
+ case !unicode.IsUpper(firstRune):
+ result.WriteString(prefixFunc(name, firstPart))
+ /*
+ result.WriteRune(unicode.ToUpper(firstRune))
+ result.WriteString(firstPart[offset:])
+ */
+ default:
+ result.WriteString(firstPart)
+ }
+ }
- result := ""
- for _, lexem := range lexems {
+ for _, lexem := range lexemes[1:] {
goName := lexem.GetUnsafeGoName()
// to support old behavior
if lexem.IsInitialism() {
goName = upper(goName)
}
- result += goName
+ result.WriteString(goName)
}
- if len(result) > 0 {
- // Only prefix with X when the first character isn't an ascii letter
- first := []rune(result)[0]
- if !unicode.IsLetter(first) || (first > unicode.MaxASCII && !unicode.IsUpper(first)) {
- if GoNamePrefixFunc == nil {
- return "X" + result
- }
- result = GoNamePrefixFunc(name) + result
- }
- first = []rune(result)[0]
- if unicode.IsLetter(first) && !unicode.IsUpper(first) {
- result = string(append([]rune{unicode.ToUpper(first)}, []rune(result)[1:]...))
- }
- }
-
- return result
+ return result.String()
}
// ContainsStrings searches a slice of strings for a case-sensitive match
@@ -376,16 +356,6 @@ func IsZero(data interface{}) bool {
}
}
-// AddInitialisms add additional initialisms
-func AddInitialisms(words ...string) {
- for _, word := range words {
- // commonInitialisms[upper(word)] = true
- commonInitialisms.add(upper(word))
- }
- // sort again
- initialisms = commonInitialisms.sorted()
-}
-
// CommandLineOptionsGroup represents a group of user-defined command line options
type CommandLineOptionsGroup struct {
ShortDescription string
diff --git a/vendor/github.com/go-openapi/swag/yaml.go b/vendor/github.com/go-openapi/swag/yaml.go
index a8c4e359..f59e0259 100644
--- a/vendor/github.com/go-openapi/swag/yaml.go
+++ b/vendor/github.com/go-openapi/swag/yaml.go
@@ -16,6 +16,7 @@ package swag
import (
"encoding/json"
+ "errors"
"fmt"
"path/filepath"
"reflect"
@@ -50,7 +51,7 @@ func BytesToYAMLDoc(data []byte) (interface{}, error) {
return nil, err
}
if document.Kind != yaml.DocumentNode || len(document.Content) != 1 || document.Content[0].Kind != yaml.MappingNode {
- return nil, fmt.Errorf("only YAML documents that are objects are supported")
+ return nil, errors.New("only YAML documents that are objects are supported")
}
return &document, nil
}
diff --git a/vendor/github.com/go-resty/resty/v2/.gitignore b/vendor/github.com/go-resty/resty/v2/.gitignore
index 9e856bd4..7542ac89 100644
--- a/vendor/github.com/go-resty/resty/v2/.gitignore
+++ b/vendor/github.com/go-resty/resty/v2/.gitignore
@@ -26,5 +26,6 @@ _testmain.go
coverage.out
coverage.txt
-# Exclude intellij IDE folders
+# Exclude IDE folders
.idea/*
+.vscode/*
diff --git a/vendor/github.com/go-resty/resty/v2/BUILD.bazel b/vendor/github.com/go-resty/resty/v2/BUILD.bazel
index f461c29d..7248abc5 100644
--- a/vendor/github.com/go-resty/resty/v2/BUILD.bazel
+++ b/vendor/github.com/go-resty/resty/v2/BUILD.bazel
@@ -1,5 +1,5 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
load("@bazel_gazelle//:def.bzl", "gazelle")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
# gazelle:prefix github.com/go-resty/resty/v2
# gazelle:go_naming_convention import_alias
@@ -17,15 +17,19 @@ go_library(
"resty.go",
"retry.go",
"trace.go",
- "transport_js.go",
- "transport_other.go",
"transport.go",
"transport112.go",
+ "transport_js.go",
+ "transport_other.go",
"util.go",
+ "util_curl.go",
],
importpath = "github.com/go-resty/resty/v2",
visibility = ["//visibility:public"],
- deps = ["@org_golang_x_net//publicsuffix:go_default_library"],
+ deps = [
+ "//shellescape",
+ "@org_golang_x_net//publicsuffix:go_default_library",
+ ],
)
go_test(
@@ -34,6 +38,7 @@ go_test(
"client_test.go",
"context_test.go",
"example_test.go",
+ "middleware_test.go",
"request_test.go",
"resty_test.go",
"retry_test.go",
@@ -41,7 +46,10 @@ go_test(
],
data = glob([".testdata/*"]),
embed = [":resty"],
- deps = ["@org_golang_x_net//proxy:go_default_library"],
+ deps = [
+ "@org_golang_x_net//proxy:go_default_library",
+ "@org_golang_x_time//rate:go_default_library",
+ ],
)
alias(
diff --git a/vendor/github.com/go-resty/resty/v2/LICENSE b/vendor/github.com/go-resty/resty/v2/LICENSE
index 0c2d38a3..de30fea8 100644
--- a/vendor/github.com/go-resty/resty/v2/LICENSE
+++ b/vendor/github.com/go-resty/resty/v2/LICENSE
@@ -1,6 +1,6 @@
The MIT License (MIT)
-Copyright (c) 2015-2023 Jeevanandam M., https://myjeeva.com
+Copyright (c) 2015-2024 Jeevanandam M., https://myjeeva.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/vendor/github.com/go-resty/resty/v2/README.md b/vendor/github.com/go-resty/resty/v2/README.md
index d6d501ef..7592ca95 100644
--- a/vendor/github.com/go-resty/resty/v2/README.md
+++ b/vendor/github.com/go-resty/resty/v2/README.md
@@ -4,16 +4,12 @@
Features section describes in detail about Resty capabilities
-
-
-
-
Resty Communication Channels
-
+
## News
- * v2.11.0 [released](https://github.com/go-resty/resty/releases/tag/v2.11.0) and tagged on Dec 27, 2023.
+ * v2.16.2 [released](https://github.com/go-resty/resty/releases/tag/v2.16.2) and tagged on Nov 21, 2024.
* v2.0.0 [released](https://github.com/go-resty/resty/releases/tag/v2.0.0) and tagged on Jul 16, 2019.
* v1.12.0 [released](https://github.com/go-resty/resty/releases/tag/v1.12.0) and tagged on Feb 27, 2019.
* v1.0 released and tagged on Sep 25, 2017. - Resty's first version was released on Sep 15, 2015 then it grew gradually as a very handy and helpful library. Its been a two years since first release. I'm very thankful to Resty users and its [contributors](https://github.com/go-resty/resty/graphs/contributors).
@@ -62,9 +58,10 @@
* goroutine concurrent safe
* Resty Client trace, see [Client.EnableTrace](https://pkg.go.dev/github.com/go-resty/resty/v2#Client.EnableTrace) and [Request.EnableTrace](https://pkg.go.dev/github.com/go-resty/resty/v2#Request.EnableTrace)
* Since v2.4.0, trace info contains a `RequestAttempt` value, and the `Request` object contains an `Attempt` attribute
+ * Supports on-demand CURL command generation, see [Client.EnableGenerateCurlOnDebug](https://pkg.go.dev/github.com/go-resty/resty/v2#Client.EnableGenerateCurlOnDebug), [Request.EnableGenerateCurlOnDebug](https://pkg.go.dev/github.com/go-resty/resty/v2#Request.EnableGenerateCurlOnDebug). It requires debug mode to be enabled.
* Debug mode - clean and informative logging presentation
* Gzip - Go does it automatically also resty has fallback handling too
- * Works fine with `HTTP/2` and `HTTP/1.1`
+ * Works fine with `HTTP/2` and `HTTP/1.1`, also `HTTP/3` can be used with Resty, see this [comment](https://github.com/go-resty/resty/issues/846#issuecomment-2329696110)
* [Bazel support](#bazel-support)
* Easily mock Resty for testing, [for e.g.](#mocking-http-requests-using-httpmock-library)
* Well tested client library
@@ -86,7 +83,7 @@
#### Supported Go Versions
-Recommended to use `go1.16` and above.
+Recommended to use `go1.20` and above.
Initially Resty started supporting `go modules` since `v1.10.0` release.
@@ -101,8 +98,6 @@ Starting Resty v2 and higher versions, it fully embraces [go modules](https://gi
Resty author also published following projects for Go Community.
- * [aah framework](https://aahframework.org) - A secure, flexible, rapid Go web framework.
- * [THUMBAI](https://thumbai.app) - Go Mod Repository, Go Vanity Service and Simple Proxy Server.
* [go-model](https://github.com/jeevatkm/go-model) - Robust & Easy to use model mapper and utility methods for Go `struct`.
@@ -110,7 +105,7 @@ Resty author also published following projects for Go Community.
```bash
# Go Modules
-require github.com/go-resty/resty/v2 v2.11.0
+require github.com/go-resty/resty/v2 v2.16.2
```
## Usage
@@ -558,6 +553,30 @@ client.OnError(func(req *resty.Request, err error) {
})
```
+#### Generate CURL Command
+>Refer: [curl_cmd_test.go](https://github.com/go-resty/resty/blob/v2/curl_cmd_test.go)
+
+```go
+// Create a Resty Client
+client := resty.New()
+
+resp, err := client.R().
+ SetDebug(true).
+ EnableGenerateCurlOnDebug(). // CURL command generated when debug mode enabled with this option
+ SetBody(map[string]string{"name": "Alex"}).
+ Post("https://httpbin.org/post")
+
+curlCmdExecuted := resp.Request.GenerateCurlCommand()
+
+// Explore curl command
+fmt.Println("Curl Command:\n ", curlCmdExecuted+"\n")
+
+/* Output
+Curl Command:
+ curl -X POST -H 'Content-Type: application/json' -H 'User-Agent: go-resty/2.14.0 (https://github.com/go-resty/resty)' -d '{"name":"Alex"}' https://httpbin.org/post
+*/
+```
+
#### Redirect Policy
Resty provides few ready to use redirect policy(s) also it supports multiple policies together.
@@ -702,8 +721,8 @@ client.
})
```
-By default, resty will retry requests that return a non-nil error during execution.
-Therefore, the above setup will result in resty retrying requests with non-nil errors up to 3 times,
+By default, resty will retry requests that return a non-nil error during execution.
+Therefore, the above setup will result in resty retrying requests with non-nil errors up to 3 times,
with the delay increasing after each attempt.
You can optionally provide client with [custom retry conditions](https://pkg.go.dev/github.com/go-resty/resty/v2#RetryConditionFunc):
@@ -739,7 +758,7 @@ client.AddRetryCondition(
)
```
-Multiple retry conditions can be added.
+Multiple retry conditions can be added.
Note that if multiple conditions are specified, a retry will occur if any of the conditions are met.
It is also possible to use `resty.Backoff(...)` to get arbitrary retry scenarios
@@ -797,7 +816,7 @@ client.SetTimeout(1 * time.Minute)
// You can override all below settings and options at request level if you want to
//--------------------------------------------------------------------------------
// Host URL for all request. So you can use relative URL in the request
-client.SetHostURL("http://httpbin.org")
+client.SetBaseURL("http://httpbin.org")
// Headers for all request
client.SetHeader("Accept", "application/json")
@@ -861,7 +880,7 @@ client := resty.New()
// Set the previous transport that we created, set the scheme of the communication to the
// socket and set the unixSocket as the HostURL.
-client.SetTransport(&transport).SetScheme("http").SetHostURL(unixSocket)
+client.SetTransport(&transport).SetScheme("http").SetBaseURL(unixSocket)
// No need to write the host's URL on the request, just the path.
client.R().Get("http://localhost/index.html")
diff --git a/vendor/github.com/go-resty/resty/v2/WORKSPACE b/vendor/github.com/go-resty/resty/v2/WORKSPACE
index 9ef03e95..504de145 100644
--- a/vendor/github.com/go-resty/resty/v2/WORKSPACE
+++ b/vendor/github.com/go-resty/resty/v2/WORKSPACE
@@ -4,10 +4,10 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "io_bazel_rules_go",
- sha256 = "69de5c704a05ff37862f7e0f5534d4f479418afc21806c887db544a316f3cb6b",
+ sha256 = "80a98277ad1311dacd837f9b16db62887702e9f1d1c4c9f796d0121a46c8e184",
urls = [
- "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.27.0/rules_go-v0.27.0.tar.gz",
- "https://github.com/bazelbuild/rules_go/releases/download/v0.27.0/rules_go-v0.27.0.tar.gz",
+ "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.46.0/rules_go-v0.46.0.zip",
+ "https://github.com/bazelbuild/rules_go/releases/download/v0.46.0/rules_go-v0.46.0.zip",
],
)
@@ -24,7 +24,7 @@ load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_depe
go_rules_dependencies()
-go_register_toolchains(version = "1.16")
+go_register_toolchains(version = "1.19")
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
diff --git a/vendor/github.com/go-resty/resty/v2/client.go b/vendor/github.com/go-resty/resty/v2/client.go
index 446ba851..7ab33ae8 100644
--- a/vendor/github.com/go-resty/resty/v2/client.go
+++ b/vendor/github.com/go-resty/resty/v2/client.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2015-2023 Jeevanandam M (jeeva@myjeeva.com), All rights reserved.
+// Copyright (c) 2015-2024 Jeevanandam M (jeeva@myjeeva.com), All rights reserved.
// resty source code and usage is governed by a MIT style
// license that can be found in the LICENSE file.
@@ -92,11 +92,11 @@ type (
SuccessHook func(*Client, *Response)
)
-// Client struct is used to create Resty client with client level settings,
-// these settings are applicable to all the request raised from the client.
+// Client struct is used to create a Resty client with client-level settings,
+// these settings apply to all the requests raised from the client.
//
-// Resty also provides an options to override most of the client settings
-// at request level.
+// Resty also provides an option to override most of the client settings
+// at [Request] level.
type Client struct {
BaseURL string
HostURL string // Deprecated: use BaseURL instead. To be removed in v3.0.0 release.
@@ -128,6 +128,7 @@ type Client struct {
// HeaderAuthorizationKey is used to set/access Request Authorization header
// value when `SetAuthToken` option is used.
HeaderAuthorizationKey string
+ ResponseBodyLimit int
jsonEscapeHTML bool
setContentLength bool
@@ -142,17 +143,19 @@ type Client struct {
proxyURL *url.URL
beforeRequest []RequestMiddleware
udBeforeRequest []RequestMiddleware
- udBeforeRequestLock sync.RWMutex
+ udBeforeRequestLock *sync.RWMutex
preReqHook PreRequestHook
successHooks []SuccessHook
afterResponse []ResponseMiddleware
- afterResponseLock sync.RWMutex
+ afterResponseLock *sync.RWMutex
requestLog RequestLogCallback
responseLog ResponseLogCallback
errorHooks []ErrorHook
invalidHooks []ErrorHook
panicHooks []ErrorHook
rateLimiter RateLimiter
+ generateCurlOnDebug bool
+ unescapeQueryParams bool
}
// User type is to hold an username and password information
@@ -164,8 +167,8 @@ type User struct {
// Client methods
//___________________________________
-// SetHostURL method is to set Host URL in the client instance. It will be used with request
-// raised from this client with relative URL
+// SetHostURL method sets the Host URL in the client instance. It will be used with a request
+// raised from this client with a relative URL
//
// // Setting HTTP address
// client.SetHostURL("http://myjeeva.com")
@@ -173,22 +176,20 @@ type User struct {
// // Setting HTTPS address
// client.SetHostURL("https://myjeeva.com")
//
-// Deprecated: use SetBaseURL instead. To be removed in v3.0.0 release.
+// Deprecated: use [Client.SetBaseURL] instead. To be removed in the v3.0.0 release.
func (c *Client) SetHostURL(url string) *Client {
c.SetBaseURL(url)
return c
}
-// SetBaseURL method is to set Base URL in the client instance. It will be used with request
-// raised from this client with relative URL
+// SetBaseURL method sets the Base URL in the client instance. It will be used with a request
+// raised from this client with a relative URL
//
// // Setting HTTP address
// client.SetBaseURL("http://myjeeva.com")
//
// // Setting HTTPS address
// client.SetBaseURL("https://myjeeva.com")
-//
-// Since v2.7.0
func (c *Client) SetBaseURL(url string) *Client {
c.BaseURL = strings.TrimRight(url, "/")
c.HostURL = c.BaseURL
@@ -196,10 +197,10 @@ func (c *Client) SetBaseURL(url string) *Client {
}
// SetHeader method sets a single header field and its value in the client instance.
-// These headers will be applied to all requests raised from this client instance.
-// Also it can be overridden at request level header options.
+// These headers will be applied to all requests from this client instance.
+// Also, it can be overridden by request-level header options.
//
-// See `Request.SetHeader` or `Request.SetHeaders`.
+// See [Request.SetHeader] or [Request.SetHeaders].
//
// For Example: To set `Content-Type` and `Accept` as `application/json`
//
@@ -211,11 +212,11 @@ func (c *Client) SetHeader(header, value string) *Client {
return c
}
-// SetHeaders method sets multiple headers field and its values at one go in the client instance.
-// These headers will be applied to all requests raised from this client instance. Also it can be
+// SetHeaders method sets multiple header fields and their values at one go in the client instance.
+// These headers will be applied to all requests from this client instance. Also, it can be
// overridden at request level headers options.
//
-// See `Request.SetHeaders` or `Request.SetHeader`.
+// See [Request.SetHeaders] or [Request.SetHeader].
//
// For Example: To set `Content-Type` and `Accept` as `application/json`
//
@@ -230,25 +231,21 @@ func (c *Client) SetHeaders(headers map[string]string) *Client {
return c
}
-// SetHeaderVerbatim method is to set a single header field and its value verbatim in the current request.
+// SetHeaderVerbatim method sets a single header field and its value verbatim in the current request.
//
// For Example: To set `all_lowercase` and `UPPERCASE` as `available`.
//
-// client.R().
+// client.
// SetHeaderVerbatim("all_lowercase", "available").
// SetHeaderVerbatim("UPPERCASE", "available")
-//
-// Also you can override header value, which was set at client instance level.
-//
-// Since v2.6.0
func (c *Client) SetHeaderVerbatim(header, value string) *Client {
c.Header[header] = []string{value}
return c
}
-// SetCookieJar method sets custom http.CookieJar in the resty client. Its way to override default.
+// SetCookieJar method sets custom [http.CookieJar] in the resty client. It's a way to override the default.
//
-// For Example: sometimes we don't want to save cookies in api contacting, we can remove the default
+// For Example, sometimes we don't want to save cookies in API mode so that we can remove the default
// CookieJar in resty client.
//
// client.SetCookieJar(nil)
@@ -257,8 +254,8 @@ func (c *Client) SetCookieJar(jar http.CookieJar) *Client {
return c
}
-// SetCookie method appends a single cookie in the client instance.
-// These cookies will be added to all the request raised from this client instance.
+// SetCookie method appends a single cookie to the client instance.
+// These cookies will be added to all the requests from this client instance.
//
// client.SetCookie(&http.Cookie{
// Name:"go-resty",
@@ -270,7 +267,7 @@ func (c *Client) SetCookie(hc *http.Cookie) *Client {
}
// SetCookies method sets an array of cookies in the client instance.
-// These cookies will be added to all the request raised from this client instance.
+// These cookies will be added to all the requests from this client instance.
//
// cookies := []*http.Cookie{
// &http.Cookie{
@@ -290,14 +287,15 @@ func (c *Client) SetCookies(cs []*http.Cookie) *Client {
return c
}
-// SetQueryParam method sets single parameter and its value in the client instance.
-// It will be formed as query string for the request.
+// SetQueryParam method sets a single parameter and its value in the client instance.
+// It will be formed as a query string for the request.
+//
+// For Example: `search=kitchen%20papers&size=large`
//
-// For Example: `search=kitchen%20papers&size=large`
-// in the URL after `?` mark. These query params will be added to all the request raised from
-// this client instance. Also it can be overridden at request level Query Param options.
+// In the URL after the `?` mark. These query params will be added to all the requests raised from
+// this client instance. Also, it can be overridden at the request level.
//
-// See `Request.SetQueryParam` or `Request.SetQueryParams`.
+// See [Request.SetQueryParam] or [Request.SetQueryParams].
//
// client.
// SetQueryParam("search", "kitchen papers").
@@ -308,13 +306,14 @@ func (c *Client) SetQueryParam(param, value string) *Client {
}
// SetQueryParams method sets multiple parameters and their values at one go in the client instance.
-// It will be formed as query string for the request.
+// It will be formed as a query string for the request.
+//
+// For Example: `search=kitchen%20papers&size=large`
//
-// For Example: `search=kitchen%20papers&size=large`
-// in the URL after `?` mark. These query params will be added to all the request raised from this
-// client instance. Also it can be overridden at request level Query Param options.
+// In the URL after the `?` mark. These query params will be added to all the requests raised from this
+// client instance. Also, it can be overridden at the request level.
//
-// See `Request.SetQueryParams` or `Request.SetQueryParam`.
+// See [Request.SetQueryParams] or [Request.SetQueryParam].
//
// client.SetQueryParams(map[string]string{
// "search": "kitchen papers",
@@ -327,12 +326,23 @@ func (c *Client) SetQueryParams(params map[string]string) *Client {
return c
}
+// SetUnescapeQueryParams method sets the unescape query parameters choice for request URL.
+// To prevent broken URL, resty replaces space (" ") with "+" in the query parameters.
+//
+// See [Request.SetUnescapeQueryParams]
+//
+// NOTE: Request failure is possible due to non-standard usage of Unescaped Query Parameters.
+func (c *Client) SetUnescapeQueryParams(unescape bool) *Client {
+ c.unescapeQueryParams = unescape
+ return c
+}
+
// SetFormData method sets Form parameters and their values in the client instance.
-// It's applicable only HTTP method `POST` and `PUT` and request content type would be set as
-// `application/x-www-form-urlencoded`. These form data will be added to all the request raised from
-// this client instance. Also it can be overridden at request level form data.
+// It applies only to HTTP methods `POST` and `PUT`, and the request content type would be set as
+// `application/x-www-form-urlencoded`. These form data will be added to all the requests raised from
+// this client instance. Also, it can be overridden at the request level.
//
-// See `Request.SetFormData`.
+// See [Request.SetFormData].
//
// client.SetFormData(map[string]string{
// "access_token": "BC594900-518B-4F7E-AC75-BD37F019E08F",
@@ -353,17 +363,17 @@ func (c *Client) SetFormData(data map[string]string) *Client {
//
// client.SetBasicAuth("go-resty", "welcome")
//
-// This basic auth information gets added to all the request raised from this client instance.
-// Also it can be overridden or set one at the request level is supported.
+// This basic auth information is added to all requests from this client instance.
+// It can also be overridden at the request level.
//
-// See `Request.SetBasicAuth`.
+// See [Request.SetBasicAuth].
func (c *Client) SetBasicAuth(username, password string) *Client {
c.UserInfo = &User{Username: username, Password: password}
return c
}
// SetAuthToken method sets the auth token of the `Authorization` header for all HTTP requests.
-// The default auth scheme is `Bearer`, it can be customized with the method `SetAuthScheme`. For Example:
+// The default auth scheme is `Bearer`; it can be customized with the method [Client.SetAuthScheme]. For Example:
//
// Authorization:
//
@@ -372,9 +382,9 @@ func (c *Client) SetBasicAuth(username, password string) *Client {
// client.SetAuthToken("BC594900518B4F7EAC75BD37F019E08FBC594900518B4F7EAC75BD37F019E08F")
//
// This auth token gets added to all the requests raised from this client instance.
-// Also it can be overridden or set one at the request level is supported.
+// Also, it can be overridden at the request level.
//
-// See `Request.SetAuthToken`.
+// See [Request.SetAuthToken].
func (c *Client) SetAuthToken(token string) *Client {
c.Token = token
return c
@@ -389,15 +399,14 @@ func (c *Client) SetAuthToken(token string) *Client {
// client.SetAuthScheme("OAuth")
//
// This auth scheme gets added to all the requests raised from this client instance.
-// Also it can be overridden or set one at the request level is supported.
+// Also, it can be overridden at the request level.
//
-// Information about auth schemes can be found in RFC7235 which is linked to below
-// along with the page containing the currently defined official authentication schemes:
+// Information about auth schemes can be found in [RFC 7235], IANA [HTTP Auth schemes].
//
-// https://tools.ietf.org/html/rfc7235
-// https://www.iana.org/assignments/http-authschemes/http-authschemes.xhtml#authschemes
+// See [Request.SetAuthToken].
//
-// See `Request.SetAuthToken`.
+// [RFC 7235]: https://tools.ietf.org/html/rfc7235
+// [HTTP Auth schemes]: https://www.iana.org/assignments/http-authschemes/http-authschemes.xhtml#authschemes
func (c *Client) SetAuthScheme(scheme string) *Client {
c.AuthScheme = scheme
return c
@@ -410,11 +419,11 @@ func (c *Client) SetAuthScheme(scheme string) *Client {
//
// client.SetDigestAuth("Mufasa", "Circle Of Life")
//
-// Information about Digest Access Authentication can be found in RFC7616:
+// Information about Digest Access Authentication can be found in [RFC 7616].
//
-// https://datatracker.ietf.org/doc/html/rfc7616
+// See [Request.SetDigestAuth].
//
-// See `Request.SetDigestAuth`.
+// [RFC 7616]: https://datatracker.ietf.org/doc/html/rfc7616
func (c *Client) SetDigestAuth(username, password string) *Client {
oldTransport := c.httpClient.Transport
c.OnBeforeRequest(func(c *Client, _ *Request) error {
@@ -431,7 +440,7 @@ func (c *Client) SetDigestAuth(username, password string) *Client {
return c
}
-// R method creates a new request instance, its used for Get, Post, Put, Delete, Patch, Head, Options, etc.
+// R method creates a new request instance; it's used for Get, Post, Put, Delete, Patch, Head, Options, etc.
func (c *Client) R() *Request {
r := &Request{
QueryParam: url.Values{},
@@ -442,30 +451,32 @@ func (c *Client) R() *Request {
RawPathParams: map[string]string{},
Debug: c.Debug,
- client: c,
- multipartFiles: []*File{},
- multipartFields: []*MultipartField{},
- jsonEscapeHTML: c.jsonEscapeHTML,
- log: c.log,
+ client: c,
+ multipartFiles: []*File{},
+ multipartFields: []*MultipartField{},
+ jsonEscapeHTML: c.jsonEscapeHTML,
+ log: c.log,
+ responseBodyLimit: c.ResponseBodyLimit,
+ generateCurlOnDebug: c.generateCurlOnDebug,
+ unescapeQueryParams: c.unescapeQueryParams,
}
return r
}
-// NewRequest is an alias for method `R()`. Creates a new request instance, its used for
-// Get, Post, Put, Delete, Patch, Head, Options, etc.
+// NewRequest method is an alias for method `R()`.
func (c *Client) NewRequest() *Request {
return c.R()
}
-// OnBeforeRequest method appends a request middleware into the before request chain.
-// The user defined middlewares get applied before the default Resty request middlewares.
+// OnBeforeRequest method appends a request middleware to the before request chain.
+// The user-defined middlewares are applied before the default Resty request middlewares.
// After all middlewares have been applied, the request is sent from Resty to the host server.
//
// client.OnBeforeRequest(func(c *resty.Client, r *resty.Request) error {
-// // Now you have access to Client and Request instance
+// // Now you have access to the Client and Request instance
// // manipulate it as per your need
//
-// return nil // if its success otherwise return error
+// return nil // if its successful otherwise return error
// })
func (c *Client) OnBeforeRequest(m RequestMiddleware) *Client {
c.udBeforeRequestLock.Lock()
@@ -476,15 +487,15 @@ func (c *Client) OnBeforeRequest(m RequestMiddleware) *Client {
return c
}
-// OnAfterResponse method appends response middleware into the after response chain.
-// Once we receive response from host server, default Resty response middleware
-// gets applied and then user assigned response middlewares applied.
+// OnAfterResponse method appends response middleware to the after-response chain.
+// Once we receive a response from the host server, the default Resty response middleware
+// gets applied, and then the user-assigned response middleware is applied.
//
// client.OnAfterResponse(func(c *resty.Client, r *resty.Response) error {
-// // Now you have access to Client and Response instance
+// // Now you have access to the Client and Response instance
// // manipulate it as per your need
//
-// return nil // if its success otherwise return error
+// return nil // if its successful otherwise return error
// })
func (c *Client) OnAfterResponse(m ResponseMiddleware) *Client {
c.afterResponseLock.Lock()
@@ -497,7 +508,7 @@ func (c *Client) OnAfterResponse(m ResponseMiddleware) *Client {
// OnError method adds a callback that will be run whenever a request execution fails.
// This is called after all retries have been attempted (if any).
-// If there was a response from the server, the error will be wrapped in *ResponseError
+// If there was a response from the server, the error will be wrapped in [ResponseError]
// which has the last response received from the server.
//
// client.OnError(func(req *resty.Request, err error) {
@@ -507,8 +518,8 @@ func (c *Client) OnAfterResponse(m ResponseMiddleware) *Client {
// // Log the error, increment a metric, etc...
// })
//
-// Out of the OnSuccess, OnError, OnInvalid, OnPanic callbacks, exactly one
-// set will be invoked for each call to Request.Execute() that completes.
+// Out of the [Client.OnSuccess], [Client.OnError], [Client.OnInvalid], [Client.OnPanic]
+// callbacks, exactly one set will be invoked for each call to [Request.Execute] that completes.
func (c *Client) OnError(h ErrorHook) *Client {
c.errorHooks = append(c.errorHooks, h)
return c
@@ -517,10 +528,8 @@ func (c *Client) OnError(h ErrorHook) *Client {
// OnSuccess method adds a callback that will be run whenever a request execution
// succeeds. This is called after all retries have been attempted (if any).
//
-// Out of the OnSuccess, OnError, OnInvalid, OnPanic callbacks, exactly one
-// set will be invoked for each call to Request.Execute() that completes.
-//
-// Since v2.8.0
+// Out of the [Client.OnSuccess], [Client.OnError], [Client.OnInvalid], [Client.OnPanic]
+// callbacks, exactly one set will be invoked for each call to [Request.Execute] that completes.
func (c *Client) OnSuccess(h SuccessHook) *Client {
c.successHooks = append(c.successHooks, h)
return c
@@ -529,10 +538,8 @@ func (c *Client) OnSuccess(h SuccessHook) *Client {
// OnInvalid method adds a callback that will be run whenever a request execution
// fails before it starts because the request is invalid.
//
-// Out of the OnSuccess, OnError, OnInvalid, OnPanic callbacks, exactly one
-// set will be invoked for each call to Request.Execute() that completes.
-//
-// Since v2.8.0
+// Out of the [Client.OnSuccess], [Client.OnError], [Client.OnInvalid], [Client.OnPanic]
+// callbacks, exactly one set will be invoked for each call to [Request.Execute] that completes.
func (c *Client) OnInvalid(h ErrorHook) *Client {
c.invalidHooks = append(c.invalidHooks, h)
return c
@@ -541,21 +548,20 @@ func (c *Client) OnInvalid(h ErrorHook) *Client {
// OnPanic method adds a callback that will be run whenever a request execution
// panics.
//
-// Out of the OnSuccess, OnError, OnInvalid, OnPanic callbacks, exactly one
-// set will be invoked for each call to Request.Execute() that completes.
-// If an OnSuccess, OnError, or OnInvalid callback panics, then the exactly
-// one rule can be violated.
+// Out of the [Client.OnSuccess], [Client.OnError], [Client.OnInvalid], [Client.OnPanic]
+// callbacks, exactly one set will be invoked for each call to [Request.Execute] that completes.
//
-// Since v2.8.0
+// If an [Client.OnSuccess], [Client.OnError], or [Client.OnInvalid] callback panics,
+// then exactly one rule can be violated.
func (c *Client) OnPanic(h ErrorHook) *Client {
c.panicHooks = append(c.panicHooks, h)
return c
}
-// SetPreRequestHook method sets the given pre-request function into resty client.
+// SetPreRequestHook method sets the given pre-request function into a resty client.
// It is called right before the request is fired.
//
-// Note: Only one pre-request hook can be registered. Use `client.OnBeforeRequest` for multiple.
+// NOTE: Only one pre-request hook can be registered. Use [Client.OnBeforeRequest] for multiple.
func (c *Client) SetPreRequestHook(h PreRequestHook) *Client {
if c.preReqHook != nil {
c.log.Warnf("Overwriting an existing pre-request hook: %s", functionName(h))
@@ -564,19 +570,23 @@ func (c *Client) SetPreRequestHook(h PreRequestHook) *Client {
return c
}
-// SetDebug method enables the debug mode on Resty client. Client logs details of every request and response.
-// For `Request` it logs information such as HTTP verb, Relative URL path, Host, Headers, Body if it has one.
-// For `Response` it logs information such as Status, Response Time, Headers, Body if it has one.
+// SetDebug method enables the debug mode on the Resty client. The client logs details
+// of every request and response.
//
// client.SetDebug(true)
//
-// Also it can be enabled at request level for particular request, see `Request.SetDebug`.
+// Also, it can be enabled at the request level for a particular request; see [Request.SetDebug].
+// - For [Request], it logs information such as HTTP verb, Relative URL path,
+// Host, Headers, and Body if it has one.
+// - For [Response], it logs information such as Status, Response Time, Headers,
+// and Body if it has one.
func (c *Client) SetDebug(d bool) *Client {
c.Debug = d
return c
}
-// SetDebugBodyLimit sets the maximum size for which the response and request body will be logged in debug mode.
+// SetDebugBodyLimit sets the maximum size in bytes for which the response and
+// request body will be logged in debug mode.
//
// client.SetDebugBodyLimit(1000000)
func (c *Client) SetDebugBodyLimit(sl int64) *Client {
@@ -584,8 +594,8 @@ func (c *Client) SetDebugBodyLimit(sl int64) *Client {
return c
}
-// OnRequestLog method used to set request log callback into Resty. Registered callback gets
-// called before the resty actually logs the information.
+// OnRequestLog method sets the request log callback to Resty. Registered callback gets
+// called before the resty logs the information.
func (c *Client) OnRequestLog(rl RequestLogCallback) *Client {
if c.requestLog != nil {
c.log.Warnf("Overwriting an existing on-request-log callback from=%s to=%s",
@@ -595,8 +605,8 @@ func (c *Client) OnRequestLog(rl RequestLogCallback) *Client {
return c
}
-// OnResponseLog method used to set response log callback into Resty. Registered callback gets
-// called before the resty actually logs the information.
+// OnResponseLog method sets the response log callback to Resty. Registered callback gets
+// called before the resty logs the information.
func (c *Client) OnResponseLog(rl ResponseLogCallback) *Client {
if c.responseLog != nil {
c.log.Warnf("Overwriting an existing on-response-log callback from=%s to=%s",
@@ -606,9 +616,9 @@ func (c *Client) OnResponseLog(rl ResponseLogCallback) *Client {
return c
}
-// SetDisableWarn method disables the warning message on Resty client.
+// SetDisableWarn method disables the warning log message on the Resty client.
//
-// For Example: Resty warns the user when BasicAuth used on non-TLS mode.
+// For example, Resty warns users when BasicAuth is used in non-TLS mode.
//
// client.SetDisableWarn(true)
func (c *Client) SetDisableWarn(d bool) *Client {
@@ -616,9 +626,9 @@ func (c *Client) SetDisableWarn(d bool) *Client {
return c
}
-// SetAllowGetMethodPayload method allows the GET method with payload on Resty client.
+// SetAllowGetMethodPayload method allows the GET method with payload on the Resty client.
//
-// For Example: Resty allows the user sends request with a payload on HTTP GET method.
+// For example, Resty allows the user to send a request with a payload using the HTTP GET method.
//
// client.SetAllowGetMethodPayload(true)
func (c *Client) SetAllowGetMethodPayload(a bool) *Client {
@@ -628,24 +638,24 @@ func (c *Client) SetAllowGetMethodPayload(a bool) *Client {
// SetLogger method sets given writer for logging Resty request and response details.
//
-// Compliant to interface `resty.Logger`.
+// Compliant to interface [resty.Logger]
func (c *Client) SetLogger(l Logger) *Client {
c.log = l
return c
}
// SetContentLength method enables the HTTP header `Content-Length` value for every request.
-// By default Resty won't set `Content-Length`.
+// By default, Resty won't set `Content-Length`.
//
// client.SetContentLength(true)
//
-// Also you have an option to enable for particular request. See `Request.SetContentLength`
+// Also, you have the option to enable a particular request. See [Request.SetContentLength]
func (c *Client) SetContentLength(l bool) *Client {
c.setContentLength = l
return c
}
-// SetTimeout method sets timeout for request raised from client.
+// SetTimeout method sets the timeout for a request raised by the client.
//
// client.SetTimeout(time.Duration(1 * time.Minute))
func (c *Client) SetTimeout(timeout time.Duration) *Client {
@@ -653,9 +663,9 @@ func (c *Client) SetTimeout(timeout time.Duration) *Client {
return c
}
-// SetError method is to register the global or client common `Error` object into Resty.
-// It is used for automatic unmarshalling if response status code is greater than 399 and
-// content type either JSON or XML. Can be pointer or non-pointer.
+// SetError method registers the global or client common `Error` object into Resty.
+// It is used for automatic unmarshalling if the response status code is greater than 399 and
+// content type is JSON or XML. It can be a pointer or a non-pointer.
//
// client.SetError(&Error{})
// // OR
@@ -665,8 +675,8 @@ func (c *Client) SetError(err interface{}) *Client {
return c
}
-// SetRedirectPolicy method sets the client redirect policy. Resty provides ready to use
-// redirect policies. Wanna create one for yourself refer to `redirect.go`.
+// SetRedirectPolicy method sets the redirect policy for the client. Resty provides ready-to-use
+// redirect policies. Wanna create one for yourself, refer to `redirect.go`.
//
// client.SetRedirectPolicy(FlexibleRedirectPolicy(20))
//
@@ -699,7 +709,7 @@ func (c *Client) SetRetryCount(count int) *Client {
return c
}
-// SetRetryWaitTime method sets default wait time to sleep before retrying
+// SetRetryWaitTime method sets the default wait time for sleep before retrying
// request.
//
// Default is 100 milliseconds.
@@ -708,7 +718,7 @@ func (c *Client) SetRetryWaitTime(waitTime time.Duration) *Client {
return c
}
-// SetRetryMaxWaitTime method sets max wait time to sleep before retrying
+// SetRetryMaxWaitTime method sets the max wait time for sleep before retrying
// request.
//
// Default is 2 seconds.
@@ -717,7 +727,7 @@ func (c *Client) SetRetryMaxWaitTime(maxWaitTime time.Duration) *Client {
return c
}
-// SetRetryAfter sets callback to calculate wait time between retries.
+// SetRetryAfter sets a callback to calculate the wait time between retries.
// Default (nil) implies exponential backoff with jitter
func (c *Client) SetRetryAfter(callback RetryAfterFunc) *Client {
c.RetryAfter = callback
@@ -725,56 +735,46 @@ func (c *Client) SetRetryAfter(callback RetryAfterFunc) *Client {
}
// SetJSONMarshaler method sets the JSON marshaler function to marshal the request body.
-// By default, Resty uses `encoding/json` package to marshal the request body.
-//
-// Since v2.8.0
+// By default, Resty uses [encoding/json] package to marshal the request body.
func (c *Client) SetJSONMarshaler(marshaler func(v interface{}) ([]byte, error)) *Client {
c.JSONMarshal = marshaler
return c
}
// SetJSONUnmarshaler method sets the JSON unmarshaler function to unmarshal the response body.
-// By default, Resty uses `encoding/json` package to unmarshal the response body.
-//
-// Since v2.8.0
+// By default, Resty uses [encoding/json] package to unmarshal the response body.
func (c *Client) SetJSONUnmarshaler(unmarshaler func(data []byte, v interface{}) error) *Client {
c.JSONUnmarshal = unmarshaler
return c
}
// SetXMLMarshaler method sets the XML marshaler function to marshal the request body.
-// By default, Resty uses `encoding/xml` package to marshal the request body.
-//
-// Since v2.8.0
+// By default, Resty uses [encoding/xml] package to marshal the request body.
func (c *Client) SetXMLMarshaler(marshaler func(v interface{}) ([]byte, error)) *Client {
c.XMLMarshal = marshaler
return c
}
// SetXMLUnmarshaler method sets the XML unmarshaler function to unmarshal the response body.
-// By default, Resty uses `encoding/xml` package to unmarshal the response body.
-//
-// Since v2.8.0
+// By default, Resty uses [encoding/xml] package to unmarshal the response body.
func (c *Client) SetXMLUnmarshaler(unmarshaler func(data []byte, v interface{}) error) *Client {
c.XMLUnmarshal = unmarshaler
return c
}
-// AddRetryCondition method adds a retry condition function to array of functions
+// AddRetryCondition method adds a retry condition function to an array of functions
// that are checked to determine if the request is retried. The request will
-// retry if any of the functions return true and error is nil.
+// retry if any functions return true and the error is nil.
//
-// Note: These retry conditions are applied on all Request made using this Client.
-// For Request specific retry conditions check *Request.AddRetryCondition
+// NOTE: These retry conditions are applied on all requests made using this Client.
+// For [Request] specific retry conditions, check [Request.AddRetryCondition]
func (c *Client) AddRetryCondition(condition RetryConditionFunc) *Client {
c.RetryConditions = append(c.RetryConditions, condition)
return c
}
// AddRetryAfterErrorCondition adds the basic condition of retrying after encountering
-// an error from the http response
-//
-// Since v2.6.0
+// an error from the HTTP response
func (c *Client) AddRetryAfterErrorCondition() *Client {
c.AddRetryCondition(func(response *Response, err error) bool {
return response.IsError()
@@ -784,33 +784,29 @@ func (c *Client) AddRetryAfterErrorCondition() *Client {
// AddRetryHook adds a side-effecting retry hook to an array of hooks
// that will be executed on each retry.
-//
-// Since v2.6.0
func (c *Client) AddRetryHook(hook OnRetryFunc) *Client {
c.RetryHooks = append(c.RetryHooks, hook)
return c
}
// SetRetryResetReaders method enables the Resty client to seek the start of all
-// file readers given as multipart files, if the given object implements `io.ReadSeeker`.
-//
-// Since ...
+// file readers are given as multipart files if the object implements [io.ReadSeeker].
func (c *Client) SetRetryResetReaders(b bool) *Client {
c.RetryResetReaders = b
return c
}
-// SetTLSClientConfig method sets TLSClientConfig for underling client Transport.
+// SetTLSClientConfig method sets TLSClientConfig for underlying client Transport.
//
// For Example:
//
-// // One can set custom root-certificate. Refer: http://golang.org/pkg/crypto/tls/#example_Dial
+// // One can set a custom root certificate. Refer: http://golang.org/pkg/crypto/tls/#example_Dial
// client.SetTLSClientConfig(&tls.Config{ RootCAs: roots })
//
// // or One can disable security check (https)
// client.SetTLSClientConfig(&tls.Config{ InsecureSkipVerify: true })
//
-// Note: This method overwrites existing `TLSClientConfig`.
+// NOTE: This method overwrites existing [http.Transport.TLSClientConfig]
func (c *Client) SetTLSClientConfig(config *tls.Config) *Client {
transport, err := c.Transport()
if err != nil {
@@ -821,13 +817,11 @@ func (c *Client) SetTLSClientConfig(config *tls.Config) *Client {
return c
}
-// SetProxy method sets the Proxy URL and Port for Resty client.
+// SetProxy method sets the Proxy URL and Port for the Resty client.
//
// client.SetProxy("http://proxyserver:8888")
//
-// OR Without this `SetProxy` method, you could also set Proxy via environment variable.
-//
-// Refer to godoc `http.ProxyFromEnvironment`.
+// OR you could also set Proxy via environment variable, refer to [http.ProxyFromEnvironment]
func (c *Client) SetProxy(proxyURL string) *Client {
transport, err := c.Transport()
if err != nil {
@@ -846,7 +840,7 @@ func (c *Client) SetProxy(proxyURL string) *Client {
return c
}
-// RemoveProxy method removes the proxy configuration from Resty client
+// RemoveProxy method removes the proxy configuration from the Resty client
//
// client.RemoveProxy()
func (c *Client) RemoveProxy() *Client {
@@ -860,7 +854,7 @@ func (c *Client) RemoveProxy() *Client {
return c
}
-// SetCertificates method helps to set client certificates into Resty conveniently.
+// SetCertificates method helps to conveniently set client certificates into Resty.
func (c *Client) SetCertificates(certs ...tls.Certificate) *Client {
config, err := c.tlsConfig()
if err != nil {
@@ -871,7 +865,7 @@ func (c *Client) SetCertificates(certs ...tls.Certificate) *Client {
return c
}
-// SetRootCertificate method helps to add one or more root certificates into Resty client
+// SetRootCertificate method helps to add one or more root certificates into the Resty client
//
// client.SetRootCertificate("/path/to/root/pemFile.pem")
func (c *Client) SetRootCertificate(pemFilePath string) *Client {
@@ -880,40 +874,66 @@ func (c *Client) SetRootCertificate(pemFilePath string) *Client {
c.log.Errorf("%v", err)
return c
}
+ c.handleCAs("root", rootPemData)
+ return c
+}
- config, err := c.tlsConfig()
+// SetRootCertificateFromString method helps to add one or more root certificates
+// into the Resty client
+//
+// client.SetRootCertificateFromString("pem certs content")
+func (c *Client) SetRootCertificateFromString(pemCerts string) *Client {
+ c.handleCAs("root", []byte(pemCerts))
+ return c
+}
+
+// SetClientRootCertificate method helps to add one or more client's root
+// certificates into the Resty client
+//
+// client.SetClientRootCertificate("/path/to/root/pemFile.pem")
+func (c *Client) SetClientRootCertificate(pemFilePath string) *Client {
+ rootPemData, err := os.ReadFile(pemFilePath)
if err != nil {
c.log.Errorf("%v", err)
return c
}
- if config.RootCAs == nil {
- config.RootCAs = x509.NewCertPool()
- }
-
- config.RootCAs.AppendCertsFromPEM(rootPemData)
+ c.handleCAs("client", rootPemData)
return c
}
-// SetRootCertificateFromString method helps to add one or more root certificates into Resty client
+// SetClientRootCertificateFromString method helps to add one or more clients
+// root certificates into the Resty client
//
-// client.SetRootCertificateFromString("pem file content")
-func (c *Client) SetRootCertificateFromString(pemContent string) *Client {
+// client.SetClientRootCertificateFromString("pem certs content")
+func (c *Client) SetClientRootCertificateFromString(pemCerts string) *Client {
+ c.handleCAs("client", []byte(pemCerts))
+ return c
+}
+
+func (c *Client) handleCAs(scope string, permCerts []byte) {
config, err := c.tlsConfig()
if err != nil {
c.log.Errorf("%v", err)
- return c
- }
- if config.RootCAs == nil {
- config.RootCAs = x509.NewCertPool()
+ return
}
- config.RootCAs.AppendCertsFromPEM([]byte(pemContent))
- return c
+ switch scope {
+ case "root":
+ if config.RootCAs == nil {
+ config.RootCAs = x509.NewCertPool()
+ }
+ config.RootCAs.AppendCertsFromPEM(permCerts)
+ case "client":
+ if config.ClientCAs == nil {
+ config.ClientCAs = x509.NewCertPool()
+ }
+ config.ClientCAs.AppendCertsFromPEM(permCerts)
+ }
}
-// SetOutputDirectory method sets output directory for saving HTTP response into file.
-// If the output directory not exists then resty creates one. This setting is optional one,
-// if you're planning using absolute path in `Request.SetOutput` and can used together.
+// SetOutputDirectory method sets the output directory for saving HTTP responses in a file.
+// Resty creates one if the output directory does not exist. This setting is optional,
+// if you plan to use the absolute path in [Request.SetOutput] and can used together.
//
// client.SetOutputDirectory("/save/http/response/here")
func (c *Client) SetOutputDirectory(dirPath string) *Client {
@@ -921,24 +941,15 @@ func (c *Client) SetOutputDirectory(dirPath string) *Client {
return c
}
-// SetRateLimiter sets an optional `RateLimiter`. If set the rate limiter will control
-// all requests made with this client.
-//
-// Since v2.9.0
+// SetRateLimiter sets an optional [RateLimiter]. If set, the rate limiter will control
+// all requests were made by this client.
func (c *Client) SetRateLimiter(rl RateLimiter) *Client {
c.rateLimiter = rl
return c
}
-// SetTransport method sets custom `*http.Transport` or any `http.RoundTripper`
-// compatible interface implementation in the resty client.
-//
-// Note:
-//
-// - If transport is not type of `*http.Transport` then you may not be able to
-// take advantage of some of the Resty client settings.
-//
-// - It overwrites the Resty client transport instance and it's configurations.
+// SetTransport method sets custom [http.Transport] or any [http.RoundTripper]
+// compatible interface implementation in the Resty client.
//
// transport := &http.Transport{
// // something like Proxying to httptest.Server, etc...
@@ -946,8 +957,12 @@ func (c *Client) SetRateLimiter(rl RateLimiter) *Client {
// return url.Parse(server.URL)
// },
// }
-//
// client.SetTransport(transport)
+//
+// NOTE:
+// - If transport is not the type of `*http.Transport`, then you may not be able to
+// take advantage of some of the Resty client settings.
+// - It overwrites the Resty client transport instance and its configurations.
func (c *Client) SetTransport(transport http.RoundTripper) *Client {
if transport != nil {
c.httpClient.Transport = transport
@@ -955,7 +970,7 @@ func (c *Client) SetTransport(transport http.RoundTripper) *Client {
return c
}
-// SetScheme method sets custom scheme in the Resty client. It's way to override default.
+// SetScheme method sets a custom scheme for the Resty client. It's a way to override the default.
//
// client.SetScheme("http")
func (c *Client) SetScheme(scheme string) *Client {
@@ -965,25 +980,26 @@ func (c *Client) SetScheme(scheme string) *Client {
return c
}
-// SetCloseConnection method sets variable `Close` in http request struct with the given
+// SetCloseConnection method sets variable `Close` in HTTP request struct with the given
// value. More info: https://golang.org/src/net/http/request.go
func (c *Client) SetCloseConnection(close bool) *Client {
c.closeConnection = close
return c
}
-// SetDoNotParseResponse method instructs `Resty` not to parse the response body automatically.
-// Resty exposes the raw response body as `io.ReadCloser`. Also do not forget to close the body,
-// otherwise you might get into connection leaks, no connection reuse.
+// SetDoNotParseResponse method instructs Resty not to parse the response body automatically.
+// Resty exposes the raw response body as [io.ReadCloser]. If you use it, do not
+// forget to close the body, otherwise, you might get into connection leaks, and connection
+// reuse may not happen.
//
-// Note: Response middlewares are not applicable, if you use this option. Basically you have
-// taken over the control of response parsing from `Resty`.
-func (c *Client) SetDoNotParseResponse(parse bool) *Client {
- c.notParseResponse = parse
+// NOTE: [Response] middlewares are not executed using this option. You have
+// taken over the control of response parsing from Resty.
+func (c *Client) SetDoNotParseResponse(notParse bool) *Client {
+ c.notParseResponse = notParse
return c
}
-// SetPathParam method sets single URL path key-value pair in the
+// SetPathParam method sets a single URL path key-value pair in the
// Resty client instance.
//
// client.SetPathParam("userId", "sample@sample.com")
@@ -993,10 +1009,10 @@ func (c *Client) SetDoNotParseResponse(parse bool) *Client {
// Composed URL - /v1/users/sample@sample.com/details
//
// It replaces the value of the key while composing the request URL.
-// The value will be escaped using `url.PathEscape` function.
+// The value will be escaped using [url.PathEscape] function.
//
-// Also it can be overridden at request level Path Params options,
-// see `Request.SetPathParam` or `Request.SetPathParams`.
+// It can be overridden at the request level,
+// see [Request.SetPathParam] or [Request.SetPathParams]
func (c *Client) SetPathParam(param, value string) *Client {
c.PathParams[param] = value
return c
@@ -1016,10 +1032,10 @@ func (c *Client) SetPathParam(param, value string) *Client {
// Composed URL - /v1/users/sample@sample.com/100002/groups%2Fdevelopers/details
//
// It replaces the value of the key while composing the request URL.
-// The values will be escaped using `url.PathEscape` function.
+// The values will be escaped using [url.PathEscape] function.
//
-// Also it can be overridden at request level Path Params options,
-// see `Request.SetPathParam` or `Request.SetPathParams`.
+// It can be overridden at the request level,
+// see [Request.SetPathParam] or [Request.SetPathParams]
func (c *Client) SetPathParams(params map[string]string) *Client {
for p, v := range params {
c.SetPathParam(p, v)
@@ -1027,7 +1043,7 @@ func (c *Client) SetPathParams(params map[string]string) *Client {
return c
}
-// SetRawPathParam method sets single URL path key-value pair in the
+// SetRawPathParam method sets a single URL path key-value pair in the
// Resty client instance.
//
// client.SetPathParam("userId", "sample@sample.com")
@@ -1045,10 +1061,8 @@ func (c *Client) SetPathParams(params map[string]string) *Client {
// It replaces the value of the key while composing the request URL.
// The value will be used as it is and will not be escaped.
//
-// Also it can be overridden at request level Path Params options,
-// see `Request.SetPathParam` or `Request.SetPathParams`.
-//
-// Since v2.8.0
+// It can be overridden at the request level,
+// see [Request.SetRawPathParam] or [Request.SetRawPathParams]
func (c *Client) SetRawPathParam(param, value string) *Client {
c.RawPathParams[param] = value
return c
@@ -1070,10 +1084,8 @@ func (c *Client) SetRawPathParam(param, value string) *Client {
// It replaces the value of the key while composing the request URL.
// The values will be used as they are and will not be escaped.
//
-// Also it can be overridden at request level Path Params options,
-// see `Request.SetPathParam` or `Request.SetPathParams`.
-//
-// Since v2.8.0
+// It can be overridden at the request level,
+// see [Request.SetRawPathParam] or [Request.SetRawPathParams]
func (c *Client) SetRawPathParams(params map[string]string) *Client {
for p, v := range params {
c.SetRawPathParam(p, v)
@@ -1081,16 +1093,35 @@ func (c *Client) SetRawPathParams(params map[string]string) *Client {
return c
}
-// SetJSONEscapeHTML method is to enable/disable the HTML escape on JSON marshal.
+// SetJSONEscapeHTML method enables or disables the HTML escape on JSON marshal.
+// By default, escape HTML is false.
+//
+// NOTE: This option only applies to the standard JSON Marshaller used by Resty.
//
-// Note: This option only applicable to standard JSON Marshaller.
+// It can be overridden at the request level, see [Client.SetJSONEscapeHTML]
func (c *Client) SetJSONEscapeHTML(b bool) *Client {
c.jsonEscapeHTML = b
return c
}
+// SetResponseBodyLimit method sets a maximum body size limit in bytes on response,
+// avoid reading too much data to memory.
+//
+// Client will return [resty.ErrResponseBodyTooLarge] if the body size of the body
+// in the uncompressed response is larger than the limit.
+// Body size limit will not be enforced in the following cases:
+// - ResponseBodyLimit <= 0, which is the default behavior.
+// - [Request.SetOutput] is called to save response data to the file.
+// - "DoNotParseResponse" is set for client or request.
+//
+// It can be overridden at the request level; see [Request.SetResponseBodyLimit]
+func (c *Client) SetResponseBodyLimit(v int) *Client {
+ c.ResponseBodyLimit = v
+ return c
+}
+
// EnableTrace method enables the Resty client trace for the requests fired from
-// the client using `httptrace.ClientTrace` and provides insights.
+// the client using [httptrace.ClientTrace] and provides insights.
//
// client := resty.New().EnableTrace()
//
@@ -1098,40 +1129,64 @@ func (c *Client) SetJSONEscapeHTML(b bool) *Client {
// fmt.Println("Error:", err)
// fmt.Println("Trace Info:", resp.Request.TraceInfo())
//
-// Also `Request.EnableTrace` available too to get trace info for single request.
-//
-// Since v2.0.0
+// The method [Request.EnableTrace] is also available to get trace info for a single request.
func (c *Client) EnableTrace() *Client {
c.trace = true
return c
}
-// DisableTrace method disables the Resty client trace. Refer to `Client.EnableTrace`.
-//
-// Since v2.0.0
+// DisableTrace method disables the Resty client trace. Refer to [Client.EnableTrace].
func (c *Client) DisableTrace() *Client {
c.trace = false
return c
}
-// IsProxySet method returns the true is proxy is set from resty client otherwise
-// false. By default proxy is set from environment, refer to `http.ProxyFromEnvironment`.
+// EnableGenerateCurlOnDebug method enables the generation of CURL commands in the debug log.
+// It works in conjunction with debug mode.
+//
+// NOTE: Use with care.
+// - Potential to leak sensitive data from [Request] and [Response] in the debug log.
+// - Beware of memory usage since the request body is reread.
+func (c *Client) EnableGenerateCurlOnDebug() *Client {
+ c.generateCurlOnDebug = true
+ return c
+}
+
+// DisableGenerateCurlOnDebug method disables the option set by [Client.EnableGenerateCurlOnDebug].
+func (c *Client) DisableGenerateCurlOnDebug() *Client {
+ c.generateCurlOnDebug = false
+ return c
+}
+
+// IsProxySet method returns the true is proxy is set from the Resty client; otherwise
+// false. By default, the proxy is set from the environment variable; refer to [http.ProxyFromEnvironment].
func (c *Client) IsProxySet() bool {
return c.proxyURL != nil
}
-// GetClient method returns the current `http.Client` used by the resty client.
+// GetClient method returns the underlying [http.Client] used by the Resty.
func (c *Client) GetClient() *http.Client {
return c.httpClient
}
-//‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
-// Client Unexported methods
-//_______________________________________________________________________
+// Clone returns a clone of the original client.
+//
+// NOTE: Use with care:
+// - Interface values are not deeply cloned. Thus, both the original and the
+// clone will use the same value.
+// - This function is not safe for concurrent use. You should only use this method
+// when you are sure that any other goroutine is not using the client.
+func (c *Client) Clone() *Client {
+ // dereference the pointer and copy the value
+ cc := *c
-// Executes method executes the given `Request` object and returns response
-// error.
-func (c *Client) execute(req *Request) (*Response, error) {
+ // lock values should not be copied - thus new values are used.
+ cc.afterResponseLock = &sync.RWMutex{}
+ cc.udBeforeRequestLock = &sync.RWMutex{}
+ return &cc
+}
+
+func (c *Client) executeBefore(req *Request) error {
// Lock the user-defined pre-request hooks.
c.udBeforeRequestLock.RLock()
defer c.udBeforeRequestLock.RUnlock()
@@ -1147,7 +1202,7 @@ func (c *Client) execute(req *Request) (*Response, error) {
// to modify the *resty.Request object
for _, f := range c.udBeforeRequest {
if err = f(c, req); err != nil {
- return nil, wrapNoRetryErr(err)
+ return wrapNoRetryErr(err)
}
}
@@ -1155,14 +1210,14 @@ func (c *Client) execute(req *Request) (*Response, error) {
// will return an error if the rate limit is exceeded.
if req.client.rateLimiter != nil {
if !req.client.rateLimiter.Allow() {
- return nil, wrapNoRetryErr(ErrRateLimitExceeded)
+ return wrapNoRetryErr(ErrRateLimitExceeded)
}
}
// resty middlewares
for _, f := range c.beforeRequest {
if err = f(c, req); err != nil {
- return nil, wrapNoRetryErr(err)
+ return wrapNoRetryErr(err)
}
}
@@ -1173,15 +1228,23 @@ func (c *Client) execute(req *Request) (*Response, error) {
// call pre-request if defined
if c.preReqHook != nil {
if err = c.preReqHook(c, req.RawRequest); err != nil {
- return nil, wrapNoRetryErr(err)
+ return wrapNoRetryErr(err)
}
}
if err = requestLogger(c, req); err != nil {
- return nil, wrapNoRetryErr(err)
+ return wrapNoRetryErr(err)
}
- req.RawRequest.Body = newRequestBodyReleaser(req.RawRequest.Body, req.bodyBuf)
+ return nil
+}
+
+// Executes method executes the given `Request` object and returns
+// response or error.
+func (c *Client) execute(req *Request) (*Response, error) {
+ if err := c.executeBefore(req); err != nil {
+ return nil, err
+ }
req.Time = time.Now()
resp, err := c.httpClient.Do(req.RawRequest)
@@ -1193,7 +1256,13 @@ func (c *Client) execute(req *Request) (*Response, error) {
if err != nil || req.notParseResponse || c.notParseResponse {
response.setReceivedAt()
- return response, err
+ if logErr := responseLogger(c, response); logErr != nil {
+ return response, wrapErrors(logErr, err)
+ }
+ if err != nil {
+ return response, err
+ }
+ return response, nil
}
if !req.isSaveResponse {
@@ -1205,6 +1274,7 @@ func (c *Client) execute(req *Request) (*Response, error) {
if _, ok := body.(*gzip.Reader); !ok {
body, err = gzip.NewReader(body)
if err != nil {
+ err = wrapErrors(responseLogger(c, response), err)
response.setReceivedAt()
return response, err
}
@@ -1212,7 +1282,8 @@ func (c *Client) execute(req *Request) (*Response, error) {
}
}
- if response.body, err = io.ReadAll(body); err != nil {
+ if response.body, err = readAllWithLimit(body, req.responseBodyLimit); err != nil {
+ err = wrapErrors(responseLogger(c, response), err)
response.setReceivedAt()
return response, err
}
@@ -1223,6 +1294,11 @@ func (c *Client) execute(req *Request) (*Response, error) {
response.setReceivedAt() // after we read the body
// Apply Response middleware
+ err = responseLogger(c, response)
+ if err != nil {
+ return response, wrapNoRetryErr(err)
+ }
+
for _, f := range c.afterResponse {
if err = f(c, response); err != nil {
break
@@ -1232,6 +1308,39 @@ func (c *Client) execute(req *Request) (*Response, error) {
return response, wrapNoRetryErr(err)
}
+var ErrResponseBodyTooLarge = errors.New("resty: response body too large")
+
+// https://github.com/golang/go/issues/51115
+// [io.LimitedReader] can only return [io.EOF]
+func readAllWithLimit(r io.Reader, maxSize int) ([]byte, error) {
+ if maxSize <= 0 {
+ return io.ReadAll(r)
+ }
+
+ var buf [512]byte // make buf stack allocated
+ result := make([]byte, 0, 512)
+ total := 0
+ for {
+ n, err := r.Read(buf[:])
+ total += n
+ if total > maxSize {
+ return nil, ErrResponseBodyTooLarge
+ }
+
+ if err != nil {
+ if err == io.EOF {
+ result = append(result, buf[:n]...)
+ break
+ }
+ return nil, err
+ }
+
+ result = append(result, buf[:n]...)
+ }
+
+ return result, nil
+}
+
// getting TLS client config if not exists then create one
func (c *Client) tlsConfig() (*tls.Config, error) {
transport, err := c.Transport()
@@ -1244,10 +1353,10 @@ func (c *Client) tlsConfig() (*tls.Config, error) {
return transport.TLSClientConfig, nil
}
-// Transport method returns `*http.Transport` currently in use or error
-// in case currently used `transport` is not a `*http.Transport`.
+// Transport method returns [http.Transport] currently in use or error
+// in case the currently used `transport` is not a [http.Transport].
//
-// Since v2.8.0 become exported method.
+// Since v2.8.0 has become exported method.
func (c *Client) Transport() (*http.Transport, error) {
if transport, ok := c.httpClient.Transport.(*http.Transport); ok {
return transport, nil
@@ -1261,7 +1370,7 @@ func (c *Client) outputLogTo(w io.Writer) *Client {
return c
}
-// ResponseError is a wrapper for including the server response with an error.
+// ResponseError is a wrapper that includes the server response with an error.
// Neither the err nor the response should be nil.
type ResponseError struct {
Response *Response
@@ -1277,7 +1386,7 @@ func (e *ResponseError) Unwrap() error {
}
// Helper to run errorHooks hooks.
-// It wraps the error in a ResponseError if the resp is not nil
+// It wraps the error in a [ResponseError] if the resp is not nil
// so hooks can access it.
func (c *Client) onErrorHooks(req *Request, resp *Response, err error) {
if err != nil {
@@ -1312,14 +1421,14 @@ func (c *Client) onInvalidHooks(req *Request, err error) {
// File struct and its methods
//_______________________________________________________________________
-// File struct represent file information for multipart request
+// File struct represents file information for multipart request
type File struct {
Name string
ParamName string
io.Reader
}
-// String returns string value of current file details
+// String method returns the string value of current file details
func (f *File) String() string {
return fmt.Sprintf("ParamName: %v; FileName: %v", f.ParamName, f.Name)
}
@@ -1328,7 +1437,7 @@ func (f *File) String() string {
// MultipartField struct
//_______________________________________________________________________
-// MultipartField struct represent custom data part for multipart request
+// MultipartField struct represents the custom data part for a multipart request
type MultipartField struct {
Param string
FileName string
@@ -1336,10 +1445,6 @@ type MultipartField struct {
io.Reader
}
-//‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
-// Unexported package methods
-//_______________________________________________________________________
-
func createClient(hc *http.Client) *Client {
if hc.Transport == nil {
hc.Transport = createTransport(nil)
@@ -1360,9 +1465,11 @@ func createClient(hc *http.Client) *Client {
XMLUnmarshal: xml.Unmarshal,
HeaderAuthorizationKey: http.CanonicalHeaderKey("Authorization"),
- jsonEscapeHTML: true,
- httpClient: hc,
- debugBodySizeLimit: math.MaxInt32,
+ jsonEscapeHTML: true,
+ httpClient: hc,
+ debugBodySizeLimit: math.MaxInt32,
+ udBeforeRequestLock: &sync.RWMutex{},
+ afterResponseLock: &sync.RWMutex{},
}
// Logger
@@ -1375,6 +1482,7 @@ func createClient(hc *http.Client) *Client {
parseRequestBody,
createHTTPRequest,
addCredentials,
+ createCurlCmd,
}
// user defined request middlewares
@@ -1382,7 +1490,6 @@ func createClient(hc *http.Client) *Client {
// default after response middlewares
c.afterResponse = []ResponseMiddleware{
- responseLogger,
parseResponseBody,
saveResponseIntoFile,
}
diff --git a/vendor/github.com/go-resty/resty/v2/digest.go b/vendor/github.com/go-resty/resty/v2/digest.go
index 9dd3a13b..3a08477d 100644
--- a/vendor/github.com/go-resty/resty/v2/digest.go
+++ b/vendor/github.com/go-resty/resty/v2/digest.go
@@ -1,5 +1,6 @@
-// Copyright (c) 2015-2023 Jeevanandam M (jeeva@myjeeva.com)
+// Copyright (c) 2015-2024 Jeevanandam M (jeeva@myjeeva.com)
// 2023 Segev Dagan (https://github.com/segevda)
+// 2024 Philipp Wolfer (https://github.com/phw)
// All rights reserved.
// resty source code and usage is governed by a MIT style
// license that can be found in the LICENSE file.
@@ -125,48 +126,78 @@ type challenge struct {
userhash string
}
+func (c *challenge) setValue(k, v string) error {
+ switch k {
+ case "realm":
+ c.realm = v
+ case "domain":
+ c.domain = v
+ case "nonce":
+ c.nonce = v
+ case "opaque":
+ c.opaque = v
+ case "stale":
+ c.stale = v
+ case "algorithm":
+ c.algorithm = v
+ case "qop":
+ c.qop = v
+ case "charset":
+ if strings.ToUpper(v) != "UTF-8" {
+ return ErrDigestCharset
+ }
+ case "userhash":
+ c.userhash = v
+ default:
+ return ErrDigestBadChallenge
+ }
+ return nil
+}
+
func parseChallenge(input string) (*challenge, error) {
const ws = " \n\r\t"
- const qs = `"`
s := strings.Trim(input, ws)
if !strings.HasPrefix(s, "Digest ") {
return nil, ErrDigestBadChallenge
}
s = strings.Trim(s[7:], ws)
- sl := strings.Split(s, ",")
c := &challenge{}
- var r []string
- for i := range sl {
- sl[i] = strings.TrimSpace(sl[i])
- r = strings.SplitN(sl[i], "=", 2)
- if len(r) != 2 {
- return nil, ErrDigestBadChallenge
- }
- r[0] = strings.TrimSpace(r[0])
- r[1] = strings.TrimSpace(r[1])
- switch r[0] {
- case "realm":
- c.realm = strings.Trim(r[1], qs)
- case "domain":
- c.domain = strings.Trim(r[1], qs)
- case "nonce":
- c.nonce = strings.Trim(r[1], qs)
- case "opaque":
- c.opaque = strings.Trim(r[1], qs)
- case "stale":
- c.stale = strings.Trim(r[1], qs)
- case "algorithm":
- c.algorithm = strings.Trim(r[1], qs)
- case "qop":
- c.qop = strings.Trim(r[1], qs)
- case "charset":
- if strings.ToUpper(strings.Trim(r[1], qs)) != "UTF-8" {
- return nil, ErrDigestCharset
+ b := strings.Builder{}
+ key := ""
+ quoted := false
+ for _, r := range s {
+ switch r {
+ case '"':
+ quoted = !quoted
+ case ',':
+ if quoted {
+ b.WriteRune(r)
+ } else {
+ val := strings.Trim(b.String(), ws)
+ b.Reset()
+ if err := c.setValue(key, val); err != nil {
+ return nil, err
+ }
+ key = ""
+ }
+ case '=':
+ if quoted {
+ b.WriteRune(r)
+ } else {
+ key = strings.Trim(b.String(), ws)
+ b.Reset()
}
- case "userhash":
- c.userhash = strings.Trim(r[1], qs)
default:
- return nil, ErrDigestBadChallenge
+ b.WriteRune(r)
+ }
+ }
+ if quoted || (key == "" && b.Len() > 0) {
+ return nil, ErrDigestBadChallenge
+ }
+ if key != "" {
+ val := strings.Trim(b.String(), ws)
+ if err := c.setValue(key, val); err != nil {
+ return nil, err
}
}
return c, nil
@@ -233,9 +264,10 @@ func (c *credentials) validateQop() error {
if c.messageQop == "" {
return ErrDigestNoQop
}
- possibleQops := strings.Split(c.messageQop, ", ")
+ possibleQops := strings.Split(c.messageQop, ",")
var authSupport bool
for _, qop := range possibleQops {
+ qop = strings.TrimSpace(qop)
if qop == "auth" {
authSupport = true
break
diff --git a/vendor/github.com/go-resty/resty/v2/middleware.go b/vendor/github.com/go-resty/resty/v2/middleware.go
index ac2bbc9e..91eed9b2 100644
--- a/vendor/github.com/go-resty/resty/v2/middleware.go
+++ b/vendor/github.com/go-resty/resty/v2/middleware.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2015-2023 Jeevanandam M (jeeva@myjeeva.com), All rights reserved.
+// Copyright (c) 2015-2024 Jeevanandam M (jeeva@myjeeva.com), All rights reserved.
// resty source code and usage is governed by a MIT style
// license that can be found in the LICENSE file.
@@ -57,8 +57,8 @@ func parseRequestURL(c *Client, r *Request) error {
buf := acquireBuffer()
defer releaseBuffer(buf)
// search for the next or first opened curly bracket
- for curr := strings.Index(r.URL, "{"); curr > prev; curr = prev + strings.Index(r.URL[prev:], "{") {
- // write everything form the previous position up to the current
+ for curr := strings.Index(r.URL, "{"); curr == 0 || curr > prev; curr = prev + strings.Index(r.URL[prev:], "{") {
+ // write everything from the previous position up to the current
if curr > prev {
buf.WriteString(r.URL[prev:curr])
}
@@ -154,6 +154,15 @@ func parseRequestURL(c *Client, r *Request) error {
}
}
+ // GH#797 Unescape query parameters
+ if r.unescapeQueryParams && len(reqURL.RawQuery) > 0 {
+ // at this point, all errors caught up in the above operations
+ // so ignore the return error on query unescape; I realized
+ // while writing the unit test
+ unescapedQuery, _ := url.QueryUnescape(reqURL.RawQuery)
+ reqURL.RawQuery = strings.ReplaceAll(unescapedQuery, " ", "+") // otherwise request becomes bad request
+ }
+
r.URL = reqURL.String()
return nil
@@ -254,17 +263,19 @@ func createHTTPRequest(c *Client, r *Request) (err error) {
r.RawRequest = r.RawRequest.WithContext(r.ctx)
}
- bodyCopy, err := getBodyCopy(r)
- if err != nil {
- return err
- }
-
// assign get body func for the underlying raw request instance
- r.RawRequest.GetBody = func() (io.ReadCloser, error) {
+ if r.RawRequest.GetBody == nil {
+ bodyCopy, err := getBodyCopy(r)
+ if err != nil {
+ return err
+ }
if bodyCopy != nil {
- return io.NopCloser(bytes.NewReader(bodyCopy.Bytes())), nil
+ buf := bodyCopy.Bytes()
+ r.RawRequest.GetBody = func() (io.ReadCloser, error) {
+ b := bytes.NewReader(buf)
+ return io.NopCloser(b), nil
+ }
}
- return nil, nil
}
return
@@ -307,6 +318,16 @@ func addCredentials(c *Client, r *Request) error {
return nil
}
+func createCurlCmd(c *Client, r *Request) (err error) {
+ if r.Debug && r.generateCurlOnDebug {
+ if r.resultCurlCmd == nil {
+ r.resultCurlCmd = new(string)
+ }
+ *r.resultCurlCmd = buildCurlRequest(r.RawRequest, c.httpClient.Jar)
+ }
+ return nil
+}
+
func requestLogger(c *Client, r *Request) error {
if r.Debug {
rr := r.RawRequest
@@ -328,8 +349,14 @@ func requestLogger(c *Client, r *Request) error {
}
}
- reqLog := "\n==============================================================================\n" +
- "~~~ REQUEST ~~~\n" +
+ reqLog := "\n==============================================================================\n"
+
+ if r.Debug && r.generateCurlOnDebug {
+ reqLog += "~~~ REQUEST(CURL) ~~~\n" +
+ fmt.Sprintf(" %v\n", *r.resultCurlCmd)
+ }
+
+ reqLog += "~~~ REQUEST ~~~\n" +
fmt.Sprintf("%s %s %s\n", r.Method, rr.URL.RequestURI(), rr.Proto) +
fmt.Sprintf("HOST : %s\n", rr.URL.Host) +
fmt.Sprintf("HEADERS:\n%s\n", composeHeaders(c, r, rl.Header)) +
@@ -359,7 +386,7 @@ func responseLogger(c *Client, res *Response) error {
debugLog := res.Request.values[debugRequestLogKey].(string)
debugLog += "~~~ RESPONSE ~~~\n" +
fmt.Sprintf("STATUS : %s\n", res.Status()) +
- fmt.Sprintf("PROTO : %s\n", res.RawResponse.Proto) +
+ fmt.Sprintf("PROTO : %s\n", res.Proto()) +
fmt.Sprintf("RECEIVED AT : %v\n", res.ReceivedAt().Format(time.RFC3339Nano)) +
fmt.Sprintf("TIME DURATION: %v\n", res.Time()) +
"HEADERS :\n" +
@@ -417,6 +444,13 @@ func handleMultipart(c *Client, r *Request) error {
r.bodyBuf = acquireBuffer()
w := multipart.NewWriter(r.bodyBuf)
+ // Set boundary if not set by user
+ if r.multipartBoundary != "" {
+ if err := w.SetBoundary(r.multipartBoundary); err != nil {
+ return err
+ }
+ }
+
for k, v := range c.FormData {
for _, iv := range v {
if err := w.WriteField(k, iv); err != nil {
diff --git a/vendor/github.com/go-resty/resty/v2/redirect.go b/vendor/github.com/go-resty/resty/v2/redirect.go
index ed58d735..bb016e27 100644
--- a/vendor/github.com/go-resty/resty/v2/redirect.go
+++ b/vendor/github.com/go-resty/resty/v2/redirect.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2015-2023 Jeevanandam M (jeeva@myjeeva.com), All rights reserved.
+// Copyright (c) 2015-2024 Jeevanandam M (jeeva@myjeeva.com), All rights reserved.
// resty source code and usage is governed by a MIT style
// license that can be found in the LICENSE file.
@@ -13,22 +13,22 @@ import (
)
var (
- // Since v2.8.0
ErrAutoRedirectDisabled = errors.New("auto redirect is disabled")
)
type (
- // RedirectPolicy to regulate the redirects in the resty client.
- // Objects implementing the RedirectPolicy interface can be registered as
+ // RedirectPolicy to regulate the redirects in the Resty client.
+ // Objects implementing the [RedirectPolicy] interface can be registered as
//
- // Apply function should return nil to continue the redirect journey, otherwise
+ // Apply function should return nil to continue the redirect journey; otherwise
// return error to stop the redirect.
RedirectPolicy interface {
Apply(req *http.Request, via []*http.Request) error
}
- // The RedirectPolicyFunc type is an adapter to allow the use of ordinary functions as RedirectPolicy.
- // If f is a function with the appropriate signature, RedirectPolicyFunc(f) is a RedirectPolicy object that calls f.
+ // The [RedirectPolicyFunc] type is an adapter to allow the use of ordinary
+ // functions as [RedirectPolicy]. If `f` is a function with the appropriate
+ // signature, RedirectPolicyFunc(f) is a RedirectPolicy object that calls `f`.
RedirectPolicyFunc func(*http.Request, []*http.Request) error
)
@@ -37,7 +37,7 @@ func (f RedirectPolicyFunc) Apply(req *http.Request, via []*http.Request) error
return f(req, via)
}
-// NoRedirectPolicy is used to disable redirects in the HTTP client
+// NoRedirectPolicy is used to disable redirects in the Resty client
//
// resty.SetRedirectPolicy(NoRedirectPolicy())
func NoRedirectPolicy() RedirectPolicy {
@@ -46,7 +46,7 @@ func NoRedirectPolicy() RedirectPolicy {
})
}
-// FlexibleRedirectPolicy is convenient method to create No of redirect policy for HTTP client.
+// FlexibleRedirectPolicy method is convenient for creating several redirect policies for Resty clients.
//
// resty.SetRedirectPolicy(FlexibleRedirectPolicy(20))
func FlexibleRedirectPolicy(noOfRedirect int) RedirectPolicy {
@@ -59,8 +59,8 @@ func FlexibleRedirectPolicy(noOfRedirect int) RedirectPolicy {
})
}
-// DomainCheckRedirectPolicy is convenient method to define domain name redirect rule in resty client.
-// Redirect is allowed for only mentioned host in the policy.
+// DomainCheckRedirectPolicy method is convenient for defining domain name redirect rules in Resty clients.
+// Redirect is allowed only for the host mentioned in the policy.
//
// resty.SetRedirectPolicy(DomainCheckRedirectPolicy("host1.com", "host2.org", "host3.net"))
func DomainCheckRedirectPolicy(hostnames ...string) RedirectPolicy {
@@ -80,10 +80,6 @@ func DomainCheckRedirectPolicy(hostnames ...string) RedirectPolicy {
return fn
}
-//‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
-// Package Unexported methods
-//_______________________________________________________________________
-
func getHostname(host string) (hostname string) {
if strings.Index(host, ":") > 0 {
host, _, _ = net.SplitHostPort(host)
@@ -92,10 +88,11 @@ func getHostname(host string) (hostname string) {
return
}
-// By default Golang will not redirect request headers
-// after go throwing various discussion comments from thread
+// By default, Golang will not redirect request headers.
+// After reading through the various discussion comments from the thread -
// https://github.com/golang/go/issues/4800
-// Resty will add all the headers during a redirect for the same host
+// Resty will add all the headers during a redirect for the same host and
+// adds library user-agent if the Host is different.
func checkHostAndAddHeaders(cur *http.Request, pre *http.Request) {
curHostname := getHostname(cur.URL.Host)
preHostname := getHostname(pre.URL.Host)
diff --git a/vendor/github.com/go-resty/resty/v2/request.go b/vendor/github.com/go-resty/resty/v2/request.go
index fec09763..6c6f9259 100644
--- a/vendor/github.com/go-resty/resty/v2/request.go
+++ b/vendor/github.com/go-resty/resty/v2/request.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2015-2023 Jeevanandam M (jeeva@myjeeva.com), All rights reserved.
+// Copyright (c) 2015-2024 Jeevanandam M (jeeva@myjeeva.com), All rights reserved.
// resty source code and usage is governed by a MIT style
// license that can be found in the LICENSE file.
@@ -23,9 +23,9 @@ import (
// Request struct and methods
//_______________________________________________________________________
-// Request struct is used to compose and fire individual request from
-// resty client. Request provides an options to override client level
-// settings and also an options for the request composition.
+// Request struct is used to compose and fire individual requests from
+// Resty client. The [Request] provides an option to override client-level
+// settings and also an option for the request composition.
type Request struct {
URL string
Method string
@@ -39,6 +39,7 @@ type Request struct {
Time time.Time
Body interface{}
Result interface{}
+ resultCurlCmd *string
Error interface{}
RawRequest *http.Request
SRV *SRVRecord
@@ -48,8 +49,6 @@ type Request struct {
// Attempt is to represent the request attempt made during a Resty
// request execution flow, including retry count.
- //
- // Since v2.4.0
Attempt int
isMultiPart bool
@@ -68,13 +67,37 @@ type Request struct {
bodyBuf *bytes.Buffer
clientTrace *clientTrace
log Logger
+ multipartBoundary string
multipartFiles []*File
multipartFields []*MultipartField
retryConditions []RetryConditionFunc
+ responseBodyLimit int
+ generateCurlOnDebug bool
+ unescapeQueryParams bool
}
-// Context method returns the Context if its already set in request
-// otherwise it creates new one using `context.Background()`.
+// GenerateCurlCommand method generates the CURL command for the request.
+func (r *Request) GenerateCurlCommand() string {
+ if !(r.Debug && r.generateCurlOnDebug) {
+ return ""
+ }
+
+ if r.resultCurlCmd != nil {
+ return *r.resultCurlCmd
+ }
+
+ if r.RawRequest == nil {
+ r.client.executeBefore(r) // mock with r.Get("/")
+ }
+ if r.resultCurlCmd == nil {
+ r.resultCurlCmd = new(string)
+ }
+ *r.resultCurlCmd = buildCurlRequest(r.RawRequest, r.client.httpClient.Jar)
+ return *r.resultCurlCmd
+}
+
+// Context method returns the Context if it is already set in the [Request]
+// otherwise, it creates a new one using [context.Background].
func (r *Request) Context() context.Context {
if r.ctx == nil {
return context.Background()
@@ -82,16 +105,16 @@ func (r *Request) Context() context.Context {
return r.ctx
}
-// SetContext method sets the context.Context for current Request. It allows
-// to interrupt the request execution if ctx.Done() channel is closed.
-// See https://blog.golang.org/context article and the "context" package
+// SetContext method sets the [context.Context] for current [Request]. It allows
+// to interrupt the request execution if `ctx.Done()` channel is closed.
+// See https://blog.golang.org/context article and the package [context]
// documentation.
func (r *Request) SetContext(ctx context.Context) *Request {
r.ctx = ctx
return r
}
-// SetHeader method is to set a single header field and its value in the current request.
+// SetHeader method sets a single header field and its value in the current request.
//
// For Example: To set `Content-Type` and `Accept` as `application/json`.
//
@@ -99,13 +122,13 @@ func (r *Request) SetContext(ctx context.Context) *Request {
// SetHeader("Content-Type", "application/json").
// SetHeader("Accept", "application/json")
//
-// Also you can override header value, which was set at client instance level.
+// It overrides the header value set at the client instance level.
func (r *Request) SetHeader(header, value string) *Request {
r.Header.Set(header, value)
return r
}
-// SetHeaders method sets multiple headers field and its values at one go in the current request.
+// SetHeaders method sets multiple header fields and their values at one go in the current request.
//
// For Example: To set `Content-Type` and `Accept` as `application/json`
//
@@ -115,7 +138,7 @@ func (r *Request) SetHeader(header, value string) *Request {
// "Accept": "application/json",
// })
//
-// Also you can override header value, which was set at client instance level.
+// It overrides the header value set at the client instance level.
func (r *Request) SetHeaders(headers map[string]string) *Request {
for h, v := range headers {
r.SetHeader(h, v)
@@ -123,7 +146,7 @@ func (r *Request) SetHeaders(headers map[string]string) *Request {
return r
}
-// SetHeaderMultiValues sets multiple headers fields and its values is list of strings at one go in the current request.
+// SetHeaderMultiValues sets multiple header fields and their values as a list of strings in the current request.
//
// For Example: To set `Accept` as `text/html, application/xhtml+xml, application/xml;q=0.9, image/webp, */*;q=0.8`
//
@@ -132,7 +155,7 @@ func (r *Request) SetHeaders(headers map[string]string) *Request {
// "Accept": []string{"text/html", "application/xhtml+xml", "application/xml;q=0.9", "image/webp", "*/*;q=0.8"},
// })
//
-// Also you can override header value, which was set at client instance level.
+// It overrides the header value set at the client instance level.
func (r *Request) SetHeaderMultiValues(headers map[string][]string) *Request {
for key, values := range headers {
r.SetHeader(key, strings.Join(values, ", "))
@@ -140,7 +163,7 @@ func (r *Request) SetHeaderMultiValues(headers map[string][]string) *Request {
return r
}
-// SetHeaderVerbatim method is to set a single header field and its value verbatim in the current request.
+// SetHeaderVerbatim method sets a single header field and its value verbatim in the current request.
//
// For Example: To set `all_lowercase` and `UPPERCASE` as `available`.
//
@@ -148,33 +171,31 @@ func (r *Request) SetHeaderMultiValues(headers map[string][]string) *Request {
// SetHeaderVerbatim("all_lowercase", "available").
// SetHeaderVerbatim("UPPERCASE", "available")
//
-// Also you can override header value, which was set at client instance level.
-//
-// Since v2.6.0
+// It overrides the header value set at the client instance level.
func (r *Request) SetHeaderVerbatim(header, value string) *Request {
r.Header[header] = []string{value}
return r
}
-// SetQueryParam method sets single parameter and its value in the current request.
-// It will be formed as query string for the request.
+// SetQueryParam method sets a single parameter and its value in the current request.
+// It will be formed as a query string for the request.
//
-// For Example: `search=kitchen%20papers&size=large` in the URL after `?` mark.
+// For Example: `search=kitchen%20papers&size=large` in the URL after the `?` mark.
//
// client.R().
// SetQueryParam("search", "kitchen papers").
// SetQueryParam("size", "large")
//
-// Also you can override query params value, which was set at client instance level.
+// It overrides the query parameter value set at the client instance level.
func (r *Request) SetQueryParam(param, value string) *Request {
r.QueryParam.Set(param, value)
return r
}
-// SetQueryParams method sets multiple parameters and its values at one go in the current request.
-// It will be formed as query string for the request.
+// SetQueryParams method sets multiple parameters and their values at one go in the current request.
+// It will be formed as a query string for the request.
//
-// For Example: `search=kitchen%20papers&size=large` in the URL after `?` mark.
+// For Example: `search=kitchen%20papers&size=large` in the URL after the `?` mark.
//
// client.R().
// SetQueryParams(map[string]string{
@@ -182,7 +203,7 @@ func (r *Request) SetQueryParam(param, value string) *Request {
// "size": "large",
// })
//
-// Also you can override query params value, which was set at client instance level.
+// It overrides the query parameter value set at the client instance level.
func (r *Request) SetQueryParams(params map[string]string) *Request {
for p, v := range params {
r.SetQueryParam(p, v)
@@ -190,18 +211,29 @@ func (r *Request) SetQueryParams(params map[string]string) *Request {
return r
}
+// SetUnescapeQueryParams method sets the unescape query parameters choice for request URL.
+// To prevent broken URL, resty replaces space (" ") with "+" in the query parameters.
+//
+// This method overrides the value set by [Client.SetUnescapeQueryParams]
+//
+// NOTE: Request failure is possible due to non-standard usage of Unescaped Query Parameters.
+func (r *Request) SetUnescapeQueryParams(unescape bool) *Request {
+ r.unescapeQueryParams = unescape
+ return r
+}
+
// SetQueryParamsFromValues method appends multiple parameters with multi-value
-// (`url.Values`) at one go in the current request. It will be formed as
+// ([url.Values]) at one go in the current request. It will be formed as
// query string for the request.
//
-// For Example: `status=pending&status=approved&status=open` in the URL after `?` mark.
+// For Example: `status=pending&status=approved&status=open` in the URL after the `?` mark.
//
// client.R().
// SetQueryParamsFromValues(url.Values{
// "status": []string{"pending", "approved", "open"},
// })
//
-// Also you can override query params value, which was set at client instance level.
+// It overrides the query parameter value set at the client instance level.
func (r *Request) SetQueryParamsFromValues(params url.Values) *Request {
for p, v := range params {
for _, pv := range v {
@@ -211,12 +243,12 @@ func (r *Request) SetQueryParamsFromValues(params url.Values) *Request {
return r
}
-// SetQueryString method provides ability to use string as an input to set URL query string for the request.
-//
-// Using String as an input
+// SetQueryString method provides the ability to use string as an input to set URL query string for the request.
//
// client.R().
// SetQueryString("productId=232&template=fresh-sample&cat=resty&source=google&kw=buy a lot more")
+//
+// It overrides the query parameter value set at the client instance level.
func (r *Request) SetQueryString(query string) *Request {
params, err := url.ParseQuery(strings.TrimSpace(query))
if err == nil {
@@ -231,9 +263,9 @@ func (r *Request) SetQueryString(query string) *Request {
return r
}
-// SetFormData method sets Form parameters and their values in the current request.
-// It's applicable only HTTP method `POST` and `PUT` and requests content type would be set as
-// `application/x-www-form-urlencoded`.
+// SetFormData method sets Form parameters and their values for the current request.
+// It applies only to HTTP methods `POST` and `PUT`, and by default requests
+// content type would be set as `application/x-www-form-urlencoded`.
//
// client.R().
// SetFormData(map[string]string{
@@ -241,7 +273,7 @@ func (r *Request) SetQueryString(query string) *Request {
// "user_id": "3455454545",
// })
//
-// Also you can override form data value, which was set at client instance level.
+// It overrides the form data value set at the client instance level.
func (r *Request) SetFormData(data map[string]string) *Request {
for k, v := range data {
r.FormData.Set(k, v)
@@ -250,14 +282,14 @@ func (r *Request) SetFormData(data map[string]string) *Request {
}
// SetFormDataFromValues method appends multiple form parameters with multi-value
-// (`url.Values`) at one go in the current request.
+// ([url.Values]) at one go in the current request.
//
// client.R().
// SetFormDataFromValues(url.Values{
// "search_criteria": []string{"book", "glass", "pencil"},
// })
//
-// Also you can override form data value, which was set at client instance level.
+// It overrides the form data value set at the client instance level.
func (r *Request) SetFormDataFromValues(data url.Values) *Request {
for k, v := range data {
for _, kv := range v {
@@ -267,14 +299,17 @@ func (r *Request) SetFormDataFromValues(data url.Values) *Request {
return r
}
-// SetBody method sets the request body for the request. It supports various realtime needs as easy.
-// We can say its quite handy or powerful. Supported request body data types is `string`,
-// `[]byte`, `struct`, `map`, `slice` and `io.Reader`. Body value can be pointer or non-pointer.
-// Automatic marshalling for JSON and XML content type, if it is `struct`, `map`, or `slice`.
+// SetBody method sets the request body for the request. It supports various practical needs as easy.
+// It's quite handy and powerful. Supported request body data types are `string`,
+// `[]byte`, `struct`, `map`, `slice` and [io.Reader].
+//
+// Body value can be pointer or non-pointer. Automatic marshalling for JSON and XML content type, if it is `struct`, `map`, or `slice`.
//
-// Note: `io.Reader` is processed as bufferless mode while sending request.
+// NOTE: [io.Reader] is processed in bufferless mode while sending a request.
//
-// For Example: Struct as a body input, based on content type, it will be marshalled.
+// For Example:
+//
+// `struct` gets marshaled based on the request header `Content-Type`.
//
// client.R().
// SetBody(User{
@@ -282,7 +317,7 @@ func (r *Request) SetFormDataFromValues(data url.Values) *Request {
// Password: "welcome2resty",
// })
//
-// Map as a body input, based on content type, it will be marshalled.
+// 'map` gets marshaled based on the request header `Content-Type`.
//
// client.R().
// SetBody(map[string]interface{}{
@@ -297,7 +332,7 @@ func (r *Request) SetFormDataFromValues(data url.Values) *Request {
// },
// })
//
-// String as a body input. Suitable for any need as a string input.
+// `string` as a body input. Suitable for any need as a string input.
//
// client.R().
// SetBody(`{
@@ -305,27 +340,41 @@ func (r *Request) SetFormDataFromValues(data url.Values) *Request {
// "password": "admin"
// }`)
//
-// []byte as a body input. Suitable for raw request such as file upload, serialize & deserialize, etc.
+// `[]byte` as a body input. Suitable for raw requests such as file upload, serialize & deserialize, etc.
//
// client.R().
// SetBody([]byte("This is my raw request, sent as-is"))
+//
+// and so on.
func (r *Request) SetBody(body interface{}) *Request {
r.Body = body
return r
}
-// SetResult method is to register the response `Result` object for automatic unmarshalling for the request,
-// if response status code is between 200 and 299 and content type either JSON or XML.
+// SetResult method is to register the response `Result` object for automatic
+// unmarshalling of the HTTP response if the response status code is
+// between 200 and 299, and the content type is JSON or XML.
+//
+// Note: [Request.SetResult] input can be a pointer or non-pointer.
+//
+// The pointer with handle
//
-// Note: Result object can be pointer or non-pointer.
+// authToken := &AuthToken{}
+// client.R().SetResult(authToken)
+//
+// // Can be accessed via -
+// fmt.Println(authToken) OR fmt.Println(response.Result().(*AuthToken))
+//
+// OR -
+//
+// The pointer without handle or non-pointer
//
// client.R().SetResult(&AuthToken{})
// // OR
// client.R().SetResult(AuthToken{})
//
-// Accessing a result value from response instance.
-//
-// response.Result().(*AuthToken)
+// // Can be accessed via -
+// fmt.Println(response.Result().(*AuthToken))
func (r *Request) SetResult(res interface{}) *Request {
if res != nil {
r.Result = getPointer(res)
@@ -334,23 +383,25 @@ func (r *Request) SetResult(res interface{}) *Request {
}
// SetError method is to register the request `Error` object for automatic unmarshalling for the request,
-// if response status code is greater than 399 and content type either JSON or XML.
+// if the response status code is greater than 399 and the content type is either JSON or XML.
//
-// Note: Error object can be pointer or non-pointer.
+// NOTE: [Request.SetError] input can be a pointer or non-pointer.
//
// client.R().SetError(&AuthError{})
// // OR
// client.R().SetError(AuthError{})
//
-// Accessing a error value from response instance.
+// Accessing an error value from response instance.
//
// response.Error().(*AuthError)
+//
+// If this request Error object is nil, Resty will use the client-level error object Type if it is set.
func (r *Request) SetError(err interface{}) *Request {
r.Error = getPointer(err)
return r
}
-// SetFile method is to set single file field name and its path for multipart upload.
+// SetFile method sets a single file field name and its path for multipart upload.
//
// client.R().
// SetFile("my_file", "/Users/jeeva/Gas Bill - Sep.pdf")
@@ -360,7 +411,7 @@ func (r *Request) SetFile(param, filePath string) *Request {
return r
}
-// SetFiles method is to set multiple file field name and its path for multipart upload.
+// SetFiles method sets multiple file field names and their paths for multipart uploads.
//
// client.R().
// SetFiles(map[string]string{
@@ -376,7 +427,7 @@ func (r *Request) SetFiles(files map[string]string) *Request {
return r
}
-// SetFileReader method is to set single file using io.Reader for multipart upload.
+// SetFileReader method is to set a file using [io.Reader] for multipart upload.
//
// client.R().
// SetFileReader("profile_img", "my-profile-img.png", bytes.NewReader(profileImgBytes)).
@@ -391,7 +442,8 @@ func (r *Request) SetFileReader(param, fileName string, reader io.Reader) *Reque
return r
}
-// SetMultipartFormData method allows simple form data to be attached to the request as `multipart:form-data`
+// SetMultipartFormData method allows simple form data to be attached to the request
+// as `multipart:form-data`
func (r *Request) SetMultipartFormData(data map[string]string) *Request {
for k, v := range data {
r = r.SetMultipartField(k, "", "", strings.NewReader(v))
@@ -400,7 +452,7 @@ func (r *Request) SetMultipartFormData(data map[string]string) *Request {
return r
}
-// SetMultipartField method is to set custom data using io.Reader for multipart upload.
+// SetMultipartField method sets custom data with Content-Type using [io.Reader] for multipart upload.
func (r *Request) SetMultipartField(param, fileName, contentType string, reader io.Reader) *Request {
r.isMultiPart = true
r.multipartFields = append(r.multipartFields, &MultipartField{
@@ -412,7 +464,7 @@ func (r *Request) SetMultipartField(param, fileName, contentType string, reader
return r
}
-// SetMultipartFields method is to set multiple data fields using io.Reader for multipart upload.
+// SetMultipartFields method sets multiple data fields using [io.Reader] for multipart upload.
//
// For Example:
//
@@ -430,7 +482,7 @@ func (r *Request) SetMultipartField(param, fileName, contentType string, reader
// Reader: strings.NewReader(`{"input": {"name": "Uploaded document 2", "_filename" : ["file2.txt"]}}`),
// })
//
-// If you have slice already, then simply call-
+// If you have a `slice` of fields already, then call-
//
// client.R().SetMultipartFields(fields...)
func (r *Request) SetMultipartFields(fields ...*MultipartField) *Request {
@@ -439,13 +491,21 @@ func (r *Request) SetMultipartFields(fields ...*MultipartField) *Request {
return r
}
-// SetContentLength method sets the HTTP header `Content-Length` value for current request.
-// By default Resty won't set `Content-Length`. Also you have an option to enable for every
-// request.
+// SetMultipartBoundary method sets the custom multipart boundary for the multipart request.
+// Typically, the `mime/multipart` package generates a random multipart boundary if not provided.
+func (r *Request) SetMultipartBoundary(boundary string) *Request {
+ r.multipartBoundary = boundary
+ return r
+}
+
+// SetContentLength method sets the current request's HTTP header `Content-Length` value.
+// By default, Resty won't set `Content-Length`.
//
-// See `Client.SetContentLength`
+// See [Client.SetContentLength]
//
// client.R().SetContentLength(true)
+//
+// It overrides the value set at the client instance level.
func (r *Request) SetContentLength(l bool) *Request {
r.setContentLength = l
return r
@@ -461,7 +521,7 @@ func (r *Request) SetContentLength(l bool) *Request {
//
// client.R().SetBasicAuth("go-resty", "welcome")
//
-// This method overrides the credentials set by method `Client.SetBasicAuth`.
+// It overrides the credentials set by method [Client.SetBasicAuth].
func (r *Request) SetBasicAuth(username, password string) *Request {
r.UserInfo = &User{Username: username, Password: password}
return r
@@ -475,13 +535,15 @@ func (r *Request) SetBasicAuth(username, password string) *Request {
//
// client.R().SetAuthToken("BC594900518B4F7EAC75BD37F019E08FBC594900518B4F7EAC75BD37F019E08F")
//
-// This method overrides the Auth token set by method `Client.SetAuthToken`.
+// It overrides the Auth token set by method [Client.SetAuthToken].
func (r *Request) SetAuthToken(token string) *Request {
r.Token = token
return r
}
-// SetAuthScheme method sets the auth token scheme type in the HTTP request. For Example:
+// SetAuthScheme method sets the auth token scheme type in the HTTP request.
+//
+// Example Header value structure:
//
// Authorization:
//
@@ -489,33 +551,33 @@ func (r *Request) SetAuthToken(token string) *Request {
//
// client.R().SetAuthScheme("OAuth")
//
-// This auth header scheme gets added to all the request raised from this client instance.
-// Also it can be overridden or set one at the request level is supported.
+// // The outcome will be -
+// Authorization: OAuth
//
-// Information about Auth schemes can be found in RFC7235 which is linked to below along with the page containing
-// the currently defined official authentication schemes:
+// Information about Auth schemes can be found in [RFC 7235], IANA [HTTP Auth schemes]
//
-// https://tools.ietf.org/html/rfc7235
-// https://www.iana.org/assignments/http-authschemes/http-authschemes.xhtml#authschemes
+// It overrides the `Authorization` scheme set by method [Client.SetAuthScheme].
//
-// This method overrides the Authorization scheme set by method `Client.SetAuthScheme`.
+// [RFC 7235]: https://tools.ietf.org/html/rfc7235
+// [HTTP Auth schemes]: https://www.iana.org/assignments/http-authschemes/http-authschemes.xhtml#authschemes
func (r *Request) SetAuthScheme(scheme string) *Request {
r.AuthScheme = scheme
return r
}
-// SetDigestAuth method sets the Digest Access auth scheme for the HTTP request. If a server responds with 401 and sends
-// a Digest challenge in the WWW-Authenticate Header, the request will be resent with the appropriate Authorization Header.
+// SetDigestAuth method sets the Digest Access auth scheme for the HTTP request.
+// If a server responds with 401 and sends a Digest challenge in the WWW-Authenticate Header,
+// the request will be resent with the appropriate Authorization Header.
//
// For Example: To set the Digest scheme with username "Mufasa" and password "Circle Of Life"
//
// client.R().SetDigestAuth("Mufasa", "Circle Of Life")
//
-// Information about Digest Access Authentication can be found in RFC7616:
+// Information about Digest Access Authentication can be found in [RFC 7616]
//
-// https://datatracker.ietf.org/doc/html/rfc7616
+// It overrides the digest username and password set by method [Client.SetDigestAuth].
//
-// This method overrides the username and password set by method `Client.SetDigestAuth`.
+// [RFC 7616]: https://datatracker.ietf.org/doc/html/rfc7616
func (r *Request) SetDigestAuth(username, password string) *Request {
oldTransport := r.client.httpClient.Transport
r.client.OnBeforeRequest(func(c *Client, _ *Request) error {
@@ -533,16 +595,19 @@ func (r *Request) SetDigestAuth(username, password string) *Request {
return r
}
-// SetOutput method sets the output file for current HTTP request. Current HTTP response will be
-// saved into given file. It is similar to `curl -o` flag. Absolute path or relative path can be used.
-// If is it relative path then output file goes under the output directory, as mentioned
-// in the `Client.SetOutputDirectory`.
+// SetOutput method sets the output file for the current HTTP request. The current
+// HTTP response will be saved in the given file. It is similar to the `curl -o` flag.
+//
+// Absolute path or relative path can be used.
+//
+// If it is a relative path, then the output file goes under the output directory, as mentioned
+// in the [Client.SetOutputDirectory].
//
// client.R().
// SetOutput("/Users/jeeva/Downloads/ReplyWithHeader-v5.1-beta.zip").
// Get("http://bit.ly/1LouEKr")
//
-// Note: In this scenario `Response.Body` might be nil.
+// NOTE: In this scenario [Response.Body] might be nil.
func (r *Request) SetOutput(file string) *Request {
r.outputFile = file
r.isSaveResponse = true
@@ -560,18 +625,35 @@ func (r *Request) SetSRV(srv *SRVRecord) *Request {
return r
}
-// SetDoNotParseResponse method instructs `Resty` not to parse the response body automatically.
-// Resty exposes the raw response body as `io.ReadCloser`. Also do not forget to close the body,
-// otherwise you might get into connection leaks, no connection reuse.
+// SetDoNotParseResponse method instructs Resty not to parse the response body automatically.
+// Resty exposes the raw response body as [io.ReadCloser]. If you use it, do not
+// forget to close the body, otherwise, you might get into connection leaks, and connection
+// reuse may not happen.
//
-// Note: Response middlewares are not applicable, if you use this option. Basically you have
-// taken over the control of response parsing from `Resty`.
+// NOTE: [Response] middlewares are not executed using this option. You have
+// taken over the control of response parsing from Resty.
func (r *Request) SetDoNotParseResponse(parse bool) *Request {
r.notParseResponse = parse
return r
}
-// SetPathParam method sets single URL path key-value pair in the
+// SetResponseBodyLimit method sets a maximum body size limit in bytes on response,
+// avoid reading too much data to memory.
+//
+// Client will return [resty.ErrResponseBodyTooLarge] if the body size of the body
+// in the uncompressed response is larger than the limit.
+// Body size limit will not be enforced in the following cases:
+// - ResponseBodyLimit <= 0, which is the default behavior.
+// - [Request.SetOutput] is called to save response data to the file.
+// - "DoNotParseResponse" is set for client or request.
+//
+// It overrides the value set at the client instance level. see [Client.SetResponseBodyLimit]
+func (r *Request) SetResponseBodyLimit(v int) *Request {
+ r.responseBodyLimit = v
+ return r
+}
+
+// SetPathParam method sets a single URL path key-value pair in the
// Resty current request instance.
//
// client.R().SetPathParam("userId", "sample@sample.com")
@@ -587,10 +669,9 @@ func (r *Request) SetDoNotParseResponse(parse bool) *Request {
// Composed URL - /v1/users/groups%2Fdevelopers/details
//
// It replaces the value of the key while composing the request URL.
-// The values will be escaped using `url.PathEscape` function.
+// The values will be escaped using function [url.PathEscape].
//
-// Also you can override Path Params value, which was set at client instance
-// level.
+// It overrides the path parameter set at the client instance level.
func (r *Request) SetPathParam(param, value string) *Request {
r.PathParams[param] = value
return r
@@ -609,11 +690,10 @@ func (r *Request) SetPathParam(param, value string) *Request {
// URL - /v1/users/{userId}/{subAccountId}/{path}/details
// Composed URL - /v1/users/sample@sample.com/100002/groups%2Fdevelopers/details
//
-// It replaces the value of the key while composing request URL.
-// The value will be used as it is and will not be escaped.
+// It replaces the value of the key while composing the request URL.
+// The values will be escaped using function [url.PathEscape].
//
-// Also you can override Path Params value, which was set at client instance
-// level.
+// It overrides the path parameter set at the client instance level.
func (r *Request) SetPathParams(params map[string]string) *Request {
for p, v := range params {
r.SetPathParam(p, v)
@@ -621,7 +701,7 @@ func (r *Request) SetPathParams(params map[string]string) *Request {
return r
}
-// SetRawPathParam method sets single URL path key-value pair in the
+// SetRawPathParam method sets a single URL path key-value pair in the
// Resty current request instance.
//
// client.R().SetPathParam("userId", "sample@sample.com")
@@ -637,12 +717,9 @@ func (r *Request) SetPathParams(params map[string]string) *Request {
// Composed URL - /v1/users/groups/developers/details
//
// It replaces the value of the key while composing the request URL.
-// The value will be used as it is and will not be escaped.
+// The value will be used as-is and has not been escaped.
//
-// Also you can override Path Params value, which was set at client instance
-// level.
-//
-// Since v2.8.0
+// It overrides the raw path parameter set at the client instance level.
func (r *Request) SetRawPathParam(param, value string) *Request {
r.RawPathParams[param] = value
return r
@@ -661,13 +738,10 @@ func (r *Request) SetRawPathParam(param, value string) *Request {
// URL - /v1/users/{userId}/{subAccountId}/{path}/details
// Composed URL - /v1/users/sample@sample.com/100002/groups/developers/details
//
-// It replaces the value of the key while composing request URL.
-// The values will be used as they are and will not be escaped.
-//
-// Also you can override Path Params value, which was set at client instance
-// level.
+// It replaces the value of the key while composing the request URL.
+// The value will be used as-is and has not been escaped.
//
-// Since v2.8.0
+// It overrides the raw path parameter set at the client instance level.
func (r *Request) SetRawPathParams(params map[string]string) *Request {
for p, v := range params {
r.SetRawPathParam(p, v)
@@ -676,23 +750,29 @@ func (r *Request) SetRawPathParams(params map[string]string) *Request {
}
// ExpectContentType method allows to provide fallback `Content-Type` for automatic unmarshalling
-// when `Content-Type` response header is unavailable.
+// when the `Content-Type` response header is unavailable.
func (r *Request) ExpectContentType(contentType string) *Request {
r.fallbackContentType = contentType
return r
}
-// ForceContentType method provides a strong sense of response `Content-Type` for automatic unmarshalling.
-// Resty gives this a higher priority than the `Content-Type` response header. This means that if both
-// `Request.ForceContentType` is set and the response `Content-Type` is available, `ForceContentType` will win.
+// ForceContentType method provides a strong sense of response `Content-Type` for
+// automatic unmarshalling. Resty gives this a higher priority than the `Content-Type`
+// response header.
+//
+// This means that if both [Request.ForceContentType] is set and
+// the response `Content-Type` is available, `ForceContentType` will win.
func (r *Request) ForceContentType(contentType string) *Request {
r.forceContentType = contentType
return r
}
-// SetJSONEscapeHTML method is to enable/disable the HTML escape on JSON marshal.
+// SetJSONEscapeHTML method enables or disables the HTML escape on JSON marshal.
+// By default, escape HTML is false.
//
-// Note: This option only applicable to standard JSON Marshaller.
+// NOTE: This option only applies to the standard JSON Marshaller used by Resty.
+//
+// It overrides the value set at the client instance level, see [Client.SetJSONEscapeHTML]
func (r *Request) SetJSONEscapeHTML(b bool) *Request {
r.jsonEscapeHTML = b
return r
@@ -705,9 +785,7 @@ func (r *Request) SetJSONEscapeHTML(b bool) *Request {
// Value:"This is cookie value",
// })
//
-// Note: Method appends the Cookie value into existing Cookie if already existing.
-//
-// Since v2.1.0
+// NOTE: Method appends the Cookie value into existing Cookie even if its already existing.
func (r *Request) SetCookie(hc *http.Cookie) *Request {
r.Cookies = append(r.Cookies, hc)
return r
@@ -729,9 +807,7 @@ func (r *Request) SetCookie(hc *http.Cookie) *Request {
// // Setting a cookies into resty's current request
// client.R().SetCookies(cookies)
//
-// Note: Method appends the Cookie value into existing Cookie if already existing.
-//
-// Since v2.1.0
+// NOTE: Method appends the Cookie value into existing Cookie even if its already existing.
func (r *Request) SetCookies(rs []*http.Cookie) *Request {
r.Cookies = append(r.Cookies, rs...)
return r
@@ -740,30 +816,35 @@ func (r *Request) SetCookies(rs []*http.Cookie) *Request {
// SetLogger method sets given writer for logging Resty request and response details.
// By default, requests and responses inherit their logger from the client.
//
-// Compliant to interface `resty.Logger`.
+// Compliant to interface [resty.Logger].
+//
+// It overrides the logger value set at the client instance level.
func (r *Request) SetLogger(l Logger) *Request {
r.log = l
return r
}
-// SetDebug method enables the debug mode on current request Resty request, It logs
+// SetDebug method enables the debug mode on the current request. It logs
// the details current request and response.
-// For `Request` it logs information such as HTTP verb, Relative URL path, Host, Headers, Body if it has one.
-// For `Response` it logs information such as Status, Response Time, Headers, Body if it has one.
//
-// client.R().SetDebug(true)
+// client.SetDebug(true)
+//
+// Also, it can be enabled at the request level for a particular request; see [Request.SetDebug].
+// - For [Request], it logs information such as HTTP verb, Relative URL path,
+// Host, Headers, and Body if it has one.
+// - For [Response], it logs information such as Status, Response Time, Headers,
+// and Body if it has one.
func (r *Request) SetDebug(d bool) *Request {
r.Debug = d
return r
}
// AddRetryCondition method adds a retry condition function to the request's
-// array of functions that are checked to determine if the request is retried.
-// The request will retry if any of the functions return true and error is nil.
-//
-// Note: These retry conditions are checked before all retry conditions of the client.
+// array of functions is checked to determine if the request can be retried.
+// The request will retry if any functions return true and the error is nil.
//
-// Since v2.7.0
+// NOTE: The request level retry conditions are checked before all retry
+// conditions from the client instance.
func (r *Request) AddRetryCondition(condition RetryConditionFunc) *Request {
r.retryConditions = append(r.retryConditions, condition)
return r
@@ -774,7 +855,7 @@ func (r *Request) AddRetryCondition(condition RetryConditionFunc) *Request {
//_______________________________________________________________________
// EnableTrace method enables trace for the current request
-// using `httptrace.ClientTrace` and provides insights.
+// using [httptrace.ClientTrace] and provides insights.
//
// client := resty.New()
//
@@ -782,19 +863,33 @@ func (r *Request) AddRetryCondition(condition RetryConditionFunc) *Request {
// fmt.Println("Error:", err)
// fmt.Println("Trace Info:", resp.Request.TraceInfo())
//
-// See `Client.EnableTrace` available too to get trace info for all requests.
-//
-// Since v2.0.0
+// See [Client.EnableTrace] is also available to get trace info for all requests.
func (r *Request) EnableTrace() *Request {
r.trace = true
return r
}
-// TraceInfo method returns the trace info for the request.
-// If either the Client or Request EnableTrace function has not been called
-// prior to the request being made, an empty TraceInfo object will be returned.
+// EnableGenerateCurlOnDebug method enables the generation of CURL commands in the debug log.
+// It works in conjunction with debug mode. It overrides the options set by the [Client].
//
-// Since v2.0.0
+// NOTE: Use with care.
+// - Potential to leak sensitive data from [Request] and [Response] in the debug log.
+// - Beware of memory usage since the request body is reread.
+func (r *Request) EnableGenerateCurlOnDebug() *Request {
+ r.generateCurlOnDebug = true
+ return r
+}
+
+// DisableGenerateCurlOnDebug method disables the option set by [Request.EnableGenerateCurlOnDebug].
+// It overrides the options set by the [Client].
+func (r *Request) DisableGenerateCurlOnDebug() *Request {
+ r.generateCurlOnDebug = false
+ return r
+}
+
+// TraceInfo method returns the trace info for the request.
+// If either the [Client.EnableTrace] or [Request.EnableTrace] function has not been called
+// before the request is made, an empty [resty.TraceInfo] object is returned.
func (r *Request) TraceInfo() TraceInfo {
ct := r.clientTrace
@@ -883,20 +978,20 @@ func (r *Request) Patch(url string) (*Response, error) {
}
// Send method performs the HTTP request using the method and URL already defined
-// for current `Request`.
+// for current [Request].
//
// req := client.R()
-// req.Method = resty.GET
+// req.Method = resty.MethodGet
// req.URL = "http://httpbin.org/get"
// resp, err := req.Send()
func (r *Request) Send() (*Response, error) {
return r.Execute(r.Method, r.URL)
}
-// Execute method performs the HTTP request with given HTTP method and URL
-// for current `Request`.
+// Execute method performs the HTTP request with the given HTTP method and URL
+// for current [Request].
//
-// resp, err := client.R().Execute(resty.GET, "http://httpbin.org/get")
+// resp, err := client.R().Execute(resty.MethodGet, "http://httpbin.org/get")
func (r *Request) Execute(method, url string) (*Response, error) {
var addrs []*net.SRV
var resp *Response
@@ -935,6 +1030,7 @@ func (r *Request) Execute(method, url string) (*Response, error) {
r.Attempt = 1
resp, err = r.client.execute(r)
r.client.onErrorHooks(r, resp, unwrapNoRetryErr(err))
+ backToBufPool(r.bodyBuf)
return resp, unwrapNoRetryErr(err)
}
@@ -964,6 +1060,7 @@ func (r *Request) Execute(method, url string) (*Response, error) {
}
r.client.onErrorHooks(r, resp, unwrapNoRetryErr(err))
+ backToBufPool(r.bodyBuf)
return resp, unwrapNoRetryErr(err)
}
@@ -978,10 +1075,6 @@ type SRVRecord struct {
Domain string
}
-//‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
-// Request Unexported methods
-//_______________________________________________________________________
-
func (r *Request) fmtBodyString(sl int64) (body string) {
body = "***** NO CONTENT *****"
if !isPayloadSupported(r.Method, r.client.AllowGetMethodPayload) {
@@ -1014,7 +1107,12 @@ func (r *Request) fmtBodyString(sl int64) (body string) {
contentType := r.Header.Get(hdrContentTypeKey)
kind := kindOf(r.Body)
if canJSONMarshal(contentType, kind) {
- prtBodyBytes, err = noescapeJSONMarshalIndent(&r.Body)
+ var bodyBuf *bytes.Buffer
+ bodyBuf, err = noescapeJSONMarshalIndent(&r.Body)
+ if err == nil {
+ prtBodyBytes = bodyBuf.Bytes()
+ defer releaseBuffer(bodyBuf)
+ }
} else if IsXMLType(contentType) && (kind == reflect.Struct) {
prtBodyBytes, err = xml.MarshalIndent(&r.Body, "", " ")
} else if b, ok := r.Body.(string); ok {
@@ -1077,17 +1175,16 @@ var noescapeJSONMarshal = func(v interface{}) (*bytes.Buffer, error) {
return buf, nil
}
-var noescapeJSONMarshalIndent = func(v interface{}) ([]byte, error) {
+var noescapeJSONMarshalIndent = func(v interface{}) (*bytes.Buffer, error) {
buf := acquireBuffer()
- defer releaseBuffer(buf)
-
encoder := json.NewEncoder(buf)
encoder.SetEscapeHTML(false)
encoder.SetIndent("", " ")
if err := encoder.Encode(v); err != nil {
+ releaseBuffer(buf)
return nil, err
}
- return buf.Bytes(), nil
+ return buf, nil
}
diff --git a/vendor/github.com/go-resty/resty/v2/response.go b/vendor/github.com/go-resty/resty/v2/response.go
index 63c95c41..f52b5c61 100644
--- a/vendor/github.com/go-resty/resty/v2/response.go
+++ b/vendor/github.com/go-resty/resty/v2/response.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2015-2023 Jeevanandam M (jeeva@myjeeva.com), All rights reserved.
+// Copyright (c) 2015-2024 Jeevanandam M (jeeva@myjeeva.com), All rights reserved.
// resty source code and usage is governed by a MIT style
// license that can be found in the LICENSE file.
@@ -17,7 +17,7 @@ import (
// Response struct and methods
//_______________________________________________________________________
-// Response struct holds response values of executed request.
+// Response struct holds response values of executed requests.
type Response struct {
Request *Request
RawResponse *http.Response
@@ -27,9 +27,10 @@ type Response struct {
receivedAt time.Time
}
-// Body method returns HTTP response as []byte array for the executed request.
+// Body method returns the HTTP response as `[]byte` slice for the executed request.
//
-// Note: `Response.Body` might be nil, if `Request.SetOutput` is used.
+// NOTE: [Response.Body] might be nil if [Request.SetOutput] is used.
+// Also see [Request.SetDoNotParseResponse], [Client.SetDoNotParseResponse]
func (r *Response) Body() []byte {
if r.RawResponse == nil {
return []byte{}
@@ -37,13 +38,11 @@ func (r *Response) Body() []byte {
return r.body
}
-// SetBody method is to set Response body in byte slice. Typically,
-// its helpful for test cases.
+// SetBody method sets [Response] body in byte slice. Typically,
+// It is helpful for test cases.
//
// resp.SetBody([]byte("This is test body content"))
// resp.SetBody(nil)
-//
-// Since v2.10.0
func (r *Response) SetBody(b []byte) *Response {
r.body = b
return r
@@ -78,11 +77,15 @@ func (r *Response) Proto() string {
}
// Result method returns the response value as an object if it has one
+//
+// See [Request.SetResult]
func (r *Response) Result() interface{} {
return r.Request.Result
}
// Error method returns the error object if it has one
+//
+// See [Request.SetError], [Client.SetError]
func (r *Response) Error() interface{} {
return r.Request.Error
}
@@ -95,7 +98,7 @@ func (r *Response) Header() http.Header {
return r.RawResponse.Header
}
-// Cookies method to access all the response cookies
+// Cookies method to returns all the response cookies
func (r *Response) Cookies() []*http.Cookie {
if r.RawResponse == nil {
return make([]*http.Cookie, 0)
@@ -103,7 +106,8 @@ func (r *Response) Cookies() []*http.Cookie {
return r.RawResponse.Cookies()
}
-// String method returns the body of the server response as String.
+// String method returns the body of the HTTP response as a `string`.
+// It returns an empty string if it is nil or the body is zero length.
func (r *Response) String() string {
if len(r.body) == 0 {
return ""
@@ -111,10 +115,11 @@ func (r *Response) String() string {
return strings.TrimSpace(string(r.body))
}
-// Time method returns the time of HTTP response time that from request we sent and received a request.
+// Time method returns the duration of HTTP response time from the request we sent
+// and received a request.
//
-// See `Response.ReceivedAt` to know when client received response and see `Response.Request.Time` to know
-// when client sent a request.
+// See [Response.ReceivedAt] to know when the client received a response and see
+// `Response.Request.Time` to know when the client sent a request.
func (r *Response) Time() time.Duration {
if r.Request.clientTrace != nil {
return r.Request.TraceInfo().TotalTime
@@ -122,23 +127,25 @@ func (r *Response) Time() time.Duration {
return r.receivedAt.Sub(r.Request.Time)
}
-// ReceivedAt method returns when response got received from server for the request.
+// ReceivedAt method returns the time we received a response from the server for the request.
func (r *Response) ReceivedAt() time.Time {
return r.receivedAt
}
-// Size method returns the HTTP response size in bytes. Ya, you can relay on HTTP `Content-Length` header,
-// however it won't be good for chucked transfer/compressed response. Since Resty calculates response size
-// at the client end. You will get actual size of the http response.
+// Size method returns the HTTP response size in bytes. Yeah, you can rely on HTTP `Content-Length`
+// header, however it won't be available for chucked transfer/compressed response.
+// Since Resty captures response size details when processing the response body
+// when possible. So that users get the actual size of response bytes.
func (r *Response) Size() int64 {
return r.size
}
-// RawBody method exposes the HTTP raw response body. Use this method in-conjunction with `SetDoNotParseResponse`
-// option otherwise you get an error as `read err: http: read on closed response body`.
+// RawBody method exposes the HTTP raw response body. Use this method in conjunction with
+// [Client.SetDoNotParseResponse] or [Request.SetDoNotParseResponse]
+// option; otherwise, you get an error as `read err: http: read on closed response body.`
//
// Do not forget to close the body, otherwise you might get into connection leaks, no connection reuse.
-// Basically you have taken over the control of response parsing from `Resty`.
+// You have taken over the control of response parsing from Resty.
func (r *Response) RawBody() io.ReadCloser {
if r.RawResponse == nil {
return nil
@@ -156,10 +163,6 @@ func (r *Response) IsError() bool {
return r.StatusCode() > 399
}
-//‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
-// Response Unexported methods
-//_______________________________________________________________________
-
func (r *Response) setReceivedAt() {
r.receivedAt = time.Now()
if r.Request.clientTrace != nil {
@@ -168,6 +171,9 @@ func (r *Response) setReceivedAt() {
}
func (r *Response) fmtBodyString(sl int64) string {
+ if r.Request.client.notParseResponse || r.Request.notParseResponse {
+ return "***** DO NOT PARSE RESPONSE - Enabled *****"
+ }
if len(r.body) > 0 {
if int64(len(r.body)) > sl {
return fmt.Sprintf("***** RESPONSE TOO LARGE (size - %d) *****", len(r.body))
diff --git a/vendor/github.com/go-resty/resty/v2/resty.go b/vendor/github.com/go-resty/resty/v2/resty.go
index 21dcd565..92ed4eb8 100644
--- a/vendor/github.com/go-resty/resty/v2/resty.go
+++ b/vendor/github.com/go-resty/resty/v2/resty.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2015-2023 Jeevanandam M (jeeva@myjeeva.com), All rights reserved.
+// Copyright (c) 2015-2024 Jeevanandam M (jeeva@myjeeva.com), All rights reserved.
// resty source code and usage is governed by a MIT style
// license that can be found in the LICENSE file.
@@ -14,7 +14,7 @@ import (
)
// Version # of resty
-const Version = "2.10.0"
+const Version = "2.16.2"
// New method creates a new Resty client.
func New() *Client {
@@ -24,12 +24,12 @@ func New() *Client {
})
}
-// NewWithClient method creates a new Resty client with given `http.Client`.
+// NewWithClient method creates a new Resty client with given [http.Client].
func NewWithClient(hc *http.Client) *Client {
return createClient(hc)
}
-// NewWithLocalAddr method creates a new Resty client with given Local Address
+// NewWithLocalAddr method creates a new Resty client with the given Local Address.
// to dial from.
func NewWithLocalAddr(localAddr net.Addr) *Client {
cookieJar, _ := cookiejar.New(&cookiejar.Options{PublicSuffixList: publicsuffix.List})
diff --git a/vendor/github.com/go-resty/resty/v2/retry.go b/vendor/github.com/go-resty/resty/v2/retry.go
index c5eda26b..416107e4 100644
--- a/vendor/github.com/go-resty/resty/v2/retry.go
+++ b/vendor/github.com/go-resty/resty/v2/retry.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2015-2023 Jeevanandam M (jeeva@myjeeva.com), All rights reserved.
+// Copyright (c) 2015-2024 Jeevanandam M (jeeva@myjeeva.com), All rights reserved.
// resty source code and usage is governed by a MIT style
// license that can be found in the LICENSE file.
@@ -23,7 +23,7 @@ type (
// Option is to create convenient retry options like wait time, max retries, etc.
Option func(*Options)
- // RetryConditionFunc type is for retry condition function
+ // RetryConditionFunc type is for the retry condition function
// input: non-nil Response OR request execution error
RetryConditionFunc func(*Response, error) bool
@@ -33,8 +33,8 @@ type (
// RetryAfterFunc returns time to wait before retry
// For example, it can parse HTTP Retry-After header
// https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
- // Non-nil error is returned if it is found that request is not retryable
- // (0, nil) is a special result means 'use default algorithm'
+ // Non-nil error is returned if it is found that the request is not retryable
+ // (0, nil) is a special result that means 'use default algorithm'
RetryAfterFunc func(*Client, *Response) (time.Duration, error)
// Options struct is used to hold retry settings.
@@ -69,7 +69,7 @@ func MaxWaitTime(value time.Duration) Option {
}
}
-// RetryConditions sets the conditions that will be checked for retry.
+// RetryConditions sets the conditions that will be checked for retry
func RetryConditions(conditions []RetryConditionFunc) Option {
return func(o *Options) {
o.retryConditions = conditions
@@ -84,7 +84,7 @@ func RetryHooks(hooks []OnRetryFunc) Option {
}
// ResetMultipartReaders sets a boolean value which will lead the start being seeked out
-// on all multipart file readers, if they implement io.ReadSeeker
+// on all multipart file readers if they implement [io.ReadSeeker]
func ResetMultipartReaders(value bool) Option {
return func(o *Options) {
o.resetReaders = value
@@ -202,7 +202,7 @@ func sleepDuration(resp *Response, min, max time.Duration, attempt int) (time.Du
}
// Return capped exponential backoff with jitter
-// http://www.awsarchitectureblog.com/2015/03/backoff.html
+// https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/
func jitterBackoff(min, max time.Duration, attempt int) time.Duration {
base := float64(min)
capLevel := float64(max)
diff --git a/vendor/github.com/go-resty/resty/v2/shellescape/BUILD.bazel b/vendor/github.com/go-resty/resty/v2/shellescape/BUILD.bazel
new file mode 100644
index 00000000..fe829e39
--- /dev/null
+++ b/vendor/github.com/go-resty/resty/v2/shellescape/BUILD.bazel
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+ name = "shellescape",
+ srcs = ["shellescape.go"],
+ importpath = "github.com/go-resty/resty/v2/shellescape",
+ visibility = ["//visibility:public"],
+)
+
+alias(
+ name = "go_default_library",
+ actual = ":shellescape",
+ visibility = ["//visibility:public"],
+)
diff --git a/vendor/github.com/go-resty/resty/v2/shellescape/shellescape.go b/vendor/github.com/go-resty/resty/v2/shellescape/shellescape.go
new file mode 100644
index 00000000..1e835cb3
--- /dev/null
+++ b/vendor/github.com/go-resty/resty/v2/shellescape/shellescape.go
@@ -0,0 +1,40 @@
+// Copyright (c) 2015-present Jeevanandam M (jeeva@myjeeva.com)
+// 2024 Ahuigo (https://github.com/ahuigo)
+// All rights reserved.
+// resty source code and usage is governed by a MIT style
+// license that can be found in the LICENSE file.
+
+/*
+Package shellescape provides the methods to escape arbitrary
+strings for a safe use as command line arguments in the most common
+POSIX shells.
+
+The original Python package which this work was inspired by can be found
+at https://pypi.python.org/pypi/shellescape.
+*/
+package shellescape
+
+import (
+ "regexp"
+ "strings"
+)
+
+var pattern *regexp.Regexp
+
+func init() {
+ pattern = regexp.MustCompile(`[^\w@%+=:,./-]`)
+}
+
+// Quote method returns a shell-escaped version of the string. The returned value
+// can safely be used as one token in a shell command line.
+func Quote(s string) string {
+ if len(s) == 0 {
+ return "''"
+ }
+
+ if pattern.MatchString(s) {
+ return "'" + strings.ReplaceAll(s, "'", "'\"'\"'") + "'"
+ }
+
+ return s
+}
diff --git a/vendor/github.com/go-resty/resty/v2/trace.go b/vendor/github.com/go-resty/resty/v2/trace.go
index be7555c2..226bfbff 100644
--- a/vendor/github.com/go-resty/resty/v2/trace.go
+++ b/vendor/github.com/go-resty/resty/v2/trace.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2015-2023 Jeevanandam M (jeeva@myjeeva.com), All rights reserved.
+// Copyright (c) 2015-2024 Jeevanandam M (jeeva@myjeeva.com), All rights reserved.
// resty source code and usage is governed by a MIT style
// license that can be found in the LICENSE file.
@@ -16,32 +16,30 @@ import (
// TraceInfo struct
//_______________________________________________________________________
-// TraceInfo struct is used provide request trace info such as DNS lookup
+// TraceInfo struct is used to provide request trace info such as DNS lookup
// duration, Connection obtain duration, Server processing duration, etc.
-//
-// Since v2.0.0
type TraceInfo struct {
- // DNSLookup is a duration that transport took to perform
+ // DNSLookup is the duration that transport took to perform
// DNS lookup.
DNSLookup time.Duration
- // ConnTime is a duration that took to obtain a successful connection.
+ // ConnTime is the duration it took to obtain a successful connection.
ConnTime time.Duration
- // TCPConnTime is a duration that took to obtain the TCP connection.
+ // TCPConnTime is the duration it took to obtain the TCP connection.
TCPConnTime time.Duration
- // TLSHandshake is a duration that TLS handshake took place.
+ // TLSHandshake is the duration of the TLS handshake.
TLSHandshake time.Duration
- // ServerTime is a duration that server took to respond first byte.
+ // ServerTime is the server's duration for responding to the first byte.
ServerTime time.Duration
- // ResponseTime is a duration since first response byte from server to
+ // ResponseTime is the duration since the first response byte from the server to
// request completion.
ResponseTime time.Duration
- // TotalTime is a duration that total request took end-to-end.
+ // TotalTime is the duration of the total time request taken end-to-end.
TotalTime time.Duration
// IsConnReused is whether this connection has been previously
@@ -52,7 +50,7 @@ type TraceInfo struct {
// idle pool.
IsConnWasIdle bool
- // ConnIdleTime is a duration how long the connection was previously
+ // ConnIdleTime is the duration how long the connection that was previously
// idle, if IsConnWasIdle is true.
ConnIdleTime time.Duration
@@ -68,9 +66,9 @@ type TraceInfo struct {
// ClientTrace struct and its methods
//_______________________________________________________________________
-// tracer struct maps the `httptrace.ClientTrace` hooks into Fields
-// with same naming for easy understanding. Plus additional insights
-// Request.
+// clientTrace struct maps the [httptrace.ClientTrace] hooks into Fields
+// with the same naming for easy understanding. Plus additional insights
+// [Request].
type clientTrace struct {
getConn time.Time
dnsStart time.Time
@@ -84,10 +82,6 @@ type clientTrace struct {
gotConnInfo httptrace.GotConnInfo
}
-//‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
-// Trace unexported methods
-//_______________________________________________________________________
-
func (t *clientTrace) createContext(ctx context.Context) context.Context {
return httptrace.WithClientTrace(
ctx,
diff --git a/vendor/github.com/go-resty/resty/v2/transport.go b/vendor/github.com/go-resty/resty/v2/transport.go
index 191cd519..13c3de34 100644
--- a/vendor/github.com/go-resty/resty/v2/transport.go
+++ b/vendor/github.com/go-resty/resty/v2/transport.go
@@ -1,7 +1,7 @@
//go:build go1.13
// +build go1.13
-// Copyright (c) 2015-2023 Jeevanandam M (jeeva@myjeeva.com), All rights reserved.
+// Copyright (c) 2015-2024 Jeevanandam M (jeeva@myjeeva.com), All rights reserved.
// resty source code and usage is governed by a MIT style
// license that can be found in the LICENSE file.
diff --git a/vendor/github.com/go-resty/resty/v2/transport112.go b/vendor/github.com/go-resty/resty/v2/transport112.go
index d4aa4175..beb0301a 100644
--- a/vendor/github.com/go-resty/resty/v2/transport112.go
+++ b/vendor/github.com/go-resty/resty/v2/transport112.go
@@ -1,7 +1,7 @@
//go:build !go1.13
// +build !go1.13
-// Copyright (c) 2015-2023 Jeevanandam M (jeeva@myjeeva.com), All rights reserved.
+// Copyright (c) 2015-2024 Jeevanandam M (jeeva@myjeeva.com), All rights reserved.
// resty source code and usage is governed by a MIT style
// license that can be found in the LICENSE file.
diff --git a/vendor/github.com/go-resty/resty/v2/util.go b/vendor/github.com/go-resty/resty/v2/util.go
index 27b466dc..0ac470e4 100644
--- a/vendor/github.com/go-resty/resty/v2/util.go
+++ b/vendor/github.com/go-resty/resty/v2/util.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2015-2023 Jeevanandam M (jeeva@myjeeva.com), All rights reserved.
+// Copyright (c) 2015-2024 Jeevanandam M (jeeva@myjeeva.com), All rights reserved.
// resty source code and usage is governed by a MIT style
// license that can be found in the LICENSE file.
@@ -19,7 +19,6 @@ import (
"runtime"
"sort"
"strings"
- "sync"
)
//‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
@@ -145,10 +144,6 @@ type ResponseLog struct {
Body string
}
-//‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
-// Package Unexported methods
-//_______________________________________________________________________
-
// way to disable the HTML escape as opt-in
func jsonMarshal(c *Client, r *Request, d interface{}) (*bytes.Buffer, error) {
if !r.jsonEscapeHTML || !c.jsonEscapeHTML {
@@ -216,7 +211,7 @@ func writeMultipartFormFile(w *multipart.Writer, fieldName, fileName string, r i
return err
}
- partWriter, err := w.CreatePart(createMultipartHeader(fieldName, fileName, http.DetectContentType(cbuf)))
+ partWriter, err := w.CreatePart(createMultipartHeader(fieldName, fileName, http.DetectContentType(cbuf[:size])))
if err != nil {
return err
}
@@ -290,7 +285,13 @@ func functionName(i interface{}) string {
}
func acquireBuffer() *bytes.Buffer {
- return bufPool.Get().(*bytes.Buffer)
+ buf := bufPool.Get().(*bytes.Buffer)
+ if buf.Len() == 0 {
+ buf.Reset()
+ return buf
+ }
+ bufPool.Put(buf)
+ return new(bytes.Buffer)
}
func releaseBuffer(buf *bytes.Buffer) {
@@ -300,34 +301,12 @@ func releaseBuffer(buf *bytes.Buffer) {
}
}
-// requestBodyReleaser wraps requests's body and implements custom Close for it.
-// The Close method closes original body and releases request body back to sync.Pool.
-type requestBodyReleaser struct {
- releaseOnce sync.Once
- reqBuf *bytes.Buffer
- io.ReadCloser
-}
-
-func newRequestBodyReleaser(respBody io.ReadCloser, reqBuf *bytes.Buffer) io.ReadCloser {
- if reqBuf == nil {
- return respBody
- }
-
- return &requestBodyReleaser{
- reqBuf: reqBuf,
- ReadCloser: respBody,
+func backToBufPool(buf *bytes.Buffer) {
+ if buf != nil {
+ bufPool.Put(buf)
}
}
-func (rr *requestBodyReleaser) Close() error {
- err := rr.ReadCloser.Close()
- rr.releaseOnce.Do(func() {
- releaseBuffer(rr.reqBuf)
- })
-
- return err
-}
-
func closeq(v interface{}) {
if c, ok := v.(io.Closer); ok {
silently(c.Close())
@@ -361,6 +340,32 @@ func copyHeaders(hdrs http.Header) http.Header {
return nh
}
+func wrapErrors(n error, inner error) error {
+ if inner == nil {
+ return n
+ }
+ if n == nil {
+ return inner
+ }
+ return &restyError{
+ err: n,
+ inner: inner,
+ }
+}
+
+type restyError struct {
+ err error
+ inner error
+}
+
+func (e *restyError) Error() string {
+ return e.err.Error()
+}
+
+func (e *restyError) Unwrap() error {
+ return e.inner
+}
+
type noRetryErr struct {
err error
}
diff --git a/vendor/github.com/go-resty/resty/v2/util_curl.go b/vendor/github.com/go-resty/resty/v2/util_curl.go
new file mode 100644
index 00000000..073d0492
--- /dev/null
+++ b/vendor/github.com/go-resty/resty/v2/util_curl.go
@@ -0,0 +1,78 @@
+package resty
+
+import (
+ "bytes"
+ "io"
+ "net/http"
+ "net/http/cookiejar"
+
+ "net/url"
+ "strings"
+
+ "github.com/go-resty/resty/v2/shellescape"
+)
+
+func buildCurlRequest(req *http.Request, httpCookiejar http.CookieJar) (curl string) {
+ // 1. Generate curl raw headers
+
+ curl = "curl -X " + req.Method + " "
+ // req.Host + req.URL.Path + "?" + req.URL.RawQuery + " " + req.Proto + " "
+ headers := dumpCurlHeaders(req)
+ for _, kv := range *headers {
+ curl += `-H ` + shellescape.Quote(kv[0]+": "+kv[1]) + ` `
+ }
+
+ // 2. Generate curl cookies
+ // TODO validate this block of code, I think its not required since cookie captured via Headers
+ if cookieJar, ok := httpCookiejar.(*cookiejar.Jar); ok {
+ cookies := cookieJar.Cookies(req.URL)
+ if len(cookies) > 0 {
+ curl += `-H ` + shellescape.Quote(dumpCurlCookies(cookies)) + " "
+ }
+ }
+
+ // 3. Generate curl body
+ if req.Body != nil {
+ buf, _ := io.ReadAll(req.Body)
+ req.Body = io.NopCloser(bytes.NewBuffer(buf)) // important!!
+ curl += `-d ` + shellescape.Quote(string(buf)) + " "
+ }
+
+ urlString := shellescape.Quote(req.URL.String())
+ if urlString == "''" {
+ urlString = "'http://unexecuted-request'"
+ }
+ curl += urlString
+ return curl
+}
+
+// dumpCurlCookies dumps cookies to curl format
+func dumpCurlCookies(cookies []*http.Cookie) string {
+ sb := strings.Builder{}
+ sb.WriteString("Cookie: ")
+ for _, cookie := range cookies {
+ sb.WriteString(cookie.Name + "=" + url.QueryEscape(cookie.Value) + "&")
+ }
+ return strings.TrimRight(sb.String(), "&")
+}
+
+// dumpCurlHeaders dumps headers to curl format
+func dumpCurlHeaders(req *http.Request) *[][2]string {
+ headers := [][2]string{}
+ for k, vs := range req.Header {
+ for _, v := range vs {
+ headers = append(headers, [2]string{k, v})
+ }
+ }
+ n := len(headers)
+ for i := 0; i < n; i++ {
+ for j := n - 1; j > i; j-- {
+ jj := j - 1
+ h1, h2 := headers[j], headers[jj]
+ if h1[0] < h2[0] {
+ headers[jj], headers[j] = headers[j], headers[jj]
+ }
+ }
+ }
+ return &headers
+}
diff --git a/vendor/github.com/golang-jwt/jwt/v5/ecdsa.go b/vendor/github.com/golang-jwt/jwt/v5/ecdsa.go
index ca85659b..c929e4a0 100644
--- a/vendor/github.com/golang-jwt/jwt/v5/ecdsa.go
+++ b/vendor/github.com/golang-jwt/jwt/v5/ecdsa.go
@@ -62,7 +62,7 @@ func (m *SigningMethodECDSA) Verify(signingString string, sig []byte, key interf
case *ecdsa.PublicKey:
ecdsaKey = k
default:
- return newError("ECDSA verify expects *ecsda.PublicKey", ErrInvalidKeyType)
+ return newError("ECDSA verify expects *ecdsa.PublicKey", ErrInvalidKeyType)
}
if len(sig) != 2*m.KeySize {
@@ -96,7 +96,7 @@ func (m *SigningMethodECDSA) Sign(signingString string, key interface{}) ([]byte
case *ecdsa.PrivateKey:
ecdsaKey = k
default:
- return nil, newError("ECDSA sign expects *ecsda.PrivateKey", ErrInvalidKeyType)
+ return nil, newError("ECDSA sign expects *ecdsa.PrivateKey", ErrInvalidKeyType)
}
// Create the hasher
diff --git a/vendor/github.com/golang-jwt/jwt/v5/hmac.go b/vendor/github.com/golang-jwt/jwt/v5/hmac.go
index 96c62722..aca600ce 100644
--- a/vendor/github.com/golang-jwt/jwt/v5/hmac.go
+++ b/vendor/github.com/golang-jwt/jwt/v5/hmac.go
@@ -91,7 +91,7 @@ func (m *SigningMethodHMAC) Verify(signingString string, sig []byte, key interfa
func (m *SigningMethodHMAC) Sign(signingString string, key interface{}) ([]byte, error) {
if keyBytes, ok := key.([]byte); ok {
if !m.Hash.Available() {
- return nil, newError("HMAC sign expects []byte", ErrInvalidKeyType)
+ return nil, ErrHashUnavailable
}
hasher := hmac.New(m.Hash.New, keyBytes)
@@ -100,5 +100,5 @@ func (m *SigningMethodHMAC) Sign(signingString string, key interface{}) ([]byte,
return hasher.Sum(nil), nil
}
- return nil, ErrInvalidKeyType
+ return nil, newError("HMAC sign expects []byte", ErrInvalidKeyType)
}
diff --git a/vendor/github.com/golang/protobuf/jsonpb/decode.go b/vendor/github.com/golang/protobuf/jsonpb/decode.go
deleted file mode 100644
index 6c16c255..00000000
--- a/vendor/github.com/golang/protobuf/jsonpb/decode.go
+++ /dev/null
@@ -1,530 +0,0 @@
-// Copyright 2015 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package jsonpb
-
-import (
- "encoding/json"
- "errors"
- "fmt"
- "io"
- "math"
- "reflect"
- "strconv"
- "strings"
- "time"
-
- "github.com/golang/protobuf/proto"
- "google.golang.org/protobuf/encoding/protojson"
- protoV2 "google.golang.org/protobuf/proto"
- "google.golang.org/protobuf/reflect/protoreflect"
- "google.golang.org/protobuf/reflect/protoregistry"
-)
-
-const wrapJSONUnmarshalV2 = false
-
-// UnmarshalNext unmarshals the next JSON object from d into m.
-func UnmarshalNext(d *json.Decoder, m proto.Message) error {
- return new(Unmarshaler).UnmarshalNext(d, m)
-}
-
-// Unmarshal unmarshals a JSON object from r into m.
-func Unmarshal(r io.Reader, m proto.Message) error {
- return new(Unmarshaler).Unmarshal(r, m)
-}
-
-// UnmarshalString unmarshals a JSON object from s into m.
-func UnmarshalString(s string, m proto.Message) error {
- return new(Unmarshaler).Unmarshal(strings.NewReader(s), m)
-}
-
-// Unmarshaler is a configurable object for converting from a JSON
-// representation to a protocol buffer object.
-type Unmarshaler struct {
- // AllowUnknownFields specifies whether to allow messages to contain
- // unknown JSON fields, as opposed to failing to unmarshal.
- AllowUnknownFields bool
-
- // AnyResolver is used to resolve the google.protobuf.Any well-known type.
- // If unset, the global registry is used by default.
- AnyResolver AnyResolver
-}
-
-// JSONPBUnmarshaler is implemented by protobuf messages that customize the way
-// they are unmarshaled from JSON. Messages that implement this should also
-// implement JSONPBMarshaler so that the custom format can be produced.
-//
-// The JSON unmarshaling must follow the JSON to proto specification:
-// https://developers.google.com/protocol-buffers/docs/proto3#json
-//
-// Deprecated: Custom types should implement protobuf reflection instead.
-type JSONPBUnmarshaler interface {
- UnmarshalJSONPB(*Unmarshaler, []byte) error
-}
-
-// Unmarshal unmarshals a JSON object from r into m.
-func (u *Unmarshaler) Unmarshal(r io.Reader, m proto.Message) error {
- return u.UnmarshalNext(json.NewDecoder(r), m)
-}
-
-// UnmarshalNext unmarshals the next JSON object from d into m.
-func (u *Unmarshaler) UnmarshalNext(d *json.Decoder, m proto.Message) error {
- if m == nil {
- return errors.New("invalid nil message")
- }
-
- // Parse the next JSON object from the stream.
- raw := json.RawMessage{}
- if err := d.Decode(&raw); err != nil {
- return err
- }
-
- // Check for custom unmarshalers first since they may not properly
- // implement protobuf reflection that the logic below relies on.
- if jsu, ok := m.(JSONPBUnmarshaler); ok {
- return jsu.UnmarshalJSONPB(u, raw)
- }
-
- mr := proto.MessageReflect(m)
-
- // NOTE: For historical reasons, a top-level null is treated as a noop.
- // This is incorrect, but kept for compatibility.
- if string(raw) == "null" && mr.Descriptor().FullName() != "google.protobuf.Value" {
- return nil
- }
-
- if wrapJSONUnmarshalV2 {
- // NOTE: If input message is non-empty, we need to preserve merge semantics
- // of the old jsonpb implementation. These semantics are not supported by
- // the protobuf JSON specification.
- isEmpty := true
- mr.Range(func(protoreflect.FieldDescriptor, protoreflect.Value) bool {
- isEmpty = false // at least one iteration implies non-empty
- return false
- })
- if !isEmpty {
- // Perform unmarshaling into a newly allocated, empty message.
- mr = mr.New()
-
- // Use a defer to copy all unmarshaled fields into the original message.
- dst := proto.MessageReflect(m)
- defer mr.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool {
- dst.Set(fd, v)
- return true
- })
- }
-
- // Unmarshal using the v2 JSON unmarshaler.
- opts := protojson.UnmarshalOptions{
- DiscardUnknown: u.AllowUnknownFields,
- }
- if u.AnyResolver != nil {
- opts.Resolver = anyResolver{u.AnyResolver}
- }
- return opts.Unmarshal(raw, mr.Interface())
- } else {
- if err := u.unmarshalMessage(mr, raw); err != nil {
- return err
- }
- return protoV2.CheckInitialized(mr.Interface())
- }
-}
-
-func (u *Unmarshaler) unmarshalMessage(m protoreflect.Message, in []byte) error {
- md := m.Descriptor()
- fds := md.Fields()
-
- if jsu, ok := proto.MessageV1(m.Interface()).(JSONPBUnmarshaler); ok {
- return jsu.UnmarshalJSONPB(u, in)
- }
-
- if string(in) == "null" && md.FullName() != "google.protobuf.Value" {
- return nil
- }
-
- switch wellKnownType(md.FullName()) {
- case "Any":
- var jsonObject map[string]json.RawMessage
- if err := json.Unmarshal(in, &jsonObject); err != nil {
- return err
- }
-
- rawTypeURL, ok := jsonObject["@type"]
- if !ok {
- return errors.New("Any JSON doesn't have '@type'")
- }
- typeURL, err := unquoteString(string(rawTypeURL))
- if err != nil {
- return fmt.Errorf("can't unmarshal Any's '@type': %q", rawTypeURL)
- }
- m.Set(fds.ByNumber(1), protoreflect.ValueOfString(typeURL))
-
- var m2 protoreflect.Message
- if u.AnyResolver != nil {
- mi, err := u.AnyResolver.Resolve(typeURL)
- if err != nil {
- return err
- }
- m2 = proto.MessageReflect(mi)
- } else {
- mt, err := protoregistry.GlobalTypes.FindMessageByURL(typeURL)
- if err != nil {
- if err == protoregistry.NotFound {
- return fmt.Errorf("could not resolve Any message type: %v", typeURL)
- }
- return err
- }
- m2 = mt.New()
- }
-
- if wellKnownType(m2.Descriptor().FullName()) != "" {
- rawValue, ok := jsonObject["value"]
- if !ok {
- return errors.New("Any JSON doesn't have 'value'")
- }
- if err := u.unmarshalMessage(m2, rawValue); err != nil {
- return fmt.Errorf("can't unmarshal Any nested proto %v: %v", typeURL, err)
- }
- } else {
- delete(jsonObject, "@type")
- rawJSON, err := json.Marshal(jsonObject)
- if err != nil {
- return fmt.Errorf("can't generate JSON for Any's nested proto to be unmarshaled: %v", err)
- }
- if err = u.unmarshalMessage(m2, rawJSON); err != nil {
- return fmt.Errorf("can't unmarshal Any nested proto %v: %v", typeURL, err)
- }
- }
-
- rawWire, err := protoV2.Marshal(m2.Interface())
- if err != nil {
- return fmt.Errorf("can't marshal proto %v into Any.Value: %v", typeURL, err)
- }
- m.Set(fds.ByNumber(2), protoreflect.ValueOfBytes(rawWire))
- return nil
- case "BoolValue", "BytesValue", "StringValue",
- "Int32Value", "UInt32Value", "FloatValue",
- "Int64Value", "UInt64Value", "DoubleValue":
- fd := fds.ByNumber(1)
- v, err := u.unmarshalValue(m.NewField(fd), in, fd)
- if err != nil {
- return err
- }
- m.Set(fd, v)
- return nil
- case "Duration":
- v, err := unquoteString(string(in))
- if err != nil {
- return err
- }
- d, err := time.ParseDuration(v)
- if err != nil {
- return fmt.Errorf("bad Duration: %v", err)
- }
-
- sec := d.Nanoseconds() / 1e9
- nsec := d.Nanoseconds() % 1e9
- m.Set(fds.ByNumber(1), protoreflect.ValueOfInt64(int64(sec)))
- m.Set(fds.ByNumber(2), protoreflect.ValueOfInt32(int32(nsec)))
- return nil
- case "Timestamp":
- v, err := unquoteString(string(in))
- if err != nil {
- return err
- }
- t, err := time.Parse(time.RFC3339Nano, v)
- if err != nil {
- return fmt.Errorf("bad Timestamp: %v", err)
- }
-
- sec := t.Unix()
- nsec := t.Nanosecond()
- m.Set(fds.ByNumber(1), protoreflect.ValueOfInt64(int64(sec)))
- m.Set(fds.ByNumber(2), protoreflect.ValueOfInt32(int32(nsec)))
- return nil
- case "Value":
- switch {
- case string(in) == "null":
- m.Set(fds.ByNumber(1), protoreflect.ValueOfEnum(0))
- case string(in) == "true":
- m.Set(fds.ByNumber(4), protoreflect.ValueOfBool(true))
- case string(in) == "false":
- m.Set(fds.ByNumber(4), protoreflect.ValueOfBool(false))
- case hasPrefixAndSuffix('"', in, '"'):
- s, err := unquoteString(string(in))
- if err != nil {
- return fmt.Errorf("unrecognized type for Value %q", in)
- }
- m.Set(fds.ByNumber(3), protoreflect.ValueOfString(s))
- case hasPrefixAndSuffix('[', in, ']'):
- v := m.Mutable(fds.ByNumber(6))
- return u.unmarshalMessage(v.Message(), in)
- case hasPrefixAndSuffix('{', in, '}'):
- v := m.Mutable(fds.ByNumber(5))
- return u.unmarshalMessage(v.Message(), in)
- default:
- f, err := strconv.ParseFloat(string(in), 0)
- if err != nil {
- return fmt.Errorf("unrecognized type for Value %q", in)
- }
- m.Set(fds.ByNumber(2), protoreflect.ValueOfFloat64(f))
- }
- return nil
- case "ListValue":
- var jsonArray []json.RawMessage
- if err := json.Unmarshal(in, &jsonArray); err != nil {
- return fmt.Errorf("bad ListValue: %v", err)
- }
-
- lv := m.Mutable(fds.ByNumber(1)).List()
- for _, raw := range jsonArray {
- ve := lv.NewElement()
- if err := u.unmarshalMessage(ve.Message(), raw); err != nil {
- return err
- }
- lv.Append(ve)
- }
- return nil
- case "Struct":
- var jsonObject map[string]json.RawMessage
- if err := json.Unmarshal(in, &jsonObject); err != nil {
- return fmt.Errorf("bad StructValue: %v", err)
- }
-
- mv := m.Mutable(fds.ByNumber(1)).Map()
- for key, raw := range jsonObject {
- kv := protoreflect.ValueOf(key).MapKey()
- vv := mv.NewValue()
- if err := u.unmarshalMessage(vv.Message(), raw); err != nil {
- return fmt.Errorf("bad value in StructValue for key %q: %v", key, err)
- }
- mv.Set(kv, vv)
- }
- return nil
- }
-
- var jsonObject map[string]json.RawMessage
- if err := json.Unmarshal(in, &jsonObject); err != nil {
- return err
- }
-
- // Handle known fields.
- for i := 0; i < fds.Len(); i++ {
- fd := fds.Get(i)
- if fd.IsWeak() && fd.Message().IsPlaceholder() {
- continue // weak reference is not linked in
- }
-
- // Search for any raw JSON value associated with this field.
- var raw json.RawMessage
- name := string(fd.Name())
- if fd.Kind() == protoreflect.GroupKind {
- name = string(fd.Message().Name())
- }
- if v, ok := jsonObject[name]; ok {
- delete(jsonObject, name)
- raw = v
- }
- name = string(fd.JSONName())
- if v, ok := jsonObject[name]; ok {
- delete(jsonObject, name)
- raw = v
- }
-
- field := m.NewField(fd)
- // Unmarshal the field value.
- if raw == nil || (string(raw) == "null" && !isSingularWellKnownValue(fd) && !isSingularJSONPBUnmarshaler(field, fd)) {
- continue
- }
- v, err := u.unmarshalValue(field, raw, fd)
- if err != nil {
- return err
- }
- m.Set(fd, v)
- }
-
- // Handle extension fields.
- for name, raw := range jsonObject {
- if !strings.HasPrefix(name, "[") || !strings.HasSuffix(name, "]") {
- continue
- }
-
- // Resolve the extension field by name.
- xname := protoreflect.FullName(name[len("[") : len(name)-len("]")])
- xt, _ := protoregistry.GlobalTypes.FindExtensionByName(xname)
- if xt == nil && isMessageSet(md) {
- xt, _ = protoregistry.GlobalTypes.FindExtensionByName(xname.Append("message_set_extension"))
- }
- if xt == nil {
- continue
- }
- delete(jsonObject, name)
- fd := xt.TypeDescriptor()
- if fd.ContainingMessage().FullName() != m.Descriptor().FullName() {
- return fmt.Errorf("extension field %q does not extend message %q", xname, m.Descriptor().FullName())
- }
-
- field := m.NewField(fd)
- // Unmarshal the field value.
- if raw == nil || (string(raw) == "null" && !isSingularWellKnownValue(fd) && !isSingularJSONPBUnmarshaler(field, fd)) {
- continue
- }
- v, err := u.unmarshalValue(field, raw, fd)
- if err != nil {
- return err
- }
- m.Set(fd, v)
- }
-
- if !u.AllowUnknownFields && len(jsonObject) > 0 {
- for name := range jsonObject {
- return fmt.Errorf("unknown field %q in %v", name, md.FullName())
- }
- }
- return nil
-}
-
-func isSingularWellKnownValue(fd protoreflect.FieldDescriptor) bool {
- if fd.Cardinality() == protoreflect.Repeated {
- return false
- }
- if md := fd.Message(); md != nil {
- return md.FullName() == "google.protobuf.Value"
- }
- if ed := fd.Enum(); ed != nil {
- return ed.FullName() == "google.protobuf.NullValue"
- }
- return false
-}
-
-func isSingularJSONPBUnmarshaler(v protoreflect.Value, fd protoreflect.FieldDescriptor) bool {
- if fd.Message() != nil && fd.Cardinality() != protoreflect.Repeated {
- _, ok := proto.MessageV1(v.Interface()).(JSONPBUnmarshaler)
- return ok
- }
- return false
-}
-
-func (u *Unmarshaler) unmarshalValue(v protoreflect.Value, in []byte, fd protoreflect.FieldDescriptor) (protoreflect.Value, error) {
- switch {
- case fd.IsList():
- var jsonArray []json.RawMessage
- if err := json.Unmarshal(in, &jsonArray); err != nil {
- return v, err
- }
- lv := v.List()
- for _, raw := range jsonArray {
- ve, err := u.unmarshalSingularValue(lv.NewElement(), raw, fd)
- if err != nil {
- return v, err
- }
- lv.Append(ve)
- }
- return v, nil
- case fd.IsMap():
- var jsonObject map[string]json.RawMessage
- if err := json.Unmarshal(in, &jsonObject); err != nil {
- return v, err
- }
- kfd := fd.MapKey()
- vfd := fd.MapValue()
- mv := v.Map()
- for key, raw := range jsonObject {
- var kv protoreflect.MapKey
- if kfd.Kind() == protoreflect.StringKind {
- kv = protoreflect.ValueOf(key).MapKey()
- } else {
- v, err := u.unmarshalSingularValue(kfd.Default(), []byte(key), kfd)
- if err != nil {
- return v, err
- }
- kv = v.MapKey()
- }
-
- vv, err := u.unmarshalSingularValue(mv.NewValue(), raw, vfd)
- if err != nil {
- return v, err
- }
- mv.Set(kv, vv)
- }
- return v, nil
- default:
- return u.unmarshalSingularValue(v, in, fd)
- }
-}
-
-var nonFinite = map[string]float64{
- `"NaN"`: math.NaN(),
- `"Infinity"`: math.Inf(+1),
- `"-Infinity"`: math.Inf(-1),
-}
-
-func (u *Unmarshaler) unmarshalSingularValue(v protoreflect.Value, in []byte, fd protoreflect.FieldDescriptor) (protoreflect.Value, error) {
- switch fd.Kind() {
- case protoreflect.BoolKind:
- return unmarshalValue(in, new(bool))
- case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind:
- return unmarshalValue(trimQuote(in), new(int32))
- case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind:
- return unmarshalValue(trimQuote(in), new(int64))
- case protoreflect.Uint32Kind, protoreflect.Fixed32Kind:
- return unmarshalValue(trimQuote(in), new(uint32))
- case protoreflect.Uint64Kind, protoreflect.Fixed64Kind:
- return unmarshalValue(trimQuote(in), new(uint64))
- case protoreflect.FloatKind:
- if f, ok := nonFinite[string(in)]; ok {
- return protoreflect.ValueOfFloat32(float32(f)), nil
- }
- return unmarshalValue(trimQuote(in), new(float32))
- case protoreflect.DoubleKind:
- if f, ok := nonFinite[string(in)]; ok {
- return protoreflect.ValueOfFloat64(float64(f)), nil
- }
- return unmarshalValue(trimQuote(in), new(float64))
- case protoreflect.StringKind:
- return unmarshalValue(in, new(string))
- case protoreflect.BytesKind:
- return unmarshalValue(in, new([]byte))
- case protoreflect.EnumKind:
- if hasPrefixAndSuffix('"', in, '"') {
- vd := fd.Enum().Values().ByName(protoreflect.Name(trimQuote(in)))
- if vd == nil {
- return v, fmt.Errorf("unknown value %q for enum %s", in, fd.Enum().FullName())
- }
- return protoreflect.ValueOfEnum(vd.Number()), nil
- }
- return unmarshalValue(in, new(protoreflect.EnumNumber))
- case protoreflect.MessageKind, protoreflect.GroupKind:
- err := u.unmarshalMessage(v.Message(), in)
- return v, err
- default:
- panic(fmt.Sprintf("invalid kind %v", fd.Kind()))
- }
-}
-
-func unmarshalValue(in []byte, v interface{}) (protoreflect.Value, error) {
- err := json.Unmarshal(in, v)
- return protoreflect.ValueOf(reflect.ValueOf(v).Elem().Interface()), err
-}
-
-func unquoteString(in string) (out string, err error) {
- err = json.Unmarshal([]byte(in), &out)
- return out, err
-}
-
-func hasPrefixAndSuffix(prefix byte, in []byte, suffix byte) bool {
- if len(in) >= 2 && in[0] == prefix && in[len(in)-1] == suffix {
- return true
- }
- return false
-}
-
-// trimQuote is like unquoteString but simply strips surrounding quotes.
-// This is incorrect, but is behavior done by the legacy implementation.
-func trimQuote(in []byte) []byte {
- if len(in) >= 2 && in[0] == '"' && in[len(in)-1] == '"' {
- in = in[1 : len(in)-1]
- }
- return in
-}
diff --git a/vendor/github.com/golang/protobuf/jsonpb/encode.go b/vendor/github.com/golang/protobuf/jsonpb/encode.go
deleted file mode 100644
index 685c80a6..00000000
--- a/vendor/github.com/golang/protobuf/jsonpb/encode.go
+++ /dev/null
@@ -1,559 +0,0 @@
-// Copyright 2015 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package jsonpb
-
-import (
- "encoding/json"
- "errors"
- "fmt"
- "io"
- "math"
- "reflect"
- "sort"
- "strconv"
- "strings"
- "time"
-
- "github.com/golang/protobuf/proto"
- "google.golang.org/protobuf/encoding/protojson"
- protoV2 "google.golang.org/protobuf/proto"
- "google.golang.org/protobuf/reflect/protoreflect"
- "google.golang.org/protobuf/reflect/protoregistry"
-)
-
-const wrapJSONMarshalV2 = false
-
-// Marshaler is a configurable object for marshaling protocol buffer messages
-// to the specified JSON representation.
-type Marshaler struct {
- // OrigName specifies whether to use the original protobuf name for fields.
- OrigName bool
-
- // EnumsAsInts specifies whether to render enum values as integers,
- // as opposed to string values.
- EnumsAsInts bool
-
- // EmitDefaults specifies whether to render fields with zero values.
- EmitDefaults bool
-
- // Indent controls whether the output is compact or not.
- // If empty, the output is compact JSON. Otherwise, every JSON object
- // entry and JSON array value will be on its own line.
- // Each line will be preceded by repeated copies of Indent, where the
- // number of copies is the current indentation depth.
- Indent string
-
- // AnyResolver is used to resolve the google.protobuf.Any well-known type.
- // If unset, the global registry is used by default.
- AnyResolver AnyResolver
-}
-
-// JSONPBMarshaler is implemented by protobuf messages that customize the
-// way they are marshaled to JSON. Messages that implement this should also
-// implement JSONPBUnmarshaler so that the custom format can be parsed.
-//
-// The JSON marshaling must follow the proto to JSON specification:
-// https://developers.google.com/protocol-buffers/docs/proto3#json
-//
-// Deprecated: Custom types should implement protobuf reflection instead.
-type JSONPBMarshaler interface {
- MarshalJSONPB(*Marshaler) ([]byte, error)
-}
-
-// Marshal serializes a protobuf message as JSON into w.
-func (jm *Marshaler) Marshal(w io.Writer, m proto.Message) error {
- b, err := jm.marshal(m)
- if len(b) > 0 {
- if _, err := w.Write(b); err != nil {
- return err
- }
- }
- return err
-}
-
-// MarshalToString serializes a protobuf message as JSON in string form.
-func (jm *Marshaler) MarshalToString(m proto.Message) (string, error) {
- b, err := jm.marshal(m)
- if err != nil {
- return "", err
- }
- return string(b), nil
-}
-
-func (jm *Marshaler) marshal(m proto.Message) ([]byte, error) {
- v := reflect.ValueOf(m)
- if m == nil || (v.Kind() == reflect.Ptr && v.IsNil()) {
- return nil, errors.New("Marshal called with nil")
- }
-
- // Check for custom marshalers first since they may not properly
- // implement protobuf reflection that the logic below relies on.
- if jsm, ok := m.(JSONPBMarshaler); ok {
- return jsm.MarshalJSONPB(jm)
- }
-
- if wrapJSONMarshalV2 {
- opts := protojson.MarshalOptions{
- UseProtoNames: jm.OrigName,
- UseEnumNumbers: jm.EnumsAsInts,
- EmitUnpopulated: jm.EmitDefaults,
- Indent: jm.Indent,
- }
- if jm.AnyResolver != nil {
- opts.Resolver = anyResolver{jm.AnyResolver}
- }
- return opts.Marshal(proto.MessageReflect(m).Interface())
- } else {
- // Check for unpopulated required fields first.
- m2 := proto.MessageReflect(m)
- if err := protoV2.CheckInitialized(m2.Interface()); err != nil {
- return nil, err
- }
-
- w := jsonWriter{Marshaler: jm}
- err := w.marshalMessage(m2, "", "")
- return w.buf, err
- }
-}
-
-type jsonWriter struct {
- *Marshaler
- buf []byte
-}
-
-func (w *jsonWriter) write(s string) {
- w.buf = append(w.buf, s...)
-}
-
-func (w *jsonWriter) marshalMessage(m protoreflect.Message, indent, typeURL string) error {
- if jsm, ok := proto.MessageV1(m.Interface()).(JSONPBMarshaler); ok {
- b, err := jsm.MarshalJSONPB(w.Marshaler)
- if err != nil {
- return err
- }
- if typeURL != "" {
- // we are marshaling this object to an Any type
- var js map[string]*json.RawMessage
- if err = json.Unmarshal(b, &js); err != nil {
- return fmt.Errorf("type %T produced invalid JSON: %v", m.Interface(), err)
- }
- turl, err := json.Marshal(typeURL)
- if err != nil {
- return fmt.Errorf("failed to marshal type URL %q to JSON: %v", typeURL, err)
- }
- js["@type"] = (*json.RawMessage)(&turl)
- if b, err = json.Marshal(js); err != nil {
- return err
- }
- }
- w.write(string(b))
- return nil
- }
-
- md := m.Descriptor()
- fds := md.Fields()
-
- // Handle well-known types.
- const secondInNanos = int64(time.Second / time.Nanosecond)
- switch wellKnownType(md.FullName()) {
- case "Any":
- return w.marshalAny(m, indent)
- case "BoolValue", "BytesValue", "StringValue",
- "Int32Value", "UInt32Value", "FloatValue",
- "Int64Value", "UInt64Value", "DoubleValue":
- fd := fds.ByNumber(1)
- return w.marshalValue(fd, m.Get(fd), indent)
- case "Duration":
- const maxSecondsInDuration = 315576000000
- // "Generated output always contains 0, 3, 6, or 9 fractional digits,
- // depending on required precision."
- s := m.Get(fds.ByNumber(1)).Int()
- ns := m.Get(fds.ByNumber(2)).Int()
- if s < -maxSecondsInDuration || s > maxSecondsInDuration {
- return fmt.Errorf("seconds out of range %v", s)
- }
- if ns <= -secondInNanos || ns >= secondInNanos {
- return fmt.Errorf("ns out of range (%v, %v)", -secondInNanos, secondInNanos)
- }
- if (s > 0 && ns < 0) || (s < 0 && ns > 0) {
- return errors.New("signs of seconds and nanos do not match")
- }
- var sign string
- if s < 0 || ns < 0 {
- sign, s, ns = "-", -1*s, -1*ns
- }
- x := fmt.Sprintf("%s%d.%09d", sign, s, ns)
- x = strings.TrimSuffix(x, "000")
- x = strings.TrimSuffix(x, "000")
- x = strings.TrimSuffix(x, ".000")
- w.write(fmt.Sprintf(`"%vs"`, x))
- return nil
- case "Timestamp":
- // "RFC 3339, where generated output will always be Z-normalized
- // and uses 0, 3, 6 or 9 fractional digits."
- s := m.Get(fds.ByNumber(1)).Int()
- ns := m.Get(fds.ByNumber(2)).Int()
- if ns < 0 || ns >= secondInNanos {
- return fmt.Errorf("ns out of range [0, %v)", secondInNanos)
- }
- t := time.Unix(s, ns).UTC()
- // time.RFC3339Nano isn't exactly right (we need to get 3/6/9 fractional digits).
- x := t.Format("2006-01-02T15:04:05.000000000")
- x = strings.TrimSuffix(x, "000")
- x = strings.TrimSuffix(x, "000")
- x = strings.TrimSuffix(x, ".000")
- w.write(fmt.Sprintf(`"%vZ"`, x))
- return nil
- case "Value":
- // JSON value; which is a null, number, string, bool, object, or array.
- od := md.Oneofs().Get(0)
- fd := m.WhichOneof(od)
- if fd == nil {
- return errors.New("nil Value")
- }
- return w.marshalValue(fd, m.Get(fd), indent)
- case "Struct", "ListValue":
- // JSON object or array.
- fd := fds.ByNumber(1)
- return w.marshalValue(fd, m.Get(fd), indent)
- }
-
- w.write("{")
- if w.Indent != "" {
- w.write("\n")
- }
-
- firstField := true
- if typeURL != "" {
- if err := w.marshalTypeURL(indent, typeURL); err != nil {
- return err
- }
- firstField = false
- }
-
- for i := 0; i < fds.Len(); {
- fd := fds.Get(i)
- if od := fd.ContainingOneof(); od != nil {
- fd = m.WhichOneof(od)
- i += od.Fields().Len()
- if fd == nil {
- continue
- }
- } else {
- i++
- }
-
- v := m.Get(fd)
-
- if !m.Has(fd) {
- if !w.EmitDefaults || fd.ContainingOneof() != nil {
- continue
- }
- if fd.Cardinality() != protoreflect.Repeated && (fd.Message() != nil || fd.Syntax() == protoreflect.Proto2) {
- v = protoreflect.Value{} // use "null" for singular messages or proto2 scalars
- }
- }
-
- if !firstField {
- w.writeComma()
- }
- if err := w.marshalField(fd, v, indent); err != nil {
- return err
- }
- firstField = false
- }
-
- // Handle proto2 extensions.
- if md.ExtensionRanges().Len() > 0 {
- // Collect a sorted list of all extension descriptor and values.
- type ext struct {
- desc protoreflect.FieldDescriptor
- val protoreflect.Value
- }
- var exts []ext
- m.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool {
- if fd.IsExtension() {
- exts = append(exts, ext{fd, v})
- }
- return true
- })
- sort.Slice(exts, func(i, j int) bool {
- return exts[i].desc.Number() < exts[j].desc.Number()
- })
-
- for _, ext := range exts {
- if !firstField {
- w.writeComma()
- }
- if err := w.marshalField(ext.desc, ext.val, indent); err != nil {
- return err
- }
- firstField = false
- }
- }
-
- if w.Indent != "" {
- w.write("\n")
- w.write(indent)
- }
- w.write("}")
- return nil
-}
-
-func (w *jsonWriter) writeComma() {
- if w.Indent != "" {
- w.write(",\n")
- } else {
- w.write(",")
- }
-}
-
-func (w *jsonWriter) marshalAny(m protoreflect.Message, indent string) error {
- // "If the Any contains a value that has a special JSON mapping,
- // it will be converted as follows: {"@type": xxx, "value": yyy}.
- // Otherwise, the value will be converted into a JSON object,
- // and the "@type" field will be inserted to indicate the actual data type."
- md := m.Descriptor()
- typeURL := m.Get(md.Fields().ByNumber(1)).String()
- rawVal := m.Get(md.Fields().ByNumber(2)).Bytes()
-
- var m2 protoreflect.Message
- if w.AnyResolver != nil {
- mi, err := w.AnyResolver.Resolve(typeURL)
- if err != nil {
- return err
- }
- m2 = proto.MessageReflect(mi)
- } else {
- mt, err := protoregistry.GlobalTypes.FindMessageByURL(typeURL)
- if err != nil {
- return err
- }
- m2 = mt.New()
- }
-
- if err := protoV2.Unmarshal(rawVal, m2.Interface()); err != nil {
- return err
- }
-
- if wellKnownType(m2.Descriptor().FullName()) == "" {
- return w.marshalMessage(m2, indent, typeURL)
- }
-
- w.write("{")
- if w.Indent != "" {
- w.write("\n")
- }
- if err := w.marshalTypeURL(indent, typeURL); err != nil {
- return err
- }
- w.writeComma()
- if w.Indent != "" {
- w.write(indent)
- w.write(w.Indent)
- w.write(`"value": `)
- } else {
- w.write(`"value":`)
- }
- if err := w.marshalMessage(m2, indent+w.Indent, ""); err != nil {
- return err
- }
- if w.Indent != "" {
- w.write("\n")
- w.write(indent)
- }
- w.write("}")
- return nil
-}
-
-func (w *jsonWriter) marshalTypeURL(indent, typeURL string) error {
- if w.Indent != "" {
- w.write(indent)
- w.write(w.Indent)
- }
- w.write(`"@type":`)
- if w.Indent != "" {
- w.write(" ")
- }
- b, err := json.Marshal(typeURL)
- if err != nil {
- return err
- }
- w.write(string(b))
- return nil
-}
-
-// marshalField writes field description and value to the Writer.
-func (w *jsonWriter) marshalField(fd protoreflect.FieldDescriptor, v protoreflect.Value, indent string) error {
- if w.Indent != "" {
- w.write(indent)
- w.write(w.Indent)
- }
- w.write(`"`)
- switch {
- case fd.IsExtension():
- // For message set, use the fname of the message as the extension name.
- name := string(fd.FullName())
- if isMessageSet(fd.ContainingMessage()) {
- name = strings.TrimSuffix(name, ".message_set_extension")
- }
-
- w.write("[" + name + "]")
- case w.OrigName:
- name := string(fd.Name())
- if fd.Kind() == protoreflect.GroupKind {
- name = string(fd.Message().Name())
- }
- w.write(name)
- default:
- w.write(string(fd.JSONName()))
- }
- w.write(`":`)
- if w.Indent != "" {
- w.write(" ")
- }
- return w.marshalValue(fd, v, indent)
-}
-
-func (w *jsonWriter) marshalValue(fd protoreflect.FieldDescriptor, v protoreflect.Value, indent string) error {
- switch {
- case fd.IsList():
- w.write("[")
- comma := ""
- lv := v.List()
- for i := 0; i < lv.Len(); i++ {
- w.write(comma)
- if w.Indent != "" {
- w.write("\n")
- w.write(indent)
- w.write(w.Indent)
- w.write(w.Indent)
- }
- if err := w.marshalSingularValue(fd, lv.Get(i), indent+w.Indent); err != nil {
- return err
- }
- comma = ","
- }
- if w.Indent != "" {
- w.write("\n")
- w.write(indent)
- w.write(w.Indent)
- }
- w.write("]")
- return nil
- case fd.IsMap():
- kfd := fd.MapKey()
- vfd := fd.MapValue()
- mv := v.Map()
-
- // Collect a sorted list of all map keys and values.
- type entry struct{ key, val protoreflect.Value }
- var entries []entry
- mv.Range(func(k protoreflect.MapKey, v protoreflect.Value) bool {
- entries = append(entries, entry{k.Value(), v})
- return true
- })
- sort.Slice(entries, func(i, j int) bool {
- switch kfd.Kind() {
- case protoreflect.BoolKind:
- return !entries[i].key.Bool() && entries[j].key.Bool()
- case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind, protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind:
- return entries[i].key.Int() < entries[j].key.Int()
- case protoreflect.Uint32Kind, protoreflect.Fixed32Kind, protoreflect.Uint64Kind, protoreflect.Fixed64Kind:
- return entries[i].key.Uint() < entries[j].key.Uint()
- case protoreflect.StringKind:
- return entries[i].key.String() < entries[j].key.String()
- default:
- panic("invalid kind")
- }
- })
-
- w.write(`{`)
- comma := ""
- for _, entry := range entries {
- w.write(comma)
- if w.Indent != "" {
- w.write("\n")
- w.write(indent)
- w.write(w.Indent)
- w.write(w.Indent)
- }
-
- s := fmt.Sprint(entry.key.Interface())
- b, err := json.Marshal(s)
- if err != nil {
- return err
- }
- w.write(string(b))
-
- w.write(`:`)
- if w.Indent != "" {
- w.write(` `)
- }
-
- if err := w.marshalSingularValue(vfd, entry.val, indent+w.Indent); err != nil {
- return err
- }
- comma = ","
- }
- if w.Indent != "" {
- w.write("\n")
- w.write(indent)
- w.write(w.Indent)
- }
- w.write(`}`)
- return nil
- default:
- return w.marshalSingularValue(fd, v, indent)
- }
-}
-
-func (w *jsonWriter) marshalSingularValue(fd protoreflect.FieldDescriptor, v protoreflect.Value, indent string) error {
- switch {
- case !v.IsValid():
- w.write("null")
- return nil
- case fd.Message() != nil:
- return w.marshalMessage(v.Message(), indent+w.Indent, "")
- case fd.Enum() != nil:
- if fd.Enum().FullName() == "google.protobuf.NullValue" {
- w.write("null")
- return nil
- }
-
- vd := fd.Enum().Values().ByNumber(v.Enum())
- if vd == nil || w.EnumsAsInts {
- w.write(strconv.Itoa(int(v.Enum())))
- } else {
- w.write(`"` + string(vd.Name()) + `"`)
- }
- return nil
- default:
- switch v.Interface().(type) {
- case float32, float64:
- switch {
- case math.IsInf(v.Float(), +1):
- w.write(`"Infinity"`)
- return nil
- case math.IsInf(v.Float(), -1):
- w.write(`"-Infinity"`)
- return nil
- case math.IsNaN(v.Float()):
- w.write(`"NaN"`)
- return nil
- }
- case int64, uint64:
- w.write(fmt.Sprintf(`"%d"`, v.Interface()))
- return nil
- }
-
- b, err := json.Marshal(v.Interface())
- if err != nil {
- return err
- }
- w.write(string(b))
- return nil
- }
-}
diff --git a/vendor/github.com/golang/protobuf/jsonpb/json.go b/vendor/github.com/golang/protobuf/jsonpb/json.go
deleted file mode 100644
index 480e2448..00000000
--- a/vendor/github.com/golang/protobuf/jsonpb/json.go
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright 2015 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package jsonpb provides functionality to marshal and unmarshal between a
-// protocol buffer message and JSON. It follows the specification at
-// https://developers.google.com/protocol-buffers/docs/proto3#json.
-//
-// Do not rely on the default behavior of the standard encoding/json package
-// when called on generated message types as it does not operate correctly.
-//
-// Deprecated: Use the "google.golang.org/protobuf/encoding/protojson"
-// package instead.
-package jsonpb
-
-import (
- "github.com/golang/protobuf/proto"
- "google.golang.org/protobuf/reflect/protoreflect"
- "google.golang.org/protobuf/reflect/protoregistry"
- "google.golang.org/protobuf/runtime/protoimpl"
-)
-
-// AnyResolver takes a type URL, present in an Any message,
-// and resolves it into an instance of the associated message.
-type AnyResolver interface {
- Resolve(typeURL string) (proto.Message, error)
-}
-
-type anyResolver struct{ AnyResolver }
-
-func (r anyResolver) FindMessageByName(message protoreflect.FullName) (protoreflect.MessageType, error) {
- return r.FindMessageByURL(string(message))
-}
-
-func (r anyResolver) FindMessageByURL(url string) (protoreflect.MessageType, error) {
- m, err := r.Resolve(url)
- if err != nil {
- return nil, err
- }
- return protoimpl.X.MessageTypeOf(m), nil
-}
-
-func (r anyResolver) FindExtensionByName(field protoreflect.FullName) (protoreflect.ExtensionType, error) {
- return protoregistry.GlobalTypes.FindExtensionByName(field)
-}
-
-func (r anyResolver) FindExtensionByNumber(message protoreflect.FullName, field protoreflect.FieldNumber) (protoreflect.ExtensionType, error) {
- return protoregistry.GlobalTypes.FindExtensionByNumber(message, field)
-}
-
-func wellKnownType(s protoreflect.FullName) string {
- if s.Parent() == "google.protobuf" {
- switch s.Name() {
- case "Empty", "Any",
- "BoolValue", "BytesValue", "StringValue",
- "Int32Value", "UInt32Value", "FloatValue",
- "Int64Value", "UInt64Value", "DoubleValue",
- "Duration", "Timestamp",
- "NullValue", "Struct", "Value", "ListValue":
- return string(s.Name())
- }
- }
- return ""
-}
-
-func isMessageSet(md protoreflect.MessageDescriptor) bool {
- ms, ok := md.(interface{ IsMessageSet() bool })
- return ok && ms.IsMessageSet()
-}
diff --git a/vendor/github.com/golang/protobuf/ptypes/any.go b/vendor/github.com/golang/protobuf/ptypes/any.go
deleted file mode 100644
index 85f9f573..00000000
--- a/vendor/github.com/golang/protobuf/ptypes/any.go
+++ /dev/null
@@ -1,179 +0,0 @@
-// Copyright 2016 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package ptypes
-
-import (
- "fmt"
- "strings"
-
- "github.com/golang/protobuf/proto"
- "google.golang.org/protobuf/reflect/protoreflect"
- "google.golang.org/protobuf/reflect/protoregistry"
-
- anypb "github.com/golang/protobuf/ptypes/any"
-)
-
-const urlPrefix = "type.googleapis.com/"
-
-// AnyMessageName returns the message name contained in an anypb.Any message.
-// Most type assertions should use the Is function instead.
-//
-// Deprecated: Call the any.MessageName method instead.
-func AnyMessageName(any *anypb.Any) (string, error) {
- name, err := anyMessageName(any)
- return string(name), err
-}
-func anyMessageName(any *anypb.Any) (protoreflect.FullName, error) {
- if any == nil {
- return "", fmt.Errorf("message is nil")
- }
- name := protoreflect.FullName(any.TypeUrl)
- if i := strings.LastIndex(any.TypeUrl, "/"); i >= 0 {
- name = name[i+len("/"):]
- }
- if !name.IsValid() {
- return "", fmt.Errorf("message type url %q is invalid", any.TypeUrl)
- }
- return name, nil
-}
-
-// MarshalAny marshals the given message m into an anypb.Any message.
-//
-// Deprecated: Call the anypb.New function instead.
-func MarshalAny(m proto.Message) (*anypb.Any, error) {
- switch dm := m.(type) {
- case DynamicAny:
- m = dm.Message
- case *DynamicAny:
- if dm == nil {
- return nil, proto.ErrNil
- }
- m = dm.Message
- }
- b, err := proto.Marshal(m)
- if err != nil {
- return nil, err
- }
- return &anypb.Any{TypeUrl: urlPrefix + proto.MessageName(m), Value: b}, nil
-}
-
-// Empty returns a new message of the type specified in an anypb.Any message.
-// It returns protoregistry.NotFound if the corresponding message type could not
-// be resolved in the global registry.
-//
-// Deprecated: Use protoregistry.GlobalTypes.FindMessageByName instead
-// to resolve the message name and create a new instance of it.
-func Empty(any *anypb.Any) (proto.Message, error) {
- name, err := anyMessageName(any)
- if err != nil {
- return nil, err
- }
- mt, err := protoregistry.GlobalTypes.FindMessageByName(name)
- if err != nil {
- return nil, err
- }
- return proto.MessageV1(mt.New().Interface()), nil
-}
-
-// UnmarshalAny unmarshals the encoded value contained in the anypb.Any message
-// into the provided message m. It returns an error if the target message
-// does not match the type in the Any message or if an unmarshal error occurs.
-//
-// The target message m may be a *DynamicAny message. If the underlying message
-// type could not be resolved, then this returns protoregistry.NotFound.
-//
-// Deprecated: Call the any.UnmarshalTo method instead.
-func UnmarshalAny(any *anypb.Any, m proto.Message) error {
- if dm, ok := m.(*DynamicAny); ok {
- if dm.Message == nil {
- var err error
- dm.Message, err = Empty(any)
- if err != nil {
- return err
- }
- }
- m = dm.Message
- }
-
- anyName, err := AnyMessageName(any)
- if err != nil {
- return err
- }
- msgName := proto.MessageName(m)
- if anyName != msgName {
- return fmt.Errorf("mismatched message type: got %q want %q", anyName, msgName)
- }
- return proto.Unmarshal(any.Value, m)
-}
-
-// Is reports whether the Any message contains a message of the specified type.
-//
-// Deprecated: Call the any.MessageIs method instead.
-func Is(any *anypb.Any, m proto.Message) bool {
- if any == nil || m == nil {
- return false
- }
- name := proto.MessageName(m)
- if !strings.HasSuffix(any.TypeUrl, name) {
- return false
- }
- return len(any.TypeUrl) == len(name) || any.TypeUrl[len(any.TypeUrl)-len(name)-1] == '/'
-}
-
-// DynamicAny is a value that can be passed to UnmarshalAny to automatically
-// allocate a proto.Message for the type specified in an anypb.Any message.
-// The allocated message is stored in the embedded proto.Message.
-//
-// Example:
-// var x ptypes.DynamicAny
-// if err := ptypes.UnmarshalAny(a, &x); err != nil { ... }
-// fmt.Printf("unmarshaled message: %v", x.Message)
-//
-// Deprecated: Use the any.UnmarshalNew method instead to unmarshal
-// the any message contents into a new instance of the underlying message.
-type DynamicAny struct{ proto.Message }
-
-func (m DynamicAny) String() string {
- if m.Message == nil {
- return ""
- }
- return m.Message.String()
-}
-func (m DynamicAny) Reset() {
- if m.Message == nil {
- return
- }
- m.Message.Reset()
-}
-func (m DynamicAny) ProtoMessage() {
- return
-}
-func (m DynamicAny) ProtoReflect() protoreflect.Message {
- if m.Message == nil {
- return nil
- }
- return dynamicAny{proto.MessageReflect(m.Message)}
-}
-
-type dynamicAny struct{ protoreflect.Message }
-
-func (m dynamicAny) Type() protoreflect.MessageType {
- return dynamicAnyType{m.Message.Type()}
-}
-func (m dynamicAny) New() protoreflect.Message {
- return dynamicAnyType{m.Message.Type()}.New()
-}
-func (m dynamicAny) Interface() protoreflect.ProtoMessage {
- return DynamicAny{proto.MessageV1(m.Message.Interface())}
-}
-
-type dynamicAnyType struct{ protoreflect.MessageType }
-
-func (t dynamicAnyType) New() protoreflect.Message {
- return dynamicAny{t.MessageType.New()}
-}
-func (t dynamicAnyType) Zero() protoreflect.Message {
- return dynamicAny{t.MessageType.Zero()}
-}
diff --git a/vendor/github.com/golang/protobuf/ptypes/any/any.pb.go b/vendor/github.com/golang/protobuf/ptypes/any/any.pb.go
deleted file mode 100644
index 0ef27d33..00000000
--- a/vendor/github.com/golang/protobuf/ptypes/any/any.pb.go
+++ /dev/null
@@ -1,62 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: github.com/golang/protobuf/ptypes/any/any.proto
-
-package any
-
-import (
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
- anypb "google.golang.org/protobuf/types/known/anypb"
- reflect "reflect"
-)
-
-// Symbols defined in public import of google/protobuf/any.proto.
-
-type Any = anypb.Any
-
-var File_github_com_golang_protobuf_ptypes_any_any_proto protoreflect.FileDescriptor
-
-var file_github_com_golang_protobuf_ptypes_any_any_proto_rawDesc = []byte{
- 0x0a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6c,
- 0x61, 0x6e, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x74, 0x79,
- 0x70, 0x65, 0x73, 0x2f, 0x61, 0x6e, 0x79, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74,
- 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
- 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x2b, 0x5a, 0x29,
- 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6c, 0x61, 0x6e,
- 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x74, 0x79, 0x70, 0x65,
- 0x73, 0x2f, 0x61, 0x6e, 0x79, 0x3b, 0x61, 0x6e, 0x79, 0x50, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x33,
-}
-
-var file_github_com_golang_protobuf_ptypes_any_any_proto_goTypes = []interface{}{}
-var file_github_com_golang_protobuf_ptypes_any_any_proto_depIdxs = []int32{
- 0, // [0:0] is the sub-list for method output_type
- 0, // [0:0] is the sub-list for method input_type
- 0, // [0:0] is the sub-list for extension type_name
- 0, // [0:0] is the sub-list for extension extendee
- 0, // [0:0] is the sub-list for field type_name
-}
-
-func init() { file_github_com_golang_protobuf_ptypes_any_any_proto_init() }
-func file_github_com_golang_protobuf_ptypes_any_any_proto_init() {
- if File_github_com_golang_protobuf_ptypes_any_any_proto != nil {
- return
- }
- type x struct{}
- out := protoimpl.TypeBuilder{
- File: protoimpl.DescBuilder{
- GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
- RawDescriptor: file_github_com_golang_protobuf_ptypes_any_any_proto_rawDesc,
- NumEnums: 0,
- NumMessages: 0,
- NumExtensions: 0,
- NumServices: 0,
- },
- GoTypes: file_github_com_golang_protobuf_ptypes_any_any_proto_goTypes,
- DependencyIndexes: file_github_com_golang_protobuf_ptypes_any_any_proto_depIdxs,
- }.Build()
- File_github_com_golang_protobuf_ptypes_any_any_proto = out.File
- file_github_com_golang_protobuf_ptypes_any_any_proto_rawDesc = nil
- file_github_com_golang_protobuf_ptypes_any_any_proto_goTypes = nil
- file_github_com_golang_protobuf_ptypes_any_any_proto_depIdxs = nil
-}
diff --git a/vendor/github.com/golang/protobuf/ptypes/doc.go b/vendor/github.com/golang/protobuf/ptypes/doc.go
deleted file mode 100644
index d3c33259..00000000
--- a/vendor/github.com/golang/protobuf/ptypes/doc.go
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright 2016 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package ptypes provides functionality for interacting with well-known types.
-//
-// Deprecated: Well-known types have specialized functionality directly
-// injected into the generated packages for each message type.
-// See the deprecation notice for each function for the suggested alternative.
-package ptypes
diff --git a/vendor/github.com/golang/protobuf/ptypes/duration.go b/vendor/github.com/golang/protobuf/ptypes/duration.go
deleted file mode 100644
index b2b55dd8..00000000
--- a/vendor/github.com/golang/protobuf/ptypes/duration.go
+++ /dev/null
@@ -1,76 +0,0 @@
-// Copyright 2016 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package ptypes
-
-import (
- "errors"
- "fmt"
- "time"
-
- durationpb "github.com/golang/protobuf/ptypes/duration"
-)
-
-// Range of google.protobuf.Duration as specified in duration.proto.
-// This is about 10,000 years in seconds.
-const (
- maxSeconds = int64(10000 * 365.25 * 24 * 60 * 60)
- minSeconds = -maxSeconds
-)
-
-// Duration converts a durationpb.Duration to a time.Duration.
-// Duration returns an error if dur is invalid or overflows a time.Duration.
-//
-// Deprecated: Call the dur.AsDuration and dur.CheckValid methods instead.
-func Duration(dur *durationpb.Duration) (time.Duration, error) {
- if err := validateDuration(dur); err != nil {
- return 0, err
- }
- d := time.Duration(dur.Seconds) * time.Second
- if int64(d/time.Second) != dur.Seconds {
- return 0, fmt.Errorf("duration: %v is out of range for time.Duration", dur)
- }
- if dur.Nanos != 0 {
- d += time.Duration(dur.Nanos) * time.Nanosecond
- if (d < 0) != (dur.Nanos < 0) {
- return 0, fmt.Errorf("duration: %v is out of range for time.Duration", dur)
- }
- }
- return d, nil
-}
-
-// DurationProto converts a time.Duration to a durationpb.Duration.
-//
-// Deprecated: Call the durationpb.New function instead.
-func DurationProto(d time.Duration) *durationpb.Duration {
- nanos := d.Nanoseconds()
- secs := nanos / 1e9
- nanos -= secs * 1e9
- return &durationpb.Duration{
- Seconds: int64(secs),
- Nanos: int32(nanos),
- }
-}
-
-// validateDuration determines whether the durationpb.Duration is valid
-// according to the definition in google/protobuf/duration.proto.
-// A valid durpb.Duration may still be too large to fit into a time.Duration
-// Note that the range of durationpb.Duration is about 10,000 years,
-// while the range of time.Duration is about 290 years.
-func validateDuration(dur *durationpb.Duration) error {
- if dur == nil {
- return errors.New("duration: nil Duration")
- }
- if dur.Seconds < minSeconds || dur.Seconds > maxSeconds {
- return fmt.Errorf("duration: %v: seconds out of range", dur)
- }
- if dur.Nanos <= -1e9 || dur.Nanos >= 1e9 {
- return fmt.Errorf("duration: %v: nanos out of range", dur)
- }
- // Seconds and Nanos must have the same sign, unless d.Nanos is zero.
- if (dur.Seconds < 0 && dur.Nanos > 0) || (dur.Seconds > 0 && dur.Nanos < 0) {
- return fmt.Errorf("duration: %v: seconds and nanos have different signs", dur)
- }
- return nil
-}
diff --git a/vendor/github.com/golang/protobuf/ptypes/duration/duration.pb.go b/vendor/github.com/golang/protobuf/ptypes/duration/duration.pb.go
deleted file mode 100644
index d0079ee3..00000000
--- a/vendor/github.com/golang/protobuf/ptypes/duration/duration.pb.go
+++ /dev/null
@@ -1,63 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: github.com/golang/protobuf/ptypes/duration/duration.proto
-
-package duration
-
-import (
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
- durationpb "google.golang.org/protobuf/types/known/durationpb"
- reflect "reflect"
-)
-
-// Symbols defined in public import of google/protobuf/duration.proto.
-
-type Duration = durationpb.Duration
-
-var File_github_com_golang_protobuf_ptypes_duration_duration_proto protoreflect.FileDescriptor
-
-var file_github_com_golang_protobuf_ptypes_duration_duration_proto_rawDesc = []byte{
- 0x0a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6c,
- 0x61, 0x6e, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x74, 0x79,
- 0x70, 0x65, 0x73, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x64, 0x75, 0x72,
- 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f,
- 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72,
- 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x35, 0x5a, 0x33, 0x67,
- 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67,
- 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x74, 0x79, 0x70, 0x65, 0x73,
- 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69,
- 0x6f, 0x6e, 0x50, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
-}
-
-var file_github_com_golang_protobuf_ptypes_duration_duration_proto_goTypes = []interface{}{}
-var file_github_com_golang_protobuf_ptypes_duration_duration_proto_depIdxs = []int32{
- 0, // [0:0] is the sub-list for method output_type
- 0, // [0:0] is the sub-list for method input_type
- 0, // [0:0] is the sub-list for extension type_name
- 0, // [0:0] is the sub-list for extension extendee
- 0, // [0:0] is the sub-list for field type_name
-}
-
-func init() { file_github_com_golang_protobuf_ptypes_duration_duration_proto_init() }
-func file_github_com_golang_protobuf_ptypes_duration_duration_proto_init() {
- if File_github_com_golang_protobuf_ptypes_duration_duration_proto != nil {
- return
- }
- type x struct{}
- out := protoimpl.TypeBuilder{
- File: protoimpl.DescBuilder{
- GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
- RawDescriptor: file_github_com_golang_protobuf_ptypes_duration_duration_proto_rawDesc,
- NumEnums: 0,
- NumMessages: 0,
- NumExtensions: 0,
- NumServices: 0,
- },
- GoTypes: file_github_com_golang_protobuf_ptypes_duration_duration_proto_goTypes,
- DependencyIndexes: file_github_com_golang_protobuf_ptypes_duration_duration_proto_depIdxs,
- }.Build()
- File_github_com_golang_protobuf_ptypes_duration_duration_proto = out.File
- file_github_com_golang_protobuf_ptypes_duration_duration_proto_rawDesc = nil
- file_github_com_golang_protobuf_ptypes_duration_duration_proto_goTypes = nil
- file_github_com_golang_protobuf_ptypes_duration_duration_proto_depIdxs = nil
-}
diff --git a/vendor/github.com/golang/protobuf/ptypes/timestamp.go b/vendor/github.com/golang/protobuf/ptypes/timestamp.go
deleted file mode 100644
index 8368a3f7..00000000
--- a/vendor/github.com/golang/protobuf/ptypes/timestamp.go
+++ /dev/null
@@ -1,112 +0,0 @@
-// Copyright 2016 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package ptypes
-
-import (
- "errors"
- "fmt"
- "time"
-
- timestamppb "github.com/golang/protobuf/ptypes/timestamp"
-)
-
-// Range of google.protobuf.Duration as specified in timestamp.proto.
-const (
- // Seconds field of the earliest valid Timestamp.
- // This is time.Date(1, 1, 1, 0, 0, 0, 0, time.UTC).Unix().
- minValidSeconds = -62135596800
- // Seconds field just after the latest valid Timestamp.
- // This is time.Date(10000, 1, 1, 0, 0, 0, 0, time.UTC).Unix().
- maxValidSeconds = 253402300800
-)
-
-// Timestamp converts a timestamppb.Timestamp to a time.Time.
-// It returns an error if the argument is invalid.
-//
-// Unlike most Go functions, if Timestamp returns an error, the first return
-// value is not the zero time.Time. Instead, it is the value obtained from the
-// time.Unix function when passed the contents of the Timestamp, in the UTC
-// locale. This may or may not be a meaningful time; many invalid Timestamps
-// do map to valid time.Times.
-//
-// A nil Timestamp returns an error. The first return value in that case is
-// undefined.
-//
-// Deprecated: Call the ts.AsTime and ts.CheckValid methods instead.
-func Timestamp(ts *timestamppb.Timestamp) (time.Time, error) {
- // Don't return the zero value on error, because corresponds to a valid
- // timestamp. Instead return whatever time.Unix gives us.
- var t time.Time
- if ts == nil {
- t = time.Unix(0, 0).UTC() // treat nil like the empty Timestamp
- } else {
- t = time.Unix(ts.Seconds, int64(ts.Nanos)).UTC()
- }
- return t, validateTimestamp(ts)
-}
-
-// TimestampNow returns a google.protobuf.Timestamp for the current time.
-//
-// Deprecated: Call the timestamppb.Now function instead.
-func TimestampNow() *timestamppb.Timestamp {
- ts, err := TimestampProto(time.Now())
- if err != nil {
- panic("ptypes: time.Now() out of Timestamp range")
- }
- return ts
-}
-
-// TimestampProto converts the time.Time to a google.protobuf.Timestamp proto.
-// It returns an error if the resulting Timestamp is invalid.
-//
-// Deprecated: Call the timestamppb.New function instead.
-func TimestampProto(t time.Time) (*timestamppb.Timestamp, error) {
- ts := ×tamppb.Timestamp{
- Seconds: t.Unix(),
- Nanos: int32(t.Nanosecond()),
- }
- if err := validateTimestamp(ts); err != nil {
- return nil, err
- }
- return ts, nil
-}
-
-// TimestampString returns the RFC 3339 string for valid Timestamps.
-// For invalid Timestamps, it returns an error message in parentheses.
-//
-// Deprecated: Call the ts.AsTime method instead,
-// followed by a call to the Format method on the time.Time value.
-func TimestampString(ts *timestamppb.Timestamp) string {
- t, err := Timestamp(ts)
- if err != nil {
- return fmt.Sprintf("(%v)", err)
- }
- return t.Format(time.RFC3339Nano)
-}
-
-// validateTimestamp determines whether a Timestamp is valid.
-// A valid timestamp represents a time in the range [0001-01-01, 10000-01-01)
-// and has a Nanos field in the range [0, 1e9).
-//
-// If the Timestamp is valid, validateTimestamp returns nil.
-// Otherwise, it returns an error that describes the problem.
-//
-// Every valid Timestamp can be represented by a time.Time,
-// but the converse is not true.
-func validateTimestamp(ts *timestamppb.Timestamp) error {
- if ts == nil {
- return errors.New("timestamp: nil Timestamp")
- }
- if ts.Seconds < minValidSeconds {
- return fmt.Errorf("timestamp: %v before 0001-01-01", ts)
- }
- if ts.Seconds >= maxValidSeconds {
- return fmt.Errorf("timestamp: %v after 10000-01-01", ts)
- }
- if ts.Nanos < 0 || ts.Nanos >= 1e9 {
- return fmt.Errorf("timestamp: %v: nanos not in range [0, 1e9)", ts)
- }
- return nil
-}
diff --git a/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.pb.go b/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.pb.go
deleted file mode 100644
index a76f8076..00000000
--- a/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.pb.go
+++ /dev/null
@@ -1,64 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: github.com/golang/protobuf/ptypes/timestamp/timestamp.proto
-
-package timestamp
-
-import (
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
- timestamppb "google.golang.org/protobuf/types/known/timestamppb"
- reflect "reflect"
-)
-
-// Symbols defined in public import of google/protobuf/timestamp.proto.
-
-type Timestamp = timestamppb.Timestamp
-
-var File_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto protoreflect.FileDescriptor
-
-var file_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto_rawDesc = []byte{
- 0x0a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6c,
- 0x61, 0x6e, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x74, 0x79,
- 0x70, 0x65, 0x73, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2f, 0x74, 0x69,
- 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67,
- 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74,
- 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x37,
- 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6c,
- 0x61, 0x6e, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x74, 0x79,
- 0x70, 0x65, 0x73, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x3b, 0x74, 0x69,
- 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x50, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x33,
-}
-
-var file_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto_goTypes = []interface{}{}
-var file_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto_depIdxs = []int32{
- 0, // [0:0] is the sub-list for method output_type
- 0, // [0:0] is the sub-list for method input_type
- 0, // [0:0] is the sub-list for extension type_name
- 0, // [0:0] is the sub-list for extension extendee
- 0, // [0:0] is the sub-list for field type_name
-}
-
-func init() { file_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto_init() }
-func file_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto_init() {
- if File_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto != nil {
- return
- }
- type x struct{}
- out := protoimpl.TypeBuilder{
- File: protoimpl.DescBuilder{
- GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
- RawDescriptor: file_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto_rawDesc,
- NumEnums: 0,
- NumMessages: 0,
- NumExtensions: 0,
- NumServices: 0,
- },
- GoTypes: file_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto_goTypes,
- DependencyIndexes: file_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto_depIdxs,
- }.Build()
- File_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto = out.File
- file_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto_rawDesc = nil
- file_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto_goTypes = nil
- file_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto_depIdxs = nil
-}
diff --git a/vendor/github.com/google/s2a-go/internal/proto/common_go_proto/common.pb.go b/vendor/github.com/google/s2a-go/internal/proto/common_go_proto/common.pb.go
index 16278a1d..fcd049de 100644
--- a/vendor/github.com/google/s2a-go/internal/proto/common_go_proto/common.pb.go
+++ b/vendor/github.com/google/s2a-go/internal/proto/common_go_proto/common.pb.go
@@ -14,7 +14,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
-// protoc-gen-go v1.30.0
+// protoc-gen-go v1.34.2
// protoc v3.21.12
// source: internal/proto/common/common.proto
@@ -145,8 +145,8 @@ type Identity struct {
// *Identity_SpiffeId
// *Identity_Hostname
// *Identity_Uid
- // *Identity_MdbUsername
- // *Identity_GaiaId
+ // *Identity_Username
+ // *Identity_GcpId
IdentityOneof isIdentity_IdentityOneof `protobuf_oneof:"identity_oneof"`
// Additional identity-specific attributes.
Attributes map[string]string `protobuf:"bytes,3,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
@@ -212,16 +212,16 @@ func (x *Identity) GetUid() string {
return ""
}
-func (x *Identity) GetMdbUsername() string {
- if x, ok := x.GetIdentityOneof().(*Identity_MdbUsername); ok {
- return x.MdbUsername
+func (x *Identity) GetUsername() string {
+ if x, ok := x.GetIdentityOneof().(*Identity_Username); ok {
+ return x.Username
}
return ""
}
-func (x *Identity) GetGaiaId() string {
- if x, ok := x.GetIdentityOneof().(*Identity_GaiaId); ok {
- return x.GaiaId
+func (x *Identity) GetGcpId() string {
+ if x, ok := x.GetIdentityOneof().(*Identity_GcpId); ok {
+ return x.GcpId
}
return ""
}
@@ -252,14 +252,14 @@ type Identity_Uid struct {
Uid string `protobuf:"bytes,4,opt,name=uid,proto3,oneof"`
}
-type Identity_MdbUsername struct {
- // The MDB username of a connection endpoint.
- MdbUsername string `protobuf:"bytes,5,opt,name=mdb_username,json=mdbUsername,proto3,oneof"`
+type Identity_Username struct {
+ // The username of a connection endpoint.
+ Username string `protobuf:"bytes,5,opt,name=username,proto3,oneof"`
}
-type Identity_GaiaId struct {
- // The Gaia ID of a connection endpoint.
- GaiaId string `protobuf:"bytes,6,opt,name=gaia_id,json=gaiaId,proto3,oneof"`
+type Identity_GcpId struct {
+ // The GCP ID of a connection endpoint.
+ GcpId string `protobuf:"bytes,6,opt,name=gcp_id,json=gcpId,proto3,oneof"`
}
func (*Identity_SpiffeId) isIdentity_IdentityOneof() {}
@@ -268,9 +268,9 @@ func (*Identity_Hostname) isIdentity_IdentityOneof() {}
func (*Identity_Uid) isIdentity_IdentityOneof() {}
-func (*Identity_MdbUsername) isIdentity_IdentityOneof() {}
+func (*Identity_Username) isIdentity_IdentityOneof() {}
-func (*Identity_GaiaId) isIdentity_IdentityOneof() {}
+func (*Identity_GcpId) isIdentity_IdentityOneof() {}
var File_internal_proto_common_common_proto protoreflect.FileDescriptor
@@ -278,38 +278,37 @@ var file_internal_proto_common_common_proto_rawDesc = []byte{
0x0a, 0x22, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
- 0xb1, 0x02, 0x0a, 0x08, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x1d, 0x0a, 0x09,
+ 0xa8, 0x02, 0x0a, 0x08, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x1d, 0x0a, 0x09,
0x73, 0x70, 0x69, 0x66, 0x66, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48,
0x00, 0x52, 0x08, 0x73, 0x70, 0x69, 0x66, 0x66, 0x65, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x08, 0x68,
0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52,
0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x03, 0x75, 0x69, 0x64,
- 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x23, 0x0a,
- 0x0c, 0x6d, 0x64, 0x62, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20,
- 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x6d, 0x64, 0x62, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61,
- 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x07, 0x67, 0x61, 0x69, 0x61, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20,
- 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x67, 0x61, 0x69, 0x61, 0x49, 0x64, 0x12, 0x43, 0x0a,
- 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28,
- 0x0b, 0x32, 0x23, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x49, 0x64,
- 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65,
- 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74,
- 0x65, 0x73, 0x1a, 0x3d, 0x0a, 0x0f, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73,
- 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01,
- 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
- 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38,
- 0x01, 0x42, 0x10, 0x0a, 0x0e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x6f, 0x6e,
- 0x65, 0x6f, 0x66, 0x2a, 0x5b, 0x0a, 0x0b, 0x43, 0x69, 0x70, 0x68, 0x65, 0x72, 0x73, 0x75, 0x69,
- 0x74, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x45, 0x53, 0x5f, 0x31, 0x32, 0x38, 0x5f, 0x47, 0x43,
- 0x4d, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x45,
- 0x53, 0x5f, 0x32, 0x35, 0x36, 0x5f, 0x47, 0x43, 0x4d, 0x5f, 0x53, 0x48, 0x41, 0x33, 0x38, 0x34,
- 0x10, 0x01, 0x12, 0x1c, 0x0a, 0x18, 0x43, 0x48, 0x41, 0x43, 0x48, 0x41, 0x32, 0x30, 0x5f, 0x50,
- 0x4f, 0x4c, 0x59, 0x31, 0x33, 0x30, 0x35, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x02,
- 0x2a, 0x24, 0x0a, 0x0a, 0x54, 0x4c, 0x53, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0a,
- 0x0a, 0x06, 0x54, 0x4c, 0x53, 0x31, 0x5f, 0x32, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x54, 0x4c,
- 0x53, 0x31, 0x5f, 0x33, 0x10, 0x01, 0x42, 0x36, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
- 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x73, 0x32, 0x61, 0x2f,
- 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63,
- 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x67, 0x6f, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1c, 0x0a,
+ 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48,
+ 0x00, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x06, 0x67,
+ 0x63, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x67,
+ 0x63, 0x70, 0x49, 0x64, 0x12, 0x43, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74,
+ 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70,
+ 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x41, 0x74,
+ 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x61,
+ 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x1a, 0x3d, 0x0a, 0x0f, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03,
+ 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14,
+ 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76,
+ 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x10, 0x0a, 0x0e, 0x69, 0x64, 0x65, 0x6e,
+ 0x74, 0x69, 0x74, 0x79, 0x5f, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x2a, 0x5b, 0x0a, 0x0b, 0x43, 0x69,
+ 0x70, 0x68, 0x65, 0x72, 0x73, 0x75, 0x69, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x45, 0x53,
+ 0x5f, 0x31, 0x32, 0x38, 0x5f, 0x47, 0x43, 0x4d, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10,
+ 0x00, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x45, 0x53, 0x5f, 0x32, 0x35, 0x36, 0x5f, 0x47, 0x43, 0x4d,
+ 0x5f, 0x53, 0x48, 0x41, 0x33, 0x38, 0x34, 0x10, 0x01, 0x12, 0x1c, 0x0a, 0x18, 0x43, 0x48, 0x41,
+ 0x43, 0x48, 0x41, 0x32, 0x30, 0x5f, 0x50, 0x4f, 0x4c, 0x59, 0x31, 0x33, 0x30, 0x35, 0x5f, 0x53,
+ 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x02, 0x2a, 0x24, 0x0a, 0x0a, 0x54, 0x4c, 0x53, 0x56, 0x65,
+ 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0a, 0x0a, 0x06, 0x54, 0x4c, 0x53, 0x31, 0x5f, 0x32, 0x10,
+ 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x54, 0x4c, 0x53, 0x31, 0x5f, 0x33, 0x10, 0x01, 0x42, 0x36, 0x5a,
+ 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6f, 0x67,
+ 0x6c, 0x65, 0x2f, 0x73, 0x32, 0x61, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f,
+ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x67, 0x6f, 0x5f,
+ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -326,7 +325,7 @@ func file_internal_proto_common_common_proto_rawDescGZIP() []byte {
var file_internal_proto_common_common_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
var file_internal_proto_common_common_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
-var file_internal_proto_common_common_proto_goTypes = []interface{}{
+var file_internal_proto_common_common_proto_goTypes = []any{
(Ciphersuite)(0), // 0: s2a.proto.Ciphersuite
(TLSVersion)(0), // 1: s2a.proto.TLSVersion
(*Identity)(nil), // 2: s2a.proto.Identity
@@ -347,7 +346,7 @@ func file_internal_proto_common_common_proto_init() {
return
}
if !protoimpl.UnsafeEnabled {
- file_internal_proto_common_common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_common_common_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*Identity); i {
case 0:
return &v.state
@@ -360,12 +359,12 @@ func file_internal_proto_common_common_proto_init() {
}
}
}
- file_internal_proto_common_common_proto_msgTypes[0].OneofWrappers = []interface{}{
+ file_internal_proto_common_common_proto_msgTypes[0].OneofWrappers = []any{
(*Identity_SpiffeId)(nil),
(*Identity_Hostname)(nil),
(*Identity_Uid)(nil),
- (*Identity_MdbUsername)(nil),
- (*Identity_GaiaId)(nil),
+ (*Identity_Username)(nil),
+ (*Identity_GcpId)(nil),
}
type x struct{}
out := protoimpl.TypeBuilder{
diff --git a/vendor/github.com/google/s2a-go/internal/proto/s2a_context_go_proto/s2a_context.pb.go b/vendor/github.com/google/s2a-go/internal/proto/s2a_context_go_proto/s2a_context.pb.go
index f4f763ae..2af3ee3d 100644
--- a/vendor/github.com/google/s2a-go/internal/proto/s2a_context_go_proto/s2a_context.pb.go
+++ b/vendor/github.com/google/s2a-go/internal/proto/s2a_context_go_proto/s2a_context.pb.go
@@ -14,7 +14,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
-// protoc-gen-go v1.30.0
+// protoc-gen-go v1.34.2
// protoc v3.21.12
// source: internal/proto/s2a_context/s2a_context.proto
@@ -209,7 +209,7 @@ func file_internal_proto_s2a_context_s2a_context_proto_rawDescGZIP() []byte {
}
var file_internal_proto_s2a_context_s2a_context_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
-var file_internal_proto_s2a_context_s2a_context_proto_goTypes = []interface{}{
+var file_internal_proto_s2a_context_s2a_context_proto_goTypes = []any{
(*S2AContext)(nil), // 0: s2a.proto.S2AContext
(common_go_proto.TLSVersion)(0), // 1: s2a.proto.TLSVersion
(common_go_proto.Ciphersuite)(0), // 2: s2a.proto.Ciphersuite
@@ -233,7 +233,7 @@ func file_internal_proto_s2a_context_s2a_context_proto_init() {
return
}
if !protoimpl.UnsafeEnabled {
- file_internal_proto_s2a_context_s2a_context_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_s2a_context_s2a_context_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*S2AContext); i {
case 0:
return &v.state
diff --git a/vendor/github.com/google/s2a-go/internal/proto/s2a_go_proto/s2a.pb.go b/vendor/github.com/google/s2a-go/internal/proto/s2a_go_proto/s2a.pb.go
index 0a86ebee..8919232f 100644
--- a/vendor/github.com/google/s2a-go/internal/proto/s2a_go_proto/s2a.pb.go
+++ b/vendor/github.com/google/s2a-go/internal/proto/s2a_go_proto/s2a.pb.go
@@ -14,7 +14,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
-// protoc-gen-go v1.30.0
+// protoc-gen-go v1.34.2
// protoc v3.21.12
// source: internal/proto/s2a/s2a.proto
@@ -1171,7 +1171,7 @@ func file_internal_proto_s2a_s2a_proto_rawDescGZIP() []byte {
}
var file_internal_proto_s2a_s2a_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
-var file_internal_proto_s2a_s2a_proto_goTypes = []interface{}{
+var file_internal_proto_s2a_s2a_proto_goTypes = []any{
(*AuthenticationMechanism)(nil), // 0: s2a.proto.AuthenticationMechanism
(*ClientSessionStartReq)(nil), // 1: s2a.proto.ClientSessionStartReq
(*ServerSessionStartReq)(nil), // 2: s2a.proto.ServerSessionStartReq
@@ -1226,7 +1226,7 @@ func file_internal_proto_s2a_s2a_proto_init() {
return
}
if !protoimpl.UnsafeEnabled {
- file_internal_proto_s2a_s2a_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_s2a_s2a_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*AuthenticationMechanism); i {
case 0:
return &v.state
@@ -1238,7 +1238,7 @@ func file_internal_proto_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_s2a_s2a_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_s2a_s2a_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*ClientSessionStartReq); i {
case 0:
return &v.state
@@ -1250,7 +1250,7 @@ func file_internal_proto_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_s2a_s2a_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_s2a_s2a_proto_msgTypes[2].Exporter = func(v any, i int) any {
switch v := v.(*ServerSessionStartReq); i {
case 0:
return &v.state
@@ -1262,7 +1262,7 @@ func file_internal_proto_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_s2a_s2a_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_s2a_s2a_proto_msgTypes[3].Exporter = func(v any, i int) any {
switch v := v.(*SessionNextReq); i {
case 0:
return &v.state
@@ -1274,7 +1274,7 @@ func file_internal_proto_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_s2a_s2a_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_s2a_s2a_proto_msgTypes[4].Exporter = func(v any, i int) any {
switch v := v.(*ResumptionTicketReq); i {
case 0:
return &v.state
@@ -1286,7 +1286,7 @@ func file_internal_proto_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_s2a_s2a_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_s2a_s2a_proto_msgTypes[5].Exporter = func(v any, i int) any {
switch v := v.(*SessionReq); i {
case 0:
return &v.state
@@ -1298,7 +1298,7 @@ func file_internal_proto_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_s2a_s2a_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_s2a_s2a_proto_msgTypes[6].Exporter = func(v any, i int) any {
switch v := v.(*SessionState); i {
case 0:
return &v.state
@@ -1310,7 +1310,7 @@ func file_internal_proto_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_s2a_s2a_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_s2a_s2a_proto_msgTypes[7].Exporter = func(v any, i int) any {
switch v := v.(*SessionResult); i {
case 0:
return &v.state
@@ -1322,7 +1322,7 @@ func file_internal_proto_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_s2a_s2a_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_s2a_s2a_proto_msgTypes[8].Exporter = func(v any, i int) any {
switch v := v.(*SessionStatus); i {
case 0:
return &v.state
@@ -1334,7 +1334,7 @@ func file_internal_proto_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_s2a_s2a_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_s2a_s2a_proto_msgTypes[9].Exporter = func(v any, i int) any {
switch v := v.(*SessionResp); i {
case 0:
return &v.state
@@ -1347,10 +1347,10 @@ func file_internal_proto_s2a_s2a_proto_init() {
}
}
}
- file_internal_proto_s2a_s2a_proto_msgTypes[0].OneofWrappers = []interface{}{
+ file_internal_proto_s2a_s2a_proto_msgTypes[0].OneofWrappers = []any{
(*AuthenticationMechanism_Token)(nil),
}
- file_internal_proto_s2a_s2a_proto_msgTypes[5].OneofWrappers = []interface{}{
+ file_internal_proto_s2a_s2a_proto_msgTypes[5].OneofWrappers = []any{
(*SessionReq_ClientStart)(nil),
(*SessionReq_ServerStart)(nil),
(*SessionReq_Next)(nil),
diff --git a/vendor/github.com/google/s2a-go/internal/proto/s2a_go_proto/s2a_grpc.pb.go b/vendor/github.com/google/s2a-go/internal/proto/s2a_go_proto/s2a_grpc.pb.go
index 0fa582fc..8fac3841 100644
--- a/vendor/github.com/google/s2a-go/internal/proto/s2a_go_proto/s2a_grpc.pb.go
+++ b/vendor/github.com/google/s2a-go/internal/proto/s2a_go_proto/s2a_grpc.pb.go
@@ -14,7 +14,7 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
-// - protoc-gen-go-grpc v1.3.0
+// - protoc-gen-go-grpc v1.4.0
// - protoc v3.21.12
// source: internal/proto/s2a/s2a.proto
@@ -29,8 +29,8 @@ import (
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
-// Requires gRPC-Go v1.32.0 or later.
-const _ = grpc.SupportPackageIsVersion7
+// Requires gRPC-Go v1.62.0 or later.
+const _ = grpc.SupportPackageIsVersion8
const (
S2AService_SetUpSession_FullMethodName = "/s2a.proto.S2AService/SetUpSession"
@@ -61,11 +61,12 @@ func NewS2AServiceClient(cc grpc.ClientConnInterface) S2AServiceClient {
}
func (c *s2AServiceClient) SetUpSession(ctx context.Context, opts ...grpc.CallOption) (S2AService_SetUpSessionClient, error) {
- stream, err := c.cc.NewStream(ctx, &S2AService_ServiceDesc.Streams[0], S2AService_SetUpSession_FullMethodName, opts...)
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
+ stream, err := c.cc.NewStream(ctx, &S2AService_ServiceDesc.Streams[0], S2AService_SetUpSession_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
- x := &s2AServiceSetUpSessionClient{stream}
+ x := &s2AServiceSetUpSessionClient{ClientStream: stream}
return x, nil
}
@@ -129,7 +130,7 @@ func RegisterS2AServiceServer(s grpc.ServiceRegistrar, srv S2AServiceServer) {
}
func _S2AService_SetUpSession_Handler(srv interface{}, stream grpc.ServerStream) error {
- return srv.(S2AServiceServer).SetUpSession(&s2AServiceSetUpSessionServer{stream})
+ return srv.(S2AServiceServer).SetUpSession(&s2AServiceSetUpSessionServer{ServerStream: stream})
}
type S2AService_SetUpSessionServer interface {
diff --git a/vendor/github.com/google/s2a-go/internal/proto/v2/common_go_proto/common.pb.go b/vendor/github.com/google/s2a-go/internal/proto/v2/common_go_proto/common.pb.go
index c84bed97..e9aa5d14 100644
--- a/vendor/github.com/google/s2a-go/internal/proto/v2/common_go_proto/common.pb.go
+++ b/vendor/github.com/google/s2a-go/internal/proto/v2/common_go_proto/common.pb.go
@@ -14,7 +14,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
-// protoc-gen-go v1.30.0
+// protoc-gen-go v1.34.2
// protoc v3.21.12
// source: internal/proto/v2/common/common.proto
@@ -256,62 +256,218 @@ func (AlpnProtocol) EnumDescriptor() ([]byte, []int) {
return file_internal_proto_v2_common_common_proto_rawDescGZIP(), []int{3}
}
+type Identity struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Types that are assignable to IdentityOneof:
+ //
+ // *Identity_SpiffeId
+ // *Identity_Hostname
+ // *Identity_Uid
+ // *Identity_Username
+ // *Identity_GcpId
+ IdentityOneof isIdentity_IdentityOneof `protobuf_oneof:"identity_oneof"`
+ // Additional identity-specific attributes.
+ Attributes map[string]string `protobuf:"bytes,3,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
+}
+
+func (x *Identity) Reset() {
+ *x = Identity{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_internal_proto_v2_common_common_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *Identity) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Identity) ProtoMessage() {}
+
+func (x *Identity) ProtoReflect() protoreflect.Message {
+ mi := &file_internal_proto_v2_common_common_proto_msgTypes[0]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use Identity.ProtoReflect.Descriptor instead.
+func (*Identity) Descriptor() ([]byte, []int) {
+ return file_internal_proto_v2_common_common_proto_rawDescGZIP(), []int{0}
+}
+
+func (m *Identity) GetIdentityOneof() isIdentity_IdentityOneof {
+ if m != nil {
+ return m.IdentityOneof
+ }
+ return nil
+}
+
+func (x *Identity) GetSpiffeId() string {
+ if x, ok := x.GetIdentityOneof().(*Identity_SpiffeId); ok {
+ return x.SpiffeId
+ }
+ return ""
+}
+
+func (x *Identity) GetHostname() string {
+ if x, ok := x.GetIdentityOneof().(*Identity_Hostname); ok {
+ return x.Hostname
+ }
+ return ""
+}
+
+func (x *Identity) GetUid() string {
+ if x, ok := x.GetIdentityOneof().(*Identity_Uid); ok {
+ return x.Uid
+ }
+ return ""
+}
+
+func (x *Identity) GetUsername() string {
+ if x, ok := x.GetIdentityOneof().(*Identity_Username); ok {
+ return x.Username
+ }
+ return ""
+}
+
+func (x *Identity) GetGcpId() string {
+ if x, ok := x.GetIdentityOneof().(*Identity_GcpId); ok {
+ return x.GcpId
+ }
+ return ""
+}
+
+func (x *Identity) GetAttributes() map[string]string {
+ if x != nil {
+ return x.Attributes
+ }
+ return nil
+}
+
+type isIdentity_IdentityOneof interface {
+ isIdentity_IdentityOneof()
+}
+
+type Identity_SpiffeId struct {
+ // The SPIFFE ID of a connection endpoint.
+ SpiffeId string `protobuf:"bytes,1,opt,name=spiffe_id,json=spiffeId,proto3,oneof"`
+}
+
+type Identity_Hostname struct {
+ // The hostname of a connection endpoint.
+ Hostname string `protobuf:"bytes,2,opt,name=hostname,proto3,oneof"`
+}
+
+type Identity_Uid struct {
+ // The UID of a connection endpoint.
+ Uid string `protobuf:"bytes,4,opt,name=uid,proto3,oneof"`
+}
+
+type Identity_Username struct {
+ // The username of a connection endpoint.
+ Username string `protobuf:"bytes,5,opt,name=username,proto3,oneof"`
+}
+
+type Identity_GcpId struct {
+ // The GCP ID of a connection endpoint.
+ GcpId string `protobuf:"bytes,6,opt,name=gcp_id,json=gcpId,proto3,oneof"`
+}
+
+func (*Identity_SpiffeId) isIdentity_IdentityOneof() {}
+
+func (*Identity_Hostname) isIdentity_IdentityOneof() {}
+
+func (*Identity_Uid) isIdentity_IdentityOneof() {}
+
+func (*Identity_Username) isIdentity_IdentityOneof() {}
+
+func (*Identity_GcpId) isIdentity_IdentityOneof() {}
+
var File_internal_proto_v2_common_common_proto protoreflect.FileDescriptor
var file_internal_proto_v2_common_common_proto_rawDesc = []byte{
0x0a, 0x25, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f,
0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2a, 0xee, 0x02, 0x0a, 0x0b, 0x43, 0x69, 0x70, 0x68, 0x65, 0x72,
- 0x73, 0x75, 0x69, 0x74, 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x43, 0x49, 0x50, 0x48, 0x45, 0x52, 0x53,
- 0x55, 0x49, 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44,
- 0x10, 0x00, 0x12, 0x33, 0x0a, 0x2f, 0x43, 0x49, 0x50, 0x48, 0x45, 0x52, 0x53, 0x55, 0x49, 0x54,
- 0x45, 0x5f, 0x45, 0x43, 0x44, 0x48, 0x45, 0x5f, 0x45, 0x43, 0x44, 0x53, 0x41, 0x5f, 0x57, 0x49,
- 0x54, 0x48, 0x5f, 0x41, 0x45, 0x53, 0x5f, 0x31, 0x32, 0x38, 0x5f, 0x47, 0x43, 0x4d, 0x5f, 0x53,
- 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x01, 0x12, 0x33, 0x0a, 0x2f, 0x43, 0x49, 0x50, 0x48, 0x45,
- 0x52, 0x53, 0x55, 0x49, 0x54, 0x45, 0x5f, 0x45, 0x43, 0x44, 0x48, 0x45, 0x5f, 0x45, 0x43, 0x44,
- 0x53, 0x41, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x41, 0x45, 0x53, 0x5f, 0x32, 0x35, 0x36, 0x5f,
- 0x47, 0x43, 0x4d, 0x5f, 0x53, 0x48, 0x41, 0x33, 0x38, 0x34, 0x10, 0x02, 0x12, 0x39, 0x0a, 0x35,
- 0x43, 0x49, 0x50, 0x48, 0x45, 0x52, 0x53, 0x55, 0x49, 0x54, 0x45, 0x5f, 0x45, 0x43, 0x44, 0x48,
- 0x45, 0x5f, 0x45, 0x43, 0x44, 0x53, 0x41, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x43, 0x48, 0x41,
- 0x43, 0x48, 0x41, 0x32, 0x30, 0x5f, 0x50, 0x4f, 0x4c, 0x59, 0x31, 0x33, 0x30, 0x35, 0x5f, 0x53,
- 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x03, 0x12, 0x31, 0x0a, 0x2d, 0x43, 0x49, 0x50, 0x48, 0x45,
- 0x52, 0x53, 0x55, 0x49, 0x54, 0x45, 0x5f, 0x45, 0x43, 0x44, 0x48, 0x45, 0x5f, 0x52, 0x53, 0x41,
- 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x41, 0x45, 0x53, 0x5f, 0x31, 0x32, 0x38, 0x5f, 0x47, 0x43,
- 0x4d, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x04, 0x12, 0x31, 0x0a, 0x2d, 0x43, 0x49,
+ 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x22, 0xab, 0x02, 0x0a, 0x08, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69,
+ 0x74, 0x79, 0x12, 0x1d, 0x0a, 0x09, 0x73, 0x70, 0x69, 0x66, 0x66, 0x65, 0x5f, 0x69, 0x64, 0x18,
+ 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x73, 0x70, 0x69, 0x66, 0x66, 0x65, 0x49,
+ 0x64, 0x12, 0x1c, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20,
+ 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12,
+ 0x12, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x03,
+ 0x75, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18,
+ 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d,
+ 0x65, 0x12, 0x17, 0x0a, 0x06, 0x67, 0x63, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28,
+ 0x09, 0x48, 0x00, 0x52, 0x05, 0x67, 0x63, 0x70, 0x49, 0x64, 0x12, 0x46, 0x0a, 0x0a, 0x61, 0x74,
+ 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26,
+ 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x64,
+ 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65,
+ 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74,
+ 0x65, 0x73, 0x1a, 0x3d, 0x0a, 0x0f, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73,
+ 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01,
+ 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
+ 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38,
+ 0x01, 0x42, 0x10, 0x0a, 0x0e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x6f, 0x6e,
+ 0x65, 0x6f, 0x66, 0x2a, 0xee, 0x02, 0x0a, 0x0b, 0x43, 0x69, 0x70, 0x68, 0x65, 0x72, 0x73, 0x75,
+ 0x69, 0x74, 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x43, 0x49, 0x50, 0x48, 0x45, 0x52, 0x53, 0x55, 0x49,
+ 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00,
+ 0x12, 0x33, 0x0a, 0x2f, 0x43, 0x49, 0x50, 0x48, 0x45, 0x52, 0x53, 0x55, 0x49, 0x54, 0x45, 0x5f,
+ 0x45, 0x43, 0x44, 0x48, 0x45, 0x5f, 0x45, 0x43, 0x44, 0x53, 0x41, 0x5f, 0x57, 0x49, 0x54, 0x48,
+ 0x5f, 0x41, 0x45, 0x53, 0x5f, 0x31, 0x32, 0x38, 0x5f, 0x47, 0x43, 0x4d, 0x5f, 0x53, 0x48, 0x41,
+ 0x32, 0x35, 0x36, 0x10, 0x01, 0x12, 0x33, 0x0a, 0x2f, 0x43, 0x49, 0x50, 0x48, 0x45, 0x52, 0x53,
+ 0x55, 0x49, 0x54, 0x45, 0x5f, 0x45, 0x43, 0x44, 0x48, 0x45, 0x5f, 0x45, 0x43, 0x44, 0x53, 0x41,
+ 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x41, 0x45, 0x53, 0x5f, 0x32, 0x35, 0x36, 0x5f, 0x47, 0x43,
+ 0x4d, 0x5f, 0x53, 0x48, 0x41, 0x33, 0x38, 0x34, 0x10, 0x02, 0x12, 0x39, 0x0a, 0x35, 0x43, 0x49,
0x50, 0x48, 0x45, 0x52, 0x53, 0x55, 0x49, 0x54, 0x45, 0x5f, 0x45, 0x43, 0x44, 0x48, 0x45, 0x5f,
- 0x52, 0x53, 0x41, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x41, 0x45, 0x53, 0x5f, 0x32, 0x35, 0x36,
- 0x5f, 0x47, 0x43, 0x4d, 0x5f, 0x53, 0x48, 0x41, 0x33, 0x38, 0x34, 0x10, 0x05, 0x12, 0x37, 0x0a,
- 0x33, 0x43, 0x49, 0x50, 0x48, 0x45, 0x52, 0x53, 0x55, 0x49, 0x54, 0x45, 0x5f, 0x45, 0x43, 0x44,
- 0x48, 0x45, 0x5f, 0x52, 0x53, 0x41, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x43, 0x48, 0x41, 0x43,
- 0x48, 0x41, 0x32, 0x30, 0x5f, 0x50, 0x4f, 0x4c, 0x59, 0x31, 0x33, 0x30, 0x35, 0x5f, 0x53, 0x48,
- 0x41, 0x32, 0x35, 0x36, 0x10, 0x06, 0x2a, 0x7d, 0x0a, 0x0a, 0x54, 0x4c, 0x53, 0x56, 0x65, 0x72,
- 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x17, 0x54, 0x4c, 0x53, 0x5f, 0x56, 0x45, 0x52, 0x53,
- 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10,
- 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x54, 0x4c, 0x53, 0x5f, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e,
- 0x5f, 0x31, 0x5f, 0x30, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x54, 0x4c, 0x53, 0x5f, 0x56, 0x45,
- 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x31, 0x5f, 0x31, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x54,
- 0x4c, 0x53, 0x5f, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x31, 0x5f, 0x32, 0x10, 0x03,
- 0x12, 0x13, 0x0a, 0x0f, 0x54, 0x4c, 0x53, 0x5f, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x5f,
- 0x31, 0x5f, 0x33, 0x10, 0x04, 0x2a, 0x69, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74,
- 0x69, 0x6f, 0x6e, 0x53, 0x69, 0x64, 0x65, 0x12, 0x1f, 0x0a, 0x1b, 0x43, 0x4f, 0x4e, 0x4e, 0x45,
- 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x49, 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45,
- 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1a, 0x0a, 0x16, 0x43, 0x4f, 0x4e, 0x4e,
- 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x49, 0x44, 0x45, 0x5f, 0x43, 0x4c, 0x49, 0x45,
- 0x4e, 0x54, 0x10, 0x01, 0x12, 0x1a, 0x0a, 0x16, 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, 0x54, 0x49,
- 0x4f, 0x4e, 0x5f, 0x53, 0x49, 0x44, 0x45, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x45, 0x52, 0x10, 0x02,
- 0x2a, 0x79, 0x0a, 0x0c, 0x41, 0x6c, 0x70, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c,
- 0x12, 0x1d, 0x0a, 0x19, 0x41, 0x4c, 0x50, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x43, 0x4f,
- 0x4c, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12,
- 0x16, 0x0a, 0x12, 0x41, 0x4c, 0x50, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x43, 0x4f, 0x4c,
- 0x5f, 0x47, 0x52, 0x50, 0x43, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x41, 0x4c, 0x50, 0x4e, 0x5f,
- 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x43, 0x4f, 0x4c, 0x5f, 0x48, 0x54, 0x54, 0x50, 0x32, 0x10, 0x02,
- 0x12, 0x19, 0x0a, 0x15, 0x41, 0x4c, 0x50, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x43, 0x4f,
- 0x4c, 0x5f, 0x48, 0x54, 0x54, 0x50, 0x31, 0x5f, 0x31, 0x10, 0x03, 0x42, 0x39, 0x5a, 0x37, 0x67,
- 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
- 0x2f, 0x73, 0x32, 0x61, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x67, 0x6f,
- 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x45, 0x43, 0x44, 0x53, 0x41, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x43, 0x48, 0x41, 0x43, 0x48,
+ 0x41, 0x32, 0x30, 0x5f, 0x50, 0x4f, 0x4c, 0x59, 0x31, 0x33, 0x30, 0x35, 0x5f, 0x53, 0x48, 0x41,
+ 0x32, 0x35, 0x36, 0x10, 0x03, 0x12, 0x31, 0x0a, 0x2d, 0x43, 0x49, 0x50, 0x48, 0x45, 0x52, 0x53,
+ 0x55, 0x49, 0x54, 0x45, 0x5f, 0x45, 0x43, 0x44, 0x48, 0x45, 0x5f, 0x52, 0x53, 0x41, 0x5f, 0x57,
+ 0x49, 0x54, 0x48, 0x5f, 0x41, 0x45, 0x53, 0x5f, 0x31, 0x32, 0x38, 0x5f, 0x47, 0x43, 0x4d, 0x5f,
+ 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x04, 0x12, 0x31, 0x0a, 0x2d, 0x43, 0x49, 0x50, 0x48,
+ 0x45, 0x52, 0x53, 0x55, 0x49, 0x54, 0x45, 0x5f, 0x45, 0x43, 0x44, 0x48, 0x45, 0x5f, 0x52, 0x53,
+ 0x41, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x41, 0x45, 0x53, 0x5f, 0x32, 0x35, 0x36, 0x5f, 0x47,
+ 0x43, 0x4d, 0x5f, 0x53, 0x48, 0x41, 0x33, 0x38, 0x34, 0x10, 0x05, 0x12, 0x37, 0x0a, 0x33, 0x43,
+ 0x49, 0x50, 0x48, 0x45, 0x52, 0x53, 0x55, 0x49, 0x54, 0x45, 0x5f, 0x45, 0x43, 0x44, 0x48, 0x45,
+ 0x5f, 0x52, 0x53, 0x41, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x43, 0x48, 0x41, 0x43, 0x48, 0x41,
+ 0x32, 0x30, 0x5f, 0x50, 0x4f, 0x4c, 0x59, 0x31, 0x33, 0x30, 0x35, 0x5f, 0x53, 0x48, 0x41, 0x32,
+ 0x35, 0x36, 0x10, 0x06, 0x2a, 0x7d, 0x0a, 0x0a, 0x54, 0x4c, 0x53, 0x56, 0x65, 0x72, 0x73, 0x69,
+ 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x17, 0x54, 0x4c, 0x53, 0x5f, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f,
+ 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12,
+ 0x13, 0x0a, 0x0f, 0x54, 0x4c, 0x53, 0x5f, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x31,
+ 0x5f, 0x30, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x54, 0x4c, 0x53, 0x5f, 0x56, 0x45, 0x52, 0x53,
+ 0x49, 0x4f, 0x4e, 0x5f, 0x31, 0x5f, 0x31, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x54, 0x4c, 0x53,
+ 0x5f, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x31, 0x5f, 0x32, 0x10, 0x03, 0x12, 0x13,
+ 0x0a, 0x0f, 0x54, 0x4c, 0x53, 0x5f, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x31, 0x5f,
+ 0x33, 0x10, 0x04, 0x2a, 0x69, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x53, 0x69, 0x64, 0x65, 0x12, 0x1f, 0x0a, 0x1b, 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, 0x54,
+ 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x49, 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49,
+ 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1a, 0x0a, 0x16, 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43,
+ 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x49, 0x44, 0x45, 0x5f, 0x43, 0x4c, 0x49, 0x45, 0x4e, 0x54,
+ 0x10, 0x01, 0x12, 0x1a, 0x0a, 0x16, 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e,
+ 0x5f, 0x53, 0x49, 0x44, 0x45, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x45, 0x52, 0x10, 0x02, 0x2a, 0x79,
+ 0x0a, 0x0c, 0x41, 0x6c, 0x70, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x1d,
+ 0x0a, 0x19, 0x41, 0x4c, 0x50, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x43, 0x4f, 0x4c, 0x5f,
+ 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x16, 0x0a,
+ 0x12, 0x41, 0x4c, 0x50, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x43, 0x4f, 0x4c, 0x5f, 0x47,
+ 0x52, 0x50, 0x43, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x41, 0x4c, 0x50, 0x4e, 0x5f, 0x50, 0x52,
+ 0x4f, 0x54, 0x4f, 0x43, 0x4f, 0x4c, 0x5f, 0x48, 0x54, 0x54, 0x50, 0x32, 0x10, 0x02, 0x12, 0x19,
+ 0x0a, 0x15, 0x41, 0x4c, 0x50, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x43, 0x4f, 0x4c, 0x5f,
+ 0x48, 0x54, 0x54, 0x50, 0x31, 0x5f, 0x31, 0x10, 0x03, 0x42, 0x39, 0x5a, 0x37, 0x67, 0x69, 0x74,
+ 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x73,
+ 0x32, 0x61, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74,
+ 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x67, 0x6f, 0x5f, 0x70,
+ 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -327,18 +483,22 @@ func file_internal_proto_v2_common_common_proto_rawDescGZIP() []byte {
}
var file_internal_proto_v2_common_common_proto_enumTypes = make([]protoimpl.EnumInfo, 4)
-var file_internal_proto_v2_common_common_proto_goTypes = []interface{}{
+var file_internal_proto_v2_common_common_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
+var file_internal_proto_v2_common_common_proto_goTypes = []any{
(Ciphersuite)(0), // 0: s2a.proto.v2.Ciphersuite
(TLSVersion)(0), // 1: s2a.proto.v2.TLSVersion
(ConnectionSide)(0), // 2: s2a.proto.v2.ConnectionSide
(AlpnProtocol)(0), // 3: s2a.proto.v2.AlpnProtocol
+ (*Identity)(nil), // 4: s2a.proto.v2.Identity
+ nil, // 5: s2a.proto.v2.Identity.AttributesEntry
}
var file_internal_proto_v2_common_common_proto_depIdxs = []int32{
- 0, // [0:0] is the sub-list for method output_type
- 0, // [0:0] is the sub-list for method input_type
- 0, // [0:0] is the sub-list for extension type_name
- 0, // [0:0] is the sub-list for extension extendee
- 0, // [0:0] is the sub-list for field type_name
+ 5, // 0: s2a.proto.v2.Identity.attributes:type_name -> s2a.proto.v2.Identity.AttributesEntry
+ 1, // [1:1] is the sub-list for method output_type
+ 1, // [1:1] is the sub-list for method input_type
+ 1, // [1:1] is the sub-list for extension type_name
+ 1, // [1:1] is the sub-list for extension extendee
+ 0, // [0:1] is the sub-list for field type_name
}
func init() { file_internal_proto_v2_common_common_proto_init() }
@@ -346,19 +506,41 @@ func file_internal_proto_v2_common_common_proto_init() {
if File_internal_proto_v2_common_common_proto != nil {
return
}
+ if !protoimpl.UnsafeEnabled {
+ file_internal_proto_v2_common_common_proto_msgTypes[0].Exporter = func(v any, i int) any {
+ switch v := v.(*Identity); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ }
+ file_internal_proto_v2_common_common_proto_msgTypes[0].OneofWrappers = []any{
+ (*Identity_SpiffeId)(nil),
+ (*Identity_Hostname)(nil),
+ (*Identity_Uid)(nil),
+ (*Identity_Username)(nil),
+ (*Identity_GcpId)(nil),
+ }
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_internal_proto_v2_common_common_proto_rawDesc,
NumEnums: 4,
- NumMessages: 0,
+ NumMessages: 2,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_internal_proto_v2_common_common_proto_goTypes,
DependencyIndexes: file_internal_proto_v2_common_common_proto_depIdxs,
EnumInfos: file_internal_proto_v2_common_common_proto_enumTypes,
+ MessageInfos: file_internal_proto_v2_common_common_proto_msgTypes,
}.Build()
File_internal_proto_v2_common_common_proto = out.File
file_internal_proto_v2_common_common_proto_rawDesc = nil
diff --git a/vendor/github.com/google/s2a-go/internal/proto/v2/s2a_context_go_proto/s2a_context.pb.go b/vendor/github.com/google/s2a-go/internal/proto/v2/s2a_context_go_proto/s2a_context.pb.go
index b7fd871c..418331a4 100644
--- a/vendor/github.com/google/s2a-go/internal/proto/v2/s2a_context_go_proto/s2a_context.pb.go
+++ b/vendor/github.com/google/s2a-go/internal/proto/v2/s2a_context_go_proto/s2a_context.pb.go
@@ -14,14 +14,14 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
-// protoc-gen-go v1.30.0
+// protoc-gen-go v1.34.2
// protoc v3.21.12
// source: internal/proto/v2/s2a_context/s2a_context.proto
package s2a_context_go_proto
import (
- common_go_proto "github.com/google/s2a-go/internal/proto/common_go_proto"
+ common_go_proto "github.com/google/s2a-go/internal/proto/v2/common_go_proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
@@ -64,7 +64,7 @@ type S2AContext struct {
// certificate chain was NOT validated successfully.
PeerCertificateChainFingerprints []string `protobuf:"bytes,4,rep,name=peer_certificate_chain_fingerprints,json=peerCertificateChainFingerprints,proto3" json:"peer_certificate_chain_fingerprints,omitempty"`
// The local identity used during session setup.
- LocalIdentity *common_go_proto.Identity `protobuf:"bytes,5,opt,name=local_identity,json=localIdentity,proto3" json:"local_identity,omitempty"`
+ LocalIdentity *common_go_proto.Identity `protobuf:"bytes,9,opt,name=local_identity,json=localIdentity,proto3" json:"local_identity,omitempty"`
// The SHA256 hash of the DER-encoding of the local leaf certificate used in
// the handshake.
LocalLeafCertFingerprint []byte `protobuf:"bytes,6,opt,name=local_leaf_cert_fingerprint,json=localLeafCertFingerprint,proto3" json:"local_leaf_cert_fingerprint,omitempty"`
@@ -151,35 +151,36 @@ var file_internal_proto_v2_s2a_context_s2a_context_proto_rawDesc = []byte{
0x2f, 0x76, 0x32, 0x2f, 0x73, 0x32, 0x61, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2f,
0x73, 0x32, 0x61, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x12, 0x0c, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x1a,
- 0x22, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f,
- 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x22, 0xd9, 0x02, 0x0a, 0x0a, 0x53, 0x32, 0x41, 0x43, 0x6f, 0x6e, 0x74, 0x65,
- 0x78, 0x74, 0x12, 0x2d, 0x0a, 0x13, 0x6c, 0x65, 0x61, 0x66, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x5f,
- 0x73, 0x70, 0x69, 0x66, 0x66, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
- 0x10, 0x6c, 0x65, 0x61, 0x66, 0x43, 0x65, 0x72, 0x74, 0x53, 0x70, 0x69, 0x66, 0x66, 0x65, 0x49,
- 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x6c, 0x65, 0x61, 0x66, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x5f, 0x75,
- 0x72, 0x69, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x6c, 0x65, 0x61, 0x66, 0x43,
- 0x65, 0x72, 0x74, 0x55, 0x72, 0x69, 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x6c, 0x65, 0x61, 0x66, 0x5f,
- 0x63, 0x65, 0x72, 0x74, 0x5f, 0x64, 0x6e, 0x73, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x03, 0x20,
- 0x03, 0x28, 0x09, 0x52, 0x10, 0x6c, 0x65, 0x61, 0x66, 0x43, 0x65, 0x72, 0x74, 0x44, 0x6e, 0x73,
- 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x4d, 0x0a, 0x23, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x63, 0x65,
- 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f,
- 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03,
- 0x28, 0x09, 0x52, 0x20, 0x70, 0x65, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63,
- 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72,
- 0x69, 0x6e, 0x74, 0x73, 0x12, 0x3a, 0x0a, 0x0e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x69, 0x64,
- 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x73,
- 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74,
- 0x79, 0x52, 0x0d, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79,
- 0x12, 0x3d, 0x0a, 0x1b, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x6c, 0x65, 0x61, 0x66, 0x5f, 0x63,
- 0x65, 0x72, 0x74, 0x5f, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x18,
- 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x18, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x4c, 0x65, 0x61, 0x66,
- 0x43, 0x65, 0x72, 0x74, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x42,
- 0x3e, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f,
- 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x73, 0x32, 0x61, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61,
- 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x32, 0x61, 0x5f, 0x63,
- 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x67, 0x6f, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
- 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x25, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f,
+ 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e,
+ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xee, 0x02, 0x0a, 0x0a, 0x53, 0x32, 0x41, 0x43, 0x6f,
+ 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x2d, 0x0a, 0x13, 0x6c, 0x65, 0x61, 0x66, 0x5f, 0x63, 0x65,
+ 0x72, 0x74, 0x5f, 0x73, 0x70, 0x69, 0x66, 0x66, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
+ 0x28, 0x09, 0x52, 0x10, 0x6c, 0x65, 0x61, 0x66, 0x43, 0x65, 0x72, 0x74, 0x53, 0x70, 0x69, 0x66,
+ 0x66, 0x65, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x6c, 0x65, 0x61, 0x66, 0x5f, 0x63, 0x65, 0x72,
+ 0x74, 0x5f, 0x75, 0x72, 0x69, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x6c, 0x65,
+ 0x61, 0x66, 0x43, 0x65, 0x72, 0x74, 0x55, 0x72, 0x69, 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x6c, 0x65,
+ 0x61, 0x66, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x5f, 0x64, 0x6e, 0x73, 0x6e, 0x61, 0x6d, 0x65, 0x73,
+ 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x6c, 0x65, 0x61, 0x66, 0x43, 0x65, 0x72, 0x74,
+ 0x44, 0x6e, 0x73, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x4d, 0x0a, 0x23, 0x70, 0x65, 0x65, 0x72,
+ 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61,
+ 0x69, 0x6e, 0x5f, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x73, 0x18,
+ 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x20, 0x70, 0x65, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69,
+ 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x46, 0x69, 0x6e, 0x67, 0x65,
+ 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x3d, 0x0a, 0x0e, 0x6c, 0x6f, 0x63, 0x61, 0x6c,
+ 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32,
+ 0x16, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x49,
+ 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x0d, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x49, 0x64,
+ 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x3d, 0x0a, 0x1b, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f,
+ 0x6c, 0x65, 0x61, 0x66, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x5f, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72,
+ 0x70, 0x72, 0x69, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x18, 0x6c, 0x6f, 0x63,
+ 0x61, 0x6c, 0x4c, 0x65, 0x61, 0x66, 0x43, 0x65, 0x72, 0x74, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72,
+ 0x70, 0x72, 0x69, 0x6e, 0x74, 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x4a, 0x04, 0x08, 0x07, 0x10,
+ 0x08, 0x4a, 0x04, 0x08, 0x08, 0x10, 0x09, 0x42, 0x3e, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x68, 0x75,
+ 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x73, 0x32, 0x61,
+ 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f,
+ 0x76, 0x32, 0x2f, 0x73, 0x32, 0x61, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x67,
+ 0x6f, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -195,12 +196,12 @@ func file_internal_proto_v2_s2a_context_s2a_context_proto_rawDescGZIP() []byte {
}
var file_internal_proto_v2_s2a_context_s2a_context_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
-var file_internal_proto_v2_s2a_context_s2a_context_proto_goTypes = []interface{}{
+var file_internal_proto_v2_s2a_context_s2a_context_proto_goTypes = []any{
(*S2AContext)(nil), // 0: s2a.proto.v2.S2AContext
- (*common_go_proto.Identity)(nil), // 1: s2a.proto.Identity
+ (*common_go_proto.Identity)(nil), // 1: s2a.proto.v2.Identity
}
var file_internal_proto_v2_s2a_context_s2a_context_proto_depIdxs = []int32{
- 1, // 0: s2a.proto.v2.S2AContext.local_identity:type_name -> s2a.proto.Identity
+ 1, // 0: s2a.proto.v2.S2AContext.local_identity:type_name -> s2a.proto.v2.Identity
1, // [1:1] is the sub-list for method output_type
1, // [1:1] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
@@ -214,7 +215,7 @@ func file_internal_proto_v2_s2a_context_s2a_context_proto_init() {
return
}
if !protoimpl.UnsafeEnabled {
- file_internal_proto_v2_s2a_context_s2a_context_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_v2_s2a_context_s2a_context_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*S2AContext); i {
case 0:
return &v.state
diff --git a/vendor/github.com/google/s2a-go/internal/proto/v2/s2a_go_proto/s2a.pb.go b/vendor/github.com/google/s2a-go/internal/proto/v2/s2a_go_proto/s2a.pb.go
index e843450c..548f31da 100644
--- a/vendor/github.com/google/s2a-go/internal/proto/v2/s2a_go_proto/s2a.pb.go
+++ b/vendor/github.com/google/s2a-go/internal/proto/v2/s2a_go_proto/s2a.pb.go
@@ -14,14 +14,13 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
-// protoc-gen-go v1.30.0
+// protoc-gen-go v1.34.2
// protoc v3.21.12
// source: internal/proto/v2/s2a/s2a.proto
package s2a_go_proto
import (
- common_go_proto1 "github.com/google/s2a-go/internal/proto/common_go_proto"
common_go_proto "github.com/google/s2a-go/internal/proto/v2/common_go_proto"
s2a_context_go_proto "github.com/google/s2a-go/internal/proto/v2/s2a_context_go_proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
@@ -292,6 +291,12 @@ const (
// The connect-to-Google verification mode uses the trust bundle for
// connecting to Google, e.g. *.mtls.googleapis.com endpoints.
ValidatePeerCertificateChainReq_CONNECT_TO_GOOGLE ValidatePeerCertificateChainReq_VerificationMode = 2
+ // Internal use only.
+ ValidatePeerCertificateChainReq_RESERVED_CUSTOM_VERIFICATION_MODE_3 ValidatePeerCertificateChainReq_VerificationMode = 3
+ // Internal use only.
+ ValidatePeerCertificateChainReq_RESERVED_CUSTOM_VERIFICATION_MODE_4 ValidatePeerCertificateChainReq_VerificationMode = 4
+ // Internal use only.
+ ValidatePeerCertificateChainReq_RESERVED_CUSTOM_VERIFICATION_MODE_5 ValidatePeerCertificateChainReq_VerificationMode = 5
)
// Enum value maps for ValidatePeerCertificateChainReq_VerificationMode.
@@ -300,11 +305,17 @@ var (
0: "UNSPECIFIED",
1: "SPIFFE",
2: "CONNECT_TO_GOOGLE",
+ 3: "RESERVED_CUSTOM_VERIFICATION_MODE_3",
+ 4: "RESERVED_CUSTOM_VERIFICATION_MODE_4",
+ 5: "RESERVED_CUSTOM_VERIFICATION_MODE_5",
}
ValidatePeerCertificateChainReq_VerificationMode_value = map[string]int32{
- "UNSPECIFIED": 0,
- "SPIFFE": 1,
- "CONNECT_TO_GOOGLE": 2,
+ "UNSPECIFIED": 0,
+ "SPIFFE": 1,
+ "CONNECT_TO_GOOGLE": 2,
+ "RESERVED_CUSTOM_VERIFICATION_MODE_3": 3,
+ "RESERVED_CUSTOM_VERIFICATION_MODE_4": 4,
+ "RESERVED_CUSTOM_VERIFICATION_MODE_5": 5,
}
)
@@ -454,7 +465,7 @@ type AuthenticationMechanism struct {
// mechanism. Otherwise, S2A assumes that the authentication mechanism is
// associated with the default identity. If the default identity cannot be
// determined, the request is rejected.
- Identity *common_go_proto1.Identity `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"`
+ Identity *common_go_proto.Identity `protobuf:"bytes,3,opt,name=identity,proto3" json:"identity,omitempty"`
// Types that are assignable to MechanismOneof:
//
// *AuthenticationMechanism_Token
@@ -493,7 +504,7 @@ func (*AuthenticationMechanism) Descriptor() ([]byte, []int) {
return file_internal_proto_v2_s2a_s2a_proto_rawDescGZIP(), []int{1}
}
-func (x *AuthenticationMechanism) GetIdentity() *common_go_proto1.Identity {
+func (x *AuthenticationMechanism) GetIdentity() *common_go_proto.Identity {
if x != nil {
return x.Identity
}
@@ -1185,7 +1196,7 @@ type SessionReq struct {
// identity is not populated, S2A will try to deduce the managed identity to
// use from the SNI extension. If that also fails, S2A uses the default
// identity (if one exists).
- LocalIdentity *common_go_proto1.Identity `protobuf:"bytes,1,opt,name=local_identity,json=localIdentity,proto3" json:"local_identity,omitempty"`
+ LocalIdentity *common_go_proto.Identity `protobuf:"bytes,7,opt,name=local_identity,json=localIdentity,proto3" json:"local_identity,omitempty"`
// The authentication mechanisms that the application wishes to use to
// authenticate to S2A, ordered by preference. S2A will always use the first
// authentication mechanism that matches the managed identity.
@@ -1231,7 +1242,7 @@ func (*SessionReq) Descriptor() ([]byte, []int) {
return file_internal_proto_v2_s2a_s2a_proto_rawDescGZIP(), []int{11}
}
-func (x *SessionReq) GetLocalIdentity() *common_go_proto1.Identity {
+func (x *SessionReq) GetLocalIdentity() *common_go_proto.Identity {
if x != nil {
return x.LocalIdentity
}
@@ -1790,358 +1801,365 @@ var file_internal_proto_v2_s2a_s2a_proto_rawDesc = []byte{
0x0a, 0x1f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x2f, 0x76, 0x32, 0x2f, 0x73, 0x32, 0x61, 0x2f, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x12, 0x0c, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x1a,
- 0x22, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f,
- 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x1a, 0x25, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f,
- 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2f, 0x69, 0x6e, 0x74, 0x65,
- 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x32,
- 0x61, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x73, 0x32, 0x61, 0x5f, 0x63, 0x6f,
- 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x87, 0x01, 0x0a, 0x0a,
- 0x41, 0x6c, 0x70, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x36, 0x0a, 0x17, 0x65, 0x6e,
- 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x6c, 0x70, 0x6e, 0x5f, 0x6e, 0x65, 0x67, 0x6f, 0x74, 0x69,
- 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x65, 0x6e, 0x61,
- 0x62, 0x6c, 0x65, 0x41, 0x6c, 0x70, 0x6e, 0x4e, 0x65, 0x67, 0x6f, 0x74, 0x69, 0x61, 0x74, 0x69,
- 0x6f, 0x6e, 0x12, 0x41, 0x0a, 0x0e, 0x61, 0x6c, 0x70, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x63, 0x6f, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x73, 0x32, 0x61,
- 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6c, 0x70, 0x6e, 0x50, 0x72,
- 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x52, 0x0d, 0x61, 0x6c, 0x70, 0x6e, 0x50, 0x72, 0x6f, 0x74,
- 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x22, 0x75, 0x0a, 0x17, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74,
- 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x63, 0x68, 0x61, 0x6e, 0x69, 0x73, 0x6d,
- 0x12, 0x2f, 0x0a, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01,
- 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x49,
- 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74,
- 0x79, 0x12, 0x16, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
- 0x48, 0x00, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x11, 0x0a, 0x0f, 0x6d, 0x65, 0x63,
- 0x68, 0x61, 0x6e, 0x69, 0x73, 0x6d, 0x5f, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x22, 0x36, 0x0a, 0x06,
- 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01,
- 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65,
- 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x74,
- 0x61, 0x69, 0x6c, 0x73, 0x22, 0x71, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f,
- 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x45,
- 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x69, 0x64,
- 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f,
- 0x6e, 0x53, 0x69, 0x64, 0x65, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f,
- 0x6e, 0x53, 0x69, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x6e, 0x69, 0x18, 0x02, 0x20, 0x01,
- 0x28, 0x09, 0x52, 0x03, 0x73, 0x6e, 0x69, 0x22, 0xf1, 0x0b, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x54,
- 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52,
- 0x65, 0x73, 0x70, 0x12, 0x78, 0x0a, 0x18, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x6c,
- 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18,
- 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74,
- 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69,
- 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x43, 0x6c, 0x69,
- 0x65, 0x6e, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74,
- 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x16, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x6c, 0x73,
- 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x78, 0x0a,
- 0x18, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x66,
- 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
- 0x3c, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x47,
- 0x65, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69,
- 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x54, 0x6c, 0x73,
- 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52,
- 0x16, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
- 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0xcf, 0x02, 0x0a, 0x16, 0x43, 0x6c, 0x69, 0x65,
+ 0x25, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f,
+ 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e,
+ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c,
+ 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x32, 0x61, 0x5f, 0x63, 0x6f,
+ 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x73, 0x32, 0x61, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78,
+ 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x87, 0x01, 0x0a, 0x0a, 0x41, 0x6c, 0x70, 0x6e,
+ 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x36, 0x0a, 0x17, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65,
+ 0x5f, 0x61, 0x6c, 0x70, 0x6e, 0x5f, 0x6e, 0x65, 0x67, 0x6f, 0x74, 0x69, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x41,
+ 0x6c, 0x70, 0x6e, 0x4e, 0x65, 0x67, 0x6f, 0x74, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x41,
+ 0x0a, 0x0e, 0x61, 0x6c, 0x70, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73,
+ 0x18, 0x02, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f,
+ 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6c, 0x70, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63,
+ 0x6f, 0x6c, 0x52, 0x0d, 0x61, 0x6c, 0x70, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c,
+ 0x73, 0x22, 0x7e, 0x0a, 0x17, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x63, 0x68, 0x61, 0x6e, 0x69, 0x73, 0x6d, 0x12, 0x32, 0x0a, 0x08,
+ 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16,
+ 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x64,
+ 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79,
+ 0x12, 0x16, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48,
+ 0x00, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x11, 0x0a, 0x0f, 0x6d, 0x65, 0x63, 0x68,
+ 0x61, 0x6e, 0x69, 0x73, 0x6d, 0x5f, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x4a, 0x04, 0x08, 0x01, 0x10,
+ 0x02, 0x22, 0x36, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63,
+ 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12,
+ 0x18, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
+ 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x71, 0x0a, 0x16, 0x47, 0x65, 0x74,
+ 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x52, 0x65, 0x71, 0x12, 0x45, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x5f, 0x73, 0x69, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x73,
+ 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6e, 0x6e,
+ 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x69, 0x64, 0x65, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x6e,
+ 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x69, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x6e,
+ 0x69, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x6e, 0x69, 0x22, 0xf1, 0x0b, 0x0a,
+ 0x17, 0x47, 0x65, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x78, 0x0a, 0x18, 0x63, 0x6c, 0x69, 0x65,
+ 0x6e, 0x74, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x73, 0x32, 0x61,
+ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x6c, 0x73,
+ 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73,
+ 0x70, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69,
+ 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x16, 0x63, 0x6c, 0x69, 0x65,
0x6e, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69,
- 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74,
- 0x65, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x63,
- 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x12,
- 0x40, 0x0a, 0x0f, 0x6d, 0x69, 0x6e, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69,
- 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70,
- 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x4c, 0x53, 0x56, 0x65, 0x72, 0x73, 0x69,
- 0x6f, 0x6e, 0x52, 0x0d, 0x6d, 0x69, 0x6e, 0x54, 0x6c, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f,
- 0x6e, 0x12, 0x40, 0x0a, 0x0f, 0x6d, 0x61, 0x78, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x76, 0x65, 0x72,
- 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x73, 0x32, 0x61,
- 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x4c, 0x53, 0x56, 0x65, 0x72,
- 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x6d, 0x61, 0x78, 0x54, 0x6c, 0x73, 0x56, 0x65, 0x72, 0x73,
- 0x69, 0x6f, 0x6e, 0x12, 0x3d, 0x0a, 0x0c, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x73, 0x75, 0x69,
- 0x74, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x73, 0x32, 0x61, 0x2e,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x69, 0x70, 0x68, 0x65, 0x72, 0x73,
- 0x75, 0x69, 0x74, 0x65, 0x52, 0x0c, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x73, 0x75, 0x69, 0x74,
- 0x65, 0x73, 0x12, 0x39, 0x0a, 0x0b, 0x61, 0x6c, 0x70, 0x6e, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63,
- 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6c, 0x70, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63,
- 0x79, 0x52, 0x0a, 0x61, 0x6c, 0x70, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4a, 0x04, 0x08,
- 0x04, 0x10, 0x05, 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x1a, 0xfa, 0x06, 0x0a, 0x16, 0x53, 0x65,
- 0x72, 0x76, 0x65, 0x72, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61,
- 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63,
- 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52,
- 0x10, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69,
- 0x6e, 0x12, 0x40, 0x0a, 0x0f, 0x6d, 0x69, 0x6e, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x76, 0x65, 0x72,
- 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x73, 0x32, 0x61,
- 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x4c, 0x53, 0x56, 0x65, 0x72,
- 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x6d, 0x69, 0x6e, 0x54, 0x6c, 0x73, 0x56, 0x65, 0x72, 0x73,
- 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x0f, 0x6d, 0x61, 0x78, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x76,
- 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x73,
- 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x4c, 0x53, 0x56,
- 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x6d, 0x61, 0x78, 0x54, 0x6c, 0x73, 0x56, 0x65,
- 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3d, 0x0a, 0x0c, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x73,
- 0x75, 0x69, 0x74, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x73, 0x32,
- 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x69, 0x70, 0x68, 0x65,
- 0x72, 0x73, 0x75, 0x69, 0x74, 0x65, 0x52, 0x0c, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x73, 0x75,
- 0x69, 0x74, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x16, 0x74, 0x6c, 0x73, 0x5f, 0x72, 0x65, 0x73, 0x75,
- 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x06,
- 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x74, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74,
- 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x93, 0x01, 0x0a, 0x1a, 0x72,
- 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x65,
- 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32,
- 0x55, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x47,
- 0x65, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69,
- 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x54, 0x6c, 0x73,
- 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65,
- 0x71, 0x75, 0x65, 0x73, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69,
- 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x18, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x43,
- 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65,
- 0x12, 0x3c, 0x0a, 0x1b, 0x6d, 0x61, 0x78, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x68, 0x65, 0x61, 0x64,
- 0x5f, 0x6f, 0x66, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x61, 0x65, 0x61, 0x64, 0x18,
- 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x17, 0x6d, 0x61, 0x78, 0x4f, 0x76, 0x65, 0x72, 0x68, 0x65,
- 0x61, 0x64, 0x4f, 0x66, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x41, 0x65, 0x61, 0x64, 0x12, 0x39,
- 0x0a, 0x0b, 0x61, 0x6c, 0x70, 0x6e, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x0b, 0x20,
- 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e,
- 0x76, 0x32, 0x2e, 0x41, 0x6c, 0x70, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x0a, 0x61,
- 0x6c, 0x70, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x9e, 0x02, 0x0a, 0x18, 0x52, 0x65,
- 0x71, 0x75, 0x65, 0x73, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69,
- 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43,
- 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x23, 0x0a, 0x1f, 0x44, 0x4f, 0x4e, 0x54, 0x5f,
- 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x43, 0x4c, 0x49, 0x45, 0x4e, 0x54, 0x5f, 0x43,
- 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x10, 0x01, 0x12, 0x2e, 0x0a, 0x2a,
- 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x43, 0x4c, 0x49, 0x45, 0x4e, 0x54, 0x5f, 0x43,
- 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f, 0x42, 0x55, 0x54, 0x5f, 0x44,
- 0x4f, 0x4e, 0x54, 0x5f, 0x56, 0x45, 0x52, 0x49, 0x46, 0x59, 0x10, 0x02, 0x12, 0x29, 0x0a, 0x25,
- 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x43, 0x4c, 0x49, 0x45, 0x4e, 0x54, 0x5f, 0x43,
- 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f, 0x41, 0x4e, 0x44, 0x5f, 0x56,
- 0x45, 0x52, 0x49, 0x46, 0x59, 0x10, 0x03, 0x12, 0x3a, 0x0a, 0x36, 0x52, 0x45, 0x51, 0x55, 0x45,
- 0x53, 0x54, 0x5f, 0x41, 0x4e, 0x44, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, 0x45, 0x5f, 0x43,
- 0x4c, 0x49, 0x45, 0x4e, 0x54, 0x5f, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54,
- 0x45, 0x5f, 0x42, 0x55, 0x54, 0x5f, 0x44, 0x4f, 0x4e, 0x54, 0x5f, 0x56, 0x45, 0x52, 0x49, 0x46,
- 0x59, 0x10, 0x04, 0x12, 0x35, 0x0a, 0x31, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x41,
- 0x4e, 0x44, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, 0x45, 0x5f, 0x43, 0x4c, 0x49, 0x45, 0x4e,
- 0x54, 0x5f, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f, 0x41, 0x4e,
- 0x44, 0x5f, 0x56, 0x45, 0x52, 0x49, 0x46, 0x59, 0x10, 0x05, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05,
- 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x42, 0x13, 0x0a, 0x11, 0x74, 0x6c, 0x73, 0x5f, 0x63, 0x6f,
- 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xb0, 0x03, 0x0a, 0x1d,
- 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65,
- 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x5d, 0x0a,
- 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e,
- 0x32, 0x3f, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e,
- 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65,
- 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x2e, 0x50, 0x72,
+ 0x6f, 0x6e, 0x12, 0x78, 0x0a, 0x18, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x74, 0x6c, 0x73,
+ 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02,
+ 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+ 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
+ 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x53, 0x65, 0x72, 0x76,
+ 0x65, 0x72, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x16, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x54, 0x6c, 0x73, 0x43,
+ 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0xcf, 0x02, 0x0a,
+ 0x16, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
+ 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x65, 0x72, 0x74, 0x69,
+ 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x03,
+ 0x28, 0x09, 0x52, 0x10, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43,
+ 0x68, 0x61, 0x69, 0x6e, 0x12, 0x40, 0x0a, 0x0f, 0x6d, 0x69, 0x6e, 0x5f, 0x74, 0x6c, 0x73, 0x5f,
+ 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e,
+ 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x4c, 0x53,
+ 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x6d, 0x69, 0x6e, 0x54, 0x6c, 0x73, 0x56,
+ 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x0f, 0x6d, 0x61, 0x78, 0x5f, 0x74, 0x6c,
+ 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32,
+ 0x18, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x54,
+ 0x4c, 0x53, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x6d, 0x61, 0x78, 0x54, 0x6c,
+ 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3d, 0x0a, 0x0c, 0x63, 0x69, 0x70, 0x68,
+ 0x65, 0x72, 0x73, 0x75, 0x69, 0x74, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x19,
+ 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x69,
+ 0x70, 0x68, 0x65, 0x72, 0x73, 0x75, 0x69, 0x74, 0x65, 0x52, 0x0c, 0x63, 0x69, 0x70, 0x68, 0x65,
+ 0x72, 0x73, 0x75, 0x69, 0x74, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x0b, 0x61, 0x6c, 0x70, 0x6e, 0x5f,
+ 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73,
+ 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6c, 0x70, 0x6e,
+ 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x0a, 0x61, 0x6c, 0x70, 0x6e, 0x50, 0x6f, 0x6c, 0x69,
+ 0x63, 0x79, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x1a, 0xfa,
+ 0x06, 0x0a, 0x16, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66,
+ 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x65, 0x72,
+ 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x18, 0x01,
+ 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74,
+ 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x40, 0x0a, 0x0f, 0x6d, 0x69, 0x6e, 0x5f, 0x74, 0x6c,
+ 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32,
+ 0x18, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x54,
+ 0x4c, 0x53, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x6d, 0x69, 0x6e, 0x54, 0x6c,
+ 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x0f, 0x6d, 0x61, 0x78, 0x5f,
+ 0x74, 0x6c, 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28,
+ 0x0e, 0x32, 0x18, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32,
+ 0x2e, 0x54, 0x4c, 0x53, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x6d, 0x61, 0x78,
+ 0x54, 0x6c, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3d, 0x0a, 0x0c, 0x63, 0x69,
+ 0x70, 0x68, 0x65, 0x72, 0x73, 0x75, 0x69, 0x74, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0e,
+ 0x32, 0x19, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e,
+ 0x43, 0x69, 0x70, 0x68, 0x65, 0x72, 0x73, 0x75, 0x69, 0x74, 0x65, 0x52, 0x0c, 0x63, 0x69, 0x70,
+ 0x68, 0x65, 0x72, 0x73, 0x75, 0x69, 0x74, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x16, 0x74, 0x6c, 0x73,
+ 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x61, 0x62,
+ 0x6c, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x74, 0x6c, 0x73, 0x52, 0x65,
+ 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12,
+ 0x93, 0x01, 0x0a, 0x1a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x63, 0x6c, 0x69, 0x65,
+ 0x6e, 0x74, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x07,
+ 0x20, 0x01, 0x28, 0x0e, 0x32, 0x55, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+ 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
+ 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x53, 0x65, 0x72, 0x76,
+ 0x65, 0x72, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74,
+ 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x18, 0x72, 0x65, 0x71,
+ 0x75, 0x65, 0x73, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66,
+ 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x3c, 0x0a, 0x1b, 0x6d, 0x61, 0x78, 0x5f, 0x6f, 0x76, 0x65,
+ 0x72, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x6f, 0x66, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x5f,
+ 0x61, 0x65, 0x61, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x17, 0x6d, 0x61, 0x78, 0x4f,
+ 0x76, 0x65, 0x72, 0x68, 0x65, 0x61, 0x64, 0x4f, 0x66, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x41,
+ 0x65, 0x61, 0x64, 0x12, 0x39, 0x0a, 0x0b, 0x61, 0x6c, 0x70, 0x6e, 0x5f, 0x70, 0x6f, 0x6c, 0x69,
+ 0x63, 0x79, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70,
+ 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6c, 0x70, 0x6e, 0x50, 0x6f, 0x6c, 0x69,
+ 0x63, 0x79, 0x52, 0x0a, 0x61, 0x6c, 0x70, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x9e,
+ 0x02, 0x0a, 0x18, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74,
+ 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x55,
+ 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x23, 0x0a, 0x1f,
+ 0x44, 0x4f, 0x4e, 0x54, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x43, 0x4c, 0x49,
+ 0x45, 0x4e, 0x54, 0x5f, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x10,
+ 0x01, 0x12, 0x2e, 0x0a, 0x2a, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x43, 0x4c, 0x49,
+ 0x45, 0x4e, 0x54, 0x5f, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f,
+ 0x42, 0x55, 0x54, 0x5f, 0x44, 0x4f, 0x4e, 0x54, 0x5f, 0x56, 0x45, 0x52, 0x49, 0x46, 0x59, 0x10,
+ 0x02, 0x12, 0x29, 0x0a, 0x25, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x43, 0x4c, 0x49,
+ 0x45, 0x4e, 0x54, 0x5f, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f,
+ 0x41, 0x4e, 0x44, 0x5f, 0x56, 0x45, 0x52, 0x49, 0x46, 0x59, 0x10, 0x03, 0x12, 0x3a, 0x0a, 0x36,
+ 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x41, 0x4e, 0x44, 0x5f, 0x52, 0x45, 0x51, 0x55,
+ 0x49, 0x52, 0x45, 0x5f, 0x43, 0x4c, 0x49, 0x45, 0x4e, 0x54, 0x5f, 0x43, 0x45, 0x52, 0x54, 0x49,
+ 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f, 0x42, 0x55, 0x54, 0x5f, 0x44, 0x4f, 0x4e, 0x54, 0x5f,
+ 0x56, 0x45, 0x52, 0x49, 0x46, 0x59, 0x10, 0x04, 0x12, 0x35, 0x0a, 0x31, 0x52, 0x45, 0x51, 0x55,
+ 0x45, 0x53, 0x54, 0x5f, 0x41, 0x4e, 0x44, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, 0x45, 0x5f,
+ 0x43, 0x4c, 0x49, 0x45, 0x4e, 0x54, 0x5f, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41,
+ 0x54, 0x45, 0x5f, 0x41, 0x4e, 0x44, 0x5f, 0x56, 0x45, 0x52, 0x49, 0x46, 0x59, 0x10, 0x05, 0x4a,
+ 0x04, 0x08, 0x04, 0x10, 0x05, 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x42, 0x13, 0x0a, 0x11, 0x74,
+ 0x6c, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x22, 0xb0, 0x03, 0x0a, 0x1d, 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x69, 0x76,
+ 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52,
+ 0x65, 0x71, 0x12, 0x5d, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18,
+ 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3f, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74,
+ 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x69, 0x76,
+ 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52,
+ 0x65, 0x71, 0x2e, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65,
+ 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x12, 0x51, 0x0a, 0x13, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x61,
+ 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20,
+ 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x69,
+ 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d,
+ 0x52, 0x12, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x41, 0x6c, 0x67, 0x6f, 0x72,
+ 0x69, 0x74, 0x68, 0x6d, 0x12, 0x1d, 0x0a, 0x09, 0x72, 0x61, 0x77, 0x5f, 0x62, 0x79, 0x74, 0x65,
+ 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x08, 0x72, 0x61, 0x77, 0x42, 0x79,
+ 0x74, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0d, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x5f, 0x64, 0x69,
+ 0x67, 0x65, 0x73, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0c, 0x73, 0x68,
+ 0x61, 0x32, 0x35, 0x36, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x0d, 0x73, 0x68,
+ 0x61, 0x33, 0x38, 0x34, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28,
+ 0x0c, 0x48, 0x00, 0x52, 0x0c, 0x73, 0x68, 0x61, 0x33, 0x38, 0x34, 0x44, 0x69, 0x67, 0x65, 0x73,
+ 0x74, 0x12, 0x25, 0x0a, 0x0d, 0x73, 0x68, 0x61, 0x35, 0x31, 0x32, 0x5f, 0x64, 0x69, 0x67, 0x65,
+ 0x73, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0c, 0x73, 0x68, 0x61, 0x35,
+ 0x31, 0x32, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x22, 0x3d, 0x0a, 0x13, 0x50, 0x72, 0x69, 0x76,
+ 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12,
+ 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00,
+ 0x12, 0x08, 0x0a, 0x04, 0x53, 0x49, 0x47, 0x4e, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45,
+ 0x43, 0x52, 0x59, 0x50, 0x54, 0x10, 0x02, 0x42, 0x0a, 0x0a, 0x08, 0x69, 0x6e, 0x5f, 0x62, 0x79,
+ 0x74, 0x65, 0x73, 0x22, 0x3d, 0x0a, 0x1e, 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72,
0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f,
- 0x6e, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x51, 0x0a, 0x13,
- 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69,
- 0x74, 0x68, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x73, 0x32, 0x61, 0x2e,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75,
- 0x72, 0x65, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x52, 0x12, 0x73, 0x69, 0x67,
- 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12,
- 0x1d, 0x0a, 0x09, 0x72, 0x61, 0x77, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01,
- 0x28, 0x0c, 0x48, 0x00, 0x52, 0x08, 0x72, 0x61, 0x77, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x25,
- 0x0a, 0x0d, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18,
- 0x05, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0c, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x44,
- 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x0d, 0x73, 0x68, 0x61, 0x33, 0x38, 0x34, 0x5f,
- 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0c,
- 0x73, 0x68, 0x61, 0x33, 0x38, 0x34, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x0d,
- 0x73, 0x68, 0x61, 0x35, 0x31, 0x32, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x07, 0x20,
- 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0c, 0x73, 0x68, 0x61, 0x35, 0x31, 0x32, 0x44, 0x69, 0x67,
- 0x65, 0x73, 0x74, 0x22, 0x3d, 0x0a, 0x13, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65,
- 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e,
- 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x53,
- 0x49, 0x47, 0x4e, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x43, 0x52, 0x59, 0x50, 0x54,
- 0x10, 0x02, 0x42, 0x0a, 0x0a, 0x08, 0x69, 0x6e, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x22, 0x3d,
- 0x0a, 0x1e, 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65,
- 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70,
- 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x75, 0x74, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20,
- 0x01, 0x28, 0x0c, 0x52, 0x08, 0x6f, 0x75, 0x74, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0xe7, 0x01,
- 0x0a, 0x20, 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74,
- 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52,
- 0x65, 0x71, 0x12, 0x63, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18,
- 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x45, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74,
- 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x75,
- 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69,
- 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e,
- 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x6f, 0x70,
- 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x6e, 0x5f, 0x62, 0x79,
- 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x69, 0x6e, 0x42, 0x79, 0x74,
- 0x65, 0x73, 0x22, 0x43, 0x0a, 0x16, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e,
- 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0f, 0x0a, 0x0b,
- 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a,
- 0x07, 0x45, 0x4e, 0x43, 0x52, 0x59, 0x50, 0x54, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45,
- 0x43, 0x52, 0x59, 0x50, 0x54, 0x10, 0x02, 0x22, 0x40, 0x0a, 0x21, 0x4f, 0x66, 0x66, 0x6c, 0x6f,
- 0x61, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4f,
- 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1b, 0x0a, 0x09,
- 0x6f, 0x75, 0x74, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52,
- 0x08, 0x6f, 0x75, 0x74, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0xf8, 0x04, 0x0a, 0x1f, 0x56, 0x61,
- 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66,
- 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x52, 0x0a,
- 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3e, 0x2e, 0x73, 0x32,
+ 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x75, 0x74, 0x5f, 0x62, 0x79, 0x74,
+ 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x6f, 0x75, 0x74, 0x42, 0x79, 0x74,
+ 0x65, 0x73, 0x22, 0xe7, 0x01, 0x0a, 0x20, 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65,
+ 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x63, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x45, 0x2e, 0x73, 0x32, 0x61,
+ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61,
+ 0x64, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4f, 0x70,
+ 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6d,
+ 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08,
+ 0x69, 0x6e, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07,
+ 0x69, 0x6e, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0x43, 0x0a, 0x16, 0x52, 0x65, 0x73, 0x75, 0x6d,
+ 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44,
+ 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x45, 0x4e, 0x43, 0x52, 0x59, 0x50, 0x54, 0x10, 0x01, 0x12,
+ 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x43, 0x52, 0x59, 0x50, 0x54, 0x10, 0x02, 0x22, 0x40, 0x0a, 0x21,
+ 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f,
+ 0x6e, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73,
+ 0x70, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x75, 0x74, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01,
+ 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x6f, 0x75, 0x74, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0xf4,
+ 0x05, 0x0a, 0x1f, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x43,
+ 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52,
+ 0x65, 0x71, 0x12, 0x52, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e,
+ 0x32, 0x3e, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e,
+ 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74,
+ 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x2e,
+ 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x6f, 0x64, 0x65,
+ 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x12, 0x5b, 0x0a, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74,
+ 0x5f, 0x70, 0x65, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x73, 0x32,
0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64,
0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61,
- 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66,
- 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6d, 0x6f, 0x64,
- 0x65, 0x12, 0x5b, 0x0a, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x70, 0x65, 0x65, 0x72,
- 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65,
- 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61,
- 0x69, 0x6e, 0x52, 0x65, 0x71, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x50, 0x65, 0x65, 0x72,
- 0x48, 0x00, 0x52, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x50, 0x65, 0x65, 0x72, 0x12, 0x5b,
- 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x65, 0x65, 0x72, 0x18, 0x03, 0x20,
- 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e,
- 0x76, 0x32, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x43,
- 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52,
- 0x65, 0x71, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x50, 0x65, 0x65, 0x72, 0x48, 0x00, 0x52,
- 0x0a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x50, 0x65, 0x65, 0x72, 0x1a, 0x39, 0x0a, 0x0a, 0x43,
- 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x50, 0x65, 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x65, 0x72,
- 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x18, 0x01,
- 0x20, 0x03, 0x28, 0x0c, 0x52, 0x10, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74,
- 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x1a, 0xb5, 0x01, 0x0a, 0x0a, 0x53, 0x65, 0x72, 0x76, 0x65,
- 0x72, 0x50, 0x65, 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69,
- 0x63, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c,
- 0x52, 0x10, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61,
- 0x69, 0x6e, 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x68, 0x6f, 0x73,
- 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x65, 0x72,
- 0x76, 0x65, 0x72, 0x48, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x51, 0x0a, 0x25, 0x73,
- 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x75, 0x6e, 0x72, 0x65, 0x73, 0x74,
- 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x70, 0x6f,
- 0x6c, 0x69, 0x63, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x22, 0x73, 0x65, 0x72, 0x69,
- 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x55, 0x6e, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74,
- 0x65, 0x64, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x46,
- 0x0a, 0x10, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x6f,
- 0x64, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45,
- 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x50, 0x49, 0x46, 0x46, 0x45, 0x10, 0x01, 0x12,
- 0x15, 0x0a, 0x11, 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, 0x54, 0x5f, 0x54, 0x4f, 0x5f, 0x47, 0x4f,
- 0x4f, 0x47, 0x4c, 0x45, 0x10, 0x02, 0x42, 0x0c, 0x0a, 0x0a, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x6f,
- 0x6e, 0x65, 0x6f, 0x66, 0x22, 0xb2, 0x02, 0x0a, 0x20, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74,
- 0x65, 0x50, 0x65, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65,
- 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x6c, 0x0a, 0x11, 0x76, 0x61, 0x6c,
- 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01,
- 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3f, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72,
- 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e,
- 0x52, 0x65, 0x73, 0x70, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52,
- 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f,
- 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x2d, 0x0a, 0x12, 0x76, 0x61, 0x6c, 0x69, 0x64,
- 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20,
- 0x01, 0x28, 0x09, 0x52, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44,
- 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x32, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78,
- 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x32, 0x41, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78,
- 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0x3d, 0x0a, 0x10, 0x56, 0x61,
- 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x0f,
- 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12,
- 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07,
- 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x10, 0x02, 0x22, 0x97, 0x05, 0x0a, 0x0a, 0x53, 0x65,
- 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x3a, 0x0a, 0x0e, 0x6c, 0x6f, 0x63, 0x61,
- 0x6c, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
- 0x32, 0x13, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x49, 0x64, 0x65,
- 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x0d, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x49, 0x64, 0x65, 0x6e,
- 0x74, 0x69, 0x74, 0x79, 0x12, 0x62, 0x0a, 0x19, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69,
- 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x63, 0x68, 0x61, 0x6e, 0x69, 0x73, 0x6d,
- 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63,
- 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x63, 0x68, 0x61, 0x6e, 0x69, 0x73, 0x6d, 0x52, 0x18,
- 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65,
- 0x63, 0x68, 0x61, 0x6e, 0x69, 0x73, 0x6d, 0x73, 0x12, 0x61, 0x0a, 0x19, 0x67, 0x65, 0x74, 0x5f,
- 0x74, 0x6c, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f,
- 0x6e, 0x5f, 0x72, 0x65, 0x71, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x73, 0x32,
- 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x6c,
- 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65,
- 0x71, 0x48, 0x00, 0x52, 0x16, 0x67, 0x65, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69,
- 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x77, 0x0a, 0x21, 0x6f,
- 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x6b,
- 0x65, 0x79, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x71,
- 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x69,
- 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,
- 0x52, 0x65, 0x71, 0x48, 0x00, 0x52, 0x1d, 0x6f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72,
- 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f,
- 0x6e, 0x52, 0x65, 0x71, 0x12, 0x80, 0x01, 0x0a, 0x24, 0x6f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64,
- 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x5f,
- 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x71, 0x18, 0x05, 0x20,
- 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e,
- 0x76, 0x32, 0x2e, 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x70,
- 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,
- 0x52, 0x65, 0x71, 0x48, 0x00, 0x52, 0x20, 0x6f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65,
+ 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e,
+ 0x74, 0x50, 0x65, 0x65, 0x72, 0x48, 0x00, 0x52, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x50,
+ 0x65, 0x65, 0x72, 0x12, 0x5b, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x65,
+ 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70,
+ 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65,
+ 0x50, 0x65, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43,
+ 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x50, 0x65,
+ 0x65, 0x72, 0x48, 0x00, 0x52, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x50, 0x65, 0x65, 0x72,
+ 0x1a, 0x39, 0x0a, 0x0a, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x50, 0x65, 0x65, 0x72, 0x12, 0x2b,
+ 0x0a, 0x11, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68,
+ 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x10, 0x63, 0x65, 0x72, 0x74, 0x69,
+ 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x1a, 0xb5, 0x01, 0x0a, 0x0a,
+ 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x50, 0x65, 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x65,
+ 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x18,
+ 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x10, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61,
+ 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x65, 0x72, 0x76, 0x65,
+ 0x72, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
+ 0x52, 0x0e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x48, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65,
+ 0x12, 0x51, 0x0a, 0x25, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x75,
+ 0x6e, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6c, 0x69, 0x65,
+ 0x6e, 0x74, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52,
+ 0x22, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x55, 0x6e, 0x72, 0x65, 0x73,
+ 0x74, 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x6c,
+ 0x69, 0x63, 0x79, 0x22, 0xc1, 0x01, 0x0a, 0x10, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50,
+ 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x50, 0x49,
+ 0x46, 0x46, 0x45, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, 0x54,
+ 0x5f, 0x54, 0x4f, 0x5f, 0x47, 0x4f, 0x4f, 0x47, 0x4c, 0x45, 0x10, 0x02, 0x12, 0x27, 0x0a, 0x23,
+ 0x52, 0x45, 0x53, 0x45, 0x52, 0x56, 0x45, 0x44, 0x5f, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x5f,
+ 0x56, 0x45, 0x52, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4d, 0x4f, 0x44,
+ 0x45, 0x5f, 0x33, 0x10, 0x03, 0x12, 0x27, 0x0a, 0x23, 0x52, 0x45, 0x53, 0x45, 0x52, 0x56, 0x45,
+ 0x44, 0x5f, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x5f, 0x56, 0x45, 0x52, 0x49, 0x46, 0x49, 0x43,
+ 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x34, 0x10, 0x04, 0x12, 0x27,
+ 0x0a, 0x23, 0x52, 0x45, 0x53, 0x45, 0x52, 0x56, 0x45, 0x44, 0x5f, 0x43, 0x55, 0x53, 0x54, 0x4f,
+ 0x4d, 0x5f, 0x56, 0x45, 0x52, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4d,
+ 0x4f, 0x44, 0x45, 0x5f, 0x35, 0x10, 0x05, 0x42, 0x0c, 0x0a, 0x0a, 0x70, 0x65, 0x65, 0x72, 0x5f,
+ 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x22, 0xb2, 0x02, 0x0a, 0x20, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61,
+ 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74,
+ 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x6c, 0x0a, 0x11, 0x76, 0x61,
+ 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18,
+ 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3f, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74,
+ 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x65,
+ 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69,
+ 0x6e, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x2d, 0x0a, 0x12, 0x76, 0x61, 0x6c, 0x69,
+ 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02,
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x32, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65,
+ 0x78, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70,
+ 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x32, 0x41, 0x43, 0x6f, 0x6e, 0x74, 0x65,
+ 0x78, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0x3d, 0x0a, 0x10, 0x56,
+ 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12,
+ 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00,
+ 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x01, 0x12, 0x0b, 0x0a,
+ 0x07, 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x10, 0x02, 0x22, 0xa0, 0x05, 0x0a, 0x0a, 0x53,
+ 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x3d, 0x0a, 0x0e, 0x6c, 0x6f, 0x63,
+ 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28,
+ 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32,
+ 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x0d, 0x6c, 0x6f, 0x63, 0x61, 0x6c,
+ 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x62, 0x0a, 0x19, 0x61, 0x75, 0x74, 0x68,
+ 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x63, 0x68, 0x61,
+ 0x6e, 0x69, 0x73, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x73, 0x32,
+ 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x65,
+ 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x63, 0x68, 0x61, 0x6e, 0x69,
+ 0x73, 0x6d, 0x52, 0x18, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x4d, 0x65, 0x63, 0x68, 0x61, 0x6e, 0x69, 0x73, 0x6d, 0x73, 0x12, 0x61, 0x0a, 0x19,
+ 0x67, 0x65, 0x74, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x71, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32,
+ 0x24, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x47,
+ 0x65, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x48, 0x00, 0x52, 0x16, 0x67, 0x65, 0x74, 0x54, 0x6c, 0x73, 0x43,
+ 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12,
+ 0x77, 0x0a, 0x21, 0x6f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61,
+ 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x5f, 0x72, 0x65, 0x71, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x73, 0x32, 0x61,
+ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61,
+ 0x64, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x48, 0x00, 0x52, 0x1d, 0x6f, 0x66, 0x66, 0x6c, 0x6f,
+ 0x61, 0x64, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x80, 0x01, 0x0a, 0x24, 0x6f, 0x66, 0x66,
+ 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f,
+ 0x6b, 0x65, 0x79, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65,
+ 0x71, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72,
+ 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65,
0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61,
- 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x7d, 0x0a, 0x23, 0x76, 0x61, 0x6c, 0x69, 0x64,
- 0x61, 0x74, 0x65, 0x5f, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69,
- 0x63, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x72, 0x65, 0x71, 0x18, 0x06,
- 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72,
- 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e,
- 0x52, 0x65, 0x71, 0x48, 0x00, 0x52, 0x1f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50,
- 0x65, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68,
- 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x42, 0x0b, 0x0a, 0x09, 0x72, 0x65, 0x71, 0x5f, 0x6f, 0x6e,
- 0x65, 0x6f, 0x66, 0x22, 0xb4, 0x04, 0x0a, 0x0b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52,
- 0x65, 0x73, 0x70, 0x12, 0x2c, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20,
- 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e,
- 0x76, 0x32, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75,
- 0x73, 0x12, 0x64, 0x0a, 0x1a, 0x67, 0x65, 0x74, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x63, 0x6f, 0x6e,
- 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x18,
- 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74,
- 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69,
- 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x48, 0x00, 0x52, 0x17,
- 0x67, 0x65, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74,
- 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x7a, 0x0a, 0x22, 0x6f, 0x66, 0x66, 0x6c, 0x6f,
- 0x61, 0x64, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x6f,
- 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x18, 0x03, 0x20,
- 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e,
- 0x76, 0x32, 0x2e, 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74,
- 0x65, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73,
- 0x70, 0x48, 0x00, 0x52, 0x1e, 0x6f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x69, 0x76,
- 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52,
- 0x65, 0x73, 0x70, 0x12, 0x83, 0x01, 0x0a, 0x25, 0x6f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x5f,
- 0x72, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x6f,
- 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x18, 0x04, 0x20,
- 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e,
- 0x76, 0x32, 0x2e, 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x70,
- 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,
- 0x52, 0x65, 0x73, 0x70, 0x48, 0x00, 0x52, 0x21, 0x6f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x52,
- 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72,
- 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x80, 0x01, 0x0a, 0x24, 0x76, 0x61,
- 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x63, 0x65, 0x72, 0x74,
- 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x72, 0x65,
- 0x73, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70,
+ 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x48, 0x00, 0x52, 0x20, 0x6f, 0x66, 0x66, 0x6c, 0x6f,
+ 0x61, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4f,
+ 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x7d, 0x0a, 0x23, 0x76,
+ 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x63, 0x65, 0x72,
+ 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x72,
+ 0x65, 0x71, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65,
0x50, 0x65, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43,
- 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x48, 0x00, 0x52, 0x20, 0x76, 0x61, 0x6c, 0x69,
- 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63,
- 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x42, 0x0c, 0x0a, 0x0a,
- 0x72, 0x65, 0x73, 0x70, 0x5f, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x2a, 0xa2, 0x03, 0x0a, 0x12, 0x53,
- 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68,
- 0x6d, 0x12, 0x1c, 0x0a, 0x18, 0x53, 0x32, 0x41, 0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x53, 0x49, 0x47,
- 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12,
+ 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x48, 0x00, 0x52, 0x1f, 0x76, 0x61, 0x6c, 0x69, 0x64,
+ 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61,
+ 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x42, 0x0b, 0x0a, 0x09, 0x72, 0x65,
+ 0x71, 0x5f, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x22, 0xb4, 0x04,
+ 0x0a, 0x0b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2c, 0x0a,
+ 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e,
+ 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x74, 0x61,
+ 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x64, 0x0a, 0x1a, 0x67,
+ 0x65, 0x74, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
+ 0x25, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x47,
+ 0x65, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x48, 0x00, 0x52, 0x17, 0x67, 0x65, 0x74, 0x54, 0x6c, 0x73,
+ 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73,
+ 0x70, 0x12, 0x7a, 0x0a, 0x22, 0x6f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x70, 0x72, 0x69,
+ 0x76, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e,
+ 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x66, 0x66,
+ 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x4f, 0x70,
+ 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x48, 0x00, 0x52, 0x1e, 0x6f,
+ 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79,
+ 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x83, 0x01,
+ 0x0a, 0x25, 0x6f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6d, 0x70,
+ 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e,
+ 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x66, 0x66,
+ 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65,
+ 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x48, 0x00,
+ 0x52, 0x21, 0x6f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74,
+ 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52,
+ 0x65, 0x73, 0x70, 0x12, 0x80, 0x01, 0x0a, 0x24, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65,
+ 0x5f, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74,
+ 0x65, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x18, 0x05, 0x20, 0x01,
+ 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76,
+ 0x32, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x43, 0x65,
+ 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65,
+ 0x73, 0x70, 0x48, 0x00, 0x52, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65,
+ 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61,
+ 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x42, 0x0c, 0x0a, 0x0a, 0x72, 0x65, 0x73, 0x70, 0x5f, 0x6f,
+ 0x6e, 0x65, 0x6f, 0x66, 0x2a, 0xa2, 0x03, 0x0a, 0x12, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75,
+ 0x72, 0x65, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x1c, 0x0a, 0x18, 0x53,
+ 0x32, 0x41, 0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50,
+ 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x21, 0x0a, 0x1d, 0x53, 0x32, 0x41,
+ 0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x52, 0x53, 0x41, 0x5f, 0x50, 0x4b,
+ 0x43, 0x53, 0x31, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x01, 0x12, 0x21, 0x0a, 0x1d,
+ 0x53, 0x32, 0x41, 0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x52, 0x53, 0x41,
+ 0x5f, 0x50, 0x4b, 0x43, 0x53, 0x31, 0x5f, 0x53, 0x48, 0x41, 0x33, 0x38, 0x34, 0x10, 0x02, 0x12,
0x21, 0x0a, 0x1d, 0x53, 0x32, 0x41, 0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f,
- 0x52, 0x53, 0x41, 0x5f, 0x50, 0x4b, 0x43, 0x53, 0x31, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36,
- 0x10, 0x01, 0x12, 0x21, 0x0a, 0x1d, 0x53, 0x32, 0x41, 0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x53, 0x49,
- 0x47, 0x4e, 0x5f, 0x52, 0x53, 0x41, 0x5f, 0x50, 0x4b, 0x43, 0x53, 0x31, 0x5f, 0x53, 0x48, 0x41,
- 0x33, 0x38, 0x34, 0x10, 0x02, 0x12, 0x21, 0x0a, 0x1d, 0x53, 0x32, 0x41, 0x5f, 0x53, 0x53, 0x4c,
- 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x52, 0x53, 0x41, 0x5f, 0x50, 0x4b, 0x43, 0x53, 0x31, 0x5f,
- 0x53, 0x48, 0x41, 0x35, 0x31, 0x32, 0x10, 0x03, 0x12, 0x27, 0x0a, 0x23, 0x53, 0x32, 0x41, 0x5f,
- 0x53, 0x53, 0x4c, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x45, 0x43, 0x44, 0x53, 0x41, 0x5f, 0x53,
- 0x45, 0x43, 0x50, 0x32, 0x35, 0x36, 0x52, 0x31, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10,
- 0x04, 0x12, 0x27, 0x0a, 0x23, 0x53, 0x32, 0x41, 0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x53, 0x49, 0x47,
- 0x4e, 0x5f, 0x45, 0x43, 0x44, 0x53, 0x41, 0x5f, 0x53, 0x45, 0x43, 0x50, 0x33, 0x38, 0x34, 0x52,
- 0x31, 0x5f, 0x53, 0x48, 0x41, 0x33, 0x38, 0x34, 0x10, 0x05, 0x12, 0x27, 0x0a, 0x23, 0x53, 0x32,
- 0x41, 0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x45, 0x43, 0x44, 0x53, 0x41,
- 0x5f, 0x53, 0x45, 0x43, 0x50, 0x35, 0x32, 0x31, 0x52, 0x31, 0x5f, 0x53, 0x48, 0x41, 0x35, 0x31,
- 0x32, 0x10, 0x06, 0x12, 0x24, 0x0a, 0x20, 0x53, 0x32, 0x41, 0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x53,
+ 0x52, 0x53, 0x41, 0x5f, 0x50, 0x4b, 0x43, 0x53, 0x31, 0x5f, 0x53, 0x48, 0x41, 0x35, 0x31, 0x32,
+ 0x10, 0x03, 0x12, 0x27, 0x0a, 0x23, 0x53, 0x32, 0x41, 0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x53, 0x49,
+ 0x47, 0x4e, 0x5f, 0x45, 0x43, 0x44, 0x53, 0x41, 0x5f, 0x53, 0x45, 0x43, 0x50, 0x32, 0x35, 0x36,
+ 0x52, 0x31, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x04, 0x12, 0x27, 0x0a, 0x23, 0x53,
+ 0x32, 0x41, 0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x45, 0x43, 0x44, 0x53,
+ 0x41, 0x5f, 0x53, 0x45, 0x43, 0x50, 0x33, 0x38, 0x34, 0x52, 0x31, 0x5f, 0x53, 0x48, 0x41, 0x33,
+ 0x38, 0x34, 0x10, 0x05, 0x12, 0x27, 0x0a, 0x23, 0x53, 0x32, 0x41, 0x5f, 0x53, 0x53, 0x4c, 0x5f,
+ 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x45, 0x43, 0x44, 0x53, 0x41, 0x5f, 0x53, 0x45, 0x43, 0x50, 0x35,
+ 0x32, 0x31, 0x52, 0x31, 0x5f, 0x53, 0x48, 0x41, 0x35, 0x31, 0x32, 0x10, 0x06, 0x12, 0x24, 0x0a,
+ 0x20, 0x53, 0x32, 0x41, 0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x52, 0x53,
+ 0x41, 0x5f, 0x50, 0x53, 0x53, 0x5f, 0x52, 0x53, 0x41, 0x45, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35,
+ 0x36, 0x10, 0x07, 0x12, 0x24, 0x0a, 0x20, 0x53, 0x32, 0x41, 0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x53,
0x49, 0x47, 0x4e, 0x5f, 0x52, 0x53, 0x41, 0x5f, 0x50, 0x53, 0x53, 0x5f, 0x52, 0x53, 0x41, 0x45,
- 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x07, 0x12, 0x24, 0x0a, 0x20, 0x53, 0x32, 0x41,
+ 0x5f, 0x53, 0x48, 0x41, 0x33, 0x38, 0x34, 0x10, 0x08, 0x12, 0x24, 0x0a, 0x20, 0x53, 0x32, 0x41,
0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x52, 0x53, 0x41, 0x5f, 0x50, 0x53,
- 0x53, 0x5f, 0x52, 0x53, 0x41, 0x45, 0x5f, 0x53, 0x48, 0x41, 0x33, 0x38, 0x34, 0x10, 0x08, 0x12,
- 0x24, 0x0a, 0x20, 0x53, 0x32, 0x41, 0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f,
- 0x52, 0x53, 0x41, 0x5f, 0x50, 0x53, 0x53, 0x5f, 0x52, 0x53, 0x41, 0x45, 0x5f, 0x53, 0x48, 0x41,
- 0x35, 0x31, 0x32, 0x10, 0x09, 0x12, 0x18, 0x0a, 0x14, 0x53, 0x32, 0x41, 0x5f, 0x53, 0x53, 0x4c,
- 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x45, 0x44, 0x32, 0x35, 0x35, 0x31, 0x39, 0x10, 0x0a, 0x32,
- 0x57, 0x0a, 0x0a, 0x53, 0x32, 0x41, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x49, 0x0a,
- 0x0c, 0x53, 0x65, 0x74, 0x55, 0x70, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x2e,
- 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x73,
- 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72,
+ 0x53, 0x5f, 0x52, 0x53, 0x41, 0x45, 0x5f, 0x53, 0x48, 0x41, 0x35, 0x31, 0x32, 0x10, 0x09, 0x12,
+ 0x18, 0x0a, 0x14, 0x53, 0x32, 0x41, 0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f,
+ 0x45, 0x44, 0x32, 0x35, 0x35, 0x31, 0x39, 0x10, 0x0a, 0x32, 0x57, 0x0a, 0x0a, 0x53, 0x32, 0x41,
+ 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x49, 0x0a, 0x0c, 0x53, 0x65, 0x74, 0x55, 0x70,
+ 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65,
- 0x73, 0x70, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x36, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68,
- 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x73, 0x32,
- 0x61, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x32, 0x61, 0x5f, 0x67, 0x6f, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x71, 0x1a, 0x19, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32,
+ 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x28, 0x01,
+ 0x30, 0x01, 0x42, 0x36, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
+ 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x73, 0x32, 0x61, 0x2f, 0x69, 0x6e, 0x74, 0x65,
+ 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x32,
+ 0x61, 0x5f, 0x67, 0x6f, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
+ 0x6f, 0x33,
}
var (
@@ -2158,7 +2176,7 @@ func file_internal_proto_v2_s2a_s2a_proto_rawDescGZIP() []byte {
var file_internal_proto_v2_s2a_s2a_proto_enumTypes = make([]protoimpl.EnumInfo, 6)
var file_internal_proto_v2_s2a_s2a_proto_msgTypes = make([]protoimpl.MessageInfo, 17)
-var file_internal_proto_v2_s2a_s2a_proto_goTypes = []interface{}{
+var file_internal_proto_v2_s2a_s2a_proto_goTypes = []any{
(SignatureAlgorithm)(0), // 0: s2a.proto.v2.SignatureAlgorithm
(GetTlsConfigurationResp_ServerTlsConfiguration_RequestClientCertificate)(0), // 1: s2a.proto.v2.GetTlsConfigurationResp.ServerTlsConfiguration.RequestClientCertificate
(OffloadPrivateKeyOperationReq_PrivateKeyOperation)(0), // 2: s2a.proto.v2.OffloadPrivateKeyOperationReq.PrivateKeyOperation
@@ -2183,7 +2201,7 @@ var file_internal_proto_v2_s2a_s2a_proto_goTypes = []interface{}{
(*ValidatePeerCertificateChainReq_ClientPeer)(nil), // 21: s2a.proto.v2.ValidatePeerCertificateChainReq.ClientPeer
(*ValidatePeerCertificateChainReq_ServerPeer)(nil), // 22: s2a.proto.v2.ValidatePeerCertificateChainReq.ServerPeer
(common_go_proto.AlpnProtocol)(0), // 23: s2a.proto.v2.AlpnProtocol
- (*common_go_proto1.Identity)(nil), // 24: s2a.proto.Identity
+ (*common_go_proto.Identity)(nil), // 24: s2a.proto.v2.Identity
(common_go_proto.ConnectionSide)(0), // 25: s2a.proto.v2.ConnectionSide
(*s2a_context_go_proto.S2AContext)(nil), // 26: s2a.proto.v2.S2AContext
(common_go_proto.TLSVersion)(0), // 27: s2a.proto.v2.TLSVersion
@@ -2191,7 +2209,7 @@ var file_internal_proto_v2_s2a_s2a_proto_goTypes = []interface{}{
}
var file_internal_proto_v2_s2a_s2a_proto_depIdxs = []int32{
23, // 0: s2a.proto.v2.AlpnPolicy.alpn_protocols:type_name -> s2a.proto.v2.AlpnProtocol
- 24, // 1: s2a.proto.v2.AuthenticationMechanism.identity:type_name -> s2a.proto.Identity
+ 24, // 1: s2a.proto.v2.AuthenticationMechanism.identity:type_name -> s2a.proto.v2.Identity
25, // 2: s2a.proto.v2.GetTlsConfigurationReq.connection_side:type_name -> s2a.proto.v2.ConnectionSide
19, // 3: s2a.proto.v2.GetTlsConfigurationResp.client_tls_configuration:type_name -> s2a.proto.v2.GetTlsConfigurationResp.ClientTlsConfiguration
20, // 4: s2a.proto.v2.GetTlsConfigurationResp.server_tls_configuration:type_name -> s2a.proto.v2.GetTlsConfigurationResp.ServerTlsConfiguration
@@ -2203,7 +2221,7 @@ var file_internal_proto_v2_s2a_s2a_proto_depIdxs = []int32{
22, // 10: s2a.proto.v2.ValidatePeerCertificateChainReq.server_peer:type_name -> s2a.proto.v2.ValidatePeerCertificateChainReq.ServerPeer
5, // 11: s2a.proto.v2.ValidatePeerCertificateChainResp.validation_result:type_name -> s2a.proto.v2.ValidatePeerCertificateChainResp.ValidationResult
26, // 12: s2a.proto.v2.ValidatePeerCertificateChainResp.context:type_name -> s2a.proto.v2.S2AContext
- 24, // 13: s2a.proto.v2.SessionReq.local_identity:type_name -> s2a.proto.Identity
+ 24, // 13: s2a.proto.v2.SessionReq.local_identity:type_name -> s2a.proto.v2.Identity
7, // 14: s2a.proto.v2.SessionReq.authentication_mechanisms:type_name -> s2a.proto.v2.AuthenticationMechanism
9, // 15: s2a.proto.v2.SessionReq.get_tls_configuration_req:type_name -> s2a.proto.v2.GetTlsConfigurationReq
11, // 16: s2a.proto.v2.SessionReq.offload_private_key_operation_req:type_name -> s2a.proto.v2.OffloadPrivateKeyOperationReq
@@ -2238,7 +2256,7 @@ func file_internal_proto_v2_s2a_s2a_proto_init() {
return
}
if !protoimpl.UnsafeEnabled {
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*AlpnPolicy); i {
case 0:
return &v.state
@@ -2250,7 +2268,7 @@ func file_internal_proto_v2_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*AuthenticationMechanism); i {
case 0:
return &v.state
@@ -2262,7 +2280,7 @@ func file_internal_proto_v2_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[2].Exporter = func(v any, i int) any {
switch v := v.(*Status); i {
case 0:
return &v.state
@@ -2274,7 +2292,7 @@ func file_internal_proto_v2_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[3].Exporter = func(v any, i int) any {
switch v := v.(*GetTlsConfigurationReq); i {
case 0:
return &v.state
@@ -2286,7 +2304,7 @@ func file_internal_proto_v2_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[4].Exporter = func(v any, i int) any {
switch v := v.(*GetTlsConfigurationResp); i {
case 0:
return &v.state
@@ -2298,7 +2316,7 @@ func file_internal_proto_v2_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[5].Exporter = func(v any, i int) any {
switch v := v.(*OffloadPrivateKeyOperationReq); i {
case 0:
return &v.state
@@ -2310,7 +2328,7 @@ func file_internal_proto_v2_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[6].Exporter = func(v any, i int) any {
switch v := v.(*OffloadPrivateKeyOperationResp); i {
case 0:
return &v.state
@@ -2322,7 +2340,7 @@ func file_internal_proto_v2_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[7].Exporter = func(v any, i int) any {
switch v := v.(*OffloadResumptionKeyOperationReq); i {
case 0:
return &v.state
@@ -2334,7 +2352,7 @@ func file_internal_proto_v2_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[8].Exporter = func(v any, i int) any {
switch v := v.(*OffloadResumptionKeyOperationResp); i {
case 0:
return &v.state
@@ -2346,7 +2364,7 @@ func file_internal_proto_v2_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[9].Exporter = func(v any, i int) any {
switch v := v.(*ValidatePeerCertificateChainReq); i {
case 0:
return &v.state
@@ -2358,7 +2376,7 @@ func file_internal_proto_v2_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[10].Exporter = func(v any, i int) any {
switch v := v.(*ValidatePeerCertificateChainResp); i {
case 0:
return &v.state
@@ -2370,7 +2388,7 @@ func file_internal_proto_v2_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[11].Exporter = func(v any, i int) any {
switch v := v.(*SessionReq); i {
case 0:
return &v.state
@@ -2382,7 +2400,7 @@ func file_internal_proto_v2_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[12].Exporter = func(v any, i int) any {
switch v := v.(*SessionResp); i {
case 0:
return &v.state
@@ -2394,7 +2412,7 @@ func file_internal_proto_v2_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[13].Exporter = func(v any, i int) any {
switch v := v.(*GetTlsConfigurationResp_ClientTlsConfiguration); i {
case 0:
return &v.state
@@ -2406,7 +2424,7 @@ func file_internal_proto_v2_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[14].Exporter = func(v any, i int) any {
switch v := v.(*GetTlsConfigurationResp_ServerTlsConfiguration); i {
case 0:
return &v.state
@@ -2418,7 +2436,7 @@ func file_internal_proto_v2_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[15].Exporter = func(v any, i int) any {
switch v := v.(*ValidatePeerCertificateChainReq_ClientPeer); i {
case 0:
return &v.state
@@ -2430,7 +2448,7 @@ func file_internal_proto_v2_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[16].Exporter = func(v any, i int) any {
switch v := v.(*ValidatePeerCertificateChainReq_ServerPeer); i {
case 0:
return &v.state
@@ -2443,30 +2461,30 @@ func file_internal_proto_v2_s2a_s2a_proto_init() {
}
}
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[1].OneofWrappers = []interface{}{
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[1].OneofWrappers = []any{
(*AuthenticationMechanism_Token)(nil),
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[4].OneofWrappers = []interface{}{
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[4].OneofWrappers = []any{
(*GetTlsConfigurationResp_ClientTlsConfiguration_)(nil),
(*GetTlsConfigurationResp_ServerTlsConfiguration_)(nil),
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[5].OneofWrappers = []interface{}{
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[5].OneofWrappers = []any{
(*OffloadPrivateKeyOperationReq_RawBytes)(nil),
(*OffloadPrivateKeyOperationReq_Sha256Digest)(nil),
(*OffloadPrivateKeyOperationReq_Sha384Digest)(nil),
(*OffloadPrivateKeyOperationReq_Sha512Digest)(nil),
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[9].OneofWrappers = []interface{}{
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[9].OneofWrappers = []any{
(*ValidatePeerCertificateChainReq_ClientPeer_)(nil),
(*ValidatePeerCertificateChainReq_ServerPeer_)(nil),
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[11].OneofWrappers = []interface{}{
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[11].OneofWrappers = []any{
(*SessionReq_GetTlsConfigurationReq)(nil),
(*SessionReq_OffloadPrivateKeyOperationReq)(nil),
(*SessionReq_OffloadResumptionKeyOperationReq)(nil),
(*SessionReq_ValidatePeerCertificateChainReq)(nil),
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[12].OneofWrappers = []interface{}{
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[12].OneofWrappers = []any{
(*SessionResp_GetTlsConfigurationResp)(nil),
(*SessionResp_OffloadPrivateKeyOperationResp)(nil),
(*SessionResp_OffloadResumptionKeyOperationResp)(nil),
diff --git a/vendor/github.com/google/s2a-go/internal/proto/v2/s2a_go_proto/s2a_grpc.pb.go b/vendor/github.com/google/s2a-go/internal/proto/v2/s2a_go_proto/s2a_grpc.pb.go
index 2566df6c..c93f75a7 100644
--- a/vendor/github.com/google/s2a-go/internal/proto/v2/s2a_go_proto/s2a_grpc.pb.go
+++ b/vendor/github.com/google/s2a-go/internal/proto/v2/s2a_go_proto/s2a_grpc.pb.go
@@ -14,7 +14,7 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
-// - protoc-gen-go-grpc v1.3.0
+// - protoc-gen-go-grpc v1.4.0
// - protoc v3.21.12
// source: internal/proto/v2/s2a/s2a.proto
@@ -29,8 +29,8 @@ import (
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
-// Requires gRPC-Go v1.32.0 or later.
-const _ = grpc.SupportPackageIsVersion7
+// Requires gRPC-Go v1.62.0 or later.
+const _ = grpc.SupportPackageIsVersion8
const (
S2AService_SetUpSession_FullMethodName = "/s2a.proto.v2.S2AService/SetUpSession"
@@ -54,11 +54,12 @@ func NewS2AServiceClient(cc grpc.ClientConnInterface) S2AServiceClient {
}
func (c *s2AServiceClient) SetUpSession(ctx context.Context, opts ...grpc.CallOption) (S2AService_SetUpSessionClient, error) {
- stream, err := c.cc.NewStream(ctx, &S2AService_ServiceDesc.Streams[0], S2AService_SetUpSession_FullMethodName, opts...)
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
+ stream, err := c.cc.NewStream(ctx, &S2AService_ServiceDesc.Streams[0], S2AService_SetUpSession_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
- x := &s2AServiceSetUpSessionClient{stream}
+ x := &s2AServiceSetUpSessionClient{ClientStream: stream}
return x, nil
}
@@ -115,7 +116,7 @@ func RegisterS2AServiceServer(s grpc.ServiceRegistrar, srv S2AServiceServer) {
}
func _S2AService_SetUpSession_Handler(srv interface{}, stream grpc.ServerStream) error {
- return srv.(S2AServiceServer).SetUpSession(&s2AServiceSetUpSessionServer{stream})
+ return srv.(S2AServiceServer).SetUpSession(&s2AServiceSetUpSessionServer{ServerStream: stream})
}
type S2AService_SetUpSessionServer interface {
diff --git a/vendor/github.com/google/s2a-go/internal/record/record.go b/vendor/github.com/google/s2a-go/internal/record/record.go
index c6051551..e76509ef 100644
--- a/vendor/github.com/google/s2a-go/internal/record/record.go
+++ b/vendor/github.com/google/s2a-go/internal/record/record.go
@@ -378,11 +378,6 @@ func (p *conn) Read(b []byte) (n int, err error) {
if len(p.handshakeBuf) > 0 {
return 0, errors.New("application data received while processing fragmented handshake messages")
}
- if p.ticketState == receivingTickets {
- p.ticketState = notReceivingTickets
- grpclog.Infof("Sending session tickets to S2A.")
- p.ticketSender.sendTicketsToS2A(p.sessionTickets, p.callComplete)
- }
case alert:
return 0, p.handleAlertMessage()
case handshake:
@@ -500,17 +495,7 @@ func (p *conn) buildRecord(plaintext []byte, recordType byte, recordStartIndex i
}
func (p *conn) Close() error {
- p.readMutex.Lock()
- defer p.readMutex.Unlock()
- p.writeMutex.Lock()
- defer p.writeMutex.Unlock()
- // If p.ticketState is equal to notReceivingTickets, then S2A has
- // been sent a flight of session tickets, and we must wait for the
- // call to S2A to complete before closing the record protocol.
- if p.ticketState == notReceivingTickets {
- <-p.callComplete
- grpclog.Infof("Safe to close the connection because sending tickets to S2A is (already) complete.")
- }
+ // Close the connection immediately.
return p.Conn.Close()
}
@@ -663,7 +648,7 @@ func (p *conn) handleHandshakeMessage() error {
// Several handshake messages may be coalesced into a single record.
// Continue reading them until the handshake buffer is empty.
for len(p.handshakeBuf) > 0 {
- handshakeMsgType, msgLen, msg, rawMsg, ok := p.parseHandshakeMsg()
+ handshakeMsgType, msgLen, msg, _, ok := p.parseHandshakeMsg()
if !ok {
// The handshake could not be fully parsed, so read in another
// record and try again later.
@@ -681,20 +666,7 @@ func (p *conn) handleHandshakeMessage() error {
return err
}
case tlsHandshakeNewSessionTicketType:
- // Ignore tickets that are received after a batch of tickets has
- // been sent to S2A.
- if p.ticketState == notReceivingTickets {
- continue
- }
- if p.ticketState == ticketsNotYetReceived {
- p.ticketState = receivingTickets
- }
- p.sessionTickets = append(p.sessionTickets, rawMsg)
- if len(p.sessionTickets) == maxAllowedTickets {
- p.ticketState = notReceivingTickets
- grpclog.Infof("Sending session tickets to S2A.")
- p.ticketSender.sendTicketsToS2A(p.sessionTickets, p.callComplete)
- }
+ // Do nothing for session ticket.
default:
return errors.New("unknown handshake message type")
}
diff --git a/vendor/github.com/google/s2a-go/internal/tokenmanager/tokenmanager.go b/vendor/github.com/google/s2a-go/internal/tokenmanager/tokenmanager.go
index ec96ba3b..4057e70c 100644
--- a/vendor/github.com/google/s2a-go/internal/tokenmanager/tokenmanager.go
+++ b/vendor/github.com/google/s2a-go/internal/tokenmanager/tokenmanager.go
@@ -23,7 +23,8 @@ import (
"fmt"
"os"
- commonpb "github.com/google/s2a-go/internal/proto/common_go_proto"
+ commonpbv1 "github.com/google/s2a-go/internal/proto/common_go_proto"
+ commonpb "github.com/google/s2a-go/internal/proto/v2/common_go_proto"
)
const (
@@ -37,7 +38,7 @@ type AccessTokenManager interface {
DefaultToken() (token string, err error)
// Token returns a token that an application with local identity equal to
// identity must use to authenticate to S2A.
- Token(identity *commonpb.Identity) (token string, err error)
+ Token(identity interface{}) (token string, err error)
}
type singleTokenAccessTokenManager struct {
@@ -65,6 +66,14 @@ func (m *singleTokenAccessTokenManager) DefaultToken() (string, error) {
}
// Token always returns the token managed by the singleTokenAccessTokenManager.
-func (m *singleTokenAccessTokenManager) Token(*commonpb.Identity) (string, error) {
+func (m *singleTokenAccessTokenManager) Token(identity interface{}) (string, error) {
+ switch v := identity.(type) {
+ case *commonpbv1.Identity:
+ // valid type.
+ case *commonpb.Identity:
+ // valid type.
+ default:
+ return "", fmt.Errorf("Incorrect identity type: %v", v)
+ }
return m.token, nil
}
diff --git a/vendor/github.com/google/s2a-go/internal/v2/s2av2.go b/vendor/github.com/google/s2a-go/internal/v2/s2av2.go
index 85a8379d..a6402ee4 100644
--- a/vendor/github.com/google/s2a-go/internal/v2/s2av2.go
+++ b/vendor/github.com/google/s2a-go/internal/v2/s2av2.go
@@ -28,7 +28,6 @@ import (
"os"
"time"
- "github.com/golang/protobuf/proto"
"github.com/google/s2a-go/fallback"
"github.com/google/s2a-go/internal/handshaker/service"
"github.com/google/s2a-go/internal/tokenmanager"
@@ -38,8 +37,9 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/grpclog"
+ "google.golang.org/protobuf/proto"
- commonpbv1 "github.com/google/s2a-go/internal/proto/common_go_proto"
+ commonpb "github.com/google/s2a-go/internal/proto/v2/common_go_proto"
s2av2pb "github.com/google/s2a-go/internal/proto/v2/s2a_go_proto"
)
@@ -59,9 +59,9 @@ type s2av2TransportCreds struct {
transportCreds credentials.TransportCredentials
tokenManager *tokenmanager.AccessTokenManager
// localIdentity should only be used by the client.
- localIdentity *commonpbv1.Identity
+ localIdentity *commonpb.Identity
// localIdentities should only be used by the server.
- localIdentities []*commonpbv1.Identity
+ localIdentities []*commonpb.Identity
verificationMode s2av2pb.ValidatePeerCertificateChainReq_VerificationMode
fallbackClientHandshake fallback.ClientHandshake
getS2AStream func(ctx context.Context, s2av2Address string) (stream.S2AStream, error)
@@ -70,7 +70,7 @@ type s2av2TransportCreds struct {
// NewClientCreds returns a client-side transport credentials object that uses
// the S2Av2 to establish a secure connection with a server.
-func NewClientCreds(s2av2Address string, transportCreds credentials.TransportCredentials, localIdentity *commonpbv1.Identity, verificationMode s2av2pb.ValidatePeerCertificateChainReq_VerificationMode, fallbackClientHandshakeFunc fallback.ClientHandshake, getS2AStream func(ctx context.Context, s2av2Address string) (stream.S2AStream, error), serverAuthorizationPolicy []byte) (credentials.TransportCredentials, error) {
+func NewClientCreds(s2av2Address string, transportCreds credentials.TransportCredentials, localIdentity *commonpb.Identity, verificationMode s2av2pb.ValidatePeerCertificateChainReq_VerificationMode, fallbackClientHandshakeFunc fallback.ClientHandshake, getS2AStream func(ctx context.Context, s2av2Address string) (stream.S2AStream, error), serverAuthorizationPolicy []byte) (credentials.TransportCredentials, error) {
// Create an AccessTokenManager instance to use to authenticate to S2Av2.
accessTokenManager, err := tokenmanager.NewSingleTokenAccessTokenManager()
@@ -101,7 +101,7 @@ func NewClientCreds(s2av2Address string, transportCreds credentials.TransportCre
// NewServerCreds returns a server-side transport credentials object that uses
// the S2Av2 to establish a secure connection with a client.
-func NewServerCreds(s2av2Address string, transportCreds credentials.TransportCredentials, localIdentities []*commonpbv1.Identity, verificationMode s2av2pb.ValidatePeerCertificateChainReq_VerificationMode, getS2AStream func(ctx context.Context, s2av2Address string) (stream.S2AStream, error)) (credentials.TransportCredentials, error) {
+func NewServerCreds(s2av2Address string, transportCreds credentials.TransportCredentials, localIdentities []*commonpb.Identity, verificationMode s2av2pb.ValidatePeerCertificateChainReq_VerificationMode, getS2AStream func(ctx context.Context, s2av2Address string) (stream.S2AStream, error)) (credentials.TransportCredentials, error) {
// Create an AccessTokenManager instance to use to authenticate to S2Av2.
accessTokenManager, err := tokenmanager.NewSingleTokenAccessTokenManager()
creds := &s2av2TransportCreds{
@@ -183,13 +183,7 @@ func (c *s2av2TransportCreds) ClientHandshake(ctx context.Context, serverAuthori
}
creds := credentials.NewTLS(config)
- var conn net.Conn
- var authInfo credentials.AuthInfo
- retry.Run(timeoutCtx,
- func() error {
- conn, authInfo, err = creds.ClientHandshake(timeoutCtx, serverName, rawConn)
- return err
- })
+ conn, authInfo, err := creds.ClientHandshake(timeoutCtx, serverName, rawConn)
if err != nil {
grpclog.Infof("Failed to do client handshake using S2Av2: %v", err)
if c.fallbackClientHandshake != nil {
@@ -197,7 +191,7 @@ func (c *s2av2TransportCreds) ClientHandshake(ctx context.Context, serverAuthori
}
return nil, nil, err
}
- grpclog.Infof("Successfully done client handshake using S2Av2 to: %s", serverName)
+ grpclog.Infof("client-side handshake is done using S2Av2 to: %s", serverName)
return conn, authInfo, err
}
@@ -247,13 +241,7 @@ func (c *s2av2TransportCreds) ServerHandshake(rawConn net.Conn) (net.Conn, crede
}
creds := credentials.NewTLS(config)
- var conn net.Conn
- var authInfo credentials.AuthInfo
- retry.Run(ctx,
- func() error {
- conn, authInfo, err = creds.ServerHandshake(rawConn)
- return err
- })
+ conn, authInfo, err := creds.ServerHandshake(rawConn)
if err != nil {
grpclog.Infof("Failed to do server handshake using S2Av2: %v", err)
return nil, nil, err
@@ -280,15 +268,15 @@ func (c *s2av2TransportCreds) Clone() credentials.TransportCredentials {
tokenManager = *c.tokenManager
}
verificationMode := c.verificationMode
- var localIdentity *commonpbv1.Identity
+ var localIdentity *commonpb.Identity
if c.localIdentity != nil {
- localIdentity = proto.Clone(c.localIdentity).(*commonpbv1.Identity)
+ localIdentity = proto.Clone(c.localIdentity).(*commonpb.Identity)
}
- var localIdentities []*commonpbv1.Identity
+ var localIdentities []*commonpb.Identity
if c.localIdentities != nil {
- localIdentities = make([]*commonpbv1.Identity, len(c.localIdentities))
+ localIdentities = make([]*commonpb.Identity, len(c.localIdentities))
for i, localIdentity := range c.localIdentities {
- localIdentities[i] = proto.Clone(localIdentity).(*commonpbv1.Identity)
+ localIdentities[i] = proto.Clone(localIdentity).(*commonpb.Identity)
}
}
creds := &s2av2TransportCreds{
diff --git a/vendor/github.com/google/s2a-go/internal/v2/tlsconfigstore/tlsconfigstore.go b/vendor/github.com/google/s2a-go/internal/v2/tlsconfigstore/tlsconfigstore.go
index 4d919132..fa0002e3 100644
--- a/vendor/github.com/google/s2a-go/internal/v2/tlsconfigstore/tlsconfigstore.go
+++ b/vendor/github.com/google/s2a-go/internal/v2/tlsconfigstore/tlsconfigstore.go
@@ -33,7 +33,6 @@ import (
"google.golang.org/grpc/codes"
"google.golang.org/grpc/grpclog"
- commonpbv1 "github.com/google/s2a-go/internal/proto/common_go_proto"
commonpb "github.com/google/s2a-go/internal/proto/v2/common_go_proto"
s2av2pb "github.com/google/s2a-go/internal/proto/v2/s2a_go_proto"
)
@@ -44,8 +43,8 @@ const (
)
// GetTLSConfigurationForClient returns a tls.Config instance for use by a client application.
-func GetTLSConfigurationForClient(serverHostname string, s2AStream stream.S2AStream, tokenManager tokenmanager.AccessTokenManager, localIdentity *commonpbv1.Identity, verificationMode s2av2pb.ValidatePeerCertificateChainReq_VerificationMode, serverAuthorizationPolicy []byte) (*tls.Config, error) {
- authMechanisms := getAuthMechanisms(tokenManager, []*commonpbv1.Identity{localIdentity})
+func GetTLSConfigurationForClient(serverHostname string, s2AStream stream.S2AStream, tokenManager tokenmanager.AccessTokenManager, localIdentity *commonpb.Identity, verificationMode s2av2pb.ValidatePeerCertificateChainReq_VerificationMode, serverAuthorizationPolicy []byte) (*tls.Config, error) {
+ authMechanisms := getAuthMechanisms(tokenManager, []*commonpb.Identity{localIdentity})
if grpclog.V(1) {
grpclog.Infof("Sending request to S2Av2 for client TLS config.")
@@ -126,7 +125,7 @@ func GetTLSConfigurationForClient(serverHostname string, s2AStream stream.S2AStr
}
// GetTLSConfigurationForServer returns a tls.Config instance for use by a server application.
-func GetTLSConfigurationForServer(s2AStream stream.S2AStream, tokenManager tokenmanager.AccessTokenManager, localIdentities []*commonpbv1.Identity, verificationMode s2av2pb.ValidatePeerCertificateChainReq_VerificationMode) (*tls.Config, error) {
+func GetTLSConfigurationForServer(s2AStream stream.S2AStream, tokenManager tokenmanager.AccessTokenManager, localIdentities []*commonpb.Identity, verificationMode s2av2pb.ValidatePeerCertificateChainReq_VerificationMode) (*tls.Config, error) {
return &tls.Config{
GetConfigForClient: ClientConfig(tokenManager, localIdentities, verificationMode, s2AStream),
}, nil
@@ -136,7 +135,7 @@ func GetTLSConfigurationForServer(s2AStream stream.S2AStream, tokenManager token
// connection with a client, based on SNI communicated during ClientHello.
// Ensures that server presents the correct certificate to establish a TLS
// connection.
-func ClientConfig(tokenManager tokenmanager.AccessTokenManager, localIdentities []*commonpbv1.Identity, verificationMode s2av2pb.ValidatePeerCertificateChainReq_VerificationMode, s2AStream stream.S2AStream) func(chi *tls.ClientHelloInfo) (*tls.Config, error) {
+func ClientConfig(tokenManager tokenmanager.AccessTokenManager, localIdentities []*commonpb.Identity, verificationMode s2av2pb.ValidatePeerCertificateChainReq_VerificationMode, s2AStream stream.S2AStream) func(chi *tls.ClientHelloInfo) (*tls.Config, error) {
return func(chi *tls.ClientHelloInfo) (*tls.Config, error) {
tlsConfig, err := getServerConfigFromS2Av2(tokenManager, localIdentities, chi.ServerName, s2AStream)
if err != nil {
@@ -219,9 +218,9 @@ func getTLSCipherSuite(tlsCipherSuite commonpb.Ciphersuite) uint16 {
}
}
-func getServerConfigFromS2Av2(tokenManager tokenmanager.AccessTokenManager, localIdentities []*commonpbv1.Identity, sni string, s2AStream stream.S2AStream) (*s2av2pb.GetTlsConfigurationResp_ServerTlsConfiguration, error) {
+func getServerConfigFromS2Av2(tokenManager tokenmanager.AccessTokenManager, localIdentities []*commonpb.Identity, sni string, s2AStream stream.S2AStream) (*s2av2pb.GetTlsConfigurationResp_ServerTlsConfiguration, error) {
authMechanisms := getAuthMechanisms(tokenManager, localIdentities)
- var locID *commonpbv1.Identity
+ var locID *commonpb.Identity
if localIdentities != nil {
locID = localIdentities[0]
}
@@ -283,7 +282,7 @@ func getTLSClientAuthType(tlsConfig *s2av2pb.GetTlsConfigurationResp_ServerTlsCo
return clientAuth
}
-func getAuthMechanisms(tokenManager tokenmanager.AccessTokenManager, localIdentities []*commonpbv1.Identity) []*s2av2pb.AuthenticationMechanism {
+func getAuthMechanisms(tokenManager tokenmanager.AccessTokenManager, localIdentities []*commonpb.Identity) []*s2av2pb.AuthenticationMechanism {
if tokenManager == nil {
return nil
}
diff --git a/vendor/github.com/google/s2a-go/s2a.go b/vendor/github.com/google/s2a-go/s2a.go
index 5ecb06f9..cc79bd09 100644
--- a/vendor/github.com/google/s2a-go/s2a.go
+++ b/vendor/github.com/google/s2a-go/s2a.go
@@ -29,7 +29,6 @@ import (
"sync"
"time"
- "github.com/golang/protobuf/proto"
"github.com/google/s2a-go/fallback"
"github.com/google/s2a-go/internal/handshaker"
"github.com/google/s2a-go/internal/handshaker/service"
@@ -38,8 +37,10 @@ import (
"github.com/google/s2a-go/retry"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/grpclog"
+ "google.golang.org/protobuf/proto"
- commonpb "github.com/google/s2a-go/internal/proto/common_go_proto"
+ commonpbv1 "github.com/google/s2a-go/internal/proto/common_go_proto"
+ commonpb "github.com/google/s2a-go/internal/proto/v2/common_go_proto"
s2av2pb "github.com/google/s2a-go/internal/proto/v2/s2a_go_proto"
)
@@ -54,17 +55,17 @@ const (
// credentials.TransportCredentials interface.
type s2aTransportCreds struct {
info *credentials.ProtocolInfo
- minTLSVersion commonpb.TLSVersion
- maxTLSVersion commonpb.TLSVersion
+ minTLSVersion commonpbv1.TLSVersion
+ maxTLSVersion commonpbv1.TLSVersion
// tlsCiphersuites contains the ciphersuites used in the S2A connection.
// Note that these are currently unconfigurable.
- tlsCiphersuites []commonpb.Ciphersuite
+ tlsCiphersuites []commonpbv1.Ciphersuite
// localIdentity should only be used by the client.
- localIdentity *commonpb.Identity
+ localIdentity *commonpbv1.Identity
// localIdentities should only be used by the server.
- localIdentities []*commonpb.Identity
+ localIdentities []*commonpbv1.Identity
// targetIdentities should only be used by the client.
- targetIdentities []*commonpb.Identity
+ targetIdentities []*commonpbv1.Identity
isClient bool
s2aAddr string
ensureProcessSessionTickets *sync.WaitGroup
@@ -76,7 +77,7 @@ func NewClientCreds(opts *ClientOptions) (credentials.TransportCredentials, erro
if opts == nil {
return nil, errors.New("nil client options")
}
- var targetIdentities []*commonpb.Identity
+ var targetIdentities []*commonpbv1.Identity
for _, targetIdentity := range opts.TargetIdentities {
protoTargetIdentity, err := toProtoIdentity(targetIdentity)
if err != nil {
@@ -93,12 +94,12 @@ func NewClientCreds(opts *ClientOptions) (credentials.TransportCredentials, erro
info: &credentials.ProtocolInfo{
SecurityProtocol: s2aSecurityProtocol,
},
- minTLSVersion: commonpb.TLSVersion_TLS1_3,
- maxTLSVersion: commonpb.TLSVersion_TLS1_3,
- tlsCiphersuites: []commonpb.Ciphersuite{
- commonpb.Ciphersuite_AES_128_GCM_SHA256,
- commonpb.Ciphersuite_AES_256_GCM_SHA384,
- commonpb.Ciphersuite_CHACHA20_POLY1305_SHA256,
+ minTLSVersion: commonpbv1.TLSVersion_TLS1_3,
+ maxTLSVersion: commonpbv1.TLSVersion_TLS1_3,
+ tlsCiphersuites: []commonpbv1.Ciphersuite{
+ commonpbv1.Ciphersuite_AES_128_GCM_SHA256,
+ commonpbv1.Ciphersuite_AES_256_GCM_SHA384,
+ commonpbv1.Ciphersuite_CHACHA20_POLY1305_SHA256,
},
localIdentity: localIdentity,
targetIdentities: targetIdentities,
@@ -112,7 +113,11 @@ func NewClientCreds(opts *ClientOptions) (credentials.TransportCredentials, erro
if opts.FallbackOpts != nil && opts.FallbackOpts.FallbackClientHandshakeFunc != nil {
fallbackFunc = opts.FallbackOpts.FallbackClientHandshakeFunc
}
- return v2.NewClientCreds(opts.S2AAddress, opts.TransportCreds, localIdentity, verificationMode, fallbackFunc, opts.getS2AStream, opts.serverAuthorizationPolicy)
+ v2LocalIdentity, err := toV2ProtoIdentity(opts.LocalIdentity)
+ if err != nil {
+ return nil, err
+ }
+ return v2.NewClientCreds(opts.S2AAddress, opts.TransportCreds, v2LocalIdentity, verificationMode, fallbackFunc, opts.getS2AStream, opts.serverAuthorizationPolicy)
}
// NewServerCreds returns a server-side transport credentials object that uses
@@ -121,7 +126,7 @@ func NewServerCreds(opts *ServerOptions) (credentials.TransportCredentials, erro
if opts == nil {
return nil, errors.New("nil server options")
}
- var localIdentities []*commonpb.Identity
+ var localIdentities []*commonpbv1.Identity
for _, localIdentity := range opts.LocalIdentities {
protoLocalIdentity, err := toProtoIdentity(localIdentity)
if err != nil {
@@ -134,12 +139,12 @@ func NewServerCreds(opts *ServerOptions) (credentials.TransportCredentials, erro
info: &credentials.ProtocolInfo{
SecurityProtocol: s2aSecurityProtocol,
},
- minTLSVersion: commonpb.TLSVersion_TLS1_3,
- maxTLSVersion: commonpb.TLSVersion_TLS1_3,
- tlsCiphersuites: []commonpb.Ciphersuite{
- commonpb.Ciphersuite_AES_128_GCM_SHA256,
- commonpb.Ciphersuite_AES_256_GCM_SHA384,
- commonpb.Ciphersuite_CHACHA20_POLY1305_SHA256,
+ minTLSVersion: commonpbv1.TLSVersion_TLS1_3,
+ maxTLSVersion: commonpbv1.TLSVersion_TLS1_3,
+ tlsCiphersuites: []commonpbv1.Ciphersuite{
+ commonpbv1.Ciphersuite_AES_128_GCM_SHA256,
+ commonpbv1.Ciphersuite_AES_256_GCM_SHA384,
+ commonpbv1.Ciphersuite_CHACHA20_POLY1305_SHA256,
},
localIdentities: localIdentities,
isClient: false,
@@ -147,7 +152,15 @@ func NewServerCreds(opts *ServerOptions) (credentials.TransportCredentials, erro
}, nil
}
verificationMode := getVerificationMode(opts.VerificationMode)
- return v2.NewServerCreds(opts.S2AAddress, opts.TransportCreds, localIdentities, verificationMode, opts.getS2AStream)
+ var v2LocalIdentities []*commonpb.Identity
+ for _, localIdentity := range opts.LocalIdentities {
+ protoLocalIdentity, err := toV2ProtoIdentity(localIdentity)
+ if err != nil {
+ return nil, err
+ }
+ v2LocalIdentities = append(v2LocalIdentities, protoLocalIdentity)
+ }
+ return v2.NewServerCreds(opts.S2AAddress, opts.TransportCreds, v2LocalIdentities, verificationMode, opts.getS2AStream)
}
// ClientHandshake initiates a client-side TLS handshake using the S2A.
@@ -248,22 +261,22 @@ func (c *s2aTransportCreds) Info() credentials.ProtocolInfo {
func (c *s2aTransportCreds) Clone() credentials.TransportCredentials {
info := *c.info
- var localIdentity *commonpb.Identity
+ var localIdentity *commonpbv1.Identity
if c.localIdentity != nil {
- localIdentity = proto.Clone(c.localIdentity).(*commonpb.Identity)
+ localIdentity = proto.Clone(c.localIdentity).(*commonpbv1.Identity)
}
- var localIdentities []*commonpb.Identity
+ var localIdentities []*commonpbv1.Identity
if c.localIdentities != nil {
- localIdentities = make([]*commonpb.Identity, len(c.localIdentities))
+ localIdentities = make([]*commonpbv1.Identity, len(c.localIdentities))
for i, localIdentity := range c.localIdentities {
- localIdentities[i] = proto.Clone(localIdentity).(*commonpb.Identity)
+ localIdentities[i] = proto.Clone(localIdentity).(*commonpbv1.Identity)
}
}
- var targetIdentities []*commonpb.Identity
+ var targetIdentities []*commonpbv1.Identity
if c.targetIdentities != nil {
- targetIdentities = make([]*commonpb.Identity, len(c.targetIdentities))
+ targetIdentities = make([]*commonpbv1.Identity, len(c.targetIdentities))
for i, targetIdentity := range c.targetIdentities {
- targetIdentities[i] = proto.Clone(targetIdentity).(*commonpb.Identity)
+ targetIdentities[i] = proto.Clone(targetIdentity).(*commonpbv1.Identity)
}
}
return &s2aTransportCreds{
@@ -351,6 +364,12 @@ func getVerificationMode(verificationMode VerificationModeType) s2av2pb.Validate
return s2av2pb.ValidatePeerCertificateChainReq_CONNECT_TO_GOOGLE
case Spiffe:
return s2av2pb.ValidatePeerCertificateChainReq_SPIFFE
+ case ReservedCustomVerificationMode3:
+ return s2av2pb.ValidatePeerCertificateChainReq_RESERVED_CUSTOM_VERIFICATION_MODE_3
+ case ReservedCustomVerificationMode4:
+ return s2av2pb.ValidatePeerCertificateChainReq_RESERVED_CUSTOM_VERIFICATION_MODE_4
+ case ReservedCustomVerificationMode5:
+ return s2av2pb.ValidatePeerCertificateChainReq_RESERVED_CUSTOM_VERIFICATION_MODE_5
default:
return s2av2pb.ValidatePeerCertificateChainReq_UNSPECIFIED
}
@@ -396,24 +415,20 @@ func NewS2ADialTLSContextFunc(opts *ClientOptions) func(ctx context.Context, net
defer cancel()
var s2aTLSConfig *tls.Config
+ var c net.Conn
retry.Run(timeoutCtx,
func() error {
s2aTLSConfig, err = factory.Build(timeoutCtx, &TLSClientConfigOptions{
ServerName: serverName,
})
- return err
- })
- if err != nil {
- grpclog.Infof("error building S2A TLS config: %v", err)
- return fallback(err)
- }
+ if err != nil {
+ grpclog.Infof("error building S2A TLS config: %v", err)
+ return err
+ }
- s2aDialer := &tls.Dialer{
- Config: s2aTLSConfig,
- }
- var c net.Conn
- retry.Run(timeoutCtx,
- func() error {
+ s2aDialer := &tls.Dialer{
+ Config: s2aTLSConfig,
+ }
c, err = s2aDialer.DialContext(timeoutCtx, network, addr)
return err
})
diff --git a/vendor/github.com/google/s2a-go/s2a_options.go b/vendor/github.com/google/s2a-go/s2a_options.go
index fcdbc162..5bbf31bf 100644
--- a/vendor/github.com/google/s2a-go/s2a_options.go
+++ b/vendor/github.com/google/s2a-go/s2a_options.go
@@ -28,7 +28,8 @@ import (
"github.com/google/s2a-go/stream"
"google.golang.org/grpc/credentials"
- s2apb "github.com/google/s2a-go/internal/proto/common_go_proto"
+ s2apbv1 "github.com/google/s2a-go/internal/proto/common_go_proto"
+ s2apb "github.com/google/s2a-go/internal/proto/v2/common_go_proto"
)
// Identity is the interface for S2A identities.
@@ -76,9 +77,12 @@ type VerificationModeType int
// Three types of verification modes.
const (
- Unspecified = iota
- ConnectToGoogle
+ Unspecified VerificationModeType = iota
Spiffe
+ ConnectToGoogle
+ ReservedCustomVerificationMode3
+ ReservedCustomVerificationMode4
+ ReservedCustomVerificationMode5
)
// ClientOptions contains the client-side options used to establish a secure
@@ -198,7 +202,23 @@ func DefaultServerOptions(s2aAddress string) *ServerOptions {
}
}
-func toProtoIdentity(identity Identity) (*s2apb.Identity, error) {
+func toProtoIdentity(identity Identity) (*s2apbv1.Identity, error) {
+ if identity == nil {
+ return nil, nil
+ }
+ switch id := identity.(type) {
+ case *spiffeID:
+ return &s2apbv1.Identity{IdentityOneof: &s2apbv1.Identity_SpiffeId{SpiffeId: id.Name()}}, nil
+ case *hostname:
+ return &s2apbv1.Identity{IdentityOneof: &s2apbv1.Identity_Hostname{Hostname: id.Name()}}, nil
+ case *uid:
+ return &s2apbv1.Identity{IdentityOneof: &s2apbv1.Identity_Uid{Uid: id.Name()}}, nil
+ default:
+ return nil, errors.New("unrecognized identity type")
+ }
+}
+
+func toV2ProtoIdentity(identity Identity) (*s2apb.Identity, error) {
if identity == nil {
return nil, nil
}
diff --git a/vendor/github.com/google/uuid/CHANGELOG.md b/vendor/github.com/google/uuid/CHANGELOG.md
index c9fb829d..7ec5ac7e 100644
--- a/vendor/github.com/google/uuid/CHANGELOG.md
+++ b/vendor/github.com/google/uuid/CHANGELOG.md
@@ -1,5 +1,18 @@
# Changelog
+## [1.6.0](https://github.com/google/uuid/compare/v1.5.0...v1.6.0) (2024-01-16)
+
+
+### Features
+
+* add Max UUID constant ([#149](https://github.com/google/uuid/issues/149)) ([c58770e](https://github.com/google/uuid/commit/c58770eb495f55fe2ced6284f93c5158a62e53e3))
+
+
+### Bug Fixes
+
+* fix typo in version 7 uuid documentation ([#153](https://github.com/google/uuid/issues/153)) ([016b199](https://github.com/google/uuid/commit/016b199544692f745ffc8867b914129ecb47ef06))
+* Monotonicity in UUIDv7 ([#150](https://github.com/google/uuid/issues/150)) ([a2b2b32](https://github.com/google/uuid/commit/a2b2b32373ff0b1a312b7fdf6d38a977099698a6))
+
## [1.5.0](https://github.com/google/uuid/compare/v1.4.0...v1.5.0) (2023-12-12)
diff --git a/vendor/github.com/google/uuid/hash.go b/vendor/github.com/google/uuid/hash.go
index b404f4be..dc60082d 100644
--- a/vendor/github.com/google/uuid/hash.go
+++ b/vendor/github.com/google/uuid/hash.go
@@ -17,6 +17,12 @@ var (
NameSpaceOID = Must(Parse("6ba7b812-9dad-11d1-80b4-00c04fd430c8"))
NameSpaceX500 = Must(Parse("6ba7b814-9dad-11d1-80b4-00c04fd430c8"))
Nil UUID // empty UUID, all zeros
+
+ // The Max UUID is special form of UUID that is specified to have all 128 bits set to 1.
+ Max = UUID{
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ }
)
// NewHash returns a new UUID derived from the hash of space concatenated with
diff --git a/vendor/github.com/google/uuid/version7.go b/vendor/github.com/google/uuid/version7.go
index ba9dd5eb..3167b643 100644
--- a/vendor/github.com/google/uuid/version7.go
+++ b/vendor/github.com/google/uuid/version7.go
@@ -44,7 +44,7 @@ func NewV7FromReader(r io.Reader) (UUID, error) {
// makeV7 fill 48 bits time (uuid[0] - uuid[5]), set version b0111 (uuid[6])
// uuid[8] already has the right version number (Variant is 10)
-// see function NewV7 and NewV7FromReader
+// see function NewV7 and NewV7FromReader
func makeV7(uuid []byte) {
/*
0 1 2 3
@@ -52,7 +52,7 @@ func makeV7(uuid []byte) {
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| unix_ts_ms |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | unix_ts_ms | ver | rand_a |
+ | unix_ts_ms | ver | rand_a (12 bit seq) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|var| rand_b |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -61,7 +61,7 @@ func makeV7(uuid []byte) {
*/
_ = uuid[15] // bounds check
- t := timeNow().UnixMilli()
+ t, s := getV7Time()
uuid[0] = byte(t >> 40)
uuid[1] = byte(t >> 32)
@@ -70,6 +70,35 @@ func makeV7(uuid []byte) {
uuid[4] = byte(t >> 8)
uuid[5] = byte(t)
- uuid[6] = 0x70 | (uuid[6] & 0x0F)
- // uuid[8] has already has right version
+ uuid[6] = 0x70 | (0x0F & byte(s>>8))
+ uuid[7] = byte(s)
+}
+
+// lastV7time is the last time we returned stored as:
+//
+// 52 bits of time in milliseconds since epoch
+// 12 bits of (fractional nanoseconds) >> 8
+var lastV7time int64
+
+const nanoPerMilli = 1000000
+
+// getV7Time returns the time in milliseconds and nanoseconds / 256.
+// The returned (milli << 12 + seq) is guarenteed to be greater than
+// (milli << 12 + seq) returned by any previous call to getV7Time.
+func getV7Time() (milli, seq int64) {
+ timeMu.Lock()
+ defer timeMu.Unlock()
+
+ nano := timeNow().UnixNano()
+ milli = nano / nanoPerMilli
+ // Sequence number is between 0 and 3906 (nanoPerMilli>>8)
+ seq = (nano - milli*nanoPerMilli) >> 8
+ now := milli<<12 + seq
+ if now <= lastV7time {
+ now = lastV7time + 1
+ milli = now >> 12
+ seq = now & 0xfff
+ }
+ lastV7time = now
+ return milli, seq
}
diff --git a/vendor/github.com/googleapis/gax-go/v2/.release-please-manifest.json b/vendor/github.com/googleapis/gax-go/v2/.release-please-manifest.json
index ef508417..29a5900c 100644
--- a/vendor/github.com/googleapis/gax-go/v2/.release-please-manifest.json
+++ b/vendor/github.com/googleapis/gax-go/v2/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- "v2": "2.12.0"
+ "v2": "2.14.0"
}
diff --git a/vendor/github.com/googleapis/gax-go/v2/CHANGES.md b/vendor/github.com/googleapis/gax-go/v2/CHANGES.md
index ae711494..9fb90359 100644
--- a/vendor/github.com/googleapis/gax-go/v2/CHANGES.md
+++ b/vendor/github.com/googleapis/gax-go/v2/CHANGES.md
@@ -1,5 +1,54 @@
# Changelog
+## [2.14.0](https://github.com/googleapis/gax-go/compare/v2.13.0...v2.14.0) (2024-11-13)
+
+
+### Features
+
+* **internallog:** add a logging support package ([#380](https://github.com/googleapis/gax-go/issues/380)) ([c877470](https://github.com/googleapis/gax-go/commit/c87747098135631a3de5865ed03aaf2c79fd9319))
+
+## [2.13.0](https://github.com/googleapis/gax-go/compare/v2.12.5...v2.13.0) (2024-07-22)
+
+
+### Features
+
+* **iterator:** add package to help work with new iter.Seq types ([#358](https://github.com/googleapis/gax-go/issues/358)) ([6bccdaa](https://github.com/googleapis/gax-go/commit/6bccdaac011fe6fd147e4eb533a8e6520b7d4acc))
+
+## [2.12.5](https://github.com/googleapis/gax-go/compare/v2.12.4...v2.12.5) (2024-06-18)
+
+
+### Bug Fixes
+
+* **v2/apierror:** fix (*APIError).Error() for unwrapped Status ([#351](https://github.com/googleapis/gax-go/issues/351)) ([22c16e7](https://github.com/googleapis/gax-go/commit/22c16e7bff5402bdc4c25063771cdd01c650b500)), refs [#350](https://github.com/googleapis/gax-go/issues/350)
+
+## [2.12.4](https://github.com/googleapis/gax-go/compare/v2.12.3...v2.12.4) (2024-05-03)
+
+
+### Bug Fixes
+
+* provide unmarshal options for streams ([#343](https://github.com/googleapis/gax-go/issues/343)) ([ddf9a90](https://github.com/googleapis/gax-go/commit/ddf9a90bf180295d49875e15cb80b2136a49dbaf))
+
+## [2.12.3](https://github.com/googleapis/gax-go/compare/v2.12.2...v2.12.3) (2024-03-14)
+
+
+### Bug Fixes
+
+* bump protobuf dep to v1.33 ([#333](https://github.com/googleapis/gax-go/issues/333)) ([2892b22](https://github.com/googleapis/gax-go/commit/2892b22c1ae8a70dec3448d82e634643fe6c1be2))
+
+## [2.12.2](https://github.com/googleapis/gax-go/compare/v2.12.1...v2.12.2) (2024-02-23)
+
+
+### Bug Fixes
+
+* **v2/callctx:** fix SetHeader race by cloning header map ([#326](https://github.com/googleapis/gax-go/issues/326)) ([534311f](https://github.com/googleapis/gax-go/commit/534311f0f163d101f30657736c0e6f860e9c39dc))
+
+## [2.12.1](https://github.com/googleapis/gax-go/compare/v2.12.0...v2.12.1) (2024-02-13)
+
+
+### Bug Fixes
+
+* add XGoogFieldMaskHeader constant ([#321](https://github.com/googleapis/gax-go/issues/321)) ([666ee08](https://github.com/googleapis/gax-go/commit/666ee08931041b7fed56bed7132649785b2d3dfe))
+
## [2.12.0](https://github.com/googleapis/gax-go/compare/v2.11.0...v2.12.0) (2023-06-26)
diff --git a/vendor/github.com/googleapis/gax-go/v2/apierror/apierror.go b/vendor/github.com/googleapis/gax-go/v2/apierror/apierror.go
index d785a065..7de60773 100644
--- a/vendor/github.com/googleapis/gax-go/v2/apierror/apierror.go
+++ b/vendor/github.com/googleapis/gax-go/v2/apierror/apierror.go
@@ -206,8 +206,10 @@ func (a *APIError) Error() string {
// Truncate the googleapi.Error message because it dumps the Details in
// an ugly way.
msg = fmt.Sprintf("googleapi: Error %d: %s", a.httpErr.Code, a.httpErr.Message)
- } else if a.status != nil {
+ } else if a.status != nil && a.err != nil {
msg = a.err.Error()
+ } else if a.status != nil {
+ msg = a.status.Message()
}
return strings.TrimSpace(fmt.Sprintf("%s\n%s", msg, a.details))
}
diff --git a/vendor/github.com/googleapis/gax-go/v2/callctx/callctx.go b/vendor/github.com/googleapis/gax-go/v2/callctx/callctx.go
index af15fb58..f5af5c99 100644
--- a/vendor/github.com/googleapis/gax-go/v2/callctx/callctx.go
+++ b/vendor/github.com/googleapis/gax-go/v2/callctx/callctx.go
@@ -38,6 +38,14 @@ import (
)
const (
+ // XGoogFieldMaskHeader is the canonical header key for the [System Parameter]
+ // that specifies the response read mask. The value(s) for this header
+ // must adhere to format described in [fieldmaskpb].
+ //
+ // [System Parameter]: https://cloud.google.com/apis/docs/system-parameters
+ // [fieldmaskpb]: https://google.golang.org/protobuf/types/known/fieldmaskpb
+ XGoogFieldMaskHeader = "x-goog-fieldmask"
+
headerKey = contextKey("header")
)
@@ -66,9 +74,27 @@ func SetHeaders(ctx context.Context, keyvals ...string) context.Context {
h, ok := ctx.Value(headerKey).(map[string][]string)
if !ok {
h = make(map[string][]string)
+ } else {
+ h = cloneHeaders(h)
}
+
for i := 0; i < len(keyvals); i = i + 2 {
h[keyvals[i]] = append(h[keyvals[i]], keyvals[i+1])
}
return context.WithValue(ctx, headerKey, h)
}
+
+// cloneHeaders makes a new key-value map while reusing the value slices.
+// As such, new values should be appended to the value slice, and modifying
+// indexed values is not thread safe.
+//
+// TODO: Replace this with maps.Clone when Go 1.21 is the minimum version.
+func cloneHeaders(h map[string][]string) map[string][]string {
+ c := make(map[string][]string, len(h))
+ for k, v := range h {
+ vc := make([]string, len(v))
+ copy(vc, v)
+ c[k] = vc
+ }
+ return c
+}
diff --git a/vendor/github.com/googleapis/gax-go/v2/header.go b/vendor/github.com/googleapis/gax-go/v2/header.go
index 453fab7e..f5273985 100644
--- a/vendor/github.com/googleapis/gax-go/v2/header.go
+++ b/vendor/github.com/googleapis/gax-go/v2/header.go
@@ -103,7 +103,9 @@ func goVersion() string {
return "UNKNOWN"
}
-// XGoogHeader is for use by the Google Cloud Libraries only.
+// XGoogHeader is for use by the Google Cloud Libraries only. See package
+// [github.com/googleapis/gax-go/v2/callctx] for help setting/retrieving
+// request/response headers.
//
// XGoogHeader formats key-value pairs.
// The resulting string is suitable for x-goog-api-client header.
@@ -125,7 +127,8 @@ func XGoogHeader(keyval ...string) string {
}
// InsertMetadataIntoOutgoingContext is for use by the Google Cloud Libraries
-// only.
+// only. See package [github.com/googleapis/gax-go/v2/callctx] for help
+// setting/retrieving request/response headers.
//
// InsertMetadataIntoOutgoingContext returns a new context that merges the
// provided keyvals metadata pairs with any existing metadata/headers in the
@@ -137,7 +140,9 @@ func InsertMetadataIntoOutgoingContext(ctx context.Context, keyvals ...string) c
return metadata.NewOutgoingContext(ctx, insertMetadata(ctx, keyvals...))
}
-// BuildHeaders is for use by the Google Cloud Libraries only.
+// BuildHeaders is for use by the Google Cloud Libraries only. See package
+// [github.com/googleapis/gax-go/v2/callctx] for help setting/retrieving
+// request/response headers.
//
// BuildHeaders returns a new http.Header that merges the provided
// keyvals header pairs with any existing metadata/headers in the provided
@@ -158,11 +163,38 @@ func insertMetadata(ctx context.Context, keyvals ...string) metadata.MD {
out = metadata.MD(make(map[string][]string))
}
headers := callctx.HeadersFromContext(ctx)
- for k, v := range headers {
- out[k] = append(out[k], v...)
+
+ // x-goog-api-client is a special case that we want to make sure gets merged
+ // into a single header.
+ const xGoogHeader = "x-goog-api-client"
+ var mergedXgoogHeader strings.Builder
+
+ for k, vals := range headers {
+ if k == xGoogHeader {
+ // Merge all values for the x-goog-api-client header set on the ctx.
+ for _, v := range vals {
+ mergedXgoogHeader.WriteString(v)
+ mergedXgoogHeader.WriteRune(' ')
+ }
+ continue
+ }
+ out[k] = append(out[k], vals...)
}
for i := 0; i < len(keyvals); i = i + 2 {
out[keyvals[i]] = append(out[keyvals[i]], keyvals[i+1])
+
+ if keyvals[i] == xGoogHeader {
+ // Merge the x-goog-api-client header values set on the ctx with any
+ // values passed in for it from the client.
+ mergedXgoogHeader.WriteString(keyvals[i+1])
+ mergedXgoogHeader.WriteRune(' ')
+ }
+ }
+
+ // Add the x goog header back in, replacing the separate values that were set.
+ if mergedXgoogHeader.Len() > 0 {
+ out[xGoogHeader] = []string{mergedXgoogHeader.String()[:mergedXgoogHeader.Len()-1]}
}
+
return out
}
diff --git a/vendor/github.com/googleapis/gax-go/v2/internal/version.go b/vendor/github.com/googleapis/gax-go/v2/internal/version.go
index 7425b5ff..88288934 100644
--- a/vendor/github.com/googleapis/gax-go/v2/internal/version.go
+++ b/vendor/github.com/googleapis/gax-go/v2/internal/version.go
@@ -30,4 +30,4 @@
package internal
// Version is the current tagged release of the library.
-const Version = "2.12.0"
+const Version = "2.14.0"
diff --git a/vendor/github.com/googleapis/gax-go/v2/internallog/internal/internal.go b/vendor/github.com/googleapis/gax-go/v2/internallog/internal/internal.go
new file mode 100644
index 00000000..19f4be35
--- /dev/null
+++ b/vendor/github.com/googleapis/gax-go/v2/internallog/internal/internal.go
@@ -0,0 +1,134 @@
+// Copyright 2024, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Package internal provides some common logic and types to other logging
+// sub-packages.
+package internal
+
+import (
+ "context"
+ "io"
+ "log/slog"
+ "os"
+ "strings"
+ "time"
+)
+
+const (
+ // LoggingLevelEnvVar is the environment variable used to enable logging
+ // at a particular level.
+ LoggingLevelEnvVar = "GOOGLE_SDK_GO_LOGGING_LEVEL"
+
+ googLvlKey = "severity"
+ googMsgKey = "message"
+ googSourceKey = "sourceLocation"
+ googTimeKey = "timestamp"
+)
+
+// NewLoggerWithWriter is exposed for testing.
+func NewLoggerWithWriter(w io.Writer) *slog.Logger {
+ lvl, loggingEnabled := checkLoggingLevel()
+ if !loggingEnabled {
+ return slog.New(noOpHandler{})
+ }
+ return slog.New(newGCPSlogHandler(lvl, w))
+}
+
+// checkLoggingLevel returned the configured logging level and whether or not
+// logging is enabled.
+func checkLoggingLevel() (slog.Leveler, bool) {
+ sLevel := strings.ToLower(os.Getenv(LoggingLevelEnvVar))
+ var level slog.Level
+ switch sLevel {
+ case "debug":
+ level = slog.LevelDebug
+ case "info":
+ level = slog.LevelInfo
+ case "warn":
+ level = slog.LevelWarn
+ case "error":
+ level = slog.LevelError
+ default:
+ return nil, false
+ }
+ return level, true
+}
+
+// newGCPSlogHandler returns a Handler that is configured to output in a JSON
+// format with well-known keys. For more information on this format see
+// https://cloud.google.com/logging/docs/agent/logging/configuration#special-fields.
+func newGCPSlogHandler(lvl slog.Leveler, w io.Writer) slog.Handler {
+ return slog.NewJSONHandler(w, &slog.HandlerOptions{
+ Level: lvl,
+ ReplaceAttr: replaceAttr,
+ })
+}
+
+// replaceAttr remaps default Go logging keys to match what is expected in
+// cloud logging.
+func replaceAttr(groups []string, a slog.Attr) slog.Attr {
+ if groups == nil {
+ if a.Key == slog.LevelKey {
+ a.Key = googLvlKey
+ return a
+ } else if a.Key == slog.MessageKey {
+ a.Key = googMsgKey
+ return a
+ } else if a.Key == slog.SourceKey {
+ a.Key = googSourceKey
+ return a
+ } else if a.Key == slog.TimeKey {
+ a.Key = googTimeKey
+ if a.Value.Kind() == slog.KindTime {
+ a.Value = slog.StringValue(a.Value.Time().Format(time.RFC3339))
+ }
+ return a
+ }
+ }
+ return a
+}
+
+// The handler returned if logging is not enabled.
+type noOpHandler struct{}
+
+func (h noOpHandler) Enabled(_ context.Context, _ slog.Level) bool {
+ return false
+}
+
+func (h noOpHandler) Handle(_ context.Context, _ slog.Record) error {
+ return nil
+}
+
+func (h noOpHandler) WithAttrs(_ []slog.Attr) slog.Handler {
+ return h
+}
+
+func (h noOpHandler) WithGroup(_ string) slog.Handler {
+ return h
+}
diff --git a/vendor/github.com/googleapis/gax-go/v2/internallog/internallog.go b/vendor/github.com/googleapis/gax-go/v2/internallog/internallog.go
new file mode 100644
index 00000000..91b648a6
--- /dev/null
+++ b/vendor/github.com/googleapis/gax-go/v2/internallog/internallog.go
@@ -0,0 +1,154 @@
+// Copyright 2024, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Package internallog in intended for internal use by generated clients only.
+package internallog
+
+import (
+ "bytes"
+ "encoding/json"
+ "fmt"
+ "log/slog"
+ "net/http"
+ "os"
+ "strings"
+
+ "github.com/googleapis/gax-go/v2/internallog/internal"
+)
+
+// New returns a new [slog.Logger] default logger, or the provided logger if
+// non-nil. The returned logger will be a no-op logger unless the environment
+// variable GOOGLE_SDK_DEBUG_LOGGING is set.
+func New(l *slog.Logger) *slog.Logger {
+ if l != nil {
+ return l
+ }
+ return internal.NewLoggerWithWriter(os.Stderr)
+}
+
+// HTTPRequest returns a lazily evaluated [slog.LogValuer] for a
+// [http.Request] and the associated body.
+func HTTPRequest(req *http.Request, body []byte) slog.LogValuer {
+ return &request{
+ req: req,
+ payload: body,
+ }
+}
+
+type request struct {
+ req *http.Request
+ payload []byte
+}
+
+func (r *request) LogValue() slog.Value {
+ if r == nil || r.req == nil {
+ return slog.Value{}
+ }
+ var groupValueAttrs []slog.Attr
+ groupValueAttrs = append(groupValueAttrs, slog.String("method", r.req.Method))
+ groupValueAttrs = append(groupValueAttrs, slog.String("url", r.req.URL.String()))
+
+ var headerAttr []slog.Attr
+ for k, val := range r.req.Header {
+ headerAttr = append(headerAttr, slog.String(k, strings.Join(val, ",")))
+ }
+ if len(headerAttr) > 0 {
+ groupValueAttrs = append(groupValueAttrs, slog.Any("headers", headerAttr))
+ }
+
+ if len(r.payload) > 0 {
+ if attr, ok := processPayload(r.payload); ok {
+ groupValueAttrs = append(groupValueAttrs, attr)
+ }
+ }
+ return slog.GroupValue(groupValueAttrs...)
+}
+
+// HTTPResponse returns a lazily evaluated [slog.LogValuer] for a
+// [http.Response] and the associated body.
+func HTTPResponse(resp *http.Response, body []byte) slog.LogValuer {
+ return &response{
+ resp: resp,
+ payload: body,
+ }
+}
+
+type response struct {
+ resp *http.Response
+ payload []byte
+}
+
+func (r *response) LogValue() slog.Value {
+ if r == nil {
+ return slog.Value{}
+ }
+ var groupValueAttrs []slog.Attr
+ groupValueAttrs = append(groupValueAttrs, slog.String("status", fmt.Sprint(r.resp.StatusCode)))
+
+ var headerAttr []slog.Attr
+ for k, val := range r.resp.Header {
+ headerAttr = append(headerAttr, slog.String(k, strings.Join(val, ",")))
+ }
+ if len(headerAttr) > 0 {
+ groupValueAttrs = append(groupValueAttrs, slog.Any("headers", headerAttr))
+ }
+
+ if len(r.payload) > 0 {
+ if attr, ok := processPayload(r.payload); ok {
+ groupValueAttrs = append(groupValueAttrs, attr)
+ }
+ }
+ return slog.GroupValue(groupValueAttrs...)
+}
+
+func processPayload(payload []byte) (slog.Attr, bool) {
+ peekChar := payload[0]
+ if peekChar == '{' {
+ // JSON object
+ var m map[string]any
+ if err := json.Unmarshal(payload, &m); err == nil {
+ return slog.Any("payload", m), true
+ }
+ } else if peekChar == '[' {
+ // JSON array
+ var m []any
+ if err := json.Unmarshal(payload, &m); err == nil {
+ return slog.Any("payload", m), true
+ }
+ } else {
+ // Everything else
+ buf := &bytes.Buffer{}
+ if err := json.Compact(buf, payload); err != nil {
+ // Write raw payload incase of error
+ buf.Write(payload)
+ }
+ return slog.String("payload", buf.String()), true
+ }
+ return slog.Attr{}, false
+}
diff --git a/vendor/github.com/googleapis/gax-go/v2/proto_json_stream.go b/vendor/github.com/googleapis/gax-go/v2/proto_json_stream.go
index cc4486eb..9b690d40 100644
--- a/vendor/github.com/googleapis/gax-go/v2/proto_json_stream.go
+++ b/vendor/github.com/googleapis/gax-go/v2/proto_json_stream.go
@@ -111,7 +111,8 @@ func (s *ProtoJSONStream) Recv() (proto.Message, error) {
// Initialize a new instance of the protobuf message to unmarshal the
// raw data into.
m := s.typ.New().Interface()
- err := protojson.Unmarshal(raw, m)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ err := unm.Unmarshal(raw, m)
return m, err
}
diff --git a/vendor/github.com/hashicorp/go-retryablehttp/.go-version b/vendor/github.com/hashicorp/go-retryablehttp/.go-version
new file mode 100644
index 00000000..6fee2fed
--- /dev/null
+++ b/vendor/github.com/hashicorp/go-retryablehttp/.go-version
@@ -0,0 +1 @@
+1.22.2
diff --git a/vendor/github.com/hashicorp/go-retryablehttp/CHANGELOG.md b/vendor/github.com/hashicorp/go-retryablehttp/CHANGELOG.md
index 7a17b9f9..68a627c6 100644
--- a/vendor/github.com/hashicorp/go-retryablehttp/CHANGELOG.md
+++ b/vendor/github.com/hashicorp/go-retryablehttp/CHANGELOG.md
@@ -1,14 +1,32 @@
+## 0.7.7 (May 30, 2024)
+
+BUG FIXES:
+
+- client: avoid potentially leaking URL-embedded basic authentication credentials in logs (#158)
+
+## 0.7.6 (May 9, 2024)
+
+ENHANCEMENTS:
+
+- client: support a `RetryPrepare` function for modifying the request before retrying (#216)
+- client: support HTTP-date values for `Retry-After` header value (#138)
+- client: avoid reading entire body when the body is a `*bytes.Reader` (#197)
+
+BUG FIXES:
+
+- client: fix a broken check for invalid server certificate in go 1.20+ (#210)
+
## 0.7.5 (Nov 8, 2023)
-BUG FIXES
+BUG FIXES:
-- client: fixes an issue where the request body is not preserved on temporary redirects or re-established HTTP/2 connections [GH-207]
+- client: fixes an issue where the request body is not preserved on temporary redirects or re-established HTTP/2 connections (#207)
## 0.7.4 (Jun 6, 2023)
-BUG FIXES
+BUG FIXES:
-- client: fixing an issue where the Content-Type header wouldn't be sent with an empty payload when using HTTP/2 [GH-194]
+- client: fixing an issue where the Content-Type header wouldn't be sent with an empty payload when using HTTP/2 (#194)
## 0.7.3 (May 15, 2023)
diff --git a/vendor/github.com/hashicorp/go-retryablehttp/CODEOWNERS b/vendor/github.com/hashicorp/go-retryablehttp/CODEOWNERS
index f8389c99..d6dd78a2 100644
--- a/vendor/github.com/hashicorp/go-retryablehttp/CODEOWNERS
+++ b/vendor/github.com/hashicorp/go-retryablehttp/CODEOWNERS
@@ -1 +1 @@
-* @hashicorp/release-engineering
\ No newline at end of file
+* @hashicorp/go-retryablehttp-maintainers
diff --git a/vendor/github.com/hashicorp/go-retryablehttp/Makefile b/vendor/github.com/hashicorp/go-retryablehttp/Makefile
index da17640e..52552419 100644
--- a/vendor/github.com/hashicorp/go-retryablehttp/Makefile
+++ b/vendor/github.com/hashicorp/go-retryablehttp/Makefile
@@ -2,7 +2,7 @@ default: test
test:
go vet ./...
- go test -race ./...
+ go test -v -race ./...
updatedeps:
go get -f -t -u ./...
diff --git a/vendor/github.com/hashicorp/go-retryablehttp/README.md b/vendor/github.com/hashicorp/go-retryablehttp/README.md
index 8943becf..145a62f2 100644
--- a/vendor/github.com/hashicorp/go-retryablehttp/README.md
+++ b/vendor/github.com/hashicorp/go-retryablehttp/README.md
@@ -59,4 +59,4 @@ standardClient := retryClient.StandardClient() // *http.Client
```
For more usage and examples see the
-[godoc](http://godoc.org/github.com/hashicorp/go-retryablehttp).
+[pkg.go.dev](https://pkg.go.dev/github.com/hashicorp/go-retryablehttp).
diff --git a/vendor/github.com/hashicorp/go-retryablehttp/cert_error_go119.go b/vendor/github.com/hashicorp/go-retryablehttp/cert_error_go119.go
new file mode 100644
index 00000000..b2b27e87
--- /dev/null
+++ b/vendor/github.com/hashicorp/go-retryablehttp/cert_error_go119.go
@@ -0,0 +1,14 @@
+// Copyright (c) HashiCorp, Inc.
+// SPDX-License-Identifier: MPL-2.0
+
+//go:build !go1.20
+// +build !go1.20
+
+package retryablehttp
+
+import "crypto/x509"
+
+func isCertError(err error) bool {
+ _, ok := err.(x509.UnknownAuthorityError)
+ return ok
+}
diff --git a/vendor/github.com/hashicorp/go-retryablehttp/cert_error_go120.go b/vendor/github.com/hashicorp/go-retryablehttp/cert_error_go120.go
new file mode 100644
index 00000000..a3cd315a
--- /dev/null
+++ b/vendor/github.com/hashicorp/go-retryablehttp/cert_error_go120.go
@@ -0,0 +1,14 @@
+// Copyright (c) HashiCorp, Inc.
+// SPDX-License-Identifier: MPL-2.0
+
+//go:build go1.20
+// +build go1.20
+
+package retryablehttp
+
+import "crypto/tls"
+
+func isCertError(err error) bool {
+ _, ok := err.(*tls.CertificateVerificationError)
+ return ok
+}
diff --git a/vendor/github.com/hashicorp/go-retryablehttp/client.go b/vendor/github.com/hashicorp/go-retryablehttp/client.go
index c9edbd05..efee53c4 100644
--- a/vendor/github.com/hashicorp/go-retryablehttp/client.go
+++ b/vendor/github.com/hashicorp/go-retryablehttp/client.go
@@ -27,10 +27,8 @@ package retryablehttp
import (
"bytes"
"context"
- "crypto/x509"
"fmt"
"io"
- "io/ioutil"
"log"
"math"
"math/rand"
@@ -63,6 +61,10 @@ var (
// limit the size we consume to respReadLimit.
respReadLimit = int64(4096)
+ // timeNow sets the function that returns the current time.
+ // This defaults to time.Now. Changes to this should only be done in tests.
+ timeNow = time.Now
+
// A regular expression to match the error returned by net/http when the
// configured number of redirects is exhausted. This error isn't typed
// specifically so we resort to matching on the error string.
@@ -73,6 +75,11 @@ var (
// specifically so we resort to matching on the error string.
schemeErrorRe = regexp.MustCompile(`unsupported protocol scheme`)
+ // A regular expression to match the error returned by net/http when a
+ // request header or value is invalid. This error isn't typed
+ // specifically so we resort to matching on the error string.
+ invalidHeaderErrorRe = regexp.MustCompile(`invalid header`)
+
// A regular expression to match the error returned by net/http when the
// TLS certificate is not trusted. This error isn't typed
// specifically so we resort to matching on the error string.
@@ -248,21 +255,19 @@ func getBodyReaderAndContentLength(rawBody interface{}) (ReaderFunc, int64, erro
// deal with it seeking so want it to match here instead of the
// io.ReadSeeker case.
case *bytes.Reader:
- buf, err := ioutil.ReadAll(body)
- if err != nil {
- return nil, 0, err
- }
+ snapshot := *body
bodyReader = func() (io.Reader, error) {
- return bytes.NewReader(buf), nil
+ r := snapshot
+ return &r, nil
}
- contentLength = int64(len(buf))
+ contentLength = int64(body.Len())
// Compat case
case io.ReadSeeker:
raw := body
bodyReader = func() (io.Reader, error) {
_, err := raw.Seek(0, 0)
- return ioutil.NopCloser(raw), err
+ return io.NopCloser(raw), err
}
if lr, ok := raw.(LenReader); ok {
contentLength = int64(lr.Len())
@@ -270,7 +275,7 @@ func getBodyReaderAndContentLength(rawBody interface{}) (ReaderFunc, int64, erro
// Read all in so we can reset
case io.Reader:
- buf, err := ioutil.ReadAll(body)
+ buf, err := io.ReadAll(body)
if err != nil {
return nil, 0, err
}
@@ -393,6 +398,9 @@ type Backoff func(min, max time.Duration, attemptNum int, resp *http.Response) t
// attempted. If overriding this, be sure to close the body if needed.
type ErrorHandler func(resp *http.Response, err error, numTries int) (*http.Response, error)
+// PrepareRetry is called before retry operation. It can be used for example to re-sign the request
+type PrepareRetry func(req *http.Request) error
+
// Client is used to make HTTP requests. It adds additional functionality
// like automatic retries to tolerate minor outages.
type Client struct {
@@ -421,6 +429,9 @@ type Client struct {
// ErrorHandler specifies the custom error handler to use, if any
ErrorHandler ErrorHandler
+ // PrepareRetry can prepare the request for retry operation, for example re-sign it
+ PrepareRetry PrepareRetry
+
loggerInit sync.Once
clientInit sync.Once
}
@@ -494,11 +505,16 @@ func baseRetryPolicy(resp *http.Response, err error) (bool, error) {
return false, v
}
+ // Don't retry if the error was due to an invalid header.
+ if invalidHeaderErrorRe.MatchString(v.Error()) {
+ return false, v
+ }
+
// Don't retry if the error was due to TLS cert verification failure.
if notTrustedErrorRe.MatchString(v.Error()) {
return false, v
}
- if _, ok := v.Err.(x509.UnknownAuthorityError); ok {
+ if isCertError(v.Err) {
return false, v
}
}
@@ -535,10 +551,8 @@ func baseRetryPolicy(resp *http.Response, err error) (bool, error) {
func DefaultBackoff(min, max time.Duration, attemptNum int, resp *http.Response) time.Duration {
if resp != nil {
if resp.StatusCode == http.StatusTooManyRequests || resp.StatusCode == http.StatusServiceUnavailable {
- if s, ok := resp.Header["Retry-After"]; ok {
- if sleep, err := strconv.ParseInt(s[0], 10, 64); err == nil {
- return time.Second * time.Duration(sleep)
- }
+ if sleep, ok := parseRetryAfterHeader(resp.Header["Retry-After"]); ok {
+ return sleep
}
}
}
@@ -551,6 +565,41 @@ func DefaultBackoff(min, max time.Duration, attemptNum int, resp *http.Response)
return sleep
}
+// parseRetryAfterHeader parses the Retry-After header and returns the
+// delay duration according to the spec: https://httpwg.org/specs/rfc7231.html#header.retry-after
+// The bool returned will be true if the header was successfully parsed.
+// Otherwise, the header was either not present, or was not parseable according to the spec.
+//
+// Retry-After headers come in two flavors: Seconds or HTTP-Date
+//
+// Examples:
+// * Retry-After: Fri, 31 Dec 1999 23:59:59 GMT
+// * Retry-After: 120
+func parseRetryAfterHeader(headers []string) (time.Duration, bool) {
+ if len(headers) == 0 || headers[0] == "" {
+ return 0, false
+ }
+ header := headers[0]
+ // Retry-After: 120
+ if sleep, err := strconv.ParseInt(header, 10, 64); err == nil {
+ if sleep < 0 { // a negative sleep doesn't make sense
+ return 0, false
+ }
+ return time.Second * time.Duration(sleep), true
+ }
+
+ // Retry-After: Fri, 31 Dec 1999 23:59:59 GMT
+ retryTime, err := time.Parse(time.RFC1123, header)
+ if err != nil {
+ return 0, false
+ }
+ if until := retryTime.Sub(timeNow()); until > 0 {
+ return until, true
+ }
+ // date is in the past
+ return 0, true
+}
+
// LinearJitterBackoff provides a callback for Client.Backoff which will
// perform linear backoff based on the attempt number and with jitter to
// prevent a thundering herd.
@@ -578,13 +627,13 @@ func LinearJitterBackoff(min, max time.Duration, attemptNum int, resp *http.Resp
}
// Seed rand; doing this every time is fine
- rand := rand.New(rand.NewSource(int64(time.Now().Nanosecond())))
+ source := rand.New(rand.NewSource(int64(time.Now().Nanosecond())))
// Pick a random number that lies somewhere between the min and max and
// multiply by the attemptNum. attemptNum starts at zero so we always
// increment here. We first get a random percentage, then apply that to the
// difference between min and max, and add to min.
- jitter := rand.Float64() * float64(max-min)
+ jitter := source.Float64() * float64(max-min)
jitterMin := int64(jitter) + int64(min)
return time.Duration(jitterMin * int64(attemptNum))
}
@@ -609,19 +658,19 @@ func (c *Client) Do(req *Request) (*http.Response, error) {
if logger != nil {
switch v := logger.(type) {
case LeveledLogger:
- v.Debug("performing request", "method", req.Method, "url", req.URL)
+ v.Debug("performing request", "method", req.Method, "url", redactURL(req.URL))
case Logger:
- v.Printf("[DEBUG] %s %s", req.Method, req.URL)
+ v.Printf("[DEBUG] %s %s", req.Method, redactURL(req.URL))
}
}
var resp *http.Response
var attempt int
var shouldRetry bool
- var doErr, respErr, checkErr error
+ var doErr, respErr, checkErr, prepareErr error
for i := 0; ; i++ {
- doErr, respErr = nil, nil
+ doErr, respErr, prepareErr = nil, nil, nil
attempt++
// Always rewind the request body when non-nil.
@@ -634,7 +683,7 @@ func (c *Client) Do(req *Request) (*http.Response, error) {
if c, ok := body.(io.ReadCloser); ok {
req.Body = c
} else {
- req.Body = ioutil.NopCloser(body)
+ req.Body = io.NopCloser(body)
}
}
@@ -666,9 +715,9 @@ func (c *Client) Do(req *Request) (*http.Response, error) {
if err != nil {
switch v := logger.(type) {
case LeveledLogger:
- v.Error("request failed", "error", err, "method", req.Method, "url", req.URL)
+ v.Error("request failed", "error", err, "method", req.Method, "url", redactURL(req.URL))
case Logger:
- v.Printf("[ERR] %s %s request failed: %v", req.Method, req.URL, err)
+ v.Printf("[ERR] %s %s request failed: %v", req.Method, redactURL(req.URL), err)
}
} else {
// Call this here to maintain the behavior of logging all requests,
@@ -704,7 +753,7 @@ func (c *Client) Do(req *Request) (*http.Response, error) {
wait := c.Backoff(c.RetryWaitMin, c.RetryWaitMax, i, resp)
if logger != nil {
- desc := fmt.Sprintf("%s %s", req.Method, req.URL)
+ desc := fmt.Sprintf("%s %s", req.Method, redactURL(req.URL))
if resp != nil {
desc = fmt.Sprintf("%s (status: %d)", desc, resp.StatusCode)
}
@@ -728,17 +777,26 @@ func (c *Client) Do(req *Request) (*http.Response, error) {
// without racing against the closeBody call in persistConn.writeLoop.
httpreq := *req.Request
req.Request = &httpreq
+
+ if c.PrepareRetry != nil {
+ if err := c.PrepareRetry(req.Request); err != nil {
+ prepareErr = err
+ break
+ }
+ }
}
// this is the closest we have to success criteria
- if doErr == nil && respErr == nil && checkErr == nil && !shouldRetry {
+ if doErr == nil && respErr == nil && checkErr == nil && prepareErr == nil && !shouldRetry {
return resp, nil
}
defer c.HTTPClient.CloseIdleConnections()
var err error
- if checkErr != nil {
+ if prepareErr != nil {
+ err = prepareErr
+ } else if checkErr != nil {
err = checkErr
} else if respErr != nil {
err = respErr
@@ -760,17 +818,17 @@ func (c *Client) Do(req *Request) (*http.Response, error) {
// communicate why
if err == nil {
return nil, fmt.Errorf("%s %s giving up after %d attempt(s)",
- req.Method, req.URL, attempt)
+ req.Method, redactURL(req.URL), attempt)
}
return nil, fmt.Errorf("%s %s giving up after %d attempt(s): %w",
- req.Method, req.URL, attempt, err)
+ req.Method, redactURL(req.URL), attempt, err)
}
// Try to read the response body so we can reuse this connection.
func (c *Client) drainBody(body io.ReadCloser) {
defer body.Close()
- _, err := io.Copy(ioutil.Discard, io.LimitReader(body, respReadLimit))
+ _, err := io.Copy(io.Discard, io.LimitReader(body, respReadLimit))
if err != nil {
if c.logger() != nil {
switch v := c.logger().(type) {
@@ -845,3 +903,17 @@ func (c *Client) StandardClient() *http.Client {
Transport: &RoundTripper{Client: c},
}
}
+
+// Taken from url.URL#Redacted() which was introduced in go 1.15.
+// We can switch to using it directly if we'll bump the minimum required go version.
+func redactURL(u *url.URL) string {
+ if u == nil {
+ return ""
+ }
+
+ ru := *u
+ if _, has := ru.User.Password(); has {
+ ru.User = url.UserPassword(ru.User.Username(), "xxxxx")
+ }
+ return ru.String()
+}
diff --git a/vendor/github.com/hetznercloud/hcloud-go/hcloud/action.go b/vendor/github.com/hetznercloud/hcloud-go/hcloud/action.go
index 7100cf77..9b5d65e1 100644
--- a/vendor/github.com/hetznercloud/hcloud-go/hcloud/action.go
+++ b/vendor/github.com/hetznercloud/hcloud-go/hcloud/action.go
@@ -120,173 +120,6 @@ func (c *ActionClient) AllWithOpts(ctx context.Context, opts ActionListOpts) ([]
return c.action.All(ctx, opts)
}
-// WatchOverallProgress watches several actions' progress until they complete
-// with success or error. This watching happens in a goroutine and updates are
-// provided through the two returned channels:
-//
-// - The first channel receives percentage updates of the progress, based on
-// the number of completed versus total watched actions. The return value
-// is an int between 0 and 100.
-// - The second channel returned receives errors for actions that did not
-// complete successfully, as well as any errors that happened while
-// querying the API.
-//
-// By default, the method keeps watching until all actions have finished
-// processing. If you want to be able to cancel the method or configure a
-// timeout, use the [context.Context]. Once the method has stopped watching,
-// both returned channels are closed.
-//
-// WatchOverallProgress uses the [WithPollBackoffFunc] of the [Client] to wait
-// until sending the next request.
-func (c *ActionClient) WatchOverallProgress(ctx context.Context, actions []*Action) (<-chan int, <-chan error) {
- errCh := make(chan error, len(actions))
- progressCh := make(chan int)
-
- go func() {
- defer close(errCh)
- defer close(progressCh)
-
- completedIDs := make([]int, 0, len(actions))
- watchIDs := make(map[int]struct{}, len(actions))
-
- for _, action := range actions {
- watchIDs[action.ID] = struct{}{}
- }
-
- retries := 0
- previousProgress := 0
-
- for {
- select {
- case <-ctx.Done():
- errCh <- ctx.Err()
- return
- case <-time.After(c.action.client.pollBackoffFunc(retries)):
- retries++
- }
-
- opts := ActionListOpts{}
- for watchID := range watchIDs {
- opts.ID = append(opts.ID, watchID)
- }
-
- as, err := c.AllWithOpts(ctx, opts)
- if err != nil {
- errCh <- err
- return
- }
- if len(as) == 0 {
- // No actions returned for the provided IDs, they do not exist in the API.
- // We need to catch and fail early for this, otherwise the loop will continue
- // indefinitely.
- errCh <- fmt.Errorf("failed to wait for actions: remaining actions (%v) are not returned from API", opts.ID)
- return
- }
-
- progress := 0
- for _, a := range as {
- switch a.Status {
- case ActionStatusRunning:
- progress += a.Progress
- case ActionStatusSuccess:
- delete(watchIDs, a.ID)
- completedIDs = append(completedIDs, a.ID)
- case ActionStatusError:
- delete(watchIDs, a.ID)
- completedIDs = append(completedIDs, a.ID)
- errCh <- fmt.Errorf("action %d failed: %w", a.ID, a.Error())
- }
- }
-
- progress += len(completedIDs) * 100
- if progress != 0 && progress != previousProgress {
- sendProgress(progressCh, progress/len(actions))
- previousProgress = progress
- }
-
- if len(watchIDs) == 0 {
- return
- }
- }
- }()
-
- return progressCh, errCh
-}
-
-// WatchProgress watches one action's progress until it completes with success
-// or error. This watching happens in a goroutine and updates are provided
-// through the two returned channels:
-//
-// - The first channel receives percentage updates of the progress, based on
-// the progress percentage indicated by the API. The return value is an int
-// between 0 and 100.
-// - The second channel receives any errors that happened while querying the
-// API, as well as the error of the action if it did not complete
-// successfully, or nil if it did.
-//
-// By default, the method keeps watching until the action has finished
-// processing. If you want to be able to cancel the method or configure a
-// timeout, use the [context.Context]. Once the method has stopped watching,
-// both returned channels are closed.
-//
-// WatchProgress uses the [WithPollBackoffFunc] of the [Client] to wait until
-// sending the next request.
-func (c *ActionClient) WatchProgress(ctx context.Context, action *Action) (<-chan int, <-chan error) {
- errCh := make(chan error, 1)
- progressCh := make(chan int)
-
- go func() {
- defer close(errCh)
- defer close(progressCh)
-
- retries := 0
-
- for {
- select {
- case <-ctx.Done():
- errCh <- ctx.Err()
- return
- case <-time.After(c.action.client.pollBackoffFunc(retries)):
- retries++
- }
-
- a, _, err := c.GetByID(ctx, action.ID)
- if err != nil {
- errCh <- err
- return
- }
- if a == nil {
- errCh <- fmt.Errorf("failed to wait for action %d: action not returned from API", action.ID)
- return
- }
-
- switch a.Status {
- case ActionStatusRunning:
- sendProgress(progressCh, a.Progress)
- case ActionStatusSuccess:
- sendProgress(progressCh, 100)
- errCh <- nil
- return
- case ActionStatusError:
- errCh <- a.Error()
- return
- }
- }
- }()
-
- return progressCh, errCh
-}
-
-// sendProgress allows the user to only read from the error channel and ignore any progress updates.
-func sendProgress(progressCh chan int, p int) {
- select {
- case progressCh <- p:
- break
- default:
- break
- }
-}
-
// ResourceActionClient is a client for the actions API exposed by the resource.
type ResourceActionClient struct {
resource string
diff --git a/vendor/github.com/hetznercloud/hcloud-go/hcloud/action_waiter.go b/vendor/github.com/hetznercloud/hcloud-go/hcloud/action_waiter.go
new file mode 100644
index 00000000..18f32c80
--- /dev/null
+++ b/vendor/github.com/hetznercloud/hcloud-go/hcloud/action_waiter.go
@@ -0,0 +1,119 @@
+package hcloud
+
+import (
+ "context"
+ "fmt"
+ "maps"
+ "slices"
+ "time"
+)
+
+type ActionWaiter interface {
+ WaitForFunc(ctx context.Context, handleUpdate func(update *Action) error, actions ...*Action) error
+ WaitFor(ctx context.Context, actions ...*Action) error
+}
+
+var _ ActionWaiter = (*ActionClient)(nil)
+
+// WaitForFunc waits until all actions are completed by polling the API at the interval
+// defined by [WithPollBackoffFunc]. An action is considered as complete when its status is
+// either [ActionStatusSuccess] or [ActionStatusError].
+//
+// The handleUpdate callback is called every time an action is updated.
+func (c *ActionClient) WaitForFunc(ctx context.Context, handleUpdate func(update *Action) error, actions ...*Action) error {
+ // Filter out nil actions
+ actions = slices.DeleteFunc(actions, func(a *Action) bool { return a == nil })
+
+ running := make(map[int]struct{}, len(actions))
+ for _, action := range actions {
+ if action.Status == ActionStatusRunning {
+ running[action.ID] = struct{}{}
+ } else if handleUpdate != nil {
+ // We filter out already completed actions from the API polling loop; while
+ // this isn't a real update, the caller should be notified about the new
+ // state.
+ if err := handleUpdate(action); err != nil {
+ return err
+ }
+ }
+ }
+
+ retries := 0
+ for {
+ if len(running) == 0 {
+ break
+ }
+
+ select {
+ case <-ctx.Done():
+ return ctx.Err()
+ case <-time.After(c.action.client.pollBackoffFunc(retries)):
+ retries++
+ }
+
+ opts := ActionListOpts{
+ Sort: []string{"status", "id"},
+ ID: make([]int, 0, len(running)),
+ }
+ for actionID := range running {
+ opts.ID = append(opts.ID, actionID)
+ }
+ slices.Sort(opts.ID)
+
+ updates, err := c.AllWithOpts(ctx, opts)
+ if err != nil {
+ return err
+ }
+
+ if len(updates) != len(running) {
+ // Some actions may not exist in the API, also fail early to prevent an
+ // infinite loop when updates == 0.
+
+ notFound := maps.Clone(running)
+ for _, update := range updates {
+ delete(notFound, update.ID)
+ }
+ notFoundIDs := make([]int, 0, len(notFound))
+ for unknownID := range notFound {
+ notFoundIDs = append(notFoundIDs, unknownID)
+ }
+
+ return fmt.Errorf("actions not found: %v", notFoundIDs)
+ }
+
+ for _, update := range updates {
+ if update.Status != ActionStatusRunning {
+ delete(running, update.ID)
+ }
+
+ if handleUpdate != nil {
+ if err := handleUpdate(update); err != nil {
+ return err
+ }
+ }
+ }
+ }
+
+ return nil
+}
+
+// WaitFor waits until all actions succeed by polling the API at the interval defined by
+// [WithPollBackoffFunc]. An action is considered as succeeded when its status is either
+// [ActionStatusSuccess].
+//
+// If a single action fails, the function will stop waiting and the error set in the
+// action will be returned as an [ActionError].
+//
+// For more flexibility, see the [ActionClient.WaitForFunc] function.
+func (c *ActionClient) WaitFor(ctx context.Context, actions ...*Action) error {
+ return c.WaitForFunc(
+ ctx,
+ func(update *Action) error {
+ if update.Status == ActionStatusError {
+ return update.Error()
+ }
+ return nil
+ },
+ actions...,
+ )
+}
diff --git a/vendor/github.com/hetznercloud/hcloud-go/hcloud/action_watch.go b/vendor/github.com/hetznercloud/hcloud-go/hcloud/action_watch.go
new file mode 100644
index 00000000..12bda18e
--- /dev/null
+++ b/vendor/github.com/hetznercloud/hcloud-go/hcloud/action_watch.go
@@ -0,0 +1,131 @@
+package hcloud
+
+import (
+ "context"
+ "fmt"
+)
+
+// WatchOverallProgress watches several actions' progress until they complete
+// with success or error. This watching happens in a goroutine and updates are
+// provided through the two returned channels:
+//
+// - The first channel receives percentage updates of the progress, based on
+// the number of completed versus total watched actions. The return value
+// is an int between 0 and 100.
+// - The second channel returned receives errors for actions that did not
+// complete successfully, as well as any errors that happened while
+// querying the API.
+//
+// By default, the method keeps watching until all actions have finished
+// processing. If you want to be able to cancel the method or configure a
+// timeout, use the [context.Context]. Once the method has stopped watching,
+// both returned channels are closed.
+//
+// WatchOverallProgress uses the [WithPollBackoffFunc] of the [Client] to wait
+// until sending the next request.
+//
+// Deprecated: WatchOverallProgress is deprecated, use [WaitForFunc] instead.
+func (c *ActionClient) WatchOverallProgress(ctx context.Context, actions []*Action) (<-chan int, <-chan error) {
+ errCh := make(chan error, len(actions))
+ progressCh := make(chan int)
+
+ go func() {
+ defer close(errCh)
+ defer close(progressCh)
+
+ previousGlobalProgress := 0
+ progressByAction := make(map[int]int, len(actions))
+ err := c.WaitForFunc(ctx, func(update *Action) error {
+ switch update.Status {
+ case ActionStatusRunning:
+ progressByAction[update.ID] = update.Progress
+ case ActionStatusSuccess:
+ progressByAction[update.ID] = 100
+ case ActionStatusError:
+ progressByAction[update.ID] = 100
+ errCh <- fmt.Errorf("action %d failed: %w", update.ID, update.Error())
+ }
+
+ // Compute global progress
+ progressSum := 0
+ for _, value := range progressByAction {
+ progressSum += value
+ }
+ globalProgress := progressSum / len(actions)
+
+ // Only send progress when it changed
+ if globalProgress != 0 && globalProgress != previousGlobalProgress {
+ sendProgress(progressCh, globalProgress)
+ previousGlobalProgress = globalProgress
+ }
+
+ return nil
+ }, actions...)
+
+ if err != nil {
+ errCh <- err
+ }
+ }()
+
+ return progressCh, errCh
+}
+
+// WatchProgress watches one action's progress until it completes with success
+// or error. This watching happens in a goroutine and updates are provided
+// through the two returned channels:
+//
+// - The first channel receives percentage updates of the progress, based on
+// the progress percentage indicated by the API. The return value is an int
+// between 0 and 100.
+// - The second channel receives any errors that happened while querying the
+// API, as well as the error of the action if it did not complete
+// successfully, or nil if it did.
+//
+// By default, the method keeps watching until the action has finished
+// processing. If you want to be able to cancel the method or configure a
+// timeout, use the [context.Context]. Once the method has stopped watching,
+// both returned channels are closed.
+//
+// WatchProgress uses the [WithPollBackoffFunc] of the [Client] to wait until
+// sending the next request.
+//
+// Deprecated: WatchProgress is deprecated, use [WaitForFunc] instead.
+func (c *ActionClient) WatchProgress(ctx context.Context, action *Action) (<-chan int, <-chan error) {
+ errCh := make(chan error, 1)
+ progressCh := make(chan int)
+
+ go func() {
+ defer close(errCh)
+ defer close(progressCh)
+
+ err := c.WaitForFunc(ctx, func(update *Action) error {
+ switch update.Status {
+ case ActionStatusRunning:
+ sendProgress(progressCh, update.Progress)
+ case ActionStatusSuccess:
+ sendProgress(progressCh, 100)
+ case ActionStatusError:
+ // Do not wrap the action error
+ return update.Error()
+ }
+
+ return nil
+ }, action)
+
+ if err != nil {
+ errCh <- err
+ }
+ }()
+
+ return progressCh, errCh
+}
+
+// sendProgress allows the user to only read from the error channel and ignore any progress updates.
+func sendProgress(progressCh chan int, p int) {
+ select {
+ case progressCh <- p:
+ break
+ default:
+ break
+ }
+}
diff --git a/vendor/github.com/hetznercloud/hcloud-go/hcloud/client.go b/vendor/github.com/hetznercloud/hcloud-go/hcloud/client.go
index 570066ac..5558e3c6 100644
--- a/vendor/github.com/hetznercloud/hcloud-go/hcloud/client.go
+++ b/vendor/github.com/hetznercloud/hcloud-go/hcloud/client.go
@@ -377,6 +377,10 @@ func errorFromResponse(resp *Response, body []byte) error {
return hcErr
}
+const (
+ headerCorrelationID = "X-Correlation-Id"
+)
+
// Response represents a response from the API. It embeds http.Response.
type Response struct {
*http.Response
@@ -410,6 +414,12 @@ func (r *Response) readMeta(body []byte) error {
return nil
}
+// internalCorrelationID returns the unique ID of the request as set by the API. This ID can help with support requests,
+// as it allows the people working on identify this request in particular.
+func (r *Response) internalCorrelationID() string {
+ return r.Header.Get(headerCorrelationID)
+}
+
// Meta represents meta information included in an API response.
type Meta struct {
Pagination *Pagination
diff --git a/vendor/github.com/hetznercloud/hcloud-go/hcloud/error.go b/vendor/github.com/hetznercloud/hcloud-go/hcloud/error.go
index 653043e6..371a92e3 100644
--- a/vendor/github.com/hetznercloud/hcloud-go/hcloud/error.go
+++ b/vendor/github.com/hetznercloud/hcloud-go/hcloud/error.go
@@ -1,6 +1,7 @@
package hcloud
import (
+ "errors"
"fmt"
"net"
)
@@ -99,6 +100,13 @@ type Error struct {
}
func (e Error) Error() string {
+ if resp := e.Response(); resp != nil {
+ correlationID := resp.internalCorrelationID()
+ if correlationID != "" {
+ // For easier debugging, the error string contains the Correlation ID of the response.
+ return fmt.Sprintf("%s (%s, %s)", e.Message, e.Code, correlationID)
+ }
+ }
return fmt.Sprintf("%s (%s)", e.Message, e.Code)
}
@@ -120,7 +128,8 @@ type ErrorDetailsInvalidInputField struct {
// IsError returns whether err is an API error with the given error code.
func IsError(err error, code ErrorCode) bool {
- apiErr, ok := err.(Error)
+ var apiErr Error
+ ok := errors.As(err, &apiErr)
return ok && apiErr.Code == code
}
diff --git a/vendor/github.com/hetznercloud/hcloud-go/hcloud/firewall.go b/vendor/github.com/hetznercloud/hcloud-go/hcloud/firewall.go
index f410db6f..29c52327 100644
--- a/vendor/github.com/hetznercloud/hcloud-go/hcloud/firewall.go
+++ b/vendor/github.com/hetznercloud/hcloud-go/hcloud/firewall.go
@@ -299,6 +299,7 @@ type FirewallSetRulesOpts struct {
// SetRules sets the rules of a Firewall.
func (c *FirewallClient) SetRules(ctx context.Context, firewall *Firewall, opts FirewallSetRulesOpts) ([]*Action, *Response, error) {
reqBody := firewallSetRulesOptsToSchema(opts)
+
reqBodyData, err := json.Marshal(reqBody)
if err != nil {
return nil, nil, err
diff --git a/vendor/github.com/hetznercloud/hcloud-go/hcloud/hcloud.go b/vendor/github.com/hetznercloud/hcloud-go/hcloud/hcloud.go
index b4ce367a..158ee729 100644
--- a/vendor/github.com/hetznercloud/hcloud-go/hcloud/hcloud.go
+++ b/vendor/github.com/hetznercloud/hcloud-go/hcloud/hcloud.go
@@ -2,4 +2,4 @@
package hcloud
// Version is the library's version following Semantic Versioning.
-const Version = "1.53.0" // x-release-please-version
+const Version = "1.59.1" // x-release-please-version
diff --git a/vendor/github.com/hetznercloud/hcloud-go/hcloud/network.go b/vendor/github.com/hetznercloud/hcloud-go/hcloud/network.go
index dbd262d3..7e6b9e44 100644
--- a/vendor/github.com/hetznercloud/hcloud-go/hcloud/network.go
+++ b/vendor/github.com/hetznercloud/hcloud-go/hcloud/network.go
@@ -19,9 +19,10 @@ type NetworkZone string
// List of available Network Zones.
const (
- NetworkZoneEUCentral NetworkZone = "eu-central"
- NetworkZoneUSEast NetworkZone = "us-east"
- NetworkZoneUSWest NetworkZone = "us-west"
+ NetworkZoneEUCentral NetworkZone = "eu-central"
+ NetworkZoneUSEast NetworkZone = "us-east"
+ NetworkZoneUSWest NetworkZone = "us-west"
+ NetworkZoneAPSouthEast NetworkZone = "ap-southeast"
)
// NetworkSubnetType specifies a type of a subnet.
diff --git a/vendor/github.com/hetznercloud/hcloud-go/hcloud/pricing.go b/vendor/github.com/hetznercloud/hcloud-go/hcloud/pricing.go
index 836f391f..e8ca92d5 100644
--- a/vendor/github.com/hetznercloud/hcloud-go/hcloud/pricing.go
+++ b/vendor/github.com/hetznercloud/hcloud-go/hcloud/pricing.go
@@ -8,10 +8,12 @@ import (
// Pricing specifies pricing information for various resources.
type Pricing struct {
- Image ImagePricing
- FloatingIP FloatingIPPricing
- FloatingIPs []FloatingIPTypePricing
- PrimaryIPs []PrimaryIPPricing
+ Image ImagePricing
+ FloatingIP FloatingIPPricing
+ FloatingIPs []FloatingIPTypePricing
+ PrimaryIPs []PrimaryIPPricing
+ // Deprecated: [Pricing.Traffic] is deprecated and will report 0 after 2024-08-05.
+ // Use traffic pricing from [Pricing.ServerTypes] or [Pricing.LoadBalancerTypes] instead.
Traffic TrafficPricing
ServerBackup ServerBackupPricing
ServerTypes []ServerTypePricing
@@ -102,6 +104,10 @@ type ServerTypeLocationPricing struct {
Location *Location
Hourly Price
Monthly Price
+
+ // IncludedTraffic is the free traffic per month in bytes
+ IncludedTraffic uint64
+ PerTBTraffic Price
}
// LoadBalancerTypePricing provides pricing information for a Load Balancer type.
@@ -116,6 +122,10 @@ type LoadBalancerTypeLocationPricing struct {
Location *Location
Hourly Price
Monthly Price
+
+ // IncludedTraffic is the free traffic per month in bytes
+ IncludedTraffic uint64
+ PerTBTraffic Price
}
// PricingClient is a client for the pricing API.
diff --git a/vendor/github.com/hetznercloud/hcloud-go/hcloud/schema.go b/vendor/github.com/hetznercloud/hcloud-go/hcloud/schema.go
index 09c03864..8b8ffd0f 100644
--- a/vendor/github.com/hetznercloud/hcloud-go/hcloud/schema.go
+++ b/vendor/github.com/hetznercloud/hcloud-go/hcloud/schema.go
@@ -290,7 +290,7 @@ func ServerTypeFromSchema(s schema.ServerType) *ServerType {
StorageType: StorageType(s.StorageType),
CPUType: CPUType(s.CPUType),
Architecture: Architecture(s.Architecture),
- IncludedTraffic: s.IncludedTraffic,
+ IncludedTraffic: s.IncludedTraffic, // nolint:staticcheck // Field is deprecated, but we still need to map it as long as it is available
DeprecatableResource: DeprecatableResource{
DeprecationFromSchema(s.Deprecation),
},
@@ -306,6 +306,11 @@ func ServerTypeFromSchema(s schema.ServerType) *ServerType {
Net: price.PriceMonthly.Net,
Gross: price.PriceMonthly.Gross,
},
+ IncludedTraffic: price.IncludedTraffic,
+ PerTBTraffic: Price{
+ Net: price.PricePerTBTraffic.Net,
+ Gross: price.PricePerTBTraffic.Gross,
+ },
})
}
@@ -380,6 +385,7 @@ func VolumeFromSchema(s schema.Volume) *Volume {
Name: s.Name,
Location: LocationFromSchema(s.Location),
Size: s.Size,
+ Format: s.Format,
Status: VolumeStatus(s.Status),
LinuxDevice: s.LinuxDevice,
Protection: VolumeProtection{
@@ -471,6 +477,11 @@ func LoadBalancerTypeFromSchema(s schema.LoadBalancerType) *LoadBalancerType {
Net: price.PriceMonthly.Net,
Gross: price.PriceMonthly.Gross,
},
+ IncludedTraffic: price.IncludedTraffic,
+ PerTBTraffic: Price{
+ Net: price.PricePerTBTraffic.Net,
+ Gross: price.PricePerTBTraffic.Gross,
+ },
})
}
return lt
@@ -700,8 +711,8 @@ func PricingFromSchema(s schema.Pricing) Pricing {
PerTB: Price{
Currency: s.Currency,
VATRate: s.VATRate,
- Net: s.Traffic.PricePerTB.Net,
- Gross: s.Traffic.PricePerTB.Gross,
+ Net: s.Traffic.PricePerTB.Net, // nolint:staticcheck // Field is deprecated, but we still need to map it as long as it is available
+ Gross: s.Traffic.PricePerTB.Gross, // nolint:staticcheck // Field is deprecated, but we still need to map it as long as it is available
},
},
ServerBackup: ServerBackupPricing{
@@ -767,6 +778,13 @@ func PricingFromSchema(s schema.Pricing) Pricing {
Net: price.PriceMonthly.Net,
Gross: price.PriceMonthly.Gross,
},
+ IncludedTraffic: price.IncludedTraffic,
+ PerTBTraffic: Price{
+ Currency: s.Currency,
+ VATRate: s.VATRate,
+ Net: price.PricePerTBTraffic.Net,
+ Gross: price.PricePerTBTraffic.Gross,
+ },
})
}
p.ServerTypes = append(p.ServerTypes, ServerTypePricing{
@@ -794,6 +812,13 @@ func PricingFromSchema(s schema.Pricing) Pricing {
Net: price.PriceMonthly.Net,
Gross: price.PriceMonthly.Gross,
},
+ IncludedTraffic: price.IncludedTraffic,
+ PerTBTraffic: Price{
+ Currency: s.Currency,
+ VATRate: s.VATRate,
+ Net: price.PricePerTBTraffic.Net,
+ Gross: price.PricePerTBTraffic.Gross,
+ },
})
}
p.LoadBalancerTypes = append(p.LoadBalancerTypes, LoadBalancerTypePricing{
@@ -973,6 +998,7 @@ func loadBalancerCreateOptsToSchema(opts LoadBalancerCreateOpts) schema.LoadBala
TLS: service.HealthCheck.HTTP.TLS,
}
if service.HealthCheck.HTTP.StatusCodes != nil {
+ //nolint:gosec
schemaHealthCheckHTTP.StatusCodes = &service.HealthCheck.HTTP.StatusCodes
}
schemaHealthCheck.HTTP = schemaHealthCheckHTTP
@@ -1097,7 +1123,7 @@ func firewallCreateOptsToSchema(opts FirewallCreateOpts) schema.FirewallCreateRe
req.Labels = &opts.Labels
}
for _, rule := range opts.Rules {
- schemaRule := schema.FirewallRule{
+ schemaRule := schema.FirewallRuleRequest{
Direction: string(rule.Direction),
Protocol: string(rule.Protocol),
Port: rule.Port,
@@ -1136,9 +1162,9 @@ func firewallCreateOptsToSchema(opts FirewallCreateOpts) schema.FirewallCreateRe
}
func firewallSetRulesOptsToSchema(opts FirewallSetRulesOpts) schema.FirewallActionSetRulesRequest {
- req := schema.FirewallActionSetRulesRequest{Rules: []schema.FirewallRule{}}
+ req := schema.FirewallActionSetRulesRequest{Rules: []schema.FirewallRuleRequest{}}
for _, rule := range opts.Rules {
- schemaRule := schema.FirewallRule{
+ schemaRule := schema.FirewallRuleRequest{
Direction: string(rule.Direction),
Protocol: string(rule.Protocol),
Port: rule.Port,
diff --git a/vendor/github.com/hetznercloud/hcloud-go/hcloud/schema/error.go b/vendor/github.com/hetznercloud/hcloud-go/hcloud/schema/error.go
index 2d5cf5dd..86a5455e 100644
--- a/vendor/github.com/hetznercloud/hcloud-go/hcloud/schema/error.go
+++ b/vendor/github.com/hetznercloud/hcloud-go/hcloud/schema/error.go
@@ -17,7 +17,7 @@ func (e *Error) UnmarshalJSON(data []byte) (err error) {
if err = json.Unmarshal(data, alias); err != nil {
return
}
- if e.Code == "invalid_input" {
+ if e.Code == "invalid_input" && len(e.DetailsRaw) > 0 {
details := ErrorDetailsInvalidInput{}
if err = json.Unmarshal(e.DetailsRaw, &details); err != nil {
return
diff --git a/vendor/github.com/hetznercloud/hcloud-go/hcloud/schema/firewall.go b/vendor/github.com/hetznercloud/hcloud-go/hcloud/schema/firewall.go
index b085bbb1..bf5afc7c 100644
--- a/vendor/github.com/hetznercloud/hcloud-go/hcloud/schema/firewall.go
+++ b/vendor/github.com/hetznercloud/hcloud-go/hcloud/schema/firewall.go
@@ -12,8 +12,18 @@ type Firewall struct {
AppliedTo []FirewallResource `json:"applied_to"`
}
-// FirewallRule defines the schema of a Firewall rule.
+// FirewallRule defines the schema of a Firewall rule in responses.
type FirewallRule struct {
+ Direction string `json:"direction"`
+ SourceIPs []string `json:"source_ips"`
+ DestinationIPs []string `json:"destination_ips"`
+ Protocol string `json:"protocol"`
+ Port *string `json:"port"`
+ Description *string `json:"description"`
+}
+
+// FirewallRuleRequest defines the schema of a Firewall rule in requests.
+type FirewallRuleRequest struct {
Direction string `json:"direction"`
SourceIPs []string `json:"source_ips,omitempty"`
DestinationIPs []string `json:"destination_ips,omitempty"`
@@ -34,10 +44,10 @@ type FirewallGetResponse struct {
// FirewallCreateRequest defines the schema of the request to create a Firewall.
type FirewallCreateRequest struct {
- Name string `json:"name"`
- Labels *map[string]string `json:"labels,omitempty"`
- Rules []FirewallRule `json:"rules,omitempty"`
- ApplyTo []FirewallResource `json:"apply_to,omitempty"`
+ Name string `json:"name"`
+ Labels *map[string]string `json:"labels,omitempty"`
+ Rules []FirewallRuleRequest `json:"rules,omitempty"`
+ ApplyTo []FirewallResource `json:"apply_to,omitempty"`
}
// FirewallResource defines the schema of a resource to apply the new Firewall on.
@@ -76,7 +86,7 @@ type FirewallUpdateResponse struct {
// FirewallActionSetRulesRequest defines the schema of the request when setting Firewall rules.
type FirewallActionSetRulesRequest struct {
- Rules []FirewallRule `json:"rules"`
+ Rules []FirewallRuleRequest `json:"rules"`
}
// FirewallActionSetRulesResponse defines the schema of the response when setting Firewall rules.
diff --git a/vendor/github.com/hetznercloud/hcloud-go/hcloud/schema/pricing.go b/vendor/github.com/hetznercloud/hcloud-go/hcloud/schema/pricing.go
index 0c06c73d..a863a57a 100644
--- a/vendor/github.com/hetznercloud/hcloud-go/hcloud/schema/pricing.go
+++ b/vendor/github.com/hetznercloud/hcloud-go/hcloud/schema/pricing.go
@@ -2,12 +2,14 @@ package schema
// Pricing defines the schema for pricing information.
type Pricing struct {
- Currency string `json:"currency"`
- VATRate string `json:"vat_rate"`
- Image PricingImage `json:"image"`
- FloatingIP PricingFloatingIP `json:"floating_ip"`
- FloatingIPs []PricingFloatingIPType `json:"floating_ips"`
- PrimaryIPs []PricingPrimaryIP `json:"primary_ips"`
+ Currency string `json:"currency"`
+ VATRate string `json:"vat_rate"`
+ Image PricingImage `json:"image"`
+ FloatingIP PricingFloatingIP `json:"floating_ip"`
+ FloatingIPs []PricingFloatingIPType `json:"floating_ips"`
+ PrimaryIPs []PricingPrimaryIP `json:"primary_ips"`
+ // Deprecated: [Pricing.Traffic] is deprecated and will report 0 after 2024-08-05.
+ // Use traffic pricing from [Pricing.ServerTypes] or [Pricing.LoadBalancerTypes] instead.
Traffic PricingTraffic `json:"traffic"`
ServerBackup PricingServerBackup `json:"server_backup"`
ServerTypes []PricingServerType `json:"server_types"`
@@ -72,6 +74,9 @@ type PricingServerTypePrice struct {
Location string `json:"location"`
PriceHourly Price `json:"price_hourly"`
PriceMonthly Price `json:"price_monthly"`
+
+ IncludedTraffic uint64 `json:"included_traffic"`
+ PricePerTBTraffic Price `json:"price_per_tb_traffic"`
}
// PricingLoadBalancerType defines the schema of pricing information for a Load Balancer type.
@@ -87,6 +92,9 @@ type PricingLoadBalancerTypePrice struct {
Location string `json:"location"`
PriceHourly Price `json:"price_hourly"`
PriceMonthly Price `json:"price_monthly"`
+
+ IncludedTraffic uint64 `json:"included_traffic"`
+ PricePerTBTraffic Price `json:"price_per_tb_traffic"`
}
// PricingGetResponse defines the schema of the response when retrieving pricing information.
diff --git a/vendor/github.com/hetznercloud/hcloud-go/hcloud/schema/server_type.go b/vendor/github.com/hetznercloud/hcloud-go/hcloud/schema/server_type.go
index e4d9b3a8..db622449 100644
--- a/vendor/github.com/hetznercloud/hcloud-go/hcloud/schema/server_type.go
+++ b/vendor/github.com/hetznercloud/hcloud-go/hcloud/schema/server_type.go
@@ -2,15 +2,18 @@ package schema
// ServerType defines the schema of a server type.
type ServerType struct {
- ID int `json:"id"`
- Name string `json:"name"`
- Description string `json:"description"`
- Cores int `json:"cores"`
- Memory float32 `json:"memory"`
- Disk int `json:"disk"`
- StorageType string `json:"storage_type"`
- CPUType string `json:"cpu_type"`
- Architecture string `json:"architecture"`
+ ID int `json:"id"`
+ Name string `json:"name"`
+ Description string `json:"description"`
+ Cores int `json:"cores"`
+ Memory float32 `json:"memory"`
+ Disk int `json:"disk"`
+ StorageType string `json:"storage_type"`
+ CPUType string `json:"cpu_type"`
+ Architecture string `json:"architecture"`
+
+ // Deprecated: [ServerType.IncludedTraffic] is deprecated and will always report 0 after 2024-08-05.
+ // Use [ServerType.Prices] instead to get the included traffic for each location.
IncludedTraffic int64 `json:"included_traffic"`
Prices []PricingServerTypePrice `json:"prices"`
DeprecatableResource
diff --git a/vendor/github.com/hetznercloud/hcloud-go/hcloud/schema/volume.go b/vendor/github.com/hetznercloud/hcloud-go/hcloud/schema/volume.go
index ad745ea9..19c741c1 100644
--- a/vendor/github.com/hetznercloud/hcloud-go/hcloud/schema/volume.go
+++ b/vendor/github.com/hetznercloud/hcloud-go/hcloud/schema/volume.go
@@ -10,6 +10,7 @@ type Volume struct {
Status string `json:"status"`
Location Location `json:"location"`
Size int `json:"size"`
+ Format *string `json:"format"`
Protection VolumeProtection `json:"protection"`
Labels map[string]string `json:"labels"`
LinuxDevice string `json:"linux_device"`
diff --git a/vendor/github.com/hetznercloud/hcloud-go/hcloud/server.go b/vendor/github.com/hetznercloud/hcloud-go/hcloud/server.go
index 51a0edaf..894e9d73 100644
--- a/vendor/github.com/hetznercloud/hcloud-go/hcloud/server.go
+++ b/vendor/github.com/hetznercloud/hcloud-go/hcloud/server.go
@@ -146,6 +146,7 @@ type ServerRescueType string
// List of rescue types.
const (
+ // Deprecated: Use ServerRescueTypeLinux64 instead.
ServerRescueTypeLinux32 ServerRescueType = "linux32"
ServerRescueTypeLinux64 ServerRescueType = "linux64"
)
diff --git a/vendor/github.com/hetznercloud/hcloud-go/hcloud/server_type.go b/vendor/github.com/hetznercloud/hcloud-go/hcloud/server_type.go
index 823f656d..7f8e09ec 100644
--- a/vendor/github.com/hetznercloud/hcloud-go/hcloud/server_type.go
+++ b/vendor/github.com/hetznercloud/hcloud-go/hcloud/server_type.go
@@ -20,7 +20,9 @@ type ServerType struct {
StorageType StorageType
CPUType CPUType
Architecture Architecture
- // IncludedTraffic is the free traffic per month in bytes
+
+ // Deprecated: [ServerType.IncludedTraffic] is deprecated and will always report 0 after 2024-08-05.
+ // Use [ServerType.Pricings] instead to get the included traffic for each location.
IncludedTraffic int64
Pricings []ServerTypeLocationPricing
DeprecatableResource
diff --git a/vendor/github.com/hetznercloud/hcloud-go/hcloud/volume.go b/vendor/github.com/hetznercloud/hcloud-go/hcloud/volume.go
index 3548165e..747c17de 100644
--- a/vendor/github.com/hetznercloud/hcloud-go/hcloud/volume.go
+++ b/vendor/github.com/hetznercloud/hcloud-go/hcloud/volume.go
@@ -21,12 +21,18 @@ type Volume struct {
Server *Server
Location *Location
Size int
+ Format *string
Protection VolumeProtection
Labels map[string]string
LinuxDevice string
Created time.Time
}
+const (
+ VolumeFormatExt4 = "ext4"
+ VolumeFormatXFS = "xfs"
+)
+
// VolumeProtection represents the protection level of a volume.
type VolumeProtection struct {
Delete bool
diff --git a/vendor/github.com/imdario/mergo/.deepsource.toml b/vendor/github.com/imdario/mergo/.deepsource.toml
new file mode 100644
index 00000000..8a0681af
--- /dev/null
+++ b/vendor/github.com/imdario/mergo/.deepsource.toml
@@ -0,0 +1,12 @@
+version = 1
+
+test_patterns = [
+ "*_test.go"
+]
+
+[[analyzers]]
+name = "go"
+enabled = true
+
+ [analyzers.meta]
+ import_path = "github.com/imdario/mergo"
\ No newline at end of file
diff --git a/vendor/github.com/imdario/mergo/.travis.yml b/vendor/github.com/imdario/mergo/.travis.yml
index b13a50ed..d324c43b 100644
--- a/vendor/github.com/imdario/mergo/.travis.yml
+++ b/vendor/github.com/imdario/mergo/.travis.yml
@@ -1,7 +1,12 @@
language: go
+arch:
+ - amd64
+ - ppc64le
install:
- go get -t
- go get golang.org/x/tools/cmd/cover
- go get github.com/mattn/goveralls
script:
+ - go test -race -v ./...
+after_script:
- $HOME/gopath/bin/goveralls -service=travis-ci -repotoken $COVERALLS_TOKEN
diff --git a/vendor/github.com/imdario/mergo/CONTRIBUTING.md b/vendor/github.com/imdario/mergo/CONTRIBUTING.md
new file mode 100644
index 00000000..0a1ff9f9
--- /dev/null
+++ b/vendor/github.com/imdario/mergo/CONTRIBUTING.md
@@ -0,0 +1,112 @@
+
+# Contributing to mergo
+
+First off, thanks for taking the time to contribute! ❤️
+
+All types of contributions are encouraged and valued. See the [Table of Contents](#table-of-contents) for different ways to help and details about how this project handles them. Please make sure to read the relevant section before making your contribution. It will make it a lot easier for us maintainers and smooth out the experience for all involved. The community looks forward to your contributions. 🎉
+
+> And if you like the project, but just don't have time to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about:
+> - Star the project
+> - Tweet about it
+> - Refer this project in your project's readme
+> - Mention the project at local meetups and tell your friends/colleagues
+
+
+## Table of Contents
+
+- [Code of Conduct](#code-of-conduct)
+- [I Have a Question](#i-have-a-question)
+- [I Want To Contribute](#i-want-to-contribute)
+- [Reporting Bugs](#reporting-bugs)
+- [Suggesting Enhancements](#suggesting-enhancements)
+
+## Code of Conduct
+
+This project and everyone participating in it is governed by the
+[mergo Code of Conduct](https://github.com/imdario/mergoblob/master/CODE_OF_CONDUCT.md).
+By participating, you are expected to uphold this code. Please report unacceptable behavior
+to <>.
+
+
+## I Have a Question
+
+> If you want to ask a question, we assume that you have read the available [Documentation](https://pkg.go.dev/github.com/imdario/mergo).
+
+Before you ask a question, it is best to search for existing [Issues](https://github.com/imdario/mergo/issues) that might help you. In case you have found a suitable issue and still need clarification, you can write your question in this issue. It is also advisable to search the internet for answers first.
+
+If you then still feel the need to ask a question and need clarification, we recommend the following:
+
+- Open an [Issue](https://github.com/imdario/mergo/issues/new).
+- Provide as much context as you can about what you're running into.
+- Provide project and platform versions (nodejs, npm, etc), depending on what seems relevant.
+
+We will then take care of the issue as soon as possible.
+
+## I Want To Contribute
+
+> ### Legal Notice
+> When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content and that the content you contribute may be provided under the project license.
+
+### Reporting Bugs
+
+
+#### Before Submitting a Bug Report
+
+A good bug report shouldn't leave others needing to chase you up for more information. Therefore, we ask you to investigate carefully, collect information and describe the issue in detail in your report. Please complete the following steps in advance to help us fix any potential bug as fast as possible.
+
+- Make sure that you are using the latest version.
+- Determine if your bug is really a bug and not an error on your side e.g. using incompatible environment components/versions (Make sure that you have read the [documentation](). If you are looking for support, you might want to check [this section](#i-have-a-question)).
+- To see if other users have experienced (and potentially already solved) the same issue you are having, check if there is not already a bug report existing for your bug or error in the [bug tracker](https://github.com/imdario/mergoissues?q=label%3Abug).
+- Also make sure to search the internet (including Stack Overflow) to see if users outside of the GitHub community have discussed the issue.
+- Collect information about the bug:
+- Stack trace (Traceback)
+- OS, Platform and Version (Windows, Linux, macOS, x86, ARM)
+- Version of the interpreter, compiler, SDK, runtime environment, package manager, depending on what seems relevant.
+- Possibly your input and the output
+- Can you reliably reproduce the issue? And can you also reproduce it with older versions?
+
+
+#### How Do I Submit a Good Bug Report?
+
+> You must never report security related issues, vulnerabilities or bugs including sensitive information to the issue tracker, or elsewhere in public. Instead sensitive bugs must be sent by email to .
+
+
+We use GitHub issues to track bugs and errors. If you run into an issue with the project:
+
+- Open an [Issue](https://github.com/imdario/mergo/issues/new). (Since we can't be sure at this point whether it is a bug or not, we ask you not to talk about a bug yet and not to label the issue.)
+- Explain the behavior you would expect and the actual behavior.
+- Please provide as much context as possible and describe the *reproduction steps* that someone else can follow to recreate the issue on their own. This usually includes your code. For good bug reports you should isolate the problem and create a reduced test case.
+- Provide the information you collected in the previous section.
+
+Once it's filed:
+
+- The project team will label the issue accordingly.
+- A team member will try to reproduce the issue with your provided steps. If there are no reproduction steps or no obvious way to reproduce the issue, the team will ask you for those steps and mark the issue as `needs-repro`. Bugs with the `needs-repro` tag will not be addressed until they are reproduced.
+- If the team is able to reproduce the issue, it will be marked `needs-fix`, as well as possibly other tags (such as `critical`), and the issue will be left to be implemented by someone.
+
+### Suggesting Enhancements
+
+This section guides you through submitting an enhancement suggestion for mergo, **including completely new features and minor improvements to existing functionality**. Following these guidelines will help maintainers and the community to understand your suggestion and find related suggestions.
+
+
+#### Before Submitting an Enhancement
+
+- Make sure that you are using the latest version.
+- Read the [documentation]() carefully and find out if the functionality is already covered, maybe by an individual configuration.
+- Perform a [search](https://github.com/imdario/mergo/issues) to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one.
+- Find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Keep in mind that we want features that will be useful to the majority of our users and not just a small subset. If you're just targeting a minority of users, consider writing an add-on/plugin library.
+
+
+#### How Do I Submit a Good Enhancement Suggestion?
+
+Enhancement suggestions are tracked as [GitHub issues](https://github.com/imdario/mergo/issues).
+
+- Use a **clear and descriptive title** for the issue to identify the suggestion.
+- Provide a **step-by-step description of the suggested enhancement** in as many details as possible.
+- **Describe the current behavior** and **explain which behavior you expected to see instead** and why. At this point you can also tell which alternatives do not work for you.
+- You may want to **include screenshots and animated GIFs** which help you demonstrate the steps or point out the part which the suggestion is related to. You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux.
+- **Explain why this enhancement would be useful** to most mergo users. You may also want to point out the other projects that solved it better and which could serve as inspiration.
+
+
+## Attribution
+This guide is based on the **contributing-gen**. [Make your own](https://github.com/bttger/contributing-gen)!
diff --git a/vendor/github.com/imdario/mergo/README.md b/vendor/github.com/imdario/mergo/README.md
index 8b76f1fb..ffbbb62c 100644
--- a/vendor/github.com/imdario/mergo/README.md
+++ b/vendor/github.com/imdario/mergo/README.md
@@ -1,48 +1,66 @@
# Mergo
-A helper to merge structs and maps in Golang. Useful for configuration default values, avoiding messy if-statements.
-
-Also a lovely [comune](http://en.wikipedia.org/wiki/Mergo) (municipality) in the Province of Ancona in the Italian region of Marche.
-
-## Status
-
-It is ready for production use. [It is used in several projects by Docker, Google, The Linux Foundation, VMWare, Shopify, etc](https://github.com/imdario/mergo#mergo-in-the-wild).
+[![GitHub release][5]][6]
+[![GoCard][7]][8]
+[![Test status][1]][2]
+[![OpenSSF Scorecard][21]][22]
+[![OpenSSF Best Practices][19]][20]
+[![Coverage status][9]][10]
+[![Sourcegraph][11]][12]
+[![FOSSA status][13]][14]
[![GoDoc][3]][4]
-[![GoCard][5]][6]
-[![Build Status][1]][2]
-[![Coverage Status][7]][8]
-[![Sourcegraph][9]][10]
+[![Become my sponsor][15]][16]
+[![Tidelift][17]][18]
-[1]: https://travis-ci.org/imdario/mergo.png
-[2]: https://travis-ci.org/imdario/mergo
+[1]: https://github.com/imdario/mergo/workflows/tests/badge.svg?branch=master
+[2]: https://github.com/imdario/mergo/actions/workflows/tests.yml
[3]: https://godoc.org/github.com/imdario/mergo?status.svg
[4]: https://godoc.org/github.com/imdario/mergo
-[5]: https://goreportcard.com/badge/imdario/mergo
-[6]: https://goreportcard.com/report/github.com/imdario/mergo
-[7]: https://coveralls.io/repos/github/imdario/mergo/badge.svg?branch=master
-[8]: https://coveralls.io/github/imdario/mergo?branch=master
-[9]: https://sourcegraph.com/github.com/imdario/mergo/-/badge.svg
-[10]: https://sourcegraph.com/github.com/imdario/mergo?badge
+[5]: https://img.shields.io/github/release/imdario/mergo.svg
+[6]: https://github.com/imdario/mergo/releases
+[7]: https://goreportcard.com/badge/imdario/mergo
+[8]: https://goreportcard.com/report/github.com/imdario/mergo
+[9]: https://coveralls.io/repos/github/imdario/mergo/badge.svg?branch=master
+[10]: https://coveralls.io/github/imdario/mergo?branch=master
+[11]: https://sourcegraph.com/github.com/imdario/mergo/-/badge.svg
+[12]: https://sourcegraph.com/github.com/imdario/mergo?badge
+[13]: https://app.fossa.io/api/projects/git%2Bgithub.com%2Fimdario%2Fmergo.svg?type=shield
+[14]: https://app.fossa.io/projects/git%2Bgithub.com%2Fimdario%2Fmergo?ref=badge_shield
+[15]: https://img.shields.io/github/sponsors/imdario
+[16]: https://github.com/sponsors/imdario
+[17]: https://tidelift.com/badges/package/go/github.com%2Fimdario%2Fmergo
+[18]: https://tidelift.com/subscription/pkg/go-github.com-imdario-mergo
+[19]: https://bestpractices.coreinfrastructure.org/projects/7177/badge
+[20]: https://bestpractices.coreinfrastructure.org/projects/7177
+[21]: https://api.securityscorecards.dev/projects/github.com/imdario/mergo/badge
+[22]: https://api.securityscorecards.dev/projects/github.com/imdario/mergo
+
+A helper to merge structs and maps in Golang. Useful for configuration default values, avoiding messy if-statements.
-### Latest release
+Mergo merges same-type structs and maps by setting default values in zero-value fields. Mergo won't merge unexported (private) fields. It will do recursively any exported one. It also won't merge structs inside maps (because they are not addressable using Go reflection).
-[Release v0.3.6](https://github.com/imdario/mergo/releases/tag/v0.3.6).
+Also a lovely [comune](http://en.wikipedia.org/wiki/Mergo) (municipality) in the Province of Ancona in the Italian region of Marche.
+
+## Status
+
+It is ready for production use. [It is used in several projects by Docker, Google, The Linux Foundation, VMWare, Shopify, Microsoft, etc](https://github.com/imdario/mergo#mergo-in-the-wild).
### Important note
-Please keep in mind that in [0.3.2](//github.com/imdario/mergo/releases/tag/0.3.2) Mergo changed `Merge()`and `Map()` signatures to support [transformers](#transformers). An optional/variadic argument has been added, so it won't break existing code.
+Please keep in mind that a problematic PR broke [0.3.9](//github.com/imdario/mergo/releases/tag/0.3.9). I reverted it in [0.3.10](//github.com/imdario/mergo/releases/tag/0.3.10), and I consider it stable but not bug-free. Also, this version adds support for go modules.
-If you were using Mergo **before** April 6th 2015, please check your project works as intended after updating your local copy with ```go get -u github.com/imdario/mergo```. I apologize for any issue caused by its previous behavior and any future bug that Mergo could cause (I hope it won't!) in existing projects after the change (release 0.2.0).
+Keep in mind that in [0.3.2](//github.com/imdario/mergo/releases/tag/0.3.2), Mergo changed `Merge()`and `Map()` signatures to support [transformers](#transformers). I added an optional/variadic argument so that it won't break the existing code.
+
+If you were using Mergo before April 6th, 2015, please check your project works as intended after updating your local copy with ```go get -u github.com/imdario/mergo```. I apologize for any issue caused by its previous behavior and any future bug that Mergo could cause in existing projects after the change (release 0.2.0).
### Donations
-If Mergo is useful to you, consider buying me a coffee, a beer or making a monthly donation so I can keep building great free software. :heart_eyes:
+If Mergo is useful to you, consider buying me a coffee, a beer, or making a monthly donation to allow me to keep building great free software. :heart_eyes:
-[![Beerpay](https://beerpay.io/imdario/mergo/badge.svg)](https://beerpay.io/imdario/mergo)
-[![Beerpay](https://beerpay.io/imdario/mergo/make-wish.svg)](https://beerpay.io/imdario/mergo)
+
### Mergo in the wild
@@ -86,8 +104,11 @@ If Mergo is useful to you, consider buying me a coffee, a beer or making a month
- [mantasmatelis/whooplist-server](https://github.com/mantasmatelis/whooplist-server)
- [jnuthong/item_search](https://github.com/jnuthong/item_search)
- [bukalapak/snowboard](https://github.com/bukalapak/snowboard)
+- [containerssh/containerssh](https://github.com/containerssh/containerssh)
+- [goreleaser/goreleaser](https://github.com/goreleaser/goreleaser)
+- [tjpnz/structbot](https://github.com/tjpnz/structbot)
-## Installation
+## Install
go get github.com/imdario/mergo
@@ -98,7 +119,7 @@ If Mergo is useful to you, consider buying me a coffee, a beer or making a month
## Usage
-You can only merge same-type structs with exported fields initialized as zero value of their type and same-types maps. Mergo won't merge unexported (private) fields but will do recursively any exported one. It won't merge empty structs value as [they are not considered zero values](https://golang.org/ref/spec#The_zero_value) either. Also maps will be merged recursively except for structs inside maps (because they are not addressable using Go reflection).
+You can only merge same-type structs with exported fields initialized as zero value of their type and same-types maps. Mergo won't merge unexported (private) fields but will do recursively any exported one. It won't merge empty structs value as [they are zero values](https://golang.org/ref/spec#The_zero_value) too. Also, maps will be merged recursively except for structs inside maps (because they are not addressable using Go reflection).
```go
if err := mergo.Merge(&dst, src); err != nil {
@@ -124,9 +145,7 @@ if err := mergo.Map(&dst, srcMap); err != nil {
Warning: if you map a struct to map, it won't do it recursively. Don't expect Mergo to map struct members of your struct as `map[string]interface{}`. They will be just assigned as values.
-More information and examples in [godoc documentation](http://godoc.org/github.com/imdario/mergo).
-
-### Nice example
+Here is a nice example:
```go
package main
@@ -158,7 +177,7 @@ func main() {
Note: if test are failing due missing package, please execute:
- go get gopkg.in/yaml.v2
+ go get gopkg.in/yaml.v3
### Transformers
@@ -174,10 +193,10 @@ import (
"time"
)
-type timeTransfomer struct {
+type timeTransformer struct {
}
-func (t timeTransfomer) Transformer(typ reflect.Type) func(dst, src reflect.Value) error {
+func (t timeTransformer) Transformer(typ reflect.Type) func(dst, src reflect.Value) error {
if typ == reflect.TypeOf(time.Time{}) {
return func(dst, src reflect.Value) error {
if dst.CanSet() {
@@ -201,14 +220,13 @@ type Snapshot struct {
func main() {
src := Snapshot{time.Now()}
dest := Snapshot{}
- mergo.Merge(&dest, src, mergo.WithTransformers(timeTransfomer{}))
+ mergo.Merge(&dest, src, mergo.WithTransformers(timeTransformer{}))
fmt.Println(dest)
// Will print
// { 2018-01-12 01:15:00 +0000 UTC m=+0.000000001 }
}
```
-
## Contact me
If I can help you, you have an idea or you are using Mergo in your projects, don't hesitate to drop me a line (or a pull request): [@im_dario](https://twitter.com/im_dario)
@@ -220,3 +238,5 @@ Written by [Dario Castañé](http://dario.im).
## License
[BSD 3-Clause](http://opensource.org/licenses/BSD-3-Clause) license, as [Go language](http://golang.org/LICENSE).
+
+[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fimdario%2Fmergo.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fimdario%2Fmergo?ref=badge_large)
diff --git a/vendor/github.com/imdario/mergo/SECURITY.md b/vendor/github.com/imdario/mergo/SECURITY.md
new file mode 100644
index 00000000..a5de61f7
--- /dev/null
+++ b/vendor/github.com/imdario/mergo/SECURITY.md
@@ -0,0 +1,14 @@
+# Security Policy
+
+## Supported Versions
+
+| Version | Supported |
+| ------- | ------------------ |
+| 0.3.x | :white_check_mark: |
+| < 0.3 | :x: |
+
+## Security contact information
+
+To report a security vulnerability, please use the
+[Tidelift security contact](https://tidelift.com/security).
+Tidelift will coordinate the fix and disclosure.
diff --git a/vendor/github.com/imdario/mergo/doc.go b/vendor/github.com/imdario/mergo/doc.go
index 6e9aa7ba..fcd985f9 100644
--- a/vendor/github.com/imdario/mergo/doc.go
+++ b/vendor/github.com/imdario/mergo/doc.go
@@ -4,41 +4,140 @@
// license that can be found in the LICENSE file.
/*
-Package mergo merges same-type structs and maps by setting default values in zero-value fields.
+A helper to merge structs and maps in Golang. Useful for configuration default values, avoiding messy if-statements.
-Mergo won't merge unexported (private) fields but will do recursively any exported one. It also won't merge structs inside maps (because they are not addressable using Go reflection).
+Mergo merges same-type structs and maps by setting default values in zero-value fields. Mergo won't merge unexported (private) fields. It will do recursively any exported one. It also won't merge structs inside maps (because they are not addressable using Go reflection).
+
+Status
+
+It is ready for production use. It is used in several projects by Docker, Google, The Linux Foundation, VMWare, Shopify, etc.
+
+Important note
+
+Please keep in mind that a problematic PR broke 0.3.9. We reverted it in 0.3.10. We consider 0.3.10 as stable but not bug-free. . Also, this version adds suppot for go modules.
+
+Keep in mind that in 0.3.2, Mergo changed Merge() and Map() signatures to support transformers. We added an optional/variadic argument so that it won't break the existing code.
+
+If you were using Mergo before April 6th, 2015, please check your project works as intended after updating your local copy with go get -u github.com/imdario/mergo. I apologize for any issue caused by its previous behavior and any future bug that Mergo could cause in existing projects after the change (release 0.2.0).
+
+Install
+
+Do your usual installation procedure:
+
+ go get github.com/imdario/mergo
+
+ // use in your .go code
+ import (
+ "github.com/imdario/mergo"
+ )
Usage
-From my own work-in-progress project:
+You can only merge same-type structs with exported fields initialized as zero value of their type and same-types maps. Mergo won't merge unexported (private) fields but will do recursively any exported one. It won't merge empty structs value as they are zero values too. Also, maps will be merged recursively except for structs inside maps (because they are not addressable using Go reflection).
+
+ if err := mergo.Merge(&dst, src); err != nil {
+ // ...
+ }
+
+Also, you can merge overwriting values using the transformer WithOverride.
+
+ if err := mergo.Merge(&dst, src, mergo.WithOverride); err != nil {
+ // ...
+ }
+
+Additionally, you can map a map[string]interface{} to a struct (and otherwise, from struct to map), following the same restrictions as in Merge(). Keys are capitalized to find each corresponding exported field.
+
+ if err := mergo.Map(&dst, srcMap); err != nil {
+ // ...
+ }
+
+Warning: if you map a struct to map, it won't do it recursively. Don't expect Mergo to map struct members of your struct as map[string]interface{}. They will be just assigned as values.
+
+Here is a nice example:
+
+ package main
+
+ import (
+ "fmt"
+ "github.com/imdario/mergo"
+ )
- type networkConfig struct {
- Protocol string
- Address string
- ServerType string `json: "server_type"`
- Port uint16
+ type Foo struct {
+ A string
+ B int64
}
- type FssnConfig struct {
- Network networkConfig
+ func main() {
+ src := Foo{
+ A: "one",
+ B: 2,
+ }
+ dest := Foo{
+ A: "two",
+ }
+ mergo.Merge(&dest, src)
+ fmt.Println(dest)
+ // Will print
+ // {two 2}
}
- var fssnDefault = FssnConfig {
- networkConfig {
- "tcp",
- "127.0.0.1",
- "http",
- 31560,
- },
+Transformers
+
+Transformers allow to merge specific types differently than in the default behavior. In other words, now you can customize how some types are merged. For example, time.Time is a struct; it doesn't have zero value but IsZero can return true because it has fields with zero value. How can we merge a non-zero time.Time?
+
+ package main
+
+ import (
+ "fmt"
+ "github.com/imdario/mergo"
+ "reflect"
+ "time"
+ )
+
+ type timeTransformer struct {
}
- // Inside a function [...]
+ func (t timeTransformer) Transformer(typ reflect.Type) func(dst, src reflect.Value) error {
+ if typ == reflect.TypeOf(time.Time{}) {
+ return func(dst, src reflect.Value) error {
+ if dst.CanSet() {
+ isZero := dst.MethodByName("IsZero")
+ result := isZero.Call([]reflect.Value{})
+ if result[0].Bool() {
+ dst.Set(src)
+ }
+ }
+ return nil
+ }
+ }
+ return nil
+ }
+
+ type Snapshot struct {
+ Time time.Time
+ // ...
+ }
- if err := mergo.Merge(&config, fssnDefault); err != nil {
- log.Fatal(err)
+ func main() {
+ src := Snapshot{time.Now()}
+ dest := Snapshot{}
+ mergo.Merge(&dest, src, mergo.WithTransformers(timeTransformer{}))
+ fmt.Println(dest)
+ // Will print
+ // { 2018-01-12 01:15:00 +0000 UTC m=+0.000000001 }
}
- // More code [...]
+Contact me
+
+If I can help you, you have an idea or you are using Mergo in your projects, don't hesitate to drop me a line (or a pull request): https://twitter.com/im_dario
+
+About
+
+Written by Dario Castañé: https://da.rio.hn
+
+License
+
+BSD 3-Clause license, as Go language.
*/
package mergo
diff --git a/vendor/github.com/imdario/mergo/map.go b/vendor/github.com/imdario/mergo/map.go
index 6ea38e63..b50d5c2a 100644
--- a/vendor/github.com/imdario/mergo/map.go
+++ b/vendor/github.com/imdario/mergo/map.go
@@ -44,7 +44,7 @@ func deepMap(dst, src reflect.Value, visited map[uintptr]*visit, depth int, conf
}
}
// Remember, remember...
- visited[h] = &visit{addr, typ, seen}
+ visited[h] = &visit{typ, seen, addr}
}
zeroValue := reflect.Value{}
switch dst.Kind() {
@@ -58,7 +58,7 @@ func deepMap(dst, src reflect.Value, visited map[uintptr]*visit, depth int, conf
}
fieldName := field.Name
fieldName = changeInitialCase(fieldName, unicode.ToLower)
- if v, ok := dstMap[fieldName]; !ok || (isEmptyValue(reflect.ValueOf(v)) || overwrite) {
+ if v, ok := dstMap[fieldName]; !ok || (isEmptyValue(reflect.ValueOf(v), !config.ShouldNotDereference) || overwrite) {
dstMap[fieldName] = src.Field(i).Interface()
}
}
@@ -72,6 +72,7 @@ func deepMap(dst, src reflect.Value, visited map[uintptr]*visit, depth int, conf
case reflect.Struct:
srcMap := src.Interface().(map[string]interface{})
for key := range srcMap {
+ config.overwriteWithEmptyValue = true
srcValue := srcMap[key]
fieldName := changeInitialCase(key, unicode.ToUpper)
dstElement := dst.FieldByName(fieldName)
@@ -140,6 +141,9 @@ func MapWithOverwrite(dst, src interface{}, opts ...func(*Config)) error {
}
func _map(dst, src interface{}, opts ...func(*Config)) error {
+ if dst != nil && reflect.ValueOf(dst).Kind() != reflect.Ptr {
+ return ErrNonPointerArgument
+ }
var (
vDst, vSrc reflect.Value
err error
diff --git a/vendor/github.com/imdario/mergo/merge.go b/vendor/github.com/imdario/mergo/merge.go
index 44f70a89..0ef9b213 100644
--- a/vendor/github.com/imdario/mergo/merge.go
+++ b/vendor/github.com/imdario/mergo/merge.go
@@ -13,22 +13,40 @@ import (
"reflect"
)
-func hasExportedField(dst reflect.Value) (exported bool) {
+func hasMergeableFields(dst reflect.Value) (exported bool) {
for i, n := 0, dst.NumField(); i < n; i++ {
field := dst.Type().Field(i)
if field.Anonymous && dst.Field(i).Kind() == reflect.Struct {
- exported = exported || hasExportedField(dst.Field(i))
- } else {
+ exported = exported || hasMergeableFields(dst.Field(i))
+ } else if isExportedComponent(&field) {
exported = exported || len(field.PkgPath) == 0
}
}
return
}
+func isExportedComponent(field *reflect.StructField) bool {
+ pkgPath := field.PkgPath
+ if len(pkgPath) > 0 {
+ return false
+ }
+ c := field.Name[0]
+ if 'a' <= c && c <= 'z' || c == '_' {
+ return false
+ }
+ return true
+}
+
type Config struct {
- Overwrite bool
- AppendSlice bool
- Transformers Transformers
+ Transformers Transformers
+ Overwrite bool
+ ShouldNotDereference bool
+ AppendSlice bool
+ TypeCheck bool
+ overwriteWithEmptyValue bool
+ overwriteSliceWithEmptyValue bool
+ sliceDeepCopy bool
+ debug bool
}
type Transformers interface {
@@ -40,6 +58,10 @@ type Transformers interface {
// short circuiting on recursive types.
func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, config *Config) (err error) {
overwrite := config.Overwrite
+ typeCheck := config.TypeCheck
+ overwriteWithEmptySrc := config.overwriteWithEmptyValue
+ overwriteSliceWithEmptySrc := config.overwriteSliceWithEmptyValue
+ sliceDeepCopy := config.sliceDeepCopy
if !src.IsValid() {
return
@@ -55,10 +77,10 @@ func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, co
}
}
// Remember, remember...
- visited[h] = &visit{addr, typ, seen}
+ visited[h] = &visit{typ, seen, addr}
}
- if config.Transformers != nil && !isEmptyValue(dst) {
+ if config.Transformers != nil && !isReflectNil(dst) && dst.IsValid() {
if fn := config.Transformers.Transformer(dst.Type()); fn != nil {
err = fn(dst, src)
return
@@ -67,21 +89,34 @@ func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, co
switch dst.Kind() {
case reflect.Struct:
- if hasExportedField(dst) {
+ if hasMergeableFields(dst) {
for i, n := 0, dst.NumField(); i < n; i++ {
if err = deepMerge(dst.Field(i), src.Field(i), visited, depth+1, config); err != nil {
return
}
}
} else {
- if dst.CanSet() && !isEmptyValue(src) && (overwrite || isEmptyValue(dst)) {
+ if dst.CanSet() && (isReflectNil(dst) || overwrite) && (!isEmptyValue(src, !config.ShouldNotDereference) || overwriteWithEmptySrc) {
dst.Set(src)
}
}
case reflect.Map:
if dst.IsNil() && !src.IsNil() {
- dst.Set(reflect.MakeMap(dst.Type()))
+ if dst.CanSet() {
+ dst.Set(reflect.MakeMap(dst.Type()))
+ } else {
+ dst = src
+ return
+ }
+ }
+
+ if src.Kind() != reflect.Map {
+ if overwrite && dst.CanSet() {
+ dst.Set(src)
+ }
+ return
}
+
for _, key := range src.MapKeys() {
srcElement := src.MapIndex(key)
if !srcElement.IsValid() {
@@ -91,6 +126,9 @@ func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, co
switch srcElement.Kind() {
case reflect.Chan, reflect.Func, reflect.Map, reflect.Interface, reflect.Slice:
if srcElement.IsNil() {
+ if overwrite {
+ dst.SetMapIndex(key, srcElement)
+ }
continue
}
fallthrough
@@ -125,54 +163,116 @@ func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, co
dstSlice = reflect.ValueOf(dstElement.Interface())
}
- if !isEmptyValue(src) && (overwrite || isEmptyValue(dst)) && !config.AppendSlice {
+ if (!isEmptyValue(src, !config.ShouldNotDereference) || overwriteWithEmptySrc || overwriteSliceWithEmptySrc) && (overwrite || isEmptyValue(dst, !config.ShouldNotDereference)) && !config.AppendSlice && !sliceDeepCopy {
+ if typeCheck && srcSlice.Type() != dstSlice.Type() {
+ return fmt.Errorf("cannot override two slices with different type (%s, %s)", srcSlice.Type(), dstSlice.Type())
+ }
dstSlice = srcSlice
} else if config.AppendSlice {
if srcSlice.Type() != dstSlice.Type() {
- return fmt.Errorf("cannot append two slice with different type (%s, %s)", srcSlice.Type(), dstSlice.Type())
+ return fmt.Errorf("cannot append two slices with different type (%s, %s)", srcSlice.Type(), dstSlice.Type())
}
dstSlice = reflect.AppendSlice(dstSlice, srcSlice)
+ } else if sliceDeepCopy {
+ i := 0
+ for ; i < srcSlice.Len() && i < dstSlice.Len(); i++ {
+ srcElement := srcSlice.Index(i)
+ dstElement := dstSlice.Index(i)
+
+ if srcElement.CanInterface() {
+ srcElement = reflect.ValueOf(srcElement.Interface())
+ }
+ if dstElement.CanInterface() {
+ dstElement = reflect.ValueOf(dstElement.Interface())
+ }
+
+ if err = deepMerge(dstElement, srcElement, visited, depth+1, config); err != nil {
+ return
+ }
+ }
+
}
dst.SetMapIndex(key, dstSlice)
}
}
- if dstElement.IsValid() && reflect.TypeOf(srcElement.Interface()).Kind() == reflect.Map {
- continue
+
+ if dstElement.IsValid() && !isEmptyValue(dstElement, !config.ShouldNotDereference) {
+ if reflect.TypeOf(srcElement.Interface()).Kind() == reflect.Slice {
+ continue
+ }
+ if reflect.TypeOf(srcElement.Interface()).Kind() == reflect.Map && reflect.TypeOf(dstElement.Interface()).Kind() == reflect.Map {
+ continue
+ }
}
- if srcElement.IsValid() && (overwrite || (!dstElement.IsValid() || isEmptyValue(dstElement))) {
+ if srcElement.IsValid() && ((srcElement.Kind() != reflect.Ptr && overwrite) || !dstElement.IsValid() || isEmptyValue(dstElement, !config.ShouldNotDereference)) {
if dst.IsNil() {
dst.Set(reflect.MakeMap(dst.Type()))
}
dst.SetMapIndex(key, srcElement)
}
}
+
+ // Ensure that all keys in dst are deleted if they are not in src.
+ if overwriteWithEmptySrc {
+ for _, key := range dst.MapKeys() {
+ srcElement := src.MapIndex(key)
+ if !srcElement.IsValid() {
+ dst.SetMapIndex(key, reflect.Value{})
+ }
+ }
+ }
case reflect.Slice:
if !dst.CanSet() {
break
}
- if !isEmptyValue(src) && (overwrite || isEmptyValue(dst)) && !config.AppendSlice {
+ if (!isEmptyValue(src, !config.ShouldNotDereference) || overwriteWithEmptySrc || overwriteSliceWithEmptySrc) && (overwrite || isEmptyValue(dst, !config.ShouldNotDereference)) && !config.AppendSlice && !sliceDeepCopy {
dst.Set(src)
} else if config.AppendSlice {
if src.Type() != dst.Type() {
return fmt.Errorf("cannot append two slice with different type (%s, %s)", src.Type(), dst.Type())
}
dst.Set(reflect.AppendSlice(dst, src))
+ } else if sliceDeepCopy {
+ for i := 0; i < src.Len() && i < dst.Len(); i++ {
+ srcElement := src.Index(i)
+ dstElement := dst.Index(i)
+ if srcElement.CanInterface() {
+ srcElement = reflect.ValueOf(srcElement.Interface())
+ }
+ if dstElement.CanInterface() {
+ dstElement = reflect.ValueOf(dstElement.Interface())
+ }
+
+ if err = deepMerge(dstElement, srcElement, visited, depth+1, config); err != nil {
+ return
+ }
+ }
}
case reflect.Ptr:
fallthrough
case reflect.Interface:
- if src.IsNil() {
+ if isReflectNil(src) {
+ if overwriteWithEmptySrc && dst.CanSet() && src.Type().AssignableTo(dst.Type()) {
+ dst.Set(src)
+ }
break
}
+
if src.Kind() != reflect.Interface {
- if dst.IsNil() || overwrite {
- if dst.CanSet() && (overwrite || isEmptyValue(dst)) {
+ if dst.IsNil() || (src.Kind() != reflect.Ptr && overwrite) {
+ if dst.CanSet() && (overwrite || isEmptyValue(dst, !config.ShouldNotDereference)) {
dst.Set(src)
}
} else if src.Kind() == reflect.Ptr {
- if err = deepMerge(dst.Elem(), src.Elem(), visited, depth+1, config); err != nil {
- return
+ if !config.ShouldNotDereference {
+ if err = deepMerge(dst.Elem(), src.Elem(), visited, depth+1, config); err != nil {
+ return
+ }
+ } else {
+ if overwriteWithEmptySrc || (overwrite && !src.IsNil()) || dst.IsNil() {
+ dst.Set(src)
+ }
}
} else if dst.Elem().Type() == src.Type() {
if err = deepMerge(dst.Elem(), src, visited, depth+1, config); err != nil {
@@ -183,18 +283,31 @@ func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, co
}
break
}
+
if dst.IsNil() || overwrite {
- if dst.CanSet() && (overwrite || isEmptyValue(dst)) {
+ if dst.CanSet() && (overwrite || isEmptyValue(dst, !config.ShouldNotDereference)) {
dst.Set(src)
}
- } else if err = deepMerge(dst.Elem(), src.Elem(), visited, depth+1, config); err != nil {
- return
+ break
+ }
+
+ if dst.Elem().Kind() == src.Elem().Kind() {
+ if err = deepMerge(dst.Elem(), src.Elem(), visited, depth+1, config); err != nil {
+ return
+ }
+ break
}
default:
- if dst.CanSet() && !isEmptyValue(src) && (overwrite || isEmptyValue(dst)) {
- dst.Set(src)
+ mustSet := (isEmptyValue(dst, !config.ShouldNotDereference) || overwrite) && (!isEmptyValue(src, !config.ShouldNotDereference) || overwriteWithEmptySrc)
+ if mustSet {
+ if dst.CanSet() {
+ dst.Set(src)
+ } else {
+ dst = src
+ }
}
}
+
return
}
@@ -206,7 +319,7 @@ func Merge(dst, src interface{}, opts ...func(*Config)) error {
return merge(dst, src, opts...)
}
-// MergeWithOverwrite will do the same as Merge except that non-empty dst attributes will be overriden by
+// MergeWithOverwrite will do the same as Merge except that non-empty dst attributes will be overridden by
// non-empty src attribute values.
// Deprecated: use Merge(…) with WithOverride
func MergeWithOverwrite(dst, src interface{}, opts ...func(*Config)) error {
@@ -225,12 +338,43 @@ func WithOverride(config *Config) {
config.Overwrite = true
}
-// WithAppendSlice will make merge append slices instead of overwriting it
+// WithOverwriteWithEmptyValue will make merge override non empty dst attributes with empty src attributes values.
+func WithOverwriteWithEmptyValue(config *Config) {
+ config.Overwrite = true
+ config.overwriteWithEmptyValue = true
+}
+
+// WithOverrideEmptySlice will make merge override empty dst slice with empty src slice.
+func WithOverrideEmptySlice(config *Config) {
+ config.overwriteSliceWithEmptyValue = true
+}
+
+// WithoutDereference prevents dereferencing pointers when evaluating whether they are empty
+// (i.e. a non-nil pointer is never considered empty).
+func WithoutDereference(config *Config) {
+ config.ShouldNotDereference = true
+}
+
+// WithAppendSlice will make merge append slices instead of overwriting it.
func WithAppendSlice(config *Config) {
config.AppendSlice = true
}
+// WithTypeCheck will make merge check types while overwriting it (must be used with WithOverride).
+func WithTypeCheck(config *Config) {
+ config.TypeCheck = true
+}
+
+// WithSliceDeepCopy will merge slice element one by one with Overwrite flag.
+func WithSliceDeepCopy(config *Config) {
+ config.sliceDeepCopy = true
+ config.Overwrite = true
+}
+
func merge(dst, src interface{}, opts ...func(*Config)) error {
+ if dst != nil && reflect.ValueOf(dst).Kind() != reflect.Ptr {
+ return ErrNonPointerArgument
+ }
var (
vDst, vSrc reflect.Value
err error
@@ -250,3 +394,16 @@ func merge(dst, src interface{}, opts ...func(*Config)) error {
}
return deepMerge(vDst, vSrc, make(map[uintptr]*visit), 0, config)
}
+
+// IsReflectNil is the reflect value provided nil
+func isReflectNil(v reflect.Value) bool {
+ k := v.Kind()
+ switch k {
+ case reflect.Interface, reflect.Slice, reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr:
+ // Both interface and slice are nil if first word is 0.
+ // Both are always bigger than a word; assume flagIndir.
+ return v.IsNil()
+ default:
+ return false
+ }
+}
diff --git a/vendor/github.com/imdario/mergo/mergo.go b/vendor/github.com/imdario/mergo/mergo.go
index a82fea2f..0a721e2d 100644
--- a/vendor/github.com/imdario/mergo/mergo.go
+++ b/vendor/github.com/imdario/mergo/mergo.go
@@ -17,9 +17,10 @@ import (
var (
ErrNilArguments = errors.New("src and dst must not be nil")
ErrDifferentArgumentsTypes = errors.New("src and dst must be of same type")
- ErrNotSupported = errors.New("only structs and maps are supported")
+ ErrNotSupported = errors.New("only structs, maps, and slices are supported")
ErrExpectedMapAsDestination = errors.New("dst was expected to be a map")
ErrExpectedStructAsDestination = errors.New("dst was expected to be a struct")
+ ErrNonPointerArgument = errors.New("dst must be a pointer")
)
// During deepMerge, must keep track of checks that are
@@ -27,13 +28,13 @@ var (
// checks in progress are true when it reencounters them.
// Visited are stored in a map indexed by 17 * a1 + a2;
type visit struct {
- ptr uintptr
typ reflect.Type
next *visit
+ ptr uintptr
}
// From src/pkg/encoding/json/encode.go.
-func isEmptyValue(v reflect.Value) bool {
+func isEmptyValue(v reflect.Value, shouldDereference bool) bool {
switch v.Kind() {
case reflect.Array, reflect.Map, reflect.Slice, reflect.String:
return v.Len() == 0
@@ -49,7 +50,10 @@ func isEmptyValue(v reflect.Value) bool {
if v.IsNil() {
return true
}
- return isEmptyValue(v.Elem())
+ if shouldDereference {
+ return isEmptyValue(v.Elem(), shouldDereference)
+ }
+ return false
case reflect.Func:
return v.IsNil()
case reflect.Invalid:
@@ -64,7 +68,7 @@ func resolveValues(dst, src interface{}) (vDst, vSrc reflect.Value, err error) {
return
}
vDst = reflect.ValueOf(dst).Elem()
- if vDst.Kind() != reflect.Struct && vDst.Kind() != reflect.Map {
+ if vDst.Kind() != reflect.Struct && vDst.Kind() != reflect.Map && vDst.Kind() != reflect.Slice {
err = ErrNotSupported
return
}
@@ -75,23 +79,3 @@ func resolveValues(dst, src interface{}) (vDst, vSrc reflect.Value, err error) {
}
return
}
-
-// Traverses recursively both values, assigning src's fields values to dst.
-// The map argument tracks comparisons that have already been seen, which allows
-// short circuiting on recursive types.
-func deeper(dst, src reflect.Value, visited map[uintptr]*visit, depth int) (err error) {
- if dst.CanAddr() {
- addr := dst.UnsafeAddr()
- h := 17 * addr
- seen := visited[h]
- typ := dst.Type()
- for p := seen; p != nil; p = p.next {
- if p.ptr == addr && p.typ == typ {
- return nil
- }
- }
- // Remember, remember...
- visited[h] = &visit{addr, typ, seen}
- }
- return // TODO refactor
-}
diff --git a/vendor/github.com/inlets/cloud-provision/provision/civo.go b/vendor/github.com/inlets/cloud-provision/provision/civo.go
deleted file mode 100644
index 4763c13f..00000000
--- a/vendor/github.com/inlets/cloud-provision/provision/civo.go
+++ /dev/null
@@ -1,267 +0,0 @@
-// Copyright (c) Inlets Author(s) 2019. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-package provision
-
-import (
- "encoding/json"
- "errors"
- "fmt"
- "io"
- "io/ioutil"
- "log"
- "net/http"
- "net/url"
-
- "strings"
- "time"
-)
-
-// CivoProvisioner creates instances on civo.com
-type CivoProvisioner struct {
- APIKey string
-}
-
-// Network represents a network for civo vm instances to connect to
-type Network struct {
- ID string `json:"id"`
- Name string `json:"name,omitempty"`
- Default bool `json:"default,omitempty"`
- CIDR string `json:"cidr,omitempty"`
- Label string `json:"label,omitempty"`
-}
-
-// NewCivoProvisioner with an accessKey
-func NewCivoProvisioner(accessKey string) (*CivoProvisioner, error) {
- return &CivoProvisioner{
- APIKey: accessKey,
- }, nil
-}
-
-// Status gets the status of the exit node
-func (p *CivoProvisioner) Status(id string) (*ProvisionedHost, error) {
- host := &ProvisionedHost{}
-
- apiURL := fmt.Sprint("https://api.civo.com/v2/instances/", id)
-
- req, err := http.NewRequest(http.MethodGet, apiURL, nil)
- if err != nil {
- return host, err
- }
- addAuth(req, p.APIKey)
-
- req.Header.Add("Accept", "application/json")
- instance := createdInstance{}
-
- res, err := http.DefaultClient.Do(req)
- if err != nil {
- return host, err
- }
-
- var body []byte
- if res.Body != nil {
- defer res.Body.Close()
- body, _ = ioutil.ReadAll(res.Body)
- }
-
- if res.StatusCode != http.StatusOK {
- return host, fmt.Errorf("unexpected HTTP code: %d\n%q", res.StatusCode, string(body))
- }
-
- unmarshalErr := json.Unmarshal(body, &instance)
- if unmarshalErr != nil {
- return host, unmarshalErr
- }
-
- return &ProvisionedHost{
- ID: instance.ID,
- IP: instance.PublicIP,
- Status: strings.ToLower(instance.Status),
- }, nil
-}
-
-// Delete terminates the exit node
-func (p *CivoProvisioner) Delete(request HostDeleteRequest) error {
- var id string
- var err error
- if len(request.ID) > 0 {
- id = request.ID
- } else {
- id, err = p.lookupID(request)
- if err != nil {
- return err
- }
- }
-
- apiURL := fmt.Sprint("https://api.civo.com/v2/instances/", id)
- _, err = apiCall(p.APIKey, http.MethodDelete, apiURL, nil)
- if err != nil {
- return err
- }
- return nil
-}
-
-// Provision creates a new exit node
-func (p *CivoProvisioner) Provision(host BasicHost) (*ProvisionedHost, error) {
-
- log.Printf("Provisioning host with Civo\n")
-
- if host.Region == "" {
- host.Region = "lon1"
- }
-
- res, err := provisionCivoInstance(host, p.APIKey)
-
- if err != nil {
- return nil, err
- }
-
- return &ProvisionedHost{
- ID: res.ID,
- }, nil
-}
-
-// List returns a list of exit nodes
-func (p *CivoProvisioner) List(filter ListFilter) ([]*ProvisionedHost, error) {
- var inlets []*ProvisionedHost
- apiURL := fmt.Sprintf("https://api.civo.com/v2/instances/?tags=%s", filter.Filter)
- body, err := apiCall(p.APIKey, http.MethodGet, apiURL, nil)
- if err != nil {
- return inlets, err
- }
-
- var resp apiResponse
- unmarshalErr := json.Unmarshal(body, &resp)
- if unmarshalErr != nil {
- return inlets, unmarshalErr
- }
-
- for _, instance := range resp.Items {
- host := &ProvisionedHost{
- IP: instance.PublicIP,
- ID: instance.ID,
- Status: instance.Status,
- }
- inlets = append(inlets, host)
- }
- return inlets, nil
-}
-
-func (p *CivoProvisioner) lookupID(request HostDeleteRequest) (string, error) {
- inlets, err := p.List(ListFilter{Filter: "inlets"})
- if err != nil {
- return "", err
- }
- for _, inlet := range inlets {
- if inlet.IP == request.IP {
- return inlet.ID, nil
- }
- }
- return "", fmt.Errorf("no host with ip: %s", request.IP)
-}
-
-// gets the default network for the selected region.
-func getDefaultNetwork(key, region string) (*Network, error) {
- apiURL := "https://api.civo.com/v2/networks"
- values := url.Values{}
- values.Add("region", region)
- body, err := apiCall(key, http.MethodGet, apiURL, strings.NewReader(values.Encode()))
- if err != nil {
- return nil, err
- }
-
- networks := []Network{}
- if err := json.Unmarshal(body, &networks); err != nil {
- return nil, err
- }
-
- for _, network := range networks {
- if network.Default {
- return &network, nil
- }
- }
- return nil, errors.New("no default network found")
-}
-
-func provisionCivoInstance(host BasicHost, key string) (createdInstance, error) {
- instance := createdInstance{}
-
- network, err := getDefaultNetwork(key, host.Region)
- if err != nil {
- return instance, err
- }
-
- apiURL := "https://api.civo.com/v2/instances"
-
- values := url.Values{}
- values.Add("hostname", host.Name)
- values.Add("size", host.Plan)
- values.Add("public_ip", "create")
- values.Add("template_id", host.OS)
- values.Add("initial_user", "civo")
- values.Add("script", host.UserData)
- values.Add("region", host.Region)
- values.Add("network_id", network.ID)
- values.Add("tags", "inlets")
-
- body, err := apiCall(key, http.MethodPost, apiURL, strings.NewReader(values.Encode()))
- if err != nil {
- return instance, err
- }
-
- unmarshalErr := json.Unmarshal(body, &instance)
- if unmarshalErr != nil {
- return instance, unmarshalErr
- }
-
- fmt.Printf("Instance ID: %s\n", instance.ID)
- return instance, nil
-}
-
-func apiCall(key, method, url string, requestBody io.Reader) ([]byte, error) {
-
- req, err := http.NewRequest(method, url, requestBody)
- if err != nil {
- return nil, err
- }
- addAuth(req, key)
-
- req.Header.Add("Accept", "application/json")
- req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
-
- res, err := http.DefaultClient.Do(req)
- if err != nil {
- return nil, err
- }
-
- var body []byte
- if res.Body != nil {
- defer res.Body.Close()
- body, err = ioutil.ReadAll(res.Body)
- if err != nil {
- return nil, err
- }
- }
-
- if res.StatusCode != http.StatusOK {
- return nil, fmt.Errorf("unexpected HTTP code: %d\n%q", res.StatusCode, string(body))
- }
-
- return body, nil
-}
-
-type apiResponse struct {
- Items []createdInstance `json:"items"`
-}
-
-type createdInstance struct {
- ID string `json:"id"`
- CreatedAt time.Time `json:"created_at"`
- PublicIP string `json:"public_ip"`
- Status string `json:"status"`
-}
-
-func addAuth(r *http.Request, APIKey string) {
- r.Header.Add("Authorization", fmt.Sprintf("bearer %s", APIKey))
- r.Header.Add("User-Agent", "inlets")
-}
diff --git a/vendor/github.com/inlets/cloud-provision/provision/equinix_metal.go b/vendor/github.com/inlets/cloud-provision/provision/equinix_metal.go
deleted file mode 100644
index b9ce2325..00000000
--- a/vendor/github.com/inlets/cloud-provision/provision/equinix_metal.go
+++ /dev/null
@@ -1,128 +0,0 @@
-package provision
-
-import (
- "fmt"
-
- "github.com/hashicorp/go-retryablehttp"
- "github.com/packethost/packngo"
-)
-
-// EquinixMetalProvisioner provisions a host to Equinix Metal
-type EquinixMetalProvisioner struct {
- client *packngo.Client
-}
-
-// NewEquinixMetalProvisioner create a EquinixMetalProvisioner with an accessKey
-func NewEquinixMetalProvisioner(accessKey string) (*EquinixMetalProvisioner, error) {
- httpClient := retryablehttp.NewClient()
-
- return &EquinixMetalProvisioner{
- client: packngo.NewClientWithAuth("", accessKey, httpClient.HTTPClient),
- }, nil
-}
-
-// Status returns the IP, ID and Status of the exit node
-func (p *EquinixMetalProvisioner) Status(id string) (*ProvisionedHost, error) {
- device, _, err := p.client.Devices.Get(id, nil)
-
- if err != nil {
- return nil, err
- }
-
- state := device.State
-
- ip := ""
- for _, network := range device.Network {
- if network.Public {
- ip = network.IpAddressCommon.Address
- break
- }
- }
-
- return &ProvisionedHost{
- ID: device.ID,
- Status: state,
- IP: ip,
- }, nil
-}
-
-// Delete terminates the exit node
-func (p *EquinixMetalProvisioner) Delete(request HostDeleteRequest) error {
- var id string
- var err error
- if len(request.ID) > 0 {
- id = request.ID
- } else {
- id, err = p.lookupID(request)
- if err != nil {
- return err
- }
- }
- force := true
- _, err = p.client.Devices.Delete(id, force)
- return err
-}
-
-// Provision a host
-func (p *EquinixMetalProvisioner) Provision(host BasicHost) (*ProvisionedHost, error) {
- if host.Region == "" {
- host.Region = "am6"
- }
- createReq := &packngo.DeviceCreateRequest{
- Plan: host.Plan,
- Facility: []string{host.Region},
- Hostname: host.Name,
- ProjectID: host.Additional["project_id"],
- SpotInstance: false,
- OS: host.OS,
- BillingCycle: "hourly",
- UserData: host.UserData,
- Tags: []string{"inlets"},
- NoSSHKeys: true,
- }
-
- device, _, err := p.client.Devices.Create(createReq)
-
- if err != nil {
- return nil, err
- }
-
- return &ProvisionedHost{
- ID: device.ID,
- }, nil
-}
-
-// List returns a list of exit nodes
-func (p *EquinixMetalProvisioner) List(filter ListFilter) ([]*ProvisionedHost, error) {
- var inlets []*ProvisionedHost
- devices, _, err := p.client.Devices.List(filter.ProjectID, nil)
- if err != nil {
- return nil, err
- }
- for _, device := range devices {
- for _, tag := range device.Tags {
- if tag == filter.Filter {
- net := device.GetNetworkInfo()
- host := &ProvisionedHost{
- IP: net.PublicIPv4,
- ID: device.ID,
- }
- inlets = append(inlets, host)
- }
- }
- }
- return inlets, nil
-}
-
-func (p *EquinixMetalProvisioner) lookupID(request HostDeleteRequest) (string, error) {
- inlets, err := p.List(ListFilter{Filter: "inlets", ProjectID: request.ProjectID})
- if err != nil {
- return "", err
- }
- for _, inlet := range inlets {
- if inlet.IP == request.IP {
- return inlet.ID, nil
- }
- }
- return "", fmt.Errorf("no host with ip: %s", request.IP)
-}
diff --git a/vendor/github.com/klauspost/compress/.gitattributes b/vendor/github.com/klauspost/compress/.gitattributes
new file mode 100644
index 00000000..40243359
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/.gitattributes
@@ -0,0 +1,2 @@
+* -text
+*.bin -text -diff
diff --git a/vendor/github.com/packethost/packngo/.gitignore b/vendor/github.com/klauspost/compress/.gitignore
similarity index 74%
rename from vendor/github.com/packethost/packngo/.gitignore
rename to vendor/github.com/klauspost/compress/.gitignore
index 7cc2daad..d31b3781 100644
--- a/vendor/github.com/packethost/packngo/.gitignore
+++ b/vendor/github.com/klauspost/compress/.gitignore
@@ -1,4 +1,3 @@
-### Go template
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
@@ -23,8 +22,11 @@ _testmain.go
*.exe
*.test
*.prof
-*.swp
+/s2/cmd/_s2sx/sfx-exe
-# IDEs
-.idea**/**
-.vscode
+# Linux perf files
+perf.data
+perf.data.old
+
+# gdb history
+.gdb_history
diff --git a/vendor/github.com/klauspost/compress/.goreleaser.yml b/vendor/github.com/klauspost/compress/.goreleaser.yml
new file mode 100644
index 00000000..4528059c
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/.goreleaser.yml
@@ -0,0 +1,123 @@
+version: 2
+
+before:
+ hooks:
+ - ./gen.sh
+
+builds:
+ -
+ id: "s2c"
+ binary: s2c
+ main: ./s2/cmd/s2c/main.go
+ flags:
+ - -trimpath
+ env:
+ - CGO_ENABLED=0
+ goos:
+ - aix
+ - linux
+ - freebsd
+ - netbsd
+ - windows
+ - darwin
+ goarch:
+ - 386
+ - amd64
+ - arm
+ - arm64
+ - ppc64
+ - ppc64le
+ - mips64
+ - mips64le
+ goarm:
+ - 7
+ -
+ id: "s2d"
+ binary: s2d
+ main: ./s2/cmd/s2d/main.go
+ flags:
+ - -trimpath
+ env:
+ - CGO_ENABLED=0
+ goos:
+ - aix
+ - linux
+ - freebsd
+ - netbsd
+ - windows
+ - darwin
+ goarch:
+ - 386
+ - amd64
+ - arm
+ - arm64
+ - ppc64
+ - ppc64le
+ - mips64
+ - mips64le
+ goarm:
+ - 7
+ -
+ id: "s2sx"
+ binary: s2sx
+ main: ./s2/cmd/_s2sx/main.go
+ flags:
+ - -modfile=s2sx.mod
+ - -trimpath
+ env:
+ - CGO_ENABLED=0
+ goos:
+ - aix
+ - linux
+ - freebsd
+ - netbsd
+ - windows
+ - darwin
+ goarch:
+ - 386
+ - amd64
+ - arm
+ - arm64
+ - ppc64
+ - ppc64le
+ - mips64
+ - mips64le
+ goarm:
+ - 7
+
+archives:
+ -
+ id: s2-binaries
+ name_template: "s2-{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
+ format_overrides:
+ - goos: windows
+ format: zip
+ files:
+ - unpack/*
+ - s2/LICENSE
+ - s2/README.md
+checksum:
+ name_template: 'checksums.txt'
+snapshot:
+ version_template: "{{ .Tag }}-next"
+changelog:
+ sort: asc
+ filters:
+ exclude:
+ - '^doc:'
+ - '^docs:'
+ - '^test:'
+ - '^tests:'
+ - '^Update\sREADME.md'
+
+nfpms:
+ -
+ file_name_template: "s2_package__{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
+ vendor: Klaus Post
+ homepage: https://github.com/klauspost/compress
+ maintainer: Klaus Post
+ description: S2 Compression Tool
+ license: BSD 3-Clause
+ formats:
+ - deb
+ - rpm
diff --git a/vendor/github.com/klauspost/compress/LICENSE b/vendor/github.com/klauspost/compress/LICENSE
new file mode 100644
index 00000000..87d55747
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/LICENSE
@@ -0,0 +1,304 @@
+Copyright (c) 2012 The Go Authors. All rights reserved.
+Copyright (c) 2019 Klaus Post. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
+distribution.
+ * Neither the name of Google Inc. nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+------------------
+
+Files: gzhttp/*
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright 2016-2017 The New York Times Company
+
+ 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.
+
+------------------
+
+Files: s2/cmd/internal/readahead/*
+
+The MIT License (MIT)
+
+Copyright (c) 2015 Klaus Post
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+---------------------
+Files: snappy/*
+Files: internal/snapref/*
+
+Copyright (c) 2011 The Snappy-Go Authors. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
+distribution.
+ * Neither the name of Google Inc. nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+-----------------
+
+Files: s2/cmd/internal/filepathx/*
+
+Copyright 2016 The filepathx Authors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/vendor/github.com/klauspost/compress/README.md b/vendor/github.com/klauspost/compress/README.md
new file mode 100644
index 00000000..de264c85
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/README.md
@@ -0,0 +1,721 @@
+# compress
+
+This package provides various compression algorithms.
+
+* [zstandard](https://github.com/klauspost/compress/tree/master/zstd#zstd) compression and decompression in pure Go.
+* [S2](https://github.com/klauspost/compress/tree/master/s2#s2-compression) is a high performance replacement for Snappy.
+* Optimized [deflate](https://godoc.org/github.com/klauspost/compress/flate) packages which can be used as a dropin replacement for [gzip](https://godoc.org/github.com/klauspost/compress/gzip), [zip](https://godoc.org/github.com/klauspost/compress/zip) and [zlib](https://godoc.org/github.com/klauspost/compress/zlib).
+* [snappy](https://github.com/klauspost/compress/tree/master/snappy) is a drop-in replacement for `github.com/golang/snappy` offering better compression and concurrent streams.
+* [huff0](https://github.com/klauspost/compress/tree/master/huff0) and [FSE](https://github.com/klauspost/compress/tree/master/fse) implementations for raw entropy encoding.
+* [gzhttp](https://github.com/klauspost/compress/tree/master/gzhttp) Provides client and server wrappers for handling gzipped requests efficiently.
+* [pgzip](https://github.com/klauspost/pgzip) is a separate package that provides a very fast parallel gzip implementation.
+
+[![Go Reference](https://pkg.go.dev/badge/klauspost/compress.svg)](https://pkg.go.dev/github.com/klauspost/compress?tab=subdirectories)
+[![Go](https://github.com/klauspost/compress/actions/workflows/go.yml/badge.svg)](https://github.com/klauspost/compress/actions/workflows/go.yml)
+[![Sourcegraph Badge](https://sourcegraph.com/github.com/klauspost/compress/-/badge.svg)](https://sourcegraph.com/github.com/klauspost/compress?badge)
+
+# changelog
+
+* Sep 23rd, 2024 - [1.17.10](https://github.com/klauspost/compress/releases/tag/v1.17.10)
+ * gzhttp: Add TransportAlwaysDecompress option. https://github.com/klauspost/compress/pull/978
+ * gzhttp: Add supported decompress request body by @mirecl in https://github.com/klauspost/compress/pull/1002
+ * s2: Add EncodeBuffer buffer recycling callback https://github.com/klauspost/compress/pull/982
+ * zstd: Improve memory usage on small streaming encodes https://github.com/klauspost/compress/pull/1007
+ * flate: read data written with partial flush by @vajexal in https://github.com/klauspost/compress/pull/996
+
+* Jun 12th, 2024 - [1.17.9](https://github.com/klauspost/compress/releases/tag/v1.17.9)
+ * s2: Reduce ReadFrom temporary allocations https://github.com/klauspost/compress/pull/949
+ * flate, zstd: Shave some bytes off amd64 matchLen by @greatroar in https://github.com/klauspost/compress/pull/963
+ * Upgrade zip/zlib to 1.22.4 upstream https://github.com/klauspost/compress/pull/970 https://github.com/klauspost/compress/pull/971
+ * zstd: BuildDict fails with RLE table https://github.com/klauspost/compress/pull/951
+
+* Apr 9th, 2024 - [1.17.8](https://github.com/klauspost/compress/releases/tag/v1.17.8)
+ * zstd: Reject blocks where reserved values are not 0 https://github.com/klauspost/compress/pull/885
+ * zstd: Add RLE detection+encoding https://github.com/klauspost/compress/pull/938
+
+* Feb 21st, 2024 - [1.17.7](https://github.com/klauspost/compress/releases/tag/v1.17.7)
+ * s2: Add AsyncFlush method: Complete the block without flushing by @Jille in https://github.com/klauspost/compress/pull/927
+ * s2: Fix literal+repeat exceeds dst crash https://github.com/klauspost/compress/pull/930
+
+* Feb 5th, 2024 - [1.17.6](https://github.com/klauspost/compress/releases/tag/v1.17.6)
+ * zstd: Fix incorrect repeat coding in best mode https://github.com/klauspost/compress/pull/923
+ * s2: Fix DecodeConcurrent deadlock on errors https://github.com/klauspost/compress/pull/925
+
+* Jan 26th, 2024 - [v1.17.5](https://github.com/klauspost/compress/releases/tag/v1.17.5)
+ * flate: Fix reset with dictionary on custom window encodes https://github.com/klauspost/compress/pull/912
+ * zstd: Add Frame header encoding and stripping https://github.com/klauspost/compress/pull/908
+ * zstd: Limit better/best default window to 8MB https://github.com/klauspost/compress/pull/913
+ * zstd: Speed improvements by @greatroar in https://github.com/klauspost/compress/pull/896 https://github.com/klauspost/compress/pull/910
+ * s2: Fix callbacks for skippable blocks and disallow 0xfe (Padding) by @Jille in https://github.com/klauspost/compress/pull/916 https://github.com/klauspost/compress/pull/917
+https://github.com/klauspost/compress/pull/919 https://github.com/klauspost/compress/pull/918
+
+* Dec 1st, 2023 - [v1.17.4](https://github.com/klauspost/compress/releases/tag/v1.17.4)
+ * huff0: Speed up symbol counting by @greatroar in https://github.com/klauspost/compress/pull/887
+ * huff0: Remove byteReader by @greatroar in https://github.com/klauspost/compress/pull/886
+ * gzhttp: Allow overriding decompression on transport https://github.com/klauspost/compress/pull/892
+ * gzhttp: Clamp compression level https://github.com/klauspost/compress/pull/890
+ * gzip: Error out if reserved bits are set https://github.com/klauspost/compress/pull/891
+
+* Nov 15th, 2023 - [v1.17.3](https://github.com/klauspost/compress/releases/tag/v1.17.3)
+ * fse: Fix max header size https://github.com/klauspost/compress/pull/881
+ * zstd: Improve better/best compression https://github.com/klauspost/compress/pull/877
+ * gzhttp: Fix missing content type on Close https://github.com/klauspost/compress/pull/883
+
+* Oct 22nd, 2023 - [v1.17.2](https://github.com/klauspost/compress/releases/tag/v1.17.2)
+ * zstd: Fix rare *CORRUPTION* output in "best" mode. See https://github.com/klauspost/compress/pull/876
+
+* Oct 14th, 2023 - [v1.17.1](https://github.com/klauspost/compress/releases/tag/v1.17.1)
+ * s2: Fix S2 "best" dictionary wrong encoding by @klauspost in https://github.com/klauspost/compress/pull/871
+ * flate: Reduce allocations in decompressor and minor code improvements by @fakefloordiv in https://github.com/klauspost/compress/pull/869
+ * s2: Fix EstimateBlockSize on 6&7 length input by @klauspost in https://github.com/klauspost/compress/pull/867
+
+* Sept 19th, 2023 - [v1.17.0](https://github.com/klauspost/compress/releases/tag/v1.17.0)
+ * Add experimental dictionary builder https://github.com/klauspost/compress/pull/853
+ * Add xerial snappy read/writer https://github.com/klauspost/compress/pull/838
+ * flate: Add limited window compression https://github.com/klauspost/compress/pull/843
+ * s2: Do 2 overlapping match checks https://github.com/klauspost/compress/pull/839
+ * flate: Add amd64 assembly matchlen https://github.com/klauspost/compress/pull/837
+ * gzip: Copy bufio.Reader on Reset by @thatguystone in https://github.com/klauspost/compress/pull/860
+
+
+ See changes to v1.16.x
+
+
+* July 1st, 2023 - [v1.16.7](https://github.com/klauspost/compress/releases/tag/v1.16.7)
+ * zstd: Fix default level first dictionary encode https://github.com/klauspost/compress/pull/829
+ * s2: add GetBufferCapacity() method by @GiedriusS in https://github.com/klauspost/compress/pull/832
+
+* June 13, 2023 - [v1.16.6](https://github.com/klauspost/compress/releases/tag/v1.16.6)
+ * zstd: correctly ignore WithEncoderPadding(1) by @ianlancetaylor in https://github.com/klauspost/compress/pull/806
+ * zstd: Add amd64 match length assembly https://github.com/klauspost/compress/pull/824
+ * gzhttp: Handle informational headers by @rtribotte in https://github.com/klauspost/compress/pull/815
+ * s2: Improve Better compression slightly https://github.com/klauspost/compress/pull/663
+
+* Apr 16, 2023 - [v1.16.5](https://github.com/klauspost/compress/releases/tag/v1.16.5)
+ * zstd: readByte needs to use io.ReadFull by @jnoxon in https://github.com/klauspost/compress/pull/802
+ * gzip: Fix WriterTo after initial read https://github.com/klauspost/compress/pull/804
+
+* Apr 5, 2023 - [v1.16.4](https://github.com/klauspost/compress/releases/tag/v1.16.4)
+ * zstd: Improve zstd best efficiency by @greatroar and @klauspost in https://github.com/klauspost/compress/pull/784
+ * zstd: Respect WithAllLitEntropyCompression https://github.com/klauspost/compress/pull/792
+ * zstd: Fix amd64 not always detecting corrupt data https://github.com/klauspost/compress/pull/785
+ * zstd: Various minor improvements by @greatroar in https://github.com/klauspost/compress/pull/788 https://github.com/klauspost/compress/pull/794 https://github.com/klauspost/compress/pull/795
+ * s2: Fix huge block overflow https://github.com/klauspost/compress/pull/779
+ * s2: Allow CustomEncoder fallback https://github.com/klauspost/compress/pull/780
+ * gzhttp: Support ResponseWriter Unwrap() in gzhttp handler by @jgimenez in https://github.com/klauspost/compress/pull/799
+
+* Mar 13, 2023 - [v1.16.1](https://github.com/klauspost/compress/releases/tag/v1.16.1)
+ * zstd: Speed up + improve best encoder by @greatroar in https://github.com/klauspost/compress/pull/776
+ * gzhttp: Add optional [BREACH mitigation](https://github.com/klauspost/compress/tree/master/gzhttp#breach-mitigation). https://github.com/klauspost/compress/pull/762 https://github.com/klauspost/compress/pull/768 https://github.com/klauspost/compress/pull/769 https://github.com/klauspost/compress/pull/770 https://github.com/klauspost/compress/pull/767
+ * s2: Add Intel LZ4s converter https://github.com/klauspost/compress/pull/766
+ * zstd: Minor bug fixes https://github.com/klauspost/compress/pull/771 https://github.com/klauspost/compress/pull/772 https://github.com/klauspost/compress/pull/773
+ * huff0: Speed up compress1xDo by @greatroar in https://github.com/klauspost/compress/pull/774
+
+* Feb 26, 2023 - [v1.16.0](https://github.com/klauspost/compress/releases/tag/v1.16.0)
+ * s2: Add [Dictionary](https://github.com/klauspost/compress/tree/master/s2#dictionaries) support. https://github.com/klauspost/compress/pull/685
+ * s2: Add Compression Size Estimate. https://github.com/klauspost/compress/pull/752
+ * s2: Add support for custom stream encoder. https://github.com/klauspost/compress/pull/755
+ * s2: Add LZ4 block converter. https://github.com/klauspost/compress/pull/748
+ * s2: Support io.ReaderAt in ReadSeeker. https://github.com/klauspost/compress/pull/747
+ * s2c/s2sx: Use concurrent decoding. https://github.com/klauspost/compress/pull/746
+
+
+
+ See changes to v1.15.x
+
+* Jan 21st, 2023 (v1.15.15)
+ * deflate: Improve level 7-9 by @klauspost in https://github.com/klauspost/compress/pull/739
+ * zstd: Add delta encoding support by @greatroar in https://github.com/klauspost/compress/pull/728
+ * zstd: Various speed improvements by @greatroar https://github.com/klauspost/compress/pull/741 https://github.com/klauspost/compress/pull/734 https://github.com/klauspost/compress/pull/736 https://github.com/klauspost/compress/pull/744 https://github.com/klauspost/compress/pull/743 https://github.com/klauspost/compress/pull/745
+ * gzhttp: Add SuffixETag() and DropETag() options to prevent ETag collisions on compressed responses by @willbicks in https://github.com/klauspost/compress/pull/740
+
+* Jan 3rd, 2023 (v1.15.14)
+
+ * flate: Improve speed in big stateless blocks https://github.com/klauspost/compress/pull/718
+ * zstd: Minor speed tweaks by @greatroar in https://github.com/klauspost/compress/pull/716 https://github.com/klauspost/compress/pull/720
+ * export NoGzipResponseWriter for custom ResponseWriter wrappers by @harshavardhana in https://github.com/klauspost/compress/pull/722
+ * s2: Add example for indexing and existing stream https://github.com/klauspost/compress/pull/723
+
+* Dec 11, 2022 (v1.15.13)
+ * zstd: Add [MaxEncodedSize](https://pkg.go.dev/github.com/klauspost/compress@v1.15.13/zstd#Encoder.MaxEncodedSize) to encoder https://github.com/klauspost/compress/pull/691
+ * zstd: Various tweaks and improvements https://github.com/klauspost/compress/pull/693 https://github.com/klauspost/compress/pull/695 https://github.com/klauspost/compress/pull/696 https://github.com/klauspost/compress/pull/701 https://github.com/klauspost/compress/pull/702 https://github.com/klauspost/compress/pull/703 https://github.com/klauspost/compress/pull/704 https://github.com/klauspost/compress/pull/705 https://github.com/klauspost/compress/pull/706 https://github.com/klauspost/compress/pull/707 https://github.com/klauspost/compress/pull/708
+
+* Oct 26, 2022 (v1.15.12)
+
+ * zstd: Tweak decoder allocs. https://github.com/klauspost/compress/pull/680
+ * gzhttp: Always delete `HeaderNoCompression` https://github.com/klauspost/compress/pull/683
+
+* Sept 26, 2022 (v1.15.11)
+
+ * flate: Improve level 1-3 compression https://github.com/klauspost/compress/pull/678
+ * zstd: Improve "best" compression by @nightwolfz in https://github.com/klauspost/compress/pull/677
+ * zstd: Fix+reduce decompression allocations https://github.com/klauspost/compress/pull/668
+ * zstd: Fix non-effective noescape tag https://github.com/klauspost/compress/pull/667
+
+* Sept 16, 2022 (v1.15.10)
+
+ * zstd: Add [WithDecodeAllCapLimit](https://pkg.go.dev/github.com/klauspost/compress@v1.15.10/zstd#WithDecodeAllCapLimit) https://github.com/klauspost/compress/pull/649
+ * Add Go 1.19 - deprecate Go 1.16 https://github.com/klauspost/compress/pull/651
+ * flate: Improve level 5+6 compression https://github.com/klauspost/compress/pull/656
+ * zstd: Improve "better" compression https://github.com/klauspost/compress/pull/657
+ * s2: Improve "best" compression https://github.com/klauspost/compress/pull/658
+ * s2: Improve "better" compression. https://github.com/klauspost/compress/pull/635
+ * s2: Slightly faster non-assembly decompression https://github.com/klauspost/compress/pull/646
+ * Use arrays for constant size copies https://github.com/klauspost/compress/pull/659
+
+* July 21, 2022 (v1.15.9)
+
+ * zstd: Fix decoder crash on amd64 (no BMI) on invalid input https://github.com/klauspost/compress/pull/645
+ * zstd: Disable decoder extended memory copies (amd64) due to possible crashes https://github.com/klauspost/compress/pull/644
+ * zstd: Allow single segments up to "max decoded size" by @klauspost in https://github.com/klauspost/compress/pull/643
+
+* July 13, 2022 (v1.15.8)
+
+ * gzip: fix stack exhaustion bug in Reader.Read https://github.com/klauspost/compress/pull/641
+ * s2: Add Index header trim/restore https://github.com/klauspost/compress/pull/638
+ * zstd: Optimize seqdeq amd64 asm by @greatroar in https://github.com/klauspost/compress/pull/636
+ * zstd: Improve decoder memcopy https://github.com/klauspost/compress/pull/637
+ * huff0: Pass a single bitReader pointer to asm by @greatroar in https://github.com/klauspost/compress/pull/634
+ * zstd: Branchless getBits for amd64 w/o BMI2 by @greatroar in https://github.com/klauspost/compress/pull/640
+ * gzhttp: Remove header before writing https://github.com/klauspost/compress/pull/639
+
+* June 29, 2022 (v1.15.7)
+
+ * s2: Fix absolute forward seeks https://github.com/klauspost/compress/pull/633
+ * zip: Merge upstream https://github.com/klauspost/compress/pull/631
+ * zip: Re-add zip64 fix https://github.com/klauspost/compress/pull/624
+ * zstd: translate fseDecoder.buildDtable into asm by @WojciechMula in https://github.com/klauspost/compress/pull/598
+ * flate: Faster histograms https://github.com/klauspost/compress/pull/620
+ * deflate: Use compound hcode https://github.com/klauspost/compress/pull/622
+
+* June 3, 2022 (v1.15.6)
+ * s2: Improve coding for long, close matches https://github.com/klauspost/compress/pull/613
+ * s2c: Add Snappy/S2 stream recompression https://github.com/klauspost/compress/pull/611
+ * zstd: Always use configured block size https://github.com/klauspost/compress/pull/605
+ * zstd: Fix incorrect hash table placement for dict encoding in default https://github.com/klauspost/compress/pull/606
+ * zstd: Apply default config to ZipDecompressor without options https://github.com/klauspost/compress/pull/608
+ * gzhttp: Exclude more common archive formats https://github.com/klauspost/compress/pull/612
+ * s2: Add ReaderIgnoreCRC https://github.com/klauspost/compress/pull/609
+ * s2: Remove sanity load on index creation https://github.com/klauspost/compress/pull/607
+ * snappy: Use dedicated function for scoring https://github.com/klauspost/compress/pull/614
+ * s2c+s2d: Use official snappy framed extension https://github.com/klauspost/compress/pull/610
+
+* May 25, 2022 (v1.15.5)
+ * s2: Add concurrent stream decompression https://github.com/klauspost/compress/pull/602
+ * s2: Fix final emit oob read crash on amd64 https://github.com/klauspost/compress/pull/601
+ * huff0: asm implementation of Decompress1X by @WojciechMula https://github.com/klauspost/compress/pull/596
+ * zstd: Use 1 less goroutine for stream decoding https://github.com/klauspost/compress/pull/588
+ * zstd: Copy literal in 16 byte blocks when possible https://github.com/klauspost/compress/pull/592
+ * zstd: Speed up when WithDecoderLowmem(false) https://github.com/klauspost/compress/pull/599
+ * zstd: faster next state update in BMI2 version of decode by @WojciechMula in https://github.com/klauspost/compress/pull/593
+ * huff0: Do not check max size when reading table. https://github.com/klauspost/compress/pull/586
+ * flate: Inplace hashing for level 7-9 by @klauspost in https://github.com/klauspost/compress/pull/590
+
+
+* May 11, 2022 (v1.15.4)
+ * huff0: decompress directly into output by @WojciechMula in [#577](https://github.com/klauspost/compress/pull/577)
+ * inflate: Keep dict on stack [#581](https://github.com/klauspost/compress/pull/581)
+ * zstd: Faster decoding memcopy in asm [#583](https://github.com/klauspost/compress/pull/583)
+ * zstd: Fix ignored crc [#580](https://github.com/klauspost/compress/pull/580)
+
+* May 5, 2022 (v1.15.3)
+ * zstd: Allow to ignore checksum checking by @WojciechMula [#572](https://github.com/klauspost/compress/pull/572)
+ * s2: Fix incorrect seek for io.SeekEnd in [#575](https://github.com/klauspost/compress/pull/575)
+
+* Apr 26, 2022 (v1.15.2)
+ * zstd: Add x86-64 assembly for decompression on streams and blocks. Contributed by [@WojciechMula](https://github.com/WojciechMula). Typically 2x faster. [#528](https://github.com/klauspost/compress/pull/528) [#531](https://github.com/klauspost/compress/pull/531) [#545](https://github.com/klauspost/compress/pull/545) [#537](https://github.com/klauspost/compress/pull/537)
+ * zstd: Add options to ZipDecompressor and fixes [#539](https://github.com/klauspost/compress/pull/539)
+ * s2: Use sorted search for index [#555](https://github.com/klauspost/compress/pull/555)
+ * Minimum version is Go 1.16, added CI test on 1.18.
+
+* Mar 11, 2022 (v1.15.1)
+ * huff0: Add x86 assembly of Decode4X by @WojciechMula in [#512](https://github.com/klauspost/compress/pull/512)
+ * zstd: Reuse zip decoders in [#514](https://github.com/klauspost/compress/pull/514)
+ * zstd: Detect extra block data and report as corrupted in [#520](https://github.com/klauspost/compress/pull/520)
+ * zstd: Handle zero sized frame content size stricter in [#521](https://github.com/klauspost/compress/pull/521)
+ * zstd: Add stricter block size checks in [#523](https://github.com/klauspost/compress/pull/523)
+
+* Mar 3, 2022 (v1.15.0)
+ * zstd: Refactor decoder by @klauspost in [#498](https://github.com/klauspost/compress/pull/498)
+ * zstd: Add stream encoding without goroutines by @klauspost in [#505](https://github.com/klauspost/compress/pull/505)
+ * huff0: Prevent single blocks exceeding 16 bits by @klauspost in[#507](https://github.com/klauspost/compress/pull/507)
+ * flate: Inline literal emission by @klauspost in [#509](https://github.com/klauspost/compress/pull/509)
+ * gzhttp: Add zstd to transport by @klauspost in [#400](https://github.com/klauspost/compress/pull/400)
+ * gzhttp: Make content-type optional by @klauspost in [#510](https://github.com/klauspost/compress/pull/510)
+
+Both compression and decompression now supports "synchronous" stream operations. This means that whenever "concurrency" is set to 1, they will operate without spawning goroutines.
+
+Stream decompression is now faster on asynchronous, since the goroutine allocation much more effectively splits the workload. On typical streams this will typically use 2 cores fully for decompression. When a stream has finished decoding no goroutines will be left over, so decoders can now safely be pooled and still be garbage collected.
+
+While the release has been extensively tested, it is recommended to testing when upgrading.
+
+
+
+
+ See changes to v1.14.x
+
+* Feb 22, 2022 (v1.14.4)
+ * flate: Fix rare huffman only (-2) corruption. [#503](https://github.com/klauspost/compress/pull/503)
+ * zip: Update deprecated CreateHeaderRaw to correctly call CreateRaw by @saracen in [#502](https://github.com/klauspost/compress/pull/502)
+ * zip: don't read data descriptor early by @saracen in [#501](https://github.com/klauspost/compress/pull/501) #501
+ * huff0: Use static decompression buffer up to 30% faster by @klauspost in [#499](https://github.com/klauspost/compress/pull/499) [#500](https://github.com/klauspost/compress/pull/500)
+
+* Feb 17, 2022 (v1.14.3)
+ * flate: Improve fastest levels compression speed ~10% more throughput. [#482](https://github.com/klauspost/compress/pull/482) [#489](https://github.com/klauspost/compress/pull/489) [#490](https://github.com/klauspost/compress/pull/490) [#491](https://github.com/klauspost/compress/pull/491) [#494](https://github.com/klauspost/compress/pull/494) [#478](https://github.com/klauspost/compress/pull/478)
+ * flate: Faster decompression speed, ~5-10%. [#483](https://github.com/klauspost/compress/pull/483)
+ * s2: Faster compression with Go v1.18 and amd64 microarch level 3+. [#484](https://github.com/klauspost/compress/pull/484) [#486](https://github.com/klauspost/compress/pull/486)
+
+* Jan 25, 2022 (v1.14.2)
+ * zstd: improve header decoder by @dsnet [#476](https://github.com/klauspost/compress/pull/476)
+ * zstd: Add bigger default blocks [#469](https://github.com/klauspost/compress/pull/469)
+ * zstd: Remove unused decompression buffer [#470](https://github.com/klauspost/compress/pull/470)
+ * zstd: Fix logically dead code by @ningmingxiao [#472](https://github.com/klauspost/compress/pull/472)
+ * flate: Improve level 7-9 [#471](https://github.com/klauspost/compress/pull/471) [#473](https://github.com/klauspost/compress/pull/473)
+ * zstd: Add noasm tag for xxhash [#475](https://github.com/klauspost/compress/pull/475)
+
+* Jan 11, 2022 (v1.14.1)
+ * s2: Add stream index in [#462](https://github.com/klauspost/compress/pull/462)
+ * flate: Speed and efficiency improvements in [#439](https://github.com/klauspost/compress/pull/439) [#461](https://github.com/klauspost/compress/pull/461) [#455](https://github.com/klauspost/compress/pull/455) [#452](https://github.com/klauspost/compress/pull/452) [#458](https://github.com/klauspost/compress/pull/458)
+ * zstd: Performance improvement in [#420]( https://github.com/klauspost/compress/pull/420) [#456](https://github.com/klauspost/compress/pull/456) [#437](https://github.com/klauspost/compress/pull/437) [#467](https://github.com/klauspost/compress/pull/467) [#468](https://github.com/klauspost/compress/pull/468)
+ * zstd: add arm64 xxhash assembly in [#464](https://github.com/klauspost/compress/pull/464)
+ * Add garbled for binaries for s2 in [#445](https://github.com/klauspost/compress/pull/445)
+
+
+
+ See changes to v1.13.x
+
+* Aug 30, 2021 (v1.13.5)
+ * gz/zlib/flate: Alias stdlib errors [#425](https://github.com/klauspost/compress/pull/425)
+ * s2: Add block support to commandline tools [#413](https://github.com/klauspost/compress/pull/413)
+ * zstd: pooledZipWriter should return Writers to the same pool [#426](https://github.com/klauspost/compress/pull/426)
+ * Removed golang/snappy as external dependency for tests [#421](https://github.com/klauspost/compress/pull/421)
+
+* Aug 12, 2021 (v1.13.4)
+ * Add [snappy replacement package](https://github.com/klauspost/compress/tree/master/snappy).
+ * zstd: Fix incorrect encoding in "best" mode [#415](https://github.com/klauspost/compress/pull/415)
+
+* Aug 3, 2021 (v1.13.3)
+ * zstd: Improve Best compression [#404](https://github.com/klauspost/compress/pull/404)
+ * zstd: Fix WriteTo error forwarding [#411](https://github.com/klauspost/compress/pull/411)
+ * gzhttp: Return http.HandlerFunc instead of http.Handler. Unlikely breaking change. [#406](https://github.com/klauspost/compress/pull/406)
+ * s2sx: Fix max size error [#399](https://github.com/klauspost/compress/pull/399)
+ * zstd: Add optional stream content size on reset [#401](https://github.com/klauspost/compress/pull/401)
+ * zstd: use SpeedBestCompression for level >= 10 [#410](https://github.com/klauspost/compress/pull/410)
+
+* Jun 14, 2021 (v1.13.1)
+ * s2: Add full Snappy output support [#396](https://github.com/klauspost/compress/pull/396)
+ * zstd: Add configurable [Decoder window](https://pkg.go.dev/github.com/klauspost/compress/zstd#WithDecoderMaxWindow) size [#394](https://github.com/klauspost/compress/pull/394)
+ * gzhttp: Add header to skip compression [#389](https://github.com/klauspost/compress/pull/389)
+ * s2: Improve speed with bigger output margin [#395](https://github.com/klauspost/compress/pull/395)
+
+* Jun 3, 2021 (v1.13.0)
+ * Added [gzhttp](https://github.com/klauspost/compress/tree/master/gzhttp#gzip-handler) which allows wrapping HTTP servers and clients with GZIP compressors.
+ * zstd: Detect short invalid signatures [#382](https://github.com/klauspost/compress/pull/382)
+ * zstd: Spawn decoder goroutine only if needed. [#380](https://github.com/klauspost/compress/pull/380)
+
+
+
+
+ See changes to v1.12.x
+
+* May 25, 2021 (v1.12.3)
+ * deflate: Better/faster Huffman encoding [#374](https://github.com/klauspost/compress/pull/374)
+ * deflate: Allocate less for history. [#375](https://github.com/klauspost/compress/pull/375)
+ * zstd: Forward read errors [#373](https://github.com/klauspost/compress/pull/373)
+
+* Apr 27, 2021 (v1.12.2)
+ * zstd: Improve better/best compression [#360](https://github.com/klauspost/compress/pull/360) [#364](https://github.com/klauspost/compress/pull/364) [#365](https://github.com/klauspost/compress/pull/365)
+ * zstd: Add helpers to compress/decompress zstd inside zip files [#363](https://github.com/klauspost/compress/pull/363)
+ * deflate: Improve level 5+6 compression [#367](https://github.com/klauspost/compress/pull/367)
+ * s2: Improve better/best compression [#358](https://github.com/klauspost/compress/pull/358) [#359](https://github.com/klauspost/compress/pull/358)
+ * s2: Load after checking src limit on amd64. [#362](https://github.com/klauspost/compress/pull/362)
+ * s2sx: Limit max executable size [#368](https://github.com/klauspost/compress/pull/368)
+
+* Apr 14, 2021 (v1.12.1)
+ * snappy package removed. Upstream added as dependency.
+ * s2: Better compression in "best" mode [#353](https://github.com/klauspost/compress/pull/353)
+ * s2sx: Add stdin input and detect pre-compressed from signature [#352](https://github.com/klauspost/compress/pull/352)
+ * s2c/s2d: Add http as possible input [#348](https://github.com/klauspost/compress/pull/348)
+ * s2c/s2d/s2sx: Always truncate when writing files [#352](https://github.com/klauspost/compress/pull/352)
+ * zstd: Reduce memory usage further when using [WithLowerEncoderMem](https://pkg.go.dev/github.com/klauspost/compress/zstd#WithLowerEncoderMem) [#346](https://github.com/klauspost/compress/pull/346)
+ * s2: Fix potential problem with amd64 assembly and profilers [#349](https://github.com/klauspost/compress/pull/349)
+
+
+
+ See changes to v1.11.x
+
+* Mar 26, 2021 (v1.11.13)
+ * zstd: Big speedup on small dictionary encodes [#344](https://github.com/klauspost/compress/pull/344) [#345](https://github.com/klauspost/compress/pull/345)
+ * zstd: Add [WithLowerEncoderMem](https://pkg.go.dev/github.com/klauspost/compress/zstd#WithLowerEncoderMem) encoder option [#336](https://github.com/klauspost/compress/pull/336)
+ * deflate: Improve entropy compression [#338](https://github.com/klauspost/compress/pull/338)
+ * s2: Clean up and minor performance improvement in best [#341](https://github.com/klauspost/compress/pull/341)
+
+* Mar 5, 2021 (v1.11.12)
+ * s2: Add `s2sx` binary that creates [self extracting archives](https://github.com/klauspost/compress/tree/master/s2#s2sx-self-extracting-archives).
+ * s2: Speed up decompression on non-assembly platforms [#328](https://github.com/klauspost/compress/pull/328)
+
+* Mar 1, 2021 (v1.11.9)
+ * s2: Add ARM64 decompression assembly. Around 2x output speed. [#324](https://github.com/klauspost/compress/pull/324)
+ * s2: Improve "better" speed and efficiency. [#325](https://github.com/klauspost/compress/pull/325)
+ * s2: Fix binaries.
+
+* Feb 25, 2021 (v1.11.8)
+ * s2: Fixed occasional out-of-bounds write on amd64. Upgrade recommended.
+ * s2: Add AMD64 assembly for better mode. 25-50% faster. [#315](https://github.com/klauspost/compress/pull/315)
+ * s2: Less upfront decoder allocation. [#322](https://github.com/klauspost/compress/pull/322)
+ * zstd: Faster "compression" of incompressible data. [#314](https://github.com/klauspost/compress/pull/314)
+ * zip: Fix zip64 headers. [#313](https://github.com/klauspost/compress/pull/313)
+
+* Jan 14, 2021 (v1.11.7)
+ * Use Bytes() interface to get bytes across packages. [#309](https://github.com/klauspost/compress/pull/309)
+ * s2: Add 'best' compression option. [#310](https://github.com/klauspost/compress/pull/310)
+ * s2: Add ReaderMaxBlockSize, changes `s2.NewReader` signature to include varargs. [#311](https://github.com/klauspost/compress/pull/311)
+ * s2: Fix crash on small better buffers. [#308](https://github.com/klauspost/compress/pull/308)
+ * s2: Clean up decoder. [#312](https://github.com/klauspost/compress/pull/312)
+
+* Jan 7, 2021 (v1.11.6)
+ * zstd: Make decoder allocations smaller [#306](https://github.com/klauspost/compress/pull/306)
+ * zstd: Free Decoder resources when Reset is called with a nil io.Reader [#305](https://github.com/klauspost/compress/pull/305)
+
+* Dec 20, 2020 (v1.11.4)
+ * zstd: Add Best compression mode [#304](https://github.com/klauspost/compress/pull/304)
+ * Add header decoder [#299](https://github.com/klauspost/compress/pull/299)
+ * s2: Add uncompressed stream option [#297](https://github.com/klauspost/compress/pull/297)
+ * Simplify/speed up small blocks with known max size. [#300](https://github.com/klauspost/compress/pull/300)
+ * zstd: Always reset literal dict encoder [#303](https://github.com/klauspost/compress/pull/303)
+
+* Nov 15, 2020 (v1.11.3)
+ * inflate: 10-15% faster decompression [#293](https://github.com/klauspost/compress/pull/293)
+ * zstd: Tweak DecodeAll default allocation [#295](https://github.com/klauspost/compress/pull/295)
+
+* Oct 11, 2020 (v1.11.2)
+ * s2: Fix out of bounds read in "better" block compression [#291](https://github.com/klauspost/compress/pull/291)
+
+* Oct 1, 2020 (v1.11.1)
+ * zstd: Set allLitEntropy true in default configuration [#286](https://github.com/klauspost/compress/pull/286)
+
+* Sept 8, 2020 (v1.11.0)
+ * zstd: Add experimental compression [dictionaries](https://github.com/klauspost/compress/tree/master/zstd#dictionaries) [#281](https://github.com/klauspost/compress/pull/281)
+ * zstd: Fix mixed Write and ReadFrom calls [#282](https://github.com/klauspost/compress/pull/282)
+ * inflate/gz: Limit variable shifts, ~5% faster decompression [#274](https://github.com/klauspost/compress/pull/274)
+
+
+
+ See changes to v1.10.x
+
+* July 8, 2020 (v1.10.11)
+ * zstd: Fix extra block when compressing with ReadFrom. [#278](https://github.com/klauspost/compress/pull/278)
+ * huff0: Also populate compression table when reading decoding table. [#275](https://github.com/klauspost/compress/pull/275)
+
+* June 23, 2020 (v1.10.10)
+ * zstd: Skip entropy compression in fastest mode when no matches. [#270](https://github.com/klauspost/compress/pull/270)
+
+* June 16, 2020 (v1.10.9):
+ * zstd: API change for specifying dictionaries. See [#268](https://github.com/klauspost/compress/pull/268)
+ * zip: update CreateHeaderRaw to handle zip64 fields. [#266](https://github.com/klauspost/compress/pull/266)
+ * Fuzzit tests removed. The service has been purchased and is no longer available.
+
+* June 5, 2020 (v1.10.8):
+ * 1.15x faster zstd block decompression. [#265](https://github.com/klauspost/compress/pull/265)
+
+* June 1, 2020 (v1.10.7):
+ * Added zstd decompression [dictionary support](https://github.com/klauspost/compress/tree/master/zstd#dictionaries)
+ * Increase zstd decompression speed up to 1.19x. [#259](https://github.com/klauspost/compress/pull/259)
+ * Remove internal reset call in zstd compression and reduce allocations. [#263](https://github.com/klauspost/compress/pull/263)
+
+* May 21, 2020: (v1.10.6)
+ * zstd: Reduce allocations while decoding. [#258](https://github.com/klauspost/compress/pull/258), [#252](https://github.com/klauspost/compress/pull/252)
+ * zstd: Stricter decompression checks.
+
+* April 12, 2020: (v1.10.5)
+ * s2-commands: Flush output when receiving SIGINT. [#239](https://github.com/klauspost/compress/pull/239)
+
+* Apr 8, 2020: (v1.10.4)
+ * zstd: Minor/special case optimizations. [#251](https://github.com/klauspost/compress/pull/251), [#250](https://github.com/klauspost/compress/pull/250), [#249](https://github.com/klauspost/compress/pull/249), [#247](https://github.com/klauspost/compress/pull/247)
+* Mar 11, 2020: (v1.10.3)
+ * s2: Use S2 encoder in pure Go mode for Snappy output as well. [#245](https://github.com/klauspost/compress/pull/245)
+ * s2: Fix pure Go block encoder. [#244](https://github.com/klauspost/compress/pull/244)
+ * zstd: Added "better compression" mode. [#240](https://github.com/klauspost/compress/pull/240)
+ * zstd: Improve speed of fastest compression mode by 5-10% [#241](https://github.com/klauspost/compress/pull/241)
+ * zstd: Skip creating encoders when not needed. [#238](https://github.com/klauspost/compress/pull/238)
+
+* Feb 27, 2020: (v1.10.2)
+ * Close to 50% speedup in inflate (gzip/zip decompression). [#236](https://github.com/klauspost/compress/pull/236) [#234](https://github.com/klauspost/compress/pull/234) [#232](https://github.com/klauspost/compress/pull/232)
+ * Reduce deflate level 1-6 memory usage up to 59%. [#227](https://github.com/klauspost/compress/pull/227)
+
+* Feb 18, 2020: (v1.10.1)
+ * Fix zstd crash when resetting multiple times without sending data. [#226](https://github.com/klauspost/compress/pull/226)
+ * deflate: Fix dictionary use on level 1-6. [#224](https://github.com/klauspost/compress/pull/224)
+ * Remove deflate writer reference when closing. [#224](https://github.com/klauspost/compress/pull/224)
+
+* Feb 4, 2020: (v1.10.0)
+ * Add optional dictionary to [stateless deflate](https://pkg.go.dev/github.com/klauspost/compress/flate?tab=doc#StatelessDeflate). Breaking change, send `nil` for previous behaviour. [#216](https://github.com/klauspost/compress/pull/216)
+ * Fix buffer overflow on repeated small block deflate. [#218](https://github.com/klauspost/compress/pull/218)
+ * Allow copying content from an existing ZIP file without decompressing+compressing. [#214](https://github.com/klauspost/compress/pull/214)
+ * Added [S2](https://github.com/klauspost/compress/tree/master/s2#s2-compression) AMD64 assembler and various optimizations. Stream speed >10GB/s. [#186](https://github.com/klauspost/compress/pull/186)
+
+
+
+
+ See changes prior to v1.10.0
+
+* Jan 20,2020 (v1.9.8) Optimize gzip/deflate with better size estimates and faster table generation. [#207](https://github.com/klauspost/compress/pull/207) by [luyu6056](https://github.com/luyu6056), [#206](https://github.com/klauspost/compress/pull/206).
+* Jan 11, 2020: S2 Encode/Decode will use provided buffer if capacity is big enough. [#204](https://github.com/klauspost/compress/pull/204)
+* Jan 5, 2020: (v1.9.7) Fix another zstd regression in v1.9.5 - v1.9.6 removed.
+* Jan 4, 2020: (v1.9.6) Regression in v1.9.5 fixed causing corrupt zstd encodes in rare cases.
+* Jan 4, 2020: Faster IO in [s2c + s2d commandline tools](https://github.com/klauspost/compress/tree/master/s2#commandline-tools) compression/decompression. [#192](https://github.com/klauspost/compress/pull/192)
+* Dec 29, 2019: Removed v1.9.5 since fuzz tests showed a compatibility problem with the reference zstandard decoder.
+* Dec 29, 2019: (v1.9.5) zstd: 10-20% faster block compression. [#199](https://github.com/klauspost/compress/pull/199)
+* Dec 29, 2019: [zip](https://godoc.org/github.com/klauspost/compress/zip) package updated with latest Go features
+* Dec 29, 2019: zstd: Single segment flag condintions tweaked. [#197](https://github.com/klauspost/compress/pull/197)
+* Dec 18, 2019: s2: Faster compression when ReadFrom is used. [#198](https://github.com/klauspost/compress/pull/198)
+* Dec 10, 2019: s2: Fix repeat length output when just above at 16MB limit.
+* Dec 10, 2019: zstd: Add function to get decoder as io.ReadCloser. [#191](https://github.com/klauspost/compress/pull/191)
+* Dec 3, 2019: (v1.9.4) S2: limit max repeat length. [#188](https://github.com/klauspost/compress/pull/188)
+* Dec 3, 2019: Add [WithNoEntropyCompression](https://godoc.org/github.com/klauspost/compress/zstd#WithNoEntropyCompression) to zstd [#187](https://github.com/klauspost/compress/pull/187)
+* Dec 3, 2019: Reduce memory use for tests. Check for leaked goroutines.
+* Nov 28, 2019 (v1.9.3) Less allocations in stateless deflate.
+* Nov 28, 2019: 5-20% Faster huff0 decode. Impacts zstd as well. [#184](https://github.com/klauspost/compress/pull/184)
+* Nov 12, 2019 (v1.9.2) Added [Stateless Compression](#stateless-compression) for gzip/deflate.
+* Nov 12, 2019: Fixed zstd decompression of large single blocks. [#180](https://github.com/klauspost/compress/pull/180)
+* Nov 11, 2019: Set default [s2c](https://github.com/klauspost/compress/tree/master/s2#commandline-tools) block size to 4MB.
+* Nov 11, 2019: Reduce inflate memory use by 1KB.
+* Nov 10, 2019: Less allocations in deflate bit writer.
+* Nov 10, 2019: Fix inconsistent error returned by zstd decoder.
+* Oct 28, 2019 (v1.9.1) ztsd: Fix crash when compressing blocks. [#174](https://github.com/klauspost/compress/pull/174)
+* Oct 24, 2019 (v1.9.0) zstd: Fix rare data corruption [#173](https://github.com/klauspost/compress/pull/173)
+* Oct 24, 2019 zstd: Fix huff0 out of buffer write [#171](https://github.com/klauspost/compress/pull/171) and always return errors [#172](https://github.com/klauspost/compress/pull/172)
+* Oct 10, 2019: Big deflate rewrite, 30-40% faster with better compression [#105](https://github.com/klauspost/compress/pull/105)
+
+
+
+
+ See changes prior to v1.9.0
+
+* Oct 10, 2019: (v1.8.6) zstd: Allow partial reads to get flushed data. [#169](https://github.com/klauspost/compress/pull/169)
+* Oct 3, 2019: Fix inconsistent results on broken zstd streams.
+* Sep 25, 2019: Added `-rm` (remove source files) and `-q` (no output except errors) to `s2c` and `s2d` [commands](https://github.com/klauspost/compress/tree/master/s2#commandline-tools)
+* Sep 16, 2019: (v1.8.4) Add `s2c` and `s2d` [commandline tools](https://github.com/klauspost/compress/tree/master/s2#commandline-tools).
+* Sep 10, 2019: (v1.8.3) Fix s2 decoder [Skip](https://godoc.org/github.com/klauspost/compress/s2#Reader.Skip).
+* Sep 7, 2019: zstd: Added [WithWindowSize](https://godoc.org/github.com/klauspost/compress/zstd#WithWindowSize), contributed by [ianwilkes](https://github.com/ianwilkes).
+* Sep 5, 2019: (v1.8.2) Add [WithZeroFrames](https://godoc.org/github.com/klauspost/compress/zstd#WithZeroFrames) which adds full zero payload block encoding option.
+* Sep 5, 2019: Lazy initialization of zstandard predefined en/decoder tables.
+* Aug 26, 2019: (v1.8.1) S2: 1-2% compression increase in "better" compression mode.
+* Aug 26, 2019: zstd: Check maximum size of Huffman 1X compressed literals while decoding.
+* Aug 24, 2019: (v1.8.0) Added [S2 compression](https://github.com/klauspost/compress/tree/master/s2#s2-compression), a high performance replacement for Snappy.
+* Aug 21, 2019: (v1.7.6) Fixed minor issues found by fuzzer. One could lead to zstd not decompressing.
+* Aug 18, 2019: Add [fuzzit](https://fuzzit.dev/) continuous fuzzing.
+* Aug 14, 2019: zstd: Skip incompressible data 2x faster. [#147](https://github.com/klauspost/compress/pull/147)
+* Aug 4, 2019 (v1.7.5): Better literal compression. [#146](https://github.com/klauspost/compress/pull/146)
+* Aug 4, 2019: Faster zstd compression. [#143](https://github.com/klauspost/compress/pull/143) [#144](https://github.com/klauspost/compress/pull/144)
+* Aug 4, 2019: Faster zstd decompression. [#145](https://github.com/klauspost/compress/pull/145) [#143](https://github.com/klauspost/compress/pull/143) [#142](https://github.com/klauspost/compress/pull/142)
+* July 15, 2019 (v1.7.4): Fix double EOF block in rare cases on zstd encoder.
+* July 15, 2019 (v1.7.3): Minor speedup/compression increase in default zstd encoder.
+* July 14, 2019: zstd decoder: Fix decompression error on multiple uses with mixed content.
+* July 7, 2019 (v1.7.2): Snappy update, zstd decoder potential race fix.
+* June 17, 2019: zstd decompression bugfix.
+* June 17, 2019: fix 32 bit builds.
+* June 17, 2019: Easier use in modules (less dependencies).
+* June 9, 2019: New stronger "default" [zstd](https://github.com/klauspost/compress/tree/master/zstd#zstd) compression mode. Matches zstd default compression ratio.
+* June 5, 2019: 20-40% throughput in [zstandard](https://github.com/klauspost/compress/tree/master/zstd#zstd) compression and better compression.
+* June 5, 2019: deflate/gzip compression: Reduce memory usage of lower compression levels.
+* June 2, 2019: Added [zstandard](https://github.com/klauspost/compress/tree/master/zstd#zstd) compression!
+* May 25, 2019: deflate/gzip: 10% faster bit writer, mostly visible in lower levels.
+* Apr 22, 2019: [zstd](https://github.com/klauspost/compress/tree/master/zstd#zstd) decompression added.
+* Aug 1, 2018: Added [huff0 README](https://github.com/klauspost/compress/tree/master/huff0#huff0-entropy-compression).
+* Jul 8, 2018: Added [Performance Update 2018](#performance-update-2018) below.
+* Jun 23, 2018: Merged [Go 1.11 inflate optimizations](https://go-review.googlesource.com/c/go/+/102235). Go 1.9 is now required. Backwards compatible version tagged with [v1.3.0](https://github.com/klauspost/compress/releases/tag/v1.3.0).
+* Apr 2, 2018: Added [huff0](https://godoc.org/github.com/klauspost/compress/huff0) en/decoder. Experimental for now, API may change.
+* Mar 4, 2018: Added [FSE Entropy](https://godoc.org/github.com/klauspost/compress/fse) en/decoder. Experimental for now, API may change.
+* Nov 3, 2017: Add compression [Estimate](https://godoc.org/github.com/klauspost/compress#Estimate) function.
+* May 28, 2017: Reduce allocations when resetting decoder.
+* Apr 02, 2017: Change back to official crc32, since changes were merged in Go 1.7.
+* Jan 14, 2017: Reduce stack pressure due to array copies. See [Issue #18625](https://github.com/golang/go/issues/18625).
+* Oct 25, 2016: Level 2-4 have been rewritten and now offers significantly better performance than before.
+* Oct 20, 2016: Port zlib changes from Go 1.7 to fix zlib writer issue. Please update.
+* Oct 16, 2016: Go 1.7 changes merged. Apples to apples this package is a few percent faster, but has a significantly better balance between speed and compression per level.
+* Mar 24, 2016: Always attempt Huffman encoding on level 4-7. This improves base 64 encoded data compression.
+* Mar 24, 2016: Small speedup for level 1-3.
+* Feb 19, 2016: Faster bit writer, level -2 is 15% faster, level 1 is 4% faster.
+* Feb 19, 2016: Handle small payloads faster in level 1-3.
+* Feb 19, 2016: Added faster level 2 + 3 compression modes.
+* Feb 19, 2016: [Rebalanced compression levels](https://blog.klauspost.com/rebalancing-deflate-compression-levels/), so there is a more even progression in terms of compression. New default level is 5.
+* Feb 14, 2016: Snappy: Merge upstream changes.
+* Feb 14, 2016: Snappy: Fix aggressive skipping.
+* Feb 14, 2016: Snappy: Update benchmark.
+* Feb 13, 2016: Deflate: Fixed assembler problem that could lead to sub-optimal compression.
+* Feb 12, 2016: Snappy: Added AMD64 SSE 4.2 optimizations to matching, which makes easy to compress material run faster. Typical speedup is around 25%.
+* Feb 9, 2016: Added Snappy package fork. This version is 5-7% faster, much more on hard to compress content.
+* Jan 30, 2016: Optimize level 1 to 3 by not considering static dictionary or storing uncompressed. ~4-5% speedup.
+* Jan 16, 2016: Optimization on deflate level 1,2,3 compression.
+* Jan 8 2016: Merge [CL 18317](https://go-review.googlesource.com/#/c/18317): fix reading, writing of zip64 archives.
+* Dec 8 2015: Make level 1 and -2 deterministic even if write size differs.
+* Dec 8 2015: Split encoding functions, so hashing and matching can potentially be inlined. 1-3% faster on AMD64. 5% faster on other platforms.
+* Dec 8 2015: Fixed rare [one byte out-of bounds read](https://github.com/klauspost/compress/issues/20). Please update!
+* Nov 23 2015: Optimization on token writer. ~2-4% faster. Contributed by [@dsnet](https://github.com/dsnet).
+* Nov 20 2015: Small optimization to bit writer on 64 bit systems.
+* Nov 17 2015: Fixed out-of-bound errors if the underlying Writer returned an error. See [#15](https://github.com/klauspost/compress/issues/15).
+* Nov 12 2015: Added [io.WriterTo](https://golang.org/pkg/io/#WriterTo) support to gzip/inflate.
+* Nov 11 2015: Merged [CL 16669](https://go-review.googlesource.com/#/c/16669/4): archive/zip: enable overriding (de)compressors per file
+* Oct 15 2015: Added skipping on uncompressible data. Random data speed up >5x.
+
+
+
+# deflate usage
+
+The packages are drop-in replacements for standard libraries. Simply replace the import path to use them:
+
+| old import | new import | Documentation
+|--------------------|-----------------------------------------|--------------------|
+| `compress/gzip` | `github.com/klauspost/compress/gzip` | [gzip](https://pkg.go.dev/github.com/klauspost/compress/gzip?tab=doc)
+| `compress/zlib` | `github.com/klauspost/compress/zlib` | [zlib](https://pkg.go.dev/github.com/klauspost/compress/zlib?tab=doc)
+| `archive/zip` | `github.com/klauspost/compress/zip` | [zip](https://pkg.go.dev/github.com/klauspost/compress/zip?tab=doc)
+| `compress/flate` | `github.com/klauspost/compress/flate` | [flate](https://pkg.go.dev/github.com/klauspost/compress/flate?tab=doc)
+
+* Optimized [deflate](https://godoc.org/github.com/klauspost/compress/flate) packages which can be used as a dropin replacement for [gzip](https://godoc.org/github.com/klauspost/compress/gzip), [zip](https://godoc.org/github.com/klauspost/compress/zip) and [zlib](https://godoc.org/github.com/klauspost/compress/zlib).
+
+You may also be interested in [pgzip](https://github.com/klauspost/pgzip), which is a drop in replacement for gzip, which support multithreaded compression on big files and the optimized [crc32](https://github.com/klauspost/crc32) package used by these packages.
+
+The packages contains the same as the standard library, so you can use the godoc for that: [gzip](http://golang.org/pkg/compress/gzip/), [zip](http://golang.org/pkg/archive/zip/), [zlib](http://golang.org/pkg/compress/zlib/), [flate](http://golang.org/pkg/compress/flate/).
+
+Currently there is only minor speedup on decompression (mostly CRC32 calculation).
+
+Memory usage is typically 1MB for a Writer. stdlib is in the same range.
+If you expect to have a lot of concurrently allocated Writers consider using
+the stateless compress described below.
+
+For compression performance, see: [this spreadsheet](https://docs.google.com/spreadsheets/d/1nuNE2nPfuINCZJRMt6wFWhKpToF95I47XjSsc-1rbPQ/edit?usp=sharing).
+
+To disable all assembly add `-tags=noasm`. This works across all packages.
+
+# Stateless compression
+
+This package offers stateless compression as a special option for gzip/deflate.
+It will do compression but without maintaining any state between Write calls.
+
+This means there will be no memory kept between Write calls, but compression and speed will be suboptimal.
+
+This is only relevant in cases where you expect to run many thousands of compressors concurrently,
+but with very little activity. This is *not* intended for regular web servers serving individual requests.
+
+Because of this, the size of actual Write calls will affect output size.
+
+In gzip, specify level `-3` / `gzip.StatelessCompression` to enable.
+
+For direct deflate use, NewStatelessWriter and StatelessDeflate are available. See [documentation](https://godoc.org/github.com/klauspost/compress/flate#NewStatelessWriter)
+
+A `bufio.Writer` can of course be used to control write sizes. For example, to use a 4KB buffer:
+
+```go
+ // replace 'ioutil.Discard' with your output.
+ gzw, err := gzip.NewWriterLevel(ioutil.Discard, gzip.StatelessCompression)
+ if err != nil {
+ return err
+ }
+ defer gzw.Close()
+
+ w := bufio.NewWriterSize(gzw, 4096)
+ defer w.Flush()
+
+ // Write to 'w'
+```
+
+This will only use up to 4KB in memory when the writer is idle.
+
+Compression is almost always worse than the fastest compression level
+and each write will allocate (a little) memory.
+
+# Performance Update 2018
+
+It has been a while since we have been looking at the speed of this package compared to the standard library, so I thought I would re-do my tests and give some overall recommendations based on the current state. All benchmarks have been performed with Go 1.10 on my Desktop Intel(R) Core(TM) i7-2600 CPU @3.40GHz. Since I last ran the tests, I have gotten more RAM, which means tests with big files are no longer limited by my SSD.
+
+The raw results are in my [updated spreadsheet](https://docs.google.com/spreadsheets/d/1nuNE2nPfuINCZJRMt6wFWhKpToF95I47XjSsc-1rbPQ/edit?usp=sharing). Due to cgo changes and upstream updates i could not get the cgo version of gzip to compile. Instead I included the [zstd](https://github.com/datadog/zstd) cgo implementation. If I get cgo gzip to work again, I might replace the results in the sheet.
+
+The columns to take note of are: *MB/s* - the throughput. *Reduction* - the data size reduction in percent of the original. *Rel Speed* relative speed compared to the standard library at the same level. *Smaller* - how many percent smaller is the compressed output compared to stdlib. Negative means the output was bigger. *Loss* means the loss (or gain) in compression as a percentage difference of the input.
+
+The `gzstd` (standard library gzip) and `gzkp` (this package gzip) only uses one CPU core. [`pgzip`](https://github.com/klauspost/pgzip), [`bgzf`](https://github.com/biogo/hts/tree/master/bgzf) uses all 4 cores. [`zstd`](https://github.com/DataDog/zstd) uses one core, and is a beast (but not Go, yet).
+
+
+## Overall differences.
+
+There appears to be a roughly 5-10% speed advantage over the standard library when comparing at similar compression levels.
+
+The biggest difference you will see is the result of [re-balancing](https://blog.klauspost.com/rebalancing-deflate-compression-levels/) the compression levels. I wanted by library to give a smoother transition between the compression levels than the standard library.
+
+This package attempts to provide a more smooth transition, where "1" is taking a lot of shortcuts, "5" is the reasonable trade-off and "9" is the "give me the best compression", and the values in between gives something reasonable in between. The standard library has big differences in levels 1-4, but levels 5-9 having no significant gains - often spending a lot more time than can be justified by the achieved compression.
+
+There are links to all the test data in the [spreadsheet](https://docs.google.com/spreadsheets/d/1nuNE2nPfuINCZJRMt6wFWhKpToF95I47XjSsc-1rbPQ/edit?usp=sharing) in the top left field on each tab.
+
+## Web Content
+
+This test set aims to emulate typical use in a web server. The test-set is 4GB data in 53k files, and is a mixture of (mostly) HTML, JS, CSS.
+
+Since level 1 and 9 are close to being the same code, they are quite close. But looking at the levels in-between the differences are quite big.
+
+Looking at level 6, this package is 88% faster, but will output about 6% more data. For a web server, this means you can serve 88% more data, but have to pay for 6% more bandwidth. You can draw your own conclusions on what would be the most expensive for your case.
+
+## Object files
+
+This test is for typical data files stored on a server. In this case it is a collection of Go precompiled objects. They are very compressible.
+
+The picture is similar to the web content, but with small differences since this is very compressible. Levels 2-3 offer good speed, but is sacrificing quite a bit of compression.
+
+The standard library seems suboptimal on level 3 and 4 - offering both worse compression and speed than level 6 & 7 of this package respectively.
+
+## Highly Compressible File
+
+This is a JSON file with very high redundancy. The reduction starts at 95% on level 1, so in real life terms we are dealing with something like a highly redundant stream of data, etc.
+
+It is definitely visible that we are dealing with specialized content here, so the results are very scattered. This package does not do very well at levels 1-4, but picks up significantly at level 5 and levels 7 and 8 offering great speed for the achieved compression.
+
+So if you know you content is extremely compressible you might want to go slightly higher than the defaults. The standard library has a huge gap between levels 3 and 4 in terms of speed (2.75x slowdown), so it offers little "middle ground".
+
+## Medium-High Compressible
+
+This is a pretty common test corpus: [enwik9](http://mattmahoney.net/dc/textdata.html). It contains the first 10^9 bytes of the English Wikipedia dump on Mar. 3, 2006. This is a very good test of typical text based compression and more data heavy streams.
+
+We see a similar picture here as in "Web Content". On equal levels some compression is sacrificed for more speed. Level 5 seems to be the best trade-off between speed and size, beating stdlib level 3 in both.
+
+## Medium Compressible
+
+I will combine two test sets, one [10GB file set](http://mattmahoney.net/dc/10gb.html) and a VM disk image (~8GB). Both contain different data types and represent a typical backup scenario.
+
+The most notable thing is how quickly the standard library drops to very low compression speeds around level 5-6 without any big gains in compression. Since this type of data is fairly common, this does not seem like good behavior.
+
+
+## Un-compressible Content
+
+This is mainly a test of how good the algorithms are at detecting un-compressible input. The standard library only offers this feature with very conservative settings at level 1. Obviously there is no reason for the algorithms to try to compress input that cannot be compressed. The only downside is that it might skip some compressible data on false detections.
+
+
+## Huffman only compression
+
+This compression library adds a special compression level, named `HuffmanOnly`, which allows near linear time compression. This is done by completely disabling matching of previous data, and only reduce the number of bits to represent each character.
+
+This means that often used characters, like 'e' and ' ' (space) in text use the fewest bits to represent, and rare characters like '¤' takes more bits to represent. For more information see [wikipedia](https://en.wikipedia.org/wiki/Huffman_coding) or this nice [video](https://youtu.be/ZdooBTdW5bM).
+
+Since this type of compression has much less variance, the compression speed is mostly unaffected by the input data, and is usually more than *180MB/s* for a single core.
+
+The downside is that the compression ratio is usually considerably worse than even the fastest conventional compression. The compression ratio can never be better than 8:1 (12.5%).
+
+The linear time compression can be used as a "better than nothing" mode, where you cannot risk the encoder to slow down on some content. For comparison, the size of the "Twain" text is *233460 bytes* (+29% vs. level 1) and encode speed is 144MB/s (4.5x level 1). So in this case you trade a 30% size increase for a 4 times speedup.
+
+For more information see my blog post on [Fast Linear Time Compression](http://blog.klauspost.com/constant-time-gzipzip-compression/).
+
+This is implemented on Go 1.7 as "Huffman Only" mode, though not exposed for gzip.
+
+# Other packages
+
+Here are other packages of good quality and pure Go (no cgo wrappers or autoconverted code):
+
+* [github.com/pierrec/lz4](https://github.com/pierrec/lz4) - strong multithreaded LZ4 compression.
+* [github.com/cosnicolaou/pbzip2](https://github.com/cosnicolaou/pbzip2) - multithreaded bzip2 decompression.
+* [github.com/dsnet/compress](https://github.com/dsnet/compress) - brotli decompression, bzip2 writer.
+* [github.com/ronanh/intcomp](https://github.com/ronanh/intcomp) - Integer compression.
+* [github.com/spenczar/fpc](https://github.com/spenczar/fpc) - Float compression.
+* [github.com/minio/zipindex](https://github.com/minio/zipindex) - External ZIP directory index.
+* [github.com/ybirader/pzip](https://github.com/ybirader/pzip) - Fast concurrent zip archiver and extractor.
+
+# license
+
+This code is licensed under the same conditions as the original Go code. See LICENSE file.
diff --git a/vendor/github.com/klauspost/compress/SECURITY.md b/vendor/github.com/klauspost/compress/SECURITY.md
new file mode 100644
index 00000000..ca6685e2
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/SECURITY.md
@@ -0,0 +1,25 @@
+# Security Policy
+
+## Supported Versions
+
+Security updates are applied only to the latest release.
+
+## Vulnerability Definition
+
+A security vulnerability is a bug that with certain input triggers a crash or an infinite loop. Most calls will have varying execution time and only in rare cases will slow operation be considered a security vulnerability.
+
+Corrupted output generally is not considered a security vulnerability, unless independent operations are able to affect each other. Note that not all functionality is re-entrant and safe to use concurrently.
+
+Out-of-memory crashes only applies if the en/decoder uses an abnormal amount of memory, with appropriate options applied, to limit maximum window size, concurrency, etc. However, if you are in doubt you are welcome to file a security issue.
+
+It is assumed that all callers are trusted, meaning internal data exposed through reflection or inspection of returned data structures is not considered a vulnerability.
+
+Vulnerabilities resulting from compiler/assembler errors should be reported upstream. Depending on the severity this package may or may not implement a workaround.
+
+## Reporting a Vulnerability
+
+If you have discovered a security vulnerability in this project, please report it privately. **Do not disclose it as a public issue.** This gives us time to work with you to fix the issue before public exposure, reducing the chance that the exploit will be used before a patch is released.
+
+Please disclose it at [security advisory](https://github.com/klauspost/compress/security/advisories/new). If possible please provide a minimal reproducer. If the issue only applies to a single platform, it would be helpful to provide access to that.
+
+This project is maintained by a team of volunteers on a reasonable-effort basis. As such, vulnerabilities will be disclosed in a best effort base.
diff --git a/vendor/github.com/klauspost/compress/compressible.go b/vendor/github.com/klauspost/compress/compressible.go
new file mode 100644
index 00000000..ea5a692d
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/compressible.go
@@ -0,0 +1,85 @@
+package compress
+
+import "math"
+
+// Estimate returns a normalized compressibility estimate of block b.
+// Values close to zero are likely uncompressible.
+// Values above 0.1 are likely to be compressible.
+// Values above 0.5 are very compressible.
+// Very small lengths will return 0.
+func Estimate(b []byte) float64 {
+ if len(b) < 16 {
+ return 0
+ }
+
+ // Correctly predicted order 1
+ hits := 0
+ lastMatch := false
+ var o1 [256]byte
+ var hist [256]int
+ c1 := byte(0)
+ for _, c := range b {
+ if c == o1[c1] {
+ // We only count a hit if there was two correct predictions in a row.
+ if lastMatch {
+ hits++
+ }
+ lastMatch = true
+ } else {
+ lastMatch = false
+ }
+ o1[c1] = c
+ c1 = c
+ hist[c]++
+ }
+
+ // Use x^0.6 to give better spread
+ prediction := math.Pow(float64(hits)/float64(len(b)), 0.6)
+
+ // Calculate histogram distribution
+ variance := float64(0)
+ avg := float64(len(b)) / 256
+
+ for _, v := range hist {
+ Δ := float64(v) - avg
+ variance += Δ * Δ
+ }
+
+ stddev := math.Sqrt(float64(variance)) / float64(len(b))
+ exp := math.Sqrt(1 / float64(len(b)))
+
+ // Subtract expected stddev
+ stddev -= exp
+ if stddev < 0 {
+ stddev = 0
+ }
+ stddev *= 1 + exp
+
+ // Use x^0.4 to give better spread
+ entropy := math.Pow(stddev, 0.4)
+
+ // 50/50 weight between prediction and histogram distribution
+ return math.Pow((prediction+entropy)/2, 0.9)
+}
+
+// ShannonEntropyBits returns the number of bits minimum required to represent
+// an entropy encoding of the input bytes.
+// https://en.wiktionary.org/wiki/Shannon_entropy
+func ShannonEntropyBits(b []byte) int {
+ if len(b) == 0 {
+ return 0
+ }
+ var hist [256]int
+ for _, c := range b {
+ hist[c]++
+ }
+ shannon := float64(0)
+ invTotal := 1.0 / float64(len(b))
+ for _, v := range hist[:] {
+ if v > 0 {
+ n := float64(v)
+ shannon += math.Ceil(-math.Log2(n*invTotal) * n)
+ }
+ }
+ return int(math.Ceil(shannon))
+}
diff --git a/vendor/github.com/klauspost/compress/fse/README.md b/vendor/github.com/klauspost/compress/fse/README.md
new file mode 100644
index 00000000..ea7324da
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/fse/README.md
@@ -0,0 +1,79 @@
+# Finite State Entropy
+
+This package provides Finite State Entropy encoding and decoding.
+
+Finite State Entropy (also referenced as [tANS](https://en.wikipedia.org/wiki/Asymmetric_numeral_systems#tANS))
+encoding provides a fast near-optimal symbol encoding/decoding
+for byte blocks as implemented in [zstandard](https://github.com/facebook/zstd).
+
+This can be used for compressing input with a lot of similar input values to the smallest number of bytes.
+This does not perform any multi-byte [dictionary coding](https://en.wikipedia.org/wiki/Dictionary_coder) as LZ coders,
+but it can be used as a secondary step to compressors (like Snappy) that does not do entropy encoding.
+
+* [Godoc documentation](https://godoc.org/github.com/klauspost/compress/fse)
+
+## News
+
+ * Feb 2018: First implementation released. Consider this beta software for now.
+
+# Usage
+
+This package provides a low level interface that allows to compress single independent blocks.
+
+Each block is separate, and there is no built in integrity checks.
+This means that the caller should keep track of block sizes and also do checksums if needed.
+
+Compressing a block is done via the [`Compress`](https://godoc.org/github.com/klauspost/compress/fse#Compress) function.
+You must provide input and will receive the output and maybe an error.
+
+These error values can be returned:
+
+| Error | Description |
+|---------------------|-----------------------------------------------------------------------------|
+| `` | Everything ok, output is returned |
+| `ErrIncompressible` | Returned when input is judged to be too hard to compress |
+| `ErrUseRLE` | Returned from the compressor when the input is a single byte value repeated |
+| `(error)` | An internal error occurred. |
+
+As can be seen above there are errors that will be returned even under normal operation so it is important to handle these.
+
+To reduce allocations you can provide a [`Scratch`](https://godoc.org/github.com/klauspost/compress/fse#Scratch) object
+that can be re-used for successive calls. Both compression and decompression accepts a `Scratch` object, and the same
+object can be used for both.
+
+Be aware, that when re-using a `Scratch` object that the *output* buffer is also re-used, so if you are still using this
+you must set the `Out` field in the scratch to nil. The same buffer is used for compression and decompression output.
+
+Decompressing is done by calling the [`Decompress`](https://godoc.org/github.com/klauspost/compress/fse#Decompress) function.
+You must provide the output from the compression stage, at exactly the size you got back. If you receive an error back
+your input was likely corrupted.
+
+It is important to note that a successful decoding does *not* mean your output matches your original input.
+There are no integrity checks, so relying on errors from the decompressor does not assure your data is valid.
+
+For more detailed usage, see examples in the [godoc documentation](https://godoc.org/github.com/klauspost/compress/fse#pkg-examples).
+
+# Performance
+
+A lot of factors are affecting speed. Block sizes and compressibility of the material are primary factors.
+All compression functions are currently only running on the calling goroutine so only one core will be used per block.
+
+The compressor is significantly faster if symbols are kept as small as possible. The highest byte value of the input
+is used to reduce some of the processing, so if all your input is above byte value 64 for instance, it may be
+beneficial to transpose all your input values down by 64.
+
+With moderate block sizes around 64k speed are typically 200MB/s per core for compression and
+around 300MB/s decompression speed.
+
+The same hardware typically does Huffman (deflate) encoding at 125MB/s and decompression at 100MB/s.
+
+# Plans
+
+At one point, more internals will be exposed to facilitate more "expert" usage of the components.
+
+A streaming interface is also likely to be implemented. Likely compatible with [FSE stream format](https://github.com/Cyan4973/FiniteStateEntropy/blob/dev/programs/fileio.c#L261).
+
+# Contributing
+
+Contributions are always welcome. Be aware that adding public functions will require good justification and breaking
+changes will likely not be accepted. If in doubt open an issue before writing the PR.
\ No newline at end of file
diff --git a/vendor/github.com/klauspost/compress/fse/bitreader.go b/vendor/github.com/klauspost/compress/fse/bitreader.go
new file mode 100644
index 00000000..f65eb390
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/fse/bitreader.go
@@ -0,0 +1,122 @@
+// Copyright 2018 Klaus Post. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+// Based on work Copyright (c) 2013, Yann Collet, released under BSD License.
+
+package fse
+
+import (
+ "encoding/binary"
+ "errors"
+ "io"
+)
+
+// bitReader reads a bitstream in reverse.
+// The last set bit indicates the start of the stream and is used
+// for aligning the input.
+type bitReader struct {
+ in []byte
+ off uint // next byte to read is at in[off - 1]
+ value uint64
+ bitsRead uint8
+}
+
+// init initializes and resets the bit reader.
+func (b *bitReader) init(in []byte) error {
+ if len(in) < 1 {
+ return errors.New("corrupt stream: too short")
+ }
+ b.in = in
+ b.off = uint(len(in))
+ // The highest bit of the last byte indicates where to start
+ v := in[len(in)-1]
+ if v == 0 {
+ return errors.New("corrupt stream, did not find end of stream")
+ }
+ b.bitsRead = 64
+ b.value = 0
+ if len(in) >= 8 {
+ b.fillFastStart()
+ } else {
+ b.fill()
+ b.fill()
+ }
+ b.bitsRead += 8 - uint8(highBits(uint32(v)))
+ return nil
+}
+
+// getBits will return n bits. n can be 0.
+func (b *bitReader) getBits(n uint8) uint16 {
+ if n == 0 || b.bitsRead >= 64 {
+ return 0
+ }
+ return b.getBitsFast(n)
+}
+
+// getBitsFast requires that at least one bit is requested every time.
+// There are no checks if the buffer is filled.
+func (b *bitReader) getBitsFast(n uint8) uint16 {
+ const regMask = 64 - 1
+ v := uint16((b.value << (b.bitsRead & regMask)) >> ((regMask + 1 - n) & regMask))
+ b.bitsRead += n
+ return v
+}
+
+// fillFast() will make sure at least 32 bits are available.
+// There must be at least 4 bytes available.
+func (b *bitReader) fillFast() {
+ if b.bitsRead < 32 {
+ return
+ }
+ // 2 bounds checks.
+ v := b.in[b.off-4:]
+ v = v[:4]
+ low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24)
+ b.value = (b.value << 32) | uint64(low)
+ b.bitsRead -= 32
+ b.off -= 4
+}
+
+// fill() will make sure at least 32 bits are available.
+func (b *bitReader) fill() {
+ if b.bitsRead < 32 {
+ return
+ }
+ if b.off > 4 {
+ v := b.in[b.off-4:]
+ v = v[:4]
+ low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24)
+ b.value = (b.value << 32) | uint64(low)
+ b.bitsRead -= 32
+ b.off -= 4
+ return
+ }
+ for b.off > 0 {
+ b.value = (b.value << 8) | uint64(b.in[b.off-1])
+ b.bitsRead -= 8
+ b.off--
+ }
+}
+
+// fillFastStart() assumes the bitreader is empty and there is at least 8 bytes to read.
+func (b *bitReader) fillFastStart() {
+ // Do single re-slice to avoid bounds checks.
+ b.value = binary.LittleEndian.Uint64(b.in[b.off-8:])
+ b.bitsRead = 0
+ b.off -= 8
+}
+
+// finished returns true if all bits have been read from the bit stream.
+func (b *bitReader) finished() bool {
+ return b.bitsRead >= 64 && b.off == 0
+}
+
+// close the bitstream and returns an error if out-of-buffer reads occurred.
+func (b *bitReader) close() error {
+ // Release reference.
+ b.in = nil
+ if b.bitsRead > 64 {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
diff --git a/vendor/github.com/klauspost/compress/fse/bitwriter.go b/vendor/github.com/klauspost/compress/fse/bitwriter.go
new file mode 100644
index 00000000..e82fa3bb
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/fse/bitwriter.go
@@ -0,0 +1,167 @@
+// Copyright 2018 Klaus Post. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+// Based on work Copyright (c) 2013, Yann Collet, released under BSD License.
+
+package fse
+
+import "fmt"
+
+// bitWriter will write bits.
+// First bit will be LSB of the first byte of output.
+type bitWriter struct {
+ bitContainer uint64
+ nBits uint8
+ out []byte
+}
+
+// bitMask16 is bitmasks. Has extra to avoid bounds check.
+var bitMask16 = [32]uint16{
+ 0, 1, 3, 7, 0xF, 0x1F,
+ 0x3F, 0x7F, 0xFF, 0x1FF, 0x3FF, 0x7FF,
+ 0xFFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF, 0xFFFF,
+ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
+ 0xFFFF, 0xFFFF} /* up to 16 bits */
+
+// addBits16NC will add up to 16 bits.
+// It will not check if there is space for them,
+// so the caller must ensure that it has flushed recently.
+func (b *bitWriter) addBits16NC(value uint16, bits uint8) {
+ b.bitContainer |= uint64(value&bitMask16[bits&31]) << (b.nBits & 63)
+ b.nBits += bits
+}
+
+// addBits16Clean will add up to 16 bits. value may not contain more set bits than indicated.
+// It will not check if there is space for them, so the caller must ensure that it has flushed recently.
+func (b *bitWriter) addBits16Clean(value uint16, bits uint8) {
+ b.bitContainer |= uint64(value) << (b.nBits & 63)
+ b.nBits += bits
+}
+
+// addBits16ZeroNC will add up to 16 bits.
+// It will not check if there is space for them,
+// so the caller must ensure that it has flushed recently.
+// This is fastest if bits can be zero.
+func (b *bitWriter) addBits16ZeroNC(value uint16, bits uint8) {
+ if bits == 0 {
+ return
+ }
+ value <<= (16 - bits) & 15
+ value >>= (16 - bits) & 15
+ b.bitContainer |= uint64(value) << (b.nBits & 63)
+ b.nBits += bits
+}
+
+// flush will flush all pending full bytes.
+// There will be at least 56 bits available for writing when this has been called.
+// Using flush32 is faster, but leaves less space for writing.
+func (b *bitWriter) flush() {
+ v := b.nBits >> 3
+ switch v {
+ case 0:
+ case 1:
+ b.out = append(b.out,
+ byte(b.bitContainer),
+ )
+ case 2:
+ b.out = append(b.out,
+ byte(b.bitContainer),
+ byte(b.bitContainer>>8),
+ )
+ case 3:
+ b.out = append(b.out,
+ byte(b.bitContainer),
+ byte(b.bitContainer>>8),
+ byte(b.bitContainer>>16),
+ )
+ case 4:
+ b.out = append(b.out,
+ byte(b.bitContainer),
+ byte(b.bitContainer>>8),
+ byte(b.bitContainer>>16),
+ byte(b.bitContainer>>24),
+ )
+ case 5:
+ b.out = append(b.out,
+ byte(b.bitContainer),
+ byte(b.bitContainer>>8),
+ byte(b.bitContainer>>16),
+ byte(b.bitContainer>>24),
+ byte(b.bitContainer>>32),
+ )
+ case 6:
+ b.out = append(b.out,
+ byte(b.bitContainer),
+ byte(b.bitContainer>>8),
+ byte(b.bitContainer>>16),
+ byte(b.bitContainer>>24),
+ byte(b.bitContainer>>32),
+ byte(b.bitContainer>>40),
+ )
+ case 7:
+ b.out = append(b.out,
+ byte(b.bitContainer),
+ byte(b.bitContainer>>8),
+ byte(b.bitContainer>>16),
+ byte(b.bitContainer>>24),
+ byte(b.bitContainer>>32),
+ byte(b.bitContainer>>40),
+ byte(b.bitContainer>>48),
+ )
+ case 8:
+ b.out = append(b.out,
+ byte(b.bitContainer),
+ byte(b.bitContainer>>8),
+ byte(b.bitContainer>>16),
+ byte(b.bitContainer>>24),
+ byte(b.bitContainer>>32),
+ byte(b.bitContainer>>40),
+ byte(b.bitContainer>>48),
+ byte(b.bitContainer>>56),
+ )
+ default:
+ panic(fmt.Errorf("bits (%d) > 64", b.nBits))
+ }
+ b.bitContainer >>= v << 3
+ b.nBits &= 7
+}
+
+// flush32 will flush out, so there are at least 32 bits available for writing.
+func (b *bitWriter) flush32() {
+ if b.nBits < 32 {
+ return
+ }
+ b.out = append(b.out,
+ byte(b.bitContainer),
+ byte(b.bitContainer>>8),
+ byte(b.bitContainer>>16),
+ byte(b.bitContainer>>24))
+ b.nBits -= 32
+ b.bitContainer >>= 32
+}
+
+// flushAlign will flush remaining full bytes and align to next byte boundary.
+func (b *bitWriter) flushAlign() {
+ nbBytes := (b.nBits + 7) >> 3
+ for i := uint8(0); i < nbBytes; i++ {
+ b.out = append(b.out, byte(b.bitContainer>>(i*8)))
+ }
+ b.nBits = 0
+ b.bitContainer = 0
+}
+
+// close will write the alignment bit and write the final byte(s)
+// to the output.
+func (b *bitWriter) close() {
+ // End mark
+ b.addBits16Clean(1, 1)
+ // flush until next byte.
+ b.flushAlign()
+}
+
+// reset and continue writing by appending to out.
+func (b *bitWriter) reset(out []byte) {
+ b.bitContainer = 0
+ b.nBits = 0
+ b.out = out
+}
diff --git a/vendor/github.com/klauspost/compress/fse/bytereader.go b/vendor/github.com/klauspost/compress/fse/bytereader.go
new file mode 100644
index 00000000..abade2d6
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/fse/bytereader.go
@@ -0,0 +1,47 @@
+// Copyright 2018 Klaus Post. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+// Based on work Copyright (c) 2013, Yann Collet, released under BSD License.
+
+package fse
+
+// byteReader provides a byte reader that reads
+// little endian values from a byte stream.
+// The input stream is manually advanced.
+// The reader performs no bounds checks.
+type byteReader struct {
+ b []byte
+ off int
+}
+
+// init will initialize the reader and set the input.
+func (b *byteReader) init(in []byte) {
+ b.b = in
+ b.off = 0
+}
+
+// advance the stream b n bytes.
+func (b *byteReader) advance(n uint) {
+ b.off += int(n)
+}
+
+// Uint32 returns a little endian uint32 starting at current offset.
+func (b byteReader) Uint32() uint32 {
+ b2 := b.b[b.off:]
+ b2 = b2[:4]
+ v3 := uint32(b2[3])
+ v2 := uint32(b2[2])
+ v1 := uint32(b2[1])
+ v0 := uint32(b2[0])
+ return v0 | (v1 << 8) | (v2 << 16) | (v3 << 24)
+}
+
+// unread returns the unread portion of the input.
+func (b byteReader) unread() []byte {
+ return b.b[b.off:]
+}
+
+// remain will return the number of bytes remaining.
+func (b byteReader) remain() int {
+ return len(b.b) - b.off
+}
diff --git a/vendor/github.com/klauspost/compress/fse/compress.go b/vendor/github.com/klauspost/compress/fse/compress.go
new file mode 100644
index 00000000..074018d8
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/fse/compress.go
@@ -0,0 +1,683 @@
+// Copyright 2018 Klaus Post. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+// Based on work Copyright (c) 2013, Yann Collet, released under BSD License.
+
+package fse
+
+import (
+ "errors"
+ "fmt"
+)
+
+// Compress the input bytes. Input must be < 2GB.
+// Provide a Scratch buffer to avoid memory allocations.
+// Note that the output is also kept in the scratch buffer.
+// If input is too hard to compress, ErrIncompressible is returned.
+// If input is a single byte value repeated ErrUseRLE is returned.
+func Compress(in []byte, s *Scratch) ([]byte, error) {
+ if len(in) <= 1 {
+ return nil, ErrIncompressible
+ }
+ if len(in) > (2<<30)-1 {
+ return nil, errors.New("input too big, must be < 2GB")
+ }
+ s, err := s.prepare(in)
+ if err != nil {
+ return nil, err
+ }
+
+ // Create histogram, if none was provided.
+ maxCount := s.maxCount
+ if maxCount == 0 {
+ maxCount = s.countSimple(in)
+ }
+ // Reset for next run.
+ s.clearCount = true
+ s.maxCount = 0
+ if maxCount == len(in) {
+ // One symbol, use RLE
+ return nil, ErrUseRLE
+ }
+ if maxCount == 1 || maxCount < (len(in)>>7) {
+ // Each symbol present maximum once or too well distributed.
+ return nil, ErrIncompressible
+ }
+ s.optimalTableLog()
+ err = s.normalizeCount()
+ if err != nil {
+ return nil, err
+ }
+ err = s.writeCount()
+ if err != nil {
+ return nil, err
+ }
+
+ if false {
+ err = s.validateNorm()
+ if err != nil {
+ return nil, err
+ }
+ }
+
+ err = s.buildCTable()
+ if err != nil {
+ return nil, err
+ }
+ err = s.compress(in)
+ if err != nil {
+ return nil, err
+ }
+ s.Out = s.bw.out
+ // Check if we compressed.
+ if len(s.Out) >= len(in) {
+ return nil, ErrIncompressible
+ }
+ return s.Out, nil
+}
+
+// cState contains the compression state of a stream.
+type cState struct {
+ bw *bitWriter
+ stateTable []uint16
+ state uint16
+}
+
+// init will initialize the compression state to the first symbol of the stream.
+func (c *cState) init(bw *bitWriter, ct *cTable, tableLog uint8, first symbolTransform) {
+ c.bw = bw
+ c.stateTable = ct.stateTable
+
+ nbBitsOut := (first.deltaNbBits + (1 << 15)) >> 16
+ im := int32((nbBitsOut << 16) - first.deltaNbBits)
+ lu := (im >> nbBitsOut) + first.deltaFindState
+ c.state = c.stateTable[lu]
+}
+
+// encode the output symbol provided and write it to the bitstream.
+func (c *cState) encode(symbolTT symbolTransform) {
+ nbBitsOut := (uint32(c.state) + symbolTT.deltaNbBits) >> 16
+ dstState := int32(c.state>>(nbBitsOut&15)) + symbolTT.deltaFindState
+ c.bw.addBits16NC(c.state, uint8(nbBitsOut))
+ c.state = c.stateTable[dstState]
+}
+
+// encode the output symbol provided and write it to the bitstream.
+func (c *cState) encodeZero(symbolTT symbolTransform) {
+ nbBitsOut := (uint32(c.state) + symbolTT.deltaNbBits) >> 16
+ dstState := int32(c.state>>(nbBitsOut&15)) + symbolTT.deltaFindState
+ c.bw.addBits16ZeroNC(c.state, uint8(nbBitsOut))
+ c.state = c.stateTable[dstState]
+}
+
+// flush will write the tablelog to the output and flush the remaining full bytes.
+func (c *cState) flush(tableLog uint8) {
+ c.bw.flush32()
+ c.bw.addBits16NC(c.state, tableLog)
+ c.bw.flush()
+}
+
+// compress is the main compression loop that will encode the input from the last byte to the first.
+func (s *Scratch) compress(src []byte) error {
+ if len(src) <= 2 {
+ return errors.New("compress: src too small")
+ }
+ tt := s.ct.symbolTT[:256]
+ s.bw.reset(s.Out)
+
+ // Our two states each encodes every second byte.
+ // Last byte encoded (first byte decoded) will always be encoded by c1.
+ var c1, c2 cState
+
+ // Encode so remaining size is divisible by 4.
+ ip := len(src)
+ if ip&1 == 1 {
+ c1.init(&s.bw, &s.ct, s.actualTableLog, tt[src[ip-1]])
+ c2.init(&s.bw, &s.ct, s.actualTableLog, tt[src[ip-2]])
+ c1.encodeZero(tt[src[ip-3]])
+ ip -= 3
+ } else {
+ c2.init(&s.bw, &s.ct, s.actualTableLog, tt[src[ip-1]])
+ c1.init(&s.bw, &s.ct, s.actualTableLog, tt[src[ip-2]])
+ ip -= 2
+ }
+ if ip&2 != 0 {
+ c2.encodeZero(tt[src[ip-1]])
+ c1.encodeZero(tt[src[ip-2]])
+ ip -= 2
+ }
+ src = src[:ip]
+
+ // Main compression loop.
+ switch {
+ case !s.zeroBits && s.actualTableLog <= 8:
+ // We can encode 4 symbols without requiring a flush.
+ // We do not need to check if any output is 0 bits.
+ for ; len(src) >= 4; src = src[:len(src)-4] {
+ s.bw.flush32()
+ v3, v2, v1, v0 := src[len(src)-4], src[len(src)-3], src[len(src)-2], src[len(src)-1]
+ c2.encode(tt[v0])
+ c1.encode(tt[v1])
+ c2.encode(tt[v2])
+ c1.encode(tt[v3])
+ }
+ case !s.zeroBits:
+ // We do not need to check if any output is 0 bits.
+ for ; len(src) >= 4; src = src[:len(src)-4] {
+ s.bw.flush32()
+ v3, v2, v1, v0 := src[len(src)-4], src[len(src)-3], src[len(src)-2], src[len(src)-1]
+ c2.encode(tt[v0])
+ c1.encode(tt[v1])
+ s.bw.flush32()
+ c2.encode(tt[v2])
+ c1.encode(tt[v3])
+ }
+ case s.actualTableLog <= 8:
+ // We can encode 4 symbols without requiring a flush
+ for ; len(src) >= 4; src = src[:len(src)-4] {
+ s.bw.flush32()
+ v3, v2, v1, v0 := src[len(src)-4], src[len(src)-3], src[len(src)-2], src[len(src)-1]
+ c2.encodeZero(tt[v0])
+ c1.encodeZero(tt[v1])
+ c2.encodeZero(tt[v2])
+ c1.encodeZero(tt[v3])
+ }
+ default:
+ for ; len(src) >= 4; src = src[:len(src)-4] {
+ s.bw.flush32()
+ v3, v2, v1, v0 := src[len(src)-4], src[len(src)-3], src[len(src)-2], src[len(src)-1]
+ c2.encodeZero(tt[v0])
+ c1.encodeZero(tt[v1])
+ s.bw.flush32()
+ c2.encodeZero(tt[v2])
+ c1.encodeZero(tt[v3])
+ }
+ }
+
+ // Flush final state.
+ // Used to initialize state when decoding.
+ c2.flush(s.actualTableLog)
+ c1.flush(s.actualTableLog)
+
+ s.bw.close()
+ return nil
+}
+
+// writeCount will write the normalized histogram count to header.
+// This is read back by readNCount.
+func (s *Scratch) writeCount() error {
+ var (
+ tableLog = s.actualTableLog
+ tableSize = 1 << tableLog
+ previous0 bool
+ charnum uint16
+
+ maxHeaderSize = ((int(s.symbolLen)*int(tableLog) + 4 + 2) >> 3) + 3
+
+ // Write Table Size
+ bitStream = uint32(tableLog - minTablelog)
+ bitCount = uint(4)
+ remaining = int16(tableSize + 1) /* +1 for extra accuracy */
+ threshold = int16(tableSize)
+ nbBits = uint(tableLog + 1)
+ )
+ if cap(s.Out) < maxHeaderSize {
+ s.Out = make([]byte, 0, s.br.remain()+maxHeaderSize)
+ }
+ outP := uint(0)
+ out := s.Out[:maxHeaderSize]
+
+ // stops at 1
+ for remaining > 1 {
+ if previous0 {
+ start := charnum
+ for s.norm[charnum] == 0 {
+ charnum++
+ }
+ for charnum >= start+24 {
+ start += 24
+ bitStream += uint32(0xFFFF) << bitCount
+ out[outP] = byte(bitStream)
+ out[outP+1] = byte(bitStream >> 8)
+ outP += 2
+ bitStream >>= 16
+ }
+ for charnum >= start+3 {
+ start += 3
+ bitStream += 3 << bitCount
+ bitCount += 2
+ }
+ bitStream += uint32(charnum-start) << bitCount
+ bitCount += 2
+ if bitCount > 16 {
+ out[outP] = byte(bitStream)
+ out[outP+1] = byte(bitStream >> 8)
+ outP += 2
+ bitStream >>= 16
+ bitCount -= 16
+ }
+ }
+
+ count := s.norm[charnum]
+ charnum++
+ max := (2*threshold - 1) - remaining
+ if count < 0 {
+ remaining += count
+ } else {
+ remaining -= count
+ }
+ count++ // +1 for extra accuracy
+ if count >= threshold {
+ count += max // [0..max[ [max..threshold[ (...) [threshold+max 2*threshold[
+ }
+ bitStream += uint32(count) << bitCount
+ bitCount += nbBits
+ if count < max {
+ bitCount--
+ }
+
+ previous0 = count == 1
+ if remaining < 1 {
+ return errors.New("internal error: remaining<1")
+ }
+ for remaining < threshold {
+ nbBits--
+ threshold >>= 1
+ }
+
+ if bitCount > 16 {
+ out[outP] = byte(bitStream)
+ out[outP+1] = byte(bitStream >> 8)
+ outP += 2
+ bitStream >>= 16
+ bitCount -= 16
+ }
+ }
+
+ out[outP] = byte(bitStream)
+ out[outP+1] = byte(bitStream >> 8)
+ outP += (bitCount + 7) / 8
+
+ if charnum > s.symbolLen {
+ return errors.New("internal error: charnum > s.symbolLen")
+ }
+ s.Out = out[:outP]
+ return nil
+}
+
+// symbolTransform contains the state transform for a symbol.
+type symbolTransform struct {
+ deltaFindState int32
+ deltaNbBits uint32
+}
+
+// String prints values as a human readable string.
+func (s symbolTransform) String() string {
+ return fmt.Sprintf("dnbits: %08x, fs:%d", s.deltaNbBits, s.deltaFindState)
+}
+
+// cTable contains tables used for compression.
+type cTable struct {
+ tableSymbol []byte
+ stateTable []uint16
+ symbolTT []symbolTransform
+}
+
+// allocCtable will allocate tables needed for compression.
+// If existing tables a re big enough, they are simply re-used.
+func (s *Scratch) allocCtable() {
+ tableSize := 1 << s.actualTableLog
+ // get tableSymbol that is big enough.
+ if cap(s.ct.tableSymbol) < tableSize {
+ s.ct.tableSymbol = make([]byte, tableSize)
+ }
+ s.ct.tableSymbol = s.ct.tableSymbol[:tableSize]
+
+ ctSize := tableSize
+ if cap(s.ct.stateTable) < ctSize {
+ s.ct.stateTable = make([]uint16, ctSize)
+ }
+ s.ct.stateTable = s.ct.stateTable[:ctSize]
+
+ if cap(s.ct.symbolTT) < 256 {
+ s.ct.symbolTT = make([]symbolTransform, 256)
+ }
+ s.ct.symbolTT = s.ct.symbolTT[:256]
+}
+
+// buildCTable will populate the compression table so it is ready to be used.
+func (s *Scratch) buildCTable() error {
+ tableSize := uint32(1 << s.actualTableLog)
+ highThreshold := tableSize - 1
+ var cumul [maxSymbolValue + 2]int16
+
+ s.allocCtable()
+ tableSymbol := s.ct.tableSymbol[:tableSize]
+ // symbol start positions
+ {
+ cumul[0] = 0
+ for ui, v := range s.norm[:s.symbolLen-1] {
+ u := byte(ui) // one less than reference
+ if v == -1 {
+ // Low proba symbol
+ cumul[u+1] = cumul[u] + 1
+ tableSymbol[highThreshold] = u
+ highThreshold--
+ } else {
+ cumul[u+1] = cumul[u] + v
+ }
+ }
+ // Encode last symbol separately to avoid overflowing u
+ u := int(s.symbolLen - 1)
+ v := s.norm[s.symbolLen-1]
+ if v == -1 {
+ // Low proba symbol
+ cumul[u+1] = cumul[u] + 1
+ tableSymbol[highThreshold] = byte(u)
+ highThreshold--
+ } else {
+ cumul[u+1] = cumul[u] + v
+ }
+ if uint32(cumul[s.symbolLen]) != tableSize {
+ return fmt.Errorf("internal error: expected cumul[s.symbolLen] (%d) == tableSize (%d)", cumul[s.symbolLen], tableSize)
+ }
+ cumul[s.symbolLen] = int16(tableSize) + 1
+ }
+ // Spread symbols
+ s.zeroBits = false
+ {
+ step := tableStep(tableSize)
+ tableMask := tableSize - 1
+ var position uint32
+ // if any symbol > largeLimit, we may have 0 bits output.
+ largeLimit := int16(1 << (s.actualTableLog - 1))
+ for ui, v := range s.norm[:s.symbolLen] {
+ symbol := byte(ui)
+ if v > largeLimit {
+ s.zeroBits = true
+ }
+ for nbOccurrences := int16(0); nbOccurrences < v; nbOccurrences++ {
+ tableSymbol[position] = symbol
+ position = (position + step) & tableMask
+ for position > highThreshold {
+ position = (position + step) & tableMask
+ } /* Low proba area */
+ }
+ }
+
+ // Check if we have gone through all positions
+ if position != 0 {
+ return errors.New("position!=0")
+ }
+ }
+
+ // Build table
+ table := s.ct.stateTable
+ {
+ tsi := int(tableSize)
+ for u, v := range tableSymbol {
+ // TableU16 : sorted by symbol order; gives next state value
+ table[cumul[v]] = uint16(tsi + u)
+ cumul[v]++
+ }
+ }
+
+ // Build Symbol Transformation Table
+ {
+ total := int16(0)
+ symbolTT := s.ct.symbolTT[:s.symbolLen]
+ tableLog := s.actualTableLog
+ tl := (uint32(tableLog) << 16) - (1 << tableLog)
+ for i, v := range s.norm[:s.symbolLen] {
+ switch v {
+ case 0:
+ case -1, 1:
+ symbolTT[i].deltaNbBits = tl
+ symbolTT[i].deltaFindState = int32(total - 1)
+ total++
+ default:
+ maxBitsOut := uint32(tableLog) - highBits(uint32(v-1))
+ minStatePlus := uint32(v) << maxBitsOut
+ symbolTT[i].deltaNbBits = (maxBitsOut << 16) - minStatePlus
+ symbolTT[i].deltaFindState = int32(total - v)
+ total += v
+ }
+ }
+ if total != int16(tableSize) {
+ return fmt.Errorf("total mismatch %d (got) != %d (want)", total, tableSize)
+ }
+ }
+ return nil
+}
+
+// countSimple will create a simple histogram in s.count.
+// Returns the biggest count.
+// Does not update s.clearCount.
+func (s *Scratch) countSimple(in []byte) (max int) {
+ for _, v := range in {
+ s.count[v]++
+ }
+ m, symlen := uint32(0), s.symbolLen
+ for i, v := range s.count[:] {
+ if v == 0 {
+ continue
+ }
+ if v > m {
+ m = v
+ }
+ symlen = uint16(i) + 1
+ }
+ s.symbolLen = symlen
+ return int(m)
+}
+
+// minTableLog provides the minimum logSize to safely represent a distribution.
+func (s *Scratch) minTableLog() uint8 {
+ minBitsSrc := highBits(uint32(s.br.remain()-1)) + 1
+ minBitsSymbols := highBits(uint32(s.symbolLen-1)) + 2
+ if minBitsSrc < minBitsSymbols {
+ return uint8(minBitsSrc)
+ }
+ return uint8(minBitsSymbols)
+}
+
+// optimalTableLog calculates and sets the optimal tableLog in s.actualTableLog
+func (s *Scratch) optimalTableLog() {
+ tableLog := s.TableLog
+ minBits := s.minTableLog()
+ maxBitsSrc := uint8(highBits(uint32(s.br.remain()-1))) - 2
+ if maxBitsSrc < tableLog {
+ // Accuracy can be reduced
+ tableLog = maxBitsSrc
+ }
+ if minBits > tableLog {
+ tableLog = minBits
+ }
+ // Need a minimum to safely represent all symbol values
+ if tableLog < minTablelog {
+ tableLog = minTablelog
+ }
+ if tableLog > maxTableLog {
+ tableLog = maxTableLog
+ }
+ s.actualTableLog = tableLog
+}
+
+var rtbTable = [...]uint32{0, 473195, 504333, 520860, 550000, 700000, 750000, 830000}
+
+// normalizeCount will normalize the count of the symbols so
+// the total is equal to the table size.
+func (s *Scratch) normalizeCount() error {
+ var (
+ tableLog = s.actualTableLog
+ scale = 62 - uint64(tableLog)
+ step = (1 << 62) / uint64(s.br.remain())
+ vStep = uint64(1) << (scale - 20)
+ stillToDistribute = int16(1 << tableLog)
+ largest int
+ largestP int16
+ lowThreshold = (uint32)(s.br.remain() >> tableLog)
+ )
+
+ for i, cnt := range s.count[:s.symbolLen] {
+ // already handled
+ // if (count[s] == s.length) return 0; /* rle special case */
+
+ if cnt == 0 {
+ s.norm[i] = 0
+ continue
+ }
+ if cnt <= lowThreshold {
+ s.norm[i] = -1
+ stillToDistribute--
+ } else {
+ proba := (int16)((uint64(cnt) * step) >> scale)
+ if proba < 8 {
+ restToBeat := vStep * uint64(rtbTable[proba])
+ v := uint64(cnt)*step - (uint64(proba) << scale)
+ if v > restToBeat {
+ proba++
+ }
+ }
+ if proba > largestP {
+ largestP = proba
+ largest = i
+ }
+ s.norm[i] = proba
+ stillToDistribute -= proba
+ }
+ }
+
+ if -stillToDistribute >= (s.norm[largest] >> 1) {
+ // corner case, need another normalization method
+ return s.normalizeCount2()
+ }
+ s.norm[largest] += stillToDistribute
+ return nil
+}
+
+// Secondary normalization method.
+// To be used when primary method fails.
+func (s *Scratch) normalizeCount2() error {
+ const notYetAssigned = -2
+ var (
+ distributed uint32
+ total = uint32(s.br.remain())
+ tableLog = s.actualTableLog
+ lowThreshold = total >> tableLog
+ lowOne = (total * 3) >> (tableLog + 1)
+ )
+ for i, cnt := range s.count[:s.symbolLen] {
+ if cnt == 0 {
+ s.norm[i] = 0
+ continue
+ }
+ if cnt <= lowThreshold {
+ s.norm[i] = -1
+ distributed++
+ total -= cnt
+ continue
+ }
+ if cnt <= lowOne {
+ s.norm[i] = 1
+ distributed++
+ total -= cnt
+ continue
+ }
+ s.norm[i] = notYetAssigned
+ }
+ toDistribute := (1 << tableLog) - distributed
+
+ if (total / toDistribute) > lowOne {
+ // risk of rounding to zero
+ lowOne = (total * 3) / (toDistribute * 2)
+ for i, cnt := range s.count[:s.symbolLen] {
+ if (s.norm[i] == notYetAssigned) && (cnt <= lowOne) {
+ s.norm[i] = 1
+ distributed++
+ total -= cnt
+ continue
+ }
+ }
+ toDistribute = (1 << tableLog) - distributed
+ }
+ if distributed == uint32(s.symbolLen)+1 {
+ // all values are pretty poor;
+ // probably incompressible data (should have already been detected);
+ // find max, then give all remaining points to max
+ var maxV int
+ var maxC uint32
+ for i, cnt := range s.count[:s.symbolLen] {
+ if cnt > maxC {
+ maxV = i
+ maxC = cnt
+ }
+ }
+ s.norm[maxV] += int16(toDistribute)
+ return nil
+ }
+
+ if total == 0 {
+ // all of the symbols were low enough for the lowOne or lowThreshold
+ for i := uint32(0); toDistribute > 0; i = (i + 1) % (uint32(s.symbolLen)) {
+ if s.norm[i] > 0 {
+ toDistribute--
+ s.norm[i]++
+ }
+ }
+ return nil
+ }
+
+ var (
+ vStepLog = 62 - uint64(tableLog)
+ mid = uint64((1 << (vStepLog - 1)) - 1)
+ rStep = (((1 << vStepLog) * uint64(toDistribute)) + mid) / uint64(total) // scale on remaining
+ tmpTotal = mid
+ )
+ for i, cnt := range s.count[:s.symbolLen] {
+ if s.norm[i] == notYetAssigned {
+ var (
+ end = tmpTotal + uint64(cnt)*rStep
+ sStart = uint32(tmpTotal >> vStepLog)
+ sEnd = uint32(end >> vStepLog)
+ weight = sEnd - sStart
+ )
+ if weight < 1 {
+ return errors.New("weight < 1")
+ }
+ s.norm[i] = int16(weight)
+ tmpTotal = end
+ }
+ }
+ return nil
+}
+
+// validateNorm validates the normalized histogram table.
+func (s *Scratch) validateNorm() (err error) {
+ var total int
+ for _, v := range s.norm[:s.symbolLen] {
+ if v >= 0 {
+ total += int(v)
+ } else {
+ total -= int(v)
+ }
+ }
+ defer func() {
+ if err == nil {
+ return
+ }
+ fmt.Printf("selected TableLog: %d, Symbol length: %d\n", s.actualTableLog, s.symbolLen)
+ for i, v := range s.norm[:s.symbolLen] {
+ fmt.Printf("%3d: %5d -> %4d \n", i, s.count[i], v)
+ }
+ }()
+ if total != (1 << s.actualTableLog) {
+ return fmt.Errorf("warning: Total == %d != %d", total, 1< tablelogAbsoluteMax {
+ return errors.New("tableLog too large")
+ }
+ bitStream >>= 4
+ bitCount := uint(4)
+
+ s.actualTableLog = uint8(nbBits)
+ remaining := int32((1 << nbBits) + 1)
+ threshold := int32(1 << nbBits)
+ gotTotal := int32(0)
+ nbBits++
+
+ for remaining > 1 {
+ if previous0 {
+ n0 := charnum
+ for (bitStream & 0xFFFF) == 0xFFFF {
+ n0 += 24
+ if b.off < iend-5 {
+ b.advance(2)
+ bitStream = b.Uint32() >> bitCount
+ } else {
+ bitStream >>= 16
+ bitCount += 16
+ }
+ }
+ for (bitStream & 3) == 3 {
+ n0 += 3
+ bitStream >>= 2
+ bitCount += 2
+ }
+ n0 += uint16(bitStream & 3)
+ bitCount += 2
+ if n0 > maxSymbolValue {
+ return errors.New("maxSymbolValue too small")
+ }
+ for charnum < n0 {
+ s.norm[charnum&0xff] = 0
+ charnum++
+ }
+
+ if b.off <= iend-7 || b.off+int(bitCount>>3) <= iend-4 {
+ b.advance(bitCount >> 3)
+ bitCount &= 7
+ bitStream = b.Uint32() >> bitCount
+ } else {
+ bitStream >>= 2
+ }
+ }
+
+ max := (2*(threshold) - 1) - (remaining)
+ var count int32
+
+ if (int32(bitStream) & (threshold - 1)) < max {
+ count = int32(bitStream) & (threshold - 1)
+ bitCount += nbBits - 1
+ } else {
+ count = int32(bitStream) & (2*threshold - 1)
+ if count >= threshold {
+ count -= max
+ }
+ bitCount += nbBits
+ }
+
+ count-- // extra accuracy
+ if count < 0 {
+ // -1 means +1
+ remaining += count
+ gotTotal -= count
+ } else {
+ remaining -= count
+ gotTotal += count
+ }
+ s.norm[charnum&0xff] = int16(count)
+ charnum++
+ previous0 = count == 0
+ for remaining < threshold {
+ nbBits--
+ threshold >>= 1
+ }
+ if b.off <= iend-7 || b.off+int(bitCount>>3) <= iend-4 {
+ b.advance(bitCount >> 3)
+ bitCount &= 7
+ } else {
+ bitCount -= (uint)(8 * (len(b.b) - 4 - b.off))
+ b.off = len(b.b) - 4
+ }
+ bitStream = b.Uint32() >> (bitCount & 31)
+ }
+ s.symbolLen = charnum
+
+ if s.symbolLen <= 1 {
+ return fmt.Errorf("symbolLen (%d) too small", s.symbolLen)
+ }
+ if s.symbolLen > maxSymbolValue+1 {
+ return fmt.Errorf("symbolLen (%d) too big", s.symbolLen)
+ }
+ if remaining != 1 {
+ return fmt.Errorf("corruption detected (remaining %d != 1)", remaining)
+ }
+ if bitCount > 32 {
+ return fmt.Errorf("corruption detected (bitCount %d > 32)", bitCount)
+ }
+ if gotTotal != 1<> 3)
+ return nil
+}
+
+// decSymbol contains information about a state entry,
+// Including the state offset base, the output symbol and
+// the number of bits to read for the low part of the destination state.
+type decSymbol struct {
+ newState uint16
+ symbol uint8
+ nbBits uint8
+}
+
+// allocDtable will allocate decoding tables if they are not big enough.
+func (s *Scratch) allocDtable() {
+ tableSize := 1 << s.actualTableLog
+ if cap(s.decTable) < tableSize {
+ s.decTable = make([]decSymbol, tableSize)
+ }
+ s.decTable = s.decTable[:tableSize]
+
+ if cap(s.ct.tableSymbol) < 256 {
+ s.ct.tableSymbol = make([]byte, 256)
+ }
+ s.ct.tableSymbol = s.ct.tableSymbol[:256]
+
+ if cap(s.ct.stateTable) < 256 {
+ s.ct.stateTable = make([]uint16, 256)
+ }
+ s.ct.stateTable = s.ct.stateTable[:256]
+}
+
+// buildDtable will build the decoding table.
+func (s *Scratch) buildDtable() error {
+ tableSize := uint32(1 << s.actualTableLog)
+ highThreshold := tableSize - 1
+ s.allocDtable()
+ symbolNext := s.ct.stateTable[:256]
+
+ // Init, lay down lowprob symbols
+ s.zeroBits = false
+ {
+ largeLimit := int16(1 << (s.actualTableLog - 1))
+ for i, v := range s.norm[:s.symbolLen] {
+ if v == -1 {
+ s.decTable[highThreshold].symbol = uint8(i)
+ highThreshold--
+ symbolNext[i] = 1
+ } else {
+ if v >= largeLimit {
+ s.zeroBits = true
+ }
+ symbolNext[i] = uint16(v)
+ }
+ }
+ }
+ // Spread symbols
+ {
+ tableMask := tableSize - 1
+ step := tableStep(tableSize)
+ position := uint32(0)
+ for ss, v := range s.norm[:s.symbolLen] {
+ for i := 0; i < int(v); i++ {
+ s.decTable[position].symbol = uint8(ss)
+ position = (position + step) & tableMask
+ for position > highThreshold {
+ // lowprob area
+ position = (position + step) & tableMask
+ }
+ }
+ }
+ if position != 0 {
+ // position must reach all cells once, otherwise normalizedCounter is incorrect
+ return errors.New("corrupted input (position != 0)")
+ }
+ }
+
+ // Build Decoding table
+ {
+ tableSize := uint16(1 << s.actualTableLog)
+ for u, v := range s.decTable {
+ symbol := v.symbol
+ nextState := symbolNext[symbol]
+ symbolNext[symbol] = nextState + 1
+ nBits := s.actualTableLog - byte(highBits(uint32(nextState)))
+ s.decTable[u].nbBits = nBits
+ newState := (nextState << nBits) - tableSize
+ if newState >= tableSize {
+ return fmt.Errorf("newState (%d) outside table size (%d)", newState, tableSize)
+ }
+ if newState == uint16(u) && nBits == 0 {
+ // Seems weird that this is possible with nbits > 0.
+ return fmt.Errorf("newState (%d) == oldState (%d) and no bits", newState, u)
+ }
+ s.decTable[u].newState = newState
+ }
+ }
+ return nil
+}
+
+// decompress will decompress the bitstream.
+// If the buffer is over-read an error is returned.
+func (s *Scratch) decompress() error {
+ br := &s.bits
+ if err := br.init(s.br.unread()); err != nil {
+ return err
+ }
+
+ var s1, s2 decoder
+ // Initialize and decode first state and symbol.
+ s1.init(br, s.decTable, s.actualTableLog)
+ s2.init(br, s.decTable, s.actualTableLog)
+
+ // Use temp table to avoid bound checks/append penalty.
+ var tmp = s.ct.tableSymbol[:256]
+ var off uint8
+
+ // Main part
+ if !s.zeroBits {
+ for br.off >= 8 {
+ br.fillFast()
+ tmp[off+0] = s1.nextFast()
+ tmp[off+1] = s2.nextFast()
+ br.fillFast()
+ tmp[off+2] = s1.nextFast()
+ tmp[off+3] = s2.nextFast()
+ off += 4
+ // When off is 0, we have overflowed and should write.
+ if off == 0 {
+ s.Out = append(s.Out, tmp...)
+ if len(s.Out) >= s.DecompressLimit {
+ return fmt.Errorf("output size (%d) > DecompressLimit (%d)", len(s.Out), s.DecompressLimit)
+ }
+ }
+ }
+ } else {
+ for br.off >= 8 {
+ br.fillFast()
+ tmp[off+0] = s1.next()
+ tmp[off+1] = s2.next()
+ br.fillFast()
+ tmp[off+2] = s1.next()
+ tmp[off+3] = s2.next()
+ off += 4
+ if off == 0 {
+ s.Out = append(s.Out, tmp...)
+ // When off is 0, we have overflowed and should write.
+ if len(s.Out) >= s.DecompressLimit {
+ return fmt.Errorf("output size (%d) > DecompressLimit (%d)", len(s.Out), s.DecompressLimit)
+ }
+ }
+ }
+ }
+ s.Out = append(s.Out, tmp[:off]...)
+
+ // Final bits, a bit more expensive check
+ for {
+ if s1.finished() {
+ s.Out = append(s.Out, s1.final(), s2.final())
+ break
+ }
+ br.fill()
+ s.Out = append(s.Out, s1.next())
+ if s2.finished() {
+ s.Out = append(s.Out, s2.final(), s1.final())
+ break
+ }
+ s.Out = append(s.Out, s2.next())
+ if len(s.Out) >= s.DecompressLimit {
+ return fmt.Errorf("output size (%d) > DecompressLimit (%d)", len(s.Out), s.DecompressLimit)
+ }
+ }
+ return br.close()
+}
+
+// decoder keeps track of the current state and updates it from the bitstream.
+type decoder struct {
+ state uint16
+ br *bitReader
+ dt []decSymbol
+}
+
+// init will initialize the decoder and read the first state from the stream.
+func (d *decoder) init(in *bitReader, dt []decSymbol, tableLog uint8) {
+ d.dt = dt
+ d.br = in
+ d.state = in.getBits(tableLog)
+}
+
+// next returns the next symbol and sets the next state.
+// At least tablelog bits must be available in the bit reader.
+func (d *decoder) next() uint8 {
+ n := &d.dt[d.state]
+ lowBits := d.br.getBits(n.nbBits)
+ d.state = n.newState + lowBits
+ return n.symbol
+}
+
+// finished returns true if all bits have been read from the bitstream
+// and the next state would require reading bits from the input.
+func (d *decoder) finished() bool {
+ return d.br.finished() && d.dt[d.state].nbBits > 0
+}
+
+// final returns the current state symbol without decoding the next.
+func (d *decoder) final() uint8 {
+ return d.dt[d.state].symbol
+}
+
+// nextFast returns the next symbol and sets the next state.
+// This can only be used if no symbols are 0 bits.
+// At least tablelog bits must be available in the bit reader.
+func (d *decoder) nextFast() uint8 {
+ n := d.dt[d.state]
+ lowBits := d.br.getBitsFast(n.nbBits)
+ d.state = n.newState + lowBits
+ return n.symbol
+}
diff --git a/vendor/github.com/klauspost/compress/fse/fse.go b/vendor/github.com/klauspost/compress/fse/fse.go
new file mode 100644
index 00000000..535cbadf
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/fse/fse.go
@@ -0,0 +1,144 @@
+// Copyright 2018 Klaus Post. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+// Based on work Copyright (c) 2013, Yann Collet, released under BSD License.
+
+// Package fse provides Finite State Entropy encoding and decoding.
+//
+// Finite State Entropy encoding provides a fast near-optimal symbol encoding/decoding
+// for byte blocks as implemented in zstd.
+//
+// See https://github.com/klauspost/compress/tree/master/fse for more information.
+package fse
+
+import (
+ "errors"
+ "fmt"
+ "math/bits"
+)
+
+const (
+ /*!MEMORY_USAGE :
+ * Memory usage formula : N->2^N Bytes (examples : 10 -> 1KB; 12 -> 4KB ; 16 -> 64KB; 20 -> 1MB; etc.)
+ * Increasing memory usage improves compression ratio
+ * Reduced memory usage can improve speed, due to cache effect
+ * Recommended max value is 14, for 16KB, which nicely fits into Intel x86 L1 cache */
+ maxMemoryUsage = 14
+ defaultMemoryUsage = 13
+
+ maxTableLog = maxMemoryUsage - 2
+ maxTablesize = 1 << maxTableLog
+ defaultTablelog = defaultMemoryUsage - 2
+ minTablelog = 5
+ maxSymbolValue = 255
+)
+
+var (
+ // ErrIncompressible is returned when input is judged to be too hard to compress.
+ ErrIncompressible = errors.New("input is not compressible")
+
+ // ErrUseRLE is returned from the compressor when the input is a single byte value repeated.
+ ErrUseRLE = errors.New("input is single value repeated")
+)
+
+// Scratch provides temporary storage for compression and decompression.
+type Scratch struct {
+ // Private
+ count [maxSymbolValue + 1]uint32
+ norm [maxSymbolValue + 1]int16
+ br byteReader
+ bits bitReader
+ bw bitWriter
+ ct cTable // Compression tables.
+ decTable []decSymbol // Decompression table.
+ maxCount int // count of the most probable symbol
+
+ // Per block parameters.
+ // These can be used to override compression parameters of the block.
+ // Do not touch, unless you know what you are doing.
+
+ // Out is output buffer.
+ // If the scratch is re-used before the caller is done processing the output,
+ // set this field to nil.
+ // Otherwise the output buffer will be re-used for next Compression/Decompression step
+ // and allocation will be avoided.
+ Out []byte
+
+ // DecompressLimit limits the maximum decoded size acceptable.
+ // If > 0 decompression will stop when approximately this many bytes
+ // has been decoded.
+ // If 0, maximum size will be 2GB.
+ DecompressLimit int
+
+ symbolLen uint16 // Length of active part of the symbol table.
+ actualTableLog uint8 // Selected tablelog.
+ zeroBits bool // no bits has prob > 50%.
+ clearCount bool // clear count
+
+ // MaxSymbolValue will override the maximum symbol value of the next block.
+ MaxSymbolValue uint8
+
+ // TableLog will attempt to override the tablelog for the next block.
+ TableLog uint8
+}
+
+// Histogram allows to populate the histogram and skip that step in the compression,
+// It otherwise allows to inspect the histogram when compression is done.
+// To indicate that you have populated the histogram call HistogramFinished
+// with the value of the highest populated symbol, as well as the number of entries
+// in the most populated entry. These are accepted at face value.
+// The returned slice will always be length 256.
+func (s *Scratch) Histogram() []uint32 {
+ return s.count[:]
+}
+
+// HistogramFinished can be called to indicate that the histogram has been populated.
+// maxSymbol is the index of the highest set symbol of the next data segment.
+// maxCount is the number of entries in the most populated entry.
+// These are accepted at face value.
+func (s *Scratch) HistogramFinished(maxSymbol uint8, maxCount int) {
+ s.maxCount = maxCount
+ s.symbolLen = uint16(maxSymbol) + 1
+ s.clearCount = maxCount != 0
+}
+
+// prepare will prepare and allocate scratch tables used for both compression and decompression.
+func (s *Scratch) prepare(in []byte) (*Scratch, error) {
+ if s == nil {
+ s = &Scratch{}
+ }
+ if s.MaxSymbolValue == 0 {
+ s.MaxSymbolValue = 255
+ }
+ if s.TableLog == 0 {
+ s.TableLog = defaultTablelog
+ }
+ if s.TableLog > maxTableLog {
+ return nil, fmt.Errorf("tableLog (%d) > maxTableLog (%d)", s.TableLog, maxTableLog)
+ }
+ if cap(s.Out) == 0 {
+ s.Out = make([]byte, 0, len(in))
+ }
+ if s.clearCount && s.maxCount == 0 {
+ for i := range s.count {
+ s.count[i] = 0
+ }
+ s.clearCount = false
+ }
+ s.br.init(in)
+ if s.DecompressLimit == 0 {
+ // Max size 2GB.
+ s.DecompressLimit = (2 << 30) - 1
+ }
+
+ return s, nil
+}
+
+// tableStep returns the next table index.
+func tableStep(tableSize uint32) uint32 {
+ return (tableSize >> 1) + (tableSize >> 3) + 3
+}
+
+func highBits(val uint32) (n uint32) {
+ return uint32(bits.Len32(val) - 1)
+}
diff --git a/vendor/github.com/klauspost/compress/gen.sh b/vendor/github.com/klauspost/compress/gen.sh
new file mode 100644
index 00000000..aff94220
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/gen.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+cd s2/cmd/_s2sx/ || exit 1
+go generate .
diff --git a/vendor/github.com/klauspost/compress/huff0/.gitignore b/vendor/github.com/klauspost/compress/huff0/.gitignore
new file mode 100644
index 00000000..b3d26295
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/huff0/.gitignore
@@ -0,0 +1 @@
+/huff0-fuzz.zip
diff --git a/vendor/github.com/klauspost/compress/huff0/README.md b/vendor/github.com/klauspost/compress/huff0/README.md
new file mode 100644
index 00000000..8b6e5c66
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/huff0/README.md
@@ -0,0 +1,89 @@
+# Huff0 entropy compression
+
+This package provides Huff0 encoding and decoding as used in zstd.
+
+[Huff0](https://github.com/Cyan4973/FiniteStateEntropy#new-generation-entropy-coders),
+a Huffman codec designed for modern CPU, featuring OoO (Out of Order) operations on multiple ALU
+(Arithmetic Logic Unit), achieving extremely fast compression and decompression speeds.
+
+This can be used for compressing input with a lot of similar input values to the smallest number of bytes.
+This does not perform any multi-byte [dictionary coding](https://en.wikipedia.org/wiki/Dictionary_coder) as LZ coders,
+but it can be used as a secondary step to compressors (like Snappy) that does not do entropy encoding.
+
+* [Godoc documentation](https://godoc.org/github.com/klauspost/compress/huff0)
+
+## News
+
+This is used as part of the [zstandard](https://github.com/klauspost/compress/tree/master/zstd#zstd) compression and decompression package.
+
+This ensures that most functionality is well tested.
+
+# Usage
+
+This package provides a low level interface that allows to compress single independent blocks.
+
+Each block is separate, and there is no built in integrity checks.
+This means that the caller should keep track of block sizes and also do checksums if needed.
+
+Compressing a block is done via the [`Compress1X`](https://godoc.org/github.com/klauspost/compress/huff0#Compress1X) and
+[`Compress4X`](https://godoc.org/github.com/klauspost/compress/huff0#Compress4X) functions.
+You must provide input and will receive the output and maybe an error.
+
+These error values can be returned:
+
+| Error | Description |
+|---------------------|-----------------------------------------------------------------------------|
+| `` | Everything ok, output is returned |
+| `ErrIncompressible` | Returned when input is judged to be too hard to compress |
+| `ErrUseRLE` | Returned from the compressor when the input is a single byte value repeated |
+| `ErrTooBig` | Returned if the input block exceeds the maximum allowed size (128 Kib) |
+| `(error)` | An internal error occurred. |
+
+
+As can be seen above some of there are errors that will be returned even under normal operation so it is important to handle these.
+
+To reduce allocations you can provide a [`Scratch`](https://godoc.org/github.com/klauspost/compress/huff0#Scratch) object
+that can be re-used for successive calls. Both compression and decompression accepts a `Scratch` object, and the same
+object can be used for both.
+
+Be aware, that when re-using a `Scratch` object that the *output* buffer is also re-used, so if you are still using this
+you must set the `Out` field in the scratch to nil. The same buffer is used for compression and decompression output.
+
+The `Scratch` object will retain state that allows to re-use previous tables for encoding and decoding.
+
+## Tables and re-use
+
+Huff0 allows for reusing tables from the previous block to save space if that is expected to give better/faster results.
+
+The Scratch object allows you to set a [`ReusePolicy`](https://godoc.org/github.com/klauspost/compress/huff0#ReusePolicy)
+that controls this behaviour. See the documentation for details. This can be altered between each block.
+
+Do however note that this information is *not* stored in the output block and it is up to the users of the package to
+record whether [`ReadTable`](https://godoc.org/github.com/klauspost/compress/huff0#ReadTable) should be called,
+based on the boolean reported back from the CompressXX call.
+
+If you want to store the table separate from the data, you can access them as `OutData` and `OutTable` on the
+[`Scratch`](https://godoc.org/github.com/klauspost/compress/huff0#Scratch) object.
+
+## Decompressing
+
+The first part of decoding is to initialize the decoding table through [`ReadTable`](https://godoc.org/github.com/klauspost/compress/huff0#ReadTable).
+This will initialize the decoding tables.
+You can supply the complete block to `ReadTable` and it will return the data part of the block
+which can be given to the decompressor.
+
+Decompressing is done by calling the [`Decompress1X`](https://godoc.org/github.com/klauspost/compress/huff0#Scratch.Decompress1X)
+or [`Decompress4X`](https://godoc.org/github.com/klauspost/compress/huff0#Scratch.Decompress4X) function.
+
+For concurrently decompressing content with a fixed table a stateless [`Decoder`](https://godoc.org/github.com/klauspost/compress/huff0#Decoder) can be requested which will remain correct as long as the scratch is unchanged. The capacity of the provided slice indicates the expected output size.
+
+You must provide the output from the compression stage, at exactly the size you got back. If you receive an error back
+your input was likely corrupted.
+
+It is important to note that a successful decoding does *not* mean your output matches your original input.
+There are no integrity checks, so relying on errors from the decompressor does not assure your data is valid.
+
+# Contributing
+
+Contributions are always welcome. Be aware that adding public functions will require good justification and breaking
+changes will likely not be accepted. If in doubt open an issue before writing the PR.
diff --git a/vendor/github.com/klauspost/compress/huff0/bitreader.go b/vendor/github.com/klauspost/compress/huff0/bitreader.go
new file mode 100644
index 00000000..e36d9742
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/huff0/bitreader.go
@@ -0,0 +1,229 @@
+// Copyright 2018 Klaus Post. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+// Based on work Copyright (c) 2013, Yann Collet, released under BSD License.
+
+package huff0
+
+import (
+ "encoding/binary"
+ "errors"
+ "fmt"
+ "io"
+)
+
+// bitReader reads a bitstream in reverse.
+// The last set bit indicates the start of the stream and is used
+// for aligning the input.
+type bitReaderBytes struct {
+ in []byte
+ off uint // next byte to read is at in[off - 1]
+ value uint64
+ bitsRead uint8
+}
+
+// init initializes and resets the bit reader.
+func (b *bitReaderBytes) init(in []byte) error {
+ if len(in) < 1 {
+ return errors.New("corrupt stream: too short")
+ }
+ b.in = in
+ b.off = uint(len(in))
+ // The highest bit of the last byte indicates where to start
+ v := in[len(in)-1]
+ if v == 0 {
+ return errors.New("corrupt stream, did not find end of stream")
+ }
+ b.bitsRead = 64
+ b.value = 0
+ if len(in) >= 8 {
+ b.fillFastStart()
+ } else {
+ b.fill()
+ b.fill()
+ }
+ b.advance(8 - uint8(highBit32(uint32(v))))
+ return nil
+}
+
+// peekBitsFast requires that at least one bit is requested every time.
+// There are no checks if the buffer is filled.
+func (b *bitReaderBytes) peekByteFast() uint8 {
+ got := uint8(b.value >> 56)
+ return got
+}
+
+func (b *bitReaderBytes) advance(n uint8) {
+ b.bitsRead += n
+ b.value <<= n & 63
+}
+
+// fillFast() will make sure at least 32 bits are available.
+// There must be at least 4 bytes available.
+func (b *bitReaderBytes) fillFast() {
+ if b.bitsRead < 32 {
+ return
+ }
+
+ // 2 bounds checks.
+ v := b.in[b.off-4 : b.off]
+ low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24)
+ b.value |= uint64(low) << (b.bitsRead - 32)
+ b.bitsRead -= 32
+ b.off -= 4
+}
+
+// fillFastStart() assumes the bitReaderBytes is empty and there is at least 8 bytes to read.
+func (b *bitReaderBytes) fillFastStart() {
+ // Do single re-slice to avoid bounds checks.
+ b.value = binary.LittleEndian.Uint64(b.in[b.off-8:])
+ b.bitsRead = 0
+ b.off -= 8
+}
+
+// fill() will make sure at least 32 bits are available.
+func (b *bitReaderBytes) fill() {
+ if b.bitsRead < 32 {
+ return
+ }
+ if b.off > 4 {
+ v := b.in[b.off-4 : b.off]
+ low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24)
+ b.value |= uint64(low) << (b.bitsRead - 32)
+ b.bitsRead -= 32
+ b.off -= 4
+ return
+ }
+ for b.off > 0 {
+ b.value |= uint64(b.in[b.off-1]) << (b.bitsRead - 8)
+ b.bitsRead -= 8
+ b.off--
+ }
+}
+
+// finished returns true if all bits have been read from the bit stream.
+func (b *bitReaderBytes) finished() bool {
+ return b.off == 0 && b.bitsRead >= 64
+}
+
+func (b *bitReaderBytes) remaining() uint {
+ return b.off*8 + uint(64-b.bitsRead)
+}
+
+// close the bitstream and returns an error if out-of-buffer reads occurred.
+func (b *bitReaderBytes) close() error {
+ // Release reference.
+ b.in = nil
+ if b.remaining() > 0 {
+ return fmt.Errorf("corrupt input: %d bits remain on stream", b.remaining())
+ }
+ if b.bitsRead > 64 {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+
+// bitReaderShifted reads a bitstream in reverse.
+// The last set bit indicates the start of the stream and is used
+// for aligning the input.
+type bitReaderShifted struct {
+ in []byte
+ off uint // next byte to read is at in[off - 1]
+ value uint64
+ bitsRead uint8
+}
+
+// init initializes and resets the bit reader.
+func (b *bitReaderShifted) init(in []byte) error {
+ if len(in) < 1 {
+ return errors.New("corrupt stream: too short")
+ }
+ b.in = in
+ b.off = uint(len(in))
+ // The highest bit of the last byte indicates where to start
+ v := in[len(in)-1]
+ if v == 0 {
+ return errors.New("corrupt stream, did not find end of stream")
+ }
+ b.bitsRead = 64
+ b.value = 0
+ if len(in) >= 8 {
+ b.fillFastStart()
+ } else {
+ b.fill()
+ b.fill()
+ }
+ b.advance(8 - uint8(highBit32(uint32(v))))
+ return nil
+}
+
+// peekBitsFast requires that at least one bit is requested every time.
+// There are no checks if the buffer is filled.
+func (b *bitReaderShifted) peekBitsFast(n uint8) uint16 {
+ return uint16(b.value >> ((64 - n) & 63))
+}
+
+func (b *bitReaderShifted) advance(n uint8) {
+ b.bitsRead += n
+ b.value <<= n & 63
+}
+
+// fillFast() will make sure at least 32 bits are available.
+// There must be at least 4 bytes available.
+func (b *bitReaderShifted) fillFast() {
+ if b.bitsRead < 32 {
+ return
+ }
+
+ // 2 bounds checks.
+ v := b.in[b.off-4 : b.off]
+ low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24)
+ b.value |= uint64(low) << ((b.bitsRead - 32) & 63)
+ b.bitsRead -= 32
+ b.off -= 4
+}
+
+// fillFastStart() assumes the bitReaderShifted is empty and there is at least 8 bytes to read.
+func (b *bitReaderShifted) fillFastStart() {
+ // Do single re-slice to avoid bounds checks.
+ b.value = binary.LittleEndian.Uint64(b.in[b.off-8:])
+ b.bitsRead = 0
+ b.off -= 8
+}
+
+// fill() will make sure at least 32 bits are available.
+func (b *bitReaderShifted) fill() {
+ if b.bitsRead < 32 {
+ return
+ }
+ if b.off > 4 {
+ v := b.in[b.off-4 : b.off]
+ low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24)
+ b.value |= uint64(low) << ((b.bitsRead - 32) & 63)
+ b.bitsRead -= 32
+ b.off -= 4
+ return
+ }
+ for b.off > 0 {
+ b.value |= uint64(b.in[b.off-1]) << ((b.bitsRead - 8) & 63)
+ b.bitsRead -= 8
+ b.off--
+ }
+}
+
+func (b *bitReaderShifted) remaining() uint {
+ return b.off*8 + uint(64-b.bitsRead)
+}
+
+// close the bitstream and returns an error if out-of-buffer reads occurred.
+func (b *bitReaderShifted) close() error {
+ // Release reference.
+ b.in = nil
+ if b.remaining() > 0 {
+ return fmt.Errorf("corrupt input: %d bits remain on stream", b.remaining())
+ }
+ if b.bitsRead > 64 {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
diff --git a/vendor/github.com/klauspost/compress/huff0/bitwriter.go b/vendor/github.com/klauspost/compress/huff0/bitwriter.go
new file mode 100644
index 00000000..0ebc9aaa
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/huff0/bitwriter.go
@@ -0,0 +1,102 @@
+// Copyright 2018 Klaus Post. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+// Based on work Copyright (c) 2013, Yann Collet, released under BSD License.
+
+package huff0
+
+// bitWriter will write bits.
+// First bit will be LSB of the first byte of output.
+type bitWriter struct {
+ bitContainer uint64
+ nBits uint8
+ out []byte
+}
+
+// addBits16Clean will add up to 16 bits. value may not contain more set bits than indicated.
+// It will not check if there is space for them, so the caller must ensure that it has flushed recently.
+func (b *bitWriter) addBits16Clean(value uint16, bits uint8) {
+ b.bitContainer |= uint64(value) << (b.nBits & 63)
+ b.nBits += bits
+}
+
+// encSymbol will add up to 16 bits. value may not contain more set bits than indicated.
+// It will not check if there is space for them, so the caller must ensure that it has flushed recently.
+func (b *bitWriter) encSymbol(ct cTable, symbol byte) {
+ enc := ct[symbol]
+ b.bitContainer |= uint64(enc.val) << (b.nBits & 63)
+ if false {
+ if enc.nBits == 0 {
+ panic("nbits 0")
+ }
+ }
+ b.nBits += enc.nBits
+}
+
+// encTwoSymbols will add up to 32 bits. value may not contain more set bits than indicated.
+// It will not check if there is space for them, so the caller must ensure that it has flushed recently.
+func (b *bitWriter) encTwoSymbols(ct cTable, av, bv byte) {
+ encA := ct[av]
+ encB := ct[bv]
+ sh := b.nBits & 63
+ combined := uint64(encA.val) | (uint64(encB.val) << (encA.nBits & 63))
+ b.bitContainer |= combined << sh
+ if false {
+ if encA.nBits == 0 {
+ panic("nbitsA 0")
+ }
+ if encB.nBits == 0 {
+ panic("nbitsB 0")
+ }
+ }
+ b.nBits += encA.nBits + encB.nBits
+}
+
+// encFourSymbols adds up to 32 bits from four symbols.
+// It will not check if there is space for them,
+// so the caller must ensure that b has been flushed recently.
+func (b *bitWriter) encFourSymbols(encA, encB, encC, encD cTableEntry) {
+ bitsA := encA.nBits
+ bitsB := bitsA + encB.nBits
+ bitsC := bitsB + encC.nBits
+ bitsD := bitsC + encD.nBits
+ combined := uint64(encA.val) |
+ (uint64(encB.val) << (bitsA & 63)) |
+ (uint64(encC.val) << (bitsB & 63)) |
+ (uint64(encD.val) << (bitsC & 63))
+ b.bitContainer |= combined << (b.nBits & 63)
+ b.nBits += bitsD
+}
+
+// flush32 will flush out, so there are at least 32 bits available for writing.
+func (b *bitWriter) flush32() {
+ if b.nBits < 32 {
+ return
+ }
+ b.out = append(b.out,
+ byte(b.bitContainer),
+ byte(b.bitContainer>>8),
+ byte(b.bitContainer>>16),
+ byte(b.bitContainer>>24))
+ b.nBits -= 32
+ b.bitContainer >>= 32
+}
+
+// flushAlign will flush remaining full bytes and align to next byte boundary.
+func (b *bitWriter) flushAlign() {
+ nbBytes := (b.nBits + 7) >> 3
+ for i := uint8(0); i < nbBytes; i++ {
+ b.out = append(b.out, byte(b.bitContainer>>(i*8)))
+ }
+ b.nBits = 0
+ b.bitContainer = 0
+}
+
+// close will write the alignment bit and write the final byte(s)
+// to the output.
+func (b *bitWriter) close() {
+ // End mark
+ b.addBits16Clean(1, 1)
+ // flush until next byte.
+ b.flushAlign()
+}
diff --git a/vendor/github.com/klauspost/compress/huff0/compress.go b/vendor/github.com/klauspost/compress/huff0/compress.go
new file mode 100644
index 00000000..84aa3d12
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/huff0/compress.go
@@ -0,0 +1,742 @@
+package huff0
+
+import (
+ "fmt"
+ "math"
+ "runtime"
+ "sync"
+)
+
+// Compress1X will compress the input.
+// The output can be decoded using Decompress1X.
+// Supply a Scratch object. The scratch object contains state about re-use,
+// So when sharing across independent encodes, be sure to set the re-use policy.
+func Compress1X(in []byte, s *Scratch) (out []byte, reUsed bool, err error) {
+ s, err = s.prepare(in)
+ if err != nil {
+ return nil, false, err
+ }
+ return compress(in, s, s.compress1X)
+}
+
+// Compress4X will compress the input. The input is split into 4 independent blocks
+// and compressed similar to Compress1X.
+// The output can be decoded using Decompress4X.
+// Supply a Scratch object. The scratch object contains state about re-use,
+// So when sharing across independent encodes, be sure to set the re-use policy.
+func Compress4X(in []byte, s *Scratch) (out []byte, reUsed bool, err error) {
+ s, err = s.prepare(in)
+ if err != nil {
+ return nil, false, err
+ }
+ if false {
+ // TODO: compress4Xp only slightly faster.
+ const parallelThreshold = 8 << 10
+ if len(in) < parallelThreshold || runtime.GOMAXPROCS(0) == 1 {
+ return compress(in, s, s.compress4X)
+ }
+ return compress(in, s, s.compress4Xp)
+ }
+ return compress(in, s, s.compress4X)
+}
+
+func compress(in []byte, s *Scratch, compressor func(src []byte) ([]byte, error)) (out []byte, reUsed bool, err error) {
+ // Nuke previous table if we cannot reuse anyway.
+ if s.Reuse == ReusePolicyNone {
+ s.prevTable = s.prevTable[:0]
+ }
+
+ // Create histogram, if none was provided.
+ maxCount := s.maxCount
+ var canReuse = false
+ if maxCount == 0 {
+ maxCount, canReuse = s.countSimple(in)
+ } else {
+ canReuse = s.canUseTable(s.prevTable)
+ }
+
+ // We want the output size to be less than this:
+ wantSize := len(in)
+ if s.WantLogLess > 0 {
+ wantSize -= wantSize >> s.WantLogLess
+ }
+
+ // Reset for next run.
+ s.clearCount = true
+ s.maxCount = 0
+ if maxCount >= len(in) {
+ if maxCount > len(in) {
+ return nil, false, fmt.Errorf("maxCount (%d) > length (%d)", maxCount, len(in))
+ }
+ if len(in) == 1 {
+ return nil, false, ErrIncompressible
+ }
+ // One symbol, use RLE
+ return nil, false, ErrUseRLE
+ }
+ if maxCount == 1 || maxCount < (len(in)>>7) {
+ // Each symbol present maximum once or too well distributed.
+ return nil, false, ErrIncompressible
+ }
+ if s.Reuse == ReusePolicyMust && !canReuse {
+ // We must reuse, but we can't.
+ return nil, false, ErrIncompressible
+ }
+ if (s.Reuse == ReusePolicyPrefer || s.Reuse == ReusePolicyMust) && canReuse {
+ keepTable := s.cTable
+ keepTL := s.actualTableLog
+ s.cTable = s.prevTable
+ s.actualTableLog = s.prevTableLog
+ s.Out, err = compressor(in)
+ s.cTable = keepTable
+ s.actualTableLog = keepTL
+ if err == nil && len(s.Out) < wantSize {
+ s.OutData = s.Out
+ return s.Out, true, nil
+ }
+ if s.Reuse == ReusePolicyMust {
+ return nil, false, ErrIncompressible
+ }
+ // Do not attempt to re-use later.
+ s.prevTable = s.prevTable[:0]
+ }
+
+ // Calculate new table.
+ err = s.buildCTable()
+ if err != nil {
+ return nil, false, err
+ }
+
+ if false && !s.canUseTable(s.cTable) {
+ panic("invalid table generated")
+ }
+
+ if s.Reuse == ReusePolicyAllow && canReuse {
+ hSize := len(s.Out)
+ oldSize := s.prevTable.estimateSize(s.count[:s.symbolLen])
+ newSize := s.cTable.estimateSize(s.count[:s.symbolLen])
+ if oldSize <= hSize+newSize || hSize+12 >= wantSize {
+ // Retain cTable even if we re-use.
+ keepTable := s.cTable
+ keepTL := s.actualTableLog
+
+ s.cTable = s.prevTable
+ s.actualTableLog = s.prevTableLog
+ s.Out, err = compressor(in)
+
+ // Restore ctable.
+ s.cTable = keepTable
+ s.actualTableLog = keepTL
+ if err != nil {
+ return nil, false, err
+ }
+ if len(s.Out) >= wantSize {
+ return nil, false, ErrIncompressible
+ }
+ s.OutData = s.Out
+ return s.Out, true, nil
+ }
+ }
+
+ // Use new table
+ err = s.cTable.write(s)
+ if err != nil {
+ s.OutTable = nil
+ return nil, false, err
+ }
+ s.OutTable = s.Out
+
+ // Compress using new table
+ s.Out, err = compressor(in)
+ if err != nil {
+ s.OutTable = nil
+ return nil, false, err
+ }
+ if len(s.Out) >= wantSize {
+ s.OutTable = nil
+ return nil, false, ErrIncompressible
+ }
+ // Move current table into previous.
+ s.prevTable, s.prevTableLog, s.cTable = s.cTable, s.actualTableLog, s.prevTable[:0]
+ s.OutData = s.Out[len(s.OutTable):]
+ return s.Out, false, nil
+}
+
+// EstimateSizes will estimate the data sizes
+func EstimateSizes(in []byte, s *Scratch) (tableSz, dataSz, reuseSz int, err error) {
+ s, err = s.prepare(in)
+ if err != nil {
+ return 0, 0, 0, err
+ }
+
+ // Create histogram, if none was provided.
+ tableSz, dataSz, reuseSz = -1, -1, -1
+ maxCount := s.maxCount
+ var canReuse = false
+ if maxCount == 0 {
+ maxCount, canReuse = s.countSimple(in)
+ } else {
+ canReuse = s.canUseTable(s.prevTable)
+ }
+
+ // We want the output size to be less than this:
+ wantSize := len(in)
+ if s.WantLogLess > 0 {
+ wantSize -= wantSize >> s.WantLogLess
+ }
+
+ // Reset for next run.
+ s.clearCount = true
+ s.maxCount = 0
+ if maxCount >= len(in) {
+ if maxCount > len(in) {
+ return 0, 0, 0, fmt.Errorf("maxCount (%d) > length (%d)", maxCount, len(in))
+ }
+ if len(in) == 1 {
+ return 0, 0, 0, ErrIncompressible
+ }
+ // One symbol, use RLE
+ return 0, 0, 0, ErrUseRLE
+ }
+ if maxCount == 1 || maxCount < (len(in)>>7) {
+ // Each symbol present maximum once or too well distributed.
+ return 0, 0, 0, ErrIncompressible
+ }
+
+ // Calculate new table.
+ err = s.buildCTable()
+ if err != nil {
+ return 0, 0, 0, err
+ }
+
+ if false && !s.canUseTable(s.cTable) {
+ panic("invalid table generated")
+ }
+
+ tableSz, err = s.cTable.estTableSize(s)
+ if err != nil {
+ return 0, 0, 0, err
+ }
+ if canReuse {
+ reuseSz = s.prevTable.estimateSize(s.count[:s.symbolLen])
+ }
+ dataSz = s.cTable.estimateSize(s.count[:s.symbolLen])
+
+ // Restore
+ return tableSz, dataSz, reuseSz, nil
+}
+
+func (s *Scratch) compress1X(src []byte) ([]byte, error) {
+ return s.compress1xDo(s.Out, src), nil
+}
+
+func (s *Scratch) compress1xDo(dst, src []byte) []byte {
+ var bw = bitWriter{out: dst}
+
+ // N is length divisible by 4.
+ n := len(src)
+ n -= n & 3
+ cTable := s.cTable[:256]
+
+ // Encode last bytes.
+ for i := len(src) & 3; i > 0; i-- {
+ bw.encSymbol(cTable, src[n+i-1])
+ }
+ n -= 4
+ if s.actualTableLog <= 8 {
+ for ; n >= 0; n -= 4 {
+ tmp := src[n : n+4]
+ // tmp should be len 4
+ bw.flush32()
+ bw.encFourSymbols(cTable[tmp[3]], cTable[tmp[2]], cTable[tmp[1]], cTable[tmp[0]])
+ }
+ } else {
+ for ; n >= 0; n -= 4 {
+ tmp := src[n : n+4]
+ // tmp should be len 4
+ bw.flush32()
+ bw.encTwoSymbols(cTable, tmp[3], tmp[2])
+ bw.flush32()
+ bw.encTwoSymbols(cTable, tmp[1], tmp[0])
+ }
+ }
+ bw.close()
+ return bw.out
+}
+
+var sixZeros [6]byte
+
+func (s *Scratch) compress4X(src []byte) ([]byte, error) {
+ if len(src) < 12 {
+ return nil, ErrIncompressible
+ }
+ segmentSize := (len(src) + 3) / 4
+
+ // Add placeholder for output length
+ offsetIdx := len(s.Out)
+ s.Out = append(s.Out, sixZeros[:]...)
+
+ for i := 0; i < 4; i++ {
+ toDo := src
+ if len(toDo) > segmentSize {
+ toDo = toDo[:segmentSize]
+ }
+ src = src[len(toDo):]
+
+ idx := len(s.Out)
+ s.Out = s.compress1xDo(s.Out, toDo)
+ if len(s.Out)-idx > math.MaxUint16 {
+ // We cannot store the size in the jump table
+ return nil, ErrIncompressible
+ }
+ // Write compressed length as little endian before block.
+ if i < 3 {
+ // Last length is not written.
+ length := len(s.Out) - idx
+ s.Out[i*2+offsetIdx] = byte(length)
+ s.Out[i*2+offsetIdx+1] = byte(length >> 8)
+ }
+ }
+
+ return s.Out, nil
+}
+
+// compress4Xp will compress 4 streams using separate goroutines.
+func (s *Scratch) compress4Xp(src []byte) ([]byte, error) {
+ if len(src) < 12 {
+ return nil, ErrIncompressible
+ }
+ // Add placeholder for output length
+ s.Out = s.Out[:6]
+
+ segmentSize := (len(src) + 3) / 4
+ var wg sync.WaitGroup
+ wg.Add(4)
+ for i := 0; i < 4; i++ {
+ toDo := src
+ if len(toDo) > segmentSize {
+ toDo = toDo[:segmentSize]
+ }
+ src = src[len(toDo):]
+
+ // Separate goroutine for each block.
+ go func(i int) {
+ s.tmpOut[i] = s.compress1xDo(s.tmpOut[i][:0], toDo)
+ wg.Done()
+ }(i)
+ }
+ wg.Wait()
+ for i := 0; i < 4; i++ {
+ o := s.tmpOut[i]
+ if len(o) > math.MaxUint16 {
+ // We cannot store the size in the jump table
+ return nil, ErrIncompressible
+ }
+ // Write compressed length as little endian before block.
+ if i < 3 {
+ // Last length is not written.
+ s.Out[i*2] = byte(len(o))
+ s.Out[i*2+1] = byte(len(o) >> 8)
+ }
+
+ // Write output.
+ s.Out = append(s.Out, o...)
+ }
+ return s.Out, nil
+}
+
+// countSimple will create a simple histogram in s.count.
+// Returns the biggest count.
+// Does not update s.clearCount.
+func (s *Scratch) countSimple(in []byte) (max int, reuse bool) {
+ reuse = true
+ _ = s.count // Assert that s != nil to speed up the following loop.
+ for _, v := range in {
+ s.count[v]++
+ }
+ m := uint32(0)
+ if len(s.prevTable) > 0 {
+ for i, v := range s.count[:] {
+ if v == 0 {
+ continue
+ }
+ if v > m {
+ m = v
+ }
+ s.symbolLen = uint16(i) + 1
+ if i >= len(s.prevTable) {
+ reuse = false
+ } else if s.prevTable[i].nBits == 0 {
+ reuse = false
+ }
+ }
+ return int(m), reuse
+ }
+ for i, v := range s.count[:] {
+ if v == 0 {
+ continue
+ }
+ if v > m {
+ m = v
+ }
+ s.symbolLen = uint16(i) + 1
+ }
+ return int(m), false
+}
+
+func (s *Scratch) canUseTable(c cTable) bool {
+ if len(c) < int(s.symbolLen) {
+ return false
+ }
+ for i, v := range s.count[:s.symbolLen] {
+ if v != 0 && c[i].nBits == 0 {
+ return false
+ }
+ }
+ return true
+}
+
+//lint:ignore U1000 used for debugging
+func (s *Scratch) validateTable(c cTable) bool {
+ if len(c) < int(s.symbolLen) {
+ return false
+ }
+ for i, v := range s.count[:s.symbolLen] {
+ if v != 0 {
+ if c[i].nBits == 0 {
+ return false
+ }
+ if c[i].nBits > s.actualTableLog {
+ return false
+ }
+ }
+ }
+ return true
+}
+
+// minTableLog provides the minimum logSize to safely represent a distribution.
+func (s *Scratch) minTableLog() uint8 {
+ minBitsSrc := highBit32(uint32(s.srcLen)) + 1
+ minBitsSymbols := highBit32(uint32(s.symbolLen-1)) + 2
+ if minBitsSrc < minBitsSymbols {
+ return uint8(minBitsSrc)
+ }
+ return uint8(minBitsSymbols)
+}
+
+// optimalTableLog calculates and sets the optimal tableLog in s.actualTableLog
+func (s *Scratch) optimalTableLog() {
+ tableLog := s.TableLog
+ minBits := s.minTableLog()
+ maxBitsSrc := uint8(highBit32(uint32(s.srcLen-1))) - 1
+ if maxBitsSrc < tableLog {
+ // Accuracy can be reduced
+ tableLog = maxBitsSrc
+ }
+ if minBits > tableLog {
+ tableLog = minBits
+ }
+ // Need a minimum to safely represent all symbol values
+ if tableLog < minTablelog {
+ tableLog = minTablelog
+ }
+ if tableLog > tableLogMax {
+ tableLog = tableLogMax
+ }
+ s.actualTableLog = tableLog
+}
+
+type cTableEntry struct {
+ val uint16
+ nBits uint8
+ // We have 8 bits extra
+}
+
+const huffNodesMask = huffNodesLen - 1
+
+func (s *Scratch) buildCTable() error {
+ s.optimalTableLog()
+ s.huffSort()
+ if cap(s.cTable) < maxSymbolValue+1 {
+ s.cTable = make([]cTableEntry, s.symbolLen, maxSymbolValue+1)
+ } else {
+ s.cTable = s.cTable[:s.symbolLen]
+ for i := range s.cTable {
+ s.cTable[i] = cTableEntry{}
+ }
+ }
+
+ var startNode = int16(s.symbolLen)
+ nonNullRank := s.symbolLen - 1
+
+ nodeNb := startNode
+ huffNode := s.nodes[1 : huffNodesLen+1]
+
+ // This overlays the slice above, but allows "-1" index lookups.
+ // Different from reference implementation.
+ huffNode0 := s.nodes[0 : huffNodesLen+1]
+
+ for huffNode[nonNullRank].count() == 0 {
+ nonNullRank--
+ }
+
+ lowS := int16(nonNullRank)
+ nodeRoot := nodeNb + lowS - 1
+ lowN := nodeNb
+ huffNode[nodeNb].setCount(huffNode[lowS].count() + huffNode[lowS-1].count())
+ huffNode[lowS].setParent(nodeNb)
+ huffNode[lowS-1].setParent(nodeNb)
+ nodeNb++
+ lowS -= 2
+ for n := nodeNb; n <= nodeRoot; n++ {
+ huffNode[n].setCount(1 << 30)
+ }
+ // fake entry, strong barrier
+ huffNode0[0].setCount(1 << 31)
+
+ // create parents
+ for nodeNb <= nodeRoot {
+ var n1, n2 int16
+ if huffNode0[lowS+1].count() < huffNode0[lowN+1].count() {
+ n1 = lowS
+ lowS--
+ } else {
+ n1 = lowN
+ lowN++
+ }
+ if huffNode0[lowS+1].count() < huffNode0[lowN+1].count() {
+ n2 = lowS
+ lowS--
+ } else {
+ n2 = lowN
+ lowN++
+ }
+
+ huffNode[nodeNb].setCount(huffNode0[n1+1].count() + huffNode0[n2+1].count())
+ huffNode0[n1+1].setParent(nodeNb)
+ huffNode0[n2+1].setParent(nodeNb)
+ nodeNb++
+ }
+
+ // distribute weights (unlimited tree height)
+ huffNode[nodeRoot].setNbBits(0)
+ for n := nodeRoot - 1; n >= startNode; n-- {
+ huffNode[n].setNbBits(huffNode[huffNode[n].parent()].nbBits() + 1)
+ }
+ for n := uint16(0); n <= nonNullRank; n++ {
+ huffNode[n].setNbBits(huffNode[huffNode[n].parent()].nbBits() + 1)
+ }
+ s.actualTableLog = s.setMaxHeight(int(nonNullRank))
+ maxNbBits := s.actualTableLog
+
+ // fill result into tree (val, nbBits)
+ if maxNbBits > tableLogMax {
+ return fmt.Errorf("internal error: maxNbBits (%d) > tableLogMax (%d)", maxNbBits, tableLogMax)
+ }
+ var nbPerRank [tableLogMax + 1]uint16
+ var valPerRank [16]uint16
+ for _, v := range huffNode[:nonNullRank+1] {
+ nbPerRank[v.nbBits()]++
+ }
+ // determine stating value per rank
+ {
+ min := uint16(0)
+ for n := maxNbBits; n > 0; n-- {
+ // get starting value within each rank
+ valPerRank[n] = min
+ min += nbPerRank[n]
+ min >>= 1
+ }
+ }
+
+ // push nbBits per symbol, symbol order
+ for _, v := range huffNode[:nonNullRank+1] {
+ s.cTable[v.symbol()].nBits = v.nbBits()
+ }
+
+ // assign value within rank, symbol order
+ t := s.cTable[:s.symbolLen]
+ for n, val := range t {
+ nbits := val.nBits & 15
+ v := valPerRank[nbits]
+ t[n].val = v
+ valPerRank[nbits] = v + 1
+ }
+
+ return nil
+}
+
+// huffSort will sort symbols, decreasing order.
+func (s *Scratch) huffSort() {
+ type rankPos struct {
+ base uint32
+ current uint32
+ }
+
+ // Clear nodes
+ nodes := s.nodes[:huffNodesLen+1]
+ s.nodes = nodes
+ nodes = nodes[1 : huffNodesLen+1]
+
+ // Sort into buckets based on length of symbol count.
+ var rank [32]rankPos
+ for _, v := range s.count[:s.symbolLen] {
+ r := highBit32(v+1) & 31
+ rank[r].base++
+ }
+ // maxBitLength is log2(BlockSizeMax) + 1
+ const maxBitLength = 18 + 1
+ for n := maxBitLength; n > 0; n-- {
+ rank[n-1].base += rank[n].base
+ }
+ for n := range rank[:maxBitLength] {
+ rank[n].current = rank[n].base
+ }
+ for n, c := range s.count[:s.symbolLen] {
+ r := (highBit32(c+1) + 1) & 31
+ pos := rank[r].current
+ rank[r].current++
+ prev := nodes[(pos-1)&huffNodesMask]
+ for pos > rank[r].base && c > prev.count() {
+ nodes[pos&huffNodesMask] = prev
+ pos--
+ prev = nodes[(pos-1)&huffNodesMask]
+ }
+ nodes[pos&huffNodesMask] = makeNodeElt(c, byte(n))
+ }
+}
+
+func (s *Scratch) setMaxHeight(lastNonNull int) uint8 {
+ maxNbBits := s.actualTableLog
+ huffNode := s.nodes[1 : huffNodesLen+1]
+ //huffNode = huffNode[: huffNodesLen]
+
+ largestBits := huffNode[lastNonNull].nbBits()
+
+ // early exit : no elt > maxNbBits
+ if largestBits <= maxNbBits {
+ return largestBits
+ }
+ totalCost := int(0)
+ baseCost := int(1) << (largestBits - maxNbBits)
+ n := uint32(lastNonNull)
+
+ for huffNode[n].nbBits() > maxNbBits {
+ totalCost += baseCost - (1 << (largestBits - huffNode[n].nbBits()))
+ huffNode[n].setNbBits(maxNbBits)
+ n--
+ }
+ // n stops at huffNode[n].nbBits <= maxNbBits
+
+ for huffNode[n].nbBits() == maxNbBits {
+ n--
+ }
+ // n end at index of smallest symbol using < maxNbBits
+
+ // renorm totalCost
+ totalCost >>= largestBits - maxNbBits /* note : totalCost is necessarily a multiple of baseCost */
+
+ // repay normalized cost
+ {
+ const noSymbol = 0xF0F0F0F0
+ var rankLast [tableLogMax + 2]uint32
+
+ for i := range rankLast[:] {
+ rankLast[i] = noSymbol
+ }
+
+ // Get pos of last (smallest) symbol per rank
+ {
+ currentNbBits := maxNbBits
+ for pos := int(n); pos >= 0; pos-- {
+ if huffNode[pos].nbBits() >= currentNbBits {
+ continue
+ }
+ currentNbBits = huffNode[pos].nbBits() // < maxNbBits
+ rankLast[maxNbBits-currentNbBits] = uint32(pos)
+ }
+ }
+
+ for totalCost > 0 {
+ nBitsToDecrease := uint8(highBit32(uint32(totalCost))) + 1
+
+ for ; nBitsToDecrease > 1; nBitsToDecrease-- {
+ highPos := rankLast[nBitsToDecrease]
+ lowPos := rankLast[nBitsToDecrease-1]
+ if highPos == noSymbol {
+ continue
+ }
+ if lowPos == noSymbol {
+ break
+ }
+ highTotal := huffNode[highPos].count()
+ lowTotal := 2 * huffNode[lowPos].count()
+ if highTotal <= lowTotal {
+ break
+ }
+ }
+ // only triggered when no more rank 1 symbol left => find closest one (note : there is necessarily at least one !)
+ // HUF_MAX_TABLELOG test just to please gcc 5+; but it should not be necessary
+ // FIXME: try to remove
+ for (nBitsToDecrease <= tableLogMax) && (rankLast[nBitsToDecrease] == noSymbol) {
+ nBitsToDecrease++
+ }
+ totalCost -= 1 << (nBitsToDecrease - 1)
+ if rankLast[nBitsToDecrease-1] == noSymbol {
+ // this rank is no longer empty
+ rankLast[nBitsToDecrease-1] = rankLast[nBitsToDecrease]
+ }
+ huffNode[rankLast[nBitsToDecrease]].setNbBits(1 +
+ huffNode[rankLast[nBitsToDecrease]].nbBits())
+ if rankLast[nBitsToDecrease] == 0 {
+ /* special case, reached largest symbol */
+ rankLast[nBitsToDecrease] = noSymbol
+ } else {
+ rankLast[nBitsToDecrease]--
+ if huffNode[rankLast[nBitsToDecrease]].nbBits() != maxNbBits-nBitsToDecrease {
+ rankLast[nBitsToDecrease] = noSymbol /* this rank is now empty */
+ }
+ }
+ }
+
+ for totalCost < 0 { /* Sometimes, cost correction overshoot */
+ if rankLast[1] == noSymbol { /* special case : no rank 1 symbol (using maxNbBits-1); let's create one from largest rank 0 (using maxNbBits) */
+ for huffNode[n].nbBits() == maxNbBits {
+ n--
+ }
+ huffNode[n+1].setNbBits(huffNode[n+1].nbBits() - 1)
+ rankLast[1] = n + 1
+ totalCost++
+ continue
+ }
+ huffNode[rankLast[1]+1].setNbBits(huffNode[rankLast[1]+1].nbBits() - 1)
+ rankLast[1]++
+ totalCost++
+ }
+ }
+ return maxNbBits
+}
+
+// A nodeElt is the fields
+//
+// count uint32
+// parent uint16
+// symbol byte
+// nbBits uint8
+//
+// in some order, all squashed into an integer so that the compiler
+// always loads and stores entire nodeElts instead of separate fields.
+type nodeElt uint64
+
+func makeNodeElt(count uint32, symbol byte) nodeElt {
+ return nodeElt(count) | nodeElt(symbol)<<48
+}
+
+func (e *nodeElt) count() uint32 { return uint32(*e) }
+func (e *nodeElt) parent() uint16 { return uint16(*e >> 32) }
+func (e *nodeElt) symbol() byte { return byte(*e >> 48) }
+func (e *nodeElt) nbBits() uint8 { return uint8(*e >> 56) }
+
+func (e *nodeElt) setCount(c uint32) { *e = (*e)&0xffffffff00000000 | nodeElt(c) }
+func (e *nodeElt) setParent(p int16) { *e = (*e)&0xffff0000ffffffff | nodeElt(uint16(p))<<32 }
+func (e *nodeElt) setNbBits(n uint8) { *e = (*e)&0x00ffffffffffffff | nodeElt(n)<<56 }
diff --git a/vendor/github.com/klauspost/compress/huff0/decompress.go b/vendor/github.com/klauspost/compress/huff0/decompress.go
new file mode 100644
index 00000000..0f56b02d
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/huff0/decompress.go
@@ -0,0 +1,1167 @@
+package huff0
+
+import (
+ "errors"
+ "fmt"
+ "io"
+ "sync"
+
+ "github.com/klauspost/compress/fse"
+)
+
+type dTable struct {
+ single []dEntrySingle
+}
+
+// single-symbols decoding
+type dEntrySingle struct {
+ entry uint16
+}
+
+// Uses special code for all tables that are < 8 bits.
+const use8BitTables = true
+
+// ReadTable will read a table from the input.
+// The size of the input may be larger than the table definition.
+// Any content remaining after the table definition will be returned.
+// If no Scratch is provided a new one is allocated.
+// The returned Scratch can be used for encoding or decoding input using this table.
+func ReadTable(in []byte, s *Scratch) (s2 *Scratch, remain []byte, err error) {
+ s, err = s.prepare(nil)
+ if err != nil {
+ return s, nil, err
+ }
+ if len(in) <= 1 {
+ return s, nil, errors.New("input too small for table")
+ }
+ iSize := in[0]
+ in = in[1:]
+ if iSize >= 128 {
+ // Uncompressed
+ oSize := iSize - 127
+ iSize = (oSize + 1) / 2
+ if int(iSize) > len(in) {
+ return s, nil, errors.New("input too small for table")
+ }
+ for n := uint8(0); n < oSize; n += 2 {
+ v := in[n/2]
+ s.huffWeight[n] = v >> 4
+ s.huffWeight[n+1] = v & 15
+ }
+ s.symbolLen = uint16(oSize)
+ in = in[iSize:]
+ } else {
+ if len(in) < int(iSize) {
+ return s, nil, fmt.Errorf("input too small for table, want %d bytes, have %d", iSize, len(in))
+ }
+ // FSE compressed weights
+ s.fse.DecompressLimit = 255
+ hw := s.huffWeight[:]
+ s.fse.Out = hw
+ b, err := fse.Decompress(in[:iSize], s.fse)
+ s.fse.Out = nil
+ if err != nil {
+ return s, nil, fmt.Errorf("fse decompress returned: %w", err)
+ }
+ if len(b) > 255 {
+ return s, nil, errors.New("corrupt input: output table too large")
+ }
+ s.symbolLen = uint16(len(b))
+ in = in[iSize:]
+ }
+
+ // collect weight stats
+ var rankStats [16]uint32
+ weightTotal := uint32(0)
+ for _, v := range s.huffWeight[:s.symbolLen] {
+ if v > tableLogMax {
+ return s, nil, errors.New("corrupt input: weight too large")
+ }
+ v2 := v & 15
+ rankStats[v2]++
+ // (1 << (v2-1)) is slower since the compiler cannot prove that v2 isn't 0.
+ weightTotal += (1 << v2) >> 1
+ }
+ if weightTotal == 0 {
+ return s, nil, errors.New("corrupt input: weights zero")
+ }
+
+ // get last non-null symbol weight (implied, total must be 2^n)
+ {
+ tableLog := highBit32(weightTotal) + 1
+ if tableLog > tableLogMax {
+ return s, nil, errors.New("corrupt input: tableLog too big")
+ }
+ s.actualTableLog = uint8(tableLog)
+ // determine last weight
+ {
+ total := uint32(1) << tableLog
+ rest := total - weightTotal
+ verif := uint32(1) << highBit32(rest)
+ lastWeight := highBit32(rest) + 1
+ if verif != rest {
+ // last value must be a clean power of 2
+ return s, nil, errors.New("corrupt input: last value not power of two")
+ }
+ s.huffWeight[s.symbolLen] = uint8(lastWeight)
+ s.symbolLen++
+ rankStats[lastWeight]++
+ }
+ }
+
+ if (rankStats[1] < 2) || (rankStats[1]&1 != 0) {
+ // by construction : at least 2 elts of rank 1, must be even
+ return s, nil, errors.New("corrupt input: min elt size, even check failed ")
+ }
+
+ // TODO: Choose between single/double symbol decoding
+
+ // Calculate starting value for each rank
+ {
+ var nextRankStart uint32
+ for n := uint8(1); n < s.actualTableLog+1; n++ {
+ current := nextRankStart
+ nextRankStart += rankStats[n] << (n - 1)
+ rankStats[n] = current
+ }
+ }
+
+ // fill DTable (always full size)
+ tSize := 1 << tableLogMax
+ if len(s.dt.single) != tSize {
+ s.dt.single = make([]dEntrySingle, tSize)
+ }
+ cTable := s.prevTable
+ if cap(cTable) < maxSymbolValue+1 {
+ cTable = make([]cTableEntry, 0, maxSymbolValue+1)
+ }
+ cTable = cTable[:maxSymbolValue+1]
+ s.prevTable = cTable[:s.symbolLen]
+ s.prevTableLog = s.actualTableLog
+
+ for n, w := range s.huffWeight[:s.symbolLen] {
+ if w == 0 {
+ cTable[n] = cTableEntry{
+ val: 0,
+ nBits: 0,
+ }
+ continue
+ }
+ length := (uint32(1) << w) >> 1
+ d := dEntrySingle{
+ entry: uint16(s.actualTableLog+1-w) | (uint16(n) << 8),
+ }
+
+ rank := &rankStats[w]
+ cTable[n] = cTableEntry{
+ val: uint16(*rank >> (w - 1)),
+ nBits: uint8(d.entry),
+ }
+
+ single := s.dt.single[*rank : *rank+length]
+ for i := range single {
+ single[i] = d
+ }
+ *rank += length
+ }
+
+ return s, in, nil
+}
+
+// Decompress1X will decompress a 1X encoded stream.
+// The length of the supplied input must match the end of a block exactly.
+// Before this is called, the table must be initialized with ReadTable unless
+// the encoder re-used the table.
+// deprecated: Use the stateless Decoder() to get a concurrent version.
+func (s *Scratch) Decompress1X(in []byte) (out []byte, err error) {
+ if cap(s.Out) < s.MaxDecodedSize {
+ s.Out = make([]byte, s.MaxDecodedSize)
+ }
+ s.Out = s.Out[:0:s.MaxDecodedSize]
+ s.Out, err = s.Decoder().Decompress1X(s.Out, in)
+ return s.Out, err
+}
+
+// Decompress4X will decompress a 4X encoded stream.
+// Before this is called, the table must be initialized with ReadTable unless
+// the encoder re-used the table.
+// The length of the supplied input must match the end of a block exactly.
+// The destination size of the uncompressed data must be known and provided.
+// deprecated: Use the stateless Decoder() to get a concurrent version.
+func (s *Scratch) Decompress4X(in []byte, dstSize int) (out []byte, err error) {
+ if dstSize > s.MaxDecodedSize {
+ return nil, ErrMaxDecodedSizeExceeded
+ }
+ if cap(s.Out) < dstSize {
+ s.Out = make([]byte, s.MaxDecodedSize)
+ }
+ s.Out = s.Out[:0:dstSize]
+ s.Out, err = s.Decoder().Decompress4X(s.Out, in)
+ return s.Out, err
+}
+
+// Decoder will return a stateless decoder that can be used by multiple
+// decompressors concurrently.
+// Before this is called, the table must be initialized with ReadTable.
+// The Decoder is still linked to the scratch buffer so that cannot be reused.
+// However, it is safe to discard the scratch.
+func (s *Scratch) Decoder() *Decoder {
+ return &Decoder{
+ dt: s.dt,
+ actualTableLog: s.actualTableLog,
+ bufs: &s.decPool,
+ }
+}
+
+// Decoder provides stateless decoding.
+type Decoder struct {
+ dt dTable
+ actualTableLog uint8
+ bufs *sync.Pool
+}
+
+func (d *Decoder) buffer() *[4][256]byte {
+ buf, ok := d.bufs.Get().(*[4][256]byte)
+ if ok {
+ return buf
+ }
+ return &[4][256]byte{}
+}
+
+// decompress1X8Bit will decompress a 1X encoded stream with tablelog <= 8.
+// The cap of the output buffer will be the maximum decompressed size.
+// The length of the supplied input must match the end of a block exactly.
+func (d *Decoder) decompress1X8Bit(dst, src []byte) ([]byte, error) {
+ if d.actualTableLog == 8 {
+ return d.decompress1X8BitExactly(dst, src)
+ }
+ var br bitReaderBytes
+ err := br.init(src)
+ if err != nil {
+ return dst, err
+ }
+ maxDecodedSize := cap(dst)
+ dst = dst[:0]
+
+ // Avoid bounds check by always having full sized table.
+ dt := d.dt.single[:256]
+
+ // Use temp table to avoid bound checks/append penalty.
+ bufs := d.buffer()
+ buf := &bufs[0]
+ var off uint8
+
+ switch d.actualTableLog {
+ case 8:
+ const shift = 0
+ for br.off >= 4 {
+ br.fillFast()
+ v := dt[uint8(br.value>>(56+shift))]
+ br.advance(uint8(v.entry))
+ buf[off+0] = uint8(v.entry >> 8)
+
+ v = dt[uint8(br.value>>(56+shift))]
+ br.advance(uint8(v.entry))
+ buf[off+1] = uint8(v.entry >> 8)
+
+ v = dt[uint8(br.value>>(56+shift))]
+ br.advance(uint8(v.entry))
+ buf[off+2] = uint8(v.entry >> 8)
+
+ v = dt[uint8(br.value>>(56+shift))]
+ br.advance(uint8(v.entry))
+ buf[off+3] = uint8(v.entry >> 8)
+
+ off += 4
+ if off == 0 {
+ if len(dst)+256 > maxDecodedSize {
+ br.close()
+ d.bufs.Put(bufs)
+ return nil, ErrMaxDecodedSizeExceeded
+ }
+ dst = append(dst, buf[:]...)
+ }
+ }
+ case 7:
+ const shift = 8 - 7
+ for br.off >= 4 {
+ br.fillFast()
+ v := dt[uint8(br.value>>(56+shift))]
+ br.advance(uint8(v.entry))
+ buf[off+0] = uint8(v.entry >> 8)
+
+ v = dt[uint8(br.value>>(56+shift))]
+ br.advance(uint8(v.entry))
+ buf[off+1] = uint8(v.entry >> 8)
+
+ v = dt[uint8(br.value>>(56+shift))]
+ br.advance(uint8(v.entry))
+ buf[off+2] = uint8(v.entry >> 8)
+
+ v = dt[uint8(br.value>>(56+shift))]
+ br.advance(uint8(v.entry))
+ buf[off+3] = uint8(v.entry >> 8)
+
+ off += 4
+ if off == 0 {
+ if len(dst)+256 > maxDecodedSize {
+ br.close()
+ d.bufs.Put(bufs)
+ return nil, ErrMaxDecodedSizeExceeded
+ }
+ dst = append(dst, buf[:]...)
+ }
+ }
+ case 6:
+ const shift = 8 - 6
+ for br.off >= 4 {
+ br.fillFast()
+ v := dt[uint8(br.value>>(56+shift))]
+ br.advance(uint8(v.entry))
+ buf[off+0] = uint8(v.entry >> 8)
+
+ v = dt[uint8(br.value>>(56+shift))]
+ br.advance(uint8(v.entry))
+ buf[off+1] = uint8(v.entry >> 8)
+
+ v = dt[uint8(br.value>>(56+shift))]
+ br.advance(uint8(v.entry))
+ buf[off+2] = uint8(v.entry >> 8)
+
+ v = dt[uint8(br.value>>(56+shift))]
+ br.advance(uint8(v.entry))
+ buf[off+3] = uint8(v.entry >> 8)
+
+ off += 4
+ if off == 0 {
+ if len(dst)+256 > maxDecodedSize {
+ d.bufs.Put(bufs)
+ br.close()
+ return nil, ErrMaxDecodedSizeExceeded
+ }
+ dst = append(dst, buf[:]...)
+ }
+ }
+ case 5:
+ const shift = 8 - 5
+ for br.off >= 4 {
+ br.fillFast()
+ v := dt[uint8(br.value>>(56+shift))]
+ br.advance(uint8(v.entry))
+ buf[off+0] = uint8(v.entry >> 8)
+
+ v = dt[uint8(br.value>>(56+shift))]
+ br.advance(uint8(v.entry))
+ buf[off+1] = uint8(v.entry >> 8)
+
+ v = dt[uint8(br.value>>(56+shift))]
+ br.advance(uint8(v.entry))
+ buf[off+2] = uint8(v.entry >> 8)
+
+ v = dt[uint8(br.value>>(56+shift))]
+ br.advance(uint8(v.entry))
+ buf[off+3] = uint8(v.entry >> 8)
+
+ off += 4
+ if off == 0 {
+ if len(dst)+256 > maxDecodedSize {
+ d.bufs.Put(bufs)
+ br.close()
+ return nil, ErrMaxDecodedSizeExceeded
+ }
+ dst = append(dst, buf[:]...)
+ }
+ }
+ case 4:
+ const shift = 8 - 4
+ for br.off >= 4 {
+ br.fillFast()
+ v := dt[uint8(br.value>>(56+shift))]
+ br.advance(uint8(v.entry))
+ buf[off+0] = uint8(v.entry >> 8)
+
+ v = dt[uint8(br.value>>(56+shift))]
+ br.advance(uint8(v.entry))
+ buf[off+1] = uint8(v.entry >> 8)
+
+ v = dt[uint8(br.value>>(56+shift))]
+ br.advance(uint8(v.entry))
+ buf[off+2] = uint8(v.entry >> 8)
+
+ v = dt[uint8(br.value>>(56+shift))]
+ br.advance(uint8(v.entry))
+ buf[off+3] = uint8(v.entry >> 8)
+
+ off += 4
+ if off == 0 {
+ if len(dst)+256 > maxDecodedSize {
+ d.bufs.Put(bufs)
+ br.close()
+ return nil, ErrMaxDecodedSizeExceeded
+ }
+ dst = append(dst, buf[:]...)
+ }
+ }
+ case 3:
+ const shift = 8 - 3
+ for br.off >= 4 {
+ br.fillFast()
+ v := dt[uint8(br.value>>(56+shift))]
+ br.advance(uint8(v.entry))
+ buf[off+0] = uint8(v.entry >> 8)
+
+ v = dt[uint8(br.value>>(56+shift))]
+ br.advance(uint8(v.entry))
+ buf[off+1] = uint8(v.entry >> 8)
+
+ v = dt[uint8(br.value>>(56+shift))]
+ br.advance(uint8(v.entry))
+ buf[off+2] = uint8(v.entry >> 8)
+
+ v = dt[uint8(br.value>>(56+shift))]
+ br.advance(uint8(v.entry))
+ buf[off+3] = uint8(v.entry >> 8)
+
+ off += 4
+ if off == 0 {
+ if len(dst)+256 > maxDecodedSize {
+ d.bufs.Put(bufs)
+ br.close()
+ return nil, ErrMaxDecodedSizeExceeded
+ }
+ dst = append(dst, buf[:]...)
+ }
+ }
+ case 2:
+ const shift = 8 - 2
+ for br.off >= 4 {
+ br.fillFast()
+ v := dt[uint8(br.value>>(56+shift))]
+ br.advance(uint8(v.entry))
+ buf[off+0] = uint8(v.entry >> 8)
+
+ v = dt[uint8(br.value>>(56+shift))]
+ br.advance(uint8(v.entry))
+ buf[off+1] = uint8(v.entry >> 8)
+
+ v = dt[uint8(br.value>>(56+shift))]
+ br.advance(uint8(v.entry))
+ buf[off+2] = uint8(v.entry >> 8)
+
+ v = dt[uint8(br.value>>(56+shift))]
+ br.advance(uint8(v.entry))
+ buf[off+3] = uint8(v.entry >> 8)
+
+ off += 4
+ if off == 0 {
+ if len(dst)+256 > maxDecodedSize {
+ d.bufs.Put(bufs)
+ br.close()
+ return nil, ErrMaxDecodedSizeExceeded
+ }
+ dst = append(dst, buf[:]...)
+ }
+ }
+ case 1:
+ const shift = 8 - 1
+ for br.off >= 4 {
+ br.fillFast()
+ v := dt[uint8(br.value>>(56+shift))]
+ br.advance(uint8(v.entry))
+ buf[off+0] = uint8(v.entry >> 8)
+
+ v = dt[uint8(br.value>>(56+shift))]
+ br.advance(uint8(v.entry))
+ buf[off+1] = uint8(v.entry >> 8)
+
+ v = dt[uint8(br.value>>(56+shift))]
+ br.advance(uint8(v.entry))
+ buf[off+2] = uint8(v.entry >> 8)
+
+ v = dt[uint8(br.value>>(56+shift))]
+ br.advance(uint8(v.entry))
+ buf[off+3] = uint8(v.entry >> 8)
+
+ off += 4
+ if off == 0 {
+ if len(dst)+256 > maxDecodedSize {
+ d.bufs.Put(bufs)
+ br.close()
+ return nil, ErrMaxDecodedSizeExceeded
+ }
+ dst = append(dst, buf[:]...)
+ }
+ }
+ default:
+ d.bufs.Put(bufs)
+ return nil, fmt.Errorf("invalid tablelog: %d", d.actualTableLog)
+ }
+
+ if len(dst)+int(off) > maxDecodedSize {
+ d.bufs.Put(bufs)
+ br.close()
+ return nil, ErrMaxDecodedSizeExceeded
+ }
+ dst = append(dst, buf[:off]...)
+
+ // br < 4, so uint8 is fine
+ bitsLeft := int8(uint8(br.off)*8 + (64 - br.bitsRead))
+ shift := (8 - d.actualTableLog) & 7
+
+ for bitsLeft > 0 {
+ if br.bitsRead >= 64-8 {
+ for br.off > 0 {
+ br.value |= uint64(br.in[br.off-1]) << (br.bitsRead - 8)
+ br.bitsRead -= 8
+ br.off--
+ }
+ }
+ if len(dst) >= maxDecodedSize {
+ br.close()
+ d.bufs.Put(bufs)
+ return nil, ErrMaxDecodedSizeExceeded
+ }
+ v := dt[br.peekByteFast()>>shift]
+ nBits := uint8(v.entry)
+ br.advance(nBits)
+ bitsLeft -= int8(nBits)
+ dst = append(dst, uint8(v.entry>>8))
+ }
+ d.bufs.Put(bufs)
+ return dst, br.close()
+}
+
+// decompress1X8Bit will decompress a 1X encoded stream with tablelog <= 8.
+// The cap of the output buffer will be the maximum decompressed size.
+// The length of the supplied input must match the end of a block exactly.
+func (d *Decoder) decompress1X8BitExactly(dst, src []byte) ([]byte, error) {
+ var br bitReaderBytes
+ err := br.init(src)
+ if err != nil {
+ return dst, err
+ }
+ maxDecodedSize := cap(dst)
+ dst = dst[:0]
+
+ // Avoid bounds check by always having full sized table.
+ dt := d.dt.single[:256]
+
+ // Use temp table to avoid bound checks/append penalty.
+ bufs := d.buffer()
+ buf := &bufs[0]
+ var off uint8
+
+ const shift = 56
+
+ //fmt.Printf("mask: %b, tl:%d\n", mask, d.actualTableLog)
+ for br.off >= 4 {
+ br.fillFast()
+ v := dt[uint8(br.value>>shift)]
+ br.advance(uint8(v.entry))
+ buf[off+0] = uint8(v.entry >> 8)
+
+ v = dt[uint8(br.value>>shift)]
+ br.advance(uint8(v.entry))
+ buf[off+1] = uint8(v.entry >> 8)
+
+ v = dt[uint8(br.value>>shift)]
+ br.advance(uint8(v.entry))
+ buf[off+2] = uint8(v.entry >> 8)
+
+ v = dt[uint8(br.value>>shift)]
+ br.advance(uint8(v.entry))
+ buf[off+3] = uint8(v.entry >> 8)
+
+ off += 4
+ if off == 0 {
+ if len(dst)+256 > maxDecodedSize {
+ d.bufs.Put(bufs)
+ br.close()
+ return nil, ErrMaxDecodedSizeExceeded
+ }
+ dst = append(dst, buf[:]...)
+ }
+ }
+
+ if len(dst)+int(off) > maxDecodedSize {
+ d.bufs.Put(bufs)
+ br.close()
+ return nil, ErrMaxDecodedSizeExceeded
+ }
+ dst = append(dst, buf[:off]...)
+
+ // br < 4, so uint8 is fine
+ bitsLeft := int8(uint8(br.off)*8 + (64 - br.bitsRead))
+ for bitsLeft > 0 {
+ if br.bitsRead >= 64-8 {
+ for br.off > 0 {
+ br.value |= uint64(br.in[br.off-1]) << (br.bitsRead - 8)
+ br.bitsRead -= 8
+ br.off--
+ }
+ }
+ if len(dst) >= maxDecodedSize {
+ d.bufs.Put(bufs)
+ br.close()
+ return nil, ErrMaxDecodedSizeExceeded
+ }
+ v := dt[br.peekByteFast()]
+ nBits := uint8(v.entry)
+ br.advance(nBits)
+ bitsLeft -= int8(nBits)
+ dst = append(dst, uint8(v.entry>>8))
+ }
+ d.bufs.Put(bufs)
+ return dst, br.close()
+}
+
+// Decompress4X will decompress a 4X encoded stream.
+// The length of the supplied input must match the end of a block exactly.
+// The *capacity* of the dst slice must match the destination size of
+// the uncompressed data exactly.
+func (d *Decoder) decompress4X8bit(dst, src []byte) ([]byte, error) {
+ if d.actualTableLog == 8 {
+ return d.decompress4X8bitExactly(dst, src)
+ }
+
+ var br [4]bitReaderBytes
+ start := 6
+ for i := 0; i < 3; i++ {
+ length := int(src[i*2]) | (int(src[i*2+1]) << 8)
+ if start+length >= len(src) {
+ return nil, errors.New("truncated input (or invalid offset)")
+ }
+ err := br[i].init(src[start : start+length])
+ if err != nil {
+ return nil, err
+ }
+ start += length
+ }
+ err := br[3].init(src[start:])
+ if err != nil {
+ return nil, err
+ }
+
+ // destination, offset to match first output
+ dstSize := cap(dst)
+ dst = dst[:dstSize]
+ out := dst
+ dstEvery := (dstSize + 3) / 4
+
+ shift := (56 + (8 - d.actualTableLog)) & 63
+
+ const tlSize = 1 << 8
+ single := d.dt.single[:tlSize]
+
+ // Use temp table to avoid bound checks/append penalty.
+ buf := d.buffer()
+ var off uint8
+ var decoded int
+
+ // Decode 4 values from each decoder/loop.
+ const bufoff = 256
+ for {
+ if br[0].off < 4 || br[1].off < 4 || br[2].off < 4 || br[3].off < 4 {
+ break
+ }
+
+ {
+ // Interleave 2 decodes.
+ const stream = 0
+ const stream2 = 1
+ br1 := &br[stream]
+ br2 := &br[stream2]
+ br1.fillFast()
+ br2.fillFast()
+
+ v := single[uint8(br1.value>>shift)].entry
+ v2 := single[uint8(br2.value>>shift)].entry
+ br1.bitsRead += uint8(v)
+ br1.value <<= v & 63
+ br2.bitsRead += uint8(v2)
+ br2.value <<= v2 & 63
+ buf[stream][off] = uint8(v >> 8)
+ buf[stream2][off] = uint8(v2 >> 8)
+
+ v = single[uint8(br1.value>>shift)].entry
+ v2 = single[uint8(br2.value>>shift)].entry
+ br1.bitsRead += uint8(v)
+ br1.value <<= v & 63
+ br2.bitsRead += uint8(v2)
+ br2.value <<= v2 & 63
+ buf[stream][off+1] = uint8(v >> 8)
+ buf[stream2][off+1] = uint8(v2 >> 8)
+
+ v = single[uint8(br1.value>>shift)].entry
+ v2 = single[uint8(br2.value>>shift)].entry
+ br1.bitsRead += uint8(v)
+ br1.value <<= v & 63
+ br2.bitsRead += uint8(v2)
+ br2.value <<= v2 & 63
+ buf[stream][off+2] = uint8(v >> 8)
+ buf[stream2][off+2] = uint8(v2 >> 8)
+
+ v = single[uint8(br1.value>>shift)].entry
+ v2 = single[uint8(br2.value>>shift)].entry
+ br1.bitsRead += uint8(v)
+ br1.value <<= v & 63
+ br2.bitsRead += uint8(v2)
+ br2.value <<= v2 & 63
+ buf[stream][off+3] = uint8(v >> 8)
+ buf[stream2][off+3] = uint8(v2 >> 8)
+ }
+
+ {
+ const stream = 2
+ const stream2 = 3
+ br1 := &br[stream]
+ br2 := &br[stream2]
+ br1.fillFast()
+ br2.fillFast()
+
+ v := single[uint8(br1.value>>shift)].entry
+ v2 := single[uint8(br2.value>>shift)].entry
+ br1.bitsRead += uint8(v)
+ br1.value <<= v & 63
+ br2.bitsRead += uint8(v2)
+ br2.value <<= v2 & 63
+ buf[stream][off] = uint8(v >> 8)
+ buf[stream2][off] = uint8(v2 >> 8)
+
+ v = single[uint8(br1.value>>shift)].entry
+ v2 = single[uint8(br2.value>>shift)].entry
+ br1.bitsRead += uint8(v)
+ br1.value <<= v & 63
+ br2.bitsRead += uint8(v2)
+ br2.value <<= v2 & 63
+ buf[stream][off+1] = uint8(v >> 8)
+ buf[stream2][off+1] = uint8(v2 >> 8)
+
+ v = single[uint8(br1.value>>shift)].entry
+ v2 = single[uint8(br2.value>>shift)].entry
+ br1.bitsRead += uint8(v)
+ br1.value <<= v & 63
+ br2.bitsRead += uint8(v2)
+ br2.value <<= v2 & 63
+ buf[stream][off+2] = uint8(v >> 8)
+ buf[stream2][off+2] = uint8(v2 >> 8)
+
+ v = single[uint8(br1.value>>shift)].entry
+ v2 = single[uint8(br2.value>>shift)].entry
+ br1.bitsRead += uint8(v)
+ br1.value <<= v & 63
+ br2.bitsRead += uint8(v2)
+ br2.value <<= v2 & 63
+ buf[stream][off+3] = uint8(v >> 8)
+ buf[stream2][off+3] = uint8(v2 >> 8)
+ }
+
+ off += 4
+
+ if off == 0 {
+ if bufoff > dstEvery {
+ d.bufs.Put(buf)
+ return nil, errors.New("corruption detected: stream overrun 1")
+ }
+ // There must at least be 3 buffers left.
+ if len(out)-bufoff < dstEvery*3 {
+ d.bufs.Put(buf)
+ return nil, errors.New("corruption detected: stream overrun 2")
+ }
+ //copy(out, buf[0][:])
+ //copy(out[dstEvery:], buf[1][:])
+ //copy(out[dstEvery*2:], buf[2][:])
+ *(*[bufoff]byte)(out) = buf[0]
+ *(*[bufoff]byte)(out[dstEvery:]) = buf[1]
+ *(*[bufoff]byte)(out[dstEvery*2:]) = buf[2]
+ *(*[bufoff]byte)(out[dstEvery*3:]) = buf[3]
+ out = out[bufoff:]
+ decoded += bufoff * 4
+ }
+ }
+ if off > 0 {
+ ioff := int(off)
+ if len(out) < dstEvery*3+ioff {
+ d.bufs.Put(buf)
+ return nil, errors.New("corruption detected: stream overrun 3")
+ }
+ copy(out, buf[0][:off])
+ copy(out[dstEvery:], buf[1][:off])
+ copy(out[dstEvery*2:], buf[2][:off])
+ copy(out[dstEvery*3:], buf[3][:off])
+ decoded += int(off) * 4
+ out = out[off:]
+ }
+
+ // Decode remaining.
+ // Decode remaining.
+ remainBytes := dstEvery - (decoded / 4)
+ for i := range br {
+ offset := dstEvery * i
+ endsAt := offset + remainBytes
+ if endsAt > len(out) {
+ endsAt = len(out)
+ }
+ br := &br[i]
+ bitsLeft := br.remaining()
+ for bitsLeft > 0 {
+ if br.finished() {
+ d.bufs.Put(buf)
+ return nil, io.ErrUnexpectedEOF
+ }
+ if br.bitsRead >= 56 {
+ if br.off >= 4 {
+ v := br.in[br.off-4:]
+ v = v[:4]
+ low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24)
+ br.value |= uint64(low) << (br.bitsRead - 32)
+ br.bitsRead -= 32
+ br.off -= 4
+ } else {
+ for br.off > 0 {
+ br.value |= uint64(br.in[br.off-1]) << (br.bitsRead - 8)
+ br.bitsRead -= 8
+ br.off--
+ }
+ }
+ }
+ // end inline...
+ if offset >= endsAt {
+ d.bufs.Put(buf)
+ return nil, errors.New("corruption detected: stream overrun 4")
+ }
+
+ // Read value and increment offset.
+ v := single[uint8(br.value>>shift)].entry
+ nBits := uint8(v)
+ br.advance(nBits)
+ bitsLeft -= uint(nBits)
+ out[offset] = uint8(v >> 8)
+ offset++
+ }
+ if offset != endsAt {
+ d.bufs.Put(buf)
+ return nil, fmt.Errorf("corruption detected: short output block %d, end %d != %d", i, offset, endsAt)
+ }
+ decoded += offset - dstEvery*i
+ err = br.close()
+ if err != nil {
+ d.bufs.Put(buf)
+ return nil, err
+ }
+ }
+ d.bufs.Put(buf)
+ if dstSize != decoded {
+ return nil, errors.New("corruption detected: short output block")
+ }
+ return dst, nil
+}
+
+// Decompress4X will decompress a 4X encoded stream.
+// The length of the supplied input must match the end of a block exactly.
+// The *capacity* of the dst slice must match the destination size of
+// the uncompressed data exactly.
+func (d *Decoder) decompress4X8bitExactly(dst, src []byte) ([]byte, error) {
+ var br [4]bitReaderBytes
+ start := 6
+ for i := 0; i < 3; i++ {
+ length := int(src[i*2]) | (int(src[i*2+1]) << 8)
+ if start+length >= len(src) {
+ return nil, errors.New("truncated input (or invalid offset)")
+ }
+ err := br[i].init(src[start : start+length])
+ if err != nil {
+ return nil, err
+ }
+ start += length
+ }
+ err := br[3].init(src[start:])
+ if err != nil {
+ return nil, err
+ }
+
+ // destination, offset to match first output
+ dstSize := cap(dst)
+ dst = dst[:dstSize]
+ out := dst
+ dstEvery := (dstSize + 3) / 4
+
+ const shift = 56
+ const tlSize = 1 << 8
+ single := d.dt.single[:tlSize]
+
+ // Use temp table to avoid bound checks/append penalty.
+ buf := d.buffer()
+ var off uint8
+ var decoded int
+
+ // Decode 4 values from each decoder/loop.
+ const bufoff = 256
+ for {
+ if br[0].off < 4 || br[1].off < 4 || br[2].off < 4 || br[3].off < 4 {
+ break
+ }
+
+ {
+ // Interleave 2 decodes.
+ const stream = 0
+ const stream2 = 1
+ br1 := &br[stream]
+ br2 := &br[stream2]
+ br1.fillFast()
+ br2.fillFast()
+
+ v := single[uint8(br1.value>>shift)].entry
+ v2 := single[uint8(br2.value>>shift)].entry
+ br1.bitsRead += uint8(v)
+ br1.value <<= v & 63
+ br2.bitsRead += uint8(v2)
+ br2.value <<= v2 & 63
+ buf[stream][off] = uint8(v >> 8)
+ buf[stream2][off] = uint8(v2 >> 8)
+
+ v = single[uint8(br1.value>>shift)].entry
+ v2 = single[uint8(br2.value>>shift)].entry
+ br1.bitsRead += uint8(v)
+ br1.value <<= v & 63
+ br2.bitsRead += uint8(v2)
+ br2.value <<= v2 & 63
+ buf[stream][off+1] = uint8(v >> 8)
+ buf[stream2][off+1] = uint8(v2 >> 8)
+
+ v = single[uint8(br1.value>>shift)].entry
+ v2 = single[uint8(br2.value>>shift)].entry
+ br1.bitsRead += uint8(v)
+ br1.value <<= v & 63
+ br2.bitsRead += uint8(v2)
+ br2.value <<= v2 & 63
+ buf[stream][off+2] = uint8(v >> 8)
+ buf[stream2][off+2] = uint8(v2 >> 8)
+
+ v = single[uint8(br1.value>>shift)].entry
+ v2 = single[uint8(br2.value>>shift)].entry
+ br1.bitsRead += uint8(v)
+ br1.value <<= v & 63
+ br2.bitsRead += uint8(v2)
+ br2.value <<= v2 & 63
+ buf[stream][off+3] = uint8(v >> 8)
+ buf[stream2][off+3] = uint8(v2 >> 8)
+ }
+
+ {
+ const stream = 2
+ const stream2 = 3
+ br1 := &br[stream]
+ br2 := &br[stream2]
+ br1.fillFast()
+ br2.fillFast()
+
+ v := single[uint8(br1.value>>shift)].entry
+ v2 := single[uint8(br2.value>>shift)].entry
+ br1.bitsRead += uint8(v)
+ br1.value <<= v & 63
+ br2.bitsRead += uint8(v2)
+ br2.value <<= v2 & 63
+ buf[stream][off] = uint8(v >> 8)
+ buf[stream2][off] = uint8(v2 >> 8)
+
+ v = single[uint8(br1.value>>shift)].entry
+ v2 = single[uint8(br2.value>>shift)].entry
+ br1.bitsRead += uint8(v)
+ br1.value <<= v & 63
+ br2.bitsRead += uint8(v2)
+ br2.value <<= v2 & 63
+ buf[stream][off+1] = uint8(v >> 8)
+ buf[stream2][off+1] = uint8(v2 >> 8)
+
+ v = single[uint8(br1.value>>shift)].entry
+ v2 = single[uint8(br2.value>>shift)].entry
+ br1.bitsRead += uint8(v)
+ br1.value <<= v & 63
+ br2.bitsRead += uint8(v2)
+ br2.value <<= v2 & 63
+ buf[stream][off+2] = uint8(v >> 8)
+ buf[stream2][off+2] = uint8(v2 >> 8)
+
+ v = single[uint8(br1.value>>shift)].entry
+ v2 = single[uint8(br2.value>>shift)].entry
+ br1.bitsRead += uint8(v)
+ br1.value <<= v & 63
+ br2.bitsRead += uint8(v2)
+ br2.value <<= v2 & 63
+ buf[stream][off+3] = uint8(v >> 8)
+ buf[stream2][off+3] = uint8(v2 >> 8)
+ }
+
+ off += 4
+
+ if off == 0 {
+ if bufoff > dstEvery {
+ d.bufs.Put(buf)
+ return nil, errors.New("corruption detected: stream overrun 1")
+ }
+ // There must at least be 3 buffers left.
+ if len(out)-bufoff < dstEvery*3 {
+ d.bufs.Put(buf)
+ return nil, errors.New("corruption detected: stream overrun 2")
+ }
+
+ //copy(out, buf[0][:])
+ //copy(out[dstEvery:], buf[1][:])
+ //copy(out[dstEvery*2:], buf[2][:])
+ // copy(out[dstEvery*3:], buf[3][:])
+ *(*[bufoff]byte)(out) = buf[0]
+ *(*[bufoff]byte)(out[dstEvery:]) = buf[1]
+ *(*[bufoff]byte)(out[dstEvery*2:]) = buf[2]
+ *(*[bufoff]byte)(out[dstEvery*3:]) = buf[3]
+ out = out[bufoff:]
+ decoded += bufoff * 4
+ }
+ }
+ if off > 0 {
+ ioff := int(off)
+ if len(out) < dstEvery*3+ioff {
+ return nil, errors.New("corruption detected: stream overrun 3")
+ }
+ copy(out, buf[0][:off])
+ copy(out[dstEvery:], buf[1][:off])
+ copy(out[dstEvery*2:], buf[2][:off])
+ copy(out[dstEvery*3:], buf[3][:off])
+ decoded += int(off) * 4
+ out = out[off:]
+ }
+
+ // Decode remaining.
+ remainBytes := dstEvery - (decoded / 4)
+ for i := range br {
+ offset := dstEvery * i
+ endsAt := offset + remainBytes
+ if endsAt > len(out) {
+ endsAt = len(out)
+ }
+ br := &br[i]
+ bitsLeft := br.remaining()
+ for bitsLeft > 0 {
+ if br.finished() {
+ d.bufs.Put(buf)
+ return nil, io.ErrUnexpectedEOF
+ }
+ if br.bitsRead >= 56 {
+ if br.off >= 4 {
+ v := br.in[br.off-4:]
+ v = v[:4]
+ low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24)
+ br.value |= uint64(low) << (br.bitsRead - 32)
+ br.bitsRead -= 32
+ br.off -= 4
+ } else {
+ for br.off > 0 {
+ br.value |= uint64(br.in[br.off-1]) << (br.bitsRead - 8)
+ br.bitsRead -= 8
+ br.off--
+ }
+ }
+ }
+ // end inline...
+ if offset >= endsAt {
+ d.bufs.Put(buf)
+ return nil, errors.New("corruption detected: stream overrun 4")
+ }
+
+ // Read value and increment offset.
+ v := single[br.peekByteFast()].entry
+ nBits := uint8(v)
+ br.advance(nBits)
+ bitsLeft -= uint(nBits)
+ out[offset] = uint8(v >> 8)
+ offset++
+ }
+ if offset != endsAt {
+ d.bufs.Put(buf)
+ return nil, fmt.Errorf("corruption detected: short output block %d, end %d != %d", i, offset, endsAt)
+ }
+
+ decoded += offset - dstEvery*i
+ err = br.close()
+ if err != nil {
+ d.bufs.Put(buf)
+ return nil, err
+ }
+ }
+ d.bufs.Put(buf)
+ if dstSize != decoded {
+ return nil, errors.New("corruption detected: short output block")
+ }
+ return dst, nil
+}
+
+// matches will compare a decoding table to a coding table.
+// Errors are written to the writer.
+// Nothing will be written if table is ok.
+func (s *Scratch) matches(ct cTable, w io.Writer) {
+ if s == nil || len(s.dt.single) == 0 {
+ return
+ }
+ dt := s.dt.single[:1<>8) == byte(sym) {
+ fmt.Fprintf(w, "symbol %x has decoder, but no encoder\n", sym)
+ errs++
+ break
+ }
+ }
+ if errs == 0 {
+ broken--
+ }
+ continue
+ }
+ // Unused bits in input
+ ub := tablelog - enc.nBits
+ top := enc.val << ub
+ // decoder looks at top bits.
+ dec := dt[top]
+ if uint8(dec.entry) != enc.nBits {
+ fmt.Fprintf(w, "symbol 0x%x bit size mismatch (enc: %d, dec:%d).\n", sym, enc.nBits, uint8(dec.entry))
+ errs++
+ }
+ if uint8(dec.entry>>8) != uint8(sym) {
+ fmt.Fprintf(w, "symbol 0x%x decoder output mismatch (enc: %d, dec:%d).\n", sym, sym, uint8(dec.entry>>8))
+ errs++
+ }
+ if errs > 0 {
+ fmt.Fprintf(w, "%d errors in base, stopping\n", errs)
+ continue
+ }
+ // Ensure that all combinations are covered.
+ for i := uint16(0); i < (1 << ub); i++ {
+ vval := top | i
+ dec := dt[vval]
+ if uint8(dec.entry) != enc.nBits {
+ fmt.Fprintf(w, "symbol 0x%x bit size mismatch (enc: %d, dec:%d).\n", vval, enc.nBits, uint8(dec.entry))
+ errs++
+ }
+ if uint8(dec.entry>>8) != uint8(sym) {
+ fmt.Fprintf(w, "symbol 0x%x decoder output mismatch (enc: %d, dec:%d).\n", vval, sym, uint8(dec.entry>>8))
+ errs++
+ }
+ if errs > 20 {
+ fmt.Fprintf(w, "%d errors, stopping\n", errs)
+ break
+ }
+ }
+ if errs == 0 {
+ ok++
+ broken--
+ }
+ }
+ if broken > 0 {
+ fmt.Fprintf(w, "%d broken, %d ok\n", broken, ok)
+ }
+}
diff --git a/vendor/github.com/klauspost/compress/huff0/decompress_amd64.go b/vendor/github.com/klauspost/compress/huff0/decompress_amd64.go
new file mode 100644
index 00000000..ba7e8e6b
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/huff0/decompress_amd64.go
@@ -0,0 +1,226 @@
+//go:build amd64 && !appengine && !noasm && gc
+// +build amd64,!appengine,!noasm,gc
+
+// This file contains the specialisation of Decoder.Decompress4X
+// and Decoder.Decompress1X that use an asm implementation of thir main loops.
+package huff0
+
+import (
+ "errors"
+ "fmt"
+
+ "github.com/klauspost/compress/internal/cpuinfo"
+)
+
+// decompress4x_main_loop_x86 is an x86 assembler implementation
+// of Decompress4X when tablelog > 8.
+//
+//go:noescape
+func decompress4x_main_loop_amd64(ctx *decompress4xContext)
+
+// decompress4x_8b_loop_x86 is an x86 assembler implementation
+// of Decompress4X when tablelog <= 8 which decodes 4 entries
+// per loop.
+//
+//go:noescape
+func decompress4x_8b_main_loop_amd64(ctx *decompress4xContext)
+
+// fallback8BitSize is the size where using Go version is faster.
+const fallback8BitSize = 800
+
+type decompress4xContext struct {
+ pbr *[4]bitReaderShifted
+ peekBits uint8
+ out *byte
+ dstEvery int
+ tbl *dEntrySingle
+ decoded int
+ limit *byte
+}
+
+// Decompress4X will decompress a 4X encoded stream.
+// The length of the supplied input must match the end of a block exactly.
+// The *capacity* of the dst slice must match the destination size of
+// the uncompressed data exactly.
+func (d *Decoder) Decompress4X(dst, src []byte) ([]byte, error) {
+ if len(d.dt.single) == 0 {
+ return nil, errors.New("no table loaded")
+ }
+ if len(src) < 6+(4*1) {
+ return nil, errors.New("input too small")
+ }
+
+ use8BitTables := d.actualTableLog <= 8
+ if cap(dst) < fallback8BitSize && use8BitTables {
+ return d.decompress4X8bit(dst, src)
+ }
+
+ var br [4]bitReaderShifted
+ // Decode "jump table"
+ start := 6
+ for i := 0; i < 3; i++ {
+ length := int(src[i*2]) | (int(src[i*2+1]) << 8)
+ if start+length >= len(src) {
+ return nil, errors.New("truncated input (or invalid offset)")
+ }
+ err := br[i].init(src[start : start+length])
+ if err != nil {
+ return nil, err
+ }
+ start += length
+ }
+ err := br[3].init(src[start:])
+ if err != nil {
+ return nil, err
+ }
+
+ // destination, offset to match first output
+ dstSize := cap(dst)
+ dst = dst[:dstSize]
+ out := dst
+ dstEvery := (dstSize + 3) / 4
+
+ const tlSize = 1 << tableLogMax
+ const tlMask = tlSize - 1
+ single := d.dt.single[:tlSize]
+
+ var decoded int
+
+ if len(out) > 4*4 && !(br[0].off < 4 || br[1].off < 4 || br[2].off < 4 || br[3].off < 4) {
+ ctx := decompress4xContext{
+ pbr: &br,
+ peekBits: uint8((64 - d.actualTableLog) & 63), // see: bitReaderShifted.peekBitsFast()
+ out: &out[0],
+ dstEvery: dstEvery,
+ tbl: &single[0],
+ limit: &out[dstEvery-4], // Always stop decoding when first buffer gets here to avoid writing OOB on last.
+ }
+ if use8BitTables {
+ decompress4x_8b_main_loop_amd64(&ctx)
+ } else {
+ decompress4x_main_loop_amd64(&ctx)
+ }
+
+ decoded = ctx.decoded
+ out = out[decoded/4:]
+ }
+
+ // Decode remaining.
+ remainBytes := dstEvery - (decoded / 4)
+ for i := range br {
+ offset := dstEvery * i
+ endsAt := offset + remainBytes
+ if endsAt > len(out) {
+ endsAt = len(out)
+ }
+ br := &br[i]
+ bitsLeft := br.remaining()
+ for bitsLeft > 0 {
+ br.fill()
+ if offset >= endsAt {
+ return nil, errors.New("corruption detected: stream overrun 4")
+ }
+
+ // Read value and increment offset.
+ val := br.peekBitsFast(d.actualTableLog)
+ v := single[val&tlMask].entry
+ nBits := uint8(v)
+ br.advance(nBits)
+ bitsLeft -= uint(nBits)
+ out[offset] = uint8(v >> 8)
+ offset++
+ }
+ if offset != endsAt {
+ return nil, fmt.Errorf("corruption detected: short output block %d, end %d != %d", i, offset, endsAt)
+ }
+ decoded += offset - dstEvery*i
+ err = br.close()
+ if err != nil {
+ return nil, err
+ }
+ }
+ if dstSize != decoded {
+ return nil, errors.New("corruption detected: short output block")
+ }
+ return dst, nil
+}
+
+// decompress4x_main_loop_x86 is an x86 assembler implementation
+// of Decompress1X when tablelog > 8.
+//
+//go:noescape
+func decompress1x_main_loop_amd64(ctx *decompress1xContext)
+
+// decompress4x_main_loop_x86 is an x86 with BMI2 assembler implementation
+// of Decompress1X when tablelog > 8.
+//
+//go:noescape
+func decompress1x_main_loop_bmi2(ctx *decompress1xContext)
+
+type decompress1xContext struct {
+ pbr *bitReaderShifted
+ peekBits uint8
+ out *byte
+ outCap int
+ tbl *dEntrySingle
+ decoded int
+}
+
+// Error reported by asm implementations
+const error_max_decoded_size_exeeded = -1
+
+// Decompress1X will decompress a 1X encoded stream.
+// The cap of the output buffer will be the maximum decompressed size.
+// The length of the supplied input must match the end of a block exactly.
+func (d *Decoder) Decompress1X(dst, src []byte) ([]byte, error) {
+ if len(d.dt.single) == 0 {
+ return nil, errors.New("no table loaded")
+ }
+ var br bitReaderShifted
+ err := br.init(src)
+ if err != nil {
+ return dst, err
+ }
+ maxDecodedSize := cap(dst)
+ dst = dst[:maxDecodedSize]
+
+ const tlSize = 1 << tableLogMax
+ const tlMask = tlSize - 1
+
+ if maxDecodedSize >= 4 {
+ ctx := decompress1xContext{
+ pbr: &br,
+ out: &dst[0],
+ outCap: maxDecodedSize,
+ peekBits: uint8((64 - d.actualTableLog) & 63), // see: bitReaderShifted.peekBitsFast()
+ tbl: &d.dt.single[0],
+ }
+
+ if cpuinfo.HasBMI2() {
+ decompress1x_main_loop_bmi2(&ctx)
+ } else {
+ decompress1x_main_loop_amd64(&ctx)
+ }
+ if ctx.decoded == error_max_decoded_size_exeeded {
+ return nil, ErrMaxDecodedSizeExceeded
+ }
+
+ dst = dst[:ctx.decoded]
+ }
+
+ // br < 8, so uint8 is fine
+ bitsLeft := uint8(br.off)*8 + 64 - br.bitsRead
+ for bitsLeft > 0 {
+ br.fill()
+ if len(dst) >= maxDecodedSize {
+ br.close()
+ return nil, ErrMaxDecodedSizeExceeded
+ }
+ v := d.dt.single[br.peekBitsFast(d.actualTableLog)&tlMask]
+ nBits := uint8(v.entry)
+ br.advance(nBits)
+ bitsLeft -= nBits
+ dst = append(dst, uint8(v.entry>>8))
+ }
+ return dst, br.close()
+}
diff --git a/vendor/github.com/klauspost/compress/huff0/decompress_amd64.s b/vendor/github.com/klauspost/compress/huff0/decompress_amd64.s
new file mode 100644
index 00000000..c4c7ab2d
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/huff0/decompress_amd64.s
@@ -0,0 +1,830 @@
+// Code generated by command: go run gen.go -out ../decompress_amd64.s -pkg=huff0. DO NOT EDIT.
+
+//go:build amd64 && !appengine && !noasm && gc
+
+// func decompress4x_main_loop_amd64(ctx *decompress4xContext)
+TEXT ·decompress4x_main_loop_amd64(SB), $0-8
+ // Preload values
+ MOVQ ctx+0(FP), AX
+ MOVBQZX 8(AX), DI
+ MOVQ 16(AX), BX
+ MOVQ 48(AX), SI
+ MOVQ 24(AX), R8
+ MOVQ 32(AX), R9
+ MOVQ (AX), R10
+
+ // Main loop
+main_loop:
+ XORL DX, DX
+ CMPQ BX, SI
+ SETGE DL
+
+ // br0.fillFast32()
+ MOVQ 32(R10), R11
+ MOVBQZX 40(R10), R12
+ CMPQ R12, $0x20
+ JBE skip_fill0
+ MOVQ 24(R10), AX
+ SUBQ $0x20, R12
+ SUBQ $0x04, AX
+ MOVQ (R10), R13
+
+ // b.value |= uint64(low) << (b.bitsRead & 63)
+ MOVL (AX)(R13*1), R13
+ MOVQ R12, CX
+ SHLQ CL, R13
+ MOVQ AX, 24(R10)
+ ORQ R13, R11
+
+ // exhausted += (br0.off < 4)
+ CMPQ AX, $0x04
+ ADCB $+0, DL
+
+skip_fill0:
+ // val0 := br0.peekTopBits(peekBits)
+ MOVQ R11, R13
+ MOVQ DI, CX
+ SHRQ CL, R13
+
+ // v0 := table[val0&mask]
+ MOVW (R9)(R13*2), CX
+
+ // br0.advance(uint8(v0.entry)
+ MOVB CH, AL
+ SHLQ CL, R11
+ ADDB CL, R12
+
+ // val1 := br0.peekTopBits(peekBits)
+ MOVQ DI, CX
+ MOVQ R11, R13
+ SHRQ CL, R13
+
+ // v1 := table[val1&mask]
+ MOVW (R9)(R13*2), CX
+
+ // br0.advance(uint8(v1.entry))
+ MOVB CH, AH
+ SHLQ CL, R11
+ ADDB CL, R12
+
+ // these two writes get coalesced
+ // out[id * dstEvery + 0] = uint8(v0.entry >> 8)
+ // out[id * dstEvery + 1] = uint8(v1.entry >> 8)
+ MOVW AX, (BX)
+
+ // update the bitreader structure
+ MOVQ R11, 32(R10)
+ MOVB R12, 40(R10)
+
+ // br1.fillFast32()
+ MOVQ 80(R10), R11
+ MOVBQZX 88(R10), R12
+ CMPQ R12, $0x20
+ JBE skip_fill1
+ MOVQ 72(R10), AX
+ SUBQ $0x20, R12
+ SUBQ $0x04, AX
+ MOVQ 48(R10), R13
+
+ // b.value |= uint64(low) << (b.bitsRead & 63)
+ MOVL (AX)(R13*1), R13
+ MOVQ R12, CX
+ SHLQ CL, R13
+ MOVQ AX, 72(R10)
+ ORQ R13, R11
+
+ // exhausted += (br1.off < 4)
+ CMPQ AX, $0x04
+ ADCB $+0, DL
+
+skip_fill1:
+ // val0 := br1.peekTopBits(peekBits)
+ MOVQ R11, R13
+ MOVQ DI, CX
+ SHRQ CL, R13
+
+ // v0 := table[val0&mask]
+ MOVW (R9)(R13*2), CX
+
+ // br1.advance(uint8(v0.entry)
+ MOVB CH, AL
+ SHLQ CL, R11
+ ADDB CL, R12
+
+ // val1 := br1.peekTopBits(peekBits)
+ MOVQ DI, CX
+ MOVQ R11, R13
+ SHRQ CL, R13
+
+ // v1 := table[val1&mask]
+ MOVW (R9)(R13*2), CX
+
+ // br1.advance(uint8(v1.entry))
+ MOVB CH, AH
+ SHLQ CL, R11
+ ADDB CL, R12
+
+ // these two writes get coalesced
+ // out[id * dstEvery + 0] = uint8(v0.entry >> 8)
+ // out[id * dstEvery + 1] = uint8(v1.entry >> 8)
+ MOVW AX, (BX)(R8*1)
+
+ // update the bitreader structure
+ MOVQ R11, 80(R10)
+ MOVB R12, 88(R10)
+
+ // br2.fillFast32()
+ MOVQ 128(R10), R11
+ MOVBQZX 136(R10), R12
+ CMPQ R12, $0x20
+ JBE skip_fill2
+ MOVQ 120(R10), AX
+ SUBQ $0x20, R12
+ SUBQ $0x04, AX
+ MOVQ 96(R10), R13
+
+ // b.value |= uint64(low) << (b.bitsRead & 63)
+ MOVL (AX)(R13*1), R13
+ MOVQ R12, CX
+ SHLQ CL, R13
+ MOVQ AX, 120(R10)
+ ORQ R13, R11
+
+ // exhausted += (br2.off < 4)
+ CMPQ AX, $0x04
+ ADCB $+0, DL
+
+skip_fill2:
+ // val0 := br2.peekTopBits(peekBits)
+ MOVQ R11, R13
+ MOVQ DI, CX
+ SHRQ CL, R13
+
+ // v0 := table[val0&mask]
+ MOVW (R9)(R13*2), CX
+
+ // br2.advance(uint8(v0.entry)
+ MOVB CH, AL
+ SHLQ CL, R11
+ ADDB CL, R12
+
+ // val1 := br2.peekTopBits(peekBits)
+ MOVQ DI, CX
+ MOVQ R11, R13
+ SHRQ CL, R13
+
+ // v1 := table[val1&mask]
+ MOVW (R9)(R13*2), CX
+
+ // br2.advance(uint8(v1.entry))
+ MOVB CH, AH
+ SHLQ CL, R11
+ ADDB CL, R12
+
+ // these two writes get coalesced
+ // out[id * dstEvery + 0] = uint8(v0.entry >> 8)
+ // out[id * dstEvery + 1] = uint8(v1.entry >> 8)
+ MOVW AX, (BX)(R8*2)
+
+ // update the bitreader structure
+ MOVQ R11, 128(R10)
+ MOVB R12, 136(R10)
+
+ // br3.fillFast32()
+ MOVQ 176(R10), R11
+ MOVBQZX 184(R10), R12
+ CMPQ R12, $0x20
+ JBE skip_fill3
+ MOVQ 168(R10), AX
+ SUBQ $0x20, R12
+ SUBQ $0x04, AX
+ MOVQ 144(R10), R13
+
+ // b.value |= uint64(low) << (b.bitsRead & 63)
+ MOVL (AX)(R13*1), R13
+ MOVQ R12, CX
+ SHLQ CL, R13
+ MOVQ AX, 168(R10)
+ ORQ R13, R11
+
+ // exhausted += (br3.off < 4)
+ CMPQ AX, $0x04
+ ADCB $+0, DL
+
+skip_fill3:
+ // val0 := br3.peekTopBits(peekBits)
+ MOVQ R11, R13
+ MOVQ DI, CX
+ SHRQ CL, R13
+
+ // v0 := table[val0&mask]
+ MOVW (R9)(R13*2), CX
+
+ // br3.advance(uint8(v0.entry)
+ MOVB CH, AL
+ SHLQ CL, R11
+ ADDB CL, R12
+
+ // val1 := br3.peekTopBits(peekBits)
+ MOVQ DI, CX
+ MOVQ R11, R13
+ SHRQ CL, R13
+
+ // v1 := table[val1&mask]
+ MOVW (R9)(R13*2), CX
+
+ // br3.advance(uint8(v1.entry))
+ MOVB CH, AH
+ SHLQ CL, R11
+ ADDB CL, R12
+
+ // these two writes get coalesced
+ // out[id * dstEvery + 0] = uint8(v0.entry >> 8)
+ // out[id * dstEvery + 1] = uint8(v1.entry >> 8)
+ LEAQ (R8)(R8*2), CX
+ MOVW AX, (BX)(CX*1)
+
+ // update the bitreader structure
+ MOVQ R11, 176(R10)
+ MOVB R12, 184(R10)
+ ADDQ $0x02, BX
+ TESTB DL, DL
+ JZ main_loop
+ MOVQ ctx+0(FP), AX
+ SUBQ 16(AX), BX
+ SHLQ $0x02, BX
+ MOVQ BX, 40(AX)
+ RET
+
+// func decompress4x_8b_main_loop_amd64(ctx *decompress4xContext)
+TEXT ·decompress4x_8b_main_loop_amd64(SB), $0-8
+ // Preload values
+ MOVQ ctx+0(FP), CX
+ MOVBQZX 8(CX), DI
+ MOVQ 16(CX), BX
+ MOVQ 48(CX), SI
+ MOVQ 24(CX), R8
+ MOVQ 32(CX), R9
+ MOVQ (CX), R10
+
+ // Main loop
+main_loop:
+ XORL DX, DX
+ CMPQ BX, SI
+ SETGE DL
+
+ // br0.fillFast32()
+ MOVQ 32(R10), R11
+ MOVBQZX 40(R10), R12
+ CMPQ R12, $0x20
+ JBE skip_fill0
+ MOVQ 24(R10), R13
+ SUBQ $0x20, R12
+ SUBQ $0x04, R13
+ MOVQ (R10), R14
+
+ // b.value |= uint64(low) << (b.bitsRead & 63)
+ MOVL (R13)(R14*1), R14
+ MOVQ R12, CX
+ SHLQ CL, R14
+ MOVQ R13, 24(R10)
+ ORQ R14, R11
+
+ // exhausted += (br0.off < 4)
+ CMPQ R13, $0x04
+ ADCB $+0, DL
+
+skip_fill0:
+ // val0 := br0.peekTopBits(peekBits)
+ MOVQ R11, R13
+ MOVQ DI, CX
+ SHRQ CL, R13
+
+ // v0 := table[val0&mask]
+ MOVW (R9)(R13*2), CX
+
+ // br0.advance(uint8(v0.entry)
+ MOVB CH, AL
+ SHLQ CL, R11
+ ADDB CL, R12
+
+ // val1 := br0.peekTopBits(peekBits)
+ MOVQ R11, R13
+ MOVQ DI, CX
+ SHRQ CL, R13
+
+ // v1 := table[val0&mask]
+ MOVW (R9)(R13*2), CX
+
+ // br0.advance(uint8(v1.entry)
+ MOVB CH, AH
+ SHLQ CL, R11
+ ADDB CL, R12
+ BSWAPL AX
+
+ // val2 := br0.peekTopBits(peekBits)
+ MOVQ R11, R13
+ MOVQ DI, CX
+ SHRQ CL, R13
+
+ // v2 := table[val0&mask]
+ MOVW (R9)(R13*2), CX
+
+ // br0.advance(uint8(v2.entry)
+ MOVB CH, AH
+ SHLQ CL, R11
+ ADDB CL, R12
+
+ // val3 := br0.peekTopBits(peekBits)
+ MOVQ R11, R13
+ MOVQ DI, CX
+ SHRQ CL, R13
+
+ // v3 := table[val0&mask]
+ MOVW (R9)(R13*2), CX
+
+ // br0.advance(uint8(v3.entry)
+ MOVB CH, AL
+ SHLQ CL, R11
+ ADDB CL, R12
+ BSWAPL AX
+
+ // these four writes get coalesced
+ // out[id * dstEvery + 0] = uint8(v0.entry >> 8)
+ // out[id * dstEvery + 1] = uint8(v1.entry >> 8)
+ // out[id * dstEvery + 3] = uint8(v2.entry >> 8)
+ // out[id * dstEvery + 4] = uint8(v3.entry >> 8)
+ MOVL AX, (BX)
+
+ // update the bitreader structure
+ MOVQ R11, 32(R10)
+ MOVB R12, 40(R10)
+
+ // br1.fillFast32()
+ MOVQ 80(R10), R11
+ MOVBQZX 88(R10), R12
+ CMPQ R12, $0x20
+ JBE skip_fill1
+ MOVQ 72(R10), R13
+ SUBQ $0x20, R12
+ SUBQ $0x04, R13
+ MOVQ 48(R10), R14
+
+ // b.value |= uint64(low) << (b.bitsRead & 63)
+ MOVL (R13)(R14*1), R14
+ MOVQ R12, CX
+ SHLQ CL, R14
+ MOVQ R13, 72(R10)
+ ORQ R14, R11
+
+ // exhausted += (br1.off < 4)
+ CMPQ R13, $0x04
+ ADCB $+0, DL
+
+skip_fill1:
+ // val0 := br1.peekTopBits(peekBits)
+ MOVQ R11, R13
+ MOVQ DI, CX
+ SHRQ CL, R13
+
+ // v0 := table[val0&mask]
+ MOVW (R9)(R13*2), CX
+
+ // br1.advance(uint8(v0.entry)
+ MOVB CH, AL
+ SHLQ CL, R11
+ ADDB CL, R12
+
+ // val1 := br1.peekTopBits(peekBits)
+ MOVQ R11, R13
+ MOVQ DI, CX
+ SHRQ CL, R13
+
+ // v1 := table[val0&mask]
+ MOVW (R9)(R13*2), CX
+
+ // br1.advance(uint8(v1.entry)
+ MOVB CH, AH
+ SHLQ CL, R11
+ ADDB CL, R12
+ BSWAPL AX
+
+ // val2 := br1.peekTopBits(peekBits)
+ MOVQ R11, R13
+ MOVQ DI, CX
+ SHRQ CL, R13
+
+ // v2 := table[val0&mask]
+ MOVW (R9)(R13*2), CX
+
+ // br1.advance(uint8(v2.entry)
+ MOVB CH, AH
+ SHLQ CL, R11
+ ADDB CL, R12
+
+ // val3 := br1.peekTopBits(peekBits)
+ MOVQ R11, R13
+ MOVQ DI, CX
+ SHRQ CL, R13
+
+ // v3 := table[val0&mask]
+ MOVW (R9)(R13*2), CX
+
+ // br1.advance(uint8(v3.entry)
+ MOVB CH, AL
+ SHLQ CL, R11
+ ADDB CL, R12
+ BSWAPL AX
+
+ // these four writes get coalesced
+ // out[id * dstEvery + 0] = uint8(v0.entry >> 8)
+ // out[id * dstEvery + 1] = uint8(v1.entry >> 8)
+ // out[id * dstEvery + 3] = uint8(v2.entry >> 8)
+ // out[id * dstEvery + 4] = uint8(v3.entry >> 8)
+ MOVL AX, (BX)(R8*1)
+
+ // update the bitreader structure
+ MOVQ R11, 80(R10)
+ MOVB R12, 88(R10)
+
+ // br2.fillFast32()
+ MOVQ 128(R10), R11
+ MOVBQZX 136(R10), R12
+ CMPQ R12, $0x20
+ JBE skip_fill2
+ MOVQ 120(R10), R13
+ SUBQ $0x20, R12
+ SUBQ $0x04, R13
+ MOVQ 96(R10), R14
+
+ // b.value |= uint64(low) << (b.bitsRead & 63)
+ MOVL (R13)(R14*1), R14
+ MOVQ R12, CX
+ SHLQ CL, R14
+ MOVQ R13, 120(R10)
+ ORQ R14, R11
+
+ // exhausted += (br2.off < 4)
+ CMPQ R13, $0x04
+ ADCB $+0, DL
+
+skip_fill2:
+ // val0 := br2.peekTopBits(peekBits)
+ MOVQ R11, R13
+ MOVQ DI, CX
+ SHRQ CL, R13
+
+ // v0 := table[val0&mask]
+ MOVW (R9)(R13*2), CX
+
+ // br2.advance(uint8(v0.entry)
+ MOVB CH, AL
+ SHLQ CL, R11
+ ADDB CL, R12
+
+ // val1 := br2.peekTopBits(peekBits)
+ MOVQ R11, R13
+ MOVQ DI, CX
+ SHRQ CL, R13
+
+ // v1 := table[val0&mask]
+ MOVW (R9)(R13*2), CX
+
+ // br2.advance(uint8(v1.entry)
+ MOVB CH, AH
+ SHLQ CL, R11
+ ADDB CL, R12
+ BSWAPL AX
+
+ // val2 := br2.peekTopBits(peekBits)
+ MOVQ R11, R13
+ MOVQ DI, CX
+ SHRQ CL, R13
+
+ // v2 := table[val0&mask]
+ MOVW (R9)(R13*2), CX
+
+ // br2.advance(uint8(v2.entry)
+ MOVB CH, AH
+ SHLQ CL, R11
+ ADDB CL, R12
+
+ // val3 := br2.peekTopBits(peekBits)
+ MOVQ R11, R13
+ MOVQ DI, CX
+ SHRQ CL, R13
+
+ // v3 := table[val0&mask]
+ MOVW (R9)(R13*2), CX
+
+ // br2.advance(uint8(v3.entry)
+ MOVB CH, AL
+ SHLQ CL, R11
+ ADDB CL, R12
+ BSWAPL AX
+
+ // these four writes get coalesced
+ // out[id * dstEvery + 0] = uint8(v0.entry >> 8)
+ // out[id * dstEvery + 1] = uint8(v1.entry >> 8)
+ // out[id * dstEvery + 3] = uint8(v2.entry >> 8)
+ // out[id * dstEvery + 4] = uint8(v3.entry >> 8)
+ MOVL AX, (BX)(R8*2)
+
+ // update the bitreader structure
+ MOVQ R11, 128(R10)
+ MOVB R12, 136(R10)
+
+ // br3.fillFast32()
+ MOVQ 176(R10), R11
+ MOVBQZX 184(R10), R12
+ CMPQ R12, $0x20
+ JBE skip_fill3
+ MOVQ 168(R10), R13
+ SUBQ $0x20, R12
+ SUBQ $0x04, R13
+ MOVQ 144(R10), R14
+
+ // b.value |= uint64(low) << (b.bitsRead & 63)
+ MOVL (R13)(R14*1), R14
+ MOVQ R12, CX
+ SHLQ CL, R14
+ MOVQ R13, 168(R10)
+ ORQ R14, R11
+
+ // exhausted += (br3.off < 4)
+ CMPQ R13, $0x04
+ ADCB $+0, DL
+
+skip_fill3:
+ // val0 := br3.peekTopBits(peekBits)
+ MOVQ R11, R13
+ MOVQ DI, CX
+ SHRQ CL, R13
+
+ // v0 := table[val0&mask]
+ MOVW (R9)(R13*2), CX
+
+ // br3.advance(uint8(v0.entry)
+ MOVB CH, AL
+ SHLQ CL, R11
+ ADDB CL, R12
+
+ // val1 := br3.peekTopBits(peekBits)
+ MOVQ R11, R13
+ MOVQ DI, CX
+ SHRQ CL, R13
+
+ // v1 := table[val0&mask]
+ MOVW (R9)(R13*2), CX
+
+ // br3.advance(uint8(v1.entry)
+ MOVB CH, AH
+ SHLQ CL, R11
+ ADDB CL, R12
+ BSWAPL AX
+
+ // val2 := br3.peekTopBits(peekBits)
+ MOVQ R11, R13
+ MOVQ DI, CX
+ SHRQ CL, R13
+
+ // v2 := table[val0&mask]
+ MOVW (R9)(R13*2), CX
+
+ // br3.advance(uint8(v2.entry)
+ MOVB CH, AH
+ SHLQ CL, R11
+ ADDB CL, R12
+
+ // val3 := br3.peekTopBits(peekBits)
+ MOVQ R11, R13
+ MOVQ DI, CX
+ SHRQ CL, R13
+
+ // v3 := table[val0&mask]
+ MOVW (R9)(R13*2), CX
+
+ // br3.advance(uint8(v3.entry)
+ MOVB CH, AL
+ SHLQ CL, R11
+ ADDB CL, R12
+ BSWAPL AX
+
+ // these four writes get coalesced
+ // out[id * dstEvery + 0] = uint8(v0.entry >> 8)
+ // out[id * dstEvery + 1] = uint8(v1.entry >> 8)
+ // out[id * dstEvery + 3] = uint8(v2.entry >> 8)
+ // out[id * dstEvery + 4] = uint8(v3.entry >> 8)
+ LEAQ (R8)(R8*2), CX
+ MOVL AX, (BX)(CX*1)
+
+ // update the bitreader structure
+ MOVQ R11, 176(R10)
+ MOVB R12, 184(R10)
+ ADDQ $0x04, BX
+ TESTB DL, DL
+ JZ main_loop
+ MOVQ ctx+0(FP), AX
+ SUBQ 16(AX), BX
+ SHLQ $0x02, BX
+ MOVQ BX, 40(AX)
+ RET
+
+// func decompress1x_main_loop_amd64(ctx *decompress1xContext)
+TEXT ·decompress1x_main_loop_amd64(SB), $0-8
+ MOVQ ctx+0(FP), CX
+ MOVQ 16(CX), DX
+ MOVQ 24(CX), BX
+ CMPQ BX, $0x04
+ JB error_max_decoded_size_exceeded
+ LEAQ (DX)(BX*1), BX
+ MOVQ (CX), SI
+ MOVQ (SI), R8
+ MOVQ 24(SI), R9
+ MOVQ 32(SI), R10
+ MOVBQZX 40(SI), R11
+ MOVQ 32(CX), SI
+ MOVBQZX 8(CX), DI
+ JMP loop_condition
+
+main_loop:
+ // Check if we have room for 4 bytes in the output buffer
+ LEAQ 4(DX), CX
+ CMPQ CX, BX
+ JGE error_max_decoded_size_exceeded
+
+ // Decode 4 values
+ CMPQ R11, $0x20
+ JL bitReader_fillFast_1_end
+ SUBQ $0x20, R11
+ SUBQ $0x04, R9
+ MOVL (R8)(R9*1), R12
+ MOVQ R11, CX
+ SHLQ CL, R12
+ ORQ R12, R10
+
+bitReader_fillFast_1_end:
+ MOVQ DI, CX
+ MOVQ R10, R12
+ SHRQ CL, R12
+ MOVW (SI)(R12*2), CX
+ MOVB CH, AL
+ MOVBQZX CL, CX
+ ADDQ CX, R11
+ SHLQ CL, R10
+ MOVQ DI, CX
+ MOVQ R10, R12
+ SHRQ CL, R12
+ MOVW (SI)(R12*2), CX
+ MOVB CH, AH
+ MOVBQZX CL, CX
+ ADDQ CX, R11
+ SHLQ CL, R10
+ BSWAPL AX
+ CMPQ R11, $0x20
+ JL bitReader_fillFast_2_end
+ SUBQ $0x20, R11
+ SUBQ $0x04, R9
+ MOVL (R8)(R9*1), R12
+ MOVQ R11, CX
+ SHLQ CL, R12
+ ORQ R12, R10
+
+bitReader_fillFast_2_end:
+ MOVQ DI, CX
+ MOVQ R10, R12
+ SHRQ CL, R12
+ MOVW (SI)(R12*2), CX
+ MOVB CH, AH
+ MOVBQZX CL, CX
+ ADDQ CX, R11
+ SHLQ CL, R10
+ MOVQ DI, CX
+ MOVQ R10, R12
+ SHRQ CL, R12
+ MOVW (SI)(R12*2), CX
+ MOVB CH, AL
+ MOVBQZX CL, CX
+ ADDQ CX, R11
+ SHLQ CL, R10
+ BSWAPL AX
+
+ // Store the decoded values
+ MOVL AX, (DX)
+ ADDQ $0x04, DX
+
+loop_condition:
+ CMPQ R9, $0x08
+ JGE main_loop
+
+ // Update ctx structure
+ MOVQ ctx+0(FP), AX
+ SUBQ 16(AX), DX
+ MOVQ DX, 40(AX)
+ MOVQ (AX), AX
+ MOVQ R9, 24(AX)
+ MOVQ R10, 32(AX)
+ MOVB R11, 40(AX)
+ RET
+
+ // Report error
+error_max_decoded_size_exceeded:
+ MOVQ ctx+0(FP), AX
+ MOVQ $-1, CX
+ MOVQ CX, 40(AX)
+ RET
+
+// func decompress1x_main_loop_bmi2(ctx *decompress1xContext)
+// Requires: BMI2
+TEXT ·decompress1x_main_loop_bmi2(SB), $0-8
+ MOVQ ctx+0(FP), CX
+ MOVQ 16(CX), DX
+ MOVQ 24(CX), BX
+ CMPQ BX, $0x04
+ JB error_max_decoded_size_exceeded
+ LEAQ (DX)(BX*1), BX
+ MOVQ (CX), SI
+ MOVQ (SI), R8
+ MOVQ 24(SI), R9
+ MOVQ 32(SI), R10
+ MOVBQZX 40(SI), R11
+ MOVQ 32(CX), SI
+ MOVBQZX 8(CX), DI
+ JMP loop_condition
+
+main_loop:
+ // Check if we have room for 4 bytes in the output buffer
+ LEAQ 4(DX), CX
+ CMPQ CX, BX
+ JGE error_max_decoded_size_exceeded
+
+ // Decode 4 values
+ CMPQ R11, $0x20
+ JL bitReader_fillFast_1_end
+ SUBQ $0x20, R11
+ SUBQ $0x04, R9
+ MOVL (R8)(R9*1), CX
+ SHLXQ R11, CX, CX
+ ORQ CX, R10
+
+bitReader_fillFast_1_end:
+ SHRXQ DI, R10, CX
+ MOVW (SI)(CX*2), CX
+ MOVB CH, AL
+ MOVBQZX CL, CX
+ ADDQ CX, R11
+ SHLXQ CX, R10, R10
+ SHRXQ DI, R10, CX
+ MOVW (SI)(CX*2), CX
+ MOVB CH, AH
+ MOVBQZX CL, CX
+ ADDQ CX, R11
+ SHLXQ CX, R10, R10
+ BSWAPL AX
+ CMPQ R11, $0x20
+ JL bitReader_fillFast_2_end
+ SUBQ $0x20, R11
+ SUBQ $0x04, R9
+ MOVL (R8)(R9*1), CX
+ SHLXQ R11, CX, CX
+ ORQ CX, R10
+
+bitReader_fillFast_2_end:
+ SHRXQ DI, R10, CX
+ MOVW (SI)(CX*2), CX
+ MOVB CH, AH
+ MOVBQZX CL, CX
+ ADDQ CX, R11
+ SHLXQ CX, R10, R10
+ SHRXQ DI, R10, CX
+ MOVW (SI)(CX*2), CX
+ MOVB CH, AL
+ MOVBQZX CL, CX
+ ADDQ CX, R11
+ SHLXQ CX, R10, R10
+ BSWAPL AX
+
+ // Store the decoded values
+ MOVL AX, (DX)
+ ADDQ $0x04, DX
+
+loop_condition:
+ CMPQ R9, $0x08
+ JGE main_loop
+
+ // Update ctx structure
+ MOVQ ctx+0(FP), AX
+ SUBQ 16(AX), DX
+ MOVQ DX, 40(AX)
+ MOVQ (AX), AX
+ MOVQ R9, 24(AX)
+ MOVQ R10, 32(AX)
+ MOVB R11, 40(AX)
+ RET
+
+ // Report error
+error_max_decoded_size_exceeded:
+ MOVQ ctx+0(FP), AX
+ MOVQ $-1, CX
+ MOVQ CX, 40(AX)
+ RET
diff --git a/vendor/github.com/klauspost/compress/huff0/decompress_generic.go b/vendor/github.com/klauspost/compress/huff0/decompress_generic.go
new file mode 100644
index 00000000..908c17de
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/huff0/decompress_generic.go
@@ -0,0 +1,299 @@
+//go:build !amd64 || appengine || !gc || noasm
+// +build !amd64 appengine !gc noasm
+
+// This file contains a generic implementation of Decoder.Decompress4X.
+package huff0
+
+import (
+ "errors"
+ "fmt"
+)
+
+// Decompress4X will decompress a 4X encoded stream.
+// The length of the supplied input must match the end of a block exactly.
+// The *capacity* of the dst slice must match the destination size of
+// the uncompressed data exactly.
+func (d *Decoder) Decompress4X(dst, src []byte) ([]byte, error) {
+ if len(d.dt.single) == 0 {
+ return nil, errors.New("no table loaded")
+ }
+ if len(src) < 6+(4*1) {
+ return nil, errors.New("input too small")
+ }
+ if use8BitTables && d.actualTableLog <= 8 {
+ return d.decompress4X8bit(dst, src)
+ }
+
+ var br [4]bitReaderShifted
+ // Decode "jump table"
+ start := 6
+ for i := 0; i < 3; i++ {
+ length := int(src[i*2]) | (int(src[i*2+1]) << 8)
+ if start+length >= len(src) {
+ return nil, errors.New("truncated input (or invalid offset)")
+ }
+ err := br[i].init(src[start : start+length])
+ if err != nil {
+ return nil, err
+ }
+ start += length
+ }
+ err := br[3].init(src[start:])
+ if err != nil {
+ return nil, err
+ }
+
+ // destination, offset to match first output
+ dstSize := cap(dst)
+ dst = dst[:dstSize]
+ out := dst
+ dstEvery := (dstSize + 3) / 4
+
+ const tlSize = 1 << tableLogMax
+ const tlMask = tlSize - 1
+ single := d.dt.single[:tlSize]
+
+ // Use temp table to avoid bound checks/append penalty.
+ buf := d.buffer()
+ var off uint8
+ var decoded int
+
+ // Decode 2 values from each decoder/loop.
+ const bufoff = 256
+ for {
+ if br[0].off < 4 || br[1].off < 4 || br[2].off < 4 || br[3].off < 4 {
+ break
+ }
+
+ {
+ const stream = 0
+ const stream2 = 1
+ br[stream].fillFast()
+ br[stream2].fillFast()
+
+ val := br[stream].peekBitsFast(d.actualTableLog)
+ val2 := br[stream2].peekBitsFast(d.actualTableLog)
+ v := single[val&tlMask]
+ v2 := single[val2&tlMask]
+ br[stream].advance(uint8(v.entry))
+ br[stream2].advance(uint8(v2.entry))
+ buf[stream][off] = uint8(v.entry >> 8)
+ buf[stream2][off] = uint8(v2.entry >> 8)
+
+ val = br[stream].peekBitsFast(d.actualTableLog)
+ val2 = br[stream2].peekBitsFast(d.actualTableLog)
+ v = single[val&tlMask]
+ v2 = single[val2&tlMask]
+ br[stream].advance(uint8(v.entry))
+ br[stream2].advance(uint8(v2.entry))
+ buf[stream][off+1] = uint8(v.entry >> 8)
+ buf[stream2][off+1] = uint8(v2.entry >> 8)
+ }
+
+ {
+ const stream = 2
+ const stream2 = 3
+ br[stream].fillFast()
+ br[stream2].fillFast()
+
+ val := br[stream].peekBitsFast(d.actualTableLog)
+ val2 := br[stream2].peekBitsFast(d.actualTableLog)
+ v := single[val&tlMask]
+ v2 := single[val2&tlMask]
+ br[stream].advance(uint8(v.entry))
+ br[stream2].advance(uint8(v2.entry))
+ buf[stream][off] = uint8(v.entry >> 8)
+ buf[stream2][off] = uint8(v2.entry >> 8)
+
+ val = br[stream].peekBitsFast(d.actualTableLog)
+ val2 = br[stream2].peekBitsFast(d.actualTableLog)
+ v = single[val&tlMask]
+ v2 = single[val2&tlMask]
+ br[stream].advance(uint8(v.entry))
+ br[stream2].advance(uint8(v2.entry))
+ buf[stream][off+1] = uint8(v.entry >> 8)
+ buf[stream2][off+1] = uint8(v2.entry >> 8)
+ }
+
+ off += 2
+
+ if off == 0 {
+ if bufoff > dstEvery {
+ d.bufs.Put(buf)
+ return nil, errors.New("corruption detected: stream overrun 1")
+ }
+ // There must at least be 3 buffers left.
+ if len(out)-bufoff < dstEvery*3 {
+ d.bufs.Put(buf)
+ return nil, errors.New("corruption detected: stream overrun 2")
+ }
+ //copy(out, buf[0][:])
+ //copy(out[dstEvery:], buf[1][:])
+ //copy(out[dstEvery*2:], buf[2][:])
+ //copy(out[dstEvery*3:], buf[3][:])
+ *(*[bufoff]byte)(out) = buf[0]
+ *(*[bufoff]byte)(out[dstEvery:]) = buf[1]
+ *(*[bufoff]byte)(out[dstEvery*2:]) = buf[2]
+ *(*[bufoff]byte)(out[dstEvery*3:]) = buf[3]
+ out = out[bufoff:]
+ decoded += bufoff * 4
+ }
+ }
+ if off > 0 {
+ ioff := int(off)
+ if len(out) < dstEvery*3+ioff {
+ d.bufs.Put(buf)
+ return nil, errors.New("corruption detected: stream overrun 3")
+ }
+ copy(out, buf[0][:off])
+ copy(out[dstEvery:], buf[1][:off])
+ copy(out[dstEvery*2:], buf[2][:off])
+ copy(out[dstEvery*3:], buf[3][:off])
+ decoded += int(off) * 4
+ out = out[off:]
+ }
+
+ // Decode remaining.
+ remainBytes := dstEvery - (decoded / 4)
+ for i := range br {
+ offset := dstEvery * i
+ endsAt := offset + remainBytes
+ if endsAt > len(out) {
+ endsAt = len(out)
+ }
+ br := &br[i]
+ bitsLeft := br.remaining()
+ for bitsLeft > 0 {
+ br.fill()
+ if offset >= endsAt {
+ d.bufs.Put(buf)
+ return nil, errors.New("corruption detected: stream overrun 4")
+ }
+
+ // Read value and increment offset.
+ val := br.peekBitsFast(d.actualTableLog)
+ v := single[val&tlMask].entry
+ nBits := uint8(v)
+ br.advance(nBits)
+ bitsLeft -= uint(nBits)
+ out[offset] = uint8(v >> 8)
+ offset++
+ }
+ if offset != endsAt {
+ d.bufs.Put(buf)
+ return nil, fmt.Errorf("corruption detected: short output block %d, end %d != %d", i, offset, endsAt)
+ }
+ decoded += offset - dstEvery*i
+ err = br.close()
+ if err != nil {
+ return nil, err
+ }
+ }
+ d.bufs.Put(buf)
+ if dstSize != decoded {
+ return nil, errors.New("corruption detected: short output block")
+ }
+ return dst, nil
+}
+
+// Decompress1X will decompress a 1X encoded stream.
+// The cap of the output buffer will be the maximum decompressed size.
+// The length of the supplied input must match the end of a block exactly.
+func (d *Decoder) Decompress1X(dst, src []byte) ([]byte, error) {
+ if len(d.dt.single) == 0 {
+ return nil, errors.New("no table loaded")
+ }
+ if use8BitTables && d.actualTableLog <= 8 {
+ return d.decompress1X8Bit(dst, src)
+ }
+ var br bitReaderShifted
+ err := br.init(src)
+ if err != nil {
+ return dst, err
+ }
+ maxDecodedSize := cap(dst)
+ dst = dst[:0]
+
+ // Avoid bounds check by always having full sized table.
+ const tlSize = 1 << tableLogMax
+ const tlMask = tlSize - 1
+ dt := d.dt.single[:tlSize]
+
+ // Use temp table to avoid bound checks/append penalty.
+ bufs := d.buffer()
+ buf := &bufs[0]
+ var off uint8
+
+ for br.off >= 8 {
+ br.fillFast()
+ v := dt[br.peekBitsFast(d.actualTableLog)&tlMask]
+ br.advance(uint8(v.entry))
+ buf[off+0] = uint8(v.entry >> 8)
+
+ v = dt[br.peekBitsFast(d.actualTableLog)&tlMask]
+ br.advance(uint8(v.entry))
+ buf[off+1] = uint8(v.entry >> 8)
+
+ // Refill
+ br.fillFast()
+
+ v = dt[br.peekBitsFast(d.actualTableLog)&tlMask]
+ br.advance(uint8(v.entry))
+ buf[off+2] = uint8(v.entry >> 8)
+
+ v = dt[br.peekBitsFast(d.actualTableLog)&tlMask]
+ br.advance(uint8(v.entry))
+ buf[off+3] = uint8(v.entry >> 8)
+
+ off += 4
+ if off == 0 {
+ if len(dst)+256 > maxDecodedSize {
+ br.close()
+ d.bufs.Put(bufs)
+ return nil, ErrMaxDecodedSizeExceeded
+ }
+ dst = append(dst, buf[:]...)
+ }
+ }
+
+ if len(dst)+int(off) > maxDecodedSize {
+ d.bufs.Put(bufs)
+ br.close()
+ return nil, ErrMaxDecodedSizeExceeded
+ }
+ dst = append(dst, buf[:off]...)
+
+ // br < 8, so uint8 is fine
+ bitsLeft := uint8(br.off)*8 + 64 - br.bitsRead
+ for bitsLeft > 0 {
+ br.fill()
+ if false && br.bitsRead >= 32 {
+ if br.off >= 4 {
+ v := br.in[br.off-4:]
+ v = v[:4]
+ low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24)
+ br.value = (br.value << 32) | uint64(low)
+ br.bitsRead -= 32
+ br.off -= 4
+ } else {
+ for br.off > 0 {
+ br.value = (br.value << 8) | uint64(br.in[br.off-1])
+ br.bitsRead -= 8
+ br.off--
+ }
+ }
+ }
+ if len(dst) >= maxDecodedSize {
+ d.bufs.Put(bufs)
+ br.close()
+ return nil, ErrMaxDecodedSizeExceeded
+ }
+ v := d.dt.single[br.peekBitsFast(d.actualTableLog)&tlMask]
+ nBits := uint8(v.entry)
+ br.advance(nBits)
+ bitsLeft -= nBits
+ dst = append(dst, uint8(v.entry>>8))
+ }
+ d.bufs.Put(bufs)
+ return dst, br.close()
+}
diff --git a/vendor/github.com/klauspost/compress/huff0/huff0.go b/vendor/github.com/klauspost/compress/huff0/huff0.go
new file mode 100644
index 00000000..77ecd68e
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/huff0/huff0.go
@@ -0,0 +1,337 @@
+// Package huff0 provides fast huffman encoding as used in zstd.
+//
+// See README.md at https://github.com/klauspost/compress/tree/master/huff0 for details.
+package huff0
+
+import (
+ "errors"
+ "fmt"
+ "math"
+ "math/bits"
+ "sync"
+
+ "github.com/klauspost/compress/fse"
+)
+
+const (
+ maxSymbolValue = 255
+
+ // zstandard limits tablelog to 11, see:
+ // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#huffman-tree-description
+ tableLogMax = 11
+ tableLogDefault = 11
+ minTablelog = 5
+ huffNodesLen = 512
+
+ // BlockSizeMax is maximum input size for a single block uncompressed.
+ BlockSizeMax = 1<<18 - 1
+)
+
+var (
+ // ErrIncompressible is returned when input is judged to be too hard to compress.
+ ErrIncompressible = errors.New("input is not compressible")
+
+ // ErrUseRLE is returned from the compressor when the input is a single byte value repeated.
+ ErrUseRLE = errors.New("input is single value repeated")
+
+ // ErrTooBig is return if input is too large for a single block.
+ ErrTooBig = errors.New("input too big")
+
+ // ErrMaxDecodedSizeExceeded is return if input is too large for a single block.
+ ErrMaxDecodedSizeExceeded = errors.New("maximum output size exceeded")
+)
+
+type ReusePolicy uint8
+
+const (
+ // ReusePolicyAllow will allow reuse if it produces smaller output.
+ ReusePolicyAllow ReusePolicy = iota
+
+ // ReusePolicyPrefer will re-use aggressively if possible.
+ // This will not check if a new table will produce smaller output,
+ // except if the current table is impossible to use or
+ // compressed output is bigger than input.
+ ReusePolicyPrefer
+
+ // ReusePolicyNone will disable re-use of tables.
+ // This is slightly faster than ReusePolicyAllow but may produce larger output.
+ ReusePolicyNone
+
+ // ReusePolicyMust must allow reuse and produce smaller output.
+ ReusePolicyMust
+)
+
+type Scratch struct {
+ count [maxSymbolValue + 1]uint32
+
+ // Per block parameters.
+ // These can be used to override compression parameters of the block.
+ // Do not touch, unless you know what you are doing.
+
+ // Out is output buffer.
+ // If the scratch is re-used before the caller is done processing the output,
+ // set this field to nil.
+ // Otherwise the output buffer will be re-used for next Compression/Decompression step
+ // and allocation will be avoided.
+ Out []byte
+
+ // OutTable will contain the table data only, if a new table has been generated.
+ // Slice of the returned data.
+ OutTable []byte
+
+ // OutData will contain the compressed data.
+ // Slice of the returned data.
+ OutData []byte
+
+ // MaxDecodedSize will set the maximum allowed output size.
+ // This value will automatically be set to BlockSizeMax if not set.
+ // Decoders will return ErrMaxDecodedSizeExceeded is this limit is exceeded.
+ MaxDecodedSize int
+
+ srcLen int
+
+ // MaxSymbolValue will override the maximum symbol value of the next block.
+ MaxSymbolValue uint8
+
+ // TableLog will attempt to override the tablelog for the next block.
+ // Must be <= 11 and >= 5.
+ TableLog uint8
+
+ // Reuse will specify the reuse policy
+ Reuse ReusePolicy
+
+ // WantLogLess allows to specify a log 2 reduction that should at least be achieved,
+ // otherwise the block will be returned as incompressible.
+ // The reduction should then at least be (input size >> WantLogLess)
+ // If WantLogLess == 0 any improvement will do.
+ WantLogLess uint8
+
+ symbolLen uint16 // Length of active part of the symbol table.
+ maxCount int // count of the most probable symbol
+ clearCount bool // clear count
+ actualTableLog uint8 // Selected tablelog.
+ prevTableLog uint8 // Tablelog for previous table
+ prevTable cTable // Table used for previous compression.
+ cTable cTable // compression table
+ dt dTable // decompression table
+ nodes []nodeElt
+ tmpOut [4][]byte
+ fse *fse.Scratch
+ decPool sync.Pool // *[4][256]byte buffers.
+ huffWeight [maxSymbolValue + 1]byte
+}
+
+// TransferCTable will transfer the previously used compression table.
+func (s *Scratch) TransferCTable(src *Scratch) {
+ if cap(s.prevTable) < len(src.prevTable) {
+ s.prevTable = make(cTable, 0, maxSymbolValue+1)
+ }
+ s.prevTable = s.prevTable[:len(src.prevTable)]
+ copy(s.prevTable, src.prevTable)
+ s.prevTableLog = src.prevTableLog
+}
+
+func (s *Scratch) prepare(in []byte) (*Scratch, error) {
+ if len(in) > BlockSizeMax {
+ return nil, ErrTooBig
+ }
+ if s == nil {
+ s = &Scratch{}
+ }
+ if s.MaxSymbolValue == 0 {
+ s.MaxSymbolValue = maxSymbolValue
+ }
+ if s.TableLog == 0 {
+ s.TableLog = tableLogDefault
+ }
+ if s.TableLog > tableLogMax || s.TableLog < minTablelog {
+ return nil, fmt.Errorf(" invalid tableLog %d (%d -> %d)", s.TableLog, minTablelog, tableLogMax)
+ }
+ if s.MaxDecodedSize <= 0 || s.MaxDecodedSize > BlockSizeMax {
+ s.MaxDecodedSize = BlockSizeMax
+ }
+ if s.clearCount && s.maxCount == 0 {
+ for i := range s.count {
+ s.count[i] = 0
+ }
+ s.clearCount = false
+ }
+ if cap(s.Out) == 0 {
+ s.Out = make([]byte, 0, len(in))
+ }
+ s.Out = s.Out[:0]
+
+ s.OutTable = nil
+ s.OutData = nil
+ if cap(s.nodes) < huffNodesLen+1 {
+ s.nodes = make([]nodeElt, 0, huffNodesLen+1)
+ }
+ s.nodes = s.nodes[:0]
+ if s.fse == nil {
+ s.fse = &fse.Scratch{}
+ }
+ s.srcLen = len(in)
+
+ return s, nil
+}
+
+type cTable []cTableEntry
+
+func (c cTable) write(s *Scratch) error {
+ var (
+ // precomputed conversion table
+ bitsToWeight [tableLogMax + 1]byte
+ huffLog = s.actualTableLog
+ // last weight is not saved.
+ maxSymbolValue = uint8(s.symbolLen - 1)
+ huffWeight = s.huffWeight[:256]
+ )
+ const (
+ maxFSETableLog = 6
+ )
+ // convert to weight
+ bitsToWeight[0] = 0
+ for n := uint8(1); n < huffLog+1; n++ {
+ bitsToWeight[n] = huffLog + 1 - n
+ }
+
+ // Acquire histogram for FSE.
+ hist := s.fse.Histogram()
+ hist = hist[:256]
+ for i := range hist[:16] {
+ hist[i] = 0
+ }
+ for n := uint8(0); n < maxSymbolValue; n++ {
+ v := bitsToWeight[c[n].nBits] & 15
+ huffWeight[n] = v
+ hist[v]++
+ }
+
+ // FSE compress if feasible.
+ if maxSymbolValue >= 2 {
+ huffMaxCnt := uint32(0)
+ huffMax := uint8(0)
+ for i, v := range hist[:16] {
+ if v == 0 {
+ continue
+ }
+ huffMax = byte(i)
+ if v > huffMaxCnt {
+ huffMaxCnt = v
+ }
+ }
+ s.fse.HistogramFinished(huffMax, int(huffMaxCnt))
+ s.fse.TableLog = maxFSETableLog
+ b, err := fse.Compress(huffWeight[:maxSymbolValue], s.fse)
+ if err == nil && len(b) < int(s.symbolLen>>1) {
+ s.Out = append(s.Out, uint8(len(b)))
+ s.Out = append(s.Out, b...)
+ return nil
+ }
+ // Unable to compress (RLE/uncompressible)
+ }
+ // write raw values as 4-bits (max : 15)
+ if maxSymbolValue > (256 - 128) {
+ // should not happen : likely means source cannot be compressed
+ return ErrIncompressible
+ }
+ op := s.Out
+ // special case, pack weights 4 bits/weight.
+ op = append(op, 128|(maxSymbolValue-1))
+ // be sure it doesn't cause msan issue in final combination
+ huffWeight[maxSymbolValue] = 0
+ for n := uint16(0); n < uint16(maxSymbolValue); n += 2 {
+ op = append(op, (huffWeight[n]<<4)|huffWeight[n+1])
+ }
+ s.Out = op
+ return nil
+}
+
+func (c cTable) estTableSize(s *Scratch) (sz int, err error) {
+ var (
+ // precomputed conversion table
+ bitsToWeight [tableLogMax + 1]byte
+ huffLog = s.actualTableLog
+ // last weight is not saved.
+ maxSymbolValue = uint8(s.symbolLen - 1)
+ huffWeight = s.huffWeight[:256]
+ )
+ const (
+ maxFSETableLog = 6
+ )
+ // convert to weight
+ bitsToWeight[0] = 0
+ for n := uint8(1); n < huffLog+1; n++ {
+ bitsToWeight[n] = huffLog + 1 - n
+ }
+
+ // Acquire histogram for FSE.
+ hist := s.fse.Histogram()
+ hist = hist[:256]
+ for i := range hist[:16] {
+ hist[i] = 0
+ }
+ for n := uint8(0); n < maxSymbolValue; n++ {
+ v := bitsToWeight[c[n].nBits] & 15
+ huffWeight[n] = v
+ hist[v]++
+ }
+
+ // FSE compress if feasible.
+ if maxSymbolValue >= 2 {
+ huffMaxCnt := uint32(0)
+ huffMax := uint8(0)
+ for i, v := range hist[:16] {
+ if v == 0 {
+ continue
+ }
+ huffMax = byte(i)
+ if v > huffMaxCnt {
+ huffMaxCnt = v
+ }
+ }
+ s.fse.HistogramFinished(huffMax, int(huffMaxCnt))
+ s.fse.TableLog = maxFSETableLog
+ b, err := fse.Compress(huffWeight[:maxSymbolValue], s.fse)
+ if err == nil && len(b) < int(s.symbolLen>>1) {
+ sz += 1 + len(b)
+ return sz, nil
+ }
+ // Unable to compress (RLE/uncompressible)
+ }
+ // write raw values as 4-bits (max : 15)
+ if maxSymbolValue > (256 - 128) {
+ // should not happen : likely means source cannot be compressed
+ return 0, ErrIncompressible
+ }
+ // special case, pack weights 4 bits/weight.
+ sz += 1 + int(maxSymbolValue/2)
+ return sz, nil
+}
+
+// estimateSize returns the estimated size in bytes of the input represented in the
+// histogram supplied.
+func (c cTable) estimateSize(hist []uint32) int {
+ nbBits := uint32(7)
+ for i, v := range c[:len(hist)] {
+ nbBits += uint32(v.nBits) * hist[i]
+ }
+ return int(nbBits >> 3)
+}
+
+// minSize returns the minimum possible size considering the shannon limit.
+func (s *Scratch) minSize(total int) int {
+ nbBits := float64(7)
+ fTotal := float64(total)
+ for _, v := range s.count[:s.symbolLen] {
+ n := float64(v)
+ if n > 0 {
+ nbBits += math.Log2(fTotal/n) * n
+ }
+ }
+ return int(nbBits) >> 3
+}
+
+func highBit32(val uint32) (n uint32) {
+ return uint32(bits.Len32(val) - 1)
+}
diff --git a/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo.go b/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo.go
new file mode 100644
index 00000000..3954c512
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo.go
@@ -0,0 +1,34 @@
+// Package cpuinfo gives runtime info about the current CPU.
+//
+// This is a very limited module meant for use internally
+// in this project. For more versatile solution check
+// https://github.com/klauspost/cpuid.
+package cpuinfo
+
+// HasBMI1 checks whether an x86 CPU supports the BMI1 extension.
+func HasBMI1() bool {
+ return hasBMI1
+}
+
+// HasBMI2 checks whether an x86 CPU supports the BMI2 extension.
+func HasBMI2() bool {
+ return hasBMI2
+}
+
+// DisableBMI2 will disable BMI2, for testing purposes.
+// Call returned function to restore previous state.
+func DisableBMI2() func() {
+ old := hasBMI2
+ hasBMI2 = false
+ return func() {
+ hasBMI2 = old
+ }
+}
+
+// HasBMI checks whether an x86 CPU supports both BMI1 and BMI2 extensions.
+func HasBMI() bool {
+ return HasBMI1() && HasBMI2()
+}
+
+var hasBMI1 bool
+var hasBMI2 bool
diff --git a/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.go b/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.go
new file mode 100644
index 00000000..e802579c
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.go
@@ -0,0 +1,11 @@
+//go:build amd64 && !appengine && !noasm && gc
+// +build amd64,!appengine,!noasm,gc
+
+package cpuinfo
+
+// go:noescape
+func x86extensions() (bmi1, bmi2 bool)
+
+func init() {
+ hasBMI1, hasBMI2 = x86extensions()
+}
diff --git a/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.s b/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.s
new file mode 100644
index 00000000..4465fbe9
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.s
@@ -0,0 +1,36 @@
+// +build !appengine
+// +build gc
+// +build !noasm
+
+#include "textflag.h"
+#include "funcdata.h"
+#include "go_asm.h"
+
+TEXT ·x86extensions(SB), NOSPLIT, $0
+ // 1. determine max EAX value
+ XORQ AX, AX
+ CPUID
+
+ CMPQ AX, $7
+ JB unsupported
+
+ // 2. EAX = 7, ECX = 0 --- see Table 3-8 "Information Returned by CPUID Instruction"
+ MOVQ $7, AX
+ MOVQ $0, CX
+ CPUID
+
+ BTQ $3, BX // bit 3 = BMI1
+ SETCS AL
+
+ BTQ $8, BX // bit 8 = BMI2
+ SETCS AH
+
+ MOVB AL, bmi1+0(FP)
+ MOVB AH, bmi2+1(FP)
+ RET
+
+unsupported:
+ XORQ AX, AX
+ MOVB AL, bmi1+0(FP)
+ MOVB AL, bmi2+1(FP)
+ RET
diff --git a/vendor/github.com/packethost/packngo/LICENSE.txt b/vendor/github.com/klauspost/compress/internal/snapref/LICENSE
similarity index 52%
rename from vendor/github.com/packethost/packngo/LICENSE.txt
rename to vendor/github.com/klauspost/compress/internal/snapref/LICENSE
index 57c50110..6050c10f 100644
--- a/vendor/github.com/packethost/packngo/LICENSE.txt
+++ b/vendor/github.com/klauspost/compress/internal/snapref/LICENSE
@@ -1,32 +1,4 @@
-Copyright (c) 2014 The packngo AUTHORS. All rights reserved.
-
-MIT License
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-======================
-Portions of the client are based on code at:
-https://github.com/google/go-github/ and
-https://github.com/digitalocean/godo
-
-Copyright (c) 2013 The go-github AUTHORS. All rights reserved.
+Copyright (c) 2011 The Snappy-Go Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@@ -53,4 +25,3 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
diff --git a/vendor/github.com/klauspost/compress/internal/snapref/decode.go b/vendor/github.com/klauspost/compress/internal/snapref/decode.go
new file mode 100644
index 00000000..40796a49
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/internal/snapref/decode.go
@@ -0,0 +1,264 @@
+// Copyright 2011 The Snappy-Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package snapref
+
+import (
+ "encoding/binary"
+ "errors"
+ "io"
+)
+
+var (
+ // ErrCorrupt reports that the input is invalid.
+ ErrCorrupt = errors.New("snappy: corrupt input")
+ // ErrTooLarge reports that the uncompressed length is too large.
+ ErrTooLarge = errors.New("snappy: decoded block is too large")
+ // ErrUnsupported reports that the input isn't supported.
+ ErrUnsupported = errors.New("snappy: unsupported input")
+
+ errUnsupportedLiteralLength = errors.New("snappy: unsupported literal length")
+)
+
+// DecodedLen returns the length of the decoded block.
+func DecodedLen(src []byte) (int, error) {
+ v, _, err := decodedLen(src)
+ return v, err
+}
+
+// decodedLen returns the length of the decoded block and the number of bytes
+// that the length header occupied.
+func decodedLen(src []byte) (blockLen, headerLen int, err error) {
+ v, n := binary.Uvarint(src)
+ if n <= 0 || v > 0xffffffff {
+ return 0, 0, ErrCorrupt
+ }
+
+ const wordSize = 32 << (^uint(0) >> 32 & 1)
+ if wordSize == 32 && v > 0x7fffffff {
+ return 0, 0, ErrTooLarge
+ }
+ return int(v), n, nil
+}
+
+const (
+ decodeErrCodeCorrupt = 1
+ decodeErrCodeUnsupportedLiteralLength = 2
+)
+
+// Decode returns the decoded form of src. The returned slice may be a sub-
+// slice of dst if dst was large enough to hold the entire decoded block.
+// Otherwise, a newly allocated slice will be returned.
+//
+// The dst and src must not overlap. It is valid to pass a nil dst.
+//
+// Decode handles the Snappy block format, not the Snappy stream format.
+func Decode(dst, src []byte) ([]byte, error) {
+ dLen, s, err := decodedLen(src)
+ if err != nil {
+ return nil, err
+ }
+ if dLen <= len(dst) {
+ dst = dst[:dLen]
+ } else {
+ dst = make([]byte, dLen)
+ }
+ switch decode(dst, src[s:]) {
+ case 0:
+ return dst, nil
+ case decodeErrCodeUnsupportedLiteralLength:
+ return nil, errUnsupportedLiteralLength
+ }
+ return nil, ErrCorrupt
+}
+
+// NewReader returns a new Reader that decompresses from r, using the framing
+// format described at
+// https://github.com/google/snappy/blob/master/framing_format.txt
+func NewReader(r io.Reader) *Reader {
+ return &Reader{
+ r: r,
+ decoded: make([]byte, maxBlockSize),
+ buf: make([]byte, maxEncodedLenOfMaxBlockSize+checksumSize),
+ }
+}
+
+// Reader is an io.Reader that can read Snappy-compressed bytes.
+//
+// Reader handles the Snappy stream format, not the Snappy block format.
+type Reader struct {
+ r io.Reader
+ err error
+ decoded []byte
+ buf []byte
+ // decoded[i:j] contains decoded bytes that have not yet been passed on.
+ i, j int
+ readHeader bool
+}
+
+// Reset discards any buffered data, resets all state, and switches the Snappy
+// reader to read from r. This permits reusing a Reader rather than allocating
+// a new one.
+func (r *Reader) Reset(reader io.Reader) {
+ r.r = reader
+ r.err = nil
+ r.i = 0
+ r.j = 0
+ r.readHeader = false
+}
+
+func (r *Reader) readFull(p []byte, allowEOF bool) (ok bool) {
+ if _, r.err = io.ReadFull(r.r, p); r.err != nil {
+ if r.err == io.ErrUnexpectedEOF || (r.err == io.EOF && !allowEOF) {
+ r.err = ErrCorrupt
+ }
+ return false
+ }
+ return true
+}
+
+func (r *Reader) fill() error {
+ for r.i >= r.j {
+ if !r.readFull(r.buf[:4], true) {
+ return r.err
+ }
+ chunkType := r.buf[0]
+ if !r.readHeader {
+ if chunkType != chunkTypeStreamIdentifier {
+ r.err = ErrCorrupt
+ return r.err
+ }
+ r.readHeader = true
+ }
+ chunkLen := int(r.buf[1]) | int(r.buf[2])<<8 | int(r.buf[3])<<16
+ if chunkLen > len(r.buf) {
+ r.err = ErrUnsupported
+ return r.err
+ }
+
+ // The chunk types are specified at
+ // https://github.com/google/snappy/blob/master/framing_format.txt
+ switch chunkType {
+ case chunkTypeCompressedData:
+ // Section 4.2. Compressed data (chunk type 0x00).
+ if chunkLen < checksumSize {
+ r.err = ErrCorrupt
+ return r.err
+ }
+ buf := r.buf[:chunkLen]
+ if !r.readFull(buf, false) {
+ return r.err
+ }
+ checksum := uint32(buf[0]) | uint32(buf[1])<<8 | uint32(buf[2])<<16 | uint32(buf[3])<<24
+ buf = buf[checksumSize:]
+
+ n, err := DecodedLen(buf)
+ if err != nil {
+ r.err = err
+ return r.err
+ }
+ if n > len(r.decoded) {
+ r.err = ErrCorrupt
+ return r.err
+ }
+ if _, err := Decode(r.decoded, buf); err != nil {
+ r.err = err
+ return r.err
+ }
+ if crc(r.decoded[:n]) != checksum {
+ r.err = ErrCorrupt
+ return r.err
+ }
+ r.i, r.j = 0, n
+ continue
+
+ case chunkTypeUncompressedData:
+ // Section 4.3. Uncompressed data (chunk type 0x01).
+ if chunkLen < checksumSize {
+ r.err = ErrCorrupt
+ return r.err
+ }
+ buf := r.buf[:checksumSize]
+ if !r.readFull(buf, false) {
+ return r.err
+ }
+ checksum := uint32(buf[0]) | uint32(buf[1])<<8 | uint32(buf[2])<<16 | uint32(buf[3])<<24
+ // Read directly into r.decoded instead of via r.buf.
+ n := chunkLen - checksumSize
+ if n > len(r.decoded) {
+ r.err = ErrCorrupt
+ return r.err
+ }
+ if !r.readFull(r.decoded[:n], false) {
+ return r.err
+ }
+ if crc(r.decoded[:n]) != checksum {
+ r.err = ErrCorrupt
+ return r.err
+ }
+ r.i, r.j = 0, n
+ continue
+
+ case chunkTypeStreamIdentifier:
+ // Section 4.1. Stream identifier (chunk type 0xff).
+ if chunkLen != len(magicBody) {
+ r.err = ErrCorrupt
+ return r.err
+ }
+ if !r.readFull(r.buf[:len(magicBody)], false) {
+ return r.err
+ }
+ for i := 0; i < len(magicBody); i++ {
+ if r.buf[i] != magicBody[i] {
+ r.err = ErrCorrupt
+ return r.err
+ }
+ }
+ continue
+ }
+
+ if chunkType <= 0x7f {
+ // Section 4.5. Reserved unskippable chunks (chunk types 0x02-0x7f).
+ r.err = ErrUnsupported
+ return r.err
+ }
+ // Section 4.4 Padding (chunk type 0xfe).
+ // Section 4.6. Reserved skippable chunks (chunk types 0x80-0xfd).
+ if !r.readFull(r.buf[:chunkLen], false) {
+ return r.err
+ }
+ }
+
+ return nil
+}
+
+// Read satisfies the io.Reader interface.
+func (r *Reader) Read(p []byte) (int, error) {
+ if r.err != nil {
+ return 0, r.err
+ }
+
+ if err := r.fill(); err != nil {
+ return 0, err
+ }
+
+ n := copy(p, r.decoded[r.i:r.j])
+ r.i += n
+ return n, nil
+}
+
+// ReadByte satisfies the io.ByteReader interface.
+func (r *Reader) ReadByte() (byte, error) {
+ if r.err != nil {
+ return 0, r.err
+ }
+
+ if err := r.fill(); err != nil {
+ return 0, err
+ }
+
+ c := r.decoded[r.i]
+ r.i++
+ return c, nil
+}
diff --git a/vendor/github.com/klauspost/compress/internal/snapref/decode_other.go b/vendor/github.com/klauspost/compress/internal/snapref/decode_other.go
new file mode 100644
index 00000000..77395a6b
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/internal/snapref/decode_other.go
@@ -0,0 +1,113 @@
+// Copyright 2016 The Snappy-Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package snapref
+
+// decode writes the decoding of src to dst. It assumes that the varint-encoded
+// length of the decompressed bytes has already been read, and that len(dst)
+// equals that length.
+//
+// It returns 0 on success or a decodeErrCodeXxx error code on failure.
+func decode(dst, src []byte) int {
+ var d, s, offset, length int
+ for s < len(src) {
+ switch src[s] & 0x03 {
+ case tagLiteral:
+ x := uint32(src[s] >> 2)
+ switch {
+ case x < 60:
+ s++
+ case x == 60:
+ s += 2
+ if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line.
+ return decodeErrCodeCorrupt
+ }
+ x = uint32(src[s-1])
+ case x == 61:
+ s += 3
+ if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line.
+ return decodeErrCodeCorrupt
+ }
+ x = uint32(src[s-2]) | uint32(src[s-1])<<8
+ case x == 62:
+ s += 4
+ if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line.
+ return decodeErrCodeCorrupt
+ }
+ x = uint32(src[s-3]) | uint32(src[s-2])<<8 | uint32(src[s-1])<<16
+ case x == 63:
+ s += 5
+ if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line.
+ return decodeErrCodeCorrupt
+ }
+ x = uint32(src[s-4]) | uint32(src[s-3])<<8 | uint32(src[s-2])<<16 | uint32(src[s-1])<<24
+ }
+ length = int(x) + 1
+ if length <= 0 {
+ return decodeErrCodeUnsupportedLiteralLength
+ }
+ if length > len(dst)-d || length > len(src)-s {
+ return decodeErrCodeCorrupt
+ }
+ copy(dst[d:], src[s:s+length])
+ d += length
+ s += length
+ continue
+
+ case tagCopy1:
+ s += 2
+ if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line.
+ return decodeErrCodeCorrupt
+ }
+ length = 4 + int(src[s-2])>>2&0x7
+ offset = int(uint32(src[s-2])&0xe0<<3 | uint32(src[s-1]))
+
+ case tagCopy2:
+ s += 3
+ if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line.
+ return decodeErrCodeCorrupt
+ }
+ length = 1 + int(src[s-3])>>2
+ offset = int(uint32(src[s-2]) | uint32(src[s-1])<<8)
+
+ case tagCopy4:
+ s += 5
+ if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line.
+ return decodeErrCodeCorrupt
+ }
+ length = 1 + int(src[s-5])>>2
+ offset = int(uint32(src[s-4]) | uint32(src[s-3])<<8 | uint32(src[s-2])<<16 | uint32(src[s-1])<<24)
+ }
+
+ if offset <= 0 || d < offset || length > len(dst)-d {
+ return decodeErrCodeCorrupt
+ }
+ // Copy from an earlier sub-slice of dst to a later sub-slice.
+ // If no overlap, use the built-in copy:
+ if offset >= length {
+ copy(dst[d:d+length], dst[d-offset:])
+ d += length
+ continue
+ }
+
+ // Unlike the built-in copy function, this byte-by-byte copy always runs
+ // forwards, even if the slices overlap. Conceptually, this is:
+ //
+ // d += forwardCopy(dst[d:d+length], dst[d-offset:])
+ //
+ // We align the slices into a and b and show the compiler they are the same size.
+ // This allows the loop to run without bounds checks.
+ a := dst[d : d+length]
+ b := dst[d-offset:]
+ b = b[:len(a)]
+ for i := range a {
+ a[i] = b[i]
+ }
+ d += length
+ }
+ if d != len(dst) {
+ return decodeErrCodeCorrupt
+ }
+ return 0
+}
diff --git a/vendor/github.com/klauspost/compress/internal/snapref/encode.go b/vendor/github.com/klauspost/compress/internal/snapref/encode.go
new file mode 100644
index 00000000..13c6040a
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/internal/snapref/encode.go
@@ -0,0 +1,289 @@
+// Copyright 2011 The Snappy-Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package snapref
+
+import (
+ "encoding/binary"
+ "errors"
+ "io"
+)
+
+// Encode returns the encoded form of src. The returned slice may be a sub-
+// slice of dst if dst was large enough to hold the entire encoded block.
+// Otherwise, a newly allocated slice will be returned.
+//
+// The dst and src must not overlap. It is valid to pass a nil dst.
+//
+// Encode handles the Snappy block format, not the Snappy stream format.
+func Encode(dst, src []byte) []byte {
+ if n := MaxEncodedLen(len(src)); n < 0 {
+ panic(ErrTooLarge)
+ } else if len(dst) < n {
+ dst = make([]byte, n)
+ }
+
+ // The block starts with the varint-encoded length of the decompressed bytes.
+ d := binary.PutUvarint(dst, uint64(len(src)))
+
+ for len(src) > 0 {
+ p := src
+ src = nil
+ if len(p) > maxBlockSize {
+ p, src = p[:maxBlockSize], p[maxBlockSize:]
+ }
+ if len(p) < minNonLiteralBlockSize {
+ d += emitLiteral(dst[d:], p)
+ } else {
+ d += encodeBlock(dst[d:], p)
+ }
+ }
+ return dst[:d]
+}
+
+// inputMargin is the minimum number of extra input bytes to keep, inside
+// encodeBlock's inner loop. On some architectures, this margin lets us
+// implement a fast path for emitLiteral, where the copy of short (<= 16 byte)
+// literals can be implemented as a single load to and store from a 16-byte
+// register. That literal's actual length can be as short as 1 byte, so this
+// can copy up to 15 bytes too much, but that's OK as subsequent iterations of
+// the encoding loop will fix up the copy overrun, and this inputMargin ensures
+// that we don't overrun the dst and src buffers.
+const inputMargin = 16 - 1
+
+// minNonLiteralBlockSize is the minimum size of the input to encodeBlock that
+// could be encoded with a copy tag. This is the minimum with respect to the
+// algorithm used by encodeBlock, not a minimum enforced by the file format.
+//
+// The encoded output must start with at least a 1 byte literal, as there are
+// no previous bytes to copy. A minimal (1 byte) copy after that, generated
+// from an emitCopy call in encodeBlock's main loop, would require at least
+// another inputMargin bytes, for the reason above: we want any emitLiteral
+// calls inside encodeBlock's main loop to use the fast path if possible, which
+// requires being able to overrun by inputMargin bytes. Thus,
+// minNonLiteralBlockSize equals 1 + 1 + inputMargin.
+//
+// The C++ code doesn't use this exact threshold, but it could, as discussed at
+// https://groups.google.com/d/topic/snappy-compression/oGbhsdIJSJ8/discussion
+// The difference between Go (2+inputMargin) and C++ (inputMargin) is purely an
+// optimization. It should not affect the encoded form. This is tested by
+// TestSameEncodingAsCppShortCopies.
+const minNonLiteralBlockSize = 1 + 1 + inputMargin
+
+// MaxEncodedLen returns the maximum length of a snappy block, given its
+// uncompressed length.
+//
+// It will return a negative value if srcLen is too large to encode.
+func MaxEncodedLen(srcLen int) int {
+ n := uint64(srcLen)
+ if n > 0xffffffff {
+ return -1
+ }
+ // Compressed data can be defined as:
+ // compressed := item* literal*
+ // item := literal* copy
+ //
+ // The trailing literal sequence has a space blowup of at most 62/60
+ // since a literal of length 60 needs one tag byte + one extra byte
+ // for length information.
+ //
+ // Item blowup is trickier to measure. Suppose the "copy" op copies
+ // 4 bytes of data. Because of a special check in the encoding code,
+ // we produce a 4-byte copy only if the offset is < 65536. Therefore
+ // the copy op takes 3 bytes to encode, and this type of item leads
+ // to at most the 62/60 blowup for representing literals.
+ //
+ // Suppose the "copy" op copies 5 bytes of data. If the offset is big
+ // enough, it will take 5 bytes to encode the copy op. Therefore the
+ // worst case here is a one-byte literal followed by a five-byte copy.
+ // That is, 6 bytes of input turn into 7 bytes of "compressed" data.
+ //
+ // This last factor dominates the blowup, so the final estimate is:
+ n = 32 + n + n/6
+ if n > 0xffffffff {
+ return -1
+ }
+ return int(n)
+}
+
+var errClosed = errors.New("snappy: Writer is closed")
+
+// NewWriter returns a new Writer that compresses to w.
+//
+// The Writer returned does not buffer writes. There is no need to Flush or
+// Close such a Writer.
+//
+// Deprecated: the Writer returned is not suitable for many small writes, only
+// for few large writes. Use NewBufferedWriter instead, which is efficient
+// regardless of the frequency and shape of the writes, and remember to Close
+// that Writer when done.
+func NewWriter(w io.Writer) *Writer {
+ return &Writer{
+ w: w,
+ obuf: make([]byte, obufLen),
+ }
+}
+
+// NewBufferedWriter returns a new Writer that compresses to w, using the
+// framing format described at
+// https://github.com/google/snappy/blob/master/framing_format.txt
+//
+// The Writer returned buffers writes. Users must call Close to guarantee all
+// data has been forwarded to the underlying io.Writer. They may also call
+// Flush zero or more times before calling Close.
+func NewBufferedWriter(w io.Writer) *Writer {
+ return &Writer{
+ w: w,
+ ibuf: make([]byte, 0, maxBlockSize),
+ obuf: make([]byte, obufLen),
+ }
+}
+
+// Writer is an io.Writer that can write Snappy-compressed bytes.
+//
+// Writer handles the Snappy stream format, not the Snappy block format.
+type Writer struct {
+ w io.Writer
+ err error
+
+ // ibuf is a buffer for the incoming (uncompressed) bytes.
+ //
+ // Its use is optional. For backwards compatibility, Writers created by the
+ // NewWriter function have ibuf == nil, do not buffer incoming bytes, and
+ // therefore do not need to be Flush'ed or Close'd.
+ ibuf []byte
+
+ // obuf is a buffer for the outgoing (compressed) bytes.
+ obuf []byte
+
+ // wroteStreamHeader is whether we have written the stream header.
+ wroteStreamHeader bool
+}
+
+// Reset discards the writer's state and switches the Snappy writer to write to
+// w. This permits reusing a Writer rather than allocating a new one.
+func (w *Writer) Reset(writer io.Writer) {
+ w.w = writer
+ w.err = nil
+ if w.ibuf != nil {
+ w.ibuf = w.ibuf[:0]
+ }
+ w.wroteStreamHeader = false
+}
+
+// Write satisfies the io.Writer interface.
+func (w *Writer) Write(p []byte) (nRet int, errRet error) {
+ if w.ibuf == nil {
+ // Do not buffer incoming bytes. This does not perform or compress well
+ // if the caller of Writer.Write writes many small slices. This
+ // behavior is therefore deprecated, but still supported for backwards
+ // compatibility with code that doesn't explicitly Flush or Close.
+ return w.write(p)
+ }
+
+ // The remainder of this method is based on bufio.Writer.Write from the
+ // standard library.
+
+ for len(p) > (cap(w.ibuf)-len(w.ibuf)) && w.err == nil {
+ var n int
+ if len(w.ibuf) == 0 {
+ // Large write, empty buffer.
+ // Write directly from p to avoid copy.
+ n, _ = w.write(p)
+ } else {
+ n = copy(w.ibuf[len(w.ibuf):cap(w.ibuf)], p)
+ w.ibuf = w.ibuf[:len(w.ibuf)+n]
+ w.Flush()
+ }
+ nRet += n
+ p = p[n:]
+ }
+ if w.err != nil {
+ return nRet, w.err
+ }
+ n := copy(w.ibuf[len(w.ibuf):cap(w.ibuf)], p)
+ w.ibuf = w.ibuf[:len(w.ibuf)+n]
+ nRet += n
+ return nRet, nil
+}
+
+func (w *Writer) write(p []byte) (nRet int, errRet error) {
+ if w.err != nil {
+ return 0, w.err
+ }
+ for len(p) > 0 {
+ obufStart := len(magicChunk)
+ if !w.wroteStreamHeader {
+ w.wroteStreamHeader = true
+ copy(w.obuf, magicChunk)
+ obufStart = 0
+ }
+
+ var uncompressed []byte
+ if len(p) > maxBlockSize {
+ uncompressed, p = p[:maxBlockSize], p[maxBlockSize:]
+ } else {
+ uncompressed, p = p, nil
+ }
+ checksum := crc(uncompressed)
+
+ // Compress the buffer, discarding the result if the improvement
+ // isn't at least 12.5%.
+ compressed := Encode(w.obuf[obufHeaderLen:], uncompressed)
+ chunkType := uint8(chunkTypeCompressedData)
+ chunkLen := 4 + len(compressed)
+ obufEnd := obufHeaderLen + len(compressed)
+ if len(compressed) >= len(uncompressed)-len(uncompressed)/8 {
+ chunkType = chunkTypeUncompressedData
+ chunkLen = 4 + len(uncompressed)
+ obufEnd = obufHeaderLen
+ }
+
+ // Fill in the per-chunk header that comes before the body.
+ w.obuf[len(magicChunk)+0] = chunkType
+ w.obuf[len(magicChunk)+1] = uint8(chunkLen >> 0)
+ w.obuf[len(magicChunk)+2] = uint8(chunkLen >> 8)
+ w.obuf[len(magicChunk)+3] = uint8(chunkLen >> 16)
+ w.obuf[len(magicChunk)+4] = uint8(checksum >> 0)
+ w.obuf[len(magicChunk)+5] = uint8(checksum >> 8)
+ w.obuf[len(magicChunk)+6] = uint8(checksum >> 16)
+ w.obuf[len(magicChunk)+7] = uint8(checksum >> 24)
+
+ if _, err := w.w.Write(w.obuf[obufStart:obufEnd]); err != nil {
+ w.err = err
+ return nRet, err
+ }
+ if chunkType == chunkTypeUncompressedData {
+ if _, err := w.w.Write(uncompressed); err != nil {
+ w.err = err
+ return nRet, err
+ }
+ }
+ nRet += len(uncompressed)
+ }
+ return nRet, nil
+}
+
+// Flush flushes the Writer to its underlying io.Writer.
+func (w *Writer) Flush() error {
+ if w.err != nil {
+ return w.err
+ }
+ if len(w.ibuf) == 0 {
+ return nil
+ }
+ w.write(w.ibuf)
+ w.ibuf = w.ibuf[:0]
+ return w.err
+}
+
+// Close calls Flush and then closes the Writer.
+func (w *Writer) Close() error {
+ w.Flush()
+ ret := w.err
+ if w.err == nil {
+ w.err = errClosed
+ }
+ return ret
+}
diff --git a/vendor/github.com/klauspost/compress/internal/snapref/encode_other.go b/vendor/github.com/klauspost/compress/internal/snapref/encode_other.go
new file mode 100644
index 00000000..2754bac6
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/internal/snapref/encode_other.go
@@ -0,0 +1,250 @@
+// Copyright 2016 The Snappy-Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package snapref
+
+func load32(b []byte, i int) uint32 {
+ b = b[i : i+4 : len(b)] // Help the compiler eliminate bounds checks on the next line.
+ return uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24
+}
+
+func load64(b []byte, i int) uint64 {
+ b = b[i : i+8 : len(b)] // Help the compiler eliminate bounds checks on the next line.
+ return uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 |
+ uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56
+}
+
+// emitLiteral writes a literal chunk and returns the number of bytes written.
+//
+// It assumes that:
+//
+// dst is long enough to hold the encoded bytes
+// 1 <= len(lit) && len(lit) <= 65536
+func emitLiteral(dst, lit []byte) int {
+ i, n := 0, uint(len(lit)-1)
+ switch {
+ case n < 60:
+ dst[0] = uint8(n)<<2 | tagLiteral
+ i = 1
+ case n < 1<<8:
+ dst[0] = 60<<2 | tagLiteral
+ dst[1] = uint8(n)
+ i = 2
+ default:
+ dst[0] = 61<<2 | tagLiteral
+ dst[1] = uint8(n)
+ dst[2] = uint8(n >> 8)
+ i = 3
+ }
+ return i + copy(dst[i:], lit)
+}
+
+// emitCopy writes a copy chunk and returns the number of bytes written.
+//
+// It assumes that:
+//
+// dst is long enough to hold the encoded bytes
+// 1 <= offset && offset <= 65535
+// 4 <= length && length <= 65535
+func emitCopy(dst []byte, offset, length int) int {
+ i := 0
+ // The maximum length for a single tagCopy1 or tagCopy2 op is 64 bytes. The
+ // threshold for this loop is a little higher (at 68 = 64 + 4), and the
+ // length emitted down below is a little lower (at 60 = 64 - 4), because
+ // it's shorter to encode a length 67 copy as a length 60 tagCopy2 followed
+ // by a length 7 tagCopy1 (which encodes as 3+2 bytes) than to encode it as
+ // a length 64 tagCopy2 followed by a length 3 tagCopy2 (which encodes as
+ // 3+3 bytes). The magic 4 in the 64±4 is because the minimum length for a
+ // tagCopy1 op is 4 bytes, which is why a length 3 copy has to be an
+ // encodes-as-3-bytes tagCopy2 instead of an encodes-as-2-bytes tagCopy1.
+ for length >= 68 {
+ // Emit a length 64 copy, encoded as 3 bytes.
+ dst[i+0] = 63<<2 | tagCopy2
+ dst[i+1] = uint8(offset)
+ dst[i+2] = uint8(offset >> 8)
+ i += 3
+ length -= 64
+ }
+ if length > 64 {
+ // Emit a length 60 copy, encoded as 3 bytes.
+ dst[i+0] = 59<<2 | tagCopy2
+ dst[i+1] = uint8(offset)
+ dst[i+2] = uint8(offset >> 8)
+ i += 3
+ length -= 60
+ }
+ if length >= 12 || offset >= 2048 {
+ // Emit the remaining copy, encoded as 3 bytes.
+ dst[i+0] = uint8(length-1)<<2 | tagCopy2
+ dst[i+1] = uint8(offset)
+ dst[i+2] = uint8(offset >> 8)
+ return i + 3
+ }
+ // Emit the remaining copy, encoded as 2 bytes.
+ dst[i+0] = uint8(offset>>8)<<5 | uint8(length-4)<<2 | tagCopy1
+ dst[i+1] = uint8(offset)
+ return i + 2
+}
+
+func hash(u, shift uint32) uint32 {
+ return (u * 0x1e35a7bd) >> shift
+}
+
+// EncodeBlockInto exposes encodeBlock but checks dst size.
+func EncodeBlockInto(dst, src []byte) (d int) {
+ if MaxEncodedLen(len(src)) > len(dst) {
+ return 0
+ }
+
+ // encodeBlock breaks on too big blocks, so split.
+ for len(src) > 0 {
+ p := src
+ src = nil
+ if len(p) > maxBlockSize {
+ p, src = p[:maxBlockSize], p[maxBlockSize:]
+ }
+ if len(p) < minNonLiteralBlockSize {
+ d += emitLiteral(dst[d:], p)
+ } else {
+ d += encodeBlock(dst[d:], p)
+ }
+ }
+ return d
+}
+
+// encodeBlock encodes a non-empty src to a guaranteed-large-enough dst. It
+// assumes that the varint-encoded length of the decompressed bytes has already
+// been written.
+//
+// It also assumes that:
+//
+// len(dst) >= MaxEncodedLen(len(src)) &&
+// minNonLiteralBlockSize <= len(src) && len(src) <= maxBlockSize
+func encodeBlock(dst, src []byte) (d int) {
+ // Initialize the hash table. Its size ranges from 1<<8 to 1<<14 inclusive.
+ // The table element type is uint16, as s < sLimit and sLimit < len(src)
+ // and len(src) <= maxBlockSize and maxBlockSize == 65536.
+ const (
+ maxTableSize = 1 << 14
+ // tableMask is redundant, but helps the compiler eliminate bounds
+ // checks.
+ tableMask = maxTableSize - 1
+ )
+ shift := uint32(32 - 8)
+ for tableSize := 1 << 8; tableSize < maxTableSize && tableSize < len(src); tableSize *= 2 {
+ shift--
+ }
+ // In Go, all array elements are zero-initialized, so there is no advantage
+ // to a smaller tableSize per se. However, it matches the C++ algorithm,
+ // and in the asm versions of this code, we can get away with zeroing only
+ // the first tableSize elements.
+ var table [maxTableSize]uint16
+
+ // sLimit is when to stop looking for offset/length copies. The inputMargin
+ // lets us use a fast path for emitLiteral in the main loop, while we are
+ // looking for copies.
+ sLimit := len(src) - inputMargin
+
+ // nextEmit is where in src the next emitLiteral should start from.
+ nextEmit := 0
+
+ // The encoded form must start with a literal, as there are no previous
+ // bytes to copy, so we start looking for hash matches at s == 1.
+ s := 1
+ nextHash := hash(load32(src, s), shift)
+
+ for {
+ // Copied from the C++ snappy implementation:
+ //
+ // Heuristic match skipping: If 32 bytes are scanned with no matches
+ // found, start looking only at every other byte. If 32 more bytes are
+ // scanned (or skipped), look at every third byte, etc.. When a match
+ // is found, immediately go back to looking at every byte. This is a
+ // small loss (~5% performance, ~0.1% density) for compressible data
+ // due to more bookkeeping, but for non-compressible data (such as
+ // JPEG) it's a huge win since the compressor quickly "realizes" the
+ // data is incompressible and doesn't bother looking for matches
+ // everywhere.
+ //
+ // The "skip" variable keeps track of how many bytes there are since
+ // the last match; dividing it by 32 (ie. right-shifting by five) gives
+ // the number of bytes to move ahead for each iteration.
+ skip := 32
+
+ nextS := s
+ candidate := 0
+ for {
+ s = nextS
+ bytesBetweenHashLookups := skip >> 5
+ nextS = s + bytesBetweenHashLookups
+ skip += bytesBetweenHashLookups
+ if nextS > sLimit {
+ goto emitRemainder
+ }
+ candidate = int(table[nextHash&tableMask])
+ table[nextHash&tableMask] = uint16(s)
+ nextHash = hash(load32(src, nextS), shift)
+ if load32(src, s) == load32(src, candidate) {
+ break
+ }
+ }
+
+ // A 4-byte match has been found. We'll later see if more than 4 bytes
+ // match. But, prior to the match, src[nextEmit:s] are unmatched. Emit
+ // them as literal bytes.
+ d += emitLiteral(dst[d:], src[nextEmit:s])
+
+ // Call emitCopy, and then see if another emitCopy could be our next
+ // move. Repeat until we find no match for the input immediately after
+ // what was consumed by the last emitCopy call.
+ //
+ // If we exit this loop normally then we need to call emitLiteral next,
+ // though we don't yet know how big the literal will be. We handle that
+ // by proceeding to the next iteration of the main loop. We also can
+ // exit this loop via goto if we get close to exhausting the input.
+ for {
+ // Invariant: we have a 4-byte match at s, and no need to emit any
+ // literal bytes prior to s.
+ base := s
+
+ // Extend the 4-byte match as long as possible.
+ //
+ // This is an inlined version of:
+ // s = extendMatch(src, candidate+4, s+4)
+ s += 4
+ for i := candidate + 4; s < len(src) && src[i] == src[s]; i, s = i+1, s+1 {
+ }
+
+ d += emitCopy(dst[d:], base-candidate, s-base)
+ nextEmit = s
+ if s >= sLimit {
+ goto emitRemainder
+ }
+
+ // We could immediately start working at s now, but to improve
+ // compression we first update the hash table at s-1 and at s. If
+ // another emitCopy is not our next move, also calculate nextHash
+ // at s+1. At least on GOARCH=amd64, these three hash calculations
+ // are faster as one load64 call (with some shifts) instead of
+ // three load32 calls.
+ x := load64(src, s-1)
+ prevHash := hash(uint32(x>>0), shift)
+ table[prevHash&tableMask] = uint16(s - 1)
+ currHash := hash(uint32(x>>8), shift)
+ candidate = int(table[currHash&tableMask])
+ table[currHash&tableMask] = uint16(s)
+ if uint32(x>>8) != load32(src, candidate) {
+ nextHash = hash(uint32(x>>16), shift)
+ s++
+ break
+ }
+ }
+ }
+
+emitRemainder:
+ if nextEmit < len(src) {
+ d += emitLiteral(dst[d:], src[nextEmit:])
+ }
+ return d
+}
diff --git a/vendor/github.com/klauspost/compress/internal/snapref/snappy.go b/vendor/github.com/klauspost/compress/internal/snapref/snappy.go
new file mode 100644
index 00000000..34d01f4a
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/internal/snapref/snappy.go
@@ -0,0 +1,98 @@
+// Copyright 2011 The Snappy-Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Package snapref implements the Snappy compression format. It aims for very
+// high speeds and reasonable compression.
+//
+// There are actually two Snappy formats: block and stream. They are related,
+// but different: trying to decompress block-compressed data as a Snappy stream
+// will fail, and vice versa. The block format is the Decode and Encode
+// functions and the stream format is the Reader and Writer types.
+//
+// The block format, the more common case, is used when the complete size (the
+// number of bytes) of the original data is known upfront, at the time
+// compression starts. The stream format, also known as the framing format, is
+// for when that isn't always true.
+//
+// The canonical, C++ implementation is at https://github.com/google/snappy and
+// it only implements the block format.
+package snapref
+
+import (
+ "hash/crc32"
+)
+
+/*
+Each encoded block begins with the varint-encoded length of the decoded data,
+followed by a sequence of chunks. Chunks begin and end on byte boundaries. The
+first byte of each chunk is broken into its 2 least and 6 most significant bits
+called l and m: l ranges in [0, 4) and m ranges in [0, 64). l is the chunk tag.
+Zero means a literal tag. All other values mean a copy tag.
+
+For literal tags:
+ - If m < 60, the next 1 + m bytes are literal bytes.
+ - Otherwise, let n be the little-endian unsigned integer denoted by the next
+ m - 59 bytes. The next 1 + n bytes after that are literal bytes.
+
+For copy tags, length bytes are copied from offset bytes ago, in the style of
+Lempel-Ziv compression algorithms. In particular:
+ - For l == 1, the offset ranges in [0, 1<<11) and the length in [4, 12).
+ The length is 4 + the low 3 bits of m. The high 3 bits of m form bits 8-10
+ of the offset. The next byte is bits 0-7 of the offset.
+ - For l == 2, the offset ranges in [0, 1<<16) and the length in [1, 65).
+ The length is 1 + m. The offset is the little-endian unsigned integer
+ denoted by the next 2 bytes.
+ - For l == 3, this tag is a legacy format that is no longer issued by most
+ encoders. Nonetheless, the offset ranges in [0, 1<<32) and the length in
+ [1, 65). The length is 1 + m. The offset is the little-endian unsigned
+ integer denoted by the next 4 bytes.
+*/
+const (
+ tagLiteral = 0x00
+ tagCopy1 = 0x01
+ tagCopy2 = 0x02
+ tagCopy4 = 0x03
+)
+
+const (
+ checksumSize = 4
+ chunkHeaderSize = 4
+ magicChunk = "\xff\x06\x00\x00" + magicBody
+ magicBody = "sNaPpY"
+
+ // maxBlockSize is the maximum size of the input to encodeBlock. It is not
+ // part of the wire format per se, but some parts of the encoder assume
+ // that an offset fits into a uint16.
+ //
+ // Also, for the framing format (Writer type instead of Encode function),
+ // https://github.com/google/snappy/blob/master/framing_format.txt says
+ // that "the uncompressed data in a chunk must be no longer than 65536
+ // bytes".
+ maxBlockSize = 65536
+
+ // maxEncodedLenOfMaxBlockSize equals MaxEncodedLen(maxBlockSize), but is
+ // hard coded to be a const instead of a variable, so that obufLen can also
+ // be a const. Their equivalence is confirmed by
+ // TestMaxEncodedLenOfMaxBlockSize.
+ maxEncodedLenOfMaxBlockSize = 76490
+
+ obufHeaderLen = len(magicChunk) + checksumSize + chunkHeaderSize
+ obufLen = obufHeaderLen + maxEncodedLenOfMaxBlockSize
+)
+
+const (
+ chunkTypeCompressedData = 0x00
+ chunkTypeUncompressedData = 0x01
+ chunkTypePadding = 0xfe
+ chunkTypeStreamIdentifier = 0xff
+)
+
+var crcTable = crc32.MakeTable(crc32.Castagnoli)
+
+// crc implements the checksum specified in section 3 of
+// https://github.com/google/snappy/blob/master/framing_format.txt
+func crc(b []byte) uint32 {
+ c := crc32.Update(0, crcTable, b)
+ return uint32(c>>15|c<<17) + 0xa282ead8
+}
diff --git a/vendor/github.com/klauspost/compress/s2sx.mod b/vendor/github.com/klauspost/compress/s2sx.mod
new file mode 100644
index 00000000..5a4412f9
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/s2sx.mod
@@ -0,0 +1,4 @@
+module github.com/klauspost/compress
+
+go 1.19
+
diff --git a/vendor/github.com/klauspost/compress/s2sx.sum b/vendor/github.com/klauspost/compress/s2sx.sum
new file mode 100644
index 00000000..e69de29b
diff --git a/vendor/github.com/klauspost/compress/zstd/README.md b/vendor/github.com/klauspost/compress/zstd/README.md
new file mode 100644
index 00000000..92e2347b
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/README.md
@@ -0,0 +1,441 @@
+# zstd
+
+[Zstandard](https://facebook.github.io/zstd/) is a real-time compression algorithm, providing high compression ratios.
+It offers a very wide range of compression / speed trade-off, while being backed by a very fast decoder.
+A high performance compression algorithm is implemented. For now focused on speed.
+
+This package provides [compression](#Compressor) to and [decompression](#Decompressor) of Zstandard content.
+
+This package is pure Go and without use of "unsafe".
+
+The `zstd` package is provided as open source software using a Go standard license.
+
+Currently the package is heavily optimized for 64 bit processors and will be significantly slower on 32 bit processors.
+
+For seekable zstd streams, see [this excellent package](https://github.com/SaveTheRbtz/zstd-seekable-format-go).
+
+## Installation
+
+Install using `go get -u github.com/klauspost/compress`. The package is located in `github.com/klauspost/compress/zstd`.
+
+[![Go Reference](https://pkg.go.dev/badge/github.com/klauspost/compress/zstd.svg)](https://pkg.go.dev/github.com/klauspost/compress/zstd)
+
+## Compressor
+
+### Status:
+
+STABLE - there may always be subtle bugs, a wide variety of content has been tested and the library is actively
+used by several projects. This library is being [fuzz-tested](https://github.com/klauspost/compress-fuzz) for all updates.
+
+There may still be specific combinations of data types/size/settings that could lead to edge cases,
+so as always, testing is recommended.
+
+For now, a high speed (fastest) and medium-fast (default) compressor has been implemented.
+
+* The "Fastest" compression ratio is roughly equivalent to zstd level 1.
+* The "Default" compression ratio is roughly equivalent to zstd level 3 (default).
+* The "Better" compression ratio is roughly equivalent to zstd level 7.
+* The "Best" compression ratio is roughly equivalent to zstd level 11.
+
+In terms of speed, it is typically 2x as fast as the stdlib deflate/gzip in its fastest mode.
+The compression ratio compared to stdlib is around level 3, but usually 3x as fast.
+
+
+### Usage
+
+An Encoder can be used for either compressing a stream via the
+`io.WriteCloser` interface supported by the Encoder or as multiple independent
+tasks via the `EncodeAll` function.
+Smaller encodes are encouraged to use the EncodeAll function.
+Use `NewWriter` to create a new instance that can be used for both.
+
+To create a writer with default options, do like this:
+
+```Go
+// Compress input to output.
+func Compress(in io.Reader, out io.Writer) error {
+ enc, err := zstd.NewWriter(out)
+ if err != nil {
+ return err
+ }
+ _, err = io.Copy(enc, in)
+ if err != nil {
+ enc.Close()
+ return err
+ }
+ return enc.Close()
+}
+```
+
+Now you can encode by writing data to `enc`. The output will be finished writing when `Close()` is called.
+Even if your encode fails, you should still call `Close()` to release any resources that may be held up.
+
+The above is fine for big encodes. However, whenever possible try to *reuse* the writer.
+
+To reuse the encoder, you can use the `Reset(io.Writer)` function to change to another output.
+This will allow the encoder to reuse all resources and avoid wasteful allocations.
+
+Currently stream encoding has 'light' concurrency, meaning up to 2 goroutines can be working on part
+of a stream. This is independent of the `WithEncoderConcurrency(n)`, but that is likely to change
+in the future. So if you want to limit concurrency for future updates, specify the concurrency
+you would like.
+
+If you would like stream encoding to be done without spawning async goroutines, use `WithEncoderConcurrency(1)`
+which will compress input as each block is completed, blocking on writes until each has completed.
+
+You can specify your desired compression level using `WithEncoderLevel()` option. Currently only pre-defined
+compression settings can be specified.
+
+#### Future Compatibility Guarantees
+
+This will be an evolving project. When using this package it is important to note that both the compression efficiency and speed may change.
+
+The goal will be to keep the default efficiency at the default zstd (level 3).
+However the encoding should never be assumed to remain the same,
+and you should not use hashes of compressed output for similarity checks.
+
+The Encoder can be assumed to produce the same output from the exact same code version.
+However, the may be modes in the future that break this,
+although they will not be enabled without an explicit option.
+
+This encoder is not designed to (and will probably never) output the exact same bitstream as the reference encoder.
+
+Also note, that the cgo decompressor currently does not [report all errors on invalid input](https://github.com/DataDog/zstd/issues/59),
+[omits error checks](https://github.com/DataDog/zstd/issues/61), [ignores checksums](https://github.com/DataDog/zstd/issues/43)
+and seems to ignore concatenated streams, even though [it is part of the spec](https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#frames).
+
+#### Blocks
+
+For compressing small blocks, the returned encoder has a function called `EncodeAll(src, dst []byte) []byte`.
+
+`EncodeAll` will encode all input in src and append it to dst.
+This function can be called concurrently.
+Each call will only run on a same goroutine as the caller.
+
+Encoded blocks can be concatenated and the result will be the combined input stream.
+Data compressed with EncodeAll can be decoded with the Decoder, using either a stream or `DecodeAll`.
+
+Especially when encoding blocks you should take special care to reuse the encoder.
+This will effectively make it run without allocations after a warmup period.
+To make it run completely without allocations, supply a destination buffer with space for all content.
+
+```Go
+import "github.com/klauspost/compress/zstd"
+
+// Create a writer that caches compressors.
+// For this operation type we supply a nil Reader.
+var encoder, _ = zstd.NewWriter(nil)
+
+// Compress a buffer.
+// If you have a destination buffer, the allocation in the call can also be eliminated.
+func Compress(src []byte) []byte {
+ return encoder.EncodeAll(src, make([]byte, 0, len(src)))
+}
+```
+
+You can control the maximum number of concurrent encodes using the `WithEncoderConcurrency(n)`
+option when creating the writer.
+
+Using the Encoder for both a stream and individual blocks concurrently is safe.
+
+### Performance
+
+I have collected some speed examples to compare speed and compression against other compressors.
+
+* `file` is the input file.
+* `out` is the compressor used. `zskp` is this package. `zstd` is the Datadog cgo library. `gzstd/gzkp` is gzip standard and this library.
+* `level` is the compression level used. For `zskp` level 1 is "fastest", level 2 is "default"; 3 is "better", 4 is "best".
+* `insize`/`outsize` is the input/output size.
+* `millis` is the number of milliseconds used for compression.
+* `mb/s` is megabytes (2^20 bytes) per second.
+
+```
+Silesia Corpus:
+http://sun.aei.polsl.pl/~sdeor/corpus/silesia.zip
+
+This package:
+file out level insize outsize millis mb/s
+silesia.tar zskp 1 211947520 73821326 634 318.47
+silesia.tar zskp 2 211947520 67655404 1508 133.96
+silesia.tar zskp 3 211947520 64746933 3000 67.37
+silesia.tar zskp 4 211947520 60073508 16926 11.94
+
+cgo zstd:
+silesia.tar zstd 1 211947520 73605392 543 371.56
+silesia.tar zstd 3 211947520 66793289 864 233.68
+silesia.tar zstd 6 211947520 62916450 1913 105.66
+silesia.tar zstd 9 211947520 60212393 5063 39.92
+
+gzip, stdlib/this package:
+silesia.tar gzstd 1 211947520 80007735 1498 134.87
+silesia.tar gzkp 1 211947520 80088272 1009 200.31
+
+GOB stream of binary data. Highly compressible.
+https://files.klauspost.com/compress/gob-stream.7z
+
+file out level insize outsize millis mb/s
+gob-stream zskp 1 1911399616 233948096 3230 564.34
+gob-stream zskp 2 1911399616 203997694 4997 364.73
+gob-stream zskp 3 1911399616 173526523 13435 135.68
+gob-stream zskp 4 1911399616 162195235 47559 38.33
+
+gob-stream zstd 1 1911399616 249810424 2637 691.26
+gob-stream zstd 3 1911399616 208192146 3490 522.31
+gob-stream zstd 6 1911399616 193632038 6687 272.56
+gob-stream zstd 9 1911399616 177620386 16175 112.70
+
+gob-stream gzstd 1 1911399616 357382013 9046 201.49
+gob-stream gzkp 1 1911399616 359136669 4885 373.08
+
+The test data for the Large Text Compression Benchmark is the first
+10^9 bytes of the English Wikipedia dump on Mar. 3, 2006.
+http://mattmahoney.net/dc/textdata.html
+
+file out level insize outsize millis mb/s
+enwik9 zskp 1 1000000000 343833605 3687 258.64
+enwik9 zskp 2 1000000000 317001237 7672 124.29
+enwik9 zskp 3 1000000000 291915823 15923 59.89
+enwik9 zskp 4 1000000000 261710291 77697 12.27
+
+enwik9 zstd 1 1000000000 358072021 3110 306.65
+enwik9 zstd 3 1000000000 313734672 4784 199.35
+enwik9 zstd 6 1000000000 295138875 10290 92.68
+enwik9 zstd 9 1000000000 278348700 28549 33.40
+
+enwik9 gzstd 1 1000000000 382578136 8608 110.78
+enwik9 gzkp 1 1000000000 382781160 5628 169.45
+
+Highly compressible JSON file.
+https://files.klauspost.com/compress/github-june-2days-2019.json.zst
+
+file out level insize outsize millis mb/s
+github-june-2days-2019.json zskp 1 6273951764 697439532 9789 611.17
+github-june-2days-2019.json zskp 2 6273951764 610876538 18553 322.49
+github-june-2days-2019.json zskp 3 6273951764 517662858 44186 135.41
+github-june-2days-2019.json zskp 4 6273951764 464617114 165373 36.18
+
+github-june-2days-2019.json zstd 1 6273951764 766284037 8450 708.00
+github-june-2days-2019.json zstd 3 6273951764 661889476 10927 547.57
+github-june-2days-2019.json zstd 6 6273951764 642756859 22996 260.18
+github-june-2days-2019.json zstd 9 6273951764 601974523 52413 114.16
+
+github-june-2days-2019.json gzstd 1 6273951764 1164397768 26793 223.32
+github-june-2days-2019.json gzkp 1 6273951764 1120631856 17693 338.16
+
+VM Image, Linux mint with a few installed applications:
+https://files.klauspost.com/compress/rawstudio-mint14.7z
+
+file out level insize outsize millis mb/s
+rawstudio-mint14.tar zskp 1 8558382592 3718400221 18206 448.29
+rawstudio-mint14.tar zskp 2 8558382592 3326118337 37074 220.15
+rawstudio-mint14.tar zskp 3 8558382592 3163842361 87306 93.49
+rawstudio-mint14.tar zskp 4 8558382592 2970480650 783862 10.41
+
+rawstudio-mint14.tar zstd 1 8558382592 3609250104 17136 476.27
+rawstudio-mint14.tar zstd 3 8558382592 3341679997 29262 278.92
+rawstudio-mint14.tar zstd 6 8558382592 3235846406 77904 104.77
+rawstudio-mint14.tar zstd 9 8558382592 3160778861 140946 57.91
+
+rawstudio-mint14.tar gzstd 1 8558382592 3926234992 51345 158.96
+rawstudio-mint14.tar gzkp 1 8558382592 3960117298 36722 222.26
+
+CSV data:
+https://files.klauspost.com/compress/nyc-taxi-data-10M.csv.zst
+
+file out level insize outsize millis mb/s
+nyc-taxi-data-10M.csv zskp 1 3325605752 641319332 9462 335.17
+nyc-taxi-data-10M.csv zskp 2 3325605752 588976126 17570 180.50
+nyc-taxi-data-10M.csv zskp 3 3325605752 529329260 32432 97.79
+nyc-taxi-data-10M.csv zskp 4 3325605752 474949772 138025 22.98
+
+nyc-taxi-data-10M.csv zstd 1 3325605752 687399637 8233 385.18
+nyc-taxi-data-10M.csv zstd 3 3325605752 598514411 10065 315.07
+nyc-taxi-data-10M.csv zstd 6 3325605752 570522953 20038 158.27
+nyc-taxi-data-10M.csv zstd 9 3325605752 517554797 64565 49.12
+
+nyc-taxi-data-10M.csv gzstd 1 3325605752 928654908 21270 149.11
+nyc-taxi-data-10M.csv gzkp 1 3325605752 922273214 13929 227.68
+```
+
+## Decompressor
+
+Status: STABLE - there may still be subtle bugs, but a wide variety of content has been tested.
+
+This library is being continuously [fuzz-tested](https://github.com/klauspost/compress-fuzz),
+kindly supplied by [fuzzit.dev](https://fuzzit.dev/).
+The main purpose of the fuzz testing is to ensure that it is not possible to crash the decoder,
+or run it past its limits with ANY input provided.
+
+### Usage
+
+The package has been designed for two main usages, big streams of data and smaller in-memory buffers.
+There are two main usages of the package for these. Both of them are accessed by creating a `Decoder`.
+
+For streaming use a simple setup could look like this:
+
+```Go
+import "github.com/klauspost/compress/zstd"
+
+func Decompress(in io.Reader, out io.Writer) error {
+ d, err := zstd.NewReader(in)
+ if err != nil {
+ return err
+ }
+ defer d.Close()
+
+ // Copy content...
+ _, err = io.Copy(out, d)
+ return err
+}
+```
+
+It is important to use the "Close" function when you no longer need the Reader to stop running goroutines,
+when running with default settings.
+Goroutines will exit once an error has been returned, including `io.EOF` at the end of a stream.
+
+Streams are decoded concurrently in 4 asynchronous stages to give the best possible throughput.
+However, if you prefer synchronous decompression, use `WithDecoderConcurrency(1)` which will decompress data
+as it is being requested only.
+
+For decoding buffers, it could look something like this:
+
+```Go
+import "github.com/klauspost/compress/zstd"
+
+// Create a reader that caches decompressors.
+// For this operation type we supply a nil Reader.
+var decoder, _ = zstd.NewReader(nil, zstd.WithDecoderConcurrency(0))
+
+// Decompress a buffer. We don't supply a destination buffer,
+// so it will be allocated by the decoder.
+func Decompress(src []byte) ([]byte, error) {
+ return decoder.DecodeAll(src, nil)
+}
+```
+
+Both of these cases should provide the functionality needed.
+The decoder can be used for *concurrent* decompression of multiple buffers.
+By default 4 decompressors will be created.
+
+It will only allow a certain number of concurrent operations to run.
+To tweak that yourself use the `WithDecoderConcurrency(n)` option when creating the decoder.
+It is possible to use `WithDecoderConcurrency(0)` to create GOMAXPROCS decoders.
+
+### Dictionaries
+
+Data compressed with [dictionaries](https://github.com/facebook/zstd#the-case-for-small-data-compression) can be decompressed.
+
+Dictionaries are added individually to Decoders.
+Dictionaries are generated by the `zstd --train` command and contains an initial state for the decoder.
+To add a dictionary use the `WithDecoderDicts(dicts ...[]byte)` option with the dictionary data.
+Several dictionaries can be added at once.
+
+The dictionary will be used automatically for the data that specifies them.
+A re-used Decoder will still contain the dictionaries registered.
+
+When registering multiple dictionaries with the same ID, the last one will be used.
+
+It is possible to use dictionaries when compressing data.
+
+To enable a dictionary use `WithEncoderDict(dict []byte)`. Here only one dictionary will be used
+and it will likely be used even if it doesn't improve compression.
+
+The used dictionary must be used to decompress the content.
+
+For any real gains, the dictionary should be built with similar data.
+If an unsuitable dictionary is used the output may be slightly larger than using no dictionary.
+Use the [zstd commandline tool](https://github.com/facebook/zstd/releases) to build a dictionary from sample data.
+For information see [zstd dictionary information](https://github.com/facebook/zstd#the-case-for-small-data-compression).
+
+For now there is a fixed startup performance penalty for compressing content with dictionaries.
+This will likely be improved over time. Just be aware to test performance when implementing.
+
+### Allocation-less operation
+
+The decoder has been designed to operate without allocations after a warmup.
+
+This means that you should *store* the decoder for best performance.
+To re-use a stream decoder, use the `Reset(r io.Reader) error` to switch to another stream.
+A decoder can safely be re-used even if the previous stream failed.
+
+To release the resources, you must call the `Close()` function on a decoder.
+After this it can *no longer be reused*, but all running goroutines will be stopped.
+So you *must* use this if you will no longer need the Reader.
+
+For decompressing smaller buffers a single decoder can be used.
+When decoding buffers, you can supply a destination slice with length 0 and your expected capacity.
+In this case no unneeded allocations should be made.
+
+### Concurrency
+
+The buffer decoder does everything on the same goroutine and does nothing concurrently.
+It can however decode several buffers concurrently. Use `WithDecoderConcurrency(n)` to limit that.
+
+The stream decoder will create goroutines that:
+
+1) Reads input and splits the input into blocks.
+2) Decompression of literals.
+3) Decompression of sequences.
+4) Reconstruction of output stream.
+
+So effectively this also means the decoder will "read ahead" and prepare data to always be available for output.
+
+The concurrency level will, for streams, determine how many blocks ahead the compression will start.
+
+Since "blocks" are quite dependent on the output of the previous block stream decoding will only have limited concurrency.
+
+In practice this means that concurrency is often limited to utilizing about 3 cores effectively.
+
+### Benchmarks
+
+The first two are streaming decodes and the last are smaller inputs.
+
+Running on AMD Ryzen 9 3950X 16-Core Processor. AMD64 assembly used.
+
+```
+BenchmarkDecoderSilesia-32 5 206878840 ns/op 1024.50 MB/s 49808 B/op 43 allocs/op
+BenchmarkDecoderEnwik9-32 1 1271809000 ns/op 786.28 MB/s 72048 B/op 52 allocs/op
+
+Concurrent blocks, performance:
+
+BenchmarkDecoder_DecodeAllParallel/kppkn.gtb.zst-32 67356 17857 ns/op 10321.96 MB/s 22.48 pct 102 B/op 0 allocs/op
+BenchmarkDecoder_DecodeAllParallel/geo.protodata.zst-32 266656 4421 ns/op 26823.21 MB/s 11.89 pct 19 B/op 0 allocs/op
+BenchmarkDecoder_DecodeAllParallel/plrabn12.txt.zst-32 20992 56842 ns/op 8477.17 MB/s 39.90 pct 754 B/op 0 allocs/op
+BenchmarkDecoder_DecodeAllParallel/lcet10.txt.zst-32 27456 43932 ns/op 9714.01 MB/s 33.27 pct 524 B/op 0 allocs/op
+BenchmarkDecoder_DecodeAllParallel/asyoulik.txt.zst-32 78432 15047 ns/op 8319.15 MB/s 40.34 pct 66 B/op 0 allocs/op
+BenchmarkDecoder_DecodeAllParallel/alice29.txt.zst-32 65800 18436 ns/op 8249.63 MB/s 37.75 pct 88 B/op 0 allocs/op
+BenchmarkDecoder_DecodeAllParallel/html_x_4.zst-32 102993 11523 ns/op 35546.09 MB/s 3.637 pct 143 B/op 0 allocs/op
+BenchmarkDecoder_DecodeAllParallel/paper-100k.pdf.zst-32 1000000 1070 ns/op 95720.98 MB/s 80.53 pct 3 B/op 0 allocs/op
+BenchmarkDecoder_DecodeAllParallel/fireworks.jpeg.zst-32 749802 1752 ns/op 70272.35 MB/s 100.0 pct 5 B/op 0 allocs/op
+BenchmarkDecoder_DecodeAllParallel/urls.10K.zst-32 22640 52934 ns/op 13263.37 MB/s 26.25 pct 1014 B/op 0 allocs/op
+BenchmarkDecoder_DecodeAllParallel/html.zst-32 226412 5232 ns/op 19572.27 MB/s 14.49 pct 20 B/op 0 allocs/op
+BenchmarkDecoder_DecodeAllParallel/comp-data.bin.zst-32 923041 1276 ns/op 3194.71 MB/s 31.26 pct 0 B/op 0 allocs/op
+```
+
+This reflects the performance around May 2022, but this may be out of date.
+
+## Zstd inside ZIP files
+
+It is possible to use zstandard to compress individual files inside zip archives.
+While this isn't widely supported it can be useful for internal files.
+
+To support the compression and decompression of these files you must register a compressor and decompressor.
+
+It is highly recommended registering the (de)compressors on individual zip Reader/Writer and NOT
+use the global registration functions. The main reason for this is that 2 registrations from
+different packages will result in a panic.
+
+It is a good idea to only have a single compressor and decompressor, since they can be used for multiple zip
+files concurrently, and using a single instance will allow reusing some resources.
+
+See [this example](https://pkg.go.dev/github.com/klauspost/compress/zstd#example-ZipCompressor) for
+how to compress and decompress files inside zip archives.
+
+# Contributions
+
+Contributions are always welcome.
+For new features/fixes, remember to add tests and for performance enhancements include benchmarks.
+
+For general feedback and experience reports, feel free to open an issue or write me on [Twitter](https://twitter.com/sh0dan).
+
+This package includes the excellent [`github.com/cespare/xxhash`](https://github.com/cespare/xxhash) package Copyright (c) 2016 Caleb Spare.
diff --git a/vendor/github.com/klauspost/compress/zstd/bitreader.go b/vendor/github.com/klauspost/compress/zstd/bitreader.go
new file mode 100644
index 00000000..25ca9839
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/bitreader.go
@@ -0,0 +1,136 @@
+// Copyright 2019+ Klaus Post. All rights reserved.
+// License information can be found in the LICENSE file.
+// Based on work by Yann Collet, released under BSD License.
+
+package zstd
+
+import (
+ "encoding/binary"
+ "errors"
+ "fmt"
+ "io"
+ "math/bits"
+)
+
+// bitReader reads a bitstream in reverse.
+// The last set bit indicates the start of the stream and is used
+// for aligning the input.
+type bitReader struct {
+ in []byte
+ value uint64 // Maybe use [16]byte, but shifting is awkward.
+ bitsRead uint8
+}
+
+// init initializes and resets the bit reader.
+func (b *bitReader) init(in []byte) error {
+ if len(in) < 1 {
+ return errors.New("corrupt stream: too short")
+ }
+ b.in = in
+ // The highest bit of the last byte indicates where to start
+ v := in[len(in)-1]
+ if v == 0 {
+ return errors.New("corrupt stream, did not find end of stream")
+ }
+ b.bitsRead = 64
+ b.value = 0
+ if len(in) >= 8 {
+ b.fillFastStart()
+ } else {
+ b.fill()
+ b.fill()
+ }
+ b.bitsRead += 8 - uint8(highBits(uint32(v)))
+ return nil
+}
+
+// getBits will return n bits. n can be 0.
+func (b *bitReader) getBits(n uint8) int {
+ if n == 0 /*|| b.bitsRead >= 64 */ {
+ return 0
+ }
+ return int(b.get32BitsFast(n))
+}
+
+// get32BitsFast requires that at least one bit is requested every time.
+// There are no checks if the buffer is filled.
+func (b *bitReader) get32BitsFast(n uint8) uint32 {
+ const regMask = 64 - 1
+ v := uint32((b.value << (b.bitsRead & regMask)) >> ((regMask + 1 - n) & regMask))
+ b.bitsRead += n
+ return v
+}
+
+// fillFast() will make sure at least 32 bits are available.
+// There must be at least 4 bytes available.
+func (b *bitReader) fillFast() {
+ if b.bitsRead < 32 {
+ return
+ }
+ v := b.in[len(b.in)-4:]
+ b.in = b.in[:len(b.in)-4]
+ low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24)
+ b.value = (b.value << 32) | uint64(low)
+ b.bitsRead -= 32
+}
+
+// fillFastStart() assumes the bitreader is empty and there is at least 8 bytes to read.
+func (b *bitReader) fillFastStart() {
+ v := b.in[len(b.in)-8:]
+ b.in = b.in[:len(b.in)-8]
+ b.value = binary.LittleEndian.Uint64(v)
+ b.bitsRead = 0
+}
+
+// fill() will make sure at least 32 bits are available.
+func (b *bitReader) fill() {
+ if b.bitsRead < 32 {
+ return
+ }
+ if len(b.in) >= 4 {
+ v := b.in[len(b.in)-4:]
+ b.in = b.in[:len(b.in)-4]
+ low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24)
+ b.value = (b.value << 32) | uint64(low)
+ b.bitsRead -= 32
+ return
+ }
+
+ b.bitsRead -= uint8(8 * len(b.in))
+ for len(b.in) > 0 {
+ b.value = (b.value << 8) | uint64(b.in[len(b.in)-1])
+ b.in = b.in[:len(b.in)-1]
+ }
+}
+
+// finished returns true if all bits have been read from the bit stream.
+func (b *bitReader) finished() bool {
+ return len(b.in) == 0 && b.bitsRead >= 64
+}
+
+// overread returns true if more bits have been requested than is on the stream.
+func (b *bitReader) overread() bool {
+ return b.bitsRead > 64
+}
+
+// remain returns the number of bits remaining.
+func (b *bitReader) remain() uint {
+ return 8*uint(len(b.in)) + 64 - uint(b.bitsRead)
+}
+
+// close the bitstream and returns an error if out-of-buffer reads occurred.
+func (b *bitReader) close() error {
+ // Release reference.
+ b.in = nil
+ if !b.finished() {
+ return fmt.Errorf("%d extra bits on block, should be 0", b.remain())
+ }
+ if b.bitsRead > 64 {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+
+func highBits(val uint32) (n uint32) {
+ return uint32(bits.Len32(val) - 1)
+}
diff --git a/vendor/github.com/klauspost/compress/zstd/bitwriter.go b/vendor/github.com/klauspost/compress/zstd/bitwriter.go
new file mode 100644
index 00000000..1952f175
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/bitwriter.go
@@ -0,0 +1,112 @@
+// Copyright 2018 Klaus Post. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+// Based on work Copyright (c) 2013, Yann Collet, released under BSD License.
+
+package zstd
+
+// bitWriter will write bits.
+// First bit will be LSB of the first byte of output.
+type bitWriter struct {
+ bitContainer uint64
+ nBits uint8
+ out []byte
+}
+
+// bitMask16 is bitmasks. Has extra to avoid bounds check.
+var bitMask16 = [32]uint16{
+ 0, 1, 3, 7, 0xF, 0x1F,
+ 0x3F, 0x7F, 0xFF, 0x1FF, 0x3FF, 0x7FF,
+ 0xFFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF, 0xFFFF,
+ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
+ 0xFFFF, 0xFFFF} /* up to 16 bits */
+
+var bitMask32 = [32]uint32{
+ 0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F, 0xFF,
+ 0x1FF, 0x3FF, 0x7FF, 0xFFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF,
+ 0x1ffff, 0x3ffff, 0x7FFFF, 0xfFFFF, 0x1fFFFF, 0x3fFFFF, 0x7fFFFF, 0xffFFFF,
+ 0x1ffFFFF, 0x3ffFFFF, 0x7ffFFFF, 0xfffFFFF, 0x1fffFFFF, 0x3fffFFFF, 0x7fffFFFF,
+} // up to 32 bits
+
+// addBits16NC will add up to 16 bits.
+// It will not check if there is space for them,
+// so the caller must ensure that it has flushed recently.
+func (b *bitWriter) addBits16NC(value uint16, bits uint8) {
+ b.bitContainer |= uint64(value&bitMask16[bits&31]) << (b.nBits & 63)
+ b.nBits += bits
+}
+
+// addBits32NC will add up to 31 bits.
+// It will not check if there is space for them,
+// so the caller must ensure that it has flushed recently.
+func (b *bitWriter) addBits32NC(value uint32, bits uint8) {
+ b.bitContainer |= uint64(value&bitMask32[bits&31]) << (b.nBits & 63)
+ b.nBits += bits
+}
+
+// addBits64NC will add up to 64 bits.
+// There must be space for 32 bits.
+func (b *bitWriter) addBits64NC(value uint64, bits uint8) {
+ if bits <= 31 {
+ b.addBits32Clean(uint32(value), bits)
+ return
+ }
+ b.addBits32Clean(uint32(value), 32)
+ b.flush32()
+ b.addBits32Clean(uint32(value>>32), bits-32)
+}
+
+// addBits32Clean will add up to 32 bits.
+// It will not check if there is space for them.
+// The input must not contain more bits than specified.
+func (b *bitWriter) addBits32Clean(value uint32, bits uint8) {
+ b.bitContainer |= uint64(value) << (b.nBits & 63)
+ b.nBits += bits
+}
+
+// addBits16Clean will add up to 16 bits. value may not contain more set bits than indicated.
+// It will not check if there is space for them, so the caller must ensure that it has flushed recently.
+func (b *bitWriter) addBits16Clean(value uint16, bits uint8) {
+ b.bitContainer |= uint64(value) << (b.nBits & 63)
+ b.nBits += bits
+}
+
+// flush32 will flush out, so there are at least 32 bits available for writing.
+func (b *bitWriter) flush32() {
+ if b.nBits < 32 {
+ return
+ }
+ b.out = append(b.out,
+ byte(b.bitContainer),
+ byte(b.bitContainer>>8),
+ byte(b.bitContainer>>16),
+ byte(b.bitContainer>>24))
+ b.nBits -= 32
+ b.bitContainer >>= 32
+}
+
+// flushAlign will flush remaining full bytes and align to next byte boundary.
+func (b *bitWriter) flushAlign() {
+ nbBytes := (b.nBits + 7) >> 3
+ for i := uint8(0); i < nbBytes; i++ {
+ b.out = append(b.out, byte(b.bitContainer>>(i*8)))
+ }
+ b.nBits = 0
+ b.bitContainer = 0
+}
+
+// close will write the alignment bit and write the final byte(s)
+// to the output.
+func (b *bitWriter) close() {
+ // End mark
+ b.addBits16Clean(1, 1)
+ // flush until next byte.
+ b.flushAlign()
+}
+
+// reset and continue writing by appending to out.
+func (b *bitWriter) reset(out []byte) {
+ b.bitContainer = 0
+ b.nBits = 0
+ b.out = out
+}
diff --git a/vendor/github.com/klauspost/compress/zstd/blockdec.go b/vendor/github.com/klauspost/compress/zstd/blockdec.go
new file mode 100644
index 00000000..9c28840c
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/blockdec.go
@@ -0,0 +1,731 @@
+// Copyright 2019+ Klaus Post. All rights reserved.
+// License information can be found in the LICENSE file.
+// Based on work by Yann Collet, released under BSD License.
+
+package zstd
+
+import (
+ "bytes"
+ "encoding/binary"
+ "errors"
+ "fmt"
+ "hash/crc32"
+ "io"
+ "os"
+ "path/filepath"
+ "sync"
+
+ "github.com/klauspost/compress/huff0"
+ "github.com/klauspost/compress/zstd/internal/xxhash"
+)
+
+type blockType uint8
+
+//go:generate stringer -type=blockType,literalsBlockType,seqCompMode,tableIndex
+
+const (
+ blockTypeRaw blockType = iota
+ blockTypeRLE
+ blockTypeCompressed
+ blockTypeReserved
+)
+
+type literalsBlockType uint8
+
+const (
+ literalsBlockRaw literalsBlockType = iota
+ literalsBlockRLE
+ literalsBlockCompressed
+ literalsBlockTreeless
+)
+
+const (
+ // maxCompressedBlockSize is the biggest allowed compressed block size (128KB)
+ maxCompressedBlockSize = 128 << 10
+
+ compressedBlockOverAlloc = 16
+ maxCompressedBlockSizeAlloc = 128<<10 + compressedBlockOverAlloc
+
+ // Maximum possible block size (all Raw+Uncompressed).
+ maxBlockSize = (1 << 21) - 1
+
+ maxMatchLen = 131074
+ maxSequences = 0x7f00 + 0xffff
+
+ // We support slightly less than the reference decoder to be able to
+ // use ints on 32 bit archs.
+ maxOffsetBits = 30
+)
+
+var (
+ huffDecoderPool = sync.Pool{New: func() interface{} {
+ return &huff0.Scratch{}
+ }}
+
+ fseDecoderPool = sync.Pool{New: func() interface{} {
+ return &fseDecoder{}
+ }}
+)
+
+type blockDec struct {
+ // Raw source data of the block.
+ data []byte
+ dataStorage []byte
+
+ // Destination of the decoded data.
+ dst []byte
+
+ // Buffer for literals data.
+ literalBuf []byte
+
+ // Window size of the block.
+ WindowSize uint64
+
+ err error
+
+ // Check against this crc, if hasCRC is true.
+ checkCRC uint32
+ hasCRC bool
+
+ // Frame to use for singlethreaded decoding.
+ // Should not be used by the decoder itself since parent may be another frame.
+ localFrame *frameDec
+
+ sequence []seqVals
+
+ async struct {
+ newHist *history
+ literals []byte
+ seqData []byte
+ seqSize int // Size of uncompressed sequences
+ fcs uint64
+ }
+
+ // Block is RLE, this is the size.
+ RLESize uint32
+
+ Type blockType
+
+ // Is this the last block of a frame?
+ Last bool
+
+ // Use less memory
+ lowMem bool
+}
+
+func (b *blockDec) String() string {
+ if b == nil {
+ return ""
+ }
+ return fmt.Sprintf("Steam Size: %d, Type: %v, Last: %t, Window: %d", len(b.data), b.Type, b.Last, b.WindowSize)
+}
+
+func newBlockDec(lowMem bool) *blockDec {
+ b := blockDec{
+ lowMem: lowMem,
+ }
+ return &b
+}
+
+// reset will reset the block.
+// Input must be a start of a block and will be at the end of the block when returned.
+func (b *blockDec) reset(br byteBuffer, windowSize uint64) error {
+ b.WindowSize = windowSize
+ tmp, err := br.readSmall(3)
+ if err != nil {
+ println("Reading block header:", err)
+ return err
+ }
+ bh := uint32(tmp[0]) | (uint32(tmp[1]) << 8) | (uint32(tmp[2]) << 16)
+ b.Last = bh&1 != 0
+ b.Type = blockType((bh >> 1) & 3)
+ // find size.
+ cSize := int(bh >> 3)
+ maxSize := maxCompressedBlockSizeAlloc
+ switch b.Type {
+ case blockTypeReserved:
+ return ErrReservedBlockType
+ case blockTypeRLE:
+ if cSize > maxCompressedBlockSize || cSize > int(b.WindowSize) {
+ if debugDecoder {
+ printf("rle block too big: csize:%d block: %+v\n", uint64(cSize), b)
+ }
+ return ErrWindowSizeExceeded
+ }
+ b.RLESize = uint32(cSize)
+ if b.lowMem {
+ maxSize = cSize
+ }
+ cSize = 1
+ case blockTypeCompressed:
+ if debugDecoder {
+ println("Data size on stream:", cSize)
+ }
+ b.RLESize = 0
+ maxSize = maxCompressedBlockSizeAlloc
+ if windowSize < maxCompressedBlockSize && b.lowMem {
+ maxSize = int(windowSize) + compressedBlockOverAlloc
+ }
+ if cSize > maxCompressedBlockSize || uint64(cSize) > b.WindowSize {
+ if debugDecoder {
+ printf("compressed block too big: csize:%d block: %+v\n", uint64(cSize), b)
+ }
+ return ErrCompressedSizeTooBig
+ }
+ // Empty compressed blocks must at least be 2 bytes
+ // for Literals_Block_Type and one for Sequences_Section_Header.
+ if cSize < 2 {
+ return ErrBlockTooSmall
+ }
+ case blockTypeRaw:
+ if cSize > maxCompressedBlockSize || cSize > int(b.WindowSize) {
+ if debugDecoder {
+ printf("rle block too big: csize:%d block: %+v\n", uint64(cSize), b)
+ }
+ return ErrWindowSizeExceeded
+ }
+
+ b.RLESize = 0
+ // We do not need a destination for raw blocks.
+ maxSize = -1
+ default:
+ panic("Invalid block type")
+ }
+
+ // Read block data.
+ if _, ok := br.(*byteBuf); !ok && cap(b.dataStorage) < cSize {
+ // byteBuf doesn't need a destination buffer.
+ if b.lowMem || cSize > maxCompressedBlockSize {
+ b.dataStorage = make([]byte, 0, cSize+compressedBlockOverAlloc)
+ } else {
+ b.dataStorage = make([]byte, 0, maxCompressedBlockSizeAlloc)
+ }
+ }
+ b.data, err = br.readBig(cSize, b.dataStorage)
+ if err != nil {
+ if debugDecoder {
+ println("Reading block:", err, "(", cSize, ")", len(b.data))
+ printf("%T", br)
+ }
+ return err
+ }
+ if cap(b.dst) <= maxSize {
+ b.dst = make([]byte, 0, maxSize+1)
+ }
+ return nil
+}
+
+// sendEOF will make the decoder send EOF on this frame.
+func (b *blockDec) sendErr(err error) {
+ b.Last = true
+ b.Type = blockTypeReserved
+ b.err = err
+}
+
+// Close will release resources.
+// Closed blockDec cannot be reset.
+func (b *blockDec) Close() {
+}
+
+// decodeBuf
+func (b *blockDec) decodeBuf(hist *history) error {
+ switch b.Type {
+ case blockTypeRLE:
+ if cap(b.dst) < int(b.RLESize) {
+ if b.lowMem {
+ b.dst = make([]byte, b.RLESize)
+ } else {
+ b.dst = make([]byte, maxCompressedBlockSize)
+ }
+ }
+ b.dst = b.dst[:b.RLESize]
+ v := b.data[0]
+ for i := range b.dst {
+ b.dst[i] = v
+ }
+ hist.appendKeep(b.dst)
+ return nil
+ case blockTypeRaw:
+ hist.appendKeep(b.data)
+ return nil
+ case blockTypeCompressed:
+ saved := b.dst
+ // Append directly to history
+ if hist.ignoreBuffer == 0 {
+ b.dst = hist.b
+ hist.b = nil
+ } else {
+ b.dst = b.dst[:0]
+ }
+ err := b.decodeCompressed(hist)
+ if debugDecoder {
+ println("Decompressed to total", len(b.dst), "bytes, hash:", xxhash.Sum64(b.dst), "error:", err)
+ }
+ if hist.ignoreBuffer == 0 {
+ hist.b = b.dst
+ b.dst = saved
+ } else {
+ hist.appendKeep(b.dst)
+ }
+ return err
+ case blockTypeReserved:
+ // Used for returning errors.
+ return b.err
+ default:
+ panic("Invalid block type")
+ }
+}
+
+func (b *blockDec) decodeLiterals(in []byte, hist *history) (remain []byte, err error) {
+ // There must be at least one byte for Literals_Block_Type and one for Sequences_Section_Header
+ if len(in) < 2 {
+ return in, ErrBlockTooSmall
+ }
+
+ litType := literalsBlockType(in[0] & 3)
+ var litRegenSize int
+ var litCompSize int
+ sizeFormat := (in[0] >> 2) & 3
+ var fourStreams bool
+ var literals []byte
+ switch litType {
+ case literalsBlockRaw, literalsBlockRLE:
+ switch sizeFormat {
+ case 0, 2:
+ // Regenerated_Size uses 5 bits (0-31). Literals_Section_Header uses 1 byte.
+ litRegenSize = int(in[0] >> 3)
+ in = in[1:]
+ case 1:
+ // Regenerated_Size uses 12 bits (0-4095). Literals_Section_Header uses 2 bytes.
+ litRegenSize = int(in[0]>>4) + (int(in[1]) << 4)
+ in = in[2:]
+ case 3:
+ // Regenerated_Size uses 20 bits (0-1048575). Literals_Section_Header uses 3 bytes.
+ if len(in) < 3 {
+ println("too small: litType:", litType, " sizeFormat", sizeFormat, len(in))
+ return in, ErrBlockTooSmall
+ }
+ litRegenSize = int(in[0]>>4) + (int(in[1]) << 4) + (int(in[2]) << 12)
+ in = in[3:]
+ }
+ case literalsBlockCompressed, literalsBlockTreeless:
+ switch sizeFormat {
+ case 0, 1:
+ // Both Regenerated_Size and Compressed_Size use 10 bits (0-1023).
+ if len(in) < 3 {
+ println("too small: litType:", litType, " sizeFormat", sizeFormat, len(in))
+ return in, ErrBlockTooSmall
+ }
+ n := uint64(in[0]>>4) + (uint64(in[1]) << 4) + (uint64(in[2]) << 12)
+ litRegenSize = int(n & 1023)
+ litCompSize = int(n >> 10)
+ fourStreams = sizeFormat == 1
+ in = in[3:]
+ case 2:
+ fourStreams = true
+ if len(in) < 4 {
+ println("too small: litType:", litType, " sizeFormat", sizeFormat, len(in))
+ return in, ErrBlockTooSmall
+ }
+ n := uint64(in[0]>>4) + (uint64(in[1]) << 4) + (uint64(in[2]) << 12) + (uint64(in[3]) << 20)
+ litRegenSize = int(n & 16383)
+ litCompSize = int(n >> 14)
+ in = in[4:]
+ case 3:
+ fourStreams = true
+ if len(in) < 5 {
+ println("too small: litType:", litType, " sizeFormat", sizeFormat, len(in))
+ return in, ErrBlockTooSmall
+ }
+ n := uint64(in[0]>>4) + (uint64(in[1]) << 4) + (uint64(in[2]) << 12) + (uint64(in[3]) << 20) + (uint64(in[4]) << 28)
+ litRegenSize = int(n & 262143)
+ litCompSize = int(n >> 18)
+ in = in[5:]
+ }
+ }
+ if debugDecoder {
+ println("literals type:", litType, "litRegenSize:", litRegenSize, "litCompSize:", litCompSize, "sizeFormat:", sizeFormat, "4X:", fourStreams)
+ }
+ if litRegenSize > int(b.WindowSize) || litRegenSize > maxCompressedBlockSize {
+ return in, ErrWindowSizeExceeded
+ }
+
+ switch litType {
+ case literalsBlockRaw:
+ if len(in) < litRegenSize {
+ println("too small: litType:", litType, " sizeFormat", sizeFormat, "remain:", len(in), "want:", litRegenSize)
+ return in, ErrBlockTooSmall
+ }
+ literals = in[:litRegenSize]
+ in = in[litRegenSize:]
+ //printf("Found %d uncompressed literals\n", litRegenSize)
+ case literalsBlockRLE:
+ if len(in) < 1 {
+ println("too small: litType:", litType, " sizeFormat", sizeFormat, "remain:", len(in), "want:", 1)
+ return in, ErrBlockTooSmall
+ }
+ if cap(b.literalBuf) < litRegenSize {
+ if b.lowMem {
+ b.literalBuf = make([]byte, litRegenSize, litRegenSize+compressedBlockOverAlloc)
+ } else {
+ b.literalBuf = make([]byte, litRegenSize, maxCompressedBlockSize+compressedBlockOverAlloc)
+ }
+ }
+ literals = b.literalBuf[:litRegenSize]
+ v := in[0]
+ for i := range literals {
+ literals[i] = v
+ }
+ in = in[1:]
+ if debugDecoder {
+ printf("Found %d RLE compressed literals\n", litRegenSize)
+ }
+ case literalsBlockTreeless:
+ if len(in) < litCompSize {
+ println("too small: litType:", litType, " sizeFormat", sizeFormat, "remain:", len(in), "want:", litCompSize)
+ return in, ErrBlockTooSmall
+ }
+ // Store compressed literals, so we defer decoding until we get history.
+ literals = in[:litCompSize]
+ in = in[litCompSize:]
+ if debugDecoder {
+ printf("Found %d compressed literals\n", litCompSize)
+ }
+ huff := hist.huffTree
+ if huff == nil {
+ return in, errors.New("literal block was treeless, but no history was defined")
+ }
+ // Ensure we have space to store it.
+ if cap(b.literalBuf) < litRegenSize {
+ if b.lowMem {
+ b.literalBuf = make([]byte, 0, litRegenSize+compressedBlockOverAlloc)
+ } else {
+ b.literalBuf = make([]byte, 0, maxCompressedBlockSize+compressedBlockOverAlloc)
+ }
+ }
+ var err error
+ // Use our out buffer.
+ huff.MaxDecodedSize = litRegenSize
+ if fourStreams {
+ literals, err = huff.Decoder().Decompress4X(b.literalBuf[:0:litRegenSize], literals)
+ } else {
+ literals, err = huff.Decoder().Decompress1X(b.literalBuf[:0:litRegenSize], literals)
+ }
+ // Make sure we don't leak our literals buffer
+ if err != nil {
+ println("decompressing literals:", err)
+ return in, err
+ }
+ if len(literals) != litRegenSize {
+ return in, fmt.Errorf("literal output size mismatch want %d, got %d", litRegenSize, len(literals))
+ }
+
+ case literalsBlockCompressed:
+ if len(in) < litCompSize {
+ println("too small: litType:", litType, " sizeFormat", sizeFormat, "remain:", len(in), "want:", litCompSize)
+ return in, ErrBlockTooSmall
+ }
+ literals = in[:litCompSize]
+ in = in[litCompSize:]
+ // Ensure we have space to store it.
+ if cap(b.literalBuf) < litRegenSize {
+ if b.lowMem {
+ b.literalBuf = make([]byte, 0, litRegenSize+compressedBlockOverAlloc)
+ } else {
+ b.literalBuf = make([]byte, 0, maxCompressedBlockSize+compressedBlockOverAlloc)
+ }
+ }
+ huff := hist.huffTree
+ if huff == nil || (hist.dict != nil && huff == hist.dict.litEnc) {
+ huff = huffDecoderPool.Get().(*huff0.Scratch)
+ if huff == nil {
+ huff = &huff0.Scratch{}
+ }
+ }
+ var err error
+ if debugDecoder {
+ println("huff table input:", len(literals), "CRC:", crc32.ChecksumIEEE(literals))
+ }
+ huff, literals, err = huff0.ReadTable(literals, huff)
+ if err != nil {
+ println("reading huffman table:", err)
+ return in, err
+ }
+ hist.huffTree = huff
+ huff.MaxDecodedSize = litRegenSize
+ // Use our out buffer.
+ if fourStreams {
+ literals, err = huff.Decoder().Decompress4X(b.literalBuf[:0:litRegenSize], literals)
+ } else {
+ literals, err = huff.Decoder().Decompress1X(b.literalBuf[:0:litRegenSize], literals)
+ }
+ if err != nil {
+ println("decoding compressed literals:", err)
+ return in, err
+ }
+ // Make sure we don't leak our literals buffer
+ if len(literals) != litRegenSize {
+ return in, fmt.Errorf("literal output size mismatch want %d, got %d", litRegenSize, len(literals))
+ }
+ // Re-cap to get extra size.
+ literals = b.literalBuf[:len(literals)]
+ if debugDecoder {
+ printf("Decompressed %d literals into %d bytes\n", litCompSize, litRegenSize)
+ }
+ }
+ hist.decoders.literals = literals
+ return in, nil
+}
+
+// decodeCompressed will start decompressing a block.
+func (b *blockDec) decodeCompressed(hist *history) error {
+ in := b.data
+ in, err := b.decodeLiterals(in, hist)
+ if err != nil {
+ return err
+ }
+ err = b.prepareSequences(in, hist)
+ if err != nil {
+ return err
+ }
+ if hist.decoders.nSeqs == 0 {
+ b.dst = append(b.dst, hist.decoders.literals...)
+ return nil
+ }
+ before := len(hist.decoders.out)
+ err = hist.decoders.decodeSync(hist.b[hist.ignoreBuffer:])
+ if err != nil {
+ return err
+ }
+ if hist.decoders.maxSyncLen > 0 {
+ hist.decoders.maxSyncLen += uint64(before)
+ hist.decoders.maxSyncLen -= uint64(len(hist.decoders.out))
+ }
+ b.dst = hist.decoders.out
+ hist.recentOffsets = hist.decoders.prevOffset
+ return nil
+}
+
+func (b *blockDec) prepareSequences(in []byte, hist *history) (err error) {
+ if debugDecoder {
+ printf("prepareSequences: %d byte(s) input\n", len(in))
+ }
+ // Decode Sequences
+ // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#sequences-section
+ if len(in) < 1 {
+ return ErrBlockTooSmall
+ }
+ var nSeqs int
+ seqHeader := in[0]
+ switch {
+ case seqHeader < 128:
+ nSeqs = int(seqHeader)
+ in = in[1:]
+ case seqHeader < 255:
+ if len(in) < 2 {
+ return ErrBlockTooSmall
+ }
+ nSeqs = int(seqHeader-128)<<8 | int(in[1])
+ in = in[2:]
+ case seqHeader == 255:
+ if len(in) < 3 {
+ return ErrBlockTooSmall
+ }
+ nSeqs = 0x7f00 + int(in[1]) + (int(in[2]) << 8)
+ in = in[3:]
+ }
+ if nSeqs == 0 && len(in) != 0 {
+ // When no sequences, there should not be any more data...
+ if debugDecoder {
+ printf("prepareSequences: 0 sequences, but %d byte(s) left on stream\n", len(in))
+ }
+ return ErrUnexpectedBlockSize
+ }
+
+ var seqs = &hist.decoders
+ seqs.nSeqs = nSeqs
+ if nSeqs > 0 {
+ if len(in) < 1 {
+ return ErrBlockTooSmall
+ }
+ br := byteReader{b: in, off: 0}
+ compMode := br.Uint8()
+ br.advance(1)
+ if debugDecoder {
+ printf("Compression modes: 0b%b", compMode)
+ }
+ if compMode&3 != 0 {
+ return errors.New("corrupt block: reserved bits not zero")
+ }
+ for i := uint(0); i < 3; i++ {
+ mode := seqCompMode((compMode >> (6 - i*2)) & 3)
+ if debugDecoder {
+ println("Table", tableIndex(i), "is", mode)
+ }
+ var seq *sequenceDec
+ switch tableIndex(i) {
+ case tableLiteralLengths:
+ seq = &seqs.litLengths
+ case tableOffsets:
+ seq = &seqs.offsets
+ case tableMatchLengths:
+ seq = &seqs.matchLengths
+ default:
+ panic("unknown table")
+ }
+ switch mode {
+ case compModePredefined:
+ if seq.fse != nil && !seq.fse.preDefined {
+ fseDecoderPool.Put(seq.fse)
+ }
+ seq.fse = &fsePredef[i]
+ case compModeRLE:
+ if br.remain() < 1 {
+ return ErrBlockTooSmall
+ }
+ v := br.Uint8()
+ br.advance(1)
+ if seq.fse == nil || seq.fse.preDefined {
+ seq.fse = fseDecoderPool.Get().(*fseDecoder)
+ }
+ symb, err := decSymbolValue(v, symbolTableX[i])
+ if err != nil {
+ printf("RLE Transform table (%v) error: %v", tableIndex(i), err)
+ return err
+ }
+ seq.fse.setRLE(symb)
+ if debugDecoder {
+ printf("RLE set to 0x%x, code: %v", symb, v)
+ }
+ case compModeFSE:
+ if debugDecoder {
+ println("Reading table for", tableIndex(i))
+ }
+ if seq.fse == nil || seq.fse.preDefined {
+ seq.fse = fseDecoderPool.Get().(*fseDecoder)
+ }
+ err := seq.fse.readNCount(&br, uint16(maxTableSymbol[i]))
+ if err != nil {
+ println("Read table error:", err)
+ return err
+ }
+ err = seq.fse.transform(symbolTableX[i])
+ if err != nil {
+ println("Transform table error:", err)
+ return err
+ }
+ if debugDecoder {
+ println("Read table ok", "symbolLen:", seq.fse.symbolLen)
+ }
+ case compModeRepeat:
+ seq.repeat = true
+ }
+ if br.overread() {
+ return io.ErrUnexpectedEOF
+ }
+ }
+ in = br.unread()
+ }
+ if debugDecoder {
+ println("Literals:", len(seqs.literals), "hash:", xxhash.Sum64(seqs.literals), "and", seqs.nSeqs, "sequences.")
+ }
+
+ if nSeqs == 0 {
+ if len(b.sequence) > 0 {
+ b.sequence = b.sequence[:0]
+ }
+ return nil
+ }
+ br := seqs.br
+ if br == nil {
+ br = &bitReader{}
+ }
+ if err := br.init(in); err != nil {
+ return err
+ }
+
+ if err := seqs.initialize(br, hist, b.dst); err != nil {
+ println("initializing sequences:", err)
+ return err
+ }
+ // Extract blocks...
+ if false && hist.dict == nil {
+ fatalErr := func(err error) {
+ if err != nil {
+ panic(err)
+ }
+ }
+ fn := fmt.Sprintf("n-%d-lits-%d-prev-%d-%d-%d-win-%d.blk", hist.decoders.nSeqs, len(hist.decoders.literals), hist.recentOffsets[0], hist.recentOffsets[1], hist.recentOffsets[2], hist.windowSize)
+ var buf bytes.Buffer
+ fatalErr(binary.Write(&buf, binary.LittleEndian, hist.decoders.litLengths.fse))
+ fatalErr(binary.Write(&buf, binary.LittleEndian, hist.decoders.matchLengths.fse))
+ fatalErr(binary.Write(&buf, binary.LittleEndian, hist.decoders.offsets.fse))
+ buf.Write(in)
+ os.WriteFile(filepath.Join("testdata", "seqs", fn), buf.Bytes(), os.ModePerm)
+ }
+
+ return nil
+}
+
+func (b *blockDec) decodeSequences(hist *history) error {
+ if cap(b.sequence) < hist.decoders.nSeqs {
+ if b.lowMem {
+ b.sequence = make([]seqVals, 0, hist.decoders.nSeqs)
+ } else {
+ b.sequence = make([]seqVals, 0, 0x7F00+0xffff)
+ }
+ }
+ b.sequence = b.sequence[:hist.decoders.nSeqs]
+ if hist.decoders.nSeqs == 0 {
+ hist.decoders.seqSize = len(hist.decoders.literals)
+ return nil
+ }
+ hist.decoders.windowSize = hist.windowSize
+ hist.decoders.prevOffset = hist.recentOffsets
+
+ err := hist.decoders.decode(b.sequence)
+ hist.recentOffsets = hist.decoders.prevOffset
+ return err
+}
+
+func (b *blockDec) executeSequences(hist *history) error {
+ hbytes := hist.b
+ if len(hbytes) > hist.windowSize {
+ hbytes = hbytes[len(hbytes)-hist.windowSize:]
+ // We do not need history anymore.
+ if hist.dict != nil {
+ hist.dict.content = nil
+ }
+ }
+ hist.decoders.windowSize = hist.windowSize
+ hist.decoders.out = b.dst[:0]
+ err := hist.decoders.execute(b.sequence, hbytes)
+ if err != nil {
+ return err
+ }
+ return b.updateHistory(hist)
+}
+
+func (b *blockDec) updateHistory(hist *history) error {
+ if len(b.data) > maxCompressedBlockSize {
+ return fmt.Errorf("compressed block size too large (%d)", len(b.data))
+ }
+ // Set output and release references.
+ b.dst = hist.decoders.out
+ hist.recentOffsets = hist.decoders.prevOffset
+
+ if b.Last {
+ // if last block we don't care about history.
+ println("Last block, no history returned")
+ hist.b = hist.b[:0]
+ return nil
+ } else {
+ hist.append(b.dst)
+ if debugDecoder {
+ println("Finished block with ", len(b.sequence), "sequences. Added", len(b.dst), "to history, now length", len(hist.b))
+ }
+ }
+ hist.decoders.out, hist.decoders.literals = nil, nil
+
+ return nil
+}
diff --git a/vendor/github.com/klauspost/compress/zstd/blockenc.go b/vendor/github.com/klauspost/compress/zstd/blockenc.go
new file mode 100644
index 00000000..32a7f401
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/blockenc.go
@@ -0,0 +1,909 @@
+// Copyright 2019+ Klaus Post. All rights reserved.
+// License information can be found in the LICENSE file.
+// Based on work by Yann Collet, released under BSD License.
+
+package zstd
+
+import (
+ "errors"
+ "fmt"
+ "math"
+ "math/bits"
+
+ "github.com/klauspost/compress/huff0"
+)
+
+type blockEnc struct {
+ size int
+ literals []byte
+ sequences []seq
+ coders seqCoders
+ litEnc *huff0.Scratch
+ dictLitEnc *huff0.Scratch
+ wr bitWriter
+
+ extraLits int
+ output []byte
+ recentOffsets [3]uint32
+ prevRecentOffsets [3]uint32
+
+ last bool
+ lowMem bool
+}
+
+// init should be used once the block has been created.
+// If called more than once, the effect is the same as calling reset.
+func (b *blockEnc) init() {
+ if b.lowMem {
+ // 1K literals
+ if cap(b.literals) < 1<<10 {
+ b.literals = make([]byte, 0, 1<<10)
+ }
+ const defSeqs = 20
+ if cap(b.sequences) < defSeqs {
+ b.sequences = make([]seq, 0, defSeqs)
+ }
+ // 1K
+ if cap(b.output) < 1<<10 {
+ b.output = make([]byte, 0, 1<<10)
+ }
+ } else {
+ if cap(b.literals) < maxCompressedBlockSize {
+ b.literals = make([]byte, 0, maxCompressedBlockSize)
+ }
+ const defSeqs = 2000
+ if cap(b.sequences) < defSeqs {
+ b.sequences = make([]seq, 0, defSeqs)
+ }
+ if cap(b.output) < maxCompressedBlockSize {
+ b.output = make([]byte, 0, maxCompressedBlockSize)
+ }
+ }
+
+ if b.coders.mlEnc == nil {
+ b.coders.mlEnc = &fseEncoder{}
+ b.coders.mlPrev = &fseEncoder{}
+ b.coders.ofEnc = &fseEncoder{}
+ b.coders.ofPrev = &fseEncoder{}
+ b.coders.llEnc = &fseEncoder{}
+ b.coders.llPrev = &fseEncoder{}
+ }
+ b.litEnc = &huff0.Scratch{WantLogLess: 4}
+ b.reset(nil)
+}
+
+// initNewEncode can be used to reset offsets and encoders to the initial state.
+func (b *blockEnc) initNewEncode() {
+ b.recentOffsets = [3]uint32{1, 4, 8}
+ b.litEnc.Reuse = huff0.ReusePolicyNone
+ b.coders.setPrev(nil, nil, nil)
+}
+
+// reset will reset the block for a new encode, but in the same stream,
+// meaning that state will be carried over, but the block content is reset.
+// If a previous block is provided, the recent offsets are carried over.
+func (b *blockEnc) reset(prev *blockEnc) {
+ b.extraLits = 0
+ b.literals = b.literals[:0]
+ b.size = 0
+ b.sequences = b.sequences[:0]
+ b.output = b.output[:0]
+ b.last = false
+ if prev != nil {
+ b.recentOffsets = prev.prevRecentOffsets
+ }
+ b.dictLitEnc = nil
+}
+
+// reset will reset the block for a new encode, but in the same stream,
+// meaning that state will be carried over, but the block content is reset.
+// If a previous block is provided, the recent offsets are carried over.
+func (b *blockEnc) swapEncoders(prev *blockEnc) {
+ b.coders.swap(&prev.coders)
+ b.litEnc, prev.litEnc = prev.litEnc, b.litEnc
+}
+
+// blockHeader contains the information for a block header.
+type blockHeader uint32
+
+// setLast sets the 'last' indicator on a block.
+func (h *blockHeader) setLast(b bool) {
+ if b {
+ *h = *h | 1
+ } else {
+ const mask = (1 << 24) - 2
+ *h = *h & mask
+ }
+}
+
+// setSize will store the compressed size of a block.
+func (h *blockHeader) setSize(v uint32) {
+ const mask = 7
+ *h = (*h)&mask | blockHeader(v<<3)
+}
+
+// setType sets the block type.
+func (h *blockHeader) setType(t blockType) {
+ const mask = 1 | (((1 << 24) - 1) ^ 7)
+ *h = (*h & mask) | blockHeader(t<<1)
+}
+
+// appendTo will append the block header to a slice.
+func (h blockHeader) appendTo(b []byte) []byte {
+ return append(b, uint8(h), uint8(h>>8), uint8(h>>16))
+}
+
+// String returns a string representation of the block.
+func (h blockHeader) String() string {
+ return fmt.Sprintf("Type: %d, Size: %d, Last:%t", (h>>1)&3, h>>3, h&1 == 1)
+}
+
+// literalsHeader contains literals header information.
+type literalsHeader uint64
+
+// setType can be used to set the type of literal block.
+func (h *literalsHeader) setType(t literalsBlockType) {
+ const mask = math.MaxUint64 - 3
+ *h = (*h & mask) | literalsHeader(t)
+}
+
+// setSize can be used to set a single size, for uncompressed and RLE content.
+func (h *literalsHeader) setSize(regenLen int) {
+ inBits := bits.Len32(uint32(regenLen))
+ // Only retain 2 bits
+ const mask = 3
+ lh := uint64(*h & mask)
+ switch {
+ case inBits < 5:
+ lh |= (uint64(regenLen) << 3) | (1 << 60)
+ if debugEncoder {
+ got := int(lh>>3) & 0xff
+ if got != regenLen {
+ panic(fmt.Sprint("litRegenSize = ", regenLen, "(want) != ", got, "(got)"))
+ }
+ }
+ case inBits < 12:
+ lh |= (1 << 2) | (uint64(regenLen) << 4) | (2 << 60)
+ case inBits < 20:
+ lh |= (3 << 2) | (uint64(regenLen) << 4) | (3 << 60)
+ default:
+ panic(fmt.Errorf("internal error: block too big (%d)", regenLen))
+ }
+ *h = literalsHeader(lh)
+}
+
+// setSizes will set the size of a compressed literals section and the input length.
+func (h *literalsHeader) setSizes(compLen, inLen int, single bool) {
+ compBits, inBits := bits.Len32(uint32(compLen)), bits.Len32(uint32(inLen))
+ // Only retain 2 bits
+ const mask = 3
+ lh := uint64(*h & mask)
+ switch {
+ case compBits <= 10 && inBits <= 10:
+ if !single {
+ lh |= 1 << 2
+ }
+ lh |= (uint64(inLen) << 4) | (uint64(compLen) << (10 + 4)) | (3 << 60)
+ if debugEncoder {
+ const mmask = (1 << 24) - 1
+ n := (lh >> 4) & mmask
+ if int(n&1023) != inLen {
+ panic(fmt.Sprint("regensize:", int(n&1023), "!=", inLen, inBits))
+ }
+ if int(n>>10) != compLen {
+ panic(fmt.Sprint("compsize:", int(n>>10), "!=", compLen, compBits))
+ }
+ }
+ case compBits <= 14 && inBits <= 14:
+ lh |= (2 << 2) | (uint64(inLen) << 4) | (uint64(compLen) << (14 + 4)) | (4 << 60)
+ if single {
+ panic("single stream used with more than 10 bits length.")
+ }
+ case compBits <= 18 && inBits <= 18:
+ lh |= (3 << 2) | (uint64(inLen) << 4) | (uint64(compLen) << (18 + 4)) | (5 << 60)
+ if single {
+ panic("single stream used with more than 10 bits length.")
+ }
+ default:
+ panic("internal error: block too big")
+ }
+ *h = literalsHeader(lh)
+}
+
+// appendTo will append the literals header to a byte slice.
+func (h literalsHeader) appendTo(b []byte) []byte {
+ size := uint8(h >> 60)
+ switch size {
+ case 1:
+ b = append(b, uint8(h))
+ case 2:
+ b = append(b, uint8(h), uint8(h>>8))
+ case 3:
+ b = append(b, uint8(h), uint8(h>>8), uint8(h>>16))
+ case 4:
+ b = append(b, uint8(h), uint8(h>>8), uint8(h>>16), uint8(h>>24))
+ case 5:
+ b = append(b, uint8(h), uint8(h>>8), uint8(h>>16), uint8(h>>24), uint8(h>>32))
+ default:
+ panic(fmt.Errorf("internal error: literalsHeader has invalid size (%d)", size))
+ }
+ return b
+}
+
+// size returns the output size with currently set values.
+func (h literalsHeader) size() int {
+ return int(h >> 60)
+}
+
+func (h literalsHeader) String() string {
+ return fmt.Sprintf("Type: %d, SizeFormat: %d, Size: 0x%d, Bytes:%d", literalsBlockType(h&3), (h>>2)&3, h&((1<<60)-1)>>4, h>>60)
+}
+
+// pushOffsets will push the recent offsets to the backup store.
+func (b *blockEnc) pushOffsets() {
+ b.prevRecentOffsets = b.recentOffsets
+}
+
+// pushOffsets will push the recent offsets to the backup store.
+func (b *blockEnc) popOffsets() {
+ b.recentOffsets = b.prevRecentOffsets
+}
+
+// matchOffset will adjust recent offsets and return the adjusted one,
+// if it matches a previous offset.
+func (b *blockEnc) matchOffset(offset, lits uint32) uint32 {
+ // Check if offset is one of the recent offsets.
+ // Adjusts the output offset accordingly.
+ // Gives a tiny bit of compression, typically around 1%.
+ if true {
+ if lits > 0 {
+ switch offset {
+ case b.recentOffsets[0]:
+ offset = 1
+ case b.recentOffsets[1]:
+ b.recentOffsets[1] = b.recentOffsets[0]
+ b.recentOffsets[0] = offset
+ offset = 2
+ case b.recentOffsets[2]:
+ b.recentOffsets[2] = b.recentOffsets[1]
+ b.recentOffsets[1] = b.recentOffsets[0]
+ b.recentOffsets[0] = offset
+ offset = 3
+ default:
+ b.recentOffsets[2] = b.recentOffsets[1]
+ b.recentOffsets[1] = b.recentOffsets[0]
+ b.recentOffsets[0] = offset
+ offset += 3
+ }
+ } else {
+ switch offset {
+ case b.recentOffsets[1]:
+ b.recentOffsets[1] = b.recentOffsets[0]
+ b.recentOffsets[0] = offset
+ offset = 1
+ case b.recentOffsets[2]:
+ b.recentOffsets[2] = b.recentOffsets[1]
+ b.recentOffsets[1] = b.recentOffsets[0]
+ b.recentOffsets[0] = offset
+ offset = 2
+ case b.recentOffsets[0] - 1:
+ b.recentOffsets[2] = b.recentOffsets[1]
+ b.recentOffsets[1] = b.recentOffsets[0]
+ b.recentOffsets[0] = offset
+ offset = 3
+ default:
+ b.recentOffsets[2] = b.recentOffsets[1]
+ b.recentOffsets[1] = b.recentOffsets[0]
+ b.recentOffsets[0] = offset
+ offset += 3
+ }
+ }
+ } else {
+ offset += 3
+ }
+ return offset
+}
+
+// encodeRaw can be used to set the output to a raw representation of supplied bytes.
+func (b *blockEnc) encodeRaw(a []byte) {
+ var bh blockHeader
+ bh.setLast(b.last)
+ bh.setSize(uint32(len(a)))
+ bh.setType(blockTypeRaw)
+ b.output = bh.appendTo(b.output[:0])
+ b.output = append(b.output, a...)
+ if debugEncoder {
+ println("Adding RAW block, length", len(a), "last:", b.last)
+ }
+}
+
+// encodeRaw can be used to set the output to a raw representation of supplied bytes.
+func (b *blockEnc) encodeRawTo(dst, src []byte) []byte {
+ var bh blockHeader
+ bh.setLast(b.last)
+ bh.setSize(uint32(len(src)))
+ bh.setType(blockTypeRaw)
+ dst = bh.appendTo(dst)
+ dst = append(dst, src...)
+ if debugEncoder {
+ println("Adding RAW block, length", len(src), "last:", b.last)
+ }
+ return dst
+}
+
+// encodeLits can be used if the block is only litLen.
+func (b *blockEnc) encodeLits(lits []byte, raw bool) error {
+ var bh blockHeader
+ bh.setLast(b.last)
+ bh.setSize(uint32(len(lits)))
+
+ // Don't compress extremely small blocks
+ if len(lits) < 8 || (len(lits) < 32 && b.dictLitEnc == nil) || raw {
+ if debugEncoder {
+ println("Adding RAW block, length", len(lits), "last:", b.last)
+ }
+ bh.setType(blockTypeRaw)
+ b.output = bh.appendTo(b.output)
+ b.output = append(b.output, lits...)
+ return nil
+ }
+
+ var (
+ out []byte
+ reUsed, single bool
+ err error
+ )
+ if b.dictLitEnc != nil {
+ b.litEnc.TransferCTable(b.dictLitEnc)
+ b.litEnc.Reuse = huff0.ReusePolicyAllow
+ b.dictLitEnc = nil
+ }
+ if len(lits) >= 1024 {
+ // Use 4 Streams.
+ out, reUsed, err = huff0.Compress4X(lits, b.litEnc)
+ } else if len(lits) > 16 {
+ // Use 1 stream
+ single = true
+ out, reUsed, err = huff0.Compress1X(lits, b.litEnc)
+ } else {
+ err = huff0.ErrIncompressible
+ }
+ if err == nil && len(out)+5 > len(lits) {
+ // If we are close, we may still be worse or equal to raw.
+ var lh literalsHeader
+ lh.setSizes(len(out), len(lits), single)
+ if len(out)+lh.size() >= len(lits) {
+ err = huff0.ErrIncompressible
+ }
+ }
+ switch err {
+ case huff0.ErrIncompressible:
+ if debugEncoder {
+ println("Adding RAW block, length", len(lits), "last:", b.last)
+ }
+ bh.setType(blockTypeRaw)
+ b.output = bh.appendTo(b.output)
+ b.output = append(b.output, lits...)
+ return nil
+ case huff0.ErrUseRLE:
+ if debugEncoder {
+ println("Adding RLE block, length", len(lits))
+ }
+ bh.setType(blockTypeRLE)
+ b.output = bh.appendTo(b.output)
+ b.output = append(b.output, lits[0])
+ return nil
+ case nil:
+ default:
+ return err
+ }
+ // Compressed...
+ // Now, allow reuse
+ b.litEnc.Reuse = huff0.ReusePolicyAllow
+ bh.setType(blockTypeCompressed)
+ var lh literalsHeader
+ if reUsed {
+ if debugEncoder {
+ println("Reused tree, compressed to", len(out))
+ }
+ lh.setType(literalsBlockTreeless)
+ } else {
+ if debugEncoder {
+ println("New tree, compressed to", len(out), "tree size:", len(b.litEnc.OutTable))
+ }
+ lh.setType(literalsBlockCompressed)
+ }
+ // Set sizes
+ lh.setSizes(len(out), len(lits), single)
+ bh.setSize(uint32(len(out) + lh.size() + 1))
+
+ // Write block headers.
+ b.output = bh.appendTo(b.output)
+ b.output = lh.appendTo(b.output)
+ // Add compressed data.
+ b.output = append(b.output, out...)
+ // No sequences.
+ b.output = append(b.output, 0)
+ return nil
+}
+
+// encodeRLE will encode an RLE block.
+func (b *blockEnc) encodeRLE(val byte, length uint32) {
+ var bh blockHeader
+ bh.setLast(b.last)
+ bh.setSize(length)
+ bh.setType(blockTypeRLE)
+ b.output = bh.appendTo(b.output)
+ b.output = append(b.output, val)
+}
+
+// fuzzFseEncoder can be used to fuzz the FSE encoder.
+func fuzzFseEncoder(data []byte) int {
+ if len(data) > maxSequences || len(data) < 2 {
+ return 0
+ }
+ enc := fseEncoder{}
+ hist := enc.Histogram()
+ maxSym := uint8(0)
+ for i, v := range data {
+ v = v & 63
+ data[i] = v
+ hist[v]++
+ if v > maxSym {
+ maxSym = v
+ }
+ }
+ if maxSym == 0 {
+ // All 0
+ return 0
+ }
+ maxCount := func(a []uint32) int {
+ var max uint32
+ for _, v := range a {
+ if v > max {
+ max = v
+ }
+ }
+ return int(max)
+ }
+ cnt := maxCount(hist[:maxSym])
+ if cnt == len(data) {
+ // RLE
+ return 0
+ }
+ enc.HistogramFinished(maxSym, cnt)
+ err := enc.normalizeCount(len(data))
+ if err != nil {
+ return 0
+ }
+ _, err = enc.writeCount(nil)
+ if err != nil {
+ panic(err)
+ }
+ return 1
+}
+
+// encode will encode the block and append the output in b.output.
+// Previous offset codes must be pushed if more blocks are expected.
+func (b *blockEnc) encode(org []byte, raw, rawAllLits bool) error {
+ if len(b.sequences) == 0 {
+ return b.encodeLits(b.literals, rawAllLits)
+ }
+ if len(b.sequences) == 1 && len(org) > 0 && len(b.literals) <= 1 {
+ // Check common RLE cases.
+ seq := b.sequences[0]
+ if seq.litLen == uint32(len(b.literals)) && seq.offset-3 == 1 {
+ // Offset == 1 and 0 or 1 literals.
+ b.encodeRLE(org[0], b.sequences[0].matchLen+zstdMinMatch+seq.litLen)
+ return nil
+ }
+ }
+
+ // We want some difference to at least account for the headers.
+ saved := b.size - len(b.literals) - (b.size >> 6)
+ if saved < 16 {
+ if org == nil {
+ return errIncompressible
+ }
+ b.popOffsets()
+ return b.encodeLits(org, rawAllLits)
+ }
+
+ var bh blockHeader
+ var lh literalsHeader
+ bh.setLast(b.last)
+ bh.setType(blockTypeCompressed)
+ // Store offset of the block header. Needed when we know the size.
+ bhOffset := len(b.output)
+ b.output = bh.appendTo(b.output)
+
+ var (
+ out []byte
+ reUsed, single bool
+ err error
+ )
+ if b.dictLitEnc != nil {
+ b.litEnc.TransferCTable(b.dictLitEnc)
+ b.litEnc.Reuse = huff0.ReusePolicyAllow
+ b.dictLitEnc = nil
+ }
+ if len(b.literals) >= 1024 && !raw {
+ // Use 4 Streams.
+ out, reUsed, err = huff0.Compress4X(b.literals, b.litEnc)
+ } else if len(b.literals) > 16 && !raw {
+ // Use 1 stream
+ single = true
+ out, reUsed, err = huff0.Compress1X(b.literals, b.litEnc)
+ } else {
+ err = huff0.ErrIncompressible
+ }
+
+ if err == nil && len(out)+5 > len(b.literals) {
+ // If we are close, we may still be worse or equal to raw.
+ var lh literalsHeader
+ lh.setSize(len(b.literals))
+ szRaw := lh.size()
+ lh.setSizes(len(out), len(b.literals), single)
+ szComp := lh.size()
+ if len(out)+szComp >= len(b.literals)+szRaw {
+ err = huff0.ErrIncompressible
+ }
+ }
+ switch err {
+ case huff0.ErrIncompressible:
+ lh.setType(literalsBlockRaw)
+ lh.setSize(len(b.literals))
+ b.output = lh.appendTo(b.output)
+ b.output = append(b.output, b.literals...)
+ if debugEncoder {
+ println("Adding literals RAW, length", len(b.literals))
+ }
+ case huff0.ErrUseRLE:
+ lh.setType(literalsBlockRLE)
+ lh.setSize(len(b.literals))
+ b.output = lh.appendTo(b.output)
+ b.output = append(b.output, b.literals[0])
+ if debugEncoder {
+ println("Adding literals RLE")
+ }
+ case nil:
+ // Compressed litLen...
+ if reUsed {
+ if debugEncoder {
+ println("reused tree")
+ }
+ lh.setType(literalsBlockTreeless)
+ } else {
+ if debugEncoder {
+ println("new tree, size:", len(b.litEnc.OutTable))
+ }
+ lh.setType(literalsBlockCompressed)
+ if debugEncoder {
+ _, _, err := huff0.ReadTable(out, nil)
+ if err != nil {
+ panic(err)
+ }
+ }
+ }
+ lh.setSizes(len(out), len(b.literals), single)
+ if debugEncoder {
+ printf("Compressed %d literals to %d bytes", len(b.literals), len(out))
+ println("Adding literal header:", lh)
+ }
+ b.output = lh.appendTo(b.output)
+ b.output = append(b.output, out...)
+ b.litEnc.Reuse = huff0.ReusePolicyAllow
+ if debugEncoder {
+ println("Adding literals compressed")
+ }
+ default:
+ if debugEncoder {
+ println("Adding literals ERROR:", err)
+ }
+ return err
+ }
+ // Sequence compression
+
+ // Write the number of sequences
+ switch {
+ case len(b.sequences) < 128:
+ b.output = append(b.output, uint8(len(b.sequences)))
+ case len(b.sequences) < 0x7f00: // TODO: this could be wrong
+ n := len(b.sequences)
+ b.output = append(b.output, 128+uint8(n>>8), uint8(n))
+ default:
+ n := len(b.sequences) - 0x7f00
+ b.output = append(b.output, 255, uint8(n), uint8(n>>8))
+ }
+ if debugEncoder {
+ println("Encoding", len(b.sequences), "sequences")
+ }
+ b.genCodes()
+ llEnc := b.coders.llEnc
+ ofEnc := b.coders.ofEnc
+ mlEnc := b.coders.mlEnc
+ err = llEnc.normalizeCount(len(b.sequences))
+ if err != nil {
+ return err
+ }
+ err = ofEnc.normalizeCount(len(b.sequences))
+ if err != nil {
+ return err
+ }
+ err = mlEnc.normalizeCount(len(b.sequences))
+ if err != nil {
+ return err
+ }
+
+ // Choose the best compression mode for each type.
+ // Will evaluate the new vs predefined and previous.
+ chooseComp := func(cur, prev, preDef *fseEncoder) (*fseEncoder, seqCompMode) {
+ // See if predefined/previous is better
+ hist := cur.count[:cur.symbolLen]
+ nSize := cur.approxSize(hist) + cur.maxHeaderSize()
+ predefSize := preDef.approxSize(hist)
+ prevSize := prev.approxSize(hist)
+
+ // Add a small penalty for new encoders.
+ // Don't bother with extremely small (<2 byte gains).
+ nSize = nSize + (nSize+2*8*16)>>4
+ switch {
+ case predefSize <= prevSize && predefSize <= nSize || forcePreDef:
+ if debugEncoder {
+ println("Using predefined", predefSize>>3, "<=", nSize>>3)
+ }
+ return preDef, compModePredefined
+ case prevSize <= nSize:
+ if debugEncoder {
+ println("Using previous", prevSize>>3, "<=", nSize>>3)
+ }
+ return prev, compModeRepeat
+ default:
+ if debugEncoder {
+ println("Using new, predef", predefSize>>3, ". previous:", prevSize>>3, ">", nSize>>3, "header max:", cur.maxHeaderSize()>>3, "bytes")
+ println("tl:", cur.actualTableLog, "symbolLen:", cur.symbolLen, "norm:", cur.norm[:cur.symbolLen], "hist", cur.count[:cur.symbolLen])
+ }
+ return cur, compModeFSE
+ }
+ }
+
+ // Write compression mode
+ var mode uint8
+ if llEnc.useRLE {
+ mode |= uint8(compModeRLE) << 6
+ llEnc.setRLE(b.sequences[0].llCode)
+ if debugEncoder {
+ println("llEnc.useRLE")
+ }
+ } else {
+ var m seqCompMode
+ llEnc, m = chooseComp(llEnc, b.coders.llPrev, &fsePredefEnc[tableLiteralLengths])
+ mode |= uint8(m) << 6
+ }
+ if ofEnc.useRLE {
+ mode |= uint8(compModeRLE) << 4
+ ofEnc.setRLE(b.sequences[0].ofCode)
+ if debugEncoder {
+ println("ofEnc.useRLE")
+ }
+ } else {
+ var m seqCompMode
+ ofEnc, m = chooseComp(ofEnc, b.coders.ofPrev, &fsePredefEnc[tableOffsets])
+ mode |= uint8(m) << 4
+ }
+
+ if mlEnc.useRLE {
+ mode |= uint8(compModeRLE) << 2
+ mlEnc.setRLE(b.sequences[0].mlCode)
+ if debugEncoder {
+ println("mlEnc.useRLE, code: ", b.sequences[0].mlCode, "value", b.sequences[0].matchLen)
+ }
+ } else {
+ var m seqCompMode
+ mlEnc, m = chooseComp(mlEnc, b.coders.mlPrev, &fsePredefEnc[tableMatchLengths])
+ mode |= uint8(m) << 2
+ }
+ b.output = append(b.output, mode)
+ if debugEncoder {
+ printf("Compression modes: 0b%b", mode)
+ }
+ b.output, err = llEnc.writeCount(b.output)
+ if err != nil {
+ return err
+ }
+ start := len(b.output)
+ b.output, err = ofEnc.writeCount(b.output)
+ if err != nil {
+ return err
+ }
+ if false {
+ println("block:", b.output[start:], "tablelog", ofEnc.actualTableLog, "maxcount:", ofEnc.maxCount)
+ fmt.Printf("selected TableLog: %d, Symbol length: %d\n", ofEnc.actualTableLog, ofEnc.symbolLen)
+ for i, v := range ofEnc.norm[:ofEnc.symbolLen] {
+ fmt.Printf("%3d: %5d -> %4d \n", i, ofEnc.count[i], v)
+ }
+ }
+ b.output, err = mlEnc.writeCount(b.output)
+ if err != nil {
+ return err
+ }
+
+ // Maybe in block?
+ wr := &b.wr
+ wr.reset(b.output)
+
+ var ll, of, ml cState
+
+ // Current sequence
+ seq := len(b.sequences) - 1
+ s := b.sequences[seq]
+ llEnc.setBits(llBitsTable[:])
+ mlEnc.setBits(mlBitsTable[:])
+ ofEnc.setBits(nil)
+
+ llTT, ofTT, mlTT := llEnc.ct.symbolTT[:256], ofEnc.ct.symbolTT[:256], mlEnc.ct.symbolTT[:256]
+
+ // We have 3 bounds checks here (and in the loop).
+ // Since we are iterating backwards it is kinda hard to avoid.
+ llB, ofB, mlB := llTT[s.llCode], ofTT[s.ofCode], mlTT[s.mlCode]
+ ll.init(wr, &llEnc.ct, llB)
+ of.init(wr, &ofEnc.ct, ofB)
+ wr.flush32()
+ ml.init(wr, &mlEnc.ct, mlB)
+
+ // Each of these lookups also generates a bounds check.
+ wr.addBits32NC(s.litLen, llB.outBits)
+ wr.addBits32NC(s.matchLen, mlB.outBits)
+ wr.flush32()
+ wr.addBits32NC(s.offset, ofB.outBits)
+ if debugSequences {
+ println("Encoded seq", seq, s, "codes:", s.llCode, s.mlCode, s.ofCode, "states:", ll.state, ml.state, of.state, "bits:", llB, mlB, ofB)
+ }
+ seq--
+ // Store sequences in reverse...
+ for seq >= 0 {
+ s = b.sequences[seq]
+
+ ofB := ofTT[s.ofCode]
+ wr.flush32() // tablelog max is below 8 for each, so it will fill max 24 bits.
+ //of.encode(ofB)
+ nbBitsOut := (uint32(of.state) + ofB.deltaNbBits) >> 16
+ dstState := int32(of.state>>(nbBitsOut&15)) + int32(ofB.deltaFindState)
+ wr.addBits16NC(of.state, uint8(nbBitsOut))
+ of.state = of.stateTable[dstState]
+
+ // Accumulate extra bits.
+ outBits := ofB.outBits & 31
+ extraBits := uint64(s.offset & bitMask32[outBits])
+ extraBitsN := outBits
+
+ mlB := mlTT[s.mlCode]
+ //ml.encode(mlB)
+ nbBitsOut = (uint32(ml.state) + mlB.deltaNbBits) >> 16
+ dstState = int32(ml.state>>(nbBitsOut&15)) + int32(mlB.deltaFindState)
+ wr.addBits16NC(ml.state, uint8(nbBitsOut))
+ ml.state = ml.stateTable[dstState]
+
+ outBits = mlB.outBits & 31
+ extraBits = extraBits<> 16
+ dstState = int32(ll.state>>(nbBitsOut&15)) + int32(llB.deltaFindState)
+ wr.addBits16NC(ll.state, uint8(nbBitsOut))
+ ll.state = ll.stateTable[dstState]
+
+ outBits = llB.outBits & 31
+ extraBits = extraBits<= b.size {
+ // Discard and encode as raw block.
+ b.output = b.encodeRawTo(b.output[:bhOffset], org)
+ b.popOffsets()
+ b.litEnc.Reuse = huff0.ReusePolicyNone
+ return nil
+ }
+
+ // Size is output minus block header.
+ bh.setSize(uint32(len(b.output)-bhOffset) - 3)
+ if debugEncoder {
+ println("Rewriting block header", bh)
+ }
+ _ = bh.appendTo(b.output[bhOffset:bhOffset])
+ b.coders.setPrev(llEnc, mlEnc, ofEnc)
+ return nil
+}
+
+var errIncompressible = errors.New("incompressible")
+
+func (b *blockEnc) genCodes() {
+ if len(b.sequences) == 0 {
+ // nothing to do
+ return
+ }
+ if len(b.sequences) > math.MaxUint16 {
+ panic("can only encode up to 64K sequences")
+ }
+ // No bounds checks after here:
+ llH := b.coders.llEnc.Histogram()
+ ofH := b.coders.ofEnc.Histogram()
+ mlH := b.coders.mlEnc.Histogram()
+ for i := range llH {
+ llH[i] = 0
+ }
+ for i := range ofH {
+ ofH[i] = 0
+ }
+ for i := range mlH {
+ mlH[i] = 0
+ }
+
+ var llMax, ofMax, mlMax uint8
+ for i := range b.sequences {
+ seq := &b.sequences[i]
+ v := llCode(seq.litLen)
+ seq.llCode = v
+ llH[v]++
+ if v > llMax {
+ llMax = v
+ }
+
+ v = ofCode(seq.offset)
+ seq.ofCode = v
+ ofH[v]++
+ if v > ofMax {
+ ofMax = v
+ }
+
+ v = mlCode(seq.matchLen)
+ seq.mlCode = v
+ mlH[v]++
+ if v > mlMax {
+ mlMax = v
+ if debugAsserts && mlMax > maxMatchLengthSymbol {
+ panic(fmt.Errorf("mlMax > maxMatchLengthSymbol (%d), matchlen: %d", mlMax, seq.matchLen))
+ }
+ }
+ }
+ maxCount := func(a []uint32) int {
+ var max uint32
+ for _, v := range a {
+ if v > max {
+ max = v
+ }
+ }
+ return int(max)
+ }
+ if debugAsserts && mlMax > maxMatchLengthSymbol {
+ panic(fmt.Errorf("mlMax > maxMatchLengthSymbol (%d)", mlMax))
+ }
+ if debugAsserts && ofMax > maxOffsetBits {
+ panic(fmt.Errorf("ofMax > maxOffsetBits (%d)", ofMax))
+ }
+ if debugAsserts && llMax > maxLiteralLengthSymbol {
+ panic(fmt.Errorf("llMax > maxLiteralLengthSymbol (%d)", llMax))
+ }
+
+ b.coders.mlEnc.HistogramFinished(mlMax, maxCount(mlH[:mlMax+1]))
+ b.coders.ofEnc.HistogramFinished(ofMax, maxCount(ofH[:ofMax+1]))
+ b.coders.llEnc.HistogramFinished(llMax, maxCount(llH[:llMax+1]))
+}
diff --git a/vendor/github.com/klauspost/compress/zstd/blocktype_string.go b/vendor/github.com/klauspost/compress/zstd/blocktype_string.go
new file mode 100644
index 00000000..01a01e48
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/blocktype_string.go
@@ -0,0 +1,85 @@
+// Code generated by "stringer -type=blockType,literalsBlockType,seqCompMode,tableIndex"; DO NOT EDIT.
+
+package zstd
+
+import "strconv"
+
+func _() {
+ // An "invalid array index" compiler error signifies that the constant values have changed.
+ // Re-run the stringer command to generate them again.
+ var x [1]struct{}
+ _ = x[blockTypeRaw-0]
+ _ = x[blockTypeRLE-1]
+ _ = x[blockTypeCompressed-2]
+ _ = x[blockTypeReserved-3]
+}
+
+const _blockType_name = "blockTypeRawblockTypeRLEblockTypeCompressedblockTypeReserved"
+
+var _blockType_index = [...]uint8{0, 12, 24, 43, 60}
+
+func (i blockType) String() string {
+ if i >= blockType(len(_blockType_index)-1) {
+ return "blockType(" + strconv.FormatInt(int64(i), 10) + ")"
+ }
+ return _blockType_name[_blockType_index[i]:_blockType_index[i+1]]
+}
+func _() {
+ // An "invalid array index" compiler error signifies that the constant values have changed.
+ // Re-run the stringer command to generate them again.
+ var x [1]struct{}
+ _ = x[literalsBlockRaw-0]
+ _ = x[literalsBlockRLE-1]
+ _ = x[literalsBlockCompressed-2]
+ _ = x[literalsBlockTreeless-3]
+}
+
+const _literalsBlockType_name = "literalsBlockRawliteralsBlockRLEliteralsBlockCompressedliteralsBlockTreeless"
+
+var _literalsBlockType_index = [...]uint8{0, 16, 32, 55, 76}
+
+func (i literalsBlockType) String() string {
+ if i >= literalsBlockType(len(_literalsBlockType_index)-1) {
+ return "literalsBlockType(" + strconv.FormatInt(int64(i), 10) + ")"
+ }
+ return _literalsBlockType_name[_literalsBlockType_index[i]:_literalsBlockType_index[i+1]]
+}
+func _() {
+ // An "invalid array index" compiler error signifies that the constant values have changed.
+ // Re-run the stringer command to generate them again.
+ var x [1]struct{}
+ _ = x[compModePredefined-0]
+ _ = x[compModeRLE-1]
+ _ = x[compModeFSE-2]
+ _ = x[compModeRepeat-3]
+}
+
+const _seqCompMode_name = "compModePredefinedcompModeRLEcompModeFSEcompModeRepeat"
+
+var _seqCompMode_index = [...]uint8{0, 18, 29, 40, 54}
+
+func (i seqCompMode) String() string {
+ if i >= seqCompMode(len(_seqCompMode_index)-1) {
+ return "seqCompMode(" + strconv.FormatInt(int64(i), 10) + ")"
+ }
+ return _seqCompMode_name[_seqCompMode_index[i]:_seqCompMode_index[i+1]]
+}
+func _() {
+ // An "invalid array index" compiler error signifies that the constant values have changed.
+ // Re-run the stringer command to generate them again.
+ var x [1]struct{}
+ _ = x[tableLiteralLengths-0]
+ _ = x[tableOffsets-1]
+ _ = x[tableMatchLengths-2]
+}
+
+const _tableIndex_name = "tableLiteralLengthstableOffsetstableMatchLengths"
+
+var _tableIndex_index = [...]uint8{0, 19, 31, 48}
+
+func (i tableIndex) String() string {
+ if i >= tableIndex(len(_tableIndex_index)-1) {
+ return "tableIndex(" + strconv.FormatInt(int64(i), 10) + ")"
+ }
+ return _tableIndex_name[_tableIndex_index[i]:_tableIndex_index[i+1]]
+}
diff --git a/vendor/github.com/klauspost/compress/zstd/bytebuf.go b/vendor/github.com/klauspost/compress/zstd/bytebuf.go
new file mode 100644
index 00000000..55a38855
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/bytebuf.go
@@ -0,0 +1,131 @@
+// Copyright 2019+ Klaus Post. All rights reserved.
+// License information can be found in the LICENSE file.
+// Based on work by Yann Collet, released under BSD License.
+
+package zstd
+
+import (
+ "fmt"
+ "io"
+)
+
+type byteBuffer interface {
+ // Read up to 8 bytes.
+ // Returns io.ErrUnexpectedEOF if this cannot be satisfied.
+ readSmall(n int) ([]byte, error)
+
+ // Read >8 bytes.
+ // MAY use the destination slice.
+ readBig(n int, dst []byte) ([]byte, error)
+
+ // Read a single byte.
+ readByte() (byte, error)
+
+ // Skip n bytes.
+ skipN(n int64) error
+}
+
+// in-memory buffer
+type byteBuf []byte
+
+func (b *byteBuf) readSmall(n int) ([]byte, error) {
+ if debugAsserts && n > 8 {
+ panic(fmt.Errorf("small read > 8 (%d). use readBig", n))
+ }
+ bb := *b
+ if len(bb) < n {
+ return nil, io.ErrUnexpectedEOF
+ }
+ r := bb[:n]
+ *b = bb[n:]
+ return r, nil
+}
+
+func (b *byteBuf) readBig(n int, dst []byte) ([]byte, error) {
+ bb := *b
+ if len(bb) < n {
+ return nil, io.ErrUnexpectedEOF
+ }
+ r := bb[:n]
+ *b = bb[n:]
+ return r, nil
+}
+
+func (b *byteBuf) readByte() (byte, error) {
+ bb := *b
+ if len(bb) < 1 {
+ return 0, io.ErrUnexpectedEOF
+ }
+ r := bb[0]
+ *b = bb[1:]
+ return r, nil
+}
+
+func (b *byteBuf) skipN(n int64) error {
+ bb := *b
+ if n < 0 {
+ return fmt.Errorf("negative skip (%d) requested", n)
+ }
+ if int64(len(bb)) < n {
+ return io.ErrUnexpectedEOF
+ }
+ *b = bb[n:]
+ return nil
+}
+
+// wrapper around a reader.
+type readerWrapper struct {
+ r io.Reader
+ tmp [8]byte
+}
+
+func (r *readerWrapper) readSmall(n int) ([]byte, error) {
+ if debugAsserts && n > 8 {
+ panic(fmt.Errorf("small read > 8 (%d). use readBig", n))
+ }
+ n2, err := io.ReadFull(r.r, r.tmp[:n])
+ // We only really care about the actual bytes read.
+ if err != nil {
+ if err == io.EOF {
+ return nil, io.ErrUnexpectedEOF
+ }
+ if debugDecoder {
+ println("readSmall: got", n2, "want", n, "err", err)
+ }
+ return nil, err
+ }
+ return r.tmp[:n], nil
+}
+
+func (r *readerWrapper) readBig(n int, dst []byte) ([]byte, error) {
+ if cap(dst) < n {
+ dst = make([]byte, n)
+ }
+ n2, err := io.ReadFull(r.r, dst[:n])
+ if err == io.EOF && n > 0 {
+ err = io.ErrUnexpectedEOF
+ }
+ return dst[:n2], err
+}
+
+func (r *readerWrapper) readByte() (byte, error) {
+ n2, err := io.ReadFull(r.r, r.tmp[:1])
+ if err != nil {
+ if err == io.EOF {
+ err = io.ErrUnexpectedEOF
+ }
+ return 0, err
+ }
+ if n2 != 1 {
+ return 0, io.ErrUnexpectedEOF
+ }
+ return r.tmp[0], nil
+}
+
+func (r *readerWrapper) skipN(n int64) error {
+ n2, err := io.CopyN(io.Discard, r.r, n)
+ if n2 != n {
+ err = io.ErrUnexpectedEOF
+ }
+ return err
+}
diff --git a/vendor/github.com/klauspost/compress/zstd/bytereader.go b/vendor/github.com/klauspost/compress/zstd/bytereader.go
new file mode 100644
index 00000000..0e59a242
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/bytereader.go
@@ -0,0 +1,82 @@
+// Copyright 2019+ Klaus Post. All rights reserved.
+// License information can be found in the LICENSE file.
+// Based on work by Yann Collet, released under BSD License.
+
+package zstd
+
+// byteReader provides a byte reader that reads
+// little endian values from a byte stream.
+// The input stream is manually advanced.
+// The reader performs no bounds checks.
+type byteReader struct {
+ b []byte
+ off int
+}
+
+// advance the stream b n bytes.
+func (b *byteReader) advance(n uint) {
+ b.off += int(n)
+}
+
+// overread returns whether we have advanced too far.
+func (b *byteReader) overread() bool {
+ return b.off > len(b.b)
+}
+
+// Int32 returns a little endian int32 starting at current offset.
+func (b byteReader) Int32() int32 {
+ b2 := b.b[b.off:]
+ b2 = b2[:4]
+ v3 := int32(b2[3])
+ v2 := int32(b2[2])
+ v1 := int32(b2[1])
+ v0 := int32(b2[0])
+ return v0 | (v1 << 8) | (v2 << 16) | (v3 << 24)
+}
+
+// Uint8 returns the next byte
+func (b *byteReader) Uint8() uint8 {
+ v := b.b[b.off]
+ return v
+}
+
+// Uint32 returns a little endian uint32 starting at current offset.
+func (b byteReader) Uint32() uint32 {
+ if r := b.remain(); r < 4 {
+ // Very rare
+ v := uint32(0)
+ for i := 1; i <= r; i++ {
+ v = (v << 8) | uint32(b.b[len(b.b)-i])
+ }
+ return v
+ }
+ b2 := b.b[b.off:]
+ b2 = b2[:4]
+ v3 := uint32(b2[3])
+ v2 := uint32(b2[2])
+ v1 := uint32(b2[1])
+ v0 := uint32(b2[0])
+ return v0 | (v1 << 8) | (v2 << 16) | (v3 << 24)
+}
+
+// Uint32NC returns a little endian uint32 starting at current offset.
+// The caller must be sure if there are at least 4 bytes left.
+func (b byteReader) Uint32NC() uint32 {
+ b2 := b.b[b.off:]
+ b2 = b2[:4]
+ v3 := uint32(b2[3])
+ v2 := uint32(b2[2])
+ v1 := uint32(b2[1])
+ v0 := uint32(b2[0])
+ return v0 | (v1 << 8) | (v2 << 16) | (v3 << 24)
+}
+
+// unread returns the unread portion of the input.
+func (b byteReader) unread() []byte {
+ return b.b[b.off:]
+}
+
+// remain will return the number of bytes remaining.
+func (b byteReader) remain() int {
+ return len(b.b) - b.off
+}
diff --git a/vendor/github.com/klauspost/compress/zstd/decodeheader.go b/vendor/github.com/klauspost/compress/zstd/decodeheader.go
new file mode 100644
index 00000000..6a5a2988
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/decodeheader.go
@@ -0,0 +1,261 @@
+// Copyright 2020+ Klaus Post. All rights reserved.
+// License information can be found in the LICENSE file.
+
+package zstd
+
+import (
+ "encoding/binary"
+ "errors"
+ "io"
+)
+
+// HeaderMaxSize is the maximum size of a Frame and Block Header.
+// If less is sent to Header.Decode it *may* still contain enough information.
+const HeaderMaxSize = 14 + 3
+
+// Header contains information about the first frame and block within that.
+type Header struct {
+ // SingleSegment specifies whether the data is to be decompressed into a
+ // single contiguous memory segment.
+ // It implies that WindowSize is invalid and that FrameContentSize is valid.
+ SingleSegment bool
+
+ // WindowSize is the window of data to keep while decoding.
+ // Will only be set if SingleSegment is false.
+ WindowSize uint64
+
+ // Dictionary ID.
+ // If 0, no dictionary.
+ DictionaryID uint32
+
+ // HasFCS specifies whether FrameContentSize has a valid value.
+ HasFCS bool
+
+ // FrameContentSize is the expected uncompressed size of the entire frame.
+ FrameContentSize uint64
+
+ // Skippable will be true if the frame is meant to be skipped.
+ // This implies that FirstBlock.OK is false.
+ Skippable bool
+
+ // SkippableID is the user-specific ID for the skippable frame.
+ // Valid values are between 0 to 15, inclusive.
+ SkippableID int
+
+ // SkippableSize is the length of the user data to skip following
+ // the header.
+ SkippableSize uint32
+
+ // HeaderSize is the raw size of the frame header.
+ //
+ // For normal frames, it includes the size of the magic number and
+ // the size of the header (per section 3.1.1.1).
+ // It does not include the size for any data blocks (section 3.1.1.2) nor
+ // the size for the trailing content checksum.
+ //
+ // For skippable frames, this counts the size of the magic number
+ // along with the size of the size field of the payload.
+ // It does not include the size of the skippable payload itself.
+ // The total frame size is the HeaderSize plus the SkippableSize.
+ HeaderSize int
+
+ // First block information.
+ FirstBlock struct {
+ // OK will be set if first block could be decoded.
+ OK bool
+
+ // Is this the last block of a frame?
+ Last bool
+
+ // Is the data compressed?
+ // If true CompressedSize will be populated.
+ // Unfortunately DecompressedSize cannot be determined
+ // without decoding the blocks.
+ Compressed bool
+
+ // DecompressedSize is the expected decompressed size of the block.
+ // Will be 0 if it cannot be determined.
+ DecompressedSize int
+
+ // CompressedSize of the data in the block.
+ // Does not include the block header.
+ // Will be equal to DecompressedSize if not Compressed.
+ CompressedSize int
+ }
+
+ // If set there is a checksum present for the block content.
+ // The checksum field at the end is always 4 bytes long.
+ HasCheckSum bool
+}
+
+// Decode the header from the beginning of the stream.
+// This will decode the frame header and the first block header if enough bytes are provided.
+// It is recommended to provide at least HeaderMaxSize bytes.
+// If the frame header cannot be read an error will be returned.
+// If there isn't enough input, io.ErrUnexpectedEOF is returned.
+// The FirstBlock.OK will indicate if enough information was available to decode the first block header.
+func (h *Header) Decode(in []byte) error {
+ _, err := h.DecodeAndStrip(in)
+ return err
+}
+
+// DecodeAndStrip will decode the header from the beginning of the stream
+// and on success return the remaining bytes.
+// This will decode the frame header and the first block header if enough bytes are provided.
+// It is recommended to provide at least HeaderMaxSize bytes.
+// If the frame header cannot be read an error will be returned.
+// If there isn't enough input, io.ErrUnexpectedEOF is returned.
+// The FirstBlock.OK will indicate if enough information was available to decode the first block header.
+func (h *Header) DecodeAndStrip(in []byte) (remain []byte, err error) {
+ *h = Header{}
+ if len(in) < 4 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ h.HeaderSize += 4
+ b, in := in[:4], in[4:]
+ if string(b) != frameMagic {
+ if string(b[1:4]) != skippableFrameMagic || b[0]&0xf0 != 0x50 {
+ return nil, ErrMagicMismatch
+ }
+ if len(in) < 4 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ h.HeaderSize += 4
+ h.Skippable = true
+ h.SkippableID = int(b[0] & 0xf)
+ h.SkippableSize = binary.LittleEndian.Uint32(in)
+ return in[4:], nil
+ }
+
+ // Read Window_Descriptor
+ // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#window_descriptor
+ if len(in) < 1 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ fhd, in := in[0], in[1:]
+ h.HeaderSize++
+ h.SingleSegment = fhd&(1<<5) != 0
+ h.HasCheckSum = fhd&(1<<2) != 0
+ if fhd&(1<<3) != 0 {
+ return nil, errors.New("reserved bit set on frame header")
+ }
+
+ if !h.SingleSegment {
+ if len(in) < 1 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ var wd byte
+ wd, in = in[0], in[1:]
+ h.HeaderSize++
+ windowLog := 10 + (wd >> 3)
+ windowBase := uint64(1) << windowLog
+ windowAdd := (windowBase / 8) * uint64(wd&0x7)
+ h.WindowSize = windowBase + windowAdd
+ }
+
+ // Read Dictionary_ID
+ // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#dictionary_id
+ if size := fhd & 3; size != 0 {
+ if size == 3 {
+ size = 4
+ }
+ if len(in) < int(size) {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b, in = in[:size], in[size:]
+ h.HeaderSize += int(size)
+ switch len(b) {
+ case 1:
+ h.DictionaryID = uint32(b[0])
+ case 2:
+ h.DictionaryID = uint32(b[0]) | (uint32(b[1]) << 8)
+ case 4:
+ h.DictionaryID = uint32(b[0]) | (uint32(b[1]) << 8) | (uint32(b[2]) << 16) | (uint32(b[3]) << 24)
+ }
+ }
+
+ // Read Frame_Content_Size
+ // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#frame_content_size
+ var fcsSize int
+ v := fhd >> 6
+ switch v {
+ case 0:
+ if h.SingleSegment {
+ fcsSize = 1
+ }
+ default:
+ fcsSize = 1 << v
+ }
+
+ if fcsSize > 0 {
+ h.HasFCS = true
+ if len(in) < fcsSize {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b, in = in[:fcsSize], in[fcsSize:]
+ h.HeaderSize += int(fcsSize)
+ switch len(b) {
+ case 1:
+ h.FrameContentSize = uint64(b[0])
+ case 2:
+ // When FCS_Field_Size is 2, the offset of 256 is added.
+ h.FrameContentSize = uint64(b[0]) | (uint64(b[1]) << 8) + 256
+ case 4:
+ h.FrameContentSize = uint64(b[0]) | (uint64(b[1]) << 8) | (uint64(b[2]) << 16) | (uint64(b[3]) << 24)
+ case 8:
+ d1 := uint32(b[0]) | (uint32(b[1]) << 8) | (uint32(b[2]) << 16) | (uint32(b[3]) << 24)
+ d2 := uint32(b[4]) | (uint32(b[5]) << 8) | (uint32(b[6]) << 16) | (uint32(b[7]) << 24)
+ h.FrameContentSize = uint64(d1) | (uint64(d2) << 32)
+ }
+ }
+
+ // Frame Header done, we will not fail from now on.
+ if len(in) < 3 {
+ return in, nil
+ }
+ tmp := in[:3]
+ bh := uint32(tmp[0]) | (uint32(tmp[1]) << 8) | (uint32(tmp[2]) << 16)
+ h.FirstBlock.Last = bh&1 != 0
+ blockType := blockType((bh >> 1) & 3)
+ // find size.
+ cSize := int(bh >> 3)
+ switch blockType {
+ case blockTypeReserved:
+ return in, nil
+ case blockTypeRLE:
+ h.FirstBlock.Compressed = true
+ h.FirstBlock.DecompressedSize = cSize
+ h.FirstBlock.CompressedSize = 1
+ case blockTypeCompressed:
+ h.FirstBlock.Compressed = true
+ h.FirstBlock.CompressedSize = cSize
+ case blockTypeRaw:
+ h.FirstBlock.DecompressedSize = cSize
+ h.FirstBlock.CompressedSize = cSize
+ default:
+ panic("Invalid block type")
+ }
+
+ h.FirstBlock.OK = true
+ return in, nil
+}
+
+// AppendTo will append the encoded header to the dst slice.
+// There is no error checking performed on the header values.
+func (h *Header) AppendTo(dst []byte) ([]byte, error) {
+ if h.Skippable {
+ magic := [4]byte{0x50, 0x2a, 0x4d, 0x18}
+ magic[0] |= byte(h.SkippableID & 0xf)
+ dst = append(dst, magic[:]...)
+ f := h.SkippableSize
+ return append(dst, uint8(f), uint8(f>>8), uint8(f>>16), uint8(f>>24)), nil
+ }
+ f := frameHeader{
+ ContentSize: h.FrameContentSize,
+ WindowSize: uint32(h.WindowSize),
+ SingleSegment: h.SingleSegment,
+ Checksum: h.HasCheckSum,
+ DictID: h.DictionaryID,
+ }
+ return f.appendTo(dst), nil
+}
diff --git a/vendor/github.com/klauspost/compress/zstd/decoder.go b/vendor/github.com/klauspost/compress/zstd/decoder.go
new file mode 100644
index 00000000..bbca1723
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/decoder.go
@@ -0,0 +1,948 @@
+// Copyright 2019+ Klaus Post. All rights reserved.
+// License information can be found in the LICENSE file.
+// Based on work by Yann Collet, released under BSD License.
+
+package zstd
+
+import (
+ "context"
+ "encoding/binary"
+ "io"
+ "sync"
+
+ "github.com/klauspost/compress/zstd/internal/xxhash"
+)
+
+// Decoder provides decoding of zstandard streams.
+// The decoder has been designed to operate without allocations after a warmup.
+// This means that you should store the decoder for best performance.
+// To re-use a stream decoder, use the Reset(r io.Reader) error to switch to another stream.
+// A decoder can safely be re-used even if the previous stream failed.
+// To release the resources, you must call the Close() function on a decoder.
+type Decoder struct {
+ o decoderOptions
+
+ // Unreferenced decoders, ready for use.
+ decoders chan *blockDec
+
+ // Current read position used for Reader functionality.
+ current decoderState
+
+ // sync stream decoding
+ syncStream struct {
+ decodedFrame uint64
+ br readerWrapper
+ enabled bool
+ inFrame bool
+ dstBuf []byte
+ }
+
+ frame *frameDec
+
+ // Custom dictionaries.
+ dicts map[uint32]*dict
+
+ // streamWg is the waitgroup for all streams
+ streamWg sync.WaitGroup
+}
+
+// decoderState is used for maintaining state when the decoder
+// is used for streaming.
+type decoderState struct {
+ // current block being written to stream.
+ decodeOutput
+
+ // output in order to be written to stream.
+ output chan decodeOutput
+
+ // cancel remaining output.
+ cancel context.CancelFunc
+
+ // crc of current frame
+ crc *xxhash.Digest
+
+ flushed bool
+}
+
+var (
+ // Check the interfaces we want to support.
+ _ = io.WriterTo(&Decoder{})
+ _ = io.Reader(&Decoder{})
+)
+
+// NewReader creates a new decoder.
+// A nil Reader can be provided in which case Reset can be used to start a decode.
+//
+// A Decoder can be used in two modes:
+//
+// 1) As a stream, or
+// 2) For stateless decoding using DecodeAll.
+//
+// Only a single stream can be decoded concurrently, but the same decoder
+// can run multiple concurrent stateless decodes. It is even possible to
+// use stateless decodes while a stream is being decoded.
+//
+// The Reset function can be used to initiate a new stream, which will considerably
+// reduce the allocations normally caused by NewReader.
+func NewReader(r io.Reader, opts ...DOption) (*Decoder, error) {
+ initPredefined()
+ var d Decoder
+ d.o.setDefault()
+ for _, o := range opts {
+ err := o(&d.o)
+ if err != nil {
+ return nil, err
+ }
+ }
+ d.current.crc = xxhash.New()
+ d.current.flushed = true
+
+ if r == nil {
+ d.current.err = ErrDecoderNilInput
+ }
+
+ // Transfer option dicts.
+ d.dicts = make(map[uint32]*dict, len(d.o.dicts))
+ for _, dc := range d.o.dicts {
+ d.dicts[dc.id] = dc
+ }
+ d.o.dicts = nil
+
+ // Create decoders
+ d.decoders = make(chan *blockDec, d.o.concurrent)
+ for i := 0; i < d.o.concurrent; i++ {
+ dec := newBlockDec(d.o.lowMem)
+ dec.localFrame = newFrameDec(d.o)
+ d.decoders <- dec
+ }
+
+ if r == nil {
+ return &d, nil
+ }
+ return &d, d.Reset(r)
+}
+
+// Read bytes from the decompressed stream into p.
+// Returns the number of bytes written and any error that occurred.
+// When the stream is done, io.EOF will be returned.
+func (d *Decoder) Read(p []byte) (int, error) {
+ var n int
+ for {
+ if len(d.current.b) > 0 {
+ filled := copy(p, d.current.b)
+ p = p[filled:]
+ d.current.b = d.current.b[filled:]
+ n += filled
+ }
+ if len(p) == 0 {
+ break
+ }
+ if len(d.current.b) == 0 {
+ // We have an error and no more data
+ if d.current.err != nil {
+ break
+ }
+ if !d.nextBlock(n == 0) {
+ return n, d.current.err
+ }
+ }
+ }
+ if len(d.current.b) > 0 {
+ if debugDecoder {
+ println("returning", n, "still bytes left:", len(d.current.b))
+ }
+ // Only return error at end of block
+ return n, nil
+ }
+ if d.current.err != nil {
+ d.drainOutput()
+ }
+ if debugDecoder {
+ println("returning", n, d.current.err, len(d.decoders))
+ }
+ return n, d.current.err
+}
+
+// Reset will reset the decoder the supplied stream after the current has finished processing.
+// Note that this functionality cannot be used after Close has been called.
+// Reset can be called with a nil reader to release references to the previous reader.
+// After being called with a nil reader, no other operations than Reset or DecodeAll or Close
+// should be used.
+func (d *Decoder) Reset(r io.Reader) error {
+ if d.current.err == ErrDecoderClosed {
+ return d.current.err
+ }
+
+ d.drainOutput()
+
+ d.syncStream.br.r = nil
+ if r == nil {
+ d.current.err = ErrDecoderNilInput
+ if len(d.current.b) > 0 {
+ d.current.b = d.current.b[:0]
+ }
+ d.current.flushed = true
+ return nil
+ }
+
+ // If bytes buffer and < 5MB, do sync decoding anyway.
+ if bb, ok := r.(byter); ok && bb.Len() < d.o.decodeBufsBelow && !d.o.limitToCap {
+ bb2 := bb
+ if debugDecoder {
+ println("*bytes.Buffer detected, doing sync decode, len:", bb.Len())
+ }
+ b := bb2.Bytes()
+ var dst []byte
+ if cap(d.syncStream.dstBuf) > 0 {
+ dst = d.syncStream.dstBuf[:0]
+ }
+
+ dst, err := d.DecodeAll(b, dst)
+ if err == nil {
+ err = io.EOF
+ }
+ // Save output buffer
+ d.syncStream.dstBuf = dst
+ d.current.b = dst
+ d.current.err = err
+ d.current.flushed = true
+ if debugDecoder {
+ println("sync decode to", len(dst), "bytes, err:", err)
+ }
+ return nil
+ }
+ // Remove current block.
+ d.stashDecoder()
+ d.current.decodeOutput = decodeOutput{}
+ d.current.err = nil
+ d.current.flushed = false
+ d.current.d = nil
+ d.syncStream.dstBuf = nil
+
+ // Ensure no-one else is still running...
+ d.streamWg.Wait()
+ if d.frame == nil {
+ d.frame = newFrameDec(d.o)
+ }
+
+ if d.o.concurrent == 1 {
+ return d.startSyncDecoder(r)
+ }
+
+ d.current.output = make(chan decodeOutput, d.o.concurrent)
+ ctx, cancel := context.WithCancel(context.Background())
+ d.current.cancel = cancel
+ d.streamWg.Add(1)
+ go d.startStreamDecoder(ctx, r, d.current.output)
+
+ return nil
+}
+
+// drainOutput will drain the output until errEndOfStream is sent.
+func (d *Decoder) drainOutput() {
+ if d.current.cancel != nil {
+ if debugDecoder {
+ println("cancelling current")
+ }
+ d.current.cancel()
+ d.current.cancel = nil
+ }
+ if d.current.d != nil {
+ if debugDecoder {
+ printf("re-adding current decoder %p, decoders: %d", d.current.d, len(d.decoders))
+ }
+ d.decoders <- d.current.d
+ d.current.d = nil
+ d.current.b = nil
+ }
+ if d.current.output == nil || d.current.flushed {
+ println("current already flushed")
+ return
+ }
+ for v := range d.current.output {
+ if v.d != nil {
+ if debugDecoder {
+ printf("re-adding decoder %p", v.d)
+ }
+ d.decoders <- v.d
+ }
+ }
+ d.current.output = nil
+ d.current.flushed = true
+}
+
+// WriteTo writes data to w until there's no more data to write or when an error occurs.
+// The return value n is the number of bytes written.
+// Any error encountered during the write is also returned.
+func (d *Decoder) WriteTo(w io.Writer) (int64, error) {
+ var n int64
+ for {
+ if len(d.current.b) > 0 {
+ n2, err2 := w.Write(d.current.b)
+ n += int64(n2)
+ if err2 != nil && (d.current.err == nil || d.current.err == io.EOF) {
+ d.current.err = err2
+ } else if n2 != len(d.current.b) {
+ d.current.err = io.ErrShortWrite
+ }
+ }
+ if d.current.err != nil {
+ break
+ }
+ d.nextBlock(true)
+ }
+ err := d.current.err
+ if err != nil {
+ d.drainOutput()
+ }
+ if err == io.EOF {
+ err = nil
+ }
+ return n, err
+}
+
+// DecodeAll allows stateless decoding of a blob of bytes.
+// Output will be appended to dst, so if the destination size is known
+// you can pre-allocate the destination slice to avoid allocations.
+// DecodeAll can be used concurrently.
+// The Decoder concurrency limits will be respected.
+func (d *Decoder) DecodeAll(input, dst []byte) ([]byte, error) {
+ if d.decoders == nil {
+ return dst, ErrDecoderClosed
+ }
+
+ // Grab a block decoder and frame decoder.
+ block := <-d.decoders
+ frame := block.localFrame
+ initialSize := len(dst)
+ defer func() {
+ if debugDecoder {
+ printf("re-adding decoder: %p", block)
+ }
+ frame.rawInput = nil
+ frame.bBuf = nil
+ if frame.history.decoders.br != nil {
+ frame.history.decoders.br.in = nil
+ }
+ d.decoders <- block
+ }()
+ frame.bBuf = input
+
+ for {
+ frame.history.reset()
+ err := frame.reset(&frame.bBuf)
+ if err != nil {
+ if err == io.EOF {
+ if debugDecoder {
+ println("frame reset return EOF")
+ }
+ return dst, nil
+ }
+ return dst, err
+ }
+ if err = d.setDict(frame); err != nil {
+ return nil, err
+ }
+ if frame.WindowSize > d.o.maxWindowSize {
+ if debugDecoder {
+ println("window size exceeded:", frame.WindowSize, ">", d.o.maxWindowSize)
+ }
+ return dst, ErrWindowSizeExceeded
+ }
+ if frame.FrameContentSize != fcsUnknown {
+ if frame.FrameContentSize > d.o.maxDecodedSize-uint64(len(dst)-initialSize) {
+ if debugDecoder {
+ println("decoder size exceeded; fcs:", frame.FrameContentSize, "> mcs:", d.o.maxDecodedSize-uint64(len(dst)-initialSize), "len:", len(dst))
+ }
+ return dst, ErrDecoderSizeExceeded
+ }
+ if d.o.limitToCap && frame.FrameContentSize > uint64(cap(dst)-len(dst)) {
+ if debugDecoder {
+ println("decoder size exceeded; fcs:", frame.FrameContentSize, "> (cap-len)", cap(dst)-len(dst))
+ }
+ return dst, ErrDecoderSizeExceeded
+ }
+ if cap(dst)-len(dst) < int(frame.FrameContentSize) {
+ dst2 := make([]byte, len(dst), len(dst)+int(frame.FrameContentSize)+compressedBlockOverAlloc)
+ copy(dst2, dst)
+ dst = dst2
+ }
+ }
+
+ if cap(dst) == 0 && !d.o.limitToCap {
+ // Allocate len(input) * 2 by default if nothing is provided
+ // and we didn't get frame content size.
+ size := len(input) * 2
+ // Cap to 1 MB.
+ if size > 1<<20 {
+ size = 1 << 20
+ }
+ if uint64(size) > d.o.maxDecodedSize {
+ size = int(d.o.maxDecodedSize)
+ }
+ dst = make([]byte, 0, size)
+ }
+
+ dst, err = frame.runDecoder(dst, block)
+ if err != nil {
+ return dst, err
+ }
+ if uint64(len(dst)-initialSize) > d.o.maxDecodedSize {
+ return dst, ErrDecoderSizeExceeded
+ }
+ if len(frame.bBuf) == 0 {
+ if debugDecoder {
+ println("frame dbuf empty")
+ }
+ break
+ }
+ }
+ return dst, nil
+}
+
+// nextBlock returns the next block.
+// If an error occurs d.err will be set.
+// Optionally the function can block for new output.
+// If non-blocking mode is used the returned boolean will be false
+// if no data was available without blocking.
+func (d *Decoder) nextBlock(blocking bool) (ok bool) {
+ if d.current.err != nil {
+ // Keep error state.
+ return false
+ }
+ d.current.b = d.current.b[:0]
+
+ // SYNC:
+ if d.syncStream.enabled {
+ if !blocking {
+ return false
+ }
+ ok = d.nextBlockSync()
+ if !ok {
+ d.stashDecoder()
+ }
+ return ok
+ }
+
+ //ASYNC:
+ d.stashDecoder()
+ if blocking {
+ d.current.decodeOutput, ok = <-d.current.output
+ } else {
+ select {
+ case d.current.decodeOutput, ok = <-d.current.output:
+ default:
+ return false
+ }
+ }
+ if !ok {
+ // This should not happen, so signal error state...
+ d.current.err = io.ErrUnexpectedEOF
+ return false
+ }
+ next := d.current.decodeOutput
+ if next.d != nil && next.d.async.newHist != nil {
+ d.current.crc.Reset()
+ }
+ if debugDecoder {
+ var tmp [4]byte
+ binary.LittleEndian.PutUint32(tmp[:], uint32(xxhash.Sum64(next.b)))
+ println("got", len(d.current.b), "bytes, error:", d.current.err, "data crc:", tmp)
+ }
+
+ if d.o.ignoreChecksum {
+ return true
+ }
+
+ if len(next.b) > 0 {
+ d.current.crc.Write(next.b)
+ }
+ if next.err == nil && next.d != nil && next.d.hasCRC {
+ got := uint32(d.current.crc.Sum64())
+ if got != next.d.checkCRC {
+ if debugDecoder {
+ printf("CRC Check Failed: %08x (got) != %08x (on stream)\n", got, next.d.checkCRC)
+ }
+ d.current.err = ErrCRCMismatch
+ } else {
+ if debugDecoder {
+ printf("CRC ok %08x\n", got)
+ }
+ }
+ }
+
+ return true
+}
+
+func (d *Decoder) nextBlockSync() (ok bool) {
+ if d.current.d == nil {
+ d.current.d = <-d.decoders
+ }
+ for len(d.current.b) == 0 {
+ if !d.syncStream.inFrame {
+ d.frame.history.reset()
+ d.current.err = d.frame.reset(&d.syncStream.br)
+ if d.current.err == nil {
+ d.current.err = d.setDict(d.frame)
+ }
+ if d.current.err != nil {
+ return false
+ }
+ if d.frame.WindowSize > d.o.maxDecodedSize || d.frame.WindowSize > d.o.maxWindowSize {
+ d.current.err = ErrDecoderSizeExceeded
+ return false
+ }
+
+ d.syncStream.decodedFrame = 0
+ d.syncStream.inFrame = true
+ }
+ d.current.err = d.frame.next(d.current.d)
+ if d.current.err != nil {
+ return false
+ }
+ d.frame.history.ensureBlock()
+ if debugDecoder {
+ println("History trimmed:", len(d.frame.history.b), "decoded already:", d.syncStream.decodedFrame)
+ }
+ histBefore := len(d.frame.history.b)
+ d.current.err = d.current.d.decodeBuf(&d.frame.history)
+
+ if d.current.err != nil {
+ println("error after:", d.current.err)
+ return false
+ }
+ d.current.b = d.frame.history.b[histBefore:]
+ if debugDecoder {
+ println("history after:", len(d.frame.history.b))
+ }
+
+ // Check frame size (before CRC)
+ d.syncStream.decodedFrame += uint64(len(d.current.b))
+ if d.syncStream.decodedFrame > d.frame.FrameContentSize {
+ if debugDecoder {
+ printf("DecodedFrame (%d) > FrameContentSize (%d)\n", d.syncStream.decodedFrame, d.frame.FrameContentSize)
+ }
+ d.current.err = ErrFrameSizeExceeded
+ return false
+ }
+
+ // Check FCS
+ if d.current.d.Last && d.frame.FrameContentSize != fcsUnknown && d.syncStream.decodedFrame != d.frame.FrameContentSize {
+ if debugDecoder {
+ printf("DecodedFrame (%d) != FrameContentSize (%d)\n", d.syncStream.decodedFrame, d.frame.FrameContentSize)
+ }
+ d.current.err = ErrFrameSizeMismatch
+ return false
+ }
+
+ // Update/Check CRC
+ if d.frame.HasCheckSum {
+ if !d.o.ignoreChecksum {
+ d.frame.crc.Write(d.current.b)
+ }
+ if d.current.d.Last {
+ if !d.o.ignoreChecksum {
+ d.current.err = d.frame.checkCRC()
+ } else {
+ d.current.err = d.frame.consumeCRC()
+ }
+ if d.current.err != nil {
+ println("CRC error:", d.current.err)
+ return false
+ }
+ }
+ }
+ d.syncStream.inFrame = !d.current.d.Last
+ }
+ return true
+}
+
+func (d *Decoder) stashDecoder() {
+ if d.current.d != nil {
+ if debugDecoder {
+ printf("re-adding current decoder %p", d.current.d)
+ }
+ d.decoders <- d.current.d
+ d.current.d = nil
+ }
+}
+
+// Close will release all resources.
+// It is NOT possible to reuse the decoder after this.
+func (d *Decoder) Close() {
+ if d.current.err == ErrDecoderClosed {
+ return
+ }
+ d.drainOutput()
+ if d.current.cancel != nil {
+ d.current.cancel()
+ d.streamWg.Wait()
+ d.current.cancel = nil
+ }
+ if d.decoders != nil {
+ close(d.decoders)
+ for dec := range d.decoders {
+ dec.Close()
+ }
+ d.decoders = nil
+ }
+ if d.current.d != nil {
+ d.current.d.Close()
+ d.current.d = nil
+ }
+ d.current.err = ErrDecoderClosed
+}
+
+// IOReadCloser returns the decoder as an io.ReadCloser for convenience.
+// Any changes to the decoder will be reflected, so the returned ReadCloser
+// can be reused along with the decoder.
+// io.WriterTo is also supported by the returned ReadCloser.
+func (d *Decoder) IOReadCloser() io.ReadCloser {
+ return closeWrapper{d: d}
+}
+
+// closeWrapper wraps a function call as a closer.
+type closeWrapper struct {
+ d *Decoder
+}
+
+// WriteTo forwards WriteTo calls to the decoder.
+func (c closeWrapper) WriteTo(w io.Writer) (n int64, err error) {
+ return c.d.WriteTo(w)
+}
+
+// Read forwards read calls to the decoder.
+func (c closeWrapper) Read(p []byte) (n int, err error) {
+ return c.d.Read(p)
+}
+
+// Close closes the decoder.
+func (c closeWrapper) Close() error {
+ c.d.Close()
+ return nil
+}
+
+type decodeOutput struct {
+ d *blockDec
+ b []byte
+ err error
+}
+
+func (d *Decoder) startSyncDecoder(r io.Reader) error {
+ d.frame.history.reset()
+ d.syncStream.br = readerWrapper{r: r}
+ d.syncStream.inFrame = false
+ d.syncStream.enabled = true
+ d.syncStream.decodedFrame = 0
+ return nil
+}
+
+// Create Decoder:
+// ASYNC:
+// Spawn 3 go routines.
+// 0: Read frames and decode block literals.
+// 1: Decode sequences.
+// 2: Execute sequences, send to output.
+func (d *Decoder) startStreamDecoder(ctx context.Context, r io.Reader, output chan decodeOutput) {
+ defer d.streamWg.Done()
+ br := readerWrapper{r: r}
+
+ var seqDecode = make(chan *blockDec, d.o.concurrent)
+ var seqExecute = make(chan *blockDec, d.o.concurrent)
+
+ // Async 1: Decode sequences...
+ go func() {
+ var hist history
+ var hasErr bool
+
+ for block := range seqDecode {
+ if hasErr {
+ if block != nil {
+ seqExecute <- block
+ }
+ continue
+ }
+ if block.async.newHist != nil {
+ if debugDecoder {
+ println("Async 1: new history, recent:", block.async.newHist.recentOffsets)
+ }
+ hist.reset()
+ hist.decoders = block.async.newHist.decoders
+ hist.recentOffsets = block.async.newHist.recentOffsets
+ hist.windowSize = block.async.newHist.windowSize
+ if block.async.newHist.dict != nil {
+ hist.setDict(block.async.newHist.dict)
+ }
+ }
+ if block.err != nil || block.Type != blockTypeCompressed {
+ hasErr = block.err != nil
+ seqExecute <- block
+ continue
+ }
+
+ hist.decoders.literals = block.async.literals
+ block.err = block.prepareSequences(block.async.seqData, &hist)
+ if debugDecoder && block.err != nil {
+ println("prepareSequences returned:", block.err)
+ }
+ hasErr = block.err != nil
+ if block.err == nil {
+ block.err = block.decodeSequences(&hist)
+ if debugDecoder && block.err != nil {
+ println("decodeSequences returned:", block.err)
+ }
+ hasErr = block.err != nil
+ // block.async.sequence = hist.decoders.seq[:hist.decoders.nSeqs]
+ block.async.seqSize = hist.decoders.seqSize
+ }
+ seqExecute <- block
+ }
+ close(seqExecute)
+ hist.reset()
+ }()
+
+ var wg sync.WaitGroup
+ wg.Add(1)
+
+ // Async 3: Execute sequences...
+ frameHistCache := d.frame.history.b
+ go func() {
+ var hist history
+ var decodedFrame uint64
+ var fcs uint64
+ var hasErr bool
+ for block := range seqExecute {
+ out := decodeOutput{err: block.err, d: block}
+ if block.err != nil || hasErr {
+ hasErr = true
+ output <- out
+ continue
+ }
+ if block.async.newHist != nil {
+ if debugDecoder {
+ println("Async 2: new history")
+ }
+ hist.reset()
+ hist.windowSize = block.async.newHist.windowSize
+ hist.allocFrameBuffer = block.async.newHist.allocFrameBuffer
+ if block.async.newHist.dict != nil {
+ hist.setDict(block.async.newHist.dict)
+ }
+
+ if cap(hist.b) < hist.allocFrameBuffer {
+ if cap(frameHistCache) >= hist.allocFrameBuffer {
+ hist.b = frameHistCache
+ } else {
+ hist.b = make([]byte, 0, hist.allocFrameBuffer)
+ println("Alloc history sized", hist.allocFrameBuffer)
+ }
+ }
+ hist.b = hist.b[:0]
+ fcs = block.async.fcs
+ decodedFrame = 0
+ }
+ do := decodeOutput{err: block.err, d: block}
+ switch block.Type {
+ case blockTypeRLE:
+ if debugDecoder {
+ println("add rle block length:", block.RLESize)
+ }
+
+ if cap(block.dst) < int(block.RLESize) {
+ if block.lowMem {
+ block.dst = make([]byte, block.RLESize)
+ } else {
+ block.dst = make([]byte, maxCompressedBlockSize)
+ }
+ }
+ block.dst = block.dst[:block.RLESize]
+ v := block.data[0]
+ for i := range block.dst {
+ block.dst[i] = v
+ }
+ hist.append(block.dst)
+ do.b = block.dst
+ case blockTypeRaw:
+ if debugDecoder {
+ println("add raw block length:", len(block.data))
+ }
+ hist.append(block.data)
+ do.b = block.data
+ case blockTypeCompressed:
+ if debugDecoder {
+ println("execute with history length:", len(hist.b), "window:", hist.windowSize)
+ }
+ hist.decoders.seqSize = block.async.seqSize
+ hist.decoders.literals = block.async.literals
+ do.err = block.executeSequences(&hist)
+ hasErr = do.err != nil
+ if debugDecoder && hasErr {
+ println("executeSequences returned:", do.err)
+ }
+ do.b = block.dst
+ }
+ if !hasErr {
+ decodedFrame += uint64(len(do.b))
+ if decodedFrame > fcs {
+ println("fcs exceeded", block.Last, fcs, decodedFrame)
+ do.err = ErrFrameSizeExceeded
+ hasErr = true
+ } else if block.Last && fcs != fcsUnknown && decodedFrame != fcs {
+ do.err = ErrFrameSizeMismatch
+ hasErr = true
+ } else {
+ if debugDecoder {
+ println("fcs ok", block.Last, fcs, decodedFrame)
+ }
+ }
+ }
+ output <- do
+ }
+ close(output)
+ frameHistCache = hist.b
+ wg.Done()
+ if debugDecoder {
+ println("decoder goroutines finished")
+ }
+ hist.reset()
+ }()
+
+ var hist history
+decodeStream:
+ for {
+ var hasErr bool
+ hist.reset()
+ decodeBlock := func(block *blockDec) {
+ if hasErr {
+ if block != nil {
+ seqDecode <- block
+ }
+ return
+ }
+ if block.err != nil || block.Type != blockTypeCompressed {
+ hasErr = block.err != nil
+ seqDecode <- block
+ return
+ }
+
+ remain, err := block.decodeLiterals(block.data, &hist)
+ block.err = err
+ hasErr = block.err != nil
+ if err == nil {
+ block.async.literals = hist.decoders.literals
+ block.async.seqData = remain
+ } else if debugDecoder {
+ println("decodeLiterals error:", err)
+ }
+ seqDecode <- block
+ }
+ frame := d.frame
+ if debugDecoder {
+ println("New frame...")
+ }
+ var historySent bool
+ frame.history.reset()
+ err := frame.reset(&br)
+ if debugDecoder && err != nil {
+ println("Frame decoder returned", err)
+ }
+ if err == nil {
+ err = d.setDict(frame)
+ }
+ if err == nil && d.frame.WindowSize > d.o.maxWindowSize {
+ if debugDecoder {
+ println("decoder size exceeded, fws:", d.frame.WindowSize, "> mws:", d.o.maxWindowSize)
+ }
+
+ err = ErrDecoderSizeExceeded
+ }
+ if err != nil {
+ select {
+ case <-ctx.Done():
+ case dec := <-d.decoders:
+ dec.sendErr(err)
+ decodeBlock(dec)
+ }
+ break decodeStream
+ }
+
+ // Go through all blocks of the frame.
+ for {
+ var dec *blockDec
+ select {
+ case <-ctx.Done():
+ break decodeStream
+ case dec = <-d.decoders:
+ // Once we have a decoder, we MUST return it.
+ }
+ err := frame.next(dec)
+ if !historySent {
+ h := frame.history
+ if debugDecoder {
+ println("Alloc History:", h.allocFrameBuffer)
+ }
+ hist.reset()
+ if h.dict != nil {
+ hist.setDict(h.dict)
+ }
+ dec.async.newHist = &h
+ dec.async.fcs = frame.FrameContentSize
+ historySent = true
+ } else {
+ dec.async.newHist = nil
+ }
+ if debugDecoder && err != nil {
+ println("next block returned error:", err)
+ }
+ dec.err = err
+ dec.hasCRC = false
+ if dec.Last && frame.HasCheckSum && err == nil {
+ crc, err := frame.rawInput.readSmall(4)
+ if len(crc) < 4 {
+ if err == nil {
+ err = io.ErrUnexpectedEOF
+
+ }
+ println("CRC missing?", err)
+ dec.err = err
+ } else {
+ dec.checkCRC = binary.LittleEndian.Uint32(crc)
+ dec.hasCRC = true
+ if debugDecoder {
+ printf("found crc to check: %08x\n", dec.checkCRC)
+ }
+ }
+ }
+ err = dec.err
+ last := dec.Last
+ decodeBlock(dec)
+ if err != nil {
+ break decodeStream
+ }
+ if last {
+ break
+ }
+ }
+ }
+ close(seqDecode)
+ wg.Wait()
+ hist.reset()
+ d.frame.history.b = frameHistCache
+}
+
+func (d *Decoder) setDict(frame *frameDec) (err error) {
+ dict, ok := d.dicts[frame.DictionaryID]
+ if ok {
+ if debugDecoder {
+ println("setting dict", frame.DictionaryID)
+ }
+ frame.history.setDict(dict)
+ } else if frame.DictionaryID != 0 {
+ // A zero or missing dictionary id is ambiguous:
+ // either dictionary zero, or no dictionary. In particular,
+ // zstd --patch-from uses this id for the source file,
+ // so only return an error if the dictionary id is not zero.
+ err = ErrUnknownDictionary
+ }
+ return err
+}
diff --git a/vendor/github.com/klauspost/compress/zstd/decoder_options.go b/vendor/github.com/klauspost/compress/zstd/decoder_options.go
new file mode 100644
index 00000000..774c5f00
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/decoder_options.go
@@ -0,0 +1,169 @@
+// Copyright 2019+ Klaus Post. All rights reserved.
+// License information can be found in the LICENSE file.
+// Based on work by Yann Collet, released under BSD License.
+
+package zstd
+
+import (
+ "errors"
+ "fmt"
+ "math/bits"
+ "runtime"
+)
+
+// DOption is an option for creating a decoder.
+type DOption func(*decoderOptions) error
+
+// options retains accumulated state of multiple options.
+type decoderOptions struct {
+ lowMem bool
+ concurrent int
+ maxDecodedSize uint64
+ maxWindowSize uint64
+ dicts []*dict
+ ignoreChecksum bool
+ limitToCap bool
+ decodeBufsBelow int
+}
+
+func (o *decoderOptions) setDefault() {
+ *o = decoderOptions{
+ // use less ram: true for now, but may change.
+ lowMem: true,
+ concurrent: runtime.GOMAXPROCS(0),
+ maxWindowSize: MaxWindowSize,
+ decodeBufsBelow: 128 << 10,
+ }
+ if o.concurrent > 4 {
+ o.concurrent = 4
+ }
+ o.maxDecodedSize = 64 << 30
+}
+
+// WithDecoderLowmem will set whether to use a lower amount of memory,
+// but possibly have to allocate more while running.
+func WithDecoderLowmem(b bool) DOption {
+ return func(o *decoderOptions) error { o.lowMem = b; return nil }
+}
+
+// WithDecoderConcurrency sets the number of created decoders.
+// When decoding block with DecodeAll, this will limit the number
+// of possible concurrently running decodes.
+// When decoding streams, this will limit the number of
+// inflight blocks.
+// When decoding streams and setting maximum to 1,
+// no async decoding will be done.
+// When a value of 0 is provided GOMAXPROCS will be used.
+// By default this will be set to 4 or GOMAXPROCS, whatever is lower.
+func WithDecoderConcurrency(n int) DOption {
+ return func(o *decoderOptions) error {
+ if n < 0 {
+ return errors.New("concurrency must be at least 1")
+ }
+ if n == 0 {
+ o.concurrent = runtime.GOMAXPROCS(0)
+ } else {
+ o.concurrent = n
+ }
+ return nil
+ }
+}
+
+// WithDecoderMaxMemory allows to set a maximum decoded size for in-memory
+// non-streaming operations or maximum window size for streaming operations.
+// This can be used to control memory usage of potentially hostile content.
+// Maximum is 1 << 63 bytes. Default is 64GiB.
+func WithDecoderMaxMemory(n uint64) DOption {
+ return func(o *decoderOptions) error {
+ if n == 0 {
+ return errors.New("WithDecoderMaxMemory must be at least 1")
+ }
+ if n > 1<<63 {
+ return errors.New("WithDecoderMaxmemory must be less than 1 << 63")
+ }
+ o.maxDecodedSize = n
+ return nil
+ }
+}
+
+// WithDecoderDicts allows to register one or more dictionaries for the decoder.
+//
+// Each slice in dict must be in the [dictionary format] produced by
+// "zstd --train" from the Zstandard reference implementation.
+//
+// If several dictionaries with the same ID are provided, the last one will be used.
+//
+// [dictionary format]: https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#dictionary-format
+func WithDecoderDicts(dicts ...[]byte) DOption {
+ return func(o *decoderOptions) error {
+ for _, b := range dicts {
+ d, err := loadDict(b)
+ if err != nil {
+ return err
+ }
+ o.dicts = append(o.dicts, d)
+ }
+ return nil
+ }
+}
+
+// WithDecoderDictRaw registers a dictionary that may be used by the decoder.
+// The slice content can be arbitrary data.
+func WithDecoderDictRaw(id uint32, content []byte) DOption {
+ return func(o *decoderOptions) error {
+ if bits.UintSize > 32 && uint(len(content)) > dictMaxLength {
+ return fmt.Errorf("dictionary of size %d > 2GiB too large", len(content))
+ }
+ o.dicts = append(o.dicts, &dict{id: id, content: content, offsets: [3]int{1, 4, 8}})
+ return nil
+ }
+}
+
+// WithDecoderMaxWindow allows to set a maximum window size for decodes.
+// This allows rejecting packets that will cause big memory usage.
+// The Decoder will likely allocate more memory based on the WithDecoderLowmem setting.
+// If WithDecoderMaxMemory is set to a lower value, that will be used.
+// Default is 512MB, Maximum is ~3.75 TB as per zstandard spec.
+func WithDecoderMaxWindow(size uint64) DOption {
+ return func(o *decoderOptions) error {
+ if size < MinWindowSize {
+ return errors.New("WithMaxWindowSize must be at least 1KB, 1024 bytes")
+ }
+ if size > (1<<41)+7*(1<<38) {
+ return errors.New("WithMaxWindowSize must be less than (1<<41) + 7*(1<<38) ~ 3.75TB")
+ }
+ o.maxWindowSize = size
+ return nil
+ }
+}
+
+// WithDecodeAllCapLimit will limit DecodeAll to decoding cap(dst)-len(dst) bytes,
+// or any size set in WithDecoderMaxMemory.
+// This can be used to limit decoding to a specific maximum output size.
+// Disabled by default.
+func WithDecodeAllCapLimit(b bool) DOption {
+ return func(o *decoderOptions) error {
+ o.limitToCap = b
+ return nil
+ }
+}
+
+// WithDecodeBuffersBelow will fully decode readers that have a
+// `Bytes() []byte` and `Len() int` interface similar to bytes.Buffer.
+// This typically uses less allocations but will have the full decompressed object in memory.
+// Note that DecodeAllCapLimit will disable this, as well as giving a size of 0 or less.
+// Default is 128KiB.
+func WithDecodeBuffersBelow(size int) DOption {
+ return func(o *decoderOptions) error {
+ o.decodeBufsBelow = size
+ return nil
+ }
+}
+
+// IgnoreChecksum allows to forcibly ignore checksum checking.
+func IgnoreChecksum(b bool) DOption {
+ return func(o *decoderOptions) error {
+ o.ignoreChecksum = b
+ return nil
+ }
+}
diff --git a/vendor/github.com/klauspost/compress/zstd/dict.go b/vendor/github.com/klauspost/compress/zstd/dict.go
new file mode 100644
index 00000000..b7b83164
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/dict.go
@@ -0,0 +1,565 @@
+package zstd
+
+import (
+ "bytes"
+ "encoding/binary"
+ "errors"
+ "fmt"
+ "io"
+ "math"
+ "sort"
+
+ "github.com/klauspost/compress/huff0"
+)
+
+type dict struct {
+ id uint32
+
+ litEnc *huff0.Scratch
+ llDec, ofDec, mlDec sequenceDec
+ offsets [3]int
+ content []byte
+}
+
+const dictMagic = "\x37\xa4\x30\xec"
+
+// Maximum dictionary size for the reference implementation (1.5.3) is 2 GiB.
+const dictMaxLength = 1 << 31
+
+// ID returns the dictionary id or 0 if d is nil.
+func (d *dict) ID() uint32 {
+ if d == nil {
+ return 0
+ }
+ return d.id
+}
+
+// ContentSize returns the dictionary content size or 0 if d is nil.
+func (d *dict) ContentSize() int {
+ if d == nil {
+ return 0
+ }
+ return len(d.content)
+}
+
+// Content returns the dictionary content.
+func (d *dict) Content() []byte {
+ if d == nil {
+ return nil
+ }
+ return d.content
+}
+
+// Offsets returns the initial offsets.
+func (d *dict) Offsets() [3]int {
+ if d == nil {
+ return [3]int{}
+ }
+ return d.offsets
+}
+
+// LitEncoder returns the literal encoder.
+func (d *dict) LitEncoder() *huff0.Scratch {
+ if d == nil {
+ return nil
+ }
+ return d.litEnc
+}
+
+// Load a dictionary as described in
+// https://github.com/facebook/zstd/blob/master/doc/zstd_compression_format.md#dictionary-format
+func loadDict(b []byte) (*dict, error) {
+ // Check static field size.
+ if len(b) <= 8+(3*4) {
+ return nil, io.ErrUnexpectedEOF
+ }
+ d := dict{
+ llDec: sequenceDec{fse: &fseDecoder{}},
+ ofDec: sequenceDec{fse: &fseDecoder{}},
+ mlDec: sequenceDec{fse: &fseDecoder{}},
+ }
+ if string(b[:4]) != dictMagic {
+ return nil, ErrMagicMismatch
+ }
+ d.id = binary.LittleEndian.Uint32(b[4:8])
+ if d.id == 0 {
+ return nil, errors.New("dictionaries cannot have ID 0")
+ }
+
+ // Read literal table
+ var err error
+ d.litEnc, b, err = huff0.ReadTable(b[8:], nil)
+ if err != nil {
+ return nil, fmt.Errorf("loading literal table: %w", err)
+ }
+ d.litEnc.Reuse = huff0.ReusePolicyMust
+
+ br := byteReader{
+ b: b,
+ off: 0,
+ }
+ readDec := func(i tableIndex, dec *fseDecoder) error {
+ if err := dec.readNCount(&br, uint16(maxTableSymbol[i])); err != nil {
+ return err
+ }
+ if br.overread() {
+ return io.ErrUnexpectedEOF
+ }
+ err = dec.transform(symbolTableX[i])
+ if err != nil {
+ println("Transform table error:", err)
+ return err
+ }
+ if debugDecoder || debugEncoder {
+ println("Read table ok", "symbolLen:", dec.symbolLen)
+ }
+ // Set decoders as predefined so they aren't reused.
+ dec.preDefined = true
+ return nil
+ }
+
+ if err := readDec(tableOffsets, d.ofDec.fse); err != nil {
+ return nil, err
+ }
+ if err := readDec(tableMatchLengths, d.mlDec.fse); err != nil {
+ return nil, err
+ }
+ if err := readDec(tableLiteralLengths, d.llDec.fse); err != nil {
+ return nil, err
+ }
+ if br.remain() < 12 {
+ return nil, io.ErrUnexpectedEOF
+ }
+
+ d.offsets[0] = int(br.Uint32())
+ br.advance(4)
+ d.offsets[1] = int(br.Uint32())
+ br.advance(4)
+ d.offsets[2] = int(br.Uint32())
+ br.advance(4)
+ if d.offsets[0] <= 0 || d.offsets[1] <= 0 || d.offsets[2] <= 0 {
+ return nil, errors.New("invalid offset in dictionary")
+ }
+ d.content = make([]byte, br.remain())
+ copy(d.content, br.unread())
+ if d.offsets[0] > len(d.content) || d.offsets[1] > len(d.content) || d.offsets[2] > len(d.content) {
+ return nil, fmt.Errorf("initial offset bigger than dictionary content size %d, offsets: %v", len(d.content), d.offsets)
+ }
+
+ return &d, nil
+}
+
+// InspectDictionary loads a zstd dictionary and provides functions to inspect the content.
+func InspectDictionary(b []byte) (interface {
+ ID() uint32
+ ContentSize() int
+ Content() []byte
+ Offsets() [3]int
+ LitEncoder() *huff0.Scratch
+}, error) {
+ initPredefined()
+ d, err := loadDict(b)
+ return d, err
+}
+
+type BuildDictOptions struct {
+ // Dictionary ID.
+ ID uint32
+
+ // Content to use to create dictionary tables.
+ Contents [][]byte
+
+ // History to use for all blocks.
+ History []byte
+
+ // Offsets to use.
+ Offsets [3]int
+
+ // CompatV155 will make the dictionary compatible with Zstd v1.5.5 and earlier.
+ // See https://github.com/facebook/zstd/issues/3724
+ CompatV155 bool
+
+ // Use the specified encoder level.
+ // The dictionary will be built using the specified encoder level,
+ // which will reflect speed and make the dictionary tailored for that level.
+ // If not set SpeedBestCompression will be used.
+ Level EncoderLevel
+
+ // DebugOut will write stats and other details here if set.
+ DebugOut io.Writer
+}
+
+func BuildDict(o BuildDictOptions) ([]byte, error) {
+ initPredefined()
+ hist := o.History
+ contents := o.Contents
+ debug := o.DebugOut != nil
+ println := func(args ...interface{}) {
+ if o.DebugOut != nil {
+ fmt.Fprintln(o.DebugOut, args...)
+ }
+ }
+ printf := func(s string, args ...interface{}) {
+ if o.DebugOut != nil {
+ fmt.Fprintf(o.DebugOut, s, args...)
+ }
+ }
+ print := func(args ...interface{}) {
+ if o.DebugOut != nil {
+ fmt.Fprint(o.DebugOut, args...)
+ }
+ }
+
+ if int64(len(hist)) > dictMaxLength {
+ return nil, fmt.Errorf("dictionary of size %d > %d", len(hist), int64(dictMaxLength))
+ }
+ if len(hist) < 8 {
+ return nil, fmt.Errorf("dictionary of size %d < %d", len(hist), 8)
+ }
+ if len(contents) == 0 {
+ return nil, errors.New("no content provided")
+ }
+ d := dict{
+ id: o.ID,
+ litEnc: nil,
+ llDec: sequenceDec{},
+ ofDec: sequenceDec{},
+ mlDec: sequenceDec{},
+ offsets: o.Offsets,
+ content: hist,
+ }
+ block := blockEnc{lowMem: false}
+ block.init()
+ enc := encoder(&bestFastEncoder{fastBase: fastBase{maxMatchOff: int32(maxMatchLen), bufferReset: math.MaxInt32 - int32(maxMatchLen*2), lowMem: false}})
+ if o.Level != 0 {
+ eOpts := encoderOptions{
+ level: o.Level,
+ blockSize: maxMatchLen,
+ windowSize: maxMatchLen,
+ dict: &d,
+ lowMem: false,
+ }
+ enc = eOpts.encoder()
+ } else {
+ o.Level = SpeedBestCompression
+ }
+ var (
+ remain [256]int
+ ll [256]int
+ ml [256]int
+ of [256]int
+ )
+ addValues := func(dst *[256]int, src []byte) {
+ for _, v := range src {
+ dst[v]++
+ }
+ }
+ addHist := func(dst *[256]int, src *[256]uint32) {
+ for i, v := range src {
+ dst[i] += int(v)
+ }
+ }
+ seqs := 0
+ nUsed := 0
+ litTotal := 0
+ newOffsets := make(map[uint32]int, 1000)
+ for _, b := range contents {
+ block.reset(nil)
+ if len(b) < 8 {
+ continue
+ }
+ nUsed++
+ enc.Reset(&d, true)
+ enc.Encode(&block, b)
+ addValues(&remain, block.literals)
+ litTotal += len(block.literals)
+ if len(block.sequences) == 0 {
+ continue
+ }
+ seqs += len(block.sequences)
+ block.genCodes()
+ addHist(&ll, block.coders.llEnc.Histogram())
+ addHist(&ml, block.coders.mlEnc.Histogram())
+ addHist(&of, block.coders.ofEnc.Histogram())
+ for i, seq := range block.sequences {
+ if i > 3 {
+ break
+ }
+ offset := seq.offset
+ if offset == 0 {
+ continue
+ }
+ if int(offset) >= len(o.History) {
+ continue
+ }
+ if offset > 3 {
+ newOffsets[offset-3]++
+ } else {
+ newOffsets[uint32(o.Offsets[offset-1])]++
+ }
+ }
+ }
+ // Find most used offsets.
+ var sortedOffsets []uint32
+ for k := range newOffsets {
+ sortedOffsets = append(sortedOffsets, k)
+ }
+ sort.Slice(sortedOffsets, func(i, j int) bool {
+ a, b := sortedOffsets[i], sortedOffsets[j]
+ if a == b {
+ // Prefer the longer offset
+ return sortedOffsets[i] > sortedOffsets[j]
+ }
+ return newOffsets[sortedOffsets[i]] > newOffsets[sortedOffsets[j]]
+ })
+ if len(sortedOffsets) > 3 {
+ if debug {
+ print("Offsets:")
+ for i, v := range sortedOffsets {
+ if i > 20 {
+ break
+ }
+ printf("[%d: %d],", v, newOffsets[v])
+ }
+ println("")
+ }
+
+ sortedOffsets = sortedOffsets[:3]
+ }
+ for i, v := range sortedOffsets {
+ o.Offsets[i] = int(v)
+ }
+ if debug {
+ println("New repeat offsets", o.Offsets)
+ }
+
+ if nUsed == 0 || seqs == 0 {
+ return nil, fmt.Errorf("%d blocks, %d sequences found", nUsed, seqs)
+ }
+ if debug {
+ println("Sequences:", seqs, "Blocks:", nUsed, "Literals:", litTotal)
+ }
+ if seqs/nUsed < 512 {
+ // Use 512 as minimum.
+ nUsed = seqs / 512
+ if nUsed == 0 {
+ nUsed = 1
+ }
+ }
+ copyHist := func(dst *fseEncoder, src *[256]int) ([]byte, error) {
+ hist := dst.Histogram()
+ var maxSym uint8
+ var maxCount int
+ var fakeLength int
+ for i, v := range src {
+ if v > 0 {
+ v = v / nUsed
+ if v == 0 {
+ v = 1
+ }
+ }
+ if v > maxCount {
+ maxCount = v
+ }
+ if v != 0 {
+ maxSym = uint8(i)
+ }
+ fakeLength += v
+ hist[i] = uint32(v)
+ }
+
+ // Ensure we aren't trying to represent RLE.
+ if maxCount == fakeLength {
+ for i := range hist {
+ if uint8(i) == maxSym {
+ fakeLength++
+ maxSym++
+ hist[i+1] = 1
+ if maxSym > 1 {
+ break
+ }
+ }
+ if hist[0] == 0 {
+ fakeLength++
+ hist[i] = 1
+ if maxSym > 1 {
+ break
+ }
+ }
+ }
+ }
+
+ dst.HistogramFinished(maxSym, maxCount)
+ dst.reUsed = false
+ dst.useRLE = false
+ err := dst.normalizeCount(fakeLength)
+ if err != nil {
+ return nil, err
+ }
+ if debug {
+ println("RAW:", dst.count[:maxSym+1], "NORM:", dst.norm[:maxSym+1], "LEN:", fakeLength)
+ }
+ return dst.writeCount(nil)
+ }
+ if debug {
+ print("Literal lengths: ")
+ }
+ llTable, err := copyHist(block.coders.llEnc, &ll)
+ if err != nil {
+ return nil, err
+ }
+ if debug {
+ print("Match lengths: ")
+ }
+ mlTable, err := copyHist(block.coders.mlEnc, &ml)
+ if err != nil {
+ return nil, err
+ }
+ if debug {
+ print("Offsets: ")
+ }
+ ofTable, err := copyHist(block.coders.ofEnc, &of)
+ if err != nil {
+ return nil, err
+ }
+
+ // Literal table
+ avgSize := litTotal
+ if avgSize > huff0.BlockSizeMax/2 {
+ avgSize = huff0.BlockSizeMax / 2
+ }
+ huffBuff := make([]byte, 0, avgSize)
+ // Target size
+ div := litTotal / avgSize
+ if div < 1 {
+ div = 1
+ }
+ if debug {
+ println("Huffman weights:")
+ }
+ for i, n := range remain[:] {
+ if n > 0 {
+ n = n / div
+ // Allow all entries to be represented.
+ if n == 0 {
+ n = 1
+ }
+ huffBuff = append(huffBuff, bytes.Repeat([]byte{byte(i)}, n)...)
+ if debug {
+ printf("[%d: %d], ", i, n)
+ }
+ }
+ }
+ if o.CompatV155 && remain[255]/div == 0 {
+ huffBuff = append(huffBuff, 255)
+ }
+ scratch := &huff0.Scratch{TableLog: 11}
+ for tries := 0; tries < 255; tries++ {
+ scratch = &huff0.Scratch{TableLog: 11}
+ _, _, err = huff0.Compress1X(huffBuff, scratch)
+ if err == nil {
+ break
+ }
+ if debug {
+ printf("Try %d: Huffman error: %v\n", tries+1, err)
+ }
+ huffBuff = huffBuff[:0]
+ if tries == 250 {
+ if debug {
+ println("Huffman: Bailing out with predefined table")
+ }
+
+ // Bail out.... Just generate something
+ huffBuff = append(huffBuff, bytes.Repeat([]byte{255}, 10000)...)
+ for i := 0; i < 128; i++ {
+ huffBuff = append(huffBuff, byte(i))
+ }
+ continue
+ }
+ if errors.Is(err, huff0.ErrIncompressible) {
+ // Try truncating least common.
+ for i, n := range remain[:] {
+ if n > 0 {
+ n = n / (div * (i + 1))
+ if n > 0 {
+ huffBuff = append(huffBuff, bytes.Repeat([]byte{byte(i)}, n)...)
+ }
+ }
+ }
+ if o.CompatV155 && len(huffBuff) > 0 && huffBuff[len(huffBuff)-1] != 255 {
+ huffBuff = append(huffBuff, 255)
+ }
+ if len(huffBuff) == 0 {
+ huffBuff = append(huffBuff, 0, 255)
+ }
+ }
+ if errors.Is(err, huff0.ErrUseRLE) {
+ for i, n := range remain[:] {
+ n = n / (div * (i + 1))
+ // Allow all entries to be represented.
+ if n == 0 {
+ n = 1
+ }
+ huffBuff = append(huffBuff, bytes.Repeat([]byte{byte(i)}, n)...)
+ }
+ }
+ }
+
+ var out bytes.Buffer
+ out.Write([]byte(dictMagic))
+ out.Write(binary.LittleEndian.AppendUint32(nil, o.ID))
+ out.Write(scratch.OutTable)
+ if debug {
+ println("huff table:", len(scratch.OutTable), "bytes")
+ println("of table:", len(ofTable), "bytes")
+ println("ml table:", len(mlTable), "bytes")
+ println("ll table:", len(llTable), "bytes")
+ }
+ out.Write(ofTable)
+ out.Write(mlTable)
+ out.Write(llTable)
+ out.Write(binary.LittleEndian.AppendUint32(nil, uint32(o.Offsets[0])))
+ out.Write(binary.LittleEndian.AppendUint32(nil, uint32(o.Offsets[1])))
+ out.Write(binary.LittleEndian.AppendUint32(nil, uint32(o.Offsets[2])))
+ out.Write(hist)
+ if debug {
+ _, err := loadDict(out.Bytes())
+ if err != nil {
+ panic(err)
+ }
+ i, err := InspectDictionary(out.Bytes())
+ if err != nil {
+ panic(err)
+ }
+ println("ID:", i.ID())
+ println("Content size:", i.ContentSize())
+ println("Encoder:", i.LitEncoder() != nil)
+ println("Offsets:", i.Offsets())
+ var totalSize int
+ for _, b := range contents {
+ totalSize += len(b)
+ }
+
+ encWith := func(opts ...EOption) int {
+ enc, err := NewWriter(nil, opts...)
+ if err != nil {
+ panic(err)
+ }
+ defer enc.Close()
+ var dst []byte
+ var totalSize int
+ for _, b := range contents {
+ dst = enc.EncodeAll(b, dst[:0])
+ totalSize += len(dst)
+ }
+ return totalSize
+ }
+ plain := encWith(WithEncoderLevel(o.Level))
+ withDict := encWith(WithEncoderLevel(o.Level), WithEncoderDict(out.Bytes()))
+ println("Input size:", totalSize)
+ println("Plain Compressed:", plain)
+ println("Dict Compressed:", withDict)
+ println("Saved:", plain-withDict, (plain-withDict)/len(contents), "bytes per input (rounded down)")
+ }
+ return out.Bytes(), nil
+}
diff --git a/vendor/github.com/klauspost/compress/zstd/enc_base.go b/vendor/github.com/klauspost/compress/zstd/enc_base.go
new file mode 100644
index 00000000..5ca46038
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/enc_base.go
@@ -0,0 +1,173 @@
+package zstd
+
+import (
+ "fmt"
+ "math/bits"
+
+ "github.com/klauspost/compress/zstd/internal/xxhash"
+)
+
+const (
+ dictShardBits = 6
+)
+
+type fastBase struct {
+ // cur is the offset at the start of hist
+ cur int32
+ // maximum offset. Should be at least 2x block size.
+ maxMatchOff int32
+ bufferReset int32
+ hist []byte
+ crc *xxhash.Digest
+ tmp [8]byte
+ blk *blockEnc
+ lastDictID uint32
+ lowMem bool
+}
+
+// CRC returns the underlying CRC writer.
+func (e *fastBase) CRC() *xxhash.Digest {
+ return e.crc
+}
+
+// AppendCRC will append the CRC to the destination slice and return it.
+func (e *fastBase) AppendCRC(dst []byte) []byte {
+ crc := e.crc.Sum(e.tmp[:0])
+ dst = append(dst, crc[7], crc[6], crc[5], crc[4])
+ return dst
+}
+
+// WindowSize returns the window size of the encoder,
+// or a window size small enough to contain the input size, if > 0.
+func (e *fastBase) WindowSize(size int64) int32 {
+ if size > 0 && size < int64(e.maxMatchOff) {
+ b := int32(1) << uint(bits.Len(uint(size)))
+ // Keep minimum window.
+ if b < 1024 {
+ b = 1024
+ }
+ return b
+ }
+ return e.maxMatchOff
+}
+
+// Block returns the current block.
+func (e *fastBase) Block() *blockEnc {
+ return e.blk
+}
+
+func (e *fastBase) addBlock(src []byte) int32 {
+ if debugAsserts && e.cur > e.bufferReset {
+ panic(fmt.Sprintf("ecur (%d) > buffer reset (%d)", e.cur, e.bufferReset))
+ }
+ // check if we have space already
+ if len(e.hist)+len(src) > cap(e.hist) {
+ if cap(e.hist) == 0 {
+ e.ensureHist(len(src))
+ } else {
+ if cap(e.hist) < int(e.maxMatchOff+maxCompressedBlockSize) {
+ panic(fmt.Errorf("unexpected buffer cap %d, want at least %d with window %d", cap(e.hist), e.maxMatchOff+maxCompressedBlockSize, e.maxMatchOff))
+ }
+ // Move down
+ offset := int32(len(e.hist)) - e.maxMatchOff
+ copy(e.hist[0:e.maxMatchOff], e.hist[offset:])
+ e.cur += offset
+ e.hist = e.hist[:e.maxMatchOff]
+ }
+ }
+ s := int32(len(e.hist))
+ e.hist = append(e.hist, src...)
+ return s
+}
+
+// ensureHist will ensure that history can keep at least this many bytes.
+func (e *fastBase) ensureHist(n int) {
+ if cap(e.hist) >= n {
+ return
+ }
+ l := e.maxMatchOff
+ if (e.lowMem && e.maxMatchOff > maxCompressedBlockSize) || e.maxMatchOff <= maxCompressedBlockSize {
+ l += maxCompressedBlockSize
+ } else {
+ l += e.maxMatchOff
+ }
+ // Make it at least 1MB.
+ if l < 1<<20 && !e.lowMem {
+ l = 1 << 20
+ }
+ // Make it at least the requested size.
+ if l < int32(n) {
+ l = int32(n)
+ }
+ e.hist = make([]byte, 0, l)
+}
+
+// useBlock will replace the block with the provided one,
+// but transfer recent offsets from the previous.
+func (e *fastBase) UseBlock(enc *blockEnc) {
+ enc.reset(e.blk)
+ e.blk = enc
+}
+
+func (e *fastBase) matchlen(s, t int32, src []byte) int32 {
+ if debugAsserts {
+ if s < 0 {
+ err := fmt.Sprintf("s (%d) < 0", s)
+ panic(err)
+ }
+ if t < 0 {
+ err := fmt.Sprintf("s (%d) < 0", s)
+ panic(err)
+ }
+ if s-t > e.maxMatchOff {
+ err := fmt.Sprintf("s (%d) - t (%d) > maxMatchOff (%d)", s, t, e.maxMatchOff)
+ panic(err)
+ }
+ if len(src)-int(s) > maxCompressedBlockSize {
+ panic(fmt.Sprintf("len(src)-s (%d) > maxCompressedBlockSize (%d)", len(src)-int(s), maxCompressedBlockSize))
+ }
+ }
+ return int32(matchLen(src[s:], src[t:]))
+}
+
+// Reset the encoding table.
+func (e *fastBase) resetBase(d *dict, singleBlock bool) {
+ if e.blk == nil {
+ e.blk = &blockEnc{lowMem: e.lowMem}
+ e.blk.init()
+ } else {
+ e.blk.reset(nil)
+ }
+ e.blk.initNewEncode()
+ if e.crc == nil {
+ e.crc = xxhash.New()
+ } else {
+ e.crc.Reset()
+ }
+ e.blk.dictLitEnc = nil
+ if d != nil {
+ low := e.lowMem
+ if singleBlock {
+ e.lowMem = true
+ }
+ e.ensureHist(d.ContentSize() + maxCompressedBlockSize)
+ e.lowMem = low
+ }
+
+ // We offset current position so everything will be out of reach.
+ // If above reset line, history will be purged.
+ if e.cur < e.bufferReset {
+ e.cur += e.maxMatchOff + int32(len(e.hist))
+ }
+ e.hist = e.hist[:0]
+ if d != nil {
+ // Set offsets (currently not used)
+ for i, off := range d.offsets {
+ e.blk.recentOffsets[i] = uint32(off)
+ e.blk.prevRecentOffsets[i] = e.blk.recentOffsets[i]
+ }
+ // Transfer litenc.
+ e.blk.dictLitEnc = d.litEnc
+ e.hist = append(e.hist, d.content...)
+ }
+}
diff --git a/vendor/github.com/klauspost/compress/zstd/enc_best.go b/vendor/github.com/klauspost/compress/zstd/enc_best.go
new file mode 100644
index 00000000..4613724e
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/enc_best.go
@@ -0,0 +1,560 @@
+// Copyright 2019+ Klaus Post. All rights reserved.
+// License information can be found in the LICENSE file.
+// Based on work by Yann Collet, released under BSD License.
+
+package zstd
+
+import (
+ "bytes"
+ "fmt"
+
+ "github.com/klauspost/compress"
+)
+
+const (
+ bestLongTableBits = 22 // Bits used in the long match table
+ bestLongTableSize = 1 << bestLongTableBits // Size of the table
+ bestLongLen = 8 // Bytes used for table hash
+
+ // Note: Increasing the short table bits or making the hash shorter
+ // can actually lead to compression degradation since it will 'steal' more from the
+ // long match table and match offsets are quite big.
+ // This greatly depends on the type of input.
+ bestShortTableBits = 18 // Bits used in the short match table
+ bestShortTableSize = 1 << bestShortTableBits // Size of the table
+ bestShortLen = 4 // Bytes used for table hash
+
+)
+
+type match struct {
+ offset int32
+ s int32
+ length int32
+ rep int32
+ est int32
+}
+
+const highScore = maxMatchLen * 8
+
+// estBits will estimate output bits from predefined tables.
+func (m *match) estBits(bitsPerByte int32) {
+ mlc := mlCode(uint32(m.length - zstdMinMatch))
+ var ofc uint8
+ if m.rep < 0 {
+ ofc = ofCode(uint32(m.s-m.offset) + 3)
+ } else {
+ ofc = ofCode(uint32(m.rep) & 3)
+ }
+ // Cost, excluding
+ ofTT, mlTT := fsePredefEnc[tableOffsets].ct.symbolTT[ofc], fsePredefEnc[tableMatchLengths].ct.symbolTT[mlc]
+
+ // Add cost of match encoding...
+ m.est = int32(ofTT.outBits + mlTT.outBits)
+ m.est += int32(ofTT.deltaNbBits>>16 + mlTT.deltaNbBits>>16)
+ // Subtract savings compared to literal encoding...
+ m.est -= (m.length * bitsPerByte) >> 10
+ if m.est > 0 {
+ // Unlikely gain..
+ m.length = 0
+ m.est = highScore
+ }
+}
+
+// bestFastEncoder uses 2 tables, one for short matches (5 bytes) and one for long matches.
+// The long match table contains the previous entry with the same hash,
+// effectively making it a "chain" of length 2.
+// When we find a long match we choose between the two values and select the longest.
+// When we find a short match, after checking the long, we check if we can find a long at n+1
+// and that it is longer (lazy matching).
+type bestFastEncoder struct {
+ fastBase
+ table [bestShortTableSize]prevEntry
+ longTable [bestLongTableSize]prevEntry
+ dictTable []prevEntry
+ dictLongTable []prevEntry
+}
+
+// Encode improves compression...
+func (e *bestFastEncoder) Encode(blk *blockEnc, src []byte) {
+ const (
+ // Input margin is the number of bytes we read (8)
+ // and the maximum we will read ahead (2)
+ inputMargin = 8 + 4
+ minNonLiteralBlockSize = 16
+ )
+
+ // Protect against e.cur wraparound.
+ for e.cur >= e.bufferReset-int32(len(e.hist)) {
+ if len(e.hist) == 0 {
+ e.table = [bestShortTableSize]prevEntry{}
+ e.longTable = [bestLongTableSize]prevEntry{}
+ e.cur = e.maxMatchOff
+ break
+ }
+ // Shift down everything in the table that isn't already too far away.
+ minOff := e.cur + int32(len(e.hist)) - e.maxMatchOff
+ for i := range e.table[:] {
+ v := e.table[i].offset
+ v2 := e.table[i].prev
+ if v < minOff {
+ v = 0
+ v2 = 0
+ } else {
+ v = v - e.cur + e.maxMatchOff
+ if v2 < minOff {
+ v2 = 0
+ } else {
+ v2 = v2 - e.cur + e.maxMatchOff
+ }
+ }
+ e.table[i] = prevEntry{
+ offset: v,
+ prev: v2,
+ }
+ }
+ for i := range e.longTable[:] {
+ v := e.longTable[i].offset
+ v2 := e.longTable[i].prev
+ if v < minOff {
+ v = 0
+ v2 = 0
+ } else {
+ v = v - e.cur + e.maxMatchOff
+ if v2 < minOff {
+ v2 = 0
+ } else {
+ v2 = v2 - e.cur + e.maxMatchOff
+ }
+ }
+ e.longTable[i] = prevEntry{
+ offset: v,
+ prev: v2,
+ }
+ }
+ e.cur = e.maxMatchOff
+ break
+ }
+
+ // Add block to history
+ s := e.addBlock(src)
+ blk.size = len(src)
+
+ // Check RLE first
+ if len(src) > zstdMinMatch {
+ ml := matchLen(src[1:], src)
+ if ml == len(src)-1 {
+ blk.literals = append(blk.literals, src[0])
+ blk.sequences = append(blk.sequences, seq{litLen: 1, matchLen: uint32(len(src)-1) - zstdMinMatch, offset: 1 + 3})
+ return
+ }
+ }
+
+ if len(src) < minNonLiteralBlockSize {
+ blk.extraLits = len(src)
+ blk.literals = blk.literals[:len(src)]
+ copy(blk.literals, src)
+ return
+ }
+
+ // Use this to estimate literal cost.
+ // Scaled by 10 bits.
+ bitsPerByte := int32((compress.ShannonEntropyBits(src) * 1024) / len(src))
+ // Huffman can never go < 1 bit/byte
+ if bitsPerByte < 1024 {
+ bitsPerByte = 1024
+ }
+
+ // Override src
+ src = e.hist
+ sLimit := int32(len(src)) - inputMargin
+ const kSearchStrength = 10
+
+ // nextEmit is where in src the next emitLiteral should start from.
+ nextEmit := s
+
+ // Relative offsets
+ offset1 := int32(blk.recentOffsets[0])
+ offset2 := int32(blk.recentOffsets[1])
+ offset3 := int32(blk.recentOffsets[2])
+
+ addLiterals := func(s *seq, until int32) {
+ if until == nextEmit {
+ return
+ }
+ blk.literals = append(blk.literals, src[nextEmit:until]...)
+ s.litLen = uint32(until - nextEmit)
+ }
+
+ if debugEncoder {
+ println("recent offsets:", blk.recentOffsets)
+ }
+
+encodeLoop:
+ for {
+ // We allow the encoder to optionally turn off repeat offsets across blocks
+ canRepeat := len(blk.sequences) > 2
+
+ if debugAsserts && canRepeat && offset1 == 0 {
+ panic("offset0 was 0")
+ }
+
+ const goodEnough = 250
+
+ cv := load6432(src, s)
+
+ nextHashL := hashLen(cv, bestLongTableBits, bestLongLen)
+ nextHashS := hashLen(cv, bestShortTableBits, bestShortLen)
+ candidateL := e.longTable[nextHashL]
+ candidateS := e.table[nextHashS]
+
+ // Set m to a match at offset if it looks like that will improve compression.
+ improve := func(m *match, offset int32, s int32, first uint32, rep int32) {
+ delta := s - offset
+ if delta >= e.maxMatchOff || delta <= 0 || load3232(src, offset) != first {
+ return
+ }
+ // Try to quick reject if we already have a long match.
+ if m.length > 16 {
+ left := len(src) - int(m.s+m.length)
+ // If we are too close to the end, keep as is.
+ if left <= 0 {
+ return
+ }
+ checkLen := m.length - (s - m.s) - 8
+ if left > 2 && checkLen > 4 {
+ // Check 4 bytes, 4 bytes from the end of the current match.
+ a := load3232(src, offset+checkLen)
+ b := load3232(src, s+checkLen)
+ if a != b {
+ return
+ }
+ }
+ }
+ l := 4 + e.matchlen(s+4, offset+4, src)
+ if m.rep <= 0 {
+ // Extend candidate match backwards as far as possible.
+ // Do not extend repeats as we can assume they are optimal
+ // and offsets change if s == nextEmit.
+ tMin := s - e.maxMatchOff
+ if tMin < 0 {
+ tMin = 0
+ }
+ for offset > tMin && s > nextEmit && src[offset-1] == src[s-1] && l < maxMatchLength {
+ s--
+ offset--
+ l++
+ }
+ }
+ if debugAsserts {
+ if offset >= s {
+ panic(fmt.Sprintf("offset: %d - s:%d - rep: %d - cur :%d - max: %d", offset, s, rep, e.cur, e.maxMatchOff))
+ }
+ if !bytes.Equal(src[s:s+l], src[offset:offset+l]) {
+ panic(fmt.Sprintf("second match mismatch: %v != %v, first: %08x", src[s:s+4], src[offset:offset+4], first))
+ }
+ }
+ cand := match{offset: offset, s: s, length: l, rep: rep}
+ cand.estBits(bitsPerByte)
+ if m.est >= highScore || cand.est-m.est+(cand.s-m.s)*bitsPerByte>>10 < 0 {
+ *m = cand
+ }
+ }
+
+ best := match{s: s, est: highScore}
+ improve(&best, candidateL.offset-e.cur, s, uint32(cv), -1)
+ improve(&best, candidateL.prev-e.cur, s, uint32(cv), -1)
+ improve(&best, candidateS.offset-e.cur, s, uint32(cv), -1)
+ improve(&best, candidateS.prev-e.cur, s, uint32(cv), -1)
+
+ if canRepeat && best.length < goodEnough {
+ if s == nextEmit {
+ // Check repeats straight after a match.
+ improve(&best, s-offset2, s, uint32(cv), 1|4)
+ improve(&best, s-offset3, s, uint32(cv), 2|4)
+ if offset1 > 1 {
+ improve(&best, s-(offset1-1), s, uint32(cv), 3|4)
+ }
+ }
+
+ // If either no match or a non-repeat match, check at + 1
+ if best.rep <= 0 {
+ cv32 := uint32(cv >> 8)
+ spp := s + 1
+ improve(&best, spp-offset1, spp, cv32, 1)
+ improve(&best, spp-offset2, spp, cv32, 2)
+ improve(&best, spp-offset3, spp, cv32, 3)
+ if best.rep < 0 {
+ cv32 = uint32(cv >> 24)
+ spp += 2
+ improve(&best, spp-offset1, spp, cv32, 1)
+ improve(&best, spp-offset2, spp, cv32, 2)
+ improve(&best, spp-offset3, spp, cv32, 3)
+ }
+ }
+ }
+ // Load next and check...
+ e.longTable[nextHashL] = prevEntry{offset: s + e.cur, prev: candidateL.offset}
+ e.table[nextHashS] = prevEntry{offset: s + e.cur, prev: candidateS.offset}
+ index0 := s + 1
+
+ // Look far ahead, unless we have a really long match already...
+ if best.length < goodEnough {
+ // No match found, move forward on input, no need to check forward...
+ if best.length < 4 {
+ s += 1 + (s-nextEmit)>>(kSearchStrength-1)
+ if s >= sLimit {
+ break encodeLoop
+ }
+ continue
+ }
+
+ candidateS = e.table[hashLen(cv>>8, bestShortTableBits, bestShortLen)]
+ cv = load6432(src, s+1)
+ cv2 := load6432(src, s+2)
+ candidateL = e.longTable[hashLen(cv, bestLongTableBits, bestLongLen)]
+ candidateL2 := e.longTable[hashLen(cv2, bestLongTableBits, bestLongLen)]
+
+ // Short at s+1
+ improve(&best, candidateS.offset-e.cur, s+1, uint32(cv), -1)
+ // Long at s+1, s+2
+ improve(&best, candidateL.offset-e.cur, s+1, uint32(cv), -1)
+ improve(&best, candidateL.prev-e.cur, s+1, uint32(cv), -1)
+ improve(&best, candidateL2.offset-e.cur, s+2, uint32(cv2), -1)
+ improve(&best, candidateL2.prev-e.cur, s+2, uint32(cv2), -1)
+ if false {
+ // Short at s+3.
+ // Too often worse...
+ improve(&best, e.table[hashLen(cv2>>8, bestShortTableBits, bestShortLen)].offset-e.cur, s+3, uint32(cv2>>8), -1)
+ }
+
+ // Start check at a fixed offset to allow for a few mismatches.
+ // For this compression level 2 yields the best results.
+ // We cannot do this if we have already indexed this position.
+ const skipBeginning = 2
+ if best.s > s-skipBeginning {
+ // See if we can find a better match by checking where the current best ends.
+ // Use that offset to see if we can find a better full match.
+ if sAt := best.s + best.length; sAt < sLimit {
+ nextHashL := hashLen(load6432(src, sAt), bestLongTableBits, bestLongLen)
+ candidateEnd := e.longTable[nextHashL]
+
+ if off := candidateEnd.offset - e.cur - best.length + skipBeginning; off >= 0 {
+ improve(&best, off, best.s+skipBeginning, load3232(src, best.s+skipBeginning), -1)
+ if off := candidateEnd.prev - e.cur - best.length + skipBeginning; off >= 0 {
+ improve(&best, off, best.s+skipBeginning, load3232(src, best.s+skipBeginning), -1)
+ }
+ }
+ }
+ }
+ }
+
+ if debugAsserts {
+ if best.offset >= best.s {
+ panic(fmt.Sprintf("best.offset > s: %d >= %d", best.offset, best.s))
+ }
+ if best.s < nextEmit {
+ panic(fmt.Sprintf("s %d < nextEmit %d", best.s, nextEmit))
+ }
+ if best.offset < s-e.maxMatchOff {
+ panic(fmt.Sprintf("best.offset < s-e.maxMatchOff: %d < %d", best.offset, s-e.maxMatchOff))
+ }
+ if !bytes.Equal(src[best.s:best.s+best.length], src[best.offset:best.offset+best.length]) {
+ panic(fmt.Sprintf("match mismatch: %v != %v", src[best.s:best.s+best.length], src[best.offset:best.offset+best.length]))
+ }
+ }
+
+ // We have a match, we can store the forward value
+ s = best.s
+ if best.rep > 0 {
+ var seq seq
+ seq.matchLen = uint32(best.length - zstdMinMatch)
+ addLiterals(&seq, best.s)
+
+ // Repeat. If bit 4 is set, this is a non-lit repeat.
+ seq.offset = uint32(best.rep & 3)
+ if debugSequences {
+ println("repeat sequence", seq, "next s:", best.s, "off:", best.s-best.offset)
+ }
+ blk.sequences = append(blk.sequences, seq)
+
+ // Index old s + 1 -> s - 1
+ s = best.s + best.length
+ nextEmit = s
+
+ // Index skipped...
+ end := s
+ if s > sLimit+4 {
+ end = sLimit + 4
+ }
+ off := index0 + e.cur
+ for index0 < end {
+ cv0 := load6432(src, index0)
+ h0 := hashLen(cv0, bestLongTableBits, bestLongLen)
+ h1 := hashLen(cv0, bestShortTableBits, bestShortLen)
+ e.longTable[h0] = prevEntry{offset: off, prev: e.longTable[h0].offset}
+ e.table[h1] = prevEntry{offset: off, prev: e.table[h1].offset}
+ off++
+ index0++
+ }
+
+ switch best.rep {
+ case 2, 4 | 1:
+ offset1, offset2 = offset2, offset1
+ case 3, 4 | 2:
+ offset1, offset2, offset3 = offset3, offset1, offset2
+ case 4 | 3:
+ offset1, offset2, offset3 = offset1-1, offset1, offset2
+ }
+ if s >= sLimit {
+ if debugEncoder {
+ println("repeat ended", s, best.length)
+ }
+ break encodeLoop
+ }
+ continue
+ }
+
+ // A 4-byte match has been found. Update recent offsets.
+ // We'll later see if more than 4 bytes.
+ t := best.offset
+ offset1, offset2, offset3 = s-t, offset1, offset2
+
+ if debugAsserts && s <= t {
+ panic(fmt.Sprintf("s (%d) <= t (%d)", s, t))
+ }
+
+ if debugAsserts && int(offset1) > len(src) {
+ panic("invalid offset")
+ }
+
+ // Write our sequence
+ var seq seq
+ l := best.length
+ seq.litLen = uint32(s - nextEmit)
+ seq.matchLen = uint32(l - zstdMinMatch)
+ if seq.litLen > 0 {
+ blk.literals = append(blk.literals, src[nextEmit:s]...)
+ }
+ seq.offset = uint32(s-t) + 3
+ s += l
+ if debugSequences {
+ println("sequence", seq, "next s:", s)
+ }
+ blk.sequences = append(blk.sequences, seq)
+ nextEmit = s
+
+ // Index old s + 1 -> s - 1 or sLimit
+ end := s
+ if s > sLimit-4 {
+ end = sLimit - 4
+ }
+
+ off := index0 + e.cur
+ for index0 < end {
+ cv0 := load6432(src, index0)
+ h0 := hashLen(cv0, bestLongTableBits, bestLongLen)
+ h1 := hashLen(cv0, bestShortTableBits, bestShortLen)
+ e.longTable[h0] = prevEntry{offset: off, prev: e.longTable[h0].offset}
+ e.table[h1] = prevEntry{offset: off, prev: e.table[h1].offset}
+ index0++
+ off++
+ }
+ if s >= sLimit {
+ break encodeLoop
+ }
+ }
+
+ if int(nextEmit) < len(src) {
+ blk.literals = append(blk.literals, src[nextEmit:]...)
+ blk.extraLits = len(src) - int(nextEmit)
+ }
+ blk.recentOffsets[0] = uint32(offset1)
+ blk.recentOffsets[1] = uint32(offset2)
+ blk.recentOffsets[2] = uint32(offset3)
+ if debugEncoder {
+ println("returning, recent offsets:", blk.recentOffsets, "extra literals:", blk.extraLits)
+ }
+}
+
+// EncodeNoHist will encode a block with no history and no following blocks.
+// Most notable difference is that src will not be copied for history and
+// we do not need to check for max match length.
+func (e *bestFastEncoder) EncodeNoHist(blk *blockEnc, src []byte) {
+ e.ensureHist(len(src))
+ e.Encode(blk, src)
+}
+
+// Reset will reset and set a dictionary if not nil
+func (e *bestFastEncoder) Reset(d *dict, singleBlock bool) {
+ e.resetBase(d, singleBlock)
+ if d == nil {
+ return
+ }
+ // Init or copy dict table
+ if len(e.dictTable) != len(e.table) || d.id != e.lastDictID {
+ if len(e.dictTable) != len(e.table) {
+ e.dictTable = make([]prevEntry, len(e.table))
+ }
+ end := int32(len(d.content)) - 8 + e.maxMatchOff
+ for i := e.maxMatchOff; i < end; i += 4 {
+ const hashLog = bestShortTableBits
+
+ cv := load6432(d.content, i-e.maxMatchOff)
+ nextHash := hashLen(cv, hashLog, bestShortLen) // 0 -> 4
+ nextHash1 := hashLen(cv>>8, hashLog, bestShortLen) // 1 -> 5
+ nextHash2 := hashLen(cv>>16, hashLog, bestShortLen) // 2 -> 6
+ nextHash3 := hashLen(cv>>24, hashLog, bestShortLen) // 3 -> 7
+ e.dictTable[nextHash] = prevEntry{
+ prev: e.dictTable[nextHash].offset,
+ offset: i,
+ }
+ e.dictTable[nextHash1] = prevEntry{
+ prev: e.dictTable[nextHash1].offset,
+ offset: i + 1,
+ }
+ e.dictTable[nextHash2] = prevEntry{
+ prev: e.dictTable[nextHash2].offset,
+ offset: i + 2,
+ }
+ e.dictTable[nextHash3] = prevEntry{
+ prev: e.dictTable[nextHash3].offset,
+ offset: i + 3,
+ }
+ }
+ e.lastDictID = d.id
+ }
+
+ // Init or copy dict table
+ if len(e.dictLongTable) != len(e.longTable) || d.id != e.lastDictID {
+ if len(e.dictLongTable) != len(e.longTable) {
+ e.dictLongTable = make([]prevEntry, len(e.longTable))
+ }
+ if len(d.content) >= 8 {
+ cv := load6432(d.content, 0)
+ h := hashLen(cv, bestLongTableBits, bestLongLen)
+ e.dictLongTable[h] = prevEntry{
+ offset: e.maxMatchOff,
+ prev: e.dictLongTable[h].offset,
+ }
+
+ end := int32(len(d.content)) - 8 + e.maxMatchOff
+ off := 8 // First to read
+ for i := e.maxMatchOff + 1; i < end; i++ {
+ cv = cv>>8 | (uint64(d.content[off]) << 56)
+ h := hashLen(cv, bestLongTableBits, bestLongLen)
+ e.dictLongTable[h] = prevEntry{
+ offset: i,
+ prev: e.dictLongTable[h].offset,
+ }
+ off++
+ }
+ }
+ e.lastDictID = d.id
+ }
+ // Reset table to initial state
+ copy(e.longTable[:], e.dictLongTable)
+
+ e.cur = e.maxMatchOff
+ // Reset table to initial state
+ copy(e.table[:], e.dictTable)
+}
diff --git a/vendor/github.com/klauspost/compress/zstd/enc_better.go b/vendor/github.com/klauspost/compress/zstd/enc_better.go
new file mode 100644
index 00000000..84a79fde
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/enc_better.go
@@ -0,0 +1,1252 @@
+// Copyright 2019+ Klaus Post. All rights reserved.
+// License information can be found in the LICENSE file.
+// Based on work by Yann Collet, released under BSD License.
+
+package zstd
+
+import "fmt"
+
+const (
+ betterLongTableBits = 19 // Bits used in the long match table
+ betterLongTableSize = 1 << betterLongTableBits // Size of the table
+ betterLongLen = 8 // Bytes used for table hash
+
+ // Note: Increasing the short table bits or making the hash shorter
+ // can actually lead to compression degradation since it will 'steal' more from the
+ // long match table and match offsets are quite big.
+ // This greatly depends on the type of input.
+ betterShortTableBits = 13 // Bits used in the short match table
+ betterShortTableSize = 1 << betterShortTableBits // Size of the table
+ betterShortLen = 5 // Bytes used for table hash
+
+ betterLongTableShardCnt = 1 << (betterLongTableBits - dictShardBits) // Number of shards in the table
+ betterLongTableShardSize = betterLongTableSize / betterLongTableShardCnt // Size of an individual shard
+
+ betterShortTableShardCnt = 1 << (betterShortTableBits - dictShardBits) // Number of shards in the table
+ betterShortTableShardSize = betterShortTableSize / betterShortTableShardCnt // Size of an individual shard
+)
+
+type prevEntry struct {
+ offset int32
+ prev int32
+}
+
+// betterFastEncoder uses 2 tables, one for short matches (5 bytes) and one for long matches.
+// The long match table contains the previous entry with the same hash,
+// effectively making it a "chain" of length 2.
+// When we find a long match we choose between the two values and select the longest.
+// When we find a short match, after checking the long, we check if we can find a long at n+1
+// and that it is longer (lazy matching).
+type betterFastEncoder struct {
+ fastBase
+ table [betterShortTableSize]tableEntry
+ longTable [betterLongTableSize]prevEntry
+}
+
+type betterFastEncoderDict struct {
+ betterFastEncoder
+ dictTable []tableEntry
+ dictLongTable []prevEntry
+ shortTableShardDirty [betterShortTableShardCnt]bool
+ longTableShardDirty [betterLongTableShardCnt]bool
+ allDirty bool
+}
+
+// Encode improves compression...
+func (e *betterFastEncoder) Encode(blk *blockEnc, src []byte) {
+ const (
+ // Input margin is the number of bytes we read (8)
+ // and the maximum we will read ahead (2)
+ inputMargin = 8 + 2
+ minNonLiteralBlockSize = 16
+ )
+
+ // Protect against e.cur wraparound.
+ for e.cur >= e.bufferReset-int32(len(e.hist)) {
+ if len(e.hist) == 0 {
+ e.table = [betterShortTableSize]tableEntry{}
+ e.longTable = [betterLongTableSize]prevEntry{}
+ e.cur = e.maxMatchOff
+ break
+ }
+ // Shift down everything in the table that isn't already too far away.
+ minOff := e.cur + int32(len(e.hist)) - e.maxMatchOff
+ for i := range e.table[:] {
+ v := e.table[i].offset
+ if v < minOff {
+ v = 0
+ } else {
+ v = v - e.cur + e.maxMatchOff
+ }
+ e.table[i].offset = v
+ }
+ for i := range e.longTable[:] {
+ v := e.longTable[i].offset
+ v2 := e.longTable[i].prev
+ if v < minOff {
+ v = 0
+ v2 = 0
+ } else {
+ v = v - e.cur + e.maxMatchOff
+ if v2 < minOff {
+ v2 = 0
+ } else {
+ v2 = v2 - e.cur + e.maxMatchOff
+ }
+ }
+ e.longTable[i] = prevEntry{
+ offset: v,
+ prev: v2,
+ }
+ }
+ e.cur = e.maxMatchOff
+ break
+ }
+ // Add block to history
+ s := e.addBlock(src)
+ blk.size = len(src)
+
+ // Check RLE first
+ if len(src) > zstdMinMatch {
+ ml := matchLen(src[1:], src)
+ if ml == len(src)-1 {
+ blk.literals = append(blk.literals, src[0])
+ blk.sequences = append(blk.sequences, seq{litLen: 1, matchLen: uint32(len(src)-1) - zstdMinMatch, offset: 1 + 3})
+ return
+ }
+ }
+
+ if len(src) < minNonLiteralBlockSize {
+ blk.extraLits = len(src)
+ blk.literals = blk.literals[:len(src)]
+ copy(blk.literals, src)
+ return
+ }
+
+ // Override src
+ src = e.hist
+ sLimit := int32(len(src)) - inputMargin
+ // stepSize is the number of bytes to skip on every main loop iteration.
+ // It should be >= 1.
+ const stepSize = 1
+
+ const kSearchStrength = 9
+
+ // nextEmit is where in src the next emitLiteral should start from.
+ nextEmit := s
+ cv := load6432(src, s)
+
+ // Relative offsets
+ offset1 := int32(blk.recentOffsets[0])
+ offset2 := int32(blk.recentOffsets[1])
+
+ addLiterals := func(s *seq, until int32) {
+ if until == nextEmit {
+ return
+ }
+ blk.literals = append(blk.literals, src[nextEmit:until]...)
+ s.litLen = uint32(until - nextEmit)
+ }
+ if debugEncoder {
+ println("recent offsets:", blk.recentOffsets)
+ }
+
+encodeLoop:
+ for {
+ var t int32
+ // We allow the encoder to optionally turn off repeat offsets across blocks
+ canRepeat := len(blk.sequences) > 2
+ var matched, index0 int32
+
+ for {
+ if debugAsserts && canRepeat && offset1 == 0 {
+ panic("offset0 was 0")
+ }
+
+ nextHashL := hashLen(cv, betterLongTableBits, betterLongLen)
+ nextHashS := hashLen(cv, betterShortTableBits, betterShortLen)
+ candidateL := e.longTable[nextHashL]
+ candidateS := e.table[nextHashS]
+
+ const repOff = 1
+ repIndex := s - offset1 + repOff
+ off := s + e.cur
+ e.longTable[nextHashL] = prevEntry{offset: off, prev: candidateL.offset}
+ e.table[nextHashS] = tableEntry{offset: off, val: uint32(cv)}
+ index0 = s + 1
+
+ if canRepeat {
+ if repIndex >= 0 && load3232(src, repIndex) == uint32(cv>>(repOff*8)) {
+ // Consider history as well.
+ var seq seq
+ length := 4 + e.matchlen(s+4+repOff, repIndex+4, src)
+
+ seq.matchLen = uint32(length - zstdMinMatch)
+
+ // We might be able to match backwards.
+ // Extend as long as we can.
+ start := s + repOff
+ // We end the search early, so we don't risk 0 literals
+ // and have to do special offset treatment.
+ startLimit := nextEmit + 1
+
+ tMin := s - e.maxMatchOff
+ if tMin < 0 {
+ tMin = 0
+ }
+ for repIndex > tMin && start > startLimit && src[repIndex-1] == src[start-1] && seq.matchLen < maxMatchLength-zstdMinMatch-1 {
+ repIndex--
+ start--
+ seq.matchLen++
+ }
+ addLiterals(&seq, start)
+
+ // rep 0
+ seq.offset = 1
+ if debugSequences {
+ println("repeat sequence", seq, "next s:", s)
+ }
+ blk.sequences = append(blk.sequences, seq)
+
+ // Index match start+1 (long) -> s - 1
+ index0 := s + repOff
+ s += length + repOff
+
+ nextEmit = s
+ if s >= sLimit {
+ if debugEncoder {
+ println("repeat ended", s, length)
+
+ }
+ break encodeLoop
+ }
+ // Index skipped...
+ for index0 < s-1 {
+ cv0 := load6432(src, index0)
+ cv1 := cv0 >> 8
+ h0 := hashLen(cv0, betterLongTableBits, betterLongLen)
+ off := index0 + e.cur
+ e.longTable[h0] = prevEntry{offset: off, prev: e.longTable[h0].offset}
+ e.table[hashLen(cv1, betterShortTableBits, betterShortLen)] = tableEntry{offset: off + 1, val: uint32(cv1)}
+ index0 += 2
+ }
+ cv = load6432(src, s)
+ continue
+ }
+ const repOff2 = 1
+
+ // We deviate from the reference encoder and also check offset 2.
+ // Still slower and not much better, so disabled.
+ // repIndex = s - offset2 + repOff2
+ if false && repIndex >= 0 && load6432(src, repIndex) == load6432(src, s+repOff) {
+ // Consider history as well.
+ var seq seq
+ length := 8 + e.matchlen(s+8+repOff2, repIndex+8, src)
+
+ seq.matchLen = uint32(length - zstdMinMatch)
+
+ // We might be able to match backwards.
+ // Extend as long as we can.
+ start := s + repOff2
+ // We end the search early, so we don't risk 0 literals
+ // and have to do special offset treatment.
+ startLimit := nextEmit + 1
+
+ tMin := s - e.maxMatchOff
+ if tMin < 0 {
+ tMin = 0
+ }
+ for repIndex > tMin && start > startLimit && src[repIndex-1] == src[start-1] && seq.matchLen < maxMatchLength-zstdMinMatch-1 {
+ repIndex--
+ start--
+ seq.matchLen++
+ }
+ addLiterals(&seq, start)
+
+ // rep 2
+ seq.offset = 2
+ if debugSequences {
+ println("repeat sequence 2", seq, "next s:", s)
+ }
+ blk.sequences = append(blk.sequences, seq)
+
+ s += length + repOff2
+ nextEmit = s
+ if s >= sLimit {
+ if debugEncoder {
+ println("repeat ended", s, length)
+
+ }
+ break encodeLoop
+ }
+
+ // Index skipped...
+ for index0 < s-1 {
+ cv0 := load6432(src, index0)
+ cv1 := cv0 >> 8
+ h0 := hashLen(cv0, betterLongTableBits, betterLongLen)
+ off := index0 + e.cur
+ e.longTable[h0] = prevEntry{offset: off, prev: e.longTable[h0].offset}
+ e.table[hashLen(cv1, betterShortTableBits, betterShortLen)] = tableEntry{offset: off + 1, val: uint32(cv1)}
+ index0 += 2
+ }
+ cv = load6432(src, s)
+ // Swap offsets
+ offset1, offset2 = offset2, offset1
+ continue
+ }
+ }
+ // Find the offsets of our two matches.
+ coffsetL := candidateL.offset - e.cur
+ coffsetLP := candidateL.prev - e.cur
+
+ // Check if we have a long match.
+ if s-coffsetL < e.maxMatchOff && cv == load6432(src, coffsetL) {
+ // Found a long match, at least 8 bytes.
+ matched = e.matchlen(s+8, coffsetL+8, src) + 8
+ t = coffsetL
+ if debugAsserts && s <= t {
+ panic(fmt.Sprintf("s (%d) <= t (%d)", s, t))
+ }
+ if debugAsserts && s-t > e.maxMatchOff {
+ panic("s - t >e.maxMatchOff")
+ }
+ if debugMatches {
+ println("long match")
+ }
+
+ if s-coffsetLP < e.maxMatchOff && cv == load6432(src, coffsetLP) {
+ // Found a long match, at least 8 bytes.
+ prevMatch := e.matchlen(s+8, coffsetLP+8, src) + 8
+ if prevMatch > matched {
+ matched = prevMatch
+ t = coffsetLP
+ }
+ if debugAsserts && s <= t {
+ panic(fmt.Sprintf("s (%d) <= t (%d)", s, t))
+ }
+ if debugAsserts && s-t > e.maxMatchOff {
+ panic("s - t >e.maxMatchOff")
+ }
+ if debugMatches {
+ println("long match")
+ }
+ }
+ break
+ }
+
+ // Check if we have a long match on prev.
+ if s-coffsetLP < e.maxMatchOff && cv == load6432(src, coffsetLP) {
+ // Found a long match, at least 8 bytes.
+ matched = e.matchlen(s+8, coffsetLP+8, src) + 8
+ t = coffsetLP
+ if debugAsserts && s <= t {
+ panic(fmt.Sprintf("s (%d) <= t (%d)", s, t))
+ }
+ if debugAsserts && s-t > e.maxMatchOff {
+ panic("s - t >e.maxMatchOff")
+ }
+ if debugMatches {
+ println("long match")
+ }
+ break
+ }
+
+ coffsetS := candidateS.offset - e.cur
+
+ // Check if we have a short match.
+ if s-coffsetS < e.maxMatchOff && uint32(cv) == candidateS.val {
+ // found a regular match
+ matched = e.matchlen(s+4, coffsetS+4, src) + 4
+
+ // See if we can find a long match at s+1
+ const checkAt = 1
+ cv := load6432(src, s+checkAt)
+ nextHashL = hashLen(cv, betterLongTableBits, betterLongLen)
+ candidateL = e.longTable[nextHashL]
+ coffsetL = candidateL.offset - e.cur
+
+ // We can store it, since we have at least a 4 byte match.
+ e.longTable[nextHashL] = prevEntry{offset: s + checkAt + e.cur, prev: candidateL.offset}
+ if s-coffsetL < e.maxMatchOff && cv == load6432(src, coffsetL) {
+ // Found a long match, at least 8 bytes.
+ matchedNext := e.matchlen(s+8+checkAt, coffsetL+8, src) + 8
+ if matchedNext > matched {
+ t = coffsetL
+ s += checkAt
+ matched = matchedNext
+ if debugMatches {
+ println("long match (after short)")
+ }
+ break
+ }
+ }
+
+ // Check prev long...
+ coffsetL = candidateL.prev - e.cur
+ if s-coffsetL < e.maxMatchOff && cv == load6432(src, coffsetL) {
+ // Found a long match, at least 8 bytes.
+ matchedNext := e.matchlen(s+8+checkAt, coffsetL+8, src) + 8
+ if matchedNext > matched {
+ t = coffsetL
+ s += checkAt
+ matched = matchedNext
+ if debugMatches {
+ println("prev long match (after short)")
+ }
+ break
+ }
+ }
+ t = coffsetS
+ if debugAsserts && s <= t {
+ panic(fmt.Sprintf("s (%d) <= t (%d)", s, t))
+ }
+ if debugAsserts && s-t > e.maxMatchOff {
+ panic("s - t >e.maxMatchOff")
+ }
+ if debugAsserts && t < 0 {
+ panic("t<0")
+ }
+ if debugMatches {
+ println("short match")
+ }
+ break
+ }
+
+ // No match found, move forward in input.
+ s += stepSize + ((s - nextEmit) >> (kSearchStrength - 1))
+ if s >= sLimit {
+ break encodeLoop
+ }
+ cv = load6432(src, s)
+ }
+
+ // Try to find a better match by searching for a long match at the end of the current best match
+ if s+matched < sLimit {
+ // Allow some bytes at the beginning to mismatch.
+ // Sweet spot is around 3 bytes, but depends on input.
+ // The skipped bytes are tested in Extend backwards,
+ // and still picked up as part of the match if they do.
+ const skipBeginning = 3
+
+ nextHashL := hashLen(load6432(src, s+matched), betterLongTableBits, betterLongLen)
+ s2 := s + skipBeginning
+ cv := load3232(src, s2)
+ candidateL := e.longTable[nextHashL]
+ coffsetL := candidateL.offset - e.cur - matched + skipBeginning
+ if coffsetL >= 0 && coffsetL < s2 && s2-coffsetL < e.maxMatchOff && cv == load3232(src, coffsetL) {
+ // Found a long match, at least 4 bytes.
+ matchedNext := e.matchlen(s2+4, coffsetL+4, src) + 4
+ if matchedNext > matched {
+ t = coffsetL
+ s = s2
+ matched = matchedNext
+ if debugMatches {
+ println("long match at end-of-match")
+ }
+ }
+ }
+
+ // Check prev long...
+ if true {
+ coffsetL = candidateL.prev - e.cur - matched + skipBeginning
+ if coffsetL >= 0 && coffsetL < s2 && s2-coffsetL < e.maxMatchOff && cv == load3232(src, coffsetL) {
+ // Found a long match, at least 4 bytes.
+ matchedNext := e.matchlen(s2+4, coffsetL+4, src) + 4
+ if matchedNext > matched {
+ t = coffsetL
+ s = s2
+ matched = matchedNext
+ if debugMatches {
+ println("prev long match at end-of-match")
+ }
+ }
+ }
+ }
+ }
+ // A match has been found. Update recent offsets.
+ offset2 = offset1
+ offset1 = s - t
+
+ if debugAsserts && s <= t {
+ panic(fmt.Sprintf("s (%d) <= t (%d)", s, t))
+ }
+
+ if debugAsserts && canRepeat && int(offset1) > len(src) {
+ panic("invalid offset")
+ }
+
+ // Extend the n-byte match as long as possible.
+ l := matched
+
+ // Extend backwards
+ tMin := s - e.maxMatchOff
+ if tMin < 0 {
+ tMin = 0
+ }
+ for t > tMin && s > nextEmit && src[t-1] == src[s-1] && l < maxMatchLength {
+ s--
+ t--
+ l++
+ }
+
+ // Write our sequence
+ var seq seq
+ seq.litLen = uint32(s - nextEmit)
+ seq.matchLen = uint32(l - zstdMinMatch)
+ if seq.litLen > 0 {
+ blk.literals = append(blk.literals, src[nextEmit:s]...)
+ }
+ seq.offset = uint32(s-t) + 3
+ s += l
+ if debugSequences {
+ println("sequence", seq, "next s:", s)
+ }
+ blk.sequences = append(blk.sequences, seq)
+ nextEmit = s
+ if s >= sLimit {
+ break encodeLoop
+ }
+
+ // Index match start+1 (long) -> s - 1
+ off := index0 + e.cur
+ for index0 < s-1 {
+ cv0 := load6432(src, index0)
+ cv1 := cv0 >> 8
+ h0 := hashLen(cv0, betterLongTableBits, betterLongLen)
+ e.longTable[h0] = prevEntry{offset: off, prev: e.longTable[h0].offset}
+ e.table[hashLen(cv1, betterShortTableBits, betterShortLen)] = tableEntry{offset: off + 1, val: uint32(cv1)}
+ index0 += 2
+ off += 2
+ }
+
+ cv = load6432(src, s)
+ if !canRepeat {
+ continue
+ }
+
+ // Check offset 2
+ for {
+ o2 := s - offset2
+ if load3232(src, o2) != uint32(cv) {
+ // Do regular search
+ break
+ }
+
+ // Store this, since we have it.
+ nextHashL := hashLen(cv, betterLongTableBits, betterLongLen)
+ nextHashS := hashLen(cv, betterShortTableBits, betterShortLen)
+
+ // We have at least 4 byte match.
+ // No need to check backwards. We come straight from a match
+ l := 4 + e.matchlen(s+4, o2+4, src)
+
+ e.longTable[nextHashL] = prevEntry{offset: s + e.cur, prev: e.longTable[nextHashL].offset}
+ e.table[nextHashS] = tableEntry{offset: s + e.cur, val: uint32(cv)}
+ seq.matchLen = uint32(l) - zstdMinMatch
+ seq.litLen = 0
+
+ // Since litlen is always 0, this is offset 1.
+ seq.offset = 1
+ s += l
+ nextEmit = s
+ if debugSequences {
+ println("sequence", seq, "next s:", s)
+ }
+ blk.sequences = append(blk.sequences, seq)
+
+ // Swap offset 1 and 2.
+ offset1, offset2 = offset2, offset1
+ if s >= sLimit {
+ // Finished
+ break encodeLoop
+ }
+ cv = load6432(src, s)
+ }
+ }
+
+ if int(nextEmit) < len(src) {
+ blk.literals = append(blk.literals, src[nextEmit:]...)
+ blk.extraLits = len(src) - int(nextEmit)
+ }
+ blk.recentOffsets[0] = uint32(offset1)
+ blk.recentOffsets[1] = uint32(offset2)
+ if debugEncoder {
+ println("returning, recent offsets:", blk.recentOffsets, "extra literals:", blk.extraLits)
+ }
+}
+
+// EncodeNoHist will encode a block with no history and no following blocks.
+// Most notable difference is that src will not be copied for history and
+// we do not need to check for max match length.
+func (e *betterFastEncoder) EncodeNoHist(blk *blockEnc, src []byte) {
+ e.ensureHist(len(src))
+ e.Encode(blk, src)
+}
+
+// Encode improves compression...
+func (e *betterFastEncoderDict) Encode(blk *blockEnc, src []byte) {
+ const (
+ // Input margin is the number of bytes we read (8)
+ // and the maximum we will read ahead (2)
+ inputMargin = 8 + 2
+ minNonLiteralBlockSize = 16
+ )
+
+ // Protect against e.cur wraparound.
+ for e.cur >= e.bufferReset-int32(len(e.hist)) {
+ if len(e.hist) == 0 {
+ for i := range e.table[:] {
+ e.table[i] = tableEntry{}
+ }
+ for i := range e.longTable[:] {
+ e.longTable[i] = prevEntry{}
+ }
+ e.cur = e.maxMatchOff
+ e.allDirty = true
+ break
+ }
+ // Shift down everything in the table that isn't already too far away.
+ minOff := e.cur + int32(len(e.hist)) - e.maxMatchOff
+ for i := range e.table[:] {
+ v := e.table[i].offset
+ if v < minOff {
+ v = 0
+ } else {
+ v = v - e.cur + e.maxMatchOff
+ }
+ e.table[i].offset = v
+ }
+ for i := range e.longTable[:] {
+ v := e.longTable[i].offset
+ v2 := e.longTable[i].prev
+ if v < minOff {
+ v = 0
+ v2 = 0
+ } else {
+ v = v - e.cur + e.maxMatchOff
+ if v2 < minOff {
+ v2 = 0
+ } else {
+ v2 = v2 - e.cur + e.maxMatchOff
+ }
+ }
+ e.longTable[i] = prevEntry{
+ offset: v,
+ prev: v2,
+ }
+ }
+ e.allDirty = true
+ e.cur = e.maxMatchOff
+ break
+ }
+
+ s := e.addBlock(src)
+ blk.size = len(src)
+ if len(src) < minNonLiteralBlockSize {
+ blk.extraLits = len(src)
+ blk.literals = blk.literals[:len(src)]
+ copy(blk.literals, src)
+ return
+ }
+
+ // Override src
+ src = e.hist
+ sLimit := int32(len(src)) - inputMargin
+ // stepSize is the number of bytes to skip on every main loop iteration.
+ // It should be >= 1.
+ const stepSize = 1
+
+ const kSearchStrength = 9
+
+ // nextEmit is where in src the next emitLiteral should start from.
+ nextEmit := s
+ cv := load6432(src, s)
+
+ // Relative offsets
+ offset1 := int32(blk.recentOffsets[0])
+ offset2 := int32(blk.recentOffsets[1])
+
+ addLiterals := func(s *seq, until int32) {
+ if until == nextEmit {
+ return
+ }
+ blk.literals = append(blk.literals, src[nextEmit:until]...)
+ s.litLen = uint32(until - nextEmit)
+ }
+ if debugEncoder {
+ println("recent offsets:", blk.recentOffsets)
+ }
+
+encodeLoop:
+ for {
+ var t int32
+ // We allow the encoder to optionally turn off repeat offsets across blocks
+ canRepeat := len(blk.sequences) > 2
+ var matched, index0 int32
+
+ for {
+ if debugAsserts && canRepeat && offset1 == 0 {
+ panic("offset0 was 0")
+ }
+
+ nextHashL := hashLen(cv, betterLongTableBits, betterLongLen)
+ nextHashS := hashLen(cv, betterShortTableBits, betterShortLen)
+ candidateL := e.longTable[nextHashL]
+ candidateS := e.table[nextHashS]
+
+ const repOff = 1
+ repIndex := s - offset1 + repOff
+ off := s + e.cur
+ e.longTable[nextHashL] = prevEntry{offset: off, prev: candidateL.offset}
+ e.markLongShardDirty(nextHashL)
+ e.table[nextHashS] = tableEntry{offset: off, val: uint32(cv)}
+ e.markShortShardDirty(nextHashS)
+ index0 = s + 1
+
+ if canRepeat {
+ if repIndex >= 0 && load3232(src, repIndex) == uint32(cv>>(repOff*8)) {
+ // Consider history as well.
+ var seq seq
+ length := 4 + e.matchlen(s+4+repOff, repIndex+4, src)
+
+ seq.matchLen = uint32(length - zstdMinMatch)
+
+ // We might be able to match backwards.
+ // Extend as long as we can.
+ start := s + repOff
+ // We end the search early, so we don't risk 0 literals
+ // and have to do special offset treatment.
+ startLimit := nextEmit + 1
+
+ tMin := s - e.maxMatchOff
+ if tMin < 0 {
+ tMin = 0
+ }
+ for repIndex > tMin && start > startLimit && src[repIndex-1] == src[start-1] && seq.matchLen < maxMatchLength-zstdMinMatch-1 {
+ repIndex--
+ start--
+ seq.matchLen++
+ }
+ addLiterals(&seq, start)
+
+ // rep 0
+ seq.offset = 1
+ if debugSequences {
+ println("repeat sequence", seq, "next s:", s)
+ }
+ blk.sequences = append(blk.sequences, seq)
+
+ // Index match start+1 (long) -> s - 1
+ s += length + repOff
+
+ nextEmit = s
+ if s >= sLimit {
+ if debugEncoder {
+ println("repeat ended", s, length)
+
+ }
+ break encodeLoop
+ }
+ // Index skipped...
+ for index0 < s-1 {
+ cv0 := load6432(src, index0)
+ cv1 := cv0 >> 8
+ h0 := hashLen(cv0, betterLongTableBits, betterLongLen)
+ off := index0 + e.cur
+ e.longTable[h0] = prevEntry{offset: off, prev: e.longTable[h0].offset}
+ e.markLongShardDirty(h0)
+ h1 := hashLen(cv1, betterShortTableBits, betterShortLen)
+ e.table[h1] = tableEntry{offset: off + 1, val: uint32(cv1)}
+ e.markShortShardDirty(h1)
+ index0 += 2
+ }
+ cv = load6432(src, s)
+ continue
+ }
+ const repOff2 = 1
+
+ // We deviate from the reference encoder and also check offset 2.
+ // Still slower and not much better, so disabled.
+ // repIndex = s - offset2 + repOff2
+ if false && repIndex >= 0 && load6432(src, repIndex) == load6432(src, s+repOff) {
+ // Consider history as well.
+ var seq seq
+ length := 8 + e.matchlen(s+8+repOff2, repIndex+8, src)
+
+ seq.matchLen = uint32(length - zstdMinMatch)
+
+ // We might be able to match backwards.
+ // Extend as long as we can.
+ start := s + repOff2
+ // We end the search early, so we don't risk 0 literals
+ // and have to do special offset treatment.
+ startLimit := nextEmit + 1
+
+ tMin := s - e.maxMatchOff
+ if tMin < 0 {
+ tMin = 0
+ }
+ for repIndex > tMin && start > startLimit && src[repIndex-1] == src[start-1] && seq.matchLen < maxMatchLength-zstdMinMatch-1 {
+ repIndex--
+ start--
+ seq.matchLen++
+ }
+ addLiterals(&seq, start)
+
+ // rep 2
+ seq.offset = 2
+ if debugSequences {
+ println("repeat sequence 2", seq, "next s:", s)
+ }
+ blk.sequences = append(blk.sequences, seq)
+
+ s += length + repOff2
+ nextEmit = s
+ if s >= sLimit {
+ if debugEncoder {
+ println("repeat ended", s, length)
+
+ }
+ break encodeLoop
+ }
+
+ // Index skipped...
+ for index0 < s-1 {
+ cv0 := load6432(src, index0)
+ cv1 := cv0 >> 8
+ h0 := hashLen(cv0, betterLongTableBits, betterLongLen)
+ off := index0 + e.cur
+ e.longTable[h0] = prevEntry{offset: off, prev: e.longTable[h0].offset}
+ e.markLongShardDirty(h0)
+ h1 := hashLen(cv1, betterShortTableBits, betterShortLen)
+ e.table[h1] = tableEntry{offset: off + 1, val: uint32(cv1)}
+ e.markShortShardDirty(h1)
+ index0 += 2
+ }
+ cv = load6432(src, s)
+ // Swap offsets
+ offset1, offset2 = offset2, offset1
+ continue
+ }
+ }
+ // Find the offsets of our two matches.
+ coffsetL := candidateL.offset - e.cur
+ coffsetLP := candidateL.prev - e.cur
+
+ // Check if we have a long match.
+ if s-coffsetL < e.maxMatchOff && cv == load6432(src, coffsetL) {
+ // Found a long match, at least 8 bytes.
+ matched = e.matchlen(s+8, coffsetL+8, src) + 8
+ t = coffsetL
+ if debugAsserts && s <= t {
+ panic(fmt.Sprintf("s (%d) <= t (%d)", s, t))
+ }
+ if debugAsserts && s-t > e.maxMatchOff {
+ panic("s - t >e.maxMatchOff")
+ }
+ if debugMatches {
+ println("long match")
+ }
+
+ if s-coffsetLP < e.maxMatchOff && cv == load6432(src, coffsetLP) {
+ // Found a long match, at least 8 bytes.
+ prevMatch := e.matchlen(s+8, coffsetLP+8, src) + 8
+ if prevMatch > matched {
+ matched = prevMatch
+ t = coffsetLP
+ }
+ if debugAsserts && s <= t {
+ panic(fmt.Sprintf("s (%d) <= t (%d)", s, t))
+ }
+ if debugAsserts && s-t > e.maxMatchOff {
+ panic("s - t >e.maxMatchOff")
+ }
+ if debugMatches {
+ println("long match")
+ }
+ }
+ break
+ }
+
+ // Check if we have a long match on prev.
+ if s-coffsetLP < e.maxMatchOff && cv == load6432(src, coffsetLP) {
+ // Found a long match, at least 8 bytes.
+ matched = e.matchlen(s+8, coffsetLP+8, src) + 8
+ t = coffsetLP
+ if debugAsserts && s <= t {
+ panic(fmt.Sprintf("s (%d) <= t (%d)", s, t))
+ }
+ if debugAsserts && s-t > e.maxMatchOff {
+ panic("s - t >e.maxMatchOff")
+ }
+ if debugMatches {
+ println("long match")
+ }
+ break
+ }
+
+ coffsetS := candidateS.offset - e.cur
+
+ // Check if we have a short match.
+ if s-coffsetS < e.maxMatchOff && uint32(cv) == candidateS.val {
+ // found a regular match
+ matched = e.matchlen(s+4, coffsetS+4, src) + 4
+
+ // See if we can find a long match at s+1
+ const checkAt = 1
+ cv := load6432(src, s+checkAt)
+ nextHashL = hashLen(cv, betterLongTableBits, betterLongLen)
+ candidateL = e.longTable[nextHashL]
+ coffsetL = candidateL.offset - e.cur
+
+ // We can store it, since we have at least a 4 byte match.
+ e.longTable[nextHashL] = prevEntry{offset: s + checkAt + e.cur, prev: candidateL.offset}
+ e.markLongShardDirty(nextHashL)
+ if s-coffsetL < e.maxMatchOff && cv == load6432(src, coffsetL) {
+ // Found a long match, at least 8 bytes.
+ matchedNext := e.matchlen(s+8+checkAt, coffsetL+8, src) + 8
+ if matchedNext > matched {
+ t = coffsetL
+ s += checkAt
+ matched = matchedNext
+ if debugMatches {
+ println("long match (after short)")
+ }
+ break
+ }
+ }
+
+ // Check prev long...
+ coffsetL = candidateL.prev - e.cur
+ if s-coffsetL < e.maxMatchOff && cv == load6432(src, coffsetL) {
+ // Found a long match, at least 8 bytes.
+ matchedNext := e.matchlen(s+8+checkAt, coffsetL+8, src) + 8
+ if matchedNext > matched {
+ t = coffsetL
+ s += checkAt
+ matched = matchedNext
+ if debugMatches {
+ println("prev long match (after short)")
+ }
+ break
+ }
+ }
+ t = coffsetS
+ if debugAsserts && s <= t {
+ panic(fmt.Sprintf("s (%d) <= t (%d)", s, t))
+ }
+ if debugAsserts && s-t > e.maxMatchOff {
+ panic("s - t >e.maxMatchOff")
+ }
+ if debugAsserts && t < 0 {
+ panic("t<0")
+ }
+ if debugMatches {
+ println("short match")
+ }
+ break
+ }
+
+ // No match found, move forward in input.
+ s += stepSize + ((s - nextEmit) >> (kSearchStrength - 1))
+ if s >= sLimit {
+ break encodeLoop
+ }
+ cv = load6432(src, s)
+ }
+ // Try to find a better match by searching for a long match at the end of the current best match
+ if s+matched < sLimit {
+ nextHashL := hashLen(load6432(src, s+matched), betterLongTableBits, betterLongLen)
+ cv := load3232(src, s)
+ candidateL := e.longTable[nextHashL]
+ coffsetL := candidateL.offset - e.cur - matched
+ if coffsetL >= 0 && coffsetL < s && s-coffsetL < e.maxMatchOff && cv == load3232(src, coffsetL) {
+ // Found a long match, at least 4 bytes.
+ matchedNext := e.matchlen(s+4, coffsetL+4, src) + 4
+ if matchedNext > matched {
+ t = coffsetL
+ matched = matchedNext
+ if debugMatches {
+ println("long match at end-of-match")
+ }
+ }
+ }
+
+ // Check prev long...
+ if true {
+ coffsetL = candidateL.prev - e.cur - matched
+ if coffsetL >= 0 && coffsetL < s && s-coffsetL < e.maxMatchOff && cv == load3232(src, coffsetL) {
+ // Found a long match, at least 4 bytes.
+ matchedNext := e.matchlen(s+4, coffsetL+4, src) + 4
+ if matchedNext > matched {
+ t = coffsetL
+ matched = matchedNext
+ if debugMatches {
+ println("prev long match at end-of-match")
+ }
+ }
+ }
+ }
+ }
+ // A match has been found. Update recent offsets.
+ offset2 = offset1
+ offset1 = s - t
+
+ if debugAsserts && s <= t {
+ panic(fmt.Sprintf("s (%d) <= t (%d)", s, t))
+ }
+
+ if debugAsserts && canRepeat && int(offset1) > len(src) {
+ panic("invalid offset")
+ }
+
+ // Extend the n-byte match as long as possible.
+ l := matched
+
+ // Extend backwards
+ tMin := s - e.maxMatchOff
+ if tMin < 0 {
+ tMin = 0
+ }
+ for t > tMin && s > nextEmit && src[t-1] == src[s-1] && l < maxMatchLength {
+ s--
+ t--
+ l++
+ }
+
+ // Write our sequence
+ var seq seq
+ seq.litLen = uint32(s - nextEmit)
+ seq.matchLen = uint32(l - zstdMinMatch)
+ if seq.litLen > 0 {
+ blk.literals = append(blk.literals, src[nextEmit:s]...)
+ }
+ seq.offset = uint32(s-t) + 3
+ s += l
+ if debugSequences {
+ println("sequence", seq, "next s:", s)
+ }
+ blk.sequences = append(blk.sequences, seq)
+ nextEmit = s
+ if s >= sLimit {
+ break encodeLoop
+ }
+
+ // Index match start+1 (long) -> s - 1
+ off := index0 + e.cur
+ for index0 < s-1 {
+ cv0 := load6432(src, index0)
+ cv1 := cv0 >> 8
+ h0 := hashLen(cv0, betterLongTableBits, betterLongLen)
+ e.longTable[h0] = prevEntry{offset: off, prev: e.longTable[h0].offset}
+ e.markLongShardDirty(h0)
+ h1 := hashLen(cv1, betterShortTableBits, betterShortLen)
+ e.table[h1] = tableEntry{offset: off + 1, val: uint32(cv1)}
+ e.markShortShardDirty(h1)
+ index0 += 2
+ off += 2
+ }
+
+ cv = load6432(src, s)
+ if !canRepeat {
+ continue
+ }
+
+ // Check offset 2
+ for {
+ o2 := s - offset2
+ if load3232(src, o2) != uint32(cv) {
+ // Do regular search
+ break
+ }
+
+ // Store this, since we have it.
+ nextHashL := hashLen(cv, betterLongTableBits, betterLongLen)
+ nextHashS := hashLen(cv, betterShortTableBits, betterShortLen)
+
+ // We have at least 4 byte match.
+ // No need to check backwards. We come straight from a match
+ l := 4 + e.matchlen(s+4, o2+4, src)
+
+ e.longTable[nextHashL] = prevEntry{offset: s + e.cur, prev: e.longTable[nextHashL].offset}
+ e.markLongShardDirty(nextHashL)
+ e.table[nextHashS] = tableEntry{offset: s + e.cur, val: uint32(cv)}
+ e.markShortShardDirty(nextHashS)
+ seq.matchLen = uint32(l) - zstdMinMatch
+ seq.litLen = 0
+
+ // Since litlen is always 0, this is offset 1.
+ seq.offset = 1
+ s += l
+ nextEmit = s
+ if debugSequences {
+ println("sequence", seq, "next s:", s)
+ }
+ blk.sequences = append(blk.sequences, seq)
+
+ // Swap offset 1 and 2.
+ offset1, offset2 = offset2, offset1
+ if s >= sLimit {
+ // Finished
+ break encodeLoop
+ }
+ cv = load6432(src, s)
+ }
+ }
+
+ if int(nextEmit) < len(src) {
+ blk.literals = append(blk.literals, src[nextEmit:]...)
+ blk.extraLits = len(src) - int(nextEmit)
+ }
+ blk.recentOffsets[0] = uint32(offset1)
+ blk.recentOffsets[1] = uint32(offset2)
+ if debugEncoder {
+ println("returning, recent offsets:", blk.recentOffsets, "extra literals:", blk.extraLits)
+ }
+}
+
+// ResetDict will reset and set a dictionary if not nil
+func (e *betterFastEncoder) Reset(d *dict, singleBlock bool) {
+ e.resetBase(d, singleBlock)
+ if d != nil {
+ panic("betterFastEncoder: Reset with dict")
+ }
+}
+
+// ResetDict will reset and set a dictionary if not nil
+func (e *betterFastEncoderDict) Reset(d *dict, singleBlock bool) {
+ e.resetBase(d, singleBlock)
+ if d == nil {
+ return
+ }
+ // Init or copy dict table
+ if len(e.dictTable) != len(e.table) || d.id != e.lastDictID {
+ if len(e.dictTable) != len(e.table) {
+ e.dictTable = make([]tableEntry, len(e.table))
+ }
+ end := int32(len(d.content)) - 8 + e.maxMatchOff
+ for i := e.maxMatchOff; i < end; i += 4 {
+ const hashLog = betterShortTableBits
+
+ cv := load6432(d.content, i-e.maxMatchOff)
+ nextHash := hashLen(cv, hashLog, betterShortLen) // 0 -> 4
+ nextHash1 := hashLen(cv>>8, hashLog, betterShortLen) // 1 -> 5
+ nextHash2 := hashLen(cv>>16, hashLog, betterShortLen) // 2 -> 6
+ nextHash3 := hashLen(cv>>24, hashLog, betterShortLen) // 3 -> 7
+ e.dictTable[nextHash] = tableEntry{
+ val: uint32(cv),
+ offset: i,
+ }
+ e.dictTable[nextHash1] = tableEntry{
+ val: uint32(cv >> 8),
+ offset: i + 1,
+ }
+ e.dictTable[nextHash2] = tableEntry{
+ val: uint32(cv >> 16),
+ offset: i + 2,
+ }
+ e.dictTable[nextHash3] = tableEntry{
+ val: uint32(cv >> 24),
+ offset: i + 3,
+ }
+ }
+ e.lastDictID = d.id
+ e.allDirty = true
+ }
+
+ // Init or copy dict table
+ if len(e.dictLongTable) != len(e.longTable) || d.id != e.lastDictID {
+ if len(e.dictLongTable) != len(e.longTable) {
+ e.dictLongTable = make([]prevEntry, len(e.longTable))
+ }
+ if len(d.content) >= 8 {
+ cv := load6432(d.content, 0)
+ h := hashLen(cv, betterLongTableBits, betterLongLen)
+ e.dictLongTable[h] = prevEntry{
+ offset: e.maxMatchOff,
+ prev: e.dictLongTable[h].offset,
+ }
+
+ end := int32(len(d.content)) - 8 + e.maxMatchOff
+ off := 8 // First to read
+ for i := e.maxMatchOff + 1; i < end; i++ {
+ cv = cv>>8 | (uint64(d.content[off]) << 56)
+ h := hashLen(cv, betterLongTableBits, betterLongLen)
+ e.dictLongTable[h] = prevEntry{
+ offset: i,
+ prev: e.dictLongTable[h].offset,
+ }
+ off++
+ }
+ }
+ e.lastDictID = d.id
+ e.allDirty = true
+ }
+
+ // Reset table to initial state
+ {
+ dirtyShardCnt := 0
+ if !e.allDirty {
+ for i := range e.shortTableShardDirty {
+ if e.shortTableShardDirty[i] {
+ dirtyShardCnt++
+ }
+ }
+ }
+ const shardCnt = betterShortTableShardCnt
+ const shardSize = betterShortTableShardSize
+ if e.allDirty || dirtyShardCnt > shardCnt*4/6 {
+ copy(e.table[:], e.dictTable)
+ for i := range e.shortTableShardDirty {
+ e.shortTableShardDirty[i] = false
+ }
+ } else {
+ for i := range e.shortTableShardDirty {
+ if !e.shortTableShardDirty[i] {
+ continue
+ }
+
+ copy(e.table[i*shardSize:(i+1)*shardSize], e.dictTable[i*shardSize:(i+1)*shardSize])
+ e.shortTableShardDirty[i] = false
+ }
+ }
+ }
+ {
+ dirtyShardCnt := 0
+ if !e.allDirty {
+ for i := range e.shortTableShardDirty {
+ if e.shortTableShardDirty[i] {
+ dirtyShardCnt++
+ }
+ }
+ }
+ const shardCnt = betterLongTableShardCnt
+ const shardSize = betterLongTableShardSize
+ if e.allDirty || dirtyShardCnt > shardCnt*4/6 {
+ copy(e.longTable[:], e.dictLongTable)
+ for i := range e.longTableShardDirty {
+ e.longTableShardDirty[i] = false
+ }
+ } else {
+ for i := range e.longTableShardDirty {
+ if !e.longTableShardDirty[i] {
+ continue
+ }
+
+ copy(e.longTable[i*shardSize:(i+1)*shardSize], e.dictLongTable[i*shardSize:(i+1)*shardSize])
+ e.longTableShardDirty[i] = false
+ }
+ }
+ }
+ e.cur = e.maxMatchOff
+ e.allDirty = false
+}
+
+func (e *betterFastEncoderDict) markLongShardDirty(entryNum uint32) {
+ e.longTableShardDirty[entryNum/betterLongTableShardSize] = true
+}
+
+func (e *betterFastEncoderDict) markShortShardDirty(entryNum uint32) {
+ e.shortTableShardDirty[entryNum/betterShortTableShardSize] = true
+}
diff --git a/vendor/github.com/klauspost/compress/zstd/enc_dfast.go b/vendor/github.com/klauspost/compress/zstd/enc_dfast.go
new file mode 100644
index 00000000..d36be7bd
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/enc_dfast.go
@@ -0,0 +1,1123 @@
+// Copyright 2019+ Klaus Post. All rights reserved.
+// License information can be found in the LICENSE file.
+// Based on work by Yann Collet, released under BSD License.
+
+package zstd
+
+import "fmt"
+
+const (
+ dFastLongTableBits = 17 // Bits used in the long match table
+ dFastLongTableSize = 1 << dFastLongTableBits // Size of the table
+ dFastLongTableMask = dFastLongTableSize - 1 // Mask for table indices. Redundant, but can eliminate bounds checks.
+ dFastLongLen = 8 // Bytes used for table hash
+
+ dLongTableShardCnt = 1 << (dFastLongTableBits - dictShardBits) // Number of shards in the table
+ dLongTableShardSize = dFastLongTableSize / tableShardCnt // Size of an individual shard
+
+ dFastShortTableBits = tableBits // Bits used in the short match table
+ dFastShortTableSize = 1 << dFastShortTableBits // Size of the table
+ dFastShortTableMask = dFastShortTableSize - 1 // Mask for table indices. Redundant, but can eliminate bounds checks.
+ dFastShortLen = 5 // Bytes used for table hash
+
+)
+
+type doubleFastEncoder struct {
+ fastEncoder
+ longTable [dFastLongTableSize]tableEntry
+}
+
+type doubleFastEncoderDict struct {
+ fastEncoderDict
+ longTable [dFastLongTableSize]tableEntry
+ dictLongTable []tableEntry
+ longTableShardDirty [dLongTableShardCnt]bool
+}
+
+// Encode mimmics functionality in zstd_dfast.c
+func (e *doubleFastEncoder) Encode(blk *blockEnc, src []byte) {
+ const (
+ // Input margin is the number of bytes we read (8)
+ // and the maximum we will read ahead (2)
+ inputMargin = 8 + 2
+ minNonLiteralBlockSize = 16
+ )
+
+ // Protect against e.cur wraparound.
+ for e.cur >= e.bufferReset-int32(len(e.hist)) {
+ if len(e.hist) == 0 {
+ e.table = [dFastShortTableSize]tableEntry{}
+ e.longTable = [dFastLongTableSize]tableEntry{}
+ e.cur = e.maxMatchOff
+ break
+ }
+ // Shift down everything in the table that isn't already too far away.
+ minOff := e.cur + int32(len(e.hist)) - e.maxMatchOff
+ for i := range e.table[:] {
+ v := e.table[i].offset
+ if v < minOff {
+ v = 0
+ } else {
+ v = v - e.cur + e.maxMatchOff
+ }
+ e.table[i].offset = v
+ }
+ for i := range e.longTable[:] {
+ v := e.longTable[i].offset
+ if v < minOff {
+ v = 0
+ } else {
+ v = v - e.cur + e.maxMatchOff
+ }
+ e.longTable[i].offset = v
+ }
+ e.cur = e.maxMatchOff
+ break
+ }
+
+ s := e.addBlock(src)
+ blk.size = len(src)
+ if len(src) < minNonLiteralBlockSize {
+ blk.extraLits = len(src)
+ blk.literals = blk.literals[:len(src)]
+ copy(blk.literals, src)
+ return
+ }
+
+ // Override src
+ src = e.hist
+ sLimit := int32(len(src)) - inputMargin
+ // stepSize is the number of bytes to skip on every main loop iteration.
+ // It should be >= 1.
+ const stepSize = 1
+
+ const kSearchStrength = 8
+
+ // nextEmit is where in src the next emitLiteral should start from.
+ nextEmit := s
+ cv := load6432(src, s)
+
+ // Relative offsets
+ offset1 := int32(blk.recentOffsets[0])
+ offset2 := int32(blk.recentOffsets[1])
+
+ addLiterals := func(s *seq, until int32) {
+ if until == nextEmit {
+ return
+ }
+ blk.literals = append(blk.literals, src[nextEmit:until]...)
+ s.litLen = uint32(until - nextEmit)
+ }
+ if debugEncoder {
+ println("recent offsets:", blk.recentOffsets)
+ }
+
+encodeLoop:
+ for {
+ var t int32
+ // We allow the encoder to optionally turn off repeat offsets across blocks
+ canRepeat := len(blk.sequences) > 2
+
+ for {
+ if debugAsserts && canRepeat && offset1 == 0 {
+ panic("offset0 was 0")
+ }
+
+ nextHashL := hashLen(cv, dFastLongTableBits, dFastLongLen)
+ nextHashS := hashLen(cv, dFastShortTableBits, dFastShortLen)
+ candidateL := e.longTable[nextHashL]
+ candidateS := e.table[nextHashS]
+
+ const repOff = 1
+ repIndex := s - offset1 + repOff
+ entry := tableEntry{offset: s + e.cur, val: uint32(cv)}
+ e.longTable[nextHashL] = entry
+ e.table[nextHashS] = entry
+
+ if canRepeat {
+ if repIndex >= 0 && load3232(src, repIndex) == uint32(cv>>(repOff*8)) {
+ // Consider history as well.
+ var seq seq
+ length := 4 + e.matchlen(s+4+repOff, repIndex+4, src)
+
+ seq.matchLen = uint32(length - zstdMinMatch)
+
+ // We might be able to match backwards.
+ // Extend as long as we can.
+ start := s + repOff
+ // We end the search early, so we don't risk 0 literals
+ // and have to do special offset treatment.
+ startLimit := nextEmit + 1
+
+ tMin := s - e.maxMatchOff
+ if tMin < 0 {
+ tMin = 0
+ }
+ for repIndex > tMin && start > startLimit && src[repIndex-1] == src[start-1] && seq.matchLen < maxMatchLength-zstdMinMatch-1 {
+ repIndex--
+ start--
+ seq.matchLen++
+ }
+ addLiterals(&seq, start)
+
+ // rep 0
+ seq.offset = 1
+ if debugSequences {
+ println("repeat sequence", seq, "next s:", s)
+ }
+ blk.sequences = append(blk.sequences, seq)
+ s += length + repOff
+ nextEmit = s
+ if s >= sLimit {
+ if debugEncoder {
+ println("repeat ended", s, length)
+
+ }
+ break encodeLoop
+ }
+ cv = load6432(src, s)
+ continue
+ }
+ }
+ // Find the offsets of our two matches.
+ coffsetL := s - (candidateL.offset - e.cur)
+ coffsetS := s - (candidateS.offset - e.cur)
+
+ // Check if we have a long match.
+ if coffsetL < e.maxMatchOff && uint32(cv) == candidateL.val {
+ // Found a long match, likely at least 8 bytes.
+ // Reference encoder checks all 8 bytes, we only check 4,
+ // but the likelihood of both the first 4 bytes and the hash matching should be enough.
+ t = candidateL.offset - e.cur
+ if debugAsserts && s <= t {
+ panic(fmt.Sprintf("s (%d) <= t (%d)", s, t))
+ }
+ if debugAsserts && s-t > e.maxMatchOff {
+ panic("s - t >e.maxMatchOff")
+ }
+ if debugMatches {
+ println("long match")
+ }
+ break
+ }
+
+ // Check if we have a short match.
+ if coffsetS < e.maxMatchOff && uint32(cv) == candidateS.val {
+ // found a regular match
+ // See if we can find a long match at s+1
+ const checkAt = 1
+ cv := load6432(src, s+checkAt)
+ nextHashL = hashLen(cv, dFastLongTableBits, dFastLongLen)
+ candidateL = e.longTable[nextHashL]
+ coffsetL = s - (candidateL.offset - e.cur) + checkAt
+
+ // We can store it, since we have at least a 4 byte match.
+ e.longTable[nextHashL] = tableEntry{offset: s + checkAt + e.cur, val: uint32(cv)}
+ if coffsetL < e.maxMatchOff && uint32(cv) == candidateL.val {
+ // Found a long match, likely at least 8 bytes.
+ // Reference encoder checks all 8 bytes, we only check 4,
+ // but the likelihood of both the first 4 bytes and the hash matching should be enough.
+ t = candidateL.offset - e.cur
+ s += checkAt
+ if debugMatches {
+ println("long match (after short)")
+ }
+ break
+ }
+
+ t = candidateS.offset - e.cur
+ if debugAsserts && s <= t {
+ panic(fmt.Sprintf("s (%d) <= t (%d)", s, t))
+ }
+ if debugAsserts && s-t > e.maxMatchOff {
+ panic("s - t >e.maxMatchOff")
+ }
+ if debugAsserts && t < 0 {
+ panic("t<0")
+ }
+ if debugMatches {
+ println("short match")
+ }
+ break
+ }
+
+ // No match found, move forward in input.
+ s += stepSize + ((s - nextEmit) >> (kSearchStrength - 1))
+ if s >= sLimit {
+ break encodeLoop
+ }
+ cv = load6432(src, s)
+ }
+
+ // A 4-byte match has been found. Update recent offsets.
+ // We'll later see if more than 4 bytes.
+ offset2 = offset1
+ offset1 = s - t
+
+ if debugAsserts && s <= t {
+ panic(fmt.Sprintf("s (%d) <= t (%d)", s, t))
+ }
+
+ if debugAsserts && canRepeat && int(offset1) > len(src) {
+ panic("invalid offset")
+ }
+
+ // Extend the 4-byte match as long as possible.
+ l := e.matchlen(s+4, t+4, src) + 4
+
+ // Extend backwards
+ tMin := s - e.maxMatchOff
+ if tMin < 0 {
+ tMin = 0
+ }
+ for t > tMin && s > nextEmit && src[t-1] == src[s-1] && l < maxMatchLength {
+ s--
+ t--
+ l++
+ }
+
+ // Write our sequence
+ var seq seq
+ seq.litLen = uint32(s - nextEmit)
+ seq.matchLen = uint32(l - zstdMinMatch)
+ if seq.litLen > 0 {
+ blk.literals = append(blk.literals, src[nextEmit:s]...)
+ }
+ seq.offset = uint32(s-t) + 3
+ s += l
+ if debugSequences {
+ println("sequence", seq, "next s:", s)
+ }
+ blk.sequences = append(blk.sequences, seq)
+ nextEmit = s
+ if s >= sLimit {
+ break encodeLoop
+ }
+
+ // Index match start+1 (long) and start+2 (short)
+ index0 := s - l + 1
+ // Index match end-2 (long) and end-1 (short)
+ index1 := s - 2
+
+ cv0 := load6432(src, index0)
+ cv1 := load6432(src, index1)
+ te0 := tableEntry{offset: index0 + e.cur, val: uint32(cv0)}
+ te1 := tableEntry{offset: index1 + e.cur, val: uint32(cv1)}
+ e.longTable[hashLen(cv0, dFastLongTableBits, dFastLongLen)] = te0
+ e.longTable[hashLen(cv1, dFastLongTableBits, dFastLongLen)] = te1
+ cv0 >>= 8
+ cv1 >>= 8
+ te0.offset++
+ te1.offset++
+ te0.val = uint32(cv0)
+ te1.val = uint32(cv1)
+ e.table[hashLen(cv0, dFastShortTableBits, dFastShortLen)] = te0
+ e.table[hashLen(cv1, dFastShortTableBits, dFastShortLen)] = te1
+
+ cv = load6432(src, s)
+
+ if !canRepeat {
+ continue
+ }
+
+ // Check offset 2
+ for {
+ o2 := s - offset2
+ if load3232(src, o2) != uint32(cv) {
+ // Do regular search
+ break
+ }
+
+ // Store this, since we have it.
+ nextHashS := hashLen(cv, dFastShortTableBits, dFastShortLen)
+ nextHashL := hashLen(cv, dFastLongTableBits, dFastLongLen)
+
+ // We have at least 4 byte match.
+ // No need to check backwards. We come straight from a match
+ l := 4 + e.matchlen(s+4, o2+4, src)
+
+ entry := tableEntry{offset: s + e.cur, val: uint32(cv)}
+ e.longTable[nextHashL] = entry
+ e.table[nextHashS] = entry
+ seq.matchLen = uint32(l) - zstdMinMatch
+ seq.litLen = 0
+
+ // Since litlen is always 0, this is offset 1.
+ seq.offset = 1
+ s += l
+ nextEmit = s
+ if debugSequences {
+ println("sequence", seq, "next s:", s)
+ }
+ blk.sequences = append(blk.sequences, seq)
+
+ // Swap offset 1 and 2.
+ offset1, offset2 = offset2, offset1
+ if s >= sLimit {
+ // Finished
+ break encodeLoop
+ }
+ cv = load6432(src, s)
+ }
+ }
+
+ if int(nextEmit) < len(src) {
+ blk.literals = append(blk.literals, src[nextEmit:]...)
+ blk.extraLits = len(src) - int(nextEmit)
+ }
+ blk.recentOffsets[0] = uint32(offset1)
+ blk.recentOffsets[1] = uint32(offset2)
+ if debugEncoder {
+ println("returning, recent offsets:", blk.recentOffsets, "extra literals:", blk.extraLits)
+ }
+}
+
+// EncodeNoHist will encode a block with no history and no following blocks.
+// Most notable difference is that src will not be copied for history and
+// we do not need to check for max match length.
+func (e *doubleFastEncoder) EncodeNoHist(blk *blockEnc, src []byte) {
+ const (
+ // Input margin is the number of bytes we read (8)
+ // and the maximum we will read ahead (2)
+ inputMargin = 8 + 2
+ minNonLiteralBlockSize = 16
+ )
+
+ // Protect against e.cur wraparound.
+ if e.cur >= e.bufferReset {
+ for i := range e.table[:] {
+ e.table[i] = tableEntry{}
+ }
+ for i := range e.longTable[:] {
+ e.longTable[i] = tableEntry{}
+ }
+ e.cur = e.maxMatchOff
+ }
+
+ s := int32(0)
+ blk.size = len(src)
+ if len(src) < minNonLiteralBlockSize {
+ blk.extraLits = len(src)
+ blk.literals = blk.literals[:len(src)]
+ copy(blk.literals, src)
+ return
+ }
+
+ // Override src
+ sLimit := int32(len(src)) - inputMargin
+ // stepSize is the number of bytes to skip on every main loop iteration.
+ // It should be >= 1.
+ const stepSize = 1
+
+ const kSearchStrength = 8
+
+ // nextEmit is where in src the next emitLiteral should start from.
+ nextEmit := s
+ cv := load6432(src, s)
+
+ // Relative offsets
+ offset1 := int32(blk.recentOffsets[0])
+ offset2 := int32(blk.recentOffsets[1])
+
+ addLiterals := func(s *seq, until int32) {
+ if until == nextEmit {
+ return
+ }
+ blk.literals = append(blk.literals, src[nextEmit:until]...)
+ s.litLen = uint32(until - nextEmit)
+ }
+ if debugEncoder {
+ println("recent offsets:", blk.recentOffsets)
+ }
+
+encodeLoop:
+ for {
+ var t int32
+ for {
+
+ nextHashL := hashLen(cv, dFastLongTableBits, dFastLongLen)
+ nextHashS := hashLen(cv, dFastShortTableBits, dFastShortLen)
+ candidateL := e.longTable[nextHashL]
+ candidateS := e.table[nextHashS]
+
+ const repOff = 1
+ repIndex := s - offset1 + repOff
+ entry := tableEntry{offset: s + e.cur, val: uint32(cv)}
+ e.longTable[nextHashL] = entry
+ e.table[nextHashS] = entry
+
+ if len(blk.sequences) > 2 {
+ if load3232(src, repIndex) == uint32(cv>>(repOff*8)) {
+ // Consider history as well.
+ var seq seq
+ //length := 4 + e.matchlen(s+4+repOff, repIndex+4, src)
+ length := 4 + int32(matchLen(src[s+4+repOff:], src[repIndex+4:]))
+
+ seq.matchLen = uint32(length - zstdMinMatch)
+
+ // We might be able to match backwards.
+ // Extend as long as we can.
+ start := s + repOff
+ // We end the search early, so we don't risk 0 literals
+ // and have to do special offset treatment.
+ startLimit := nextEmit + 1
+
+ tMin := s - e.maxMatchOff
+ if tMin < 0 {
+ tMin = 0
+ }
+ for repIndex > tMin && start > startLimit && src[repIndex-1] == src[start-1] {
+ repIndex--
+ start--
+ seq.matchLen++
+ }
+ addLiterals(&seq, start)
+
+ // rep 0
+ seq.offset = 1
+ if debugSequences {
+ println("repeat sequence", seq, "next s:", s)
+ }
+ blk.sequences = append(blk.sequences, seq)
+ s += length + repOff
+ nextEmit = s
+ if s >= sLimit {
+ if debugEncoder {
+ println("repeat ended", s, length)
+
+ }
+ break encodeLoop
+ }
+ cv = load6432(src, s)
+ continue
+ }
+ }
+ // Find the offsets of our two matches.
+ coffsetL := s - (candidateL.offset - e.cur)
+ coffsetS := s - (candidateS.offset - e.cur)
+
+ // Check if we have a long match.
+ if coffsetL < e.maxMatchOff && uint32(cv) == candidateL.val {
+ // Found a long match, likely at least 8 bytes.
+ // Reference encoder checks all 8 bytes, we only check 4,
+ // but the likelihood of both the first 4 bytes and the hash matching should be enough.
+ t = candidateL.offset - e.cur
+ if debugAsserts && s <= t {
+ panic(fmt.Sprintf("s (%d) <= t (%d). cur: %d", s, t, e.cur))
+ }
+ if debugAsserts && s-t > e.maxMatchOff {
+ panic("s - t >e.maxMatchOff")
+ }
+ if debugMatches {
+ println("long match")
+ }
+ break
+ }
+
+ // Check if we have a short match.
+ if coffsetS < e.maxMatchOff && uint32(cv) == candidateS.val {
+ // found a regular match
+ // See if we can find a long match at s+1
+ const checkAt = 1
+ cv := load6432(src, s+checkAt)
+ nextHashL = hashLen(cv, dFastLongTableBits, dFastLongLen)
+ candidateL = e.longTable[nextHashL]
+ coffsetL = s - (candidateL.offset - e.cur) + checkAt
+
+ // We can store it, since we have at least a 4 byte match.
+ e.longTable[nextHashL] = tableEntry{offset: s + checkAt + e.cur, val: uint32(cv)}
+ if coffsetL < e.maxMatchOff && uint32(cv) == candidateL.val {
+ // Found a long match, likely at least 8 bytes.
+ // Reference encoder checks all 8 bytes, we only check 4,
+ // but the likelihood of both the first 4 bytes and the hash matching should be enough.
+ t = candidateL.offset - e.cur
+ s += checkAt
+ if debugMatches {
+ println("long match (after short)")
+ }
+ break
+ }
+
+ t = candidateS.offset - e.cur
+ if debugAsserts && s <= t {
+ panic(fmt.Sprintf("s (%d) <= t (%d)", s, t))
+ }
+ if debugAsserts && s-t > e.maxMatchOff {
+ panic("s - t >e.maxMatchOff")
+ }
+ if debugAsserts && t < 0 {
+ panic("t<0")
+ }
+ if debugMatches {
+ println("short match")
+ }
+ break
+ }
+
+ // No match found, move forward in input.
+ s += stepSize + ((s - nextEmit) >> (kSearchStrength - 1))
+ if s >= sLimit {
+ break encodeLoop
+ }
+ cv = load6432(src, s)
+ }
+
+ // A 4-byte match has been found. Update recent offsets.
+ // We'll later see if more than 4 bytes.
+ offset2 = offset1
+ offset1 = s - t
+
+ if debugAsserts && s <= t {
+ panic(fmt.Sprintf("s (%d) <= t (%d)", s, t))
+ }
+
+ // Extend the 4-byte match as long as possible.
+ //l := e.matchlen(s+4, t+4, src) + 4
+ l := int32(matchLen(src[s+4:], src[t+4:])) + 4
+
+ // Extend backwards
+ tMin := s - e.maxMatchOff
+ if tMin < 0 {
+ tMin = 0
+ }
+ for t > tMin && s > nextEmit && src[t-1] == src[s-1] {
+ s--
+ t--
+ l++
+ }
+
+ // Write our sequence
+ var seq seq
+ seq.litLen = uint32(s - nextEmit)
+ seq.matchLen = uint32(l - zstdMinMatch)
+ if seq.litLen > 0 {
+ blk.literals = append(blk.literals, src[nextEmit:s]...)
+ }
+ seq.offset = uint32(s-t) + 3
+ s += l
+ if debugSequences {
+ println("sequence", seq, "next s:", s)
+ }
+ blk.sequences = append(blk.sequences, seq)
+ nextEmit = s
+ if s >= sLimit {
+ break encodeLoop
+ }
+
+ // Index match start+1 (long) and start+2 (short)
+ index0 := s - l + 1
+ // Index match end-2 (long) and end-1 (short)
+ index1 := s - 2
+
+ cv0 := load6432(src, index0)
+ cv1 := load6432(src, index1)
+ te0 := tableEntry{offset: index0 + e.cur, val: uint32(cv0)}
+ te1 := tableEntry{offset: index1 + e.cur, val: uint32(cv1)}
+ e.longTable[hashLen(cv0, dFastLongTableBits, dFastLongLen)] = te0
+ e.longTable[hashLen(cv1, dFastLongTableBits, dFastLongLen)] = te1
+ cv0 >>= 8
+ cv1 >>= 8
+ te0.offset++
+ te1.offset++
+ te0.val = uint32(cv0)
+ te1.val = uint32(cv1)
+ e.table[hashLen(cv0, dFastShortTableBits, dFastShortLen)] = te0
+ e.table[hashLen(cv1, dFastShortTableBits, dFastShortLen)] = te1
+
+ cv = load6432(src, s)
+
+ if len(blk.sequences) <= 2 {
+ continue
+ }
+
+ // Check offset 2
+ for {
+ o2 := s - offset2
+ if load3232(src, o2) != uint32(cv) {
+ // Do regular search
+ break
+ }
+
+ // Store this, since we have it.
+ nextHashS := hashLen(cv1>>8, dFastShortTableBits, dFastShortLen)
+ nextHashL := hashLen(cv, dFastLongTableBits, dFastLongLen)
+
+ // We have at least 4 byte match.
+ // No need to check backwards. We come straight from a match
+ //l := 4 + e.matchlen(s+4, o2+4, src)
+ l := 4 + int32(matchLen(src[s+4:], src[o2+4:]))
+
+ entry := tableEntry{offset: s + e.cur, val: uint32(cv)}
+ e.longTable[nextHashL] = entry
+ e.table[nextHashS] = entry
+ seq.matchLen = uint32(l) - zstdMinMatch
+ seq.litLen = 0
+
+ // Since litlen is always 0, this is offset 1.
+ seq.offset = 1
+ s += l
+ nextEmit = s
+ if debugSequences {
+ println("sequence", seq, "next s:", s)
+ }
+ blk.sequences = append(blk.sequences, seq)
+
+ // Swap offset 1 and 2.
+ offset1, offset2 = offset2, offset1
+ if s >= sLimit {
+ // Finished
+ break encodeLoop
+ }
+ cv = load6432(src, s)
+ }
+ }
+
+ if int(nextEmit) < len(src) {
+ blk.literals = append(blk.literals, src[nextEmit:]...)
+ blk.extraLits = len(src) - int(nextEmit)
+ }
+ if debugEncoder {
+ println("returning, recent offsets:", blk.recentOffsets, "extra literals:", blk.extraLits)
+ }
+
+ // We do not store history, so we must offset e.cur to avoid false matches for next user.
+ if e.cur < e.bufferReset {
+ e.cur += int32(len(src))
+ }
+}
+
+// Encode will encode the content, with a dictionary if initialized for it.
+func (e *doubleFastEncoderDict) Encode(blk *blockEnc, src []byte) {
+ const (
+ // Input margin is the number of bytes we read (8)
+ // and the maximum we will read ahead (2)
+ inputMargin = 8 + 2
+ minNonLiteralBlockSize = 16
+ )
+
+ // Protect against e.cur wraparound.
+ for e.cur >= e.bufferReset-int32(len(e.hist)) {
+ if len(e.hist) == 0 {
+ for i := range e.table[:] {
+ e.table[i] = tableEntry{}
+ }
+ for i := range e.longTable[:] {
+ e.longTable[i] = tableEntry{}
+ }
+ e.markAllShardsDirty()
+ e.cur = e.maxMatchOff
+ break
+ }
+ // Shift down everything in the table that isn't already too far away.
+ minOff := e.cur + int32(len(e.hist)) - e.maxMatchOff
+ for i := range e.table[:] {
+ v := e.table[i].offset
+ if v < minOff {
+ v = 0
+ } else {
+ v = v - e.cur + e.maxMatchOff
+ }
+ e.table[i].offset = v
+ }
+ for i := range e.longTable[:] {
+ v := e.longTable[i].offset
+ if v < minOff {
+ v = 0
+ } else {
+ v = v - e.cur + e.maxMatchOff
+ }
+ e.longTable[i].offset = v
+ }
+ e.markAllShardsDirty()
+ e.cur = e.maxMatchOff
+ break
+ }
+
+ s := e.addBlock(src)
+ blk.size = len(src)
+ if len(src) < minNonLiteralBlockSize {
+ blk.extraLits = len(src)
+ blk.literals = blk.literals[:len(src)]
+ copy(blk.literals, src)
+ return
+ }
+
+ // Override src
+ src = e.hist
+ sLimit := int32(len(src)) - inputMargin
+ // stepSize is the number of bytes to skip on every main loop iteration.
+ // It should be >= 1.
+ const stepSize = 1
+
+ const kSearchStrength = 8
+
+ // nextEmit is where in src the next emitLiteral should start from.
+ nextEmit := s
+ cv := load6432(src, s)
+
+ // Relative offsets
+ offset1 := int32(blk.recentOffsets[0])
+ offset2 := int32(blk.recentOffsets[1])
+
+ addLiterals := func(s *seq, until int32) {
+ if until == nextEmit {
+ return
+ }
+ blk.literals = append(blk.literals, src[nextEmit:until]...)
+ s.litLen = uint32(until - nextEmit)
+ }
+ if debugEncoder {
+ println("recent offsets:", blk.recentOffsets)
+ }
+
+encodeLoop:
+ for {
+ var t int32
+ // We allow the encoder to optionally turn off repeat offsets across blocks
+ canRepeat := len(blk.sequences) > 2
+
+ for {
+ if debugAsserts && canRepeat && offset1 == 0 {
+ panic("offset0 was 0")
+ }
+
+ nextHashL := hashLen(cv, dFastLongTableBits, dFastLongLen)
+ nextHashS := hashLen(cv, dFastShortTableBits, dFastShortLen)
+ candidateL := e.longTable[nextHashL]
+ candidateS := e.table[nextHashS]
+
+ const repOff = 1
+ repIndex := s - offset1 + repOff
+ entry := tableEntry{offset: s + e.cur, val: uint32(cv)}
+ e.longTable[nextHashL] = entry
+ e.markLongShardDirty(nextHashL)
+ e.table[nextHashS] = entry
+ e.markShardDirty(nextHashS)
+
+ if canRepeat {
+ if repIndex >= 0 && load3232(src, repIndex) == uint32(cv>>(repOff*8)) {
+ // Consider history as well.
+ var seq seq
+ length := 4 + e.matchlen(s+4+repOff, repIndex+4, src)
+
+ seq.matchLen = uint32(length - zstdMinMatch)
+
+ // We might be able to match backwards.
+ // Extend as long as we can.
+ start := s + repOff
+ // We end the search early, so we don't risk 0 literals
+ // and have to do special offset treatment.
+ startLimit := nextEmit + 1
+
+ tMin := s - e.maxMatchOff
+ if tMin < 0 {
+ tMin = 0
+ }
+ for repIndex > tMin && start > startLimit && src[repIndex-1] == src[start-1] && seq.matchLen < maxMatchLength-zstdMinMatch-1 {
+ repIndex--
+ start--
+ seq.matchLen++
+ }
+ addLiterals(&seq, start)
+
+ // rep 0
+ seq.offset = 1
+ if debugSequences {
+ println("repeat sequence", seq, "next s:", s)
+ }
+ blk.sequences = append(blk.sequences, seq)
+ s += length + repOff
+ nextEmit = s
+ if s >= sLimit {
+ if debugEncoder {
+ println("repeat ended", s, length)
+
+ }
+ break encodeLoop
+ }
+ cv = load6432(src, s)
+ continue
+ }
+ }
+ // Find the offsets of our two matches.
+ coffsetL := s - (candidateL.offset - e.cur)
+ coffsetS := s - (candidateS.offset - e.cur)
+
+ // Check if we have a long match.
+ if coffsetL < e.maxMatchOff && uint32(cv) == candidateL.val {
+ // Found a long match, likely at least 8 bytes.
+ // Reference encoder checks all 8 bytes, we only check 4,
+ // but the likelihood of both the first 4 bytes and the hash matching should be enough.
+ t = candidateL.offset - e.cur
+ if debugAsserts && s <= t {
+ panic(fmt.Sprintf("s (%d) <= t (%d)", s, t))
+ }
+ if debugAsserts && s-t > e.maxMatchOff {
+ panic("s - t >e.maxMatchOff")
+ }
+ if debugMatches {
+ println("long match")
+ }
+ break
+ }
+
+ // Check if we have a short match.
+ if coffsetS < e.maxMatchOff && uint32(cv) == candidateS.val {
+ // found a regular match
+ // See if we can find a long match at s+1
+ const checkAt = 1
+ cv := load6432(src, s+checkAt)
+ nextHashL = hashLen(cv, dFastLongTableBits, dFastLongLen)
+ candidateL = e.longTable[nextHashL]
+ coffsetL = s - (candidateL.offset - e.cur) + checkAt
+
+ // We can store it, since we have at least a 4 byte match.
+ e.longTable[nextHashL] = tableEntry{offset: s + checkAt + e.cur, val: uint32(cv)}
+ e.markLongShardDirty(nextHashL)
+ if coffsetL < e.maxMatchOff && uint32(cv) == candidateL.val {
+ // Found a long match, likely at least 8 bytes.
+ // Reference encoder checks all 8 bytes, we only check 4,
+ // but the likelihood of both the first 4 bytes and the hash matching should be enough.
+ t = candidateL.offset - e.cur
+ s += checkAt
+ if debugMatches {
+ println("long match (after short)")
+ }
+ break
+ }
+
+ t = candidateS.offset - e.cur
+ if debugAsserts && s <= t {
+ panic(fmt.Sprintf("s (%d) <= t (%d)", s, t))
+ }
+ if debugAsserts && s-t > e.maxMatchOff {
+ panic("s - t >e.maxMatchOff")
+ }
+ if debugAsserts && t < 0 {
+ panic("t<0")
+ }
+ if debugMatches {
+ println("short match")
+ }
+ break
+ }
+
+ // No match found, move forward in input.
+ s += stepSize + ((s - nextEmit) >> (kSearchStrength - 1))
+ if s >= sLimit {
+ break encodeLoop
+ }
+ cv = load6432(src, s)
+ }
+
+ // A 4-byte match has been found. Update recent offsets.
+ // We'll later see if more than 4 bytes.
+ offset2 = offset1
+ offset1 = s - t
+
+ if debugAsserts && s <= t {
+ panic(fmt.Sprintf("s (%d) <= t (%d)", s, t))
+ }
+
+ if debugAsserts && canRepeat && int(offset1) > len(src) {
+ panic("invalid offset")
+ }
+
+ // Extend the 4-byte match as long as possible.
+ l := e.matchlen(s+4, t+4, src) + 4
+
+ // Extend backwards
+ tMin := s - e.maxMatchOff
+ if tMin < 0 {
+ tMin = 0
+ }
+ for t > tMin && s > nextEmit && src[t-1] == src[s-1] && l < maxMatchLength {
+ s--
+ t--
+ l++
+ }
+
+ // Write our sequence
+ var seq seq
+ seq.litLen = uint32(s - nextEmit)
+ seq.matchLen = uint32(l - zstdMinMatch)
+ if seq.litLen > 0 {
+ blk.literals = append(blk.literals, src[nextEmit:s]...)
+ }
+ seq.offset = uint32(s-t) + 3
+ s += l
+ if debugSequences {
+ println("sequence", seq, "next s:", s)
+ }
+ blk.sequences = append(blk.sequences, seq)
+ nextEmit = s
+ if s >= sLimit {
+ break encodeLoop
+ }
+
+ // Index match start+1 (long) and start+2 (short)
+ index0 := s - l + 1
+ // Index match end-2 (long) and end-1 (short)
+ index1 := s - 2
+
+ cv0 := load6432(src, index0)
+ cv1 := load6432(src, index1)
+ te0 := tableEntry{offset: index0 + e.cur, val: uint32(cv0)}
+ te1 := tableEntry{offset: index1 + e.cur, val: uint32(cv1)}
+ longHash1 := hashLen(cv0, dFastLongTableBits, dFastLongLen)
+ longHash2 := hashLen(cv1, dFastLongTableBits, dFastLongLen)
+ e.longTable[longHash1] = te0
+ e.longTable[longHash2] = te1
+ e.markLongShardDirty(longHash1)
+ e.markLongShardDirty(longHash2)
+ cv0 >>= 8
+ cv1 >>= 8
+ te0.offset++
+ te1.offset++
+ te0.val = uint32(cv0)
+ te1.val = uint32(cv1)
+ hashVal1 := hashLen(cv0, dFastShortTableBits, dFastShortLen)
+ hashVal2 := hashLen(cv1, dFastShortTableBits, dFastShortLen)
+ e.table[hashVal1] = te0
+ e.markShardDirty(hashVal1)
+ e.table[hashVal2] = te1
+ e.markShardDirty(hashVal2)
+
+ cv = load6432(src, s)
+
+ if !canRepeat {
+ continue
+ }
+
+ // Check offset 2
+ for {
+ o2 := s - offset2
+ if load3232(src, o2) != uint32(cv) {
+ // Do regular search
+ break
+ }
+
+ // Store this, since we have it.
+ nextHashL := hashLen(cv, dFastLongTableBits, dFastLongLen)
+ nextHashS := hashLen(cv, dFastShortTableBits, dFastShortLen)
+
+ // We have at least 4 byte match.
+ // No need to check backwards. We come straight from a match
+ l := 4 + e.matchlen(s+4, o2+4, src)
+
+ entry := tableEntry{offset: s + e.cur, val: uint32(cv)}
+ e.longTable[nextHashL] = entry
+ e.markLongShardDirty(nextHashL)
+ e.table[nextHashS] = entry
+ e.markShardDirty(nextHashS)
+ seq.matchLen = uint32(l) - zstdMinMatch
+ seq.litLen = 0
+
+ // Since litlen is always 0, this is offset 1.
+ seq.offset = 1
+ s += l
+ nextEmit = s
+ if debugSequences {
+ println("sequence", seq, "next s:", s)
+ }
+ blk.sequences = append(blk.sequences, seq)
+
+ // Swap offset 1 and 2.
+ offset1, offset2 = offset2, offset1
+ if s >= sLimit {
+ // Finished
+ break encodeLoop
+ }
+ cv = load6432(src, s)
+ }
+ }
+
+ if int(nextEmit) < len(src) {
+ blk.literals = append(blk.literals, src[nextEmit:]...)
+ blk.extraLits = len(src) - int(nextEmit)
+ }
+ blk.recentOffsets[0] = uint32(offset1)
+ blk.recentOffsets[1] = uint32(offset2)
+ if debugEncoder {
+ println("returning, recent offsets:", blk.recentOffsets, "extra literals:", blk.extraLits)
+ }
+ // If we encoded more than 64K mark all dirty.
+ if len(src) > 64<<10 {
+ e.markAllShardsDirty()
+ }
+}
+
+// ResetDict will reset and set a dictionary if not nil
+func (e *doubleFastEncoder) Reset(d *dict, singleBlock bool) {
+ e.fastEncoder.Reset(d, singleBlock)
+ if d != nil {
+ panic("doubleFastEncoder: Reset with dict not supported")
+ }
+}
+
+// ResetDict will reset and set a dictionary if not nil
+func (e *doubleFastEncoderDict) Reset(d *dict, singleBlock bool) {
+ allDirty := e.allDirty
+ e.fastEncoderDict.Reset(d, singleBlock)
+ if d == nil {
+ return
+ }
+
+ // Init or copy dict table
+ if len(e.dictLongTable) != len(e.longTable) || d.id != e.lastDictID {
+ if len(e.dictLongTable) != len(e.longTable) {
+ e.dictLongTable = make([]tableEntry, len(e.longTable))
+ }
+ if len(d.content) >= 8 {
+ cv := load6432(d.content, 0)
+ e.dictLongTable[hashLen(cv, dFastLongTableBits, dFastLongLen)] = tableEntry{
+ val: uint32(cv),
+ offset: e.maxMatchOff,
+ }
+ end := int32(len(d.content)) - 8 + e.maxMatchOff
+ for i := e.maxMatchOff + 1; i < end; i++ {
+ cv = cv>>8 | (uint64(d.content[i-e.maxMatchOff+7]) << 56)
+ e.dictLongTable[hashLen(cv, dFastLongTableBits, dFastLongLen)] = tableEntry{
+ val: uint32(cv),
+ offset: i,
+ }
+ }
+ }
+ e.lastDictID = d.id
+ allDirty = true
+ }
+ // Reset table to initial state
+ e.cur = e.maxMatchOff
+
+ dirtyShardCnt := 0
+ if !allDirty {
+ for i := range e.longTableShardDirty {
+ if e.longTableShardDirty[i] {
+ dirtyShardCnt++
+ }
+ }
+ }
+
+ if allDirty || dirtyShardCnt > dLongTableShardCnt/2 {
+ //copy(e.longTable[:], e.dictLongTable)
+ e.longTable = *(*[dFastLongTableSize]tableEntry)(e.dictLongTable)
+ for i := range e.longTableShardDirty {
+ e.longTableShardDirty[i] = false
+ }
+ return
+ }
+ for i := range e.longTableShardDirty {
+ if !e.longTableShardDirty[i] {
+ continue
+ }
+
+ // copy(e.longTable[i*dLongTableShardSize:(i+1)*dLongTableShardSize], e.dictLongTable[i*dLongTableShardSize:(i+1)*dLongTableShardSize])
+ *(*[dLongTableShardSize]tableEntry)(e.longTable[i*dLongTableShardSize:]) = *(*[dLongTableShardSize]tableEntry)(e.dictLongTable[i*dLongTableShardSize:])
+
+ e.longTableShardDirty[i] = false
+ }
+}
+
+func (e *doubleFastEncoderDict) markLongShardDirty(entryNum uint32) {
+ e.longTableShardDirty[entryNum/dLongTableShardSize] = true
+}
diff --git a/vendor/github.com/klauspost/compress/zstd/enc_fast.go b/vendor/github.com/klauspost/compress/zstd/enc_fast.go
new file mode 100644
index 00000000..f45a3da7
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/enc_fast.go
@@ -0,0 +1,891 @@
+// Copyright 2019+ Klaus Post. All rights reserved.
+// License information can be found in the LICENSE file.
+// Based on work by Yann Collet, released under BSD License.
+
+package zstd
+
+import (
+ "fmt"
+)
+
+const (
+ tableBits = 15 // Bits used in the table
+ tableSize = 1 << tableBits // Size of the table
+ tableShardCnt = 1 << (tableBits - dictShardBits) // Number of shards in the table
+ tableShardSize = tableSize / tableShardCnt // Size of an individual shard
+ tableFastHashLen = 6
+ tableMask = tableSize - 1 // Mask for table indices. Redundant, but can eliminate bounds checks.
+ maxMatchLength = 131074
+)
+
+type tableEntry struct {
+ val uint32
+ offset int32
+}
+
+type fastEncoder struct {
+ fastBase
+ table [tableSize]tableEntry
+}
+
+type fastEncoderDict struct {
+ fastEncoder
+ dictTable []tableEntry
+ tableShardDirty [tableShardCnt]bool
+ allDirty bool
+}
+
+// Encode mimmics functionality in zstd_fast.c
+func (e *fastEncoder) Encode(blk *blockEnc, src []byte) {
+ const (
+ inputMargin = 8
+ minNonLiteralBlockSize = 1 + 1 + inputMargin
+ )
+
+ // Protect against e.cur wraparound.
+ for e.cur >= e.bufferReset-int32(len(e.hist)) {
+ if len(e.hist) == 0 {
+ for i := range e.table[:] {
+ e.table[i] = tableEntry{}
+ }
+ e.cur = e.maxMatchOff
+ break
+ }
+ // Shift down everything in the table that isn't already too far away.
+ minOff := e.cur + int32(len(e.hist)) - e.maxMatchOff
+ for i := range e.table[:] {
+ v := e.table[i].offset
+ if v < minOff {
+ v = 0
+ } else {
+ v = v - e.cur + e.maxMatchOff
+ }
+ e.table[i].offset = v
+ }
+ e.cur = e.maxMatchOff
+ break
+ }
+
+ s := e.addBlock(src)
+ blk.size = len(src)
+ if len(src) < minNonLiteralBlockSize {
+ blk.extraLits = len(src)
+ blk.literals = blk.literals[:len(src)]
+ copy(blk.literals, src)
+ return
+ }
+
+ // Override src
+ src = e.hist
+ sLimit := int32(len(src)) - inputMargin
+ // stepSize is the number of bytes to skip on every main loop iteration.
+ // It should be >= 2.
+ const stepSize = 2
+
+ // TEMPLATE
+ const hashLog = tableBits
+ // seems global, but would be nice to tweak.
+ const kSearchStrength = 6
+
+ // nextEmit is where in src the next emitLiteral should start from.
+ nextEmit := s
+ cv := load6432(src, s)
+
+ // Relative offsets
+ offset1 := int32(blk.recentOffsets[0])
+ offset2 := int32(blk.recentOffsets[1])
+
+ addLiterals := func(s *seq, until int32) {
+ if until == nextEmit {
+ return
+ }
+ blk.literals = append(blk.literals, src[nextEmit:until]...)
+ s.litLen = uint32(until - nextEmit)
+ }
+ if debugEncoder {
+ println("recent offsets:", blk.recentOffsets)
+ }
+
+encodeLoop:
+ for {
+ // t will contain the match offset when we find one.
+ // When existing the search loop, we have already checked 4 bytes.
+ var t int32
+
+ // We will not use repeat offsets across blocks.
+ // By not using them for the first 3 matches
+ canRepeat := len(blk.sequences) > 2
+
+ for {
+ if debugAsserts && canRepeat && offset1 == 0 {
+ panic("offset0 was 0")
+ }
+
+ nextHash := hashLen(cv, hashLog, tableFastHashLen)
+ nextHash2 := hashLen(cv>>8, hashLog, tableFastHashLen)
+ candidate := e.table[nextHash]
+ candidate2 := e.table[nextHash2]
+ repIndex := s - offset1 + 2
+
+ e.table[nextHash] = tableEntry{offset: s + e.cur, val: uint32(cv)}
+ e.table[nextHash2] = tableEntry{offset: s + e.cur + 1, val: uint32(cv >> 8)}
+
+ if canRepeat && repIndex >= 0 && load3232(src, repIndex) == uint32(cv>>16) {
+ // Consider history as well.
+ var seq seq
+ length := 4 + e.matchlen(s+6, repIndex+4, src)
+ seq.matchLen = uint32(length - zstdMinMatch)
+
+ // We might be able to match backwards.
+ // Extend as long as we can.
+ start := s + 2
+ // We end the search early, so we don't risk 0 literals
+ // and have to do special offset treatment.
+ startLimit := nextEmit + 1
+
+ sMin := s - e.maxMatchOff
+ if sMin < 0 {
+ sMin = 0
+ }
+ for repIndex > sMin && start > startLimit && src[repIndex-1] == src[start-1] && seq.matchLen < maxMatchLength-zstdMinMatch {
+ repIndex--
+ start--
+ seq.matchLen++
+ }
+ addLiterals(&seq, start)
+
+ // rep 0
+ seq.offset = 1
+ if debugSequences {
+ println("repeat sequence", seq, "next s:", s)
+ }
+ blk.sequences = append(blk.sequences, seq)
+ s += length + 2
+ nextEmit = s
+ if s >= sLimit {
+ if debugEncoder {
+ println("repeat ended", s, length)
+
+ }
+ break encodeLoop
+ }
+ cv = load6432(src, s)
+ continue
+ }
+ coffset0 := s - (candidate.offset - e.cur)
+ coffset1 := s - (candidate2.offset - e.cur) + 1
+ if coffset0 < e.maxMatchOff && uint32(cv) == candidate.val {
+ // found a regular match
+ t = candidate.offset - e.cur
+ if debugAsserts && s <= t {
+ panic(fmt.Sprintf("s (%d) <= t (%d)", s, t))
+ }
+ if debugAsserts && s-t > e.maxMatchOff {
+ panic("s - t >e.maxMatchOff")
+ }
+ break
+ }
+
+ if coffset1 < e.maxMatchOff && uint32(cv>>8) == candidate2.val {
+ // found a regular match
+ t = candidate2.offset - e.cur
+ s++
+ if debugAsserts && s <= t {
+ panic(fmt.Sprintf("s (%d) <= t (%d)", s, t))
+ }
+ if debugAsserts && s-t > e.maxMatchOff {
+ panic("s - t >e.maxMatchOff")
+ }
+ if debugAsserts && t < 0 {
+ panic("t<0")
+ }
+ break
+ }
+ s += stepSize + ((s - nextEmit) >> (kSearchStrength - 1))
+ if s >= sLimit {
+ break encodeLoop
+ }
+ cv = load6432(src, s)
+ }
+ // A 4-byte match has been found. We'll later see if more than 4 bytes.
+ offset2 = offset1
+ offset1 = s - t
+
+ if debugAsserts && s <= t {
+ panic(fmt.Sprintf("s (%d) <= t (%d)", s, t))
+ }
+
+ if debugAsserts && canRepeat && int(offset1) > len(src) {
+ panic("invalid offset")
+ }
+
+ // Extend the 4-byte match as long as possible.
+ l := e.matchlen(s+4, t+4, src) + 4
+
+ // Extend backwards
+ tMin := s - e.maxMatchOff
+ if tMin < 0 {
+ tMin = 0
+ }
+ for t > tMin && s > nextEmit && src[t-1] == src[s-1] && l < maxMatchLength {
+ s--
+ t--
+ l++
+ }
+
+ // Write our sequence.
+ var seq seq
+ seq.litLen = uint32(s - nextEmit)
+ seq.matchLen = uint32(l - zstdMinMatch)
+ if seq.litLen > 0 {
+ blk.literals = append(blk.literals, src[nextEmit:s]...)
+ }
+ // Don't use repeat offsets
+ seq.offset = uint32(s-t) + 3
+ s += l
+ if debugSequences {
+ println("sequence", seq, "next s:", s)
+ }
+ blk.sequences = append(blk.sequences, seq)
+ nextEmit = s
+ if s >= sLimit {
+ break encodeLoop
+ }
+ cv = load6432(src, s)
+
+ // Check offset 2
+ if o2 := s - offset2; canRepeat && load3232(src, o2) == uint32(cv) {
+ // We have at least 4 byte match.
+ // No need to check backwards. We come straight from a match
+ l := 4 + e.matchlen(s+4, o2+4, src)
+
+ // Store this, since we have it.
+ nextHash := hashLen(cv, hashLog, tableFastHashLen)
+ e.table[nextHash] = tableEntry{offset: s + e.cur, val: uint32(cv)}
+ seq.matchLen = uint32(l) - zstdMinMatch
+ seq.litLen = 0
+ // Since litlen is always 0, this is offset 1.
+ seq.offset = 1
+ s += l
+ nextEmit = s
+ if debugSequences {
+ println("sequence", seq, "next s:", s)
+ }
+ blk.sequences = append(blk.sequences, seq)
+
+ // Swap offset 1 and 2.
+ offset1, offset2 = offset2, offset1
+ if s >= sLimit {
+ break encodeLoop
+ }
+ // Prepare next loop.
+ cv = load6432(src, s)
+ }
+ }
+
+ if int(nextEmit) < len(src) {
+ blk.literals = append(blk.literals, src[nextEmit:]...)
+ blk.extraLits = len(src) - int(nextEmit)
+ }
+ blk.recentOffsets[0] = uint32(offset1)
+ blk.recentOffsets[1] = uint32(offset2)
+ if debugEncoder {
+ println("returning, recent offsets:", blk.recentOffsets, "extra literals:", blk.extraLits)
+ }
+}
+
+// EncodeNoHist will encode a block with no history and no following blocks.
+// Most notable difference is that src will not be copied for history and
+// we do not need to check for max match length.
+func (e *fastEncoder) EncodeNoHist(blk *blockEnc, src []byte) {
+ const (
+ inputMargin = 8
+ minNonLiteralBlockSize = 1 + 1 + inputMargin
+ )
+ if debugEncoder {
+ if len(src) > maxCompressedBlockSize {
+ panic("src too big")
+ }
+ }
+
+ // Protect against e.cur wraparound.
+ if e.cur >= e.bufferReset {
+ for i := range e.table[:] {
+ e.table[i] = tableEntry{}
+ }
+ e.cur = e.maxMatchOff
+ }
+
+ s := int32(0)
+ blk.size = len(src)
+ if len(src) < minNonLiteralBlockSize {
+ blk.extraLits = len(src)
+ blk.literals = blk.literals[:len(src)]
+ copy(blk.literals, src)
+ return
+ }
+
+ sLimit := int32(len(src)) - inputMargin
+ // stepSize is the number of bytes to skip on every main loop iteration.
+ // It should be >= 2.
+ const stepSize = 2
+
+ // TEMPLATE
+ const hashLog = tableBits
+ // seems global, but would be nice to tweak.
+ const kSearchStrength = 6
+
+ // nextEmit is where in src the next emitLiteral should start from.
+ nextEmit := s
+ cv := load6432(src, s)
+
+ // Relative offsets
+ offset1 := int32(blk.recentOffsets[0])
+ offset2 := int32(blk.recentOffsets[1])
+
+ addLiterals := func(s *seq, until int32) {
+ if until == nextEmit {
+ return
+ }
+ blk.literals = append(blk.literals, src[nextEmit:until]...)
+ s.litLen = uint32(until - nextEmit)
+ }
+ if debugEncoder {
+ println("recent offsets:", blk.recentOffsets)
+ }
+
+encodeLoop:
+ for {
+ // t will contain the match offset when we find one.
+ // When existing the search loop, we have already checked 4 bytes.
+ var t int32
+
+ // We will not use repeat offsets across blocks.
+ // By not using them for the first 3 matches
+
+ for {
+ nextHash := hashLen(cv, hashLog, tableFastHashLen)
+ nextHash2 := hashLen(cv>>8, hashLog, tableFastHashLen)
+ candidate := e.table[nextHash]
+ candidate2 := e.table[nextHash2]
+ repIndex := s - offset1 + 2
+
+ e.table[nextHash] = tableEntry{offset: s + e.cur, val: uint32(cv)}
+ e.table[nextHash2] = tableEntry{offset: s + e.cur + 1, val: uint32(cv >> 8)}
+
+ if len(blk.sequences) > 2 && load3232(src, repIndex) == uint32(cv>>16) {
+ // Consider history as well.
+ var seq seq
+ length := 4 + e.matchlen(s+6, repIndex+4, src)
+
+ seq.matchLen = uint32(length - zstdMinMatch)
+
+ // We might be able to match backwards.
+ // Extend as long as we can.
+ start := s + 2
+ // We end the search early, so we don't risk 0 literals
+ // and have to do special offset treatment.
+ startLimit := nextEmit + 1
+
+ sMin := s - e.maxMatchOff
+ if sMin < 0 {
+ sMin = 0
+ }
+ for repIndex > sMin && start > startLimit && src[repIndex-1] == src[start-1] {
+ repIndex--
+ start--
+ seq.matchLen++
+ }
+ addLiterals(&seq, start)
+
+ // rep 0
+ seq.offset = 1
+ if debugSequences {
+ println("repeat sequence", seq, "next s:", s)
+ }
+ blk.sequences = append(blk.sequences, seq)
+ s += length + 2
+ nextEmit = s
+ if s >= sLimit {
+ if debugEncoder {
+ println("repeat ended", s, length)
+
+ }
+ break encodeLoop
+ }
+ cv = load6432(src, s)
+ continue
+ }
+ coffset0 := s - (candidate.offset - e.cur)
+ coffset1 := s - (candidate2.offset - e.cur) + 1
+ if coffset0 < e.maxMatchOff && uint32(cv) == candidate.val {
+ // found a regular match
+ t = candidate.offset - e.cur
+ if debugAsserts && s <= t {
+ panic(fmt.Sprintf("s (%d) <= t (%d)", s, t))
+ }
+ if debugAsserts && s-t > e.maxMatchOff {
+ panic("s - t >e.maxMatchOff")
+ }
+ if debugAsserts && t < 0 {
+ panic(fmt.Sprintf("t (%d) < 0, candidate.offset: %d, e.cur: %d, coffset0: %d, e.maxMatchOff: %d", t, candidate.offset, e.cur, coffset0, e.maxMatchOff))
+ }
+ break
+ }
+
+ if coffset1 < e.maxMatchOff && uint32(cv>>8) == candidate2.val {
+ // found a regular match
+ t = candidate2.offset - e.cur
+ s++
+ if debugAsserts && s <= t {
+ panic(fmt.Sprintf("s (%d) <= t (%d)", s, t))
+ }
+ if debugAsserts && s-t > e.maxMatchOff {
+ panic("s - t >e.maxMatchOff")
+ }
+ if debugAsserts && t < 0 {
+ panic("t<0")
+ }
+ break
+ }
+ s += stepSize + ((s - nextEmit) >> (kSearchStrength - 1))
+ if s >= sLimit {
+ break encodeLoop
+ }
+ cv = load6432(src, s)
+ }
+ // A 4-byte match has been found. We'll later see if more than 4 bytes.
+ offset2 = offset1
+ offset1 = s - t
+
+ if debugAsserts && s <= t {
+ panic(fmt.Sprintf("s (%d) <= t (%d)", s, t))
+ }
+
+ if debugAsserts && t < 0 {
+ panic(fmt.Sprintf("t (%d) < 0 ", t))
+ }
+ // Extend the 4-byte match as long as possible.
+ l := e.matchlen(s+4, t+4, src) + 4
+
+ // Extend backwards
+ tMin := s - e.maxMatchOff
+ if tMin < 0 {
+ tMin = 0
+ }
+ for t > tMin && s > nextEmit && src[t-1] == src[s-1] {
+ s--
+ t--
+ l++
+ }
+
+ // Write our sequence.
+ var seq seq
+ seq.litLen = uint32(s - nextEmit)
+ seq.matchLen = uint32(l - zstdMinMatch)
+ if seq.litLen > 0 {
+ blk.literals = append(blk.literals, src[nextEmit:s]...)
+ }
+ // Don't use repeat offsets
+ seq.offset = uint32(s-t) + 3
+ s += l
+ if debugSequences {
+ println("sequence", seq, "next s:", s)
+ }
+ blk.sequences = append(blk.sequences, seq)
+ nextEmit = s
+ if s >= sLimit {
+ break encodeLoop
+ }
+ cv = load6432(src, s)
+
+ // Check offset 2
+ if o2 := s - offset2; len(blk.sequences) > 2 && load3232(src, o2) == uint32(cv) {
+ // We have at least 4 byte match.
+ // No need to check backwards. We come straight from a match
+ l := 4 + e.matchlen(s+4, o2+4, src)
+
+ // Store this, since we have it.
+ nextHash := hashLen(cv, hashLog, tableFastHashLen)
+ e.table[nextHash] = tableEntry{offset: s + e.cur, val: uint32(cv)}
+ seq.matchLen = uint32(l) - zstdMinMatch
+ seq.litLen = 0
+ // Since litlen is always 0, this is offset 1.
+ seq.offset = 1
+ s += l
+ nextEmit = s
+ if debugSequences {
+ println("sequence", seq, "next s:", s)
+ }
+ blk.sequences = append(blk.sequences, seq)
+
+ // Swap offset 1 and 2.
+ offset1, offset2 = offset2, offset1
+ if s >= sLimit {
+ break encodeLoop
+ }
+ // Prepare next loop.
+ cv = load6432(src, s)
+ }
+ }
+
+ if int(nextEmit) < len(src) {
+ blk.literals = append(blk.literals, src[nextEmit:]...)
+ blk.extraLits = len(src) - int(nextEmit)
+ }
+ if debugEncoder {
+ println("returning, recent offsets:", blk.recentOffsets, "extra literals:", blk.extraLits)
+ }
+ // We do not store history, so we must offset e.cur to avoid false matches for next user.
+ if e.cur < e.bufferReset {
+ e.cur += int32(len(src))
+ }
+}
+
+// Encode will encode the content, with a dictionary if initialized for it.
+func (e *fastEncoderDict) Encode(blk *blockEnc, src []byte) {
+ const (
+ inputMargin = 8
+ minNonLiteralBlockSize = 1 + 1 + inputMargin
+ )
+ if e.allDirty || len(src) > 32<<10 {
+ e.fastEncoder.Encode(blk, src)
+ e.allDirty = true
+ return
+ }
+ // Protect against e.cur wraparound.
+ for e.cur >= e.bufferReset-int32(len(e.hist)) {
+ if len(e.hist) == 0 {
+ e.table = [tableSize]tableEntry{}
+ e.cur = e.maxMatchOff
+ break
+ }
+ // Shift down everything in the table that isn't already too far away.
+ minOff := e.cur + int32(len(e.hist)) - e.maxMatchOff
+ for i := range e.table[:] {
+ v := e.table[i].offset
+ if v < minOff {
+ v = 0
+ } else {
+ v = v - e.cur + e.maxMatchOff
+ }
+ e.table[i].offset = v
+ }
+ e.cur = e.maxMatchOff
+ break
+ }
+
+ s := e.addBlock(src)
+ blk.size = len(src)
+ if len(src) < minNonLiteralBlockSize {
+ blk.extraLits = len(src)
+ blk.literals = blk.literals[:len(src)]
+ copy(blk.literals, src)
+ return
+ }
+
+ // Override src
+ src = e.hist
+ sLimit := int32(len(src)) - inputMargin
+ // stepSize is the number of bytes to skip on every main loop iteration.
+ // It should be >= 2.
+ const stepSize = 2
+
+ // TEMPLATE
+ const hashLog = tableBits
+ // seems global, but would be nice to tweak.
+ const kSearchStrength = 7
+
+ // nextEmit is where in src the next emitLiteral should start from.
+ nextEmit := s
+ cv := load6432(src, s)
+
+ // Relative offsets
+ offset1 := int32(blk.recentOffsets[0])
+ offset2 := int32(blk.recentOffsets[1])
+
+ addLiterals := func(s *seq, until int32) {
+ if until == nextEmit {
+ return
+ }
+ blk.literals = append(blk.literals, src[nextEmit:until]...)
+ s.litLen = uint32(until - nextEmit)
+ }
+ if debugEncoder {
+ println("recent offsets:", blk.recentOffsets)
+ }
+
+encodeLoop:
+ for {
+ // t will contain the match offset when we find one.
+ // When existing the search loop, we have already checked 4 bytes.
+ var t int32
+
+ // We will not use repeat offsets across blocks.
+ // By not using them for the first 3 matches
+ canRepeat := len(blk.sequences) > 2
+
+ for {
+ if debugAsserts && canRepeat && offset1 == 0 {
+ panic("offset0 was 0")
+ }
+
+ nextHash := hashLen(cv, hashLog, tableFastHashLen)
+ nextHash2 := hashLen(cv>>8, hashLog, tableFastHashLen)
+ candidate := e.table[nextHash]
+ candidate2 := e.table[nextHash2]
+ repIndex := s - offset1 + 2
+
+ e.table[nextHash] = tableEntry{offset: s + e.cur, val: uint32(cv)}
+ e.markShardDirty(nextHash)
+ e.table[nextHash2] = tableEntry{offset: s + e.cur + 1, val: uint32(cv >> 8)}
+ e.markShardDirty(nextHash2)
+
+ if canRepeat && repIndex >= 0 && load3232(src, repIndex) == uint32(cv>>16) {
+ // Consider history as well.
+ var seq seq
+ length := 4 + e.matchlen(s+6, repIndex+4, src)
+
+ seq.matchLen = uint32(length - zstdMinMatch)
+
+ // We might be able to match backwards.
+ // Extend as long as we can.
+ start := s + 2
+ // We end the search early, so we don't risk 0 literals
+ // and have to do special offset treatment.
+ startLimit := nextEmit + 1
+
+ sMin := s - e.maxMatchOff
+ if sMin < 0 {
+ sMin = 0
+ }
+ for repIndex > sMin && start > startLimit && src[repIndex-1] == src[start-1] && seq.matchLen < maxMatchLength-zstdMinMatch {
+ repIndex--
+ start--
+ seq.matchLen++
+ }
+ addLiterals(&seq, start)
+
+ // rep 0
+ seq.offset = 1
+ if debugSequences {
+ println("repeat sequence", seq, "next s:", s)
+ }
+ blk.sequences = append(blk.sequences, seq)
+ s += length + 2
+ nextEmit = s
+ if s >= sLimit {
+ if debugEncoder {
+ println("repeat ended", s, length)
+
+ }
+ break encodeLoop
+ }
+ cv = load6432(src, s)
+ continue
+ }
+ coffset0 := s - (candidate.offset - e.cur)
+ coffset1 := s - (candidate2.offset - e.cur) + 1
+ if coffset0 < e.maxMatchOff && uint32(cv) == candidate.val {
+ // found a regular match
+ t = candidate.offset - e.cur
+ if debugAsserts && s <= t {
+ panic(fmt.Sprintf("s (%d) <= t (%d)", s, t))
+ }
+ if debugAsserts && s-t > e.maxMatchOff {
+ panic("s - t >e.maxMatchOff")
+ }
+ break
+ }
+
+ if coffset1 < e.maxMatchOff && uint32(cv>>8) == candidate2.val {
+ // found a regular match
+ t = candidate2.offset - e.cur
+ s++
+ if debugAsserts && s <= t {
+ panic(fmt.Sprintf("s (%d) <= t (%d)", s, t))
+ }
+ if debugAsserts && s-t > e.maxMatchOff {
+ panic("s - t >e.maxMatchOff")
+ }
+ if debugAsserts && t < 0 {
+ panic("t<0")
+ }
+ break
+ }
+ s += stepSize + ((s - nextEmit) >> (kSearchStrength - 1))
+ if s >= sLimit {
+ break encodeLoop
+ }
+ cv = load6432(src, s)
+ }
+ // A 4-byte match has been found. We'll later see if more than 4 bytes.
+ offset2 = offset1
+ offset1 = s - t
+
+ if debugAsserts && s <= t {
+ panic(fmt.Sprintf("s (%d) <= t (%d)", s, t))
+ }
+
+ if debugAsserts && canRepeat && int(offset1) > len(src) {
+ panic("invalid offset")
+ }
+
+ // Extend the 4-byte match as long as possible.
+ l := e.matchlen(s+4, t+4, src) + 4
+
+ // Extend backwards
+ tMin := s - e.maxMatchOff
+ if tMin < 0 {
+ tMin = 0
+ }
+ for t > tMin && s > nextEmit && src[t-1] == src[s-1] && l < maxMatchLength {
+ s--
+ t--
+ l++
+ }
+
+ // Write our sequence.
+ var seq seq
+ seq.litLen = uint32(s - nextEmit)
+ seq.matchLen = uint32(l - zstdMinMatch)
+ if seq.litLen > 0 {
+ blk.literals = append(blk.literals, src[nextEmit:s]...)
+ }
+ // Don't use repeat offsets
+ seq.offset = uint32(s-t) + 3
+ s += l
+ if debugSequences {
+ println("sequence", seq, "next s:", s)
+ }
+ blk.sequences = append(blk.sequences, seq)
+ nextEmit = s
+ if s >= sLimit {
+ break encodeLoop
+ }
+ cv = load6432(src, s)
+
+ // Check offset 2
+ if o2 := s - offset2; canRepeat && load3232(src, o2) == uint32(cv) {
+ // We have at least 4 byte match.
+ // No need to check backwards. We come straight from a match
+ l := 4 + e.matchlen(s+4, o2+4, src)
+
+ // Store this, since we have it.
+ nextHash := hashLen(cv, hashLog, tableFastHashLen)
+ e.table[nextHash] = tableEntry{offset: s + e.cur, val: uint32(cv)}
+ e.markShardDirty(nextHash)
+ seq.matchLen = uint32(l) - zstdMinMatch
+ seq.litLen = 0
+ // Since litlen is always 0, this is offset 1.
+ seq.offset = 1
+ s += l
+ nextEmit = s
+ if debugSequences {
+ println("sequence", seq, "next s:", s)
+ }
+ blk.sequences = append(blk.sequences, seq)
+
+ // Swap offset 1 and 2.
+ offset1, offset2 = offset2, offset1
+ if s >= sLimit {
+ break encodeLoop
+ }
+ // Prepare next loop.
+ cv = load6432(src, s)
+ }
+ }
+
+ if int(nextEmit) < len(src) {
+ blk.literals = append(blk.literals, src[nextEmit:]...)
+ blk.extraLits = len(src) - int(nextEmit)
+ }
+ blk.recentOffsets[0] = uint32(offset1)
+ blk.recentOffsets[1] = uint32(offset2)
+ if debugEncoder {
+ println("returning, recent offsets:", blk.recentOffsets, "extra literals:", blk.extraLits)
+ }
+}
+
+// ResetDict will reset and set a dictionary if not nil
+func (e *fastEncoder) Reset(d *dict, singleBlock bool) {
+ e.resetBase(d, singleBlock)
+ if d != nil {
+ panic("fastEncoder: Reset with dict")
+ }
+}
+
+// ResetDict will reset and set a dictionary if not nil
+func (e *fastEncoderDict) Reset(d *dict, singleBlock bool) {
+ e.resetBase(d, singleBlock)
+ if d == nil {
+ return
+ }
+
+ // Init or copy dict table
+ if len(e.dictTable) != len(e.table) || d.id != e.lastDictID {
+ if len(e.dictTable) != len(e.table) {
+ e.dictTable = make([]tableEntry, len(e.table))
+ }
+ if true {
+ end := e.maxMatchOff + int32(len(d.content)) - 8
+ for i := e.maxMatchOff; i < end; i += 2 {
+ const hashLog = tableBits
+
+ cv := load6432(d.content, i-e.maxMatchOff)
+ nextHash := hashLen(cv, hashLog, tableFastHashLen) // 0 -> 6
+ nextHash1 := hashLen(cv>>8, hashLog, tableFastHashLen) // 1 -> 7
+ e.dictTable[nextHash] = tableEntry{
+ val: uint32(cv),
+ offset: i,
+ }
+ e.dictTable[nextHash1] = tableEntry{
+ val: uint32(cv >> 8),
+ offset: i + 1,
+ }
+ }
+ }
+ e.lastDictID = d.id
+ e.allDirty = true
+ }
+
+ e.cur = e.maxMatchOff
+ dirtyShardCnt := 0
+ if !e.allDirty {
+ for i := range e.tableShardDirty {
+ if e.tableShardDirty[i] {
+ dirtyShardCnt++
+ }
+ }
+ }
+
+ const shardCnt = tableShardCnt
+ const shardSize = tableShardSize
+ if e.allDirty || dirtyShardCnt > shardCnt*4/6 {
+ //copy(e.table[:], e.dictTable)
+ e.table = *(*[tableSize]tableEntry)(e.dictTable)
+ for i := range e.tableShardDirty {
+ e.tableShardDirty[i] = false
+ }
+ e.allDirty = false
+ return
+ }
+ for i := range e.tableShardDirty {
+ if !e.tableShardDirty[i] {
+ continue
+ }
+
+ //copy(e.table[i*shardSize:(i+1)*shardSize], e.dictTable[i*shardSize:(i+1)*shardSize])
+ *(*[shardSize]tableEntry)(e.table[i*shardSize:]) = *(*[shardSize]tableEntry)(e.dictTable[i*shardSize:])
+ e.tableShardDirty[i] = false
+ }
+ e.allDirty = false
+}
+
+func (e *fastEncoderDict) markAllShardsDirty() {
+ e.allDirty = true
+}
+
+func (e *fastEncoderDict) markShardDirty(entryNum uint32) {
+ e.tableShardDirty[entryNum/tableShardSize] = true
+}
diff --git a/vendor/github.com/klauspost/compress/zstd/encoder.go b/vendor/github.com/klauspost/compress/zstd/encoder.go
new file mode 100644
index 00000000..8f8223cd
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/encoder.go
@@ -0,0 +1,642 @@
+// Copyright 2019+ Klaus Post. All rights reserved.
+// License information can be found in the LICENSE file.
+// Based on work by Yann Collet, released under BSD License.
+
+package zstd
+
+import (
+ "crypto/rand"
+ "errors"
+ "fmt"
+ "io"
+ "math"
+ rdebug "runtime/debug"
+ "sync"
+
+ "github.com/klauspost/compress/zstd/internal/xxhash"
+)
+
+// Encoder provides encoding to Zstandard.
+// An Encoder can be used for either compressing a stream via the
+// io.WriteCloser interface supported by the Encoder or as multiple independent
+// tasks via the EncodeAll function.
+// Smaller encodes are encouraged to use the EncodeAll function.
+// Use NewWriter to create a new instance.
+type Encoder struct {
+ o encoderOptions
+ encoders chan encoder
+ state encoderState
+ init sync.Once
+}
+
+type encoder interface {
+ Encode(blk *blockEnc, src []byte)
+ EncodeNoHist(blk *blockEnc, src []byte)
+ Block() *blockEnc
+ CRC() *xxhash.Digest
+ AppendCRC([]byte) []byte
+ WindowSize(size int64) int32
+ UseBlock(*blockEnc)
+ Reset(d *dict, singleBlock bool)
+}
+
+type encoderState struct {
+ w io.Writer
+ filling []byte
+ current []byte
+ previous []byte
+ encoder encoder
+ writing *blockEnc
+ err error
+ writeErr error
+ nWritten int64
+ nInput int64
+ frameContentSize int64
+ headerWritten bool
+ eofWritten bool
+ fullFrameWritten bool
+
+ // This waitgroup indicates an encode is running.
+ wg sync.WaitGroup
+ // This waitgroup indicates we have a block encoding/writing.
+ wWg sync.WaitGroup
+}
+
+// NewWriter will create a new Zstandard encoder.
+// If the encoder will be used for encoding blocks a nil writer can be used.
+func NewWriter(w io.Writer, opts ...EOption) (*Encoder, error) {
+ initPredefined()
+ var e Encoder
+ e.o.setDefault()
+ for _, o := range opts {
+ err := o(&e.o)
+ if err != nil {
+ return nil, err
+ }
+ }
+ if w != nil {
+ e.Reset(w)
+ }
+ return &e, nil
+}
+
+func (e *Encoder) initialize() {
+ if e.o.concurrent == 0 {
+ e.o.setDefault()
+ }
+ e.encoders = make(chan encoder, e.o.concurrent)
+ for i := 0; i < e.o.concurrent; i++ {
+ enc := e.o.encoder()
+ e.encoders <- enc
+ }
+}
+
+// Reset will re-initialize the writer and new writes will encode to the supplied writer
+// as a new, independent stream.
+func (e *Encoder) Reset(w io.Writer) {
+ s := &e.state
+ s.wg.Wait()
+ s.wWg.Wait()
+ if cap(s.filling) == 0 {
+ s.filling = make([]byte, 0, e.o.blockSize)
+ }
+ if e.o.concurrent > 1 {
+ if cap(s.current) == 0 {
+ s.current = make([]byte, 0, e.o.blockSize)
+ }
+ if cap(s.previous) == 0 {
+ s.previous = make([]byte, 0, e.o.blockSize)
+ }
+ s.current = s.current[:0]
+ s.previous = s.previous[:0]
+ if s.writing == nil {
+ s.writing = &blockEnc{lowMem: e.o.lowMem}
+ s.writing.init()
+ }
+ s.writing.initNewEncode()
+ }
+ if s.encoder == nil {
+ s.encoder = e.o.encoder()
+ }
+ s.filling = s.filling[:0]
+ s.encoder.Reset(e.o.dict, false)
+ s.headerWritten = false
+ s.eofWritten = false
+ s.fullFrameWritten = false
+ s.w = w
+ s.err = nil
+ s.nWritten = 0
+ s.nInput = 0
+ s.writeErr = nil
+ s.frameContentSize = 0
+}
+
+// ResetContentSize will reset and set a content size for the next stream.
+// If the bytes written does not match the size given an error will be returned
+// when calling Close().
+// This is removed when Reset is called.
+// Sizes <= 0 results in no content size set.
+func (e *Encoder) ResetContentSize(w io.Writer, size int64) {
+ e.Reset(w)
+ if size >= 0 {
+ e.state.frameContentSize = size
+ }
+}
+
+// Write data to the encoder.
+// Input data will be buffered and as the buffer fills up
+// content will be compressed and written to the output.
+// When done writing, use Close to flush the remaining output
+// and write CRC if requested.
+func (e *Encoder) Write(p []byte) (n int, err error) {
+ s := &e.state
+ if s.eofWritten {
+ return 0, ErrEncoderClosed
+ }
+ for len(p) > 0 {
+ if len(p)+len(s.filling) < e.o.blockSize {
+ if e.o.crc {
+ _, _ = s.encoder.CRC().Write(p)
+ }
+ s.filling = append(s.filling, p...)
+ return n + len(p), nil
+ }
+ add := p
+ if len(p)+len(s.filling) > e.o.blockSize {
+ add = add[:e.o.blockSize-len(s.filling)]
+ }
+ if e.o.crc {
+ _, _ = s.encoder.CRC().Write(add)
+ }
+ s.filling = append(s.filling, add...)
+ p = p[len(add):]
+ n += len(add)
+ if len(s.filling) < e.o.blockSize {
+ return n, nil
+ }
+ err := e.nextBlock(false)
+ if err != nil {
+ return n, err
+ }
+ if debugAsserts && len(s.filling) > 0 {
+ panic(len(s.filling))
+ }
+ }
+ return n, nil
+}
+
+// nextBlock will synchronize and start compressing input in e.state.filling.
+// If an error has occurred during encoding it will be returned.
+func (e *Encoder) nextBlock(final bool) error {
+ s := &e.state
+ // Wait for current block.
+ s.wg.Wait()
+ if s.err != nil {
+ return s.err
+ }
+ if len(s.filling) > e.o.blockSize {
+ return fmt.Errorf("block > maxStoreBlockSize")
+ }
+ if !s.headerWritten {
+ // If we have a single block encode, do a sync compression.
+ if final && len(s.filling) == 0 && !e.o.fullZero {
+ s.headerWritten = true
+ s.fullFrameWritten = true
+ s.eofWritten = true
+ return nil
+ }
+ if final && len(s.filling) > 0 {
+ s.current = e.encodeAll(s.encoder, s.filling, s.current[:0])
+ var n2 int
+ n2, s.err = s.w.Write(s.current)
+ if s.err != nil {
+ return s.err
+ }
+ s.nWritten += int64(n2)
+ s.nInput += int64(len(s.filling))
+ s.current = s.current[:0]
+ s.filling = s.filling[:0]
+ s.headerWritten = true
+ s.fullFrameWritten = true
+ s.eofWritten = true
+ return nil
+ }
+
+ var tmp [maxHeaderSize]byte
+ fh := frameHeader{
+ ContentSize: uint64(s.frameContentSize),
+ WindowSize: uint32(s.encoder.WindowSize(s.frameContentSize)),
+ SingleSegment: false,
+ Checksum: e.o.crc,
+ DictID: e.o.dict.ID(),
+ }
+
+ dst := fh.appendTo(tmp[:0])
+ s.headerWritten = true
+ s.wWg.Wait()
+ var n2 int
+ n2, s.err = s.w.Write(dst)
+ if s.err != nil {
+ return s.err
+ }
+ s.nWritten += int64(n2)
+ }
+ if s.eofWritten {
+ // Ensure we only write it once.
+ final = false
+ }
+
+ if len(s.filling) == 0 {
+ // Final block, but no data.
+ if final {
+ enc := s.encoder
+ blk := enc.Block()
+ blk.reset(nil)
+ blk.last = true
+ blk.encodeRaw(nil)
+ s.wWg.Wait()
+ _, s.err = s.w.Write(blk.output)
+ s.nWritten += int64(len(blk.output))
+ s.eofWritten = true
+ }
+ return s.err
+ }
+
+ // SYNC:
+ if e.o.concurrent == 1 {
+ src := s.filling
+ s.nInput += int64(len(s.filling))
+ if debugEncoder {
+ println("Adding sync block,", len(src), "bytes, final:", final)
+ }
+ enc := s.encoder
+ blk := enc.Block()
+ blk.reset(nil)
+ enc.Encode(blk, src)
+ blk.last = final
+ if final {
+ s.eofWritten = true
+ }
+
+ s.err = blk.encode(src, e.o.noEntropy, !e.o.allLitEntropy)
+ if s.err != nil {
+ return s.err
+ }
+ _, s.err = s.w.Write(blk.output)
+ s.nWritten += int64(len(blk.output))
+ s.filling = s.filling[:0]
+ return s.err
+ }
+
+ // Move blocks forward.
+ s.filling, s.current, s.previous = s.previous[:0], s.filling, s.current
+ s.nInput += int64(len(s.current))
+ s.wg.Add(1)
+ if final {
+ s.eofWritten = true
+ }
+ go func(src []byte) {
+ if debugEncoder {
+ println("Adding block,", len(src), "bytes, final:", final)
+ }
+ defer func() {
+ if r := recover(); r != nil {
+ s.err = fmt.Errorf("panic while encoding: %v", r)
+ rdebug.PrintStack()
+ }
+ s.wg.Done()
+ }()
+ enc := s.encoder
+ blk := enc.Block()
+ enc.Encode(blk, src)
+ blk.last = final
+ // Wait for pending writes.
+ s.wWg.Wait()
+ if s.writeErr != nil {
+ s.err = s.writeErr
+ return
+ }
+ // Transfer encoders from previous write block.
+ blk.swapEncoders(s.writing)
+ // Transfer recent offsets to next.
+ enc.UseBlock(s.writing)
+ s.writing = blk
+ s.wWg.Add(1)
+ go func() {
+ defer func() {
+ if r := recover(); r != nil {
+ s.writeErr = fmt.Errorf("panic while encoding/writing: %v", r)
+ rdebug.PrintStack()
+ }
+ s.wWg.Done()
+ }()
+ s.writeErr = blk.encode(src, e.o.noEntropy, !e.o.allLitEntropy)
+ if s.writeErr != nil {
+ return
+ }
+ _, s.writeErr = s.w.Write(blk.output)
+ s.nWritten += int64(len(blk.output))
+ }()
+ }(s.current)
+ return nil
+}
+
+// ReadFrom reads data from r until EOF or error.
+// The return value n is the number of bytes read.
+// Any error except io.EOF encountered during the read is also returned.
+//
+// The Copy function uses ReaderFrom if available.
+func (e *Encoder) ReadFrom(r io.Reader) (n int64, err error) {
+ if debugEncoder {
+ println("Using ReadFrom")
+ }
+
+ // Flush any current writes.
+ if len(e.state.filling) > 0 {
+ if err := e.nextBlock(false); err != nil {
+ return 0, err
+ }
+ }
+ e.state.filling = e.state.filling[:e.o.blockSize]
+ src := e.state.filling
+ for {
+ n2, err := r.Read(src)
+ if e.o.crc {
+ _, _ = e.state.encoder.CRC().Write(src[:n2])
+ }
+ // src is now the unfilled part...
+ src = src[n2:]
+ n += int64(n2)
+ switch err {
+ case io.EOF:
+ e.state.filling = e.state.filling[:len(e.state.filling)-len(src)]
+ if debugEncoder {
+ println("ReadFrom: got EOF final block:", len(e.state.filling))
+ }
+ return n, nil
+ case nil:
+ default:
+ if debugEncoder {
+ println("ReadFrom: got error:", err)
+ }
+ e.state.err = err
+ return n, err
+ }
+ if len(src) > 0 {
+ if debugEncoder {
+ println("ReadFrom: got space left in source:", len(src))
+ }
+ continue
+ }
+ err = e.nextBlock(false)
+ if err != nil {
+ return n, err
+ }
+ e.state.filling = e.state.filling[:e.o.blockSize]
+ src = e.state.filling
+ }
+}
+
+// Flush will send the currently written data to output
+// and block until everything has been written.
+// This should only be used on rare occasions where pushing the currently queued data is critical.
+func (e *Encoder) Flush() error {
+ s := &e.state
+ if len(s.filling) > 0 {
+ err := e.nextBlock(false)
+ if err != nil {
+ // Ignore Flush after Close.
+ if errors.Is(s.err, ErrEncoderClosed) {
+ return nil
+ }
+ return err
+ }
+ }
+ s.wg.Wait()
+ s.wWg.Wait()
+ if s.err != nil {
+ // Ignore Flush after Close.
+ if errors.Is(s.err, ErrEncoderClosed) {
+ return nil
+ }
+ return s.err
+ }
+ return s.writeErr
+}
+
+// Close will flush the final output and close the stream.
+// The function will block until everything has been written.
+// The Encoder can still be re-used after calling this.
+func (e *Encoder) Close() error {
+ s := &e.state
+ if s.encoder == nil {
+ return nil
+ }
+ err := e.nextBlock(true)
+ if err != nil {
+ if errors.Is(s.err, ErrEncoderClosed) {
+ return nil
+ }
+ return err
+ }
+ if s.frameContentSize > 0 {
+ if s.nInput != s.frameContentSize {
+ return fmt.Errorf("frame content size %d given, but %d bytes was written", s.frameContentSize, s.nInput)
+ }
+ }
+ if e.state.fullFrameWritten {
+ return s.err
+ }
+ s.wg.Wait()
+ s.wWg.Wait()
+
+ if s.err != nil {
+ return s.err
+ }
+ if s.writeErr != nil {
+ return s.writeErr
+ }
+
+ // Write CRC
+ if e.o.crc && s.err == nil {
+ // heap alloc.
+ var tmp [4]byte
+ _, s.err = s.w.Write(s.encoder.AppendCRC(tmp[:0]))
+ s.nWritten += 4
+ }
+
+ // Add padding with content from crypto/rand.Reader
+ if s.err == nil && e.o.pad > 0 {
+ add := calcSkippableFrame(s.nWritten, int64(e.o.pad))
+ frame, err := skippableFrame(s.filling[:0], add, rand.Reader)
+ if err != nil {
+ return err
+ }
+ _, s.err = s.w.Write(frame)
+ }
+ if s.err == nil {
+ s.err = ErrEncoderClosed
+ return nil
+ }
+
+ return s.err
+}
+
+// EncodeAll will encode all input in src and append it to dst.
+// This function can be called concurrently, but each call will only run on a single goroutine.
+// If empty input is given, nothing is returned, unless WithZeroFrames is specified.
+// Encoded blocks can be concatenated and the result will be the combined input stream.
+// Data compressed with EncodeAll can be decoded with the Decoder,
+// using either a stream or DecodeAll.
+func (e *Encoder) EncodeAll(src, dst []byte) []byte {
+ e.init.Do(e.initialize)
+ enc := <-e.encoders
+ defer func() {
+ e.encoders <- enc
+ }()
+ return e.encodeAll(enc, src, dst)
+}
+
+func (e *Encoder) encodeAll(enc encoder, src, dst []byte) []byte {
+ if len(src) == 0 {
+ if e.o.fullZero {
+ // Add frame header.
+ fh := frameHeader{
+ ContentSize: 0,
+ WindowSize: MinWindowSize,
+ SingleSegment: true,
+ // Adding a checksum would be a waste of space.
+ Checksum: false,
+ DictID: 0,
+ }
+ dst = fh.appendTo(dst)
+
+ // Write raw block as last one only.
+ var blk blockHeader
+ blk.setSize(0)
+ blk.setType(blockTypeRaw)
+ blk.setLast(true)
+ dst = blk.appendTo(dst)
+ }
+ return dst
+ }
+
+ // Use single segments when above minimum window and below window size.
+ single := len(src) <= e.o.windowSize && len(src) > MinWindowSize
+ if e.o.single != nil {
+ single = *e.o.single
+ }
+ fh := frameHeader{
+ ContentSize: uint64(len(src)),
+ WindowSize: uint32(enc.WindowSize(int64(len(src)))),
+ SingleSegment: single,
+ Checksum: e.o.crc,
+ DictID: e.o.dict.ID(),
+ }
+
+ // If less than 1MB, allocate a buffer up front.
+ if len(dst) == 0 && cap(dst) == 0 && len(src) < 1<<20 && !e.o.lowMem {
+ dst = make([]byte, 0, len(src))
+ }
+ dst = fh.appendTo(dst)
+
+ // If we can do everything in one block, prefer that.
+ if len(src) <= e.o.blockSize {
+ enc.Reset(e.o.dict, true)
+ // Slightly faster with no history and everything in one block.
+ if e.o.crc {
+ _, _ = enc.CRC().Write(src)
+ }
+ blk := enc.Block()
+ blk.last = true
+ if e.o.dict == nil {
+ enc.EncodeNoHist(blk, src)
+ } else {
+ enc.Encode(blk, src)
+ }
+
+ // If we got the exact same number of literals as input,
+ // assume the literals cannot be compressed.
+ oldout := blk.output
+ // Output directly to dst
+ blk.output = dst
+
+ err := blk.encode(src, e.o.noEntropy, !e.o.allLitEntropy)
+ if err != nil {
+ panic(err)
+ }
+ dst = blk.output
+ blk.output = oldout
+ } else {
+ enc.Reset(e.o.dict, false)
+ blk := enc.Block()
+ for len(src) > 0 {
+ todo := src
+ if len(todo) > e.o.blockSize {
+ todo = todo[:e.o.blockSize]
+ }
+ src = src[len(todo):]
+ if e.o.crc {
+ _, _ = enc.CRC().Write(todo)
+ }
+ blk.pushOffsets()
+ enc.Encode(blk, todo)
+ if len(src) == 0 {
+ blk.last = true
+ }
+ err := blk.encode(todo, e.o.noEntropy, !e.o.allLitEntropy)
+ if err != nil {
+ panic(err)
+ }
+ dst = append(dst, blk.output...)
+ blk.reset(nil)
+ }
+ }
+ if e.o.crc {
+ dst = enc.AppendCRC(dst)
+ }
+ // Add padding with content from crypto/rand.Reader
+ if e.o.pad > 0 {
+ add := calcSkippableFrame(int64(len(dst)), int64(e.o.pad))
+ var err error
+ dst, err = skippableFrame(dst, add, rand.Reader)
+ if err != nil {
+ panic(err)
+ }
+ }
+ return dst
+}
+
+// MaxEncodedSize returns the expected maximum
+// size of an encoded block or stream.
+func (e *Encoder) MaxEncodedSize(size int) int {
+ frameHeader := 4 + 2 // magic + frame header & window descriptor
+ if e.o.dict != nil {
+ frameHeader += 4
+ }
+ // Frame content size:
+ if size < 256 {
+ frameHeader++
+ } else if size < 65536+256 {
+ frameHeader += 2
+ } else if size < math.MaxInt32 {
+ frameHeader += 4
+ } else {
+ frameHeader += 8
+ }
+ // Final crc
+ if e.o.crc {
+ frameHeader += 4
+ }
+
+ // Max overhead is 3 bytes/block.
+ // There cannot be 0 blocks.
+ blocks := (size + e.o.blockSize) / e.o.blockSize
+
+ // Combine, add padding.
+ maxSz := frameHeader + 3*blocks + size
+ if e.o.pad > 1 {
+ maxSz += calcSkippableFrame(int64(maxSz), int64(e.o.pad))
+ }
+ return maxSz
+}
diff --git a/vendor/github.com/klauspost/compress/zstd/encoder_options.go b/vendor/github.com/klauspost/compress/zstd/encoder_options.go
new file mode 100644
index 00000000..20671dcb
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/encoder_options.go
@@ -0,0 +1,339 @@
+package zstd
+
+import (
+ "errors"
+ "fmt"
+ "math"
+ "math/bits"
+ "runtime"
+ "strings"
+)
+
+// EOption is an option for creating a encoder.
+type EOption func(*encoderOptions) error
+
+// options retains accumulated state of multiple options.
+type encoderOptions struct {
+ concurrent int
+ level EncoderLevel
+ single *bool
+ pad int
+ blockSize int
+ windowSize int
+ crc bool
+ fullZero bool
+ noEntropy bool
+ allLitEntropy bool
+ customWindow bool
+ customALEntropy bool
+ customBlockSize bool
+ lowMem bool
+ dict *dict
+}
+
+func (o *encoderOptions) setDefault() {
+ *o = encoderOptions{
+ concurrent: runtime.GOMAXPROCS(0),
+ crc: true,
+ single: nil,
+ blockSize: maxCompressedBlockSize,
+ windowSize: 8 << 20,
+ level: SpeedDefault,
+ allLitEntropy: false,
+ lowMem: false,
+ }
+}
+
+// encoder returns an encoder with the selected options.
+func (o encoderOptions) encoder() encoder {
+ switch o.level {
+ case SpeedFastest:
+ if o.dict != nil {
+ return &fastEncoderDict{fastEncoder: fastEncoder{fastBase: fastBase{maxMatchOff: int32(o.windowSize), bufferReset: math.MaxInt32 - int32(o.windowSize*2), lowMem: o.lowMem}}}
+ }
+ return &fastEncoder{fastBase: fastBase{maxMatchOff: int32(o.windowSize), bufferReset: math.MaxInt32 - int32(o.windowSize*2), lowMem: o.lowMem}}
+
+ case SpeedDefault:
+ if o.dict != nil {
+ return &doubleFastEncoderDict{fastEncoderDict: fastEncoderDict{fastEncoder: fastEncoder{fastBase: fastBase{maxMatchOff: int32(o.windowSize), bufferReset: math.MaxInt32 - int32(o.windowSize*2), lowMem: o.lowMem}}}}
+ }
+ return &doubleFastEncoder{fastEncoder: fastEncoder{fastBase: fastBase{maxMatchOff: int32(o.windowSize), bufferReset: math.MaxInt32 - int32(o.windowSize*2), lowMem: o.lowMem}}}
+ case SpeedBetterCompression:
+ if o.dict != nil {
+ return &betterFastEncoderDict{betterFastEncoder: betterFastEncoder{fastBase: fastBase{maxMatchOff: int32(o.windowSize), bufferReset: math.MaxInt32 - int32(o.windowSize*2), lowMem: o.lowMem}}}
+ }
+ return &betterFastEncoder{fastBase: fastBase{maxMatchOff: int32(o.windowSize), bufferReset: math.MaxInt32 - int32(o.windowSize*2), lowMem: o.lowMem}}
+ case SpeedBestCompression:
+ return &bestFastEncoder{fastBase: fastBase{maxMatchOff: int32(o.windowSize), bufferReset: math.MaxInt32 - int32(o.windowSize*2), lowMem: o.lowMem}}
+ }
+ panic("unknown compression level")
+}
+
+// WithEncoderCRC will add CRC value to output.
+// Output will be 4 bytes larger.
+func WithEncoderCRC(b bool) EOption {
+ return func(o *encoderOptions) error { o.crc = b; return nil }
+}
+
+// WithEncoderConcurrency will set the concurrency,
+// meaning the maximum number of encoders to run concurrently.
+// The value supplied must be at least 1.
+// For streams, setting a value of 1 will disable async compression.
+// By default this will be set to GOMAXPROCS.
+func WithEncoderConcurrency(n int) EOption {
+ return func(o *encoderOptions) error {
+ if n <= 0 {
+ return fmt.Errorf("concurrency must be at least 1")
+ }
+ o.concurrent = n
+ return nil
+ }
+}
+
+// WithWindowSize will set the maximum allowed back-reference distance.
+// The value must be a power of two between MinWindowSize and MaxWindowSize.
+// A larger value will enable better compression but allocate more memory and,
+// for above-default values, take considerably longer.
+// The default value is determined by the compression level and max 8MB.
+func WithWindowSize(n int) EOption {
+ return func(o *encoderOptions) error {
+ switch {
+ case n < MinWindowSize:
+ return fmt.Errorf("window size must be at least %d", MinWindowSize)
+ case n > MaxWindowSize:
+ return fmt.Errorf("window size must be at most %d", MaxWindowSize)
+ case (n & (n - 1)) != 0:
+ return errors.New("window size must be a power of 2")
+ }
+
+ o.windowSize = n
+ o.customWindow = true
+ if o.blockSize > o.windowSize {
+ o.blockSize = o.windowSize
+ o.customBlockSize = true
+ }
+ return nil
+ }
+}
+
+// WithEncoderPadding will add padding to all output so the size will be a multiple of n.
+// This can be used to obfuscate the exact output size or make blocks of a certain size.
+// The contents will be a skippable frame, so it will be invisible by the decoder.
+// n must be > 0 and <= 1GB, 1<<30 bytes.
+// The padded area will be filled with data from crypto/rand.Reader.
+// If `EncodeAll` is used with data already in the destination, the total size will be multiple of this.
+func WithEncoderPadding(n int) EOption {
+ return func(o *encoderOptions) error {
+ if n <= 0 {
+ return fmt.Errorf("padding must be at least 1")
+ }
+ // No need to waste our time.
+ if n == 1 {
+ n = 0
+ }
+ if n > 1<<30 {
+ return fmt.Errorf("padding must less than 1GB (1<<30 bytes) ")
+ }
+ o.pad = n
+ return nil
+ }
+}
+
+// EncoderLevel predefines encoder compression levels.
+// Only use the constants made available, since the actual mapping
+// of these values are very likely to change and your compression could change
+// unpredictably when upgrading the library.
+type EncoderLevel int
+
+const (
+ speedNotSet EncoderLevel = iota
+
+ // SpeedFastest will choose the fastest reasonable compression.
+ // This is roughly equivalent to the fastest Zstandard mode.
+ SpeedFastest
+
+ // SpeedDefault is the default "pretty fast" compression option.
+ // This is roughly equivalent to the default Zstandard mode (level 3).
+ SpeedDefault
+
+ // SpeedBetterCompression will yield better compression than the default.
+ // Currently it is about zstd level 7-8 with ~ 2x-3x the default CPU usage.
+ // By using this, notice that CPU usage may go up in the future.
+ SpeedBetterCompression
+
+ // SpeedBestCompression will choose the best available compression option.
+ // This will offer the best compression no matter the CPU cost.
+ SpeedBestCompression
+
+ // speedLast should be kept as the last actual compression option.
+ // The is not for external usage, but is used to keep track of the valid options.
+ speedLast
+)
+
+// EncoderLevelFromString will convert a string representation of an encoding level back
+// to a compression level. The compare is not case sensitive.
+// If the string wasn't recognized, (false, SpeedDefault) will be returned.
+func EncoderLevelFromString(s string) (bool, EncoderLevel) {
+ for l := speedNotSet + 1; l < speedLast; l++ {
+ if strings.EqualFold(s, l.String()) {
+ return true, l
+ }
+ }
+ return false, SpeedDefault
+}
+
+// EncoderLevelFromZstd will return an encoder level that closest matches the compression
+// ratio of a specific zstd compression level.
+// Many input values will provide the same compression level.
+func EncoderLevelFromZstd(level int) EncoderLevel {
+ switch {
+ case level < 3:
+ return SpeedFastest
+ case level >= 3 && level < 6:
+ return SpeedDefault
+ case level >= 6 && level < 10:
+ return SpeedBetterCompression
+ default:
+ return SpeedBestCompression
+ }
+}
+
+// String provides a string representation of the compression level.
+func (e EncoderLevel) String() string {
+ switch e {
+ case SpeedFastest:
+ return "fastest"
+ case SpeedDefault:
+ return "default"
+ case SpeedBetterCompression:
+ return "better"
+ case SpeedBestCompression:
+ return "best"
+ default:
+ return "invalid"
+ }
+}
+
+// WithEncoderLevel specifies a predefined compression level.
+func WithEncoderLevel(l EncoderLevel) EOption {
+ return func(o *encoderOptions) error {
+ switch {
+ case l <= speedNotSet || l >= speedLast:
+ return fmt.Errorf("unknown encoder level")
+ }
+ o.level = l
+ if !o.customWindow {
+ switch o.level {
+ case SpeedFastest:
+ o.windowSize = 4 << 20
+ if !o.customBlockSize {
+ o.blockSize = 1 << 16
+ }
+ case SpeedDefault:
+ o.windowSize = 8 << 20
+ case SpeedBetterCompression:
+ o.windowSize = 8 << 20
+ case SpeedBestCompression:
+ o.windowSize = 8 << 20
+ }
+ }
+ if !o.customALEntropy {
+ o.allLitEntropy = l > SpeedDefault
+ }
+
+ return nil
+ }
+}
+
+// WithZeroFrames will encode 0 length input as full frames.
+// This can be needed for compatibility with zstandard usage,
+// but is not needed for this package.
+func WithZeroFrames(b bool) EOption {
+ return func(o *encoderOptions) error {
+ o.fullZero = b
+ return nil
+ }
+}
+
+// WithAllLitEntropyCompression will apply entropy compression if no matches are found.
+// Disabling this will skip incompressible data faster, but in cases with no matches but
+// skewed character distribution compression is lost.
+// Default value depends on the compression level selected.
+func WithAllLitEntropyCompression(b bool) EOption {
+ return func(o *encoderOptions) error {
+ o.customALEntropy = true
+ o.allLitEntropy = b
+ return nil
+ }
+}
+
+// WithNoEntropyCompression will always skip entropy compression of literals.
+// This can be useful if content has matches, but unlikely to benefit from entropy
+// compression. Usually the slight speed improvement is not worth enabling this.
+func WithNoEntropyCompression(b bool) EOption {
+ return func(o *encoderOptions) error {
+ o.noEntropy = b
+ return nil
+ }
+}
+
+// WithSingleSegment will set the "single segment" flag when EncodeAll is used.
+// If this flag is set, data must be regenerated within a single continuous memory segment.
+// In this case, Window_Descriptor byte is skipped, but Frame_Content_Size is necessarily present.
+// As a consequence, the decoder must allocate a memory segment of size equal or larger than size of your content.
+// In order to preserve the decoder from unreasonable memory requirements,
+// a decoder is allowed to reject a compressed frame which requests a memory size beyond decoder's authorized range.
+// For broader compatibility, decoders are recommended to support memory sizes of at least 8 MB.
+// This is only a recommendation, each decoder is free to support higher or lower limits, depending on local limitations.
+// If this is not specified, block encodes will automatically choose this based on the input size and the window size.
+// This setting has no effect on streamed encodes.
+func WithSingleSegment(b bool) EOption {
+ return func(o *encoderOptions) error {
+ o.single = &b
+ return nil
+ }
+}
+
+// WithLowerEncoderMem will trade in some memory cases trade less memory usage for
+// slower encoding speed.
+// This will not change the window size which is the primary function for reducing
+// memory usage. See WithWindowSize.
+func WithLowerEncoderMem(b bool) EOption {
+ return func(o *encoderOptions) error {
+ o.lowMem = b
+ return nil
+ }
+}
+
+// WithEncoderDict allows to register a dictionary that will be used for the encode.
+//
+// The slice dict must be in the [dictionary format] produced by
+// "zstd --train" from the Zstandard reference implementation.
+//
+// The encoder *may* choose to use no dictionary instead for certain payloads.
+//
+// [dictionary format]: https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#dictionary-format
+func WithEncoderDict(dict []byte) EOption {
+ return func(o *encoderOptions) error {
+ d, err := loadDict(dict)
+ if err != nil {
+ return err
+ }
+ o.dict = d
+ return nil
+ }
+}
+
+// WithEncoderDictRaw registers a dictionary that may be used by the encoder.
+//
+// The slice content may contain arbitrary data. It will be used as an initial
+// history.
+func WithEncoderDictRaw(id uint32, content []byte) EOption {
+ return func(o *encoderOptions) error {
+ if bits.UintSize > 32 && uint(len(content)) > dictMaxLength {
+ return fmt.Errorf("dictionary of size %d > 2GiB too large", len(content))
+ }
+ o.dict = &dict{id: id, content: content, offsets: [3]int{1, 4, 8}}
+ return nil
+ }
+}
diff --git a/vendor/github.com/klauspost/compress/zstd/framedec.go b/vendor/github.com/klauspost/compress/zstd/framedec.go
new file mode 100644
index 00000000..e47af66e
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/framedec.go
@@ -0,0 +1,415 @@
+// Copyright 2019+ Klaus Post. All rights reserved.
+// License information can be found in the LICENSE file.
+// Based on work by Yann Collet, released under BSD License.
+
+package zstd
+
+import (
+ "encoding/binary"
+ "encoding/hex"
+ "errors"
+ "io"
+
+ "github.com/klauspost/compress/zstd/internal/xxhash"
+)
+
+type frameDec struct {
+ o decoderOptions
+ crc *xxhash.Digest
+
+ WindowSize uint64
+
+ // Frame history passed between blocks
+ history history
+
+ rawInput byteBuffer
+
+ // Byte buffer that can be reused for small input blocks.
+ bBuf byteBuf
+
+ FrameContentSize uint64
+
+ DictionaryID uint32
+ HasCheckSum bool
+ SingleSegment bool
+}
+
+const (
+ // MinWindowSize is the minimum Window Size, which is 1 KB.
+ MinWindowSize = 1 << 10
+
+ // MaxWindowSize is the maximum encoder window size
+ // and the default decoder maximum window size.
+ MaxWindowSize = 1 << 29
+)
+
+const (
+ frameMagic = "\x28\xb5\x2f\xfd"
+ skippableFrameMagic = "\x2a\x4d\x18"
+)
+
+func newFrameDec(o decoderOptions) *frameDec {
+ if o.maxWindowSize > o.maxDecodedSize {
+ o.maxWindowSize = o.maxDecodedSize
+ }
+ d := frameDec{
+ o: o,
+ }
+ return &d
+}
+
+// reset will read the frame header and prepare for block decoding.
+// If nothing can be read from the input, io.EOF will be returned.
+// Any other error indicated that the stream contained data, but
+// there was a problem.
+func (d *frameDec) reset(br byteBuffer) error {
+ d.HasCheckSum = false
+ d.WindowSize = 0
+ var signature [4]byte
+ for {
+ var err error
+ // Check if we can read more...
+ b, err := br.readSmall(1)
+ switch err {
+ case io.EOF, io.ErrUnexpectedEOF:
+ return io.EOF
+ case nil:
+ signature[0] = b[0]
+ default:
+ return err
+ }
+ // Read the rest, don't allow io.ErrUnexpectedEOF
+ b, err = br.readSmall(3)
+ switch err {
+ case io.EOF:
+ return io.EOF
+ case nil:
+ copy(signature[1:], b)
+ default:
+ return err
+ }
+
+ if string(signature[1:4]) != skippableFrameMagic || signature[0]&0xf0 != 0x50 {
+ if debugDecoder {
+ println("Not skippable", hex.EncodeToString(signature[:]), hex.EncodeToString([]byte(skippableFrameMagic)))
+ }
+ // Break if not skippable frame.
+ break
+ }
+ // Read size to skip
+ b, err = br.readSmall(4)
+ if err != nil {
+ if debugDecoder {
+ println("Reading Frame Size", err)
+ }
+ return err
+ }
+ n := uint32(b[0]) | (uint32(b[1]) << 8) | (uint32(b[2]) << 16) | (uint32(b[3]) << 24)
+ println("Skipping frame with", n, "bytes.")
+ err = br.skipN(int64(n))
+ if err != nil {
+ if debugDecoder {
+ println("Reading discarded frame", err)
+ }
+ return err
+ }
+ }
+ if string(signature[:]) != frameMagic {
+ if debugDecoder {
+ println("Got magic numbers: ", signature, "want:", []byte(frameMagic))
+ }
+ return ErrMagicMismatch
+ }
+
+ // Read Frame_Header_Descriptor
+ fhd, err := br.readByte()
+ if err != nil {
+ if debugDecoder {
+ println("Reading Frame_Header_Descriptor", err)
+ }
+ return err
+ }
+ d.SingleSegment = fhd&(1<<5) != 0
+
+ if fhd&(1<<3) != 0 {
+ return errors.New("reserved bit set on frame header")
+ }
+
+ // Read Window_Descriptor
+ // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#window_descriptor
+ d.WindowSize = 0
+ if !d.SingleSegment {
+ wd, err := br.readByte()
+ if err != nil {
+ if debugDecoder {
+ println("Reading Window_Descriptor", err)
+ }
+ return err
+ }
+ if debugDecoder {
+ printf("raw: %x, mantissa: %d, exponent: %d\n", wd, wd&7, wd>>3)
+ }
+ windowLog := 10 + (wd >> 3)
+ windowBase := uint64(1) << windowLog
+ windowAdd := (windowBase / 8) * uint64(wd&0x7)
+ d.WindowSize = windowBase + windowAdd
+ }
+
+ // Read Dictionary_ID
+ // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#dictionary_id
+ d.DictionaryID = 0
+ if size := fhd & 3; size != 0 {
+ if size == 3 {
+ size = 4
+ }
+
+ b, err := br.readSmall(int(size))
+ if err != nil {
+ println("Reading Dictionary_ID", err)
+ return err
+ }
+ var id uint32
+ switch len(b) {
+ case 1:
+ id = uint32(b[0])
+ case 2:
+ id = uint32(b[0]) | (uint32(b[1]) << 8)
+ case 4:
+ id = uint32(b[0]) | (uint32(b[1]) << 8) | (uint32(b[2]) << 16) | (uint32(b[3]) << 24)
+ }
+ if debugDecoder {
+ println("Dict size", size, "ID:", id)
+ }
+ d.DictionaryID = id
+ }
+
+ // Read Frame_Content_Size
+ // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#frame_content_size
+ var fcsSize int
+ v := fhd >> 6
+ switch v {
+ case 0:
+ if d.SingleSegment {
+ fcsSize = 1
+ }
+ default:
+ fcsSize = 1 << v
+ }
+ d.FrameContentSize = fcsUnknown
+ if fcsSize > 0 {
+ b, err := br.readSmall(fcsSize)
+ if err != nil {
+ println("Reading Frame content", err)
+ return err
+ }
+ switch len(b) {
+ case 1:
+ d.FrameContentSize = uint64(b[0])
+ case 2:
+ // When FCS_Field_Size is 2, the offset of 256 is added.
+ d.FrameContentSize = uint64(b[0]) | (uint64(b[1]) << 8) + 256
+ case 4:
+ d.FrameContentSize = uint64(b[0]) | (uint64(b[1]) << 8) | (uint64(b[2]) << 16) | (uint64(b[3]) << 24)
+ case 8:
+ d1 := uint32(b[0]) | (uint32(b[1]) << 8) | (uint32(b[2]) << 16) | (uint32(b[3]) << 24)
+ d2 := uint32(b[4]) | (uint32(b[5]) << 8) | (uint32(b[6]) << 16) | (uint32(b[7]) << 24)
+ d.FrameContentSize = uint64(d1) | (uint64(d2) << 32)
+ }
+ if debugDecoder {
+ println("Read FCS:", d.FrameContentSize)
+ }
+ }
+
+ // Move this to shared.
+ d.HasCheckSum = fhd&(1<<2) != 0
+ if d.HasCheckSum {
+ if d.crc == nil {
+ d.crc = xxhash.New()
+ }
+ d.crc.Reset()
+ }
+
+ if d.WindowSize > d.o.maxWindowSize {
+ if debugDecoder {
+ printf("window size %d > max %d\n", d.WindowSize, d.o.maxWindowSize)
+ }
+ return ErrWindowSizeExceeded
+ }
+
+ if d.WindowSize == 0 && d.SingleSegment {
+ // We may not need window in this case.
+ d.WindowSize = d.FrameContentSize
+ if d.WindowSize < MinWindowSize {
+ d.WindowSize = MinWindowSize
+ }
+ if d.WindowSize > d.o.maxDecodedSize {
+ if debugDecoder {
+ printf("window size %d > max %d\n", d.WindowSize, d.o.maxWindowSize)
+ }
+ return ErrDecoderSizeExceeded
+ }
+ }
+
+ // The minimum Window_Size is 1 KB.
+ if d.WindowSize < MinWindowSize {
+ if debugDecoder {
+ println("got window size: ", d.WindowSize)
+ }
+ return ErrWindowSizeTooSmall
+ }
+ d.history.windowSize = int(d.WindowSize)
+ if !d.o.lowMem || d.history.windowSize < maxBlockSize {
+ // Alloc 2x window size if not low-mem, or window size below 2MB.
+ d.history.allocFrameBuffer = d.history.windowSize * 2
+ } else {
+ if d.o.lowMem {
+ // Alloc with 1MB extra.
+ d.history.allocFrameBuffer = d.history.windowSize + maxBlockSize/2
+ } else {
+ // Alloc with 2MB extra.
+ d.history.allocFrameBuffer = d.history.windowSize + maxBlockSize
+ }
+ }
+
+ if debugDecoder {
+ println("Frame: Dict:", d.DictionaryID, "FrameContentSize:", d.FrameContentSize, "singleseg:", d.SingleSegment, "window:", d.WindowSize, "crc:", d.HasCheckSum)
+ }
+
+ // history contains input - maybe we do something
+ d.rawInput = br
+ return nil
+}
+
+// next will start decoding the next block from stream.
+func (d *frameDec) next(block *blockDec) error {
+ if debugDecoder {
+ println("decoding new block")
+ }
+ err := block.reset(d.rawInput, d.WindowSize)
+ if err != nil {
+ println("block error:", err)
+ // Signal the frame decoder we have a problem.
+ block.sendErr(err)
+ return err
+ }
+ return nil
+}
+
+// checkCRC will check the checksum, assuming the frame has one.
+// Will return ErrCRCMismatch if crc check failed, otherwise nil.
+func (d *frameDec) checkCRC() error {
+ // We can overwrite upper tmp now
+ buf, err := d.rawInput.readSmall(4)
+ if err != nil {
+ println("CRC missing?", err)
+ return err
+ }
+
+ want := binary.LittleEndian.Uint32(buf[:4])
+ got := uint32(d.crc.Sum64())
+
+ if got != want {
+ if debugDecoder {
+ printf("CRC check failed: got %08x, want %08x\n", got, want)
+ }
+ return ErrCRCMismatch
+ }
+ if debugDecoder {
+ printf("CRC ok %08x\n", got)
+ }
+ return nil
+}
+
+// consumeCRC skips over the checksum, assuming the frame has one.
+func (d *frameDec) consumeCRC() error {
+ _, err := d.rawInput.readSmall(4)
+ if err != nil {
+ println("CRC missing?", err)
+ }
+ return err
+}
+
+// runDecoder will run the decoder for the remainder of the frame.
+func (d *frameDec) runDecoder(dst []byte, dec *blockDec) ([]byte, error) {
+ saved := d.history.b
+
+ // We use the history for output to avoid copying it.
+ d.history.b = dst
+ d.history.ignoreBuffer = len(dst)
+ // Store input length, so we only check new data.
+ crcStart := len(dst)
+ d.history.decoders.maxSyncLen = 0
+ if d.o.limitToCap {
+ d.history.decoders.maxSyncLen = uint64(cap(dst) - len(dst))
+ }
+ if d.FrameContentSize != fcsUnknown {
+ if !d.o.limitToCap || d.FrameContentSize+uint64(len(dst)) < d.history.decoders.maxSyncLen {
+ d.history.decoders.maxSyncLen = d.FrameContentSize + uint64(len(dst))
+ }
+ if d.history.decoders.maxSyncLen > d.o.maxDecodedSize {
+ if debugDecoder {
+ println("maxSyncLen:", d.history.decoders.maxSyncLen, "> maxDecodedSize:", d.o.maxDecodedSize)
+ }
+ return dst, ErrDecoderSizeExceeded
+ }
+ if debugDecoder {
+ println("maxSyncLen:", d.history.decoders.maxSyncLen)
+ }
+ if !d.o.limitToCap && uint64(cap(dst)) < d.history.decoders.maxSyncLen {
+ // Alloc for output
+ dst2 := make([]byte, len(dst), d.history.decoders.maxSyncLen+compressedBlockOverAlloc)
+ copy(dst2, dst)
+ dst = dst2
+ }
+ }
+ var err error
+ for {
+ err = dec.reset(d.rawInput, d.WindowSize)
+ if err != nil {
+ break
+ }
+ if debugDecoder {
+ println("next block:", dec)
+ }
+ err = dec.decodeBuf(&d.history)
+ if err != nil {
+ break
+ }
+ if uint64(len(d.history.b)-crcStart) > d.o.maxDecodedSize {
+ println("runDecoder: maxDecodedSize exceeded", uint64(len(d.history.b)-crcStart), ">", d.o.maxDecodedSize)
+ err = ErrDecoderSizeExceeded
+ break
+ }
+ if d.o.limitToCap && len(d.history.b) > cap(dst) {
+ println("runDecoder: cap exceeded", uint64(len(d.history.b)), ">", cap(dst))
+ err = ErrDecoderSizeExceeded
+ break
+ }
+ if uint64(len(d.history.b)-crcStart) > d.FrameContentSize {
+ println("runDecoder: FrameContentSize exceeded", uint64(len(d.history.b)-crcStart), ">", d.FrameContentSize)
+ err = ErrFrameSizeExceeded
+ break
+ }
+ if dec.Last {
+ break
+ }
+ if debugDecoder {
+ println("runDecoder: FrameContentSize", uint64(len(d.history.b)-crcStart), "<=", d.FrameContentSize)
+ }
+ }
+ dst = d.history.b
+ if err == nil {
+ if d.FrameContentSize != fcsUnknown && uint64(len(d.history.b)-crcStart) != d.FrameContentSize {
+ err = ErrFrameSizeMismatch
+ } else if d.HasCheckSum {
+ if d.o.ignoreChecksum {
+ err = d.consumeCRC()
+ } else {
+ d.crc.Write(dst[crcStart:])
+ err = d.checkCRC()
+ }
+ }
+ }
+ d.history.b = saved
+ return dst, err
+}
diff --git a/vendor/github.com/klauspost/compress/zstd/frameenc.go b/vendor/github.com/klauspost/compress/zstd/frameenc.go
new file mode 100644
index 00000000..667ca067
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/frameenc.go
@@ -0,0 +1,137 @@
+// Copyright 2019+ Klaus Post. All rights reserved.
+// License information can be found in the LICENSE file.
+// Based on work by Yann Collet, released under BSD License.
+
+package zstd
+
+import (
+ "encoding/binary"
+ "fmt"
+ "io"
+ "math"
+ "math/bits"
+)
+
+type frameHeader struct {
+ ContentSize uint64
+ WindowSize uint32
+ SingleSegment bool
+ Checksum bool
+ DictID uint32
+}
+
+const maxHeaderSize = 14
+
+func (f frameHeader) appendTo(dst []byte) []byte {
+ dst = append(dst, frameMagic...)
+ var fhd uint8
+ if f.Checksum {
+ fhd |= 1 << 2
+ }
+ if f.SingleSegment {
+ fhd |= 1 << 5
+ }
+
+ var dictIDContent []byte
+ if f.DictID > 0 {
+ var tmp [4]byte
+ if f.DictID < 256 {
+ fhd |= 1
+ tmp[0] = uint8(f.DictID)
+ dictIDContent = tmp[:1]
+ } else if f.DictID < 1<<16 {
+ fhd |= 2
+ binary.LittleEndian.PutUint16(tmp[:2], uint16(f.DictID))
+ dictIDContent = tmp[:2]
+ } else {
+ fhd |= 3
+ binary.LittleEndian.PutUint32(tmp[:4], f.DictID)
+ dictIDContent = tmp[:4]
+ }
+ }
+ var fcs uint8
+ if f.ContentSize >= 256 {
+ fcs++
+ }
+ if f.ContentSize >= 65536+256 {
+ fcs++
+ }
+ if f.ContentSize >= 0xffffffff {
+ fcs++
+ }
+
+ fhd |= fcs << 6
+
+ dst = append(dst, fhd)
+ if !f.SingleSegment {
+ const winLogMin = 10
+ windowLog := (bits.Len32(f.WindowSize-1) - winLogMin) << 3
+ dst = append(dst, uint8(windowLog))
+ }
+ if f.DictID > 0 {
+ dst = append(dst, dictIDContent...)
+ }
+ switch fcs {
+ case 0:
+ if f.SingleSegment {
+ dst = append(dst, uint8(f.ContentSize))
+ }
+ // Unless SingleSegment is set, framessizes < 256 are not stored.
+ case 1:
+ f.ContentSize -= 256
+ dst = append(dst, uint8(f.ContentSize), uint8(f.ContentSize>>8))
+ case 2:
+ dst = append(dst, uint8(f.ContentSize), uint8(f.ContentSize>>8), uint8(f.ContentSize>>16), uint8(f.ContentSize>>24))
+ case 3:
+ dst = append(dst, uint8(f.ContentSize), uint8(f.ContentSize>>8), uint8(f.ContentSize>>16), uint8(f.ContentSize>>24),
+ uint8(f.ContentSize>>32), uint8(f.ContentSize>>40), uint8(f.ContentSize>>48), uint8(f.ContentSize>>56))
+ default:
+ panic("invalid fcs")
+ }
+ return dst
+}
+
+const skippableFrameHeader = 4 + 4
+
+// calcSkippableFrame will return a total size to be added for written
+// to be divisible by multiple.
+// The value will always be > skippableFrameHeader.
+// The function will panic if written < 0 or wantMultiple <= 0.
+func calcSkippableFrame(written, wantMultiple int64) int {
+ if wantMultiple <= 0 {
+ panic("wantMultiple <= 0")
+ }
+ if written < 0 {
+ panic("written < 0")
+ }
+ leftOver := written % wantMultiple
+ if leftOver == 0 {
+ return 0
+ }
+ toAdd := wantMultiple - leftOver
+ for toAdd < skippableFrameHeader {
+ toAdd += wantMultiple
+ }
+ return int(toAdd)
+}
+
+// skippableFrame will add a skippable frame with a total size of bytes.
+// total should be >= skippableFrameHeader and < math.MaxUint32.
+func skippableFrame(dst []byte, total int, r io.Reader) ([]byte, error) {
+ if total == 0 {
+ return dst, nil
+ }
+ if total < skippableFrameHeader {
+ return dst, fmt.Errorf("requested skippable frame (%d) < 8", total)
+ }
+ if int64(total) > math.MaxUint32 {
+ return dst, fmt.Errorf("requested skippable frame (%d) > max uint32", total)
+ }
+ dst = append(dst, 0x50, 0x2a, 0x4d, 0x18)
+ f := uint32(total - skippableFrameHeader)
+ dst = append(dst, uint8(f), uint8(f>>8), uint8(f>>16), uint8(f>>24))
+ start := len(dst)
+ dst = append(dst, make([]byte, f)...)
+ _, err := io.ReadFull(r, dst[start:])
+ return dst, err
+}
diff --git a/vendor/github.com/klauspost/compress/zstd/fse_decoder.go b/vendor/github.com/klauspost/compress/zstd/fse_decoder.go
new file mode 100644
index 00000000..2f8860a7
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/fse_decoder.go
@@ -0,0 +1,307 @@
+// Copyright 2019+ Klaus Post. All rights reserved.
+// License information can be found in the LICENSE file.
+// Based on work by Yann Collet, released under BSD License.
+
+package zstd
+
+import (
+ "encoding/binary"
+ "errors"
+ "fmt"
+ "io"
+)
+
+const (
+ tablelogAbsoluteMax = 9
+)
+
+const (
+ /*!MEMORY_USAGE :
+ * Memory usage formula : N->2^N Bytes (examples : 10 -> 1KB; 12 -> 4KB ; 16 -> 64KB; 20 -> 1MB; etc.)
+ * Increasing memory usage improves compression ratio
+ * Reduced memory usage can improve speed, due to cache effect
+ * Recommended max value is 14, for 16KB, which nicely fits into Intel x86 L1 cache */
+ maxMemoryUsage = tablelogAbsoluteMax + 2
+
+ maxTableLog = maxMemoryUsage - 2
+ maxTablesize = 1 << maxTableLog
+ maxTableMask = (1 << maxTableLog) - 1
+ minTablelog = 5
+ maxSymbolValue = 255
+)
+
+// fseDecoder provides temporary storage for compression and decompression.
+type fseDecoder struct {
+ dt [maxTablesize]decSymbol // Decompression table.
+ symbolLen uint16 // Length of active part of the symbol table.
+ actualTableLog uint8 // Selected tablelog.
+ maxBits uint8 // Maximum number of additional bits
+
+ // used for table creation to avoid allocations.
+ stateTable [256]uint16
+ norm [maxSymbolValue + 1]int16
+ preDefined bool
+}
+
+// tableStep returns the next table index.
+func tableStep(tableSize uint32) uint32 {
+ return (tableSize >> 1) + (tableSize >> 3) + 3
+}
+
+// readNCount will read the symbol distribution so decoding tables can be constructed.
+func (s *fseDecoder) readNCount(b *byteReader, maxSymbol uint16) error {
+ var (
+ charnum uint16
+ previous0 bool
+ )
+ if b.remain() < 4 {
+ return errors.New("input too small")
+ }
+ bitStream := b.Uint32NC()
+ nbBits := uint((bitStream & 0xF) + minTablelog) // extract tableLog
+ if nbBits > tablelogAbsoluteMax {
+ println("Invalid tablelog:", nbBits)
+ return errors.New("tableLog too large")
+ }
+ bitStream >>= 4
+ bitCount := uint(4)
+
+ s.actualTableLog = uint8(nbBits)
+ remaining := int32((1 << nbBits) + 1)
+ threshold := int32(1 << nbBits)
+ gotTotal := int32(0)
+ nbBits++
+
+ for remaining > 1 && charnum <= maxSymbol {
+ if previous0 {
+ //println("prev0")
+ n0 := charnum
+ for (bitStream & 0xFFFF) == 0xFFFF {
+ //println("24 x 0")
+ n0 += 24
+ if r := b.remain(); r > 5 {
+ b.advance(2)
+ // The check above should make sure we can read 32 bits
+ bitStream = b.Uint32NC() >> bitCount
+ } else {
+ // end of bit stream
+ bitStream >>= 16
+ bitCount += 16
+ }
+ }
+ //printf("bitstream: %d, 0b%b", bitStream&3, bitStream)
+ for (bitStream & 3) == 3 {
+ n0 += 3
+ bitStream >>= 2
+ bitCount += 2
+ }
+ n0 += uint16(bitStream & 3)
+ bitCount += 2
+
+ if n0 > maxSymbolValue {
+ return errors.New("maxSymbolValue too small")
+ }
+ //println("inserting ", n0-charnum, "zeroes from idx", charnum, "ending before", n0)
+ for charnum < n0 {
+ s.norm[uint8(charnum)] = 0
+ charnum++
+ }
+
+ if r := b.remain(); r >= 7 || r-int(bitCount>>3) >= 4 {
+ b.advance(bitCount >> 3)
+ bitCount &= 7
+ // The check above should make sure we can read 32 bits
+ bitStream = b.Uint32NC() >> bitCount
+ } else {
+ bitStream >>= 2
+ }
+ }
+
+ max := (2*threshold - 1) - remaining
+ var count int32
+
+ if int32(bitStream)&(threshold-1) < max {
+ count = int32(bitStream) & (threshold - 1)
+ if debugAsserts && nbBits < 1 {
+ panic("nbBits underflow")
+ }
+ bitCount += nbBits - 1
+ } else {
+ count = int32(bitStream) & (2*threshold - 1)
+ if count >= threshold {
+ count -= max
+ }
+ bitCount += nbBits
+ }
+
+ // extra accuracy
+ count--
+ if count < 0 {
+ // -1 means +1
+ remaining += count
+ gotTotal -= count
+ } else {
+ remaining -= count
+ gotTotal += count
+ }
+ s.norm[charnum&0xff] = int16(count)
+ charnum++
+ previous0 = count == 0
+ for remaining < threshold {
+ nbBits--
+ threshold >>= 1
+ }
+
+ if r := b.remain(); r >= 7 || r-int(bitCount>>3) >= 4 {
+ b.advance(bitCount >> 3)
+ bitCount &= 7
+ // The check above should make sure we can read 32 bits
+ bitStream = b.Uint32NC() >> (bitCount & 31)
+ } else {
+ bitCount -= (uint)(8 * (len(b.b) - 4 - b.off))
+ b.off = len(b.b) - 4
+ bitStream = b.Uint32() >> (bitCount & 31)
+ }
+ }
+ s.symbolLen = charnum
+ if s.symbolLen <= 1 {
+ return fmt.Errorf("symbolLen (%d) too small", s.symbolLen)
+ }
+ if s.symbolLen > maxSymbolValue+1 {
+ return fmt.Errorf("symbolLen (%d) too big", s.symbolLen)
+ }
+ if remaining != 1 {
+ return fmt.Errorf("corruption detected (remaining %d != 1)", remaining)
+ }
+ if bitCount > 32 {
+ return fmt.Errorf("corruption detected (bitCount %d > 32)", bitCount)
+ }
+ if gotTotal != 1<> 3)
+ return s.buildDtable()
+}
+
+func (s *fseDecoder) mustReadFrom(r io.Reader) {
+ fatalErr := func(err error) {
+ if err != nil {
+ panic(err)
+ }
+ }
+ // dt [maxTablesize]decSymbol // Decompression table.
+ // symbolLen uint16 // Length of active part of the symbol table.
+ // actualTableLog uint8 // Selected tablelog.
+ // maxBits uint8 // Maximum number of additional bits
+ // // used for table creation to avoid allocations.
+ // stateTable [256]uint16
+ // norm [maxSymbolValue + 1]int16
+ // preDefined bool
+ fatalErr(binary.Read(r, binary.LittleEndian, &s.dt))
+ fatalErr(binary.Read(r, binary.LittleEndian, &s.symbolLen))
+ fatalErr(binary.Read(r, binary.LittleEndian, &s.actualTableLog))
+ fatalErr(binary.Read(r, binary.LittleEndian, &s.maxBits))
+ fatalErr(binary.Read(r, binary.LittleEndian, &s.stateTable))
+ fatalErr(binary.Read(r, binary.LittleEndian, &s.norm))
+ fatalErr(binary.Read(r, binary.LittleEndian, &s.preDefined))
+}
+
+// decSymbol contains information about a state entry,
+// Including the state offset base, the output symbol and
+// the number of bits to read for the low part of the destination state.
+// Using a composite uint64 is faster than a struct with separate members.
+type decSymbol uint64
+
+func newDecSymbol(nbits, addBits uint8, newState uint16, baseline uint32) decSymbol {
+ return decSymbol(nbits) | (decSymbol(addBits) << 8) | (decSymbol(newState) << 16) | (decSymbol(baseline) << 32)
+}
+
+func (d decSymbol) nbBits() uint8 {
+ return uint8(d)
+}
+
+func (d decSymbol) addBits() uint8 {
+ return uint8(d >> 8)
+}
+
+func (d decSymbol) newState() uint16 {
+ return uint16(d >> 16)
+}
+
+func (d decSymbol) baselineInt() int {
+ return int(d >> 32)
+}
+
+func (d *decSymbol) setNBits(nBits uint8) {
+ const mask = 0xffffffffffffff00
+ *d = (*d & mask) | decSymbol(nBits)
+}
+
+func (d *decSymbol) setAddBits(addBits uint8) {
+ const mask = 0xffffffffffff00ff
+ *d = (*d & mask) | (decSymbol(addBits) << 8)
+}
+
+func (d *decSymbol) setNewState(state uint16) {
+ const mask = 0xffffffff0000ffff
+ *d = (*d & mask) | decSymbol(state)<<16
+}
+
+func (d *decSymbol) setExt(addBits uint8, baseline uint32) {
+ const mask = 0xffff00ff
+ *d = (*d & mask) | (decSymbol(addBits) << 8) | (decSymbol(baseline) << 32)
+}
+
+// decSymbolValue returns the transformed decSymbol for the given symbol.
+func decSymbolValue(symb uint8, t []baseOffset) (decSymbol, error) {
+ if int(symb) >= len(t) {
+ return 0, fmt.Errorf("rle symbol %d >= max %d", symb, len(t))
+ }
+ lu := t[symb]
+ return newDecSymbol(0, lu.addBits, 0, lu.baseLine), nil
+}
+
+// setRLE will set the decoder til RLE mode.
+func (s *fseDecoder) setRLE(symbol decSymbol) {
+ s.actualTableLog = 0
+ s.maxBits = symbol.addBits()
+ s.dt[0] = symbol
+}
+
+// transform will transform the decoder table into a table usable for
+// decoding without having to apply the transformation while decoding.
+// The state will contain the base value and the number of bits to read.
+func (s *fseDecoder) transform(t []baseOffset) error {
+ tableSize := uint16(1 << s.actualTableLog)
+ s.maxBits = 0
+ for i, v := range s.dt[:tableSize] {
+ add := v.addBits()
+ if int(add) >= len(t) {
+ return fmt.Errorf("invalid decoding table entry %d, symbol %d >= max (%d)", i, v.addBits(), len(t))
+ }
+ lu := t[add]
+ if lu.addBits > s.maxBits {
+ s.maxBits = lu.addBits
+ }
+ v.setExt(lu.addBits, lu.baseLine)
+ s.dt[i] = v
+ }
+ return nil
+}
+
+type fseState struct {
+ dt []decSymbol
+ state decSymbol
+}
+
+// Initialize and decodeAsync first state and symbol.
+func (s *fseState) init(br *bitReader, tableLog uint8, dt []decSymbol) {
+ s.dt = dt
+ br.fill()
+ s.state = dt[br.getBits(tableLog)]
+}
+
+// final returns the current state symbol without decoding the next.
+func (s decSymbol) final() (int, uint8) {
+ return s.baselineInt(), s.addBits()
+}
diff --git a/vendor/github.com/klauspost/compress/zstd/fse_decoder_amd64.go b/vendor/github.com/klauspost/compress/zstd/fse_decoder_amd64.go
new file mode 100644
index 00000000..d04a829b
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/fse_decoder_amd64.go
@@ -0,0 +1,65 @@
+//go:build amd64 && !appengine && !noasm && gc
+// +build amd64,!appengine,!noasm,gc
+
+package zstd
+
+import (
+ "fmt"
+)
+
+type buildDtableAsmContext struct {
+ // inputs
+ stateTable *uint16
+ norm *int16
+ dt *uint64
+
+ // outputs --- set by the procedure in the case of error;
+ // for interpretation please see the error handling part below
+ errParam1 uint64
+ errParam2 uint64
+}
+
+// buildDtable_asm is an x86 assembly implementation of fseDecoder.buildDtable.
+// Function returns non-zero exit code on error.
+//
+//go:noescape
+func buildDtable_asm(s *fseDecoder, ctx *buildDtableAsmContext) int
+
+// please keep in sync with _generate/gen_fse.go
+const (
+ errorCorruptedNormalizedCounter = 1
+ errorNewStateTooBig = 2
+ errorNewStateNoBits = 3
+)
+
+// buildDtable will build the decoding table.
+func (s *fseDecoder) buildDtable() error {
+ ctx := buildDtableAsmContext{
+ stateTable: &s.stateTable[0],
+ norm: &s.norm[0],
+ dt: (*uint64)(&s.dt[0]),
+ }
+ code := buildDtable_asm(s, &ctx)
+
+ if code != 0 {
+ switch code {
+ case errorCorruptedNormalizedCounter:
+ position := ctx.errParam1
+ return fmt.Errorf("corrupted input (position=%d, expected 0)", position)
+
+ case errorNewStateTooBig:
+ newState := decSymbol(ctx.errParam1)
+ size := ctx.errParam2
+ return fmt.Errorf("newState (%d) outside table size (%d)", newState, size)
+
+ case errorNewStateNoBits:
+ newState := decSymbol(ctx.errParam1)
+ oldState := decSymbol(ctx.errParam2)
+ return fmt.Errorf("newState (%d) == oldState (%d) and no bits", newState, oldState)
+
+ default:
+ return fmt.Errorf("buildDtable_asm returned unhandled nonzero code = %d", code)
+ }
+ }
+ return nil
+}
diff --git a/vendor/github.com/klauspost/compress/zstd/fse_decoder_amd64.s b/vendor/github.com/klauspost/compress/zstd/fse_decoder_amd64.s
new file mode 100644
index 00000000..bcde3986
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/fse_decoder_amd64.s
@@ -0,0 +1,126 @@
+// Code generated by command: go run gen_fse.go -out ../fse_decoder_amd64.s -pkg=zstd. DO NOT EDIT.
+
+//go:build !appengine && !noasm && gc && !noasm
+
+// func buildDtable_asm(s *fseDecoder, ctx *buildDtableAsmContext) int
+TEXT ·buildDtable_asm(SB), $0-24
+ MOVQ ctx+8(FP), CX
+ MOVQ s+0(FP), DI
+
+ // Load values
+ MOVBQZX 4098(DI), DX
+ XORQ AX, AX
+ BTSQ DX, AX
+ MOVQ (CX), BX
+ MOVQ 16(CX), SI
+ LEAQ -1(AX), R8
+ MOVQ 8(CX), CX
+ MOVWQZX 4096(DI), DI
+
+ // End load values
+ // Init, lay down lowprob symbols
+ XORQ R9, R9
+ JMP init_main_loop_condition
+
+init_main_loop:
+ MOVWQSX (CX)(R9*2), R10
+ CMPW R10, $-1
+ JNE do_not_update_high_threshold
+ MOVB R9, 1(SI)(R8*8)
+ DECQ R8
+ MOVQ $0x0000000000000001, R10
+
+do_not_update_high_threshold:
+ MOVW R10, (BX)(R9*2)
+ INCQ R9
+
+init_main_loop_condition:
+ CMPQ R9, DI
+ JL init_main_loop
+
+ // Spread symbols
+ // Calculate table step
+ MOVQ AX, R9
+ SHRQ $0x01, R9
+ MOVQ AX, R10
+ SHRQ $0x03, R10
+ LEAQ 3(R9)(R10*1), R9
+
+ // Fill add bits values
+ LEAQ -1(AX), R10
+ XORQ R11, R11
+ XORQ R12, R12
+ JMP spread_main_loop_condition
+
+spread_main_loop:
+ XORQ R13, R13
+ MOVWQSX (CX)(R12*2), R14
+ JMP spread_inner_loop_condition
+
+spread_inner_loop:
+ MOVB R12, 1(SI)(R11*8)
+
+adjust_position:
+ ADDQ R9, R11
+ ANDQ R10, R11
+ CMPQ R11, R8
+ JG adjust_position
+ INCQ R13
+
+spread_inner_loop_condition:
+ CMPQ R13, R14
+ JL spread_inner_loop
+ INCQ R12
+
+spread_main_loop_condition:
+ CMPQ R12, DI
+ JL spread_main_loop
+ TESTQ R11, R11
+ JZ spread_check_ok
+ MOVQ ctx+8(FP), AX
+ MOVQ R11, 24(AX)
+ MOVQ $+1, ret+16(FP)
+ RET
+
+spread_check_ok:
+ // Build Decoding table
+ XORQ DI, DI
+
+build_table_main_table:
+ MOVBQZX 1(SI)(DI*8), CX
+ MOVWQZX (BX)(CX*2), R8
+ LEAQ 1(R8), R9
+ MOVW R9, (BX)(CX*2)
+ MOVQ R8, R9
+ BSRQ R9, R9
+ MOVQ DX, CX
+ SUBQ R9, CX
+ SHLQ CL, R8
+ SUBQ AX, R8
+ MOVB CL, (SI)(DI*8)
+ MOVW R8, 2(SI)(DI*8)
+ CMPQ R8, AX
+ JLE build_table_check1_ok
+ MOVQ ctx+8(FP), CX
+ MOVQ R8, 24(CX)
+ MOVQ AX, 32(CX)
+ MOVQ $+2, ret+16(FP)
+ RET
+
+build_table_check1_ok:
+ TESTB CL, CL
+ JNZ build_table_check2_ok
+ CMPW R8, DI
+ JNE build_table_check2_ok
+ MOVQ ctx+8(FP), AX
+ MOVQ R8, 24(AX)
+ MOVQ DI, 32(AX)
+ MOVQ $+3, ret+16(FP)
+ RET
+
+build_table_check2_ok:
+ INCQ DI
+ CMPQ DI, AX
+ JL build_table_main_table
+ MOVQ $+0, ret+16(FP)
+ RET
diff --git a/vendor/github.com/klauspost/compress/zstd/fse_decoder_generic.go b/vendor/github.com/klauspost/compress/zstd/fse_decoder_generic.go
new file mode 100644
index 00000000..8adfebb0
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/fse_decoder_generic.go
@@ -0,0 +1,73 @@
+//go:build !amd64 || appengine || !gc || noasm
+// +build !amd64 appengine !gc noasm
+
+package zstd
+
+import (
+ "errors"
+ "fmt"
+)
+
+// buildDtable will build the decoding table.
+func (s *fseDecoder) buildDtable() error {
+ tableSize := uint32(1 << s.actualTableLog)
+ highThreshold := tableSize - 1
+ symbolNext := s.stateTable[:256]
+
+ // Init, lay down lowprob symbols
+ {
+ for i, v := range s.norm[:s.symbolLen] {
+ if v == -1 {
+ s.dt[highThreshold].setAddBits(uint8(i))
+ highThreshold--
+ v = 1
+ }
+ symbolNext[i] = uint16(v)
+ }
+ }
+
+ // Spread symbols
+ {
+ tableMask := tableSize - 1
+ step := tableStep(tableSize)
+ position := uint32(0)
+ for ss, v := range s.norm[:s.symbolLen] {
+ for i := 0; i < int(v); i++ {
+ s.dt[position].setAddBits(uint8(ss))
+ for {
+ // lowprob area
+ position = (position + step) & tableMask
+ if position <= highThreshold {
+ break
+ }
+ }
+ }
+ }
+ if position != 0 {
+ // position must reach all cells once, otherwise normalizedCounter is incorrect
+ return errors.New("corrupted input (position != 0)")
+ }
+ }
+
+ // Build Decoding table
+ {
+ tableSize := uint16(1 << s.actualTableLog)
+ for u, v := range s.dt[:tableSize] {
+ symbol := v.addBits()
+ nextState := symbolNext[symbol]
+ symbolNext[symbol] = nextState + 1
+ nBits := s.actualTableLog - byte(highBits(uint32(nextState)))
+ s.dt[u&maxTableMask].setNBits(nBits)
+ newState := (nextState << nBits) - tableSize
+ if newState > tableSize {
+ return fmt.Errorf("newState (%d) outside table size (%d)", newState, tableSize)
+ }
+ if newState == uint16(u) && nBits == 0 {
+ // Seems weird that this is possible with nbits > 0.
+ return fmt.Errorf("newState (%d) == oldState (%d) and no bits", newState, u)
+ }
+ s.dt[u&maxTableMask].setNewState(newState)
+ }
+ }
+ return nil
+}
diff --git a/vendor/github.com/klauspost/compress/zstd/fse_encoder.go b/vendor/github.com/klauspost/compress/zstd/fse_encoder.go
new file mode 100644
index 00000000..ab26326a
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/fse_encoder.go
@@ -0,0 +1,701 @@
+// Copyright 2019+ Klaus Post. All rights reserved.
+// License information can be found in the LICENSE file.
+// Based on work by Yann Collet, released under BSD License.
+
+package zstd
+
+import (
+ "errors"
+ "fmt"
+ "math"
+)
+
+const (
+ // For encoding we only support up to
+ maxEncTableLog = 8
+ maxEncTablesize = 1 << maxTableLog
+ maxEncTableMask = (1 << maxTableLog) - 1
+ minEncTablelog = 5
+ maxEncSymbolValue = maxMatchLengthSymbol
+)
+
+// Scratch provides temporary storage for compression and decompression.
+type fseEncoder struct {
+ symbolLen uint16 // Length of active part of the symbol table.
+ actualTableLog uint8 // Selected tablelog.
+ ct cTable // Compression tables.
+ maxCount int // count of the most probable symbol
+ zeroBits bool // no bits has prob > 50%.
+ clearCount bool // clear count
+ useRLE bool // This encoder is for RLE
+ preDefined bool // This encoder is predefined.
+ reUsed bool // Set to know when the encoder has been reused.
+ rleVal uint8 // RLE Symbol
+ maxBits uint8 // Maximum output bits after transform.
+
+ // TODO: Technically zstd should be fine with 64 bytes.
+ count [256]uint32
+ norm [256]int16
+}
+
+// cTable contains tables used for compression.
+type cTable struct {
+ tableSymbol []byte
+ stateTable []uint16
+ symbolTT []symbolTransform
+}
+
+// symbolTransform contains the state transform for a symbol.
+type symbolTransform struct {
+ deltaNbBits uint32
+ deltaFindState int16
+ outBits uint8
+}
+
+// String prints values as a human readable string.
+func (s symbolTransform) String() string {
+ return fmt.Sprintf("{deltabits: %08x, findstate:%d outbits:%d}", s.deltaNbBits, s.deltaFindState, s.outBits)
+}
+
+// Histogram allows to populate the histogram and skip that step in the compression,
+// It otherwise allows to inspect the histogram when compression is done.
+// To indicate that you have populated the histogram call HistogramFinished
+// with the value of the highest populated symbol, as well as the number of entries
+// in the most populated entry. These are accepted at face value.
+func (s *fseEncoder) Histogram() *[256]uint32 {
+ return &s.count
+}
+
+// HistogramFinished can be called to indicate that the histogram has been populated.
+// maxSymbol is the index of the highest set symbol of the next data segment.
+// maxCount is the number of entries in the most populated entry.
+// These are accepted at face value.
+func (s *fseEncoder) HistogramFinished(maxSymbol uint8, maxCount int) {
+ s.maxCount = maxCount
+ s.symbolLen = uint16(maxSymbol) + 1
+ s.clearCount = maxCount != 0
+}
+
+// allocCtable will allocate tables needed for compression.
+// If existing tables a re big enough, they are simply re-used.
+func (s *fseEncoder) allocCtable() {
+ tableSize := 1 << s.actualTableLog
+ // get tableSymbol that is big enough.
+ if cap(s.ct.tableSymbol) < tableSize {
+ s.ct.tableSymbol = make([]byte, tableSize)
+ }
+ s.ct.tableSymbol = s.ct.tableSymbol[:tableSize]
+
+ ctSize := tableSize
+ if cap(s.ct.stateTable) < ctSize {
+ s.ct.stateTable = make([]uint16, ctSize)
+ }
+ s.ct.stateTable = s.ct.stateTable[:ctSize]
+
+ if cap(s.ct.symbolTT) < 256 {
+ s.ct.symbolTT = make([]symbolTransform, 256)
+ }
+ s.ct.symbolTT = s.ct.symbolTT[:256]
+}
+
+// buildCTable will populate the compression table so it is ready to be used.
+func (s *fseEncoder) buildCTable() error {
+ tableSize := uint32(1 << s.actualTableLog)
+ highThreshold := tableSize - 1
+ var cumul [256]int16
+
+ s.allocCtable()
+ tableSymbol := s.ct.tableSymbol[:tableSize]
+ // symbol start positions
+ {
+ cumul[0] = 0
+ for ui, v := range s.norm[:s.symbolLen-1] {
+ u := byte(ui) // one less than reference
+ if v == -1 {
+ // Low proba symbol
+ cumul[u+1] = cumul[u] + 1
+ tableSymbol[highThreshold] = u
+ highThreshold--
+ } else {
+ cumul[u+1] = cumul[u] + v
+ }
+ }
+ // Encode last symbol separately to avoid overflowing u
+ u := int(s.symbolLen - 1)
+ v := s.norm[s.symbolLen-1]
+ if v == -1 {
+ // Low proba symbol
+ cumul[u+1] = cumul[u] + 1
+ tableSymbol[highThreshold] = byte(u)
+ highThreshold--
+ } else {
+ cumul[u+1] = cumul[u] + v
+ }
+ if uint32(cumul[s.symbolLen]) != tableSize {
+ return fmt.Errorf("internal error: expected cumul[s.symbolLen] (%d) == tableSize (%d)", cumul[s.symbolLen], tableSize)
+ }
+ cumul[s.symbolLen] = int16(tableSize) + 1
+ }
+ // Spread symbols
+ s.zeroBits = false
+ {
+ step := tableStep(tableSize)
+ tableMask := tableSize - 1
+ var position uint32
+ // if any symbol > largeLimit, we may have 0 bits output.
+ largeLimit := int16(1 << (s.actualTableLog - 1))
+ for ui, v := range s.norm[:s.symbolLen] {
+ symbol := byte(ui)
+ if v > largeLimit {
+ s.zeroBits = true
+ }
+ for nbOccurrences := int16(0); nbOccurrences < v; nbOccurrences++ {
+ tableSymbol[position] = symbol
+ position = (position + step) & tableMask
+ for position > highThreshold {
+ position = (position + step) & tableMask
+ } /* Low proba area */
+ }
+ }
+
+ // Check if we have gone through all positions
+ if position != 0 {
+ return errors.New("position!=0")
+ }
+ }
+
+ // Build table
+ table := s.ct.stateTable
+ {
+ tsi := int(tableSize)
+ for u, v := range tableSymbol {
+ // TableU16 : sorted by symbol order; gives next state value
+ table[cumul[v]] = uint16(tsi + u)
+ cumul[v]++
+ }
+ }
+
+ // Build Symbol Transformation Table
+ {
+ total := int16(0)
+ symbolTT := s.ct.symbolTT[:s.symbolLen]
+ tableLog := s.actualTableLog
+ tl := (uint32(tableLog) << 16) - (1 << tableLog)
+ for i, v := range s.norm[:s.symbolLen] {
+ switch v {
+ case 0:
+ case -1, 1:
+ symbolTT[i].deltaNbBits = tl
+ symbolTT[i].deltaFindState = total - 1
+ total++
+ default:
+ maxBitsOut := uint32(tableLog) - highBit(uint32(v-1))
+ minStatePlus := uint32(v) << maxBitsOut
+ symbolTT[i].deltaNbBits = (maxBitsOut << 16) - minStatePlus
+ symbolTT[i].deltaFindState = total - v
+ total += v
+ }
+ }
+ if total != int16(tableSize) {
+ return fmt.Errorf("total mismatch %d (got) != %d (want)", total, tableSize)
+ }
+ }
+ return nil
+}
+
+var rtbTable = [...]uint32{0, 473195, 504333, 520860, 550000, 700000, 750000, 830000}
+
+func (s *fseEncoder) setRLE(val byte) {
+ s.allocCtable()
+ s.actualTableLog = 0
+ s.ct.stateTable = s.ct.stateTable[:1]
+ s.ct.symbolTT[val] = symbolTransform{
+ deltaFindState: 0,
+ deltaNbBits: 0,
+ }
+ if debugEncoder {
+ println("setRLE: val", val, "symbolTT", s.ct.symbolTT[val])
+ }
+ s.rleVal = val
+ s.useRLE = true
+}
+
+// setBits will set output bits for the transform.
+// if nil is provided, the number of bits is equal to the index.
+func (s *fseEncoder) setBits(transform []byte) {
+ if s.reUsed || s.preDefined {
+ return
+ }
+ if s.useRLE {
+ if transform == nil {
+ s.ct.symbolTT[s.rleVal].outBits = s.rleVal
+ s.maxBits = s.rleVal
+ return
+ }
+ s.maxBits = transform[s.rleVal]
+ s.ct.symbolTT[s.rleVal].outBits = s.maxBits
+ return
+ }
+ if transform == nil {
+ for i := range s.ct.symbolTT[:s.symbolLen] {
+ s.ct.symbolTT[i].outBits = uint8(i)
+ }
+ s.maxBits = uint8(s.symbolLen - 1)
+ return
+ }
+ s.maxBits = 0
+ for i, v := range transform[:s.symbolLen] {
+ s.ct.symbolTT[i].outBits = v
+ if v > s.maxBits {
+ // We could assume bits always going up, but we play safe.
+ s.maxBits = v
+ }
+ }
+}
+
+// normalizeCount will normalize the count of the symbols so
+// the total is equal to the table size.
+// If successful, compression tables will also be made ready.
+func (s *fseEncoder) normalizeCount(length int) error {
+ if s.reUsed {
+ return nil
+ }
+ s.optimalTableLog(length)
+ var (
+ tableLog = s.actualTableLog
+ scale = 62 - uint64(tableLog)
+ step = (1 << 62) / uint64(length)
+ vStep = uint64(1) << (scale - 20)
+ stillToDistribute = int16(1 << tableLog)
+ largest int
+ largestP int16
+ lowThreshold = (uint32)(length >> tableLog)
+ )
+ if s.maxCount == length {
+ s.useRLE = true
+ return nil
+ }
+ s.useRLE = false
+ for i, cnt := range s.count[:s.symbolLen] {
+ // already handled
+ // if (count[s] == s.length) return 0; /* rle special case */
+
+ if cnt == 0 {
+ s.norm[i] = 0
+ continue
+ }
+ if cnt <= lowThreshold {
+ s.norm[i] = -1
+ stillToDistribute--
+ } else {
+ proba := (int16)((uint64(cnt) * step) >> scale)
+ if proba < 8 {
+ restToBeat := vStep * uint64(rtbTable[proba])
+ v := uint64(cnt)*step - (uint64(proba) << scale)
+ if v > restToBeat {
+ proba++
+ }
+ }
+ if proba > largestP {
+ largestP = proba
+ largest = i
+ }
+ s.norm[i] = proba
+ stillToDistribute -= proba
+ }
+ }
+
+ if -stillToDistribute >= (s.norm[largest] >> 1) {
+ // corner case, need another normalization method
+ err := s.normalizeCount2(length)
+ if err != nil {
+ return err
+ }
+ if debugAsserts {
+ err = s.validateNorm()
+ if err != nil {
+ return err
+ }
+ }
+ return s.buildCTable()
+ }
+ s.norm[largest] += stillToDistribute
+ if debugAsserts {
+ err := s.validateNorm()
+ if err != nil {
+ return err
+ }
+ }
+ return s.buildCTable()
+}
+
+// Secondary normalization method.
+// To be used when primary method fails.
+func (s *fseEncoder) normalizeCount2(length int) error {
+ const notYetAssigned = -2
+ var (
+ distributed uint32
+ total = uint32(length)
+ tableLog = s.actualTableLog
+ lowThreshold = total >> tableLog
+ lowOne = (total * 3) >> (tableLog + 1)
+ )
+ for i, cnt := range s.count[:s.symbolLen] {
+ if cnt == 0 {
+ s.norm[i] = 0
+ continue
+ }
+ if cnt <= lowThreshold {
+ s.norm[i] = -1
+ distributed++
+ total -= cnt
+ continue
+ }
+ if cnt <= lowOne {
+ s.norm[i] = 1
+ distributed++
+ total -= cnt
+ continue
+ }
+ s.norm[i] = notYetAssigned
+ }
+ toDistribute := (1 << tableLog) - distributed
+
+ if (total / toDistribute) > lowOne {
+ // risk of rounding to zero
+ lowOne = (total * 3) / (toDistribute * 2)
+ for i, cnt := range s.count[:s.symbolLen] {
+ if (s.norm[i] == notYetAssigned) && (cnt <= lowOne) {
+ s.norm[i] = 1
+ distributed++
+ total -= cnt
+ continue
+ }
+ }
+ toDistribute = (1 << tableLog) - distributed
+ }
+ if distributed == uint32(s.symbolLen)+1 {
+ // all values are pretty poor;
+ // probably incompressible data (should have already been detected);
+ // find max, then give all remaining points to max
+ var maxV int
+ var maxC uint32
+ for i, cnt := range s.count[:s.symbolLen] {
+ if cnt > maxC {
+ maxV = i
+ maxC = cnt
+ }
+ }
+ s.norm[maxV] += int16(toDistribute)
+ return nil
+ }
+
+ if total == 0 {
+ // all of the symbols were low enough for the lowOne or lowThreshold
+ for i := uint32(0); toDistribute > 0; i = (i + 1) % (uint32(s.symbolLen)) {
+ if s.norm[i] > 0 {
+ toDistribute--
+ s.norm[i]++
+ }
+ }
+ return nil
+ }
+
+ var (
+ vStepLog = 62 - uint64(tableLog)
+ mid = uint64((1 << (vStepLog - 1)) - 1)
+ rStep = (((1 << vStepLog) * uint64(toDistribute)) + mid) / uint64(total) // scale on remaining
+ tmpTotal = mid
+ )
+ for i, cnt := range s.count[:s.symbolLen] {
+ if s.norm[i] == notYetAssigned {
+ var (
+ end = tmpTotal + uint64(cnt)*rStep
+ sStart = uint32(tmpTotal >> vStepLog)
+ sEnd = uint32(end >> vStepLog)
+ weight = sEnd - sStart
+ )
+ if weight < 1 {
+ return errors.New("weight < 1")
+ }
+ s.norm[i] = int16(weight)
+ tmpTotal = end
+ }
+ }
+ return nil
+}
+
+// optimalTableLog calculates and sets the optimal tableLog in s.actualTableLog
+func (s *fseEncoder) optimalTableLog(length int) {
+ tableLog := uint8(maxEncTableLog)
+ minBitsSrc := highBit(uint32(length)) + 1
+ minBitsSymbols := highBit(uint32(s.symbolLen-1)) + 2
+ minBits := uint8(minBitsSymbols)
+ if minBitsSrc < minBitsSymbols {
+ minBits = uint8(minBitsSrc)
+ }
+
+ maxBitsSrc := uint8(highBit(uint32(length-1))) - 2
+ if maxBitsSrc < tableLog {
+ // Accuracy can be reduced
+ tableLog = maxBitsSrc
+ }
+ if minBits > tableLog {
+ tableLog = minBits
+ }
+ // Need a minimum to safely represent all symbol values
+ if tableLog < minEncTablelog {
+ tableLog = minEncTablelog
+ }
+ if tableLog > maxEncTableLog {
+ tableLog = maxEncTableLog
+ }
+ s.actualTableLog = tableLog
+}
+
+// validateNorm validates the normalized histogram table.
+func (s *fseEncoder) validateNorm() (err error) {
+ var total int
+ for _, v := range s.norm[:s.symbolLen] {
+ if v >= 0 {
+ total += int(v)
+ } else {
+ total -= int(v)
+ }
+ }
+ defer func() {
+ if err == nil {
+ return
+ }
+ fmt.Printf("selected TableLog: %d, Symbol length: %d\n", s.actualTableLog, s.symbolLen)
+ for i, v := range s.norm[:s.symbolLen] {
+ fmt.Printf("%3d: %5d -> %4d \n", i, s.count[i], v)
+ }
+ }()
+ if total != (1 << s.actualTableLog) {
+ return fmt.Errorf("warning: Total == %d != %d", total, 1<> 3) + 3 + 2
+
+ // Write Table Size
+ bitStream = uint32(tableLog - minEncTablelog)
+ bitCount = uint(4)
+ remaining = int16(tableSize + 1) /* +1 for extra accuracy */
+ threshold = int16(tableSize)
+ nbBits = uint(tableLog + 1)
+ outP = len(out)
+ )
+ if cap(out) < outP+maxHeaderSize {
+ out = append(out, make([]byte, maxHeaderSize*3)...)
+ out = out[:len(out)-maxHeaderSize*3]
+ }
+ out = out[:outP+maxHeaderSize]
+
+ // stops at 1
+ for remaining > 1 {
+ if previous0 {
+ start := charnum
+ for s.norm[charnum] == 0 {
+ charnum++
+ }
+ for charnum >= start+24 {
+ start += 24
+ bitStream += uint32(0xFFFF) << bitCount
+ out[outP] = byte(bitStream)
+ out[outP+1] = byte(bitStream >> 8)
+ outP += 2
+ bitStream >>= 16
+ }
+ for charnum >= start+3 {
+ start += 3
+ bitStream += 3 << bitCount
+ bitCount += 2
+ }
+ bitStream += uint32(charnum-start) << bitCount
+ bitCount += 2
+ if bitCount > 16 {
+ out[outP] = byte(bitStream)
+ out[outP+1] = byte(bitStream >> 8)
+ outP += 2
+ bitStream >>= 16
+ bitCount -= 16
+ }
+ }
+
+ count := s.norm[charnum]
+ charnum++
+ max := (2*threshold - 1) - remaining
+ if count < 0 {
+ remaining += count
+ } else {
+ remaining -= count
+ }
+ count++ // +1 for extra accuracy
+ if count >= threshold {
+ count += max // [0..max[ [max..threshold[ (...) [threshold+max 2*threshold[
+ }
+ bitStream += uint32(count) << bitCount
+ bitCount += nbBits
+ if count < max {
+ bitCount--
+ }
+
+ previous0 = count == 1
+ if remaining < 1 {
+ return nil, errors.New("internal error: remaining < 1")
+ }
+ for remaining < threshold {
+ nbBits--
+ threshold >>= 1
+ }
+
+ if bitCount > 16 {
+ out[outP] = byte(bitStream)
+ out[outP+1] = byte(bitStream >> 8)
+ outP += 2
+ bitStream >>= 16
+ bitCount -= 16
+ }
+ }
+
+ if outP+2 > len(out) {
+ return nil, fmt.Errorf("internal error: %d > %d, maxheader: %d, sl: %d, tl: %d, normcount: %v", outP+2, len(out), maxHeaderSize, s.symbolLen, int(tableLog), s.norm[:s.symbolLen])
+ }
+ out[outP] = byte(bitStream)
+ out[outP+1] = byte(bitStream >> 8)
+ outP += int((bitCount + 7) / 8)
+
+ if charnum > s.symbolLen {
+ return nil, errors.New("internal error: charnum > s.symbolLen")
+ }
+ return out[:outP], nil
+}
+
+// Approximate symbol cost, as fractional value, using fixed-point format (accuracyLog fractional bits)
+// note 1 : assume symbolValue is valid (<= maxSymbolValue)
+// note 2 : if freq[symbolValue]==0, @return a fake cost of tableLog+1 bits *
+func (s *fseEncoder) bitCost(symbolValue uint8, accuracyLog uint32) uint32 {
+ minNbBits := s.ct.symbolTT[symbolValue].deltaNbBits >> 16
+ threshold := (minNbBits + 1) << 16
+ if debugAsserts {
+ if !(s.actualTableLog < 16) {
+ panic("!s.actualTableLog < 16")
+ }
+ // ensure enough room for renormalization double shift
+ if !(uint8(accuracyLog) < 31-s.actualTableLog) {
+ panic("!uint8(accuracyLog) < 31-s.actualTableLog")
+ }
+ }
+ tableSize := uint32(1) << s.actualTableLog
+ deltaFromThreshold := threshold - (s.ct.symbolTT[symbolValue].deltaNbBits + tableSize)
+ // linear interpolation (very approximate)
+ normalizedDeltaFromThreshold := (deltaFromThreshold << accuracyLog) >> s.actualTableLog
+ bitMultiplier := uint32(1) << accuracyLog
+ if debugAsserts {
+ if s.ct.symbolTT[symbolValue].deltaNbBits+tableSize > threshold {
+ panic("s.ct.symbolTT[symbolValue].deltaNbBits+tableSize > threshold")
+ }
+ if normalizedDeltaFromThreshold > bitMultiplier {
+ panic("normalizedDeltaFromThreshold > bitMultiplier")
+ }
+ }
+ return (minNbBits+1)*bitMultiplier - normalizedDeltaFromThreshold
+}
+
+// Returns the cost in bits of encoding the distribution in count using ctable.
+// Histogram should only be up to the last non-zero symbol.
+// Returns an -1 if ctable cannot represent all the symbols in count.
+func (s *fseEncoder) approxSize(hist []uint32) uint32 {
+ if int(s.symbolLen) < len(hist) {
+ // More symbols than we have.
+ return math.MaxUint32
+ }
+ if s.useRLE {
+ // We will never reuse RLE encoders.
+ return math.MaxUint32
+ }
+ const kAccuracyLog = 8
+ badCost := (uint32(s.actualTableLog) + 1) << kAccuracyLog
+ var cost uint32
+ for i, v := range hist {
+ if v == 0 {
+ continue
+ }
+ if s.norm[i] == 0 {
+ return math.MaxUint32
+ }
+ bitCost := s.bitCost(uint8(i), kAccuracyLog)
+ if bitCost > badCost {
+ return math.MaxUint32
+ }
+ cost += v * bitCost
+ }
+ return cost >> kAccuracyLog
+}
+
+// maxHeaderSize returns the maximum header size in bits.
+// This is not exact size, but we want a penalty for new tables anyway.
+func (s *fseEncoder) maxHeaderSize() uint32 {
+ if s.preDefined {
+ return 0
+ }
+ if s.useRLE {
+ return 8
+ }
+ return (((uint32(s.symbolLen) * uint32(s.actualTableLog)) >> 3) + 3) * 8
+}
+
+// cState contains the compression state of a stream.
+type cState struct {
+ bw *bitWriter
+ stateTable []uint16
+ state uint16
+}
+
+// init will initialize the compression state to the first symbol of the stream.
+func (c *cState) init(bw *bitWriter, ct *cTable, first symbolTransform) {
+ c.bw = bw
+ c.stateTable = ct.stateTable
+ if len(c.stateTable) == 1 {
+ // RLE
+ c.stateTable[0] = uint16(0)
+ c.state = 0
+ return
+ }
+ nbBitsOut := (first.deltaNbBits + (1 << 15)) >> 16
+ im := int32((nbBitsOut << 16) - first.deltaNbBits)
+ lu := (im >> nbBitsOut) + int32(first.deltaFindState)
+ c.state = c.stateTable[lu]
+}
+
+// flush will write the tablelog to the output and flush the remaining full bytes.
+func (c *cState) flush(tableLog uint8) {
+ c.bw.flush32()
+ c.bw.addBits16NC(c.state, tableLog)
+}
diff --git a/vendor/github.com/klauspost/compress/zstd/fse_predefined.go b/vendor/github.com/klauspost/compress/zstd/fse_predefined.go
new file mode 100644
index 00000000..474cb77d
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/fse_predefined.go
@@ -0,0 +1,158 @@
+// Copyright 2019+ Klaus Post. All rights reserved.
+// License information can be found in the LICENSE file.
+// Based on work by Yann Collet, released under BSD License.
+
+package zstd
+
+import (
+ "fmt"
+ "math"
+ "sync"
+)
+
+var (
+ // fsePredef are the predefined fse tables as defined here:
+ // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#default-distributions
+ // These values are already transformed.
+ fsePredef [3]fseDecoder
+
+ // fsePredefEnc are the predefined encoder based on fse tables as defined here:
+ // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#default-distributions
+ // These values are already transformed.
+ fsePredefEnc [3]fseEncoder
+
+ // symbolTableX contain the transformations needed for each type as defined in
+ // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#the-codes-for-literals-lengths-match-lengths-and-offsets
+ symbolTableX [3][]baseOffset
+
+ // maxTableSymbol is the biggest supported symbol for each table type
+ // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#the-codes-for-literals-lengths-match-lengths-and-offsets
+ maxTableSymbol = [3]uint8{tableLiteralLengths: maxLiteralLengthSymbol, tableOffsets: maxOffsetLengthSymbol, tableMatchLengths: maxMatchLengthSymbol}
+
+ // bitTables is the bits table for each table.
+ bitTables = [3][]byte{tableLiteralLengths: llBitsTable[:], tableOffsets: nil, tableMatchLengths: mlBitsTable[:]}
+)
+
+type tableIndex uint8
+
+const (
+ // indexes for fsePredef and symbolTableX
+ tableLiteralLengths tableIndex = 0
+ tableOffsets tableIndex = 1
+ tableMatchLengths tableIndex = 2
+
+ maxLiteralLengthSymbol = 35
+ maxOffsetLengthSymbol = 30
+ maxMatchLengthSymbol = 52
+)
+
+// baseOffset is used for calculating transformations.
+type baseOffset struct {
+ baseLine uint32
+ addBits uint8
+}
+
+// fillBase will precalculate base offsets with the given bit distributions.
+func fillBase(dst []baseOffset, base uint32, bits ...uint8) {
+ if len(bits) != len(dst) {
+ panic(fmt.Sprintf("len(dst) (%d) != len(bits) (%d)", len(dst), len(bits)))
+ }
+ for i, bit := range bits {
+ if base > math.MaxInt32 {
+ panic("invalid decoding table, base overflows int32")
+ }
+
+ dst[i] = baseOffset{
+ baseLine: base,
+ addBits: bit,
+ }
+ base += 1 << bit
+ }
+}
+
+var predef sync.Once
+
+func initPredefined() {
+ predef.Do(func() {
+ // Literals length codes
+ tmp := make([]baseOffset, 36)
+ for i := range tmp[:16] {
+ tmp[i] = baseOffset{
+ baseLine: uint32(i),
+ addBits: 0,
+ }
+ }
+ fillBase(tmp[16:], 16, 1, 1, 1, 1, 2, 2, 3, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)
+ symbolTableX[tableLiteralLengths] = tmp
+
+ // Match length codes
+ tmp = make([]baseOffset, 53)
+ for i := range tmp[:32] {
+ tmp[i] = baseOffset{
+ // The transformation adds the 3 length.
+ baseLine: uint32(i) + 3,
+ addBits: 0,
+ }
+ }
+ fillBase(tmp[32:], 35, 1, 1, 1, 1, 2, 2, 3, 3, 4, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)
+ symbolTableX[tableMatchLengths] = tmp
+
+ // Offset codes
+ tmp = make([]baseOffset, maxOffsetBits+1)
+ tmp[1] = baseOffset{
+ baseLine: 1,
+ addBits: 1,
+ }
+ fillBase(tmp[2:], 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30)
+ symbolTableX[tableOffsets] = tmp
+
+ // Fill predefined tables and transform them.
+ // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#default-distributions
+ for i := range fsePredef[:] {
+ f := &fsePredef[i]
+ switch tableIndex(i) {
+ case tableLiteralLengths:
+ // https://github.com/facebook/zstd/blob/ededcfca57366461021c922720878c81a5854a0a/lib/decompress/zstd_decompress_block.c#L243
+ f.actualTableLog = 6
+ copy(f.norm[:], []int16{4, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 1, 1, 1, 1, 1,
+ -1, -1, -1, -1})
+ f.symbolLen = 36
+ case tableOffsets:
+ // https://github.com/facebook/zstd/blob/ededcfca57366461021c922720878c81a5854a0a/lib/decompress/zstd_decompress_block.c#L281
+ f.actualTableLog = 5
+ copy(f.norm[:], []int16{
+ 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1})
+ f.symbolLen = 29
+ case tableMatchLengths:
+ //https://github.com/facebook/zstd/blob/ededcfca57366461021c922720878c81a5854a0a/lib/decompress/zstd_decompress_block.c#L304
+ f.actualTableLog = 6
+ copy(f.norm[:], []int16{
+ 1, 4, 3, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1,
+ -1, -1, -1, -1, -1})
+ f.symbolLen = 53
+ }
+ if err := f.buildDtable(); err != nil {
+ panic(fmt.Errorf("building table %v: %v", tableIndex(i), err))
+ }
+ if err := f.transform(symbolTableX[i]); err != nil {
+ panic(fmt.Errorf("building table %v: %v", tableIndex(i), err))
+ }
+ f.preDefined = true
+
+ // Create encoder as well
+ enc := &fsePredefEnc[i]
+ copy(enc.norm[:], f.norm[:])
+ enc.symbolLen = f.symbolLen
+ enc.actualTableLog = f.actualTableLog
+ if err := enc.buildCTable(); err != nil {
+ panic(fmt.Errorf("building encoding table %v: %v", tableIndex(i), err))
+ }
+ enc.setBits(bitTables[i])
+ enc.preDefined = true
+ }
+ })
+}
diff --git a/vendor/github.com/klauspost/compress/zstd/hash.go b/vendor/github.com/klauspost/compress/zstd/hash.go
new file mode 100644
index 00000000..5d73c21e
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/hash.go
@@ -0,0 +1,35 @@
+// Copyright 2019+ Klaus Post. All rights reserved.
+// License information can be found in the LICENSE file.
+// Based on work by Yann Collet, released under BSD License.
+
+package zstd
+
+const (
+ prime3bytes = 506832829
+ prime4bytes = 2654435761
+ prime5bytes = 889523592379
+ prime6bytes = 227718039650203
+ prime7bytes = 58295818150454627
+ prime8bytes = 0xcf1bbcdcb7a56463
+)
+
+// hashLen returns a hash of the lowest mls bytes of with length output bits.
+// mls must be >=3 and <=8. Any other value will return hash for 4 bytes.
+// length should always be < 32.
+// Preferably length and mls should be a constant for inlining.
+func hashLen(u uint64, length, mls uint8) uint32 {
+ switch mls {
+ case 3:
+ return (uint32(u<<8) * prime3bytes) >> (32 - length)
+ case 5:
+ return uint32(((u << (64 - 40)) * prime5bytes) >> (64 - length))
+ case 6:
+ return uint32(((u << (64 - 48)) * prime6bytes) >> (64 - length))
+ case 7:
+ return uint32(((u << (64 - 56)) * prime7bytes) >> (64 - length))
+ case 8:
+ return uint32((u * prime8bytes) >> (64 - length))
+ default:
+ return (uint32(u) * prime4bytes) >> (32 - length)
+ }
+}
diff --git a/vendor/github.com/klauspost/compress/zstd/history.go b/vendor/github.com/klauspost/compress/zstd/history.go
new file mode 100644
index 00000000..09164856
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/history.go
@@ -0,0 +1,116 @@
+// Copyright 2019+ Klaus Post. All rights reserved.
+// License information can be found in the LICENSE file.
+// Based on work by Yann Collet, released under BSD License.
+
+package zstd
+
+import (
+ "github.com/klauspost/compress/huff0"
+)
+
+// history contains the information transferred between blocks.
+type history struct {
+ // Literal decompression
+ huffTree *huff0.Scratch
+
+ // Sequence decompression
+ decoders sequenceDecs
+ recentOffsets [3]int
+
+ // History buffer...
+ b []byte
+
+ // ignoreBuffer is meant to ignore a number of bytes
+ // when checking for matches in history
+ ignoreBuffer int
+
+ windowSize int
+ allocFrameBuffer int // needed?
+ error bool
+ dict *dict
+}
+
+// reset will reset the history to initial state of a frame.
+// The history must already have been initialized to the desired size.
+func (h *history) reset() {
+ h.b = h.b[:0]
+ h.ignoreBuffer = 0
+ h.error = false
+ h.recentOffsets = [3]int{1, 4, 8}
+ h.decoders.freeDecoders()
+ h.decoders = sequenceDecs{br: h.decoders.br}
+ h.freeHuffDecoder()
+ h.huffTree = nil
+ h.dict = nil
+ //printf("history created: %+v (l: %d, c: %d)", *h, len(h.b), cap(h.b))
+}
+
+func (h *history) freeHuffDecoder() {
+ if h.huffTree != nil {
+ if h.dict == nil || h.dict.litEnc != h.huffTree {
+ huffDecoderPool.Put(h.huffTree)
+ h.huffTree = nil
+ }
+ }
+}
+
+func (h *history) setDict(dict *dict) {
+ if dict == nil {
+ return
+ }
+ h.dict = dict
+ h.decoders.litLengths = dict.llDec
+ h.decoders.offsets = dict.ofDec
+ h.decoders.matchLengths = dict.mlDec
+ h.decoders.dict = dict.content
+ h.recentOffsets = dict.offsets
+ h.huffTree = dict.litEnc
+}
+
+// append bytes to history.
+// This function will make sure there is space for it,
+// if the buffer has been allocated with enough extra space.
+func (h *history) append(b []byte) {
+ if len(b) >= h.windowSize {
+ // Discard all history by simply overwriting
+ h.b = h.b[:h.windowSize]
+ copy(h.b, b[len(b)-h.windowSize:])
+ return
+ }
+
+ // If there is space, append it.
+ if len(b) < cap(h.b)-len(h.b) {
+ h.b = append(h.b, b...)
+ return
+ }
+
+ // Move data down so we only have window size left.
+ // We know we have less than window size in b at this point.
+ discard := len(b) + len(h.b) - h.windowSize
+ copy(h.b, h.b[discard:])
+ h.b = h.b[:h.windowSize]
+ copy(h.b[h.windowSize-len(b):], b)
+}
+
+// ensureBlock will ensure there is space for at least one block...
+func (h *history) ensureBlock() {
+ if cap(h.b) < h.allocFrameBuffer {
+ h.b = make([]byte, 0, h.allocFrameBuffer)
+ return
+ }
+
+ avail := cap(h.b) - len(h.b)
+ if avail >= h.windowSize || avail > maxCompressedBlockSize {
+ return
+ }
+ // Move data down so we only have window size left.
+ // We know we have less than window size in b at this point.
+ discard := len(h.b) - h.windowSize
+ copy(h.b, h.b[discard:])
+ h.b = h.b[:h.windowSize]
+}
+
+// append bytes to history without ever discarding anything.
+func (h *history) appendKeep(b []byte) {
+ h.b = append(h.b, b...)
+}
diff --git a/vendor/github.com/klauspost/compress/zstd/internal/xxhash/LICENSE.txt b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/LICENSE.txt
new file mode 100644
index 00000000..24b53065
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/LICENSE.txt
@@ -0,0 +1,22 @@
+Copyright (c) 2016 Caleb Spare
+
+MIT License
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/vendor/github.com/klauspost/compress/zstd/internal/xxhash/README.md b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/README.md
new file mode 100644
index 00000000..777290d4
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/README.md
@@ -0,0 +1,71 @@
+# xxhash
+
+VENDORED: Go to [github.com/cespare/xxhash](https://github.com/cespare/xxhash) for original package.
+
+xxhash is a Go implementation of the 64-bit [xxHash] algorithm, XXH64. This is a
+high-quality hashing algorithm that is much faster than anything in the Go
+standard library.
+
+This package provides a straightforward API:
+
+```
+func Sum64(b []byte) uint64
+func Sum64String(s string) uint64
+type Digest struct{ ... }
+ func New() *Digest
+```
+
+The `Digest` type implements hash.Hash64. Its key methods are:
+
+```
+func (*Digest) Write([]byte) (int, error)
+func (*Digest) WriteString(string) (int, error)
+func (*Digest) Sum64() uint64
+```
+
+The package is written with optimized pure Go and also contains even faster
+assembly implementations for amd64 and arm64. If desired, the `purego` build tag
+opts into using the Go code even on those architectures.
+
+[xxHash]: http://cyan4973.github.io/xxHash/
+
+## Compatibility
+
+This package is in a module and the latest code is in version 2 of the module.
+You need a version of Go with at least "minimal module compatibility" to use
+github.com/cespare/xxhash/v2:
+
+* 1.9.7+ for Go 1.9
+* 1.10.3+ for Go 1.10
+* Go 1.11 or later
+
+I recommend using the latest release of Go.
+
+## Benchmarks
+
+Here are some quick benchmarks comparing the pure-Go and assembly
+implementations of Sum64.
+
+| input size | purego | asm |
+| ---------- | --------- | --------- |
+| 4 B | 1.3 GB/s | 1.2 GB/s |
+| 16 B | 2.9 GB/s | 3.5 GB/s |
+| 100 B | 6.9 GB/s | 8.1 GB/s |
+| 4 KB | 11.7 GB/s | 16.7 GB/s |
+| 10 MB | 12.0 GB/s | 17.3 GB/s |
+
+These numbers were generated on Ubuntu 20.04 with an Intel Xeon Platinum 8252C
+CPU using the following commands under Go 1.19.2:
+
+```
+benchstat <(go test -tags purego -benchtime 500ms -count 15 -bench 'Sum64$')
+benchstat <(go test -benchtime 500ms -count 15 -bench 'Sum64$')
+```
+
+## Projects using this package
+
+- [InfluxDB](https://github.com/influxdata/influxdb)
+- [Prometheus](https://github.com/prometheus/prometheus)
+- [VictoriaMetrics](https://github.com/VictoriaMetrics/VictoriaMetrics)
+- [FreeCache](https://github.com/coocood/freecache)
+- [FastCache](https://github.com/VictoriaMetrics/fastcache)
diff --git a/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash.go b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash.go
new file mode 100644
index 00000000..fc40c820
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash.go
@@ -0,0 +1,230 @@
+// Package xxhash implements the 64-bit variant of xxHash (XXH64) as described
+// at http://cyan4973.github.io/xxHash/.
+// THIS IS VENDORED: Go to github.com/cespare/xxhash for original package.
+
+package xxhash
+
+import (
+ "encoding/binary"
+ "errors"
+ "math/bits"
+)
+
+const (
+ prime1 uint64 = 11400714785074694791
+ prime2 uint64 = 14029467366897019727
+ prime3 uint64 = 1609587929392839161
+ prime4 uint64 = 9650029242287828579
+ prime5 uint64 = 2870177450012600261
+)
+
+// Store the primes in an array as well.
+//
+// The consts are used when possible in Go code to avoid MOVs but we need a
+// contiguous array of the assembly code.
+var primes = [...]uint64{prime1, prime2, prime3, prime4, prime5}
+
+// Digest implements hash.Hash64.
+type Digest struct {
+ v1 uint64
+ v2 uint64
+ v3 uint64
+ v4 uint64
+ total uint64
+ mem [32]byte
+ n int // how much of mem is used
+}
+
+// New creates a new Digest that computes the 64-bit xxHash algorithm.
+func New() *Digest {
+ var d Digest
+ d.Reset()
+ return &d
+}
+
+// Reset clears the Digest's state so that it can be reused.
+func (d *Digest) Reset() {
+ d.v1 = primes[0] + prime2
+ d.v2 = prime2
+ d.v3 = 0
+ d.v4 = -primes[0]
+ d.total = 0
+ d.n = 0
+}
+
+// Size always returns 8 bytes.
+func (d *Digest) Size() int { return 8 }
+
+// BlockSize always returns 32 bytes.
+func (d *Digest) BlockSize() int { return 32 }
+
+// Write adds more data to d. It always returns len(b), nil.
+func (d *Digest) Write(b []byte) (n int, err error) {
+ n = len(b)
+ d.total += uint64(n)
+
+ memleft := d.mem[d.n&(len(d.mem)-1):]
+
+ if d.n+n < 32 {
+ // This new data doesn't even fill the current block.
+ copy(memleft, b)
+ d.n += n
+ return
+ }
+
+ if d.n > 0 {
+ // Finish off the partial block.
+ c := copy(memleft, b)
+ d.v1 = round(d.v1, u64(d.mem[0:8]))
+ d.v2 = round(d.v2, u64(d.mem[8:16]))
+ d.v3 = round(d.v3, u64(d.mem[16:24]))
+ d.v4 = round(d.v4, u64(d.mem[24:32]))
+ b = b[c:]
+ d.n = 0
+ }
+
+ if len(b) >= 32 {
+ // One or more full blocks left.
+ nw := writeBlocks(d, b)
+ b = b[nw:]
+ }
+
+ // Store any remaining partial block.
+ copy(d.mem[:], b)
+ d.n = len(b)
+
+ return
+}
+
+// Sum appends the current hash to b and returns the resulting slice.
+func (d *Digest) Sum(b []byte) []byte {
+ s := d.Sum64()
+ return append(
+ b,
+ byte(s>>56),
+ byte(s>>48),
+ byte(s>>40),
+ byte(s>>32),
+ byte(s>>24),
+ byte(s>>16),
+ byte(s>>8),
+ byte(s),
+ )
+}
+
+// Sum64 returns the current hash.
+func (d *Digest) Sum64() uint64 {
+ var h uint64
+
+ if d.total >= 32 {
+ v1, v2, v3, v4 := d.v1, d.v2, d.v3, d.v4
+ h = rol1(v1) + rol7(v2) + rol12(v3) + rol18(v4)
+ h = mergeRound(h, v1)
+ h = mergeRound(h, v2)
+ h = mergeRound(h, v3)
+ h = mergeRound(h, v4)
+ } else {
+ h = d.v3 + prime5
+ }
+
+ h += d.total
+
+ b := d.mem[:d.n&(len(d.mem)-1)]
+ for ; len(b) >= 8; b = b[8:] {
+ k1 := round(0, u64(b[:8]))
+ h ^= k1
+ h = rol27(h)*prime1 + prime4
+ }
+ if len(b) >= 4 {
+ h ^= uint64(u32(b[:4])) * prime1
+ h = rol23(h)*prime2 + prime3
+ b = b[4:]
+ }
+ for ; len(b) > 0; b = b[1:] {
+ h ^= uint64(b[0]) * prime5
+ h = rol11(h) * prime1
+ }
+
+ h ^= h >> 33
+ h *= prime2
+ h ^= h >> 29
+ h *= prime3
+ h ^= h >> 32
+
+ return h
+}
+
+const (
+ magic = "xxh\x06"
+ marshaledSize = len(magic) + 8*5 + 32
+)
+
+// MarshalBinary implements the encoding.BinaryMarshaler interface.
+func (d *Digest) MarshalBinary() ([]byte, error) {
+ b := make([]byte, 0, marshaledSize)
+ b = append(b, magic...)
+ b = appendUint64(b, d.v1)
+ b = appendUint64(b, d.v2)
+ b = appendUint64(b, d.v3)
+ b = appendUint64(b, d.v4)
+ b = appendUint64(b, d.total)
+ b = append(b, d.mem[:d.n]...)
+ b = b[:len(b)+len(d.mem)-d.n]
+ return b, nil
+}
+
+// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
+func (d *Digest) UnmarshalBinary(b []byte) error {
+ if len(b) < len(magic) || string(b[:len(magic)]) != magic {
+ return errors.New("xxhash: invalid hash state identifier")
+ }
+ if len(b) != marshaledSize {
+ return errors.New("xxhash: invalid hash state size")
+ }
+ b = b[len(magic):]
+ b, d.v1 = consumeUint64(b)
+ b, d.v2 = consumeUint64(b)
+ b, d.v3 = consumeUint64(b)
+ b, d.v4 = consumeUint64(b)
+ b, d.total = consumeUint64(b)
+ copy(d.mem[:], b)
+ d.n = int(d.total % uint64(len(d.mem)))
+ return nil
+}
+
+func appendUint64(b []byte, x uint64) []byte {
+ var a [8]byte
+ binary.LittleEndian.PutUint64(a[:], x)
+ return append(b, a[:]...)
+}
+
+func consumeUint64(b []byte) ([]byte, uint64) {
+ x := u64(b)
+ return b[8:], x
+}
+
+func u64(b []byte) uint64 { return binary.LittleEndian.Uint64(b) }
+func u32(b []byte) uint32 { return binary.LittleEndian.Uint32(b) }
+
+func round(acc, input uint64) uint64 {
+ acc += input * prime2
+ acc = rol31(acc)
+ acc *= prime1
+ return acc
+}
+
+func mergeRound(acc, val uint64) uint64 {
+ val = round(0, val)
+ acc ^= val
+ acc = acc*prime1 + prime4
+ return acc
+}
+
+func rol1(x uint64) uint64 { return bits.RotateLeft64(x, 1) }
+func rol7(x uint64) uint64 { return bits.RotateLeft64(x, 7) }
+func rol11(x uint64) uint64 { return bits.RotateLeft64(x, 11) }
+func rol12(x uint64) uint64 { return bits.RotateLeft64(x, 12) }
+func rol18(x uint64) uint64 { return bits.RotateLeft64(x, 18) }
+func rol23(x uint64) uint64 { return bits.RotateLeft64(x, 23) }
+func rol27(x uint64) uint64 { return bits.RotateLeft64(x, 27) }
+func rol31(x uint64) uint64 { return bits.RotateLeft64(x, 31) }
diff --git a/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_amd64.s b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_amd64.s
new file mode 100644
index 00000000..ddb63aa9
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_amd64.s
@@ -0,0 +1,210 @@
+//go:build !appengine && gc && !purego && !noasm
+// +build !appengine
+// +build gc
+// +build !purego
+// +build !noasm
+
+#include "textflag.h"
+
+// Registers:
+#define h AX
+#define d AX
+#define p SI // pointer to advance through b
+#define n DX
+#define end BX // loop end
+#define v1 R8
+#define v2 R9
+#define v3 R10
+#define v4 R11
+#define x R12
+#define prime1 R13
+#define prime2 R14
+#define prime4 DI
+
+#define round(acc, x) \
+ IMULQ prime2, x \
+ ADDQ x, acc \
+ ROLQ $31, acc \
+ IMULQ prime1, acc
+
+// round0 performs the operation x = round(0, x).
+#define round0(x) \
+ IMULQ prime2, x \
+ ROLQ $31, x \
+ IMULQ prime1, x
+
+// mergeRound applies a merge round on the two registers acc and x.
+// It assumes that prime1, prime2, and prime4 have been loaded.
+#define mergeRound(acc, x) \
+ round0(x) \
+ XORQ x, acc \
+ IMULQ prime1, acc \
+ ADDQ prime4, acc
+
+// blockLoop processes as many 32-byte blocks as possible,
+// updating v1, v2, v3, and v4. It assumes that there is at least one block
+// to process.
+#define blockLoop() \
+loop: \
+ MOVQ +0(p), x \
+ round(v1, x) \
+ MOVQ +8(p), x \
+ round(v2, x) \
+ MOVQ +16(p), x \
+ round(v3, x) \
+ MOVQ +24(p), x \
+ round(v4, x) \
+ ADDQ $32, p \
+ CMPQ p, end \
+ JLE loop
+
+// func Sum64(b []byte) uint64
+TEXT ·Sum64(SB), NOSPLIT|NOFRAME, $0-32
+ // Load fixed primes.
+ MOVQ ·primes+0(SB), prime1
+ MOVQ ·primes+8(SB), prime2
+ MOVQ ·primes+24(SB), prime4
+
+ // Load slice.
+ MOVQ b_base+0(FP), p
+ MOVQ b_len+8(FP), n
+ LEAQ (p)(n*1), end
+
+ // The first loop limit will be len(b)-32.
+ SUBQ $32, end
+
+ // Check whether we have at least one block.
+ CMPQ n, $32
+ JLT noBlocks
+
+ // Set up initial state (v1, v2, v3, v4).
+ MOVQ prime1, v1
+ ADDQ prime2, v1
+ MOVQ prime2, v2
+ XORQ v3, v3
+ XORQ v4, v4
+ SUBQ prime1, v4
+
+ blockLoop()
+
+ MOVQ v1, h
+ ROLQ $1, h
+ MOVQ v2, x
+ ROLQ $7, x
+ ADDQ x, h
+ MOVQ v3, x
+ ROLQ $12, x
+ ADDQ x, h
+ MOVQ v4, x
+ ROLQ $18, x
+ ADDQ x, h
+
+ mergeRound(h, v1)
+ mergeRound(h, v2)
+ mergeRound(h, v3)
+ mergeRound(h, v4)
+
+ JMP afterBlocks
+
+noBlocks:
+ MOVQ ·primes+32(SB), h
+
+afterBlocks:
+ ADDQ n, h
+
+ ADDQ $24, end
+ CMPQ p, end
+ JG try4
+
+loop8:
+ MOVQ (p), x
+ ADDQ $8, p
+ round0(x)
+ XORQ x, h
+ ROLQ $27, h
+ IMULQ prime1, h
+ ADDQ prime4, h
+
+ CMPQ p, end
+ JLE loop8
+
+try4:
+ ADDQ $4, end
+ CMPQ p, end
+ JG try1
+
+ MOVL (p), x
+ ADDQ $4, p
+ IMULQ prime1, x
+ XORQ x, h
+
+ ROLQ $23, h
+ IMULQ prime2, h
+ ADDQ ·primes+16(SB), h
+
+try1:
+ ADDQ $4, end
+ CMPQ p, end
+ JGE finalize
+
+loop1:
+ MOVBQZX (p), x
+ ADDQ $1, p
+ IMULQ ·primes+32(SB), x
+ XORQ x, h
+ ROLQ $11, h
+ IMULQ prime1, h
+
+ CMPQ p, end
+ JL loop1
+
+finalize:
+ MOVQ h, x
+ SHRQ $33, x
+ XORQ x, h
+ IMULQ prime2, h
+ MOVQ h, x
+ SHRQ $29, x
+ XORQ x, h
+ IMULQ ·primes+16(SB), h
+ MOVQ h, x
+ SHRQ $32, x
+ XORQ x, h
+
+ MOVQ h, ret+24(FP)
+ RET
+
+// func writeBlocks(d *Digest, b []byte) int
+TEXT ·writeBlocks(SB), NOSPLIT|NOFRAME, $0-40
+ // Load fixed primes needed for round.
+ MOVQ ·primes+0(SB), prime1
+ MOVQ ·primes+8(SB), prime2
+
+ // Load slice.
+ MOVQ b_base+8(FP), p
+ MOVQ b_len+16(FP), n
+ LEAQ (p)(n*1), end
+ SUBQ $32, end
+
+ // Load vN from d.
+ MOVQ s+0(FP), d
+ MOVQ 0(d), v1
+ MOVQ 8(d), v2
+ MOVQ 16(d), v3
+ MOVQ 24(d), v4
+
+ // We don't need to check the loop condition here; this function is
+ // always called with at least one block of data to process.
+ blockLoop()
+
+ // Copy vN back to d.
+ MOVQ v1, 0(d)
+ MOVQ v2, 8(d)
+ MOVQ v3, 16(d)
+ MOVQ v4, 24(d)
+
+ // The number of bytes written is p minus the old base pointer.
+ SUBQ b_base+8(FP), p
+ MOVQ p, ret+32(FP)
+
+ RET
diff --git a/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_arm64.s b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_arm64.s
new file mode 100644
index 00000000..ae7d4d32
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_arm64.s
@@ -0,0 +1,184 @@
+//go:build !appengine && gc && !purego && !noasm
+// +build !appengine
+// +build gc
+// +build !purego
+// +build !noasm
+
+#include "textflag.h"
+
+// Registers:
+#define digest R1
+#define h R2 // return value
+#define p R3 // input pointer
+#define n R4 // input length
+#define nblocks R5 // n / 32
+#define prime1 R7
+#define prime2 R8
+#define prime3 R9
+#define prime4 R10
+#define prime5 R11
+#define v1 R12
+#define v2 R13
+#define v3 R14
+#define v4 R15
+#define x1 R20
+#define x2 R21
+#define x3 R22
+#define x4 R23
+
+#define round(acc, x) \
+ MADD prime2, acc, x, acc \
+ ROR $64-31, acc \
+ MUL prime1, acc
+
+// round0 performs the operation x = round(0, x).
+#define round0(x) \
+ MUL prime2, x \
+ ROR $64-31, x \
+ MUL prime1, x
+
+#define mergeRound(acc, x) \
+ round0(x) \
+ EOR x, acc \
+ MADD acc, prime4, prime1, acc
+
+// blockLoop processes as many 32-byte blocks as possible,
+// updating v1, v2, v3, and v4. It assumes that n >= 32.
+#define blockLoop() \
+ LSR $5, n, nblocks \
+ PCALIGN $16 \
+ loop: \
+ LDP.P 16(p), (x1, x2) \
+ LDP.P 16(p), (x3, x4) \
+ round(v1, x1) \
+ round(v2, x2) \
+ round(v3, x3) \
+ round(v4, x4) \
+ SUB $1, nblocks \
+ CBNZ nblocks, loop
+
+// func Sum64(b []byte) uint64
+TEXT ·Sum64(SB), NOSPLIT|NOFRAME, $0-32
+ LDP b_base+0(FP), (p, n)
+
+ LDP ·primes+0(SB), (prime1, prime2)
+ LDP ·primes+16(SB), (prime3, prime4)
+ MOVD ·primes+32(SB), prime5
+
+ CMP $32, n
+ CSEL LT, prime5, ZR, h // if n < 32 { h = prime5 } else { h = 0 }
+ BLT afterLoop
+
+ ADD prime1, prime2, v1
+ MOVD prime2, v2
+ MOVD $0, v3
+ NEG prime1, v4
+
+ blockLoop()
+
+ ROR $64-1, v1, x1
+ ROR $64-7, v2, x2
+ ADD x1, x2
+ ROR $64-12, v3, x3
+ ROR $64-18, v4, x4
+ ADD x3, x4
+ ADD x2, x4, h
+
+ mergeRound(h, v1)
+ mergeRound(h, v2)
+ mergeRound(h, v3)
+ mergeRound(h, v4)
+
+afterLoop:
+ ADD n, h
+
+ TBZ $4, n, try8
+ LDP.P 16(p), (x1, x2)
+
+ round0(x1)
+
+ // NOTE: here and below, sequencing the EOR after the ROR (using a
+ // rotated register) is worth a small but measurable speedup for small
+ // inputs.
+ ROR $64-27, h
+ EOR x1 @> 64-27, h, h
+ MADD h, prime4, prime1, h
+
+ round0(x2)
+ ROR $64-27, h
+ EOR x2 @> 64-27, h, h
+ MADD h, prime4, prime1, h
+
+try8:
+ TBZ $3, n, try4
+ MOVD.P 8(p), x1
+
+ round0(x1)
+ ROR $64-27, h
+ EOR x1 @> 64-27, h, h
+ MADD h, prime4, prime1, h
+
+try4:
+ TBZ $2, n, try2
+ MOVWU.P 4(p), x2
+
+ MUL prime1, x2
+ ROR $64-23, h
+ EOR x2 @> 64-23, h, h
+ MADD h, prime3, prime2, h
+
+try2:
+ TBZ $1, n, try1
+ MOVHU.P 2(p), x3
+ AND $255, x3, x1
+ LSR $8, x3, x2
+
+ MUL prime5, x1
+ ROR $64-11, h
+ EOR x1 @> 64-11, h, h
+ MUL prime1, h
+
+ MUL prime5, x2
+ ROR $64-11, h
+ EOR x2 @> 64-11, h, h
+ MUL prime1, h
+
+try1:
+ TBZ $0, n, finalize
+ MOVBU (p), x4
+
+ MUL prime5, x4
+ ROR $64-11, h
+ EOR x4 @> 64-11, h, h
+ MUL prime1, h
+
+finalize:
+ EOR h >> 33, h
+ MUL prime2, h
+ EOR h >> 29, h
+ MUL prime3, h
+ EOR h >> 32, h
+
+ MOVD h, ret+24(FP)
+ RET
+
+// func writeBlocks(s *Digest, b []byte) int
+TEXT ·writeBlocks(SB), NOSPLIT|NOFRAME, $0-40
+ LDP ·primes+0(SB), (prime1, prime2)
+
+ // Load state. Assume v[1-4] are stored contiguously.
+ MOVD s+0(FP), digest
+ LDP 0(digest), (v1, v2)
+ LDP 16(digest), (v3, v4)
+
+ LDP b_base+8(FP), (p, n)
+
+ blockLoop()
+
+ // Store updated state.
+ STP (v1, v2), 0(digest)
+ STP (v3, v4), 16(digest)
+
+ BIC $31, n
+ MOVD n, ret+32(FP)
+ RET
diff --git a/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_asm.go b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_asm.go
new file mode 100644
index 00000000..d4221edf
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_asm.go
@@ -0,0 +1,16 @@
+//go:build (amd64 || arm64) && !appengine && gc && !purego && !noasm
+// +build amd64 arm64
+// +build !appengine
+// +build gc
+// +build !purego
+// +build !noasm
+
+package xxhash
+
+// Sum64 computes the 64-bit xxHash digest of b.
+//
+//go:noescape
+func Sum64(b []byte) uint64
+
+//go:noescape
+func writeBlocks(s *Digest, b []byte) int
diff --git a/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_other.go b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_other.go
new file mode 100644
index 00000000..0be16cef
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_other.go
@@ -0,0 +1,76 @@
+//go:build (!amd64 && !arm64) || appengine || !gc || purego || noasm
+// +build !amd64,!arm64 appengine !gc purego noasm
+
+package xxhash
+
+// Sum64 computes the 64-bit xxHash digest of b.
+func Sum64(b []byte) uint64 {
+ // A simpler version would be
+ // d := New()
+ // d.Write(b)
+ // return d.Sum64()
+ // but this is faster, particularly for small inputs.
+
+ n := len(b)
+ var h uint64
+
+ if n >= 32 {
+ v1 := primes[0] + prime2
+ v2 := prime2
+ v3 := uint64(0)
+ v4 := -primes[0]
+ for len(b) >= 32 {
+ v1 = round(v1, u64(b[0:8:len(b)]))
+ v2 = round(v2, u64(b[8:16:len(b)]))
+ v3 = round(v3, u64(b[16:24:len(b)]))
+ v4 = round(v4, u64(b[24:32:len(b)]))
+ b = b[32:len(b):len(b)]
+ }
+ h = rol1(v1) + rol7(v2) + rol12(v3) + rol18(v4)
+ h = mergeRound(h, v1)
+ h = mergeRound(h, v2)
+ h = mergeRound(h, v3)
+ h = mergeRound(h, v4)
+ } else {
+ h = prime5
+ }
+
+ h += uint64(n)
+
+ for ; len(b) >= 8; b = b[8:] {
+ k1 := round(0, u64(b[:8]))
+ h ^= k1
+ h = rol27(h)*prime1 + prime4
+ }
+ if len(b) >= 4 {
+ h ^= uint64(u32(b[:4])) * prime1
+ h = rol23(h)*prime2 + prime3
+ b = b[4:]
+ }
+ for ; len(b) > 0; b = b[1:] {
+ h ^= uint64(b[0]) * prime5
+ h = rol11(h) * prime1
+ }
+
+ h ^= h >> 33
+ h *= prime2
+ h ^= h >> 29
+ h *= prime3
+ h ^= h >> 32
+
+ return h
+}
+
+func writeBlocks(d *Digest, b []byte) int {
+ v1, v2, v3, v4 := d.v1, d.v2, d.v3, d.v4
+ n := len(b)
+ for len(b) >= 32 {
+ v1 = round(v1, u64(b[0:8:len(b)]))
+ v2 = round(v2, u64(b[8:16:len(b)]))
+ v3 = round(v3, u64(b[16:24:len(b)]))
+ v4 = round(v4, u64(b[24:32:len(b)]))
+ b = b[32:len(b):len(b)]
+ }
+ d.v1, d.v2, d.v3, d.v4 = v1, v2, v3, v4
+ return n - len(b)
+}
diff --git a/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_safe.go b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_safe.go
new file mode 100644
index 00000000..6f3b0cb1
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_safe.go
@@ -0,0 +1,11 @@
+package xxhash
+
+// Sum64String computes the 64-bit xxHash digest of s.
+func Sum64String(s string) uint64 {
+ return Sum64([]byte(s))
+}
+
+// WriteString adds more data to d. It always returns len(s), nil.
+func (d *Digest) WriteString(s string) (n int, err error) {
+ return d.Write([]byte(s))
+}
diff --git a/vendor/github.com/klauspost/compress/zstd/matchlen_amd64.go b/vendor/github.com/klauspost/compress/zstd/matchlen_amd64.go
new file mode 100644
index 00000000..f41932b7
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/matchlen_amd64.go
@@ -0,0 +1,16 @@
+//go:build amd64 && !appengine && !noasm && gc
+// +build amd64,!appengine,!noasm,gc
+
+// Copyright 2019+ Klaus Post. All rights reserved.
+// License information can be found in the LICENSE file.
+
+package zstd
+
+// matchLen returns how many bytes match in a and b
+//
+// It assumes that:
+//
+// len(a) <= len(b) and len(a) > 0
+//
+//go:noescape
+func matchLen(a []byte, b []byte) int
diff --git a/vendor/github.com/klauspost/compress/zstd/matchlen_amd64.s b/vendor/github.com/klauspost/compress/zstd/matchlen_amd64.s
new file mode 100644
index 00000000..0782b86e
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/matchlen_amd64.s
@@ -0,0 +1,66 @@
+// Copied from S2 implementation.
+
+//go:build !appengine && !noasm && gc && !noasm
+
+#include "textflag.h"
+
+// func matchLen(a []byte, b []byte) int
+TEXT ·matchLen(SB), NOSPLIT, $0-56
+ MOVQ a_base+0(FP), AX
+ MOVQ b_base+24(FP), CX
+ MOVQ a_len+8(FP), DX
+
+ // matchLen
+ XORL SI, SI
+ CMPL DX, $0x08
+ JB matchlen_match4_standalone
+
+matchlen_loopback_standalone:
+ MOVQ (AX)(SI*1), BX
+ XORQ (CX)(SI*1), BX
+ JZ matchlen_loop_standalone
+
+#ifdef GOAMD64_v3
+ TZCNTQ BX, BX
+#else
+ BSFQ BX, BX
+#endif
+ SHRL $0x03, BX
+ LEAL (SI)(BX*1), SI
+ JMP gen_match_len_end
+
+matchlen_loop_standalone:
+ LEAL -8(DX), DX
+ LEAL 8(SI), SI
+ CMPL DX, $0x08
+ JAE matchlen_loopback_standalone
+
+matchlen_match4_standalone:
+ CMPL DX, $0x04
+ JB matchlen_match2_standalone
+ MOVL (AX)(SI*1), BX
+ CMPL (CX)(SI*1), BX
+ JNE matchlen_match2_standalone
+ LEAL -4(DX), DX
+ LEAL 4(SI), SI
+
+matchlen_match2_standalone:
+ CMPL DX, $0x02
+ JB matchlen_match1_standalone
+ MOVW (AX)(SI*1), BX
+ CMPW (CX)(SI*1), BX
+ JNE matchlen_match1_standalone
+ LEAL -2(DX), DX
+ LEAL 2(SI), SI
+
+matchlen_match1_standalone:
+ CMPL DX, $0x01
+ JB gen_match_len_end
+ MOVB (AX)(SI*1), BL
+ CMPB (CX)(SI*1), BL
+ JNE gen_match_len_end
+ INCL SI
+
+gen_match_len_end:
+ MOVQ SI, ret+48(FP)
+ RET
diff --git a/vendor/github.com/klauspost/compress/zstd/matchlen_generic.go b/vendor/github.com/klauspost/compress/zstd/matchlen_generic.go
new file mode 100644
index 00000000..57b9c31c
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/matchlen_generic.go
@@ -0,0 +1,33 @@
+//go:build !amd64 || appengine || !gc || noasm
+// +build !amd64 appengine !gc noasm
+
+// Copyright 2019+ Klaus Post. All rights reserved.
+// License information can be found in the LICENSE file.
+
+package zstd
+
+import (
+ "encoding/binary"
+ "math/bits"
+)
+
+// matchLen returns the maximum common prefix length of a and b.
+// a must be the shortest of the two.
+func matchLen(a, b []byte) (n int) {
+ for ; len(a) >= 8 && len(b) >= 8; a, b = a[8:], b[8:] {
+ diff := binary.LittleEndian.Uint64(a) ^ binary.LittleEndian.Uint64(b)
+ if diff != 0 {
+ return n + bits.TrailingZeros64(diff)>>3
+ }
+ n += 8
+ }
+
+ for i := range a {
+ if a[i] != b[i] {
+ break
+ }
+ n++
+ }
+ return n
+
+}
diff --git a/vendor/github.com/klauspost/compress/zstd/seqdec.go b/vendor/github.com/klauspost/compress/zstd/seqdec.go
new file mode 100644
index 00000000..d7fe6d82
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/seqdec.go
@@ -0,0 +1,503 @@
+// Copyright 2019+ Klaus Post. All rights reserved.
+// License information can be found in the LICENSE file.
+// Based on work by Yann Collet, released under BSD License.
+
+package zstd
+
+import (
+ "errors"
+ "fmt"
+ "io"
+)
+
+type seq struct {
+ litLen uint32
+ matchLen uint32
+ offset uint32
+
+ // Codes are stored here for the encoder
+ // so they only have to be looked up once.
+ llCode, mlCode, ofCode uint8
+}
+
+type seqVals struct {
+ ll, ml, mo int
+}
+
+func (s seq) String() string {
+ if s.offset <= 3 {
+ if s.offset == 0 {
+ return fmt.Sprint("litLen:", s.litLen, ", matchLen:", s.matchLen+zstdMinMatch, ", offset: INVALID (0)")
+ }
+ return fmt.Sprint("litLen:", s.litLen, ", matchLen:", s.matchLen+zstdMinMatch, ", offset:", s.offset, " (repeat)")
+ }
+ return fmt.Sprint("litLen:", s.litLen, ", matchLen:", s.matchLen+zstdMinMatch, ", offset:", s.offset-3, " (new)")
+}
+
+type seqCompMode uint8
+
+const (
+ compModePredefined seqCompMode = iota
+ compModeRLE
+ compModeFSE
+ compModeRepeat
+)
+
+type sequenceDec struct {
+ // decoder keeps track of the current state and updates it from the bitstream.
+ fse *fseDecoder
+ state fseState
+ repeat bool
+}
+
+// init the state of the decoder with input from stream.
+func (s *sequenceDec) init(br *bitReader) error {
+ if s.fse == nil {
+ return errors.New("sequence decoder not defined")
+ }
+ s.state.init(br, s.fse.actualTableLog, s.fse.dt[:1< cap(s.out) {
+ addBytes := s.seqSize + len(s.out)
+ s.out = append(s.out, make([]byte, addBytes)...)
+ s.out = s.out[:len(s.out)-addBytes]
+ }
+
+ if debugDecoder {
+ printf("Execute %d seqs with hist %d, dict %d, literals: %d into %d bytes\n", len(seqs), len(hist), len(s.dict), len(s.literals), s.seqSize)
+ }
+
+ var t = len(s.out)
+ out := s.out[:t+s.seqSize]
+
+ for _, seq := range seqs {
+ // Add literals
+ copy(out[t:], s.literals[:seq.ll])
+ t += seq.ll
+ s.literals = s.literals[seq.ll:]
+
+ // Copy from dictionary...
+ if seq.mo > t+len(hist) || seq.mo > s.windowSize {
+ if len(s.dict) == 0 {
+ return fmt.Errorf("match offset (%d) bigger than current history (%d)", seq.mo, t+len(hist))
+ }
+
+ // we may be in dictionary.
+ dictO := len(s.dict) - (seq.mo - (t + len(hist)))
+ if dictO < 0 || dictO >= len(s.dict) {
+ return fmt.Errorf("match offset (%d) bigger than current history+dict (%d)", seq.mo, t+len(hist)+len(s.dict))
+ }
+ end := dictO + seq.ml
+ if end > len(s.dict) {
+ n := len(s.dict) - dictO
+ copy(out[t:], s.dict[dictO:])
+ t += n
+ seq.ml -= n
+ } else {
+ copy(out[t:], s.dict[dictO:end])
+ t += end - dictO
+ continue
+ }
+ }
+
+ // Copy from history.
+ if v := seq.mo - t; v > 0 {
+ // v is the start position in history from end.
+ start := len(hist) - v
+ if seq.ml > v {
+ // Some goes into current block.
+ // Copy remainder of history
+ copy(out[t:], hist[start:])
+ t += v
+ seq.ml -= v
+ } else {
+ copy(out[t:], hist[start:start+seq.ml])
+ t += seq.ml
+ continue
+ }
+ }
+ // We must be in current buffer now
+ if seq.ml > 0 {
+ start := t - seq.mo
+ if seq.ml <= t-start {
+ // No overlap
+ copy(out[t:], out[start:start+seq.ml])
+ t += seq.ml
+ continue
+ } else {
+ // Overlapping copy
+ // Extend destination slice and copy one byte at the time.
+ src := out[start : start+seq.ml]
+ dst := out[t:]
+ dst = dst[:len(src)]
+ t += len(src)
+ // Destination is the space we just added.
+ for i := range src {
+ dst[i] = src[i]
+ }
+ }
+ }
+ }
+
+ // Add final literals
+ copy(out[t:], s.literals)
+ if debugDecoder {
+ t += len(s.literals)
+ if t != len(out) {
+ panic(fmt.Errorf("length mismatch, want %d, got %d, ss: %d", len(out), t, s.seqSize))
+ }
+ }
+ s.out = out
+
+ return nil
+}
+
+// decode sequences from the stream with the provided history.
+func (s *sequenceDecs) decodeSync(hist []byte) error {
+ supported, err := s.decodeSyncSimple(hist)
+ if supported {
+ return err
+ }
+
+ br := s.br
+ seqs := s.nSeqs
+ startSize := len(s.out)
+ // Grab full sizes tables, to avoid bounds checks.
+ llTable, mlTable, ofTable := s.litLengths.fse.dt[:maxTablesize], s.matchLengths.fse.dt[:maxTablesize], s.offsets.fse.dt[:maxTablesize]
+ llState, mlState, ofState := s.litLengths.state.state, s.matchLengths.state.state, s.offsets.state.state
+ out := s.out
+ maxBlockSize := maxCompressedBlockSize
+ if s.windowSize < maxBlockSize {
+ maxBlockSize = s.windowSize
+ }
+
+ if debugDecoder {
+ println("decodeSync: decoding", seqs, "sequences", br.remain(), "bits remain on stream")
+ }
+ for i := seqs - 1; i >= 0; i-- {
+ if br.overread() {
+ printf("reading sequence %d, exceeded available data. Overread by %d\n", seqs-i, -br.remain())
+ return io.ErrUnexpectedEOF
+ }
+ var ll, mo, ml int
+ if len(br.in) > 4+((maxOffsetBits+16+16)>>3) {
+ // inlined function:
+ // ll, mo, ml = s.nextFast(br, llState, mlState, ofState)
+
+ // Final will not read from stream.
+ var llB, mlB, moB uint8
+ ll, llB = llState.final()
+ ml, mlB = mlState.final()
+ mo, moB = ofState.final()
+
+ // extra bits are stored in reverse order.
+ br.fillFast()
+ mo += br.getBits(moB)
+ if s.maxBits > 32 {
+ br.fillFast()
+ }
+ ml += br.getBits(mlB)
+ ll += br.getBits(llB)
+
+ if moB > 1 {
+ s.prevOffset[2] = s.prevOffset[1]
+ s.prevOffset[1] = s.prevOffset[0]
+ s.prevOffset[0] = mo
+ } else {
+ // mo = s.adjustOffset(mo, ll, moB)
+ // Inlined for rather big speedup
+ if ll == 0 {
+ // There is an exception though, when current sequence's literals_length = 0.
+ // In this case, repeated offsets are shifted by one, so an offset_value of 1 means Repeated_Offset2,
+ // an offset_value of 2 means Repeated_Offset3, and an offset_value of 3 means Repeated_Offset1 - 1_byte.
+ mo++
+ }
+
+ if mo == 0 {
+ mo = s.prevOffset[0]
+ } else {
+ var temp int
+ if mo == 3 {
+ temp = s.prevOffset[0] - 1
+ } else {
+ temp = s.prevOffset[mo]
+ }
+
+ if temp == 0 {
+ // 0 is not valid; input is corrupted; force offset to 1
+ println("WARNING: temp was 0")
+ temp = 1
+ }
+
+ if mo != 1 {
+ s.prevOffset[2] = s.prevOffset[1]
+ }
+ s.prevOffset[1] = s.prevOffset[0]
+ s.prevOffset[0] = temp
+ mo = temp
+ }
+ }
+ br.fillFast()
+ } else {
+ ll, mo, ml = s.next(br, llState, mlState, ofState)
+ br.fill()
+ }
+
+ if debugSequences {
+ println("Seq", seqs-i-1, "Litlen:", ll, "mo:", mo, "(abs) ml:", ml)
+ }
+
+ if ll > len(s.literals) {
+ return fmt.Errorf("unexpected literal count, want %d bytes, but only %d is available", ll, len(s.literals))
+ }
+ size := ll + ml + len(out)
+ if size-startSize > maxBlockSize {
+ return fmt.Errorf("output bigger than max block size (%d)", maxBlockSize)
+ }
+ if size > cap(out) {
+ // Not enough size, which can happen under high volume block streaming conditions
+ // but could be if destination slice is too small for sync operations.
+ // over-allocating here can create a large amount of GC pressure so we try to keep
+ // it as contained as possible
+ used := len(out) - startSize
+ addBytes := 256 + ll + ml + used>>2
+ // Clamp to max block size.
+ if used+addBytes > maxBlockSize {
+ addBytes = maxBlockSize - used
+ }
+ out = append(out, make([]byte, addBytes)...)
+ out = out[:len(out)-addBytes]
+ }
+ if ml > maxMatchLen {
+ return fmt.Errorf("match len (%d) bigger than max allowed length", ml)
+ }
+
+ // Add literals
+ out = append(out, s.literals[:ll]...)
+ s.literals = s.literals[ll:]
+
+ if mo == 0 && ml > 0 {
+ return fmt.Errorf("zero matchoff and matchlen (%d) > 0", ml)
+ }
+
+ if mo > len(out)+len(hist) || mo > s.windowSize {
+ if len(s.dict) == 0 {
+ return fmt.Errorf("match offset (%d) bigger than current history (%d)", mo, len(out)+len(hist)-startSize)
+ }
+
+ // we may be in dictionary.
+ dictO := len(s.dict) - (mo - (len(out) + len(hist)))
+ if dictO < 0 || dictO >= len(s.dict) {
+ return fmt.Errorf("match offset (%d) bigger than current history (%d)", mo, len(out)+len(hist)-startSize)
+ }
+ end := dictO + ml
+ if end > len(s.dict) {
+ out = append(out, s.dict[dictO:]...)
+ ml -= len(s.dict) - dictO
+ } else {
+ out = append(out, s.dict[dictO:end]...)
+ mo = 0
+ ml = 0
+ }
+ }
+
+ // Copy from history.
+ // TODO: Blocks without history could be made to ignore this completely.
+ if v := mo - len(out); v > 0 {
+ // v is the start position in history from end.
+ start := len(hist) - v
+ if ml > v {
+ // Some goes into current block.
+ // Copy remainder of history
+ out = append(out, hist[start:]...)
+ ml -= v
+ } else {
+ out = append(out, hist[start:start+ml]...)
+ ml = 0
+ }
+ }
+ // We must be in current buffer now
+ if ml > 0 {
+ start := len(out) - mo
+ if ml <= len(out)-start {
+ // No overlap
+ out = append(out, out[start:start+ml]...)
+ } else {
+ // Overlapping copy
+ // Extend destination slice and copy one byte at the time.
+ out = out[:len(out)+ml]
+ src := out[start : start+ml]
+ // Destination is the space we just added.
+ dst := out[len(out)-ml:]
+ dst = dst[:len(src)]
+ for i := range src {
+ dst[i] = src[i]
+ }
+ }
+ }
+ if i == 0 {
+ // This is the last sequence, so we shouldn't update state.
+ break
+ }
+
+ // Manually inlined, ~ 5-20% faster
+ // Update all 3 states at once. Approx 20% faster.
+ nBits := llState.nbBits() + mlState.nbBits() + ofState.nbBits()
+ if nBits == 0 {
+ llState = llTable[llState.newState()&maxTableMask]
+ mlState = mlTable[mlState.newState()&maxTableMask]
+ ofState = ofTable[ofState.newState()&maxTableMask]
+ } else {
+ bits := br.get32BitsFast(nBits)
+
+ lowBits := uint16(bits >> ((ofState.nbBits() + mlState.nbBits()) & 31))
+ llState = llTable[(llState.newState()+lowBits)&maxTableMask]
+
+ lowBits = uint16(bits >> (ofState.nbBits() & 31))
+ lowBits &= bitMask[mlState.nbBits()&15]
+ mlState = mlTable[(mlState.newState()+lowBits)&maxTableMask]
+
+ lowBits = uint16(bits) & bitMask[ofState.nbBits()&15]
+ ofState = ofTable[(ofState.newState()+lowBits)&maxTableMask]
+ }
+ }
+
+ if size := len(s.literals) + len(out) - startSize; size > maxBlockSize {
+ return fmt.Errorf("output bigger than max block size (%d)", maxBlockSize)
+ }
+
+ // Add final literals
+ s.out = append(out, s.literals...)
+ return br.close()
+}
+
+var bitMask [16]uint16
+
+func init() {
+ for i := range bitMask[:] {
+ bitMask[i] = uint16((1 << uint(i)) - 1)
+ }
+}
+
+func (s *sequenceDecs) next(br *bitReader, llState, mlState, ofState decSymbol) (ll, mo, ml int) {
+ // Final will not read from stream.
+ ll, llB := llState.final()
+ ml, mlB := mlState.final()
+ mo, moB := ofState.final()
+
+ // extra bits are stored in reverse order.
+ br.fill()
+ mo += br.getBits(moB)
+ if s.maxBits > 32 {
+ br.fill()
+ }
+ // matchlength+literal length, max 32 bits
+ ml += br.getBits(mlB)
+ ll += br.getBits(llB)
+ mo = s.adjustOffset(mo, ll, moB)
+ return
+}
+
+func (s *sequenceDecs) adjustOffset(offset, litLen int, offsetB uint8) int {
+ if offsetB > 1 {
+ s.prevOffset[2] = s.prevOffset[1]
+ s.prevOffset[1] = s.prevOffset[0]
+ s.prevOffset[0] = offset
+ return offset
+ }
+
+ if litLen == 0 {
+ // There is an exception though, when current sequence's literals_length = 0.
+ // In this case, repeated offsets are shifted by one, so an offset_value of 1 means Repeated_Offset2,
+ // an offset_value of 2 means Repeated_Offset3, and an offset_value of 3 means Repeated_Offset1 - 1_byte.
+ offset++
+ }
+
+ if offset == 0 {
+ return s.prevOffset[0]
+ }
+ var temp int
+ if offset == 3 {
+ temp = s.prevOffset[0] - 1
+ } else {
+ temp = s.prevOffset[offset]
+ }
+
+ if temp == 0 {
+ // 0 is not valid; input is corrupted; force offset to 1
+ println("temp was 0")
+ temp = 1
+ }
+
+ if offset != 1 {
+ s.prevOffset[2] = s.prevOffset[1]
+ }
+ s.prevOffset[1] = s.prevOffset[0]
+ s.prevOffset[0] = temp
+ return temp
+}
diff --git a/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.go b/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.go
new file mode 100644
index 00000000..c59f17e0
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.go
@@ -0,0 +1,394 @@
+//go:build amd64 && !appengine && !noasm && gc
+// +build amd64,!appengine,!noasm,gc
+
+package zstd
+
+import (
+ "fmt"
+ "io"
+
+ "github.com/klauspost/compress/internal/cpuinfo"
+)
+
+type decodeSyncAsmContext struct {
+ llTable []decSymbol
+ mlTable []decSymbol
+ ofTable []decSymbol
+ llState uint64
+ mlState uint64
+ ofState uint64
+ iteration int
+ litRemain int
+ out []byte
+ outPosition int
+ literals []byte
+ litPosition int
+ history []byte
+ windowSize int
+ ll int // set on error (not for all errors, please refer to _generate/gen.go)
+ ml int // set on error (not for all errors, please refer to _generate/gen.go)
+ mo int // set on error (not for all errors, please refer to _generate/gen.go)
+}
+
+// sequenceDecs_decodeSync_amd64 implements the main loop of sequenceDecs.decodeSync in x86 asm.
+//
+// Please refer to seqdec_generic.go for the reference implementation.
+//
+//go:noescape
+func sequenceDecs_decodeSync_amd64(s *sequenceDecs, br *bitReader, ctx *decodeSyncAsmContext) int
+
+// sequenceDecs_decodeSync_bmi2 implements the main loop of sequenceDecs.decodeSync in x86 asm with BMI2 extensions.
+//
+//go:noescape
+func sequenceDecs_decodeSync_bmi2(s *sequenceDecs, br *bitReader, ctx *decodeSyncAsmContext) int
+
+// sequenceDecs_decodeSync_safe_amd64 does the same as above, but does not write more than output buffer.
+//
+//go:noescape
+func sequenceDecs_decodeSync_safe_amd64(s *sequenceDecs, br *bitReader, ctx *decodeSyncAsmContext) int
+
+// sequenceDecs_decodeSync_safe_bmi2 does the same as above, but does not write more than output buffer.
+//
+//go:noescape
+func sequenceDecs_decodeSync_safe_bmi2(s *sequenceDecs, br *bitReader, ctx *decodeSyncAsmContext) int
+
+// decode sequences from the stream with the provided history but without a dictionary.
+func (s *sequenceDecs) decodeSyncSimple(hist []byte) (bool, error) {
+ if len(s.dict) > 0 {
+ return false, nil
+ }
+ if s.maxSyncLen == 0 && cap(s.out)-len(s.out) < maxCompressedBlockSize {
+ return false, nil
+ }
+
+ // FIXME: Using unsafe memory copies leads to rare, random crashes
+ // with fuzz testing. It is therefore disabled for now.
+ const useSafe = true
+ /*
+ useSafe := false
+ if s.maxSyncLen == 0 && cap(s.out)-len(s.out) < maxCompressedBlockSizeAlloc {
+ useSafe = true
+ }
+ if s.maxSyncLen > 0 && cap(s.out)-len(s.out)-compressedBlockOverAlloc < int(s.maxSyncLen) {
+ useSafe = true
+ }
+ if cap(s.literals) < len(s.literals)+compressedBlockOverAlloc {
+ useSafe = true
+ }
+ */
+
+ br := s.br
+
+ maxBlockSize := maxCompressedBlockSize
+ if s.windowSize < maxBlockSize {
+ maxBlockSize = s.windowSize
+ }
+
+ ctx := decodeSyncAsmContext{
+ llTable: s.litLengths.fse.dt[:maxTablesize],
+ mlTable: s.matchLengths.fse.dt[:maxTablesize],
+ ofTable: s.offsets.fse.dt[:maxTablesize],
+ llState: uint64(s.litLengths.state.state),
+ mlState: uint64(s.matchLengths.state.state),
+ ofState: uint64(s.offsets.state.state),
+ iteration: s.nSeqs - 1,
+ litRemain: len(s.literals),
+ out: s.out,
+ outPosition: len(s.out),
+ literals: s.literals,
+ windowSize: s.windowSize,
+ history: hist,
+ }
+
+ s.seqSize = 0
+ startSize := len(s.out)
+
+ var errCode int
+ if cpuinfo.HasBMI2() {
+ if useSafe {
+ errCode = sequenceDecs_decodeSync_safe_bmi2(s, br, &ctx)
+ } else {
+ errCode = sequenceDecs_decodeSync_bmi2(s, br, &ctx)
+ }
+ } else {
+ if useSafe {
+ errCode = sequenceDecs_decodeSync_safe_amd64(s, br, &ctx)
+ } else {
+ errCode = sequenceDecs_decodeSync_amd64(s, br, &ctx)
+ }
+ }
+ switch errCode {
+ case noError:
+ break
+
+ case errorMatchLenOfsMismatch:
+ return true, fmt.Errorf("zero matchoff and matchlen (%d) > 0", ctx.ml)
+
+ case errorMatchLenTooBig:
+ return true, fmt.Errorf("match len (%d) bigger than max allowed length", ctx.ml)
+
+ case errorMatchOffTooBig:
+ return true, fmt.Errorf("match offset (%d) bigger than current history (%d)",
+ ctx.mo, ctx.outPosition+len(hist)-startSize)
+
+ case errorNotEnoughLiterals:
+ return true, fmt.Errorf("unexpected literal count, want %d bytes, but only %d is available",
+ ctx.ll, ctx.litRemain+ctx.ll)
+
+ case errorOverread:
+ return true, io.ErrUnexpectedEOF
+
+ case errorNotEnoughSpace:
+ size := ctx.outPosition + ctx.ll + ctx.ml
+ if debugDecoder {
+ println("msl:", s.maxSyncLen, "cap", cap(s.out), "bef:", startSize, "sz:", size-startSize, "mbs:", maxBlockSize, "outsz:", cap(s.out)-startSize)
+ }
+ return true, fmt.Errorf("output bigger than max block size (%d)", maxBlockSize)
+
+ default:
+ return true, fmt.Errorf("sequenceDecs_decode returned erroneous code %d", errCode)
+ }
+
+ s.seqSize += ctx.litRemain
+ if s.seqSize > maxBlockSize {
+ return true, fmt.Errorf("output bigger than max block size (%d)", maxBlockSize)
+ }
+ err := br.close()
+ if err != nil {
+ printf("Closing sequences: %v, %+v\n", err, *br)
+ return true, err
+ }
+
+ s.literals = s.literals[ctx.litPosition:]
+ t := ctx.outPosition
+ s.out = s.out[:t]
+
+ // Add final literals
+ s.out = append(s.out, s.literals...)
+ if debugDecoder {
+ t += len(s.literals)
+ if t != len(s.out) {
+ panic(fmt.Errorf("length mismatch, want %d, got %d", len(s.out), t))
+ }
+ }
+
+ return true, nil
+}
+
+// --------------------------------------------------------------------------------
+
+type decodeAsmContext struct {
+ llTable []decSymbol
+ mlTable []decSymbol
+ ofTable []decSymbol
+ llState uint64
+ mlState uint64
+ ofState uint64
+ iteration int
+ seqs []seqVals
+ litRemain int
+}
+
+const noError = 0
+
+// error reported when mo == 0 && ml > 0
+const errorMatchLenOfsMismatch = 1
+
+// error reported when ml > maxMatchLen
+const errorMatchLenTooBig = 2
+
+// error reported when mo > available history or mo > s.windowSize
+const errorMatchOffTooBig = 3
+
+// error reported when the sum of literal lengths exeeceds the literal buffer size
+const errorNotEnoughLiterals = 4
+
+// error reported when capacity of `out` is too small
+const errorNotEnoughSpace = 5
+
+// error reported when bits are overread.
+const errorOverread = 6
+
+// sequenceDecs_decode implements the main loop of sequenceDecs in x86 asm.
+//
+// Please refer to seqdec_generic.go for the reference implementation.
+//
+//go:noescape
+func sequenceDecs_decode_amd64(s *sequenceDecs, br *bitReader, ctx *decodeAsmContext) int
+
+// sequenceDecs_decode implements the main loop of sequenceDecs in x86 asm.
+//
+// Please refer to seqdec_generic.go for the reference implementation.
+//
+//go:noescape
+func sequenceDecs_decode_56_amd64(s *sequenceDecs, br *bitReader, ctx *decodeAsmContext) int
+
+// sequenceDecs_decode implements the main loop of sequenceDecs in x86 asm with BMI2 extensions.
+//
+//go:noescape
+func sequenceDecs_decode_bmi2(s *sequenceDecs, br *bitReader, ctx *decodeAsmContext) int
+
+// sequenceDecs_decode implements the main loop of sequenceDecs in x86 asm with BMI2 extensions.
+//
+//go:noescape
+func sequenceDecs_decode_56_bmi2(s *sequenceDecs, br *bitReader, ctx *decodeAsmContext) int
+
+// decode sequences from the stream without the provided history.
+func (s *sequenceDecs) decode(seqs []seqVals) error {
+ br := s.br
+
+ maxBlockSize := maxCompressedBlockSize
+ if s.windowSize < maxBlockSize {
+ maxBlockSize = s.windowSize
+ }
+
+ ctx := decodeAsmContext{
+ llTable: s.litLengths.fse.dt[:maxTablesize],
+ mlTable: s.matchLengths.fse.dt[:maxTablesize],
+ ofTable: s.offsets.fse.dt[:maxTablesize],
+ llState: uint64(s.litLengths.state.state),
+ mlState: uint64(s.matchLengths.state.state),
+ ofState: uint64(s.offsets.state.state),
+ seqs: seqs,
+ iteration: len(seqs) - 1,
+ litRemain: len(s.literals),
+ }
+
+ if debugDecoder {
+ println("decode: decoding", len(seqs), "sequences", br.remain(), "bits remain on stream")
+ }
+
+ s.seqSize = 0
+ lte56bits := s.maxBits+s.offsets.fse.actualTableLog+s.matchLengths.fse.actualTableLog+s.litLengths.fse.actualTableLog <= 56
+ var errCode int
+ if cpuinfo.HasBMI2() {
+ if lte56bits {
+ errCode = sequenceDecs_decode_56_bmi2(s, br, &ctx)
+ } else {
+ errCode = sequenceDecs_decode_bmi2(s, br, &ctx)
+ }
+ } else {
+ if lte56bits {
+ errCode = sequenceDecs_decode_56_amd64(s, br, &ctx)
+ } else {
+ errCode = sequenceDecs_decode_amd64(s, br, &ctx)
+ }
+ }
+ if errCode != 0 {
+ i := len(seqs) - ctx.iteration - 1
+ switch errCode {
+ case errorMatchLenOfsMismatch:
+ ml := ctx.seqs[i].ml
+ return fmt.Errorf("zero matchoff and matchlen (%d) > 0", ml)
+
+ case errorMatchLenTooBig:
+ ml := ctx.seqs[i].ml
+ return fmt.Errorf("match len (%d) bigger than max allowed length", ml)
+
+ case errorNotEnoughLiterals:
+ ll := ctx.seqs[i].ll
+ return fmt.Errorf("unexpected literal count, want %d bytes, but only %d is available", ll, ctx.litRemain+ll)
+ case errorOverread:
+ return io.ErrUnexpectedEOF
+ }
+
+ return fmt.Errorf("sequenceDecs_decode_amd64 returned erroneous code %d", errCode)
+ }
+
+ if ctx.litRemain < 0 {
+ return fmt.Errorf("literal count is too big: total available %d, total requested %d",
+ len(s.literals), len(s.literals)-ctx.litRemain)
+ }
+
+ s.seqSize += ctx.litRemain
+ if s.seqSize > maxBlockSize {
+ return fmt.Errorf("output bigger than max block size (%d)", maxBlockSize)
+ }
+ if debugDecoder {
+ println("decode: ", br.remain(), "bits remain on stream. code:", errCode)
+ }
+ err := br.close()
+ if err != nil {
+ printf("Closing sequences: %v, %+v\n", err, *br)
+ }
+ return err
+}
+
+// --------------------------------------------------------------------------------
+
+type executeAsmContext struct {
+ seqs []seqVals
+ seqIndex int
+ out []byte
+ history []byte
+ literals []byte
+ outPosition int
+ litPosition int
+ windowSize int
+}
+
+// sequenceDecs_executeSimple_amd64 implements the main loop of sequenceDecs.executeSimple in x86 asm.
+//
+// Returns false if a match offset is too big.
+//
+// Please refer to seqdec_generic.go for the reference implementation.
+//
+//go:noescape
+func sequenceDecs_executeSimple_amd64(ctx *executeAsmContext) bool
+
+// Same as above, but with safe memcopies
+//
+//go:noescape
+func sequenceDecs_executeSimple_safe_amd64(ctx *executeAsmContext) bool
+
+// executeSimple handles cases when dictionary is not used.
+func (s *sequenceDecs) executeSimple(seqs []seqVals, hist []byte) error {
+ // Ensure we have enough output size...
+ if len(s.out)+s.seqSize+compressedBlockOverAlloc > cap(s.out) {
+ addBytes := s.seqSize + len(s.out) + compressedBlockOverAlloc
+ s.out = append(s.out, make([]byte, addBytes)...)
+ s.out = s.out[:len(s.out)-addBytes]
+ }
+
+ if debugDecoder {
+ printf("Execute %d seqs with literals: %d into %d bytes\n", len(seqs), len(s.literals), s.seqSize)
+ }
+
+ var t = len(s.out)
+ out := s.out[:t+s.seqSize]
+
+ ctx := executeAsmContext{
+ seqs: seqs,
+ seqIndex: 0,
+ out: out,
+ history: hist,
+ outPosition: t,
+ litPosition: 0,
+ literals: s.literals,
+ windowSize: s.windowSize,
+ }
+ var ok bool
+ if cap(s.literals) < len(s.literals)+compressedBlockOverAlloc {
+ ok = sequenceDecs_executeSimple_safe_amd64(&ctx)
+ } else {
+ ok = sequenceDecs_executeSimple_amd64(&ctx)
+ }
+ if !ok {
+ return fmt.Errorf("match offset (%d) bigger than current history (%d)",
+ seqs[ctx.seqIndex].mo, ctx.outPosition+len(hist))
+ }
+ s.literals = s.literals[ctx.litPosition:]
+ t = ctx.outPosition
+
+ // Add final literals
+ copy(out[t:], s.literals)
+ if debugDecoder {
+ t += len(s.literals)
+ if t != len(out) {
+ panic(fmt.Errorf("length mismatch, want %d, got %d, ss: %d", len(out), t, s.seqSize))
+ }
+ }
+ s.out = out
+
+ return nil
+}
diff --git a/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.s b/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.s
new file mode 100644
index 00000000..f5591fa1
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.s
@@ -0,0 +1,4151 @@
+// Code generated by command: go run gen.go -out ../seqdec_amd64.s -pkg=zstd. DO NOT EDIT.
+
+//go:build !appengine && !noasm && gc && !noasm
+
+// func sequenceDecs_decode_amd64(s *sequenceDecs, br *bitReader, ctx *decodeAsmContext) int
+// Requires: CMOV
+TEXT ·sequenceDecs_decode_amd64(SB), $8-32
+ MOVQ br+8(FP), CX
+ MOVQ 24(CX), DX
+ MOVBQZX 32(CX), BX
+ MOVQ (CX), AX
+ MOVQ 8(CX), SI
+ ADDQ SI, AX
+ MOVQ AX, (SP)
+ MOVQ ctx+16(FP), AX
+ MOVQ 72(AX), DI
+ MOVQ 80(AX), R8
+ MOVQ 88(AX), R9
+ MOVQ 104(AX), R10
+ MOVQ s+0(FP), AX
+ MOVQ 144(AX), R11
+ MOVQ 152(AX), R12
+ MOVQ 160(AX), R13
+
+sequenceDecs_decode_amd64_main_loop:
+ MOVQ (SP), R14
+
+ // Fill bitreader to have enough for the offset and match length.
+ CMPQ SI, $0x08
+ JL sequenceDecs_decode_amd64_fill_byte_by_byte
+ MOVQ BX, AX
+ SHRQ $0x03, AX
+ SUBQ AX, R14
+ MOVQ (R14), DX
+ SUBQ AX, SI
+ ANDQ $0x07, BX
+ JMP sequenceDecs_decode_amd64_fill_end
+
+sequenceDecs_decode_amd64_fill_byte_by_byte:
+ CMPQ SI, $0x00
+ JLE sequenceDecs_decode_amd64_fill_check_overread
+ CMPQ BX, $0x07
+ JLE sequenceDecs_decode_amd64_fill_end
+ SHLQ $0x08, DX
+ SUBQ $0x01, R14
+ SUBQ $0x01, SI
+ SUBQ $0x08, BX
+ MOVBQZX (R14), AX
+ ORQ AX, DX
+ JMP sequenceDecs_decode_amd64_fill_byte_by_byte
+
+sequenceDecs_decode_amd64_fill_check_overread:
+ CMPQ BX, $0x40
+ JA error_overread
+
+sequenceDecs_decode_amd64_fill_end:
+ // Update offset
+ MOVQ R9, AX
+ MOVQ BX, CX
+ MOVQ DX, R15
+ SHLQ CL, R15
+ MOVB AH, CL
+ SHRQ $0x20, AX
+ TESTQ CX, CX
+ JZ sequenceDecs_decode_amd64_of_update_zero
+ ADDQ CX, BX
+ CMPQ BX, $0x40
+ JA sequenceDecs_decode_amd64_of_update_zero
+ CMPQ CX, $0x40
+ JAE sequenceDecs_decode_amd64_of_update_zero
+ NEGQ CX
+ SHRQ CL, R15
+ ADDQ R15, AX
+
+sequenceDecs_decode_amd64_of_update_zero:
+ MOVQ AX, 16(R10)
+
+ // Update match length
+ MOVQ R8, AX
+ MOVQ BX, CX
+ MOVQ DX, R15
+ SHLQ CL, R15
+ MOVB AH, CL
+ SHRQ $0x20, AX
+ TESTQ CX, CX
+ JZ sequenceDecs_decode_amd64_ml_update_zero
+ ADDQ CX, BX
+ CMPQ BX, $0x40
+ JA sequenceDecs_decode_amd64_ml_update_zero
+ CMPQ CX, $0x40
+ JAE sequenceDecs_decode_amd64_ml_update_zero
+ NEGQ CX
+ SHRQ CL, R15
+ ADDQ R15, AX
+
+sequenceDecs_decode_amd64_ml_update_zero:
+ MOVQ AX, 8(R10)
+
+ // Fill bitreader to have enough for the remaining
+ CMPQ SI, $0x08
+ JL sequenceDecs_decode_amd64_fill_2_byte_by_byte
+ MOVQ BX, AX
+ SHRQ $0x03, AX
+ SUBQ AX, R14
+ MOVQ (R14), DX
+ SUBQ AX, SI
+ ANDQ $0x07, BX
+ JMP sequenceDecs_decode_amd64_fill_2_end
+
+sequenceDecs_decode_amd64_fill_2_byte_by_byte:
+ CMPQ SI, $0x00
+ JLE sequenceDecs_decode_amd64_fill_2_check_overread
+ CMPQ BX, $0x07
+ JLE sequenceDecs_decode_amd64_fill_2_end
+ SHLQ $0x08, DX
+ SUBQ $0x01, R14
+ SUBQ $0x01, SI
+ SUBQ $0x08, BX
+ MOVBQZX (R14), AX
+ ORQ AX, DX
+ JMP sequenceDecs_decode_amd64_fill_2_byte_by_byte
+
+sequenceDecs_decode_amd64_fill_2_check_overread:
+ CMPQ BX, $0x40
+ JA error_overread
+
+sequenceDecs_decode_amd64_fill_2_end:
+ // Update literal length
+ MOVQ DI, AX
+ MOVQ BX, CX
+ MOVQ DX, R15
+ SHLQ CL, R15
+ MOVB AH, CL
+ SHRQ $0x20, AX
+ TESTQ CX, CX
+ JZ sequenceDecs_decode_amd64_ll_update_zero
+ ADDQ CX, BX
+ CMPQ BX, $0x40
+ JA sequenceDecs_decode_amd64_ll_update_zero
+ CMPQ CX, $0x40
+ JAE sequenceDecs_decode_amd64_ll_update_zero
+ NEGQ CX
+ SHRQ CL, R15
+ ADDQ R15, AX
+
+sequenceDecs_decode_amd64_ll_update_zero:
+ MOVQ AX, (R10)
+
+ // Fill bitreader for state updates
+ MOVQ R14, (SP)
+ MOVQ R9, AX
+ SHRQ $0x08, AX
+ MOVBQZX AL, AX
+ MOVQ ctx+16(FP), CX
+ CMPQ 96(CX), $0x00
+ JZ sequenceDecs_decode_amd64_skip_update
+
+ // Update Literal Length State
+ MOVBQZX DI, R14
+ SHRL $0x10, DI
+ LEAQ (BX)(R14*1), CX
+ MOVQ DX, R15
+ MOVQ CX, BX
+ ROLQ CL, R15
+ MOVL $0x00000001, BP
+ MOVB R14, CL
+ SHLL CL, BP
+ DECL BP
+ ANDQ BP, R15
+ ADDQ R15, DI
+
+ // Load ctx.llTable
+ MOVQ ctx+16(FP), CX
+ MOVQ (CX), CX
+ MOVQ (CX)(DI*8), DI
+
+ // Update Match Length State
+ MOVBQZX R8, R14
+ SHRL $0x10, R8
+ LEAQ (BX)(R14*1), CX
+ MOVQ DX, R15
+ MOVQ CX, BX
+ ROLQ CL, R15
+ MOVL $0x00000001, BP
+ MOVB R14, CL
+ SHLL CL, BP
+ DECL BP
+ ANDQ BP, R15
+ ADDQ R15, R8
+
+ // Load ctx.mlTable
+ MOVQ ctx+16(FP), CX
+ MOVQ 24(CX), CX
+ MOVQ (CX)(R8*8), R8
+
+ // Update Offset State
+ MOVBQZX R9, R14
+ SHRL $0x10, R9
+ LEAQ (BX)(R14*1), CX
+ MOVQ DX, R15
+ MOVQ CX, BX
+ ROLQ CL, R15
+ MOVL $0x00000001, BP
+ MOVB R14, CL
+ SHLL CL, BP
+ DECL BP
+ ANDQ BP, R15
+ ADDQ R15, R9
+
+ // Load ctx.ofTable
+ MOVQ ctx+16(FP), CX
+ MOVQ 48(CX), CX
+ MOVQ (CX)(R9*8), R9
+
+sequenceDecs_decode_amd64_skip_update:
+ // Adjust offset
+ MOVQ 16(R10), CX
+ CMPQ AX, $0x01
+ JBE sequenceDecs_decode_amd64_adjust_offsetB_1_or_0
+ MOVQ R12, R13
+ MOVQ R11, R12
+ MOVQ CX, R11
+ JMP sequenceDecs_decode_amd64_after_adjust
+
+sequenceDecs_decode_amd64_adjust_offsetB_1_or_0:
+ CMPQ (R10), $0x00000000
+ JNE sequenceDecs_decode_amd64_adjust_offset_maybezero
+ INCQ CX
+ JMP sequenceDecs_decode_amd64_adjust_offset_nonzero
+
+sequenceDecs_decode_amd64_adjust_offset_maybezero:
+ TESTQ CX, CX
+ JNZ sequenceDecs_decode_amd64_adjust_offset_nonzero
+ MOVQ R11, CX
+ JMP sequenceDecs_decode_amd64_after_adjust
+
+sequenceDecs_decode_amd64_adjust_offset_nonzero:
+ CMPQ CX, $0x01
+ JB sequenceDecs_decode_amd64_adjust_zero
+ JEQ sequenceDecs_decode_amd64_adjust_one
+ CMPQ CX, $0x02
+ JA sequenceDecs_decode_amd64_adjust_three
+ JMP sequenceDecs_decode_amd64_adjust_two
+
+sequenceDecs_decode_amd64_adjust_zero:
+ MOVQ R11, AX
+ JMP sequenceDecs_decode_amd64_adjust_test_temp_valid
+
+sequenceDecs_decode_amd64_adjust_one:
+ MOVQ R12, AX
+ JMP sequenceDecs_decode_amd64_adjust_test_temp_valid
+
+sequenceDecs_decode_amd64_adjust_two:
+ MOVQ R13, AX
+ JMP sequenceDecs_decode_amd64_adjust_test_temp_valid
+
+sequenceDecs_decode_amd64_adjust_three:
+ LEAQ -1(R11), AX
+
+sequenceDecs_decode_amd64_adjust_test_temp_valid:
+ TESTQ AX, AX
+ JNZ sequenceDecs_decode_amd64_adjust_temp_valid
+ MOVQ $0x00000001, AX
+
+sequenceDecs_decode_amd64_adjust_temp_valid:
+ CMPQ CX, $0x01
+ CMOVQNE R12, R13
+ MOVQ R11, R12
+ MOVQ AX, R11
+ MOVQ AX, CX
+
+sequenceDecs_decode_amd64_after_adjust:
+ MOVQ CX, 16(R10)
+
+ // Check values
+ MOVQ 8(R10), AX
+ MOVQ (R10), R14
+ LEAQ (AX)(R14*1), R15
+ MOVQ s+0(FP), BP
+ ADDQ R15, 256(BP)
+ MOVQ ctx+16(FP), R15
+ SUBQ R14, 128(R15)
+ JS error_not_enough_literals
+ CMPQ AX, $0x00020002
+ JA sequenceDecs_decode_amd64_error_match_len_too_big
+ TESTQ CX, CX
+ JNZ sequenceDecs_decode_amd64_match_len_ofs_ok
+ TESTQ AX, AX
+ JNZ sequenceDecs_decode_amd64_error_match_len_ofs_mismatch
+
+sequenceDecs_decode_amd64_match_len_ofs_ok:
+ ADDQ $0x18, R10
+ MOVQ ctx+16(FP), AX
+ DECQ 96(AX)
+ JNS sequenceDecs_decode_amd64_main_loop
+ MOVQ s+0(FP), AX
+ MOVQ R11, 144(AX)
+ MOVQ R12, 152(AX)
+ MOVQ R13, 160(AX)
+ MOVQ br+8(FP), AX
+ MOVQ DX, 24(AX)
+ MOVB BL, 32(AX)
+ MOVQ SI, 8(AX)
+
+ // Return success
+ MOVQ $0x00000000, ret+24(FP)
+ RET
+
+ // Return with match length error
+sequenceDecs_decode_amd64_error_match_len_ofs_mismatch:
+ MOVQ $0x00000001, ret+24(FP)
+ RET
+
+ // Return with match too long error
+sequenceDecs_decode_amd64_error_match_len_too_big:
+ MOVQ $0x00000002, ret+24(FP)
+ RET
+
+ // Return with match offset too long error
+ MOVQ $0x00000003, ret+24(FP)
+ RET
+
+ // Return with not enough literals error
+error_not_enough_literals:
+ MOVQ $0x00000004, ret+24(FP)
+ RET
+
+ // Return with overread error
+error_overread:
+ MOVQ $0x00000006, ret+24(FP)
+ RET
+
+// func sequenceDecs_decode_56_amd64(s *sequenceDecs, br *bitReader, ctx *decodeAsmContext) int
+// Requires: CMOV
+TEXT ·sequenceDecs_decode_56_amd64(SB), $8-32
+ MOVQ br+8(FP), CX
+ MOVQ 24(CX), DX
+ MOVBQZX 32(CX), BX
+ MOVQ (CX), AX
+ MOVQ 8(CX), SI
+ ADDQ SI, AX
+ MOVQ AX, (SP)
+ MOVQ ctx+16(FP), AX
+ MOVQ 72(AX), DI
+ MOVQ 80(AX), R8
+ MOVQ 88(AX), R9
+ MOVQ 104(AX), R10
+ MOVQ s+0(FP), AX
+ MOVQ 144(AX), R11
+ MOVQ 152(AX), R12
+ MOVQ 160(AX), R13
+
+sequenceDecs_decode_56_amd64_main_loop:
+ MOVQ (SP), R14
+
+ // Fill bitreader to have enough for the offset and match length.
+ CMPQ SI, $0x08
+ JL sequenceDecs_decode_56_amd64_fill_byte_by_byte
+ MOVQ BX, AX
+ SHRQ $0x03, AX
+ SUBQ AX, R14
+ MOVQ (R14), DX
+ SUBQ AX, SI
+ ANDQ $0x07, BX
+ JMP sequenceDecs_decode_56_amd64_fill_end
+
+sequenceDecs_decode_56_amd64_fill_byte_by_byte:
+ CMPQ SI, $0x00
+ JLE sequenceDecs_decode_56_amd64_fill_check_overread
+ CMPQ BX, $0x07
+ JLE sequenceDecs_decode_56_amd64_fill_end
+ SHLQ $0x08, DX
+ SUBQ $0x01, R14
+ SUBQ $0x01, SI
+ SUBQ $0x08, BX
+ MOVBQZX (R14), AX
+ ORQ AX, DX
+ JMP sequenceDecs_decode_56_amd64_fill_byte_by_byte
+
+sequenceDecs_decode_56_amd64_fill_check_overread:
+ CMPQ BX, $0x40
+ JA error_overread
+
+sequenceDecs_decode_56_amd64_fill_end:
+ // Update offset
+ MOVQ R9, AX
+ MOVQ BX, CX
+ MOVQ DX, R15
+ SHLQ CL, R15
+ MOVB AH, CL
+ SHRQ $0x20, AX
+ TESTQ CX, CX
+ JZ sequenceDecs_decode_56_amd64_of_update_zero
+ ADDQ CX, BX
+ CMPQ BX, $0x40
+ JA sequenceDecs_decode_56_amd64_of_update_zero
+ CMPQ CX, $0x40
+ JAE sequenceDecs_decode_56_amd64_of_update_zero
+ NEGQ CX
+ SHRQ CL, R15
+ ADDQ R15, AX
+
+sequenceDecs_decode_56_amd64_of_update_zero:
+ MOVQ AX, 16(R10)
+
+ // Update match length
+ MOVQ R8, AX
+ MOVQ BX, CX
+ MOVQ DX, R15
+ SHLQ CL, R15
+ MOVB AH, CL
+ SHRQ $0x20, AX
+ TESTQ CX, CX
+ JZ sequenceDecs_decode_56_amd64_ml_update_zero
+ ADDQ CX, BX
+ CMPQ BX, $0x40
+ JA sequenceDecs_decode_56_amd64_ml_update_zero
+ CMPQ CX, $0x40
+ JAE sequenceDecs_decode_56_amd64_ml_update_zero
+ NEGQ CX
+ SHRQ CL, R15
+ ADDQ R15, AX
+
+sequenceDecs_decode_56_amd64_ml_update_zero:
+ MOVQ AX, 8(R10)
+
+ // Update literal length
+ MOVQ DI, AX
+ MOVQ BX, CX
+ MOVQ DX, R15
+ SHLQ CL, R15
+ MOVB AH, CL
+ SHRQ $0x20, AX
+ TESTQ CX, CX
+ JZ sequenceDecs_decode_56_amd64_ll_update_zero
+ ADDQ CX, BX
+ CMPQ BX, $0x40
+ JA sequenceDecs_decode_56_amd64_ll_update_zero
+ CMPQ CX, $0x40
+ JAE sequenceDecs_decode_56_amd64_ll_update_zero
+ NEGQ CX
+ SHRQ CL, R15
+ ADDQ R15, AX
+
+sequenceDecs_decode_56_amd64_ll_update_zero:
+ MOVQ AX, (R10)
+
+ // Fill bitreader for state updates
+ MOVQ R14, (SP)
+ MOVQ R9, AX
+ SHRQ $0x08, AX
+ MOVBQZX AL, AX
+ MOVQ ctx+16(FP), CX
+ CMPQ 96(CX), $0x00
+ JZ sequenceDecs_decode_56_amd64_skip_update
+
+ // Update Literal Length State
+ MOVBQZX DI, R14
+ SHRL $0x10, DI
+ LEAQ (BX)(R14*1), CX
+ MOVQ DX, R15
+ MOVQ CX, BX
+ ROLQ CL, R15
+ MOVL $0x00000001, BP
+ MOVB R14, CL
+ SHLL CL, BP
+ DECL BP
+ ANDQ BP, R15
+ ADDQ R15, DI
+
+ // Load ctx.llTable
+ MOVQ ctx+16(FP), CX
+ MOVQ (CX), CX
+ MOVQ (CX)(DI*8), DI
+
+ // Update Match Length State
+ MOVBQZX R8, R14
+ SHRL $0x10, R8
+ LEAQ (BX)(R14*1), CX
+ MOVQ DX, R15
+ MOVQ CX, BX
+ ROLQ CL, R15
+ MOVL $0x00000001, BP
+ MOVB R14, CL
+ SHLL CL, BP
+ DECL BP
+ ANDQ BP, R15
+ ADDQ R15, R8
+
+ // Load ctx.mlTable
+ MOVQ ctx+16(FP), CX
+ MOVQ 24(CX), CX
+ MOVQ (CX)(R8*8), R8
+
+ // Update Offset State
+ MOVBQZX R9, R14
+ SHRL $0x10, R9
+ LEAQ (BX)(R14*1), CX
+ MOVQ DX, R15
+ MOVQ CX, BX
+ ROLQ CL, R15
+ MOVL $0x00000001, BP
+ MOVB R14, CL
+ SHLL CL, BP
+ DECL BP
+ ANDQ BP, R15
+ ADDQ R15, R9
+
+ // Load ctx.ofTable
+ MOVQ ctx+16(FP), CX
+ MOVQ 48(CX), CX
+ MOVQ (CX)(R9*8), R9
+
+sequenceDecs_decode_56_amd64_skip_update:
+ // Adjust offset
+ MOVQ 16(R10), CX
+ CMPQ AX, $0x01
+ JBE sequenceDecs_decode_56_amd64_adjust_offsetB_1_or_0
+ MOVQ R12, R13
+ MOVQ R11, R12
+ MOVQ CX, R11
+ JMP sequenceDecs_decode_56_amd64_after_adjust
+
+sequenceDecs_decode_56_amd64_adjust_offsetB_1_or_0:
+ CMPQ (R10), $0x00000000
+ JNE sequenceDecs_decode_56_amd64_adjust_offset_maybezero
+ INCQ CX
+ JMP sequenceDecs_decode_56_amd64_adjust_offset_nonzero
+
+sequenceDecs_decode_56_amd64_adjust_offset_maybezero:
+ TESTQ CX, CX
+ JNZ sequenceDecs_decode_56_amd64_adjust_offset_nonzero
+ MOVQ R11, CX
+ JMP sequenceDecs_decode_56_amd64_after_adjust
+
+sequenceDecs_decode_56_amd64_adjust_offset_nonzero:
+ CMPQ CX, $0x01
+ JB sequenceDecs_decode_56_amd64_adjust_zero
+ JEQ sequenceDecs_decode_56_amd64_adjust_one
+ CMPQ CX, $0x02
+ JA sequenceDecs_decode_56_amd64_adjust_three
+ JMP sequenceDecs_decode_56_amd64_adjust_two
+
+sequenceDecs_decode_56_amd64_adjust_zero:
+ MOVQ R11, AX
+ JMP sequenceDecs_decode_56_amd64_adjust_test_temp_valid
+
+sequenceDecs_decode_56_amd64_adjust_one:
+ MOVQ R12, AX
+ JMP sequenceDecs_decode_56_amd64_adjust_test_temp_valid
+
+sequenceDecs_decode_56_amd64_adjust_two:
+ MOVQ R13, AX
+ JMP sequenceDecs_decode_56_amd64_adjust_test_temp_valid
+
+sequenceDecs_decode_56_amd64_adjust_three:
+ LEAQ -1(R11), AX
+
+sequenceDecs_decode_56_amd64_adjust_test_temp_valid:
+ TESTQ AX, AX
+ JNZ sequenceDecs_decode_56_amd64_adjust_temp_valid
+ MOVQ $0x00000001, AX
+
+sequenceDecs_decode_56_amd64_adjust_temp_valid:
+ CMPQ CX, $0x01
+ CMOVQNE R12, R13
+ MOVQ R11, R12
+ MOVQ AX, R11
+ MOVQ AX, CX
+
+sequenceDecs_decode_56_amd64_after_adjust:
+ MOVQ CX, 16(R10)
+
+ // Check values
+ MOVQ 8(R10), AX
+ MOVQ (R10), R14
+ LEAQ (AX)(R14*1), R15
+ MOVQ s+0(FP), BP
+ ADDQ R15, 256(BP)
+ MOVQ ctx+16(FP), R15
+ SUBQ R14, 128(R15)
+ JS error_not_enough_literals
+ CMPQ AX, $0x00020002
+ JA sequenceDecs_decode_56_amd64_error_match_len_too_big
+ TESTQ CX, CX
+ JNZ sequenceDecs_decode_56_amd64_match_len_ofs_ok
+ TESTQ AX, AX
+ JNZ sequenceDecs_decode_56_amd64_error_match_len_ofs_mismatch
+
+sequenceDecs_decode_56_amd64_match_len_ofs_ok:
+ ADDQ $0x18, R10
+ MOVQ ctx+16(FP), AX
+ DECQ 96(AX)
+ JNS sequenceDecs_decode_56_amd64_main_loop
+ MOVQ s+0(FP), AX
+ MOVQ R11, 144(AX)
+ MOVQ R12, 152(AX)
+ MOVQ R13, 160(AX)
+ MOVQ br+8(FP), AX
+ MOVQ DX, 24(AX)
+ MOVB BL, 32(AX)
+ MOVQ SI, 8(AX)
+
+ // Return success
+ MOVQ $0x00000000, ret+24(FP)
+ RET
+
+ // Return with match length error
+sequenceDecs_decode_56_amd64_error_match_len_ofs_mismatch:
+ MOVQ $0x00000001, ret+24(FP)
+ RET
+
+ // Return with match too long error
+sequenceDecs_decode_56_amd64_error_match_len_too_big:
+ MOVQ $0x00000002, ret+24(FP)
+ RET
+
+ // Return with match offset too long error
+ MOVQ $0x00000003, ret+24(FP)
+ RET
+
+ // Return with not enough literals error
+error_not_enough_literals:
+ MOVQ $0x00000004, ret+24(FP)
+ RET
+
+ // Return with overread error
+error_overread:
+ MOVQ $0x00000006, ret+24(FP)
+ RET
+
+// func sequenceDecs_decode_bmi2(s *sequenceDecs, br *bitReader, ctx *decodeAsmContext) int
+// Requires: BMI, BMI2, CMOV
+TEXT ·sequenceDecs_decode_bmi2(SB), $8-32
+ MOVQ br+8(FP), BX
+ MOVQ 24(BX), AX
+ MOVBQZX 32(BX), DX
+ MOVQ (BX), CX
+ MOVQ 8(BX), BX
+ ADDQ BX, CX
+ MOVQ CX, (SP)
+ MOVQ ctx+16(FP), CX
+ MOVQ 72(CX), SI
+ MOVQ 80(CX), DI
+ MOVQ 88(CX), R8
+ MOVQ 104(CX), R9
+ MOVQ s+0(FP), CX
+ MOVQ 144(CX), R10
+ MOVQ 152(CX), R11
+ MOVQ 160(CX), R12
+
+sequenceDecs_decode_bmi2_main_loop:
+ MOVQ (SP), R13
+
+ // Fill bitreader to have enough for the offset and match length.
+ CMPQ BX, $0x08
+ JL sequenceDecs_decode_bmi2_fill_byte_by_byte
+ MOVQ DX, CX
+ SHRQ $0x03, CX
+ SUBQ CX, R13
+ MOVQ (R13), AX
+ SUBQ CX, BX
+ ANDQ $0x07, DX
+ JMP sequenceDecs_decode_bmi2_fill_end
+
+sequenceDecs_decode_bmi2_fill_byte_by_byte:
+ CMPQ BX, $0x00
+ JLE sequenceDecs_decode_bmi2_fill_check_overread
+ CMPQ DX, $0x07
+ JLE sequenceDecs_decode_bmi2_fill_end
+ SHLQ $0x08, AX
+ SUBQ $0x01, R13
+ SUBQ $0x01, BX
+ SUBQ $0x08, DX
+ MOVBQZX (R13), CX
+ ORQ CX, AX
+ JMP sequenceDecs_decode_bmi2_fill_byte_by_byte
+
+sequenceDecs_decode_bmi2_fill_check_overread:
+ CMPQ DX, $0x40
+ JA error_overread
+
+sequenceDecs_decode_bmi2_fill_end:
+ // Update offset
+ MOVQ $0x00000808, CX
+ BEXTRQ CX, R8, R14
+ MOVQ AX, R15
+ LEAQ (DX)(R14*1), CX
+ ROLQ CL, R15
+ BZHIQ R14, R15, R15
+ MOVQ CX, DX
+ MOVQ R8, CX
+ SHRQ $0x20, CX
+ ADDQ R15, CX
+ MOVQ CX, 16(R9)
+
+ // Update match length
+ MOVQ $0x00000808, CX
+ BEXTRQ CX, DI, R14
+ MOVQ AX, R15
+ LEAQ (DX)(R14*1), CX
+ ROLQ CL, R15
+ BZHIQ R14, R15, R15
+ MOVQ CX, DX
+ MOVQ DI, CX
+ SHRQ $0x20, CX
+ ADDQ R15, CX
+ MOVQ CX, 8(R9)
+
+ // Fill bitreader to have enough for the remaining
+ CMPQ BX, $0x08
+ JL sequenceDecs_decode_bmi2_fill_2_byte_by_byte
+ MOVQ DX, CX
+ SHRQ $0x03, CX
+ SUBQ CX, R13
+ MOVQ (R13), AX
+ SUBQ CX, BX
+ ANDQ $0x07, DX
+ JMP sequenceDecs_decode_bmi2_fill_2_end
+
+sequenceDecs_decode_bmi2_fill_2_byte_by_byte:
+ CMPQ BX, $0x00
+ JLE sequenceDecs_decode_bmi2_fill_2_check_overread
+ CMPQ DX, $0x07
+ JLE sequenceDecs_decode_bmi2_fill_2_end
+ SHLQ $0x08, AX
+ SUBQ $0x01, R13
+ SUBQ $0x01, BX
+ SUBQ $0x08, DX
+ MOVBQZX (R13), CX
+ ORQ CX, AX
+ JMP sequenceDecs_decode_bmi2_fill_2_byte_by_byte
+
+sequenceDecs_decode_bmi2_fill_2_check_overread:
+ CMPQ DX, $0x40
+ JA error_overread
+
+sequenceDecs_decode_bmi2_fill_2_end:
+ // Update literal length
+ MOVQ $0x00000808, CX
+ BEXTRQ CX, SI, R14
+ MOVQ AX, R15
+ LEAQ (DX)(R14*1), CX
+ ROLQ CL, R15
+ BZHIQ R14, R15, R15
+ MOVQ CX, DX
+ MOVQ SI, CX
+ SHRQ $0x20, CX
+ ADDQ R15, CX
+ MOVQ CX, (R9)
+
+ // Fill bitreader for state updates
+ MOVQ R13, (SP)
+ MOVQ $0x00000808, CX
+ BEXTRQ CX, R8, R13
+ MOVQ ctx+16(FP), CX
+ CMPQ 96(CX), $0x00
+ JZ sequenceDecs_decode_bmi2_skip_update
+ LEAQ (SI)(DI*1), R14
+ ADDQ R8, R14
+ MOVBQZX R14, R14
+ LEAQ (DX)(R14*1), CX
+ MOVQ AX, R15
+ MOVQ CX, DX
+ ROLQ CL, R15
+ BZHIQ R14, R15, R15
+
+ // Update Offset State
+ BZHIQ R8, R15, CX
+ SHRXQ R8, R15, R15
+ SHRL $0x10, R8
+ ADDQ CX, R8
+
+ // Load ctx.ofTable
+ MOVQ ctx+16(FP), CX
+ MOVQ 48(CX), CX
+ MOVQ (CX)(R8*8), R8
+
+ // Update Match Length State
+ BZHIQ DI, R15, CX
+ SHRXQ DI, R15, R15
+ SHRL $0x10, DI
+ ADDQ CX, DI
+
+ // Load ctx.mlTable
+ MOVQ ctx+16(FP), CX
+ MOVQ 24(CX), CX
+ MOVQ (CX)(DI*8), DI
+
+ // Update Literal Length State
+ BZHIQ SI, R15, CX
+ SHRL $0x10, SI
+ ADDQ CX, SI
+
+ // Load ctx.llTable
+ MOVQ ctx+16(FP), CX
+ MOVQ (CX), CX
+ MOVQ (CX)(SI*8), SI
+
+sequenceDecs_decode_bmi2_skip_update:
+ // Adjust offset
+ MOVQ 16(R9), CX
+ CMPQ R13, $0x01
+ JBE sequenceDecs_decode_bmi2_adjust_offsetB_1_or_0
+ MOVQ R11, R12
+ MOVQ R10, R11
+ MOVQ CX, R10
+ JMP sequenceDecs_decode_bmi2_after_adjust
+
+sequenceDecs_decode_bmi2_adjust_offsetB_1_or_0:
+ CMPQ (R9), $0x00000000
+ JNE sequenceDecs_decode_bmi2_adjust_offset_maybezero
+ INCQ CX
+ JMP sequenceDecs_decode_bmi2_adjust_offset_nonzero
+
+sequenceDecs_decode_bmi2_adjust_offset_maybezero:
+ TESTQ CX, CX
+ JNZ sequenceDecs_decode_bmi2_adjust_offset_nonzero
+ MOVQ R10, CX
+ JMP sequenceDecs_decode_bmi2_after_adjust
+
+sequenceDecs_decode_bmi2_adjust_offset_nonzero:
+ CMPQ CX, $0x01
+ JB sequenceDecs_decode_bmi2_adjust_zero
+ JEQ sequenceDecs_decode_bmi2_adjust_one
+ CMPQ CX, $0x02
+ JA sequenceDecs_decode_bmi2_adjust_three
+ JMP sequenceDecs_decode_bmi2_adjust_two
+
+sequenceDecs_decode_bmi2_adjust_zero:
+ MOVQ R10, R13
+ JMP sequenceDecs_decode_bmi2_adjust_test_temp_valid
+
+sequenceDecs_decode_bmi2_adjust_one:
+ MOVQ R11, R13
+ JMP sequenceDecs_decode_bmi2_adjust_test_temp_valid
+
+sequenceDecs_decode_bmi2_adjust_two:
+ MOVQ R12, R13
+ JMP sequenceDecs_decode_bmi2_adjust_test_temp_valid
+
+sequenceDecs_decode_bmi2_adjust_three:
+ LEAQ -1(R10), R13
+
+sequenceDecs_decode_bmi2_adjust_test_temp_valid:
+ TESTQ R13, R13
+ JNZ sequenceDecs_decode_bmi2_adjust_temp_valid
+ MOVQ $0x00000001, R13
+
+sequenceDecs_decode_bmi2_adjust_temp_valid:
+ CMPQ CX, $0x01
+ CMOVQNE R11, R12
+ MOVQ R10, R11
+ MOVQ R13, R10
+ MOVQ R13, CX
+
+sequenceDecs_decode_bmi2_after_adjust:
+ MOVQ CX, 16(R9)
+
+ // Check values
+ MOVQ 8(R9), R13
+ MOVQ (R9), R14
+ LEAQ (R13)(R14*1), R15
+ MOVQ s+0(FP), BP
+ ADDQ R15, 256(BP)
+ MOVQ ctx+16(FP), R15
+ SUBQ R14, 128(R15)
+ JS error_not_enough_literals
+ CMPQ R13, $0x00020002
+ JA sequenceDecs_decode_bmi2_error_match_len_too_big
+ TESTQ CX, CX
+ JNZ sequenceDecs_decode_bmi2_match_len_ofs_ok
+ TESTQ R13, R13
+ JNZ sequenceDecs_decode_bmi2_error_match_len_ofs_mismatch
+
+sequenceDecs_decode_bmi2_match_len_ofs_ok:
+ ADDQ $0x18, R9
+ MOVQ ctx+16(FP), CX
+ DECQ 96(CX)
+ JNS sequenceDecs_decode_bmi2_main_loop
+ MOVQ s+0(FP), CX
+ MOVQ R10, 144(CX)
+ MOVQ R11, 152(CX)
+ MOVQ R12, 160(CX)
+ MOVQ br+8(FP), CX
+ MOVQ AX, 24(CX)
+ MOVB DL, 32(CX)
+ MOVQ BX, 8(CX)
+
+ // Return success
+ MOVQ $0x00000000, ret+24(FP)
+ RET
+
+ // Return with match length error
+sequenceDecs_decode_bmi2_error_match_len_ofs_mismatch:
+ MOVQ $0x00000001, ret+24(FP)
+ RET
+
+ // Return with match too long error
+sequenceDecs_decode_bmi2_error_match_len_too_big:
+ MOVQ $0x00000002, ret+24(FP)
+ RET
+
+ // Return with match offset too long error
+ MOVQ $0x00000003, ret+24(FP)
+ RET
+
+ // Return with not enough literals error
+error_not_enough_literals:
+ MOVQ $0x00000004, ret+24(FP)
+ RET
+
+ // Return with overread error
+error_overread:
+ MOVQ $0x00000006, ret+24(FP)
+ RET
+
+// func sequenceDecs_decode_56_bmi2(s *sequenceDecs, br *bitReader, ctx *decodeAsmContext) int
+// Requires: BMI, BMI2, CMOV
+TEXT ·sequenceDecs_decode_56_bmi2(SB), $8-32
+ MOVQ br+8(FP), BX
+ MOVQ 24(BX), AX
+ MOVBQZX 32(BX), DX
+ MOVQ (BX), CX
+ MOVQ 8(BX), BX
+ ADDQ BX, CX
+ MOVQ CX, (SP)
+ MOVQ ctx+16(FP), CX
+ MOVQ 72(CX), SI
+ MOVQ 80(CX), DI
+ MOVQ 88(CX), R8
+ MOVQ 104(CX), R9
+ MOVQ s+0(FP), CX
+ MOVQ 144(CX), R10
+ MOVQ 152(CX), R11
+ MOVQ 160(CX), R12
+
+sequenceDecs_decode_56_bmi2_main_loop:
+ MOVQ (SP), R13
+
+ // Fill bitreader to have enough for the offset and match length.
+ CMPQ BX, $0x08
+ JL sequenceDecs_decode_56_bmi2_fill_byte_by_byte
+ MOVQ DX, CX
+ SHRQ $0x03, CX
+ SUBQ CX, R13
+ MOVQ (R13), AX
+ SUBQ CX, BX
+ ANDQ $0x07, DX
+ JMP sequenceDecs_decode_56_bmi2_fill_end
+
+sequenceDecs_decode_56_bmi2_fill_byte_by_byte:
+ CMPQ BX, $0x00
+ JLE sequenceDecs_decode_56_bmi2_fill_check_overread
+ CMPQ DX, $0x07
+ JLE sequenceDecs_decode_56_bmi2_fill_end
+ SHLQ $0x08, AX
+ SUBQ $0x01, R13
+ SUBQ $0x01, BX
+ SUBQ $0x08, DX
+ MOVBQZX (R13), CX
+ ORQ CX, AX
+ JMP sequenceDecs_decode_56_bmi2_fill_byte_by_byte
+
+sequenceDecs_decode_56_bmi2_fill_check_overread:
+ CMPQ DX, $0x40
+ JA error_overread
+
+sequenceDecs_decode_56_bmi2_fill_end:
+ // Update offset
+ MOVQ $0x00000808, CX
+ BEXTRQ CX, R8, R14
+ MOVQ AX, R15
+ LEAQ (DX)(R14*1), CX
+ ROLQ CL, R15
+ BZHIQ R14, R15, R15
+ MOVQ CX, DX
+ MOVQ R8, CX
+ SHRQ $0x20, CX
+ ADDQ R15, CX
+ MOVQ CX, 16(R9)
+
+ // Update match length
+ MOVQ $0x00000808, CX
+ BEXTRQ CX, DI, R14
+ MOVQ AX, R15
+ LEAQ (DX)(R14*1), CX
+ ROLQ CL, R15
+ BZHIQ R14, R15, R15
+ MOVQ CX, DX
+ MOVQ DI, CX
+ SHRQ $0x20, CX
+ ADDQ R15, CX
+ MOVQ CX, 8(R9)
+
+ // Update literal length
+ MOVQ $0x00000808, CX
+ BEXTRQ CX, SI, R14
+ MOVQ AX, R15
+ LEAQ (DX)(R14*1), CX
+ ROLQ CL, R15
+ BZHIQ R14, R15, R15
+ MOVQ CX, DX
+ MOVQ SI, CX
+ SHRQ $0x20, CX
+ ADDQ R15, CX
+ MOVQ CX, (R9)
+
+ // Fill bitreader for state updates
+ MOVQ R13, (SP)
+ MOVQ $0x00000808, CX
+ BEXTRQ CX, R8, R13
+ MOVQ ctx+16(FP), CX
+ CMPQ 96(CX), $0x00
+ JZ sequenceDecs_decode_56_bmi2_skip_update
+ LEAQ (SI)(DI*1), R14
+ ADDQ R8, R14
+ MOVBQZX R14, R14
+ LEAQ (DX)(R14*1), CX
+ MOVQ AX, R15
+ MOVQ CX, DX
+ ROLQ CL, R15
+ BZHIQ R14, R15, R15
+
+ // Update Offset State
+ BZHIQ R8, R15, CX
+ SHRXQ R8, R15, R15
+ SHRL $0x10, R8
+ ADDQ CX, R8
+
+ // Load ctx.ofTable
+ MOVQ ctx+16(FP), CX
+ MOVQ 48(CX), CX
+ MOVQ (CX)(R8*8), R8
+
+ // Update Match Length State
+ BZHIQ DI, R15, CX
+ SHRXQ DI, R15, R15
+ SHRL $0x10, DI
+ ADDQ CX, DI
+
+ // Load ctx.mlTable
+ MOVQ ctx+16(FP), CX
+ MOVQ 24(CX), CX
+ MOVQ (CX)(DI*8), DI
+
+ // Update Literal Length State
+ BZHIQ SI, R15, CX
+ SHRL $0x10, SI
+ ADDQ CX, SI
+
+ // Load ctx.llTable
+ MOVQ ctx+16(FP), CX
+ MOVQ (CX), CX
+ MOVQ (CX)(SI*8), SI
+
+sequenceDecs_decode_56_bmi2_skip_update:
+ // Adjust offset
+ MOVQ 16(R9), CX
+ CMPQ R13, $0x01
+ JBE sequenceDecs_decode_56_bmi2_adjust_offsetB_1_or_0
+ MOVQ R11, R12
+ MOVQ R10, R11
+ MOVQ CX, R10
+ JMP sequenceDecs_decode_56_bmi2_after_adjust
+
+sequenceDecs_decode_56_bmi2_adjust_offsetB_1_or_0:
+ CMPQ (R9), $0x00000000
+ JNE sequenceDecs_decode_56_bmi2_adjust_offset_maybezero
+ INCQ CX
+ JMP sequenceDecs_decode_56_bmi2_adjust_offset_nonzero
+
+sequenceDecs_decode_56_bmi2_adjust_offset_maybezero:
+ TESTQ CX, CX
+ JNZ sequenceDecs_decode_56_bmi2_adjust_offset_nonzero
+ MOVQ R10, CX
+ JMP sequenceDecs_decode_56_bmi2_after_adjust
+
+sequenceDecs_decode_56_bmi2_adjust_offset_nonzero:
+ CMPQ CX, $0x01
+ JB sequenceDecs_decode_56_bmi2_adjust_zero
+ JEQ sequenceDecs_decode_56_bmi2_adjust_one
+ CMPQ CX, $0x02
+ JA sequenceDecs_decode_56_bmi2_adjust_three
+ JMP sequenceDecs_decode_56_bmi2_adjust_two
+
+sequenceDecs_decode_56_bmi2_adjust_zero:
+ MOVQ R10, R13
+ JMP sequenceDecs_decode_56_bmi2_adjust_test_temp_valid
+
+sequenceDecs_decode_56_bmi2_adjust_one:
+ MOVQ R11, R13
+ JMP sequenceDecs_decode_56_bmi2_adjust_test_temp_valid
+
+sequenceDecs_decode_56_bmi2_adjust_two:
+ MOVQ R12, R13
+ JMP sequenceDecs_decode_56_bmi2_adjust_test_temp_valid
+
+sequenceDecs_decode_56_bmi2_adjust_three:
+ LEAQ -1(R10), R13
+
+sequenceDecs_decode_56_bmi2_adjust_test_temp_valid:
+ TESTQ R13, R13
+ JNZ sequenceDecs_decode_56_bmi2_adjust_temp_valid
+ MOVQ $0x00000001, R13
+
+sequenceDecs_decode_56_bmi2_adjust_temp_valid:
+ CMPQ CX, $0x01
+ CMOVQNE R11, R12
+ MOVQ R10, R11
+ MOVQ R13, R10
+ MOVQ R13, CX
+
+sequenceDecs_decode_56_bmi2_after_adjust:
+ MOVQ CX, 16(R9)
+
+ // Check values
+ MOVQ 8(R9), R13
+ MOVQ (R9), R14
+ LEAQ (R13)(R14*1), R15
+ MOVQ s+0(FP), BP
+ ADDQ R15, 256(BP)
+ MOVQ ctx+16(FP), R15
+ SUBQ R14, 128(R15)
+ JS error_not_enough_literals
+ CMPQ R13, $0x00020002
+ JA sequenceDecs_decode_56_bmi2_error_match_len_too_big
+ TESTQ CX, CX
+ JNZ sequenceDecs_decode_56_bmi2_match_len_ofs_ok
+ TESTQ R13, R13
+ JNZ sequenceDecs_decode_56_bmi2_error_match_len_ofs_mismatch
+
+sequenceDecs_decode_56_bmi2_match_len_ofs_ok:
+ ADDQ $0x18, R9
+ MOVQ ctx+16(FP), CX
+ DECQ 96(CX)
+ JNS sequenceDecs_decode_56_bmi2_main_loop
+ MOVQ s+0(FP), CX
+ MOVQ R10, 144(CX)
+ MOVQ R11, 152(CX)
+ MOVQ R12, 160(CX)
+ MOVQ br+8(FP), CX
+ MOVQ AX, 24(CX)
+ MOVB DL, 32(CX)
+ MOVQ BX, 8(CX)
+
+ // Return success
+ MOVQ $0x00000000, ret+24(FP)
+ RET
+
+ // Return with match length error
+sequenceDecs_decode_56_bmi2_error_match_len_ofs_mismatch:
+ MOVQ $0x00000001, ret+24(FP)
+ RET
+
+ // Return with match too long error
+sequenceDecs_decode_56_bmi2_error_match_len_too_big:
+ MOVQ $0x00000002, ret+24(FP)
+ RET
+
+ // Return with match offset too long error
+ MOVQ $0x00000003, ret+24(FP)
+ RET
+
+ // Return with not enough literals error
+error_not_enough_literals:
+ MOVQ $0x00000004, ret+24(FP)
+ RET
+
+ // Return with overread error
+error_overread:
+ MOVQ $0x00000006, ret+24(FP)
+ RET
+
+// func sequenceDecs_executeSimple_amd64(ctx *executeAsmContext) bool
+// Requires: SSE
+TEXT ·sequenceDecs_executeSimple_amd64(SB), $8-9
+ MOVQ ctx+0(FP), R10
+ MOVQ 8(R10), CX
+ TESTQ CX, CX
+ JZ empty_seqs
+ MOVQ (R10), AX
+ MOVQ 24(R10), DX
+ MOVQ 32(R10), BX
+ MOVQ 80(R10), SI
+ MOVQ 104(R10), DI
+ MOVQ 120(R10), R8
+ MOVQ 56(R10), R9
+ MOVQ 64(R10), R10
+ ADDQ R10, R9
+
+ // seqsBase += 24 * seqIndex
+ LEAQ (DX)(DX*2), R11
+ SHLQ $0x03, R11
+ ADDQ R11, AX
+
+ // outBase += outPosition
+ ADDQ DI, BX
+
+main_loop:
+ MOVQ (AX), R11
+ MOVQ 16(AX), R12
+ MOVQ 8(AX), R13
+
+ // Copy literals
+ TESTQ R11, R11
+ JZ check_offset
+ XORQ R14, R14
+
+copy_1:
+ MOVUPS (SI)(R14*1), X0
+ MOVUPS X0, (BX)(R14*1)
+ ADDQ $0x10, R14
+ CMPQ R14, R11
+ JB copy_1
+ ADDQ R11, SI
+ ADDQ R11, BX
+ ADDQ R11, DI
+
+ // Malformed input if seq.mo > t+len(hist) || seq.mo > s.windowSize)
+check_offset:
+ LEAQ (DI)(R10*1), R11
+ CMPQ R12, R11
+ JG error_match_off_too_big
+ CMPQ R12, R8
+ JG error_match_off_too_big
+
+ // Copy match from history
+ MOVQ R12, R11
+ SUBQ DI, R11
+ JLS copy_match
+ MOVQ R9, R14
+ SUBQ R11, R14
+ CMPQ R13, R11
+ JG copy_all_from_history
+ MOVQ R13, R11
+ SUBQ $0x10, R11
+ JB copy_4_small
+
+copy_4_loop:
+ MOVUPS (R14), X0
+ MOVUPS X0, (BX)
+ ADDQ $0x10, R14
+ ADDQ $0x10, BX
+ SUBQ $0x10, R11
+ JAE copy_4_loop
+ LEAQ 16(R14)(R11*1), R14
+ LEAQ 16(BX)(R11*1), BX
+ MOVUPS -16(R14), X0
+ MOVUPS X0, -16(BX)
+ JMP copy_4_end
+
+copy_4_small:
+ CMPQ R13, $0x03
+ JE copy_4_move_3
+ CMPQ R13, $0x08
+ JB copy_4_move_4through7
+ JMP copy_4_move_8through16
+
+copy_4_move_3:
+ MOVW (R14), R11
+ MOVB 2(R14), R12
+ MOVW R11, (BX)
+ MOVB R12, 2(BX)
+ ADDQ R13, R14
+ ADDQ R13, BX
+ JMP copy_4_end
+
+copy_4_move_4through7:
+ MOVL (R14), R11
+ MOVL -4(R14)(R13*1), R12
+ MOVL R11, (BX)
+ MOVL R12, -4(BX)(R13*1)
+ ADDQ R13, R14
+ ADDQ R13, BX
+ JMP copy_4_end
+
+copy_4_move_8through16:
+ MOVQ (R14), R11
+ MOVQ -8(R14)(R13*1), R12
+ MOVQ R11, (BX)
+ MOVQ R12, -8(BX)(R13*1)
+ ADDQ R13, R14
+ ADDQ R13, BX
+
+copy_4_end:
+ ADDQ R13, DI
+ ADDQ $0x18, AX
+ INCQ DX
+ CMPQ DX, CX
+ JB main_loop
+ JMP loop_finished
+
+copy_all_from_history:
+ MOVQ R11, R15
+ SUBQ $0x10, R15
+ JB copy_5_small
+
+copy_5_loop:
+ MOVUPS (R14), X0
+ MOVUPS X0, (BX)
+ ADDQ $0x10, R14
+ ADDQ $0x10, BX
+ SUBQ $0x10, R15
+ JAE copy_5_loop
+ LEAQ 16(R14)(R15*1), R14
+ LEAQ 16(BX)(R15*1), BX
+ MOVUPS -16(R14), X0
+ MOVUPS X0, -16(BX)
+ JMP copy_5_end
+
+copy_5_small:
+ CMPQ R11, $0x03
+ JE copy_5_move_3
+ JB copy_5_move_1or2
+ CMPQ R11, $0x08
+ JB copy_5_move_4through7
+ JMP copy_5_move_8through16
+
+copy_5_move_1or2:
+ MOVB (R14), R15
+ MOVB -1(R14)(R11*1), BP
+ MOVB R15, (BX)
+ MOVB BP, -1(BX)(R11*1)
+ ADDQ R11, R14
+ ADDQ R11, BX
+ JMP copy_5_end
+
+copy_5_move_3:
+ MOVW (R14), R15
+ MOVB 2(R14), BP
+ MOVW R15, (BX)
+ MOVB BP, 2(BX)
+ ADDQ R11, R14
+ ADDQ R11, BX
+ JMP copy_5_end
+
+copy_5_move_4through7:
+ MOVL (R14), R15
+ MOVL -4(R14)(R11*1), BP
+ MOVL R15, (BX)
+ MOVL BP, -4(BX)(R11*1)
+ ADDQ R11, R14
+ ADDQ R11, BX
+ JMP copy_5_end
+
+copy_5_move_8through16:
+ MOVQ (R14), R15
+ MOVQ -8(R14)(R11*1), BP
+ MOVQ R15, (BX)
+ MOVQ BP, -8(BX)(R11*1)
+ ADDQ R11, R14
+ ADDQ R11, BX
+
+copy_5_end:
+ ADDQ R11, DI
+ SUBQ R11, R13
+
+ // Copy match from the current buffer
+copy_match:
+ MOVQ BX, R11
+ SUBQ R12, R11
+
+ // ml <= mo
+ CMPQ R13, R12
+ JA copy_overlapping_match
+
+ // Copy non-overlapping match
+ ADDQ R13, DI
+ MOVQ BX, R12
+ ADDQ R13, BX
+
+copy_2:
+ MOVUPS (R11), X0
+ MOVUPS X0, (R12)
+ ADDQ $0x10, R11
+ ADDQ $0x10, R12
+ SUBQ $0x10, R13
+ JHI copy_2
+ JMP handle_loop
+
+ // Copy overlapping match
+copy_overlapping_match:
+ ADDQ R13, DI
+
+copy_slow_3:
+ MOVB (R11), R12
+ MOVB R12, (BX)
+ INCQ R11
+ INCQ BX
+ DECQ R13
+ JNZ copy_slow_3
+
+handle_loop:
+ ADDQ $0x18, AX
+ INCQ DX
+ CMPQ DX, CX
+ JB main_loop
+
+loop_finished:
+ // Return value
+ MOVB $0x01, ret+8(FP)
+
+ // Update the context
+ MOVQ ctx+0(FP), AX
+ MOVQ DX, 24(AX)
+ MOVQ DI, 104(AX)
+ SUBQ 80(AX), SI
+ MOVQ SI, 112(AX)
+ RET
+
+error_match_off_too_big:
+ // Return value
+ MOVB $0x00, ret+8(FP)
+
+ // Update the context
+ MOVQ ctx+0(FP), AX
+ MOVQ DX, 24(AX)
+ MOVQ DI, 104(AX)
+ SUBQ 80(AX), SI
+ MOVQ SI, 112(AX)
+ RET
+
+empty_seqs:
+ // Return value
+ MOVB $0x01, ret+8(FP)
+ RET
+
+// func sequenceDecs_executeSimple_safe_amd64(ctx *executeAsmContext) bool
+// Requires: SSE
+TEXT ·sequenceDecs_executeSimple_safe_amd64(SB), $8-9
+ MOVQ ctx+0(FP), R10
+ MOVQ 8(R10), CX
+ TESTQ CX, CX
+ JZ empty_seqs
+ MOVQ (R10), AX
+ MOVQ 24(R10), DX
+ MOVQ 32(R10), BX
+ MOVQ 80(R10), SI
+ MOVQ 104(R10), DI
+ MOVQ 120(R10), R8
+ MOVQ 56(R10), R9
+ MOVQ 64(R10), R10
+ ADDQ R10, R9
+
+ // seqsBase += 24 * seqIndex
+ LEAQ (DX)(DX*2), R11
+ SHLQ $0x03, R11
+ ADDQ R11, AX
+
+ // outBase += outPosition
+ ADDQ DI, BX
+
+main_loop:
+ MOVQ (AX), R11
+ MOVQ 16(AX), R12
+ MOVQ 8(AX), R13
+
+ // Copy literals
+ TESTQ R11, R11
+ JZ check_offset
+ MOVQ R11, R14
+ SUBQ $0x10, R14
+ JB copy_1_small
+
+copy_1_loop:
+ MOVUPS (SI), X0
+ MOVUPS X0, (BX)
+ ADDQ $0x10, SI
+ ADDQ $0x10, BX
+ SUBQ $0x10, R14
+ JAE copy_1_loop
+ LEAQ 16(SI)(R14*1), SI
+ LEAQ 16(BX)(R14*1), BX
+ MOVUPS -16(SI), X0
+ MOVUPS X0, -16(BX)
+ JMP copy_1_end
+
+copy_1_small:
+ CMPQ R11, $0x03
+ JE copy_1_move_3
+ JB copy_1_move_1or2
+ CMPQ R11, $0x08
+ JB copy_1_move_4through7
+ JMP copy_1_move_8through16
+
+copy_1_move_1or2:
+ MOVB (SI), R14
+ MOVB -1(SI)(R11*1), R15
+ MOVB R14, (BX)
+ MOVB R15, -1(BX)(R11*1)
+ ADDQ R11, SI
+ ADDQ R11, BX
+ JMP copy_1_end
+
+copy_1_move_3:
+ MOVW (SI), R14
+ MOVB 2(SI), R15
+ MOVW R14, (BX)
+ MOVB R15, 2(BX)
+ ADDQ R11, SI
+ ADDQ R11, BX
+ JMP copy_1_end
+
+copy_1_move_4through7:
+ MOVL (SI), R14
+ MOVL -4(SI)(R11*1), R15
+ MOVL R14, (BX)
+ MOVL R15, -4(BX)(R11*1)
+ ADDQ R11, SI
+ ADDQ R11, BX
+ JMP copy_1_end
+
+copy_1_move_8through16:
+ MOVQ (SI), R14
+ MOVQ -8(SI)(R11*1), R15
+ MOVQ R14, (BX)
+ MOVQ R15, -8(BX)(R11*1)
+ ADDQ R11, SI
+ ADDQ R11, BX
+
+copy_1_end:
+ ADDQ R11, DI
+
+ // Malformed input if seq.mo > t+len(hist) || seq.mo > s.windowSize)
+check_offset:
+ LEAQ (DI)(R10*1), R11
+ CMPQ R12, R11
+ JG error_match_off_too_big
+ CMPQ R12, R8
+ JG error_match_off_too_big
+
+ // Copy match from history
+ MOVQ R12, R11
+ SUBQ DI, R11
+ JLS copy_match
+ MOVQ R9, R14
+ SUBQ R11, R14
+ CMPQ R13, R11
+ JG copy_all_from_history
+ MOVQ R13, R11
+ SUBQ $0x10, R11
+ JB copy_4_small
+
+copy_4_loop:
+ MOVUPS (R14), X0
+ MOVUPS X0, (BX)
+ ADDQ $0x10, R14
+ ADDQ $0x10, BX
+ SUBQ $0x10, R11
+ JAE copy_4_loop
+ LEAQ 16(R14)(R11*1), R14
+ LEAQ 16(BX)(R11*1), BX
+ MOVUPS -16(R14), X0
+ MOVUPS X0, -16(BX)
+ JMP copy_4_end
+
+copy_4_small:
+ CMPQ R13, $0x03
+ JE copy_4_move_3
+ CMPQ R13, $0x08
+ JB copy_4_move_4through7
+ JMP copy_4_move_8through16
+
+copy_4_move_3:
+ MOVW (R14), R11
+ MOVB 2(R14), R12
+ MOVW R11, (BX)
+ MOVB R12, 2(BX)
+ ADDQ R13, R14
+ ADDQ R13, BX
+ JMP copy_4_end
+
+copy_4_move_4through7:
+ MOVL (R14), R11
+ MOVL -4(R14)(R13*1), R12
+ MOVL R11, (BX)
+ MOVL R12, -4(BX)(R13*1)
+ ADDQ R13, R14
+ ADDQ R13, BX
+ JMP copy_4_end
+
+copy_4_move_8through16:
+ MOVQ (R14), R11
+ MOVQ -8(R14)(R13*1), R12
+ MOVQ R11, (BX)
+ MOVQ R12, -8(BX)(R13*1)
+ ADDQ R13, R14
+ ADDQ R13, BX
+
+copy_4_end:
+ ADDQ R13, DI
+ ADDQ $0x18, AX
+ INCQ DX
+ CMPQ DX, CX
+ JB main_loop
+ JMP loop_finished
+
+copy_all_from_history:
+ MOVQ R11, R15
+ SUBQ $0x10, R15
+ JB copy_5_small
+
+copy_5_loop:
+ MOVUPS (R14), X0
+ MOVUPS X0, (BX)
+ ADDQ $0x10, R14
+ ADDQ $0x10, BX
+ SUBQ $0x10, R15
+ JAE copy_5_loop
+ LEAQ 16(R14)(R15*1), R14
+ LEAQ 16(BX)(R15*1), BX
+ MOVUPS -16(R14), X0
+ MOVUPS X0, -16(BX)
+ JMP copy_5_end
+
+copy_5_small:
+ CMPQ R11, $0x03
+ JE copy_5_move_3
+ JB copy_5_move_1or2
+ CMPQ R11, $0x08
+ JB copy_5_move_4through7
+ JMP copy_5_move_8through16
+
+copy_5_move_1or2:
+ MOVB (R14), R15
+ MOVB -1(R14)(R11*1), BP
+ MOVB R15, (BX)
+ MOVB BP, -1(BX)(R11*1)
+ ADDQ R11, R14
+ ADDQ R11, BX
+ JMP copy_5_end
+
+copy_5_move_3:
+ MOVW (R14), R15
+ MOVB 2(R14), BP
+ MOVW R15, (BX)
+ MOVB BP, 2(BX)
+ ADDQ R11, R14
+ ADDQ R11, BX
+ JMP copy_5_end
+
+copy_5_move_4through7:
+ MOVL (R14), R15
+ MOVL -4(R14)(R11*1), BP
+ MOVL R15, (BX)
+ MOVL BP, -4(BX)(R11*1)
+ ADDQ R11, R14
+ ADDQ R11, BX
+ JMP copy_5_end
+
+copy_5_move_8through16:
+ MOVQ (R14), R15
+ MOVQ -8(R14)(R11*1), BP
+ MOVQ R15, (BX)
+ MOVQ BP, -8(BX)(R11*1)
+ ADDQ R11, R14
+ ADDQ R11, BX
+
+copy_5_end:
+ ADDQ R11, DI
+ SUBQ R11, R13
+
+ // Copy match from the current buffer
+copy_match:
+ MOVQ BX, R11
+ SUBQ R12, R11
+
+ // ml <= mo
+ CMPQ R13, R12
+ JA copy_overlapping_match
+
+ // Copy non-overlapping match
+ ADDQ R13, DI
+ MOVQ R13, R12
+ SUBQ $0x10, R12
+ JB copy_2_small
+
+copy_2_loop:
+ MOVUPS (R11), X0
+ MOVUPS X0, (BX)
+ ADDQ $0x10, R11
+ ADDQ $0x10, BX
+ SUBQ $0x10, R12
+ JAE copy_2_loop
+ LEAQ 16(R11)(R12*1), R11
+ LEAQ 16(BX)(R12*1), BX
+ MOVUPS -16(R11), X0
+ MOVUPS X0, -16(BX)
+ JMP copy_2_end
+
+copy_2_small:
+ CMPQ R13, $0x03
+ JE copy_2_move_3
+ JB copy_2_move_1or2
+ CMPQ R13, $0x08
+ JB copy_2_move_4through7
+ JMP copy_2_move_8through16
+
+copy_2_move_1or2:
+ MOVB (R11), R12
+ MOVB -1(R11)(R13*1), R14
+ MOVB R12, (BX)
+ MOVB R14, -1(BX)(R13*1)
+ ADDQ R13, R11
+ ADDQ R13, BX
+ JMP copy_2_end
+
+copy_2_move_3:
+ MOVW (R11), R12
+ MOVB 2(R11), R14
+ MOVW R12, (BX)
+ MOVB R14, 2(BX)
+ ADDQ R13, R11
+ ADDQ R13, BX
+ JMP copy_2_end
+
+copy_2_move_4through7:
+ MOVL (R11), R12
+ MOVL -4(R11)(R13*1), R14
+ MOVL R12, (BX)
+ MOVL R14, -4(BX)(R13*1)
+ ADDQ R13, R11
+ ADDQ R13, BX
+ JMP copy_2_end
+
+copy_2_move_8through16:
+ MOVQ (R11), R12
+ MOVQ -8(R11)(R13*1), R14
+ MOVQ R12, (BX)
+ MOVQ R14, -8(BX)(R13*1)
+ ADDQ R13, R11
+ ADDQ R13, BX
+
+copy_2_end:
+ JMP handle_loop
+
+ // Copy overlapping match
+copy_overlapping_match:
+ ADDQ R13, DI
+
+copy_slow_3:
+ MOVB (R11), R12
+ MOVB R12, (BX)
+ INCQ R11
+ INCQ BX
+ DECQ R13
+ JNZ copy_slow_3
+
+handle_loop:
+ ADDQ $0x18, AX
+ INCQ DX
+ CMPQ DX, CX
+ JB main_loop
+
+loop_finished:
+ // Return value
+ MOVB $0x01, ret+8(FP)
+
+ // Update the context
+ MOVQ ctx+0(FP), AX
+ MOVQ DX, 24(AX)
+ MOVQ DI, 104(AX)
+ SUBQ 80(AX), SI
+ MOVQ SI, 112(AX)
+ RET
+
+error_match_off_too_big:
+ // Return value
+ MOVB $0x00, ret+8(FP)
+
+ // Update the context
+ MOVQ ctx+0(FP), AX
+ MOVQ DX, 24(AX)
+ MOVQ DI, 104(AX)
+ SUBQ 80(AX), SI
+ MOVQ SI, 112(AX)
+ RET
+
+empty_seqs:
+ // Return value
+ MOVB $0x01, ret+8(FP)
+ RET
+
+// func sequenceDecs_decodeSync_amd64(s *sequenceDecs, br *bitReader, ctx *decodeSyncAsmContext) int
+// Requires: CMOV, SSE
+TEXT ·sequenceDecs_decodeSync_amd64(SB), $64-32
+ MOVQ br+8(FP), CX
+ MOVQ 24(CX), DX
+ MOVBQZX 32(CX), BX
+ MOVQ (CX), AX
+ MOVQ 8(CX), SI
+ ADDQ SI, AX
+ MOVQ AX, (SP)
+ MOVQ ctx+16(FP), AX
+ MOVQ 72(AX), DI
+ MOVQ 80(AX), R8
+ MOVQ 88(AX), R9
+ XORQ CX, CX
+ MOVQ CX, 8(SP)
+ MOVQ CX, 16(SP)
+ MOVQ CX, 24(SP)
+ MOVQ 112(AX), R10
+ MOVQ 128(AX), CX
+ MOVQ CX, 32(SP)
+ MOVQ 144(AX), R11
+ MOVQ 136(AX), R12
+ MOVQ 200(AX), CX
+ MOVQ CX, 56(SP)
+ MOVQ 176(AX), CX
+ MOVQ CX, 48(SP)
+ MOVQ 184(AX), AX
+ MOVQ AX, 40(SP)
+ MOVQ 40(SP), AX
+ ADDQ AX, 48(SP)
+
+ // Calculate pointer to s.out[cap(s.out)] (a past-end pointer)
+ ADDQ R10, 32(SP)
+
+ // outBase += outPosition
+ ADDQ R12, R10
+
+sequenceDecs_decodeSync_amd64_main_loop:
+ MOVQ (SP), R13
+
+ // Fill bitreader to have enough for the offset and match length.
+ CMPQ SI, $0x08
+ JL sequenceDecs_decodeSync_amd64_fill_byte_by_byte
+ MOVQ BX, AX
+ SHRQ $0x03, AX
+ SUBQ AX, R13
+ MOVQ (R13), DX
+ SUBQ AX, SI
+ ANDQ $0x07, BX
+ JMP sequenceDecs_decodeSync_amd64_fill_end
+
+sequenceDecs_decodeSync_amd64_fill_byte_by_byte:
+ CMPQ SI, $0x00
+ JLE sequenceDecs_decodeSync_amd64_fill_check_overread
+ CMPQ BX, $0x07
+ JLE sequenceDecs_decodeSync_amd64_fill_end
+ SHLQ $0x08, DX
+ SUBQ $0x01, R13
+ SUBQ $0x01, SI
+ SUBQ $0x08, BX
+ MOVBQZX (R13), AX
+ ORQ AX, DX
+ JMP sequenceDecs_decodeSync_amd64_fill_byte_by_byte
+
+sequenceDecs_decodeSync_amd64_fill_check_overread:
+ CMPQ BX, $0x40
+ JA error_overread
+
+sequenceDecs_decodeSync_amd64_fill_end:
+ // Update offset
+ MOVQ R9, AX
+ MOVQ BX, CX
+ MOVQ DX, R14
+ SHLQ CL, R14
+ MOVB AH, CL
+ SHRQ $0x20, AX
+ TESTQ CX, CX
+ JZ sequenceDecs_decodeSync_amd64_of_update_zero
+ ADDQ CX, BX
+ CMPQ BX, $0x40
+ JA sequenceDecs_decodeSync_amd64_of_update_zero
+ CMPQ CX, $0x40
+ JAE sequenceDecs_decodeSync_amd64_of_update_zero
+ NEGQ CX
+ SHRQ CL, R14
+ ADDQ R14, AX
+
+sequenceDecs_decodeSync_amd64_of_update_zero:
+ MOVQ AX, 8(SP)
+
+ // Update match length
+ MOVQ R8, AX
+ MOVQ BX, CX
+ MOVQ DX, R14
+ SHLQ CL, R14
+ MOVB AH, CL
+ SHRQ $0x20, AX
+ TESTQ CX, CX
+ JZ sequenceDecs_decodeSync_amd64_ml_update_zero
+ ADDQ CX, BX
+ CMPQ BX, $0x40
+ JA sequenceDecs_decodeSync_amd64_ml_update_zero
+ CMPQ CX, $0x40
+ JAE sequenceDecs_decodeSync_amd64_ml_update_zero
+ NEGQ CX
+ SHRQ CL, R14
+ ADDQ R14, AX
+
+sequenceDecs_decodeSync_amd64_ml_update_zero:
+ MOVQ AX, 16(SP)
+
+ // Fill bitreader to have enough for the remaining
+ CMPQ SI, $0x08
+ JL sequenceDecs_decodeSync_amd64_fill_2_byte_by_byte
+ MOVQ BX, AX
+ SHRQ $0x03, AX
+ SUBQ AX, R13
+ MOVQ (R13), DX
+ SUBQ AX, SI
+ ANDQ $0x07, BX
+ JMP sequenceDecs_decodeSync_amd64_fill_2_end
+
+sequenceDecs_decodeSync_amd64_fill_2_byte_by_byte:
+ CMPQ SI, $0x00
+ JLE sequenceDecs_decodeSync_amd64_fill_2_check_overread
+ CMPQ BX, $0x07
+ JLE sequenceDecs_decodeSync_amd64_fill_2_end
+ SHLQ $0x08, DX
+ SUBQ $0x01, R13
+ SUBQ $0x01, SI
+ SUBQ $0x08, BX
+ MOVBQZX (R13), AX
+ ORQ AX, DX
+ JMP sequenceDecs_decodeSync_amd64_fill_2_byte_by_byte
+
+sequenceDecs_decodeSync_amd64_fill_2_check_overread:
+ CMPQ BX, $0x40
+ JA error_overread
+
+sequenceDecs_decodeSync_amd64_fill_2_end:
+ // Update literal length
+ MOVQ DI, AX
+ MOVQ BX, CX
+ MOVQ DX, R14
+ SHLQ CL, R14
+ MOVB AH, CL
+ SHRQ $0x20, AX
+ TESTQ CX, CX
+ JZ sequenceDecs_decodeSync_amd64_ll_update_zero
+ ADDQ CX, BX
+ CMPQ BX, $0x40
+ JA sequenceDecs_decodeSync_amd64_ll_update_zero
+ CMPQ CX, $0x40
+ JAE sequenceDecs_decodeSync_amd64_ll_update_zero
+ NEGQ CX
+ SHRQ CL, R14
+ ADDQ R14, AX
+
+sequenceDecs_decodeSync_amd64_ll_update_zero:
+ MOVQ AX, 24(SP)
+
+ // Fill bitreader for state updates
+ MOVQ R13, (SP)
+ MOVQ R9, AX
+ SHRQ $0x08, AX
+ MOVBQZX AL, AX
+ MOVQ ctx+16(FP), CX
+ CMPQ 96(CX), $0x00
+ JZ sequenceDecs_decodeSync_amd64_skip_update
+
+ // Update Literal Length State
+ MOVBQZX DI, R13
+ SHRL $0x10, DI
+ LEAQ (BX)(R13*1), CX
+ MOVQ DX, R14
+ MOVQ CX, BX
+ ROLQ CL, R14
+ MOVL $0x00000001, R15
+ MOVB R13, CL
+ SHLL CL, R15
+ DECL R15
+ ANDQ R15, R14
+ ADDQ R14, DI
+
+ // Load ctx.llTable
+ MOVQ ctx+16(FP), CX
+ MOVQ (CX), CX
+ MOVQ (CX)(DI*8), DI
+
+ // Update Match Length State
+ MOVBQZX R8, R13
+ SHRL $0x10, R8
+ LEAQ (BX)(R13*1), CX
+ MOVQ DX, R14
+ MOVQ CX, BX
+ ROLQ CL, R14
+ MOVL $0x00000001, R15
+ MOVB R13, CL
+ SHLL CL, R15
+ DECL R15
+ ANDQ R15, R14
+ ADDQ R14, R8
+
+ // Load ctx.mlTable
+ MOVQ ctx+16(FP), CX
+ MOVQ 24(CX), CX
+ MOVQ (CX)(R8*8), R8
+
+ // Update Offset State
+ MOVBQZX R9, R13
+ SHRL $0x10, R9
+ LEAQ (BX)(R13*1), CX
+ MOVQ DX, R14
+ MOVQ CX, BX
+ ROLQ CL, R14
+ MOVL $0x00000001, R15
+ MOVB R13, CL
+ SHLL CL, R15
+ DECL R15
+ ANDQ R15, R14
+ ADDQ R14, R9
+
+ // Load ctx.ofTable
+ MOVQ ctx+16(FP), CX
+ MOVQ 48(CX), CX
+ MOVQ (CX)(R9*8), R9
+
+sequenceDecs_decodeSync_amd64_skip_update:
+ // Adjust offset
+ MOVQ s+0(FP), CX
+ MOVQ 8(SP), R13
+ CMPQ AX, $0x01
+ JBE sequenceDecs_decodeSync_amd64_adjust_offsetB_1_or_0
+ MOVUPS 144(CX), X0
+ MOVQ R13, 144(CX)
+ MOVUPS X0, 152(CX)
+ JMP sequenceDecs_decodeSync_amd64_after_adjust
+
+sequenceDecs_decodeSync_amd64_adjust_offsetB_1_or_0:
+ CMPQ 24(SP), $0x00000000
+ JNE sequenceDecs_decodeSync_amd64_adjust_offset_maybezero
+ INCQ R13
+ JMP sequenceDecs_decodeSync_amd64_adjust_offset_nonzero
+
+sequenceDecs_decodeSync_amd64_adjust_offset_maybezero:
+ TESTQ R13, R13
+ JNZ sequenceDecs_decodeSync_amd64_adjust_offset_nonzero
+ MOVQ 144(CX), R13
+ JMP sequenceDecs_decodeSync_amd64_after_adjust
+
+sequenceDecs_decodeSync_amd64_adjust_offset_nonzero:
+ MOVQ R13, AX
+ XORQ R14, R14
+ MOVQ $-1, R15
+ CMPQ R13, $0x03
+ CMOVQEQ R14, AX
+ CMOVQEQ R15, R14
+ ADDQ 144(CX)(AX*8), R14
+ JNZ sequenceDecs_decodeSync_amd64_adjust_temp_valid
+ MOVQ $0x00000001, R14
+
+sequenceDecs_decodeSync_amd64_adjust_temp_valid:
+ CMPQ R13, $0x01
+ JZ sequenceDecs_decodeSync_amd64_adjust_skip
+ MOVQ 152(CX), AX
+ MOVQ AX, 160(CX)
+
+sequenceDecs_decodeSync_amd64_adjust_skip:
+ MOVQ 144(CX), AX
+ MOVQ AX, 152(CX)
+ MOVQ R14, 144(CX)
+ MOVQ R14, R13
+
+sequenceDecs_decodeSync_amd64_after_adjust:
+ MOVQ R13, 8(SP)
+
+ // Check values
+ MOVQ 16(SP), AX
+ MOVQ 24(SP), CX
+ LEAQ (AX)(CX*1), R14
+ MOVQ s+0(FP), R15
+ ADDQ R14, 256(R15)
+ MOVQ ctx+16(FP), R14
+ SUBQ CX, 104(R14)
+ JS error_not_enough_literals
+ CMPQ AX, $0x00020002
+ JA sequenceDecs_decodeSync_amd64_error_match_len_too_big
+ TESTQ R13, R13
+ JNZ sequenceDecs_decodeSync_amd64_match_len_ofs_ok
+ TESTQ AX, AX
+ JNZ sequenceDecs_decodeSync_amd64_error_match_len_ofs_mismatch
+
+sequenceDecs_decodeSync_amd64_match_len_ofs_ok:
+ MOVQ 24(SP), AX
+ MOVQ 8(SP), CX
+ MOVQ 16(SP), R13
+
+ // Check if we have enough space in s.out
+ LEAQ (AX)(R13*1), R14
+ ADDQ R10, R14
+ CMPQ R14, 32(SP)
+ JA error_not_enough_space
+
+ // Copy literals
+ TESTQ AX, AX
+ JZ check_offset
+ XORQ R14, R14
+
+copy_1:
+ MOVUPS (R11)(R14*1), X0
+ MOVUPS X0, (R10)(R14*1)
+ ADDQ $0x10, R14
+ CMPQ R14, AX
+ JB copy_1
+ ADDQ AX, R11
+ ADDQ AX, R10
+ ADDQ AX, R12
+
+ // Malformed input if seq.mo > t+len(hist) || seq.mo > s.windowSize)
+check_offset:
+ MOVQ R12, AX
+ ADDQ 40(SP), AX
+ CMPQ CX, AX
+ JG error_match_off_too_big
+ CMPQ CX, 56(SP)
+ JG error_match_off_too_big
+
+ // Copy match from history
+ MOVQ CX, AX
+ SUBQ R12, AX
+ JLS copy_match
+ MOVQ 48(SP), R14
+ SUBQ AX, R14
+ CMPQ R13, AX
+ JG copy_all_from_history
+ MOVQ R13, AX
+ SUBQ $0x10, AX
+ JB copy_4_small
+
+copy_4_loop:
+ MOVUPS (R14), X0
+ MOVUPS X0, (R10)
+ ADDQ $0x10, R14
+ ADDQ $0x10, R10
+ SUBQ $0x10, AX
+ JAE copy_4_loop
+ LEAQ 16(R14)(AX*1), R14
+ LEAQ 16(R10)(AX*1), R10
+ MOVUPS -16(R14), X0
+ MOVUPS X0, -16(R10)
+ JMP copy_4_end
+
+copy_4_small:
+ CMPQ R13, $0x03
+ JE copy_4_move_3
+ CMPQ R13, $0x08
+ JB copy_4_move_4through7
+ JMP copy_4_move_8through16
+
+copy_4_move_3:
+ MOVW (R14), AX
+ MOVB 2(R14), CL
+ MOVW AX, (R10)
+ MOVB CL, 2(R10)
+ ADDQ R13, R14
+ ADDQ R13, R10
+ JMP copy_4_end
+
+copy_4_move_4through7:
+ MOVL (R14), AX
+ MOVL -4(R14)(R13*1), CX
+ MOVL AX, (R10)
+ MOVL CX, -4(R10)(R13*1)
+ ADDQ R13, R14
+ ADDQ R13, R10
+ JMP copy_4_end
+
+copy_4_move_8through16:
+ MOVQ (R14), AX
+ MOVQ -8(R14)(R13*1), CX
+ MOVQ AX, (R10)
+ MOVQ CX, -8(R10)(R13*1)
+ ADDQ R13, R14
+ ADDQ R13, R10
+
+copy_4_end:
+ ADDQ R13, R12
+ JMP handle_loop
+ JMP loop_finished
+
+copy_all_from_history:
+ MOVQ AX, R15
+ SUBQ $0x10, R15
+ JB copy_5_small
+
+copy_5_loop:
+ MOVUPS (R14), X0
+ MOVUPS X0, (R10)
+ ADDQ $0x10, R14
+ ADDQ $0x10, R10
+ SUBQ $0x10, R15
+ JAE copy_5_loop
+ LEAQ 16(R14)(R15*1), R14
+ LEAQ 16(R10)(R15*1), R10
+ MOVUPS -16(R14), X0
+ MOVUPS X0, -16(R10)
+ JMP copy_5_end
+
+copy_5_small:
+ CMPQ AX, $0x03
+ JE copy_5_move_3
+ JB copy_5_move_1or2
+ CMPQ AX, $0x08
+ JB copy_5_move_4through7
+ JMP copy_5_move_8through16
+
+copy_5_move_1or2:
+ MOVB (R14), R15
+ MOVB -1(R14)(AX*1), BP
+ MOVB R15, (R10)
+ MOVB BP, -1(R10)(AX*1)
+ ADDQ AX, R14
+ ADDQ AX, R10
+ JMP copy_5_end
+
+copy_5_move_3:
+ MOVW (R14), R15
+ MOVB 2(R14), BP
+ MOVW R15, (R10)
+ MOVB BP, 2(R10)
+ ADDQ AX, R14
+ ADDQ AX, R10
+ JMP copy_5_end
+
+copy_5_move_4through7:
+ MOVL (R14), R15
+ MOVL -4(R14)(AX*1), BP
+ MOVL R15, (R10)
+ MOVL BP, -4(R10)(AX*1)
+ ADDQ AX, R14
+ ADDQ AX, R10
+ JMP copy_5_end
+
+copy_5_move_8through16:
+ MOVQ (R14), R15
+ MOVQ -8(R14)(AX*1), BP
+ MOVQ R15, (R10)
+ MOVQ BP, -8(R10)(AX*1)
+ ADDQ AX, R14
+ ADDQ AX, R10
+
+copy_5_end:
+ ADDQ AX, R12
+ SUBQ AX, R13
+
+ // Copy match from the current buffer
+copy_match:
+ MOVQ R10, AX
+ SUBQ CX, AX
+
+ // ml <= mo
+ CMPQ R13, CX
+ JA copy_overlapping_match
+
+ // Copy non-overlapping match
+ ADDQ R13, R12
+ MOVQ R10, CX
+ ADDQ R13, R10
+
+copy_2:
+ MOVUPS (AX), X0
+ MOVUPS X0, (CX)
+ ADDQ $0x10, AX
+ ADDQ $0x10, CX
+ SUBQ $0x10, R13
+ JHI copy_2
+ JMP handle_loop
+
+ // Copy overlapping match
+copy_overlapping_match:
+ ADDQ R13, R12
+
+copy_slow_3:
+ MOVB (AX), CL
+ MOVB CL, (R10)
+ INCQ AX
+ INCQ R10
+ DECQ R13
+ JNZ copy_slow_3
+
+handle_loop:
+ MOVQ ctx+16(FP), AX
+ DECQ 96(AX)
+ JNS sequenceDecs_decodeSync_amd64_main_loop
+
+loop_finished:
+ MOVQ br+8(FP), AX
+ MOVQ DX, 24(AX)
+ MOVB BL, 32(AX)
+ MOVQ SI, 8(AX)
+
+ // Update the context
+ MOVQ ctx+16(FP), AX
+ MOVQ R12, 136(AX)
+ MOVQ 144(AX), CX
+ SUBQ CX, R11
+ MOVQ R11, 168(AX)
+
+ // Return success
+ MOVQ $0x00000000, ret+24(FP)
+ RET
+
+ // Return with match length error
+sequenceDecs_decodeSync_amd64_error_match_len_ofs_mismatch:
+ MOVQ 16(SP), AX
+ MOVQ ctx+16(FP), CX
+ MOVQ AX, 216(CX)
+ MOVQ $0x00000001, ret+24(FP)
+ RET
+
+ // Return with match too long error
+sequenceDecs_decodeSync_amd64_error_match_len_too_big:
+ MOVQ ctx+16(FP), AX
+ MOVQ 16(SP), CX
+ MOVQ CX, 216(AX)
+ MOVQ $0x00000002, ret+24(FP)
+ RET
+
+ // Return with match offset too long error
+error_match_off_too_big:
+ MOVQ ctx+16(FP), AX
+ MOVQ 8(SP), CX
+ MOVQ CX, 224(AX)
+ MOVQ R12, 136(AX)
+ MOVQ $0x00000003, ret+24(FP)
+ RET
+
+ // Return with not enough literals error
+error_not_enough_literals:
+ MOVQ ctx+16(FP), AX
+ MOVQ 24(SP), CX
+ MOVQ CX, 208(AX)
+ MOVQ $0x00000004, ret+24(FP)
+ RET
+
+ // Return with overread error
+error_overread:
+ MOVQ $0x00000006, ret+24(FP)
+ RET
+
+ // Return with not enough output space error
+error_not_enough_space:
+ MOVQ ctx+16(FP), AX
+ MOVQ 24(SP), CX
+ MOVQ CX, 208(AX)
+ MOVQ 16(SP), CX
+ MOVQ CX, 216(AX)
+ MOVQ R12, 136(AX)
+ MOVQ $0x00000005, ret+24(FP)
+ RET
+
+// func sequenceDecs_decodeSync_bmi2(s *sequenceDecs, br *bitReader, ctx *decodeSyncAsmContext) int
+// Requires: BMI, BMI2, CMOV, SSE
+TEXT ·sequenceDecs_decodeSync_bmi2(SB), $64-32
+ MOVQ br+8(FP), BX
+ MOVQ 24(BX), AX
+ MOVBQZX 32(BX), DX
+ MOVQ (BX), CX
+ MOVQ 8(BX), BX
+ ADDQ BX, CX
+ MOVQ CX, (SP)
+ MOVQ ctx+16(FP), CX
+ MOVQ 72(CX), SI
+ MOVQ 80(CX), DI
+ MOVQ 88(CX), R8
+ XORQ R9, R9
+ MOVQ R9, 8(SP)
+ MOVQ R9, 16(SP)
+ MOVQ R9, 24(SP)
+ MOVQ 112(CX), R9
+ MOVQ 128(CX), R10
+ MOVQ R10, 32(SP)
+ MOVQ 144(CX), R10
+ MOVQ 136(CX), R11
+ MOVQ 200(CX), R12
+ MOVQ R12, 56(SP)
+ MOVQ 176(CX), R12
+ MOVQ R12, 48(SP)
+ MOVQ 184(CX), CX
+ MOVQ CX, 40(SP)
+ MOVQ 40(SP), CX
+ ADDQ CX, 48(SP)
+
+ // Calculate pointer to s.out[cap(s.out)] (a past-end pointer)
+ ADDQ R9, 32(SP)
+
+ // outBase += outPosition
+ ADDQ R11, R9
+
+sequenceDecs_decodeSync_bmi2_main_loop:
+ MOVQ (SP), R12
+
+ // Fill bitreader to have enough for the offset and match length.
+ CMPQ BX, $0x08
+ JL sequenceDecs_decodeSync_bmi2_fill_byte_by_byte
+ MOVQ DX, CX
+ SHRQ $0x03, CX
+ SUBQ CX, R12
+ MOVQ (R12), AX
+ SUBQ CX, BX
+ ANDQ $0x07, DX
+ JMP sequenceDecs_decodeSync_bmi2_fill_end
+
+sequenceDecs_decodeSync_bmi2_fill_byte_by_byte:
+ CMPQ BX, $0x00
+ JLE sequenceDecs_decodeSync_bmi2_fill_check_overread
+ CMPQ DX, $0x07
+ JLE sequenceDecs_decodeSync_bmi2_fill_end
+ SHLQ $0x08, AX
+ SUBQ $0x01, R12
+ SUBQ $0x01, BX
+ SUBQ $0x08, DX
+ MOVBQZX (R12), CX
+ ORQ CX, AX
+ JMP sequenceDecs_decodeSync_bmi2_fill_byte_by_byte
+
+sequenceDecs_decodeSync_bmi2_fill_check_overread:
+ CMPQ DX, $0x40
+ JA error_overread
+
+sequenceDecs_decodeSync_bmi2_fill_end:
+ // Update offset
+ MOVQ $0x00000808, CX
+ BEXTRQ CX, R8, R13
+ MOVQ AX, R14
+ LEAQ (DX)(R13*1), CX
+ ROLQ CL, R14
+ BZHIQ R13, R14, R14
+ MOVQ CX, DX
+ MOVQ R8, CX
+ SHRQ $0x20, CX
+ ADDQ R14, CX
+ MOVQ CX, 8(SP)
+
+ // Update match length
+ MOVQ $0x00000808, CX
+ BEXTRQ CX, DI, R13
+ MOVQ AX, R14
+ LEAQ (DX)(R13*1), CX
+ ROLQ CL, R14
+ BZHIQ R13, R14, R14
+ MOVQ CX, DX
+ MOVQ DI, CX
+ SHRQ $0x20, CX
+ ADDQ R14, CX
+ MOVQ CX, 16(SP)
+
+ // Fill bitreader to have enough for the remaining
+ CMPQ BX, $0x08
+ JL sequenceDecs_decodeSync_bmi2_fill_2_byte_by_byte
+ MOVQ DX, CX
+ SHRQ $0x03, CX
+ SUBQ CX, R12
+ MOVQ (R12), AX
+ SUBQ CX, BX
+ ANDQ $0x07, DX
+ JMP sequenceDecs_decodeSync_bmi2_fill_2_end
+
+sequenceDecs_decodeSync_bmi2_fill_2_byte_by_byte:
+ CMPQ BX, $0x00
+ JLE sequenceDecs_decodeSync_bmi2_fill_2_check_overread
+ CMPQ DX, $0x07
+ JLE sequenceDecs_decodeSync_bmi2_fill_2_end
+ SHLQ $0x08, AX
+ SUBQ $0x01, R12
+ SUBQ $0x01, BX
+ SUBQ $0x08, DX
+ MOVBQZX (R12), CX
+ ORQ CX, AX
+ JMP sequenceDecs_decodeSync_bmi2_fill_2_byte_by_byte
+
+sequenceDecs_decodeSync_bmi2_fill_2_check_overread:
+ CMPQ DX, $0x40
+ JA error_overread
+
+sequenceDecs_decodeSync_bmi2_fill_2_end:
+ // Update literal length
+ MOVQ $0x00000808, CX
+ BEXTRQ CX, SI, R13
+ MOVQ AX, R14
+ LEAQ (DX)(R13*1), CX
+ ROLQ CL, R14
+ BZHIQ R13, R14, R14
+ MOVQ CX, DX
+ MOVQ SI, CX
+ SHRQ $0x20, CX
+ ADDQ R14, CX
+ MOVQ CX, 24(SP)
+
+ // Fill bitreader for state updates
+ MOVQ R12, (SP)
+ MOVQ $0x00000808, CX
+ BEXTRQ CX, R8, R12
+ MOVQ ctx+16(FP), CX
+ CMPQ 96(CX), $0x00
+ JZ sequenceDecs_decodeSync_bmi2_skip_update
+ LEAQ (SI)(DI*1), R13
+ ADDQ R8, R13
+ MOVBQZX R13, R13
+ LEAQ (DX)(R13*1), CX
+ MOVQ AX, R14
+ MOVQ CX, DX
+ ROLQ CL, R14
+ BZHIQ R13, R14, R14
+
+ // Update Offset State
+ BZHIQ R8, R14, CX
+ SHRXQ R8, R14, R14
+ SHRL $0x10, R8
+ ADDQ CX, R8
+
+ // Load ctx.ofTable
+ MOVQ ctx+16(FP), CX
+ MOVQ 48(CX), CX
+ MOVQ (CX)(R8*8), R8
+
+ // Update Match Length State
+ BZHIQ DI, R14, CX
+ SHRXQ DI, R14, R14
+ SHRL $0x10, DI
+ ADDQ CX, DI
+
+ // Load ctx.mlTable
+ MOVQ ctx+16(FP), CX
+ MOVQ 24(CX), CX
+ MOVQ (CX)(DI*8), DI
+
+ // Update Literal Length State
+ BZHIQ SI, R14, CX
+ SHRL $0x10, SI
+ ADDQ CX, SI
+
+ // Load ctx.llTable
+ MOVQ ctx+16(FP), CX
+ MOVQ (CX), CX
+ MOVQ (CX)(SI*8), SI
+
+sequenceDecs_decodeSync_bmi2_skip_update:
+ // Adjust offset
+ MOVQ s+0(FP), CX
+ MOVQ 8(SP), R13
+ CMPQ R12, $0x01
+ JBE sequenceDecs_decodeSync_bmi2_adjust_offsetB_1_or_0
+ MOVUPS 144(CX), X0
+ MOVQ R13, 144(CX)
+ MOVUPS X0, 152(CX)
+ JMP sequenceDecs_decodeSync_bmi2_after_adjust
+
+sequenceDecs_decodeSync_bmi2_adjust_offsetB_1_or_0:
+ CMPQ 24(SP), $0x00000000
+ JNE sequenceDecs_decodeSync_bmi2_adjust_offset_maybezero
+ INCQ R13
+ JMP sequenceDecs_decodeSync_bmi2_adjust_offset_nonzero
+
+sequenceDecs_decodeSync_bmi2_adjust_offset_maybezero:
+ TESTQ R13, R13
+ JNZ sequenceDecs_decodeSync_bmi2_adjust_offset_nonzero
+ MOVQ 144(CX), R13
+ JMP sequenceDecs_decodeSync_bmi2_after_adjust
+
+sequenceDecs_decodeSync_bmi2_adjust_offset_nonzero:
+ MOVQ R13, R12
+ XORQ R14, R14
+ MOVQ $-1, R15
+ CMPQ R13, $0x03
+ CMOVQEQ R14, R12
+ CMOVQEQ R15, R14
+ ADDQ 144(CX)(R12*8), R14
+ JNZ sequenceDecs_decodeSync_bmi2_adjust_temp_valid
+ MOVQ $0x00000001, R14
+
+sequenceDecs_decodeSync_bmi2_adjust_temp_valid:
+ CMPQ R13, $0x01
+ JZ sequenceDecs_decodeSync_bmi2_adjust_skip
+ MOVQ 152(CX), R12
+ MOVQ R12, 160(CX)
+
+sequenceDecs_decodeSync_bmi2_adjust_skip:
+ MOVQ 144(CX), R12
+ MOVQ R12, 152(CX)
+ MOVQ R14, 144(CX)
+ MOVQ R14, R13
+
+sequenceDecs_decodeSync_bmi2_after_adjust:
+ MOVQ R13, 8(SP)
+
+ // Check values
+ MOVQ 16(SP), CX
+ MOVQ 24(SP), R12
+ LEAQ (CX)(R12*1), R14
+ MOVQ s+0(FP), R15
+ ADDQ R14, 256(R15)
+ MOVQ ctx+16(FP), R14
+ SUBQ R12, 104(R14)
+ JS error_not_enough_literals
+ CMPQ CX, $0x00020002
+ JA sequenceDecs_decodeSync_bmi2_error_match_len_too_big
+ TESTQ R13, R13
+ JNZ sequenceDecs_decodeSync_bmi2_match_len_ofs_ok
+ TESTQ CX, CX
+ JNZ sequenceDecs_decodeSync_bmi2_error_match_len_ofs_mismatch
+
+sequenceDecs_decodeSync_bmi2_match_len_ofs_ok:
+ MOVQ 24(SP), CX
+ MOVQ 8(SP), R12
+ MOVQ 16(SP), R13
+
+ // Check if we have enough space in s.out
+ LEAQ (CX)(R13*1), R14
+ ADDQ R9, R14
+ CMPQ R14, 32(SP)
+ JA error_not_enough_space
+
+ // Copy literals
+ TESTQ CX, CX
+ JZ check_offset
+ XORQ R14, R14
+
+copy_1:
+ MOVUPS (R10)(R14*1), X0
+ MOVUPS X0, (R9)(R14*1)
+ ADDQ $0x10, R14
+ CMPQ R14, CX
+ JB copy_1
+ ADDQ CX, R10
+ ADDQ CX, R9
+ ADDQ CX, R11
+
+ // Malformed input if seq.mo > t+len(hist) || seq.mo > s.windowSize)
+check_offset:
+ MOVQ R11, CX
+ ADDQ 40(SP), CX
+ CMPQ R12, CX
+ JG error_match_off_too_big
+ CMPQ R12, 56(SP)
+ JG error_match_off_too_big
+
+ // Copy match from history
+ MOVQ R12, CX
+ SUBQ R11, CX
+ JLS copy_match
+ MOVQ 48(SP), R14
+ SUBQ CX, R14
+ CMPQ R13, CX
+ JG copy_all_from_history
+ MOVQ R13, CX
+ SUBQ $0x10, CX
+ JB copy_4_small
+
+copy_4_loop:
+ MOVUPS (R14), X0
+ MOVUPS X0, (R9)
+ ADDQ $0x10, R14
+ ADDQ $0x10, R9
+ SUBQ $0x10, CX
+ JAE copy_4_loop
+ LEAQ 16(R14)(CX*1), R14
+ LEAQ 16(R9)(CX*1), R9
+ MOVUPS -16(R14), X0
+ MOVUPS X0, -16(R9)
+ JMP copy_4_end
+
+copy_4_small:
+ CMPQ R13, $0x03
+ JE copy_4_move_3
+ CMPQ R13, $0x08
+ JB copy_4_move_4through7
+ JMP copy_4_move_8through16
+
+copy_4_move_3:
+ MOVW (R14), CX
+ MOVB 2(R14), R12
+ MOVW CX, (R9)
+ MOVB R12, 2(R9)
+ ADDQ R13, R14
+ ADDQ R13, R9
+ JMP copy_4_end
+
+copy_4_move_4through7:
+ MOVL (R14), CX
+ MOVL -4(R14)(R13*1), R12
+ MOVL CX, (R9)
+ MOVL R12, -4(R9)(R13*1)
+ ADDQ R13, R14
+ ADDQ R13, R9
+ JMP copy_4_end
+
+copy_4_move_8through16:
+ MOVQ (R14), CX
+ MOVQ -8(R14)(R13*1), R12
+ MOVQ CX, (R9)
+ MOVQ R12, -8(R9)(R13*1)
+ ADDQ R13, R14
+ ADDQ R13, R9
+
+copy_4_end:
+ ADDQ R13, R11
+ JMP handle_loop
+ JMP loop_finished
+
+copy_all_from_history:
+ MOVQ CX, R15
+ SUBQ $0x10, R15
+ JB copy_5_small
+
+copy_5_loop:
+ MOVUPS (R14), X0
+ MOVUPS X0, (R9)
+ ADDQ $0x10, R14
+ ADDQ $0x10, R9
+ SUBQ $0x10, R15
+ JAE copy_5_loop
+ LEAQ 16(R14)(R15*1), R14
+ LEAQ 16(R9)(R15*1), R9
+ MOVUPS -16(R14), X0
+ MOVUPS X0, -16(R9)
+ JMP copy_5_end
+
+copy_5_small:
+ CMPQ CX, $0x03
+ JE copy_5_move_3
+ JB copy_5_move_1or2
+ CMPQ CX, $0x08
+ JB copy_5_move_4through7
+ JMP copy_5_move_8through16
+
+copy_5_move_1or2:
+ MOVB (R14), R15
+ MOVB -1(R14)(CX*1), BP
+ MOVB R15, (R9)
+ MOVB BP, -1(R9)(CX*1)
+ ADDQ CX, R14
+ ADDQ CX, R9
+ JMP copy_5_end
+
+copy_5_move_3:
+ MOVW (R14), R15
+ MOVB 2(R14), BP
+ MOVW R15, (R9)
+ MOVB BP, 2(R9)
+ ADDQ CX, R14
+ ADDQ CX, R9
+ JMP copy_5_end
+
+copy_5_move_4through7:
+ MOVL (R14), R15
+ MOVL -4(R14)(CX*1), BP
+ MOVL R15, (R9)
+ MOVL BP, -4(R9)(CX*1)
+ ADDQ CX, R14
+ ADDQ CX, R9
+ JMP copy_5_end
+
+copy_5_move_8through16:
+ MOVQ (R14), R15
+ MOVQ -8(R14)(CX*1), BP
+ MOVQ R15, (R9)
+ MOVQ BP, -8(R9)(CX*1)
+ ADDQ CX, R14
+ ADDQ CX, R9
+
+copy_5_end:
+ ADDQ CX, R11
+ SUBQ CX, R13
+
+ // Copy match from the current buffer
+copy_match:
+ MOVQ R9, CX
+ SUBQ R12, CX
+
+ // ml <= mo
+ CMPQ R13, R12
+ JA copy_overlapping_match
+
+ // Copy non-overlapping match
+ ADDQ R13, R11
+ MOVQ R9, R12
+ ADDQ R13, R9
+
+copy_2:
+ MOVUPS (CX), X0
+ MOVUPS X0, (R12)
+ ADDQ $0x10, CX
+ ADDQ $0x10, R12
+ SUBQ $0x10, R13
+ JHI copy_2
+ JMP handle_loop
+
+ // Copy overlapping match
+copy_overlapping_match:
+ ADDQ R13, R11
+
+copy_slow_3:
+ MOVB (CX), R12
+ MOVB R12, (R9)
+ INCQ CX
+ INCQ R9
+ DECQ R13
+ JNZ copy_slow_3
+
+handle_loop:
+ MOVQ ctx+16(FP), CX
+ DECQ 96(CX)
+ JNS sequenceDecs_decodeSync_bmi2_main_loop
+
+loop_finished:
+ MOVQ br+8(FP), CX
+ MOVQ AX, 24(CX)
+ MOVB DL, 32(CX)
+ MOVQ BX, 8(CX)
+
+ // Update the context
+ MOVQ ctx+16(FP), AX
+ MOVQ R11, 136(AX)
+ MOVQ 144(AX), CX
+ SUBQ CX, R10
+ MOVQ R10, 168(AX)
+
+ // Return success
+ MOVQ $0x00000000, ret+24(FP)
+ RET
+
+ // Return with match length error
+sequenceDecs_decodeSync_bmi2_error_match_len_ofs_mismatch:
+ MOVQ 16(SP), AX
+ MOVQ ctx+16(FP), CX
+ MOVQ AX, 216(CX)
+ MOVQ $0x00000001, ret+24(FP)
+ RET
+
+ // Return with match too long error
+sequenceDecs_decodeSync_bmi2_error_match_len_too_big:
+ MOVQ ctx+16(FP), AX
+ MOVQ 16(SP), CX
+ MOVQ CX, 216(AX)
+ MOVQ $0x00000002, ret+24(FP)
+ RET
+
+ // Return with match offset too long error
+error_match_off_too_big:
+ MOVQ ctx+16(FP), AX
+ MOVQ 8(SP), CX
+ MOVQ CX, 224(AX)
+ MOVQ R11, 136(AX)
+ MOVQ $0x00000003, ret+24(FP)
+ RET
+
+ // Return with not enough literals error
+error_not_enough_literals:
+ MOVQ ctx+16(FP), AX
+ MOVQ 24(SP), CX
+ MOVQ CX, 208(AX)
+ MOVQ $0x00000004, ret+24(FP)
+ RET
+
+ // Return with overread error
+error_overread:
+ MOVQ $0x00000006, ret+24(FP)
+ RET
+
+ // Return with not enough output space error
+error_not_enough_space:
+ MOVQ ctx+16(FP), AX
+ MOVQ 24(SP), CX
+ MOVQ CX, 208(AX)
+ MOVQ 16(SP), CX
+ MOVQ CX, 216(AX)
+ MOVQ R11, 136(AX)
+ MOVQ $0x00000005, ret+24(FP)
+ RET
+
+// func sequenceDecs_decodeSync_safe_amd64(s *sequenceDecs, br *bitReader, ctx *decodeSyncAsmContext) int
+// Requires: CMOV, SSE
+TEXT ·sequenceDecs_decodeSync_safe_amd64(SB), $64-32
+ MOVQ br+8(FP), CX
+ MOVQ 24(CX), DX
+ MOVBQZX 32(CX), BX
+ MOVQ (CX), AX
+ MOVQ 8(CX), SI
+ ADDQ SI, AX
+ MOVQ AX, (SP)
+ MOVQ ctx+16(FP), AX
+ MOVQ 72(AX), DI
+ MOVQ 80(AX), R8
+ MOVQ 88(AX), R9
+ XORQ CX, CX
+ MOVQ CX, 8(SP)
+ MOVQ CX, 16(SP)
+ MOVQ CX, 24(SP)
+ MOVQ 112(AX), R10
+ MOVQ 128(AX), CX
+ MOVQ CX, 32(SP)
+ MOVQ 144(AX), R11
+ MOVQ 136(AX), R12
+ MOVQ 200(AX), CX
+ MOVQ CX, 56(SP)
+ MOVQ 176(AX), CX
+ MOVQ CX, 48(SP)
+ MOVQ 184(AX), AX
+ MOVQ AX, 40(SP)
+ MOVQ 40(SP), AX
+ ADDQ AX, 48(SP)
+
+ // Calculate pointer to s.out[cap(s.out)] (a past-end pointer)
+ ADDQ R10, 32(SP)
+
+ // outBase += outPosition
+ ADDQ R12, R10
+
+sequenceDecs_decodeSync_safe_amd64_main_loop:
+ MOVQ (SP), R13
+
+ // Fill bitreader to have enough for the offset and match length.
+ CMPQ SI, $0x08
+ JL sequenceDecs_decodeSync_safe_amd64_fill_byte_by_byte
+ MOVQ BX, AX
+ SHRQ $0x03, AX
+ SUBQ AX, R13
+ MOVQ (R13), DX
+ SUBQ AX, SI
+ ANDQ $0x07, BX
+ JMP sequenceDecs_decodeSync_safe_amd64_fill_end
+
+sequenceDecs_decodeSync_safe_amd64_fill_byte_by_byte:
+ CMPQ SI, $0x00
+ JLE sequenceDecs_decodeSync_safe_amd64_fill_check_overread
+ CMPQ BX, $0x07
+ JLE sequenceDecs_decodeSync_safe_amd64_fill_end
+ SHLQ $0x08, DX
+ SUBQ $0x01, R13
+ SUBQ $0x01, SI
+ SUBQ $0x08, BX
+ MOVBQZX (R13), AX
+ ORQ AX, DX
+ JMP sequenceDecs_decodeSync_safe_amd64_fill_byte_by_byte
+
+sequenceDecs_decodeSync_safe_amd64_fill_check_overread:
+ CMPQ BX, $0x40
+ JA error_overread
+
+sequenceDecs_decodeSync_safe_amd64_fill_end:
+ // Update offset
+ MOVQ R9, AX
+ MOVQ BX, CX
+ MOVQ DX, R14
+ SHLQ CL, R14
+ MOVB AH, CL
+ SHRQ $0x20, AX
+ TESTQ CX, CX
+ JZ sequenceDecs_decodeSync_safe_amd64_of_update_zero
+ ADDQ CX, BX
+ CMPQ BX, $0x40
+ JA sequenceDecs_decodeSync_safe_amd64_of_update_zero
+ CMPQ CX, $0x40
+ JAE sequenceDecs_decodeSync_safe_amd64_of_update_zero
+ NEGQ CX
+ SHRQ CL, R14
+ ADDQ R14, AX
+
+sequenceDecs_decodeSync_safe_amd64_of_update_zero:
+ MOVQ AX, 8(SP)
+
+ // Update match length
+ MOVQ R8, AX
+ MOVQ BX, CX
+ MOVQ DX, R14
+ SHLQ CL, R14
+ MOVB AH, CL
+ SHRQ $0x20, AX
+ TESTQ CX, CX
+ JZ sequenceDecs_decodeSync_safe_amd64_ml_update_zero
+ ADDQ CX, BX
+ CMPQ BX, $0x40
+ JA sequenceDecs_decodeSync_safe_amd64_ml_update_zero
+ CMPQ CX, $0x40
+ JAE sequenceDecs_decodeSync_safe_amd64_ml_update_zero
+ NEGQ CX
+ SHRQ CL, R14
+ ADDQ R14, AX
+
+sequenceDecs_decodeSync_safe_amd64_ml_update_zero:
+ MOVQ AX, 16(SP)
+
+ // Fill bitreader to have enough for the remaining
+ CMPQ SI, $0x08
+ JL sequenceDecs_decodeSync_safe_amd64_fill_2_byte_by_byte
+ MOVQ BX, AX
+ SHRQ $0x03, AX
+ SUBQ AX, R13
+ MOVQ (R13), DX
+ SUBQ AX, SI
+ ANDQ $0x07, BX
+ JMP sequenceDecs_decodeSync_safe_amd64_fill_2_end
+
+sequenceDecs_decodeSync_safe_amd64_fill_2_byte_by_byte:
+ CMPQ SI, $0x00
+ JLE sequenceDecs_decodeSync_safe_amd64_fill_2_check_overread
+ CMPQ BX, $0x07
+ JLE sequenceDecs_decodeSync_safe_amd64_fill_2_end
+ SHLQ $0x08, DX
+ SUBQ $0x01, R13
+ SUBQ $0x01, SI
+ SUBQ $0x08, BX
+ MOVBQZX (R13), AX
+ ORQ AX, DX
+ JMP sequenceDecs_decodeSync_safe_amd64_fill_2_byte_by_byte
+
+sequenceDecs_decodeSync_safe_amd64_fill_2_check_overread:
+ CMPQ BX, $0x40
+ JA error_overread
+
+sequenceDecs_decodeSync_safe_amd64_fill_2_end:
+ // Update literal length
+ MOVQ DI, AX
+ MOVQ BX, CX
+ MOVQ DX, R14
+ SHLQ CL, R14
+ MOVB AH, CL
+ SHRQ $0x20, AX
+ TESTQ CX, CX
+ JZ sequenceDecs_decodeSync_safe_amd64_ll_update_zero
+ ADDQ CX, BX
+ CMPQ BX, $0x40
+ JA sequenceDecs_decodeSync_safe_amd64_ll_update_zero
+ CMPQ CX, $0x40
+ JAE sequenceDecs_decodeSync_safe_amd64_ll_update_zero
+ NEGQ CX
+ SHRQ CL, R14
+ ADDQ R14, AX
+
+sequenceDecs_decodeSync_safe_amd64_ll_update_zero:
+ MOVQ AX, 24(SP)
+
+ // Fill bitreader for state updates
+ MOVQ R13, (SP)
+ MOVQ R9, AX
+ SHRQ $0x08, AX
+ MOVBQZX AL, AX
+ MOVQ ctx+16(FP), CX
+ CMPQ 96(CX), $0x00
+ JZ sequenceDecs_decodeSync_safe_amd64_skip_update
+
+ // Update Literal Length State
+ MOVBQZX DI, R13
+ SHRL $0x10, DI
+ LEAQ (BX)(R13*1), CX
+ MOVQ DX, R14
+ MOVQ CX, BX
+ ROLQ CL, R14
+ MOVL $0x00000001, R15
+ MOVB R13, CL
+ SHLL CL, R15
+ DECL R15
+ ANDQ R15, R14
+ ADDQ R14, DI
+
+ // Load ctx.llTable
+ MOVQ ctx+16(FP), CX
+ MOVQ (CX), CX
+ MOVQ (CX)(DI*8), DI
+
+ // Update Match Length State
+ MOVBQZX R8, R13
+ SHRL $0x10, R8
+ LEAQ (BX)(R13*1), CX
+ MOVQ DX, R14
+ MOVQ CX, BX
+ ROLQ CL, R14
+ MOVL $0x00000001, R15
+ MOVB R13, CL
+ SHLL CL, R15
+ DECL R15
+ ANDQ R15, R14
+ ADDQ R14, R8
+
+ // Load ctx.mlTable
+ MOVQ ctx+16(FP), CX
+ MOVQ 24(CX), CX
+ MOVQ (CX)(R8*8), R8
+
+ // Update Offset State
+ MOVBQZX R9, R13
+ SHRL $0x10, R9
+ LEAQ (BX)(R13*1), CX
+ MOVQ DX, R14
+ MOVQ CX, BX
+ ROLQ CL, R14
+ MOVL $0x00000001, R15
+ MOVB R13, CL
+ SHLL CL, R15
+ DECL R15
+ ANDQ R15, R14
+ ADDQ R14, R9
+
+ // Load ctx.ofTable
+ MOVQ ctx+16(FP), CX
+ MOVQ 48(CX), CX
+ MOVQ (CX)(R9*8), R9
+
+sequenceDecs_decodeSync_safe_amd64_skip_update:
+ // Adjust offset
+ MOVQ s+0(FP), CX
+ MOVQ 8(SP), R13
+ CMPQ AX, $0x01
+ JBE sequenceDecs_decodeSync_safe_amd64_adjust_offsetB_1_or_0
+ MOVUPS 144(CX), X0
+ MOVQ R13, 144(CX)
+ MOVUPS X0, 152(CX)
+ JMP sequenceDecs_decodeSync_safe_amd64_after_adjust
+
+sequenceDecs_decodeSync_safe_amd64_adjust_offsetB_1_or_0:
+ CMPQ 24(SP), $0x00000000
+ JNE sequenceDecs_decodeSync_safe_amd64_adjust_offset_maybezero
+ INCQ R13
+ JMP sequenceDecs_decodeSync_safe_amd64_adjust_offset_nonzero
+
+sequenceDecs_decodeSync_safe_amd64_adjust_offset_maybezero:
+ TESTQ R13, R13
+ JNZ sequenceDecs_decodeSync_safe_amd64_adjust_offset_nonzero
+ MOVQ 144(CX), R13
+ JMP sequenceDecs_decodeSync_safe_amd64_after_adjust
+
+sequenceDecs_decodeSync_safe_amd64_adjust_offset_nonzero:
+ MOVQ R13, AX
+ XORQ R14, R14
+ MOVQ $-1, R15
+ CMPQ R13, $0x03
+ CMOVQEQ R14, AX
+ CMOVQEQ R15, R14
+ ADDQ 144(CX)(AX*8), R14
+ JNZ sequenceDecs_decodeSync_safe_amd64_adjust_temp_valid
+ MOVQ $0x00000001, R14
+
+sequenceDecs_decodeSync_safe_amd64_adjust_temp_valid:
+ CMPQ R13, $0x01
+ JZ sequenceDecs_decodeSync_safe_amd64_adjust_skip
+ MOVQ 152(CX), AX
+ MOVQ AX, 160(CX)
+
+sequenceDecs_decodeSync_safe_amd64_adjust_skip:
+ MOVQ 144(CX), AX
+ MOVQ AX, 152(CX)
+ MOVQ R14, 144(CX)
+ MOVQ R14, R13
+
+sequenceDecs_decodeSync_safe_amd64_after_adjust:
+ MOVQ R13, 8(SP)
+
+ // Check values
+ MOVQ 16(SP), AX
+ MOVQ 24(SP), CX
+ LEAQ (AX)(CX*1), R14
+ MOVQ s+0(FP), R15
+ ADDQ R14, 256(R15)
+ MOVQ ctx+16(FP), R14
+ SUBQ CX, 104(R14)
+ JS error_not_enough_literals
+ CMPQ AX, $0x00020002
+ JA sequenceDecs_decodeSync_safe_amd64_error_match_len_too_big
+ TESTQ R13, R13
+ JNZ sequenceDecs_decodeSync_safe_amd64_match_len_ofs_ok
+ TESTQ AX, AX
+ JNZ sequenceDecs_decodeSync_safe_amd64_error_match_len_ofs_mismatch
+
+sequenceDecs_decodeSync_safe_amd64_match_len_ofs_ok:
+ MOVQ 24(SP), AX
+ MOVQ 8(SP), CX
+ MOVQ 16(SP), R13
+
+ // Check if we have enough space in s.out
+ LEAQ (AX)(R13*1), R14
+ ADDQ R10, R14
+ CMPQ R14, 32(SP)
+ JA error_not_enough_space
+
+ // Copy literals
+ TESTQ AX, AX
+ JZ check_offset
+ MOVQ AX, R14
+ SUBQ $0x10, R14
+ JB copy_1_small
+
+copy_1_loop:
+ MOVUPS (R11), X0
+ MOVUPS X0, (R10)
+ ADDQ $0x10, R11
+ ADDQ $0x10, R10
+ SUBQ $0x10, R14
+ JAE copy_1_loop
+ LEAQ 16(R11)(R14*1), R11
+ LEAQ 16(R10)(R14*1), R10
+ MOVUPS -16(R11), X0
+ MOVUPS X0, -16(R10)
+ JMP copy_1_end
+
+copy_1_small:
+ CMPQ AX, $0x03
+ JE copy_1_move_3
+ JB copy_1_move_1or2
+ CMPQ AX, $0x08
+ JB copy_1_move_4through7
+ JMP copy_1_move_8through16
+
+copy_1_move_1or2:
+ MOVB (R11), R14
+ MOVB -1(R11)(AX*1), R15
+ MOVB R14, (R10)
+ MOVB R15, -1(R10)(AX*1)
+ ADDQ AX, R11
+ ADDQ AX, R10
+ JMP copy_1_end
+
+copy_1_move_3:
+ MOVW (R11), R14
+ MOVB 2(R11), R15
+ MOVW R14, (R10)
+ MOVB R15, 2(R10)
+ ADDQ AX, R11
+ ADDQ AX, R10
+ JMP copy_1_end
+
+copy_1_move_4through7:
+ MOVL (R11), R14
+ MOVL -4(R11)(AX*1), R15
+ MOVL R14, (R10)
+ MOVL R15, -4(R10)(AX*1)
+ ADDQ AX, R11
+ ADDQ AX, R10
+ JMP copy_1_end
+
+copy_1_move_8through16:
+ MOVQ (R11), R14
+ MOVQ -8(R11)(AX*1), R15
+ MOVQ R14, (R10)
+ MOVQ R15, -8(R10)(AX*1)
+ ADDQ AX, R11
+ ADDQ AX, R10
+
+copy_1_end:
+ ADDQ AX, R12
+
+ // Malformed input if seq.mo > t+len(hist) || seq.mo > s.windowSize)
+check_offset:
+ MOVQ R12, AX
+ ADDQ 40(SP), AX
+ CMPQ CX, AX
+ JG error_match_off_too_big
+ CMPQ CX, 56(SP)
+ JG error_match_off_too_big
+
+ // Copy match from history
+ MOVQ CX, AX
+ SUBQ R12, AX
+ JLS copy_match
+ MOVQ 48(SP), R14
+ SUBQ AX, R14
+ CMPQ R13, AX
+ JG copy_all_from_history
+ MOVQ R13, AX
+ SUBQ $0x10, AX
+ JB copy_4_small
+
+copy_4_loop:
+ MOVUPS (R14), X0
+ MOVUPS X0, (R10)
+ ADDQ $0x10, R14
+ ADDQ $0x10, R10
+ SUBQ $0x10, AX
+ JAE copy_4_loop
+ LEAQ 16(R14)(AX*1), R14
+ LEAQ 16(R10)(AX*1), R10
+ MOVUPS -16(R14), X0
+ MOVUPS X0, -16(R10)
+ JMP copy_4_end
+
+copy_4_small:
+ CMPQ R13, $0x03
+ JE copy_4_move_3
+ CMPQ R13, $0x08
+ JB copy_4_move_4through7
+ JMP copy_4_move_8through16
+
+copy_4_move_3:
+ MOVW (R14), AX
+ MOVB 2(R14), CL
+ MOVW AX, (R10)
+ MOVB CL, 2(R10)
+ ADDQ R13, R14
+ ADDQ R13, R10
+ JMP copy_4_end
+
+copy_4_move_4through7:
+ MOVL (R14), AX
+ MOVL -4(R14)(R13*1), CX
+ MOVL AX, (R10)
+ MOVL CX, -4(R10)(R13*1)
+ ADDQ R13, R14
+ ADDQ R13, R10
+ JMP copy_4_end
+
+copy_4_move_8through16:
+ MOVQ (R14), AX
+ MOVQ -8(R14)(R13*1), CX
+ MOVQ AX, (R10)
+ MOVQ CX, -8(R10)(R13*1)
+ ADDQ R13, R14
+ ADDQ R13, R10
+
+copy_4_end:
+ ADDQ R13, R12
+ JMP handle_loop
+ JMP loop_finished
+
+copy_all_from_history:
+ MOVQ AX, R15
+ SUBQ $0x10, R15
+ JB copy_5_small
+
+copy_5_loop:
+ MOVUPS (R14), X0
+ MOVUPS X0, (R10)
+ ADDQ $0x10, R14
+ ADDQ $0x10, R10
+ SUBQ $0x10, R15
+ JAE copy_5_loop
+ LEAQ 16(R14)(R15*1), R14
+ LEAQ 16(R10)(R15*1), R10
+ MOVUPS -16(R14), X0
+ MOVUPS X0, -16(R10)
+ JMP copy_5_end
+
+copy_5_small:
+ CMPQ AX, $0x03
+ JE copy_5_move_3
+ JB copy_5_move_1or2
+ CMPQ AX, $0x08
+ JB copy_5_move_4through7
+ JMP copy_5_move_8through16
+
+copy_5_move_1or2:
+ MOVB (R14), R15
+ MOVB -1(R14)(AX*1), BP
+ MOVB R15, (R10)
+ MOVB BP, -1(R10)(AX*1)
+ ADDQ AX, R14
+ ADDQ AX, R10
+ JMP copy_5_end
+
+copy_5_move_3:
+ MOVW (R14), R15
+ MOVB 2(R14), BP
+ MOVW R15, (R10)
+ MOVB BP, 2(R10)
+ ADDQ AX, R14
+ ADDQ AX, R10
+ JMP copy_5_end
+
+copy_5_move_4through7:
+ MOVL (R14), R15
+ MOVL -4(R14)(AX*1), BP
+ MOVL R15, (R10)
+ MOVL BP, -4(R10)(AX*1)
+ ADDQ AX, R14
+ ADDQ AX, R10
+ JMP copy_5_end
+
+copy_5_move_8through16:
+ MOVQ (R14), R15
+ MOVQ -8(R14)(AX*1), BP
+ MOVQ R15, (R10)
+ MOVQ BP, -8(R10)(AX*1)
+ ADDQ AX, R14
+ ADDQ AX, R10
+
+copy_5_end:
+ ADDQ AX, R12
+ SUBQ AX, R13
+
+ // Copy match from the current buffer
+copy_match:
+ MOVQ R10, AX
+ SUBQ CX, AX
+
+ // ml <= mo
+ CMPQ R13, CX
+ JA copy_overlapping_match
+
+ // Copy non-overlapping match
+ ADDQ R13, R12
+ MOVQ R13, CX
+ SUBQ $0x10, CX
+ JB copy_2_small
+
+copy_2_loop:
+ MOVUPS (AX), X0
+ MOVUPS X0, (R10)
+ ADDQ $0x10, AX
+ ADDQ $0x10, R10
+ SUBQ $0x10, CX
+ JAE copy_2_loop
+ LEAQ 16(AX)(CX*1), AX
+ LEAQ 16(R10)(CX*1), R10
+ MOVUPS -16(AX), X0
+ MOVUPS X0, -16(R10)
+ JMP copy_2_end
+
+copy_2_small:
+ CMPQ R13, $0x03
+ JE copy_2_move_3
+ JB copy_2_move_1or2
+ CMPQ R13, $0x08
+ JB copy_2_move_4through7
+ JMP copy_2_move_8through16
+
+copy_2_move_1or2:
+ MOVB (AX), CL
+ MOVB -1(AX)(R13*1), R14
+ MOVB CL, (R10)
+ MOVB R14, -1(R10)(R13*1)
+ ADDQ R13, AX
+ ADDQ R13, R10
+ JMP copy_2_end
+
+copy_2_move_3:
+ MOVW (AX), CX
+ MOVB 2(AX), R14
+ MOVW CX, (R10)
+ MOVB R14, 2(R10)
+ ADDQ R13, AX
+ ADDQ R13, R10
+ JMP copy_2_end
+
+copy_2_move_4through7:
+ MOVL (AX), CX
+ MOVL -4(AX)(R13*1), R14
+ MOVL CX, (R10)
+ MOVL R14, -4(R10)(R13*1)
+ ADDQ R13, AX
+ ADDQ R13, R10
+ JMP copy_2_end
+
+copy_2_move_8through16:
+ MOVQ (AX), CX
+ MOVQ -8(AX)(R13*1), R14
+ MOVQ CX, (R10)
+ MOVQ R14, -8(R10)(R13*1)
+ ADDQ R13, AX
+ ADDQ R13, R10
+
+copy_2_end:
+ JMP handle_loop
+
+ // Copy overlapping match
+copy_overlapping_match:
+ ADDQ R13, R12
+
+copy_slow_3:
+ MOVB (AX), CL
+ MOVB CL, (R10)
+ INCQ AX
+ INCQ R10
+ DECQ R13
+ JNZ copy_slow_3
+
+handle_loop:
+ MOVQ ctx+16(FP), AX
+ DECQ 96(AX)
+ JNS sequenceDecs_decodeSync_safe_amd64_main_loop
+
+loop_finished:
+ MOVQ br+8(FP), AX
+ MOVQ DX, 24(AX)
+ MOVB BL, 32(AX)
+ MOVQ SI, 8(AX)
+
+ // Update the context
+ MOVQ ctx+16(FP), AX
+ MOVQ R12, 136(AX)
+ MOVQ 144(AX), CX
+ SUBQ CX, R11
+ MOVQ R11, 168(AX)
+
+ // Return success
+ MOVQ $0x00000000, ret+24(FP)
+ RET
+
+ // Return with match length error
+sequenceDecs_decodeSync_safe_amd64_error_match_len_ofs_mismatch:
+ MOVQ 16(SP), AX
+ MOVQ ctx+16(FP), CX
+ MOVQ AX, 216(CX)
+ MOVQ $0x00000001, ret+24(FP)
+ RET
+
+ // Return with match too long error
+sequenceDecs_decodeSync_safe_amd64_error_match_len_too_big:
+ MOVQ ctx+16(FP), AX
+ MOVQ 16(SP), CX
+ MOVQ CX, 216(AX)
+ MOVQ $0x00000002, ret+24(FP)
+ RET
+
+ // Return with match offset too long error
+error_match_off_too_big:
+ MOVQ ctx+16(FP), AX
+ MOVQ 8(SP), CX
+ MOVQ CX, 224(AX)
+ MOVQ R12, 136(AX)
+ MOVQ $0x00000003, ret+24(FP)
+ RET
+
+ // Return with not enough literals error
+error_not_enough_literals:
+ MOVQ ctx+16(FP), AX
+ MOVQ 24(SP), CX
+ MOVQ CX, 208(AX)
+ MOVQ $0x00000004, ret+24(FP)
+ RET
+
+ // Return with overread error
+error_overread:
+ MOVQ $0x00000006, ret+24(FP)
+ RET
+
+ // Return with not enough output space error
+error_not_enough_space:
+ MOVQ ctx+16(FP), AX
+ MOVQ 24(SP), CX
+ MOVQ CX, 208(AX)
+ MOVQ 16(SP), CX
+ MOVQ CX, 216(AX)
+ MOVQ R12, 136(AX)
+ MOVQ $0x00000005, ret+24(FP)
+ RET
+
+// func sequenceDecs_decodeSync_safe_bmi2(s *sequenceDecs, br *bitReader, ctx *decodeSyncAsmContext) int
+// Requires: BMI, BMI2, CMOV, SSE
+TEXT ·sequenceDecs_decodeSync_safe_bmi2(SB), $64-32
+ MOVQ br+8(FP), BX
+ MOVQ 24(BX), AX
+ MOVBQZX 32(BX), DX
+ MOVQ (BX), CX
+ MOVQ 8(BX), BX
+ ADDQ BX, CX
+ MOVQ CX, (SP)
+ MOVQ ctx+16(FP), CX
+ MOVQ 72(CX), SI
+ MOVQ 80(CX), DI
+ MOVQ 88(CX), R8
+ XORQ R9, R9
+ MOVQ R9, 8(SP)
+ MOVQ R9, 16(SP)
+ MOVQ R9, 24(SP)
+ MOVQ 112(CX), R9
+ MOVQ 128(CX), R10
+ MOVQ R10, 32(SP)
+ MOVQ 144(CX), R10
+ MOVQ 136(CX), R11
+ MOVQ 200(CX), R12
+ MOVQ R12, 56(SP)
+ MOVQ 176(CX), R12
+ MOVQ R12, 48(SP)
+ MOVQ 184(CX), CX
+ MOVQ CX, 40(SP)
+ MOVQ 40(SP), CX
+ ADDQ CX, 48(SP)
+
+ // Calculate pointer to s.out[cap(s.out)] (a past-end pointer)
+ ADDQ R9, 32(SP)
+
+ // outBase += outPosition
+ ADDQ R11, R9
+
+sequenceDecs_decodeSync_safe_bmi2_main_loop:
+ MOVQ (SP), R12
+
+ // Fill bitreader to have enough for the offset and match length.
+ CMPQ BX, $0x08
+ JL sequenceDecs_decodeSync_safe_bmi2_fill_byte_by_byte
+ MOVQ DX, CX
+ SHRQ $0x03, CX
+ SUBQ CX, R12
+ MOVQ (R12), AX
+ SUBQ CX, BX
+ ANDQ $0x07, DX
+ JMP sequenceDecs_decodeSync_safe_bmi2_fill_end
+
+sequenceDecs_decodeSync_safe_bmi2_fill_byte_by_byte:
+ CMPQ BX, $0x00
+ JLE sequenceDecs_decodeSync_safe_bmi2_fill_check_overread
+ CMPQ DX, $0x07
+ JLE sequenceDecs_decodeSync_safe_bmi2_fill_end
+ SHLQ $0x08, AX
+ SUBQ $0x01, R12
+ SUBQ $0x01, BX
+ SUBQ $0x08, DX
+ MOVBQZX (R12), CX
+ ORQ CX, AX
+ JMP sequenceDecs_decodeSync_safe_bmi2_fill_byte_by_byte
+
+sequenceDecs_decodeSync_safe_bmi2_fill_check_overread:
+ CMPQ DX, $0x40
+ JA error_overread
+
+sequenceDecs_decodeSync_safe_bmi2_fill_end:
+ // Update offset
+ MOVQ $0x00000808, CX
+ BEXTRQ CX, R8, R13
+ MOVQ AX, R14
+ LEAQ (DX)(R13*1), CX
+ ROLQ CL, R14
+ BZHIQ R13, R14, R14
+ MOVQ CX, DX
+ MOVQ R8, CX
+ SHRQ $0x20, CX
+ ADDQ R14, CX
+ MOVQ CX, 8(SP)
+
+ // Update match length
+ MOVQ $0x00000808, CX
+ BEXTRQ CX, DI, R13
+ MOVQ AX, R14
+ LEAQ (DX)(R13*1), CX
+ ROLQ CL, R14
+ BZHIQ R13, R14, R14
+ MOVQ CX, DX
+ MOVQ DI, CX
+ SHRQ $0x20, CX
+ ADDQ R14, CX
+ MOVQ CX, 16(SP)
+
+ // Fill bitreader to have enough for the remaining
+ CMPQ BX, $0x08
+ JL sequenceDecs_decodeSync_safe_bmi2_fill_2_byte_by_byte
+ MOVQ DX, CX
+ SHRQ $0x03, CX
+ SUBQ CX, R12
+ MOVQ (R12), AX
+ SUBQ CX, BX
+ ANDQ $0x07, DX
+ JMP sequenceDecs_decodeSync_safe_bmi2_fill_2_end
+
+sequenceDecs_decodeSync_safe_bmi2_fill_2_byte_by_byte:
+ CMPQ BX, $0x00
+ JLE sequenceDecs_decodeSync_safe_bmi2_fill_2_check_overread
+ CMPQ DX, $0x07
+ JLE sequenceDecs_decodeSync_safe_bmi2_fill_2_end
+ SHLQ $0x08, AX
+ SUBQ $0x01, R12
+ SUBQ $0x01, BX
+ SUBQ $0x08, DX
+ MOVBQZX (R12), CX
+ ORQ CX, AX
+ JMP sequenceDecs_decodeSync_safe_bmi2_fill_2_byte_by_byte
+
+sequenceDecs_decodeSync_safe_bmi2_fill_2_check_overread:
+ CMPQ DX, $0x40
+ JA error_overread
+
+sequenceDecs_decodeSync_safe_bmi2_fill_2_end:
+ // Update literal length
+ MOVQ $0x00000808, CX
+ BEXTRQ CX, SI, R13
+ MOVQ AX, R14
+ LEAQ (DX)(R13*1), CX
+ ROLQ CL, R14
+ BZHIQ R13, R14, R14
+ MOVQ CX, DX
+ MOVQ SI, CX
+ SHRQ $0x20, CX
+ ADDQ R14, CX
+ MOVQ CX, 24(SP)
+
+ // Fill bitreader for state updates
+ MOVQ R12, (SP)
+ MOVQ $0x00000808, CX
+ BEXTRQ CX, R8, R12
+ MOVQ ctx+16(FP), CX
+ CMPQ 96(CX), $0x00
+ JZ sequenceDecs_decodeSync_safe_bmi2_skip_update
+ LEAQ (SI)(DI*1), R13
+ ADDQ R8, R13
+ MOVBQZX R13, R13
+ LEAQ (DX)(R13*1), CX
+ MOVQ AX, R14
+ MOVQ CX, DX
+ ROLQ CL, R14
+ BZHIQ R13, R14, R14
+
+ // Update Offset State
+ BZHIQ R8, R14, CX
+ SHRXQ R8, R14, R14
+ SHRL $0x10, R8
+ ADDQ CX, R8
+
+ // Load ctx.ofTable
+ MOVQ ctx+16(FP), CX
+ MOVQ 48(CX), CX
+ MOVQ (CX)(R8*8), R8
+
+ // Update Match Length State
+ BZHIQ DI, R14, CX
+ SHRXQ DI, R14, R14
+ SHRL $0x10, DI
+ ADDQ CX, DI
+
+ // Load ctx.mlTable
+ MOVQ ctx+16(FP), CX
+ MOVQ 24(CX), CX
+ MOVQ (CX)(DI*8), DI
+
+ // Update Literal Length State
+ BZHIQ SI, R14, CX
+ SHRL $0x10, SI
+ ADDQ CX, SI
+
+ // Load ctx.llTable
+ MOVQ ctx+16(FP), CX
+ MOVQ (CX), CX
+ MOVQ (CX)(SI*8), SI
+
+sequenceDecs_decodeSync_safe_bmi2_skip_update:
+ // Adjust offset
+ MOVQ s+0(FP), CX
+ MOVQ 8(SP), R13
+ CMPQ R12, $0x01
+ JBE sequenceDecs_decodeSync_safe_bmi2_adjust_offsetB_1_or_0
+ MOVUPS 144(CX), X0
+ MOVQ R13, 144(CX)
+ MOVUPS X0, 152(CX)
+ JMP sequenceDecs_decodeSync_safe_bmi2_after_adjust
+
+sequenceDecs_decodeSync_safe_bmi2_adjust_offsetB_1_or_0:
+ CMPQ 24(SP), $0x00000000
+ JNE sequenceDecs_decodeSync_safe_bmi2_adjust_offset_maybezero
+ INCQ R13
+ JMP sequenceDecs_decodeSync_safe_bmi2_adjust_offset_nonzero
+
+sequenceDecs_decodeSync_safe_bmi2_adjust_offset_maybezero:
+ TESTQ R13, R13
+ JNZ sequenceDecs_decodeSync_safe_bmi2_adjust_offset_nonzero
+ MOVQ 144(CX), R13
+ JMP sequenceDecs_decodeSync_safe_bmi2_after_adjust
+
+sequenceDecs_decodeSync_safe_bmi2_adjust_offset_nonzero:
+ MOVQ R13, R12
+ XORQ R14, R14
+ MOVQ $-1, R15
+ CMPQ R13, $0x03
+ CMOVQEQ R14, R12
+ CMOVQEQ R15, R14
+ ADDQ 144(CX)(R12*8), R14
+ JNZ sequenceDecs_decodeSync_safe_bmi2_adjust_temp_valid
+ MOVQ $0x00000001, R14
+
+sequenceDecs_decodeSync_safe_bmi2_adjust_temp_valid:
+ CMPQ R13, $0x01
+ JZ sequenceDecs_decodeSync_safe_bmi2_adjust_skip
+ MOVQ 152(CX), R12
+ MOVQ R12, 160(CX)
+
+sequenceDecs_decodeSync_safe_bmi2_adjust_skip:
+ MOVQ 144(CX), R12
+ MOVQ R12, 152(CX)
+ MOVQ R14, 144(CX)
+ MOVQ R14, R13
+
+sequenceDecs_decodeSync_safe_bmi2_after_adjust:
+ MOVQ R13, 8(SP)
+
+ // Check values
+ MOVQ 16(SP), CX
+ MOVQ 24(SP), R12
+ LEAQ (CX)(R12*1), R14
+ MOVQ s+0(FP), R15
+ ADDQ R14, 256(R15)
+ MOVQ ctx+16(FP), R14
+ SUBQ R12, 104(R14)
+ JS error_not_enough_literals
+ CMPQ CX, $0x00020002
+ JA sequenceDecs_decodeSync_safe_bmi2_error_match_len_too_big
+ TESTQ R13, R13
+ JNZ sequenceDecs_decodeSync_safe_bmi2_match_len_ofs_ok
+ TESTQ CX, CX
+ JNZ sequenceDecs_decodeSync_safe_bmi2_error_match_len_ofs_mismatch
+
+sequenceDecs_decodeSync_safe_bmi2_match_len_ofs_ok:
+ MOVQ 24(SP), CX
+ MOVQ 8(SP), R12
+ MOVQ 16(SP), R13
+
+ // Check if we have enough space in s.out
+ LEAQ (CX)(R13*1), R14
+ ADDQ R9, R14
+ CMPQ R14, 32(SP)
+ JA error_not_enough_space
+
+ // Copy literals
+ TESTQ CX, CX
+ JZ check_offset
+ MOVQ CX, R14
+ SUBQ $0x10, R14
+ JB copy_1_small
+
+copy_1_loop:
+ MOVUPS (R10), X0
+ MOVUPS X0, (R9)
+ ADDQ $0x10, R10
+ ADDQ $0x10, R9
+ SUBQ $0x10, R14
+ JAE copy_1_loop
+ LEAQ 16(R10)(R14*1), R10
+ LEAQ 16(R9)(R14*1), R9
+ MOVUPS -16(R10), X0
+ MOVUPS X0, -16(R9)
+ JMP copy_1_end
+
+copy_1_small:
+ CMPQ CX, $0x03
+ JE copy_1_move_3
+ JB copy_1_move_1or2
+ CMPQ CX, $0x08
+ JB copy_1_move_4through7
+ JMP copy_1_move_8through16
+
+copy_1_move_1or2:
+ MOVB (R10), R14
+ MOVB -1(R10)(CX*1), R15
+ MOVB R14, (R9)
+ MOVB R15, -1(R9)(CX*1)
+ ADDQ CX, R10
+ ADDQ CX, R9
+ JMP copy_1_end
+
+copy_1_move_3:
+ MOVW (R10), R14
+ MOVB 2(R10), R15
+ MOVW R14, (R9)
+ MOVB R15, 2(R9)
+ ADDQ CX, R10
+ ADDQ CX, R9
+ JMP copy_1_end
+
+copy_1_move_4through7:
+ MOVL (R10), R14
+ MOVL -4(R10)(CX*1), R15
+ MOVL R14, (R9)
+ MOVL R15, -4(R9)(CX*1)
+ ADDQ CX, R10
+ ADDQ CX, R9
+ JMP copy_1_end
+
+copy_1_move_8through16:
+ MOVQ (R10), R14
+ MOVQ -8(R10)(CX*1), R15
+ MOVQ R14, (R9)
+ MOVQ R15, -8(R9)(CX*1)
+ ADDQ CX, R10
+ ADDQ CX, R9
+
+copy_1_end:
+ ADDQ CX, R11
+
+ // Malformed input if seq.mo > t+len(hist) || seq.mo > s.windowSize)
+check_offset:
+ MOVQ R11, CX
+ ADDQ 40(SP), CX
+ CMPQ R12, CX
+ JG error_match_off_too_big
+ CMPQ R12, 56(SP)
+ JG error_match_off_too_big
+
+ // Copy match from history
+ MOVQ R12, CX
+ SUBQ R11, CX
+ JLS copy_match
+ MOVQ 48(SP), R14
+ SUBQ CX, R14
+ CMPQ R13, CX
+ JG copy_all_from_history
+ MOVQ R13, CX
+ SUBQ $0x10, CX
+ JB copy_4_small
+
+copy_4_loop:
+ MOVUPS (R14), X0
+ MOVUPS X0, (R9)
+ ADDQ $0x10, R14
+ ADDQ $0x10, R9
+ SUBQ $0x10, CX
+ JAE copy_4_loop
+ LEAQ 16(R14)(CX*1), R14
+ LEAQ 16(R9)(CX*1), R9
+ MOVUPS -16(R14), X0
+ MOVUPS X0, -16(R9)
+ JMP copy_4_end
+
+copy_4_small:
+ CMPQ R13, $0x03
+ JE copy_4_move_3
+ CMPQ R13, $0x08
+ JB copy_4_move_4through7
+ JMP copy_4_move_8through16
+
+copy_4_move_3:
+ MOVW (R14), CX
+ MOVB 2(R14), R12
+ MOVW CX, (R9)
+ MOVB R12, 2(R9)
+ ADDQ R13, R14
+ ADDQ R13, R9
+ JMP copy_4_end
+
+copy_4_move_4through7:
+ MOVL (R14), CX
+ MOVL -4(R14)(R13*1), R12
+ MOVL CX, (R9)
+ MOVL R12, -4(R9)(R13*1)
+ ADDQ R13, R14
+ ADDQ R13, R9
+ JMP copy_4_end
+
+copy_4_move_8through16:
+ MOVQ (R14), CX
+ MOVQ -8(R14)(R13*1), R12
+ MOVQ CX, (R9)
+ MOVQ R12, -8(R9)(R13*1)
+ ADDQ R13, R14
+ ADDQ R13, R9
+
+copy_4_end:
+ ADDQ R13, R11
+ JMP handle_loop
+ JMP loop_finished
+
+copy_all_from_history:
+ MOVQ CX, R15
+ SUBQ $0x10, R15
+ JB copy_5_small
+
+copy_5_loop:
+ MOVUPS (R14), X0
+ MOVUPS X0, (R9)
+ ADDQ $0x10, R14
+ ADDQ $0x10, R9
+ SUBQ $0x10, R15
+ JAE copy_5_loop
+ LEAQ 16(R14)(R15*1), R14
+ LEAQ 16(R9)(R15*1), R9
+ MOVUPS -16(R14), X0
+ MOVUPS X0, -16(R9)
+ JMP copy_5_end
+
+copy_5_small:
+ CMPQ CX, $0x03
+ JE copy_5_move_3
+ JB copy_5_move_1or2
+ CMPQ CX, $0x08
+ JB copy_5_move_4through7
+ JMP copy_5_move_8through16
+
+copy_5_move_1or2:
+ MOVB (R14), R15
+ MOVB -1(R14)(CX*1), BP
+ MOVB R15, (R9)
+ MOVB BP, -1(R9)(CX*1)
+ ADDQ CX, R14
+ ADDQ CX, R9
+ JMP copy_5_end
+
+copy_5_move_3:
+ MOVW (R14), R15
+ MOVB 2(R14), BP
+ MOVW R15, (R9)
+ MOVB BP, 2(R9)
+ ADDQ CX, R14
+ ADDQ CX, R9
+ JMP copy_5_end
+
+copy_5_move_4through7:
+ MOVL (R14), R15
+ MOVL -4(R14)(CX*1), BP
+ MOVL R15, (R9)
+ MOVL BP, -4(R9)(CX*1)
+ ADDQ CX, R14
+ ADDQ CX, R9
+ JMP copy_5_end
+
+copy_5_move_8through16:
+ MOVQ (R14), R15
+ MOVQ -8(R14)(CX*1), BP
+ MOVQ R15, (R9)
+ MOVQ BP, -8(R9)(CX*1)
+ ADDQ CX, R14
+ ADDQ CX, R9
+
+copy_5_end:
+ ADDQ CX, R11
+ SUBQ CX, R13
+
+ // Copy match from the current buffer
+copy_match:
+ MOVQ R9, CX
+ SUBQ R12, CX
+
+ // ml <= mo
+ CMPQ R13, R12
+ JA copy_overlapping_match
+
+ // Copy non-overlapping match
+ ADDQ R13, R11
+ MOVQ R13, R12
+ SUBQ $0x10, R12
+ JB copy_2_small
+
+copy_2_loop:
+ MOVUPS (CX), X0
+ MOVUPS X0, (R9)
+ ADDQ $0x10, CX
+ ADDQ $0x10, R9
+ SUBQ $0x10, R12
+ JAE copy_2_loop
+ LEAQ 16(CX)(R12*1), CX
+ LEAQ 16(R9)(R12*1), R9
+ MOVUPS -16(CX), X0
+ MOVUPS X0, -16(R9)
+ JMP copy_2_end
+
+copy_2_small:
+ CMPQ R13, $0x03
+ JE copy_2_move_3
+ JB copy_2_move_1or2
+ CMPQ R13, $0x08
+ JB copy_2_move_4through7
+ JMP copy_2_move_8through16
+
+copy_2_move_1or2:
+ MOVB (CX), R12
+ MOVB -1(CX)(R13*1), R14
+ MOVB R12, (R9)
+ MOVB R14, -1(R9)(R13*1)
+ ADDQ R13, CX
+ ADDQ R13, R9
+ JMP copy_2_end
+
+copy_2_move_3:
+ MOVW (CX), R12
+ MOVB 2(CX), R14
+ MOVW R12, (R9)
+ MOVB R14, 2(R9)
+ ADDQ R13, CX
+ ADDQ R13, R9
+ JMP copy_2_end
+
+copy_2_move_4through7:
+ MOVL (CX), R12
+ MOVL -4(CX)(R13*1), R14
+ MOVL R12, (R9)
+ MOVL R14, -4(R9)(R13*1)
+ ADDQ R13, CX
+ ADDQ R13, R9
+ JMP copy_2_end
+
+copy_2_move_8through16:
+ MOVQ (CX), R12
+ MOVQ -8(CX)(R13*1), R14
+ MOVQ R12, (R9)
+ MOVQ R14, -8(R9)(R13*1)
+ ADDQ R13, CX
+ ADDQ R13, R9
+
+copy_2_end:
+ JMP handle_loop
+
+ // Copy overlapping match
+copy_overlapping_match:
+ ADDQ R13, R11
+
+copy_slow_3:
+ MOVB (CX), R12
+ MOVB R12, (R9)
+ INCQ CX
+ INCQ R9
+ DECQ R13
+ JNZ copy_slow_3
+
+handle_loop:
+ MOVQ ctx+16(FP), CX
+ DECQ 96(CX)
+ JNS sequenceDecs_decodeSync_safe_bmi2_main_loop
+
+loop_finished:
+ MOVQ br+8(FP), CX
+ MOVQ AX, 24(CX)
+ MOVB DL, 32(CX)
+ MOVQ BX, 8(CX)
+
+ // Update the context
+ MOVQ ctx+16(FP), AX
+ MOVQ R11, 136(AX)
+ MOVQ 144(AX), CX
+ SUBQ CX, R10
+ MOVQ R10, 168(AX)
+
+ // Return success
+ MOVQ $0x00000000, ret+24(FP)
+ RET
+
+ // Return with match length error
+sequenceDecs_decodeSync_safe_bmi2_error_match_len_ofs_mismatch:
+ MOVQ 16(SP), AX
+ MOVQ ctx+16(FP), CX
+ MOVQ AX, 216(CX)
+ MOVQ $0x00000001, ret+24(FP)
+ RET
+
+ // Return with match too long error
+sequenceDecs_decodeSync_safe_bmi2_error_match_len_too_big:
+ MOVQ ctx+16(FP), AX
+ MOVQ 16(SP), CX
+ MOVQ CX, 216(AX)
+ MOVQ $0x00000002, ret+24(FP)
+ RET
+
+ // Return with match offset too long error
+error_match_off_too_big:
+ MOVQ ctx+16(FP), AX
+ MOVQ 8(SP), CX
+ MOVQ CX, 224(AX)
+ MOVQ R11, 136(AX)
+ MOVQ $0x00000003, ret+24(FP)
+ RET
+
+ // Return with not enough literals error
+error_not_enough_literals:
+ MOVQ ctx+16(FP), AX
+ MOVQ 24(SP), CX
+ MOVQ CX, 208(AX)
+ MOVQ $0x00000004, ret+24(FP)
+ RET
+
+ // Return with overread error
+error_overread:
+ MOVQ $0x00000006, ret+24(FP)
+ RET
+
+ // Return with not enough output space error
+error_not_enough_space:
+ MOVQ ctx+16(FP), AX
+ MOVQ 24(SP), CX
+ MOVQ CX, 208(AX)
+ MOVQ 16(SP), CX
+ MOVQ CX, 216(AX)
+ MOVQ R11, 136(AX)
+ MOVQ $0x00000005, ret+24(FP)
+ RET
diff --git a/vendor/github.com/klauspost/compress/zstd/seqdec_generic.go b/vendor/github.com/klauspost/compress/zstd/seqdec_generic.go
new file mode 100644
index 00000000..2fb35b78
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/seqdec_generic.go
@@ -0,0 +1,237 @@
+//go:build !amd64 || appengine || !gc || noasm
+// +build !amd64 appengine !gc noasm
+
+package zstd
+
+import (
+ "fmt"
+ "io"
+)
+
+// decode sequences from the stream with the provided history but without dictionary.
+func (s *sequenceDecs) decodeSyncSimple(hist []byte) (bool, error) {
+ return false, nil
+}
+
+// decode sequences from the stream without the provided history.
+func (s *sequenceDecs) decode(seqs []seqVals) error {
+ br := s.br
+
+ // Grab full sizes tables, to avoid bounds checks.
+ llTable, mlTable, ofTable := s.litLengths.fse.dt[:maxTablesize], s.matchLengths.fse.dt[:maxTablesize], s.offsets.fse.dt[:maxTablesize]
+ llState, mlState, ofState := s.litLengths.state.state, s.matchLengths.state.state, s.offsets.state.state
+ s.seqSize = 0
+ litRemain := len(s.literals)
+
+ maxBlockSize := maxCompressedBlockSize
+ if s.windowSize < maxBlockSize {
+ maxBlockSize = s.windowSize
+ }
+ for i := range seqs {
+ var ll, mo, ml int
+ if len(br.in) > 4+((maxOffsetBits+16+16)>>3) {
+ // inlined function:
+ // ll, mo, ml = s.nextFast(br, llState, mlState, ofState)
+
+ // Final will not read from stream.
+ var llB, mlB, moB uint8
+ ll, llB = llState.final()
+ ml, mlB = mlState.final()
+ mo, moB = ofState.final()
+
+ // extra bits are stored in reverse order.
+ br.fillFast()
+ mo += br.getBits(moB)
+ if s.maxBits > 32 {
+ br.fillFast()
+ }
+ ml += br.getBits(mlB)
+ ll += br.getBits(llB)
+
+ if moB > 1 {
+ s.prevOffset[2] = s.prevOffset[1]
+ s.prevOffset[1] = s.prevOffset[0]
+ s.prevOffset[0] = mo
+ } else {
+ // mo = s.adjustOffset(mo, ll, moB)
+ // Inlined for rather big speedup
+ if ll == 0 {
+ // There is an exception though, when current sequence's literals_length = 0.
+ // In this case, repeated offsets are shifted by one, so an offset_value of 1 means Repeated_Offset2,
+ // an offset_value of 2 means Repeated_Offset3, and an offset_value of 3 means Repeated_Offset1 - 1_byte.
+ mo++
+ }
+
+ if mo == 0 {
+ mo = s.prevOffset[0]
+ } else {
+ var temp int
+ if mo == 3 {
+ temp = s.prevOffset[0] - 1
+ } else {
+ temp = s.prevOffset[mo]
+ }
+
+ if temp == 0 {
+ // 0 is not valid; input is corrupted; force offset to 1
+ println("WARNING: temp was 0")
+ temp = 1
+ }
+
+ if mo != 1 {
+ s.prevOffset[2] = s.prevOffset[1]
+ }
+ s.prevOffset[1] = s.prevOffset[0]
+ s.prevOffset[0] = temp
+ mo = temp
+ }
+ }
+ br.fillFast()
+ } else {
+ if br.overread() {
+ if debugDecoder {
+ printf("reading sequence %d, exceeded available data\n", i)
+ }
+ return io.ErrUnexpectedEOF
+ }
+ ll, mo, ml = s.next(br, llState, mlState, ofState)
+ br.fill()
+ }
+
+ if debugSequences {
+ println("Seq", i, "Litlen:", ll, "mo:", mo, "(abs) ml:", ml)
+ }
+ // Evaluate.
+ // We might be doing this async, so do it early.
+ if mo == 0 && ml > 0 {
+ return fmt.Errorf("zero matchoff and matchlen (%d) > 0", ml)
+ }
+ if ml > maxMatchLen {
+ return fmt.Errorf("match len (%d) bigger than max allowed length", ml)
+ }
+ s.seqSize += ll + ml
+ if s.seqSize > maxBlockSize {
+ return fmt.Errorf("output bigger than max block size (%d)", maxBlockSize)
+ }
+ litRemain -= ll
+ if litRemain < 0 {
+ return fmt.Errorf("unexpected literal count, want %d bytes, but only %d is available", ll, litRemain+ll)
+ }
+ seqs[i] = seqVals{
+ ll: ll,
+ ml: ml,
+ mo: mo,
+ }
+ if i == len(seqs)-1 {
+ // This is the last sequence, so we shouldn't update state.
+ break
+ }
+
+ // Manually inlined, ~ 5-20% faster
+ // Update all 3 states at once. Approx 20% faster.
+ nBits := llState.nbBits() + mlState.nbBits() + ofState.nbBits()
+ if nBits == 0 {
+ llState = llTable[llState.newState()&maxTableMask]
+ mlState = mlTable[mlState.newState()&maxTableMask]
+ ofState = ofTable[ofState.newState()&maxTableMask]
+ } else {
+ bits := br.get32BitsFast(nBits)
+ lowBits := uint16(bits >> ((ofState.nbBits() + mlState.nbBits()) & 31))
+ llState = llTable[(llState.newState()+lowBits)&maxTableMask]
+
+ lowBits = uint16(bits >> (ofState.nbBits() & 31))
+ lowBits &= bitMask[mlState.nbBits()&15]
+ mlState = mlTable[(mlState.newState()+lowBits)&maxTableMask]
+
+ lowBits = uint16(bits) & bitMask[ofState.nbBits()&15]
+ ofState = ofTable[(ofState.newState()+lowBits)&maxTableMask]
+ }
+ }
+ s.seqSize += litRemain
+ if s.seqSize > maxBlockSize {
+ return fmt.Errorf("output bigger than max block size (%d)", maxBlockSize)
+ }
+ err := br.close()
+ if err != nil {
+ printf("Closing sequences: %v, %+v\n", err, *br)
+ }
+ return err
+}
+
+// executeSimple handles cases when a dictionary is not used.
+func (s *sequenceDecs) executeSimple(seqs []seqVals, hist []byte) error {
+ // Ensure we have enough output size...
+ if len(s.out)+s.seqSize > cap(s.out) {
+ addBytes := s.seqSize + len(s.out)
+ s.out = append(s.out, make([]byte, addBytes)...)
+ s.out = s.out[:len(s.out)-addBytes]
+ }
+
+ if debugDecoder {
+ printf("Execute %d seqs with literals: %d into %d bytes\n", len(seqs), len(s.literals), s.seqSize)
+ }
+
+ var t = len(s.out)
+ out := s.out[:t+s.seqSize]
+
+ for _, seq := range seqs {
+ // Add literals
+ copy(out[t:], s.literals[:seq.ll])
+ t += seq.ll
+ s.literals = s.literals[seq.ll:]
+
+ // Malformed input
+ if seq.mo > t+len(hist) || seq.mo > s.windowSize {
+ return fmt.Errorf("match offset (%d) bigger than current history (%d)", seq.mo, t+len(hist))
+ }
+
+ // Copy from history.
+ if v := seq.mo - t; v > 0 {
+ // v is the start position in history from end.
+ start := len(hist) - v
+ if seq.ml > v {
+ // Some goes into the current block.
+ // Copy remainder of history
+ copy(out[t:], hist[start:])
+ t += v
+ seq.ml -= v
+ } else {
+ copy(out[t:], hist[start:start+seq.ml])
+ t += seq.ml
+ continue
+ }
+ }
+
+ // We must be in the current buffer now
+ if seq.ml > 0 {
+ start := t - seq.mo
+ if seq.ml <= t-start {
+ // No overlap
+ copy(out[t:], out[start:start+seq.ml])
+ t += seq.ml
+ } else {
+ // Overlapping copy
+ // Extend destination slice and copy one byte at the time.
+ src := out[start : start+seq.ml]
+ dst := out[t:]
+ dst = dst[:len(src)]
+ t += len(src)
+ // Destination is the space we just added.
+ for i := range src {
+ dst[i] = src[i]
+ }
+ }
+ }
+ }
+ // Add final literals
+ copy(out[t:], s.literals)
+ if debugDecoder {
+ t += len(s.literals)
+ if t != len(out) {
+ panic(fmt.Errorf("length mismatch, want %d, got %d, ss: %d", len(out), t, s.seqSize))
+ }
+ }
+ s.out = out
+
+ return nil
+}
diff --git a/vendor/github.com/klauspost/compress/zstd/seqenc.go b/vendor/github.com/klauspost/compress/zstd/seqenc.go
new file mode 100644
index 00000000..8014174a
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/seqenc.go
@@ -0,0 +1,114 @@
+// Copyright 2019+ Klaus Post. All rights reserved.
+// License information can be found in the LICENSE file.
+// Based on work by Yann Collet, released under BSD License.
+
+package zstd
+
+import "math/bits"
+
+type seqCoders struct {
+ llEnc, ofEnc, mlEnc *fseEncoder
+ llPrev, ofPrev, mlPrev *fseEncoder
+}
+
+// swap coders with another (block).
+func (s *seqCoders) swap(other *seqCoders) {
+ *s, *other = *other, *s
+}
+
+// setPrev will update the previous encoders to the actually used ones
+// and make sure a fresh one is in the main slot.
+func (s *seqCoders) setPrev(ll, ml, of *fseEncoder) {
+ compareSwap := func(used *fseEncoder, current, prev **fseEncoder) {
+ // We used the new one, more current to history and reuse the previous history
+ if *current == used {
+ *prev, *current = *current, *prev
+ c := *current
+ p := *prev
+ c.reUsed = false
+ p.reUsed = true
+ return
+ }
+ if used == *prev {
+ return
+ }
+ // Ensure we cannot reuse by accident
+ prevEnc := *prev
+ prevEnc.symbolLen = 0
+ }
+ compareSwap(ll, &s.llEnc, &s.llPrev)
+ compareSwap(ml, &s.mlEnc, &s.mlPrev)
+ compareSwap(of, &s.ofEnc, &s.ofPrev)
+}
+
+func highBit(val uint32) (n uint32) {
+ return uint32(bits.Len32(val) - 1)
+}
+
+var llCodeTable = [64]byte{0, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15,
+ 16, 16, 17, 17, 18, 18, 19, 19,
+ 20, 20, 20, 20, 21, 21, 21, 21,
+ 22, 22, 22, 22, 22, 22, 22, 22,
+ 23, 23, 23, 23, 23, 23, 23, 23,
+ 24, 24, 24, 24, 24, 24, 24, 24,
+ 24, 24, 24, 24, 24, 24, 24, 24}
+
+// Up to 6 bits
+const maxLLCode = 35
+
+// llBitsTable translates from ll code to number of bits.
+var llBitsTable = [maxLLCode + 1]byte{
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 1, 2, 2, 3, 3,
+ 4, 6, 7, 8, 9, 10, 11, 12,
+ 13, 14, 15, 16}
+
+// llCode returns the code that represents the literal length requested.
+func llCode(litLength uint32) uint8 {
+ const llDeltaCode = 19
+ if litLength <= 63 {
+ // Compiler insists on bounds check (Go 1.12)
+ return llCodeTable[litLength&63]
+ }
+ return uint8(highBit(litLength)) + llDeltaCode
+}
+
+var mlCodeTable = [128]byte{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
+ 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 36, 36, 37, 37, 37, 37,
+ 38, 38, 38, 38, 38, 38, 38, 38, 39, 39, 39, 39, 39, 39, 39, 39,
+ 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
+ 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
+ 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
+ 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42}
+
+// Up to 6 bits
+const maxMLCode = 52
+
+// mlBitsTable translates from ml code to number of bits.
+var mlBitsTable = [maxMLCode + 1]byte{
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 1, 2, 2, 3, 3,
+ 4, 4, 5, 7, 8, 9, 10, 11,
+ 12, 13, 14, 15, 16}
+
+// note : mlBase = matchLength - MINMATCH;
+// because it's the format it's stored in seqStore->sequences
+func mlCode(mlBase uint32) uint8 {
+ const mlDeltaCode = 36
+ if mlBase <= 127 {
+ // Compiler insists on bounds check (Go 1.12)
+ return mlCodeTable[mlBase&127]
+ }
+ return uint8(highBit(mlBase)) + mlDeltaCode
+}
+
+func ofCode(offset uint32) uint8 {
+ // A valid offset will always be > 0.
+ return uint8(bits.Len32(offset) - 1)
+}
diff --git a/vendor/github.com/klauspost/compress/zstd/snappy.go b/vendor/github.com/klauspost/compress/zstd/snappy.go
new file mode 100644
index 00000000..ec13594e
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/snappy.go
@@ -0,0 +1,434 @@
+// Copyright 2019+ Klaus Post. All rights reserved.
+// License information can be found in the LICENSE file.
+// Based on work by Yann Collet, released under BSD License.
+
+package zstd
+
+import (
+ "encoding/binary"
+ "errors"
+ "hash/crc32"
+ "io"
+
+ "github.com/klauspost/compress/huff0"
+ snappy "github.com/klauspost/compress/internal/snapref"
+)
+
+const (
+ snappyTagLiteral = 0x00
+ snappyTagCopy1 = 0x01
+ snappyTagCopy2 = 0x02
+ snappyTagCopy4 = 0x03
+)
+
+const (
+ snappyChecksumSize = 4
+ snappyMagicBody = "sNaPpY"
+
+ // snappyMaxBlockSize is the maximum size of the input to encodeBlock. It is not
+ // part of the wire format per se, but some parts of the encoder assume
+ // that an offset fits into a uint16.
+ //
+ // Also, for the framing format (Writer type instead of Encode function),
+ // https://github.com/google/snappy/blob/master/framing_format.txt says
+ // that "the uncompressed data in a chunk must be no longer than 65536
+ // bytes".
+ snappyMaxBlockSize = 65536
+
+ // snappyMaxEncodedLenOfMaxBlockSize equals MaxEncodedLen(snappyMaxBlockSize), but is
+ // hard coded to be a const instead of a variable, so that obufLen can also
+ // be a const. Their equivalence is confirmed by
+ // TestMaxEncodedLenOfMaxBlockSize.
+ snappyMaxEncodedLenOfMaxBlockSize = 76490
+)
+
+const (
+ chunkTypeCompressedData = 0x00
+ chunkTypeUncompressedData = 0x01
+ chunkTypePadding = 0xfe
+ chunkTypeStreamIdentifier = 0xff
+)
+
+var (
+ // ErrSnappyCorrupt reports that the input is invalid.
+ ErrSnappyCorrupt = errors.New("snappy: corrupt input")
+ // ErrSnappyTooLarge reports that the uncompressed length is too large.
+ ErrSnappyTooLarge = errors.New("snappy: decoded block is too large")
+ // ErrSnappyUnsupported reports that the input isn't supported.
+ ErrSnappyUnsupported = errors.New("snappy: unsupported input")
+
+ errUnsupportedLiteralLength = errors.New("snappy: unsupported literal length")
+)
+
+// SnappyConverter can read SnappyConverter-compressed streams and convert them to zstd.
+// Conversion is done by converting the stream directly from Snappy without intermediate
+// full decoding.
+// Therefore the compression ratio is much less than what can be done by a full decompression
+// and compression, and a faulty Snappy stream may lead to a faulty Zstandard stream without
+// any errors being generated.
+// No CRC value is being generated and not all CRC values of the Snappy stream are checked.
+// However, it provides really fast recompression of Snappy streams.
+// The converter can be reused to avoid allocations, even after errors.
+type SnappyConverter struct {
+ r io.Reader
+ err error
+ buf []byte
+ block *blockEnc
+}
+
+// Convert the Snappy stream supplied in 'in' and write the zStandard stream to 'w'.
+// If any error is detected on the Snappy stream it is returned.
+// The number of bytes written is returned.
+func (r *SnappyConverter) Convert(in io.Reader, w io.Writer) (int64, error) {
+ initPredefined()
+ r.err = nil
+ r.r = in
+ if r.block == nil {
+ r.block = &blockEnc{}
+ r.block.init()
+ }
+ r.block.initNewEncode()
+ if len(r.buf) != snappyMaxEncodedLenOfMaxBlockSize+snappyChecksumSize {
+ r.buf = make([]byte, snappyMaxEncodedLenOfMaxBlockSize+snappyChecksumSize)
+ }
+ r.block.litEnc.Reuse = huff0.ReusePolicyNone
+ var written int64
+ var readHeader bool
+ {
+ header := frameHeader{WindowSize: snappyMaxBlockSize}.appendTo(r.buf[:0])
+
+ var n int
+ n, r.err = w.Write(header)
+ if r.err != nil {
+ return written, r.err
+ }
+ written += int64(n)
+ }
+
+ for {
+ if !r.readFull(r.buf[:4], true) {
+ // Add empty last block
+ r.block.reset(nil)
+ r.block.last = true
+ err := r.block.encodeLits(r.block.literals, false)
+ if err != nil {
+ return written, err
+ }
+ n, err := w.Write(r.block.output)
+ if err != nil {
+ return written, err
+ }
+ written += int64(n)
+
+ return written, r.err
+ }
+ chunkType := r.buf[0]
+ if !readHeader {
+ if chunkType != chunkTypeStreamIdentifier {
+ println("chunkType != chunkTypeStreamIdentifier", chunkType)
+ r.err = ErrSnappyCorrupt
+ return written, r.err
+ }
+ readHeader = true
+ }
+ chunkLen := int(r.buf[1]) | int(r.buf[2])<<8 | int(r.buf[3])<<16
+ if chunkLen > len(r.buf) {
+ println("chunkLen > len(r.buf)", chunkType)
+ r.err = ErrSnappyUnsupported
+ return written, r.err
+ }
+
+ // The chunk types are specified at
+ // https://github.com/google/snappy/blob/master/framing_format.txt
+ switch chunkType {
+ case chunkTypeCompressedData:
+ // Section 4.2. Compressed data (chunk type 0x00).
+ if chunkLen < snappyChecksumSize {
+ println("chunkLen < snappyChecksumSize", chunkLen, snappyChecksumSize)
+ r.err = ErrSnappyCorrupt
+ return written, r.err
+ }
+ buf := r.buf[:chunkLen]
+ if !r.readFull(buf, false) {
+ return written, r.err
+ }
+ //checksum := uint32(buf[0]) | uint32(buf[1])<<8 | uint32(buf[2])<<16 | uint32(buf[3])<<24
+ buf = buf[snappyChecksumSize:]
+
+ n, hdr, err := snappyDecodedLen(buf)
+ if err != nil {
+ r.err = err
+ return written, r.err
+ }
+ buf = buf[hdr:]
+ if n > snappyMaxBlockSize {
+ println("n > snappyMaxBlockSize", n, snappyMaxBlockSize)
+ r.err = ErrSnappyCorrupt
+ return written, r.err
+ }
+ r.block.reset(nil)
+ r.block.pushOffsets()
+ if err := decodeSnappy(r.block, buf); err != nil {
+ r.err = err
+ return written, r.err
+ }
+ if r.block.size+r.block.extraLits != n {
+ printf("invalid size, want %d, got %d\n", n, r.block.size+r.block.extraLits)
+ r.err = ErrSnappyCorrupt
+ return written, r.err
+ }
+ err = r.block.encode(nil, false, false)
+ switch err {
+ case errIncompressible:
+ r.block.popOffsets()
+ r.block.reset(nil)
+ r.block.literals, err = snappy.Decode(r.block.literals[:n], r.buf[snappyChecksumSize:chunkLen])
+ if err != nil {
+ return written, err
+ }
+ err = r.block.encodeLits(r.block.literals, false)
+ if err != nil {
+ return written, err
+ }
+ case nil:
+ default:
+ return written, err
+ }
+
+ n, r.err = w.Write(r.block.output)
+ if r.err != nil {
+ return written, err
+ }
+ written += int64(n)
+ continue
+ case chunkTypeUncompressedData:
+ if debugEncoder {
+ println("Uncompressed, chunklen", chunkLen)
+ }
+ // Section 4.3. Uncompressed data (chunk type 0x01).
+ if chunkLen < snappyChecksumSize {
+ println("chunkLen < snappyChecksumSize", chunkLen, snappyChecksumSize)
+ r.err = ErrSnappyCorrupt
+ return written, r.err
+ }
+ r.block.reset(nil)
+ buf := r.buf[:snappyChecksumSize]
+ if !r.readFull(buf, false) {
+ return written, r.err
+ }
+ checksum := uint32(buf[0]) | uint32(buf[1])<<8 | uint32(buf[2])<<16 | uint32(buf[3])<<24
+ // Read directly into r.decoded instead of via r.buf.
+ n := chunkLen - snappyChecksumSize
+ if n > snappyMaxBlockSize {
+ println("n > snappyMaxBlockSize", n, snappyMaxBlockSize)
+ r.err = ErrSnappyCorrupt
+ return written, r.err
+ }
+ r.block.literals = r.block.literals[:n]
+ if !r.readFull(r.block.literals, false) {
+ return written, r.err
+ }
+ if snappyCRC(r.block.literals) != checksum {
+ println("literals crc mismatch")
+ r.err = ErrSnappyCorrupt
+ return written, r.err
+ }
+ err := r.block.encodeLits(r.block.literals, false)
+ if err != nil {
+ return written, err
+ }
+ n, r.err = w.Write(r.block.output)
+ if r.err != nil {
+ return written, err
+ }
+ written += int64(n)
+ continue
+
+ case chunkTypeStreamIdentifier:
+ if debugEncoder {
+ println("stream id", chunkLen, len(snappyMagicBody))
+ }
+ // Section 4.1. Stream identifier (chunk type 0xff).
+ if chunkLen != len(snappyMagicBody) {
+ println("chunkLen != len(snappyMagicBody)", chunkLen, len(snappyMagicBody))
+ r.err = ErrSnappyCorrupt
+ return written, r.err
+ }
+ if !r.readFull(r.buf[:len(snappyMagicBody)], false) {
+ return written, r.err
+ }
+ for i := 0; i < len(snappyMagicBody); i++ {
+ if r.buf[i] != snappyMagicBody[i] {
+ println("r.buf[i] != snappyMagicBody[i]", r.buf[i], snappyMagicBody[i], i)
+ r.err = ErrSnappyCorrupt
+ return written, r.err
+ }
+ }
+ continue
+ }
+
+ if chunkType <= 0x7f {
+ // Section 4.5. Reserved unskippable chunks (chunk types 0x02-0x7f).
+ println("chunkType <= 0x7f")
+ r.err = ErrSnappyUnsupported
+ return written, r.err
+ }
+ // Section 4.4 Padding (chunk type 0xfe).
+ // Section 4.6. Reserved skippable chunks (chunk types 0x80-0xfd).
+ if !r.readFull(r.buf[:chunkLen], false) {
+ return written, r.err
+ }
+ }
+}
+
+// decodeSnappy writes the decoding of src to dst. It assumes that the varint-encoded
+// length of the decompressed bytes has already been read.
+func decodeSnappy(blk *blockEnc, src []byte) error {
+ //decodeRef(make([]byte, snappyMaxBlockSize), src)
+ var s, length int
+ lits := blk.extraLits
+ var offset uint32
+ for s < len(src) {
+ switch src[s] & 0x03 {
+ case snappyTagLiteral:
+ x := uint32(src[s] >> 2)
+ switch {
+ case x < 60:
+ s++
+ case x == 60:
+ s += 2
+ if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line.
+ println("uint(s) > uint(len(src)", s, src)
+ return ErrSnappyCorrupt
+ }
+ x = uint32(src[s-1])
+ case x == 61:
+ s += 3
+ if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line.
+ println("uint(s) > uint(len(src)", s, src)
+ return ErrSnappyCorrupt
+ }
+ x = uint32(src[s-2]) | uint32(src[s-1])<<8
+ case x == 62:
+ s += 4
+ if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line.
+ println("uint(s) > uint(len(src)", s, src)
+ return ErrSnappyCorrupt
+ }
+ x = uint32(src[s-3]) | uint32(src[s-2])<<8 | uint32(src[s-1])<<16
+ case x == 63:
+ s += 5
+ if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line.
+ println("uint(s) > uint(len(src)", s, src)
+ return ErrSnappyCorrupt
+ }
+ x = uint32(src[s-4]) | uint32(src[s-3])<<8 | uint32(src[s-2])<<16 | uint32(src[s-1])<<24
+ }
+ if x > snappyMaxBlockSize {
+ println("x > snappyMaxBlockSize", x, snappyMaxBlockSize)
+ return ErrSnappyCorrupt
+ }
+ length = int(x) + 1
+ if length <= 0 {
+ println("length <= 0 ", length)
+
+ return errUnsupportedLiteralLength
+ }
+ //if length > snappyMaxBlockSize-d || uint32(length) > len(src)-s {
+ // return ErrSnappyCorrupt
+ //}
+
+ blk.literals = append(blk.literals, src[s:s+length]...)
+ //println(length, "litLen")
+ lits += length
+ s += length
+ continue
+
+ case snappyTagCopy1:
+ s += 2
+ if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line.
+ println("uint(s) > uint(len(src)", s, len(src))
+ return ErrSnappyCorrupt
+ }
+ length = 4 + int(src[s-2])>>2&0x7
+ offset = uint32(src[s-2])&0xe0<<3 | uint32(src[s-1])
+
+ case snappyTagCopy2:
+ s += 3
+ if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line.
+ println("uint(s) > uint(len(src)", s, len(src))
+ return ErrSnappyCorrupt
+ }
+ length = 1 + int(src[s-3])>>2
+ offset = uint32(src[s-2]) | uint32(src[s-1])<<8
+
+ case snappyTagCopy4:
+ s += 5
+ if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line.
+ println("uint(s) > uint(len(src)", s, len(src))
+ return ErrSnappyCorrupt
+ }
+ length = 1 + int(src[s-5])>>2
+ offset = uint32(src[s-4]) | uint32(src[s-3])<<8 | uint32(src[s-2])<<16 | uint32(src[s-1])<<24
+ }
+
+ if offset <= 0 || blk.size+lits < int(offset) /*|| length > len(blk)-d */ {
+ println("offset <= 0 || blk.size+lits < int(offset)", offset, blk.size+lits, int(offset), blk.size, lits)
+
+ return ErrSnappyCorrupt
+ }
+
+ // Check if offset is one of the recent offsets.
+ // Adjusts the output offset accordingly.
+ // Gives a tiny bit of compression, typically around 1%.
+ if false {
+ offset = blk.matchOffset(offset, uint32(lits))
+ } else {
+ offset += 3
+ }
+
+ blk.sequences = append(blk.sequences, seq{
+ litLen: uint32(lits),
+ offset: offset,
+ matchLen: uint32(length) - zstdMinMatch,
+ })
+ blk.size += length + lits
+ lits = 0
+ }
+ blk.extraLits = lits
+ return nil
+}
+
+func (r *SnappyConverter) readFull(p []byte, allowEOF bool) (ok bool) {
+ if _, r.err = io.ReadFull(r.r, p); r.err != nil {
+ if r.err == io.ErrUnexpectedEOF || (r.err == io.EOF && !allowEOF) {
+ r.err = ErrSnappyCorrupt
+ }
+ return false
+ }
+ return true
+}
+
+var crcTable = crc32.MakeTable(crc32.Castagnoli)
+
+// crc implements the checksum specified in section 3 of
+// https://github.com/google/snappy/blob/master/framing_format.txt
+func snappyCRC(b []byte) uint32 {
+ c := crc32.Update(0, crcTable, b)
+ return c>>15 | c<<17 + 0xa282ead8
+}
+
+// snappyDecodedLen returns the length of the decoded block and the number of bytes
+// that the length header occupied.
+func snappyDecodedLen(src []byte) (blockLen, headerLen int, err error) {
+ v, n := binary.Uvarint(src)
+ if n <= 0 || v > 0xffffffff {
+ return 0, 0, ErrSnappyCorrupt
+ }
+
+ const wordSize = 32 << (^uint(0) >> 32 & 1)
+ if wordSize == 32 && v > 0x7fffffff {
+ return 0, 0, ErrSnappyTooLarge
+ }
+ return int(v), n, nil
+}
diff --git a/vendor/github.com/klauspost/compress/zstd/zip.go b/vendor/github.com/klauspost/compress/zstd/zip.go
new file mode 100644
index 00000000..29c15c8c
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/zip.go
@@ -0,0 +1,141 @@
+// Copyright 2019+ Klaus Post. All rights reserved.
+// License information can be found in the LICENSE file.
+
+package zstd
+
+import (
+ "errors"
+ "io"
+ "sync"
+)
+
+// ZipMethodWinZip is the method for Zstandard compressed data inside Zip files for WinZip.
+// See https://www.winzip.com/win/en/comp_info.html
+const ZipMethodWinZip = 93
+
+// ZipMethodPKWare is the original method number used by PKWARE to indicate Zstandard compression.
+// Deprecated: This has been deprecated by PKWARE, use ZipMethodWinZip instead for compression.
+// See https://pkware.cachefly.net/webdocs/APPNOTE/APPNOTE-6.3.9.TXT
+const ZipMethodPKWare = 20
+
+// zipReaderPool is the default reader pool.
+var zipReaderPool = sync.Pool{New: func() interface{} {
+ z, err := NewReader(nil, WithDecoderLowmem(true), WithDecoderMaxWindow(128<<20), WithDecoderConcurrency(1))
+ if err != nil {
+ panic(err)
+ }
+ return z
+}}
+
+// newZipReader creates a pooled zip decompressor.
+func newZipReader(opts ...DOption) func(r io.Reader) io.ReadCloser {
+ pool := &zipReaderPool
+ if len(opts) > 0 {
+ opts = append([]DOption{WithDecoderLowmem(true), WithDecoderMaxWindow(128 << 20)}, opts...)
+ // Force concurrency 1
+ opts = append(opts, WithDecoderConcurrency(1))
+ // Create our own pool
+ pool = &sync.Pool{}
+ }
+ return func(r io.Reader) io.ReadCloser {
+ dec, ok := pool.Get().(*Decoder)
+ if ok {
+ dec.Reset(r)
+ } else {
+ d, err := NewReader(r, opts...)
+ if err != nil {
+ panic(err)
+ }
+ dec = d
+ }
+ return &pooledZipReader{dec: dec, pool: pool}
+ }
+}
+
+type pooledZipReader struct {
+ mu sync.Mutex // guards Close and Read
+ pool *sync.Pool
+ dec *Decoder
+}
+
+func (r *pooledZipReader) Read(p []byte) (n int, err error) {
+ r.mu.Lock()
+ defer r.mu.Unlock()
+ if r.dec == nil {
+ return 0, errors.New("read after close or EOF")
+ }
+ dec, err := r.dec.Read(p)
+ if err == io.EOF {
+ r.dec.Reset(nil)
+ r.pool.Put(r.dec)
+ r.dec = nil
+ }
+ return dec, err
+}
+
+func (r *pooledZipReader) Close() error {
+ r.mu.Lock()
+ defer r.mu.Unlock()
+ var err error
+ if r.dec != nil {
+ err = r.dec.Reset(nil)
+ r.pool.Put(r.dec)
+ r.dec = nil
+ }
+ return err
+}
+
+type pooledZipWriter struct {
+ mu sync.Mutex // guards Close and Read
+ enc *Encoder
+ pool *sync.Pool
+}
+
+func (w *pooledZipWriter) Write(p []byte) (n int, err error) {
+ w.mu.Lock()
+ defer w.mu.Unlock()
+ if w.enc == nil {
+ return 0, errors.New("Write after Close")
+ }
+ return w.enc.Write(p)
+}
+
+func (w *pooledZipWriter) Close() error {
+ w.mu.Lock()
+ defer w.mu.Unlock()
+ var err error
+ if w.enc != nil {
+ err = w.enc.Close()
+ w.pool.Put(w.enc)
+ w.enc = nil
+ }
+ return err
+}
+
+// ZipCompressor returns a compressor that can be registered with zip libraries.
+// The provided encoder options will be used on all encodes.
+func ZipCompressor(opts ...EOption) func(w io.Writer) (io.WriteCloser, error) {
+ var pool sync.Pool
+ return func(w io.Writer) (io.WriteCloser, error) {
+ enc, ok := pool.Get().(*Encoder)
+ if ok {
+ enc.Reset(w)
+ } else {
+ var err error
+ enc, err = NewWriter(w, opts...)
+ if err != nil {
+ return nil, err
+ }
+ }
+ return &pooledZipWriter{enc: enc, pool: &pool}, nil
+ }
+}
+
+// ZipDecompressor returns a decompressor that can be registered with zip libraries.
+// See ZipCompressor for example.
+// Options can be specified. WithDecoderConcurrency(1) is forced,
+// and by default a 128MB maximum decompression window is specified.
+// The window size can be overridden if required.
+func ZipDecompressor(opts ...DOption) func(r io.Reader) io.ReadCloser {
+ return newZipReader(opts...)
+}
diff --git a/vendor/github.com/klauspost/compress/zstd/zstd.go b/vendor/github.com/klauspost/compress/zstd/zstd.go
new file mode 100644
index 00000000..066bef2a
--- /dev/null
+++ b/vendor/github.com/klauspost/compress/zstd/zstd.go
@@ -0,0 +1,125 @@
+// Package zstd provides decompression of zstandard files.
+//
+// For advanced usage and examples, go to the README: https://github.com/klauspost/compress/tree/master/zstd#zstd
+package zstd
+
+import (
+ "bytes"
+ "encoding/binary"
+ "errors"
+ "log"
+ "math"
+)
+
+// enable debug printing
+const debug = false
+
+// enable encoding debug printing
+const debugEncoder = debug
+
+// enable decoding debug printing
+const debugDecoder = debug
+
+// Enable extra assertions.
+const debugAsserts = debug || false
+
+// print sequence details
+const debugSequences = false
+
+// print detailed matching information
+const debugMatches = false
+
+// force encoder to use predefined tables.
+const forcePreDef = false
+
+// zstdMinMatch is the minimum zstd match length.
+const zstdMinMatch = 3
+
+// fcsUnknown is used for unknown frame content size.
+const fcsUnknown = math.MaxUint64
+
+var (
+ // ErrReservedBlockType is returned when a reserved block type is found.
+ // Typically this indicates wrong or corrupted input.
+ ErrReservedBlockType = errors.New("invalid input: reserved block type encountered")
+
+ // ErrCompressedSizeTooBig is returned when a block is bigger than allowed.
+ // Typically this indicates wrong or corrupted input.
+ ErrCompressedSizeTooBig = errors.New("invalid input: compressed size too big")
+
+ // ErrBlockTooSmall is returned when a block is too small to be decoded.
+ // Typically returned on invalid input.
+ ErrBlockTooSmall = errors.New("block too small")
+
+ // ErrUnexpectedBlockSize is returned when a block has unexpected size.
+ // Typically returned on invalid input.
+ ErrUnexpectedBlockSize = errors.New("unexpected block size")
+
+ // ErrMagicMismatch is returned when a "magic" number isn't what is expected.
+ // Typically this indicates wrong or corrupted input.
+ ErrMagicMismatch = errors.New("invalid input: magic number mismatch")
+
+ // ErrWindowSizeExceeded is returned when a reference exceeds the valid window size.
+ // Typically this indicates wrong or corrupted input.
+ ErrWindowSizeExceeded = errors.New("window size exceeded")
+
+ // ErrWindowSizeTooSmall is returned when no window size is specified.
+ // Typically this indicates wrong or corrupted input.
+ ErrWindowSizeTooSmall = errors.New("invalid input: window size was too small")
+
+ // ErrDecoderSizeExceeded is returned if decompressed size exceeds the configured limit.
+ ErrDecoderSizeExceeded = errors.New("decompressed size exceeds configured limit")
+
+ // ErrUnknownDictionary is returned if the dictionary ID is unknown.
+ ErrUnknownDictionary = errors.New("unknown dictionary")
+
+ // ErrFrameSizeExceeded is returned if the stated frame size is exceeded.
+ // This is only returned if SingleSegment is specified on the frame.
+ ErrFrameSizeExceeded = errors.New("frame size exceeded")
+
+ // ErrFrameSizeMismatch is returned if the stated frame size does not match the expected size.
+ // This is only returned if SingleSegment is specified on the frame.
+ ErrFrameSizeMismatch = errors.New("frame size does not match size on stream")
+
+ // ErrCRCMismatch is returned if CRC mismatches.
+ ErrCRCMismatch = errors.New("CRC check failed")
+
+ // ErrDecoderClosed will be returned if the Decoder was used after
+ // Close has been called.
+ ErrDecoderClosed = errors.New("decoder used after Close")
+
+ // ErrEncoderClosed will be returned if the Encoder was used after
+ // Close has been called.
+ ErrEncoderClosed = errors.New("encoder used after Close")
+
+ // ErrDecoderNilInput is returned when a nil Reader was provided
+ // and an operation other than Reset/DecodeAll/Close was attempted.
+ ErrDecoderNilInput = errors.New("nil input provided as reader")
+)
+
+func println(a ...interface{}) {
+ if debug || debugDecoder || debugEncoder {
+ log.Println(a...)
+ }
+}
+
+func printf(format string, a ...interface{}) {
+ if debug || debugDecoder || debugEncoder {
+ log.Printf(format, a...)
+ }
+}
+
+func load3232(b []byte, i int32) uint32 {
+ return binary.LittleEndian.Uint32(b[:len(b):len(b)][i:])
+}
+
+func load6432(b []byte, i int32) uint64 {
+ return binary.LittleEndian.Uint64(b[:len(b):len(b)][i:])
+}
+
+type byter interface {
+ Bytes() []byte
+ Len() int
+}
+
+var _ byter = &bytes.Buffer{}
diff --git a/vendor/github.com/linode/linodego/.gitignore b/vendor/github.com/linode/linodego/.gitignore
index cec47a06..a076b73c 100644
--- a/vendor/github.com/linode/linodego/.gitignore
+++ b/vendor/github.com/linode/linodego/.gitignore
@@ -21,3 +21,4 @@
vendor/**/
.env
coverage.txt
+go.work.sum
diff --git a/vendor/github.com/linode/linodego/.gitmodules b/vendor/github.com/linode/linodego/.gitmodules
index df7dc11d..1a19a1c1 100644
--- a/vendor/github.com/linode/linodego/.gitmodules
+++ b/vendor/github.com/linode/linodego/.gitmodules
@@ -1,3 +1,3 @@
-[submodule "tod_scripts"]
- path = tod_scripts
- url = https://github.com/linode/TOD-test-report-uploader.git
+[submodule "e2e_scripts"]
+ path = e2e_scripts
+ url = https://github.com/linode/dx-e2e-test-scripts
diff --git a/vendor/github.com/linode/linodego/.golangci.yml b/vendor/github.com/linode/linodego/.golangci.yml
index bc15e56d..5bd4cdc1 100644
--- a/vendor/github.com/linode/linodego/.golangci.yml
+++ b/vendor/github.com/linode/linodego/.golangci.yml
@@ -7,22 +7,15 @@ linters-settings:
check-blank: true
govet:
- check-shadowing: true
-
enable:
- atomicalign
- enable-all: false
- disable:
- shadow
+ enable-all: false
disable-all: false
- golint:
- min-confidence: 0.8
gocyclo:
min-complexity: 30
gocognit:
min-complexity: 30
- maligned:
- suggest-new: true
dupl:
threshold: 100
@@ -30,10 +23,7 @@ linters:
enable-all: true
disable:
# deprecated linters
- - deadcode
- - ifshort
- - varcheck
- - nosnakecase
+ - exportloopref
####################
# conflicted with go fmt
@@ -42,24 +32,21 @@ linters:
# workaround to avoid linter failures of getting malformed json
- musttag
+ - err113
+
- bodyclose
- contextcheck
- nilerr
- noctx
- rowserrcheck
- sqlclosecheck
- - structcheck
- tparallel
- - vetshadow
- errname
- forcetypeassert
- gocyclo
- unparam
- nakedret
- lll
- - golint
- - maligned
- - scopelint
- dupl
- gosec
- gochecknoinits
@@ -70,15 +57,11 @@ linters:
- staticcheck
- stylecheck
- wsl
- - interfacer
- varnamelen
- tagliatelle
- - gomnd
- nlreturn
- wrapcheck
- wastedassign
- - goerr113
- - exhaustivestruct
- durationcheck
- errorlint
- cyclop
@@ -87,4 +70,6 @@ linters:
- depguard
- tagalign
- inamedparam
+ - perfsprint
+ - recvcheck
fast: false
diff --git a/vendor/github.com/linode/linodego/Makefile b/vendor/github.com/linode/linodego/Makefile
index 3597c2a7..1296b577 100644
--- a/vendor/github.com/linode/linodego/Makefile
+++ b/vendor/github.com/linode/linodego/Makefile
@@ -25,9 +25,10 @@ citest: lint test
testunit:
go test -v $(PACKAGES) $(ARGS)
+ cd test && make testunit
testint:
- cd test && make test
+ cd test && make testint
testcov-func:
@go test -v -coverprofile="coverage.txt" . > /dev/null 2>&1
@@ -76,7 +77,7 @@ run_fixtures:
LINODE_API_VERSION="v4beta" \
LINODE_URL="$(LINODE_URL)" \
GO111MODULE="on" \
- go test -timeout=$(TEST_TIMEOUT) -v $(ARGS)
+ go test --tags $(TEST_TAGS) -timeout=$(TEST_TIMEOUT) -v $(ARGS)
sanitize:
@echo "* Sanitizing fixtures"
diff --git a/vendor/github.com/linode/linodego/README.md b/vendor/github.com/linode/linodego/README.md
index cf73b4df..4eb779a0 100644
--- a/vendor/github.com/linode/linodego/README.md
+++ b/vendor/github.com/linode/linodego/README.md
@@ -1,11 +1,11 @@
# linodego
-![Tests](https://img.shields.io/github/actions/workflow/status/linode/linodego/test.yml?branch=main)
+![Tests](https://img.shields.io/github/actions/workflow/status/linode/linodego/ci.yml?branch=main)
[![Release](https://img.shields.io/github/v/release/linode/linodego)](https://github.com/linode/linodego/releases/latest)
[![GoDoc](https://godoc.org/github.com/linode/linodego?status.svg)](https://godoc.org/github.com/linode/linodego)
[![Go Report Card](https://goreportcard.com/badge/github.com/linode/linodego)](https://goreportcard.com/report/github.com/linode/linodego)
-Go client for [Linode REST v4 API](https://developers.linode.com/api/v4)
+Go client for [Linode REST v4 API](https://techdocs.akamai.com/linode-api/reference/api)
## Installation
@@ -17,7 +17,7 @@ go get -u github.com/linode/linodego
See [godoc](https://godoc.org/github.com/linode/linodego) for a complete reference.
-The API generally follows the naming patterns prescribed in the [OpenAPIv3 document for Linode APIv4](https://developers.linode.com/api/v4).
+The API generally follows the naming patterns prescribed in the [OpenAPIv3 document for Linode APIv4](https://techdocs.akamai.com/linode-api/reference/api).
Deviations in naming have been made to avoid using "Linode" and "Instance" redundantly or inconsistently.
@@ -33,36 +33,35 @@ package main
import (
"context"
"fmt"
-
- "github.com/linode/linodego"
- "golang.org/x/oauth2"
-
"log"
"net/http"
"os"
+
+ "github.com/linode/linodego"
+ "golang.org/x/oauth2"
)
func main() {
- apiKey, ok := os.LookupEnv("LINODE_TOKEN")
- if !ok {
- log.Fatal("Could not find LINODE_TOKEN, please assert it is set.")
- }
- tokenSource := oauth2.StaticTokenSource(&oauth2.Token{AccessToken: apiKey})
-
- oauth2Client := &http.Client{
- Transport: &oauth2.Transport{
- Source: tokenSource,
- },
- }
-
- linodeClient := linodego.NewClient(oauth2Client)
- linodeClient.SetDebug(true)
-
- res, err := linodeClient.GetInstance(context.Background(), 4090913)
- if err != nil {
- log.Fatal(err)
- }
- fmt.Printf("%v", res)
+ apiKey, ok := os.LookupEnv("LINODE_TOKEN")
+ if !ok {
+ log.Fatal("Could not find LINODE_TOKEN, please assert it is set.")
+ }
+ tokenSource := oauth2.StaticTokenSource(&oauth2.Token{AccessToken: apiKey})
+
+ oauth2Client := &http.Client{
+ Transport: &oauth2.Transport{
+ Source: tokenSource,
+ },
+ }
+
+ linodeClient := linodego.NewClient(oauth2Client)
+ linodeClient.SetDebug(true)
+
+ res, err := linodeClient.GetInstance(context.Background(), 4090913)
+ if err != nil {
+ log.Fatal(err)
+ }
+ fmt.Printf("%v", res)
}
```
@@ -99,6 +98,11 @@ values are set in the supplied ListOptions.
// opts.Results == 218
```
+> **_NOTES:_**
+> - The ListOptions will be mutated by list endpoint functions.
+> - Instances of ListOptions should NOT be shared across multiple list endpoint functions.
+> - The resulting number of results and pages can be accessed through the user-supplied ListOptions instance.
+
#### Filtering
```go
diff --git a/vendor/github.com/linode/linodego/account.go b/vendor/github.com/linode/linodego/account.go
index 03d3297f..a743e778 100644
--- a/vendor/github.com/linode/linodego/account.go
+++ b/vendor/github.com/linode/linodego/account.go
@@ -1,6 +1,12 @@
package linodego
-import "context"
+import (
+ "context"
+ "encoding/json"
+ "time"
+
+ "github.com/linode/linodego/internal/parseabletime"
+)
// Account associated with the token in use.
type Account struct {
@@ -20,6 +26,64 @@ type Account struct {
Phone string `json:"phone"`
CreditCard *CreditCard `json:"credit_card"`
EUUID string `json:"euuid"`
+ BillingSource string `json:"billing_source"`
+ Capabilities []string `json:"capabilities"`
+ ActiveSince *time.Time `json:"active_since"`
+ ActivePromotions []Promotion `json:"active_promotions"`
+}
+
+// AccountUpdateOptions fields are those accepted by UpdateAccount
+type AccountUpdateOptions struct {
+ Address1 string `json:"address_1,omitempty"`
+ Address2 string `json:"address_2,omitempty"`
+ City string `json:"city,omitempty"`
+ Company string `json:"company,omitempty"`
+ Country string `json:"country,omitempty"`
+ Email string `json:"email,omitempty"`
+ FirstName string `json:"first_name,omitempty"`
+ LastName string `json:"last_name,omitempty"`
+ Phone string `json:"phone,omitempty"`
+ State string `json:"state,omitempty"`
+ TaxID string `json:"tax_id,omitempty"`
+ Zip string `json:"zip,omitempty"`
+}
+
+// GetUpdateOptions converts an Account to AccountUpdateOptions for use in UpdateAccount
+func (i Account) GetUpdateOptions() (o AccountUpdateOptions) {
+ o.Address1 = i.Address1
+ o.Address2 = i.Address2
+ o.City = i.City
+ o.Company = i.Company
+ o.Country = i.Country
+ o.Email = i.Email
+ o.FirstName = i.FirstName
+ o.LastName = i.LastName
+ o.Phone = i.Phone
+ o.State = i.State
+ o.TaxID = i.TaxID
+ o.Zip = i.Zip
+
+ return
+}
+
+// UnmarshalJSON implements the json.Unmarshaler interface
+func (i *Account) UnmarshalJSON(b []byte) error {
+ type Mask Account
+
+ p := struct {
+ *Mask
+ ActiveSince *parseabletime.ParseableTime `json:"active_since"`
+ }{
+ Mask: (*Mask)(i),
+ }
+
+ if err := json.Unmarshal(b, &p); err != nil {
+ return err
+ }
+
+ i.ActiveSince = (*time.Time)(p.ActiveSince)
+
+ return nil
}
// CreditCard information associated with the Account.
@@ -30,12 +94,10 @@ type CreditCard struct {
// GetAccount gets the contact and billing information related to the Account.
func (c *Client) GetAccount(ctx context.Context) (*Account, error) {
- e := "account"
- req := c.R(ctx).SetResult(&Account{})
- r, err := coupleAPIErrors(req.Get(e))
- if err != nil {
- return nil, err
- }
+ return doGETRequest[Account](ctx, c, "account")
+}
- return r.Result().(*Account), nil
+// UpdateAccount updates the Account
+func (c *Client) UpdateAccount(ctx context.Context, opts AccountUpdateOptions) (*Account, error) {
+ return doPUTRequest[Account](ctx, c, "account", opts)
}
diff --git a/vendor/github.com/linode/linodego/account_agreements.go b/vendor/github.com/linode/linodego/account_agreements.go
new file mode 100644
index 00000000..18150652
--- /dev/null
+++ b/vendor/github.com/linode/linodego/account_agreements.go
@@ -0,0 +1,37 @@
+package linodego
+
+import "context"
+
+// AccountAgreements represents the agreements and their acceptance status for an Account
+type AccountAgreements struct {
+ EUModel bool `json:"eu_model"`
+ MasterServiceAgreement bool `json:"master_service_agreement"`
+ PrivacyPolicy bool `json:"privacy_policy"`
+}
+
+// AccountAgreementsUpdateOptions fields are those accepted by UpdateAccountAgreements
+type AccountAgreementsUpdateOptions struct {
+ EUModel bool `json:"eu_model,omitempty"`
+ MasterServiceAgreement bool `json:"master_service_agreement,omitempty"`
+ PrivacyPolicy bool `json:"privacy_policy,omitempty"`
+}
+
+// GetUpdateOptions converts an AccountAgreements to AccountAgreementsUpdateOptions for use in UpdateAccountAgreements
+func (i AccountAgreements) GetUpdateOptions() (o AccountAgreementsUpdateOptions) {
+ o.EUModel = i.EUModel
+ o.MasterServiceAgreement = i.MasterServiceAgreement
+ o.PrivacyPolicy = i.PrivacyPolicy
+
+ return
+}
+
+// GetAccountAgreements gets all agreements and their acceptance status for the Account.
+func (c *Client) GetAccountAgreements(ctx context.Context) (*AccountAgreements, error) {
+ return doGETRequest[AccountAgreements](ctx, c, "account/agreements")
+}
+
+// AcknowledgeAccountAgreements acknowledges account agreements for the Account
+func (c *Client) AcknowledgeAccountAgreements(ctx context.Context, opts AccountAgreementsUpdateOptions) error {
+ _, err := doPOSTRequest[AccountAgreements](ctx, c, "account/agreements", opts)
+ return err
+}
diff --git a/vendor/github.com/linode/linodego/account_availability.go b/vendor/github.com/linode/linodego/account_availability.go
index 9a846415..3824f77b 100644
--- a/vendor/github.com/linode/linodego/account_availability.go
+++ b/vendor/github.com/linode/linodego/account_availability.go
@@ -2,61 +2,37 @@ package linodego
import (
"context"
- "fmt"
- "net/url"
-
- "github.com/go-resty/resty/v2"
)
-// AccountAvailability returns the resources information in a region which are NOT available to an account.
+// AccountAvailability returns the resources availability in a region to an account.
type AccountAvailability struct {
// region id
Region string `json:"region"`
// the unavailable resources in a region to the customer
Unavailable []string `json:"unavailable"`
-}
-// AccountAvailabilityPagedResponse represents a paginated Account Availability API response
-type AccountAvailabilityPagedResponse struct {
- *PageOptions
- Data []AccountAvailability `json:"data"`
+ // the available resources in a region to the customer
+ Available []string `json:"available"`
}
-// endpoint gets the endpoint URL for AccountAvailability
-func (AccountAvailabilityPagedResponse) endpoint(_ ...any) string {
- return "/account/availability"
-}
-
-func (resp *AccountAvailabilityPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(AccountAvailabilityPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*AccountAvailabilityPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
-// ListAccountAvailabilities lists all available regions and the resources which are NOT available to the account.
+// ListAccountAvailabilities lists all regions and the resource availabilities to the account.
func (c *Client) ListAccountAvailabilities(ctx context.Context, opts *ListOptions) ([]AccountAvailability, error) {
- response := AccountAvailabilityPagedResponse{}
- err := c.listHelper(ctx, &response, opts)
+ response, err := getPaginatedResults[AccountAvailability](ctx, c, "account/availability", opts)
if err != nil {
return nil, err
}
- return response.Data, nil
+
+ return response, nil
}
-// GetAccountAvailability gets the unavailable resources in a region to the customer.
+// GetAccountAvailability gets the resources availability in a region to the customer.
func (c *Client) GetAccountAvailability(ctx context.Context, regionID string) (*AccountAvailability, error) {
- req := c.R(ctx).SetResult(&AccountAvailability{})
- regionID = url.PathEscape(regionID)
- b := fmt.Sprintf("account/availability/%s", regionID)
- r, err := coupleAPIErrors(req.Get(b))
+ b := formatAPIPath("account/availability/%s", regionID)
+ response, err := doGETRequest[AccountAvailability](ctx, c, b)
if err != nil {
return nil, err
}
- return r.Result().(*AccountAvailability), nil
+ return response, nil
}
diff --git a/vendor/github.com/linode/linodego/account_betas.go b/vendor/github.com/linode/linodego/account_betas.go
index 0897a4a7..830905a0 100644
--- a/vendor/github.com/linode/linodego/account_betas.go
+++ b/vendor/github.com/linode/linodego/account_betas.go
@@ -3,11 +3,8 @@ package linodego
import (
"context"
"encoding/json"
- "fmt"
- "net/url"
"time"
- "github.com/go-resty/resty/v2"
"github.com/linode/linodego/internal/parseabletime"
)
@@ -28,17 +25,6 @@ type AccountBetaProgramCreateOpts struct {
ID string `json:"id"`
}
-// AccountBetasPagedResponse represents a paginated Account Beta Programs API response
-type AccountBetasPagedResponse struct {
- *PageOptions
- Data []AccountBetaProgram `json:"data"`
-}
-
-// endpoint gets the endpoint URL for AccountBetaProgram
-func (AccountBetasPagedResponse) endpoint(_ ...any) string {
- return "/account/betas"
-}
-
// UnmarshalJSON implements the json.Unmarshaler interface
func (cBeta *AccountBetaProgram) UnmarshalJSON(b []byte) error {
type Mask AccountBetaProgram
@@ -63,52 +49,35 @@ func (cBeta *AccountBetaProgram) UnmarshalJSON(b []byte) error {
return nil
}
-func (resp *AccountBetasPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(AccountBetasPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*AccountBetasPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListAccountBetaPrograms lists all beta programs an account is enrolled in.
func (c *Client) ListAccountBetaPrograms(ctx context.Context, opts *ListOptions) ([]AccountBetaProgram, error) {
- response := AccountBetasPagedResponse{}
- err := c.listHelper(ctx, &response, opts)
+ response, err := getPaginatedResults[AccountBetaProgram](ctx, c, "/account/betas", opts)
if err != nil {
return nil, err
}
- return response.Data, nil
+
+ return response, nil
}
// GetAccountBetaProgram gets the details of a beta program an account is enrolled in.
func (c *Client) GetAccountBetaProgram(ctx context.Context, betaID string) (*AccountBetaProgram, error) {
- req := c.R(ctx).SetResult(&AccountBetaProgram{})
- betaID = url.PathEscape(betaID)
- b := fmt.Sprintf("/account/betas/%s", betaID)
- r, err := coupleAPIErrors(req.Get(b))
+ b := formatAPIPath("/account/betas/%s", betaID)
+
+ response, err := doGETRequest[AccountBetaProgram](ctx, c, b)
if err != nil {
return nil, err
}
- return r.Result().(*AccountBetaProgram), nil
+ return response, nil
}
// JoinBetaProgram enrolls an account into a beta program.
func (c *Client) JoinBetaProgram(ctx context.Context, opts AccountBetaProgramCreateOpts) (*AccountBetaProgram, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
e := "account/betas"
- req := c.R(ctx).SetResult(&AccountBetaProgram{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Post(e))
+ response, err := doPOSTRequest[AccountBetaProgram](ctx, c, e, opts)
if err != nil {
return nil, err
}
- return r.Result().(*AccountBetaProgram), nil
+ return response, nil
}
diff --git a/vendor/github.com/linode/linodego/account_child.go b/vendor/github.com/linode/linodego/account_child.go
new file mode 100644
index 00000000..c11a9d3e
--- /dev/null
+++ b/vendor/github.com/linode/linodego/account_child.go
@@ -0,0 +1,47 @@
+package linodego
+
+import (
+ "context"
+)
+
+// ChildAccount represents an account under the current account.
+// NOTE: This is an alias to prevent any future breaking changes.
+type ChildAccount = Account
+
+// ChildAccountToken represents a short-lived token created using
+// the CreateChildAccountToken(...) function.
+// NOTE: This is an alias to prevent any future breaking changes.
+type ChildAccountToken = Token
+
+// ListChildAccounts lists child accounts under the current account.
+// NOTE: Parent/Child related features may not be generally available.
+func (c *Client) ListChildAccounts(ctx context.Context, opts *ListOptions) ([]ChildAccount, error) {
+ return getPaginatedResults[ChildAccount](
+ ctx,
+ c,
+ "account/child-accounts",
+ opts,
+ )
+}
+
+// GetChildAccount gets a single child accounts under the current account.
+// NOTE: Parent/Child related features may not be generally available.
+func (c *Client) GetChildAccount(ctx context.Context, euuid string) (*ChildAccount, error) {
+ return doGETRequest[ChildAccount](
+ ctx,
+ c,
+ formatAPIPath("account/child-accounts/%s", euuid),
+ )
+}
+
+// CreateChildAccountToken creates a short-lived token that can be used to
+// access the Linode API under a child account.
+// The attributes of this token are not currently configurable.
+// NOTE: Parent/Child related features may not be generally available.
+func (c *Client) CreateChildAccountToken(ctx context.Context, euuid string) (*ChildAccountToken, error) {
+ return doPOSTRequest[ChildAccountToken, any](
+ ctx,
+ c,
+ formatAPIPath("account/child-accounts/%s/token", euuid),
+ )
+}
diff --git a/vendor/github.com/linode/linodego/account_events.go b/vendor/github.com/linode/linodego/account_events.go
index 8a9d9667..faf4186e 100644
--- a/vendor/github.com/linode/linodego/account_events.go
+++ b/vendor/github.com/linode/linodego/account_events.go
@@ -3,10 +3,8 @@ package linodego
import (
"context"
"encoding/json"
- "fmt"
"time"
- "github.com/go-resty/resty/v2"
"github.com/linode/linodego/internal/duration"
"github.com/linode/linodego/internal/parseabletime"
)
@@ -48,6 +46,12 @@ type Event struct {
// When this Event was created.
Created *time.Time `json:"-"`
+
+ // Provides additional information about the event.
+ Message string `json:"message"`
+
+ // The total duration in seconds that it takes for the Event to complete.
+ Duration float64 `json:"duration"`
}
// EventAction constants start with Action and include all known Linode API Event Actions.
@@ -62,7 +66,7 @@ const (
ActionBackupsRestore EventAction = "backups_restore"
ActionCommunityQuestionReply EventAction = "community_question_reply"
ActionCommunityLike EventAction = "community_like"
- ActionCreateCardUpdated EventAction = "credit_card_updated"
+ ActionCreditCardUpdated EventAction = "credit_card_updated"
ActionDatabaseCreate EventAction = "database_create"
ActionDatabaseDegraded EventAction = "database_degraded"
ActionDatabaseDelete EventAction = "database_delete"
@@ -127,6 +131,9 @@ const (
ActionLinodeConfigUpdate EventAction = "linode_config_update"
ActionLishBoot EventAction = "lish_boot"
ActionLKENodeCreate EventAction = "lke_node_create"
+ ActionLKEControlPlaneACLCreate EventAction = "lke_control_plane_acl_create"
+ ActionLKEControlPlaneACLUpdate EventAction = "lke_control_plane_acl_update"
+ ActionLKEControlPlaneACLDelete EventAction = "lke_control_plane_acl_delete"
ActionLongviewClientCreate EventAction = "longviewclient_create"
ActionLongviewClientDelete EventAction = "longviewclient_delete"
ActionLongviewClientUpdate EventAction = "longviewclient_update"
@@ -149,15 +156,26 @@ const (
ActionOAuthClientDelete EventAction = "oauth_client_delete"
ActionOAuthClientSecretReset EventAction = "oauth_client_secret_reset" //#nosec G101
ActionOAuthClientUpdate EventAction = "oauth_client_update"
+ ActionOBJAccessKeyCreate EventAction = "obj_access_key_create"
+ ActionOBJAccessKeyDelete EventAction = "obj_access_key_delete"
+ ActionOBJAccessKeyUpdate EventAction = "obj_access_key_update"
ActionPaymentMethodAdd EventAction = "payment_method_add"
ActionPaymentSubmitted EventAction = "payment_submitted"
ActionPasswordReset EventAction = "password_reset"
+ ActionPlacementGroupCreate EventAction = "placement_group_create"
+ ActionPlacementGroupUpdate EventAction = "placement_group_update"
+ ActionPlacementGroupDelete EventAction = "placement_group_delete"
+ ActionPlacementGroupAssign EventAction = "placement_group_assign"
+ ActionPlacementGroupUnassign EventAction = "placement_group_unassign"
+ ActionPlacementGroupBecameNonCompliant EventAction = "placement_group_became_non_compliant"
+ ActionPlacementGroupBecameCompliant EventAction = "placement_group_became_compliant"
ActionProfileUpdate EventAction = "profile_update"
ActionStackScriptCreate EventAction = "stackscript_create"
ActionStackScriptDelete EventAction = "stackscript_delete"
ActionStackScriptUpdate EventAction = "stackscript_update"
ActionStackScriptPublicize EventAction = "stackscript_publicize"
ActionStackScriptRevise EventAction = "stackscript_revise"
+ ActionTaxIDInvalid EventAction = "tax_id_invalid"
ActionTagCreate EventAction = "tag_create"
ActionTagDelete EventAction = "tag_delete"
ActionTFADisabled EventAction = "tfa_disabled"
@@ -190,9 +208,13 @@ const (
ActionVPCSubnetDelete EventAction = "subnet_delete"
ActionVPCSubnetUpdate EventAction = "subnet_update"
- // deprecated due to incorrect spelling,
+ // Deprecated: incorrect spelling,
// to be removed in the next major version release.
ActionVolumeDelte EventAction = "volume_delete"
+
+ // Deprecated: incorrect spelling,
+ // to be removed in the next major version
+ ActionCreateCardUpdated = ActionCreditCardUpdated
)
// EntityType constants start with Entity and include Linode API Event Entity Types
@@ -200,14 +222,32 @@ type EntityType string
// EntityType contants are the entities an Event can be related to.
const (
- EntityLinode EntityType = "linode"
- EntityDisk EntityType = "disk"
- EntityDatabase EntityType = "database"
- EntityDomain EntityType = "domain"
- EntityFirewall EntityType = "firewall"
- EntityNodebalancer EntityType = "nodebalancer"
- EntityVPC EntityType = "vpc"
- EntityVPCSubnet EntityType = "subnet"
+ EntityAccount EntityType = "account"
+ EntityBackups EntityType = "backups"
+ EntityCommunity EntityType = "community"
+ EntityDatabase EntityType = "database"
+ EntityDisk EntityType = "disk"
+ EntityDomain EntityType = "domain"
+ EntityTransfer EntityType = "entity_transfer"
+ EntityFirewall EntityType = "firewall"
+ EntityImage EntityType = "image"
+ EntityIPAddress EntityType = "ipaddress"
+ EntityLinode EntityType = "linode"
+ EntityLongview EntityType = "longview"
+ EntityManagedService EntityType = "managed_service"
+ EntityNodebalancer EntityType = "nodebalancer"
+ EntityOAuthClient EntityType = "oauth_client"
+ EntityPlacementGroup EntityType = "placement_group"
+ EntityProfile EntityType = "profile"
+ EntityStackscript EntityType = "stackscript"
+ EntityTag EntityType = "tag"
+ EntityTicket EntityType = "ticket"
+ EntityToken EntityType = "token"
+ EntityUser EntityType = "user"
+ EntityUserSSHKey EntityType = "user_ssh_key"
+ EntityVolume EntityType = "volume"
+ EntityVPC EntityType = "vpc"
+ EntityVPCSubnet EntityType = "subnet"
)
// EventStatus constants start with Event and include Linode API Event Status values
@@ -234,17 +274,6 @@ type EventEntity struct {
URL string `json:"url"`
}
-// EventsPagedResponse represents a paginated Events API response
-type EventsPagedResponse struct {
- *PageOptions
- Data []Event `json:"data"`
-}
-
-// endpoint gets the endpoint URL for Event
-func (EventsPagedResponse) endpoint(_ ...any) string {
- return "account/events"
-}
-
// UnmarshalJSON implements the json.Unmarshaler interface
func (i *Event) UnmarshalJSON(b []byte) error {
type Mask Event
@@ -267,51 +296,39 @@ func (i *Event) UnmarshalJSON(b []byte) error {
return nil
}
-func (resp *EventsPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(EventsPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*EventsPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListEvents gets a collection of Event objects representing actions taken
// on the Account. The Events returned depend on the token grants and the grants
// of the associated user.
func (c *Client) ListEvents(ctx context.Context, opts *ListOptions) ([]Event, error) {
- response := EventsPagedResponse{}
- err := c.listHelper(ctx, &response, opts)
+ response, err := getPaginatedResults[Event](ctx, c, "account/events", opts)
if err != nil {
return nil, err
}
- return response.Data, nil
+ return response, nil
}
// GetEvent gets the Event with the Event ID
func (c *Client) GetEvent(ctx context.Context, eventID int) (*Event, error) {
- req := c.R(ctx).SetResult(&Event{})
- e := fmt.Sprintf("account/events/%d", eventID)
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("account/events/%d", eventID)
+ response, err := doGETRequest[Event](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*Event), nil
+ return response, nil
}
// MarkEventRead marks a single Event as read.
func (c *Client) MarkEventRead(ctx context.Context, event *Event) error {
- e := fmt.Sprintf("account/events/%d/read", event.ID)
- _, err := coupleAPIErrors(c.R(ctx).Post(e))
+ e := formatAPIPath("account/events/%d/read", event.ID)
+ _, err := doPOSTRequest[Event](ctx, c, e, []any{})
return err
}
// MarkEventsSeen marks all Events up to and including this Event by ID as seen.
func (c *Client) MarkEventsSeen(ctx context.Context, event *Event) error {
- e := fmt.Sprintf("account/events/%d/seen", event.ID)
- _, err := coupleAPIErrors(c.R(ctx).Post(e))
+ e := formatAPIPath("account/events/%d/seen", event.ID)
+ _, err := doPOSTRequest[Event](ctx, c, e, []any{})
return err
}
diff --git a/vendor/github.com/linode/linodego/account_invoices.go b/vendor/github.com/linode/linodego/account_invoices.go
index d068662f..52b131ab 100644
--- a/vendor/github.com/linode/linodego/account_invoices.go
+++ b/vendor/github.com/linode/linodego/account_invoices.go
@@ -3,64 +3,50 @@ package linodego
import (
"context"
"encoding/json"
- "fmt"
"time"
- "github.com/go-resty/resty/v2"
"github.com/linode/linodego/internal/parseabletime"
)
// Invoice structs reflect an invoice for billable activity on the account.
type Invoice struct {
- ID int `json:"id"`
- Label string `json:"label"`
- Total float32 `json:"total"`
- Date *time.Time `json:"-"`
+ ID int `json:"id"`
+ Label string `json:"label"`
+ Total float32 `json:"total"`
+ Date *time.Time `json:"-"`
+ Tax float32 `json:"tax"`
+ Subtotal float32 `json:"subtotal"`
+ BillingSource string `json:"billing_source"`
+ TaxSummary []InvoiceTaxSummary `json:"tax_summary"`
+}
+
+type InvoiceTaxSummary struct {
+ Tax float32 `json:"tax"`
+ Name string `json:"name"`
}
// InvoiceItem structs reflect a single billable activity associate with an Invoice
type InvoiceItem struct {
Label string `json:"label"`
Type string `json:"type"`
- UnitPrice int `json:"unitprice"`
+ UnitPrice float32 `json:"unit_price"`
Quantity int `json:"quantity"`
Amount float32 `json:"amount"`
Tax float32 `json:"tax"`
Region *string `json:"region"`
From *time.Time `json:"-"`
To *time.Time `json:"-"`
-}
-
-// InvoicesPagedResponse represents a paginated Invoice API response
-type InvoicesPagedResponse struct {
- *PageOptions
- Data []Invoice `json:"data"`
-}
-
-// endpoint gets the endpoint URL for Invoice
-func (InvoicesPagedResponse) endpoint(_ ...any) string {
- return "account/invoices"
-}
-
-func (resp *InvoicesPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(InvoicesPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*InvoicesPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
+ Total float32 `json:"total"`
}
// ListInvoices gets a paginated list of Invoices against the Account
func (c *Client) ListInvoices(ctx context.Context, opts *ListOptions) ([]Invoice, error) {
- response := InvoicesPagedResponse{}
- err := c.listHelper(ctx, &response, opts)
+ response, err := getPaginatedResults[Invoice](ctx, c, "account/invoices", opts)
if err != nil {
return nil, err
}
- return response.Data, nil
+ return response, nil
}
// UnmarshalJSON implements the json.Unmarshaler interface
@@ -107,45 +93,21 @@ func (i *InvoiceItem) UnmarshalJSON(b []byte) error {
// GetInvoice gets a single Invoice matching the provided ID
func (c *Client) GetInvoice(ctx context.Context, invoiceID int) (*Invoice, error) {
- req := c.R(ctx).SetResult(&Invoice{})
- e := fmt.Sprintf("account/invoices/%d", invoiceID)
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("account/invoices/%d", invoiceID)
+ response, err := doGETRequest[Invoice](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*Invoice), nil
-}
-
-// InvoiceItemsPagedResponse represents a paginated Invoice Item API response
-type InvoiceItemsPagedResponse struct {
- *PageOptions
- Data []InvoiceItem `json:"data"`
-}
-
-// endpoint gets the endpoint URL for InvoiceItems associated with a specific Invoice
-func (InvoiceItemsPagedResponse) endpoint(ids ...any) string {
- id := ids[0].(int)
- return fmt.Sprintf("account/invoices/%d/items", id)
-}
-
-func (resp *InvoiceItemsPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(InvoiceItemsPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*InvoiceItemsPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
+ return response, nil
}
// ListInvoiceItems gets the invoice items associated with a specific Invoice
func (c *Client) ListInvoiceItems(ctx context.Context, invoiceID int, opts *ListOptions) ([]InvoiceItem, error) {
- response := InvoiceItemsPagedResponse{}
- err := c.listHelper(ctx, &response, opts, invoiceID)
+ response, err := getPaginatedResults[InvoiceItem](ctx, c, formatAPIPath("account/invoices/%d/items", invoiceID), opts)
if err != nil {
return nil, err
}
- return response.Data, nil
+ return response, nil
}
diff --git a/vendor/github.com/linode/linodego/account_logins.go b/vendor/github.com/linode/linodego/account_logins.go
index 9b5f69a9..45f2a5f2 100644
--- a/vendor/github.com/linode/linodego/account_logins.go
+++ b/vendor/github.com/linode/linodego/account_logins.go
@@ -3,10 +3,8 @@ package linodego
import (
"context"
"encoding/json"
- "fmt"
"time"
- "github.com/go-resty/resty/v2"
"github.com/linode/linodego/internal/parseabletime"
)
@@ -19,33 +17,13 @@ type Login struct {
Status string `json:"status"`
}
-type LoginsPagedResponse struct {
- *PageOptions
- Data []Login `json:"data"`
-}
-
-func (LoginsPagedResponse) endpoint(_ ...any) string {
- return "account/logins"
-}
-
-func (resp *LoginsPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(LoginsPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*LoginsPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
func (c *Client) ListLogins(ctx context.Context, opts *ListOptions) ([]Login, error) {
- response := LoginsPagedResponse{}
- err := c.listHelper(ctx, &response, opts)
+ response, err := getPaginatedResults[Login](ctx, c, "account/logins", opts)
if err != nil {
return nil, err
}
- return response.Data, nil
+ return response, nil
}
// UnmarshalJSON implements the json.Unmarshaler interface
@@ -69,12 +47,12 @@ func (i *Login) UnmarshalJSON(b []byte) error {
}
func (c *Client) GetLogin(ctx context.Context, loginID int) (*Login, error) {
- req := c.R(ctx).SetResult(&Login{})
- e := fmt.Sprintf("account/logins/%d", loginID)
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("account/logins/%d", loginID)
+
+ response, err := doGETRequest[Login](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*Login), nil
+ return response, nil
}
diff --git a/vendor/github.com/linode/linodego/account_maintenance.go b/vendor/github.com/linode/linodego/account_maintenance.go
new file mode 100644
index 00000000..c1047164
--- /dev/null
+++ b/vendor/github.com/linode/linodego/account_maintenance.go
@@ -0,0 +1,51 @@
+package linodego
+
+import (
+ "context"
+ "encoding/json"
+ "time"
+
+ "github.com/linode/linodego/internal/parseabletime"
+)
+
+// AccountMaintenance represents a Maintenance object for any entity a user has permissions to view
+type AccountMaintenance struct {
+ Entity *Entity `json:"entity"`
+ Reason string `json:"reason"`
+ Status string `json:"status"`
+ Type string `json:"type"`
+ When *time.Time `json:"when"`
+}
+
+// The entity being affected by maintenance
+type Entity struct {
+ ID int `json:"id"`
+ Label string `json:"label"`
+ Type string `json:"type"`
+ URL string `json:"url"`
+}
+
+// UnmarshalJSON implements the json.Unmarshaler interface
+func (accountMaintenance *AccountMaintenance) UnmarshalJSON(b []byte) error {
+ type Mask AccountMaintenance
+
+ p := struct {
+ *Mask
+ When *parseabletime.ParseableTime `json:"when"`
+ }{
+ Mask: (*Mask)(accountMaintenance),
+ }
+
+ if err := json.Unmarshal(b, &p); err != nil {
+ return err
+ }
+
+ accountMaintenance.When = (*time.Time)(p.When)
+
+ return nil
+}
+
+// ListMaintenances lists Account Maintenance objects for any entity a user has permissions to view
+func (c *Client) ListMaintenances(ctx context.Context, opts *ListOptions) ([]AccountMaintenance, error) {
+ return getPaginatedResults[AccountMaintenance](ctx, c, "account/maintenance", opts)
+}
diff --git a/vendor/github.com/linode/linodego/account_notifications.go b/vendor/github.com/linode/linodego/account_notifications.go
index df65bd3e..3820f090 100644
--- a/vendor/github.com/linode/linodego/account_notifications.go
+++ b/vendor/github.com/linode/linodego/account_notifications.go
@@ -5,7 +5,6 @@ import (
"encoding/json"
"time"
- "github.com/go-resty/resty/v2"
"github.com/linode/linodego/internal/parseabletime"
)
@@ -57,40 +56,18 @@ const (
NotificationMaintenance NotificationType = "maintenance"
)
-// NotificationsPagedResponse represents a paginated Notifications API response
-type NotificationsPagedResponse struct {
- *PageOptions
- Data []Notification `json:"data"`
-}
-
-// endpoint gets the endpoint URL for Notification
-func (NotificationsPagedResponse) endpoint(_ ...any) string {
- return "account/notifications"
-}
-
-func (resp *NotificationsPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(NotificationsPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*NotificationsPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListNotifications gets a collection of Notification objects representing important,
// often time-sensitive items related to the Account. An account cannot interact directly with
// Notifications, and a Notification will disappear when the circumstances causing it
// have been resolved. For example, if the account has an important Ticket open, a response
// to the Ticket will dismiss the Notification.
func (c *Client) ListNotifications(ctx context.Context, opts *ListOptions) ([]Notification, error) {
- response := NotificationsPagedResponse{}
- err := c.listHelper(ctx, &response, opts)
+ response, err := getPaginatedResults[Notification](ctx, c, "account/notifications", opts)
if err != nil {
return nil, err
}
- return response.Data, nil
+ return response, nil
}
// UnmarshalJSON implements the json.Unmarshaler interface
diff --git a/vendor/github.com/linode/linodego/account_oauth_client.go b/vendor/github.com/linode/linodego/account_oauth_client.go
index dba898d2..6f2a57a1 100644
--- a/vendor/github.com/linode/linodego/account_oauth_client.go
+++ b/vendor/github.com/linode/linodego/account_oauth_client.go
@@ -2,11 +2,6 @@ package linodego
import (
"context"
- "encoding/json"
- "fmt"
- "net/url"
-
- "github.com/go-resty/resty/v2"
)
// OAuthClientStatus constants start with OAuthClient and include Linode API Instance Status values
@@ -85,92 +80,52 @@ func (i OAuthClient) GetUpdateOptions() (o OAuthClientUpdateOptions) {
return
}
-// OAuthClientsPagedResponse represents a paginated OAuthClient API response
-type OAuthClientsPagedResponse struct {
- *PageOptions
- Data []OAuthClient `json:"data"`
-}
-
-// endpoint gets the endpoint URL for OAuthClient
-func (OAuthClientsPagedResponse) endpoint(_ ...any) string {
- return "account/oauth-clients"
-}
-
-func (resp *OAuthClientsPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(OAuthClientsPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*OAuthClientsPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListOAuthClients lists OAuthClients
func (c *Client) ListOAuthClients(ctx context.Context, opts *ListOptions) ([]OAuthClient, error) {
- response := OAuthClientsPagedResponse{}
- err := c.listHelper(ctx, &response, opts)
+ response, err := getPaginatedResults[OAuthClient](ctx, c, "account/oauth-clients", opts)
if err != nil {
return nil, err
}
- return response.Data, nil
+ return response, nil
}
// GetOAuthClient gets the OAuthClient with the provided ID
func (c *Client) GetOAuthClient(ctx context.Context, clientID string) (*OAuthClient, error) {
- req := c.R(ctx).SetResult(&OAuthClient{})
- clientID = url.PathEscape(clientID)
- e := fmt.Sprintf("account/oauth-clients/%s", clientID)
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("account/oauth-clients/%s", clientID)
+ response, err := doGETRequest[OAuthClient](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*OAuthClient), nil
+ return response, nil
}
// CreateOAuthClient creates an OAuthClient
func (c *Client) CreateOAuthClient(ctx context.Context, opts OAuthClientCreateOptions) (*OAuthClient, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
- req := c.R(ctx).SetResult(&OAuthClient{}).SetBody(string(body))
e := "account/oauth-clients"
- r, err := coupleAPIErrors(req.Post(e))
+ response, err := doPOSTRequest[OAuthClient](ctx, c, e, opts)
if err != nil {
return nil, err
}
- return r.Result().(*OAuthClient), nil
+ return response, nil
}
// UpdateOAuthClient updates the OAuthClient with the specified id
func (c *Client) UpdateOAuthClient(ctx context.Context, clientID string, opts OAuthClientUpdateOptions) (*OAuthClient, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
- req := c.R(ctx).SetResult(&OAuthClient{}).SetBody(string(body))
-
- clientID = url.PathEscape(clientID)
-
- e := fmt.Sprintf("account/oauth-clients/%s", clientID)
- r, err := coupleAPIErrors(req.Put(e))
+ e := formatAPIPath("account/oauth-clients/%s", clientID)
+ response, err := doPUTRequest[OAuthClient](ctx, c, e, opts)
if err != nil {
return nil, err
}
- return r.Result().(*OAuthClient), nil
+ return response, nil
}
// DeleteOAuthClient deletes the OAuthClient with the specified id
func (c *Client) DeleteOAuthClient(ctx context.Context, clientID string) error {
- clientID = url.PathEscape(clientID)
- e := fmt.Sprintf("account/oauth-clients/%s", clientID)
- _, err := coupleAPIErrors(c.R(ctx).Delete(e))
+ e := formatAPIPath("account/oauth-clients/%s", clientID)
+ err := doDELETERequest(ctx, c, e)
return err
}
diff --git a/vendor/github.com/linode/linodego/account_payment_methods.go b/vendor/github.com/linode/linodego/account_payment_methods.go
new file mode 100644
index 00000000..2afcc3bc
--- /dev/null
+++ b/vendor/github.com/linode/linodego/account_payment_methods.go
@@ -0,0 +1,165 @@
+package linodego
+
+import (
+ "context"
+ "encoding/json"
+ "fmt"
+ "time"
+
+ "github.com/linode/linodego/internal/parseabletime"
+)
+
+// PaymentMethod represents a PaymentMethod object
+type PaymentMethod struct {
+ // The unique ID of the Payment Method.
+ ID int `json:"id"`
+
+ // When the Payment Method was created.
+ Created *time.Time `json:"created"`
+
+ // Whether this Payment Method is the default method for automatically processing service charges.
+ IsDefault bool `json:"is_default"`
+
+ // The type of Payment Method.
+ Type string `json:"type"`
+
+ // The detailed data for the Payment Method, which can be of varying types.
+ Data interface{} `json:"data"`
+}
+
+// PaymentMethodDataCreditCard represents a PaymentMethodDataCreditCard object
+type PaymentMethodDataCreditCard struct {
+ // The type of credit card.
+ CardType string `json:"card_type"`
+
+ // The expiration month and year of the credit card.
+ Expiry string `json:"expiry"`
+
+ // The last four digits of the credit card number.
+ LastFour string `json:"last_four"`
+}
+
+// PaymentMethodDataGooglePay represents a PaymentMethodDataGooglePay object
+type PaymentMethodDataGooglePay struct {
+ // The type of credit card.
+ CardType string `json:"card_type"`
+
+ // The expiration month and year of the credit card.
+ Expiry string `json:"expiry"`
+
+ // The last four digits of the credit card number.
+ LastFour string `json:"last_four"`
+}
+
+// PaymentMethodDataPaypal represents a PaymentMethodDataPaypal object
+type PaymentMethodDataPaypal struct {
+ // The email address associated with your PayPal account.
+ Email string `json:"email"`
+
+ // PayPal Merchant ID associated with your PayPal account.
+ PaypalID string `json:"paypal_id"`
+}
+
+// PaymentMethodCreateOptions fields are those accepted by CreatePaymentMethod
+type PaymentMethodCreateOptions struct {
+ // Whether this Payment Method is the default method for automatically processing service charges.
+ IsDefault bool `json:"is_default"`
+
+ // The type of Payment Method. Alternative payment methods including Google Pay and PayPal can be added using the Cloud Manager.
+ Type string `json:"type"`
+
+ // An object representing the credit card information you have on file with Linode to make Payments against your Account.
+ Data *PaymentMethodCreateOptionsData `json:"data"`
+}
+
+type PaymentMethodCreateOptionsData struct {
+ // Your credit card number. No spaces or hyphens (-) allowed.
+ CardNumber string `json:"card_number"`
+
+ // CVV (Card Verification Value) of the credit card, typically found on the back of the card.
+ CVV string `json:"cvv"`
+
+ // A value from 1-12 representing the expiration month of your credit card.
+ ExpiryMonth int `json:"expiry_month"`
+
+ // A four-digit integer representing the expiration year of your credit card.
+ ExpiryYear int `json:"expiry_year"`
+}
+
+// UnmarshalJSON implements the json.Unmarshaler interface
+func (i *PaymentMethod) UnmarshalJSON(b []byte) error {
+ if len(b) == 0 || string(b) == "{}" || string(b) == "null" {
+ return nil
+ }
+
+ type Mask PaymentMethod
+
+ pm := &struct {
+ *Mask
+ Created *parseabletime.ParseableTime `json:"created"`
+ Data json.RawMessage `json:"data"`
+ }{
+ Mask: (*Mask)(i),
+ }
+
+ if err := json.Unmarshal(b, &pm); err != nil {
+ return err
+ }
+
+ // Process Data based on the Type field
+ switch i.Type {
+ case "credit_card":
+ var creditCardData PaymentMethodDataCreditCard
+ if err := json.Unmarshal(pm.Data, &creditCardData); err != nil {
+ return err
+ }
+ i.Data = creditCardData
+ case "google_pay":
+ var googlePayData PaymentMethodDataGooglePay
+ if err := json.Unmarshal(pm.Data, &googlePayData); err != nil {
+ return err
+ }
+ i.Data = googlePayData
+ case "paypal":
+ var paypalData PaymentMethodDataPaypal
+ if err := json.Unmarshal(pm.Data, &paypalData); err != nil {
+ return err
+ }
+ i.Data = paypalData
+ default:
+ return fmt.Errorf("unknown payment method type: %s", i.Type)
+ }
+
+ i.Created = (*time.Time)(pm.Created)
+ return nil
+}
+
+// ListPaymentMethods lists PaymentMethods
+func (c *Client) ListPaymentMethods(ctx context.Context, opts *ListOptions) ([]PaymentMethod, error) {
+ return getPaginatedResults[PaymentMethod](ctx, c, "account/payment-methods", opts)
+}
+
+// GetPaymentMethod gets the payment method with the provided ID
+func (c *Client) GetPaymentMethod(ctx context.Context, paymentMethodID int) (*PaymentMethod, error) {
+ e := formatAPIPath("account/payment-methods/%d", paymentMethodID)
+ return doGETRequest[PaymentMethod](ctx, c, e)
+}
+
+// DeletePaymentMethod deletes the payment method with the provided ID
+func (c *Client) DeletePaymentMethod(ctx context.Context, paymentMethodID int) error {
+ e := formatAPIPath("account/payment-methods/%d", paymentMethodID)
+ return doDELETERequest(ctx, c, e)
+}
+
+// AddPaymentMethod adds the provided payment method to the account
+func (c *Client) AddPaymentMethod(ctx context.Context, opts PaymentMethodCreateOptions) error {
+ _, err := doPOSTRequest[PaymentMethod, any](ctx, c, "account/payment-methods", opts)
+ return err
+}
+
+// SetDefaultPaymentMethod sets the payment method with the provided ID as the default
+func (c *Client) SetDefaultPaymentMethod(ctx context.Context, paymentMethodID int) error {
+ e := formatAPIPath("account/payment-methods/%d", paymentMethodID)
+ _, err := doPOSTRequest[PaymentMethod, any](ctx, c, e)
+ return err
+}
diff --git a/vendor/github.com/linode/linodego/account_payments.go b/vendor/github.com/linode/linodego/account_payments.go
index a2fe17b6..dc43c008 100644
--- a/vendor/github.com/linode/linodego/account_payments.go
+++ b/vendor/github.com/linode/linodego/account_payments.go
@@ -3,10 +3,8 @@ package linodego
import (
"context"
"encoding/json"
- "fmt"
"time"
- "github.com/go-resty/resty/v2"
"github.com/linode/linodego/internal/parseabletime"
)
@@ -57,63 +55,34 @@ func (i Payment) GetCreateOptions() (o PaymentCreateOptions) {
return
}
-// PaymentsPagedResponse represents a paginated Payment API response
-type PaymentsPagedResponse struct {
- *PageOptions
- Data []Payment `json:"data"`
-}
-
-// endpoint gets the endpoint URL for Payment
-func (PaymentsPagedResponse) endpoint(_ ...any) string {
- return "account/payments"
-}
-
-func (resp *PaymentsPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(PaymentsPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*PaymentsPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListPayments lists Payments
func (c *Client) ListPayments(ctx context.Context, opts *ListOptions) ([]Payment, error) {
- response := PaymentsPagedResponse{}
- err := c.listHelper(ctx, &response, opts)
+ response, err := getPaginatedResults[Payment](ctx, c, "account/payments", opts)
if err != nil {
return nil, err
}
- return response.Data, nil
+ return response, nil
}
// GetPayment gets the payment with the provided ID
func (c *Client) GetPayment(ctx context.Context, paymentID int) (*Payment, error) {
- req := c.R(ctx).SetResult(&Payment{})
- e := fmt.Sprintf("account/payments/%d", paymentID)
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("account/payments/%d", paymentID)
+ response, err := doGETRequest[Payment](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*Payment), nil
+ return response, nil
}
// CreatePayment creates a Payment
func (c *Client) CreatePayment(ctx context.Context, opts PaymentCreateOptions) (*Payment, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
- req := c.R(ctx).SetResult(&Payment{}).SetBody(string(body))
- e := "accounts/payments"
- r, err := coupleAPIErrors(req.Post(e))
+ e := "account/payments"
+ response, err := doPOSTRequest[Payment](ctx, c, e, opts)
if err != nil {
return nil, err
}
- return r.Result().(*Payment), nil
+ return response, nil
}
diff --git a/vendor/github.com/linode/linodego/account_promo_credits.go b/vendor/github.com/linode/linodego/account_promo_credits.go
new file mode 100644
index 00000000..a40dc243
--- /dev/null
+++ b/vendor/github.com/linode/linodego/account_promo_credits.go
@@ -0,0 +1,67 @@
+package linodego
+
+import (
+ "context"
+ "encoding/json"
+ "time"
+
+ "github.com/linode/linodego/internal/parseabletime"
+)
+
+// Promotion represents a Promotion object
+type Promotion struct {
+ // The amount available to spend per month.
+ CreditMonthlyCap string `json:"credit_monthly_cap"`
+
+ // The total amount of credit left for this promotion.
+ CreditRemaining string `json:"credit_remaining"`
+
+ // A detailed description of this promotion.
+ Description string `json:"description"`
+
+ // When this promotion's credits expire.
+ ExpirationDate *time.Time `json:"-"`
+
+ // The location of an image for this promotion.
+ ImageURL string `json:"image_url"`
+
+ // The service to which this promotion applies.
+ ServiceType string `json:"service_type"`
+
+ // Short details of this promotion.
+ Summary string `json:"summary"`
+
+ // The amount of credit left for this month for this promotion.
+ ThisMonthCreditRemaining string `json:"this_month_credit_remaining"`
+}
+
+// PromoCodeCreateOptions fields are those accepted by AddPromoCode
+type PromoCodeCreateOptions struct {
+ // The Promo Code.
+ PromoCode string `json:"promo_code"`
+}
+
+// UnmarshalJSON implements the json.Unmarshaler interface
+func (i *Promotion) UnmarshalJSON(b []byte) error {
+ type Mask Promotion
+
+ p := struct {
+ *Mask
+ ExpirationDate *parseabletime.ParseableTime `json:"date"`
+ }{
+ Mask: (*Mask)(i),
+ }
+
+ if err := json.Unmarshal(b, &p); err != nil {
+ return err
+ }
+
+ i.ExpirationDate = (*time.Time)(p.ExpirationDate)
+
+ return nil
+}
+
+// AddPromoCode adds the provided promo code to the account
+func (c *Client) AddPromoCode(ctx context.Context, opts PromoCodeCreateOptions) (*Promotion, error) {
+ return doPOSTRequest[Promotion, any](ctx, c, "account/promo-codes", opts)
+}
diff --git a/vendor/github.com/linode/linodego/account_settings.go b/vendor/github.com/linode/linodego/account_settings.go
index 9a4b1362..5edef5be 100644
--- a/vendor/github.com/linode/linodego/account_settings.go
+++ b/vendor/github.com/linode/linodego/account_settings.go
@@ -2,7 +2,6 @@ package linodego
import (
"context"
- "encoding/json"
)
// AccountSettings are the account wide flags or plans that effect new resources
@@ -38,29 +37,24 @@ type AccountSettingsUpdateOptions struct {
// GetAccountSettings gets the account wide flags or plans that effect new resources
func (c *Client) GetAccountSettings(ctx context.Context) (*AccountSettings, error) {
- req := c.R(ctx).SetResult(&AccountSettings{})
e := "account/settings"
- r, err := coupleAPIErrors(req.Get(e))
+
+ response, err := doGETRequest[AccountSettings](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*AccountSettings), nil
+ return response, nil
}
// UpdateAccountSettings updates the settings associated with the account
func (c *Client) UpdateAccountSettings(ctx context.Context, opts AccountSettingsUpdateOptions) (*AccountSettings, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
- req := c.R(ctx).SetResult(&AccountSettings{}).SetBody(string(body))
e := "account/settings"
- r, err := coupleAPIErrors(req.Put(e))
+
+ response, err := doPUTRequest[AccountSettings](ctx, c, e, opts)
if err != nil {
return nil, err
}
- return r.Result().(*AccountSettings), nil
+ return response, nil
}
diff --git a/vendor/github.com/linode/linodego/account_transfer.go b/vendor/github.com/linode/linodego/account_transfer.go
index 11557302..1420f278 100644
--- a/vendor/github.com/linode/linodego/account_transfer.go
+++ b/vendor/github.com/linode/linodego/account_transfer.go
@@ -22,12 +22,12 @@ type AccountTransferRegion struct {
// GetAccountTransfer gets current Account's network utilization for the current month.
func (c *Client) GetAccountTransfer(ctx context.Context) (*AccountTransfer, error) {
- req := c.R(ctx).SetResult(&AccountTransfer{})
e := "account/transfer"
- r, err := coupleAPIErrors(req.Get(e))
+
+ response, err := doGETRequest[AccountTransfer](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*AccountTransfer), nil
+ return response, nil
}
diff --git a/vendor/github.com/linode/linodego/account_user_grants.go b/vendor/github.com/linode/linodego/account_user_grants.go
index 221fb5f7..f0ca1dc7 100644
--- a/vendor/github.com/linode/linodego/account_user_grants.go
+++ b/vendor/github.com/linode/linodego/account_user_grants.go
@@ -2,9 +2,6 @@ package linodego
import (
"context"
- "encoding/json"
- "fmt"
- "net/url"
)
type GrantPermissionLevel string
@@ -69,30 +66,21 @@ type UserGrantsUpdateOptions struct {
}
func (c *Client) GetUserGrants(ctx context.Context, username string) (*UserGrants, error) {
- username = url.PathEscape(username)
- e := fmt.Sprintf("account/users/%s/grants", username)
- req := c.R(ctx).SetResult(&UserGrants{})
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("account/users/%s/grants", username)
+ response, err := doGETRequest[UserGrants](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*UserGrants), nil
+ return response, nil
}
func (c *Client) UpdateUserGrants(ctx context.Context, username string, opts UserGrantsUpdateOptions) (*UserGrants, error) {
- body, err := json.Marshal(opts)
+ e := formatAPIPath("account/users/%s/grants", username)
+ response, err := doPUTRequest[UserGrants](ctx, c, e, opts)
if err != nil {
return nil, err
}
- username = url.PathEscape(username)
- e := fmt.Sprintf("account/users/%s/grants", username)
- req := c.R(ctx).SetResult(&UserGrants{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Put(e))
- if err != nil {
- return nil, err
- }
-
- return r.Result().(*UserGrants), nil
+ return response, nil
}
diff --git a/vendor/github.com/linode/linodego/account_users.go b/vendor/github.com/linode/linodego/account_users.go
index d9633d88..88615fa8 100644
--- a/vendor/github.com/linode/linodego/account_users.go
+++ b/vendor/github.com/linode/linodego/account_users.go
@@ -3,18 +3,32 @@ package linodego
import (
"context"
"encoding/json"
- "fmt"
- "net/url"
"time"
- "github.com/go-resty/resty/v2"
"github.com/linode/linodego/internal/parseabletime"
)
+type UserType string
+
+const (
+ UserTypeProxy UserType = "proxy"
+ UserTypeParent UserType = "parent"
+ UserTypeChild UserType = "child"
+ UserTypeDefault UserType = "default"
+)
+
+// LastLogin represents a LastLogin object
+type LastLogin struct {
+ LoginDatetime *time.Time `json:"-"`
+ Status string `json:"status"`
+}
+
// User represents a User object
type User struct {
Username string `json:"username"`
Email string `json:"email"`
+ LastLogin *LastLogin `json:"last_login"`
+ UserType UserType `json:"user_type"`
Restricted bool `json:"restricted"`
TFAEnabled bool `json:"tfa_enabled"`
SSHKeys []string `json:"ssh_keys"`
@@ -35,6 +49,26 @@ type UserUpdateOptions struct {
Restricted *bool `json:"restricted,omitempty"`
}
+// UnmarshalJSON implements the json.Unmarshaler interface
+func (ll *LastLogin) UnmarshalJSON(b []byte) error {
+ type Mask LastLogin
+
+ p := struct {
+ *Mask
+ LoginDatetime *parseabletime.ParseableTime `json:"login_datetime"`
+ }{
+ Mask: (*Mask)(ll),
+ }
+
+ if err := json.Unmarshal(b, &p); err != nil {
+ return err
+ }
+
+ ll.LoginDatetime = (*time.Time)(p.LoginDatetime)
+
+ return nil
+}
+
// UnmarshalJSON implements the json.Unmarshaler interface
func (i *User) UnmarshalJSON(b []byte) error {
type Mask User
@@ -72,91 +106,53 @@ func (i User) GetUpdateOptions() (o UserUpdateOptions) {
return
}
-// UsersPagedResponse represents a paginated User API response
-type UsersPagedResponse struct {
- *PageOptions
- Data []User `json:"data"`
-}
-
-// endpoint gets the endpoint URL for User
-func (UsersPagedResponse) endpoint(_ ...any) string {
- return "account/users"
-}
-
-func (resp *UsersPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(UsersPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*UsersPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListUsers lists Users on the account
func (c *Client) ListUsers(ctx context.Context, opts *ListOptions) ([]User, error) {
- response := UsersPagedResponse{}
- err := c.listHelper(ctx, &response, opts)
+ response, err := getPaginatedResults[User](ctx, c, "account/users", opts)
if err != nil {
return nil, err
}
- return response.Data, nil
+ return response, nil
}
// GetUser gets the user with the provided ID
func (c *Client) GetUser(ctx context.Context, userID string) (*User, error) {
- userID = url.PathEscape(userID)
- e := fmt.Sprintf("account/users/%s", userID)
- req := c.R(ctx).SetResult(&User{})
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("account/users/%s", userID)
+ response, err := doGETRequest[User](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*User), nil
+ return response, nil
}
// CreateUser creates a User. The email address must be confirmed before the
// User account can be accessed.
func (c *Client) CreateUser(ctx context.Context, opts UserCreateOptions) (*User, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
e := "account/users"
- req := c.R(ctx).SetResult(&User{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Post(e))
+ response, err := doPOSTRequest[User](ctx, c, e, opts)
if err != nil {
return nil, err
}
- return r.Result().(*User), nil
+ return response, nil
}
// UpdateUser updates the User with the specified id
func (c *Client) UpdateUser(ctx context.Context, userID string, opts UserUpdateOptions) (*User, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
- userID = url.PathEscape(userID)
- e := fmt.Sprintf("account/users/%s", userID)
- req := c.R(ctx).SetResult(&User{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Put(e))
+ e := formatAPIPath("account/users/%s", userID)
+ response, err := doPUTRequest[User](ctx, c, e, opts)
if err != nil {
return nil, err
}
- return r.Result().(*User), nil
+ return response, nil
}
// DeleteUser deletes the User with the specified id
func (c *Client) DeleteUser(ctx context.Context, userID string) error {
- userID = url.PathEscape(userID)
- e := fmt.Sprintf("account/users/%s", userID)
- _, err := coupleAPIErrors(c.R(ctx).Delete(e))
+ e := formatAPIPath("account/users/%s", userID)
+ err := doDELETERequest(ctx, c, e)
return err
}
diff --git a/vendor/github.com/linode/linodego/base_types.go b/vendor/github.com/linode/linodego/base_types.go
new file mode 100644
index 00000000..dbaafe31
--- /dev/null
+++ b/vendor/github.com/linode/linodego/base_types.go
@@ -0,0 +1,29 @@
+// This package contains various type-related base classes intended
+// to be used in composition across type structures in this project.
+
+package linodego
+
+// baseType is a base struct containing the core fields of a resource type
+// returned from the Linode API.
+type baseType[PriceType any, RegionPriceType any] struct {
+ ID string `json:"id"`
+ Label string `json:"label"`
+ Price PriceType `json:"price"`
+ RegionPrices []RegionPriceType `json:"region_prices"`
+ Transfer int `json:"transfer"`
+}
+
+// baseTypePrice is a base struct containing the core fields of a resource type's
+// base price.
+type baseTypePrice struct {
+ Hourly float64 `json:"hourly"`
+ Monthly float64 `json:"monthly"`
+}
+
+// baseTypeRegionPrice is a base struct containing the core fields of a resource type's
+// region-specific price.
+type baseTypeRegionPrice struct {
+ baseTypePrice
+
+ ID string `json:"id"`
+}
diff --git a/vendor/github.com/linode/linodego/betas.go b/vendor/github.com/linode/linodego/betas.go
index 9cd84ad5..8f90220d 100644
--- a/vendor/github.com/linode/linodego/betas.go
+++ b/vendor/github.com/linode/linodego/betas.go
@@ -3,11 +3,8 @@ package linodego
import (
"context"
"encoding/json"
- "fmt"
- "net/url"
"time"
- "github.com/go-resty/resty/v2"
"github.com/linode/linodego/internal/parseabletime"
)
@@ -32,17 +29,6 @@ type BetaProgram struct {
MoreInfo string `json:"more_info"`
}
-// BetasPagedResponse represents a paginated Beta Programs API response
-type BetasPagedResponse struct {
- *PageOptions
- Data []BetaProgram `json:"data"`
-}
-
-// endpoint gets the endpoint URL for BetaProgram
-func (BetasPagedResponse) endpoint(_ ...any) string {
- return "/betas"
-}
-
// UnmarshalJSON implements the json.Unmarshaler interface
func (beta *BetaProgram) UnmarshalJSON(b []byte) error {
type Mask BetaProgram
@@ -65,35 +51,23 @@ func (beta *BetaProgram) UnmarshalJSON(b []byte) error {
return nil
}
-func (resp *BetasPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(BetasPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*BetasPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListBetaPrograms lists active beta programs
func (c *Client) ListBetaPrograms(ctx context.Context, opts *ListOptions) ([]BetaProgram, error) {
- response := BetasPagedResponse{}
- err := c.listHelper(ctx, &response, opts)
+ response, err := getPaginatedResults[BetaProgram](ctx, c, "/betas", opts)
if err != nil {
return nil, err
}
- return response.Data, nil
+
+ return response, nil
}
// GetBetaProgram gets the beta program's detail with the ID
func (c *Client) GetBetaProgram(ctx context.Context, betaID string) (*BetaProgram, error) {
- req := c.R(ctx).SetResult(&BetaProgram{})
- betaID = url.PathEscape(betaID)
- b := fmt.Sprintf("betas/%s", betaID)
- r, err := coupleAPIErrors(req.Get(b))
+ e := formatAPIPath("betas/%s", betaID)
+ response, err := doGETRequest[BetaProgram](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*BetaProgram), nil
+ return response, nil
}
diff --git a/vendor/github.com/linode/linodego/client.go b/vendor/github.com/linode/linodego/client.go
index a2d676f5..beafdbc1 100644
--- a/vendor/github.com/linode/linodego/client.go
+++ b/vendor/github.com/linode/linodego/client.go
@@ -1,8 +1,11 @@
package linodego
import (
+ "bytes"
"context"
+ "encoding/json"
"fmt"
+ "io"
"log"
"net/http"
"net/url"
@@ -10,8 +13,11 @@ import (
"path"
"path/filepath"
"reflect"
+ "regexp"
"strconv"
+ "strings"
"sync"
+ "text/template"
"time"
"github.com/go-resty/resty/v2"
@@ -26,7 +32,8 @@ const (
APIHost = "api.linode.com"
// APIHostVar environment var to check for alternate API URL
APIHostVar = "LINODE_URL"
- // APIHostCert environment var containing path to CA cert to validate against
+ // APIHostCert environment var containing path to CA cert to validate against.
+ // Note that the custom CA cannot be configured together with a custom HTTP Transport.
APIHostCert = "LINODE_CA"
// APIVersion Linode API version
APIVersion = "v4"
@@ -39,7 +46,22 @@ const (
// APISecondsPerPoll how frequently to poll for new Events or Status in WaitFor functions
APISecondsPerPoll = 3
// Maximum wait time for retries
- APIRetryMaxWaitTime = time.Duration(30) * time.Second
+ APIRetryMaxWaitTime = time.Duration(30) * time.Second
+ APIDefaultCacheExpiration = time.Minute * 15
+)
+
+//nolint:unused
+var (
+ reqLogTemplate = template.Must(template.New("request").Parse(`Sending request:
+Method: {{.Method}}
+URL: {{.URL}}
+Headers: {{.Headers}}
+Body: {{.Body}}`))
+
+ respLogTemplate = template.Must(template.New("response").Parse(`Received response:
+Status: {{.Status}}
+Headers: {{.Headers}}
+Body: {{.Body}}`))
)
var envDebug = false
@@ -82,12 +104,13 @@ type clientCacheEntry struct {
}
type (
- Request = resty.Request
- Logger = resty.Logger
+ Request = resty.Request
+ Response = resty.Response
+ Logger = resty.Logger
)
func init() {
- // Wether or not we will enable Resty debugging output
+ // Whether we will enable Resty debugging output
if apiDebug, ok := os.LookupEnv("LINODE_DEBUG"); ok {
if parsed, err := strconv.ParseBool(apiDebug); err == nil {
envDebug = parsed
@@ -106,6 +129,238 @@ func (c *Client) SetUserAgent(ua string) *Client {
return c
}
+type RequestParams struct {
+ Body any
+ Response any
+}
+
+// Generic helper to execute HTTP requests using the net/http package
+//
+// nolint:unused, funlen, gocognit
+func (c *httpClient) doRequest(ctx context.Context, method, url string, params RequestParams) error {
+ var (
+ req *http.Request
+ bodyBuffer *bytes.Buffer
+ resp *http.Response
+ err error
+ )
+
+ for range httpDefaultRetryCount {
+ req, bodyBuffer, err = c.createRequest(ctx, method, url, params)
+ if err != nil {
+ return err
+ }
+
+ if err = c.applyBeforeRequest(req); err != nil {
+ return err
+ }
+
+ if c.debug && c.logger != nil {
+ c.logRequest(req, method, url, bodyBuffer)
+ }
+
+ processResponse := func() error {
+ defer func() {
+ closeErr := resp.Body.Close()
+ if closeErr != nil && err == nil {
+ err = closeErr
+ }
+ }()
+ if err = c.checkHTTPError(resp); err != nil {
+ return err
+ }
+ if c.debug && c.logger != nil {
+ var logErr error
+ resp, logErr = c.logResponse(resp)
+ if logErr != nil {
+ return logErr
+ }
+ }
+ if params.Response != nil {
+ if err = c.decodeResponseBody(resp, params.Response); err != nil {
+ return err
+ }
+ }
+
+ // Apply after-response mutations
+ if err = c.applyAfterResponse(resp); err != nil {
+ return err
+ }
+
+ return nil
+ }
+
+ resp, err = c.sendRequest(req)
+ if err == nil {
+ if err = processResponse(); err == nil {
+ return nil
+ }
+ }
+
+ if !c.shouldRetry(resp, err) {
+ break
+ }
+
+ retryAfter, retryErr := c.retryAfter(resp)
+ if retryErr != nil {
+ return retryErr
+ }
+
+ // Sleep for the specified duration before retrying.
+ // If retryAfter is 0 (i.e., Retry-After header is not found),
+ // no delay is applied.
+ time.Sleep(retryAfter)
+ }
+
+ return err
+}
+
+// nolint:unused
+func (c *httpClient) shouldRetry(resp *http.Response, err error) bool {
+ for _, retryConditional := range c.retryConditionals {
+ if retryConditional(resp, err) {
+ return true
+ }
+ }
+ return false
+}
+
+// nolint:unused
+func (c *httpClient) createRequest(ctx context.Context, method, url string, params RequestParams) (*http.Request, *bytes.Buffer, error) {
+ var bodyReader io.Reader
+ var bodyBuffer *bytes.Buffer
+
+ if params.Body != nil {
+ bodyBuffer = new(bytes.Buffer)
+ if err := json.NewEncoder(bodyBuffer).Encode(params.Body); err != nil {
+ if c.debug && c.logger != nil {
+ c.logger.Errorf("failed to encode body: %v", err)
+ }
+ return nil, nil, fmt.Errorf("failed to encode body: %w", err)
+ }
+ bodyReader = bodyBuffer
+ }
+
+ req, err := http.NewRequestWithContext(ctx, method, url, bodyReader)
+ if err != nil {
+ if c.debug && c.logger != nil {
+ c.logger.Errorf("failed to create request: %v", err)
+ }
+ return nil, nil, fmt.Errorf("failed to create request: %w", err)
+ }
+
+ req.Header.Set("Content-Type", "application/json")
+ req.Header.Set("Accept", "application/json")
+ if c.userAgent != "" {
+ req.Header.Set("User-Agent", c.userAgent)
+ }
+
+ return req, bodyBuffer, nil
+}
+
+// nolint:unused
+func (c *httpClient) applyBeforeRequest(req *http.Request) error {
+ for _, mutate := range c.onBeforeRequest {
+ if err := mutate(req); err != nil {
+ if c.debug && c.logger != nil {
+ c.logger.Errorf("failed to mutate before request: %v", err)
+ }
+ return fmt.Errorf("failed to mutate before request: %w", err)
+ }
+ }
+ return nil
+}
+
+// nolint:unused
+func (c *httpClient) applyAfterResponse(resp *http.Response) error {
+ for _, mutate := range c.onAfterResponse {
+ if err := mutate(resp); err != nil {
+ if c.debug && c.logger != nil {
+ c.logger.Errorf("failed to mutate after response: %v", err)
+ }
+ return fmt.Errorf("failed to mutate after response: %w", err)
+ }
+ }
+ return nil
+}
+
+// nolint:unused
+func (c *httpClient) logRequest(req *http.Request, method, url string, bodyBuffer *bytes.Buffer) {
+ var reqBody string
+ if bodyBuffer != nil {
+ reqBody = bodyBuffer.String()
+ } else {
+ reqBody = "nil"
+ }
+
+ var logBuf bytes.Buffer
+ err := reqLogTemplate.Execute(&logBuf, map[string]interface{}{
+ "Method": method,
+ "URL": url,
+ "Headers": req.Header,
+ "Body": reqBody,
+ })
+ if err == nil {
+ c.logger.Debugf(logBuf.String())
+ }
+}
+
+// nolint:unused
+func (c *httpClient) sendRequest(req *http.Request) (*http.Response, error) {
+ resp, err := c.httpClient.Do(req)
+ if err != nil {
+ if c.debug && c.logger != nil {
+ c.logger.Errorf("failed to send request: %v", err)
+ }
+ return nil, fmt.Errorf("failed to send request: %w", err)
+ }
+ return resp, nil
+}
+
+// nolint:unused
+func (c *httpClient) checkHTTPError(resp *http.Response) error {
+ _, err := coupleAPIErrorsHTTP(resp, nil)
+ if err != nil {
+ if c.debug && c.logger != nil {
+ c.logger.Errorf("received HTTP error: %v", err)
+ }
+ return err
+ }
+ return nil
+}
+
+// nolint:unused
+func (c *httpClient) logResponse(resp *http.Response) (*http.Response, error) {
+ var respBody bytes.Buffer
+ if _, err := io.Copy(&respBody, resp.Body); err != nil {
+ c.logger.Errorf("failed to read response body: %v", err)
+ }
+
+ var logBuf bytes.Buffer
+ err := respLogTemplate.Execute(&logBuf, map[string]interface{}{
+ "Status": resp.Status,
+ "Headers": resp.Header,
+ "Body": respBody.String(),
+ })
+ if err == nil {
+ c.logger.Debugf(logBuf.String())
+ }
+
+ resp.Body = io.NopCloser(bytes.NewReader(respBody.Bytes()))
+ return resp, nil
+}
+
+// nolint:unused
+func (c *httpClient) decodeResponseBody(resp *http.Response, response interface{}) error {
+ if err := json.NewDecoder(resp.Body).Decode(response); err != nil {
+ if c.debug && c.logger != nil {
+ c.logger.Errorf("failed to decode response: %v", err)
+ }
+ return fmt.Errorf("failed to decode response: %w", err)
+ }
+ return nil
+}
+
// R wraps resty's R method
func (c *Client) R(ctx context.Context) *resty.Request {
return c.resty.R().
@@ -131,13 +386,79 @@ func (c *Client) SetLogger(logger Logger) *Client {
return c
}
+//nolint:unused
+func (c *httpClient) httpSetDebug(debug bool) *httpClient {
+ c.debug = debug
+
+ return c
+}
+
+//nolint:unused
+func (c *httpClient) httpSetLogger(logger httpLogger) *httpClient {
+ c.logger = logger
+
+ return c
+}
+
// OnBeforeRequest adds a handler to the request body to run before the request is sent
func (c *Client) OnBeforeRequest(m func(request *Request) error) {
- c.resty.OnBeforeRequest(func(client *resty.Client, req *resty.Request) error {
+ c.resty.OnBeforeRequest(func(_ *resty.Client, req *resty.Request) error {
+ return m(req)
+ })
+}
+
+// OnAfterResponse adds a handler to the request body to run before the request is sent
+func (c *Client) OnAfterResponse(m func(response *Response) error) {
+ c.resty.OnAfterResponse(func(_ *resty.Client, req *resty.Response) error {
return m(req)
})
}
+// nolint:unused
+func (c *httpClient) httpOnBeforeRequest(m func(*http.Request) error) *httpClient {
+ c.onBeforeRequest = append(c.onBeforeRequest, m)
+
+ return c
+}
+
+// nolint:unused
+func (c *httpClient) httpOnAfterResponse(m func(*http.Response) error) *httpClient {
+ c.onAfterResponse = append(c.onAfterResponse, m)
+
+ return c
+}
+
+// UseURL parses the individual components of the given API URL and configures the client
+// accordingly. For example, a valid URL.
+// For example:
+//
+// client.UseURL("https://api.test.linode.com/v4beta")
+func (c *Client) UseURL(apiURL string) (*Client, error) {
+ parsedURL, err := url.Parse(apiURL)
+ if err != nil {
+ return nil, fmt.Errorf("failed to parse URL: %w", err)
+ }
+
+ // Create a new URL excluding the path to use as the base URL
+ baseURL := &url.URL{
+ Host: parsedURL.Host,
+ Scheme: parsedURL.Scheme,
+ }
+
+ c.SetBaseURL(baseURL.String())
+
+ versionMatches := regexp.MustCompile(`/v[a-zA-Z0-9]+`).FindAllString(parsedURL.Path, -1)
+
+ // Only set the version if a version is found in the URL, else use the default
+ if len(versionMatches) > 0 {
+ c.SetAPIVersion(
+ strings.Trim(versionMatches[len(versionMatches)-1], "/"),
+ )
+ }
+
+ return c, nil
+}
+
// SetBaseURL sets the base URL of the Linode v4 API (https://api.linode.com/v4)
func (c *Client) SetBaseURL(baseURL string) *Client {
baseURLPath, _ := url.Parse(baseURL)
@@ -334,14 +655,14 @@ func (c *Client) UseCache(value bool) {
}
// SetRetryMaxWaitTime sets the maximum delay before retrying a request.
-func (c *Client) SetRetryMaxWaitTime(max time.Duration) *Client {
- c.resty.SetRetryMaxWaitTime(max)
+func (c *Client) SetRetryMaxWaitTime(maxWaitTime time.Duration) *Client {
+ c.resty.SetRetryMaxWaitTime(maxWaitTime)
return c
}
// SetRetryWaitTime sets the default (minimum) delay before retrying a request.
-func (c *Client) SetRetryWaitTime(min time.Duration) *Client {
- c.resty.SetRetryWaitTime(min)
+func (c *Client) SetRetryWaitTime(minWaitTime time.Duration) *Client {
+ c.resty.SetRetryWaitTime(minWaitTime)
return c
}
@@ -378,6 +699,16 @@ func (c *Client) SetHeader(name, value string) {
c.resty.SetHeader(name, value)
}
+func (c *Client) enableLogSanitization() *Client {
+ c.resty.OnRequestLog(func(r *resty.RequestLog) error {
+ // masking authorization header
+ r.Header.Set("Authorization", "Bearer *******************************")
+ return nil
+ })
+
+ return c
+}
+
// NewClient factory to create new Client struct
func NewClient(hc *http.Client) (client Client) {
if hc != nil {
@@ -387,7 +718,7 @@ func NewClient(hc *http.Client) (client Client) {
}
client.shouldCache = true
- client.cacheExpiration = time.Minute * 15
+ client.cacheExpiration = APIDefaultCacheExpiration
client.cachedEntries = make(map[string]clientCacheEntry)
client.cachedEntryLock = &sync.RWMutex{}
@@ -407,7 +738,7 @@ func NewClient(hc *http.Client) (client Client) {
certPath, certPathExists := os.LookupEnv(APIHostCert)
- if certPathExists {
+ if certPathExists && !isCustomTransport(hc.Transport) {
cert, err := os.ReadFile(filepath.Clean(certPath))
if err != nil {
log.Fatalf("[ERROR] Error when reading cert at %s: %s\n", certPath, err.Error())
@@ -421,10 +752,11 @@ func NewClient(hc *http.Client) (client Client) {
}
client.
- SetRetryWaitTime((1000 * APISecondsPerPoll) * time.Millisecond).
+ SetRetryWaitTime(APISecondsPerPoll * time.Second).
SetPollDelay(APISecondsPerPoll * time.Second).
SetRetries().
- SetDebug(envDebug)
+ SetDebug(envDebug).
+ enableLogSanitization()
return
}
@@ -462,7 +794,7 @@ func NewClientFromEnv(hc *http.Client) (*Client, error) {
client.selectedProfile = configProfile
// We should only load the config if the config file exists
- if _, err := os.Stat(configPath); err != nil {
+ if _, err = os.Stat(configPath); err != nil {
return nil, fmt.Errorf("error loading config file %s: %w", configPath, err)
}
@@ -483,7 +815,7 @@ func (c *Client) preLoadConfig(configPath string) error {
}
// We don't want to load the profile until the user is actually making requests
- c.OnBeforeRequest(func(request *Request) error {
+ c.OnBeforeRequest(func(_ *Request) error {
if c.loadedProfile != c.selectedProfile {
if err := c.UseProfile(c.selectedProfile); err != nil {
return err
@@ -548,3 +880,11 @@ func generateListCacheURL(endpoint string, opts *ListOptions) (string, error) {
return fmt.Sprintf("%s:%s", endpoint, hashedOpts), nil
}
+
+func isCustomTransport(transport http.RoundTripper) bool {
+ if transport != http.DefaultTransport.(*http.Transport) {
+ log.Println("[WARN] Custom transport is not allowed with a custom root CA.")
+ return true
+ }
+ return false
+}
diff --git a/vendor/github.com/linode/linodego/client_http.go b/vendor/github.com/linode/linodego/client_http.go
new file mode 100644
index 00000000..7f16362c
--- /dev/null
+++ b/vendor/github.com/linode/linodego/client_http.go
@@ -0,0 +1,56 @@
+package linodego
+
+import (
+ "net/http"
+ "sync"
+ "time"
+)
+
+// Client is a wrapper around the Resty client
+//
+//nolint:unused
+type httpClient struct {
+ //nolint:unused
+ httpClient *http.Client
+ //nolint:unused
+ userAgent string
+ //nolint:unused
+ debug bool
+ //nolint:unused
+ retryConditionals []httpRetryConditional
+ //nolint:unused
+ retryAfter httpRetryAfter
+
+ //nolint:unused
+ pollInterval time.Duration
+
+ //nolint:unused
+ baseURL string
+ //nolint:unused
+ apiVersion string
+ //nolint:unused
+ apiProto string
+ //nolint:unused
+ selectedProfile string
+ //nolint:unused
+ loadedProfile string
+
+ //nolint:unused
+ configProfiles map[string]ConfigProfile
+
+ // Fields for caching endpoint responses
+ //nolint:unused
+ shouldCache bool
+ //nolint:unused
+ cacheExpiration time.Duration
+ //nolint:unused
+ cachedEntries map[string]clientCacheEntry
+ //nolint:unused
+ cachedEntryLock *sync.RWMutex
+ //nolint:unused
+ logger httpLogger
+ //nolint:unused
+ onBeforeRequest []func(*http.Request) error
+ //nolint:unused
+ onAfterResponse []func(*http.Response) error
+}
diff --git a/vendor/github.com/linode/linodego/config.go b/vendor/github.com/linode/linodego/config.go
index 6bccf83f..66d73f9b 100644
--- a/vendor/github.com/linode/linodego/config.go
+++ b/vendor/github.com/linode/linodego/config.go
@@ -140,7 +140,7 @@ func resolveValidConfigPath() (string, error) {
return "", err
}
- if _, err := os.Stat(p); err != nil {
+ if _, err = os.Stat(p); err != nil {
continue
}
diff --git a/vendor/github.com/linode/linodego/databases.go b/vendor/github.com/linode/linodego/databases.go
index 50d752d5..c665da77 100644
--- a/vendor/github.com/linode/linodego/databases.go
+++ b/vendor/github.com/linode/linodego/databases.go
@@ -3,11 +3,8 @@ package linodego
import (
"context"
"encoding/json"
- "fmt"
- "net/url"
"time"
- "github.com/go-resty/resty/v2"
"github.com/linode/linodego/internal/parseabletime"
)
@@ -53,63 +50,6 @@ const (
DatabaseStatusBackingUp DatabaseStatus = "backing_up"
)
-type DatabasesPagedResponse struct {
- *PageOptions
- Data []Database `json:"data"`
-}
-
-func (DatabasesPagedResponse) endpoint(_ ...any) string {
- return "databases/instances"
-}
-
-func (resp *DatabasesPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(DatabasesPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*DatabasesPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
-type DatabaseEnginesPagedResponse struct {
- *PageOptions
- Data []DatabaseEngine `json:"data"`
-}
-
-func (DatabaseEnginesPagedResponse) endpoint(_ ...any) string {
- return "databases/engines"
-}
-
-func (resp *DatabaseEnginesPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(DatabaseEnginesPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*DatabaseEnginesPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
-type DatabaseTypesPagedResponse struct {
- *PageOptions
- Data []DatabaseType `json:"data"`
-}
-
-func (DatabaseTypesPagedResponse) endpoint(_ ...any) string {
- return "databases/types"
-}
-
-func (resp *DatabaseTypesPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(DatabaseTypesPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*DatabaseTypesPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// A Database is a instance of Linode Managed Databases
type Database struct {
ID int `json:"id"`
@@ -202,100 +142,52 @@ func (d *Database) UnmarshalJSON(b []byte) error {
// ListDatabases lists all Database instances in Linode Managed Databases for the account
func (c *Client) ListDatabases(ctx context.Context, opts *ListOptions) ([]Database, error) {
- response := DatabasesPagedResponse{}
-
- err := c.listHelper(ctx, &response, opts)
+ response, err := getPaginatedResults[Database](ctx, c, "databases/instances", opts)
if err != nil {
return nil, err
}
- return response.Data, nil
+ return response, nil
}
// ListDatabaseEngines lists all Database Engines. This endpoint is cached by default.
func (c *Client) ListDatabaseEngines(ctx context.Context, opts *ListOptions) ([]DatabaseEngine, error) {
- response := DatabaseEnginesPagedResponse{}
-
- endpoint, err := generateListCacheURL(response.endpoint(), opts)
- if err != nil {
- return nil, err
- }
-
- if result := c.getCachedResponse(endpoint); result != nil {
- return result.([]DatabaseEngine), nil
- }
-
- err = c.listHelper(ctx, &response, opts)
+ response, err := getPaginatedResults[DatabaseEngine](ctx, c, "databases/engines", opts)
if err != nil {
return nil, err
}
- c.addCachedResponse(endpoint, response.Data, &cacheExpiryTime)
-
- return response.Data, nil
+ return response, nil
}
// GetDatabaseEngine returns a specific Database Engine. This endpoint is cached by default.
func (c *Client) GetDatabaseEngine(ctx context.Context, _ *ListOptions, engineID string) (*DatabaseEngine, error) {
- engineID = url.PathEscape(engineID)
- e := fmt.Sprintf("databases/engines/%s", engineID)
-
- if result := c.getCachedResponse(e); result != nil {
- result := result.(DatabaseEngine)
- return &result, nil
- }
-
- req := c.R(ctx).SetResult(&DatabaseEngine{})
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("databases/engines/%s", engineID)
+ response, err := doGETRequest[DatabaseEngine](ctx, c, e)
if err != nil {
return nil, err
}
- c.addCachedResponse(e, r.Result(), &cacheExpiryTime)
-
- return r.Result().(*DatabaseEngine), nil
+ return response, nil
}
// ListDatabaseTypes lists all Types of Database provided in Linode Managed Databases. This endpoint is cached by default.
func (c *Client) ListDatabaseTypes(ctx context.Context, opts *ListOptions) ([]DatabaseType, error) {
- response := DatabaseTypesPagedResponse{}
-
- endpoint, err := generateListCacheURL(response.endpoint(), opts)
- if err != nil {
- return nil, err
- }
-
- if result := c.getCachedResponse(endpoint); result != nil {
- return result.([]DatabaseType), nil
- }
-
- err = c.listHelper(ctx, &response, opts)
+ response, err := getPaginatedResults[DatabaseType](ctx, c, "databases/types", opts)
if err != nil {
return nil, err
}
- c.addCachedResponse(endpoint, response.Data, &cacheExpiryTime)
-
- return response.Data, nil
+ return response, nil
}
// GetDatabaseType returns a specific Database Type. This endpoint is cached by default.
func (c *Client) GetDatabaseType(ctx context.Context, _ *ListOptions, typeID string) (*DatabaseType, error) {
- typeID = url.PathEscape(typeID)
- e := fmt.Sprintf("databases/types/%s", typeID)
-
- if result := c.getCachedResponse(e); result != nil {
- result := result.(DatabaseType)
- return &result, nil
- }
-
- req := c.R(ctx).SetResult(&DatabaseType{})
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("databases/types/%s", typeID)
+ response, err := doGETRequest[DatabaseType](ctx, c, e)
if err != nil {
return nil, err
}
- c.addCachedResponse(e, r.Result(), &cacheExpiryTime)
-
- return r.Result().(*DatabaseType), nil
+ return response, nil
}
diff --git a/vendor/github.com/linode/linodego/domain_records.go b/vendor/github.com/linode/linodego/domain_records.go
index fcb664d8..073dccb8 100644
--- a/vendor/github.com/linode/linodego/domain_records.go
+++ b/vendor/github.com/linode/linodego/domain_records.go
@@ -3,9 +3,9 @@ package linodego
import (
"context"
"encoding/json"
- "fmt"
+ "time"
- "github.com/go-resty/resty/v2"
+ "github.com/linode/linodego/internal/parseabletime"
)
// DomainRecord represents a DomainRecord object
@@ -21,6 +21,8 @@ type DomainRecord struct {
Protocol *string `json:"protocol"`
TTLSec int `json:"ttl_sec"`
Tag *string `json:"tag"`
+ Created *time.Time `json:"-"`
+ Updated *time.Time `json:"-"`
}
// DomainRecordCreateOptions fields are those accepted by CreateDomainRecord
@@ -67,6 +69,27 @@ const (
RecordTypeCAA DomainRecordType = "CAA"
)
+// UnmarshalJSON for DomainRecord responses
+func (d *DomainRecord) UnmarshalJSON(b []byte) error {
+ type Mask DomainRecord
+
+ p := struct {
+ *Mask
+ Created *parseabletime.ParseableTime `json:"created"`
+ Updated *parseabletime.ParseableTime `json:"updated"`
+ }{
+ Mask: (*Mask)(d),
+ }
+
+ if err := json.Unmarshal(b, &p); err != nil {
+ return err
+ }
+
+ d.Created = (*time.Time)(p.Created)
+ d.Updated = (*time.Time)(p.Updated)
+ return nil
+}
+
// GetUpdateOptions converts a DomainRecord to DomainRecordUpdateOptions for use in UpdateDomainRecord
func (d DomainRecord) GetUpdateOptions() (du DomainRecordUpdateOptions) {
du.Type = d.Type
@@ -83,86 +106,31 @@ func (d DomainRecord) GetUpdateOptions() (du DomainRecordUpdateOptions) {
return
}
-// DomainRecordsPagedResponse represents a paginated DomainRecord API response
-type DomainRecordsPagedResponse struct {
- *PageOptions
- Data []DomainRecord `json:"data"`
-}
-
-// endpoint gets the endpoint URL for InstanceConfig
-func (DomainRecordsPagedResponse) endpoint(ids ...any) string {
- id, _ := ids[0].(int)
- return fmt.Sprintf("domains/%d/records", id)
-}
-
-func (resp *DomainRecordsPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(DomainRecordsPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*DomainRecordsPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListDomainRecords lists DomainRecords
func (c *Client) ListDomainRecords(ctx context.Context, domainID int, opts *ListOptions) ([]DomainRecord, error) {
- response := DomainRecordsPagedResponse{}
- err := c.listHelper(ctx, &response, opts, domainID)
- if err != nil {
- return nil, err
- }
- return response.Data, nil
+ return getPaginatedResults[DomainRecord](ctx, c, formatAPIPath("domains/%d/records", domainID), opts)
}
// GetDomainRecord gets the domainrecord with the provided ID
func (c *Client) GetDomainRecord(ctx context.Context, domainID int, recordID int) (*DomainRecord, error) {
- req := c.R(ctx).SetResult(&DomainRecord{})
- e := fmt.Sprintf("domains/%d/records/%d", domainID, recordID)
- r, err := coupleAPIErrors(req.Get(e))
- if err != nil {
- return nil, err
- }
- return r.Result().(*DomainRecord), nil
+ e := formatAPIPath("domains/%d/records/%d", domainID, recordID)
+ return doGETRequest[DomainRecord](ctx, c, e)
}
// CreateDomainRecord creates a DomainRecord
func (c *Client) CreateDomainRecord(ctx context.Context, domainID int, opts DomainRecordCreateOptions) (*DomainRecord, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
- e := fmt.Sprintf("domains/%d/records", domainID)
- req := c.R(ctx).SetResult(&DomainRecord{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Post(e))
- if err != nil {
- return nil, err
- }
-
- return r.Result().(*DomainRecord), nil
+ e := formatAPIPath("domains/%d/records", domainID)
+ return doPOSTRequest[DomainRecord](ctx, c, e, opts)
}
// UpdateDomainRecord updates the DomainRecord with the specified id
func (c *Client) UpdateDomainRecord(ctx context.Context, domainID int, recordID int, opts DomainRecordUpdateOptions) (*DomainRecord, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
- e := fmt.Sprintf("domains/%d/records/%d", domainID, recordID)
- req := c.R(ctx).SetResult(&DomainRecord{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Put(e))
- if err != nil {
- return nil, err
- }
-
- return r.Result().(*DomainRecord), nil
+ e := formatAPIPath("domains/%d/records/%d", domainID, recordID)
+ return doPUTRequest[DomainRecord](ctx, c, e, opts)
}
// DeleteDomainRecord deletes the DomainRecord with the specified id
func (c *Client) DeleteDomainRecord(ctx context.Context, domainID int, recordID int) error {
- e := fmt.Sprintf("domains/%d/records/%d", domainID, recordID)
- _, err := coupleAPIErrors(c.R(ctx).Delete(e))
- return err
+ e := formatAPIPath("domains/%d/records/%d", domainID, recordID)
+ return doDELETERequest(ctx, c, e)
}
diff --git a/vendor/github.com/linode/linodego/domains.go b/vendor/github.com/linode/linodego/domains.go
index eff796fa..0bc05bdd 100644
--- a/vendor/github.com/linode/linodego/domains.go
+++ b/vendor/github.com/linode/linodego/domains.go
@@ -2,10 +2,6 @@ package linodego
import (
"context"
- "encoding/json"
- "fmt"
-
- "github.com/go-resty/resty/v2"
)
// Domain represents a Domain object
@@ -188,99 +184,63 @@ func (d Domain) GetUpdateOptions() (du DomainUpdateOptions) {
return
}
-// DomainsPagedResponse represents a paginated Domain API response
-type DomainsPagedResponse struct {
- *PageOptions
- Data []Domain `json:"data"`
-}
-
-// endpoint gets the endpoint URL for Domain
-func (DomainsPagedResponse) endpoint(_ ...any) string {
- return "domains"
-}
-
-func (resp *DomainsPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(DomainsPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*DomainsPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListDomains lists Domains
func (c *Client) ListDomains(ctx context.Context, opts *ListOptions) ([]Domain, error) {
- response := DomainsPagedResponse{}
- err := c.listHelper(ctx, &response, opts)
+ response, err := getPaginatedResults[Domain](ctx, c, "domains", opts)
if err != nil {
return nil, err
}
- return response.Data, nil
+ return response, nil
}
// GetDomain gets the domain with the provided ID
func (c *Client) GetDomain(ctx context.Context, domainID int) (*Domain, error) {
- req := c.R(ctx).SetResult(&Domain{})
- e := fmt.Sprintf("domains/%d", domainID)
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("domains/%d", domainID)
+ response, err := doGETRequest[Domain](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*Domain), nil
+ return response, nil
}
// CreateDomain creates a Domain
func (c *Client) CreateDomain(ctx context.Context, opts DomainCreateOptions) (*Domain, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
- req := c.R(ctx).SetResult(&Domain{}).SetBody(string(body))
e := "domains"
- r, err := coupleAPIErrors(req.Post(e))
+ response, err := doPOSTRequest[Domain](ctx, c, e, opts)
if err != nil {
return nil, err
}
- return r.Result().(*Domain), nil
+ return response, nil
}
// UpdateDomain updates the Domain with the specified id
func (c *Client) UpdateDomain(ctx context.Context, domainID int, opts DomainUpdateOptions) (*Domain, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
- e := fmt.Sprintf("domains/%d", domainID)
- req := c.R(ctx).SetResult(&Domain{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Put(e))
+ e := formatAPIPath("domains/%d", domainID)
+ response, err := doPUTRequest[Domain](ctx, c, e, opts)
if err != nil {
return nil, err
}
- return r.Result().(*Domain), nil
+ return response, nil
}
// DeleteDomain deletes the Domain with the specified id
func (c *Client) DeleteDomain(ctx context.Context, domainID int) error {
- e := fmt.Sprintf("domains/%d", domainID)
- _, err := coupleAPIErrors(c.R(ctx).Delete(e))
+ e := formatAPIPath("domains/%d", domainID)
+ err := doDELETERequest(ctx, c, e)
return err
}
// GetDomainZoneFile gets the zone file for the last rendered zone for the specified domain.
func (c *Client) GetDomainZoneFile(ctx context.Context, domainID int) (*DomainZoneFile, error) {
- e := fmt.Sprintf("domains/%d/zone-file", domainID)
- req := c.R(ctx).SetResult(&DomainZoneFile{})
- resp, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("domains/%d/zone-file", domainID)
+ response, err := doGETRequest[DomainZoneFile](ctx, c, e)
if err != nil {
return nil, err
}
- return resp.Result().(*DomainZoneFile), nil
+ return response, nil
}
diff --git a/vendor/github.com/linode/linodego/errors.go b/vendor/github.com/linode/linodego/errors.go
index fc3eb654..be15c014 100644
--- a/vendor/github.com/linode/linodego/errors.go
+++ b/vendor/github.com/linode/linodego/errors.go
@@ -1,8 +1,10 @@
package linodego
import (
+ "encoding/json"
"errors"
"fmt"
+ "io"
"net/http"
"reflect"
"strings"
@@ -46,6 +48,11 @@ type APIError struct {
Errors []APIErrorReason `json:"errors"`
}
+// String returns the error reason in a formatted string
+func (r APIErrorReason) String() string {
+ return fmt.Sprintf("[%s] %s", r.Field, r.Reason)
+}
+
func coupleAPIErrors(r *resty.Response, err error) (*resty.Response, error) {
if err != nil {
// an error was raised in go code, no need to check the resty Response
@@ -66,7 +73,7 @@ func coupleAPIErrors(r *resty.Response, err error) (*resty.Response, error) {
// If the upstream Linode API server being fronted fails to respond to the request,
// the http server will respond with a default "Bad Gateway" page with Content-Type
// "text/html".
- if r.StatusCode() == http.StatusBadGateway && responseContentType == "text/html" {
+ if r.StatusCode() == http.StatusBadGateway && responseContentType == "text/html" { //nolint:goconst
return nil, Error{Code: http.StatusBadGateway, Message: http.StatusText(http.StatusBadGateway)}
}
@@ -89,6 +96,52 @@ func coupleAPIErrors(r *resty.Response, err error) (*resty.Response, error) {
return nil, NewError(r)
}
+//nolint:unused
+func coupleAPIErrorsHTTP(resp *http.Response, err error) (*http.Response, error) {
+ if err != nil {
+ // an error was raised in go code, no need to check the http.Response
+ return nil, NewError(err)
+ }
+
+ if resp == nil || resp.StatusCode < 200 || resp.StatusCode >= 300 {
+ // Check that response is of the correct content-type before unmarshalling
+ expectedContentType := resp.Request.Header.Get("Accept")
+ responseContentType := resp.Header.Get("Content-Type")
+
+ // If the upstream server fails to respond to the request,
+ // the http server will respond with a default error page with Content-Type "text/html".
+ if resp.StatusCode == http.StatusBadGateway && responseContentType == "text/html" { //nolint:goconst
+ return nil, Error{Code: http.StatusBadGateway, Message: http.StatusText(http.StatusBadGateway)}
+ }
+
+ if responseContentType != expectedContentType {
+ bodyBytes, _ := io.ReadAll(resp.Body)
+ msg := fmt.Sprintf(
+ "Unexpected Content-Type: Expected: %v, Received: %v\nResponse body: %s",
+ expectedContentType,
+ responseContentType,
+ string(bodyBytes),
+ )
+
+ return nil, Error{Code: resp.StatusCode, Message: msg}
+ }
+
+ var apiError APIError
+ if err := json.NewDecoder(resp.Body).Decode(&apiError); err != nil {
+ return nil, NewError(fmt.Errorf("failed to decode response body: %w", err))
+ }
+
+ if len(apiError.Errors) == 0 {
+ return resp, nil
+ }
+
+ return nil, Error{Code: resp.StatusCode, Message: apiError.Errors[0].String()}
+ }
+
+ // no error in the http.Response
+ return resp, nil
+}
+
func (e APIError) Error() string {
x := []string{}
for _, msg := range e.Errors {
@@ -149,3 +202,34 @@ func NewError(err any) *Error {
return &Error{Code: ErrorUnsupported, Message: fmt.Sprintf("Unsupported type to linodego.NewError: %s", reflect.TypeOf(e))}
}
}
+
+// IsNotFound indicates if err indicates a 404 Not Found error from the Linode API.
+func IsNotFound(err error) bool {
+ return ErrHasStatus(err, http.StatusNotFound)
+}
+
+// ErrHasStatus checks if err is an error from the Linode API, and whether it contains the given HTTP status code.
+// More than one status code may be given.
+// If len(code) == 0, err is nil or is not a [Error], ErrHasStatus will return false.
+func ErrHasStatus(err error, code ...int) bool {
+ if err == nil {
+ return false
+ }
+
+ // Short-circuit if the caller did not provide any status codes.
+ if len(code) == 0 {
+ return false
+ }
+
+ var e *Error
+ if !errors.As(err, &e) {
+ return false
+ }
+ ec := e.StatusCode()
+ for _, c := range code {
+ if ec == c {
+ return true
+ }
+ }
+ return false
+}
diff --git a/vendor/github.com/linode/linodego/firewall_devices.go b/vendor/github.com/linode/linodego/firewall_devices.go
index 901cf43d..91896d28 100644
--- a/vendor/github.com/linode/linodego/firewall_devices.go
+++ b/vendor/github.com/linode/linodego/firewall_devices.go
@@ -3,10 +3,8 @@ package linodego
import (
"context"
"encoding/json"
- "fmt"
"time"
- "github.com/go-resty/resty/v2"
"github.com/linode/linodego/internal/parseabletime"
)
@@ -62,68 +60,41 @@ type FirewallDeviceEntity struct {
URL string `json:"url"`
}
-// FirewallDevicesPagedResponse represents a Linode API response for FirewallDevices
-type FirewallDevicesPagedResponse struct {
- *PageOptions
- Data []FirewallDevice `json:"data"`
-}
-
-// endpoint gets the endpoint URL for FirewallDevices of a given Firewall
-func (FirewallDevicesPagedResponse) endpoint(ids ...any) string {
- id, _ := ids[0].(int)
- return fmt.Sprintf("networking/firewalls/%d/devices", id)
-}
-
-func (resp *FirewallDevicesPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(FirewallDevicesPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*FirewallDevicesPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListFirewallDevices get devices associated with a given Firewall
func (c *Client) ListFirewallDevices(ctx context.Context, firewallID int, opts *ListOptions) ([]FirewallDevice, error) {
- response := FirewallDevicesPagedResponse{}
- err := c.listHelper(ctx, &response, opts, firewallID)
+ response, err := getPaginatedResults[FirewallDevice](ctx, c, formatAPIPath("networking/firewalls/%d/devices", firewallID), opts)
if err != nil {
return nil, err
}
- return response.Data, nil
+
+ return response, nil
}
// GetFirewallDevice gets a FirewallDevice given an ID
func (c *Client) GetFirewallDevice(ctx context.Context, firewallID, deviceID int) (*FirewallDevice, error) {
- e := fmt.Sprintf("networking/firewalls/%d/devices/%d", firewallID, deviceID)
- req := c.R(ctx).SetResult(&FirewallDevice{})
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("networking/firewalls/%d/devices/%d", firewallID, deviceID)
+ response, err := doGETRequest[FirewallDevice](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*FirewallDevice), nil
+
+ return response, nil
}
// AddFirewallDevice associates a Device with a given Firewall
func (c *Client) CreateFirewallDevice(ctx context.Context, firewallID int, opts FirewallDeviceCreateOptions) (*FirewallDevice, error) {
- body, err := json.Marshal(opts)
+ e := formatAPIPath("networking/firewalls/%d/devices", firewallID)
+ response, err := doPOSTRequest[FirewallDevice](ctx, c, e, opts)
if err != nil {
return nil, err
}
- e := fmt.Sprintf("networking/firewalls/%d/devices", firewallID)
- req := c.R(ctx).SetResult(&FirewallDevice{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Post(e))
- if err != nil {
- return nil, err
- }
- return r.Result().(*FirewallDevice), nil
+ return response, nil
}
// DeleteFirewallDevice disassociates a Device with a given Firewall
func (c *Client) DeleteFirewallDevice(ctx context.Context, firewallID, deviceID int) error {
- e := fmt.Sprintf("networking/firewalls/%d/devices/%d", firewallID, deviceID)
- _, err := coupleAPIErrors(c.R(ctx).Delete(e))
+ e := formatAPIPath("networking/firewalls/%d/devices/%d", firewallID, deviceID)
+ err := doDELETERequest(ctx, c, e)
return err
}
diff --git a/vendor/github.com/linode/linodego/firewall_rules.go b/vendor/github.com/linode/linodego/firewall_rules.go
index fe3b8c7d..2a6d3b2e 100644
--- a/vendor/github.com/linode/linodego/firewall_rules.go
+++ b/vendor/github.com/linode/linodego/firewall_rules.go
@@ -2,8 +2,6 @@ package linodego
import (
"context"
- "encoding/json"
- "fmt"
)
// NetworkProtocol enum type
@@ -43,27 +41,22 @@ type FirewallRuleSet struct {
// GetFirewallRules gets the FirewallRuleSet for the given Firewall.
func (c *Client) GetFirewallRules(ctx context.Context, firewallID int) (*FirewallRuleSet, error) {
- e := fmt.Sprintf("networking/firewalls/%d/rules", firewallID)
- req := c.R(ctx).SetResult(&FirewallRuleSet{})
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("networking/firewalls/%d/rules", firewallID)
+ response, err := doGETRequest[FirewallRuleSet](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*FirewallRuleSet), nil
+
+ return response, nil
}
// UpdateFirewallRules updates the FirewallRuleSet for the given Firewall
func (c *Client) UpdateFirewallRules(ctx context.Context, firewallID int, rules FirewallRuleSet) (*FirewallRuleSet, error) {
- body, err := json.Marshal(rules)
+ e := formatAPIPath("networking/firewalls/%d/rules", firewallID)
+ response, err := doPUTRequest[FirewallRuleSet](ctx, c, e, rules)
if err != nil {
return nil, err
}
- e := fmt.Sprintf("networking/firewalls/%d/rules", firewallID)
- req := c.R(ctx).SetResult(&FirewallRuleSet{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Put(e))
- if err != nil {
- return nil, err
- }
- return r.Result().(*FirewallRuleSet), nil
+ return response, nil
}
diff --git a/vendor/github.com/linode/linodego/firewalls.go b/vendor/github.com/linode/linodego/firewalls.go
index ca4d324e..1474f3dc 100644
--- a/vendor/github.com/linode/linodego/firewalls.go
+++ b/vendor/github.com/linode/linodego/firewalls.go
@@ -3,10 +3,8 @@ package linodego
import (
"context"
"encoding/json"
- "fmt"
"time"
- "github.com/go-resty/resty/v2"
"github.com/linode/linodego/internal/parseabletime"
)
@@ -82,87 +80,52 @@ func (f *Firewall) UnmarshalJSON(b []byte) error {
return nil
}
-// FirewallsPagedResponse represents a Linode API response for listing of Cloud Firewalls
-type FirewallsPagedResponse struct {
- *PageOptions
- Data []Firewall `json:"data"`
-}
-
-func (FirewallsPagedResponse) endpoint(_ ...any) string {
- return "networking/firewalls"
-}
-
-func (resp *FirewallsPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(FirewallsPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*FirewallsPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListFirewalls returns a paginated list of Cloud Firewalls
func (c *Client) ListFirewalls(ctx context.Context, opts *ListOptions) ([]Firewall, error) {
- response := FirewallsPagedResponse{}
-
- err := c.listHelper(ctx, &response, opts)
+ response, err := getPaginatedResults[Firewall](ctx, c, "networking/firewalls", opts)
if err != nil {
return nil, err
}
- return response.Data, nil
+ return response, nil
}
// CreateFirewall creates a single Firewall with at least one set of inbound or outbound rules
func (c *Client) CreateFirewall(ctx context.Context, opts FirewallCreateOptions) (*Firewall, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
e := "networking/firewalls"
- req := c.R(ctx).SetResult(&Firewall{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Post(e))
+ response, err := doPOSTRequest[Firewall](ctx, c, e, opts)
if err != nil {
return nil, err
}
- return r.Result().(*Firewall), nil
+ return response, nil
}
// GetFirewall gets a single Firewall with the provided ID
func (c *Client) GetFirewall(ctx context.Context, firewallID int) (*Firewall, error) {
- e := fmt.Sprintf("networking/firewalls/%d", firewallID)
- req := c.R(ctx).SetResult(&Firewall{})
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("networking/firewalls/%d", firewallID)
+ response, err := doGETRequest[Firewall](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*Firewall), nil
+ return response, nil
}
// UpdateFirewall updates a Firewall with the given ID
func (c *Client) UpdateFirewall(ctx context.Context, firewallID int, opts FirewallUpdateOptions) (*Firewall, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
- e := fmt.Sprintf("networking/firewalls/%d", firewallID)
- req := c.R(ctx).SetResult(&Firewall{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Put(e))
+ e := formatAPIPath("networking/firewalls/%d", firewallID)
+ response, err := doPUTRequest[Firewall](ctx, c, e, opts)
if err != nil {
return nil, err
}
- return r.Result().(*Firewall), nil
+ return response, nil
}
// DeleteFirewall deletes a single Firewall with the provided ID
func (c *Client) DeleteFirewall(ctx context.Context, firewallID int) error {
- e := fmt.Sprintf("networking/firewalls/%d", firewallID)
- _, err := coupleAPIErrors(c.R(ctx).Delete(e))
+ e := formatAPIPath("networking/firewalls/%d", firewallID)
+ err := doDELETERequest(ctx, c, e)
return err
}
diff --git a/vendor/github.com/linode/linodego/go.work b/vendor/github.com/linode/linodego/go.work
index db3a7dbc..9f6d7df5 100644
--- a/vendor/github.com/linode/linodego/go.work
+++ b/vendor/github.com/linode/linodego/go.work
@@ -1,4 +1,4 @@
-go 1.20
+go 1.22
use (
.
diff --git a/vendor/github.com/linode/linodego/go.work.sum b/vendor/github.com/linode/linodego/go.work.sum
index 2a469314..0327b684 100644
--- a/vendor/github.com/linode/linodego/go.work.sum
+++ b/vendor/github.com/linode/linodego/go.work.sum
@@ -1,201 +1,63 @@
-cloud.google.com/go v0.81.0 h1:at8Tk2zUz63cLPR0JPWm5vp77pEZmzxEQBEfRKn1VV8=
-cloud.google.com/go/bigquery v1.8.0 h1:PQcPefKFdaIzjQFbiyOgAqyx8q5djaE7x9Sqe712DPA=
-cloud.google.com/go/compute/metadata v0.2.0 h1:nBbNSZyDpkNlo3DepaaLKVuO7ClyifSAmNloSCZrHnQ=
-cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k=
-cloud.google.com/go/datastore v1.1.0 h1:/May9ojXjRkPBNVrq+oWLqmWCkr4OU5uRY29bu0mRyQ=
-cloud.google.com/go/pubsub v1.3.1 h1:ukjixP1wl0LpnZ6LWtZJ0mX5tBmjp1f8Sqer8Z2OMUU=
-cloud.google.com/go/storage v1.10.0 h1:STgFzyU5/8miMl0//zKh2aQeTyeaUH3WN9bSUiJ09bA=
-dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9 h1:VpgP7xuJadIUuKccphEpTJnWhS2jkQyMt6Y7pJCD7fY=
-github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs=
-github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI=
-github.com/Azure/go-autorest/autorest v0.11.18 h1:90Y4srNYrwOtAgVo3ndrQkTYn6kf1Eg/AjTFJ8Is2aM=
-github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0=
-github.com/Azure/go-autorest/autorest/adal v0.9.13 h1:Mp5hbtOePIzM8pJVRa3YLrWWmZtoxRXqUEzCfJt3+/Q=
-github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA=
-github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw=
-github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0=
-github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0=
-github.com/Azure/go-autorest/autorest/mocks v0.4.1 h1:K0laFcLE6VLTOwNgSxaGbUcLPuGXlNkbVvq4cW4nIHk=
-github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc=
-github.com/Azure/go-autorest/logger v0.2.1 h1:IG7i4p/mDa2Ce4TRyAO8IHnVhAVF3RFU+ZtXWSmf4Tg=
-github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk=
-github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo=
-github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
-github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc=
+cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc=
+cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k=
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46 h1:lsxEuwrXEAokXB9qhlbKWPpo3KMLZQ5WB5WLQRW1uq0=
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
-github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
-github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI=
-github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
-github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA=
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
-github.com/census-instrumentation/opencensus-proto v0.2.1 h1:glEXhBS5PSLLv4IXzLA5yPRVX4bilULVyxxbrfOtDAk=
-github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE=
-github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8=
-github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8=
-github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI=
-github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403 h1:cqQfy1jclcSy/FwLjemeg3SR1yaINm74aQyupQ0Bl8M=
github.com/creack/pty v1.1.9 h1:uDmaGzcdjhF4i/plgjmEsriH11Y0o7RKapEf/LDaM3w=
-github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
-github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E=
-github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM=
-github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815 h1:bWDMxwH3px2JBh6AyO7hdCn/PkvCZXii8TGj7sbtEbQ=
-github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153 h1:yUdfgN0XgIJw7foRItutHYUIhlcKzcSf5vDpdhQAKTc=
-github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633 h1:H2pdYOb3KQ1/YsqVWoWNLQO+fusocsw354rqGTZtAgw=
-github.com/emicklei/go-restful/v3 v3.8.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
-github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad h1:EmNYJhPYy0pOFjCx2PrgtaBXmee0iUX9hLlxE1xHOJE=
-github.com/envoyproxy/protoc-gen-validate v0.1.0 h1:EQciDnbrYxy13PgWoY8AqoxGiPrpgBZ1R8UNe3ddc+A=
-github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84=
-github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U=
-github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
-github.com/form3tech-oss/jwt-go v3.2.3+incompatible h1:7ZaBxOI7TMoYBfyA3cQHErNNyAWIKUMIwqxEtgHOs5c=
-github.com/getkin/kin-openapi v0.76.0 h1:j77zg3Ec+k+r+GA3d8hBoXpAc6KX9TbBPrwQGBIy2sY=
-github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
-github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
-github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1 h1:QbL/5oDUmRBzO9/Z7Seo6zf912W/a6Sr4Eu0G/3Jho0=
-github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4 h1:WtGNWLvXpe6ZudgnXrq0barxBImvnnJoMEhXAzcbM0I=
-github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
-github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
-github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0=
-github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY=
-github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg=
-github.com/go-openapi/jsonreference v0.19.3 h1:5cxNfTy0UVC3X8JL5ymxzyoUZmo8iZb+jeTWn7tUa8o=
-github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc=
-github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I=
-github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY=
-github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
-github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
-github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
-github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
-github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
+github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
-github.com/golang/mock v1.5.0 h1:jlYHihg//f7RRwuPfptm04yp4s7O6Kw8EZiVYIGcH0g=
-github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4=
github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA=
-github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
-github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no=
-github.com/google/martian/v3 v3.1.0 h1:wCKgOCHuUEVfsaQLpPSJb7VdYCdTVZQAuOdYm1yc/60=
-github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5 h1:zIaiqGYDQwa4HVx5wGRTXbx38Pqxjemn4BP98wpzpXo=
-github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
-github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
-github.com/google/renameio v0.1.0 h1:GOZbcHa3HfsPKPlmyPyN2KEohoMXOhdMbHrvbpl2QaA=
-github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
-github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y=
-github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
-github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM=
-github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
-github.com/googleapis/gnostic v0.1.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
-github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8=
-github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
-github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
-github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
+github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
+github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM=
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
-github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU=
-github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
-github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639 h1:mV02weKRL81bEnm8A0HT1/CAelMQDBuQIfLw8n+d6xI=
-github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
-github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
-github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o=
-github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
github.com/kisielk/errcheck v1.5.0 h1:e8esj/e4R+SAOwFwN+n3zr0nYeCyeweozKfO23MvHzY=
github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg=
-github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs=
-github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/pty v1.1.1 h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw=
-github.com/linode/linodego v0.20.1 h1:Kw5Qes0E0wlKVx5EbITI+F/ambO6G+PQyK0Yi7i4EyQ=
-github.com/linode/linodego v0.20.1/go.mod h1:XOWXRHjqeU2uPS84tKLgfWIfTlv3TYzCS0io4GOQzEI=
-github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
-github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8=
-github.com/maxatome/go-testdeep v1.11.0/go.mod h1:011SgQ6efzZYAen6fDn4BqQ+lUR72ysdyKe7Dyogw70=
-github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=
github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8=
github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c=
-github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5 h1:8Q0qkMVC/MmWkpIdlvZgcv2o2jrlF6zqVOh7W5YHdMA=
-github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d h1:7PxY7LVfSZm7PEeBTyK1rj1gABdCO2mbri6GKO1cMDs=
-github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus=
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
-github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw=
-github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
-github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
-github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47RKZmLU=
-github.com/onsi/ginkgo/v2 v2.9.1/go.mod h1:FEcmzVcCHl+4o9bQZVab+4dC9+j+91t2FHSzmGAPfuo=
-github.com/onsi/ginkgo/v2 v2.9.2/go.mod h1:WHcJJG2dIlcCqVfBAwUCrJxSPFb6v4azBwgxeMeDuts=
-github.com/onsi/ginkgo/v2 v2.9.4/go.mod h1:gCQYp2Q+kSoIj7ykSVb9nskRSsR6PUj4AiLywzIhbKM=
-github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
-github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro=
-github.com/onsi/gomega v1.27.3/go.mod h1:5vG284IBtfDAmDyrK+eGyZmUgUlmi+Wngqo557cZ6Gw=
-github.com/onsi/gomega v1.27.4/go.mod h1:riYq/GJKh8hhoM01HN6Vmuy93AarCXCBGpvFDK3q3fQ=
-github.com/onsi/gomega v1.27.6/go.mod h1:PIQNjfQwkP3aQAH7lf7j87O/5FiNr+ZR8+ipb+qQlhg=
github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI=
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
-github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e h1:aoZm08cpOy4WuID//EZDgcC4zIxODThtZNPirFr42+A=
-github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
-github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM=
-github.com/rogpeppe/go-internal v1.3.0 h1:RR9dF3JtopPvtkroDZuVD7qquD0bnHlKSqaQhgwt8yk=
-github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
-github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
-github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
-github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc=
-github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
-github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
-github.com/stoewer/go-strcase v1.2.0 h1:Z2iHWqGXH00XYgqDmNgQbIBxf3wrNq0F3feEy0ainaU=
-github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4=
-github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
-github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
-github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/yuin/goldmark v1.2.1 h1:ruQGxdhGHe7FWOJPT0mKs5+pD2Xs1Bm/kdGlHO04FmM=
-github.com/yuin/goldmark v1.3.5 h1:dPmz1Snjq0kmkz159iL7S6WzdahUTHnHB5M56WFVifs=
github.com/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE=
-go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M=
-golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
-golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
-golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM=
-golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I=
-golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio=
-golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk=
-golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw=
-golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck=
-golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc=
-golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g=
-golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
-golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg=
-golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6 h1:QE6XYQK6naiK1EPAe1g/ILLxN5RBoH5xkJk3CqlMI/Y=
-golang.org/x/image v0.0.0-20190802002840-cff245a6509b h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4=
-golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 h1:2M3HP5CCK1Si9FQhwnzYhXdG6DXeebvUHFpre8QvbyI=
-golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028 h1:4+4C/Iv2U4fMZBiMCc98MG1In4gJY5YRhtpDNeDeHWs=
-golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
-golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8=
-golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
-golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
-golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20220722155237-a158d28d115b h1:PxfKdU9lEEDYjdIzOtC4qFWgkU2rGHdKlKowJSMN9h0=
-golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
-golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
-golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
-golang.org/x/net v0.13.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA=
-golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck=
-golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
-golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
-golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY=
-golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4=
+github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
+golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI=
+golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM=
+golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30=
+golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M=
+golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=
+golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54=
+golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A=
+golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70=
+golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw=
+golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U=
+golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA=
+golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
+golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
+golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
+golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
+golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
+golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
+golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ=
+golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
+golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2 h1:IRJeR9r1pYWsHKTRe/IInb7lYvbBVIqOgsX/u0mbOWY=
+golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
+golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8=
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk=
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
-k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c h1:GohjlNKauSai7gN4wsJkeZ3WAJx4Sh+oT/b5IYn5suA=
-k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E=
+google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
+google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
+k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01 h1:pWEwq4Asjm4vjW7vcsmijwBhOr1/shsbSYiWXmNGlks=
+k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E=
diff --git a/vendor/github.com/linode/linodego/images.go b/vendor/github.com/linode/linodego/images.go
index 7875d6fd..9bbb2075 100644
--- a/vendor/github.com/linode/linodego/images.go
+++ b/vendor/github.com/linode/linodego/images.go
@@ -3,9 +3,7 @@ package linodego
import (
"context"
"encoding/json"
- "fmt"
"io"
- "net/url"
"time"
"github.com/go-resty/resty/v2"
@@ -22,35 +20,69 @@ const (
ImageStatusAvailable ImageStatus = "available"
)
+// ImageRegionStatus represents the status of an Image's replica.
+type ImageRegionStatus string
+
+// ImageRegionStatus options start with ImageRegionStatus and
+// include all Image replica statuses
+const (
+ ImageRegionStatusAvailable ImageRegionStatus = "available"
+ ImageRegionStatusCreating ImageRegionStatus = "creating"
+ ImageRegionStatusPending ImageRegionStatus = "pending"
+ ImageRegionStatusPendingReplication ImageRegionStatus = "pending replication"
+ ImageRegionStatusPendingDeletion ImageRegionStatus = "pending deletion"
+ ImageRegionStatusReplicating ImageRegionStatus = "replicating"
+)
+
+// ImageRegion represents the status of an Image object in a given Region.
+type ImageRegion struct {
+ Region string `json:"region"`
+ Status ImageRegionStatus `json:"status"`
+}
+
// Image represents a deployable Image object for use with Linode Instances
type Image struct {
- ID string `json:"id"`
- CreatedBy string `json:"created_by"`
- Capabilities []string `json:"capabilities"`
- Label string `json:"label"`
- Description string `json:"description"`
- Type string `json:"type"`
- Vendor string `json:"vendor"`
- Status ImageStatus `json:"status"`
- Size int `json:"size"`
- IsPublic bool `json:"is_public"`
- Deprecated bool `json:"deprecated"`
- Created *time.Time `json:"-"`
- Expiry *time.Time `json:"-"`
+ ID string `json:"id"`
+ CreatedBy string `json:"created_by"`
+ Capabilities []string `json:"capabilities"`
+ Label string `json:"label"`
+ Description string `json:"description"`
+ Type string `json:"type"`
+ Vendor string `json:"vendor"`
+ Status ImageStatus `json:"status"`
+ Size int `json:"size"`
+ TotalSize int `json:"total_size"`
+ IsPublic bool `json:"is_public"`
+ Deprecated bool `json:"deprecated"`
+ Regions []ImageRegion `json:"regions"`
+ Tags []string `json:"tags"`
+
+ Updated *time.Time `json:"-"`
+ Created *time.Time `json:"-"`
+ Expiry *time.Time `json:"-"`
+ EOL *time.Time `json:"-"`
}
// ImageCreateOptions fields are those accepted by CreateImage
type ImageCreateOptions struct {
- DiskID int `json:"disk_id"`
- Label string `json:"label"`
- Description string `json:"description,omitempty"`
- CloudInit bool `json:"cloud_init,omitempty"`
+ DiskID int `json:"disk_id"`
+ Label string `json:"label"`
+ Description string `json:"description,omitempty"`
+ CloudInit bool `json:"cloud_init,omitempty"`
+ Tags *[]string `json:"tags,omitempty"`
}
// ImageUpdateOptions fields are those accepted by UpdateImage
type ImageUpdateOptions struct {
- Label string `json:"label,omitempty"`
- Description *string `json:"description,omitempty"`
+ Label string `json:"label,omitempty"`
+ Description *string `json:"description,omitempty"`
+ Tags *[]string `json:"tags,omitempty"`
+}
+
+// ImageReplicateOptions represents the options accepted by the
+// ReplicateImage(...) function.
+type ImageReplicateOptions struct {
+ Regions []string `json:"regions"`
}
// ImageCreateUploadResponse fields are those returned by CreateImageUpload
@@ -61,18 +93,20 @@ type ImageCreateUploadResponse struct {
// ImageCreateUploadOptions fields are those accepted by CreateImageUpload
type ImageCreateUploadOptions struct {
- Region string `json:"region"`
- Label string `json:"label"`
- Description string `json:"description,omitempty"`
- CloudInit bool `json:"cloud_init,omitempty"`
+ Region string `json:"region"`
+ Label string `json:"label"`
+ Description string `json:"description,omitempty"`
+ CloudInit bool `json:"cloud_init,omitempty"`
+ Tags *[]string `json:"tags,omitempty"`
}
// ImageUploadOptions fields are those accepted by UploadImage
type ImageUploadOptions struct {
- Region string `json:"region"`
- Label string `json:"label"`
- Description string `json:"description,omitempty"`
- CloudInit bool `json:"cloud_init"`
+ Region string `json:"region"`
+ Label string `json:"label"`
+ Description string `json:"description,omitempty"`
+ CloudInit bool `json:"cloud_init"`
+ Tags *[]string `json:"tags,omitempty"`
Image io.Reader
}
@@ -82,8 +116,10 @@ func (i *Image) UnmarshalJSON(b []byte) error {
p := struct {
*Mask
+ Updated *parseabletime.ParseableTime `json:"updated"`
Created *parseabletime.ParseableTime `json:"created"`
Expiry *parseabletime.ParseableTime `json:"expiry"`
+ EOL *parseabletime.ParseableTime `json:"eol"`
}{
Mask: (*Mask)(i),
}
@@ -92,8 +128,10 @@ func (i *Image) UnmarshalJSON(b []byte) error {
return err
}
+ i.Updated = (*time.Time)(p.Updated)
i.Created = (*time.Time)(p.Created)
i.Expiry = (*time.Time)(p.Expiry)
+ i.EOL = (*time.Time)(p.EOL)
return nil
}
@@ -105,114 +143,81 @@ func (i Image) GetUpdateOptions() (iu ImageUpdateOptions) {
return
}
-// ImagesPagedResponse represents a linode API response for listing of images
-type ImagesPagedResponse struct {
- *PageOptions
- Data []Image `json:"data"`
-}
-
-func (ImagesPagedResponse) endpoint(_ ...any) string {
- return "images"
-}
-
-func (resp *ImagesPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(ImagesPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*ImagesPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
-// ListImages lists Images
+// ListImages lists Images.
func (c *Client) ListImages(ctx context.Context, opts *ListOptions) ([]Image, error) {
- response := ImagesPagedResponse{}
- err := c.listHelper(ctx, &response, opts)
- if err != nil {
- return nil, err
- }
- return response.Data, nil
+ return getPaginatedResults[Image](
+ ctx,
+ c,
+ "images",
+ opts,
+ )
}
-// GetImage gets the Image with the provided ID
+// GetImage gets the Image with the provided ID.
func (c *Client) GetImage(ctx context.Context, imageID string) (*Image, error) {
- imageID = url.PathEscape(imageID)
-
- e := fmt.Sprintf("images/%s", imageID)
- req := c.R(ctx).SetResult(&Image{})
- r, err := coupleAPIErrors(req.Get(e))
- if err != nil {
- return nil, err
- }
- return r.Result().(*Image), nil
+ return doGETRequest[Image](
+ ctx,
+ c,
+ formatAPIPath("images/%s", imageID),
+ )
}
-// CreateImage creates an Image
+// CreateImage creates an Image.
func (c *Client) CreateImage(ctx context.Context, opts ImageCreateOptions) (*Image, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
- e := "images"
- req := c.R(ctx).SetResult(&Image{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Post(e))
- if err != nil {
- return nil, err
- }
- return r.Result().(*Image), nil
+ return doPOSTRequest[Image](
+ ctx,
+ c,
+ "images",
+ opts,
+ )
}
-// UpdateImage updates the Image with the specified id
+// UpdateImage updates the Image with the specified id.
func (c *Client) UpdateImage(ctx context.Context, imageID string, opts ImageUpdateOptions) (*Image, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
- imageID = url.PathEscape(imageID)
-
- e := fmt.Sprintf("images/%s", imageID)
- req := c.R(ctx).SetResult(&Image{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Put(e))
- if err != nil {
- return nil, err
- }
- return r.Result().(*Image), nil
-}
-
-// DeleteImage deletes the Image with the specified id
+ return doPUTRequest[Image](
+ ctx,
+ c,
+ formatAPIPath("images/%s", imageID),
+ opts,
+ )
+}
+
+// ReplicateImage replicates an image to a given set of regions.
+// NOTE: Image replication may not currently be available to all users.
+func (c *Client) ReplicateImage(ctx context.Context, imageID string, opts ImageReplicateOptions) (*Image, error) {
+ return doPOSTRequest[Image](
+ ctx,
+ c,
+ formatAPIPath("images/%s/regions", imageID),
+ opts,
+ )
+}
+
+// DeleteImage deletes the Image with the specified id.
func (c *Client) DeleteImage(ctx context.Context, imageID string) error {
- imageID = url.PathEscape(imageID)
- e := fmt.Sprintf("images/%s", imageID)
- _, err := coupleAPIErrors(c.R(ctx).Delete(e))
- return err
+ return doDELETERequest(
+ ctx,
+ c,
+ formatAPIPath("images/%s", imageID),
+ )
}
-// CreateImageUpload creates an Image and an upload URL
+// CreateImageUpload creates an Image and an upload URL.
func (c *Client) CreateImageUpload(ctx context.Context, opts ImageCreateUploadOptions) (*Image, string, error) {
- body, err := json.Marshal(opts)
+ result, err := doPOSTRequest[ImageCreateUploadResponse](
+ ctx,
+ c,
+ "images/upload",
+ opts,
+ )
if err != nil {
return nil, "", err
}
- e := "images/upload"
- req := c.R(ctx).SetResult(&ImageCreateUploadResponse{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Post(e))
- if err != nil {
- return nil, "", err
- }
-
- result, ok := r.Result().(*ImageCreateUploadResponse)
- if !ok {
- return nil, "", fmt.Errorf("failed to parse result")
- }
-
return result.Image, result.UploadTo, nil
}
-// UploadImageToURL uploads the given image to the given upload URL
+// UploadImageToURL uploads the given image to the given upload URL.
func (c *Client) UploadImageToURL(ctx context.Context, uploadURL string, image io.Reader) error {
// Linode-specific headers do not need to be sent to this endpoint
req := resty.New().SetDebug(c.resty.Debug).R().
@@ -227,13 +232,14 @@ func (c *Client) UploadImageToURL(ctx context.Context, uploadURL string, image i
return err
}
-// UploadImage creates and uploads an image
+// UploadImage creates and uploads an image.
func (c *Client) UploadImage(ctx context.Context, opts ImageUploadOptions) (*Image, error) {
image, uploadURL, err := c.CreateImageUpload(ctx, ImageCreateUploadOptions{
Label: opts.Label,
Region: opts.Region,
Description: opts.Description,
CloudInit: opts.CloudInit,
+ Tags: opts.Tags,
})
if err != nil {
return nil, err
diff --git a/vendor/github.com/linode/linodego/instance_config_interfaces.go b/vendor/github.com/linode/linodego/instance_config_interfaces.go
index d975ddcb..945bcf90 100644
--- a/vendor/github.com/linode/linodego/instance_config_interfaces.go
+++ b/vendor/github.com/linode/linodego/instance_config_interfaces.go
@@ -2,8 +2,6 @@ package linodego
import (
"context"
- "encoding/json"
- "fmt"
)
// InstanceConfigInterface contains information about a configuration's network interface
@@ -16,13 +14,13 @@ type InstanceConfigInterface struct {
Active bool `json:"active"`
VPCID *int `json:"vpc_id"`
SubnetID *int `json:"subnet_id"`
- IPv4 VPCIPv4 `json:"ipv4"`
+ IPv4 *VPCIPv4 `json:"ipv4"`
IPRanges []string `json:"ip_ranges"`
}
type VPCIPv4 struct {
- VPC string `json:"vpc,omitempty"`
- NAT1To1 string `json:"nat_1_1,omitempty"`
+ VPC string `json:"vpc,omitempty"`
+ NAT1To1 *string `json:"nat_1_1,omitempty"`
}
type InstanceConfigInterfaceCreateOptions struct {
@@ -36,9 +34,9 @@ type InstanceConfigInterfaceCreateOptions struct {
}
type InstanceConfigInterfaceUpdateOptions struct {
- Primary bool `json:"primary,omitempty"`
- IPv4 *VPCIPv4 `json:"ipv4,omitempty"`
- IPRanges []string `json:"ip_ranges,omitempty"`
+ Primary bool `json:"primary,omitempty"`
+ IPv4 *VPCIPv4 `json:"ipv4,omitempty"`
+ IPRanges *[]string `json:"ip_ranges,omitempty"`
}
type InstanceConfigInterfacesReorderOptions struct {
@@ -67,20 +65,14 @@ func (i InstanceConfigInterface) GetCreateOptions() InstanceConfigInterfaceCreat
opts.IPRanges = i.IPRanges
}
- if i.Purpose == InterfacePurposeVPC &&
- i.IPv4.NAT1To1 != "" && i.IPv4.VPC != "" {
+ if i.Purpose == InterfacePurposeVPC && i.IPv4 != nil {
opts.IPv4 = &VPCIPv4{
VPC: i.IPv4.VPC,
NAT1To1: i.IPv4.NAT1To1,
}
}
- // workaround for API issue
- if i.IPAMAddress == "222" {
- opts.IPAMAddress = ""
- } else {
- opts.IPAMAddress = i.IPAMAddress
- }
+ opts.IPAMAddress = i.IPAMAddress
return opts
}
@@ -90,15 +82,20 @@ func (i InstanceConfigInterface) GetUpdateOptions() InstanceConfigInterfaceUpdat
Primary: i.Primary,
}
- if i.Purpose == InterfacePurposeVPC {
+ if i.Purpose == InterfacePurposeVPC && i.IPv4 != nil {
opts.IPv4 = &VPCIPv4{
VPC: i.IPv4.VPC,
NAT1To1: i.IPv4.NAT1To1,
}
}
- if len(i.IPRanges) > 0 {
- opts.IPRanges = i.IPRanges
+ if i.IPRanges != nil {
+ // Copy the slice to prevent accidental
+ // mutations
+ copiedIPRanges := make([]string, len(i.IPRanges))
+ copy(copiedIPRanges, i.IPRanges)
+
+ opts.IPRanges = &copiedIPRanges
}
return opts
@@ -110,19 +107,13 @@ func (c *Client) AppendInstanceConfigInterface(
configID int,
opts InstanceConfigInterfaceCreateOptions,
) (*InstanceConfigInterface, error) {
- body, err := json.Marshal(opts)
+ e := formatAPIPath("/linode/instances/%d/configs/%d/interfaces", linodeID, configID)
+ response, err := doPOSTRequest[InstanceConfigInterface](ctx, c, e, opts)
if err != nil {
return nil, err
}
- req := c.R(ctx).SetResult(&InstanceConfigInterface{}).SetBody(string(body))
- e := fmt.Sprintf("/linode/instances/%d/configs/%d/interfaces", linodeID, configID)
- r, err := coupleAPIErrors(req.Post(e))
- if err != nil {
- return nil, err
- }
-
- return r.Result().(*InstanceConfigInterface), nil
+ return response, nil
}
func (c *Client) GetInstanceConfigInterface(
@@ -131,18 +122,18 @@ func (c *Client) GetInstanceConfigInterface(
configID int,
interfaceID int,
) (*InstanceConfigInterface, error) {
- e := fmt.Sprintf(
+ e := formatAPIPath(
"linode/instances/%d/configs/%d/interfaces/%d",
linodeID,
configID,
interfaceID,
)
- req := c.R(ctx).SetResult(&InstanceConfigInterface{})
- r, err := coupleAPIErrors(req.Get(e))
+ response, err := doGETRequest[InstanceConfigInterface](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*InstanceConfigInterface), nil
+
+ return response, nil
}
func (c *Client) ListInstanceConfigInterfaces(
@@ -150,17 +141,17 @@ func (c *Client) ListInstanceConfigInterfaces(
linodeID int,
configID int,
) ([]InstanceConfigInterface, error) {
- e := fmt.Sprintf(
+ e := formatAPIPath(
"linode/instances/%d/configs/%d/interfaces",
linodeID,
configID,
)
- req := c.R(ctx).SetResult([]InstanceConfigInterface{})
- r, err := coupleAPIErrors(req.Get(e))
+ response, err := doGETRequest[[]InstanceConfigInterface](ctx, c, e)
if err != nil {
return nil, err
}
- return *r.Result().(*[]InstanceConfigInterface), nil
+
+ return *response, nil
}
func (c *Client) UpdateInstanceConfigInterface(
@@ -170,23 +161,18 @@ func (c *Client) UpdateInstanceConfigInterface(
interfaceID int,
opts InstanceConfigInterfaceUpdateOptions,
) (*InstanceConfigInterface, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
- e := fmt.Sprintf(
+ e := formatAPIPath(
"linode/instances/%d/configs/%d/interfaces/%d",
linodeID,
configID,
interfaceID,
)
- req := c.R(ctx).SetResult(&InstanceConfigInterface{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Put(e))
+ response, err := doPUTRequest[InstanceConfigInterface](ctx, c, e, opts)
if err != nil {
return nil, err
}
- return r.Result().(*InstanceConfigInterface), nil
+
+ return response, nil
}
func (c *Client) DeleteInstanceConfigInterface(
@@ -195,13 +181,13 @@ func (c *Client) DeleteInstanceConfigInterface(
configID int,
interfaceID int,
) error {
- e := fmt.Sprintf(
+ e := formatAPIPath(
"linode/instances/%d/configs/%d/interfaces/%d",
linodeID,
configID,
interfaceID,
)
- _, err := coupleAPIErrors(c.R(ctx).Delete(e))
+ err := doDELETERequest(ctx, c, e)
return err
}
@@ -211,18 +197,12 @@ func (c *Client) ReorderInstanceConfigInterfaces(
configID int,
opts InstanceConfigInterfacesReorderOptions,
) error {
- body, err := json.Marshal(opts)
- if err != nil {
- return err
- }
- e := fmt.Sprintf(
+ e := formatAPIPath(
"linode/instances/%d/configs/%d/interfaces/order",
linodeID,
configID,
)
-
- req := c.R(ctx).SetBody(string(body))
- _, err = coupleAPIErrors(req.Post(e))
+ _, err := doPOSTRequest[OAuthClient](ctx, c, e, opts)
return err
}
diff --git a/vendor/github.com/linode/linodego/instance_configs.go b/vendor/github.com/linode/linodego/instance_configs.go
index 0e155f71..020fce7f 100644
--- a/vendor/github.com/linode/linodego/instance_configs.go
+++ b/vendor/github.com/linode/linodego/instance_configs.go
@@ -3,10 +3,8 @@ package linodego
import (
"context"
"encoding/json"
- "fmt"
"time"
- "github.com/go-resty/resty/v2"
"github.com/linode/linodego/internal/parseabletime"
)
@@ -64,12 +62,6 @@ const (
InterfacePurposeVPC ConfigInterfacePurpose = "vpc"
)
-// InstanceConfigsPagedResponse represents a paginated InstanceConfig API response
-type InstanceConfigsPagedResponse struct {
- *PageOptions
- Data []InstanceConfig `json:"data"`
-}
-
// InstanceConfigCreateOptions are InstanceConfig settings that can be used at creation
type InstanceConfigCreateOptions struct {
Label string `json:"label,omitempty"`
@@ -162,75 +154,47 @@ func (i InstanceConfig) GetUpdateOptions() InstanceConfigUpdateOptions {
}
}
-// endpoint gets the endpoint URL for InstanceConfigs of a given Instance
-func (InstanceConfigsPagedResponse) endpoint(ids ...any) string {
- id := ids[0].(int)
- return fmt.Sprintf("linode/instances/%d/configs", id)
-}
-
-func (resp *InstanceConfigsPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(InstanceConfigsPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*InstanceConfigsPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListInstanceConfigs lists InstanceConfigs
func (c *Client) ListInstanceConfigs(ctx context.Context, linodeID int, opts *ListOptions) ([]InstanceConfig, error) {
- response := InstanceConfigsPagedResponse{}
- err := c.listHelper(ctx, &response, opts, linodeID)
+ response, err := getPaginatedResults[InstanceConfig](ctx, c, formatAPIPath("linode/instances/%d/configs", linodeID), opts)
if err != nil {
return nil, err
}
- return response.Data, nil
+
+ return response, nil
}
// GetInstanceConfig gets the template with the provided ID
func (c *Client) GetInstanceConfig(ctx context.Context, linodeID int, configID int) (*InstanceConfig, error) {
- e := fmt.Sprintf("linode/instances/%d/configs/%d", linodeID, configID)
- req := c.R(ctx).SetResult(&InstanceConfig{})
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("linode/instances/%d/configs/%d", linodeID, configID)
+ response, err := doGETRequest[InstanceConfig](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*InstanceConfig), nil
+
+ return response, nil
}
// CreateInstanceConfig creates a new InstanceConfig for the given Instance
func (c *Client) CreateInstanceConfig(ctx context.Context, linodeID int, opts InstanceConfigCreateOptions) (*InstanceConfig, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
- e := fmt.Sprintf("linode/instances/%d/configs", linodeID)
- req := c.R(ctx).SetResult(&InstanceConfig{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Post(e))
+ e := formatAPIPath("linode/instances/%d/configs", linodeID)
+ response, err := doPOSTRequest[InstanceConfig](ctx, c, e, opts)
if err != nil {
return nil, err
}
- return r.Result().(*InstanceConfig), nil
+ return response, nil
}
// UpdateInstanceConfig update an InstanceConfig for the given Instance
func (c *Client) UpdateInstanceConfig(ctx context.Context, linodeID int, configID int, opts InstanceConfigUpdateOptions) (*InstanceConfig, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
- e := fmt.Sprintf("linode/instances/%d/configs/%d", linodeID, configID)
- req := c.R(ctx).SetResult(&InstanceConfig{}).SetBody(body)
- r, err := coupleAPIErrors(req.Put(e))
+ e := formatAPIPath("linode/instances/%d/configs/%d", linodeID, configID)
+ response, err := doPUTRequest[InstanceConfig](ctx, c, e, opts)
if err != nil {
return nil, err
}
- return r.Result().(*InstanceConfig), nil
+ return response, nil
}
// RenameInstanceConfig renames an InstanceConfig
@@ -240,7 +204,7 @@ func (c *Client) RenameInstanceConfig(ctx context.Context, linodeID int, configI
// DeleteInstanceConfig deletes a Linode InstanceConfig
func (c *Client) DeleteInstanceConfig(ctx context.Context, linodeID int, configID int) error {
- e := fmt.Sprintf("linode/instances/%d/configs/%d", linodeID, configID)
- _, err := coupleAPIErrors(c.R(ctx).Delete(e))
+ e := formatAPIPath("linode/instances/%d/configs/%d", linodeID, configID)
+ err := doDELETERequest(ctx, c, e)
return err
}
diff --git a/vendor/github.com/linode/linodego/instance_disks.go b/vendor/github.com/linode/linodego/instance_disks.go
index 6be455c9..9ae18c83 100644
--- a/vendor/github.com/linode/linodego/instance_disks.go
+++ b/vendor/github.com/linode/linodego/instance_disks.go
@@ -3,10 +3,8 @@ package linodego
import (
"context"
"encoding/json"
- "fmt"
"time"
- "github.com/go-resty/resty/v2"
"github.com/linode/linodego/internal/parseabletime"
)
@@ -19,6 +17,9 @@ type InstanceDisk struct {
Filesystem DiskFilesystem `json:"filesystem"`
Created *time.Time `json:"-"`
Updated *time.Time `json:"-"`
+
+ // NOTE: Disk encryption may not currently be available to all users.
+ DiskEncryption InstanceDiskEncryption `json:"disk_encryption"`
}
// DiskFilesystem constants start with Filesystem and include Linode API Filesystems
@@ -43,12 +44,6 @@ const (
DiskDeleting DiskStatus = "deleting"
)
-// InstanceDisksPagedResponse represents a paginated InstanceDisk API response
-type InstanceDisksPagedResponse struct {
- *PageOptions
- Data []InstanceDisk `json:"data"`
-}
-
// InstanceDiskCreateOptions are InstanceDisk settings that can be used at creation
type InstanceDiskCreateOptions struct {
Label string `json:"label"`
@@ -61,41 +56,25 @@ type InstanceDiskCreateOptions struct {
Filesystem string `json:"filesystem,omitempty"`
AuthorizedKeys []string `json:"authorized_keys,omitempty"`
AuthorizedUsers []string `json:"authorized_users,omitempty"`
- ReadOnly bool `json:"read_only,omitempty"`
StackscriptID int `json:"stackscript_id,omitempty"`
StackscriptData map[string]string `json:"stackscript_data,omitempty"`
}
// InstanceDiskUpdateOptions are InstanceDisk settings that can be used in updates
type InstanceDiskUpdateOptions struct {
- Label string `json:"label"`
- ReadOnly bool `json:"read_only"`
-}
-
-// endpoint gets the endpoint URL for InstanceDisks of a given Instance
-func (InstanceDisksPagedResponse) endpoint(ids ...any) string {
- id := ids[0].(int)
- return fmt.Sprintf("linode/instances/%d/disks", id)
+ Label string `json:"label"`
}
-func (resp *InstanceDisksPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(InstanceDisksPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*InstanceDisksPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
+type InstanceDiskCloneOptions struct{}
// ListInstanceDisks lists InstanceDisks
func (c *Client) ListInstanceDisks(ctx context.Context, linodeID int, opts *ListOptions) ([]InstanceDisk, error) {
- response := InstanceDisksPagedResponse{}
- err := c.listHelper(ctx, &response, opts, linodeID)
+ response, err := getPaginatedResults[InstanceDisk](ctx, c, formatAPIPath("linode/instances/%d/disks", linodeID), opts)
if err != nil {
return nil, err
}
- return response.Data, nil
+
+ return response, nil
}
// UnmarshalJSON implements the json.Unmarshaler interface
@@ -122,47 +101,35 @@ func (i *InstanceDisk) UnmarshalJSON(b []byte) error {
// GetInstanceDisk gets the template with the provided ID
func (c *Client) GetInstanceDisk(ctx context.Context, linodeID int, diskID int) (*InstanceDisk, error) {
- e := fmt.Sprintf("linode/instances/%d/disks/%d", linodeID, diskID)
- req := c.R(ctx).SetResult(&InstanceDisk{})
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("linode/instances/%d/disks/%d", linodeID, diskID)
+ response, err := doGETRequest[InstanceDisk](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*InstanceDisk), nil
+
+ return response, nil
}
// CreateInstanceDisk creates a new InstanceDisk for the given Instance
func (c *Client) CreateInstanceDisk(ctx context.Context, linodeID int, opts InstanceDiskCreateOptions) (*InstanceDisk, error) {
- body, err := json.Marshal(opts)
+ e := formatAPIPath("linode/instances/%d/disks", linodeID)
+ response, err := doPOSTRequest[InstanceDisk](ctx, c, e, opts)
if err != nil {
return nil, err
}
- e := fmt.Sprintf("linode/instances/%d/disks", linodeID)
- req := c.R(ctx).SetResult(&InstanceDisk{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Post(e))
- if err != nil {
- return nil, err
- }
-
- return r.Result().(*InstanceDisk), nil
+ return response, nil
}
// UpdateInstanceDisk creates a new InstanceDisk for the given Instance
func (c *Client) UpdateInstanceDisk(ctx context.Context, linodeID int, diskID int, opts InstanceDiskUpdateOptions) (*InstanceDisk, error) {
- body, err := json.Marshal(opts)
+ e := formatAPIPath("linode/instances/%d/disks/%d", linodeID, diskID)
+ response, err := doPUTRequest[InstanceDisk](ctx, c, e, opts)
if err != nil {
return nil, err
}
- e := fmt.Sprintf("linode/instances/%d/disks/%d", linodeID, diskID)
- req := c.R(ctx).SetResult(&InstanceDisk{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Put(e))
- if err != nil {
- return nil, err
- }
-
- return r.Result().(*InstanceDisk), nil
+ return response, nil
}
// RenameInstanceDisk renames an InstanceDisk
@@ -176,14 +143,9 @@ func (c *Client) ResizeInstanceDisk(ctx context.Context, linodeID int, diskID in
"size": size,
}
- body, err := json.Marshal(opts)
- if err != nil {
- return err
- }
+ e := formatAPIPath("linode/instances/%d/disks/%d/resize", linodeID, diskID)
+ _, err := doPOSTRequest[InstanceDisk](ctx, c, e, opts)
- e := fmt.Sprintf("linode/instances/%d/disks/%d/resize", linodeID, diskID)
- req := c.R(ctx).SetResult(&InstanceDisk{}).SetBody(body)
- _, err = coupleAPIErrors(req.Post(e))
return err
}
@@ -193,20 +155,21 @@ func (c *Client) PasswordResetInstanceDisk(ctx context.Context, linodeID int, di
"password": password,
}
- body, err := json.Marshal(opts)
- if err != nil {
- return err
- }
+ e := formatAPIPath("linode/instances/%d/disks/%d/password", linodeID, diskID)
+ _, err := doPOSTRequest[InstanceDisk](ctx, c, e, opts)
- e := fmt.Sprintf("linode/instances/%d/disks/%d/password", linodeID, diskID)
- req := c.R(ctx).SetResult(&InstanceDisk{}).SetBody(string(body))
- _, err = coupleAPIErrors(req.SetBody(body).Post(e))
return err
}
// DeleteInstanceDisk deletes a Linode Instance Disk
func (c *Client) DeleteInstanceDisk(ctx context.Context, linodeID int, diskID int) error {
- e := fmt.Sprintf("linode/instances/%d/disks/%d", linodeID, diskID)
- _, err := coupleAPIErrors(c.R(ctx).Delete(e))
+ e := formatAPIPath("linode/instances/%d/disks/%d", linodeID, diskID)
+ err := doDELETERequest(ctx, c, e)
return err
}
+
+// CloneInstanceDisk clones the given InstanceDisk for the given Instance
+func (c *Client) CloneInstanceDisk(ctx context.Context, linodeID, diskID int, opts InstanceDiskCloneOptions) (*InstanceDisk, error) {
+ e := formatAPIPath("linode/instances/%d/disks/%d/clone", linodeID, diskID)
+ return doPOSTRequest[InstanceDisk](ctx, c, e, opts)
+}
diff --git a/vendor/github.com/linode/linodego/instance_firewalls.go b/vendor/github.com/linode/linodego/instance_firewalls.go
index ffca799e..2ab254df 100644
--- a/vendor/github.com/linode/linodego/instance_firewalls.go
+++ b/vendor/github.com/linode/linodego/instance_firewalls.go
@@ -2,40 +2,14 @@ package linodego
import (
"context"
- "fmt"
-
- "github.com/go-resty/resty/v2"
)
-// InstanceFirewallsPagedResponse represents a Linode API response for listing of Cloud Firewalls
-type InstanceFirewallsPagedResponse struct {
- *PageOptions
- Data []Firewall `json:"data"`
-}
-
-func (InstanceFirewallsPagedResponse) endpoint(ids ...any) string {
- id := ids[0].(int)
- return fmt.Sprintf("linode/instances/%d/firewalls", id)
-}
-
-func (resp *InstanceFirewallsPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(InstanceFirewallsPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*InstanceFirewallsPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListInstanceFirewalls returns a paginated list of Cloud Firewalls for linodeID
func (c *Client) ListInstanceFirewalls(ctx context.Context, linodeID int, opts *ListOptions) ([]Firewall, error) {
- response := InstanceFirewallsPagedResponse{}
-
- err := c.listHelper(ctx, &response, opts, linodeID)
+ response, err := getPaginatedResults[Firewall](ctx, c, formatAPIPath("linode/instances/%d/firewalls", linodeID), opts)
if err != nil {
return nil, err
}
- return response.Data, nil
+ return response, nil
}
diff --git a/vendor/github.com/linode/linodego/instance_ips.go b/vendor/github.com/linode/linodego/instance_ips.go
index beaeb0a2..7a5ad62c 100644
--- a/vendor/github.com/linode/linodego/instance_ips.go
+++ b/vendor/github.com/linode/linodego/instance_ips.go
@@ -2,9 +2,6 @@ package linodego
import (
"context"
- "encoding/json"
- "fmt"
- "net/url"
)
// InstanceIPAddressResponse contains the IPv4 and IPv6 details for an Instance
@@ -19,6 +16,7 @@ type InstanceIPv4Response struct {
Private []*InstanceIP `json:"private"`
Shared []*InstanceIP `json:"shared"`
Reserved []*InstanceIP `json:"reserved"`
+ VPC []*VPCIP `json:"vpc"`
}
// InstanceIP represents an Instance IP with additional DNS and networking details
@@ -33,6 +31,24 @@ type InstanceIP struct {
LinodeID int `json:"linode_id"`
Region string `json:"region"`
VPCNAT1To1 *InstanceIPNAT1To1 `json:"vpc_nat_1_1"`
+ Reserved bool `json:"reserved"`
+}
+
+// VPCIP represents a private IP address in a VPC subnet with additional networking details
+type VPCIP struct {
+ Address *string `json:"address"`
+ AddressRange *string `json:"address_range"`
+ Gateway string `json:"gateway"`
+ SubnetMask string `json:"subnet_mask"`
+ Prefix int `json:"prefix"`
+ LinodeID int `json:"linode_id"`
+ Region string `json:"region"`
+ Active bool `json:"active"`
+ NAT1To1 *string `json:"nat_1_1"`
+ VPCID int `json:"vpc_id"`
+ SubnetID int `json:"subnet_id"`
+ ConfigID int `json:"config_id"`
+ InterfaceID int `json:"interface_id"`
}
// InstanceIPv6Response contains the IPv6 addresses and ranges for an Instance
@@ -63,6 +79,12 @@ type IPv6Range struct {
Linodes []int `json:"linodes"`
}
+type InstanceReserveIPOptions struct {
+ Type string `json:"type"`
+ Public bool `json:"public"`
+ Address string `json:"address"`
+}
+
// InstanceIPType constants start with IPType and include Linode Instance IP Types
type InstanceIPType string
@@ -76,26 +98,24 @@ const (
// GetInstanceIPAddresses gets the IPAddresses for a Linode instance
func (c *Client) GetInstanceIPAddresses(ctx context.Context, linodeID int) (*InstanceIPAddressResponse, error) {
- e := fmt.Sprintf("linode/instances/%d/ips", linodeID)
- req := c.R(ctx).SetResult(&InstanceIPAddressResponse{})
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("linode/instances/%d/ips", linodeID)
+ response, err := doGETRequest[InstanceIPAddressResponse](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*InstanceIPAddressResponse), nil
+
+ return response, nil
}
// GetInstanceIPAddress gets the IPAddress for a Linode instance matching a supplied IP address
func (c *Client) GetInstanceIPAddress(ctx context.Context, linodeID int, ipaddress string) (*InstanceIP, error) {
- ipaddress = url.PathEscape(ipaddress)
- e := fmt.Sprintf("linode/instances/%d/ips/%s", linodeID, ipaddress)
- req := c.R(ctx).SetResult(&InstanceIP{})
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("linode/instances/%d/ips/%s", linodeID, ipaddress)
+ response, err := doGETRequest[InstanceIP](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*InstanceIP), nil
+ return response, nil
}
// AddInstanceIPAddress adds a public or private IP to a Linode instance
@@ -105,42 +125,38 @@ func (c *Client) AddInstanceIPAddress(ctx context.Context, linodeID int, public
Public bool `json:"public"`
}{"ipv4", public}
- body, err := json.Marshal(instanceipRequest)
- if err != nil {
- return nil, err
- }
-
- e := fmt.Sprintf("linode/instances/%d/ips", linodeID)
- req := c.R(ctx).SetResult(&InstanceIP{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Post(e))
+ e := formatAPIPath("linode/instances/%d/ips", linodeID)
+ response, err := doPOSTRequest[InstanceIP](ctx, c, e, instanceipRequest)
if err != nil {
return nil, err
}
- return r.Result().(*InstanceIP), nil
+ return response, nil
}
// UpdateInstanceIPAddress updates the IPAddress with the specified instance id and IP address
func (c *Client) UpdateInstanceIPAddress(ctx context.Context, linodeID int, ipAddress string, opts IPAddressUpdateOptions) (*InstanceIP, error) {
- body, err := json.Marshal(opts)
+ e := formatAPIPath("linode/instances/%d/ips/%s", linodeID, ipAddress)
+ response, err := doPUTRequest[InstanceIP](ctx, c, e, opts)
if err != nil {
return nil, err
}
- ipAddress = url.PathEscape(ipAddress)
-
- e := fmt.Sprintf("linode/instances/%d/ips/%s", linodeID, ipAddress)
- req := c.R(ctx).SetResult(&InstanceIP{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Put(e))
- if err != nil {
- return nil, err
- }
- return r.Result().(*InstanceIP), nil
+ return response, nil
}
func (c *Client) DeleteInstanceIPAddress(ctx context.Context, linodeID int, ipAddress string) error {
- ipAddress = url.PathEscape(ipAddress)
- e := fmt.Sprintf("linode/instances/%d/ips/%s", linodeID, ipAddress)
- _, err := coupleAPIErrors(c.R(ctx).Delete(e))
+ e := formatAPIPath("linode/instances/%d/ips/%s", linodeID, ipAddress)
+ err := doDELETERequest(ctx, c, e)
return err
}
+
+// Function to add additional reserved IPV4 addresses to an existing linode
+func (c *Client) AssignInstanceReservedIP(ctx context.Context, linodeID int, opts InstanceReserveIPOptions) (*InstanceIP, error) {
+ endpoint := formatAPIPath("linode/instances/%d/ips", linodeID)
+ response, err := doPOSTRequest[InstanceIP](ctx, c, endpoint, opts)
+ if err != nil {
+ return nil, err
+ }
+ return response, nil
+}
diff --git a/vendor/github.com/linode/linodego/instance_nodebalancers.go b/vendor/github.com/linode/linodego/instance_nodebalancers.go
new file mode 100644
index 00000000..a390832a
--- /dev/null
+++ b/vendor/github.com/linode/linodego/instance_nodebalancers.go
@@ -0,0 +1,10 @@
+package linodego
+
+import (
+ "context"
+)
+
+// ListInstanceNodeBalancers lists NodeBalancers that the provided instance is a node in
+func (c *Client) ListInstanceNodeBalancers(ctx context.Context, linodeID int, opts *ListOptions) ([]NodeBalancer, error) {
+ return getPaginatedResults[NodeBalancer](ctx, c, formatAPIPath("linode/instances/%d/nodebalancers", linodeID), opts)
+}
diff --git a/vendor/github.com/linode/linodego/instance_snapshots.go b/vendor/github.com/linode/linodego/instance_snapshots.go
index fd81e101..6a58dced 100644
--- a/vendor/github.com/linode/linodego/instance_snapshots.go
+++ b/vendor/github.com/linode/linodego/instance_snapshots.go
@@ -3,7 +3,6 @@ package linodego
import (
"context"
"encoding/json"
- "fmt"
"time"
"github.com/linode/linodego/internal/parseabletime"
@@ -88,64 +87,57 @@ func (i *InstanceSnapshot) UnmarshalJSON(b []byte) error {
// GetInstanceSnapshot gets the snapshot with the provided ID
func (c *Client) GetInstanceSnapshot(ctx context.Context, linodeID int, snapshotID int) (*InstanceSnapshot, error) {
- e := fmt.Sprintf("linode/instances/%d/backups/%d", linodeID, snapshotID)
- req := c.R(ctx).SetResult(&InstanceSnapshot{})
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("linode/instances/%d/backups/%d", linodeID, snapshotID)
+ response, err := doGETRequest[InstanceSnapshot](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*InstanceSnapshot), nil
+
+ return response, nil
}
// CreateInstanceSnapshot Creates or Replaces the snapshot Backup of a Linode. If a previous snapshot exists for this Linode, it will be deleted.
func (c *Client) CreateInstanceSnapshot(ctx context.Context, linodeID int, label string) (*InstanceSnapshot, error) {
- body, err := json.Marshal(map[string]string{"label": label})
- if err != nil {
- return nil, err
- }
- e := fmt.Sprintf("linode/instances/%d/backups", linodeID)
- req := c.R(ctx).SetResult(&InstanceSnapshot{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Post(e))
+ opts := map[string]string{"label": label}
+
+ e := formatAPIPath("linode/instances/%d/backups", linodeID)
+ response, err := doPOSTRequest[InstanceSnapshot](ctx, c, e, opts)
if err != nil {
return nil, err
}
- return r.Result().(*InstanceSnapshot), nil
+ return response, nil
}
// GetInstanceBackups gets the Instance's available Backups.
// This is not called ListInstanceBackups because a single object is returned, matching the API response.
func (c *Client) GetInstanceBackups(ctx context.Context, linodeID int) (*InstanceBackupsResponse, error) {
- e := fmt.Sprintf("linode/instances/%d/backups", linodeID)
- req := c.R(ctx).SetResult(&InstanceBackupsResponse{})
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("linode/instances/%d/backups", linodeID)
+ response, err := doGETRequest[InstanceBackupsResponse](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*InstanceBackupsResponse), nil
+
+ return response, nil
}
// EnableInstanceBackups Enables backups for the specified Linode.
func (c *Client) EnableInstanceBackups(ctx context.Context, linodeID int) error {
- e := fmt.Sprintf("linode/instances/%d/backups/enable", linodeID)
- _, err := coupleAPIErrors(c.R(ctx).Post(e))
+ e := formatAPIPath("linode/instances/%d/backups/enable", linodeID)
+ _, err := doPOSTRequest[InstanceBackup, any](ctx, c, e)
return err
}
// CancelInstanceBackups Cancels backups for the specified Linode.
func (c *Client) CancelInstanceBackups(ctx context.Context, linodeID int) error {
- e := fmt.Sprintf("linode/instances/%d/backups/cancel", linodeID)
- _, err := coupleAPIErrors(c.R(ctx).Post(e))
+ e := formatAPIPath("linode/instances/%d/backups/cancel", linodeID)
+ _, err := doPOSTRequest[InstanceBackup, any](ctx, c, e)
return err
}
// RestoreInstanceBackup Restores a Linode's Backup to the specified Linode.
func (c *Client) RestoreInstanceBackup(ctx context.Context, linodeID int, backupID int, opts RestoreInstanceOptions) error {
- body, err := json.Marshal(opts)
- if err != nil {
- return NewError(err)
- }
- e := fmt.Sprintf("linode/instances/%d/backups/%d/restore", linodeID, backupID)
- _, err = coupleAPIErrors(c.R(ctx).SetBody(string(body)).Post(e))
+ e := formatAPIPath("linode/instances/%d/backups/%d/restore", linodeID, backupID)
+ _, err := doPOSTRequest[InstanceBackup](ctx, c, e, opts)
return err
}
diff --git a/vendor/github.com/linode/linodego/instance_stats.go b/vendor/github.com/linode/linodego/instance_stats.go
index a30b0621..ad5190e4 100644
--- a/vendor/github.com/linode/linodego/instance_stats.go
+++ b/vendor/github.com/linode/linodego/instance_stats.go
@@ -2,7 +2,6 @@ package linodego
import (
"context"
- "fmt"
)
// StatsNet represents a network stats object
@@ -35,22 +34,22 @@ type InstanceStats struct {
// GetInstanceStats gets the template with the provided ID
func (c *Client) GetInstanceStats(ctx context.Context, linodeID int) (*InstanceStats, error) {
- e := fmt.Sprintf("linode/instances/%d/stats", linodeID)
- req := c.R(ctx).SetResult(&InstanceStats{})
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("linode/instances/%d/stats", linodeID)
+ response, err := doGETRequest[InstanceStats](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*InstanceStats), nil
+
+ return response, nil
}
// GetInstanceStatsByDate gets the template with the provided ID, year, and month
func (c *Client) GetInstanceStatsByDate(ctx context.Context, linodeID int, year int, month int) (*InstanceStats, error) {
- e := fmt.Sprintf("linode/instances/%d/stats/%d/%d", linodeID, year, month)
- req := c.R(ctx).SetResult(&InstanceStats{})
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("linode/instances/%d/stats/%d/%d", linodeID, year, month)
+ response, err := doGETRequest[InstanceStats](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*InstanceStats), nil
+
+ return response, nil
}
diff --git a/vendor/github.com/linode/linodego/instance_volumes.go b/vendor/github.com/linode/linodego/instance_volumes.go
index f8a6368e..6a67edf4 100644
--- a/vendor/github.com/linode/linodego/instance_volumes.go
+++ b/vendor/github.com/linode/linodego/instance_volumes.go
@@ -2,39 +2,14 @@ package linodego
import (
"context"
- "fmt"
-
- "github.com/go-resty/resty/v2"
)
-// InstanceVolumesPagedResponse represents a paginated InstanceVolume API response
-type InstanceVolumesPagedResponse struct {
- *PageOptions
- Data []Volume `json:"data"`
-}
-
-// endpoint gets the endpoint URL for InstanceVolume
-func (InstanceVolumesPagedResponse) endpoint(ids ...any) string {
- id := ids[0].(int)
- return fmt.Sprintf("linode/instances/%d/volumes", id)
-}
-
-func (resp *InstanceVolumesPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(InstanceVolumesPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*InstanceVolumesPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListInstanceVolumes lists InstanceVolumes
func (c *Client) ListInstanceVolumes(ctx context.Context, linodeID int, opts *ListOptions) ([]Volume, error) {
- response := InstanceVolumesPagedResponse{}
- err := c.listHelper(ctx, &response, opts, linodeID)
+ response, err := getPaginatedResults[Volume](ctx, c, formatAPIPath("linode/instances/%d/volumes", linodeID), opts)
if err != nil {
return nil, err
}
- return response.Data, nil
+
+ return response, nil
}
diff --git a/vendor/github.com/linode/linodego/instances.go b/vendor/github.com/linode/linodego/instances.go
index f5659730..e9654526 100644
--- a/vendor/github.com/linode/linodego/instances.go
+++ b/vendor/github.com/linode/linodego/instances.go
@@ -3,17 +3,14 @@ package linodego
import (
"context"
"encoding/json"
- "fmt"
"net"
- "net/url"
"time"
- "github.com/go-resty/resty/v2"
"github.com/linode/linodego/internal/parseabletime"
)
/*
- * https://developers.linode.com/v4/reference/endpoints/linode/instances
+ * https://techdocs.akamai.com/linode-api/reference/post-linode-instance
*/
// InstanceStatus constants start with Instance and include Linode API Instance Status values
@@ -63,6 +60,14 @@ type Instance struct {
Specs *InstanceSpec `json:"specs"`
WatchdogEnabled bool `json:"watchdog_enabled"`
Tags []string `json:"tags"`
+
+ PlacementGroup *InstancePlacementGroup `json:"placement_group"`
+
+ // NOTE: Disk encryption may not currently be available to all users.
+ DiskEncryption InstanceDiskEncryption `json:"disk_encryption"`
+
+ LKEClusterID int `json:"lke_cluster_id"`
+ Capabilities []string `json:"capabilities"`
}
// InstanceSpec represents a linode spec
@@ -93,6 +98,13 @@ type InstanceBackup struct {
} `json:"schedule,omitempty"`
}
+type InstanceDiskEncryption string
+
+const (
+ InstanceDiskEncryptionEnabled InstanceDiskEncryption = "enabled"
+ InstanceDiskEncryptionDisabled InstanceDiskEncryption = "disabled"
+)
+
// InstanceTransfer pool stats for a Linode Instance during the current billing month
type InstanceTransfer struct {
// Bytes of transfer this instance has consumed
@@ -105,6 +117,27 @@ type InstanceTransfer struct {
Quota int `json:"quota"`
}
+// MonthlyInstanceTransferStats pool stats for a Linode Instance network transfer statistics for a specific month
+type MonthlyInstanceTransferStats struct {
+ // The amount of inbound public network traffic received by this Linode, in bytes, for a specific year/month.
+ BytesIn int `json:"bytes_in"`
+
+ // The amount of outbound public network traffic sent by this Linode, in bytes, for a specific year/month.
+ BytesOut int `json:"bytes_out"`
+
+ // The total amount of public network traffic sent and received by this Linode, in bytes, for a specific year/month.
+ BytesTotal int `json:"bytes_total"`
+}
+
+// InstancePlacementGroup represents information about the placement group
+// this Linode is a part of.
+type InstancePlacementGroup struct {
+ ID int `json:"id"`
+ Label string `json:"label"`
+ PlacementGroupType PlacementGroupType `json:"placement_group_type"`
+ PlacementGroupPolicy PlacementGroupPolicy `json:"placement_group_policy"`
+}
+
// InstanceMetadataOptions specifies various Instance creation fields
// that relate to the Linode Metadata service.
type InstanceMetadataOptions struct {
@@ -112,12 +145,16 @@ type InstanceMetadataOptions struct {
UserData string `json:"user_data,omitempty"`
}
+// InstancePasswordResetOptions specifies the new password for the Linode
+type InstancePasswordResetOptions struct {
+ RootPass string `json:"root_pass"`
+}
+
// InstanceCreateOptions require only Region and Type
type InstanceCreateOptions struct {
Region string `json:"region"`
Type string `json:"type"`
Label string `json:"label,omitempty"`
- Group string `json:"group,omitempty"`
RootPass string `json:"root_pass,omitempty"`
AuthorizedKeys []string `json:"authorized_keys,omitempty"`
AuthorizedUsers []string `json:"authorized_users,omitempty"`
@@ -132,19 +169,38 @@ type InstanceCreateOptions struct {
Metadata *InstanceMetadataOptions `json:"metadata,omitempty"`
FirewallID int `json:"firewall_id,omitempty"`
+ // NOTE: Disk encryption may not currently be available to all users.
+ DiskEncryption InstanceDiskEncryption `json:"disk_encryption,omitempty"`
+
+ PlacementGroup *InstanceCreatePlacementGroupOptions `json:"placement_group,omitempty"`
+
// Creation fields that need to be set explicitly false, "", or 0 use pointers
SwapSize *int `json:"swap_size,omitempty"`
Booted *bool `json:"booted,omitempty"`
+
+ // Deprecated: group is a deprecated property denoting a group label for the Linode.
+ Group string `json:"group,omitempty"`
+
+ IPv4 []string `json:"ipv4,omitempty"`
+}
+
+// InstanceCreatePlacementGroupOptions represents the placement group
+// to create this Linode under.
+type InstanceCreatePlacementGroupOptions struct {
+ ID int `json:"id"`
+ CompliantOnly *bool `json:"compliant_only,omitempty"`
}
// InstanceUpdateOptions is an options struct used when Updating an Instance
type InstanceUpdateOptions struct {
Label string `json:"label,omitempty"`
- Group string `json:"group,omitempty"`
Backups *InstanceBackup `json:"backups,omitempty"`
Alerts *InstanceAlert `json:"alerts,omitempty"`
WatchdogEnabled *bool `json:"watchdog_enabled,omitempty"`
Tags *[]string `json:"tags,omitempty"`
+
+ // Deprecated: group is a deprecated property denoting a group label for the Linode.
+ Group *string `json:"group,omitempty"`
}
// UnmarshalJSON implements the json.Unmarshaler interface
@@ -173,7 +229,7 @@ func (i *Instance) UnmarshalJSON(b []byte) error {
func (i *Instance) GetUpdateOptions() InstanceUpdateOptions {
return InstanceUpdateOptions{
Label: i.Label,
- Group: i.Group,
+ Group: &i.Group,
Backups: i.Backups,
Alerts: i.Alerts,
WatchdogEnabled: &i.WatchdogEnabled,
@@ -187,14 +243,17 @@ type InstanceCloneOptions struct {
Type string `json:"type,omitempty"`
// LinodeID is an optional existing instance to use as the target of the clone
- LinodeID int `json:"linode_id,omitempty"`
- Label string `json:"label,omitempty"`
- Group string `json:"group,omitempty"`
- BackupsEnabled bool `json:"backups_enabled"`
- Disks []int `json:"disks,omitempty"`
- Configs []int `json:"configs,omitempty"`
- PrivateIP bool `json:"private_ip,omitempty"`
- Metadata *InstanceMetadataOptions `json:"metadata,omitempty"`
+ LinodeID int `json:"linode_id,omitempty"`
+ Label string `json:"label,omitempty"`
+ BackupsEnabled bool `json:"backups_enabled"`
+ Disks []int `json:"disks,omitempty"`
+ Configs []int `json:"configs,omitempty"`
+ PrivateIP bool `json:"private_ip,omitempty"`
+ Metadata *InstanceMetadataOptions `json:"metadata,omitempty"`
+ PlacementGroup *InstanceCreatePlacementGroupOptions `json:"placement_group,omitempty"`
+
+ // Deprecated: group is a deprecated property denoting a group label for the Linode.
+ Group string `json:"group,omitempty"`
}
// InstanceResizeOptions is an options struct used when resizing an instance
@@ -206,95 +265,73 @@ type InstanceResizeOptions struct {
AllowAutoDiskResize *bool `json:"allow_auto_disk_resize,omitempty"`
}
-// InstanceResizeOptions is an options struct used when resizing an instance
+// InstanceMigrateOptions is an options struct used when migrating an instance
type InstanceMigrateOptions struct {
- Type InstanceMigrationType `json:"type,omitempty"`
- Region string `json:"region,omitempty"`
-}
+ Type InstanceMigrationType `json:"type,omitempty"`
+ Region string `json:"region,omitempty"`
+ Upgrade *bool `json:"upgrade,omitempty"`
-// InstancesPagedResponse represents a linode API response for listing
-type InstancesPagedResponse struct {
- *PageOptions
- Data []Instance `json:"data"`
-}
-
-// endpoint gets the endpoint URL for Instance
-func (InstancesPagedResponse) endpoint(_ ...any) string {
- return "linode/instances"
-}
-
-func (resp *InstancesPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(InstancesPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*InstancesPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
+ PlacementGroup *InstanceCreatePlacementGroupOptions `json:"placement_group,omitempty"`
}
// ListInstances lists linode instances
func (c *Client) ListInstances(ctx context.Context, opts *ListOptions) ([]Instance, error) {
- response := InstancesPagedResponse{}
- err := c.listHelper(ctx, &response, opts)
+ response, err := getPaginatedResults[Instance](ctx, c, "linode/instances", opts)
if err != nil {
return nil, err
}
- return response.Data, nil
+
+ return response, nil
}
// GetInstance gets the instance with the provided ID
func (c *Client) GetInstance(ctx context.Context, linodeID int) (*Instance, error) {
- e := fmt.Sprintf("linode/instances/%d", linodeID)
- req := c.R(ctx).SetResult(Instance{})
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("linode/instances/%d", linodeID)
+ response, err := doGETRequest[Instance](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*Instance), nil
+
+ return response, nil
}
-// GetInstanceTransfer gets the instance with the provided ID
+// GetInstanceTransfer gets the instance's network transfer pool statistics for the current month.
func (c *Client) GetInstanceTransfer(ctx context.Context, linodeID int) (*InstanceTransfer, error) {
- e := fmt.Sprintf("linode/instances/%d/transfer", linodeID)
- req := c.R(ctx).SetResult(InstanceTransfer{})
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("linode/instances/%d/transfer", linodeID)
+ response, err := doGETRequest[InstanceTransfer](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*InstanceTransfer), nil
+
+ return response, nil
+}
+
+// GetInstanceTransferMonthly gets the instance's network transfer pool statistics for a specific month.
+func (c *Client) GetInstanceTransferMonthly(ctx context.Context, linodeID, year, month int) (*MonthlyInstanceTransferStats, error) {
+ e := formatAPIPath("linode/instances/%d/transfer/%d/%d", linodeID, year, month)
+ return doGETRequest[MonthlyInstanceTransferStats](ctx, c, e)
}
// CreateInstance creates a Linode instance
func (c *Client) CreateInstance(ctx context.Context, opts InstanceCreateOptions) (*Instance, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
e := "linode/instances"
- req := c.R(ctx).SetResult(&Instance{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Post(e))
+ response, err := doPOSTRequest[Instance](ctx, c, e, opts)
if err != nil {
return nil, err
}
- return r.Result().(*Instance), nil
+
+ return response, nil
}
// UpdateInstance creates a Linode instance
func (c *Client) UpdateInstance(ctx context.Context, linodeID int, opts InstanceUpdateOptions) (*Instance, error) {
- body, err := json.Marshal(opts)
+ e := formatAPIPath("linode/instances/%d", linodeID)
+ response, err := doPUTRequest[Instance](ctx, c, e, opts)
if err != nil {
return nil, err
}
- e := fmt.Sprintf("linode/instances/%d", linodeID)
- req := c.R(ctx).SetResult(&Instance{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Put(e))
- if err != nil {
- return nil, err
- }
- return r.Result().(*Instance), nil
+ return response, nil
}
// RenameInstance renames an Instance
@@ -304,60 +341,55 @@ func (c *Client) RenameInstance(ctx context.Context, linodeID int, label string)
// DeleteInstance deletes a Linode instance
func (c *Client) DeleteInstance(ctx context.Context, linodeID int) error {
- e := fmt.Sprintf("linode/instances/%d", linodeID)
- _, err := coupleAPIErrors(c.R(ctx).Delete(e))
+ e := formatAPIPath("linode/instances/%d", linodeID)
+ err := doDELETERequest(ctx, c, e)
return err
}
// BootInstance will boot a Linode instance
// A configID of 0 will cause Linode to choose the last/best config
func (c *Client) BootInstance(ctx context.Context, linodeID int, configID int) error {
- var body string
+ opts := make(map[string]int)
+
if configID != 0 {
- bodyMap := map[string]int{"config_id": configID}
- bodyJSON, err := json.Marshal(bodyMap)
- if err != nil {
- return err
- }
- body = string(bodyJSON)
+ opts = map[string]int{"config_id": configID}
}
- e := fmt.Sprintf("linode/instances/%d/boot", linodeID)
- _, err := coupleAPIErrors(c.R(ctx).SetBody(body).Post(e))
+
+ e := formatAPIPath("linode/instances/%d/boot", linodeID)
+ _, err := doPOSTRequest[Instance](ctx, c, e, opts)
return err
}
// CloneInstance clone an existing Instances Disks and Configuration profiles to another Linode Instance
func (c *Client) CloneInstance(ctx context.Context, linodeID int, opts InstanceCloneOptions) (*Instance, error) {
- body, err := json.Marshal(opts)
+ e := formatAPIPath("linode/instances/%d/clone", linodeID)
+ response, err := doPOSTRequest[Instance](ctx, c, e, opts)
if err != nil {
return nil, err
}
- req := c.R(ctx).SetResult(&Instance{}).SetBody(string(body))
- e := fmt.Sprintf("linode/instances/%d/clone", linodeID)
- r, err := coupleAPIErrors(req.Post(e))
- if err != nil {
- return nil, err
- }
+ return response, nil
+}
+
+// ResetInstancePassword resets a Linode instance's root password
+func (c *Client) ResetInstancePassword(ctx context.Context, linodeID int, opts InstancePasswordResetOptions) error {
+ e := formatAPIPath("linode/instances/%d/password", linodeID)
+ _, err := doPOSTRequest[Instance](ctx, c, e, opts)
- return r.Result().(*Instance), nil
+ return err
}
// RebootInstance reboots a Linode instance
// A configID of 0 will cause Linode to choose the last/best config
func (c *Client) RebootInstance(ctx context.Context, linodeID int, configID int) error {
- body := "{}"
+ opts := make(map[string]int)
if configID != 0 {
- bodyMap := map[string]int{"config_id": configID}
- bodyJSON, err := json.Marshal(bodyMap)
- if err != nil {
- return err
- }
- body = string(bodyJSON)
+ opts = map[string]int{"config_id": configID}
}
- e := fmt.Sprintf("linode/instances/%d/reboot", linodeID)
- _, err := coupleAPIErrors(c.R(ctx).SetBody(body).Post(e))
+
+ e := formatAPIPath("linode/instances/%d/reboot", linodeID)
+ _, err := doPOSTRequest[Instance](ctx, c, e, opts)
return err
}
@@ -372,22 +404,21 @@ type InstanceRebuildOptions struct {
Booted *bool `json:"booted,omitempty"`
Metadata *InstanceMetadataOptions `json:"metadata,omitempty"`
Type string `json:"type,omitempty"`
+
+ // NOTE: Disk encryption may not currently be available to all users.
+ DiskEncryption InstanceDiskEncryption `json:"disk_encryption,omitempty"`
}
// RebuildInstance Deletes all Disks and Configs on this Linode,
// then deploys a new Image to this Linode with the given attributes.
func (c *Client) RebuildInstance(ctx context.Context, linodeID int, opts InstanceRebuildOptions) (*Instance, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
- e := fmt.Sprintf("linode/instances/%d/rebuild", linodeID)
- req := c.R(ctx).SetBody(string(body)).SetResult(&Instance{})
- r, err := coupleAPIErrors(req.Post(e))
+ e := formatAPIPath("linode/instances/%d/rebuild", linodeID)
+ response, err := doPOSTRequest[Instance](ctx, c, e, opts)
if err != nil {
return nil, err
}
- return r.Result().(*Instance), nil
+
+ return response, nil
}
// InstanceRescueOptions fields are those accepted by RescueInstance
@@ -400,23 +431,15 @@ type InstanceRescueOptions struct {
// You can also use Rescue Mode for tasks other than disaster recovery, such as formatting disks to use different filesystems,
// copying data between disks, and downloading files from a disk via SSH and SFTP.
func (c *Client) RescueInstance(ctx context.Context, linodeID int, opts InstanceRescueOptions) error {
- body, err := json.Marshal(opts)
- if err != nil {
- return err
- }
- e := fmt.Sprintf("linode/instances/%d/rescue", linodeID)
- _, err = coupleAPIErrors(c.R(ctx).SetBody(string(body)).Post(e))
+ e := formatAPIPath("linode/instances/%d/rescue", linodeID)
+ _, err := doPOSTRequest[Instance](ctx, c, e, opts)
return err
}
// ResizeInstance resizes an instance to new Linode type
func (c *Client) ResizeInstance(ctx context.Context, linodeID int, opts InstanceResizeOptions) error {
- body, err := json.Marshal(opts)
- if err != nil {
- return err
- }
- e := fmt.Sprintf("linode/instances/%d/resize", linodeID)
- _, err = coupleAPIErrors(c.R(ctx).SetBody(string(body)).Post(e))
+ e := formatAPIPath("linode/instances/%d/resize", linodeID)
+ _, err := doPOSTRequest[Instance](ctx, c, e, opts)
return err
}
@@ -432,20 +455,18 @@ func (c *Client) MutateInstance(ctx context.Context, id int) error {
// MigrateInstance - Migrate an instance
func (c *Client) MigrateInstance(ctx context.Context, linodeID int, opts InstanceMigrateOptions) error {
- body, err := json.Marshal(opts)
- if err != nil {
- return err
- }
- e := fmt.Sprintf("linode/instances/%d/migrate", linodeID)
- _, err = coupleAPIErrors(c.R(ctx).SetBody(string(body)).Post(e))
+ e := formatAPIPath("linode/instances/%d/migrate", linodeID)
+ _, err := doPOSTRequest[Instance](ctx, c, e, opts)
return err
}
// simpleInstanceAction is a helper for Instance actions that take no parameters
// and return empty responses `{}` unless they return a standard error
func (c *Client) simpleInstanceAction(ctx context.Context, action string, linodeID int) error {
- action = url.PathEscape(action)
- e := fmt.Sprintf("linode/instances/%d/%s", linodeID, action)
- _, err := coupleAPIErrors(c.R(ctx).Post(e))
+ _, err := doPOSTRequest[any, any](
+ ctx,
+ c,
+ formatAPIPath("linode/instances/%d/%s", linodeID, action),
+ )
return err
}
diff --git a/vendor/github.com/linode/linodego/internal/duration/duration.go b/vendor/github.com/linode/linodego/internal/duration/duration.go
index 14d4f136..a63a11a9 100644
--- a/vendor/github.com/linode/linodego/internal/duration/duration.go
+++ b/vendor/github.com/linode/linodego/internal/duration/duration.go
@@ -51,7 +51,7 @@ func durationToSeconds(s string) (int, error) {
l := len(segs)
- for i := 0; i < l; i++ {
+ for i := range l {
m, err := strconv.Atoi(segs[i])
if err != nil {
return 0, err
diff --git a/vendor/github.com/linode/linodego/kernels.go b/vendor/github.com/linode/linodego/kernels.go
index 26987a63..5f3f12e0 100644
--- a/vendor/github.com/linode/linodego/kernels.go
+++ b/vendor/github.com/linode/linodego/kernels.go
@@ -3,11 +3,8 @@ package linodego
import (
"context"
"encoding/json"
- "fmt"
- "net/url"
"time"
- "github.com/go-resty/resty/v2"
"github.com/linode/linodego/internal/parseabletime"
)
@@ -24,12 +21,6 @@ type LinodeKernel struct {
Built *time.Time `json:"-"`
}
-// LinodeKernelsPagedResponse represents a Linode kernels API response for listing
-type LinodeKernelsPagedResponse struct {
- *PageOptions
- Data []LinodeKernel `json:"data"`
-}
-
// UnmarshalJSON implements the json.Unmarshaler interface
func (i *LinodeKernel) UnmarshalJSON(b []byte) error {
type Mask LinodeKernel
@@ -50,25 +41,9 @@ func (i *LinodeKernel) UnmarshalJSON(b []byte) error {
return nil
}
-func (LinodeKernelsPagedResponse) endpoint(_ ...any) string {
- return "linode/kernels"
-}
-
-func (resp *LinodeKernelsPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(LinodeKernelsPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*LinodeKernelsPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListKernels lists linode kernels. This endpoint is cached by default.
func (c *Client) ListKernels(ctx context.Context, opts *ListOptions) ([]LinodeKernel, error) {
- response := LinodeKernelsPagedResponse{}
-
- endpoint, err := generateListCacheURL(response.endpoint(), opts)
+ endpoint, err := generateListCacheURL("linode/kernels", opts)
if err != nil {
return nil, err
}
@@ -77,33 +52,31 @@ func (c *Client) ListKernels(ctx context.Context, opts *ListOptions) ([]LinodeKe
return result.([]LinodeKernel), nil
}
- err = c.listHelper(ctx, &response, opts)
+ response, err := getPaginatedResults[LinodeKernel](ctx, c, "linode/kernels", opts)
if err != nil {
return nil, err
}
- c.addCachedResponse(endpoint, response.Data, nil)
+ c.addCachedResponse(endpoint, response, nil)
- return response.Data, nil
+ return response, nil
}
// GetKernel gets the kernel with the provided ID. This endpoint is cached by default.
func (c *Client) GetKernel(ctx context.Context, kernelID string) (*LinodeKernel, error) {
- kernelID = url.PathEscape(kernelID)
- e := fmt.Sprintf("linode/kernels/%s", kernelID)
+ e := formatAPIPath("linode/kernels/%s", kernelID)
if result := c.getCachedResponse(e); result != nil {
result := result.(LinodeKernel)
return &result, nil
}
- req := c.R(ctx).SetResult(&LinodeKernel{})
- r, err := coupleAPIErrors(req.Get(e))
+ response, err := doGETRequest[LinodeKernel](ctx, c, e)
if err != nil {
return nil, err
}
- c.addCachedResponse(e, r.Result(), nil)
+ c.addCachedResponse(e, response, nil)
- return r.Result().(*LinodeKernel), nil
+ return response, nil
}
diff --git a/vendor/github.com/linode/linodego/lke_cluster_pools.go b/vendor/github.com/linode/linodego/lke_cluster_pools.go
index e3114877..5f520765 100644
--- a/vendor/github.com/linode/linodego/lke_cluster_pools.go
+++ b/vendor/github.com/linode/linodego/lke_cluster_pools.go
@@ -22,9 +22,6 @@ type LKEClusterPoolCreateOptions = LKENodePoolCreateOptions
// Deprecated: LKEClusterPoolUpdateOptions fields are those accepted by UpdateLKEClusterPool
type LKEClusterPoolUpdateOptions = LKENodePoolUpdateOptions
-// Deprecated: LKEClusterPoolsPagedResponse represents a paginated LKEClusterPool API response
-type LKEClusterPoolsPagedResponse = LKENodePoolsPagedResponse
-
// Deprecated: ListLKEClusterPools lists LKEClusterPools
func (c *Client) ListLKEClusterPools(ctx context.Context, clusterID int, opts *ListOptions) ([]LKEClusterPool, error) {
return c.ListLKENodePools(ctx, clusterID, opts)
diff --git a/vendor/github.com/linode/linodego/lke_clusters.go b/vendor/github.com/linode/linodego/lke_clusters.go
index ff9b6765..7b34559d 100644
--- a/vendor/github.com/linode/linodego/lke_clusters.go
+++ b/vendor/github.com/linode/linodego/lke_clusters.go
@@ -3,11 +3,8 @@ package linodego
import (
"context"
"encoding/json"
- "fmt"
- "net/url"
"time"
- "github.com/go-resty/resty/v2"
"github.com/linode/linodego/internal/parseabletime"
)
@@ -35,20 +32,20 @@ type LKECluster struct {
// LKEClusterCreateOptions fields are those accepted by CreateLKECluster
type LKEClusterCreateOptions struct {
- NodePools []LKENodePoolCreateOptions `json:"node_pools"`
- Label string `json:"label"`
- Region string `json:"region"`
- K8sVersion string `json:"k8s_version"`
- Tags []string `json:"tags,omitempty"`
- ControlPlane *LKEClusterControlPlane `json:"control_plane,omitempty"`
+ NodePools []LKENodePoolCreateOptions `json:"node_pools"`
+ Label string `json:"label"`
+ Region string `json:"region"`
+ K8sVersion string `json:"k8s_version"`
+ Tags []string `json:"tags,omitempty"`
+ ControlPlane *LKEClusterControlPlaneOptions `json:"control_plane,omitempty"`
}
// LKEClusterUpdateOptions fields are those accepted by UpdateLKECluster
type LKEClusterUpdateOptions struct {
- K8sVersion string `json:"k8s_version,omitempty"`
- Label string `json:"label,omitempty"`
- Tags *[]string `json:"tags,omitempty"`
- ControlPlane *LKEClusterControlPlane `json:"control_plane,omitempty"`
+ K8sVersion string `json:"k8s_version,omitempty"`
+ Label string `json:"label,omitempty"`
+ Tags *[]string `json:"tags,omitempty"`
+ ControlPlane *LKEClusterControlPlaneOptions `json:"control_plane,omitempty"`
}
// LKEClusterAPIEndpoint fields are those returned by ListLKEClusterAPIEndpoints
@@ -66,11 +63,6 @@ type LKEClusterDashboard struct {
URL string `json:"url"`
}
-// LKEClusterControlPlane fields contained within the `control_plane` attribute of an LKE cluster.
-type LKEClusterControlPlane struct {
- HighAvailability bool `json:"high_availability"`
-}
-
// LKEVersion fields are those returned by GetLKEVersion
type LKEVersion struct {
ID string `json:"id"`
@@ -110,7 +102,14 @@ func (i LKECluster) GetCreateOptions() (o LKEClusterCreateOptions) {
o.Region = i.Region
o.K8sVersion = i.K8sVersion
o.Tags = i.Tags
- o.ControlPlane = &i.ControlPlane
+
+ isHA := i.ControlPlane.HighAvailability
+
+ o.ControlPlane = &LKEClusterControlPlaneOptions{
+ HighAvailability: &isHA,
+ // ACL will not be populated in the control plane response
+ }
+
// @TODO copy NodePools?
return
}
@@ -120,36 +119,22 @@ func (i LKECluster) GetUpdateOptions() (o LKEClusterUpdateOptions) {
o.K8sVersion = i.K8sVersion
o.Label = i.Label
o.Tags = &i.Tags
- o.ControlPlane = &i.ControlPlane
- return
-}
-
-// LKEVersionsPagedResponse represents a paginated LKEVersion API response
-type LKEVersionsPagedResponse struct {
- *PageOptions
- Data []LKEVersion `json:"data"`
-}
-// endpoint gets the endpoint URL for LKEVersion
-func (LKEVersionsPagedResponse) endpoint(_ ...any) string {
- return "lke/versions"
-}
+ isHA := i.ControlPlane.HighAvailability
-func (resp *LKEVersionsPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(LKEVersionsPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
+ o.ControlPlane = &LKEClusterControlPlaneOptions{
+ HighAvailability: &isHA,
+ // ACL will not be populated in the control plane response
}
- castedRes := res.Result().(*LKEVersionsPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
+
+ return
}
// ListLKEVersions lists the Kubernetes versions available through LKE. This endpoint is cached by default.
func (c *Client) ListLKEVersions(ctx context.Context, opts *ListOptions) ([]LKEVersion, error) {
- response := LKEVersionsPagedResponse{}
+ e := "lke/versions"
- endpoint, err := generateListCacheURL(response.endpoint(), opts)
+ endpoint, err := generateListCacheURL(e, opts)
if err != nil {
return nil, err
}
@@ -158,198 +143,138 @@ func (c *Client) ListLKEVersions(ctx context.Context, opts *ListOptions) ([]LKEV
return result.([]LKEVersion), nil
}
- err = c.listHelper(ctx, &response, opts)
+ response, err := getPaginatedResults[LKEVersion](ctx, c, e, opts)
if err != nil {
return nil, err
}
- c.addCachedResponse(endpoint, response.Data, &cacheExpiryTime)
+ c.addCachedResponse(endpoint, response, &cacheExpiryTime)
- return response.Data, nil
+ return response, nil
}
// GetLKEVersion gets details about a specific LKE Version. This endpoint is cached by default.
func (c *Client) GetLKEVersion(ctx context.Context, version string) (*LKEVersion, error) {
- version = url.PathEscape(version)
- e := fmt.Sprintf("lke/versions/%s", version)
+ e := formatAPIPath("lke/versions/%s", version)
if result := c.getCachedResponse(e); result != nil {
result := result.(LKEVersion)
return &result, nil
}
- req := c.R(ctx).SetResult(&LKEVersion{})
- r, err := coupleAPIErrors(req.Get(e))
+ response, err := doGETRequest[LKEVersion](ctx, c, e)
if err != nil {
return nil, err
}
- c.addCachedResponse(e, r.Result(), &cacheExpiryTime)
-
- return r.Result().(*LKEVersion), nil
-}
-
-// LKEClusterAPIEndpointsPagedResponse represents a paginated LKEClusterAPIEndpoints API response
-type LKEClusterAPIEndpointsPagedResponse struct {
- *PageOptions
- Data []LKEClusterAPIEndpoint `json:"data"`
-}
-
-// endpoint gets the endpoint URL for LKEClusterAPIEndpointsPagedResponse
-func (LKEClusterAPIEndpointsPagedResponse) endpoint(ids ...any) string {
- id := ids[0].(int)
- return fmt.Sprintf("lke/clusters/%d/api-endpoints", id)
-}
+ c.addCachedResponse(e, response, &cacheExpiryTime)
-func (resp *LKEClusterAPIEndpointsPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(LKEClusterAPIEndpointsPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*LKEClusterAPIEndpointsPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
+ return response, nil
}
// ListLKEClusterAPIEndpoints gets the API Endpoint for the LKE Cluster specified
func (c *Client) ListLKEClusterAPIEndpoints(ctx context.Context, clusterID int, opts *ListOptions) ([]LKEClusterAPIEndpoint, error) {
- response := LKEClusterAPIEndpointsPagedResponse{}
- err := c.listHelper(ctx, &response, opts, clusterID)
+ response, err := getPaginatedResults[LKEClusterAPIEndpoint](ctx, c, formatAPIPath("lke/clusters/%d/api-endpoints", clusterID), opts)
if err != nil {
return nil, err
}
- return response.Data, nil
-}
-
-// LKEClustersPagedResponse represents a paginated LKECluster API response
-type LKEClustersPagedResponse struct {
- *PageOptions
- Data []LKECluster `json:"data"`
-}
-// endpoint gets the endpoint URL for LKECluster
-func (LKEClustersPagedResponse) endpoint(_ ...any) string {
- return "lke/clusters"
-}
-
-func (resp *LKEClustersPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(LKEClustersPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*LKEClustersPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
+ return response, nil
}
// ListLKEClusters lists LKEClusters
func (c *Client) ListLKEClusters(ctx context.Context, opts *ListOptions) ([]LKECluster, error) {
- response := LKEClustersPagedResponse{}
- err := c.listHelper(ctx, &response, opts)
- if err != nil {
- return nil, err
- }
- return response.Data, nil
+ response, err := getPaginatedResults[LKECluster](ctx, c, "lke/clusters", opts)
+ return response, err
}
// GetLKECluster gets the lkeCluster with the provided ID
func (c *Client) GetLKECluster(ctx context.Context, clusterID int) (*LKECluster, error) {
- e := fmt.Sprintf("lke/clusters/%d", clusterID)
- req := c.R(ctx).SetResult(&LKECluster{})
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("lke/clusters/%d", clusterID)
+ response, err := doGETRequest[LKECluster](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*LKECluster), nil
+
+ return response, nil
}
// CreateLKECluster creates a LKECluster
func (c *Client) CreateLKECluster(ctx context.Context, opts LKEClusterCreateOptions) (*LKECluster, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
e := "lke/clusters"
- req := c.R(ctx).SetResult(&LKECluster{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Post(e))
+ response, err := doPOSTRequest[LKECluster](ctx, c, e, opts)
if err != nil {
return nil, err
}
- return r.Result().(*LKECluster), nil
+
+ return response, nil
}
// UpdateLKECluster updates the LKECluster with the specified id
func (c *Client) UpdateLKECluster(ctx context.Context, clusterID int, opts LKEClusterUpdateOptions) (*LKECluster, error) {
- body, err := json.Marshal(opts)
+ e := formatAPIPath("lke/clusters/%d", clusterID)
+ response, err := doPUTRequest[LKECluster](ctx, c, e, opts)
if err != nil {
return nil, err
}
- e := fmt.Sprintf("lke/clusters/%d", clusterID)
- req := c.R(ctx).SetResult(&LKECluster{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Put(e))
- if err != nil {
- return nil, err
- }
- return r.Result().(*LKECluster), nil
+ return response, nil
}
// DeleteLKECluster deletes the LKECluster with the specified id
func (c *Client) DeleteLKECluster(ctx context.Context, clusterID int) error {
- e := fmt.Sprintf("lke/clusters/%d", clusterID)
- _, err := coupleAPIErrors(c.R(ctx).Delete(e))
- return err
+ e := formatAPIPath("lke/clusters/%d", clusterID)
+ return doDELETERequest(ctx, c, e)
}
// GetLKEClusterKubeconfig gets the Kubeconfig for the LKE Cluster specified
func (c *Client) GetLKEClusterKubeconfig(ctx context.Context, clusterID int) (*LKEClusterKubeconfig, error) {
- e := fmt.Sprintf("lke/clusters/%d/kubeconfig", clusterID)
- req := c.R(ctx).SetResult(&LKEClusterKubeconfig{})
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("lke/clusters/%d/kubeconfig", clusterID)
+ response, err := doGETRequest[LKEClusterKubeconfig](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*LKEClusterKubeconfig), nil
+
+ return response, nil
+}
+
+// DeleteLKEClusterKubeconfig deletes the Kubeconfig for the LKE Cluster specified
+func (c *Client) DeleteLKEClusterKubeconfig(ctx context.Context, clusterID int) error {
+ e := formatAPIPath("lke/clusters/%d/kubeconfig", clusterID)
+ return doDELETERequest(ctx, c, e)
}
// GetLKEClusterDashboard gets information about the dashboard for an LKE cluster
func (c *Client) GetLKEClusterDashboard(ctx context.Context, clusterID int) (*LKEClusterDashboard, error) {
- e := fmt.Sprintf("lke/clusters/%d/dashboard", clusterID)
- req := c.R(ctx).SetResult(&LKEClusterDashboard{})
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("lke/clusters/%d/dashboard", clusterID)
+ response, err := doGETRequest[LKEClusterDashboard](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*LKEClusterDashboard), nil
+
+ return response, nil
}
// RecycleLKEClusterNodes recycles all nodes in all pools of the specified LKE Cluster.
func (c *Client) RecycleLKEClusterNodes(ctx context.Context, clusterID int) error {
- e := fmt.Sprintf("lke/clusters/%d/recycle", clusterID)
- _, err := coupleAPIErrors(c.R(ctx).Post(e))
+ e := formatAPIPath("lke/clusters/%d/recycle", clusterID)
+ _, err := doPOSTRequest[LKECluster, any](ctx, c, e)
return err
}
// RegenerateLKECluster regenerates the Kubeconfig file and/or the service account token for the specified LKE Cluster.
func (c *Client) RegenerateLKECluster(ctx context.Context, clusterID int, opts LKEClusterRegenerateOptions) (*LKECluster, error) {
- body, err := json.Marshal(opts)
+ e := formatAPIPath("lke/clusters/%d/regenerate", clusterID)
+ response, err := doPOSTRequest[LKECluster](ctx, c, e, opts)
if err != nil {
return nil, err
}
- e := fmt.Sprintf("lke/clusters/%d/regenerate", clusterID)
- req := c.R(ctx).SetResult(&LKECluster{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Post(e))
- if err != nil {
- return nil, err
- }
- return r.Result().(*LKECluster), nil
+ return response, nil
}
// DeleteLKEClusterServiceToken deletes and regenerate the service account token for a Cluster.
func (c *Client) DeleteLKEClusterServiceToken(ctx context.Context, clusterID int) error {
- e := fmt.Sprintf("lke/clusters/%d/servicetoken", clusterID)
- _, err := coupleAPIErrors(c.R(ctx).Delete(e))
- return err
+ e := formatAPIPath("lke/clusters/%d/servicetoken", clusterID)
+ return doDELETERequest(ctx, c, e)
}
diff --git a/vendor/github.com/linode/linodego/lke_clusters_control_plane.go b/vendor/github.com/linode/linodego/lke_clusters_control_plane.go
new file mode 100644
index 00000000..fc648bf8
--- /dev/null
+++ b/vendor/github.com/linode/linodego/lke_clusters_control_plane.go
@@ -0,0 +1,99 @@
+package linodego
+
+import "context"
+
+// LKEClusterControlPlane fields contained within the `control_plane` attribute of an LKE cluster.
+type LKEClusterControlPlane struct {
+ HighAvailability bool `json:"high_availability"`
+}
+
+// LKEClusterControlPlaneACLAddresses describes the
+// allowed IP ranges for an LKE cluster's control plane.
+type LKEClusterControlPlaneACLAddresses struct {
+ IPv4 []string `json:"ipv4"`
+ IPv6 []string `json:"ipv6"`
+}
+
+// LKEClusterControlPlaneACL describes the ACL configuration
+// for an LKE cluster's control plane.
+// NOTE: Control Plane ACLs may not currently be available to all users.
+type LKEClusterControlPlaneACL struct {
+ Enabled bool `json:"enabled"`
+ Addresses *LKEClusterControlPlaneACLAddresses `json:"addresses"`
+}
+
+// LKEClusterControlPlaneACLAddressesOptions are the options used to
+// specify the allowed IP ranges for an LKE cluster's control plane.
+type LKEClusterControlPlaneACLAddressesOptions struct {
+ IPv4 *[]string `json:"ipv4,omitempty"`
+ IPv6 *[]string `json:"ipv6,omitempty"`
+}
+
+// LKEClusterControlPlaneACLOptions represents the options used when
+// configuring an LKE cluster's control plane ACL policy.
+// NOTE: Control Plane ACLs may not currently be available to all users.
+type LKEClusterControlPlaneACLOptions struct {
+ Enabled *bool `json:"enabled,omitempty"`
+ Addresses *LKEClusterControlPlaneACLAddressesOptions `json:"addresses,omitempty"`
+}
+
+// LKEClusterControlPlaneOptions represents the options used when
+// configuring an LKE cluster's control plane.
+type LKEClusterControlPlaneOptions struct {
+ HighAvailability *bool `json:"high_availability,omitempty"`
+ ACL *LKEClusterControlPlaneACLOptions `json:"acl,omitempty"`
+}
+
+// LKEClusterControlPlaneACLUpdateOptions represents the options
+// available when updating the ACL configuration of an LKE cluster's
+// control plane.
+// NOTE: Control Plane ACLs may not currently be available to all users.
+type LKEClusterControlPlaneACLUpdateOptions struct {
+ ACL LKEClusterControlPlaneACLOptions `json:"acl"`
+}
+
+// LKEClusterControlPlaneACLResponse represents the response structure
+// for the Client.GetLKEClusterControlPlaneACL(...) method.
+type LKEClusterControlPlaneACLResponse struct {
+ ACL LKEClusterControlPlaneACL `json:"acl"`
+}
+
+// GetLKEClusterControlPlaneACL gets the ACL configuration for the
+// given cluster's control plane.
+// NOTE: Control Plane ACLs may not currently be available to all users.
+func (c *Client) GetLKEClusterControlPlaneACL(ctx context.Context, clusterID int) (*LKEClusterControlPlaneACLResponse, error) {
+ return doGETRequest[LKEClusterControlPlaneACLResponse](
+ ctx,
+ c,
+ formatAPIPath("lke/clusters/%d/control_plane_acl", clusterID),
+ )
+}
+
+// UpdateLKEClusterControlPlaneACL updates the ACL configuration for the
+// given cluster's control plane.
+// NOTE: Control Plane ACLs may not currently be available to all users.
+func (c *Client) UpdateLKEClusterControlPlaneACL(
+ ctx context.Context,
+ clusterID int,
+ opts LKEClusterControlPlaneACLUpdateOptions,
+) (*LKEClusterControlPlaneACLResponse, error) {
+ return doPUTRequest[LKEClusterControlPlaneACLResponse](
+ ctx,
+ c,
+ formatAPIPath("lke/clusters/%d/control_plane_acl", clusterID),
+ opts,
+ )
+}
+
+// DeleteLKEClusterControlPlaneACL deletes the ACL configuration for the
+// given cluster's control plane.
+func (c *Client) DeleteLKEClusterControlPlaneACL(
+ ctx context.Context,
+ clusterID int,
+) error {
+ return doDELETERequest(
+ ctx,
+ c,
+ formatAPIPath("lke/clusters/%d/control_plane_acl", clusterID),
+ )
+}
diff --git a/vendor/github.com/linode/linodego/lke_node_pools.go b/vendor/github.com/linode/linodego/lke_node_pools.go
index b7e5bc0b..7ae6f311 100644
--- a/vendor/github.com/linode/linodego/lke_node_pools.go
+++ b/vendor/github.com/linode/linodego/lke_node_pools.go
@@ -2,11 +2,6 @@ package linodego
import (
"context"
- "encoding/json"
- "fmt"
- "net/url"
-
- "github.com/go-resty/resty/v2"
)
// LKELinodeStatus constants start with LKELinode and include
@@ -38,6 +33,25 @@ type LKENodePoolLinode struct {
Status LKELinodeStatus `json:"status"`
}
+// LKENodePoolTaintEffect represents the effect value of a taint
+type LKENodePoolTaintEffect string
+
+const (
+ LKENodePoolTaintEffectNoSchedule LKENodePoolTaintEffect = "NoSchedule"
+ LKENodePoolTaintEffectPreferNoSchedule LKENodePoolTaintEffect = "PreferNoSchedule"
+ LKENodePoolTaintEffectNoExecute LKENodePoolTaintEffect = "NoExecute"
+)
+
+// LKENodePoolTaint represents a corev1.Taint to add to an LKENodePool
+type LKENodePoolTaint struct {
+ Key string `json:"key"`
+ Value string `json:"value,omitempty"`
+ Effect LKENodePoolTaintEffect `json:"effect"`
+}
+
+// LKENodePoolLabels represents Kubernetes labels to add to an LKENodePool
+type LKENodePoolLabels map[string]string
+
// LKENodePool represents a LKENodePool object
type LKENodePool struct {
ID int `json:"id"`
@@ -46,24 +60,33 @@ type LKENodePool struct {
Disks []LKENodePoolDisk `json:"disks"`
Linodes []LKENodePoolLinode `json:"nodes"`
Tags []string `json:"tags"`
+ Labels LKENodePoolLabels `json:"labels"`
+ Taints []LKENodePoolTaint `json:"taints"`
Autoscaler LKENodePoolAutoscaler `json:"autoscaler"`
+
+ // NOTE: Disk encryption may not currently be available to all users.
+ DiskEncryption InstanceDiskEncryption `json:"disk_encryption,omitempty"`
}
// LKENodePoolCreateOptions fields are those accepted by CreateLKENodePool
type LKENodePoolCreateOptions struct {
- Count int `json:"count"`
- Type string `json:"type"`
- Disks []LKENodePoolDisk `json:"disks"`
- Tags []string `json:"tags"`
+ Count int `json:"count"`
+ Type string `json:"type"`
+ Disks []LKENodePoolDisk `json:"disks"`
+ Tags []string `json:"tags"`
+ Labels LKENodePoolLabels `json:"labels"`
+ Taints []LKENodePoolTaint `json:"taints"`
Autoscaler *LKENodePoolAutoscaler `json:"autoscaler,omitempty"`
}
// LKENodePoolUpdateOptions fields are those accepted by UpdateLKENodePoolUpdate
type LKENodePoolUpdateOptions struct {
- Count int `json:"count,omitempty"`
- Tags *[]string `json:"tags,omitempty"`
+ Count int `json:"count,omitempty"`
+ Tags *[]string `json:"tags,omitempty"`
+ Labels *LKENodePoolLabels `json:"labels,omitempty"`
+ Taints *[]LKENodePoolTaint `json:"taints,omitempty"`
Autoscaler *LKENodePoolAutoscaler `json:"autoscaler,omitempty"`
}
@@ -74,6 +97,8 @@ func (l LKENodePool) GetCreateOptions() (o LKENodePoolCreateOptions) {
o.Count = l.Count
o.Disks = l.Disks
o.Tags = l.Tags
+ o.Labels = l.Labels
+ o.Taints = l.Taints
o.Autoscaler = &l.Autoscaler
return
}
@@ -82,97 +107,96 @@ func (l LKENodePool) GetCreateOptions() (o LKENodePoolCreateOptions) {
func (l LKENodePool) GetUpdateOptions() (o LKENodePoolUpdateOptions) {
o.Count = l.Count
o.Tags = &l.Tags
+ o.Labels = &l.Labels
+ o.Taints = &l.Taints
o.Autoscaler = &l.Autoscaler
return
}
-// LKENodePoolsPagedResponse represents a paginated LKENodePool API response
-type LKENodePoolsPagedResponse struct {
- *PageOptions
- Data []LKENodePool `json:"data"`
-}
-
-// endpoint gets the endpoint URL for InstanceConfigs of a given Instance
-func (LKENodePoolsPagedResponse) endpoint(ids ...any) string {
- id := ids[0].(int)
- return fmt.Sprintf("lke/clusters/%d/pools", id)
-}
-
-func (resp *LKENodePoolsPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(LKENodePoolsPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*LKENodePoolsPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListLKENodePools lists LKENodePools
func (c *Client) ListLKENodePools(ctx context.Context, clusterID int, opts *ListOptions) ([]LKENodePool, error) {
- response := LKENodePoolsPagedResponse{}
- err := c.listHelper(ctx, &response, opts, clusterID)
+ response, err := getPaginatedResults[LKENodePool](ctx, c, formatAPIPath("lke/clusters/%d/pools", clusterID), opts)
if err != nil {
return nil, err
}
- return response.Data, nil
+ return response, nil
}
// GetLKENodePool gets the LKENodePool with the provided ID
func (c *Client) GetLKENodePool(ctx context.Context, clusterID, poolID int) (*LKENodePool, error) {
- e := fmt.Sprintf("lke/clusters/%d/pools/%d", clusterID, poolID)
- req := c.R(ctx).SetResult(&LKENodePool{})
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("lke/clusters/%d/pools/%d", clusterID, poolID)
+ response, err := doGETRequest[LKENodePool](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*LKENodePool), nil
+
+ return response, nil
}
// CreateLKENodePool creates a LKENodePool
func (c *Client) CreateLKENodePool(ctx context.Context, clusterID int, opts LKENodePoolCreateOptions) (*LKENodePool, error) {
- body, err := json.Marshal(opts)
+ e := formatAPIPath("lke/clusters/%d/pools", clusterID)
+ response, err := doPOSTRequest[LKENodePool](ctx, c, e, opts)
if err != nil {
return nil, err
}
- e := fmt.Sprintf("lke/clusters/%d/pools", clusterID)
- req := c.R(ctx).SetResult(&LKENodePool{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Post(e))
+ return response, nil
+}
+
+// RecycleLKENodePool recycles a LKENodePool
+func (c *Client) RecycleLKENodePool(ctx context.Context, clusterID, poolID int) error {
+ e := formatAPIPath("lke/clusters/%d/pools/%d/recycle", clusterID, poolID)
+ _, err := doPOSTRequest[LKENodePool, any](ctx, c, e)
if err != nil {
- return nil, err
+ return err
}
- return r.Result().(*LKENodePool), nil
+
+ return nil
}
// UpdateLKENodePool updates the LKENodePool with the specified id
func (c *Client) UpdateLKENodePool(ctx context.Context, clusterID, poolID int, opts LKENodePoolUpdateOptions) (*LKENodePool, error) {
- body, err := json.Marshal(opts)
+ e := formatAPIPath("lke/clusters/%d/pools/%d", clusterID, poolID)
+ response, err := doPUTRequest[LKENodePool](ctx, c, e, opts)
if err != nil {
return nil, err
}
- e := fmt.Sprintf("lke/clusters/%d/pools/%d", clusterID, poolID)
- req := c.R(ctx).SetResult(&LKENodePool{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Put(e))
+ return response, nil
+}
+
+// DeleteLKENodePool deletes the LKENodePool with the specified id
+func (c *Client) DeleteLKENodePool(ctx context.Context, clusterID, poolID int) error {
+ e := formatAPIPath("lke/clusters/%d/pools/%d", clusterID, poolID)
+ return doDELETERequest(ctx, c, e)
+}
+
+// GetLKENodePoolNode gets the LKENodePoolLinode with the provided ID
+func (c *Client) GetLKENodePoolNode(ctx context.Context, clusterID int, nodeID string) (*LKENodePoolLinode, error) {
+ e := formatAPIPath("lke/clusters/%d/nodes/%s", clusterID, nodeID)
+ response, err := doGETRequest[LKENodePoolLinode](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*LKENodePool), nil
+
+ return response, nil
}
-// DeleteLKENodePool deletes the LKENodePool with the specified id
-func (c *Client) DeleteLKENodePool(ctx context.Context, clusterID, poolID int) error {
- e := fmt.Sprintf("lke/clusters/%d/pools/%d", clusterID, poolID)
- _, err := coupleAPIErrors(c.R(ctx).Delete(e))
- return err
+// RecycleLKENodePoolNode recycles a LKENodePoolLinode
+func (c *Client) RecycleLKENodePoolNode(ctx context.Context, clusterID int, nodeID string) error {
+ e := formatAPIPath("lke/clusters/%d/nodes/%s/recycle", clusterID, nodeID)
+ _, err := doPOSTRequest[LKENodePoolLinode, any](ctx, c, e)
+ if err != nil {
+ return err
+ }
+
+ return nil
}
// DeleteLKENodePoolNode deletes a given node from a node pool
func (c *Client) DeleteLKENodePoolNode(ctx context.Context, clusterID int, nodeID string) error {
- nodeID = url.PathEscape(nodeID)
- e := fmt.Sprintf("lke/clusters/%d/nodes/%s", clusterID, nodeID)
- _, err := coupleAPIErrors(c.R(ctx).Delete(e))
- return err
+ e := formatAPIPath("lke/clusters/%d/nodes/%s", clusterID, nodeID)
+ return doDELETERequest(ctx, c, e)
}
diff --git a/vendor/github.com/linode/linodego/lke_types.go b/vendor/github.com/linode/linodego/lke_types.go
new file mode 100644
index 00000000..14273bbd
--- /dev/null
+++ b/vendor/github.com/linode/linodego/lke_types.go
@@ -0,0 +1,47 @@
+package linodego
+
+import (
+ "context"
+)
+
+// LKEType represents a single valid LKE type.
+// NOTE: This typically corresponds to the availability of a cluster's
+// control plane.
+type LKEType struct {
+ baseType[LKETypePrice, LKETypeRegionPrice]
+}
+
+// LKETypePrice represents the base hourly and monthly prices
+// for an LKE type entry.
+type LKETypePrice struct {
+ baseTypePrice
+}
+
+// LKETypeRegionPrice represents the regional hourly and monthly prices
+// for an LKE type entry.
+type LKETypeRegionPrice struct {
+ baseTypeRegionPrice
+}
+
+// ListLKETypes lists LKE types. This endpoint is cached by default.
+func (c *Client) ListLKETypes(ctx context.Context, opts *ListOptions) ([]LKEType, error) {
+ e := "lke/types"
+
+ endpoint, err := generateListCacheURL(e, opts)
+ if err != nil {
+ return nil, err
+ }
+
+ if result := c.getCachedResponse(endpoint); result != nil {
+ return result.([]LKEType), nil
+ }
+
+ response, err := getPaginatedResults[LKEType](ctx, c, e, opts)
+ if err != nil {
+ return nil, err
+ }
+
+ c.addCachedResponse(endpoint, response, &cacheExpiryTime)
+
+ return response, nil
+}
diff --git a/vendor/github.com/linode/linodego/logger.go b/vendor/github.com/linode/linodego/logger.go
new file mode 100644
index 00000000..5de75859
--- /dev/null
+++ b/vendor/github.com/linode/linodego/logger.go
@@ -0,0 +1,51 @@
+package linodego
+
+import (
+ "log"
+ "os"
+)
+
+//nolint:unused
+type httpLogger interface {
+ Errorf(format string, v ...interface{})
+ Warnf(format string, v ...interface{})
+ Debugf(format string, v ...interface{})
+}
+
+//nolint:unused
+type logger struct {
+ l *log.Logger
+}
+
+//nolint:unused
+func createLogger() *logger {
+ l := &logger{l: log.New(os.Stderr, "", log.Ldate|log.Lmicroseconds)}
+ return l
+}
+
+//nolint:unused
+var _ httpLogger = (*logger)(nil)
+
+//nolint:unused
+func (l *logger) Errorf(format string, v ...interface{}) {
+ l.output("ERROR RESTY "+format, v...)
+}
+
+//nolint:unused
+func (l *logger) Warnf(format string, v ...interface{}) {
+ l.output("WARN RESTY "+format, v...)
+}
+
+//nolint:unused
+func (l *logger) Debugf(format string, v ...interface{}) {
+ l.output("DEBUG RESTY "+format, v...)
+}
+
+//nolint:unused
+func (l *logger) output(format string, v ...interface{}) { //nolint:goprintffuncname
+ if len(v) == 0 {
+ l.l.Print(format)
+ return
+ }
+ l.l.Printf(format, v...)
+}
diff --git a/vendor/github.com/linode/linodego/longview.go b/vendor/github.com/linode/linodego/longview.go
index 8eeb9f3a..ec76fc8d 100644
--- a/vendor/github.com/linode/linodego/longview.go
+++ b/vendor/github.com/linode/linodego/longview.go
@@ -3,10 +3,8 @@ package linodego
import (
"context"
"encoding/json"
- "fmt"
"time"
- "github.com/go-resty/resty/v2"
"github.com/linode/linodego/internal/parseabletime"
)
@@ -51,110 +49,76 @@ type LongviewPlanUpdateOptions struct {
LongviewSubscription string `json:"longview_subscription"`
}
-// LongviewClientsPagedResponse represents a paginated LongviewClient API response
-type LongviewClientsPagedResponse struct {
- *PageOptions
- Data []LongviewClient `json:"data"`
-}
-
-// endpoint gets the endpoint URL for LongviewClient
-func (LongviewClientsPagedResponse) endpoint(_ ...any) string {
- return "longview/clients"
-}
-
-func (resp *LongviewClientsPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(LongviewClientsPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*LongviewClientsPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListLongviewClients lists LongviewClients
func (c *Client) ListLongviewClients(ctx context.Context, opts *ListOptions) ([]LongviewClient, error) {
- response := LongviewClientsPagedResponse{}
- err := c.listHelper(ctx, &response, opts)
+ response, err := getPaginatedResults[LongviewClient](ctx, c, "longview/clients", opts)
if err != nil {
return nil, err
}
- return response.Data, nil
+
+ return response, nil
}
// GetLongviewClient gets the template with the provided ID
func (c *Client) GetLongviewClient(ctx context.Context, clientID int) (*LongviewClient, error) {
- e := fmt.Sprintf("longview/clients/%d", clientID)
- r, err := c.R(ctx).SetResult(&LongviewClient{}).Get(e)
+ e := formatAPIPath("longview/clients/%d", clientID)
+ response, err := doGETRequest[LongviewClient](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*LongviewClient), nil
+
+ return response, nil
}
// CreateLongviewClient creates a Longview Client
func (c *Client) CreateLongviewClient(ctx context.Context, opts LongviewClientCreateOptions) (*LongviewClient, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
e := "longview/clients"
- req := c.R(ctx).SetResult(&LongviewClient{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Post(e))
+ response, err := doPOSTRequest[LongviewClient](ctx, c, e, opts)
if err != nil {
return nil, err
}
- return r.Result().(*LongviewClient), nil
+
+ return response, nil
}
// DeleteLongviewClient deletes a Longview Client
func (c *Client) DeleteLongviewClient(ctx context.Context, clientID int) error {
- e := fmt.Sprintf("longview/clients/%d", clientID)
- _, err := coupleAPIErrors(c.R(ctx).Delete(e))
+ e := formatAPIPath("longview/clients/%d", clientID)
+ err := doDELETERequest(ctx, c, e)
return err
}
// UpdateLongviewClient updates a Longview Client
func (c *Client) UpdateLongviewClient(ctx context.Context, clientID int, opts LongviewClientUpdateOptions) (*LongviewClient, error) {
- body, err := json.Marshal(opts)
+ e := formatAPIPath("longview/clients/%d", clientID)
+ response, err := doPUTRequest[LongviewClient](ctx, c, e, opts)
if err != nil {
return nil, err
}
- e := fmt.Sprintf("longview/clients/%d", clientID)
- req := c.R(ctx).SetResult(&LongviewClient{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Put(e))
- if err != nil {
- return nil, err
- }
- return r.Result().(*LongviewClient), nil
+ return response, nil
}
// GetLongviewPlan gets the template with the provided ID
func (c *Client) GetLongviewPlan(ctx context.Context) (*LongviewPlan, error) {
e := "longview/plan"
- r, err := c.R(ctx).SetResult(&LongviewPlan{}).Get(e)
+ response, err := doGETRequest[LongviewPlan](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*LongviewPlan), nil
+
+ return response, nil
}
// UpdateLongviewPlan updates a Longview Plan
func (c *Client) UpdateLongviewPlan(ctx context.Context, opts LongviewPlanUpdateOptions) (*LongviewPlan, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
e := "longview/plan"
- req := c.R(ctx).SetResult(&LongviewPlan{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Put(e))
+ response, err := doPUTRequest[LongviewPlan](ctx, c, e, opts)
if err != nil {
return nil, err
}
- return r.Result().(*LongviewPlan), nil
+
+ return response, nil
}
// UnmarshalJSON implements the json.Unmarshaler interface
diff --git a/vendor/github.com/linode/linodego/longview_subscriptions.go b/vendor/github.com/linode/linodego/longview_subscriptions.go
index efb3ee12..586785be 100644
--- a/vendor/github.com/linode/linodego/longview_subscriptions.go
+++ b/vendor/github.com/linode/linodego/longview_subscriptions.go
@@ -2,10 +2,6 @@ package linodego
import (
"context"
- "fmt"
- "net/url"
-
- "github.com/go-resty/resty/v2"
)
// LongviewSubscription represents a LongviewSubscription object
@@ -18,45 +14,23 @@ type LongviewSubscription struct {
// Updated *time.Time `json:"-"`
}
-// LongviewSubscriptionsPagedResponse represents a paginated LongviewSubscription API response
-type LongviewSubscriptionsPagedResponse struct {
- *PageOptions
- Data []LongviewSubscription `json:"data"`
-}
-
-// endpoint gets the endpoint URL for LongviewSubscription
-func (LongviewSubscriptionsPagedResponse) endpoint(_ ...any) string {
- return "longview/subscriptions"
-}
-
-func (resp *LongviewSubscriptionsPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(LongviewSubscriptionsPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*LongviewSubscriptionsPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListLongviewSubscriptions lists LongviewSubscriptions
func (c *Client) ListLongviewSubscriptions(ctx context.Context, opts *ListOptions) ([]LongviewSubscription, error) {
- response := LongviewSubscriptionsPagedResponse{}
- err := c.listHelper(ctx, &response, opts)
+ response, err := getPaginatedResults[LongviewSubscription](ctx, c, "longview/subscriptions", opts)
if err != nil {
return nil, err
}
- return response.Data, nil
+
+ return response, nil
}
// GetLongviewSubscription gets the template with the provided ID
func (c *Client) GetLongviewSubscription(ctx context.Context, templateID string) (*LongviewSubscription, error) {
- templateID = url.PathEscape(templateID)
- e := fmt.Sprintf("longview/subscriptions/%s", templateID)
- req := c.R(ctx).SetResult(&LongviewSubscription{})
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("longview/subscriptions/%s", templateID)
+ response, err := doGETRequest[LongviewSubscription](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*LongviewSubscription), nil
+
+ return response, nil
}
diff --git a/vendor/github.com/linode/linodego/mysql.go b/vendor/github.com/linode/linodego/mysql.go
index 575d0b27..f69f32f2 100644
--- a/vendor/github.com/linode/linodego/mysql.go
+++ b/vendor/github.com/linode/linodego/mysql.go
@@ -3,10 +3,8 @@ package linodego
import (
"context"
"encoding/json"
- "fmt"
"time"
- "github.com/go-resty/resty/v2"
"github.com/linode/linodego/internal/parseabletime"
)
@@ -112,25 +110,6 @@ func (d *MySQLDatabaseBackup) UnmarshalJSON(b []byte) error {
return nil
}
-type MySQLDatabasesPagedResponse struct {
- *PageOptions
- Data []MySQLDatabase `json:"data"`
-}
-
-func (MySQLDatabasesPagedResponse) endpoint(_ ...any) string {
- return "databases/mysql/instances"
-}
-
-func (resp *MySQLDatabasesPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(MySQLDatabasesPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*MySQLDatabasesPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// MySQLDatabaseCredential is the Root Credentials to access the Linode Managed Database
type MySQLDatabaseCredential struct {
Username string `json:"username"`
@@ -144,165 +123,121 @@ type MySQLDatabaseSSL struct {
// ListMySQLDatabases lists all MySQL Databases associated with the account
func (c *Client) ListMySQLDatabases(ctx context.Context, opts *ListOptions) ([]MySQLDatabase, error) {
- response := MySQLDatabasesPagedResponse{}
-
- err := c.listHelper(ctx, &response, opts)
+ response, err := getPaginatedResults[MySQLDatabase](ctx, c, "databases/mysql/instances", opts)
if err != nil {
return nil, err
}
- return response.Data, nil
-}
-
-type MySQLDatabaseBackupsPagedResponse struct {
- *PageOptions
- Data []MySQLDatabaseBackup `json:"data"`
-}
-
-func (MySQLDatabaseBackupsPagedResponse) endpoint(ids ...any) string {
- id := ids[0].(int)
- return fmt.Sprintf("databases/mysql/instances/%d/backups", id)
-}
-
-func (resp *MySQLDatabaseBackupsPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(MySQLDatabaseBackupsPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*MySQLDatabaseBackupsPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
+ return response, nil
}
// ListMySQLDatabaseBackups lists all MySQL Database Backups associated with the given MySQL Database
func (c *Client) ListMySQLDatabaseBackups(ctx context.Context, databaseID int, opts *ListOptions) ([]MySQLDatabaseBackup, error) {
- response := MySQLDatabaseBackupsPagedResponse{}
-
- err := c.listHelper(ctx, &response, opts, databaseID)
+ response, err := getPaginatedResults[MySQLDatabaseBackup](ctx, c, formatAPIPath("databases/mysql/instances/%d/backups", databaseID), opts)
if err != nil {
return nil, err
}
- return response.Data, nil
+ return response, nil
}
// GetMySQLDatabase returns a single MySQL Database matching the id
func (c *Client) GetMySQLDatabase(ctx context.Context, databaseID int) (*MySQLDatabase, error) {
- e := fmt.Sprintf("databases/mysql/instances/%d", databaseID)
- req := c.R(ctx).SetResult(&MySQLDatabase{})
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("databases/mysql/instances/%d", databaseID)
+ response, err := doGETRequest[MySQLDatabase](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*MySQLDatabase), nil
+ return response, nil
}
// CreateMySQLDatabase creates a new MySQL Database using the createOpts as configuration, returns the new MySQL Database
func (c *Client) CreateMySQLDatabase(ctx context.Context, opts MySQLCreateOptions) (*MySQLDatabase, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
e := "databases/mysql/instances"
- req := c.R(ctx).SetResult(&MySQLDatabase{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Post(e))
+ response, err := doPOSTRequest[MySQLDatabase](ctx, c, e, opts)
if err != nil {
return nil, err
}
- return r.Result().(*MySQLDatabase), nil
+
+ return response, nil
}
// DeleteMySQLDatabase deletes an existing MySQL Database with the given id
func (c *Client) DeleteMySQLDatabase(ctx context.Context, databaseID int) error {
- e := fmt.Sprintf("databases/mysql/instances/%d", databaseID)
- _, err := coupleAPIErrors(c.R(ctx).Delete(e))
+ e := formatAPIPath("databases/mysql/instances/%d", databaseID)
+ err := doDELETERequest(ctx, c, e)
return err
}
// UpdateMySQLDatabase updates the given MySQL Database with the provided opts, returns the MySQLDatabase with the new settings
func (c *Client) UpdateMySQLDatabase(ctx context.Context, databaseID int, opts MySQLUpdateOptions) (*MySQLDatabase, error) {
- body, err := json.Marshal(opts)
+ e := formatAPIPath("databases/mysql/instances/%d", databaseID)
+ response, err := doPUTRequest[MySQLDatabase](ctx, c, e, opts)
if err != nil {
return nil, err
}
- e := fmt.Sprintf("databases/mysql/instances/%d", databaseID)
- req := c.R(ctx).SetResult(&MySQLDatabase{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Put(e))
- if err != nil {
- return nil, err
- }
-
- return r.Result().(*MySQLDatabase), nil
+ return response, nil
}
// GetMySQLDatabaseSSL returns the SSL Certificate for the given MySQL Database
func (c *Client) GetMySQLDatabaseSSL(ctx context.Context, databaseID int) (*MySQLDatabaseSSL, error) {
- e := fmt.Sprintf("databases/mysql/instances/%d/ssl", databaseID)
- req := c.R(ctx).SetResult(&MySQLDatabaseSSL{})
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("databases/mysql/instances/%d/ssl", databaseID)
+ response, err := doGETRequest[MySQLDatabaseSSL](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*MySQLDatabaseSSL), nil
+ return response, nil
}
// GetMySQLDatabaseCredentials returns the Root Credentials for the given MySQL Database
func (c *Client) GetMySQLDatabaseCredentials(ctx context.Context, databaseID int) (*MySQLDatabaseCredential, error) {
- e := fmt.Sprintf("databases/mysql/instances/%d/credentials", databaseID)
- req := c.R(ctx).SetResult(&MySQLDatabaseCredential{})
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("databases/mysql/instances/%d/credentials", databaseID)
+ response, err := doGETRequest[MySQLDatabaseCredential](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*MySQLDatabaseCredential), nil
+ return response, nil
}
// ResetMySQLDatabaseCredentials returns the Root Credentials for the given MySQL Database (may take a few seconds to work)
func (c *Client) ResetMySQLDatabaseCredentials(ctx context.Context, databaseID int) error {
- e := fmt.Sprintf("databases/mysql/instances/%d/credentials/reset", databaseID)
- _, err := coupleAPIErrors(c.R(ctx).Post(e))
+ e := formatAPIPath("databases/mysql/instances/%d/credentials/reset", databaseID)
+ _, err := doPOSTRequest[MySQLDatabaseCredential, any](ctx, c, e)
return err
}
// GetMySQLDatabaseBackup returns a specific MySQL Database Backup with the given ids
func (c *Client) GetMySQLDatabaseBackup(ctx context.Context, databaseID int, backupID int) (*MySQLDatabaseBackup, error) {
- e := fmt.Sprintf("databases/mysql/instances/%d/backups/%d", databaseID, backupID)
- req := c.R(ctx).SetResult(&MySQLDatabaseBackup{})
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("databases/mysql/instances/%d/backups/%d", databaseID, backupID)
+ response, err := doGETRequest[MySQLDatabaseBackup](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*MySQLDatabaseBackup), nil
+ return response, nil
}
// RestoreMySQLDatabaseBackup returns the given MySQL Database with the given Backup
func (c *Client) RestoreMySQLDatabaseBackup(ctx context.Context, databaseID int, backupID int) error {
- e := fmt.Sprintf("databases/mysql/instances/%d/backups/%d/restore", databaseID, backupID)
- _, err := coupleAPIErrors(c.R(ctx).Post(e))
+ e := formatAPIPath("databases/mysql/instances/%d/backups/%d/restore", databaseID, backupID)
+ _, err := doPOSTRequest[MySQLDatabaseBackup, any](ctx, c, e)
return err
}
// CreateMySQLDatabaseBackup creates a snapshot for the given MySQL database
func (c *Client) CreateMySQLDatabaseBackup(ctx context.Context, databaseID int, opts MySQLBackupCreateOptions) error {
- body, err := json.Marshal(opts)
- if err != nil {
- return err
- }
-
- e := fmt.Sprintf("databases/mysql/instances/%d/backups", databaseID)
- _, err = coupleAPIErrors(c.R(ctx).SetBody(string(body)).Post(e))
+ e := formatAPIPath("databases/mysql/instances/%d/backups", databaseID)
+ _, err := doPOSTRequest[MySQLDatabaseBackup](ctx, c, e, opts)
return err
}
// PatchMySQLDatabase applies security patches and updates to the underlying operating system of the Managed MySQL Database
func (c *Client) PatchMySQLDatabase(ctx context.Context, databaseID int) error {
- e := fmt.Sprintf("databases/mysql/instances/%d/patch", databaseID)
- _, err := coupleAPIErrors(c.R(ctx).Post(e))
+ e := formatAPIPath("databases/mysql/instances/%d/patch", databaseID)
+ _, err := doPOSTRequest[MySQLDatabase, any](ctx, c, e)
return err
}
diff --git a/vendor/github.com/linode/linodego/network_ips.go b/vendor/github.com/linode/linodego/network_ips.go
index 5b86883e..39bcd2d6 100644
--- a/vendor/github.com/linode/linodego/network_ips.go
+++ b/vendor/github.com/linode/linodego/network_ips.go
@@ -2,19 +2,8 @@ package linodego
import (
"context"
- "encoding/json"
- "fmt"
- "net/url"
-
- "github.com/go-resty/resty/v2"
)
-// IPAddressesPagedResponse represents a paginated IPAddress API response
-type IPAddressesPagedResponse struct {
- *PageOptions
- Data []InstanceIP `json:"data"`
-}
-
// IPAddressUpdateOptions fields are those accepted by UpdateToken
type IPAddressUpdateOptions struct {
// The reverse DNS assigned to this address. For public IPv4 addresses, this will be set to a default value provided by Linode if set to nil.
@@ -52,84 +41,50 @@ func (i InstanceIP) GetUpdateOptions() (o IPAddressUpdateOptions) {
return
}
-// endpoint gets the endpoint URL for IPAddress
-func (IPAddressesPagedResponse) endpoint(_ ...any) string {
- return "networking/ips"
-}
-
-func (resp *IPAddressesPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(IPAddressesPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*IPAddressesPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListIPAddresses lists IPAddresses
func (c *Client) ListIPAddresses(ctx context.Context, opts *ListOptions) ([]InstanceIP, error) {
- response := IPAddressesPagedResponse{}
- err := c.listHelper(ctx, &response, opts)
+ response, err := getPaginatedResults[InstanceIP](ctx, c, "networking/ips", opts)
if err != nil {
return nil, err
}
- return response.Data, nil
+
+ return response, nil
}
-// GetIPAddress gets the template with the provided ID
+// GetIPAddress gets the IPAddress with the provided IP
func (c *Client) GetIPAddress(ctx context.Context, id string) (*InstanceIP, error) {
- id = url.PathEscape(id)
- e := fmt.Sprintf("networking/ips/%s", id)
- req := c.R(ctx).SetResult(&InstanceIP{})
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("networking/ips/%s", id)
+ response, err := doGETRequest[InstanceIP](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*InstanceIP), nil
+
+ return response, nil
}
// UpdateIPAddress updates the IPAddress with the specified id
func (c *Client) UpdateIPAddress(ctx context.Context, id string, opts IPAddressUpdateOptions) (*InstanceIP, error) {
- body, err := json.Marshal(opts)
+ e := formatAPIPath("networking/ips/%s", id)
+ response, err := doPUTRequest[InstanceIP](ctx, c, e, opts)
if err != nil {
return nil, err
}
- id = url.PathEscape(id)
- e := fmt.Sprintf("networking/ips/%s", id)
- req := c.R(ctx).SetResult(&InstanceIP{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Put(e))
- if err != nil {
- return nil, err
- }
- return r.Result().(*InstanceIP), nil
+ return response, nil
}
// InstancesAssignIPs assigns multiple IPv4 addresses and/or IPv6 ranges to multiple Linodes in one Region.
// This allows swapping, shuffling, or otherwise reorganizing IPs to your Linodes.
func (c *Client) InstancesAssignIPs(ctx context.Context, opts LinodesAssignIPsOptions) error {
- body, err := json.Marshal(opts)
- if err != nil {
- return err
- }
-
e := "networking/ips/assign"
- req := c.R(ctx).SetBody(string(body))
- _, err = coupleAPIErrors(req.Post(e))
+ _, err := doPOSTRequest[InstanceIP](ctx, c, e, opts)
return err
}
// ShareIPAddresses allows IP address reassignment (also referred to as IP failover)
// from one Linode to another if the primary Linode becomes unresponsive.
func (c *Client) ShareIPAddresses(ctx context.Context, opts IPAddressesShareOptions) error {
- body, err := json.Marshal(opts)
- if err != nil {
- return err
- }
-
e := "networking/ips/share"
- req := c.R(ctx).SetBody(string(body))
- _, err = coupleAPIErrors(req.Post(e))
+ _, err := doPOSTRequest[InstanceIP](ctx, c, e, opts)
return err
}
diff --git a/vendor/github.com/linode/linodego/network_pools.go b/vendor/github.com/linode/linodego/network_pools.go
index 36f8b8f9..d5031a75 100644
--- a/vendor/github.com/linode/linodego/network_pools.go
+++ b/vendor/github.com/linode/linodego/network_pools.go
@@ -2,51 +2,25 @@ package linodego
import (
"context"
- "fmt"
- "net/url"
-
- "github.com/go-resty/resty/v2"
)
-// IPv6PoolsPagedResponse represents a paginated IPv6Pool API response
-type IPv6PoolsPagedResponse struct {
- *PageOptions
- Data []IPv6Range `json:"data"`
-}
-
-// endpoint gets the endpoint URL for IPv6Pool
-func (IPv6PoolsPagedResponse) endpoint(_ ...any) string {
- return "networking/ipv6/pools"
-}
-
-func (resp *IPv6PoolsPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(IPv6PoolsPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*IPv6PoolsPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListIPv6Pools lists IPv6Pools
func (c *Client) ListIPv6Pools(ctx context.Context, opts *ListOptions) ([]IPv6Range, error) {
- response := IPv6PoolsPagedResponse{}
- err := c.listHelper(ctx, &response, opts)
+ response, err := getPaginatedResults[IPv6Range](ctx, c, "networking/ipv6/pools", opts)
if err != nil {
return nil, err
}
- return response.Data, nil
+
+ return response, nil
}
// GetIPv6Pool gets the template with the provided ID
func (c *Client) GetIPv6Pool(ctx context.Context, id string) (*IPv6Range, error) {
- id = url.PathEscape(id)
- e := fmt.Sprintf("networking/ipv6/pools/%s", id)
- req := c.R(ctx).SetResult(&IPv6Range{})
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("networking/ipv6/pools/%s", id)
+ response, err := doGETRequest[IPv6Range](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*IPv6Range), nil
+
+ return response, nil
}
diff --git a/vendor/github.com/linode/linodego/network_ranges.go b/vendor/github.com/linode/linodego/network_ranges.go
index 6a012237..554803d7 100644
--- a/vendor/github.com/linode/linodego/network_ranges.go
+++ b/vendor/github.com/linode/linodego/network_ranges.go
@@ -2,19 +2,8 @@ package linodego
import (
"context"
- "encoding/json"
- "fmt"
- "net/url"
-
- "github.com/go-resty/resty/v2"
)
-// IPv6RangesPagedResponse represents a paginated IPv6Range API response
-type IPv6RangesPagedResponse struct {
- *PageOptions
- Data []IPv6Range `json:"data"`
-}
-
// IPv6RangeCreateOptions fields are those accepted by CreateIPv6Range
type IPv6RangeCreateOptions struct {
LinodeID int `json:"linode_id,omitempty"`
@@ -22,63 +11,41 @@ type IPv6RangeCreateOptions struct {
RouteTarget string `json:"route_target,omitempty"`
}
-// endpoint gets the endpoint URL for IPv6Range
-func (IPv6RangesPagedResponse) endpoint(_ ...any) string {
- return "networking/ipv6/ranges"
-}
-
-func (resp *IPv6RangesPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(IPv6RangesPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*IPv6RangesPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListIPv6Ranges lists IPv6Ranges
func (c *Client) ListIPv6Ranges(ctx context.Context, opts *ListOptions) ([]IPv6Range, error) {
- response := IPv6RangesPagedResponse{}
- err := c.listHelper(ctx, &response, opts)
+ response, err := getPaginatedResults[IPv6Range](ctx, c, "networking/ipv6/ranges", opts)
if err != nil {
return nil, err
}
- return response.Data, nil
+
+ return response, nil
}
// GetIPv6Range gets details about an IPv6 range
func (c *Client) GetIPv6Range(ctx context.Context, ipRange string) (*IPv6Range, error) {
- ipRange = url.PathEscape(ipRange)
- e := fmt.Sprintf("networking/ipv6/ranges/%s", ipRange)
- req := c.R(ctx).SetResult(&IPv6Range{})
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("networking/ipv6/ranges/%s", ipRange)
+ response, err := doGETRequest[IPv6Range](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*IPv6Range), nil
+
+ return response, nil
}
// CreateIPv6Range creates an IPv6 Range and assigns it based on the provided Linode or route target IPv6 SLAAC address.
func (c *Client) CreateIPv6Range(ctx context.Context, opts IPv6RangeCreateOptions) (*IPv6Range, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
e := "networking/ipv6/ranges"
- req := c.R(ctx).SetResult(&IPv6Range{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Post(e))
+ response, err := doPOSTRequest[IPv6Range](ctx, c, e, opts)
if err != nil {
return nil, err
}
- return r.Result().(*IPv6Range), nil
+
+ return response, nil
}
// DeleteIPv6Range deletes an IPv6 Range.
func (c *Client) DeleteIPv6Range(ctx context.Context, ipRange string) error {
- ipRange = url.PathEscape(ipRange)
- e := fmt.Sprintf("networking/ipv6/ranges/%s", ipRange)
- _, err := coupleAPIErrors(c.R(ctx).Delete(e))
+ e := formatAPIPath("networking/ipv6/ranges/%s", ipRange)
+ err := doDELETERequest(ctx, c, e)
return err
}
diff --git a/vendor/github.com/linode/linodego/network_reserved_ips.go b/vendor/github.com/linode/linodego/network_reserved_ips.go
new file mode 100644
index 00000000..56f343f8
--- /dev/null
+++ b/vendor/github.com/linode/linodego/network_reserved_ips.go
@@ -0,0 +1,54 @@
+package linodego
+
+import (
+ "context"
+)
+
+// ReserveIPOptions represents the options for reserving an IP address
+// NOTE: Reserved IP feature may not currently be available to all users.
+type ReserveIPOptions struct {
+ Region string `json:"region"`
+}
+
+// ListReservedIPAddresses retrieves a list of reserved IP addresses
+// NOTE: Reserved IP feature may not currently be available to all users.
+func (c *Client) ListReservedIPAddresses(ctx context.Context, opts *ListOptions) ([]InstanceIP, error) {
+ e := formatAPIPath("networking/reserved/ips")
+ response, err := getPaginatedResults[InstanceIP](ctx, c, e, opts)
+ if err != nil {
+ return nil, err
+ }
+
+ return response, nil
+}
+
+// GetReservedIPAddress retrieves details of a specific reserved IP address
+// NOTE: Reserved IP feature may not currently be available to all users.
+func (c *Client) GetReservedIPAddress(ctx context.Context, ipAddress string) (*InstanceIP, error) {
+ e := formatAPIPath("networking/reserved/ips/%s", ipAddress)
+ response, err := doGETRequest[InstanceIP](ctx, c, e)
+ if err != nil {
+ return nil, err
+ }
+
+ return response, nil
+}
+
+// ReserveIPAddress reserves a new IP address
+// NOTE: Reserved IP feature may not currently be available to all users.
+func (c *Client) ReserveIPAddress(ctx context.Context, opts ReserveIPOptions) (*InstanceIP, error) {
+ e := "networking/reserved/ips"
+ response, err := doPOSTRequest[InstanceIP](ctx, c, e, opts)
+ if err != nil {
+ return nil, err
+ }
+
+ return response, nil
+}
+
+// DeleteReservedIPAddress deletes a reserved IP address
+// NOTE: Reserved IP feature may not currently be available to all users.
+func (c *Client) DeleteReservedIPAddress(ctx context.Context, ipAddress string) error {
+ e := formatAPIPath("networking/reserved/ips/%s", ipAddress)
+ return doDELETERequest(ctx, c, e)
+}
diff --git a/vendor/github.com/linode/linodego/network_transfer_prices.go b/vendor/github.com/linode/linodego/network_transfer_prices.go
new file mode 100644
index 00000000..daa25e88
--- /dev/null
+++ b/vendor/github.com/linode/linodego/network_transfer_prices.go
@@ -0,0 +1,45 @@
+package linodego
+
+import (
+ "context"
+)
+
+// NetworkTransferPrice represents a single valid network transfer price.
+type NetworkTransferPrice struct {
+ baseType[NetworkTransferTypePrice, NetworkTransferTypeRegionPrice]
+}
+
+// NetworkTransferTypePrice represents the base hourly and monthly prices
+// for a network transfer price entry.
+type NetworkTransferTypePrice struct {
+ baseTypePrice
+}
+
+// NetworkTransferTypeRegionPrice represents the regional hourly and monthly prices
+// for a network transfer price entry.
+type NetworkTransferTypeRegionPrice struct {
+ baseTypeRegionPrice
+}
+
+// ListNetworkTransferPrices lists network transfer prices. This endpoint is cached by default.
+func (c *Client) ListNetworkTransferPrices(ctx context.Context, opts *ListOptions) ([]NetworkTransferPrice, error) {
+ e := "network-transfer/prices"
+
+ endpoint, err := generateListCacheURL(e, opts)
+ if err != nil {
+ return nil, err
+ }
+
+ if result := c.getCachedResponse(endpoint); result != nil {
+ return result.([]NetworkTransferPrice), nil
+ }
+
+ response, err := getPaginatedResults[NetworkTransferPrice](ctx, c, e, opts)
+ if err != nil {
+ return nil, err
+ }
+
+ c.addCachedResponse(endpoint, response, &cacheExpiryTime)
+
+ return response, nil
+}
diff --git a/vendor/github.com/linode/linodego/nodebalancer.go b/vendor/github.com/linode/linodego/nodebalancer.go
index f7ec8e27..068eda49 100644
--- a/vendor/github.com/linode/linodego/nodebalancer.go
+++ b/vendor/github.com/linode/linodego/nodebalancer.go
@@ -3,10 +3,8 @@ package linodego
import (
"context"
"encoding/json"
- "fmt"
"time"
- "github.com/go-resty/resty/v2"
"github.com/linode/linodego/internal/parseabletime"
)
@@ -104,82 +102,52 @@ func (i NodeBalancer) GetUpdateOptions() NodeBalancerUpdateOptions {
}
}
-// NodeBalancersPagedResponse represents a paginated NodeBalancer API response
-type NodeBalancersPagedResponse struct {
- *PageOptions
- Data []NodeBalancer `json:"data"`
-}
-
-func (*NodeBalancersPagedResponse) endpoint(_ ...any) string {
- return "nodebalancers"
-}
-
-func (resp *NodeBalancersPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(NodeBalancersPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*NodeBalancersPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListNodeBalancers lists NodeBalancers
func (c *Client) ListNodeBalancers(ctx context.Context, opts *ListOptions) ([]NodeBalancer, error) {
- response := NodeBalancersPagedResponse{}
- err := c.listHelper(ctx, &response, opts)
+ response, err := getPaginatedResults[NodeBalancer](ctx, c, "nodebalancers", opts)
if err != nil {
return nil, err
}
- return response.Data, nil
+
+ return response, nil
}
// GetNodeBalancer gets the NodeBalancer with the provided ID
func (c *Client) GetNodeBalancer(ctx context.Context, nodebalancerID int) (*NodeBalancer, error) {
- e := fmt.Sprintf("nodebalancers/%d", nodebalancerID)
- req := c.R(ctx).SetResult(&NodeBalancer{})
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("nodebalancers/%d", nodebalancerID)
+ response, err := doGETRequest[NodeBalancer](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*NodeBalancer), nil
+
+ return response, nil
}
// CreateNodeBalancer creates a NodeBalancer
func (c *Client) CreateNodeBalancer(ctx context.Context, opts NodeBalancerCreateOptions) (*NodeBalancer, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
e := "nodebalancers"
- req := c.R(ctx).SetResult(&NodeBalancer{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Post(e))
+ response, err := doPOSTRequest[NodeBalancer](ctx, c, e, opts)
if err != nil {
return nil, err
}
- return r.Result().(*NodeBalancer), nil
+
+ return response, nil
}
// UpdateNodeBalancer updates the NodeBalancer with the specified id
func (c *Client) UpdateNodeBalancer(ctx context.Context, nodebalancerID int, opts NodeBalancerUpdateOptions) (*NodeBalancer, error) {
- body, err := json.Marshal(opts)
+ e := formatAPIPath("nodebalancers/%d", nodebalancerID)
+ response, err := doPUTRequest[NodeBalancer](ctx, c, e, opts)
if err != nil {
return nil, err
}
- e := fmt.Sprintf("nodebalancers/%d", nodebalancerID)
- req := c.R(ctx).SetResult(&NodeBalancer{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Put(e))
- if err != nil {
- return nil, err
- }
- return r.Result().(*NodeBalancer), nil
+ return response, nil
}
// DeleteNodeBalancer deletes the NodeBalancer with the specified id
func (c *Client) DeleteNodeBalancer(ctx context.Context, nodebalancerID int) error {
- e := fmt.Sprintf("nodebalancers/%d", nodebalancerID)
- _, err := coupleAPIErrors(c.R(ctx).Delete(e))
+ e := formatAPIPath("nodebalancers/%d", nodebalancerID)
+ err := doDELETERequest(ctx, c, e)
return err
}
diff --git a/vendor/github.com/linode/linodego/nodebalancer_config_nodes.go b/vendor/github.com/linode/linodego/nodebalancer_config_nodes.go
index 5befacd2..b69e135c 100644
--- a/vendor/github.com/linode/linodego/nodebalancer_config_nodes.go
+++ b/vendor/github.com/linode/linodego/nodebalancer_config_nodes.go
@@ -2,10 +2,6 @@ package linodego
import (
"context"
- "encoding/json"
- "fmt"
-
- "github.com/go-resty/resty/v2"
)
// NodeBalancerNode objects represent a backend that can accept traffic for a NodeBalancer Config
@@ -73,85 +69,52 @@ func (i NodeBalancerNode) GetUpdateOptions() NodeBalancerNodeUpdateOptions {
}
}
-// NodeBalancerNodesPagedResponse represents a paginated NodeBalancerNode API response
-type NodeBalancerNodesPagedResponse struct {
- *PageOptions
- Data []NodeBalancerNode `json:"data"`
-}
-
-// endpoint gets the endpoint URL for NodeBalancerNode
-func (NodeBalancerNodesPagedResponse) endpoint(ids ...any) string {
- nodebalancerID := ids[0].(int)
- configID := ids[1].(int)
- return fmt.Sprintf("nodebalancers/%d/configs/%d/nodes", nodebalancerID, configID)
-}
-
-func (resp *NodeBalancerNodesPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(NodeBalancerNodesPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*NodeBalancerNodesPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListNodeBalancerNodes lists NodeBalancerNodes
func (c *Client) ListNodeBalancerNodes(ctx context.Context, nodebalancerID int, configID int, opts *ListOptions) ([]NodeBalancerNode, error) {
- response := NodeBalancerNodesPagedResponse{}
- err := c.listHelper(ctx, &response, opts, nodebalancerID, configID)
+ response, err := getPaginatedResults[NodeBalancerNode](ctx, c, formatAPIPath("nodebalancers/%d/configs/%d/nodes", nodebalancerID, configID), opts)
if err != nil {
return nil, err
}
- return response.Data, nil
+
+ return response, nil
}
// GetNodeBalancerNode gets the template with the provided ID
func (c *Client) GetNodeBalancerNode(ctx context.Context, nodebalancerID int, configID int, nodeID int) (*NodeBalancerNode, error) {
- e := fmt.Sprintf("nodebalancers/%d/configs/%d/nodes/%d", nodebalancerID, configID, nodeID)
- req := c.R(ctx).SetResult(&NodeBalancerNode{})
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("nodebalancers/%d/configs/%d/nodes/%d", nodebalancerID, configID, nodeID)
+ response, err := doGETRequest[NodeBalancerNode](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*NodeBalancerNode), nil
+
+ return response, nil
}
// CreateNodeBalancerNode creates a NodeBalancerNode
func (c *Client) CreateNodeBalancerNode(ctx context.Context, nodebalancerID int, configID int, opts NodeBalancerNodeCreateOptions) (*NodeBalancerNode, error) {
- body, err := json.Marshal(opts)
+ e := formatAPIPath("nodebalancers/%d/configs/%d/nodes", nodebalancerID, configID)
+ response, err := doPOSTRequest[NodeBalancerNode](ctx, c, e, opts)
if err != nil {
return nil, err
}
- e := fmt.Sprintf("nodebalancers/%d/configs/%d/nodes", nodebalancerID, configID)
- req := c.R(ctx).SetResult(&NodeBalancerNode{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Post(e))
- if err != nil {
- return nil, err
- }
- return r.Result().(*NodeBalancerNode), nil
+ return response, nil
}
// UpdateNodeBalancerNode updates the NodeBalancerNode with the specified id
func (c *Client) UpdateNodeBalancerNode(ctx context.Context, nodebalancerID int, configID int, nodeID int, opts NodeBalancerNodeUpdateOptions) (*NodeBalancerNode, error) {
- body, err := json.Marshal(opts)
+ e := formatAPIPath("nodebalancers/%d/configs/%d/nodes/%d", nodebalancerID, configID, nodeID)
+ response, err := doPUTRequest[NodeBalancerNode](ctx, c, e, opts)
if err != nil {
return nil, err
}
- e := fmt.Sprintf("nodebalancers/%d/configs/%d/nodes/%d", nodebalancerID, configID, nodeID)
- req := c.R(ctx).SetResult(&NodeBalancerNode{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Put(e))
- if err != nil {
- return nil, err
- }
- return r.Result().(*NodeBalancerNode), nil
+ return response, nil
}
// DeleteNodeBalancerNode deletes the NodeBalancerNode with the specified id
func (c *Client) DeleteNodeBalancerNode(ctx context.Context, nodebalancerID int, configID int, nodeID int) error {
- e := fmt.Sprintf("nodebalancers/%d/configs/%d/nodes/%d", nodebalancerID, configID, nodeID)
- _, err := coupleAPIErrors(c.R(ctx).Delete(e))
+ e := formatAPIPath("nodebalancers/%d/configs/%d/nodes/%d", nodebalancerID, configID, nodeID)
+ err := doDELETERequest(ctx, c, e)
return err
}
diff --git a/vendor/github.com/linode/linodego/nodebalancer_configs.go b/vendor/github.com/linode/linodego/nodebalancer_configs.go
index c9f1870d..28caac70 100644
--- a/vendor/github.com/linode/linodego/nodebalancer_configs.go
+++ b/vendor/github.com/linode/linodego/nodebalancer_configs.go
@@ -2,10 +2,6 @@ package linodego
import (
"context"
- "encoding/json"
- "fmt"
-
- "github.com/go-resty/resty/v2"
)
// NodeBalancerConfig objects allow a NodeBalancer to accept traffic on a new port
@@ -120,22 +116,30 @@ type NodeBalancerConfigCreateOptions struct {
// NodeBalancerConfigRebuildOptions used by RebuildNodeBalancerConfig
type NodeBalancerConfigRebuildOptions struct {
- Port int `json:"port"`
- Protocol ConfigProtocol `json:"protocol,omitempty"`
- ProxyProtocol ConfigProxyProtocol `json:"proxy_protocol,omitempty"`
- Algorithm ConfigAlgorithm `json:"algorithm,omitempty"`
- Stickiness ConfigStickiness `json:"stickiness,omitempty"`
- Check ConfigCheck `json:"check,omitempty"`
- CheckInterval int `json:"check_interval,omitempty"`
- CheckAttempts int `json:"check_attempts,omitempty"`
- CheckPath string `json:"check_path,omitempty"`
- CheckBody string `json:"check_body,omitempty"`
- CheckPassive *bool `json:"check_passive,omitempty"`
- CheckTimeout int `json:"check_timeout,omitempty"`
- CipherSuite ConfigCipher `json:"cipher_suite,omitempty"`
- SSLCert string `json:"ssl_cert,omitempty"`
- SSLKey string `json:"ssl_key,omitempty"`
- Nodes []NodeBalancerNodeCreateOptions `json:"nodes"`
+ Port int `json:"port"`
+ Protocol ConfigProtocol `json:"protocol,omitempty"`
+ ProxyProtocol ConfigProxyProtocol `json:"proxy_protocol,omitempty"`
+ Algorithm ConfigAlgorithm `json:"algorithm,omitempty"`
+ Stickiness ConfigStickiness `json:"stickiness,omitempty"`
+ Check ConfigCheck `json:"check,omitempty"`
+ CheckInterval int `json:"check_interval,omitempty"`
+ CheckAttempts int `json:"check_attempts,omitempty"`
+ CheckPath string `json:"check_path,omitempty"`
+ CheckBody string `json:"check_body,omitempty"`
+ CheckPassive *bool `json:"check_passive,omitempty"`
+ CheckTimeout int `json:"check_timeout,omitempty"`
+ CipherSuite ConfigCipher `json:"cipher_suite,omitempty"`
+ SSLCert string `json:"ssl_cert,omitempty"`
+ SSLKey string `json:"ssl_key,omitempty"`
+ Nodes []NodeBalancerConfigRebuildNodeOptions `json:"nodes"`
+}
+
+// NodeBalancerConfigRebuildNodeOptions represents a node defined when rebuilding a
+// NodeBalancer config.
+type NodeBalancerConfigRebuildNodeOptions struct {
+ NodeBalancerNodeCreateOptions
+
+ ID int `json:"id,omitempty"`
}
// NodeBalancerConfigUpdateOptions are permitted by UpdateNodeBalancerConfig
@@ -201,104 +205,67 @@ func (i NodeBalancerConfig) GetRebuildOptions() NodeBalancerConfigRebuildOptions
CipherSuite: i.CipherSuite,
SSLCert: i.SSLCert,
SSLKey: i.SSLKey,
- Nodes: make([]NodeBalancerNodeCreateOptions, 0),
+ Nodes: make([]NodeBalancerConfigRebuildNodeOptions, 0),
}
}
-// NodeBalancerConfigsPagedResponse represents a paginated NodeBalancerConfig API response
-type NodeBalancerConfigsPagedResponse struct {
- *PageOptions
- Data []NodeBalancerConfig `json:"data"`
-}
-
-// endpoint gets the endpoint URL for NodeBalancerConfig
-func (NodeBalancerConfigsPagedResponse) endpoint(ids ...any) string {
- id := ids[0].(int)
- return fmt.Sprintf("nodebalancers/%d/configs", id)
-}
-
-func (resp *NodeBalancerConfigsPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(NodeBalancerConfigsPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*NodeBalancerConfigsPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListNodeBalancerConfigs lists NodeBalancerConfigs
func (c *Client) ListNodeBalancerConfigs(ctx context.Context, nodebalancerID int, opts *ListOptions) ([]NodeBalancerConfig, error) {
- response := NodeBalancerConfigsPagedResponse{}
- err := c.listHelper(ctx, &response, opts, nodebalancerID)
+ response, err := getPaginatedResults[NodeBalancerConfig](ctx, c, formatAPIPath("nodebalancers/%d/configs", nodebalancerID), opts)
if err != nil {
return nil, err
}
- return response.Data, nil
+
+ return response, nil
}
// GetNodeBalancerConfig gets the template with the provided ID
func (c *Client) GetNodeBalancerConfig(ctx context.Context, nodebalancerID int, configID int) (*NodeBalancerConfig, error) {
- e := fmt.Sprintf("nodebalancers/%d/configs/%d", nodebalancerID, configID)
- req := c.R(ctx).SetResult(&NodeBalancerConfig{})
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("nodebalancers/%d/configs/%d", nodebalancerID, configID)
+ response, err := doGETRequest[NodeBalancerConfig](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*NodeBalancerConfig), nil
+
+ return response, nil
}
// CreateNodeBalancerConfig creates a NodeBalancerConfig
func (c *Client) CreateNodeBalancerConfig(ctx context.Context, nodebalancerID int, opts NodeBalancerConfigCreateOptions) (*NodeBalancerConfig, error) {
- body, err := json.Marshal(opts)
+ e := formatAPIPath("nodebalancers/%d/configs", nodebalancerID)
+ response, err := doPOSTRequest[NodeBalancerConfig](ctx, c, e, opts)
if err != nil {
return nil, err
}
- e := fmt.Sprintf("nodebalancers/%d/configs", nodebalancerID)
- req := c.R(ctx).SetResult(&NodeBalancerConfig{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Post(e))
- if err != nil {
- return nil, err
- }
- return r.Result().(*NodeBalancerConfig), nil
+ return response, nil
}
// UpdateNodeBalancerConfig updates the NodeBalancerConfig with the specified id
func (c *Client) UpdateNodeBalancerConfig(ctx context.Context, nodebalancerID int, configID int, opts NodeBalancerConfigUpdateOptions) (*NodeBalancerConfig, error) {
- body, err := json.Marshal(opts)
+ e := formatAPIPath("nodebalancers/%d/configs/%d", nodebalancerID, configID)
+ response, err := doPUTRequest[NodeBalancerConfig](ctx, c, e, opts)
if err != nil {
return nil, err
}
- e := fmt.Sprintf("nodebalancers/%d/configs/%d", nodebalancerID, configID)
- req := c.R(ctx).SetResult(&NodeBalancerConfig{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Put(e))
- if err != nil {
- return nil, err
- }
- return r.Result().(*NodeBalancerConfig), nil
+ return response, nil
}
// DeleteNodeBalancerConfig deletes the NodeBalancerConfig with the specified id
func (c *Client) DeleteNodeBalancerConfig(ctx context.Context, nodebalancerID int, configID int) error {
- e := fmt.Sprintf("nodebalancers/%d/configs/%d", nodebalancerID, configID)
- _, err := coupleAPIErrors(c.R(ctx).Delete(e))
+ e := formatAPIPath("nodebalancers/%d/configs/%d", nodebalancerID, configID)
+ err := doDELETERequest(ctx, c, e)
return err
}
// RebuildNodeBalancerConfig updates the NodeBalancer with the specified id
func (c *Client) RebuildNodeBalancerConfig(ctx context.Context, nodeBalancerID int, configID int, opts NodeBalancerConfigRebuildOptions) (*NodeBalancerConfig, error) {
- body, err := json.Marshal(opts)
+ e := formatAPIPath("nodebalancers/%d/configs/%d/rebuild", nodeBalancerID, configID)
+ response, err := doPOSTRequest[NodeBalancerConfig](ctx, c, e, opts)
if err != nil {
return nil, err
}
- e := fmt.Sprintf("nodebalancers/%d/configs/%d/rebuild", nodeBalancerID, configID)
- req := c.R(ctx).SetResult(&NodeBalancerConfig{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Post(e))
- if err != nil {
- return nil, err
- }
- return r.Result().(*NodeBalancerConfig), nil
+ return response, nil
}
diff --git a/vendor/github.com/linode/linodego/nodebalancer_firewalls.go b/vendor/github.com/linode/linodego/nodebalancer_firewalls.go
index d2b339c7..2e033784 100644
--- a/vendor/github.com/linode/linodego/nodebalancer_firewalls.go
+++ b/vendor/github.com/linode/linodego/nodebalancer_firewalls.go
@@ -2,40 +2,14 @@ package linodego
import (
"context"
- "fmt"
-
- "github.com/go-resty/resty/v2"
)
-// NodeBalancerFirewallsPagedResponse represents a Linode API response for listing of Cloud Firewalls
-type NodeBalancerFirewallsPagedResponse struct {
- *PageOptions
- Data []Firewall `json:"data"`
-}
-
-func (NodeBalancerFirewallsPagedResponse) endpoint(ids ...any) string {
- id := ids[0].(int)
- return fmt.Sprintf("nodebalancers/%d/firewalls", id)
-}
-
-func (resp *NodeBalancerFirewallsPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(NodeBalancerFirewallsPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*NodeBalancerFirewallsPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListNodeBalancerFirewalls returns a paginated list of Cloud Firewalls for nodebalancerID
func (c *Client) ListNodeBalancerFirewalls(ctx context.Context, nodebalancerID int, opts *ListOptions) ([]Firewall, error) {
- response := NodeBalancerFirewallsPagedResponse{}
-
- err := c.listHelper(ctx, &response, opts, nodebalancerID)
+ response, err := getPaginatedResults[Firewall](ctx, c, formatAPIPath("nodebalancers/%d/firewalls", nodebalancerID), opts)
if err != nil {
return nil, err
}
- return response.Data, nil
+ return response, nil
}
diff --git a/vendor/github.com/linode/linodego/nodebalancer_stats.go b/vendor/github.com/linode/linodego/nodebalancer_stats.go
index 39a055cb..e1ae39b3 100644
--- a/vendor/github.com/linode/linodego/nodebalancer_stats.go
+++ b/vendor/github.com/linode/linodego/nodebalancer_stats.go
@@ -2,7 +2,6 @@ package linodego
import (
"context"
- "fmt"
)
// NodeBalancerStats represents a nodebalancer stats object
@@ -25,12 +24,11 @@ type StatsTraffic struct {
// GetNodeBalancerStats gets the template with the provided ID
func (c *Client) GetNodeBalancerStats(ctx context.Context, nodebalancerID int) (*NodeBalancerStats, error) {
- e := fmt.Sprintf("nodebalancers/%d/stats", nodebalancerID)
- req := c.R(ctx).SetResult(&NodeBalancerStats{})
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("nodebalancers/%d/stats", nodebalancerID)
+ response, err := doGETRequest[NodeBalancerStats](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*NodeBalancerStats), nil
+ return response, nil
}
diff --git a/vendor/github.com/linode/linodego/nodebalancer_types.go b/vendor/github.com/linode/linodego/nodebalancer_types.go
new file mode 100644
index 00000000..879665d4
--- /dev/null
+++ b/vendor/github.com/linode/linodego/nodebalancer_types.go
@@ -0,0 +1,45 @@
+package linodego
+
+import (
+ "context"
+)
+
+// NodeBalancerType represents a single valid NodeBalancer type.
+type NodeBalancerType struct {
+ baseType[NodeBalancerTypePrice, NodeBalancerTypeRegionPrice]
+}
+
+// NodeBalancerTypePrice represents the base hourly and monthly prices
+// for a NodeBalancer type entry.
+type NodeBalancerTypePrice struct {
+ baseTypePrice
+}
+
+// NodeBalancerTypeRegionPrice represents the regional hourly and monthly prices
+// for a NodeBalancer type entry.
+type NodeBalancerTypeRegionPrice struct {
+ baseTypeRegionPrice
+}
+
+// ListNodeBalancerTypes lists NodeBalancer types. This endpoint is cached by default.
+func (c *Client) ListNodeBalancerTypes(ctx context.Context, opts *ListOptions) ([]NodeBalancerType, error) {
+ e := "nodebalancers/types"
+
+ endpoint, err := generateListCacheURL(e, opts)
+ if err != nil {
+ return nil, err
+ }
+
+ if result := c.getCachedResponse(endpoint); result != nil {
+ return result.([]NodeBalancerType), nil
+ }
+
+ response, err := getPaginatedResults[NodeBalancerType](ctx, c, e, opts)
+ if err != nil {
+ return nil, err
+ }
+
+ c.addCachedResponse(endpoint, response, &cacheExpiryTime)
+
+ return response, nil
+}
diff --git a/vendor/github.com/linode/linodego/object_storage.go b/vendor/github.com/linode/linodego/object_storage.go
index 743bfa62..7e9c5179 100644
--- a/vendor/github.com/linode/linodego/object_storage.go
+++ b/vendor/github.com/linode/linodego/object_storage.go
@@ -12,18 +12,17 @@ type ObjectStorageTransfer struct {
// CancelObjectStorage cancels and removes all object storage from the Account
func (c *Client) CancelObjectStorage(ctx context.Context) error {
e := "object-storage/cancel"
- _, err := coupleAPIErrors(c.R(ctx).Post(e))
+ _, err := doPOSTRequest[any, any](ctx, c, e)
return err
}
// GetObjectStorageTransfer returns the amount of outbound data transferred used by the Account
func (c *Client) GetObjectStorageTransfer(ctx context.Context) (*ObjectStorageTransfer, error) {
e := "object-storage/transfer"
- req := c.R(ctx).SetResult(&ObjectStorageTransfer{})
- r, err := coupleAPIErrors(req.Get(e))
+ response, err := doGETRequest[ObjectStorageTransfer](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*ObjectStorageTransfer), nil
+ return response, nil
}
diff --git a/vendor/github.com/linode/linodego/object_storage_bucket_certs.go b/vendor/github.com/linode/linodego/object_storage_bucket_certs.go
index 904f2dcd..e09d2337 100644
--- a/vendor/github.com/linode/linodego/object_storage_bucket_certs.go
+++ b/vendor/github.com/linode/linodego/object_storage_bucket_certs.go
@@ -2,9 +2,6 @@ package linodego
import (
"context"
- "encoding/json"
- "fmt"
- "net/url"
)
type ObjectStorageBucketCert struct {
@@ -17,41 +14,30 @@ type ObjectStorageBucketCertUploadOptions struct {
}
// UploadObjectStorageBucketCert uploads a TLS/SSL Cert to be used with an Object Storage Bucket.
-func (c *Client) UploadObjectStorageBucketCert(ctx context.Context, clusterID, bucket string, opts ObjectStorageBucketCertUploadOptions) (*ObjectStorageBucketCert, error) {
- body, err := json.Marshal(opts)
+func (c *Client) UploadObjectStorageBucketCert(ctx context.Context, clusterOrRegionID, bucket string, opts ObjectStorageBucketCertUploadOptions) (*ObjectStorageBucketCert, error) {
+ e := formatAPIPath("object-storage/buckets/%s/%s/ssl", clusterOrRegionID, bucket)
+ response, err := doPOSTRequest[ObjectStorageBucketCert](ctx, c, e, opts)
if err != nil {
return nil, err
}
- clusterID = url.PathEscape(clusterID)
- bucket = url.PathEscape(bucket)
- e := fmt.Sprintf("object-storage/buckets/%s/%s/ssl", clusterID, bucket)
- req := c.R(ctx).SetResult(&ObjectStorageBucketCert{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Post(e))
- if err != nil {
- return nil, err
- }
- return r.Result().(*ObjectStorageBucketCert), nil
+ return response, nil
}
// GetObjectStorageBucketCert gets an ObjectStorageBucketCert
-func (c *Client) GetObjectStorageBucketCert(ctx context.Context, clusterID, bucket string) (*ObjectStorageBucketCert, error) {
- clusterID = url.PathEscape(clusterID)
- bucket = url.PathEscape(bucket)
- e := fmt.Sprintf("object-storage/buckets/%s/%s/ssl", clusterID, bucket)
- req := c.R(ctx).SetResult(&ObjectStorageBucketCert{})
- r, err := coupleAPIErrors(req.Get(e))
+func (c *Client) GetObjectStorageBucketCert(ctx context.Context, clusterOrRegionID, bucket string) (*ObjectStorageBucketCert, error) {
+ e := formatAPIPath("object-storage/buckets/%s/%s/ssl", clusterOrRegionID, bucket)
+ response, err := doGETRequest[ObjectStorageBucketCert](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*ObjectStorageBucketCert), nil
+
+ return response, nil
}
// DeleteObjectStorageBucketCert deletes an ObjectStorageBucketCert
-func (c *Client) DeleteObjectStorageBucketCert(ctx context.Context, clusterID, bucket string) error {
- clusterID = url.PathEscape(clusterID)
- bucket = url.PathEscape(bucket)
- e := fmt.Sprintf("object-storage/buckets/%s/%s/ssl", clusterID, bucket)
- _, err := coupleAPIErrors(c.R(ctx).Delete(e))
+func (c *Client) DeleteObjectStorageBucketCert(ctx context.Context, clusterOrRegionID, bucket string) error {
+ e := formatAPIPath("object-storage/buckets/%s/%s/ssl", clusterOrRegionID, bucket)
+ err := doDELETERequest(ctx, c, e)
return err
}
diff --git a/vendor/github.com/linode/linodego/object_storage_buckets.go b/vendor/github.com/linode/linodego/object_storage_buckets.go
index 060ec985..f5e5cd08 100644
--- a/vendor/github.com/linode/linodego/object_storage_buckets.go
+++ b/vendor/github.com/linode/linodego/object_storage_buckets.go
@@ -3,18 +3,24 @@ package linodego
import (
"context"
"encoding/json"
- "fmt"
- "net/url"
"time"
- "github.com/go-resty/resty/v2"
"github.com/linode/linodego/internal/parseabletime"
)
// ObjectStorageBucket represents a ObjectStorage object
type ObjectStorageBucket struct {
- Label string `json:"label"`
+ Label string `json:"label"`
+
+ // Deprecated: The 'Cluster' field has been deprecated in favor of the 'Region' field.
+ // For example, a Cluster value of `us-mia-1` will translate to a Region value of `us-mia`.
+ //
+ // This is necessary because there are now multiple Object Storage clusters to a region.
+ //
+ // NOTE: The 'Cluster' field will always return a value similar to `-1` (e.g., `us-mia-1`)
+ // for backward compatibility purposes.
Cluster string `json:"cluster"`
+ Region string `json:"region"`
Created *time.Time `json:"-"`
Hostname string `json:"hostname"`
@@ -50,8 +56,15 @@ func (i *ObjectStorageBucket) UnmarshalJSON(b []byte) error {
// ObjectStorageBucketCreateOptions fields are those accepted by CreateObjectStorageBucket
type ObjectStorageBucketCreateOptions struct {
- Cluster string `json:"cluster"`
- Label string `json:"label"`
+ // Deprecated: The 'Cluster' field has been deprecated.
+ //
+ // Going forward, the 'Region' field will be the supported way to designate where an
+ // Object Storage Bucket should be created. For example, a 'Cluster' value of `us-mia-1`
+ // will translate to a Region value of `us-mia`.
+ Cluster string `json:"cluster,omitempty"`
+ Region string `json:"region,omitempty"`
+
+ Label string `json:"label"`
ACL ObjectStorageACL `json:"acl,omitempty"`
CorsEnabled *bool `json:"cors_enabled,omitempty"`
@@ -74,116 +87,70 @@ const (
ACLPublicReadWrite ObjectStorageACL = "public-read-write"
)
-// ObjectStorageBucketsPagedResponse represents a paginated ObjectStorageBucket API response
-type ObjectStorageBucketsPagedResponse struct {
- *PageOptions
- Data []ObjectStorageBucket `json:"data"`
-}
-
-// endpoint gets the endpoint URL for ObjectStorageBucket
-func (ObjectStorageBucketsPagedResponse) endpoint(args ...any) string {
- endpoint := "object-storage/buckets"
- if len(args) > 0 {
- endpoint = fmt.Sprintf(endpoint+"/%s", url.PathEscape(args[0].(string)))
- }
- return endpoint
-}
-
-func (resp *ObjectStorageBucketsPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(ObjectStorageBucketsPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*ObjectStorageBucketsPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListObjectStorageBuckets lists ObjectStorageBuckets
func (c *Client) ListObjectStorageBuckets(ctx context.Context, opts *ListOptions) ([]ObjectStorageBucket, error) {
- response := ObjectStorageBucketsPagedResponse{}
- err := c.listHelper(ctx, &response, opts)
+ response, err := getPaginatedResults[ObjectStorageBucket](ctx, c, "object-storage/buckets", opts)
if err != nil {
return nil, err
}
- return response.Data, nil
+
+ return response, nil
}
// ListObjectStorageBucketsInCluster lists all ObjectStorageBuckets of a cluster
-func (c *Client) ListObjectStorageBucketsInCluster(ctx context.Context, opts *ListOptions, clusterID string) ([]ObjectStorageBucket, error) {
- response := ObjectStorageBucketsPagedResponse{}
- err := c.listHelper(ctx, &response, opts, clusterID)
+func (c *Client) ListObjectStorageBucketsInCluster(ctx context.Context, opts *ListOptions, clusterOrRegionID string) ([]ObjectStorageBucket, error) {
+ response, err := getPaginatedResults[ObjectStorageBucket](ctx, c, formatAPIPath("object-storage/buckets/%s", clusterOrRegionID), opts)
if err != nil {
return nil, err
}
- return response.Data, nil
+
+ return response, nil
}
// GetObjectStorageBucket gets the ObjectStorageBucket with the provided label
-func (c *Client) GetObjectStorageBucket(ctx context.Context, clusterID, label string) (*ObjectStorageBucket, error) {
- label = url.PathEscape(label)
- clusterID = url.PathEscape(clusterID)
- e := fmt.Sprintf("object-storage/buckets/%s/%s", clusterID, label)
- req := c.R(ctx).SetResult(&ObjectStorageBucket{})
- r, err := coupleAPIErrors(req.Get(e))
+func (c *Client) GetObjectStorageBucket(ctx context.Context, clusterOrRegionID, label string) (*ObjectStorageBucket, error) {
+ e := formatAPIPath("object-storage/buckets/%s/%s", clusterOrRegionID, label)
+ response, err := doGETRequest[ObjectStorageBucket](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*ObjectStorageBucket), nil
+
+ return response, nil
}
// CreateObjectStorageBucket creates an ObjectStorageBucket
func (c *Client) CreateObjectStorageBucket(ctx context.Context, opts ObjectStorageBucketCreateOptions) (*ObjectStorageBucket, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
e := "object-storage/buckets"
- req := c.R(ctx).SetResult(&ObjectStorageBucket{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Post(e))
+ response, err := doPOSTRequest[ObjectStorageBucket](ctx, c, e, opts)
if err != nil {
return nil, err
}
- return r.Result().(*ObjectStorageBucket), nil
+
+ return response, nil
}
// GetObjectStorageBucketAccess gets the current access config for a bucket
-func (c *Client) GetObjectStorageBucketAccess(ctx context.Context, clusterID, label string) (*ObjectStorageBucketAccess, error) {
- label = url.PathEscape(label)
- clusterID = url.PathEscape(clusterID)
- e := fmt.Sprintf("object-storage/buckets/%s/%s/access", clusterID, label)
- req := c.R(ctx).SetResult(&ObjectStorageBucketAccess{})
- r, err := coupleAPIErrors(req.Get(e))
+func (c *Client) GetObjectStorageBucketAccess(ctx context.Context, clusterOrRegionID, label string) (*ObjectStorageBucketAccess, error) {
+ e := formatAPIPath("object-storage/buckets/%s/%s/access", clusterOrRegionID, label)
+ response, err := doGETRequest[ObjectStorageBucketAccess](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*ObjectStorageBucketAccess), nil
+ return response, nil
}
// UpdateObjectStorageBucketAccess updates the access configuration for an ObjectStorageBucket
-func (c *Client) UpdateObjectStorageBucketAccess(ctx context.Context, clusterID, label string, opts ObjectStorageBucketUpdateAccessOptions) error {
- body, err := json.Marshal(opts)
- if err != nil {
- return err
- }
+func (c *Client) UpdateObjectStorageBucketAccess(ctx context.Context, clusterOrRegionID, label string, opts ObjectStorageBucketUpdateAccessOptions) error {
+ e := formatAPIPath("object-storage/buckets/%s/%s/access", clusterOrRegionID, label)
+ _, err := doPOSTRequest[ObjectStorageBucketAccess](ctx, c, e, opts)
- label = url.PathEscape(label)
- clusterID = url.PathEscape(clusterID)
- e := fmt.Sprintf("object-storage/buckets/%s/%s/access", clusterID, label)
- _, err = coupleAPIErrors(c.R(ctx).SetBody(string(body)).Post(e))
- if err != nil {
- return err
- }
-
- return nil
+ return err
}
// DeleteObjectStorageBucket deletes the ObjectStorageBucket with the specified label
-func (c *Client) DeleteObjectStorageBucket(ctx context.Context, clusterID, label string) error {
- label = url.PathEscape(label)
- e := fmt.Sprintf("object-storage/buckets/%s/%s", clusterID, label)
- _, err := coupleAPIErrors(c.R(ctx).Delete(e))
+func (c *Client) DeleteObjectStorageBucket(ctx context.Context, clusterOrRegionID, label string) error {
+ e := formatAPIPath("object-storage/buckets/%s/%s", clusterOrRegionID, label)
+ err := doDELETERequest(ctx, c, e)
return err
}
diff --git a/vendor/github.com/linode/linodego/object_storage_clusters.go b/vendor/github.com/linode/linodego/object_storage_clusters.go
index 4e4e3e26..f1d2c498 100644
--- a/vendor/github.com/linode/linodego/object_storage_clusters.go
+++ b/vendor/github.com/linode/linodego/object_storage_clusters.go
@@ -2,10 +2,6 @@ package linodego
import (
"context"
- "fmt"
- "net/url"
-
- "github.com/go-resty/resty/v2"
)
// ObjectStorageCluster represents a linode object storage cluster object
@@ -17,45 +13,24 @@ type ObjectStorageCluster struct {
StaticSiteDomain string `json:"static_site_domain"`
}
-// ObjectStorageClustersPagedResponse represents a linode API response for listing
-type ObjectStorageClustersPagedResponse struct {
- *PageOptions
- Data []ObjectStorageCluster `json:"data"`
-}
-
-// endpoint gets the endpoint URL for ObjectStorageCluster
-func (ObjectStorageClustersPagedResponse) endpoint(_ ...any) string {
- return "object-storage/clusters"
-}
-
-func (resp *ObjectStorageClustersPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(ObjectStorageClustersPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*ObjectStorageClustersPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListObjectStorageClusters lists ObjectStorageClusters
func (c *Client) ListObjectStorageClusters(ctx context.Context, opts *ListOptions) ([]ObjectStorageCluster, error) {
- response := ObjectStorageClustersPagedResponse{}
- err := c.listHelper(ctx, &response, opts)
+ response, err := getPaginatedResults[ObjectStorageCluster](ctx, c, "object-storage/clusters", opts)
if err != nil {
return nil, err
}
- return response.Data, nil
+
+ return response, nil
}
+// Deprecated: GetObjectStorageCluster uses a deprecated API endpoint.
// GetObjectStorageCluster gets the template with the provided ID
func (c *Client) GetObjectStorageCluster(ctx context.Context, clusterID string) (*ObjectStorageCluster, error) {
- clusterID = url.PathEscape(clusterID)
- e := fmt.Sprintf("object-storage/clusters/%s", clusterID)
- req := c.R(ctx).SetResult(&ObjectStorageCluster{})
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("object-storage/clusters/%s", clusterID)
+ response, err := doGETRequest[ObjectStorageCluster](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*ObjectStorageCluster), nil
+
+ return response, nil
}
diff --git a/vendor/github.com/linode/linodego/object_storage_keys.go b/vendor/github.com/linode/linodego/object_storage_keys.go
index eff34dc6..d6127db3 100644
--- a/vendor/github.com/linode/linodego/object_storage_keys.go
+++ b/vendor/github.com/linode/linodego/object_storage_keys.go
@@ -2,12 +2,13 @@ package linodego
import (
"context"
- "encoding/json"
- "fmt"
-
- "github.com/go-resty/resty/v2"
)
+type ObjectStorageKeyRegion struct {
+ ID string `json:"id"`
+ S3Endpoint string `json:"s3_endpoint"`
+}
+
// ObjectStorageKey represents a linode object storage key object
type ObjectStorageKey struct {
ID int `json:"id"`
@@ -16,11 +17,17 @@ type ObjectStorageKey struct {
SecretKey string `json:"secret_key"`
Limited bool `json:"limited"`
BucketAccess *[]ObjectStorageKeyBucketAccess `json:"bucket_access"`
+ Regions []ObjectStorageKeyRegion `json:"regions"`
}
// ObjectStorageKeyBucketAccess represents a linode limited object storage key's bucket access
type ObjectStorageKeyBucketAccess struct {
- Cluster string `json:"cluster"`
+ // Deprecated: Cluster field has been deprecated.
+ // Please consider switching to use the 'Region' field.
+ // If your Cluster is `us-mia-1`, then the region would be `us-mia`.
+ Cluster string `json:"cluster,omitempty"`
+ Region string `json:"region,omitempty"`
+
BucketName string `json:"bucket_name"`
Permissions string `json:"permissions"`
}
@@ -28,91 +35,46 @@ type ObjectStorageKeyBucketAccess struct {
// ObjectStorageKeyCreateOptions fields are those accepted by CreateObjectStorageKey
type ObjectStorageKeyCreateOptions struct {
Label string `json:"label"`
- BucketAccess *[]ObjectStorageKeyBucketAccess `json:"bucket_access"`
+ BucketAccess *[]ObjectStorageKeyBucketAccess `json:"bucket_access,omitempty"`
+ Regions []string `json:"regions,omitempty"`
}
// ObjectStorageKeyUpdateOptions fields are those accepted by UpdateObjectStorageKey
type ObjectStorageKeyUpdateOptions struct {
- Label string `json:"label"`
-}
-
-// ObjectStorageKeysPagedResponse represents a linode API response for listing
-type ObjectStorageKeysPagedResponse struct {
- *PageOptions
- Data []ObjectStorageKey `json:"data"`
-}
-
-// endpoint gets the endpoint URL for Object Storage keys
-func (ObjectStorageKeysPagedResponse) endpoint(_ ...any) string {
- return "object-storage/keys"
-}
-
-func (resp *ObjectStorageKeysPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(ObjectStorageKeysPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*ObjectStorageKeysPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
+ Label string `json:"label,omitempty"`
+ Regions []string `json:"regions,omitempty"`
}
// ListObjectStorageKeys lists ObjectStorageKeys
func (c *Client) ListObjectStorageKeys(ctx context.Context, opts *ListOptions) ([]ObjectStorageKey, error) {
- response := ObjectStorageKeysPagedResponse{}
- err := c.listHelper(ctx, &response, opts)
- if err != nil {
- return nil, err
- }
- return response.Data, nil
+ response, err := getPaginatedResults[ObjectStorageKey](ctx, c, "object-storage/keys", opts)
+ return response, err
}
// CreateObjectStorageKey creates a ObjectStorageKey
func (c *Client) CreateObjectStorageKey(ctx context.Context, opts ObjectStorageKeyCreateOptions) (*ObjectStorageKey, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, NewError(err)
- }
-
e := "object-storage/keys"
- req := c.R(ctx).SetResult(&ObjectStorageKey{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Post(e))
- if err != nil {
- return nil, err
- }
- return r.Result().(*ObjectStorageKey), nil
+ response, err := doPOSTRequest[ObjectStorageKey](ctx, c, e, opts)
+ return response, err
}
// GetObjectStorageKey gets the object storage key with the provided ID
func (c *Client) GetObjectStorageKey(ctx context.Context, keyID int) (*ObjectStorageKey, error) {
- e := fmt.Sprintf("object-storage/keys/%d", keyID)
- req := c.R(ctx).SetResult(&ObjectStorageKey{})
- r, err := coupleAPIErrors(req.Get(e))
- if err != nil {
- return nil, err
- }
- return r.Result().(*ObjectStorageKey), nil
+ e := formatAPIPath("object-storage/keys/%d", keyID)
+ response, err := doGETRequest[ObjectStorageKey](ctx, c, e)
+ return response, err
}
// UpdateObjectStorageKey updates the object storage key with the specified id
func (c *Client) UpdateObjectStorageKey(ctx context.Context, keyID int, opts ObjectStorageKeyUpdateOptions) (*ObjectStorageKey, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
- e := fmt.Sprintf("object-storage/keys/%d", keyID)
- req := c.R(ctx).SetResult(&ObjectStorageKey{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Put(e))
- if err != nil {
- return nil, err
- }
- return r.Result().(*ObjectStorageKey), nil
+ e := formatAPIPath("object-storage/keys/%d", keyID)
+ response, err := doPUTRequest[ObjectStorageKey](ctx, c, e, opts)
+ return response, err
}
// DeleteObjectStorageKey deletes the ObjectStorageKey with the specified id
func (c *Client) DeleteObjectStorageKey(ctx context.Context, keyID int) error {
- e := fmt.Sprintf("object-storage/keys/%d", keyID)
- _, err := coupleAPIErrors(c.R(ctx).Delete(e))
+ e := formatAPIPath("object-storage/keys/%d", keyID)
+ err := doDELETERequest(ctx, c, e)
return err
}
diff --git a/vendor/github.com/linode/linodego/object_storage_object.go b/vendor/github.com/linode/linodego/object_storage_object.go
index 4d262f40..ac289f3f 100644
--- a/vendor/github.com/linode/linodego/object_storage_object.go
+++ b/vendor/github.com/linode/linodego/object_storage_object.go
@@ -2,9 +2,6 @@ package linodego
import (
"context"
- "encoding/json"
- "fmt"
- "net/url"
)
type ObjectStorageObjectURLCreateOptions struct {
@@ -31,41 +28,19 @@ type ObjectStorageObjectACLConfigUpdateOptions struct {
}
func (c *Client) CreateObjectStorageObjectURL(ctx context.Context, objectID, label string, opts ObjectStorageObjectURLCreateOptions) (*ObjectStorageObjectURL, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
- label = url.PathEscape(label)
- objectID = url.PathEscape(objectID)
- e := fmt.Sprintf("object-storage/buckets/%s/%s/object-url", objectID, label)
- req := c.R(ctx).SetResult(&ObjectStorageObjectURL{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Post(e))
- return r.Result().(*ObjectStorageObjectURL), err
+ e := formatAPIPath("object-storage/buckets/%s/%s/object-url", objectID, label)
+ response, err := doPOSTRequest[ObjectStorageObjectURL](ctx, c, e, opts)
+ return response, err
}
func (c *Client) GetObjectStorageObjectACLConfig(ctx context.Context, objectID, label, object string) (*ObjectStorageObjectACLConfig, error) {
- label = url.PathEscape(label)
- object = url.QueryEscape(object)
- e := fmt.Sprintf("object-storage/buckets/%s/%s/object-acl?name=%s", objectID, label, object)
- req := c.R(ctx).SetResult(&ObjectStorageObjectACLConfig{})
- r, err := coupleAPIErrors(req.Get(e))
- return r.Result().(*ObjectStorageObjectACLConfig), err
+ e := formatAPIPath("object-storage/buckets/%s/%s/object-acl?name=%s", objectID, label, object)
+ response, err := doGETRequest[ObjectStorageObjectACLConfig](ctx, c, e)
+ return response, err
}
func (c *Client) UpdateObjectStorageObjectACLConfig(ctx context.Context, objectID, label string, opts ObjectStorageObjectACLConfigUpdateOptions) (*ObjectStorageObjectACLConfig, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
- label = url.PathEscape(label)
- e := fmt.Sprintf("object-storage/buckets/%s/%s/object-acl", objectID, label)
- req := c.R(ctx).SetResult(&ObjectStorageObjectACLConfig{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Put(e))
- if err != nil {
- return nil, err
- }
-
- return r.Result().(*ObjectStorageObjectACLConfig), err
+ e := formatAPIPath("object-storage/buckets/%s/%s/object-acl", objectID, label)
+ response, err := doPUTRequest[ObjectStorageObjectACLConfig](ctx, c, e, opts)
+ return response, err
}
diff --git a/vendor/github.com/linode/linodego/paged_response_structs.go b/vendor/github.com/linode/linodego/paged_response_structs.go
new file mode 100644
index 00000000..5c20ed26
--- /dev/null
+++ b/vendor/github.com/linode/linodego/paged_response_structs.go
@@ -0,0 +1,180 @@
+package linodego
+
+// Deprecated: AccountAvailabilityPagedResponse exists for historical compatibility and should not be used.
+type AccountAvailabilityPagedResponse legacyPagedResponse[AccountAvailability]
+
+// Deprecated: AccountBetasPagedResponse exists for historical compatibility and should not be used.
+type AccountBetasPagedResponse legacyPagedResponse[AccountBetaProgram]
+
+// Deprecated: BetaProgramPagedResponse exists for historical compatibility and should not be used.
+type BetaProgramPagedResponse legacyPagedResponse[BetaProgram]
+
+// Deprecated: DatabaseEnginesPagedResponse exists for historical compatibility and should not be used.
+type DatabaseEnginesPagedResponse legacyPagedResponse[DatabaseEngine]
+
+// Deprecated: DatabaseTypesPagedResponse exists for historical compatibility and should not be used.
+type DatabaseTypesPagedResponse legacyPagedResponse[DatabaseType]
+
+// Deprecated: DatabasesPagedResponse exists for historical compatibility and should not be used.
+type DatabasesPagedResponse legacyPagedResponse[Database]
+
+// Deprecated: DomainRecordsPagedResponse exists for historical compatibility and should not be used.
+type DomainRecordsPagedResponse legacyPagedResponse[DomainRecord]
+
+// Deprecated: DomainsPagedResponse exists for historical compatibility and should not be used.
+type DomainsPagedResponse legacyPagedResponse[Domain]
+
+// Deprecated: EventsPagedResponse exists for historical compatibility and should not be used.
+type EventsPagedResponse legacyPagedResponse[Event]
+
+// Deprecated: FirewallDevicesPagedResponse exists for historical compatibility and should not be used.
+type FirewallDevicesPagedResponse legacyPagedResponse[FirewallDevice]
+
+// Deprecated: FirewallsPagedResponse exists for historical compatibility and should not be used.
+type FirewallsPagedResponse legacyPagedResponse[Firewall]
+
+// Deprecated: ImagesPagedResponse exists for historical compatibility and should not be used.
+type ImagesPagedResponse legacyPagedResponse[Image]
+
+// Deprecated: InstanceConfigsPagedResponse exists for historical compatibility and should not be used.
+type InstanceConfigsPagedResponse legacyPagedResponse[InstanceConfig]
+
+// Deprecated: InstanceDisksPagedResponse exists for historical compatibility and should not be used.
+type InstanceDisksPagedResponse legacyPagedResponse[InstanceDisk]
+
+// Deprecated: InstanceFirewallsPagedResponse exists for historical compatibility and should not be used.
+type InstanceFirewallsPagedResponse legacyPagedResponse[Firewall]
+
+// Deprecated: InstanceVolumesPagedResponse exists for historical compatibility and should not be used.
+type InstanceVolumesPagedResponse legacyPagedResponse[Volume]
+
+// Deprecated: InstancesPagedResponse exists for historical compatibility and should not be used.
+type InstancesPagedResponse legacyPagedResponse[Instance]
+
+// Deprecated: InvoiceItemsPagedResponse exists for historical compatibility and should not be used.
+type InvoiceItemsPagedResponse legacyPagedResponse[InvoiceItem]
+
+// Deprecated: InvoicesPagedResponse exists for historical compatibility and should not be used.
+type InvoicesPagedResponse legacyPagedResponse[Invoice]
+
+// Deprecated: LKEClusterPoolsPagedResponse exists for historical compatibility and should not be used.
+// LKEClusterPoolsPagedResponse represents a paginated LKEClusterPool API response.
+type LKEClusterPoolsPagedResponse LKENodePoolsPagedResponse
+
+// Deprecated: LKEVersionsPagedResponse exists for historical compatibility and should not be used.
+type LKEVersionsPagedResponse legacyPagedResponse[LKEVersion]
+
+// Deprecated: LKEClusterAPIEndpointsPagedResponse exists for historical compatibility and should not be used.
+type LKEClusterAPIEndpointsPagedResponse legacyPagedResponse[LKEClusterAPIEndpoint]
+
+// Deprecated: LKEClustersPagedResponse exists for historical compatibility and should not be used.
+type LKEClustersPagedResponse legacyPagedResponse[LKECluster]
+
+// Deprecated: LKENodePoolsPagedResponse exists for historical compatibility and should not be used.
+type LKENodePoolsPagedResponse legacyPagedResponse[LKENodePool]
+
+// Deprecated: IPAddressesPagedResponse exists for historical compatibility and should not be used.
+type IPAddressesPagedResponse legacyPagedResponse[InstanceIP]
+
+// Deprecated: IPv6PoolsPagedResponse exists for historical compatibility and should not be used.
+type IPv6PoolsPagedResponse legacyPagedResponse[IPv6Range]
+
+// Deprecated: IPv6RangesPagedResponse exists for historical compatibility and should not be used.
+type IPv6RangesPagedResponse legacyPagedResponse[IPv6Range]
+
+// Deprecated: LinodeKernelsPagedResponse exists for historical compatibility and should not be used.
+type LinodeKernelsPagedResponse legacyPagedResponse[LinodeKernel]
+
+// Deprecated: LinodeTypesPagedResponse exists for historical compatibility and should not be used.
+type LinodeTypesPagedResponse legacyPagedResponse[LinodeType]
+
+// Deprecated: LoginsPagedResponse exists for historical compatibility and should not be used.
+type LoginsPagedResponse legacyPagedResponse[Login]
+
+// Deprecated: LongviewClientsPagedResponse exists for historical compatibility and should not be used.
+type LongviewClientsPagedResponse legacyPagedResponse[LongviewClient]
+
+// Deprecated: LongviewSubscriptionsPagedResponse exists for historical compatibility and should not be used.
+type LongviewSubscriptionsPagedResponse legacyPagedResponse[LongviewSubscription]
+
+// Deprecated: MySQLDatabasesPagedResponse exists for historical compatibility and should not be used.
+type MySQLDatabasesPagedResponse legacyPagedResponse[MySQLDatabase]
+
+// Deprecated: MySQLDatabaseBackupsPagedResponse exists for historical compatibility and should not be used.
+type MySQLDatabaseBackupsPagedResponse legacyPagedResponse[MySQLDatabaseBackup]
+
+// Deprecated: NodeBalancersPagedResponse exists for historical compatibility and should not be used.
+type NodeBalancersPagedResponse legacyPagedResponse[NodeBalancer]
+
+// Deprecated: NodeBalancerConfigsPagedResponse exists for historical compatibility and should not be used.
+type NodeBalancerConfigsPagedResponse legacyPagedResponse[NodeBalancerConfig]
+
+// Deprecated: NodeBalancerNodesPagedResponse exists for historical compatibility and should not be used.
+type NodeBalancerNodesPagedResponse legacyPagedResponse[NodeBalancerNode]
+
+// Deprecated: NodeBalancerFirewallsPagedResponse exists for historical compatibility and should not be used.
+type NodeBalancerFirewallsPagedResponse legacyPagedResponse[Firewall]
+
+// Deprecated: NotificationsPagedResponse exists for historical compatibility and should not be used.
+type NotificationsPagedResponse legacyPagedResponse[Notification]
+
+// Deprecated: OAuthClientsPagedResponse exists for historical compatibility and should not be used.
+type OAuthClientsPagedResponse legacyPagedResponse[OAuthClient]
+
+// Deprecated: ObjectStorageKeysPagedResponse exists for historical compatibility and should not be used.
+type ObjectStorageKeysPagedResponse legacyPagedResponse[ObjectStorageKey]
+
+// Deprecated: ObjectStorageBucketsPagedResponse exists for historical compatibility and should not be used.
+type ObjectStorageBucketsPagedResponse legacyPagedResponse[ObjectStorageBucket]
+
+// Deprecated: ObjectStorageClustersPagedResponse exists for historical compatibility and should not be used.
+type ObjectStorageClustersPagedResponse legacyPagedResponse[ObjectStorageCluster]
+
+// Deprecated: PaymentsPagedResponse exists for historical compatibility and should not be used.
+type PaymentsPagedResponse legacyPagedResponse[Payment]
+
+// Deprecated: RegionsPagedResponse exists for historical compatibility and should not be used.
+type RegionsPagedResponse legacyPagedResponse[Region]
+
+// Deprecated: SSHKeysPagedResponse exists for historical compatibility and should not be used.
+type SSHKeysPagedResponse legacyPagedResponse[SSHKey]
+
+// Deprecated: TokensPagedResponse exists for historical compatibility and should not be used.
+type (
+ TokensPagedResponse legacyPagedResponse[Token]
+ // Deprecated: RegionsAvailabilityPagedResponse exists for historical compatibility and should not be used.
+ RegionsAvailabilityPagedResponse legacyPagedResponse[RegionAvailability]
+)
+
+// Deprecated: StackscriptsPagedResponse exists for historical compatibility and should not be used.
+type StackscriptsPagedResponse legacyPagedResponse[Stackscript]
+
+// Deprecated: TagsPagedResponse exists for historical compatibility and should not be used.
+type TagsPagedResponse legacyPagedResponse[Tag]
+
+// Deprecated: TaggedObjectsPagedResponse exists for historical compatibility and should not be used.
+type TaggedObjectsPagedResponse legacyPagedResponse[TaggedObject]
+
+// Deprecated: TicketsPagedResponse exists for historical compatibility and should not be used.
+type TicketsPagedResponse legacyPagedResponse[Ticket]
+
+// Deprecated: PostgresDatabasesPagedResponse exists for historical compatibility and should not be used.
+type PostgresDatabasesPagedResponse legacyPagedResponse[PostgresDatabase]
+
+// Deprecated: PostgresDatabaseBackupsPagedResponse exists for historical compatibility and should not be used.
+type PostgresDatabaseBackupsPagedResponse legacyPagedResponse[PostgresDatabaseBackup]
+
+// Deprecated: ProfileLoginsPagedResponse exists for historical compatibility and should not be used.
+type ProfileLoginsPagedResponse legacyPagedResponse[ProfileLogin]
+
+// Deprecated: UsersPagedResponse exists for historical compatibility and should not be used.
+type UsersPagedResponse legacyPagedResponse[User]
+
+// Deprecated: VolumesPagedResponse exists for historical compatibility and should not be used.
+type VolumesPagedResponse legacyPagedResponse[Volume]
+
+// Deprecated: VPCsPagedResponse exists for historical compatibility and should not be used.
+type VPCsPagedResponse legacyPagedResponse[VPC]
+
+// Deprecated: VPCSubnetsPagedResponse exists for historical compatibility and should not be used.
+type VPCSubnetsPagedResponse legacyPagedResponse[VPCSubnet]
diff --git a/vendor/github.com/linode/linodego/pagination.go b/vendor/github.com/linode/linodego/pagination.go
index 671ef602..3b3f50ac 100644
--- a/vendor/github.com/linode/linodego/pagination.go
+++ b/vendor/github.com/linode/linodego/pagination.go
@@ -5,7 +5,6 @@ package linodego
*/
import (
- "context"
"crypto/sha256"
"encoding/hex"
"encoding/json"
@@ -91,41 +90,6 @@ type PagedResponse interface {
castResult(*resty.Request, string) (int, int, error)
}
-// listHelper abstracts fetching and pagination for GET endpoints that
-// do not require any Ids (top level endpoints).
-// When opts (or opts.Page) is nil, all pages will be fetched and
-// returned in a single (endpoint-specific)PagedResponse
-// opts.results and opts.pages will be updated from the API response
-func (c *Client) listHelper(ctx context.Context, pager PagedResponse, opts *ListOptions, ids ...any) error {
- req := c.R(ctx)
- if err := applyListOptionsToRequest(opts, req); err != nil {
- return err
- }
-
- pages, results, err := pager.castResult(req, pager.endpoint(ids...))
- if err != nil {
- return err
- }
- if opts == nil {
- opts = &ListOptions{PageOptions: &PageOptions{Page: 0}}
- }
- if opts.PageOptions == nil {
- opts.PageOptions = &PageOptions{Page: 0}
- }
- if opts.Page == 0 {
- for page := 2; page <= pages; page++ {
- opts.Page = page
- if err := c.listHelper(ctx, pager, opts, ids...); err != nil {
- return err
- }
- }
- }
-
- opts.Results = results
- opts.Pages = pages
- return nil
-}
-
// flattenQueryStruct flattens a structure into a Resty-compatible query param map.
// Fields are mapped using the `query` struct tag.
func flattenQueryStruct(val any) (map[string]string, error) {
@@ -150,7 +114,7 @@ func flattenQueryStruct(val any) (map[string]string, error) {
valType := reflectVal.Type()
- for i := 0; i < valType.NumField(); i++ {
+ for i := range valType.NumField() {
currentField := valType.Field(i)
queryTag, ok := currentField.Tag.Lookup("query")
@@ -197,3 +161,8 @@ func queryFieldToString(value reflect.Value) (string, error) {
return "", fmt.Errorf("unsupported query param type: %s", value.Type().Name())
}
}
+
+type legacyPagedResponse[T any] struct {
+ *PageOptions
+ Data []T `json:"data"`
+}
diff --git a/vendor/github.com/linode/linodego/placement_groups.go b/vendor/github.com/linode/linodego/placement_groups.go
new file mode 100644
index 00000000..5e68e2e9
--- /dev/null
+++ b/vendor/github.com/linode/linodego/placement_groups.go
@@ -0,0 +1,161 @@
+package linodego
+
+import "context"
+
+// PlacementGroupType is an enum that determines the affinity policy
+// for Linodes in a placement group.
+type PlacementGroupType string
+
+const (
+ PlacementGroupTypeAntiAffinityLocal PlacementGroupType = "anti_affinity:local"
+)
+
+// PlacementGroupPolicy is an enum for the policy that determines whether a
+// Linode can be assigned to a Placement Group.
+type PlacementGroupPolicy string
+
+const (
+ PlacementGroupPolicyStrict PlacementGroupPolicy = "strict"
+ PlacementGroupPolicyFlexible PlacementGroupPolicy = "flexible"
+)
+
+// PlacementGroupMember represents a single Linode assigned to a
+// placement group.
+type PlacementGroupMember struct {
+ LinodeID int `json:"linode_id"`
+ IsCompliant bool `json:"is_compliant"`
+}
+
+// PlacementGroup represents a Linode placement group.
+type PlacementGroup struct {
+ ID int `json:"id"`
+ Label string `json:"label"`
+ Region string `json:"region"`
+ PlacementGroupType PlacementGroupType `json:"placement_group_type"`
+ PlacementGroupPolicy PlacementGroupPolicy `json:"placement_group_policy"`
+ IsCompliant bool `json:"is_compliant"`
+ Members []PlacementGroupMember `json:"members"`
+}
+
+// PlacementGroupCreateOptions represents the options to use
+// when creating a placement group.
+type PlacementGroupCreateOptions struct {
+ Label string `json:"label"`
+ Region string `json:"region"`
+ PlacementGroupType PlacementGroupType `json:"placement_group_type"`
+ PlacementGroupPolicy PlacementGroupPolicy `json:"placement_group_policy"`
+}
+
+// PlacementGroupUpdateOptions represents the options to use
+// when updating a placement group.
+type PlacementGroupUpdateOptions struct {
+ Label string `json:"label,omitempty"`
+}
+
+// PlacementGroupAssignOptions represents options used when
+// assigning Linodes to a placement group.
+type PlacementGroupAssignOptions struct {
+ Linodes []int `json:"linodes"`
+ CompliantOnly *bool `json:"compliant_only,omitempty"`
+}
+
+// PlacementGroupUnAssignOptions represents options used when
+// unassigning Linodes from a placement group.
+type PlacementGroupUnAssignOptions struct {
+ Linodes []int `json:"linodes"`
+}
+
+// ListPlacementGroups lists placement groups under the current account
+// matching the given list options.
+func (c *Client) ListPlacementGroups(
+ ctx context.Context,
+ options *ListOptions,
+) ([]PlacementGroup, error) {
+ return getPaginatedResults[PlacementGroup](
+ ctx,
+ c,
+ "placement/groups",
+ options,
+ )
+}
+
+// GetPlacementGroup gets a placement group with the specified ID.
+func (c *Client) GetPlacementGroup(
+ ctx context.Context,
+ id int,
+) (*PlacementGroup, error) {
+ return doGETRequest[PlacementGroup](
+ ctx,
+ c,
+ formatAPIPath("placement/groups/%d", id),
+ )
+}
+
+// CreatePlacementGroup creates a placement group with the specified options.
+func (c *Client) CreatePlacementGroup(
+ ctx context.Context,
+ options PlacementGroupCreateOptions,
+) (*PlacementGroup, error) {
+ return doPOSTRequest[PlacementGroup](
+ ctx,
+ c,
+ "placement/groups",
+ options,
+ )
+}
+
+// UpdatePlacementGroup updates a placement group with the specified ID using the provided options.
+func (c *Client) UpdatePlacementGroup(
+ ctx context.Context,
+ id int,
+ options PlacementGroupUpdateOptions,
+) (*PlacementGroup, error) {
+ return doPUTRequest[PlacementGroup](
+ ctx,
+ c,
+ formatAPIPath("placement/groups/%d", id),
+ options,
+ )
+}
+
+// AssignPlacementGroupLinodes assigns the specified Linodes to the given
+// placement group.
+func (c *Client) AssignPlacementGroupLinodes(
+ ctx context.Context,
+ id int,
+ options PlacementGroupAssignOptions,
+) (*PlacementGroup, error) {
+ return doPOSTRequest[PlacementGroup](
+ ctx,
+ c,
+ formatAPIPath("placement/groups/%d/assign", id),
+ options,
+ )
+}
+
+// UnassignPlacementGroupLinodes un-assigns the specified Linodes from the given
+// placement group.
+func (c *Client) UnassignPlacementGroupLinodes(
+ ctx context.Context,
+ id int,
+ options PlacementGroupUnAssignOptions,
+) (*PlacementGroup, error) {
+ return doPOSTRequest[PlacementGroup](
+ ctx,
+ c,
+ formatAPIPath("placement/groups/%d/unassign", id),
+ options,
+ )
+}
+
+// DeletePlacementGroup deletes a placement group with the specified ID.
+func (c *Client) DeletePlacementGroup(
+ ctx context.Context,
+ id int,
+) error {
+ return doDELETERequest(
+ ctx,
+ c,
+ formatAPIPath("placement/groups/%d", id),
+ )
+}
diff --git a/vendor/github.com/linode/linodego/pointer_helpers.go b/vendor/github.com/linode/linodego/pointer_helpers.go
new file mode 100644
index 00000000..a6045fdf
--- /dev/null
+++ b/vendor/github.com/linode/linodego/pointer_helpers.go
@@ -0,0 +1,25 @@
+package linodego
+
+/*
+Pointer takes a value of any type T and returns a pointer to that value.
+Go does not allow directly creating pointers to literals, so Pointer enables
+abstraction away the pointer logic.
+
+Example:
+
+ booted := true
+
+ createOpts := linodego.InstanceCreateOptions{
+ Booted: &booted,
+ }
+
+ can be replaced with
+
+ createOpts := linodego.InstanceCreateOptions{
+ Booted: linodego.Pointer(true),
+ }
+*/
+
+func Pointer[T any](value T) *T {
+ return &value
+}
diff --git a/vendor/github.com/linode/linodego/postgres.go b/vendor/github.com/linode/linodego/postgres.go
index 35158b6e..19c32f79 100644
--- a/vendor/github.com/linode/linodego/postgres.go
+++ b/vendor/github.com/linode/linodego/postgres.go
@@ -3,10 +3,8 @@ package linodego
import (
"context"
"encoding/json"
- "fmt"
"time"
- "github.com/go-resty/resty/v2"
"github.com/linode/linodego/internal/parseabletime"
)
@@ -109,35 +107,10 @@ type PostgresDatabaseCredential struct {
Password string `json:"password"`
}
-type PostgresDatabasesPagedResponse struct {
- *PageOptions
- Data []PostgresDatabase `json:"data"`
-}
-
-func (PostgresDatabasesPagedResponse) endpoint(_ ...any) string {
- return "databases/postgresql/instances"
-}
-
-func (resp *PostgresDatabasesPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(PostgresDatabasesPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*PostgresDatabasesPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListPostgresDatabases lists all Postgres Databases associated with the account
func (c *Client) ListPostgresDatabases(ctx context.Context, opts *ListOptions) ([]PostgresDatabase, error) {
- response := PostgresDatabasesPagedResponse{}
-
- err := c.listHelper(ctx, &response, opts)
- if err != nil {
- return nil, err
- }
-
- return response.Data, nil
+ response, err := getPaginatedResults[PostgresDatabase](ctx, c, "databases/postgresql/instances", opts)
+ return response, err
}
// PostgresDatabaseBackup is information for interacting with a backup for the existing Postgres Database
@@ -172,155 +145,85 @@ type PostgresBackupCreateOptions struct {
Target PostgresDatabaseTarget `json:"target"`
}
-type PostgresDatabaseBackupsPagedResponse struct {
- *PageOptions
- Data []PostgresDatabaseBackup `json:"data"`
-}
-
-func (PostgresDatabaseBackupsPagedResponse) endpoint(ids ...any) string {
- id := ids[0].(int)
- return fmt.Sprintf("databases/postgresql/instances/%d/backups", id)
-}
-
-func (resp *PostgresDatabaseBackupsPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(PostgresDatabaseBackupsPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*PostgresDatabaseBackupsPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListPostgresDatabaseBackups lists all Postgres Database Backups associated with the given Postgres Database
func (c *Client) ListPostgresDatabaseBackups(ctx context.Context, databaseID int, opts *ListOptions) ([]PostgresDatabaseBackup, error) {
- response := PostgresDatabaseBackupsPagedResponse{}
-
- err := c.listHelper(ctx, &response, opts, databaseID)
- if err != nil {
- return nil, err
- }
-
- return response.Data, nil
+ response, err := getPaginatedResults[PostgresDatabaseBackup](ctx, c, formatAPIPath("databases/postgresql/instances/%d/backups", databaseID), opts)
+ return response, err
}
// GetPostgresDatabase returns a single Postgres Database matching the id
func (c *Client) GetPostgresDatabase(ctx context.Context, databaseID int) (*PostgresDatabase, error) {
- e := fmt.Sprintf("databases/postgresql/instances/%d", databaseID)
- req := c.R(ctx).SetResult(&PostgresDatabase{})
- r, err := coupleAPIErrors(req.Get(e))
- if err != nil {
- return nil, err
- }
-
- return r.Result().(*PostgresDatabase), nil
+ e := formatAPIPath("databases/postgresql/instances/%d", databaseID)
+ response, err := doGETRequest[PostgresDatabase](ctx, c, e)
+ return response, err
}
// CreatePostgresDatabase creates a new Postgres Database using the createOpts as configuration, returns the new Postgres Database
func (c *Client) CreatePostgresDatabase(ctx context.Context, opts PostgresCreateOptions) (*PostgresDatabase, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
e := "databases/postgresql/instances"
- req := c.R(ctx).SetResult(&PostgresDatabase{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Post(e))
- if err != nil {
- return nil, err
- }
- return r.Result().(*PostgresDatabase), nil
+ response, err := doPOSTRequest[PostgresDatabase](ctx, c, e, opts)
+ return response, err
}
// DeletePostgresDatabase deletes an existing Postgres Database with the given id
func (c *Client) DeletePostgresDatabase(ctx context.Context, databaseID int) error {
- e := fmt.Sprintf("databases/postgresql/instances/%d", databaseID)
- _, err := coupleAPIErrors(c.R(ctx).Delete(e))
+ e := formatAPIPath("databases/postgresql/instances/%d", databaseID)
+ err := doDELETERequest(ctx, c, e)
return err
}
// UpdatePostgresDatabase updates the given Postgres Database with the provided opts, returns the PostgresDatabase with the new settings
func (c *Client) UpdatePostgresDatabase(ctx context.Context, databaseID int, opts PostgresUpdateOptions) (*PostgresDatabase, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, NewError(err)
- }
-
- e := fmt.Sprintf("databases/postgresql/instances/%d", databaseID)
- req := c.R(ctx).SetResult(&PostgresDatabase{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Put(e))
- if err != nil {
- return nil, err
- }
-
- return r.Result().(*PostgresDatabase), nil
+ e := formatAPIPath("databases/postgresql/instances/%d", databaseID)
+ response, err := doPUTRequest[PostgresDatabase](ctx, c, e, opts)
+ return response, err
}
// PatchPostgresDatabase applies security patches and updates to the underlying operating system of the Managed Postgres Database
func (c *Client) PatchPostgresDatabase(ctx context.Context, databaseID int) error {
- e := fmt.Sprintf("databases/postgresql/instances/%d/patch", databaseID)
- _, err := coupleAPIErrors(c.R(ctx).Post(e))
+ e := formatAPIPath("databases/postgresql/instances/%d/patch", databaseID)
+ _, err := doPOSTRequest[PostgresDatabase, any](ctx, c, e)
return err
}
// GetPostgresDatabaseCredentials returns the Root Credentials for the given Postgres Database
func (c *Client) GetPostgresDatabaseCredentials(ctx context.Context, databaseID int) (*PostgresDatabaseCredential, error) {
- e := fmt.Sprintf("databases/postgresql/instances/%d/credentials", databaseID)
- req := c.R(ctx).SetResult(&PostgresDatabaseCredential{})
- r, err := coupleAPIErrors(req.Get(e))
- if err != nil {
- return nil, err
- }
-
- return r.Result().(*PostgresDatabaseCredential), nil
+ e := formatAPIPath("databases/postgresql/instances/%d/credentials", databaseID)
+ response, err := doGETRequest[PostgresDatabaseCredential](ctx, c, e)
+ return response, err
}
// ResetPostgresDatabaseCredentials returns the Root Credentials for the given Postgres Database (may take a few seconds to work)
func (c *Client) ResetPostgresDatabaseCredentials(ctx context.Context, databaseID int) error {
- e := fmt.Sprintf("databases/postgresql/instances/%d/credentials/reset", databaseID)
- _, err := coupleAPIErrors(c.R(ctx).Post(e))
+ e := formatAPIPath("databases/postgresql/instances/%d/credentials/reset", databaseID)
+ _, err := doPOSTRequest[PostgresDatabaseCredential, any](ctx, c, e)
return err
}
// GetPostgresDatabaseSSL returns the SSL Certificate for the given Postgres Database
func (c *Client) GetPostgresDatabaseSSL(ctx context.Context, databaseID int) (*PostgresDatabaseSSL, error) {
- e := fmt.Sprintf("databases/postgresql/instances/%d/ssl", databaseID)
- req := c.R(ctx).SetResult(&PostgresDatabaseSSL{})
- r, err := coupleAPIErrors(req.Get(e))
- if err != nil {
- return nil, err
- }
-
- return r.Result().(*PostgresDatabaseSSL), nil
+ e := formatAPIPath("databases/postgresql/instances/%d/ssl", databaseID)
+ response, err := doGETRequest[PostgresDatabaseSSL](ctx, c, e)
+ return response, err
}
// GetPostgresDatabaseBackup returns a specific Postgres Database Backup with the given ids
func (c *Client) GetPostgresDatabaseBackup(ctx context.Context, databaseID int, backupID int) (*PostgresDatabaseBackup, error) {
- e := fmt.Sprintf("databases/postgresql/instances/%d/backups/%d", databaseID, backupID)
- req := c.R(ctx).SetResult(&PostgresDatabaseBackup{})
- r, err := coupleAPIErrors(req.Get(e))
- if err != nil {
- return nil, err
- }
-
- return r.Result().(*PostgresDatabaseBackup), nil
+ e := formatAPIPath("databases/postgresql/instances/%d/backups/%d", databaseID, backupID)
+ response, err := doGETRequest[PostgresDatabaseBackup](ctx, c, e)
+ return response, err
}
// RestorePostgresDatabaseBackup returns the given Postgres Database with the given Backup
func (c *Client) RestorePostgresDatabaseBackup(ctx context.Context, databaseID int, backupID int) error {
- e := fmt.Sprintf("databases/postgresql/instances/%d/backups/%d/restore", databaseID, backupID)
- _, err := coupleAPIErrors(c.R(ctx).Post(e))
+ e := formatAPIPath("databases/postgresql/instances/%d/backups/%d/restore", databaseID, backupID)
+ _, err := doPOSTRequest[PostgresDatabaseBackup, any](ctx, c, e)
return err
}
// CreatePostgresDatabaseBackup creates a snapshot for the given Postgres database
func (c *Client) CreatePostgresDatabaseBackup(ctx context.Context, databaseID int, opts PostgresBackupCreateOptions) error {
- body, err := json.Marshal(opts)
- if err != nil {
- return err
- }
-
- e := fmt.Sprintf("databases/postgresql/instances/%d/backups", databaseID)
- _, err = coupleAPIErrors(c.R(ctx).SetBody(string(body)).Post(e))
+ e := formatAPIPath("databases/postgresql/instances/%d/backups", databaseID)
+ _, err := doPOSTRequest[PostgresDatabaseBackup](ctx, c, e, opts)
return err
}
diff --git a/vendor/github.com/linode/linodego/profile.go b/vendor/github.com/linode/linodego/profile.go
index a955d39c..bc5761db 100644
--- a/vendor/github.com/linode/linodego/profile.go
+++ b/vendor/github.com/linode/linodego/profile.go
@@ -2,7 +2,6 @@ package linodego
import (
"context"
- "encoding/json"
)
// LishAuthMethod constants start with AuthMethod and include Linode API Lish Authentication Methods
@@ -27,17 +26,19 @@ type ProfileReferrals struct {
// Profile represents a Profile object
type Profile struct {
- UID int `json:"uid"`
- Username string `json:"username"`
- Email string `json:"email"`
- Timezone string `json:"timezone"`
- EmailNotifications bool `json:"email_notifications"`
- IPWhitelistEnabled bool `json:"ip_whitelist_enabled"`
- TwoFactorAuth bool `json:"two_factor_auth"`
- Restricted bool `json:"restricted"`
- LishAuthMethod LishAuthMethod `json:"lish_auth_method"`
- Referrals ProfileReferrals `json:"referrals"`
- AuthorizedKeys []string `json:"authorized_keys"`
+ UID int `json:"uid"`
+ Username string `json:"username"`
+ Email string `json:"email"`
+ Timezone string `json:"timezone"`
+ EmailNotifications bool `json:"email_notifications"`
+ IPWhitelistEnabled bool `json:"ip_whitelist_enabled"`
+ TwoFactorAuth bool `json:"two_factor_auth"`
+ Restricted bool `json:"restricted"`
+ LishAuthMethod LishAuthMethod `json:"lish_auth_method"`
+ Referrals ProfileReferrals `json:"referrals"`
+ AuthorizedKeys []string `json:"authorized_keys"`
+ AuthenticationType string `json:"authentication_type"`
+ VerifiedPhoneNumber string `json:"verified_phone_number,omitempty"`
}
// ProfileUpdateOptions fields are those accepted by UpdateProfile
@@ -71,26 +72,13 @@ func (i Profile) GetUpdateOptions() (o ProfileUpdateOptions) {
// GetProfile returns the Profile of the authenticated user
func (c *Client) GetProfile(ctx context.Context) (*Profile, error) {
e := "profile"
- req := c.R(ctx).SetResult(&Profile{})
- r, err := coupleAPIErrors(req.Get(e))
- if err != nil {
- return nil, err
- }
- return r.Result().(*Profile), nil
+ response, err := doGETRequest[Profile](ctx, c, e)
+ return response, err
}
// UpdateProfile updates the Profile with the specified id
func (c *Client) UpdateProfile(ctx context.Context, opts ProfileUpdateOptions) (*Profile, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
e := "profile"
- req := c.R(ctx).SetResult(&Profile{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Put(e))
- if err != nil {
- return nil, err
- }
- return r.Result().(*Profile), nil
+ response, err := doPUTRequest[Profile](ctx, c, e, opts)
+ return response, err
}
diff --git a/vendor/github.com/linode/linodego/profile_grants_list.go b/vendor/github.com/linode/linodego/profile_grants_list.go
index c7058107..9dafd928 100644
--- a/vendor/github.com/linode/linodego/profile_grants_list.go
+++ b/vendor/github.com/linode/linodego/profile_grants_list.go
@@ -8,10 +8,6 @@ type GrantsListResponse = UserGrants
func (c *Client) GrantsList(ctx context.Context) (*GrantsListResponse, error) {
e := "profile/grants"
- r, err := coupleAPIErrors(c.R(ctx).SetResult(GrantsListResponse{}).Get(e))
- if err != nil {
- return nil, err
- }
-
- return r.Result().(*GrantsListResponse), err
+ response, err := doGETRequest[GrantsListResponse](ctx, c, e)
+ return response, err
}
diff --git a/vendor/github.com/linode/linodego/profile_logins.go b/vendor/github.com/linode/linodego/profile_logins.go
index ce5d87bd..bb5b8521 100644
--- a/vendor/github.com/linode/linodego/profile_logins.go
+++ b/vendor/github.com/linode/linodego/profile_logins.go
@@ -3,10 +3,8 @@ package linodego
import (
"context"
"encoding/json"
- "fmt"
"time"
- "github.com/go-resty/resty/v2"
"github.com/linode/linodego/internal/parseabletime"
)
@@ -20,25 +18,6 @@ type ProfileLogin struct {
Username string `json:"username"`
}
-type ProfileLoginsPagedResponse struct {
- *PageOptions
- Data []ProfileLogin `json:"data"`
-}
-
-func (ProfileLoginsPagedResponse) endpoint(_ ...any) string {
- return "profile/logins"
-}
-
-func (resp *ProfileLoginsPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(ProfileLoginsPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*ProfileLoginsPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// UnmarshalJSON implements the json.Unmarshaler interface
func (i *ProfileLogin) UnmarshalJSON(b []byte) error {
type Mask ProfileLogin
@@ -61,23 +40,13 @@ func (i *ProfileLogin) UnmarshalJSON(b []byte) error {
// GetProfileLogin returns the Profile Login of the authenticated user
func (c *Client) GetProfileLogin(ctx context.Context, id int) (*ProfileLogin, error) {
- e := fmt.Sprintf("profile/logins/%d", id)
-
- req := c.R(ctx).SetResult(&ProfileLogin{})
- r, err := coupleAPIErrors(req.Get(e))
- if err != nil {
- return nil, err
- }
- return r.Result().(*ProfileLogin), nil
+ e := formatAPIPath("profile/logins/%d", id)
+ response, err := doGETRequest[ProfileLogin](ctx, c, e)
+ return response, err
}
// ListProfileLogins lists Profile Logins of the authenticated user
func (c *Client) ListProfileLogins(ctx context.Context, opts *ListOptions) ([]ProfileLogin, error) {
- response := ProfileLoginsPagedResponse{}
- err := c.listHelper(ctx, &response, opts)
- if err != nil {
- return nil, err
- }
-
- return response.Data, nil
+ response, err := getPaginatedResults[ProfileLogin](ctx, c, "profile/logins", opts)
+ return response, err
}
diff --git a/vendor/github.com/linode/linodego/profile_phone_number.go b/vendor/github.com/linode/linodego/profile_phone_number.go
index 8c52ae38..c71d12fe 100644
--- a/vendor/github.com/linode/linodego/profile_phone_number.go
+++ b/vendor/github.com/linode/linodego/profile_phone_number.go
@@ -2,7 +2,6 @@ package linodego
import (
"context"
- "encoding/json"
)
// SendPhoneNumberVerificationCodeOptions fields are those accepted by SendPhoneNumberVerificationCode
@@ -18,31 +17,23 @@ type VerifyPhoneNumberOptions struct {
// SendPhoneNumberVerificationCode sends a one-time verification code via SMS message to the submitted phone number.
func (c *Client) SendPhoneNumberVerificationCode(ctx context.Context, opts SendPhoneNumberVerificationCodeOptions) error {
- body, err := json.Marshal(opts)
- if err != nil {
- return err
- }
-
e := "profile/phone-number"
- _, err = coupleAPIErrors(c.R(ctx).SetBody(string(body)).Post(e))
+ _, err := doPOSTRequest[any](ctx, c, e, opts)
+
return err
}
// DeletePhoneNumber deletes the verified phone number for the User making this request.
func (c *Client) DeletePhoneNumber(ctx context.Context) error {
e := "profile/phone-number"
- _, err := coupleAPIErrors(c.R(ctx).Delete(e))
+ err := doDELETERequest(ctx, c, e)
return err
}
// VerifyPhoneNumber verifies a phone number by confirming the one-time code received via SMS message after accessing the Phone Verification Code Send command.
func (c *Client) VerifyPhoneNumber(ctx context.Context, opts VerifyPhoneNumberOptions) error {
- body, err := json.Marshal(opts)
- if err != nil {
- return err
- }
-
e := "profile/phone-number/verify"
- _, err = coupleAPIErrors(c.R(ctx).SetBody(string(body)).Post(e))
+ _, err := doPOSTRequest[any](ctx, c, e, opts)
+
return err
}
diff --git a/vendor/github.com/linode/linodego/profile_security_questions.go b/vendor/github.com/linode/linodego/profile_security_questions.go
index 66760c95..c827cd79 100644
--- a/vendor/github.com/linode/linodego/profile_security_questions.go
+++ b/vendor/github.com/linode/linodego/profile_security_questions.go
@@ -2,7 +2,6 @@ package linodego
import (
"context"
- "encoding/json"
)
type SecurityQuestion struct {
@@ -27,23 +26,18 @@ type SecurityQuestionsAnswerOptions struct {
// SecurityQuestionsList returns a collection of security questions and their responses, if any, for your User Profile.
func (c *Client) SecurityQuestionsList(ctx context.Context) (*SecurityQuestionsListResponse, error) {
e := "profile/security-questions"
- req := c.R(ctx).SetResult(&SecurityQuestionsListResponse{})
- r, err := coupleAPIErrors(req.Get(e))
+ response, err := doGETRequest[SecurityQuestionsListResponse](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*SecurityQuestionsListResponse), nil
+
+ return response, nil
}
// SecurityQuestionsAnswer adds security question responses for your User.
func (c *Client) SecurityQuestionsAnswer(ctx context.Context, opts SecurityQuestionsAnswerOptions) error {
- body, err := json.Marshal(opts)
- if err != nil {
- return err
- }
-
e := "profile/security-questions"
- req := c.R(ctx).SetBody(string(body))
- _, err = coupleAPIErrors(req.Post(e))
+
+ _, err := doPOSTRequest[any](ctx, c, e, opts)
return err
}
diff --git a/vendor/github.com/linode/linodego/profile_sshkeys.go b/vendor/github.com/linode/linodego/profile_sshkeys.go
index 340ca8c4..b67e616c 100644
--- a/vendor/github.com/linode/linodego/profile_sshkeys.go
+++ b/vendor/github.com/linode/linodego/profile_sshkeys.go
@@ -3,10 +3,8 @@ package linodego
import (
"context"
"encoding/json"
- "fmt"
"time"
- "github.com/go-resty/resty/v2"
"github.com/linode/linodego/internal/parseabletime"
)
@@ -62,83 +60,52 @@ func (i SSHKey) GetUpdateOptions() (o SSHKeyUpdateOptions) {
return
}
-// SSHKeysPagedResponse represents a paginated SSHKey API response
-type SSHKeysPagedResponse struct {
- *PageOptions
- Data []SSHKey `json:"data"`
-}
-
-// endpoint gets the endpoint URL for SSHKey
-func (SSHKeysPagedResponse) endpoint(_ ...any) string {
- return "profile/sshkeys"
-}
-
-func (resp *SSHKeysPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(SSHKeysPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*SSHKeysPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListSSHKeys lists SSHKeys
func (c *Client) ListSSHKeys(ctx context.Context, opts *ListOptions) ([]SSHKey, error) {
- response := SSHKeysPagedResponse{}
- err := c.listHelper(ctx, &response, opts)
+ response, err := getPaginatedResults[SSHKey](ctx, c, "profile/sshkeys", opts)
if err != nil {
return nil, err
}
- return response.Data, nil
+
+ return response, nil
}
// GetSSHKey gets the sshkey with the provided ID
func (c *Client) GetSSHKey(ctx context.Context, keyID int) (*SSHKey, error) {
- e := fmt.Sprintf("profile/sshkeys/%d", keyID)
- req := c.R(ctx).SetResult(&SSHKey{})
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("profile/sshkeys/%d", keyID)
+ response, err := doGETRequest[SSHKey](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*SSHKey), nil
+
+ return response, nil
}
// CreateSSHKey creates a SSHKey
func (c *Client) CreateSSHKey(ctx context.Context, opts SSHKeyCreateOptions) (*SSHKey, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
e := "profile/sshkeys"
- req := c.R(ctx).SetResult(&SSHKey{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Post(e))
+ response, err := doPOSTRequest[SSHKey](ctx, c, e, opts)
if err != nil {
return nil, err
}
- return r.Result().(*SSHKey), nil
+
+ return response, nil
}
// UpdateSSHKey updates the SSHKey with the specified id
func (c *Client) UpdateSSHKey(ctx context.Context, keyID int, opts SSHKeyUpdateOptions) (*SSHKey, error) {
- body, err := json.Marshal(opts)
+ e := formatAPIPath("profile/sshkeys/%d", keyID)
+ response, err := doPUTRequest[SSHKey](ctx, c, e, opts)
if err != nil {
return nil, err
}
- e := fmt.Sprintf("profile/sshkeys/%d", keyID)
- req := c.R(ctx).SetResult(&SSHKey{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Put(e))
- if err != nil {
- return nil, err
- }
- return r.Result().(*SSHKey), nil
+ return response, nil
}
// DeleteSSHKey deletes the SSHKey with the specified id
func (c *Client) DeleteSSHKey(ctx context.Context, keyID int) error {
- e := fmt.Sprintf("profile/sshkeys/%d", keyID)
- _, err := coupleAPIErrors(c.R(ctx).Delete(e))
+ e := formatAPIPath("profile/sshkeys/%d", keyID)
+ err := doDELETERequest(ctx, c, e)
return err
}
diff --git a/vendor/github.com/linode/linodego/profile_tfa.go b/vendor/github.com/linode/linodego/profile_tfa.go
index 715f4b36..a187a046 100644
--- a/vendor/github.com/linode/linodego/profile_tfa.go
+++ b/vendor/github.com/linode/linodego/profile_tfa.go
@@ -46,35 +46,28 @@ func (s *TwoFactorSecret) UnmarshalJSON(b []byte) error {
// CreateTwoFactorSecret generates a Two Factor secret for your User.
func (c *Client) CreateTwoFactorSecret(ctx context.Context) (*TwoFactorSecret, error) {
e := "profile/tfa-enable"
- req := c.R(ctx).SetResult(&TwoFactorSecret{})
- r, err := coupleAPIErrors(req.Post(e))
+ response, err := doPOSTRequest[TwoFactorSecret, any](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*TwoFactorSecret), nil
+ return response, nil
}
// DisableTwoFactor disables Two Factor Authentication for your User.
func (c *Client) DisableTwoFactor(ctx context.Context) error {
e := "profile/tfa-disable"
- _, err := coupleAPIErrors(c.R(ctx).Post(e))
+ _, err := doPOSTRequest[TwoFactorSecret, any](ctx, c, e)
return err
}
// ConfirmTwoFactor confirms that you can successfully generate Two Factor codes and enables TFA on your Account.
func (c *Client) ConfirmTwoFactor(ctx context.Context, opts ConfirmTwoFactorOptions) (*ConfirmTwoFactorResponse, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
e := "profile/tfa-enable-confirm"
- req := c.R(ctx).SetResult(&ConfirmTwoFactorResponse{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Post(e))
+ response, err := doPOSTRequest[ConfirmTwoFactorResponse](ctx, c, e, opts)
if err != nil {
return nil, err
}
- return r.Result().(*ConfirmTwoFactorResponse), nil
+ return response, nil
}
diff --git a/vendor/github.com/linode/linodego/profile_tokens.go b/vendor/github.com/linode/linodego/profile_tokens.go
index a4f45cc0..ce8acd18 100644
--- a/vendor/github.com/linode/linodego/profile_tokens.go
+++ b/vendor/github.com/linode/linodego/profile_tokens.go
@@ -3,10 +3,8 @@ package linodego
import (
"context"
"encoding/json"
- "fmt"
"time"
- "github.com/go-resty/resty/v2"
"github.com/linode/linodego/internal/parseabletime"
)
@@ -16,7 +14,7 @@ type Token struct {
ID int `json:"id"`
// The scopes this token was created with. These define what parts of the Account the token can be used to access. Many command-line tools, such as the Linode CLI, require tokens with access to *. Tokens with more restrictive scopes are generally more secure.
- // Valid values are "*" or a comma separated list of scopes https://developers.linode.com/api/v4/#o-auth
+ // Valid values are "*" or a comma separated list of scopes https://techdocs.akamai.com/linode-api/reference/get-started#oauth-reference
Scopes string `json:"scopes"`
// This token's label. This is for display purposes only, but can be used to more easily track what you're using each token for. (1-100 Characters)
@@ -86,46 +84,25 @@ func (i Token) GetUpdateOptions() (o TokenUpdateOptions) {
return
}
-// TokensPagedResponse represents a paginated Token API response
-type TokensPagedResponse struct {
- *PageOptions
- Data []Token `json:"data"`
-}
-
-// endpoint gets the endpoint URL for Token
-func (TokensPagedResponse) endpoint(_ ...any) string {
- return "profile/tokens"
-}
-
-func (resp *TokensPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(TokensPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*TokensPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListTokens lists Tokens
func (c *Client) ListTokens(ctx context.Context, opts *ListOptions) ([]Token, error) {
- response := TokensPagedResponse{}
- err := c.listHelper(ctx, &response, opts)
+ response, err := getPaginatedResults[Token](ctx, c, "profile/tokens", opts)
if err != nil {
return nil, err
}
- return response.Data, nil
+
+ return response, nil
}
// GetToken gets the token with the provided ID
func (c *Client) GetToken(ctx context.Context, tokenID int) (*Token, error) {
- e := fmt.Sprintf("profile/tokens/%d", tokenID)
- req := c.R(ctx).SetResult(&Token{})
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("profile/tokens/%d", tokenID)
+ response, err := doGETRequest[Token](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*Token), nil
+
+ return response, nil
}
// CreateToken creates a Token
@@ -143,39 +120,29 @@ func (c *Client) CreateToken(ctx context.Context, opts TokenCreateOptions) (*Tok
createOptsFixed.Expiry = &iso8601Expiry
}
- body, err := json.Marshal(createOptsFixed)
- if err != nil {
- return nil, err
- }
-
e := "profile/tokens"
- req := c.R(ctx).SetResult(&Token{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Post(e))
+ response, err := doPOSTRequest[Token](ctx, c, e, createOptsFixed)
if err != nil {
return nil, err
}
- return r.Result().(*Token), nil
+
+ return response, nil
}
// UpdateToken updates the Token with the specified id
func (c *Client) UpdateToken(ctx context.Context, tokenID int, opts TokenUpdateOptions) (*Token, error) {
- body, err := json.Marshal(opts)
+ e := formatAPIPath("profile/tokens/%d", tokenID)
+ response, err := doPUTRequest[Token](ctx, c, e, opts)
if err != nil {
return nil, err
}
- e := fmt.Sprintf("profile/tokens/%d", tokenID)
- req := c.R(ctx).SetResult(&Token{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Put(e))
- if err != nil {
- return nil, err
- }
- return r.Result().(*Token), nil
+ return response, nil
}
// DeleteToken deletes the Token with the specified id
func (c *Client) DeleteToken(ctx context.Context, tokenID int) error {
- e := fmt.Sprintf("profile/tokens/%d", tokenID)
- _, err := coupleAPIErrors(c.R(ctx).Delete(e))
+ e := formatAPIPath("profile/tokens/%d", tokenID)
+ err := doDELETERequest(ctx, c, e)
return err
}
diff --git a/vendor/github.com/linode/linodego/regions.go b/vendor/github.com/linode/linodego/regions.go
index f4210383..908a4fa8 100644
--- a/vendor/github.com/linode/linodego/regions.go
+++ b/vendor/github.com/linode/linodego/regions.go
@@ -2,11 +2,40 @@ package linodego
import (
"context"
- "fmt"
- "net/url"
"time"
+)
- "github.com/go-resty/resty/v2"
+// This is an enumeration of Capabilities Linode offers that can be referenced
+// through the user-facing parts of the application.
+// Defined as strings rather than a custom type to avoid breaking change.
+// Can be changed in the potential v2 version.
+const (
+ CapabilityLinodes string = "Linodes"
+ CapabilityNodeBalancers string = "NodeBalancers"
+ CapabilityBlockStorage string = "Block Storage"
+ CapabilityObjectStorage string = "Object Storage"
+ CapabilityObjectStorageRegions string = "Object Storage Access Key Regions"
+ CapabilityLKE string = "Kubernetes"
+ CapabilityLkeHaControlPlanes string = "LKE HA Control Planes"
+ CapabilityCloudFirewall string = "Cloud Firewall"
+ CapabilityGPU string = "GPU Linodes"
+ CapabilityVlans string = "Vlans"
+ CapabilityVPCs string = "VPCs"
+ CapabilityVPCsExtra string = "VPCs Extra"
+ CapabilityMachineImages string = "Machine Images"
+ CapabilityBareMetal string = "Bare Metal"
+ CapabilityDBAAS string = "Managed Databases"
+ CapabilityBlockStorageMigrations string = "Block Storage Migrations"
+ CapabilityMetadata string = "Metadata"
+ CapabilityPremiumPlans string = "Premium Plans"
+ CapabilityEdgePlans string = "Edge Plans"
+ CapabilityLKEControlPlaneACL string = "LKE Network Access Control List (IP ACL)"
+ CapabilityACLB string = "Akamai Cloud Load Balancer"
+ CapabilitySupportTicketSeverity string = "Support Ticket Severity"
+ CapabilityBackups string = "Backups"
+ CapabilityPlacementGroup string = "Placement Group"
+ CapabilityDiskEncryption string = "Disk Encryption"
+ CapabilityBlockStorageEncryption string = "Block Storage Encryption"
)
// Region-related endpoints have a custom expiry time as the
@@ -15,12 +44,18 @@ var cacheExpiryTime = time.Minute
// Region represents a linode region object
type Region struct {
- ID string `json:"id"`
- Country string `json:"country"`
- Capabilities []string `json:"capabilities"`
- Status string `json:"status"`
- Resolvers RegionResolvers `json:"resolvers"`
- Label string `json:"label"`
+ ID string `json:"id"`
+ Country string `json:"country"`
+
+ // A List of enums from the above constants
+ Capabilities []string `json:"capabilities"`
+
+ Status string `json:"status"`
+ Label string `json:"label"`
+ SiteType string `json:"site_type"`
+
+ Resolvers RegionResolvers `json:"resolvers"`
+ PlacementGroupLimits *RegionPlacementGroupLimits `json:"placement_group_limits"`
}
// RegionResolvers contains the DNS resolvers of a region
@@ -29,32 +64,16 @@ type RegionResolvers struct {
IPv6 string `json:"ipv6"`
}
-// RegionsPagedResponse represents a linode API response for listing
-type RegionsPagedResponse struct {
- *PageOptions
- Data []Region `json:"data"`
-}
-
-// endpoint gets the endpoint URL for Region
-func (RegionsPagedResponse) endpoint(_ ...any) string {
- return "regions"
-}
-
-func (resp *RegionsPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(RegionsPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*RegionsPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
+// RegionPlacementGroupLimits contains information about the
+// placement group limits for the current user in the current region.
+type RegionPlacementGroupLimits struct {
+ MaximumPGsPerCustomer int `json:"maximum_pgs_per_customer"`
+ MaximumLinodesPerPG int `json:"maximum_linodes_per_pg"`
}
// ListRegions lists Regions. This endpoint is cached by default.
func (c *Client) ListRegions(ctx context.Context, opts *ListOptions) ([]Region, error) {
- response := RegionsPagedResponse{}
-
- endpoint, err := generateListCacheURL(response.endpoint(), opts)
+ endpoint, err := generateListCacheURL("regions", opts)
if err != nil {
return nil, err
}
@@ -63,32 +82,31 @@ func (c *Client) ListRegions(ctx context.Context, opts *ListOptions) ([]Region,
return result.([]Region), nil
}
- err = c.listHelper(ctx, &response, opts)
+ response, err := getPaginatedResults[Region](ctx, c, "regions", opts)
if err != nil {
return nil, err
}
- c.addCachedResponse(endpoint, response.Data, &cacheExpiryTime)
+ c.addCachedResponse(endpoint, response, &cacheExpiryTime)
- return response.Data, nil
+ return response, nil
}
// GetRegion gets the template with the provided ID. This endpoint is cached by default.
func (c *Client) GetRegion(ctx context.Context, regionID string) (*Region, error) {
- e := fmt.Sprintf("regions/%s", url.PathEscape(regionID))
+ e := formatAPIPath("regions/%s", regionID)
if result := c.getCachedResponse(e); result != nil {
result := result.(Region)
return &result, nil
}
- req := c.R(ctx).SetResult(&Region{})
- r, err := coupleAPIErrors(req.Get(e))
+ response, err := doGETRequest[Region](ctx, c, e)
if err != nil {
return nil, err
}
- c.addCachedResponse(e, r.Result(), &cacheExpiryTime)
+ c.addCachedResponse(e, response, &cacheExpiryTime)
- return r.Result().(*Region), nil
+ return response, nil
}
diff --git a/vendor/github.com/linode/linodego/regions_availability.go b/vendor/github.com/linode/linodego/regions_availability.go
index d4510dd3..4caefeb7 100644
--- a/vendor/github.com/linode/linodego/regions_availability.go
+++ b/vendor/github.com/linode/linodego/regions_availability.go
@@ -2,10 +2,6 @@ package linodego
import (
"context"
- "fmt"
- "net/url"
-
- "github.com/go-resty/resty/v2"
)
// Region represents a linode region object
@@ -15,32 +11,11 @@ type RegionAvailability struct {
Available bool `json:"available"`
}
-// RegionsAvailabilityPagedResponse represents a linode API response for listing
-type RegionsAvailabilityPagedResponse struct {
- *PageOptions
- Data []RegionAvailability `json:"data"`
-}
-
-// endpoint gets the endpoint URL for Region
-func (RegionsAvailabilityPagedResponse) endpoint(_ ...any) string {
- return "regions/availability"
-}
-
-func (resp *RegionsAvailabilityPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(RegionsAvailabilityPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*RegionsAvailabilityPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListRegionsAvailability lists Regions. This endpoint is cached by default.
func (c *Client) ListRegionsAvailability(ctx context.Context, opts *ListOptions) ([]RegionAvailability, error) {
- response := RegionsAvailabilityPagedResponse{}
+ e := "regions/availability"
- endpoint, err := generateListCacheURL(response.endpoint(), opts)
+ endpoint, err := generateListCacheURL(e, opts)
if err != nil {
return nil, err
}
@@ -49,32 +24,31 @@ func (c *Client) ListRegionsAvailability(ctx context.Context, opts *ListOptions)
return result.([]RegionAvailability), nil
}
- err = c.listHelper(ctx, &response, opts)
+ response, err := getPaginatedResults[RegionAvailability](ctx, c, e, opts)
if err != nil {
return nil, err
}
- c.addCachedResponse(endpoint, response.Data, &cacheExpiryTime)
+ c.addCachedResponse(endpoint, response, &cacheExpiryTime)
- return response.Data, nil
+ return response, nil
}
// GetRegionAvailability gets the template with the provided ID. This endpoint is cached by default.
func (c *Client) GetRegionAvailability(ctx context.Context, regionID string) (*RegionAvailability, error) {
- e := fmt.Sprintf("regions/%s/availability", url.PathEscape(regionID))
+ e := formatAPIPath("regions/%s/availability", regionID)
if result := c.getCachedResponse(e); result != nil {
result := result.(RegionAvailability)
return &result, nil
}
- req := c.R(ctx).SetResult(&RegionAvailability{})
- r, err := coupleAPIErrors(req.Get(e))
+ response, err := doGETRequest[RegionAvailability](ctx, c, e)
if err != nil {
return nil, err
}
- c.addCachedResponse(e, r.Result(), &cacheExpiryTime)
+ c.addCachedResponse(e, response, &cacheExpiryTime)
- return r.Result().(*RegionAvailability), nil
+ return response, nil
}
diff --git a/vendor/github.com/linode/linodego/request_helpers.go b/vendor/github.com/linode/linodego/request_helpers.go
new file mode 100644
index 00000000..152a2643
--- /dev/null
+++ b/vendor/github.com/linode/linodego/request_helpers.go
@@ -0,0 +1,220 @@
+package linodego
+
+import (
+ "context"
+ "encoding/json"
+ "fmt"
+ "net/url"
+ "reflect"
+)
+
+// paginatedResponse represents a single response from a paginated
+// endpoint.
+type paginatedResponse[T any] struct {
+ Page int `json:"page" url:"page,omitempty"`
+ Pages int `json:"pages" url:"pages,omitempty"`
+ Results int `json:"results" url:"results,omitempty"`
+ Data []T `json:"data"`
+}
+
+// getPaginatedResults aggregates results from the given
+// paginated endpoint using the provided ListOptions.
+// nolint:funlen
+func getPaginatedResults[T any](
+ ctx context.Context,
+ client *Client,
+ endpoint string,
+ opts *ListOptions,
+) ([]T, error) {
+ var resultType paginatedResponse[T]
+
+ result := make([]T, 0)
+
+ if opts == nil {
+ opts = &ListOptions{PageOptions: &PageOptions{Page: 0}}
+ }
+
+ if opts.PageOptions == nil {
+ opts.PageOptions = &PageOptions{Page: 0}
+ }
+
+ // Makes a request to a particular page and
+ // appends the response to the result
+ handlePage := func(page int) error {
+ // Override the page to be applied in applyListOptionsToRequest(...)
+ opts.Page = page
+
+ // This request object cannot be reused for each page request
+ // because it can lead to possible data corruption
+ req := client.R(ctx).SetResult(resultType)
+
+ // Apply all user-provided list options to the request
+ if err := applyListOptionsToRequest(opts, req); err != nil {
+ return err
+ }
+
+ res, err := coupleAPIErrors(req.Get(endpoint))
+ if err != nil {
+ return err
+ }
+
+ response := res.Result().(*paginatedResponse[T])
+
+ opts.Page = page
+ opts.Pages = response.Pages
+ opts.Results = response.Results
+
+ result = append(result, response.Data...)
+ return nil
+ }
+
+ // This helps simplify the logic below
+ startingPage := 1
+ pageDefined := opts.Page > 0
+
+ if pageDefined {
+ startingPage = opts.Page
+ }
+
+ // Get the first page
+ if err := handlePage(startingPage); err != nil {
+ return nil, err
+ }
+
+ // If the user has explicitly specified a page, we don't
+ // need to get any other pages.
+ if pageDefined {
+ return result, nil
+ }
+
+ // Get the rest of the pages
+ for page := 2; page <= opts.Pages; page++ {
+ if err := handlePage(page); err != nil {
+ return nil, err
+ }
+ }
+
+ return result, nil
+}
+
+// doGETRequest runs a GET request using the given client and API endpoint,
+// and returns the result
+func doGETRequest[T any](
+ ctx context.Context,
+ client *Client,
+ endpoint string,
+) (*T, error) {
+ var resultType T
+
+ req := client.R(ctx).SetResult(&resultType)
+ r, err := coupleAPIErrors(req.Get(endpoint))
+ if err != nil {
+ return nil, err
+ }
+
+ return r.Result().(*T), nil
+}
+
+// doPOSTRequest runs a PUT request using the given client, API endpoint,
+// and options/body.
+func doPOSTRequest[T, O any](
+ ctx context.Context,
+ client *Client,
+ endpoint string,
+ options ...O,
+) (*T, error) {
+ var resultType T
+
+ numOpts := len(options)
+
+ if numOpts > 1 {
+ return nil, fmt.Errorf("invalid number of options: %d", len(options))
+ }
+
+ req := client.R(ctx).SetResult(&resultType)
+
+ if numOpts > 0 && !isNil(options[0]) {
+ body, err := json.Marshal(options[0])
+ if err != nil {
+ return nil, err
+ }
+ req.SetBody(string(body))
+ }
+
+ r, err := coupleAPIErrors(req.Post(endpoint))
+ if err != nil {
+ return nil, err
+ }
+
+ return r.Result().(*T), nil
+}
+
+// doPUTRequest runs a PUT request using the given client, API endpoint,
+// and options/body.
+func doPUTRequest[T, O any](
+ ctx context.Context,
+ client *Client,
+ endpoint string,
+ options ...O,
+) (*T, error) {
+ var resultType T
+
+ numOpts := len(options)
+
+ if numOpts > 1 {
+ return nil, fmt.Errorf("invalid number of options: %d", len(options))
+ }
+
+ req := client.R(ctx).SetResult(&resultType)
+
+ if numOpts > 0 && !isNil(options[0]) {
+ body, err := json.Marshal(options[0])
+ if err != nil {
+ return nil, err
+ }
+ req.SetBody(string(body))
+ }
+
+ r, err := coupleAPIErrors(req.Put(endpoint))
+ if err != nil {
+ return nil, err
+ }
+
+ return r.Result().(*T), nil
+}
+
+// doDELETERequest runs a DELETE request using the given client
+// and API endpoint.
+func doDELETERequest(
+ ctx context.Context,
+ client *Client,
+ endpoint string,
+) error {
+ req := client.R(ctx)
+ _, err := coupleAPIErrors(req.Delete(endpoint))
+ return err
+}
+
+// formatAPIPath allows us to safely build an API request with path escaping
+func formatAPIPath(format string, args ...any) string {
+ escapedArgs := make([]any, len(args))
+ for i, arg := range args {
+ if typeStr, ok := arg.(string); ok {
+ arg = url.PathEscape(typeStr)
+ }
+
+ escapedArgs[i] = arg
+ }
+
+ return fmt.Sprintf(format, escapedArgs...)
+}
+
+func isNil(i interface{}) bool {
+ if i == nil {
+ return true
+ }
+
+ // Check for nil pointers
+ v := reflect.ValueOf(i)
+ return v.Kind() == reflect.Ptr && v.IsNil()
+}
diff --git a/vendor/github.com/linode/linodego/retries.go b/vendor/github.com/linode/linodego/retries.go
index 1474242e..14886442 100644
--- a/vendor/github.com/linode/linodego/retries.go
+++ b/vendor/github.com/linode/linodego/retries.go
@@ -14,6 +14,8 @@ import (
const (
retryAfterHeaderName = "Retry-After"
maintenanceModeHeaderName = "X-Maintenance-Mode"
+
+ defaultRetryCount = 1000
)
// type RetryConditional func(r *resty.Response) (shouldRetry bool)
@@ -27,7 +29,7 @@ type RetryAfter resty.RetryAfterFunc
// If the Retry-After header is not set, we fall back to value of SetPollDelay.
func configureRetries(c *Client) {
c.resty.
- SetRetryCount(1000).
+ SetRetryCount(defaultRetryCount).
AddRetryCondition(checkRetryConditionals(c)).
SetRetryAfter(respectRetryAfter)
}
diff --git a/vendor/github.com/linode/linodego/retries_http.go b/vendor/github.com/linode/linodego/retries_http.go
new file mode 100644
index 00000000..0439af48
--- /dev/null
+++ b/vendor/github.com/linode/linodego/retries_http.go
@@ -0,0 +1,127 @@
+package linodego
+
+import (
+ "encoding/json"
+ "errors"
+ "log"
+ "net/http"
+ "strconv"
+ "time"
+
+ "golang.org/x/net/http2"
+)
+
+const (
+ // nolint:unused
+ httpRetryAfterHeaderName = "Retry-After"
+ // nolint:unused
+ httpMaintenanceModeHeaderName = "X-Maintenance-Mode"
+
+ // nolint:unused
+ httpDefaultRetryCount = 1000
+)
+
+// RetryConditional is a type alias for a function that determines if a request should be retried based on the response and error.
+// nolint:unused
+type httpRetryConditional func(*http.Response, error) bool
+
+// RetryAfter is a type alias for a function that determines the duration to wait before retrying based on the response.
+// nolint:unused
+type httpRetryAfter func(*http.Response) (time.Duration, error)
+
+// Configures http.Client to lock until enough time has passed to retry the request as determined by the Retry-After response header.
+// If the Retry-After header is not set, we fall back to the value of SetPollDelay.
+// nolint:unused
+func httpConfigureRetries(c *httpClient) {
+ c.retryConditionals = append(c.retryConditionals, httpcheckRetryConditionals(c))
+ c.retryAfter = httpRespectRetryAfter
+}
+
+// nolint:unused
+func httpcheckRetryConditionals(c *httpClient) httpRetryConditional {
+ return func(resp *http.Response, err error) bool {
+ for _, retryConditional := range c.retryConditionals {
+ retry := retryConditional(resp, err)
+ if retry {
+ log.Printf("[INFO] Received error %v - Retrying", err)
+ return true
+ }
+ }
+ return false
+ }
+}
+
+// nolint:unused
+func httpRespectRetryAfter(resp *http.Response) (time.Duration, error) {
+ retryAfterStr := resp.Header.Get(retryAfterHeaderName)
+ if retryAfterStr == "" {
+ return 0, nil
+ }
+
+ retryAfter, err := strconv.Atoi(retryAfterStr)
+ if err != nil {
+ return 0, err
+ }
+
+ duration := time.Duration(retryAfter) * time.Second
+ log.Printf("[INFO] Respecting Retry-After Header of %d (%s)", retryAfter, duration)
+ return duration, nil
+}
+
+// Retry conditions
+
+// nolint:unused
+func httpLinodeBusyRetryCondition(resp *http.Response, _ error) bool {
+ apiError, ok := getAPIError(resp)
+ linodeBusy := ok && apiError.Error() == "Linode busy."
+ retry := resp.StatusCode == http.StatusBadRequest && linodeBusy
+ return retry
+}
+
+// nolint:unused
+func httpTooManyRequestsRetryCondition(resp *http.Response, _ error) bool {
+ return resp.StatusCode == http.StatusTooManyRequests
+}
+
+// nolint:unused
+func httpServiceUnavailableRetryCondition(resp *http.Response, _ error) bool {
+ serviceUnavailable := resp.StatusCode == http.StatusServiceUnavailable
+
+ // During maintenance events, the API will return a 503 and add
+ // an `X-MAINTENANCE-MODE` header. Don't retry during maintenance
+ // events, only for legitimate 503s.
+ if serviceUnavailable && resp.Header.Get(maintenanceModeHeaderName) != "" {
+ log.Printf("[INFO] Linode API is under maintenance, request will not be retried - please see status.linode.com for more information")
+ return false
+ }
+
+ return serviceUnavailable
+}
+
+// nolint:unused
+func httpRequestTimeoutRetryCondition(resp *http.Response, _ error) bool {
+ return resp.StatusCode == http.StatusRequestTimeout
+}
+
+// nolint:unused
+func httpRequestGOAWAYRetryCondition(_ *http.Response, err error) bool {
+ return errors.As(err, &http2.GoAwayError{})
+}
+
+// nolint:unused
+func httpRequestNGINXRetryCondition(resp *http.Response, _ error) bool {
+ return resp.StatusCode == http.StatusBadRequest &&
+ resp.Header.Get("Server") == "nginx" &&
+ resp.Header.Get("Content-Type") == "text/html"
+}
+
+// Helper function to extract APIError from response
+// nolint:unused
+func getAPIError(resp *http.Response) (*APIError, bool) {
+ var apiError APIError
+ err := json.NewDecoder(resp.Body).Decode(&apiError)
+ if err != nil {
+ return nil, false
+ }
+ return &apiError, true
+}
diff --git a/vendor/github.com/linode/linodego/stackscripts.go b/vendor/github.com/linode/linodego/stackscripts.go
index 5d67128d..3f290b07 100644
--- a/vendor/github.com/linode/linodego/stackscripts.go
+++ b/vendor/github.com/linode/linodego/stackscripts.go
@@ -3,10 +3,8 @@ package linodego
import (
"context"
"encoding/json"
- "fmt"
"time"
- "github.com/go-resty/resty/v2"
"github.com/linode/linodego/internal/parseabletime"
)
@@ -111,83 +109,36 @@ func (i Stackscript) GetUpdateOptions() StackscriptUpdateOptions {
}
}
-// StackscriptsPagedResponse represents a paginated Stackscript API response
-type StackscriptsPagedResponse struct {
- *PageOptions
- Data []Stackscript `json:"data"`
-}
-
-// endpoint gets the endpoint URL for Stackscript
-func (StackscriptsPagedResponse) endpoint(_ ...any) string {
- return "linode/stackscripts"
-}
-
-func (resp *StackscriptsPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(StackscriptsPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*StackscriptsPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListStackscripts lists Stackscripts
func (c *Client) ListStackscripts(ctx context.Context, opts *ListOptions) ([]Stackscript, error) {
- response := StackscriptsPagedResponse{}
- err := c.listHelper(ctx, &response, opts)
- if err != nil {
- return nil, err
- }
- return response.Data, nil
+ response, err := getPaginatedResults[Stackscript](ctx, c, "linode/stackscripts", opts)
+ return response, err
}
// GetStackscript gets the Stackscript with the provided ID
func (c *Client) GetStackscript(ctx context.Context, scriptID int) (*Stackscript, error) {
- e := fmt.Sprintf("linode/stackscripts/%d", scriptID)
- req := c.R(ctx).SetResult(&Stackscript{})
- r, err := coupleAPIErrors(req.Get(e))
- if err != nil {
- return nil, err
- }
- return r.Result().(*Stackscript), nil
+ e := formatAPIPath("linode/stackscripts/%d", scriptID)
+ response, err := doGETRequest[Stackscript](ctx, c, e)
+ return response, err
}
// CreateStackscript creates a StackScript
func (c *Client) CreateStackscript(ctx context.Context, opts StackscriptCreateOptions) (*Stackscript, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
e := "linode/stackscripts"
- req := c.R(ctx).SetResult(&Stackscript{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Post(e))
- if err != nil {
- return nil, err
- }
- return r.Result().(*Stackscript), nil
+ response, err := doPOSTRequest[Stackscript](ctx, c, e, opts)
+ return response, err
}
// UpdateStackscript updates the StackScript with the specified id
func (c *Client) UpdateStackscript(ctx context.Context, scriptID int, opts StackscriptUpdateOptions) (*Stackscript, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
- req := c.R(ctx).SetResult(&Stackscript{}).SetBody(string(body))
- e := fmt.Sprintf("linode/stackscripts/%d", scriptID)
- r, err := coupleAPIErrors(req.Put(e))
- if err != nil {
- return nil, err
- }
- return r.Result().(*Stackscript), nil
+ e := formatAPIPath("linode/stackscripts/%d", scriptID)
+ response, err := doPUTRequest[Stackscript](ctx, c, e, opts)
+ return response, err
}
// DeleteStackscript deletes the StackScript with the specified id
func (c *Client) DeleteStackscript(ctx context.Context, scriptID int) error {
- e := fmt.Sprintf("linode/stackscripts/%d", scriptID)
- _, err := coupleAPIErrors(c.R(ctx).Delete(e))
+ e := formatAPIPath("linode/stackscripts/%d", scriptID)
+ err := doDELETERequest(ctx, c, e)
return err
}
diff --git a/vendor/github.com/linode/linodego/support.go b/vendor/github.com/linode/linodego/support.go
index 7e7e54a5..2fb2d7b2 100644
--- a/vendor/github.com/linode/linodego/support.go
+++ b/vendor/github.com/linode/linodego/support.go
@@ -2,10 +2,7 @@ package linodego
import (
"context"
- "fmt"
"time"
-
- "github.com/go-resty/resty/v2"
)
// Ticket represents a support ticket object
@@ -22,6 +19,7 @@ type Ticket struct {
Summary string `json:"summary"`
Updated *time.Time `json:"-"`
UpdatedBy string `json:"updated_by"`
+ Closeable bool `json:"closeable"`
}
// TicketEntity refers a ticket to a specific entity
@@ -42,46 +40,18 @@ const (
TicketOpen TicketStatus = "open"
)
-// TicketsPagedResponse represents a paginated ticket API response
-type TicketsPagedResponse struct {
- *PageOptions
- Data []Ticket `json:"data"`
-}
-
-func (TicketsPagedResponse) endpoint(_ ...any) string {
- return "support/tickets"
-}
-
-func (resp *TicketsPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(TicketsPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*TicketsPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListTickets returns a collection of Support Tickets on the Account. Support Tickets
// can be both tickets opened with Linode for support, as well as tickets generated by
// Linode regarding the Account. This collection includes all Support Tickets generated
// on the Account, with open tickets returned first.
func (c *Client) ListTickets(ctx context.Context, opts *ListOptions) ([]Ticket, error) {
- response := TicketsPagedResponse{}
- err := c.listHelper(ctx, &response, opts)
- if err != nil {
- return nil, err
- }
- return response.Data, nil
+ response, err := getPaginatedResults[Ticket](ctx, c, "support/tickets", opts)
+ return response, err
}
// GetTicket gets a Support Ticket on the Account with the specified ID
func (c *Client) GetTicket(ctx context.Context, ticketID int) (*Ticket, error) {
- e := fmt.Sprintf("support/tickets/%d", ticketID)
- req := c.R(ctx).SetResult(&Ticket{})
- r, err := coupleAPIErrors(req.Get(e))
- if err != nil {
- return nil, err
- }
- return r.Result().(*Ticket), nil
+ e := formatAPIPath("support/tickets/%d", ticketID)
+ response, err := doGETRequest[Ticket](ctx, c, e)
+ return response, err
}
diff --git a/vendor/github.com/linode/linodego/tags.go b/vendor/github.com/linode/linodego/tags.go
index f22208ec..9d8d9eb6 100644
--- a/vendor/github.com/linode/linodego/tags.go
+++ b/vendor/github.com/linode/linodego/tags.go
@@ -4,10 +4,6 @@ import (
"context"
"encoding/json"
"errors"
- "fmt"
- "net/url"
-
- "github.com/go-resty/resty/v2"
)
// Tag represents a Tag object
@@ -54,57 +50,10 @@ func (i Tag) GetCreateOptions() (o TagCreateOptions) {
return
}
-// TagsPagedResponse represents a paginated Tag API response
-type TagsPagedResponse struct {
- *PageOptions
- Data []Tag `json:"data"`
-}
-
-// endpoint gets the endpoint URL for Tag
-func (TagsPagedResponse) endpoint(_ ...any) string {
- return "tags"
-}
-
-func (resp *TagsPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(TagsPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*TagsPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
-// TaggedObjectsPagedResponse represents a paginated Tag API response
-type TaggedObjectsPagedResponse struct {
- *PageOptions
- Data []TaggedObject `json:"data"`
-}
-
-// endpoint gets the endpoint URL for Tag
-func (TaggedObjectsPagedResponse) endpoint(ids ...any) string {
- id := url.PathEscape(ids[0].(string))
- return fmt.Sprintf("tags/%s", id)
-}
-
-func (resp *TaggedObjectsPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(TaggedObjectsPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*TaggedObjectsPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListTags lists Tags
func (c *Client) ListTags(ctx context.Context, opts *ListOptions) ([]Tag, error) {
- response := TagsPagedResponse{}
- err := c.listHelper(ctx, &response, opts)
- if err != nil {
- return nil, err
- }
- return response.Data, nil
+ response, err := getPaginatedResults[Tag](ctx, c, "tags", opts)
+ return response, err
}
// fixData stores an object of the type defined by Type in Data using RawData
@@ -147,19 +96,17 @@ func (i *TaggedObject) fixData() (*TaggedObject, error) {
// ListTaggedObjects lists Tagged Objects
func (c *Client) ListTaggedObjects(ctx context.Context, label string, opts *ListOptions) (TaggedObjectList, error) {
- response := TaggedObjectsPagedResponse{}
- label = url.PathEscape(label)
- err := c.listHelper(ctx, &response, opts, label)
+ response, err := getPaginatedResults[TaggedObject](ctx, c, formatAPIPath("tags/%s", label), opts)
if err != nil {
return nil, err
}
- for i := range response.Data {
- if _, err := response.Data[i].fixData(); err != nil {
+ for i := range response {
+ if _, err := response[i].fixData(); err != nil {
return nil, err
}
}
- return response.Data, nil
+ return response, nil
}
// SortedObjects converts a list of TaggedObjects into a Sorted Objects struct, for easier access
@@ -205,24 +152,14 @@ func (t TaggedObjectList) SortedObjects() (SortedObjects, error) {
// CreateTag creates a Tag
func (c *Client) CreateTag(ctx context.Context, opts TagCreateOptions) (*Tag, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
e := "tags"
- req := c.R(ctx).SetResult(&Tag{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Post(e))
- if err != nil {
- return nil, err
- }
- return r.Result().(*Tag), nil
+ response, err := doPOSTRequest[Tag](ctx, c, e, opts)
+ return response, err
}
// DeleteTag deletes the Tag with the specified id
func (c *Client) DeleteTag(ctx context.Context, label string) error {
- label = url.PathEscape(label)
- e := fmt.Sprintf("tags/%s", label)
- _, err := coupleAPIErrors(c.R(ctx).Delete(e))
+ e := formatAPIPath("tags/%s", label)
+ err := doDELETERequest(ctx, c, e)
return err
}
diff --git a/vendor/github.com/linode/linodego/types.go b/vendor/github.com/linode/linodego/types.go
index 1d834136..bd9b801c 100644
--- a/vendor/github.com/linode/linodego/types.go
+++ b/vendor/github.com/linode/linodego/types.go
@@ -2,10 +2,7 @@ package linodego
import (
"context"
- "fmt"
"net/url"
-
- "github.com/go-resty/resty/v2"
)
// LinodeType represents a linode type object
@@ -62,31 +59,11 @@ const (
ClassGPU LinodeTypeClass = "gpu"
)
-// LinodeTypesPagedResponse represents a linode types API response for listing
-type LinodeTypesPagedResponse struct {
- *PageOptions
- Data []LinodeType `json:"data"`
-}
-
-func (*LinodeTypesPagedResponse) endpoint(_ ...any) string {
- return "linode/types"
-}
-
-func (resp *LinodeTypesPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(LinodeTypesPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*LinodeTypesPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListTypes lists linode types. This endpoint is cached by default.
func (c *Client) ListTypes(ctx context.Context, opts *ListOptions) ([]LinodeType, error) {
- response := LinodeTypesPagedResponse{}
+ e := "linode/types"
- endpoint, err := generateListCacheURL(response.endpoint(), opts)
+ endpoint, err := generateListCacheURL(e, opts)
if err != nil {
return nil, err
}
@@ -95,32 +72,31 @@ func (c *Client) ListTypes(ctx context.Context, opts *ListOptions) ([]LinodeType
return result.([]LinodeType), nil
}
- err = c.listHelper(ctx, &response, opts)
+ response, err := getPaginatedResults[LinodeType](ctx, c, e, opts)
if err != nil {
return nil, err
}
- c.addCachedResponse(endpoint, response.Data, &cacheExpiryTime)
+ c.addCachedResponse(endpoint, response, &cacheExpiryTime)
- return response.Data, nil
+ return response, nil
}
// GetType gets the type with the provided ID. This endpoint is cached by default.
func (c *Client) GetType(ctx context.Context, typeID string) (*LinodeType, error) {
- e := fmt.Sprintf("linode/types/%s", url.PathEscape(typeID))
+ e := formatAPIPath("linode/types/%s", url.PathEscape(typeID))
if result := c.getCachedResponse(e); result != nil {
result := result.(LinodeType)
return &result, nil
}
- req := c.R(ctx).SetResult(LinodeType{})
- r, err := coupleAPIErrors(req.Get(e))
+ response, err := doGETRequest[LinodeType](ctx, c, e)
if err != nil {
return nil, err
}
- c.addCachedResponse(e, r.Result(), &cacheExpiryTime)
+ c.addCachedResponse(e, response, &cacheExpiryTime)
- return r.Result().(*LinodeType), nil
+ return response, nil
}
diff --git a/vendor/github.com/linode/linodego/vlans.go b/vendor/github.com/linode/linodego/vlans.go
index 7f6433b0..14732637 100644
--- a/vendor/github.com/linode/linodego/vlans.go
+++ b/vendor/github.com/linode/linodego/vlans.go
@@ -6,7 +6,6 @@ import (
"fmt"
"time"
- "github.com/go-resty/resty/v2"
"github.com/linode/linodego/internal/parseabletime"
)
@@ -36,36 +35,10 @@ func (v *VLAN) UnmarshalJSON(b []byte) error {
return nil
}
-// VLANsPagedResponse represents a Linode API response for listing of VLANs
-type VLANsPagedResponse struct {
- *PageOptions
- Data []VLAN `json:"data"`
-}
-
-func (VLANsPagedResponse) endpoint(_ ...any) string {
- return "networking/vlans"
-}
-
-func (resp *VLANsPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(VLANsPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*VLANsPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListVLANs returns a paginated list of VLANs
func (c *Client) ListVLANs(ctx context.Context, opts *ListOptions) ([]VLAN, error) {
- response := VLANsPagedResponse{}
-
- err := c.listHelper(ctx, &response, opts)
- if err != nil {
- return nil, err
- }
-
- return response.Data, nil
+ response, err := getPaginatedResults[VLAN](ctx, c, "networking/vlans", opts)
+ return response, err
}
// GetVLANIPAMAddress returns the IPAM Address for a given VLAN Label as a string (10.0.0.1/24)
diff --git a/vendor/github.com/linode/linodego/volumes.go b/vendor/github.com/linode/linodego/volumes.go
index b832cfb2..684e718a 100644
--- a/vendor/github.com/linode/linodego/volumes.go
+++ b/vendor/github.com/linode/linodego/volumes.go
@@ -3,10 +3,8 @@ package linodego
import (
"context"
"encoding/json"
- "fmt"
"time"
- "github.com/go-resty/resty/v2"
"github.com/linode/linodego/internal/parseabletime"
)
@@ -39,6 +37,9 @@ type Volume struct {
Tags []string `json:"tags"`
Created *time.Time `json:"-"`
Updated *time.Time `json:"-"`
+
+ // Note: Block Storage Disk Encryption is not currently available to all users.
+ Encryption string `json:"encryption"`
}
// VolumeCreateOptions fields are those accepted by CreateVolume
@@ -52,6 +53,7 @@ type VolumeCreateOptions struct {
// An array of tags applied to this object. Tags are for organizational purposes only.
Tags []string `json:"tags"`
PersistAcrossBoots *bool `json:"persist_across_boots,omitempty"`
+ Encryption string `json:"encryption,omitempty"`
}
// VolumeUpdateOptions fields are those accepted by UpdateVolume
@@ -67,12 +69,6 @@ type VolumeAttachOptions struct {
PersistAcrossBoots *bool `json:"persist_across_boots,omitempty"`
}
-// VolumesPagedResponse represents a linode API response for listing of volumes
-type VolumesPagedResponse struct {
- *PageOptions
- Data []Volume `json:"data"`
-}
-
// UnmarshalJSON implements the json.Unmarshaler interface
func (v *Volume) UnmarshalJSON(b []byte) error {
type Mask Volume
@@ -114,125 +110,72 @@ func (v Volume) GetCreateOptions() (createOpts VolumeCreateOptions) {
return
}
-// endpoint gets the endpoint URL for Volume
-func (VolumesPagedResponse) endpoint(_ ...any) string {
- return "volumes"
-}
-
-func (resp *VolumesPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(VolumesPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*VolumesPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListVolumes lists Volumes
func (c *Client) ListVolumes(ctx context.Context, opts *ListOptions) ([]Volume, error) {
- response := VolumesPagedResponse{}
- err := c.listHelper(ctx, &response, opts)
- if err != nil {
- return nil, err
- }
- return response.Data, nil
+ response, err := getPaginatedResults[Volume](ctx, c, "volumes", opts)
+ return response, err
}
// GetVolume gets the template with the provided ID
func (c *Client) GetVolume(ctx context.Context, volumeID int) (*Volume, error) {
- e := fmt.Sprintf("volumes/%d", volumeID)
- req := c.R(ctx).SetResult(&Volume{})
- r, err := coupleAPIErrors(req.Get(e))
- if err != nil {
- return nil, err
- }
- return r.Result().(*Volume), nil
+ e := formatAPIPath("volumes/%d", volumeID)
+ response, err := doGETRequest[Volume](ctx, c, e)
+ return response, err
}
// AttachVolume attaches a volume to a Linode instance
func (c *Client) AttachVolume(ctx context.Context, volumeID int, opts *VolumeAttachOptions) (*Volume, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
- e := fmt.Sprintf("volumes/%d/attach", volumeID)
- req := c.R(ctx).SetResult(&Volume{}).SetBody(string(body))
- resp, err := coupleAPIErrors(req.Post(e))
- if err != nil {
- return nil, err
- }
-
- return resp.Result().(*Volume), nil
+ e := formatAPIPath("volumes/%d/attach", volumeID)
+ response, err := doPOSTRequest[Volume](ctx, c, e, opts)
+ return response, err
}
// CreateVolume creates a Linode Volume
func (c *Client) CreateVolume(ctx context.Context, opts VolumeCreateOptions) (*Volume, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
e := "volumes"
- req := c.R(ctx).SetResult(&Volume{}).SetBody(string(body))
- resp, err := coupleAPIErrors(req.Post(e))
- if err != nil {
- return nil, err
- }
-
- return resp.Result().(*Volume), nil
+ response, err := doPOSTRequest[Volume](ctx, c, e, opts)
+ return response, err
}
// UpdateVolume updates the Volume with the specified id
func (c *Client) UpdateVolume(ctx context.Context, volumeID int, opts VolumeUpdateOptions) (*Volume, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, NewError(err)
- }
-
- e := fmt.Sprintf("volumes/%d", volumeID)
- req := c.R(ctx).SetResult(&Volume{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Put(e))
- if err != nil {
- return nil, err
- }
-
- return r.Result().(*Volume), nil
+ e := formatAPIPath("volumes/%d", volumeID)
+ response, err := doPUTRequest[Volume](ctx, c, e, opts)
+ return response, err
}
// CloneVolume clones a Linode volume
func (c *Client) CloneVolume(ctx context.Context, volumeID int, label string) (*Volume, error) {
- body := fmt.Sprintf("{\"label\":\"%s\"}", label)
- e := fmt.Sprintf("volumes/%d/clone", volumeID)
- req := c.R(ctx).SetResult(&Volume{}).SetBody(body)
- resp, err := coupleAPIErrors(req.Post(e))
- if err != nil {
- return nil, err
+ opts := map[string]any{
+ "label": label,
}
- return resp.Result().(*Volume), nil
+ e := formatAPIPath("volumes/%d/clone", volumeID)
+ response, err := doPOSTRequest[Volume](ctx, c, e, opts)
+ return response, err
}
// DetachVolume detaches a Linode volume
func (c *Client) DetachVolume(ctx context.Context, volumeID int) error {
- body := ""
- e := fmt.Sprintf("volumes/%d/detach", volumeID)
- _, err := coupleAPIErrors(c.R(ctx).SetBody(body).Post(e))
+ e := formatAPIPath("volumes/%d/detach", volumeID)
+ _, err := doPOSTRequest[Volume, any](ctx, c, e)
return err
}
// ResizeVolume resizes an instance to new Linode type
func (c *Client) ResizeVolume(ctx context.Context, volumeID int, size int) error {
- body := fmt.Sprintf("{\"size\": %d}", size)
- e := fmt.Sprintf("volumes/%d/resize", volumeID)
- _, err := coupleAPIErrors(c.R(ctx).SetBody(body).Post(e))
+ opts := map[string]int{
+ "size": size,
+ }
+
+ e := formatAPIPath("volumes/%d/resize", volumeID)
+ _, err := doPOSTRequest[Volume](ctx, c, e, opts)
return err
}
// DeleteVolume deletes the Volume with the specified id
func (c *Client) DeleteVolume(ctx context.Context, volumeID int) error {
- e := fmt.Sprintf("volumes/%d", volumeID)
- _, err := coupleAPIErrors(c.R(ctx).Delete(e))
+ e := formatAPIPath("volumes/%d", volumeID)
+ err := doDELETERequest(ctx, c, e)
return err
}
diff --git a/vendor/github.com/linode/linodego/volumes_types.go b/vendor/github.com/linode/linodego/volumes_types.go
new file mode 100644
index 00000000..887a3c5a
--- /dev/null
+++ b/vendor/github.com/linode/linodego/volumes_types.go
@@ -0,0 +1,45 @@
+package linodego
+
+import (
+ "context"
+)
+
+// VolumeType represents a single valid Volume type.
+type VolumeType struct {
+ baseType[VolumeTypePrice, VolumeTypeRegionPrice]
+}
+
+// VolumeTypePrice represents the base hourly and monthly prices
+// for a volume type entry.
+type VolumeTypePrice struct {
+ baseTypePrice
+}
+
+// VolumeTypeRegionPrice represents the regional hourly and monthly prices
+// for a volume type entry.
+type VolumeTypeRegionPrice struct {
+ baseTypeRegionPrice
+}
+
+// ListVolumeTypes lists Volume types. This endpoint is cached by default.
+func (c *Client) ListVolumeTypes(ctx context.Context, opts *ListOptions) ([]VolumeType, error) {
+ e := "volumes/types"
+
+ endpoint, err := generateListCacheURL(e, opts)
+ if err != nil {
+ return nil, err
+ }
+
+ if result := c.getCachedResponse(endpoint); result != nil {
+ return result.([]VolumeType), nil
+ }
+
+ response, err := getPaginatedResults[VolumeType](ctx, c, e, opts)
+ if err != nil {
+ return nil, err
+ }
+
+ c.addCachedResponse(endpoint, response, &cacheExpiryTime)
+
+ return response, nil
+}
diff --git a/vendor/github.com/linode/linodego/vpc.go b/vendor/github.com/linode/linodego/vpc.go
index eb5aa1c1..78537991 100644
--- a/vendor/github.com/linode/linodego/vpc.go
+++ b/vendor/github.com/linode/linodego/vpc.go
@@ -3,10 +3,8 @@ package linodego
import (
"context"
"encoding/json"
- "fmt"
"time"
- "github.com/go-resty/resty/v2"
"github.com/linode/linodego/internal/parseabletime"
)
@@ -32,25 +30,6 @@ type VPCUpdateOptions struct {
Description string `json:"description,omitempty"`
}
-type VPCsPagedResponse struct {
- *PageOptions
- Data []VPC `json:"data"`
-}
-
-func (VPCsPagedResponse) endpoint(_ ...any) string {
- return "vpcs"
-}
-
-func (resp *VPCsPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(VPCsPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*VPCsPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
func (v VPC) GetCreateOptions() VPCCreateOptions {
subnetCreations := make([]VPCSubnetCreateOptions, len(v.Subnets))
for i, s := range v.Subnets {
@@ -95,37 +74,20 @@ func (c *Client) CreateVPC(
ctx context.Context,
opts VPCCreateOptions,
) (*VPC, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
- req := c.R(ctx).SetResult(&VPC{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Post("vpcs"))
- if err != nil {
- return nil, err
- }
-
- return r.Result().(*VPC), nil
+ e := "vpcs"
+ response, err := doPOSTRequest[VPC](ctx, c, e, opts)
+ return response, err
}
func (c *Client) GetVPC(ctx context.Context, vpcID int) (*VPC, error) {
- e := fmt.Sprintf("/vpcs/%d", vpcID)
- req := c.R(ctx).SetResult(&VPC{})
- r, err := coupleAPIErrors(req.Get(e))
- if err != nil {
- return nil, err
- }
- return r.Result().(*VPC), nil
+ e := formatAPIPath("/vpcs/%d", vpcID)
+ response, err := doGETRequest[VPC](ctx, c, e)
+ return response, err
}
func (c *Client) ListVPCs(ctx context.Context, opts *ListOptions) ([]VPC, error) {
- response := VPCsPagedResponse{}
- err := c.listHelper(ctx, &response, opts)
- if err != nil {
- return nil, err
- }
- return response.Data, nil
+ response, err := getPaginatedResults[VPC](ctx, c, "vpcs", opts)
+ return response, err
}
func (c *Client) UpdateVPC(
@@ -133,23 +95,13 @@ func (c *Client) UpdateVPC(
vpcID int,
opts VPCUpdateOptions,
) (*VPC, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
- e := fmt.Sprintf("vpcs/%d", vpcID)
- req := c.R(ctx).SetResult(&VPC{}).SetBody(body)
- r, err := coupleAPIErrors(req.Put(e))
- if err != nil {
- return nil, err
- }
-
- return r.Result().(*VPC), nil
+ e := formatAPIPath("vpcs/%d", vpcID)
+ response, err := doPUTRequest[VPC](ctx, c, e, opts)
+ return response, err
}
func (c *Client) DeleteVPC(ctx context.Context, vpcID int) error {
- e := fmt.Sprintf("vpcs/%d", vpcID)
- _, err := coupleAPIErrors(c.R(ctx).Delete(e))
+ e := formatAPIPath("vpcs/%d", vpcID)
+ err := doDELETERequest(ctx, c, e)
return err
}
diff --git a/vendor/github.com/linode/linodego/vpc_ips.go b/vendor/github.com/linode/linodego/vpc_ips.go
new file mode 100644
index 00000000..7ccef887
--- /dev/null
+++ b/vendor/github.com/linode/linodego/vpc_ips.go
@@ -0,0 +1,20 @@
+package linodego
+
+import (
+ "context"
+ "fmt"
+)
+
+// ListAllVPCIPAddresses gets the list of all IP addresses of all VPCs in the Linode account.
+func (c *Client) ListAllVPCIPAddresses(
+ ctx context.Context, opts *ListOptions,
+) ([]VPCIP, error) {
+ return getPaginatedResults[VPCIP](ctx, c, "vpcs/ips", opts)
+}
+
+// ListVPCIPAddresses gets the list of all IP addresses of a specific VPC.
+func (c *Client) ListVPCIPAddresses(
+ ctx context.Context, vpcID int, opts *ListOptions,
+) ([]VPCIP, error) {
+ return getPaginatedResults[VPCIP](ctx, c, fmt.Sprintf("vpcs/%d/ips", vpcID), opts)
+}
diff --git a/vendor/github.com/linode/linodego/vpc_subnet.go b/vendor/github.com/linode/linodego/vpc_subnet.go
index 24582bb3..184316c4 100644
--- a/vendor/github.com/linode/linodego/vpc_subnet.go
+++ b/vendor/github.com/linode/linodego/vpc_subnet.go
@@ -3,10 +3,8 @@ package linodego
import (
"context"
"encoding/json"
- "fmt"
"time"
- "github.com/go-resty/resty/v2"
"github.com/linode/linodego/internal/parseabletime"
)
@@ -41,29 +39,6 @@ type VPCSubnetUpdateOptions struct {
Label string `json:"label"`
}
-type VPCSubnetsPagedResponse struct {
- *PageOptions
- Data []VPCSubnet `json:"data"`
-}
-
-func (VPCSubnetsPagedResponse) endpoint(ids ...any) string {
- id := ids[0].(int)
- return fmt.Sprintf("vpcs/%d/subnets", id)
-}
-
-func (resp *VPCSubnetsPagedResponse) castResult(
- r *resty.Request,
- e string,
-) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(VPCSubnetsPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*VPCSubnetsPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
func (v *VPCSubnet) UnmarshalJSON(b []byte) error {
type Mask VPCSubnet
p := struct {
@@ -99,19 +74,9 @@ func (c *Client) CreateVPCSubnet(
opts VPCSubnetCreateOptions,
vpcID int,
) (*VPCSubnet, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
- req := c.R(ctx).SetResult(&VPCSubnet{}).SetBody(string(body))
- e := fmt.Sprintf("vpcs/%d/subnets", vpcID)
- r, err := coupleAPIErrors(req.Post(e))
- if err != nil {
- return nil, err
- }
-
- return r.Result().(*VPCSubnet), nil
+ e := formatAPIPath("vpcs/%d/subnets", vpcID)
+ response, err := doPOSTRequest[VPCSubnet](ctx, c, e, opts)
+ return response, err
}
func (c *Client) GetVPCSubnet(
@@ -119,14 +84,9 @@ func (c *Client) GetVPCSubnet(
vpcID int,
subnetID int,
) (*VPCSubnet, error) {
- req := c.R(ctx).SetResult(&VPCSubnet{})
-
- e := fmt.Sprintf("vpcs/%d/subnets/%d", vpcID, subnetID)
- r, err := coupleAPIErrors(req.Get(e))
- if err != nil {
- return nil, err
- }
- return r.Result().(*VPCSubnet), nil
+ e := formatAPIPath("vpcs/%d/subnets/%d", vpcID, subnetID)
+ response, err := doGETRequest[VPCSubnet](ctx, c, e)
+ return response, err
}
func (c *Client) ListVPCSubnets(
@@ -134,12 +94,8 @@ func (c *Client) ListVPCSubnets(
vpcID int,
opts *ListOptions,
) ([]VPCSubnet, error) {
- response := VPCSubnetsPagedResponse{}
- err := c.listHelper(ctx, &response, opts, vpcID)
- if err != nil {
- return nil, err
- }
- return response.Data, nil
+ response, err := getPaginatedResults[VPCSubnet](ctx, c, formatAPIPath("vpcs/%d/subnets", vpcID), opts)
+ return response, err
}
func (c *Client) UpdateVPCSubnet(
@@ -148,23 +104,13 @@ func (c *Client) UpdateVPCSubnet(
subnetID int,
opts VPCSubnetUpdateOptions,
) (*VPCSubnet, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
- req := c.R(ctx).SetResult(&VPCSubnet{}).SetBody(body)
- e := fmt.Sprintf("vpcs/%d/subnets/%d", vpcID, subnetID)
- r, err := coupleAPIErrors(req.Put(e))
- if err != nil {
- return nil, err
- }
-
- return r.Result().(*VPCSubnet), nil
+ e := formatAPIPath("vpcs/%d/subnets/%d", vpcID, subnetID)
+ response, err := doPUTRequest[VPCSubnet](ctx, c, e, opts)
+ return response, err
}
func (c *Client) DeleteVPCSubnet(ctx context.Context, vpcID int, subnetID int) error {
- e := fmt.Sprintf("vpcs/%d/subnets/%d", vpcID, subnetID)
- _, err := coupleAPIErrors(c.R(ctx).Delete(e))
+ e := formatAPIPath("vpcs/%d/subnets/%d", vpcID, subnetID)
+ err := doDELETERequest(ctx, c, e)
return err
}
diff --git a/vendor/github.com/linode/linodego/waitfor.go b/vendor/github.com/linode/linodego/waitfor.go
index 0b4d6c7b..3d709a04 100644
--- a/vendor/github.com/linode/linodego/waitfor.go
+++ b/vendor/github.com/linode/linodego/waitfor.go
@@ -5,6 +5,7 @@ import (
"fmt"
"log"
"net/http"
+ "slices"
"strconv"
"time"
@@ -75,7 +76,6 @@ func (client Client) WaitForInstanceDiskStatus(ctx context.Context, instanceID i
}
for _, disk := range disks {
- disk := disk
if disk.ID == diskID {
complete := (disk.Status == status)
if complete {
@@ -442,6 +442,40 @@ func (client Client) WaitForImageStatus(ctx context.Context, imageID string, sta
}
}
+// WaitForImageRegionStatus waits for an Image's replica to reach the desired state
+// before returning.
+func (client Client) WaitForImageRegionStatus(ctx context.Context, imageID, region string, status ImageRegionStatus) (*Image, error) {
+ ticker := time.NewTicker(client.pollInterval)
+ defer ticker.Stop()
+
+ for {
+ select {
+ case <-ticker.C:
+ image, err := client.GetImage(ctx, imageID)
+ if err != nil {
+ return image, err
+ }
+
+ replicaIdx := slices.IndexFunc(
+ image.Regions,
+ func(r ImageRegion) bool {
+ return r.Region == region
+ },
+ )
+
+ // If no replica was found or the status doesn't match, try again
+ if replicaIdx < 0 || image.Regions[replicaIdx].Status != status {
+ continue
+ }
+
+ return image, nil
+
+ case <-ctx.Done():
+ return nil, fmt.Errorf("failed to wait for Image %s status %s: %w", imageID, status, ctx.Err())
+ }
+ }
+}
+
// WaitForMySQLDatabaseBackup waits for the backup with the given label to be available.
func (client Client) WaitForMySQLDatabaseBackup(ctx context.Context, dbID int, label string, timeoutSeconds int) (*MySQLDatabaseBackup, error) {
ctx, cancel := context.WithTimeout(ctx, time.Duration(timeoutSeconds)*time.Second)
@@ -705,7 +739,7 @@ func (p *EventPoller) WaitForFinished(
for {
select {
case <-ticker.C:
- event, err := p.client.GetEvent(ctx, event.ID)
+ event, err = p.client.GetEvent(ctx, event.ID)
if err != nil {
return nil, fmt.Errorf("failed to get event: %w", err)
}
diff --git a/vendor/github.com/ovh/go-ovh/ovh/configuration.go b/vendor/github.com/ovh/go-ovh/ovh/configuration.go
index 7dbea7a2..6102f06d 100644
--- a/vendor/github.com/ovh/go-ovh/ovh/configuration.go
+++ b/vendor/github.com/ovh/go-ovh/ovh/configuration.go
@@ -1,11 +1,14 @@
package ovh
import (
+ "context"
+ "errors"
"fmt"
"os"
"os/user"
"strings"
+ "golang.org/x/oauth2/clientcredentials"
"gopkg.in/ini.v1"
)
@@ -102,6 +105,10 @@ func (c *Client) loadConfig(endpointName string) error {
endpointName = getConfigValue(cfg, "default", "endpoint", "ovh-eu")
}
+ if c.AccessToken == "" {
+ c.AccessToken = getConfigValue(cfg, endpointName, "access_token", "")
+ }
+
if c.AppKey == "" {
c.AppKey = getConfigValue(cfg, endpointName, "application_key", "")
}
@@ -114,6 +121,41 @@ func (c *Client) loadConfig(endpointName string) error {
c.ConsumerKey = getConfigValue(cfg, endpointName, "consumer_key", "")
}
+ if c.ClientID == "" {
+ c.ClientID = getConfigValue(cfg, endpointName, "client_id", "")
+ }
+
+ if c.ClientSecret == "" {
+ c.ClientSecret = getConfigValue(cfg, endpointName, "client_secret", "")
+ }
+
+ configuredAuthMethods := []string{}
+ if c.AppKey != "" || c.AppSecret != "" || c.ConsumerKey != "" {
+ configuredAuthMethods = append(configuredAuthMethods, "application_key/application_secret")
+ }
+ if c.ClientID != "" || c.ClientSecret != "" {
+ configuredAuthMethods = append(configuredAuthMethods, "client_id/client_secret")
+ }
+ if c.AccessToken != "" {
+ configuredAuthMethods = append(configuredAuthMethods, "access_token")
+ }
+
+ if len(configuredAuthMethods) > 1 {
+ return fmt.Errorf("can't use multiple authentication methods: %s", strings.Join(configuredAuthMethods, ", "))
+ }
+ if len(configuredAuthMethods) == 0 {
+ return errors.New(
+ "missing authentication information, you need to provide one of the following: application_key/application_secret, client_id/client_secret, or access_token",
+ )
+ }
+
+ if (c.ClientID != "") != (c.ClientSecret != "") {
+ return errors.New("invalid oauth2 config, both client_id and client_secret must be given")
+ }
+ if (c.AppKey != "") != (c.AppSecret != "") {
+ return errors.New("invalid authentication config, both application_key and application_secret must be given")
+ }
+
// Load real endpoint URL by name. If endpoint contains a '/', consider it as a URL
if strings.Contains(endpointName, "/") {
c.endpoint = endpointName
@@ -123,13 +165,22 @@ func (c *Client) loadConfig(endpointName string) error {
// If we still have no valid endpoint, AppKey or AppSecret, return an error
if c.endpoint == "" {
- return fmt.Errorf("unknown endpoint '%s', consider checking 'Endpoints' list of using an URL", endpointName)
- }
- if c.AppKey == "" {
- return fmt.Errorf("missing application key, please check your configuration or consult the documentation to create one")
+ return fmt.Errorf("unknown endpoint '%s', consider checking 'Endpoints' list or using an URL", endpointName)
}
- if c.AppSecret == "" {
- return fmt.Errorf("missing application secret, please check your configuration or consult the documentation to create one")
+
+ if c.ClientID != "" {
+ if _, ok := tokensURLs[c.endpoint]; !ok {
+ return fmt.Errorf("oauth2 authentication is not compatible with endpoint %q", c.endpoint)
+ }
+
+ conf := &clientcredentials.Config{
+ ClientID: c.ClientID,
+ ClientSecret: c.ClientSecret,
+ TokenURL: tokensURLs[c.endpoint],
+ Scopes: []string{"all"},
+ }
+
+ c.oauth2TokenSource = conf.TokenSource(context.Background())
}
return nil
diff --git a/vendor/github.com/ovh/go-ovh/ovh/ovh.go b/vendor/github.com/ovh/go-ovh/ovh/ovh.go
index 950fd375..a5363402 100644
--- a/vendor/github.com/ovh/go-ovh/ovh/ovh.go
+++ b/vendor/github.com/ovh/go-ovh/ovh/ovh.go
@@ -14,6 +14,8 @@ import (
"strings"
"sync/atomic"
"time"
+
+ "golang.org/x/oauth2"
)
// getLocalTime is a function to be overwritten during the tests, it returns the time
@@ -48,10 +50,19 @@ var Endpoints = map[string]string{
// Errors
var (
ErrAPIDown = errors.New("go-ovh: the OVH API is not reachable: failed to get /auth/time response")
+
+ tokensURLs = map[string]string{
+ OvhEU: "https://www.ovh.com/auth/oauth2/token",
+ OvhCA: "https://ca.ovh.com/auth/oauth2/token",
+ OvhUS: "https://us.ovhcloud.com/auth/oauth2/token",
+ }
)
// Client represents a client to call the OVH API
type Client struct {
+ // AccessToken is a short-lived access token that we got from auth/oauth2/token endpoint.
+ AccessToken string
+
// Self generated tokens. Create one by visiting
// https://eu.api.ovh.com/createApp/
// AppKey holds the Application key
@@ -63,8 +74,12 @@ type Client struct {
// ConsumerKey holds the user/app specific token. It must have been validated before use.
ConsumerKey string
+ ClientID string
+ ClientSecret string
+
// API endpoint
- endpoint string
+ endpoint string
+ oauth2TokenSource oauth2.TokenSource
// Client is the underlying HTTP client used to run the requests. It may be overloaded but a default one is instanciated in ``NewClient`` by default.
Client *http.Client
@@ -114,6 +129,35 @@ func NewDefaultClient() (*Client, error) {
return NewClient("", "", "", "")
}
+func NewOAuth2Client(endpoint, clientID, clientSecret string) (*Client, error) {
+ client := Client{
+ ClientID: clientID,
+ ClientSecret: clientSecret,
+ Client: &http.Client{},
+ Timeout: DefaultTimeout,
+ }
+
+ // Get and check the configuration
+ if err := client.loadConfig(endpoint); err != nil {
+ return nil, err
+ }
+ return &client, nil
+}
+
+func NewAccessTokenClient(endpoint, accessToken string) (*Client, error) {
+ client := Client{
+ AccessToken: accessToken,
+ Client: &http.Client{},
+ Timeout: DefaultTimeout,
+ }
+
+ // Get and check the configuration
+ if err := client.loadConfig(endpoint); err != nil {
+ return nil, err
+ }
+ return &client, nil
+}
+
func (c *Client) Endpoint() string {
return c.endpoint
}
@@ -288,32 +332,45 @@ func (c *Client) NewRequest(method, path string, reqBody interface{}, needAuth b
if body != nil {
req.Header.Add("Content-Type", "application/json;charset=utf-8")
}
- req.Header.Add("X-Ovh-Application", c.AppKey)
+ if c.AppKey != "" {
+ req.Header.Add("X-Ovh-Application", c.AppKey)
+ }
req.Header.Add("Accept", "application/json")
// Inject signature. Some methods do not need authentication, especially /time,
// /auth and some /order methods are actually broken if authenticated.
if needAuth {
- timeDelta, err := c.TimeDelta()
- if err != nil {
- return nil, err
+ if c.AppKey != "" {
+ timeDelta, err := c.TimeDelta()
+ if err != nil {
+ return nil, err
+ }
+
+ timestamp := getLocalTime().Add(-timeDelta).Unix()
+
+ req.Header.Add("X-Ovh-Timestamp", strconv.FormatInt(timestamp, 10))
+ req.Header.Add("X-Ovh-Consumer", c.ConsumerKey)
+
+ h := sha1.New()
+ h.Write([]byte(fmt.Sprintf("%s+%s+%s+%s+%s+%d",
+ c.AppSecret,
+ c.ConsumerKey,
+ method,
+ target,
+ body,
+ timestamp,
+ )))
+ req.Header.Add("X-Ovh-Signature", fmt.Sprintf("$1$%x", h.Sum(nil)))
+ } else if c.ClientID != "" {
+ token, err := c.oauth2TokenSource.Token()
+ if err != nil {
+ return nil, fmt.Errorf("failed to retrieve OAuth2 Access Token: %w", err)
+ }
+
+ req.Header.Set("Authorization", "Bearer "+token.AccessToken)
+ } else if c.AccessToken != "" {
+ req.Header.Set("Authorization", "Bearer "+c.AccessToken)
}
-
- timestamp := getLocalTime().Add(-timeDelta).Unix()
-
- req.Header.Add("X-Ovh-Timestamp", strconv.FormatInt(timestamp, 10))
- req.Header.Add("X-Ovh-Consumer", c.ConsumerKey)
-
- h := sha1.New()
- h.Write([]byte(fmt.Sprintf("%s+%s+%s+%s+%s+%d",
- c.AppSecret,
- c.ConsumerKey,
- method,
- target,
- body,
- timestamp,
- )))
- req.Header.Add("X-Ovh-Signature", fmt.Sprintf("$1$%x", h.Sum(nil)))
}
// Send the request with requested timeout
diff --git a/vendor/github.com/packethost/packngo/CHANGELOG.md b/vendor/github.com/packethost/packngo/CHANGELOG.md
deleted file mode 100644
index 53b6de27..00000000
--- a/vendor/github.com/packethost/packngo/CHANGELOG.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# Changelog
-
-This project adheres to [Semantic
-Versioning](http://semver.org/spec/v2.0.0.html).
-
-All notable changes to this project will be documented at
-. Drafts release notes may be
-used to track features that will be available in future releases.
-
-The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/),
-breaking changes, additions, removals, and fixes should be pointed out in the
-release notes.
diff --git a/vendor/github.com/packethost/packngo/CONTRIBUTING.md b/vendor/github.com/packethost/packngo/CONTRIBUTING.md
deleted file mode 100644
index 368e3a4a..00000000
--- a/vendor/github.com/packethost/packngo/CONTRIBUTING.md
+++ /dev/null
@@ -1,119 +0,0 @@
-# Contributing
-
-Thanks for your interest in improving this project! Before we get technical,
-make sure you have reviewed the [code of conduct](code-of-conduct.md),
-[Developer Certificate of Origin](DCO), and [OWNERS](OWNERS.md) files. Code will
-be licensed according to [LICENSE.txt](LICENSE.txt).
-
-## Pull Requests
-
-When creating a pull request, please refer to an open issue. If there is no
-issue open for the pull request you are creating, please create one. Frequently,
-pull requests may be merged or closed while the underlying issue being addressed
-is not fully addressed. Issues are a place to discuss the problem in need of a
-solution. Pull requests are a place to discuss an implementation of one
-particular answer to that problem. A pull request may not address all (or any)
-of the problems expressed in the issue, so it is important to track these
-separately.
-
-## Code Quality
-
-### Documentation
-
-All public functions and variables should include at least a short description
-of the functionality they provide. Comments should be formatted according to
-.
-
-Documentation at will be
-generated from these comments.
-
-The documentation provided for packngo fields and functions should be at or
-better than the quality provided at .
-When the API documentation provides a lengthy description, a linking to the
-related API documentation will benefit users.
-
-### Linters
-
-`golangci-lint` is used to verify that the style of the code remains consistent.
-
-Before committing, it's a good idea to run `goimports -w .`.
-([goimports](https://pkg.go.dev/golang.org/x/tools/cmd/goimports?tab=doc)) and
-`gofmt -w *.go`. ([gofmt](https://golang.org/cmd/gofmt/))
-
-`make lint` can be used to verify style before creating a pull request.
-
-## Building and Testing
-
-The [Makefile](./Makefile) contains the targets to build, lint and test:
-
-```sh
-make build
-make lint
-make test
-```
-
-These normally will be run in a docker image of golang. To run locally, just run
-with `BUILD=local`:
-
-```sh
-make build BUILD=local
-make lint BUILD=local
-make test BUILD=local
-```
-
-### Acceptance Tests
-
-If you want to run tests against the actual Equinix Metal API, you must set the
-environment variable `PACKET_TEST_ACTUAL_API` to a non-empty string and set
-`PACKNGO_TEST_RECORDER` to `disabled`. The device tests wait for the device
-creation, so it's best to run a few in parallel.
-
-To run a particular test, you can do
-
-```sh
-PACKNGO_TEST_ACTUAL_API=1 go test -v -run=TestAccDeviceBasic --timeout=2h
-```
-
-If you want to see HTTP requests, set the `PACKNGO_DEBUG` env var to non-empty
-string, for example:
-
-```sh
-PACKNGO_DEBUG=1 PACKNGO_TEST_ACTUAL_API=1 go test -v -run=TestAccVolumeUpdate
-```
-
-### Test Fixtures
-
-By default, `go test ./...` will skip most of the tests unless
-`PACKNGO_TEST_ACTUAL_API` is non-empty.
-
-With the `PACKNGO_TEST_ACTUAL_API` environment variable set, tests will be run
-against the Equinix Metal API, creating real infrastructure and incurring costs.
-
-The `PACKNGO_TEST_RECORDER` variable can be used to record and playback API
-responses to test code changes without the delay and costs of making actual API
-calls. When unset, `PACKNGO_TEST_RECORDER` acts as though it was set to
-`disabled`. This is the default behavior. This default behavior may change in
-the future once fixtures are available for all tests.
-
-When `PACKNGO_TEST_RECORDER` is set to `play`, tests will playback API responses
-from recorded HTTP response fixtures. This is idea for refactoring and making
-changes to request and response handling without introducing changes to the data
-sent or received by the Equinix Metal API.
-
-When adding support for new end-points, recorded test sessions should be added.
-Record the HTTP interactions to fixtures by setting the environment variable
-`PACKNGO_TEST_RECORDER` to `record`.
-
-The fixtures are automatically named according to the test they were run from.
-They are placed in `fixtures/`. The API token used during authentication is
-automatically removed from these fixtures. Nonetheless, caution should be
-exercised before committing any fixtures into the project. Account details
-includes API tokens, contact, and payment details could easily be leaked by
-committing fixtures that haven't been thoroughly reviewed.
-
-### Automation (CI/CD)
-
-Today, Drone tests pull requests using tests defined in
-[.drone.yml](.drone.yml).
-
-See [RELEASE.md](RELEASE.md) for details on the release process.
diff --git a/vendor/github.com/packethost/packngo/DCO b/vendor/github.com/packethost/packngo/DCO
deleted file mode 100644
index 068953d4..00000000
--- a/vendor/github.com/packethost/packngo/DCO
+++ /dev/null
@@ -1,37 +0,0 @@
-Developer Certificate of Origin
-Version 1.1
-
-Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
-660 York Street, Suite 102,
-San Francisco, CA 94110 USA
-
-Everyone is permitted to copy and distribute verbatim copies of this
-license document, but changing it is not allowed.
-
-
-Developer's Certificate of Origin 1.1
-
-By making a contribution to this project, I certify that:
-
-(a) The contribution was created in whole or in part by me and I
- have the right to submit it under the open source license
- indicated in the file; or
-
-(b) The contribution is based upon previous work that, to the best
- of my knowledge, is covered under an appropriate open source
- license and I have the right under that license to submit that
- work with modifications, whether created in whole or in part
- by me, under the same open source license (unless I am
- permitted to submit under a different license), as indicated
- in the file; or
-
-(c) The contribution was provided directly to me by some other
- person who certified (a), (b) or (c) and I have not modified
- it.
-
-(d) I understand and agree that this project and the contribution
- are public and that a record of the contribution (including all
- personal information I submit with it, including my sign-off) is
- maintained indefinitely and may be redistributed consistent with
- this project or the open source license(s) involved.
-
diff --git a/vendor/github.com/packethost/packngo/Makefile b/vendor/github.com/packethost/packngo/Makefile
deleted file mode 100644
index 17c8036b..00000000
--- a/vendor/github.com/packethost/packngo/Makefile
+++ /dev/null
@@ -1,24 +0,0 @@
-IMG ?= golang:1.16
-
-# enable go modules, disabled CGO
-
-GOENV ?= GO111MODULE=on CGO_ENABLED=0
-export GO111MODULE=on
-export CGO_ENABLED=0
-
-# we build in a docker image, unless we are set to BUILD=local
-GO ?= docker run --rm -v $(PWD):/app -w /app $(IMG) env $(GOENV)
-ifeq ($(BUILD),local)
-GO =
-endif
-
-
-build:
- $(GO) go build -i -v ./...
-
-lint:
- @docker run --rm -v $(CURDIR):/app -w /app golangci/golangci-lint:v1.34.1 golangci-lint run -v
-
-test:
- $(GO) test ./...
-
diff --git a/vendor/github.com/packethost/packngo/OWNERS.md b/vendor/github.com/packethost/packngo/OWNERS.md
deleted file mode 100644
index ffc1a7b3..00000000
--- a/vendor/github.com/packethost/packngo/OWNERS.md
+++ /dev/null
@@ -1,24 +0,0 @@
-# Owners
-
-This project is governed by [Equinix Metal] and benefits from a community of users that
-collaborate and contribute to its use in Go powered projects, such as the [Equinix
-Terraform provider], the [Docker machine driver], the Kubernetes [CCM],
-the [Equinix Metal CLI], and others.
-
-Members of the Equinix Metal Github organization will strive to triage issues in a
-timely manner, see [SUPPORT.md] for details.
-
-See the [Equinix Labs Glossary] for more details about this file.
-
-## Maintainers
-
-Maintainers of this repository are defined within the [CODEOWNERS] file.
-
-[Equinix Metal]: https://metal.equinix.com
-[Equinix Terraform provider]: https://github.com/equinix/terraform-provider-equinix
-[Docker machine driver]: https://github.com/equinix/docker-machine-driver-metal
-[CCM]: https://github.com/equinix/cloud-provider-equinix-metal
-[Equinix Metal CLI]: https://github.com/equinix/metal-cli
-[SUPPORT.md]: SUPPORT.md
-[Equinix Labs Glossary]: https://github.com/equinix-labs/equinix-labs/blob/main/glossary.md#ownersmd
-[CODEOWNERS]: CODEOWNERS
diff --git a/vendor/github.com/packethost/packngo/README.md b/vendor/github.com/packethost/packngo/README.md
deleted file mode 100644
index 54f4d704..00000000
--- a/vendor/github.com/packethost/packngo/README.md
+++ /dev/null
@@ -1,155 +0,0 @@
-# packngo
-
-[![Deprecated](https://img.shields.io/badge/Stability-Deprecated-red.svg)](https://github.com/equinix-labs/equinix-labs/blob/main/uniform-standards.md)
-[![Release](https://img.shields.io/github/v/release/packethost/packngo)](https://github.com/packethost/packngo/releases/latest)
-[![GoDoc](https://godoc.org/github.com/packethost/packngo?status.svg)](https://godoc.org/github.com/packethost/packngo)
-[![Go Report Card](https://goreportcard.com/badge/github.com/packethost/packngo)](https://goreportcard.com/report/github.com/packethost/packngo)
-[![Slack](https://slack.equinixmetal.com/badge.svg)](https://slack.equinixmetal.com/)
-[![Twitter Follow](https://img.shields.io/twitter/follow/equinixmetal.svg?style=social&label=Follow)](https://twitter.com/intent/follow?screen_name=equinixmetal)
-
-> **[Deprecated](https://github.com/equinix-labs/equinix-labs/blob/main/deprecated-statement.md)** This repository is Deprecated, meaning that this software is only supported or maintained by Equinix Metal and its community in a case-by-case basis. It has been replaced by [`equinix-sdk-go`](https://github.com/equinix/equinix-sdk-go), which is generated from Equinix OpenAPI specs and is intended to support Equinix services beyond only Metal.
-
-A Golang client for the Equinix Metal API. ([Packet is now Equinix Metal](https://blog.equinix.com/blog/2020/10/06/equinix-metal-metal-and-more/))
-
-## Installation
-
-To import this library into your Go project:
-
-```go
-import "github.com/packethost/packngo"
-```
-
-**Note:** A minimum of Go 1.14 is required for development.
-
-Download module with:
-
-```sh
-go get github.com/packethost/packngo
-```
-
-## Stability and Compatibility
-
-This repository is [Maintained](https://github.com/equinix-labs/equinix-labs/blob/main/maintained-statement.md) meaning that this software is supported by Equinix Metal and its community - available to use in production environments.
-
-Packngo is currently provided with a major version of [v0](https://blog.golang.org/v2-go-modules). We'll try to avoid breaking changes to this library, but they will certainly happen as we work towards a stable v1 library. See [CHANGELOG.md](CHANGELOG.md) for details on the latest additions, removals, fixes, and breaking changes.
-
-While packngo provides an interface to most of the [Equinix Metal API](https://metal.equinix.com/developers/api/), the API is regularly adding new features. To request or contribute support for more API end-points or added fields, [create an issue](https://github.com/packethost/packngo/issues/new).
-
-See [SUPPORT.md](SUPPORT.md) for any other issues.
-
-## Usage
-
-To authenticate to the Equinix Metal API, you must have your API token exported in env var `PACKET_AUTH_TOKEN`.
-
-This code snippet initializes Equinix Metal API client, and lists your Projects:
-
-```go
-package main
-
-import (
- "log"
-
- "github.com/packethost/packngo"
-)
-
-func main() {
- c, err := packngo.NewClient()
- if err != nil {
- log.Fatal(err)
- }
-
- ps, _, err := c.Projects.List(nil)
- if err != nil {
- log.Fatal(err)
- }
- for _, p := range ps {
- log.Println(p.ID, p.Name)
- }
-}
-
-```
-
-This library is used by the official [terraform-provider-equinix](https://github.com/equinix/terraform-provider-equinix).
-
-You can also learn a lot from the `*_test.go` sources. Almost all out tests touch the Equinix Metal API, so you can see how auth, querying and POSTing works. For example [devices_test.go](devices_test.go).
-
-
-Linked Resources
-
-### Linked resources in Get\* and List\* functions
-
-The Equinix Metal API includes references to related entities for a wide selection of resource types, indicated by `href` fields. The Equinix Metal API allows for these entities to be included in the API response, saving the user from making more round-trip API requests. This is useful for linked resources, e.g members of a project, devices in a project. Similarly, by excluding entities that are included by default, you can reduce the API response time and payload size.
-
-Control of this behavior is provided through [common attributes](https://metal.equinix.com/developers/api/common-parameters/) that can be used to toggle, by field name, which referenced resources will be included as values in API responses. The API exposes this feature through `?include=` and `?exclude=` query parameters which accept a comma-separated list of field names. These field names can be dotted to reference nested entities.
-
-Most of the packngo `Get` functions take references to `GetOptions` parameters (or `ListOptions` for `List` functions). These types include an `Include` and `Exclude` slice that will be converted to query parameters upon request.
-
-For example, if you want to list users in a project, you can fetch the project via `Projects.Get(pid, nil)` call. The result of this call will be a `Project` which has a `Users []User` attribute. The items in the `[]User` slice only have a non-zero URL attribute, the rest of the fields will be type defaults. You can then parse the ID of the User resources and fetch them consequently.
-
-Optionally, you can use the ListOptions struct in the project fetch call to include the Users (`members` JSON tag). Then, every item in the `[]User` slice will have all (not only the `Href`) attributes populated.
-
-```go
-Projects.Get(pid, &packngo.ListOptions{Includes: []{'members'}})
-```
-
-The following is a more comprehensive illustration of Includes and Excludes.
-
-```go
-import (
- "log"
-
- "github.com/packethost/packngo"
-)
-
-func listProjectsAndUsers(lo *packngo.ListOptions) {
- c, err := packngo.NewClient()
- if err != nil {
- log.Fatal(err)
- }
-
- ps, _, err := c.Projects.List(lo)
- if err != nil {
- log.Fatal(err)
- }
- log.Printf("Listing for listOptions %+v\n", lo)
- for _, p := range ps {
- log.Printf("project resource %s has %d users", p.Name, len(p.Users))
- for _, u := range p.Users {
- if u.Email != "" && u.FullName != "" {
- log.Printf(" user %s has email %s\n", u.FullName, u.Email)
- } else {
- log.Printf(" only got user link %s\n", u.URL)
- }
- }
- }
-}
-
-func main() {
- loMembers := &packngo.ListOptions{Includes: []string{"members"}}
- loMembersOut := &packngo.ListOptions{Excludes: []string{"members"}}
- listProjectsAndUsers(loMembers)
- listProjectsAndUsers(nil)
- listProjectsAndUsers(loMembersOut)
-}
-```
-
-
-
-### Deprecation and Sunset
-
-If the Equinix Metal API returns a [RFC-8594](https://tools.ietf.org/html/rfc8594) `Deprecation` or `Sunset` header, packngo will log this header to stderr with any accompanied `Link` headers.
-
-Example:
-
-```console
-WARNING: "POST /deprecate-and-sunset" reported deprecation
-WARNING: "POST /deprecate-and-sunset" reported sunsetting on Sat, 1 Aug 2020 23:59:59 GMT
-WARNING: See for deprecation details
-WARNING: See for sunset details
-WARNING: See for sunset details
-WARNING: See for deprecation details
-```
-
-## Contributing
-
-See [CONTIBUTING.md](CONTRIBUTING.md).
diff --git a/vendor/github.com/packethost/packngo/RELEASE.md b/vendor/github.com/packethost/packngo/RELEASE.md
deleted file mode 100644
index 74a9ac2d..00000000
--- a/vendor/github.com/packethost/packngo/RELEASE.md
+++ /dev/null
@@ -1,40 +0,0 @@
-# Releases
-
-This file serves to provide guidance and act as a checklist for any maintainers
-to this project, now or in the future. This file should be updated with any
-changes to the process. Automated processes should be described well enough that
-they can be run in the absence of that automation.
-
-* See [CHANGELOG.md](CHANGELOG.md) for notes on versioning.
-* Fetch the latest origin branches:
-
- ```sh
- git fetch origin
- git checkout master
- git pull
- ```
-
-* Verify that your branch matches the upstream branch:
-
- ```sh
- git branch --points-at=master -r | grep origin/master >/dev/null || echo "master differs from origin/master"
- ```
-
-* Tag `master` with a semver tag that suits the level of changes
- introduced:
-
- ```sh
- git tag -m "v0.8.0" -a v0.8.0 master # use -s if gpg is available
- ```
-* Push the tag:
-
- ```sh
- git push --tags origin master v0.8.0
- ```
-* Create a release from the tag (include a keepachangelog.com formatted description):
-
- (use the correct
- version)
-
-Releases can be followed through the GitHub Atom feed at
-.
diff --git a/vendor/github.com/packethost/packngo/SUPPORT.md b/vendor/github.com/packethost/packngo/SUPPORT.md
deleted file mode 100644
index 86f8401f..00000000
--- a/vendor/github.com/packethost/packngo/SUPPORT.md
+++ /dev/null
@@ -1,17 +0,0 @@
-# Support
-
-Please [open a GitHub Issue] stating any problems that you encounter using this
-software. Be sure to leave a descriptive report of the problem, including the
-environment you were running in and the expected behavior. Be careful not to
-include any sensitive information such as API Keys, IP addresses or their
-ranges, or any resource identifiers (UUID or ID) of your organizations,
-projects, or devices.
-
-As an open-source project, the priority, timing, or eventual resolution is not
-guaranteed. Issues will be addressed based on priorities that may or may not
-be reflected in Github or issue comments.
-
-For other forms of support, including our Slack community, visit
-.
-
-[open a GitHub Issue]: https://github.com/packethost/packngo/issues/new
\ No newline at end of file
diff --git a/vendor/github.com/packethost/packngo/api_call_options.go b/vendor/github.com/packethost/packngo/api_call_options.go
deleted file mode 100644
index c1b4db70..00000000
--- a/vendor/github.com/packethost/packngo/api_call_options.go
+++ /dev/null
@@ -1,222 +0,0 @@
-package packngo
-
-import (
- "fmt"
- "net/url"
- "strconv"
- "strings"
-)
-
-type ListSortDirection string
-
-const (
- SortDirectionAsc ListSortDirection = "asc"
- SortDirectionDesc ListSortDirection = "desc"
-)
-
-// GetOptions are options common to Equinix Metal API GET requests
-type GetOptions struct {
- // Includes are a list of fields to expand in the request results.
- //
- // For resources that contain collections of other resources, the Equinix Metal API
- // will only return the `Href` value of these resources by default. In
- // nested API Go types, this will result in objects that have zero values in
- // all fiends except their `Href` field. When an object's associated field
- // name is "included", the returned fields will be Uumarshalled into the
- // nested object. Field specifiers can use a dotted notation up to three
- // references deep. (For example, "memberships.projects" can be used in
- // ListUsers.)
- Includes []string `url:"include,omitempty,comma"`
-
- // Excludes reduce the size of the API response by removing nested objects
- // that may be returned.
- //
- // The default behavior of the Equinix Metal API is to "exclude" fields, but some
- // API endpoints have an "include" behavior on certain fields. Nested Go
- // types unmarshalled into an "excluded" field will only have a values in
- // their `Href` field.
- Excludes []string `url:"exclude,omitempty,comma"`
-
- // QueryParams for API URL, used for arbitrary filters
- QueryParams map[string]string `url:"-"`
-
- // Page is the page of results to retrieve for paginated result sets
- Page int `url:"page,omitempty"`
-
- // PerPage is the number of results to return per page for paginated result
- // sets,
- PerPage int `url:"per_page,omitempty"`
-
- // Search is a special API query parameter that, for resources that support
- // it, will filter results to those with any one of various fields matching
- // the supplied keyword. For example, a resource may have a defined search
- // behavior matches either a name or a fingerprint field, while another
- // resource may match entirely different fields. Search is currently
- // implemented for SSHKeys and uses an exact match.
- Search string `url:"search,omitempty"`
-
- SortBy string `url:"sort_by,omitempty"`
- SortDirection ListSortDirection `url:"sort_direction,omitempty"`
-
- Meta meta `url:"-"`
-}
-
-type ListOptions = GetOptions
-type SearchOptions = GetOptions
-
-type QueryAppender interface {
- WithQuery(path string) string // we use this in all List functions (urlQuery)
- GetPage() int // we use this in List
- Including(...string) // we use this in Device List to add facility
- Excluding(...string)
-}
-
-// GetOptions returns GetOptions from GetOptions (and is nil-receiver safe)
-func (g *GetOptions) GetOptions() *GetOptions {
- getOpts := GetOptions{}
- if g != nil {
- getOpts.Includes = g.Includes
- getOpts.Excludes = g.Excludes
- }
- return &getOpts
-}
-
-func (g *GetOptions) WithQuery(apiPath string) string {
- params := g.Encode()
- if params != "" {
- // parse path, take existing vars
- return fmt.Sprintf("%s?%s", apiPath, params)
- }
- return apiPath
-}
-
-// OptionsGetter provides GetOptions
-type OptionsGetter interface {
- GetOptions() *GetOptions
-}
-
-func (g *GetOptions) GetPage() int { // guaranteed int
- if g == nil {
- return 0
- }
- return g.Page
-}
-
-func (g *GetOptions) CopyOrNew() *GetOptions {
- if g == nil {
- return &GetOptions{}
- }
- ret := *g
- return &ret
-}
-
-func (g *GetOptions) Filter(key, value string) *GetOptions {
- return g.AddParam(key, value)
-}
-
-// AddParam adds key=value to URL path
-func (g *GetOptions) AddParam(key, value string) *GetOptions {
- ret := g.CopyOrNew()
- if ret.QueryParams == nil {
- ret.QueryParams = map[string]string{}
- }
- ret.QueryParams[key] = value
- return ret
-}
-
-// Including ensures that the variadic refs are included in a copy of the
-// options, resulting in expansion of the the referred sub-resources. Unknown
-// values within refs will be silently ignore by the API.
-func (g *GetOptions) Including(refs ...string) *GetOptions {
- ret := g.CopyOrNew()
- for _, v := range refs {
- if !contains(ret.Includes, v) {
- ret.Includes = append(ret.Includes, v)
- }
- }
- return ret
-}
-
-// Excluding ensures that the variadic refs are included in the "Excluded" param
-// in a copy of the options.
-// Unknown values within refs will be silently ignore by the API.
-func (g *GetOptions) Excluding(refs ...string) *GetOptions {
- ret := g.CopyOrNew()
- for _, v := range refs {
- if !contains(ret.Excludes, v) {
- ret.Excludes = append(ret.Excludes, v)
- }
- }
- return ret
-}
-
-func stripQuery(inURL string) string {
- u, _ := url.Parse(inURL)
- u.RawQuery = ""
- return u.String()
-}
-
-// nextPage is common and extracted from all List functions
-func nextPage(meta meta, opts *GetOptions) (path string) {
- if meta.Next != nil && (opts.GetPage() == 0) {
- optsCopy := opts.CopyOrNew()
- optsCopy.Page = meta.CurrentPageNum + 1
- return optsCopy.WithQuery(stripQuery(meta.Next.Href))
- }
- if opts != nil {
- opts.Meta = meta
- }
- return ""
-}
-
-const (
- IncludeParam = "include"
- ExcludeParam = "exclude"
- PageParam = "page"
- PerPageParam = "per_page"
- SearchParam = "search"
- SortByParam = "sort_by"
- SortDirectionParam = "sort_direction"
-)
-
-// Encode generates a URL query string ("?foo=bar")
-func (g *GetOptions) Encode() string {
- if g == nil {
- return ""
- }
- v := url.Values{}
- for k, val := range g.QueryParams {
- v.Add(k, val)
- }
- // the names parameters will rewrite arbitrary options
- if g.Includes != nil && len(g.Includes) > 0 {
- v.Add(IncludeParam, strings.Join(g.Includes, ","))
- }
- if g.Excludes != nil && len(g.Excludes) > 0 {
- v.Add(ExcludeParam, strings.Join(g.Excludes, ","))
- }
- if g.Page != 0 {
- v.Add(PageParam, strconv.Itoa(g.Page))
- }
- if g.PerPage != 0 {
- v.Add(PerPageParam, strconv.Itoa(g.PerPage))
- }
- if g.Search != "" {
- v.Add(SearchParam, g.Search)
- }
- if g.SortBy != "" {
- v.Add(SortByParam, g.SortBy)
- }
- if g.SortDirection != "" {
- v.Add(SortDirectionParam, string(g.SortDirection))
- }
- return v.Encode()
-}
-
-/*
-// Encode generates a URL query string ("?foo=bar")
-func (g *GetOptions) Encode() string {
- urlValues, _ := query.Values(g)
- return urlValues.Encode()
-}
-*/
diff --git a/vendor/github.com/packethost/packngo/apikeys.go b/vendor/github.com/packethost/packngo/apikeys.go
deleted file mode 100644
index 6aa0bfc6..00000000
--- a/vendor/github.com/packethost/packngo/apikeys.go
+++ /dev/null
@@ -1,191 +0,0 @@
-package packngo
-
-import (
- "fmt"
- "path"
-)
-
-const (
- apiKeyBasePath = "/api-keys"
-)
-
-// APIKeyService interface defines available device methods
-type APIKeyService interface {
- UserList(*ListOptions) ([]APIKey, *Response, error)
- ProjectList(string, *ListOptions) ([]APIKey, *Response, error)
- UserGet(string, *GetOptions) (*APIKey, error)
- ProjectGet(string, string, *GetOptions) (*APIKey, error)
- Create(*APIKeyCreateRequest) (*APIKey, *Response, error)
- Delete(string) (*Response, error)
-}
-
-type apiKeyRoot struct {
- APIKeys []APIKey `json:"api_keys"`
-}
-
-type APIKey struct {
- // ID is the UUIDv4 representing an API key in API requests and responses.
- ID string `json:"id"`
-
- // Description is any text description of the key. This can be used to
- // describe the purpose of the key.
- Description string `json:"description"`
-
- // Token is a sensitive credential that can be used as a `Client.APIKey` to
- // access Equinix Metal resources.
- Token string `json:"token"`
-
- // ReadOnly keys can not create new resources.
- ReadOnly bool `json:"read_only"`
-
- // Created is the creation date of the API key.
- Created string `json:"created_at"`
-
- // Updated is the last-update date of the API key.
- Updated string `json:"updated_at"`
-
- // User will be non-nil when getting or listing an User API key.
- User *User `json:"user"`
-
- // Project will be non-nil when getting or listing a Project API key
- Project *Project `json:"project"`
-}
-
-// APIKeyCreateRequest type used to create an api key.
-type APIKeyCreateRequest struct {
- // Description is any text description of the key. This can be used to
- // describe the purpose of the key.
- Description string `json:"description"`
-
- // ReadOnly keys can not create new resources.
- ReadOnly bool `json:"read_only"`
-
- // ProjectID when non-empty will result in the creation of a Project API
- // key.
- ProjectID string `json:"-"`
-}
-
-func (s APIKeyCreateRequest) String() string {
- return Stringify(s)
-}
-
-// APIKeyServiceOp implements APIKeyService
-type APIKeyServiceOp struct {
- client *Client
-}
-
-func (s *APIKeyServiceOp) list(url string, opts *ListOptions) ([]APIKey, *Response, error) {
- root := new(apiKeyRoot)
- apiPathQuery := opts.WithQuery(url)
-
- resp, err := s.client.DoRequest("GET", apiPathQuery, nil, root)
- if err != nil {
- return nil, resp, err
- }
-
- return root.APIKeys, resp, err
-}
-
-// ProjectList lists the API keys associated with a project having `projectID`
-// match `Project.ID`.
-func (s *APIKeyServiceOp) ProjectList(projectID string, opts *ListOptions) ([]APIKey, *Response, error) {
- if validateErr := ValidateUUID(projectID); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(projectBasePath, projectID, apiKeyBasePath)
- return s.list(endpointPath, opts)
-}
-
-// UserList returns the API keys for the User associated with the
-// `Client.APIKey`.
-//
-// When `Client.APIKey` is a Project API key, this method will return an access
-// denied error.
-func (s *APIKeyServiceOp) UserList(opts *ListOptions) ([]APIKey, *Response, error) {
- endpointPath := path.Join(userBasePath, apiKeyBasePath)
- return s.list(endpointPath, opts)
-}
-
-// ProjectGet returns the Project API key with the given `APIKey.ID`.
-//
-// In other methods, it is typical for a Response to be returned, which could
-// include a StatusCode of `http.StatusNotFound` (404 error) when the resource
-// was not found. The Equinix Metal API does not expose a get by ID endpoint for
-// APIKeys. That is why in this method, all API keys are listed and compared
-// for a match. Therefor, the Response is not returned and a custom error will
-// be returned when the key is not found.
-func (s *APIKeyServiceOp) ProjectGet(projectID, apiKeyID string, opts *GetOptions) (*APIKey, error) {
- if validateErr := ValidateUUID(projectID); validateErr != nil {
- return nil, validateErr
- }
- if validateErr := ValidateUUID(apiKeyID); validateErr != nil {
- return nil, validateErr
- }
- pkeys, _, err := s.ProjectList(projectID, opts)
- if err != nil {
- return nil, err
- }
- for _, k := range pkeys {
- if k.ID == apiKeyID {
- return &k, nil
- }
- }
- return nil, fmt.Errorf("Project (%s) API key %s not found", projectID, apiKeyID)
-}
-
-// UserGet returns the User API key with the given `APIKey.ID`.
-//
-// In other methods, it is typical for a Response to be returned, which could
-// include a StatusCode of `http.StatusNotFound` (404 error) when the resource
-// was not found. The Equinix Metal API does not expose a get by ID endpoint for
-// APIKeys. That is why in this method, all API keys are listed and compared
-// for a match. Therefor, the Response is not returned and a custom error will
-// be returned when the key is not found.
-func (s *APIKeyServiceOp) UserGet(apiKeyID string, opts *GetOptions) (*APIKey, error) {
- if validateErr := ValidateUUID(apiKeyID); validateErr != nil {
- return nil, validateErr
- }
- ukeys, _, err := s.UserList(opts)
- if err != nil {
- return nil, err
- }
- for _, k := range ukeys {
- if k.ID == apiKeyID {
- return &k, nil
- }
- }
- return nil, fmt.Errorf("User API key %s not found", apiKeyID)
-}
-
-// Create creates a new API key.
-//
-// The API key can be either an User API key or a Project API key, determined by
-// the value (or emptiness) of `APIKeyCreateRequest.ProjectID`. Either `User` or
-// `Project` will be non-nil in the `APIKey` depending on this factor.
-func (s *APIKeyServiceOp) Create(createRequest *APIKeyCreateRequest) (*APIKey, *Response, error) {
- apiPath := path.Join(userBasePath, apiKeyBasePath)
- if createRequest.ProjectID != "" {
- apiPath = path.Join(projectBasePath, createRequest.ProjectID, apiKeyBasePath)
- }
- apiKey := new(APIKey)
-
- resp, err := s.client.DoRequest("POST", apiPath, createRequest, apiKey)
- if err != nil {
- return nil, resp, err
- }
-
- return apiKey, resp, err
-}
-
-// Delete deletes an API key by `APIKey.ID`
-//
-// The API key can be either an User API key or a Project API key.
-//
-// Project API keys can not be used to delete themselves.
-func (s *APIKeyServiceOp) Delete(apiKeyID string) (*Response, error) {
- if validateErr := ValidateUUID(apiKeyID); validateErr != nil {
- return nil, validateErr
- }
- apiPath := path.Join(userBasePath, apiKeyBasePath, apiKeyID)
- return s.client.DoRequest("DELETE", apiPath, nil, nil)
-}
diff --git a/vendor/github.com/packethost/packngo/batches.go b/vendor/github.com/packethost/packngo/batches.go
deleted file mode 100644
index b660f549..00000000
--- a/vendor/github.com/packethost/packngo/batches.go
+++ /dev/null
@@ -1,118 +0,0 @@
-package packngo
-
-import (
- "fmt"
- "path"
-)
-
-const batchBasePath = "/batches"
-
-// BatchService interface defines available batch methods
-type BatchService interface {
- Get(batchID string, getOpt *GetOptions) (*Batch, *Response, error)
- List(ProjectID string, listOpt *ListOptions) ([]Batch, *Response, error)
- Create(projectID string, batches *BatchCreateRequest) ([]Batch, *Response, error)
- Delete(string, bool) (*Response, error)
-}
-
-// Batch type
-type Batch struct {
- ID string `json:"id"`
- ErrorMessages []string `json:"error_messages,omitempty"`
-
- // State may be 'failed' or 'completed'
- State string `json:"state,omitempty"`
- Quantity int32 `json:"quantity,omitempty"`
- CreatedAt *Timestamp `json:"created_at,omitempty"`
- Href string `json:"href,omitempty"`
- Project Href `json:"project,omitempty"`
- Devices []Device `json:"devices,omitempty"`
-}
-
-//BatchesList represents collection of batches
-type batchesList struct {
- Batches []Batch `json:"batches,omitempty"`
-}
-
-// BatchCreateRequest type used to create batch of device instances
-type BatchCreateRequest struct {
- Batches []BatchCreateDevice `json:"batches"`
-}
-
-// BatchCreateDevice type used to describe batch instances
-type BatchCreateDevice struct {
- DeviceCreateRequest
- Quantity int32 `json:"quantity"`
- FacilityDiversityLevel int32 `json:"facility_diversity_level,omitempty"`
- SpotInstance bool `json:"spot_instance,omitempty"`
- SpotPriceMax float64 `json:"spot_price_max,omitempty"`
-}
-
-// BatchServiceOp implements BatchService
-type BatchServiceOp struct {
- client *Client
-}
-
-// Get returns batch details
-func (s *BatchServiceOp) Get(batchID string, opts *GetOptions) (*Batch, *Response, error) {
- if validateErr := ValidateUUID(batchID); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(batchBasePath, batchID)
- apiPathQuery := opts.WithQuery(endpointPath)
- batch := new(Batch)
-
- resp, err := s.client.DoRequest("GET", apiPathQuery, nil, batch)
- if err != nil {
- return nil, resp, err
- }
-
- return batch, resp, err
-}
-
-// List returns batches on a project
-func (s *BatchServiceOp) List(projectID string, opts *ListOptions) (batches []Batch, resp *Response, err error) {
- if validateErr := ValidateUUID(projectID); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(projectBasePath, projectID, batchBasePath)
- apiPathQuery := opts.WithQuery(endpointPath)
- subset := new(batchesList)
- resp, err = s.client.DoRequest("GET", apiPathQuery, nil, subset)
- if err != nil {
- return nil, resp, err
- }
-
- batches = append(batches, subset.Batches...)
- return batches, resp, err
-}
-
-// Create function to create batch of device instances
-func (s *BatchServiceOp) Create(projectID string, request *BatchCreateRequest) ([]Batch, *Response, error) {
- if validateErr := ValidateUUID(projectID); validateErr != nil {
- return nil, nil, validateErr
- }
- apiPath := path.Join(projectBasePath, projectID, "devices", "batch")
-
- batches := new(batchesList)
- resp, err := s.client.DoRequest("POST", apiPath, request, batches)
-
- if err != nil {
- return nil, resp, err
- }
-
- return batches.Batches, resp, err
-}
-
-// Delete function to remove an instance batch
-func (s *BatchServiceOp) Delete(id string, removeDevices bool) (*Response, error) {
- if validateErr := ValidateUUID(id); validateErr != nil {
- return nil, validateErr
- }
- // API doc days the remove_associated_instances params shout be in the body
- // https://metal.equinix.com/developers/api/batches/#delete-the-batch
- // .. does this even work?
- apiPath := fmt.Sprintf("%s/%s?remove_associated_instances=%t", batchBasePath, id, removeDevices)
-
- return s.client.DoRequest("DELETE", apiPath, nil, nil)
-}
diff --git a/vendor/github.com/packethost/packngo/bgp_configs.go b/vendor/github.com/packethost/packngo/bgp_configs.go
deleted file mode 100644
index c6929b51..00000000
--- a/vendor/github.com/packethost/packngo/bgp_configs.go
+++ /dev/null
@@ -1,94 +0,0 @@
-package packngo
-
-import (
- "path"
-)
-
-var (
- bgpConfigPostBasePath = "/bgp-configs"
- bgpConfigGetBasePath = "/bgp-config"
-)
-
-// BGPConfigService interface defines available BGP config methods
-type BGPConfigService interface {
- Get(projectID string, getOpt *GetOptions) (*BGPConfig, *Response, error)
- Create(projectID string, request CreateBGPConfigRequest) (*Response, error)
- // Delete(configID string) (resp *Response, err error) TODO: Not in Equinix Metal API
-}
-
-// BGPConfigServiceOp implements BgpConfigService
-type BGPConfigServiceOp struct {
- client *Client
-}
-
-// CreateBGPConfigRequest struct
-type CreateBGPConfigRequest struct {
- DeploymentType string `json:"deployment_type,omitempty"`
- Asn int `json:"asn,omitempty"`
- Md5 string `json:"md5,omitempty"`
- UseCase string `json:"use_case,omitempty"`
-}
-
-// BGPConfig represents an Equinix Metal BGP Config
-type BGPConfig struct {
- ID string `json:"id,omitempty"`
- Status string `json:"status,omitempty"`
- DeploymentType string `json:"deployment_type,omitempty"`
- Asn int `json:"asn,omitempty"`
- RouteObject string `json:"route_object,omitempty"`
- Md5 string `json:"md5,omitempty"`
- MaxPrefix int `json:"max_prefix,omitempty"`
- Project Project `json:"project,omitempty"`
- CreatedAt Timestamp `json:"created_at,omitempty"`
- RequestedAt Timestamp `json:"requested_at,omitempty"`
- Sessions []BGPSession `json:"sessions,omitempty"`
- Href string `json:"href,omitempty"`
-}
-
-// Create function
-func (s *BGPConfigServiceOp) Create(projectID string, request CreateBGPConfigRequest) (*Response, error) {
- if validateErr := ValidateUUID(projectID); validateErr != nil {
- return nil, validateErr
- }
- apiPath := path.Join(projectBasePath, projectID, bgpConfigPostBasePath)
-
- resp, err := s.client.DoRequest("POST", apiPath, request, nil)
- if err != nil {
- return resp, err
- }
-
- return resp, err
-}
-
-// Get function
-func (s *BGPConfigServiceOp) Get(projectID string, opts *GetOptions) (bgpConfig *BGPConfig, resp *Response, err error) {
- if validateErr := ValidateUUID(projectID); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(projectBasePath, projectID, bgpConfigGetBasePath)
- apiPathQuery := opts.WithQuery(endpointPath)
-
- subset := new(BGPConfig)
-
- resp, err = s.client.DoRequest("GET", apiPathQuery, nil, subset)
- if err != nil {
- return nil, resp, err
- }
-
- return subset, resp, err
-}
-
-// Delete function TODO: this is not implemented in the Equinix Metal API
-// func (s *BGPConfigServiceOp) Delete(configID string) (resp *Response, err error) {
-// if validateErr := ValidateUUID(configID); validateErr != nil {
-// return nil, validateErr
-// }
-// apiPath := fmt.Sprintf("%ss/%s", bgpConfigBasePath, configID)
-
-// resp, err = s.client.DoRequest("DELETE", apiPath, nil, nil)
-// if err != nil {
-// return resp, err
-// }
-
-// return resp, err
-// }
diff --git a/vendor/github.com/packethost/packngo/bgp_sessions.go b/vendor/github.com/packethost/packngo/bgp_sessions.go
deleted file mode 100644
index 69be6d34..00000000
--- a/vendor/github.com/packethost/packngo/bgp_sessions.go
+++ /dev/null
@@ -1,131 +0,0 @@
-package packngo
-
-import (
- "path"
-)
-
-var bgpSessionBasePath = "/bgp/sessions"
-var bgpNeighborsBasePath = "/bgp/neighbors"
-var bgpDiscoverBasePath = "/bgp/discover"
-
-// BGPSessionService interface defines available BGP session methods
-type BGPSessionService interface {
- Get(string, *GetOptions) (*BGPSession, *Response, error)
- Create(string, CreateBGPSessionRequest) (*BGPSession, *Response, error)
- Update(string, UpdateBGPSessionRequest) (*BGPSession, *Response, error)
- Delete(string) (*Response, error)
-}
-
-type bgpSessionsRoot struct {
- Sessions []BGPSession `json:"bgp_sessions"`
- Meta meta `json:"meta"`
-}
-
-// BGPSessionServiceOp implements BgpSessionService
-type BGPSessionServiceOp struct {
- client *Client
-}
-
-// BGPSession represents an Equinix Metal BGP Session
-type BGPSession struct {
- ID string `json:"id,omitempty"`
- Status string `json:"status,omitempty"`
- LearnedRoutes []string `json:"learned_routes,omitempty"`
- AddressFamily string `json:"address_family,omitempty"`
- Device Device `json:"device,omitempty"`
- Href string `json:"href,omitempty"`
- DefaultRoute *bool `json:"default_route,omitempty"`
-}
-
-type bgpNeighborsRoot struct {
- BGPNeighbors []BGPNeighbor `json:"bgp_neighbors"`
-}
-
-// BGPNeighor is struct for listing BGP neighbors of a device
-type BGPNeighbor struct {
- AddressFamily int `json:"address_family"`
- CustomerAs int `json:"customer_as"`
- CustomerIP string `json:"customer_ip"`
- Md5Enabled bool `json:"md5_enabled"`
- Md5Password string `json:"md5_password"`
- Multihop bool `json:"multihop"`
- PeerAs int `json:"peer_as"`
- PeerIps []string `json:"peer_ips"`
- RoutesIn []BGPRoute `json:"routes_in"`
- RoutesOut []BGPRoute `json:"routes_out"`
-}
-
-// BGPRoute is a struct for Route in BGP neighbor listing
-type BGPRoute struct {
- Route string `json:"route"`
- Exact bool `json:"exact"`
-}
-
-// CreateBGPSessionRequest struct
-type CreateBGPSessionRequest struct {
- AddressFamily string `json:"address_family"`
- DefaultRoute *bool `json:"default_route,omitempty"`
-}
-
-// UpdateBGPSessionRequest struct
-type UpdateBGPSessionRequest struct {
- DefaultRoute bool `json:"default_route"`
-}
-
-// Create function
-func (s *BGPSessionServiceOp) Create(deviceID string, request CreateBGPSessionRequest) (*BGPSession, *Response, error) {
- if validateErr := ValidateUUID(deviceID); validateErr != nil {
- return nil, nil, validateErr
- }
- apiPath := path.Join(deviceBasePath, deviceID, bgpSessionBasePath)
- session := new(BGPSession)
-
- resp, err := s.client.DoRequest("POST", apiPath, request, session)
- if err != nil {
- return nil, resp, err
- }
-
- return session, resp, err
-}
-
-// Update function
-func (s *BGPSessionServiceOp) Update(sessionID string, request UpdateBGPSessionRequest) (*BGPSession, *Response, error) {
- if validateErr := ValidateUUID(sessionID); validateErr != nil {
- return nil, nil, validateErr
- }
- apiPath := path.Join(bgpSessionBasePath, sessionID)
- session := new(BGPSession)
-
- resp, err := s.client.DoRequest("PUT", apiPath, request, session)
- if err != nil {
- return nil, resp, err
- }
-
- return session, resp, err
-}
-
-// Delete function
-func (s *BGPSessionServiceOp) Delete(id string) (*Response, error) {
- if validateErr := ValidateUUID(id); validateErr != nil {
- return nil, validateErr
- }
- apiPath := path.Join(bgpSessionBasePath, id)
-
- return s.client.DoRequest("DELETE", apiPath, nil, nil)
-}
-
-// Get function
-func (s *BGPSessionServiceOp) Get(id string, opts *GetOptions) (session *BGPSession, response *Response, err error) {
- if validateErr := ValidateUUID(id); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(bgpSessionBasePath, id)
- apiPathQuery := opts.WithQuery(endpointPath)
- session = new(BGPSession)
- response, err = s.client.DoRequest("GET", apiPathQuery, nil, session)
- if err != nil {
- return nil, response, err
- }
-
- return session, response, err
-}
diff --git a/vendor/github.com/packethost/packngo/billing_address.go b/vendor/github.com/packethost/packngo/billing_address.go
deleted file mode 100644
index 93255b32..00000000
--- a/vendor/github.com/packethost/packngo/billing_address.go
+++ /dev/null
@@ -1,7 +0,0 @@
-package packngo
-
-type BillingAddress struct {
- StreetAddress string `json:"street_address,omitempty"`
- PostalCode string `json:"postal_code,omitempty"`
- CountryCode string `json:"country_code_alpha2,omitempty"`
-}
diff --git a/vendor/github.com/packethost/packngo/capacities.go b/vendor/github.com/packethost/packngo/capacities.go
deleted file mode 100644
index 45ffac60..00000000
--- a/vendor/github.com/packethost/packngo/capacities.go
+++ /dev/null
@@ -1,103 +0,0 @@
-package packngo
-
-const (
- capacityBasePath = "/capacity"
- capacityBasePathMetros = "/capacity/metros"
-)
-
-// CapacityService interface defines available capacity methods
-type CapacityService interface {
- List() (*CapacityReport, *Response, error)
- ListMetros() (*CapacityReport, *Response, error)
- Check(*CapacityInput) (*CapacityInput, *Response, error)
- CheckMetros(*CapacityInput) (*CapacityInput, *Response, error)
-}
-
-// CapacityInput struct
-type CapacityInput struct {
- Servers []ServerInfo `json:"servers,omitempty"`
-}
-
-// ServerInfo struct
-type ServerInfo struct {
- Facility string `json:"facility,omitempty"`
- Metro string `json:"metro,omitempty"`
- Plan string `json:"plan,omitempty"`
- Quantity int `json:"quantity,omitempty"`
- Available bool `json:"available,omitempty"`
-}
-
-type capacityRoot struct {
- Capacity CapacityReport `json:"capacity,omitempty"`
-}
-
-// CapacityReport map
-type CapacityReport map[string]map[string]CapacityPerBaremetal
-
-// // CapacityPerFacility struct
-// type CapacityPerFacility struct {
-// T1SmallX86 *CapacityPerBaremetal `json:"t1.small.x86,omitempty"`
-// C1SmallX86 *CapacityPerBaremetal `json:"c1.small.x86,omitempty"`
-// M1XlargeX86 *CapacityPerBaremetal `json:"m1.xlarge.x86,omitempty"`
-// C1XlargeX86 *CapacityPerBaremetal `json:"c1.xlarge.x86,omitempty"`
-
-// Baremetal0 *CapacityPerBaremetal `json:"baremetal_0,omitempty"`
-// Baremetal1 *CapacityPerBaremetal `json:"baremetal_1,omitempty"`
-// Baremetal1e *CapacityPerBaremetal `json:"baremetal_1e,omitempty"`
-// Baremetal2 *CapacityPerBaremetal `json:"baremetal_2,omitempty"`
-// Baremetal2a *CapacityPerBaremetal `json:"baremetal_2a,omitempty"`
-// Baremetal2a2 *CapacityPerBaremetal `json:"baremetal_2a2,omitempty"`
-// Baremetal3 *CapacityPerBaremetal `json:"baremetal_3,omitempty"`
-// }
-
-// CapacityPerBaremetal struct
-type CapacityPerBaremetal struct {
- Level string `json:"level,omitempty"`
-}
-
-// CapacityList struct
-type CapacityList struct {
- Capacity CapacityReport `json:"capacity,omitempty"`
-}
-
-// CapacityServiceOp implements CapacityService
-type CapacityServiceOp struct {
- client *Client
-}
-
-func capacityList(client *Client, capUrl string) (*CapacityReport, *Response, error) {
- root := new(capacityRoot)
-
- resp, err := client.DoRequest("GET", capUrl, nil, root)
- if err != nil {
- return nil, resp, err
- }
-
- return &root.Capacity, nil, nil
-}
-
-// List returns a list of facilities and plans with their current capacity.
-func (s *CapacityServiceOp) List() (*CapacityReport, *Response, error) {
- return capacityList(s.client, capacityBasePath)
-}
-
-// ListMetros returns a list of metros and plans with their current capacity.
-func (s *CapacityServiceOp) ListMetros() (*CapacityReport, *Response, error) {
- return capacityList(s.client, capacityBasePathMetros)
-}
-
-func checkCapacity(client *Client, input *CapacityInput, capUrl string) (capInput *CapacityInput, resp *Response, err error) {
- capInput = new(CapacityInput)
- resp, err = client.DoRequest("POST", capUrl, input, capInput)
- return capInput, resp, err
-}
-
-// Check validates if a deploy can be fulfilled in a capacity.
-func (s *CapacityServiceOp) Check(input *CapacityInput) (capInput *CapacityInput, resp *Response, err error) {
- return checkCapacity(s.client, input, capacityBasePath)
-}
-
-// Check validates if a deploy can be fulfilled in a metro.
-func (s *CapacityServiceOp) CheckMetros(input *CapacityInput) (capInput *CapacityInput, resp *Response, err error) {
- return checkCapacity(s.client, input, capacityBasePathMetros)
-}
diff --git a/vendor/github.com/packethost/packngo/clientopt.go b/vendor/github.com/packethost/packngo/clientopt.go
deleted file mode 100644
index 11096ab6..00000000
--- a/vendor/github.com/packethost/packngo/clientopt.go
+++ /dev/null
@@ -1,55 +0,0 @@
-package packngo
-
-import (
- "net/http"
- "net/url"
-)
-
-// ClientOpt is an option usable as an argument to NewClient constructor.
-type ClientOpt func(*Client) error
-
-// WithAuth configures Client with a specific consumerToken and apiKey for subsequent HTTP requests.
-func WithAuth(consumerToken string, apiKey string) ClientOpt {
- return func(c *Client) error {
- c.ConsumerToken = consumerToken
- c.APIKey = apiKey
- c.apiKeySet = true
-
- return nil
- }
-}
-
-// WithHTTPClient configures Client to use a specific httpClient for subsequent HTTP requests.
-func WithHTTPClient(httpClient *http.Client) ClientOpt {
- return func(c *Client) error {
- c.client = httpClient
-
- return nil
- }
-}
-
-// WithBaseURL configures Client to use a nonstandard API URL, e.g. for mocking the remote API.
-func WithBaseURL(apiBaseURL string) ClientOpt {
- return func(c *Client) error {
- u, err := url.Parse(apiBaseURL)
- if err != nil {
- return err
- }
-
- c.BaseURL = u
-
- return nil
- }
-}
-
-// WithHeader configures Client to use the given HTTP header set.
-// The headers X-Auth-Token, X-Consumer-Token, User-Agent will be ignored even if provided in the set.
-func WithHeader(header http.Header) ClientOpt {
- return func(c *Client) error {
- for k, v := range header {
- c.header[k] = v
- }
-
- return nil
- }
-}
diff --git a/vendor/github.com/packethost/packngo/code-of-conduct.md b/vendor/github.com/packethost/packngo/code-of-conduct.md
deleted file mode 100644
index 3a14e528..00000000
--- a/vendor/github.com/packethost/packngo/code-of-conduct.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# Code Of Conduct
-
-Please refer to the [Contributor Covenant](https://www.contributor-covenant.org/version/1/2/0/code-of-conduct/).
diff --git a/vendor/github.com/packethost/packngo/connections.go b/vendor/github.com/packethost/packngo/connections.go
deleted file mode 100644
index bba8d74d..00000000
--- a/vendor/github.com/packethost/packngo/connections.go
+++ /dev/null
@@ -1,331 +0,0 @@
-package packngo
-
-import (
- "errors"
- "fmt"
- "path"
- "time"
-)
-
-type ConnectionRedundancy string
-type ConnectionType string
-type ConnectionPortRole string
-type ConnectionMode string
-
-const (
- connectionBasePath = "/connections"
- ConnectionShared ConnectionType = "shared"
- ConnectionDedicated ConnectionType = "dedicated"
- ConnectionRedundant ConnectionRedundancy = "redundant"
- ConnectionPrimary ConnectionRedundancy = "primary"
- ConnectionPortPrimary ConnectionPortRole = "primary"
- ConnectionPortSecondary ConnectionPortRole = "secondary"
- ConnectionModeStandard ConnectionMode = "standard"
- ConnectionModeTunnel ConnectionMode = "tunnel"
- ConnectionDeleteTimeout = 60 * time.Second
- ConnectionDeleteCheck = 2 * time.Second
-)
-
-type ConnectionService interface {
- OrganizationCreate(string, *ConnectionCreateRequest) (*Connection, *Response, error)
- ProjectCreate(string, *ConnectionCreateRequest) (*Connection, *Response, error)
- Update(string, *ConnectionUpdateRequest, *GetOptions) (*Connection, *Response, error)
- OrganizationList(string, *GetOptions) ([]Connection, *Response, error)
- ProjectList(string, *GetOptions) ([]Connection, *Response, error)
- Delete(string, bool) (*Response, error)
- Get(string, *GetOptions) (*Connection, *Response, error)
- Events(string, *GetOptions) ([]Event, *Response, error)
- PortEvents(string, string, *GetOptions) ([]Event, *Response, error)
- Ports(string, *GetOptions) ([]ConnectionPort, *Response, error)
- Port(string, string, *GetOptions) (*ConnectionPort, *Response, error)
- VirtualCircuits(string, string, *GetOptions) ([]VirtualCircuit, *Response, error)
-}
-
-type ConnectionServiceOp struct {
- client *Client
-}
-
-type connectionPortsRoot struct {
- Ports []ConnectionPort `json:"ports"`
-}
-
-type connectionsRoot struct {
- Connections []Connection `json:"interconnections"`
- Meta meta `json:"meta"`
-}
-
-type ConnectionPort struct {
- *Href `json:",inline"`
- ID string `json:"id"`
- LinkStatus string `json:"link_status,omitempty"`
- Name string `json:"name,omitempty"`
- Organization *Organization `json:"organization,omitempty"`
- Role ConnectionPortRole `json:"role,omitempty"`
- // Speed is the maximum allowed throughput. This value inherits changes made in the Equinix Fabric API.
- Speed uint64 `json:"speed,omitempty"`
- Status string `json:"status,omitempty"`
- Tokens []FabricServiceToken `json:"tokens,omitempty"`
- VirtualCircuits []VirtualCircuit `json:"virtual_circuits,omitempty"`
-}
-
-type Connection struct {
- ID string `json:"id"`
- ContactEmail string `json:"contact_email,omitempty"`
- Name string `json:"name,omitempty"`
- Status string `json:"status,omitempty"`
- Redundancy ConnectionRedundancy `json:"redundancy,omitempty"`
- Facility *Facility `json:"facility,omitempty"`
- Metro *Metro `json:"metro,omitempty"`
- Type ConnectionType `json:"type,omitempty"`
- Mode *ConnectionMode `json:"mode,omitempty"`
- Description string `json:"description,omitempty"`
- Project *Project `json:"project,omitempty"`
- Organization *Organization `json:"organization,omitempty"`
- Speed uint64 `json:"speed,omitempty"`
- Token string `json:"token,omitempty"`
- Tokens []FabricServiceToken `json:"service_tokens,omitempty"`
- Tags []string `json:"tags,omitempty"`
- Ports []ConnectionPort `json:"ports,omitempty"`
- ServiceTokenType string `json:"service_token_type,omitempty"`
-}
-
-type ConnectionCreateRequest struct {
- ContactEmail string `json:"contact_email,omitempty"`
- Description *string `json:"description,omitempty"`
- Facility string `json:"facility,omitempty"`
- Metro string `json:"metro,omitempty"`
- Mode ConnectionMode `json:"mode,omitempty"`
- Name string `json:"name,omitempty"`
- Project string `json:"project,omitempty"`
- Redundancy ConnectionRedundancy `json:"redundancy,omitempty"`
- ServiceTokenType FabricServiceTokenType `json:"service_token_type,omitempty"`
- Speed uint64 `json:"speed,omitempty"`
- Tags []string `json:"tags,omitempty"`
- Type ConnectionType `json:"type,omitempty"`
- VLANs []int `json:"vlans,omitempty"`
-}
-
-type ConnectionUpdateRequest struct {
- Redundancy ConnectionRedundancy `json:"redundancy,omitempty"`
- Mode *ConnectionMode `json:"mode,omitempty"`
- Description *string `json:"description,omitempty"`
- Tags []string `json:"tags,omitempty"`
-}
-
-func (c *Connection) PortByRole(r ConnectionPortRole) *ConnectionPort {
- for _, p := range c.Ports {
- if p.Role == r {
- return &p
- }
- }
- return nil
-}
-
-func (s *ConnectionServiceOp) create(apiUrl string, createRequest *ConnectionCreateRequest) (*Connection, *Response, error) {
- connection := new(Connection)
- resp, err := s.client.DoRequest("POST", apiUrl, createRequest, connection)
- if err != nil {
- return nil, resp, err
- }
-
- return connection, resp, err
-}
-
-func (s *ConnectionServiceOp) OrganizationCreate(id string, createRequest *ConnectionCreateRequest) (*Connection, *Response, error) {
- if validateErr := ValidateUUID(id); validateErr != nil {
- return nil, nil, validateErr
- }
- apiUrl := path.Join(organizationBasePath, id, connectionBasePath)
- return s.create(apiUrl, createRequest)
-}
-
-func (s *ConnectionServiceOp) ProjectCreate(id string, createRequest *ConnectionCreateRequest) (*Connection, *Response, error) {
- if validateErr := ValidateUUID(id); validateErr != nil {
- return nil, nil, validateErr
- }
- apiUrl := path.Join(projectBasePath, id, connectionBasePath)
- return s.create(apiUrl, createRequest)
-}
-
-func (s *ConnectionServiceOp) list(url string, opts *GetOptions) (connections []Connection, resp *Response, err error) {
- apiPathQuery := opts.WithQuery(url)
-
- for {
- subset := new(connectionsRoot)
-
- resp, err = s.client.DoRequest("GET", apiPathQuery, nil, subset)
- if err != nil {
- return nil, resp, err
- }
-
- connections = append(connections, subset.Connections...)
-
- if apiPathQuery = nextPage(subset.Meta, opts); apiPathQuery != "" {
- continue
- }
-
- return
- }
-
-}
-
-func (s *ConnectionServiceOp) OrganizationList(id string, opts *GetOptions) ([]Connection, *Response, error) {
- if validateErr := ValidateUUID(id); validateErr != nil {
- return nil, nil, validateErr
- }
- apiUrl := path.Join(organizationBasePath, id, connectionBasePath)
- return s.list(apiUrl, opts)
-}
-
-func (s *ConnectionServiceOp) ProjectList(id string, opts *GetOptions) ([]Connection, *Response, error) {
- if validateErr := ValidateUUID(id); validateErr != nil {
- return nil, nil, validateErr
- }
- apiUrl := path.Join(projectBasePath, id, connectionBasePath)
- return s.list(apiUrl, opts)
-}
-
-func (s *ConnectionServiceOp) Delete(id string, wait bool) (*Response, error) {
- if validateErr := ValidateUUID(id); validateErr != nil {
- return nil, validateErr
- }
- apiPath := path.Join(connectionBasePath, id)
- connection := new(Connection)
-
- resp, err := s.client.DoRequest("DELETE", apiPath, nil, connection)
- if err != nil {
- return resp, err
- }
- // We really miss context here.
- if wait {
- timeout := time.After(ConnectionDeleteTimeout)
- //ticker := time.Tick(ConnectionDeleteCheck)
- ticker := time.NewTicker(ConnectionDeleteCheck)
- for {
- select {
- case <-ticker.C:
- c, resp2, err := s.Get(id, nil)
- if resp2.StatusCode == 404 {
- // Connection has been deleted
- return resp, nil
- }
- if err != nil {
- return resp, err
- }
- if c.Status != "deleting" {
- return resp, fmt.Errorf("Connection %s is in undexpected state %s", id, c.Status)
- }
- case <-timeout:
- return resp, errors.New("Timeout waiting for connection to be deleted")
- }
- }
- }
- return resp, nil
-}
-
-func (s *ConnectionServiceOp) Port(connID, portID string, opts *GetOptions) (*ConnectionPort, *Response, error) {
- if validateErr := ValidateUUID(connID); validateErr != nil {
- return nil, nil, validateErr
- }
- if validateErr := ValidateUUID(portID); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(connectionBasePath, connID, portBasePath, portID)
- apiPathQuery := opts.WithQuery(endpointPath)
- port := new(ConnectionPort)
- resp, err := s.client.DoRequest("GET", apiPathQuery, nil, port)
- if err != nil {
- return nil, resp, err
- }
- return port, resp, err
-}
-
-func (s *ConnectionServiceOp) Get(id string, opts *GetOptions) (*Connection, *Response, error) {
- if validateErr := ValidateUUID(id); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(connectionBasePath, id)
- apiPathQuery := opts.WithQuery(endpointPath)
- connection := new(Connection)
- resp, err := s.client.DoRequest("GET", apiPathQuery, nil, connection)
- if err != nil {
- return nil, resp, err
- }
- return connection, resp, err
-}
-
-func (s *ConnectionServiceOp) Update(id string, updateRequest *ConnectionUpdateRequest, opts *GetOptions) (*Connection, *Response, error) {
- if validateErr := ValidateUUID(id); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(connectionBasePath, id)
- apiPathQuery := opts.WithQuery(endpointPath)
- connection := new(Connection)
- resp, err := s.client.DoRequest("PUT", apiPathQuery, updateRequest, connection)
- if err != nil {
- return nil, resp, err
- }
-
- return connection, resp, err
-}
-
-func (s *ConnectionServiceOp) Ports(connID string, opts *GetOptions) ([]ConnectionPort, *Response, error) {
- if validateErr := ValidateUUID(connID); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(connectionBasePath, connID, portBasePath)
- apiPathQuery := opts.WithQuery(endpointPath)
- ports := new(connectionPortsRoot)
- resp, err := s.client.DoRequest("GET", apiPathQuery, nil, ports)
- if err != nil {
- return nil, resp, err
- }
- return ports.Ports, resp, nil
-
-}
-
-func (s *ConnectionServiceOp) Events(id string, opts *GetOptions) ([]Event, *Response, error) {
- if validateErr := ValidateUUID(id); validateErr != nil {
- return nil, nil, validateErr
- }
- apiPath := path.Join(connectionBasePath, id, eventBasePath)
- return listEvents(s.client, apiPath, opts)
-}
-
-func (s *ConnectionServiceOp) PortEvents(connID, portID string, opts *GetOptions) ([]Event, *Response, error) {
- if validateErr := ValidateUUID(connID); validateErr != nil {
- return nil, nil, validateErr
- }
- if validateErr := ValidateUUID(portID); validateErr != nil {
- return nil, nil, validateErr
- }
- apiPath := path.Join(connectionBasePath, connID, portBasePath, portID, eventBasePath)
- return listEvents(s.client, apiPath, opts)
-}
-
-func (s *ConnectionServiceOp) VirtualCircuits(connID, portID string, opts *GetOptions) (vcs []VirtualCircuit, resp *Response, err error) {
- if validateErr := ValidateUUID(connID); validateErr != nil {
- return nil, nil, validateErr
- }
- if validateErr := ValidateUUID(portID); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(connectionBasePath, connID, portBasePath, portID, virtualCircuitBasePath)
- apiPathQuery := opts.WithQuery(endpointPath)
- for {
- subset := new(virtualCircuitsRoot)
-
- resp, err = s.client.DoRequest("GET", apiPathQuery, nil, subset)
- if err != nil {
- return nil, resp, err
- }
-
- vcs = append(vcs, subset.VirtualCircuits...)
-
- if apiPathQuery = nextPage(subset.Meta, opts); apiPathQuery != "" {
- continue
- }
-
- return
- }
-}
diff --git a/vendor/github.com/packethost/packngo/device_ports.go b/vendor/github.com/packethost/packngo/device_ports.go
deleted file mode 100644
index 026e0ad8..00000000
--- a/vendor/github.com/packethost/packngo/device_ports.go
+++ /dev/null
@@ -1,332 +0,0 @@
-package packngo
-
-import (
- "fmt"
- "strings"
-)
-
-const portBasePath = "/ports"
-
-// DevicePortService handles operations on a port which belongs to a particular device
-//
-// Deprecated: use PortService or Device methods
-type DevicePortService interface {
- Assign(*PortAssignRequest) (*Port, *Response, error)
- Unassign(*PortAssignRequest) (*Port, *Response, error)
- AssignNative(*PortAssignRequest) (*Port, *Response, error)
- UnassignNative(string) (*Port, *Response, error)
- Bond(*Port, bool) (*Port, *Response, error)
- Disbond(*Port, bool) (*Port, *Response, error)
- DeviceToNetworkType(string, string) (*Device, error)
- DeviceNetworkType(string) (string, error)
- PortToLayerTwo(string, string) (*Port, *Response, error)
- PortToLayerThree(string, string) (*Port, *Response, error)
- GetPortByName(string, string) (*Port, error)
- GetOddEthPorts(*Device) (map[string]*Port, error)
- GetAllEthPorts(*Device) (map[string]*Port, error)
- ConvertDevice(*Device, string) error
-}
-
-// DevicePortServiceOp implements DevicePortService on the Equinix Metal API
-//
-// Deprecated: use PortServiceOp or Device methods
-type DevicePortServiceOp struct {
- client *Client
-}
-
-// GetPortByName returns the matching Port on the specified device
-//
-// Deprecated: use Device.GetPortByName
-func (i *DevicePortServiceOp) GetPortByName(deviceID, name string) (*Port, error) {
- device, _, err := i.client.Devices.Get(deviceID, nil)
- if err != nil {
- return nil, err
- }
- return device.GetPortByName(name)
-}
-
-// Assign the specified VLAN to the specified Port
-//
-// Deprecated: use PortServiceOp.Assign
-func (i *DevicePortServiceOp) Assign(par *PortAssignRequest) (*Port, *Response, error) {
- return i.client.Ports.Assign(par.PortID, par.VirtualNetworkID)
-}
-
-// AssignNative designates the specified VLAN as the native VLAN for the
-// specified Port
-//
-// Deprecated: use PortServiceOp.AssignNative
-func (i *DevicePortServiceOp) AssignNative(par *PortAssignRequest) (*Port, *Response, error) {
- return i.client.Ports.AssignNative(par.PortID, par.VirtualNetworkID)
-}
-
-// UnassignNative removes the native VLAN from the specified Port
-//
-// Deprecated: use PortServiceOp.UnassignNative
-func (i *DevicePortServiceOp) UnassignNative(portID string) (*Port, *Response, error) {
- if validateErr := ValidateUUID(portID); validateErr != nil {
- return nil, nil, validateErr
- }
- return i.client.Ports.UnassignNative(portID)
-}
-
-// Unassign removes the specified VLAN from the specified Port
-//
-// Deprecated: use PortServiceOp.Unassign
-func (i *DevicePortServiceOp) Unassign(par *PortAssignRequest) (*Port, *Response, error) {
- return i.client.Ports.Unassign(par.PortID, par.VirtualNetworkID)
-}
-
-// Bond enabled bonding on the specified port
-//
-// Deprecated: use PortServiceOp.Bond
-func (i *DevicePortServiceOp) Bond(p *Port, bulk_enable bool) (*Port, *Response, error) {
- if p.Data.Bonded {
- return p, nil, nil
- }
-
- return i.client.Ports.Bond(p.ID, bulk_enable)
-}
-
-// Disbond disables bonding on the specified port
-//
-// Deprecated: use PortServiceOp.Disbond
-func (i *DevicePortServiceOp) Disbond(p *Port, bulk_disable bool) (*Port, *Response, error) {
- if !p.Data.Bonded {
- return p, nil, nil
- }
- return i.client.Ports.Disbond(p.ID, bulk_disable)
-}
-
-// PortToLayerTwo fetches the specified device, finds the matching port by name,
-// and converts it to layer2. A port may already be in a layer2 mode, in which
-// case the port will be returned with a nil response and nil error with no
-// additional action taking place.
-//
-// Deprecated: use PortServiceOp.ConvertToLayerTwo
-func (i *DevicePortServiceOp) PortToLayerTwo(deviceID, portName string) (*Port, *Response, error) {
- p, err := i.GetPortByName(deviceID, portName)
- if err != nil {
- return nil, nil, err
- }
- if strings.HasPrefix(p.NetworkType, "layer2") {
- return p, nil, nil
- }
-
- return i.client.Ports.ConvertToLayerTwo(p.ID)
-}
-
-// PortToLayerThree fetches the specified device, finds the matching port by
-// name, and converts it to layer3. A port may already be in a layer3 mode, in
-// which case the port will be returned with a nil response and nil error with
-// no additional action taking place.
-//
-// When switching to Layer3, a new set of IP addresses will be requested
-// including Public IPv4, Public IPv6, and Private IPv6 addresses.
-//
-// Deprecated: use PortServiceOp.ConvertToLayerTwo
-func (i *DevicePortServiceOp) PortToLayerThree(deviceID, portName string) (*Port, *Response, error) {
- p, err := i.GetPortByName(deviceID, portName)
- if err != nil {
- return nil, nil, err
- }
- if (p.NetworkType == NetworkTypeL3) || (p.NetworkType == NetworkTypeHybrid) {
- return p, nil, nil
- }
-
- ips := []AddressRequest{
- {AddressFamily: 4, Public: true},
- {AddressFamily: 4, Public: false},
- {AddressFamily: 6, Public: true},
- }
-
- return i.client.Ports.ConvertToLayerThree(p.ID, ips)
-}
-
-// DeviceNetworkType fetches the specified Device and returns a heuristic single
-// word network type consistent with the Equinix Metal console experience.
-//
-// Deprecated: use Device.GetNetworkType
-func (i *DevicePortServiceOp) DeviceNetworkType(deviceID string) (string, error) {
- if validateErr := ValidateUUID(deviceID); validateErr != nil {
- return "", validateErr
- }
- d, _, err := i.client.Devices.Get(deviceID, nil)
- if err != nil {
- return "", err
- }
- return d.GetNetworkType(), nil
-}
-
-// GetAllEthPorts fetches the specified Device and returns a heuristic single
-// word network type consistent with the Equinix Metal console experience.
-//
-// Deprecated: use Device.GetPhysicalPorts
-func (i *DevicePortServiceOp) GetAllEthPorts(d *Device) (map[string]*Port, error) {
- d, _, err := i.client.Devices.Get(d.ID, nil)
- if err != nil {
- return nil, err
- }
- return d.GetPhysicalPorts(), nil
-}
-
-// GetOddEthPorts fetches the specified Device and returns physical
-// ports eth1 and eth3.
-//
-// Deprecated: use Device.GetPhysicalPorts and filter the map to only the keys
-// ending with odd digits
-func (i *DevicePortServiceOp) GetOddEthPorts(d *Device) (map[string]*Port, error) {
- d, _, err := i.client.Devices.Get(d.ID, nil)
- if err != nil {
- return nil, err
- }
- ret := map[string]*Port{}
- eth1, err := d.GetPortByName("eth1")
- if err != nil {
- return nil, err
- }
- ret["eth1"] = eth1
-
- eth3, err := d.GetPortByName("eth3")
- if err != nil {
- return ret, nil
- }
- ret["eth3"] = eth3
- return ret, nil
-
-}
-
-// ConvertDevice converts the specified device's network ports (including
-// addresses and vlans) to the named network type, consistent with the Equinix
-// Metal console experience.
-//
-// Deprecated: Equinix Metal devices may support more than two ports and the
-// whole-device single word network type can no longer capture the capabilities
-// and permutations of device port configurations.
-func (i *DevicePortServiceOp) ConvertDevice(d *Device, targetType string) error {
- bondPorts := d.GetBondPorts()
-
- if targetType == NetworkTypeL3 {
- // TODO: remove vlans from all the ports
- for _, p := range bondPorts {
- _, _, err := i.Bond(p, false)
- if err != nil {
- return err
- }
- }
- _, _, err := i.PortToLayerThree(d.ID, "bond0")
- if err != nil {
- return err
- }
- allEthPorts, err := i.GetAllEthPorts(d)
- if err != nil {
- return err
- }
- for _, p := range allEthPorts {
- _, _, err := i.Bond(p, false)
- if err != nil {
- return err
- }
- }
- }
- if targetType == NetworkTypeHybrid {
- for _, p := range bondPorts {
- _, _, err := i.Bond(p, false)
- if err != nil {
- return err
- }
- }
-
- _, _, err := i.PortToLayerThree(d.ID, "bond0")
- if err != nil {
- return err
- }
-
- // ports need to be refreshed before bonding/disbonding
- oddEthPorts, err := i.GetOddEthPorts(d)
- if err != nil {
- return err
- }
-
- for _, p := range oddEthPorts {
- _, _, err := i.Disbond(p, false)
- if err != nil {
- return err
- }
- }
- }
- if targetType == NetworkTypeL2Individual {
- _, _, err := i.PortToLayerTwo(d.ID, "bond0")
- if err != nil {
- return err
- }
- for _, p := range bondPorts {
- _, _, err = i.Disbond(p, true)
- if err != nil {
- return err
- }
- }
- }
- if targetType == NetworkTypeL2Bonded {
-
- for _, p := range bondPorts {
- _, _, err := i.PortToLayerTwo(d.ID, p.Name)
- if err != nil {
- return err
- }
- }
- allEthPorts, err := i.GetAllEthPorts(d)
- if err != nil {
- return err
- }
- for _, p := range allEthPorts {
- _, _, err := i.Bond(p, false)
- if err != nil {
- return err
- }
- }
- }
- return nil
-}
-
-// DeviceToNetworkType fetches the specified device and converts its network
-// ports (including addresses and vlans) to the named network type, consistent
-// with the Equinix Metal console experience.
-//
-// Deprecated: use DevicePortServiceOp.ConvertDevice which this function thinly
-// wraps.
-func (i *DevicePortServiceOp) DeviceToNetworkType(deviceID string, targetType string) (*Device, error) {
- if validateErr := ValidateUUID(deviceID); validateErr != nil {
- return nil, validateErr
- }
- d, _, err := i.client.Devices.Get(deviceID, nil)
- if err != nil {
- return nil, err
- }
-
- curType := d.GetNetworkType()
-
- if curType == targetType {
- return nil, fmt.Errorf("Device already is in state %s", targetType)
- }
- err = i.ConvertDevice(d, targetType)
- if err != nil {
- return nil, err
- }
-
- d, _, err = i.client.Devices.Get(deviceID, nil)
-
- if err != nil {
- return nil, err
- }
-
- finalType := d.GetNetworkType()
-
- if finalType != targetType {
- return nil, fmt.Errorf(
- "Failed to convert device %s from %s to %s. New type was %s",
- deviceID, curType, targetType, finalType)
-
- }
- return d, err
-}
diff --git a/vendor/github.com/packethost/packngo/devices.go b/vendor/github.com/packethost/packngo/devices.go
deleted file mode 100644
index ace32e68..00000000
--- a/vendor/github.com/packethost/packngo/devices.go
+++ /dev/null
@@ -1,692 +0,0 @@
-package packngo
-
-import (
- "encoding/json"
- "fmt"
- "net/url"
- "path"
- "strconv"
-)
-
-const deviceBasePath = "/devices"
-
-const (
- NetworkTypeHybrid = "hybrid"
- NetworkTypeL2Bonded = "layer2-bonded"
- NetworkTypeL2Individual = "layer2-individual"
- NetworkTypeL3 = "layer3"
-)
-
-// DeviceService interface defines available device methods
-type DeviceService interface {
- List(ProjectID string, opts *ListOptions) ([]Device, *Response, error)
- Get(DeviceID string, opts *GetOptions) (*Device, *Response, error)
- Create(*DeviceCreateRequest) (*Device, *Response, error)
- Update(string, *DeviceUpdateRequest) (*Device, *Response, error)
- Delete(string, bool) (*Response, error)
- Reboot(string) (*Response, error)
- Reinstall(string, *DeviceReinstallFields) (*Response, error)
- PowerOff(string) (*Response, error)
- PowerOn(string) (*Response, error)
- Rescue(string) (*Response, error)
- Lock(string) (*Response, error)
- Unlock(string) (*Response, error)
- ListBGPSessions(deviceID string, opts *ListOptions) ([]BGPSession, *Response, error)
- ListBGPNeighbors(deviceID string, opts *ListOptions) ([]BGPNeighbor, *Response, error)
- ListEvents(deviceID string, opts *ListOptions) ([]Event, *Response, error)
- GetBandwidth(deviceID string, opts *BandwidthOpts) (*BandwidthIO, *Response, error)
-}
-
-type devicesRoot struct {
- Devices []Device `json:"devices"`
- Meta meta `json:"meta"`
-}
-
-// Device represents an Equinix Metal device from API
-type Device struct {
- ID string `json:"id"`
- Href string `json:"href,omitempty"`
- Hostname string `json:"hostname,omitempty"`
- Description *string `json:"description,omitempty"`
- State string `json:"state,omitempty"`
- Created string `json:"created_at,omitempty"`
- CreatedBy *UserLite `json:"created_by,omitempty"`
- Updated string `json:"updated_at,omitempty"`
- Locked bool `json:"locked,omitempty"`
- BillingCycle string `json:"billing_cycle,omitempty"`
- Storage *CPR `json:"storage,omitempty"`
- Tags []string `json:"tags,omitempty"`
- Network []*IPAddressAssignment `json:"ip_addresses"`
- Volumes []*Volume `json:"volumes"`
- OS *OS `json:"operating_system,omitempty"`
- Plan *Plan `json:"plan,omitempty"`
- Facility *Facility `json:"facility,omitempty"`
- Metro *Metro `json:"metro,omitempty"`
- Project *Project `json:"project,omitempty"`
- ProvisionEvents []*Event `json:"provisioning_events,omitempty"`
- ProvisionPer float32 `json:"provisioning_percentage,omitempty"`
- UserData string `json:"userdata,omitempty"`
- User string `json:"user,omitempty"`
- RootPassword string `json:"root_password,omitempty"`
- IPXEScriptURL string `json:"ipxe_script_url,omitempty"`
- AlwaysPXE bool `json:"always_pxe,omitempty"`
- HardwareReservation *HardwareReservation `json:"hardware_reservation,omitempty"`
- SpotInstance bool `json:"spot_instance,omitempty"`
- SpotPriceMax float64 `json:"spot_price_max,omitempty"`
- TerminationTime *Timestamp `json:"termination_time,omitempty"`
- NetworkPorts []Port `json:"network_ports,omitempty"`
- CustomData map[string]interface{} `json:"customdata,omitempty"`
- SSHKeys []SSHKey `json:"ssh_keys,omitempty"`
- ShortID string `json:"short_id,omitempty"`
- SwitchUUID string `json:"switch_uuid,omitempty"`
- SOS string `json:"sos,omitempty"`
-}
-
-type NetworkInfo struct {
- PublicIPv4 string
- PublicIPv6 string
- PrivateIPv4 string
-}
-
-type BandwidthIO struct {
- Inbound BandwidthComponent `json:"inbound"`
- Outbound BandwidthComponent `json:"outbound"`
-}
-
-func (b *BandwidthIO) UnmarshalJSON(buf []byte) error {
- tmp := []interface{}{&b.Inbound, &b.Outbound}
- wantLen := len(tmp)
- if err := json.Unmarshal(buf, &tmp); err != nil {
- return err
- }
- if g, e := len(tmp), wantLen; g != e {
- return fmt.Errorf("wrong number of fields in BandwidthIO: %d != %d", g, e)
- }
- if b.Inbound.Target == BandwidthOutbound {
- b.Inbound, b.Outbound = b.Outbound, b.Inbound
- }
- return nil
-}
-
-type bandwidthRoot struct {
- Bandwidth BandwidthIO `json:"bandwidth"`
-}
-
-type BandwidthTarget string
-
-// BandwidthTarget enums
-const (
- BandwidthInbound BandwidthTarget = "inbound"
- BandwidthOutbound BandwidthTarget = "outbound"
-)
-
-// BandwidthTags
-type BandwidthTags struct {
- // AggregatedBy
- AggregatedBy string `json:"aggregatedBy"`
-
- // Name
- Name string `json:"name"`
-}
-
-// BandwidthComponent
-type BandwidthComponent struct {
- // Datapoints
- Datapoints []Datapoint `json:"datapoints"`
-
- // Tags
- Tags BandwidthTags `json:"tags"`
-
- // Target
- Target BandwidthTarget `json:"target"`
-}
-type Datapoint struct {
- // Rate is the aggregated sum of Bytes/Second across all ports
- Rate *float64 `json:"rate"`
-
- // When the rate was captured
- When Timestamp `json:"when"`
-}
-
-func (d *Datapoint) UnmarshalJSON(buf []byte) error {
- tmp := []interface{}{&d.Rate, &d.When}
- wantLen := len(tmp)
- if err := json.Unmarshal(buf, &tmp); err != nil {
- return err
- }
- if g, e := len(tmp), wantLen; g != e {
- return fmt.Errorf("wrong number of fields in BandwidthComponent: %d != %d", g, e)
- }
- return nil
-}
-
-type BandwidthOpts struct {
- From *Timestamp `json:"from,omitempty"`
- Until *Timestamp `json:"until,omitempty"`
-}
-
-func (b *BandwidthOpts) Encode() string {
- if b == nil {
- return ""
- }
- v := url.Values{}
- if b.From != nil {
- v.Add("from", strconv.FormatInt(b.From.UTC().Unix(), 10))
- }
- if b.Until != nil {
- v.Add("until", strconv.FormatInt(b.Until.UTC().Unix(), 10))
- }
- return v.Encode()
-}
-
-func (b *BandwidthOpts) WithQuery(apiPath string) string {
- params := b.Encode()
- if params != "" {
- // parse path, take existing vars
- return fmt.Sprintf("%s?%s", apiPath, params)
- }
- return apiPath
-}
-
-func (d *DeviceServiceOp) GetBandwidth(deviceID string, opts *BandwidthOpts) (*BandwidthIO, *Response, error) {
- if validateErr := ValidateUUID(deviceID); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(deviceBasePath, deviceID, "bandwidth")
- apiPathQuery := opts.WithQuery(endpointPath)
- bw := new(bandwidthRoot)
- resp, err := d.client.DoRequest("GET", apiPathQuery, nil, bw)
- if err != nil {
- return nil, resp, err
- }
- return &bw.Bandwidth, resp, nil
-}
-
-func (d *Device) GetNetworkInfo() NetworkInfo {
- ni := NetworkInfo{}
- for _, ip := range d.Network {
- // Initial device IPs are fixed and marked as "Management"
- if ip.Management {
- if ip.AddressFamily == 4 {
- if ip.Public {
- ni.PublicIPv4 = ip.Address
- } else {
- ni.PrivateIPv4 = ip.Address
- }
- } else {
- ni.PublicIPv6 = ip.Address
- }
- }
- }
- return ni
-}
-
-func (d Device) String() string {
- return Stringify(d)
-}
-
-func (d *Device) NumOfBonds() int {
- numOfBonds := 0
- for _, p := range d.NetworkPorts {
- if p.Type == "NetworkBondPort" {
- numOfBonds++
- }
- }
- return numOfBonds
-}
-
-func (d *Device) GetPortsInBond(name string) map[string]*Port {
- ports := map[string]*Port{}
- for _, port := range d.NetworkPorts {
- if port.Bond != nil && port.Bond.Name == name {
- p := port
- ports[p.Name] = &p
- }
- }
- return ports
-}
-
-func (d *Device) GetBondPorts() map[string]*Port {
- ports := map[string]*Port{}
- for _, port := range d.NetworkPorts {
- if port.Type == "NetworkBondPort" {
- p := port
- ports[p.Name] = &p
- }
- }
- return ports
-}
-
-func (d *Device) GetPhysicalPorts() map[string]*Port {
- ports := map[string]*Port{}
- for _, port := range d.NetworkPorts {
- if port.Type == "NetworkPort" {
- p := port
- ports[p.Name] = &p
- }
- }
- return ports
-}
-
-func (d *Device) GetPortByName(name string) (*Port, error) {
- for _, port := range d.NetworkPorts {
- if port.Name == name {
- return &port, nil
- }
- }
- return nil, fmt.Errorf("Port %s not found in device %s", name, d.ID)
-}
-
-type ports map[string]*Port
-
-func (ports ports) allBonded() bool {
- if ports == nil {
- return false
- }
-
- if len(ports) == 0 {
- return false
- }
-
- for _, p := range ports {
- if (p == nil) || (!p.Data.Bonded) {
- return false
- }
- }
- return true
-}
-
-func (d *Device) HasManagementIPs() bool {
- for _, ip := range d.Network {
- if ip.Management {
- return true
- }
- }
- return false
-}
-
-// GetNetworkType returns a composite network type identification for a device
-// based on the plan, network_type, and IP management state of the device.
-// GetNetworkType provides the same composite state rendered in the Packet
-// Portal for a given device.
-func (d *Device) GetNetworkType() string {
- if d.Plan != nil {
- if d.Plan.Slug == "baremetal_0" || d.Plan.Slug == "baremetal_1" {
- return NetworkTypeL3
- }
- if d.Plan.Slug == "baremetal_1e" {
- return NetworkTypeHybrid
- }
- }
-
- bonds := ports(d.GetBondPorts())
- phys := ports(d.GetPhysicalPorts())
-
- if bonds.allBonded() {
- if phys.allBonded() {
- if !d.HasManagementIPs() {
- return NetworkTypeL2Bonded
- }
- return NetworkTypeL3
- }
- return NetworkTypeHybrid
- }
- return NetworkTypeL2Individual
-}
-
-type IPAddressCreateRequest struct {
- // Address Family for IP Address
- AddressFamily int `json:"address_family"`
-
- // Address Type for IP Address
- Public bool `json:"public"`
-
- // CIDR Size for the IP Block created. Valid values depends on the operating system provisioned.
- CIDR int `json:"cidr,omitempty"`
-
- // Reservations are UUIDs of any IP reservations to use when assigning IPs
- Reservations []string `json:"ip_reservations,omitempty"`
-}
-
-// CPR is a struct for custom partitioning and RAID
-// If you don't want to bother writing the struct, just write the CPR conf to
-// a string and then do
-//
-// var cpr CPR
-// err := json.Unmarshal([]byte(cprString), &cpr)
-// if err != nil {
-// log.Fatal(err)
-// }
-type CPR struct {
- Disks []struct {
- Device string `json:"device"`
- WipeTable bool `json:"wipeTable"`
- Partitions []struct {
- Label string `json:"label"`
- Number int `json:"number"`
- Size string `json:"size"`
- } `json:"partitions"`
- } `json:"disks"`
- Raid []struct {
- Devices []string `json:"devices"`
- Level string `json:"level"`
- Name string `json:"name"`
- } `json:"raid,omitempty"`
- Filesystems []struct {
- Mount struct {
- Device string `json:"device"`
- Format string `json:"format"`
- Point string `json:"point"`
- Create struct {
- Options []string `json:"options"`
- } `json:"create"`
- } `json:"mount"`
- } `json:"filesystems"`
-}
-
-// DeviceCreateRequest type used to create an Equinix Metal device
-type DeviceCreateRequest struct {
- Hostname string `json:"hostname,omitempty"`
- Plan string `json:"plan"`
- Facility []string `json:"facility,omitempty"`
- Metro string `json:"metro,omitempty"`
- OS string `json:"operating_system"`
- BillingCycle string `json:"billing_cycle,omitempty"`
- ProjectID string `json:"project_id"`
- UserData string `json:"userdata,omitempty"`
- Storage *CPR `json:"storage,omitempty"`
- Tags []string `json:"tags"`
- Description string `json:"description,omitempty"`
- IPXEScriptURL string `json:"ipxe_script_url,omitempty"`
- PublicIPv4SubnetSize int `json:"public_ipv4_subnet_size,omitempty"`
- AlwaysPXE bool `json:"always_pxe,omitempty"`
- HardwareReservationID string `json:"hardware_reservation_id,omitempty"`
- SpotInstance bool `json:"spot_instance,omitempty"`
- SpotPriceMax float64 `json:"spot_price_max,omitempty,string"`
- TerminationTime *Timestamp `json:"termination_time,omitempty"`
- CustomData string `json:"customdata,omitempty"`
- // UserSSHKeys is a list of user UUIDs - essentially a list of
- // collaborators. The users must be a collaborator in the same project
- // where the device is created. The user's SSH keys then go to the
- // device
- UserSSHKeys []string `json:"user_ssh_keys,omitempty"`
- // Project SSHKeys is a list of SSHKeys resource UUIDs. If this param
- // is supplied, only the listed SSHKeys will go to the device.
- // Any other Project SSHKeys and any User SSHKeys will not be present
- // in the device.
- ProjectSSHKeys []string `json:"project_ssh_keys,omitempty"`
- Features map[string]string `json:"features,omitempty"`
- IPAddresses []IPAddressCreateRequest `json:"ip_addresses,omitempty"`
- NoSSHKeys bool `json:"no_ssh_keys,omitempty"`
-}
-
-// DeviceUpdateRequest type used to update an Equinix Metal device
-type DeviceUpdateRequest struct {
- Hostname *string `json:"hostname,omitempty"`
- Description *string `json:"description,omitempty"`
- UserData *string `json:"userdata,omitempty"`
- Locked *bool `json:"locked,omitempty"`
- Tags *[]string `json:"tags,omitempty"`
- AlwaysPXE *bool `json:"always_pxe,omitempty"`
- IPXEScriptURL *string `json:"ipxe_script_url,omitempty"`
- CustomData *string `json:"customdata,omitempty"`
-}
-
-func (d DeviceCreateRequest) String() string {
- return Stringify(d)
-}
-
-// DeviceActionRequest type used to execute actions on devices
-type DeviceActionRequest struct {
- Type string `json:"type"`
-}
-
-type DeviceDeleteRequest struct {
- Force bool `json:"force_delete"`
-}
-type DeviceReinstallFields struct {
- OperatingSystem string `json:"operating_system,omitempty"`
- PreserveData bool `json:"preserve_data,omitempty"`
- DeprovisionFast bool `json:"deprovision_fast,omitempty"`
-}
-
-type DeviceReinstallRequest struct {
- DeviceActionRequest
- *DeviceReinstallFields
-}
-
-func (d DeviceActionRequest) String() string {
- return Stringify(d)
-}
-
-// DeviceServiceOp implements DeviceService
-type DeviceServiceOp struct {
- client *Client
-}
-
-// List returns devices on a project
-//
-// Regarding ListOptions.Search: The API documentation does not provide guidance
-// on the fields that will be searched using this parameter, so this behavior is
-// undefined and prone to change.
-//
-// As of 2020-10-20, ListOptions.Search will look for matches in the following
-// Device properties: Hostname, Description, Tags, ID, ShortID, Network.Address,
-// Plan.Name, Plan.Slug, Facility.Code, Facility.Name, OS.Name, OS.Slug,
-// HardwareReservation.ID, HardwareReservation.ShortID
-func (s *DeviceServiceOp) List(projectID string, opts *ListOptions) (devices []Device, resp *Response, err error) {
- if validateErr := ValidateUUID(projectID); validateErr != nil {
- return nil, nil, validateErr
- }
- opts = opts.Including("facility")
- endpointPath := path.Join(projectBasePath, projectID, deviceBasePath)
- apiPathQuery := opts.WithQuery(endpointPath)
-
- for {
- subset := new(devicesRoot)
-
- resp, err = s.client.DoRequest("GET", apiPathQuery, nil, subset)
- if err != nil {
- return nil, resp, err
- }
-
- devices = append(devices, subset.Devices...)
-
- if apiPathQuery = nextPage(subset.Meta, opts); apiPathQuery != "" {
- continue
- }
-
- return
- }
-}
-
-// Get returns a device by id
-func (s *DeviceServiceOp) Get(deviceID string, opts *GetOptions) (*Device, *Response, error) {
- if validateErr := ValidateUUID(deviceID); validateErr != nil {
- return nil, nil, validateErr
- }
- opts = opts.Including("facility")
- endpointPath := path.Join(deviceBasePath, deviceID)
- apiPathQuery := opts.WithQuery(endpointPath)
- device := new(Device)
- resp, err := s.client.DoRequest("GET", apiPathQuery, nil, device)
- if err != nil {
- return nil, resp, err
- }
- return device, resp, err
-}
-
-// Create creates a new device
-func (s *DeviceServiceOp) Create(createRequest *DeviceCreateRequest) (*Device, *Response, error) {
- apiPath := path.Join(projectBasePath, createRequest.ProjectID, deviceBasePath)
- device := new(Device)
-
- resp, err := s.client.DoRequest("POST", apiPath, createRequest, device)
- if err != nil {
- return nil, resp, err
- }
- return device, resp, err
-}
-
-// Update updates an existing device
-func (s *DeviceServiceOp) Update(deviceID string, updateRequest *DeviceUpdateRequest) (*Device, *Response, error) {
- if validateErr := ValidateUUID(deviceID); validateErr != nil {
- return nil, nil, validateErr
- }
- opts := &GetOptions{}
- opts = opts.Including("facility")
- endpointPath := path.Join(deviceBasePath, deviceID)
- apiPathQuery := opts.WithQuery(endpointPath)
- device := new(Device)
-
- resp, err := s.client.DoRequest("PUT", apiPathQuery, updateRequest, device)
- if err != nil {
- return nil, resp, err
- }
-
- return device, resp, err
-}
-
-// Delete deletes a device
-func (s *DeviceServiceOp) Delete(deviceID string, force bool) (*Response, error) {
- if validateErr := ValidateUUID(deviceID); validateErr != nil {
- return nil, validateErr
- }
- apiPath := path.Join(deviceBasePath, deviceID)
- req := &DeviceDeleteRequest{Force: force}
-
- return s.client.DoRequest("DELETE", apiPath, req, nil)
-}
-
-// Reboot reboots on a device
-func (s *DeviceServiceOp) Reboot(deviceID string) (*Response, error) {
- if validateErr := ValidateUUID(deviceID); validateErr != nil {
- return nil, validateErr
- }
- apiPath := path.Join(deviceBasePath, deviceID, "actions")
- action := &DeviceActionRequest{Type: "reboot"}
-
- return s.client.DoRequest("POST", apiPath, action, nil)
-}
-
-// Reinstall reinstalls a device
-func (s *DeviceServiceOp) Reinstall(deviceID string, fields *DeviceReinstallFields) (*Response, error) {
- if validateErr := ValidateUUID(deviceID); validateErr != nil {
- return nil, validateErr
- }
- path := fmt.Sprintf("%s/%s/actions", deviceBasePath, deviceID)
- action := &DeviceReinstallRequest{DeviceActionRequest{Type: "reinstall"}, fields}
-
- return s.client.DoRequest("POST", path, action, nil)
-}
-
-// PowerOff powers on a device
-func (s *DeviceServiceOp) PowerOff(deviceID string) (*Response, error) {
- if validateErr := ValidateUUID(deviceID); validateErr != nil {
- return nil, validateErr
- }
- apiPath := path.Join(deviceBasePath, deviceID, "actions")
- action := &DeviceActionRequest{Type: "power_off"}
-
- return s.client.DoRequest("POST", apiPath, action, nil)
-}
-
-// PowerOn powers on a device
-func (s *DeviceServiceOp) PowerOn(deviceID string) (*Response, error) {
- if validateErr := ValidateUUID(deviceID); validateErr != nil {
- return nil, validateErr
- }
- apiPath := path.Join(deviceBasePath, deviceID, "actions")
- action := &DeviceActionRequest{Type: "power_on"}
-
- return s.client.DoRequest("POST", apiPath, action, nil)
-}
-
-// Rescue boots a device into Rescue OS
-func (s *DeviceServiceOp) Rescue(deviceID string) (*Response, error) {
- if validateErr := ValidateUUID(deviceID); validateErr != nil {
- return nil, validateErr
- }
- apiPath := path.Join(deviceBasePath, deviceID, "actions")
- action := &DeviceActionRequest{Type: "rescue"}
-
- return s.client.DoRequest("POST", apiPath, action, nil)
-}
-
-type lockType struct {
- Locked bool `json:"locked"`
-}
-
-// Lock sets a device to "locked"
-func (s *DeviceServiceOp) Lock(deviceID string) (*Response, error) {
- if validateErr := ValidateUUID(deviceID); validateErr != nil {
- return nil, validateErr
- }
- apiPath := path.Join(deviceBasePath, deviceID)
- action := lockType{Locked: true}
-
- return s.client.DoRequest("PATCH", apiPath, action, nil)
-}
-
-// Unlock sets a device to "unlocked"
-func (s *DeviceServiceOp) Unlock(deviceID string) (*Response, error) {
- if validateErr := ValidateUUID(deviceID); validateErr != nil {
- return nil, validateErr
- }
- apiPath := path.Join(deviceBasePath, deviceID)
- action := lockType{Locked: false}
-
- return s.client.DoRequest("PATCH", apiPath, action, nil)
-}
-
-func (s *DeviceServiceOp) ListBGPNeighbors(deviceID string, opts *ListOptions) ([]BGPNeighbor, *Response, error) {
- if validateErr := ValidateUUID(deviceID); validateErr != nil {
- return nil, nil, validateErr
- }
- root := new(bgpNeighborsRoot)
- endpointPath := path.Join(deviceBasePath, deviceID, bgpNeighborsBasePath)
- apiPathQuery := opts.WithQuery(endpointPath)
-
- resp, err := s.client.DoRequest("GET", apiPathQuery, nil, root)
- if err != nil {
- return nil, resp, err
- }
-
- return root.BGPNeighbors, resp, err
-}
-
-// ListBGPSessions returns all BGP Sessions associated with the device
-func (s *DeviceServiceOp) ListBGPSessions(deviceID string, opts *ListOptions) (bgpSessions []BGPSession, resp *Response, err error) {
- if validateErr := ValidateUUID(deviceID); validateErr != nil {
- return nil, nil, validateErr
- }
-
- endpointPath := path.Join(deviceBasePath, deviceID, bgpSessionBasePath)
- apiPathQuery := opts.WithQuery(endpointPath)
-
- for {
- subset := new(bgpSessionsRoot)
-
- resp, err = s.client.DoRequest("GET", apiPathQuery, nil, subset)
- if err != nil {
- return nil, resp, err
- }
-
- bgpSessions = append(bgpSessions, subset.Sessions...)
-
- if apiPathQuery = nextPage(subset.Meta, opts); apiPathQuery != "" {
- continue
- }
- return
- }
-}
-
-// ListEvents returns list of device events
-func (s *DeviceServiceOp) ListEvents(deviceID string, opts *ListOptions) ([]Event, *Response, error) {
- if validateErr := ValidateUUID(deviceID); validateErr != nil {
- return nil, nil, validateErr
- }
- apiPath := path.Join(deviceBasePath, deviceID, eventBasePath)
-
- return listEvents(s.client, apiPath, opts)
-}
diff --git a/vendor/github.com/packethost/packngo/doc.go b/vendor/github.com/packethost/packngo/doc.go
deleted file mode 100644
index 52a192a0..00000000
--- a/vendor/github.com/packethost/packngo/doc.go
+++ /dev/null
@@ -1,3 +0,0 @@
-// Package packngo implements the Equinix Metal API
-// documented at https://metal.equinix.com/developers/api.
-package packngo
diff --git a/vendor/github.com/packethost/packngo/email.go b/vendor/github.com/packethost/packngo/email.go
deleted file mode 100644
index 375a4aa0..00000000
--- a/vendor/github.com/packethost/packngo/email.go
+++ /dev/null
@@ -1,98 +0,0 @@
-package packngo
-
-import (
- "path"
-)
-
-const emailBasePath = "/emails"
-
-// EmailRequest type used to add an email address to the current user
-type EmailRequest struct {
- Address string `json:"address,omitempty"`
- Default *bool `json:"default,omitempty"`
-}
-
-// EmailService interface defines available email methods
-type EmailService interface {
- Get(string, *GetOptions) (*Email, *Response, error)
- Create(*EmailRequest) (*Email, *Response, error)
- Update(string, *EmailRequest) (*Email, *Response, error)
- Delete(string) (*Response, error)
-}
-
-// Email represents a user's email address
-type Email struct {
- ID string `json:"id"`
- Address string `json:"address"`
- Default bool `json:"default,omitempty"`
- URL string `json:"href,omitempty"`
-}
-
-func (e Email) String() string {
- return Stringify(e)
-}
-
-// EmailServiceOp implements EmailService
-type EmailServiceOp struct {
- client *Client
-}
-
-// Get retrieves an email by id
-func (s *EmailServiceOp) Get(emailID string, opts *GetOptions) (*Email, *Response, error) {
- if validateErr := ValidateUUID(emailID); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(emailBasePath, emailID)
- apiPathQuery := opts.WithQuery(endpointPath)
- email := new(Email)
-
- resp, err := s.client.DoRequest("GET", apiPathQuery, nil, email)
- if err != nil {
- return nil, resp, err
- }
-
- return email, resp, err
-}
-
-// Create adds a new email address to the current user.
-func (s *EmailServiceOp) Create(request *EmailRequest) (*Email, *Response, error) {
- email := new(Email)
-
- resp, err := s.client.DoRequest("POST", emailBasePath, request, email)
- if err != nil {
- return nil, resp, err
- }
-
- return email, resp, err
-}
-
-// Delete removes the email address from the current user account
-func (s *EmailServiceOp) Delete(emailID string) (*Response, error) {
- if validateErr := ValidateUUID(emailID); validateErr != nil {
- return nil, validateErr
- }
- apiPath := path.Join(emailBasePath, emailID)
-
- resp, err := s.client.DoRequest("DELETE", apiPath, nil, nil)
- if err != nil {
- return resp, err
- }
-
- return resp, err
-}
-
-// Update email parameters
-func (s *EmailServiceOp) Update(emailID string, request *EmailRequest) (*Email, *Response, error) {
- if validateErr := ValidateUUID(emailID); validateErr != nil {
- return nil, nil, validateErr
- }
- email := new(Email)
- apiPath := path.Join(emailBasePath, emailID)
-
- resp, err := s.client.DoRequest("PUT", apiPath, request, email)
- if err != nil {
- return nil, resp, err
- }
-
- return email, resp, err
-}
diff --git a/vendor/github.com/packethost/packngo/events.go b/vendor/github.com/packethost/packngo/events.go
deleted file mode 100644
index c8365436..00000000
--- a/vendor/github.com/packethost/packngo/events.go
+++ /dev/null
@@ -1,84 +0,0 @@
-package packngo
-
-import (
- "path"
-)
-
-const eventBasePath = "/events"
-
-// Event struct
-type Event struct {
- ID string `json:"id,omitempty"`
- State string `json:"state,omitempty"`
- Type string `json:"type,omitempty"`
- Body string `json:"body,omitempty"`
- Relationships []Href `json:"relationships,omitempty"`
- Interpolated string `json:"interpolated,omitempty"`
- CreatedAt *Timestamp `json:"created_at,omitempty"`
- Href string `json:"href,omitempty"`
-}
-
-type eventsRoot struct {
- Events []Event `json:"events,omitempty"`
- Meta meta `json:"meta,omitempty"`
-}
-
-// EventService interface defines available event functions
-type EventService interface {
- List(*ListOptions) ([]Event, *Response, error)
- Get(string, *GetOptions) (*Event, *Response, error)
-}
-
-// EventServiceOp implements EventService
-type EventServiceOp struct {
- client *Client
-}
-
-// List returns all events
-func (s *EventServiceOp) List(listOpt *ListOptions) ([]Event, *Response, error) {
- return listEvents(s.client, eventBasePath, listOpt)
-}
-
-// Get returns an event by ID
-func (s *EventServiceOp) Get(eventID string, getOpt *GetOptions) (*Event, *Response, error) {
- if validateErr := ValidateUUID(eventID); validateErr != nil {
- return nil, nil, validateErr
- }
- apiPath := path.Join(eventBasePath, eventID)
- return get(s.client, apiPath, getOpt)
-}
-
-// list helper function for all event functions
-func listEvents(client requestDoer, endpointPath string, opts *ListOptions) (events []Event, resp *Response, err error) {
- apiPathQuery := opts.WithQuery(endpointPath)
-
- for {
- subset := new(eventsRoot)
-
- resp, err = client.DoRequest("GET", apiPathQuery, nil, subset)
- if err != nil {
- return nil, resp, err
- }
-
- events = append(events, subset.Events...)
-
- if apiPathQuery = nextPage(subset.Meta, opts); apiPathQuery != "" {
- continue
- }
- return
- }
-
-}
-
-func get(client *Client, endpointPath string, opts *GetOptions) (*Event, *Response, error) {
- event := new(Event)
-
- apiPathQuery := opts.WithQuery(endpointPath)
-
- resp, err := client.DoRequest("GET", apiPathQuery, nil, event)
- if err != nil {
- return nil, resp, err
- }
-
- return event, resp, err
-}
diff --git a/vendor/github.com/packethost/packngo/fabric_service_tokens.go b/vendor/github.com/packethost/packngo/fabric_service_tokens.go
deleted file mode 100644
index da4b9d7a..00000000
--- a/vendor/github.com/packethost/packngo/fabric_service_tokens.go
+++ /dev/null
@@ -1,42 +0,0 @@
-package packngo
-
-import "path"
-
-type FabricServiceTokenType string
-
-const (
- fabricServiceTokenBasePath = "/fabric-service-tokens"
- FabricServiceTokenASide FabricServiceTokenType = "a_side"
- FabricServiceTokenZSide FabricServiceTokenType = "z_side"
-)
-
-// FabricServiceToken represents an Equinix Metal metro
-type FabricServiceToken struct {
- *Href `json:",inline"`
- ExpiresAt *Timestamp `json:"expires_at,omitempty"`
- ID string `json:"id"`
- MaxAllowedSpeed uint64 `json:"max_allowed_speed,omitempty"`
- Role ConnectionPortRole `json:"role,omitempty"`
- ServiceTokenType FabricServiceTokenType `json:"service_token_type,omitempty"`
- State string `json:"state,omitempty"`
-}
-
-func (f FabricServiceToken) String() string {
- return Stringify(f)
-}
-
-// FabricServiceTokenServiceOp implements FabricServiceTokenService
-type FabricServiceTokenServiceOp struct {
- client *Client
-}
-
-func (s *FabricServiceTokenServiceOp) Get(id string, opts *GetOptions) (*FabricServiceToken, *Response, error) {
- endpointPath := path.Join(fabricServiceTokenBasePath, id)
- apiPathQuery := opts.WithQuery(endpointPath)
- fst := new(FabricServiceToken)
- resp, err := s.client.DoRequest("GET", apiPathQuery, nil, fst)
- if err != nil {
- return nil, resp, err
- }
- return fst, resp, err
-}
diff --git a/vendor/github.com/packethost/packngo/facilities.go b/vendor/github.com/packethost/packngo/facilities.go
deleted file mode 100644
index 12d18aec..00000000
--- a/vendor/github.com/packethost/packngo/facilities.go
+++ /dev/null
@@ -1,67 +0,0 @@
-package packngo
-
-const facilityBasePath = "/facilities"
-
-// FacilityService interface defines available facility methods
-type FacilityService interface {
- List(*ListOptions) ([]Facility, *Response, error)
-}
-
-type facilityRoot struct {
- Facilities []Facility `json:"facilities"`
-}
-
-// Facility represents an Equinix Metal facility
-type Facility struct {
- ID string `json:"id"`
- Name string `json:"name,omitempty"`
- Code string `json:"code,omitempty"`
- Features []string `json:"features,omitempty"`
- Address *Address `json:"address,omitempty"`
- Metro *Metro `json:"metro,omitempty"`
- URL string `json:"href,omitempty"`
-}
-
-func (f Facility) String() string {
- return Stringify(f)
-}
-
-// Coordinates struct for Coordinates
-type Coordinates struct {
- Latitude *string `json:"latitude,omitempty"`
- Longitude *string `json:"longitude,omitempty"`
-}
-
-// Address - the physical address of the facility
-type Address struct {
- ID string `json:"id,omitempty"`
- Address string `json:"address"`
- Address2 *string `json:"address2,omitempty"`
- City *string `json:"city,omitempty"`
- State *string `json:"state,omitempty"`
- ZipCode string `json:"zip_code"`
- Country string `json:"country"`
- Coordinates *Coordinates `json:"coordinates,omitempty"`
-}
-
-func (a Address) String() string {
- return Stringify(a)
-}
-
-// FacilityServiceOp implements FacilityService
-type FacilityServiceOp struct {
- client *Client
-}
-
-// List returns all facilities
-func (s *FacilityServiceOp) List(opts *ListOptions) ([]Facility, *Response, error) {
- root := new(facilityRoot)
- apiPathQuery := opts.WithQuery(facilityBasePath)
-
- resp, err := s.client.DoRequest("GET", apiPathQuery, nil, root)
- if err != nil {
- return nil, resp, err
- }
-
- return root.Facilities, resp, err
-}
diff --git a/vendor/github.com/packethost/packngo/hardware_reservations.go b/vendor/github.com/packethost/packngo/hardware_reservations.go
deleted file mode 100644
index da870a35..00000000
--- a/vendor/github.com/packethost/packngo/hardware_reservations.go
+++ /dev/null
@@ -1,104 +0,0 @@
-package packngo
-
-import (
- "path"
-)
-
-const hardwareReservationBasePath = "/hardware-reservations"
-
-// HardwareReservationService interface defines available hardware reservation functions
-type HardwareReservationService interface {
- Get(hardwareReservationID string, getOpt *GetOptions) (*HardwareReservation, *Response, error)
- List(projectID string, listOpt *ListOptions) ([]HardwareReservation, *Response, error)
- Move(string, string) (*HardwareReservation, *Response, error)
-}
-
-// HardwareReservationServiceOp implements HardwareReservationService
-type HardwareReservationServiceOp struct {
- client requestDoer
-}
-
-// HardwareReservation struct
-type HardwareReservation struct {
- ID string `json:"id,omitempty"`
- ShortID string `json:"short_id,omitempty"`
- Facility Facility `json:"facility,omitempty"`
- Plan Plan `json:"plan,omitempty"`
- Provisionable bool `json:"provisionable,omitempty"`
- Spare bool `json:"spare,omitempty"`
- SwitchUUID string `json:"switch_uuid,omitempty"`
- Intervals int `json:"intervals,omitempty"`
- CurrentPeriod int `json:"current_period,omitempty"`
- Href string `json:"href,omitempty"`
- Project Project `json:"project,omitempty"`
- Device *Device `json:"device,omitempty"`
- CreatedAt Timestamp `json:"created_at,omitempty"`
-}
-
-type hardwareReservationRoot struct {
- HardwareReservations []HardwareReservation `json:"hardware_reservations"`
- Meta meta `json:"meta"`
-}
-
-// List returns all hardware reservations for a given project
-func (s *HardwareReservationServiceOp) List(projectID string, opts *ListOptions) (reservations []HardwareReservation, resp *Response, err error) {
- if validateErr := ValidateUUID(projectID); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(projectBasePath, projectID, hardwareReservationBasePath)
- apiPathQuery := opts.WithQuery(endpointPath)
-
- for {
- subset := new(hardwareReservationRoot)
-
- resp, err = s.client.DoRequest("GET", apiPathQuery, nil, subset)
- if err != nil {
- return nil, resp, err
- }
-
- reservations = append(reservations, subset.HardwareReservations...)
- if apiPathQuery = nextPage(subset.Meta, opts); apiPathQuery != "" {
- continue
- }
- return
- }
-}
-
-// Get returns a single hardware reservation
-func (s *HardwareReservationServiceOp) Get(hardwareReservationdID string, opts *GetOptions) (*HardwareReservation, *Response, error) {
- if validateErr := ValidateUUID(hardwareReservationdID); validateErr != nil {
- return nil, nil, validateErr
- }
- hardwareReservation := new(HardwareReservation)
-
- endpointPath := path.Join(hardwareReservationBasePath, hardwareReservationdID)
- apiPathQuery := opts.WithQuery(endpointPath)
-
- resp, err := s.client.DoRequest("GET", apiPathQuery, nil, hardwareReservation)
- if err != nil {
- return nil, resp, err
- }
-
- return hardwareReservation, resp, err
-}
-
-// Move a hardware reservation to another project
-func (s *HardwareReservationServiceOp) Move(hardwareReservationdID, projectID string) (*HardwareReservation, *Response, error) {
- if validateErr := ValidateUUID(hardwareReservationdID); validateErr != nil {
- return nil, nil, validateErr
- }
- if validateErr := ValidateUUID(projectID); validateErr != nil {
- return nil, nil, validateErr
- }
- hardwareReservation := new(HardwareReservation)
- apiPath := path.Join(hardwareReservationBasePath, hardwareReservationdID, "move")
- body := map[string]string{}
- body["project_id"] = projectID
-
- resp, err := s.client.DoRequest("POST", apiPath, body, hardwareReservation)
- if err != nil {
- return nil, resp, err
- }
-
- return hardwareReservation, resp, err
-}
diff --git a/vendor/github.com/packethost/packngo/invitations.go b/vendor/github.com/packethost/packngo/invitations.go
deleted file mode 100644
index ef39eea8..00000000
--- a/vendor/github.com/packethost/packngo/invitations.go
+++ /dev/null
@@ -1,155 +0,0 @@
-package packngo
-
-import (
- "path"
-)
-
-const (
- invitationsBasePath = "/invitations"
-)
-
-// InvitationService interface defines available invitation methods
-type InvitationService interface {
- Create(string, *InvitationCreateRequest, *GetOptions) (*Invitation, *Response, error)
- List(string, *ListOptions) ([]Invitation, *Response, error)
- Get(string, *GetOptions) (*Invitation, *Response, error)
- Accept(string, *InvitationUpdateRequest) (*Invitation, *Response, error)
- Resend(string) (*Invitation, *Response, error)
- Delete(string) (*Response, error)
-}
-
-type invitationsRoot struct {
- Invitations []Invitation `json:"invitations"`
- Meta meta `json:"meta"`
-}
-
-// Invitation represents an Equinix Metal invitation
-type Invitation struct {
- *Href `json:",inline"`
- ID string `json:"id,omitempty"`
- Invitation Href `json:"invitation,omitempty"`
- InvitedBy Href `json:"invited_by,omitempty"`
- Invitee string `json:"invitee,omitempty"`
- Nonce string `json:"nonce,omitempty"`
- Organization Href `json:"organization,omitempty"`
- Projects []Href `json:"projects,omitempty"`
- Roles []string `json:"roles,omitempty"`
- CreatedAt *Timestamp `json:"created_at,omitempty"`
- UpdatedAt *Timestamp `json:"updated_at,omitempty"`
-}
-
-// InvitationCreateRequest struct for InvitationService.Create
-type InvitationCreateRequest struct {
- // Invitee is the email address of the recipient
- Invitee string `json:"invitee"`
- Message string `json:"message,omitempty"`
- ProjectsIDs []string `json:"projects_ids,omitempty"`
- Roles []string `json:"roles,omitempty"`
-}
-
-// InvitationUpdateRequest struct for InvitationService.Update
-type InvitationUpdateRequest struct{}
-
-func (u Invitation) String() string {
- return Stringify(u)
-}
-
-// InvitationServiceOp implements InvitationService
-type InvitationServiceOp struct {
- client *Client
-}
-
-var _ InvitationService = (*InvitationServiceOp)(nil)
-
-// Lists open invitations to the project
-func (s *InvitationServiceOp) List(organizationID string, opts *ListOptions) (invitations []Invitation, resp *Response, err error) {
- endpointPath := path.Join(organizationBasePath, organizationID, invitationsBasePath)
- apiPathQuery := opts.WithQuery(endpointPath)
-
- for {
- subset := new(invitationsRoot)
-
- resp, err = s.client.DoRequest("GET", apiPathQuery, nil, subset)
- if err != nil {
- return nil, resp, err
- }
-
- invitations = append(invitations, subset.Invitations...)
-
- if apiPathQuery = nextPage(subset.Meta, opts); apiPathQuery != "" {
- continue
- }
- return
- }
-}
-
-// Create a Invitation with the given InvitationCreateRequest. New invitation VerificationStage
-// will be AccountCreated, unless InvitationCreateRequest contains an valid
-// InvitationID and Nonce in which case the VerificationStage will be Verified.
-func (s *InvitationServiceOp) Create(organizationID string, createRequest *InvitationCreateRequest, opts *GetOptions) (*Invitation, *Response, error) {
- endpointPath := path.Join(organizationBasePath, organizationID, invitationsBasePath)
- apiPathQuery := opts.WithQuery(endpointPath)
- invitation := new(Invitation)
-
- resp, err := s.client.DoRequest("POST", apiPathQuery, createRequest, invitation)
- if err != nil {
- return nil, resp, err
- }
-
- return invitation, resp, err
-}
-
-func (s *InvitationServiceOp) Get(invitationID string, opts *GetOptions) (*Invitation, *Response, error) {
- if validateErr := ValidateUUID(invitationID); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(invitationsBasePath, invitationID)
- apiPathQuery := opts.WithQuery(endpointPath)
- invitation := new(Invitation)
-
- resp, err := s.client.DoRequest("GET", apiPathQuery, nil, invitation)
- if err != nil {
- return nil, resp, err
- }
-
- return invitation, resp, err
-}
-
-// Update updates the current invitation
-func (s *InvitationServiceOp) Delete(id string) (*Response, error) {
- opts := &GetOptions{}
- endpointPath := path.Join(invitationsBasePath, id)
- apiPathQuery := opts.WithQuery(endpointPath)
-
- return s.client.DoRequest("DELETE", apiPathQuery, nil, nil)
-}
-
-// Update updates the current invitation
-func (s *InvitationServiceOp) Accept(id string, updateRequest *InvitationUpdateRequest) (*Invitation, *Response, error) {
- opts := &GetOptions{}
- endpointPath := path.Join(invitationsBasePath, id)
- apiPathQuery := opts.WithQuery(endpointPath)
- invitation := new(Invitation)
-
- resp, err := s.client.DoRequest("PUT", apiPathQuery, updateRequest, invitation)
- if err != nil {
- return nil, resp, err
- }
-
- return invitation, resp, err
-}
-
-// Update updates the current invitation
-func (s *InvitationServiceOp) Resend(id string) (*Invitation, *Response, error) {
- opts := &GetOptions{}
- endpointPath := path.Join(invitationsBasePath, id)
- apiPathQuery := opts.WithQuery(endpointPath)
- invitation := new(Invitation)
-
- resp, err := s.client.DoRequest("POST", apiPathQuery, nil, invitation)
- if err != nil {
- return nil, resp, err
- }
-
- return invitation, resp, err
-}
diff --git a/vendor/github.com/packethost/packngo/ip.go b/vendor/github.com/packethost/packngo/ip.go
deleted file mode 100644
index 90a1a5c7..00000000
--- a/vendor/github.com/packethost/packngo/ip.go
+++ /dev/null
@@ -1,391 +0,0 @@
-package packngo
-
-import (
- "path"
- "strconv"
-)
-
-const ipBasePath = "/ips"
-
-const (
- // PublicIPv4 fixed string representation of public ipv4
- PublicIPv4 IPReservationType = "public_ipv4"
- // PrivateIPv4 fixed string representation of private ipv4
- PrivateIPv4 IPReservationType = "private_ipv4"
- // GlobalIPv4 fixed string representation of global ipv4
- GlobalIPv4 IPReservationType = "global_ipv4"
- // PublicIPv6 fixed string representation of public ipv6
- PublicIPv6 IPReservationType = "public_ipv6"
- // PrivateIPv6 fixed string representation of private ipv6
- PrivateIPv6 IPReservationType = "private_ipv6"
- // GlobalIPv6 fixed string representation of global ipv6
- GlobalIPv6 IPReservationType = "global_ipv6"
- // VRFIPRange fixed string representation of vrf (virtual routing and forwarding). This may be any VRF supported range, including public and RFC-1918 IPv4 and IPv6 ranges.
- VRFIPRange IPReservationType = "vrf"
-)
-
-type IPReservationType string
-
-// DeviceIPService handles assignment of addresses from reserved blocks to instances in a project.
-type DeviceIPService interface {
- Assign(deviceID string, assignRequest *AddressStruct) (*IPAddressAssignment, *Response, error)
- Unassign(assignmentID string) (*Response, error)
- Get(assignmentID string, getOpt *GetOptions) (*IPAddressAssignment, *Response, error)
- List(deviceID string, opts *ListOptions) ([]IPAddressAssignment, *Response, error)
-}
-
-// ProjectIPService handles reservation of IP address blocks for a project.
-type ProjectIPService interface {
- Get(reservationID string, getOpt *GetOptions) (*IPAddressReservation, *Response, error)
- List(projectID string, opts *ListOptions) ([]IPAddressReservation, *Response, error)
- // Deprecated Use Create instead of Request
- Request(projectID string, ipReservationReq *IPReservationRequest) (*IPAddressReservation, *Response, error)
- Create(projectID string, ipReservationReq *IPReservationCreateRequest) (*IPAddressReservation, *Response, error)
- Delete(ipReservationID string) (*Response, error)
- // Deprecated Use Delete instead of Remove
- Remove(ipReservationID string) (*Response, error)
- Update(assignmentID string, updateRequest *IPAddressUpdateRequest, opt *GetOptions) (*IPAddressReservation, *Response, error)
- AvailableAddresses(ipReservationID string, r *AvailableRequest) ([]string, *Response, error)
-}
-
-var (
- _ DeviceIPService = (*DeviceIPServiceOp)(nil)
- _ ProjectIPService = (*ProjectIPServiceOp)(nil)
-)
-
-type IpAddressCommon struct { //nolint:golint
- ID string `json:"id"`
- Address string `json:"address"`
- Gateway string `json:"gateway"`
- Network string `json:"network"`
- AddressFamily int `json:"address_family"`
- Netmask string `json:"netmask"`
- Public bool `json:"public"`
- CIDR int `json:"cidr"`
- Created string `json:"created_at,omitempty"`
- Updated string `json:"updated_at,omitempty"`
- Href string `json:"href"`
- Management bool `json:"management"`
- Manageable bool `json:"manageable"`
- Metro *Metro `json:"metro,omitempty"`
- Project Href `json:"project"`
- Global bool `json:"global_ip"`
- Tags []string `json:"tags,omitempty"`
- ParentBlock *ParentBlock `json:"parent_block,omitempty"`
- CustomData interface{} `json:"customdata,omitempty"`
- Type IPReservationType `json:"type"`
- VRF *VRF `json:"vrf,omitempty"`
-}
-
-// ParentBlock is the network block for the parent of an IP address
-type ParentBlock struct {
- Network string `json:"network"`
- Netmask string `json:"netmask"`
- CIDR int `json:"cidr"`
- Href *string `json:"href,omitempty"`
-}
-
-type IPReservationState string
-
-const (
- // IPReservationStatePending fixed string representation of pending
- IPReservationStatePending IPReservationState = "pending"
-
- // IPReservationStateCreated fixed string representation of created
- IPReservationStateCreated IPReservationState = "created"
-
- // IPReservationStateDenied fixed string representation of denied
- IPReservationStateDenied IPReservationState = "denied"
-)
-
-// IPAddressReservation is created when user sends IP reservation request for a project (considering it's within quota).
-type IPAddressReservation struct {
- IpAddressCommon
- Assignments []*IPAddressAssignment `json:"assignments"`
- Facility *Facility `json:"facility,omitempty"`
- Available string `json:"available"`
- Addon bool `json:"addon"`
- Bill bool `json:"bill"`
- State IPReservationState `json:"state"`
- Description *string `json:"details"`
- Enabled bool `json:"enabled"`
- MetalGateway *MetalGatewayLite `json:"metal_gateway,omitempty"`
- RequestedBy *UserLite `json:"requested_by,omitempty"`
-}
-
-// AvailableResponse is a type for listing of available addresses from a reserved block.
-type AvailableResponse struct {
- Available []string `json:"available"`
-}
-
-// AvailableRequest is a type for listing available addresses from a reserved block.
-type AvailableRequest struct {
- CIDR int `json:"cidr"`
-}
-
-// IPAddressAssignment is created when an IP address from reservation block is assigned to a device.
-type IPAddressAssignment struct {
- IpAddressCommon
- AssignedTo Href `json:"assigned_to"`
-}
-
-// IPAddressUpdateRequest represents the body of an IPAddress patch
-type IPAddressUpdateRequest struct {
- Tags *[]string `json:"tags,omitempty"`
- Description *string `json:"details,omitempty"`
- CustomData interface{} `json:"customdata,omitempty"`
-}
-
-// IPReservationRequest represents the body of an IP reservation request
-// Deprecated: use IPReservationCreateRequest
-type IPReservationRequest = IPReservationCreateRequest
-
-// IPReservationCreateRequest represents the body of an IP reservation request.
-type IPReservationCreateRequest struct {
- // Type of IP reservation.
- Type IPReservationType `json:"type"`
- Quantity int `json:"quantity"`
- Description string `json:"details,omitempty"`
- Facility *string `json:"facility,omitempty"`
- Metro *string `json:"metro,omitempty"`
- Tags []string `json:"tags,omitempty"`
- CustomData interface{} `json:"customdata,omitempty"`
- // FailOnApprovalRequired if the IP request cannot be approved
- // automatically, rather than sending to the longer Equinix Metal approval
- // process, fail immediately with a 422 error
- FailOnApprovalRequired bool `json:"fail_on_approval_required,omitempty"`
-
- // Comments in support of the request for additional addresses when the
- // request must be manually approved.
- Comments string `json:"comments,omitempty"`
-
- // VRFID is the ID of the VRF to associate and draw the IP range from.
- // * Required when Type is VRFIPRange, not valid otherwise
- // * Network and CIDR are required when set
- // * Metro and Facility are not required when set
- VRFID string `json:"vrf_id,omitempty"`
-
- // Network an unreserved network address from an existing VRF ip_range.
- // * Required when Type is VRFIPRange, not valid otherwise
- Network string `json:"network,omitempty"`
-
- // CIDR the size of the network to reserve from an existing VRF ip_range.
- // * Required when Type is VRFIPRange, not valid otherwise
- // * Minimum range is 22-29, with 30-31 supported and necessary for virtual-circuits
- CIDR int `json:"cidr,omitempty"`
-}
-
-// AddressStruct is a helper type for request/response with dict like {"address": ... }
-type AddressStruct struct {
- Address string `json:"address"`
-}
-
-func deleteFromIP(client *Client, resourceID string) (*Response, error) {
- if validateErr := ValidateUUID(resourceID); validateErr != nil {
- return nil, validateErr
- }
- apiPath := path.Join(ipBasePath, resourceID)
-
- return client.DoRequest("DELETE", apiPath, nil, nil)
-}
-
-func (i IPAddressReservation) String() string {
- return Stringify(i)
-}
-
-func (i IPAddressAssignment) String() string {
- return Stringify(i)
-}
-
-// DeviceIPServiceOp is interface for IP-address assignment methods.
-type DeviceIPServiceOp struct {
- client *Client
-}
-
-// Unassign unassigns an IP address from the device to which it is currently assigned.
-// This will remove the relationship between an IP and the device and will make the IP
-// address available to be assigned to another device.
-func (i *DeviceIPServiceOp) Unassign(assignmentID string) (*Response, error) {
- if validateErr := ValidateUUID(assignmentID); validateErr != nil {
- return nil, validateErr
- }
- return deleteFromIP(i.client, assignmentID)
-}
-
-// Assign assigns an IP address to a device.
-// The IP address must be in one of the IP ranges assigned to the device’s project.
-func (i *DeviceIPServiceOp) Assign(deviceID string, assignRequest *AddressStruct) (*IPAddressAssignment, *Response, error) {
- if validateErr := ValidateUUID(deviceID); validateErr != nil {
- return nil, nil, validateErr
- }
- apiPath := path.Join(deviceBasePath, deviceID, ipBasePath)
- ipa := new(IPAddressAssignment)
-
- resp, err := i.client.DoRequest("POST", apiPath, assignRequest, ipa)
- if err != nil {
- return nil, resp, err
- }
-
- return ipa, resp, err
-}
-
-// Get returns assignment by ID.
-func (i *DeviceIPServiceOp) Get(assignmentID string, opts *GetOptions) (*IPAddressAssignment, *Response, error) {
- if validateErr := ValidateUUID(assignmentID); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(ipBasePath, assignmentID)
- apiPathQuery := opts.WithQuery(endpointPath)
- ipa := new(IPAddressAssignment)
-
- resp, err := i.client.DoRequest("GET", apiPathQuery, nil, ipa)
- if err != nil {
- return nil, resp, err
- }
-
- return ipa, resp, err
-}
-
-// List list all of the IP address assignments on a device
-func (i *DeviceIPServiceOp) List(deviceID string, opts *ListOptions) ([]IPAddressAssignment, *Response, error) {
- if validateErr := ValidateUUID(deviceID); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(deviceBasePath, deviceID, ipBasePath)
- apiPathQuery := opts.WithQuery(endpointPath)
-
- // ipList represents collection of IP Address reservations
- type ipList struct {
- IPs []IPAddressAssignment `json:"ip_addresses,omitempty"`
- }
-
- ips := new(ipList)
-
- resp, err := i.client.DoRequest("GET", apiPathQuery, nil, ips)
- if err != nil {
- return nil, resp, err
- }
-
- return ips.IPs, resp, err
-}
-
-// ProjectIPServiceOp is interface for IP assignment methods.
-type ProjectIPServiceOp struct {
- client *Client
-}
-
-// Get returns reservation by ID.
-func (i *ProjectIPServiceOp) Get(reservationID string, opts *GetOptions) (*IPAddressReservation, *Response, error) {
- if validateErr := ValidateUUID(reservationID); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(ipBasePath, reservationID)
- apiPathQuery := opts.WithQuery(endpointPath)
- ipr := new(IPAddressReservation)
-
- resp, err := i.client.DoRequest("GET", apiPathQuery, nil, ipr)
- if err != nil {
- return nil, resp, err
- }
-
- return ipr, resp, err
-}
-
-// List provides a list of IP resevations for a single project.
-// opts be filtered to limit the type of reservations returned:
-// opts.Filter("type", "vrf")
-func (i *ProjectIPServiceOp) List(projectID string, opts *ListOptions) ([]IPAddressReservation, *Response, error) {
- if validateErr := ValidateUUID(projectID); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(projectBasePath, projectID, ipBasePath)
- apiPathQuery := opts.WithQuery(endpointPath)
- reservations := new(struct {
- Reservations []IPAddressReservation `json:"ip_addresses"`
- })
-
- resp, err := i.client.DoRequest("GET", apiPathQuery, nil, reservations)
- if err != nil {
- return nil, resp, err
- }
- return reservations.Reservations, resp, nil
-}
-
-// Create creates a request for more IP space for a project in order to have
-// additional IP addresses to assign to devices.
-func (i *ProjectIPServiceOp) Create(projectID string, ipReservationReq *IPReservationCreateRequest) (*IPAddressReservation, *Response, error) {
- if validateErr := ValidateUUID(projectID); validateErr != nil {
- return nil, nil, validateErr
- }
- apiPath := path.Join(projectBasePath, projectID, ipBasePath)
- ipr := new(IPAddressReservation)
-
- resp, err := i.client.DoRequest("POST", apiPath, ipReservationReq, ipr)
- if err != nil {
- return nil, resp, err
- }
- return ipr, resp, err
-}
-
-// Request requests more IP space for a project in order to have additional IP
-// addresses to assign to devices.
-//
-// Deprecated: Use Create instead.
-func (i *ProjectIPServiceOp) Request(projectID string, ipReservationReq *IPReservationRequest) (*IPAddressReservation, *Response, error) {
- return i.Create(projectID, ipReservationReq)
-}
-
-// Update updates an existing IP reservation.
-func (i *ProjectIPServiceOp) Update(reservationID string, updateRequest *IPAddressUpdateRequest, opts *GetOptions) (*IPAddressReservation, *Response, error) {
- if validateErr := ValidateUUID(reservationID); validateErr != nil {
- return nil, nil, validateErr
- }
- if opts == nil {
- opts = &GetOptions{}
- }
- endpointPath := path.Join(ipBasePath, reservationID)
- apiPathQuery := opts.WithQuery(endpointPath)
- ipr := new(IPAddressReservation)
-
- resp, err := i.client.DoRequest("PATCH", apiPathQuery, updateRequest, ipr)
- if err != nil {
- return nil, resp, err
- }
-
- return ipr, resp, err
-}
-
-// Delete removes the requests for specific IP within a project
-func (i *ProjectIPServiceOp) Delete(ipReservationID string) (*Response, error) {
- if validateErr := ValidateUUID(ipReservationID); validateErr != nil {
- return nil, validateErr
- }
- return deleteFromIP(i.client, ipReservationID)
-}
-
-// Remove removes an IP reservation from the project.
-// Deprecated: Use Delete instead.
-func (i *ProjectIPServiceOp) Remove(ipReservationID string) (*Response, error) {
- return i.Delete(ipReservationID)
-}
-
-// AvailableAddresses lists addresses available from a reserved block
-func (i *ProjectIPServiceOp) AvailableAddresses(ipReservationID string, r *AvailableRequest) ([]string, *Response, error) {
- if validateErr := ValidateUUID(ipReservationID); validateErr != nil {
- return nil, nil, validateErr
- }
-
- opts := &GetOptions{}
- opts = opts.Filter("cidr", strconv.Itoa(r.CIDR))
-
- endpointPath := path.Join(ipBasePath, ipReservationID, "available")
- apiPathQuery := opts.WithQuery(endpointPath)
-
- ar := new(AvailableResponse)
-
- resp, err := i.client.DoRequest("GET", apiPathQuery, r, ar)
- if err != nil {
- return nil, resp, err
- }
- return ar.Available, resp, nil
-}
diff --git a/vendor/github.com/packethost/packngo/members.go b/vendor/github.com/packethost/packngo/members.go
deleted file mode 100644
index 6ce6c1c3..00000000
--- a/vendor/github.com/packethost/packngo/members.go
+++ /dev/null
@@ -1,66 +0,0 @@
-package packngo
-
-import "path"
-
-// API documentation https://metal.equinix.com/developers/api#tag/Memberships
-const membersBasePath = "/members"
-
-// OrganizationService interface defines available organization methods
-type MemberService interface {
- List(string, *ListOptions) ([]Member, *Response, error)
- Delete(string, string) (*Response, error)
-}
-
-type membersRoot struct {
- Members []Member `json:"members"`
- Meta meta `json:"meta"`
-}
-
-// Member is the returned from organization/id/members
-type Member struct {
- *Href `json:",inline"`
- ID string `json:"id"`
- Roles []string `json:"roles"`
- ProjectsCount int `json:"projects_count"`
- User User `json:"user"`
- Organization Organization `json:"organization"`
- Projects []Project `json:"projects"`
-}
-
-// MemberServiceOp implements MemberService
-type MemberServiceOp struct {
- client *Client
-}
-
-var _ MemberService = (*MemberServiceOp)(nil)
-
-// List returns the members in an organization
-func (s *MemberServiceOp) List(organizationID string, opts *ListOptions) (orgs []Member, resp *Response, err error) {
- subset := new(membersRoot)
- endpointPath := path.Join(organizationBasePath, organizationID, membersBasePath)
- apiPathQuery := opts.WithQuery(endpointPath)
-
- for {
- resp, err = s.client.DoRequest("GET", apiPathQuery, nil, subset)
- if err != nil {
- return nil, resp, err
- }
-
- orgs = append(orgs, subset.Members...)
-
- if apiPathQuery = nextPage(subset.Meta, opts); apiPathQuery != "" {
- continue
- }
- return
- }
-}
-
-// Delete removes the given member from the given organization
-func (s *MemberServiceOp) Delete(organizationID, memberID string) (*Response, error) {
- if validateErr := ValidateUUID(organizationID); validateErr != nil {
- return nil, validateErr
- }
- apiPath := path.Join(organizationBasePath, organizationID, membersBasePath, memberID)
-
- return s.client.DoRequest("DELETE", apiPath, nil, nil)
-}
diff --git a/vendor/github.com/packethost/packngo/metal_gateway.go b/vendor/github.com/packethost/packngo/metal_gateway.go
deleted file mode 100644
index b4851d22..00000000
--- a/vendor/github.com/packethost/packngo/metal_gateway.go
+++ /dev/null
@@ -1,136 +0,0 @@
-package packngo
-
-import (
- "path"
-)
-
-type MetalGatewayState string
-
-const (
- metalGatewayBasePath = "/metal-gateways"
- MetalGatewayActive MetalGatewayState = "active"
- MetalGatewayReady MetalGatewayState = "ready"
- MetalGatewayDeleting MetalGatewayState = "deleting"
-)
-
-type MetalGatewayService interface {
- List(projectID string, opts *ListOptions) ([]MetalGateway, *Response, error)
- Create(projectID string, input *MetalGatewayCreateRequest) (*MetalGateway, *Response, error)
- Get(metalGatewayID string, opts *GetOptions) (*MetalGateway, *Response, error)
- Delete(metalGatewayID string) (*Response, error)
-}
-
-type MetalGateway struct {
- ID string `json:"id"`
- State MetalGatewayState `json:"state"`
- Project *Project `json:"project,omitempty"`
- VirtualNetwork *VirtualNetwork `json:"virtual_network,omitempty"`
- IPReservation *IPAddressReservation `json:"ip_reservation,omitempty"`
- Href string `json:"href"`
- CreatedAt string `json:"created_at,omitempty"`
- UpdatedAt string `json:"updated_at,omitempty"`
- VRF *VRF `json:"vrf,omitempty"`
-}
-
-// MetalGatewayLite struct representation of a Metal Gateway
-type MetalGatewayLite struct {
- ID string `json:"id,omitempty"`
- // The current state of the Metal Gateway. 'Ready' indicates the gateway record has been configured, but is currently not active on the network. 'Active' indicates the gateway has been configured on the network. 'Deleting' is a temporary state used to indicate that the gateway is in the process of being un-configured from the network, after which the gateway record will be deleted.
- State string `json:"state,omitempty"`
- CreatedAt *Timestamp `json:"created_at,omitempty"`
- UpdatedAt *Timestamp `json:"updated_at,omitempty"`
- // The gateway address with subnet CIDR value for this Metal Gateway. For example, a Metal Gateway using an IP reservation with block 10.1.2.0/27 would have a gateway address of 10.1.2.1/27.
- GatewayAddress string `json:"gateway_address,omitempty"`
- // The VLAN id of the Virtual Network record associated to this Metal Gateway. Example: 1001.
- VLAN int `json:"vlan,omitempty"`
- Href string `json:"href,omitempty"`
-}
-
-type MetalGatewayServiceOp struct {
- client *Client
-}
-
-func (s *MetalGatewayServiceOp) List(projectID string, opts *ListOptions) (metalGateways []MetalGateway, resp *Response, err error) {
- if validateErr := ValidateUUID(projectID); validateErr != nil {
- return nil, nil, validateErr
- }
- type metalGatewaysRoot struct {
- MetalGateways []MetalGateway `json:"metal_gateways"`
- Meta meta `json:"meta"`
- }
-
- endpointPath := path.Join(projectBasePath, projectID, metalGatewayBasePath)
- apiPathQuery := opts.WithQuery(endpointPath)
-
- for {
- subset := new(metalGatewaysRoot)
-
- resp, err = s.client.DoRequest("GET", apiPathQuery, nil, subset)
- if err != nil {
- return nil, resp, err
- }
-
- metalGateways = append(metalGateways, subset.MetalGateways...)
-
- if apiPathQuery = nextPage(subset.Meta, opts); apiPathQuery != "" {
- continue
- }
- return
- }
-}
-
-type MetalGatewayCreateRequest struct {
- // VirtualNetworkID virtual network UUID.
- VirtualNetworkID string `json:"virtual_network_id"`
-
- // IPReservationID (optional) IP Reservation UUID (Public or VRF). Required for VRF.
- IPReservationID string `json:"ip_reservation_id,omitempty"`
-
- // PrivateIPv4SubnetSize (optional) Power of 2 between 8 and 128 (8, 16, 32, 64, 128). Invalid for VRF.
- PrivateIPv4SubnetSize int `json:"private_ipv4_subnet_size,omitempty"`
-}
-
-func (s *MetalGatewayServiceOp) Get(metalGatewayID string, opts *GetOptions) (*MetalGateway, *Response, error) {
- if validateErr := ValidateUUID(metalGatewayID); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(metalGatewayBasePath, metalGatewayID)
- apiPathQuery := opts.WithQuery(endpointPath)
- metalGateway := new(MetalGateway)
-
- resp, err := s.client.DoRequest("GET", apiPathQuery, nil, metalGateway)
- if err != nil {
- return nil, resp, err
- }
-
- return metalGateway, resp, err
-}
-
-func (s *MetalGatewayServiceOp) Create(projectID string, input *MetalGatewayCreateRequest) (*MetalGateway, *Response, error) {
- if validateErr := ValidateUUID(projectID); validateErr != nil {
- return nil, nil, validateErr
- }
- apiPath := path.Join(projectBasePath, projectID, metalGatewayBasePath)
- output := new(MetalGateway)
-
- resp, err := s.client.DoRequest("POST", apiPath, input, output)
- if err != nil {
- return nil, nil, err
- }
-
- return output, resp, nil
-}
-
-func (s *MetalGatewayServiceOp) Delete(metalGatewayID string) (*Response, error) {
- if validateErr := ValidateUUID(metalGatewayID); validateErr != nil {
- return nil, validateErr
- }
- apiPath := path.Join(metalGatewayBasePath, metalGatewayID)
-
- resp, err := s.client.DoRequest("DELETE", apiPath, nil, nil)
- if err != nil {
- return nil, err
- }
-
- return resp, nil
-}
diff --git a/vendor/github.com/packethost/packngo/metros.go b/vendor/github.com/packethost/packngo/metros.go
deleted file mode 100644
index 2a3924dc..00000000
--- a/vendor/github.com/packethost/packngo/metros.go
+++ /dev/null
@@ -1,42 +0,0 @@
-package packngo
-
-const metroBasePath = "/locations/metros"
-
-// MetroService interface defines available metro methods
-type MetroService interface {
- List(*ListOptions) ([]Metro, *Response, error)
-}
-
-type metroRoot struct {
- Metros []Metro `json:"metros"`
-}
-
-// Metro represents an Equinix Metal metro
-type Metro struct {
- ID string `json:"id"`
- Name string `json:"name,omitempty"`
- Code string `json:"code,omitempty"`
- Country string `json:"country,omitempty"`
-}
-
-func (f Metro) String() string {
- return Stringify(f)
-}
-
-// MetroServiceOp implements MetroService
-type MetroServiceOp struct {
- client *Client
-}
-
-// List returns all metros
-func (s *MetroServiceOp) List(opts *ListOptions) ([]Metro, *Response, error) {
- root := new(metroRoot)
- apiPathQuery := opts.WithQuery(metroBasePath)
-
- resp, err := s.client.DoRequest("GET", apiPathQuery, nil, root)
- if err != nil {
- return nil, resp, err
- }
-
- return root.Metros, resp, err
-}
diff --git a/vendor/github.com/packethost/packngo/notifications.go b/vendor/github.com/packethost/packngo/notifications.go
deleted file mode 100644
index bdefa1bd..00000000
--- a/vendor/github.com/packethost/packngo/notifications.go
+++ /dev/null
@@ -1,100 +0,0 @@
-package packngo
-
-import (
- "path"
-)
-
-const notificationBasePath = "/notifications"
-
-// Notification struct
-type Notification struct {
- ID string `json:"id,omitempty"`
- Type string `json:"type,omitempty"`
- Body string `json:"body,omitempty"`
- Severity string `json:"severity,omitempty"`
- Read bool `json:"read,omitempty"`
- Context string `json:"context,omitempty"`
- CreatedAt Timestamp `json:"created_at,omitempty"`
- UpdatedAt Timestamp `json:"updated_at,omitempty"`
- User Href `json:"user,omitempty"`
- Href string `json:"href,omitempty"`
-}
-
-type notificationsRoot struct {
- Notifications []Notification `json:"notifications,omitempty"`
- Meta meta `json:"meta,omitempty"`
-}
-
-// NotificationService interface defines available event functions
-type NotificationService interface {
- List(*ListOptions) ([]Notification, *Response, error)
- Get(string, *GetOptions) (*Notification, *Response, error)
- MarkAsRead(string) (*Notification, *Response, error)
-}
-
-// NotificationServiceOp implements NotificationService
-type NotificationServiceOp struct {
- client *Client
-}
-
-// List returns all notifications
-func (s *NotificationServiceOp) List(listOpt *ListOptions) ([]Notification, *Response, error) {
- return listNotifications(s.client, notificationBasePath, listOpt)
-}
-
-// Get returns a notification by ID
-func (s *NotificationServiceOp) Get(notificationID string, opts *GetOptions) (*Notification, *Response, error) {
- if validateErr := ValidateUUID(notificationID); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(notificationBasePath, notificationID)
- apiPathQuery := opts.WithQuery(endpointPath)
- return getNotifications(s.client, apiPathQuery)
-}
-
-// Marks notification as read by ID
-func (s *NotificationServiceOp) MarkAsRead(notificationID string) (*Notification, *Response, error) {
- if validateErr := ValidateUUID(notificationID); validateErr != nil {
- return nil, nil, validateErr
- }
- apiPath := path.Join(notificationBasePath, notificationID)
- return markAsRead(s.client, apiPath)
-}
-
-// list helper function for all notification functions
-func listNotifications(client *Client, endpointPath string, opts *ListOptions) ([]Notification, *Response, error) {
- root := new(notificationsRoot)
-
- apiPathQuery := opts.WithQuery(endpointPath)
-
- resp, err := client.DoRequest("GET", apiPathQuery, nil, root)
- if err != nil {
- return nil, resp, err
- }
-
- return root.Notifications, resp, err
-}
-
-func getNotifications(client *Client, apiPath string) (*Notification, *Response, error) {
-
- notification := new(Notification)
-
- resp, err := client.DoRequest("GET", apiPath, nil, notification)
- if err != nil {
- return nil, resp, err
- }
-
- return notification, resp, err
-}
-
-func markAsRead(client *Client, apiPath string) (*Notification, *Response, error) {
-
- notification := new(Notification)
-
- resp, err := client.DoRequest("PUT", apiPath, nil, notification)
- if err != nil {
- return nil, resp, err
- }
-
- return notification, resp, err
-}
diff --git a/vendor/github.com/packethost/packngo/operatingsystems.go b/vendor/github.com/packethost/packngo/operatingsystems.go
deleted file mode 100644
index 087fba6c..00000000
--- a/vendor/github.com/packethost/packngo/operatingsystems.go
+++ /dev/null
@@ -1,42 +0,0 @@
-package packngo
-
-const osBasePath = "/operating-systems"
-
-// OSService interface defines available operating_systems methods
-type OSService interface {
- List() ([]OS, *Response, error)
-}
-
-type osRoot struct {
- OperatingSystems []OS `json:"operating_systems"`
-}
-
-// OS represents an Equinix Metal operating system
-type OS struct {
- Name string `json:"name"`
- Slug string `json:"slug"`
- Distro string `json:"distro"`
- Version string `json:"version"`
- ProvisionableOn []string `json:"provisionable_on"`
-}
-
-func (o OS) String() string {
- return Stringify(o)
-}
-
-// OSServiceOp implements OSService
-type OSServiceOp struct {
- client *Client
-}
-
-// List returns all available operating systems
-func (s *OSServiceOp) List() ([]OS, *Response, error) {
- root := new(osRoot)
-
- resp, err := s.client.DoRequest("GET", osBasePath, nil, root)
- if err != nil {
- return nil, resp, err
- }
-
- return root.OperatingSystems, resp, err
-}
diff --git a/vendor/github.com/packethost/packngo/organizations.go b/vendor/github.com/packethost/packngo/organizations.go
deleted file mode 100644
index c4e2c77f..00000000
--- a/vendor/github.com/packethost/packngo/organizations.go
+++ /dev/null
@@ -1,186 +0,0 @@
-package packngo
-
-import (
- "path"
-)
-
-// API documentation https://metal.equinix.com/developers/api/organizations/
-const organizationBasePath = "/organizations"
-
-// OrganizationService interface defines available organization methods
-type OrganizationService interface {
- List(*ListOptions) ([]Organization, *Response, error)
- Get(string, *GetOptions) (*Organization, *Response, error)
- Create(*OrganizationCreateRequest) (*Organization, *Response, error)
- Update(string, *OrganizationUpdateRequest) (*Organization, *Response, error)
- Delete(string) (*Response, error)
- ListPaymentMethods(string) ([]PaymentMethod, *Response, error)
- ListEvents(string, *ListOptions) ([]Event, *Response, error)
-}
-
-type organizationsRoot struct {
- Organizations []Organization `json:"organizations"`
- Meta meta `json:"meta"`
-}
-
-// Organization represents an Equinix Metal organization
-type Organization struct {
- ID string `json:"id"`
- Name string `json:"name,omitempty"`
- Description string `json:"description,omitempty"`
- Website string `json:"website,omitempty"`
- Twitter string `json:"twitter,omitempty"`
- Created string `json:"created_at,omitempty"`
- Updated string `json:"updated_at,omitempty"`
- Address Address `json:"address,omitempty"`
- TaxID string `json:"tax_id,omitempty"`
- MainPhone string `json:"main_phone,omitempty"`
- BillingPhone string `json:"billing_phone,omitempty"`
- CreditAmount float64 `json:"credit_amount,omitempty"`
- Logo string `json:"logo,omitempty"`
- LogoThumb string `json:"logo_thumb,omitempty"`
- Projects []Project `json:"projects,omitempty"`
- URL string `json:"href,omitempty"`
- Members []Member `json:"members,omitempty"`
- Owners []User `json:"owners,omitempty"`
- PrimaryOwner User `json:"primary_owner,omitempty"`
-}
-
-func (o Organization) String() string {
- return Stringify(o)
-}
-
-// OrganizationCreateRequest type used to create an Equinix Metal organization
-type OrganizationCreateRequest struct {
- Name string `json:"name"`
- Description string `json:"description,omitempty"`
- Website string `json:"website,omitempty"`
- Twitter string `json:"twitter,omitempty"`
- Logo string `json:"logo,omitempty"`
- Address Address `json:"address,omitempty"`
-}
-
-func (o OrganizationCreateRequest) String() string {
- return Stringify(o)
-}
-
-// OrganizationUpdateRequest type used to update an Equinix Metal organization
-type OrganizationUpdateRequest struct {
- Name *string `json:"name,omitempty"`
- Description *string `json:"description,omitempty"`
- Website *string `json:"website,omitempty"`
- Twitter *string `json:"twitter,omitempty"`
- Logo *string `json:"logo,omitempty"`
- Address *Address `json:"address,omitempty"`
-}
-
-func (o OrganizationUpdateRequest) String() string {
- return Stringify(o)
-}
-
-// OrganizationServiceOp implements OrganizationService
-type OrganizationServiceOp struct {
- client *Client
-}
-
-// List returns the user's organizations
-func (s *OrganizationServiceOp) List(opts *ListOptions) (orgs []Organization, resp *Response, err error) {
- subset := new(organizationsRoot)
-
- apiPathQuery := opts.WithQuery(organizationBasePath)
-
- for {
- resp, err = s.client.DoRequest("GET", apiPathQuery, nil, subset)
- if err != nil {
- return nil, resp, err
- }
-
- orgs = append(orgs, subset.Organizations...)
-
- if apiPathQuery = nextPage(subset.Meta, opts); apiPathQuery != "" {
- continue
- }
- return
- }
-}
-
-// Get returns a organization by id
-func (s *OrganizationServiceOp) Get(organizationID string, opts *GetOptions) (*Organization, *Response, error) {
- if validateErr := ValidateUUID(organizationID); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(organizationBasePath, organizationID)
- apiPathQuery := opts.WithQuery(endpointPath)
- organization := new(Organization)
-
- resp, err := s.client.DoRequest("GET", apiPathQuery, nil, organization)
- if err != nil {
- return nil, resp, err
- }
-
- return organization, resp, err
-}
-
-// Create creates a new organization
-func (s *OrganizationServiceOp) Create(createRequest *OrganizationCreateRequest) (*Organization, *Response, error) {
- organization := new(Organization)
-
- resp, err := s.client.DoRequest("POST", organizationBasePath, createRequest, organization)
- if err != nil {
- return nil, resp, err
- }
-
- return organization, resp, err
-}
-
-// Update updates an organization
-func (s *OrganizationServiceOp) Update(id string, updateRequest *OrganizationUpdateRequest) (*Organization, *Response, error) {
- if validateErr := ValidateUUID(id); validateErr != nil {
- return nil, nil, validateErr
- }
- apiPath := path.Join(organizationBasePath, id)
- organization := new(Organization)
-
- resp, err := s.client.DoRequest("PATCH", apiPath, updateRequest, organization)
- if err != nil {
- return nil, resp, err
- }
-
- return organization, resp, err
-}
-
-// Delete deletes an organizationID
-func (s *OrganizationServiceOp) Delete(organizationID string) (*Response, error) {
- if validateErr := ValidateUUID(organizationID); validateErr != nil {
- return nil, validateErr
- }
- apiPath := path.Join(organizationBasePath, organizationID)
-
- return s.client.DoRequest("DELETE", apiPath, nil, nil)
-}
-
-// ListPaymentMethods returns PaymentMethods for an organization
-func (s *OrganizationServiceOp) ListPaymentMethods(organizationID string) ([]PaymentMethod, *Response, error) {
- if validateErr := ValidateUUID(organizationID); validateErr != nil {
- return nil, nil, validateErr
- }
- apiPath := path.Join(organizationBasePath, organizationID, paymentMethodBasePath)
- root := new(paymentMethodsRoot)
-
- resp, err := s.client.DoRequest("GET", apiPath, nil, root)
- if err != nil {
- return nil, resp, err
- }
-
- return root.PaymentMethods, resp, err
-}
-
-// ListEvents returns list of organization events
-func (s *OrganizationServiceOp) ListEvents(organizationID string, listOpt *ListOptions) ([]Event, *Response, error) {
- if validateErr := ValidateUUID(organizationID); validateErr != nil {
- return nil, nil, validateErr
- }
- apiPath := path.Join(organizationBasePath, organizationID, eventBasePath)
-
- return listEvents(s.client, apiPath, listOpt)
-}
diff --git a/vendor/github.com/packethost/packngo/packngo.go b/vendor/github.com/packethost/packngo/packngo.go
deleted file mode 100644
index 25c9c331..00000000
--- a/vendor/github.com/packethost/packngo/packngo.go
+++ /dev/null
@@ -1,468 +0,0 @@
-package packngo
-
-import (
- "bytes"
- "context"
- "encoding/json"
- "fmt"
- "io"
- "io/ioutil"
- "log"
- "net/http"
- "net/http/httputil"
- "net/url"
- "os"
- "regexp"
- "strconv"
- "strings"
- "time"
-)
-
-const (
- authTokenEnvVar = "PACKET_AUTH_TOKEN"
- baseURL = "https://api.equinix.com/metal/v1/"
- mediaType = "application/json"
- debugEnvVar = "PACKNGO_DEBUG"
-
- headerRateLimit = "X-RateLimit-Limit"
- headerRateRemaining = "X-RateLimit-Remaining"
- headerRateReset = "X-RateLimit-Reset"
- expectedAPIContentTypePrefix = "application/json"
-)
-
-// meta contains pagination information
-type meta struct {
- Self *Href `json:"self"`
- First *Href `json:"first"`
- Last *Href `json:"last"`
- Previous *Href `json:"previous,omitempty"`
- Next *Href `json:"next,omitempty"`
- Total int `json:"total"`
- CurrentPageNum int `json:"current_page"`
- LastPageNum int `json:"last_page"`
-}
-
-// Response is the http response from api calls
-type Response struct {
- *http.Response
- Rate
-}
-
-// Href is an API link
-type Href struct {
- Href string `json:"href"`
-}
-
-func (r *Response) populateRate() {
- // parse the rate limit headers and populate Response.Rate
- if limit := r.Header.Get(headerRateLimit); limit != "" {
- r.Rate.RequestLimit, _ = strconv.Atoi(limit)
- }
- if remaining := r.Header.Get(headerRateRemaining); remaining != "" {
- r.Rate.RequestsRemaining, _ = strconv.Atoi(remaining)
- }
- if reset := r.Header.Get(headerRateReset); reset != "" {
- if v, _ := strconv.ParseInt(reset, 10, 64); v != 0 {
- r.Rate.Reset = Timestamp{time.Unix(v, 0)}
- }
- }
-}
-
-// ErrorResponse is the http response used on errors
-type ErrorResponse struct {
- Response *http.Response
- Errors []string `json:"errors"`
- SingleError string `json:"error"`
-}
-
-func (r *ErrorResponse) Error() string {
- return fmt.Sprintf("%v %v: %d %v %v",
- r.Response.Request.Method, r.Response.Request.URL, r.Response.StatusCode, strings.Join(r.Errors, ", "), r.SingleError)
-}
-
-// Client is the base API Client
-type Client struct {
- client *http.Client
- debug bool
-
- BaseURL *url.URL
-
- UserAgent string
- ConsumerToken string
- APIKey string
- apiKeySet bool
- header http.Header
-
- RateLimit Rate
-
- // Equinix Metal Api Objects
- APIKeys APIKeyService
- BGPConfig BGPConfigService
- BGPSessions BGPSessionService
- Batches BatchService
- CapacityService CapacityService
- Connections ConnectionService
- DeviceIPs DeviceIPService
- Devices DeviceService
- Emails EmailService
- Events EventService
- Facilities FacilityService
- HardwareReservations HardwareReservationService
- Invitations InvitationService
- Members MemberService
- Metros MetroService
- Notifications NotificationService
- OperatingSystems OSService
- Organizations OrganizationService
- Plans PlanService
- Ports PortService
- ProjectIPs ProjectIPService
- ProjectVirtualNetworks ProjectVirtualNetworkService
- Projects ProjectService
- SSHKeys SSHKeyService
- SpotMarket SpotMarketService
- SpotMarketRequests SpotMarketRequestService
- MetalGateways MetalGatewayService
- TwoFactorAuth TwoFactorAuthService
- Users UserService
- VirtualCircuits VirtualCircuitService
- VLANAssignments VLANAssignmentService
- VolumeAttachments VolumeAttachmentService
- Volumes VolumeService
- VRFs VRFService
-
- // DevicePorts
- //
- // Deprecated: Use Client.Ports or Device methods
- DevicePorts DevicePortService
-}
-
-// requestDoer provides methods for making HTTP requests and receiving the
-// response, errors, and a structured result
-//
-// This interface is used in *ServiceOp as a mockable alternative to a full
-// Client object.
-type requestDoer interface {
- NewRequest(method, path string, body interface{}) (*http.Request, error)
- Do(req *http.Request, v interface{}) (*Response, error)
- DoRequest(method, path string, body, v interface{}) (*Response, error)
- DoRequestWithHeader(method string, headers map[string]string, path string, body, v interface{}) (*Response, error)
-}
-
-// NewRequest inits a new http request with the proper headers
-func (c *Client) NewRequest(method, path string, body interface{}) (*http.Request, error) {
- // relative path to append to the endpoint url, no leading slash please
- if path[0] == '/' {
- path = path[1:]
- }
- rel, err := url.Parse(path)
- if err != nil {
- return nil, err
- }
-
- u := c.BaseURL.ResolveReference(rel)
-
- // json encode the request body, if any
- buf := new(bytes.Buffer)
- if body != nil {
- err := json.NewEncoder(buf).Encode(body)
- if err != nil {
- return nil, err
- }
- }
-
- req, err := http.NewRequest(method, u.String(), buf)
- if err != nil {
- return nil, err
- }
-
- req.Close = true
-
- req.Header = c.header.Clone()
- req.Header.Set("X-Auth-Token", c.APIKey)
- req.Header.Set("X-Consumer-Token", c.ConsumerToken)
- req.Header.Set("User-Agent", c.UserAgent)
-
- return req, nil
-}
-
-// Do executes the http request
-func (c *Client) Do(req *http.Request, v interface{}) (*Response, error) {
- resp, err := c.client.Do(req)
- if err != nil {
- return nil, err
- }
-
- defer resp.Body.Close()
-
- response := Response{Response: resp}
- response.populateRate()
- if c.debug {
- dumpResponse(response.Response)
- }
- dumpDeprecation(response.Response)
- c.RateLimit = response.Rate
-
- err = checkResponse(resp)
- // if the response is an error, return the ErrorResponse
- if err != nil {
- return &response, err
- }
-
- if v != nil {
- // if v implements the io.Writer interface, return the raw response
- if w, ok := v.(io.Writer); ok {
- _, err = io.Copy(w, resp.Body)
- if err != nil {
- return &response, err
- }
- } else {
- err = json.NewDecoder(resp.Body).Decode(v)
- if err != nil {
- return &response, err
- }
- }
- }
-
- return &response, err
-}
-
-// dumpDeprecation logs headers defined by
-// https://tools.ietf.org/html/rfc8594
-func dumpDeprecation(resp *http.Response) {
- uri := ""
- if resp.Request != nil {
- uri = resp.Request.Method + " " + resp.Request.URL.Path
- }
-
- deprecation := resp.Header.Get("Deprecation")
- if deprecation != "" {
- if deprecation == "true" {
- deprecation = ""
- } else {
- deprecation = " on " + deprecation
- }
- log.Printf("WARNING: %q reported deprecation%s", uri, deprecation)
- }
-
- sunset := resp.Header.Get("Sunset")
- if sunset != "" {
- log.Printf("WARNING: %q reported sunsetting on %s", uri, sunset)
- }
-
- links := resp.Header.Values("Link")
-
- for _, s := range links {
- for _, ss := range strings.Split(s, ",") {
- if strings.Contains(ss, "rel=\"sunset\"") {
- link := strings.Split(ss, ";")[0]
- log.Printf("WARNING: See %s for sunset details", link)
- } else if strings.Contains(ss, "rel=\"deprecation\"") {
- link := strings.Split(ss, ";")[0]
- log.Printf("WARNING: See %s for deprecation details", link)
- }
- }
- }
-}
-
-// from terraform-plugin-sdk/v2/helper/logging/transport.go
-func prettyPrintJsonLines(b []byte) string {
- parts := strings.Split(string(b), "\n")
- for i, p := range parts {
- if b := []byte(p); json.Valid(b) {
- var out bytes.Buffer
- _ = json.Indent(&out, b, "", " ")
- parts[i] = out.String()
- }
- }
- return strings.Join(parts, "\n")
-}
-
-func dumpResponse(resp *http.Response) {
- o, _ := httputil.DumpResponse(resp, true)
- strResp := prettyPrintJsonLines(o)
- reg, _ := regexp.Compile(`"token":(.+?),`)
- reMatches := reg.FindStringSubmatch(strResp)
- if len(reMatches) == 2 {
- strResp = strings.Replace(strResp, reMatches[1], strings.Repeat("-", len(reMatches[1])), 1)
- }
- log.Printf("\n=======[RESPONSE]============\n%s\n\n", strResp)
-}
-
-func dumpRequest(req *http.Request) {
- r := req.Clone(context.TODO())
- r.Body, _ = req.GetBody()
- h := r.Header
- if len(h.Get("X-Auth-Token")) != 0 {
- h.Set("X-Auth-Token", "**REDACTED**")
- }
- defer r.Body.Close()
-
- o, _ := httputil.DumpRequestOut(r, false)
- bbs, _ := ioutil.ReadAll(r.Body)
- reqBodyStr := prettyPrintJsonLines(bbs)
- strReq := prettyPrintJsonLines(o)
- log.Printf("\n=======[REQUEST]=============\n%s%s\n", string(strReq), reqBodyStr)
-}
-
-// DoRequest is a convenience method, it calls NewRequest followed by Do
-// v is the interface to unmarshal the response JSON into
-func (c *Client) DoRequest(method, path string, body, v interface{}) (*Response, error) {
- req, err := c.NewRequest(method, path, body)
- if c.debug {
- dumpRequest(req)
- }
- if err != nil {
- return nil, err
- }
- return c.Do(req, v)
-}
-
-// DoRequestWithHeader same as DoRequest
-func (c *Client) DoRequestWithHeader(method string, headers map[string]string, path string, body, v interface{}) (*Response, error) {
- req, err := c.NewRequest(method, path, body)
- for k, v := range headers {
- req.Header.Add(k, v)
- }
-
- if c.debug {
- dumpRequest(req)
- }
- if err != nil {
- return nil, err
- }
- return c.Do(req, v)
-}
-
-// NewClientWithAuth initializes and returns a Client, use this to get an API Client to operate on
-// N.B.: Equinix Metal's API certificate requires Go 1.5+ to successfully parse. If you are using
-// an older version of Go, pass in a custom http.Client with a custom TLS configuration
-// that sets "InsecureSkipVerify" to "true"
-func NewClientWithAuth(consumerToken string, apiKey string, httpClient *http.Client) *Client {
- client, _ := NewClientWithBaseURL(consumerToken, apiKey, httpClient, baseURL)
- return client
-}
-
-// NewClientWithBaseURL returns a Client pointing to nonstandard API URL, e.g.
-// for mocking the remote API
-func NewClientWithBaseURL(consumerToken string, apiKey string, httpClient *http.Client, apiBaseURL string) (*Client, error) {
- if httpClient == nil {
- httpClient = http.DefaultClient
- }
-
- return NewClient(WithAuth(consumerToken, apiKey), WithHTTPClient(httpClient), WithBaseURL(apiBaseURL))
-}
-
-// NewClient initializes and returns a Client. The opts are functions such as WithAuth,
-// WithHTTPClient, etc.
-//
-// An example:
-//
-// c, err := NewClient()
-//
-// An alternative example, which avoids reading PACKET_AUTH_TOKEN environment variable:
-//
-// c, err := NewClient(WithAuth("packngo lib", packetAuthToken))
-func NewClient(opts ...ClientOpt) (*Client, error) {
- // set defaults, then let caller override them
- c := &Client{
- client: http.DefaultClient,
- UserAgent: UserAgent,
- ConsumerToken: "packngo lib",
- header: http.Header{},
- }
-
- c.header.Set("Content-Type", mediaType)
- c.header.Set("Accept", mediaType)
-
- var err error
- c.BaseURL, err = url.Parse(baseURL)
- if err != nil {
- return nil, err
- }
-
- c.APIKeys = &APIKeyServiceOp{client: c}
- c.BGPConfig = &BGPConfigServiceOp{client: c}
- c.BGPSessions = &BGPSessionServiceOp{client: c}
- c.Batches = &BatchServiceOp{client: c}
- c.CapacityService = &CapacityServiceOp{client: c}
- c.Connections = &ConnectionServiceOp{client: c}
- c.DeviceIPs = &DeviceIPServiceOp{client: c}
- c.DevicePorts = &DevicePortServiceOp{client: c}
- c.Devices = &DeviceServiceOp{client: c}
- c.Emails = &EmailServiceOp{client: c}
- c.Events = &EventServiceOp{client: c}
- c.Facilities = &FacilityServiceOp{client: c}
- c.HardwareReservations = &HardwareReservationServiceOp{client: c}
- c.Invitations = &InvitationServiceOp{client: c}
- c.Members = &MemberServiceOp{client: c}
- c.Metros = &MetroServiceOp{client: c}
- c.Notifications = &NotificationServiceOp{client: c}
- c.OperatingSystems = &OSServiceOp{client: c}
- c.Organizations = &OrganizationServiceOp{client: c}
- c.Plans = &PlanServiceOp{client: c}
- c.Ports = &PortServiceOp{client: c}
- c.ProjectIPs = &ProjectIPServiceOp{client: c}
- c.ProjectVirtualNetworks = &ProjectVirtualNetworkServiceOp{client: c}
- c.Projects = &ProjectServiceOp{client: c}
- c.SSHKeys = &SSHKeyServiceOp{client: c}
- c.SpotMarket = &SpotMarketServiceOp{client: c}
- c.SpotMarketRequests = &SpotMarketRequestServiceOp{client: c}
- c.MetalGateways = &MetalGatewayServiceOp{client: c}
- c.TwoFactorAuth = &TwoFactorAuthServiceOp{client: c}
- c.Users = &UserServiceOp{client: c}
- c.VirtualCircuits = &VirtualCircuitServiceOp{client: c}
- c.VolumeAttachments = &VolumeAttachmentServiceOp{client: c}
- c.Volumes = &VolumeServiceOp{client: c}
- c.VRFs = &VRFServiceOp{client: c}
- c.VLANAssignments = &VLANAssignmentServiceOp{client: c}
- c.debug = os.Getenv(debugEnvVar) != ""
-
- for _, fn := range opts {
- err := fn(c)
- if err != nil {
- return nil, err
- }
- }
-
- if !c.apiKeySet {
- c.APIKey = os.Getenv(authTokenEnvVar)
-
- if c.APIKey == "" {
- return nil, fmt.Errorf("you must export %s", authTokenEnvVar)
- }
-
- c.apiKeySet = true
- }
-
- return c, nil
-}
-
-func checkResponse(r *http.Response) error {
- if s := r.StatusCode; s >= 200 && s <= 299 {
- // response is good, return
- return nil
- }
-
- errorResponse := &ErrorResponse{Response: r}
- data, err := ioutil.ReadAll(r.Body)
- // if the response has a body, populate the message in errorResponse
- if err != nil {
- return err
- }
-
- ct := r.Header.Get("Content-Type")
- if !strings.HasPrefix(ct, expectedAPIContentTypePrefix) {
- errorResponse.SingleError = fmt.Sprintf("Unexpected Content-Type %s with status %s", ct, r.Status)
- return errorResponse
- }
-
- if len(data) > 0 {
- err = json.Unmarshal(data, errorResponse)
- if err != nil {
- return err
- }
- }
-
- return errorResponse
-}
diff --git a/vendor/github.com/packethost/packngo/payment_methods.go b/vendor/github.com/packethost/packngo/payment_methods.go
deleted file mode 100644
index 8f9840f0..00000000
--- a/vendor/github.com/packethost/packngo/payment_methods.go
+++ /dev/null
@@ -1,71 +0,0 @@
-package packngo
-
-// API documentation https://metal.equinix.com/developers/api/paymentmethods/
-const paymentMethodBasePath = "/payment-methods"
-
-// ProjectService interface defines available project methods
-type PaymentMethodService interface {
- List() ([]PaymentMethod, *Response, error)
- Get(string) (*PaymentMethod, *Response, error)
- Create(*PaymentMethodCreateRequest) (*PaymentMethod, *Response, error)
- Update(string, *PaymentMethodUpdateRequest) (*PaymentMethod, *Response, error)
- Delete(string) (*Response, error)
-}
-
-type paymentMethodsRoot struct {
- PaymentMethods []PaymentMethod `json:"payment_methods"`
-}
-
-// PaymentMethod represents an Equinix Metal payment method of an organization
-type PaymentMethod struct {
- ID string `json:"id"`
- Name string `json:"name,omitempty"`
- Created string `json:"created_at,omitempty"`
- Updated string `json:"updated_at,omitempty"`
- Nonce string `json:"nonce,omitempty"`
- Default bool `json:"default,omitempty"`
- Organization Organization `json:"organization,omitempty"`
- Projects []Project `json:"projects,omitempty"`
- Type string `json:"type,omitempty"`
- CardholderName string `json:"cardholder_name,omitempty"`
- ExpMonth string `json:"expiration_month,omitempty"`
- ExpYear string `json:"expiration_year,omitempty"`
- Last4 string `json:"last_4,omitempty"`
- BillingAddress BillingAddress `json:"billing_address,omitempty"`
- URL string `json:"href,omitempty"`
-}
-
-func (pm PaymentMethod) String() string {
- return Stringify(pm)
-}
-
-// PaymentMethodCreateRequest type used to create an Equinix Metal payment method of an organization
-type PaymentMethodCreateRequest struct {
- Name string `json:"name"`
- Nonce string `json:"nonce"`
- CardholderName string `json:"cardholder_name,omitempty"`
- ExpMonth string `json:"expiration_month,omitempty"`
- ExpYear string `json:"expiration_year,omitempty"`
- BillingAddress string `json:"billing_address,omitempty"`
-}
-
-func (pm PaymentMethodCreateRequest) String() string {
- return Stringify(pm)
-}
-
-// PaymentMethodUpdateRequest type used to update an Equinix Metal payment method of an organization
-type PaymentMethodUpdateRequest struct {
- Name *string `json:"name,omitempty"`
- CardholderName *string `json:"cardholder_name,omitempty"`
- ExpMonth *string `json:"expiration_month,omitempty"`
- ExpYear *string `json:"expiration_year,omitempty"`
- BillingAddress *string `json:"billing_address,omitempty"`
-}
-
-func (pm PaymentMethodUpdateRequest) String() string {
- return Stringify(pm)
-}
-
-// PaymentMethodServiceOp implements PaymentMethodService
-type PaymentMethodServiceOp struct {
-}
diff --git a/vendor/github.com/packethost/packngo/plans.go b/vendor/github.com/packethost/packngo/plans.go
deleted file mode 100644
index 8b815c44..00000000
--- a/vendor/github.com/packethost/packngo/plans.go
+++ /dev/null
@@ -1,201 +0,0 @@
-package packngo
-
-import (
- "encoding/json"
- "path"
-)
-
-const planBasePath = "/plans"
-
-// PlanService interface defines available plan methods
-type PlanService interface {
- List(*ListOptions) ([]Plan, *Response, error)
- ProjectList(string, *ListOptions) ([]Plan, *Response, error)
- OrganizationList(string, *ListOptions) ([]Plan, *Response, error)
-}
-
-type planRoot struct {
- Plans []Plan `json:"plans"`
-}
-
-// Plan represents an Equinix Metal service plan
-type Plan struct {
- ID string `json:"id"`
- Slug string `json:"slug,omitempty"`
- Name string `json:"name,omitempty"`
- Description string `json:"description,omitempty"`
- Line string `json:"line,omitempty"`
- Legacy bool `json:"legacy,omitempty"`
- Specs *Specs `json:"specs,omitempty"`
- Pricing *Pricing `json:"pricing,omitempty"`
- DeploymentTypes []string `json:"deployment_types"`
- Class string `json:"class"`
- AvailableIn []Facility `json:"available_in"`
- AvailableInMetros []Metro `json:"available_in_metros"`
- ReservationPricing *ReservationPricing `json:"reservation_pricing,omitempty"`
-
- Href string `json:"href,omitempty"`
-}
-
-func (p Plan) String() string {
- return Stringify(p)
-}
-
-type MetroPricing map[string]AnnualReservationPricing
-
-// ReservationPricing - The reserved pricing for a plan
-type ReservationPricing struct {
- AnnualReservationPricing
- Metros MetroPricing
-}
-
-func (r ReservationPricing) String() string {
- return Stringify(r)
-}
-
-// UnmarshalJSON - Custom unmarshal function to set up the ReservationPricing object
-func (r *ReservationPricing) UnmarshalJSON(data []byte) error {
- var a AnnualReservationPricing
- var m MetroPricing
-
- // Leverage the built in unmarshalling to sort out all the fields
- err := json.Unmarshal(data, &a)
- if err != nil {
- return err
- }
- err = json.Unmarshal(data, &m)
- if err != nil {
- return err
- }
- // Remove three_year and one_year from the metropricing object
- delete(m, "three_year")
- delete(m, "one_year")
-
- // Pass the objects to the parent
- r.Metros = m
- r.AnnualReservationPricing = a
-
- return nil
-}
-
-type AnnualReservationPricing struct {
- OneYear *Pricing `json:"one_year"`
- ThreeYear *Pricing `json:"three_year"`
-}
-
-func (m AnnualReservationPricing) String() string {
- return Stringify(m)
-}
-
-// Specs - the server specs for a plan
-type Specs struct {
- Cpus []*Cpus `json:"cpus,omitempty"`
- Memory *Memory `json:"memory,omitempty"`
- Drives []*Drives `json:"drives,omitempty"`
- Nics []*Nics `json:"nics,omitempty"`
- Features *Features `json:"features,omitempty"`
-}
-
-func (s Specs) String() string {
- return Stringify(s)
-}
-
-// Cpus - the CPU config details for specs on a plan
-type Cpus struct {
- Count int `json:"count,omitempty"`
- Type string `json:"type,omitempty"`
-}
-
-func (c Cpus) String() string {
- return Stringify(c)
-}
-
-// Memory - the RAM config details for specs on a plan
-type Memory struct {
- Total string `json:"total,omitempty"`
-}
-
-func (m Memory) String() string {
- return Stringify(m)
-}
-
-// Drives - the storage config details for specs on a plan
-type Drives struct {
- Count int `json:"count,omitempty"`
- Size string `json:"size,omitempty"`
- Type string `json:"type,omitempty"`
-}
-
-func (d Drives) String() string {
- return Stringify(d)
-}
-
-// Nics - the network hardware details for specs on a plan
-type Nics struct {
- Count int `json:"count,omitempty"`
- Type string `json:"type,omitempty"`
-}
-
-func (n Nics) String() string {
- return Stringify(n)
-}
-
-// Features - other features in the specs for a plan
-type Features struct {
- Raid bool `json:"raid,omitempty"`
- Txt bool `json:"txt,omitempty"`
-}
-
-func (f Features) String() string {
- return Stringify(f)
-}
-
-// Pricing - the pricing options on a plan
-type Pricing struct {
- Hour float32 `json:"hour,omitempty"`
- Month float32 `json:"month,omitempty"`
-}
-
-func (p Pricing) String() string {
- return Stringify(p)
-}
-
-// PlanServiceOp implements PlanService
-type PlanServiceOp struct {
- client *Client
-}
-
-func planList(c *Client, apiPath string, opts *ListOptions) ([]Plan, *Response, error) {
- root := new(planRoot)
- apiPathQuery := opts.WithQuery(apiPath)
-
- resp, err := c.DoRequest("GET", apiPathQuery, nil, root)
- if err != nil {
- return nil, resp, err
- }
-
- return root.Plans, resp, err
-
-}
-
-// List method returns all available plans
-func (s *PlanServiceOp) List(opts *ListOptions) ([]Plan, *Response, error) {
- return planList(s.client, planBasePath, opts)
-
-}
-
-// ProjectList method returns plans available in a project
-func (s *PlanServiceOp) ProjectList(projectID string, opts *ListOptions) ([]Plan, *Response, error) {
- if validateErr := ValidateUUID(projectID); validateErr != nil {
- return nil, nil, validateErr
- }
- return planList(s.client, path.Join(projectBasePath, projectID, planBasePath), opts)
-}
-
-// OrganizationList method returns plans available in an organization
-func (s *PlanServiceOp) OrganizationList(organizationID string, opts *ListOptions) ([]Plan, *Response, error) {
- if validateErr := ValidateUUID(organizationID); validateErr != nil {
- return nil, nil, validateErr
- }
- return planList(s.client, path.Join(organizationBasePath, organizationID, planBasePath), opts)
-}
diff --git a/vendor/github.com/packethost/packngo/ports.go b/vendor/github.com/packethost/packngo/ports.go
deleted file mode 100644
index 286f70ed..00000000
--- a/vendor/github.com/packethost/packngo/ports.go
+++ /dev/null
@@ -1,248 +0,0 @@
-package packngo
-
-import (
- "path"
-)
-
-// PortService handles operations on a port
-type PortService interface {
- Assign(string, string) (*Port, *Response, error)
- Unassign(string, string) (*Port, *Response, error)
- AssignNative(string, string) (*Port, *Response, error)
- UnassignNative(string) (*Port, *Response, error)
- Bond(string, bool) (*Port, *Response, error)
- Disbond(string, bool) (*Port, *Response, error)
- ConvertToLayerTwo(string) (*Port, *Response, error)
- ConvertToLayerThree(string, []AddressRequest) (*Port, *Response, error)
- Get(string, *GetOptions) (*Port, *Response, error)
-}
-
-type PortServiceOp struct {
- client requestDoer
-}
-
-var _ PortService = (*PortServiceOp)(nil)
-
-type PortData struct {
- // MAC address is set for NetworkPort ports
- MAC string `json:"mac,omitempty"`
-
- // Bonded is true for NetworkPort ports in a bond and NetworkBondPort ports
- // that are active
- Bonded bool `json:"bonded"`
-}
-
-type BondData struct {
- // ID is the Port.ID of the bonding port
- ID string `json:"id"`
-
- // Name of the port interface for the bond ("bond0")
- Name string `json:"name"`
-}
-
-// Port is a hardware port associated with a reserved or instantiated hardware
-// device.
-type Port struct {
- *Href `json:",inline"`
-
- // ID of the Port
- ID string `json:"id"`
-
- // Type is either "NetworkBondPort" for bond ports or "NetworkPort" for
- // bondable ethernet ports
- Type string `json:"type"`
-
- // Name of the interface for this port (such as "bond0" or "eth0")
- Name string `json:"name"`
-
- // Data about the port
- Data PortData `json:"data,omitempty"`
-
- // Indicates whether or not the bond can be broken on the port (when applicable).
- DisbondOperationSupported bool `json:"disbond_operation_supported,omitempty"`
-
- // NetworkType is either of layer2-bonded, layer2-individual, layer3,
- // hybrid, hybrid-bonded
- NetworkType string `json:"network_type,omitempty"`
-
- // NativeVirtualNetwork is the Native VLAN attached to the port
- //
- NativeVirtualNetwork *VirtualNetwork `json:"native_virtual_network,omitempty"`
-
- // VLANs attached to the port
- AttachedVirtualNetworks []VirtualNetwork `json:"virtual_networks,omitempty"`
-
- // Bond details for ports with a NetworkPort type
- Bond *BondData `json:"bond,omitempty"`
-}
-
-type AddressRequest struct {
- AddressFamily int `json:"address_family"`
- Public bool `json:"public"`
-}
-
-type BackToL3Request struct {
- RequestIPs []AddressRequest `json:"request_ips"`
-}
-
-type PortAssignRequest struct {
- // PortID of the Port
- //
- // Deprecated: this is redundant to the portID parameter in request
- // functions. This is kept for use by deprecated DevicePortServiceOps
- // methods.
- PortID string `json:"id,omitempty"`
-
- VirtualNetworkID string `json:"vnid"`
-}
-
-type BondRequest struct {
- BulkEnable bool `json:"bulk_enable"`
-}
-
-type DisbondRequest struct {
- BulkDisable bool `json:"bulk_disable"`
-}
-
-// Assign adds a VLAN to a port
-func (i *PortServiceOp) Assign(portID, vlanID string) (*Port, *Response, error) {
- if validateErr := ValidateUUID(portID); validateErr != nil {
- return nil, nil, validateErr
- }
- if validateErr := ValidateUUID(vlanID); validateErr != nil {
- return nil, nil, validateErr
- }
- apiPath := path.Join(portBasePath, portID, "assign")
- par := &PortAssignRequest{VirtualNetworkID: vlanID}
-
- return i.portAction(apiPath, par)
-}
-
-// AssignNative assigns a virtual network to the port as a "native VLAN"
-// The VLAN being assigned MUST first be added as a vlan using Assign() before
-// you may assign it as the native VLAN
-func (i *PortServiceOp) AssignNative(portID, vlanID string) (*Port, *Response, error) {
- if validateErr := ValidateUUID(portID); validateErr != nil {
- return nil, nil, validateErr
- }
- if validateErr := ValidateUUID(vlanID); validateErr != nil {
- return nil, nil, validateErr
- }
- apiPath := path.Join(portBasePath, portID, "native-vlan")
- par := &PortAssignRequest{VirtualNetworkID: vlanID}
- return i.portAction(apiPath, par)
-}
-
-// UnassignNative removes native VLAN from the supplied port
-func (i *PortServiceOp) UnassignNative(portID string) (*Port, *Response, error) {
- if validateErr := ValidateUUID(portID); validateErr != nil {
- return nil, nil, validateErr
- }
- apiPath := path.Join(portBasePath, portID, "native-vlan")
- port := new(Port)
-
- resp, err := i.client.DoRequest("DELETE", apiPath, nil, port)
- if err != nil {
- return nil, resp, err
- }
-
- return port, resp, err
-}
-
-// Unassign removes a VLAN from the port
-func (i *PortServiceOp) Unassign(portID, vlanID string) (*Port, *Response, error) {
- if validateErr := ValidateUUID(portID); validateErr != nil {
- return nil, nil, validateErr
- }
- if validateErr := ValidateUUID(vlanID); validateErr != nil {
- return nil, nil, validateErr
- }
- apiPath := path.Join(portBasePath, portID, "unassign")
- par := &PortAssignRequest{VirtualNetworkID: vlanID}
-
- return i.portAction(apiPath, par)
-}
-
-// Bond enables bonding for one or all ports
-func (i *PortServiceOp) Bond(portID string, bulkEnable bool) (*Port, *Response, error) {
- if validateErr := ValidateUUID(portID); validateErr != nil {
- return nil, nil, validateErr
- }
- br := &BondRequest{BulkEnable: bulkEnable}
- apiPath := path.Join(portBasePath, portID, "bond")
- return i.portAction(apiPath, br)
-}
-
-// Disbond disables bonding for one or all ports
-func (i *PortServiceOp) Disbond(portID string, bulkEnable bool) (*Port, *Response, error) {
- if validateErr := ValidateUUID(portID); validateErr != nil {
- return nil, nil, validateErr
- }
- dr := &DisbondRequest{BulkDisable: bulkEnable}
- apiPath := path.Join(portBasePath, portID, "disbond")
- return i.portAction(apiPath, dr)
-}
-
-func (i *PortServiceOp) portAction(apiPath string, req interface{}) (*Port, *Response, error) {
- port := new(Port)
-
- resp, err := i.client.DoRequest("POST", apiPath, req, port)
- if err != nil {
- return nil, resp, err
- }
-
- return port, resp, err
-}
-
-// ConvertToLayerTwo converts a bond port to Layer 2. IP assignments of the port will be removed.
-//
-// portID is the UUID of a Bonding Port
-func (i *PortServiceOp) ConvertToLayerTwo(portID string) (*Port, *Response, error) {
- if validateErr := ValidateUUID(portID); validateErr != nil {
- return nil, nil, validateErr
- }
- apiPath := path.Join(portBasePath, portID, "convert", "layer-2")
- port := new(Port)
-
- resp, err := i.client.DoRequest("POST", apiPath, nil, port)
- if err != nil {
- return nil, resp, err
- }
-
- return port, resp, err
-}
-
-// ConvertToLayerThree converts a bond port to Layer 3. VLANs must first be unassigned.
-func (i *PortServiceOp) ConvertToLayerThree(portID string, ips []AddressRequest) (*Port, *Response, error) {
- if validateErr := ValidateUUID(portID); validateErr != nil {
- return nil, nil, validateErr
- }
- apiPath := path.Join(portBasePath, portID, "convert", "layer-3")
- port := new(Port)
-
- req := BackToL3Request{
- RequestIPs: ips,
- }
-
- resp, err := i.client.DoRequest("POST", apiPath, &req, port)
- if err != nil {
- return nil, resp, err
- }
-
- return port, resp, err
-}
-
-// Get returns a port by id
-func (s *PortServiceOp) Get(portID string, opts *GetOptions) (*Port, *Response, error) {
- if validateErr := ValidateUUID(portID); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(portBasePath, portID)
- apiPathQuery := opts.WithQuery(endpointPath)
- port := new(Port)
- resp, err := s.client.DoRequest("GET", apiPathQuery, nil, port)
- if err != nil {
- return nil, resp, err
- }
- return port, resp, err
-}
diff --git a/vendor/github.com/packethost/packngo/projects.go b/vendor/github.com/packethost/packngo/projects.go
deleted file mode 100644
index 720c3b28..00000000
--- a/vendor/github.com/packethost/packngo/projects.go
+++ /dev/null
@@ -1,222 +0,0 @@
-package packngo
-
-import (
- "path"
-)
-
-const projectBasePath = "/projects"
-
-// ProjectService interface defines available project methods
-type ProjectService interface {
- List(listOpt *ListOptions) ([]Project, *Response, error)
- Get(string, *GetOptions) (*Project, *Response, error)
- Create(*ProjectCreateRequest) (*Project, *Response, error)
- Update(string, *ProjectUpdateRequest) (*Project, *Response, error)
- Delete(string) (*Response, error)
- ListBGPSessions(projectID string, listOpt *ListOptions) ([]BGPSession, *Response, error)
- DiscoverBGPSessions(projectID string, getOpt *GetOptions) (*BGPDiscoverResponse, *Response, error)
- ListEvents(string, *ListOptions) ([]Event, *Response, error)
- ListSSHKeys(projectID string, searchOpt *SearchOptions) ([]SSHKey, *Response, error)
-}
-
-type projectsRoot struct {
- Projects []Project `json:"projects"`
- Meta meta `json:"meta"`
-}
-
-// Project represents an Equinix Metal project
-type Project struct {
- ID string `json:"id"`
- Name string `json:"name,omitempty"`
- Organization Organization `json:"organization,omitempty"`
- Created string `json:"created_at,omitempty"`
- Updated string `json:"updated_at,omitempty"`
- Users []User `json:"members,omitempty"`
- Devices []Device `json:"devices,omitempty"`
- SSHKeys []SSHKey `json:"ssh_keys,omitempty"`
- URL string `json:"href,omitempty"`
- PaymentMethod PaymentMethod `json:"payment_method,omitempty"`
- BackendTransfer bool `json:"backend_transfer_enabled"`
-}
-
-// BGPDiscoverResponse struct is returned from the bgp/discover endpoint
-type BGPDiscoverResponse struct {
- UpdatedAt Timestamp `json:"updated_at"`
-}
-
-func (p Project) String() string {
- return Stringify(p)
-}
-
-// ProjectCreateRequest type used to create an Equinix Metal project
-type ProjectCreateRequest struct {
- Name string `json:"name"`
- PaymentMethodID string `json:"payment_method_id,omitempty"`
- OrganizationID string `json:"organization_id,omitempty"`
-}
-
-func (p ProjectCreateRequest) String() string {
- return Stringify(p)
-}
-
-// ProjectUpdateRequest type used to update an Equinix Metal project
-type ProjectUpdateRequest struct {
- Name *string `json:"name,omitempty"`
- PaymentMethodID *string `json:"payment_method_id,omitempty"`
- BackendTransfer *bool `json:"backend_transfer_enabled,omitempty"`
-}
-
-func (p ProjectUpdateRequest) String() string {
- return Stringify(p)
-}
-
-// ProjectServiceOp implements ProjectService
-type ProjectServiceOp struct {
- client requestDoer
-}
-
-// List returns the user's projects
-func (s *ProjectServiceOp) List(opts *ListOptions) (projects []Project, resp *Response, err error) {
- apiPathQuery := opts.WithQuery(projectBasePath)
-
- for {
- subset := new(projectsRoot)
-
- resp, err = s.client.DoRequest("GET", apiPathQuery, nil, subset)
- if err != nil {
- return nil, resp, err
- }
-
- projects = append(projects, subset.Projects...)
-
- if apiPathQuery = nextPage(subset.Meta, opts); apiPathQuery != "" {
- continue
- }
-
- return
- }
-}
-
-// Get returns a project by id
-func (s *ProjectServiceOp) Get(projectID string, opts *GetOptions) (*Project, *Response, error) {
- if validateErr := ValidateUUID(projectID); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(projectBasePath, projectID)
- apiPathQuery := opts.WithQuery(endpointPath)
- project := new(Project)
- resp, err := s.client.DoRequest("GET", apiPathQuery, nil, project)
- if err != nil {
- return nil, resp, err
- }
- return project, resp, err
-}
-
-// Create creates a new project
-func (s *ProjectServiceOp) Create(createRequest *ProjectCreateRequest) (*Project, *Response, error) {
- project := new(Project)
-
- resp, err := s.client.DoRequest("POST", projectBasePath, createRequest, project)
- if err != nil {
- return nil, resp, err
- }
-
- return project, resp, err
-}
-
-// Update updates a project
-func (s *ProjectServiceOp) Update(id string, updateRequest *ProjectUpdateRequest) (*Project, *Response, error) {
- if validateErr := ValidateUUID(id); validateErr != nil {
- return nil, nil, validateErr
- }
- apiPath := path.Join(projectBasePath, id)
- project := new(Project)
-
- resp, err := s.client.DoRequest("PATCH", apiPath, updateRequest, project)
- if err != nil {
- return nil, resp, err
- }
-
- return project, resp, err
-}
-
-// Delete deletes a project
-func (s *ProjectServiceOp) Delete(projectID string) (*Response, error) {
- if validateErr := ValidateUUID(projectID); validateErr != nil {
- return nil, validateErr
- }
- apiPath := path.Join(projectBasePath, projectID)
-
- return s.client.DoRequest("DELETE", apiPath, nil, nil)
-}
-
-// ListBGPSessions returns all BGP Sessions associated with the project
-func (s *ProjectServiceOp) ListBGPSessions(projectID string, opts *ListOptions) (bgpSessions []BGPSession, resp *Response, err error) {
- if validateErr := ValidateUUID(projectID); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(projectBasePath, projectID, bgpSessionBasePath)
- apiPathQuery := opts.WithQuery(endpointPath)
-
- for {
- subset := new(bgpSessionsRoot)
-
- resp, err = s.client.DoRequest("GET", apiPathQuery, nil, subset)
- if err != nil {
- return nil, resp, err
- }
-
- bgpSessions = append(bgpSessions, subset.Sessions...)
- if apiPathQuery = nextPage(subset.Meta, opts); apiPathQuery != "" {
- continue
- }
- return
- }
-}
-
-// ListSSHKeys returns all SSH Keys associated with the project
-func (s *ProjectServiceOp) ListSSHKeys(projectID string, opts *SearchOptions) (sshKeys []SSHKey, resp *Response, err error) {
- if validateErr := ValidateUUID(projectID); validateErr != nil {
- return nil, nil, validateErr
- }
-
- endpointPath := path.Join(projectBasePath, projectID, sshKeyBasePath)
- apiPathQuery := opts.WithQuery(endpointPath)
-
- subset := new(sshKeyRoot)
-
- resp, err = s.client.DoRequest("GET", apiPathQuery, nil, subset)
- if err != nil {
- return nil, resp, err
- }
-
- sshKeys = append(sshKeys, subset.SSHKeys...)
-
- return
-}
-
-// ListEvents returns list of project events
-func (s *ProjectServiceOp) ListEvents(projectID string, listOpt *ListOptions) ([]Event, *Response, error) {
- if validateErr := ValidateUUID(projectID); validateErr != nil {
- return nil, nil, validateErr
- }
- apiPath := path.Join(projectBasePath, projectID, eventBasePath)
-
- return listEvents(s.client, apiPath, listOpt)
-}
-
-// Discover refreshes BGP session status
-func (p *ProjectServiceOp) DiscoverBGPSessions(projectID string, opts *GetOptions) (*BGPDiscoverResponse, *Response, error) {
- if validateErr := ValidateUUID(projectID); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(bgpDiscoverBasePath, projectID)
- apiPathQuery := opts.WithQuery(endpointPath)
- discovery := new(BGPDiscoverResponse)
- response, err := p.client.DoRequest("POST", apiPathQuery, nil, discovery)
- if err != nil {
- return nil, response, err
- }
-
- return discovery, response, err
-}
diff --git a/vendor/github.com/packethost/packngo/rate.go b/vendor/github.com/packethost/packngo/rate.go
deleted file mode 100644
index 965967d4..00000000
--- a/vendor/github.com/packethost/packngo/rate.go
+++ /dev/null
@@ -1,12 +0,0 @@
-package packngo
-
-// Rate provides the API request rate limit details
-type Rate struct {
- RequestLimit int `json:"request_limit"`
- RequestsRemaining int `json:"requests_remaining"`
- Reset Timestamp `json:"rate_reset"`
-}
-
-func (r Rate) String() string {
- return Stringify(r)
-}
diff --git a/vendor/github.com/packethost/packngo/renovate.json b/vendor/github.com/packethost/packngo/renovate.json
deleted file mode 100644
index 39a2b6e9..00000000
--- a/vendor/github.com/packethost/packngo/renovate.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "$schema": "https://docs.renovatebot.com/renovate-schema.json",
- "extends": [
- "config:base"
- ]
-}
diff --git a/vendor/github.com/packethost/packngo/spotmarket.go b/vendor/github.com/packethost/packngo/spotmarket.go
deleted file mode 100644
index 3c1ee943..00000000
--- a/vendor/github.com/packethost/packngo/spotmarket.go
+++ /dev/null
@@ -1,92 +0,0 @@
-package packngo
-
-import "path"
-
-const (
- spotMarketBasePath = "/market/spot/prices"
-
- spotMarketMetrosPath = "metros"
-)
-
-// SpotMarketService expooses Spot Market methods
-type SpotMarketService interface {
- // Prices gets current spot market prices by facility.
- //
- // Deprecated: Use PricesByFacility
- Prices() (PriceMap, *Response, error)
-
- // PricesByFacility gets current spot market prices by facility. The map is
- // indexed by facility code and then plan name.
- PricesByFacility() (PriceMap, *Response, error)
-
- // PricesByMetro gets current spot market prices by metro. The map is
- // indexed by metro code and then plan name.
- PricesByMetro() (PriceMap, *Response, error)
-}
-
-// SpotMarketServiceOp implements SpotMarketService
-type SpotMarketServiceOp struct {
- client *Client
-}
-
-// PriceMap is a map of [location][plan]-> float Price
-type PriceMap map[string]map[string]float64
-
-// Prices gets current spot market prices by facility.
-//
-// Deprecated: Use PricesByFacility which this function thinly wraps.
-func (s *SpotMarketServiceOp) Prices() (PriceMap, *Response, error) {
- return s.PricesByFacility()
-}
-
-// PricesByFacility gets current spot market prices by facility. The map is
-// indexed by facility code and then plan name.
-//
-// price := client.SpotMarket.PricesByFacility()["ny5"]["c3.medium.x86"]
-func (s *SpotMarketServiceOp) PricesByFacility() (PriceMap, *Response, error) {
- root := new(struct {
- SMPs map[string]map[string]struct {
- Price float64 `json:"price"`
- } `json:"spot_market_prices"`
- })
-
- resp, err := s.client.DoRequest("GET", spotMarketBasePath, nil, root)
- if err != nil {
- return nil, resp, err
- }
-
- prices := make(PriceMap)
- for facility, planMap := range root.SMPs {
- prices[facility] = map[string]float64{}
- for plan, v := range planMap {
- prices[facility][plan] = v.Price
- }
- }
- return prices, resp, err
-}
-
-// PricesByMetro gets current spot market prices by metro. The map is
-// indexed by metro code and then plan name.
-//
-// price := client.SpotMarket.PricesByMetro()["sv"]["c3.medium.x86"]
-func (s *SpotMarketServiceOp) PricesByMetro() (PriceMap, *Response, error) {
- root := new(struct {
- SMPs map[string]map[string]struct {
- Price float64 `json:"price"`
- } `json:"spot_market_prices"`
- })
-
- resp, err := s.client.DoRequest("GET", path.Join(spotMarketBasePath, spotMarketMetrosPath), nil, root)
- if err != nil {
- return nil, resp, err
- }
-
- prices := make(PriceMap)
- for metro, planMap := range root.SMPs {
- prices[metro] = map[string]float64{}
- for plan, v := range planMap {
- prices[metro][plan] = v.Price
- }
- }
- return prices, resp, err
-}
diff --git a/vendor/github.com/packethost/packngo/spotmarketrequest.go b/vendor/github.com/packethost/packngo/spotmarketrequest.go
deleted file mode 100644
index 38894d23..00000000
--- a/vendor/github.com/packethost/packngo/spotmarketrequest.go
+++ /dev/null
@@ -1,132 +0,0 @@
-package packngo
-
-import (
- "math"
- "path"
-)
-
-const spotMarketRequestBasePath = "/spot-market-requests"
-
-type SpotMarketRequestService interface {
- List(string, *ListOptions) ([]SpotMarketRequest, *Response, error)
- Create(*SpotMarketRequestCreateRequest, string) (*SpotMarketRequest, *Response, error)
- Delete(string, bool) (*Response, error)
- Get(string, *GetOptions) (*SpotMarketRequest, *Response, error)
-}
-
-type SpotMarketRequestCreateRequest struct {
- DevicesMax int `json:"devices_max"`
- DevicesMin int `json:"devices_min"`
- EndAt *Timestamp `json:"end_at,omitempty"`
- FacilityIDs []string `json:"facilities,omitempty"`
- Metro string `json:"metro,omitempty"`
- MaxBidPrice float64 `json:"max_bid_price"`
-
- Parameters SpotMarketRequestInstanceParameters `json:"instance_parameters"`
-}
-
-type SpotMarketRequest struct {
- SpotMarketRequestCreateRequest
- ID string `json:"id"`
- Devices []Device `json:"devices"`
- Facilities []Facility `json:"facilities,omitempty"`
- Metro *Metro `json:"metro,omitempty"`
- Project Project `json:"project"`
- Href string `json:"href"`
- Plan Plan `json:"plan"`
-}
-
-type SpotMarketRequestInstanceParameters struct {
- AlwaysPXE bool `json:"always_pxe,omitempty"`
- IPXEScriptURL string `json:"ipxe_script_url,omitempty"`
- BillingCycle string `json:"billing_cycle"`
- CustomData string `json:"customdata,omitempty"`
- Description string `json:"description,omitempty"`
- Features []string `json:"features,omitempty"`
- Hostname string `json:"hostname,omitempty"`
- Hostnames []string `json:"hostnames,omitempty"`
- Locked bool `json:"locked,omitempty"`
- OperatingSystem string `json:"operating_system"`
- Plan string `json:"plan"`
- ProjectSSHKeys []string `json:"project_ssh_keys,omitempty"`
- Tags []string `json:"tags"`
- TerminationTime *Timestamp `json:"termination_time,omitempty"`
- UserSSHKeys []string `json:"user_ssh_keys,omitempty"`
- UserData string `json:"userdata"`
-}
-
-type SpotMarketRequestServiceOp struct {
- client *Client
-}
-
-func roundPlus(f float64, places int) float64 {
- shift := math.Pow(10, float64(places))
- return math.Floor(f*shift+.5) / shift
-}
-
-func (s *SpotMarketRequestServiceOp) Create(cr *SpotMarketRequestCreateRequest, pID string) (*SpotMarketRequest, *Response, error) {
- if validateErr := ValidateUUID(pID); validateErr != nil {
- return nil, nil, validateErr
- }
- opts := (&GetOptions{}).Including("devices", "project", "plan")
- endpointPath := path.Join(projectBasePath, pID, spotMarketRequestBasePath)
- apiPathQuery := opts.WithQuery(endpointPath)
-
- cr.MaxBidPrice = roundPlus(cr.MaxBidPrice, 2)
- smr := new(SpotMarketRequest)
-
- resp, err := s.client.DoRequest("POST", apiPathQuery, cr, smr)
- if err != nil {
- return nil, resp, err
- }
-
- return smr, resp, err
-}
-
-func (s *SpotMarketRequestServiceOp) List(pID string, opts *ListOptions) ([]SpotMarketRequest, *Response, error) {
- if validateErr := ValidateUUID(pID); validateErr != nil {
- return nil, nil, validateErr
- }
- type smrRoot struct {
- SMRs []SpotMarketRequest `json:"spot_market_requests"`
- }
-
- endpointPath := path.Join(projectBasePath, pID, spotMarketRequestBasePath)
- apiPathQuery := opts.WithQuery(endpointPath)
- output := new(smrRoot)
-
- resp, err := s.client.DoRequest("GET", apiPathQuery, nil, output)
- if err != nil {
- return nil, nil, err
- }
-
- return output.SMRs, resp, nil
-}
-
-func (s *SpotMarketRequestServiceOp) Get(id string, opts *GetOptions) (*SpotMarketRequest, *Response, error) {
- if validateErr := ValidateUUID(id); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(spotMarketRequestBasePath, id)
- apiPathQuery := opts.WithQuery(endpointPath)
- smr := new(SpotMarketRequest)
-
- resp, err := s.client.DoRequest("GET", apiPathQuery, nil, &smr)
- if err != nil {
- return nil, resp, err
- }
-
- return smr, resp, err
-}
-
-func (s *SpotMarketRequestServiceOp) Delete(id string, forceDelete bool) (*Response, error) {
- if validateErr := ValidateUUID(id); validateErr != nil {
- return nil, validateErr
- }
- apiPath := path.Join(spotMarketRequestBasePath, id)
- var params *map[string]bool
- if forceDelete {
- params = &map[string]bool{"force_termination": true}
- }
- return s.client.DoRequest("DELETE", apiPath, params, nil)
-}
diff --git a/vendor/github.com/packethost/packngo/sshkeys.go b/vendor/github.com/packethost/packngo/sshkeys.go
deleted file mode 100644
index 8f0934fb..00000000
--- a/vendor/github.com/packethost/packngo/sshkeys.go
+++ /dev/null
@@ -1,155 +0,0 @@
-package packngo
-
-import (
- "fmt"
- "path"
-)
-
-const (
- sshKeyBasePath = "/ssh-keys"
-)
-
-// SSHKeyService interface defines available device methods
-type SSHKeyService interface {
- List() ([]SSHKey, *Response, error)
- ProjectList(string) ([]SSHKey, *Response, error)
- Get(string, *GetOptions) (*SSHKey, *Response, error)
- Create(*SSHKeyCreateRequest) (*SSHKey, *Response, error)
- Update(string, *SSHKeyUpdateRequest) (*SSHKey, *Response, error)
- Delete(string) (*Response, error)
-}
-
-type sshKeyRoot struct {
- SSHKeys []SSHKey `json:"ssh_keys"`
-}
-
-// SSHKey represents a user's ssh key
-type SSHKey struct {
- ID string `json:"id"`
- Label string `json:"label"`
- Key string `json:"key"`
- FingerPrint string `json:"fingerprint"`
- Created string `json:"created_at"`
- Updated string `json:"updated_at"`
- Owner Href
- URL string `json:"href,omitempty"`
-}
-
-func (s SSHKey) String() string {
- return Stringify(s)
-}
-
-// SSHKeyCreateRequest type used to create an ssh key
-type SSHKeyCreateRequest struct {
- Label string `json:"label"`
- Key string `json:"key"`
- ProjectID string `json:"-"`
-}
-
-func (s SSHKeyCreateRequest) String() string {
- return Stringify(s)
-}
-
-// SSHKeyUpdateRequest type used to update an ssh key
-type SSHKeyUpdateRequest struct {
- Label *string `json:"label,omitempty"`
- Key *string `json:"key,omitempty"`
-}
-
-func (s SSHKeyUpdateRequest) String() string {
- return Stringify(s)
-}
-
-// SSHKeyServiceOp implements SSHKeyService
-type SSHKeyServiceOp struct {
- client *Client
-}
-
-func (s *SSHKeyServiceOp) list(url string) ([]SSHKey, *Response, error) {
- root := new(sshKeyRoot)
-
- resp, err := s.client.DoRequest("GET", url, nil, root)
- if err != nil {
- return nil, resp, err
- }
-
- return root.SSHKeys, resp, err
-}
-
-// ProjectList lists ssh keys of a project
-// Deprecated: Use ProjectServiceOp.ListSSHKeys
-func (s *SSHKeyServiceOp) ProjectList(projectID string) ([]SSHKey, *Response, error) {
- if validateErr := ValidateUUID(projectID); validateErr != nil {
- return nil, nil, validateErr
- }
- return s.list(path.Join(projectBasePath, projectID, sshKeyBasePath))
-
-}
-
-// List returns a user's ssh keys
-func (s *SSHKeyServiceOp) List() ([]SSHKey, *Response, error) {
- return s.list(sshKeyBasePath)
-}
-
-// Get returns an ssh key by id
-func (s *SSHKeyServiceOp) Get(sshKeyID string, opts *GetOptions) (*SSHKey, *Response, error) {
- if validateErr := ValidateUUID(sshKeyID); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(sshKeyBasePath, sshKeyID)
- apiPathQuery := opts.WithQuery(endpointPath)
- sshKey := new(SSHKey)
-
- resp, err := s.client.DoRequest("GET", apiPathQuery, nil, sshKey)
- if err != nil {
- return nil, resp, err
- }
-
- return sshKey, resp, err
-}
-
-// Create creates a new ssh key
-func (s *SSHKeyServiceOp) Create(createRequest *SSHKeyCreateRequest) (*SSHKey, *Response, error) {
- urlPath := sshKeyBasePath
- if createRequest.ProjectID != "" {
- urlPath = path.Join(projectBasePath, createRequest.ProjectID, sshKeyBasePath)
- }
- sshKey := new(SSHKey)
-
- resp, err := s.client.DoRequest("POST", urlPath, createRequest, sshKey)
- if err != nil {
- return nil, resp, err
- }
-
- return sshKey, resp, err
-}
-
-// Update updates an ssh key
-func (s *SSHKeyServiceOp) Update(id string, updateRequest *SSHKeyUpdateRequest) (*SSHKey, *Response, error) {
- if validateErr := ValidateUUID(id); validateErr != nil {
- return nil, nil, validateErr
- }
- if updateRequest.Label == nil && updateRequest.Key == nil {
- return nil, nil, fmt.Errorf("You must set either Label or Key string for SSH Key update")
- }
- apiPath := path.Join(sshKeyBasePath, id)
-
- sshKey := new(SSHKey)
-
- resp, err := s.client.DoRequest("PATCH", apiPath, updateRequest, sshKey)
- if err != nil {
- return nil, resp, err
- }
-
- return sshKey, resp, err
-}
-
-// Delete deletes an ssh key
-func (s *SSHKeyServiceOp) Delete(sshKeyID string) (*Response, error) {
- if validateErr := ValidateUUID(sshKeyID); validateErr != nil {
- return nil, validateErr
- }
- apiPath := path.Join(sshKeyBasePath, sshKeyID)
-
- return s.client.DoRequest("DELETE", apiPath, nil, nil)
-}
diff --git a/vendor/github.com/packethost/packngo/timestamp.go b/vendor/github.com/packethost/packngo/timestamp.go
deleted file mode 100644
index ee3d780d..00000000
--- a/vendor/github.com/packethost/packngo/timestamp.go
+++ /dev/null
@@ -1,38 +0,0 @@
-package packngo
-
-import (
- "strconv"
- "strings"
- "time"
-)
-
-// Timestamp represents a time that can be unmarshalled from a JSON string
-// formatted as either an RFC3339 or Unix timestamp. All
-// exported methods of time.Time can be called on Timestamp.
-type Timestamp struct {
- time.Time
-}
-
-func (t Timestamp) String() string {
- return t.Time.String()
-}
-
-// UnmarshalJSON implements the json.Unmarshaler interface.
-// Time is expected in RFC3339 or Unix format.
-func (t *Timestamp) UnmarshalJSON(data []byte) (err error) {
- str := string(data)
- i, err := strconv.ParseInt(str, 10, 64)
- if err == nil {
- t.Time = time.Unix(i, 0).UTC()
- } else {
- if t.Time, err = time.ParseInLocation(time.RFC3339, strings.Trim(str, `"`), time.UTC); err != nil {
- return err
- }
- }
- return
-}
-
-// Equal reports whether t and u are equal based on time.Equal
-func (t Timestamp) Equal(u Timestamp) bool {
- return t.Time.Equal(u.Time)
-}
diff --git a/vendor/github.com/packethost/packngo/two_factor_auth.go b/vendor/github.com/packethost/packngo/two_factor_auth.go
deleted file mode 100644
index 5064b09f..00000000
--- a/vendor/github.com/packethost/packngo/two_factor_auth.go
+++ /dev/null
@@ -1,56 +0,0 @@
-package packngo
-
-const twoFactorAuthAppPath = "/user/otp/app"
-const twoFactorAuthSmsPath = "/user/otp/sms"
-
-// TwoFactorAuthService interface defines available two factor authentication functions
-type TwoFactorAuthService interface {
- EnableApp(string) (*Response, error)
- DisableApp(string) (*Response, error)
- EnableSms(string) (*Response, error)
- DisableSms(string) (*Response, error)
- ReceiveSms() (*Response, error)
- SeedApp() (string, *Response, error)
-}
-
-// TwoFactorAuthServiceOp implements TwoFactorAuthService
-type TwoFactorAuthServiceOp struct {
- client *Client
-}
-
-// EnableApp function enables two factor auth using authenticatior app
-func (s *TwoFactorAuthServiceOp) EnableApp(token string) (resp *Response, err error) {
- headers := map[string]string{"x-otp-token": token}
- return s.client.DoRequestWithHeader("POST", headers, twoFactorAuthAppPath, nil, nil)
-}
-
-// EnableSms function enables two factor auth using sms
-func (s *TwoFactorAuthServiceOp) EnableSms(token string) (resp *Response, err error) {
- headers := map[string]string{"x-otp-token": token}
- return s.client.DoRequestWithHeader("POST", headers, twoFactorAuthSmsPath, nil, nil)
-}
-
-// ReceiveSms orders the auth service to issue an SMS token
-func (s *TwoFactorAuthServiceOp) ReceiveSms() (resp *Response, err error) {
- return s.client.DoRequest("POST", twoFactorAuthSmsPath+"/receive", nil, nil)
-}
-
-// DisableApp function disables two factor auth using
-func (s *TwoFactorAuthServiceOp) DisableApp(token string) (resp *Response, err error) {
- headers := map[string]string{"x-otp-token": token}
- return s.client.DoRequestWithHeader("DELETE", headers, twoFactorAuthAppPath, nil, nil)
-}
-
-// DisableSms function disables two factor auth using
-func (s *TwoFactorAuthServiceOp) DisableSms(token string) (resp *Response, err error) {
- headers := map[string]string{"x-otp-token": token}
- return s.client.DoRequestWithHeader("DELETE", headers, twoFactorAuthSmsPath, nil, nil)
-}
-
-// SeedApp orders the auth service to issue a token via google authenticator
-func (s *TwoFactorAuthServiceOp) SeedApp() (otpURI string, resp *Response, err error) {
- ret := &map[string]string{}
- resp, err = s.client.DoRequest("POST", twoFactorAuthAppPath+"/receive", nil, ret)
-
- return (*ret)["otp_uri"], resp, err
-}
diff --git a/vendor/github.com/packethost/packngo/user.go b/vendor/github.com/packethost/packngo/user.go
deleted file mode 100644
index 5b2a4390..00000000
--- a/vendor/github.com/packethost/packngo/user.go
+++ /dev/null
@@ -1,199 +0,0 @@
-package packngo
-
-import (
- "path"
-)
-
-const (
- usersBasePath = "/users"
- userBasePath = "/user"
-)
-
-// UserService interface defines available user methods
-type UserService interface {
- Create(*UserCreateRequest) (*User, *Response, error)
- Current() (*User, *Response, error)
- List(*ListOptions) ([]User, *Response, error)
- Get(string, *GetOptions) (*User, *Response, error)
- Update(*UserUpdateRequest) (*User, *Response, error)
-}
-
-type usersRoot struct {
- Users []User `json:"users"`
- Meta meta `json:"meta"`
-}
-
-// SocialAccounts are social usernames or urls
-type SocialAccounts struct {
- GitHub string `json:"github,omitempty"`
- LinkedIn string `json:"linkedin,omitempty"`
- Twitter string `json:"twitter,omitempty"`
- Gravatar string `json:"gravatar,omitempty"`
- Keybase string `json:"keybase,omitempty"`
-}
-
-// User represents an Equinix Metal user
-type User struct {
- ID string `json:"id"`
- ShortID string `json:"short_id"`
- FirstName string `json:"first_name,omitempty"`
- LastName string `json:"last_name,omitempty"`
- FullName string `json:"full_name,omitempty"`
- Email string `json:"email,omitempty"`
- SocialAccounts *SocialAccounts `json:"social_accounts,omitempty"`
- CustomData interface{} `json:"customdata,omitempty"`
- OptIn *bool `json:"opt_in,omitempty"`
- OptInUpdatedAt string `json:"opt_in_updated_at,omitempty"`
- DefaultProjectID *string `json:"default_project_id,omitempty"`
- NumberOfSSHKeys int `json:"number_of_ssh_keys,omitempty"`
- Language *string `json:"language,omitempty"`
- // MailingAddress TODO: format
- VerificationStage string `json:"verification_stage,omitempty"`
- MaxProjects *int `json:"max_projects,omitempty"`
- LastLogin string `json:"last_login_at,omitempty"`
-
- // Features effect the behavior of the API and UI
- Features []string `json:"features,omitempty"`
-
- // TwoFactorAuth is the form of two factor auth, "app" or "sms"
- // Renamed from TwoFactor in packngo v0.16 to match API
- TwoFactorAuth string `json:"two_factor_auth,omitempty"`
- DefaultOrganizationID string `json:"default_organization_id,omitempty"`
- AvatarURL string `json:"avatar_url,omitempty"`
- AvatarThumbURL string `json:"avatar_thumb_url,omitempty"`
- Created string `json:"created_at,omitempty"`
- Updated string `json:"updated_at,omitempty"`
- TimeZone string `json:"timezone,omitempty"`
- Emails []Email `json:"emails,omitempty"`
- PhoneNumber string `json:"phone_number,omitempty"`
- URL string `json:"href,omitempty"`
- Restricted bool `json:"restricted,omitempty"`
- Staff bool `json:"staff,omitempty"`
-}
-
-// UserLite is an abbreviated listing of an Equinix Metal user
-type UserLite struct {
- *Href `json:",inline"`
- ID string `json:"id"`
- ShortID string `json:"short_id"`
- FirstName string `json:"first_name,omitempty"`
- LastName string `json:"last_name,omitempty"`
- FullName string `json:"full_name,omitempty"`
- Email string `json:"email,omitempty"`
- CreatedAt *Timestamp `json:"created_at,omitempty"`
- UpdatedAt *Timestamp `json:"updated_at,omitempty"`
- Level string `json:"level,omitempty"`
- AvatarThumbURL string `json:"avatar_thumb_url,omitempty"`
-}
-
-// UserCreateRequest struct for UserService.Create
-type UserCreateRequest struct {
- InvitationID string `json:"invitation_id,omitempty"`
- Nonce string `json:"nonce,omitempty"`
- FirstName string `json:"first_name,omitempty"`
- LastName string `json:"last_name,omitempty"`
- Password string `json:"password,omitempty"`
- Customdata *interface{} `json:"customdata,omitempty"`
- Emails []EmailRequest `json:"emails,omitempty"`
-}
-
-// UserUpdateRequest struct for UserService.Update
-type UserUpdateRequest struct {
- FirstName *string `json:"first_name,omitempty"`
- LastName *string `json:"last_name,omitempty"`
- PhoneNumber *string `json:"phone_number,omitempty"`
- Timezone *string `json:"timezone,omitempty"`
- Password *string `json:"password,omitempty"`
- Avatar *string `json:"avatar,omitempty"`
- Customdata *interface{} `json:"customdata,omitempty"`
-}
-
-func (u User) String() string {
- return Stringify(u)
-}
-
-// UserServiceOp implements UserService
-type UserServiceOp struct {
- client *Client
-}
-
-// Get method gets a user by userID
-func (s *UserServiceOp) List(opts *ListOptions) (users []User, resp *Response, err error) {
- apiPathQuery := opts.WithQuery(usersBasePath)
-
- for {
- subset := new(usersRoot)
-
- resp, err = s.client.DoRequest("GET", apiPathQuery, nil, subset)
- if err != nil {
- return nil, resp, err
- }
-
- users = append(users, subset.Users...)
-
- if apiPathQuery = nextPage(subset.Meta, opts); apiPathQuery != "" {
- continue
- }
- return
- }
-}
-
-// Create a User with the given UserCreateRequest. New user VerificationStage
-// will be AccountCreated, unless UserCreateRequest contains an valid
-// InvitationID and Nonce in which case the VerificationStage will be Verified.
-func (s *UserServiceOp) Create(createRequest *UserCreateRequest) (*User, *Response, error) {
- opts := &GetOptions{}
- endpointPath := path.Join(usersBasePath)
- apiPathQuery := opts.WithQuery(endpointPath)
- user := new(User)
-
- resp, err := s.client.DoRequest("POST", apiPathQuery, createRequest, user)
- if err != nil {
- return nil, resp, err
- }
-
- return user, resp, err
-}
-
-// Returns the user object for the currently logged-in user.
-func (s *UserServiceOp) Current() (*User, *Response, error) {
- user := new(User)
-
- resp, err := s.client.DoRequest("GET", userBasePath, nil, user)
- if err != nil {
- return nil, resp, err
- }
-
- return user, resp, err
-}
-
-func (s *UserServiceOp) Get(userID string, opts *GetOptions) (*User, *Response, error) {
- if validateErr := ValidateUUID(userID); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(usersBasePath, userID)
- apiPathQuery := opts.WithQuery(endpointPath)
- user := new(User)
-
- resp, err := s.client.DoRequest("GET", apiPathQuery, nil, user)
- if err != nil {
- return nil, resp, err
- }
-
- return user, resp, err
-}
-
-// Update updates the current user
-func (s *UserServiceOp) Update(updateRequest *UserUpdateRequest) (*User, *Response, error) {
- opts := &GetOptions{}
- endpointPath := path.Join(userBasePath)
- apiPathQuery := opts.WithQuery(endpointPath)
- user := new(User)
-
- resp, err := s.client.DoRequest("PUT", apiPathQuery, updateRequest, user)
- if err != nil {
- return nil, resp, err
- }
-
- return user, resp, err
-}
diff --git a/vendor/github.com/packethost/packngo/utils.go b/vendor/github.com/packethost/packngo/utils.go
deleted file mode 100644
index 02ed7499..00000000
--- a/vendor/github.com/packethost/packngo/utils.go
+++ /dev/null
@@ -1,166 +0,0 @@
-package packngo
-
-import (
- "bytes"
- "fmt"
- "io"
- "reflect"
- "regexp"
-)
-
-var (
- timestampType = reflect.TypeOf(Timestamp{})
-
- // Facilities DEPRECATED Use Facilities.List
- Facilities = []string{
- "yyz1", "nrt1", "atl1", "mrs1", "hkg1", "ams1",
- "ewr1", "sin1", "dfw1", "lax1", "syd1", "sjc1",
- "ord1", "iad1", "fra1", "sea1", "dfw2"}
-
- // FacilityFeatures DEPRECATED Use Facilities.List
- FacilityFeatures = []string{
- "baremetal", "layer_2", "backend_transfer", "storage", "global_ipv4"}
-
- // UtilizationLevels DEPRECATED
- UtilizationLevels = []string{"unavailable", "critical", "limited", "normal"}
-
- // DevicePlans DEPRECATED Use Plans.List
- DevicePlans = []string{"c2.medium.x86", "g2.large.x86",
- "m2.xlarge.x86", "x2.xlarge.x86", "baremetal_2a", "baremetal_2a2",
- "baremetal_1", "baremetal_3", "baremetal_2", "baremetal_s",
- "baremetal_0", "baremetal_1e",
- }
-)
-
-// Stringify creates a string representation of the provided message
-// DEPRECATED This is used internally and should not be exported by packngo
-func Stringify(message interface{}) string {
- var buf bytes.Buffer
- v := reflect.ValueOf(message)
- // TODO(displague) errors here are not reported
- _ = stringifyValue(&buf, v)
- return buf.String()
-}
-
-// StreamToString converts a reader to a string
-// DEPRECATED This is unused and should not be exported by packngo
-func StreamToString(stream io.Reader) (string, error) {
- buf := new(bytes.Buffer)
- if _, err := buf.ReadFrom(stream); err != nil {
- return "", err
- }
- return buf.String(), nil
-}
-
-// contains tells whether a contains x.
-func contains(a []string, x string) bool {
- for _, n := range a {
- if x == n {
- return true
- }
- }
- return false
-}
-
-// stringifyValue was graciously cargoculted from the goprotubuf library
-func stringifyValue(w io.Writer, val reflect.Value) error {
- if val.Kind() == reflect.Ptr && val.IsNil() {
- _, err := w.Write([]byte(""))
- return err
- }
-
- v := reflect.Indirect(val)
-
- switch v.Kind() {
- case reflect.String:
- if _, err := fmt.Fprintf(w, `"%s"`, v); err != nil {
- return err
- }
- case reflect.Slice:
- if _, err := w.Write([]byte{'['}); err != nil {
- return err
- }
- for i := 0; i < v.Len(); i++ {
- if i > 0 {
- if _, err := w.Write([]byte{' '}); err != nil {
- return err
- }
- }
-
- if err := stringifyValue(w, v.Index(i)); err != nil {
- return err
- }
- }
-
- if _, err := w.Write([]byte{']'}); err != nil {
- return err
- }
- return nil
- case reflect.Struct:
- if v.Type().Name() != "" {
- if _, err := w.Write([]byte(v.Type().String())); err != nil {
- return err
- }
- }
-
- // special handling of Timestamp values
- if v.Type() == timestampType {
- _, err := fmt.Fprintf(w, "{%s}", v.Interface())
- return err
- }
-
- if _, err := w.Write([]byte{'{'}); err != nil {
- return err
- }
-
- var sep bool
- for i := 0; i < v.NumField(); i++ {
- fv := v.Field(i)
- if fv.Kind() == reflect.Ptr && fv.IsNil() {
- continue
- }
- if fv.Kind() == reflect.Slice && fv.IsNil() {
- continue
- }
-
- if sep {
- if _, err := w.Write([]byte(", ")); err != nil {
- return err
- }
- } else {
- sep = true
- }
-
- if _, err := w.Write([]byte(v.Type().Field(i).Name)); err != nil {
- return err
- }
- if _, err := w.Write([]byte{':'}); err != nil {
- return err
- }
-
- if err := stringifyValue(w, fv); err != nil {
- return err
- }
- }
-
- if _, err := w.Write([]byte{'}'}); err != nil {
- return err
- }
- default:
- if v.CanInterface() {
- if _, err := fmt.Fprint(w, v.Interface()); err != nil {
- return err
- }
- }
- }
- return nil
-}
-
-// validate UUID
-func ValidateUUID(uuid string) error {
- r := regexp.MustCompile("^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")
- if !r.MatchString(uuid) {
- return fmt.Errorf("%s is not a valid UUID", uuid)
- }
- return nil
-}
diff --git a/vendor/github.com/packethost/packngo/version.go b/vendor/github.com/packethost/packngo/version.go
deleted file mode 100644
index 384479c7..00000000
--- a/vendor/github.com/packethost/packngo/version.go
+++ /dev/null
@@ -1,36 +0,0 @@
-package packngo
-
-import "runtime/debug"
-
-var (
- // Version of the packngo package. Version will be updated at runtime.
- Version = "(devel)"
-
- // UserAgent is the default HTTP User-Agent Header value that will be used by NewClient.
- // init() will update the version to match the built version of packngo.
- UserAgent = "packngo/(devel)"
-)
-
-const packagePath = "github.com/packethost/packngo"
-
-// init finds packngo in the dependency so the package Version can be properly
-// reflected in API UserAgent headers and client introspection
-func init() {
- bi, ok := debug.ReadBuildInfo()
- if !ok {
- return
- }
- for _, d := range bi.Deps {
- if d.Path == packagePath {
- Version = d.Version
- if d.Replace != nil {
- v := d.Replace.Version
- if v != "" {
- Version = v
- }
- }
- UserAgent = "packngo/" + Version
- break
- }
- }
-}
diff --git a/vendor/github.com/packethost/packngo/virtualcircuits.go b/vendor/github.com/packethost/packngo/virtualcircuits.go
deleted file mode 100644
index 9ca0dd36..00000000
--- a/vendor/github.com/packethost/packngo/virtualcircuits.go
+++ /dev/null
@@ -1,186 +0,0 @@
-package packngo
-
-import "path"
-
-type VCStatus string
-
-const (
- virtualCircuitBasePath = "/virtual-circuits"
-
- // VC is being create but not ready yet
- VCStatusPending VCStatus = "pending"
-
- // VC is ready with a VLAN
- VCStatusActive VCStatus = "active"
-
- // VC is ready without a VLAN
- VCStatusWaiting VCStatus = "waiting_on_customer_vlan"
-
- // VC is being deleted
- VCStatusDeleting VCStatus = "deleting"
-
- // not sure what the following states mean, or whether they exist
- // someone from the API side could check
- VCStatusActivating VCStatus = "activating"
- VCStatusDeactivating VCStatus = "deactivating"
- VCStatusActivationFailed VCStatus = "activation_failed"
- VCStatusDeactivationFailed VCStatus = "dactivation_failed"
-)
-
-type VirtualCircuitService interface {
- Create(string, string, string, *VCCreateRequest, *GetOptions) (*VirtualCircuit, *Response, error)
- Get(string, *GetOptions) (*VirtualCircuit, *Response, error)
- Events(string, *GetOptions) ([]Event, *Response, error)
- Delete(string) (*Response, error)
- Update(string, *VCUpdateRequest, *GetOptions) (*VirtualCircuit, *Response, error)
-}
-
-type VCUpdateRequest struct {
- Name *string `json:"name,omitempty"`
- Tags *[]string `json:"tags,omitempty"`
- Description *string `json:"description,omitempty"`
- VirtualNetworkID *string `json:"vnid,omitempty"`
-
- // Speed is a bps representation of the VirtualCircuit throughput. This is informational only, the field is a user-controlled description of the speed. It may be presented as a whole number with a bps, mpbs, or gbps suffix (or the respective initial).
- Speed string `json:"speed,omitempty"`
-}
-
-type VCCreateRequest struct {
- // VirtualNetworkID of the Virtual Network to connect to the Virtual Circuit (required when VRFID is not specified)
- VirtualNetworkID string `json:"vnid,omitempty"`
- // VRFID of the VRF to connect to the Virtual Circuit (required when VirtualNetworkID is not specified)
- VRFID string `json:"vrf_id,omitempty"`
- // PeerASN (optional, required with VRFID) The BGP ASN of the device the switch will peer with. Can be the used across several VCs, but cannot be the same as the local_asn.
- PeerASN int `json:"peer_asn,omitempty"`
- // Subnet (Required for VRF) A subnet from one of the IP blocks associated with the VRF that we
- // will help create an IP reservation for. Can only be either a /30 or /31.
- // * For a /31 block, it will only have two IP addresses, which will be used for the metal_ip and customer_ip.
- // * For a /30 block, it will have four IP
- // addresses, but the first and last IP addresses are not usable. We will
- // default to the first usable IP address for the metal_ip.
- Subnet string `json:"subnet,omitempty"`
- // MetalIP (optional, required with VRFID) The IP address that’s set as “our” IP that is
- // configured on the rack_local_vlan SVI. Will default to the first usable
- // IP in the subnet.
- MetalIP string `json:"metal_ip,omitempty"`
- // CustomerIP (optional, requires VRFID) The IP address set as the customer IP which the CSR
- // switch will peer with. Will default to the other usable IP in the subnet.
- CustomerIP string `json:"customer_ip,omitempty"`
- // MD5 (optional, requires VRFID) The password that can be set for the VRF BGP peer
- MD5 string `json:"md5,omitempty"`
- NniVLAN int `json:"nni_vlan,omitempty"`
- Name string `json:"name,omitempty"`
- Description string `json:"description,omitempty"`
- Tags []string `json:"tags,omitempty"`
-
- // Speed is a bps representation of the VirtualCircuit throughput. This is informational only, the field is a user-controlled description of the speed. It may be presented as a whole number with a bps, mpbs, or gbps suffix (or the respective initial).
- Speed string `json:"speed,omitempty"`
-}
-
-type VirtualCircuitServiceOp struct {
- client *Client
-}
-
-type virtualCircuitsRoot struct {
- VirtualCircuits []VirtualCircuit `json:"virtual_circuits"`
- Meta meta `json:"meta"`
-}
-
-type VirtualCircuit struct {
- ID string `json:"id"`
- Name string `json:"name,omitempty"`
- Description string `json:"description,omitempty"`
- // Speed of the VirtualCircuit in bps
- Speed int `json:"speed,omitempty"`
- Status VCStatus `json:"status,omitempty"`
- VNID int `json:"vnid,omitempty"`
- NniVNID int `json:"nni_vnid,omitempty"`
- NniVLAN int `json:"nni_vlan,omitempty"`
- Project *Project `json:"project,omitempty"`
- Port *ConnectionPort `json:"port,omitempty"`
- VirtualNetwork *VirtualNetwork `json:"virtual_network,omitempty"`
- Tags []string `json:"tags,omitempty"`
- // VRF connected to the Virtual Circuit
- VRF *VRF `json:"vrf,omitempty"`
-
- // PeerASN (optional, required with VRFID) The BGP ASN of the device the switch will peer with. Can be the used across several VCs, but cannot be the same as the local_asn.
- PeerASN int `json:"peer_asn,omitempty"`
-
- // Subnet (returned with VRF) A subnet from one of the IP blocks associated with the VRF that we
- // will help create an IP reservation for. Can only be either a /30 or /31.
- // * For a /31 block, it will only have two IP addresses, which will be used for the metal_ip and customer_ip.
- // * For a /30 block, it will have four IP
- // addresses, but the first and last IP addresses are not usable. We will
- // default to the first usable IP address for the metal_ip.
- Subnet string `json:"subnet,omitempty"`
-
- // MetalIP (returned with VRF) The IP address that’s set as “our” IP that is
- // configured on the rack_local_vlan SVI. Will default to the first usable
- // IP in the subnet.
- MetalIP string `json:"metal_ip,omitempty"`
-
- // CustomerIP (returned with VRF) The IP address set as the customer IP which the CSR
- // switch will peer with. Will default to the other usable IP in the subnet.
- CustomerIP string `json:"customer_ip,omitempty"`
-
- // MD5 (returned with VRF) The password that can be set for the VRF BGP peer
- MD5 string `json:"md5,omitempty"`
-}
-
-func (s *VirtualCircuitServiceOp) do(method, apiPathQuery string, req interface{}) (*VirtualCircuit, *Response, error) {
- vc := new(VirtualCircuit)
- resp, err := s.client.DoRequest(method, apiPathQuery, req, vc)
- if err != nil {
- return nil, resp, err
- }
- return vc, resp, err
-}
-
-func (s *VirtualCircuitServiceOp) Update(vcID string, req *VCUpdateRequest, opts *GetOptions) (*VirtualCircuit, *Response, error) {
- if validateErr := ValidateUUID(vcID); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(virtualCircuitBasePath, vcID)
- apiPathQuery := opts.WithQuery(endpointPath)
- return s.do("PUT", apiPathQuery, req)
-}
-
-func (s *VirtualCircuitServiceOp) Events(id string, opts *GetOptions) ([]Event, *Response, error) {
- if validateErr := ValidateUUID(id); validateErr != nil {
- return nil, nil, validateErr
- }
- apiPath := path.Join(virtualCircuitBasePath, id, eventBasePath)
- return listEvents(s.client, apiPath, opts)
-}
-
-func (s *VirtualCircuitServiceOp) Get(id string, opts *GetOptions) (*VirtualCircuit, *Response, error) {
- if validateErr := ValidateUUID(id); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(virtualCircuitBasePath, id)
- apiPathQuery := opts.WithQuery(endpointPath)
- return s.do("GET", apiPathQuery, nil)
-}
-
-func (s *VirtualCircuitServiceOp) Delete(id string) (*Response, error) {
- if validateErr := ValidateUUID(id); validateErr != nil {
- return nil, validateErr
- }
- apiPath := path.Join(virtualCircuitBasePath, id)
- return s.client.DoRequest("DELETE", apiPath, nil, nil)
-}
-
-func (s *VirtualCircuitServiceOp) Create(projectID, connID, portID string, request *VCCreateRequest, opts *GetOptions) (*VirtualCircuit, *Response, error) {
- if validateErr := ValidateUUID(projectID); validateErr != nil {
- return nil, nil, validateErr
- }
- if validateErr := ValidateUUID(connID); validateErr != nil {
- return nil, nil, validateErr
- }
- if validateErr := ValidateUUID(portID); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(projectBasePath, projectID, connectionBasePath, connID, portBasePath, portID, virtualCircuitBasePath)
- apiPathQuery := opts.WithQuery(endpointPath)
- return s.do("POST", apiPathQuery, request)
-}
diff --git a/vendor/github.com/packethost/packngo/virtualnetworks.go b/vendor/github.com/packethost/packngo/virtualnetworks.go
deleted file mode 100644
index 48aceb4a..00000000
--- a/vendor/github.com/packethost/packngo/virtualnetworks.go
+++ /dev/null
@@ -1,117 +0,0 @@
-package packngo
-
-import (
- "path"
-)
-
-const virtualNetworkBasePath = "/virtual-networks"
-
-// DevicePortService handles operations on a port which belongs to a particular device
-type ProjectVirtualNetworkService interface {
- List(projectID string, opts *ListOptions) (*VirtualNetworkListResponse, *Response, error)
- Create(*VirtualNetworkCreateRequest) (*VirtualNetwork, *Response, error)
- Get(string, *GetOptions) (*VirtualNetwork, *Response, error)
- Delete(virtualNetworkID string) (*Response, error)
-}
-
-type VirtualNetwork struct {
- ID string `json:"id"`
- Description string `json:"description,omitempty"` // TODO: field can be null
- VXLAN int `json:"vxlan,omitempty"`
- FacilityCode string `json:"facility_code,omitempty"`
- MetroCode string `json:"metro_code,omitempty"`
- CreatedAt string `json:"created_at,omitempty"`
- Href string `json:"href"`
- Project *Project `json:"assigned_to,omitempty"`
- Facility *Facility `json:"facility,omitempty"`
- Metro *Metro `json:"metro,omitempty"`
- Instances []*Device `json:"instances,omitempty"`
-}
-
-type ProjectVirtualNetworkServiceOp struct {
- client *Client
-}
-
-type VirtualNetworkListResponse struct {
- VirtualNetworks []VirtualNetwork `json:"virtual_networks"`
-}
-
-func (i *ProjectVirtualNetworkServiceOp) List(projectID string, opts *ListOptions) (*VirtualNetworkListResponse, *Response, error) {
- if validateErr := ValidateUUID(projectID); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(projectBasePath, projectID, virtualNetworkBasePath)
- apiPathQuery := opts.WithQuery(endpointPath)
- output := new(VirtualNetworkListResponse)
-
- resp, err := i.client.DoRequest("GET", apiPathQuery, nil, output)
- if err != nil {
- return nil, nil, err
- }
-
- return output, resp, nil
-}
-
-type VirtualNetworkCreateRequest struct {
- // ProjectID of the project where the VLAN will be made available.
- ProjectID string `json:"project_id"`
-
- // Description is a user supplied description of the VLAN.
- Description string `json:"description"`
-
- // TODO: default Description is null when not specified. Permitting *string here would require changing VirtualNetwork.Description to *string too.
-
- // Facility in which to create the VLAN. Mutually exclusive with Metro.
- Facility string `json:"facility,omitempty"`
-
- // Metro in which to create the VLAN. Mutually exclusive with Facility.
- Metro string `json:"metro,omitempty"`
-
- // VXLAN is the VLAN ID. VXLAN may be specified when Metro is defined. It is remotely incremented otherwise. Must be unique per Metro.
- VXLAN int `json:"vxlan,omitempty"`
-}
-
-func (i *ProjectVirtualNetworkServiceOp) Get(vlanID string, opts *GetOptions) (*VirtualNetwork, *Response, error) {
- if validateErr := ValidateUUID(vlanID); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(virtualNetworkBasePath, vlanID)
- apiPathQuery := opts.WithQuery(endpointPath)
- vlan := new(VirtualNetwork)
-
- resp, err := i.client.DoRequest("GET", apiPathQuery, nil, vlan)
- if err != nil {
- return nil, resp, err
- }
-
- return vlan, resp, err
-}
-
-func (i *ProjectVirtualNetworkServiceOp) Create(input *VirtualNetworkCreateRequest) (*VirtualNetwork, *Response, error) {
- // TODO: May need to add timestamp to output from 'post' request
- // for the 'created_at' attribute of VirtualNetwork struct since
- // API response doesn't include it
- apiPath := path.Join(projectBasePath, input.ProjectID, virtualNetworkBasePath)
- output := new(VirtualNetwork)
-
- resp, err := i.client.DoRequest("POST", apiPath, input, output)
- if err != nil {
- return nil, nil, err
- }
-
- return output, resp, nil
-}
-
-func (i *ProjectVirtualNetworkServiceOp) Delete(virtualNetworkID string) (*Response, error) {
- if validateErr := ValidateUUID(virtualNetworkID); validateErr != nil {
- return nil, validateErr
- }
- apiPath := path.Join(virtualNetworkBasePath, virtualNetworkID)
-
- resp, err := i.client.DoRequest("DELETE", apiPath, nil, nil)
- if err != nil {
- return nil, err
- }
-
- return resp, nil
-}
diff --git a/vendor/github.com/packethost/packngo/vlan_assignments.go b/vendor/github.com/packethost/packngo/vlan_assignments.go
deleted file mode 100644
index 211b9857..00000000
--- a/vendor/github.com/packethost/packngo/vlan_assignments.go
+++ /dev/null
@@ -1,215 +0,0 @@
-package packngo
-
-import (
- "path"
-)
-
-const (
- portVLANAssignmentsPath = "vlan-assignments"
- portVLANAssignmentsBatchPath = "batches"
-)
-
-type vlanAssignmentsRoot struct {
- VLANAssignments []VLANAssignment `json:"vlan_assignments"`
- Meta meta `json:"meta"`
-}
-
-type vlanAssignmentBatchesRoot struct {
- VLANAssignmentBatches []VLANAssignmentBatch `json:"batches"`
- Meta meta `json:"meta"`
-}
-
-// VLANAssignmentService handles operations on a VLANAssignment
-type VLANAssignmentService interface {
- Get(string, string, *GetOptions) (*VLANAssignment, *Response, error)
- List(string, *ListOptions) ([]VLANAssignment, *Response, error)
-
- GetBatch(string, string, *GetOptions) (*VLANAssignmentBatch, *Response, error)
- ListBatch(string, *ListOptions) ([]VLANAssignmentBatch, *Response, error)
- CreateBatch(string, *VLANAssignmentBatchCreateRequest, *GetOptions) (*VLANAssignmentBatch, *Response, error)
-}
-
-type VLANAssignmentServiceOp struct {
- client requestDoer
-}
-
-var _ VLANAssignmentService = (*VLANAssignmentServiceOp)(nil)
-
-type VLANAssignmentBatchState string
-
-const (
- VLANAssignmentBatchQueued VLANAssignmentBatchState = "queued"
- VLANAssignmentBatchInProgress VLANAssignmentBatchState = "in_progress"
- VLANAssignmentBatchCompleted VLANAssignmentBatchState = "completed"
- VLANAssignmentBatchFailed VLANAssignmentBatchState = "failed"
-)
-
-type VLANAssignmentState string
-
-const (
- VLANAssignmentAssigned VLANAssignmentState = "assigned"
- VLANAssignmentUnassigned VLANAssignmentState = "unassigned"
-)
-
-// VLANAssignment struct for VLANAssignmentService.Get represents a port VLAN assignment that has been enacted
-type VLANAssignment struct {
- // ID of the assignment
- ID string `json:"id,omitempty"`
-
- CreatedAt Timestamp `json:"created_at,omitempty"`
- UpdatedAt Timestamp `json:"updated_at,omitempty"`
-
- // Native indicates the VLAN is the native VLAN on the port and packets for this vlan will be untagged
- Native bool `json:"native,omitempty"`
-
- // State of the assignment
- State VLANAssignmentState `json:"state,omitempty"`
-
- // VLAN is the VirtualNetwork.VXLAN of the VLAN the assignment was made to
- VLAN int `json:"vlan,omitempty"`
-
- // Port is a reference to the Port the assignment was made on
- Port *Port `json:"port,omitempty"`
-
- // VirtualNetwork is a reference to the VLAN the assignment was made to
- VirtualNetwork *VirtualNetwork `json:"virtual_network,omitempty"`
-}
-
-// BatchedVLANAssignment represents the data requested in the batch before being processed. ID represents the VLAN ID, not the VLAN Assignment ID.
-type BatchedVLANAssignment struct {
- // VirtualNetworkID is the VirtualNetwork.ID of the VLAN the assignment was made to
- VirtualNetworkID string `json:"id,omitempty"`
-
- // Native indicates the VLAN is the native VLAN on the port and packets for this vlan will be untagged
- Native bool `json:"native,omitempty"`
-
- // State of the assignment
- State VLANAssignmentState `json:"state,omitempty"`
-
- // VLAN is the VirtualNetwork.VXLAN of the VLAN the assignment was made to
- VLAN int `json:"vlan,omitempty"`
-}
-
-// VLANAssignmentBatch struct for VLANAssignmentBatch
-type VLANAssignmentBatch struct {
- ID string `json:"id,omitempty"`
- ErrorMessages []string `json:"error_messages,omitempty"`
- Quantity int `json:"quantity,omitempty"`
- State VLANAssignmentBatchState `json:"state,omitempty"`
- CreatedAt Timestamp `json:"created_at,omitempty"`
- UpdatedAt Timestamp `json:"updated_at,omitempty"`
- Port *Port `json:"port,omitempty"`
- Project *Project `json:"project,omitempty"`
- VLANAssignments []BatchedVLANAssignment `json:"vlan_assignments,omitempty"`
-}
-
-// VLANAssignmentBatchCreateRequest struct for VLANAssignmentBatch Create
-type VLANAssignmentBatchCreateRequest struct {
- VLANAssignments []VLANAssignmentCreateRequest `json:"vlan_assignments"`
-}
-
-// VLANAssignmentCreateRequest struct for VLANAssignmentBatchCreateRequest
-type VLANAssignmentCreateRequest struct {
- VLAN string `json:"vlan,omitempty"`
- State VLANAssignmentState `json:"state,omitempty"`
- Native *bool `json:"native,omitempty"`
-}
-
-// List returns VLANAssignmentBatches
-func (s *VLANAssignmentServiceOp) ListBatch(portID string, opts *ListOptions) (results []VLANAssignmentBatch, resp *Response, err error) {
- if validateErr := ValidateUUID(portID); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(portBasePath, portID, portVLANAssignmentsPath, portVLANAssignmentsBatchPath)
- apiPathQuery := opts.WithQuery(endpointPath)
-
- for {
- subset := new(vlanAssignmentBatchesRoot)
-
- resp, err = s.client.DoRequest("GET", apiPathQuery, nil, subset)
- if err != nil {
- return nil, resp, err
- }
-
- results = append(results, subset.VLANAssignmentBatches...)
- if apiPathQuery = nextPage(subset.Meta, opts); apiPathQuery != "" {
- continue
- }
- return
- }
-}
-
-// Get returns a VLANAssignmentBatch by id
-func (s *VLANAssignmentServiceOp) GetBatch(portID, batchID string, opts *GetOptions) (*VLANAssignmentBatch, *Response, error) {
- if validateErr := ValidateUUID(portID); validateErr != nil {
- return nil, nil, validateErr
- }
- if validateErr := ValidateUUID(batchID); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(portBasePath, portID, portVLANAssignmentsPath, portVLANAssignmentsBatchPath, batchID)
- apiPathQuery := opts.WithQuery(endpointPath)
- batch := new(VLANAssignmentBatch)
- resp, err := s.client.DoRequest("GET", apiPathQuery, nil, batch)
- if err != nil {
- return nil, resp, err
- }
- return batch, resp, err
-}
-
-// Create creates VLANAssignmentBatch objects
-func (s *VLANAssignmentServiceOp) CreateBatch(portID string, request *VLANAssignmentBatchCreateRequest, opts *GetOptions) (*VLANAssignmentBatch, *Response, error) {
- if validateErr := ValidateUUID(portID); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(portBasePath, portID, portVLANAssignmentsPath, portVLANAssignmentsBatchPath)
- apiPathQuery := opts.WithQuery(endpointPath)
- batch := new(VLANAssignmentBatch)
- resp, err := s.client.DoRequest("POST", apiPathQuery, request, batch)
- if err != nil {
- return nil, resp, err
- }
- return batch, resp, err
-}
-
-// List returns VLANAssignment
-func (s *VLANAssignmentServiceOp) List(portID string, opts *ListOptions) (results []VLANAssignment, resp *Response, err error) {
- if validateErr := ValidateUUID(portID); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(portBasePath, portID, portVLANAssignmentsPath)
- apiPathQuery := opts.WithQuery(endpointPath)
-
- for {
- subset := new(vlanAssignmentsRoot)
-
- resp, err = s.client.DoRequest("GET", apiPathQuery, nil, subset)
- if err != nil {
- return nil, resp, err
- }
-
- results = append(results, subset.VLANAssignments...)
- if apiPathQuery = nextPage(subset.Meta, opts); apiPathQuery != "" {
- continue
- }
- return
- }
-}
-
-// Get returns a VLANAssignment by id
-func (s *VLANAssignmentServiceOp) Get(portID, assignmentID string, opts *GetOptions) (*VLANAssignment, *Response, error) {
- if validateErr := ValidateUUID(portID); validateErr != nil {
- return nil, nil, validateErr
- }
- if validateErr := ValidateUUID(assignmentID); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(portBasePath, portID, portVLANAssignmentsPath, assignmentID)
- apiPathQuery := opts.WithQuery(endpointPath)
- VLANAssignment := new(VLANAssignment)
- resp, err := s.client.DoRequest("GET", apiPathQuery, nil, VLANAssignment)
- if err != nil {
- return nil, resp, err
- }
- return VLANAssignment, resp, err
-}
diff --git a/vendor/github.com/packethost/packngo/volumes.go b/vendor/github.com/packethost/packngo/volumes.go
deleted file mode 100644
index bc6f7993..00000000
--- a/vendor/github.com/packethost/packngo/volumes.go
+++ /dev/null
@@ -1,264 +0,0 @@
-package packngo
-
-import (
- "path"
-)
-
-const (
- volumeBasePath = "/storage"
- attachmentsBasePath = "/attachments"
-)
-
-// VolumeService interface defines available Volume methods
-type VolumeService interface {
- List(string, *ListOptions) ([]Volume, *Response, error)
- Get(string, *GetOptions) (*Volume, *Response, error)
- Update(string, *VolumeUpdateRequest) (*Volume, *Response, error)
- Delete(string) (*Response, error)
- Create(*VolumeCreateRequest, string) (*Volume, *Response, error)
- Lock(string) (*Response, error)
- Unlock(string) (*Response, error)
-}
-
-// VolumeAttachmentService defines attachment methdods
-type VolumeAttachmentService interface {
- Get(string, *GetOptions) (*VolumeAttachment, *Response, error)
- Create(string, string) (*VolumeAttachment, *Response, error)
- Delete(string) (*Response, error)
-}
-
-type volumesRoot struct {
- Volumes []Volume `json:"volumes"`
- Meta meta `json:"meta"`
-}
-
-// Volume represents a volume
-type Volume struct {
- Attachments []*VolumeAttachment `json:"attachments,omitempty"`
- BillingCycle string `json:"billing_cycle,omitempty"`
- Created string `json:"created_at,omitempty"`
- Description string `json:"description,omitempty"`
- Facility *Facility `json:"facility,omitempty"`
- Href string `json:"href,omitempty"`
- ID string `json:"id"`
- Locked bool `json:"locked,omitempty"`
- Name string `json:"name,omitempty"`
- Plan *Plan `json:"plan,omitempty"`
- Project *Project `json:"project,omitempty"`
- Size int `json:"size,omitempty"`
- SnapshotPolicies []*SnapshotPolicy `json:"snapshot_policies,omitempty"`
- State string `json:"state,omitempty"`
- Updated string `json:"updated_at,omitempty"`
-}
-
-// SnapshotPolicy used to execute actions on volume
-type SnapshotPolicy struct {
- ID string `json:"id"`
- Href string `json:"href"`
- SnapshotFrequency string `json:"snapshot_frequency,omitempty"`
- SnapshotCount int `json:"snapshot_count,omitempty"`
-}
-
-func (v Volume) String() string {
- return Stringify(v)
-}
-
-// VolumeCreateRequest type used to create an Equinix Metal volume
-type VolumeCreateRequest struct {
- BillingCycle string `json:"billing_cycle"`
- Description string `json:"description,omitempty"`
- Locked bool `json:"locked,omitempty"`
- Size int `json:"size"`
- PlanID string `json:"plan_id"`
- FacilityID string `json:"facility_id"`
- SnapshotPolicies []*SnapshotPolicy `json:"snapshot_policies,omitempty"`
-}
-
-func (v VolumeCreateRequest) String() string {
- return Stringify(v)
-}
-
-// VolumeUpdateRequest type used to update an Equinix Metal volume
-type VolumeUpdateRequest struct {
- Description *string `json:"description,omitempty"`
- PlanID *string `json:"plan_id,omitempty"`
- Size *int `json:"size,omitempty"`
- BillingCycle *string `json:"billing_cycle,omitempty"`
-}
-
-// VolumeAttachment is a type from Equinix Metal API
-type VolumeAttachment struct {
- Href string `json:"href"`
- ID string `json:"id"`
- Volume Volume `json:"volume"`
- Device Device `json:"device"`
-}
-
-func (v VolumeUpdateRequest) String() string {
- return Stringify(v)
-}
-
-// VolumeAttachmentServiceOp implements VolumeService
-type VolumeAttachmentServiceOp struct {
- client *Client
-}
-
-// VolumeServiceOp implements VolumeService
-type VolumeServiceOp struct {
- client *Client
-}
-
-// List returns the volumes for a project
-func (v *VolumeServiceOp) List(projectID string, opts *ListOptions) (volumes []Volume, resp *Response, err error) {
- if validateErr := ValidateUUID(projectID); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(projectBasePath, projectID, volumeBasePath)
- apiPathQuery := opts.WithQuery(endpointPath)
- for {
- subset := new(volumesRoot)
-
- resp, err = v.client.DoRequest("GET", apiPathQuery, nil, subset)
- if err != nil {
- return nil, resp, err
- }
-
- volumes = append(volumes, subset.Volumes...)
-
- if apiPathQuery = nextPage(subset.Meta, opts); apiPathQuery != "" {
- continue
- }
- return
- }
-}
-
-// Get returns a volume by id
-func (v *VolumeServiceOp) Get(volumeID string, opts *GetOptions) (*Volume, *Response, error) {
- if validateErr := ValidateUUID(volumeID); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(volumeBasePath, volumeID)
- apiPathQuery := opts.WithQuery(endpointPath)
- volume := new(Volume)
-
- resp, err := v.client.DoRequest("GET", apiPathQuery, nil, volume)
- if err != nil {
- return nil, resp, err
- }
-
- return volume, resp, err
-}
-
-// Update updates a volume
-func (v *VolumeServiceOp) Update(id string, updateRequest *VolumeUpdateRequest) (*Volume, *Response, error) {
- if validateErr := ValidateUUID(id); validateErr != nil {
- return nil, nil, validateErr
- }
- apiPath := path.Join(volumeBasePath, id)
- volume := new(Volume)
-
- resp, err := v.client.DoRequest("PATCH", apiPath, updateRequest, volume)
- if err != nil {
- return nil, resp, err
- }
-
- return volume, resp, err
-}
-
-// Delete deletes a volume
-func (v *VolumeServiceOp) Delete(volumeID string) (*Response, error) {
- if validateErr := ValidateUUID(volumeID); validateErr != nil {
- return nil, validateErr
- }
- apiPath := path.Join(volumeBasePath, volumeID)
-
- return v.client.DoRequest("DELETE", apiPath, nil, nil)
-}
-
-// Create creates a new volume for a project
-func (v *VolumeServiceOp) Create(createRequest *VolumeCreateRequest, projectID string) (*Volume, *Response, error) {
- if validateErr := ValidateUUID(projectID); validateErr != nil {
- return nil, nil, validateErr
- }
- url := path.Join(projectBasePath, projectID, volumeBasePath)
- volume := new(Volume)
-
- resp, err := v.client.DoRequest("POST", url, createRequest, volume)
- if err != nil {
- return nil, resp, err
- }
-
- return volume, resp, err
-}
-
-// Attachments
-
-// Create Attachment, i.e. attach volume to a device
-func (v *VolumeAttachmentServiceOp) Create(volumeID, deviceID string) (*VolumeAttachment, *Response, error) {
- if validateErr := ValidateUUID(volumeID); validateErr != nil {
- return nil, nil, validateErr
- }
- if validateErr := ValidateUUID(deviceID); validateErr != nil {
- return nil, nil, validateErr
- }
- url := path.Join(volumeBasePath, volumeID, attachmentsBasePath)
- volAttachParam := map[string]string{
- "device_id": deviceID,
- }
- volumeAttachment := new(VolumeAttachment)
-
- resp, err := v.client.DoRequest("POST", url, volAttachParam, volumeAttachment)
- if err != nil {
- return nil, resp, err
- }
- return volumeAttachment, resp, nil
-}
-
-// Get gets attachment by id
-func (v *VolumeAttachmentServiceOp) Get(attachmentID string, opts *GetOptions) (*VolumeAttachment, *Response, error) {
- if validateErr := ValidateUUID(attachmentID); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(volumeBasePath, attachmentsBasePath, attachmentID)
- apiPathQuery := opts.WithQuery(endpointPath)
- volumeAttachment := new(VolumeAttachment)
-
- resp, err := v.client.DoRequest("GET", apiPathQuery, nil, volumeAttachment)
- if err != nil {
- return nil, resp, err
- }
-
- return volumeAttachment, resp, nil
-}
-
-// Delete deletes attachment by id
-func (v *VolumeAttachmentServiceOp) Delete(attachmentID string) (*Response, error) {
- if validateErr := ValidateUUID(attachmentID); validateErr != nil {
- return nil, validateErr
- }
- apiPath := path.Join(volumeBasePath, attachmentsBasePath, attachmentID)
-
- return v.client.DoRequest("DELETE", apiPath, nil, nil)
-}
-
-// Lock sets a volume to "locked"
-func (v *VolumeServiceOp) Lock(id string) (*Response, error) {
- if validateErr := ValidateUUID(id); validateErr != nil {
- return nil, validateErr
- }
- apiPath := path.Join(volumeBasePath, id)
- action := lockType{Locked: true}
-
- return v.client.DoRequest("PATCH", apiPath, action, nil)
-}
-
-// Unlock sets a volume to "unlocked"
-func (v *VolumeServiceOp) Unlock(id string) (*Response, error) {
- if validateErr := ValidateUUID(id); validateErr != nil {
- return nil, validateErr
- }
- apiPath := path.Join(volumeBasePath, id)
- action := lockType{Locked: false}
-
- return v.client.DoRequest("PATCH", apiPath, action, nil)
-}
diff --git a/vendor/github.com/packethost/packngo/vrf.go b/vendor/github.com/packethost/packngo/vrf.go
deleted file mode 100644
index 23b1e030..00000000
--- a/vendor/github.com/packethost/packngo/vrf.go
+++ /dev/null
@@ -1,187 +0,0 @@
-package packngo
-
-import (
- "path"
-)
-
-const (
- vrfBasePath = "/vrfs"
-)
-
-type VRFService interface {
- List(projectID string, opts *ListOptions) ([]VRF, *Response, error)
- Create(projectID string, input *VRFCreateRequest) (*VRF, *Response, error)
- Update(vrfID string, update *VRFUpdateRequest) (*VRF, *Response, error)
- Get(vrfID string, opts *GetOptions) (*VRF, *Response, error)
- ListIPs(vrfID string, opts *GetOptions) ([]IPAddressReservation, *Response, error)
- Delete(vrfID string) (*Response, error)
-}
-
-type VRF struct {
- ID string `json:"id"`
- Name string `json:"name"`
- Description string `json:"description"`
- LocalASN int `json:"local_asn,omitempty"`
- IPRanges []string `json:"ip_ranges,omitempty"`
- Project *Project `json:"project,omitempty"`
- Metro *Metro `json:"metro,omitempty"`
- Href string `json:"href"`
- CreatedAt string `json:"created_at,omitempty"`
- UpdatedAt string `json:"updated_at,omitempty"`
-}
-
-type VRFCreateRequest struct {
- // Metro id or code
- Metro string `json:"metro"`
-
- // Name is the name of the VRF. It must be unique per project.
- Name string `json:"name"`
-
- // Description of the VRF to be created.
- Description string `json:"description"`
-
- // LocalASN is the ASN of the local network.
- LocalASN int `json:"local_asn,omitempty"`
-
- // IPRanges is a list of all IPv4 and IPv6 Ranges that will be available to
- // BGP Peers. IPv4 addresses must be /8 or smaller with a minimum size of
- // /29. IPv6 must be /56 or smaller with a minimum size of /64. Ranges must
- // not overlap other ranges within the VRF.
- IPRanges []string `json:"ip_ranges,omitempty"`
-}
-
-type VRFUpdateRequest struct {
- // Name is the name of the VRF. It must be unique per project.
- Name *string `json:"name,omitempty"`
-
- // Description of the VRF to be created.
- Description *string `json:"description,omitempty"`
-
- // LocalASN is the ASN of the local network.
- LocalASN *int `json:"local_asn,omitempty"`
-
- // IPRanges is a list of all IPv4 and IPv6 Ranges that will be available to
- // BGP Peers. IPv4 addresses must be /8 or smaller with a minimum size of
- // /29. IPv6 must be /56 or smaller with a minimum size of /64. Ranges must
- // not overlap other ranges within the VRF.
- IPRanges *[]string `json:"ip_ranges,omitempty"`
-}
-
-type VRFServiceOp struct {
- client *Client
-}
-
-func (s *VRFServiceOp) List(projectID string, opts *ListOptions) (vrfs []VRF, resp *Response, err error) {
- if validateErr := ValidateUUID(projectID); validateErr != nil {
- return nil, nil, validateErr
- }
- type vrfsRoot struct {
- VRFs []VRF `json:"vrfs"`
- Meta meta `json:"meta"`
- }
-
- endpointPath := path.Join(projectBasePath, projectID, vrfBasePath)
- apiPathQuery := opts.WithQuery(endpointPath)
-
- for {
- subset := new(vrfsRoot)
-
- resp, err = s.client.DoRequest("GET", apiPathQuery, nil, subset)
- if err != nil {
- return nil, resp, err
- }
-
- vrfs = append(vrfs, subset.VRFs...)
-
- if apiPathQuery = nextPage(subset.Meta, opts); apiPathQuery != "" {
- continue
- }
- return
- }
-}
-
-func (s *VRFServiceOp) ListIPs(vrfID string, opts *ListOptions) (ips []IPAddressReservation, resp *Response, err error) {
- if validateErr := ValidateUUID(vrfID); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(vrfBasePath, vrfID, ipBasePath)
- apiPathQuery := opts.WithQuery(endpointPath)
-
- // ipList represents collection of IP Address reservations
- type ipList struct {
- IPs []IPAddressReservation `json:"ip_addresses,omitempty"`
- }
-
- results := new(ipList)
-
- resp, err = s.client.DoRequest("GET", apiPathQuery, nil, results)
- if err != nil {
- return nil, resp, err
- }
-
- return results.IPs, resp, err
-}
-
-func (s *VRFServiceOp) Get(vrfID string, opts *GetOptions) (*VRF, *Response, error) {
- if validateErr := ValidateUUID(vrfID); validateErr != nil {
- return nil, nil, validateErr
- }
- endpointPath := path.Join(vrfBasePath, vrfID)
- apiPathQuery := opts.WithQuery(endpointPath)
- metalGateway := new(VRF)
-
- resp, err := s.client.DoRequest("GET", apiPathQuery, nil, metalGateway)
- if err != nil {
- return nil, resp, err
- }
-
- return metalGateway, resp, err
-}
-
-func (s *VRFServiceOp) Create(projectID string, input *VRFCreateRequest) (*VRF, *Response, error) {
- if validateErr := ValidateUUID(projectID); validateErr != nil {
- return nil, nil, validateErr
- }
- apiPath := path.Join(projectBasePath, projectID, vrfBasePath)
- output := new(VRF)
-
- resp, err := s.client.DoRequest("POST", apiPath, input, output)
- if err != nil {
- return nil, nil, err
- }
-
- return output, resp, nil
-}
-
-// Update updates an existing VRF
-func (s *VRFServiceOp) Update(vrfID string, updateRequest *VRFUpdateRequest) (*VRF, *Response, error) {
- if validateErr := ValidateUUID(vrfID); validateErr != nil {
- return nil, nil, validateErr
- }
- opts := &GetOptions{}
- endpointPath := path.Join(vrfBasePath, vrfID)
- apiPathQuery := opts.WithQuery(endpointPath)
-
- vrf := new(VRF)
-
- resp, err := s.client.DoRequest("PUT", apiPathQuery, updateRequest, vrf)
- if err != nil {
- return nil, resp, err
- }
-
- return vrf, resp, err
-}
-
-func (s *VRFServiceOp) Delete(vrfID string) (*Response, error) {
- if validateErr := ValidateUUID(vrfID); validateErr != nil {
- return nil, validateErr
- }
- apiPath := path.Join(vrfBasePath, vrfID)
-
- resp, err := s.client.DoRequest("DELETE", apiPath, nil, nil)
- if err != nil {
- return nil, err
- }
-
- return resp, nil
-}
diff --git a/vendor/github.com/prometheus/client_golang/NOTICE b/vendor/github.com/prometheus/client_golang/NOTICE
index dd878a30..b9cc55ab 100644
--- a/vendor/github.com/prometheus/client_golang/NOTICE
+++ b/vendor/github.com/prometheus/client_golang/NOTICE
@@ -16,8 +16,3 @@ Go support for Protocol Buffers - Google's data interchange format
http://github.com/golang/protobuf/
Copyright 2010 The Go Authors
See source code for license details.
-
-Support for streaming Protocol Buffer messages for the Go language (golang).
-https://github.com/matttproud/golang_protobuf_extensions
-Copyright 2013 Matt T. Proud
-Licensed under the Apache License, Version 2.0
diff --git a/vendor/github.com/prometheus/client_golang/internal/github.com/golang/gddo/LICENSE b/vendor/github.com/prometheus/client_golang/internal/github.com/golang/gddo/LICENSE
new file mode 100644
index 00000000..65d761bc
--- /dev/null
+++ b/vendor/github.com/prometheus/client_golang/internal/github.com/golang/gddo/LICENSE
@@ -0,0 +1,27 @@
+Copyright (c) 2013 The Go Authors. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
+distribution.
+ * Neither the name of Google Inc. nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/vendor/github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil/header/header.go b/vendor/github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil/header/header.go
new file mode 100644
index 00000000..8547c8df
--- /dev/null
+++ b/vendor/github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil/header/header.go
@@ -0,0 +1,145 @@
+// Copyright 2013 The Go Authors. All rights reserved.
+//
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file or at
+// https://developers.google.com/open-source/licenses/bsd.
+
+// Package header provides functions for parsing HTTP headers.
+package header
+
+import (
+ "net/http"
+ "strings"
+)
+
+// Octet types from RFC 2616.
+var octetTypes [256]octetType
+
+type octetType byte
+
+const (
+ isToken octetType = 1 << iota
+ isSpace
+)
+
+func init() {
+ // OCTET =
+ // CHAR =
+ // CTL =
+ // CR =
+ // LF =
+ // SP =
+ // HT =
+ // <"> =
+ // CRLF = CR LF
+ // LWS = [CRLF] 1*( SP | HT )
+ // TEXT =
+ // separators = "(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "\" | <">
+ // | "/" | "[" | "]" | "?" | "=" | "{" | "}" | SP | HT
+ // token = 1*
+ // qdtext = >
+
+ for c := 0; c < 256; c++ {
+ var t octetType
+ isCtl := c <= 31 || c == 127
+ isChar := 0 <= c && c <= 127
+ isSeparator := strings.ContainsRune(" \t\"(),/:;<=>?@[]\\{}", rune(c))
+ if strings.ContainsRune(" \t\r\n", rune(c)) {
+ t |= isSpace
+ }
+ if isChar && !isCtl && !isSeparator {
+ t |= isToken
+ }
+ octetTypes[c] = t
+ }
+}
+
+// AcceptSpec describes an Accept* header.
+type AcceptSpec struct {
+ Value string
+ Q float64
+}
+
+// ParseAccept parses Accept* headers.
+func ParseAccept(header http.Header, key string) (specs []AcceptSpec) {
+loop:
+ for _, s := range header[key] {
+ for {
+ var spec AcceptSpec
+ spec.Value, s = expectTokenSlash(s)
+ if spec.Value == "" {
+ continue loop
+ }
+ spec.Q = 1.0
+ s = skipSpace(s)
+ if strings.HasPrefix(s, ";") {
+ s = skipSpace(s[1:])
+ if !strings.HasPrefix(s, "q=") {
+ continue loop
+ }
+ spec.Q, s = expectQuality(s[2:])
+ if spec.Q < 0.0 {
+ continue loop
+ }
+ }
+ specs = append(specs, spec)
+ s = skipSpace(s)
+ if !strings.HasPrefix(s, ",") {
+ continue loop
+ }
+ s = skipSpace(s[1:])
+ }
+ }
+ return
+}
+
+func skipSpace(s string) (rest string) {
+ i := 0
+ for ; i < len(s); i++ {
+ if octetTypes[s[i]]&isSpace == 0 {
+ break
+ }
+ }
+ return s[i:]
+}
+
+func expectTokenSlash(s string) (token, rest string) {
+ i := 0
+ for ; i < len(s); i++ {
+ b := s[i]
+ if (octetTypes[b]&isToken == 0) && b != '/' {
+ break
+ }
+ }
+ return s[:i], s[i:]
+}
+
+func expectQuality(s string) (q float64, rest string) {
+ switch {
+ case len(s) == 0:
+ return -1, ""
+ case s[0] == '0':
+ q = 0
+ case s[0] == '1':
+ q = 1
+ default:
+ return -1, ""
+ }
+ s = s[1:]
+ if !strings.HasPrefix(s, ".") {
+ return q, s
+ }
+ s = s[1:]
+ i := 0
+ n := 0
+ d := 1
+ for ; i < len(s); i++ {
+ b := s[i]
+ if b < '0' || b > '9' {
+ break
+ }
+ n = n*10 + int(b) - '0'
+ d *= 10
+ }
+ return q + float64(n)/float64(d), s[i:]
+}
diff --git a/vendor/github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil/negotiate.go b/vendor/github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil/negotiate.go
new file mode 100644
index 00000000..2e45780b
--- /dev/null
+++ b/vendor/github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil/negotiate.go
@@ -0,0 +1,36 @@
+// Copyright 2013 The Go Authors. All rights reserved.
+//
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file or at
+// https://developers.google.com/open-source/licenses/bsd.
+
+package httputil
+
+import (
+ "net/http"
+
+ "github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil/header"
+)
+
+// NegotiateContentEncoding returns the best offered content encoding for the
+// request's Accept-Encoding header. If two offers match with equal weight and
+// then the offer earlier in the list is preferred. If no offers are
+// acceptable, then "" is returned.
+func NegotiateContentEncoding(r *http.Request, offers []string) string {
+ bestOffer := "identity"
+ bestQ := -1.0
+ specs := header.ParseAccept(r.Header, "Accept-Encoding")
+ for _, offer := range offers {
+ for _, spec := range specs {
+ if spec.Q > bestQ &&
+ (spec.Value == "*" || spec.Value == offer) {
+ bestQ = spec.Q
+ bestOffer = offer
+ }
+ }
+ }
+ if bestQ == 0 {
+ bestOffer = ""
+ }
+ return bestOffer
+}
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/go_collector.go b/vendor/github.com/prometheus/client_golang/prometheus/go_collector.go
index ad9a71a5..520cbd7d 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/go_collector.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/go_collector.go
@@ -22,13 +22,13 @@ import (
// goRuntimeMemStats provides the metrics initially provided by runtime.ReadMemStats.
// From Go 1.17 those similar (and better) statistics are provided by runtime/metrics, so
// while eval closure works on runtime.MemStats, the struct from Go 1.17+ is
-// populated using runtime/metrics.
+// populated using runtime/metrics. Those are the defaults we can't alter.
func goRuntimeMemStats() memStatsMetrics {
return memStatsMetrics{
{
desc: NewDesc(
memstatNamespace("alloc_bytes"),
- "Number of bytes allocated and still in use.",
+ "Number of bytes allocated in heap and currently in use. Equals to /memory/classes/heap/objects:bytes.",
nil, nil,
),
eval: func(ms *runtime.MemStats) float64 { return float64(ms.Alloc) },
@@ -36,7 +36,7 @@ func goRuntimeMemStats() memStatsMetrics {
}, {
desc: NewDesc(
memstatNamespace("alloc_bytes_total"),
- "Total number of bytes allocated, even if freed.",
+ "Total number of bytes allocated in heap until now, even if released already. Equals to /gc/heap/allocs:bytes.",
nil, nil,
),
eval: func(ms *runtime.MemStats) float64 { return float64(ms.TotalAlloc) },
@@ -44,23 +44,16 @@ func goRuntimeMemStats() memStatsMetrics {
}, {
desc: NewDesc(
memstatNamespace("sys_bytes"),
- "Number of bytes obtained from system.",
+ "Number of bytes obtained from system. Equals to /memory/classes/total:byte.",
nil, nil,
),
eval: func(ms *runtime.MemStats) float64 { return float64(ms.Sys) },
valType: GaugeValue,
- }, {
- desc: NewDesc(
- memstatNamespace("lookups_total"),
- "Total number of pointer lookups.",
- nil, nil,
- ),
- eval: func(ms *runtime.MemStats) float64 { return float64(ms.Lookups) },
- valType: CounterValue,
}, {
desc: NewDesc(
memstatNamespace("mallocs_total"),
- "Total number of mallocs.",
+ // TODO(bwplotka): We could add go_memstats_heap_objects, probably useful for discovery. Let's gather more feedback, kind of a waste of bytes for everybody for compatibility reasons to keep both, and we can't really rename/remove useful metric.
+ "Total number of heap objects allocated, both live and gc-ed. Semantically a counter version for go_memstats_heap_objects gauge. Equals to /gc/heap/allocs:objects + /gc/heap/tiny/allocs:objects.",
nil, nil,
),
eval: func(ms *runtime.MemStats) float64 { return float64(ms.Mallocs) },
@@ -68,7 +61,7 @@ func goRuntimeMemStats() memStatsMetrics {
}, {
desc: NewDesc(
memstatNamespace("frees_total"),
- "Total number of frees.",
+ "Total number of heap objects frees. Equals to /gc/heap/frees:objects + /gc/heap/tiny/allocs:objects.",
nil, nil,
),
eval: func(ms *runtime.MemStats) float64 { return float64(ms.Frees) },
@@ -76,7 +69,7 @@ func goRuntimeMemStats() memStatsMetrics {
}, {
desc: NewDesc(
memstatNamespace("heap_alloc_bytes"),
- "Number of heap bytes allocated and still in use.",
+ "Number of heap bytes allocated and currently in use, same as go_memstats_alloc_bytes. Equals to /memory/classes/heap/objects:bytes.",
nil, nil,
),
eval: func(ms *runtime.MemStats) float64 { return float64(ms.HeapAlloc) },
@@ -84,7 +77,7 @@ func goRuntimeMemStats() memStatsMetrics {
}, {
desc: NewDesc(
memstatNamespace("heap_sys_bytes"),
- "Number of heap bytes obtained from system.",
+ "Number of heap bytes obtained from system. Equals to /memory/classes/heap/objects:bytes + /memory/classes/heap/unused:bytes + /memory/classes/heap/released:bytes + /memory/classes/heap/free:bytes.",
nil, nil,
),
eval: func(ms *runtime.MemStats) float64 { return float64(ms.HeapSys) },
@@ -92,7 +85,7 @@ func goRuntimeMemStats() memStatsMetrics {
}, {
desc: NewDesc(
memstatNamespace("heap_idle_bytes"),
- "Number of heap bytes waiting to be used.",
+ "Number of heap bytes waiting to be used. Equals to /memory/classes/heap/released:bytes + /memory/classes/heap/free:bytes.",
nil, nil,
),
eval: func(ms *runtime.MemStats) float64 { return float64(ms.HeapIdle) },
@@ -100,7 +93,7 @@ func goRuntimeMemStats() memStatsMetrics {
}, {
desc: NewDesc(
memstatNamespace("heap_inuse_bytes"),
- "Number of heap bytes that are in use.",
+ "Number of heap bytes that are in use. Equals to /memory/classes/heap/objects:bytes + /memory/classes/heap/unused:bytes",
nil, nil,
),
eval: func(ms *runtime.MemStats) float64 { return float64(ms.HeapInuse) },
@@ -108,7 +101,7 @@ func goRuntimeMemStats() memStatsMetrics {
}, {
desc: NewDesc(
memstatNamespace("heap_released_bytes"),
- "Number of heap bytes released to OS.",
+ "Number of heap bytes released to OS. Equals to /memory/classes/heap/released:bytes.",
nil, nil,
),
eval: func(ms *runtime.MemStats) float64 { return float64(ms.HeapReleased) },
@@ -116,7 +109,7 @@ func goRuntimeMemStats() memStatsMetrics {
}, {
desc: NewDesc(
memstatNamespace("heap_objects"),
- "Number of allocated objects.",
+ "Number of currently allocated objects. Equals to /gc/heap/objects:objects.",
nil, nil,
),
eval: func(ms *runtime.MemStats) float64 { return float64(ms.HeapObjects) },
@@ -124,7 +117,7 @@ func goRuntimeMemStats() memStatsMetrics {
}, {
desc: NewDesc(
memstatNamespace("stack_inuse_bytes"),
- "Number of bytes in use by the stack allocator.",
+ "Number of bytes obtained from system for stack allocator in non-CGO environments. Equals to /memory/classes/heap/stacks:bytes.",
nil, nil,
),
eval: func(ms *runtime.MemStats) float64 { return float64(ms.StackInuse) },
@@ -132,7 +125,7 @@ func goRuntimeMemStats() memStatsMetrics {
}, {
desc: NewDesc(
memstatNamespace("stack_sys_bytes"),
- "Number of bytes obtained from system for stack allocator.",
+ "Number of bytes obtained from system for stack allocator. Equals to /memory/classes/heap/stacks:bytes + /memory/classes/os-stacks:bytes.",
nil, nil,
),
eval: func(ms *runtime.MemStats) float64 { return float64(ms.StackSys) },
@@ -140,7 +133,7 @@ func goRuntimeMemStats() memStatsMetrics {
}, {
desc: NewDesc(
memstatNamespace("mspan_inuse_bytes"),
- "Number of bytes in use by mspan structures.",
+ "Number of bytes in use by mspan structures. Equals to /memory/classes/metadata/mspan/inuse:bytes.",
nil, nil,
),
eval: func(ms *runtime.MemStats) float64 { return float64(ms.MSpanInuse) },
@@ -148,7 +141,7 @@ func goRuntimeMemStats() memStatsMetrics {
}, {
desc: NewDesc(
memstatNamespace("mspan_sys_bytes"),
- "Number of bytes used for mspan structures obtained from system.",
+ "Number of bytes used for mspan structures obtained from system. Equals to /memory/classes/metadata/mspan/inuse:bytes + /memory/classes/metadata/mspan/free:bytes.",
nil, nil,
),
eval: func(ms *runtime.MemStats) float64 { return float64(ms.MSpanSys) },
@@ -156,7 +149,7 @@ func goRuntimeMemStats() memStatsMetrics {
}, {
desc: NewDesc(
memstatNamespace("mcache_inuse_bytes"),
- "Number of bytes in use by mcache structures.",
+ "Number of bytes in use by mcache structures. Equals to /memory/classes/metadata/mcache/inuse:bytes.",
nil, nil,
),
eval: func(ms *runtime.MemStats) float64 { return float64(ms.MCacheInuse) },
@@ -164,7 +157,7 @@ func goRuntimeMemStats() memStatsMetrics {
}, {
desc: NewDesc(
memstatNamespace("mcache_sys_bytes"),
- "Number of bytes used for mcache structures obtained from system.",
+ "Number of bytes used for mcache structures obtained from system. Equals to /memory/classes/metadata/mcache/inuse:bytes + /memory/classes/metadata/mcache/free:bytes.",
nil, nil,
),
eval: func(ms *runtime.MemStats) float64 { return float64(ms.MCacheSys) },
@@ -172,7 +165,7 @@ func goRuntimeMemStats() memStatsMetrics {
}, {
desc: NewDesc(
memstatNamespace("buck_hash_sys_bytes"),
- "Number of bytes used by the profiling bucket hash table.",
+ "Number of bytes used by the profiling bucket hash table. Equals to /memory/classes/profiling/buckets:bytes.",
nil, nil,
),
eval: func(ms *runtime.MemStats) float64 { return float64(ms.BuckHashSys) },
@@ -180,7 +173,7 @@ func goRuntimeMemStats() memStatsMetrics {
}, {
desc: NewDesc(
memstatNamespace("gc_sys_bytes"),
- "Number of bytes used for garbage collection system metadata.",
+ "Number of bytes used for garbage collection system metadata. Equals to /memory/classes/metadata/other:bytes.",
nil, nil,
),
eval: func(ms *runtime.MemStats) float64 { return float64(ms.GCSys) },
@@ -188,7 +181,7 @@ func goRuntimeMemStats() memStatsMetrics {
}, {
desc: NewDesc(
memstatNamespace("other_sys_bytes"),
- "Number of bytes used for other system allocations.",
+ "Number of bytes used for other system allocations. Equals to /memory/classes/other:bytes.",
nil, nil,
),
eval: func(ms *runtime.MemStats) float64 { return float64(ms.OtherSys) },
@@ -196,7 +189,7 @@ func goRuntimeMemStats() memStatsMetrics {
}, {
desc: NewDesc(
memstatNamespace("next_gc_bytes"),
- "Number of heap bytes when next garbage collection will take place.",
+ "Number of heap bytes when next garbage collection will take place. Equals to /gc/heap/goal:bytes.",
nil, nil,
),
eval: func(ms *runtime.MemStats) float64 { return float64(ms.NextGC) },
@@ -225,7 +218,7 @@ func newBaseGoCollector() baseGoCollector {
nil, nil),
gcDesc: NewDesc(
"go_gc_duration_seconds",
- "A summary of the pause duration of garbage collection cycles.",
+ "A summary of the wall-time pause (stop-the-world) duration in garbage collection cycles.",
nil, nil),
gcLastTimeDesc: NewDesc(
"go_memstats_last_gc_time_seconds",
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/go_collector_latest.go b/vendor/github.com/prometheus/client_golang/prometheus/go_collector_latest.go
index 2d8d9f64..51174641 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/go_collector_latest.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/go_collector_latest.go
@@ -17,6 +17,7 @@
package prometheus
import (
+ "fmt"
"math"
"runtime"
"runtime/metrics"
@@ -153,7 +154,8 @@ func defaultGoCollectorOptions() internal.GoCollectorOptions {
"/gc/heap/frees-by-size:bytes": goGCHeapFreesBytes,
},
RuntimeMetricRules: []internal.GoCollectorRule{
- //{Matcher: regexp.MustCompile("")},
+ // Recommended metrics we want by default from runtime/metrics.
+ {Matcher: internal.GoCollectorDefaultRuntimeMetrics},
},
}
}
@@ -203,6 +205,7 @@ func NewGoCollector(opts ...func(o *internal.GoCollectorOptions)) Collector {
// to fail here. This condition is tested in TestExpectedRuntimeMetrics.
continue
}
+ help := attachOriginalName(d.Description.Description, d.Name)
sampleBuf = append(sampleBuf, metrics.Sample{Name: d.Name})
sampleMap[d.Name] = &sampleBuf[len(sampleBuf)-1]
@@ -214,7 +217,7 @@ func NewGoCollector(opts ...func(o *internal.GoCollectorOptions)) Collector {
m = newBatchHistogram(
NewDesc(
BuildFQName(namespace, subsystem, name),
- d.Description.Description,
+ help,
nil,
nil,
),
@@ -226,7 +229,7 @@ func NewGoCollector(opts ...func(o *internal.GoCollectorOptions)) Collector {
Namespace: namespace,
Subsystem: subsystem,
Name: name,
- Help: d.Description.Description,
+ Help: help,
},
)
} else {
@@ -234,7 +237,7 @@ func NewGoCollector(opts ...func(o *internal.GoCollectorOptions)) Collector {
Namespace: namespace,
Subsystem: subsystem,
Name: name,
- Help: d.Description.Description,
+ Help: help,
})
}
metricSet = append(metricSet, m)
@@ -284,6 +287,10 @@ func NewGoCollector(opts ...func(o *internal.GoCollectorOptions)) Collector {
}
}
+func attachOriginalName(desc, origName string) string {
+ return fmt.Sprintf("%s Sourced from %s", desc, origName)
+}
+
// Describe returns all descriptions of the collector.
func (c *goCollector) Describe(ch chan<- *Desc) {
c.base.Describe(ch)
@@ -376,13 +383,13 @@ func unwrapScalarRMValue(v metrics.Value) float64 {
//
// This should never happen because we always populate our metric
// set from the runtime/metrics package.
- panic("unexpected unsupported metric")
+ panic("unexpected bad kind metric")
default:
// Unsupported metric kind.
//
// This should never happen because we check for this during initialization
// and flag and filter metrics whose kinds we don't understand.
- panic("unexpected unsupported metric kind")
+ panic(fmt.Sprintf("unexpected unsupported metric: %v", v.Kind()))
}
}
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/histogram.go b/vendor/github.com/prometheus/client_golang/prometheus/histogram.go
index b5c8bcb3..519db348 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/histogram.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/histogram.go
@@ -440,7 +440,7 @@ type HistogramOpts struct {
// constant (or any negative float value).
NativeHistogramZeroThreshold float64
- // The remaining fields define a strategy to limit the number of
+ // The next three fields define a strategy to limit the number of
// populated sparse buckets. If NativeHistogramMaxBucketNumber is left
// at zero, the number of buckets is not limited. (Note that this might
// lead to unbounded memory consumption if the values observed by the
@@ -473,6 +473,22 @@ type HistogramOpts struct {
NativeHistogramMinResetDuration time.Duration
NativeHistogramMaxZeroThreshold float64
+ // NativeHistogramMaxExemplars limits the number of exemplars
+ // that are kept in memory for each native histogram. If you leave it at
+ // zero, a default value of 10 is used. If no exemplars should be kept specifically
+ // for native histograms, set it to a negative value. (Scrapers can
+ // still use the exemplars exposed for classic buckets, which are managed
+ // independently.)
+ NativeHistogramMaxExemplars int
+ // NativeHistogramExemplarTTL is only checked once
+ // NativeHistogramMaxExemplars is exceeded. In that case, the
+ // oldest exemplar is removed if it is older than NativeHistogramExemplarTTL.
+ // Otherwise, the older exemplar in the pair of exemplars that are closest
+ // together (on an exponential scale) is removed.
+ // If NativeHistogramExemplarTTL is left at its zero value, a default value of
+ // 5m is used. To always delete the oldest exemplar, set it to a negative value.
+ NativeHistogramExemplarTTL time.Duration
+
// now is for testing purposes, by default it's time.Now.
now func() time.Time
@@ -532,6 +548,7 @@ func newHistogram(desc *Desc, opts HistogramOpts, labelValues ...string) Histogr
if opts.afterFunc == nil {
opts.afterFunc = time.AfterFunc
}
+
h := &histogram{
desc: desc,
upperBounds: opts.Buckets,
@@ -556,6 +573,7 @@ func newHistogram(desc *Desc, opts HistogramOpts, labelValues ...string) Histogr
h.nativeHistogramZeroThreshold = DefNativeHistogramZeroThreshold
} // Leave h.nativeHistogramZeroThreshold at 0 otherwise.
h.nativeHistogramSchema = pickSchema(opts.NativeHistogramBucketFactor)
+ h.nativeExemplars = makeNativeExemplars(opts.NativeHistogramExemplarTTL, opts.NativeHistogramMaxExemplars)
}
for i, upperBound := range h.upperBounds {
if i < len(h.upperBounds)-1 {
@@ -725,7 +743,8 @@ type histogram struct {
// resetScheduled is protected by mtx. It is true if a reset is
// scheduled for a later time (when nativeHistogramMinResetDuration has
// passed).
- resetScheduled bool
+ resetScheduled bool
+ nativeExemplars nativeExemplars
// now is for testing purposes, by default it's time.Now.
now func() time.Time
@@ -742,6 +761,9 @@ func (h *histogram) Observe(v float64) {
h.observe(v, h.findBucket(v))
}
+// ObserveWithExemplar should not be called in a high-frequency setting
+// for a native histogram with configured exemplars. For this case,
+// the implementation isn't lock-free and might suffer from lock contention.
func (h *histogram) ObserveWithExemplar(v float64, e Labels) {
i := h.findBucket(v)
h.observe(v, i)
@@ -821,6 +843,13 @@ func (h *histogram) Write(out *dto.Metric) error {
Length: proto.Uint32(0),
}}
}
+
+ if h.nativeExemplars.isEnabled() {
+ h.nativeExemplars.Lock()
+ his.Exemplars = append(his.Exemplars, h.nativeExemplars.exemplars...)
+ h.nativeExemplars.Unlock()
+ }
+
}
addAndResetCounts(hotCounts, coldCounts)
return nil
@@ -1091,8 +1120,10 @@ func (h *histogram) resetCounts(counts *histogramCounts) {
deleteSyncMap(&counts.nativeHistogramBucketsPositive)
}
-// updateExemplar replaces the exemplar for the provided bucket. With empty
-// labels, it's a no-op. It panics if any of the labels is invalid.
+// updateExemplar replaces the exemplar for the provided classic bucket.
+// With empty labels, it's a no-op. It panics if any of the labels is invalid.
+// If histogram is native, the exemplar will be cached into nativeExemplars,
+// which has a limit, and will remove one exemplar when limit is reached.
func (h *histogram) updateExemplar(v float64, bucket int, l Labels) {
if l == nil {
return
@@ -1102,6 +1133,10 @@ func (h *histogram) updateExemplar(v float64, bucket int, l Labels) {
panic(err)
}
h.exemplars[bucket].Store(e)
+ doSparse := h.nativeHistogramSchema > math.MinInt32 && !math.IsNaN(v)
+ if doSparse {
+ h.nativeExemplars.addExemplar(e)
+ }
}
// HistogramVec is a Collector that bundles a set of Histograms that all share the
@@ -1336,6 +1371,48 @@ func MustNewConstHistogram(
return m
}
+// NewConstHistogramWithCreatedTimestamp does the same thing as NewConstHistogram but sets the created timestamp.
+func NewConstHistogramWithCreatedTimestamp(
+ desc *Desc,
+ count uint64,
+ sum float64,
+ buckets map[float64]uint64,
+ ct time.Time,
+ labelValues ...string,
+) (Metric, error) {
+ if desc.err != nil {
+ return nil, desc.err
+ }
+ if err := validateLabelValues(labelValues, len(desc.variableLabels.names)); err != nil {
+ return nil, err
+ }
+ return &constHistogram{
+ desc: desc,
+ count: count,
+ sum: sum,
+ buckets: buckets,
+ labelPairs: MakeLabelPairs(desc, labelValues),
+ createdTs: timestamppb.New(ct),
+ }, nil
+}
+
+// MustNewConstHistogramWithCreatedTimestamp is a version of NewConstHistogramWithCreatedTimestamp that panics where
+// NewConstHistogramWithCreatedTimestamp would have returned an error.
+func MustNewConstHistogramWithCreatedTimestamp(
+ desc *Desc,
+ count uint64,
+ sum float64,
+ buckets map[float64]uint64,
+ ct time.Time,
+ labelValues ...string,
+) Metric {
+ m, err := NewConstHistogramWithCreatedTimestamp(desc, count, sum, buckets, ct, labelValues...)
+ if err != nil {
+ panic(err)
+ }
+ return m
+}
+
type buckSort []*dto.Bucket
func (s buckSort) Len() int {
@@ -1575,3 +1652,186 @@ func addAndResetCounts(hot, cold *histogramCounts) {
atomic.AddUint64(&hot.nativeHistogramZeroBucket, atomic.LoadUint64(&cold.nativeHistogramZeroBucket))
atomic.StoreUint64(&cold.nativeHistogramZeroBucket, 0)
}
+
+type nativeExemplars struct {
+ sync.Mutex
+
+ // Time-to-live for exemplars, it is set to -1 if exemplars are disabled, that is NativeHistogramMaxExemplars is below 0.
+ // The ttl is used on insertion to remove an exemplar that is older than ttl, if present.
+ ttl time.Duration
+
+ exemplars []*dto.Exemplar
+}
+
+func (n *nativeExemplars) isEnabled() bool {
+ return n.ttl != -1
+}
+
+func makeNativeExemplars(ttl time.Duration, maxCount int) nativeExemplars {
+ if ttl == 0 {
+ ttl = 5 * time.Minute
+ }
+
+ if maxCount == 0 {
+ maxCount = 10
+ }
+
+ if maxCount < 0 {
+ maxCount = 0
+ ttl = -1
+ }
+
+ return nativeExemplars{
+ ttl: ttl,
+ exemplars: make([]*dto.Exemplar, 0, maxCount),
+ }
+}
+
+func (n *nativeExemplars) addExemplar(e *dto.Exemplar) {
+ if !n.isEnabled() {
+ return
+ }
+
+ n.Lock()
+ defer n.Unlock()
+
+ // When the number of exemplars has not yet exceeded or
+ // is equal to cap(n.exemplars), then
+ // insert the new exemplar directly.
+ if len(n.exemplars) < cap(n.exemplars) {
+ var nIdx int
+ for nIdx = 0; nIdx < len(n.exemplars); nIdx++ {
+ if *e.Value < *n.exemplars[nIdx].Value {
+ break
+ }
+ }
+ n.exemplars = append(n.exemplars[:nIdx], append([]*dto.Exemplar{e}, n.exemplars[nIdx:]...)...)
+ return
+ }
+
+ if len(n.exemplars) == 1 {
+ // When the number of exemplars is 1, then
+ // replace the existing exemplar with the new exemplar.
+ n.exemplars[0] = e
+ return
+ }
+ // From this point on, the number of exemplars is greater than 1.
+
+ // When the number of exemplars exceeds the limit, remove one exemplar.
+ var (
+ ot = time.Time{} // Oldest timestamp seen. Initial value doesn't matter as we replace it due to otIdx == -1 in the loop.
+ otIdx = -1 // Index of the exemplar with the oldest timestamp.
+
+ md = -1.0 // Logarithm of the delta of the closest pair of exemplars.
+
+ // The insertion point of the new exemplar in the exemplars slice after insertion.
+ // This is calculated purely based on the order of the exemplars by value.
+ // nIdx == len(n.exemplars) means the new exemplar is to be inserted after the end.
+ nIdx = -1
+
+ // rIdx is ultimately the index for the exemplar that we are replacing with the new exemplar.
+ // The aim is to keep a good spread of exemplars by value and not let them bunch up too much.
+ // It is calculated in 3 steps:
+ // 1. First we set rIdx to the index of the older exemplar within the closest pair by value.
+ // That is the following will be true (on log scale):
+ // either the exemplar pair on index (rIdx-1, rIdx) or (rIdx, rIdx+1) will have
+ // the closest values to each other from all pairs.
+ // For example, suppose the values are distributed like this:
+ // |-----------x-------------x----------------x----x-----|
+ // ^--rIdx as this is older.
+ // Or like this:
+ // |-----------x-------------x----------------x----x-----|
+ // ^--rIdx as this is older.
+ // 2. If there is an exemplar that expired, then we simple reset rIdx to that index.
+ // 3. We check if by inserting the new exemplar we would create a closer pair at
+ // (nIdx-1, nIdx) or (nIdx, nIdx+1) and set rIdx to nIdx-1 or nIdx accordingly to
+ // keep the spread of exemplars by value; otherwise we keep rIdx as it is.
+ rIdx = -1
+ cLog float64 // Logarithm of the current exemplar.
+ pLog float64 // Logarithm of the previous exemplar.
+ )
+
+ for i, exemplar := range n.exemplars {
+ // Find the exemplar with the oldest timestamp.
+ if otIdx == -1 || exemplar.Timestamp.AsTime().Before(ot) {
+ ot = exemplar.Timestamp.AsTime()
+ otIdx = i
+ }
+
+ // Find the index at which to insert new the exemplar.
+ if nIdx == -1 && *e.Value <= *exemplar.Value {
+ nIdx = i
+ }
+
+ // Find the two closest exemplars and pick the one the with older timestamp.
+ pLog = cLog
+ cLog = math.Log(exemplar.GetValue())
+ if i == 0 {
+ continue
+ }
+ diff := math.Abs(cLog - pLog)
+ if md == -1 || diff < md {
+ // The closest exemplar pair is at index: i-1, i.
+ // Choose the exemplar with the older timestamp for replacement.
+ md = diff
+ if n.exemplars[i].Timestamp.AsTime().Before(n.exemplars[i-1].Timestamp.AsTime()) {
+ rIdx = i
+ } else {
+ rIdx = i - 1
+ }
+ }
+
+ }
+
+ // If all existing exemplar are smaller than new exemplar,
+ // then the exemplar should be inserted at the end.
+ if nIdx == -1 {
+ nIdx = len(n.exemplars)
+ }
+ // Here, we have the following relationships:
+ // n.exemplars[nIdx-1].Value < e.Value (if nIdx > 0)
+ // e.Value <= n.exemplars[nIdx].Value (if nIdx < len(n.exemplars))
+
+ if otIdx != -1 && e.Timestamp.AsTime().Sub(ot) > n.ttl {
+ // If the oldest exemplar has expired, then replace it with the new exemplar.
+ rIdx = otIdx
+ } else {
+ // In the previous for loop, when calculating the closest pair of exemplars,
+ // we did not take into account the newly inserted exemplar.
+ // So we need to calculate with the newly inserted exemplar again.
+ elog := math.Log(e.GetValue())
+ if nIdx > 0 {
+ diff := math.Abs(elog - math.Log(n.exemplars[nIdx-1].GetValue()))
+ if diff < md {
+ // The value we are about to insert is closer to the previous exemplar at the insertion point than what we calculated before in rIdx.
+ // v--rIdx
+ // |-----------x-n-----------x----------------x----x-----|
+ // nIdx-1--^ ^--new exemplar value
+ // Do not make the spread worse, replace nIdx-1 and not rIdx.
+ md = diff
+ rIdx = nIdx - 1
+ }
+ }
+ if nIdx < len(n.exemplars) {
+ diff := math.Abs(math.Log(n.exemplars[nIdx].GetValue()) - elog)
+ if diff < md {
+ // The value we are about to insert is closer to the next exemplar at the insertion point than what we calculated before in rIdx.
+ // v--rIdx
+ // |-----------x-----------n-x----------------x----x-----|
+ // new exemplar value--^ ^--nIdx
+ // Do not make the spread worse, replace nIdx-1 and not rIdx.
+ rIdx = nIdx
+ }
+ }
+ }
+
+ // Adjust the slice according to rIdx and nIdx.
+ switch {
+ case rIdx == nIdx:
+ n.exemplars[nIdx] = e
+ case rIdx < nIdx:
+ n.exemplars = append(n.exemplars[:rIdx], append(n.exemplars[rIdx+1:nIdx], append([]*dto.Exemplar{e}, n.exemplars[nIdx:]...)...)...)
+ case rIdx > nIdx:
+ n.exemplars = append(n.exemplars[:nIdx], append([]*dto.Exemplar{e}, append(n.exemplars[nIdx:rIdx], n.exemplars[rIdx+1:]...)...)...)
+ }
+}
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/internal/go_collector_options.go b/vendor/github.com/prometheus/client_golang/prometheus/internal/go_collector_options.go
index 723b45d6..a4fa6eab 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/internal/go_collector_options.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/internal/go_collector_options.go
@@ -30,3 +30,5 @@ type GoCollectorOptions struct {
RuntimeMetricSumForHist map[string]string
RuntimeMetricRules []GoCollectorRule
}
+
+var GoCollectorDefaultRuntimeMetrics = regexp.MustCompile(`/gc/gogc:percent|/gc/gomemlimit:bytes|/sched/gomaxprocs:threads`)
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/metric.go b/vendor/github.com/prometheus/client_golang/prometheus/metric.go
index f018e572..9d9b81ab 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/metric.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/metric.go
@@ -234,7 +234,7 @@ func NewMetricWithExemplars(m Metric, exemplars ...Exemplar) (Metric, error) {
)
for i, e := range exemplars {
ts := e.Timestamp
- if ts == (time.Time{}) {
+ if ts.IsZero() {
ts = now
}
exs[i], err = newExemplar(e.Value, ts, e.Labels)
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/process_collector.go b/vendor/github.com/prometheus/client_golang/prometheus/process_collector.go
index 8548dd18..62a4e7ad 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/process_collector.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/process_collector.go
@@ -22,14 +22,15 @@ import (
)
type processCollector struct {
- collectFn func(chan<- Metric)
- pidFn func() (int, error)
- reportErrors bool
- cpuTotal *Desc
- openFDs, maxFDs *Desc
- vsize, maxVsize *Desc
- rss *Desc
- startTime *Desc
+ collectFn func(chan<- Metric)
+ pidFn func() (int, error)
+ reportErrors bool
+ cpuTotal *Desc
+ openFDs, maxFDs *Desc
+ vsize, maxVsize *Desc
+ rss *Desc
+ startTime *Desc
+ inBytes, outBytes *Desc
}
// ProcessCollectorOpts defines the behavior of a process metrics collector
@@ -100,6 +101,16 @@ func NewProcessCollector(opts ProcessCollectorOpts) Collector {
"Start time of the process since unix epoch in seconds.",
nil, nil,
),
+ inBytes: NewDesc(
+ ns+"process_network_receive_bytes_total",
+ "Number of bytes received by the process over the network.",
+ nil, nil,
+ ),
+ outBytes: NewDesc(
+ ns+"process_network_transmit_bytes_total",
+ "Number of bytes sent by the process over the network.",
+ nil, nil,
+ ),
}
if opts.PidFn == nil {
@@ -129,6 +140,8 @@ func (c *processCollector) Describe(ch chan<- *Desc) {
ch <- c.maxVsize
ch <- c.rss
ch <- c.startTime
+ ch <- c.inBytes
+ ch <- c.outBytes
}
// Collect returns the current state of all metrics of the collector.
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/process_collector_other.go b/vendor/github.com/prometheus/client_golang/prometheus/process_collector_other.go
index 8c1136ce..14d56d2d 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/process_collector_other.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/process_collector_other.go
@@ -63,4 +63,18 @@ func (c *processCollector) processCollect(ch chan<- Metric) {
} else {
c.reportError(ch, nil, err)
}
+
+ if netstat, err := p.Netstat(); err == nil {
+ var inOctets, outOctets float64
+ if netstat.IpExt.InOctets != nil {
+ inOctets = *netstat.IpExt.InOctets
+ }
+ if netstat.IpExt.OutOctets != nil {
+ outOctets = *netstat.IpExt.OutOctets
+ }
+ ch <- MustNewConstMetric(c.inBytes, CounterValue, inOctets)
+ ch <- MustNewConstMetric(c.outBytes, CounterValue, outOctets)
+ } else {
+ c.reportError(ch, nil, err)
+ }
}
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/promhttp/delegator.go b/vendor/github.com/prometheus/client_golang/prometheus/promhttp/delegator.go
index 9819917b..315eab5f 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/promhttp/delegator.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/promhttp/delegator.go
@@ -76,6 +76,12 @@ func (r *responseWriterDelegator) Write(b []byte) (int, error) {
return n, err
}
+// Unwrap lets http.ResponseController get the underlying http.ResponseWriter,
+// by implementing the [rwUnwrapper](https://cs.opensource.google/go/go/+/refs/tags/go1.21.4:src/net/http/responsecontroller.go;l=42-44) interface.
+func (r *responseWriterDelegator) Unwrap() http.ResponseWriter {
+ return r.ResponseWriter
+}
+
type (
closeNotifierDelegator struct{ *responseWriterDelegator }
flusherDelegator struct{ *responseWriterDelegator }
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/promhttp/http.go b/vendor/github.com/prometheus/client_golang/prometheus/promhttp/http.go
index 09b8d2fb..e598e66e 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/promhttp/http.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/promhttp/http.go
@@ -38,12 +38,13 @@ import (
"io"
"net/http"
"strconv"
- "strings"
"sync"
"time"
+ "github.com/klauspost/compress/zstd"
"github.com/prometheus/common/expfmt"
+ "github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil"
"github.com/prometheus/client_golang/prometheus"
)
@@ -54,6 +55,18 @@ const (
processStartTimeHeader = "Process-Start-Time-Unix"
)
+// Compression represents the content encodings handlers support for the HTTP
+// responses.
+type Compression string
+
+const (
+ Identity Compression = "identity"
+ Gzip Compression = "gzip"
+ Zstd Compression = "zstd"
+)
+
+var defaultCompressionFormats = []Compression{Identity, Gzip, Zstd}
+
var gzipPool = sync.Pool{
New: func() interface{} {
return gzip.NewWriter(nil)
@@ -122,6 +135,18 @@ func HandlerForTransactional(reg prometheus.TransactionalGatherer, opts HandlerO
}
}
+ // Select compression formats to offer based on default or user choice.
+ var compressions []string
+ if !opts.DisableCompression {
+ offers := defaultCompressionFormats
+ if len(opts.OfferedCompressions) > 0 {
+ offers = opts.OfferedCompressions
+ }
+ for _, comp := range offers {
+ compressions = append(compressions, string(comp))
+ }
+ }
+
h := http.HandlerFunc(func(rsp http.ResponseWriter, req *http.Request) {
if !opts.ProcessStartTime.IsZero() {
rsp.Header().Set(processStartTimeHeader, strconv.FormatInt(opts.ProcessStartTime.Unix(), 10))
@@ -165,21 +190,23 @@ func HandlerForTransactional(reg prometheus.TransactionalGatherer, opts HandlerO
} else {
contentType = expfmt.Negotiate(req.Header)
}
- header := rsp.Header()
- header.Set(contentTypeHeader, string(contentType))
+ rsp.Header().Set(contentTypeHeader, string(contentType))
- w := io.Writer(rsp)
- if !opts.DisableCompression && gzipAccepted(req.Header) {
- header.Set(contentEncodingHeader, "gzip")
- gz := gzipPool.Get().(*gzip.Writer)
- defer gzipPool.Put(gz)
+ w, encodingHeader, closeWriter, err := negotiateEncodingWriter(req, rsp, compressions)
+ if err != nil {
+ if opts.ErrorLog != nil {
+ opts.ErrorLog.Println("error getting writer", err)
+ }
+ w = io.Writer(rsp)
+ encodingHeader = string(Identity)
+ }
- gz.Reset(w)
- defer gz.Close()
+ defer closeWriter()
- w = gz
+ // Set Content-Encoding only when data is compressed
+ if encodingHeader != string(Identity) {
+ rsp.Header().Set(contentEncodingHeader, encodingHeader)
}
-
enc := expfmt.NewEncoder(w, contentType)
// handleError handles the error according to opts.ErrorHandling
@@ -343,9 +370,19 @@ type HandlerOpts struct {
// no effect on the HTTP status code because ErrorHandling is set to
// ContinueOnError.
Registry prometheus.Registerer
- // If DisableCompression is true, the handler will never compress the
- // response, even if requested by the client.
+ // DisableCompression disables the response encoding (compression) and
+ // encoding negotiation. If true, the handler will
+ // never compress the response, even if requested
+ // by the client and the OfferedCompressions field is set.
DisableCompression bool
+ // OfferedCompressions is a set of encodings (compressions) handler will
+ // try to offer when negotiating with the client. This defaults to identity, gzip
+ // and zstd.
+ // NOTE: If handler can't agree with the client on the encodings or
+ // unsupported or empty encodings are set in OfferedCompressions,
+ // handler always fallbacks to no compression (identity), for
+ // compatibility reasons. In such cases ErrorLog will be used if set.
+ OfferedCompressions []Compression
// The number of concurrent HTTP requests is limited to
// MaxRequestsInFlight. Additional requests are responded to with 503
// Service Unavailable and a suitable message in the body. If
@@ -381,19 +418,6 @@ type HandlerOpts struct {
ProcessStartTime time.Time
}
-// gzipAccepted returns whether the client will accept gzip-encoded content.
-func gzipAccepted(header http.Header) bool {
- a := header.Get(acceptEncodingHeader)
- parts := strings.Split(a, ",")
- for _, part := range parts {
- part = strings.TrimSpace(part)
- if part == "gzip" || strings.HasPrefix(part, "gzip;") {
- return true
- }
- }
- return false
-}
-
// httpError removes any content-encoding header and then calls http.Error with
// the provided error and http.StatusInternalServerError. Error contents is
// supposed to be uncompressed plain text. Same as with a plain http.Error, this
@@ -406,3 +430,38 @@ func httpError(rsp http.ResponseWriter, err error) {
http.StatusInternalServerError,
)
}
+
+// negotiateEncodingWriter reads the Accept-Encoding header from a request and
+// selects the right compression based on an allow-list of supported
+// compressions. It returns a writer implementing the compression and an the
+// correct value that the caller can set in the response header.
+func negotiateEncodingWriter(r *http.Request, rw io.Writer, compressions []string) (_ io.Writer, encodingHeaderValue string, closeWriter func(), _ error) {
+ if len(compressions) == 0 {
+ return rw, string(Identity), func() {}, nil
+ }
+
+ // TODO(mrueg): Replace internal/github.com/gddo once https://github.com/golang/go/issues/19307 is implemented.
+ selected := httputil.NegotiateContentEncoding(r, compressions)
+
+ switch selected {
+ case "zstd":
+ // TODO(mrueg): Replace klauspost/compress with stdlib implementation once https://github.com/golang/go/issues/62513 is implemented.
+ z, err := zstd.NewWriter(rw, zstd.WithEncoderLevel(zstd.SpeedFastest))
+ if err != nil {
+ return nil, "", func() {}, err
+ }
+
+ z.Reset(rw)
+ return z, selected, func() { _ = z.Close() }, nil
+ case "gzip":
+ gz := gzipPool.Get().(*gzip.Writer)
+ gz.Reset(rw)
+ return gz, selected, func() { _ = gz.Close(); gzipPool.Put(gz) }, nil
+ case "identity":
+ // This means the content is not compressed.
+ return rw, selected, func() {}, nil
+ default:
+ // The content encoding was not implemented yet.
+ return nil, "", func() {}, fmt.Errorf("content compression format not recognized: %s. Valid formats are: %s", selected, defaultCompressionFormats)
+ }
+}
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/registry.go b/vendor/github.com/prometheus/client_golang/prometheus/registry.go
index 5e2ced25..c6fd2f58 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/registry.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/registry.go
@@ -314,16 +314,17 @@ func (r *Registry) Register(c Collector) error {
if dimHash != desc.dimHash {
return fmt.Errorf("a previously registered descriptor with the same fully-qualified name as %s has different label names or a different help string", desc)
}
- } else {
- // ...then check the new descriptors already seen.
- if dimHash, exists := newDimHashesByName[desc.fqName]; exists {
- if dimHash != desc.dimHash {
- return fmt.Errorf("descriptors reported by collector have inconsistent label names or help strings for the same fully-qualified name, offender is %s", desc)
- }
- } else {
- newDimHashesByName[desc.fqName] = desc.dimHash
+ continue
+ }
+
+ // ...then check the new descriptors already seen.
+ if dimHash, exists := newDimHashesByName[desc.fqName]; exists {
+ if dimHash != desc.dimHash {
+ return fmt.Errorf("descriptors reported by collector have inconsistent label names or help strings for the same fully-qualified name, offender is %s", desc)
}
+ continue
}
+ newDimHashesByName[desc.fqName] = desc.dimHash
}
// A Collector yielding no Desc at all is considered unchecked.
if len(newDescIDs) == 0 {
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/summary.go b/vendor/github.com/prometheus/client_golang/prometheus/summary.go
index 14627044..1ab0e479 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/summary.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/summary.go
@@ -783,3 +783,45 @@ func MustNewConstSummary(
}
return m
}
+
+// NewConstSummaryWithCreatedTimestamp does the same thing as NewConstSummary but sets the created timestamp.
+func NewConstSummaryWithCreatedTimestamp(
+ desc *Desc,
+ count uint64,
+ sum float64,
+ quantiles map[float64]float64,
+ ct time.Time,
+ labelValues ...string,
+) (Metric, error) {
+ if desc.err != nil {
+ return nil, desc.err
+ }
+ if err := validateLabelValues(labelValues, len(desc.variableLabels.names)); err != nil {
+ return nil, err
+ }
+ return &constSummary{
+ desc: desc,
+ count: count,
+ sum: sum,
+ quantiles: quantiles,
+ labelPairs: MakeLabelPairs(desc, labelValues),
+ createdTs: timestamppb.New(ct),
+ }, nil
+}
+
+// MustNewConstSummaryWithCreatedTimestamp is a version of NewConstSummaryWithCreatedTimestamp that panics where
+// NewConstSummaryWithCreatedTimestamp would have returned an error.
+func MustNewConstSummaryWithCreatedTimestamp(
+ desc *Desc,
+ count uint64,
+ sum float64,
+ quantiles map[float64]float64,
+ ct time.Time,
+ labelValues ...string,
+) Metric {
+ m, err := NewConstSummaryWithCreatedTimestamp(desc, count, sum, quantiles, ct, labelValues...)
+ if err != nil {
+ panic(err)
+ }
+ return m
+}
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/vec.go b/vendor/github.com/prometheus/client_golang/prometheus/vec.go
index 955cfd59..2c808eec 100644
--- a/vendor/github.com/prometheus/client_golang/prometheus/vec.go
+++ b/vendor/github.com/prometheus/client_golang/prometheus/vec.go
@@ -507,7 +507,7 @@ func (m *metricMap) getOrCreateMetricWithLabelValues(
return metric
}
-// getOrCreateMetricWithLabelValues retrieves the metric by hash and label value
+// getOrCreateMetricWithLabels retrieves the metric by hash and label value
// or creates it and returns the new one.
//
// This function holds the mutex.
diff --git a/vendor/github.com/prometheus/client_model/go/metrics.pb.go b/vendor/github.com/prometheus/client_model/go/metrics.pb.go
index cee360db..2f154907 100644
--- a/vendor/github.com/prometheus/client_model/go/metrics.pb.go
+++ b/vendor/github.com/prometheus/client_model/go/metrics.pb.go
@@ -483,6 +483,8 @@ type Histogram struct {
// histograms.
PositiveDelta []int64 `protobuf:"zigzag64,13,rep,name=positive_delta,json=positiveDelta" json:"positive_delta,omitempty"` // Count delta of each bucket compared to previous one (or to zero for 1st bucket).
PositiveCount []float64 `protobuf:"fixed64,14,rep,name=positive_count,json=positiveCount" json:"positive_count,omitempty"` // Absolute count of each bucket.
+ // Only used for native histograms. These exemplars MUST have a timestamp.
+ Exemplars []*Exemplar `protobuf:"bytes,16,rep,name=exemplars" json:"exemplars,omitempty"`
}
func (x *Histogram) Reset() {
@@ -622,6 +624,13 @@ func (x *Histogram) GetPositiveCount() []float64 {
return nil
}
+func (x *Histogram) GetExemplars() []*Exemplar {
+ if x != nil {
+ return x.Exemplars
+ }
+ return nil
+}
+
// A Bucket of a conventional histogram, each of which is treated as
// an individual counter-like time series by Prometheus.
type Bucket struct {
@@ -923,6 +932,7 @@ type MetricFamily struct {
Help *string `protobuf:"bytes,2,opt,name=help" json:"help,omitempty"`
Type *MetricType `protobuf:"varint,3,opt,name=type,enum=io.prometheus.client.MetricType" json:"type,omitempty"`
Metric []*Metric `protobuf:"bytes,4,rep,name=metric" json:"metric,omitempty"`
+ Unit *string `protobuf:"bytes,5,opt,name=unit" json:"unit,omitempty"`
}
func (x *MetricFamily) Reset() {
@@ -985,6 +995,13 @@ func (x *MetricFamily) GetMetric() []*Metric {
return nil
}
+func (x *MetricFamily) GetUnit() string {
+ if x != nil && x.Unit != nil {
+ return *x.Unit
+ }
+ return ""
+}
+
var File_io_prometheus_client_metrics_proto protoreflect.FileDescriptor
var file_io_prometheus_client_metrics_proto_rawDesc = []byte{
@@ -1028,7 +1045,7 @@ var file_io_prometheus_client_metrics_proto_rawDesc = []byte{
0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x10, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64,
0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x1f, 0x0a, 0x07, 0x55, 0x6e, 0x74,
0x79, 0x70, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20,
- 0x01, 0x28, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xac, 0x05, 0x0a, 0x09, 0x48,
+ 0x01, 0x28, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xea, 0x05, 0x0a, 0x09, 0x48,
0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x61, 0x6d, 0x70,
0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b,
0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x12, 0x73,
@@ -1071,79 +1088,84 @@ var file_io_prometheus_client_metrics_proto_rawDesc = []byte{
0x03, 0x28, 0x12, 0x52, 0x0d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x44, 0x65, 0x6c,
0x74, 0x61, 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63,
0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x01, 0x52, 0x0d, 0x70, 0x6f, 0x73, 0x69,
- 0x74, 0x69, 0x76, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xc6, 0x01, 0x0a, 0x06, 0x42, 0x75,
- 0x63, 0x6b, 0x65, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69,
- 0x76, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f,
- 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12,
- 0x34, 0x0a, 0x16, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x6f,
- 0x75, 0x6e, 0x74, 0x5f, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52,
- 0x14, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74,
- 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x75, 0x70, 0x70, 0x65, 0x72, 0x5f, 0x62,
- 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x75, 0x70, 0x70, 0x65,
- 0x72, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x3a, 0x0a, 0x08, 0x65, 0x78, 0x65, 0x6d, 0x70, 0x6c,
- 0x61, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72,
- 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e,
- 0x45, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x52, 0x08, 0x65, 0x78, 0x65, 0x6d, 0x70, 0x6c,
- 0x61, 0x72, 0x22, 0x3c, 0x0a, 0x0a, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x53, 0x70, 0x61, 0x6e,
- 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x11,
- 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x65, 0x6e, 0x67,
- 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68,
- 0x22, 0x91, 0x01, 0x0a, 0x08, 0x45, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x12, 0x35, 0x0a,
+ 0x74, 0x69, 0x76, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x3c, 0x0a, 0x09, 0x65, 0x78, 0x65,
+ 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x73, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x69,
+ 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69,
+ 0x65, 0x6e, 0x74, 0x2e, 0x45, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x52, 0x09, 0x65, 0x78,
+ 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x73, 0x22, 0xc6, 0x01, 0x0a, 0x06, 0x42, 0x75, 0x63, 0x6b,
+ 0x65, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65,
+ 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x63, 0x75,
+ 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x34, 0x0a,
+ 0x16, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e,
+ 0x74, 0x5f, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x14, 0x63,
+ 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x46, 0x6c,
+ 0x6f, 0x61, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x75, 0x70, 0x70, 0x65, 0x72, 0x5f, 0x62, 0x6f, 0x75,
+ 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x75, 0x70, 0x70, 0x65, 0x72, 0x42,
+ 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x3a, 0x0a, 0x08, 0x65, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72,
+ 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d,
+ 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x45, 0x78,
+ 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x52, 0x08, 0x65, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72,
+ 0x22, 0x3c, 0x0a, 0x0a, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x53, 0x70, 0x61, 0x6e, 0x12, 0x16,
+ 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x11, 0x52, 0x06,
+ 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68,
+ 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x22, 0x91,
+ 0x01, 0x0a, 0x08, 0x45, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x12, 0x35, 0x0a, 0x05, 0x6c,
+ 0x61, 0x62, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x69, 0x6f, 0x2e,
+ 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e,
+ 0x74, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x50, 0x61, 0x69, 0x72, 0x52, 0x05, 0x6c, 0x61, 0x62,
+ 0x65, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
+ 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65,
+ 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f,
+ 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69,
+ 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61,
+ 0x6d, 0x70, 0x22, 0xff, 0x02, 0x0a, 0x06, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x12, 0x35, 0x0a,
0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x69,
0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69,
0x65, 0x6e, 0x74, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x50, 0x61, 0x69, 0x72, 0x52, 0x05, 0x6c,
- 0x61, 0x62, 0x65, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20,
- 0x01, 0x28, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69,
- 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e,
- 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
- 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73,
- 0x74, 0x61, 0x6d, 0x70, 0x22, 0xff, 0x02, 0x0a, 0x06, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x12,
- 0x35, 0x0a, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f,
- 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63,
- 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x50, 0x61, 0x69, 0x72, 0x52,
- 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x31, 0x0a, 0x05, 0x67, 0x61, 0x75, 0x67, 0x65, 0x18,
- 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65,
- 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x61, 0x75,
- 0x67, 0x65, 0x52, 0x05, 0x67, 0x61, 0x75, 0x67, 0x65, 0x12, 0x37, 0x0a, 0x07, 0x63, 0x6f, 0x75,
- 0x6e, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x69, 0x6f, 0x2e,
+ 0x61, 0x62, 0x65, 0x6c, 0x12, 0x31, 0x0a, 0x05, 0x67, 0x61, 0x75, 0x67, 0x65, 0x18, 0x02, 0x20,
+ 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68,
+ 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x61, 0x75, 0x67, 0x65,
+ 0x52, 0x05, 0x67, 0x61, 0x75, 0x67, 0x65, 0x12, 0x37, 0x0a, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74,
+ 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72,
+ 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e,
+ 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x52, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72,
+ 0x12, 0x37, 0x0a, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28,
+ 0x0b, 0x32, 0x1d, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75,
+ 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79,
+ 0x52, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x37, 0x0a, 0x07, 0x75, 0x6e, 0x74,
+ 0x79, 0x70, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x69, 0x6f, 0x2e,
0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e,
- 0x74, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x52, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74,
- 0x65, 0x72, 0x12, 0x37, 0x0a, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x04, 0x20,
- 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68,
- 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x75, 0x6d, 0x6d, 0x61,
- 0x72, 0x79, 0x52, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x37, 0x0a, 0x07, 0x75,
- 0x6e, 0x74, 0x79, 0x70, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x69,
- 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69,
- 0x65, 0x6e, 0x74, 0x2e, 0x55, 0x6e, 0x74, 0x79, 0x70, 0x65, 0x64, 0x52, 0x07, 0x75, 0x6e, 0x74,
- 0x79, 0x70, 0x65, 0x64, 0x12, 0x3d, 0x0a, 0x09, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61,
- 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f,
- 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x48,
- 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x52, 0x09, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x67,
- 0x72, 0x61, 0x6d, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70,
- 0x5f, 0x6d, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x73,
- 0x74, 0x61, 0x6d, 0x70, 0x4d, 0x73, 0x22, 0xa2, 0x01, 0x0a, 0x0c, 0x4d, 0x65, 0x74, 0x72, 0x69,
- 0x63, 0x46, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18,
- 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x68,
- 0x65, 0x6c, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x65, 0x6c, 0x70, 0x12,
- 0x34, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e,
- 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c,
- 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x54, 0x79, 0x70, 0x65, 0x52,
- 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x34, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x18,
- 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65,
- 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x4d, 0x65, 0x74,
- 0x72, 0x69, 0x63, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x2a, 0x62, 0x0a, 0x0a, 0x4d,
- 0x65, 0x74, 0x72, 0x69, 0x63, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x4f, 0x55,
- 0x4e, 0x54, 0x45, 0x52, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x47, 0x41, 0x55, 0x47, 0x45, 0x10,
- 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x4d, 0x4d, 0x41, 0x52, 0x59, 0x10, 0x02, 0x12, 0x0b,
- 0x0a, 0x07, 0x55, 0x4e, 0x54, 0x59, 0x50, 0x45, 0x44, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x48,
- 0x49, 0x53, 0x54, 0x4f, 0x47, 0x52, 0x41, 0x4d, 0x10, 0x04, 0x12, 0x13, 0x0a, 0x0f, 0x47, 0x41,
- 0x55, 0x47, 0x45, 0x5f, 0x48, 0x49, 0x53, 0x54, 0x4f, 0x47, 0x52, 0x41, 0x4d, 0x10, 0x05, 0x42,
- 0x52, 0x0a, 0x14, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73,
- 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
- 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2f, 0x63,
- 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x67, 0x6f, 0x3b, 0x69,
- 0x6f, 0x5f, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x5f, 0x63, 0x6c, 0x69,
- 0x65, 0x6e, 0x74,
+ 0x74, 0x2e, 0x55, 0x6e, 0x74, 0x79, 0x70, 0x65, 0x64, 0x52, 0x07, 0x75, 0x6e, 0x74, 0x79, 0x70,
+ 0x65, 0x64, 0x12, 0x3d, 0x0a, 0x09, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x18,
+ 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65,
+ 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x48, 0x69, 0x73,
+ 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x52, 0x09, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61,
+ 0x6d, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x6d,
+ 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61,
+ 0x6d, 0x70, 0x4d, 0x73, 0x22, 0xb6, 0x01, 0x0a, 0x0c, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x46,
+ 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20,
+ 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x65, 0x6c,
+ 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x65, 0x6c, 0x70, 0x12, 0x34, 0x0a,
+ 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x69, 0x6f,
+ 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65,
+ 0x6e, 0x74, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74,
+ 0x79, 0x70, 0x65, 0x12, 0x34, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x18, 0x04, 0x20,
+ 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68,
+ 0x65, 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69,
+ 0x63, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x6e, 0x69,
+ 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x6e, 0x69, 0x74, 0x2a, 0x62, 0x0a,
+ 0x0a, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x43,
+ 0x4f, 0x55, 0x4e, 0x54, 0x45, 0x52, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x47, 0x41, 0x55, 0x47,
+ 0x45, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x4d, 0x4d, 0x41, 0x52, 0x59, 0x10, 0x02,
+ 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x54, 0x59, 0x50, 0x45, 0x44, 0x10, 0x03, 0x12, 0x0d, 0x0a,
+ 0x09, 0x48, 0x49, 0x53, 0x54, 0x4f, 0x47, 0x52, 0x41, 0x4d, 0x10, 0x04, 0x12, 0x13, 0x0a, 0x0f,
+ 0x47, 0x41, 0x55, 0x47, 0x45, 0x5f, 0x48, 0x49, 0x53, 0x54, 0x4f, 0x47, 0x52, 0x41, 0x4d, 0x10,
+ 0x05, 0x42, 0x52, 0x0a, 0x14, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65,
+ 0x75, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75,
+ 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73,
+ 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x67, 0x6f,
+ 0x3b, 0x69, 0x6f, 0x5f, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x5f, 0x63,
+ 0x6c, 0x69, 0x65, 0x6e, 0x74,
}
var (
@@ -1185,22 +1207,23 @@ var file_io_prometheus_client_metrics_proto_depIdxs = []int32{
13, // 5: io.prometheus.client.Histogram.created_timestamp:type_name -> google.protobuf.Timestamp
9, // 6: io.prometheus.client.Histogram.negative_span:type_name -> io.prometheus.client.BucketSpan
9, // 7: io.prometheus.client.Histogram.positive_span:type_name -> io.prometheus.client.BucketSpan
- 10, // 8: io.prometheus.client.Bucket.exemplar:type_name -> io.prometheus.client.Exemplar
- 1, // 9: io.prometheus.client.Exemplar.label:type_name -> io.prometheus.client.LabelPair
- 13, // 10: io.prometheus.client.Exemplar.timestamp:type_name -> google.protobuf.Timestamp
- 1, // 11: io.prometheus.client.Metric.label:type_name -> io.prometheus.client.LabelPair
- 2, // 12: io.prometheus.client.Metric.gauge:type_name -> io.prometheus.client.Gauge
- 3, // 13: io.prometheus.client.Metric.counter:type_name -> io.prometheus.client.Counter
- 5, // 14: io.prometheus.client.Metric.summary:type_name -> io.prometheus.client.Summary
- 6, // 15: io.prometheus.client.Metric.untyped:type_name -> io.prometheus.client.Untyped
- 7, // 16: io.prometheus.client.Metric.histogram:type_name -> io.prometheus.client.Histogram
- 0, // 17: io.prometheus.client.MetricFamily.type:type_name -> io.prometheus.client.MetricType
- 11, // 18: io.prometheus.client.MetricFamily.metric:type_name -> io.prometheus.client.Metric
- 19, // [19:19] is the sub-list for method output_type
- 19, // [19:19] is the sub-list for method input_type
- 19, // [19:19] is the sub-list for extension type_name
- 19, // [19:19] is the sub-list for extension extendee
- 0, // [0:19] is the sub-list for field type_name
+ 10, // 8: io.prometheus.client.Histogram.exemplars:type_name -> io.prometheus.client.Exemplar
+ 10, // 9: io.prometheus.client.Bucket.exemplar:type_name -> io.prometheus.client.Exemplar
+ 1, // 10: io.prometheus.client.Exemplar.label:type_name -> io.prometheus.client.LabelPair
+ 13, // 11: io.prometheus.client.Exemplar.timestamp:type_name -> google.protobuf.Timestamp
+ 1, // 12: io.prometheus.client.Metric.label:type_name -> io.prometheus.client.LabelPair
+ 2, // 13: io.prometheus.client.Metric.gauge:type_name -> io.prometheus.client.Gauge
+ 3, // 14: io.prometheus.client.Metric.counter:type_name -> io.prometheus.client.Counter
+ 5, // 15: io.prometheus.client.Metric.summary:type_name -> io.prometheus.client.Summary
+ 6, // 16: io.prometheus.client.Metric.untyped:type_name -> io.prometheus.client.Untyped
+ 7, // 17: io.prometheus.client.Metric.histogram:type_name -> io.prometheus.client.Histogram
+ 0, // 18: io.prometheus.client.MetricFamily.type:type_name -> io.prometheus.client.MetricType
+ 11, // 19: io.prometheus.client.MetricFamily.metric:type_name -> io.prometheus.client.Metric
+ 20, // [20:20] is the sub-list for method output_type
+ 20, // [20:20] is the sub-list for method input_type
+ 20, // [20:20] is the sub-list for extension type_name
+ 20, // [20:20] is the sub-list for extension extendee
+ 0, // [0:20] is the sub-list for field type_name
}
func init() { file_io_prometheus_client_metrics_proto_init() }
diff --git a/vendor/github.com/prometheus/common/expfmt/decode.go b/vendor/github.com/prometheus/common/expfmt/decode.go
index a909b171..1448439b 100644
--- a/vendor/github.com/prometheus/common/expfmt/decode.go
+++ b/vendor/github.com/prometheus/common/expfmt/decode.go
@@ -73,16 +73,16 @@ func ResponseFormat(h http.Header) Format {
// NewDecoder returns a new decoder based on the given input format.
// If the input format does not imply otherwise, a text format decoder is returned.
func NewDecoder(r io.Reader, format Format) Decoder {
- switch format {
- case FmtProtoDelim:
- return &protoDecoder{r: r}
+ switch format.FormatType() {
+ case TypeProtoDelim:
+ return &protoDecoder{r: bufio.NewReader(r)}
}
return &textDecoder{r: r}
}
// protoDecoder implements the Decoder interface for protocol buffers.
type protoDecoder struct {
- r io.Reader
+ r protodelim.Reader
}
// Decode implements the Decoder interface.
@@ -90,7 +90,7 @@ func (d *protoDecoder) Decode(v *dto.MetricFamily) error {
opts := protodelim.UnmarshalOptions{
MaxSize: -1,
}
- if err := opts.UnmarshalFrom(bufio.NewReader(d.r), v); err != nil {
+ if err := opts.UnmarshalFrom(d.r, v); err != nil {
return err
}
if !model.IsValidMetricName(model.LabelValue(v.GetName())) {
diff --git a/vendor/github.com/prometheus/common/expfmt/encode.go b/vendor/github.com/prometheus/common/expfmt/encode.go
index 02b7a5e8..cf0c150c 100644
--- a/vendor/github.com/prometheus/common/expfmt/encode.go
+++ b/vendor/github.com/prometheus/common/expfmt/encode.go
@@ -21,7 +21,9 @@ import (
"google.golang.org/protobuf/encoding/protodelim"
"google.golang.org/protobuf/encoding/prototext"
- "github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg"
+ "github.com/prometheus/common/model"
+
+ "github.com/munnerz/goautoneg"
dto "github.com/prometheus/client_model/go"
)
@@ -61,23 +63,32 @@ func (ec encoderCloser) Close() error {
// as the support is still experimental. To include the option to negotiate
// FmtOpenMetrics, use NegotiateOpenMetrics.
func Negotiate(h http.Header) Format {
+ escapingScheme := Format(fmt.Sprintf("; escaping=%s", Format(model.NameEscapingScheme.String())))
for _, ac := range goautoneg.ParseAccept(h.Get(hdrAccept)) {
+ if escapeParam := ac.Params[model.EscapingKey]; escapeParam != "" {
+ switch Format(escapeParam) {
+ case model.AllowUTF8, model.EscapeUnderscores, model.EscapeDots, model.EscapeValues:
+ escapingScheme = Format(fmt.Sprintf("; escaping=%s", escapeParam))
+ default:
+ // If the escaping parameter is unknown, ignore it.
+ }
+ }
ver := ac.Params["version"]
if ac.Type+"/"+ac.SubType == ProtoType && ac.Params["proto"] == ProtoProtocol {
switch ac.Params["encoding"] {
case "delimited":
- return FmtProtoDelim
+ return FmtProtoDelim + escapingScheme
case "text":
- return FmtProtoText
+ return FmtProtoText + escapingScheme
case "compact-text":
- return FmtProtoCompact
+ return FmtProtoCompact + escapingScheme
}
}
if ac.Type == "text" && ac.SubType == "plain" && (ver == TextVersion || ver == "") {
- return FmtText
+ return FmtText + escapingScheme
}
}
- return FmtText
+ return FmtText + escapingScheme
}
// NegotiateIncludingOpenMetrics works like Negotiate but includes
@@ -85,29 +96,40 @@ func Negotiate(h http.Header) Format {
// temporary and will disappear once FmtOpenMetrics is fully supported and as
// such may be negotiated by the normal Negotiate function.
func NegotiateIncludingOpenMetrics(h http.Header) Format {
+ escapingScheme := Format(fmt.Sprintf("; escaping=%s", Format(model.NameEscapingScheme.String())))
for _, ac := range goautoneg.ParseAccept(h.Get(hdrAccept)) {
+ if escapeParam := ac.Params[model.EscapingKey]; escapeParam != "" {
+ switch Format(escapeParam) {
+ case model.AllowUTF8, model.EscapeUnderscores, model.EscapeDots, model.EscapeValues:
+ escapingScheme = Format(fmt.Sprintf("; escaping=%s", escapeParam))
+ default:
+ // If the escaping parameter is unknown, ignore it.
+ }
+ }
ver := ac.Params["version"]
if ac.Type+"/"+ac.SubType == ProtoType && ac.Params["proto"] == ProtoProtocol {
switch ac.Params["encoding"] {
case "delimited":
- return FmtProtoDelim
+ return FmtProtoDelim + escapingScheme
case "text":
- return FmtProtoText
+ return FmtProtoText + escapingScheme
case "compact-text":
- return FmtProtoCompact
+ return FmtProtoCompact + escapingScheme
}
}
if ac.Type == "text" && ac.SubType == "plain" && (ver == TextVersion || ver == "") {
- return FmtText
+ return FmtText + escapingScheme
}
if ac.Type+"/"+ac.SubType == OpenMetricsType && (ver == OpenMetricsVersion_0_0_1 || ver == OpenMetricsVersion_1_0_0 || ver == "") {
- if ver == OpenMetricsVersion_1_0_0 {
- return FmtOpenMetrics_1_0_0
+ switch ver {
+ case OpenMetricsVersion_1_0_0:
+ return FmtOpenMetrics_1_0_0 + escapingScheme
+ default:
+ return FmtOpenMetrics_0_0_1 + escapingScheme
}
- return FmtOpenMetrics_0_0_1
}
}
- return FmtText
+ return FmtText + escapingScheme
}
// NewEncoder returns a new encoder based on content type negotiation. All
@@ -116,9 +138,19 @@ func NegotiateIncludingOpenMetrics(h http.Header) Format {
// for FmtOpenMetrics, but a future (breaking) release will add the Close method
// to the Encoder interface directly. The current version of the Encoder
// interface is kept for backwards compatibility.
-func NewEncoder(w io.Writer, format Format) Encoder {
- switch format {
- case FmtProtoDelim:
+// In cases where the Format does not allow for UTF-8 names, the global
+// NameEscapingScheme will be applied.
+//
+// NewEncoder can be called with additional options to customize the OpenMetrics text output.
+// For example:
+// NewEncoder(w, FmtOpenMetrics_1_0_0, WithCreatedLines())
+//
+// Extra options are ignored for all other formats.
+func NewEncoder(w io.Writer, format Format, options ...EncoderOption) Encoder {
+ escapingScheme := format.ToEscapingScheme()
+
+ switch format.FormatType() {
+ case TypeProtoDelim:
return encoderCloser{
encode: func(v *dto.MetricFamily) error {
_, err := protodelim.MarshalTo(w, v)
@@ -126,34 +158,34 @@ func NewEncoder(w io.Writer, format Format) Encoder {
},
close: func() error { return nil },
}
- case FmtProtoCompact:
+ case TypeProtoCompact:
return encoderCloser{
encode: func(v *dto.MetricFamily) error {
- _, err := fmt.Fprintln(w, v.String())
+ _, err := fmt.Fprintln(w, model.EscapeMetricFamily(v, escapingScheme).String())
return err
},
close: func() error { return nil },
}
- case FmtProtoText:
+ case TypeProtoText:
return encoderCloser{
encode: func(v *dto.MetricFamily) error {
- _, err := fmt.Fprintln(w, prototext.Format(v))
+ _, err := fmt.Fprintln(w, prototext.Format(model.EscapeMetricFamily(v, escapingScheme)))
return err
},
close: func() error { return nil },
}
- case FmtText:
+ case TypeTextPlain:
return encoderCloser{
encode: func(v *dto.MetricFamily) error {
- _, err := MetricFamilyToText(w, v)
+ _, err := MetricFamilyToText(w, model.EscapeMetricFamily(v, escapingScheme))
return err
},
close: func() error { return nil },
}
- case FmtOpenMetrics_0_0_1, FmtOpenMetrics_1_0_0:
+ case TypeOpenMetrics:
return encoderCloser{
encode: func(v *dto.MetricFamily) error {
- _, err := MetricFamilyToOpenMetrics(w, v)
+ _, err := MetricFamilyToOpenMetrics(w, model.EscapeMetricFamily(v, escapingScheme), options...)
return err
},
close: func() error {
diff --git a/vendor/github.com/prometheus/common/expfmt/expfmt.go b/vendor/github.com/prometheus/common/expfmt/expfmt.go
index c4cb20f0..d942af8e 100644
--- a/vendor/github.com/prometheus/common/expfmt/expfmt.go
+++ b/vendor/github.com/prometheus/common/expfmt/expfmt.go
@@ -14,26 +14,48 @@
// Package expfmt contains tools for reading and writing Prometheus metrics.
package expfmt
+import (
+ "fmt"
+ "strings"
+
+ "github.com/prometheus/common/model"
+)
+
// Format specifies the HTTP content type of the different wire protocols.
type Format string
-// Constants to assemble the Content-Type values for the different wire protocols.
+// Constants to assemble the Content-Type values for the different wire
+// protocols. The Content-Type strings here are all for the legacy exposition
+// formats, where valid characters for metric names and label names are limited.
+// Support for arbitrary UTF-8 characters in those names is already partially
+// implemented in this module (see model.ValidationScheme), but to actually use
+// it on the wire, new content-type strings will have to be agreed upon and
+// added here.
const (
- TextVersion = "0.0.4"
- ProtoType = `application/vnd.google.protobuf`
- ProtoProtocol = `io.prometheus.client.MetricFamily`
+ TextVersion = "0.0.4"
+ ProtoType = `application/vnd.google.protobuf`
+ ProtoProtocol = `io.prometheus.client.MetricFamily`
+ // Deprecated: Use expfmt.NewFormat(expfmt.TypeProtoCompact) instead.
ProtoFmt = ProtoType + "; proto=" + ProtoProtocol + ";"
OpenMetricsType = `application/openmetrics-text`
OpenMetricsVersion_0_0_1 = "0.0.1"
OpenMetricsVersion_1_0_0 = "1.0.0"
- // The Content-Type values for the different wire protocols.
- FmtUnknown Format = ``
- FmtText Format = `text/plain; version=` + TextVersion + `; charset=utf-8`
- FmtProtoDelim Format = ProtoFmt + ` encoding=delimited`
- FmtProtoText Format = ProtoFmt + ` encoding=text`
- FmtProtoCompact Format = ProtoFmt + ` encoding=compact-text`
+ // The Content-Type values for the different wire protocols. Do not do direct
+ // comparisons to these constants, instead use the comparison functions.
+ // Deprecated: Use expfmt.NewFormat(expfmt.TypeUnknown) instead.
+ FmtUnknown Format = ``
+ // Deprecated: Use expfmt.NewFormat(expfmt.TypeTextPlain) instead.
+ FmtText Format = `text/plain; version=` + TextVersion + `; charset=utf-8`
+ // Deprecated: Use expfmt.NewFormat(expfmt.TypeProtoDelim) instead.
+ FmtProtoDelim Format = ProtoFmt + ` encoding=delimited`
+ // Deprecated: Use expfmt.NewFormat(expfmt.TypeProtoText) instead.
+ FmtProtoText Format = ProtoFmt + ` encoding=text`
+ // Deprecated: Use expfmt.NewFormat(expfmt.TypeProtoCompact) instead.
+ FmtProtoCompact Format = ProtoFmt + ` encoding=compact-text`
+ // Deprecated: Use expfmt.NewFormat(expfmt.TypeOpenMetrics) instead.
FmtOpenMetrics_1_0_0 Format = OpenMetricsType + `; version=` + OpenMetricsVersion_1_0_0 + `; charset=utf-8`
+ // Deprecated: Use expfmt.NewFormat(expfmt.TypeOpenMetrics) instead.
FmtOpenMetrics_0_0_1 Format = OpenMetricsType + `; version=` + OpenMetricsVersion_0_0_1 + `; charset=utf-8`
)
@@ -41,3 +63,145 @@ const (
hdrContentType = "Content-Type"
hdrAccept = "Accept"
)
+
+// FormatType is a Go enum representing the overall category for the given
+// Format. As the number of Format permutations increases, doing basic string
+// comparisons are not feasible, so this enum captures the most useful
+// high-level attribute of the Format string.
+type FormatType int
+
+const (
+ TypeUnknown FormatType = iota
+ TypeProtoCompact
+ TypeProtoDelim
+ TypeProtoText
+ TypeTextPlain
+ TypeOpenMetrics
+)
+
+// NewFormat generates a new Format from the type provided. Mostly used for
+// tests, most Formats should be generated as part of content negotiation in
+// encode.go. If a type has more than one version, the latest version will be
+// returned.
+func NewFormat(t FormatType) Format {
+ switch t {
+ case TypeProtoCompact:
+ return FmtProtoCompact
+ case TypeProtoDelim:
+ return FmtProtoDelim
+ case TypeProtoText:
+ return FmtProtoText
+ case TypeTextPlain:
+ return FmtText
+ case TypeOpenMetrics:
+ return FmtOpenMetrics_1_0_0
+ default:
+ return FmtUnknown
+ }
+}
+
+// NewOpenMetricsFormat generates a new OpenMetrics format matching the
+// specified version number.
+func NewOpenMetricsFormat(version string) (Format, error) {
+ if version == OpenMetricsVersion_0_0_1 {
+ return FmtOpenMetrics_0_0_1, nil
+ }
+ if version == OpenMetricsVersion_1_0_0 {
+ return FmtOpenMetrics_1_0_0, nil
+ }
+ return FmtUnknown, fmt.Errorf("unknown open metrics version string")
+}
+
+// WithEscapingScheme returns a copy of Format with the specified escaping
+// scheme appended to the end. If an escaping scheme already exists it is
+// removed.
+func (f Format) WithEscapingScheme(s model.EscapingScheme) Format {
+ var terms []string
+ for _, p := range strings.Split(string(f), ";") {
+ toks := strings.Split(p, "=")
+ if len(toks) != 2 {
+ trimmed := strings.TrimSpace(p)
+ if len(trimmed) > 0 {
+ terms = append(terms, trimmed)
+ }
+ continue
+ }
+ key := strings.TrimSpace(toks[0])
+ if key != model.EscapingKey {
+ terms = append(terms, strings.TrimSpace(p))
+ }
+ }
+ terms = append(terms, model.EscapingKey+"="+s.String())
+ return Format(strings.Join(terms, "; "))
+}
+
+// FormatType deduces an overall FormatType for the given format.
+func (f Format) FormatType() FormatType {
+ toks := strings.Split(string(f), ";")
+ params := make(map[string]string)
+ for i, t := range toks {
+ if i == 0 {
+ continue
+ }
+ args := strings.Split(t, "=")
+ if len(args) != 2 {
+ continue
+ }
+ params[strings.TrimSpace(args[0])] = strings.TrimSpace(args[1])
+ }
+
+ switch strings.TrimSpace(toks[0]) {
+ case ProtoType:
+ if params["proto"] != ProtoProtocol {
+ return TypeUnknown
+ }
+ switch params["encoding"] {
+ case "delimited":
+ return TypeProtoDelim
+ case "text":
+ return TypeProtoText
+ case "compact-text":
+ return TypeProtoCompact
+ default:
+ return TypeUnknown
+ }
+ case OpenMetricsType:
+ if params["charset"] != "utf-8" {
+ return TypeUnknown
+ }
+ return TypeOpenMetrics
+ case "text/plain":
+ v, ok := params["version"]
+ if !ok {
+ return TypeTextPlain
+ }
+ if v == TextVersion {
+ return TypeTextPlain
+ }
+ return TypeUnknown
+ default:
+ return TypeUnknown
+ }
+}
+
+// ToEscapingScheme returns an EscapingScheme depending on the Format. Iff the
+// Format contains a escaping=allow-utf-8 term, it will select NoEscaping. If a valid
+// "escaping" term exists, that will be used. Otherwise, the global default will
+// be returned.
+func (format Format) ToEscapingScheme() model.EscapingScheme {
+ for _, p := range strings.Split(string(format), ";") {
+ toks := strings.Split(p, "=")
+ if len(toks) != 2 {
+ continue
+ }
+ key, value := strings.TrimSpace(toks[0]), strings.TrimSpace(toks[1])
+ if key == model.EscapingKey {
+ scheme, err := model.ToEscapingScheme(value)
+ if err != nil {
+ return model.NameEscapingScheme
+ }
+ return scheme
+ }
+ }
+ return model.NameEscapingScheme
+}
diff --git a/vendor/github.com/prometheus/common/expfmt/openmetrics_create.go b/vendor/github.com/prometheus/common/expfmt/openmetrics_create.go
index 21cdddcf..11c8ff4b 100644
--- a/vendor/github.com/prometheus/common/expfmt/openmetrics_create.go
+++ b/vendor/github.com/prometheus/common/expfmt/openmetrics_create.go
@@ -22,11 +22,47 @@ import (
"strconv"
"strings"
+ "google.golang.org/protobuf/types/known/timestamppb"
+
"github.com/prometheus/common/model"
dto "github.com/prometheus/client_model/go"
)
+type encoderOption struct {
+ withCreatedLines bool
+ withUnit bool
+}
+
+type EncoderOption func(*encoderOption)
+
+// WithCreatedLines is an EncoderOption that configures the OpenMetrics encoder
+// to include _created lines (See
+// https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#counter-1).
+// Created timestamps can improve the accuracy of series reset detection, but
+// come with a bandwidth cost.
+//
+// At the time of writing, created timestamp ingestion is still experimental in
+// Prometheus and need to be enabled with the feature-flag
+// `--feature-flag=created-timestamp-zero-ingestion`, and breaking changes are
+// still possible. Therefore, it is recommended to use this feature with caution.
+func WithCreatedLines() EncoderOption {
+ return func(t *encoderOption) {
+ t.withCreatedLines = true
+ }
+}
+
+// WithUnit is an EncoderOption enabling a set unit to be written to the output
+// and to be added to the metric name, if it's not there already, as a suffix.
+// Without opting in this way, the unit will not be added to the metric name and,
+// on top of that, the unit will not be passed onto the output, even if it
+// were declared in the *dto.MetricFamily struct, i.e. even if in.Unit !=nil.
+func WithUnit() EncoderOption {
+ return func(t *encoderOption) {
+ t.withUnit = true
+ }
+}
+
// MetricFamilyToOpenMetrics converts a MetricFamily proto message into the
// OpenMetrics text format and writes the resulting lines to 'out'. It returns
// the number of bytes written and any error encountered. The output will have
@@ -35,6 +71,18 @@ import (
// sanity checks. If the input contains duplicate metrics or invalid metric or
// label names, the conversion will result in invalid text format output.
//
+// If metric names conform to the legacy validation pattern, they will be placed
+// outside the brackets in the traditional way, like `foo{}`. If the metric name
+// fails the legacy validation check, it will be placed quoted inside the
+// brackets: `{"foo"}`. As stated above, the input is assumed to be santized and
+// no error will be thrown in this case.
+//
+// Similar to metric names, if label names conform to the legacy validation
+// pattern, they will be unquoted as normal, like `foo{bar="baz"}`. If the label
+// name fails the legacy validation check, it will be quoted:
+// `foo{"bar"="baz"}`. As stated above, the input is assumed to be santized and
+// no error will be thrown in this case.
+//
// This function fulfills the type 'expfmt.encoder'.
//
// Note that OpenMetrics requires a final `# EOF` line. Since this function acts
@@ -47,20 +95,34 @@ import (
// Prometheus to OpenMetrics or vice versa:
//
// - Counters are expected to have the `_total` suffix in their metric name. In
-// the output, the suffix will be truncated from the `# TYPE` and `# HELP`
-// line. A counter with a missing `_total` suffix is not an error. However,
+// the output, the suffix will be truncated from the `# TYPE`, `# HELP` and `# UNIT`
+// lines. A counter with a missing `_total` suffix is not an error. However,
// its type will be set to `unknown` in that case to avoid invalid OpenMetrics
// output.
//
-// - No support for the following (optional) features: `# UNIT` line, `_created`
-// line, info type, stateset type, gaugehistogram type.
+// - According to the OM specs, the `# UNIT` line is optional, but if populated,
+// the unit has to be present in the metric name as its suffix:
+// (see https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#unit).
+// However, in order to accommodate any potential scenario where such a change in the
+// metric name is not desirable, the users are here given the choice of either explicitly
+// opt in, in case they wish for the unit to be included in the output AND in the metric name
+// as a suffix (see the description of the WithUnit function above),
+// or not to opt in, in case they don't want for any of that to happen.
+//
+// - No support for the following (optional) features: info type,
+// stateset type, gaugehistogram type.
//
// - The size of exemplar labels is not checked (i.e. it's possible to create
// exemplars that are larger than allowed by the OpenMetrics specification).
//
// - The value of Counters is not checked. (OpenMetrics doesn't allow counters
// with a `NaN` value.)
-func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily) (written int, err error) {
+func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily, options ...EncoderOption) (written int, err error) {
+ toOM := encoderOption{}
+ for _, option := range options {
+ option(&toOM)
+ }
+
name := in.GetName()
if name == "" {
return 0, fmt.Errorf("MetricFamily has no name: %s", in)
@@ -83,12 +145,15 @@ func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily) (written int
}
var (
- n int
- metricType = in.GetType()
- shortName = name
+ n int
+ metricType = in.GetType()
+ compliantName = name
)
- if metricType == dto.MetricType_COUNTER && strings.HasSuffix(shortName, "_total") {
- shortName = name[:len(name)-6]
+ if metricType == dto.MetricType_COUNTER && strings.HasSuffix(compliantName, "_total") {
+ compliantName = name[:len(name)-6]
+ }
+ if toOM.withUnit && in.Unit != nil && !strings.HasSuffix(compliantName, fmt.Sprintf("_%s", *in.Unit)) {
+ compliantName = compliantName + fmt.Sprintf("_%s", *in.Unit)
}
// Comments, first HELP, then TYPE.
@@ -98,7 +163,7 @@ func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily) (written int
if err != nil {
return
}
- n, err = w.WriteString(shortName)
+ n, err = writeName(w, compliantName)
written += n
if err != nil {
return
@@ -124,7 +189,7 @@ func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily) (written int
if err != nil {
return
}
- n, err = w.WriteString(shortName)
+ n, err = writeName(w, compliantName)
written += n
if err != nil {
return
@@ -151,55 +216,89 @@ func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily) (written int
if err != nil {
return
}
+ if toOM.withUnit && in.Unit != nil {
+ n, err = w.WriteString("# UNIT ")
+ written += n
+ if err != nil {
+ return
+ }
+ n, err = writeName(w, compliantName)
+ written += n
+ if err != nil {
+ return
+ }
+
+ err = w.WriteByte(' ')
+ written++
+ if err != nil {
+ return
+ }
+ n, err = writeEscapedString(w, *in.Unit, true)
+ written += n
+ if err != nil {
+ return
+ }
+ err = w.WriteByte('\n')
+ written++
+ if err != nil {
+ return
+ }
+ }
+
+ var createdTsBytesWritten int
// Finally the samples, one line for each.
+ if metricType == dto.MetricType_COUNTER && strings.HasSuffix(name, "_total") {
+ compliantName = compliantName + "_total"
+ }
for _, metric := range in.Metric {
switch metricType {
case dto.MetricType_COUNTER:
if metric.Counter == nil {
return written, fmt.Errorf(
- "expected counter in metric %s %s", name, metric,
+ "expected counter in metric %s %s", compliantName, metric,
)
}
- // Note that we have ensured above that either the name
- // ends on `_total` or that the rendered type is
- // `unknown`. Therefore, no `_total` must be added here.
n, err = writeOpenMetricsSample(
- w, name, "", metric, "", 0,
+ w, compliantName, "", metric, "", 0,
metric.Counter.GetValue(), 0, false,
metric.Counter.Exemplar,
)
+ if toOM.withCreatedLines && metric.Counter.CreatedTimestamp != nil {
+ createdTsBytesWritten, err = writeOpenMetricsCreated(w, compliantName, "_total", metric, "", 0, metric.Counter.GetCreatedTimestamp())
+ n += createdTsBytesWritten
+ }
case dto.MetricType_GAUGE:
if metric.Gauge == nil {
return written, fmt.Errorf(
- "expected gauge in metric %s %s", name, metric,
+ "expected gauge in metric %s %s", compliantName, metric,
)
}
n, err = writeOpenMetricsSample(
- w, name, "", metric, "", 0,
+ w, compliantName, "", metric, "", 0,
metric.Gauge.GetValue(), 0, false,
nil,
)
case dto.MetricType_UNTYPED:
if metric.Untyped == nil {
return written, fmt.Errorf(
- "expected untyped in metric %s %s", name, metric,
+ "expected untyped in metric %s %s", compliantName, metric,
)
}
n, err = writeOpenMetricsSample(
- w, name, "", metric, "", 0,
+ w, compliantName, "", metric, "", 0,
metric.Untyped.GetValue(), 0, false,
nil,
)
case dto.MetricType_SUMMARY:
if metric.Summary == nil {
return written, fmt.Errorf(
- "expected summary in metric %s %s", name, metric,
+ "expected summary in metric %s %s", compliantName, metric,
)
}
for _, q := range metric.Summary.Quantile {
n, err = writeOpenMetricsSample(
- w, name, "", metric,
+ w, compliantName, "", metric,
model.QuantileLabel, q.GetQuantile(),
q.GetValue(), 0, false,
nil,
@@ -210,7 +309,7 @@ func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily) (written int
}
}
n, err = writeOpenMetricsSample(
- w, name, "_sum", metric, "", 0,
+ w, compliantName, "_sum", metric, "", 0,
metric.Summary.GetSampleSum(), 0, false,
nil,
)
@@ -219,20 +318,24 @@ func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily) (written int
return
}
n, err = writeOpenMetricsSample(
- w, name, "_count", metric, "", 0,
+ w, compliantName, "_count", metric, "", 0,
0, metric.Summary.GetSampleCount(), true,
nil,
)
+ if toOM.withCreatedLines && metric.Summary.CreatedTimestamp != nil {
+ createdTsBytesWritten, err = writeOpenMetricsCreated(w, compliantName, "", metric, "", 0, metric.Summary.GetCreatedTimestamp())
+ n += createdTsBytesWritten
+ }
case dto.MetricType_HISTOGRAM:
if metric.Histogram == nil {
return written, fmt.Errorf(
- "expected histogram in metric %s %s", name, metric,
+ "expected histogram in metric %s %s", compliantName, metric,
)
}
infSeen := false
for _, b := range metric.Histogram.Bucket {
n, err = writeOpenMetricsSample(
- w, name, "_bucket", metric,
+ w, compliantName, "_bucket", metric,
model.BucketLabel, b.GetUpperBound(),
0, b.GetCumulativeCount(), true,
b.Exemplar,
@@ -247,7 +350,7 @@ func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily) (written int
}
if !infSeen {
n, err = writeOpenMetricsSample(
- w, name, "_bucket", metric,
+ w, compliantName, "_bucket", metric,
model.BucketLabel, math.Inf(+1),
0, metric.Histogram.GetSampleCount(), true,
nil,
@@ -258,7 +361,7 @@ func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily) (written int
}
}
n, err = writeOpenMetricsSample(
- w, name, "_sum", metric, "", 0,
+ w, compliantName, "_sum", metric, "", 0,
metric.Histogram.GetSampleSum(), 0, false,
nil,
)
@@ -267,13 +370,17 @@ func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily) (written int
return
}
n, err = writeOpenMetricsSample(
- w, name, "_count", metric, "", 0,
+ w, compliantName, "_count", metric, "", 0,
0, metric.Histogram.GetSampleCount(), true,
nil,
)
+ if toOM.withCreatedLines && metric.Histogram.CreatedTimestamp != nil {
+ createdTsBytesWritten, err = writeOpenMetricsCreated(w, compliantName, "", metric, "", 0, metric.Histogram.GetCreatedTimestamp())
+ n += createdTsBytesWritten
+ }
default:
return written, fmt.Errorf(
- "unexpected type in metric %s %s", name, metric,
+ "unexpected type in metric %s %s", compliantName, metric,
)
}
written += n
@@ -303,21 +410,9 @@ func writeOpenMetricsSample(
floatValue float64, intValue uint64, useIntValue bool,
exemplar *dto.Exemplar,
) (int, error) {
- var written int
- n, err := w.WriteString(name)
- written += n
- if err != nil {
- return written, err
- }
- if suffix != "" {
- n, err = w.WriteString(suffix)
- written += n
- if err != nil {
- return written, err
- }
- }
- n, err = writeOpenMetricsLabelPairs(
- w, metric.Label, additionalLabelName, additionalLabelValue,
+ written := 0
+ n, err := writeOpenMetricsNameAndLabelPairs(
+ w, name+suffix, metric.Label, additionalLabelName, additionalLabelValue,
)
written += n
if err != nil {
@@ -350,7 +445,7 @@ func writeOpenMetricsSample(
return written, err
}
}
- if exemplar != nil {
+ if exemplar != nil && len(exemplar.Label) > 0 {
n, err = writeExemplar(w, exemplar)
written += n
if err != nil {
@@ -365,27 +460,58 @@ func writeOpenMetricsSample(
return written, nil
}
-// writeOpenMetricsLabelPairs works like writeOpenMetrics but formats the float
-// in OpenMetrics style.
-func writeOpenMetricsLabelPairs(
+// writeOpenMetricsNameAndLabelPairs works like writeOpenMetricsSample but
+// formats the float in OpenMetrics style.
+func writeOpenMetricsNameAndLabelPairs(
w enhancedWriter,
+ name string,
in []*dto.LabelPair,
additionalLabelName string, additionalLabelValue float64,
) (int, error) {
- if len(in) == 0 && additionalLabelName == "" {
- return 0, nil
- }
var (
- written int
- separator byte = '{'
+ written int
+ separator byte = '{'
+ metricInsideBraces = false
)
+
+ if name != "" {
+ // If the name does not pass the legacy validity check, we must put the
+ // metric name inside the braces, quoted.
+ if !model.IsValidLegacyMetricName(name) {
+ metricInsideBraces = true
+ err := w.WriteByte(separator)
+ written++
+ if err != nil {
+ return written, err
+ }
+ separator = ','
+ }
+
+ n, err := writeName(w, name)
+ written += n
+ if err != nil {
+ return written, err
+ }
+ }
+
+ if len(in) == 0 && additionalLabelName == "" {
+ if metricInsideBraces {
+ err := w.WriteByte('}')
+ written++
+ if err != nil {
+ return written, err
+ }
+ }
+ return written, nil
+ }
+
for _, lp := range in {
err := w.WriteByte(separator)
written++
if err != nil {
return written, err
}
- n, err := w.WriteString(lp.GetName())
+ n, err := writeName(w, lp.GetName())
written += n
if err != nil {
return written, err
@@ -442,6 +568,49 @@ func writeOpenMetricsLabelPairs(
return written, nil
}
+// writeOpenMetricsCreated writes the created timestamp for a single time series
+// following OpenMetrics text format to w, given the metric name, the metric proto
+// message itself, optionally a suffix to be removed, e.g. '_total' for counters,
+// an additional label name with a float64 value (use empty string as label name if
+// not required) and the timestamp that represents the created timestamp.
+// The function returns the number of bytes written and any error encountered.
+func writeOpenMetricsCreated(w enhancedWriter,
+ name, suffixToTrim string, metric *dto.Metric,
+ additionalLabelName string, additionalLabelValue float64,
+ createdTimestamp *timestamppb.Timestamp,
+) (int, error) {
+ written := 0
+ n, err := writeOpenMetricsNameAndLabelPairs(
+ w, strings.TrimSuffix(name, suffixToTrim)+"_created", metric.Label, additionalLabelName, additionalLabelValue,
+ )
+ written += n
+ if err != nil {
+ return written, err
+ }
+
+ err = w.WriteByte(' ')
+ written++
+ if err != nil {
+ return written, err
+ }
+
+ // TODO(beorn7): Format this directly from components of ts to
+ // avoid overflow/underflow and precision issues of the float
+ // conversion.
+ n, err = writeOpenMetricsFloat(w, float64(createdTimestamp.AsTime().UnixNano())/1e9)
+ written += n
+ if err != nil {
+ return written, err
+ }
+
+ err = w.WriteByte('\n')
+ written++
+ if err != nil {
+ return written, err
+ }
+ return written, nil
+}
+
// writeExemplar writes the provided exemplar in OpenMetrics format to w. The
// function returns the number of bytes written and any error encountered.
func writeExemplar(w enhancedWriter, e *dto.Exemplar) (int, error) {
@@ -451,7 +620,7 @@ func writeExemplar(w enhancedWriter, e *dto.Exemplar) (int, error) {
if err != nil {
return written, err
}
- n, err = writeOpenMetricsLabelPairs(w, e.Label, "", 0)
+ n, err = writeOpenMetricsNameAndLabelPairs(w, "", e.Label, "", 0)
written += n
if err != nil {
return written, err
diff --git a/vendor/github.com/prometheus/common/expfmt/text_create.go b/vendor/github.com/prometheus/common/expfmt/text_create.go
index 2946b8f1..4b86434b 100644
--- a/vendor/github.com/prometheus/common/expfmt/text_create.go
+++ b/vendor/github.com/prometheus/common/expfmt/text_create.go
@@ -62,6 +62,18 @@ var (
// contains duplicate metrics or invalid metric or label names, the conversion
// will result in invalid text format output.
//
+// If metric names conform to the legacy validation pattern, they will be placed
+// outside the brackets in the traditional way, like `foo{}`. If the metric name
+// fails the legacy validation check, it will be placed quoted inside the
+// brackets: `{"foo"}`. As stated above, the input is assumed to be santized and
+// no error will be thrown in this case.
+//
+// Similar to metric names, if label names conform to the legacy validation
+// pattern, they will be unquoted as normal, like `foo{bar="baz"}`. If the label
+// name fails the legacy validation check, it will be quoted:
+// `foo{"bar"="baz"}`. As stated above, the input is assumed to be santized and
+// no error will be thrown in this case.
+//
// This method fulfills the type 'prometheus.encoder'.
func MetricFamilyToText(out io.Writer, in *dto.MetricFamily) (written int, err error) {
// Fail-fast checks.
@@ -98,7 +110,7 @@ func MetricFamilyToText(out io.Writer, in *dto.MetricFamily) (written int, err e
if err != nil {
return
}
- n, err = w.WriteString(name)
+ n, err = writeName(w, name)
written += n
if err != nil {
return
@@ -124,7 +136,7 @@ func MetricFamilyToText(out io.Writer, in *dto.MetricFamily) (written int, err e
if err != nil {
return
}
- n, err = w.WriteString(name)
+ n, err = writeName(w, name)
written += n
if err != nil {
return
@@ -280,21 +292,9 @@ func writeSample(
additionalLabelName string, additionalLabelValue float64,
value float64,
) (int, error) {
- var written int
- n, err := w.WriteString(name)
- written += n
- if err != nil {
- return written, err
- }
- if suffix != "" {
- n, err = w.WriteString(suffix)
- written += n
- if err != nil {
- return written, err
- }
- }
- n, err = writeLabelPairs(
- w, metric.Label, additionalLabelName, additionalLabelValue,
+ written := 0
+ n, err := writeNameAndLabelPairs(
+ w, name+suffix, metric.Label, additionalLabelName, additionalLabelValue,
)
written += n
if err != nil {
@@ -330,32 +330,64 @@ func writeSample(
return written, nil
}
-// writeLabelPairs converts a slice of LabelPair proto messages plus the
-// explicitly given additional label pair into text formatted as required by the
-// text format and writes it to 'w'. An empty slice in combination with an empty
-// string 'additionalLabelName' results in nothing being written. Otherwise, the
-// label pairs are written, escaped as required by the text format, and enclosed
-// in '{...}'. The function returns the number of bytes written and any error
-// encountered.
-func writeLabelPairs(
+// writeNameAndLabelPairs converts a slice of LabelPair proto messages plus the
+// explicitly given metric name and additional label pair into text formatted as
+// required by the text format and writes it to 'w'. An empty slice in
+// combination with an empty string 'additionalLabelName' results in nothing
+// being written. Otherwise, the label pairs are written, escaped as required by
+// the text format, and enclosed in '{...}'. The function returns the number of
+// bytes written and any error encountered. If the metric name is not
+// legacy-valid, it will be put inside the brackets as well. Legacy-invalid
+// label names will also be quoted.
+func writeNameAndLabelPairs(
w enhancedWriter,
+ name string,
in []*dto.LabelPair,
additionalLabelName string, additionalLabelValue float64,
) (int, error) {
- if len(in) == 0 && additionalLabelName == "" {
- return 0, nil
- }
var (
- written int
- separator byte = '{'
+ written int
+ separator byte = '{'
+ metricInsideBraces = false
)
+
+ if name != "" {
+ // If the name does not pass the legacy validity check, we must put the
+ // metric name inside the braces.
+ if !model.IsValidLegacyMetricName(name) {
+ metricInsideBraces = true
+ err := w.WriteByte(separator)
+ written++
+ if err != nil {
+ return written, err
+ }
+ separator = ','
+ }
+ n, err := writeName(w, name)
+ written += n
+ if err != nil {
+ return written, err
+ }
+ }
+
+ if len(in) == 0 && additionalLabelName == "" {
+ if metricInsideBraces {
+ err := w.WriteByte('}')
+ written++
+ if err != nil {
+ return written, err
+ }
+ }
+ return written, nil
+ }
+
for _, lp := range in {
err := w.WriteByte(separator)
written++
if err != nil {
return written, err
}
- n, err := w.WriteString(lp.GetName())
+ n, err := writeName(w, lp.GetName())
written += n
if err != nil {
return written, err
@@ -462,3 +494,27 @@ func writeInt(w enhancedWriter, i int64) (int, error) {
numBufPool.Put(bp)
return written, err
}
+
+// writeName writes a string as-is if it complies with the legacy naming
+// scheme, or escapes it in double quotes if not.
+func writeName(w enhancedWriter, name string) (int, error) {
+ if model.IsValidLegacyMetricName(name) {
+ return w.WriteString(name)
+ }
+ var written int
+ var err error
+ err = w.WriteByte('"')
+ written++
+ if err != nil {
+ return written, err
+ }
+ var n int
+ n, err = writeEscapedString(w, name, true)
+ written += n
+ if err != nil {
+ return written, err
+ }
+ err = w.WriteByte('"')
+ written++
+ return written, err
+}
diff --git a/vendor/github.com/prometheus/common/expfmt/text_parse.go b/vendor/github.com/prometheus/common/expfmt/text_parse.go
index 26490211..f085a923 100644
--- a/vendor/github.com/prometheus/common/expfmt/text_parse.go
+++ b/vendor/github.com/prometheus/common/expfmt/text_parse.go
@@ -22,9 +22,9 @@ import (
"math"
"strconv"
"strings"
+ "unicode/utf8"
dto "github.com/prometheus/client_model/go"
-
"google.golang.org/protobuf/proto"
"github.com/prometheus/common/model"
@@ -60,6 +60,7 @@ type TextParser struct {
currentMF *dto.MetricFamily
currentMetric *dto.Metric
currentLabelPair *dto.LabelPair
+ currentLabelPairs []*dto.LabelPair // Temporarily stores label pairs while parsing a metric line.
// The remaining member variables are only used for summaries/histograms.
currentLabels map[string]string // All labels including '__name__' but excluding 'quantile'/'le'
@@ -74,6 +75,9 @@ type TextParser struct {
// count and sum of that summary/histogram.
currentIsSummaryCount, currentIsSummarySum bool
currentIsHistogramCount, currentIsHistogramSum bool
+ // These indicate if the metric name from the current line being parsed is inside
+ // braces and if that metric name was found respectively.
+ currentMetricIsInsideBraces, currentMetricInsideBracesIsPresent bool
}
// TextToMetricFamilies reads 'in' as the simple and flat text-based exchange
@@ -137,12 +141,15 @@ func (p *TextParser) reset(in io.Reader) {
}
p.currentQuantile = math.NaN()
p.currentBucket = math.NaN()
+ p.currentMF = nil
}
// startOfLine represents the state where the next byte read from p.buf is the
// start of a line (or whitespace leading up to it).
func (p *TextParser) startOfLine() stateFn {
p.lineCount++
+ p.currentMetricIsInsideBraces = false
+ p.currentMetricInsideBracesIsPresent = false
if p.skipBlankTab(); p.err != nil {
// This is the only place that we expect to see io.EOF,
// which is not an error but the signal that we are done.
@@ -158,6 +165,9 @@ func (p *TextParser) startOfLine() stateFn {
return p.startComment
case '\n':
return p.startOfLine // Empty line, start the next one.
+ case '{':
+ p.currentMetricIsInsideBraces = true
+ return p.readingLabels
}
return p.readingMetricName
}
@@ -275,6 +285,8 @@ func (p *TextParser) startLabelName() stateFn {
return nil // Unexpected end of input.
}
if p.currentByte == '}' {
+ p.currentMetric.Label = append(p.currentMetric.Label, p.currentLabelPairs...)
+ p.currentLabelPairs = nil
if p.skipBlankTab(); p.err != nil {
return nil // Unexpected end of input.
}
@@ -287,6 +299,45 @@ func (p *TextParser) startLabelName() stateFn {
p.parseError(fmt.Sprintf("invalid label name for metric %q", p.currentMF.GetName()))
return nil
}
+ if p.skipBlankTabIfCurrentBlankTab(); p.err != nil {
+ return nil // Unexpected end of input.
+ }
+ if p.currentByte != '=' {
+ if p.currentMetricIsInsideBraces {
+ if p.currentMetricInsideBracesIsPresent {
+ p.parseError(fmt.Sprintf("multiple metric names for metric %q", p.currentMF.GetName()))
+ return nil
+ }
+ switch p.currentByte {
+ case ',':
+ p.setOrCreateCurrentMF()
+ if p.currentMF.Type == nil {
+ p.currentMF.Type = dto.MetricType_UNTYPED.Enum()
+ }
+ p.currentMetric = &dto.Metric{}
+ p.currentMetricInsideBracesIsPresent = true
+ return p.startLabelName
+ case '}':
+ p.setOrCreateCurrentMF()
+ if p.currentMF.Type == nil {
+ p.currentMF.Type = dto.MetricType_UNTYPED.Enum()
+ }
+ p.currentMetric = &dto.Metric{}
+ p.currentMetric.Label = append(p.currentMetric.Label, p.currentLabelPairs...)
+ p.currentLabelPairs = nil
+ if p.skipBlankTab(); p.err != nil {
+ return nil // Unexpected end of input.
+ }
+ return p.readingValue
+ default:
+ p.parseError(fmt.Sprintf("unexpected end of metric name %q", p.currentByte))
+ return nil
+ }
+ }
+ p.parseError(fmt.Sprintf("expected '=' after label name, found %q", p.currentByte))
+ p.currentLabelPairs = nil
+ return nil
+ }
p.currentLabelPair = &dto.LabelPair{Name: proto.String(p.currentToken.String())}
if p.currentLabelPair.GetName() == string(model.MetricNameLabel) {
p.parseError(fmt.Sprintf("label name %q is reserved", model.MetricNameLabel))
@@ -296,23 +347,17 @@ func (p *TextParser) startLabelName() stateFn {
// labels to 'real' labels.
if !(p.currentMF.GetType() == dto.MetricType_SUMMARY && p.currentLabelPair.GetName() == model.QuantileLabel) &&
!(p.currentMF.GetType() == dto.MetricType_HISTOGRAM && p.currentLabelPair.GetName() == model.BucketLabel) {
- p.currentMetric.Label = append(p.currentMetric.Label, p.currentLabelPair)
- }
- if p.skipBlankTabIfCurrentBlankTab(); p.err != nil {
- return nil // Unexpected end of input.
- }
- if p.currentByte != '=' {
- p.parseError(fmt.Sprintf("expected '=' after label name, found %q", p.currentByte))
- return nil
+ p.currentLabelPairs = append(p.currentLabelPairs, p.currentLabelPair)
}
// Check for duplicate label names.
labels := make(map[string]struct{})
- for _, l := range p.currentMetric.Label {
+ for _, l := range p.currentLabelPairs {
lName := l.GetName()
if _, exists := labels[lName]; !exists {
labels[lName] = struct{}{}
} else {
p.parseError(fmt.Sprintf("duplicate label names for metric %q", p.currentMF.GetName()))
+ p.currentLabelPairs = nil
return nil
}
}
@@ -345,6 +390,7 @@ func (p *TextParser) startLabelValue() stateFn {
if p.currentQuantile, p.err = parseFloat(p.currentLabelPair.GetValue()); p.err != nil {
// Create a more helpful error message.
p.parseError(fmt.Sprintf("expected float as value for 'quantile' label, got %q", p.currentLabelPair.GetValue()))
+ p.currentLabelPairs = nil
return nil
}
} else {
@@ -371,12 +417,19 @@ func (p *TextParser) startLabelValue() stateFn {
return p.startLabelName
case '}':
+ if p.currentMF == nil {
+ p.parseError("invalid metric name")
+ return nil
+ }
+ p.currentMetric.Label = append(p.currentMetric.Label, p.currentLabelPairs...)
+ p.currentLabelPairs = nil
if p.skipBlankTab(); p.err != nil {
return nil // Unexpected end of input.
}
return p.readingValue
default:
p.parseError(fmt.Sprintf("unexpected end of label value %q", p.currentLabelPair.GetValue()))
+ p.currentLabelPairs = nil
return nil
}
}
@@ -585,6 +638,8 @@ func (p *TextParser) readTokenUntilNewline(recognizeEscapeSequence bool) {
p.currentToken.WriteByte(p.currentByte)
case 'n':
p.currentToken.WriteByte('\n')
+ case '"':
+ p.currentToken.WriteByte('"')
default:
p.parseError(fmt.Sprintf("invalid escape sequence '\\%c'", p.currentByte))
return
@@ -610,13 +665,45 @@ func (p *TextParser) readTokenUntilNewline(recognizeEscapeSequence bool) {
// but not into p.currentToken.
func (p *TextParser) readTokenAsMetricName() {
p.currentToken.Reset()
+ // A UTF-8 metric name must be quoted and may have escaped characters.
+ quoted := false
+ escaped := false
if !isValidMetricNameStart(p.currentByte) {
return
}
- for {
- p.currentToken.WriteByte(p.currentByte)
+ for p.err == nil {
+ if escaped {
+ switch p.currentByte {
+ case '\\':
+ p.currentToken.WriteByte(p.currentByte)
+ case 'n':
+ p.currentToken.WriteByte('\n')
+ case '"':
+ p.currentToken.WriteByte('"')
+ default:
+ p.parseError(fmt.Sprintf("invalid escape sequence '\\%c'", p.currentByte))
+ return
+ }
+ escaped = false
+ } else {
+ switch p.currentByte {
+ case '"':
+ quoted = !quoted
+ if !quoted {
+ p.currentByte, p.err = p.buf.ReadByte()
+ return
+ }
+ case '\n':
+ p.parseError(fmt.Sprintf("metric name %q contains unescaped new-line", p.currentToken.String()))
+ return
+ case '\\':
+ escaped = true
+ default:
+ p.currentToken.WriteByte(p.currentByte)
+ }
+ }
p.currentByte, p.err = p.buf.ReadByte()
- if p.err != nil || !isValidMetricNameContinuation(p.currentByte) {
+ if !isValidMetricNameContinuation(p.currentByte, quoted) || (!quoted && p.currentByte == ' ') {
return
}
}
@@ -628,13 +715,45 @@ func (p *TextParser) readTokenAsMetricName() {
// but not into p.currentToken.
func (p *TextParser) readTokenAsLabelName() {
p.currentToken.Reset()
+ // A UTF-8 label name must be quoted and may have escaped characters.
+ quoted := false
+ escaped := false
if !isValidLabelNameStart(p.currentByte) {
return
}
- for {
- p.currentToken.WriteByte(p.currentByte)
+ for p.err == nil {
+ if escaped {
+ switch p.currentByte {
+ case '\\':
+ p.currentToken.WriteByte(p.currentByte)
+ case 'n':
+ p.currentToken.WriteByte('\n')
+ case '"':
+ p.currentToken.WriteByte('"')
+ default:
+ p.parseError(fmt.Sprintf("invalid escape sequence '\\%c'", p.currentByte))
+ return
+ }
+ escaped = false
+ } else {
+ switch p.currentByte {
+ case '"':
+ quoted = !quoted
+ if !quoted {
+ p.currentByte, p.err = p.buf.ReadByte()
+ return
+ }
+ case '\n':
+ p.parseError(fmt.Sprintf("label name %q contains unescaped new-line", p.currentToken.String()))
+ return
+ case '\\':
+ escaped = true
+ default:
+ p.currentToken.WriteByte(p.currentByte)
+ }
+ }
p.currentByte, p.err = p.buf.ReadByte()
- if p.err != nil || !isValidLabelNameContinuation(p.currentByte) {
+ if !isValidLabelNameContinuation(p.currentByte, quoted) || (!quoted && p.currentByte == '=') {
return
}
}
@@ -660,6 +779,7 @@ func (p *TextParser) readTokenAsLabelValue() {
p.currentToken.WriteByte('\n')
default:
p.parseError(fmt.Sprintf("invalid escape sequence '\\%c'", p.currentByte))
+ p.currentLabelPairs = nil
return
}
escaped = false
@@ -718,19 +838,19 @@ func (p *TextParser) setOrCreateCurrentMF() {
}
func isValidLabelNameStart(b byte) bool {
- return (b >= 'a' && b <= 'z') || (b >= 'A' && b <= 'Z') || b == '_'
+ return (b >= 'a' && b <= 'z') || (b >= 'A' && b <= 'Z') || b == '_' || b == '"'
}
-func isValidLabelNameContinuation(b byte) bool {
- return isValidLabelNameStart(b) || (b >= '0' && b <= '9')
+func isValidLabelNameContinuation(b byte, quoted bool) bool {
+ return isValidLabelNameStart(b) || (b >= '0' && b <= '9') || (quoted && utf8.ValidString(string(b)))
}
func isValidMetricNameStart(b byte) bool {
return isValidLabelNameStart(b) || b == ':'
}
-func isValidMetricNameContinuation(b byte) bool {
- return isValidLabelNameContinuation(b) || b == ':'
+func isValidMetricNameContinuation(b byte, quoted bool) bool {
+ return isValidLabelNameContinuation(b, quoted) || b == ':'
}
func isBlankOrTab(b byte) bool {
diff --git a/vendor/github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg/README.txt b/vendor/github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg/README.txt
deleted file mode 100644
index 7723656d..00000000
--- a/vendor/github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg/README.txt
+++ /dev/null
@@ -1,67 +0,0 @@
-PACKAGE
-
-package goautoneg
-import "bitbucket.org/ww/goautoneg"
-
-HTTP Content-Type Autonegotiation.
-
-The functions in this package implement the behaviour specified in
-http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
-
-Copyright (c) 2011, Open Knowledge Foundation Ltd.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
- Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in
- the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Open Knowledge Foundation Ltd. nor the
- names of its contributors may be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-FUNCTIONS
-
-func Negotiate(header string, alternatives []string) (content_type string)
-Negotiate the most appropriate content_type given the accept header
-and a list of alternatives.
-
-func ParseAccept(header string) (accept []Accept)
-Parse an Accept Header string returning a sorted list
-of clauses
-
-
-TYPES
-
-type Accept struct {
- Type, SubType string
- Q float32
- Params map[string]string
-}
-Structure to represent a clause in an HTTP Accept Header
-
-
-SUBDIRECTORIES
-
- .hg
diff --git a/vendor/github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg/autoneg.go b/vendor/github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg/autoneg.go
deleted file mode 100644
index a21b9d15..00000000
--- a/vendor/github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg/autoneg.go
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
-Copyright (c) 2011, Open Knowledge Foundation Ltd.
-All rights reserved.
-
-HTTP Content-Type Autonegotiation.
-
-The functions in this package implement the behaviour specified in
-http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
- Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in
- the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Open Knowledge Foundation Ltd. nor the
- names of its contributors may be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-package goautoneg
-
-import (
- "sort"
- "strconv"
- "strings"
-)
-
-// Structure to represent a clause in an HTTP Accept Header
-type Accept struct {
- Type, SubType string
- Q float64
- Params map[string]string
-}
-
-// For internal use, so that we can use the sort interface
-type accept_slice []Accept
-
-func (accept accept_slice) Len() int {
- slice := []Accept(accept)
- return len(slice)
-}
-
-func (accept accept_slice) Less(i, j int) bool {
- slice := []Accept(accept)
- ai, aj := slice[i], slice[j]
- if ai.Q > aj.Q {
- return true
- }
- if ai.Type != "*" && aj.Type == "*" {
- return true
- }
- if ai.SubType != "*" && aj.SubType == "*" {
- return true
- }
- return false
-}
-
-func (accept accept_slice) Swap(i, j int) {
- slice := []Accept(accept)
- slice[i], slice[j] = slice[j], slice[i]
-}
-
-// Parse an Accept Header string returning a sorted list
-// of clauses
-func ParseAccept(header string) (accept []Accept) {
- parts := strings.Split(header, ",")
- accept = make([]Accept, 0, len(parts))
- for _, part := range parts {
- part := strings.Trim(part, " ")
-
- a := Accept{}
- a.Params = make(map[string]string)
- a.Q = 1.0
-
- mrp := strings.Split(part, ";")
-
- media_range := mrp[0]
- sp := strings.Split(media_range, "/")
- a.Type = strings.Trim(sp[0], " ")
-
- switch {
- case len(sp) == 1 && a.Type == "*":
- a.SubType = "*"
- case len(sp) == 2:
- a.SubType = strings.Trim(sp[1], " ")
- default:
- continue
- }
-
- if len(mrp) == 1 {
- accept = append(accept, a)
- continue
- }
-
- for _, param := range mrp[1:] {
- sp := strings.SplitN(param, "=", 2)
- if len(sp) != 2 {
- continue
- }
- token := strings.Trim(sp[0], " ")
- if token == "q" {
- a.Q, _ = strconv.ParseFloat(sp[1], 32)
- } else {
- a.Params[token] = strings.Trim(sp[1], " ")
- }
- }
-
- accept = append(accept, a)
- }
-
- slice := accept_slice(accept)
- sort.Sort(slice)
-
- return
-}
-
-// Negotiate the most appropriate content_type given the accept header
-// and a list of alternatives.
-func Negotiate(header string, alternatives []string) (content_type string) {
- asp := make([][]string, 0, len(alternatives))
- for _, ctype := range alternatives {
- asp = append(asp, strings.SplitN(ctype, "/", 2))
- }
- for _, clause := range ParseAccept(header) {
- for i, ctsp := range asp {
- if clause.Type == ctsp[0] && clause.SubType == ctsp[1] {
- content_type = alternatives[i]
- return
- }
- if clause.Type == ctsp[0] && clause.SubType == "*" {
- content_type = alternatives[i]
- return
- }
- if clause.Type == "*" && clause.SubType == "*" {
- content_type = alternatives[i]
- return
- }
- }
- }
- return
-}
diff --git a/vendor/github.com/prometheus/common/model/alert.go b/vendor/github.com/prometheus/common/model/alert.go
index 178fdbaf..80d1fe94 100644
--- a/vendor/github.com/prometheus/common/model/alert.go
+++ b/vendor/github.com/prometheus/common/model/alert.go
@@ -75,7 +75,12 @@ func (a *Alert) ResolvedAt(ts time.Time) bool {
// Status returns the status of the alert.
func (a *Alert) Status() AlertStatus {
- if a.Resolved() {
+ return a.StatusAt(time.Now())
+}
+
+// StatusAt returns the status of the alert at the given timestamp.
+func (a *Alert) StatusAt(ts time.Time) AlertStatus {
+ if a.ResolvedAt(ts) {
return AlertResolved
}
return AlertFiring
@@ -127,6 +132,17 @@ func (as Alerts) HasFiring() bool {
return false
}
+// HasFiringAt returns true iff one of the alerts is not resolved
+// at the time ts.
+func (as Alerts) HasFiringAt(ts time.Time) bool {
+ for _, a := range as {
+ if !a.ResolvedAt(ts) {
+ return true
+ }
+ }
+ return false
+}
+
// Status returns StatusFiring iff at least one of the alerts is firing.
func (as Alerts) Status() AlertStatus {
if as.HasFiring() {
@@ -134,3 +150,12 @@ func (as Alerts) Status() AlertStatus {
}
return AlertResolved
}
+
+// StatusAt returns StatusFiring iff at least one of the alerts is firing
+// at the time ts.
+func (as Alerts) StatusAt(ts time.Time) AlertStatus {
+ if as.HasFiringAt(ts) {
+ return AlertFiring
+ }
+ return AlertResolved
+}
diff --git a/vendor/github.com/prometheus/common/model/labels.go b/vendor/github.com/prometheus/common/model/labels.go
index ef895633..73b7aa3e 100644
--- a/vendor/github.com/prometheus/common/model/labels.go
+++ b/vendor/github.com/prometheus/common/model/labels.go
@@ -97,10 +97,27 @@ var LabelNameRE = regexp.MustCompile("^[a-zA-Z_][a-zA-Z0-9_]*$")
// therewith.
type LabelName string
-// IsValid is true iff the label name matches the pattern of LabelNameRE. This
-// method, however, does not use LabelNameRE for the check but a much faster
-// hardcoded implementation.
+// IsValid returns true iff the name matches the pattern of LabelNameRE when
+// NameValidationScheme is set to LegacyValidation, or valid UTF-8 if
+// NameValidationScheme is set to UTF8Validation.
func (ln LabelName) IsValid() bool {
+ if len(ln) == 0 {
+ return false
+ }
+ switch NameValidationScheme {
+ case LegacyValidation:
+ return ln.IsValidLegacy()
+ case UTF8Validation:
+ return utf8.ValidString(string(ln))
+ default:
+ panic(fmt.Sprintf("Invalid name validation scheme requested: %d", NameValidationScheme))
+ }
+}
+
+// IsValidLegacy returns true iff name matches the pattern of LabelNameRE for
+// legacy names. It does not use LabelNameRE for the check but a much faster
+// hardcoded implementation.
+func (ln LabelName) IsValidLegacy() bool {
if len(ln) == 0 {
return false
}
@@ -164,7 +181,7 @@ func (l LabelNames) String() string {
// A LabelValue is an associated value for a LabelName.
type LabelValue string
-// IsValid returns true iff the string is a valid UTF8.
+// IsValid returns true iff the string is a valid UTF-8.
func (lv LabelValue) IsValid() bool {
return utf8.ValidString(string(lv))
}
diff --git a/vendor/github.com/prometheus/common/model/labelset.go b/vendor/github.com/prometheus/common/model/labelset.go
index 6eda08a7..d0ad88da 100644
--- a/vendor/github.com/prometheus/common/model/labelset.go
+++ b/vendor/github.com/prometheus/common/model/labelset.go
@@ -17,7 +17,6 @@ import (
"encoding/json"
"fmt"
"sort"
- "strings"
)
// A LabelSet is a collection of LabelName and LabelValue pairs. The LabelSet
@@ -129,16 +128,6 @@ func (l LabelSet) Merge(other LabelSet) LabelSet {
return result
}
-func (l LabelSet) String() string {
- lstrs := make([]string, 0, len(l))
- for l, v := range l {
- lstrs = append(lstrs, fmt.Sprintf("%s=%q", l, v))
- }
-
- sort.Strings(lstrs)
- return fmt.Sprintf("{%s}", strings.Join(lstrs, ", "))
-}
-
// Fingerprint returns the LabelSet's fingerprint.
func (ls LabelSet) Fingerprint() Fingerprint {
return labelSetToFingerprint(ls)
diff --git a/vendor/github.com/prometheus/common/model/labelset_string.go b/vendor/github.com/prometheus/common/model/labelset_string.go
new file mode 100644
index 00000000..abb2c900
--- /dev/null
+++ b/vendor/github.com/prometheus/common/model/labelset_string.go
@@ -0,0 +1,43 @@
+// Copyright 2024 The Prometheus 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 model
+
+import (
+ "bytes"
+ "slices"
+ "strconv"
+)
+
+// String will look like `{foo="bar", more="less"}`. Names are sorted alphabetically.
+func (l LabelSet) String() string {
+ var lna [32]string // On stack to avoid memory allocation for sorting names.
+ labelNames := lna[:0]
+ for name := range l {
+ labelNames = append(labelNames, string(name))
+ }
+ slices.Sort(labelNames)
+ var bytea [1024]byte // On stack to avoid memory allocation while building the output.
+ b := bytes.NewBuffer(bytea[:0])
+ b.WriteByte('{')
+ for i, name := range labelNames {
+ if i > 0 {
+ b.WriteString(", ")
+ }
+ b.WriteString(name)
+ b.WriteByte('=')
+ b.Write(strconv.AppendQuote(b.AvailableBuffer(), string(l[LabelName(name)])))
+ }
+ b.WriteByte('}')
+ return b.String()
+}
diff --git a/vendor/github.com/prometheus/common/model/metric.go b/vendor/github.com/prometheus/common/model/metric.go
index f8c5eaba..f50966bc 100644
--- a/vendor/github.com/prometheus/common/model/metric.go
+++ b/vendor/github.com/prometheus/common/model/metric.go
@@ -18,6 +18,80 @@ import (
"regexp"
"sort"
"strings"
+ "unicode/utf8"
+
+ dto "github.com/prometheus/client_model/go"
+ "google.golang.org/protobuf/proto"
+)
+
+var (
+ // NameValidationScheme determines the method of name validation to be used by
+ // all calls to IsValidMetricName() and LabelName IsValid(). Setting UTF-8 mode
+ // in isolation from other components that don't support UTF-8 may result in
+ // bugs or other undefined behavior. This value is intended to be set by
+ // UTF-8-aware binaries as part of their startup. To avoid need for locking,
+ // this value should be set once, ideally in an init(), before multiple
+ // goroutines are started.
+ NameValidationScheme = LegacyValidation
+
+ // NameEscapingScheme defines the default way that names will be escaped when
+ // presented to systems that do not support UTF-8 names. If the Content-Type
+ // "escaping" term is specified, that will override this value.
+ // NameEscapingScheme should not be set to the NoEscaping value. That string
+ // is used in content negotiation to indicate that a system supports UTF-8 and
+ // has that feature enabled.
+ NameEscapingScheme = UnderscoreEscaping
+)
+
+// ValidationScheme is a Go enum for determining how metric and label names will
+// be validated by this library.
+type ValidationScheme int
+
+const (
+ // LegacyValidation is a setting that requirets that metric and label names
+ // conform to the original Prometheus character requirements described by
+ // MetricNameRE and LabelNameRE.
+ LegacyValidation ValidationScheme = iota
+
+ // UTF8Validation only requires that metric and label names be valid UTF-8
+ // strings.
+ UTF8Validation
+)
+
+type EscapingScheme int
+
+const (
+ // NoEscaping indicates that a name will not be escaped. Unescaped names that
+ // do not conform to the legacy validity check will use a new exposition
+ // format syntax that will be officially standardized in future versions.
+ NoEscaping EscapingScheme = iota
+
+ // UnderscoreEscaping replaces all legacy-invalid characters with underscores.
+ UnderscoreEscaping
+
+ // DotsEscaping is similar to UnderscoreEscaping, except that dots are
+ // converted to `_dot_` and pre-existing underscores are converted to `__`.
+ DotsEscaping
+
+ // ValueEncodingEscaping prepends the name with `U__` and replaces all invalid
+ // characters with the unicode value, surrounded by underscores. Single
+ // underscores are replaced with double underscores.
+ ValueEncodingEscaping
+)
+
+const (
+ // EscapingKey is the key in an Accept or Content-Type header that defines how
+ // metric and label names that do not conform to the legacy character
+ // requirements should be escaped when being scraped by a legacy prometheus
+ // system. If a system does not explicitly pass an escaping parameter in the
+ // Accept header, the default NameEscapingScheme will be used.
+ EscapingKey = "escaping"
+
+ // Possible values for Escaping Key:
+ AllowUTF8 = "allow-utf-8" // No escaping required.
+ EscapeUnderscores = "underscores"
+ EscapeDots = "dots"
+ EscapeValues = "values"
)
// MetricNameRE is a regular expression matching valid metric
@@ -84,17 +158,303 @@ func (m Metric) FastFingerprint() Fingerprint {
return LabelSet(m).FastFingerprint()
}
-// IsValidMetricName returns true iff name matches the pattern of MetricNameRE.
+// IsValidMetricName returns true iff name matches the pattern of MetricNameRE
+// for legacy names, and iff it's valid UTF-8 if the UTF8Validation scheme is
+// selected.
+func IsValidMetricName(n LabelValue) bool {
+ switch NameValidationScheme {
+ case LegacyValidation:
+ return IsValidLegacyMetricName(string(n))
+ case UTF8Validation:
+ if len(n) == 0 {
+ return false
+ }
+ return utf8.ValidString(string(n))
+ default:
+ panic(fmt.Sprintf("Invalid name validation scheme requested: %d", NameValidationScheme))
+ }
+}
+
+// IsValidLegacyMetricName is similar to IsValidMetricName but always uses the
+// legacy validation scheme regardless of the value of NameValidationScheme.
// This function, however, does not use MetricNameRE for the check but a much
// faster hardcoded implementation.
-func IsValidMetricName(n LabelValue) bool {
+func IsValidLegacyMetricName(n string) bool {
if len(n) == 0 {
return false
}
for i, b := range n {
- if !((b >= 'a' && b <= 'z') || (b >= 'A' && b <= 'Z') || b == '_' || b == ':' || (b >= '0' && b <= '9' && i > 0)) {
+ if !isValidLegacyRune(b, i) {
return false
}
}
return true
}
+
+// EscapeMetricFamily escapes the given metric names and labels with the given
+// escaping scheme. Returns a new object that uses the same pointers to fields
+// when possible and creates new escaped versions so as not to mutate the
+// input.
+func EscapeMetricFamily(v *dto.MetricFamily, scheme EscapingScheme) *dto.MetricFamily {
+ if v == nil {
+ return nil
+ }
+
+ if scheme == NoEscaping {
+ return v
+ }
+
+ out := &dto.MetricFamily{
+ Help: v.Help,
+ Type: v.Type,
+ Unit: v.Unit,
+ }
+
+ // If the name is nil, copy as-is, don't try to escape.
+ if v.Name == nil || IsValidLegacyMetricName(v.GetName()) {
+ out.Name = v.Name
+ } else {
+ out.Name = proto.String(EscapeName(v.GetName(), scheme))
+ }
+ for _, m := range v.Metric {
+ if !metricNeedsEscaping(m) {
+ out.Metric = append(out.Metric, m)
+ continue
+ }
+
+ escaped := &dto.Metric{
+ Gauge: m.Gauge,
+ Counter: m.Counter,
+ Summary: m.Summary,
+ Untyped: m.Untyped,
+ Histogram: m.Histogram,
+ TimestampMs: m.TimestampMs,
+ }
+
+ for _, l := range m.Label {
+ if l.GetName() == MetricNameLabel {
+ if l.Value == nil || IsValidLegacyMetricName(l.GetValue()) {
+ escaped.Label = append(escaped.Label, l)
+ continue
+ }
+ escaped.Label = append(escaped.Label, &dto.LabelPair{
+ Name: proto.String(MetricNameLabel),
+ Value: proto.String(EscapeName(l.GetValue(), scheme)),
+ })
+ continue
+ }
+ if l.Name == nil || IsValidLegacyMetricName(l.GetName()) {
+ escaped.Label = append(escaped.Label, l)
+ continue
+ }
+ escaped.Label = append(escaped.Label, &dto.LabelPair{
+ Name: proto.String(EscapeName(l.GetName(), scheme)),
+ Value: l.Value,
+ })
+ }
+ out.Metric = append(out.Metric, escaped)
+ }
+ return out
+}
+
+func metricNeedsEscaping(m *dto.Metric) bool {
+ for _, l := range m.Label {
+ if l.GetName() == MetricNameLabel && !IsValidLegacyMetricName(l.GetValue()) {
+ return true
+ }
+ if !IsValidLegacyMetricName(l.GetName()) {
+ return true
+ }
+ }
+ return false
+}
+
+const (
+ lowerhex = "0123456789abcdef"
+)
+
+// EscapeName escapes the incoming name according to the provided escaping
+// scheme. Depending on the rules of escaping, this may cause no change in the
+// string that is returned. (Especially NoEscaping, which by definition is a
+// noop). This function does not do any validation of the name.
+func EscapeName(name string, scheme EscapingScheme) string {
+ if len(name) == 0 {
+ return name
+ }
+ var escaped strings.Builder
+ switch scheme {
+ case NoEscaping:
+ return name
+ case UnderscoreEscaping:
+ if IsValidLegacyMetricName(name) {
+ return name
+ }
+ for i, b := range name {
+ if isValidLegacyRune(b, i) {
+ escaped.WriteRune(b)
+ } else {
+ escaped.WriteRune('_')
+ }
+ }
+ return escaped.String()
+ case DotsEscaping:
+ // Do not early return for legacy valid names, we still escape underscores.
+ for i, b := range name {
+ if b == '_' {
+ escaped.WriteString("__")
+ } else if b == '.' {
+ escaped.WriteString("_dot_")
+ } else if isValidLegacyRune(b, i) {
+ escaped.WriteRune(b)
+ } else {
+ escaped.WriteRune('_')
+ }
+ }
+ return escaped.String()
+ case ValueEncodingEscaping:
+ if IsValidLegacyMetricName(name) {
+ return name
+ }
+ escaped.WriteString("U__")
+ for i, b := range name {
+ if isValidLegacyRune(b, i) {
+ escaped.WriteRune(b)
+ } else if !utf8.ValidRune(b) {
+ escaped.WriteString("_FFFD_")
+ } else if b < 0x100 {
+ escaped.WriteRune('_')
+ for s := 4; s >= 0; s -= 4 {
+ escaped.WriteByte(lowerhex[b>>uint(s)&0xF])
+ }
+ escaped.WriteRune('_')
+ } else if b < 0x10000 {
+ escaped.WriteRune('_')
+ for s := 12; s >= 0; s -= 4 {
+ escaped.WriteByte(lowerhex[b>>uint(s)&0xF])
+ }
+ escaped.WriteRune('_')
+ }
+ }
+ return escaped.String()
+ default:
+ panic(fmt.Sprintf("invalid escaping scheme %d", scheme))
+ }
+}
+
+// lower function taken from strconv.atoi
+func lower(c byte) byte {
+ return c | ('x' - 'X')
+}
+
+// UnescapeName unescapes the incoming name according to the provided escaping
+// scheme if possible. Some schemes are partially or totally non-roundtripable.
+// If any error is enountered, returns the original input.
+func UnescapeName(name string, scheme EscapingScheme) string {
+ if len(name) == 0 {
+ return name
+ }
+ switch scheme {
+ case NoEscaping:
+ return name
+ case UnderscoreEscaping:
+ // It is not possible to unescape from underscore replacement.
+ return name
+ case DotsEscaping:
+ name = strings.ReplaceAll(name, "_dot_", ".")
+ name = strings.ReplaceAll(name, "__", "_")
+ return name
+ case ValueEncodingEscaping:
+ escapedName, found := strings.CutPrefix(name, "U__")
+ if !found {
+ return name
+ }
+
+ var unescaped strings.Builder
+ TOP:
+ for i := 0; i < len(escapedName); i++ {
+ // All non-underscores are treated normally.
+ if escapedName[i] != '_' {
+ unescaped.WriteByte(escapedName[i])
+ continue
+ }
+ i++
+ if i >= len(escapedName) {
+ return name
+ }
+ // A double underscore is a single underscore.
+ if escapedName[i] == '_' {
+ unescaped.WriteByte('_')
+ continue
+ }
+ // We think we are in a UTF-8 code, process it.
+ var utf8Val uint
+ for j := 0; i < len(escapedName); j++ {
+ // This is too many characters for a utf8 value.
+ if j > 4 {
+ return name
+ }
+ // Found a closing underscore, convert to a rune, check validity, and append.
+ if escapedName[i] == '_' {
+ utf8Rune := rune(utf8Val)
+ if !utf8.ValidRune(utf8Rune) {
+ return name
+ }
+ unescaped.WriteRune(utf8Rune)
+ continue TOP
+ }
+ r := lower(escapedName[i])
+ utf8Val *= 16
+ if r >= '0' && r <= '9' {
+ utf8Val += uint(r) - '0'
+ } else if r >= 'a' && r <= 'f' {
+ utf8Val += uint(r) - 'a' + 10
+ } else {
+ return name
+ }
+ i++
+ }
+ // Didn't find closing underscore, invalid.
+ return name
+ }
+ return unescaped.String()
+ default:
+ panic(fmt.Sprintf("invalid escaping scheme %d", scheme))
+ }
+}
+
+func isValidLegacyRune(b rune, i int) bool {
+ return (b >= 'a' && b <= 'z') || (b >= 'A' && b <= 'Z') || b == '_' || b == ':' || (b >= '0' && b <= '9' && i > 0)
+}
+
+func (e EscapingScheme) String() string {
+ switch e {
+ case NoEscaping:
+ return AllowUTF8
+ case UnderscoreEscaping:
+ return EscapeUnderscores
+ case DotsEscaping:
+ return EscapeDots
+ case ValueEncodingEscaping:
+ return EscapeValues
+ default:
+ panic(fmt.Sprintf("unknown format scheme %d", e))
+ }
+}
+
+func ToEscapingScheme(s string) (EscapingScheme, error) {
+ if s == "" {
+ return NoEscaping, fmt.Errorf("got empty string instead of escaping scheme")
+ }
+ switch s {
+ case AllowUTF8:
+ return NoEscaping, nil
+ case EscapeUnderscores:
+ return UnderscoreEscaping, nil
+ case EscapeDots:
+ return DotsEscaping, nil
+ case EscapeValues:
+ return ValueEncodingEscaping, nil
+ default:
+ return NoEscaping, fmt.Errorf("unknown format scheme %s", s)
+ }
+}
diff --git a/vendor/github.com/prometheus/procfs/.golangci.yml b/vendor/github.com/prometheus/procfs/.golangci.yml
index c24864a9..126df9e6 100644
--- a/vendor/github.com/prometheus/procfs/.golangci.yml
+++ b/vendor/github.com/prometheus/procfs/.golangci.yml
@@ -1,9 +1,16 @@
---
linters:
enable:
+ - errcheck
- godot
+ - gosimple
+ - govet
+ - ineffassign
- misspell
- revive
+ - staticcheck
+ - testifylint
+ - unused
linter-settings:
godot:
diff --git a/vendor/github.com/prometheus/procfs/MAINTAINERS.md b/vendor/github.com/prometheus/procfs/MAINTAINERS.md
index 56ba67d3..e00f3b36 100644
--- a/vendor/github.com/prometheus/procfs/MAINTAINERS.md
+++ b/vendor/github.com/prometheus/procfs/MAINTAINERS.md
@@ -1,2 +1,3 @@
* Johannes 'fish' Ziemke @discordianfish
-* Paul Gier @pgier
+* Paul Gier @pgier
+* Ben Kochie @SuperQ
diff --git a/vendor/github.com/prometheus/procfs/Makefile.common b/vendor/github.com/prometheus/procfs/Makefile.common
index 062a2818..16172923 100644
--- a/vendor/github.com/prometheus/procfs/Makefile.common
+++ b/vendor/github.com/prometheus/procfs/Makefile.common
@@ -49,23 +49,23 @@ endif
GOTEST := $(GO) test
GOTEST_DIR :=
ifneq ($(CIRCLE_JOB),)
-ifneq ($(shell command -v gotestsum > /dev/null),)
+ifneq ($(shell command -v gotestsum 2> /dev/null),)
GOTEST_DIR := test-results
GOTEST := gotestsum --junitfile $(GOTEST_DIR)/unit-tests.xml --
endif
endif
-PROMU_VERSION ?= 0.15.0
+PROMU_VERSION ?= 0.17.0
PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_VERSION)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM).tar.gz
SKIP_GOLANGCI_LINT :=
GOLANGCI_LINT :=
GOLANGCI_LINT_OPTS ?=
-GOLANGCI_LINT_VERSION ?= v1.54.2
-# golangci-lint only supports linux, darwin and windows platforms on i386/amd64.
+GOLANGCI_LINT_VERSION ?= v1.59.0
+# golangci-lint only supports linux, darwin and windows platforms on i386/amd64/arm64.
# windows isn't included here because of the path separator being different.
ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin))
- ifeq ($(GOHOSTARCH),$(filter $(GOHOSTARCH),amd64 i386))
+ ifeq ($(GOHOSTARCH),$(filter $(GOHOSTARCH),amd64 i386 arm64))
# If we're in CI and there is an Actions file, that means the linter
# is being run in Actions, so we don't need to run it here.
ifneq (,$(SKIP_GOLANGCI_LINT))
@@ -169,16 +169,20 @@ common-vet:
common-lint: $(GOLANGCI_LINT)
ifdef GOLANGCI_LINT
@echo ">> running golangci-lint"
-# 'go list' needs to be executed before staticcheck to prepopulate the modules cache.
-# Otherwise staticcheck might fail randomly for some reason not yet explained.
- $(GO) list -e -compiled -test=true -export=false -deps=true -find=false -tags= -- ./... > /dev/null
$(GOLANGCI_LINT) run $(GOLANGCI_LINT_OPTS) $(pkgs)
endif
+.PHONY: common-lint-fix
+common-lint-fix: $(GOLANGCI_LINT)
+ifdef GOLANGCI_LINT
+ @echo ">> running golangci-lint fix"
+ $(GOLANGCI_LINT) run --fix $(GOLANGCI_LINT_OPTS) $(pkgs)
+endif
+
.PHONY: common-yamllint
common-yamllint:
@echo ">> running yamllint on all YAML files in the repository"
-ifeq (, $(shell command -v yamllint > /dev/null))
+ifeq (, $(shell command -v yamllint 2> /dev/null))
@echo "yamllint not installed so skipping"
else
yamllint .
@@ -204,6 +208,10 @@ common-tarball: promu
@echo ">> building release tarball"
$(PROMU) tarball --prefix $(PREFIX) $(BIN_DIR)
+.PHONY: common-docker-repo-name
+common-docker-repo-name:
+ @echo "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)"
+
.PHONY: common-docker $(BUILD_DOCKER_ARCHS)
common-docker: $(BUILD_DOCKER_ARCHS)
$(BUILD_DOCKER_ARCHS): common-docker-%:
diff --git a/vendor/github.com/prometheus/procfs/arp.go b/vendor/github.com/prometheus/procfs/arp.go
index 28783e2d..cdcc8a7c 100644
--- a/vendor/github.com/prometheus/procfs/arp.go
+++ b/vendor/github.com/prometheus/procfs/arp.go
@@ -55,7 +55,7 @@ type ARPEntry struct {
func (fs FS) GatherARPEntries() ([]ARPEntry, error) {
data, err := os.ReadFile(fs.proc.Path("net/arp"))
if err != nil {
- return nil, fmt.Errorf("%s: error reading arp %s: %w", ErrFileRead, fs.proc.Path("net/arp"), err)
+ return nil, fmt.Errorf("%w: error reading arp %s: %w", ErrFileRead, fs.proc.Path("net/arp"), err)
}
return parseARPEntries(data)
@@ -78,11 +78,11 @@ func parseARPEntries(data []byte) ([]ARPEntry, error) {
} else if width == expectedDataWidth {
entry, err := parseARPEntry(columns)
if err != nil {
- return []ARPEntry{}, fmt.Errorf("%s: Failed to parse ARP entry: %v: %w", ErrFileParse, entry, err)
+ return []ARPEntry{}, fmt.Errorf("%w: Failed to parse ARP entry: %v: %w", ErrFileParse, entry, err)
}
entries = append(entries, entry)
} else {
- return []ARPEntry{}, fmt.Errorf("%s: %d columns found, but expected %d: %w", ErrFileParse, width, expectedDataWidth, err)
+ return []ARPEntry{}, fmt.Errorf("%w: %d columns found, but expected %d: %w", ErrFileParse, width, expectedDataWidth, err)
}
}
diff --git a/vendor/github.com/prometheus/procfs/buddyinfo.go b/vendor/github.com/prometheus/procfs/buddyinfo.go
index 4a173636..83807500 100644
--- a/vendor/github.com/prometheus/procfs/buddyinfo.go
+++ b/vendor/github.com/prometheus/procfs/buddyinfo.go
@@ -58,8 +58,8 @@ func parseBuddyInfo(r io.Reader) ([]BuddyInfo, error) {
return nil, fmt.Errorf("%w: Invalid number of fields, found: %v", ErrFileParse, parts)
}
- node := strings.TrimRight(parts[1], ",")
- zone := strings.TrimRight(parts[3], ",")
+ node := strings.TrimSuffix(parts[1], ",")
+ zone := strings.TrimSuffix(parts[3], ",")
arraySize := len(parts[4:])
if bucketCount == -1 {
@@ -74,7 +74,7 @@ func parseBuddyInfo(r io.Reader) ([]BuddyInfo, error) {
for i := 0; i < arraySize; i++ {
sizes[i], err = strconv.ParseFloat(parts[i+4], 64)
if err != nil {
- return nil, fmt.Errorf("%s: Invalid valid in buddyinfo: %f: %w", ErrFileParse, sizes[i], err)
+ return nil, fmt.Errorf("%w: Invalid valid in buddyinfo: %f: %w", ErrFileParse, sizes[i], err)
}
}
diff --git a/vendor/github.com/prometheus/procfs/cpuinfo.go b/vendor/github.com/prometheus/procfs/cpuinfo.go
index f4f5501c..f0950bb4 100644
--- a/vendor/github.com/prometheus/procfs/cpuinfo.go
+++ b/vendor/github.com/prometheus/procfs/cpuinfo.go
@@ -194,7 +194,7 @@ func parseCPUInfoARM(info []byte) ([]CPUInfo, error) {
firstLine := firstNonEmptyLine(scanner)
match, err := regexp.MatchString("^[Pp]rocessor", firstLine)
if !match || !strings.Contains(firstLine, ":") {
- return nil, fmt.Errorf("%s: Cannot parse line: %q: %w", ErrFileParse, firstLine, err)
+ return nil, fmt.Errorf("%w: Cannot parse line: %q: %w", ErrFileParse, firstLine, err)
}
field := strings.SplitN(firstLine, ": ", 2)
@@ -386,7 +386,7 @@ func parseCPUInfoLoong(info []byte) ([]CPUInfo, error) {
// find the first "processor" line
firstLine := firstNonEmptyLine(scanner)
if !strings.HasPrefix(firstLine, "system type") || !strings.Contains(firstLine, ":") {
- return nil, errors.New("invalid cpuinfo file: " + firstLine)
+ return nil, fmt.Errorf("%w: %q", ErrFileParse, firstLine)
}
field := strings.SplitN(firstLine, ": ", 2)
cpuinfo := []CPUInfo{}
diff --git a/vendor/github.com/prometheus/procfs/crypto.go b/vendor/github.com/prometheus/procfs/crypto.go
index 9a73e263..5f2a37a7 100644
--- a/vendor/github.com/prometheus/procfs/crypto.go
+++ b/vendor/github.com/prometheus/procfs/crypto.go
@@ -55,13 +55,13 @@ func (fs FS) Crypto() ([]Crypto, error) {
path := fs.proc.Path("crypto")
b, err := util.ReadFileNoStat(path)
if err != nil {
- return nil, fmt.Errorf("%s: Cannot read file %v: %w", ErrFileRead, b, err)
+ return nil, fmt.Errorf("%w: Cannot read file %v: %w", ErrFileRead, b, err)
}
crypto, err := parseCrypto(bytes.NewReader(b))
if err != nil {
- return nil, fmt.Errorf("%s: Cannot parse %v: %w", ErrFileParse, crypto, err)
+ return nil, fmt.Errorf("%w: Cannot parse %v: %w", ErrFileParse, crypto, err)
}
return crypto, nil
@@ -84,7 +84,7 @@ func parseCrypto(r io.Reader) ([]Crypto, error) {
kv := strings.Split(text, ":")
if len(kv) != 2 {
- return nil, fmt.Errorf("%w: Cannot parae line: %q", ErrFileParse, text)
+ return nil, fmt.Errorf("%w: Cannot parse line: %q", ErrFileParse, text)
}
k := strings.TrimSpace(kv[0])
diff --git a/vendor/github.com/prometheus/procfs/fscache.go b/vendor/github.com/prometheus/procfs/fscache.go
index f560a8db..cf2e3eaa 100644
--- a/vendor/github.com/prometheus/procfs/fscache.go
+++ b/vendor/github.com/prometheus/procfs/fscache.go
@@ -236,7 +236,7 @@ func (fs FS) Fscacheinfo() (Fscacheinfo, error) {
m, err := parseFscacheinfo(bytes.NewReader(b))
if err != nil {
- return Fscacheinfo{}, fmt.Errorf("%s: Cannot parse %v: %w", ErrFileParse, m, err)
+ return Fscacheinfo{}, fmt.Errorf("%w: Cannot parse %v: %w", ErrFileParse, m, err)
}
return *m, nil
@@ -245,7 +245,7 @@ func (fs FS) Fscacheinfo() (Fscacheinfo, error) {
func setFSCacheFields(fields []string, setFields ...*uint64) error {
var err error
if len(fields) < len(setFields) {
- return fmt.Errorf("%s: Expected %d, but got %d: %w", ErrFileParse, len(setFields), len(fields), err)
+ return fmt.Errorf("%w: Expected %d, but got %d: %w", ErrFileParse, len(setFields), len(fields), err)
}
for i := range setFields {
diff --git a/vendor/github.com/prometheus/procfs/ipvs.go b/vendor/github.com/prometheus/procfs/ipvs.go
index 5a145bbf..bc3a20c9 100644
--- a/vendor/github.com/prometheus/procfs/ipvs.go
+++ b/vendor/github.com/prometheus/procfs/ipvs.go
@@ -221,16 +221,16 @@ func parseIPPort(s string) (net.IP, uint16, error) {
case 46:
ip = net.ParseIP(s[1:40])
if ip == nil {
- return nil, 0, fmt.Errorf("%s: Invalid IPv6 addr %s: %w", ErrFileParse, s[1:40], err)
+ return nil, 0, fmt.Errorf("%w: Invalid IPv6 addr %s: %w", ErrFileParse, s[1:40], err)
}
default:
- return nil, 0, fmt.Errorf("%s: Unexpected IP:Port %s: %w", ErrFileParse, s, err)
+ return nil, 0, fmt.Errorf("%w: Unexpected IP:Port %s: %w", ErrFileParse, s, err)
}
portString := s[len(s)-4:]
if len(portString) != 4 {
return nil, 0,
- fmt.Errorf("%s: Unexpected port string format %s: %w", ErrFileParse, portString, err)
+ fmt.Errorf("%w: Unexpected port string format %s: %w", ErrFileParse, portString, err)
}
port, err := strconv.ParseUint(portString, 16, 16)
if err != nil {
diff --git a/vendor/github.com/prometheus/procfs/loadavg.go b/vendor/github.com/prometheus/procfs/loadavg.go
index 59465c5b..332e76c1 100644
--- a/vendor/github.com/prometheus/procfs/loadavg.go
+++ b/vendor/github.com/prometheus/procfs/loadavg.go
@@ -51,7 +51,7 @@ func parseLoad(loadavgBytes []byte) (*LoadAvg, error) {
for i, load := range parts[0:3] {
loads[i], err = strconv.ParseFloat(load, 64)
if err != nil {
- return nil, fmt.Errorf("%s: Cannot parse load: %f: %w", ErrFileParse, loads[i], err)
+ return nil, fmt.Errorf("%w: Cannot parse load: %f: %w", ErrFileParse, loads[i], err)
}
}
return &LoadAvg{
diff --git a/vendor/github.com/prometheus/procfs/mdstat.go b/vendor/github.com/prometheus/procfs/mdstat.go
index fdd4b954..67a9d2b4 100644
--- a/vendor/github.com/prometheus/procfs/mdstat.go
+++ b/vendor/github.com/prometheus/procfs/mdstat.go
@@ -23,7 +23,7 @@ import (
var (
statusLineRE = regexp.MustCompile(`(\d+) blocks .*\[(\d+)/(\d+)\] \[([U_]+)\]`)
- recoveryLineBlocksRE = regexp.MustCompile(`\((\d+)/\d+\)`)
+ recoveryLineBlocksRE = regexp.MustCompile(`\((\d+/\d+)\)`)
recoveryLinePctRE = regexp.MustCompile(`= (.+)%`)
recoveryLineFinishRE = regexp.MustCompile(`finish=(.+)min`)
recoveryLineSpeedRE = regexp.MustCompile(`speed=(.+)[A-Z]`)
@@ -50,6 +50,8 @@ type MDStat struct {
BlocksTotal int64
// Number of blocks on the device that are in sync.
BlocksSynced int64
+ // Number of blocks on the device that need to be synced.
+ BlocksToBeSynced int64
// progress percentage of current sync
BlocksSyncedPct float64
// estimated finishing time for current sync (in minutes)
@@ -70,7 +72,7 @@ func (fs FS) MDStat() ([]MDStat, error) {
}
mdstat, err := parseMDStat(data)
if err != nil {
- return nil, fmt.Errorf("%s: Cannot parse %v: %w", ErrFileParse, fs.proc.Path("mdstat"), err)
+ return nil, fmt.Errorf("%w: Cannot parse %v: %w", ErrFileParse, fs.proc.Path("mdstat"), err)
}
return mdstat, nil
}
@@ -90,7 +92,7 @@ func parseMDStat(mdStatData []byte) ([]MDStat, error) {
deviceFields := strings.Fields(line)
if len(deviceFields) < 3 {
- return nil, fmt.Errorf("%s: Expected 3+ lines, got %q", ErrFileParse, line)
+ return nil, fmt.Errorf("%w: Expected 3+ lines, got %q", ErrFileParse, line)
}
mdName := deviceFields[0] // mdx
state := deviceFields[2] // active or inactive
@@ -105,7 +107,7 @@ func parseMDStat(mdStatData []byte) ([]MDStat, error) {
active, total, down, size, err := evalStatusLine(lines[i], lines[i+1])
if err != nil {
- return nil, fmt.Errorf("%s: Cannot parse md device lines: %v: %w", ErrFileParse, active, err)
+ return nil, fmt.Errorf("%w: Cannot parse md device lines: %v: %w", ErrFileParse, active, err)
}
syncLineIdx := i + 2
@@ -115,7 +117,8 @@ func parseMDStat(mdStatData []byte) ([]MDStat, error) {
// If device is syncing at the moment, get the number of currently
// synced bytes, otherwise that number equals the size of the device.
- syncedBlocks := size
+ blocksSynced := size
+ blocksToBeSynced := size
speed := float64(0)
finish := float64(0)
pct := float64(0)
@@ -136,11 +139,11 @@ func parseMDStat(mdStatData []byte) ([]MDStat, error) {
// Handle case when resync=PENDING or resync=DELAYED.
if strings.Contains(lines[syncLineIdx], "PENDING") ||
strings.Contains(lines[syncLineIdx], "DELAYED") {
- syncedBlocks = 0
+ blocksSynced = 0
} else {
- syncedBlocks, pct, finish, speed, err = evalRecoveryLine(lines[syncLineIdx])
+ blocksSynced, blocksToBeSynced, pct, finish, speed, err = evalRecoveryLine(lines[syncLineIdx])
if err != nil {
- return nil, fmt.Errorf("%s: Cannot parse sync line in md device: %q: %w", ErrFileParse, mdName, err)
+ return nil, fmt.Errorf("%w: Cannot parse sync line in md device: %q: %w", ErrFileParse, mdName, err)
}
}
}
@@ -154,7 +157,8 @@ func parseMDStat(mdStatData []byte) ([]MDStat, error) {
DisksSpare: spare,
DisksTotal: total,
BlocksTotal: size,
- BlocksSynced: syncedBlocks,
+ BlocksSynced: blocksSynced,
+ BlocksToBeSynced: blocksToBeSynced,
BlocksSyncedPct: pct,
BlocksSyncedFinishTime: finish,
BlocksSyncedSpeed: speed,
@@ -168,13 +172,13 @@ func parseMDStat(mdStatData []byte) ([]MDStat, error) {
func evalStatusLine(deviceLine, statusLine string) (active, total, down, size int64, err error) {
statusFields := strings.Fields(statusLine)
if len(statusFields) < 1 {
- return 0, 0, 0, 0, fmt.Errorf("%s: Unexpected statusline %q: %w", ErrFileParse, statusLine, err)
+ return 0, 0, 0, 0, fmt.Errorf("%w: Unexpected statusline %q: %w", ErrFileParse, statusLine, err)
}
sizeStr := statusFields[0]
size, err = strconv.ParseInt(sizeStr, 10, 64)
if err != nil {
- return 0, 0, 0, 0, fmt.Errorf("%s: Unexpected statusline %q: %w", ErrFileParse, statusLine, err)
+ return 0, 0, 0, 0, fmt.Errorf("%w: Unexpected statusline %q: %w", ErrFileParse, statusLine, err)
}
if strings.Contains(deviceLine, "raid0") || strings.Contains(deviceLine, "linear") {
@@ -189,65 +193,71 @@ func evalStatusLine(deviceLine, statusLine string) (active, total, down, size in
matches := statusLineRE.FindStringSubmatch(statusLine)
if len(matches) != 5 {
- return 0, 0, 0, 0, fmt.Errorf("%s: Could not fild all substring matches %s: %w", ErrFileParse, statusLine, err)
+ return 0, 0, 0, 0, fmt.Errorf("%w: Could not fild all substring matches %s: %w", ErrFileParse, statusLine, err)
}
total, err = strconv.ParseInt(matches[2], 10, 64)
if err != nil {
- return 0, 0, 0, 0, fmt.Errorf("%s: Unexpected statusline %q: %w", ErrFileParse, statusLine, err)
+ return 0, 0, 0, 0, fmt.Errorf("%w: Unexpected statusline %q: %w", ErrFileParse, statusLine, err)
}
active, err = strconv.ParseInt(matches[3], 10, 64)
if err != nil {
- return 0, 0, 0, 0, fmt.Errorf("%s: Unexpected active %d: %w", ErrFileParse, active, err)
+ return 0, 0, 0, 0, fmt.Errorf("%w: Unexpected active %d: %w", ErrFileParse, active, err)
}
down = int64(strings.Count(matches[4], "_"))
return active, total, down, size, nil
}
-func evalRecoveryLine(recoveryLine string) (syncedBlocks int64, pct float64, finish float64, speed float64, err error) {
+func evalRecoveryLine(recoveryLine string) (blocksSynced int64, blocksToBeSynced int64, pct float64, finish float64, speed float64, err error) {
matches := recoveryLineBlocksRE.FindStringSubmatch(recoveryLine)
if len(matches) != 2 {
- return 0, 0, 0, 0, fmt.Errorf("%s: Unexpected recoveryLine %s: %w", ErrFileParse, recoveryLine, err)
+ return 0, 0, 0, 0, 0, fmt.Errorf("%w: Unexpected recoveryLine blocks %s: %w", ErrFileParse, recoveryLine, err)
}
- syncedBlocks, err = strconv.ParseInt(matches[1], 10, 64)
+ blocks := strings.Split(matches[1], "/")
+ blocksSynced, err = strconv.ParseInt(blocks[0], 10, 64)
if err != nil {
- return 0, 0, 0, 0, fmt.Errorf("%s: Unexpected parsing of recoveryLine %q: %w", ErrFileParse, recoveryLine, err)
+ return 0, 0, 0, 0, 0, fmt.Errorf("%w: Unable to parse recovery blocks synced %q: %w", ErrFileParse, matches[1], err)
+ }
+
+ blocksToBeSynced, err = strconv.ParseInt(blocks[1], 10, 64)
+ if err != nil {
+ return blocksSynced, 0, 0, 0, 0, fmt.Errorf("%w: Unable to parse recovery to be synced blocks %q: %w", ErrFileParse, matches[2], err)
}
// Get percentage complete
matches = recoveryLinePctRE.FindStringSubmatch(recoveryLine)
if len(matches) != 2 {
- return syncedBlocks, 0, 0, 0, fmt.Errorf("%w: Unexpected recoveryLine matching percentage %s", ErrFileParse, recoveryLine)
+ return blocksSynced, blocksToBeSynced, 0, 0, 0, fmt.Errorf("%w: Unexpected recoveryLine matching percentage %s", ErrFileParse, recoveryLine)
}
pct, err = strconv.ParseFloat(strings.TrimSpace(matches[1]), 64)
if err != nil {
- return syncedBlocks, 0, 0, 0, fmt.Errorf("%w: Error parsing float from recoveryLine %q", ErrFileParse, recoveryLine)
+ return blocksSynced, blocksToBeSynced, 0, 0, 0, fmt.Errorf("%w: Error parsing float from recoveryLine %q", ErrFileParse, recoveryLine)
}
// Get time expected left to complete
matches = recoveryLineFinishRE.FindStringSubmatch(recoveryLine)
if len(matches) != 2 {
- return syncedBlocks, pct, 0, 0, fmt.Errorf("%w: Unexpected recoveryLine matching est. finish time: %s", ErrFileParse, recoveryLine)
+ return blocksSynced, blocksToBeSynced, pct, 0, 0, fmt.Errorf("%w: Unexpected recoveryLine matching est. finish time: %s", ErrFileParse, recoveryLine)
}
finish, err = strconv.ParseFloat(matches[1], 64)
if err != nil {
- return syncedBlocks, pct, 0, 0, fmt.Errorf("%w: Unable to parse float from recoveryLine: %q", ErrFileParse, recoveryLine)
+ return blocksSynced, blocksToBeSynced, pct, 0, 0, fmt.Errorf("%w: Unable to parse float from recoveryLine: %q", ErrFileParse, recoveryLine)
}
// Get recovery speed
matches = recoveryLineSpeedRE.FindStringSubmatch(recoveryLine)
if len(matches) != 2 {
- return syncedBlocks, pct, finish, 0, fmt.Errorf("%w: Unexpected recoveryLine value: %s", ErrFileParse, recoveryLine)
+ return blocksSynced, blocksToBeSynced, pct, finish, 0, fmt.Errorf("%w: Unexpected recoveryLine value: %s", ErrFileParse, recoveryLine)
}
speed, err = strconv.ParseFloat(matches[1], 64)
if err != nil {
- return syncedBlocks, pct, finish, 0, fmt.Errorf("%s: Error parsing float from recoveryLine: %q: %w", ErrFileParse, recoveryLine, err)
+ return blocksSynced, blocksToBeSynced, pct, finish, 0, fmt.Errorf("%w: Error parsing float from recoveryLine: %q: %w", ErrFileParse, recoveryLine, err)
}
- return syncedBlocks, pct, finish, speed, nil
+ return blocksSynced, blocksToBeSynced, pct, finish, speed, nil
}
func evalComponentDevices(deviceFields []string) []string {
diff --git a/vendor/github.com/prometheus/procfs/meminfo.go b/vendor/github.com/prometheus/procfs/meminfo.go
index eaf00e22..4b2c4050 100644
--- a/vendor/github.com/prometheus/procfs/meminfo.go
+++ b/vendor/github.com/prometheus/procfs/meminfo.go
@@ -126,6 +126,7 @@ type Meminfo struct {
VmallocUsed *uint64
// largest contiguous block of vmalloc area which is free
VmallocChunk *uint64
+ Percpu *uint64
HardwareCorrupted *uint64
AnonHugePages *uint64
ShmemHugePages *uint64
@@ -140,6 +141,55 @@ type Meminfo struct {
DirectMap4k *uint64
DirectMap2M *uint64
DirectMap1G *uint64
+
+ // The struct fields below are the byte-normalized counterparts to the
+ // existing struct fields. Values are normalized using the optional
+ // unit field in the meminfo line.
+ MemTotalBytes *uint64
+ MemFreeBytes *uint64
+ MemAvailableBytes *uint64
+ BuffersBytes *uint64
+ CachedBytes *uint64
+ SwapCachedBytes *uint64
+ ActiveBytes *uint64
+ InactiveBytes *uint64
+ ActiveAnonBytes *uint64
+ InactiveAnonBytes *uint64
+ ActiveFileBytes *uint64
+ InactiveFileBytes *uint64
+ UnevictableBytes *uint64
+ MlockedBytes *uint64
+ SwapTotalBytes *uint64
+ SwapFreeBytes *uint64
+ DirtyBytes *uint64
+ WritebackBytes *uint64
+ AnonPagesBytes *uint64
+ MappedBytes *uint64
+ ShmemBytes *uint64
+ SlabBytes *uint64
+ SReclaimableBytes *uint64
+ SUnreclaimBytes *uint64
+ KernelStackBytes *uint64
+ PageTablesBytes *uint64
+ NFSUnstableBytes *uint64
+ BounceBytes *uint64
+ WritebackTmpBytes *uint64
+ CommitLimitBytes *uint64
+ CommittedASBytes *uint64
+ VmallocTotalBytes *uint64
+ VmallocUsedBytes *uint64
+ VmallocChunkBytes *uint64
+ PercpuBytes *uint64
+ HardwareCorruptedBytes *uint64
+ AnonHugePagesBytes *uint64
+ ShmemHugePagesBytes *uint64
+ ShmemPmdMappedBytes *uint64
+ CmaTotalBytes *uint64
+ CmaFreeBytes *uint64
+ HugepagesizeBytes *uint64
+ DirectMap4kBytes *uint64
+ DirectMap2MBytes *uint64
+ DirectMap1GBytes *uint64
}
// Meminfo returns an information about current kernel/system memory statistics.
@@ -152,7 +202,7 @@ func (fs FS) Meminfo() (Meminfo, error) {
m, err := parseMemInfo(bytes.NewReader(b))
if err != nil {
- return Meminfo{}, fmt.Errorf("%s: %w", ErrFileParse, err)
+ return Meminfo{}, fmt.Errorf("%w: %w", ErrFileParse, err)
}
return *m, nil
@@ -162,114 +212,176 @@ func parseMemInfo(r io.Reader) (*Meminfo, error) {
var m Meminfo
s := bufio.NewScanner(r)
for s.Scan() {
- // Each line has at least a name and value; we ignore the unit.
fields := strings.Fields(s.Text())
- if len(fields) < 2 {
- return nil, fmt.Errorf("%w: Malformed line %q", ErrFileParse, s.Text())
- }
+ var val, valBytes uint64
- v, err := strconv.ParseUint(fields[1], 0, 64)
+ val, err := strconv.ParseUint(fields[1], 0, 64)
if err != nil {
return nil, err
}
+ switch len(fields) {
+ case 2:
+ // No unit present, use the parsed the value as bytes directly.
+ valBytes = val
+ case 3:
+ // Unit present in optional 3rd field, convert it to
+ // bytes. The only unit supported within the Linux
+ // kernel is `kB`.
+ if fields[2] != "kB" {
+ return nil, fmt.Errorf("%w: Unsupported unit in optional 3rd field %q", ErrFileParse, fields[2])
+ }
+
+ valBytes = 1024 * val
+
+ default:
+ return nil, fmt.Errorf("%w: Malformed line %q", ErrFileParse, s.Text())
+ }
+
switch fields[0] {
case "MemTotal:":
- m.MemTotal = &v
+ m.MemTotal = &val
+ m.MemTotalBytes = &valBytes
case "MemFree:":
- m.MemFree = &v
+ m.MemFree = &val
+ m.MemFreeBytes = &valBytes
case "MemAvailable:":
- m.MemAvailable = &v
+ m.MemAvailable = &val
+ m.MemAvailableBytes = &valBytes
case "Buffers:":
- m.Buffers = &v
+ m.Buffers = &val
+ m.BuffersBytes = &valBytes
case "Cached:":
- m.Cached = &v
+ m.Cached = &val
+ m.CachedBytes = &valBytes
case "SwapCached:":
- m.SwapCached = &v
+ m.SwapCached = &val
+ m.SwapCachedBytes = &valBytes
case "Active:":
- m.Active = &v
+ m.Active = &val
+ m.ActiveBytes = &valBytes
case "Inactive:":
- m.Inactive = &v
+ m.Inactive = &val
+ m.InactiveBytes = &valBytes
case "Active(anon):":
- m.ActiveAnon = &v
+ m.ActiveAnon = &val
+ m.ActiveAnonBytes = &valBytes
case "Inactive(anon):":
- m.InactiveAnon = &v
+ m.InactiveAnon = &val
+ m.InactiveAnonBytes = &valBytes
case "Active(file):":
- m.ActiveFile = &v
+ m.ActiveFile = &val
+ m.ActiveFileBytes = &valBytes
case "Inactive(file):":
- m.InactiveFile = &v
+ m.InactiveFile = &val
+ m.InactiveFileBytes = &valBytes
case "Unevictable:":
- m.Unevictable = &v
+ m.Unevictable = &val
+ m.UnevictableBytes = &valBytes
case "Mlocked:":
- m.Mlocked = &v
+ m.Mlocked = &val
+ m.MlockedBytes = &valBytes
case "SwapTotal:":
- m.SwapTotal = &v
+ m.SwapTotal = &val
+ m.SwapTotalBytes = &valBytes
case "SwapFree:":
- m.SwapFree = &v
+ m.SwapFree = &val
+ m.SwapFreeBytes = &valBytes
case "Dirty:":
- m.Dirty = &v
+ m.Dirty = &val
+ m.DirtyBytes = &valBytes
case "Writeback:":
- m.Writeback = &v
+ m.Writeback = &val
+ m.WritebackBytes = &valBytes
case "AnonPages:":
- m.AnonPages = &v
+ m.AnonPages = &val
+ m.AnonPagesBytes = &valBytes
case "Mapped:":
- m.Mapped = &v
+ m.Mapped = &val
+ m.MappedBytes = &valBytes
case "Shmem:":
- m.Shmem = &v
+ m.Shmem = &val
+ m.ShmemBytes = &valBytes
case "Slab:":
- m.Slab = &v
+ m.Slab = &val
+ m.SlabBytes = &valBytes
case "SReclaimable:":
- m.SReclaimable = &v
+ m.SReclaimable = &val
+ m.SReclaimableBytes = &valBytes
case "SUnreclaim:":
- m.SUnreclaim = &v
+ m.SUnreclaim = &val
+ m.SUnreclaimBytes = &valBytes
case "KernelStack:":
- m.KernelStack = &v
+ m.KernelStack = &val
+ m.KernelStackBytes = &valBytes
case "PageTables:":
- m.PageTables = &v
+ m.PageTables = &val
+ m.PageTablesBytes = &valBytes
case "NFS_Unstable:":
- m.NFSUnstable = &v
+ m.NFSUnstable = &val
+ m.NFSUnstableBytes = &valBytes
case "Bounce:":
- m.Bounce = &v
+ m.Bounce = &val
+ m.BounceBytes = &valBytes
case "WritebackTmp:":
- m.WritebackTmp = &v
+ m.WritebackTmp = &val
+ m.WritebackTmpBytes = &valBytes
case "CommitLimit:":
- m.CommitLimit = &v
+ m.CommitLimit = &val
+ m.CommitLimitBytes = &valBytes
case "Committed_AS:":
- m.CommittedAS = &v
+ m.CommittedAS = &val
+ m.CommittedASBytes = &valBytes
case "VmallocTotal:":
- m.VmallocTotal = &v
+ m.VmallocTotal = &val
+ m.VmallocTotalBytes = &valBytes
case "VmallocUsed:":
- m.VmallocUsed = &v
+ m.VmallocUsed = &val
+ m.VmallocUsedBytes = &valBytes
case "VmallocChunk:":
- m.VmallocChunk = &v
+ m.VmallocChunk = &val
+ m.VmallocChunkBytes = &valBytes
+ case "Percpu:":
+ m.Percpu = &val
+ m.PercpuBytes = &valBytes
case "HardwareCorrupted:":
- m.HardwareCorrupted = &v
+ m.HardwareCorrupted = &val
+ m.HardwareCorruptedBytes = &valBytes
case "AnonHugePages:":
- m.AnonHugePages = &v
+ m.AnonHugePages = &val
+ m.AnonHugePagesBytes = &valBytes
case "ShmemHugePages:":
- m.ShmemHugePages = &v
+ m.ShmemHugePages = &val
+ m.ShmemHugePagesBytes = &valBytes
case "ShmemPmdMapped:":
- m.ShmemPmdMapped = &v
+ m.ShmemPmdMapped = &val
+ m.ShmemPmdMappedBytes = &valBytes
case "CmaTotal:":
- m.CmaTotal = &v
+ m.CmaTotal = &val
+ m.CmaTotalBytes = &valBytes
case "CmaFree:":
- m.CmaFree = &v
+ m.CmaFree = &val
+ m.CmaFreeBytes = &valBytes
case "HugePages_Total:":
- m.HugePagesTotal = &v
+ m.HugePagesTotal = &val
case "HugePages_Free:":
- m.HugePagesFree = &v
+ m.HugePagesFree = &val
case "HugePages_Rsvd:":
- m.HugePagesRsvd = &v
+ m.HugePagesRsvd = &val
case "HugePages_Surp:":
- m.HugePagesSurp = &v
+ m.HugePagesSurp = &val
case "Hugepagesize:":
- m.Hugepagesize = &v
+ m.Hugepagesize = &val
+ m.HugepagesizeBytes = &valBytes
case "DirectMap4k:":
- m.DirectMap4k = &v
+ m.DirectMap4k = &val
+ m.DirectMap4kBytes = &valBytes
case "DirectMap2M:":
- m.DirectMap2M = &v
+ m.DirectMap2M = &val
+ m.DirectMap2MBytes = &valBytes
case "DirectMap1G:":
- m.DirectMap1G = &v
+ m.DirectMap1G = &val
+ m.DirectMap1GBytes = &valBytes
}
}
diff --git a/vendor/github.com/prometheus/procfs/mountinfo.go b/vendor/github.com/prometheus/procfs/mountinfo.go
index 388ebf39..a704c5e7 100644
--- a/vendor/github.com/prometheus/procfs/mountinfo.go
+++ b/vendor/github.com/prometheus/procfs/mountinfo.go
@@ -109,7 +109,7 @@ func parseMountInfoString(mountString string) (*MountInfo, error) {
if mountInfo[6] != "" {
mount.OptionalFields, err = mountOptionsParseOptionalFields(mountInfo[6 : mountInfoLength-4])
if err != nil {
- return nil, fmt.Errorf("%s: %w", ErrFileParse, err)
+ return nil, fmt.Errorf("%w: %w", ErrFileParse, err)
}
}
return mount, nil
diff --git a/vendor/github.com/prometheus/procfs/mountstats.go b/vendor/github.com/prometheus/procfs/mountstats.go
index 9d8af6db..75a3b6c8 100644
--- a/vendor/github.com/prometheus/procfs/mountstats.go
+++ b/vendor/github.com/prometheus/procfs/mountstats.go
@@ -88,7 +88,7 @@ type MountStatsNFS struct {
// Statistics broken down by filesystem operation.
Operations []NFSOperationStats
// Statistics about the NFS RPC transport.
- Transport NFSTransportStats
+ Transport []NFSTransportStats
}
// mountStats implements MountStats.
@@ -194,8 +194,6 @@ type NFSOperationStats struct {
CumulativeTotalResponseMilliseconds uint64
// Duration from when a request was enqueued to when it was completely handled.
CumulativeTotalRequestMilliseconds uint64
- // The average time from the point the client sends RPC requests until it receives the response.
- AverageRTTMilliseconds float64
// The count of operations that complete with tk_status < 0. These statuses usually indicate error conditions.
Errors uint64
}
@@ -434,7 +432,7 @@ func parseMountStatsNFS(s *bufio.Scanner, statVersion string) (*MountStatsNFS, e
return nil, err
}
- stats.Transport = *tstats
+ stats.Transport = append(stats.Transport, *tstats)
}
// When encountering "per-operation statistics", we must break this
@@ -582,9 +580,6 @@ func parseNFSOperationStats(s *bufio.Scanner) ([]NFSOperationStats, error) {
CumulativeTotalResponseMilliseconds: ns[6],
CumulativeTotalRequestMilliseconds: ns[7],
}
- if ns[0] != 0 {
- opStats.AverageRTTMilliseconds = float64(ns[6]) / float64(ns[0])
- }
if len(ns) > 8 {
opStats.Errors = ns[8]
@@ -632,7 +627,7 @@ func parseNFSTransportStats(ss []string, statVersion string) (*NFSTransportStats
return nil, fmt.Errorf("%w: invalid NFS transport stats 1.1 statement: %v, protocol: %v", ErrFileParse, ss, protocol)
}
default:
- return nil, fmt.Errorf("%s: Unrecognized NFS transport stats version: %q, protocol: %v", ErrFileParse, statVersion, protocol)
+ return nil, fmt.Errorf("%w: Unrecognized NFS transport stats version: %q, protocol: %v", ErrFileParse, statVersion, protocol)
}
// Allocate enough for v1.1 stats since zero value for v1.1 stats will be okay
diff --git a/vendor/github.com/prometheus/procfs/net_conntrackstat.go b/vendor/github.com/prometheus/procfs/net_conntrackstat.go
index fdfa4561..316df5fb 100644
--- a/vendor/github.com/prometheus/procfs/net_conntrackstat.go
+++ b/vendor/github.com/prometheus/procfs/net_conntrackstat.go
@@ -58,7 +58,7 @@ func readConntrackStat(path string) ([]ConntrackStatEntry, error) {
stat, err := parseConntrackStat(bytes.NewReader(b))
if err != nil {
- return nil, fmt.Errorf("%s: Cannot read file: %v: %w", ErrFileRead, path, err)
+ return nil, fmt.Errorf("%w: Cannot read file: %v: %w", ErrFileRead, path, err)
}
return stat, nil
@@ -86,7 +86,7 @@ func parseConntrackStat(r io.Reader) ([]ConntrackStatEntry, error) {
func parseConntrackStatEntry(fields []string) (*ConntrackStatEntry, error) {
entries, err := util.ParseHexUint64s(fields)
if err != nil {
- return nil, fmt.Errorf("%s: Cannot parse entry: %d: %w", ErrFileParse, entries, err)
+ return nil, fmt.Errorf("%w: Cannot parse entry: %d: %w", ErrFileParse, entries, err)
}
numEntries := len(entries)
if numEntries < 16 || numEntries > 17 {
diff --git a/vendor/github.com/prometheus/procfs/net_ip_socket.go b/vendor/github.com/prometheus/procfs/net_ip_socket.go
index 4da81ea5..b70f1fc7 100644
--- a/vendor/github.com/prometheus/procfs/net_ip_socket.go
+++ b/vendor/github.com/prometheus/procfs/net_ip_socket.go
@@ -50,10 +50,13 @@ type (
// UsedSockets shows the total number of parsed lines representing the
// number of used sockets.
UsedSockets uint64
+ // Drops shows the total number of dropped packets of all UPD sockets.
+ Drops *uint64
}
// netIPSocketLine represents the fields parsed from a single line
// in /proc/net/{t,u}dp{,6}. Fields which are not used by IPSocket are skipped.
+ // Drops is non-nil for udp{,6}, but nil for tcp{,6}.
// For the proc file format details, see https://linux.die.net/man/5/proc.
netIPSocketLine struct {
Sl uint64
@@ -66,6 +69,7 @@ type (
RxQueue uint64
UID uint64
Inode uint64
+ Drops *uint64
}
)
@@ -77,13 +81,14 @@ func newNetIPSocket(file string) (NetIPSocket, error) {
defer f.Close()
var netIPSocket NetIPSocket
+ isUDP := strings.Contains(file, "udp")
lr := io.LimitReader(f, readLimit)
s := bufio.NewScanner(lr)
s.Scan() // skip first line with headers
for s.Scan() {
fields := strings.Fields(s.Text())
- line, err := parseNetIPSocketLine(fields)
+ line, err := parseNetIPSocketLine(fields, isUDP)
if err != nil {
return nil, err
}
@@ -104,19 +109,25 @@ func newNetIPSocketSummary(file string) (*NetIPSocketSummary, error) {
defer f.Close()
var netIPSocketSummary NetIPSocketSummary
+ var udpPacketDrops uint64
+ isUDP := strings.Contains(file, "udp")
lr := io.LimitReader(f, readLimit)
s := bufio.NewScanner(lr)
s.Scan() // skip first line with headers
for s.Scan() {
fields := strings.Fields(s.Text())
- line, err := parseNetIPSocketLine(fields)
+ line, err := parseNetIPSocketLine(fields, isUDP)
if err != nil {
return nil, err
}
netIPSocketSummary.TxQueueLength += line.TxQueue
netIPSocketSummary.RxQueueLength += line.RxQueue
netIPSocketSummary.UsedSockets++
+ if isUDP {
+ udpPacketDrops += *line.Drops
+ netIPSocketSummary.Drops = &udpPacketDrops
+ }
}
if err := s.Err(); err != nil {
return nil, err
@@ -130,7 +141,7 @@ func parseIP(hexIP string) (net.IP, error) {
var byteIP []byte
byteIP, err := hex.DecodeString(hexIP)
if err != nil {
- return nil, fmt.Errorf("%s: Cannot parse socket field in %q: %w", ErrFileParse, hexIP, err)
+ return nil, fmt.Errorf("%w: Cannot parse socket field in %q: %w", ErrFileParse, hexIP, err)
}
switch len(byteIP) {
case 4:
@@ -144,12 +155,12 @@ func parseIP(hexIP string) (net.IP, error) {
}
return i, nil
default:
- return nil, fmt.Errorf("%s: Unable to parse IP %s: %w", ErrFileParse, hexIP, nil)
+ return nil, fmt.Errorf("%w: Unable to parse IP %s: %v", ErrFileParse, hexIP, nil)
}
}
// parseNetIPSocketLine parses a single line, represented by a list of fields.
-func parseNetIPSocketLine(fields []string) (*netIPSocketLine, error) {
+func parseNetIPSocketLine(fields []string, isUDP bool) (*netIPSocketLine, error) {
line := &netIPSocketLine{}
if len(fields) < 10 {
return nil, fmt.Errorf(
@@ -167,7 +178,7 @@ func parseNetIPSocketLine(fields []string) (*netIPSocketLine, error) {
}
if line.Sl, err = strconv.ParseUint(s[0], 0, 64); err != nil {
- return nil, fmt.Errorf("%s: Unable to parse sl field in %q: %w", ErrFileParse, line.Sl, err)
+ return nil, fmt.Errorf("%w: Unable to parse sl field in %q: %w", ErrFileParse, line.Sl, err)
}
// local_address
l := strings.Split(fields[1], ":")
@@ -178,7 +189,7 @@ func parseNetIPSocketLine(fields []string) (*netIPSocketLine, error) {
return nil, err
}
if line.LocalPort, err = strconv.ParseUint(l[1], 16, 64); err != nil {
- return nil, fmt.Errorf("%s: Unable to parse local_address port value line %q: %w", ErrFileParse, line.LocalPort, err)
+ return nil, fmt.Errorf("%w: Unable to parse local_address port value line %q: %w", ErrFileParse, line.LocalPort, err)
}
// remote_address
@@ -190,12 +201,12 @@ func parseNetIPSocketLine(fields []string) (*netIPSocketLine, error) {
return nil, err
}
if line.RemPort, err = strconv.ParseUint(r[1], 16, 64); err != nil {
- return nil, fmt.Errorf("%s: Cannot parse rem_address port value in %q: %w", ErrFileParse, line.RemPort, err)
+ return nil, fmt.Errorf("%w: Cannot parse rem_address port value in %q: %w", ErrFileParse, line.RemPort, err)
}
// st
if line.St, err = strconv.ParseUint(fields[3], 16, 64); err != nil {
- return nil, fmt.Errorf("%s: Cannot parse st value in %q: %w", ErrFileParse, line.St, err)
+ return nil, fmt.Errorf("%w: Cannot parse st value in %q: %w", ErrFileParse, line.St, err)
}
// tx_queue and rx_queue
@@ -208,20 +219,29 @@ func parseNetIPSocketLine(fields []string) (*netIPSocketLine, error) {
)
}
if line.TxQueue, err = strconv.ParseUint(q[0], 16, 64); err != nil {
- return nil, fmt.Errorf("%s: Cannot parse tx_queue value in %q: %w", ErrFileParse, line.TxQueue, err)
+ return nil, fmt.Errorf("%w: Cannot parse tx_queue value in %q: %w", ErrFileParse, line.TxQueue, err)
}
if line.RxQueue, err = strconv.ParseUint(q[1], 16, 64); err != nil {
- return nil, fmt.Errorf("%s: Cannot parse trx_queue value in %q: %w", ErrFileParse, line.RxQueue, err)
+ return nil, fmt.Errorf("%w: Cannot parse trx_queue value in %q: %w", ErrFileParse, line.RxQueue, err)
}
// uid
if line.UID, err = strconv.ParseUint(fields[7], 0, 64); err != nil {
- return nil, fmt.Errorf("%s: Cannot parse UID value in %q: %w", ErrFileParse, line.UID, err)
+ return nil, fmt.Errorf("%w: Cannot parse UID value in %q: %w", ErrFileParse, line.UID, err)
}
// inode
if line.Inode, err = strconv.ParseUint(fields[9], 0, 64); err != nil {
- return nil, fmt.Errorf("%s: Cannot parse inode value in %q: %w", ErrFileParse, line.Inode, err)
+ return nil, fmt.Errorf("%w: Cannot parse inode value in %q: %w", ErrFileParse, line.Inode, err)
+ }
+
+ // drops
+ if isUDP {
+ drops, err := strconv.ParseUint(fields[12], 0, 64)
+ if err != nil {
+ return nil, fmt.Errorf("%w: Cannot parse drops value in %q: %w", ErrFileParse, drops, err)
+ }
+ line.Drops = &drops
}
return line, nil
diff --git a/vendor/github.com/prometheus/procfs/net_sockstat.go b/vendor/github.com/prometheus/procfs/net_sockstat.go
index 360e36af..fae62b13 100644
--- a/vendor/github.com/prometheus/procfs/net_sockstat.go
+++ b/vendor/github.com/prometheus/procfs/net_sockstat.go
@@ -69,7 +69,7 @@ func readSockstat(name string) (*NetSockstat, error) {
stat, err := parseSockstat(bytes.NewReader(b))
if err != nil {
- return nil, fmt.Errorf("%s: sockstats from %q: %w", ErrFileRead, name, err)
+ return nil, fmt.Errorf("%w: sockstats from %q: %w", ErrFileRead, name, err)
}
return stat, nil
@@ -89,7 +89,7 @@ func parseSockstat(r io.Reader) (*NetSockstat, error) {
// The remaining fields are key/value pairs.
kvs, err := parseSockstatKVs(fields[1:])
if err != nil {
- return nil, fmt.Errorf("%s: sockstat key/value pairs from %q: %w", ErrFileParse, s.Text(), err)
+ return nil, fmt.Errorf("%w: sockstat key/value pairs from %q: %w", ErrFileParse, s.Text(), err)
}
// The first field is the protocol. We must trim its colon suffix.
diff --git a/vendor/github.com/prometheus/procfs/net_softnet.go b/vendor/github.com/prometheus/procfs/net_softnet.go
index c7708529..71c8059f 100644
--- a/vendor/github.com/prometheus/procfs/net_softnet.go
+++ b/vendor/github.com/prometheus/procfs/net_softnet.go
@@ -64,7 +64,7 @@ func (fs FS) NetSoftnetStat() ([]SoftnetStat, error) {
entries, err := parseSoftnet(bytes.NewReader(b))
if err != nil {
- return nil, fmt.Errorf("%s: /proc/net/softnet_stat: %w", ErrFileParse, err)
+ return nil, fmt.Errorf("%w: /proc/net/softnet_stat: %w", ErrFileParse, err)
}
return entries, nil
diff --git a/vendor/github.com/prometheus/procfs/net_tls_stat.go b/vendor/github.com/prometheus/procfs/net_tls_stat.go
new file mode 100644
index 00000000..13994c17
--- /dev/null
+++ b/vendor/github.com/prometheus/procfs/net_tls_stat.go
@@ -0,0 +1,119 @@
+// Copyright 2023 Prometheus Team
+// 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 procfs
+
+import (
+ "bufio"
+ "fmt"
+ "os"
+ "strconv"
+ "strings"
+)
+
+// TLSStat struct represents data in /proc/net/tls_stat.
+// See https://docs.kernel.org/networking/tls.html#statistics
+type TLSStat struct {
+ // number of TX sessions currently installed where host handles cryptography
+ TLSCurrTxSw int
+ // number of RX sessions currently installed where host handles cryptography
+ TLSCurrRxSw int
+ // number of TX sessions currently installed where NIC handles cryptography
+ TLSCurrTxDevice int
+ // number of RX sessions currently installed where NIC handles cryptography
+ TLSCurrRxDevice int
+ //number of TX sessions opened with host cryptography
+ TLSTxSw int
+ //number of RX sessions opened with host cryptography
+ TLSRxSw int
+ // number of TX sessions opened with NIC cryptography
+ TLSTxDevice int
+ // number of RX sessions opened with NIC cryptography
+ TLSRxDevice int
+ // record decryption failed (e.g. due to incorrect authentication tag)
+ TLSDecryptError int
+ // number of RX resyncs sent to NICs handling cryptography
+ TLSRxDeviceResync int
+ // number of RX records which had to be re-decrypted due to TLS_RX_EXPECT_NO_PAD mis-prediction. Note that this counter will also increment for non-data records.
+ TLSDecryptRetry int
+ // number of data RX records which had to be re-decrypted due to TLS_RX_EXPECT_NO_PAD mis-prediction.
+ TLSRxNoPadViolation int
+}
+
+// NewTLSStat reads the tls_stat statistics.
+func NewTLSStat() (TLSStat, error) {
+ fs, err := NewFS(DefaultMountPoint)
+ if err != nil {
+ return TLSStat{}, err
+ }
+
+ return fs.NewTLSStat()
+}
+
+// NewTLSStat reads the tls_stat statistics.
+func (fs FS) NewTLSStat() (TLSStat, error) {
+ file, err := os.Open(fs.proc.Path("net/tls_stat"))
+ if err != nil {
+ return TLSStat{}, err
+ }
+ defer file.Close()
+
+ var (
+ tlsstat = TLSStat{}
+ s = bufio.NewScanner(file)
+ )
+
+ for s.Scan() {
+ fields := strings.Fields(s.Text())
+
+ if len(fields) != 2 {
+ return TLSStat{}, fmt.Errorf("%w: %q line %q", ErrFileParse, file.Name(), s.Text())
+ }
+
+ name := fields[0]
+ value, err := strconv.Atoi(fields[1])
+ if err != nil {
+ return TLSStat{}, err
+ }
+
+ switch name {
+ case "TlsCurrTxSw":
+ tlsstat.TLSCurrTxSw = value
+ case "TlsCurrRxSw":
+ tlsstat.TLSCurrRxSw = value
+ case "TlsCurrTxDevice":
+ tlsstat.TLSCurrTxDevice = value
+ case "TlsCurrRxDevice":
+ tlsstat.TLSCurrRxDevice = value
+ case "TlsTxSw":
+ tlsstat.TLSTxSw = value
+ case "TlsRxSw":
+ tlsstat.TLSRxSw = value
+ case "TlsTxDevice":
+ tlsstat.TLSTxDevice = value
+ case "TlsRxDevice":
+ tlsstat.TLSRxDevice = value
+ case "TlsDecryptError":
+ tlsstat.TLSDecryptError = value
+ case "TlsRxDeviceResync":
+ tlsstat.TLSRxDeviceResync = value
+ case "TlsDecryptRetry":
+ tlsstat.TLSDecryptRetry = value
+ case "TlsRxNoPadViolation":
+ tlsstat.TLSRxNoPadViolation = value
+ }
+
+ }
+
+ return tlsstat, s.Err()
+}
diff --git a/vendor/github.com/prometheus/procfs/net_unix.go b/vendor/github.com/prometheus/procfs/net_unix.go
index acbbc57e..d868cebd 100644
--- a/vendor/github.com/prometheus/procfs/net_unix.go
+++ b/vendor/github.com/prometheus/procfs/net_unix.go
@@ -108,14 +108,14 @@ func parseNetUNIX(r io.Reader) (*NetUNIX, error) {
line := s.Text()
item, err := nu.parseLine(line, hasInode, minFields)
if err != nil {
- return nil, fmt.Errorf("%s: /proc/net/unix encountered data %q: %w", ErrFileParse, line, err)
+ return nil, fmt.Errorf("%w: /proc/net/unix encountered data %q: %w", ErrFileParse, line, err)
}
nu.Rows = append(nu.Rows, item)
}
if err := s.Err(); err != nil {
- return nil, fmt.Errorf("%s: /proc/net/unix encountered data: %w", ErrFileParse, err)
+ return nil, fmt.Errorf("%w: /proc/net/unix encountered data: %w", ErrFileParse, err)
}
return &nu, nil
@@ -136,29 +136,29 @@ func (u *NetUNIX) parseLine(line string, hasInode bool, min int) (*NetUNIXLine,
users, err := u.parseUsers(fields[1])
if err != nil {
- return nil, fmt.Errorf("%s: ref count %q: %w", ErrFileParse, fields[1], err)
+ return nil, fmt.Errorf("%w: ref count %q: %w", ErrFileParse, fields[1], err)
}
flags, err := u.parseFlags(fields[3])
if err != nil {
- return nil, fmt.Errorf("%s: Unable to parse flags %q: %w", ErrFileParse, fields[3], err)
+ return nil, fmt.Errorf("%w: Unable to parse flags %q: %w", ErrFileParse, fields[3], err)
}
typ, err := u.parseType(fields[4])
if err != nil {
- return nil, fmt.Errorf("%s: Failed to parse type %q: %w", ErrFileParse, fields[4], err)
+ return nil, fmt.Errorf("%w: Failed to parse type %q: %w", ErrFileParse, fields[4], err)
}
state, err := u.parseState(fields[5])
if err != nil {
- return nil, fmt.Errorf("%s: Failed to parse state %q: %w", ErrFileParse, fields[5], err)
+ return nil, fmt.Errorf("%w: Failed to parse state %q: %w", ErrFileParse, fields[5], err)
}
var inode uint64
if hasInode {
inode, err = u.parseInode(fields[6])
if err != nil {
- return nil, fmt.Errorf("%s failed to parse inode %q: %w", ErrFileParse, fields[6], err)
+ return nil, fmt.Errorf("%w failed to parse inode %q: %w", ErrFileParse, fields[6], err)
}
}
diff --git a/vendor/github.com/prometheus/procfs/net_wireless.go b/vendor/github.com/prometheus/procfs/net_wireless.go
index 7443edca..7c597bc8 100644
--- a/vendor/github.com/prometheus/procfs/net_wireless.go
+++ b/vendor/github.com/prometheus/procfs/net_wireless.go
@@ -68,7 +68,7 @@ func (fs FS) Wireless() ([]*Wireless, error) {
m, err := parseWireless(bytes.NewReader(b))
if err != nil {
- return nil, fmt.Errorf("%s: wireless: %w", ErrFileParse, err)
+ return nil, fmt.Errorf("%w: wireless: %w", ErrFileParse, err)
}
return m, nil
@@ -114,47 +114,47 @@ func parseWireless(r io.Reader) ([]*Wireless, error) {
qlink, err := strconv.Atoi(strings.TrimSuffix(stats[1], "."))
if err != nil {
- return nil, fmt.Errorf("%s: parse Quality:link as integer %q: %w", ErrFileParse, qlink, err)
+ return nil, fmt.Errorf("%w: parse Quality:link as integer %q: %w", ErrFileParse, qlink, err)
}
qlevel, err := strconv.Atoi(strings.TrimSuffix(stats[2], "."))
if err != nil {
- return nil, fmt.Errorf("%s: Quality:level as integer %q: %w", ErrFileParse, qlevel, err)
+ return nil, fmt.Errorf("%w: Quality:level as integer %q: %w", ErrFileParse, qlevel, err)
}
qnoise, err := strconv.Atoi(strings.TrimSuffix(stats[3], "."))
if err != nil {
- return nil, fmt.Errorf("%s: Quality:noise as integer %q: %w", ErrFileParse, qnoise, err)
+ return nil, fmt.Errorf("%w: Quality:noise as integer %q: %w", ErrFileParse, qnoise, err)
}
dnwid, err := strconv.Atoi(stats[4])
if err != nil {
- return nil, fmt.Errorf("%s: Discarded:nwid as integer %q: %w", ErrFileParse, dnwid, err)
+ return nil, fmt.Errorf("%w: Discarded:nwid as integer %q: %w", ErrFileParse, dnwid, err)
}
dcrypt, err := strconv.Atoi(stats[5])
if err != nil {
- return nil, fmt.Errorf("%s: Discarded:crypt as integer %q: %w", ErrFileParse, dcrypt, err)
+ return nil, fmt.Errorf("%w: Discarded:crypt as integer %q: %w", ErrFileParse, dcrypt, err)
}
dfrag, err := strconv.Atoi(stats[6])
if err != nil {
- return nil, fmt.Errorf("%s: Discarded:frag as integer %q: %w", ErrFileParse, dfrag, err)
+ return nil, fmt.Errorf("%w: Discarded:frag as integer %q: %w", ErrFileParse, dfrag, err)
}
dretry, err := strconv.Atoi(stats[7])
if err != nil {
- return nil, fmt.Errorf("%s: Discarded:retry as integer %q: %w", ErrFileParse, dretry, err)
+ return nil, fmt.Errorf("%w: Discarded:retry as integer %q: %w", ErrFileParse, dretry, err)
}
dmisc, err := strconv.Atoi(stats[8])
if err != nil {
- return nil, fmt.Errorf("%s: Discarded:misc as integer %q: %w", ErrFileParse, dmisc, err)
+ return nil, fmt.Errorf("%w: Discarded:misc as integer %q: %w", ErrFileParse, dmisc, err)
}
mbeacon, err := strconv.Atoi(stats[9])
if err != nil {
- return nil, fmt.Errorf("%s: Missed:beacon as integer %q: %w", ErrFileParse, mbeacon, err)
+ return nil, fmt.Errorf("%w: Missed:beacon as integer %q: %w", ErrFileParse, mbeacon, err)
}
w := &Wireless{
@@ -175,7 +175,7 @@ func parseWireless(r io.Reader) ([]*Wireless, error) {
}
if err := scanner.Err(); err != nil {
- return nil, fmt.Errorf("%s: Failed to scan /proc/net/wireless: %w", ErrFileRead, err)
+ return nil, fmt.Errorf("%w: Failed to scan /proc/net/wireless: %w", ErrFileRead, err)
}
return interfaces, nil
diff --git a/vendor/github.com/prometheus/procfs/proc.go b/vendor/github.com/prometheus/procfs/proc.go
index d1f71caa..14279636 100644
--- a/vendor/github.com/prometheus/procfs/proc.go
+++ b/vendor/github.com/prometheus/procfs/proc.go
@@ -111,7 +111,7 @@ func (fs FS) AllProcs() (Procs, error) {
names, err := d.Readdirnames(-1)
if err != nil {
- return Procs{}, fmt.Errorf("%s: Cannot read file: %v: %w", ErrFileRead, names, err)
+ return Procs{}, fmt.Errorf("%w: Cannot read file: %v: %w", ErrFileRead, names, err)
}
p := Procs{}
@@ -137,7 +137,7 @@ func (p Proc) CmdLine() ([]string, error) {
return []string{}, nil
}
- return strings.Split(string(bytes.TrimRight(data, string("\x00"))), string(byte(0))), nil
+ return strings.Split(string(bytes.TrimRight(data, "\x00")), "\x00"), nil
}
// Wchan returns the wchan (wait channel) of a process.
@@ -212,7 +212,7 @@ func (p Proc) FileDescriptors() ([]uintptr, error) {
for i, n := range names {
fd, err := strconv.ParseInt(n, 10, 32)
if err != nil {
- return nil, fmt.Errorf("%s: Cannot parse line: %v: %w", ErrFileParse, i, err)
+ return nil, fmt.Errorf("%w: Cannot parse line: %v: %w", ErrFileParse, i, err)
}
fds[i] = uintptr(fd)
}
@@ -297,7 +297,7 @@ func (p Proc) fileDescriptors() ([]string, error) {
names, err := d.Readdirnames(-1)
if err != nil {
- return nil, fmt.Errorf("%s: Cannot read file: %v: %w", ErrFileRead, names, err)
+ return nil, fmt.Errorf("%w: Cannot read file: %v: %w", ErrFileRead, names, err)
}
return names, nil
diff --git a/vendor/github.com/prometheus/procfs/proc_limits.go b/vendor/github.com/prometheus/procfs/proc_limits.go
index c86d815d..9530b14b 100644
--- a/vendor/github.com/prometheus/procfs/proc_limits.go
+++ b/vendor/github.com/prometheus/procfs/proc_limits.go
@@ -154,7 +154,7 @@ func parseUint(s string) (uint64, error) {
}
i, err := strconv.ParseUint(s, 10, 64)
if err != nil {
- return 0, fmt.Errorf("%s: couldn't parse value %q: %w", ErrFileParse, s, err)
+ return 0, fmt.Errorf("%w: couldn't parse value %q: %w", ErrFileParse, s, err)
}
return i, nil
}
diff --git a/vendor/github.com/prometheus/procfs/proc_ns.go b/vendor/github.com/prometheus/procfs/proc_ns.go
index c2266675..0f8f847f 100644
--- a/vendor/github.com/prometheus/procfs/proc_ns.go
+++ b/vendor/github.com/prometheus/procfs/proc_ns.go
@@ -40,7 +40,7 @@ func (p Proc) Namespaces() (Namespaces, error) {
names, err := d.Readdirnames(-1)
if err != nil {
- return nil, fmt.Errorf("%s: failed to read contents of ns dir: %w", ErrFileRead, err)
+ return nil, fmt.Errorf("%w: failed to read contents of ns dir: %w", ErrFileRead, err)
}
ns := make(Namespaces, len(names))
@@ -58,7 +58,7 @@ func (p Proc) Namespaces() (Namespaces, error) {
typ := fields[0]
inode, err := strconv.ParseUint(strings.Trim(fields[1], "[]"), 10, 32)
if err != nil {
- return nil, fmt.Errorf("%s: inode from %q: %w", ErrFileParse, fields[1], err)
+ return nil, fmt.Errorf("%w: inode from %q: %w", ErrFileParse, fields[1], err)
}
ns[name] = Namespace{typ, uint32(inode)}
diff --git a/vendor/github.com/prometheus/procfs/proc_psi.go b/vendor/github.com/prometheus/procfs/proc_psi.go
index fe9dbb42..ccd35f15 100644
--- a/vendor/github.com/prometheus/procfs/proc_psi.go
+++ b/vendor/github.com/prometheus/procfs/proc_psi.go
@@ -61,7 +61,7 @@ type PSIStats struct {
func (fs FS) PSIStatsForResource(resource string) (PSIStats, error) {
data, err := util.ReadFileNoStat(fs.proc.Path(fmt.Sprintf("%s/%s", "pressure", resource)))
if err != nil {
- return PSIStats{}, fmt.Errorf("%s: psi_stats: unavailable for %q: %w", ErrFileRead, resource, err)
+ return PSIStats{}, fmt.Errorf("%w: psi_stats: unavailable for %q: %w", ErrFileRead, resource, err)
}
return parsePSIStats(bytes.NewReader(data))
diff --git a/vendor/github.com/prometheus/procfs/proc_smaps.go b/vendor/github.com/prometheus/procfs/proc_smaps.go
index ad8785a4..09060e82 100644
--- a/vendor/github.com/prometheus/procfs/proc_smaps.go
+++ b/vendor/github.com/prometheus/procfs/proc_smaps.go
@@ -127,7 +127,7 @@ func (s *ProcSMapsRollup) parseLine(line string) error {
}
v := strings.TrimSpace(kv[1])
- v = strings.TrimRight(v, " kB")
+ v = strings.TrimSuffix(v, " kB")
vKBytes, err := strconv.ParseUint(v, 10, 64)
if err != nil {
diff --git a/vendor/github.com/prometheus/procfs/proc_stat.go b/vendor/github.com/prometheus/procfs/proc_stat.go
index 923e5500..06a8d931 100644
--- a/vendor/github.com/prometheus/procfs/proc_stat.go
+++ b/vendor/github.com/prometheus/procfs/proc_stat.go
@@ -110,6 +110,11 @@ type ProcStat struct {
Policy uint
// Aggregated block I/O delays, measured in clock ticks (centiseconds).
DelayAcctBlkIOTicks uint64
+ // Guest time of the process (time spent running a virtual CPU for a guest
+ // operating system), measured in clock ticks.
+ GuestTime int
+ // Guest time of the process's children, measured in clock ticks.
+ CGuestTime int
proc FS
}
@@ -189,6 +194,8 @@ func (p Proc) Stat() (ProcStat, error) {
&s.RTPriority,
&s.Policy,
&s.DelayAcctBlkIOTicks,
+ &s.GuestTime,
+ &s.CGuestTime,
)
if err != nil {
return ProcStat{}, err
diff --git a/vendor/github.com/prometheus/procfs/proc_status.go b/vendor/github.com/prometheus/procfs/proc_status.go
index 46307f57..a055197c 100644
--- a/vendor/github.com/prometheus/procfs/proc_status.go
+++ b/vendor/github.com/prometheus/procfs/proc_status.go
@@ -15,6 +15,7 @@ package procfs
import (
"bytes"
+ "math/bits"
"sort"
"strconv"
"strings"
@@ -76,9 +77,9 @@ type ProcStatus struct {
NonVoluntaryCtxtSwitches uint64
// UIDs of the process (Real, effective, saved set, and filesystem UIDs)
- UIDs [4]string
+ UIDs [4]uint64
// GIDs of the process (Real, effective, saved set, and filesystem GIDs)
- GIDs [4]string
+ GIDs [4]uint64
// CpusAllowedList: List of cpu cores processes are allowed to run on.
CpusAllowedList []uint64
@@ -113,22 +114,37 @@ func (p Proc) NewStatus() (ProcStatus, error) {
// convert kB to B
vBytes := vKBytes * 1024
- s.fillStatus(k, v, vKBytes, vBytes)
+ err = s.fillStatus(k, v, vKBytes, vBytes)
+ if err != nil {
+ return ProcStatus{}, err
+ }
}
return s, nil
}
-func (s *ProcStatus) fillStatus(k string, vString string, vUint uint64, vUintBytes uint64) {
+func (s *ProcStatus) fillStatus(k string, vString string, vUint uint64, vUintBytes uint64) error {
switch k {
case "Tgid":
s.TGID = int(vUint)
case "Name":
s.Name = vString
case "Uid":
- copy(s.UIDs[:], strings.Split(vString, "\t"))
+ var err error
+ for i, v := range strings.Split(vString, "\t") {
+ s.UIDs[i], err = strconv.ParseUint(v, 10, bits.UintSize)
+ if err != nil {
+ return err
+ }
+ }
case "Gid":
- copy(s.GIDs[:], strings.Split(vString, "\t"))
+ var err error
+ for i, v := range strings.Split(vString, "\t") {
+ s.GIDs[i], err = strconv.ParseUint(v, 10, bits.UintSize)
+ if err != nil {
+ return err
+ }
+ }
case "NSpid":
s.NSpids = calcNSPidsList(vString)
case "VmPeak":
@@ -173,6 +189,7 @@ func (s *ProcStatus) fillStatus(k string, vString string, vUint uint64, vUintByt
s.CpusAllowedList = calcCpusAllowedList(vString)
}
+ return nil
}
// TotalCtxtSwitches returns the total context switch.
diff --git a/vendor/github.com/prometheus/procfs/proc_sys.go b/vendor/github.com/prometheus/procfs/proc_sys.go
index 12c5bf05..5eefbe2e 100644
--- a/vendor/github.com/prometheus/procfs/proc_sys.go
+++ b/vendor/github.com/prometheus/procfs/proc_sys.go
@@ -44,7 +44,7 @@ func (fs FS) SysctlInts(sysctl string) ([]int, error) {
vp := util.NewValueParser(f)
values[i] = vp.Int()
if err := vp.Err(); err != nil {
- return nil, fmt.Errorf("%s: field %d in sysctl %s is not a valid int: %w", ErrFileParse, i, sysctl, err)
+ return nil, fmt.Errorf("%w: field %d in sysctl %s is not a valid int: %w", ErrFileParse, i, sysctl, err)
}
}
return values, nil
diff --git a/vendor/github.com/prometheus/procfs/softirqs.go b/vendor/github.com/prometheus/procfs/softirqs.go
index b8fad677..28708e07 100644
--- a/vendor/github.com/prometheus/procfs/softirqs.go
+++ b/vendor/github.com/prometheus/procfs/softirqs.go
@@ -74,7 +74,7 @@ func parseSoftirqs(r io.Reader) (Softirqs, error) {
softirqs.Hi = make([]uint64, len(perCPU))
for i, count := range perCPU {
if softirqs.Hi[i], err = strconv.ParseUint(count, 10, 64); err != nil {
- return Softirqs{}, fmt.Errorf("%s: couldn't parse %q (HI%d): %w", ErrFileParse, count, i, err)
+ return Softirqs{}, fmt.Errorf("%w: couldn't parse %q (HI%d): %w", ErrFileParse, count, i, err)
}
}
case parts[0] == "TIMER:":
@@ -82,7 +82,7 @@ func parseSoftirqs(r io.Reader) (Softirqs, error) {
softirqs.Timer = make([]uint64, len(perCPU))
for i, count := range perCPU {
if softirqs.Timer[i], err = strconv.ParseUint(count, 10, 64); err != nil {
- return Softirqs{}, fmt.Errorf("%s: couldn't parse %q (TIMER%d): %w", ErrFileParse, count, i, err)
+ return Softirqs{}, fmt.Errorf("%w: couldn't parse %q (TIMER%d): %w", ErrFileParse, count, i, err)
}
}
case parts[0] == "NET_TX:":
@@ -90,7 +90,7 @@ func parseSoftirqs(r io.Reader) (Softirqs, error) {
softirqs.NetTx = make([]uint64, len(perCPU))
for i, count := range perCPU {
if softirqs.NetTx[i], err = strconv.ParseUint(count, 10, 64); err != nil {
- return Softirqs{}, fmt.Errorf("%s: couldn't parse %q (NET_TX%d): %w", ErrFileParse, count, i, err)
+ return Softirqs{}, fmt.Errorf("%w: couldn't parse %q (NET_TX%d): %w", ErrFileParse, count, i, err)
}
}
case parts[0] == "NET_RX:":
@@ -98,7 +98,7 @@ func parseSoftirqs(r io.Reader) (Softirqs, error) {
softirqs.NetRx = make([]uint64, len(perCPU))
for i, count := range perCPU {
if softirqs.NetRx[i], err = strconv.ParseUint(count, 10, 64); err != nil {
- return Softirqs{}, fmt.Errorf("%s: couldn't parse %q (NET_RX%d): %w", ErrFileParse, count, i, err)
+ return Softirqs{}, fmt.Errorf("%w: couldn't parse %q (NET_RX%d): %w", ErrFileParse, count, i, err)
}
}
case parts[0] == "BLOCK:":
@@ -106,7 +106,7 @@ func parseSoftirqs(r io.Reader) (Softirqs, error) {
softirqs.Block = make([]uint64, len(perCPU))
for i, count := range perCPU {
if softirqs.Block[i], err = strconv.ParseUint(count, 10, 64); err != nil {
- return Softirqs{}, fmt.Errorf("%s: couldn't parse %q (BLOCK%d): %w", ErrFileParse, count, i, err)
+ return Softirqs{}, fmt.Errorf("%w: couldn't parse %q (BLOCK%d): %w", ErrFileParse, count, i, err)
}
}
case parts[0] == "IRQ_POLL:":
@@ -114,7 +114,7 @@ func parseSoftirqs(r io.Reader) (Softirqs, error) {
softirqs.IRQPoll = make([]uint64, len(perCPU))
for i, count := range perCPU {
if softirqs.IRQPoll[i], err = strconv.ParseUint(count, 10, 64); err != nil {
- return Softirqs{}, fmt.Errorf("%s: couldn't parse %q (IRQ_POLL%d): %w", ErrFileParse, count, i, err)
+ return Softirqs{}, fmt.Errorf("%w: couldn't parse %q (IRQ_POLL%d): %w", ErrFileParse, count, i, err)
}
}
case parts[0] == "TASKLET:":
@@ -122,7 +122,7 @@ func parseSoftirqs(r io.Reader) (Softirqs, error) {
softirqs.Tasklet = make([]uint64, len(perCPU))
for i, count := range perCPU {
if softirqs.Tasklet[i], err = strconv.ParseUint(count, 10, 64); err != nil {
- return Softirqs{}, fmt.Errorf("%s: couldn't parse %q (TASKLET%d): %w", ErrFileParse, count, i, err)
+ return Softirqs{}, fmt.Errorf("%w: couldn't parse %q (TASKLET%d): %w", ErrFileParse, count, i, err)
}
}
case parts[0] == "SCHED:":
@@ -130,7 +130,7 @@ func parseSoftirqs(r io.Reader) (Softirqs, error) {
softirqs.Sched = make([]uint64, len(perCPU))
for i, count := range perCPU {
if softirqs.Sched[i], err = strconv.ParseUint(count, 10, 64); err != nil {
- return Softirqs{}, fmt.Errorf("%s: couldn't parse %q (SCHED%d): %w", ErrFileParse, count, i, err)
+ return Softirqs{}, fmt.Errorf("%w: couldn't parse %q (SCHED%d): %w", ErrFileParse, count, i, err)
}
}
case parts[0] == "HRTIMER:":
@@ -138,7 +138,7 @@ func parseSoftirqs(r io.Reader) (Softirqs, error) {
softirqs.HRTimer = make([]uint64, len(perCPU))
for i, count := range perCPU {
if softirqs.HRTimer[i], err = strconv.ParseUint(count, 10, 64); err != nil {
- return Softirqs{}, fmt.Errorf("%s: couldn't parse %q (HRTIMER%d): %w", ErrFileParse, count, i, err)
+ return Softirqs{}, fmt.Errorf("%w: couldn't parse %q (HRTIMER%d): %w", ErrFileParse, count, i, err)
}
}
case parts[0] == "RCU:":
@@ -146,14 +146,14 @@ func parseSoftirqs(r io.Reader) (Softirqs, error) {
softirqs.RCU = make([]uint64, len(perCPU))
for i, count := range perCPU {
if softirqs.RCU[i], err = strconv.ParseUint(count, 10, 64); err != nil {
- return Softirqs{}, fmt.Errorf("%s: couldn't parse %q (RCU%d): %w", ErrFileParse, count, i, err)
+ return Softirqs{}, fmt.Errorf("%w: couldn't parse %q (RCU%d): %w", ErrFileParse, count, i, err)
}
}
}
}
if err := scanner.Err(); err != nil {
- return Softirqs{}, fmt.Errorf("%s: couldn't parse softirqs: %w", ErrFileParse, err)
+ return Softirqs{}, fmt.Errorf("%w: couldn't parse softirqs: %w", ErrFileParse, err)
}
return softirqs, scanner.Err()
diff --git a/vendor/github.com/prometheus/procfs/stat.go b/vendor/github.com/prometheus/procfs/stat.go
index 34fc3ee2..e36b41c1 100644
--- a/vendor/github.com/prometheus/procfs/stat.go
+++ b/vendor/github.com/prometheus/procfs/stat.go
@@ -93,7 +93,7 @@ func parseCPUStat(line string) (CPUStat, int64, error) {
&cpuStat.Guest, &cpuStat.GuestNice)
if err != nil && err != io.EOF {
- return CPUStat{}, -1, fmt.Errorf("%s: couldn't parse %q (cpu): %w", ErrFileParse, line, err)
+ return CPUStat{}, -1, fmt.Errorf("%w: couldn't parse %q (cpu): %w", ErrFileParse, line, err)
}
if count == 0 {
return CPUStat{}, -1, fmt.Errorf("%w: couldn't parse %q (cpu): 0 elements parsed", ErrFileParse, line)
@@ -116,7 +116,7 @@ func parseCPUStat(line string) (CPUStat, int64, error) {
cpuID, err := strconv.ParseInt(cpu[3:], 10, 64)
if err != nil {
- return CPUStat{}, -1, fmt.Errorf("%s: couldn't parse %q (cpu/cpuid): %w", ErrFileParse, line, err)
+ return CPUStat{}, -1, fmt.Errorf("%w: couldn't parse %q (cpu/cpuid): %w", ErrFileParse, line, err)
}
return cpuStat, cpuID, nil
@@ -136,7 +136,7 @@ func parseSoftIRQStat(line string) (SoftIRQStat, uint64, error) {
&softIRQStat.Hrtimer, &softIRQStat.Rcu)
if err != nil {
- return SoftIRQStat{}, 0, fmt.Errorf("%s: couldn't parse %q (softirq): %w", ErrFileParse, line, err)
+ return SoftIRQStat{}, 0, fmt.Errorf("%w: couldn't parse %q (softirq): %w", ErrFileParse, line, err)
}
return softIRQStat, total, nil
@@ -201,34 +201,34 @@ func parseStat(r io.Reader, fileName string) (Stat, error) {
switch {
case parts[0] == "btime":
if stat.BootTime, err = strconv.ParseUint(parts[1], 10, 64); err != nil {
- return Stat{}, fmt.Errorf("%s: couldn't parse %q (btime): %w", ErrFileParse, parts[1], err)
+ return Stat{}, fmt.Errorf("%w: couldn't parse %q (btime): %w", ErrFileParse, parts[1], err)
}
case parts[0] == "intr":
if stat.IRQTotal, err = strconv.ParseUint(parts[1], 10, 64); err != nil {
- return Stat{}, fmt.Errorf("%s: couldn't parse %q (intr): %w", ErrFileParse, parts[1], err)
+ return Stat{}, fmt.Errorf("%w: couldn't parse %q (intr): %w", ErrFileParse, parts[1], err)
}
numberedIRQs := parts[2:]
stat.IRQ = make([]uint64, len(numberedIRQs))
for i, count := range numberedIRQs {
if stat.IRQ[i], err = strconv.ParseUint(count, 10, 64); err != nil {
- return Stat{}, fmt.Errorf("%s: couldn't parse %q (intr%d): %w", ErrFileParse, count, i, err)
+ return Stat{}, fmt.Errorf("%w: couldn't parse %q (intr%d): %w", ErrFileParse, count, i, err)
}
}
case parts[0] == "ctxt":
if stat.ContextSwitches, err = strconv.ParseUint(parts[1], 10, 64); err != nil {
- return Stat{}, fmt.Errorf("%s: couldn't parse %q (ctxt): %w", ErrFileParse, parts[1], err)
+ return Stat{}, fmt.Errorf("%w: couldn't parse %q (ctxt): %w", ErrFileParse, parts[1], err)
}
case parts[0] == "processes":
if stat.ProcessCreated, err = strconv.ParseUint(parts[1], 10, 64); err != nil {
- return Stat{}, fmt.Errorf("%s: couldn't parse %q (processes): %w", ErrFileParse, parts[1], err)
+ return Stat{}, fmt.Errorf("%w: couldn't parse %q (processes): %w", ErrFileParse, parts[1], err)
}
case parts[0] == "procs_running":
if stat.ProcessesRunning, err = strconv.ParseUint(parts[1], 10, 64); err != nil {
- return Stat{}, fmt.Errorf("%s: couldn't parse %q (procs_running): %w", ErrFileParse, parts[1], err)
+ return Stat{}, fmt.Errorf("%w: couldn't parse %q (procs_running): %w", ErrFileParse, parts[1], err)
}
case parts[0] == "procs_blocked":
if stat.ProcessesBlocked, err = strconv.ParseUint(parts[1], 10, 64); err != nil {
- return Stat{}, fmt.Errorf("%s: couldn't parse %q (procs_blocked): %w", ErrFileParse, parts[1], err)
+ return Stat{}, fmt.Errorf("%w: couldn't parse %q (procs_blocked): %w", ErrFileParse, parts[1], err)
}
case parts[0] == "softirq":
softIRQStats, total, err := parseSoftIRQStat(line)
@@ -251,7 +251,7 @@ func parseStat(r io.Reader, fileName string) (Stat, error) {
}
if err := scanner.Err(); err != nil {
- return Stat{}, fmt.Errorf("%s: couldn't parse %q: %w", ErrFileParse, fileName, err)
+ return Stat{}, fmt.Errorf("%w: couldn't parse %q: %w", ErrFileParse, fileName, err)
}
return stat, nil
diff --git a/vendor/github.com/prometheus/procfs/swaps.go b/vendor/github.com/prometheus/procfs/swaps.go
index fa00f555..65fec834 100644
--- a/vendor/github.com/prometheus/procfs/swaps.go
+++ b/vendor/github.com/prometheus/procfs/swaps.go
@@ -74,15 +74,15 @@ func parseSwapString(swapString string) (*Swap, error) {
swap.Size, err = strconv.Atoi(swapFields[2])
if err != nil {
- return nil, fmt.Errorf("%s: invalid swap size: %s: %w", ErrFileParse, swapFields[2], err)
+ return nil, fmt.Errorf("%w: invalid swap size: %s: %w", ErrFileParse, swapFields[2], err)
}
swap.Used, err = strconv.Atoi(swapFields[3])
if err != nil {
- return nil, fmt.Errorf("%s: invalid swap used: %s: %w", ErrFileParse, swapFields[3], err)
+ return nil, fmt.Errorf("%w: invalid swap used: %s: %w", ErrFileParse, swapFields[3], err)
}
swap.Priority, err = strconv.Atoi(swapFields[4])
if err != nil {
- return nil, fmt.Errorf("%s: invalid swap priority: %s: %w", ErrFileParse, swapFields[4], err)
+ return nil, fmt.Errorf("%w: invalid swap priority: %s: %w", ErrFileParse, swapFields[4], err)
}
return swap, nil
diff --git a/vendor/github.com/prometheus/procfs/thread.go b/vendor/github.com/prometheus/procfs/thread.go
index df2215ec..80e0e947 100644
--- a/vendor/github.com/prometheus/procfs/thread.go
+++ b/vendor/github.com/prometheus/procfs/thread.go
@@ -45,7 +45,7 @@ func (fs FS) AllThreads(pid int) (Procs, error) {
names, err := d.Readdirnames(-1)
if err != nil {
- return Procs{}, fmt.Errorf("%s: could not read %q: %w", ErrFileRead, d.Name(), err)
+ return Procs{}, fmt.Errorf("%w: could not read %q: %w", ErrFileRead, d.Name(), err)
}
t := Procs{}
diff --git a/vendor/github.com/prometheus/procfs/zoneinfo.go b/vendor/github.com/prometheus/procfs/zoneinfo.go
index ce5fefa5..e54d94b0 100644
--- a/vendor/github.com/prometheus/procfs/zoneinfo.go
+++ b/vendor/github.com/prometheus/procfs/zoneinfo.go
@@ -75,11 +75,11 @@ var nodeZoneRE = regexp.MustCompile(`(\d+), zone\s+(\w+)`)
func (fs FS) Zoneinfo() ([]Zoneinfo, error) {
data, err := os.ReadFile(fs.proc.Path("zoneinfo"))
if err != nil {
- return nil, fmt.Errorf("%s: error reading zoneinfo %q: %w", ErrFileRead, fs.proc.Path("zoneinfo"), err)
+ return nil, fmt.Errorf("%w: error reading zoneinfo %q: %w", ErrFileRead, fs.proc.Path("zoneinfo"), err)
}
zoneinfo, err := parseZoneinfo(data)
if err != nil {
- return nil, fmt.Errorf("%s: error parsing zoneinfo %q: %w", ErrFileParse, fs.proc.Path("zoneinfo"), err)
+ return nil, fmt.Errorf("%w: error parsing zoneinfo %q: %w", ErrFileParse, fs.proc.Path("zoneinfo"), err)
}
return zoneinfo, nil
}
diff --git a/vendor/github.com/scaleway/scaleway-sdk-go/api/block/v1alpha1/block_sdk.go b/vendor/github.com/scaleway/scaleway-sdk-go/api/block/v1alpha1/block_sdk.go
index bb1873c0..0cb6c8da 100644
--- a/vendor/github.com/scaleway/scaleway-sdk-go/api/block/v1alpha1/block_sdk.go
+++ b/vendor/github.com/scaleway/scaleway-sdk-go/api/block/v1alpha1/block_sdk.go
@@ -60,6 +60,15 @@ func (enum ListSnapshotsRequestOrderBy) String() string {
return string(enum)
}
+func (enum ListSnapshotsRequestOrderBy) Values() []ListSnapshotsRequestOrderBy {
+ return []ListSnapshotsRequestOrderBy{
+ "created_at_asc",
+ "created_at_desc",
+ "name_asc",
+ "name_desc",
+ }
+}
+
func (enum ListSnapshotsRequestOrderBy) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
@@ -96,6 +105,15 @@ func (enum ListVolumesRequestOrderBy) String() string {
return string(enum)
}
+func (enum ListVolumesRequestOrderBy) Values() []ListVolumesRequestOrderBy {
+ return []ListVolumesRequestOrderBy{
+ "created_at_asc",
+ "created_at_desc",
+ "name_asc",
+ "name_desc",
+ }
+}
+
func (enum ListVolumesRequestOrderBy) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
@@ -124,8 +142,8 @@ const (
ReferenceStatusDetaching = ReferenceStatus("detaching")
// When the reference is detached from a volume - the reference ceases to exist.
ReferenceStatusDetached = ReferenceStatus("detached")
- // Reference undergoing snapshotting operation (transient).
- ReferenceStatusSnapshotting = ReferenceStatus("snapshotting")
+ // Reference under creation which can be rolled back if an error occurs (transient).
+ ReferenceStatusCreating = ReferenceStatus("creating")
// Error status.
ReferenceStatusError = ReferenceStatus("error")
)
@@ -138,6 +156,18 @@ func (enum ReferenceStatus) String() string {
return string(enum)
}
+func (enum ReferenceStatus) Values() []ReferenceStatus {
+ return []ReferenceStatus{
+ "unknown_status",
+ "attaching",
+ "attached",
+ "detaching",
+ "detached",
+ "creating",
+ "error",
+ }
+}
+
func (enum ReferenceStatus) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
@@ -174,6 +204,15 @@ func (enum ReferenceType) String() string {
return string(enum)
}
+func (enum ReferenceType) Values() []ReferenceType {
+ return []ReferenceType{
+ "unknown_type",
+ "link",
+ "exclusive",
+ "read_only",
+ }
+}
+
func (enum ReferenceType) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
@@ -205,8 +244,9 @@ const (
// Snapshot was deleted.
SnapshotStatusDeleted = SnapshotStatus("deleted")
// Snapshot attached to one or more references.
- SnapshotStatusInUse = SnapshotStatus("in_use")
- SnapshotStatusLocked = SnapshotStatus("locked")
+ SnapshotStatusInUse = SnapshotStatus("in_use")
+ SnapshotStatusLocked = SnapshotStatus("locked")
+ SnapshotStatusExporting = SnapshotStatus("exporting")
)
func (enum SnapshotStatus) String() string {
@@ -217,6 +257,20 @@ func (enum SnapshotStatus) String() string {
return string(enum)
}
+func (enum SnapshotStatus) Values() []SnapshotStatus {
+ return []SnapshotStatus{
+ "unknown_status",
+ "creating",
+ "available",
+ "error",
+ "deleting",
+ "deleted",
+ "in_use",
+ "locked",
+ "exporting",
+ }
+}
+
func (enum SnapshotStatus) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
@@ -253,6 +307,15 @@ func (enum StorageClass) String() string {
return string(enum)
}
+func (enum StorageClass) Values() []StorageClass {
+ return []StorageClass{
+ "unknown_storage_class",
+ "unspecified",
+ "bssd",
+ "sbs",
+ }
+}
+
func (enum StorageClass) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
@@ -289,6 +352,8 @@ const (
// The volume is undergoing snapshotting operation (transient).
VolumeStatusSnapshotting = VolumeStatus("snapshotting")
VolumeStatusLocked = VolumeStatus("locked")
+ // The volume is being updated (transient).
+ VolumeStatusUpdating = VolumeStatus("updating")
)
func (enum VolumeStatus) String() string {
@@ -299,6 +364,22 @@ func (enum VolumeStatus) String() string {
return string(enum)
}
+func (enum VolumeStatus) Values() []VolumeStatus {
+ return []VolumeStatus{
+ "unknown_status",
+ "creating",
+ "available",
+ "in_use",
+ "deleting",
+ "deleted",
+ "resizing",
+ "error",
+ "snapshotting",
+ "locked",
+ "updating",
+ }
+}
+
func (enum VolumeStatus) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
@@ -314,6 +395,29 @@ func (enum *VolumeStatus) UnmarshalJSON(data []byte) error {
return nil
}
+// Reference: reference.
+type Reference struct {
+ // ID: UUID of the reference.
+ ID string `json:"id"`
+
+ // ProductResourceType: type of resource to which the reference is associated.
+ ProductResourceType string `json:"product_resource_type"`
+
+ // ProductResourceID: UUID of the product resource it refers to (according to the product_resource_type).
+ ProductResourceID string `json:"product_resource_id"`
+
+ // CreatedAt: creation date of the reference.
+ CreatedAt *time.Time `json:"created_at"`
+
+ // Type: type of reference (link, exclusive, read_only).
+ // Default value: unknown_type
+ Type ReferenceType `json:"type"`
+
+ // Status: status of the reference. Statuses include `attaching`, `attached`, and `detaching`.
+ // Default value: unknown_status
+ Status ReferenceStatus `json:"status"`
+}
+
// SnapshotParentVolume: snapshot parent volume.
type SnapshotParentVolume struct {
// ID: parent volume UUID (volume from which the snapshot originates).
@@ -340,29 +444,6 @@ type VolumeSpecifications struct {
Class StorageClass `json:"class"`
}
-// Reference: reference.
-type Reference struct {
- // ID: UUID of the reference.
- ID string `json:"id"`
-
- // ProductResourceType: type of resource to which the reference is associated.
- ProductResourceType string `json:"product_resource_type"`
-
- // ProductResourceID: UUID of the product resource it refers to (according to the product_resource_type).
- ProductResourceID string `json:"product_resource_id"`
-
- // CreatedAt: creation date of the reference.
- CreatedAt *time.Time `json:"created_at"`
-
- // Type: type of reference (link, exclusive, read_only).
- // Default value: unknown_type
- Type ReferenceType `json:"type"`
-
- // Status: status of reference (attaching, attached, detaching).
- // Default value: unknown_status
- Status ReferenceStatus `json:"status"`
-}
-
// CreateVolumeRequestFromEmpty: create volume request from empty.
type CreateVolumeRequestFromEmpty struct {
// Size: must be compliant with the minimum (1 GB) and maximum (10 TB) allowed size.
@@ -379,18 +460,18 @@ type CreateVolumeRequestFromSnapshot struct {
SnapshotID string `json:"snapshot_id"`
}
-// SnapshotSummary: snapshot summary.
-type SnapshotSummary struct {
+// Snapshot: snapshot.
+type Snapshot struct {
// ID: UUID of the snapshot.
ID string `json:"id"`
// Name: name of the snapshot.
Name string `json:"name"`
- // ParentVolume: if the parent volume has been deleted, value is null.
+ // ParentVolume: if the parent volume was deleted, value is null.
ParentVolume *SnapshotParentVolume `json:"parent_volume"`
- // Size: size of the snapshot in bytes.
+ // Size: size in bytes of the snapshot.
Size scw.Size `json:"size"`
// ProjectID: UUID of the project the snapshot belongs to.
@@ -402,6 +483,9 @@ type SnapshotSummary struct {
// UpdatedAt: last modification date of the properties of a snapshot.
UpdatedAt *time.Time `json:"updated_at"`
+ // References: list of the references to the snapshot.
+ References []*Reference `json:"references"`
+
// Status: current status of the snapshot (available, in_use, ...).
// Default value: unknown_status
Status SnapshotStatus `json:"status"`
@@ -409,7 +493,7 @@ type SnapshotSummary struct {
// Tags: list of tags assigned to the volume.
Tags []string `json:"tags"`
- // Zone: snapshot Availability Zone.
+ // Zone: snapshot zone.
Zone scw.Zone `json:"zone"`
// Class: storage class of the snapshot.
@@ -541,6 +625,21 @@ type DeleteVolumeRequest struct {
VolumeID string `json:"-"`
}
+// ExportSnapshotToObjectStorageRequest: export snapshot to object storage request.
+type ExportSnapshotToObjectStorageRequest struct {
+ // Zone: zone to target. If none is passed will use default zone from the config.
+ Zone scw.Zone `json:"-"`
+
+ // SnapshotID: UUID of the snapshot.
+ SnapshotID string `json:"-"`
+
+ // Bucket: scaleway Object Storage bucket where the object is stored.
+ Bucket string `json:"bucket"`
+
+ // Key: the object key inside the given bucket.
+ Key string `json:"key"`
+}
+
// GetSnapshotRequest: get snapshot request.
type GetSnapshotRequest struct {
// Zone: zone to target. If none is passed will use default zone from the config.
@@ -559,21 +658,51 @@ type GetVolumeRequest struct {
VolumeID string `json:"-"`
}
+// ImportSnapshotFromObjectStorageRequest: import snapshot from object storage request.
+type ImportSnapshotFromObjectStorageRequest struct {
+ // Zone: zone to target. If none is passed will use default zone from the config.
+ Zone scw.Zone `json:"-"`
+
+ // Bucket: scaleway Object Storage bucket where the object is stored.
+ Bucket string `json:"bucket"`
+
+ // Key: the object key inside the given bucket.
+ Key string `json:"key"`
+
+ // Name: name of the snapshot.
+ Name string `json:"name"`
+
+ // ProjectID: UUID of the Project to which the volume and the snapshot belong.
+ ProjectID string `json:"project_id"`
+
+ // Tags: list of tags assigned to the snapshot.
+ Tags []string `json:"tags"`
+
+ // Size: size of the snapshot.
+ Size *scw.Size `json:"size,omitempty"`
+}
+
// ImportSnapshotFromS3Request: import snapshot from s3 request.
type ImportSnapshotFromS3Request struct {
// Zone: zone to target. If none is passed will use default zone from the config.
Zone scw.Zone `json:"-"`
+ // Bucket: scaleway Object Storage bucket where the object is stored.
Bucket string `json:"bucket"`
+ // Key: the object key inside the given bucket.
Key string `json:"key"`
+ // Name: name of the snapshot.
Name string `json:"name"`
+ // ProjectID: UUID of the Project to which the volume and the snapshot belong.
ProjectID string `json:"project_id"`
+ // Tags: list of tags assigned to the snapshot.
Tags []string `json:"tags"`
+ // Size: size of the snapshot.
Size *scw.Size `json:"size,omitempty"`
}
@@ -608,7 +737,7 @@ type ListSnapshotsRequest struct {
// ListSnapshotsResponse: list snapshots response.
type ListSnapshotsResponse struct {
// Snapshots: paginated returned list of snapshots.
- Snapshots []*SnapshotSummary `json:"snapshots"`
+ Snapshots []*Snapshot `json:"snapshots"`
// TotalCount: total number of snpashots in the project.
TotalCount uint64 `json:"total_count"`
@@ -729,47 +858,6 @@ func (r *ListVolumesResponse) UnsafeAppend(res interface{}) (uint64, error) {
return uint64(len(results.Volumes)), nil
}
-// Snapshot: snapshot.
-type Snapshot struct {
- // ID: UUID of the snapshot.
- ID string `json:"id"`
-
- // Name: name of the snapshot.
- Name string `json:"name"`
-
- // ParentVolume: if the parent volume was deleted, value is null.
- ParentVolume *SnapshotParentVolume `json:"parent_volume"`
-
- // Size: size in bytes of the snapshot.
- Size scw.Size `json:"size"`
-
- // ProjectID: UUID of the project the snapshot belongs to.
- ProjectID string `json:"project_id"`
-
- // CreatedAt: creation date of the snapshot.
- CreatedAt *time.Time `json:"created_at"`
-
- // UpdatedAt: last modification date of the properties of a snapshot.
- UpdatedAt *time.Time `json:"updated_at"`
-
- // References: list of the references to the snapshot.
- References []*Reference `json:"references"`
-
- // Status: current status of the snapshot (available, in_use, ...).
- // Default value: unknown_status
- Status SnapshotStatus `json:"status"`
-
- // Tags: list of tags assigned to the volume.
- Tags []string `json:"tags"`
-
- // Zone: snapshot zone.
- Zone scw.Zone `json:"zone"`
-
- // Class: storage class of the snapshot.
- // Default value: unknown_storage_class
- Class StorageClass `json:"class"`
-}
-
// UpdateSnapshotRequest: update snapshot request.
type UpdateSnapshotRequest struct {
// Zone: zone to target. If none is passed will use default zone from the config.
@@ -807,7 +895,7 @@ type UpdateVolumeRequest struct {
PerfIops *uint32 `json:"perf_iops,omitempty"`
}
-// This API allows you to use and manage your Block Storage volumes.
+// This API allows you to manage your Block Storage volumes.
type API struct {
client *scw.Client
}
@@ -819,7 +907,7 @@ func NewAPI(client *scw.Client) *API {
}
}
func (s *API) Zones() []scw.Zone {
- return []scw.Zone{scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZoneNlAms3, scw.ZonePlWaw3}
+ return []scw.Zone{scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZoneNlAms2, scw.ZoneNlAms3, scw.ZonePlWaw3}
}
// ListVolumeTypes: List all available volume types in a specified zone. The volume types listed are ordered by name in ascending order.
@@ -1147,7 +1235,9 @@ func (s *API) CreateSnapshot(req *CreateSnapshotRequest, opts ...scw.RequestOpti
return &resp, nil
}
-// ImportSnapshotFromS3:
+// Deprecated: ImportSnapshotFromS3: Import a snapshot from a Scaleway Object Storage bucket
+// The bucket must contain a QCOW2 image.
+// The bucket can be imported into any Availability Zone as long as it is in the same region as the bucket.
func (s *API) ImportSnapshotFromS3(req *ImportSnapshotFromS3Request, opts ...scw.RequestOption) (*Snapshot, error) {
var err error
@@ -1184,6 +1274,81 @@ func (s *API) ImportSnapshotFromS3(req *ImportSnapshotFromS3Request, opts ...scw
return &resp, nil
}
+// ImportSnapshotFromObjectStorage: The bucket must contain a QCOW2 image.
+// The bucket can be imported into any Availability Zone as long as it is in the same region as the bucket.
+func (s *API) ImportSnapshotFromObjectStorage(req *ImportSnapshotFromObjectStorageRequest, opts ...scw.RequestOption) (*Snapshot, error) {
+ var err error
+
+ if req.Zone == "" {
+ defaultZone, _ := s.client.GetDefaultZone()
+ req.Zone = defaultZone
+ }
+
+ if req.ProjectID == "" {
+ defaultProjectID, _ := s.client.GetDefaultProjectID()
+ req.ProjectID = defaultProjectID
+ }
+
+ if fmt.Sprint(req.Zone) == "" {
+ return nil, errors.New("field Zone cannot be empty in request")
+ }
+
+ scwReq := &scw.ScalewayRequest{
+ Method: "POST",
+ Path: "/block/v1alpha1/zones/" + fmt.Sprint(req.Zone) + "/snapshots/import-from-object-storage",
+ }
+
+ err = scwReq.SetBody(req)
+ if err != nil {
+ return nil, err
+ }
+
+ var resp Snapshot
+
+ err = s.client.Do(scwReq, &resp, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return &resp, nil
+}
+
+// ExportSnapshotToObjectStorage: The snapshot is exported in QCOW2 format.
+// The snapshot must not be in transient state.
+func (s *API) ExportSnapshotToObjectStorage(req *ExportSnapshotToObjectStorageRequest, opts ...scw.RequestOption) (*Snapshot, error) {
+ var err error
+
+ if req.Zone == "" {
+ defaultZone, _ := s.client.GetDefaultZone()
+ req.Zone = defaultZone
+ }
+
+ if fmt.Sprint(req.Zone) == "" {
+ return nil, errors.New("field Zone cannot be empty in request")
+ }
+
+ if fmt.Sprint(req.SnapshotID) == "" {
+ return nil, errors.New("field SnapshotID cannot be empty in request")
+ }
+
+ scwReq := &scw.ScalewayRequest{
+ Method: "POST",
+ Path: "/block/v1alpha1/zones/" + fmt.Sprint(req.Zone) + "/snapshots/" + fmt.Sprint(req.SnapshotID) + "/export-to-object-storage",
+ }
+
+ err = scwReq.SetBody(req)
+ if err != nil {
+ return nil, err
+ }
+
+ var resp Snapshot
+
+ err = s.client.Do(scwReq, &resp, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return &resp, nil
+}
+
// DeleteSnapshot: You must specify the `snapshot_id` of the snapshot you want to delete. The snapshot must not be in use.
func (s *API) DeleteSnapshot(req *DeleteSnapshotRequest, opts ...scw.RequestOption) error {
var err error
diff --git a/vendor/github.com/scaleway/scaleway-sdk-go/api/block/v1alpha1/snapshot_utils.go b/vendor/github.com/scaleway/scaleway-sdk-go/api/block/v1alpha1/snapshot_utils.go
index d16f6114..8d7c58aa 100644
--- a/vendor/github.com/scaleway/scaleway-sdk-go/api/block/v1alpha1/snapshot_utils.go
+++ b/vendor/github.com/scaleway/scaleway-sdk-go/api/block/v1alpha1/snapshot_utils.go
@@ -41,7 +41,6 @@ func (s *API) WaitForSnapshot(req *WaitForSnapshotRequest, opts ...scw.RequestOp
SnapshotID: req.SnapshotID,
Zone: req.Zone,
}, opts...)
-
if err != nil {
return nil, false, err
}
diff --git a/vendor/github.com/scaleway/scaleway-sdk-go/api/block/v1alpha1/volume_utils.go b/vendor/github.com/scaleway/scaleway-sdk-go/api/block/v1alpha1/volume_utils.go
index 229b4111..c32937f8 100644
--- a/vendor/github.com/scaleway/scaleway-sdk-go/api/block/v1alpha1/volume_utils.go
+++ b/vendor/github.com/scaleway/scaleway-sdk-go/api/block/v1alpha1/volume_utils.go
@@ -56,7 +56,6 @@ func (s *API) WaitForVolume(req *WaitForVolumeRequest, opts ...scw.RequestOption
VolumeID: req.VolumeID,
Zone: req.Zone,
}, opts...)
-
if err != nil {
return nil, false, err
}
diff --git a/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/image_utils.go b/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/image_utils.go
index 99538fdf..343d92d9 100644
--- a/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/image_utils.go
+++ b/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/image_utils.go
@@ -38,7 +38,6 @@ func (s *API) WaitForImage(req *WaitForImageRequest, opts ...scw.RequestOption)
ImageID: req.ImageID,
Zone: req.Zone,
}, opts...)
-
if err != nil {
return nil, false, err
}
diff --git a/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/instance_metadata_sdk.go b/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/instance_metadata_sdk.go
index 6bf35d64..43b80829 100644
--- a/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/instance_metadata_sdk.go
+++ b/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/instance_metadata_sdk.go
@@ -2,8 +2,9 @@ package instance
import (
"bytes"
+ "context"
"encoding/json"
- "io/ioutil"
+ "io"
"math/rand"
"net"
"net/http"
@@ -11,14 +12,15 @@ import (
"time"
"github.com/scaleway/scaleway-sdk-go/internal/errors"
+ "github.com/scaleway/scaleway-sdk-go/logger"
)
-var (
- metadataRetryBindPort = 200
-)
+var metadataRetryBindPort = 200
-const metadataAPIv4 = "http://169.254.42.42"
-const metadataAPIv6 = "http://[fd00:42::42]"
+const (
+ metadataAPIv4 = "http://169.254.42.42"
+ metadataAPIv6 = "http://[fd00:42::42]"
+)
// MetadataAPI metadata API
type MetadataAPI struct {
@@ -30,25 +32,37 @@ func NewMetadataAPI() *MetadataAPI {
return &MetadataAPI{}
}
-func (meta *MetadataAPI) getMetadataUrl() string {
+func (meta *MetadataAPI) getMetadataURL() string {
if meta.MetadataURL != nil {
return *meta.MetadataURL
}
+ ctx := context.Background()
for _, url := range []string{metadataAPIv4, metadataAPIv6} {
http.DefaultClient.Timeout = 3 * time.Second
- resp, err := http.Get(url)
- if err == nil && resp.StatusCode == 200 {
+ req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, bytes.NewBufferString(""))
+ if err != nil {
+ logger.Warningf("Failed to create metadata URL %s: %v", url, err)
+ }
+ resp, err := http.DefaultClient.Do(req)
+ if err == nil && resp.StatusCode == http.StatusOK {
meta.MetadataURL = &url
return url
}
+ defer resp.Body.Close()
}
return metadataAPIv4
}
// GetMetadata returns the metadata available from the server
func (meta *MetadataAPI) GetMetadata() (m *Metadata, err error) {
- resp, err := http.Get(meta.getMetadataUrl() + "/conf?format=json")
+ ctx := context.Background()
+ req, err := http.NewRequestWithContext(ctx, http.MethodGet, meta.getMetadataURL()+"/conf?format=json", bytes.NewBufferString(""))
+ if err != nil {
+ return nil, err
+ }
+
+ resp, err := http.DefaultClient.Do(req)
if err != nil {
return nil, errors.Wrap(err, "error getting metadataURL")
}
@@ -82,7 +96,7 @@ type Metadata struct {
Organization string `json:"organization,omitempty"`
Project string `json:"project,omitempty"`
CommercialType string `json:"commercial_type,omitempty"`
- //PublicIP IPv4 only
+ // PublicIP IPv4 only
PublicIP struct {
ID string `json:"id"`
Address string `json:"address"`
@@ -161,6 +175,7 @@ type Metadata struct {
// ListUserData returns the metadata available from the server
func (meta *MetadataAPI) ListUserData() (res *UserData, err error) {
retries := 0
+ ctx := context.Background()
for retries <= metadataRetryBindPort {
port := rand.Intn(1024)
localTCPAddr, err := net.ResolveTCPAddr("tcp", ":"+strconv.Itoa(port))
@@ -178,7 +193,11 @@ func (meta *MetadataAPI) ListUserData() (res *UserData, err error) {
},
}
- resp, err := userdataClient.Get(meta.getMetadataUrl() + "/user_data?format=json")
+ req, err := http.NewRequestWithContext(ctx, http.MethodGet, meta.getMetadataURL()+"/user_data?format=json", bytes.NewBufferString(""))
+ if err != nil {
+ return nil, err
+ }
+ resp, err := userdataClient.Do(req)
if err != nil {
retries++ // retry with a different source port
continue
@@ -201,6 +220,7 @@ func (meta *MetadataAPI) GetUserData(key string) ([]byte, error) {
return make([]byte, 0), errors.New("key must not be empty in GetUserData")
}
+ ctx := context.Background()
retries := 0
for retries <= metadataRetryBindPort {
port := rand.Intn(1024)
@@ -219,14 +239,19 @@ func (meta *MetadataAPI) GetUserData(key string) ([]byte, error) {
},
}
- resp, err := userdataClient.Get(meta.getMetadataUrl() + "/user_data/" + key)
+ req, err := http.NewRequestWithContext(ctx, http.MethodGet, meta.getMetadataURL()+"/user_data/"+key, bytes.NewBufferString(""))
+ if err != nil {
+ return nil, err
+ }
+
+ resp, err := userdataClient.Do(req)
if err != nil {
retries++ // retry with a different source port
continue
}
defer resp.Body.Close()
- body, err := ioutil.ReadAll(resp.Body)
+ body, err := io.ReadAll(resp.Body)
if err != nil {
return make([]byte, 0), errors.Wrap(err, "error reading userdata body")
}
@@ -242,6 +267,7 @@ func (meta *MetadataAPI) SetUserData(key string, value []byte) error {
return errors.New("key must not be empty in SetUserData")
}
+ ctx := context.Background()
retries := 0
for retries <= metadataRetryBindPort {
port := rand.Intn(1024)
@@ -259,16 +285,17 @@ func (meta *MetadataAPI) SetUserData(key string, value []byte) error {
}).DialContext,
},
}
- request, err := http.NewRequest("PATCH", meta.getMetadataUrl()+"/user_data/"+key, bytes.NewBuffer(value))
+ request, err := http.NewRequestWithContext(ctx, http.MethodPatch, meta.getMetadataURL()+"/user_data/"+key, bytes.NewBuffer(value))
if err != nil {
return errors.Wrap(err, "error creating patch userdata request")
}
request.Header.Set("Content-Type", "text/plain")
- _, err = userdataClient.Do(request)
+ resp, err := userdataClient.Do(request)
if err != nil {
retries++ // retry with a different source port
continue
}
+ defer resp.Body.Close()
return nil
}
@@ -281,6 +308,7 @@ func (meta *MetadataAPI) DeleteUserData(key string) error {
return errors.New("key must not be empty in DeleteUserData")
}
+ ctx := context.Background()
retries := 0
for retries <= metadataRetryBindPort {
port := rand.Intn(1024)
@@ -298,15 +326,16 @@ func (meta *MetadataAPI) DeleteUserData(key string) error {
}).DialContext,
},
}
- request, err := http.NewRequest("DELETE", meta.getMetadataUrl()+"/user_data/"+key, bytes.NewBuffer([]byte("")))
+ request, err := http.NewRequestWithContext(ctx, http.MethodDelete, meta.getMetadataURL()+"/user_data/"+key, bytes.NewBufferString(""))
if err != nil {
return errors.Wrap(err, "error creating delete userdata request")
}
- _, err = userdataClient.Do(request)
+ resp, err := userdataClient.Do(request)
if err != nil {
retries++ // retry with a different source port
continue
}
+ defer resp.Body.Close()
return nil
}
diff --git a/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/instance_sdk.go b/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/instance_sdk.go
index 0d497d29..6492101c 100644
--- a/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/instance_sdk.go
+++ b/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/instance_sdk.go
@@ -56,6 +56,15 @@ func (enum Arch) String() string {
return string(enum)
}
+func (enum Arch) Values() []Arch {
+ return []Arch{
+ "unknown_arch",
+ "x86_64",
+ "arm",
+ "arm64",
+ }
+}
+
func (enum Arch) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
@@ -88,6 +97,15 @@ func (enum AttachServerVolumeRequestVolumeType) String() string {
return string(enum)
}
+func (enum AttachServerVolumeRequestVolumeType) Values() []AttachServerVolumeRequestVolumeType {
+ return []AttachServerVolumeRequestVolumeType{
+ "unknown_volume_type",
+ "l_ssd",
+ "b_ssd",
+ "sbs_volume",
+ }
+}
+
func (enum AttachServerVolumeRequestVolumeType) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
@@ -119,6 +137,14 @@ func (enum BootType) String() string {
return string(enum)
}
+func (enum BootType) Values() []BootType {
+ return []BootType{
+ "local",
+ "bootscript",
+ "rescue",
+ }
+}
+
func (enum BootType) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
@@ -152,6 +178,16 @@ func (enum IPState) String() string {
return string(enum)
}
+func (enum IPState) Values() []IPState {
+ return []IPState{
+ "unknown_state",
+ "detached",
+ "attached",
+ "pending",
+ "error",
+ }
+}
+
func (enum IPState) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
@@ -184,6 +220,15 @@ func (enum IPType) String() string {
return string(enum)
}
+func (enum IPType) Values() []IPType {
+ return []IPType{
+ "unknown_iptype",
+ "nat",
+ "routed_ipv4",
+ "routed_ipv6",
+ }
+}
+
func (enum IPType) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
@@ -215,6 +260,14 @@ func (enum ImageState) String() string {
return string(enum)
}
+func (enum ImageState) Values() []ImageState {
+ return []ImageState{
+ "available",
+ "creating",
+ "error",
+ }
+}
+
func (enum ImageState) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
@@ -247,6 +300,15 @@ func (enum ListServersRequestOrder) String() string {
return string(enum)
}
+func (enum ListServersRequestOrder) Values() []ListServersRequestOrder {
+ return []ListServersRequestOrder{
+ "creation_date_desc",
+ "creation_date_asc",
+ "modification_date_desc",
+ "modification_date_asc",
+ }
+}
+
func (enum ListServersRequestOrder) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
@@ -277,6 +339,13 @@ func (enum PlacementGroupPolicyMode) String() string {
return string(enum)
}
+func (enum PlacementGroupPolicyMode) Values() []PlacementGroupPolicyMode {
+ return []PlacementGroupPolicyMode{
+ "optional",
+ "enforced",
+ }
+}
+
func (enum PlacementGroupPolicyMode) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
@@ -307,6 +376,13 @@ func (enum PlacementGroupPolicyType) String() string {
return string(enum)
}
+func (enum PlacementGroupPolicyType) Values() []PlacementGroupPolicyType {
+ return []PlacementGroupPolicyType{
+ "max_availability",
+ "low_latency",
+ }
+}
+
func (enum PlacementGroupPolicyType) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
@@ -338,6 +414,14 @@ func (enum PrivateNICState) String() string {
return string(enum)
}
+func (enum PrivateNICState) Values() []PrivateNICState {
+ return []PrivateNICState{
+ "available",
+ "syncing",
+ "syncing_error",
+ }
+}
+
func (enum PrivateNICState) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
@@ -369,6 +453,14 @@ func (enum SecurityGroupPolicy) String() string {
return string(enum)
}
+func (enum SecurityGroupPolicy) Values() []SecurityGroupPolicy {
+ return []SecurityGroupPolicy{
+ "unknown_policy",
+ "accept",
+ "drop",
+ }
+}
+
func (enum SecurityGroupPolicy) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
@@ -400,6 +492,14 @@ func (enum SecurityGroupRuleAction) String() string {
return string(enum)
}
+func (enum SecurityGroupRuleAction) Values() []SecurityGroupRuleAction {
+ return []SecurityGroupRuleAction{
+ "unknown_action",
+ "accept",
+ "drop",
+ }
+}
+
func (enum SecurityGroupRuleAction) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
@@ -431,6 +531,14 @@ func (enum SecurityGroupRuleDirection) String() string {
return string(enum)
}
+func (enum SecurityGroupRuleDirection) Values() []SecurityGroupRuleDirection {
+ return []SecurityGroupRuleDirection{
+ "unknown_direction",
+ "inbound",
+ "outbound",
+ }
+}
+
func (enum SecurityGroupRuleDirection) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
@@ -464,6 +572,16 @@ func (enum SecurityGroupRuleProtocol) String() string {
return string(enum)
}
+func (enum SecurityGroupRuleProtocol) Values() []SecurityGroupRuleProtocol {
+ return []SecurityGroupRuleProtocol{
+ "unknown_protocol",
+ "TCP",
+ "UDP",
+ "ICMP",
+ "ANY",
+ }
+}
+
func (enum SecurityGroupRuleProtocol) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
@@ -495,6 +613,14 @@ func (enum SecurityGroupState) String() string {
return string(enum)
}
+func (enum SecurityGroupState) Values() []SecurityGroupState {
+ return []SecurityGroupState{
+ "available",
+ "syncing",
+ "syncing_error",
+ }
+}
+
func (enum SecurityGroupState) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
@@ -530,6 +656,18 @@ func (enum ServerAction) String() string {
return string(enum)
}
+func (enum ServerAction) Values() []ServerAction {
+ return []ServerAction{
+ "poweron",
+ "backup",
+ "stop_in_place",
+ "poweroff",
+ "terminate",
+ "reboot",
+ "enable_routed_ip",
+ }
+}
+
func (enum ServerAction) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
@@ -560,6 +698,13 @@ func (enum ServerIPIPFamily) String() string {
return string(enum)
}
+func (enum ServerIPIPFamily) Values() []ServerIPIPFamily {
+ return []ServerIPIPFamily{
+ "inet",
+ "inet6",
+ }
+}
+
func (enum ServerIPIPFamily) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
@@ -591,6 +736,14 @@ func (enum ServerIPProvisioningMode) String() string {
return string(enum)
}
+func (enum ServerIPProvisioningMode) Values() []ServerIPProvisioningMode {
+ return []ServerIPProvisioningMode{
+ "manual",
+ "dhcp",
+ "slaac",
+ }
+}
+
func (enum ServerIPProvisioningMode) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
@@ -624,6 +777,16 @@ func (enum ServerIPState) String() string {
return string(enum)
}
+func (enum ServerIPState) Values() []ServerIPState {
+ return []ServerIPState{
+ "unknown_state",
+ "detached",
+ "attached",
+ "pending",
+ "error",
+ }
+}
+
func (enum ServerIPState) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
@@ -658,6 +821,17 @@ func (enum ServerState) String() string {
return string(enum)
}
+func (enum ServerState) Values() []ServerState {
+ return []ServerState{
+ "running",
+ "stopped",
+ "stopped in place",
+ "starting",
+ "stopping",
+ "locked",
+ }
+}
+
func (enum ServerState) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
@@ -689,6 +863,14 @@ func (enum ServerTypesAvailability) String() string {
return string(enum)
}
+func (enum ServerTypesAvailability) Values() []ServerTypesAvailability {
+ return []ServerTypesAvailability{
+ "available",
+ "scarce",
+ "shortage",
+ }
+}
+
func (enum ServerTypesAvailability) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
@@ -723,6 +905,17 @@ func (enum SnapshotState) String() string {
return string(enum)
}
+func (enum SnapshotState) Values() []SnapshotState {
+ return []SnapshotState{
+ "available",
+ "snapshotting",
+ "error",
+ "invalid_data",
+ "importing",
+ "exporting",
+ }
+}
+
func (enum SnapshotState) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
@@ -755,6 +948,15 @@ func (enum SnapshotVolumeType) String() string {
return string(enum)
}
+func (enum SnapshotVolumeType) Values() []SnapshotVolumeType {
+ return []SnapshotVolumeType{
+ "unknown_volume_type",
+ "l_ssd",
+ "b_ssd",
+ "unified",
+ }
+}
+
func (enum SnapshotVolumeType) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
@@ -788,6 +990,16 @@ func (enum TaskStatus) String() string {
return string(enum)
}
+func (enum TaskStatus) Values() []TaskStatus {
+ return []TaskStatus{
+ "pending",
+ "started",
+ "success",
+ "failure",
+ "retry",
+ }
+}
+
func (enum TaskStatus) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
@@ -823,6 +1035,18 @@ func (enum VolumeServerState) String() string {
return string(enum)
}
+func (enum VolumeServerState) Values() []VolumeServerState {
+ return []VolumeServerState{
+ "available",
+ "snapshotting",
+ "fetching",
+ "resizing",
+ "saving",
+ "hotsyncing",
+ "error",
+ }
+}
+
func (enum VolumeServerState) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
@@ -855,6 +1079,15 @@ func (enum VolumeServerVolumeType) String() string {
return string(enum)
}
+func (enum VolumeServerVolumeType) Values() []VolumeServerVolumeType {
+ return []VolumeServerVolumeType{
+ "l_ssd",
+ "b_ssd",
+ "sbs_volume",
+ "scratch",
+ }
+}
+
func (enum VolumeServerVolumeType) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
@@ -890,6 +1123,18 @@ func (enum VolumeState) String() string {
return string(enum)
}
+func (enum VolumeState) Values() []VolumeState {
+ return []VolumeState{
+ "available",
+ "snapshotting",
+ "fetching",
+ "resizing",
+ "saving",
+ "hotsyncing",
+ "error",
+ }
+}
+
func (enum VolumeState) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
@@ -924,6 +1169,17 @@ func (enum VolumeVolumeType) String() string {
return string(enum)
}
+func (enum VolumeVolumeType) Values() []VolumeVolumeType {
+ return []VolumeVolumeType{
+ "l_ssd",
+ "b_ssd",
+ "unified",
+ "scratch",
+ "sbs_volume",
+ "sbs_snapshot",
+ }
+}
+
func (enum VolumeVolumeType) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}
@@ -978,9 +1234,9 @@ type Bootscript struct {
// Title: bootscript title.
Title string `json:"title"`
- // Arch: bootscript architecture.
+ // Architecture: bootscript architecture.
// Default value: unknown_arch
- Arch Arch `json:"arch"`
+ Architecture Arch `json:"architecture"`
// Zone: zone in which the bootscript is located.
Zone scw.Zone `json:"zone"`
@@ -1186,7 +1442,11 @@ type ServerIP struct {
// Tags: tags associated with the IP.
Tags []string `json:"tags"`
- // State: default value: unknown_state
+ // IpamID: the ip_id of an IPAM ip if the ip is created from IPAM, null if not.
+ IpamID string `json:"ipam_id"`
+
+ // State: IP address state.
+ // Default value: unknown_state
State ServerIPState `json:"state"`
}
@@ -1218,6 +1478,8 @@ type ServerLocation struct {
// ServerMaintenance: server maintenance.
type ServerMaintenance struct {
Reason string `json:"reason"`
+
+ StartDate *time.Time `json:"start_date"`
}
// VolumeServer: volume server.
@@ -1226,7 +1488,8 @@ type VolumeServer struct {
Name string `json:"name"`
- ExportURI string `json:"export_uri"`
+ // Deprecated
+ ExportURI *string `json:"export_uri"`
Organization string `json:"organization"`
@@ -1335,8 +1598,8 @@ type Server struct {
// RoutedIPEnabled: true to configure the instance so it uses the new routed IP mode.
RoutedIPEnabled bool `json:"routed_ip_enabled"`
- // EnableIPv6: true if IPv6 is enabled.
- EnableIPv6 bool `json:"enable_ipv6"`
+ // Deprecated: EnableIPv6: true if IPv6 is enabled (deprecated and always `False` when `routed_ip_enabled` is `True`).
+ EnableIPv6 *bool `json:"enable_ipv6"`
// Hostname: instance host name.
Hostname string `json:"hostname"`
@@ -1347,10 +1610,10 @@ type Server struct {
// Protected: defines whether the Instance protection option is activated.
Protected bool `json:"protected"`
- // PrivateIP: private IP address of the Instance.
+ // PrivateIP: private IP address of the Instance (deprecated and always `null` when `routed_ip_enabled` is `True`).
PrivateIP *string `json:"private_ip"`
- // PublicIP: information about the public IP.
+ // Deprecated: PublicIP: information about the public IP (deprecated in favor of `public_ips`).
PublicIP *ServerIP `json:"public_ip"`
// PublicIPs: information about all the public IPs attached to the server.
@@ -1369,7 +1632,7 @@ type Server struct {
// Location: instance location.
Location *ServerLocation `json:"location"`
- // IPv6: instance IPv6 address.
+ // Deprecated: IPv6: instance IPv6 address (deprecated when `routed_ip_enabled` is `True`).
IPv6 *ServerIPv6 `json:"ipv6"`
// Deprecated: Bootscript: instance bootscript.
@@ -1403,6 +1666,12 @@ type Server struct {
// Zone: zone in which the Instance is located.
Zone scw.Zone `json:"zone"`
+
+ // AdminPasswordEncryptionSSHKeyID: the public_key value of this key is used to encrypt the admin password. When set to an empty string, reset this value and admin_password_encrypted_value to an empty string so a new password may be generated.
+ AdminPasswordEncryptionSSHKeyID *string `json:"admin_password_encryption_ssh_key_id"`
+
+ // AdminPasswordEncryptedValue: this value is reset when admin_password_encryption_ssh_key_id is set to an empty string.
+ AdminPasswordEncryptedValue *string `json:"admin_password_encrypted_value"`
}
// IP: ip.
@@ -1429,6 +1698,8 @@ type IP struct {
Prefix scw.IPNet `json:"prefix"`
+ IpamID string `json:"ipam_id"`
+
// Zone: zone to target. If none is passed will use default zone from the config.
Zone scw.Zone `json:"zone"`
}
@@ -1814,15 +2085,15 @@ type ApplyBlockMigrationRequest struct {
// Zone: zone to target. If none is passed will use default zone from the config.
Zone scw.Zone `json:"-"`
- // VolumeID: the volume to migrate, along with potentially other resources, according to the migration plan generated with a call to PlanBlockMigration.
+ // VolumeID: the volume to migrate, along with potentially other resources, according to the migration plan generated with a call to the "Plan a migration" endpoint.
// Precisely one of VolumeID, SnapshotID must be set.
VolumeID *string `json:"volume_id,omitempty"`
- // SnapshotID: the snapshot to migrate, along with potentially other resources, according to the migration plan generated with a call to PlanBlockMigration.
+ // SnapshotID: the snapshot to migrate, along with potentially other resources, according to the migration plan generated with a call to the "Plan a migration" endpoint.
// Precisely one of VolumeID, SnapshotID must be set.
SnapshotID *string `json:"snapshot_id,omitempty"`
- // ValidationKey: a value to be retrieved from a call to PlanBlockMigration, to confirm that the volume and/or snapshots specified in said plan should be migrated.
+ // ValidationKey: a value to be retrieved from a call to the "Plan a migration" endpoint, to confirm that the volume and/or snapshots specified in said plan should be migrated.
ValidationKey string `json:"validation_key,omitempty"`
}
@@ -1963,8 +2234,11 @@ type CreatePrivateNICRequest struct {
// Tags: private NIC tags.
Tags []string `json:"tags,omitempty"`
- // IPIDs: ip_ids defined from IPAM.
- IPIDs []string `json:"ip_ids,omitempty"`
+ // Deprecated: IPIDs: ip_ids defined from IPAM.
+ IPIDs *[]string `json:"ip_ids,omitempty"`
+
+ // IpamIPIDs: UUID of IPAM ips, to be attached to the instance in the requested private network.
+ IpamIPIDs []string `json:"ipam_ip_ids,omitempty"`
}
// CreatePrivateNICResponse: create private nic response.
@@ -2082,10 +2356,10 @@ type CreateServerRequest struct {
// Volumes: volumes attached to the server.
Volumes map[string]*VolumeServerTemplate `json:"volumes,omitempty"`
- // EnableIPv6: true if IPv6 is enabled on the server.
- EnableIPv6 bool `json:"enable_ipv6,omitempty"`
+ // Deprecated: EnableIPv6: true if IPv6 is enabled on the server (deprecated and always `False` when `routed_ip_enabled` is `True`).
+ EnableIPv6 *bool `json:"enable_ipv6,omitempty"`
- // PublicIP: ID of the reserved IP to attach to the Instance.
+ // Deprecated: PublicIP: ID of the reserved IP to attach to the Instance.
PublicIP *string `json:"public_ip,omitempty"`
// PublicIPs: a list of reserved IP IDs to attach to the Instance.
@@ -2114,6 +2388,9 @@ type CreateServerRequest struct {
// PlacementGroup: placement group ID if Instance must be part of a placement group.
PlacementGroup *string `json:"placement_group,omitempty"`
+
+ // AdminPasswordEncryptionSSHKeyID: the public_key value of this key is used to encrypt the admin password.
+ AdminPasswordEncryptionSSHKeyID *string `json:"admin_password_encryption_ssh_key_id,omitempty"`
}
// CreateServerResponse: create server response.
@@ -2948,12 +3225,15 @@ type ListServersRequest struct {
// Name: filter Instances by name (eg. "server1" will return "server100" and "server1" but not "foo").
Name *string `json:"-"`
- // PrivateIP: list Instances by private_ip.
+ // Deprecated: PrivateIP: list Instances by private_ip.
PrivateIP *net.IP `json:"-"`
// WithoutIP: list Instances that are not attached to a public IP.
WithoutIP *bool `json:"-"`
+ // WithIP: list Instances by IP (both private_ip and public_ip are supported).
+ WithIP *net.IP `json:"-"`
+
// CommercialType: list Instances of this commercial type.
CommercialType *string `json:"-"`
@@ -3214,7 +3494,7 @@ type MigrationPlan struct {
// Snapshots: a list of snapshots which will be migrated to SBS together and with the volume, if present.
Snapshots []*Snapshot `json:"snapshots"`
- // ValidationKey: a value to be passed to ApplyBlockMigrationRequest, to confirm that the execution of the plan is being requested.
+ // ValidationKey: a value to be passed to the call to the "Apply a migration plan" endpoint, to confirm that the execution of the plan is being requested.
ValidationKey string `json:"validation_key"`
}
@@ -3588,6 +3868,7 @@ type UpdateServerRequest struct {
// PublicIPs: a list of reserved IP IDs to attach to the Instance.
PublicIPs *[]string `json:"public_ips,omitempty"`
+ // Deprecated
EnableIPv6 *bool `json:"enable_ipv6,omitempty"`
Protected *bool `json:"protected,omitempty"`
@@ -3603,8 +3884,12 @@ type UpdateServerRequest struct {
// CommercialType: warning: This field has some restrictions:
// - Cannot be changed if the Instance is not in `stopped` state.
// - Cannot be changed if the Instance is in a placement group.
+ // - Cannot be changed from/to a Windows offer to/from a Linux offer.
// - Local storage requirements of the target commercial_types must be fulfilled (i.e. if an Instance has 80GB of local storage, it can be changed into a GP1-XS, which has a maximum of 150GB, but it cannot be changed into a DEV1-S, which has only 20GB).
CommercialType *string `json:"commercial_type,omitempty"`
+
+ // AdminPasswordEncryptionSSHKeyID: the public_key value of this key is used to encrypt the admin password. When set to an empty string, reset this value and admin_password_encrypted_value to an empty string so a new password may be generated.
+ AdminPasswordEncryptionSSHKeyID *string `json:"admin_password_encryption_ssh_key_id,omitempty"`
}
// UpdateServerResponse: update server response.
@@ -3789,8 +4074,8 @@ type setServerRequest struct {
// RoutedIPEnabled: true to configure the instance so it uses the new routed IP mode (once this is set to True you cannot set it back to False).
RoutedIPEnabled *bool `json:"routed_ip_enabled,omitempty"`
- // EnableIPv6: true if IPv6 is enabled.
- EnableIPv6 bool `json:"enable_ipv6"`
+ // Deprecated: EnableIPv6: true if IPv6 is enabled (deprecated and always `False` when `routed_ip_enabled` is `True`).
+ EnableIPv6 *bool `json:"enable_ipv6,omitempty"`
// Hostname: instance host name.
Hostname string `json:"hostname"`
@@ -3801,10 +4086,10 @@ type setServerRequest struct {
// Protected: instance protection option is activated.
Protected bool `json:"protected"`
- // PrivateIP: instance private IP address.
+ // Deprecated: PrivateIP: instance private IP address (deprecated and always `null` when `routed_ip_enabled` is `True`).
PrivateIP *string `json:"private_ip,omitempty"`
- // PublicIP: information about the public IP.
+ // Deprecated: PublicIP: information about the public IP (deprecated in favor of `public_ips`).
PublicIP *ServerIP `json:"public_ip,omitempty"`
// PublicIPs: information about all the public IPs attached to the server.
@@ -3820,7 +4105,7 @@ type setServerRequest struct {
// Location: instance location.
Location *ServerLocation `json:"location,omitempty"`
- // IPv6: instance IPv6 address.
+ // Deprecated: IPv6: instance IPv6 address (deprecated when `routed_ip_enabled` is `True`).
IPv6 *ServerIPv6 `json:"ipv6,omitempty"`
// Deprecated: Bootscript: instance bootscript.
@@ -3851,6 +4136,9 @@ type setServerRequest struct {
// PrivateNics: instance private NICs.
PrivateNics []*PrivateNIC `json:"private_nics"`
+
+ // AdminPasswordEncryptionSSHKeyID: the public_key value of this key is used to encrypt the admin password. When set to an empty string, reset this value and admin_password_encrypted_value to an empty string so a new password may be generated.
+ AdminPasswordEncryptionSSHKeyID *string `json:"admin_password_encryption_ssh_key_id,omitempty"`
}
// setServerResponse: set server response.
@@ -3895,7 +4183,7 @@ type setSnapshotResponse struct {
Snapshot *Snapshot `json:"snapshot"`
}
-// Instance API.
+// This API allows you to manage your Instances.
type API struct {
client *scw.Client
}
@@ -4023,6 +4311,7 @@ func (s *API) ListServers(req *ListServersRequest, opts ...scw.RequestOption) (*
parameter.AddToQuery(query, "name", req.Name)
parameter.AddToQuery(query, "private_ip", req.PrivateIP)
parameter.AddToQuery(query, "without_ip", req.WithoutIP)
+ parameter.AddToQuery(query, "with_ip", req.WithIP)
parameter.AddToQuery(query, "commercial_type", req.CommercialType)
parameter.AddToQuery(query, "state", req.State)
if len(req.Tags) != 0 {
@@ -6427,7 +6716,7 @@ func (s *API) GetDashboard(req *GetDashboardRequest, opts ...scw.RequestOption)
return &resp, nil
}
-// PlanBlockMigration: Given a volume or snapshot, returns the migration plan for a call to the RPC ApplyBlockMigration. This plan will include zero or one volume, and zero or more snapshots, which will need to be migrated together. This RPC does not perform the actual migration itself, ApplyBlockMigration must be used. The validation_key value returned by this call must be provided to the ApplyBlockMigration call to confirm that all resources listed in the plan should be migrated.
+// PlanBlockMigration: Given a volume or snapshot, returns the migration plan for a call to the "Apply a migration plan" endpoint. This plan will include zero or one volume, and zero or more snapshots, which will need to be migrated together. This endpoint does not perform the actual migration itself, the "Apply a migration plan" endpoint must be used. The validation_key value returned by this endpoint must be provided to the call to the "Apply a migration plan" endpoint to confirm that all resources listed in the plan should be migrated.
func (s *API) PlanBlockMigration(req *PlanBlockMigrationRequest, opts ...scw.RequestOption) (*MigrationPlan, error) {
var err error
@@ -6459,7 +6748,7 @@ func (s *API) PlanBlockMigration(req *PlanBlockMigrationRequest, opts ...scw.Req
return &resp, nil
}
-// ApplyBlockMigration: To be used, this RPC must be preceded by a call to PlanBlockMigration. To migrate all resources mentioned in the MigrationPlan, the validation_key returned in the MigrationPlan must be provided.
+// ApplyBlockMigration: To be used, the call to this endpoint must be preceded by a call to the "Plan a migration" endpoint. To migrate all resources mentioned in the migration plan, the validation_key returned in the plan must be provided.
func (s *API) ApplyBlockMigration(req *ApplyBlockMigrationRequest, opts ...scw.RequestOption) error {
var err error
diff --git a/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/instance_utils.go b/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/instance_utils.go
index 0d5401df..6942e323 100644
--- a/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/instance_utils.go
+++ b/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/instance_utils.go
@@ -7,14 +7,11 @@ import (
"time"
"github.com/scaleway/scaleway-sdk-go/internal/async"
-
"github.com/scaleway/scaleway-sdk-go/internal/errors"
"github.com/scaleway/scaleway-sdk-go/scw"
)
-var (
- resourceLock sync.Map
-)
+var resourceLock sync.Map
// lockResource locks a resource from a specific resourceID
func lockResource(resourceID string) *sync.Mutex {
@@ -53,7 +50,7 @@ func (s *API) AttachIP(req *AttachIPRequest, opts ...scw.RequestOption) (*Attach
Zone: req.Zone,
IP: req.IP,
Server: &NullableStringValue{Value: req.ServerID},
- })
+ }, opts...)
if err != nil {
return nil, err
}
@@ -84,7 +81,7 @@ func (s *API) DetachIP(req *DetachIPRequest, opts ...scw.RequestOption) (*Detach
Zone: req.Zone,
IP: req.IP,
Server: &NullableStringValue{Null: true},
- })
+ }, opts...)
if err != nil {
return nil, err
}
@@ -93,6 +90,7 @@ func (s *API) DetachIP(req *DetachIPRequest, opts ...scw.RequestOption) (*Detach
}
// AttachVolumeRequest contains the parameters to attach a volume to a server
+// Deprecated by AttachServerVolumeRequest
type AttachVolumeRequest struct {
Zone scw.Zone `json:"-"`
ServerID string `json:"-"`
@@ -100,98 +98,43 @@ type AttachVolumeRequest struct {
}
// AttachVolumeResponse contains the updated server after attaching a volume
+// Deprecated by AttachServerVolumeResponse
type AttachVolumeResponse struct {
Server *Server `json:"-"`
}
-// volumesToVolumeTemplates converts a map of *Volume to a map of *VolumeTemplate
-// so it can be used in a UpdateServer request
-func volumesToVolumeTemplates(volumes map[string]*VolumeServer) map[string]*VolumeServerTemplate {
- volumeTemplates := map[string]*VolumeServerTemplate{}
- for key, volume := range volumes {
- volumeTemplate := &VolumeServerTemplate{
- ID: &volume.ID,
- }
-
- if volume.Name != "" {
- volumeTemplate.Name = &volume.Name
- }
-
- if volume.VolumeType == VolumeServerVolumeTypeSbsVolume {
- volumeTemplate.VolumeType = VolumeVolumeTypeSbsVolume
- }
-
- volumeTemplates[key] = volumeTemplate
- }
- return volumeTemplates
-}
-
// AttachVolume attaches a volume to a server
//
// Note: Implementation is thread-safe.
+// Deprecated by AttachServerVolume provided by instance API
func (s *API) AttachVolume(req *AttachVolumeRequest, opts ...scw.RequestOption) (*AttachVolumeResponse, error) {
defer lockServer(req.Zone, req.ServerID).Unlock()
// check where the volume comes from
volume, err := s.getUnknownVolume(&getUnknownVolumeRequest{
Zone: req.Zone,
VolumeID: req.VolumeID,
- })
+ }, opts...)
if err != nil {
return nil, err
}
- // get server with volumes
- getServerResponse, err := s.GetServer(&GetServerRequest{
- Zone: req.Zone,
- ServerID: req.ServerID,
- })
- if err != nil {
- return nil, err
+ attachServerVolumeReq := &AttachServerVolumeRequest{
+ Zone: req.Zone,
+ ServerID: req.ServerID,
+ VolumeID: req.VolumeID,
+ VolumeType: AttachServerVolumeRequestVolumeType(volume.Type),
}
- volumes := getServerResponse.Server.Volumes
-
- newVolumes := volumesToVolumeTemplates(volumes)
-
- // add volume to volumes list
- // We loop through all the possible volume keys (0 to len(volumes))
- // to find a non existing key and assign it to the requested volume.
- // A key should always be found. However we return an error if no keys were found.
- found := false
- for i := 0; i <= len(volumes); i++ {
- key := fmt.Sprintf("%d", i)
- if _, ok := newVolumes[key]; !ok {
- newVolumes[key] = &VolumeServerTemplate{
- ID: &req.VolumeID,
- }
- if volume.Type == VolumeVolumeTypeSbsVolume {
- newVolumes[key].VolumeType = VolumeVolumeTypeSbsVolume
- } else {
- newVolumes[key].Name = &req.VolumeID
- }
- found = true
- break
- }
- }
-
- if !found {
- return nil, fmt.Errorf("could not find key to attach volume %s", req.VolumeID)
- }
-
- // update server
- updateServerResponse, err := s.updateServer(&UpdateServerRequest{
- Zone: req.Zone,
- ServerID: req.ServerID,
- Volumes: &newVolumes,
- })
+ resp, err := s.AttachServerVolume(attachServerVolumeReq, opts...)
if err != nil {
return nil, err
}
- return &AttachVolumeResponse{Server: updateServerResponse.Server}, nil
+ return &AttachVolumeResponse{Server: resp.Server}, nil
}
// DetachVolumeRequest contains the parameters to detach a volume from a server
+// Deprecated by DetachServerVolumeRequest
type DetachVolumeRequest struct {
Zone scw.Zone `json:"-"`
VolumeID string `json:"-"`
@@ -202,6 +145,7 @@ type DetachVolumeRequest struct {
}
// DetachVolumeResponse contains the updated server after detaching a volume
+// Deprecated by DetachServerVolumeResponse
type DetachVolumeResponse struct {
Server *Server `json:"-"`
}
@@ -209,11 +153,12 @@ type DetachVolumeResponse struct {
// DetachVolume detaches a volume from a server
//
// Note: Implementation is thread-safe.
+// Deprecated by DetachServerVolume provided by instance API
func (s *API) DetachVolume(req *DetachVolumeRequest, opts ...scw.RequestOption) (*DetachVolumeResponse, error) {
volume, err := s.getUnknownVolume(&getUnknownVolumeRequest{
Zone: req.Zone,
VolumeID: req.VolumeID,
- })
+ }, opts...)
if err != nil {
return nil, err
}
@@ -223,35 +168,17 @@ func (s *API) DetachVolume(req *DetachVolumeRequest, opts ...scw.RequestOption)
}
defer lockServer(req.Zone, *volume.ServerID).Unlock()
- // get server with volumes
- getServerResponse, err := s.GetServer(&GetServerRequest{
- Zone: req.Zone,
- ServerID: *volume.ServerID,
- })
- if err != nil {
- return nil, err
- }
- volumes := getServerResponse.Server.Volumes
- // remove volume from volumes list
- for key, volume := range volumes {
- if volume.ID == req.VolumeID {
- delete(volumes, key)
- }
- }
- newVolumes := volumesToVolumeTemplates(volumes)
-
- // update server
- updateServerResponse, err := s.updateServer(&UpdateServerRequest{
+ resp, err := s.DetachServerVolume(&DetachServerVolumeRequest{
Zone: req.Zone,
ServerID: *volume.ServerID,
- Volumes: &newVolumes,
- })
+ VolumeID: volume.ID,
+ }, opts...)
if err != nil {
return nil, err
}
- return &DetachVolumeResponse{Server: updateServerResponse.Server}, nil
+ return &DetachVolumeResponse{Server: resp.Server}, nil
}
// UnsafeSetTotalCount should not be used
@@ -363,7 +290,6 @@ func (s *API) WaitForPrivateNIC(req *WaitForPrivateNICRequest, opts ...scw.Reque
Zone: req.Zone,
PrivateNicID: req.PrivateNicID,
}, opts...)
-
if err != nil {
return nil, false, err
}
@@ -432,3 +358,48 @@ func (s *API) WaitForMACAddress(req *WaitForMACAddressRequest, opts ...scw.Reque
func (r *GetServerTypesAvailabilityResponse) UnsafeSetTotalCount(totalCount int) {
r.TotalCount = uint32(totalCount)
}
+
+// WaitForServerRDPPasswordRequest is used by WaitForServerRDPPassword method.
+type WaitForServerRDPPasswordRequest struct {
+ ServerID string
+ Zone scw.Zone
+ Timeout *time.Duration
+ RetryInterval *time.Duration
+}
+
+// WaitForServerRDPPassword wait for an RDP password to be generated for an instance before returning.
+// This function can be used to wait for a windows instance to boot up.
+func (s *API) WaitForServerRDPPassword(req *WaitForServerRDPPasswordRequest, opts ...scw.RequestOption) (*Server, error) {
+ timeout := defaultTimeout
+ if req.Timeout != nil {
+ timeout = *req.Timeout
+ }
+ retryInterval := defaultRetryInterval
+ if req.RetryInterval != nil {
+ retryInterval = *req.RetryInterval
+ }
+
+ server, err := async.WaitSync(&async.WaitSyncConfig{
+ Get: func() (interface{}, bool, error) {
+ res, err := s.GetServer(&GetServerRequest{
+ ServerID: req.ServerID,
+ Zone: req.Zone,
+ }, opts...)
+ if err != nil {
+ return nil, false, err
+ }
+
+ if res.Server.AdminPasswordEncryptedValue != nil && *res.Server.AdminPasswordEncryptedValue != "" {
+ return res.Server, true, err
+ }
+
+ return res.Server, false, err
+ },
+ Timeout: timeout,
+ IntervalStrategy: async.LinearIntervalStrategy(retryInterval),
+ })
+ if err != nil {
+ return nil, errors.Wrap(err, "waiting for server failed")
+ }
+ return server.(*Server), nil
+}
diff --git a/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/server_utils.go b/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/server_utils.go
index 29c9c399..d0052d7e 100644
--- a/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/server_utils.go
+++ b/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/server_utils.go
@@ -7,7 +7,7 @@ import (
"net/http"
"time"
- "github.com/scaleway/scaleway-sdk-go/api/marketplace/v1"
+ "github.com/scaleway/scaleway-sdk-go/api/marketplace/v2"
"github.com/scaleway/scaleway-sdk-go/internal/async"
"github.com/scaleway/scaleway-sdk-go/internal/errors"
"github.com/scaleway/scaleway-sdk-go/scw"
@@ -24,7 +24,7 @@ func (s *API) CreateServer(req *CreateServerRequest, opts ...scw.RequestOption)
// If image is not a UUID we try to fetch it from marketplace.
if req.Image != "" && !validation.IsUUID(req.Image) {
apiMarketplace := marketplace.NewAPI(s.client)
- imageID, err := apiMarketplace.GetLocalImageIDByLabel(&marketplace.GetLocalImageIDByLabelRequest{
+ image, err := apiMarketplace.GetLocalImageByLabel(&marketplace.GetLocalImageByLabelRequest{
ImageLabel: req.Image,
Zone: req.Zone,
CommercialType: req.CommercialType,
@@ -32,7 +32,7 @@ func (s *API) CreateServer(req *CreateServerRequest, opts ...scw.RequestOption)
if err != nil {
return nil, err
}
- req.Image = imageID
+ req.Image = image.ID
}
return s.createServer(req, opts...)
@@ -79,7 +79,6 @@ func (s *API) WaitForServer(req *WaitForServerRequest, opts ...scw.RequestOption
ServerID: req.ServerID,
Zone: req.Zone,
}, opts...)
-
if err != nil {
return nil, false, err
}
@@ -168,7 +167,6 @@ func (s *API) GetServerType(req *GetServerTypeRequest) (*ServerType, error) {
res, err := s.ListServersTypes(&ListServersTypesRequest{
Zone: req.Zone,
}, scw.WithAllPages())
-
if err != nil {
return nil, err
}
@@ -198,21 +196,21 @@ func (s *API) GetServerUserData(req *GetServerUserDataRequest, opts ...scw.Reque
req.Zone = defaultZone
}
- if fmt.Sprint(req.Zone) == "" {
+ if req.Zone == "" {
return nil, errors.New("field Zone cannot be empty in request")
}
- if fmt.Sprint(req.ServerID) == "" {
+ if req.ServerID == "" {
return nil, errors.New("field ServerID cannot be empty in request")
}
- if fmt.Sprint(req.Key) == "" {
+ if req.Key == "" {
return nil, errors.New("field Key cannot be empty in request")
}
scwReq := &scw.ScalewayRequest{
Method: "GET",
- Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/servers/" + fmt.Sprint(req.ServerID) + "/user_data/" + fmt.Sprint(req.Key),
+ Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/servers/" + req.ServerID + "/user_data/" + req.Key,
Headers: http.Header{},
}
@@ -247,15 +245,15 @@ func (s *API) SetServerUserData(req *SetServerUserDataRequest, opts ...scw.Reque
req.Zone = defaultZone
}
- if fmt.Sprint(req.Zone) == "" {
+ if req.Zone == "" {
return errors.New("field Zone cannot be empty in request")
}
- if fmt.Sprint(req.ServerID) == "" {
+ if req.ServerID == "" {
return errors.New("field ServerID cannot be empty in request")
}
- if fmt.Sprint(req.Key) == "" {
+ if req.Key == "" {
return errors.New("field Key cannot be empty in request")
}
@@ -265,7 +263,7 @@ func (s *API) SetServerUserData(req *SetServerUserDataRequest, opts ...scw.Reque
scwReq := &scw.ScalewayRequest{
Method: "PATCH",
- Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/servers/" + fmt.Sprint(req.ServerID) + "/user_data/" + fmt.Sprint(req.Key),
+ Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/servers/" + req.ServerID + "/user_data/" + req.Key,
Headers: http.Header{},
}
@@ -306,7 +304,7 @@ func (s *API) GetAllServerUserData(req *GetAllServerUserDataRequest, opts ...scw
return nil, errors.New("field Zone cannot be empty in request")
}
- if fmt.Sprint(req.ServerID) == "" {
+ if req.ServerID == "" {
return nil, errors.New("field ServerID cannot be empty in request")
}
@@ -314,7 +312,7 @@ func (s *API) GetAllServerUserData(req *GetAllServerUserDataRequest, opts ...scw
allUserDataRes, err := s.ListServerUserData(&ListServerUserDataRequest{
Zone: req.Zone,
ServerID: req.ServerID,
- })
+ }, opts...)
if err != nil {
return nil, err
}
@@ -329,7 +327,7 @@ func (s *API) GetAllServerUserData(req *GetAllServerUserDataRequest, opts ...scw
Zone: req.Zone,
ServerID: req.ServerID,
Key: key,
- })
+ }, opts...)
if err != nil {
return nil, err
}
@@ -359,11 +357,11 @@ func (s *API) SetAllServerUserData(req *SetAllServerUserDataRequest, opts ...scw
req.Zone = defaultZone
}
- if fmt.Sprint(req.Zone) == "" {
+ if req.Zone == "" {
return errors.New("field Zone cannot be empty in request")
}
- if fmt.Sprint(req.ServerID) == "" {
+ if req.ServerID == "" {
return errors.New("field ServerID cannot be empty in request")
}
@@ -371,7 +369,7 @@ func (s *API) SetAllServerUserData(req *SetAllServerUserDataRequest, opts ...scw
allUserDataRes, err := s.ListServerUserData(&ListServerUserDataRequest{
Zone: req.Zone,
ServerID: req.ServerID,
- })
+ }, opts...)
if err != nil {
return err
}
@@ -386,7 +384,7 @@ func (s *API) SetAllServerUserData(req *SetAllServerUserDataRequest, opts ...scw
Zone: req.Zone,
ServerID: req.ServerID,
Key: key,
- })
+ }, opts...)
if err != nil {
return err
}
@@ -399,7 +397,7 @@ func (s *API) SetAllServerUserData(req *SetAllServerUserDataRequest, opts ...scw
ServerID: req.ServerID,
Key: key,
Content: value,
- })
+ }, opts...)
if err != nil {
return err
}
diff --git a/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/snapshot_utils.go b/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/snapshot_utils.go
index 6efc419d..b254bc43 100644
--- a/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/snapshot_utils.go
+++ b/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/snapshot_utils.go
@@ -38,7 +38,6 @@ func (s *API) WaitForSnapshot(req *WaitForSnapshotRequest, opts ...scw.RequestOp
SnapshotID: req.SnapshotID,
Zone: req.Zone,
}, opts...)
-
if err != nil {
return nil, false, err
}
diff --git a/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/volume_utils.go b/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/volume_utils.go
index 30b98c6e..64582c59 100644
--- a/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/volume_utils.go
+++ b/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/volume_utils.go
@@ -40,7 +40,6 @@ func (s *API) WaitForVolume(req *WaitForVolumeRequest, opts ...scw.RequestOption
VolumeID: req.VolumeID,
Zone: req.Zone,
}, opts...)
-
if err != nil {
return nil, false, err
}
@@ -76,11 +75,11 @@ func (s *API) getUnknownVolume(req *getUnknownVolumeRequest, opts ...scw.Request
}
// Try instance API
- if req.IsBlockVolume == nil || *req.IsBlockVolume == false {
+ if req.IsBlockVolume == nil || !*req.IsBlockVolume {
getVolumeResponse, err := s.GetVolume(&GetVolumeRequest{
Zone: req.Zone,
VolumeID: req.VolumeID,
- })
+ }, opts...)
notFoundErr := &scw.ResourceNotFoundError{}
if err != nil && !goerrors.As(err, ¬FoundErr) {
return nil, err
@@ -93,11 +92,12 @@ func (s *API) getUnknownVolume(req *getUnknownVolumeRequest, opts ...scw.Request
volume.Type = getVolumeResponse.Volume.VolumeType
}
}
- if volume.Type == "" && (req.IsBlockVolume == nil || *req.IsBlockVolume == true) {
+
+ if volume.Type == "" && (req.IsBlockVolume == nil || *req.IsBlockVolume) {
getVolumeResponse, err := block.NewAPI(s.client).GetVolume(&block.GetVolumeRequest{
Zone: req.Zone,
VolumeID: req.VolumeID,
- })
+ }, opts...)
if err != nil {
return nil, err
}
diff --git a/vendor/github.com/scaleway/scaleway-sdk-go/api/marketplace/v1/marketplace_sdk.go b/vendor/github.com/scaleway/scaleway-sdk-go/api/marketplace/v1/marketplace_sdk.go
deleted file mode 100644
index b430fe8b..00000000
--- a/vendor/github.com/scaleway/scaleway-sdk-go/api/marketplace/v1/marketplace_sdk.go
+++ /dev/null
@@ -1,221 +0,0 @@
-// This file was automatically generated. DO NOT EDIT.
-// If you have any remark or suggestion do not hesitate to open an issue.
-
-// Package marketplace provides methods and message types of the marketplace v1 API.
-package marketplace
-
-import (
- "bytes"
- "encoding/json"
- "fmt"
- "net"
- "net/http"
- "net/url"
- "strings"
- "time"
-
- "github.com/scaleway/scaleway-sdk-go/internal/errors"
- "github.com/scaleway/scaleway-sdk-go/internal/marshaler"
- "github.com/scaleway/scaleway-sdk-go/internal/parameter"
- "github.com/scaleway/scaleway-sdk-go/namegenerator"
- "github.com/scaleway/scaleway-sdk-go/scw"
-)
-
-// always import dependencies
-var (
- _ fmt.Stringer
- _ json.Unmarshaler
- _ url.URL
- _ net.IP
- _ http.Header
- _ bytes.Reader
- _ time.Time
- _ = strings.Join
-
- _ scw.ScalewayRequest
- _ marshaler.Duration
- _ scw.File
- _ = parameter.AddToQuery
- _ = namegenerator.GetRandomName
-)
-
-// LocalImage: local image.
-type LocalImage struct {
- // ID: version you will typically use to define an image in an API call.
- ID string `json:"id"`
-
- // CompatibleCommercialTypes: list of all commercial types that are compatible with this local image.
- CompatibleCommercialTypes []string `json:"compatible_commercial_types"`
-
- // Arch: supported architecture for this local image.
- Arch string `json:"arch"`
-
- // Zone: availability Zone where this local image is available.
- Zone scw.Zone `json:"zone"`
-}
-
-// Organization: organization.
-type Organization struct {
- ID string `json:"id"`
-
- Name string `json:"name"`
-}
-
-// Version: version.
-type Version struct {
- // ID: UUID of this version.
- ID string `json:"id"`
-
- // Name: name of this version.
- Name string `json:"name"`
-
- // CreationDate: creation date of this image version.
- CreationDate *time.Time `json:"creation_date"`
-
- // ModificationDate: date of the last modification of this version.
- ModificationDate *time.Time `json:"modification_date"`
-
- // LocalImages: list of local images available in this version.
- LocalImages []*LocalImage `json:"local_images"`
-}
-
-// Image: image.
-type Image struct {
- // ID: UUID of this image.
- ID string `json:"id"`
-
- // Name: name of the image.
- Name string `json:"name"`
-
- // Description: text description of this image.
- Description string `json:"description"`
-
- // Logo: URL of this image's logo.
- Logo string `json:"logo"`
-
- // Categories: list of categories this image belongs to.
- Categories []string `json:"categories"`
-
- // CreationDate: creation date of this image.
- CreationDate *time.Time `json:"creation_date"`
-
- // ModificationDate: date of the last modification of this image.
- ModificationDate *time.Time `json:"modification_date"`
-
- // ValidUntil: expiration date of this image.
- ValidUntil *time.Time `json:"valid_until"`
-
- // Label: typically an identifier for a distribution (ex. "ubuntu_focal").
- Label string `json:"label"`
-
- // Versions: list of versions of this image.
- Versions []*Version `json:"versions"`
-
- // Organization: organization this image belongs to.
- Organization *Organization `json:"organization"`
-
- CurrentPublicVersion string `json:"current_public_version"`
-}
-
-// GetImageRequest: get image request.
-type GetImageRequest struct {
- // ImageID: display the image name.
- ImageID string `json:"-"`
-}
-
-// GetImageResponse: get image response.
-type GetImageResponse struct {
- Image *Image `json:"image"`
-}
-
-// ListImagesRequest: list images request.
-type ListImagesRequest struct {
- // PerPage: a positive integer lower or equal to 100 to select the number of items to display.
- PerPage *uint32 `json:"-"`
-
- // Page: a positive integer to choose the page to display.
- Page *int32 `json:"-"`
-}
-
-// ListImagesResponse: list images response.
-type ListImagesResponse struct {
- Images []*Image `json:"images"`
-
- TotalCount uint32 `json:"total_count"`
-}
-
-// UnsafeGetTotalCount should not be used
-// Internal usage only
-func (r *ListImagesResponse) UnsafeGetTotalCount() uint32 {
- return r.TotalCount
-}
-
-// UnsafeAppend should not be used
-// Internal usage only
-func (r *ListImagesResponse) UnsafeAppend(res interface{}) (uint32, error) {
- results, ok := res.(*ListImagesResponse)
- if !ok {
- return 0, errors.New("%T type cannot be appended to type %T", res, r)
- }
-
- r.Images = append(r.Images, results.Images...)
- r.TotalCount += uint32(len(results.Images))
- return uint32(len(results.Images)), nil
-}
-
-// Marketplace API.
-type API struct {
- client *scw.Client
-}
-
-// NewAPI returns a API object from a Scaleway client.
-func NewAPI(client *scw.Client) *API {
- return &API{
- client: client,
- }
-}
-
-// ListImages: List marketplace images.
-func (s *API) ListImages(req *ListImagesRequest, opts ...scw.RequestOption) (*ListImagesResponse, error) {
- var err error
-
- query := url.Values{}
- parameter.AddToQuery(query, "per_page", req.PerPage)
- parameter.AddToQuery(query, "page", req.Page)
-
- scwReq := &scw.ScalewayRequest{
- Method: "GET",
- Path: "/marketplace/v1/images",
- Query: query,
- }
-
- var resp ListImagesResponse
-
- err = s.client.Do(scwReq, &resp, opts...)
- if err != nil {
- return nil, err
- }
- return &resp, nil
-}
-
-// GetImage: Get a specific marketplace image.
-func (s *API) GetImage(req *GetImageRequest, opts ...scw.RequestOption) (*GetImageResponse, error) {
- var err error
-
- if fmt.Sprint(req.ImageID) == "" {
- return nil, errors.New("field ImageID cannot be empty in request")
- }
-
- scwReq := &scw.ScalewayRequest{
- Method: "GET",
- Path: "/marketplace/v1/images/" + fmt.Sprint(req.ImageID) + "",
- }
-
- var resp GetImageResponse
-
- err = s.client.Do(scwReq, &resp, opts...)
- if err != nil {
- return nil, err
- }
- return &resp, nil
-}
diff --git a/vendor/github.com/scaleway/scaleway-sdk-go/api/marketplace/v1/marketplace_utils.go b/vendor/github.com/scaleway/scaleway-sdk-go/api/marketplace/v1/marketplace_utils.go
deleted file mode 100644
index f84175e4..00000000
--- a/vendor/github.com/scaleway/scaleway-sdk-go/api/marketplace/v1/marketplace_utils.go
+++ /dev/null
@@ -1,93 +0,0 @@
-package marketplace
-
-import (
- "fmt"
- "strings"
-
- "github.com/scaleway/scaleway-sdk-go/internal/errors"
- "github.com/scaleway/scaleway-sdk-go/scw"
-)
-
-// getLocalImage returns the correct local version of an image matching
-// the current zone and the compatible commercial type
-func (version *Version) getLocalImage(zone scw.Zone, commercialType string) (*LocalImage, error) {
- for _, localImage := range version.LocalImages {
- // Check if in correct zone
- if localImage.Zone != zone {
- continue
- }
-
- // Check if compatible with wanted commercial type
- for _, compatibleCommercialType := range localImage.CompatibleCommercialTypes {
- if compatibleCommercialType == commercialType {
- return localImage, nil
- }
- }
- }
-
- return nil, fmt.Errorf("couldn't find compatible local image for this image version (%s)", version.ID)
-}
-
-// getLatestVersion returns the current/latest version on an image,
-// or an error in case the image doesn't have a public version.
-func (image *Image) getLatestVersion() (*Version, error) {
- for _, version := range image.Versions {
- if version.ID == image.CurrentPublicVersion {
- return version, nil
- }
- }
-
- return nil, errors.New("latest version could not be found for image %s", image.Label)
-}
-
-// GetLocalImageIDByLabelRequest is used by GetLocalImageIDByLabel
-type GetLocalImageIDByLabelRequest struct {
- ImageLabel string
- Zone scw.Zone
- CommercialType string
-}
-
-// GetLocalImageIDByLabel search for an image with the given label (exact match) in the given region
-// it returns the latest version of this specific image.
-func (s *API) GetLocalImageIDByLabel(req *GetLocalImageIDByLabelRequest, opts ...scw.RequestOption) (string, error) {
- if req.Zone == "" {
- defaultZone, _ := s.client.GetDefaultZone()
- req.Zone = defaultZone
- }
-
- listImageRequest := &ListImagesRequest{}
- opts = append(opts, scw.WithAllPages())
- listImageResponse, err := s.ListImages(listImageRequest, opts...)
- if err != nil {
- return "", err
- }
-
- images := listImageResponse.Images
- label := strings.Replace(req.ImageLabel, "-", "_", -1)
- commercialType := strings.ToUpper(req.CommercialType)
-
- for _, image := range images {
- // Match label of the image
- if label == image.Label {
- latestVersion, err := image.getLatestVersion()
- if err != nil {
- return "", errors.Wrap(err, "couldn't find a matching image for the given label (%s), zone (%s) and commercial type (%s)", req.ImageLabel, req.Zone, req.CommercialType)
- }
-
- localImage, err := latestVersion.getLocalImage(req.Zone, commercialType)
- if err != nil {
- return "", errors.Wrap(err, "couldn't find a matching image for the given label (%s), zone (%s) and commercial type (%s)", req.ImageLabel, req.Zone, req.CommercialType)
- }
-
- return localImage.ID, nil
- }
- }
-
- return "", errors.New("couldn't find a matching image for the given label (%s), zone (%s) and commercial type (%s)", req.ImageLabel, req.Zone, req.CommercialType)
-}
-
-// UnsafeSetTotalCount should not be used
-// Internal usage only
-func (r *ListImagesResponse) UnsafeSetTotalCount(totalCount int) {
- r.TotalCount = uint32(totalCount)
-}
diff --git a/vendor/github.com/scaleway/scaleway-sdk-go/api/marketplace/v2/marketplace_sdk.go b/vendor/github.com/scaleway/scaleway-sdk-go/api/marketplace/v2/marketplace_sdk.go
new file mode 100644
index 00000000..1fea08e3
--- /dev/null
+++ b/vendor/github.com/scaleway/scaleway-sdk-go/api/marketplace/v2/marketplace_sdk.go
@@ -0,0 +1,711 @@
+// This file was automatically generated. DO NOT EDIT.
+// If you have any remark or suggestion do not hesitate to open an issue.
+
+// Package marketplace provides methods and message types of the marketplace v2 API.
+package marketplace
+
+import (
+ "bytes"
+ "encoding/json"
+ "fmt"
+ "net"
+ "net/http"
+ "net/url"
+ "strings"
+ "time"
+
+ "github.com/scaleway/scaleway-sdk-go/internal/errors"
+ "github.com/scaleway/scaleway-sdk-go/internal/marshaler"
+ "github.com/scaleway/scaleway-sdk-go/internal/parameter"
+ "github.com/scaleway/scaleway-sdk-go/namegenerator"
+ "github.com/scaleway/scaleway-sdk-go/scw"
+)
+
+// always import dependencies
+var (
+ _ fmt.Stringer
+ _ json.Unmarshaler
+ _ url.URL
+ _ net.IP
+ _ http.Header
+ _ bytes.Reader
+ _ time.Time
+ _ = strings.Join
+
+ _ scw.ScalewayRequest
+ _ marshaler.Duration
+ _ scw.File
+ _ = parameter.AddToQuery
+ _ = namegenerator.GetRandomName
+)
+
+type ListImagesRequestOrderBy string
+
+const (
+ ListImagesRequestOrderByNameAsc = ListImagesRequestOrderBy("name_asc")
+ ListImagesRequestOrderByNameDesc = ListImagesRequestOrderBy("name_desc")
+ ListImagesRequestOrderByCreatedAtAsc = ListImagesRequestOrderBy("created_at_asc")
+ ListImagesRequestOrderByCreatedAtDesc = ListImagesRequestOrderBy("created_at_desc")
+ ListImagesRequestOrderByUpdatedAtAsc = ListImagesRequestOrderBy("updated_at_asc")
+ ListImagesRequestOrderByUpdatedAtDesc = ListImagesRequestOrderBy("updated_at_desc")
+)
+
+func (enum ListImagesRequestOrderBy) String() string {
+ if enum == "" {
+ // return default value if empty
+ return "name_asc"
+ }
+ return string(enum)
+}
+
+func (enum ListImagesRequestOrderBy) Values() []ListImagesRequestOrderBy {
+ return []ListImagesRequestOrderBy{
+ "name_asc",
+ "name_desc",
+ "created_at_asc",
+ "created_at_desc",
+ "updated_at_asc",
+ "updated_at_desc",
+ }
+}
+
+func (enum ListImagesRequestOrderBy) MarshalJSON() ([]byte, error) {
+ return []byte(fmt.Sprintf(`"%s"`, enum)), nil
+}
+
+func (enum *ListImagesRequestOrderBy) UnmarshalJSON(data []byte) error {
+ tmp := ""
+
+ if err := json.Unmarshal(data, &tmp); err != nil {
+ return err
+ }
+
+ *enum = ListImagesRequestOrderBy(ListImagesRequestOrderBy(tmp).String())
+ return nil
+}
+
+type ListLocalImagesRequestOrderBy string
+
+const (
+ ListLocalImagesRequestOrderByTypeAsc = ListLocalImagesRequestOrderBy("type_asc")
+ ListLocalImagesRequestOrderByTypeDesc = ListLocalImagesRequestOrderBy("type_desc")
+ ListLocalImagesRequestOrderByCreatedAtAsc = ListLocalImagesRequestOrderBy("created_at_asc")
+ ListLocalImagesRequestOrderByCreatedAtDesc = ListLocalImagesRequestOrderBy("created_at_desc")
+)
+
+func (enum ListLocalImagesRequestOrderBy) String() string {
+ if enum == "" {
+ // return default value if empty
+ return "type_asc"
+ }
+ return string(enum)
+}
+
+func (enum ListLocalImagesRequestOrderBy) Values() []ListLocalImagesRequestOrderBy {
+ return []ListLocalImagesRequestOrderBy{
+ "type_asc",
+ "type_desc",
+ "created_at_asc",
+ "created_at_desc",
+ }
+}
+
+func (enum ListLocalImagesRequestOrderBy) MarshalJSON() ([]byte, error) {
+ return []byte(fmt.Sprintf(`"%s"`, enum)), nil
+}
+
+func (enum *ListLocalImagesRequestOrderBy) UnmarshalJSON(data []byte) error {
+ tmp := ""
+
+ if err := json.Unmarshal(data, &tmp); err != nil {
+ return err
+ }
+
+ *enum = ListLocalImagesRequestOrderBy(ListLocalImagesRequestOrderBy(tmp).String())
+ return nil
+}
+
+type ListVersionsRequestOrderBy string
+
+const (
+ ListVersionsRequestOrderByCreatedAtAsc = ListVersionsRequestOrderBy("created_at_asc")
+ ListVersionsRequestOrderByCreatedAtDesc = ListVersionsRequestOrderBy("created_at_desc")
+)
+
+func (enum ListVersionsRequestOrderBy) String() string {
+ if enum == "" {
+ // return default value if empty
+ return "created_at_asc"
+ }
+ return string(enum)
+}
+
+func (enum ListVersionsRequestOrderBy) Values() []ListVersionsRequestOrderBy {
+ return []ListVersionsRequestOrderBy{
+ "created_at_asc",
+ "created_at_desc",
+ }
+}
+
+func (enum ListVersionsRequestOrderBy) MarshalJSON() ([]byte, error) {
+ return []byte(fmt.Sprintf(`"%s"`, enum)), nil
+}
+
+func (enum *ListVersionsRequestOrderBy) UnmarshalJSON(data []byte) error {
+ tmp := ""
+
+ if err := json.Unmarshal(data, &tmp); err != nil {
+ return err
+ }
+
+ *enum = ListVersionsRequestOrderBy(ListVersionsRequestOrderBy(tmp).String())
+ return nil
+}
+
+type LocalImageType string
+
+const (
+ // Unspecified image type.
+ LocalImageTypeUnknownType = LocalImageType("unknown_type")
+ // An image type that can be used to create volumes which are managed via the Instance API.
+ LocalImageTypeInstanceLocal = LocalImageType("instance_local")
+ // An image type that can be used to create volumes which are managed via the Scaleway Block Storage (SBS) API.
+ LocalImageTypeInstanceSbs = LocalImageType("instance_sbs")
+)
+
+func (enum LocalImageType) String() string {
+ if enum == "" {
+ // return default value if empty
+ return "unknown_type"
+ }
+ return string(enum)
+}
+
+func (enum LocalImageType) Values() []LocalImageType {
+ return []LocalImageType{
+ "unknown_type",
+ "instance_local",
+ "instance_sbs",
+ }
+}
+
+func (enum LocalImageType) MarshalJSON() ([]byte, error) {
+ return []byte(fmt.Sprintf(`"%s"`, enum)), nil
+}
+
+func (enum *LocalImageType) UnmarshalJSON(data []byte) error {
+ tmp := ""
+
+ if err := json.Unmarshal(data, &tmp); err != nil {
+ return err
+ }
+
+ *enum = LocalImageType(LocalImageType(tmp).String())
+ return nil
+}
+
+// Category: category.
+type Category struct {
+ ID string `json:"id"`
+
+ Name string `json:"name"`
+
+ Description string `json:"description"`
+}
+
+// Image: image.
+type Image struct {
+ // ID: UUID of this image.
+ ID string `json:"id"`
+
+ // Name: name of the image.
+ Name string `json:"name"`
+
+ // Description: text description of this image.
+ Description string `json:"description"`
+
+ // Logo: URL of this image's logo.
+ Logo string `json:"logo"`
+
+ // Categories: list of categories this image belongs to.
+ Categories []string `json:"categories"`
+
+ // CreatedAt: creation date of this image.
+ CreatedAt *time.Time `json:"created_at"`
+
+ // UpdatedAt: date of the last modification of this image.
+ UpdatedAt *time.Time `json:"updated_at"`
+
+ // ValidUntil: expiration date of this image.
+ ValidUntil *time.Time `json:"valid_until"`
+
+ // Label: typically an identifier for a distribution (ex. "ubuntu_focal").
+ Label string `json:"label"`
+}
+
+// LocalImage: local image.
+type LocalImage struct {
+ // ID: version you will typically use to define an image in an API call.
+ ID string `json:"id"`
+
+ // CompatibleCommercialTypes: list of all commercial types that are compatible with this local image.
+ CompatibleCommercialTypes []string `json:"compatible_commercial_types"`
+
+ // Arch: supported architecture for this local image.
+ Arch string `json:"arch"`
+
+ // Zone: availability Zone where this local image is available.
+ Zone scw.Zone `json:"zone"`
+
+ // Label: image label this image belongs to.
+ Label string `json:"label"`
+
+ // Type: type of this local image.
+ // Default value: unknown_type
+ Type LocalImageType `json:"type"`
+}
+
+// Version: version.
+type Version struct {
+ // ID: UUID of this version.
+ ID string `json:"id"`
+
+ // Name: name of this version.
+ Name string `json:"name"`
+
+ // CreatedAt: creation date of this image version.
+ CreatedAt *time.Time `json:"created_at"`
+
+ // UpdatedAt: date of the last modification of this version.
+ UpdatedAt *time.Time `json:"updated_at"`
+
+ // PublishedAt: date this version was officially published.
+ PublishedAt *time.Time `json:"published_at"`
+}
+
+// GetCategoryRequest: get category request.
+type GetCategoryRequest struct {
+ CategoryID string `json:"-"`
+}
+
+// GetImageRequest: get image request.
+type GetImageRequest struct {
+ // ImageID: display the image name.
+ ImageID string `json:"-"`
+}
+
+// GetLocalImageRequest: get local image request.
+type GetLocalImageRequest struct {
+ LocalImageID string `json:"-"`
+}
+
+// GetVersionRequest: get version request.
+type GetVersionRequest struct {
+ VersionID string `json:"-"`
+}
+
+// ListCategoriesRequest: list categories request.
+type ListCategoriesRequest struct {
+ PageSize *uint32 `json:"-"`
+
+ Page *int32 `json:"-"`
+}
+
+// ListCategoriesResponse: list categories response.
+type ListCategoriesResponse struct {
+ Categories []*Category `json:"categories"`
+
+ TotalCount uint32 `json:"total_count"`
+}
+
+// UnsafeGetTotalCount should not be used
+// Internal usage only
+func (r *ListCategoriesResponse) UnsafeGetTotalCount() uint32 {
+ return r.TotalCount
+}
+
+// UnsafeAppend should not be used
+// Internal usage only
+func (r *ListCategoriesResponse) UnsafeAppend(res interface{}) (uint32, error) {
+ results, ok := res.(*ListCategoriesResponse)
+ if !ok {
+ return 0, errors.New("%T type cannot be appended to type %T", res, r)
+ }
+
+ r.Categories = append(r.Categories, results.Categories...)
+ r.TotalCount += uint32(len(results.Categories))
+ return uint32(len(results.Categories)), nil
+}
+
+// ListImagesRequest: list images request.
+type ListImagesRequest struct {
+ // PageSize: a positive integer lower or equal to 100 to select the number of items to display.
+ PageSize *uint32 `json:"-"`
+
+ // Page: a positive integer to choose the page to display.
+ Page *int32 `json:"-"`
+
+ // OrderBy: ordering to use.
+ // Default value: name_asc
+ OrderBy ListImagesRequestOrderBy `json:"-"`
+
+ // Arch: choose for which machine architecture to return images.
+ Arch *string `json:"-"`
+
+ // Category: choose the category of images to get.
+ Category *string `json:"-"`
+
+ // IncludeEol: choose to include end-of-life images.
+ IncludeEol bool `json:"-"`
+}
+
+// ListImagesResponse: list images response.
+type ListImagesResponse struct {
+ Images []*Image `json:"images"`
+
+ TotalCount uint32 `json:"total_count"`
+}
+
+// UnsafeGetTotalCount should not be used
+// Internal usage only
+func (r *ListImagesResponse) UnsafeGetTotalCount() uint32 {
+ return r.TotalCount
+}
+
+// UnsafeAppend should not be used
+// Internal usage only
+func (r *ListImagesResponse) UnsafeAppend(res interface{}) (uint32, error) {
+ results, ok := res.(*ListImagesResponse)
+ if !ok {
+ return 0, errors.New("%T type cannot be appended to type %T", res, r)
+ }
+
+ r.Images = append(r.Images, results.Images...)
+ r.TotalCount += uint32(len(results.Images))
+ return uint32(len(results.Images)), nil
+}
+
+// ListLocalImagesRequest: list local images request.
+type ListLocalImagesRequest struct {
+ // PageSize: a positive integer lower or equal to 100 to select the number of items to display.
+ PageSize *uint32 `json:"-"`
+
+ // Page: a positive integer to choose the page to display.
+ Page *int32 `json:"-"`
+
+ // OrderBy: ordering to use.
+ // Default value: type_asc
+ OrderBy ListLocalImagesRequestOrderBy `json:"-"`
+
+ // Zone: filter local images available on this Availability Zone.
+ Zone *scw.Zone `json:"-"`
+
+ // ImageID: filter by image id.
+ // Precisely one of ImageID, VersionID, ImageLabel must be set.
+ ImageID *string `json:"image_id,omitempty"`
+
+ // VersionID: filter by version id.
+ // Precisely one of ImageID, VersionID, ImageLabel must be set.
+ VersionID *string `json:"version_id,omitempty"`
+
+ // ImageLabel: filter by image label.
+ // Precisely one of ImageID, VersionID, ImageLabel must be set.
+ ImageLabel *string `json:"image_label,omitempty"`
+
+ // Type: filter by type.
+ // Default value: unknown_type
+ Type LocalImageType `json:"-"`
+}
+
+// ListLocalImagesResponse: list local images response.
+type ListLocalImagesResponse struct {
+ LocalImages []*LocalImage `json:"local_images"`
+
+ TotalCount uint32 `json:"total_count"`
+}
+
+// UnsafeGetTotalCount should not be used
+// Internal usage only
+func (r *ListLocalImagesResponse) UnsafeGetTotalCount() uint32 {
+ return r.TotalCount
+}
+
+// UnsafeAppend should not be used
+// Internal usage only
+func (r *ListLocalImagesResponse) UnsafeAppend(res interface{}) (uint32, error) {
+ results, ok := res.(*ListLocalImagesResponse)
+ if !ok {
+ return 0, errors.New("%T type cannot be appended to type %T", res, r)
+ }
+
+ r.LocalImages = append(r.LocalImages, results.LocalImages...)
+ r.TotalCount += uint32(len(results.LocalImages))
+ return uint32(len(results.LocalImages)), nil
+}
+
+// ListVersionsRequest: list versions request.
+type ListVersionsRequest struct {
+ ImageID string `json:"-"`
+
+ PageSize *uint32 `json:"-"`
+
+ Page *int32 `json:"-"`
+
+ // OrderBy: default value: created_at_asc
+ OrderBy ListVersionsRequestOrderBy `json:"-"`
+}
+
+// ListVersionsResponse: list versions response.
+type ListVersionsResponse struct {
+ Versions []*Version `json:"versions"`
+
+ TotalCount uint32 `json:"total_count"`
+}
+
+// UnsafeGetTotalCount should not be used
+// Internal usage only
+func (r *ListVersionsResponse) UnsafeGetTotalCount() uint32 {
+ return r.TotalCount
+}
+
+// UnsafeAppend should not be used
+// Internal usage only
+func (r *ListVersionsResponse) UnsafeAppend(res interface{}) (uint32, error) {
+ results, ok := res.(*ListVersionsResponse)
+ if !ok {
+ return 0, errors.New("%T type cannot be appended to type %T", res, r)
+ }
+
+ r.Versions = append(r.Versions, results.Versions...)
+ r.TotalCount += uint32(len(results.Versions))
+ return uint32(len(results.Versions)), nil
+}
+
+// This API allows you to find available images for use when launching a Scaleway Instance.
+type API struct {
+ client *scw.Client
+}
+
+// NewAPI returns a API object from a Scaleway client.
+func NewAPI(client *scw.Client) *API {
+ return &API{
+ client: client,
+ }
+}
+
+// ListImages: List all available images on the marketplace, their UUID, CPU architecture and description.
+func (s *API) ListImages(req *ListImagesRequest, opts ...scw.RequestOption) (*ListImagesResponse, error) {
+ var err error
+
+ defaultPageSize, exist := s.client.GetDefaultPageSize()
+ if (req.PageSize == nil || *req.PageSize == 0) && exist {
+ req.PageSize = &defaultPageSize
+ }
+
+ query := url.Values{}
+ parameter.AddToQuery(query, "page_size", req.PageSize)
+ parameter.AddToQuery(query, "page", req.Page)
+ parameter.AddToQuery(query, "order_by", req.OrderBy)
+ parameter.AddToQuery(query, "arch", req.Arch)
+ parameter.AddToQuery(query, "category", req.Category)
+ parameter.AddToQuery(query, "include_eol", req.IncludeEol)
+
+ scwReq := &scw.ScalewayRequest{
+ Method: "GET",
+ Path: "/marketplace/v2/images",
+ Query: query,
+ }
+
+ var resp ListImagesResponse
+
+ err = s.client.Do(scwReq, &resp, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return &resp, nil
+}
+
+// GetImage: Get detailed information about a marketplace image, specified by its `image_id` (UUID format).
+func (s *API) GetImage(req *GetImageRequest, opts ...scw.RequestOption) (*Image, error) {
+ var err error
+
+ if fmt.Sprint(req.ImageID) == "" {
+ return nil, errors.New("field ImageID cannot be empty in request")
+ }
+
+ scwReq := &scw.ScalewayRequest{
+ Method: "GET",
+ Path: "/marketplace/v2/images/" + fmt.Sprint(req.ImageID) + "",
+ }
+
+ var resp Image
+
+ err = s.client.Do(scwReq, &resp, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return &resp, nil
+}
+
+// ListVersions: Get a list of all available version of an image, specified by its `image_id` (UUID format).
+func (s *API) ListVersions(req *ListVersionsRequest, opts ...scw.RequestOption) (*ListVersionsResponse, error) {
+ var err error
+
+ defaultPageSize, exist := s.client.GetDefaultPageSize()
+ if (req.PageSize == nil || *req.PageSize == 0) && exist {
+ req.PageSize = &defaultPageSize
+ }
+
+ query := url.Values{}
+ parameter.AddToQuery(query, "image_id", req.ImageID)
+ parameter.AddToQuery(query, "page_size", req.PageSize)
+ parameter.AddToQuery(query, "page", req.Page)
+ parameter.AddToQuery(query, "order_by", req.OrderBy)
+
+ scwReq := &scw.ScalewayRequest{
+ Method: "GET",
+ Path: "/marketplace/v2/versions",
+ Query: query,
+ }
+
+ var resp ListVersionsResponse
+
+ err = s.client.Do(scwReq, &resp, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return &resp, nil
+}
+
+// GetVersion: Get information such as the name, creation date, last update and published date for an image version specified by its `version_id` (UUID format).
+func (s *API) GetVersion(req *GetVersionRequest, opts ...scw.RequestOption) (*Version, error) {
+ var err error
+
+ if fmt.Sprint(req.VersionID) == "" {
+ return nil, errors.New("field VersionID cannot be empty in request")
+ }
+
+ scwReq := &scw.ScalewayRequest{
+ Method: "GET",
+ Path: "/marketplace/v2/versions/" + fmt.Sprint(req.VersionID) + "",
+ }
+
+ var resp Version
+
+ err = s.client.Do(scwReq, &resp, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return &resp, nil
+}
+
+// ListLocalImages: List information about local images in a specific Availability Zone, specified by its `image_id` (UUID format), `version_id` (UUID format) or `image_label`. Only one of these three parameters may be set.
+func (s *API) ListLocalImages(req *ListLocalImagesRequest, opts ...scw.RequestOption) (*ListLocalImagesResponse, error) {
+ var err error
+
+ defaultPageSize, exist := s.client.GetDefaultPageSize()
+ if (req.PageSize == nil || *req.PageSize == 0) && exist {
+ req.PageSize = &defaultPageSize
+ }
+
+ defaultZone, exist := s.client.GetDefaultZone()
+ if (req.Zone == nil || *req.Zone == "") && exist {
+ req.Zone = &defaultZone
+ }
+
+ query := url.Values{}
+ parameter.AddToQuery(query, "page_size", req.PageSize)
+ parameter.AddToQuery(query, "page", req.Page)
+ parameter.AddToQuery(query, "order_by", req.OrderBy)
+ parameter.AddToQuery(query, "zone", req.Zone)
+ parameter.AddToQuery(query, "type", req.Type)
+ parameter.AddToQuery(query, "image_id", req.ImageID)
+ parameter.AddToQuery(query, "version_id", req.VersionID)
+ parameter.AddToQuery(query, "image_label", req.ImageLabel)
+
+ scwReq := &scw.ScalewayRequest{
+ Method: "GET",
+ Path: "/marketplace/v2/local-images",
+ Query: query,
+ }
+
+ var resp ListLocalImagesResponse
+
+ err = s.client.Do(scwReq, &resp, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return &resp, nil
+}
+
+// GetLocalImage: Get detailed information about a local image, including compatible commercial types, supported architecture, labels and the Availability Zone of the image, specified by its `local_image_id` (UUID format).
+func (s *API) GetLocalImage(req *GetLocalImageRequest, opts ...scw.RequestOption) (*LocalImage, error) {
+ var err error
+
+ if fmt.Sprint(req.LocalImageID) == "" {
+ return nil, errors.New("field LocalImageID cannot be empty in request")
+ }
+
+ scwReq := &scw.ScalewayRequest{
+ Method: "GET",
+ Path: "/marketplace/v2/local-images/" + fmt.Sprint(req.LocalImageID) + "",
+ }
+
+ var resp LocalImage
+
+ err = s.client.Do(scwReq, &resp, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return &resp, nil
+}
+
+// ListCategories: Get a list of all existing categories. The output can be paginated.
+func (s *API) ListCategories(req *ListCategoriesRequest, opts ...scw.RequestOption) (*ListCategoriesResponse, error) {
+ var err error
+
+ defaultPageSize, exist := s.client.GetDefaultPageSize()
+ if (req.PageSize == nil || *req.PageSize == 0) && exist {
+ req.PageSize = &defaultPageSize
+ }
+
+ query := url.Values{}
+ parameter.AddToQuery(query, "page_size", req.PageSize)
+ parameter.AddToQuery(query, "page", req.Page)
+
+ scwReq := &scw.ScalewayRequest{
+ Method: "GET",
+ Path: "/marketplace/v2/categories",
+ Query: query,
+ }
+
+ var resp ListCategoriesResponse
+
+ err = s.client.Do(scwReq, &resp, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return &resp, nil
+}
+
+// GetCategory: Get information about a specific category of the marketplace catalog, specified by its `category_id` (UUID format).
+func (s *API) GetCategory(req *GetCategoryRequest, opts ...scw.RequestOption) (*Category, error) {
+ var err error
+
+ if fmt.Sprint(req.CategoryID) == "" {
+ return nil, errors.New("field CategoryID cannot be empty in request")
+ }
+
+ scwReq := &scw.ScalewayRequest{
+ Method: "GET",
+ Path: "/marketplace/v2/categories/" + fmt.Sprint(req.CategoryID) + "",
+ }
+
+ var resp Category
+
+ err = s.client.Do(scwReq, &resp, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return &resp, nil
+}
diff --git a/vendor/github.com/scaleway/scaleway-sdk-go/api/marketplace/v2/marketplace_utils.go b/vendor/github.com/scaleway/scaleway-sdk-go/api/marketplace/v2/marketplace_utils.go
new file mode 100644
index 00000000..33ec80b0
--- /dev/null
+++ b/vendor/github.com/scaleway/scaleway-sdk-go/api/marketplace/v2/marketplace_utils.go
@@ -0,0 +1,85 @@
+package marketplace
+
+import (
+ "strings"
+
+ "github.com/scaleway/scaleway-sdk-go/internal/errors"
+ "github.com/scaleway/scaleway-sdk-go/scw"
+)
+
+// FindByLabel returns the first image with the given label in the image list
+// Cannot find an image if it is not in the ListImagesResponse struct
+// Use scw.WithAllPages when listing image to get all images
+func (r *ListImagesResponse) FindByLabel(label string) *Image {
+ for _, image := range r.Images {
+ if image.Label == label {
+ return image
+ }
+ }
+ return nil
+}
+
+type GetImageByLabelRequest struct {
+ Label string
+}
+
+// GetImageByLabel returns the image with the given label
+func (s *API) GetImageByLabel(req *GetImageByLabelRequest, opts ...scw.RequestOption) (*Image, error) {
+ listImagesRequest := &ListImagesRequest{}
+ opts = append(opts, scw.WithAllPages())
+
+ listImagesResponse, err := s.ListImages(listImagesRequest, opts...)
+ if err != nil {
+ return nil, err
+ }
+
+ image := listImagesResponse.FindByLabel(req.Label)
+ if image == nil {
+ return nil, errors.New("couldn't find a matching image for the given label (%s)", req.Label)
+ }
+
+ return image, nil
+}
+
+type GetLocalImageByLabelRequest struct {
+ ImageLabel string
+ Zone scw.Zone
+ CommercialType string
+ Type LocalImageType
+}
+
+// GetLocalImageByLabel returns the local image for the given image label in the given zone and compatible with given commercial type
+func (s *API) GetLocalImageByLabel(req *GetLocalImageByLabelRequest, opts ...scw.RequestOption) (*LocalImage, error) {
+ if req.Zone == "" {
+ defaultZone, _ := s.client.GetDefaultZone()
+ req.Zone = defaultZone
+ }
+ req.CommercialType = strings.ToUpper(req.CommercialType)
+
+ resp, err := s.ListLocalImages(&ListLocalImagesRequest{
+ ImageLabel: scw.StringPtr(req.ImageLabel),
+ Zone: &req.Zone,
+ Type: req.Type,
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ for _, localImage := range resp.LocalImages {
+ if localImage.IsCompatible(req.CommercialType) {
+ return localImage, nil
+ }
+ }
+
+ return nil, errors.New("couldn't find a local image for the given zone (%s) and commercial type (%s)", req.Zone, req.CommercialType)
+}
+
+// IsCompatible returns true if a local image is compatible with the given instance type
+// commercialType should be an uppercase string ex: DEV1-S
+func (li *LocalImage) IsCompatible(commercialType string) bool {
+ for _, compatibleCommercialType := range li.CompatibleCommercialTypes {
+ if compatibleCommercialType == commercialType {
+ return true
+ }
+ }
+ return false
+}
diff --git a/vendor/github.com/scaleway/scaleway-sdk-go/internal/async/wait.go b/vendor/github.com/scaleway/scaleway-sdk-go/internal/async/wait.go
index 7e0d2158..01e920a7 100644
--- a/vendor/github.com/scaleway/scaleway-sdk-go/internal/async/wait.go
+++ b/vendor/github.com/scaleway/scaleway-sdk-go/internal/async/wait.go
@@ -56,7 +56,6 @@ func WaitSync(config *WaitSyncConfig) (terminalValue interface{}, err error) {
for {
// get the payload
value, stopCondition, err := config.Get()
-
// send the payload
if err != nil {
resultErr <- err
diff --git a/vendor/github.com/scaleway/scaleway-sdk-go/internal/auth/jwt.go b/vendor/github.com/scaleway/scaleway-sdk-go/internal/auth/jwt.go
index 19c81d41..1274c51c 100644
--- a/vendor/github.com/scaleway/scaleway-sdk-go/internal/auth/jwt.go
+++ b/vendor/github.com/scaleway/scaleway-sdk-go/internal/auth/jwt.go
@@ -11,7 +11,7 @@ type JWT struct {
}
// XSessionTokenHeader is Scaleway auth header for browser
-const XSessionTokenHeader = "x-session-token" // #nosec G101
+const XSessionTokenHeader = "X-Session-Token" // #nosec G101
// NewJWT create a token authentication from a jwt
func NewJWT(token string) *JWT {
diff --git a/vendor/github.com/scaleway/scaleway-sdk-go/internal/auth/no_auth.go b/vendor/github.com/scaleway/scaleway-sdk-go/internal/auth/no_auth.go
index 2181c57c..5a868694 100644
--- a/vendor/github.com/scaleway/scaleway-sdk-go/internal/auth/no_auth.go
+++ b/vendor/github.com/scaleway/scaleway-sdk-go/internal/auth/no_auth.go
@@ -2,8 +2,7 @@ package auth
import "net/http"
-type NoAuth struct {
-}
+type NoAuth struct{}
// NewNoAuth return an auth with no authentication method
func NewNoAuth() *NoAuth {
diff --git a/vendor/github.com/scaleway/scaleway-sdk-go/logger/default_logger.go b/vendor/github.com/scaleway/scaleway-sdk-go/logger/default_logger.go
index bdf1de8d..e21dc7d7 100644
--- a/vendor/github.com/scaleway/scaleway-sdk-go/logger/default_logger.go
+++ b/vendor/github.com/scaleway/scaleway-sdk-go/logger/default_logger.go
@@ -3,14 +3,15 @@ package logger
import (
"fmt"
"io"
- "io/ioutil"
"log"
"os"
"strconv"
)
-var DefaultLogger = newLogger(os.Stderr, LogLevelWarning)
-var logger Logger = DefaultLogger
+var (
+ DefaultLogger = newLogger(os.Stderr, LogLevelWarning)
+ logger Logger = DefaultLogger
+)
// loggerT is the default logger used by scaleway-sdk-go.
type loggerT struct {
@@ -27,30 +28,35 @@ func (g *loggerT) Init(w io.Writer, level LogLevel) {
// Debugf logs to the DEBUG log. Arguments are handled in the manner of fmt.Printf.
func Debugf(format string, args ...interface{}) { logger.Debugf(format, args...) }
+
func (g *loggerT) Debugf(format string, args ...interface{}) {
g.m[LogLevelDebug].Printf(format, args...)
}
// Infof logs to the INFO log. Arguments are handled in the manner of fmt.Printf.
func Infof(format string, args ...interface{}) { logger.Infof(format, args...) }
+
func (g *loggerT) Infof(format string, args ...interface{}) {
g.m[LogLevelInfo].Printf(format, args...)
}
// Warningf logs to the WARNING log. Arguments are handled in the manner of fmt.Printf.
func Warningf(format string, args ...interface{}) { logger.Warningf(format, args...) }
+
func (g *loggerT) Warningf(format string, args ...interface{}) {
g.m[LogLevelWarning].Printf(format, args...)
}
// Errorf logs to the ERROR log. Arguments are handled in the manner of fmt.Printf.
func Errorf(format string, args ...interface{}) { logger.Errorf(format, args...) }
+
func (g *loggerT) Errorf(format string, args ...interface{}) {
g.m[LogLevelError].Printf(format, args...)
}
// ShouldLog reports whether verbosity level l is at least the requested verbose level.
func ShouldLog(level LogLevel) bool { return logger.ShouldLog(level) }
+
func (g *loggerT) ShouldLog(level LogLevel) bool {
return level >= g.v
}
@@ -72,10 +78,10 @@ func isEnabled(envKey string) bool {
// newLogger creates a logger to be used as default logger.
// All logs are written to w.
func newLogger(w io.Writer, level LogLevel) *loggerT {
- errorW := ioutil.Discard
- warningW := ioutil.Discard
- infoW := ioutil.Discard
- debugW := ioutil.Discard
+ errorW := io.Discard
+ warningW := io.Discard
+ infoW := io.Discard
+ debugW := io.Discard
if isEnabled(DebugEnv) {
level = LogLevelDebug
}
diff --git a/vendor/github.com/scaleway/scaleway-sdk-go/namegenerator/name_generator.go b/vendor/github.com/scaleway/scaleway-sdk-go/namegenerator/name_generator.go
index 11fda453..b86b52c3 100644
--- a/vendor/github.com/scaleway/scaleway-sdk-go/namegenerator/name_generator.go
+++ b/vendor/github.com/scaleway/scaleway-sdk-go/namegenerator/name_generator.go
@@ -397,7 +397,7 @@ var (
// Jane Goodall - British primatologist, ethologist, and anthropologist who is considered to be the world's foremost expert on chimpanzees - https://en.wikipedia.org/wiki/Jane_Goodall
"goodall",
- // Stephen Jay Gould was was an American paleontologist, evolutionary biologist, and historian of science. He is most famous for the theory of punctuated equilibrium - https://en.wikipedia.org/wiki/Stephen_Jay_Gould
+ // Stephen Jay Gould was an American paleontologist, evolutionary biologist, and historian of science. He is most famous for the theory of punctuated equilibrium - https://en.wikipedia.org/wiki/Stephen_Jay_Gould
"gould",
// Carolyn Widney Greider - American molecular biologist and joint winner of the 2009 Nobel Prize for Physiology or Medicine for the discovery of telomerase. https://en.wikipedia.org/wiki/Carol_W._Greider
@@ -853,7 +853,7 @@ var (
// formatted as "scw-adjective-surname". For example 'scw-focused-turing'.
func GetRandomName(prefixes ...string) string {
begin:
- parts := append(prefixes, left[r.Intn(len(left))], right[r.Intn(len(right))])
+ parts := append(prefixes, left[r.Intn(len(left))], right[r.Intn(len(right))]) //nolint:gocritic
name := strings.Join(parts, "-")
if strings.Contains(name, "boring-wozniak") /* Steve Wozniak is not boring */ {
goto begin
diff --git a/vendor/github.com/scaleway/scaleway-sdk-go/scw/README.md b/vendor/github.com/scaleway/scaleway-sdk-go/scw/README.md
index e35e05df..1ddc4867 100644
--- a/vendor/github.com/scaleway/scaleway-sdk-go/scw/README.md
+++ b/vendor/github.com/scaleway/scaleway-sdk-go/scw/README.md
@@ -39,14 +39,14 @@ scw.NewClient(
## Environment variables
-| Variable | Description | Legacy variables |
-| :----------------------------- | :----------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------ |
-| `$SCW_ACCESS_KEY` | Access key of a token ([get yours](https://console.scaleway.com/project/credentials)) | `$SCALEWAY_ACCESS_KEY` (used by terraform) |
-| `$SCW_SECRET_KEY` | Secret key of a token ([get yours](https://console.scaleway.com/project/credentials)) | `$SCW_TOKEN` (used by cli), `$SCALEWAY_TOKEN` (used by terraform), `$SCALEWAY_ACCESS_KEY` (used by terraform) |
-| `$SCW_DEFAULT_ORGANIZATION_ID` | Your default organization ID ([get yours](https://console.scaleway.com/project/credentials)) | `$SCW_ORGANIZATION` (used by cli),`$SCALEWAY_ORGANIZATION` (used by terraform) |
-| `$SCW_DEFAULT_PROJECT_ID` | Your default project ID ([get yours](https://console.scaleway.com/project/credentials)) | |
-| `$SCW_DEFAULT_REGION` | Your default [region](https://developers.scaleway.com/en/quickstart/#region-and-zone) | `$SCW_REGION` (used by cli),`$SCALEWAY_REGION` (used by terraform) |
-| `$SCW_DEFAULT_ZONE` | Your default [availability zone](https://developers.scaleway.com/en/quickstart/#region-and-zone) | `$SCW_ZONE` (used by cli),`$SCALEWAY_ZONE` (used by terraform) |
-| `$SCW_API_URL` | Url of the API | - |
-| `$SCW_INSECURE` | Set this to `true` to enable the insecure mode | `$SCW_TLSVERIFY` (inverse flag used by the cli) |
-| `$SCW_PROFILE` | Set the config profile to use | - |
+| Variable | Description | Legacy variables |
+|:-------------------------------|:----------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------|
+| `$SCW_ACCESS_KEY` | Access key of a token ([get yours](https://console.scaleway.com/project/credentials)) | `$SCALEWAY_ACCESS_KEY` (used by terraform) |
+| `$SCW_SECRET_KEY` | Secret key of a token ([get yours](https://console.scaleway.com/project/credentials)) | `$SCW_TOKEN` (used by cli), `$SCALEWAY_TOKEN` (used by terraform), `$SCALEWAY_ACCESS_KEY` (used by terraform) |
+| `$SCW_DEFAULT_ORGANIZATION_ID` | Your default organization ID ([get yours](https://console.scaleway.com/project/credentials)) | `$SCW_ORGANIZATION` (used by cli),`$SCALEWAY_ORGANIZATION` (used by terraform) |
+| `$SCW_DEFAULT_PROJECT_ID` | Your default project ID ([get yours](https://console.scaleway.com/project/credentials)) | |
+| `$SCW_DEFAULT_REGION` | Your default [region](https://www.scaleway.com/en/developers/api/#region-and-zone) | `$SCW_REGION` (used by cli),`$SCALEWAY_REGION` (used by terraform) |
+| `$SCW_DEFAULT_ZONE` | Your default [availability zone](https://www.scaleway.com/en/developers/api/#region-and-zone) | `$SCW_ZONE` (used by cli),`$SCALEWAY_ZONE` (used by terraform) |
+| `$SCW_API_URL` | Url of the API | - |
+| `$SCW_INSECURE` | Set this to `true` to enable the insecure mode | `$SCW_TLSVERIFY` (inverse flag used by the cli) |
+| `$SCW_PROFILE` | Set the config profile to use | - |
diff --git a/vendor/github.com/scaleway/scaleway-sdk-go/scw/client.go b/vendor/github.com/scaleway/scaleway-sdk-go/scw/client.go
index 01f3fa79..75e5338a 100644
--- a/vendor/github.com/scaleway/scaleway-sdk-go/scw/client.go
+++ b/vendor/github.com/scaleway/scaleway-sdk-go/scw/client.go
@@ -6,7 +6,6 @@ import (
"fmt"
"io"
"math"
- "net"
"net/http"
"reflect"
"strconv"
@@ -67,16 +66,16 @@ func NewClient(opts ...ClientOption) (*Client, error) {
// insecure mode
if s.insecure {
- logger.Debugf("client: using insecure mode")
+ logger.Debugf("client: using insecure mode\n")
setInsecureMode(s.httpClient)
}
if logger.ShouldLog(logger.LogLevelDebug) {
- logger.Debugf("client: using request logger")
+ logger.Debugf("client: using request logger\n")
setRequestLogging(s.httpClient)
}
- logger.Debugf("client: using sdk version " + version)
+ logger.Debugf("client: using sdk version " + getVersion() + "\n")
return &Client{
auth: s.token,
@@ -190,7 +189,6 @@ func (c *Client) Do(req *ScalewayRequest, res interface{}, opts ...RequestOption
// do performs a single HTTP request based on the ScalewayRequest object.
func (c *Client) do(req *ScalewayRequest, res interface{}) (sdkErr error) {
-
if req == nil {
return errors.New("request must be non-nil")
}
@@ -200,7 +198,7 @@ func (c *Client) do(req *ScalewayRequest, res interface{}) (sdkErr error) {
if sdkErr != nil {
return sdkErr
}
- logger.Debugf("creating %s request on %s", req.Method, url.String())
+ logger.Debugf("creating %s request on %s\n", req.Method, url.String())
// build request
httpRequest, err := http.NewRequest(req.Method, url.String(), req.Body)
@@ -354,12 +352,12 @@ func (c *Client) doListAll(req *ScalewayRequest, res interface{}) (err error) {
return errors.New("%T does not support pagination", res)
}
-// doListLocalities collects all localities using mutliple list requests and aggregate all results on a lister response
+// doListLocalities collects all localities using multiple list requests and aggregate all results on a lister response
// results is sorted by locality
func (c *Client) doListLocalities(req *ScalewayRequest, res interface{}, localities []string) (err error) {
path := req.Path
if !strings.Contains(path, "%locality%") {
- return fmt.Errorf("request is not a valid locality request")
+ return errors.New("request is not a valid locality request")
}
// Requests are parallelized
responseMutex := sync.Mutex{}
@@ -420,7 +418,7 @@ func (c *Client) doListZones(req *ScalewayRequest, res interface{}, zones []Zone
}
}
if !strings.Contains(req.Path, "%locality%") {
- return fmt.Errorf("request is not a valid zoned request")
+ return errors.New("request is not a valid zoned request")
}
localities := make([]string, 0, len(zones))
for _, zone := range zones {
@@ -451,7 +449,7 @@ func (c *Client) doListRegions(req *ScalewayRequest, res interface{}, regions []
}
}
if !strings.Contains(req.Path, "%locality%") {
- return fmt.Errorf("request is not a valid zoned request")
+ return errors.New("request is not a valid zoned request")
}
localities := make([]string, 0, len(regions))
for _, region := range regions {
@@ -546,13 +544,8 @@ func newVariableFromType(t interface{}) interface{} {
func newHTTPClient() *http.Client {
return &http.Client{
- Timeout: 30 * time.Second,
- Transport: &http.Transport{
- DialContext: (&net.Dialer{Timeout: 5 * time.Second}).DialContext,
- TLSHandshakeTimeout: 5 * time.Second,
- ResponseHeaderTimeout: 30 * time.Second,
- MaxIdleConnsPerHost: 20,
- },
+ Timeout: 30 * time.Second,
+ Transport: http.DefaultTransport.(*http.Transport).Clone(),
}
}
diff --git a/vendor/github.com/scaleway/scaleway-sdk-go/scw/config.go b/vendor/github.com/scaleway/scaleway-sdk-go/scw/config.go
index 71d79d5f..d7ed46f1 100644
--- a/vendor/github.com/scaleway/scaleway-sdk-go/scw/config.go
+++ b/vendor/github.com/scaleway/scaleway-sdk-go/scw/config.go
@@ -3,22 +3,20 @@ package scw
import (
"bytes"
goerrors "errors"
- "io/ioutil"
"os"
"path/filepath"
"strings"
"text/template"
- "gopkg.in/yaml.v2"
-
"github.com/scaleway/scaleway-sdk-go/internal/auth"
"github.com/scaleway/scaleway-sdk-go/internal/errors"
"github.com/scaleway/scaleway-sdk-go/logger"
+ "gopkg.in/yaml.v2"
)
const (
documentationLink = "https://github.com/scaleway/scaleway-sdk-go/blob/master/scw/README.md"
- defaultConfigPermission = 0600
+ defaultConfigPermission = 0o600
// Reserved name for the default profile.
DefaultProfileName = "default"
@@ -218,7 +216,7 @@ func LoadConfigFromPath(path string) (*Config, error) {
return nil, err
}
- file, err := ioutil.ReadFile(path)
+ file, err := os.ReadFile(path)
if err != nil {
return nil, errors.Wrap(err, "cannot read config file")
}
@@ -255,10 +253,10 @@ func (c *Config) GetProfile(profileName string) (*Profile, error) {
func (c *Config) GetActiveProfile() (*Profile, error) {
switch {
case os.Getenv(ScwActiveProfileEnv) != "":
- logger.Debugf("using active profile from env: %s=%s", ScwActiveProfileEnv, os.Getenv(ScwActiveProfileEnv))
+ logger.Debugf("using active profile from env: %s=%s\n", ScwActiveProfileEnv, os.Getenv(ScwActiveProfileEnv))
return c.GetProfile(os.Getenv(ScwActiveProfileEnv))
case c.ActiveProfile != nil:
- logger.Debugf("using active profile from config: active_profile=%s", ScwActiveProfileEnv, *c.ActiveProfile)
+ logger.Debugf("using active profile from config: active_profile=%s\n", *c.ActiveProfile)
return c.GetProfile(*c.ActiveProfile)
default:
return &c.Profile, nil
@@ -299,13 +297,13 @@ func (c *Config) SaveTo(path string) error {
}
// STEP 2: create config path dir in cases it didn't exist before
- err = os.MkdirAll(filepath.Dir(path), 0700)
+ err = os.MkdirAll(filepath.Dir(path), 0o700)
if err != nil {
return err
}
// STEP 3: write new config file
- err = ioutil.WriteFile(path, []byte(file), defaultConfigPermission)
+ err = os.WriteFile(path, []byte(file), defaultConfigPermission)
if err != nil {
return err
}
diff --git a/vendor/github.com/scaleway/scaleway-sdk-go/scw/custom_types.go b/vendor/github.com/scaleway/scaleway-sdk-go/scw/custom_types.go
index 673a598e..d9d89cd5 100644
--- a/vendor/github.com/scaleway/scaleway-sdk-go/scw/custom_types.go
+++ b/vendor/github.com/scaleway/scaleway-sdk-go/scw/custom_types.go
@@ -112,7 +112,7 @@ type Money struct {
// - (value = 1.123456789, precision = 9) => Money{Units = 1, Nanos = 123456789}
func NewMoneyFromFloat(value float64, currencyCode string, precision int) *Money {
if precision > 9 {
- panic(fmt.Errorf("max precision is 9"))
+ panic(errors.New("max precision is 9"))
}
strValue := strconv.FormatFloat(value, 'f', precision, 64)
@@ -137,7 +137,7 @@ func (m Money) String() string {
currencySign, currencySignFound := currencySignsByCodes[m.CurrencyCode]
if !currencySignFound {
- logger.Debugf("%s currency code is not supported", m.CurrencyCode)
+ logger.Debugf("%s currency code is not supported\n", m.CurrencyCode)
currencySign = m.CurrencyCode
}
@@ -206,7 +206,7 @@ func (tsp *TimeSeriesPoint) UnmarshalJSON(b []byte) error {
}
if len(point) != 2 {
- return fmt.Errorf("invalid point array")
+ return errors.New("invalid point array")
}
strTimestamp, isStrTimestamp := point[0].(string)
@@ -448,3 +448,15 @@ func EncodeJSONObject(v JSONObject, escape EscapeMode) (string, error) {
panic(fmt.Sprintf("EncodeJSONObject called with unknown EscapeMode, %v", escape))
}
+
+// Decimal is a representation of a decimal value, such as 2.5.
+// Comparable to language-native decimal formats, such as Java's BigDecimal or
+// Python's decimal.Decimal.
+// Lookup protobuf google.type.Decimal for details.
+type Decimal string
+
+var _ fmt.Stringer = (*Decimal)(nil)
+
+func (d Decimal) String() string {
+ return string(d)
+}
diff --git a/vendor/github.com/scaleway/scaleway-sdk-go/scw/env.go b/vendor/github.com/scaleway/scaleway-sdk-go/scw/env.go
index 27e5e685..ae42e3e3 100644
--- a/vendor/github.com/scaleway/scaleway-sdk-go/scw/env.go
+++ b/vendor/github.com/scaleway/scaleway-sdk-go/scw/env.go
@@ -35,20 +35,20 @@ const (
cliSecretKeyEnv = "SCW_TOKEN"
// TBD
- //cliVerboseEnv = "SCW_VERBOSE_API"
- //cliDebugEnv = "DEBUG"
- //cliNoCheckVersionEnv = "SCW_NOCHECKVERSION"
- //cliTestWithRealAPIEnv = "TEST_WITH_REAL_API"
- //cliSecureExecEnv = "SCW_SECURE_EXEC"
- //cliGatewayEnv = "SCW_GATEWAY"
- //cliSensitiveEnv = "SCW_SENSITIVE"
- //cliAccountAPIEnv = "SCW_ACCOUNT_API"
- //cliMetadataAPIEnv = "SCW_METADATA_API"
- //cliMarketPlaceAPIEnv = "SCW_MARKETPLACE_API"
- //cliComputePar1APIEnv = "SCW_COMPUTE_PAR1_API"
- //cliComputeAms1APIEnv = "SCW_COMPUTE_AMS1_API"
- //cliCommercialTypeEnv = "SCW_COMMERCIAL_TYPE"
- //cliTargetArchEnv = "SCW_TARGET_ARCH"
+ // cliVerboseEnv = "SCW_VERBOSE_API"
+ // cliDebugEnv = "DEBUG"
+ // cliNoCheckVersionEnv = "SCW_NOCHECKVERSION"
+ // cliTestWithRealAPIEnv = "TEST_WITH_REAL_API"
+ // cliSecureExecEnv = "SCW_SECURE_EXEC"
+ // cliGatewayEnv = "SCW_GATEWAY"
+ // cliSensitiveEnv = "SCW_SENSITIVE"
+ // cliAccountAPIEnv = "SCW_ACCOUNT_API"
+ // cliMetadataAPIEnv = "SCW_METADATA_API"
+ // cliMarketPlaceAPIEnv = "SCW_MARKETPLACE_API"
+ // cliComputePar1APIEnv = "SCW_COMPUTE_PAR1_API"
+ // cliComputeAms1APIEnv = "SCW_COMPUTE_AMS1_API"
+ // cliCommercialTypeEnv = "SCW_COMMERCIAL_TYPE"
+ // cliTargetArchEnv = "SCW_TARGET_ARCH"
)
const (
@@ -115,15 +115,15 @@ func LoadEnvProfile() *Profile {
func getEnv(upToDateKey string, deprecatedKeys ...string) (string, string, bool) {
value, exist := os.LookupEnv(upToDateKey)
if exist {
- logger.Debugf("reading value from %s", upToDateKey)
+ logger.Debugf("reading value from %s\n", upToDateKey)
return value, upToDateKey, true
}
for _, key := range deprecatedKeys {
value, exist := os.LookupEnv(key)
if exist {
- logger.Debugf("reading value from %s", key)
- logger.Warningf("%s is deprecated, please use %s instead", key, upToDateKey)
+ logger.Debugf("reading value from %s\n", key)
+ logger.Warningf("%s is deprecated, please use %s instead\n", key, upToDateKey)
return value, key, true
}
}
diff --git a/vendor/github.com/scaleway/scaleway-sdk-go/scw/errors.go b/vendor/github.com/scaleway/scaleway-sdk-go/scw/errors.go
index 3563b0de..c98fcf6f 100644
--- a/vendor/github.com/scaleway/scaleway-sdk-go/scw/errors.go
+++ b/vendor/github.com/scaleway/scaleway-sdk-go/scw/errors.go
@@ -3,7 +3,7 @@ package scw
import (
"encoding/json"
"fmt"
- "io/ioutil"
+ "io"
"net/http"
"sort"
"strings"
@@ -59,8 +59,9 @@ func (e *ResponseError) UnmarshalJSON(b []byte) error {
// IsScwSdkError implement SdkError interface
func (e *ResponseError) IsScwSdkError() {}
+
func (e *ResponseError) Error() string {
- s := fmt.Sprintf("scaleway-sdk-go: http error %s", e.Status)
+ s := "scaleway-sdk-go: http error " + e.Status
if e.Resource != "" {
s = fmt.Sprintf("%s: resource %s", s, e.Resource)
@@ -76,6 +77,7 @@ func (e *ResponseError) Error() string {
return s
}
+
func (e *ResponseError) GetRawBody() json.RawMessage {
return e.RawBody
}
@@ -95,7 +97,7 @@ func hasResponseError(res *http.Response) error {
return newErr
}
- body, err := ioutil.ReadAll(res.Body)
+ body, err := io.ReadAll(res.Body)
if err != nil {
return errors.Wrap(err, "cannot read error response body")
}
@@ -214,6 +216,7 @@ type InvalidArgumentsError struct {
// IsScwSdkError implements the SdkError interface
func (e *InvalidArgumentsError) IsScwSdkError() {}
+
func (e *InvalidArgumentsError) Error() string {
invalidArgs := make([]string, len(e.Details))
for i, d := range e.Details {
@@ -235,6 +238,7 @@ func (e *InvalidArgumentsError) Error() string {
return "scaleway-sdk-go: invalid argument(s): " + strings.Join(invalidArgs, "; ")
}
+
func (e *InvalidArgumentsError) GetRawBody() json.RawMessage {
return e.RawBody
}
@@ -247,7 +251,7 @@ type UnknownResource struct {
}
// ToSdkError returns a standard error InvalidArgumentsError or nil Fields is nil.
-func (e *UnknownResource) ToResourceNotFoundError() SdkError {
+func (e *UnknownResource) ToResourceNotFoundError() *ResourceNotFoundError {
resourceNotFound := &ResourceNotFoundError{
RawBody: e.RawBody,
}
@@ -288,9 +292,9 @@ type InvalidRequestError struct {
}
// ToSdkError returns a standard error InvalidArgumentsError or nil Fields is nil.
-func (e *InvalidRequestError) ToInvalidArgumentsError() SdkError {
+func (e *InvalidRequestError) ToInvalidArgumentsError() *InvalidArgumentsError {
// If error has no fields, it is not an InvalidArgumentsError.
- if e.Fields == nil || len(e.Fields) == 0 {
+ if len(e.Fields) == 0 {
return nil
}
@@ -314,7 +318,7 @@ func (e *InvalidRequestError) ToInvalidArgumentsError() SdkError {
return invalidArguments
}
-func (e *InvalidRequestError) ToQuotasExceededError() SdkError {
+func (e *InvalidRequestError) ToQuotasExceededError() *QuotasExceededError {
if !strings.Contains(strings.ToLower(e.Message), "quota exceeded for this resource") {
return nil
}
@@ -344,6 +348,7 @@ type QuotasExceededError struct {
// IsScwSdkError implements the SdkError interface
func (e *QuotasExceededError) IsScwSdkError() {}
+
func (e *QuotasExceededError) Error() string {
invalidArgs := make([]string, len(e.Details))
for i, d := range e.Details {
@@ -352,6 +357,7 @@ func (e *QuotasExceededError) Error() string {
return "scaleway-sdk-go: quota exceeded(s): " + strings.Join(invalidArgs, "; ")
}
+
func (e *QuotasExceededError) GetRawBody() json.RawMessage {
return e.RawBody
}
@@ -367,6 +373,7 @@ type PermissionsDeniedError struct {
// IsScwSdkError implements the SdkError interface
func (e *PermissionsDeniedError) IsScwSdkError() {}
+
func (e *PermissionsDeniedError) Error() string {
invalidArgs := make([]string, len(e.Details))
for i, d := range e.Details {
@@ -375,6 +382,7 @@ func (e *PermissionsDeniedError) Error() string {
return "scaleway-sdk-go: insufficient permissions: " + strings.Join(invalidArgs, "; ")
}
+
func (e *PermissionsDeniedError) GetRawBody() json.RawMessage {
return e.RawBody
}
@@ -389,9 +397,11 @@ type TransientStateError struct {
// IsScwSdkError implements the SdkError interface
func (e *TransientStateError) IsScwSdkError() {}
+
func (e *TransientStateError) Error() string {
return fmt.Sprintf("scaleway-sdk-go: resource %s with ID %s is in a transient state: %s", e.Resource, e.ResourceID, e.CurrentState)
}
+
func (e *TransientStateError) GetRawBody() json.RawMessage {
return e.RawBody
}
@@ -405,9 +415,11 @@ type ResourceNotFoundError struct {
// IsScwSdkError implements the SdkError interface
func (e *ResourceNotFoundError) IsScwSdkError() {}
+
func (e *ResourceNotFoundError) Error() string {
return fmt.Sprintf("scaleway-sdk-go: resource %s with ID %s is not found", e.Resource, e.ResourceID)
}
+
func (e *ResourceNotFoundError) GetRawBody() json.RawMessage {
return e.RawBody
}
@@ -421,9 +433,11 @@ type ResourceLockedError struct {
// IsScwSdkError implements the SdkError interface
func (e *ResourceLockedError) IsScwSdkError() {}
+
func (e *ResourceLockedError) Error() string {
return fmt.Sprintf("scaleway-sdk-go: resource %s with ID %s is locked", e.Resource, e.ResourceID)
}
+
func (e *ResourceLockedError) GetRawBody() json.RawMessage {
return e.RawBody
}
@@ -436,9 +450,11 @@ type OutOfStockError struct {
// IsScwSdkError implements the SdkError interface
func (e *OutOfStockError) IsScwSdkError() {}
+
func (e *OutOfStockError) Error() string {
return fmt.Sprintf("scaleway-sdk-go: resource %s is out of stock", e.Resource)
}
+
func (e *OutOfStockError) GetRawBody() json.RawMessage {
return e.RawBody
}
@@ -454,8 +470,9 @@ func NewInvalidClientOptionError(format string, a ...interface{}) *InvalidClient
// IsScwSdkError implements the SdkError interface
func (e InvalidClientOptionError) IsScwSdkError() {}
+
func (e InvalidClientOptionError) Error() string {
- return fmt.Sprintf("scaleway-sdk-go: %s", e.errorType)
+ return "scaleway-sdk-go: " + e.errorType
}
// ConfigFileNotFound indicates that the config file could not be found
@@ -469,6 +486,7 @@ func configFileNotFound(path string) *ConfigFileNotFoundError {
// ConfigFileNotFoundError implements the SdkError interface
func (e ConfigFileNotFoundError) IsScwSdkError() {}
+
func (e ConfigFileNotFoundError) Error() string {
return fmt.Sprintf("scaleway-sdk-go: cannot read config file %s: no such file or directory", e.path)
}
@@ -519,7 +537,7 @@ func (r DeniedAuthenticationError) Error() string {
case "expired":
reason = method + " is expired"
}
- return fmt.Sprintf("scaleway-sdk-go: denied authentication: %s", reason)
+ return "scaleway-sdk-go: denied authentication: " + reason
}
func (r DeniedAuthenticationError) IsScwSdkError() {}
@@ -546,7 +564,7 @@ func (r PreconditionFailedError) Error() string {
msg += ", " + r.HelpMessage
}
- return fmt.Sprintf("scaleway-sdk-go: precondition failed: %s", msg)
+ return "scaleway-sdk-go: precondition failed: " + msg
}
func (r PreconditionFailedError) IsScwSdkError() {}
diff --git a/vendor/github.com/scaleway/scaleway-sdk-go/scw/locality.go b/vendor/github.com/scaleway/scaleway-sdk-go/scw/locality.go
index 55e0a154..ffe84381 100644
--- a/vendor/github.com/scaleway/scaleway-sdk-go/scw/locality.go
+++ b/vendor/github.com/scaleway/scaleway-sdk-go/scw/locality.go
@@ -37,20 +37,18 @@ const (
ZonePlWaw3 = Zone("pl-waw-3")
)
-var (
- // AllZones is an array that list all zones
- AllZones = []Zone{
- ZoneFrPar1,
- ZoneFrPar2,
- ZoneFrPar3,
- ZoneNlAms1,
- ZoneNlAms2,
- ZoneNlAms3,
- ZonePlWaw1,
- ZonePlWaw2,
- ZonePlWaw3,
- }
-)
+// AllZones is an array that list all zones
+var AllZones = []Zone{
+ ZoneFrPar1,
+ ZoneFrPar2,
+ ZoneFrPar3,
+ ZoneNlAms1,
+ ZoneNlAms2,
+ ZoneNlAms3,
+ ZonePlWaw1,
+ ZonePlWaw2,
+ ZonePlWaw3,
+}
// Exists checks whether a zone exists
func (zone Zone) Exists() bool {
@@ -90,14 +88,12 @@ const (
RegionPlWaw = Region("pl-waw")
)
-var (
- // AllRegions is an array that list all regions
- AllRegions = []Region{
- RegionFrPar,
- RegionNlAms,
- RegionPlWaw,
- }
-)
+// AllRegions is an array that list all regions
+var AllRegions = []Region{
+ RegionFrPar,
+ RegionNlAms,
+ RegionPlWaw,
+}
// Exists checks whether a region exists
func (region Region) Exists() bool {
diff --git a/vendor/github.com/scaleway/scaleway-sdk-go/scw/path.go b/vendor/github.com/scaleway/scaleway-sdk-go/scw/path.go
index 7bc0a3c3..a4e7a5f9 100644
--- a/vendor/github.com/scaleway/scaleway-sdk-go/scw/path.go
+++ b/vendor/github.com/scaleway/scaleway-sdk-go/scw/path.go
@@ -17,10 +17,8 @@ const (
defaultConfigFileName = "config.yaml"
)
-var (
- // ErrNoHomeDir errors when no user directory is found
- ErrNoHomeDir = errors.New("user home directory not found")
-)
+// ErrNoHomeDir errors when no user directory is found
+var ErrNoHomeDir = errors.New("user home directory not found")
// GetCacheDirectory returns the default cache directory.
// Cache directory is based on the following priority order:
@@ -82,8 +80,3 @@ func GetScwConfigDir() (string, error) {
}
return filepath.Join(homeDir, ".config", "scw"), nil
}
-
-func fileExist(name string) bool {
- _, err := os.Stat(name)
- return err == nil
-}
diff --git a/vendor/github.com/scaleway/scaleway-sdk-go/scw/transport.go b/vendor/github.com/scaleway/scaleway-sdk-go/scw/transport.go
index 791a3739..522a2f50 100644
--- a/vendor/github.com/scaleway/scaleway-sdk-go/scw/transport.go
+++ b/vendor/github.com/scaleway/scaleway-sdk-go/scw/transport.go
@@ -1,6 +1,7 @@
package scw
import (
+ "math/rand"
"net/http"
"net/http/httputil"
"sync/atomic"
@@ -24,16 +25,19 @@ func (l *requestLoggerTransport) RoundTrip(request *http.Request) (*http.Respons
// Get anonymized headers
request.Header = auth.AnonymizeHeaders(request.Header.Clone())
+ // Add a pseudo random request identifier, this can be used to identify request and response in large logs
+ requestIdentifier := rand.Uint32()
+
dump, err := httputil.DumpRequestOut(request, true)
if err != nil {
logger.Warningf("cannot dump outgoing request: %s", err)
} else {
var logString string
- logString += "\n--------------- Scaleway SDK REQUEST %d : ---------------\n"
+ logString += "\n---------- Scaleway SDK REQUEST %d (%x) : ----------\n"
logString += "%s\n"
- logString += "---------------------------------------------------------"
+ logString += "---------------------------------------------------------\n"
- logger.Debugf(logString, currentRequestNumber, dump)
+ logger.Debugf(logString, currentRequestNumber, requestIdentifier, dump)
}
// Restore original headers before sending the request
@@ -51,11 +55,11 @@ func (l *requestLoggerTransport) RoundTrip(request *http.Request) (*http.Respons
logger.Warningf("cannot dump ingoing response: %s", err)
} else {
var logString string
- logString += "\n--------------- Scaleway SDK RESPONSE %d : ---------------\n"
+ logString += "\n---------- Scaleway SDK RESPONSE %d (%x) : ----------\n"
logString += "%s\n"
- logString += "----------------------------------------------------------"
+ logString += "----------------------------------------------------------\n"
- logger.Debugf(logString, currentRequestNumber, dump)
+ logger.Debugf(logString, currentRequestNumber, requestIdentifier, dump)
}
return response, requestError
diff --git a/vendor/github.com/scaleway/scaleway-sdk-go/scw/version.go b/vendor/github.com/scaleway/scaleway-sdk-go/scw/version.go
index 6d591194..3018df48 100644
--- a/vendor/github.com/scaleway/scaleway-sdk-go/scw/version.go
+++ b/vendor/github.com/scaleway/scaleway-sdk-go/scw/version.go
@@ -3,9 +3,37 @@ package scw
import (
"fmt"
"runtime"
+ "runtime/debug"
)
// TODO: versioning process
-const version = "v1.0.0-beta.7+dev"
+const (
+ defaultVersion = "v1.0.0-beta.7+dev"
+ path = "github.com/scaleway/scaleway-sdk-go"
+)
+
+var cachedVersion = (*string)(nil)
+
+func getVersion() string {
+ if cachedVersion == nil {
+ debugVersion := ""
+ b, ok := debug.ReadBuildInfo()
+ if ok {
+ for _, dep := range b.Deps {
+ if dep.Path == path {
+ debugVersion = dep.Version
+ }
+ }
+ }
+
+ cachedVersion = &debugVersion
+ }
+
+ if *cachedVersion != "" {
+ return *cachedVersion
+ }
+
+ return defaultVersion
+}
-var userAgent = fmt.Sprintf("scaleway-sdk-go/%s (%s; %s; %s)", version, runtime.Version(), runtime.GOOS, runtime.GOARCH)
+var userAgent = fmt.Sprintf("scaleway-sdk-go/%s (%s; %s; %s)", getVersion(), runtime.Version(), runtime.GOOS, runtime.GOARCH)
diff --git a/vendor/github.com/x448/float16/.travis.yml b/vendor/github.com/x448/float16/.travis.yml
new file mode 100644
index 00000000..8902bdaa
--- /dev/null
+++ b/vendor/github.com/x448/float16/.travis.yml
@@ -0,0 +1,13 @@
+language: go
+
+go:
+ - 1.11.x
+
+env:
+ - GO111MODULE=on
+
+script:
+ - go test -short -coverprofile=coverage.txt -covermode=count ./...
+
+after_success:
+ - bash <(curl -s https://codecov.io/bash)
diff --git a/vendor/github.com/x448/float16/LICENSE b/vendor/github.com/x448/float16/LICENSE
new file mode 100644
index 00000000..bf6e3578
--- /dev/null
+++ b/vendor/github.com/x448/float16/LICENSE
@@ -0,0 +1,22 @@
+MIT License
+
+Copyright (c) 2019 Montgomery Edwards⁴⁴⁸ and Faye Amacker
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/vendor/github.com/x448/float16/README.md b/vendor/github.com/x448/float16/README.md
new file mode 100644
index 00000000..b524b813
--- /dev/null
+++ b/vendor/github.com/x448/float16/README.md
@@ -0,0 +1,133 @@
+# Float16 (Binary16) in Go/Golang
+[![Build Status](https://travis-ci.org/x448/float16.svg?branch=master)](https://travis-ci.org/x448/float16)
+[![codecov](https://codecov.io/gh/x448/float16/branch/master/graph/badge.svg?v=4)](https://codecov.io/gh/x448/float16)
+[![Go Report Card](https://goreportcard.com/badge/github.com/x448/float16)](https://goreportcard.com/report/github.com/x448/float16)
+[![Release](https://img.shields.io/github/release/x448/float16.svg?style=flat-square)](https://github.com/x448/float16/releases)
+[![License](http://img.shields.io/badge/license-mit-blue.svg?style=flat-square)](https://raw.githubusercontent.com/x448/float16/master/LICENSE)
+
+`float16` package provides [IEEE 754 half-precision floating-point format (binary16)](https://en.wikipedia.org/wiki/Half-precision_floating-point_format) with IEEE 754 default rounding for conversions. IEEE 754-2008 refers to this 16-bit floating-point format as binary16.
+
+IEEE 754 default rounding ("Round-to-Nearest RoundTiesToEven") is considered the most accurate and statistically unbiased estimate of the true result.
+
+All possible 4+ billion floating-point conversions with this library are verified to be correct.
+
+Lowercase "float16" refers to IEEE 754 binary16. And capitalized "Float16" refers to exported Go data type provided by this library.
+
+## Features
+Current features include:
+
+* float16 to float32 conversions use lossless conversion.
+* float32 to float16 conversions use IEEE 754-2008 "Round-to-Nearest RoundTiesToEven".
+* conversions using pure Go take about 2.65 ns/op on a desktop amd64.
+* unit tests provide 100% code coverage and check all possible 4+ billion conversions.
+* other functions include: IsInf(), IsNaN(), IsNormal(), PrecisionFromfloat32(), String(), etc.
+* all functions in this library use zero allocs except String().
+
+## Status
+This library is used by [fxamacker/cbor](https://github.com/fxamacker/cbor) and is ready for production use on supported platforms. The version number < 1.0 indicates more functions and options are planned but not yet published.
+
+Current status:
+
+* core API is done and breaking API changes are unlikely.
+* 100% of unit tests pass:
+ * short mode (`go test -short`) tests around 65765 conversions in 0.005s.
+ * normal mode (`go test`) tests all possible 4+ billion conversions in about 95s.
+* 100% code coverage with both short mode and normal mode.
+* tested on amd64 but it should work on all little-endian platforms supported by Go.
+
+Roadmap:
+
+* add functions for fast batch conversions leveraging SIMD when supported by hardware.
+* speed up unit test when verifying all possible 4+ billion conversions.
+* test on additional platforms.
+
+## Float16 to Float32 Conversion
+Conversions from float16 to float32 are lossless conversions. All 65536 possible float16 to float32 conversions (in pure Go) are confirmed to be correct.
+
+Unit tests take a fraction of a second to check all 65536 expected values for float16 to float32 conversions.
+
+## Float32 to Float16 Conversion
+Conversions from float32 to float16 use IEEE 754 default rounding ("Round-to-Nearest RoundTiesToEven"). All 4294967296 possible float32 to float16 conversions (in pure Go) are confirmed to be correct.
+
+Unit tests in normal mode take about 1-2 minutes to check all 4+ billion float32 input values and results for Fromfloat32(), FromNaN32ps(), and PrecisionFromfloat32().
+
+Unit tests in short mode use a small subset (around 229 float32 inputs) and finish in under 0.01 second while still reaching 100% code coverage.
+
+## Usage
+Install with `go get github.com/x448/float16`.
+```
+// Convert float32 to float16
+pi := float32(math.Pi)
+pi16 := float16.Fromfloat32(pi)
+
+// Convert float16 to float32
+pi32 := pi16.Float32()
+
+// PrecisionFromfloat32() is faster than the overhead of calling a function.
+// This example only converts if there's no data loss and input is not a subnormal.
+if float16.PrecisionFromfloat32(pi) == float16.PrecisionExact {
+ pi16 := float16.Fromfloat32(pi)
+}
+```
+
+## Float16 Type and API
+Float16 (capitalized) is a Go type with uint16 as the underlying state. There are 6 exported functions and 9 exported methods.
+```
+package float16 // import "github.com/x448/float16"
+
+// Exported types and consts
+type Float16 uint16
+const ErrInvalidNaNValue = float16Error("float16: invalid NaN value, expected IEEE 754 NaN")
+
+// Exported functions
+Fromfloat32(f32 float32) Float16 // Float16 number converted from f32 using IEEE 754 default rounding
+ with identical results to AMD and Intel F16C hardware. NaN inputs
+ are converted with quiet bit always set on, to be like F16C.
+
+FromNaN32ps(nan float32) (Float16, error) // Float16 NaN without modifying quiet bit.
+ // The "ps" suffix means "preserve signaling".
+ // Returns sNaN and ErrInvalidNaNValue if nan isn't a NaN.
+
+Frombits(b16 uint16) Float16 // Float16 number corresponding to b16 (IEEE 754 binary16 rep.)
+NaN() Float16 // Float16 of IEEE 754 binary16 not-a-number
+Inf(sign int) Float16 // Float16 of IEEE 754 binary16 infinity according to sign
+
+PrecisionFromfloat32(f32 float32) Precision // quickly indicates exact, ..., overflow, underflow
+ // (inline and < 1 ns/op)
+// Exported methods
+(f Float16) Float32() float32 // float32 number converted from f16 using lossless conversion
+(f Float16) Bits() uint16 // the IEEE 754 binary16 representation of f
+(f Float16) IsNaN() bool // true if f is not-a-number (NaN)
+(f Float16) IsQuietNaN() bool // true if f is a quiet not-a-number (NaN)
+(f Float16) IsInf(sign int) bool // true if f is infinite based on sign (-1=NegInf, 0=any, 1=PosInf)
+(f Float16) IsFinite() bool // true if f is not infinite or NaN
+(f Float16) IsNormal() bool // true if f is not zero, infinite, subnormal, or NaN.
+(f Float16) Signbit() bool // true if f is negative or negative zero
+(f Float16) String() string // string representation of f to satisfy fmt.Stringer interface
+```
+See [API](https://godoc.org/github.com/x448/float16) at godoc.org for more info.
+
+## Benchmarks
+Conversions (in pure Go) are around 2.65 ns/op for float16 -> float32 and float32 -> float16 on amd64. Speeds can vary depending on input value.
+
+```
+All functions have zero allocations except float16.String().
+
+FromFloat32pi-2 2.59ns ± 0% // speed using Fromfloat32() to convert a float32 of math.Pi to Float16
+ToFloat32pi-2 2.69ns ± 0% // speed using Float32() to convert a float16 of math.Pi to float32
+Frombits-2 0.29ns ± 5% // speed using Frombits() to cast a uint16 to Float16
+
+PrecisionFromFloat32-2 0.29ns ± 1% // speed using PrecisionFromfloat32() to check for overflows, etc.
+```
+
+## System Requirements
+* Tested on Go 1.11, 1.12, and 1.13 but it should also work with older versions.
+* Tested on amd64 but it should also work on all little-endian platforms supported by Go.
+
+## Special Thanks
+Special thanks to Kathryn Long (starkat99) for creating [half-rs](https://github.com/starkat99/half-rs), a very nice rust implementation of float16.
+
+## License
+Copyright (c) 2019 Montgomery Edwards⁴⁴⁸ and Faye Amacker
+
+Licensed under [MIT License](LICENSE)
diff --git a/vendor/github.com/x448/float16/float16.go b/vendor/github.com/x448/float16/float16.go
new file mode 100644
index 00000000..1a0e6dad
--- /dev/null
+++ b/vendor/github.com/x448/float16/float16.go
@@ -0,0 +1,302 @@
+// Copyright 2019 Montgomery Edwards⁴⁴⁸ and Faye Amacker
+//
+// Special thanks to Kathryn Long for her Rust implementation
+// of float16 at github.com/starkat99/half-rs (MIT license)
+
+package float16
+
+import (
+ "math"
+ "strconv"
+)
+
+// Float16 represents IEEE 754 half-precision floating-point numbers (binary16).
+type Float16 uint16
+
+// Precision indicates whether the conversion to Float16 is
+// exact, subnormal without dropped bits, inexact, underflow, or overflow.
+type Precision int
+
+const (
+
+ // PrecisionExact is for non-subnormals that don't drop bits during conversion.
+ // All of these can round-trip. Should always convert to float16.
+ PrecisionExact Precision = iota
+
+ // PrecisionUnknown is for subnormals that don't drop bits during conversion but
+ // not all of these can round-trip so precision is unknown without more effort.
+ // Only 2046 of these can round-trip and the rest cannot round-trip.
+ PrecisionUnknown
+
+ // PrecisionInexact is for dropped significand bits and cannot round-trip.
+ // Some of these are subnormals. Cannot round-trip float32->float16->float32.
+ PrecisionInexact
+
+ // PrecisionUnderflow is for Underflows. Cannot round-trip float32->float16->float32.
+ PrecisionUnderflow
+
+ // PrecisionOverflow is for Overflows. Cannot round-trip float32->float16->float32.
+ PrecisionOverflow
+)
+
+// PrecisionFromfloat32 returns Precision without performing
+// the conversion. Conversions from both Infinity and NaN
+// values will always report PrecisionExact even if NaN payload
+// or NaN-Quiet-Bit is lost. This function is kept simple to
+// allow inlining and run < 0.5 ns/op, to serve as a fast filter.
+func PrecisionFromfloat32(f32 float32) Precision {
+ u32 := math.Float32bits(f32)
+
+ if u32 == 0 || u32 == 0x80000000 {
+ // +- zero will always be exact conversion
+ return PrecisionExact
+ }
+
+ const COEFMASK uint32 = 0x7fffff // 23 least significant bits
+ const EXPSHIFT uint32 = 23
+ const EXPBIAS uint32 = 127
+ const EXPMASK uint32 = uint32(0xff) << EXPSHIFT
+ const DROPMASK uint32 = COEFMASK >> 10
+
+ exp := int32(((u32 & EXPMASK) >> EXPSHIFT) - EXPBIAS)
+ coef := u32 & COEFMASK
+
+ if exp == 128 {
+ // +- infinity or NaN
+ // apps may want to do extra checks for NaN separately
+ return PrecisionExact
+ }
+
+ // https://en.wikipedia.org/wiki/Half-precision_floating-point_format says,
+ // "Decimals between 2^−24 (minimum positive subnormal) and 2^−14 (maximum subnormal): fixed interval 2^−24"
+ if exp < -24 {
+ return PrecisionUnderflow
+ }
+ if exp > 15 {
+ return PrecisionOverflow
+ }
+ if (coef & DROPMASK) != uint32(0) {
+ // these include subnormals and non-subnormals that dropped bits
+ return PrecisionInexact
+ }
+
+ if exp < -14 {
+ // Subnormals. Caller may want to test these further.
+ // There are 2046 subnormals that can successfully round-trip f32->f16->f32
+ // and 20 of those 2046 have 32-bit input coef == 0.
+ // RFC 7049 and 7049bis Draft 12 don't precisely define "preserves value"
+ // so some protocols and libraries will choose to handle subnormals differently
+ // when deciding to encode them to CBOR float32 vs float16.
+ return PrecisionUnknown
+ }
+
+ return PrecisionExact
+}
+
+// Frombits returns the float16 number corresponding to the IEEE 754 binary16
+// representation u16, with the sign bit of u16 and the result in the same bit
+// position. Frombits(Bits(x)) == x.
+func Frombits(u16 uint16) Float16 {
+ return Float16(u16)
+}
+
+// Fromfloat32 returns a Float16 value converted from f32. Conversion uses
+// IEEE default rounding (nearest int, with ties to even).
+func Fromfloat32(f32 float32) Float16 {
+ return Float16(f32bitsToF16bits(math.Float32bits(f32)))
+}
+
+// ErrInvalidNaNValue indicates a NaN was not received.
+const ErrInvalidNaNValue = float16Error("float16: invalid NaN value, expected IEEE 754 NaN")
+
+type float16Error string
+
+func (e float16Error) Error() string { return string(e) }
+
+// FromNaN32ps converts nan to IEEE binary16 NaN while preserving both
+// signaling and payload. Unlike Fromfloat32(), which can only return
+// qNaN because it sets quiet bit = 1, this can return both sNaN and qNaN.
+// If the result is infinity (sNaN with empty payload), then the
+// lowest bit of payload is set to make the result a NaN.
+// Returns ErrInvalidNaNValue and 0x7c01 (sNaN) if nan isn't IEEE 754 NaN.
+// This function was kept simple to be able to inline.
+func FromNaN32ps(nan float32) (Float16, error) {
+ const SNAN = Float16(uint16(0x7c01)) // signalling NaN
+
+ u32 := math.Float32bits(nan)
+ sign := u32 & 0x80000000
+ exp := u32 & 0x7f800000
+ coef := u32 & 0x007fffff
+
+ if (exp != 0x7f800000) || (coef == 0) {
+ return SNAN, ErrInvalidNaNValue
+ }
+
+ u16 := uint16((sign >> 16) | uint32(0x7c00) | (coef >> 13))
+
+ if (u16 & 0x03ff) == 0 {
+ // result became infinity, make it NaN by setting lowest bit in payload
+ u16 = u16 | 0x0001
+ }
+
+ return Float16(u16), nil
+}
+
+// NaN returns a Float16 of IEEE 754 binary16 not-a-number (NaN).
+// Returned NaN value 0x7e01 has all exponent bits = 1 with the
+// first and last bits = 1 in the significand. This is consistent
+// with Go's 64-bit math.NaN(). Canonical CBOR in RFC 7049 uses 0x7e00.
+func NaN() Float16 {
+ return Float16(0x7e01)
+}
+
+// Inf returns a Float16 with an infinity value with the specified sign.
+// A sign >= returns positive infinity.
+// A sign < 0 returns negative infinity.
+func Inf(sign int) Float16 {
+ if sign >= 0 {
+ return Float16(0x7c00)
+ }
+ return Float16(0x8000 | 0x7c00)
+}
+
+// Float32 returns a float32 converted from f (Float16).
+// This is a lossless conversion.
+func (f Float16) Float32() float32 {
+ u32 := f16bitsToF32bits(uint16(f))
+ return math.Float32frombits(u32)
+}
+
+// Bits returns the IEEE 754 binary16 representation of f, with the sign bit
+// of f and the result in the same bit position. Bits(Frombits(x)) == x.
+func (f Float16) Bits() uint16 {
+ return uint16(f)
+}
+
+// IsNaN reports whether f is an IEEE 754 binary16 “not-a-number” value.
+func (f Float16) IsNaN() bool {
+ return (f&0x7c00 == 0x7c00) && (f&0x03ff != 0)
+}
+
+// IsQuietNaN reports whether f is a quiet (non-signaling) IEEE 754 binary16
+// “not-a-number” value.
+func (f Float16) IsQuietNaN() bool {
+ return (f&0x7c00 == 0x7c00) && (f&0x03ff != 0) && (f&0x0200 != 0)
+}
+
+// IsInf reports whether f is an infinity (inf).
+// A sign > 0 reports whether f is positive inf.
+// A sign < 0 reports whether f is negative inf.
+// A sign == 0 reports whether f is either inf.
+func (f Float16) IsInf(sign int) bool {
+ return ((f == 0x7c00) && sign >= 0) ||
+ (f == 0xfc00 && sign <= 0)
+}
+
+// IsFinite returns true if f is neither infinite nor NaN.
+func (f Float16) IsFinite() bool {
+ return (uint16(f) & uint16(0x7c00)) != uint16(0x7c00)
+}
+
+// IsNormal returns true if f is neither zero, infinite, subnormal, or NaN.
+func (f Float16) IsNormal() bool {
+ exp := uint16(f) & uint16(0x7c00)
+ return (exp != uint16(0x7c00)) && (exp != 0)
+}
+
+// Signbit reports whether f is negative or negative zero.
+func (f Float16) Signbit() bool {
+ return (uint16(f) & uint16(0x8000)) != 0
+}
+
+// String satisfies the fmt.Stringer interface.
+func (f Float16) String() string {
+ return strconv.FormatFloat(float64(f.Float32()), 'f', -1, 32)
+}
+
+// f16bitsToF32bits returns uint32 (float32 bits) converted from specified uint16.
+func f16bitsToF32bits(in uint16) uint32 {
+ // All 65536 conversions with this were confirmed to be correct
+ // by Montgomery Edwards⁴⁴⁸ (github.com/x448).
+
+ sign := uint32(in&0x8000) << 16 // sign for 32-bit
+ exp := uint32(in&0x7c00) >> 10 // exponenent for 16-bit
+ coef := uint32(in&0x03ff) << 13 // significand for 32-bit
+
+ if exp == 0x1f {
+ if coef == 0 {
+ // infinity
+ return sign | 0x7f800000 | coef
+ }
+ // NaN
+ return sign | 0x7fc00000 | coef
+ }
+
+ if exp == 0 {
+ if coef == 0 {
+ // zero
+ return sign
+ }
+
+ // normalize subnormal numbers
+ exp++
+ for coef&0x7f800000 == 0 {
+ coef <<= 1
+ exp--
+ }
+ coef &= 0x007fffff
+ }
+
+ return sign | ((exp + (0x7f - 0xf)) << 23) | coef
+}
+
+// f32bitsToF16bits returns uint16 (Float16 bits) converted from the specified float32.
+// Conversion rounds to nearest integer with ties to even.
+func f32bitsToF16bits(u32 uint32) uint16 {
+ // Translated from Rust to Go by Montgomery Edwards⁴⁴⁸ (github.com/x448).
+ // All 4294967296 conversions with this were confirmed to be correct by x448.
+ // Original Rust implementation is by Kathryn Long (github.com/starkat99) with MIT license.
+
+ sign := u32 & 0x80000000
+ exp := u32 & 0x7f800000
+ coef := u32 & 0x007fffff
+
+ if exp == 0x7f800000 {
+ // NaN or Infinity
+ nanBit := uint32(0)
+ if coef != 0 {
+ nanBit = uint32(0x0200)
+ }
+ return uint16((sign >> 16) | uint32(0x7c00) | nanBit | (coef >> 13))
+ }
+
+ halfSign := sign >> 16
+
+ unbiasedExp := int32(exp>>23) - 127
+ halfExp := unbiasedExp + 15
+
+ if halfExp >= 0x1f {
+ return uint16(halfSign | uint32(0x7c00))
+ }
+
+ if halfExp <= 0 {
+ if 14-halfExp > 24 {
+ return uint16(halfSign)
+ }
+ coef := coef | uint32(0x00800000)
+ halfCoef := coef >> uint32(14-halfExp)
+ roundBit := uint32(1) << uint32(13-halfExp)
+ if (coef&roundBit) != 0 && (coef&(3*roundBit-1)) != 0 {
+ halfCoef++
+ }
+ return uint16(halfSign | halfCoef)
+ }
+
+ uHalfExp := uint32(halfExp) << 10
+ halfCoef := coef >> 13
+ roundBit := uint32(0x00001000)
+ if (coef&roundBit) != 0 && (coef&(3*roundBit-1)) != 0 {
+ return uint16((halfSign | uHalfExp | halfCoef) + 1)
+ }
+ return uint16(halfSign | uHalfExp | halfCoef)
+}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/client.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/client.go
index 92b8cf73..6aae83bf 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/client.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/client.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
@@ -23,7 +12,7 @@ import (
)
// DefaultClient is the default Client and is used by Get, Head, Post and PostForm.
-// Please be careful of intitialization order - for example, if you change
+// Please be careful of initialization order - for example, if you change
// the global propagator, the DefaultClient might still be using the old one.
var DefaultClient = &http.Client{Transport: NewTransport(http.DefaultTransport)}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/common.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/common.go
index 9509014e..a83a0262 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/common.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/common.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
@@ -29,14 +18,6 @@ const (
WriteErrorKey = attribute.Key("http.write_error") // if an error occurred while writing a reply, the string of the error (io.EOF is not recorded)
)
-// Server HTTP metrics.
-const (
- RequestCount = "http.server.request_count" // Incoming request count total
- RequestContentLength = "http.server.request_content_length" // Incoming request bytes total
- ResponseContentLength = "http.server.response_content_length" // Incoming response bytes total
- ServerLatency = "http.server.duration" // Incoming end to end duration, milliseconds
-)
-
// Filter is a predicate used to determine whether a given http.request should
// be traced. A Filter must return true if the request should be traced.
type Filter func(*http.Request) bool
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/config.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/config.go
index a1b5b5e5..a01bfafb 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/config.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/config.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
@@ -19,6 +8,8 @@ import (
"net/http"
"net/http/httptrace"
+ "go.opentelemetry.io/otel/attribute"
+
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/metric"
"go.opentelemetry.io/otel/propagation"
@@ -44,8 +35,9 @@ type config struct {
SpanNameFormatter func(string, *http.Request) string
ClientTrace func(context.Context) *httptrace.ClientTrace
- TracerProvider trace.TracerProvider
- MeterProvider metric.MeterProvider
+ TracerProvider trace.TracerProvider
+ MeterProvider metric.MeterProvider
+ MetricAttributesFn func(*http.Request) []attribute.KeyValue
}
// Option interface used for setting optional config properties.
@@ -111,7 +103,7 @@ func WithPublicEndpoint() Option {
})
}
-// WithPublicEndpointFn runs with every request, and allows conditionnally
+// WithPublicEndpointFn runs with every request, and allows conditionally
// configuring the Handler to link the span with an incoming span context. If
// this option is not provided or returns false, then the association is a
// child association instead of a link.
@@ -205,3 +197,11 @@ func WithServerName(server string) Option {
c.ServerName = server
})
}
+
+// WithMetricAttributesFn returns an Option to set a function that maps an HTTP request to a slice of attribute.KeyValue.
+// These attributes will be included in metrics for every request.
+func WithMetricAttributesFn(metricAttributesFn func(r *http.Request) []attribute.KeyValue) Option {
+ return optionFunc(func(c *config) {
+ c.MetricAttributesFn = metricAttributesFn
+ })
+}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/doc.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/doc.go
index 38c7f01c..56b24b98 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/doc.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
// Package otelhttp provides an http.Handler and functions that are intended
// to be used to add tracing by wrapping existing handlers (with Handler) and
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go
index 9a826005..e555a475 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go
@@ -1,32 +1,18 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
import (
- "io"
"net/http"
"time"
"github.com/felixge/httpsnoop"
- "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil"
+ "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request"
+ "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv"
"go.opentelemetry.io/otel"
- "go.opentelemetry.io/otel/attribute"
- "go.opentelemetry.io/otel/metric"
"go.opentelemetry.io/otel/propagation"
- semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
"go.opentelemetry.io/otel/trace"
)
@@ -36,17 +22,16 @@ type middleware struct {
server string
tracer trace.Tracer
- meter metric.Meter
propagators propagation.TextMapPropagator
spanStartOptions []trace.SpanStartOption
readEvent bool
writeEvent bool
filters []Filter
spanNameFormatter func(string, *http.Request) string
- counters map[string]metric.Int64Counter
- valueRecorders map[string]metric.Float64Histogram
publicEndpoint bool
publicEndpointFn func(*http.Request) bool
+
+ semconv semconv.HTTPServer
}
func defaultHandlerFormatter(operation string, _ *http.Request) string {
@@ -74,7 +59,6 @@ func NewMiddleware(operation string, opts ...Option) func(http.Handler) http.Han
c := newConfig(append(defaultOpts, opts...)...)
h.configure(c)
- h.createMeasures()
return func(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
@@ -85,7 +69,6 @@ func NewMiddleware(operation string, opts ...Option) func(http.Handler) http.Han
func (h *middleware) configure(c *config) {
h.tracer = c.Tracer
- h.meter = c.Meter
h.propagators = c.Propagators
h.spanStartOptions = c.SpanStartOptions
h.readEvent = c.ReadEvent
@@ -95,42 +78,7 @@ func (h *middleware) configure(c *config) {
h.publicEndpoint = c.PublicEndpoint
h.publicEndpointFn = c.PublicEndpointFn
h.server = c.ServerName
-}
-
-func handleErr(err error) {
- if err != nil {
- otel.Handle(err)
- }
-}
-
-func (h *middleware) createMeasures() {
- h.counters = make(map[string]metric.Int64Counter)
- h.valueRecorders = make(map[string]metric.Float64Histogram)
-
- requestBytesCounter, err := h.meter.Int64Counter(
- RequestContentLength,
- metric.WithUnit("By"),
- metric.WithDescription("Measures the size of HTTP request content length (uncompressed)"),
- )
- handleErr(err)
-
- responseBytesCounter, err := h.meter.Int64Counter(
- ResponseContentLength,
- metric.WithUnit("By"),
- metric.WithDescription("Measures the size of HTTP response content length (uncompressed)"),
- )
- handleErr(err)
-
- serverLatencyMeasure, err := h.meter.Float64Histogram(
- ServerLatency,
- metric.WithUnit("ms"),
- metric.WithDescription("Measures the duration of HTTP request handling"),
- )
- handleErr(err)
-
- h.counters[RequestContentLength] = requestBytesCounter
- h.counters[ResponseContentLength] = responseBytesCounter
- h.valueRecorders[ServerLatency] = serverLatencyMeasure
+ h.semconv = semconv.NewHTTPServer(c.Meter)
}
// serveHTTP sets up tracing and calls the given next http.Handler with the span
@@ -147,12 +95,9 @@ func (h *middleware) serveHTTP(w http.ResponseWriter, r *http.Request, next http
ctx := h.propagators.Extract(r.Context(), propagation.HeaderCarrier(r.Header))
opts := []trace.SpanStartOption{
- trace.WithAttributes(semconvutil.HTTPServerRequest(h.server, r)...),
- }
- if h.server != "" {
- hostAttr := semconv.NetHostName(h.server)
- opts = append(opts, trace.WithAttributes(hostAttr))
+ trace.WithAttributes(h.semconv.RequestTraceAttrs(h.server, r)...),
}
+
opts = append(opts, h.spanStartOptions...)
if h.publicEndpoint || (h.publicEndpointFn != nil && h.publicEndpointFn(r.WithContext(ctx))) {
opts = append(opts, trace.WithNewRoot())
@@ -172,6 +117,11 @@ func (h *middleware) serveHTTP(w http.ResponseWriter, r *http.Request, next http
}
}
+ if startTime := StartTimeFromContext(ctx); !startTime.IsZero() {
+ opts = append(opts, trace.WithTimestamp(startTime))
+ requestStartTime = startTime
+ }
+
ctx, span := tracer.Start(ctx, h.spanNameFormatter(h.operation, r), opts...)
defer span.End()
@@ -182,14 +132,12 @@ func (h *middleware) serveHTTP(w http.ResponseWriter, r *http.Request, next http
}
}
- var bw bodyWrapper
// if request body is nil or NoBody, we don't want to mutate the body as it
// will affect the identity of it in an unforeseeable way because we assert
// ReadCloser fulfills a certain interface and it is indeed nil or NoBody.
+ bw := request.NewBodyWrapper(r.Body, readRecordFunc)
if r.Body != nil && r.Body != http.NoBody {
- bw.ReadCloser = r.Body
- bw.record = readRecordFunc
- r.Body = &bw
+ r.Body = bw
}
writeRecordFunc := func(int64) {}
@@ -199,13 +147,7 @@ func (h *middleware) serveHTTP(w http.ResponseWriter, r *http.Request, next http
}
}
- rww := &respWriterWrapper{
- ResponseWriter: w,
- record: writeRecordFunc,
- ctx: ctx,
- props: h.propagators,
- statusCode: http.StatusOK, // default status code in case the Handler doesn't write anything
- }
+ rww := request.NewRespWriterWrapper(w, writeRecordFunc)
// Wrap w to use our ResponseWriter methods while also exposing
// other interfaces that w may implement (http.CloseNotifier,
@@ -221,61 +163,52 @@ func (h *middleware) serveHTTP(w http.ResponseWriter, r *http.Request, next http
WriteHeader: func(httpsnoop.WriteHeaderFunc) httpsnoop.WriteHeaderFunc {
return rww.WriteHeader
},
+ Flush: func(httpsnoop.FlushFunc) httpsnoop.FlushFunc {
+ return rww.Flush
+ },
})
- labeler := &Labeler{}
- ctx = injectLabeler(ctx, labeler)
+ labeler, found := LabelerFromContext(ctx)
+ if !found {
+ ctx = ContextWithLabeler(ctx, labeler)
+ }
next.ServeHTTP(w, r.WithContext(ctx))
- setAfterServeAttributes(span, bw.read, rww.written, rww.statusCode, bw.err, rww.err)
-
- // Add metrics
- attributes := append(labeler.Get(), semconvutil.HTTPServerRequestMetrics(h.server, r)...)
- if rww.statusCode > 0 {
- attributes = append(attributes, semconv.HTTPStatusCode(rww.statusCode))
- }
- o := metric.WithAttributes(attributes...)
- h.counters[RequestContentLength].Add(ctx, bw.read, o)
- h.counters[ResponseContentLength].Add(ctx, rww.written, o)
+ statusCode := rww.StatusCode()
+ bytesWritten := rww.BytesWritten()
+ span.SetStatus(h.semconv.Status(statusCode))
+ span.SetAttributes(h.semconv.ResponseTraceAttrs(semconv.ResponseTelemetry{
+ StatusCode: statusCode,
+ ReadBytes: bw.BytesRead(),
+ ReadError: bw.Error(),
+ WriteBytes: bytesWritten,
+ WriteError: rww.Error(),
+ })...)
// Use floating point division here for higher precision (instead of Millisecond method).
elapsedTime := float64(time.Since(requestStartTime)) / float64(time.Millisecond)
- h.valueRecorders[ServerLatency].Record(ctx, elapsedTime, o)
-}
-
-func setAfterServeAttributes(span trace.Span, read, wrote int64, statusCode int, rerr, werr error) {
- attributes := []attribute.KeyValue{}
-
- // TODO: Consider adding an event after each read and write, possibly as an
- // option (defaulting to off), so as to not create needlessly verbose spans.
- if read > 0 {
- attributes = append(attributes, ReadBytesKey.Int64(read))
- }
- if rerr != nil && rerr != io.EOF {
- attributes = append(attributes, ReadErrorKey.String(rerr.Error()))
- }
- if wrote > 0 {
- attributes = append(attributes, WroteBytesKey.Int64(wrote))
- }
- if statusCode > 0 {
- attributes = append(attributes, semconv.HTTPStatusCode(statusCode))
- }
- span.SetStatus(semconvutil.HTTPServerStatus(statusCode))
-
- if werr != nil && werr != io.EOF {
- attributes = append(attributes, WriteErrorKey.String(werr.Error()))
- }
- span.SetAttributes(attributes...)
+ h.semconv.RecordMetrics(ctx, semconv.ServerMetricData{
+ ServerName: h.server,
+ ResponseSize: bytesWritten,
+ MetricAttributes: semconv.MetricAttributes{
+ Req: r,
+ StatusCode: statusCode,
+ AdditionalAttributes: labeler.Get(),
+ },
+ MetricData: semconv.MetricData{
+ RequestSize: bw.BytesRead(),
+ ElapsedTime: elapsedTime,
+ },
+ })
}
// WithRouteTag annotates spans and metrics with the provided route name
// with HTTP route attribute.
func WithRouteTag(route string, h http.Handler) http.Handler {
+ attr := semconv.NewHTTPServer(nil).Route(route)
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- attr := semconv.HTTPRouteKey.String(route)
-
span := trace.SpanFromContext(r.Context())
span.SetAttributes(attr)
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request/body_wrapper.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request/body_wrapper.go
new file mode 100644
index 00000000..a945f556
--- /dev/null
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request/body_wrapper.go
@@ -0,0 +1,75 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package request // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request"
+
+import (
+ "io"
+ "sync"
+)
+
+var _ io.ReadCloser = &BodyWrapper{}
+
+// BodyWrapper wraps a http.Request.Body (an io.ReadCloser) to track the number
+// of bytes read and the last error.
+type BodyWrapper struct {
+ io.ReadCloser
+ OnRead func(n int64) // must not be nil
+
+ mu sync.Mutex
+ read int64
+ err error
+}
+
+// NewBodyWrapper creates a new BodyWrapper.
+//
+// The onRead attribute is a callback that will be called every time the data
+// is read, with the number of bytes being read.
+func NewBodyWrapper(body io.ReadCloser, onRead func(int64)) *BodyWrapper {
+ return &BodyWrapper{
+ ReadCloser: body,
+ OnRead: onRead,
+ }
+}
+
+// Read reads the data from the io.ReadCloser, and stores the number of bytes
+// read and the error.
+func (w *BodyWrapper) Read(b []byte) (int, error) {
+ n, err := w.ReadCloser.Read(b)
+ n1 := int64(n)
+
+ w.updateReadData(n1, err)
+ w.OnRead(n1)
+ return n, err
+}
+
+func (w *BodyWrapper) updateReadData(n int64, err error) {
+ w.mu.Lock()
+ defer w.mu.Unlock()
+
+ w.read += n
+ if err != nil {
+ w.err = err
+ }
+}
+
+// Closes closes the io.ReadCloser.
+func (w *BodyWrapper) Close() error {
+ return w.ReadCloser.Close()
+}
+
+// BytesRead returns the number of bytes read up to this point.
+func (w *BodyWrapper) BytesRead() int64 {
+ w.mu.Lock()
+ defer w.mu.Unlock()
+
+ return w.read
+}
+
+// Error returns the last error.
+func (w *BodyWrapper) Error() error {
+ w.mu.Lock()
+ defer w.mu.Unlock()
+
+ return w.err
+}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request/resp_writer_wrapper.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request/resp_writer_wrapper.go
new file mode 100644
index 00000000..fbc344cb
--- /dev/null
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request/resp_writer_wrapper.go
@@ -0,0 +1,119 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package request // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request"
+
+import (
+ "net/http"
+ "sync"
+)
+
+var _ http.ResponseWriter = &RespWriterWrapper{}
+
+// RespWriterWrapper wraps a http.ResponseWriter in order to track the number of
+// bytes written, the last error, and to catch the first written statusCode.
+// TODO: The wrapped http.ResponseWriter doesn't implement any of the optional
+// types (http.Hijacker, http.Pusher, http.CloseNotifier, etc)
+// that may be useful when using it in real life situations.
+type RespWriterWrapper struct {
+ http.ResponseWriter
+ OnWrite func(n int64) // must not be nil
+
+ mu sync.RWMutex
+ written int64
+ statusCode int
+ err error
+ wroteHeader bool
+}
+
+// NewRespWriterWrapper creates a new RespWriterWrapper.
+//
+// The onWrite attribute is a callback that will be called every time the data
+// is written, with the number of bytes that were written.
+func NewRespWriterWrapper(w http.ResponseWriter, onWrite func(int64)) *RespWriterWrapper {
+ return &RespWriterWrapper{
+ ResponseWriter: w,
+ OnWrite: onWrite,
+ statusCode: http.StatusOK, // default status code in case the Handler doesn't write anything
+ }
+}
+
+// Write writes the bytes array into the [ResponseWriter], and tracks the
+// number of bytes written and last error.
+func (w *RespWriterWrapper) Write(p []byte) (int, error) {
+ w.mu.Lock()
+ defer w.mu.Unlock()
+
+ if !w.wroteHeader {
+ w.writeHeader(http.StatusOK)
+ }
+
+ n, err := w.ResponseWriter.Write(p)
+ n1 := int64(n)
+ w.OnWrite(n1)
+ w.written += n1
+ w.err = err
+ return n, err
+}
+
+// WriteHeader persists initial statusCode for span attribution.
+// All calls to WriteHeader will be propagated to the underlying ResponseWriter
+// and will persist the statusCode from the first call.
+// Blocking consecutive calls to WriteHeader alters expected behavior and will
+// remove warning logs from net/http where developers will notice incorrect handler implementations.
+func (w *RespWriterWrapper) WriteHeader(statusCode int) {
+ w.mu.Lock()
+ defer w.mu.Unlock()
+
+ w.writeHeader(statusCode)
+}
+
+// writeHeader persists the status code for span attribution, and propagates
+// the call to the underlying ResponseWriter.
+// It does not acquire a lock, and therefore assumes that is being handled by a
+// parent method.
+func (w *RespWriterWrapper) writeHeader(statusCode int) {
+ if !w.wroteHeader {
+ w.wroteHeader = true
+ w.statusCode = statusCode
+ }
+ w.ResponseWriter.WriteHeader(statusCode)
+}
+
+// Flush implements [http.Flusher].
+func (w *RespWriterWrapper) Flush() {
+ w.mu.Lock()
+ defer w.mu.Unlock()
+
+ if !w.wroteHeader {
+ w.writeHeader(http.StatusOK)
+ }
+
+ if f, ok := w.ResponseWriter.(http.Flusher); ok {
+ f.Flush()
+ }
+}
+
+// BytesWritten returns the number of bytes written.
+func (w *RespWriterWrapper) BytesWritten() int64 {
+ w.mu.RLock()
+ defer w.mu.RUnlock()
+
+ return w.written
+}
+
+// BytesWritten returns the HTTP status code that was sent.
+func (w *RespWriterWrapper) StatusCode() int {
+ w.mu.RLock()
+ defer w.mu.RUnlock()
+
+ return w.statusCode
+}
+
+// Error returns the last error.
+func (w *RespWriterWrapper) Error() error {
+ w.mu.RLock()
+ defer w.mu.RUnlock()
+
+ return w.err
+}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/env.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/env.go
new file mode 100644
index 00000000..fb893b25
--- /dev/null
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/env.go
@@ -0,0 +1,227 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package semconv // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv"
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "os"
+ "strings"
+
+ "go.opentelemetry.io/otel/attribute"
+ "go.opentelemetry.io/otel/codes"
+ "go.opentelemetry.io/otel/metric"
+)
+
+type ResponseTelemetry struct {
+ StatusCode int
+ ReadBytes int64
+ ReadError error
+ WriteBytes int64
+ WriteError error
+}
+
+type HTTPServer struct {
+ duplicate bool
+
+ // Old metrics
+ requestBytesCounter metric.Int64Counter
+ responseBytesCounter metric.Int64Counter
+ serverLatencyMeasure metric.Float64Histogram
+}
+
+// RequestTraceAttrs returns trace attributes for an HTTP request received by a
+// server.
+//
+// The server must be the primary server name if it is known. For example this
+// would be the ServerName directive
+// (https://httpd.apache.org/docs/2.4/mod/core.html#servername) for an Apache
+// server, and the server_name directive
+// (http://nginx.org/en/docs/http/ngx_http_core_module.html#server_name) for an
+// nginx server. More generically, the primary server name would be the host
+// header value that matches the default virtual host of an HTTP server. It
+// should include the host identifier and if a port is used to route to the
+// server that port identifier should be included as an appropriate port
+// suffix.
+//
+// If the primary server name is not known, server should be an empty string.
+// The req Host will be used to determine the server instead.
+func (s HTTPServer) RequestTraceAttrs(server string, req *http.Request) []attribute.KeyValue {
+ if s.duplicate {
+ return append(oldHTTPServer{}.RequestTraceAttrs(server, req), newHTTPServer{}.RequestTraceAttrs(server, req)...)
+ }
+ return oldHTTPServer{}.RequestTraceAttrs(server, req)
+}
+
+// ResponseTraceAttrs returns trace attributes for telemetry from an HTTP response.
+//
+// If any of the fields in the ResponseTelemetry are not set the attribute will be omitted.
+func (s HTTPServer) ResponseTraceAttrs(resp ResponseTelemetry) []attribute.KeyValue {
+ if s.duplicate {
+ return append(oldHTTPServer{}.ResponseTraceAttrs(resp), newHTTPServer{}.ResponseTraceAttrs(resp)...)
+ }
+ return oldHTTPServer{}.ResponseTraceAttrs(resp)
+}
+
+// Route returns the attribute for the route.
+func (s HTTPServer) Route(route string) attribute.KeyValue {
+ return oldHTTPServer{}.Route(route)
+}
+
+// Status returns a span status code and message for an HTTP status code
+// value returned by a server. Status codes in the 400-499 range are not
+// returned as errors.
+func (s HTTPServer) Status(code int) (codes.Code, string) {
+ if code < 100 || code >= 600 {
+ return codes.Error, fmt.Sprintf("Invalid HTTP status code %d", code)
+ }
+ if code >= 500 {
+ return codes.Error, ""
+ }
+ return codes.Unset, ""
+}
+
+type ServerMetricData struct {
+ ServerName string
+ ResponseSize int64
+
+ MetricData
+ MetricAttributes
+}
+
+type MetricAttributes struct {
+ Req *http.Request
+ StatusCode int
+ AdditionalAttributes []attribute.KeyValue
+}
+
+type MetricData struct {
+ RequestSize int64
+ ElapsedTime float64
+}
+
+func (s HTTPServer) RecordMetrics(ctx context.Context, md ServerMetricData) {
+ if s.requestBytesCounter == nil || s.responseBytesCounter == nil || s.serverLatencyMeasure == nil {
+ // This will happen if an HTTPServer{} is used insted of NewHTTPServer.
+ return
+ }
+
+ attributes := oldHTTPServer{}.MetricAttributes(md.ServerName, md.Req, md.StatusCode, md.AdditionalAttributes)
+ o := metric.WithAttributeSet(attribute.NewSet(attributes...))
+ addOpts := []metric.AddOption{o}
+ s.requestBytesCounter.Add(ctx, md.RequestSize, addOpts...)
+ s.responseBytesCounter.Add(ctx, md.ResponseSize, addOpts...)
+ s.serverLatencyMeasure.Record(ctx, md.ElapsedTime, o)
+
+ // TODO: Duplicate Metrics
+}
+
+func NewHTTPServer(meter metric.Meter) HTTPServer {
+ env := strings.ToLower(os.Getenv("OTEL_SEMCONV_STABILITY_OPT_IN"))
+ duplicate := env == "http/dup"
+ server := HTTPServer{
+ duplicate: duplicate,
+ }
+ server.requestBytesCounter, server.responseBytesCounter, server.serverLatencyMeasure = oldHTTPServer{}.createMeasures(meter)
+ return server
+}
+
+type HTTPClient struct {
+ duplicate bool
+
+ // old metrics
+ requestBytesCounter metric.Int64Counter
+ responseBytesCounter metric.Int64Counter
+ latencyMeasure metric.Float64Histogram
+}
+
+func NewHTTPClient(meter metric.Meter) HTTPClient {
+ env := strings.ToLower(os.Getenv("OTEL_SEMCONV_STABILITY_OPT_IN"))
+ client := HTTPClient{
+ duplicate: env == "http/dup",
+ }
+ client.requestBytesCounter, client.responseBytesCounter, client.latencyMeasure = oldHTTPClient{}.createMeasures(meter)
+ return client
+}
+
+// RequestTraceAttrs returns attributes for an HTTP request made by a client.
+func (c HTTPClient) RequestTraceAttrs(req *http.Request) []attribute.KeyValue {
+ if c.duplicate {
+ return append(oldHTTPClient{}.RequestTraceAttrs(req), newHTTPClient{}.RequestTraceAttrs(req)...)
+ }
+ return oldHTTPClient{}.RequestTraceAttrs(req)
+}
+
+// ResponseTraceAttrs returns metric attributes for an HTTP request made by a client.
+func (c HTTPClient) ResponseTraceAttrs(resp *http.Response) []attribute.KeyValue {
+ if c.duplicate {
+ return append(oldHTTPClient{}.ResponseTraceAttrs(resp), newHTTPClient{}.ResponseTraceAttrs(resp)...)
+ }
+
+ return oldHTTPClient{}.ResponseTraceAttrs(resp)
+}
+
+func (c HTTPClient) Status(code int) (codes.Code, string) {
+ if code < 100 || code >= 600 {
+ return codes.Error, fmt.Sprintf("Invalid HTTP status code %d", code)
+ }
+ if code >= 400 {
+ return codes.Error, ""
+ }
+ return codes.Unset, ""
+}
+
+func (c HTTPClient) ErrorType(err error) attribute.KeyValue {
+ if c.duplicate {
+ return newHTTPClient{}.ErrorType(err)
+ }
+
+ return attribute.KeyValue{}
+}
+
+type MetricOpts struct {
+ measurement metric.MeasurementOption
+ addOptions metric.AddOption
+}
+
+func (o MetricOpts) MeasurementOption() metric.MeasurementOption {
+ return o.measurement
+}
+
+func (o MetricOpts) AddOptions() metric.AddOption {
+ return o.addOptions
+}
+
+func (c HTTPClient) MetricOptions(ma MetricAttributes) MetricOpts {
+ attributes := oldHTTPClient{}.MetricAttributes(ma.Req, ma.StatusCode, ma.AdditionalAttributes)
+ // TODO: Duplicate Metrics
+ set := metric.WithAttributeSet(attribute.NewSet(attributes...))
+ return MetricOpts{
+ measurement: set,
+ addOptions: set,
+ }
+}
+
+func (s HTTPClient) RecordMetrics(ctx context.Context, md MetricData, opts MetricOpts) {
+ if s.requestBytesCounter == nil || s.latencyMeasure == nil {
+ // This will happen if an HTTPClient{} is used insted of NewHTTPClient().
+ return
+ }
+
+ s.requestBytesCounter.Add(ctx, md.RequestSize, opts.AddOptions())
+ s.latencyMeasure.Record(ctx, md.ElapsedTime, opts.MeasurementOption())
+
+ // TODO: Duplicate Metrics
+}
+
+func (s HTTPClient) RecordResponseSize(ctx context.Context, responseData int64, opts metric.AddOption) {
+ if s.responseBytesCounter == nil {
+ // This will happen if an HTTPClient{} is used insted of NewHTTPClient().
+ return
+ }
+
+ s.responseBytesCounter.Add(ctx, responseData, opts)
+ // TODO: Duplicate Metrics
+}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/httpconv.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/httpconv.go
new file mode 100644
index 00000000..745b8c67
--- /dev/null
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/httpconv.go
@@ -0,0 +1,348 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package semconv // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv"
+
+import (
+ "fmt"
+ "net/http"
+ "reflect"
+ "strconv"
+ "strings"
+
+ "go.opentelemetry.io/otel/attribute"
+ semconvNew "go.opentelemetry.io/otel/semconv/v1.26.0"
+)
+
+type newHTTPServer struct{}
+
+// TraceRequest returns trace attributes for an HTTP request received by a
+// server.
+//
+// The server must be the primary server name if it is known. For example this
+// would be the ServerName directive
+// (https://httpd.apache.org/docs/2.4/mod/core.html#servername) for an Apache
+// server, and the server_name directive
+// (http://nginx.org/en/docs/http/ngx_http_core_module.html#server_name) for an
+// nginx server. More generically, the primary server name would be the host
+// header value that matches the default virtual host of an HTTP server. It
+// should include the host identifier and if a port is used to route to the
+// server that port identifier should be included as an appropriate port
+// suffix.
+//
+// If the primary server name is not known, server should be an empty string.
+// The req Host will be used to determine the server instead.
+func (n newHTTPServer) RequestTraceAttrs(server string, req *http.Request) []attribute.KeyValue {
+ count := 3 // ServerAddress, Method, Scheme
+
+ var host string
+ var p int
+ if server == "" {
+ host, p = splitHostPort(req.Host)
+ } else {
+ // Prioritize the primary server name.
+ host, p = splitHostPort(server)
+ if p < 0 {
+ _, p = splitHostPort(req.Host)
+ }
+ }
+
+ hostPort := requiredHTTPPort(req.TLS != nil, p)
+ if hostPort > 0 {
+ count++
+ }
+
+ method, methodOriginal := n.method(req.Method)
+ if methodOriginal != (attribute.KeyValue{}) {
+ count++
+ }
+
+ scheme := n.scheme(req.TLS != nil)
+
+ if peer, peerPort := splitHostPort(req.RemoteAddr); peer != "" {
+ // The Go HTTP server sets RemoteAddr to "IP:port", this will not be a
+ // file-path that would be interpreted with a sock family.
+ count++
+ if peerPort > 0 {
+ count++
+ }
+ }
+
+ useragent := req.UserAgent()
+ if useragent != "" {
+ count++
+ }
+
+ clientIP := serverClientIP(req.Header.Get("X-Forwarded-For"))
+ if clientIP != "" {
+ count++
+ }
+
+ if req.URL != nil && req.URL.Path != "" {
+ count++
+ }
+
+ protoName, protoVersion := netProtocol(req.Proto)
+ if protoName != "" && protoName != "http" {
+ count++
+ }
+ if protoVersion != "" {
+ count++
+ }
+
+ attrs := make([]attribute.KeyValue, 0, count)
+ attrs = append(attrs,
+ semconvNew.ServerAddress(host),
+ method,
+ scheme,
+ )
+
+ if hostPort > 0 {
+ attrs = append(attrs, semconvNew.ServerPort(hostPort))
+ }
+ if methodOriginal != (attribute.KeyValue{}) {
+ attrs = append(attrs, methodOriginal)
+ }
+
+ if peer, peerPort := splitHostPort(req.RemoteAddr); peer != "" {
+ // The Go HTTP server sets RemoteAddr to "IP:port", this will not be a
+ // file-path that would be interpreted with a sock family.
+ attrs = append(attrs, semconvNew.NetworkPeerAddress(peer))
+ if peerPort > 0 {
+ attrs = append(attrs, semconvNew.NetworkPeerPort(peerPort))
+ }
+ }
+
+ if useragent := req.UserAgent(); useragent != "" {
+ attrs = append(attrs, semconvNew.UserAgentOriginal(useragent))
+ }
+
+ if clientIP != "" {
+ attrs = append(attrs, semconvNew.ClientAddress(clientIP))
+ }
+
+ if req.URL != nil && req.URL.Path != "" {
+ attrs = append(attrs, semconvNew.URLPath(req.URL.Path))
+ }
+
+ if protoName != "" && protoName != "http" {
+ attrs = append(attrs, semconvNew.NetworkProtocolName(protoName))
+ }
+ if protoVersion != "" {
+ attrs = append(attrs, semconvNew.NetworkProtocolVersion(protoVersion))
+ }
+
+ return attrs
+}
+
+func (n newHTTPServer) method(method string) (attribute.KeyValue, attribute.KeyValue) {
+ if method == "" {
+ return semconvNew.HTTPRequestMethodGet, attribute.KeyValue{}
+ }
+ if attr, ok := methodLookup[method]; ok {
+ return attr, attribute.KeyValue{}
+ }
+
+ orig := semconvNew.HTTPRequestMethodOriginal(method)
+ if attr, ok := methodLookup[strings.ToUpper(method)]; ok {
+ return attr, orig
+ }
+ return semconvNew.HTTPRequestMethodGet, orig
+}
+
+func (n newHTTPServer) scheme(https bool) attribute.KeyValue { // nolint:revive
+ if https {
+ return semconvNew.URLScheme("https")
+ }
+ return semconvNew.URLScheme("http")
+}
+
+// TraceResponse returns trace attributes for telemetry from an HTTP response.
+//
+// If any of the fields in the ResponseTelemetry are not set the attribute will be omitted.
+func (n newHTTPServer) ResponseTraceAttrs(resp ResponseTelemetry) []attribute.KeyValue {
+ var count int
+
+ if resp.ReadBytes > 0 {
+ count++
+ }
+ if resp.WriteBytes > 0 {
+ count++
+ }
+ if resp.StatusCode > 0 {
+ count++
+ }
+
+ attributes := make([]attribute.KeyValue, 0, count)
+
+ if resp.ReadBytes > 0 {
+ attributes = append(attributes,
+ semconvNew.HTTPRequestBodySize(int(resp.ReadBytes)),
+ )
+ }
+ if resp.WriteBytes > 0 {
+ attributes = append(attributes,
+ semconvNew.HTTPResponseBodySize(int(resp.WriteBytes)),
+ )
+ }
+ if resp.StatusCode > 0 {
+ attributes = append(attributes,
+ semconvNew.HTTPResponseStatusCode(resp.StatusCode),
+ )
+ }
+
+ return attributes
+}
+
+// Route returns the attribute for the route.
+func (n newHTTPServer) Route(route string) attribute.KeyValue {
+ return semconvNew.HTTPRoute(route)
+}
+
+type newHTTPClient struct{}
+
+// RequestTraceAttrs returns trace attributes for an HTTP request made by a client.
+func (n newHTTPClient) RequestTraceAttrs(req *http.Request) []attribute.KeyValue {
+ /*
+ below attributes are returned:
+ - http.request.method
+ - http.request.method.original
+ - url.full
+ - server.address
+ - server.port
+ - network.protocol.name
+ - network.protocol.version
+ */
+ numOfAttributes := 3 // URL, server address, proto, and method.
+
+ var urlHost string
+ if req.URL != nil {
+ urlHost = req.URL.Host
+ }
+ var requestHost string
+ var requestPort int
+ for _, hostport := range []string{urlHost, req.Header.Get("Host")} {
+ requestHost, requestPort = splitHostPort(hostport)
+ if requestHost != "" || requestPort > 0 {
+ break
+ }
+ }
+
+ eligiblePort := requiredHTTPPort(req.URL != nil && req.URL.Scheme == "https", requestPort)
+ if eligiblePort > 0 {
+ numOfAttributes++
+ }
+ useragent := req.UserAgent()
+ if useragent != "" {
+ numOfAttributes++
+ }
+
+ protoName, protoVersion := netProtocol(req.Proto)
+ if protoName != "" && protoName != "http" {
+ numOfAttributes++
+ }
+ if protoVersion != "" {
+ numOfAttributes++
+ }
+
+ method, originalMethod := n.method(req.Method)
+ if originalMethod != (attribute.KeyValue{}) {
+ numOfAttributes++
+ }
+
+ attrs := make([]attribute.KeyValue, 0, numOfAttributes)
+
+ attrs = append(attrs, method)
+ if originalMethod != (attribute.KeyValue{}) {
+ attrs = append(attrs, originalMethod)
+ }
+
+ var u string
+ if req.URL != nil {
+ // Remove any username/password info that may be in the URL.
+ userinfo := req.URL.User
+ req.URL.User = nil
+ u = req.URL.String()
+ // Restore any username/password info that was removed.
+ req.URL.User = userinfo
+ }
+ attrs = append(attrs, semconvNew.URLFull(u))
+
+ attrs = append(attrs, semconvNew.ServerAddress(requestHost))
+ if eligiblePort > 0 {
+ attrs = append(attrs, semconvNew.ServerPort(eligiblePort))
+ }
+
+ if protoName != "" && protoName != "http" {
+ attrs = append(attrs, semconvNew.NetworkProtocolName(protoName))
+ }
+ if protoVersion != "" {
+ attrs = append(attrs, semconvNew.NetworkProtocolVersion(protoVersion))
+ }
+
+ return attrs
+}
+
+// ResponseTraceAttrs returns trace attributes for an HTTP response made by a client.
+func (n newHTTPClient) ResponseTraceAttrs(resp *http.Response) []attribute.KeyValue {
+ /*
+ below attributes are returned:
+ - http.response.status_code
+ - error.type
+ */
+ var count int
+ if resp.StatusCode > 0 {
+ count++
+ }
+
+ if isErrorStatusCode(resp.StatusCode) {
+ count++
+ }
+
+ attrs := make([]attribute.KeyValue, 0, count)
+ if resp.StatusCode > 0 {
+ attrs = append(attrs, semconvNew.HTTPResponseStatusCode(resp.StatusCode))
+ }
+
+ if isErrorStatusCode(resp.StatusCode) {
+ errorType := strconv.Itoa(resp.StatusCode)
+ attrs = append(attrs, semconvNew.ErrorTypeKey.String(errorType))
+ }
+ return attrs
+}
+
+func (n newHTTPClient) ErrorType(err error) attribute.KeyValue {
+ t := reflect.TypeOf(err)
+ var value string
+ if t.PkgPath() == "" && t.Name() == "" {
+ // Likely a builtin type.
+ value = t.String()
+ } else {
+ value = fmt.Sprintf("%s.%s", t.PkgPath(), t.Name())
+ }
+
+ if value == "" {
+ return semconvNew.ErrorTypeOther
+ }
+
+ return semconvNew.ErrorTypeKey.String(value)
+}
+
+func (n newHTTPClient) method(method string) (attribute.KeyValue, attribute.KeyValue) {
+ if method == "" {
+ return semconvNew.HTTPRequestMethodGet, attribute.KeyValue{}
+ }
+ if attr, ok := methodLookup[method]; ok {
+ return attr, attribute.KeyValue{}
+ }
+
+ orig := semconvNew.HTTPRequestMethodOriginal(method)
+ if attr, ok := methodLookup[strings.ToUpper(method)]; ok {
+ return attr, orig
+ }
+ return semconvNew.HTTPRequestMethodGet, orig
+}
+
+func isErrorStatusCode(code int) bool {
+ return code >= 400 || code < 100
+}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/util.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/util.go
new file mode 100644
index 00000000..e6e14924
--- /dev/null
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/util.go
@@ -0,0 +1,98 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package semconv // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv"
+
+import (
+ "net"
+ "net/http"
+ "strconv"
+ "strings"
+
+ "go.opentelemetry.io/otel"
+ "go.opentelemetry.io/otel/attribute"
+ semconvNew "go.opentelemetry.io/otel/semconv/v1.26.0"
+)
+
+// splitHostPort splits a network address hostport of the form "host",
+// "host%zone", "[host]", "[host%zone], "host:port", "host%zone:port",
+// "[host]:port", "[host%zone]:port", or ":port" into host or host%zone and
+// port.
+//
+// An empty host is returned if it is not provided or unparsable. A negative
+// port is returned if it is not provided or unparsable.
+func splitHostPort(hostport string) (host string, port int) {
+ port = -1
+
+ if strings.HasPrefix(hostport, "[") {
+ addrEnd := strings.LastIndex(hostport, "]")
+ if addrEnd < 0 {
+ // Invalid hostport.
+ return
+ }
+ if i := strings.LastIndex(hostport[addrEnd:], ":"); i < 0 {
+ host = hostport[1:addrEnd]
+ return
+ }
+ } else {
+ if i := strings.LastIndex(hostport, ":"); i < 0 {
+ host = hostport
+ return
+ }
+ }
+
+ host, pStr, err := net.SplitHostPort(hostport)
+ if err != nil {
+ return
+ }
+
+ p, err := strconv.ParseUint(pStr, 10, 16)
+ if err != nil {
+ return
+ }
+ return host, int(p) // nolint: gosec // Byte size checked 16 above.
+}
+
+func requiredHTTPPort(https bool, port int) int { // nolint:revive
+ if https {
+ if port > 0 && port != 443 {
+ return port
+ }
+ } else {
+ if port > 0 && port != 80 {
+ return port
+ }
+ }
+ return -1
+}
+
+func serverClientIP(xForwardedFor string) string {
+ if idx := strings.Index(xForwardedFor, ","); idx >= 0 {
+ xForwardedFor = xForwardedFor[:idx]
+ }
+ return xForwardedFor
+}
+
+func netProtocol(proto string) (name string, version string) {
+ name, version, _ = strings.Cut(proto, "/")
+ name = strings.ToLower(name)
+ return name, version
+}
+
+var methodLookup = map[string]attribute.KeyValue{
+ http.MethodConnect: semconvNew.HTTPRequestMethodConnect,
+ http.MethodDelete: semconvNew.HTTPRequestMethodDelete,
+ http.MethodGet: semconvNew.HTTPRequestMethodGet,
+ http.MethodHead: semconvNew.HTTPRequestMethodHead,
+ http.MethodOptions: semconvNew.HTTPRequestMethodOptions,
+ http.MethodPatch: semconvNew.HTTPRequestMethodPatch,
+ http.MethodPost: semconvNew.HTTPRequestMethodPost,
+ http.MethodPut: semconvNew.HTTPRequestMethodPut,
+ http.MethodTrace: semconvNew.HTTPRequestMethodTrace,
+}
+
+func handleErr(err error) {
+ if err != nil {
+ otel.Handle(err)
+ }
+}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/v1.20.0.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/v1.20.0.go
new file mode 100644
index 00000000..5367732e
--- /dev/null
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/v1.20.0.go
@@ -0,0 +1,274 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package semconv // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv"
+
+import (
+ "errors"
+ "io"
+ "net/http"
+ "slices"
+ "strings"
+
+ "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil"
+ "go.opentelemetry.io/otel/attribute"
+ "go.opentelemetry.io/otel/metric"
+ "go.opentelemetry.io/otel/metric/noop"
+ semconv "go.opentelemetry.io/otel/semconv/v1.20.0"
+)
+
+type oldHTTPServer struct{}
+
+// RequestTraceAttrs returns trace attributes for an HTTP request received by a
+// server.
+//
+// The server must be the primary server name if it is known. For example this
+// would be the ServerName directive
+// (https://httpd.apache.org/docs/2.4/mod/core.html#servername) for an Apache
+// server, and the server_name directive
+// (http://nginx.org/en/docs/http/ngx_http_core_module.html#server_name) for an
+// nginx server. More generically, the primary server name would be the host
+// header value that matches the default virtual host of an HTTP server. It
+// should include the host identifier and if a port is used to route to the
+// server that port identifier should be included as an appropriate port
+// suffix.
+//
+// If the primary server name is not known, server should be an empty string.
+// The req Host will be used to determine the server instead.
+func (o oldHTTPServer) RequestTraceAttrs(server string, req *http.Request) []attribute.KeyValue {
+ return semconvutil.HTTPServerRequest(server, req)
+}
+
+// ResponseTraceAttrs returns trace attributes for telemetry from an HTTP response.
+//
+// If any of the fields in the ResponseTelemetry are not set the attribute will be omitted.
+func (o oldHTTPServer) ResponseTraceAttrs(resp ResponseTelemetry) []attribute.KeyValue {
+ attributes := []attribute.KeyValue{}
+
+ if resp.ReadBytes > 0 {
+ attributes = append(attributes, semconv.HTTPRequestContentLength(int(resp.ReadBytes)))
+ }
+ if resp.ReadError != nil && !errors.Is(resp.ReadError, io.EOF) {
+ // This is not in the semantic conventions, but is historically provided
+ attributes = append(attributes, attribute.String("http.read_error", resp.ReadError.Error()))
+ }
+ if resp.WriteBytes > 0 {
+ attributes = append(attributes, semconv.HTTPResponseContentLength(int(resp.WriteBytes)))
+ }
+ if resp.StatusCode > 0 {
+ attributes = append(attributes, semconv.HTTPStatusCode(resp.StatusCode))
+ }
+ if resp.WriteError != nil && !errors.Is(resp.WriteError, io.EOF) {
+ // This is not in the semantic conventions, but is historically provided
+ attributes = append(attributes, attribute.String("http.write_error", resp.WriteError.Error()))
+ }
+
+ return attributes
+}
+
+// Route returns the attribute for the route.
+func (o oldHTTPServer) Route(route string) attribute.KeyValue {
+ return semconv.HTTPRoute(route)
+}
+
+// HTTPStatusCode returns the attribute for the HTTP status code.
+// This is a temporary function needed by metrics. This will be removed when MetricsRequest is added.
+func HTTPStatusCode(status int) attribute.KeyValue {
+ return semconv.HTTPStatusCode(status)
+}
+
+// Server HTTP metrics.
+const (
+ serverRequestSize = "http.server.request.size" // Incoming request bytes total
+ serverResponseSize = "http.server.response.size" // Incoming response bytes total
+ serverDuration = "http.server.duration" // Incoming end to end duration, milliseconds
+)
+
+func (h oldHTTPServer) createMeasures(meter metric.Meter) (metric.Int64Counter, metric.Int64Counter, metric.Float64Histogram) {
+ if meter == nil {
+ return noop.Int64Counter{}, noop.Int64Counter{}, noop.Float64Histogram{}
+ }
+ var err error
+ requestBytesCounter, err := meter.Int64Counter(
+ serverRequestSize,
+ metric.WithUnit("By"),
+ metric.WithDescription("Measures the size of HTTP request messages."),
+ )
+ handleErr(err)
+
+ responseBytesCounter, err := meter.Int64Counter(
+ serverResponseSize,
+ metric.WithUnit("By"),
+ metric.WithDescription("Measures the size of HTTP response messages."),
+ )
+ handleErr(err)
+
+ serverLatencyMeasure, err := meter.Float64Histogram(
+ serverDuration,
+ metric.WithUnit("ms"),
+ metric.WithDescription("Measures the duration of inbound HTTP requests."),
+ )
+ handleErr(err)
+
+ return requestBytesCounter, responseBytesCounter, serverLatencyMeasure
+}
+
+func (o oldHTTPServer) MetricAttributes(server string, req *http.Request, statusCode int, additionalAttributes []attribute.KeyValue) []attribute.KeyValue {
+ n := len(additionalAttributes) + 3
+ var host string
+ var p int
+ if server == "" {
+ host, p = splitHostPort(req.Host)
+ } else {
+ // Prioritize the primary server name.
+ host, p = splitHostPort(server)
+ if p < 0 {
+ _, p = splitHostPort(req.Host)
+ }
+ }
+ hostPort := requiredHTTPPort(req.TLS != nil, p)
+ if hostPort > 0 {
+ n++
+ }
+ protoName, protoVersion := netProtocol(req.Proto)
+ if protoName != "" {
+ n++
+ }
+ if protoVersion != "" {
+ n++
+ }
+
+ if statusCode > 0 {
+ n++
+ }
+
+ attributes := slices.Grow(additionalAttributes, n)
+ attributes = append(attributes,
+ standardizeHTTPMethodMetric(req.Method),
+ o.scheme(req.TLS != nil),
+ semconv.NetHostName(host))
+
+ if hostPort > 0 {
+ attributes = append(attributes, semconv.NetHostPort(hostPort))
+ }
+ if protoName != "" {
+ attributes = append(attributes, semconv.NetProtocolName(protoName))
+ }
+ if protoVersion != "" {
+ attributes = append(attributes, semconv.NetProtocolVersion(protoVersion))
+ }
+
+ if statusCode > 0 {
+ attributes = append(attributes, semconv.HTTPStatusCode(statusCode))
+ }
+ return attributes
+}
+
+func (o oldHTTPServer) scheme(https bool) attribute.KeyValue { // nolint:revive
+ if https {
+ return semconv.HTTPSchemeHTTPS
+ }
+ return semconv.HTTPSchemeHTTP
+}
+
+type oldHTTPClient struct{}
+
+func (o oldHTTPClient) RequestTraceAttrs(req *http.Request) []attribute.KeyValue {
+ return semconvutil.HTTPClientRequest(req)
+}
+
+func (o oldHTTPClient) ResponseTraceAttrs(resp *http.Response) []attribute.KeyValue {
+ return semconvutil.HTTPClientResponse(resp)
+}
+
+func (o oldHTTPClient) MetricAttributes(req *http.Request, statusCode int, additionalAttributes []attribute.KeyValue) []attribute.KeyValue {
+ /* The following semantic conventions are returned if present:
+ http.method string
+ http.status_code int
+ net.peer.name string
+ net.peer.port int
+ */
+
+ n := 2 // method, peer name.
+ var h string
+ if req.URL != nil {
+ h = req.URL.Host
+ }
+ var requestHost string
+ var requestPort int
+ for _, hostport := range []string{h, req.Header.Get("Host")} {
+ requestHost, requestPort = splitHostPort(hostport)
+ if requestHost != "" || requestPort > 0 {
+ break
+ }
+ }
+
+ port := requiredHTTPPort(req.URL != nil && req.URL.Scheme == "https", requestPort)
+ if port > 0 {
+ n++
+ }
+
+ if statusCode > 0 {
+ n++
+ }
+
+ attributes := slices.Grow(additionalAttributes, n)
+ attributes = append(attributes,
+ standardizeHTTPMethodMetric(req.Method),
+ semconv.NetPeerName(requestHost),
+ )
+
+ if port > 0 {
+ attributes = append(attributes, semconv.NetPeerPort(port))
+ }
+
+ if statusCode > 0 {
+ attributes = append(attributes, semconv.HTTPStatusCode(statusCode))
+ }
+ return attributes
+}
+
+// Client HTTP metrics.
+const (
+ clientRequestSize = "http.client.request.size" // Incoming request bytes total
+ clientResponseSize = "http.client.response.size" // Incoming response bytes total
+ clientDuration = "http.client.duration" // Incoming end to end duration, milliseconds
+)
+
+func (o oldHTTPClient) createMeasures(meter metric.Meter) (metric.Int64Counter, metric.Int64Counter, metric.Float64Histogram) {
+ if meter == nil {
+ return noop.Int64Counter{}, noop.Int64Counter{}, noop.Float64Histogram{}
+ }
+ requestBytesCounter, err := meter.Int64Counter(
+ clientRequestSize,
+ metric.WithUnit("By"),
+ metric.WithDescription("Measures the size of HTTP request messages."),
+ )
+ handleErr(err)
+
+ responseBytesCounter, err := meter.Int64Counter(
+ clientResponseSize,
+ metric.WithUnit("By"),
+ metric.WithDescription("Measures the size of HTTP response messages."),
+ )
+ handleErr(err)
+
+ latencyMeasure, err := meter.Float64Histogram(
+ clientDuration,
+ metric.WithUnit("ms"),
+ metric.WithDescription("Measures the duration of outbound HTTP requests."),
+ )
+ handleErr(err)
+
+ return requestBytesCounter, responseBytesCounter, latencyMeasure
+}
+
+func standardizeHTTPMethodMetric(method string) attribute.KeyValue {
+ method = strings.ToUpper(method)
+ switch method {
+ case http.MethodConnect, http.MethodDelete, http.MethodGet, http.MethodHead, http.MethodOptions, http.MethodPatch, http.MethodPost, http.MethodPut, http.MethodTrace:
+ default:
+ method = "_OTHER"
+ }
+ return semconv.HTTPMethod(method)
+}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/gen.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/gen.go
index edf4ce3d..7aa5f99e 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/gen.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/gen.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package semconvutil // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil"
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/httpconv.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/httpconv.go
index d3dede9e..a73bb06e 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/httpconv.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/httpconv.go
@@ -2,18 +2,7 @@
// source: internal/shared/semconvutil/httpconv.go.tmpl
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package semconvutil // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil"
@@ -24,7 +13,7 @@ import (
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/codes"
- semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
+ semconv "go.opentelemetry.io/otel/semconv/v1.20.0"
)
// HTTPClientResponse returns trace attributes for an HTTP response received by a
@@ -43,14 +32,22 @@ func HTTPClientResponse(resp *http.Response) []attribute.KeyValue {
}
// HTTPClientRequest returns trace attributes for an HTTP request made by a client.
-// The following attributes are always returned: "http.url", "http.flavor",
-// "http.method", "net.peer.name". The following attributes are returned if the
-// related values are defined in req: "net.peer.port", "http.user_agent",
-// "http.request_content_length", "enduser.id".
+// The following attributes are always returned: "http.url", "http.method",
+// "net.peer.name". The following attributes are returned if the related values
+// are defined in req: "net.peer.port", "user_agent.original",
+// "http.request_content_length".
func HTTPClientRequest(req *http.Request) []attribute.KeyValue {
return hc.ClientRequest(req)
}
+// HTTPClientRequestMetrics returns metric attributes for an HTTP request made by a client.
+// The following attributes are always returned: "http.method", "net.peer.name".
+// The following attributes are returned if the
+// related values are defined in req: "net.peer.port".
+func HTTPClientRequestMetrics(req *http.Request) []attribute.KeyValue {
+ return hc.ClientRequestMetrics(req)
+}
+
// HTTPClientStatus returns a span status code and message for an HTTP status code
// value received by a client.
func HTTPClientStatus(code int) (codes.Code, string) {
@@ -75,10 +72,9 @@ func HTTPClientStatus(code int) (codes.Code, string) {
// The req Host will be used to determine the server instead.
//
// The following attributes are always returned: "http.method", "http.scheme",
-// "http.flavor", "http.target", "net.host.name". The following attributes are
-// returned if they related values are defined in req: "net.host.port",
-// "net.sock.peer.addr", "net.sock.peer.port", "http.user_agent", "enduser.id",
-// "http.client_ip".
+// "http.target", "net.host.name". The following attributes are returned if
+// they related values are defined in req: "net.host.port", "net.sock.peer.addr",
+// "net.sock.peer.port", "user_agent.original", "http.client_ip".
func HTTPServerRequest(server string, req *http.Request) []attribute.KeyValue {
return hc.ServerRequest(server, req)
}
@@ -101,8 +97,8 @@ func HTTPServerRequest(server string, req *http.Request) []attribute.KeyValue {
// The req Host will be used to determine the server instead.
//
// The following attributes are always returned: "http.method", "http.scheme",
-// "http.flavor", "net.host.name". The following attributes are
-// returned if they related values are defined in req: "net.host.port".
+// "net.host.name". The following attributes are returned if they related
+// values are defined in req: "net.host.port".
func HTTPServerRequestMetrics(server string, req *http.Request) []attribute.KeyValue {
return hc.ServerRequestMetrics(server, req)
}
@@ -114,44 +110,12 @@ func HTTPServerStatus(code int) (codes.Code, string) {
return hc.ServerStatus(code)
}
-// HTTPRequestHeader returns the contents of h as attributes.
-//
-// Instrumentation should require an explicit configuration of which headers to
-// captured and then prune what they pass here. Including all headers can be a
-// security risk - explicit configuration helps avoid leaking sensitive
-// information.
-//
-// The User-Agent header is already captured in the http.user_agent attribute
-// from ClientRequest and ServerRequest. Instrumentation may provide an option
-// to capture that header here even though it is not recommended. Otherwise,
-// instrumentation should filter that out of what is passed.
-func HTTPRequestHeader(h http.Header) []attribute.KeyValue {
- return hc.RequestHeader(h)
-}
-
-// HTTPResponseHeader returns the contents of h as attributes.
-//
-// Instrumentation should require an explicit configuration of which headers to
-// captured and then prune what they pass here. Including all headers can be a
-// security risk - explicit configuration helps avoid leaking sensitive
-// information.
-//
-// The User-Agent header is already captured in the http.user_agent attribute
-// from ClientRequest and ServerRequest. Instrumentation may provide an option
-// to capture that header here even though it is not recommended. Otherwise,
-// instrumentation should filter that out of what is passed.
-func HTTPResponseHeader(h http.Header) []attribute.KeyValue {
- return hc.ResponseHeader(h)
-}
-
// httpConv are the HTTP semantic convention attributes defined for a version
// of the OpenTelemetry specification.
type httpConv struct {
NetConv *netConv
- EnduserIDKey attribute.Key
HTTPClientIPKey attribute.Key
- HTTPFlavorKey attribute.Key
HTTPMethodKey attribute.Key
HTTPRequestContentLengthKey attribute.Key
HTTPResponseContentLengthKey attribute.Key
@@ -161,15 +125,13 @@ type httpConv struct {
HTTPStatusCodeKey attribute.Key
HTTPTargetKey attribute.Key
HTTPURLKey attribute.Key
- HTTPUserAgentKey attribute.Key
+ UserAgentOriginalKey attribute.Key
}
var hc = &httpConv{
NetConv: nc,
- EnduserIDKey: semconv.EnduserIDKey,
HTTPClientIPKey: semconv.HTTPClientIPKey,
- HTTPFlavorKey: semconv.HTTPFlavorKey,
HTTPMethodKey: semconv.HTTPMethodKey,
HTTPRequestContentLengthKey: semconv.HTTPRequestContentLengthKey,
HTTPResponseContentLengthKey: semconv.HTTPResponseContentLengthKey,
@@ -179,7 +141,7 @@ var hc = &httpConv{
HTTPStatusCodeKey: semconv.HTTPStatusCodeKey,
HTTPTargetKey: semconv.HTTPTargetKey,
HTTPURLKey: semconv.HTTPURLKey,
- HTTPUserAgentKey: semconv.HTTPUserAgentKey,
+ UserAgentOriginalKey: semconv.UserAgentOriginalKey,
}
// ClientResponse returns attributes for an HTTP response received by a client
@@ -193,6 +155,10 @@ var hc = &httpConv{
//
// append(ClientResponse(resp), ClientRequest(resp.Request)...)
func (c *httpConv) ClientResponse(resp *http.Response) []attribute.KeyValue {
+ /* The following semantic conventions are returned if present:
+ http.status_code int
+ http.response_content_length int
+ */
var n int
if resp.StatusCode > 0 {
n++
@@ -212,11 +178,31 @@ func (c *httpConv) ClientResponse(resp *http.Response) []attribute.KeyValue {
}
// ClientRequest returns attributes for an HTTP request made by a client. The
-// following attributes are always returned: "http.url", "http.flavor",
-// "http.method", "net.peer.name". The following attributes are returned if the
-// related values are defined in req: "net.peer.port", "http.user_agent",
-// "http.request_content_length", "enduser.id".
+// following attributes are always returned: "http.url", "http.method",
+// "net.peer.name". The following attributes are returned if the related values
+// are defined in req: "net.peer.port", "user_agent.original",
+// "http.request_content_length", "user_agent.original".
func (c *httpConv) ClientRequest(req *http.Request) []attribute.KeyValue {
+ /* The following semantic conventions are returned if present:
+ http.method string
+ user_agent.original string
+ http.url string
+ net.peer.name string
+ net.peer.port int
+ http.request_content_length int
+ */
+
+ /* The following semantic conventions are not returned:
+ http.status_code This requires the response. See ClientResponse.
+ http.response_content_length This requires the response. See ClientResponse.
+ net.sock.family This requires the socket used.
+ net.sock.peer.addr This requires the socket used.
+ net.sock.peer.name This requires the socket used.
+ net.sock.peer.port This requires the socket used.
+ http.resend_count This is something outside of a single request.
+ net.protocol.name The value is the Request is ignored, and the go client will always use "http".
+ net.protocol.version The value in the Request is ignored, and the go client will always use 1.1 or 2.0.
+ */
n := 3 // URL, peer name, proto, and method.
var h string
if req.URL != nil {
@@ -234,14 +220,10 @@ func (c *httpConv) ClientRequest(req *http.Request) []attribute.KeyValue {
if req.ContentLength > 0 {
n++
}
- userID, _, hasUserID := req.BasicAuth()
- if hasUserID {
- n++
- }
+
attrs := make([]attribute.KeyValue, 0, n)
attrs = append(attrs, c.method(req.Method))
- attrs = append(attrs, c.flavor(req.Proto))
var u string
if req.URL != nil {
@@ -260,15 +242,43 @@ func (c *httpConv) ClientRequest(req *http.Request) []attribute.KeyValue {
}
if useragent != "" {
- attrs = append(attrs, c.HTTPUserAgentKey.String(useragent))
+ attrs = append(attrs, c.UserAgentOriginalKey.String(useragent))
}
if l := req.ContentLength; l > 0 {
attrs = append(attrs, c.HTTPRequestContentLengthKey.Int64(l))
}
- if hasUserID {
- attrs = append(attrs, c.EnduserIDKey.String(userID))
+ return attrs
+}
+
+// ClientRequestMetrics returns metric attributes for an HTTP request made by a client. The
+// following attributes are always returned: "http.method", "net.peer.name".
+// The following attributes are returned if the related values
+// are defined in req: "net.peer.port".
+func (c *httpConv) ClientRequestMetrics(req *http.Request) []attribute.KeyValue {
+ /* The following semantic conventions are returned if present:
+ http.method string
+ net.peer.name string
+ net.peer.port int
+ */
+
+ n := 2 // method, peer name.
+ var h string
+ if req.URL != nil {
+ h = req.URL.Host
+ }
+ peer, p := firstHostPort(h, req.Header.Get("Host"))
+ port := requiredHTTPPort(req.URL != nil && req.URL.Scheme == "https", p)
+ if port > 0 {
+ n++
+ }
+
+ attrs := make([]attribute.KeyValue, 0, n)
+ attrs = append(attrs, c.method(req.Method), c.NetConv.PeerName(peer))
+
+ if port > 0 {
+ attrs = append(attrs, c.NetConv.PeerPort(port))
}
return attrs
@@ -291,18 +301,35 @@ func (c *httpConv) ClientRequest(req *http.Request) []attribute.KeyValue {
// The req Host will be used to determine the server instead.
//
// The following attributes are always returned: "http.method", "http.scheme",
-// "http.flavor", "http.target", "net.host.name". The following attributes are
-// returned if they related values are defined in req: "net.host.port",
-// "net.sock.peer.addr", "net.sock.peer.port", "http.user_agent", "enduser.id",
-// "http.client_ip".
+// "http.target", "net.host.name". The following attributes are returned if they
+// related values are defined in req: "net.host.port", "net.sock.peer.addr",
+// "net.sock.peer.port", "user_agent.original", "http.client_ip",
+// "net.protocol.name", "net.protocol.version".
func (c *httpConv) ServerRequest(server string, req *http.Request) []attribute.KeyValue {
- // TODO: This currently does not add the specification required
- // `http.target` attribute. It has too high of a cardinality to safely be
- // added. An alternate should be added, or this comment removed, when it is
- // addressed by the specification. If it is ultimately decided to continue
- // not including the attribute, the HTTPTargetKey field of the httpConv
- // should be removed as well.
-
+ /* The following semantic conventions are returned if present:
+ http.method string
+ http.scheme string
+ net.host.name string
+ net.host.port int
+ net.sock.peer.addr string
+ net.sock.peer.port int
+ user_agent.original string
+ http.client_ip string
+ net.protocol.name string Note: not set if the value is "http".
+ net.protocol.version string
+ http.target string Note: doesn't include the query parameter.
+ */
+
+ /* The following semantic conventions are not returned:
+ http.status_code This requires the response.
+ http.request_content_length This requires the len() of body, which can mutate it.
+ http.response_content_length This requires the response.
+ http.route This is not available.
+ net.sock.peer.name This would require a DNS lookup.
+ net.sock.host.addr The request doesn't have access to the underlying socket.
+ net.sock.host.port The request doesn't have access to the underlying socket.
+
+ */
n := 4 // Method, scheme, proto, and host name.
var host string
var p int
@@ -330,19 +357,31 @@ func (c *httpConv) ServerRequest(server string, req *http.Request) []attribute.K
if useragent != "" {
n++
}
- userID, _, hasUserID := req.BasicAuth()
- if hasUserID {
- n++
- }
+
clientIP := serverClientIP(req.Header.Get("X-Forwarded-For"))
if clientIP != "" {
n++
}
+
+ var target string
+ if req.URL != nil {
+ target = req.URL.Path
+ if target != "" {
+ n++
+ }
+ }
+ protoName, protoVersion := netProtocol(req.Proto)
+ if protoName != "" && protoName != "http" {
+ n++
+ }
+ if protoVersion != "" {
+ n++
+ }
+
attrs := make([]attribute.KeyValue, 0, n)
attrs = append(attrs, c.method(req.Method))
attrs = append(attrs, c.scheme(req.TLS != nil))
- attrs = append(attrs, c.flavor(req.Proto))
attrs = append(attrs, c.NetConv.HostName(host))
if hostPort > 0 {
@@ -359,17 +398,24 @@ func (c *httpConv) ServerRequest(server string, req *http.Request) []attribute.K
}
if useragent != "" {
- attrs = append(attrs, c.HTTPUserAgentKey.String(useragent))
- }
-
- if hasUserID {
- attrs = append(attrs, c.EnduserIDKey.String(userID))
+ attrs = append(attrs, c.UserAgentOriginalKey.String(useragent))
}
if clientIP != "" {
attrs = append(attrs, c.HTTPClientIPKey.String(clientIP))
}
+ if target != "" {
+ attrs = append(attrs, c.HTTPTargetKey.String(target))
+ }
+
+ if protoName != "" && protoName != "http" {
+ attrs = append(attrs, c.NetConv.NetProtocolName.String(protoName))
+ }
+ if protoVersion != "" {
+ attrs = append(attrs, c.NetConv.NetProtocolVersion.String(protoVersion))
+ }
+
return attrs
}
@@ -391,17 +437,21 @@ func (c *httpConv) ServerRequest(server string, req *http.Request) []attribute.K
// The req Host will be used to determine the server instead.
//
// The following attributes are always returned: "http.method", "http.scheme",
-// "http.flavor", "net.host.name". The following attributes are
-// returned if they related values are defined in req: "net.host.port".
+// "net.host.name". The following attributes are returned if they related
+// values are defined in req: "net.host.port".
func (c *httpConv) ServerRequestMetrics(server string, req *http.Request) []attribute.KeyValue {
- // TODO: This currently does not add the specification required
- // `http.target` attribute. It has too high of a cardinality to safely be
- // added. An alternate should be added, or this comment removed, when it is
- // addressed by the specification. If it is ultimately decided to continue
- // not including the attribute, the HTTPTargetKey field of the httpConv
- // should be removed as well.
-
- n := 4 // Method, scheme, proto, and host name.
+ /* The following semantic conventions are returned if present:
+ http.scheme string
+ http.route string
+ http.method string
+ http.status_code int
+ net.host.name string
+ net.host.port int
+ net.protocol.name string Note: not set if the value is "http".
+ net.protocol.version string
+ */
+
+ n := 3 // Method, scheme, and host name.
var host string
var p int
if server == "" {
@@ -417,16 +467,29 @@ func (c *httpConv) ServerRequestMetrics(server string, req *http.Request) []attr
if hostPort > 0 {
n++
}
+ protoName, protoVersion := netProtocol(req.Proto)
+ if protoName != "" {
+ n++
+ }
+ if protoVersion != "" {
+ n++
+ }
+
attrs := make([]attribute.KeyValue, 0, n)
attrs = append(attrs, c.methodMetric(req.Method))
attrs = append(attrs, c.scheme(req.TLS != nil))
- attrs = append(attrs, c.flavor(req.Proto))
attrs = append(attrs, c.NetConv.HostName(host))
if hostPort > 0 {
attrs = append(attrs, c.NetConv.HostPort(hostPort))
}
+ if protoName != "" {
+ attrs = append(attrs, c.NetConv.NetProtocolName.String(protoName))
+ }
+ if protoVersion != "" {
+ attrs = append(attrs, c.NetConv.NetProtocolVersion.String(protoVersion))
+ }
return attrs
}
@@ -455,21 +518,6 @@ func (c *httpConv) scheme(https bool) attribute.KeyValue { // nolint:revive
return c.HTTPSchemeHTTP
}
-func (c *httpConv) flavor(proto string) attribute.KeyValue {
- switch proto {
- case "HTTP/1.0":
- return c.HTTPFlavorKey.String("1.0")
- case "HTTP/1.1":
- return c.HTTPFlavorKey.String("1.1")
- case "HTTP/2":
- return c.HTTPFlavorKey.String("2.0")
- case "HTTP/3":
- return c.HTTPFlavorKey.String("3.0")
- default:
- return c.HTTPFlavorKey.String(proto)
- }
-}
-
func serverClientIP(xForwardedFor string) string {
if idx := strings.Index(xForwardedFor, ","); idx >= 0 {
xForwardedFor = xForwardedFor[:idx]
@@ -501,31 +549,6 @@ func firstHostPort(source ...string) (host string, port int) {
return
}
-// RequestHeader returns the contents of h as OpenTelemetry attributes.
-func (c *httpConv) RequestHeader(h http.Header) []attribute.KeyValue {
- return c.header("http.request.header", h)
-}
-
-// ResponseHeader returns the contents of h as OpenTelemetry attributes.
-func (c *httpConv) ResponseHeader(h http.Header) []attribute.KeyValue {
- return c.header("http.response.header", h)
-}
-
-func (c *httpConv) header(prefix string, h http.Header) []attribute.KeyValue {
- key := func(k string) attribute.Key {
- k = strings.ToLower(k)
- k = strings.ReplaceAll(k, "-", "_")
- k = fmt.Sprintf("%s.%s", prefix, k)
- return attribute.Key(k)
- }
-
- attrs := make([]attribute.KeyValue, 0, len(h))
- for k, v := range h {
- attrs = append(attrs, key(k).StringSlice(v))
- }
- return attrs
-}
-
// ClientStatus returns a span status code and message for an HTTP status code
// value received by a client.
func (c *httpConv) ClientStatus(code int) (codes.Code, string) {
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/netconv.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/netconv.go
index bde88934..b80a1db6 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/netconv.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/netconv.go
@@ -2,17 +2,7 @@
// source: internal/shared/semconvutil/netconv.go.tmpl
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package semconvutil // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil"
@@ -22,7 +12,7 @@ import (
"strings"
"go.opentelemetry.io/otel/attribute"
- semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
+ semconv "go.opentelemetry.io/otel/semconv/v1.20.0"
)
// NetTransport returns a trace attribute describing the transport protocol of the
@@ -32,24 +22,6 @@ func NetTransport(network string) attribute.KeyValue {
return nc.Transport(network)
}
-// NetClient returns trace attributes for a client network connection to address.
-// See net.Dial for information about acceptable address values, address should
-// be the same as the one used to create conn. If conn is nil, only network
-// peer attributes will be returned that describe address. Otherwise, the
-// socket level information about conn will also be included.
-func NetClient(address string, conn net.Conn) []attribute.KeyValue {
- return nc.Client(address, conn)
-}
-
-// NetServer returns trace attributes for a network listener listening at address.
-// See net.Listen for information about acceptable address values, address
-// should be the same as the one used to create ln. If ln is nil, only network
-// host attributes will be returned that describe address. Otherwise, the
-// socket level information about ln will also be included.
-func NetServer(address string, ln net.Listener) []attribute.KeyValue {
- return nc.Server(address, ln)
-}
-
// netConv are the network semantic convention attributes defined for a version
// of the OpenTelemetry specification.
type netConv struct {
@@ -57,6 +29,8 @@ type netConv struct {
NetHostPortKey attribute.Key
NetPeerNameKey attribute.Key
NetPeerPortKey attribute.Key
+ NetProtocolName attribute.Key
+ NetProtocolVersion attribute.Key
NetSockFamilyKey attribute.Key
NetSockPeerAddrKey attribute.Key
NetSockPeerPortKey attribute.Key
@@ -73,6 +47,8 @@ var nc = &netConv{
NetHostPortKey: semconv.NetHostPortKey,
NetPeerNameKey: semconv.NetPeerNameKey,
NetPeerPortKey: semconv.NetPeerPortKey,
+ NetProtocolName: semconv.NetProtocolNameKey,
+ NetProtocolVersion: semconv.NetProtocolVersionKey,
NetSockFamilyKey: semconv.NetSockFamilyKey,
NetSockPeerAddrKey: semconv.NetSockPeerAddrKey,
NetSockPeerPortKey: semconv.NetSockPeerPortKey,
@@ -116,57 +92,11 @@ func (c *netConv) Host(address string) []attribute.KeyValue {
attrs := make([]attribute.KeyValue, 0, n)
attrs = append(attrs, c.HostName(h))
if p > 0 {
- attrs = append(attrs, c.HostPort(int(p)))
+ attrs = append(attrs, c.HostPort(p))
}
return attrs
}
-// Server returns attributes for a network listener listening at address. See
-// net.Listen for information about acceptable address values, address should
-// be the same as the one used to create ln. If ln is nil, only network host
-// attributes will be returned that describe address. Otherwise, the socket
-// level information about ln will also be included.
-func (c *netConv) Server(address string, ln net.Listener) []attribute.KeyValue {
- if ln == nil {
- return c.Host(address)
- }
-
- lAddr := ln.Addr()
- if lAddr == nil {
- return c.Host(address)
- }
-
- hostName, hostPort := splitHostPort(address)
- sockHostAddr, sockHostPort := splitHostPort(lAddr.String())
- network := lAddr.Network()
- sockFamily := family(network, sockHostAddr)
-
- n := nonZeroStr(hostName, network, sockHostAddr, sockFamily)
- n += positiveInt(hostPort, sockHostPort)
- attr := make([]attribute.KeyValue, 0, n)
- if hostName != "" {
- attr = append(attr, c.HostName(hostName))
- if hostPort > 0 {
- // Only if net.host.name is set should net.host.port be.
- attr = append(attr, c.HostPort(hostPort))
- }
- }
- if network != "" {
- attr = append(attr, c.Transport(network))
- }
- if sockFamily != "" {
- attr = append(attr, c.NetSockFamilyKey.String(sockFamily))
- }
- if sockHostAddr != "" {
- attr = append(attr, c.NetSockHostAddrKey.String(sockHostAddr))
- if sockHostPort > 0 {
- // Only if net.sock.host.addr is set should net.sock.host.port be.
- attr = append(attr, c.NetSockHostPortKey.Int(sockHostPort))
- }
- }
- return attr
-}
-
func (c *netConv) HostName(name string) attribute.KeyValue {
return c.NetHostNameKey.String(name)
}
@@ -175,85 +105,6 @@ func (c *netConv) HostPort(port int) attribute.KeyValue {
return c.NetHostPortKey.Int(port)
}
-// Client returns attributes for a client network connection to address. See
-// net.Dial for information about acceptable address values, address should be
-// the same as the one used to create conn. If conn is nil, only network peer
-// attributes will be returned that describe address. Otherwise, the socket
-// level information about conn will also be included.
-func (c *netConv) Client(address string, conn net.Conn) []attribute.KeyValue {
- if conn == nil {
- return c.Peer(address)
- }
-
- lAddr, rAddr := conn.LocalAddr(), conn.RemoteAddr()
-
- var network string
- switch {
- case lAddr != nil:
- network = lAddr.Network()
- case rAddr != nil:
- network = rAddr.Network()
- default:
- return c.Peer(address)
- }
-
- peerName, peerPort := splitHostPort(address)
- var (
- sockFamily string
- sockPeerAddr string
- sockPeerPort int
- sockHostAddr string
- sockHostPort int
- )
-
- if lAddr != nil {
- sockHostAddr, sockHostPort = splitHostPort(lAddr.String())
- }
-
- if rAddr != nil {
- sockPeerAddr, sockPeerPort = splitHostPort(rAddr.String())
- }
-
- switch {
- case sockHostAddr != "":
- sockFamily = family(network, sockHostAddr)
- case sockPeerAddr != "":
- sockFamily = family(network, sockPeerAddr)
- }
-
- n := nonZeroStr(peerName, network, sockPeerAddr, sockHostAddr, sockFamily)
- n += positiveInt(peerPort, sockPeerPort, sockHostPort)
- attr := make([]attribute.KeyValue, 0, n)
- if peerName != "" {
- attr = append(attr, c.PeerName(peerName))
- if peerPort > 0 {
- // Only if net.peer.name is set should net.peer.port be.
- attr = append(attr, c.PeerPort(peerPort))
- }
- }
- if network != "" {
- attr = append(attr, c.Transport(network))
- }
- if sockFamily != "" {
- attr = append(attr, c.NetSockFamilyKey.String(sockFamily))
- }
- if sockPeerAddr != "" {
- attr = append(attr, c.NetSockPeerAddrKey.String(sockPeerAddr))
- if sockPeerPort > 0 {
- // Only if net.sock.peer.addr is set should net.sock.peer.port be.
- attr = append(attr, c.NetSockPeerPortKey.Int(sockPeerPort))
- }
- }
- if sockHostAddr != "" {
- attr = append(attr, c.NetSockHostAddrKey.String(sockHostAddr))
- if sockHostPort > 0 {
- // Only if net.sock.host.addr is set should net.sock.host.port be.
- attr = append(attr, c.NetSockHostPortKey.Int(sockHostPort))
- }
- }
- return attr
-}
-
func family(network, address string) string {
switch network {
case "unix", "unixgram", "unixpacket":
@@ -269,26 +120,6 @@ func family(network, address string) string {
return ""
}
-func nonZeroStr(strs ...string) int {
- var n int
- for _, str := range strs {
- if str != "" {
- n++
- }
- }
- return n
-}
-
-func positiveInt(ints ...int) int {
- var n int
- for _, i := range ints {
- if i > 0 {
- n++
- }
- }
- return n
-}
-
// Peer returns attributes for a network peer address.
func (c *netConv) Peer(address string) []attribute.KeyValue {
h, p := splitHostPort(address)
@@ -307,7 +138,7 @@ func (c *netConv) Peer(address string) []attribute.KeyValue {
attrs := make([]attribute.KeyValue, 0, n)
attrs = append(attrs, c.PeerName(h))
if p > 0 {
- attrs = append(attrs, c.PeerPort(int(p)))
+ attrs = append(attrs, c.PeerPort(p))
}
return attrs
}
@@ -364,5 +195,11 @@ func splitHostPort(hostport string) (host string, port int) {
if err != nil {
return
}
- return host, int(p)
+ return host, int(p) // nolint: gosec // Bitsize checked to be 16 above.
+}
+
+func netProtocol(proto string) (name string, version string) {
+ name, version, _ = strings.Cut(proto, "/")
+ name = strings.ToLower(name)
+ return name, version
}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/labeler.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/labeler.go
index 26a51a18..ea504e39 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/labeler.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/labeler.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
@@ -48,8 +37,12 @@ type labelerContextKeyType int
const lablelerContextKey labelerContextKeyType = 0
-func injectLabeler(ctx context.Context, l *Labeler) context.Context {
- return context.WithValue(ctx, lablelerContextKey, l)
+// ContextWithLabeler returns a new context with the provided Labeler instance.
+// Attributes added to the specified labeler will be injected into metrics
+// emitted by the instrumentation. Only one labeller can be injected into the
+// context. Injecting it multiple times will override the previous calls.
+func ContextWithLabeler(parent context.Context, l *Labeler) context.Context {
+ return context.WithValue(parent, lablelerContextKey, l)
}
// LabelerFromContext retrieves a Labeler instance from the provided context if
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/start_time_context.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/start_time_context.go
new file mode 100644
index 00000000..9476ef01
--- /dev/null
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/start_time_context.go
@@ -0,0 +1,29 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
+
+import (
+ "context"
+ "time"
+)
+
+type startTimeContextKeyType int
+
+const startTimeContextKey startTimeContextKeyType = 0
+
+// ContextWithStartTime returns a new context with the provided start time. The
+// start time will be used for metrics and traces emitted by the
+// instrumentation. Only one labeller can be injected into the context.
+// Injecting it multiple times will override the previous calls.
+func ContextWithStartTime(parent context.Context, start time.Time) context.Context {
+ return context.WithValue(parent, startTimeContextKey, start)
+}
+
+// StartTimeFromContext retrieves a time.Time from the provided context if one
+// is available. If no start time was found in the provided context, a new,
+// zero start time is returned and the second return value is false.
+func StartTimeFromContext(ctx context.Context) time.Time {
+ t, _ := ctx.Value(startTimeContextKey).(time.Time)
+ return t
+}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go
index e835cac1..39681ad4 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
@@ -19,31 +8,40 @@ import (
"io"
"net/http"
"net/http/httptrace"
+ "sync/atomic"
+ "time"
- "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil"
+ "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request"
+ "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv"
"go.opentelemetry.io/otel"
+ "go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/codes"
"go.opentelemetry.io/otel/propagation"
+
"go.opentelemetry.io/otel/trace"
)
// Transport implements the http.RoundTripper interface and wraps
-// outbound HTTP(S) requests with a span.
+// outbound HTTP(S) requests with a span and enriches it with metrics.
type Transport struct {
rt http.RoundTripper
- tracer trace.Tracer
- propagators propagation.TextMapPropagator
- spanStartOptions []trace.SpanStartOption
- filters []Filter
- spanNameFormatter func(string, *http.Request) string
- clientTrace func(context.Context) *httptrace.ClientTrace
+ tracer trace.Tracer
+ propagators propagation.TextMapPropagator
+ spanStartOptions []trace.SpanStartOption
+ filters []Filter
+ spanNameFormatter func(string, *http.Request) string
+ clientTrace func(context.Context) *httptrace.ClientTrace
+ metricAttributesFn func(*http.Request) []attribute.KeyValue
+
+ semconv semconv.HTTPClient
}
var _ http.RoundTripper = &Transport{}
// NewTransport wraps the provided http.RoundTripper with one that
-// starts a span and injects the span context into the outbound request headers.
+// starts a span, injects the span context into the outbound request headers,
+// and enriches it with metrics.
//
// If the provided http.RoundTripper is nil, http.DefaultTransport will be used
// as the base http.RoundTripper.
@@ -74,6 +72,8 @@ func (t *Transport) applyConfig(c *config) {
t.filters = c.Filters
t.spanNameFormatter = c.SpanNameFormatter
t.clientTrace = c.ClientTrace
+ t.semconv = semconv.NewHTTPClient(c.Meter)
+ t.metricAttributesFn = c.MetricAttributesFn
}
func defaultTransportFormatter(_ string, r *http.Request) string {
@@ -84,6 +84,7 @@ func defaultTransportFormatter(_ string, r *http.Request) string {
// before handing the request to the configured base RoundTripper. The created span will
// end when the response body is closed or when a read from the body returns io.EOF.
func (t *Transport) RoundTrip(r *http.Request) (*http.Response, error) {
+ requestStartTime := time.Now()
for _, f := range t.filters {
if !f(r) {
// Simply pass through to the base RoundTripper if a filter rejects the request
@@ -109,39 +110,91 @@ func (t *Transport) RoundTrip(r *http.Request) (*http.Response, error) {
ctx = httptrace.WithClientTrace(ctx, t.clientTrace(ctx))
}
+ labeler, found := LabelerFromContext(ctx)
+ if !found {
+ ctx = ContextWithLabeler(ctx, labeler)
+ }
+
r = r.Clone(ctx) // According to RoundTripper spec, we shouldn't modify the origin request.
- span.SetAttributes(semconvutil.HTTPClientRequest(r)...)
+
+ // if request body is nil or NoBody, we don't want to mutate the body as it
+ // will affect the identity of it in an unforeseeable way because we assert
+ // ReadCloser fulfills a certain interface and it is indeed nil or NoBody.
+ bw := request.NewBodyWrapper(r.Body, func(int64) {})
+ if r.Body != nil && r.Body != http.NoBody {
+ r.Body = bw
+ }
+
+ span.SetAttributes(t.semconv.RequestTraceAttrs(r)...)
t.propagators.Inject(ctx, propagation.HeaderCarrier(r.Header))
res, err := t.rt.RoundTrip(r)
if err != nil {
- span.RecordError(err)
+ // set error type attribute if the error is part of the predefined
+ // error types.
+ // otherwise, record it as an exception
+ if errType := t.semconv.ErrorType(err); errType.Valid() {
+ span.SetAttributes(errType)
+ } else {
+ span.RecordError(err)
+ }
+
span.SetStatus(codes.Error, err.Error())
span.End()
return res, err
}
- span.SetAttributes(semconvutil.HTTPClientResponse(res)...)
- span.SetStatus(semconvutil.HTTPClientStatus(res.StatusCode))
- res.Body = newWrappedBody(span, res.Body)
+ // metrics
+ metricOpts := t.semconv.MetricOptions(semconv.MetricAttributes{
+ Req: r,
+ StatusCode: res.StatusCode,
+ AdditionalAttributes: append(labeler.Get(), t.metricAttributesFromRequest(r)...),
+ })
- return res, err
+ // For handling response bytes we leverage a callback when the client reads the http response
+ readRecordFunc := func(n int64) {
+ t.semconv.RecordResponseSize(ctx, n, metricOpts.AddOptions())
+ }
+
+ // traces
+ span.SetAttributes(t.semconv.ResponseTraceAttrs(res)...)
+ span.SetStatus(t.semconv.Status(res.StatusCode))
+
+ res.Body = newWrappedBody(span, readRecordFunc, res.Body)
+
+ // Use floating point division here for higher precision (instead of Millisecond method).
+ elapsedTime := float64(time.Since(requestStartTime)) / float64(time.Millisecond)
+
+ t.semconv.RecordMetrics(ctx, semconv.MetricData{
+ RequestSize: bw.BytesRead(),
+ ElapsedTime: elapsedTime,
+ }, metricOpts)
+
+ return res, nil
+}
+
+func (t *Transport) metricAttributesFromRequest(r *http.Request) []attribute.KeyValue {
+ var attributeForRequest []attribute.KeyValue
+ if t.metricAttributesFn != nil {
+ attributeForRequest = t.metricAttributesFn(r)
+ }
+ return attributeForRequest
}
// newWrappedBody returns a new and appropriately scoped *wrappedBody as an
// io.ReadCloser. If the passed body implements io.Writer, the returned value
// will implement io.ReadWriteCloser.
-func newWrappedBody(span trace.Span, body io.ReadCloser) io.ReadCloser {
+func newWrappedBody(span trace.Span, record func(n int64), body io.ReadCloser) io.ReadCloser {
// The successful protocol switch responses will have a body that
// implement an io.ReadWriteCloser. Ensure this interface type continues
// to be satisfied if that is the case.
if _, ok := body.(io.ReadWriteCloser); ok {
- return &wrappedBody{span: span, body: body}
+ return &wrappedBody{span: span, record: record, body: body}
}
// Remove the implementation of the io.ReadWriteCloser and only implement
// the io.ReadCloser.
- return struct{ io.ReadCloser }{&wrappedBody{span: span, body: body}}
+ return struct{ io.ReadCloser }{&wrappedBody{span: span, record: record, body: body}}
}
// wrappedBody is the response body type returned by the transport
@@ -153,8 +206,11 @@ func newWrappedBody(span trace.Span, body io.ReadCloser) io.ReadCloser {
// If the response body implements the io.Writer interface (i.e. for
// successful protocol switches), the wrapped body also will.
type wrappedBody struct {
- span trace.Span
- body io.ReadCloser
+ span trace.Span
+ recorded atomic.Bool
+ record func(n int64)
+ body io.ReadCloser
+ read atomic.Int64
}
var _ io.ReadWriteCloser = &wrappedBody{}
@@ -171,11 +227,14 @@ func (wb *wrappedBody) Write(p []byte) (int, error) {
func (wb *wrappedBody) Read(b []byte) (int, error) {
n, err := wb.body.Read(b)
+ // Record the number of bytes read
+ wb.read.Add(int64(n))
switch err {
case nil:
// nothing to do here but fall through to the return
case io.EOF:
+ wb.recordBytesRead()
wb.span.End()
default:
wb.span.RecordError(err)
@@ -184,7 +243,20 @@ func (wb *wrappedBody) Read(b []byte) (int, error) {
return n, err
}
+// recordBytesRead is a function that ensures the number of bytes read is recorded once and only once.
+func (wb *wrappedBody) recordBytesRead() {
+ // note: it is more performant (and equally correct) to use atomic.Bool over sync.Once here. In the event that
+ // two goroutines are racing to call this method, the number of bytes read will no longer increase. Using
+ // CompareAndSwap allows later goroutines to return quickly and not block waiting for the race winner to finish
+ // calling wb.record(wb.read.Load()).
+ if wb.recorded.CompareAndSwap(false, true) {
+ // Record the total number of bytes read
+ wb.record(wb.read.Load())
+ }
+}
+
func (wb *wrappedBody) Close() error {
+ wb.recordBytesRead()
wb.span.End()
if wb.body != nil {
return wb.body.Close()
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go
index bd41c180..16ef3cb9 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go
@@ -1,22 +1,11 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
// Version is the current release version of the otelhttp instrumentation.
func Version() string {
- return "0.46.1"
+ return "0.57.0"
// This string is updated by the pre_release.sh script during release
}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/wrap.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/wrap.go
deleted file mode 100644
index 11a35ed1..00000000
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/wrap.go
+++ /dev/null
@@ -1,99 +0,0 @@
-// Copyright The OpenTelemetry 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 otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
-
-import (
- "context"
- "io"
- "net/http"
-
- "go.opentelemetry.io/otel/propagation"
-)
-
-var _ io.ReadCloser = &bodyWrapper{}
-
-// bodyWrapper wraps a http.Request.Body (an io.ReadCloser) to track the number
-// of bytes read and the last error.
-type bodyWrapper struct {
- io.ReadCloser
- record func(n int64) // must not be nil
-
- read int64
- err error
-}
-
-func (w *bodyWrapper) Read(b []byte) (int, error) {
- n, err := w.ReadCloser.Read(b)
- n1 := int64(n)
- w.read += n1
- w.err = err
- w.record(n1)
- return n, err
-}
-
-func (w *bodyWrapper) Close() error {
- return w.ReadCloser.Close()
-}
-
-var _ http.ResponseWriter = &respWriterWrapper{}
-
-// respWriterWrapper wraps a http.ResponseWriter in order to track the number of
-// bytes written, the last error, and to catch the first written statusCode.
-// TODO: The wrapped http.ResponseWriter doesn't implement any of the optional
-// types (http.Hijacker, http.Pusher, http.CloseNotifier, http.Flusher, etc)
-// that may be useful when using it in real life situations.
-type respWriterWrapper struct {
- http.ResponseWriter
- record func(n int64) // must not be nil
-
- // used to inject the header
- ctx context.Context
-
- props propagation.TextMapPropagator
-
- written int64
- statusCode int
- err error
- wroteHeader bool
-}
-
-func (w *respWriterWrapper) Header() http.Header {
- return w.ResponseWriter.Header()
-}
-
-func (w *respWriterWrapper) Write(p []byte) (int, error) {
- if !w.wroteHeader {
- w.WriteHeader(http.StatusOK)
- }
- n, err := w.ResponseWriter.Write(p)
- n1 := int64(n)
- w.record(n1)
- w.written += n1
- w.err = err
- return n, err
-}
-
-// WriteHeader persists initial statusCode for span attribution.
-// All calls to WriteHeader will be propagated to the underlying ResponseWriter
-// and will persist the statusCode from the first call.
-// Blocking consecutive calls to WriteHeader alters expected behavior and will
-// remove warning logs from net/http where developers will notice incorrect handler implementations.
-func (w *respWriterWrapper) WriteHeader(statusCode int) {
- if !w.wroteHeader {
- w.wroteHeader = true
- w.statusCode = statusCode
- }
- w.ResponseWriter.WriteHeader(statusCode)
-}
diff --git a/vendor/go.opentelemetry.io/otel/.codespellignore b/vendor/go.opentelemetry.io/otel/.codespellignore
index ae6a3bcf..6bf3abc4 100644
--- a/vendor/go.opentelemetry.io/otel/.codespellignore
+++ b/vendor/go.opentelemetry.io/otel/.codespellignore
@@ -3,3 +3,7 @@ fo
te
collison
consequentially
+ans
+nam
+valu
+thirdparty
diff --git a/vendor/go.opentelemetry.io/otel/.codespellrc b/vendor/go.opentelemetry.io/otel/.codespellrc
index 4afbb1fb..e2cb3ea9 100644
--- a/vendor/go.opentelemetry.io/otel/.codespellrc
+++ b/vendor/go.opentelemetry.io/otel/.codespellrc
@@ -5,6 +5,6 @@ check-filenames =
check-hidden =
ignore-words = .codespellignore
interactive = 1
-skip = .git,go.mod,go.sum,semconv,venv,.tools
+skip = .git,go.mod,go.sum,go.work,go.work.sum,semconv,venv,.tools
uri-ignore-words-list = *
write =
diff --git a/vendor/go.opentelemetry.io/otel/.gitignore b/vendor/go.opentelemetry.io/otel/.gitignore
index 895c7664..ae8577ef 100644
--- a/vendor/go.opentelemetry.io/otel/.gitignore
+++ b/vendor/go.opentelemetry.io/otel/.gitignore
@@ -12,11 +12,3 @@ go.work
go.work.sum
gen/
-
-/example/dice/dice
-/example/namedtracer/namedtracer
-/example/otel-collector/otel-collector
-/example/opencensus/opencensus
-/example/passthrough/passthrough
-/example/prometheus/prometheus
-/example/zipkin/zipkin
diff --git a/vendor/go.opentelemetry.io/otel/.gitmodules b/vendor/go.opentelemetry.io/otel/.gitmodules
deleted file mode 100644
index 38a1f569..00000000
--- a/vendor/go.opentelemetry.io/otel/.gitmodules
+++ /dev/null
@@ -1,3 +0,0 @@
-[submodule "opentelemetry-proto"]
- path = exporters/otlp/internal/opentelemetry-proto
- url = https://github.com/open-telemetry/opentelemetry-proto
diff --git a/vendor/go.opentelemetry.io/otel/.golangci.yml b/vendor/go.opentelemetry.io/otel/.golangci.yml
index a62511f3..dbfb2a16 100644
--- a/vendor/go.opentelemetry.io/otel/.golangci.yml
+++ b/vendor/go.opentelemetry.io/otel/.golangci.yml
@@ -9,8 +9,11 @@ linters:
disable-all: true
# Specifically enable linters we want to use.
enable:
+ - asasalint
+ - bodyclose
- depguard
- errcheck
+ - errorlint
- godot
- gofumpt
- goimports
@@ -21,8 +24,12 @@ linters:
- misspell
- revive
- staticcheck
+ - tenv
+ - testifylint
- typecheck
+ - unconvert
- unused
+ - unparam
issues:
# Maximum issues count per one linter.
@@ -58,12 +65,12 @@ issues:
- path: _test\.go
linters:
- gosec
- # Igonoring gosec G404: Use of weak random number generator (math/rand instead of crypto/rand)
+ # Ignoring gosec G404: Use of weak random number generator (math/rand instead of crypto/rand)
# as we commonly use it in tests and examples.
- text: "G404:"
linters:
- gosec
- # Igonoring gosec G402: TLS MinVersion too low
+ # Ignoring gosec G402: TLS MinVersion too low
# as the https://pkg.go.dev/crypto/tls#Config handles MinVersion default well.
- text: "G402: TLS MinVersion too low."
linters:
@@ -120,10 +127,10 @@ linters-settings:
- "**/metric/**/*.go"
- "**/bridge/*.go"
- "**/bridge/**/*.go"
- - "**/example/*.go"
- - "**/example/**/*.go"
- "**/trace/*.go"
- "**/trace/**/*.go"
+ - "**/log/*.go"
+ - "**/log/**/*.go"
deny:
- pkg: "go.opentelemetry.io/otel/internal$"
desc: Do not use cross-module internal packages.
@@ -294,3 +301,9 @@ linters-settings:
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#waitgroup-by-value
- name: waitgroup-by-value
disabled: false
+ testifylint:
+ enable-all: true
+ disable:
+ - float-compare
+ - go-require
+ - require-error
diff --git a/vendor/go.opentelemetry.io/otel/CHANGELOG.md b/vendor/go.opentelemetry.io/otel/CHANGELOG.md
index 24874f85..8f68dbd0 100644
--- a/vendor/go.opentelemetry.io/otel/CHANGELOG.md
+++ b/vendor/go.opentelemetry.io/otel/CHANGELOG.md
@@ -8,6 +8,427 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
## [Unreleased]
+
+
+
+## [1.32.0/0.54.0/0.8.0/0.0.11] 2024-11-08
+
+### Added
+
+- Add `go.opentelemetry.io/otel/sdk/metric/exemplar.AlwaysOffFilter`, which can be used to disable exemplar recording. (#5850)
+- Add `go.opentelemetry.io/otel/sdk/metric.WithExemplarFilter`, which can be used to configure the exemplar filter used by the metrics SDK. (#5850)
+- Add `ExemplarReservoirProviderSelector` and `DefaultExemplarReservoirProviderSelector` to `go.opentelemetry.io/otel/sdk/metric`, which defines the exemplar reservoir to use based on the aggregation of the metric. (#5861)
+- Add `ExemplarReservoirProviderSelector` to `go.opentelemetry.io/otel/sdk/metric.Stream` to allow using views to configure the exemplar reservoir to use for a metric. (#5861)
+- Add `ReservoirProvider`, `HistogramReservoirProvider` and `FixedSizeReservoirProvider` to `go.opentelemetry.io/otel/sdk/metric/exemplar` to make it convenient to use providers of Reservoirs. (#5861)
+- The `go.opentelemetry.io/otel/semconv/v1.27.0` package.
+ The package contains semantic conventions from the `v1.27.0` version of the OpenTelemetry Semantic Conventions. (#5894)
+- Add `Attributes attribute.Set` field to `Scope` in `go.opentelemetry.io/otel/sdk/instrumentation`. (#5903)
+- Add `Attributes attribute.Set` field to `ScopeRecords` in `go.opentelemetry.io/otel/log/logtest`. (#5927)
+- `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc` adds instrumentation scope attributes. (#5934)
+- `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp` adds instrumentation scope attributes. (#5934)
+- `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` adds instrumentation scope attributes. (#5935)
+- `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` adds instrumentation scope attributes. (#5935)
+- `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc` adds instrumentation scope attributes. (#5933)
+- `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp` adds instrumentation scope attributes. (#5933)
+- `go.opentelemetry.io/otel/exporters/prometheus` adds instrumentation scope attributes in `otel_scope_info` metric as labels. (#5932)
+
+### Changed
+
+- Support scope attributes and make them as identifying for `Tracer` in `go.opentelemetry.io/otel` and `go.opentelemetry.io/otel/sdk/trace`. (#5924)
+- Support scope attributes and make them as identifying for `Meter` in `go.opentelemetry.io/otel` and `go.opentelemetry.io/otel/sdk/metric`. (#5926)
+- Support scope attributes and make them as identifying for `Logger` in `go.opentelemetry.io/otel` and `go.opentelemetry.io/otel/sdk/log`. (#5925)
+- Make schema URL and scope attributes as identifying for `Tracer` in `go.opentelemetry.io/otel/bridge/opentracing`. (#5931)
+- Clear unneeded slice elements to allow GC to collect the objects in `go.opentelemetry.io/otel/sdk/metric` and `go.opentelemetry.io/otel/sdk/trace`. (#5804)
+
+### Fixed
+
+- Global MeterProvider registration unwraps global instrument Observers, the undocumented Unwrap() methods are now private. (#5881)
+- `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` now keeps the metadata already present in the context when `WithHeaders` is used. (#5892)
+- `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc` now keeps the metadata already present in the context when `WithHeaders` is used. (#5911)
+- `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc` now keeps the metadata already present in the context when `WithHeaders` is used. (#5915)
+- Fix `go.opentelemetry.io/otel/exporters/prometheus` trying to add exemplars to Gauge metrics, which is unsupported. (#5912)
+- Fix `WithEndpointURL` to always use a secure connection when an https URL is passed in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`. (#5944)
+- Fix `WithEndpointURL` to always use a secure connection when an https URL is passed in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#5944)
+- Fix `WithEndpointURL` to always use a secure connection when an https URL is passed in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc`. (#5944)
+- Fix `WithEndpointURL` to always use a secure connection when an https URL is passed in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`. (#5944)
+- Fix incorrect metrics generated from callbacks when multiple readers are used in `go.opentelemetry.io/otel/sdk/metric`. (#5900)
+
+### Removed
+
+- Remove all examples under `go.opentelemetry.io/otel/example` as they are moved to [Contrib repository](https://github.com/open-telemetry/opentelemetry-go-contrib/tree/main/examples). (#5930)
+
+## [1.31.0/0.53.0/0.7.0/0.0.10] 2024-10-11
+
+### Added
+
+- Add `go.opentelemetry.io/otel/sdk/metric/exemplar` package which includes `Exemplar`, `Filter`, `TraceBasedFilter`, `AlwaysOnFilter`, `HistogramReservoir`, `FixedSizeReservoir`, `Reservoir`, `Value` and `ValueType` types. These will be used for configuring the exemplar reservoir for the metrics sdk. (#5747, #5862)
+- Add `WithExportBufferSize` option to log batch processor.(#5877)
+
+### Changed
+
+- Enable exemplars by default in `go.opentelemetry.io/otel/sdk/metric`. Exemplars can be disabled by setting `OTEL_METRICS_EXEMPLAR_FILTER=always_off` (#5778)
+- `Logger.Enabled` in `go.opentelemetry.io/otel/log` now accepts a newly introduced `EnabledParameters` type instead of `Record`. (#5791)
+- `FilterProcessor.Enabled` in `go.opentelemetry.io/otel/sdk/log/internal/x` now accepts `EnabledParameters` instead of `Record`. (#5791)
+- The `Record` type in `go.opentelemetry.io/otel/log` is no longer comparable. (#5847)
+- Performance improvements for the trace SDK `SetAttributes` method in `Span`. (#5864)
+- Reduce memory allocations for the `Event` and `Link` lists in `Span`. (#5858)
+- Performance improvements for the trace SDK `AddEvent`, `AddLink`, `RecordError` and `End` methods in `Span`. (#5874)
+
+### Deprecated
+
+- Deprecate all examples under `go.opentelemetry.io/otel/example` as they are moved to [Contrib repository](https://github.com/open-telemetry/opentelemetry-go-contrib/tree/main/examples). (#5854)
+
+### Fixed
+
+- The race condition for multiple `FixedSize` exemplar reservoirs identified in #5814 is resolved. (#5819)
+- Fix log records duplication in case of heterogeneous resource attributes by correctly mapping each log record to it's resource and scope. (#5803)
+- Fix timer channel drain to avoid hanging on Go 1.23. (#5868)
+- Fix delegation for global meter providers, and panic when calling otel.SetMeterProvider. (#5827)
+- Change the `reflect.TypeOf` to use a nil pointer to not allocate on the heap unless necessary. (#5827)
+
+## [1.30.0/0.52.0/0.6.0/0.0.9] 2024-09-09
+
+### Added
+
+- Support `OTEL_EXPORTER_OTLP_LOGS_INSECURE` and `OTEL_EXPORTER_OTLP_INSECURE` environments in `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc`. (#5739)
+- The `WithResource` option for `NewMeterProvider` now merges the provided resources with the ones from environment variables. (#5773)
+- The `WithResource` option for `NewLoggerProvider` now merges the provided resources with the ones from environment variables. (#5773)
+- Add UTF-8 support to `go.opentelemetry.io/otel/exporters/prometheus`. (#5755)
+
+### Fixed
+
+- Fix memory leak in the global `MeterProvider` when identical instruments are repeatedly created. (#5754)
+- Fix panic on instruments creation when setting meter provider. (#5758)
+- Fix an issue where `SetMeterProvider` in `go.opentelemetry.io/otel` might miss the delegation for instruments and registries. (#5780)
+
+### Removed
+
+- Drop support for [Go 1.21]. (#5736, #5740, #5800)
+
+## [1.29.0/0.51.0/0.5.0] 2024-08-23
+
+This release is the last to support [Go 1.21].
+The next release will require at least [Go 1.22].
+
+### Added
+
+- Add MacOS ARM64 platform to the compatibility testing suite. (#5577)
+- Add `InstrumentationScope` field to `SpanStub` in `go.opentelemetry.io/otel/sdk/trace/tracetest`, as a replacement for the deprecated `InstrumentationLibrary`. (#5627)
+- Make the initial release of `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc`.
+ This new module contains an OTLP exporter that transmits log telemetry using gRPC.
+ This module is unstable and breaking changes may be introduced.
+ See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. (#5629)
+- Add `Walk` function to `TraceState` in `go.opentelemetry.io/otel/trace` to iterate all the key-value pairs. (#5651)
+- Bridge the trace state in `go.opentelemetry.io/otel/bridge/opencensus`. (#5651)
+- Zero value of `SimpleProcessor` in `go.opentelemetry.io/otel/sdk/log` no longer panics. (#5665)
+- The `FilterProcessor` interface type is added in `go.opentelemetry.io/otel/sdk/log/internal/x`.
+ This is an optional and experimental interface that log `Processor`s can implement to instruct the `Logger` if a `Record` will be processed or not.
+ It replaces the existing `Enabled` method that is removed from the `Processor` interface itself.
+ It does not fall within the scope of the OpenTelemetry Go versioning and stability [policy](./VERSIONING.md) and it may be changed in backwards incompatible ways or removed in feature releases. (#5692)
+- Support [Go 1.23]. (#5720)
+
+### Changed
+
+- `NewMemberRaw`, `NewKeyProperty` and `NewKeyValuePropertyRaw` in `go.opentelemetry.io/otel/baggage` allow UTF-8 string in key. (#5132)
+- `Processor.OnEmit` in `go.opentelemetry.io/otel/sdk/log` now accepts a pointer to `Record` instead of a value so that the record modifications done in a processor are propagated to subsequent registered processors. (#5636)
+- `SimpleProcessor.Enabled` in `go.opentelemetry.io/otel/sdk/log` now returns `false` if the exporter is `nil`. (#5665)
+- Update the concurrency requirements of `Exporter` in `go.opentelemetry.io/otel/sdk/log`. (#5666)
+- `SimpleProcessor` in `go.opentelemetry.io/otel/sdk/log` synchronizes `OnEmit` calls. (#5666)
+- The `Processor` interface in `go.opentelemetry.io/otel/sdk/log` no longer includes the `Enabled` method.
+ See the `FilterProcessor` interface type added in `go.opentelemetry.io/otel/sdk/log/internal/x` to continue providing this functionality. (#5692)
+- The `SimpleProcessor` type in `go.opentelemetry.io/otel/sdk/log` is no longer comparable. (#5693)
+- The `BatchProcessor` type in `go.opentelemetry.io/otel/sdk/log` is no longer comparable. (#5693)
+
+### Fixed
+
+- Correct comments for the priority of the `WithEndpoint` and `WithEndpointURL` options and their corresponding environment variables in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`. (#5584)
+- Pass the underlying error rather than a generic retry-able failure in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`, `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp` and `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`. (#5541)
+- Correct the `Tracer`, `Meter`, and `Logger` names used in `go.opentelemetry.io/otel/example/dice`. (#5612)
+- Correct the `Tracer` names used in `go.opentelemetry.io/otel/example/namedtracer`. (#5612)
+- Correct the `Tracer` name used in `go.opentelemetry.io/otel/example/opencensus`. (#5612)
+- Correct the `Tracer` and `Meter` names used in `go.opentelemetry.io/otel/example/otel-collector`. (#5612)
+- Correct the `Tracer` names used in `go.opentelemetry.io/otel/example/passthrough`. (#5612)
+- Correct the `Meter` name used in `go.opentelemetry.io/otel/example/prometheus`. (#5612)
+- Correct the `Tracer` names used in `go.opentelemetry.io/otel/example/zipkin`. (#5612)
+- Correct comments for the priority of the `WithEndpoint` and `WithEndpointURL` options and their corresponding environment variables in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` and `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#5641)
+- Correct comments for the priority of the `WithEndpoint` and `WithEndpointURL` options and their corresponding environment variables in `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp`. (#5650)
+- Stop percent encoding header environment variables in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc`, `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`, `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` and `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` (#5705)
+- Remove invalid environment variable header keys in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc`, `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`, `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` and `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` (#5705)
+
+### Removed
+
+- The `Enabled` method of the `SimpleProcessor` in `go.opentelemetry.io/otel/sdk/log` is removed. (#5692)
+- The `Enabled` method of the `BatchProcessor` in `go.opentelemetry.io/otel/sdk/log` is removed. (#5692)
+
+## [1.28.0/0.50.0/0.4.0] 2024-07-02
+
+### Added
+
+- The `IsEmpty` method is added to the `Instrument` type in `go.opentelemetry.io/otel/sdk/metric`.
+ This method is used to check if an `Instrument` instance is a zero-value. (#5431)
+- Store and provide the emitted `context.Context` in `ScopeRecords` of `go.opentelemetry.io/otel/sdk/log/logtest`. (#5468)
+- The `go.opentelemetry.io/otel/semconv/v1.26.0` package.
+ The package contains semantic conventions from the `v1.26.0` version of the OpenTelemetry Semantic Conventions. (#5476)
+- The `AssertRecordEqual` method to `go.opentelemetry.io/otel/log/logtest` to allow comparison of two log records in tests. (#5499)
+- The `WithHeaders` option to `go.opentelemetry.io/otel/exporters/zipkin` to allow configuring custom http headers while exporting spans. (#5530)
+
+### Changed
+
+- `Tracer.Start` in `go.opentelemetry.io/otel/trace/noop` no longer allocates a span for empty span context. (#5457)
+- Upgrade `go.opentelemetry.io/otel/semconv/v1.25.0` to `go.opentelemetry.io/otel/semconv/v1.26.0` in `go.opentelemetry.io/otel/example/otel-collector`. (#5490)
+- Upgrade `go.opentelemetry.io/otel/semconv/v1.25.0` to `go.opentelemetry.io/otel/semconv/v1.26.0` in `go.opentelemetry.io/otel/example/zipkin`. (#5490)
+- Upgrade `go.opentelemetry.io/otel/semconv/v1.25.0` to `go.opentelemetry.io/otel/semconv/v1.26.0` in `go.opentelemetry.io/otel/exporters/zipkin`. (#5490)
+ - The exporter no longer exports the deprecated "otel.library.name" or "otel.library.version" attributes.
+- Upgrade `go.opentelemetry.io/otel/semconv/v1.25.0` to `go.opentelemetry.io/otel/semconv/v1.26.0` in `go.opentelemetry.io/otel/sdk/resource`. (#5490)
+- Upgrade `go.opentelemetry.io/otel/semconv/v1.25.0` to `go.opentelemetry.io/otel/semconv/v1.26.0` in `go.opentelemetry.io/otel/sdk/trace`. (#5490)
+- `SimpleProcessor.OnEmit` in `go.opentelemetry.io/otel/sdk/log` no longer allocates a slice which makes it possible to have a zero-allocation log processing using `SimpleProcessor`. (#5493)
+- Use non-generic functions in the `Start` method of `"go.opentelemetry.io/otel/sdk/trace".Trace` to reduce memory allocation. (#5497)
+- `service.instance.id` is populated for a `Resource` created with `"go.opentelemetry.io/otel/sdk/resource".Default` with a default value when `OTEL_GO_X_RESOURCE` is set. (#5520)
+- Improve performance of metric instruments in `go.opentelemetry.io/otel/sdk/metric` by removing unnecessary calls to `time.Now`. (#5545)
+
+### Fixed
+
+- Log a warning to the OpenTelemetry internal logger when a `Record` in `go.opentelemetry.io/otel/sdk/log` drops an attribute due to a limit being reached. (#5376)
+- Identify the `Tracer` returned from the global `TracerProvider` in `go.opentelemetry.io/otel/global` with its schema URL. (#5426)
+- Identify the `Meter` returned from the global `MeterProvider` in `go.opentelemetry.io/otel/global` with its schema URL. (#5426)
+- Log a warning to the OpenTelemetry internal logger when a `Span` in `go.opentelemetry.io/otel/sdk/trace` drops an attribute, event, or link due to a limit being reached. (#5434)
+- Document instrument name requirements in `go.opentelemetry.io/otel/metric`. (#5435)
+- Prevent random number generation data-race for experimental rand exemplars in `go.opentelemetry.io/otel/sdk/metric`. (#5456)
+- Fix counting number of dropped attributes of `Record` in `go.opentelemetry.io/otel/sdk/log`. (#5464)
+- Fix panic in baggage creation when a member contains `0x80` char in key or value. (#5494)
+- Correct comments for the priority of the `WithEndpoint` and `WithEndpointURL` options and their corresponding environment variables in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc`. (#5508)
+- Retry trace and span ID generation if it generated an invalid one in `go.opentelemetry.io/otel/sdk/trace`. (#5514)
+- Fix stale timestamps reported by the last-value aggregation. (#5517)
+- Indicate the `Exporter` in `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp` must be created by the `New` method. (#5521)
+- Improved performance in all `{Bool,Int64,Float64,String}SliceValue` functions of `go.opentelemetry.io/attributes` by reducing the number of allocations. (#5549)
+- Replace invalid percent-encoded octet sequences with replacement char in `go.opentelemetry.io/otel/baggage`. (#5528)
+
+## [1.27.0/0.49.0/0.3.0] 2024-05-21
+
+### Added
+
+- Add example for `go.opentelemetry.io/otel/exporters/stdout/stdoutlog`. (#5242)
+- Add `RecordFactory` in `go.opentelemetry.io/otel/sdk/log/logtest` to facilitate testing exporter and processor implementations. (#5258)
+- Add `RecordFactory` in `go.opentelemetry.io/otel/log/logtest` to facilitate testing bridge implementations. (#5263)
+- The count of dropped records from the `BatchProcessor` in `go.opentelemetry.io/otel/sdk/log` is logged. (#5276)
+- Add metrics in the `otel-collector` example. (#5283)
+- Add the synchronous gauge instrument to `go.opentelemetry.io/otel/metric`. (#5304)
+ - An `int64` or `float64` synchronous gauge instrument can now be created from a `Meter`.
+ - All implementations of the API (`go.opentelemetry.io/otel/metric/noop`, `go.opentelemetry.io/otel/sdk/metric`) are updated to support this instrument.
+- Add logs to `go.opentelemetry.io/otel/example/dice`. (#5349)
+
+### Changed
+
+- The `Shutdown` method of `Exporter` in `go.opentelemetry.io/otel/exporters/stdout/stdouttrace` ignores the context cancellation and always returns `nil`. (#5189)
+- The `ForceFlush` and `Shutdown` methods of the exporter returned by `New` in `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` ignore the context cancellation and always return `nil`. (#5189)
+- Apply the value length limits to `Record` attributes in `go.opentelemetry.io/otel/sdk/log`. (#5230)
+- De-duplicate map attributes added to a `Record` in `go.opentelemetry.io/otel/sdk/log`. (#5230)
+- `go.opentelemetry.io/otel/exporters/stdout/stdoutlog` won't print timestamps when `WithoutTimestamps` option is set. (#5241)
+- The `go.opentelemetry.io/otel/exporters/stdout/stdoutlog` exporter won't print `AttributeValueLengthLimit` and `AttributeCountLimit` fields now, instead it prints the `DroppedAttributes` field. (#5272)
+- Improved performance in the `Stringer` implementation of `go.opentelemetry.io/otel/baggage.Member` by reducing the number of allocations. (#5286)
+- Set the start time for last-value aggregates in `go.opentelemetry.io/otel/sdk/metric`. (#5305)
+- The `Span` in `go.opentelemetry.io/otel/sdk/trace` will record links without span context if either non-empty `TraceState` or attributes are provided. (#5315)
+- Upgrade all dependencies of `go.opentelemetry.io/otel/semconv/v1.24.0` to `go.opentelemetry.io/otel/semconv/v1.25.0`. (#5374)
+
+### Fixed
+
+- Comparison of unordered maps for `go.opentelemetry.io/otel/log.KeyValue` and `go.opentelemetry.io/otel/log.Value`. (#5306)
+- Fix the empty output of `go.opentelemetry.io/otel/log.Value` in `go.opentelemetry.io/otel/exporters/stdout/stdoutlog`. (#5311)
+- Split the behavior of `Recorder` in `go.opentelemetry.io/otel/log/logtest` so it behaves as a `LoggerProvider` only. (#5365)
+- Fix wrong package name of the error message when parsing endpoint URL in `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp`. (#5371)
+- Identify the `Logger` returned from the global `LoggerProvider` in `go.opentelemetry.io/otel/log/global` with its schema URL. (#5375)
+
+## [1.26.0/0.48.0/0.2.0-alpha] 2024-04-24
+
+### Added
+
+- Add `Recorder` in `go.opentelemetry.io/otel/log/logtest` to facilitate testing the log bridge implementations. (#5134)
+- Add span flags to OTLP spans and links exported by `go.opentelemetry.io/otel/exporters/otlp/otlptrace`. (#5194)
+- Make the initial alpha release of `go.opentelemetry.io/otel/sdk/log`.
+ This new module contains the Go implementation of the OpenTelemetry Logs SDK.
+ This module is unstable and breaking changes may be introduced.
+ See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. (#5240)
+- Make the initial alpha release of `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp`.
+ This new module contains an OTLP exporter that transmits log telemetry using HTTP.
+ This module is unstable and breaking changes may be introduced.
+ See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. (#5240)
+- Make the initial alpha release of `go.opentelemetry.io/otel/exporters/stdout/stdoutlog`.
+ This new module contains an exporter prints log records to STDOUT.
+ This module is unstable and breaking changes may be introduced.
+ See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. (#5240)
+- The `go.opentelemetry.io/otel/semconv/v1.25.0` package.
+ The package contains semantic conventions from the `v1.25.0` version of the OpenTelemetry Semantic Conventions. (#5254)
+
+### Changed
+
+- Update `go.opentelemetry.io/proto/otlp` from v1.1.0 to v1.2.0. (#5177)
+- Improve performance of baggage member character validation in `go.opentelemetry.io/otel/baggage`. (#5214)
+- The `otel-collector` example now uses docker compose to bring up services instead of kubernetes. (#5244)
+
+### Fixed
+
+- Slice attribute values in `go.opentelemetry.io/otel/attribute` are now emitted as their JSON representation. (#5159)
+
+## [1.25.0/0.47.0/0.0.8/0.1.0-alpha] 2024-04-05
+
+### Added
+
+- Add `WithProxy` option in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#4906)
+- Add `WithProxy` option in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlptracehttp`. (#4906)
+- Add `AddLink` method to the `Span` interface in `go.opentelemetry.io/otel/trace`. (#5032)
+- The `Enabled` method is added to the `Logger` interface in `go.opentelemetry.io/otel/log`.
+ This method is used to notify users if a log record will be emitted or not. (#5071)
+- Add `SeverityUndefined` `const` to `go.opentelemetry.io/otel/log`.
+ This value represents an unset severity level. (#5072)
+- Add `Empty` function in `go.opentelemetry.io/otel/log` to return a `KeyValue` for an empty value. (#5076)
+- Add `go.opentelemetry.io/otel/log/global` to manage the global `LoggerProvider`.
+ This package is provided with the anticipation that all functionality will be migrate to `go.opentelemetry.io/otel` when `go.opentelemetry.io/otel/log` stabilizes.
+ At which point, users will be required to migrage their code, and this package will be deprecated then removed. (#5085)
+- Add support for `Summary` metrics in the `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` and `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` exporters. (#5100)
+- Add `otel.scope.name` and `otel.scope.version` tags to spans exported by `go.opentelemetry.io/otel/exporters/zipkin`. (#5108)
+- Add support for `AddLink` to `go.opentelemetry.io/otel/bridge/opencensus`. (#5116)
+- Add `String` method to `Value` and `KeyValue` in `go.opentelemetry.io/otel/log`. (#5117)
+- Add Exemplar support to `go.opentelemetry.io/otel/exporters/prometheus`. (#5111)
+- Add metric semantic conventions to `go.opentelemetry.io/otel/semconv/v1.24.0`. Future `semconv` packages will include metric semantic conventions as well. (#4528)
+
+### Changed
+
+- `SpanFromContext` and `SpanContextFromContext` in `go.opentelemetry.io/otel/trace` no longer make a heap allocation when the passed context has no span. (#5049)
+- `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc` and `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` now create a gRPC client in idle mode and with "dns" as the default resolver using [`grpc.NewClient`](https://pkg.go.dev/google.golang.org/grpc#NewClient). (#5151)
+ Because of that `WithDialOption` ignores [`grpc.WithBlock`](https://pkg.go.dev/google.golang.org/grpc#WithBlock), [`grpc.WithTimeout`](https://pkg.go.dev/google.golang.org/grpc#WithTimeout), and [`grpc.WithReturnConnectionError`](https://pkg.go.dev/google.golang.org/grpc#WithReturnConnectionError).
+ Notice that [`grpc.DialContext`](https://pkg.go.dev/google.golang.org/grpc#DialContext) which was used before is now deprecated.
+
+### Fixed
+
+- Clarify the documentation about equivalence guarantees for the `Set` and `Distinct` types in `go.opentelemetry.io/otel/attribute`. (#5027)
+- Prevent default `ErrorHandler` self-delegation. (#5137)
+- Update all dependencies to address [GO-2024-2687]. (#5139)
+
+### Removed
+
+- Drop support for [Go 1.20]. (#4967)
+
+### Deprecated
+
+- Deprecate `go.opentelemetry.io/otel/attribute.Sortable` type. (#4734)
+- Deprecate `go.opentelemetry.io/otel/attribute.NewSetWithSortable` function. (#4734)
+- Deprecate `go.opentelemetry.io/otel/attribute.NewSetWithSortableFiltered` function. (#4734)
+
+## [1.24.0/0.46.0/0.0.1-alpha] 2024-02-23
+
+This release is the last to support [Go 1.20].
+The next release will require at least [Go 1.21].
+
+### Added
+
+- Support [Go 1.22]. (#4890)
+- Add exemplar support to `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`. (#4900)
+- Add exemplar support to `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#4900)
+- The `go.opentelemetry.io/otel/log` module is added.
+ This module includes OpenTelemetry Go's implementation of the Logs Bridge API.
+ This module is in an alpha state, it is subject to breaking changes.
+ See our [versioning policy](./VERSIONING.md) for more info. (#4961)
+- Add ARM64 platform to the compatibility testing suite. (#4994)
+
+### Fixed
+
+- Fix registration of multiple callbacks when using the global meter provider from `go.opentelemetry.io/otel`. (#4945)
+- Fix negative buckets in output of exponential histograms. (#4956)
+
+## [1.23.1] 2024-02-07
+
+### Fixed
+
+- Register all callbacks passed during observable instrument creation instead of just the last one multiple times in `go.opentelemetry.io/otel/sdk/metric`. (#4888)
+
+## [1.23.0] 2024-02-06
+
+This release contains the first stable, `v1`, release of the following modules:
+
+- `go.opentelemetry.io/otel/bridge/opencensus`
+- `go.opentelemetry.io/otel/bridge/opencensus/test`
+- `go.opentelemetry.io/otel/example/opencensus`
+- `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`
+- `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`
+- `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric`
+
+See our [versioning policy](VERSIONING.md) for more information about these stability guarantees.
+
+### Added
+
+- Add `WithEndpointURL` option to the `exporters/otlp/otlpmetric/otlpmetricgrpc`, `exporters/otlp/otlpmetric/otlpmetrichttp`, `exporters/otlp/otlptrace/otlptracegrpc` and `exporters/otlp/otlptrace/otlptracehttp` packages. (#4808)
+- Experimental exemplar exporting is added to the metric SDK.
+ See [metric documentation](./sdk/metric/internal/x/README.md#exemplars) for more information about this feature and how to enable it. (#4871)
+- `ErrSchemaURLConflict` is added to `go.opentelemetry.io/otel/sdk/resource`.
+ This error is returned when a merge of two `Resource`s with different (non-empty) schema URL is attempted. (#4876)
+
+### Changed
+
+- The `Merge` and `New` functions in `go.opentelemetry.io/otel/sdk/resource` now returns a partial result if there is a schema URL merge conflict.
+ Instead of returning `nil` when two `Resource`s with different (non-empty) schema URLs are merged the merged `Resource`, along with the new `ErrSchemaURLConflict` error, is returned.
+ It is up to the user to decide if they want to use the returned `Resource` or not.
+ It may have desired attributes overwritten or include stale semantic conventions. (#4876)
+
+### Fixed
+
+- Fix `ContainerID` resource detection on systemd when cgroup path has a colon. (#4449)
+- Fix `go.opentelemetry.io/otel/sdk/metric` to cache instruments to avoid leaking memory when the same instrument is created multiple times. (#4820)
+- Fix missing `Mix` and `Max` values for `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` by introducing `MarshalText` and `MarshalJSON` for the `Extrema` type in `go.opentelemetry.io/sdk/metric/metricdata`. (#4827)
+
+## [1.23.0-rc.1] 2024-01-18
+
+This is a release candidate for the v1.23.0 release.
+That release is expected to include the `v1` release of the following modules:
+
+- `go.opentelemetry.io/otel/bridge/opencensus`
+- `go.opentelemetry.io/otel/bridge/opencensus/test`
+- `go.opentelemetry.io/otel/example/opencensus`
+- `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`
+- `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`
+- `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric`
+
+See our [versioning policy](VERSIONING.md) for more information about these stability guarantees.
+
+## [1.22.0/0.45.0] 2024-01-17
+
+### Added
+
+- The `go.opentelemetry.io/otel/semconv/v1.22.0` package.
+ The package contains semantic conventions from the `v1.22.0` version of the OpenTelemetry Semantic Conventions. (#4735)
+- The `go.opentelemetry.io/otel/semconv/v1.23.0` package.
+ The package contains semantic conventions from the `v1.23.0` version of the OpenTelemetry Semantic Conventions. (#4746)
+- The `go.opentelemetry.io/otel/semconv/v1.23.1` package.
+ The package contains semantic conventions from the `v1.23.1` version of the OpenTelemetry Semantic Conventions. (#4749)
+- The `go.opentelemetry.io/otel/semconv/v1.24.0` package.
+ The package contains semantic conventions from the `v1.24.0` version of the OpenTelemetry Semantic Conventions. (#4770)
+- Add `WithResourceAsConstantLabels` option to apply resource attributes for every metric emitted by the Prometheus exporter. (#4733)
+- Experimental cardinality limiting is added to the metric SDK.
+ See [metric documentation](./sdk/metric/internal/x/README.md#cardinality-limit) for more information about this feature and how to enable it. (#4457)
+- Add `NewMemberRaw` and `NewKeyValuePropertyRaw` in `go.opentelemetry.io/otel/baggage`. (#4804)
+
+### Changed
+
+- Upgrade all use of `go.opentelemetry.io/otel/semconv` to use `v1.24.0`. (#4754)
+- Update transformations in `go.opentelemetry.io/otel/exporters/zipkin` to follow `v1.24.0` version of the OpenTelemetry specification. (#4754)
+- Record synchronous measurements when the passed context is canceled instead of dropping in `go.opentelemetry.io/otel/sdk/metric`.
+ If you do not want to make a measurement when the context is cancelled, you need to handle it yourself (e.g `if ctx.Err() != nil`). (#4671)
+- Improve `go.opentelemetry.io/otel/trace.TraceState`'s performance. (#4722)
+- Improve `go.opentelemetry.io/otel/propagation.TraceContext`'s performance. (#4721)
+- Improve `go.opentelemetry.io/otel/baggage` performance. (#4743)
+- Improve performance of the `(*Set).Filter` method in `go.opentelemetry.io/otel/attribute` when the passed filter does not filter out any attributes from the set. (#4774)
+- `Member.String` in `go.opentelemetry.io/otel/baggage` percent-encodes only when necessary. (#4775)
+- Improve `go.opentelemetry.io/otel/trace.Span`'s performance when adding multiple attributes. (#4818)
+- `Property.Value` in `go.opentelemetry.io/otel/baggage` now returns a raw string instead of a percent-encoded value. (#4804)
+
+### Fixed
+
+- Fix `Parse` in `go.opentelemetry.io/otel/baggage` to validate member value before percent-decoding. (#4755)
+- Fix whitespace encoding of `Member.String` in `go.opentelemetry.io/otel/baggage`. (#4756)
+- Fix observable not registered error when the asynchronous instrument has a drop aggregation in `go.opentelemetry.io/otel/sdk/metric`. (#4772)
+- Fix baggage item key so that it is not canonicalized in `go.opentelemetry.io/otel/bridge/opentracing`. (#4776)
+- Fix `go.opentelemetry.io/otel/bridge/opentracing` to properly handle baggage values that requires escaping during propagation. (#4804)
+- Fix a bug where using multiple readers resulted in incorrect asynchronous counter values in `go.opentelemetry.io/otel/sdk/metric`. (#4742)
+
## [1.21.0/0.44.0] 2023-11-16
### Removed
@@ -24,7 +445,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
## [1.20.0/0.43.0] 2023-11-10
-This release brings a breaking change for custom trace API implementations. Some interfaces (`TracerProvider`, `Tracer`, `Span`) now embed the `go.opentelemetry.io/otel/trace/embedded` types. Implementors need to update their implementations based on what they want the default behavior to be. See the "API Implementations" section of the [trace API] package documentation for more information about how to accomplish this.
+This release brings a breaking change for custom trace API implementations. Some interfaces (`TracerProvider`, `Tracer`, `Span`) now embed the `go.opentelemetry.io/otel/trace/embedded` types. Implementers need to update their implementations based on what they want the default behavior to be. See the "API Implementations" section of the [trace API] package documentation for more information about how to accomplish this.
### Added
@@ -56,15 +477,15 @@ This release brings a breaking change for custom trace API implementations. Some
- `go.opentelemetry.io/otel/bridge/opencensus.NewMetricProducer` returns a `*MetricProducer` struct instead of the metric.Producer interface. (#4583)
- The `TracerProvider` in `go.opentelemetry.io/otel/trace` now embeds the `go.opentelemetry.io/otel/trace/embedded.TracerProvider` type.
This extends the `TracerProvider` interface and is is a breaking change for any existing implementation.
- Implementors need to update their implementations based on what they want the default behavior of the interface to be.
+ Implementers need to update their implementations based on what they want the default behavior of the interface to be.
See the "API Implementations" section of the `go.opentelemetry.io/otel/trace` package documentation for more information about how to accomplish this. (#4620)
- The `Tracer` in `go.opentelemetry.io/otel/trace` now embeds the `go.opentelemetry.io/otel/trace/embedded.Tracer` type.
This extends the `Tracer` interface and is is a breaking change for any existing implementation.
- Implementors need to update their implementations based on what they want the default behavior of the interface to be.
+ Implementers need to update their implementations based on what they want the default behavior of the interface to be.
See the "API Implementations" section of the `go.opentelemetry.io/otel/trace` package documentation for more information about how to accomplish this. (#4620)
- The `Span` in `go.opentelemetry.io/otel/trace` now embeds the `go.opentelemetry.io/otel/trace/embedded.Span` type.
This extends the `Span` interface and is is a breaking change for any existing implementation.
- Implementors need to update their implementations based on what they want the default behavior of the interface to be.
+ Implementers need to update their implementations based on what they want the default behavior of the interface to be.
See the "API Implementations" section of the `go.opentelemetry.io/otel/trace` package documentation for more information about how to accomplish this. (#4620)
- `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` does no longer depend on `go.opentelemetry.io/otel/exporters/otlp/otlpmetric`. (#4660)
- `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` does no longer depend on `go.opentelemetry.io/otel/exporters/otlp/otlpmetric`. (#4660)
@@ -700,7 +1121,7 @@ The next release will require at least [Go 1.19].
- Exported `Status` codes in the `go.opentelemetry.io/otel/exporters/zipkin` exporter are now exported as all upper case values. (#3340)
- `Aggregation`s from `go.opentelemetry.io/otel/sdk/metric` with no data are not exported. (#3394, #3436)
- Re-enabled Attribute Filters in the Metric SDK. (#3396)
-- Asynchronous callbacks are only called if they are registered with at least one instrument that does not use drop aggragation. (#3408)
+- Asynchronous callbacks are only called if they are registered with at least one instrument that does not use drop aggregation. (#3408)
- Do not report empty partial-success responses in the `go.opentelemetry.io/otel/exporters/otlp` exporters. (#3438, #3432)
- Handle partial success responses in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric` exporters. (#3162, #3440)
- Prevent duplicate Prometheus description, unit, and type. (#3469)
@@ -1568,7 +1989,7 @@ with major version 0.
- Setting error status while recording error with Span from oteltest package. (#1729)
- The concept of a remote and local Span stored in a context is unified to just the current Span.
Because of this `"go.opentelemetry.io/otel/trace".RemoteSpanContextFromContext` is removed as it is no longer needed.
- Instead, `"go.opentelemetry.io/otel/trace".SpanContextFromContex` can be used to return the current Span.
+ Instead, `"go.opentelemetry.io/otel/trace".SpanContextFromContext` can be used to return the current Span.
If needed, that Span's `SpanContext.IsRemote()` can then be used to determine if it is remote or not. (#1731)
- The `HasRemoteParent` field of the `"go.opentelemetry.io/otel/sdk/trace".SamplingParameters` is removed.
This field is redundant to the information returned from the `Remote` method of the `SpanContext` held in the `ParentContext` field. (#1749)
@@ -1745,7 +2166,7 @@ with major version 0.
- `NewExporter` from `exporters/otlp` now takes a `ProtocolDriver` as a parameter. (#1369)
- Many OTLP Exporter options became gRPC ProtocolDriver options. (#1369)
- Unify endpoint API that related to OTel exporter. (#1401)
-- Optimize metric histogram aggregator to re-use its slice of buckets. (#1435)
+- Optimize metric histogram aggregator to reuse its slice of buckets. (#1435)
- Metric aggregator Count() and histogram Bucket.Counts are consistently `uint64`. (1430)
- Histogram aggregator accepts functional options, uses default boundaries if none given. (#1434)
- `SamplingResult` now passed a `Tracestate` from the parent `SpanContext` (#1432)
@@ -2142,7 +2563,7 @@ This release migrates the default OpenTelemetry SDK into its own Go module, deco
- Prometheus exporter will not apply stale updates or forget inactive metrics. (#903)
- Add test for api.standard `HTTPClientAttributesFromHTTPRequest`. (#905)
- Bump github.com/golangci/golangci-lint from 1.27.0 to 1.28.1 in /tools. (#901, #913)
-- Update otel-colector example to use the v0.5.0 collector. (#915)
+- Update otel-collector example to use the v0.5.0 collector. (#915)
- The `grpctrace` instrumentation uses a span name conforming to the OpenTelemetry semantic conventions (does not contain a leading slash (`/`)). (#922)
- The `grpctrace` instrumentation includes an `rpc.method` attribute now set to the gRPC method name. (#900, #922)
- The `grpctrace` instrumentation `rpc.service` attribute now contains the package name if one exists.
@@ -2735,7 +3156,20 @@ It contains api and sdk for trace and meter.
- CircleCI build CI manifest files.
- CODEOWNERS file to track owners of this project.
-[Unreleased]: https://github.com/open-telemetry/opentelemetry-go/compare/v1.21.0...HEAD
+[Unreleased]: https://github.com/open-telemetry/opentelemetry-go/compare/v1.32.0...HEAD
+[1.32.0/0.54.0/0.8.0/0.0.11]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.32.0
+[1.31.0/0.53.0/0.7.0/0.0.10]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.31.0
+[1.30.0/0.52.0/0.6.0/0.0.9]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.30.0
+[1.29.0/0.51.0/0.5.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.29.0
+[1.28.0/0.50.0/0.4.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.28.0
+[1.27.0/0.49.0/0.3.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.27.0
+[1.26.0/0.48.0/0.2.0-alpha]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.26.0
+[1.25.0/0.47.0/0.0.8/0.1.0-alpha]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.25.0
+[1.24.0/0.46.0/0.0.1-alpha]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.24.0
+[1.23.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.23.1
+[1.23.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.23.0
+[1.23.0-rc.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.23.0-rc.1
+[1.22.0/0.45.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.22.0
[1.21.0/0.44.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.21.0
[1.20.0/0.43.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.20.0
[1.19.0/0.42.0/0.0.7]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.19.0
@@ -2809,6 +3243,11 @@ It contains api and sdk for trace and meter.
[0.1.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.1.1
[0.1.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v0.1.0
+
+
+[Go 1.23]: https://go.dev/doc/go1.23
+[Go 1.22]: https://go.dev/doc/go1.22
+[Go 1.21]: https://go.dev/doc/go1.21
[Go 1.20]: https://go.dev/doc/go1.20
[Go 1.19]: https://go.dev/doc/go1.19
[Go 1.18]: https://go.dev/doc/go1.18
@@ -2816,3 +3255,5 @@ It contains api and sdk for trace and meter.
[metric API]:https://pkg.go.dev/go.opentelemetry.io/otel/metric
[metric SDK]:https://pkg.go.dev/go.opentelemetry.io/otel/sdk/metric
[trace API]:https://pkg.go.dev/go.opentelemetry.io/otel/trace
+
+[GO-2024-2687]: https://pkg.go.dev/vuln/GO-2024-2687
diff --git a/vendor/go.opentelemetry.io/otel/CODEOWNERS b/vendor/go.opentelemetry.io/otel/CODEOWNERS
index 62374000..945a07d2 100644
--- a/vendor/go.opentelemetry.io/otel/CODEOWNERS
+++ b/vendor/go.opentelemetry.io/otel/CODEOWNERS
@@ -5,13 +5,13 @@
#####################################################
#
# Learn about membership in OpenTelemetry community:
-# https://github.com/open-telemetry/community/blob/main/community-membership.md
+# https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md
#
#
# Learn about CODEOWNERS file format:
# https://help.github.com/en/articles/about-code-owners
#
-* @MrAlias @Aneurysm9 @evantorrie @XSAM @dashpole @MadVikingGod @pellared @hanyuancheung @dmathieu
+* @MrAlias @XSAM @dashpole @pellared @dmathieu
-CODEOWNERS @MrAlias @MadVikingGod @pellared
\ No newline at end of file
+CODEOWNERS @MrAlias @pellared @dashpole @XSAM @dmathieu
diff --git a/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md b/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md
index 850606ae..22a2e9db 100644
--- a/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md
+++ b/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md
@@ -201,6 +201,16 @@ You can install and run a "local Go Doc site" in the following way:
[`go.opentelemetry.io/otel/metric`](https://pkg.go.dev/go.opentelemetry.io/otel/metric)
is an example of a very well-documented package.
+### README files
+
+Each (non-internal, non-test, non-documentation) package must contain a
+`README.md` file containing at least a title, and a `pkg.go.dev` badge.
+
+The README should not be a repetition of Go doc comments.
+
+You can verify the presence of all README files with the `make verify-readmes`
+command.
+
## Style Guide
One of the primary goals of this project is that it is actually used by
@@ -560,12 +570,18 @@ functionality should be added, each one will need their own super-set
interfaces and will duplicate the pattern. For this reason, the simple targeted
interface that defines the specific functionality should be preferred.
+See also:
+[Keeping Your Modules Compatible: Working with interfaces](https://go.dev/blog/module-compatibility#working-with-interfaces).
+
### Testing
The tests should never leak goroutines.
Use the term `ConcurrentSafe` in the test name when it aims to verify the
-absence of race conditions.
+absence of race conditions. The top-level tests with this term will be run
+many times in the `test-concurrent-safe` CI job to increase the chance of
+catching concurrency issues. This does not apply to subtests when this term
+is not in their root name.
### Internal packages
@@ -591,32 +607,56 @@ this.
[^3]: https://github.com/open-telemetry/opentelemetry-go/issues/3548
+### Ignoring context cancellation
+
+OpenTelemetry API implementations need to ignore the cancellation of the context that are
+passed when recording a value (e.g. starting a span, recording a measurement, emitting a log).
+Recording methods should not return an error describing the cancellation state of the context
+when they complete, nor should they abort any work.
+
+This rule may not apply if the OpenTelemetry specification defines a timeout mechanism for
+the method. In that case the context cancellation can be used for the timeout with the
+restriction that this behavior is documented for the method. Otherwise, timeouts
+are expected to be handled by the user calling the API, not the implementation.
+
+Stoppage of the telemetry pipeline is handled by calling the appropriate `Shutdown` method
+of a provider. It is assumed the context passed from a user is not used for this purpose.
+
+Outside of the direct recording of telemetry from the API (e.g. exporting telemetry,
+force flushing telemetry, shutting down a signal provider) the context cancellation
+should be honored. This means all work done on behalf of the user provided context
+should be canceled.
+
## Approvers and Maintainers
-### Approvers
+### Triagers
-- [Evan Torrie](https://github.com/evantorrie), Verizon Media
-- [Sam Xie](https://github.com/XSAM), Cisco/AppDynamics
-- [David Ashpole](https://github.com/dashpole), Google
-- [Chester Cheung](https://github.com/hanyuancheung), Tencent
-- [Damien Mathieu](https://github.com/dmathieu), Elastic
-- [Anthony Mirabella](https://github.com/Aneurysm9), AWS
+- [Cheng-Zhen Yang](https://github.com/scorpionknifes), Independent
+
+### Approvers
### Maintainers
-- [Aaron Clawson](https://github.com/MadVikingGod), LightStep
+- [Damien Mathieu](https://github.com/dmathieu), Elastic
+- [David Ashpole](https://github.com/dashpole), Google
- [Robert Pająk](https://github.com/pellared), Splunk
+- [Sam Xie](https://github.com/XSAM), Cisco/AppDynamics
- [Tyler Yahn](https://github.com/MrAlias), Splunk
### Emeritus
-- [Gustavo Silva Paiva](https://github.com/paivagustavo), LightStep
-- [Josh MacDonald](https://github.com/jmacd), LightStep
+- [Aaron Clawson](https://github.com/MadVikingGod)
+- [Anthony Mirabella](https://github.com/Aneurysm9)
+- [Chester Cheung](https://github.com/hanyuancheung)
+- [Evan Torrie](https://github.com/evantorrie)
+- [Gustavo Silva Paiva](https://github.com/paivagustavo)
+- [Josh MacDonald](https://github.com/jmacd)
+- [Liz Fong-Jones](https://github.com/lizthegrey)
### Become an Approver or a Maintainer
See the [community membership document in OpenTelemetry community
-repo](https://github.com/open-telemetry/community/blob/main/community-membership.md).
+repo](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md).
[Approver]: #approvers
[Maintainer]: #maintainers
diff --git a/vendor/go.opentelemetry.io/otel/Makefile b/vendor/go.opentelemetry.io/otel/Makefile
index 35fc1899..b8292a4f 100644
--- a/vendor/go.opentelemetry.io/otel/Makefile
+++ b/vendor/go.opentelemetry.io/otel/Makefile
@@ -1,16 +1,5 @@
# Copyright The OpenTelemetry 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.
+# SPDX-License-Identifier: Apache-2.0
TOOLS_MOD_DIR := ./internal/tools
@@ -25,8 +14,8 @@ TIMEOUT = 60
.DEFAULT_GOAL := precommit
.PHONY: precommit ci
-precommit: generate dependabot-generate license-check misspell go-mod-tidy golangci-lint-fix test-default
-ci: generate dependabot-check license-check lint vanity-import-check build test-default check-clean-work-tree test-coverage
+precommit: generate license-check misspell go-mod-tidy golangci-lint-fix verify-readmes verify-mods test-default
+ci: generate license-check lint vanity-import-check verify-readmes verify-mods build test-default check-clean-work-tree test-coverage
# Tools
@@ -34,7 +23,7 @@ TOOLS = $(CURDIR)/.tools
$(TOOLS):
@mkdir -p $@
-$(TOOLS)/%: | $(TOOLS)
+$(TOOLS)/%: $(TOOLS_MOD_DIR)/go.mod | $(TOOLS)
cd $(TOOLS_MOD_DIR) && \
$(GO) build -o $@ $(PACKAGE)
@@ -50,9 +39,6 @@ $(TOOLS)/crosslink: PACKAGE=go.opentelemetry.io/build-tools/crosslink
SEMCONVKIT = $(TOOLS)/semconvkit
$(TOOLS)/semconvkit: PACKAGE=go.opentelemetry.io/otel/$(TOOLS_MOD_DIR)/semconvkit
-DBOTCONF = $(TOOLS)/dbotconf
-$(TOOLS)/dbotconf: PACKAGE=go.opentelemetry.io/build-tools/dbotconf
-
GOLANGCI_LINT = $(TOOLS)/golangci-lint
$(TOOLS)/golangci-lint: PACKAGE=github.com/golangci/golangci-lint/cmd/golangci-lint
@@ -68,9 +54,6 @@ $(TOOLS)/stringer: PACKAGE=golang.org/x/tools/cmd/stringer
PORTO = $(TOOLS)/porto
$(TOOLS)/porto: PACKAGE=github.com/jcchavezs/porto/cmd/porto
-GOJQ = $(TOOLS)/gojq
-$(TOOLS)/gojq: PACKAGE=github.com/itchyny/gojq/cmd/gojq
-
GOTMPL = $(TOOLS)/gotmpl
$(GOTMPL): PACKAGE=go.opentelemetry.io/build-tools/gotmpl
@@ -81,7 +64,7 @@ GOVULNCHECK = $(TOOLS)/govulncheck
$(TOOLS)/govulncheck: PACKAGE=golang.org/x/vuln/cmd/govulncheck
.PHONY: tools
-tools: $(CROSSLINK) $(DBOTCONF) $(GOLANGCI_LINT) $(MISSPELL) $(GOCOVMERGE) $(STRINGER) $(PORTO) $(GOJQ) $(SEMCONVGEN) $(MULTIMOD) $(SEMCONVKIT) $(GOTMPL) $(GORELEASE)
+tools: $(CROSSLINK) $(GOLANGCI_LINT) $(MISSPELL) $(GOCOVMERGE) $(STRINGER) $(PORTO) $(SEMCONVGEN) $(MULTIMOD) $(SEMCONVKIT) $(GOTMPL) $(GORELEASE)
# Virtualized python tools via docker
@@ -110,7 +93,7 @@ $(PYTOOLS):
@$(DOCKERPY) bash -c "python3 -m venv $(VENVDIR) && $(PIP) install --upgrade pip"
# Install python packages into the virtual environment.
-$(PYTOOLS)/%: | $(PYTOOLS)
+$(PYTOOLS)/%: $(PYTOOLS)
@$(DOCKERPY) $(PIP) install -r requirements.txt
CODESPELL = $(PYTOOLS)/codespell
@@ -124,18 +107,18 @@ generate: go-generate vanity-import-fix
.PHONY: go-generate
go-generate: $(OTEL_GO_MOD_DIRS:%=go-generate/%)
go-generate/%: DIR=$*
-go-generate/%: | $(STRINGER) $(GOTMPL)
+go-generate/%: $(STRINGER) $(GOTMPL)
@echo "$(GO) generate $(DIR)/..." \
&& cd $(DIR) \
&& PATH="$(TOOLS):$${PATH}" $(GO) generate ./...
.PHONY: vanity-import-fix
-vanity-import-fix: | $(PORTO)
+vanity-import-fix: $(PORTO)
@$(PORTO) --include-internal -w .
# Generate go.work file for local development.
.PHONY: go-work
-go-work: | $(CROSSLINK)
+go-work: $(CROSSLINK)
$(CROSSLINK) work --root=$(shell pwd)
# Build
@@ -159,12 +142,14 @@ build-tests/%:
# Tests
-TEST_TARGETS := test-default test-bench test-short test-verbose test-race
+TEST_TARGETS := test-default test-bench test-short test-verbose test-race test-concurrent-safe
.PHONY: $(TEST_TARGETS) test
test-default test-race: ARGS=-race
test-bench: ARGS=-run=xxxxxMatchNothingxxxxx -test.benchtime=1ms -bench=.
test-short: ARGS=-short
test-verbose: ARGS=-v -race
+test-concurrent-safe: ARGS=-run=ConcurrentSafe -count=100 -race
+test-concurrent-safe: TIMEOUT=120
$(TEST_TARGETS): test
test: $(OTEL_GO_MOD_DIRS:%=test/%)
test/%: DIR=$*
@@ -178,7 +163,7 @@ test/%:
COVERAGE_MODE = atomic
COVERAGE_PROFILE = coverage.out
.PHONY: test-coverage
-test-coverage: | $(GOCOVMERGE)
+test-coverage: $(GOCOVMERGE)
@set -e; \
printf "" > coverage.txt; \
for dir in $(ALL_COVERAGE_MOD_DIRS); do \
@@ -192,40 +177,37 @@ test-coverage: | $(GOCOVMERGE)
done; \
$(GOCOVMERGE) $$(find . -name coverage.out) > coverage.txt
-# Adding a directory will include all benchmarks in that direcotry if a filter is not specified.
-BENCHMARK_TARGETS := sdk/trace
.PHONY: benchmark
-benchmark: $(BENCHMARK_TARGETS:%=benchmark/%)
-BENCHMARK_FILTER = .
-# You can override the filter for a particular directory by adding a rule here.
-benchmark/sdk/trace: BENCHMARK_FILTER = SpanWithAttributes_8/AlwaysSample
+benchmark: $(OTEL_GO_MOD_DIRS:%=benchmark/%)
benchmark/%:
- @echo "$(GO) test -timeout $(TIMEOUT)s -run=xxxxxMatchNothingxxxxx -bench=$(BENCHMARK_FILTER) $*..." \
+ @echo "$(GO) test -run=xxxxxMatchNothingxxxxx -bench=. $*..." \
&& cd $* \
- $(foreach filter, $(BENCHMARK_FILTER), && $(GO) test -timeout $(TIMEOUT)s -run=xxxxxMatchNothingxxxxx -bench=$(filter))
+ && $(GO) list ./... \
+ | grep -v third_party \
+ | xargs $(GO) test -run=xxxxxMatchNothingxxxxx -bench=.
.PHONY: golangci-lint golangci-lint-fix
golangci-lint-fix: ARGS=--fix
golangci-lint-fix: golangci-lint
golangci-lint: $(OTEL_GO_MOD_DIRS:%=golangci-lint/%)
golangci-lint/%: DIR=$*
-golangci-lint/%: | $(GOLANGCI_LINT)
+golangci-lint/%: $(GOLANGCI_LINT)
@echo 'golangci-lint $(if $(ARGS),$(ARGS) ,)$(DIR)' \
&& cd $(DIR) \
&& $(GOLANGCI_LINT) run --allow-serial-runners $(ARGS)
.PHONY: crosslink
-crosslink: | $(CROSSLINK)
+crosslink: $(CROSSLINK)
@echo "Updating intra-repository dependencies in all go modules" \
&& $(CROSSLINK) --root=$(shell pwd) --prune
.PHONY: go-mod-tidy
go-mod-tidy: $(ALL_GO_MOD_DIRS:%=go-mod-tidy/%)
go-mod-tidy/%: DIR=$*
-go-mod-tidy/%: | crosslink
+go-mod-tidy/%: crosslink
@echo "$(GO) mod tidy in $(DIR)" \
&& cd $(DIR) \
- && $(GO) mod tidy -compat=1.20
+ && $(GO) mod tidy -compat=1.21
.PHONY: lint-modules
lint-modules: go-mod-tidy
@@ -234,23 +216,23 @@ lint-modules: go-mod-tidy
lint: misspell lint-modules golangci-lint govulncheck
.PHONY: vanity-import-check
-vanity-import-check: | $(PORTO)
+vanity-import-check: $(PORTO)
@$(PORTO) --include-internal -l . || ( echo "(run: make vanity-import-fix)"; exit 1 )
.PHONY: misspell
-misspell: | $(MISSPELL)
+misspell: $(MISSPELL)
@$(MISSPELL) -w $(ALL_DOCS)
.PHONY: govulncheck
govulncheck: $(OTEL_GO_MOD_DIRS:%=govulncheck/%)
govulncheck/%: DIR=$*
-govulncheck/%: | $(GOVULNCHECK)
+govulncheck/%: $(GOVULNCHECK)
@echo "govulncheck ./... in $(DIR)" \
&& cd $(DIR) \
&& $(GOVULNCHECK) ./...
.PHONY: codespell
-codespell: | $(CODESPELL)
+codespell: $(CODESPELL)
@$(DOCKERPY) $(CODESPELL)
.PHONY: license-check
@@ -263,15 +245,6 @@ license-check:
exit 1; \
fi
-DEPENDABOT_CONFIG = .github/dependabot.yml
-.PHONY: dependabot-check
-dependabot-check: | $(DBOTCONF)
- @$(DBOTCONF) verify $(DEPENDABOT_CONFIG) || ( echo "(run: make dependabot-generate)"; exit 1 )
-
-.PHONY: dependabot-generate
-dependabot-generate: | $(DBOTCONF)
- @$(DBOTCONF) generate > $(DEPENDABOT_CONFIG)
-
.PHONY: check-clean-work-tree
check-clean-work-tree:
@if ! git diff --quiet; then \
@@ -284,13 +257,11 @@ check-clean-work-tree:
SEMCONVPKG ?= "semconv/"
.PHONY: semconv-generate
-semconv-generate: | $(SEMCONVGEN) $(SEMCONVKIT)
+semconv-generate: $(SEMCONVGEN) $(SEMCONVKIT)
[ "$(TAG)" ] || ( echo "TAG unset: missing opentelemetry semantic-conventions tag"; exit 1 )
[ "$(OTEL_SEMCONV_REPO)" ] || ( echo "OTEL_SEMCONV_REPO unset: missing path to opentelemetry semantic-conventions repo"; exit 1 )
- $(SEMCONVGEN) -i "$(OTEL_SEMCONV_REPO)/model/." --only=span -p conventionType=trace -f trace.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)"
- $(SEMCONVGEN) -i "$(OTEL_SEMCONV_REPO)/model/." --only=attribute_group -p conventionType=trace -f attribute_group.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)"
- $(SEMCONVGEN) -i "$(OTEL_SEMCONV_REPO)/model/." --only=event -p conventionType=event -f event.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)"
- $(SEMCONVGEN) -i "$(OTEL_SEMCONV_REPO)/model/." --only=resource -p conventionType=resource -f resource.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)"
+ $(SEMCONVGEN) -i "$(OTEL_SEMCONV_REPO)/model/." --only=attribute_group -p conventionType=trace -f attribute_group.go -z "$(SEMCONVPKG)/capitalizations.txt" -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)"
+ $(SEMCONVGEN) -i "$(OTEL_SEMCONV_REPO)/model/." --only=metric -f metric.go -t "$(SEMCONVPKG)/metric_template.j2" -s "$(TAG)"
$(SEMCONVKIT) -output "$(SEMCONVPKG)/$(TAG)" -tag "$(TAG)"
.PHONY: gorelease
@@ -302,17 +273,25 @@ gorelease/%:| $(GORELEASE)
&& $(GORELEASE) \
|| echo ""
+.PHONY: verify-mods
+verify-mods: $(MULTIMOD)
+ $(MULTIMOD) verify
+
.PHONY: prerelease
-prerelease: | $(MULTIMOD)
+prerelease: verify-mods
@[ "${MODSET}" ] || ( echo ">> env var MODSET is not set"; exit 1 )
- $(MULTIMOD) verify && $(MULTIMOD) prerelease -m ${MODSET}
+ $(MULTIMOD) prerelease -m ${MODSET}
COMMIT ?= "HEAD"
.PHONY: add-tags
-add-tags: | $(MULTIMOD)
+add-tags: verify-mods
@[ "${MODSET}" ] || ( echo ">> env var MODSET is not set"; exit 1 )
- $(MULTIMOD) verify && $(MULTIMOD) tag -m ${MODSET} -c ${COMMIT}
+ $(MULTIMOD) tag -m ${MODSET} -c ${COMMIT}
.PHONY: lint-markdown
-lint-markdown:
- docker run -v "$(CURDIR):$(WORKDIR)" docker://avtodev/markdown-lint:v1 -c $(WORKDIR)/.markdownlint.yaml $(WORKDIR)/**/*.md
+lint-markdown:
+ docker run -v "$(CURDIR):$(WORKDIR)" avtodev/markdown-lint:v1 -c $(WORKDIR)/.markdownlint.yaml $(WORKDIR)/**/*.md
+
+.PHONY: verify-readmes
+verify-readmes:
+ ./verify_readmes.sh
diff --git a/vendor/go.opentelemetry.io/otel/README.md b/vendor/go.opentelemetry.io/otel/README.md
index 2c5b0cc2..efec2789 100644
--- a/vendor/go.opentelemetry.io/otel/README.md
+++ b/vendor/go.opentelemetry.io/otel/README.md
@@ -11,14 +11,11 @@ It provides a set of APIs to directly measure performance and behavior of your s
## Project Status
-| Signal | Status |
-|---------|------------|
-| Traces | Stable |
-| Metrics | Stable |
-| Logs | Design [1] |
-
-- [1]: Currently the logs signal development is in a design phase ([#4696](https://github.com/open-telemetry/opentelemetry-go/issues/4696)).
- No Logs Pull Requests are currently being accepted.
+| Signal | Status |
+|---------|--------------------|
+| Traces | Stable |
+| Metrics | Stable |
+| Logs | Beta[^1] |
Progress and status specific to this repository is tracked in our
[project boards](https://github.com/open-telemetry/opentelemetry-go/projects)
@@ -28,6 +25,8 @@ and
Project versioning information and stability guarantees can be found in the
[versioning documentation](VERSIONING.md).
+[^1]: https://github.com/orgs/open-telemetry/projects/43
+
### Compatibility
OpenTelemetry-Go ensures compatibility with the current supported versions of
@@ -48,25 +47,29 @@ stop ensuring compatibility with these versions in the following manner:
Currently, this project supports the following environments.
-| OS | Go Version | Architecture |
-|---------|------------|--------------|
-| Ubuntu | 1.21 | amd64 |
-| Ubuntu | 1.20 | amd64 |
-| Ubuntu | 1.21 | 386 |
-| Ubuntu | 1.20 | 386 |
-| MacOS | 1.21 | amd64 |
-| MacOS | 1.20 | amd64 |
-| Windows | 1.21 | amd64 |
-| Windows | 1.20 | amd64 |
-| Windows | 1.21 | 386 |
-| Windows | 1.20 | 386 |
+| OS | Go Version | Architecture |
+|----------|------------|--------------|
+| Ubuntu | 1.23 | amd64 |
+| Ubuntu | 1.22 | amd64 |
+| Ubuntu | 1.23 | 386 |
+| Ubuntu | 1.22 | 386 |
+| Linux | 1.23 | arm64 |
+| Linux | 1.22 | arm64 |
+| macOS 13 | 1.23 | amd64 |
+| macOS 13 | 1.22 | amd64 |
+| macOS | 1.23 | arm64 |
+| macOS | 1.22 | arm64 |
+| Windows | 1.23 | amd64 |
+| Windows | 1.22 | amd64 |
+| Windows | 1.23 | 386 |
+| Windows | 1.22 | 386 |
While this project should work for other systems, no compatibility guarantees
are made for those systems currently.
## Getting Started
-You can find a getting started guide on [opentelemetry.io](https://opentelemetry.io/docs/go/getting-started/).
+You can find a getting started guide on [opentelemetry.io](https://opentelemetry.io/docs/languages/go/getting-started/).
OpenTelemetry's goal is to provide a single set of APIs to capture distributed
traces and metrics from your application and send them to an observability
@@ -86,8 +89,8 @@ If you need to extend the telemetry an instrumentation library provides or want
to build your own instrumentation for your application directly you will need
to use the
[Go otel](https://pkg.go.dev/go.opentelemetry.io/otel)
-package. The included [examples](./example/) are a good way to see some
-practical uses of this process.
+package. The [examples](https://github.com/open-telemetry/opentelemetry-go-contrib/tree/main/examples)
+are a good way to see some practical uses of this process.
### Export
@@ -96,12 +99,12 @@ export pipeline to send that telemetry to an observability platform.
All officially supported exporters for the OpenTelemetry project are contained in the [exporters directory](./exporters).
-| Exporter | Metrics | Traces |
-|---------------------------------------|:-------:|:------:|
-| [OTLP](./exporters/otlp/) | ✓ | ✓ |
-| [Prometheus](./exporters/prometheus/) | ✓ | |
-| [stdout](./exporters/stdout/) | ✓ | ✓ |
-| [Zipkin](./exporters/zipkin/) | | ✓ |
+| Exporter | Logs | Metrics | Traces |
+|---------------------------------------|:----:|:-------:|:------:|
+| [OTLP](./exporters/otlp/) | ✓ | ✓ | ✓ |
+| [Prometheus](./exporters/prometheus/) | | ✓ | |
+| [stdout](./exporters/stdout/) | ✓ | ✓ | ✓ |
+| [Zipkin](./exporters/zipkin/) | | | ✓ |
## Contributing
diff --git a/vendor/go.opentelemetry.io/otel/RELEASING.md b/vendor/go.opentelemetry.io/otel/RELEASING.md
index 82ce3ee4..ffa9b612 100644
--- a/vendor/go.opentelemetry.io/otel/RELEASING.md
+++ b/vendor/go.opentelemetry.io/otel/RELEASING.md
@@ -27,6 +27,12 @@ You can run `make gorelease` that runs [gorelease](https://pkg.go.dev/golang.org
You can check/report problems with `gorelease` [here](https://golang.org/issues/26420).
+## Verify changes for contrib repository
+
+If the changes in the main repository are going to affect the contrib repository, it is important to verify that the changes are compatible with the contrib repository.
+
+Follow [the steps](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/RELEASING.md#verify-otel-changes) in the contrib repository to verify OTel changes.
+
## Pre-Release
First, decide which module sets will be released and update their versions
@@ -63,6 +69,7 @@ Update go.mod for submodules to depend on the new release which will happen in t
```
- Move all the `Unreleased` changes into a new section following the title scheme (`[] - `).
+ - Make sure the new section is under the comment for released section, like ``, so it is protected from being overwritten in the future.
- Update all the appropriate links at the bottom.
4. Push the changes to upstream and create a Pull Request on GitHub.
@@ -104,17 +111,6 @@ It is critical you make sure the version you push upstream is correct.
Finally create a Release for the new `` on GitHub.
The release body should include all the release notes from the Changelog for this release.
-## Verify Examples
-
-After releasing verify that examples build outside of the repository.
-
-```
-./verify_examples.sh
-```
-
-The script copies examples into a different directory removes any `replace` declarations in `go.mod` and builds them.
-This ensures they build with the published release, not the local copy.
-
## Post-Release
### Contrib Repository
@@ -123,12 +119,12 @@ Once verified be sure to [make a release for the `contrib` repository](https://g
### Website Documentation
-Update the [Go instrumentation documentation] in the OpenTelemetry website under [content/en/docs/instrumentation/go].
+Update the [Go instrumentation documentation] in the OpenTelemetry website under [content/en/docs/languages/go].
Importantly, bump any package versions referenced to be the latest one you just released and ensure all code examples still compile and are accurate.
[OpenTelemetry Semantic Conventions]: https://github.com/open-telemetry/semantic-conventions
-[Go instrumentation documentation]: https://opentelemetry.io/docs/instrumentation/go/
-[content/en/docs/instrumentation/go]: https://github.com/open-telemetry/opentelemetry.io/tree/main/content/en/docs/instrumentation/go
+[Go instrumentation documentation]: https://opentelemetry.io/docs/languages/go/
+[content/en/docs/languages/go]: https://github.com/open-telemetry/opentelemetry.io/tree/main/content/en/docs/languages/go
### Demo Repository
diff --git a/vendor/go.opentelemetry.io/otel/attribute/README.md b/vendor/go.opentelemetry.io/otel/attribute/README.md
new file mode 100644
index 00000000..5b3da8f1
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/attribute/README.md
@@ -0,0 +1,3 @@
+# Attribute
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/attribute)](https://pkg.go.dev/go.opentelemetry.io/otel/attribute)
diff --git a/vendor/go.opentelemetry.io/otel/attribute/doc.go b/vendor/go.opentelemetry.io/otel/attribute/doc.go
index dafe7424..eef51ebc 100644
--- a/vendor/go.opentelemetry.io/otel/attribute/doc.go
+++ b/vendor/go.opentelemetry.io/otel/attribute/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
// Package attribute provides key and value attributes.
package attribute // import "go.opentelemetry.io/otel/attribute"
diff --git a/vendor/go.opentelemetry.io/otel/attribute/encoder.go b/vendor/go.opentelemetry.io/otel/attribute/encoder.go
index fe2bc576..318e42fc 100644
--- a/vendor/go.opentelemetry.io/otel/attribute/encoder.go
+++ b/vendor/go.opentelemetry.io/otel/attribute/encoder.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package attribute // import "go.opentelemetry.io/otel/attribute"
diff --git a/vendor/go.opentelemetry.io/otel/attribute/filter.go b/vendor/go.opentelemetry.io/otel/attribute/filter.go
index 638c213d..be9cd922 100644
--- a/vendor/go.opentelemetry.io/otel/attribute/filter.go
+++ b/vendor/go.opentelemetry.io/otel/attribute/filter.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package attribute // import "go.opentelemetry.io/otel/attribute"
diff --git a/vendor/go.opentelemetry.io/otel/attribute/iterator.go b/vendor/go.opentelemetry.io/otel/attribute/iterator.go
index 841b271f..f2ba89ce 100644
--- a/vendor/go.opentelemetry.io/otel/attribute/iterator.go
+++ b/vendor/go.opentelemetry.io/otel/attribute/iterator.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package attribute // import "go.opentelemetry.io/otel/attribute"
diff --git a/vendor/go.opentelemetry.io/otel/attribute/key.go b/vendor/go.opentelemetry.io/otel/attribute/key.go
index 0656a04e..d9a22c65 100644
--- a/vendor/go.opentelemetry.io/otel/attribute/key.go
+++ b/vendor/go.opentelemetry.io/otel/attribute/key.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package attribute // import "go.opentelemetry.io/otel/attribute"
diff --git a/vendor/go.opentelemetry.io/otel/attribute/kv.go b/vendor/go.opentelemetry.io/otel/attribute/kv.go
index 1ddf3ce0..3028f9a4 100644
--- a/vendor/go.opentelemetry.io/otel/attribute/kv.go
+++ b/vendor/go.opentelemetry.io/otel/attribute/kv.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package attribute // import "go.opentelemetry.io/otel/attribute"
diff --git a/vendor/go.opentelemetry.io/otel/attribute/set.go b/vendor/go.opentelemetry.io/otel/attribute/set.go
index 9f9303d4..6cbefcea 100644
--- a/vendor/go.opentelemetry.io/otel/attribute/set.go
+++ b/vendor/go.opentelemetry.io/otel/attribute/set.go
@@ -1,24 +1,14 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package attribute // import "go.opentelemetry.io/otel/attribute"
import (
+ "cmp"
"encoding/json"
"reflect"
+ "slices"
"sort"
- "sync"
)
type (
@@ -26,23 +16,33 @@ type (
// immutable set of attributes, with an internal cache for storing
// attribute encodings.
//
- // This type supports the Equivalent method of comparison using values of
- // type Distinct.
+ // This type will remain comparable for backwards compatibility. The
+ // equivalence of Sets across versions is not guaranteed to be stable.
+ // Prior versions may find two Sets to be equal or not when compared
+ // directly (i.e. ==), but subsequent versions may not. Users should use
+ // the Equals method to ensure stable equivalence checking.
+ //
+ // Users should also use the Distinct returned from Equivalent as a map key
+ // instead of a Set directly. In addition to that type providing guarantees
+ // on stable equivalence, it may also provide performance improvements.
Set struct {
equivalent Distinct
}
- // Distinct wraps a variable-size array of KeyValue, constructed with keys
- // in sorted order. This can be used as a map key or for equality checking
- // between Sets.
+ // Distinct is a unique identifier of a Set.
+ //
+ // Distinct is designed to be ensures equivalence stability: comparisons
+ // will return the save value across versions. For this reason, Distinct
+ // should always be used as a map key instead of a Set.
Distinct struct {
iface interface{}
}
- // Sortable implements sort.Interface, used for sorting KeyValue. This is
- // an exported type to support a memory optimization. A pointer to one of
- // these is needed for the call to sort.Stable(), which the caller may
- // provide in order to avoid an allocation. See NewSetWithSortable().
+ // Sortable implements sort.Interface, used for sorting KeyValue.
+ //
+ // Deprecated: This type is no longer used. It was added as a performance
+ // optimization for Go < 1.21 that is no longer needed (Go < 1.21 is no
+ // longer supported by the module).
Sortable []KeyValue
)
@@ -56,12 +56,6 @@ var (
iface: [0]KeyValue{},
},
}
-
- // sortables is a pool of Sortables used to create Sets with a user does
- // not provide one.
- sortables = sync.Pool{
- New: func() interface{} { return new(Sortable) },
- }
)
// EmptySet returns a reference to a Set with no elements.
@@ -187,13 +181,7 @@ func empty() Set {
// Except for empty sets, this method adds an additional allocation compared
// with calls that include a Sortable.
func NewSet(kvs ...KeyValue) Set {
- // Check for empty set.
- if len(kvs) == 0 {
- return empty()
- }
- srt := sortables.Get().(*Sortable)
- s, _ := NewSetWithSortableFiltered(kvs, srt, nil)
- sortables.Put(srt)
+ s, _ := NewSetWithFiltered(kvs, nil)
return s
}
@@ -201,12 +189,10 @@ func NewSet(kvs ...KeyValue) Set {
// NewSetWithSortableFiltered for more details.
//
// This call includes a Sortable option as a memory optimization.
-func NewSetWithSortable(kvs []KeyValue, tmp *Sortable) Set {
- // Check for empty set.
- if len(kvs) == 0 {
- return empty()
- }
- s, _ := NewSetWithSortableFiltered(kvs, tmp, nil)
+//
+// Deprecated: Use [NewSet] instead.
+func NewSetWithSortable(kvs []KeyValue, _ *Sortable) Set {
+ s, _ := NewSetWithFiltered(kvs, nil)
return s
}
@@ -220,10 +206,37 @@ func NewSetWithFiltered(kvs []KeyValue, filter Filter) (Set, []KeyValue) {
if len(kvs) == 0 {
return empty(), nil
}
- srt := sortables.Get().(*Sortable)
- s, filtered := NewSetWithSortableFiltered(kvs, srt, filter)
- sortables.Put(srt)
- return s, filtered
+
+ // Stable sort so the following de-duplication can implement
+ // last-value-wins semantics.
+ slices.SortStableFunc(kvs, func(a, b KeyValue) int {
+ return cmp.Compare(a.Key, b.Key)
+ })
+
+ position := len(kvs) - 1
+ offset := position - 1
+
+ // The requirements stated above require that the stable
+ // result be placed in the end of the input slice, while
+ // overwritten values are swapped to the beginning.
+ //
+ // De-duplicate with last-value-wins semantics. Preserve
+ // duplicate values at the beginning of the input slice.
+ for ; offset >= 0; offset-- {
+ if kvs[offset].Key == kvs[position].Key {
+ continue
+ }
+ position--
+ kvs[offset], kvs[position] = kvs[position], kvs[offset]
+ }
+ kvs = kvs[position:]
+
+ if filter != nil {
+ if div := filteredToFront(kvs, filter); div != 0 {
+ return Set{equivalent: computeDistinct(kvs[div:])}, kvs[:div]
+ }
+ }
+ return Set{equivalent: computeDistinct(kvs)}, nil
}
// NewSetWithSortableFiltered returns a new Set.
@@ -249,82 +262,71 @@ func NewSetWithFiltered(kvs []KeyValue, filter Filter) (Set, []KeyValue) {
//
// The second []KeyValue return value is a list of attributes that were
// excluded by the Filter (if non-nil).
-func NewSetWithSortableFiltered(kvs []KeyValue, tmp *Sortable, filter Filter) (Set, []KeyValue) {
- // Check for empty set.
- if len(kvs) == 0 {
- return empty(), nil
- }
-
- *tmp = kvs
-
- // Stable sort so the following de-duplication can implement
- // last-value-wins semantics.
- sort.Stable(tmp)
-
- *tmp = nil
-
- position := len(kvs) - 1
- offset := position - 1
-
- // The requirements stated above require that the stable
- // result be placed in the end of the input slice, while
- // overwritten values are swapped to the beginning.
- //
- // De-duplicate with last-value-wins semantics. Preserve
- // duplicate values at the beginning of the input slice.
- for ; offset >= 0; offset-- {
- if kvs[offset].Key == kvs[position].Key {
- continue
- }
- position--
- kvs[offset], kvs[position] = kvs[position], kvs[offset]
- }
- if filter != nil {
- return filterSet(kvs[position:], filter)
- }
- return Set{
- equivalent: computeDistinct(kvs[position:]),
- }, nil
+//
+// Deprecated: Use [NewSetWithFiltered] instead.
+func NewSetWithSortableFiltered(kvs []KeyValue, _ *Sortable, filter Filter) (Set, []KeyValue) {
+ return NewSetWithFiltered(kvs, filter)
}
-// filterSet reorders kvs so that included keys are contiguous at the end of
-// the slice, while excluded keys precede the included keys.
-func filterSet(kvs []KeyValue, filter Filter) (Set, []KeyValue) {
- var excluded []KeyValue
-
- // Move attributes that do not match the filter so they're adjacent before
- // calling computeDistinct().
- distinctPosition := len(kvs)
-
- // Swap indistinct keys forward and distinct keys toward the
- // end of the slice.
- offset := len(kvs) - 1
- for ; offset >= 0; offset-- {
- if filter(kvs[offset]) {
- distinctPosition--
- kvs[offset], kvs[distinctPosition] = kvs[distinctPosition], kvs[offset]
- continue
+// filteredToFront filters slice in-place using keep function. All KeyValues that need to
+// be removed are moved to the front. All KeyValues that need to be kept are
+// moved (in-order) to the back. The index for the first KeyValue to be kept is
+// returned.
+func filteredToFront(slice []KeyValue, keep Filter) int {
+ n := len(slice)
+ j := n
+ for i := n - 1; i >= 0; i-- {
+ if keep(slice[i]) {
+ j--
+ slice[i], slice[j] = slice[j], slice[i]
}
}
- excluded = kvs[:distinctPosition]
-
- return Set{
- equivalent: computeDistinct(kvs[distinctPosition:]),
- }, excluded
+ return j
}
// Filter returns a filtered copy of this Set. See the documentation for
// NewSetWithSortableFiltered for more details.
func (l *Set) Filter(re Filter) (Set, []KeyValue) {
if re == nil {
- return Set{
- equivalent: l.equivalent,
- }, nil
+ return *l, nil
+ }
+
+ // Iterate in reverse to the first attribute that will be filtered out.
+ n := l.Len()
+ first := n - 1
+ for ; first >= 0; first-- {
+ kv, _ := l.Get(first)
+ if !re(kv) {
+ break
+ }
+ }
+
+ // No attributes will be dropped, return the immutable Set l and nil.
+ if first < 0 {
+ return *l, nil
}
- // Note: This could be refactored to avoid the temporary slice
- // allocation, if it proves to be expensive.
- return filterSet(l.ToSlice(), re)
+ // Copy now that we know we need to return a modified set.
+ //
+ // Do not do this in-place on the underlying storage of *Set l. Sets are
+ // immutable and filtering should not change this.
+ slice := l.ToSlice()
+
+ // Don't re-iterate the slice if only slice[0] is filtered.
+ if first == 0 {
+ // It is safe to assume len(slice) >= 1 given we found at least one
+ // attribute above that needs to be filtered out.
+ return Set{equivalent: computeDistinct(slice[1:])}, slice[:1]
+ }
+
+ // Move the filtered slice[first] to the front (preserving order).
+ kv := slice[first]
+ copy(slice[1:first+1], slice[:first])
+ slice[0] = kv
+
+ // Do not re-evaluate re(slice[first+1:]).
+ div := filteredToFront(slice[1:first+1], re) + 1
+ return Set{equivalent: computeDistinct(slice[div:])}, slice[:div]
}
// computeDistinct returns a Distinct using either the fixed- or
@@ -345,45 +347,25 @@ func computeDistinct(kvs []KeyValue) Distinct {
func computeDistinctFixed(kvs []KeyValue) interface{} {
switch len(kvs) {
case 1:
- ptr := new([1]KeyValue)
- copy((*ptr)[:], kvs)
- return *ptr
+ return [1]KeyValue(kvs)
case 2:
- ptr := new([2]KeyValue)
- copy((*ptr)[:], kvs)
- return *ptr
+ return [2]KeyValue(kvs)
case 3:
- ptr := new([3]KeyValue)
- copy((*ptr)[:], kvs)
- return *ptr
+ return [3]KeyValue(kvs)
case 4:
- ptr := new([4]KeyValue)
- copy((*ptr)[:], kvs)
- return *ptr
+ return [4]KeyValue(kvs)
case 5:
- ptr := new([5]KeyValue)
- copy((*ptr)[:], kvs)
- return *ptr
+ return [5]KeyValue(kvs)
case 6:
- ptr := new([6]KeyValue)
- copy((*ptr)[:], kvs)
- return *ptr
+ return [6]KeyValue(kvs)
case 7:
- ptr := new([7]KeyValue)
- copy((*ptr)[:], kvs)
- return *ptr
+ return [7]KeyValue(kvs)
case 8:
- ptr := new([8]KeyValue)
- copy((*ptr)[:], kvs)
- return *ptr
+ return [8]KeyValue(kvs)
case 9:
- ptr := new([9]KeyValue)
- copy((*ptr)[:], kvs)
- return *ptr
+ return [9]KeyValue(kvs)
case 10:
- ptr := new([10]KeyValue)
- copy((*ptr)[:], kvs)
- return *ptr
+ return [10]KeyValue(kvs)
default:
return nil
}
@@ -404,7 +386,7 @@ func (l *Set) MarshalJSON() ([]byte, error) {
return json.Marshal(l.equivalent.iface)
}
-// MarshalLog is the marshaling function used by the logging system to represent this exporter.
+// MarshalLog is the marshaling function used by the logging system to represent this Set.
func (l Set) MarshalLog() interface{} {
kvs := make(map[string]string)
for _, kv := range l.ToSlice() {
diff --git a/vendor/go.opentelemetry.io/otel/attribute/value.go b/vendor/go.opentelemetry.io/otel/attribute/value.go
index cb21dd5c..9ea0ecbb 100644
--- a/vendor/go.opentelemetry.io/otel/attribute/value.go
+++ b/vendor/go.opentelemetry.io/otel/attribute/value.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package attribute // import "go.opentelemetry.io/otel/attribute"
@@ -242,15 +231,27 @@ func (v Value) Emit() string {
case BOOL:
return strconv.FormatBool(v.AsBool())
case INT64SLICE:
- return fmt.Sprint(v.asInt64Slice())
+ j, err := json.Marshal(v.asInt64Slice())
+ if err != nil {
+ return fmt.Sprintf("invalid: %v", v.asInt64Slice())
+ }
+ return string(j)
case INT64:
return strconv.FormatInt(v.AsInt64(), 10)
case FLOAT64SLICE:
- return fmt.Sprint(v.asFloat64Slice())
+ j, err := json.Marshal(v.asFloat64Slice())
+ if err != nil {
+ return fmt.Sprintf("invalid: %v", v.asFloat64Slice())
+ }
+ return string(j)
case FLOAT64:
return fmt.Sprint(v.AsFloat64())
case STRINGSLICE:
- return fmt.Sprint(v.asStringSlice())
+ j, err := json.Marshal(v.asStringSlice())
+ if err != nil {
+ return fmt.Sprintf("invalid: %v", v.asStringSlice())
+ }
+ return string(j)
case STRING:
return v.stringly
default:
diff --git a/vendor/go.opentelemetry.io/otel/baggage/README.md b/vendor/go.opentelemetry.io/otel/baggage/README.md
new file mode 100644
index 00000000..7d798435
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/baggage/README.md
@@ -0,0 +1,3 @@
+# Baggage
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/baggage)](https://pkg.go.dev/go.opentelemetry.io/otel/baggage)
diff --git a/vendor/go.opentelemetry.io/otel/baggage/baggage.go b/vendor/go.opentelemetry.io/otel/baggage/baggage.go
index 84532cb1..36f53670 100644
--- a/vendor/go.opentelemetry.io/otel/baggage/baggage.go
+++ b/vendor/go.opentelemetry.io/otel/baggage/baggage.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package baggage // import "go.opentelemetry.io/otel/baggage"
@@ -18,8 +7,8 @@ import (
"errors"
"fmt"
"net/url"
- "regexp"
"strings"
+ "unicode/utf8"
"go.opentelemetry.io/otel/internal/baggage"
)
@@ -32,16 +21,6 @@ const (
listDelimiter = ","
keyValueDelimiter = "="
propertyDelimiter = ";"
-
- keyDef = `([\x21\x23-\x27\x2A\x2B\x2D\x2E\x30-\x39\x41-\x5a\x5e-\x7a\x7c\x7e]+)`
- valueDef = `([\x21\x23-\x2b\x2d-\x3a\x3c-\x5B\x5D-\x7e]*)`
- keyValueDef = `\s*` + keyDef + `\s*` + keyValueDelimiter + `\s*` + valueDef + `\s*`
-)
-
-var (
- keyRe = regexp.MustCompile(`^` + keyDef + `$`)
- valueRe = regexp.MustCompile(`^` + valueDef + `$`)
- propertyRe = regexp.MustCompile(`^(?:\s*` + keyDef + `\s*|` + keyValueDef + `)$`)
)
var (
@@ -65,9 +44,15 @@ type Property struct {
// NewKeyProperty returns a new Property for key.
//
+// The passed key must be valid, non-empty UTF-8 string.
// If key is invalid, an error will be returned.
+// However, the specific Propagators that are used to transmit baggage entries across
+// component boundaries may impose their own restrictions on Property key.
+// For example, the W3C Baggage specification restricts the Property keys to strings that
+// satisfy the token definition from RFC7230, Section 3.2.6.
+// For maximum compatibility, alphanumeric value are strongly recommended to be used as Property key.
func NewKeyProperty(key string) (Property, error) {
- if !keyRe.MatchString(key) {
+ if !validateBaggageName(key) {
return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidKey, key)
}
@@ -77,12 +62,40 @@ func NewKeyProperty(key string) (Property, error) {
// NewKeyValueProperty returns a new Property for key with value.
//
-// If key or value are invalid, an error will be returned.
+// The passed key must be compliant with W3C Baggage specification.
+// The passed value must be percent-encoded as defined in W3C Baggage specification.
+//
+// Notice: Consider using [NewKeyValuePropertyRaw] instead
+// that does not require percent-encoding of the value.
func NewKeyValueProperty(key, value string) (Property, error) {
- if !keyRe.MatchString(key) {
+ if !validateKey(key) {
return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidKey, key)
}
- if !valueRe.MatchString(value) {
+
+ if !validateValue(value) {
+ return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidValue, value)
+ }
+ decodedValue, err := url.PathUnescape(value)
+ if err != nil {
+ return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidValue, value)
+ }
+ return NewKeyValuePropertyRaw(key, decodedValue)
+}
+
+// NewKeyValuePropertyRaw returns a new Property for key with value.
+//
+// The passed key must be valid, non-empty UTF-8 string.
+// The passed value must be valid UTF-8 string.
+// However, the specific Propagators that are used to transmit baggage entries across
+// component boundaries may impose their own restrictions on Property key.
+// For example, the W3C Baggage specification restricts the Property keys to strings that
+// satisfy the token definition from RFC7230, Section 3.2.6.
+// For maximum compatibility, alphanumeric value are strongly recommended to be used as Property key.
+func NewKeyValuePropertyRaw(key, value string) (Property, error) {
+ if !validateBaggageName(key) {
+ return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidKey, key)
+ }
+ if !validateBaggageValue(value) {
return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidValue, value)
}
@@ -106,20 +119,11 @@ func parseProperty(property string) (Property, error) {
return newInvalidProperty(), nil
}
- match := propertyRe.FindStringSubmatch(property)
- if len(match) != 4 {
+ p, ok := parsePropertyInternal(property)
+ if !ok {
return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidProperty, property)
}
- var p Property
- if match[1] != "" {
- p.key = match[1]
- } else {
- p.key = match[2]
- p.value = match[3]
- p.hasValue = true
- }
-
return p, nil
}
@@ -130,15 +134,15 @@ func (p Property) validate() error {
return fmt.Errorf("invalid property: %w", err)
}
- if !keyRe.MatchString(p.key) {
+ if !validateBaggageName(p.key) {
return errFunc(fmt.Errorf("%w: %q", errInvalidKey, p.key))
}
- if p.hasValue && !valueRe.MatchString(p.value) {
- return errFunc(fmt.Errorf("%w: %q", errInvalidValue, p.value))
- }
if !p.hasValue && p.value != "" {
return errFunc(errors.New("inconsistent value"))
}
+ if p.hasValue && !validateBaggageValue(p.value) {
+ return errFunc(fmt.Errorf("%w: %q", errInvalidValue, p.value))
+ }
return nil
}
@@ -154,11 +158,19 @@ func (p Property) Value() (string, bool) {
return p.value, p.hasValue
}
-// String encodes Property into a string compliant with the W3C Baggage
+// String encodes Property into a header string compliant with the W3C Baggage
// specification.
+// It would return empty string if the key is invalid with the W3C Baggage
+// specification. This could happen for a UTF-8 key, as it may contain
+// invalid characters.
func (p Property) String() string {
+ // W3C Baggage specification does not allow percent-encoded keys.
+ if !validateKey(p.key) {
+ return ""
+ }
+
if p.hasValue {
- return fmt.Sprintf("%s%s%v", p.key, keyValueDelimiter, p.value)
+ return fmt.Sprintf("%s%s%v", p.key, keyValueDelimiter, valueEscape(p.value))
}
return p.key
}
@@ -218,12 +230,17 @@ func (p properties) validate() error {
return nil
}
-// String encodes properties into a string compliant with the W3C Baggage
+// String encodes properties into a header string compliant with the W3C Baggage
// specification.
func (p properties) String() string {
- props := make([]string, len(p))
- for i, prop := range p {
- props[i] = prop.String()
+ props := make([]string, 0, len(p))
+ for _, prop := range p {
+ s := prop.String()
+
+ // Ignored empty properties.
+ if s != "" {
+ props = append(props, s)
+ }
}
return strings.Join(props, propertyDelimiter)
}
@@ -240,11 +257,38 @@ type Member struct {
hasData bool
}
-// NewMember returns a new Member from the passed arguments. The key will be
-// used directly while the value will be url decoded after validation. An error
-// is returned if the created Member would be invalid according to the W3C
-// Baggage specification.
+// NewMember returns a new Member from the passed arguments.
+//
+// The passed key must be compliant with W3C Baggage specification.
+// The passed value must be percent-encoded as defined in W3C Baggage specification.
+//
+// Notice: Consider using [NewMemberRaw] instead
+// that does not require percent-encoding of the value.
func NewMember(key, value string, props ...Property) (Member, error) {
+ if !validateKey(key) {
+ return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidKey, key)
+ }
+
+ if !validateValue(value) {
+ return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidValue, value)
+ }
+ decodedValue, err := url.PathUnescape(value)
+ if err != nil {
+ return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidValue, value)
+ }
+ return NewMemberRaw(key, decodedValue, props...)
+}
+
+// NewMemberRaw returns a new Member from the passed arguments.
+//
+// The passed key must be valid, non-empty UTF-8 string.
+// The passed value must be valid UTF-8 string.
+// However, the specific Propagators that are used to transmit baggage entries across
+// component boundaries may impose their own restrictions on baggage key.
+// For example, the W3C Baggage specification restricts the baggage keys to strings that
+// satisfy the token definition from RFC7230, Section 3.2.6.
+// For maximum compatibility, alphanumeric value are strongly recommended to be used as baggage key.
+func NewMemberRaw(key, value string, props ...Property) (Member, error) {
m := Member{
key: key,
value: value,
@@ -254,11 +298,6 @@ func NewMember(key, value string, props ...Property) (Member, error) {
if err := m.validate(); err != nil {
return newInvalidMember(), err
}
- decodedValue, err := url.PathUnescape(value)
- if err != nil {
- return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidValue, value)
- }
- m.value = decodedValue
return m, nil
}
@@ -274,11 +313,7 @@ func parseMember(member string) (Member, error) {
return newInvalidMember(), fmt.Errorf("%w: %d", errMemberBytes, n)
}
- var (
- key, value string
- props properties
- )
-
+ var props properties
keyValue, properties, found := strings.Cut(member, propertyDelimiter)
if found {
// Parse the member properties.
@@ -299,34 +334,61 @@ func parseMember(member string) (Member, error) {
}
// "Leading and trailing whitespaces are allowed but MUST be trimmed
// when converting the header into a data structure."
- key = strings.TrimSpace(k)
- var err error
- value, err = url.PathUnescape(strings.TrimSpace(v))
- if err != nil {
- return newInvalidMember(), fmt.Errorf("%w: %q", err, value)
- }
- if !keyRe.MatchString(key) {
+ key := strings.TrimSpace(k)
+ if !validateKey(key) {
return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidKey, key)
}
- if !valueRe.MatchString(value) {
- return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidValue, value)
+
+ rawVal := strings.TrimSpace(v)
+ if !validateValue(rawVal) {
+ return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidValue, v)
}
+ // Decode a percent-encoded value.
+ unescapeVal, err := url.PathUnescape(rawVal)
+ if err != nil {
+ return newInvalidMember(), fmt.Errorf("%w: %w", errInvalidValue, err)
+ }
+
+ value := replaceInvalidUTF8Sequences(len(rawVal), unescapeVal)
return Member{key: key, value: value, properties: props, hasData: true}, nil
}
+// replaceInvalidUTF8Sequences replaces invalid UTF-8 sequences with '�'.
+func replaceInvalidUTF8Sequences(cap int, unescapeVal string) string {
+ if utf8.ValidString(unescapeVal) {
+ return unescapeVal
+ }
+ // W3C baggage spec:
+ // https://github.com/w3c/baggage/blob/8c215efbeebd3fa4b1aceb937a747e56444f22f3/baggage/HTTP_HEADER_FORMAT.md?plain=1#L69
+
+ var b strings.Builder
+ b.Grow(cap)
+ for i := 0; i < len(unescapeVal); {
+ r, size := utf8.DecodeRuneInString(unescapeVal[i:])
+ if r == utf8.RuneError && size == 1 {
+ // Invalid UTF-8 sequence found, replace it with '�'
+ _, _ = b.WriteString("�")
+ } else {
+ _, _ = b.WriteRune(r)
+ }
+ i += size
+ }
+
+ return b.String()
+}
+
// validate ensures m conforms to the W3C Baggage specification.
-// A key is just an ASCII string, but a value must be URL encoded UTF-8,
-// returning an error otherwise.
+// A key must be an ASCII string, returning an error otherwise.
func (m Member) validate() error {
if !m.hasData {
return fmt.Errorf("%w: %q", errInvalidMember, m)
}
- if !keyRe.MatchString(m.key) {
+ if !validateBaggageName(m.key) {
return fmt.Errorf("%w: %q", errInvalidKey, m.key)
}
- if !valueRe.MatchString(m.value) {
+ if !validateBaggageValue(m.value) {
return fmt.Errorf("%w: %q", errInvalidValue, m.value)
}
return m.properties.validate()
@@ -341,13 +403,20 @@ func (m Member) Value() string { return m.value }
// Properties returns a copy of the Member properties.
func (m Member) Properties() []Property { return m.properties.Copy() }
-// String encodes Member into a string compliant with the W3C Baggage
+// String encodes Member into a header string compliant with the W3C Baggage
// specification.
+// It would return empty string if the key is invalid with the W3C Baggage
+// specification. This could happen for a UTF-8 key, as it may contain
+// invalid characters.
func (m Member) String() string {
- // A key is just an ASCII string, but a value is URL encoded UTF-8.
- s := fmt.Sprintf("%s%s%s", m.key, keyValueDelimiter, url.QueryEscape(m.value))
+ // W3C Baggage specification does not allow percent-encoded keys.
+ if !validateKey(m.key) {
+ return ""
+ }
+
+ s := m.key + keyValueDelimiter + valueEscape(m.value)
if len(m.properties) > 0 {
- s = fmt.Sprintf("%s%s%s", s, propertyDelimiter, m.properties.String())
+ s += propertyDelimiter + m.properties.String()
}
return s
}
@@ -458,7 +527,7 @@ func (b Baggage) Member(key string) Member {
}
// Members returns all the baggage list-members.
-// The order of the returned list-members does not have significance.
+// The order of the returned list-members is not significant.
//
// The returned members are not validated, as we assume the validation happened
// when they were added to the Baggage.
@@ -479,8 +548,8 @@ func (b Baggage) Members() []Member {
return members
}
-// SetMember returns a copy the Baggage with the member included. If the
-// baggage contains a Member with the same key the existing Member is
+// SetMember returns a copy of the Baggage with the member included. If the
+// baggage contains a Member with the same key, the existing Member is
// replaced.
//
// If member is invalid according to the W3C Baggage specification, an error
@@ -536,17 +605,414 @@ func (b Baggage) Len() int {
return len(b.list)
}
-// String encodes Baggage into a string compliant with the W3C Baggage
-// specification. The returned string will be invalid if the Baggage contains
-// any invalid list-members.
+// String encodes Baggage into a header string compliant with the W3C Baggage
+// specification.
+// It would ignore members where the member key is invalid with the W3C Baggage
+// specification. This could happen for a UTF-8 key, as it may contain
+// invalid characters.
func (b Baggage) String() string {
members := make([]string, 0, len(b.list))
for k, v := range b.list {
- members = append(members, Member{
+ s := Member{
key: k,
value: v.Value,
properties: fromInternalProperties(v.Properties),
- }.String())
+ }.String()
+
+ // Ignored empty members.
+ if s != "" {
+ members = append(members, s)
+ }
}
return strings.Join(members, listDelimiter)
}
+
+// parsePropertyInternal attempts to decode a Property from the passed string.
+// It follows the spec at https://www.w3.org/TR/baggage/#definition.
+func parsePropertyInternal(s string) (p Property, ok bool) {
+ // For the entire function we will use " key = value " as an example.
+ // Attempting to parse the key.
+ // First skip spaces at the beginning "< >key = value " (they could be empty).
+ index := skipSpace(s, 0)
+
+ // Parse the key: " = value ".
+ keyStart := index
+ keyEnd := index
+ for _, c := range s[keyStart:] {
+ if !validateKeyChar(c) {
+ break
+ }
+ keyEnd++
+ }
+
+ // If we couldn't find any valid key character,
+ // it means the key is either empty or invalid.
+ if keyStart == keyEnd {
+ return
+ }
+
+ // Skip spaces after the key: " key< >= value ".
+ index = skipSpace(s, keyEnd)
+
+ if index == len(s) {
+ // A key can have no value, like: " key ".
+ ok = true
+ p.key = s[keyStart:keyEnd]
+ return
+ }
+
+ // If we have not reached the end and we can't find the '=' delimiter,
+ // it means the property is invalid.
+ if s[index] != keyValueDelimiter[0] {
+ return
+ }
+
+ // Attempting to parse the value.
+ // Match: " key =< >value ".
+ index = skipSpace(s, index+1)
+
+ // Match the value string: " key = ".
+ // A valid property can be: " key =".
+ // Therefore, we don't have to check if the value is empty.
+ valueStart := index
+ valueEnd := index
+ for _, c := range s[valueStart:] {
+ if !validateValueChar(c) {
+ break
+ }
+ valueEnd++
+ }
+
+ // Skip all trailing whitespaces: " key = value< >".
+ index = skipSpace(s, valueEnd)
+
+ // If after looking for the value and skipping whitespaces
+ // we have not reached the end, it means the property is
+ // invalid, something like: " key = value value1".
+ if index != len(s) {
+ return
+ }
+
+ // Decode a percent-encoded value.
+ rawVal := s[valueStart:valueEnd]
+ unescapeVal, err := url.PathUnescape(rawVal)
+ if err != nil {
+ return
+ }
+ value := replaceInvalidUTF8Sequences(len(rawVal), unescapeVal)
+
+ ok = true
+ p.key = s[keyStart:keyEnd]
+ p.hasValue = true
+
+ p.value = value
+ return
+}
+
+func skipSpace(s string, offset int) int {
+ i := offset
+ for ; i < len(s); i++ {
+ c := s[i]
+ if c != ' ' && c != '\t' {
+ break
+ }
+ }
+ return i
+}
+
+var safeKeyCharset = [utf8.RuneSelf]bool{
+ // 0x23 to 0x27
+ '#': true,
+ '$': true,
+ '%': true,
+ '&': true,
+ '\'': true,
+
+ // 0x30 to 0x39
+ '0': true,
+ '1': true,
+ '2': true,
+ '3': true,
+ '4': true,
+ '5': true,
+ '6': true,
+ '7': true,
+ '8': true,
+ '9': true,
+
+ // 0x41 to 0x5a
+ 'A': true,
+ 'B': true,
+ 'C': true,
+ 'D': true,
+ 'E': true,
+ 'F': true,
+ 'G': true,
+ 'H': true,
+ 'I': true,
+ 'J': true,
+ 'K': true,
+ 'L': true,
+ 'M': true,
+ 'N': true,
+ 'O': true,
+ 'P': true,
+ 'Q': true,
+ 'R': true,
+ 'S': true,
+ 'T': true,
+ 'U': true,
+ 'V': true,
+ 'W': true,
+ 'X': true,
+ 'Y': true,
+ 'Z': true,
+
+ // 0x5e to 0x7a
+ '^': true,
+ '_': true,
+ '`': true,
+ 'a': true,
+ 'b': true,
+ 'c': true,
+ 'd': true,
+ 'e': true,
+ 'f': true,
+ 'g': true,
+ 'h': true,
+ 'i': true,
+ 'j': true,
+ 'k': true,
+ 'l': true,
+ 'm': true,
+ 'n': true,
+ 'o': true,
+ 'p': true,
+ 'q': true,
+ 'r': true,
+ 's': true,
+ 't': true,
+ 'u': true,
+ 'v': true,
+ 'w': true,
+ 'x': true,
+ 'y': true,
+ 'z': true,
+
+ // remainder
+ '!': true,
+ '*': true,
+ '+': true,
+ '-': true,
+ '.': true,
+ '|': true,
+ '~': true,
+}
+
+// validateBaggageName checks if the string is a valid OpenTelemetry Baggage name.
+// Baggage name is a valid, non-empty UTF-8 string.
+func validateBaggageName(s string) bool {
+ if len(s) == 0 {
+ return false
+ }
+
+ return utf8.ValidString(s)
+}
+
+// validateBaggageValue checks if the string is a valid OpenTelemetry Baggage value.
+// Baggage value is a valid UTF-8 strings.
+// Empty string is also a valid UTF-8 string.
+func validateBaggageValue(s string) bool {
+ return utf8.ValidString(s)
+}
+
+// validateKey checks if the string is a valid W3C Baggage key.
+func validateKey(s string) bool {
+ if len(s) == 0 {
+ return false
+ }
+
+ for _, c := range s {
+ if !validateKeyChar(c) {
+ return false
+ }
+ }
+
+ return true
+}
+
+func validateKeyChar(c int32) bool {
+ return c >= 0 && c < int32(utf8.RuneSelf) && safeKeyCharset[c]
+}
+
+// validateValue checks if the string is a valid W3C Baggage value.
+func validateValue(s string) bool {
+ for _, c := range s {
+ if !validateValueChar(c) {
+ return false
+ }
+ }
+
+ return true
+}
+
+var safeValueCharset = [utf8.RuneSelf]bool{
+ '!': true, // 0x21
+
+ // 0x23 to 0x2b
+ '#': true,
+ '$': true,
+ '%': true,
+ '&': true,
+ '\'': true,
+ '(': true,
+ ')': true,
+ '*': true,
+ '+': true,
+
+ // 0x2d to 0x3a
+ '-': true,
+ '.': true,
+ '/': true,
+ '0': true,
+ '1': true,
+ '2': true,
+ '3': true,
+ '4': true,
+ '5': true,
+ '6': true,
+ '7': true,
+ '8': true,
+ '9': true,
+ ':': true,
+
+ // 0x3c to 0x5b
+ '<': true, // 0x3C
+ '=': true, // 0x3D
+ '>': true, // 0x3E
+ '?': true, // 0x3F
+ '@': true, // 0x40
+ 'A': true, // 0x41
+ 'B': true, // 0x42
+ 'C': true, // 0x43
+ 'D': true, // 0x44
+ 'E': true, // 0x45
+ 'F': true, // 0x46
+ 'G': true, // 0x47
+ 'H': true, // 0x48
+ 'I': true, // 0x49
+ 'J': true, // 0x4A
+ 'K': true, // 0x4B
+ 'L': true, // 0x4C
+ 'M': true, // 0x4D
+ 'N': true, // 0x4E
+ 'O': true, // 0x4F
+ 'P': true, // 0x50
+ 'Q': true, // 0x51
+ 'R': true, // 0x52
+ 'S': true, // 0x53
+ 'T': true, // 0x54
+ 'U': true, // 0x55
+ 'V': true, // 0x56
+ 'W': true, // 0x57
+ 'X': true, // 0x58
+ 'Y': true, // 0x59
+ 'Z': true, // 0x5A
+ '[': true, // 0x5B
+
+ // 0x5d to 0x7e
+ ']': true, // 0x5D
+ '^': true, // 0x5E
+ '_': true, // 0x5F
+ '`': true, // 0x60
+ 'a': true, // 0x61
+ 'b': true, // 0x62
+ 'c': true, // 0x63
+ 'd': true, // 0x64
+ 'e': true, // 0x65
+ 'f': true, // 0x66
+ 'g': true, // 0x67
+ 'h': true, // 0x68
+ 'i': true, // 0x69
+ 'j': true, // 0x6A
+ 'k': true, // 0x6B
+ 'l': true, // 0x6C
+ 'm': true, // 0x6D
+ 'n': true, // 0x6E
+ 'o': true, // 0x6F
+ 'p': true, // 0x70
+ 'q': true, // 0x71
+ 'r': true, // 0x72
+ 's': true, // 0x73
+ 't': true, // 0x74
+ 'u': true, // 0x75
+ 'v': true, // 0x76
+ 'w': true, // 0x77
+ 'x': true, // 0x78
+ 'y': true, // 0x79
+ 'z': true, // 0x7A
+ '{': true, // 0x7B
+ '|': true, // 0x7C
+ '}': true, // 0x7D
+ '~': true, // 0x7E
+}
+
+func validateValueChar(c int32) bool {
+ return c >= 0 && c < int32(utf8.RuneSelf) && safeValueCharset[c]
+}
+
+// valueEscape escapes the string so it can be safely placed inside a baggage value,
+// replacing special characters with %XX sequences as needed.
+//
+// The implementation is based on:
+// https://github.com/golang/go/blob/f6509cf5cdbb5787061b784973782933c47f1782/src/net/url/url.go#L285.
+func valueEscape(s string) string {
+ hexCount := 0
+ for i := 0; i < len(s); i++ {
+ c := s[i]
+ if shouldEscape(c) {
+ hexCount++
+ }
+ }
+
+ if hexCount == 0 {
+ return s
+ }
+
+ var buf [64]byte
+ var t []byte
+
+ required := len(s) + 2*hexCount
+ if required <= len(buf) {
+ t = buf[:required]
+ } else {
+ t = make([]byte, required)
+ }
+
+ j := 0
+ for i := 0; i < len(s); i++ {
+ c := s[i]
+ if shouldEscape(s[i]) {
+ const upperhex = "0123456789ABCDEF"
+ t[j] = '%'
+ t[j+1] = upperhex[c>>4]
+ t[j+2] = upperhex[c&15]
+ j += 3
+ } else {
+ t[j] = c
+ j++
+ }
+ }
+
+ return string(t)
+}
+
+// shouldEscape returns true if the specified byte should be escaped when
+// appearing in a baggage value string.
+func shouldEscape(c byte) bool {
+ if c == '%' {
+ // The percent character must be encoded so that percent-encoding can work.
+ return true
+ }
+ return !validateValueChar(int32(c))
+}
diff --git a/vendor/go.opentelemetry.io/otel/baggage/context.go b/vendor/go.opentelemetry.io/otel/baggage/context.go
index 24b34b75..a572461a 100644
--- a/vendor/go.opentelemetry.io/otel/baggage/context.go
+++ b/vendor/go.opentelemetry.io/otel/baggage/context.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package baggage // import "go.opentelemetry.io/otel/baggage"
diff --git a/vendor/go.opentelemetry.io/otel/baggage/doc.go b/vendor/go.opentelemetry.io/otel/baggage/doc.go
index 4545100d..b51d87ca 100644
--- a/vendor/go.opentelemetry.io/otel/baggage/doc.go
+++ b/vendor/go.opentelemetry.io/otel/baggage/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
/*
Package baggage provides functionality for storing and retrieving
diff --git a/vendor/go.opentelemetry.io/otel/codes/README.md b/vendor/go.opentelemetry.io/otel/codes/README.md
new file mode 100644
index 00000000..24c52b38
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/codes/README.md
@@ -0,0 +1,3 @@
+# Codes
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/codes)](https://pkg.go.dev/go.opentelemetry.io/otel/codes)
diff --git a/vendor/go.opentelemetry.io/otel/codes/codes.go b/vendor/go.opentelemetry.io/otel/codes/codes.go
index 587ebae4..2acbac35 100644
--- a/vendor/go.opentelemetry.io/otel/codes/codes.go
+++ b/vendor/go.opentelemetry.io/otel/codes/codes.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package codes // import "go.opentelemetry.io/otel/codes"
@@ -94,7 +83,7 @@ func (c *Code) UnmarshalJSON(b []byte) error {
return fmt.Errorf("invalid code: %q", ci)
}
- *c = Code(ci)
+ *c = Code(ci) // nolint: gosec // Bit size of 32 check above.
return nil
}
return fmt.Errorf("invalid code: %q", string(b))
diff --git a/vendor/go.opentelemetry.io/otel/codes/doc.go b/vendor/go.opentelemetry.io/otel/codes/doc.go
index 4e328fbb..ee8db448 100644
--- a/vendor/go.opentelemetry.io/otel/codes/doc.go
+++ b/vendor/go.opentelemetry.io/otel/codes/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
/*
Package codes defines the canonical error codes used by OpenTelemetry.
diff --git a/vendor/go.opentelemetry.io/otel/doc.go b/vendor/go.opentelemetry.io/otel/doc.go
index daa36c89..921f8596 100644
--- a/vendor/go.opentelemetry.io/otel/doc.go
+++ b/vendor/go.opentelemetry.io/otel/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
/*
Package otel provides global access to the OpenTelemetry API. The subpackages of
@@ -22,12 +11,14 @@ transmitted anywhere. An implementation of the OpenTelemetry SDK, like the
default SDK implementation (go.opentelemetry.io/otel/sdk), and associated
exporters are used to process and transport this data.
-To read the getting started guide, see https://opentelemetry.io/docs/go/getting-started/.
+To read the getting started guide, see https://opentelemetry.io/docs/languages/go/getting-started/.
To read more about tracing, see go.opentelemetry.io/otel/trace.
To read more about metrics, see go.opentelemetry.io/otel/metric.
+To read more about logs, see go.opentelemetry.io/otel/log.
+
To read more about propagation, see go.opentelemetry.io/otel/propagation and
go.opentelemetry.io/otel/baggage.
*/
diff --git a/vendor/go.opentelemetry.io/otel/error_handler.go b/vendor/go.opentelemetry.io/otel/error_handler.go
index 72fad854..67414c71 100644
--- a/vendor/go.opentelemetry.io/otel/error_handler.go
+++ b/vendor/go.opentelemetry.io/otel/error_handler.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package otel // import "go.opentelemetry.io/otel"
diff --git a/vendor/go.opentelemetry.io/otel/get_main_pkgs.sh b/vendor/go.opentelemetry.io/otel/get_main_pkgs.sh
index 9a58fb1d..93e80ea3 100644
--- a/vendor/go.opentelemetry.io/otel/get_main_pkgs.sh
+++ b/vendor/go.opentelemetry.io/otel/get_main_pkgs.sh
@@ -1,18 +1,7 @@
#!/usr/bin/env bash
# Copyright The OpenTelemetry 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.
+# SPDX-License-Identifier: Apache-2.0
set -euo pipefail
diff --git a/vendor/go.opentelemetry.io/otel/handler.go b/vendor/go.opentelemetry.io/otel/handler.go
index 4115fe3b..07623b67 100644
--- a/vendor/go.opentelemetry.io/otel/handler.go
+++ b/vendor/go.opentelemetry.io/otel/handler.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package otel // import "go.opentelemetry.io/otel"
@@ -18,12 +7,8 @@ import (
"go.opentelemetry.io/otel/internal/global"
)
-var (
- // Compile-time check global.ErrDelegator implements ErrorHandler.
- _ ErrorHandler = (*global.ErrDelegator)(nil)
- // Compile-time check global.ErrLogger implements ErrorHandler.
- _ ErrorHandler = (*global.ErrLogger)(nil)
-)
+// Compile-time check global.ErrDelegator implements ErrorHandler.
+var _ ErrorHandler = (*global.ErrDelegator)(nil)
// GetErrorHandler returns the global ErrorHandler instance.
//
@@ -44,5 +29,5 @@ func GetErrorHandler() ErrorHandler { return global.GetErrorHandler() }
// delegate errors to h.
func SetErrorHandler(h ErrorHandler) { global.SetErrorHandler(h) }
-// Handle is a convenience function for ErrorHandler().Handle(err).
-func Handle(err error) { global.Handle(err) }
+// Handle is a convenience function for GetErrorHandler().Handle(err).
+func Handle(err error) { global.GetErrorHandler().Handle(err) }
diff --git a/vendor/go.opentelemetry.io/otel/internal/attribute/attribute.go b/vendor/go.opentelemetry.io/otel/internal/attribute/attribute.go
index 622c3ee3..822d8479 100644
--- a/vendor/go.opentelemetry.io/otel/internal/attribute/attribute.go
+++ b/vendor/go.opentelemetry.io/otel/internal/attribute/attribute.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
/*
Package attribute provide several helper functions for some commonly used
@@ -25,33 +14,33 @@ import (
// BoolSliceValue converts a bool slice into an array with same elements as slice.
func BoolSliceValue(v []bool) interface{} {
var zero bool
- cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero)))
- copy(cp.Elem().Slice(0, len(v)).Interface().([]bool), v)
- return cp.Elem().Interface()
+ cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero))).Elem()
+ reflect.Copy(cp, reflect.ValueOf(v))
+ return cp.Interface()
}
// Int64SliceValue converts an int64 slice into an array with same elements as slice.
func Int64SliceValue(v []int64) interface{} {
var zero int64
- cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero)))
- copy(cp.Elem().Slice(0, len(v)).Interface().([]int64), v)
- return cp.Elem().Interface()
+ cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero))).Elem()
+ reflect.Copy(cp, reflect.ValueOf(v))
+ return cp.Interface()
}
// Float64SliceValue converts a float64 slice into an array with same elements as slice.
func Float64SliceValue(v []float64) interface{} {
var zero float64
- cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero)))
- copy(cp.Elem().Slice(0, len(v)).Interface().([]float64), v)
- return cp.Elem().Interface()
+ cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero))).Elem()
+ reflect.Copy(cp, reflect.ValueOf(v))
+ return cp.Interface()
}
// StringSliceValue converts a string slice into an array with same elements as slice.
func StringSliceValue(v []string) interface{} {
var zero string
- cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero)))
- copy(cp.Elem().Slice(0, len(v)).Interface().([]string), v)
- return cp.Elem().Interface()
+ cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero))).Elem()
+ reflect.Copy(cp, reflect.ValueOf(v))
+ return cp.Interface()
}
// AsBoolSlice converts a bool array into a slice into with same elements as array.
diff --git a/vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go b/vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go
index b96e5408..b4f85f44 100644
--- a/vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go
+++ b/vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
/*
Package baggage provides base types and functionality to store and retrieve
diff --git a/vendor/go.opentelemetry.io/otel/internal/baggage/context.go b/vendor/go.opentelemetry.io/otel/internal/baggage/context.go
index 4469700d..3aea9c49 100644
--- a/vendor/go.opentelemetry.io/otel/internal/baggage/context.go
+++ b/vendor/go.opentelemetry.io/otel/internal/baggage/context.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package baggage // import "go.opentelemetry.io/otel/internal/baggage"
diff --git a/vendor/go.opentelemetry.io/otel/internal/gen.go b/vendor/go.opentelemetry.io/otel/internal/gen.go
index f532f07e..4259f032 100644
--- a/vendor/go.opentelemetry.io/otel/internal/gen.go
+++ b/vendor/go.opentelemetry.io/otel/internal/gen.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package internal // import "go.opentelemetry.io/otel/internal"
diff --git a/vendor/go.opentelemetry.io/otel/internal/global/handler.go b/vendor/go.opentelemetry.io/otel/internal/global/handler.go
index 5e9b8304..c657ff8e 100644
--- a/vendor/go.opentelemetry.io/otel/internal/global/handler.go
+++ b/vendor/go.opentelemetry.io/otel/internal/global/handler.go
@@ -1,38 +1,13 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package global // import "go.opentelemetry.io/otel/internal/global"
import (
"log"
- "os"
"sync/atomic"
)
-var (
- // GlobalErrorHandler provides an ErrorHandler that can be used
- // throughout an OpenTelemetry instrumented project. When a user
- // specified ErrorHandler is registered (`SetErrorHandler`) all calls to
- // `Handle` and will be delegated to the registered ErrorHandler.
- GlobalErrorHandler = defaultErrorHandler()
-
- // Compile-time check that delegator implements ErrorHandler.
- _ ErrorHandler = (*ErrDelegator)(nil)
- // Compile-time check that errLogger implements ErrorHandler.
- _ ErrorHandler = (*ErrLogger)(nil)
-)
-
// ErrorHandler handles irremediable events.
type ErrorHandler interface {
// Handle handles any error deemed irremediable by an OpenTelemetry
@@ -44,59 +19,18 @@ type ErrDelegator struct {
delegate atomic.Pointer[ErrorHandler]
}
-func (d *ErrDelegator) Handle(err error) {
- d.getDelegate().Handle(err)
-}
+// Compile-time check that delegator implements ErrorHandler.
+var _ ErrorHandler = (*ErrDelegator)(nil)
-func (d *ErrDelegator) getDelegate() ErrorHandler {
- return *d.delegate.Load()
+func (d *ErrDelegator) Handle(err error) {
+ if eh := d.delegate.Load(); eh != nil {
+ (*eh).Handle(err)
+ return
+ }
+ log.Print(err)
}
// setDelegate sets the ErrorHandler delegate.
func (d *ErrDelegator) setDelegate(eh ErrorHandler) {
d.delegate.Store(&eh)
}
-
-func defaultErrorHandler() *ErrDelegator {
- d := &ErrDelegator{}
- d.setDelegate(&ErrLogger{l: log.New(os.Stderr, "", log.LstdFlags)})
- return d
-}
-
-// ErrLogger logs errors if no delegate is set, otherwise they are delegated.
-type ErrLogger struct {
- l *log.Logger
-}
-
-// Handle logs err if no delegate is set, otherwise it is delegated.
-func (h *ErrLogger) Handle(err error) {
- h.l.Print(err)
-}
-
-// GetErrorHandler returns the global ErrorHandler instance.
-//
-// The default ErrorHandler instance returned will log all errors to STDERR
-// until an override ErrorHandler is set with SetErrorHandler. All
-// ErrorHandler returned prior to this will automatically forward errors to
-// the set instance instead of logging.
-//
-// Subsequent calls to SetErrorHandler after the first will not forward errors
-// to the new ErrorHandler for prior returned instances.
-func GetErrorHandler() ErrorHandler {
- return GlobalErrorHandler
-}
-
-// SetErrorHandler sets the global ErrorHandler to h.
-//
-// The first time this is called all ErrorHandler previously returned from
-// GetErrorHandler will send errors to h instead of the default logging
-// ErrorHandler. Subsequent calls will set the global ErrorHandler, but not
-// delegate errors to h.
-func SetErrorHandler(h ErrorHandler) {
- GlobalErrorHandler.setDelegate(h)
-}
-
-// Handle is a convenience function for ErrorHandler().Handle(err).
-func Handle(err error) {
- GetErrorHandler().Handle(err)
-}
diff --git a/vendor/go.opentelemetry.io/otel/internal/global/instruments.go b/vendor/go.opentelemetry.io/otel/internal/global/instruments.go
index ebb13c20..ae92a425 100644
--- a/vendor/go.opentelemetry.io/otel/internal/global/instruments.go
+++ b/vendor/go.opentelemetry.io/otel/internal/global/instruments.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package global // import "go.opentelemetry.io/otel/internal/global"
@@ -24,7 +13,7 @@ import (
// unwrapper unwraps to return the underlying instrument implementation.
type unwrapper interface {
- Unwrap() metric.Observable
+ unwrap() metric.Observable
}
type afCounter struct {
@@ -51,7 +40,7 @@ func (i *afCounter) setDelegate(m metric.Meter) {
i.delegate.Store(ctr)
}
-func (i *afCounter) Unwrap() metric.Observable {
+func (i *afCounter) unwrap() metric.Observable {
if ctr := i.delegate.Load(); ctr != nil {
return ctr.(metric.Float64ObservableCounter)
}
@@ -82,7 +71,7 @@ func (i *afUpDownCounter) setDelegate(m metric.Meter) {
i.delegate.Store(ctr)
}
-func (i *afUpDownCounter) Unwrap() metric.Observable {
+func (i *afUpDownCounter) unwrap() metric.Observable {
if ctr := i.delegate.Load(); ctr != nil {
return ctr.(metric.Float64ObservableUpDownCounter)
}
@@ -113,7 +102,7 @@ func (i *afGauge) setDelegate(m metric.Meter) {
i.delegate.Store(ctr)
}
-func (i *afGauge) Unwrap() metric.Observable {
+func (i *afGauge) unwrap() metric.Observable {
if ctr := i.delegate.Load(); ctr != nil {
return ctr.(metric.Float64ObservableGauge)
}
@@ -144,7 +133,7 @@ func (i *aiCounter) setDelegate(m metric.Meter) {
i.delegate.Store(ctr)
}
-func (i *aiCounter) Unwrap() metric.Observable {
+func (i *aiCounter) unwrap() metric.Observable {
if ctr := i.delegate.Load(); ctr != nil {
return ctr.(metric.Int64ObservableCounter)
}
@@ -175,7 +164,7 @@ func (i *aiUpDownCounter) setDelegate(m metric.Meter) {
i.delegate.Store(ctr)
}
-func (i *aiUpDownCounter) Unwrap() metric.Observable {
+func (i *aiUpDownCounter) unwrap() metric.Observable {
if ctr := i.delegate.Load(); ctr != nil {
return ctr.(metric.Int64ObservableUpDownCounter)
}
@@ -206,7 +195,7 @@ func (i *aiGauge) setDelegate(m metric.Meter) {
i.delegate.Store(ctr)
}
-func (i *aiGauge) Unwrap() metric.Observable {
+func (i *aiGauge) unwrap() metric.Observable {
if ctr := i.delegate.Load(); ctr != nil {
return ctr.(metric.Int64ObservableGauge)
}
@@ -292,6 +281,32 @@ func (i *sfHistogram) Record(ctx context.Context, x float64, opts ...metric.Reco
}
}
+type sfGauge struct {
+ embedded.Float64Gauge
+
+ name string
+ opts []metric.Float64GaugeOption
+
+ delegate atomic.Value // metric.Float64Gauge
+}
+
+var _ metric.Float64Gauge = (*sfGauge)(nil)
+
+func (i *sfGauge) setDelegate(m metric.Meter) {
+ ctr, err := m.Float64Gauge(i.name, i.opts...)
+ if err != nil {
+ GetErrorHandler().Handle(err)
+ return
+ }
+ i.delegate.Store(ctr)
+}
+
+func (i *sfGauge) Record(ctx context.Context, x float64, opts ...metric.RecordOption) {
+ if ctr := i.delegate.Load(); ctr != nil {
+ ctr.(metric.Float64Gauge).Record(ctx, x, opts...)
+ }
+}
+
type siCounter struct {
embedded.Int64Counter
@@ -369,3 +384,29 @@ func (i *siHistogram) Record(ctx context.Context, x int64, opts ...metric.Record
ctr.(metric.Int64Histogram).Record(ctx, x, opts...)
}
}
+
+type siGauge struct {
+ embedded.Int64Gauge
+
+ name string
+ opts []metric.Int64GaugeOption
+
+ delegate atomic.Value // metric.Int64Gauge
+}
+
+var _ metric.Int64Gauge = (*siGauge)(nil)
+
+func (i *siGauge) setDelegate(m metric.Meter) {
+ ctr, err := m.Int64Gauge(i.name, i.opts...)
+ if err != nil {
+ GetErrorHandler().Handle(err)
+ return
+ }
+ i.delegate.Store(ctr)
+}
+
+func (i *siGauge) Record(ctx context.Context, x int64, opts ...metric.RecordOption) {
+ if ctr := i.delegate.Load(); ctr != nil {
+ ctr.(metric.Int64Gauge).Record(ctx, x, opts...)
+ }
+}
diff --git a/vendor/go.opentelemetry.io/otel/internal/global/internal_logging.go b/vendor/go.opentelemetry.io/otel/internal/global/internal_logging.go
index c6f305a2..adbca7d3 100644
--- a/vendor/go.opentelemetry.io/otel/internal/global/internal_logging.go
+++ b/vendor/go.opentelemetry.io/otel/internal/global/internal_logging.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package global // import "go.opentelemetry.io/otel/internal/global"
@@ -23,17 +12,20 @@ import (
"github.com/go-logr/stdr"
)
-// globalLogger is the logging interface used within the otel api and sdk provide details of the internals.
+// globalLogger holds a reference to the [logr.Logger] used within
+// go.opentelemetry.io/otel.
//
// The default logger uses stdr which is backed by the standard `log.Logger`
// interface. This logger will only show messages at the Error Level.
-var globalLogger atomic.Pointer[logr.Logger]
+var globalLogger = func() *atomic.Pointer[logr.Logger] {
+ l := stdr.New(log.New(os.Stderr, "", log.LstdFlags|log.Lshortfile))
-func init() {
- SetLogger(stdr.New(log.New(os.Stderr, "", log.LstdFlags|log.Lshortfile)))
-}
+ p := new(atomic.Pointer[logr.Logger])
+ p.Store(&l)
+ return p
+}()
-// SetLogger overrides the globalLogger with l.
+// SetLogger sets the global Logger to l.
//
// To see Warn messages use a logger with `l.V(1).Enabled() == true`
// To see Info messages use a logger with `l.V(4).Enabled() == true`
@@ -42,28 +34,29 @@ func SetLogger(l logr.Logger) {
globalLogger.Store(&l)
}
-func getLogger() logr.Logger {
+// GetLogger returns the global logger.
+func GetLogger() logr.Logger {
return *globalLogger.Load()
}
// Info prints messages about the general state of the API or SDK.
// This should usually be less than 5 messages a minute.
func Info(msg string, keysAndValues ...interface{}) {
- getLogger().V(4).Info(msg, keysAndValues...)
+ GetLogger().V(4).Info(msg, keysAndValues...)
}
// Error prints messages about exceptional states of the API or SDK.
func Error(err error, msg string, keysAndValues ...interface{}) {
- getLogger().Error(err, msg, keysAndValues...)
+ GetLogger().Error(err, msg, keysAndValues...)
}
// Debug prints messages about all internal changes in the API or SDK.
func Debug(msg string, keysAndValues ...interface{}) {
- getLogger().V(8).Info(msg, keysAndValues...)
+ GetLogger().V(8).Info(msg, keysAndValues...)
}
// Warn prints messages about warnings in the API or SDK.
// Not an error but is likely more important than an informational event.
func Warn(msg string, keysAndValues ...interface{}) {
- getLogger().V(1).Info(msg, keysAndValues...)
+ GetLogger().V(1).Info(msg, keysAndValues...)
}
diff --git a/vendor/go.opentelemetry.io/otel/internal/global/meter.go b/vendor/go.opentelemetry.io/otel/internal/global/meter.go
index 0097db47..a6acd8dc 100644
--- a/vendor/go.opentelemetry.io/otel/internal/global/meter.go
+++ b/vendor/go.opentelemetry.io/otel/internal/global/meter.go
@@ -1,23 +1,13 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package global // import "go.opentelemetry.io/otel/internal/global"
import (
"container/list"
+ "context"
+ "reflect"
"sync"
- "sync/atomic"
"go.opentelemetry.io/otel/metric"
"go.opentelemetry.io/otel/metric/embedded"
@@ -76,6 +66,8 @@ func (p *meterProvider) Meter(name string, opts ...metric.MeterOption) metric.Me
key := il{
name: name,
version: c.InstrumentationVersion(),
+ schema: c.SchemaURL(),
+ attrs: c.InstrumentationAttributes(),
}
if p.meters == nil {
@@ -86,7 +78,7 @@ func (p *meterProvider) Meter(name string, opts ...metric.MeterOption) metric.Me
return val
}
- t := &meter{name: name, opts: opts}
+ t := &meter{name: name, opts: opts, instruments: make(map[instID]delegatedInstrument)}
p.meters[key] = t
return t
}
@@ -102,17 +94,29 @@ type meter struct {
opts []metric.MeterOption
mtx sync.Mutex
- instruments []delegatedInstrument
+ instruments map[instID]delegatedInstrument
registry list.List
- delegate atomic.Value // metric.Meter
+ delegate metric.Meter
}
type delegatedInstrument interface {
setDelegate(metric.Meter)
}
+// instID are the identifying properties of a instrument.
+type instID struct {
+ // name is the name of the stream.
+ name string
+ // description is the description of the stream.
+ description string
+ // kind defines the functional group of the instrument.
+ kind reflect.Type
+ // unit is the unit of the stream.
+ unit string
+}
+
// setDelegate configures m to delegate all Meter functionality to Meters
// created by provider.
//
@@ -120,19 +124,21 @@ type delegatedInstrument interface {
//
// It is guaranteed by the caller that this happens only once.
func (m *meter) setDelegate(provider metric.MeterProvider) {
- meter := provider.Meter(m.name, m.opts...)
- m.delegate.Store(meter)
-
m.mtx.Lock()
defer m.mtx.Unlock()
+ meter := provider.Meter(m.name, m.opts...)
+ m.delegate = meter
+
for _, inst := range m.instruments {
inst.setDelegate(meter)
}
- for e := m.registry.Front(); e != nil; e = e.Next() {
+ var n *list.Element
+ for e := m.registry.Front(); e != nil; e = n {
r := e.Value.(*registration)
r.setDelegate(meter)
+ n = e.Next()
m.registry.Remove(e)
}
@@ -141,147 +147,336 @@ func (m *meter) setDelegate(provider metric.MeterProvider) {
}
func (m *meter) Int64Counter(name string, options ...metric.Int64CounterOption) (metric.Int64Counter, error) {
- if del, ok := m.delegate.Load().(metric.Meter); ok {
- return del.Int64Counter(name, options...)
- }
m.mtx.Lock()
defer m.mtx.Unlock()
+
+ if m.delegate != nil {
+ return m.delegate.Int64Counter(name, options...)
+ }
+
+ cfg := metric.NewInt64CounterConfig(options...)
+ id := instID{
+ name: name,
+ kind: reflect.TypeOf((*siCounter)(nil)),
+ description: cfg.Description(),
+ unit: cfg.Unit(),
+ }
+ if f, ok := m.instruments[id]; ok {
+ return f.(metric.Int64Counter), nil
+ }
i := &siCounter{name: name, opts: options}
- m.instruments = append(m.instruments, i)
+ m.instruments[id] = i
return i, nil
}
func (m *meter) Int64UpDownCounter(name string, options ...metric.Int64UpDownCounterOption) (metric.Int64UpDownCounter, error) {
- if del, ok := m.delegate.Load().(metric.Meter); ok {
- return del.Int64UpDownCounter(name, options...)
- }
m.mtx.Lock()
defer m.mtx.Unlock()
+
+ if m.delegate != nil {
+ return m.delegate.Int64UpDownCounter(name, options...)
+ }
+
+ cfg := metric.NewInt64UpDownCounterConfig(options...)
+ id := instID{
+ name: name,
+ kind: reflect.TypeOf((*siUpDownCounter)(nil)),
+ description: cfg.Description(),
+ unit: cfg.Unit(),
+ }
+ if f, ok := m.instruments[id]; ok {
+ return f.(metric.Int64UpDownCounter), nil
+ }
i := &siUpDownCounter{name: name, opts: options}
- m.instruments = append(m.instruments, i)
+ m.instruments[id] = i
return i, nil
}
func (m *meter) Int64Histogram(name string, options ...metric.Int64HistogramOption) (metric.Int64Histogram, error) {
- if del, ok := m.delegate.Load().(metric.Meter); ok {
- return del.Int64Histogram(name, options...)
- }
m.mtx.Lock()
defer m.mtx.Unlock()
+
+ if m.delegate != nil {
+ return m.delegate.Int64Histogram(name, options...)
+ }
+
+ cfg := metric.NewInt64HistogramConfig(options...)
+ id := instID{
+ name: name,
+ kind: reflect.TypeOf((*siHistogram)(nil)),
+ description: cfg.Description(),
+ unit: cfg.Unit(),
+ }
+ if f, ok := m.instruments[id]; ok {
+ return f.(metric.Int64Histogram), nil
+ }
i := &siHistogram{name: name, opts: options}
- m.instruments = append(m.instruments, i)
+ m.instruments[id] = i
return i, nil
}
-func (m *meter) Int64ObservableCounter(name string, options ...metric.Int64ObservableCounterOption) (metric.Int64ObservableCounter, error) {
- if del, ok := m.delegate.Load().(metric.Meter); ok {
- return del.Int64ObservableCounter(name, options...)
+func (m *meter) Int64Gauge(name string, options ...metric.Int64GaugeOption) (metric.Int64Gauge, error) {
+ m.mtx.Lock()
+ defer m.mtx.Unlock()
+
+ if m.delegate != nil {
+ return m.delegate.Int64Gauge(name, options...)
}
+
+ cfg := metric.NewInt64GaugeConfig(options...)
+ id := instID{
+ name: name,
+ kind: reflect.TypeOf((*siGauge)(nil)),
+ description: cfg.Description(),
+ unit: cfg.Unit(),
+ }
+ if f, ok := m.instruments[id]; ok {
+ return f.(metric.Int64Gauge), nil
+ }
+ i := &siGauge{name: name, opts: options}
+ m.instruments[id] = i
+ return i, nil
+}
+
+func (m *meter) Int64ObservableCounter(name string, options ...metric.Int64ObservableCounterOption) (metric.Int64ObservableCounter, error) {
m.mtx.Lock()
defer m.mtx.Unlock()
+
+ if m.delegate != nil {
+ return m.delegate.Int64ObservableCounter(name, options...)
+ }
+
+ cfg := metric.NewInt64ObservableCounterConfig(options...)
+ id := instID{
+ name: name,
+ kind: reflect.TypeOf((*aiCounter)(nil)),
+ description: cfg.Description(),
+ unit: cfg.Unit(),
+ }
+ if f, ok := m.instruments[id]; ok {
+ return f.(metric.Int64ObservableCounter), nil
+ }
i := &aiCounter{name: name, opts: options}
- m.instruments = append(m.instruments, i)
+ m.instruments[id] = i
return i, nil
}
func (m *meter) Int64ObservableUpDownCounter(name string, options ...metric.Int64ObservableUpDownCounterOption) (metric.Int64ObservableUpDownCounter, error) {
- if del, ok := m.delegate.Load().(metric.Meter); ok {
- return del.Int64ObservableUpDownCounter(name, options...)
- }
m.mtx.Lock()
defer m.mtx.Unlock()
+
+ if m.delegate != nil {
+ return m.delegate.Int64ObservableUpDownCounter(name, options...)
+ }
+
+ cfg := metric.NewInt64ObservableUpDownCounterConfig(options...)
+ id := instID{
+ name: name,
+ kind: reflect.TypeOf((*aiUpDownCounter)(nil)),
+ description: cfg.Description(),
+ unit: cfg.Unit(),
+ }
+ if f, ok := m.instruments[id]; ok {
+ return f.(metric.Int64ObservableUpDownCounter), nil
+ }
i := &aiUpDownCounter{name: name, opts: options}
- m.instruments = append(m.instruments, i)
+ m.instruments[id] = i
return i, nil
}
func (m *meter) Int64ObservableGauge(name string, options ...metric.Int64ObservableGaugeOption) (metric.Int64ObservableGauge, error) {
- if del, ok := m.delegate.Load().(metric.Meter); ok {
- return del.Int64ObservableGauge(name, options...)
- }
m.mtx.Lock()
defer m.mtx.Unlock()
+
+ if m.delegate != nil {
+ return m.delegate.Int64ObservableGauge(name, options...)
+ }
+
+ cfg := metric.NewInt64ObservableGaugeConfig(options...)
+ id := instID{
+ name: name,
+ kind: reflect.TypeOf((*aiGauge)(nil)),
+ description: cfg.Description(),
+ unit: cfg.Unit(),
+ }
+ if f, ok := m.instruments[id]; ok {
+ return f.(metric.Int64ObservableGauge), nil
+ }
i := &aiGauge{name: name, opts: options}
- m.instruments = append(m.instruments, i)
+ m.instruments[id] = i
return i, nil
}
func (m *meter) Float64Counter(name string, options ...metric.Float64CounterOption) (metric.Float64Counter, error) {
- if del, ok := m.delegate.Load().(metric.Meter); ok {
- return del.Float64Counter(name, options...)
- }
m.mtx.Lock()
defer m.mtx.Unlock()
+
+ if m.delegate != nil {
+ return m.delegate.Float64Counter(name, options...)
+ }
+
+ cfg := metric.NewFloat64CounterConfig(options...)
+ id := instID{
+ name: name,
+ kind: reflect.TypeOf((*sfCounter)(nil)),
+ description: cfg.Description(),
+ unit: cfg.Unit(),
+ }
+ if f, ok := m.instruments[id]; ok {
+ return f.(metric.Float64Counter), nil
+ }
i := &sfCounter{name: name, opts: options}
- m.instruments = append(m.instruments, i)
+ m.instruments[id] = i
return i, nil
}
func (m *meter) Float64UpDownCounter(name string, options ...metric.Float64UpDownCounterOption) (metric.Float64UpDownCounter, error) {
- if del, ok := m.delegate.Load().(metric.Meter); ok {
- return del.Float64UpDownCounter(name, options...)
- }
m.mtx.Lock()
defer m.mtx.Unlock()
+
+ if m.delegate != nil {
+ return m.delegate.Float64UpDownCounter(name, options...)
+ }
+
+ cfg := metric.NewFloat64UpDownCounterConfig(options...)
+ id := instID{
+ name: name,
+ kind: reflect.TypeOf((*sfUpDownCounter)(nil)),
+ description: cfg.Description(),
+ unit: cfg.Unit(),
+ }
+ if f, ok := m.instruments[id]; ok {
+ return f.(metric.Float64UpDownCounter), nil
+ }
i := &sfUpDownCounter{name: name, opts: options}
- m.instruments = append(m.instruments, i)
+ m.instruments[id] = i
return i, nil
}
func (m *meter) Float64Histogram(name string, options ...metric.Float64HistogramOption) (metric.Float64Histogram, error) {
- if del, ok := m.delegate.Load().(metric.Meter); ok {
- return del.Float64Histogram(name, options...)
- }
m.mtx.Lock()
defer m.mtx.Unlock()
+
+ if m.delegate != nil {
+ return m.delegate.Float64Histogram(name, options...)
+ }
+
+ cfg := metric.NewFloat64HistogramConfig(options...)
+ id := instID{
+ name: name,
+ kind: reflect.TypeOf((*sfHistogram)(nil)),
+ description: cfg.Description(),
+ unit: cfg.Unit(),
+ }
+ if f, ok := m.instruments[id]; ok {
+ return f.(metric.Float64Histogram), nil
+ }
i := &sfHistogram{name: name, opts: options}
- m.instruments = append(m.instruments, i)
+ m.instruments[id] = i
return i, nil
}
-func (m *meter) Float64ObservableCounter(name string, options ...metric.Float64ObservableCounterOption) (metric.Float64ObservableCounter, error) {
- if del, ok := m.delegate.Load().(metric.Meter); ok {
- return del.Float64ObservableCounter(name, options...)
+func (m *meter) Float64Gauge(name string, options ...metric.Float64GaugeOption) (metric.Float64Gauge, error) {
+ m.mtx.Lock()
+ defer m.mtx.Unlock()
+
+ if m.delegate != nil {
+ return m.delegate.Float64Gauge(name, options...)
+ }
+
+ cfg := metric.NewFloat64GaugeConfig(options...)
+ id := instID{
+ name: name,
+ kind: reflect.TypeOf((*sfGauge)(nil)),
+ description: cfg.Description(),
+ unit: cfg.Unit(),
}
+ if f, ok := m.instruments[id]; ok {
+ return f.(metric.Float64Gauge), nil
+ }
+ i := &sfGauge{name: name, opts: options}
+ m.instruments[id] = i
+ return i, nil
+}
+
+func (m *meter) Float64ObservableCounter(name string, options ...metric.Float64ObservableCounterOption) (metric.Float64ObservableCounter, error) {
m.mtx.Lock()
defer m.mtx.Unlock()
+
+ if m.delegate != nil {
+ return m.delegate.Float64ObservableCounter(name, options...)
+ }
+
+ cfg := metric.NewFloat64ObservableCounterConfig(options...)
+ id := instID{
+ name: name,
+ kind: reflect.TypeOf((*afCounter)(nil)),
+ description: cfg.Description(),
+ unit: cfg.Unit(),
+ }
+ if f, ok := m.instruments[id]; ok {
+ return f.(metric.Float64ObservableCounter), nil
+ }
i := &afCounter{name: name, opts: options}
- m.instruments = append(m.instruments, i)
+ m.instruments[id] = i
return i, nil
}
func (m *meter) Float64ObservableUpDownCounter(name string, options ...metric.Float64ObservableUpDownCounterOption) (metric.Float64ObservableUpDownCounter, error) {
- if del, ok := m.delegate.Load().(metric.Meter); ok {
- return del.Float64ObservableUpDownCounter(name, options...)
- }
m.mtx.Lock()
defer m.mtx.Unlock()
+
+ if m.delegate != nil {
+ return m.delegate.Float64ObservableUpDownCounter(name, options...)
+ }
+
+ cfg := metric.NewFloat64ObservableUpDownCounterConfig(options...)
+ id := instID{
+ name: name,
+ kind: reflect.TypeOf((*afUpDownCounter)(nil)),
+ description: cfg.Description(),
+ unit: cfg.Unit(),
+ }
+ if f, ok := m.instruments[id]; ok {
+ return f.(metric.Float64ObservableUpDownCounter), nil
+ }
i := &afUpDownCounter{name: name, opts: options}
- m.instruments = append(m.instruments, i)
+ m.instruments[id] = i
return i, nil
}
func (m *meter) Float64ObservableGauge(name string, options ...metric.Float64ObservableGaugeOption) (metric.Float64ObservableGauge, error) {
- if del, ok := m.delegate.Load().(metric.Meter); ok {
- return del.Float64ObservableGauge(name, options...)
- }
m.mtx.Lock()
defer m.mtx.Unlock()
+
+ if m.delegate != nil {
+ return m.delegate.Float64ObservableGauge(name, options...)
+ }
+
+ cfg := metric.NewFloat64ObservableGaugeConfig(options...)
+ id := instID{
+ name: name,
+ kind: reflect.TypeOf((*afGauge)(nil)),
+ description: cfg.Description(),
+ unit: cfg.Unit(),
+ }
+ if f, ok := m.instruments[id]; ok {
+ return f.(metric.Float64ObservableGauge), nil
+ }
i := &afGauge{name: name, opts: options}
- m.instruments = append(m.instruments, i)
+ m.instruments[id] = i
return i, nil
}
// RegisterCallback captures the function that will be called during Collect.
func (m *meter) RegisterCallback(f metric.Callback, insts ...metric.Observable) (metric.Registration, error) {
- if del, ok := m.delegate.Load().(metric.Meter); ok {
- insts = unwrapInstruments(insts)
- return del.RegisterCallback(f, insts...)
- }
-
m.mtx.Lock()
defer m.mtx.Unlock()
+ if m.delegate != nil {
+ return m.delegate.RegisterCallback(unwrapCallback(f), unwrapInstruments(insts)...)
+ }
+
reg := ®istration{instruments: insts, function: f}
e := m.registry.PushBack(reg)
reg.unreg = func() error {
@@ -293,15 +488,11 @@ func (m *meter) RegisterCallback(f metric.Callback, insts ...metric.Observable)
return reg, nil
}
-type wrapped interface {
- unwrap() metric.Observable
-}
-
func unwrapInstruments(instruments []metric.Observable) []metric.Observable {
out := make([]metric.Observable, 0, len(instruments))
for _, inst := range instruments {
- if in, ok := inst.(wrapped); ok {
+ if in, ok := inst.(unwrapper); ok {
out = append(out, in.unwrap())
} else {
out = append(out, inst)
@@ -321,9 +512,61 @@ type registration struct {
unregMu sync.Mutex
}
-func (c *registration) setDelegate(m metric.Meter) {
- insts := unwrapInstruments(c.instruments)
+type unwrapObs struct {
+ embedded.Observer
+ obs metric.Observer
+}
+// unwrapFloat64Observable returns an expected metric.Float64Observable after
+// unwrapping the global object.
+func unwrapFloat64Observable(inst metric.Float64Observable) metric.Float64Observable {
+ if unwrapped, ok := inst.(unwrapper); ok {
+ if floatObs, ok := unwrapped.unwrap().(metric.Float64Observable); ok {
+ // Note: if the unwrapped object does not
+ // unwrap as an observable for either of the
+ // predicates here, it means an internal bug in
+ // this package. We avoid logging an error in
+ // this case, because the SDK has to try its
+ // own type conversion on the object. The SDK
+ // will see this and be forced to respond with
+ // its own error.
+ //
+ // This code uses a double-nested if statement
+ // to avoid creating a branch that is
+ // impossible to cover.
+ inst = floatObs
+ }
+ }
+ return inst
+}
+
+// unwrapInt64Observable returns an expected metric.Int64Observable after
+// unwrapping the global object.
+func unwrapInt64Observable(inst metric.Int64Observable) metric.Int64Observable {
+ if unwrapped, ok := inst.(unwrapper); ok {
+ if unint, ok := unwrapped.unwrap().(metric.Int64Observable); ok {
+ // See the comment in unwrapFloat64Observable().
+ inst = unint
+ }
+ }
+ return inst
+}
+
+func (uo *unwrapObs) ObserveFloat64(inst metric.Float64Observable, value float64, opts ...metric.ObserveOption) {
+ uo.obs.ObserveFloat64(unwrapFloat64Observable(inst), value, opts...)
+}
+
+func (uo *unwrapObs) ObserveInt64(inst metric.Int64Observable, value int64, opts ...metric.ObserveOption) {
+ uo.obs.ObserveInt64(unwrapInt64Observable(inst), value, opts...)
+}
+
+func unwrapCallback(f metric.Callback) metric.Callback {
+ return func(ctx context.Context, obs metric.Observer) error {
+ return f(ctx, &unwrapObs{obs: obs})
+ }
+}
+
+func (c *registration) setDelegate(m metric.Meter) {
c.unregMu.Lock()
defer c.unregMu.Unlock()
@@ -332,9 +575,10 @@ func (c *registration) setDelegate(m metric.Meter) {
return
}
- reg, err := m.RegisterCallback(c.function, insts...)
+ reg, err := m.RegisterCallback(unwrapCallback(c.function), unwrapInstruments(c.instruments)...)
if err != nil {
GetErrorHandler().Handle(err)
+ return
}
c.unreg = reg.Unregister
diff --git a/vendor/go.opentelemetry.io/otel/internal/global/propagator.go b/vendor/go.opentelemetry.io/otel/internal/global/propagator.go
index 06bac35c..38560ff9 100644
--- a/vendor/go.opentelemetry.io/otel/internal/global/propagator.go
+++ b/vendor/go.opentelemetry.io/otel/internal/global/propagator.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package global // import "go.opentelemetry.io/otel/internal/global"
diff --git a/vendor/go.opentelemetry.io/otel/internal/global/state.go b/vendor/go.opentelemetry.io/otel/internal/global/state.go
index 7985005b..204ea142 100644
--- a/vendor/go.opentelemetry.io/otel/internal/global/state.go
+++ b/vendor/go.opentelemetry.io/otel/internal/global/state.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package global // import "go.opentelemetry.io/otel/internal/global"
@@ -25,6 +14,10 @@ import (
)
type (
+ errorHandlerHolder struct {
+ eh ErrorHandler
+ }
+
tracerProviderHolder struct {
tp trace.TracerProvider
}
@@ -39,15 +32,59 @@ type (
)
var (
+ globalErrorHandler = defaultErrorHandler()
globalTracer = defaultTracerValue()
globalPropagators = defaultPropagatorsValue()
globalMeterProvider = defaultMeterProvider()
+ delegateErrorHandlerOnce sync.Once
delegateTraceOnce sync.Once
delegateTextMapPropagatorOnce sync.Once
delegateMeterOnce sync.Once
)
+// GetErrorHandler returns the global ErrorHandler instance.
+//
+// The default ErrorHandler instance returned will log all errors to STDERR
+// until an override ErrorHandler is set with SetErrorHandler. All
+// ErrorHandler returned prior to this will automatically forward errors to
+// the set instance instead of logging.
+//
+// Subsequent calls to SetErrorHandler after the first will not forward errors
+// to the new ErrorHandler for prior returned instances.
+func GetErrorHandler() ErrorHandler {
+ return globalErrorHandler.Load().(errorHandlerHolder).eh
+}
+
+// SetErrorHandler sets the global ErrorHandler to h.
+//
+// The first time this is called all ErrorHandler previously returned from
+// GetErrorHandler will send errors to h instead of the default logging
+// ErrorHandler. Subsequent calls will set the global ErrorHandler, but not
+// delegate errors to h.
+func SetErrorHandler(h ErrorHandler) {
+ current := GetErrorHandler()
+
+ if _, cOk := current.(*ErrDelegator); cOk {
+ if _, ehOk := h.(*ErrDelegator); ehOk && current == h {
+ // Do not assign to the delegate of the default ErrDelegator to be
+ // itself.
+ Error(
+ errors.New("no ErrorHandler delegate configured"),
+ "ErrorHandler remains its current value.",
+ )
+ return
+ }
+ }
+
+ delegateErrorHandlerOnce.Do(func() {
+ if def, ok := current.(*ErrDelegator); ok {
+ def.setDelegate(h)
+ }
+ })
+ globalErrorHandler.Store(errorHandlerHolder{eh: h})
+}
+
// TracerProvider is the internal implementation for global.TracerProvider.
func TracerProvider() trace.TracerProvider {
return globalTracer.Load().(tracerProviderHolder).tp
@@ -63,7 +100,7 @@ func SetTracerProvider(tp trace.TracerProvider) {
// to itself.
Error(
errors.New("no delegate configured in tracer provider"),
- "Setting tracer provider to it's current value. No delegate will be configured",
+ "Setting tracer provider to its current value. No delegate will be configured",
)
return
}
@@ -92,7 +129,7 @@ func SetTextMapPropagator(p propagation.TextMapPropagator) {
// delegate to itself.
Error(
errors.New("no delegate configured in text map propagator"),
- "Setting text map propagator to it's current value. No delegate will be configured",
+ "Setting text map propagator to its current value. No delegate will be configured",
)
return
}
@@ -123,7 +160,7 @@ func SetMeterProvider(mp metric.MeterProvider) {
// to itself.
Error(
errors.New("no delegate configured in meter provider"),
- "Setting meter provider to it's current value. No delegate will be configured",
+ "Setting meter provider to its current value. No delegate will be configured",
)
return
}
@@ -137,6 +174,12 @@ func SetMeterProvider(mp metric.MeterProvider) {
globalMeterProvider.Store(meterProviderHolder{mp: mp})
}
+func defaultErrorHandler() *atomic.Value {
+ v := &atomic.Value{}
+ v.Store(errorHandlerHolder{eh: &ErrDelegator{}})
+ return v
+}
+
func defaultTracerValue() *atomic.Value {
v := &atomic.Value{}
v.Store(tracerProviderHolder{tp: &tracerProvider{}})
diff --git a/vendor/go.opentelemetry.io/otel/internal/global/trace.go b/vendor/go.opentelemetry.io/otel/internal/global/trace.go
index 3f61ec12..ac65262c 100644
--- a/vendor/go.opentelemetry.io/otel/internal/global/trace.go
+++ b/vendor/go.opentelemetry.io/otel/internal/global/trace.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package global // import "go.opentelemetry.io/otel/internal/global"
@@ -97,6 +86,8 @@ func (p *tracerProvider) Tracer(name string, opts ...trace.TracerOption) trace.T
key := il{
name: name,
version: c.InstrumentationVersion(),
+ schema: c.SchemaURL(),
+ attrs: c.InstrumentationAttributes(),
}
if p.tracers == nil {
@@ -115,6 +106,8 @@ func (p *tracerProvider) Tracer(name string, opts ...trace.TracerOption) trace.T
type il struct {
name string
version string
+ schema string
+ attrs attribute.Set
}
// tracer is a placeholder for a trace.Tracer.
@@ -193,6 +186,9 @@ func (nonRecordingSpan) RecordError(error, ...trace.EventOption) {}
// AddEvent does nothing.
func (nonRecordingSpan) AddEvent(string, ...trace.EventOption) {}
+// AddLink does nothing.
+func (nonRecordingSpan) AddLink(trace.Link) {}
+
// SetName does nothing.
func (nonRecordingSpan) SetName(string) {}
diff --git a/vendor/go.opentelemetry.io/otel/internal/rawhelpers.go b/vendor/go.opentelemetry.io/otel/internal/rawhelpers.go
index e07e7940..b2fe3e41 100644
--- a/vendor/go.opentelemetry.io/otel/internal/rawhelpers.go
+++ b/vendor/go.opentelemetry.io/otel/internal/rawhelpers.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package internal // import "go.opentelemetry.io/otel/internal"
@@ -31,11 +20,13 @@ func RawToBool(r uint64) bool {
}
func Int64ToRaw(i int64) uint64 {
- return uint64(i)
+ // Assumes original was a valid int64 (overflow not checked).
+ return uint64(i) // nolint: gosec
}
func RawToInt64(r uint64) int64 {
- return int64(r)
+ // Assumes original was a valid int64 (overflow not checked).
+ return int64(r) // nolint: gosec
}
func Float64ToRaw(f float64) uint64 {
@@ -47,9 +38,11 @@ func RawToFloat64(r uint64) float64 {
}
func RawPtrToFloat64Ptr(r *uint64) *float64 {
- return (*float64)(unsafe.Pointer(r))
+ // Assumes original was a valid *float64 (overflow not checked).
+ return (*float64)(unsafe.Pointer(r)) // nolint: gosec
}
func RawPtrToInt64Ptr(r *uint64) *int64 {
- return (*int64)(unsafe.Pointer(r))
+ // Assumes original was a valid *int64 (overflow not checked).
+ return (*int64)(unsafe.Pointer(r)) // nolint: gosec
}
diff --git a/vendor/go.opentelemetry.io/otel/internal_logging.go b/vendor/go.opentelemetry.io/otel/internal_logging.go
index c4f8acd5..6de7f2e4 100644
--- a/vendor/go.opentelemetry.io/otel/internal_logging.go
+++ b/vendor/go.opentelemetry.io/otel/internal_logging.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package otel // import "go.opentelemetry.io/otel"
diff --git a/vendor/go.opentelemetry.io/otel/metric.go b/vendor/go.opentelemetry.io/otel/metric.go
index f9551719..1e6473b3 100644
--- a/vendor/go.opentelemetry.io/otel/metric.go
+++ b/vendor/go.opentelemetry.io/otel/metric.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package otel // import "go.opentelemetry.io/otel"
diff --git a/vendor/go.opentelemetry.io/otel/metric/README.md b/vendor/go.opentelemetry.io/otel/metric/README.md
new file mode 100644
index 00000000..0cf902e0
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/metric/README.md
@@ -0,0 +1,3 @@
+# Metric API
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/metric)](https://pkg.go.dev/go.opentelemetry.io/otel/metric)
diff --git a/vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go b/vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go
index 072baa8e..f8435d8f 100644
--- a/vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go
+++ b/vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package metric // import "go.opentelemetry.io/otel/metric"
@@ -50,7 +39,7 @@ type Float64ObservableCounter interface {
}
// Float64ObservableCounterConfig contains options for asynchronous counter
-// instruments that record int64 values.
+// instruments that record float64 values.
type Float64ObservableCounterConfig struct {
description string
unit string
@@ -108,7 +97,7 @@ type Float64ObservableUpDownCounter interface {
}
// Float64ObservableUpDownCounterConfig contains options for asynchronous
-// counter instruments that record int64 values.
+// counter instruments that record float64 values.
type Float64ObservableUpDownCounterConfig struct {
description string
unit string
@@ -165,7 +154,7 @@ type Float64ObservableGauge interface {
}
// Float64ObservableGaugeConfig contains options for asynchronous counter
-// instruments that record int64 values.
+// instruments that record float64 values.
type Float64ObservableGaugeConfig struct {
description string
unit string
@@ -224,7 +213,7 @@ type Float64Observer interface {
}
// Float64Callback is a function registered with a Meter that makes
-// observations for a Float64Observerable instrument it is registered with.
+// observations for a Float64Observable instrument it is registered with.
// Calls to the Float64Observer record measurement values for the
// Float64Observable.
//
diff --git a/vendor/go.opentelemetry.io/otel/metric/asyncint64.go b/vendor/go.opentelemetry.io/otel/metric/asyncint64.go
index 9bd6ebf0..e079aaef 100644
--- a/vendor/go.opentelemetry.io/otel/metric/asyncint64.go
+++ b/vendor/go.opentelemetry.io/otel/metric/asyncint64.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package metric // import "go.opentelemetry.io/otel/metric"
@@ -223,7 +212,7 @@ type Int64Observer interface {
}
// Int64Callback is a function registered with a Meter that makes observations
-// for an Int64Observerable instrument it is registered with. Calls to the
+// for an Int64Observable instrument it is registered with. Calls to the
// Int64Observer record measurement values for the Int64Observable.
//
// The function needs to complete in a finite amount of time and the deadline
diff --git a/vendor/go.opentelemetry.io/otel/metric/config.go b/vendor/go.opentelemetry.io/otel/metric/config.go
index 778ad2d7..d9e3b13e 100644
--- a/vendor/go.opentelemetry.io/otel/metric/config.go
+++ b/vendor/go.opentelemetry.io/otel/metric/config.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package metric // import "go.opentelemetry.io/otel/metric"
diff --git a/vendor/go.opentelemetry.io/otel/metric/doc.go b/vendor/go.opentelemetry.io/otel/metric/doc.go
index 54716e13..f153745b 100644
--- a/vendor/go.opentelemetry.io/otel/metric/doc.go
+++ b/vendor/go.opentelemetry.io/otel/metric/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
/*
Package metric provides the OpenTelemetry API used to measure metrics about
@@ -68,6 +57,23 @@ asynchronous measurement, a Gauge ([Int64ObservableGauge] and
See the [OpenTelemetry documentation] for more information about instruments
and their intended use.
+# Instrument Name
+
+OpenTelemetry defines an [instrument name syntax] that restricts what
+instrument names are allowed.
+
+Instrument names should ...
+
+ - Not be empty.
+ - Have an alphabetic character as their first letter.
+ - Have any letter after the first be an alphanumeric character, ‘_’, ‘.’,
+ ‘-’, or ‘/’.
+ - Have a maximum length of 255 letters.
+
+To ensure compatibility with observability platforms, all instruments created
+need to conform to this syntax. Not all implementations of the API will validate
+these names, it is the callers responsibility to ensure compliance.
+
# Measurements
Measurements are made by recording values and information about the values with
@@ -164,6 +170,7 @@ It is strongly recommended that authors only embed
That implementation is the only one OpenTelemetry authors can guarantee will
fully implement all the API interfaces when a user updates their API.
+[instrument name syntax]: https://opentelemetry.io/docs/specs/otel/metrics/api/#instrument-name-syntax
[OpenTelemetry documentation]: https://opentelemetry.io/docs/concepts/signals/metrics/
[GetMeterProvider]: https://pkg.go.dev/go.opentelemetry.io/otel#GetMeterProvider
*/
diff --git a/vendor/go.opentelemetry.io/otel/metric/embedded/README.md b/vendor/go.opentelemetry.io/otel/metric/embedded/README.md
new file mode 100644
index 00000000..1f6e0efa
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/metric/embedded/README.md
@@ -0,0 +1,3 @@
+# Metric Embedded
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/metric/embedded)](https://pkg.go.dev/go.opentelemetry.io/otel/metric/embedded)
diff --git a/vendor/go.opentelemetry.io/otel/metric/embedded/embedded.go b/vendor/go.opentelemetry.io/otel/metric/embedded/embedded.go
index ae0bdbd2..1a9dc680 100644
--- a/vendor/go.opentelemetry.io/otel/metric/embedded/embedded.go
+++ b/vendor/go.opentelemetry.io/otel/metric/embedded/embedded.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
// Package embedded provides interfaces embedded within the [OpenTelemetry
// metric API].
@@ -113,6 +102,16 @@ type Float64Counter interface{ float64Counter() }
// the API package).
type Float64Histogram interface{ float64Histogram() }
+// Float64Gauge is embedded in [go.opentelemetry.io/otel/metric.Float64Gauge].
+//
+// Embed this interface in your implementation of the
+// [go.opentelemetry.io/otel/metric.Float64Gauge] if you want users to
+// experience a compilation error, signaling they need to update to your latest
+// implementation, when the [go.opentelemetry.io/otel/metric.Float64Gauge]
+// interface is extended (which is something that can happen without a major
+// version bump of the API package).
+type Float64Gauge interface{ float64Gauge() }
+
// Float64ObservableCounter is embedded in
// [go.opentelemetry.io/otel/metric.Float64ObservableCounter].
//
@@ -185,6 +184,16 @@ type Int64Counter interface{ int64Counter() }
// the API package).
type Int64Histogram interface{ int64Histogram() }
+// Int64Gauge is embedded in [go.opentelemetry.io/otel/metric.Int64Gauge].
+//
+// Embed this interface in your implementation of the
+// [go.opentelemetry.io/otel/metric.Int64Gauge] if you want users to experience
+// a compilation error, signaling they need to update to your latest
+// implementation, when the [go.opentelemetry.io/otel/metric.Int64Gauge]
+// interface is extended (which is something that can happen without a major
+// version bump of the API package).
+type Int64Gauge interface{ int64Gauge() }
+
// Int64ObservableCounter is embedded in
// [go.opentelemetry.io/otel/metric.Int64ObservableCounter].
//
diff --git a/vendor/go.opentelemetry.io/otel/metric/instrument.go b/vendor/go.opentelemetry.io/otel/metric/instrument.go
index be89cd53..a535782e 100644
--- a/vendor/go.opentelemetry.io/otel/metric/instrument.go
+++ b/vendor/go.opentelemetry.io/otel/metric/instrument.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package metric // import "go.opentelemetry.io/otel/metric"
@@ -27,6 +16,7 @@ type InstrumentOption interface {
Int64CounterOption
Int64UpDownCounterOption
Int64HistogramOption
+ Int64GaugeOption
Int64ObservableCounterOption
Int64ObservableUpDownCounterOption
Int64ObservableGaugeOption
@@ -34,6 +24,7 @@ type InstrumentOption interface {
Float64CounterOption
Float64UpDownCounterOption
Float64HistogramOption
+ Float64GaugeOption
Float64ObservableCounterOption
Float64ObservableUpDownCounterOption
Float64ObservableGaugeOption
@@ -62,6 +53,11 @@ func (o descOpt) applyFloat64Histogram(c Float64HistogramConfig) Float64Histogra
return c
}
+func (o descOpt) applyFloat64Gauge(c Float64GaugeConfig) Float64GaugeConfig {
+ c.description = string(o)
+ return c
+}
+
func (o descOpt) applyFloat64ObservableCounter(c Float64ObservableCounterConfig) Float64ObservableCounterConfig {
c.description = string(o)
return c
@@ -92,6 +88,11 @@ func (o descOpt) applyInt64Histogram(c Int64HistogramConfig) Int64HistogramConfi
return c
}
+func (o descOpt) applyInt64Gauge(c Int64GaugeConfig) Int64GaugeConfig {
+ c.description = string(o)
+ return c
+}
+
func (o descOpt) applyInt64ObservableCounter(c Int64ObservableCounterConfig) Int64ObservableCounterConfig {
c.description = string(o)
return c
@@ -127,6 +128,11 @@ func (o unitOpt) applyFloat64Histogram(c Float64HistogramConfig) Float64Histogra
return c
}
+func (o unitOpt) applyFloat64Gauge(c Float64GaugeConfig) Float64GaugeConfig {
+ c.unit = string(o)
+ return c
+}
+
func (o unitOpt) applyFloat64ObservableCounter(c Float64ObservableCounterConfig) Float64ObservableCounterConfig {
c.unit = string(o)
return c
@@ -157,6 +163,11 @@ func (o unitOpt) applyInt64Histogram(c Int64HistogramConfig) Int64HistogramConfi
return c
}
+func (o unitOpt) applyInt64Gauge(c Int64GaugeConfig) Int64GaugeConfig {
+ c.unit = string(o)
+ return c
+}
+
func (o unitOpt) applyInt64ObservableCounter(c Int64ObservableCounterConfig) Int64ObservableCounterConfig {
c.unit = string(o)
return c
@@ -340,7 +351,7 @@ func WithAttributeSet(attributes attribute.Set) MeasurementOption {
//
// cp := make([]attribute.KeyValue, len(attributes))
// copy(cp, attributes)
-// WithAttributes(attribute.NewSet(cp...))
+// WithAttributeSet(attribute.NewSet(cp...))
//
// [attribute.NewSet] may modify the passed attributes so this will make a copy
// of attributes before creating a set in order to ensure this function is
diff --git a/vendor/go.opentelemetry.io/otel/metric/meter.go b/vendor/go.opentelemetry.io/otel/metric/meter.go
index 2520bc74..14e08c24 100644
--- a/vendor/go.opentelemetry.io/otel/metric/meter.go
+++ b/vendor/go.opentelemetry.io/otel/metric/meter.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package metric // import "go.opentelemetry.io/otel/metric"
@@ -58,17 +47,41 @@ type Meter interface {
// Int64Counter returns a new Int64Counter instrument identified by name
// and configured with options. The instrument is used to synchronously
// record increasing int64 measurements during a computational operation.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
Int64Counter(name string, options ...Int64CounterOption) (Int64Counter, error)
+
// Int64UpDownCounter returns a new Int64UpDownCounter instrument
// identified by name and configured with options. The instrument is used
// to synchronously record int64 measurements during a computational
// operation.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
Int64UpDownCounter(name string, options ...Int64UpDownCounterOption) (Int64UpDownCounter, error)
+
// Int64Histogram returns a new Int64Histogram instrument identified by
// name and configured with options. The instrument is used to
// synchronously record the distribution of int64 measurements during a
// computational operation.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
Int64Histogram(name string, options ...Int64HistogramOption) (Int64Histogram, error)
+
+ // Int64Gauge returns a new Int64Gauge instrument identified by name and
+ // configured with options. The instrument is used to synchronously record
+ // instantaneous int64 measurements during a computational operation.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
+ Int64Gauge(name string, options ...Int64GaugeOption) (Int64Gauge, error)
+
// Int64ObservableCounter returns a new Int64ObservableCounter identified
// by name and configured with options. The instrument is used to
// asynchronously record increasing int64 measurements once per a
@@ -78,7 +91,12 @@ type Meter interface {
// the WithInt64Callback option to register the callback here, or use the
// RegisterCallback method of this Meter to register one later. See the
// Measurements section of the package documentation for more information.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
Int64ObservableCounter(name string, options ...Int64ObservableCounterOption) (Int64ObservableCounter, error)
+
// Int64ObservableUpDownCounter returns a new Int64ObservableUpDownCounter
// instrument identified by name and configured with options. The
// instrument is used to asynchronously record int64 measurements once per
@@ -88,7 +106,12 @@ type Meter interface {
// the WithInt64Callback option to register the callback here, or use the
// RegisterCallback method of this Meter to register one later. See the
// Measurements section of the package documentation for more information.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
Int64ObservableUpDownCounter(name string, options ...Int64ObservableUpDownCounterOption) (Int64ObservableUpDownCounter, error)
+
// Int64ObservableGauge returns a new Int64ObservableGauge instrument
// identified by name and configured with options. The instrument is used
// to asynchronously record instantaneous int64 measurements once per a
@@ -98,23 +121,51 @@ type Meter interface {
// the WithInt64Callback option to register the callback here, or use the
// RegisterCallback method of this Meter to register one later. See the
// Measurements section of the package documentation for more information.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
Int64ObservableGauge(name string, options ...Int64ObservableGaugeOption) (Int64ObservableGauge, error)
// Float64Counter returns a new Float64Counter instrument identified by
// name and configured with options. The instrument is used to
// synchronously record increasing float64 measurements during a
// computational operation.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
Float64Counter(name string, options ...Float64CounterOption) (Float64Counter, error)
+
// Float64UpDownCounter returns a new Float64UpDownCounter instrument
// identified by name and configured with options. The instrument is used
// to synchronously record float64 measurements during a computational
// operation.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
Float64UpDownCounter(name string, options ...Float64UpDownCounterOption) (Float64UpDownCounter, error)
+
// Float64Histogram returns a new Float64Histogram instrument identified by
// name and configured with options. The instrument is used to
// synchronously record the distribution of float64 measurements during a
// computational operation.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
Float64Histogram(name string, options ...Float64HistogramOption) (Float64Histogram, error)
+
+ // Float64Gauge returns a new Float64Gauge instrument identified by name and
+ // configured with options. The instrument is used to synchronously record
+ // instantaneous float64 measurements during a computational operation.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
+ Float64Gauge(name string, options ...Float64GaugeOption) (Float64Gauge, error)
+
// Float64ObservableCounter returns a new Float64ObservableCounter
// instrument identified by name and configured with options. The
// instrument is used to asynchronously record increasing float64
@@ -124,7 +175,12 @@ type Meter interface {
// the WithFloat64Callback option to register the callback here, or use the
// RegisterCallback method of this Meter to register one later. See the
// Measurements section of the package documentation for more information.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
Float64ObservableCounter(name string, options ...Float64ObservableCounterOption) (Float64ObservableCounter, error)
+
// Float64ObservableUpDownCounter returns a new
// Float64ObservableUpDownCounter instrument identified by name and
// configured with options. The instrument is used to asynchronously record
@@ -134,7 +190,12 @@ type Meter interface {
// the WithFloat64Callback option to register the callback here, or use the
// RegisterCallback method of this Meter to register one later. See the
// Measurements section of the package documentation for more information.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
Float64ObservableUpDownCounter(name string, options ...Float64ObservableUpDownCounterOption) (Float64ObservableUpDownCounter, error)
+
// Float64ObservableGauge returns a new Float64ObservableGauge instrument
// identified by name and configured with options. The instrument is used
// to asynchronously record instantaneous float64 measurements once per a
@@ -144,6 +205,10 @@ type Meter interface {
// the WithFloat64Callback option to register the callback here, or use the
// RegisterCallback method of this Meter to register one later. See the
// Measurements section of the package documentation for more information.
+ //
+ // The name needs to conform to the OpenTelemetry instrument name syntax.
+ // See the Instrument Name section of the package documentation for more
+ // information.
Float64ObservableGauge(name string, options ...Float64ObservableGaugeOption) (Float64ObservableGauge, error)
// RegisterCallback registers f to be called during the collection of a
@@ -189,6 +254,7 @@ type Observer interface {
// ObserveFloat64 records the float64 value for obsrv.
ObserveFloat64(obsrv Float64Observable, value float64, opts ...ObserveOption)
+
// ObserveInt64 records the int64 value for obsrv.
ObserveInt64(obsrv Int64Observable, value int64, opts ...ObserveOption)
}
diff --git a/vendor/go.opentelemetry.io/otel/metric/noop/README.md b/vendor/go.opentelemetry.io/otel/metric/noop/README.md
new file mode 100644
index 00000000..bb896943
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/metric/noop/README.md
@@ -0,0 +1,3 @@
+# Metric Noop
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/metric/noop)](https://pkg.go.dev/go.opentelemetry.io/otel/metric/noop)
diff --git a/vendor/go.opentelemetry.io/otel/metric/noop/noop.go b/vendor/go.opentelemetry.io/otel/metric/noop/noop.go
new file mode 100644
index 00000000..ca6fcbdc
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/metric/noop/noop.go
@@ -0,0 +1,281 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Package noop provides an implementation of the OpenTelemetry metric API that
+// produces no telemetry and minimizes used computation resources.
+//
+// Using this package to implement the OpenTelemetry metric API will
+// effectively disable OpenTelemetry.
+//
+// This implementation can be embedded in other implementations of the
+// OpenTelemetry metric API. Doing so will mean the implementation defaults to
+// no operation for methods it does not implement.
+package noop // import "go.opentelemetry.io/otel/metric/noop"
+
+import (
+ "context"
+
+ "go.opentelemetry.io/otel/metric"
+ "go.opentelemetry.io/otel/metric/embedded"
+)
+
+var (
+ // Compile-time check this implements the OpenTelemetry API.
+
+ _ metric.MeterProvider = MeterProvider{}
+ _ metric.Meter = Meter{}
+ _ metric.Observer = Observer{}
+ _ metric.Registration = Registration{}
+ _ metric.Int64Counter = Int64Counter{}
+ _ metric.Float64Counter = Float64Counter{}
+ _ metric.Int64UpDownCounter = Int64UpDownCounter{}
+ _ metric.Float64UpDownCounter = Float64UpDownCounter{}
+ _ metric.Int64Histogram = Int64Histogram{}
+ _ metric.Float64Histogram = Float64Histogram{}
+ _ metric.Int64Gauge = Int64Gauge{}
+ _ metric.Float64Gauge = Float64Gauge{}
+ _ metric.Int64ObservableCounter = Int64ObservableCounter{}
+ _ metric.Float64ObservableCounter = Float64ObservableCounter{}
+ _ metric.Int64ObservableGauge = Int64ObservableGauge{}
+ _ metric.Float64ObservableGauge = Float64ObservableGauge{}
+ _ metric.Int64ObservableUpDownCounter = Int64ObservableUpDownCounter{}
+ _ metric.Float64ObservableUpDownCounter = Float64ObservableUpDownCounter{}
+ _ metric.Int64Observer = Int64Observer{}
+ _ metric.Float64Observer = Float64Observer{}
+)
+
+// MeterProvider is an OpenTelemetry No-Op MeterProvider.
+type MeterProvider struct{ embedded.MeterProvider }
+
+// NewMeterProvider returns a MeterProvider that does not record any telemetry.
+func NewMeterProvider() MeterProvider {
+ return MeterProvider{}
+}
+
+// Meter returns an OpenTelemetry Meter that does not record any telemetry.
+func (MeterProvider) Meter(string, ...metric.MeterOption) metric.Meter {
+ return Meter{}
+}
+
+// Meter is an OpenTelemetry No-Op Meter.
+type Meter struct{ embedded.Meter }
+
+// Int64Counter returns a Counter used to record int64 measurements that
+// produces no telemetry.
+func (Meter) Int64Counter(string, ...metric.Int64CounterOption) (metric.Int64Counter, error) {
+ return Int64Counter{}, nil
+}
+
+// Int64UpDownCounter returns an UpDownCounter used to record int64
+// measurements that produces no telemetry.
+func (Meter) Int64UpDownCounter(string, ...metric.Int64UpDownCounterOption) (metric.Int64UpDownCounter, error) {
+ return Int64UpDownCounter{}, nil
+}
+
+// Int64Histogram returns a Histogram used to record int64 measurements that
+// produces no telemetry.
+func (Meter) Int64Histogram(string, ...metric.Int64HistogramOption) (metric.Int64Histogram, error) {
+ return Int64Histogram{}, nil
+}
+
+// Int64Gauge returns a Gauge used to record int64 measurements that
+// produces no telemetry.
+func (Meter) Int64Gauge(string, ...metric.Int64GaugeOption) (metric.Int64Gauge, error) {
+ return Int64Gauge{}, nil
+}
+
+// Int64ObservableCounter returns an ObservableCounter used to record int64
+// measurements that produces no telemetry.
+func (Meter) Int64ObservableCounter(string, ...metric.Int64ObservableCounterOption) (metric.Int64ObservableCounter, error) {
+ return Int64ObservableCounter{}, nil
+}
+
+// Int64ObservableUpDownCounter returns an ObservableUpDownCounter used to
+// record int64 measurements that produces no telemetry.
+func (Meter) Int64ObservableUpDownCounter(string, ...metric.Int64ObservableUpDownCounterOption) (metric.Int64ObservableUpDownCounter, error) {
+ return Int64ObservableUpDownCounter{}, nil
+}
+
+// Int64ObservableGauge returns an ObservableGauge used to record int64
+// measurements that produces no telemetry.
+func (Meter) Int64ObservableGauge(string, ...metric.Int64ObservableGaugeOption) (metric.Int64ObservableGauge, error) {
+ return Int64ObservableGauge{}, nil
+}
+
+// Float64Counter returns a Counter used to record int64 measurements that
+// produces no telemetry.
+func (Meter) Float64Counter(string, ...metric.Float64CounterOption) (metric.Float64Counter, error) {
+ return Float64Counter{}, nil
+}
+
+// Float64UpDownCounter returns an UpDownCounter used to record int64
+// measurements that produces no telemetry.
+func (Meter) Float64UpDownCounter(string, ...metric.Float64UpDownCounterOption) (metric.Float64UpDownCounter, error) {
+ return Float64UpDownCounter{}, nil
+}
+
+// Float64Histogram returns a Histogram used to record int64 measurements that
+// produces no telemetry.
+func (Meter) Float64Histogram(string, ...metric.Float64HistogramOption) (metric.Float64Histogram, error) {
+ return Float64Histogram{}, nil
+}
+
+// Float64Gauge returns a Gauge used to record float64 measurements that
+// produces no telemetry.
+func (Meter) Float64Gauge(string, ...metric.Float64GaugeOption) (metric.Float64Gauge, error) {
+ return Float64Gauge{}, nil
+}
+
+// Float64ObservableCounter returns an ObservableCounter used to record int64
+// measurements that produces no telemetry.
+func (Meter) Float64ObservableCounter(string, ...metric.Float64ObservableCounterOption) (metric.Float64ObservableCounter, error) {
+ return Float64ObservableCounter{}, nil
+}
+
+// Float64ObservableUpDownCounter returns an ObservableUpDownCounter used to
+// record int64 measurements that produces no telemetry.
+func (Meter) Float64ObservableUpDownCounter(string, ...metric.Float64ObservableUpDownCounterOption) (metric.Float64ObservableUpDownCounter, error) {
+ return Float64ObservableUpDownCounter{}, nil
+}
+
+// Float64ObservableGauge returns an ObservableGauge used to record int64
+// measurements that produces no telemetry.
+func (Meter) Float64ObservableGauge(string, ...metric.Float64ObservableGaugeOption) (metric.Float64ObservableGauge, error) {
+ return Float64ObservableGauge{}, nil
+}
+
+// RegisterCallback performs no operation.
+func (Meter) RegisterCallback(metric.Callback, ...metric.Observable) (metric.Registration, error) {
+ return Registration{}, nil
+}
+
+// Observer acts as a recorder of measurements for multiple instruments in a
+// Callback, it performing no operation.
+type Observer struct{ embedded.Observer }
+
+// ObserveFloat64 performs no operation.
+func (Observer) ObserveFloat64(metric.Float64Observable, float64, ...metric.ObserveOption) {
+}
+
+// ObserveInt64 performs no operation.
+func (Observer) ObserveInt64(metric.Int64Observable, int64, ...metric.ObserveOption) {
+}
+
+// Registration is the registration of a Callback with a No-Op Meter.
+type Registration struct{ embedded.Registration }
+
+// Unregister unregisters the Callback the Registration represents with the
+// No-Op Meter. This will always return nil because the No-Op Meter performs no
+// operation, including hold any record of registrations.
+func (Registration) Unregister() error { return nil }
+
+// Int64Counter is an OpenTelemetry Counter used to record int64 measurements.
+// It produces no telemetry.
+type Int64Counter struct{ embedded.Int64Counter }
+
+// Add performs no operation.
+func (Int64Counter) Add(context.Context, int64, ...metric.AddOption) {}
+
+// Float64Counter is an OpenTelemetry Counter used to record float64
+// measurements. It produces no telemetry.
+type Float64Counter struct{ embedded.Float64Counter }
+
+// Add performs no operation.
+func (Float64Counter) Add(context.Context, float64, ...metric.AddOption) {}
+
+// Int64UpDownCounter is an OpenTelemetry UpDownCounter used to record int64
+// measurements. It produces no telemetry.
+type Int64UpDownCounter struct{ embedded.Int64UpDownCounter }
+
+// Add performs no operation.
+func (Int64UpDownCounter) Add(context.Context, int64, ...metric.AddOption) {}
+
+// Float64UpDownCounter is an OpenTelemetry UpDownCounter used to record
+// float64 measurements. It produces no telemetry.
+type Float64UpDownCounter struct{ embedded.Float64UpDownCounter }
+
+// Add performs no operation.
+func (Float64UpDownCounter) Add(context.Context, float64, ...metric.AddOption) {}
+
+// Int64Histogram is an OpenTelemetry Histogram used to record int64
+// measurements. It produces no telemetry.
+type Int64Histogram struct{ embedded.Int64Histogram }
+
+// Record performs no operation.
+func (Int64Histogram) Record(context.Context, int64, ...metric.RecordOption) {}
+
+// Float64Histogram is an OpenTelemetry Histogram used to record float64
+// measurements. It produces no telemetry.
+type Float64Histogram struct{ embedded.Float64Histogram }
+
+// Record performs no operation.
+func (Float64Histogram) Record(context.Context, float64, ...metric.RecordOption) {}
+
+// Int64Gauge is an OpenTelemetry Gauge used to record instantaneous int64
+// measurements. It produces no telemetry.
+type Int64Gauge struct{ embedded.Int64Gauge }
+
+// Record performs no operation.
+func (Int64Gauge) Record(context.Context, int64, ...metric.RecordOption) {}
+
+// Float64Gauge is an OpenTelemetry Gauge used to record instantaneous float64
+// measurements. It produces no telemetry.
+type Float64Gauge struct{ embedded.Float64Gauge }
+
+// Record performs no operation.
+func (Float64Gauge) Record(context.Context, float64, ...metric.RecordOption) {}
+
+// Int64ObservableCounter is an OpenTelemetry ObservableCounter used to record
+// int64 measurements. It produces no telemetry.
+type Int64ObservableCounter struct {
+ metric.Int64Observable
+ embedded.Int64ObservableCounter
+}
+
+// Float64ObservableCounter is an OpenTelemetry ObservableCounter used to record
+// float64 measurements. It produces no telemetry.
+type Float64ObservableCounter struct {
+ metric.Float64Observable
+ embedded.Float64ObservableCounter
+}
+
+// Int64ObservableGauge is an OpenTelemetry ObservableGauge used to record
+// int64 measurements. It produces no telemetry.
+type Int64ObservableGauge struct {
+ metric.Int64Observable
+ embedded.Int64ObservableGauge
+}
+
+// Float64ObservableGauge is an OpenTelemetry ObservableGauge used to record
+// float64 measurements. It produces no telemetry.
+type Float64ObservableGauge struct {
+ metric.Float64Observable
+ embedded.Float64ObservableGauge
+}
+
+// Int64ObservableUpDownCounter is an OpenTelemetry ObservableUpDownCounter
+// used to record int64 measurements. It produces no telemetry.
+type Int64ObservableUpDownCounter struct {
+ metric.Int64Observable
+ embedded.Int64ObservableUpDownCounter
+}
+
+// Float64ObservableUpDownCounter is an OpenTelemetry ObservableUpDownCounter
+// used to record float64 measurements. It produces no telemetry.
+type Float64ObservableUpDownCounter struct {
+ metric.Float64Observable
+ embedded.Float64ObservableUpDownCounter
+}
+
+// Int64Observer is a recorder of int64 measurements that performs no operation.
+type Int64Observer struct{ embedded.Int64Observer }
+
+// Observe performs no operation.
+func (Int64Observer) Observe(int64, ...metric.ObserveOption) {}
+
+// Float64Observer is a recorder of float64 measurements that performs no
+// operation.
+type Float64Observer struct{ embedded.Float64Observer }
+
+// Observe performs no operation.
+func (Float64Observer) Observe(float64, ...metric.ObserveOption) {}
diff --git a/vendor/go.opentelemetry.io/otel/metric/syncfloat64.go b/vendor/go.opentelemetry.io/otel/metric/syncfloat64.go
index 0a4825ae..8403a4ba 100644
--- a/vendor/go.opentelemetry.io/otel/metric/syncfloat64.go
+++ b/vendor/go.opentelemetry.io/otel/metric/syncfloat64.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package metric // import "go.opentelemetry.io/otel/metric"
@@ -39,7 +28,7 @@ type Float64Counter interface {
}
// Float64CounterConfig contains options for synchronous counter instruments that
-// record int64 values.
+// record float64 values.
type Float64CounterConfig struct {
description string
unit string
@@ -92,7 +81,7 @@ type Float64UpDownCounter interface {
}
// Float64UpDownCounterConfig contains options for synchronous counter
-// instruments that record int64 values.
+// instruments that record float64 values.
type Float64UpDownCounterConfig struct {
description string
unit string
@@ -144,8 +133,8 @@ type Float64Histogram interface {
Record(ctx context.Context, incr float64, options ...RecordOption)
}
-// Float64HistogramConfig contains options for synchronous counter instruments
-// that record int64 values.
+// Float64HistogramConfig contains options for synchronous histogram
+// instruments that record float64 values.
type Float64HistogramConfig struct {
description string
unit string
@@ -183,3 +172,55 @@ func (c Float64HistogramConfig) ExplicitBucketBoundaries() []float64 {
type Float64HistogramOption interface {
applyFloat64Histogram(Float64HistogramConfig) Float64HistogramConfig
}
+
+// Float64Gauge is an instrument that records instantaneous float64 values.
+//
+// Warning: Methods may be added to this interface in minor releases. See
+// package documentation on API implementation for information on how to set
+// default behavior for unimplemented methods.
+type Float64Gauge interface {
+ // Users of the interface can ignore this. This embedded type is only used
+ // by implementations of this interface. See the "API Implementations"
+ // section of the package documentation for more information.
+ embedded.Float64Gauge
+
+ // Record records the instantaneous value.
+ //
+ // Use the WithAttributeSet (or, if performance is not a concern,
+ // the WithAttributes) option to include measurement attributes.
+ Record(ctx context.Context, value float64, options ...RecordOption)
+}
+
+// Float64GaugeConfig contains options for synchronous gauge instruments that
+// record float64 values.
+type Float64GaugeConfig struct {
+ description string
+ unit string
+}
+
+// NewFloat64GaugeConfig returns a new [Float64GaugeConfig] with all opts
+// applied.
+func NewFloat64GaugeConfig(opts ...Float64GaugeOption) Float64GaugeConfig {
+ var config Float64GaugeConfig
+ for _, o := range opts {
+ config = o.applyFloat64Gauge(config)
+ }
+ return config
+}
+
+// Description returns the configured description.
+func (c Float64GaugeConfig) Description() string {
+ return c.description
+}
+
+// Unit returns the configured unit.
+func (c Float64GaugeConfig) Unit() string {
+ return c.unit
+}
+
+// Float64GaugeOption applies options to a [Float64GaugeConfig]. See
+// [InstrumentOption] for other options that can be used as a
+// Float64GaugeOption.
+type Float64GaugeOption interface {
+ applyFloat64Gauge(Float64GaugeConfig) Float64GaugeConfig
+}
diff --git a/vendor/go.opentelemetry.io/otel/metric/syncint64.go b/vendor/go.opentelemetry.io/otel/metric/syncint64.go
index 56667d32..783fdfba 100644
--- a/vendor/go.opentelemetry.io/otel/metric/syncint64.go
+++ b/vendor/go.opentelemetry.io/otel/metric/syncint64.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package metric // import "go.opentelemetry.io/otel/metric"
@@ -144,7 +133,7 @@ type Int64Histogram interface {
Record(ctx context.Context, incr int64, options ...RecordOption)
}
-// Int64HistogramConfig contains options for synchronous counter instruments
+// Int64HistogramConfig contains options for synchronous histogram instruments
// that record int64 values.
type Int64HistogramConfig struct {
description string
@@ -183,3 +172,55 @@ func (c Int64HistogramConfig) ExplicitBucketBoundaries() []float64 {
type Int64HistogramOption interface {
applyInt64Histogram(Int64HistogramConfig) Int64HistogramConfig
}
+
+// Int64Gauge is an instrument that records instantaneous int64 values.
+//
+// Warning: Methods may be added to this interface in minor releases. See
+// package documentation on API implementation for information on how to set
+// default behavior for unimplemented methods.
+type Int64Gauge interface {
+ // Users of the interface can ignore this. This embedded type is only used
+ // by implementations of this interface. See the "API Implementations"
+ // section of the package documentation for more information.
+ embedded.Int64Gauge
+
+ // Record records the instantaneous value.
+ //
+ // Use the WithAttributeSet (or, if performance is not a concern,
+ // the WithAttributes) option to include measurement attributes.
+ Record(ctx context.Context, value int64, options ...RecordOption)
+}
+
+// Int64GaugeConfig contains options for synchronous gauge instruments that
+// record int64 values.
+type Int64GaugeConfig struct {
+ description string
+ unit string
+}
+
+// NewInt64GaugeConfig returns a new [Int64GaugeConfig] with all opts
+// applied.
+func NewInt64GaugeConfig(opts ...Int64GaugeOption) Int64GaugeConfig {
+ var config Int64GaugeConfig
+ for _, o := range opts {
+ config = o.applyInt64Gauge(config)
+ }
+ return config
+}
+
+// Description returns the configured description.
+func (c Int64GaugeConfig) Description() string {
+ return c.description
+}
+
+// Unit returns the configured unit.
+func (c Int64GaugeConfig) Unit() string {
+ return c.unit
+}
+
+// Int64GaugeOption applies options to a [Int64GaugeConfig]. See
+// [InstrumentOption] for other options that can be used as a
+// Int64GaugeOption.
+type Int64GaugeOption interface {
+ applyInt64Gauge(Int64GaugeConfig) Int64GaugeConfig
+}
diff --git a/vendor/go.opentelemetry.io/otel/propagation.go b/vendor/go.opentelemetry.io/otel/propagation.go
index d29aaa32..2fd94973 100644
--- a/vendor/go.opentelemetry.io/otel/propagation.go
+++ b/vendor/go.opentelemetry.io/otel/propagation.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package otel // import "go.opentelemetry.io/otel"
diff --git a/vendor/go.opentelemetry.io/otel/propagation/README.md b/vendor/go.opentelemetry.io/otel/propagation/README.md
new file mode 100644
index 00000000..e2959ac7
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/propagation/README.md
@@ -0,0 +1,3 @@
+# Propagation
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/propagation)](https://pkg.go.dev/go.opentelemetry.io/otel/propagation)
diff --git a/vendor/go.opentelemetry.io/otel/propagation/baggage.go b/vendor/go.opentelemetry.io/otel/propagation/baggage.go
index 303cdf1c..552263ba 100644
--- a/vendor/go.opentelemetry.io/otel/propagation/baggage.go
+++ b/vendor/go.opentelemetry.io/otel/propagation/baggage.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package propagation // import "go.opentelemetry.io/otel/propagation"
diff --git a/vendor/go.opentelemetry.io/otel/propagation/doc.go b/vendor/go.opentelemetry.io/otel/propagation/doc.go
index c119eb28..33a3baf1 100644
--- a/vendor/go.opentelemetry.io/otel/propagation/doc.go
+++ b/vendor/go.opentelemetry.io/otel/propagation/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
/*
Package propagation contains OpenTelemetry context propagators.
diff --git a/vendor/go.opentelemetry.io/otel/propagation/propagation.go b/vendor/go.opentelemetry.io/otel/propagation/propagation.go
index c94438f7..8c8286aa 100644
--- a/vendor/go.opentelemetry.io/otel/propagation/propagation.go
+++ b/vendor/go.opentelemetry.io/otel/propagation/propagation.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package propagation // import "go.opentelemetry.io/otel/propagation"
diff --git a/vendor/go.opentelemetry.io/otel/propagation/trace_context.go b/vendor/go.opentelemetry.io/otel/propagation/trace_context.go
index 75a8f343..6870e316 100644
--- a/vendor/go.opentelemetry.io/otel/propagation/trace_context.go
+++ b/vendor/go.opentelemetry.io/otel/propagation/trace_context.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package propagation // import "go.opentelemetry.io/otel/propagation"
@@ -18,7 +7,7 @@ import (
"context"
"encoding/hex"
"fmt"
- "regexp"
+ "strings"
"go.opentelemetry.io/otel/trace"
)
@@ -28,6 +17,7 @@ const (
maxVersion = 254
traceparentHeader = "traceparent"
tracestateHeader = "tracestate"
+ delimiter = "-"
)
// TraceContext is a propagator that supports the W3C Trace Context format
@@ -41,11 +31,11 @@ const (
type TraceContext struct{}
var (
- _ TextMapPropagator = TraceContext{}
- traceCtxRegExp = regexp.MustCompile("^(?P[0-9a-f]{2})-(?P[a-f0-9]{32})-(?P[a-f0-9]{16})-(?P[a-f0-9]{2})(?:-.*)?$")
+ _ TextMapPropagator = TraceContext{}
+ versionPart = fmt.Sprintf("%.2X", supportedVersion)
)
-// Inject set tracecontext from the Context into the carrier.
+// Inject injects the trace context from ctx into carrier.
func (tc TraceContext) Inject(ctx context.Context, carrier TextMapCarrier) {
sc := trace.SpanContextFromContext(ctx)
if !sc.IsValid() {
@@ -59,12 +49,19 @@ func (tc TraceContext) Inject(ctx context.Context, carrier TextMapCarrier) {
// Clear all flags other than the trace-context supported sampling bit.
flags := sc.TraceFlags() & trace.FlagsSampled
- h := fmt.Sprintf("%.2x-%s-%s-%s",
- supportedVersion,
- sc.TraceID(),
- sc.SpanID(),
- flags)
- carrier.Set(traceparentHeader, h)
+ var sb strings.Builder
+ sb.Grow(2 + 32 + 16 + 2 + 3)
+ _, _ = sb.WriteString(versionPart)
+ traceID := sc.TraceID()
+ spanID := sc.SpanID()
+ flagByte := [1]byte{byte(flags)}
+ var buf [32]byte
+ for _, src := range [][]byte{traceID[:], spanID[:], flagByte[:]} {
+ _ = sb.WriteByte(delimiter[0])
+ n := hex.Encode(buf[:], src)
+ _, _ = sb.Write(buf[:n])
+ }
+ carrier.Set(traceparentHeader, sb.String())
}
// Extract reads tracecontext from the carrier into a returned Context.
@@ -86,21 +83,8 @@ func (tc TraceContext) extract(carrier TextMapCarrier) trace.SpanContext {
return trace.SpanContext{}
}
- matches := traceCtxRegExp.FindStringSubmatch(h)
-
- if len(matches) == 0 {
- return trace.SpanContext{}
- }
-
- if len(matches) < 5 { // four subgroups plus the overall match
- return trace.SpanContext{}
- }
-
- if len(matches[1]) != 2 {
- return trace.SpanContext{}
- }
- ver, err := hex.DecodeString(matches[1])
- if err != nil {
+ var ver [1]byte
+ if !extractPart(ver[:], &h, 2) {
return trace.SpanContext{}
}
version := int(ver[0])
@@ -108,36 +92,24 @@ func (tc TraceContext) extract(carrier TextMapCarrier) trace.SpanContext {
return trace.SpanContext{}
}
- if version == 0 && len(matches) != 5 { // four subgroups plus the overall match
- return trace.SpanContext{}
- }
-
- if len(matches[2]) != 32 {
- return trace.SpanContext{}
- }
-
var scc trace.SpanContextConfig
-
- scc.TraceID, err = trace.TraceIDFromHex(matches[2][:32])
- if err != nil {
+ if !extractPart(scc.TraceID[:], &h, 32) {
return trace.SpanContext{}
}
-
- if len(matches[3]) != 16 {
- return trace.SpanContext{}
- }
- scc.SpanID, err = trace.SpanIDFromHex(matches[3])
- if err != nil {
+ if !extractPart(scc.SpanID[:], &h, 16) {
return trace.SpanContext{}
}
- if len(matches[4]) != 2 {
+ var opts [1]byte
+ if !extractPart(opts[:], &h, 2) {
return trace.SpanContext{}
}
- opts, err := hex.DecodeString(matches[4])
- if err != nil || len(opts) < 1 || (version == 0 && opts[0] > 2) {
+ if version == 0 && (h != "" || opts[0] > 2) {
+ // version 0 not allow extra
+ // version 0 not allow other flag
return trace.SpanContext{}
}
+
// Clear all flags other than the trace-context supported sampling bit.
scc.TraceFlags = trace.TraceFlags(opts[0]) & trace.FlagsSampled
@@ -155,6 +127,29 @@ func (tc TraceContext) extract(carrier TextMapCarrier) trace.SpanContext {
return sc
}
+// upperHex detect hex is upper case Unicode characters.
+func upperHex(v string) bool {
+ for _, c := range v {
+ if c >= 'A' && c <= 'F' {
+ return true
+ }
+ }
+ return false
+}
+
+func extractPart(dst []byte, h *string, n int) bool {
+ part, left, _ := strings.Cut(*h, delimiter)
+ *h = left
+ // hex.Decode decodes unsupported upper-case characters, so exclude explicitly.
+ if len(part) != n || upperHex(part) {
+ return false
+ }
+ if p, err := hex.Decode(dst, []byte(part)); err != nil || p != n/2 {
+ return false
+ }
+ return true
+}
+
// Fields returns the keys who's values are set with Inject.
func (tc TraceContext) Fields() []string {
return []string{traceparentHeader, tracestateHeader}
diff --git a/vendor/go.opentelemetry.io/otel/renovate.json b/vendor/go.opentelemetry.io/otel/renovate.json
new file mode 100644
index 00000000..0a29a2f1
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/renovate.json
@@ -0,0 +1,32 @@
+{
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json",
+ "extends": [
+ "config:recommended"
+ ],
+ "ignorePaths": [],
+ "labels": ["Skip Changelog", "dependencies"],
+ "postUpdateOptions" : [
+ "gomodTidy"
+ ],
+ "packageRules": [
+ {
+ "matchManagers": ["gomod"],
+ "matchDepTypes": ["indirect"],
+ "enabled": true
+ },
+ {
+ "matchFileNames": ["internal/tools/**"],
+ "matchManagers": ["gomod"],
+ "matchDepTypes": ["indirect"],
+ "enabled": false
+ },
+ {
+ "matchPackageNames": ["google.golang.org/genproto/googleapis/**"],
+ "groupName": "googleapis"
+ },
+ {
+ "matchPackageNames": ["golang.org/x/**"],
+ "groupName": "golang.org/x"
+ }
+ ]
+}
diff --git a/vendor/go.opentelemetry.io/otel/requirements.txt b/vendor/go.opentelemetry.io/otel/requirements.txt
index e0a43e13..ab09daf9 100644
--- a/vendor/go.opentelemetry.io/otel/requirements.txt
+++ b/vendor/go.opentelemetry.io/otel/requirements.txt
@@ -1 +1 @@
-codespell==2.2.6
+codespell==2.3.0
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/schema.go b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/schema.go
deleted file mode 100644
index 42fc525d..00000000
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/schema.go
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright The OpenTelemetry 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 semconv // import "go.opentelemetry.io/otel/semconv/v1.17.0"
-
-// SchemaURL is the schema URL that matches the version of the semantic conventions
-// that this package defines. Semconv packages starting from v1.4.0 must declare
-// non-empty schema URL in the form https://opentelemetry.io/schemas/
-const SchemaURL = "https://opentelemetry.io/schemas/1.17.0"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/README.md b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/README.md
new file mode 100644
index 00000000..82e1f46b
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/README.md
@@ -0,0 +1,3 @@
+# Semconv v1.20.0
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/semconv/v1.20.0)](https://pkg.go.dev/go.opentelemetry.io/otel/semconv/v1.20.0)
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/attribute_group.go b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/attribute_group.go
new file mode 100644
index 00000000..6685c392
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/attribute_group.go
@@ -0,0 +1,1198 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Code generated from semantic convention specification. DO NOT EDIT.
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.20.0"
+
+import "go.opentelemetry.io/otel/attribute"
+
+// Describes HTTP attributes.
+const (
+ // HTTPMethodKey is the attribute Key conforming to the "http.method"
+ // semantic conventions. It represents the hTTP request method.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: stable
+ // Examples: 'GET', 'POST', 'HEAD'
+ HTTPMethodKey = attribute.Key("http.method")
+
+ // HTTPStatusCodeKey is the attribute Key conforming to the
+ // "http.status_code" semantic conventions. It represents the [HTTP
+ // response status code](https://tools.ietf.org/html/rfc7231#section-6).
+ //
+ // Type: int
+ // RequirementLevel: ConditionallyRequired (If and only if one was
+ // received/sent.)
+ // Stability: stable
+ // Examples: 200
+ HTTPStatusCodeKey = attribute.Key("http.status_code")
+)
+
+// HTTPMethod returns an attribute KeyValue conforming to the "http.method"
+// semantic conventions. It represents the hTTP request method.
+func HTTPMethod(val string) attribute.KeyValue {
+ return HTTPMethodKey.String(val)
+}
+
+// HTTPStatusCode returns an attribute KeyValue conforming to the
+// "http.status_code" semantic conventions. It represents the [HTTP response
+// status code](https://tools.ietf.org/html/rfc7231#section-6).
+func HTTPStatusCode(val int) attribute.KeyValue {
+ return HTTPStatusCodeKey.Int(val)
+}
+
+// HTTP Server spans attributes
+const (
+ // HTTPSchemeKey is the attribute Key conforming to the "http.scheme"
+ // semantic conventions. It represents the URI scheme identifying the used
+ // protocol.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: stable
+ // Examples: 'http', 'https'
+ HTTPSchemeKey = attribute.Key("http.scheme")
+
+ // HTTPRouteKey is the attribute Key conforming to the "http.route"
+ // semantic conventions. It represents the matched route (path template in
+ // the format used by the respective server framework). See note below
+ //
+ // Type: string
+ // RequirementLevel: ConditionallyRequired (If and only if it's available)
+ // Stability: stable
+ // Examples: '/users/:userID?', '{controller}/{action}/{id?}'
+ // Note: MUST NOT be populated when this is not supported by the HTTP
+ // server framework as the route attribute should have low-cardinality and
+ // the URI path can NOT substitute it.
+ // SHOULD include the [application
+ // root](/specification/trace/semantic_conventions/http.md#http-server-definitions)
+ // if there is one.
+ HTTPRouteKey = attribute.Key("http.route")
+)
+
+// HTTPScheme returns an attribute KeyValue conforming to the "http.scheme"
+// semantic conventions. It represents the URI scheme identifying the used
+// protocol.
+func HTTPScheme(val string) attribute.KeyValue {
+ return HTTPSchemeKey.String(val)
+}
+
+// HTTPRoute returns an attribute KeyValue conforming to the "http.route"
+// semantic conventions. It represents the matched route (path template in the
+// format used by the respective server framework). See note below
+func HTTPRoute(val string) attribute.KeyValue {
+ return HTTPRouteKey.String(val)
+}
+
+// Attributes for Events represented using Log Records.
+const (
+ // EventNameKey is the attribute Key conforming to the "event.name"
+ // semantic conventions. It represents the name identifies the event.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: stable
+ // Examples: 'click', 'exception'
+ EventNameKey = attribute.Key("event.name")
+
+ // EventDomainKey is the attribute Key conforming to the "event.domain"
+ // semantic conventions. It represents the domain identifies the business
+ // context for the events.
+ //
+ // Type: Enum
+ // RequirementLevel: Required
+ // Stability: stable
+ // Note: Events across different domains may have same `event.name`, yet be
+ // unrelated events.
+ EventDomainKey = attribute.Key("event.domain")
+)
+
+var (
+ // Events from browser apps
+ EventDomainBrowser = EventDomainKey.String("browser")
+ // Events from mobile apps
+ EventDomainDevice = EventDomainKey.String("device")
+ // Events from Kubernetes
+ EventDomainK8S = EventDomainKey.String("k8s")
+)
+
+// EventName returns an attribute KeyValue conforming to the "event.name"
+// semantic conventions. It represents the name identifies the event.
+func EventName(val string) attribute.KeyValue {
+ return EventNameKey.String(val)
+}
+
+// These attributes may be used for any network related operation.
+const (
+ // NetTransportKey is the attribute Key conforming to the "net.transport"
+ // semantic conventions. It represents the transport protocol used. See
+ // note below.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ NetTransportKey = attribute.Key("net.transport")
+
+ // NetProtocolNameKey is the attribute Key conforming to the
+ // "net.protocol.name" semantic conventions. It represents the application
+ // layer protocol used. The value SHOULD be normalized to lowercase.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'amqp', 'http', 'mqtt'
+ NetProtocolNameKey = attribute.Key("net.protocol.name")
+
+ // NetProtocolVersionKey is the attribute Key conforming to the
+ // "net.protocol.version" semantic conventions. It represents the version
+ // of the application layer protocol used. See note below.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '3.1.1'
+ // Note: `net.protocol.version` refers to the version of the protocol used
+ // and might be different from the protocol client's version. If the HTTP
+ // client used has a version of `0.27.2`, but sends HTTP version `1.1`,
+ // this attribute should be set to `1.1`.
+ NetProtocolVersionKey = attribute.Key("net.protocol.version")
+
+ // NetSockPeerNameKey is the attribute Key conforming to the
+ // "net.sock.peer.name" semantic conventions. It represents the remote
+ // socket peer name.
+ //
+ // Type: string
+ // RequirementLevel: Recommended (If available and different from
+ // `net.peer.name` and if `net.sock.peer.addr` is set.)
+ // Stability: stable
+ // Examples: 'proxy.example.com'
+ NetSockPeerNameKey = attribute.Key("net.sock.peer.name")
+
+ // NetSockPeerAddrKey is the attribute Key conforming to the
+ // "net.sock.peer.addr" semantic conventions. It represents the remote
+ // socket peer address: IPv4 or IPv6 for internet protocols, path for local
+ // communication,
+ // [etc](https://man7.org/linux/man-pages/man7/address_families.7.html).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '127.0.0.1', '/tmp/mysql.sock'
+ NetSockPeerAddrKey = attribute.Key("net.sock.peer.addr")
+
+ // NetSockPeerPortKey is the attribute Key conforming to the
+ // "net.sock.peer.port" semantic conventions. It represents the remote
+ // socket peer port.
+ //
+ // Type: int
+ // RequirementLevel: Recommended (If defined for the address family and if
+ // different than `net.peer.port` and if `net.sock.peer.addr` is set.)
+ // Stability: stable
+ // Examples: 16456
+ NetSockPeerPortKey = attribute.Key("net.sock.peer.port")
+
+ // NetSockFamilyKey is the attribute Key conforming to the
+ // "net.sock.family" semantic conventions. It represents the protocol
+ // [address
+ // family](https://man7.org/linux/man-pages/man7/address_families.7.html)
+ // which is used for communication.
+ //
+ // Type: Enum
+ // RequirementLevel: ConditionallyRequired (If different than `inet` and if
+ // any of `net.sock.peer.addr` or `net.sock.host.addr` are set. Consumers
+ // of telemetry SHOULD accept both IPv4 and IPv6 formats for the address in
+ // `net.sock.peer.addr` if `net.sock.family` is not set. This is to support
+ // instrumentations that follow previous versions of this document.)
+ // Stability: stable
+ // Examples: 'inet6', 'bluetooth'
+ NetSockFamilyKey = attribute.Key("net.sock.family")
+
+ // NetPeerNameKey is the attribute Key conforming to the "net.peer.name"
+ // semantic conventions. It represents the logical remote hostname, see
+ // note below.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'example.com'
+ // Note: `net.peer.name` SHOULD NOT be set if capturing it would require an
+ // extra DNS lookup.
+ NetPeerNameKey = attribute.Key("net.peer.name")
+
+ // NetPeerPortKey is the attribute Key conforming to the "net.peer.port"
+ // semantic conventions. It represents the logical remote port number
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 80, 8080, 443
+ NetPeerPortKey = attribute.Key("net.peer.port")
+
+ // NetHostNameKey is the attribute Key conforming to the "net.host.name"
+ // semantic conventions. It represents the logical local hostname or
+ // similar, see note below.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'localhost'
+ NetHostNameKey = attribute.Key("net.host.name")
+
+ // NetHostPortKey is the attribute Key conforming to the "net.host.port"
+ // semantic conventions. It represents the logical local port number,
+ // preferably the one that the peer used to connect
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 8080
+ NetHostPortKey = attribute.Key("net.host.port")
+
+ // NetSockHostAddrKey is the attribute Key conforming to the
+ // "net.sock.host.addr" semantic conventions. It represents the local
+ // socket address. Useful in case of a multi-IP host.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '192.168.0.1'
+ NetSockHostAddrKey = attribute.Key("net.sock.host.addr")
+
+ // NetSockHostPortKey is the attribute Key conforming to the
+ // "net.sock.host.port" semantic conventions. It represents the local
+ // socket port number.
+ //
+ // Type: int
+ // RequirementLevel: ConditionallyRequired (If defined for the address
+ // family and if different than `net.host.port` and if `net.sock.host.addr`
+ // is set. In other cases, it is still recommended to set this.)
+ // Stability: stable
+ // Examples: 35555
+ NetSockHostPortKey = attribute.Key("net.sock.host.port")
+)
+
+var (
+ // ip_tcp
+ NetTransportTCP = NetTransportKey.String("ip_tcp")
+ // ip_udp
+ NetTransportUDP = NetTransportKey.String("ip_udp")
+ // Named or anonymous pipe. See note below
+ NetTransportPipe = NetTransportKey.String("pipe")
+ // In-process communication
+ NetTransportInProc = NetTransportKey.String("inproc")
+ // Something else (non IP-based)
+ NetTransportOther = NetTransportKey.String("other")
+)
+
+var (
+ // IPv4 address
+ NetSockFamilyInet = NetSockFamilyKey.String("inet")
+ // IPv6 address
+ NetSockFamilyInet6 = NetSockFamilyKey.String("inet6")
+ // Unix domain socket path
+ NetSockFamilyUnix = NetSockFamilyKey.String("unix")
+)
+
+// NetProtocolName returns an attribute KeyValue conforming to the
+// "net.protocol.name" semantic conventions. It represents the application
+// layer protocol used. The value SHOULD be normalized to lowercase.
+func NetProtocolName(val string) attribute.KeyValue {
+ return NetProtocolNameKey.String(val)
+}
+
+// NetProtocolVersion returns an attribute KeyValue conforming to the
+// "net.protocol.version" semantic conventions. It represents the version of
+// the application layer protocol used. See note below.
+func NetProtocolVersion(val string) attribute.KeyValue {
+ return NetProtocolVersionKey.String(val)
+}
+
+// NetSockPeerName returns an attribute KeyValue conforming to the
+// "net.sock.peer.name" semantic conventions. It represents the remote socket
+// peer name.
+func NetSockPeerName(val string) attribute.KeyValue {
+ return NetSockPeerNameKey.String(val)
+}
+
+// NetSockPeerAddr returns an attribute KeyValue conforming to the
+// "net.sock.peer.addr" semantic conventions. It represents the remote socket
+// peer address: IPv4 or IPv6 for internet protocols, path for local
+// communication,
+// [etc](https://man7.org/linux/man-pages/man7/address_families.7.html).
+func NetSockPeerAddr(val string) attribute.KeyValue {
+ return NetSockPeerAddrKey.String(val)
+}
+
+// NetSockPeerPort returns an attribute KeyValue conforming to the
+// "net.sock.peer.port" semantic conventions. It represents the remote socket
+// peer port.
+func NetSockPeerPort(val int) attribute.KeyValue {
+ return NetSockPeerPortKey.Int(val)
+}
+
+// NetPeerName returns an attribute KeyValue conforming to the
+// "net.peer.name" semantic conventions. It represents the logical remote
+// hostname, see note below.
+func NetPeerName(val string) attribute.KeyValue {
+ return NetPeerNameKey.String(val)
+}
+
+// NetPeerPort returns an attribute KeyValue conforming to the
+// "net.peer.port" semantic conventions. It represents the logical remote port
+// number
+func NetPeerPort(val int) attribute.KeyValue {
+ return NetPeerPortKey.Int(val)
+}
+
+// NetHostName returns an attribute KeyValue conforming to the
+// "net.host.name" semantic conventions. It represents the logical local
+// hostname or similar, see note below.
+func NetHostName(val string) attribute.KeyValue {
+ return NetHostNameKey.String(val)
+}
+
+// NetHostPort returns an attribute KeyValue conforming to the
+// "net.host.port" semantic conventions. It represents the logical local port
+// number, preferably the one that the peer used to connect
+func NetHostPort(val int) attribute.KeyValue {
+ return NetHostPortKey.Int(val)
+}
+
+// NetSockHostAddr returns an attribute KeyValue conforming to the
+// "net.sock.host.addr" semantic conventions. It represents the local socket
+// address. Useful in case of a multi-IP host.
+func NetSockHostAddr(val string) attribute.KeyValue {
+ return NetSockHostAddrKey.String(val)
+}
+
+// NetSockHostPort returns an attribute KeyValue conforming to the
+// "net.sock.host.port" semantic conventions. It represents the local socket
+// port number.
+func NetSockHostPort(val int) attribute.KeyValue {
+ return NetSockHostPortKey.Int(val)
+}
+
+// These attributes may be used for any network related operation.
+const (
+ // NetHostConnectionTypeKey is the attribute Key conforming to the
+ // "net.host.connection.type" semantic conventions. It represents the
+ // internet connection type currently being used by the host.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'wifi'
+ NetHostConnectionTypeKey = attribute.Key("net.host.connection.type")
+
+ // NetHostConnectionSubtypeKey is the attribute Key conforming to the
+ // "net.host.connection.subtype" semantic conventions. It represents the
+ // this describes more details regarding the connection.type. It may be the
+ // type of cell technology connection, but it could be used for describing
+ // details about a wifi connection.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'LTE'
+ NetHostConnectionSubtypeKey = attribute.Key("net.host.connection.subtype")
+
+ // NetHostCarrierNameKey is the attribute Key conforming to the
+ // "net.host.carrier.name" semantic conventions. It represents the name of
+ // the mobile carrier.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'sprint'
+ NetHostCarrierNameKey = attribute.Key("net.host.carrier.name")
+
+ // NetHostCarrierMccKey is the attribute Key conforming to the
+ // "net.host.carrier.mcc" semantic conventions. It represents the mobile
+ // carrier country code.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '310'
+ NetHostCarrierMccKey = attribute.Key("net.host.carrier.mcc")
+
+ // NetHostCarrierMncKey is the attribute Key conforming to the
+ // "net.host.carrier.mnc" semantic conventions. It represents the mobile
+ // carrier network code.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '001'
+ NetHostCarrierMncKey = attribute.Key("net.host.carrier.mnc")
+
+ // NetHostCarrierIccKey is the attribute Key conforming to the
+ // "net.host.carrier.icc" semantic conventions. It represents the ISO
+ // 3166-1 alpha-2 2-character country code associated with the mobile
+ // carrier network.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'DE'
+ NetHostCarrierIccKey = attribute.Key("net.host.carrier.icc")
+)
+
+var (
+ // wifi
+ NetHostConnectionTypeWifi = NetHostConnectionTypeKey.String("wifi")
+ // wired
+ NetHostConnectionTypeWired = NetHostConnectionTypeKey.String("wired")
+ // cell
+ NetHostConnectionTypeCell = NetHostConnectionTypeKey.String("cell")
+ // unavailable
+ NetHostConnectionTypeUnavailable = NetHostConnectionTypeKey.String("unavailable")
+ // unknown
+ NetHostConnectionTypeUnknown = NetHostConnectionTypeKey.String("unknown")
+)
+
+var (
+ // GPRS
+ NetHostConnectionSubtypeGprs = NetHostConnectionSubtypeKey.String("gprs")
+ // EDGE
+ NetHostConnectionSubtypeEdge = NetHostConnectionSubtypeKey.String("edge")
+ // UMTS
+ NetHostConnectionSubtypeUmts = NetHostConnectionSubtypeKey.String("umts")
+ // CDMA
+ NetHostConnectionSubtypeCdma = NetHostConnectionSubtypeKey.String("cdma")
+ // EVDO Rel. 0
+ NetHostConnectionSubtypeEvdo0 = NetHostConnectionSubtypeKey.String("evdo_0")
+ // EVDO Rev. A
+ NetHostConnectionSubtypeEvdoA = NetHostConnectionSubtypeKey.String("evdo_a")
+ // CDMA2000 1XRTT
+ NetHostConnectionSubtypeCdma20001xrtt = NetHostConnectionSubtypeKey.String("cdma2000_1xrtt")
+ // HSDPA
+ NetHostConnectionSubtypeHsdpa = NetHostConnectionSubtypeKey.String("hsdpa")
+ // HSUPA
+ NetHostConnectionSubtypeHsupa = NetHostConnectionSubtypeKey.String("hsupa")
+ // HSPA
+ NetHostConnectionSubtypeHspa = NetHostConnectionSubtypeKey.String("hspa")
+ // IDEN
+ NetHostConnectionSubtypeIden = NetHostConnectionSubtypeKey.String("iden")
+ // EVDO Rev. B
+ NetHostConnectionSubtypeEvdoB = NetHostConnectionSubtypeKey.String("evdo_b")
+ // LTE
+ NetHostConnectionSubtypeLte = NetHostConnectionSubtypeKey.String("lte")
+ // EHRPD
+ NetHostConnectionSubtypeEhrpd = NetHostConnectionSubtypeKey.String("ehrpd")
+ // HSPAP
+ NetHostConnectionSubtypeHspap = NetHostConnectionSubtypeKey.String("hspap")
+ // GSM
+ NetHostConnectionSubtypeGsm = NetHostConnectionSubtypeKey.String("gsm")
+ // TD-SCDMA
+ NetHostConnectionSubtypeTdScdma = NetHostConnectionSubtypeKey.String("td_scdma")
+ // IWLAN
+ NetHostConnectionSubtypeIwlan = NetHostConnectionSubtypeKey.String("iwlan")
+ // 5G NR (New Radio)
+ NetHostConnectionSubtypeNr = NetHostConnectionSubtypeKey.String("nr")
+ // 5G NRNSA (New Radio Non-Standalone)
+ NetHostConnectionSubtypeNrnsa = NetHostConnectionSubtypeKey.String("nrnsa")
+ // LTE CA
+ NetHostConnectionSubtypeLteCa = NetHostConnectionSubtypeKey.String("lte_ca")
+)
+
+// NetHostCarrierName returns an attribute KeyValue conforming to the
+// "net.host.carrier.name" semantic conventions. It represents the name of the
+// mobile carrier.
+func NetHostCarrierName(val string) attribute.KeyValue {
+ return NetHostCarrierNameKey.String(val)
+}
+
+// NetHostCarrierMcc returns an attribute KeyValue conforming to the
+// "net.host.carrier.mcc" semantic conventions. It represents the mobile
+// carrier country code.
+func NetHostCarrierMcc(val string) attribute.KeyValue {
+ return NetHostCarrierMccKey.String(val)
+}
+
+// NetHostCarrierMnc returns an attribute KeyValue conforming to the
+// "net.host.carrier.mnc" semantic conventions. It represents the mobile
+// carrier network code.
+func NetHostCarrierMnc(val string) attribute.KeyValue {
+ return NetHostCarrierMncKey.String(val)
+}
+
+// NetHostCarrierIcc returns an attribute KeyValue conforming to the
+// "net.host.carrier.icc" semantic conventions. It represents the ISO 3166-1
+// alpha-2 2-character country code associated with the mobile carrier network.
+func NetHostCarrierIcc(val string) attribute.KeyValue {
+ return NetHostCarrierIccKey.String(val)
+}
+
+// Semantic conventions for HTTP client and server Spans.
+const (
+ // HTTPRequestContentLengthKey is the attribute Key conforming to the
+ // "http.request_content_length" semantic conventions. It represents the
+ // size of the request payload body in bytes. This is the number of bytes
+ // transferred excluding headers and is often, but not always, present as
+ // the
+ // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
+ // header. For requests using transport encoding, this should be the
+ // compressed size.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 3495
+ HTTPRequestContentLengthKey = attribute.Key("http.request_content_length")
+
+ // HTTPResponseContentLengthKey is the attribute Key conforming to the
+ // "http.response_content_length" semantic conventions. It represents the
+ // size of the response payload body in bytes. This is the number of bytes
+ // transferred excluding headers and is often, but not always, present as
+ // the
+ // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
+ // header. For requests using transport encoding, this should be the
+ // compressed size.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 3495
+ HTTPResponseContentLengthKey = attribute.Key("http.response_content_length")
+)
+
+// HTTPRequestContentLength returns an attribute KeyValue conforming to the
+// "http.request_content_length" semantic conventions. It represents the size
+// of the request payload body in bytes. This is the number of bytes
+// transferred excluding headers and is often, but not always, present as the
+// [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
+// header. For requests using transport encoding, this should be the compressed
+// size.
+func HTTPRequestContentLength(val int) attribute.KeyValue {
+ return HTTPRequestContentLengthKey.Int(val)
+}
+
+// HTTPResponseContentLength returns an attribute KeyValue conforming to the
+// "http.response_content_length" semantic conventions. It represents the size
+// of the response payload body in bytes. This is the number of bytes
+// transferred excluding headers and is often, but not always, present as the
+// [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
+// header. For requests using transport encoding, this should be the compressed
+// size.
+func HTTPResponseContentLength(val int) attribute.KeyValue {
+ return HTTPResponseContentLengthKey.Int(val)
+}
+
+// Semantic convention describing per-message attributes populated on messaging
+// spans or links.
+const (
+ // MessagingMessageIDKey is the attribute Key conforming to the
+ // "messaging.message.id" semantic conventions. It represents a value used
+ // by the messaging system as an identifier for the message, represented as
+ // a string.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '452a7c7c7c7048c2f887f61572b18fc2'
+ MessagingMessageIDKey = attribute.Key("messaging.message.id")
+
+ // MessagingMessageConversationIDKey is the attribute Key conforming to the
+ // "messaging.message.conversation_id" semantic conventions. It represents
+ // the [conversation ID](#conversations) identifying the conversation to
+ // which the message belongs, represented as a string. Sometimes called
+ // "Correlation ID".
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'MyConversationID'
+ MessagingMessageConversationIDKey = attribute.Key("messaging.message.conversation_id")
+
+ // MessagingMessagePayloadSizeBytesKey is the attribute Key conforming to
+ // the "messaging.message.payload_size_bytes" semantic conventions. It
+ // represents the (uncompressed) size of the message payload in bytes. Also
+ // use this attribute if it is unknown whether the compressed or
+ // uncompressed payload size is reported.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 2738
+ MessagingMessagePayloadSizeBytesKey = attribute.Key("messaging.message.payload_size_bytes")
+
+ // MessagingMessagePayloadCompressedSizeBytesKey is the attribute Key
+ // conforming to the "messaging.message.payload_compressed_size_bytes"
+ // semantic conventions. It represents the compressed size of the message
+ // payload in bytes.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 2048
+ MessagingMessagePayloadCompressedSizeBytesKey = attribute.Key("messaging.message.payload_compressed_size_bytes")
+)
+
+// MessagingMessageID returns an attribute KeyValue conforming to the
+// "messaging.message.id" semantic conventions. It represents a value used by
+// the messaging system as an identifier for the message, represented as a
+// string.
+func MessagingMessageID(val string) attribute.KeyValue {
+ return MessagingMessageIDKey.String(val)
+}
+
+// MessagingMessageConversationID returns an attribute KeyValue conforming
+// to the "messaging.message.conversation_id" semantic conventions. It
+// represents the [conversation ID](#conversations) identifying the
+// conversation to which the message belongs, represented as a string.
+// Sometimes called "Correlation ID".
+func MessagingMessageConversationID(val string) attribute.KeyValue {
+ return MessagingMessageConversationIDKey.String(val)
+}
+
+// MessagingMessagePayloadSizeBytes returns an attribute KeyValue conforming
+// to the "messaging.message.payload_size_bytes" semantic conventions. It
+// represents the (uncompressed) size of the message payload in bytes. Also use
+// this attribute if it is unknown whether the compressed or uncompressed
+// payload size is reported.
+func MessagingMessagePayloadSizeBytes(val int) attribute.KeyValue {
+ return MessagingMessagePayloadSizeBytesKey.Int(val)
+}
+
+// MessagingMessagePayloadCompressedSizeBytes returns an attribute KeyValue
+// conforming to the "messaging.message.payload_compressed_size_bytes" semantic
+// conventions. It represents the compressed size of the message payload in
+// bytes.
+func MessagingMessagePayloadCompressedSizeBytes(val int) attribute.KeyValue {
+ return MessagingMessagePayloadCompressedSizeBytesKey.Int(val)
+}
+
+// Semantic convention for attributes that describe messaging destination on
+// broker
+const (
+ // MessagingDestinationNameKey is the attribute Key conforming to the
+ // "messaging.destination.name" semantic conventions. It represents the
+ // message destination name
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'MyQueue', 'MyTopic'
+ // Note: Destination name SHOULD uniquely identify a specific queue, topic
+ // or other entity within the broker. If
+ // the broker does not have such notion, the destination name SHOULD
+ // uniquely identify the broker.
+ MessagingDestinationNameKey = attribute.Key("messaging.destination.name")
+
+ // MessagingDestinationTemplateKey is the attribute Key conforming to the
+ // "messaging.destination.template" semantic conventions. It represents the
+ // low cardinality representation of the messaging destination name
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '/customers/{customerID}'
+ // Note: Destination names could be constructed from templates. An example
+ // would be a destination name involving a user name or product id.
+ // Although the destination name in this case is of high cardinality, the
+ // underlying template is of low cardinality and can be effectively used
+ // for grouping and aggregation.
+ MessagingDestinationTemplateKey = attribute.Key("messaging.destination.template")
+
+ // MessagingDestinationTemporaryKey is the attribute Key conforming to the
+ // "messaging.destination.temporary" semantic conventions. It represents a
+ // boolean that is true if the message destination is temporary and might
+ // not exist anymore after messages are processed.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: stable
+ MessagingDestinationTemporaryKey = attribute.Key("messaging.destination.temporary")
+
+ // MessagingDestinationAnonymousKey is the attribute Key conforming to the
+ // "messaging.destination.anonymous" semantic conventions. It represents a
+ // boolean that is true if the message destination is anonymous (could be
+ // unnamed or have auto-generated name).
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: stable
+ MessagingDestinationAnonymousKey = attribute.Key("messaging.destination.anonymous")
+)
+
+// MessagingDestinationName returns an attribute KeyValue conforming to the
+// "messaging.destination.name" semantic conventions. It represents the message
+// destination name
+func MessagingDestinationName(val string) attribute.KeyValue {
+ return MessagingDestinationNameKey.String(val)
+}
+
+// MessagingDestinationTemplate returns an attribute KeyValue conforming to
+// the "messaging.destination.template" semantic conventions. It represents the
+// low cardinality representation of the messaging destination name
+func MessagingDestinationTemplate(val string) attribute.KeyValue {
+ return MessagingDestinationTemplateKey.String(val)
+}
+
+// MessagingDestinationTemporary returns an attribute KeyValue conforming to
+// the "messaging.destination.temporary" semantic conventions. It represents a
+// boolean that is true if the message destination is temporary and might not
+// exist anymore after messages are processed.
+func MessagingDestinationTemporary(val bool) attribute.KeyValue {
+ return MessagingDestinationTemporaryKey.Bool(val)
+}
+
+// MessagingDestinationAnonymous returns an attribute KeyValue conforming to
+// the "messaging.destination.anonymous" semantic conventions. It represents a
+// boolean that is true if the message destination is anonymous (could be
+// unnamed or have auto-generated name).
+func MessagingDestinationAnonymous(val bool) attribute.KeyValue {
+ return MessagingDestinationAnonymousKey.Bool(val)
+}
+
+// Semantic convention for attributes that describe messaging source on broker
+const (
+ // MessagingSourceNameKey is the attribute Key conforming to the
+ // "messaging.source.name" semantic conventions. It represents the message
+ // source name
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'MyQueue', 'MyTopic'
+ // Note: Source name SHOULD uniquely identify a specific queue, topic, or
+ // other entity within the broker. If
+ // the broker does not have such notion, the source name SHOULD uniquely
+ // identify the broker.
+ MessagingSourceNameKey = attribute.Key("messaging.source.name")
+
+ // MessagingSourceTemplateKey is the attribute Key conforming to the
+ // "messaging.source.template" semantic conventions. It represents the low
+ // cardinality representation of the messaging source name
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '/customers/{customerID}'
+ // Note: Source names could be constructed from templates. An example would
+ // be a source name involving a user name or product id. Although the
+ // source name in this case is of high cardinality, the underlying template
+ // is of low cardinality and can be effectively used for grouping and
+ // aggregation.
+ MessagingSourceTemplateKey = attribute.Key("messaging.source.template")
+
+ // MessagingSourceTemporaryKey is the attribute Key conforming to the
+ // "messaging.source.temporary" semantic conventions. It represents a
+ // boolean that is true if the message source is temporary and might not
+ // exist anymore after messages are processed.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: stable
+ MessagingSourceTemporaryKey = attribute.Key("messaging.source.temporary")
+
+ // MessagingSourceAnonymousKey is the attribute Key conforming to the
+ // "messaging.source.anonymous" semantic conventions. It represents a
+ // boolean that is true if the message source is anonymous (could be
+ // unnamed or have auto-generated name).
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: stable
+ MessagingSourceAnonymousKey = attribute.Key("messaging.source.anonymous")
+)
+
+// MessagingSourceName returns an attribute KeyValue conforming to the
+// "messaging.source.name" semantic conventions. It represents the message
+// source name
+func MessagingSourceName(val string) attribute.KeyValue {
+ return MessagingSourceNameKey.String(val)
+}
+
+// MessagingSourceTemplate returns an attribute KeyValue conforming to the
+// "messaging.source.template" semantic conventions. It represents the low
+// cardinality representation of the messaging source name
+func MessagingSourceTemplate(val string) attribute.KeyValue {
+ return MessagingSourceTemplateKey.String(val)
+}
+
+// MessagingSourceTemporary returns an attribute KeyValue conforming to the
+// "messaging.source.temporary" semantic conventions. It represents a boolean
+// that is true if the message source is temporary and might not exist anymore
+// after messages are processed.
+func MessagingSourceTemporary(val bool) attribute.KeyValue {
+ return MessagingSourceTemporaryKey.Bool(val)
+}
+
+// MessagingSourceAnonymous returns an attribute KeyValue conforming to the
+// "messaging.source.anonymous" semantic conventions. It represents a boolean
+// that is true if the message source is anonymous (could be unnamed or have
+// auto-generated name).
+func MessagingSourceAnonymous(val bool) attribute.KeyValue {
+ return MessagingSourceAnonymousKey.Bool(val)
+}
+
+// Attributes for RabbitMQ
+const (
+ // MessagingRabbitmqDestinationRoutingKeyKey is the attribute Key
+ // conforming to the "messaging.rabbitmq.destination.routing_key" semantic
+ // conventions. It represents the rabbitMQ message routing key.
+ //
+ // Type: string
+ // RequirementLevel: ConditionallyRequired (If not empty.)
+ // Stability: stable
+ // Examples: 'myKey'
+ MessagingRabbitmqDestinationRoutingKeyKey = attribute.Key("messaging.rabbitmq.destination.routing_key")
+)
+
+// MessagingRabbitmqDestinationRoutingKey returns an attribute KeyValue
+// conforming to the "messaging.rabbitmq.destination.routing_key" semantic
+// conventions. It represents the rabbitMQ message routing key.
+func MessagingRabbitmqDestinationRoutingKey(val string) attribute.KeyValue {
+ return MessagingRabbitmqDestinationRoutingKeyKey.String(val)
+}
+
+// Attributes for Apache Kafka
+const (
+ // MessagingKafkaMessageKeyKey is the attribute Key conforming to the
+ // "messaging.kafka.message.key" semantic conventions. It represents the
+ // message keys in Kafka are used for grouping alike messages to ensure
+ // they're processed on the same partition. They differ from
+ // `messaging.message.id` in that they're not unique. If the key is `null`,
+ // the attribute MUST NOT be set.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'myKey'
+ // Note: If the key type is not string, it's string representation has to
+ // be supplied for the attribute. If the key has no unambiguous, canonical
+ // string form, don't include its value.
+ MessagingKafkaMessageKeyKey = attribute.Key("messaging.kafka.message.key")
+
+ // MessagingKafkaConsumerGroupKey is the attribute Key conforming to the
+ // "messaging.kafka.consumer.group" semantic conventions. It represents the
+ // name of the Kafka Consumer Group that is handling the message. Only
+ // applies to consumers, not producers.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'my-group'
+ MessagingKafkaConsumerGroupKey = attribute.Key("messaging.kafka.consumer.group")
+
+ // MessagingKafkaClientIDKey is the attribute Key conforming to the
+ // "messaging.kafka.client_id" semantic conventions. It represents the
+ // client ID for the Consumer or Producer that is handling the message.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'client-5'
+ MessagingKafkaClientIDKey = attribute.Key("messaging.kafka.client_id")
+
+ // MessagingKafkaDestinationPartitionKey is the attribute Key conforming to
+ // the "messaging.kafka.destination.partition" semantic conventions. It
+ // represents the partition the message is sent to.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 2
+ MessagingKafkaDestinationPartitionKey = attribute.Key("messaging.kafka.destination.partition")
+
+ // MessagingKafkaSourcePartitionKey is the attribute Key conforming to the
+ // "messaging.kafka.source.partition" semantic conventions. It represents
+ // the partition the message is received from.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 2
+ MessagingKafkaSourcePartitionKey = attribute.Key("messaging.kafka.source.partition")
+
+ // MessagingKafkaMessageOffsetKey is the attribute Key conforming to the
+ // "messaging.kafka.message.offset" semantic conventions. It represents the
+ // offset of a record in the corresponding Kafka partition.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 42
+ MessagingKafkaMessageOffsetKey = attribute.Key("messaging.kafka.message.offset")
+
+ // MessagingKafkaMessageTombstoneKey is the attribute Key conforming to the
+ // "messaging.kafka.message.tombstone" semantic conventions. It represents
+ // a boolean that is true if the message is a tombstone.
+ //
+ // Type: boolean
+ // RequirementLevel: ConditionallyRequired (If value is `true`. When
+ // missing, the value is assumed to be `false`.)
+ // Stability: stable
+ MessagingKafkaMessageTombstoneKey = attribute.Key("messaging.kafka.message.tombstone")
+)
+
+// MessagingKafkaMessageKey returns an attribute KeyValue conforming to the
+// "messaging.kafka.message.key" semantic conventions. It represents the
+// message keys in Kafka are used for grouping alike messages to ensure they're
+// processed on the same partition. They differ from `messaging.message.id` in
+// that they're not unique. If the key is `null`, the attribute MUST NOT be
+// set.
+func MessagingKafkaMessageKey(val string) attribute.KeyValue {
+ return MessagingKafkaMessageKeyKey.String(val)
+}
+
+// MessagingKafkaConsumerGroup returns an attribute KeyValue conforming to
+// the "messaging.kafka.consumer.group" semantic conventions. It represents the
+// name of the Kafka Consumer Group that is handling the message. Only applies
+// to consumers, not producers.
+func MessagingKafkaConsumerGroup(val string) attribute.KeyValue {
+ return MessagingKafkaConsumerGroupKey.String(val)
+}
+
+// MessagingKafkaClientID returns an attribute KeyValue conforming to the
+// "messaging.kafka.client_id" semantic conventions. It represents the client
+// ID for the Consumer or Producer that is handling the message.
+func MessagingKafkaClientID(val string) attribute.KeyValue {
+ return MessagingKafkaClientIDKey.String(val)
+}
+
+// MessagingKafkaDestinationPartition returns an attribute KeyValue
+// conforming to the "messaging.kafka.destination.partition" semantic
+// conventions. It represents the partition the message is sent to.
+func MessagingKafkaDestinationPartition(val int) attribute.KeyValue {
+ return MessagingKafkaDestinationPartitionKey.Int(val)
+}
+
+// MessagingKafkaSourcePartition returns an attribute KeyValue conforming to
+// the "messaging.kafka.source.partition" semantic conventions. It represents
+// the partition the message is received from.
+func MessagingKafkaSourcePartition(val int) attribute.KeyValue {
+ return MessagingKafkaSourcePartitionKey.Int(val)
+}
+
+// MessagingKafkaMessageOffset returns an attribute KeyValue conforming to
+// the "messaging.kafka.message.offset" semantic conventions. It represents the
+// offset of a record in the corresponding Kafka partition.
+func MessagingKafkaMessageOffset(val int) attribute.KeyValue {
+ return MessagingKafkaMessageOffsetKey.Int(val)
+}
+
+// MessagingKafkaMessageTombstone returns an attribute KeyValue conforming
+// to the "messaging.kafka.message.tombstone" semantic conventions. It
+// represents a boolean that is true if the message is a tombstone.
+func MessagingKafkaMessageTombstone(val bool) attribute.KeyValue {
+ return MessagingKafkaMessageTombstoneKey.Bool(val)
+}
+
+// Attributes for Apache RocketMQ
+const (
+ // MessagingRocketmqNamespaceKey is the attribute Key conforming to the
+ // "messaging.rocketmq.namespace" semantic conventions. It represents the
+ // namespace of RocketMQ resources, resources in different namespaces are
+ // individual.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: stable
+ // Examples: 'myNamespace'
+ MessagingRocketmqNamespaceKey = attribute.Key("messaging.rocketmq.namespace")
+
+ // MessagingRocketmqClientGroupKey is the attribute Key conforming to the
+ // "messaging.rocketmq.client_group" semantic conventions. It represents
+ // the name of the RocketMQ producer/consumer group that is handling the
+ // message. The client type is identified by the SpanKind.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: stable
+ // Examples: 'myConsumerGroup'
+ MessagingRocketmqClientGroupKey = attribute.Key("messaging.rocketmq.client_group")
+
+ // MessagingRocketmqClientIDKey is the attribute Key conforming to the
+ // "messaging.rocketmq.client_id" semantic conventions. It represents the
+ // unique identifier for each client.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: stable
+ // Examples: 'myhost@8742@s8083jm'
+ MessagingRocketmqClientIDKey = attribute.Key("messaging.rocketmq.client_id")
+
+ // MessagingRocketmqMessageDeliveryTimestampKey is the attribute Key
+ // conforming to the "messaging.rocketmq.message.delivery_timestamp"
+ // semantic conventions. It represents the timestamp in milliseconds that
+ // the delay message is expected to be delivered to consumer.
+ //
+ // Type: int
+ // RequirementLevel: ConditionallyRequired (If the message type is delay
+ // and delay time level is not specified.)
+ // Stability: stable
+ // Examples: 1665987217045
+ MessagingRocketmqMessageDeliveryTimestampKey = attribute.Key("messaging.rocketmq.message.delivery_timestamp")
+
+ // MessagingRocketmqMessageDelayTimeLevelKey is the attribute Key
+ // conforming to the "messaging.rocketmq.message.delay_time_level" semantic
+ // conventions. It represents the delay time level for delay message, which
+ // determines the message delay time.
+ //
+ // Type: int
+ // RequirementLevel: ConditionallyRequired (If the message type is delay
+ // and delivery timestamp is not specified.)
+ // Stability: stable
+ // Examples: 3
+ MessagingRocketmqMessageDelayTimeLevelKey = attribute.Key("messaging.rocketmq.message.delay_time_level")
+
+ // MessagingRocketmqMessageGroupKey is the attribute Key conforming to the
+ // "messaging.rocketmq.message.group" semantic conventions. It represents
+ // the it is essential for FIFO message. Messages that belong to the same
+ // message group are always processed one by one within the same consumer
+ // group.
+ //
+ // Type: string
+ // RequirementLevel: ConditionallyRequired (If the message type is FIFO.)
+ // Stability: stable
+ // Examples: 'myMessageGroup'
+ MessagingRocketmqMessageGroupKey = attribute.Key("messaging.rocketmq.message.group")
+
+ // MessagingRocketmqMessageTypeKey is the attribute Key conforming to the
+ // "messaging.rocketmq.message.type" semantic conventions. It represents
+ // the type of message.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ MessagingRocketmqMessageTypeKey = attribute.Key("messaging.rocketmq.message.type")
+
+ // MessagingRocketmqMessageTagKey is the attribute Key conforming to the
+ // "messaging.rocketmq.message.tag" semantic conventions. It represents the
+ // secondary classifier of message besides topic.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'tagA'
+ MessagingRocketmqMessageTagKey = attribute.Key("messaging.rocketmq.message.tag")
+
+ // MessagingRocketmqMessageKeysKey is the attribute Key conforming to the
+ // "messaging.rocketmq.message.keys" semantic conventions. It represents
+ // the key(s) of message, another way to mark message besides message id.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'keyA', 'keyB'
+ MessagingRocketmqMessageKeysKey = attribute.Key("messaging.rocketmq.message.keys")
+
+ // MessagingRocketmqConsumptionModelKey is the attribute Key conforming to
+ // the "messaging.rocketmq.consumption_model" semantic conventions. It
+ // represents the model of message consumption. This only applies to
+ // consumer spans.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ MessagingRocketmqConsumptionModelKey = attribute.Key("messaging.rocketmq.consumption_model")
+)
+
+var (
+ // Normal message
+ MessagingRocketmqMessageTypeNormal = MessagingRocketmqMessageTypeKey.String("normal")
+ // FIFO message
+ MessagingRocketmqMessageTypeFifo = MessagingRocketmqMessageTypeKey.String("fifo")
+ // Delay message
+ MessagingRocketmqMessageTypeDelay = MessagingRocketmqMessageTypeKey.String("delay")
+ // Transaction message
+ MessagingRocketmqMessageTypeTransaction = MessagingRocketmqMessageTypeKey.String("transaction")
+)
+
+var (
+ // Clustering consumption model
+ MessagingRocketmqConsumptionModelClustering = MessagingRocketmqConsumptionModelKey.String("clustering")
+ // Broadcasting consumption model
+ MessagingRocketmqConsumptionModelBroadcasting = MessagingRocketmqConsumptionModelKey.String("broadcasting")
+)
+
+// MessagingRocketmqNamespace returns an attribute KeyValue conforming to
+// the "messaging.rocketmq.namespace" semantic conventions. It represents the
+// namespace of RocketMQ resources, resources in different namespaces are
+// individual.
+func MessagingRocketmqNamespace(val string) attribute.KeyValue {
+ return MessagingRocketmqNamespaceKey.String(val)
+}
+
+// MessagingRocketmqClientGroup returns an attribute KeyValue conforming to
+// the "messaging.rocketmq.client_group" semantic conventions. It represents
+// the name of the RocketMQ producer/consumer group that is handling the
+// message. The client type is identified by the SpanKind.
+func MessagingRocketmqClientGroup(val string) attribute.KeyValue {
+ return MessagingRocketmqClientGroupKey.String(val)
+}
+
+// MessagingRocketmqClientID returns an attribute KeyValue conforming to the
+// "messaging.rocketmq.client_id" semantic conventions. It represents the
+// unique identifier for each client.
+func MessagingRocketmqClientID(val string) attribute.KeyValue {
+ return MessagingRocketmqClientIDKey.String(val)
+}
+
+// MessagingRocketmqMessageDeliveryTimestamp returns an attribute KeyValue
+// conforming to the "messaging.rocketmq.message.delivery_timestamp" semantic
+// conventions. It represents the timestamp in milliseconds that the delay
+// message is expected to be delivered to consumer.
+func MessagingRocketmqMessageDeliveryTimestamp(val int) attribute.KeyValue {
+ return MessagingRocketmqMessageDeliveryTimestampKey.Int(val)
+}
+
+// MessagingRocketmqMessageDelayTimeLevel returns an attribute KeyValue
+// conforming to the "messaging.rocketmq.message.delay_time_level" semantic
+// conventions. It represents the delay time level for delay message, which
+// determines the message delay time.
+func MessagingRocketmqMessageDelayTimeLevel(val int) attribute.KeyValue {
+ return MessagingRocketmqMessageDelayTimeLevelKey.Int(val)
+}
+
+// MessagingRocketmqMessageGroup returns an attribute KeyValue conforming to
+// the "messaging.rocketmq.message.group" semantic conventions. It represents
+// the it is essential for FIFO message. Messages that belong to the same
+// message group are always processed one by one within the same consumer
+// group.
+func MessagingRocketmqMessageGroup(val string) attribute.KeyValue {
+ return MessagingRocketmqMessageGroupKey.String(val)
+}
+
+// MessagingRocketmqMessageTag returns an attribute KeyValue conforming to
+// the "messaging.rocketmq.message.tag" semantic conventions. It represents the
+// secondary classifier of message besides topic.
+func MessagingRocketmqMessageTag(val string) attribute.KeyValue {
+ return MessagingRocketmqMessageTagKey.String(val)
+}
+
+// MessagingRocketmqMessageKeys returns an attribute KeyValue conforming to
+// the "messaging.rocketmq.message.keys" semantic conventions. It represents
+// the key(s) of message, another way to mark message besides message id.
+func MessagingRocketmqMessageKeys(val ...string) attribute.KeyValue {
+ return MessagingRocketmqMessageKeysKey.StringSlice(val)
+}
+
+// Describes user-agent attributes.
+const (
+ // UserAgentOriginalKey is the attribute Key conforming to the
+ // "user_agent.original" semantic conventions. It represents the value of
+ // the [HTTP
+ // User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent)
+ // header sent by the client.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'CERN-LineMode/2.15 libwww/2.17b3'
+ UserAgentOriginalKey = attribute.Key("user_agent.original")
+)
+
+// UserAgentOriginal returns an attribute KeyValue conforming to the
+// "user_agent.original" semantic conventions. It represents the value of the
+// [HTTP
+// User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent)
+// header sent by the client.
+func UserAgentOriginal(val string) attribute.KeyValue {
+ return UserAgentOriginalKey.String(val)
+}
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/doc.go b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/doc.go
new file mode 100644
index 00000000..0d1f55a8
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/doc.go
@@ -0,0 +1,9 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Package semconv implements OpenTelemetry semantic conventions.
+//
+// OpenTelemetry semantic conventions are agreed standardized naming
+// patterns for OpenTelemetry things. This package represents the conventions
+// as of the v1.20.0 version of the OpenTelemetry specification.
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.20.0"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/event.go b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/event.go
similarity index 92%
rename from vendor/go.opentelemetry.io/otel/semconv/v1.17.0/event.go
rename to vendor/go.opentelemetry.io/otel/semconv/v1.20.0/event.go
index 679c40c4..63776393 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/event.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/event.go
@@ -1,20 +1,9 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
// Code generated from semantic convention specification. DO NOT EDIT.
-package semconv // import "go.opentelemetry.io/otel/semconv/v1.17.0"
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.20.0"
import "go.opentelemetry.io/otel/attribute"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/exception.go b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/exception.go
new file mode 100644
index 00000000..f40c9782
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/exception.go
@@ -0,0 +1,9 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.20.0"
+
+const (
+ // ExceptionEventName is the name of the Span event representing an exception.
+ ExceptionEventName = "exception"
+)
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/http.go b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/http.go
new file mode 100644
index 00000000..9c184063
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/http.go
@@ -0,0 +1,10 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.20.0"
+
+// HTTP scheme attributes.
+var (
+ HTTPSchemeHTTP = HTTPSchemeKey.String("http")
+ HTTPSchemeHTTPS = HTTPSchemeKey.String("https")
+)
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/resource.go b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/resource.go
similarity index 92%
rename from vendor/go.opentelemetry.io/otel/semconv/v1.17.0/resource.go
rename to vendor/go.opentelemetry.io/otel/semconv/v1.20.0/resource.go
index 39a2eab3..3d44dae2 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/resource.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/resource.go
@@ -1,20 +1,9 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
// Code generated from semantic convention specification. DO NOT EDIT.
-package semconv // import "go.opentelemetry.io/otel/semconv/v1.17.0"
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.20.0"
import "go.opentelemetry.io/otel/attribute"
@@ -71,22 +60,6 @@ const (
// SHOULD be left unset.
BrowserMobileKey = attribute.Key("browser.mobile")
- // BrowserUserAgentKey is the attribute Key conforming to the
- // "browser.user_agent" semantic conventions. It represents the full
- // user-agent string provided by the browser
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)
- // AppleWebKit/537.36 (KHTML, '
- // 'like Gecko) Chrome/95.0.4638.54 Safari/537.36'
- // Note: The user-agent value SHOULD be provided only from browsers that do
- // not have a mechanism to retrieve brands and platform individually from
- // the User-Agent Client Hints API. To retrieve the value, the legacy
- // `navigator.userAgent` API can be used.
- BrowserUserAgentKey = attribute.Key("browser.user_agent")
-
// BrowserLanguageKey is the attribute Key conforming to the
// "browser.language" semantic conventions. It represents the preferred
// language of the user using the browser
@@ -121,13 +94,6 @@ func BrowserMobile(val bool) attribute.KeyValue {
return BrowserMobileKey.Bool(val)
}
-// BrowserUserAgent returns an attribute KeyValue conforming to the
-// "browser.user_agent" semantic conventions. It represents the full user-agent
-// string provided by the browser
-func BrowserUserAgent(val string) attribute.KeyValue {
- return BrowserUserAgentKey.String(val)
-}
-
// BrowserLanguage returns an attribute KeyValue conforming to the
// "browser.language" semantic conventions. It represents the preferred
// language of the user using the browser
@@ -171,9 +137,56 @@ const (
// regions](https://azure.microsoft.com/en-us/global-infrastructure/geographies/),
// [Google Cloud regions](https://cloud.google.com/about/locations), or
// [Tencent Cloud
- // regions](https://intl.cloud.tencent.com/document/product/213/6091).
+ // regions](https://www.tencentcloud.com/document/product/213/6091).
CloudRegionKey = attribute.Key("cloud.region")
+ // CloudResourceIDKey is the attribute Key conforming to the
+ // "cloud.resource_id" semantic conventions. It represents the cloud
+ // provider-specific native identifier of the monitored cloud resource
+ // (e.g. an
+ // [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
+ // on AWS, a [fully qualified resource
+ // ID](https://learn.microsoft.com/en-us/rest/api/resources/resources/get-by-id)
+ // on Azure, a [full resource
+ // name](https://cloud.google.com/apis/design/resource_names#full_resource_name)
+ // on GCP)
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function',
+ // '//run.googleapis.com/projects/PROJECT_ID/locations/LOCATION_ID/services/SERVICE_ID',
+ // '/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/'
+ // Note: On some cloud providers, it may not be possible to determine the
+ // full ID at startup,
+ // so it may be necessary to set `cloud.resource_id` as a span attribute
+ // instead.
+ //
+ // The exact value to use for `cloud.resource_id` depends on the cloud
+ // provider.
+ // The following well-known definitions MUST be used if you set this
+ // attribute and they apply:
+ //
+ // * **AWS Lambda:** The function
+ // [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html).
+ // Take care not to use the "invoked ARN" directly but replace any
+ // [alias
+ // suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html)
+ // with the resolved function version, as the same runtime instance may
+ // be invokable with
+ // multiple different aliases.
+ // * **GCP:** The [URI of the
+ // resource](https://cloud.google.com/iam/docs/full-resource-names)
+ // * **Azure:** The [Fully Qualified Resource
+ // ID](https://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id)
+ // of the invoked function,
+ // *not* the function app, having the form
+ // `/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/`.
+ // This means that a span attribute MUST be used, as an Azure function
+ // app can host multiple functions that would usually share
+ // a TracerProvider.
+ CloudResourceIDKey = attribute.Key("cloud.resource_id")
+
// CloudAvailabilityZoneKey is the attribute Key conforming to the
// "cloud.availability_zone" semantic conventions. It represents the cloud
// regions often have multiple, isolated locations known as zones to
@@ -208,6 +221,8 @@ var (
CloudProviderAzure = CloudProviderKey.String("azure")
// Google Cloud Platform
CloudProviderGCP = CloudProviderKey.String("gcp")
+ // Heroku Platform as a Service
+ CloudProviderHeroku = CloudProviderKey.String("heroku")
// IBM Cloud
CloudProviderIbmCloud = CloudProviderKey.String("ibm_cloud")
// Tencent Cloud
@@ -258,7 +273,7 @@ var (
// Google Cloud App Engine (GAE)
CloudPlatformGCPAppEngine = CloudPlatformKey.String("gcp_app_engine")
// Red Hat OpenShift on Google Cloud
- CloudPlatformGoogleCloudOpenshift = CloudPlatformKey.String("google_cloud_openshift")
+ CloudPlatformGCPOpenshift = CloudPlatformKey.String("gcp_openshift")
// Red Hat OpenShift on IBM Cloud
CloudPlatformIbmCloudOpenshift = CloudPlatformKey.String("ibm_cloud_openshift")
// Tencent Cloud Cloud Virtual Machine (CVM)
@@ -283,6 +298,19 @@ func CloudRegion(val string) attribute.KeyValue {
return CloudRegionKey.String(val)
}
+// CloudResourceID returns an attribute KeyValue conforming to the
+// "cloud.resource_id" semantic conventions. It represents the cloud
+// provider-specific native identifier of the monitored cloud resource (e.g. an
+// [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
+// on AWS, a [fully qualified resource
+// ID](https://learn.microsoft.com/en-us/rest/api/resources/resources/get-by-id)
+// on Azure, a [full resource
+// name](https://cloud.google.com/apis/design/resource_names#full_resource_name)
+// on GCP)
+func CloudResourceID(val string) attribute.KeyValue {
+ return CloudResourceIDKey.String(val)
+}
+
// CloudAvailabilityZone returns an attribute KeyValue conforming to the
// "cloud.availability_zone" semantic conventions. It represents the cloud
// regions often have multiple, isolated locations known as zones to increase
@@ -506,6 +534,60 @@ func AWSLogStreamARNs(val ...string) attribute.KeyValue {
return AWSLogStreamARNsKey.StringSlice(val)
}
+// Heroku dyno metadata
+const (
+ // HerokuReleaseCreationTimestampKey is the attribute Key conforming to the
+ // "heroku.release.creation_timestamp" semantic conventions. It represents
+ // the time and date the release was created
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '2022-10-23T18:00:42Z'
+ HerokuReleaseCreationTimestampKey = attribute.Key("heroku.release.creation_timestamp")
+
+ // HerokuReleaseCommitKey is the attribute Key conforming to the
+ // "heroku.release.commit" semantic conventions. It represents the commit
+ // hash for the current release
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'e6134959463efd8966b20e75b913cafe3f5ec'
+ HerokuReleaseCommitKey = attribute.Key("heroku.release.commit")
+
+ // HerokuAppIDKey is the attribute Key conforming to the "heroku.app.id"
+ // semantic conventions. It represents the unique identifier for the
+ // application
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '2daa2797-e42b-4624-9322-ec3f968df4da'
+ HerokuAppIDKey = attribute.Key("heroku.app.id")
+)
+
+// HerokuReleaseCreationTimestamp returns an attribute KeyValue conforming
+// to the "heroku.release.creation_timestamp" semantic conventions. It
+// represents the time and date the release was created
+func HerokuReleaseCreationTimestamp(val string) attribute.KeyValue {
+ return HerokuReleaseCreationTimestampKey.String(val)
+}
+
+// HerokuReleaseCommit returns an attribute KeyValue conforming to the
+// "heroku.release.commit" semantic conventions. It represents the commit hash
+// for the current release
+func HerokuReleaseCommit(val string) attribute.KeyValue {
+ return HerokuReleaseCommitKey.String(val)
+}
+
+// HerokuAppID returns an attribute KeyValue conforming to the
+// "heroku.app.id" semantic conventions. It represents the unique identifier
+// for the application
+func HerokuAppID(val string) attribute.KeyValue {
+ return HerokuAppIDKey.String(val)
+}
+
// A container instance.
const (
// ContainerNameKey is the attribute Key conforming to the "container.name"
@@ -741,43 +823,9 @@ const (
// can also be seen in the resource JSON for the function).
// This means that a span attribute MUST be used, as an Azure function
// app can host multiple functions that would usually share
- // a TracerProvider (see also the `faas.id` attribute).
+ // a TracerProvider (see also the `cloud.resource_id` attribute).
FaaSNameKey = attribute.Key("faas.name")
- // FaaSIDKey is the attribute Key conforming to the "faas.id" semantic
- // conventions. It represents the unique ID of the single function that
- // this runtime instance executes.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'arn:aws:lambda:us-west-2:123456789012:function:my-function'
- // Note: On some cloud providers, it may not be possible to determine the
- // full ID at startup,
- // so consider setting `faas.id` as a span attribute instead.
- //
- // The exact value to use for `faas.id` depends on the cloud provider:
- //
- // * **AWS Lambda:** The function
- // [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html).
- // Take care not to use the "invoked ARN" directly but replace any
- // [alias
- // suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html)
- // with the resolved function version, as the same runtime instance may
- // be invokable with
- // multiple different aliases.
- // * **GCP:** The [URI of the
- // resource](https://cloud.google.com/iam/docs/full-resource-names)
- // * **Azure:** The [Fully Qualified Resource
- // ID](https://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id)
- // of the invoked function,
- // *not* the function app, having the form
- // `/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/`.
- // This means that a span attribute MUST be used, as an Azure function
- // app can host multiple functions that would usually share
- // a TracerProvider.
- FaaSIDKey = attribute.Key("faas.id")
-
// FaaSVersionKey is the attribute Key conforming to the "faas.version"
// semantic conventions. It represents the immutable version of the
// function being executed.
@@ -814,16 +862,17 @@ const (
// FaaSMaxMemoryKey is the attribute Key conforming to the
// "faas.max_memory" semantic conventions. It represents the amount of
- // memory available to the serverless function in MiB.
+ // memory available to the serverless function converted to Bytes.
//
// Type: int
// RequirementLevel: Optional
// Stability: stable
- // Examples: 128
+ // Examples: 134217728
// Note: It's recommended to set this attribute since e.g. too little
// memory can easily stop a Java AWS Lambda function from working
// correctly. On AWS Lambda, the environment variable
- // `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information.
+ // `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information (which must
+ // be multiplied by 1,048,576).
FaaSMaxMemoryKey = attribute.Key("faas.max_memory")
)
@@ -834,13 +883,6 @@ func FaaSName(val string) attribute.KeyValue {
return FaaSNameKey.String(val)
}
-// FaaSID returns an attribute KeyValue conforming to the "faas.id" semantic
-// conventions. It represents the unique ID of the single function that this
-// runtime instance executes.
-func FaaSID(val string) attribute.KeyValue {
- return FaaSIDKey.String(val)
-}
-
// FaaSVersion returns an attribute KeyValue conforming to the
// "faas.version" semantic conventions. It represents the immutable version of
// the function being executed.
@@ -858,7 +900,7 @@ func FaaSInstance(val string) attribute.KeyValue {
// FaaSMaxMemory returns an attribute KeyValue conforming to the
// "faas.max_memory" semantic conventions. It represents the amount of memory
-// available to the serverless function in MiB.
+// available to the serverless function converted to Bytes.
func FaaSMaxMemory(val int) attribute.KeyValue {
return FaaSMaxMemoryKey.Int(val)
}
@@ -868,8 +910,8 @@ const (
// HostIDKey is the attribute Key conforming to the "host.id" semantic
// conventions. It represents the unique host ID. For Cloud, this must be
// the instance_id assigned by the cloud provider. For non-containerized
- // Linux systems, the `machine-id` located in `/etc/machine-id` or
- // `/var/lib/dbus/machine-id` may be used.
+ // systems, this should be the `machine-id`. See the table below for the
+ // sources to use to determine the `machine-id` based on operating system.
//
// Type: string
// RequirementLevel: Optional
@@ -960,9 +1002,9 @@ var (
// HostID returns an attribute KeyValue conforming to the "host.id" semantic
// conventions. It represents the unique host ID. For Cloud, this must be the
-// instance_id assigned by the cloud provider. For non-containerized Linux
-// systems, the `machine-id` located in `/etc/machine-id` or
-// `/var/lib/dbus/machine-id` may be used.
+// instance_id assigned by the cloud provider. For non-containerized systems,
+// this should be the `machine-id`. See the table below for the sources to use
+// to determine the `machine-id` based on operating system.
func HostID(val string) attribute.KeyValue {
return HostIDKey.String(val)
}
@@ -1706,7 +1748,17 @@ const (
// `unknown_service:bash`. If `process.executable.name` is not available,
// the value MUST be set to `unknown_service`.
ServiceNameKey = attribute.Key("service.name")
+)
+// ServiceName returns an attribute KeyValue conforming to the
+// "service.name" semantic conventions. It represents the logical name of the
+// service.
+func ServiceName(val string) attribute.KeyValue {
+ return ServiceNameKey.String(val)
+}
+
+// A service instance.
+const (
// ServiceNamespaceKey is the attribute Key conforming to the
// "service.namespace" semantic conventions. It represents a namespace for
// `service.name`.
@@ -1732,7 +1784,8 @@ const (
// Type: string
// RequirementLevel: Optional
// Stability: stable
- // Examples: '627cc493-f310-47de-96bd-71410b7dec09'
+ // Examples: 'my-k8s-pod-deployment-1',
+ // '627cc493-f310-47de-96bd-71410b7dec09'
// Note: MUST be unique for each instance of the same
// `service.namespace,service.name` pair (in other words
// `service.namespace,service.name,service.instance.id` triplet MUST be
@@ -1759,13 +1812,6 @@ const (
ServiceVersionKey = attribute.Key("service.version")
)
-// ServiceName returns an attribute KeyValue conforming to the
-// "service.name" semantic conventions. It represents the logical name of the
-// service.
-func ServiceName(val string) attribute.KeyValue {
- return ServiceNameKey.String(val)
-}
-
// ServiceNamespace returns an attribute KeyValue conforming to the
// "service.namespace" semantic conventions. It represents a namespace for
// `service.name`.
@@ -1795,7 +1841,7 @@ const (
// telemetry SDK as defined above.
//
// Type: string
- // RequirementLevel: Optional
+ // RequirementLevel: Required
// Stability: stable
// Examples: 'opentelemetry'
TelemetrySDKNameKey = attribute.Key("telemetry.sdk.name")
@@ -1805,7 +1851,7 @@ const (
// language of the telemetry SDK.
//
// Type: Enum
- // RequirementLevel: Optional
+ // RequirementLevel: Required
// Stability: stable
TelemetrySDKLanguageKey = attribute.Key("telemetry.sdk.language")
@@ -1814,20 +1860,10 @@ const (
// string of the telemetry SDK.
//
// Type: string
- // RequirementLevel: Optional
+ // RequirementLevel: Required
// Stability: stable
// Examples: '1.2.3'
TelemetrySDKVersionKey = attribute.Key("telemetry.sdk.version")
-
- // TelemetryAutoVersionKey is the attribute Key conforming to the
- // "telemetry.auto.version" semantic conventions. It represents the version
- // string of the auto instrumentation agent, if used.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: '1.2.3'
- TelemetryAutoVersionKey = attribute.Key("telemetry.auto.version")
)
var (
@@ -1869,6 +1905,20 @@ func TelemetrySDKVersion(val string) attribute.KeyValue {
return TelemetrySDKVersionKey.String(val)
}
+// The telemetry SDK used to capture data recorded by the instrumentation
+// libraries.
+const (
+ // TelemetryAutoVersionKey is the attribute Key conforming to the
+ // "telemetry.auto.version" semantic conventions. It represents the version
+ // string of the auto instrumentation agent, if used.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '1.2.3'
+ TelemetryAutoVersionKey = attribute.Key("telemetry.auto.version")
+)
+
// TelemetryAutoVersion returns an attribute KeyValue conforming to the
// "telemetry.auto.version" semantic conventions. It represents the version
// string of the auto instrumentation agent, if used.
@@ -1936,7 +1986,7 @@ func WebEngineDescription(val string) attribute.KeyValue {
// Attributes used by non-OTLP exporters to represent OpenTelemetry Scope's
// concepts.
const (
- // OtelScopeNameKey is the attribute Key conforming to the
+ // OTelScopeNameKey is the attribute Key conforming to the
// "otel.scope.name" semantic conventions. It represents the name of the
// instrumentation scope - (`InstrumentationScope.Name` in OTLP).
//
@@ -1944,9 +1994,9 @@ const (
// RequirementLevel: Optional
// Stability: stable
// Examples: 'io.opentelemetry.contrib.mongodb'
- OtelScopeNameKey = attribute.Key("otel.scope.name")
+ OTelScopeNameKey = attribute.Key("otel.scope.name")
- // OtelScopeVersionKey is the attribute Key conforming to the
+ // OTelScopeVersionKey is the attribute Key conforming to the
// "otel.scope.version" semantic conventions. It represents the version of
// the instrumentation scope - (`InstrumentationScope.Version` in OTLP).
//
@@ -1954,27 +2004,27 @@ const (
// RequirementLevel: Optional
// Stability: stable
// Examples: '1.0.0'
- OtelScopeVersionKey = attribute.Key("otel.scope.version")
+ OTelScopeVersionKey = attribute.Key("otel.scope.version")
)
-// OtelScopeName returns an attribute KeyValue conforming to the
+// OTelScopeName returns an attribute KeyValue conforming to the
// "otel.scope.name" semantic conventions. It represents the name of the
// instrumentation scope - (`InstrumentationScope.Name` in OTLP).
-func OtelScopeName(val string) attribute.KeyValue {
- return OtelScopeNameKey.String(val)
+func OTelScopeName(val string) attribute.KeyValue {
+ return OTelScopeNameKey.String(val)
}
-// OtelScopeVersion returns an attribute KeyValue conforming to the
+// OTelScopeVersion returns an attribute KeyValue conforming to the
// "otel.scope.version" semantic conventions. It represents the version of the
// instrumentation scope - (`InstrumentationScope.Version` in OTLP).
-func OtelScopeVersion(val string) attribute.KeyValue {
- return OtelScopeVersionKey.String(val)
+func OTelScopeVersion(val string) attribute.KeyValue {
+ return OTelScopeVersionKey.String(val)
}
// Span attributes used by non-OTLP exporters to represent OpenTelemetry
// Scope's concepts.
const (
- // OtelLibraryNameKey is the attribute Key conforming to the
+ // OTelLibraryNameKey is the attribute Key conforming to the
// "otel.library.name" semantic conventions. It represents the deprecated,
// use the `otel.scope.name` attribute.
//
@@ -1982,9 +2032,9 @@ const (
// RequirementLevel: Optional
// Stability: deprecated
// Examples: 'io.opentelemetry.contrib.mongodb'
- OtelLibraryNameKey = attribute.Key("otel.library.name")
+ OTelLibraryNameKey = attribute.Key("otel.library.name")
- // OtelLibraryVersionKey is the attribute Key conforming to the
+ // OTelLibraryVersionKey is the attribute Key conforming to the
// "otel.library.version" semantic conventions. It represents the
// deprecated, use the `otel.scope.version` attribute.
//
@@ -1992,19 +2042,19 @@ const (
// RequirementLevel: Optional
// Stability: deprecated
// Examples: '1.0.0'
- OtelLibraryVersionKey = attribute.Key("otel.library.version")
+ OTelLibraryVersionKey = attribute.Key("otel.library.version")
)
-// OtelLibraryName returns an attribute KeyValue conforming to the
+// OTelLibraryName returns an attribute KeyValue conforming to the
// "otel.library.name" semantic conventions. It represents the deprecated, use
// the `otel.scope.name` attribute.
-func OtelLibraryName(val string) attribute.KeyValue {
- return OtelLibraryNameKey.String(val)
+func OTelLibraryName(val string) attribute.KeyValue {
+ return OTelLibraryNameKey.String(val)
}
-// OtelLibraryVersion returns an attribute KeyValue conforming to the
+// OTelLibraryVersion returns an attribute KeyValue conforming to the
// "otel.library.version" semantic conventions. It represents the deprecated,
// use the `otel.scope.version` attribute.
-func OtelLibraryVersion(val string) attribute.KeyValue {
- return OtelLibraryVersionKey.String(val)
+func OTelLibraryVersion(val string) attribute.KeyValue {
+ return OTelLibraryVersionKey.String(val)
}
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/schema.go b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/schema.go
new file mode 100644
index 00000000..95d0210e
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/schema.go
@@ -0,0 +1,9 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.20.0"
+
+// SchemaURL is the schema URL that matches the version of the semantic conventions
+// that this package defines. Semconv packages starting from v1.4.0 must declare
+// non-empty schema URL in the form https://opentelemetry.io/schemas/
+const SchemaURL = "https://opentelemetry.io/schemas/1.20.0"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/trace.go b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/trace.go
similarity index 63%
rename from vendor/go.opentelemetry.io/otel/semconv/v1.17.0/trace.go
rename to vendor/go.opentelemetry.io/otel/semconv/v1.20.0/trace.go
index 8c4a7299..90b1b045 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/trace.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/trace.go
@@ -1,20 +1,9 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
// Code generated from semantic convention specification. DO NOT EDIT.
-package semconv // import "go.opentelemetry.io/otel/semconv/v1.17.0"
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.20.0"
import "go.opentelemetry.io/otel/attribute"
@@ -84,42 +73,31 @@ func ExceptionStacktrace(val string) attribute.KeyValue {
return ExceptionStacktraceKey.String(val)
}
-// Attributes for Events represented using Log Records.
+// The attributes described in this section are rather generic. They may be
+// used in any Log Record they apply to.
const (
- // EventNameKey is the attribute Key conforming to the "event.name"
- // semantic conventions. It represents the name identifies the event.
+ // LogRecordUIDKey is the attribute Key conforming to the "log.record.uid"
+ // semantic conventions. It represents a unique identifier for the Log
+ // Record.
//
// Type: string
- // RequirementLevel: Required
- // Stability: stable
- // Examples: 'click', 'exception'
- EventNameKey = attribute.Key("event.name")
-
- // EventDomainKey is the attribute Key conforming to the "event.domain"
- // semantic conventions. It represents the domain identifies the business
- // context for the events.
- //
- // Type: Enum
- // RequirementLevel: Required
+ // RequirementLevel: Optional
// Stability: stable
- // Note: Events across different domains may have same `event.name`, yet be
- // unrelated events.
- EventDomainKey = attribute.Key("event.domain")
-)
-
-var (
- // Events from browser apps
- EventDomainBrowser = EventDomainKey.String("browser")
- // Events from mobile apps
- EventDomainDevice = EventDomainKey.String("device")
- // Events from Kubernetes
- EventDomainK8S = EventDomainKey.String("k8s")
+ // Examples: '01ARZ3NDEKTSV4RRFFQ69G5FAV'
+ // Note: If an id is provided, other log records with the same id will be
+ // considered duplicates and can be removed safely. This means, that two
+ // distinguishable log records MUST have different values.
+ // The id MAY be an [Universally Unique Lexicographically Sortable
+ // Identifier (ULID)](https://github.com/ulid/spec), but other identifiers
+ // (e.g. UUID) may be used as needed.
+ LogRecordUIDKey = attribute.Key("log.record.uid")
)
-// EventName returns an attribute KeyValue conforming to the "event.name"
-// semantic conventions. It represents the name identifies the event.
-func EventName(val string) attribute.KeyValue {
- return EventNameKey.String(val)
+// LogRecordUID returns an attribute KeyValue conforming to the
+// "log.record.uid" semantic conventions. It represents a unique identifier for
+// the Log Record.
+func LogRecordUID(val string) attribute.KeyValue {
+ return LogRecordUIDKey.String(val)
}
// Span attributes used by AWS Lambda (in addition to general `faas`
@@ -135,7 +113,8 @@ const (
// RequirementLevel: Optional
// Stability: stable
// Examples: 'arn:aws:lambda:us-east-1:123456:function:myfunction:myalias'
- // Note: This may be different from `faas.id` if an alias is involved.
+ // Note: This may be different from `cloud.resource_id` if an alias is
+ // involved.
AWSLambdaInvokedARNKey = attribute.Key("aws.lambda.invoked_arn")
)
@@ -342,11 +321,10 @@ const (
// executed.
//
// Type: string
- // RequirementLevel: ConditionallyRequired (If applicable and not
- // explicitly disabled via instrumentation configuration.)
+ // RequirementLevel: Recommended (Should be collected by default only if
+ // there is sanitization that excludes sensitive information.)
// Stability: stable
// Examples: 'SELECT * FROM wuser_table', 'SET mykey "WuValue"'
- // Note: The value may be sanitized to exclude sensitive information.
DBStatementKey = attribute.Key("db.statement")
// DBOperationKey is the attribute Key conforming to the "db.operation"
@@ -374,6 +352,8 @@ var (
DBSystemOtherSQL = DBSystemKey.String("other_sql")
// Microsoft SQL Server
DBSystemMSSQL = DBSystemKey.String("mssql")
+ // Microsoft SQL Server Compact
+ DBSystemMssqlcompact = DBSystemKey.String("mssqlcompact")
// MySQL
DBSystemMySQL = DBSystemKey.String("mysql")
// Oracle Database
@@ -468,6 +448,10 @@ var (
DBSystemOpensearch = DBSystemKey.String("opensearch")
// ClickHouse
DBSystemClickhouse = DBSystemKey.String("clickhouse")
+ // Cloud Spanner
+ DBSystemSpanner = DBSystemKey.String("spanner")
+ // Trino
+ DBSystemTrino = DBSystemKey.String("trino")
)
// DBConnectionString returns an attribute KeyValue conforming to the
@@ -764,10 +748,175 @@ func DBSQLTable(val string) attribute.KeyValue {
return DBSQLTableKey.String(val)
}
+// Call-level attributes for Cosmos DB.
+const (
+ // DBCosmosDBClientIDKey is the attribute Key conforming to the
+ // "db.cosmosdb.client_id" semantic conventions. It represents the unique
+ // Cosmos client instance id.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '3ba4827d-4422-483f-b59f-85b74211c11d'
+ DBCosmosDBClientIDKey = attribute.Key("db.cosmosdb.client_id")
+
+ // DBCosmosDBOperationTypeKey is the attribute Key conforming to the
+ // "db.cosmosdb.operation_type" semantic conventions. It represents the
+ // cosmosDB Operation Type.
+ //
+ // Type: Enum
+ // RequirementLevel: ConditionallyRequired (when performing one of the
+ // operations in this list)
+ // Stability: stable
+ DBCosmosDBOperationTypeKey = attribute.Key("db.cosmosdb.operation_type")
+
+ // DBCosmosDBConnectionModeKey is the attribute Key conforming to the
+ // "db.cosmosdb.connection_mode" semantic conventions. It represents the
+ // cosmos client connection mode.
+ //
+ // Type: Enum
+ // RequirementLevel: ConditionallyRequired (if not `direct` (or pick gw as
+ // default))
+ // Stability: stable
+ DBCosmosDBConnectionModeKey = attribute.Key("db.cosmosdb.connection_mode")
+
+ // DBCosmosDBContainerKey is the attribute Key conforming to the
+ // "db.cosmosdb.container" semantic conventions. It represents the cosmos
+ // DB container name.
+ //
+ // Type: string
+ // RequirementLevel: ConditionallyRequired (if available)
+ // Stability: stable
+ // Examples: 'anystring'
+ DBCosmosDBContainerKey = attribute.Key("db.cosmosdb.container")
+
+ // DBCosmosDBRequestContentLengthKey is the attribute Key conforming to the
+ // "db.cosmosdb.request_content_length" semantic conventions. It represents
+ // the request payload size in bytes
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ DBCosmosDBRequestContentLengthKey = attribute.Key("db.cosmosdb.request_content_length")
+
+ // DBCosmosDBStatusCodeKey is the attribute Key conforming to the
+ // "db.cosmosdb.status_code" semantic conventions. It represents the cosmos
+ // DB status code.
+ //
+ // Type: int
+ // RequirementLevel: ConditionallyRequired (if response was received)
+ // Stability: stable
+ // Examples: 200, 201
+ DBCosmosDBStatusCodeKey = attribute.Key("db.cosmosdb.status_code")
+
+ // DBCosmosDBSubStatusCodeKey is the attribute Key conforming to the
+ // "db.cosmosdb.sub_status_code" semantic conventions. It represents the
+ // cosmos DB sub status code.
+ //
+ // Type: int
+ // RequirementLevel: ConditionallyRequired (when response was received and
+ // contained sub-code.)
+ // Stability: stable
+ // Examples: 1000, 1002
+ DBCosmosDBSubStatusCodeKey = attribute.Key("db.cosmosdb.sub_status_code")
+
+ // DBCosmosDBRequestChargeKey is the attribute Key conforming to the
+ // "db.cosmosdb.request_charge" semantic conventions. It represents the rU
+ // consumed for that operation
+ //
+ // Type: double
+ // RequirementLevel: ConditionallyRequired (when available)
+ // Stability: stable
+ // Examples: 46.18, 1.0
+ DBCosmosDBRequestChargeKey = attribute.Key("db.cosmosdb.request_charge")
+)
+
+var (
+ // invalid
+ DBCosmosDBOperationTypeInvalid = DBCosmosDBOperationTypeKey.String("Invalid")
+ // create
+ DBCosmosDBOperationTypeCreate = DBCosmosDBOperationTypeKey.String("Create")
+ // patch
+ DBCosmosDBOperationTypePatch = DBCosmosDBOperationTypeKey.String("Patch")
+ // read
+ DBCosmosDBOperationTypeRead = DBCosmosDBOperationTypeKey.String("Read")
+ // read_feed
+ DBCosmosDBOperationTypeReadFeed = DBCosmosDBOperationTypeKey.String("ReadFeed")
+ // delete
+ DBCosmosDBOperationTypeDelete = DBCosmosDBOperationTypeKey.String("Delete")
+ // replace
+ DBCosmosDBOperationTypeReplace = DBCosmosDBOperationTypeKey.String("Replace")
+ // execute
+ DBCosmosDBOperationTypeExecute = DBCosmosDBOperationTypeKey.String("Execute")
+ // query
+ DBCosmosDBOperationTypeQuery = DBCosmosDBOperationTypeKey.String("Query")
+ // head
+ DBCosmosDBOperationTypeHead = DBCosmosDBOperationTypeKey.String("Head")
+ // head_feed
+ DBCosmosDBOperationTypeHeadFeed = DBCosmosDBOperationTypeKey.String("HeadFeed")
+ // upsert
+ DBCosmosDBOperationTypeUpsert = DBCosmosDBOperationTypeKey.String("Upsert")
+ // batch
+ DBCosmosDBOperationTypeBatch = DBCosmosDBOperationTypeKey.String("Batch")
+ // query_plan
+ DBCosmosDBOperationTypeQueryPlan = DBCosmosDBOperationTypeKey.String("QueryPlan")
+ // execute_javascript
+ DBCosmosDBOperationTypeExecuteJavascript = DBCosmosDBOperationTypeKey.String("ExecuteJavaScript")
+)
+
+var (
+ // Gateway (HTTP) connections mode
+ DBCosmosDBConnectionModeGateway = DBCosmosDBConnectionModeKey.String("gateway")
+ // Direct connection
+ DBCosmosDBConnectionModeDirect = DBCosmosDBConnectionModeKey.String("direct")
+)
+
+// DBCosmosDBClientID returns an attribute KeyValue conforming to the
+// "db.cosmosdb.client_id" semantic conventions. It represents the unique
+// Cosmos client instance id.
+func DBCosmosDBClientID(val string) attribute.KeyValue {
+ return DBCosmosDBClientIDKey.String(val)
+}
+
+// DBCosmosDBContainer returns an attribute KeyValue conforming to the
+// "db.cosmosdb.container" semantic conventions. It represents the cosmos DB
+// container name.
+func DBCosmosDBContainer(val string) attribute.KeyValue {
+ return DBCosmosDBContainerKey.String(val)
+}
+
+// DBCosmosDBRequestContentLength returns an attribute KeyValue conforming
+// to the "db.cosmosdb.request_content_length" semantic conventions. It
+// represents the request payload size in bytes
+func DBCosmosDBRequestContentLength(val int) attribute.KeyValue {
+ return DBCosmosDBRequestContentLengthKey.Int(val)
+}
+
+// DBCosmosDBStatusCode returns an attribute KeyValue conforming to the
+// "db.cosmosdb.status_code" semantic conventions. It represents the cosmos DB
+// status code.
+func DBCosmosDBStatusCode(val int) attribute.KeyValue {
+ return DBCosmosDBStatusCodeKey.Int(val)
+}
+
+// DBCosmosDBSubStatusCode returns an attribute KeyValue conforming to the
+// "db.cosmosdb.sub_status_code" semantic conventions. It represents the cosmos
+// DB sub status code.
+func DBCosmosDBSubStatusCode(val int) attribute.KeyValue {
+ return DBCosmosDBSubStatusCodeKey.Int(val)
+}
+
+// DBCosmosDBRequestCharge returns an attribute KeyValue conforming to the
+// "db.cosmosdb.request_charge" semantic conventions. It represents the rU
+// consumed for that operation
+func DBCosmosDBRequestCharge(val float64) attribute.KeyValue {
+ return DBCosmosDBRequestChargeKey.Float64(val)
+}
+
// Span attributes used by non-OTLP exporters to represent OpenTelemetry Span's
// concepts.
const (
- // OtelStatusCodeKey is the attribute Key conforming to the
+ // OTelStatusCodeKey is the attribute Key conforming to the
// "otel.status_code" semantic conventions. It represents the name of the
// code, either "OK" or "ERROR". MUST NOT be set if the status code is
// UNSET.
@@ -775,9 +924,9 @@ const (
// Type: Enum
// RequirementLevel: Optional
// Stability: stable
- OtelStatusCodeKey = attribute.Key("otel.status_code")
+ OTelStatusCodeKey = attribute.Key("otel.status_code")
- // OtelStatusDescriptionKey is the attribute Key conforming to the
+ // OTelStatusDescriptionKey is the attribute Key conforming to the
// "otel.status_description" semantic conventions. It represents the
// description of the Status if it has a value, otherwise not set.
//
@@ -785,21 +934,21 @@ const (
// RequirementLevel: Optional
// Stability: stable
// Examples: 'resource not found'
- OtelStatusDescriptionKey = attribute.Key("otel.status_description")
+ OTelStatusDescriptionKey = attribute.Key("otel.status_description")
)
var (
// The operation has been validated by an Application developer or Operator to have completed successfully
- OtelStatusCodeOk = OtelStatusCodeKey.String("OK")
+ OTelStatusCodeOk = OTelStatusCodeKey.String("OK")
// The operation contains an error
- OtelStatusCodeError = OtelStatusCodeKey.String("ERROR")
+ OTelStatusCodeError = OTelStatusCodeKey.String("ERROR")
)
-// OtelStatusDescription returns an attribute KeyValue conforming to the
+// OTelStatusDescription returns an attribute KeyValue conforming to the
// "otel.status_description" semantic conventions. It represents the
// description of the Status if it has a value, otherwise not set.
-func OtelStatusDescription(val string) attribute.KeyValue {
- return OtelStatusDescriptionKey.String(val)
+func OTelStatusDescription(val string) attribute.KeyValue {
+ return OTelStatusDescriptionKey.String(val)
}
// This semantic convention describes an instance of a function that runs
@@ -808,7 +957,7 @@ func OtelStatusDescription(val string) attribute.KeyValue {
const (
// FaaSTriggerKey is the attribute Key conforming to the "faas.trigger"
// semantic conventions. It represents the type of the trigger which caused
- // this function execution.
+ // this function invocation.
//
// Type: Enum
// RequirementLevel: Optional
@@ -824,15 +973,15 @@ const (
// call to invoke the lambda, which is often HTTP).
FaaSTriggerKey = attribute.Key("faas.trigger")
- // FaaSExecutionKey is the attribute Key conforming to the "faas.execution"
- // semantic conventions. It represents the execution ID of the current
- // function execution.
+ // FaaSInvocationIDKey is the attribute Key conforming to the
+ // "faas.invocation_id" semantic conventions. It represents the invocation
+ // ID of the current function invocation.
//
// Type: string
// RequirementLevel: Optional
// Stability: stable
// Examples: 'af9d5aa4-a685-4c5f-a22b-444f80b3cc28'
- FaaSExecutionKey = attribute.Key("faas.execution")
+ FaaSInvocationIDKey = attribute.Key("faas.invocation_id")
)
var (
@@ -848,11 +997,11 @@ var (
FaaSTriggerOther = FaaSTriggerKey.String("other")
)
-// FaaSExecution returns an attribute KeyValue conforming to the
-// "faas.execution" semantic conventions. It represents the execution ID of the
-// current function execution.
-func FaaSExecution(val string) attribute.KeyValue {
- return FaaSExecutionKey.String(val)
+// FaaSInvocationID returns an attribute KeyValue conforming to the
+// "faas.invocation_id" semantic conventions. It represents the invocation ID
+// of the current function invocation.
+func FaaSInvocationID(val string) attribute.KeyValue {
+ return FaaSInvocationIDKey.String(val)
}
// Semantic Convention for FaaS triggered as a response to some data source
@@ -1071,405 +1220,6 @@ func FaaSInvokedRegion(val string) attribute.KeyValue {
return FaaSInvokedRegionKey.String(val)
}
-// These attributes may be used for any network related operation.
-const (
- // NetTransportKey is the attribute Key conforming to the "net.transport"
- // semantic conventions. It represents the transport protocol used. See
- // note below.
- //
- // Type: Enum
- // RequirementLevel: Optional
- // Stability: stable
- NetTransportKey = attribute.Key("net.transport")
-
- // NetAppProtocolNameKey is the attribute Key conforming to the
- // "net.app.protocol.name" semantic conventions. It represents the
- // application layer protocol used. The value SHOULD be normalized to
- // lowercase.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'amqp', 'http', 'mqtt'
- NetAppProtocolNameKey = attribute.Key("net.app.protocol.name")
-
- // NetAppProtocolVersionKey is the attribute Key conforming to the
- // "net.app.protocol.version" semantic conventions. It represents the
- // version of the application layer protocol used. See note below.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: '3.1.1'
- // Note: `net.app.protocol.version` refers to the version of the protocol
- // used and might be different from the protocol client's version. If the
- // HTTP client used has a version of `0.27.2`, but sends HTTP version
- // `1.1`, this attribute should be set to `1.1`.
- NetAppProtocolVersionKey = attribute.Key("net.app.protocol.version")
-
- // NetSockPeerNameKey is the attribute Key conforming to the
- // "net.sock.peer.name" semantic conventions. It represents the remote
- // socket peer name.
- //
- // Type: string
- // RequirementLevel: Recommended (If available and different from
- // `net.peer.name` and if `net.sock.peer.addr` is set.)
- // Stability: stable
- // Examples: 'proxy.example.com'
- NetSockPeerNameKey = attribute.Key("net.sock.peer.name")
-
- // NetSockPeerAddrKey is the attribute Key conforming to the
- // "net.sock.peer.addr" semantic conventions. It represents the remote
- // socket peer address: IPv4 or IPv6 for internet protocols, path for local
- // communication,
- // [etc](https://man7.org/linux/man-pages/man7/address_families.7.html).
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: '127.0.0.1', '/tmp/mysql.sock'
- NetSockPeerAddrKey = attribute.Key("net.sock.peer.addr")
-
- // NetSockPeerPortKey is the attribute Key conforming to the
- // "net.sock.peer.port" semantic conventions. It represents the remote
- // socket peer port.
- //
- // Type: int
- // RequirementLevel: Recommended (If defined for the address family and if
- // different than `net.peer.port` and if `net.sock.peer.addr` is set.)
- // Stability: stable
- // Examples: 16456
- NetSockPeerPortKey = attribute.Key("net.sock.peer.port")
-
- // NetSockFamilyKey is the attribute Key conforming to the
- // "net.sock.family" semantic conventions. It represents the protocol
- // [address
- // family](https://man7.org/linux/man-pages/man7/address_families.7.html)
- // which is used for communication.
- //
- // Type: Enum
- // RequirementLevel: ConditionallyRequired (If different than `inet` and if
- // any of `net.sock.peer.addr` or `net.sock.host.addr` are set. Consumers
- // of telemetry SHOULD accept both IPv4 and IPv6 formats for the address in
- // `net.sock.peer.addr` if `net.sock.family` is not set. This is to support
- // instrumentations that follow previous versions of this document.)
- // Stability: stable
- // Examples: 'inet6', 'bluetooth'
- NetSockFamilyKey = attribute.Key("net.sock.family")
-
- // NetPeerNameKey is the attribute Key conforming to the "net.peer.name"
- // semantic conventions. It represents the logical remote hostname, see
- // note below.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'example.com'
- // Note: `net.peer.name` SHOULD NOT be set if capturing it would require an
- // extra DNS lookup.
- NetPeerNameKey = attribute.Key("net.peer.name")
-
- // NetPeerPortKey is the attribute Key conforming to the "net.peer.port"
- // semantic conventions. It represents the logical remote port number
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 80, 8080, 443
- NetPeerPortKey = attribute.Key("net.peer.port")
-
- // NetHostNameKey is the attribute Key conforming to the "net.host.name"
- // semantic conventions. It represents the logical local hostname or
- // similar, see note below.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'localhost'
- NetHostNameKey = attribute.Key("net.host.name")
-
- // NetHostPortKey is the attribute Key conforming to the "net.host.port"
- // semantic conventions. It represents the logical local port number,
- // preferably the one that the peer used to connect
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 8080
- NetHostPortKey = attribute.Key("net.host.port")
-
- // NetSockHostAddrKey is the attribute Key conforming to the
- // "net.sock.host.addr" semantic conventions. It represents the local
- // socket address. Useful in case of a multi-IP host.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: '192.168.0.1'
- NetSockHostAddrKey = attribute.Key("net.sock.host.addr")
-
- // NetSockHostPortKey is the attribute Key conforming to the
- // "net.sock.host.port" semantic conventions. It represents the local
- // socket port number.
- //
- // Type: int
- // RequirementLevel: Recommended (If defined for the address family and if
- // different than `net.host.port` and if `net.sock.host.addr` is set.)
- // Stability: stable
- // Examples: 35555
- NetSockHostPortKey = attribute.Key("net.sock.host.port")
-
- // NetHostConnectionTypeKey is the attribute Key conforming to the
- // "net.host.connection.type" semantic conventions. It represents the
- // internet connection type currently being used by the host.
- //
- // Type: Enum
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'wifi'
- NetHostConnectionTypeKey = attribute.Key("net.host.connection.type")
-
- // NetHostConnectionSubtypeKey is the attribute Key conforming to the
- // "net.host.connection.subtype" semantic conventions. It represents the
- // this describes more details regarding the connection.type. It may be the
- // type of cell technology connection, but it could be used for describing
- // details about a wifi connection.
- //
- // Type: Enum
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'LTE'
- NetHostConnectionSubtypeKey = attribute.Key("net.host.connection.subtype")
-
- // NetHostCarrierNameKey is the attribute Key conforming to the
- // "net.host.carrier.name" semantic conventions. It represents the name of
- // the mobile carrier.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'sprint'
- NetHostCarrierNameKey = attribute.Key("net.host.carrier.name")
-
- // NetHostCarrierMccKey is the attribute Key conforming to the
- // "net.host.carrier.mcc" semantic conventions. It represents the mobile
- // carrier country code.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: '310'
- NetHostCarrierMccKey = attribute.Key("net.host.carrier.mcc")
-
- // NetHostCarrierMncKey is the attribute Key conforming to the
- // "net.host.carrier.mnc" semantic conventions. It represents the mobile
- // carrier network code.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: '001'
- NetHostCarrierMncKey = attribute.Key("net.host.carrier.mnc")
-
- // NetHostCarrierIccKey is the attribute Key conforming to the
- // "net.host.carrier.icc" semantic conventions. It represents the ISO
- // 3166-1 alpha-2 2-character country code associated with the mobile
- // carrier network.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'DE'
- NetHostCarrierIccKey = attribute.Key("net.host.carrier.icc")
-)
-
-var (
- // ip_tcp
- NetTransportTCP = NetTransportKey.String("ip_tcp")
- // ip_udp
- NetTransportUDP = NetTransportKey.String("ip_udp")
- // Named or anonymous pipe. See note below
- NetTransportPipe = NetTransportKey.String("pipe")
- // In-process communication
- NetTransportInProc = NetTransportKey.String("inproc")
- // Something else (non IP-based)
- NetTransportOther = NetTransportKey.String("other")
-)
-
-var (
- // IPv4 address
- NetSockFamilyInet = NetSockFamilyKey.String("inet")
- // IPv6 address
- NetSockFamilyInet6 = NetSockFamilyKey.String("inet6")
- // Unix domain socket path
- NetSockFamilyUnix = NetSockFamilyKey.String("unix")
-)
-
-var (
- // wifi
- NetHostConnectionTypeWifi = NetHostConnectionTypeKey.String("wifi")
- // wired
- NetHostConnectionTypeWired = NetHostConnectionTypeKey.String("wired")
- // cell
- NetHostConnectionTypeCell = NetHostConnectionTypeKey.String("cell")
- // unavailable
- NetHostConnectionTypeUnavailable = NetHostConnectionTypeKey.String("unavailable")
- // unknown
- NetHostConnectionTypeUnknown = NetHostConnectionTypeKey.String("unknown")
-)
-
-var (
- // GPRS
- NetHostConnectionSubtypeGprs = NetHostConnectionSubtypeKey.String("gprs")
- // EDGE
- NetHostConnectionSubtypeEdge = NetHostConnectionSubtypeKey.String("edge")
- // UMTS
- NetHostConnectionSubtypeUmts = NetHostConnectionSubtypeKey.String("umts")
- // CDMA
- NetHostConnectionSubtypeCdma = NetHostConnectionSubtypeKey.String("cdma")
- // EVDO Rel. 0
- NetHostConnectionSubtypeEvdo0 = NetHostConnectionSubtypeKey.String("evdo_0")
- // EVDO Rev. A
- NetHostConnectionSubtypeEvdoA = NetHostConnectionSubtypeKey.String("evdo_a")
- // CDMA2000 1XRTT
- NetHostConnectionSubtypeCdma20001xrtt = NetHostConnectionSubtypeKey.String("cdma2000_1xrtt")
- // HSDPA
- NetHostConnectionSubtypeHsdpa = NetHostConnectionSubtypeKey.String("hsdpa")
- // HSUPA
- NetHostConnectionSubtypeHsupa = NetHostConnectionSubtypeKey.String("hsupa")
- // HSPA
- NetHostConnectionSubtypeHspa = NetHostConnectionSubtypeKey.String("hspa")
- // IDEN
- NetHostConnectionSubtypeIden = NetHostConnectionSubtypeKey.String("iden")
- // EVDO Rev. B
- NetHostConnectionSubtypeEvdoB = NetHostConnectionSubtypeKey.String("evdo_b")
- // LTE
- NetHostConnectionSubtypeLte = NetHostConnectionSubtypeKey.String("lte")
- // EHRPD
- NetHostConnectionSubtypeEhrpd = NetHostConnectionSubtypeKey.String("ehrpd")
- // HSPAP
- NetHostConnectionSubtypeHspap = NetHostConnectionSubtypeKey.String("hspap")
- // GSM
- NetHostConnectionSubtypeGsm = NetHostConnectionSubtypeKey.String("gsm")
- // TD-SCDMA
- NetHostConnectionSubtypeTdScdma = NetHostConnectionSubtypeKey.String("td_scdma")
- // IWLAN
- NetHostConnectionSubtypeIwlan = NetHostConnectionSubtypeKey.String("iwlan")
- // 5G NR (New Radio)
- NetHostConnectionSubtypeNr = NetHostConnectionSubtypeKey.String("nr")
- // 5G NRNSA (New Radio Non-Standalone)
- NetHostConnectionSubtypeNrnsa = NetHostConnectionSubtypeKey.String("nrnsa")
- // LTE CA
- NetHostConnectionSubtypeLteCa = NetHostConnectionSubtypeKey.String("lte_ca")
-)
-
-// NetAppProtocolName returns an attribute KeyValue conforming to the
-// "net.app.protocol.name" semantic conventions. It represents the application
-// layer protocol used. The value SHOULD be normalized to lowercase.
-func NetAppProtocolName(val string) attribute.KeyValue {
- return NetAppProtocolNameKey.String(val)
-}
-
-// NetAppProtocolVersion returns an attribute KeyValue conforming to the
-// "net.app.protocol.version" semantic conventions. It represents the version
-// of the application layer protocol used. See note below.
-func NetAppProtocolVersion(val string) attribute.KeyValue {
- return NetAppProtocolVersionKey.String(val)
-}
-
-// NetSockPeerName returns an attribute KeyValue conforming to the
-// "net.sock.peer.name" semantic conventions. It represents the remote socket
-// peer name.
-func NetSockPeerName(val string) attribute.KeyValue {
- return NetSockPeerNameKey.String(val)
-}
-
-// NetSockPeerAddr returns an attribute KeyValue conforming to the
-// "net.sock.peer.addr" semantic conventions. It represents the remote socket
-// peer address: IPv4 or IPv6 for internet protocols, path for local
-// communication,
-// [etc](https://man7.org/linux/man-pages/man7/address_families.7.html).
-func NetSockPeerAddr(val string) attribute.KeyValue {
- return NetSockPeerAddrKey.String(val)
-}
-
-// NetSockPeerPort returns an attribute KeyValue conforming to the
-// "net.sock.peer.port" semantic conventions. It represents the remote socket
-// peer port.
-func NetSockPeerPort(val int) attribute.KeyValue {
- return NetSockPeerPortKey.Int(val)
-}
-
-// NetPeerName returns an attribute KeyValue conforming to the
-// "net.peer.name" semantic conventions. It represents the logical remote
-// hostname, see note below.
-func NetPeerName(val string) attribute.KeyValue {
- return NetPeerNameKey.String(val)
-}
-
-// NetPeerPort returns an attribute KeyValue conforming to the
-// "net.peer.port" semantic conventions. It represents the logical remote port
-// number
-func NetPeerPort(val int) attribute.KeyValue {
- return NetPeerPortKey.Int(val)
-}
-
-// NetHostName returns an attribute KeyValue conforming to the
-// "net.host.name" semantic conventions. It represents the logical local
-// hostname or similar, see note below.
-func NetHostName(val string) attribute.KeyValue {
- return NetHostNameKey.String(val)
-}
-
-// NetHostPort returns an attribute KeyValue conforming to the
-// "net.host.port" semantic conventions. It represents the logical local port
-// number, preferably the one that the peer used to connect
-func NetHostPort(val int) attribute.KeyValue {
- return NetHostPortKey.Int(val)
-}
-
-// NetSockHostAddr returns an attribute KeyValue conforming to the
-// "net.sock.host.addr" semantic conventions. It represents the local socket
-// address. Useful in case of a multi-IP host.
-func NetSockHostAddr(val string) attribute.KeyValue {
- return NetSockHostAddrKey.String(val)
-}
-
-// NetSockHostPort returns an attribute KeyValue conforming to the
-// "net.sock.host.port" semantic conventions. It represents the local socket
-// port number.
-func NetSockHostPort(val int) attribute.KeyValue {
- return NetSockHostPortKey.Int(val)
-}
-
-// NetHostCarrierName returns an attribute KeyValue conforming to the
-// "net.host.carrier.name" semantic conventions. It represents the name of the
-// mobile carrier.
-func NetHostCarrierName(val string) attribute.KeyValue {
- return NetHostCarrierNameKey.String(val)
-}
-
-// NetHostCarrierMcc returns an attribute KeyValue conforming to the
-// "net.host.carrier.mcc" semantic conventions. It represents the mobile
-// carrier country code.
-func NetHostCarrierMcc(val string) attribute.KeyValue {
- return NetHostCarrierMccKey.String(val)
-}
-
-// NetHostCarrierMnc returns an attribute KeyValue conforming to the
-// "net.host.carrier.mnc" semantic conventions. It represents the mobile
-// carrier network code.
-func NetHostCarrierMnc(val string) attribute.KeyValue {
- return NetHostCarrierMncKey.String(val)
-}
-
-// NetHostCarrierIcc returns an attribute KeyValue conforming to the
-// "net.host.carrier.icc" semantic conventions. It represents the ISO 3166-1
-// alpha-2 2-character country code associated with the mobile carrier network.
-func NetHostCarrierIcc(val string) attribute.KeyValue {
- return NetHostCarrierIccKey.String(val)
-}
-
// Operations that access some remote service.
const (
// PeerServiceKey is the attribute Key conforming to the "peer.service"
@@ -1700,140 +1450,6 @@ func CodeColumn(val int) attribute.KeyValue {
return CodeColumnKey.Int(val)
}
-// Semantic conventions for HTTP client and server Spans.
-const (
- // HTTPMethodKey is the attribute Key conforming to the "http.method"
- // semantic conventions. It represents the hTTP request method.
- //
- // Type: string
- // RequirementLevel: Required
- // Stability: stable
- // Examples: 'GET', 'POST', 'HEAD'
- HTTPMethodKey = attribute.Key("http.method")
-
- // HTTPStatusCodeKey is the attribute Key conforming to the
- // "http.status_code" semantic conventions. It represents the [HTTP
- // response status code](https://tools.ietf.org/html/rfc7231#section-6).
- //
- // Type: int
- // RequirementLevel: ConditionallyRequired (If and only if one was
- // received/sent.)
- // Stability: stable
- // Examples: 200
- HTTPStatusCodeKey = attribute.Key("http.status_code")
-
- // HTTPFlavorKey is the attribute Key conforming to the "http.flavor"
- // semantic conventions. It represents the kind of HTTP protocol used.
- //
- // Type: Enum
- // RequirementLevel: Optional
- // Stability: stable
- // Note: If `net.transport` is not specified, it can be assumed to be
- // `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is
- // assumed.
- HTTPFlavorKey = attribute.Key("http.flavor")
-
- // HTTPUserAgentKey is the attribute Key conforming to the
- // "http.user_agent" semantic conventions. It represents the value of the
- // [HTTP
- // User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent)
- // header sent by the client.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'CERN-LineMode/2.15 libwww/2.17b3'
- HTTPUserAgentKey = attribute.Key("http.user_agent")
-
- // HTTPRequestContentLengthKey is the attribute Key conforming to the
- // "http.request_content_length" semantic conventions. It represents the
- // size of the request payload body in bytes. This is the number of bytes
- // transferred excluding headers and is often, but not always, present as
- // the
- // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
- // header. For requests using transport encoding, this should be the
- // compressed size.
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 3495
- HTTPRequestContentLengthKey = attribute.Key("http.request_content_length")
-
- // HTTPResponseContentLengthKey is the attribute Key conforming to the
- // "http.response_content_length" semantic conventions. It represents the
- // size of the response payload body in bytes. This is the number of bytes
- // transferred excluding headers and is often, but not always, present as
- // the
- // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
- // header. For requests using transport encoding, this should be the
- // compressed size.
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 3495
- HTTPResponseContentLengthKey = attribute.Key("http.response_content_length")
-)
-
-var (
- // HTTP/1.0
- HTTPFlavorHTTP10 = HTTPFlavorKey.String("1.0")
- // HTTP/1.1
- HTTPFlavorHTTP11 = HTTPFlavorKey.String("1.1")
- // HTTP/2
- HTTPFlavorHTTP20 = HTTPFlavorKey.String("2.0")
- // HTTP/3
- HTTPFlavorHTTP30 = HTTPFlavorKey.String("3.0")
- // SPDY protocol
- HTTPFlavorSPDY = HTTPFlavorKey.String("SPDY")
- // QUIC protocol
- HTTPFlavorQUIC = HTTPFlavorKey.String("QUIC")
-)
-
-// HTTPMethod returns an attribute KeyValue conforming to the "http.method"
-// semantic conventions. It represents the hTTP request method.
-func HTTPMethod(val string) attribute.KeyValue {
- return HTTPMethodKey.String(val)
-}
-
-// HTTPStatusCode returns an attribute KeyValue conforming to the
-// "http.status_code" semantic conventions. It represents the [HTTP response
-// status code](https://tools.ietf.org/html/rfc7231#section-6).
-func HTTPStatusCode(val int) attribute.KeyValue {
- return HTTPStatusCodeKey.Int(val)
-}
-
-// HTTPUserAgent returns an attribute KeyValue conforming to the
-// "http.user_agent" semantic conventions. It represents the value of the [HTTP
-// User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent)
-// header sent by the client.
-func HTTPUserAgent(val string) attribute.KeyValue {
- return HTTPUserAgentKey.String(val)
-}
-
-// HTTPRequestContentLength returns an attribute KeyValue conforming to the
-// "http.request_content_length" semantic conventions. It represents the size
-// of the request payload body in bytes. This is the number of bytes
-// transferred excluding headers and is often, but not always, present as the
-// [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
-// header. For requests using transport encoding, this should be the compressed
-// size.
-func HTTPRequestContentLength(val int) attribute.KeyValue {
- return HTTPRequestContentLengthKey.Int(val)
-}
-
-// HTTPResponseContentLength returns an attribute KeyValue conforming to the
-// "http.response_content_length" semantic conventions. It represents the size
-// of the response payload body in bytes. This is the number of bytes
-// transferred excluding headers and is often, but not always, present as the
-// [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
-// header. For requests using transport encoding, this should be the compressed
-// size.
-func HTTPResponseContentLength(val int) attribute.KeyValue {
- return HTTPResponseContentLengthKey.Int(val)
-}
-
// Semantic Convention for HTTP Client
const (
// HTTPURLKey is the attribute Key conforming to the "http.url" semantic
@@ -1885,16 +1501,6 @@ func HTTPResendCount(val int) attribute.KeyValue {
// Semantic Convention for HTTP Server
const (
- // HTTPSchemeKey is the attribute Key conforming to the "http.scheme"
- // semantic conventions. It represents the URI scheme identifying the used
- // protocol.
- //
- // Type: string
- // RequirementLevel: Required
- // Stability: stable
- // Examples: 'http', 'https'
- HTTPSchemeKey = attribute.Key("http.scheme")
-
// HTTPTargetKey is the attribute Key conforming to the "http.target"
// semantic conventions. It represents the full request target as passed in
// a HTTP request line or equivalent.
@@ -1902,22 +1508,9 @@ const (
// Type: string
// RequirementLevel: Required
// Stability: stable
- // Examples: '/path/12314/?q=ddds'
+ // Examples: '/users/12314/?q=ddds'
HTTPTargetKey = attribute.Key("http.target")
- // HTTPRouteKey is the attribute Key conforming to the "http.route"
- // semantic conventions. It represents the matched route (path template in
- // the format used by the respective server framework). See note below
- //
- // Type: string
- // RequirementLevel: ConditionallyRequired (If and only if it's available)
- // Stability: stable
- // Examples: '/users/:userID?', '{controller}/{action}/{id?}'
- // Note: 'http.route' MUST NOT be populated when this is not supported by
- // the HTTP server framework as the route attribute should have
- // low-cardinality and the URI path can NOT substitute it.
- HTTPRouteKey = attribute.Key("http.route")
-
// HTTPClientIPKey is the attribute Key conforming to the "http.client_ip"
// semantic conventions. It represents the IP address of the original
// client behind all proxies, if known (e.g. from
@@ -1943,13 +1536,6 @@ const (
HTTPClientIPKey = attribute.Key("http.client_ip")
)
-// HTTPScheme returns an attribute KeyValue conforming to the "http.scheme"
-// semantic conventions. It represents the URI scheme identifying the used
-// protocol.
-func HTTPScheme(val string) attribute.KeyValue {
- return HTTPSchemeKey.String(val)
-}
-
// HTTPTarget returns an attribute KeyValue conforming to the "http.target"
// semantic conventions. It represents the full request target as passed in a
// HTTP request line or equivalent.
@@ -1957,13 +1543,6 @@ func HTTPTarget(val string) attribute.KeyValue {
return HTTPTargetKey.String(val)
}
-// HTTPRoute returns an attribute KeyValue conforming to the "http.route"
-// semantic conventions. It represents the matched route (path template in the
-// format used by the respective server framework). See note below
-func HTTPRoute(val string) attribute.KeyValue {
- return HTTPRouteKey.String(val)
-}
-
// HTTPClientIP returns an attribute KeyValue conforming to the
// "http.client_ip" semantic conventions. It represents the IP address of the
// original client behind all proxies, if known (e.g. from
@@ -1972,6 +1551,32 @@ func HTTPClientIP(val string) attribute.KeyValue {
return HTTPClientIPKey.String(val)
}
+// The `aws` conventions apply to operations using the AWS SDK. They map
+// request or response parameters in AWS SDK API calls to attributes on a Span.
+// The conventions have been collected over time based on feedback from AWS
+// users of tracing and will continue to evolve as new interesting conventions
+// are found.
+// Some descriptions are also provided for populating general OpenTelemetry
+// semantic conventions based on these APIs.
+const (
+ // AWSRequestIDKey is the attribute Key conforming to the "aws.request_id"
+ // semantic conventions. It represents the AWS request ID as returned in
+ // the response headers `x-amz-request-id` or `x-amz-requestid`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '79b9da39-b7ae-508a-a6bc-864b2829c622', 'C9ER4AJX75574TDJ'
+ AWSRequestIDKey = attribute.Key("aws.request_id")
+)
+
+// AWSRequestID returns an attribute KeyValue conforming to the
+// "aws.request_id" semantic conventions. It represents the AWS request ID as
+// returned in the response headers `x-amz-request-id` or `x-amz-requestid`.
+func AWSRequestID(val string) attribute.KeyValue {
+ return AWSRequestIDKey.String(val)
+}
+
// Attributes that exist for multiple DynamoDB request types.
const (
// AWSDynamoDBTableNamesKey is the attribute Key conforming to the
@@ -2399,6 +2004,198 @@ func AWSDynamoDBGlobalSecondaryIndexUpdates(val ...string) attribute.KeyValue {
return AWSDynamoDBGlobalSecondaryIndexUpdatesKey.StringSlice(val)
}
+// Attributes that exist for S3 request types.
+const (
+ // AWSS3BucketKey is the attribute Key conforming to the "aws.s3.bucket"
+ // semantic conventions. It represents the S3 bucket name the request
+ // refers to. Corresponds to the `--bucket` parameter of the [S3
+ // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)
+ // operations.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'some-bucket-name'
+ // Note: The `bucket` attribute is applicable to all S3 operations that
+ // reference a bucket, i.e. that require the bucket name as a mandatory
+ // parameter.
+ // This applies to almost all S3 operations except `list-buckets`.
+ AWSS3BucketKey = attribute.Key("aws.s3.bucket")
+
+ // AWSS3KeyKey is the attribute Key conforming to the "aws.s3.key" semantic
+ // conventions. It represents the S3 object key the request refers to.
+ // Corresponds to the `--key` parameter of the [S3
+ // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)
+ // operations.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'someFile.yml'
+ // Note: The `key` attribute is applicable to all object-related S3
+ // operations, i.e. that require the object key as a mandatory parameter.
+ // This applies in particular to the following operations:
+ //
+ // -
+ // [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html)
+ // -
+ // [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html)
+ // -
+ // [get-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/get-object.html)
+ // -
+ // [head-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/head-object.html)
+ // -
+ // [put-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/put-object.html)
+ // -
+ // [restore-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/restore-object.html)
+ // -
+ // [select-object-content](https://docs.aws.amazon.com/cli/latest/reference/s3api/select-object-content.html)
+ // -
+ // [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html)
+ // -
+ // [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html)
+ // -
+ // [create-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/create-multipart-upload.html)
+ // -
+ // [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html)
+ // -
+ // [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html)
+ // -
+ // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html)
+ AWSS3KeyKey = attribute.Key("aws.s3.key")
+
+ // AWSS3CopySourceKey is the attribute Key conforming to the
+ // "aws.s3.copy_source" semantic conventions. It represents the source
+ // object (in the form `bucket`/`key`) for the copy operation.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'someFile.yml'
+ // Note: The `copy_source` attribute applies to S3 copy operations and
+ // corresponds to the `--copy-source` parameter
+ // of the [copy-object operation within the S3
+ // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html).
+ // This applies in particular to the following operations:
+ //
+ // -
+ // [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html)
+ // -
+ // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html)
+ AWSS3CopySourceKey = attribute.Key("aws.s3.copy_source")
+
+ // AWSS3UploadIDKey is the attribute Key conforming to the
+ // "aws.s3.upload_id" semantic conventions. It represents the upload ID
+ // that identifies the multipart upload.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'dfRtDYWFbkRONycy.Yxwh66Yjlx.cph0gtNBtJ'
+ // Note: The `upload_id` attribute applies to S3 multipart-upload
+ // operations and corresponds to the `--upload-id` parameter
+ // of the [S3
+ // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)
+ // multipart operations.
+ // This applies in particular to the following operations:
+ //
+ // -
+ // [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html)
+ // -
+ // [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html)
+ // -
+ // [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html)
+ // -
+ // [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html)
+ // -
+ // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html)
+ AWSS3UploadIDKey = attribute.Key("aws.s3.upload_id")
+
+ // AWSS3DeleteKey is the attribute Key conforming to the "aws.s3.delete"
+ // semantic conventions. It represents the delete request container that
+ // specifies the objects to be deleted.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples:
+ // 'Objects=[{Key=string,VersionID=string},{Key=string,VersionID=string}],Quiet=boolean'
+ // Note: The `delete` attribute is only applicable to the
+ // [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html)
+ // operation.
+ // The `delete` attribute corresponds to the `--delete` parameter of the
+ // [delete-objects operation within the S3
+ // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-objects.html).
+ AWSS3DeleteKey = attribute.Key("aws.s3.delete")
+
+ // AWSS3PartNumberKey is the attribute Key conforming to the
+ // "aws.s3.part_number" semantic conventions. It represents the part number
+ // of the part being uploaded in a multipart-upload operation. This is a
+ // positive integer between 1 and 10,000.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 3456
+ // Note: The `part_number` attribute is only applicable to the
+ // [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html)
+ // and
+ // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html)
+ // operations.
+ // The `part_number` attribute corresponds to the `--part-number` parameter
+ // of the
+ // [upload-part operation within the S3
+ // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html).
+ AWSS3PartNumberKey = attribute.Key("aws.s3.part_number")
+)
+
+// AWSS3Bucket returns an attribute KeyValue conforming to the
+// "aws.s3.bucket" semantic conventions. It represents the S3 bucket name the
+// request refers to. Corresponds to the `--bucket` parameter of the [S3
+// API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)
+// operations.
+func AWSS3Bucket(val string) attribute.KeyValue {
+ return AWSS3BucketKey.String(val)
+}
+
+// AWSS3Key returns an attribute KeyValue conforming to the "aws.s3.key"
+// semantic conventions. It represents the S3 object key the request refers to.
+// Corresponds to the `--key` parameter of the [S3
+// API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)
+// operations.
+func AWSS3Key(val string) attribute.KeyValue {
+ return AWSS3KeyKey.String(val)
+}
+
+// AWSS3CopySource returns an attribute KeyValue conforming to the
+// "aws.s3.copy_source" semantic conventions. It represents the source object
+// (in the form `bucket`/`key`) for the copy operation.
+func AWSS3CopySource(val string) attribute.KeyValue {
+ return AWSS3CopySourceKey.String(val)
+}
+
+// AWSS3UploadID returns an attribute KeyValue conforming to the
+// "aws.s3.upload_id" semantic conventions. It represents the upload ID that
+// identifies the multipart upload.
+func AWSS3UploadID(val string) attribute.KeyValue {
+ return AWSS3UploadIDKey.String(val)
+}
+
+// AWSS3Delete returns an attribute KeyValue conforming to the
+// "aws.s3.delete" semantic conventions. It represents the delete request
+// container that specifies the objects to be deleted.
+func AWSS3Delete(val string) attribute.KeyValue {
+ return AWSS3DeleteKey.String(val)
+}
+
+// AWSS3PartNumber returns an attribute KeyValue conforming to the
+// "aws.s3.part_number" semantic conventions. It represents the part number of
+// the part being uploaded in a multipart-upload operation. This is a positive
+// integer between 1 and 10,000.
+func AWSS3PartNumber(val int) attribute.KeyValue {
+ return AWSS3PartNumberKey.Int(val)
+}
+
// Semantic conventions to apply when instrumenting the GraphQL implementation.
// They map GraphQL operations to attributes on a Span.
const (
@@ -2457,287 +2254,6 @@ func GraphqlDocument(val string) attribute.KeyValue {
return GraphqlDocumentKey.String(val)
}
-// Semantic convention describing per-message attributes populated on messaging
-// spans or links.
-const (
- // MessagingMessageIDKey is the attribute Key conforming to the
- // "messaging.message.id" semantic conventions. It represents a value used
- // by the messaging system as an identifier for the message, represented as
- // a string.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: '452a7c7c7c7048c2f887f61572b18fc2'
- MessagingMessageIDKey = attribute.Key("messaging.message.id")
-
- // MessagingMessageConversationIDKey is the attribute Key conforming to the
- // "messaging.message.conversation_id" semantic conventions. It represents
- // the [conversation ID](#conversations) identifying the conversation to
- // which the message belongs, represented as a string. Sometimes called
- // "Correlation ID".
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'MyConversationID'
- MessagingMessageConversationIDKey = attribute.Key("messaging.message.conversation_id")
-
- // MessagingMessagePayloadSizeBytesKey is the attribute Key conforming to
- // the "messaging.message.payload_size_bytes" semantic conventions. It
- // represents the (uncompressed) size of the message payload in bytes. Also
- // use this attribute if it is unknown whether the compressed or
- // uncompressed payload size is reported.
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 2738
- MessagingMessagePayloadSizeBytesKey = attribute.Key("messaging.message.payload_size_bytes")
-
- // MessagingMessagePayloadCompressedSizeBytesKey is the attribute Key
- // conforming to the "messaging.message.payload_compressed_size_bytes"
- // semantic conventions. It represents the compressed size of the message
- // payload in bytes.
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 2048
- MessagingMessagePayloadCompressedSizeBytesKey = attribute.Key("messaging.message.payload_compressed_size_bytes")
-)
-
-// MessagingMessageID returns an attribute KeyValue conforming to the
-// "messaging.message.id" semantic conventions. It represents a value used by
-// the messaging system as an identifier for the message, represented as a
-// string.
-func MessagingMessageID(val string) attribute.KeyValue {
- return MessagingMessageIDKey.String(val)
-}
-
-// MessagingMessageConversationID returns an attribute KeyValue conforming
-// to the "messaging.message.conversation_id" semantic conventions. It
-// represents the [conversation ID](#conversations) identifying the
-// conversation to which the message belongs, represented as a string.
-// Sometimes called "Correlation ID".
-func MessagingMessageConversationID(val string) attribute.KeyValue {
- return MessagingMessageConversationIDKey.String(val)
-}
-
-// MessagingMessagePayloadSizeBytes returns an attribute KeyValue conforming
-// to the "messaging.message.payload_size_bytes" semantic conventions. It
-// represents the (uncompressed) size of the message payload in bytes. Also use
-// this attribute if it is unknown whether the compressed or uncompressed
-// payload size is reported.
-func MessagingMessagePayloadSizeBytes(val int) attribute.KeyValue {
- return MessagingMessagePayloadSizeBytesKey.Int(val)
-}
-
-// MessagingMessagePayloadCompressedSizeBytes returns an attribute KeyValue
-// conforming to the "messaging.message.payload_compressed_size_bytes" semantic
-// conventions. It represents the compressed size of the message payload in
-// bytes.
-func MessagingMessagePayloadCompressedSizeBytes(val int) attribute.KeyValue {
- return MessagingMessagePayloadCompressedSizeBytesKey.Int(val)
-}
-
-// Semantic convention for attributes that describe messaging destination on
-// broker
-const (
- // MessagingDestinationNameKey is the attribute Key conforming to the
- // "messaging.destination.name" semantic conventions. It represents the
- // message destination name
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'MyQueue', 'MyTopic'
- // Note: Destination name SHOULD uniquely identify a specific queue, topic
- // or other entity within the broker. If
- // the broker does not have such notion, the destination name SHOULD
- // uniquely identify the broker.
- MessagingDestinationNameKey = attribute.Key("messaging.destination.name")
-
- // MessagingDestinationKindKey is the attribute Key conforming to the
- // "messaging.destination.kind" semantic conventions. It represents the
- // kind of message destination
- //
- // Type: Enum
- // RequirementLevel: Optional
- // Stability: stable
- MessagingDestinationKindKey = attribute.Key("messaging.destination.kind")
-
- // MessagingDestinationTemplateKey is the attribute Key conforming to the
- // "messaging.destination.template" semantic conventions. It represents the
- // low cardinality representation of the messaging destination name
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: '/customers/{customerID}'
- // Note: Destination names could be constructed from templates. An example
- // would be a destination name involving a user name or product id.
- // Although the destination name in this case is of high cardinality, the
- // underlying template is of low cardinality and can be effectively used
- // for grouping and aggregation.
- MessagingDestinationTemplateKey = attribute.Key("messaging.destination.template")
-
- // MessagingDestinationTemporaryKey is the attribute Key conforming to the
- // "messaging.destination.temporary" semantic conventions. It represents a
- // boolean that is true if the message destination is temporary and might
- // not exist anymore after messages are processed.
- //
- // Type: boolean
- // RequirementLevel: Optional
- // Stability: stable
- MessagingDestinationTemporaryKey = attribute.Key("messaging.destination.temporary")
-
- // MessagingDestinationAnonymousKey is the attribute Key conforming to the
- // "messaging.destination.anonymous" semantic conventions. It represents a
- // boolean that is true if the message destination is anonymous (could be
- // unnamed or have auto-generated name).
- //
- // Type: boolean
- // RequirementLevel: Optional
- // Stability: stable
- MessagingDestinationAnonymousKey = attribute.Key("messaging.destination.anonymous")
-)
-
-var (
- // A message sent to a queue
- MessagingDestinationKindQueue = MessagingDestinationKindKey.String("queue")
- // A message sent to a topic
- MessagingDestinationKindTopic = MessagingDestinationKindKey.String("topic")
-)
-
-// MessagingDestinationName returns an attribute KeyValue conforming to the
-// "messaging.destination.name" semantic conventions. It represents the message
-// destination name
-func MessagingDestinationName(val string) attribute.KeyValue {
- return MessagingDestinationNameKey.String(val)
-}
-
-// MessagingDestinationTemplate returns an attribute KeyValue conforming to
-// the "messaging.destination.template" semantic conventions. It represents the
-// low cardinality representation of the messaging destination name
-func MessagingDestinationTemplate(val string) attribute.KeyValue {
- return MessagingDestinationTemplateKey.String(val)
-}
-
-// MessagingDestinationTemporary returns an attribute KeyValue conforming to
-// the "messaging.destination.temporary" semantic conventions. It represents a
-// boolean that is true if the message destination is temporary and might not
-// exist anymore after messages are processed.
-func MessagingDestinationTemporary(val bool) attribute.KeyValue {
- return MessagingDestinationTemporaryKey.Bool(val)
-}
-
-// MessagingDestinationAnonymous returns an attribute KeyValue conforming to
-// the "messaging.destination.anonymous" semantic conventions. It represents a
-// boolean that is true if the message destination is anonymous (could be
-// unnamed or have auto-generated name).
-func MessagingDestinationAnonymous(val bool) attribute.KeyValue {
- return MessagingDestinationAnonymousKey.Bool(val)
-}
-
-// Semantic convention for attributes that describe messaging source on broker
-const (
- // MessagingSourceNameKey is the attribute Key conforming to the
- // "messaging.source.name" semantic conventions. It represents the message
- // source name
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'MyQueue', 'MyTopic'
- // Note: Source name SHOULD uniquely identify a specific queue, topic, or
- // other entity within the broker. If
- // the broker does not have such notion, the source name SHOULD uniquely
- // identify the broker.
- MessagingSourceNameKey = attribute.Key("messaging.source.name")
-
- // MessagingSourceKindKey is the attribute Key conforming to the
- // "messaging.source.kind" semantic conventions. It represents the kind of
- // message source
- //
- // Type: Enum
- // RequirementLevel: Optional
- // Stability: stable
- MessagingSourceKindKey = attribute.Key("messaging.source.kind")
-
- // MessagingSourceTemplateKey is the attribute Key conforming to the
- // "messaging.source.template" semantic conventions. It represents the low
- // cardinality representation of the messaging source name
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: '/customers/{customerID}'
- // Note: Source names could be constructed from templates. An example would
- // be a source name involving a user name or product id. Although the
- // source name in this case is of high cardinality, the underlying template
- // is of low cardinality and can be effectively used for grouping and
- // aggregation.
- MessagingSourceTemplateKey = attribute.Key("messaging.source.template")
-
- // MessagingSourceTemporaryKey is the attribute Key conforming to the
- // "messaging.source.temporary" semantic conventions. It represents a
- // boolean that is true if the message source is temporary and might not
- // exist anymore after messages are processed.
- //
- // Type: boolean
- // RequirementLevel: Optional
- // Stability: stable
- MessagingSourceTemporaryKey = attribute.Key("messaging.source.temporary")
-
- // MessagingSourceAnonymousKey is the attribute Key conforming to the
- // "messaging.source.anonymous" semantic conventions. It represents a
- // boolean that is true if the message source is anonymous (could be
- // unnamed or have auto-generated name).
- //
- // Type: boolean
- // RequirementLevel: Optional
- // Stability: stable
- MessagingSourceAnonymousKey = attribute.Key("messaging.source.anonymous")
-)
-
-var (
- // A message received from a queue
- MessagingSourceKindQueue = MessagingSourceKindKey.String("queue")
- // A message received from a topic
- MessagingSourceKindTopic = MessagingSourceKindKey.String("topic")
-)
-
-// MessagingSourceName returns an attribute KeyValue conforming to the
-// "messaging.source.name" semantic conventions. It represents the message
-// source name
-func MessagingSourceName(val string) attribute.KeyValue {
- return MessagingSourceNameKey.String(val)
-}
-
-// MessagingSourceTemplate returns an attribute KeyValue conforming to the
-// "messaging.source.template" semantic conventions. It represents the low
-// cardinality representation of the messaging source name
-func MessagingSourceTemplate(val string) attribute.KeyValue {
- return MessagingSourceTemplateKey.String(val)
-}
-
-// MessagingSourceTemporary returns an attribute KeyValue conforming to the
-// "messaging.source.temporary" semantic conventions. It represents a boolean
-// that is true if the message source is temporary and might not exist anymore
-// after messages are processed.
-func MessagingSourceTemporary(val bool) attribute.KeyValue {
- return MessagingSourceTemporaryKey.Bool(val)
-}
-
-// MessagingSourceAnonymous returns an attribute KeyValue conforming to the
-// "messaging.source.anonymous" semantic conventions. It represents a boolean
-// that is true if the message source is anonymous (could be unnamed or have
-// auto-generated name).
-func MessagingSourceAnonymous(val bool) attribute.KeyValue {
- return MessagingSourceAnonymousKey.Bool(val)
-}
-
// General attributes used in messaging systems.
const (
// MessagingSystemKey is the attribute Key conforming to the
@@ -2832,349 +2348,6 @@ func MessagingConsumerID(val string) attribute.KeyValue {
return MessagingConsumerIDKey.String(val)
}
-// Attributes for RabbitMQ
-const (
- // MessagingRabbitmqDestinationRoutingKeyKey is the attribute Key
- // conforming to the "messaging.rabbitmq.destination.routing_key" semantic
- // conventions. It represents the rabbitMQ message routing key.
- //
- // Type: string
- // RequirementLevel: ConditionallyRequired (If not empty.)
- // Stability: stable
- // Examples: 'myKey'
- MessagingRabbitmqDestinationRoutingKeyKey = attribute.Key("messaging.rabbitmq.destination.routing_key")
-)
-
-// MessagingRabbitmqDestinationRoutingKey returns an attribute KeyValue
-// conforming to the "messaging.rabbitmq.destination.routing_key" semantic
-// conventions. It represents the rabbitMQ message routing key.
-func MessagingRabbitmqDestinationRoutingKey(val string) attribute.KeyValue {
- return MessagingRabbitmqDestinationRoutingKeyKey.String(val)
-}
-
-// Attributes for Apache Kafka
-const (
- // MessagingKafkaMessageKeyKey is the attribute Key conforming to the
- // "messaging.kafka.message.key" semantic conventions. It represents the
- // message keys in Kafka are used for grouping alike messages to ensure
- // they're processed on the same partition. They differ from
- // `messaging.message.id` in that they're not unique. If the key is `null`,
- // the attribute MUST NOT be set.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'myKey'
- // Note: If the key type is not string, it's string representation has to
- // be supplied for the attribute. If the key has no unambiguous, canonical
- // string form, don't include its value.
- MessagingKafkaMessageKeyKey = attribute.Key("messaging.kafka.message.key")
-
- // MessagingKafkaConsumerGroupKey is the attribute Key conforming to the
- // "messaging.kafka.consumer.group" semantic conventions. It represents the
- // name of the Kafka Consumer Group that is handling the message. Only
- // applies to consumers, not producers.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'my-group'
- MessagingKafkaConsumerGroupKey = attribute.Key("messaging.kafka.consumer.group")
-
- // MessagingKafkaClientIDKey is the attribute Key conforming to the
- // "messaging.kafka.client_id" semantic conventions. It represents the
- // client ID for the Consumer or Producer that is handling the message.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'client-5'
- MessagingKafkaClientIDKey = attribute.Key("messaging.kafka.client_id")
-
- // MessagingKafkaDestinationPartitionKey is the attribute Key conforming to
- // the "messaging.kafka.destination.partition" semantic conventions. It
- // represents the partition the message is sent to.
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 2
- MessagingKafkaDestinationPartitionKey = attribute.Key("messaging.kafka.destination.partition")
-
- // MessagingKafkaSourcePartitionKey is the attribute Key conforming to the
- // "messaging.kafka.source.partition" semantic conventions. It represents
- // the partition the message is received from.
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 2
- MessagingKafkaSourcePartitionKey = attribute.Key("messaging.kafka.source.partition")
-
- // MessagingKafkaMessageOffsetKey is the attribute Key conforming to the
- // "messaging.kafka.message.offset" semantic conventions. It represents the
- // offset of a record in the corresponding Kafka partition.
- //
- // Type: int
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 42
- MessagingKafkaMessageOffsetKey = attribute.Key("messaging.kafka.message.offset")
-
- // MessagingKafkaMessageTombstoneKey is the attribute Key conforming to the
- // "messaging.kafka.message.tombstone" semantic conventions. It represents
- // a boolean that is true if the message is a tombstone.
- //
- // Type: boolean
- // RequirementLevel: ConditionallyRequired (If value is `true`. When
- // missing, the value is assumed to be `false`.)
- // Stability: stable
- MessagingKafkaMessageTombstoneKey = attribute.Key("messaging.kafka.message.tombstone")
-)
-
-// MessagingKafkaMessageKey returns an attribute KeyValue conforming to the
-// "messaging.kafka.message.key" semantic conventions. It represents the
-// message keys in Kafka are used for grouping alike messages to ensure they're
-// processed on the same partition. They differ from `messaging.message.id` in
-// that they're not unique. If the key is `null`, the attribute MUST NOT be
-// set.
-func MessagingKafkaMessageKey(val string) attribute.KeyValue {
- return MessagingKafkaMessageKeyKey.String(val)
-}
-
-// MessagingKafkaConsumerGroup returns an attribute KeyValue conforming to
-// the "messaging.kafka.consumer.group" semantic conventions. It represents the
-// name of the Kafka Consumer Group that is handling the message. Only applies
-// to consumers, not producers.
-func MessagingKafkaConsumerGroup(val string) attribute.KeyValue {
- return MessagingKafkaConsumerGroupKey.String(val)
-}
-
-// MessagingKafkaClientID returns an attribute KeyValue conforming to the
-// "messaging.kafka.client_id" semantic conventions. It represents the client
-// ID for the Consumer or Producer that is handling the message.
-func MessagingKafkaClientID(val string) attribute.KeyValue {
- return MessagingKafkaClientIDKey.String(val)
-}
-
-// MessagingKafkaDestinationPartition returns an attribute KeyValue
-// conforming to the "messaging.kafka.destination.partition" semantic
-// conventions. It represents the partition the message is sent to.
-func MessagingKafkaDestinationPartition(val int) attribute.KeyValue {
- return MessagingKafkaDestinationPartitionKey.Int(val)
-}
-
-// MessagingKafkaSourcePartition returns an attribute KeyValue conforming to
-// the "messaging.kafka.source.partition" semantic conventions. It represents
-// the partition the message is received from.
-func MessagingKafkaSourcePartition(val int) attribute.KeyValue {
- return MessagingKafkaSourcePartitionKey.Int(val)
-}
-
-// MessagingKafkaMessageOffset returns an attribute KeyValue conforming to
-// the "messaging.kafka.message.offset" semantic conventions. It represents the
-// offset of a record in the corresponding Kafka partition.
-func MessagingKafkaMessageOffset(val int) attribute.KeyValue {
- return MessagingKafkaMessageOffsetKey.Int(val)
-}
-
-// MessagingKafkaMessageTombstone returns an attribute KeyValue conforming
-// to the "messaging.kafka.message.tombstone" semantic conventions. It
-// represents a boolean that is true if the message is a tombstone.
-func MessagingKafkaMessageTombstone(val bool) attribute.KeyValue {
- return MessagingKafkaMessageTombstoneKey.Bool(val)
-}
-
-// Attributes for Apache RocketMQ
-const (
- // MessagingRocketmqNamespaceKey is the attribute Key conforming to the
- // "messaging.rocketmq.namespace" semantic conventions. It represents the
- // namespace of RocketMQ resources, resources in different namespaces are
- // individual.
- //
- // Type: string
- // RequirementLevel: Required
- // Stability: stable
- // Examples: 'myNamespace'
- MessagingRocketmqNamespaceKey = attribute.Key("messaging.rocketmq.namespace")
-
- // MessagingRocketmqClientGroupKey is the attribute Key conforming to the
- // "messaging.rocketmq.client_group" semantic conventions. It represents
- // the name of the RocketMQ producer/consumer group that is handling the
- // message. The client type is identified by the SpanKind.
- //
- // Type: string
- // RequirementLevel: Required
- // Stability: stable
- // Examples: 'myConsumerGroup'
- MessagingRocketmqClientGroupKey = attribute.Key("messaging.rocketmq.client_group")
-
- // MessagingRocketmqClientIDKey is the attribute Key conforming to the
- // "messaging.rocketmq.client_id" semantic conventions. It represents the
- // unique identifier for each client.
- //
- // Type: string
- // RequirementLevel: Required
- // Stability: stable
- // Examples: 'myhost@8742@s8083jm'
- MessagingRocketmqClientIDKey = attribute.Key("messaging.rocketmq.client_id")
-
- // MessagingRocketmqMessageDeliveryTimestampKey is the attribute Key
- // conforming to the "messaging.rocketmq.message.delivery_timestamp"
- // semantic conventions. It represents the timestamp in milliseconds that
- // the delay message is expected to be delivered to consumer.
- //
- // Type: int
- // RequirementLevel: ConditionallyRequired (If the message type is delay
- // and delay time level is not specified.)
- // Stability: stable
- // Examples: 1665987217045
- MessagingRocketmqMessageDeliveryTimestampKey = attribute.Key("messaging.rocketmq.message.delivery_timestamp")
-
- // MessagingRocketmqMessageDelayTimeLevelKey is the attribute Key
- // conforming to the "messaging.rocketmq.message.delay_time_level" semantic
- // conventions. It represents the delay time level for delay message, which
- // determines the message delay time.
- //
- // Type: int
- // RequirementLevel: ConditionallyRequired (If the message type is delay
- // and delivery timestamp is not specified.)
- // Stability: stable
- // Examples: 3
- MessagingRocketmqMessageDelayTimeLevelKey = attribute.Key("messaging.rocketmq.message.delay_time_level")
-
- // MessagingRocketmqMessageGroupKey is the attribute Key conforming to the
- // "messaging.rocketmq.message.group" semantic conventions. It represents
- // the it is essential for FIFO message. Messages that belong to the same
- // message group are always processed one by one within the same consumer
- // group.
- //
- // Type: string
- // RequirementLevel: ConditionallyRequired (If the message type is FIFO.)
- // Stability: stable
- // Examples: 'myMessageGroup'
- MessagingRocketmqMessageGroupKey = attribute.Key("messaging.rocketmq.message.group")
-
- // MessagingRocketmqMessageTypeKey is the attribute Key conforming to the
- // "messaging.rocketmq.message.type" semantic conventions. It represents
- // the type of message.
- //
- // Type: Enum
- // RequirementLevel: Optional
- // Stability: stable
- MessagingRocketmqMessageTypeKey = attribute.Key("messaging.rocketmq.message.type")
-
- // MessagingRocketmqMessageTagKey is the attribute Key conforming to the
- // "messaging.rocketmq.message.tag" semantic conventions. It represents the
- // secondary classifier of message besides topic.
- //
- // Type: string
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'tagA'
- MessagingRocketmqMessageTagKey = attribute.Key("messaging.rocketmq.message.tag")
-
- // MessagingRocketmqMessageKeysKey is the attribute Key conforming to the
- // "messaging.rocketmq.message.keys" semantic conventions. It represents
- // the key(s) of message, another way to mark message besides message id.
- //
- // Type: string[]
- // RequirementLevel: Optional
- // Stability: stable
- // Examples: 'keyA', 'keyB'
- MessagingRocketmqMessageKeysKey = attribute.Key("messaging.rocketmq.message.keys")
-
- // MessagingRocketmqConsumptionModelKey is the attribute Key conforming to
- // the "messaging.rocketmq.consumption_model" semantic conventions. It
- // represents the model of message consumption. This only applies to
- // consumer spans.
- //
- // Type: Enum
- // RequirementLevel: Optional
- // Stability: stable
- MessagingRocketmqConsumptionModelKey = attribute.Key("messaging.rocketmq.consumption_model")
-)
-
-var (
- // Normal message
- MessagingRocketmqMessageTypeNormal = MessagingRocketmqMessageTypeKey.String("normal")
- // FIFO message
- MessagingRocketmqMessageTypeFifo = MessagingRocketmqMessageTypeKey.String("fifo")
- // Delay message
- MessagingRocketmqMessageTypeDelay = MessagingRocketmqMessageTypeKey.String("delay")
- // Transaction message
- MessagingRocketmqMessageTypeTransaction = MessagingRocketmqMessageTypeKey.String("transaction")
-)
-
-var (
- // Clustering consumption model
- MessagingRocketmqConsumptionModelClustering = MessagingRocketmqConsumptionModelKey.String("clustering")
- // Broadcasting consumption model
- MessagingRocketmqConsumptionModelBroadcasting = MessagingRocketmqConsumptionModelKey.String("broadcasting")
-)
-
-// MessagingRocketmqNamespace returns an attribute KeyValue conforming to
-// the "messaging.rocketmq.namespace" semantic conventions. It represents the
-// namespace of RocketMQ resources, resources in different namespaces are
-// individual.
-func MessagingRocketmqNamespace(val string) attribute.KeyValue {
- return MessagingRocketmqNamespaceKey.String(val)
-}
-
-// MessagingRocketmqClientGroup returns an attribute KeyValue conforming to
-// the "messaging.rocketmq.client_group" semantic conventions. It represents
-// the name of the RocketMQ producer/consumer group that is handling the
-// message. The client type is identified by the SpanKind.
-func MessagingRocketmqClientGroup(val string) attribute.KeyValue {
- return MessagingRocketmqClientGroupKey.String(val)
-}
-
-// MessagingRocketmqClientID returns an attribute KeyValue conforming to the
-// "messaging.rocketmq.client_id" semantic conventions. It represents the
-// unique identifier for each client.
-func MessagingRocketmqClientID(val string) attribute.KeyValue {
- return MessagingRocketmqClientIDKey.String(val)
-}
-
-// MessagingRocketmqMessageDeliveryTimestamp returns an attribute KeyValue
-// conforming to the "messaging.rocketmq.message.delivery_timestamp" semantic
-// conventions. It represents the timestamp in milliseconds that the delay
-// message is expected to be delivered to consumer.
-func MessagingRocketmqMessageDeliveryTimestamp(val int) attribute.KeyValue {
- return MessagingRocketmqMessageDeliveryTimestampKey.Int(val)
-}
-
-// MessagingRocketmqMessageDelayTimeLevel returns an attribute KeyValue
-// conforming to the "messaging.rocketmq.message.delay_time_level" semantic
-// conventions. It represents the delay time level for delay message, which
-// determines the message delay time.
-func MessagingRocketmqMessageDelayTimeLevel(val int) attribute.KeyValue {
- return MessagingRocketmqMessageDelayTimeLevelKey.Int(val)
-}
-
-// MessagingRocketmqMessageGroup returns an attribute KeyValue conforming to
-// the "messaging.rocketmq.message.group" semantic conventions. It represents
-// the it is essential for FIFO message. Messages that belong to the same
-// message group are always processed one by one within the same consumer
-// group.
-func MessagingRocketmqMessageGroup(val string) attribute.KeyValue {
- return MessagingRocketmqMessageGroupKey.String(val)
-}
-
-// MessagingRocketmqMessageTag returns an attribute KeyValue conforming to
-// the "messaging.rocketmq.message.tag" semantic conventions. It represents the
-// secondary classifier of message besides topic.
-func MessagingRocketmqMessageTag(val string) attribute.KeyValue {
- return MessagingRocketmqMessageTagKey.String(val)
-}
-
-// MessagingRocketmqMessageKeys returns an attribute KeyValue conforming to
-// the "messaging.rocketmq.message.keys" semantic conventions. It represents
-// the key(s) of message, another way to mark message besides message id.
-func MessagingRocketmqMessageKeys(val ...string) attribute.KeyValue {
- return MessagingRocketmqMessageKeysKey.StringSlice(val)
-}
-
// Semantic conventions for remote procedure calls.
const (
// RPCSystemKey is the attribute Key conforming to the "rpc.system"
@@ -3227,6 +2400,8 @@ var (
RPCSystemDotnetWcf = RPCSystemKey.String("dotnet_wcf")
// Apache Dubbo
RPCSystemApacheDubbo = RPCSystemKey.String("apache_dubbo")
+ // Connect RPC
+ RPCSystemConnectRPC = RPCSystemKey.String("connect_rpc")
)
// RPCService returns an attribute KeyValue conforming to the "rpc.service"
@@ -3373,3 +2548,52 @@ func RPCJsonrpcErrorCode(val int) attribute.KeyValue {
func RPCJsonrpcErrorMessage(val string) attribute.KeyValue {
return RPCJsonrpcErrorMessageKey.String(val)
}
+
+// Tech-specific attributes for Connect RPC.
+const (
+ // RPCConnectRPCErrorCodeKey is the attribute Key conforming to the
+ // "rpc.connect_rpc.error_code" semantic conventions. It represents the
+ // [error codes](https://connect.build/docs/protocol/#error-codes) of the
+ // Connect request. Error codes are always string values.
+ //
+ // Type: Enum
+ // RequirementLevel: ConditionallyRequired (If response is not successful
+ // and if error code available.)
+ // Stability: stable
+ RPCConnectRPCErrorCodeKey = attribute.Key("rpc.connect_rpc.error_code")
+)
+
+var (
+ // cancelled
+ RPCConnectRPCErrorCodeCancelled = RPCConnectRPCErrorCodeKey.String("cancelled")
+ // unknown
+ RPCConnectRPCErrorCodeUnknown = RPCConnectRPCErrorCodeKey.String("unknown")
+ // invalid_argument
+ RPCConnectRPCErrorCodeInvalidArgument = RPCConnectRPCErrorCodeKey.String("invalid_argument")
+ // deadline_exceeded
+ RPCConnectRPCErrorCodeDeadlineExceeded = RPCConnectRPCErrorCodeKey.String("deadline_exceeded")
+ // not_found
+ RPCConnectRPCErrorCodeNotFound = RPCConnectRPCErrorCodeKey.String("not_found")
+ // already_exists
+ RPCConnectRPCErrorCodeAlreadyExists = RPCConnectRPCErrorCodeKey.String("already_exists")
+ // permission_denied
+ RPCConnectRPCErrorCodePermissionDenied = RPCConnectRPCErrorCodeKey.String("permission_denied")
+ // resource_exhausted
+ RPCConnectRPCErrorCodeResourceExhausted = RPCConnectRPCErrorCodeKey.String("resource_exhausted")
+ // failed_precondition
+ RPCConnectRPCErrorCodeFailedPrecondition = RPCConnectRPCErrorCodeKey.String("failed_precondition")
+ // aborted
+ RPCConnectRPCErrorCodeAborted = RPCConnectRPCErrorCodeKey.String("aborted")
+ // out_of_range
+ RPCConnectRPCErrorCodeOutOfRange = RPCConnectRPCErrorCodeKey.String("out_of_range")
+ // unimplemented
+ RPCConnectRPCErrorCodeUnimplemented = RPCConnectRPCErrorCodeKey.String("unimplemented")
+ // internal
+ RPCConnectRPCErrorCodeInternal = RPCConnectRPCErrorCodeKey.String("internal")
+ // unavailable
+ RPCConnectRPCErrorCodeUnavailable = RPCConnectRPCErrorCodeKey.String("unavailable")
+ // data_loss
+ RPCConnectRPCErrorCodeDataLoss = RPCConnectRPCErrorCodeKey.String("data_loss")
+ // unauthenticated
+ RPCConnectRPCErrorCodeUnauthenticated = RPCConnectRPCErrorCodeKey.String("unauthenticated")
+)
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/README.md b/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/README.md
new file mode 100644
index 00000000..2de1fc3c
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/README.md
@@ -0,0 +1,3 @@
+# Semconv v1.26.0
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/semconv/v1.26.0)](https://pkg.go.dev/go.opentelemetry.io/otel/semconv/v1.26.0)
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/attribute_group.go b/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/attribute_group.go
new file mode 100644
index 00000000..d8dc822b
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/attribute_group.go
@@ -0,0 +1,8996 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Code generated from semantic convention specification. DO NOT EDIT.
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.26.0"
+
+import "go.opentelemetry.io/otel/attribute"
+
+// The Android platform on which the Android application is running.
+const (
+ // AndroidOSAPILevelKey is the attribute Key conforming to the
+ // "android.os.api_level" semantic conventions. It represents the uniquely
+ // identifies the framework API revision offered by a version
+ // (`os.version`) of the android operating system. More information can be
+ // found
+ // [here](https://developer.android.com/guide/topics/manifest/uses-sdk-element#APILevels).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '33', '32'
+ AndroidOSAPILevelKey = attribute.Key("android.os.api_level")
+)
+
+// AndroidOSAPILevel returns an attribute KeyValue conforming to the
+// "android.os.api_level" semantic conventions. It represents the uniquely
+// identifies the framework API revision offered by a version (`os.version`) of
+// the android operating system. More information can be found
+// [here](https://developer.android.com/guide/topics/manifest/uses-sdk-element#APILevels).
+func AndroidOSAPILevel(val string) attribute.KeyValue {
+ return AndroidOSAPILevelKey.String(val)
+}
+
+// ASP.NET Core attributes
+const (
+ // AspnetcoreRateLimitingResultKey is the attribute Key conforming to the
+ // "aspnetcore.rate_limiting.result" semantic conventions. It represents
+ // the rate-limiting result, shows whether the lease was acquired or
+ // contains a rejection reason
+ //
+ // Type: Enum
+ // RequirementLevel: Required
+ // Stability: stable
+ // Examples: 'acquired', 'request_canceled'
+ AspnetcoreRateLimitingResultKey = attribute.Key("aspnetcore.rate_limiting.result")
+
+ // AspnetcoreDiagnosticsHandlerTypeKey is the attribute Key conforming to
+ // the "aspnetcore.diagnostics.handler.type" semantic conventions. It
+ // represents the full type name of the
+ // [`IExceptionHandler`](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler)
+ // implementation that handled the exception.
+ //
+ // Type: string
+ // RequirementLevel: ConditionallyRequired (if and only if the exception
+ // was handled by this handler.)
+ // Stability: stable
+ // Examples: 'Contoso.MyHandler'
+ AspnetcoreDiagnosticsHandlerTypeKey = attribute.Key("aspnetcore.diagnostics.handler.type")
+
+ // AspnetcoreDiagnosticsExceptionResultKey is the attribute Key conforming
+ // to the "aspnetcore.diagnostics.exception.result" semantic conventions.
+ // It represents the aSP.NET Core exception middleware handling result
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'handled', 'unhandled'
+ AspnetcoreDiagnosticsExceptionResultKey = attribute.Key("aspnetcore.diagnostics.exception.result")
+
+ // AspnetcoreRateLimitingPolicyKey is the attribute Key conforming to the
+ // "aspnetcore.rate_limiting.policy" semantic conventions. It represents
+ // the rate limiting policy name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'fixed', 'sliding', 'token'
+ AspnetcoreRateLimitingPolicyKey = attribute.Key("aspnetcore.rate_limiting.policy")
+
+ // AspnetcoreRequestIsUnhandledKey is the attribute Key conforming to the
+ // "aspnetcore.request.is_unhandled" semantic conventions. It represents
+ // the flag indicating if request was handled by the application pipeline.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: True
+ AspnetcoreRequestIsUnhandledKey = attribute.Key("aspnetcore.request.is_unhandled")
+
+ // AspnetcoreRoutingIsFallbackKey is the attribute Key conforming to the
+ // "aspnetcore.routing.is_fallback" semantic conventions. It represents a
+ // value that indicates whether the matched route is a fallback route.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: True
+ AspnetcoreRoutingIsFallbackKey = attribute.Key("aspnetcore.routing.is_fallback")
+
+ // AspnetcoreRoutingMatchStatusKey is the attribute Key conforming to the
+ // "aspnetcore.routing.match_status" semantic conventions. It represents
+ // the match result - success or failure
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'success', 'failure'
+ AspnetcoreRoutingMatchStatusKey = attribute.Key("aspnetcore.routing.match_status")
+)
+
+var (
+ // Lease was acquired
+ AspnetcoreRateLimitingResultAcquired = AspnetcoreRateLimitingResultKey.String("acquired")
+ // Lease request was rejected by the endpoint limiter
+ AspnetcoreRateLimitingResultEndpointLimiter = AspnetcoreRateLimitingResultKey.String("endpoint_limiter")
+ // Lease request was rejected by the global limiter
+ AspnetcoreRateLimitingResultGlobalLimiter = AspnetcoreRateLimitingResultKey.String("global_limiter")
+ // Lease request was canceled
+ AspnetcoreRateLimitingResultRequestCanceled = AspnetcoreRateLimitingResultKey.String("request_canceled")
+)
+
+var (
+ // Exception was handled by the exception handling middleware
+ AspnetcoreDiagnosticsExceptionResultHandled = AspnetcoreDiagnosticsExceptionResultKey.String("handled")
+ // Exception was not handled by the exception handling middleware
+ AspnetcoreDiagnosticsExceptionResultUnhandled = AspnetcoreDiagnosticsExceptionResultKey.String("unhandled")
+ // Exception handling was skipped because the response had started
+ AspnetcoreDiagnosticsExceptionResultSkipped = AspnetcoreDiagnosticsExceptionResultKey.String("skipped")
+ // Exception handling didn't run because the request was aborted
+ AspnetcoreDiagnosticsExceptionResultAborted = AspnetcoreDiagnosticsExceptionResultKey.String("aborted")
+)
+
+var (
+ // Match succeeded
+ AspnetcoreRoutingMatchStatusSuccess = AspnetcoreRoutingMatchStatusKey.String("success")
+ // Match failed
+ AspnetcoreRoutingMatchStatusFailure = AspnetcoreRoutingMatchStatusKey.String("failure")
+)
+
+// AspnetcoreDiagnosticsHandlerType returns an attribute KeyValue conforming
+// to the "aspnetcore.diagnostics.handler.type" semantic conventions. It
+// represents the full type name of the
+// [`IExceptionHandler`](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler)
+// implementation that handled the exception.
+func AspnetcoreDiagnosticsHandlerType(val string) attribute.KeyValue {
+ return AspnetcoreDiagnosticsHandlerTypeKey.String(val)
+}
+
+// AspnetcoreRateLimitingPolicy returns an attribute KeyValue conforming to
+// the "aspnetcore.rate_limiting.policy" semantic conventions. It represents
+// the rate limiting policy name.
+func AspnetcoreRateLimitingPolicy(val string) attribute.KeyValue {
+ return AspnetcoreRateLimitingPolicyKey.String(val)
+}
+
+// AspnetcoreRequestIsUnhandled returns an attribute KeyValue conforming to
+// the "aspnetcore.request.is_unhandled" semantic conventions. It represents
+// the flag indicating if request was handled by the application pipeline.
+func AspnetcoreRequestIsUnhandled(val bool) attribute.KeyValue {
+ return AspnetcoreRequestIsUnhandledKey.Bool(val)
+}
+
+// AspnetcoreRoutingIsFallback returns an attribute KeyValue conforming to
+// the "aspnetcore.routing.is_fallback" semantic conventions. It represents a
+// value that indicates whether the matched route is a fallback route.
+func AspnetcoreRoutingIsFallback(val bool) attribute.KeyValue {
+ return AspnetcoreRoutingIsFallbackKey.Bool(val)
+}
+
+// Generic attributes for AWS services.
+const (
+ // AWSRequestIDKey is the attribute Key conforming to the "aws.request_id"
+ // semantic conventions. It represents the AWS request ID as returned in
+ // the response headers `x-amz-request-id` or `x-amz-requestid`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '79b9da39-b7ae-508a-a6bc-864b2829c622', 'C9ER4AJX75574TDJ'
+ AWSRequestIDKey = attribute.Key("aws.request_id")
+)
+
+// AWSRequestID returns an attribute KeyValue conforming to the
+// "aws.request_id" semantic conventions. It represents the AWS request ID as
+// returned in the response headers `x-amz-request-id` or `x-amz-requestid`.
+func AWSRequestID(val string) attribute.KeyValue {
+ return AWSRequestIDKey.String(val)
+}
+
+// Attributes for AWS DynamoDB.
+const (
+ // AWSDynamoDBAttributeDefinitionsKey is the attribute Key conforming to
+ // the "aws.dynamodb.attribute_definitions" semantic conventions. It
+ // represents the JSON-serialized value of each item in the
+ // `AttributeDefinitions` request field.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '{ "AttributeName": "string", "AttributeType": "string" }'
+ AWSDynamoDBAttributeDefinitionsKey = attribute.Key("aws.dynamodb.attribute_definitions")
+
+ // AWSDynamoDBAttributesToGetKey is the attribute Key conforming to the
+ // "aws.dynamodb.attributes_to_get" semantic conventions. It represents the
+ // value of the `AttributesToGet` request parameter.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'lives', 'id'
+ AWSDynamoDBAttributesToGetKey = attribute.Key("aws.dynamodb.attributes_to_get")
+
+ // AWSDynamoDBConsistentReadKey is the attribute Key conforming to the
+ // "aws.dynamodb.consistent_read" semantic conventions. It represents the
+ // value of the `ConsistentRead` request parameter.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ AWSDynamoDBConsistentReadKey = attribute.Key("aws.dynamodb.consistent_read")
+
+ // AWSDynamoDBConsumedCapacityKey is the attribute Key conforming to the
+ // "aws.dynamodb.consumed_capacity" semantic conventions. It represents the
+ // JSON-serialized value of each item in the `ConsumedCapacity` response
+ // field.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '{ "CapacityUnits": number, "GlobalSecondaryIndexes": {
+ // "string" : { "CapacityUnits": number, "ReadCapacityUnits": number,
+ // "WriteCapacityUnits": number } }, "LocalSecondaryIndexes": { "string" :
+ // { "CapacityUnits": number, "ReadCapacityUnits": number,
+ // "WriteCapacityUnits": number } }, "ReadCapacityUnits": number, "Table":
+ // { "CapacityUnits": number, "ReadCapacityUnits": number,
+ // "WriteCapacityUnits": number }, "TableName": "string",
+ // "WriteCapacityUnits": number }'
+ AWSDynamoDBConsumedCapacityKey = attribute.Key("aws.dynamodb.consumed_capacity")
+
+ // AWSDynamoDBCountKey is the attribute Key conforming to the
+ // "aws.dynamodb.count" semantic conventions. It represents the value of
+ // the `Count` response parameter.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 10
+ AWSDynamoDBCountKey = attribute.Key("aws.dynamodb.count")
+
+ // AWSDynamoDBExclusiveStartTableKey is the attribute Key conforming to the
+ // "aws.dynamodb.exclusive_start_table" semantic conventions. It represents
+ // the value of the `ExclusiveStartTableName` request parameter.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Users', 'CatsTable'
+ AWSDynamoDBExclusiveStartTableKey = attribute.Key("aws.dynamodb.exclusive_start_table")
+
+ // AWSDynamoDBGlobalSecondaryIndexUpdatesKey is the attribute Key
+ // conforming to the "aws.dynamodb.global_secondary_index_updates" semantic
+ // conventions. It represents the JSON-serialized value of each item in the
+ // `GlobalSecondaryIndexUpdates` request field.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '{ "Create": { "IndexName": "string", "KeySchema": [ {
+ // "AttributeName": "string", "KeyType": "string" } ], "Projection": {
+ // "NonKeyAttributes": [ "string" ], "ProjectionType": "string" },
+ // "ProvisionedThroughput": { "ReadCapacityUnits": number,
+ // "WriteCapacityUnits": number } }'
+ AWSDynamoDBGlobalSecondaryIndexUpdatesKey = attribute.Key("aws.dynamodb.global_secondary_index_updates")
+
+ // AWSDynamoDBGlobalSecondaryIndexesKey is the attribute Key conforming to
+ // the "aws.dynamodb.global_secondary_indexes" semantic conventions. It
+ // represents the JSON-serialized value of each item of the
+ // `GlobalSecondaryIndexes` request field
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '{ "IndexName": "string", "KeySchema": [ { "AttributeName":
+ // "string", "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [
+ // "string" ], "ProjectionType": "string" }, "ProvisionedThroughput": {
+ // "ReadCapacityUnits": number, "WriteCapacityUnits": number } }'
+ AWSDynamoDBGlobalSecondaryIndexesKey = attribute.Key("aws.dynamodb.global_secondary_indexes")
+
+ // AWSDynamoDBIndexNameKey is the attribute Key conforming to the
+ // "aws.dynamodb.index_name" semantic conventions. It represents the value
+ // of the `IndexName` request parameter.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'name_to_group'
+ AWSDynamoDBIndexNameKey = attribute.Key("aws.dynamodb.index_name")
+
+ // AWSDynamoDBItemCollectionMetricsKey is the attribute Key conforming to
+ // the "aws.dynamodb.item_collection_metrics" semantic conventions. It
+ // represents the JSON-serialized value of the `ItemCollectionMetrics`
+ // response field.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '{ "string" : [ { "ItemCollectionKey": { "string" : { "B":
+ // blob, "BOOL": boolean, "BS": [ blob ], "L": [ "AttributeValue" ], "M": {
+ // "string" : "AttributeValue" }, "N": "string", "NS": [ "string" ],
+ // "NULL": boolean, "S": "string", "SS": [ "string" ] } },
+ // "SizeEstimateRangeGB": [ number ] } ] }'
+ AWSDynamoDBItemCollectionMetricsKey = attribute.Key("aws.dynamodb.item_collection_metrics")
+
+ // AWSDynamoDBLimitKey is the attribute Key conforming to the
+ // "aws.dynamodb.limit" semantic conventions. It represents the value of
+ // the `Limit` request parameter.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 10
+ AWSDynamoDBLimitKey = attribute.Key("aws.dynamodb.limit")
+
+ // AWSDynamoDBLocalSecondaryIndexesKey is the attribute Key conforming to
+ // the "aws.dynamodb.local_secondary_indexes" semantic conventions. It
+ // represents the JSON-serialized value of each item of the
+ // `LocalSecondaryIndexes` request field.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '{ "IndexARN": "string", "IndexName": "string",
+ // "IndexSizeBytes": number, "ItemCount": number, "KeySchema": [ {
+ // "AttributeName": "string", "KeyType": "string" } ], "Projection": {
+ // "NonKeyAttributes": [ "string" ], "ProjectionType": "string" } }'
+ AWSDynamoDBLocalSecondaryIndexesKey = attribute.Key("aws.dynamodb.local_secondary_indexes")
+
+ // AWSDynamoDBProjectionKey is the attribute Key conforming to the
+ // "aws.dynamodb.projection" semantic conventions. It represents the value
+ // of the `ProjectionExpression` request parameter.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Title', 'Title, Price, Color', 'Title, Description,
+ // RelatedItems, ProductReviews'
+ AWSDynamoDBProjectionKey = attribute.Key("aws.dynamodb.projection")
+
+ // AWSDynamoDBProvisionedReadCapacityKey is the attribute Key conforming to
+ // the "aws.dynamodb.provisioned_read_capacity" semantic conventions. It
+ // represents the value of the `ProvisionedThroughput.ReadCapacityUnits`
+ // request parameter.
+ //
+ // Type: double
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1.0, 2.0
+ AWSDynamoDBProvisionedReadCapacityKey = attribute.Key("aws.dynamodb.provisioned_read_capacity")
+
+ // AWSDynamoDBProvisionedWriteCapacityKey is the attribute Key conforming
+ // to the "aws.dynamodb.provisioned_write_capacity" semantic conventions.
+ // It represents the value of the
+ // `ProvisionedThroughput.WriteCapacityUnits` request parameter.
+ //
+ // Type: double
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1.0, 2.0
+ AWSDynamoDBProvisionedWriteCapacityKey = attribute.Key("aws.dynamodb.provisioned_write_capacity")
+
+ // AWSDynamoDBScanForwardKey is the attribute Key conforming to the
+ // "aws.dynamodb.scan_forward" semantic conventions. It represents the
+ // value of the `ScanIndexForward` request parameter.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ AWSDynamoDBScanForwardKey = attribute.Key("aws.dynamodb.scan_forward")
+
+ // AWSDynamoDBScannedCountKey is the attribute Key conforming to the
+ // "aws.dynamodb.scanned_count" semantic conventions. It represents the
+ // value of the `ScannedCount` response parameter.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 50
+ AWSDynamoDBScannedCountKey = attribute.Key("aws.dynamodb.scanned_count")
+
+ // AWSDynamoDBSegmentKey is the attribute Key conforming to the
+ // "aws.dynamodb.segment" semantic conventions. It represents the value of
+ // the `Segment` request parameter.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 10
+ AWSDynamoDBSegmentKey = attribute.Key("aws.dynamodb.segment")
+
+ // AWSDynamoDBSelectKey is the attribute Key conforming to the
+ // "aws.dynamodb.select" semantic conventions. It represents the value of
+ // the `Select` request parameter.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'ALL_ATTRIBUTES', 'COUNT'
+ AWSDynamoDBSelectKey = attribute.Key("aws.dynamodb.select")
+
+ // AWSDynamoDBTableCountKey is the attribute Key conforming to the
+ // "aws.dynamodb.table_count" semantic conventions. It represents the
+ // number of items in the `TableNames` response parameter.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 20
+ AWSDynamoDBTableCountKey = attribute.Key("aws.dynamodb.table_count")
+
+ // AWSDynamoDBTableNamesKey is the attribute Key conforming to the
+ // "aws.dynamodb.table_names" semantic conventions. It represents the keys
+ // in the `RequestItems` object field.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Users', 'Cats'
+ AWSDynamoDBTableNamesKey = attribute.Key("aws.dynamodb.table_names")
+
+ // AWSDynamoDBTotalSegmentsKey is the attribute Key conforming to the
+ // "aws.dynamodb.total_segments" semantic conventions. It represents the
+ // value of the `TotalSegments` request parameter.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 100
+ AWSDynamoDBTotalSegmentsKey = attribute.Key("aws.dynamodb.total_segments")
+)
+
+// AWSDynamoDBAttributeDefinitions returns an attribute KeyValue conforming
+// to the "aws.dynamodb.attribute_definitions" semantic conventions. It
+// represents the JSON-serialized value of each item in the
+// `AttributeDefinitions` request field.
+func AWSDynamoDBAttributeDefinitions(val ...string) attribute.KeyValue {
+ return AWSDynamoDBAttributeDefinitionsKey.StringSlice(val)
+}
+
+// AWSDynamoDBAttributesToGet returns an attribute KeyValue conforming to
+// the "aws.dynamodb.attributes_to_get" semantic conventions. It represents the
+// value of the `AttributesToGet` request parameter.
+func AWSDynamoDBAttributesToGet(val ...string) attribute.KeyValue {
+ return AWSDynamoDBAttributesToGetKey.StringSlice(val)
+}
+
+// AWSDynamoDBConsistentRead returns an attribute KeyValue conforming to the
+// "aws.dynamodb.consistent_read" semantic conventions. It represents the value
+// of the `ConsistentRead` request parameter.
+func AWSDynamoDBConsistentRead(val bool) attribute.KeyValue {
+ return AWSDynamoDBConsistentReadKey.Bool(val)
+}
+
+// AWSDynamoDBConsumedCapacity returns an attribute KeyValue conforming to
+// the "aws.dynamodb.consumed_capacity" semantic conventions. It represents the
+// JSON-serialized value of each item in the `ConsumedCapacity` response field.
+func AWSDynamoDBConsumedCapacity(val ...string) attribute.KeyValue {
+ return AWSDynamoDBConsumedCapacityKey.StringSlice(val)
+}
+
+// AWSDynamoDBCount returns an attribute KeyValue conforming to the
+// "aws.dynamodb.count" semantic conventions. It represents the value of the
+// `Count` response parameter.
+func AWSDynamoDBCount(val int) attribute.KeyValue {
+ return AWSDynamoDBCountKey.Int(val)
+}
+
+// AWSDynamoDBExclusiveStartTable returns an attribute KeyValue conforming
+// to the "aws.dynamodb.exclusive_start_table" semantic conventions. It
+// represents the value of the `ExclusiveStartTableName` request parameter.
+func AWSDynamoDBExclusiveStartTable(val string) attribute.KeyValue {
+ return AWSDynamoDBExclusiveStartTableKey.String(val)
+}
+
+// AWSDynamoDBGlobalSecondaryIndexUpdates returns an attribute KeyValue
+// conforming to the "aws.dynamodb.global_secondary_index_updates" semantic
+// conventions. It represents the JSON-serialized value of each item in the
+// `GlobalSecondaryIndexUpdates` request field.
+func AWSDynamoDBGlobalSecondaryIndexUpdates(val ...string) attribute.KeyValue {
+ return AWSDynamoDBGlobalSecondaryIndexUpdatesKey.StringSlice(val)
+}
+
+// AWSDynamoDBGlobalSecondaryIndexes returns an attribute KeyValue
+// conforming to the "aws.dynamodb.global_secondary_indexes" semantic
+// conventions. It represents the JSON-serialized value of each item of the
+// `GlobalSecondaryIndexes` request field
+func AWSDynamoDBGlobalSecondaryIndexes(val ...string) attribute.KeyValue {
+ return AWSDynamoDBGlobalSecondaryIndexesKey.StringSlice(val)
+}
+
+// AWSDynamoDBIndexName returns an attribute KeyValue conforming to the
+// "aws.dynamodb.index_name" semantic conventions. It represents the value of
+// the `IndexName` request parameter.
+func AWSDynamoDBIndexName(val string) attribute.KeyValue {
+ return AWSDynamoDBIndexNameKey.String(val)
+}
+
+// AWSDynamoDBItemCollectionMetrics returns an attribute KeyValue conforming
+// to the "aws.dynamodb.item_collection_metrics" semantic conventions. It
+// represents the JSON-serialized value of the `ItemCollectionMetrics` response
+// field.
+func AWSDynamoDBItemCollectionMetrics(val string) attribute.KeyValue {
+ return AWSDynamoDBItemCollectionMetricsKey.String(val)
+}
+
+// AWSDynamoDBLimit returns an attribute KeyValue conforming to the
+// "aws.dynamodb.limit" semantic conventions. It represents the value of the
+// `Limit` request parameter.
+func AWSDynamoDBLimit(val int) attribute.KeyValue {
+ return AWSDynamoDBLimitKey.Int(val)
+}
+
+// AWSDynamoDBLocalSecondaryIndexes returns an attribute KeyValue conforming
+// to the "aws.dynamodb.local_secondary_indexes" semantic conventions. It
+// represents the JSON-serialized value of each item of the
+// `LocalSecondaryIndexes` request field.
+func AWSDynamoDBLocalSecondaryIndexes(val ...string) attribute.KeyValue {
+ return AWSDynamoDBLocalSecondaryIndexesKey.StringSlice(val)
+}
+
+// AWSDynamoDBProjection returns an attribute KeyValue conforming to the
+// "aws.dynamodb.projection" semantic conventions. It represents the value of
+// the `ProjectionExpression` request parameter.
+func AWSDynamoDBProjection(val string) attribute.KeyValue {
+ return AWSDynamoDBProjectionKey.String(val)
+}
+
+// AWSDynamoDBProvisionedReadCapacity returns an attribute KeyValue
+// conforming to the "aws.dynamodb.provisioned_read_capacity" semantic
+// conventions. It represents the value of the
+// `ProvisionedThroughput.ReadCapacityUnits` request parameter.
+func AWSDynamoDBProvisionedReadCapacity(val float64) attribute.KeyValue {
+ return AWSDynamoDBProvisionedReadCapacityKey.Float64(val)
+}
+
+// AWSDynamoDBProvisionedWriteCapacity returns an attribute KeyValue
+// conforming to the "aws.dynamodb.provisioned_write_capacity" semantic
+// conventions. It represents the value of the
+// `ProvisionedThroughput.WriteCapacityUnits` request parameter.
+func AWSDynamoDBProvisionedWriteCapacity(val float64) attribute.KeyValue {
+ return AWSDynamoDBProvisionedWriteCapacityKey.Float64(val)
+}
+
+// AWSDynamoDBScanForward returns an attribute KeyValue conforming to the
+// "aws.dynamodb.scan_forward" semantic conventions. It represents the value of
+// the `ScanIndexForward` request parameter.
+func AWSDynamoDBScanForward(val bool) attribute.KeyValue {
+ return AWSDynamoDBScanForwardKey.Bool(val)
+}
+
+// AWSDynamoDBScannedCount returns an attribute KeyValue conforming to the
+// "aws.dynamodb.scanned_count" semantic conventions. It represents the value
+// of the `ScannedCount` response parameter.
+func AWSDynamoDBScannedCount(val int) attribute.KeyValue {
+ return AWSDynamoDBScannedCountKey.Int(val)
+}
+
+// AWSDynamoDBSegment returns an attribute KeyValue conforming to the
+// "aws.dynamodb.segment" semantic conventions. It represents the value of the
+// `Segment` request parameter.
+func AWSDynamoDBSegment(val int) attribute.KeyValue {
+ return AWSDynamoDBSegmentKey.Int(val)
+}
+
+// AWSDynamoDBSelect returns an attribute KeyValue conforming to the
+// "aws.dynamodb.select" semantic conventions. It represents the value of the
+// `Select` request parameter.
+func AWSDynamoDBSelect(val string) attribute.KeyValue {
+ return AWSDynamoDBSelectKey.String(val)
+}
+
+// AWSDynamoDBTableCount returns an attribute KeyValue conforming to the
+// "aws.dynamodb.table_count" semantic conventions. It represents the number of
+// items in the `TableNames` response parameter.
+func AWSDynamoDBTableCount(val int) attribute.KeyValue {
+ return AWSDynamoDBTableCountKey.Int(val)
+}
+
+// AWSDynamoDBTableNames returns an attribute KeyValue conforming to the
+// "aws.dynamodb.table_names" semantic conventions. It represents the keys in
+// the `RequestItems` object field.
+func AWSDynamoDBTableNames(val ...string) attribute.KeyValue {
+ return AWSDynamoDBTableNamesKey.StringSlice(val)
+}
+
+// AWSDynamoDBTotalSegments returns an attribute KeyValue conforming to the
+// "aws.dynamodb.total_segments" semantic conventions. It represents the value
+// of the `TotalSegments` request parameter.
+func AWSDynamoDBTotalSegments(val int) attribute.KeyValue {
+ return AWSDynamoDBTotalSegmentsKey.Int(val)
+}
+
+// Attributes for AWS Elastic Container Service (ECS).
+const (
+ // AWSECSTaskIDKey is the attribute Key conforming to the "aws.ecs.task.id"
+ // semantic conventions. It represents the ID of a running ECS task. The ID
+ // MUST be extracted from `task.arn`.
+ //
+ // Type: string
+ // RequirementLevel: ConditionallyRequired (If and only if `task.arn` is
+ // populated.)
+ // Stability: experimental
+ // Examples: '10838bed-421f-43ef-870a-f43feacbbb5b',
+ // '23ebb8ac-c18f-46c6-8bbe-d55d0e37cfbd'
+ AWSECSTaskIDKey = attribute.Key("aws.ecs.task.id")
+
+ // AWSECSClusterARNKey is the attribute Key conforming to the
+ // "aws.ecs.cluster.arn" semantic conventions. It represents the ARN of an
+ // [ECS
+ // cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster'
+ AWSECSClusterARNKey = attribute.Key("aws.ecs.cluster.arn")
+
+ // AWSECSContainerARNKey is the attribute Key conforming to the
+ // "aws.ecs.container.arn" semantic conventions. It represents the Amazon
+ // Resource Name (ARN) of an [ECS container
+ // instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // 'arn:aws:ecs:us-west-1:123456789123:container/32624152-9086-4f0e-acae-1a75b14fe4d9'
+ AWSECSContainerARNKey = attribute.Key("aws.ecs.container.arn")
+
+ // AWSECSLaunchtypeKey is the attribute Key conforming to the
+ // "aws.ecs.launchtype" semantic conventions. It represents the [launch
+ // type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html)
+ // for an ECS task.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ AWSECSLaunchtypeKey = attribute.Key("aws.ecs.launchtype")
+
+ // AWSECSTaskARNKey is the attribute Key conforming to the
+ // "aws.ecs.task.arn" semantic conventions. It represents the ARN of a
+ // running [ECS
+ // task](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-ids).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // 'arn:aws:ecs:us-west-1:123456789123:task/10838bed-421f-43ef-870a-f43feacbbb5b',
+ // 'arn:aws:ecs:us-west-1:123456789123:task/my-cluster/task-id/23ebb8ac-c18f-46c6-8bbe-d55d0e37cfbd'
+ AWSECSTaskARNKey = attribute.Key("aws.ecs.task.arn")
+
+ // AWSECSTaskFamilyKey is the attribute Key conforming to the
+ // "aws.ecs.task.family" semantic conventions. It represents the family
+ // name of the [ECS task
+ // definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html)
+ // used to create the ECS task.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry-family'
+ AWSECSTaskFamilyKey = attribute.Key("aws.ecs.task.family")
+
+ // AWSECSTaskRevisionKey is the attribute Key conforming to the
+ // "aws.ecs.task.revision" semantic conventions. It represents the revision
+ // for the task definition used to create the ECS task.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '8', '26'
+ AWSECSTaskRevisionKey = attribute.Key("aws.ecs.task.revision")
+)
+
+var (
+ // ec2
+ AWSECSLaunchtypeEC2 = AWSECSLaunchtypeKey.String("ec2")
+ // fargate
+ AWSECSLaunchtypeFargate = AWSECSLaunchtypeKey.String("fargate")
+)
+
+// AWSECSTaskID returns an attribute KeyValue conforming to the
+// "aws.ecs.task.id" semantic conventions. It represents the ID of a running
+// ECS task. The ID MUST be extracted from `task.arn`.
+func AWSECSTaskID(val string) attribute.KeyValue {
+ return AWSECSTaskIDKey.String(val)
+}
+
+// AWSECSClusterARN returns an attribute KeyValue conforming to the
+// "aws.ecs.cluster.arn" semantic conventions. It represents the ARN of an [ECS
+// cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html).
+func AWSECSClusterARN(val string) attribute.KeyValue {
+ return AWSECSClusterARNKey.String(val)
+}
+
+// AWSECSContainerARN returns an attribute KeyValue conforming to the
+// "aws.ecs.container.arn" semantic conventions. It represents the Amazon
+// Resource Name (ARN) of an [ECS container
+// instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html).
+func AWSECSContainerARN(val string) attribute.KeyValue {
+ return AWSECSContainerARNKey.String(val)
+}
+
+// AWSECSTaskARN returns an attribute KeyValue conforming to the
+// "aws.ecs.task.arn" semantic conventions. It represents the ARN of a running
+// [ECS
+// task](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-ids).
+func AWSECSTaskARN(val string) attribute.KeyValue {
+ return AWSECSTaskARNKey.String(val)
+}
+
+// AWSECSTaskFamily returns an attribute KeyValue conforming to the
+// "aws.ecs.task.family" semantic conventions. It represents the family name of
+// the [ECS task
+// definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html)
+// used to create the ECS task.
+func AWSECSTaskFamily(val string) attribute.KeyValue {
+ return AWSECSTaskFamilyKey.String(val)
+}
+
+// AWSECSTaskRevision returns an attribute KeyValue conforming to the
+// "aws.ecs.task.revision" semantic conventions. It represents the revision for
+// the task definition used to create the ECS task.
+func AWSECSTaskRevision(val string) attribute.KeyValue {
+ return AWSECSTaskRevisionKey.String(val)
+}
+
+// Attributes for AWS Elastic Kubernetes Service (EKS).
+const (
+ // AWSEKSClusterARNKey is the attribute Key conforming to the
+ // "aws.eks.cluster.arn" semantic conventions. It represents the ARN of an
+ // EKS cluster.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster'
+ AWSEKSClusterARNKey = attribute.Key("aws.eks.cluster.arn")
+)
+
+// AWSEKSClusterARN returns an attribute KeyValue conforming to the
+// "aws.eks.cluster.arn" semantic conventions. It represents the ARN of an EKS
+// cluster.
+func AWSEKSClusterARN(val string) attribute.KeyValue {
+ return AWSEKSClusterARNKey.String(val)
+}
+
+// Attributes for AWS Logs.
+const (
+ // AWSLogGroupARNsKey is the attribute Key conforming to the
+ // "aws.log.group.arns" semantic conventions. It represents the Amazon
+ // Resource Name(s) (ARN) of the AWS log group(s).
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // 'arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:*'
+ // Note: See the [log group ARN format
+ // documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format).
+ AWSLogGroupARNsKey = attribute.Key("aws.log.group.arns")
+
+ // AWSLogGroupNamesKey is the attribute Key conforming to the
+ // "aws.log.group.names" semantic conventions. It represents the name(s) of
+ // the AWS log group(s) an application is writing to.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/aws/lambda/my-function', 'opentelemetry-service'
+ // Note: Multiple log groups must be supported for cases like
+ // multi-container applications, where a single application has sidecar
+ // containers, and each write to their own log group.
+ AWSLogGroupNamesKey = attribute.Key("aws.log.group.names")
+
+ // AWSLogStreamARNsKey is the attribute Key conforming to the
+ // "aws.log.stream.arns" semantic conventions. It represents the ARN(s) of
+ // the AWS log stream(s).
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // 'arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:log-stream:logs/main/10838bed-421f-43ef-870a-f43feacbbb5b'
+ // Note: See the [log stream ARN format
+ // documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format).
+ // One log group can contain several log streams, so these ARNs necessarily
+ // identify both a log group and a log stream.
+ AWSLogStreamARNsKey = attribute.Key("aws.log.stream.arns")
+
+ // AWSLogStreamNamesKey is the attribute Key conforming to the
+ // "aws.log.stream.names" semantic conventions. It represents the name(s)
+ // of the AWS log stream(s) an application is writing to.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'logs/main/10838bed-421f-43ef-870a-f43feacbbb5b'
+ AWSLogStreamNamesKey = attribute.Key("aws.log.stream.names")
+)
+
+// AWSLogGroupARNs returns an attribute KeyValue conforming to the
+// "aws.log.group.arns" semantic conventions. It represents the Amazon Resource
+// Name(s) (ARN) of the AWS log group(s).
+func AWSLogGroupARNs(val ...string) attribute.KeyValue {
+ return AWSLogGroupARNsKey.StringSlice(val)
+}
+
+// AWSLogGroupNames returns an attribute KeyValue conforming to the
+// "aws.log.group.names" semantic conventions. It represents the name(s) of the
+// AWS log group(s) an application is writing to.
+func AWSLogGroupNames(val ...string) attribute.KeyValue {
+ return AWSLogGroupNamesKey.StringSlice(val)
+}
+
+// AWSLogStreamARNs returns an attribute KeyValue conforming to the
+// "aws.log.stream.arns" semantic conventions. It represents the ARN(s) of the
+// AWS log stream(s).
+func AWSLogStreamARNs(val ...string) attribute.KeyValue {
+ return AWSLogStreamARNsKey.StringSlice(val)
+}
+
+// AWSLogStreamNames returns an attribute KeyValue conforming to the
+// "aws.log.stream.names" semantic conventions. It represents the name(s) of
+// the AWS log stream(s) an application is writing to.
+func AWSLogStreamNames(val ...string) attribute.KeyValue {
+ return AWSLogStreamNamesKey.StringSlice(val)
+}
+
+// Attributes for AWS Lambda.
+const (
+ // AWSLambdaInvokedARNKey is the attribute Key conforming to the
+ // "aws.lambda.invoked_arn" semantic conventions. It represents the full
+ // invoked ARN as provided on the `Context` passed to the function
+ // (`Lambda-Runtime-Invoked-Function-ARN` header on the
+ // `/runtime/invocation/next` applicable).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'arn:aws:lambda:us-east-1:123456:function:myfunction:myalias'
+ // Note: This may be different from `cloud.resource_id` if an alias is
+ // involved.
+ AWSLambdaInvokedARNKey = attribute.Key("aws.lambda.invoked_arn")
+)
+
+// AWSLambdaInvokedARN returns an attribute KeyValue conforming to the
+// "aws.lambda.invoked_arn" semantic conventions. It represents the full
+// invoked ARN as provided on the `Context` passed to the function
+// (`Lambda-Runtime-Invoked-Function-ARN` header on the
+// `/runtime/invocation/next` applicable).
+func AWSLambdaInvokedARN(val string) attribute.KeyValue {
+ return AWSLambdaInvokedARNKey.String(val)
+}
+
+// Attributes for AWS S3.
+const (
+ // AWSS3BucketKey is the attribute Key conforming to the "aws.s3.bucket"
+ // semantic conventions. It represents the S3 bucket name the request
+ // refers to. Corresponds to the `--bucket` parameter of the [S3
+ // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)
+ // operations.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'some-bucket-name'
+ // Note: The `bucket` attribute is applicable to all S3 operations that
+ // reference a bucket, i.e. that require the bucket name as a mandatory
+ // parameter.
+ // This applies to almost all S3 operations except `list-buckets`.
+ AWSS3BucketKey = attribute.Key("aws.s3.bucket")
+
+ // AWSS3CopySourceKey is the attribute Key conforming to the
+ // "aws.s3.copy_source" semantic conventions. It represents the source
+ // object (in the form `bucket`/`key`) for the copy operation.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'someFile.yml'
+ // Note: The `copy_source` attribute applies to S3 copy operations and
+ // corresponds to the `--copy-source` parameter
+ // of the [copy-object operation within the S3
+ // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html).
+ // This applies in particular to the following operations:
+ //
+ // -
+ // [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html)
+ // -
+ // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html)
+ AWSS3CopySourceKey = attribute.Key("aws.s3.copy_source")
+
+ // AWSS3DeleteKey is the attribute Key conforming to the "aws.s3.delete"
+ // semantic conventions. It represents the delete request container that
+ // specifies the objects to be deleted.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // 'Objects=[{Key=string,VersionID=string},{Key=string,VersionID=string}],Quiet=boolean'
+ // Note: The `delete` attribute is only applicable to the
+ // [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html)
+ // operation.
+ // The `delete` attribute corresponds to the `--delete` parameter of the
+ // [delete-objects operation within the S3
+ // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-objects.html).
+ AWSS3DeleteKey = attribute.Key("aws.s3.delete")
+
+ // AWSS3KeyKey is the attribute Key conforming to the "aws.s3.key" semantic
+ // conventions. It represents the S3 object key the request refers to.
+ // Corresponds to the `--key` parameter of the [S3
+ // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)
+ // operations.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'someFile.yml'
+ // Note: The `key` attribute is applicable to all object-related S3
+ // operations, i.e. that require the object key as a mandatory parameter.
+ // This applies in particular to the following operations:
+ //
+ // -
+ // [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html)
+ // -
+ // [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html)
+ // -
+ // [get-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/get-object.html)
+ // -
+ // [head-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/head-object.html)
+ // -
+ // [put-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/put-object.html)
+ // -
+ // [restore-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/restore-object.html)
+ // -
+ // [select-object-content](https://docs.aws.amazon.com/cli/latest/reference/s3api/select-object-content.html)
+ // -
+ // [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html)
+ // -
+ // [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html)
+ // -
+ // [create-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/create-multipart-upload.html)
+ // -
+ // [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html)
+ // -
+ // [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html)
+ // -
+ // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html)
+ AWSS3KeyKey = attribute.Key("aws.s3.key")
+
+ // AWSS3PartNumberKey is the attribute Key conforming to the
+ // "aws.s3.part_number" semantic conventions. It represents the part number
+ // of the part being uploaded in a multipart-upload operation. This is a
+ // positive integer between 1 and 10,000.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 3456
+ // Note: The `part_number` attribute is only applicable to the
+ // [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html)
+ // and
+ // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html)
+ // operations.
+ // The `part_number` attribute corresponds to the `--part-number` parameter
+ // of the
+ // [upload-part operation within the S3
+ // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html).
+ AWSS3PartNumberKey = attribute.Key("aws.s3.part_number")
+
+ // AWSS3UploadIDKey is the attribute Key conforming to the
+ // "aws.s3.upload_id" semantic conventions. It represents the upload ID
+ // that identifies the multipart upload.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'dfRtDYWFbkRONycy.Yxwh66Yjlx.cph0gtNBtJ'
+ // Note: The `upload_id` attribute applies to S3 multipart-upload
+ // operations and corresponds to the `--upload-id` parameter
+ // of the [S3
+ // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)
+ // multipart operations.
+ // This applies in particular to the following operations:
+ //
+ // -
+ // [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html)
+ // -
+ // [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html)
+ // -
+ // [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html)
+ // -
+ // [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html)
+ // -
+ // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html)
+ AWSS3UploadIDKey = attribute.Key("aws.s3.upload_id")
+)
+
+// AWSS3Bucket returns an attribute KeyValue conforming to the
+// "aws.s3.bucket" semantic conventions. It represents the S3 bucket name the
+// request refers to. Corresponds to the `--bucket` parameter of the [S3
+// API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)
+// operations.
+func AWSS3Bucket(val string) attribute.KeyValue {
+ return AWSS3BucketKey.String(val)
+}
+
+// AWSS3CopySource returns an attribute KeyValue conforming to the
+// "aws.s3.copy_source" semantic conventions. It represents the source object
+// (in the form `bucket`/`key`) for the copy operation.
+func AWSS3CopySource(val string) attribute.KeyValue {
+ return AWSS3CopySourceKey.String(val)
+}
+
+// AWSS3Delete returns an attribute KeyValue conforming to the
+// "aws.s3.delete" semantic conventions. It represents the delete request
+// container that specifies the objects to be deleted.
+func AWSS3Delete(val string) attribute.KeyValue {
+ return AWSS3DeleteKey.String(val)
+}
+
+// AWSS3Key returns an attribute KeyValue conforming to the "aws.s3.key"
+// semantic conventions. It represents the S3 object key the request refers to.
+// Corresponds to the `--key` parameter of the [S3
+// API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)
+// operations.
+func AWSS3Key(val string) attribute.KeyValue {
+ return AWSS3KeyKey.String(val)
+}
+
+// AWSS3PartNumber returns an attribute KeyValue conforming to the
+// "aws.s3.part_number" semantic conventions. It represents the part number of
+// the part being uploaded in a multipart-upload operation. This is a positive
+// integer between 1 and 10,000.
+func AWSS3PartNumber(val int) attribute.KeyValue {
+ return AWSS3PartNumberKey.Int(val)
+}
+
+// AWSS3UploadID returns an attribute KeyValue conforming to the
+// "aws.s3.upload_id" semantic conventions. It represents the upload ID that
+// identifies the multipart upload.
+func AWSS3UploadID(val string) attribute.KeyValue {
+ return AWSS3UploadIDKey.String(val)
+}
+
+// The web browser attributes
+const (
+ // BrowserBrandsKey is the attribute Key conforming to the "browser.brands"
+ // semantic conventions. It represents the array of brand name and version
+ // separated by a space
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: ' Not A;Brand 99', 'Chromium 99', 'Chrome 99'
+ // Note: This value is intended to be taken from the [UA client hints
+ // API](https://wicg.github.io/ua-client-hints/#interface)
+ // (`navigator.userAgentData.brands`).
+ BrowserBrandsKey = attribute.Key("browser.brands")
+
+ // BrowserLanguageKey is the attribute Key conforming to the
+ // "browser.language" semantic conventions. It represents the preferred
+ // language of the user using the browser
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'en', 'en-US', 'fr', 'fr-FR'
+ // Note: This value is intended to be taken from the Navigator API
+ // `navigator.language`.
+ BrowserLanguageKey = attribute.Key("browser.language")
+
+ // BrowserMobileKey is the attribute Key conforming to the "browser.mobile"
+ // semantic conventions. It represents a boolean that is true if the
+ // browser is running on a mobile device
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Note: This value is intended to be taken from the [UA client hints
+ // API](https://wicg.github.io/ua-client-hints/#interface)
+ // (`navigator.userAgentData.mobile`). If unavailable, this attribute
+ // SHOULD be left unset.
+ BrowserMobileKey = attribute.Key("browser.mobile")
+
+ // BrowserPlatformKey is the attribute Key conforming to the
+ // "browser.platform" semantic conventions. It represents the platform on
+ // which the browser is running
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Windows', 'macOS', 'Android'
+ // Note: This value is intended to be taken from the [UA client hints
+ // API](https://wicg.github.io/ua-client-hints/#interface)
+ // (`navigator.userAgentData.platform`). If unavailable, the legacy
+ // `navigator.platform` API SHOULD NOT be used instead and this attribute
+ // SHOULD be left unset in order for the values to be consistent.
+ // The list of possible values is defined in the [W3C User-Agent Client
+ // Hints
+ // specification](https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform).
+ // Note that some (but not all) of these values can overlap with values in
+ // the [`os.type` and `os.name` attributes](./os.md). However, for
+ // consistency, the values in the `browser.platform` attribute should
+ // capture the exact value that the user agent provides.
+ BrowserPlatformKey = attribute.Key("browser.platform")
+)
+
+// BrowserBrands returns an attribute KeyValue conforming to the
+// "browser.brands" semantic conventions. It represents the array of brand name
+// and version separated by a space
+func BrowserBrands(val ...string) attribute.KeyValue {
+ return BrowserBrandsKey.StringSlice(val)
+}
+
+// BrowserLanguage returns an attribute KeyValue conforming to the
+// "browser.language" semantic conventions. It represents the preferred
+// language of the user using the browser
+func BrowserLanguage(val string) attribute.KeyValue {
+ return BrowserLanguageKey.String(val)
+}
+
+// BrowserMobile returns an attribute KeyValue conforming to the
+// "browser.mobile" semantic conventions. It represents a boolean that is true
+// if the browser is running on a mobile device
+func BrowserMobile(val bool) attribute.KeyValue {
+ return BrowserMobileKey.Bool(val)
+}
+
+// BrowserPlatform returns an attribute KeyValue conforming to the
+// "browser.platform" semantic conventions. It represents the platform on which
+// the browser is running
+func BrowserPlatform(val string) attribute.KeyValue {
+ return BrowserPlatformKey.String(val)
+}
+
+// These attributes may be used to describe the client in a connection-based
+// network interaction where there is one side that initiates the connection
+// (the client is the side that initiates the connection). This covers all TCP
+// network interactions since TCP is connection-based and one side initiates
+// the connection (an exception is made for peer-to-peer communication over TCP
+// where the "user-facing" surface of the protocol / API doesn't expose a clear
+// notion of client and server). This also covers UDP network interactions
+// where one side initiates the interaction, e.g. QUIC (HTTP/3) and DNS.
+const (
+ // ClientAddressKey is the attribute Key conforming to the "client.address"
+ // semantic conventions. It represents the client address - domain name if
+ // available without reverse DNS lookup; otherwise, IP address or Unix
+ // domain socket name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'client.example.com', '10.1.2.80', '/tmp/my.sock'
+ // Note: When observed from the server side, and when communicating through
+ // an intermediary, `client.address` SHOULD represent the client address
+ // behind any intermediaries, for example proxies, if it's available.
+ ClientAddressKey = attribute.Key("client.address")
+
+ // ClientPortKey is the attribute Key conforming to the "client.port"
+ // semantic conventions. It represents the client port number.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 65123
+ // Note: When observed from the server side, and when communicating through
+ // an intermediary, `client.port` SHOULD represent the client port behind
+ // any intermediaries, for example proxies, if it's available.
+ ClientPortKey = attribute.Key("client.port")
+)
+
+// ClientAddress returns an attribute KeyValue conforming to the
+// "client.address" semantic conventions. It represents the client address -
+// domain name if available without reverse DNS lookup; otherwise, IP address
+// or Unix domain socket name.
+func ClientAddress(val string) attribute.KeyValue {
+ return ClientAddressKey.String(val)
+}
+
+// ClientPort returns an attribute KeyValue conforming to the "client.port"
+// semantic conventions. It represents the client port number.
+func ClientPort(val int) attribute.KeyValue {
+ return ClientPortKey.Int(val)
+}
+
+// A cloud environment (e.g. GCP, Azure, AWS).
+const (
+ // CloudAccountIDKey is the attribute Key conforming to the
+ // "cloud.account.id" semantic conventions. It represents the cloud account
+ // ID the resource is assigned to.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '111111111111', 'opentelemetry'
+ CloudAccountIDKey = attribute.Key("cloud.account.id")
+
+ // CloudAvailabilityZoneKey is the attribute Key conforming to the
+ // "cloud.availability_zone" semantic conventions. It represents the cloud
+ // regions often have multiple, isolated locations known as zones to
+ // increase availability. Availability zone represents the zone where the
+ // resource is running.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'us-east-1c'
+ // Note: Availability zones are called "zones" on Alibaba Cloud and Google
+ // Cloud.
+ CloudAvailabilityZoneKey = attribute.Key("cloud.availability_zone")
+
+ // CloudPlatformKey is the attribute Key conforming to the "cloud.platform"
+ // semantic conventions. It represents the cloud platform in use.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Note: The prefix of the service SHOULD match the one specified in
+ // `cloud.provider`.
+ CloudPlatformKey = attribute.Key("cloud.platform")
+
+ // CloudProviderKey is the attribute Key conforming to the "cloud.provider"
+ // semantic conventions. It represents the name of the cloud provider.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ CloudProviderKey = attribute.Key("cloud.provider")
+
+ // CloudRegionKey is the attribute Key conforming to the "cloud.region"
+ // semantic conventions. It represents the geographical region the resource
+ // is running.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'us-central1', 'us-east-1'
+ // Note: Refer to your provider's docs to see the available regions, for
+ // example [Alibaba Cloud
+ // regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS
+ // regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/),
+ // [Azure
+ // regions](https://azure.microsoft.com/global-infrastructure/geographies/),
+ // [Google Cloud regions](https://cloud.google.com/about/locations), or
+ // [Tencent Cloud
+ // regions](https://www.tencentcloud.com/document/product/213/6091).
+ CloudRegionKey = attribute.Key("cloud.region")
+
+ // CloudResourceIDKey is the attribute Key conforming to the
+ // "cloud.resource_id" semantic conventions. It represents the cloud
+ // provider-specific native identifier of the monitored cloud resource
+ // (e.g. an
+ // [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
+ // on AWS, a [fully qualified resource
+ // ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id)
+ // on Azure, a [full resource
+ // name](https://cloud.google.com/apis/design/resource_names#full_resource_name)
+ // on GCP)
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function',
+ // '//run.googleapis.com/projects/PROJECT_ID/locations/LOCATION_ID/services/SERVICE_ID',
+ // '/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/'
+ // Note: On some cloud providers, it may not be possible to determine the
+ // full ID at startup,
+ // so it may be necessary to set `cloud.resource_id` as a span attribute
+ // instead.
+ //
+ // The exact value to use for `cloud.resource_id` depends on the cloud
+ // provider.
+ // The following well-known definitions MUST be used if you set this
+ // attribute and they apply:
+ //
+ // * **AWS Lambda:** The function
+ // [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html).
+ // Take care not to use the "invoked ARN" directly but replace any
+ // [alias
+ // suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html)
+ // with the resolved function version, as the same runtime instance may
+ // be invokable with
+ // multiple different aliases.
+ // * **GCP:** The [URI of the
+ // resource](https://cloud.google.com/iam/docs/full-resource-names)
+ // * **Azure:** The [Fully Qualified Resource
+ // ID](https://docs.microsoft.com/rest/api/resources/resources/get-by-id)
+ // of the invoked function,
+ // *not* the function app, having the form
+ // `/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/`.
+ // This means that a span attribute MUST be used, as an Azure function
+ // app can host multiple functions that would usually share
+ // a TracerProvider.
+ CloudResourceIDKey = attribute.Key("cloud.resource_id")
+)
+
+var (
+ // Alibaba Cloud Elastic Compute Service
+ CloudPlatformAlibabaCloudECS = CloudPlatformKey.String("alibaba_cloud_ecs")
+ // Alibaba Cloud Function Compute
+ CloudPlatformAlibabaCloudFc = CloudPlatformKey.String("alibaba_cloud_fc")
+ // Red Hat OpenShift on Alibaba Cloud
+ CloudPlatformAlibabaCloudOpenshift = CloudPlatformKey.String("alibaba_cloud_openshift")
+ // AWS Elastic Compute Cloud
+ CloudPlatformAWSEC2 = CloudPlatformKey.String("aws_ec2")
+ // AWS Elastic Container Service
+ CloudPlatformAWSECS = CloudPlatformKey.String("aws_ecs")
+ // AWS Elastic Kubernetes Service
+ CloudPlatformAWSEKS = CloudPlatformKey.String("aws_eks")
+ // AWS Lambda
+ CloudPlatformAWSLambda = CloudPlatformKey.String("aws_lambda")
+ // AWS Elastic Beanstalk
+ CloudPlatformAWSElasticBeanstalk = CloudPlatformKey.String("aws_elastic_beanstalk")
+ // AWS App Runner
+ CloudPlatformAWSAppRunner = CloudPlatformKey.String("aws_app_runner")
+ // Red Hat OpenShift on AWS (ROSA)
+ CloudPlatformAWSOpenshift = CloudPlatformKey.String("aws_openshift")
+ // Azure Virtual Machines
+ CloudPlatformAzureVM = CloudPlatformKey.String("azure_vm")
+ // Azure Container Apps
+ CloudPlatformAzureContainerApps = CloudPlatformKey.String("azure_container_apps")
+ // Azure Container Instances
+ CloudPlatformAzureContainerInstances = CloudPlatformKey.String("azure_container_instances")
+ // Azure Kubernetes Service
+ CloudPlatformAzureAKS = CloudPlatformKey.String("azure_aks")
+ // Azure Functions
+ CloudPlatformAzureFunctions = CloudPlatformKey.String("azure_functions")
+ // Azure App Service
+ CloudPlatformAzureAppService = CloudPlatformKey.String("azure_app_service")
+ // Azure Red Hat OpenShift
+ CloudPlatformAzureOpenshift = CloudPlatformKey.String("azure_openshift")
+ // Google Bare Metal Solution (BMS)
+ CloudPlatformGCPBareMetalSolution = CloudPlatformKey.String("gcp_bare_metal_solution")
+ // Google Cloud Compute Engine (GCE)
+ CloudPlatformGCPComputeEngine = CloudPlatformKey.String("gcp_compute_engine")
+ // Google Cloud Run
+ CloudPlatformGCPCloudRun = CloudPlatformKey.String("gcp_cloud_run")
+ // Google Cloud Kubernetes Engine (GKE)
+ CloudPlatformGCPKubernetesEngine = CloudPlatformKey.String("gcp_kubernetes_engine")
+ // Google Cloud Functions (GCF)
+ CloudPlatformGCPCloudFunctions = CloudPlatformKey.String("gcp_cloud_functions")
+ // Google Cloud App Engine (GAE)
+ CloudPlatformGCPAppEngine = CloudPlatformKey.String("gcp_app_engine")
+ // Red Hat OpenShift on Google Cloud
+ CloudPlatformGCPOpenshift = CloudPlatformKey.String("gcp_openshift")
+ // Red Hat OpenShift on IBM Cloud
+ CloudPlatformIbmCloudOpenshift = CloudPlatformKey.String("ibm_cloud_openshift")
+ // Tencent Cloud Cloud Virtual Machine (CVM)
+ CloudPlatformTencentCloudCvm = CloudPlatformKey.String("tencent_cloud_cvm")
+ // Tencent Cloud Elastic Kubernetes Service (EKS)
+ CloudPlatformTencentCloudEKS = CloudPlatformKey.String("tencent_cloud_eks")
+ // Tencent Cloud Serverless Cloud Function (SCF)
+ CloudPlatformTencentCloudScf = CloudPlatformKey.String("tencent_cloud_scf")
+)
+
+var (
+ // Alibaba Cloud
+ CloudProviderAlibabaCloud = CloudProviderKey.String("alibaba_cloud")
+ // Amazon Web Services
+ CloudProviderAWS = CloudProviderKey.String("aws")
+ // Microsoft Azure
+ CloudProviderAzure = CloudProviderKey.String("azure")
+ // Google Cloud Platform
+ CloudProviderGCP = CloudProviderKey.String("gcp")
+ // Heroku Platform as a Service
+ CloudProviderHeroku = CloudProviderKey.String("heroku")
+ // IBM Cloud
+ CloudProviderIbmCloud = CloudProviderKey.String("ibm_cloud")
+ // Tencent Cloud
+ CloudProviderTencentCloud = CloudProviderKey.String("tencent_cloud")
+)
+
+// CloudAccountID returns an attribute KeyValue conforming to the
+// "cloud.account.id" semantic conventions. It represents the cloud account ID
+// the resource is assigned to.
+func CloudAccountID(val string) attribute.KeyValue {
+ return CloudAccountIDKey.String(val)
+}
+
+// CloudAvailabilityZone returns an attribute KeyValue conforming to the
+// "cloud.availability_zone" semantic conventions. It represents the cloud
+// regions often have multiple, isolated locations known as zones to increase
+// availability. Availability zone represents the zone where the resource is
+// running.
+func CloudAvailabilityZone(val string) attribute.KeyValue {
+ return CloudAvailabilityZoneKey.String(val)
+}
+
+// CloudRegion returns an attribute KeyValue conforming to the
+// "cloud.region" semantic conventions. It represents the geographical region
+// the resource is running.
+func CloudRegion(val string) attribute.KeyValue {
+ return CloudRegionKey.String(val)
+}
+
+// CloudResourceID returns an attribute KeyValue conforming to the
+// "cloud.resource_id" semantic conventions. It represents the cloud
+// provider-specific native identifier of the monitored cloud resource (e.g. an
+// [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
+// on AWS, a [fully qualified resource
+// ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id) on
+// Azure, a [full resource
+// name](https://cloud.google.com/apis/design/resource_names#full_resource_name)
+// on GCP)
+func CloudResourceID(val string) attribute.KeyValue {
+ return CloudResourceIDKey.String(val)
+}
+
+// Attributes for CloudEvents.
+const (
+ // CloudeventsEventIDKey is the attribute Key conforming to the
+ // "cloudevents.event_id" semantic conventions. It represents the
+ // [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id)
+ // uniquely identifies the event.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '123e4567-e89b-12d3-a456-426614174000', '0001'
+ CloudeventsEventIDKey = attribute.Key("cloudevents.event_id")
+
+ // CloudeventsEventSourceKey is the attribute Key conforming to the
+ // "cloudevents.event_source" semantic conventions. It represents the
+ // [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1)
+ // identifies the context in which an event happened.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'https://github.com/cloudevents',
+ // '/cloudevents/spec/pull/123', 'my-service'
+ CloudeventsEventSourceKey = attribute.Key("cloudevents.event_source")
+
+ // CloudeventsEventSpecVersionKey is the attribute Key conforming to the
+ // "cloudevents.event_spec_version" semantic conventions. It represents the
+ // [version of the CloudEvents
+ // specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion)
+ // which the event uses.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '1.0'
+ CloudeventsEventSpecVersionKey = attribute.Key("cloudevents.event_spec_version")
+
+ // CloudeventsEventSubjectKey is the attribute Key conforming to the
+ // "cloudevents.event_subject" semantic conventions. It represents the
+ // [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject)
+ // of the event in the context of the event producer (identified by
+ // source).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'mynewfile.jpg'
+ CloudeventsEventSubjectKey = attribute.Key("cloudevents.event_subject")
+
+ // CloudeventsEventTypeKey is the attribute Key conforming to the
+ // "cloudevents.event_type" semantic conventions. It represents the
+ // [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type)
+ // contains a value describing the type of event related to the originating
+ // occurrence.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'com.github.pull_request.opened',
+ // 'com.example.object.deleted.v2'
+ CloudeventsEventTypeKey = attribute.Key("cloudevents.event_type")
+)
+
+// CloudeventsEventID returns an attribute KeyValue conforming to the
+// "cloudevents.event_id" semantic conventions. It represents the
+// [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id)
+// uniquely identifies the event.
+func CloudeventsEventID(val string) attribute.KeyValue {
+ return CloudeventsEventIDKey.String(val)
+}
+
+// CloudeventsEventSource returns an attribute KeyValue conforming to the
+// "cloudevents.event_source" semantic conventions. It represents the
+// [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1)
+// identifies the context in which an event happened.
+func CloudeventsEventSource(val string) attribute.KeyValue {
+ return CloudeventsEventSourceKey.String(val)
+}
+
+// CloudeventsEventSpecVersion returns an attribute KeyValue conforming to
+// the "cloudevents.event_spec_version" semantic conventions. It represents the
+// [version of the CloudEvents
+// specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion)
+// which the event uses.
+func CloudeventsEventSpecVersion(val string) attribute.KeyValue {
+ return CloudeventsEventSpecVersionKey.String(val)
+}
+
+// CloudeventsEventSubject returns an attribute KeyValue conforming to the
+// "cloudevents.event_subject" semantic conventions. It represents the
+// [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject)
+// of the event in the context of the event producer (identified by source).
+func CloudeventsEventSubject(val string) attribute.KeyValue {
+ return CloudeventsEventSubjectKey.String(val)
+}
+
+// CloudeventsEventType returns an attribute KeyValue conforming to the
+// "cloudevents.event_type" semantic conventions. It represents the
+// [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type)
+// contains a value describing the type of event related to the originating
+// occurrence.
+func CloudeventsEventType(val string) attribute.KeyValue {
+ return CloudeventsEventTypeKey.String(val)
+}
+
+// These attributes allow to report this unit of code and therefore to provide
+// more context about the span.
+const (
+ // CodeColumnKey is the attribute Key conforming to the "code.column"
+ // semantic conventions. It represents the column number in `code.filepath`
+ // best representing the operation. It SHOULD point within the code unit
+ // named in `code.function`.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 16
+ CodeColumnKey = attribute.Key("code.column")
+
+ // CodeFilepathKey is the attribute Key conforming to the "code.filepath"
+ // semantic conventions. It represents the source code file name that
+ // identifies the code unit as uniquely as possible (preferably an absolute
+ // file path).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/usr/local/MyApplication/content_root/app/index.php'
+ CodeFilepathKey = attribute.Key("code.filepath")
+
+ // CodeFunctionKey is the attribute Key conforming to the "code.function"
+ // semantic conventions. It represents the method or function name, or
+ // equivalent (usually rightmost part of the code unit's name).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'serveRequest'
+ CodeFunctionKey = attribute.Key("code.function")
+
+ // CodeLineNumberKey is the attribute Key conforming to the "code.lineno"
+ // semantic conventions. It represents the line number in `code.filepath`
+ // best representing the operation. It SHOULD point within the code unit
+ // named in `code.function`.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 42
+ CodeLineNumberKey = attribute.Key("code.lineno")
+
+ // CodeNamespaceKey is the attribute Key conforming to the "code.namespace"
+ // semantic conventions. It represents the "namespace" within which
+ // `code.function` is defined. Usually the qualified class or module name,
+ // such that `code.namespace` + some separator + `code.function` form a
+ // unique identifier for the code unit.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'com.example.MyHTTPService'
+ CodeNamespaceKey = attribute.Key("code.namespace")
+
+ // CodeStacktraceKey is the attribute Key conforming to the
+ // "code.stacktrace" semantic conventions. It represents a stacktrace as a
+ // string in the natural representation for the language runtime. The
+ // representation is to be determined and documented by each language SIG.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'at
+ // com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\n at '
+ // 'com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\n at '
+ // 'com.example.GenerateTrace.main(GenerateTrace.java:5)'
+ CodeStacktraceKey = attribute.Key("code.stacktrace")
+)
+
+// CodeColumn returns an attribute KeyValue conforming to the "code.column"
+// semantic conventions. It represents the column number in `code.filepath`
+// best representing the operation. It SHOULD point within the code unit named
+// in `code.function`.
+func CodeColumn(val int) attribute.KeyValue {
+ return CodeColumnKey.Int(val)
+}
+
+// CodeFilepath returns an attribute KeyValue conforming to the
+// "code.filepath" semantic conventions. It represents the source code file
+// name that identifies the code unit as uniquely as possible (preferably an
+// absolute file path).
+func CodeFilepath(val string) attribute.KeyValue {
+ return CodeFilepathKey.String(val)
+}
+
+// CodeFunction returns an attribute KeyValue conforming to the
+// "code.function" semantic conventions. It represents the method or function
+// name, or equivalent (usually rightmost part of the code unit's name).
+func CodeFunction(val string) attribute.KeyValue {
+ return CodeFunctionKey.String(val)
+}
+
+// CodeLineNumber returns an attribute KeyValue conforming to the "code.lineno"
+// semantic conventions. It represents the line number in `code.filepath` best
+// representing the operation. It SHOULD point within the code unit named in
+// `code.function`.
+func CodeLineNumber(val int) attribute.KeyValue {
+ return CodeLineNumberKey.Int(val)
+}
+
+// CodeNamespace returns an attribute KeyValue conforming to the
+// "code.namespace" semantic conventions. It represents the "namespace" within
+// which `code.function` is defined. Usually the qualified class or module
+// name, such that `code.namespace` + some separator + `code.function` form a
+// unique identifier for the code unit.
+func CodeNamespace(val string) attribute.KeyValue {
+ return CodeNamespaceKey.String(val)
+}
+
+// CodeStacktrace returns an attribute KeyValue conforming to the
+// "code.stacktrace" semantic conventions. It represents a stacktrace as a
+// string in the natural representation for the language runtime. The
+// representation is to be determined and documented by each language SIG.
+func CodeStacktrace(val string) attribute.KeyValue {
+ return CodeStacktraceKey.String(val)
+}
+
+// A container instance.
+const (
+ // ContainerCommandKey is the attribute Key conforming to the
+ // "container.command" semantic conventions. It represents the command used
+ // to run the container (i.e. the command name).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'otelcontribcol'
+ // Note: If using embedded credentials or sensitive data, it is recommended
+ // to remove them to prevent potential leakage.
+ ContainerCommandKey = attribute.Key("container.command")
+
+ // ContainerCommandArgsKey is the attribute Key conforming to the
+ // "container.command_args" semantic conventions. It represents the all the
+ // command arguments (including the command/executable itself) run by the
+ // container. [2]
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'otelcontribcol, --config, config.yaml'
+ ContainerCommandArgsKey = attribute.Key("container.command_args")
+
+ // ContainerCommandLineKey is the attribute Key conforming to the
+ // "container.command_line" semantic conventions. It represents the full
+ // command run by the container as a single string representing the full
+ // command. [2]
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'otelcontribcol --config config.yaml'
+ ContainerCommandLineKey = attribute.Key("container.command_line")
+
+ // ContainerCPUStateKey is the attribute Key conforming to the
+ // "container.cpu.state" semantic conventions. It represents the CPU state
+ // for this data point.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'user', 'kernel'
+ ContainerCPUStateKey = attribute.Key("container.cpu.state")
+
+ // ContainerIDKey is the attribute Key conforming to the "container.id"
+ // semantic conventions. It represents the container ID. Usually a UUID, as
+ // for example used to [identify Docker
+ // containers](https://docs.docker.com/engine/reference/run/#container-identification).
+ // The UUID might be abbreviated.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'a3bf90e006b2'
+ ContainerIDKey = attribute.Key("container.id")
+
+ // ContainerImageIDKey is the attribute Key conforming to the
+ // "container.image.id" semantic conventions. It represents the runtime
+ // specific image identifier. Usually a hash algorithm followed by a UUID.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // 'sha256:19c92d0a00d1b66d897bceaa7319bee0dd38a10a851c60bcec9474aa3f01e50f'
+ // Note: Docker defines a sha256 of the image id; `container.image.id`
+ // corresponds to the `Image` field from the Docker container inspect
+ // [API](https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect)
+ // endpoint.
+ // K8S defines a link to the container registry repository with digest
+ // `"imageID": "registry.azurecr.io
+ // /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"`.
+ // The ID is assigned by the container runtime and can vary in different
+ // environments. Consider using `oci.manifest.digest` if it is important to
+ // identify the same image in different environments/runtimes.
+ ContainerImageIDKey = attribute.Key("container.image.id")
+
+ // ContainerImageNameKey is the attribute Key conforming to the
+ // "container.image.name" semantic conventions. It represents the name of
+ // the image the container was built on.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'gcr.io/opentelemetry/operator'
+ ContainerImageNameKey = attribute.Key("container.image.name")
+
+ // ContainerImageRepoDigestsKey is the attribute Key conforming to the
+ // "container.image.repo_digests" semantic conventions. It represents the
+ // repo digests of the container image as provided by the container
+ // runtime.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // 'example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb',
+ // 'internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578'
+ // Note:
+ // [Docker](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect)
+ // and
+ // [CRI](https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238)
+ // report those under the `RepoDigests` field.
+ ContainerImageRepoDigestsKey = attribute.Key("container.image.repo_digests")
+
+ // ContainerImageTagsKey is the attribute Key conforming to the
+ // "container.image.tags" semantic conventions. It represents the container
+ // image tags. An example can be found in [Docker Image
+ // Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect).
+ // Should be only the `` section of the full name for example from
+ // `registry.example.com/my-org/my-image:`.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'v1.27.1', '3.5.7-0'
+ ContainerImageTagsKey = attribute.Key("container.image.tags")
+
+ // ContainerNameKey is the attribute Key conforming to the "container.name"
+ // semantic conventions. It represents the container name used by container
+ // runtime.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry-autoconf'
+ ContainerNameKey = attribute.Key("container.name")
+
+ // ContainerRuntimeKey is the attribute Key conforming to the
+ // "container.runtime" semantic conventions. It represents the container
+ // runtime managing this container.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'docker', 'containerd', 'rkt'
+ ContainerRuntimeKey = attribute.Key("container.runtime")
+)
+
+var (
+ // When tasks of the cgroup are in user mode (Linux). When all container processes are in user mode (Windows)
+ ContainerCPUStateUser = ContainerCPUStateKey.String("user")
+ // When CPU is used by the system (host OS)
+ ContainerCPUStateSystem = ContainerCPUStateKey.String("system")
+ // When tasks of the cgroup are in kernel mode (Linux). When all container processes are in kernel mode (Windows)
+ ContainerCPUStateKernel = ContainerCPUStateKey.String("kernel")
+)
+
+// ContainerCommand returns an attribute KeyValue conforming to the
+// "container.command" semantic conventions. It represents the command used to
+// run the container (i.e. the command name).
+func ContainerCommand(val string) attribute.KeyValue {
+ return ContainerCommandKey.String(val)
+}
+
+// ContainerCommandArgs returns an attribute KeyValue conforming to the
+// "container.command_args" semantic conventions. It represents the all the
+// command arguments (including the command/executable itself) run by the
+// container. [2]
+func ContainerCommandArgs(val ...string) attribute.KeyValue {
+ return ContainerCommandArgsKey.StringSlice(val)
+}
+
+// ContainerCommandLine returns an attribute KeyValue conforming to the
+// "container.command_line" semantic conventions. It represents the full
+// command run by the container as a single string representing the full
+// command. [2]
+func ContainerCommandLine(val string) attribute.KeyValue {
+ return ContainerCommandLineKey.String(val)
+}
+
+// ContainerID returns an attribute KeyValue conforming to the
+// "container.id" semantic conventions. It represents the container ID. Usually
+// a UUID, as for example used to [identify Docker
+// containers](https://docs.docker.com/engine/reference/run/#container-identification).
+// The UUID might be abbreviated.
+func ContainerID(val string) attribute.KeyValue {
+ return ContainerIDKey.String(val)
+}
+
+// ContainerImageID returns an attribute KeyValue conforming to the
+// "container.image.id" semantic conventions. It represents the runtime
+// specific image identifier. Usually a hash algorithm followed by a UUID.
+func ContainerImageID(val string) attribute.KeyValue {
+ return ContainerImageIDKey.String(val)
+}
+
+// ContainerImageName returns an attribute KeyValue conforming to the
+// "container.image.name" semantic conventions. It represents the name of the
+// image the container was built on.
+func ContainerImageName(val string) attribute.KeyValue {
+ return ContainerImageNameKey.String(val)
+}
+
+// ContainerImageRepoDigests returns an attribute KeyValue conforming to the
+// "container.image.repo_digests" semantic conventions. It represents the repo
+// digests of the container image as provided by the container runtime.
+func ContainerImageRepoDigests(val ...string) attribute.KeyValue {
+ return ContainerImageRepoDigestsKey.StringSlice(val)
+}
+
+// ContainerImageTags returns an attribute KeyValue conforming to the
+// "container.image.tags" semantic conventions. It represents the container
+// image tags. An example can be found in [Docker Image
+// Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect).
+// Should be only the `` section of the full name for example from
+// `registry.example.com/my-org/my-image:`.
+func ContainerImageTags(val ...string) attribute.KeyValue {
+ return ContainerImageTagsKey.StringSlice(val)
+}
+
+// ContainerName returns an attribute KeyValue conforming to the
+// "container.name" semantic conventions. It represents the container name used
+// by container runtime.
+func ContainerName(val string) attribute.KeyValue {
+ return ContainerNameKey.String(val)
+}
+
+// ContainerRuntime returns an attribute KeyValue conforming to the
+// "container.runtime" semantic conventions. It represents the container
+// runtime managing this container.
+func ContainerRuntime(val string) attribute.KeyValue {
+ return ContainerRuntimeKey.String(val)
+}
+
+// This group defines the attributes used to describe telemetry in the context
+// of databases.
+const (
+ // DBClientConnectionsPoolNameKey is the attribute Key conforming to the
+ // "db.client.connections.pool.name" semantic conventions. It represents
+ // the name of the connection pool; unique within the instrumented
+ // application. In case the connection pool implementation doesn't provide
+ // a name, instrumentation should use a combination of `server.address` and
+ // `server.port` attributes formatted as `server.address:server.port`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myDataSource'
+ DBClientConnectionsPoolNameKey = attribute.Key("db.client.connections.pool.name")
+
+ // DBClientConnectionsStateKey is the attribute Key conforming to the
+ // "db.client.connections.state" semantic conventions. It represents the
+ // state of a connection in the pool
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'idle'
+ DBClientConnectionsStateKey = attribute.Key("db.client.connections.state")
+
+ // DBCollectionNameKey is the attribute Key conforming to the
+ // "db.collection.name" semantic conventions. It represents the name of a
+ // collection (table, container) within the database.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'public.users', 'customers'
+ // Note: If the collection name is parsed from the query, it SHOULD match
+ // the value provided in the query and may be qualified with the schema and
+ // database name.
+ // It is RECOMMENDED to capture the value as provided by the application
+ // without attempting to do any case normalization.
+ DBCollectionNameKey = attribute.Key("db.collection.name")
+
+ // DBNamespaceKey is the attribute Key conforming to the "db.namespace"
+ // semantic conventions. It represents the name of the database, fully
+ // qualified within the server address and port.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'customers', 'test.users'
+ // Note: If a database system has multiple namespace components, they
+ // SHOULD be concatenated (potentially using database system specific
+ // conventions) from most general to most specific namespace component, and
+ // more specific namespaces SHOULD NOT be captured without the more general
+ // namespaces, to ensure that "startswith" queries for the more general
+ // namespaces will be valid.
+ // Semantic conventions for individual database systems SHOULD document
+ // what `db.namespace` means in the context of that system.
+ // It is RECOMMENDED to capture the value as provided by the application
+ // without attempting to do any case normalization.
+ DBNamespaceKey = attribute.Key("db.namespace")
+
+ // DBOperationNameKey is the attribute Key conforming to the
+ // "db.operation.name" semantic conventions. It represents the name of the
+ // operation or command being executed.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'findAndModify', 'HMSET', 'SELECT'
+ // Note: It is RECOMMENDED to capture the value as provided by the
+ // application without attempting to do any case normalization.
+ DBOperationNameKey = attribute.Key("db.operation.name")
+
+ // DBQueryTextKey is the attribute Key conforming to the "db.query.text"
+ // semantic conventions. It represents the database query being executed.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'SELECT * FROM wuser_table where username = ?', 'SET mykey
+ // "WuValue"'
+ DBQueryTextKey = attribute.Key("db.query.text")
+
+ // DBSystemKey is the attribute Key conforming to the "db.system" semantic
+ // conventions. It represents the database management system (DBMS) product
+ // as identified by the client instrumentation.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Note: The actual DBMS may differ from the one identified by the client.
+ // For example, when using PostgreSQL client libraries to connect to a
+ // CockroachDB, the `db.system` is set to `postgresql` based on the
+ // instrumentation's best knowledge.
+ DBSystemKey = attribute.Key("db.system")
+)
+
+var (
+ // idle
+ DBClientConnectionsStateIdle = DBClientConnectionsStateKey.String("idle")
+ // used
+ DBClientConnectionsStateUsed = DBClientConnectionsStateKey.String("used")
+)
+
+var (
+ // Some other SQL database. Fallback only. See notes
+ DBSystemOtherSQL = DBSystemKey.String("other_sql")
+ // Microsoft SQL Server
+ DBSystemMSSQL = DBSystemKey.String("mssql")
+ // Microsoft SQL Server Compact
+ DBSystemMssqlcompact = DBSystemKey.String("mssqlcompact")
+ // MySQL
+ DBSystemMySQL = DBSystemKey.String("mysql")
+ // Oracle Database
+ DBSystemOracle = DBSystemKey.String("oracle")
+ // IBM DB2
+ DBSystemDB2 = DBSystemKey.String("db2")
+ // PostgreSQL
+ DBSystemPostgreSQL = DBSystemKey.String("postgresql")
+ // Amazon Redshift
+ DBSystemRedshift = DBSystemKey.String("redshift")
+ // Apache Hive
+ DBSystemHive = DBSystemKey.String("hive")
+ // Cloudscape
+ DBSystemCloudscape = DBSystemKey.String("cloudscape")
+ // HyperSQL DataBase
+ DBSystemHSQLDB = DBSystemKey.String("hsqldb")
+ // Progress Database
+ DBSystemProgress = DBSystemKey.String("progress")
+ // SAP MaxDB
+ DBSystemMaxDB = DBSystemKey.String("maxdb")
+ // SAP HANA
+ DBSystemHanaDB = DBSystemKey.String("hanadb")
+ // Ingres
+ DBSystemIngres = DBSystemKey.String("ingres")
+ // FirstSQL
+ DBSystemFirstSQL = DBSystemKey.String("firstsql")
+ // EnterpriseDB
+ DBSystemEDB = DBSystemKey.String("edb")
+ // InterSystems Caché
+ DBSystemCache = DBSystemKey.String("cache")
+ // Adabas (Adaptable Database System)
+ DBSystemAdabas = DBSystemKey.String("adabas")
+ // Firebird
+ DBSystemFirebird = DBSystemKey.String("firebird")
+ // Apache Derby
+ DBSystemDerby = DBSystemKey.String("derby")
+ // FileMaker
+ DBSystemFilemaker = DBSystemKey.String("filemaker")
+ // Informix
+ DBSystemInformix = DBSystemKey.String("informix")
+ // InstantDB
+ DBSystemInstantDB = DBSystemKey.String("instantdb")
+ // InterBase
+ DBSystemInterbase = DBSystemKey.String("interbase")
+ // MariaDB
+ DBSystemMariaDB = DBSystemKey.String("mariadb")
+ // Netezza
+ DBSystemNetezza = DBSystemKey.String("netezza")
+ // Pervasive PSQL
+ DBSystemPervasive = DBSystemKey.String("pervasive")
+ // PointBase
+ DBSystemPointbase = DBSystemKey.String("pointbase")
+ // SQLite
+ DBSystemSqlite = DBSystemKey.String("sqlite")
+ // Sybase
+ DBSystemSybase = DBSystemKey.String("sybase")
+ // Teradata
+ DBSystemTeradata = DBSystemKey.String("teradata")
+ // Vertica
+ DBSystemVertica = DBSystemKey.String("vertica")
+ // H2
+ DBSystemH2 = DBSystemKey.String("h2")
+ // ColdFusion IMQ
+ DBSystemColdfusion = DBSystemKey.String("coldfusion")
+ // Apache Cassandra
+ DBSystemCassandra = DBSystemKey.String("cassandra")
+ // Apache HBase
+ DBSystemHBase = DBSystemKey.String("hbase")
+ // MongoDB
+ DBSystemMongoDB = DBSystemKey.String("mongodb")
+ // Redis
+ DBSystemRedis = DBSystemKey.String("redis")
+ // Couchbase
+ DBSystemCouchbase = DBSystemKey.String("couchbase")
+ // CouchDB
+ DBSystemCouchDB = DBSystemKey.String("couchdb")
+ // Microsoft Azure Cosmos DB
+ DBSystemCosmosDB = DBSystemKey.String("cosmosdb")
+ // Amazon DynamoDB
+ DBSystemDynamoDB = DBSystemKey.String("dynamodb")
+ // Neo4j
+ DBSystemNeo4j = DBSystemKey.String("neo4j")
+ // Apache Geode
+ DBSystemGeode = DBSystemKey.String("geode")
+ // Elasticsearch
+ DBSystemElasticsearch = DBSystemKey.String("elasticsearch")
+ // Memcached
+ DBSystemMemcached = DBSystemKey.String("memcached")
+ // CockroachDB
+ DBSystemCockroachdb = DBSystemKey.String("cockroachdb")
+ // OpenSearch
+ DBSystemOpensearch = DBSystemKey.String("opensearch")
+ // ClickHouse
+ DBSystemClickhouse = DBSystemKey.String("clickhouse")
+ // Cloud Spanner
+ DBSystemSpanner = DBSystemKey.String("spanner")
+ // Trino
+ DBSystemTrino = DBSystemKey.String("trino")
+)
+
+// DBClientConnectionsPoolName returns an attribute KeyValue conforming to
+// the "db.client.connections.pool.name" semantic conventions. It represents
+// the name of the connection pool; unique within the instrumented application.
+// In case the connection pool implementation doesn't provide a name,
+// instrumentation should use a combination of `server.address` and
+// `server.port` attributes formatted as `server.address:server.port`.
+func DBClientConnectionsPoolName(val string) attribute.KeyValue {
+ return DBClientConnectionsPoolNameKey.String(val)
+}
+
+// DBCollectionName returns an attribute KeyValue conforming to the
+// "db.collection.name" semantic conventions. It represents the name of a
+// collection (table, container) within the database.
+func DBCollectionName(val string) attribute.KeyValue {
+ return DBCollectionNameKey.String(val)
+}
+
+// DBNamespace returns an attribute KeyValue conforming to the
+// "db.namespace" semantic conventions. It represents the name of the database,
+// fully qualified within the server address and port.
+func DBNamespace(val string) attribute.KeyValue {
+ return DBNamespaceKey.String(val)
+}
+
+// DBOperationName returns an attribute KeyValue conforming to the
+// "db.operation.name" semantic conventions. It represents the name of the
+// operation or command being executed.
+func DBOperationName(val string) attribute.KeyValue {
+ return DBOperationNameKey.String(val)
+}
+
+// DBQueryText returns an attribute KeyValue conforming to the
+// "db.query.text" semantic conventions. It represents the database query being
+// executed.
+func DBQueryText(val string) attribute.KeyValue {
+ return DBQueryTextKey.String(val)
+}
+
+// This group defines attributes for Cassandra.
+const (
+ // DBCassandraConsistencyLevelKey is the attribute Key conforming to the
+ // "db.cassandra.consistency_level" semantic conventions. It represents the
+ // consistency level of the query. Based on consistency values from
+ // [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html).
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ DBCassandraConsistencyLevelKey = attribute.Key("db.cassandra.consistency_level")
+
+ // DBCassandraCoordinatorDCKey is the attribute Key conforming to the
+ // "db.cassandra.coordinator.dc" semantic conventions. It represents the
+ // data center of the coordinating node for a query.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'us-west-2'
+ DBCassandraCoordinatorDCKey = attribute.Key("db.cassandra.coordinator.dc")
+
+ // DBCassandraCoordinatorIDKey is the attribute Key conforming to the
+ // "db.cassandra.coordinator.id" semantic conventions. It represents the ID
+ // of the coordinating node for a query.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'be13faa2-8574-4d71-926d-27f16cf8a7af'
+ DBCassandraCoordinatorIDKey = attribute.Key("db.cassandra.coordinator.id")
+
+ // DBCassandraIdempotenceKey is the attribute Key conforming to the
+ // "db.cassandra.idempotence" semantic conventions. It represents the
+ // whether or not the query is idempotent.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ DBCassandraIdempotenceKey = attribute.Key("db.cassandra.idempotence")
+
+ // DBCassandraPageSizeKey is the attribute Key conforming to the
+ // "db.cassandra.page_size" semantic conventions. It represents the fetch
+ // size used for paging, i.e. how many rows will be returned at once.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 5000
+ DBCassandraPageSizeKey = attribute.Key("db.cassandra.page_size")
+
+ // DBCassandraSpeculativeExecutionCountKey is the attribute Key conforming
+ // to the "db.cassandra.speculative_execution_count" semantic conventions.
+ // It represents the number of times a query was speculatively executed.
+ // Not set or `0` if the query was not executed speculatively.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 0, 2
+ DBCassandraSpeculativeExecutionCountKey = attribute.Key("db.cassandra.speculative_execution_count")
+)
+
+var (
+ // all
+ DBCassandraConsistencyLevelAll = DBCassandraConsistencyLevelKey.String("all")
+ // each_quorum
+ DBCassandraConsistencyLevelEachQuorum = DBCassandraConsistencyLevelKey.String("each_quorum")
+ // quorum
+ DBCassandraConsistencyLevelQuorum = DBCassandraConsistencyLevelKey.String("quorum")
+ // local_quorum
+ DBCassandraConsistencyLevelLocalQuorum = DBCassandraConsistencyLevelKey.String("local_quorum")
+ // one
+ DBCassandraConsistencyLevelOne = DBCassandraConsistencyLevelKey.String("one")
+ // two
+ DBCassandraConsistencyLevelTwo = DBCassandraConsistencyLevelKey.String("two")
+ // three
+ DBCassandraConsistencyLevelThree = DBCassandraConsistencyLevelKey.String("three")
+ // local_one
+ DBCassandraConsistencyLevelLocalOne = DBCassandraConsistencyLevelKey.String("local_one")
+ // any
+ DBCassandraConsistencyLevelAny = DBCassandraConsistencyLevelKey.String("any")
+ // serial
+ DBCassandraConsistencyLevelSerial = DBCassandraConsistencyLevelKey.String("serial")
+ // local_serial
+ DBCassandraConsistencyLevelLocalSerial = DBCassandraConsistencyLevelKey.String("local_serial")
+)
+
+// DBCassandraCoordinatorDC returns an attribute KeyValue conforming to the
+// "db.cassandra.coordinator.dc" semantic conventions. It represents the data
+// center of the coordinating node for a query.
+func DBCassandraCoordinatorDC(val string) attribute.KeyValue {
+ return DBCassandraCoordinatorDCKey.String(val)
+}
+
+// DBCassandraCoordinatorID returns an attribute KeyValue conforming to the
+// "db.cassandra.coordinator.id" semantic conventions. It represents the ID of
+// the coordinating node for a query.
+func DBCassandraCoordinatorID(val string) attribute.KeyValue {
+ return DBCassandraCoordinatorIDKey.String(val)
+}
+
+// DBCassandraIdempotence returns an attribute KeyValue conforming to the
+// "db.cassandra.idempotence" semantic conventions. It represents the whether
+// or not the query is idempotent.
+func DBCassandraIdempotence(val bool) attribute.KeyValue {
+ return DBCassandraIdempotenceKey.Bool(val)
+}
+
+// DBCassandraPageSize returns an attribute KeyValue conforming to the
+// "db.cassandra.page_size" semantic conventions. It represents the fetch size
+// used for paging, i.e. how many rows will be returned at once.
+func DBCassandraPageSize(val int) attribute.KeyValue {
+ return DBCassandraPageSizeKey.Int(val)
+}
+
+// DBCassandraSpeculativeExecutionCount returns an attribute KeyValue
+// conforming to the "db.cassandra.speculative_execution_count" semantic
+// conventions. It represents the number of times a query was speculatively
+// executed. Not set or `0` if the query was not executed speculatively.
+func DBCassandraSpeculativeExecutionCount(val int) attribute.KeyValue {
+ return DBCassandraSpeculativeExecutionCountKey.Int(val)
+}
+
+// This group defines attributes for Azure Cosmos DB.
+const (
+ // DBCosmosDBClientIDKey is the attribute Key conforming to the
+ // "db.cosmosdb.client_id" semantic conventions. It represents the unique
+ // Cosmos client instance id.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '3ba4827d-4422-483f-b59f-85b74211c11d'
+ DBCosmosDBClientIDKey = attribute.Key("db.cosmosdb.client_id")
+
+ // DBCosmosDBConnectionModeKey is the attribute Key conforming to the
+ // "db.cosmosdb.connection_mode" semantic conventions. It represents the
+ // cosmos client connection mode.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ DBCosmosDBConnectionModeKey = attribute.Key("db.cosmosdb.connection_mode")
+
+ // DBCosmosDBOperationTypeKey is the attribute Key conforming to the
+ // "db.cosmosdb.operation_type" semantic conventions. It represents the
+ // cosmosDB Operation Type.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ DBCosmosDBOperationTypeKey = attribute.Key("db.cosmosdb.operation_type")
+
+ // DBCosmosDBRequestChargeKey is the attribute Key conforming to the
+ // "db.cosmosdb.request_charge" semantic conventions. It represents the rU
+ // consumed for that operation
+ //
+ // Type: double
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 46.18, 1.0
+ DBCosmosDBRequestChargeKey = attribute.Key("db.cosmosdb.request_charge")
+
+ // DBCosmosDBRequestContentLengthKey is the attribute Key conforming to the
+ // "db.cosmosdb.request_content_length" semantic conventions. It represents
+ // the request payload size in bytes
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ DBCosmosDBRequestContentLengthKey = attribute.Key("db.cosmosdb.request_content_length")
+
+ // DBCosmosDBStatusCodeKey is the attribute Key conforming to the
+ // "db.cosmosdb.status_code" semantic conventions. It represents the cosmos
+ // DB status code.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 200, 201
+ DBCosmosDBStatusCodeKey = attribute.Key("db.cosmosdb.status_code")
+
+ // DBCosmosDBSubStatusCodeKey is the attribute Key conforming to the
+ // "db.cosmosdb.sub_status_code" semantic conventions. It represents the
+ // cosmos DB sub status code.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1000, 1002
+ DBCosmosDBSubStatusCodeKey = attribute.Key("db.cosmosdb.sub_status_code")
+)
+
+var (
+ // Gateway (HTTP) connections mode
+ DBCosmosDBConnectionModeGateway = DBCosmosDBConnectionModeKey.String("gateway")
+ // Direct connection
+ DBCosmosDBConnectionModeDirect = DBCosmosDBConnectionModeKey.String("direct")
+)
+
+var (
+ // invalid
+ DBCosmosDBOperationTypeInvalid = DBCosmosDBOperationTypeKey.String("Invalid")
+ // create
+ DBCosmosDBOperationTypeCreate = DBCosmosDBOperationTypeKey.String("Create")
+ // patch
+ DBCosmosDBOperationTypePatch = DBCosmosDBOperationTypeKey.String("Patch")
+ // read
+ DBCosmosDBOperationTypeRead = DBCosmosDBOperationTypeKey.String("Read")
+ // read_feed
+ DBCosmosDBOperationTypeReadFeed = DBCosmosDBOperationTypeKey.String("ReadFeed")
+ // delete
+ DBCosmosDBOperationTypeDelete = DBCosmosDBOperationTypeKey.String("Delete")
+ // replace
+ DBCosmosDBOperationTypeReplace = DBCosmosDBOperationTypeKey.String("Replace")
+ // execute
+ DBCosmosDBOperationTypeExecute = DBCosmosDBOperationTypeKey.String("Execute")
+ // query
+ DBCosmosDBOperationTypeQuery = DBCosmosDBOperationTypeKey.String("Query")
+ // head
+ DBCosmosDBOperationTypeHead = DBCosmosDBOperationTypeKey.String("Head")
+ // head_feed
+ DBCosmosDBOperationTypeHeadFeed = DBCosmosDBOperationTypeKey.String("HeadFeed")
+ // upsert
+ DBCosmosDBOperationTypeUpsert = DBCosmosDBOperationTypeKey.String("Upsert")
+ // batch
+ DBCosmosDBOperationTypeBatch = DBCosmosDBOperationTypeKey.String("Batch")
+ // query_plan
+ DBCosmosDBOperationTypeQueryPlan = DBCosmosDBOperationTypeKey.String("QueryPlan")
+ // execute_javascript
+ DBCosmosDBOperationTypeExecuteJavascript = DBCosmosDBOperationTypeKey.String("ExecuteJavaScript")
+)
+
+// DBCosmosDBClientID returns an attribute KeyValue conforming to the
+// "db.cosmosdb.client_id" semantic conventions. It represents the unique
+// Cosmos client instance id.
+func DBCosmosDBClientID(val string) attribute.KeyValue {
+ return DBCosmosDBClientIDKey.String(val)
+}
+
+// DBCosmosDBRequestCharge returns an attribute KeyValue conforming to the
+// "db.cosmosdb.request_charge" semantic conventions. It represents the rU
+// consumed for that operation
+func DBCosmosDBRequestCharge(val float64) attribute.KeyValue {
+ return DBCosmosDBRequestChargeKey.Float64(val)
+}
+
+// DBCosmosDBRequestContentLength returns an attribute KeyValue conforming
+// to the "db.cosmosdb.request_content_length" semantic conventions. It
+// represents the request payload size in bytes
+func DBCosmosDBRequestContentLength(val int) attribute.KeyValue {
+ return DBCosmosDBRequestContentLengthKey.Int(val)
+}
+
+// DBCosmosDBStatusCode returns an attribute KeyValue conforming to the
+// "db.cosmosdb.status_code" semantic conventions. It represents the cosmos DB
+// status code.
+func DBCosmosDBStatusCode(val int) attribute.KeyValue {
+ return DBCosmosDBStatusCodeKey.Int(val)
+}
+
+// DBCosmosDBSubStatusCode returns an attribute KeyValue conforming to the
+// "db.cosmosdb.sub_status_code" semantic conventions. It represents the cosmos
+// DB sub status code.
+func DBCosmosDBSubStatusCode(val int) attribute.KeyValue {
+ return DBCosmosDBSubStatusCodeKey.Int(val)
+}
+
+// This group defines attributes for Elasticsearch.
+const (
+ // DBElasticsearchClusterNameKey is the attribute Key conforming to the
+ // "db.elasticsearch.cluster.name" semantic conventions. It represents the
+ // represents the identifier of an Elasticsearch cluster.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'e9106fc68e3044f0b1475b04bf4ffd5f'
+ DBElasticsearchClusterNameKey = attribute.Key("db.elasticsearch.cluster.name")
+
+ // DBElasticsearchNodeNameKey is the attribute Key conforming to the
+ // "db.elasticsearch.node.name" semantic conventions. It represents the
+ // represents the human-readable identifier of the node/instance to which a
+ // request was routed.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'instance-0000000001'
+ DBElasticsearchNodeNameKey = attribute.Key("db.elasticsearch.node.name")
+)
+
+// DBElasticsearchClusterName returns an attribute KeyValue conforming to
+// the "db.elasticsearch.cluster.name" semantic conventions. It represents the
+// represents the identifier of an Elasticsearch cluster.
+func DBElasticsearchClusterName(val string) attribute.KeyValue {
+ return DBElasticsearchClusterNameKey.String(val)
+}
+
+// DBElasticsearchNodeName returns an attribute KeyValue conforming to the
+// "db.elasticsearch.node.name" semantic conventions. It represents the
+// represents the human-readable identifier of the node/instance to which a
+// request was routed.
+func DBElasticsearchNodeName(val string) attribute.KeyValue {
+ return DBElasticsearchNodeNameKey.String(val)
+}
+
+// Attributes for software deployments.
+const (
+ // DeploymentEnvironmentKey is the attribute Key conforming to the
+ // "deployment.environment" semantic conventions. It represents the name of
+ // the [deployment
+ // environment](https://wikipedia.org/wiki/Deployment_environment) (aka
+ // deployment tier).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'staging', 'production'
+ // Note: `deployment.environment` does not affect the uniqueness
+ // constraints defined through
+ // the `service.namespace`, `service.name` and `service.instance.id`
+ // resource attributes.
+ // This implies that resources carrying the following attribute
+ // combinations MUST be
+ // considered to be identifying the same service:
+ //
+ // * `service.name=frontend`, `deployment.environment=production`
+ // * `service.name=frontend`, `deployment.environment=staging`.
+ DeploymentEnvironmentKey = attribute.Key("deployment.environment")
+)
+
+// DeploymentEnvironment returns an attribute KeyValue conforming to the
+// "deployment.environment" semantic conventions. It represents the name of the
+// [deployment environment](https://wikipedia.org/wiki/Deployment_environment)
+// (aka deployment tier).
+func DeploymentEnvironment(val string) attribute.KeyValue {
+ return DeploymentEnvironmentKey.String(val)
+}
+
+// Attributes that represents an occurrence of a lifecycle transition on the
+// Android platform.
+const (
+ // AndroidStateKey is the attribute Key conforming to the "android.state"
+ // semantic conventions. It represents the deprecated use the
+ // `device.app.lifecycle` event definition including `android.state` as a
+ // payload field instead.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Note: The Android lifecycle states are defined in [Activity lifecycle
+ // callbacks](https://developer.android.com/guide/components/activities/activity-lifecycle#lc),
+ // and from which the `OS identifiers` are derived.
+ AndroidStateKey = attribute.Key("android.state")
+)
+
+var (
+ // Any time before Activity.onResume() or, if the app has no Activity, Context.startService() has been called in the app for the first time
+ AndroidStateCreated = AndroidStateKey.String("created")
+ // Any time after Activity.onPause() or, if the app has no Activity, Context.stopService() has been called when the app was in the foreground state
+ AndroidStateBackground = AndroidStateKey.String("background")
+ // Any time after Activity.onResume() or, if the app has no Activity, Context.startService() has been called when the app was in either the created or background states
+ AndroidStateForeground = AndroidStateKey.String("foreground")
+)
+
+// These attributes may be used to describe the receiver of a network
+// exchange/packet. These should be used when there is no client/server
+// relationship between the two sides, or when that relationship is unknown.
+// This covers low-level network interactions (e.g. packet tracing) where you
+// don't know if there was a connection or which side initiated it. This also
+// covers unidirectional UDP flows and peer-to-peer communication where the
+// "user-facing" surface of the protocol / API doesn't expose a clear notion of
+// client and server.
+const (
+ // DestinationAddressKey is the attribute Key conforming to the
+ // "destination.address" semantic conventions. It represents the
+ // destination address - domain name if available without reverse DNS
+ // lookup; otherwise, IP address or Unix domain socket name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'destination.example.com', '10.1.2.80', '/tmp/my.sock'
+ // Note: When observed from the source side, and when communicating through
+ // an intermediary, `destination.address` SHOULD represent the destination
+ // address behind any intermediaries, for example proxies, if it's
+ // available.
+ DestinationAddressKey = attribute.Key("destination.address")
+
+ // DestinationPortKey is the attribute Key conforming to the
+ // "destination.port" semantic conventions. It represents the destination
+ // port number
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 3389, 2888
+ DestinationPortKey = attribute.Key("destination.port")
+)
+
+// DestinationAddress returns an attribute KeyValue conforming to the
+// "destination.address" semantic conventions. It represents the destination
+// address - domain name if available without reverse DNS lookup; otherwise, IP
+// address or Unix domain socket name.
+func DestinationAddress(val string) attribute.KeyValue {
+ return DestinationAddressKey.String(val)
+}
+
+// DestinationPort returns an attribute KeyValue conforming to the
+// "destination.port" semantic conventions. It represents the destination port
+// number
+func DestinationPort(val int) attribute.KeyValue {
+ return DestinationPortKey.Int(val)
+}
+
+// Describes device attributes.
+const (
+ // DeviceIDKey is the attribute Key conforming to the "device.id" semantic
+ // conventions. It represents a unique identifier representing the device
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2ab2916d-a51f-4ac8-80ee-45ac31a28092'
+ // Note: The device identifier MUST only be defined using the values
+ // outlined below. This value is not an advertising identifier and MUST NOT
+ // be used as such. On iOS (Swift or Objective-C), this value MUST be equal
+ // to the [vendor
+ // identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor).
+ // On Android (Java or Kotlin), this value MUST be equal to the Firebase
+ // Installation ID or a globally unique UUID which is persisted across
+ // sessions in your application. More information can be found
+ // [here](https://developer.android.com/training/articles/user-data-ids) on
+ // best practices and exact implementation details. Caution should be taken
+ // when storing personal data or anything which can identify a user. GDPR
+ // and data protection laws may apply, ensure you do your own due
+ // diligence.
+ DeviceIDKey = attribute.Key("device.id")
+
+ // DeviceManufacturerKey is the attribute Key conforming to the
+ // "device.manufacturer" semantic conventions. It represents the name of
+ // the device manufacturer
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Apple', 'Samsung'
+ // Note: The Android OS provides this field via
+ // [Build](https://developer.android.com/reference/android/os/Build#MANUFACTURER).
+ // iOS apps SHOULD hardcode the value `Apple`.
+ DeviceManufacturerKey = attribute.Key("device.manufacturer")
+
+ // DeviceModelIdentifierKey is the attribute Key conforming to the
+ // "device.model.identifier" semantic conventions. It represents the model
+ // identifier for the device
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'iPhone3,4', 'SM-G920F'
+ // Note: It's recommended this value represents a machine-readable version
+ // of the model identifier rather than the market or consumer-friendly name
+ // of the device.
+ DeviceModelIdentifierKey = attribute.Key("device.model.identifier")
+
+ // DeviceModelNameKey is the attribute Key conforming to the
+ // "device.model.name" semantic conventions. It represents the marketing
+ // name for the device model
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'iPhone 6s Plus', 'Samsung Galaxy S6'
+ // Note: It's recommended this value represents a human-readable version of
+ // the device model rather than a machine-readable alternative.
+ DeviceModelNameKey = attribute.Key("device.model.name")
+)
+
+// DeviceID returns an attribute KeyValue conforming to the "device.id"
+// semantic conventions. It represents a unique identifier representing the
+// device
+func DeviceID(val string) attribute.KeyValue {
+ return DeviceIDKey.String(val)
+}
+
+// DeviceManufacturer returns an attribute KeyValue conforming to the
+// "device.manufacturer" semantic conventions. It represents the name of the
+// device manufacturer
+func DeviceManufacturer(val string) attribute.KeyValue {
+ return DeviceManufacturerKey.String(val)
+}
+
+// DeviceModelIdentifier returns an attribute KeyValue conforming to the
+// "device.model.identifier" semantic conventions. It represents the model
+// identifier for the device
+func DeviceModelIdentifier(val string) attribute.KeyValue {
+ return DeviceModelIdentifierKey.String(val)
+}
+
+// DeviceModelName returns an attribute KeyValue conforming to the
+// "device.model.name" semantic conventions. It represents the marketing name
+// for the device model
+func DeviceModelName(val string) attribute.KeyValue {
+ return DeviceModelNameKey.String(val)
+}
+
+// These attributes may be used for any disk related operation.
+const (
+ // DiskIoDirectionKey is the attribute Key conforming to the
+ // "disk.io.direction" semantic conventions. It represents the disk IO
+ // operation direction.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'read'
+ DiskIoDirectionKey = attribute.Key("disk.io.direction")
+)
+
+var (
+ // read
+ DiskIoDirectionRead = DiskIoDirectionKey.String("read")
+ // write
+ DiskIoDirectionWrite = DiskIoDirectionKey.String("write")
+)
+
+// The shared attributes used to report a DNS query.
+const (
+ // DNSQuestionNameKey is the attribute Key conforming to the
+ // "dns.question.name" semantic conventions. It represents the name being
+ // queried.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'www.example.com', 'opentelemetry.io'
+ // Note: If the name field contains non-printable characters (below 32 or
+ // above 126), those characters should be represented as escaped base 10
+ // integers (\DDD). Back slashes and quotes should be escaped. Tabs,
+ // carriage returns, and line feeds should be converted to \t, \r, and \n
+ // respectively.
+ DNSQuestionNameKey = attribute.Key("dns.question.name")
+)
+
+// DNSQuestionName returns an attribute KeyValue conforming to the
+// "dns.question.name" semantic conventions. It represents the name being
+// queried.
+func DNSQuestionName(val string) attribute.KeyValue {
+ return DNSQuestionNameKey.String(val)
+}
+
+// Attributes for operations with an authenticated and/or authorized enduser.
+const (
+ // EnduserIDKey is the attribute Key conforming to the "enduser.id"
+ // semantic conventions. It represents the username or client_id extracted
+ // from the access token or
+ // [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header
+ // in the inbound request from outside the system.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'username'
+ EnduserIDKey = attribute.Key("enduser.id")
+
+ // EnduserRoleKey is the attribute Key conforming to the "enduser.role"
+ // semantic conventions. It represents the actual/assumed role the client
+ // is making the request under extracted from token or application security
+ // context.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'admin'
+ EnduserRoleKey = attribute.Key("enduser.role")
+
+ // EnduserScopeKey is the attribute Key conforming to the "enduser.scope"
+ // semantic conventions. It represents the scopes or granted authorities
+ // the client currently possesses extracted from token or application
+ // security context. The value would come from the scope associated with an
+ // [OAuth 2.0 Access
+ // Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute
+ // value in a [SAML 2.0
+ // Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'read:message, write:files'
+ EnduserScopeKey = attribute.Key("enduser.scope")
+)
+
+// EnduserID returns an attribute KeyValue conforming to the "enduser.id"
+// semantic conventions. It represents the username or client_id extracted from
+// the access token or
+// [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in
+// the inbound request from outside the system.
+func EnduserID(val string) attribute.KeyValue {
+ return EnduserIDKey.String(val)
+}
+
+// EnduserRole returns an attribute KeyValue conforming to the
+// "enduser.role" semantic conventions. It represents the actual/assumed role
+// the client is making the request under extracted from token or application
+// security context.
+func EnduserRole(val string) attribute.KeyValue {
+ return EnduserRoleKey.String(val)
+}
+
+// EnduserScope returns an attribute KeyValue conforming to the
+// "enduser.scope" semantic conventions. It represents the scopes or granted
+// authorities the client currently possesses extracted from token or
+// application security context. The value would come from the scope associated
+// with an [OAuth 2.0 Access
+// Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute
+// value in a [SAML 2.0
+// Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html).
+func EnduserScope(val string) attribute.KeyValue {
+ return EnduserScopeKey.String(val)
+}
+
+// The shared attributes used to report an error.
+const (
+ // ErrorTypeKey is the attribute Key conforming to the "error.type"
+ // semantic conventions. It represents the describes a class of error the
+ // operation ended with.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'timeout', 'java.net.UnknownHostException',
+ // 'server_certificate_invalid', '500'
+ // Note: The `error.type` SHOULD be predictable, and SHOULD have low
+ // cardinality.
+ //
+ // When `error.type` is set to a type (e.g., an exception type), its
+ // canonical class name identifying the type within the artifact SHOULD be
+ // used.
+ //
+ // Instrumentations SHOULD document the list of errors they report.
+ //
+ // The cardinality of `error.type` within one instrumentation library
+ // SHOULD be low.
+ // Telemetry consumers that aggregate data from multiple instrumentation
+ // libraries and applications
+ // should be prepared for `error.type` to have high cardinality at query
+ // time when no
+ // additional filters are applied.
+ //
+ // If the operation has completed successfully, instrumentations SHOULD NOT
+ // set `error.type`.
+ //
+ // If a specific domain defines its own set of error identifiers (such as
+ // HTTP or gRPC status codes),
+ // it's RECOMMENDED to:
+ //
+ // * Use a domain-specific attribute
+ // * Set `error.type` to capture all errors, regardless of whether they are
+ // defined within the domain-specific set or not.
+ ErrorTypeKey = attribute.Key("error.type")
+)
+
+var (
+ // A fallback error value to be used when the instrumentation doesn't define a custom value
+ ErrorTypeOther = ErrorTypeKey.String("_OTHER")
+)
+
+// Attributes for Events represented using Log Records.
+const (
+ // EventNameKey is the attribute Key conforming to the "event.name"
+ // semantic conventions. It represents the identifies the class / type of
+ // event.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'browser.mouse.click', 'device.app.lifecycle'
+ // Note: Event names are subject to the same rules as [attribute
+ // names](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.33.0/specification/common/attribute-naming.md).
+ // Notably, event names are namespaced to avoid collisions and provide a
+ // clean separation of semantics for events in separate domains like
+ // browser, mobile, and kubernetes.
+ EventNameKey = attribute.Key("event.name")
+)
+
+// EventName returns an attribute KeyValue conforming to the "event.name"
+// semantic conventions. It represents the identifies the class / type of
+// event.
+func EventName(val string) attribute.KeyValue {
+ return EventNameKey.String(val)
+}
+
+// The shared attributes used to report a single exception associated with a
+// span or log.
+const (
+ // ExceptionEscapedKey is the attribute Key conforming to the
+ // "exception.escaped" semantic conventions. It represents the sHOULD be
+ // set to true if the exception event is recorded at a point where it is
+ // known that the exception is escaping the scope of the span.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Note: An exception is considered to have escaped (or left) the scope of
+ // a span,
+ // if that span is ended while the exception is still logically "in
+ // flight".
+ // This may be actually "in flight" in some languages (e.g. if the
+ // exception
+ // is passed to a Context manager's `__exit__` method in Python) but will
+ // usually be caught at the point of recording the exception in most
+ // languages.
+ //
+ // It is usually not possible to determine at the point where an exception
+ // is thrown
+ // whether it will escape the scope of a span.
+ // However, it is trivial to know that an exception
+ // will escape, if one checks for an active exception just before ending
+ // the span,
+ // as done in the [example for recording span
+ // exceptions](https://opentelemetry.io/docs/specs/semconv/exceptions/exceptions-spans/#recording-an-exception).
+ //
+ // It follows that an exception may still escape the scope of the span
+ // even if the `exception.escaped` attribute was not set or set to false,
+ // since the event might have been recorded at a time where it was not
+ // clear whether the exception will escape.
+ ExceptionEscapedKey = attribute.Key("exception.escaped")
+
+ // ExceptionMessageKey is the attribute Key conforming to the
+ // "exception.message" semantic conventions. It represents the exception
+ // message.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'Division by zero', "Can't convert 'int' object to str
+ // implicitly"
+ ExceptionMessageKey = attribute.Key("exception.message")
+
+ // ExceptionStacktraceKey is the attribute Key conforming to the
+ // "exception.stacktrace" semantic conventions. It represents a stacktrace
+ // as a string in the natural representation for the language runtime. The
+ // representation is to be determined and documented by each language SIG.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'Exception in thread "main" java.lang.RuntimeException: Test
+ // exception\\n at '
+ // 'com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\n at '
+ // 'com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\n at '
+ // 'com.example.GenerateTrace.main(GenerateTrace.java:5)'
+ ExceptionStacktraceKey = attribute.Key("exception.stacktrace")
+
+ // ExceptionTypeKey is the attribute Key conforming to the "exception.type"
+ // semantic conventions. It represents the type of the exception (its
+ // fully-qualified class name, if applicable). The dynamic type of the
+ // exception should be preferred over the static type in languages that
+ // support it.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'java.net.ConnectException', 'OSError'
+ ExceptionTypeKey = attribute.Key("exception.type")
+)
+
+// ExceptionEscaped returns an attribute KeyValue conforming to the
+// "exception.escaped" semantic conventions. It represents the sHOULD be set to
+// true if the exception event is recorded at a point where it is known that
+// the exception is escaping the scope of the span.
+func ExceptionEscaped(val bool) attribute.KeyValue {
+ return ExceptionEscapedKey.Bool(val)
+}
+
+// ExceptionMessage returns an attribute KeyValue conforming to the
+// "exception.message" semantic conventions. It represents the exception
+// message.
+func ExceptionMessage(val string) attribute.KeyValue {
+ return ExceptionMessageKey.String(val)
+}
+
+// ExceptionStacktrace returns an attribute KeyValue conforming to the
+// "exception.stacktrace" semantic conventions. It represents a stacktrace as a
+// string in the natural representation for the language runtime. The
+// representation is to be determined and documented by each language SIG.
+func ExceptionStacktrace(val string) attribute.KeyValue {
+ return ExceptionStacktraceKey.String(val)
+}
+
+// ExceptionType returns an attribute KeyValue conforming to the
+// "exception.type" semantic conventions. It represents the type of the
+// exception (its fully-qualified class name, if applicable). The dynamic type
+// of the exception should be preferred over the static type in languages that
+// support it.
+func ExceptionType(val string) attribute.KeyValue {
+ return ExceptionTypeKey.String(val)
+}
+
+// FaaS attributes
+const (
+ // FaaSColdstartKey is the attribute Key conforming to the "faas.coldstart"
+ // semantic conventions. It represents a boolean that is true if the
+ // serverless function is executed for the first time (aka cold-start).
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ FaaSColdstartKey = attribute.Key("faas.coldstart")
+
+ // FaaSCronKey is the attribute Key conforming to the "faas.cron" semantic
+ // conventions. It represents a string containing the schedule period as
+ // [Cron
+ // Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '0/5 * * * ? *'
+ FaaSCronKey = attribute.Key("faas.cron")
+
+ // FaaSDocumentCollectionKey is the attribute Key conforming to the
+ // "faas.document.collection" semantic conventions. It represents the name
+ // of the source on which the triggering operation was performed. For
+ // example, in Cloud Storage or S3 corresponds to the bucket name, and in
+ // Cosmos DB to the database name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myBucketName', 'myDBName'
+ FaaSDocumentCollectionKey = attribute.Key("faas.document.collection")
+
+ // FaaSDocumentNameKey is the attribute Key conforming to the
+ // "faas.document.name" semantic conventions. It represents the document
+ // name/table subjected to the operation. For example, in Cloud Storage or
+ // S3 is the name of the file, and in Cosmos DB the table name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myFile.txt', 'myTableName'
+ FaaSDocumentNameKey = attribute.Key("faas.document.name")
+
+ // FaaSDocumentOperationKey is the attribute Key conforming to the
+ // "faas.document.operation" semantic conventions. It represents the
+ // describes the type of the operation that was performed on the data.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ FaaSDocumentOperationKey = attribute.Key("faas.document.operation")
+
+ // FaaSDocumentTimeKey is the attribute Key conforming to the
+ // "faas.document.time" semantic conventions. It represents a string
+ // containing the time when the data was accessed in the [ISO
+ // 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format
+ // expressed in [UTC](https://www.w3.org/TR/NOTE-datetime).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2020-01-23T13:47:06Z'
+ FaaSDocumentTimeKey = attribute.Key("faas.document.time")
+
+ // FaaSInstanceKey is the attribute Key conforming to the "faas.instance"
+ // semantic conventions. It represents the execution environment ID as a
+ // string, that will be potentially reused for other invocations to the
+ // same function/function version.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309de'
+ // Note: * **AWS Lambda:** Use the (full) log stream name.
+ FaaSInstanceKey = attribute.Key("faas.instance")
+
+ // FaaSInvocationIDKey is the attribute Key conforming to the
+ // "faas.invocation_id" semantic conventions. It represents the invocation
+ // ID of the current function invocation.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'af9d5aa4-a685-4c5f-a22b-444f80b3cc28'
+ FaaSInvocationIDKey = attribute.Key("faas.invocation_id")
+
+ // FaaSInvokedNameKey is the attribute Key conforming to the
+ // "faas.invoked_name" semantic conventions. It represents the name of the
+ // invoked function.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'my-function'
+ // Note: SHOULD be equal to the `faas.name` resource attribute of the
+ // invoked function.
+ FaaSInvokedNameKey = attribute.Key("faas.invoked_name")
+
+ // FaaSInvokedProviderKey is the attribute Key conforming to the
+ // "faas.invoked_provider" semantic conventions. It represents the cloud
+ // provider of the invoked function.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Note: SHOULD be equal to the `cloud.provider` resource attribute of the
+ // invoked function.
+ FaaSInvokedProviderKey = attribute.Key("faas.invoked_provider")
+
+ // FaaSInvokedRegionKey is the attribute Key conforming to the
+ // "faas.invoked_region" semantic conventions. It represents the cloud
+ // region of the invoked function.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'eu-central-1'
+ // Note: SHOULD be equal to the `cloud.region` resource attribute of the
+ // invoked function.
+ FaaSInvokedRegionKey = attribute.Key("faas.invoked_region")
+
+ // FaaSMaxMemoryKey is the attribute Key conforming to the
+ // "faas.max_memory" semantic conventions. It represents the amount of
+ // memory available to the serverless function converted to Bytes.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 134217728
+ // Note: It's recommended to set this attribute since e.g. too little
+ // memory can easily stop a Java AWS Lambda function from working
+ // correctly. On AWS Lambda, the environment variable
+ // `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information (which must
+ // be multiplied by 1,048,576).
+ FaaSMaxMemoryKey = attribute.Key("faas.max_memory")
+
+ // FaaSNameKey is the attribute Key conforming to the "faas.name" semantic
+ // conventions. It represents the name of the single function that this
+ // runtime instance executes.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'my-function', 'myazurefunctionapp/some-function-name'
+ // Note: This is the name of the function as configured/deployed on the
+ // FaaS
+ // platform and is usually different from the name of the callback
+ // function (which may be stored in the
+ // [`code.namespace`/`code.function`](/docs/general/attributes.md#source-code-attributes)
+ // span attributes).
+ //
+ // For some cloud providers, the above definition is ambiguous. The
+ // following
+ // definition of function name MUST be used for this attribute
+ // (and consequently the span name) for the listed cloud
+ // providers/products:
+ //
+ // * **Azure:** The full name `/`, i.e., function app name
+ // followed by a forward slash followed by the function name (this form
+ // can also be seen in the resource JSON for the function).
+ // This means that a span attribute MUST be used, as an Azure function
+ // app can host multiple functions that would usually share
+ // a TracerProvider (see also the `cloud.resource_id` attribute).
+ FaaSNameKey = attribute.Key("faas.name")
+
+ // FaaSTimeKey is the attribute Key conforming to the "faas.time" semantic
+ // conventions. It represents a string containing the function invocation
+ // time in the [ISO
+ // 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format
+ // expressed in [UTC](https://www.w3.org/TR/NOTE-datetime).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2020-01-23T13:47:06Z'
+ FaaSTimeKey = attribute.Key("faas.time")
+
+ // FaaSTriggerKey is the attribute Key conforming to the "faas.trigger"
+ // semantic conventions. It represents the type of the trigger which caused
+ // this function invocation.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ FaaSTriggerKey = attribute.Key("faas.trigger")
+
+ // FaaSVersionKey is the attribute Key conforming to the "faas.version"
+ // semantic conventions. It represents the immutable version of the
+ // function being executed.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '26', 'pinkfroid-00002'
+ // Note: Depending on the cloud provider and platform, use:
+ //
+ // * **AWS Lambda:** The [function
+ // version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html)
+ // (an integer represented as a decimal string).
+ // * **Google Cloud Run (Services):** The
+ // [revision](https://cloud.google.com/run/docs/managing/revisions)
+ // (i.e., the function name plus the revision suffix).
+ // * **Google Cloud Functions:** The value of the
+ // [`K_REVISION` environment
+ // variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically).
+ // * **Azure Functions:** Not applicable. Do not set this attribute.
+ FaaSVersionKey = attribute.Key("faas.version")
+)
+
+var (
+ // When a new object is created
+ FaaSDocumentOperationInsert = FaaSDocumentOperationKey.String("insert")
+ // When an object is modified
+ FaaSDocumentOperationEdit = FaaSDocumentOperationKey.String("edit")
+ // When an object is deleted
+ FaaSDocumentOperationDelete = FaaSDocumentOperationKey.String("delete")
+)
+
+var (
+ // Alibaba Cloud
+ FaaSInvokedProviderAlibabaCloud = FaaSInvokedProviderKey.String("alibaba_cloud")
+ // Amazon Web Services
+ FaaSInvokedProviderAWS = FaaSInvokedProviderKey.String("aws")
+ // Microsoft Azure
+ FaaSInvokedProviderAzure = FaaSInvokedProviderKey.String("azure")
+ // Google Cloud Platform
+ FaaSInvokedProviderGCP = FaaSInvokedProviderKey.String("gcp")
+ // Tencent Cloud
+ FaaSInvokedProviderTencentCloud = FaaSInvokedProviderKey.String("tencent_cloud")
+)
+
+var (
+ // A response to some data source operation such as a database or filesystem read/write
+ FaaSTriggerDatasource = FaaSTriggerKey.String("datasource")
+ // To provide an answer to an inbound HTTP request
+ FaaSTriggerHTTP = FaaSTriggerKey.String("http")
+ // A function is set to be executed when messages are sent to a messaging system
+ FaaSTriggerPubsub = FaaSTriggerKey.String("pubsub")
+ // A function is scheduled to be executed regularly
+ FaaSTriggerTimer = FaaSTriggerKey.String("timer")
+ // If none of the others apply
+ FaaSTriggerOther = FaaSTriggerKey.String("other")
+)
+
+// FaaSColdstart returns an attribute KeyValue conforming to the
+// "faas.coldstart" semantic conventions. It represents a boolean that is true
+// if the serverless function is executed for the first time (aka cold-start).
+func FaaSColdstart(val bool) attribute.KeyValue {
+ return FaaSColdstartKey.Bool(val)
+}
+
+// FaaSCron returns an attribute KeyValue conforming to the "faas.cron"
+// semantic conventions. It represents a string containing the schedule period
+// as [Cron
+// Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm).
+func FaaSCron(val string) attribute.KeyValue {
+ return FaaSCronKey.String(val)
+}
+
+// FaaSDocumentCollection returns an attribute KeyValue conforming to the
+// "faas.document.collection" semantic conventions. It represents the name of
+// the source on which the triggering operation was performed. For example, in
+// Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the
+// database name.
+func FaaSDocumentCollection(val string) attribute.KeyValue {
+ return FaaSDocumentCollectionKey.String(val)
+}
+
+// FaaSDocumentName returns an attribute KeyValue conforming to the
+// "faas.document.name" semantic conventions. It represents the document
+// name/table subjected to the operation. For example, in Cloud Storage or S3
+// is the name of the file, and in Cosmos DB the table name.
+func FaaSDocumentName(val string) attribute.KeyValue {
+ return FaaSDocumentNameKey.String(val)
+}
+
+// FaaSDocumentTime returns an attribute KeyValue conforming to the
+// "faas.document.time" semantic conventions. It represents a string containing
+// the time when the data was accessed in the [ISO
+// 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format
+// expressed in [UTC](https://www.w3.org/TR/NOTE-datetime).
+func FaaSDocumentTime(val string) attribute.KeyValue {
+ return FaaSDocumentTimeKey.String(val)
+}
+
+// FaaSInstance returns an attribute KeyValue conforming to the
+// "faas.instance" semantic conventions. It represents the execution
+// environment ID as a string, that will be potentially reused for other
+// invocations to the same function/function version.
+func FaaSInstance(val string) attribute.KeyValue {
+ return FaaSInstanceKey.String(val)
+}
+
+// FaaSInvocationID returns an attribute KeyValue conforming to the
+// "faas.invocation_id" semantic conventions. It represents the invocation ID
+// of the current function invocation.
+func FaaSInvocationID(val string) attribute.KeyValue {
+ return FaaSInvocationIDKey.String(val)
+}
+
+// FaaSInvokedName returns an attribute KeyValue conforming to the
+// "faas.invoked_name" semantic conventions. It represents the name of the
+// invoked function.
+func FaaSInvokedName(val string) attribute.KeyValue {
+ return FaaSInvokedNameKey.String(val)
+}
+
+// FaaSInvokedRegion returns an attribute KeyValue conforming to the
+// "faas.invoked_region" semantic conventions. It represents the cloud region
+// of the invoked function.
+func FaaSInvokedRegion(val string) attribute.KeyValue {
+ return FaaSInvokedRegionKey.String(val)
+}
+
+// FaaSMaxMemory returns an attribute KeyValue conforming to the
+// "faas.max_memory" semantic conventions. It represents the amount of memory
+// available to the serverless function converted to Bytes.
+func FaaSMaxMemory(val int) attribute.KeyValue {
+ return FaaSMaxMemoryKey.Int(val)
+}
+
+// FaaSName returns an attribute KeyValue conforming to the "faas.name"
+// semantic conventions. It represents the name of the single function that
+// this runtime instance executes.
+func FaaSName(val string) attribute.KeyValue {
+ return FaaSNameKey.String(val)
+}
+
+// FaaSTime returns an attribute KeyValue conforming to the "faas.time"
+// semantic conventions. It represents a string containing the function
+// invocation time in the [ISO
+// 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format
+// expressed in [UTC](https://www.w3.org/TR/NOTE-datetime).
+func FaaSTime(val string) attribute.KeyValue {
+ return FaaSTimeKey.String(val)
+}
+
+// FaaSVersion returns an attribute KeyValue conforming to the
+// "faas.version" semantic conventions. It represents the immutable version of
+// the function being executed.
+func FaaSVersion(val string) attribute.KeyValue {
+ return FaaSVersionKey.String(val)
+}
+
+// Attributes for Feature Flags.
+const (
+ // FeatureFlagKeyKey is the attribute Key conforming to the
+ // "feature_flag.key" semantic conventions. It represents the unique
+ // identifier of the feature flag.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'logo-color'
+ FeatureFlagKeyKey = attribute.Key("feature_flag.key")
+
+ // FeatureFlagProviderNameKey is the attribute Key conforming to the
+ // "feature_flag.provider_name" semantic conventions. It represents the
+ // name of the service provider that performs the flag evaluation.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Flag Manager'
+ FeatureFlagProviderNameKey = attribute.Key("feature_flag.provider_name")
+
+ // FeatureFlagVariantKey is the attribute Key conforming to the
+ // "feature_flag.variant" semantic conventions. It represents the sHOULD be
+ // a semantic identifier for a value. If one is unavailable, a stringified
+ // version of the value can be used.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'red', 'true', 'on'
+ // Note: A semantic identifier, commonly referred to as a variant, provides
+ // a means
+ // for referring to a value without including the value itself. This can
+ // provide additional context for understanding the meaning behind a value.
+ // For example, the variant `red` maybe be used for the value `#c05543`.
+ //
+ // A stringified version of the value can be used in situations where a
+ // semantic identifier is unavailable. String representation of the value
+ // should be determined by the implementer.
+ FeatureFlagVariantKey = attribute.Key("feature_flag.variant")
+)
+
+// FeatureFlagKey returns an attribute KeyValue conforming to the
+// "feature_flag.key" semantic conventions. It represents the unique identifier
+// of the feature flag.
+func FeatureFlagKey(val string) attribute.KeyValue {
+ return FeatureFlagKeyKey.String(val)
+}
+
+// FeatureFlagProviderName returns an attribute KeyValue conforming to the
+// "feature_flag.provider_name" semantic conventions. It represents the name of
+// the service provider that performs the flag evaluation.
+func FeatureFlagProviderName(val string) attribute.KeyValue {
+ return FeatureFlagProviderNameKey.String(val)
+}
+
+// FeatureFlagVariant returns an attribute KeyValue conforming to the
+// "feature_flag.variant" semantic conventions. It represents the sHOULD be a
+// semantic identifier for a value. If one is unavailable, a stringified
+// version of the value can be used.
+func FeatureFlagVariant(val string) attribute.KeyValue {
+ return FeatureFlagVariantKey.String(val)
+}
+
+// Describes file attributes.
+const (
+ // FileDirectoryKey is the attribute Key conforming to the "file.directory"
+ // semantic conventions. It represents the directory where the file is
+ // located. It should include the drive letter, when appropriate.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/home/user', 'C:\\Program Files\\MyApp'
+ FileDirectoryKey = attribute.Key("file.directory")
+
+ // FileExtensionKey is the attribute Key conforming to the "file.extension"
+ // semantic conventions. It represents the file extension, excluding the
+ // leading dot.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'png', 'gz'
+ // Note: When the file name has multiple extensions (example.tar.gz), only
+ // the last one should be captured ("gz", not "tar.gz").
+ FileExtensionKey = attribute.Key("file.extension")
+
+ // FileNameKey is the attribute Key conforming to the "file.name" semantic
+ // conventions. It represents the name of the file including the extension,
+ // without the directory.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'example.png'
+ FileNameKey = attribute.Key("file.name")
+
+ // FilePathKey is the attribute Key conforming to the "file.path" semantic
+ // conventions. It represents the full path to the file, including the file
+ // name. It should include the drive letter, when appropriate.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/home/alice/example.png', 'C:\\Program
+ // Files\\MyApp\\myapp.exe'
+ FilePathKey = attribute.Key("file.path")
+
+ // FileSizeKey is the attribute Key conforming to the "file.size" semantic
+ // conventions. It represents the file size in bytes.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ FileSizeKey = attribute.Key("file.size")
+)
+
+// FileDirectory returns an attribute KeyValue conforming to the
+// "file.directory" semantic conventions. It represents the directory where the
+// file is located. It should include the drive letter, when appropriate.
+func FileDirectory(val string) attribute.KeyValue {
+ return FileDirectoryKey.String(val)
+}
+
+// FileExtension returns an attribute KeyValue conforming to the
+// "file.extension" semantic conventions. It represents the file extension,
+// excluding the leading dot.
+func FileExtension(val string) attribute.KeyValue {
+ return FileExtensionKey.String(val)
+}
+
+// FileName returns an attribute KeyValue conforming to the "file.name"
+// semantic conventions. It represents the name of the file including the
+// extension, without the directory.
+func FileName(val string) attribute.KeyValue {
+ return FileNameKey.String(val)
+}
+
+// FilePath returns an attribute KeyValue conforming to the "file.path"
+// semantic conventions. It represents the full path to the file, including the
+// file name. It should include the drive letter, when appropriate.
+func FilePath(val string) attribute.KeyValue {
+ return FilePathKey.String(val)
+}
+
+// FileSize returns an attribute KeyValue conforming to the "file.size"
+// semantic conventions. It represents the file size in bytes.
+func FileSize(val int) attribute.KeyValue {
+ return FileSizeKey.Int(val)
+}
+
+// Attributes for Google Cloud Run.
+const (
+ // GCPCloudRunJobExecutionKey is the attribute Key conforming to the
+ // "gcp.cloud_run.job.execution" semantic conventions. It represents the
+ // name of the Cloud Run
+ // [execution](https://cloud.google.com/run/docs/managing/job-executions)
+ // being run for the Job, as set by the
+ // [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars)
+ // environment variable.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'job-name-xxxx', 'sample-job-mdw84'
+ GCPCloudRunJobExecutionKey = attribute.Key("gcp.cloud_run.job.execution")
+
+ // GCPCloudRunJobTaskIndexKey is the attribute Key conforming to the
+ // "gcp.cloud_run.job.task_index" semantic conventions. It represents the
+ // index for a task within an execution as provided by the
+ // [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars)
+ // environment variable.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 0, 1
+ GCPCloudRunJobTaskIndexKey = attribute.Key("gcp.cloud_run.job.task_index")
+)
+
+// GCPCloudRunJobExecution returns an attribute KeyValue conforming to the
+// "gcp.cloud_run.job.execution" semantic conventions. It represents the name
+// of the Cloud Run
+// [execution](https://cloud.google.com/run/docs/managing/job-executions) being
+// run for the Job, as set by the
+// [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars)
+// environment variable.
+func GCPCloudRunJobExecution(val string) attribute.KeyValue {
+ return GCPCloudRunJobExecutionKey.String(val)
+}
+
+// GCPCloudRunJobTaskIndex returns an attribute KeyValue conforming to the
+// "gcp.cloud_run.job.task_index" semantic conventions. It represents the index
+// for a task within an execution as provided by the
+// [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars)
+// environment variable.
+func GCPCloudRunJobTaskIndex(val int) attribute.KeyValue {
+ return GCPCloudRunJobTaskIndexKey.Int(val)
+}
+
+// Attributes for Google Compute Engine (GCE).
+const (
+ // GCPGceInstanceHostnameKey is the attribute Key conforming to the
+ // "gcp.gce.instance.hostname" semantic conventions. It represents the
+ // hostname of a GCE instance. This is the full value of the default or
+ // [custom
+ // hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'my-host1234.example.com',
+ // 'sample-vm.us-west1-b.c.my-project.internal'
+ GCPGceInstanceHostnameKey = attribute.Key("gcp.gce.instance.hostname")
+
+ // GCPGceInstanceNameKey is the attribute Key conforming to the
+ // "gcp.gce.instance.name" semantic conventions. It represents the instance
+ // name of a GCE instance. This is the value provided by `host.name`, the
+ // visible name of the instance in the Cloud Console UI, and the prefix for
+ // the default hostname of the instance as defined by the [default internal
+ // DNS
+ // name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'instance-1', 'my-vm-name'
+ GCPGceInstanceNameKey = attribute.Key("gcp.gce.instance.name")
+)
+
+// GCPGceInstanceHostname returns an attribute KeyValue conforming to the
+// "gcp.gce.instance.hostname" semantic conventions. It represents the hostname
+// of a GCE instance. This is the full value of the default or [custom
+// hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm).
+func GCPGceInstanceHostname(val string) attribute.KeyValue {
+ return GCPGceInstanceHostnameKey.String(val)
+}
+
+// GCPGceInstanceName returns an attribute KeyValue conforming to the
+// "gcp.gce.instance.name" semantic conventions. It represents the instance
+// name of a GCE instance. This is the value provided by `host.name`, the
+// visible name of the instance in the Cloud Console UI, and the prefix for the
+// default hostname of the instance as defined by the [default internal DNS
+// name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names).
+func GCPGceInstanceName(val string) attribute.KeyValue {
+ return GCPGceInstanceNameKey.String(val)
+}
+
+// The attributes used to describe telemetry in the context of LLM (Large
+// Language Models) requests and responses.
+const (
+ // GenAiCompletionKey is the attribute Key conforming to the
+ // "gen_ai.completion" semantic conventions. It represents the full
+ // response received from the LLM.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: "[{'role': 'assistant', 'content': 'The capital of France is
+ // Paris.'}]"
+ // Note: It's RECOMMENDED to format completions as JSON string matching
+ // [OpenAI messages
+ // format](https://platform.openai.com/docs/guides/text-generation)
+ GenAiCompletionKey = attribute.Key("gen_ai.completion")
+
+ // GenAiPromptKey is the attribute Key conforming to the "gen_ai.prompt"
+ // semantic conventions. It represents the full prompt sent to an LLM.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: "[{'role': 'user', 'content': 'What is the capital of
+ // France?'}]"
+ // Note: It's RECOMMENDED to format prompts as JSON string matching [OpenAI
+ // messages
+ // format](https://platform.openai.com/docs/guides/text-generation)
+ GenAiPromptKey = attribute.Key("gen_ai.prompt")
+
+ // GenAiRequestMaxTokensKey is the attribute Key conforming to the
+ // "gen_ai.request.max_tokens" semantic conventions. It represents the
+ // maximum number of tokens the LLM generates for a request.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 100
+ GenAiRequestMaxTokensKey = attribute.Key("gen_ai.request.max_tokens")
+
+ // GenAiRequestModelKey is the attribute Key conforming to the
+ // "gen_ai.request.model" semantic conventions. It represents the name of
+ // the LLM a request is being made to.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'gpt-4'
+ GenAiRequestModelKey = attribute.Key("gen_ai.request.model")
+
+ // GenAiRequestTemperatureKey is the attribute Key conforming to the
+ // "gen_ai.request.temperature" semantic conventions. It represents the
+ // temperature setting for the LLM request.
+ //
+ // Type: double
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 0.0
+ GenAiRequestTemperatureKey = attribute.Key("gen_ai.request.temperature")
+
+ // GenAiRequestTopPKey is the attribute Key conforming to the
+ // "gen_ai.request.top_p" semantic conventions. It represents the top_p
+ // sampling setting for the LLM request.
+ //
+ // Type: double
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1.0
+ GenAiRequestTopPKey = attribute.Key("gen_ai.request.top_p")
+
+ // GenAiResponseFinishReasonsKey is the attribute Key conforming to the
+ // "gen_ai.response.finish_reasons" semantic conventions. It represents the
+ // array of reasons the model stopped generating tokens, corresponding to
+ // each generation received.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'stop'
+ GenAiResponseFinishReasonsKey = attribute.Key("gen_ai.response.finish_reasons")
+
+ // GenAiResponseIDKey is the attribute Key conforming to the
+ // "gen_ai.response.id" semantic conventions. It represents the unique
+ // identifier for the completion.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'chatcmpl-123'
+ GenAiResponseIDKey = attribute.Key("gen_ai.response.id")
+
+ // GenAiResponseModelKey is the attribute Key conforming to the
+ // "gen_ai.response.model" semantic conventions. It represents the name of
+ // the LLM a response was generated from.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'gpt-4-0613'
+ GenAiResponseModelKey = attribute.Key("gen_ai.response.model")
+
+ // GenAiSystemKey is the attribute Key conforming to the "gen_ai.system"
+ // semantic conventions. It represents the Generative AI product as
+ // identified by the client instrumentation.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'openai'
+ // Note: The actual GenAI product may differ from the one identified by the
+ // client. For example, when using OpenAI client libraries to communicate
+ // with Mistral, the `gen_ai.system` is set to `openai` based on the
+ // instrumentation's best knowledge.
+ GenAiSystemKey = attribute.Key("gen_ai.system")
+
+ // GenAiUsageCompletionTokensKey is the attribute Key conforming to the
+ // "gen_ai.usage.completion_tokens" semantic conventions. It represents the
+ // number of tokens used in the LLM response (completion).
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 180
+ GenAiUsageCompletionTokensKey = attribute.Key("gen_ai.usage.completion_tokens")
+
+ // GenAiUsagePromptTokensKey is the attribute Key conforming to the
+ // "gen_ai.usage.prompt_tokens" semantic conventions. It represents the
+ // number of tokens used in the LLM prompt.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 100
+ GenAiUsagePromptTokensKey = attribute.Key("gen_ai.usage.prompt_tokens")
+)
+
+var (
+ // OpenAI
+ GenAiSystemOpenai = GenAiSystemKey.String("openai")
+)
+
+// GenAiCompletion returns an attribute KeyValue conforming to the
+// "gen_ai.completion" semantic conventions. It represents the full response
+// received from the LLM.
+func GenAiCompletion(val string) attribute.KeyValue {
+ return GenAiCompletionKey.String(val)
+}
+
+// GenAiPrompt returns an attribute KeyValue conforming to the
+// "gen_ai.prompt" semantic conventions. It represents the full prompt sent to
+// an LLM.
+func GenAiPrompt(val string) attribute.KeyValue {
+ return GenAiPromptKey.String(val)
+}
+
+// GenAiRequestMaxTokens returns an attribute KeyValue conforming to the
+// "gen_ai.request.max_tokens" semantic conventions. It represents the maximum
+// number of tokens the LLM generates for a request.
+func GenAiRequestMaxTokens(val int) attribute.KeyValue {
+ return GenAiRequestMaxTokensKey.Int(val)
+}
+
+// GenAiRequestModel returns an attribute KeyValue conforming to the
+// "gen_ai.request.model" semantic conventions. It represents the name of the
+// LLM a request is being made to.
+func GenAiRequestModel(val string) attribute.KeyValue {
+ return GenAiRequestModelKey.String(val)
+}
+
+// GenAiRequestTemperature returns an attribute KeyValue conforming to the
+// "gen_ai.request.temperature" semantic conventions. It represents the
+// temperature setting for the LLM request.
+func GenAiRequestTemperature(val float64) attribute.KeyValue {
+ return GenAiRequestTemperatureKey.Float64(val)
+}
+
+// GenAiRequestTopP returns an attribute KeyValue conforming to the
+// "gen_ai.request.top_p" semantic conventions. It represents the top_p
+// sampling setting for the LLM request.
+func GenAiRequestTopP(val float64) attribute.KeyValue {
+ return GenAiRequestTopPKey.Float64(val)
+}
+
+// GenAiResponseFinishReasons returns an attribute KeyValue conforming to
+// the "gen_ai.response.finish_reasons" semantic conventions. It represents the
+// array of reasons the model stopped generating tokens, corresponding to each
+// generation received.
+func GenAiResponseFinishReasons(val ...string) attribute.KeyValue {
+ return GenAiResponseFinishReasonsKey.StringSlice(val)
+}
+
+// GenAiResponseID returns an attribute KeyValue conforming to the
+// "gen_ai.response.id" semantic conventions. It represents the unique
+// identifier for the completion.
+func GenAiResponseID(val string) attribute.KeyValue {
+ return GenAiResponseIDKey.String(val)
+}
+
+// GenAiResponseModel returns an attribute KeyValue conforming to the
+// "gen_ai.response.model" semantic conventions. It represents the name of the
+// LLM a response was generated from.
+func GenAiResponseModel(val string) attribute.KeyValue {
+ return GenAiResponseModelKey.String(val)
+}
+
+// GenAiUsageCompletionTokens returns an attribute KeyValue conforming to
+// the "gen_ai.usage.completion_tokens" semantic conventions. It represents the
+// number of tokens used in the LLM response (completion).
+func GenAiUsageCompletionTokens(val int) attribute.KeyValue {
+ return GenAiUsageCompletionTokensKey.Int(val)
+}
+
+// GenAiUsagePromptTokens returns an attribute KeyValue conforming to the
+// "gen_ai.usage.prompt_tokens" semantic conventions. It represents the number
+// of tokens used in the LLM prompt.
+func GenAiUsagePromptTokens(val int) attribute.KeyValue {
+ return GenAiUsagePromptTokensKey.Int(val)
+}
+
+// Attributes for GraphQL.
+const (
+ // GraphqlDocumentKey is the attribute Key conforming to the
+ // "graphql.document" semantic conventions. It represents the GraphQL
+ // document being executed.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'query findBookByID { bookByID(id: ?) { name } }'
+ // Note: The value may be sanitized to exclude sensitive information.
+ GraphqlDocumentKey = attribute.Key("graphql.document")
+
+ // GraphqlOperationNameKey is the attribute Key conforming to the
+ // "graphql.operation.name" semantic conventions. It represents the name of
+ // the operation being executed.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'findBookByID'
+ GraphqlOperationNameKey = attribute.Key("graphql.operation.name")
+
+ // GraphqlOperationTypeKey is the attribute Key conforming to the
+ // "graphql.operation.type" semantic conventions. It represents the type of
+ // the operation being executed.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'query', 'mutation', 'subscription'
+ GraphqlOperationTypeKey = attribute.Key("graphql.operation.type")
+)
+
+var (
+ // GraphQL query
+ GraphqlOperationTypeQuery = GraphqlOperationTypeKey.String("query")
+ // GraphQL mutation
+ GraphqlOperationTypeMutation = GraphqlOperationTypeKey.String("mutation")
+ // GraphQL subscription
+ GraphqlOperationTypeSubscription = GraphqlOperationTypeKey.String("subscription")
+)
+
+// GraphqlDocument returns an attribute KeyValue conforming to the
+// "graphql.document" semantic conventions. It represents the GraphQL document
+// being executed.
+func GraphqlDocument(val string) attribute.KeyValue {
+ return GraphqlDocumentKey.String(val)
+}
+
+// GraphqlOperationName returns an attribute KeyValue conforming to the
+// "graphql.operation.name" semantic conventions. It represents the name of the
+// operation being executed.
+func GraphqlOperationName(val string) attribute.KeyValue {
+ return GraphqlOperationNameKey.String(val)
+}
+
+// Attributes for the Android platform on which the Android application is
+// running.
+const (
+ // HerokuAppIDKey is the attribute Key conforming to the "heroku.app.id"
+ // semantic conventions. It represents the unique identifier for the
+ // application
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2daa2797-e42b-4624-9322-ec3f968df4da'
+ HerokuAppIDKey = attribute.Key("heroku.app.id")
+
+ // HerokuReleaseCommitKey is the attribute Key conforming to the
+ // "heroku.release.commit" semantic conventions. It represents the commit
+ // hash for the current release
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'e6134959463efd8966b20e75b913cafe3f5ec'
+ HerokuReleaseCommitKey = attribute.Key("heroku.release.commit")
+
+ // HerokuReleaseCreationTimestampKey is the attribute Key conforming to the
+ // "heroku.release.creation_timestamp" semantic conventions. It represents
+ // the time and date the release was created
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2022-10-23T18:00:42Z'
+ HerokuReleaseCreationTimestampKey = attribute.Key("heroku.release.creation_timestamp")
+)
+
+// HerokuAppID returns an attribute KeyValue conforming to the
+// "heroku.app.id" semantic conventions. It represents the unique identifier
+// for the application
+func HerokuAppID(val string) attribute.KeyValue {
+ return HerokuAppIDKey.String(val)
+}
+
+// HerokuReleaseCommit returns an attribute KeyValue conforming to the
+// "heroku.release.commit" semantic conventions. It represents the commit hash
+// for the current release
+func HerokuReleaseCommit(val string) attribute.KeyValue {
+ return HerokuReleaseCommitKey.String(val)
+}
+
+// HerokuReleaseCreationTimestamp returns an attribute KeyValue conforming
+// to the "heroku.release.creation_timestamp" semantic conventions. It
+// represents the time and date the release was created
+func HerokuReleaseCreationTimestamp(val string) attribute.KeyValue {
+ return HerokuReleaseCreationTimestampKey.String(val)
+}
+
+// A host is defined as a computing instance. For example, physical servers,
+// virtual machines, switches or disk array.
+const (
+ // HostArchKey is the attribute Key conforming to the "host.arch" semantic
+ // conventions. It represents the CPU architecture the host system is
+ // running on.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ HostArchKey = attribute.Key("host.arch")
+
+ // HostCPUCacheL2SizeKey is the attribute Key conforming to the
+ // "host.cpu.cache.l2.size" semantic conventions. It represents the amount
+ // of level 2 memory cache available to the processor (in Bytes).
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 12288000
+ HostCPUCacheL2SizeKey = attribute.Key("host.cpu.cache.l2.size")
+
+ // HostCPUFamilyKey is the attribute Key conforming to the
+ // "host.cpu.family" semantic conventions. It represents the family or
+ // generation of the CPU.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '6', 'PA-RISC 1.1e'
+ HostCPUFamilyKey = attribute.Key("host.cpu.family")
+
+ // HostCPUModelIDKey is the attribute Key conforming to the
+ // "host.cpu.model.id" semantic conventions. It represents the model
+ // identifier. It provides more granular information about the CPU,
+ // distinguishing it from other CPUs within the same family.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '6', '9000/778/B180L'
+ HostCPUModelIDKey = attribute.Key("host.cpu.model.id")
+
+ // HostCPUModelNameKey is the attribute Key conforming to the
+ // "host.cpu.model.name" semantic conventions. It represents the model
+ // designation of the processor.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz'
+ HostCPUModelNameKey = attribute.Key("host.cpu.model.name")
+
+ // HostCPUSteppingKey is the attribute Key conforming to the
+ // "host.cpu.stepping" semantic conventions. It represents the stepping or
+ // core revisions.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '1', 'r1p1'
+ HostCPUSteppingKey = attribute.Key("host.cpu.stepping")
+
+ // HostCPUVendorIDKey is the attribute Key conforming to the
+ // "host.cpu.vendor.id" semantic conventions. It represents the processor
+ // manufacturer identifier. A maximum 12-character string.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'GenuineIntel'
+ // Note: [CPUID](https://wiki.osdev.org/CPUID) command returns the vendor
+ // ID string in EBX, EDX and ECX registers. Writing these to memory in this
+ // order results in a 12-character string.
+ HostCPUVendorIDKey = attribute.Key("host.cpu.vendor.id")
+
+ // HostIDKey is the attribute Key conforming to the "host.id" semantic
+ // conventions. It represents the unique host ID. For Cloud, this must be
+ // the instance_id assigned by the cloud provider. For non-containerized
+ // systems, this should be the `machine-id`. See the table below for the
+ // sources to use to determine the `machine-id` based on operating system.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'fdbf79e8af94cb7f9e8df36789187052'
+ HostIDKey = attribute.Key("host.id")
+
+ // HostImageIDKey is the attribute Key conforming to the "host.image.id"
+ // semantic conventions. It represents the vM image ID or host OS image ID.
+ // For Cloud, this value is from the provider.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'ami-07b06b442921831e5'
+ HostImageIDKey = attribute.Key("host.image.id")
+
+ // HostImageNameKey is the attribute Key conforming to the
+ // "host.image.name" semantic conventions. It represents the name of the VM
+ // image or OS install the host was instantiated from.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'infra-ami-eks-worker-node-7d4ec78312', 'CentOS-8-x86_64-1905'
+ HostImageNameKey = attribute.Key("host.image.name")
+
+ // HostImageVersionKey is the attribute Key conforming to the
+ // "host.image.version" semantic conventions. It represents the version
+ // string of the VM image or host OS as defined in [Version
+ // Attributes](/docs/resource/README.md#version-attributes).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '0.1'
+ HostImageVersionKey = attribute.Key("host.image.version")
+
+ // HostIPKey is the attribute Key conforming to the "host.ip" semantic
+ // conventions. It represents the available IP addresses of the host,
+ // excluding loopback interfaces.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '192.168.1.140', 'fe80::abc2:4a28:737a:609e'
+ // Note: IPv4 Addresses MUST be specified in dotted-quad notation. IPv6
+ // addresses MUST be specified in the [RFC
+ // 5952](https://www.rfc-editor.org/rfc/rfc5952.html) format.
+ HostIPKey = attribute.Key("host.ip")
+
+ // HostMacKey is the attribute Key conforming to the "host.mac" semantic
+ // conventions. It represents the available MAC addresses of the host,
+ // excluding loopback interfaces.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'AC-DE-48-23-45-67', 'AC-DE-48-23-45-67-01-9F'
+ // Note: MAC Addresses MUST be represented in [IEEE RA hexadecimal
+ // form](https://standards.ieee.org/wp-content/uploads/import/documents/tutorials/eui.pdf):
+ // as hyphen-separated octets in uppercase hexadecimal form from most to
+ // least significant.
+ HostMacKey = attribute.Key("host.mac")
+
+ // HostNameKey is the attribute Key conforming to the "host.name" semantic
+ // conventions. It represents the name of the host. On Unix systems, it may
+ // contain what the hostname command returns, or the fully qualified
+ // hostname, or another name specified by the user.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry-test'
+ HostNameKey = attribute.Key("host.name")
+
+ // HostTypeKey is the attribute Key conforming to the "host.type" semantic
+ // conventions. It represents the type of host. For Cloud, this must be the
+ // machine type.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'n1-standard-1'
+ HostTypeKey = attribute.Key("host.type")
+)
+
+var (
+ // AMD64
+ HostArchAMD64 = HostArchKey.String("amd64")
+ // ARM32
+ HostArchARM32 = HostArchKey.String("arm32")
+ // ARM64
+ HostArchARM64 = HostArchKey.String("arm64")
+ // Itanium
+ HostArchIA64 = HostArchKey.String("ia64")
+ // 32-bit PowerPC
+ HostArchPPC32 = HostArchKey.String("ppc32")
+ // 64-bit PowerPC
+ HostArchPPC64 = HostArchKey.String("ppc64")
+ // IBM z/Architecture
+ HostArchS390x = HostArchKey.String("s390x")
+ // 32-bit x86
+ HostArchX86 = HostArchKey.String("x86")
+)
+
+// HostCPUCacheL2Size returns an attribute KeyValue conforming to the
+// "host.cpu.cache.l2.size" semantic conventions. It represents the amount of
+// level 2 memory cache available to the processor (in Bytes).
+func HostCPUCacheL2Size(val int) attribute.KeyValue {
+ return HostCPUCacheL2SizeKey.Int(val)
+}
+
+// HostCPUFamily returns an attribute KeyValue conforming to the
+// "host.cpu.family" semantic conventions. It represents the family or
+// generation of the CPU.
+func HostCPUFamily(val string) attribute.KeyValue {
+ return HostCPUFamilyKey.String(val)
+}
+
+// HostCPUModelID returns an attribute KeyValue conforming to the
+// "host.cpu.model.id" semantic conventions. It represents the model
+// identifier. It provides more granular information about the CPU,
+// distinguishing it from other CPUs within the same family.
+func HostCPUModelID(val string) attribute.KeyValue {
+ return HostCPUModelIDKey.String(val)
+}
+
+// HostCPUModelName returns an attribute KeyValue conforming to the
+// "host.cpu.model.name" semantic conventions. It represents the model
+// designation of the processor.
+func HostCPUModelName(val string) attribute.KeyValue {
+ return HostCPUModelNameKey.String(val)
+}
+
+// HostCPUStepping returns an attribute KeyValue conforming to the
+// "host.cpu.stepping" semantic conventions. It represents the stepping or core
+// revisions.
+func HostCPUStepping(val string) attribute.KeyValue {
+ return HostCPUSteppingKey.String(val)
+}
+
+// HostCPUVendorID returns an attribute KeyValue conforming to the
+// "host.cpu.vendor.id" semantic conventions. It represents the processor
+// manufacturer identifier. A maximum 12-character string.
+func HostCPUVendorID(val string) attribute.KeyValue {
+ return HostCPUVendorIDKey.String(val)
+}
+
+// HostID returns an attribute KeyValue conforming to the "host.id" semantic
+// conventions. It represents the unique host ID. For Cloud, this must be the
+// instance_id assigned by the cloud provider. For non-containerized systems,
+// this should be the `machine-id`. See the table below for the sources to use
+// to determine the `machine-id` based on operating system.
+func HostID(val string) attribute.KeyValue {
+ return HostIDKey.String(val)
+}
+
+// HostImageID returns an attribute KeyValue conforming to the
+// "host.image.id" semantic conventions. It represents the vM image ID or host
+// OS image ID. For Cloud, this value is from the provider.
+func HostImageID(val string) attribute.KeyValue {
+ return HostImageIDKey.String(val)
+}
+
+// HostImageName returns an attribute KeyValue conforming to the
+// "host.image.name" semantic conventions. It represents the name of the VM
+// image or OS install the host was instantiated from.
+func HostImageName(val string) attribute.KeyValue {
+ return HostImageNameKey.String(val)
+}
+
+// HostImageVersion returns an attribute KeyValue conforming to the
+// "host.image.version" semantic conventions. It represents the version string
+// of the VM image or host OS as defined in [Version
+// Attributes](/docs/resource/README.md#version-attributes).
+func HostImageVersion(val string) attribute.KeyValue {
+ return HostImageVersionKey.String(val)
+}
+
+// HostIP returns an attribute KeyValue conforming to the "host.ip" semantic
+// conventions. It represents the available IP addresses of the host, excluding
+// loopback interfaces.
+func HostIP(val ...string) attribute.KeyValue {
+ return HostIPKey.StringSlice(val)
+}
+
+// HostMac returns an attribute KeyValue conforming to the "host.mac"
+// semantic conventions. It represents the available MAC addresses of the host,
+// excluding loopback interfaces.
+func HostMac(val ...string) attribute.KeyValue {
+ return HostMacKey.StringSlice(val)
+}
+
+// HostName returns an attribute KeyValue conforming to the "host.name"
+// semantic conventions. It represents the name of the host. On Unix systems,
+// it may contain what the hostname command returns, or the fully qualified
+// hostname, or another name specified by the user.
+func HostName(val string) attribute.KeyValue {
+ return HostNameKey.String(val)
+}
+
+// HostType returns an attribute KeyValue conforming to the "host.type"
+// semantic conventions. It represents the type of host. For Cloud, this must
+// be the machine type.
+func HostType(val string) attribute.KeyValue {
+ return HostTypeKey.String(val)
+}
+
+// Semantic convention attributes in the HTTP namespace.
+const (
+ // HTTPConnectionStateKey is the attribute Key conforming to the
+ // "http.connection.state" semantic conventions. It represents the state of
+ // the HTTP connection in the HTTP connection pool.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'active', 'idle'
+ HTTPConnectionStateKey = attribute.Key("http.connection.state")
+
+ // HTTPRequestBodySizeKey is the attribute Key conforming to the
+ // "http.request.body.size" semantic conventions. It represents the size of
+ // the request payload body in bytes. This is the number of bytes
+ // transferred excluding headers and is often, but not always, present as
+ // the
+ // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
+ // header. For requests using transport encoding, this should be the
+ // compressed size.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 3495
+ HTTPRequestBodySizeKey = attribute.Key("http.request.body.size")
+
+ // HTTPRequestMethodKey is the attribute Key conforming to the
+ // "http.request.method" semantic conventions. It represents the hTTP
+ // request method.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'GET', 'POST', 'HEAD'
+ // Note: HTTP request method value SHOULD be "known" to the
+ // instrumentation.
+ // By default, this convention defines "known" methods as the ones listed
+ // in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods)
+ // and the PATCH method defined in
+ // [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html).
+ //
+ // If the HTTP request method is not known to instrumentation, it MUST set
+ // the `http.request.method` attribute to `_OTHER`.
+ //
+ // If the HTTP instrumentation could end up converting valid HTTP request
+ // methods to `_OTHER`, then it MUST provide a way to override
+ // the list of known HTTP methods. If this override is done via environment
+ // variable, then the environment variable MUST be named
+ // OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated
+ // list of case-sensitive known HTTP methods
+ // (this list MUST be a full override of the default known method, it is
+ // not a list of known methods in addition to the defaults).
+ //
+ // HTTP method names are case-sensitive and `http.request.method` attribute
+ // value MUST match a known HTTP method name exactly.
+ // Instrumentations for specific web frameworks that consider HTTP methods
+ // to be case insensitive, SHOULD populate a canonical equivalent.
+ // Tracing instrumentations that do so, MUST also set
+ // `http.request.method_original` to the original value.
+ HTTPRequestMethodKey = attribute.Key("http.request.method")
+
+ // HTTPRequestMethodOriginalKey is the attribute Key conforming to the
+ // "http.request.method_original" semantic conventions. It represents the
+ // original HTTP method sent by the client in the request line.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'GeT', 'ACL', 'foo'
+ HTTPRequestMethodOriginalKey = attribute.Key("http.request.method_original")
+
+ // HTTPRequestResendCountKey is the attribute Key conforming to the
+ // "http.request.resend_count" semantic conventions. It represents the
+ // ordinal number of request resending attempt (for any reason, including
+ // redirects).
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 3
+ // Note: The resend count SHOULD be updated each time an HTTP request gets
+ // resent by the client, regardless of what was the cause of the resending
+ // (e.g. redirection, authorization failure, 503 Server Unavailable,
+ // network issues, or any other).
+ HTTPRequestResendCountKey = attribute.Key("http.request.resend_count")
+
+ // HTTPRequestSizeKey is the attribute Key conforming to the
+ // "http.request.size" semantic conventions. It represents the total size
+ // of the request in bytes. This should be the total number of bytes sent
+ // over the wire, including the request line (HTTP/1.1), framing (HTTP/2
+ // and HTTP/3), headers, and request body if any.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1437
+ HTTPRequestSizeKey = attribute.Key("http.request.size")
+
+ // HTTPResponseBodySizeKey is the attribute Key conforming to the
+ // "http.response.body.size" semantic conventions. It represents the size
+ // of the response payload body in bytes. This is the number of bytes
+ // transferred excluding headers and is often, but not always, present as
+ // the
+ // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
+ // header. For requests using transport encoding, this should be the
+ // compressed size.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 3495
+ HTTPResponseBodySizeKey = attribute.Key("http.response.body.size")
+
+ // HTTPResponseSizeKey is the attribute Key conforming to the
+ // "http.response.size" semantic conventions. It represents the total size
+ // of the response in bytes. This should be the total number of bytes sent
+ // over the wire, including the status line (HTTP/1.1), framing (HTTP/2 and
+ // HTTP/3), headers, and response body and trailers if any.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1437
+ HTTPResponseSizeKey = attribute.Key("http.response.size")
+
+ // HTTPResponseStatusCodeKey is the attribute Key conforming to the
+ // "http.response.status_code" semantic conventions. It represents the
+ // [HTTP response status
+ // code](https://tools.ietf.org/html/rfc7231#section-6).
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 200
+ HTTPResponseStatusCodeKey = attribute.Key("http.response.status_code")
+
+ // HTTPRouteKey is the attribute Key conforming to the "http.route"
+ // semantic conventions. It represents the matched route, that is, the path
+ // template in the format used by the respective server framework.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '/users/:userID?', '{controller}/{action}/{id?}'
+ // Note: MUST NOT be populated when this is not supported by the HTTP
+ // server framework as the route attribute should have low-cardinality and
+ // the URI path can NOT substitute it.
+ // SHOULD include the [application
+ // root](/docs/http/http-spans.md#http-server-definitions) if there is one.
+ HTTPRouteKey = attribute.Key("http.route")
+)
+
+var (
+ // active state
+ HTTPConnectionStateActive = HTTPConnectionStateKey.String("active")
+ // idle state
+ HTTPConnectionStateIdle = HTTPConnectionStateKey.String("idle")
+)
+
+var (
+ // CONNECT method
+ HTTPRequestMethodConnect = HTTPRequestMethodKey.String("CONNECT")
+ // DELETE method
+ HTTPRequestMethodDelete = HTTPRequestMethodKey.String("DELETE")
+ // GET method
+ HTTPRequestMethodGet = HTTPRequestMethodKey.String("GET")
+ // HEAD method
+ HTTPRequestMethodHead = HTTPRequestMethodKey.String("HEAD")
+ // OPTIONS method
+ HTTPRequestMethodOptions = HTTPRequestMethodKey.String("OPTIONS")
+ // PATCH method
+ HTTPRequestMethodPatch = HTTPRequestMethodKey.String("PATCH")
+ // POST method
+ HTTPRequestMethodPost = HTTPRequestMethodKey.String("POST")
+ // PUT method
+ HTTPRequestMethodPut = HTTPRequestMethodKey.String("PUT")
+ // TRACE method
+ HTTPRequestMethodTrace = HTTPRequestMethodKey.String("TRACE")
+ // Any HTTP method that the instrumentation has no prior knowledge of
+ HTTPRequestMethodOther = HTTPRequestMethodKey.String("_OTHER")
+)
+
+// HTTPRequestBodySize returns an attribute KeyValue conforming to the
+// "http.request.body.size" semantic conventions. It represents the size of the
+// request payload body in bytes. This is the number of bytes transferred
+// excluding headers and is often, but not always, present as the
+// [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
+// header. For requests using transport encoding, this should be the compressed
+// size.
+func HTTPRequestBodySize(val int) attribute.KeyValue {
+ return HTTPRequestBodySizeKey.Int(val)
+}
+
+// HTTPRequestMethodOriginal returns an attribute KeyValue conforming to the
+// "http.request.method_original" semantic conventions. It represents the
+// original HTTP method sent by the client in the request line.
+func HTTPRequestMethodOriginal(val string) attribute.KeyValue {
+ return HTTPRequestMethodOriginalKey.String(val)
+}
+
+// HTTPRequestResendCount returns an attribute KeyValue conforming to the
+// "http.request.resend_count" semantic conventions. It represents the ordinal
+// number of request resending attempt (for any reason, including redirects).
+func HTTPRequestResendCount(val int) attribute.KeyValue {
+ return HTTPRequestResendCountKey.Int(val)
+}
+
+// HTTPRequestSize returns an attribute KeyValue conforming to the
+// "http.request.size" semantic conventions. It represents the total size of
+// the request in bytes. This should be the total number of bytes sent over the
+// wire, including the request line (HTTP/1.1), framing (HTTP/2 and HTTP/3),
+// headers, and request body if any.
+func HTTPRequestSize(val int) attribute.KeyValue {
+ return HTTPRequestSizeKey.Int(val)
+}
+
+// HTTPResponseBodySize returns an attribute KeyValue conforming to the
+// "http.response.body.size" semantic conventions. It represents the size of
+// the response payload body in bytes. This is the number of bytes transferred
+// excluding headers and is often, but not always, present as the
+// [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
+// header. For requests using transport encoding, this should be the compressed
+// size.
+func HTTPResponseBodySize(val int) attribute.KeyValue {
+ return HTTPResponseBodySizeKey.Int(val)
+}
+
+// HTTPResponseSize returns an attribute KeyValue conforming to the
+// "http.response.size" semantic conventions. It represents the total size of
+// the response in bytes. This should be the total number of bytes sent over
+// the wire, including the status line (HTTP/1.1), framing (HTTP/2 and HTTP/3),
+// headers, and response body and trailers if any.
+func HTTPResponseSize(val int) attribute.KeyValue {
+ return HTTPResponseSizeKey.Int(val)
+}
+
+// HTTPResponseStatusCode returns an attribute KeyValue conforming to the
+// "http.response.status_code" semantic conventions. It represents the [HTTP
+// response status code](https://tools.ietf.org/html/rfc7231#section-6).
+func HTTPResponseStatusCode(val int) attribute.KeyValue {
+ return HTTPResponseStatusCodeKey.Int(val)
+}
+
+// HTTPRoute returns an attribute KeyValue conforming to the "http.route"
+// semantic conventions. It represents the matched route, that is, the path
+// template in the format used by the respective server framework.
+func HTTPRoute(val string) attribute.KeyValue {
+ return HTTPRouteKey.String(val)
+}
+
+// Java Virtual machine related attributes.
+const (
+ // JvmBufferPoolNameKey is the attribute Key conforming to the
+ // "jvm.buffer.pool.name" semantic conventions. It represents the name of
+ // the buffer pool.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'mapped', 'direct'
+ // Note: Pool names are generally obtained via
+ // [BufferPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/BufferPoolMXBean.html#getName()).
+ JvmBufferPoolNameKey = attribute.Key("jvm.buffer.pool.name")
+
+ // JvmGcActionKey is the attribute Key conforming to the "jvm.gc.action"
+ // semantic conventions. It represents the name of the garbage collector
+ // action.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'end of minor GC', 'end of major GC'
+ // Note: Garbage collector action is generally obtained via
+ // [GarbageCollectionNotificationInfo#getGcAction()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcAction()).
+ JvmGcActionKey = attribute.Key("jvm.gc.action")
+
+ // JvmGcNameKey is the attribute Key conforming to the "jvm.gc.name"
+ // semantic conventions. It represents the name of the garbage collector.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'G1 Young Generation', 'G1 Old Generation'
+ // Note: Garbage collector name is generally obtained via
+ // [GarbageCollectionNotificationInfo#getGcName()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcName()).
+ JvmGcNameKey = attribute.Key("jvm.gc.name")
+
+ // JvmMemoryPoolNameKey is the attribute Key conforming to the
+ // "jvm.memory.pool.name" semantic conventions. It represents the name of
+ // the memory pool.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'G1 Old Gen', 'G1 Eden space', 'G1 Survivor Space'
+ // Note: Pool names are generally obtained via
+ // [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()).
+ JvmMemoryPoolNameKey = attribute.Key("jvm.memory.pool.name")
+
+ // JvmMemoryTypeKey is the attribute Key conforming to the
+ // "jvm.memory.type" semantic conventions. It represents the type of
+ // memory.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'heap', 'non_heap'
+ JvmMemoryTypeKey = attribute.Key("jvm.memory.type")
+
+ // JvmThreadDaemonKey is the attribute Key conforming to the
+ // "jvm.thread.daemon" semantic conventions. It represents the whether the
+ // thread is daemon or not.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: stable
+ JvmThreadDaemonKey = attribute.Key("jvm.thread.daemon")
+
+ // JvmThreadStateKey is the attribute Key conforming to the
+ // "jvm.thread.state" semantic conventions. It represents the state of the
+ // thread.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'runnable', 'blocked'
+ JvmThreadStateKey = attribute.Key("jvm.thread.state")
+)
+
+var (
+ // Heap memory
+ JvmMemoryTypeHeap = JvmMemoryTypeKey.String("heap")
+ // Non-heap memory
+ JvmMemoryTypeNonHeap = JvmMemoryTypeKey.String("non_heap")
+)
+
+var (
+ // A thread that has not yet started is in this state
+ JvmThreadStateNew = JvmThreadStateKey.String("new")
+ // A thread executing in the Java virtual machine is in this state
+ JvmThreadStateRunnable = JvmThreadStateKey.String("runnable")
+ // A thread that is blocked waiting for a monitor lock is in this state
+ JvmThreadStateBlocked = JvmThreadStateKey.String("blocked")
+ // A thread that is waiting indefinitely for another thread to perform a particular action is in this state
+ JvmThreadStateWaiting = JvmThreadStateKey.String("waiting")
+ // A thread that is waiting for another thread to perform an action for up to a specified waiting time is in this state
+ JvmThreadStateTimedWaiting = JvmThreadStateKey.String("timed_waiting")
+ // A thread that has exited is in this state
+ JvmThreadStateTerminated = JvmThreadStateKey.String("terminated")
+)
+
+// JvmBufferPoolName returns an attribute KeyValue conforming to the
+// "jvm.buffer.pool.name" semantic conventions. It represents the name of the
+// buffer pool.
+func JvmBufferPoolName(val string) attribute.KeyValue {
+ return JvmBufferPoolNameKey.String(val)
+}
+
+// JvmGcAction returns an attribute KeyValue conforming to the
+// "jvm.gc.action" semantic conventions. It represents the name of the garbage
+// collector action.
+func JvmGcAction(val string) attribute.KeyValue {
+ return JvmGcActionKey.String(val)
+}
+
+// JvmGcName returns an attribute KeyValue conforming to the "jvm.gc.name"
+// semantic conventions. It represents the name of the garbage collector.
+func JvmGcName(val string) attribute.KeyValue {
+ return JvmGcNameKey.String(val)
+}
+
+// JvmMemoryPoolName returns an attribute KeyValue conforming to the
+// "jvm.memory.pool.name" semantic conventions. It represents the name of the
+// memory pool.
+func JvmMemoryPoolName(val string) attribute.KeyValue {
+ return JvmMemoryPoolNameKey.String(val)
+}
+
+// JvmThreadDaemon returns an attribute KeyValue conforming to the
+// "jvm.thread.daemon" semantic conventions. It represents the whether the
+// thread is daemon or not.
+func JvmThreadDaemon(val bool) attribute.KeyValue {
+ return JvmThreadDaemonKey.Bool(val)
+}
+
+// Kubernetes resource attributes.
+const (
+ // K8SClusterNameKey is the attribute Key conforming to the
+ // "k8s.cluster.name" semantic conventions. It represents the name of the
+ // cluster.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry-cluster'
+ K8SClusterNameKey = attribute.Key("k8s.cluster.name")
+
+ // K8SClusterUIDKey is the attribute Key conforming to the
+ // "k8s.cluster.uid" semantic conventions. It represents a pseudo-ID for
+ // the cluster, set to the UID of the `kube-system` namespace.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '218fc5a9-a5f1-4b54-aa05-46717d0ab26d'
+ // Note: K8S doesn't have support for obtaining a cluster ID. If this is
+ // ever
+ // added, we will recommend collecting the `k8s.cluster.uid` through the
+ // official APIs. In the meantime, we are able to use the `uid` of the
+ // `kube-system` namespace as a proxy for cluster ID. Read on for the
+ // rationale.
+ //
+ // Every object created in a K8S cluster is assigned a distinct UID. The
+ // `kube-system` namespace is used by Kubernetes itself and will exist
+ // for the lifetime of the cluster. Using the `uid` of the `kube-system`
+ // namespace is a reasonable proxy for the K8S ClusterID as it will only
+ // change if the cluster is rebuilt. Furthermore, Kubernetes UIDs are
+ // UUIDs as standardized by
+ // [ISO/IEC 9834-8 and ITU-T
+ // X.667](https://www.itu.int/ITU-T/studygroups/com17/oid.html).
+ // Which states:
+ //
+ // > If generated according to one of the mechanisms defined in Rec.
+ // ITU-T X.667 | ISO/IEC 9834-8, a UUID is either guaranteed to be
+ // different from all other UUIDs generated before 3603 A.D., or is
+ // extremely likely to be different (depending on the mechanism chosen).
+ //
+ // Therefore, UIDs between clusters should be extremely unlikely to
+ // conflict.
+ K8SClusterUIDKey = attribute.Key("k8s.cluster.uid")
+
+ // K8SContainerNameKey is the attribute Key conforming to the
+ // "k8s.container.name" semantic conventions. It represents the name of the
+ // Container from Pod specification, must be unique within a Pod. Container
+ // runtime usually uses different globally unique name (`container.name`).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'redis'
+ K8SContainerNameKey = attribute.Key("k8s.container.name")
+
+ // K8SContainerRestartCountKey is the attribute Key conforming to the
+ // "k8s.container.restart_count" semantic conventions. It represents the
+ // number of times the container was restarted. This attribute can be used
+ // to identify a particular container (running or stopped) within a
+ // container spec.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ K8SContainerRestartCountKey = attribute.Key("k8s.container.restart_count")
+
+ // K8SContainerStatusLastTerminatedReasonKey is the attribute Key
+ // conforming to the "k8s.container.status.last_terminated_reason" semantic
+ // conventions. It represents the last terminated reason of the Container.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Evicted', 'Error'
+ K8SContainerStatusLastTerminatedReasonKey = attribute.Key("k8s.container.status.last_terminated_reason")
+
+ // K8SCronJobNameKey is the attribute Key conforming to the
+ // "k8s.cronjob.name" semantic conventions. It represents the name of the
+ // CronJob.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry'
+ K8SCronJobNameKey = attribute.Key("k8s.cronjob.name")
+
+ // K8SCronJobUIDKey is the attribute Key conforming to the
+ // "k8s.cronjob.uid" semantic conventions. It represents the UID of the
+ // CronJob.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
+ K8SCronJobUIDKey = attribute.Key("k8s.cronjob.uid")
+
+ // K8SDaemonSetNameKey is the attribute Key conforming to the
+ // "k8s.daemonset.name" semantic conventions. It represents the name of the
+ // DaemonSet.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry'
+ K8SDaemonSetNameKey = attribute.Key("k8s.daemonset.name")
+
+ // K8SDaemonSetUIDKey is the attribute Key conforming to the
+ // "k8s.daemonset.uid" semantic conventions. It represents the UID of the
+ // DaemonSet.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
+ K8SDaemonSetUIDKey = attribute.Key("k8s.daemonset.uid")
+
+ // K8SDeploymentNameKey is the attribute Key conforming to the
+ // "k8s.deployment.name" semantic conventions. It represents the name of
+ // the Deployment.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry'
+ K8SDeploymentNameKey = attribute.Key("k8s.deployment.name")
+
+ // K8SDeploymentUIDKey is the attribute Key conforming to the
+ // "k8s.deployment.uid" semantic conventions. It represents the UID of the
+ // Deployment.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
+ K8SDeploymentUIDKey = attribute.Key("k8s.deployment.uid")
+
+ // K8SJobNameKey is the attribute Key conforming to the "k8s.job.name"
+ // semantic conventions. It represents the name of the Job.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry'
+ K8SJobNameKey = attribute.Key("k8s.job.name")
+
+ // K8SJobUIDKey is the attribute Key conforming to the "k8s.job.uid"
+ // semantic conventions. It represents the UID of the Job.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
+ K8SJobUIDKey = attribute.Key("k8s.job.uid")
+
+ // K8SNamespaceNameKey is the attribute Key conforming to the
+ // "k8s.namespace.name" semantic conventions. It represents the name of the
+ // namespace that the pod is running in.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'default'
+ K8SNamespaceNameKey = attribute.Key("k8s.namespace.name")
+
+ // K8SNodeNameKey is the attribute Key conforming to the "k8s.node.name"
+ // semantic conventions. It represents the name of the Node.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'node-1'
+ K8SNodeNameKey = attribute.Key("k8s.node.name")
+
+ // K8SNodeUIDKey is the attribute Key conforming to the "k8s.node.uid"
+ // semantic conventions. It represents the UID of the Node.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '1eb3a0c6-0477-4080-a9cb-0cb7db65c6a2'
+ K8SNodeUIDKey = attribute.Key("k8s.node.uid")
+
+ // K8SPodNameKey is the attribute Key conforming to the "k8s.pod.name"
+ // semantic conventions. It represents the name of the Pod.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry-pod-autoconf'
+ K8SPodNameKey = attribute.Key("k8s.pod.name")
+
+ // K8SPodUIDKey is the attribute Key conforming to the "k8s.pod.uid"
+ // semantic conventions. It represents the UID of the Pod.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
+ K8SPodUIDKey = attribute.Key("k8s.pod.uid")
+
+ // K8SReplicaSetNameKey is the attribute Key conforming to the
+ // "k8s.replicaset.name" semantic conventions. It represents the name of
+ // the ReplicaSet.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry'
+ K8SReplicaSetNameKey = attribute.Key("k8s.replicaset.name")
+
+ // K8SReplicaSetUIDKey is the attribute Key conforming to the
+ // "k8s.replicaset.uid" semantic conventions. It represents the UID of the
+ // ReplicaSet.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
+ K8SReplicaSetUIDKey = attribute.Key("k8s.replicaset.uid")
+
+ // K8SStatefulSetNameKey is the attribute Key conforming to the
+ // "k8s.statefulset.name" semantic conventions. It represents the name of
+ // the StatefulSet.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry'
+ K8SStatefulSetNameKey = attribute.Key("k8s.statefulset.name")
+
+ // K8SStatefulSetUIDKey is the attribute Key conforming to the
+ // "k8s.statefulset.uid" semantic conventions. It represents the UID of the
+ // StatefulSet.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff'
+ K8SStatefulSetUIDKey = attribute.Key("k8s.statefulset.uid")
+)
+
+// K8SClusterName returns an attribute KeyValue conforming to the
+// "k8s.cluster.name" semantic conventions. It represents the name of the
+// cluster.
+func K8SClusterName(val string) attribute.KeyValue {
+ return K8SClusterNameKey.String(val)
+}
+
+// K8SClusterUID returns an attribute KeyValue conforming to the
+// "k8s.cluster.uid" semantic conventions. It represents a pseudo-ID for the
+// cluster, set to the UID of the `kube-system` namespace.
+func K8SClusterUID(val string) attribute.KeyValue {
+ return K8SClusterUIDKey.String(val)
+}
+
+// K8SContainerName returns an attribute KeyValue conforming to the
+// "k8s.container.name" semantic conventions. It represents the name of the
+// Container from Pod specification, must be unique within a Pod. Container
+// runtime usually uses different globally unique name (`container.name`).
+func K8SContainerName(val string) attribute.KeyValue {
+ return K8SContainerNameKey.String(val)
+}
+
+// K8SContainerRestartCount returns an attribute KeyValue conforming to the
+// "k8s.container.restart_count" semantic conventions. It represents the number
+// of times the container was restarted. This attribute can be used to identify
+// a particular container (running or stopped) within a container spec.
+func K8SContainerRestartCount(val int) attribute.KeyValue {
+ return K8SContainerRestartCountKey.Int(val)
+}
+
+// K8SContainerStatusLastTerminatedReason returns an attribute KeyValue
+// conforming to the "k8s.container.status.last_terminated_reason" semantic
+// conventions. It represents the last terminated reason of the Container.
+func K8SContainerStatusLastTerminatedReason(val string) attribute.KeyValue {
+ return K8SContainerStatusLastTerminatedReasonKey.String(val)
+}
+
+// K8SCronJobName returns an attribute KeyValue conforming to the
+// "k8s.cronjob.name" semantic conventions. It represents the name of the
+// CronJob.
+func K8SCronJobName(val string) attribute.KeyValue {
+ return K8SCronJobNameKey.String(val)
+}
+
+// K8SCronJobUID returns an attribute KeyValue conforming to the
+// "k8s.cronjob.uid" semantic conventions. It represents the UID of the
+// CronJob.
+func K8SCronJobUID(val string) attribute.KeyValue {
+ return K8SCronJobUIDKey.String(val)
+}
+
+// K8SDaemonSetName returns an attribute KeyValue conforming to the
+// "k8s.daemonset.name" semantic conventions. It represents the name of the
+// DaemonSet.
+func K8SDaemonSetName(val string) attribute.KeyValue {
+ return K8SDaemonSetNameKey.String(val)
+}
+
+// K8SDaemonSetUID returns an attribute KeyValue conforming to the
+// "k8s.daemonset.uid" semantic conventions. It represents the UID of the
+// DaemonSet.
+func K8SDaemonSetUID(val string) attribute.KeyValue {
+ return K8SDaemonSetUIDKey.String(val)
+}
+
+// K8SDeploymentName returns an attribute KeyValue conforming to the
+// "k8s.deployment.name" semantic conventions. It represents the name of the
+// Deployment.
+func K8SDeploymentName(val string) attribute.KeyValue {
+ return K8SDeploymentNameKey.String(val)
+}
+
+// K8SDeploymentUID returns an attribute KeyValue conforming to the
+// "k8s.deployment.uid" semantic conventions. It represents the UID of the
+// Deployment.
+func K8SDeploymentUID(val string) attribute.KeyValue {
+ return K8SDeploymentUIDKey.String(val)
+}
+
+// K8SJobName returns an attribute KeyValue conforming to the "k8s.job.name"
+// semantic conventions. It represents the name of the Job.
+func K8SJobName(val string) attribute.KeyValue {
+ return K8SJobNameKey.String(val)
+}
+
+// K8SJobUID returns an attribute KeyValue conforming to the "k8s.job.uid"
+// semantic conventions. It represents the UID of the Job.
+func K8SJobUID(val string) attribute.KeyValue {
+ return K8SJobUIDKey.String(val)
+}
+
+// K8SNamespaceName returns an attribute KeyValue conforming to the
+// "k8s.namespace.name" semantic conventions. It represents the name of the
+// namespace that the pod is running in.
+func K8SNamespaceName(val string) attribute.KeyValue {
+ return K8SNamespaceNameKey.String(val)
+}
+
+// K8SNodeName returns an attribute KeyValue conforming to the
+// "k8s.node.name" semantic conventions. It represents the name of the Node.
+func K8SNodeName(val string) attribute.KeyValue {
+ return K8SNodeNameKey.String(val)
+}
+
+// K8SNodeUID returns an attribute KeyValue conforming to the "k8s.node.uid"
+// semantic conventions. It represents the UID of the Node.
+func K8SNodeUID(val string) attribute.KeyValue {
+ return K8SNodeUIDKey.String(val)
+}
+
+// K8SPodName returns an attribute KeyValue conforming to the "k8s.pod.name"
+// semantic conventions. It represents the name of the Pod.
+func K8SPodName(val string) attribute.KeyValue {
+ return K8SPodNameKey.String(val)
+}
+
+// K8SPodUID returns an attribute KeyValue conforming to the "k8s.pod.uid"
+// semantic conventions. It represents the UID of the Pod.
+func K8SPodUID(val string) attribute.KeyValue {
+ return K8SPodUIDKey.String(val)
+}
+
+// K8SReplicaSetName returns an attribute KeyValue conforming to the
+// "k8s.replicaset.name" semantic conventions. It represents the name of the
+// ReplicaSet.
+func K8SReplicaSetName(val string) attribute.KeyValue {
+ return K8SReplicaSetNameKey.String(val)
+}
+
+// K8SReplicaSetUID returns an attribute KeyValue conforming to the
+// "k8s.replicaset.uid" semantic conventions. It represents the UID of the
+// ReplicaSet.
+func K8SReplicaSetUID(val string) attribute.KeyValue {
+ return K8SReplicaSetUIDKey.String(val)
+}
+
+// K8SStatefulSetName returns an attribute KeyValue conforming to the
+// "k8s.statefulset.name" semantic conventions. It represents the name of the
+// StatefulSet.
+func K8SStatefulSetName(val string) attribute.KeyValue {
+ return K8SStatefulSetNameKey.String(val)
+}
+
+// K8SStatefulSetUID returns an attribute KeyValue conforming to the
+// "k8s.statefulset.uid" semantic conventions. It represents the UID of the
+// StatefulSet.
+func K8SStatefulSetUID(val string) attribute.KeyValue {
+ return K8SStatefulSetUIDKey.String(val)
+}
+
+// Log attributes
+const (
+ // LogIostreamKey is the attribute Key conforming to the "log.iostream"
+ // semantic conventions. It represents the stream associated with the log.
+ // See below for a list of well-known values.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ LogIostreamKey = attribute.Key("log.iostream")
+)
+
+var (
+ // Logs from stdout stream
+ LogIostreamStdout = LogIostreamKey.String("stdout")
+ // Events from stderr stream
+ LogIostreamStderr = LogIostreamKey.String("stderr")
+)
+
+// Attributes for a file to which log was emitted.
+const (
+ // LogFileNameKey is the attribute Key conforming to the "log.file.name"
+ // semantic conventions. It represents the basename of the file.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'audit.log'
+ LogFileNameKey = attribute.Key("log.file.name")
+
+ // LogFileNameResolvedKey is the attribute Key conforming to the
+ // "log.file.name_resolved" semantic conventions. It represents the
+ // basename of the file, with symlinks resolved.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'uuid.log'
+ LogFileNameResolvedKey = attribute.Key("log.file.name_resolved")
+
+ // LogFilePathKey is the attribute Key conforming to the "log.file.path"
+ // semantic conventions. It represents the full path to the file.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/var/log/mysql/audit.log'
+ LogFilePathKey = attribute.Key("log.file.path")
+
+ // LogFilePathResolvedKey is the attribute Key conforming to the
+ // "log.file.path_resolved" semantic conventions. It represents the full
+ // path to the file, with symlinks resolved.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/var/lib/docker/uuid.log'
+ LogFilePathResolvedKey = attribute.Key("log.file.path_resolved")
+)
+
+// LogFileName returns an attribute KeyValue conforming to the
+// "log.file.name" semantic conventions. It represents the basename of the
+// file.
+func LogFileName(val string) attribute.KeyValue {
+ return LogFileNameKey.String(val)
+}
+
+// LogFileNameResolved returns an attribute KeyValue conforming to the
+// "log.file.name_resolved" semantic conventions. It represents the basename of
+// the file, with symlinks resolved.
+func LogFileNameResolved(val string) attribute.KeyValue {
+ return LogFileNameResolvedKey.String(val)
+}
+
+// LogFilePath returns an attribute KeyValue conforming to the
+// "log.file.path" semantic conventions. It represents the full path to the
+// file.
+func LogFilePath(val string) attribute.KeyValue {
+ return LogFilePathKey.String(val)
+}
+
+// LogFilePathResolved returns an attribute KeyValue conforming to the
+// "log.file.path_resolved" semantic conventions. It represents the full path
+// to the file, with symlinks resolved.
+func LogFilePathResolved(val string) attribute.KeyValue {
+ return LogFilePathResolvedKey.String(val)
+}
+
+// The generic attributes that may be used in any Log Record.
+const (
+ // LogRecordUIDKey is the attribute Key conforming to the "log.record.uid"
+ // semantic conventions. It represents a unique identifier for the Log
+ // Record.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '01ARZ3NDEKTSV4RRFFQ69G5FAV'
+ // Note: If an id is provided, other log records with the same id will be
+ // considered duplicates and can be removed safely. This means, that two
+ // distinguishable log records MUST have different values.
+ // The id MAY be an [Universally Unique Lexicographically Sortable
+ // Identifier (ULID)](https://github.com/ulid/spec), but other identifiers
+ // (e.g. UUID) may be used as needed.
+ LogRecordUIDKey = attribute.Key("log.record.uid")
+)
+
+// LogRecordUID returns an attribute KeyValue conforming to the
+// "log.record.uid" semantic conventions. It represents a unique identifier for
+// the Log Record.
+func LogRecordUID(val string) attribute.KeyValue {
+ return LogRecordUIDKey.String(val)
+}
+
+// Attributes describing telemetry around messaging systems and messaging
+// activities.
+const (
+ // MessagingBatchMessageCountKey is the attribute Key conforming to the
+ // "messaging.batch.message_count" semantic conventions. It represents the
+ // number of messages sent, received, or processed in the scope of the
+ // batching operation.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 0, 1, 2
+ // Note: Instrumentations SHOULD NOT set `messaging.batch.message_count` on
+ // spans that operate with a single message. When a messaging client
+ // library supports both batch and single-message API for the same
+ // operation, instrumentations SHOULD use `messaging.batch.message_count`
+ // for batching APIs and SHOULD NOT use it for single-message APIs.
+ MessagingBatchMessageCountKey = attribute.Key("messaging.batch.message_count")
+
+ // MessagingClientIDKey is the attribute Key conforming to the
+ // "messaging.client.id" semantic conventions. It represents a unique
+ // identifier for the client that consumes or produces a message.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'client-5', 'myhost@8742@s8083jm'
+ MessagingClientIDKey = attribute.Key("messaging.client.id")
+
+ // MessagingDestinationAnonymousKey is the attribute Key conforming to the
+ // "messaging.destination.anonymous" semantic conventions. It represents a
+ // boolean that is true if the message destination is anonymous (could be
+ // unnamed or have auto-generated name).
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessagingDestinationAnonymousKey = attribute.Key("messaging.destination.anonymous")
+
+ // MessagingDestinationNameKey is the attribute Key conforming to the
+ // "messaging.destination.name" semantic conventions. It represents the
+ // message destination name
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'MyQueue', 'MyTopic'
+ // Note: Destination name SHOULD uniquely identify a specific queue, topic
+ // or other entity within the broker. If
+ // the broker doesn't have such notion, the destination name SHOULD
+ // uniquely identify the broker.
+ MessagingDestinationNameKey = attribute.Key("messaging.destination.name")
+
+ // MessagingDestinationPartitionIDKey is the attribute Key conforming to
+ // the "messaging.destination.partition.id" semantic conventions. It
+ // represents the identifier of the partition messages are sent to or
+ // received from, unique within the `messaging.destination.name`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '1'
+ MessagingDestinationPartitionIDKey = attribute.Key("messaging.destination.partition.id")
+
+ // MessagingDestinationTemplateKey is the attribute Key conforming to the
+ // "messaging.destination.template" semantic conventions. It represents the
+ // low cardinality representation of the messaging destination name
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/customers/{customerID}'
+ // Note: Destination names could be constructed from templates. An example
+ // would be a destination name involving a user name or product id.
+ // Although the destination name in this case is of high cardinality, the
+ // underlying template is of low cardinality and can be effectively used
+ // for grouping and aggregation.
+ MessagingDestinationTemplateKey = attribute.Key("messaging.destination.template")
+
+ // MessagingDestinationTemporaryKey is the attribute Key conforming to the
+ // "messaging.destination.temporary" semantic conventions. It represents a
+ // boolean that is true if the message destination is temporary and might
+ // not exist anymore after messages are processed.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessagingDestinationTemporaryKey = attribute.Key("messaging.destination.temporary")
+
+ // MessagingDestinationPublishAnonymousKey is the attribute Key conforming
+ // to the "messaging.destination_publish.anonymous" semantic conventions.
+ // It represents a boolean that is true if the publish message destination
+ // is anonymous (could be unnamed or have auto-generated name).
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessagingDestinationPublishAnonymousKey = attribute.Key("messaging.destination_publish.anonymous")
+
+ // MessagingDestinationPublishNameKey is the attribute Key conforming to
+ // the "messaging.destination_publish.name" semantic conventions. It
+ // represents the name of the original destination the message was
+ // published to
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'MyQueue', 'MyTopic'
+ // Note: The name SHOULD uniquely identify a specific queue, topic, or
+ // other entity within the broker. If
+ // the broker doesn't have such notion, the original destination name
+ // SHOULD uniquely identify the broker.
+ MessagingDestinationPublishNameKey = attribute.Key("messaging.destination_publish.name")
+
+ // MessagingMessageBodySizeKey is the attribute Key conforming to the
+ // "messaging.message.body.size" semantic conventions. It represents the
+ // size of the message body in bytes.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1439
+ // Note: This can refer to both the compressed or uncompressed body size.
+ // If both sizes are known, the uncompressed
+ // body size should be used.
+ MessagingMessageBodySizeKey = attribute.Key("messaging.message.body.size")
+
+ // MessagingMessageConversationIDKey is the attribute Key conforming to the
+ // "messaging.message.conversation_id" semantic conventions. It represents
+ // the conversation ID identifying the conversation to which the message
+ // belongs, represented as a string. Sometimes called "Correlation ID".
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'MyConversationID'
+ MessagingMessageConversationIDKey = attribute.Key("messaging.message.conversation_id")
+
+ // MessagingMessageEnvelopeSizeKey is the attribute Key conforming to the
+ // "messaging.message.envelope.size" semantic conventions. It represents
+ // the size of the message body and metadata in bytes.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 2738
+ // Note: This can refer to both the compressed or uncompressed size. If
+ // both sizes are known, the uncompressed
+ // size should be used.
+ MessagingMessageEnvelopeSizeKey = attribute.Key("messaging.message.envelope.size")
+
+ // MessagingMessageIDKey is the attribute Key conforming to the
+ // "messaging.message.id" semantic conventions. It represents a value used
+ // by the messaging system as an identifier for the message, represented as
+ // a string.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '452a7c7c7c7048c2f887f61572b18fc2'
+ MessagingMessageIDKey = attribute.Key("messaging.message.id")
+
+ // MessagingOperationNameKey is the attribute Key conforming to the
+ // "messaging.operation.name" semantic conventions. It represents the
+ // system-specific name of the messaging operation.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'ack', 'nack', 'send'
+ MessagingOperationNameKey = attribute.Key("messaging.operation.name")
+
+ // MessagingOperationTypeKey is the attribute Key conforming to the
+ // "messaging.operation.type" semantic conventions. It represents a string
+ // identifying the type of the messaging operation.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Note: If a custom value is used, it MUST be of low cardinality.
+ MessagingOperationTypeKey = attribute.Key("messaging.operation.type")
+
+ // MessagingSystemKey is the attribute Key conforming to the
+ // "messaging.system" semantic conventions. It represents the messaging
+ // system as identified by the client instrumentation.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Note: The actual messaging system may differ from the one known by the
+ // client. For example, when using Kafka client libraries to communicate
+ // with Azure Event Hubs, the `messaging.system` is set to `kafka` based on
+ // the instrumentation's best knowledge.
+ MessagingSystemKey = attribute.Key("messaging.system")
+)
+
+var (
+ // One or more messages are provided for publishing to an intermediary. If a single message is published, the context of the "Publish" span can be used as the creation context and no "Create" span needs to be created
+ MessagingOperationTypePublish = MessagingOperationTypeKey.String("publish")
+ // A message is created. "Create" spans always refer to a single message and are used to provide a unique creation context for messages in batch publishing scenarios
+ MessagingOperationTypeCreate = MessagingOperationTypeKey.String("create")
+ // One or more messages are requested by a consumer. This operation refers to pull-based scenarios, where consumers explicitly call methods of messaging SDKs to receive messages
+ MessagingOperationTypeReceive = MessagingOperationTypeKey.String("receive")
+ // One or more messages are delivered to or processed by a consumer
+ MessagingOperationTypeDeliver = MessagingOperationTypeKey.String("process")
+ // One or more messages are settled
+ MessagingOperationTypeSettle = MessagingOperationTypeKey.String("settle")
+)
+
+var (
+ // Apache ActiveMQ
+ MessagingSystemActivemq = MessagingSystemKey.String("activemq")
+ // Amazon Simple Queue Service (SQS)
+ MessagingSystemAWSSqs = MessagingSystemKey.String("aws_sqs")
+ // Azure Event Grid
+ MessagingSystemEventgrid = MessagingSystemKey.String("eventgrid")
+ // Azure Event Hubs
+ MessagingSystemEventhubs = MessagingSystemKey.String("eventhubs")
+ // Azure Service Bus
+ MessagingSystemServicebus = MessagingSystemKey.String("servicebus")
+ // Google Cloud Pub/Sub
+ MessagingSystemGCPPubsub = MessagingSystemKey.String("gcp_pubsub")
+ // Java Message Service
+ MessagingSystemJms = MessagingSystemKey.String("jms")
+ // Apache Kafka
+ MessagingSystemKafka = MessagingSystemKey.String("kafka")
+ // RabbitMQ
+ MessagingSystemRabbitmq = MessagingSystemKey.String("rabbitmq")
+ // Apache RocketMQ
+ MessagingSystemRocketmq = MessagingSystemKey.String("rocketmq")
+)
+
+// MessagingBatchMessageCount returns an attribute KeyValue conforming to
+// the "messaging.batch.message_count" semantic conventions. It represents the
+// number of messages sent, received, or processed in the scope of the batching
+// operation.
+func MessagingBatchMessageCount(val int) attribute.KeyValue {
+ return MessagingBatchMessageCountKey.Int(val)
+}
+
+// MessagingClientID returns an attribute KeyValue conforming to the
+// "messaging.client.id" semantic conventions. It represents a unique
+// identifier for the client that consumes or produces a message.
+func MessagingClientID(val string) attribute.KeyValue {
+ return MessagingClientIDKey.String(val)
+}
+
+// MessagingDestinationAnonymous returns an attribute KeyValue conforming to
+// the "messaging.destination.anonymous" semantic conventions. It represents a
+// boolean that is true if the message destination is anonymous (could be
+// unnamed or have auto-generated name).
+func MessagingDestinationAnonymous(val bool) attribute.KeyValue {
+ return MessagingDestinationAnonymousKey.Bool(val)
+}
+
+// MessagingDestinationName returns an attribute KeyValue conforming to the
+// "messaging.destination.name" semantic conventions. It represents the message
+// destination name
+func MessagingDestinationName(val string) attribute.KeyValue {
+ return MessagingDestinationNameKey.String(val)
+}
+
+// MessagingDestinationPartitionID returns an attribute KeyValue conforming
+// to the "messaging.destination.partition.id" semantic conventions. It
+// represents the identifier of the partition messages are sent to or received
+// from, unique within the `messaging.destination.name`.
+func MessagingDestinationPartitionID(val string) attribute.KeyValue {
+ return MessagingDestinationPartitionIDKey.String(val)
+}
+
+// MessagingDestinationTemplate returns an attribute KeyValue conforming to
+// the "messaging.destination.template" semantic conventions. It represents the
+// low cardinality representation of the messaging destination name
+func MessagingDestinationTemplate(val string) attribute.KeyValue {
+ return MessagingDestinationTemplateKey.String(val)
+}
+
+// MessagingDestinationTemporary returns an attribute KeyValue conforming to
+// the "messaging.destination.temporary" semantic conventions. It represents a
+// boolean that is true if the message destination is temporary and might not
+// exist anymore after messages are processed.
+func MessagingDestinationTemporary(val bool) attribute.KeyValue {
+ return MessagingDestinationTemporaryKey.Bool(val)
+}
+
+// MessagingDestinationPublishAnonymous returns an attribute KeyValue
+// conforming to the "messaging.destination_publish.anonymous" semantic
+// conventions. It represents a boolean that is true if the publish message
+// destination is anonymous (could be unnamed or have auto-generated name).
+func MessagingDestinationPublishAnonymous(val bool) attribute.KeyValue {
+ return MessagingDestinationPublishAnonymousKey.Bool(val)
+}
+
+// MessagingDestinationPublishName returns an attribute KeyValue conforming
+// to the "messaging.destination_publish.name" semantic conventions. It
+// represents the name of the original destination the message was published to
+func MessagingDestinationPublishName(val string) attribute.KeyValue {
+ return MessagingDestinationPublishNameKey.String(val)
+}
+
+// MessagingMessageBodySize returns an attribute KeyValue conforming to the
+// "messaging.message.body.size" semantic conventions. It represents the size
+// of the message body in bytes.
+func MessagingMessageBodySize(val int) attribute.KeyValue {
+ return MessagingMessageBodySizeKey.Int(val)
+}
+
+// MessagingMessageConversationID returns an attribute KeyValue conforming
+// to the "messaging.message.conversation_id" semantic conventions. It
+// represents the conversation ID identifying the conversation to which the
+// message belongs, represented as a string. Sometimes called "Correlation ID".
+func MessagingMessageConversationID(val string) attribute.KeyValue {
+ return MessagingMessageConversationIDKey.String(val)
+}
+
+// MessagingMessageEnvelopeSize returns an attribute KeyValue conforming to
+// the "messaging.message.envelope.size" semantic conventions. It represents
+// the size of the message body and metadata in bytes.
+func MessagingMessageEnvelopeSize(val int) attribute.KeyValue {
+ return MessagingMessageEnvelopeSizeKey.Int(val)
+}
+
+// MessagingMessageID returns an attribute KeyValue conforming to the
+// "messaging.message.id" semantic conventions. It represents a value used by
+// the messaging system as an identifier for the message, represented as a
+// string.
+func MessagingMessageID(val string) attribute.KeyValue {
+ return MessagingMessageIDKey.String(val)
+}
+
+// MessagingOperationName returns an attribute KeyValue conforming to the
+// "messaging.operation.name" semantic conventions. It represents the
+// system-specific name of the messaging operation.
+func MessagingOperationName(val string) attribute.KeyValue {
+ return MessagingOperationNameKey.String(val)
+}
+
+// This group describes attributes specific to Apache Kafka.
+const (
+ // MessagingKafkaConsumerGroupKey is the attribute Key conforming to the
+ // "messaging.kafka.consumer.group" semantic conventions. It represents the
+ // name of the Kafka Consumer Group that is handling the message. Only
+ // applies to consumers, not producers.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'my-group'
+ MessagingKafkaConsumerGroupKey = attribute.Key("messaging.kafka.consumer.group")
+
+ // MessagingKafkaMessageKeyKey is the attribute Key conforming to the
+ // "messaging.kafka.message.key" semantic conventions. It represents the
+ // message keys in Kafka are used for grouping alike messages to ensure
+ // they're processed on the same partition. They differ from
+ // `messaging.message.id` in that they're not unique. If the key is `null`,
+ // the attribute MUST NOT be set.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myKey'
+ // Note: If the key type is not string, it's string representation has to
+ // be supplied for the attribute. If the key has no unambiguous, canonical
+ // string form, don't include its value.
+ MessagingKafkaMessageKeyKey = attribute.Key("messaging.kafka.message.key")
+
+ // MessagingKafkaMessageOffsetKey is the attribute Key conforming to the
+ // "messaging.kafka.message.offset" semantic conventions. It represents the
+ // offset of a record in the corresponding Kafka partition.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 42
+ MessagingKafkaMessageOffsetKey = attribute.Key("messaging.kafka.message.offset")
+
+ // MessagingKafkaMessageTombstoneKey is the attribute Key conforming to the
+ // "messaging.kafka.message.tombstone" semantic conventions. It represents
+ // a boolean that is true if the message is a tombstone.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessagingKafkaMessageTombstoneKey = attribute.Key("messaging.kafka.message.tombstone")
+)
+
+// MessagingKafkaConsumerGroup returns an attribute KeyValue conforming to
+// the "messaging.kafka.consumer.group" semantic conventions. It represents the
+// name of the Kafka Consumer Group that is handling the message. Only applies
+// to consumers, not producers.
+func MessagingKafkaConsumerGroup(val string) attribute.KeyValue {
+ return MessagingKafkaConsumerGroupKey.String(val)
+}
+
+// MessagingKafkaMessageKey returns an attribute KeyValue conforming to the
+// "messaging.kafka.message.key" semantic conventions. It represents the
+// message keys in Kafka are used for grouping alike messages to ensure they're
+// processed on the same partition. They differ from `messaging.message.id` in
+// that they're not unique. If the key is `null`, the attribute MUST NOT be
+// set.
+func MessagingKafkaMessageKey(val string) attribute.KeyValue {
+ return MessagingKafkaMessageKeyKey.String(val)
+}
+
+// MessagingKafkaMessageOffset returns an attribute KeyValue conforming to
+// the "messaging.kafka.message.offset" semantic conventions. It represents the
+// offset of a record in the corresponding Kafka partition.
+func MessagingKafkaMessageOffset(val int) attribute.KeyValue {
+ return MessagingKafkaMessageOffsetKey.Int(val)
+}
+
+// MessagingKafkaMessageTombstone returns an attribute KeyValue conforming
+// to the "messaging.kafka.message.tombstone" semantic conventions. It
+// represents a boolean that is true if the message is a tombstone.
+func MessagingKafkaMessageTombstone(val bool) attribute.KeyValue {
+ return MessagingKafkaMessageTombstoneKey.Bool(val)
+}
+
+// This group describes attributes specific to RabbitMQ.
+const (
+ // MessagingRabbitmqDestinationRoutingKeyKey is the attribute Key
+ // conforming to the "messaging.rabbitmq.destination.routing_key" semantic
+ // conventions. It represents the rabbitMQ message routing key.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myKey'
+ MessagingRabbitmqDestinationRoutingKeyKey = attribute.Key("messaging.rabbitmq.destination.routing_key")
+
+ // MessagingRabbitmqMessageDeliveryTagKey is the attribute Key conforming
+ // to the "messaging.rabbitmq.message.delivery_tag" semantic conventions.
+ // It represents the rabbitMQ message delivery tag
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 123
+ MessagingRabbitmqMessageDeliveryTagKey = attribute.Key("messaging.rabbitmq.message.delivery_tag")
+)
+
+// MessagingRabbitmqDestinationRoutingKey returns an attribute KeyValue
+// conforming to the "messaging.rabbitmq.destination.routing_key" semantic
+// conventions. It represents the rabbitMQ message routing key.
+func MessagingRabbitmqDestinationRoutingKey(val string) attribute.KeyValue {
+ return MessagingRabbitmqDestinationRoutingKeyKey.String(val)
+}
+
+// MessagingRabbitmqMessageDeliveryTag returns an attribute KeyValue
+// conforming to the "messaging.rabbitmq.message.delivery_tag" semantic
+// conventions. It represents the rabbitMQ message delivery tag
+func MessagingRabbitmqMessageDeliveryTag(val int) attribute.KeyValue {
+ return MessagingRabbitmqMessageDeliveryTagKey.Int(val)
+}
+
+// This group describes attributes specific to RocketMQ.
+const (
+ // MessagingRocketmqClientGroupKey is the attribute Key conforming to the
+ // "messaging.rocketmq.client_group" semantic conventions. It represents
+ // the name of the RocketMQ producer/consumer group that is handling the
+ // message. The client type is identified by the SpanKind.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myConsumerGroup'
+ MessagingRocketmqClientGroupKey = attribute.Key("messaging.rocketmq.client_group")
+
+ // MessagingRocketmqConsumptionModelKey is the attribute Key conforming to
+ // the "messaging.rocketmq.consumption_model" semantic conventions. It
+ // represents the model of message consumption. This only applies to
+ // consumer spans.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessagingRocketmqConsumptionModelKey = attribute.Key("messaging.rocketmq.consumption_model")
+
+ // MessagingRocketmqMessageDelayTimeLevelKey is the attribute Key
+ // conforming to the "messaging.rocketmq.message.delay_time_level" semantic
+ // conventions. It represents the delay time level for delay message, which
+ // determines the message delay time.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 3
+ MessagingRocketmqMessageDelayTimeLevelKey = attribute.Key("messaging.rocketmq.message.delay_time_level")
+
+ // MessagingRocketmqMessageDeliveryTimestampKey is the attribute Key
+ // conforming to the "messaging.rocketmq.message.delivery_timestamp"
+ // semantic conventions. It represents the timestamp in milliseconds that
+ // the delay message is expected to be delivered to consumer.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1665987217045
+ MessagingRocketmqMessageDeliveryTimestampKey = attribute.Key("messaging.rocketmq.message.delivery_timestamp")
+
+ // MessagingRocketmqMessageGroupKey is the attribute Key conforming to the
+ // "messaging.rocketmq.message.group" semantic conventions. It represents
+ // the it is essential for FIFO message. Messages that belong to the same
+ // message group are always processed one by one within the same consumer
+ // group.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myMessageGroup'
+ MessagingRocketmqMessageGroupKey = attribute.Key("messaging.rocketmq.message.group")
+
+ // MessagingRocketmqMessageKeysKey is the attribute Key conforming to the
+ // "messaging.rocketmq.message.keys" semantic conventions. It represents
+ // the key(s) of message, another way to mark message besides message id.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'keyA', 'keyB'
+ MessagingRocketmqMessageKeysKey = attribute.Key("messaging.rocketmq.message.keys")
+
+ // MessagingRocketmqMessageTagKey is the attribute Key conforming to the
+ // "messaging.rocketmq.message.tag" semantic conventions. It represents the
+ // secondary classifier of message besides topic.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'tagA'
+ MessagingRocketmqMessageTagKey = attribute.Key("messaging.rocketmq.message.tag")
+
+ // MessagingRocketmqMessageTypeKey is the attribute Key conforming to the
+ // "messaging.rocketmq.message.type" semantic conventions. It represents
+ // the type of message.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessagingRocketmqMessageTypeKey = attribute.Key("messaging.rocketmq.message.type")
+
+ // MessagingRocketmqNamespaceKey is the attribute Key conforming to the
+ // "messaging.rocketmq.namespace" semantic conventions. It represents the
+ // namespace of RocketMQ resources, resources in different namespaces are
+ // individual.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myNamespace'
+ MessagingRocketmqNamespaceKey = attribute.Key("messaging.rocketmq.namespace")
+)
+
+var (
+ // Clustering consumption model
+ MessagingRocketmqConsumptionModelClustering = MessagingRocketmqConsumptionModelKey.String("clustering")
+ // Broadcasting consumption model
+ MessagingRocketmqConsumptionModelBroadcasting = MessagingRocketmqConsumptionModelKey.String("broadcasting")
+)
+
+var (
+ // Normal message
+ MessagingRocketmqMessageTypeNormal = MessagingRocketmqMessageTypeKey.String("normal")
+ // FIFO message
+ MessagingRocketmqMessageTypeFifo = MessagingRocketmqMessageTypeKey.String("fifo")
+ // Delay message
+ MessagingRocketmqMessageTypeDelay = MessagingRocketmqMessageTypeKey.String("delay")
+ // Transaction message
+ MessagingRocketmqMessageTypeTransaction = MessagingRocketmqMessageTypeKey.String("transaction")
+)
+
+// MessagingRocketmqClientGroup returns an attribute KeyValue conforming to
+// the "messaging.rocketmq.client_group" semantic conventions. It represents
+// the name of the RocketMQ producer/consumer group that is handling the
+// message. The client type is identified by the SpanKind.
+func MessagingRocketmqClientGroup(val string) attribute.KeyValue {
+ return MessagingRocketmqClientGroupKey.String(val)
+}
+
+// MessagingRocketmqMessageDelayTimeLevel returns an attribute KeyValue
+// conforming to the "messaging.rocketmq.message.delay_time_level" semantic
+// conventions. It represents the delay time level for delay message, which
+// determines the message delay time.
+func MessagingRocketmqMessageDelayTimeLevel(val int) attribute.KeyValue {
+ return MessagingRocketmqMessageDelayTimeLevelKey.Int(val)
+}
+
+// MessagingRocketmqMessageDeliveryTimestamp returns an attribute KeyValue
+// conforming to the "messaging.rocketmq.message.delivery_timestamp" semantic
+// conventions. It represents the timestamp in milliseconds that the delay
+// message is expected to be delivered to consumer.
+func MessagingRocketmqMessageDeliveryTimestamp(val int) attribute.KeyValue {
+ return MessagingRocketmqMessageDeliveryTimestampKey.Int(val)
+}
+
+// MessagingRocketmqMessageGroup returns an attribute KeyValue conforming to
+// the "messaging.rocketmq.message.group" semantic conventions. It represents
+// the it is essential for FIFO message. Messages that belong to the same
+// message group are always processed one by one within the same consumer
+// group.
+func MessagingRocketmqMessageGroup(val string) attribute.KeyValue {
+ return MessagingRocketmqMessageGroupKey.String(val)
+}
+
+// MessagingRocketmqMessageKeys returns an attribute KeyValue conforming to
+// the "messaging.rocketmq.message.keys" semantic conventions. It represents
+// the key(s) of message, another way to mark message besides message id.
+func MessagingRocketmqMessageKeys(val ...string) attribute.KeyValue {
+ return MessagingRocketmqMessageKeysKey.StringSlice(val)
+}
+
+// MessagingRocketmqMessageTag returns an attribute KeyValue conforming to
+// the "messaging.rocketmq.message.tag" semantic conventions. It represents the
+// secondary classifier of message besides topic.
+func MessagingRocketmqMessageTag(val string) attribute.KeyValue {
+ return MessagingRocketmqMessageTagKey.String(val)
+}
+
+// MessagingRocketmqNamespace returns an attribute KeyValue conforming to
+// the "messaging.rocketmq.namespace" semantic conventions. It represents the
+// namespace of RocketMQ resources, resources in different namespaces are
+// individual.
+func MessagingRocketmqNamespace(val string) attribute.KeyValue {
+ return MessagingRocketmqNamespaceKey.String(val)
+}
+
+// This group describes attributes specific to GCP Pub/Sub.
+const (
+ // MessagingGCPPubsubMessageAckDeadlineKey is the attribute Key conforming
+ // to the "messaging.gcp_pubsub.message.ack_deadline" semantic conventions.
+ // It represents the ack deadline in seconds set for the modify ack
+ // deadline request.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 10
+ MessagingGCPPubsubMessageAckDeadlineKey = attribute.Key("messaging.gcp_pubsub.message.ack_deadline")
+
+ // MessagingGCPPubsubMessageAckIDKey is the attribute Key conforming to the
+ // "messaging.gcp_pubsub.message.ack_id" semantic conventions. It
+ // represents the ack id for a given message.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'ack_id'
+ MessagingGCPPubsubMessageAckIDKey = attribute.Key("messaging.gcp_pubsub.message.ack_id")
+
+ // MessagingGCPPubsubMessageDeliveryAttemptKey is the attribute Key
+ // conforming to the "messaging.gcp_pubsub.message.delivery_attempt"
+ // semantic conventions. It represents the delivery attempt for a given
+ // message.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 2
+ MessagingGCPPubsubMessageDeliveryAttemptKey = attribute.Key("messaging.gcp_pubsub.message.delivery_attempt")
+
+ // MessagingGCPPubsubMessageOrderingKeyKey is the attribute Key conforming
+ // to the "messaging.gcp_pubsub.message.ordering_key" semantic conventions.
+ // It represents the ordering key for a given message. If the attribute is
+ // not present, the message does not have an ordering key.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'ordering_key'
+ MessagingGCPPubsubMessageOrderingKeyKey = attribute.Key("messaging.gcp_pubsub.message.ordering_key")
+)
+
+// MessagingGCPPubsubMessageAckDeadline returns an attribute KeyValue
+// conforming to the "messaging.gcp_pubsub.message.ack_deadline" semantic
+// conventions. It represents the ack deadline in seconds set for the modify
+// ack deadline request.
+func MessagingGCPPubsubMessageAckDeadline(val int) attribute.KeyValue {
+ return MessagingGCPPubsubMessageAckDeadlineKey.Int(val)
+}
+
+// MessagingGCPPubsubMessageAckID returns an attribute KeyValue conforming
+// to the "messaging.gcp_pubsub.message.ack_id" semantic conventions. It
+// represents the ack id for a given message.
+func MessagingGCPPubsubMessageAckID(val string) attribute.KeyValue {
+ return MessagingGCPPubsubMessageAckIDKey.String(val)
+}
+
+// MessagingGCPPubsubMessageDeliveryAttempt returns an attribute KeyValue
+// conforming to the "messaging.gcp_pubsub.message.delivery_attempt" semantic
+// conventions. It represents the delivery attempt for a given message.
+func MessagingGCPPubsubMessageDeliveryAttempt(val int) attribute.KeyValue {
+ return MessagingGCPPubsubMessageDeliveryAttemptKey.Int(val)
+}
+
+// MessagingGCPPubsubMessageOrderingKey returns an attribute KeyValue
+// conforming to the "messaging.gcp_pubsub.message.ordering_key" semantic
+// conventions. It represents the ordering key for a given message. If the
+// attribute is not present, the message does not have an ordering key.
+func MessagingGCPPubsubMessageOrderingKey(val string) attribute.KeyValue {
+ return MessagingGCPPubsubMessageOrderingKeyKey.String(val)
+}
+
+// This group describes attributes specific to Azure Service Bus.
+const (
+ // MessagingServicebusDestinationSubscriptionNameKey is the attribute Key
+ // conforming to the "messaging.servicebus.destination.subscription_name"
+ // semantic conventions. It represents the name of the subscription in the
+ // topic messages are received from.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'mySubscription'
+ MessagingServicebusDestinationSubscriptionNameKey = attribute.Key("messaging.servicebus.destination.subscription_name")
+
+ // MessagingServicebusDispositionStatusKey is the attribute Key conforming
+ // to the "messaging.servicebus.disposition_status" semantic conventions.
+ // It represents the describes the [settlement
+ // type](https://learn.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock).
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ MessagingServicebusDispositionStatusKey = attribute.Key("messaging.servicebus.disposition_status")
+
+ // MessagingServicebusMessageDeliveryCountKey is the attribute Key
+ // conforming to the "messaging.servicebus.message.delivery_count" semantic
+ // conventions. It represents the number of deliveries that have been
+ // attempted for this message.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 2
+ MessagingServicebusMessageDeliveryCountKey = attribute.Key("messaging.servicebus.message.delivery_count")
+
+ // MessagingServicebusMessageEnqueuedTimeKey is the attribute Key
+ // conforming to the "messaging.servicebus.message.enqueued_time" semantic
+ // conventions. It represents the UTC epoch seconds at which the message
+ // has been accepted and stored in the entity.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1701393730
+ MessagingServicebusMessageEnqueuedTimeKey = attribute.Key("messaging.servicebus.message.enqueued_time")
+)
+
+var (
+ // Message is completed
+ MessagingServicebusDispositionStatusComplete = MessagingServicebusDispositionStatusKey.String("complete")
+ // Message is abandoned
+ MessagingServicebusDispositionStatusAbandon = MessagingServicebusDispositionStatusKey.String("abandon")
+ // Message is sent to dead letter queue
+ MessagingServicebusDispositionStatusDeadLetter = MessagingServicebusDispositionStatusKey.String("dead_letter")
+ // Message is deferred
+ MessagingServicebusDispositionStatusDefer = MessagingServicebusDispositionStatusKey.String("defer")
+)
+
+// MessagingServicebusDestinationSubscriptionName returns an attribute
+// KeyValue conforming to the
+// "messaging.servicebus.destination.subscription_name" semantic conventions.
+// It represents the name of the subscription in the topic messages are
+// received from.
+func MessagingServicebusDestinationSubscriptionName(val string) attribute.KeyValue {
+ return MessagingServicebusDestinationSubscriptionNameKey.String(val)
+}
+
+// MessagingServicebusMessageDeliveryCount returns an attribute KeyValue
+// conforming to the "messaging.servicebus.message.delivery_count" semantic
+// conventions. It represents the number of deliveries that have been attempted
+// for this message.
+func MessagingServicebusMessageDeliveryCount(val int) attribute.KeyValue {
+ return MessagingServicebusMessageDeliveryCountKey.Int(val)
+}
+
+// MessagingServicebusMessageEnqueuedTime returns an attribute KeyValue
+// conforming to the "messaging.servicebus.message.enqueued_time" semantic
+// conventions. It represents the UTC epoch seconds at which the message has
+// been accepted and stored in the entity.
+func MessagingServicebusMessageEnqueuedTime(val int) attribute.KeyValue {
+ return MessagingServicebusMessageEnqueuedTimeKey.Int(val)
+}
+
+// This group describes attributes specific to Azure Event Hubs.
+const (
+ // MessagingEventhubsConsumerGroupKey is the attribute Key conforming to
+ // the "messaging.eventhubs.consumer.group" semantic conventions. It
+ // represents the name of the consumer group the event consumer is
+ // associated with.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'indexer'
+ MessagingEventhubsConsumerGroupKey = attribute.Key("messaging.eventhubs.consumer.group")
+
+ // MessagingEventhubsMessageEnqueuedTimeKey is the attribute Key conforming
+ // to the "messaging.eventhubs.message.enqueued_time" semantic conventions.
+ // It represents the UTC epoch seconds at which the message has been
+ // accepted and stored in the entity.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1701393730
+ MessagingEventhubsMessageEnqueuedTimeKey = attribute.Key("messaging.eventhubs.message.enqueued_time")
+)
+
+// MessagingEventhubsConsumerGroup returns an attribute KeyValue conforming
+// to the "messaging.eventhubs.consumer.group" semantic conventions. It
+// represents the name of the consumer group the event consumer is associated
+// with.
+func MessagingEventhubsConsumerGroup(val string) attribute.KeyValue {
+ return MessagingEventhubsConsumerGroupKey.String(val)
+}
+
+// MessagingEventhubsMessageEnqueuedTime returns an attribute KeyValue
+// conforming to the "messaging.eventhubs.message.enqueued_time" semantic
+// conventions. It represents the UTC epoch seconds at which the message has
+// been accepted and stored in the entity.
+func MessagingEventhubsMessageEnqueuedTime(val int) attribute.KeyValue {
+ return MessagingEventhubsMessageEnqueuedTimeKey.Int(val)
+}
+
+// These attributes may be used for any network related operation.
+const (
+ // NetworkCarrierIccKey is the attribute Key conforming to the
+ // "network.carrier.icc" semantic conventions. It represents the ISO 3166-1
+ // alpha-2 2-character country code associated with the mobile carrier
+ // network.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'DE'
+ NetworkCarrierIccKey = attribute.Key("network.carrier.icc")
+
+ // NetworkCarrierMccKey is the attribute Key conforming to the
+ // "network.carrier.mcc" semantic conventions. It represents the mobile
+ // carrier country code.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '310'
+ NetworkCarrierMccKey = attribute.Key("network.carrier.mcc")
+
+ // NetworkCarrierMncKey is the attribute Key conforming to the
+ // "network.carrier.mnc" semantic conventions. It represents the mobile
+ // carrier network code.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '001'
+ NetworkCarrierMncKey = attribute.Key("network.carrier.mnc")
+
+ // NetworkCarrierNameKey is the attribute Key conforming to the
+ // "network.carrier.name" semantic conventions. It represents the name of
+ // the mobile carrier.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'sprint'
+ NetworkCarrierNameKey = attribute.Key("network.carrier.name")
+
+ // NetworkConnectionSubtypeKey is the attribute Key conforming to the
+ // "network.connection.subtype" semantic conventions. It represents the
+ // this describes more details regarding the connection.type. It may be the
+ // type of cell technology connection, but it could be used for describing
+ // details about a wifi connection.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'LTE'
+ NetworkConnectionSubtypeKey = attribute.Key("network.connection.subtype")
+
+ // NetworkConnectionTypeKey is the attribute Key conforming to the
+ // "network.connection.type" semantic conventions. It represents the
+ // internet connection type.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'wifi'
+ NetworkConnectionTypeKey = attribute.Key("network.connection.type")
+
+ // NetworkIoDirectionKey is the attribute Key conforming to the
+ // "network.io.direction" semantic conventions. It represents the network
+ // IO operation direction.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'transmit'
+ NetworkIoDirectionKey = attribute.Key("network.io.direction")
+
+ // NetworkLocalAddressKey is the attribute Key conforming to the
+ // "network.local.address" semantic conventions. It represents the local
+ // address of the network connection - IP address or Unix domain socket
+ // name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '10.1.2.80', '/tmp/my.sock'
+ NetworkLocalAddressKey = attribute.Key("network.local.address")
+
+ // NetworkLocalPortKey is the attribute Key conforming to the
+ // "network.local.port" semantic conventions. It represents the local port
+ // number of the network connection.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 65123
+ NetworkLocalPortKey = attribute.Key("network.local.port")
+
+ // NetworkPeerAddressKey is the attribute Key conforming to the
+ // "network.peer.address" semantic conventions. It represents the peer
+ // address of the network connection - IP address or Unix domain socket
+ // name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '10.1.2.80', '/tmp/my.sock'
+ NetworkPeerAddressKey = attribute.Key("network.peer.address")
+
+ // NetworkPeerPortKey is the attribute Key conforming to the
+ // "network.peer.port" semantic conventions. It represents the peer port
+ // number of the network connection.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 65123
+ NetworkPeerPortKey = attribute.Key("network.peer.port")
+
+ // NetworkProtocolNameKey is the attribute Key conforming to the
+ // "network.protocol.name" semantic conventions. It represents the [OSI
+ // application layer](https://osi-model.com/application-layer/) or non-OSI
+ // equivalent.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'amqp', 'http', 'mqtt'
+ // Note: The value SHOULD be normalized to lowercase.
+ NetworkProtocolNameKey = attribute.Key("network.protocol.name")
+
+ // NetworkProtocolVersionKey is the attribute Key conforming to the
+ // "network.protocol.version" semantic conventions. It represents the
+ // actual version of the protocol used for network communication.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '1.1', '2'
+ // Note: If protocol version is subject to negotiation (for example using
+ // [ALPN](https://www.rfc-editor.org/rfc/rfc7301.html)), this attribute
+ // SHOULD be set to the negotiated version. If the actual protocol version
+ // is not known, this attribute SHOULD NOT be set.
+ NetworkProtocolVersionKey = attribute.Key("network.protocol.version")
+
+ // NetworkTransportKey is the attribute Key conforming to the
+ // "network.transport" semantic conventions. It represents the [OSI
+ // transport layer](https://osi-model.com/transport-layer/) or
+ // [inter-process communication
+ // method](https://wikipedia.org/wiki/Inter-process_communication).
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'tcp', 'udp'
+ // Note: The value SHOULD be normalized to lowercase.
+ //
+ // Consider always setting the transport when setting a port number, since
+ // a port number is ambiguous without knowing the transport. For example
+ // different processes could be listening on TCP port 12345 and UDP port
+ // 12345.
+ NetworkTransportKey = attribute.Key("network.transport")
+
+ // NetworkTypeKey is the attribute Key conforming to the "network.type"
+ // semantic conventions. It represents the [OSI network
+ // layer](https://osi-model.com/network-layer/) or non-OSI equivalent.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'ipv4', 'ipv6'
+ // Note: The value SHOULD be normalized to lowercase.
+ NetworkTypeKey = attribute.Key("network.type")
+)
+
+var (
+ // GPRS
+ NetworkConnectionSubtypeGprs = NetworkConnectionSubtypeKey.String("gprs")
+ // EDGE
+ NetworkConnectionSubtypeEdge = NetworkConnectionSubtypeKey.String("edge")
+ // UMTS
+ NetworkConnectionSubtypeUmts = NetworkConnectionSubtypeKey.String("umts")
+ // CDMA
+ NetworkConnectionSubtypeCdma = NetworkConnectionSubtypeKey.String("cdma")
+ // EVDO Rel. 0
+ NetworkConnectionSubtypeEvdo0 = NetworkConnectionSubtypeKey.String("evdo_0")
+ // EVDO Rev. A
+ NetworkConnectionSubtypeEvdoA = NetworkConnectionSubtypeKey.String("evdo_a")
+ // CDMA2000 1XRTT
+ NetworkConnectionSubtypeCdma20001xrtt = NetworkConnectionSubtypeKey.String("cdma2000_1xrtt")
+ // HSDPA
+ NetworkConnectionSubtypeHsdpa = NetworkConnectionSubtypeKey.String("hsdpa")
+ // HSUPA
+ NetworkConnectionSubtypeHsupa = NetworkConnectionSubtypeKey.String("hsupa")
+ // HSPA
+ NetworkConnectionSubtypeHspa = NetworkConnectionSubtypeKey.String("hspa")
+ // IDEN
+ NetworkConnectionSubtypeIden = NetworkConnectionSubtypeKey.String("iden")
+ // EVDO Rev. B
+ NetworkConnectionSubtypeEvdoB = NetworkConnectionSubtypeKey.String("evdo_b")
+ // LTE
+ NetworkConnectionSubtypeLte = NetworkConnectionSubtypeKey.String("lte")
+ // EHRPD
+ NetworkConnectionSubtypeEhrpd = NetworkConnectionSubtypeKey.String("ehrpd")
+ // HSPAP
+ NetworkConnectionSubtypeHspap = NetworkConnectionSubtypeKey.String("hspap")
+ // GSM
+ NetworkConnectionSubtypeGsm = NetworkConnectionSubtypeKey.String("gsm")
+ // TD-SCDMA
+ NetworkConnectionSubtypeTdScdma = NetworkConnectionSubtypeKey.String("td_scdma")
+ // IWLAN
+ NetworkConnectionSubtypeIwlan = NetworkConnectionSubtypeKey.String("iwlan")
+ // 5G NR (New Radio)
+ NetworkConnectionSubtypeNr = NetworkConnectionSubtypeKey.String("nr")
+ // 5G NRNSA (New Radio Non-Standalone)
+ NetworkConnectionSubtypeNrnsa = NetworkConnectionSubtypeKey.String("nrnsa")
+ // LTE CA
+ NetworkConnectionSubtypeLteCa = NetworkConnectionSubtypeKey.String("lte_ca")
+)
+
+var (
+ // wifi
+ NetworkConnectionTypeWifi = NetworkConnectionTypeKey.String("wifi")
+ // wired
+ NetworkConnectionTypeWired = NetworkConnectionTypeKey.String("wired")
+ // cell
+ NetworkConnectionTypeCell = NetworkConnectionTypeKey.String("cell")
+ // unavailable
+ NetworkConnectionTypeUnavailable = NetworkConnectionTypeKey.String("unavailable")
+ // unknown
+ NetworkConnectionTypeUnknown = NetworkConnectionTypeKey.String("unknown")
+)
+
+var (
+ // transmit
+ NetworkIoDirectionTransmit = NetworkIoDirectionKey.String("transmit")
+ // receive
+ NetworkIoDirectionReceive = NetworkIoDirectionKey.String("receive")
+)
+
+var (
+ // TCP
+ NetworkTransportTCP = NetworkTransportKey.String("tcp")
+ // UDP
+ NetworkTransportUDP = NetworkTransportKey.String("udp")
+ // Named or anonymous pipe
+ NetworkTransportPipe = NetworkTransportKey.String("pipe")
+ // Unix domain socket
+ NetworkTransportUnix = NetworkTransportKey.String("unix")
+)
+
+var (
+ // IPv4
+ NetworkTypeIpv4 = NetworkTypeKey.String("ipv4")
+ // IPv6
+ NetworkTypeIpv6 = NetworkTypeKey.String("ipv6")
+)
+
+// NetworkCarrierIcc returns an attribute KeyValue conforming to the
+// "network.carrier.icc" semantic conventions. It represents the ISO 3166-1
+// alpha-2 2-character country code associated with the mobile carrier network.
+func NetworkCarrierIcc(val string) attribute.KeyValue {
+ return NetworkCarrierIccKey.String(val)
+}
+
+// NetworkCarrierMcc returns an attribute KeyValue conforming to the
+// "network.carrier.mcc" semantic conventions. It represents the mobile carrier
+// country code.
+func NetworkCarrierMcc(val string) attribute.KeyValue {
+ return NetworkCarrierMccKey.String(val)
+}
+
+// NetworkCarrierMnc returns an attribute KeyValue conforming to the
+// "network.carrier.mnc" semantic conventions. It represents the mobile carrier
+// network code.
+func NetworkCarrierMnc(val string) attribute.KeyValue {
+ return NetworkCarrierMncKey.String(val)
+}
+
+// NetworkCarrierName returns an attribute KeyValue conforming to the
+// "network.carrier.name" semantic conventions. It represents the name of the
+// mobile carrier.
+func NetworkCarrierName(val string) attribute.KeyValue {
+ return NetworkCarrierNameKey.String(val)
+}
+
+// NetworkLocalAddress returns an attribute KeyValue conforming to the
+// "network.local.address" semantic conventions. It represents the local
+// address of the network connection - IP address or Unix domain socket name.
+func NetworkLocalAddress(val string) attribute.KeyValue {
+ return NetworkLocalAddressKey.String(val)
+}
+
+// NetworkLocalPort returns an attribute KeyValue conforming to the
+// "network.local.port" semantic conventions. It represents the local port
+// number of the network connection.
+func NetworkLocalPort(val int) attribute.KeyValue {
+ return NetworkLocalPortKey.Int(val)
+}
+
+// NetworkPeerAddress returns an attribute KeyValue conforming to the
+// "network.peer.address" semantic conventions. It represents the peer address
+// of the network connection - IP address or Unix domain socket name.
+func NetworkPeerAddress(val string) attribute.KeyValue {
+ return NetworkPeerAddressKey.String(val)
+}
+
+// NetworkPeerPort returns an attribute KeyValue conforming to the
+// "network.peer.port" semantic conventions. It represents the peer port number
+// of the network connection.
+func NetworkPeerPort(val int) attribute.KeyValue {
+ return NetworkPeerPortKey.Int(val)
+}
+
+// NetworkProtocolName returns an attribute KeyValue conforming to the
+// "network.protocol.name" semantic conventions. It represents the [OSI
+// application layer](https://osi-model.com/application-layer/) or non-OSI
+// equivalent.
+func NetworkProtocolName(val string) attribute.KeyValue {
+ return NetworkProtocolNameKey.String(val)
+}
+
+// NetworkProtocolVersion returns an attribute KeyValue conforming to the
+// "network.protocol.version" semantic conventions. It represents the actual
+// version of the protocol used for network communication.
+func NetworkProtocolVersion(val string) attribute.KeyValue {
+ return NetworkProtocolVersionKey.String(val)
+}
+
+// An OCI image manifest.
+const (
+ // OciManifestDigestKey is the attribute Key conforming to the
+ // "oci.manifest.digest" semantic conventions. It represents the digest of
+ // the OCI image manifest. For container images specifically is the digest
+ // by which the container image is known.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // 'sha256:e4ca62c0d62f3e886e684806dfe9d4e0cda60d54986898173c1083856cfda0f4'
+ // Note: Follows [OCI Image Manifest
+ // Specification](https://github.com/opencontainers/image-spec/blob/main/manifest.md),
+ // and specifically the [Digest
+ // property](https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests).
+ // An example can be found in [Example Image
+ // Manifest](https://docs.docker.com/registry/spec/manifest-v2-2/#example-image-manifest).
+ OciManifestDigestKey = attribute.Key("oci.manifest.digest")
+)
+
+// OciManifestDigest returns an attribute KeyValue conforming to the
+// "oci.manifest.digest" semantic conventions. It represents the digest of the
+// OCI image manifest. For container images specifically is the digest by which
+// the container image is known.
+func OciManifestDigest(val string) attribute.KeyValue {
+ return OciManifestDigestKey.String(val)
+}
+
+// Attributes used by the OpenTracing Shim layer.
+const (
+ // OpentracingRefTypeKey is the attribute Key conforming to the
+ // "opentracing.ref_type" semantic conventions. It represents the
+ // parent-child Reference type
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Note: The causal relationship between a child Span and a parent Span.
+ OpentracingRefTypeKey = attribute.Key("opentracing.ref_type")
+)
+
+var (
+ // The parent Span depends on the child Span in some capacity
+ OpentracingRefTypeChildOf = OpentracingRefTypeKey.String("child_of")
+ // The parent Span doesn't depend in any way on the result of the child Span
+ OpentracingRefTypeFollowsFrom = OpentracingRefTypeKey.String("follows_from")
+)
+
+// The operating system (OS) on which the process represented by this resource
+// is running.
+const (
+ // OSBuildIDKey is the attribute Key conforming to the "os.build_id"
+ // semantic conventions. It represents the unique identifier for a
+ // particular build or compilation of the operating system.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'TQ3C.230805.001.B2', '20E247', '22621'
+ OSBuildIDKey = attribute.Key("os.build_id")
+
+ // OSDescriptionKey is the attribute Key conforming to the "os.description"
+ // semantic conventions. It represents the human readable (not intended to
+ // be parsed) OS version information, like e.g. reported by `ver` or
+ // `lsb_release -a` commands.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Microsoft Windows [Version 10.0.18363.778]', 'Ubuntu 18.04.1
+ // LTS'
+ OSDescriptionKey = attribute.Key("os.description")
+
+ // OSNameKey is the attribute Key conforming to the "os.name" semantic
+ // conventions. It represents the human readable operating system name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'iOS', 'Android', 'Ubuntu'
+ OSNameKey = attribute.Key("os.name")
+
+ // OSTypeKey is the attribute Key conforming to the "os.type" semantic
+ // conventions. It represents the operating system type.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ OSTypeKey = attribute.Key("os.type")
+
+ // OSVersionKey is the attribute Key conforming to the "os.version"
+ // semantic conventions. It represents the version string of the operating
+ // system as defined in [Version
+ // Attributes](/docs/resource/README.md#version-attributes).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '14.2.1', '18.04.1'
+ OSVersionKey = attribute.Key("os.version")
+)
+
+var (
+ // Microsoft Windows
+ OSTypeWindows = OSTypeKey.String("windows")
+ // Linux
+ OSTypeLinux = OSTypeKey.String("linux")
+ // Apple Darwin
+ OSTypeDarwin = OSTypeKey.String("darwin")
+ // FreeBSD
+ OSTypeFreeBSD = OSTypeKey.String("freebsd")
+ // NetBSD
+ OSTypeNetBSD = OSTypeKey.String("netbsd")
+ // OpenBSD
+ OSTypeOpenBSD = OSTypeKey.String("openbsd")
+ // DragonFly BSD
+ OSTypeDragonflyBSD = OSTypeKey.String("dragonflybsd")
+ // HP-UX (Hewlett Packard Unix)
+ OSTypeHPUX = OSTypeKey.String("hpux")
+ // AIX (Advanced Interactive eXecutive)
+ OSTypeAIX = OSTypeKey.String("aix")
+ // SunOS, Oracle Solaris
+ OSTypeSolaris = OSTypeKey.String("solaris")
+ // IBM z/OS
+ OSTypeZOS = OSTypeKey.String("z_os")
+)
+
+// OSBuildID returns an attribute KeyValue conforming to the "os.build_id"
+// semantic conventions. It represents the unique identifier for a particular
+// build or compilation of the operating system.
+func OSBuildID(val string) attribute.KeyValue {
+ return OSBuildIDKey.String(val)
+}
+
+// OSDescription returns an attribute KeyValue conforming to the
+// "os.description" semantic conventions. It represents the human readable (not
+// intended to be parsed) OS version information, like e.g. reported by `ver`
+// or `lsb_release -a` commands.
+func OSDescription(val string) attribute.KeyValue {
+ return OSDescriptionKey.String(val)
+}
+
+// OSName returns an attribute KeyValue conforming to the "os.name" semantic
+// conventions. It represents the human readable operating system name.
+func OSName(val string) attribute.KeyValue {
+ return OSNameKey.String(val)
+}
+
+// OSVersion returns an attribute KeyValue conforming to the "os.version"
+// semantic conventions. It represents the version string of the operating
+// system as defined in [Version
+// Attributes](/docs/resource/README.md#version-attributes).
+func OSVersion(val string) attribute.KeyValue {
+ return OSVersionKey.String(val)
+}
+
+// Attributes reserved for OpenTelemetry
+const (
+ // OTelStatusCodeKey is the attribute Key conforming to the
+ // "otel.status_code" semantic conventions. It represents the name of the
+ // code, either "OK" or "ERROR". MUST NOT be set if the status code is
+ // UNSET.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ OTelStatusCodeKey = attribute.Key("otel.status_code")
+
+ // OTelStatusDescriptionKey is the attribute Key conforming to the
+ // "otel.status_description" semantic conventions. It represents the
+ // description of the Status if it has a value, otherwise not set.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'resource not found'
+ OTelStatusDescriptionKey = attribute.Key("otel.status_description")
+)
+
+var (
+ // The operation has been validated by an Application developer or Operator to have completed successfully
+ OTelStatusCodeOk = OTelStatusCodeKey.String("OK")
+ // The operation contains an error
+ OTelStatusCodeError = OTelStatusCodeKey.String("ERROR")
+)
+
+// OTelStatusDescription returns an attribute KeyValue conforming to the
+// "otel.status_description" semantic conventions. It represents the
+// description of the Status if it has a value, otherwise not set.
+func OTelStatusDescription(val string) attribute.KeyValue {
+ return OTelStatusDescriptionKey.String(val)
+}
+
+// Attributes used by non-OTLP exporters to represent OpenTelemetry Scope's
+// concepts.
+const (
+ // OTelScopeNameKey is the attribute Key conforming to the
+ // "otel.scope.name" semantic conventions. It represents the name of the
+ // instrumentation scope - (`InstrumentationScope.Name` in OTLP).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'io.opentelemetry.contrib.mongodb'
+ OTelScopeNameKey = attribute.Key("otel.scope.name")
+
+ // OTelScopeVersionKey is the attribute Key conforming to the
+ // "otel.scope.version" semantic conventions. It represents the version of
+ // the instrumentation scope - (`InstrumentationScope.Version` in OTLP).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '1.0.0'
+ OTelScopeVersionKey = attribute.Key("otel.scope.version")
+)
+
+// OTelScopeName returns an attribute KeyValue conforming to the
+// "otel.scope.name" semantic conventions. It represents the name of the
+// instrumentation scope - (`InstrumentationScope.Name` in OTLP).
+func OTelScopeName(val string) attribute.KeyValue {
+ return OTelScopeNameKey.String(val)
+}
+
+// OTelScopeVersion returns an attribute KeyValue conforming to the
+// "otel.scope.version" semantic conventions. It represents the version of the
+// instrumentation scope - (`InstrumentationScope.Version` in OTLP).
+func OTelScopeVersion(val string) attribute.KeyValue {
+ return OTelScopeVersionKey.String(val)
+}
+
+// Operations that access some remote service.
+const (
+ // PeerServiceKey is the attribute Key conforming to the "peer.service"
+ // semantic conventions. It represents the
+ // [`service.name`](/docs/resource/README.md#service) of the remote
+ // service. SHOULD be equal to the actual `service.name` resource attribute
+ // of the remote service if any.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'AuthTokenCache'
+ PeerServiceKey = attribute.Key("peer.service")
+)
+
+// PeerService returns an attribute KeyValue conforming to the
+// "peer.service" semantic conventions. It represents the
+// [`service.name`](/docs/resource/README.md#service) of the remote service.
+// SHOULD be equal to the actual `service.name` resource attribute of the
+// remote service if any.
+func PeerService(val string) attribute.KeyValue {
+ return PeerServiceKey.String(val)
+}
+
+// An operating system process.
+const (
+ // ProcessCommandKey is the attribute Key conforming to the
+ // "process.command" semantic conventions. It represents the command used
+ // to launch the process (i.e. the command name). On Linux based systems,
+ // can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can
+ // be set to the first parameter extracted from `GetCommandLineW`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'cmd/otelcol'
+ ProcessCommandKey = attribute.Key("process.command")
+
+ // ProcessCommandArgsKey is the attribute Key conforming to the
+ // "process.command_args" semantic conventions. It represents the all the
+ // command arguments (including the command/executable itself) as received
+ // by the process. On Linux-based systems (and some other Unixoid systems
+ // supporting procfs), can be set according to the list of null-delimited
+ // strings extracted from `proc/[pid]/cmdline`. For libc-based executables,
+ // this would be the full argv vector passed to `main`.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'cmd/otecol', '--config=config.yaml'
+ ProcessCommandArgsKey = attribute.Key("process.command_args")
+
+ // ProcessCommandLineKey is the attribute Key conforming to the
+ // "process.command_line" semantic conventions. It represents the full
+ // command used to launch the process as a single string representing the
+ // full command. On Windows, can be set to the result of `GetCommandLineW`.
+ // Do not set this if you have to assemble it just for monitoring; use
+ // `process.command_args` instead.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'C:\\cmd\\otecol --config="my directory\\config.yaml"'
+ ProcessCommandLineKey = attribute.Key("process.command_line")
+
+ // ProcessContextSwitchTypeKey is the attribute Key conforming to the
+ // "process.context_switch_type" semantic conventions. It represents the
+ // specifies whether the context switches for this data point were
+ // voluntary or involuntary.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ ProcessContextSwitchTypeKey = attribute.Key("process.context_switch_type")
+
+ // ProcessCreationTimeKey is the attribute Key conforming to the
+ // "process.creation.time" semantic conventions. It represents the date and
+ // time the process was created, in ISO 8601 format.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2023-11-21T09:25:34.853Z'
+ ProcessCreationTimeKey = attribute.Key("process.creation.time")
+
+ // ProcessExecutableNameKey is the attribute Key conforming to the
+ // "process.executable.name" semantic conventions. It represents the name
+ // of the process executable. On Linux based systems, can be set to the
+ // `Name` in `proc/[pid]/status`. On Windows, can be set to the base name
+ // of `GetProcessImageFileNameW`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'otelcol'
+ ProcessExecutableNameKey = attribute.Key("process.executable.name")
+
+ // ProcessExecutablePathKey is the attribute Key conforming to the
+ // "process.executable.path" semantic conventions. It represents the full
+ // path to the process executable. On Linux based systems, can be set to
+ // the target of `proc/[pid]/exe`. On Windows, can be set to the result of
+ // `GetProcessImageFileNameW`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/usr/bin/cmd/otelcol'
+ ProcessExecutablePathKey = attribute.Key("process.executable.path")
+
+ // ProcessExitCodeKey is the attribute Key conforming to the
+ // "process.exit.code" semantic conventions. It represents the exit code of
+ // the process.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 127
+ ProcessExitCodeKey = attribute.Key("process.exit.code")
+
+ // ProcessExitTimeKey is the attribute Key conforming to the
+ // "process.exit.time" semantic conventions. It represents the date and
+ // time the process exited, in ISO 8601 format.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2023-11-21T09:26:12.315Z'
+ ProcessExitTimeKey = attribute.Key("process.exit.time")
+
+ // ProcessGroupLeaderPIDKey is the attribute Key conforming to the
+ // "process.group_leader.pid" semantic conventions. It represents the PID
+ // of the process's group leader. This is also the process group ID (PGID)
+ // of the process.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 23
+ ProcessGroupLeaderPIDKey = attribute.Key("process.group_leader.pid")
+
+ // ProcessInteractiveKey is the attribute Key conforming to the
+ // "process.interactive" semantic conventions. It represents the whether
+ // the process is connected to an interactive shell.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ ProcessInteractiveKey = attribute.Key("process.interactive")
+
+ // ProcessOwnerKey is the attribute Key conforming to the "process.owner"
+ // semantic conventions. It represents the username of the user that owns
+ // the process.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'root'
+ ProcessOwnerKey = attribute.Key("process.owner")
+
+ // ProcessPagingFaultTypeKey is the attribute Key conforming to the
+ // "process.paging.fault_type" semantic conventions. It represents the type
+ // of page fault for this data point. Type `major` is for major/hard page
+ // faults, and `minor` is for minor/soft page faults.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ ProcessPagingFaultTypeKey = attribute.Key("process.paging.fault_type")
+
+ // ProcessParentPIDKey is the attribute Key conforming to the
+ // "process.parent_pid" semantic conventions. It represents the parent
+ // Process identifier (PPID).
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 111
+ ProcessParentPIDKey = attribute.Key("process.parent_pid")
+
+ // ProcessPIDKey is the attribute Key conforming to the "process.pid"
+ // semantic conventions. It represents the process identifier (PID).
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1234
+ ProcessPIDKey = attribute.Key("process.pid")
+
+ // ProcessRealUserIDKey is the attribute Key conforming to the
+ // "process.real_user.id" semantic conventions. It represents the real user
+ // ID (RUID) of the process.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1000
+ ProcessRealUserIDKey = attribute.Key("process.real_user.id")
+
+ // ProcessRealUserNameKey is the attribute Key conforming to the
+ // "process.real_user.name" semantic conventions. It represents the
+ // username of the real user of the process.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'operator'
+ ProcessRealUserNameKey = attribute.Key("process.real_user.name")
+
+ // ProcessRuntimeDescriptionKey is the attribute Key conforming to the
+ // "process.runtime.description" semantic conventions. It represents an
+ // additional description about the runtime of the process, for example a
+ // specific vendor customization of the runtime environment.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0'
+ ProcessRuntimeDescriptionKey = attribute.Key("process.runtime.description")
+
+ // ProcessRuntimeNameKey is the attribute Key conforming to the
+ // "process.runtime.name" semantic conventions. It represents the name of
+ // the runtime of this process. For compiled native binaries, this SHOULD
+ // be the name of the compiler.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'OpenJDK Runtime Environment'
+ ProcessRuntimeNameKey = attribute.Key("process.runtime.name")
+
+ // ProcessRuntimeVersionKey is the attribute Key conforming to the
+ // "process.runtime.version" semantic conventions. It represents the
+ // version of the runtime of this process, as returned by the runtime
+ // without modification.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '14.0.2'
+ ProcessRuntimeVersionKey = attribute.Key("process.runtime.version")
+
+ // ProcessSavedUserIDKey is the attribute Key conforming to the
+ // "process.saved_user.id" semantic conventions. It represents the saved
+ // user ID (SUID) of the process.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1002
+ ProcessSavedUserIDKey = attribute.Key("process.saved_user.id")
+
+ // ProcessSavedUserNameKey is the attribute Key conforming to the
+ // "process.saved_user.name" semantic conventions. It represents the
+ // username of the saved user.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'operator'
+ ProcessSavedUserNameKey = attribute.Key("process.saved_user.name")
+
+ // ProcessSessionLeaderPIDKey is the attribute Key conforming to the
+ // "process.session_leader.pid" semantic conventions. It represents the PID
+ // of the process's session leader. This is also the session ID (SID) of
+ // the process.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 14
+ ProcessSessionLeaderPIDKey = attribute.Key("process.session_leader.pid")
+
+ // ProcessUserIDKey is the attribute Key conforming to the
+ // "process.user.id" semantic conventions. It represents the effective user
+ // ID (EUID) of the process.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1001
+ ProcessUserIDKey = attribute.Key("process.user.id")
+
+ // ProcessUserNameKey is the attribute Key conforming to the
+ // "process.user.name" semantic conventions. It represents the username of
+ // the effective user of the process.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'root'
+ ProcessUserNameKey = attribute.Key("process.user.name")
+
+ // ProcessVpidKey is the attribute Key conforming to the "process.vpid"
+ // semantic conventions. It represents the virtual process identifier.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 12
+ // Note: The process ID within a PID namespace. This is not necessarily
+ // unique across all processes on the host but it is unique within the
+ // process namespace that the process exists within.
+ ProcessVpidKey = attribute.Key("process.vpid")
+)
+
+var (
+ // voluntary
+ ProcessContextSwitchTypeVoluntary = ProcessContextSwitchTypeKey.String("voluntary")
+ // involuntary
+ ProcessContextSwitchTypeInvoluntary = ProcessContextSwitchTypeKey.String("involuntary")
+)
+
+var (
+ // major
+ ProcessPagingFaultTypeMajor = ProcessPagingFaultTypeKey.String("major")
+ // minor
+ ProcessPagingFaultTypeMinor = ProcessPagingFaultTypeKey.String("minor")
+)
+
+// ProcessCommand returns an attribute KeyValue conforming to the
+// "process.command" semantic conventions. It represents the command used to
+// launch the process (i.e. the command name). On Linux based systems, can be
+// set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to
+// the first parameter extracted from `GetCommandLineW`.
+func ProcessCommand(val string) attribute.KeyValue {
+ return ProcessCommandKey.String(val)
+}
+
+// ProcessCommandArgs returns an attribute KeyValue conforming to the
+// "process.command_args" semantic conventions. It represents the all the
+// command arguments (including the command/executable itself) as received by
+// the process. On Linux-based systems (and some other Unixoid systems
+// supporting procfs), can be set according to the list of null-delimited
+// strings extracted from `proc/[pid]/cmdline`. For libc-based executables,
+// this would be the full argv vector passed to `main`.
+func ProcessCommandArgs(val ...string) attribute.KeyValue {
+ return ProcessCommandArgsKey.StringSlice(val)
+}
+
+// ProcessCommandLine returns an attribute KeyValue conforming to the
+// "process.command_line" semantic conventions. It represents the full command
+// used to launch the process as a single string representing the full command.
+// On Windows, can be set to the result of `GetCommandLineW`. Do not set this
+// if you have to assemble it just for monitoring; use `process.command_args`
+// instead.
+func ProcessCommandLine(val string) attribute.KeyValue {
+ return ProcessCommandLineKey.String(val)
+}
+
+// ProcessCreationTime returns an attribute KeyValue conforming to the
+// "process.creation.time" semantic conventions. It represents the date and
+// time the process was created, in ISO 8601 format.
+func ProcessCreationTime(val string) attribute.KeyValue {
+ return ProcessCreationTimeKey.String(val)
+}
+
+// ProcessExecutableName returns an attribute KeyValue conforming to the
+// "process.executable.name" semantic conventions. It represents the name of
+// the process executable. On Linux based systems, can be set to the `Name` in
+// `proc/[pid]/status`. On Windows, can be set to the base name of
+// `GetProcessImageFileNameW`.
+func ProcessExecutableName(val string) attribute.KeyValue {
+ return ProcessExecutableNameKey.String(val)
+}
+
+// ProcessExecutablePath returns an attribute KeyValue conforming to the
+// "process.executable.path" semantic conventions. It represents the full path
+// to the process executable. On Linux based systems, can be set to the target
+// of `proc/[pid]/exe`. On Windows, can be set to the result of
+// `GetProcessImageFileNameW`.
+func ProcessExecutablePath(val string) attribute.KeyValue {
+ return ProcessExecutablePathKey.String(val)
+}
+
+// ProcessExitCode returns an attribute KeyValue conforming to the
+// "process.exit.code" semantic conventions. It represents the exit code of the
+// process.
+func ProcessExitCode(val int) attribute.KeyValue {
+ return ProcessExitCodeKey.Int(val)
+}
+
+// ProcessExitTime returns an attribute KeyValue conforming to the
+// "process.exit.time" semantic conventions. It represents the date and time
+// the process exited, in ISO 8601 format.
+func ProcessExitTime(val string) attribute.KeyValue {
+ return ProcessExitTimeKey.String(val)
+}
+
+// ProcessGroupLeaderPID returns an attribute KeyValue conforming to the
+// "process.group_leader.pid" semantic conventions. It represents the PID of
+// the process's group leader. This is also the process group ID (PGID) of the
+// process.
+func ProcessGroupLeaderPID(val int) attribute.KeyValue {
+ return ProcessGroupLeaderPIDKey.Int(val)
+}
+
+// ProcessInteractive returns an attribute KeyValue conforming to the
+// "process.interactive" semantic conventions. It represents the whether the
+// process is connected to an interactive shell.
+func ProcessInteractive(val bool) attribute.KeyValue {
+ return ProcessInteractiveKey.Bool(val)
+}
+
+// ProcessOwner returns an attribute KeyValue conforming to the
+// "process.owner" semantic conventions. It represents the username of the user
+// that owns the process.
+func ProcessOwner(val string) attribute.KeyValue {
+ return ProcessOwnerKey.String(val)
+}
+
+// ProcessParentPID returns an attribute KeyValue conforming to the
+// "process.parent_pid" semantic conventions. It represents the parent Process
+// identifier (PPID).
+func ProcessParentPID(val int) attribute.KeyValue {
+ return ProcessParentPIDKey.Int(val)
+}
+
+// ProcessPID returns an attribute KeyValue conforming to the "process.pid"
+// semantic conventions. It represents the process identifier (PID).
+func ProcessPID(val int) attribute.KeyValue {
+ return ProcessPIDKey.Int(val)
+}
+
+// ProcessRealUserID returns an attribute KeyValue conforming to the
+// "process.real_user.id" semantic conventions. It represents the real user ID
+// (RUID) of the process.
+func ProcessRealUserID(val int) attribute.KeyValue {
+ return ProcessRealUserIDKey.Int(val)
+}
+
+// ProcessRealUserName returns an attribute KeyValue conforming to the
+// "process.real_user.name" semantic conventions. It represents the username of
+// the real user of the process.
+func ProcessRealUserName(val string) attribute.KeyValue {
+ return ProcessRealUserNameKey.String(val)
+}
+
+// ProcessRuntimeDescription returns an attribute KeyValue conforming to the
+// "process.runtime.description" semantic conventions. It represents an
+// additional description about the runtime of the process, for example a
+// specific vendor customization of the runtime environment.
+func ProcessRuntimeDescription(val string) attribute.KeyValue {
+ return ProcessRuntimeDescriptionKey.String(val)
+}
+
+// ProcessRuntimeName returns an attribute KeyValue conforming to the
+// "process.runtime.name" semantic conventions. It represents the name of the
+// runtime of this process. For compiled native binaries, this SHOULD be the
+// name of the compiler.
+func ProcessRuntimeName(val string) attribute.KeyValue {
+ return ProcessRuntimeNameKey.String(val)
+}
+
+// ProcessRuntimeVersion returns an attribute KeyValue conforming to the
+// "process.runtime.version" semantic conventions. It represents the version of
+// the runtime of this process, as returned by the runtime without
+// modification.
+func ProcessRuntimeVersion(val string) attribute.KeyValue {
+ return ProcessRuntimeVersionKey.String(val)
+}
+
+// ProcessSavedUserID returns an attribute KeyValue conforming to the
+// "process.saved_user.id" semantic conventions. It represents the saved user
+// ID (SUID) of the process.
+func ProcessSavedUserID(val int) attribute.KeyValue {
+ return ProcessSavedUserIDKey.Int(val)
+}
+
+// ProcessSavedUserName returns an attribute KeyValue conforming to the
+// "process.saved_user.name" semantic conventions. It represents the username
+// of the saved user.
+func ProcessSavedUserName(val string) attribute.KeyValue {
+ return ProcessSavedUserNameKey.String(val)
+}
+
+// ProcessSessionLeaderPID returns an attribute KeyValue conforming to the
+// "process.session_leader.pid" semantic conventions. It represents the PID of
+// the process's session leader. This is also the session ID (SID) of the
+// process.
+func ProcessSessionLeaderPID(val int) attribute.KeyValue {
+ return ProcessSessionLeaderPIDKey.Int(val)
+}
+
+// ProcessUserID returns an attribute KeyValue conforming to the
+// "process.user.id" semantic conventions. It represents the effective user ID
+// (EUID) of the process.
+func ProcessUserID(val int) attribute.KeyValue {
+ return ProcessUserIDKey.Int(val)
+}
+
+// ProcessUserName returns an attribute KeyValue conforming to the
+// "process.user.name" semantic conventions. It represents the username of the
+// effective user of the process.
+func ProcessUserName(val string) attribute.KeyValue {
+ return ProcessUserNameKey.String(val)
+}
+
+// ProcessVpid returns an attribute KeyValue conforming to the
+// "process.vpid" semantic conventions. It represents the virtual process
+// identifier.
+func ProcessVpid(val int) attribute.KeyValue {
+ return ProcessVpidKey.Int(val)
+}
+
+// Attributes for process CPU
+const (
+ // ProcessCPUStateKey is the attribute Key conforming to the
+ // "process.cpu.state" semantic conventions. It represents the CPU state of
+ // the process.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ ProcessCPUStateKey = attribute.Key("process.cpu.state")
+)
+
+var (
+ // system
+ ProcessCPUStateSystem = ProcessCPUStateKey.String("system")
+ // user
+ ProcessCPUStateUser = ProcessCPUStateKey.String("user")
+ // wait
+ ProcessCPUStateWait = ProcessCPUStateKey.String("wait")
+)
+
+// Attributes for remote procedure calls.
+const (
+ // RPCConnectRPCErrorCodeKey is the attribute Key conforming to the
+ // "rpc.connect_rpc.error_code" semantic conventions. It represents the
+ // [error codes](https://connect.build/docs/protocol/#error-codes) of the
+ // Connect request. Error codes are always string values.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ RPCConnectRPCErrorCodeKey = attribute.Key("rpc.connect_rpc.error_code")
+
+ // RPCGRPCStatusCodeKey is the attribute Key conforming to the
+ // "rpc.grpc.status_code" semantic conventions. It represents the [numeric
+ // status
+ // code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of
+ // the gRPC request.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ RPCGRPCStatusCodeKey = attribute.Key("rpc.grpc.status_code")
+
+ // RPCJsonrpcErrorCodeKey is the attribute Key conforming to the
+ // "rpc.jsonrpc.error_code" semantic conventions. It represents the
+ // `error.code` property of response if it is an error response.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: -32700, 100
+ RPCJsonrpcErrorCodeKey = attribute.Key("rpc.jsonrpc.error_code")
+
+ // RPCJsonrpcErrorMessageKey is the attribute Key conforming to the
+ // "rpc.jsonrpc.error_message" semantic conventions. It represents the
+ // `error.message` property of response if it is an error response.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Parse error', 'User already exists'
+ RPCJsonrpcErrorMessageKey = attribute.Key("rpc.jsonrpc.error_message")
+
+ // RPCJsonrpcRequestIDKey is the attribute Key conforming to the
+ // "rpc.jsonrpc.request_id" semantic conventions. It represents the `id`
+ // property of request or response. Since protocol allows id to be int,
+ // string, `null` or missing (for notifications), value is expected to be
+ // cast to string for simplicity. Use empty string in case of `null` value.
+ // Omit entirely if this is a notification.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '10', 'request-7', ''
+ RPCJsonrpcRequestIDKey = attribute.Key("rpc.jsonrpc.request_id")
+
+ // RPCJsonrpcVersionKey is the attribute Key conforming to the
+ // "rpc.jsonrpc.version" semantic conventions. It represents the protocol
+ // version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0
+ // doesn't specify this, the value can be omitted.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2.0', '1.0'
+ RPCJsonrpcVersionKey = attribute.Key("rpc.jsonrpc.version")
+
+ // RPCMessageCompressedSizeKey is the attribute Key conforming to the
+ // "rpc.message.compressed_size" semantic conventions. It represents the
+ // compressed size of the message in bytes.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ RPCMessageCompressedSizeKey = attribute.Key("rpc.message.compressed_size")
+
+ // RPCMessageIDKey is the attribute Key conforming to the "rpc.message.id"
+ // semantic conventions. It represents the mUST be calculated as two
+ // different counters starting from `1` one for sent messages and one for
+ // received message.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Note: This way we guarantee that the values will be consistent between
+ // different implementations.
+ RPCMessageIDKey = attribute.Key("rpc.message.id")
+
+ // RPCMessageTypeKey is the attribute Key conforming to the
+ // "rpc.message.type" semantic conventions. It represents the whether this
+ // is a received or sent message.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ RPCMessageTypeKey = attribute.Key("rpc.message.type")
+
+ // RPCMessageUncompressedSizeKey is the attribute Key conforming to the
+ // "rpc.message.uncompressed_size" semantic conventions. It represents the
+ // uncompressed size of the message in bytes.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ RPCMessageUncompressedSizeKey = attribute.Key("rpc.message.uncompressed_size")
+
+ // RPCMethodKey is the attribute Key conforming to the "rpc.method"
+ // semantic conventions. It represents the name of the (logical) method
+ // being called, must be equal to the $method part in the span name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'exampleMethod'
+ // Note: This is the logical name of the method from the RPC interface
+ // perspective, which can be different from the name of any implementing
+ // method/function. The `code.function` attribute may be used to store the
+ // latter (e.g., method actually executing the call on the server side, RPC
+ // client stub method on the client side).
+ RPCMethodKey = attribute.Key("rpc.method")
+
+ // RPCServiceKey is the attribute Key conforming to the "rpc.service"
+ // semantic conventions. It represents the full (logical) name of the
+ // service being called, including its package name, if applicable.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'myservice.EchoService'
+ // Note: This is the logical name of the service from the RPC interface
+ // perspective, which can be different from the name of any implementing
+ // class. The `code.namespace` attribute may be used to store the latter
+ // (despite the attribute name, it may include a class name; e.g., class
+ // with method actually executing the call on the server side, RPC client
+ // stub class on the client side).
+ RPCServiceKey = attribute.Key("rpc.service")
+
+ // RPCSystemKey is the attribute Key conforming to the "rpc.system"
+ // semantic conventions. It represents a string identifying the remoting
+ // system. See below for a list of well-known identifiers.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ RPCSystemKey = attribute.Key("rpc.system")
+)
+
+var (
+ // cancelled
+ RPCConnectRPCErrorCodeCancelled = RPCConnectRPCErrorCodeKey.String("cancelled")
+ // unknown
+ RPCConnectRPCErrorCodeUnknown = RPCConnectRPCErrorCodeKey.String("unknown")
+ // invalid_argument
+ RPCConnectRPCErrorCodeInvalidArgument = RPCConnectRPCErrorCodeKey.String("invalid_argument")
+ // deadline_exceeded
+ RPCConnectRPCErrorCodeDeadlineExceeded = RPCConnectRPCErrorCodeKey.String("deadline_exceeded")
+ // not_found
+ RPCConnectRPCErrorCodeNotFound = RPCConnectRPCErrorCodeKey.String("not_found")
+ // already_exists
+ RPCConnectRPCErrorCodeAlreadyExists = RPCConnectRPCErrorCodeKey.String("already_exists")
+ // permission_denied
+ RPCConnectRPCErrorCodePermissionDenied = RPCConnectRPCErrorCodeKey.String("permission_denied")
+ // resource_exhausted
+ RPCConnectRPCErrorCodeResourceExhausted = RPCConnectRPCErrorCodeKey.String("resource_exhausted")
+ // failed_precondition
+ RPCConnectRPCErrorCodeFailedPrecondition = RPCConnectRPCErrorCodeKey.String("failed_precondition")
+ // aborted
+ RPCConnectRPCErrorCodeAborted = RPCConnectRPCErrorCodeKey.String("aborted")
+ // out_of_range
+ RPCConnectRPCErrorCodeOutOfRange = RPCConnectRPCErrorCodeKey.String("out_of_range")
+ // unimplemented
+ RPCConnectRPCErrorCodeUnimplemented = RPCConnectRPCErrorCodeKey.String("unimplemented")
+ // internal
+ RPCConnectRPCErrorCodeInternal = RPCConnectRPCErrorCodeKey.String("internal")
+ // unavailable
+ RPCConnectRPCErrorCodeUnavailable = RPCConnectRPCErrorCodeKey.String("unavailable")
+ // data_loss
+ RPCConnectRPCErrorCodeDataLoss = RPCConnectRPCErrorCodeKey.String("data_loss")
+ // unauthenticated
+ RPCConnectRPCErrorCodeUnauthenticated = RPCConnectRPCErrorCodeKey.String("unauthenticated")
+)
+
+var (
+ // OK
+ RPCGRPCStatusCodeOk = RPCGRPCStatusCodeKey.Int(0)
+ // CANCELLED
+ RPCGRPCStatusCodeCancelled = RPCGRPCStatusCodeKey.Int(1)
+ // UNKNOWN
+ RPCGRPCStatusCodeUnknown = RPCGRPCStatusCodeKey.Int(2)
+ // INVALID_ARGUMENT
+ RPCGRPCStatusCodeInvalidArgument = RPCGRPCStatusCodeKey.Int(3)
+ // DEADLINE_EXCEEDED
+ RPCGRPCStatusCodeDeadlineExceeded = RPCGRPCStatusCodeKey.Int(4)
+ // NOT_FOUND
+ RPCGRPCStatusCodeNotFound = RPCGRPCStatusCodeKey.Int(5)
+ // ALREADY_EXISTS
+ RPCGRPCStatusCodeAlreadyExists = RPCGRPCStatusCodeKey.Int(6)
+ // PERMISSION_DENIED
+ RPCGRPCStatusCodePermissionDenied = RPCGRPCStatusCodeKey.Int(7)
+ // RESOURCE_EXHAUSTED
+ RPCGRPCStatusCodeResourceExhausted = RPCGRPCStatusCodeKey.Int(8)
+ // FAILED_PRECONDITION
+ RPCGRPCStatusCodeFailedPrecondition = RPCGRPCStatusCodeKey.Int(9)
+ // ABORTED
+ RPCGRPCStatusCodeAborted = RPCGRPCStatusCodeKey.Int(10)
+ // OUT_OF_RANGE
+ RPCGRPCStatusCodeOutOfRange = RPCGRPCStatusCodeKey.Int(11)
+ // UNIMPLEMENTED
+ RPCGRPCStatusCodeUnimplemented = RPCGRPCStatusCodeKey.Int(12)
+ // INTERNAL
+ RPCGRPCStatusCodeInternal = RPCGRPCStatusCodeKey.Int(13)
+ // UNAVAILABLE
+ RPCGRPCStatusCodeUnavailable = RPCGRPCStatusCodeKey.Int(14)
+ // DATA_LOSS
+ RPCGRPCStatusCodeDataLoss = RPCGRPCStatusCodeKey.Int(15)
+ // UNAUTHENTICATED
+ RPCGRPCStatusCodeUnauthenticated = RPCGRPCStatusCodeKey.Int(16)
+)
+
+var (
+ // sent
+ RPCMessageTypeSent = RPCMessageTypeKey.String("SENT")
+ // received
+ RPCMessageTypeReceived = RPCMessageTypeKey.String("RECEIVED")
+)
+
+var (
+ // gRPC
+ RPCSystemGRPC = RPCSystemKey.String("grpc")
+ // Java RMI
+ RPCSystemJavaRmi = RPCSystemKey.String("java_rmi")
+ // .NET WCF
+ RPCSystemDotnetWcf = RPCSystemKey.String("dotnet_wcf")
+ // Apache Dubbo
+ RPCSystemApacheDubbo = RPCSystemKey.String("apache_dubbo")
+ // Connect RPC
+ RPCSystemConnectRPC = RPCSystemKey.String("connect_rpc")
+)
+
+// RPCJsonrpcErrorCode returns an attribute KeyValue conforming to the
+// "rpc.jsonrpc.error_code" semantic conventions. It represents the
+// `error.code` property of response if it is an error response.
+func RPCJsonrpcErrorCode(val int) attribute.KeyValue {
+ return RPCJsonrpcErrorCodeKey.Int(val)
+}
+
+// RPCJsonrpcErrorMessage returns an attribute KeyValue conforming to the
+// "rpc.jsonrpc.error_message" semantic conventions. It represents the
+// `error.message` property of response if it is an error response.
+func RPCJsonrpcErrorMessage(val string) attribute.KeyValue {
+ return RPCJsonrpcErrorMessageKey.String(val)
+}
+
+// RPCJsonrpcRequestID returns an attribute KeyValue conforming to the
+// "rpc.jsonrpc.request_id" semantic conventions. It represents the `id`
+// property of request or response. Since protocol allows id to be int, string,
+// `null` or missing (for notifications), value is expected to be cast to
+// string for simplicity. Use empty string in case of `null` value. Omit
+// entirely if this is a notification.
+func RPCJsonrpcRequestID(val string) attribute.KeyValue {
+ return RPCJsonrpcRequestIDKey.String(val)
+}
+
+// RPCJsonrpcVersion returns an attribute KeyValue conforming to the
+// "rpc.jsonrpc.version" semantic conventions. It represents the protocol
+// version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0
+// doesn't specify this, the value can be omitted.
+func RPCJsonrpcVersion(val string) attribute.KeyValue {
+ return RPCJsonrpcVersionKey.String(val)
+}
+
+// RPCMessageCompressedSize returns an attribute KeyValue conforming to the
+// "rpc.message.compressed_size" semantic conventions. It represents the
+// compressed size of the message in bytes.
+func RPCMessageCompressedSize(val int) attribute.KeyValue {
+ return RPCMessageCompressedSizeKey.Int(val)
+}
+
+// RPCMessageID returns an attribute KeyValue conforming to the
+// "rpc.message.id" semantic conventions. It represents the mUST be calculated
+// as two different counters starting from `1` one for sent messages and one
+// for received message.
+func RPCMessageID(val int) attribute.KeyValue {
+ return RPCMessageIDKey.Int(val)
+}
+
+// RPCMessageUncompressedSize returns an attribute KeyValue conforming to
+// the "rpc.message.uncompressed_size" semantic conventions. It represents the
+// uncompressed size of the message in bytes.
+func RPCMessageUncompressedSize(val int) attribute.KeyValue {
+ return RPCMessageUncompressedSizeKey.Int(val)
+}
+
+// RPCMethod returns an attribute KeyValue conforming to the "rpc.method"
+// semantic conventions. It represents the name of the (logical) method being
+// called, must be equal to the $method part in the span name.
+func RPCMethod(val string) attribute.KeyValue {
+ return RPCMethodKey.String(val)
+}
+
+// RPCService returns an attribute KeyValue conforming to the "rpc.service"
+// semantic conventions. It represents the full (logical) name of the service
+// being called, including its package name, if applicable.
+func RPCService(val string) attribute.KeyValue {
+ return RPCServiceKey.String(val)
+}
+
+// These attributes may be used to describe the server in a connection-based
+// network interaction where there is one side that initiates the connection
+// (the client is the side that initiates the connection). This covers all TCP
+// network interactions since TCP is connection-based and one side initiates
+// the connection (an exception is made for peer-to-peer communication over TCP
+// where the "user-facing" surface of the protocol / API doesn't expose a clear
+// notion of client and server). This also covers UDP network interactions
+// where one side initiates the interaction, e.g. QUIC (HTTP/3) and DNS.
+const (
+ // ServerAddressKey is the attribute Key conforming to the "server.address"
+ // semantic conventions. It represents the server domain name if available
+ // without reverse DNS lookup; otherwise, IP address or Unix domain socket
+ // name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'example.com', '10.1.2.80', '/tmp/my.sock'
+ // Note: When observed from the client side, and when communicating through
+ // an intermediary, `server.address` SHOULD represent the server address
+ // behind any intermediaries, for example proxies, if it's available.
+ ServerAddressKey = attribute.Key("server.address")
+
+ // ServerPortKey is the attribute Key conforming to the "server.port"
+ // semantic conventions. It represents the server port number.
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 80, 8080, 443
+ // Note: When observed from the client side, and when communicating through
+ // an intermediary, `server.port` SHOULD represent the server port behind
+ // any intermediaries, for example proxies, if it's available.
+ ServerPortKey = attribute.Key("server.port")
+)
+
+// ServerAddress returns an attribute KeyValue conforming to the
+// "server.address" semantic conventions. It represents the server domain name
+// if available without reverse DNS lookup; otherwise, IP address or Unix
+// domain socket name.
+func ServerAddress(val string) attribute.KeyValue {
+ return ServerAddressKey.String(val)
+}
+
+// ServerPort returns an attribute KeyValue conforming to the "server.port"
+// semantic conventions. It represents the server port number.
+func ServerPort(val int) attribute.KeyValue {
+ return ServerPortKey.Int(val)
+}
+
+// A service instance.
+const (
+ // ServiceInstanceIDKey is the attribute Key conforming to the
+ // "service.instance.id" semantic conventions. It represents the string ID
+ // of the service instance.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '627cc493-f310-47de-96bd-71410b7dec09'
+ // Note: MUST be unique for each instance of the same
+ // `service.namespace,service.name` pair (in other words
+ // `service.namespace,service.name,service.instance.id` triplet MUST be
+ // globally unique). The ID helps to
+ // distinguish instances of the same service that exist at the same time
+ // (e.g. instances of a horizontally scaled
+ // service).
+ //
+ // Implementations, such as SDKs, are recommended to generate a random
+ // Version 1 or Version 4 [RFC
+ // 4122](https://www.ietf.org/rfc/rfc4122.txt) UUID, but are free to use an
+ // inherent unique ID as the source of
+ // this value if stability is desirable. In that case, the ID SHOULD be
+ // used as source of a UUID Version 5 and
+ // SHOULD use the following UUID as the namespace:
+ // `4d63009a-8d0f-11ee-aad7-4c796ed8e320`.
+ //
+ // UUIDs are typically recommended, as only an opaque value for the
+ // purposes of identifying a service instance is
+ // needed. Similar to what can be seen in the man page for the
+ // [`/etc/machine-id`](https://www.freedesktop.org/software/systemd/man/machine-id.html)
+ // file, the underlying
+ // data, such as pod name and namespace should be treated as confidential,
+ // being the user's choice to expose it
+ // or not via another resource attribute.
+ //
+ // For applications running behind an application server (like unicorn), we
+ // do not recommend using one identifier
+ // for all processes participating in the application. Instead, it's
+ // recommended each division (e.g. a worker
+ // thread in unicorn) to have its own instance.id.
+ //
+ // It's not recommended for a Collector to set `service.instance.id` if it
+ // can't unambiguously determine the
+ // service instance that is generating that telemetry. For instance,
+ // creating an UUID based on `pod.name` will
+ // likely be wrong, as the Collector might not know from which container
+ // within that pod the telemetry originated.
+ // However, Collectors can set the `service.instance.id` if they can
+ // unambiguously determine the service instance
+ // for that telemetry. This is typically the case for scraping receivers,
+ // as they know the target address and
+ // port.
+ ServiceInstanceIDKey = attribute.Key("service.instance.id")
+
+ // ServiceNameKey is the attribute Key conforming to the "service.name"
+ // semantic conventions. It represents the logical name of the service.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'shoppingcart'
+ // Note: MUST be the same for all instances of horizontally scaled
+ // services. If the value was not specified, SDKs MUST fallback to
+ // `unknown_service:` concatenated with
+ // [`process.executable.name`](process.md), e.g. `unknown_service:bash`. If
+ // `process.executable.name` is not available, the value MUST be set to
+ // `unknown_service`.
+ ServiceNameKey = attribute.Key("service.name")
+
+ // ServiceNamespaceKey is the attribute Key conforming to the
+ // "service.namespace" semantic conventions. It represents a namespace for
+ // `service.name`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Shop'
+ // Note: A string value having a meaning that helps to distinguish a group
+ // of services, for example the team name that owns a group of services.
+ // `service.name` is expected to be unique within the same namespace. If
+ // `service.namespace` is not specified in the Resource then `service.name`
+ // is expected to be unique for all services that have no explicit
+ // namespace defined (so the empty/unspecified namespace is simply one more
+ // valid namespace). Zero-length namespace string is assumed equal to
+ // unspecified namespace.
+ ServiceNamespaceKey = attribute.Key("service.namespace")
+
+ // ServiceVersionKey is the attribute Key conforming to the
+ // "service.version" semantic conventions. It represents the version string
+ // of the service API or implementation. The format is not defined by these
+ // conventions.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '2.0.0', 'a01dbef8a'
+ ServiceVersionKey = attribute.Key("service.version")
+)
+
+// ServiceInstanceID returns an attribute KeyValue conforming to the
+// "service.instance.id" semantic conventions. It represents the string ID of
+// the service instance.
+func ServiceInstanceID(val string) attribute.KeyValue {
+ return ServiceInstanceIDKey.String(val)
+}
+
+// ServiceName returns an attribute KeyValue conforming to the
+// "service.name" semantic conventions. It represents the logical name of the
+// service.
+func ServiceName(val string) attribute.KeyValue {
+ return ServiceNameKey.String(val)
+}
+
+// ServiceNamespace returns an attribute KeyValue conforming to the
+// "service.namespace" semantic conventions. It represents a namespace for
+// `service.name`.
+func ServiceNamespace(val string) attribute.KeyValue {
+ return ServiceNamespaceKey.String(val)
+}
+
+// ServiceVersion returns an attribute KeyValue conforming to the
+// "service.version" semantic conventions. It represents the version string of
+// the service API or implementation. The format is not defined by these
+// conventions.
+func ServiceVersion(val string) attribute.KeyValue {
+ return ServiceVersionKey.String(val)
+}
+
+// Session is defined as the period of time encompassing all activities
+// performed by the application and the actions executed by the end user.
+// Consequently, a Session is represented as a collection of Logs, Events, and
+// Spans emitted by the Client Application throughout the Session's duration.
+// Each Session is assigned a unique identifier, which is included as an
+// attribute in the Logs, Events, and Spans generated during the Session's
+// lifecycle.
+// When a session reaches end of life, typically due to user inactivity or
+// session timeout, a new session identifier will be assigned. The previous
+// session identifier may be provided by the instrumentation so that telemetry
+// backends can link the two sessions.
+const (
+ // SessionIDKey is the attribute Key conforming to the "session.id"
+ // semantic conventions. It represents a unique id to identify a session.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '00112233-4455-6677-8899-aabbccddeeff'
+ SessionIDKey = attribute.Key("session.id")
+
+ // SessionPreviousIDKey is the attribute Key conforming to the
+ // "session.previous_id" semantic conventions. It represents the previous
+ // `session.id` for this user, when known.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '00112233-4455-6677-8899-aabbccddeeff'
+ SessionPreviousIDKey = attribute.Key("session.previous_id")
+)
+
+// SessionID returns an attribute KeyValue conforming to the "session.id"
+// semantic conventions. It represents a unique id to identify a session.
+func SessionID(val string) attribute.KeyValue {
+ return SessionIDKey.String(val)
+}
+
+// SessionPreviousID returns an attribute KeyValue conforming to the
+// "session.previous_id" semantic conventions. It represents the previous
+// `session.id` for this user, when known.
+func SessionPreviousID(val string) attribute.KeyValue {
+ return SessionPreviousIDKey.String(val)
+}
+
+// SignalR attributes
+const (
+ // SignalrConnectionStatusKey is the attribute Key conforming to the
+ // "signalr.connection.status" semantic conventions. It represents the
+ // signalR HTTP connection closure status.
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'app_shutdown', 'timeout'
+ SignalrConnectionStatusKey = attribute.Key("signalr.connection.status")
+
+ // SignalrTransportKey is the attribute Key conforming to the
+ // "signalr.transport" semantic conventions. It represents the [SignalR
+ // transport
+ // type](https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/docs/specs/TransportProtocols.md)
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'web_sockets', 'long_polling'
+ SignalrTransportKey = attribute.Key("signalr.transport")
+)
+
+var (
+ // The connection was closed normally
+ SignalrConnectionStatusNormalClosure = SignalrConnectionStatusKey.String("normal_closure")
+ // The connection was closed due to a timeout
+ SignalrConnectionStatusTimeout = SignalrConnectionStatusKey.String("timeout")
+ // The connection was closed because the app is shutting down
+ SignalrConnectionStatusAppShutdown = SignalrConnectionStatusKey.String("app_shutdown")
+)
+
+var (
+ // ServerSentEvents protocol
+ SignalrTransportServerSentEvents = SignalrTransportKey.String("server_sent_events")
+ // LongPolling protocol
+ SignalrTransportLongPolling = SignalrTransportKey.String("long_polling")
+ // WebSockets protocol
+ SignalrTransportWebSockets = SignalrTransportKey.String("web_sockets")
+)
+
+// These attributes may be used to describe the sender of a network
+// exchange/packet. These should be used when there is no client/server
+// relationship between the two sides, or when that relationship is unknown.
+// This covers low-level network interactions (e.g. packet tracing) where you
+// don't know if there was a connection or which side initiated it. This also
+// covers unidirectional UDP flows and peer-to-peer communication where the
+// "user-facing" surface of the protocol / API doesn't expose a clear notion of
+// client and server.
+const (
+ // SourceAddressKey is the attribute Key conforming to the "source.address"
+ // semantic conventions. It represents the source address - domain name if
+ // available without reverse DNS lookup; otherwise, IP address or Unix
+ // domain socket name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'source.example.com', '10.1.2.80', '/tmp/my.sock'
+ // Note: When observed from the destination side, and when communicating
+ // through an intermediary, `source.address` SHOULD represent the source
+ // address behind any intermediaries, for example proxies, if it's
+ // available.
+ SourceAddressKey = attribute.Key("source.address")
+
+ // SourcePortKey is the attribute Key conforming to the "source.port"
+ // semantic conventions. It represents the source port number
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 3389, 2888
+ SourcePortKey = attribute.Key("source.port")
+)
+
+// SourceAddress returns an attribute KeyValue conforming to the
+// "source.address" semantic conventions. It represents the source address -
+// domain name if available without reverse DNS lookup; otherwise, IP address
+// or Unix domain socket name.
+func SourceAddress(val string) attribute.KeyValue {
+ return SourceAddressKey.String(val)
+}
+
+// SourcePort returns an attribute KeyValue conforming to the "source.port"
+// semantic conventions. It represents the source port number
+func SourcePort(val int) attribute.KeyValue {
+ return SourcePortKey.Int(val)
+}
+
+// Describes System attributes
+const (
+ // SystemDeviceKey is the attribute Key conforming to the "system.device"
+ // semantic conventions. It represents the device identifier
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '(identifier)'
+ SystemDeviceKey = attribute.Key("system.device")
+)
+
+// SystemDevice returns an attribute KeyValue conforming to the
+// "system.device" semantic conventions. It represents the device identifier
+func SystemDevice(val string) attribute.KeyValue {
+ return SystemDeviceKey.String(val)
+}
+
+// Describes System CPU attributes
+const (
+ // SystemCPULogicalNumberKey is the attribute Key conforming to the
+ // "system.cpu.logical_number" semantic conventions. It represents the
+ // logical CPU number [0..n-1]
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 1
+ SystemCPULogicalNumberKey = attribute.Key("system.cpu.logical_number")
+
+ // SystemCPUStateKey is the attribute Key conforming to the
+ // "system.cpu.state" semantic conventions. It represents the state of the
+ // CPU
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'idle', 'interrupt'
+ SystemCPUStateKey = attribute.Key("system.cpu.state")
+)
+
+var (
+ // user
+ SystemCPUStateUser = SystemCPUStateKey.String("user")
+ // system
+ SystemCPUStateSystem = SystemCPUStateKey.String("system")
+ // nice
+ SystemCPUStateNice = SystemCPUStateKey.String("nice")
+ // idle
+ SystemCPUStateIdle = SystemCPUStateKey.String("idle")
+ // iowait
+ SystemCPUStateIowait = SystemCPUStateKey.String("iowait")
+ // interrupt
+ SystemCPUStateInterrupt = SystemCPUStateKey.String("interrupt")
+ // steal
+ SystemCPUStateSteal = SystemCPUStateKey.String("steal")
+)
+
+// SystemCPULogicalNumber returns an attribute KeyValue conforming to the
+// "system.cpu.logical_number" semantic conventions. It represents the logical
+// CPU number [0..n-1]
+func SystemCPULogicalNumber(val int) attribute.KeyValue {
+ return SystemCPULogicalNumberKey.Int(val)
+}
+
+// Describes System Memory attributes
+const (
+ // SystemMemoryStateKey is the attribute Key conforming to the
+ // "system.memory.state" semantic conventions. It represents the memory
+ // state
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'free', 'cached'
+ SystemMemoryStateKey = attribute.Key("system.memory.state")
+)
+
+var (
+ // used
+ SystemMemoryStateUsed = SystemMemoryStateKey.String("used")
+ // free
+ SystemMemoryStateFree = SystemMemoryStateKey.String("free")
+ // shared
+ SystemMemoryStateShared = SystemMemoryStateKey.String("shared")
+ // buffers
+ SystemMemoryStateBuffers = SystemMemoryStateKey.String("buffers")
+ // cached
+ SystemMemoryStateCached = SystemMemoryStateKey.String("cached")
+)
+
+// Describes System Memory Paging attributes
+const (
+ // SystemPagingDirectionKey is the attribute Key conforming to the
+ // "system.paging.direction" semantic conventions. It represents the paging
+ // access direction
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'in'
+ SystemPagingDirectionKey = attribute.Key("system.paging.direction")
+
+ // SystemPagingStateKey is the attribute Key conforming to the
+ // "system.paging.state" semantic conventions. It represents the memory
+ // paging state
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'free'
+ SystemPagingStateKey = attribute.Key("system.paging.state")
+
+ // SystemPagingTypeKey is the attribute Key conforming to the
+ // "system.paging.type" semantic conventions. It represents the memory
+ // paging type
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'minor'
+ SystemPagingTypeKey = attribute.Key("system.paging.type")
+)
+
+var (
+ // in
+ SystemPagingDirectionIn = SystemPagingDirectionKey.String("in")
+ // out
+ SystemPagingDirectionOut = SystemPagingDirectionKey.String("out")
+)
+
+var (
+ // used
+ SystemPagingStateUsed = SystemPagingStateKey.String("used")
+ // free
+ SystemPagingStateFree = SystemPagingStateKey.String("free")
+)
+
+var (
+ // major
+ SystemPagingTypeMajor = SystemPagingTypeKey.String("major")
+ // minor
+ SystemPagingTypeMinor = SystemPagingTypeKey.String("minor")
+)
+
+// Describes Filesystem attributes
+const (
+ // SystemFilesystemModeKey is the attribute Key conforming to the
+ // "system.filesystem.mode" semantic conventions. It represents the
+ // filesystem mode
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'rw, ro'
+ SystemFilesystemModeKey = attribute.Key("system.filesystem.mode")
+
+ // SystemFilesystemMountpointKey is the attribute Key conforming to the
+ // "system.filesystem.mountpoint" semantic conventions. It represents the
+ // filesystem mount path
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/mnt/data'
+ SystemFilesystemMountpointKey = attribute.Key("system.filesystem.mountpoint")
+
+ // SystemFilesystemStateKey is the attribute Key conforming to the
+ // "system.filesystem.state" semantic conventions. It represents the
+ // filesystem state
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'used'
+ SystemFilesystemStateKey = attribute.Key("system.filesystem.state")
+
+ // SystemFilesystemTypeKey is the attribute Key conforming to the
+ // "system.filesystem.type" semantic conventions. It represents the
+ // filesystem type
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'ext4'
+ SystemFilesystemTypeKey = attribute.Key("system.filesystem.type")
+)
+
+var (
+ // used
+ SystemFilesystemStateUsed = SystemFilesystemStateKey.String("used")
+ // free
+ SystemFilesystemStateFree = SystemFilesystemStateKey.String("free")
+ // reserved
+ SystemFilesystemStateReserved = SystemFilesystemStateKey.String("reserved")
+)
+
+var (
+ // fat32
+ SystemFilesystemTypeFat32 = SystemFilesystemTypeKey.String("fat32")
+ // exfat
+ SystemFilesystemTypeExfat = SystemFilesystemTypeKey.String("exfat")
+ // ntfs
+ SystemFilesystemTypeNtfs = SystemFilesystemTypeKey.String("ntfs")
+ // refs
+ SystemFilesystemTypeRefs = SystemFilesystemTypeKey.String("refs")
+ // hfsplus
+ SystemFilesystemTypeHfsplus = SystemFilesystemTypeKey.String("hfsplus")
+ // ext4
+ SystemFilesystemTypeExt4 = SystemFilesystemTypeKey.String("ext4")
+)
+
+// SystemFilesystemMode returns an attribute KeyValue conforming to the
+// "system.filesystem.mode" semantic conventions. It represents the filesystem
+// mode
+func SystemFilesystemMode(val string) attribute.KeyValue {
+ return SystemFilesystemModeKey.String(val)
+}
+
+// SystemFilesystemMountpoint returns an attribute KeyValue conforming to
+// the "system.filesystem.mountpoint" semantic conventions. It represents the
+// filesystem mount path
+func SystemFilesystemMountpoint(val string) attribute.KeyValue {
+ return SystemFilesystemMountpointKey.String(val)
+}
+
+// Describes Network attributes
+const (
+ // SystemNetworkStateKey is the attribute Key conforming to the
+ // "system.network.state" semantic conventions. It represents a stateless
+ // protocol MUST NOT set this attribute
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'close_wait'
+ SystemNetworkStateKey = attribute.Key("system.network.state")
+)
+
+var (
+ // close
+ SystemNetworkStateClose = SystemNetworkStateKey.String("close")
+ // close_wait
+ SystemNetworkStateCloseWait = SystemNetworkStateKey.String("close_wait")
+ // closing
+ SystemNetworkStateClosing = SystemNetworkStateKey.String("closing")
+ // delete
+ SystemNetworkStateDelete = SystemNetworkStateKey.String("delete")
+ // established
+ SystemNetworkStateEstablished = SystemNetworkStateKey.String("established")
+ // fin_wait_1
+ SystemNetworkStateFinWait1 = SystemNetworkStateKey.String("fin_wait_1")
+ // fin_wait_2
+ SystemNetworkStateFinWait2 = SystemNetworkStateKey.String("fin_wait_2")
+ // last_ack
+ SystemNetworkStateLastAck = SystemNetworkStateKey.String("last_ack")
+ // listen
+ SystemNetworkStateListen = SystemNetworkStateKey.String("listen")
+ // syn_recv
+ SystemNetworkStateSynRecv = SystemNetworkStateKey.String("syn_recv")
+ // syn_sent
+ SystemNetworkStateSynSent = SystemNetworkStateKey.String("syn_sent")
+ // time_wait
+ SystemNetworkStateTimeWait = SystemNetworkStateKey.String("time_wait")
+)
+
+// Describes System Process attributes
+const (
+ // SystemProcessStatusKey is the attribute Key conforming to the
+ // "system.process.status" semantic conventions. It represents the process
+ // state, e.g., [Linux Process State
+ // Codes](https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES)
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'running'
+ SystemProcessStatusKey = attribute.Key("system.process.status")
+)
+
+var (
+ // running
+ SystemProcessStatusRunning = SystemProcessStatusKey.String("running")
+ // sleeping
+ SystemProcessStatusSleeping = SystemProcessStatusKey.String("sleeping")
+ // stopped
+ SystemProcessStatusStopped = SystemProcessStatusKey.String("stopped")
+ // defunct
+ SystemProcessStatusDefunct = SystemProcessStatusKey.String("defunct")
+)
+
+// Attributes for telemetry SDK.
+const (
+ // TelemetrySDKLanguageKey is the attribute Key conforming to the
+ // "telemetry.sdk.language" semantic conventions. It represents the
+ // language of the telemetry SDK.
+ //
+ // Type: Enum
+ // RequirementLevel: Required
+ // Stability: stable
+ TelemetrySDKLanguageKey = attribute.Key("telemetry.sdk.language")
+
+ // TelemetrySDKNameKey is the attribute Key conforming to the
+ // "telemetry.sdk.name" semantic conventions. It represents the name of the
+ // telemetry SDK as defined above.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: stable
+ // Examples: 'opentelemetry'
+ // Note: The OpenTelemetry SDK MUST set the `telemetry.sdk.name` attribute
+ // to `opentelemetry`.
+ // If another SDK, like a fork or a vendor-provided implementation, is
+ // used, this SDK MUST set the
+ // `telemetry.sdk.name` attribute to the fully-qualified class or module
+ // name of this SDK's main entry point
+ // or another suitable identifier depending on the language.
+ // The identifier `opentelemetry` is reserved and MUST NOT be used in this
+ // case.
+ // All custom identifiers SHOULD be stable across different versions of an
+ // implementation.
+ TelemetrySDKNameKey = attribute.Key("telemetry.sdk.name")
+
+ // TelemetrySDKVersionKey is the attribute Key conforming to the
+ // "telemetry.sdk.version" semantic conventions. It represents the version
+ // string of the telemetry SDK.
+ //
+ // Type: string
+ // RequirementLevel: Required
+ // Stability: stable
+ // Examples: '1.2.3'
+ TelemetrySDKVersionKey = attribute.Key("telemetry.sdk.version")
+
+ // TelemetryDistroNameKey is the attribute Key conforming to the
+ // "telemetry.distro.name" semantic conventions. It represents the name of
+ // the auto instrumentation agent or distribution, if used.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'parts-unlimited-java'
+ // Note: Official auto instrumentation agents and distributions SHOULD set
+ // the `telemetry.distro.name` attribute to
+ // a string starting with `opentelemetry-`, e.g.
+ // `opentelemetry-java-instrumentation`.
+ TelemetryDistroNameKey = attribute.Key("telemetry.distro.name")
+
+ // TelemetryDistroVersionKey is the attribute Key conforming to the
+ // "telemetry.distro.version" semantic conventions. It represents the
+ // version string of the auto instrumentation agent or distribution, if
+ // used.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '1.2.3'
+ TelemetryDistroVersionKey = attribute.Key("telemetry.distro.version")
+)
+
+var (
+ // cpp
+ TelemetrySDKLanguageCPP = TelemetrySDKLanguageKey.String("cpp")
+ // dotnet
+ TelemetrySDKLanguageDotnet = TelemetrySDKLanguageKey.String("dotnet")
+ // erlang
+ TelemetrySDKLanguageErlang = TelemetrySDKLanguageKey.String("erlang")
+ // go
+ TelemetrySDKLanguageGo = TelemetrySDKLanguageKey.String("go")
+ // java
+ TelemetrySDKLanguageJava = TelemetrySDKLanguageKey.String("java")
+ // nodejs
+ TelemetrySDKLanguageNodejs = TelemetrySDKLanguageKey.String("nodejs")
+ // php
+ TelemetrySDKLanguagePHP = TelemetrySDKLanguageKey.String("php")
+ // python
+ TelemetrySDKLanguagePython = TelemetrySDKLanguageKey.String("python")
+ // ruby
+ TelemetrySDKLanguageRuby = TelemetrySDKLanguageKey.String("ruby")
+ // rust
+ TelemetrySDKLanguageRust = TelemetrySDKLanguageKey.String("rust")
+ // swift
+ TelemetrySDKLanguageSwift = TelemetrySDKLanguageKey.String("swift")
+ // webjs
+ TelemetrySDKLanguageWebjs = TelemetrySDKLanguageKey.String("webjs")
+)
+
+// TelemetrySDKName returns an attribute KeyValue conforming to the
+// "telemetry.sdk.name" semantic conventions. It represents the name of the
+// telemetry SDK as defined above.
+func TelemetrySDKName(val string) attribute.KeyValue {
+ return TelemetrySDKNameKey.String(val)
+}
+
+// TelemetrySDKVersion returns an attribute KeyValue conforming to the
+// "telemetry.sdk.version" semantic conventions. It represents the version
+// string of the telemetry SDK.
+func TelemetrySDKVersion(val string) attribute.KeyValue {
+ return TelemetrySDKVersionKey.String(val)
+}
+
+// TelemetryDistroName returns an attribute KeyValue conforming to the
+// "telemetry.distro.name" semantic conventions. It represents the name of the
+// auto instrumentation agent or distribution, if used.
+func TelemetryDistroName(val string) attribute.KeyValue {
+ return TelemetryDistroNameKey.String(val)
+}
+
+// TelemetryDistroVersion returns an attribute KeyValue conforming to the
+// "telemetry.distro.version" semantic conventions. It represents the version
+// string of the auto instrumentation agent or distribution, if used.
+func TelemetryDistroVersion(val string) attribute.KeyValue {
+ return TelemetryDistroVersionKey.String(val)
+}
+
+// These attributes may be used for any operation to store information about a
+// thread that started a span.
+const (
+ // ThreadIDKey is the attribute Key conforming to the "thread.id" semantic
+ // conventions. It represents the current "managed" thread ID (as opposed
+ // to OS thread ID).
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 42
+ ThreadIDKey = attribute.Key("thread.id")
+
+ // ThreadNameKey is the attribute Key conforming to the "thread.name"
+ // semantic conventions. It represents the current thread name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'main'
+ ThreadNameKey = attribute.Key("thread.name")
+)
+
+// ThreadID returns an attribute KeyValue conforming to the "thread.id"
+// semantic conventions. It represents the current "managed" thread ID (as
+// opposed to OS thread ID).
+func ThreadID(val int) attribute.KeyValue {
+ return ThreadIDKey.Int(val)
+}
+
+// ThreadName returns an attribute KeyValue conforming to the "thread.name"
+// semantic conventions. It represents the current thread name.
+func ThreadName(val string) attribute.KeyValue {
+ return ThreadNameKey.String(val)
+}
+
+// Semantic convention attributes in the TLS namespace.
+const (
+ // TLSCipherKey is the attribute Key conforming to the "tls.cipher"
+ // semantic conventions. It represents the string indicating the
+ // [cipher](https://datatracker.ietf.org/doc/html/rfc5246#appendix-A.5)
+ // used during the current connection.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'TLS_RSA_WITH_3DES_EDE_CBC_SHA',
+ // 'TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256'
+ // Note: The values allowed for `tls.cipher` MUST be one of the
+ // `Descriptions` of the [registered TLS Cipher
+ // Suits](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#table-tls-parameters-4).
+ TLSCipherKey = attribute.Key("tls.cipher")
+
+ // TLSClientCertificateKey is the attribute Key conforming to the
+ // "tls.client.certificate" semantic conventions. It represents the
+ // pEM-encoded stand-alone certificate offered by the client. This is
+ // usually mutually-exclusive of `client.certificate_chain` since this
+ // value also exists in that list.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'MII...'
+ TLSClientCertificateKey = attribute.Key("tls.client.certificate")
+
+ // TLSClientCertificateChainKey is the attribute Key conforming to the
+ // "tls.client.certificate_chain" semantic conventions. It represents the
+ // array of PEM-encoded certificates that make up the certificate chain
+ // offered by the client. This is usually mutually-exclusive of
+ // `client.certificate` since that value should be the first certificate in
+ // the chain.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'MII...', 'MI...'
+ TLSClientCertificateChainKey = attribute.Key("tls.client.certificate_chain")
+
+ // TLSClientHashMd5Key is the attribute Key conforming to the
+ // "tls.client.hash.md5" semantic conventions. It represents the
+ // certificate fingerprint using the MD5 digest of DER-encoded version of
+ // certificate offered by the client. For consistency with other hash
+ // values, this value should be formatted as an uppercase hash.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '0F76C7F2C55BFD7D8E8B8F4BFBF0C9EC'
+ TLSClientHashMd5Key = attribute.Key("tls.client.hash.md5")
+
+ // TLSClientHashSha1Key is the attribute Key conforming to the
+ // "tls.client.hash.sha1" semantic conventions. It represents the
+ // certificate fingerprint using the SHA1 digest of DER-encoded version of
+ // certificate offered by the client. For consistency with other hash
+ // values, this value should be formatted as an uppercase hash.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '9E393D93138888D288266C2D915214D1D1CCEB2A'
+ TLSClientHashSha1Key = attribute.Key("tls.client.hash.sha1")
+
+ // TLSClientHashSha256Key is the attribute Key conforming to the
+ // "tls.client.hash.sha256" semantic conventions. It represents the
+ // certificate fingerprint using the SHA256 digest of DER-encoded version
+ // of certificate offered by the client. For consistency with other hash
+ // values, this value should be formatted as an uppercase hash.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // '0687F666A054EF17A08E2F2162EAB4CBC0D265E1D7875BE74BF3C712CA92DAF0'
+ TLSClientHashSha256Key = attribute.Key("tls.client.hash.sha256")
+
+ // TLSClientIssuerKey is the attribute Key conforming to the
+ // "tls.client.issuer" semantic conventions. It represents the
+ // distinguished name of
+ // [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6)
+ // of the issuer of the x.509 certificate presented by the client.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'CN=Example Root CA, OU=Infrastructure Team, DC=example,
+ // DC=com'
+ TLSClientIssuerKey = attribute.Key("tls.client.issuer")
+
+ // TLSClientJa3Key is the attribute Key conforming to the "tls.client.ja3"
+ // semantic conventions. It represents a hash that identifies clients based
+ // on how they perform an SSL/TLS handshake.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'd4e5b18d6b55c71272893221c96ba240'
+ TLSClientJa3Key = attribute.Key("tls.client.ja3")
+
+ // TLSClientNotAfterKey is the attribute Key conforming to the
+ // "tls.client.not_after" semantic conventions. It represents the date/Time
+ // indicating when client certificate is no longer considered valid.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2021-01-01T00:00:00.000Z'
+ TLSClientNotAfterKey = attribute.Key("tls.client.not_after")
+
+ // TLSClientNotBeforeKey is the attribute Key conforming to the
+ // "tls.client.not_before" semantic conventions. It represents the
+ // date/Time indicating when client certificate is first considered valid.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '1970-01-01T00:00:00.000Z'
+ TLSClientNotBeforeKey = attribute.Key("tls.client.not_before")
+
+ // TLSClientServerNameKey is the attribute Key conforming to the
+ // "tls.client.server_name" semantic conventions. It represents the also
+ // called an SNI, this tells the server which hostname to which the client
+ // is attempting to connect to.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'opentelemetry.io'
+ TLSClientServerNameKey = attribute.Key("tls.client.server_name")
+
+ // TLSClientSubjectKey is the attribute Key conforming to the
+ // "tls.client.subject" semantic conventions. It represents the
+ // distinguished name of subject of the x.509 certificate presented by the
+ // client.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'CN=myclient, OU=Documentation Team, DC=example, DC=com'
+ TLSClientSubjectKey = attribute.Key("tls.client.subject")
+
+ // TLSClientSupportedCiphersKey is the attribute Key conforming to the
+ // "tls.client.supported_ciphers" semantic conventions. It represents the
+ // array of ciphers offered by the client during the client hello.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384",
+ // "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", "..."'
+ TLSClientSupportedCiphersKey = attribute.Key("tls.client.supported_ciphers")
+
+ // TLSCurveKey is the attribute Key conforming to the "tls.curve" semantic
+ // conventions. It represents the string indicating the curve used for the
+ // given cipher, when applicable
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'secp256r1'
+ TLSCurveKey = attribute.Key("tls.curve")
+
+ // TLSEstablishedKey is the attribute Key conforming to the
+ // "tls.established" semantic conventions. It represents the boolean flag
+ // indicating if the TLS negotiation was successful and transitioned to an
+ // encrypted tunnel.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: True
+ TLSEstablishedKey = attribute.Key("tls.established")
+
+ // TLSNextProtocolKey is the attribute Key conforming to the
+ // "tls.next_protocol" semantic conventions. It represents the string
+ // indicating the protocol being tunneled. Per the values in the [IANA
+ // registry](https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids),
+ // this string should be lower case.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'http/1.1'
+ TLSNextProtocolKey = attribute.Key("tls.next_protocol")
+
+ // TLSProtocolNameKey is the attribute Key conforming to the
+ // "tls.protocol.name" semantic conventions. It represents the normalized
+ // lowercase protocol name parsed from original string of the negotiated
+ // [SSL/TLS protocol
+ // version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES)
+ //
+ // Type: Enum
+ // RequirementLevel: Optional
+ // Stability: experimental
+ TLSProtocolNameKey = attribute.Key("tls.protocol.name")
+
+ // TLSProtocolVersionKey is the attribute Key conforming to the
+ // "tls.protocol.version" semantic conventions. It represents the numeric
+ // part of the version parsed from the original string of the negotiated
+ // [SSL/TLS protocol
+ // version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES)
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '1.2', '3'
+ TLSProtocolVersionKey = attribute.Key("tls.protocol.version")
+
+ // TLSResumedKey is the attribute Key conforming to the "tls.resumed"
+ // semantic conventions. It represents the boolean flag indicating if this
+ // TLS connection was resumed from an existing TLS negotiation.
+ //
+ // Type: boolean
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: True
+ TLSResumedKey = attribute.Key("tls.resumed")
+
+ // TLSServerCertificateKey is the attribute Key conforming to the
+ // "tls.server.certificate" semantic conventions. It represents the
+ // pEM-encoded stand-alone certificate offered by the server. This is
+ // usually mutually-exclusive of `server.certificate_chain` since this
+ // value also exists in that list.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'MII...'
+ TLSServerCertificateKey = attribute.Key("tls.server.certificate")
+
+ // TLSServerCertificateChainKey is the attribute Key conforming to the
+ // "tls.server.certificate_chain" semantic conventions. It represents the
+ // array of PEM-encoded certificates that make up the certificate chain
+ // offered by the server. This is usually mutually-exclusive of
+ // `server.certificate` since that value should be the first certificate in
+ // the chain.
+ //
+ // Type: string[]
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'MII...', 'MI...'
+ TLSServerCertificateChainKey = attribute.Key("tls.server.certificate_chain")
+
+ // TLSServerHashMd5Key is the attribute Key conforming to the
+ // "tls.server.hash.md5" semantic conventions. It represents the
+ // certificate fingerprint using the MD5 digest of DER-encoded version of
+ // certificate offered by the server. For consistency with other hash
+ // values, this value should be formatted as an uppercase hash.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '0F76C7F2C55BFD7D8E8B8F4BFBF0C9EC'
+ TLSServerHashMd5Key = attribute.Key("tls.server.hash.md5")
+
+ // TLSServerHashSha1Key is the attribute Key conforming to the
+ // "tls.server.hash.sha1" semantic conventions. It represents the
+ // certificate fingerprint using the SHA1 digest of DER-encoded version of
+ // certificate offered by the server. For consistency with other hash
+ // values, this value should be formatted as an uppercase hash.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '9E393D93138888D288266C2D915214D1D1CCEB2A'
+ TLSServerHashSha1Key = attribute.Key("tls.server.hash.sha1")
+
+ // TLSServerHashSha256Key is the attribute Key conforming to the
+ // "tls.server.hash.sha256" semantic conventions. It represents the
+ // certificate fingerprint using the SHA256 digest of DER-encoded version
+ // of certificate offered by the server. For consistency with other hash
+ // values, this value should be formatted as an uppercase hash.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples:
+ // '0687F666A054EF17A08E2F2162EAB4CBC0D265E1D7875BE74BF3C712CA92DAF0'
+ TLSServerHashSha256Key = attribute.Key("tls.server.hash.sha256")
+
+ // TLSServerIssuerKey is the attribute Key conforming to the
+ // "tls.server.issuer" semantic conventions. It represents the
+ // distinguished name of
+ // [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6)
+ // of the issuer of the x.509 certificate presented by the client.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'CN=Example Root CA, OU=Infrastructure Team, DC=example,
+ // DC=com'
+ TLSServerIssuerKey = attribute.Key("tls.server.issuer")
+
+ // TLSServerJa3sKey is the attribute Key conforming to the
+ // "tls.server.ja3s" semantic conventions. It represents a hash that
+ // identifies servers based on how they perform an SSL/TLS handshake.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'd4e5b18d6b55c71272893221c96ba240'
+ TLSServerJa3sKey = attribute.Key("tls.server.ja3s")
+
+ // TLSServerNotAfterKey is the attribute Key conforming to the
+ // "tls.server.not_after" semantic conventions. It represents the date/Time
+ // indicating when server certificate is no longer considered valid.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '2021-01-01T00:00:00.000Z'
+ TLSServerNotAfterKey = attribute.Key("tls.server.not_after")
+
+ // TLSServerNotBeforeKey is the attribute Key conforming to the
+ // "tls.server.not_before" semantic conventions. It represents the
+ // date/Time indicating when server certificate is first considered valid.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '1970-01-01T00:00:00.000Z'
+ TLSServerNotBeforeKey = attribute.Key("tls.server.not_before")
+
+ // TLSServerSubjectKey is the attribute Key conforming to the
+ // "tls.server.subject" semantic conventions. It represents the
+ // distinguished name of subject of the x.509 certificate presented by the
+ // server.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'CN=myserver, OU=Documentation Team, DC=example, DC=com'
+ TLSServerSubjectKey = attribute.Key("tls.server.subject")
+)
+
+var (
+ // ssl
+ TLSProtocolNameSsl = TLSProtocolNameKey.String("ssl")
+ // tls
+ TLSProtocolNameTLS = TLSProtocolNameKey.String("tls")
+)
+
+// TLSCipher returns an attribute KeyValue conforming to the "tls.cipher"
+// semantic conventions. It represents the string indicating the
+// [cipher](https://datatracker.ietf.org/doc/html/rfc5246#appendix-A.5) used
+// during the current connection.
+func TLSCipher(val string) attribute.KeyValue {
+ return TLSCipherKey.String(val)
+}
+
+// TLSClientCertificate returns an attribute KeyValue conforming to the
+// "tls.client.certificate" semantic conventions. It represents the pEM-encoded
+// stand-alone certificate offered by the client. This is usually
+// mutually-exclusive of `client.certificate_chain` since this value also
+// exists in that list.
+func TLSClientCertificate(val string) attribute.KeyValue {
+ return TLSClientCertificateKey.String(val)
+}
+
+// TLSClientCertificateChain returns an attribute KeyValue conforming to the
+// "tls.client.certificate_chain" semantic conventions. It represents the array
+// of PEM-encoded certificates that make up the certificate chain offered by
+// the client. This is usually mutually-exclusive of `client.certificate` since
+// that value should be the first certificate in the chain.
+func TLSClientCertificateChain(val ...string) attribute.KeyValue {
+ return TLSClientCertificateChainKey.StringSlice(val)
+}
+
+// TLSClientHashMd5 returns an attribute KeyValue conforming to the
+// "tls.client.hash.md5" semantic conventions. It represents the certificate
+// fingerprint using the MD5 digest of DER-encoded version of certificate
+// offered by the client. For consistency with other hash values, this value
+// should be formatted as an uppercase hash.
+func TLSClientHashMd5(val string) attribute.KeyValue {
+ return TLSClientHashMd5Key.String(val)
+}
+
+// TLSClientHashSha1 returns an attribute KeyValue conforming to the
+// "tls.client.hash.sha1" semantic conventions. It represents the certificate
+// fingerprint using the SHA1 digest of DER-encoded version of certificate
+// offered by the client. For consistency with other hash values, this value
+// should be formatted as an uppercase hash.
+func TLSClientHashSha1(val string) attribute.KeyValue {
+ return TLSClientHashSha1Key.String(val)
+}
+
+// TLSClientHashSha256 returns an attribute KeyValue conforming to the
+// "tls.client.hash.sha256" semantic conventions. It represents the certificate
+// fingerprint using the SHA256 digest of DER-encoded version of certificate
+// offered by the client. For consistency with other hash values, this value
+// should be formatted as an uppercase hash.
+func TLSClientHashSha256(val string) attribute.KeyValue {
+ return TLSClientHashSha256Key.String(val)
+}
+
+// TLSClientIssuer returns an attribute KeyValue conforming to the
+// "tls.client.issuer" semantic conventions. It represents the distinguished
+// name of
+// [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of
+// the issuer of the x.509 certificate presented by the client.
+func TLSClientIssuer(val string) attribute.KeyValue {
+ return TLSClientIssuerKey.String(val)
+}
+
+// TLSClientJa3 returns an attribute KeyValue conforming to the
+// "tls.client.ja3" semantic conventions. It represents a hash that identifies
+// clients based on how they perform an SSL/TLS handshake.
+func TLSClientJa3(val string) attribute.KeyValue {
+ return TLSClientJa3Key.String(val)
+}
+
+// TLSClientNotAfter returns an attribute KeyValue conforming to the
+// "tls.client.not_after" semantic conventions. It represents the date/Time
+// indicating when client certificate is no longer considered valid.
+func TLSClientNotAfter(val string) attribute.KeyValue {
+ return TLSClientNotAfterKey.String(val)
+}
+
+// TLSClientNotBefore returns an attribute KeyValue conforming to the
+// "tls.client.not_before" semantic conventions. It represents the date/Time
+// indicating when client certificate is first considered valid.
+func TLSClientNotBefore(val string) attribute.KeyValue {
+ return TLSClientNotBeforeKey.String(val)
+}
+
+// TLSClientServerName returns an attribute KeyValue conforming to the
+// "tls.client.server_name" semantic conventions. It represents the also called
+// an SNI, this tells the server which hostname to which the client is
+// attempting to connect to.
+func TLSClientServerName(val string) attribute.KeyValue {
+ return TLSClientServerNameKey.String(val)
+}
+
+// TLSClientSubject returns an attribute KeyValue conforming to the
+// "tls.client.subject" semantic conventions. It represents the distinguished
+// name of subject of the x.509 certificate presented by the client.
+func TLSClientSubject(val string) attribute.KeyValue {
+ return TLSClientSubjectKey.String(val)
+}
+
+// TLSClientSupportedCiphers returns an attribute KeyValue conforming to the
+// "tls.client.supported_ciphers" semantic conventions. It represents the array
+// of ciphers offered by the client during the client hello.
+func TLSClientSupportedCiphers(val ...string) attribute.KeyValue {
+ return TLSClientSupportedCiphersKey.StringSlice(val)
+}
+
+// TLSCurve returns an attribute KeyValue conforming to the "tls.curve"
+// semantic conventions. It represents the string indicating the curve used for
+// the given cipher, when applicable
+func TLSCurve(val string) attribute.KeyValue {
+ return TLSCurveKey.String(val)
+}
+
+// TLSEstablished returns an attribute KeyValue conforming to the
+// "tls.established" semantic conventions. It represents the boolean flag
+// indicating if the TLS negotiation was successful and transitioned to an
+// encrypted tunnel.
+func TLSEstablished(val bool) attribute.KeyValue {
+ return TLSEstablishedKey.Bool(val)
+}
+
+// TLSNextProtocol returns an attribute KeyValue conforming to the
+// "tls.next_protocol" semantic conventions. It represents the string
+// indicating the protocol being tunneled. Per the values in the [IANA
+// registry](https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids),
+// this string should be lower case.
+func TLSNextProtocol(val string) attribute.KeyValue {
+ return TLSNextProtocolKey.String(val)
+}
+
+// TLSProtocolVersion returns an attribute KeyValue conforming to the
+// "tls.protocol.version" semantic conventions. It represents the numeric part
+// of the version parsed from the original string of the negotiated [SSL/TLS
+// protocol
+// version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES)
+func TLSProtocolVersion(val string) attribute.KeyValue {
+ return TLSProtocolVersionKey.String(val)
+}
+
+// TLSResumed returns an attribute KeyValue conforming to the "tls.resumed"
+// semantic conventions. It represents the boolean flag indicating if this TLS
+// connection was resumed from an existing TLS negotiation.
+func TLSResumed(val bool) attribute.KeyValue {
+ return TLSResumedKey.Bool(val)
+}
+
+// TLSServerCertificate returns an attribute KeyValue conforming to the
+// "tls.server.certificate" semantic conventions. It represents the pEM-encoded
+// stand-alone certificate offered by the server. This is usually
+// mutually-exclusive of `server.certificate_chain` since this value also
+// exists in that list.
+func TLSServerCertificate(val string) attribute.KeyValue {
+ return TLSServerCertificateKey.String(val)
+}
+
+// TLSServerCertificateChain returns an attribute KeyValue conforming to the
+// "tls.server.certificate_chain" semantic conventions. It represents the array
+// of PEM-encoded certificates that make up the certificate chain offered by
+// the server. This is usually mutually-exclusive of `server.certificate` since
+// that value should be the first certificate in the chain.
+func TLSServerCertificateChain(val ...string) attribute.KeyValue {
+ return TLSServerCertificateChainKey.StringSlice(val)
+}
+
+// TLSServerHashMd5 returns an attribute KeyValue conforming to the
+// "tls.server.hash.md5" semantic conventions. It represents the certificate
+// fingerprint using the MD5 digest of DER-encoded version of certificate
+// offered by the server. For consistency with other hash values, this value
+// should be formatted as an uppercase hash.
+func TLSServerHashMd5(val string) attribute.KeyValue {
+ return TLSServerHashMd5Key.String(val)
+}
+
+// TLSServerHashSha1 returns an attribute KeyValue conforming to the
+// "tls.server.hash.sha1" semantic conventions. It represents the certificate
+// fingerprint using the SHA1 digest of DER-encoded version of certificate
+// offered by the server. For consistency with other hash values, this value
+// should be formatted as an uppercase hash.
+func TLSServerHashSha1(val string) attribute.KeyValue {
+ return TLSServerHashSha1Key.String(val)
+}
+
+// TLSServerHashSha256 returns an attribute KeyValue conforming to the
+// "tls.server.hash.sha256" semantic conventions. It represents the certificate
+// fingerprint using the SHA256 digest of DER-encoded version of certificate
+// offered by the server. For consistency with other hash values, this value
+// should be formatted as an uppercase hash.
+func TLSServerHashSha256(val string) attribute.KeyValue {
+ return TLSServerHashSha256Key.String(val)
+}
+
+// TLSServerIssuer returns an attribute KeyValue conforming to the
+// "tls.server.issuer" semantic conventions. It represents the distinguished
+// name of
+// [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of
+// the issuer of the x.509 certificate presented by the client.
+func TLSServerIssuer(val string) attribute.KeyValue {
+ return TLSServerIssuerKey.String(val)
+}
+
+// TLSServerJa3s returns an attribute KeyValue conforming to the
+// "tls.server.ja3s" semantic conventions. It represents a hash that identifies
+// servers based on how they perform an SSL/TLS handshake.
+func TLSServerJa3s(val string) attribute.KeyValue {
+ return TLSServerJa3sKey.String(val)
+}
+
+// TLSServerNotAfter returns an attribute KeyValue conforming to the
+// "tls.server.not_after" semantic conventions. It represents the date/Time
+// indicating when server certificate is no longer considered valid.
+func TLSServerNotAfter(val string) attribute.KeyValue {
+ return TLSServerNotAfterKey.String(val)
+}
+
+// TLSServerNotBefore returns an attribute KeyValue conforming to the
+// "tls.server.not_before" semantic conventions. It represents the date/Time
+// indicating when server certificate is first considered valid.
+func TLSServerNotBefore(val string) attribute.KeyValue {
+ return TLSServerNotBeforeKey.String(val)
+}
+
+// TLSServerSubject returns an attribute KeyValue conforming to the
+// "tls.server.subject" semantic conventions. It represents the distinguished
+// name of subject of the x.509 certificate presented by the server.
+func TLSServerSubject(val string) attribute.KeyValue {
+ return TLSServerSubjectKey.String(val)
+}
+
+// Attributes describing URL.
+const (
+ // URLDomainKey is the attribute Key conforming to the "url.domain"
+ // semantic conventions. It represents the domain extracted from the
+ // `url.full`, such as "opentelemetry.io".
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'www.foo.bar', 'opentelemetry.io', '3.12.167.2',
+ // '[1080:0:0:0:8:800:200C:417A]'
+ // Note: In some cases a URL may refer to an IP and/or port directly,
+ // without a domain name. In this case, the IP address would go to the
+ // domain field. If the URL contains a [literal IPv6
+ // address](https://www.rfc-editor.org/rfc/rfc2732#section-2) enclosed by
+ // `[` and `]`, the `[` and `]` characters should also be captured in the
+ // domain field.
+ URLDomainKey = attribute.Key("url.domain")
+
+ // URLExtensionKey is the attribute Key conforming to the "url.extension"
+ // semantic conventions. It represents the file extension extracted from
+ // the `url.full`, excluding the leading dot.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'png', 'gz'
+ // Note: The file extension is only set if it exists, as not every url has
+ // a file extension. When the file name has multiple extensions
+ // `example.tar.gz`, only the last one should be captured `gz`, not
+ // `tar.gz`.
+ URLExtensionKey = attribute.Key("url.extension")
+
+ // URLFragmentKey is the attribute Key conforming to the "url.fragment"
+ // semantic conventions. It represents the [URI
+ // fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'SemConv'
+ URLFragmentKey = attribute.Key("url.fragment")
+
+ // URLFullKey is the attribute Key conforming to the "url.full" semantic
+ // conventions. It represents the absolute URL describing a network
+ // resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986)
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'https://www.foo.bar/search?q=OpenTelemetry#SemConv',
+ // '//localhost'
+ // Note: For network calls, URL usually has
+ // `scheme://host[:port][path][?query][#fragment]` format, where the
+ // fragment is not transmitted over HTTP, but if it is known, it SHOULD be
+ // included nevertheless.
+ // `url.full` MUST NOT contain credentials passed via URL in form of
+ // `https://username:password@www.example.com/`. In such case username and
+ // password SHOULD be redacted and attribute's value SHOULD be
+ // `https://REDACTED:REDACTED@www.example.com/`.
+ // `url.full` SHOULD capture the absolute URL when it is available (or can
+ // be reconstructed). Sensitive content provided in `url.full` SHOULD be
+ // scrubbed when instrumentations can identify it.
+ URLFullKey = attribute.Key("url.full")
+
+ // URLOriginalKey is the attribute Key conforming to the "url.original"
+ // semantic conventions. It represents the unmodified original URL as seen
+ // in the event source.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'https://www.foo.bar/search?q=OpenTelemetry#SemConv',
+ // 'search?q=OpenTelemetry'
+ // Note: In network monitoring, the observed URL may be a full URL, whereas
+ // in access logs, the URL is often just represented as a path. This field
+ // is meant to represent the URL as it was observed, complete or not.
+ // `url.original` might contain credentials passed via URL in form of
+ // `https://username:password@www.example.com/`. In such case password and
+ // username SHOULD NOT be redacted and attribute's value SHOULD remain the
+ // same.
+ URLOriginalKey = attribute.Key("url.original")
+
+ // URLPathKey is the attribute Key conforming to the "url.path" semantic
+ // conventions. It represents the [URI
+ // path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: '/search'
+ // Note: Sensitive content provided in `url.path` SHOULD be scrubbed when
+ // instrumentations can identify it.
+ URLPathKey = attribute.Key("url.path")
+
+ // URLPortKey is the attribute Key conforming to the "url.port" semantic
+ // conventions. It represents the port extracted from the `url.full`
+ //
+ // Type: int
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 443
+ URLPortKey = attribute.Key("url.port")
+
+ // URLQueryKey is the attribute Key conforming to the "url.query" semantic
+ // conventions. It represents the [URI
+ // query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'q=OpenTelemetry'
+ // Note: Sensitive content provided in `url.query` SHOULD be scrubbed when
+ // instrumentations can identify it.
+ URLQueryKey = attribute.Key("url.query")
+
+ // URLRegisteredDomainKey is the attribute Key conforming to the
+ // "url.registered_domain" semantic conventions. It represents the highest
+ // registered url domain, stripped of the subdomain.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'example.com', 'foo.co.uk'
+ // Note: This value can be determined precisely with the [public suffix
+ // list](http://publicsuffix.org). For example, the registered domain for
+ // `foo.example.com` is `example.com`. Trying to approximate this by simply
+ // taking the last two labels will not work well for TLDs such as `co.uk`.
+ URLRegisteredDomainKey = attribute.Key("url.registered_domain")
+
+ // URLSchemeKey is the attribute Key conforming to the "url.scheme"
+ // semantic conventions. It represents the [URI
+ // scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component
+ // identifying the used protocol.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'https', 'ftp', 'telnet'
+ URLSchemeKey = attribute.Key("url.scheme")
+
+ // URLSubdomainKey is the attribute Key conforming to the "url.subdomain"
+ // semantic conventions. It represents the subdomain portion of a fully
+ // qualified domain name includes all of the names except the host name
+ // under the registered_domain. In a partially qualified domain, or if the
+ // qualification level of the full name cannot be determined, subdomain
+ // contains all of the names below the registered domain.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'east', 'sub2.sub1'
+ // Note: The subdomain portion of `www.east.mydomain.co.uk` is `east`. If
+ // the domain has multiple levels of subdomain, such as
+ // `sub2.sub1.example.com`, the subdomain field should contain `sub2.sub1`,
+ // with no trailing period.
+ URLSubdomainKey = attribute.Key("url.subdomain")
+
+ // URLTemplateKey is the attribute Key conforming to the "url.template"
+ // semantic conventions. It represents the low-cardinality template of an
+ // [absolute path
+ // reference](https://www.rfc-editor.org/rfc/rfc3986#section-4.2).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '/users/{id}', '/users/:id', '/users?id={id}'
+ URLTemplateKey = attribute.Key("url.template")
+
+ // URLTopLevelDomainKey is the attribute Key conforming to the
+ // "url.top_level_domain" semantic conventions. It represents the effective
+ // top level domain (eTLD), also known as the domain suffix, is the last
+ // part of the domain name. For example, the top level domain for
+ // example.com is `com`.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'com', 'co.uk'
+ // Note: This value can be determined precisely with the [public suffix
+ // list](http://publicsuffix.org).
+ URLTopLevelDomainKey = attribute.Key("url.top_level_domain")
+)
+
+// URLDomain returns an attribute KeyValue conforming to the "url.domain"
+// semantic conventions. It represents the domain extracted from the
+// `url.full`, such as "opentelemetry.io".
+func URLDomain(val string) attribute.KeyValue {
+ return URLDomainKey.String(val)
+}
+
+// URLExtension returns an attribute KeyValue conforming to the
+// "url.extension" semantic conventions. It represents the file extension
+// extracted from the `url.full`, excluding the leading dot.
+func URLExtension(val string) attribute.KeyValue {
+ return URLExtensionKey.String(val)
+}
+
+// URLFragment returns an attribute KeyValue conforming to the
+// "url.fragment" semantic conventions. It represents the [URI
+// fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component
+func URLFragment(val string) attribute.KeyValue {
+ return URLFragmentKey.String(val)
+}
+
+// URLFull returns an attribute KeyValue conforming to the "url.full"
+// semantic conventions. It represents the absolute URL describing a network
+// resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986)
+func URLFull(val string) attribute.KeyValue {
+ return URLFullKey.String(val)
+}
+
+// URLOriginal returns an attribute KeyValue conforming to the
+// "url.original" semantic conventions. It represents the unmodified original
+// URL as seen in the event source.
+func URLOriginal(val string) attribute.KeyValue {
+ return URLOriginalKey.String(val)
+}
+
+// URLPath returns an attribute KeyValue conforming to the "url.path"
+// semantic conventions. It represents the [URI
+// path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component
+func URLPath(val string) attribute.KeyValue {
+ return URLPathKey.String(val)
+}
+
+// URLPort returns an attribute KeyValue conforming to the "url.port"
+// semantic conventions. It represents the port extracted from the `url.full`
+func URLPort(val int) attribute.KeyValue {
+ return URLPortKey.Int(val)
+}
+
+// URLQuery returns an attribute KeyValue conforming to the "url.query"
+// semantic conventions. It represents the [URI
+// query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component
+func URLQuery(val string) attribute.KeyValue {
+ return URLQueryKey.String(val)
+}
+
+// URLRegisteredDomain returns an attribute KeyValue conforming to the
+// "url.registered_domain" semantic conventions. It represents the highest
+// registered url domain, stripped of the subdomain.
+func URLRegisteredDomain(val string) attribute.KeyValue {
+ return URLRegisteredDomainKey.String(val)
+}
+
+// URLScheme returns an attribute KeyValue conforming to the "url.scheme"
+// semantic conventions. It represents the [URI
+// scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component
+// identifying the used protocol.
+func URLScheme(val string) attribute.KeyValue {
+ return URLSchemeKey.String(val)
+}
+
+// URLSubdomain returns an attribute KeyValue conforming to the
+// "url.subdomain" semantic conventions. It represents the subdomain portion of
+// a fully qualified domain name includes all of the names except the host name
+// under the registered_domain. In a partially qualified domain, or if the
+// qualification level of the full name cannot be determined, subdomain
+// contains all of the names below the registered domain.
+func URLSubdomain(val string) attribute.KeyValue {
+ return URLSubdomainKey.String(val)
+}
+
+// URLTemplate returns an attribute KeyValue conforming to the
+// "url.template" semantic conventions. It represents the low-cardinality
+// template of an [absolute path
+// reference](https://www.rfc-editor.org/rfc/rfc3986#section-4.2).
+func URLTemplate(val string) attribute.KeyValue {
+ return URLTemplateKey.String(val)
+}
+
+// URLTopLevelDomain returns an attribute KeyValue conforming to the
+// "url.top_level_domain" semantic conventions. It represents the effective top
+// level domain (eTLD), also known as the domain suffix, is the last part of
+// the domain name. For example, the top level domain for example.com is `com`.
+func URLTopLevelDomain(val string) attribute.KeyValue {
+ return URLTopLevelDomainKey.String(val)
+}
+
+// Describes user-agent attributes.
+const (
+ // UserAgentNameKey is the attribute Key conforming to the
+ // "user_agent.name" semantic conventions. It represents the name of the
+ // user-agent extracted from original. Usually refers to the browser's
+ // name.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'Safari', 'YourApp'
+ // Note: [Example](https://www.whatsmyua.info) of extracting browser's name
+ // from original string. In the case of using a user-agent for non-browser
+ // products, such as microservices with multiple names/versions inside the
+ // `user_agent.original`, the most significant name SHOULD be selected. In
+ // such a scenario it should align with `user_agent.version`
+ UserAgentNameKey = attribute.Key("user_agent.name")
+
+ // UserAgentOriginalKey is the attribute Key conforming to the
+ // "user_agent.original" semantic conventions. It represents the value of
+ // the [HTTP
+ // User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent)
+ // header sent by the client.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: stable
+ // Examples: 'CERN-LineMode/2.15 libwww/2.17b3', 'Mozilla/5.0 (iPhone; CPU
+ // iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko)
+ // Version/14.1.2 Mobile/15E148 Safari/604.1', 'YourApp/1.0.0
+ // grpc-java-okhttp/1.27.2'
+ UserAgentOriginalKey = attribute.Key("user_agent.original")
+
+ // UserAgentVersionKey is the attribute Key conforming to the
+ // "user_agent.version" semantic conventions. It represents the version of
+ // the user-agent extracted from original. Usually refers to the browser's
+ // version
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '14.1.2', '1.0.0'
+ // Note: [Example](https://www.whatsmyua.info) of extracting browser's
+ // version from original string. In the case of using a user-agent for
+ // non-browser products, such as microservices with multiple names/versions
+ // inside the `user_agent.original`, the most significant version SHOULD be
+ // selected. In such a scenario it should align with `user_agent.name`
+ UserAgentVersionKey = attribute.Key("user_agent.version")
+)
+
+// UserAgentName returns an attribute KeyValue conforming to the
+// "user_agent.name" semantic conventions. It represents the name of the
+// user-agent extracted from original. Usually refers to the browser's name.
+func UserAgentName(val string) attribute.KeyValue {
+ return UserAgentNameKey.String(val)
+}
+
+// UserAgentOriginal returns an attribute KeyValue conforming to the
+// "user_agent.original" semantic conventions. It represents the value of the
+// [HTTP
+// User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent)
+// header sent by the client.
+func UserAgentOriginal(val string) attribute.KeyValue {
+ return UserAgentOriginalKey.String(val)
+}
+
+// UserAgentVersion returns an attribute KeyValue conforming to the
+// "user_agent.version" semantic conventions. It represents the version of the
+// user-agent extracted from original. Usually refers to the browser's version
+func UserAgentVersion(val string) attribute.KeyValue {
+ return UserAgentVersionKey.String(val)
+}
+
+// The attributes used to describe the packaged software running the
+// application code.
+const (
+ // WebEngineDescriptionKey is the attribute Key conforming to the
+ // "webengine.description" semantic conventions. It represents the
+ // additional description of the web engine (e.g. detailed version and
+ // edition information).
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) -
+ // 2.2.2.Final'
+ WebEngineDescriptionKey = attribute.Key("webengine.description")
+
+ // WebEngineNameKey is the attribute Key conforming to the "webengine.name"
+ // semantic conventions. It represents the name of the web engine.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: 'WildFly'
+ WebEngineNameKey = attribute.Key("webengine.name")
+
+ // WebEngineVersionKey is the attribute Key conforming to the
+ // "webengine.version" semantic conventions. It represents the version of
+ // the web engine.
+ //
+ // Type: string
+ // RequirementLevel: Optional
+ // Stability: experimental
+ // Examples: '21.0.0'
+ WebEngineVersionKey = attribute.Key("webengine.version")
+)
+
+// WebEngineDescription returns an attribute KeyValue conforming to the
+// "webengine.description" semantic conventions. It represents the additional
+// description of the web engine (e.g. detailed version and edition
+// information).
+func WebEngineDescription(val string) attribute.KeyValue {
+ return WebEngineDescriptionKey.String(val)
+}
+
+// WebEngineName returns an attribute KeyValue conforming to the
+// "webengine.name" semantic conventions. It represents the name of the web
+// engine.
+func WebEngineName(val string) attribute.KeyValue {
+ return WebEngineNameKey.String(val)
+}
+
+// WebEngineVersion returns an attribute KeyValue conforming to the
+// "webengine.version" semantic conventions. It represents the version of the
+// web engine.
+func WebEngineVersion(val string) attribute.KeyValue {
+ return WebEngineVersionKey.String(val)
+}
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/doc.go b/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/doc.go
new file mode 100644
index 00000000..d031bbea
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/doc.go
@@ -0,0 +1,9 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Package semconv implements OpenTelemetry semantic conventions.
+//
+// OpenTelemetry semantic conventions are agreed standardized naming
+// patterns for OpenTelemetry things. This package represents the v1.26.0
+// version of the OpenTelemetry semantic conventions.
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.26.0"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/exception.go b/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/exception.go
new file mode 100644
index 00000000..bfaee0d5
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/exception.go
@@ -0,0 +1,9 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.26.0"
+
+const (
+ // ExceptionEventName is the name of the Span event representing an exception.
+ ExceptionEventName = "exception"
+)
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/metric.go b/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/metric.go
new file mode 100644
index 00000000..fcdb9f48
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/metric.go
@@ -0,0 +1,1307 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Code generated from semantic convention specification. DO NOT EDIT.
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.26.0"
+
+const (
+
+ // ContainerCPUTime is the metric conforming to the "container.cpu.time"
+ // semantic conventions. It represents the total CPU time consumed.
+ // Instrument: counter
+ // Unit: s
+ // Stability: Experimental
+ ContainerCPUTimeName = "container.cpu.time"
+ ContainerCPUTimeUnit = "s"
+ ContainerCPUTimeDescription = "Total CPU time consumed"
+
+ // ContainerMemoryUsage is the metric conforming to the
+ // "container.memory.usage" semantic conventions. It represents the memory
+ // usage of the container.
+ // Instrument: counter
+ // Unit: By
+ // Stability: Experimental
+ ContainerMemoryUsageName = "container.memory.usage"
+ ContainerMemoryUsageUnit = "By"
+ ContainerMemoryUsageDescription = "Memory usage of the container."
+
+ // ContainerDiskIo is the metric conforming to the "container.disk.io" semantic
+ // conventions. It represents the disk bytes for the container.
+ // Instrument: counter
+ // Unit: By
+ // Stability: Experimental
+ ContainerDiskIoName = "container.disk.io"
+ ContainerDiskIoUnit = "By"
+ ContainerDiskIoDescription = "Disk bytes for the container."
+
+ // ContainerNetworkIo is the metric conforming to the "container.network.io"
+ // semantic conventions. It represents the network bytes for the container.
+ // Instrument: counter
+ // Unit: By
+ // Stability: Experimental
+ ContainerNetworkIoName = "container.network.io"
+ ContainerNetworkIoUnit = "By"
+ ContainerNetworkIoDescription = "Network bytes for the container."
+
+ // DBClientOperationDuration is the metric conforming to the
+ // "db.client.operation.duration" semantic conventions. It represents the
+ // duration of database client operations.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ DBClientOperationDurationName = "db.client.operation.duration"
+ DBClientOperationDurationUnit = "s"
+ DBClientOperationDurationDescription = "Duration of database client operations."
+
+ // DBClientConnectionCount is the metric conforming to the
+ // "db.client.connection.count" semantic conventions. It represents the number
+ // of connections that are currently in state described by the `state`
+ // attribute.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ DBClientConnectionCountName = "db.client.connection.count"
+ DBClientConnectionCountUnit = "{connection}"
+ DBClientConnectionCountDescription = "The number of connections that are currently in state described by the `state` attribute"
+
+ // DBClientConnectionIdleMax is the metric conforming to the
+ // "db.client.connection.idle.max" semantic conventions. It represents the
+ // maximum number of idle open connections allowed.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ DBClientConnectionIdleMaxName = "db.client.connection.idle.max"
+ DBClientConnectionIdleMaxUnit = "{connection}"
+ DBClientConnectionIdleMaxDescription = "The maximum number of idle open connections allowed"
+
+ // DBClientConnectionIdleMin is the metric conforming to the
+ // "db.client.connection.idle.min" semantic conventions. It represents the
+ // minimum number of idle open connections allowed.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ DBClientConnectionIdleMinName = "db.client.connection.idle.min"
+ DBClientConnectionIdleMinUnit = "{connection}"
+ DBClientConnectionIdleMinDescription = "The minimum number of idle open connections allowed"
+
+ // DBClientConnectionMax is the metric conforming to the
+ // "db.client.connection.max" semantic conventions. It represents the maximum
+ // number of open connections allowed.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ DBClientConnectionMaxName = "db.client.connection.max"
+ DBClientConnectionMaxUnit = "{connection}"
+ DBClientConnectionMaxDescription = "The maximum number of open connections allowed"
+
+ // DBClientConnectionPendingRequests is the metric conforming to the
+ // "db.client.connection.pending_requests" semantic conventions. It represents
+ // the number of pending requests for an open connection, cumulative for the
+ // entire pool.
+ // Instrument: updowncounter
+ // Unit: {request}
+ // Stability: Experimental
+ DBClientConnectionPendingRequestsName = "db.client.connection.pending_requests"
+ DBClientConnectionPendingRequestsUnit = "{request}"
+ DBClientConnectionPendingRequestsDescription = "The number of pending requests for an open connection, cumulative for the entire pool"
+
+ // DBClientConnectionTimeouts is the metric conforming to the
+ // "db.client.connection.timeouts" semantic conventions. It represents the
+ // number of connection timeouts that have occurred trying to obtain a
+ // connection from the pool.
+ // Instrument: counter
+ // Unit: {timeout}
+ // Stability: Experimental
+ DBClientConnectionTimeoutsName = "db.client.connection.timeouts"
+ DBClientConnectionTimeoutsUnit = "{timeout}"
+ DBClientConnectionTimeoutsDescription = "The number of connection timeouts that have occurred trying to obtain a connection from the pool"
+
+ // DBClientConnectionCreateTime is the metric conforming to the
+ // "db.client.connection.create_time" semantic conventions. It represents the
+ // time it took to create a new connection.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ DBClientConnectionCreateTimeName = "db.client.connection.create_time"
+ DBClientConnectionCreateTimeUnit = "s"
+ DBClientConnectionCreateTimeDescription = "The time it took to create a new connection"
+
+ // DBClientConnectionWaitTime is the metric conforming to the
+ // "db.client.connection.wait_time" semantic conventions. It represents the
+ // time it took to obtain an open connection from the pool.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ DBClientConnectionWaitTimeName = "db.client.connection.wait_time"
+ DBClientConnectionWaitTimeUnit = "s"
+ DBClientConnectionWaitTimeDescription = "The time it took to obtain an open connection from the pool"
+
+ // DBClientConnectionUseTime is the metric conforming to the
+ // "db.client.connection.use_time" semantic conventions. It represents the time
+ // between borrowing a connection and returning it to the pool.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ DBClientConnectionUseTimeName = "db.client.connection.use_time"
+ DBClientConnectionUseTimeUnit = "s"
+ DBClientConnectionUseTimeDescription = "The time between borrowing a connection and returning it to the pool"
+
+ // DBClientConnectionsUsage is the metric conforming to the
+ // "db.client.connections.usage" semantic conventions. It represents the
+ // deprecated, use `db.client.connection.count` instead.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ DBClientConnectionsUsageName = "db.client.connections.usage"
+ DBClientConnectionsUsageUnit = "{connection}"
+ DBClientConnectionsUsageDescription = "Deprecated, use `db.client.connection.count` instead."
+
+ // DBClientConnectionsIdleMax is the metric conforming to the
+ // "db.client.connections.idle.max" semantic conventions. It represents the
+ // deprecated, use `db.client.connection.idle.max` instead.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ DBClientConnectionsIdleMaxName = "db.client.connections.idle.max"
+ DBClientConnectionsIdleMaxUnit = "{connection}"
+ DBClientConnectionsIdleMaxDescription = "Deprecated, use `db.client.connection.idle.max` instead."
+
+ // DBClientConnectionsIdleMin is the metric conforming to the
+ // "db.client.connections.idle.min" semantic conventions. It represents the
+ // deprecated, use `db.client.connection.idle.min` instead.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ DBClientConnectionsIdleMinName = "db.client.connections.idle.min"
+ DBClientConnectionsIdleMinUnit = "{connection}"
+ DBClientConnectionsIdleMinDescription = "Deprecated, use `db.client.connection.idle.min` instead."
+
+ // DBClientConnectionsMax is the metric conforming to the
+ // "db.client.connections.max" semantic conventions. It represents the
+ // deprecated, use `db.client.connection.max` instead.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ DBClientConnectionsMaxName = "db.client.connections.max"
+ DBClientConnectionsMaxUnit = "{connection}"
+ DBClientConnectionsMaxDescription = "Deprecated, use `db.client.connection.max` instead."
+
+ // DBClientConnectionsPendingRequests is the metric conforming to the
+ // "db.client.connections.pending_requests" semantic conventions. It represents
+ // the deprecated, use `db.client.connection.pending_requests` instead.
+ // Instrument: updowncounter
+ // Unit: {request}
+ // Stability: Experimental
+ DBClientConnectionsPendingRequestsName = "db.client.connections.pending_requests"
+ DBClientConnectionsPendingRequestsUnit = "{request}"
+ DBClientConnectionsPendingRequestsDescription = "Deprecated, use `db.client.connection.pending_requests` instead."
+
+ // DBClientConnectionsTimeouts is the metric conforming to the
+ // "db.client.connections.timeouts" semantic conventions. It represents the
+ // deprecated, use `db.client.connection.timeouts` instead.
+ // Instrument: counter
+ // Unit: {timeout}
+ // Stability: Experimental
+ DBClientConnectionsTimeoutsName = "db.client.connections.timeouts"
+ DBClientConnectionsTimeoutsUnit = "{timeout}"
+ DBClientConnectionsTimeoutsDescription = "Deprecated, use `db.client.connection.timeouts` instead."
+
+ // DBClientConnectionsCreateTime is the metric conforming to the
+ // "db.client.connections.create_time" semantic conventions. It represents the
+ // deprecated, use `db.client.connection.create_time` instead. Note: the unit
+ // also changed from `ms` to `s`.
+ // Instrument: histogram
+ // Unit: ms
+ // Stability: Experimental
+ DBClientConnectionsCreateTimeName = "db.client.connections.create_time"
+ DBClientConnectionsCreateTimeUnit = "ms"
+ DBClientConnectionsCreateTimeDescription = "Deprecated, use `db.client.connection.create_time` instead. Note: the unit also changed from `ms` to `s`."
+
+ // DBClientConnectionsWaitTime is the metric conforming to the
+ // "db.client.connections.wait_time" semantic conventions. It represents the
+ // deprecated, use `db.client.connection.wait_time` instead. Note: the unit
+ // also changed from `ms` to `s`.
+ // Instrument: histogram
+ // Unit: ms
+ // Stability: Experimental
+ DBClientConnectionsWaitTimeName = "db.client.connections.wait_time"
+ DBClientConnectionsWaitTimeUnit = "ms"
+ DBClientConnectionsWaitTimeDescription = "Deprecated, use `db.client.connection.wait_time` instead. Note: the unit also changed from `ms` to `s`."
+
+ // DBClientConnectionsUseTime is the metric conforming to the
+ // "db.client.connections.use_time" semantic conventions. It represents the
+ // deprecated, use `db.client.connection.use_time` instead. Note: the unit also
+ // changed from `ms` to `s`.
+ // Instrument: histogram
+ // Unit: ms
+ // Stability: Experimental
+ DBClientConnectionsUseTimeName = "db.client.connections.use_time"
+ DBClientConnectionsUseTimeUnit = "ms"
+ DBClientConnectionsUseTimeDescription = "Deprecated, use `db.client.connection.use_time` instead. Note: the unit also changed from `ms` to `s`."
+
+ // DNSLookupDuration is the metric conforming to the "dns.lookup.duration"
+ // semantic conventions. It represents the measures the time taken to perform a
+ // DNS lookup.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ DNSLookupDurationName = "dns.lookup.duration"
+ DNSLookupDurationUnit = "s"
+ DNSLookupDurationDescription = "Measures the time taken to perform a DNS lookup."
+
+ // AspnetcoreRoutingMatchAttempts is the metric conforming to the
+ // "aspnetcore.routing.match_attempts" semantic conventions. It represents the
+ // number of requests that were attempted to be matched to an endpoint.
+ // Instrument: counter
+ // Unit: {match_attempt}
+ // Stability: Stable
+ AspnetcoreRoutingMatchAttemptsName = "aspnetcore.routing.match_attempts"
+ AspnetcoreRoutingMatchAttemptsUnit = "{match_attempt}"
+ AspnetcoreRoutingMatchAttemptsDescription = "Number of requests that were attempted to be matched to an endpoint."
+
+ // AspnetcoreDiagnosticsExceptions is the metric conforming to the
+ // "aspnetcore.diagnostics.exceptions" semantic conventions. It represents the
+ // number of exceptions caught by exception handling middleware.
+ // Instrument: counter
+ // Unit: {exception}
+ // Stability: Stable
+ AspnetcoreDiagnosticsExceptionsName = "aspnetcore.diagnostics.exceptions"
+ AspnetcoreDiagnosticsExceptionsUnit = "{exception}"
+ AspnetcoreDiagnosticsExceptionsDescription = "Number of exceptions caught by exception handling middleware."
+
+ // AspnetcoreRateLimitingActiveRequestLeases is the metric conforming to the
+ // "aspnetcore.rate_limiting.active_request_leases" semantic conventions. It
+ // represents the number of requests that are currently active on the server
+ // that hold a rate limiting lease.
+ // Instrument: updowncounter
+ // Unit: {request}
+ // Stability: Stable
+ AspnetcoreRateLimitingActiveRequestLeasesName = "aspnetcore.rate_limiting.active_request_leases"
+ AspnetcoreRateLimitingActiveRequestLeasesUnit = "{request}"
+ AspnetcoreRateLimitingActiveRequestLeasesDescription = "Number of requests that are currently active on the server that hold a rate limiting lease."
+
+ // AspnetcoreRateLimitingRequestLeaseDuration is the metric conforming to the
+ // "aspnetcore.rate_limiting.request_lease.duration" semantic conventions. It
+ // represents the duration of rate limiting lease held by requests on the
+ // server.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Stable
+ AspnetcoreRateLimitingRequestLeaseDurationName = "aspnetcore.rate_limiting.request_lease.duration"
+ AspnetcoreRateLimitingRequestLeaseDurationUnit = "s"
+ AspnetcoreRateLimitingRequestLeaseDurationDescription = "The duration of rate limiting lease held by requests on the server."
+
+ // AspnetcoreRateLimitingRequestTimeInQueue is the metric conforming to the
+ // "aspnetcore.rate_limiting.request.time_in_queue" semantic conventions. It
+ // represents the time the request spent in a queue waiting to acquire a rate
+ // limiting lease.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Stable
+ AspnetcoreRateLimitingRequestTimeInQueueName = "aspnetcore.rate_limiting.request.time_in_queue"
+ AspnetcoreRateLimitingRequestTimeInQueueUnit = "s"
+ AspnetcoreRateLimitingRequestTimeInQueueDescription = "The time the request spent in a queue waiting to acquire a rate limiting lease."
+
+ // AspnetcoreRateLimitingQueuedRequests is the metric conforming to the
+ // "aspnetcore.rate_limiting.queued_requests" semantic conventions. It
+ // represents the number of requests that are currently queued, waiting to
+ // acquire a rate limiting lease.
+ // Instrument: updowncounter
+ // Unit: {request}
+ // Stability: Stable
+ AspnetcoreRateLimitingQueuedRequestsName = "aspnetcore.rate_limiting.queued_requests"
+ AspnetcoreRateLimitingQueuedRequestsUnit = "{request}"
+ AspnetcoreRateLimitingQueuedRequestsDescription = "Number of requests that are currently queued, waiting to acquire a rate limiting lease."
+
+ // AspnetcoreRateLimitingRequests is the metric conforming to the
+ // "aspnetcore.rate_limiting.requests" semantic conventions. It represents the
+ // number of requests that tried to acquire a rate limiting lease.
+ // Instrument: counter
+ // Unit: {request}
+ // Stability: Stable
+ AspnetcoreRateLimitingRequestsName = "aspnetcore.rate_limiting.requests"
+ AspnetcoreRateLimitingRequestsUnit = "{request}"
+ AspnetcoreRateLimitingRequestsDescription = "Number of requests that tried to acquire a rate limiting lease."
+
+ // KestrelActiveConnections is the metric conforming to the
+ // "kestrel.active_connections" semantic conventions. It represents the number
+ // of connections that are currently active on the server.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Stable
+ KestrelActiveConnectionsName = "kestrel.active_connections"
+ KestrelActiveConnectionsUnit = "{connection}"
+ KestrelActiveConnectionsDescription = "Number of connections that are currently active on the server."
+
+ // KestrelConnectionDuration is the metric conforming to the
+ // "kestrel.connection.duration" semantic conventions. It represents the
+ // duration of connections on the server.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Stable
+ KestrelConnectionDurationName = "kestrel.connection.duration"
+ KestrelConnectionDurationUnit = "s"
+ KestrelConnectionDurationDescription = "The duration of connections on the server."
+
+ // KestrelRejectedConnections is the metric conforming to the
+ // "kestrel.rejected_connections" semantic conventions. It represents the
+ // number of connections rejected by the server.
+ // Instrument: counter
+ // Unit: {connection}
+ // Stability: Stable
+ KestrelRejectedConnectionsName = "kestrel.rejected_connections"
+ KestrelRejectedConnectionsUnit = "{connection}"
+ KestrelRejectedConnectionsDescription = "Number of connections rejected by the server."
+
+ // KestrelQueuedConnections is the metric conforming to the
+ // "kestrel.queued_connections" semantic conventions. It represents the number
+ // of connections that are currently queued and are waiting to start.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Stable
+ KestrelQueuedConnectionsName = "kestrel.queued_connections"
+ KestrelQueuedConnectionsUnit = "{connection}"
+ KestrelQueuedConnectionsDescription = "Number of connections that are currently queued and are waiting to start."
+
+ // KestrelQueuedRequests is the metric conforming to the
+ // "kestrel.queued_requests" semantic conventions. It represents the number of
+ // HTTP requests on multiplexed connections (HTTP/2 and HTTP/3) that are
+ // currently queued and are waiting to start.
+ // Instrument: updowncounter
+ // Unit: {request}
+ // Stability: Stable
+ KestrelQueuedRequestsName = "kestrel.queued_requests"
+ KestrelQueuedRequestsUnit = "{request}"
+ KestrelQueuedRequestsDescription = "Number of HTTP requests on multiplexed connections (HTTP/2 and HTTP/3) that are currently queued and are waiting to start."
+
+ // KestrelUpgradedConnections is the metric conforming to the
+ // "kestrel.upgraded_connections" semantic conventions. It represents the
+ // number of connections that are currently upgraded (WebSockets). .
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Stable
+ KestrelUpgradedConnectionsName = "kestrel.upgraded_connections"
+ KestrelUpgradedConnectionsUnit = "{connection}"
+ KestrelUpgradedConnectionsDescription = "Number of connections that are currently upgraded (WebSockets). ."
+
+ // KestrelTLSHandshakeDuration is the metric conforming to the
+ // "kestrel.tls_handshake.duration" semantic conventions. It represents the
+ // duration of TLS handshakes on the server.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Stable
+ KestrelTLSHandshakeDurationName = "kestrel.tls_handshake.duration"
+ KestrelTLSHandshakeDurationUnit = "s"
+ KestrelTLSHandshakeDurationDescription = "The duration of TLS handshakes on the server."
+
+ // KestrelActiveTLSHandshakes is the metric conforming to the
+ // "kestrel.active_tls_handshakes" semantic conventions. It represents the
+ // number of TLS handshakes that are currently in progress on the server.
+ // Instrument: updowncounter
+ // Unit: {handshake}
+ // Stability: Stable
+ KestrelActiveTLSHandshakesName = "kestrel.active_tls_handshakes"
+ KestrelActiveTLSHandshakesUnit = "{handshake}"
+ KestrelActiveTLSHandshakesDescription = "Number of TLS handshakes that are currently in progress on the server."
+
+ // SignalrServerConnectionDuration is the metric conforming to the
+ // "signalr.server.connection.duration" semantic conventions. It represents the
+ // duration of connections on the server.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Stable
+ SignalrServerConnectionDurationName = "signalr.server.connection.duration"
+ SignalrServerConnectionDurationUnit = "s"
+ SignalrServerConnectionDurationDescription = "The duration of connections on the server."
+
+ // SignalrServerActiveConnections is the metric conforming to the
+ // "signalr.server.active_connections" semantic conventions. It represents the
+ // number of connections that are currently active on the server.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Stable
+ SignalrServerActiveConnectionsName = "signalr.server.active_connections"
+ SignalrServerActiveConnectionsUnit = "{connection}"
+ SignalrServerActiveConnectionsDescription = "Number of connections that are currently active on the server."
+
+ // FaaSInvokeDuration is the metric conforming to the "faas.invoke_duration"
+ // semantic conventions. It represents the measures the duration of the
+ // function's logic execution.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ FaaSInvokeDurationName = "faas.invoke_duration"
+ FaaSInvokeDurationUnit = "s"
+ FaaSInvokeDurationDescription = "Measures the duration of the function's logic execution"
+
+ // FaaSInitDuration is the metric conforming to the "faas.init_duration"
+ // semantic conventions. It represents the measures the duration of the
+ // function's initialization, such as a cold start.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ FaaSInitDurationName = "faas.init_duration"
+ FaaSInitDurationUnit = "s"
+ FaaSInitDurationDescription = "Measures the duration of the function's initialization, such as a cold start"
+
+ // FaaSColdstarts is the metric conforming to the "faas.coldstarts" semantic
+ // conventions. It represents the number of invocation cold starts.
+ // Instrument: counter
+ // Unit: {coldstart}
+ // Stability: Experimental
+ FaaSColdstartsName = "faas.coldstarts"
+ FaaSColdstartsUnit = "{coldstart}"
+ FaaSColdstartsDescription = "Number of invocation cold starts"
+
+ // FaaSErrors is the metric conforming to the "faas.errors" semantic
+ // conventions. It represents the number of invocation errors.
+ // Instrument: counter
+ // Unit: {error}
+ // Stability: Experimental
+ FaaSErrorsName = "faas.errors"
+ FaaSErrorsUnit = "{error}"
+ FaaSErrorsDescription = "Number of invocation errors"
+
+ // FaaSInvocations is the metric conforming to the "faas.invocations" semantic
+ // conventions. It represents the number of successful invocations.
+ // Instrument: counter
+ // Unit: {invocation}
+ // Stability: Experimental
+ FaaSInvocationsName = "faas.invocations"
+ FaaSInvocationsUnit = "{invocation}"
+ FaaSInvocationsDescription = "Number of successful invocations"
+
+ // FaaSTimeouts is the metric conforming to the "faas.timeouts" semantic
+ // conventions. It represents the number of invocation timeouts.
+ // Instrument: counter
+ // Unit: {timeout}
+ // Stability: Experimental
+ FaaSTimeoutsName = "faas.timeouts"
+ FaaSTimeoutsUnit = "{timeout}"
+ FaaSTimeoutsDescription = "Number of invocation timeouts"
+
+ // FaaSMemUsage is the metric conforming to the "faas.mem_usage" semantic
+ // conventions. It represents the distribution of max memory usage per
+ // invocation.
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ FaaSMemUsageName = "faas.mem_usage"
+ FaaSMemUsageUnit = "By"
+ FaaSMemUsageDescription = "Distribution of max memory usage per invocation"
+
+ // FaaSCPUUsage is the metric conforming to the "faas.cpu_usage" semantic
+ // conventions. It represents the distribution of CPU usage per invocation.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ FaaSCPUUsageName = "faas.cpu_usage"
+ FaaSCPUUsageUnit = "s"
+ FaaSCPUUsageDescription = "Distribution of CPU usage per invocation"
+
+ // FaaSNetIo is the metric conforming to the "faas.net_io" semantic
+ // conventions. It represents the distribution of net I/O usage per invocation.
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ FaaSNetIoName = "faas.net_io"
+ FaaSNetIoUnit = "By"
+ FaaSNetIoDescription = "Distribution of net I/O usage per invocation"
+
+ // HTTPServerRequestDuration is the metric conforming to the
+ // "http.server.request.duration" semantic conventions. It represents the
+ // duration of HTTP server requests.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Stable
+ HTTPServerRequestDurationName = "http.server.request.duration"
+ HTTPServerRequestDurationUnit = "s"
+ HTTPServerRequestDurationDescription = "Duration of HTTP server requests."
+
+ // HTTPServerActiveRequests is the metric conforming to the
+ // "http.server.active_requests" semantic conventions. It represents the number
+ // of active HTTP server requests.
+ // Instrument: updowncounter
+ // Unit: {request}
+ // Stability: Experimental
+ HTTPServerActiveRequestsName = "http.server.active_requests"
+ HTTPServerActiveRequestsUnit = "{request}"
+ HTTPServerActiveRequestsDescription = "Number of active HTTP server requests."
+
+ // HTTPServerRequestBodySize is the metric conforming to the
+ // "http.server.request.body.size" semantic conventions. It represents the size
+ // of HTTP server request bodies.
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ HTTPServerRequestBodySizeName = "http.server.request.body.size"
+ HTTPServerRequestBodySizeUnit = "By"
+ HTTPServerRequestBodySizeDescription = "Size of HTTP server request bodies."
+
+ // HTTPServerResponseBodySize is the metric conforming to the
+ // "http.server.response.body.size" semantic conventions. It represents the
+ // size of HTTP server response bodies.
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ HTTPServerResponseBodySizeName = "http.server.response.body.size"
+ HTTPServerResponseBodySizeUnit = "By"
+ HTTPServerResponseBodySizeDescription = "Size of HTTP server response bodies."
+
+ // HTTPClientRequestDuration is the metric conforming to the
+ // "http.client.request.duration" semantic conventions. It represents the
+ // duration of HTTP client requests.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Stable
+ HTTPClientRequestDurationName = "http.client.request.duration"
+ HTTPClientRequestDurationUnit = "s"
+ HTTPClientRequestDurationDescription = "Duration of HTTP client requests."
+
+ // HTTPClientRequestBodySize is the metric conforming to the
+ // "http.client.request.body.size" semantic conventions. It represents the size
+ // of HTTP client request bodies.
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ HTTPClientRequestBodySizeName = "http.client.request.body.size"
+ HTTPClientRequestBodySizeUnit = "By"
+ HTTPClientRequestBodySizeDescription = "Size of HTTP client request bodies."
+
+ // HTTPClientResponseBodySize is the metric conforming to the
+ // "http.client.response.body.size" semantic conventions. It represents the
+ // size of HTTP client response bodies.
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ HTTPClientResponseBodySizeName = "http.client.response.body.size"
+ HTTPClientResponseBodySizeUnit = "By"
+ HTTPClientResponseBodySizeDescription = "Size of HTTP client response bodies."
+
+ // HTTPClientOpenConnections is the metric conforming to the
+ // "http.client.open_connections" semantic conventions. It represents the
+ // number of outbound HTTP connections that are currently active or idle on the
+ // client.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ HTTPClientOpenConnectionsName = "http.client.open_connections"
+ HTTPClientOpenConnectionsUnit = "{connection}"
+ HTTPClientOpenConnectionsDescription = "Number of outbound HTTP connections that are currently active or idle on the client."
+
+ // HTTPClientConnectionDuration is the metric conforming to the
+ // "http.client.connection.duration" semantic conventions. It represents the
+ // duration of the successfully established outbound HTTP connections.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ HTTPClientConnectionDurationName = "http.client.connection.duration"
+ HTTPClientConnectionDurationUnit = "s"
+ HTTPClientConnectionDurationDescription = "The duration of the successfully established outbound HTTP connections."
+
+ // HTTPClientActiveRequests is the metric conforming to the
+ // "http.client.active_requests" semantic conventions. It represents the number
+ // of active HTTP requests.
+ // Instrument: updowncounter
+ // Unit: {request}
+ // Stability: Experimental
+ HTTPClientActiveRequestsName = "http.client.active_requests"
+ HTTPClientActiveRequestsUnit = "{request}"
+ HTTPClientActiveRequestsDescription = "Number of active HTTP requests."
+
+ // JvmMemoryInit is the metric conforming to the "jvm.memory.init" semantic
+ // conventions. It represents the measure of initial memory requested.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ JvmMemoryInitName = "jvm.memory.init"
+ JvmMemoryInitUnit = "By"
+ JvmMemoryInitDescription = "Measure of initial memory requested."
+
+ // JvmSystemCPUUtilization is the metric conforming to the
+ // "jvm.system.cpu.utilization" semantic conventions. It represents the recent
+ // CPU utilization for the whole system as reported by the JVM.
+ // Instrument: gauge
+ // Unit: 1
+ // Stability: Experimental
+ JvmSystemCPUUtilizationName = "jvm.system.cpu.utilization"
+ JvmSystemCPUUtilizationUnit = "1"
+ JvmSystemCPUUtilizationDescription = "Recent CPU utilization for the whole system as reported by the JVM."
+
+ // JvmSystemCPULoad1m is the metric conforming to the "jvm.system.cpu.load_1m"
+ // semantic conventions. It represents the average CPU load of the whole system
+ // for the last minute as reported by the JVM.
+ // Instrument: gauge
+ // Unit: {run_queue_item}
+ // Stability: Experimental
+ JvmSystemCPULoad1mName = "jvm.system.cpu.load_1m"
+ JvmSystemCPULoad1mUnit = "{run_queue_item}"
+ JvmSystemCPULoad1mDescription = "Average CPU load of the whole system for the last minute as reported by the JVM."
+
+ // JvmBufferMemoryUsage is the metric conforming to the
+ // "jvm.buffer.memory.usage" semantic conventions. It represents the measure of
+ // memory used by buffers.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ JvmBufferMemoryUsageName = "jvm.buffer.memory.usage"
+ JvmBufferMemoryUsageUnit = "By"
+ JvmBufferMemoryUsageDescription = "Measure of memory used by buffers."
+
+ // JvmBufferMemoryLimit is the metric conforming to the
+ // "jvm.buffer.memory.limit" semantic conventions. It represents the measure of
+ // total memory capacity of buffers.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ JvmBufferMemoryLimitName = "jvm.buffer.memory.limit"
+ JvmBufferMemoryLimitUnit = "By"
+ JvmBufferMemoryLimitDescription = "Measure of total memory capacity of buffers."
+
+ // JvmBufferCount is the metric conforming to the "jvm.buffer.count" semantic
+ // conventions. It represents the number of buffers in the pool.
+ // Instrument: updowncounter
+ // Unit: {buffer}
+ // Stability: Experimental
+ JvmBufferCountName = "jvm.buffer.count"
+ JvmBufferCountUnit = "{buffer}"
+ JvmBufferCountDescription = "Number of buffers in the pool."
+
+ // JvmMemoryUsed is the metric conforming to the "jvm.memory.used" semantic
+ // conventions. It represents the measure of memory used.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Stable
+ JvmMemoryUsedName = "jvm.memory.used"
+ JvmMemoryUsedUnit = "By"
+ JvmMemoryUsedDescription = "Measure of memory used."
+
+ // JvmMemoryCommitted is the metric conforming to the "jvm.memory.committed"
+ // semantic conventions. It represents the measure of memory committed.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Stable
+ JvmMemoryCommittedName = "jvm.memory.committed"
+ JvmMemoryCommittedUnit = "By"
+ JvmMemoryCommittedDescription = "Measure of memory committed."
+
+ // JvmMemoryLimit is the metric conforming to the "jvm.memory.limit" semantic
+ // conventions. It represents the measure of max obtainable memory.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Stable
+ JvmMemoryLimitName = "jvm.memory.limit"
+ JvmMemoryLimitUnit = "By"
+ JvmMemoryLimitDescription = "Measure of max obtainable memory."
+
+ // JvmMemoryUsedAfterLastGc is the metric conforming to the
+ // "jvm.memory.used_after_last_gc" semantic conventions. It represents the
+ // measure of memory used, as measured after the most recent garbage collection
+ // event on this pool.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Stable
+ JvmMemoryUsedAfterLastGcName = "jvm.memory.used_after_last_gc"
+ JvmMemoryUsedAfterLastGcUnit = "By"
+ JvmMemoryUsedAfterLastGcDescription = "Measure of memory used, as measured after the most recent garbage collection event on this pool."
+
+ // JvmGcDuration is the metric conforming to the "jvm.gc.duration" semantic
+ // conventions. It represents the duration of JVM garbage collection actions.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Stable
+ JvmGcDurationName = "jvm.gc.duration"
+ JvmGcDurationUnit = "s"
+ JvmGcDurationDescription = "Duration of JVM garbage collection actions."
+
+ // JvmThreadCount is the metric conforming to the "jvm.thread.count" semantic
+ // conventions. It represents the number of executing platform threads.
+ // Instrument: updowncounter
+ // Unit: {thread}
+ // Stability: Stable
+ JvmThreadCountName = "jvm.thread.count"
+ JvmThreadCountUnit = "{thread}"
+ JvmThreadCountDescription = "Number of executing platform threads."
+
+ // JvmClassLoaded is the metric conforming to the "jvm.class.loaded" semantic
+ // conventions. It represents the number of classes loaded since JVM start.
+ // Instrument: counter
+ // Unit: {class}
+ // Stability: Stable
+ JvmClassLoadedName = "jvm.class.loaded"
+ JvmClassLoadedUnit = "{class}"
+ JvmClassLoadedDescription = "Number of classes loaded since JVM start."
+
+ // JvmClassUnloaded is the metric conforming to the "jvm.class.unloaded"
+ // semantic conventions. It represents the number of classes unloaded since JVM
+ // start.
+ // Instrument: counter
+ // Unit: {class}
+ // Stability: Stable
+ JvmClassUnloadedName = "jvm.class.unloaded"
+ JvmClassUnloadedUnit = "{class}"
+ JvmClassUnloadedDescription = "Number of classes unloaded since JVM start."
+
+ // JvmClassCount is the metric conforming to the "jvm.class.count" semantic
+ // conventions. It represents the number of classes currently loaded.
+ // Instrument: updowncounter
+ // Unit: {class}
+ // Stability: Stable
+ JvmClassCountName = "jvm.class.count"
+ JvmClassCountUnit = "{class}"
+ JvmClassCountDescription = "Number of classes currently loaded."
+
+ // JvmCPUCount is the metric conforming to the "jvm.cpu.count" semantic
+ // conventions. It represents the number of processors available to the Java
+ // virtual machine.
+ // Instrument: updowncounter
+ // Unit: {cpu}
+ // Stability: Stable
+ JvmCPUCountName = "jvm.cpu.count"
+ JvmCPUCountUnit = "{cpu}"
+ JvmCPUCountDescription = "Number of processors available to the Java virtual machine."
+
+ // JvmCPUTime is the metric conforming to the "jvm.cpu.time" semantic
+ // conventions. It represents the cPU time used by the process as reported by
+ // the JVM.
+ // Instrument: counter
+ // Unit: s
+ // Stability: Stable
+ JvmCPUTimeName = "jvm.cpu.time"
+ JvmCPUTimeUnit = "s"
+ JvmCPUTimeDescription = "CPU time used by the process as reported by the JVM."
+
+ // JvmCPURecentUtilization is the metric conforming to the
+ // "jvm.cpu.recent_utilization" semantic conventions. It represents the recent
+ // CPU utilization for the process as reported by the JVM.
+ // Instrument: gauge
+ // Unit: 1
+ // Stability: Stable
+ JvmCPURecentUtilizationName = "jvm.cpu.recent_utilization"
+ JvmCPURecentUtilizationUnit = "1"
+ JvmCPURecentUtilizationDescription = "Recent CPU utilization for the process as reported by the JVM."
+
+ // MessagingPublishDuration is the metric conforming to the
+ // "messaging.publish.duration" semantic conventions. It represents the
+ // measures the duration of publish operation.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ MessagingPublishDurationName = "messaging.publish.duration"
+ MessagingPublishDurationUnit = "s"
+ MessagingPublishDurationDescription = "Measures the duration of publish operation."
+
+ // MessagingReceiveDuration is the metric conforming to the
+ // "messaging.receive.duration" semantic conventions. It represents the
+ // measures the duration of receive operation.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ MessagingReceiveDurationName = "messaging.receive.duration"
+ MessagingReceiveDurationUnit = "s"
+ MessagingReceiveDurationDescription = "Measures the duration of receive operation."
+
+ // MessagingProcessDuration is the metric conforming to the
+ // "messaging.process.duration" semantic conventions. It represents the
+ // measures the duration of process operation.
+ // Instrument: histogram
+ // Unit: s
+ // Stability: Experimental
+ MessagingProcessDurationName = "messaging.process.duration"
+ MessagingProcessDurationUnit = "s"
+ MessagingProcessDurationDescription = "Measures the duration of process operation."
+
+ // MessagingPublishMessages is the metric conforming to the
+ // "messaging.publish.messages" semantic conventions. It represents the
+ // measures the number of published messages.
+ // Instrument: counter
+ // Unit: {message}
+ // Stability: Experimental
+ MessagingPublishMessagesName = "messaging.publish.messages"
+ MessagingPublishMessagesUnit = "{message}"
+ MessagingPublishMessagesDescription = "Measures the number of published messages."
+
+ // MessagingReceiveMessages is the metric conforming to the
+ // "messaging.receive.messages" semantic conventions. It represents the
+ // measures the number of received messages.
+ // Instrument: counter
+ // Unit: {message}
+ // Stability: Experimental
+ MessagingReceiveMessagesName = "messaging.receive.messages"
+ MessagingReceiveMessagesUnit = "{message}"
+ MessagingReceiveMessagesDescription = "Measures the number of received messages."
+
+ // MessagingProcessMessages is the metric conforming to the
+ // "messaging.process.messages" semantic conventions. It represents the
+ // measures the number of processed messages.
+ // Instrument: counter
+ // Unit: {message}
+ // Stability: Experimental
+ MessagingProcessMessagesName = "messaging.process.messages"
+ MessagingProcessMessagesUnit = "{message}"
+ MessagingProcessMessagesDescription = "Measures the number of processed messages."
+
+ // ProcessCPUTime is the metric conforming to the "process.cpu.time" semantic
+ // conventions. It represents the total CPU seconds broken down by different
+ // states.
+ // Instrument: counter
+ // Unit: s
+ // Stability: Experimental
+ ProcessCPUTimeName = "process.cpu.time"
+ ProcessCPUTimeUnit = "s"
+ ProcessCPUTimeDescription = "Total CPU seconds broken down by different states."
+
+ // ProcessCPUUtilization is the metric conforming to the
+ // "process.cpu.utilization" semantic conventions. It represents the difference
+ // in process.cpu.time since the last measurement, divided by the elapsed time
+ // and number of CPUs available to the process.
+ // Instrument: gauge
+ // Unit: 1
+ // Stability: Experimental
+ ProcessCPUUtilizationName = "process.cpu.utilization"
+ ProcessCPUUtilizationUnit = "1"
+ ProcessCPUUtilizationDescription = "Difference in process.cpu.time since the last measurement, divided by the elapsed time and number of CPUs available to the process."
+
+ // ProcessMemoryUsage is the metric conforming to the "process.memory.usage"
+ // semantic conventions. It represents the amount of physical memory in use.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ ProcessMemoryUsageName = "process.memory.usage"
+ ProcessMemoryUsageUnit = "By"
+ ProcessMemoryUsageDescription = "The amount of physical memory in use."
+
+ // ProcessMemoryVirtual is the metric conforming to the
+ // "process.memory.virtual" semantic conventions. It represents the amount of
+ // committed virtual memory.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ ProcessMemoryVirtualName = "process.memory.virtual"
+ ProcessMemoryVirtualUnit = "By"
+ ProcessMemoryVirtualDescription = "The amount of committed virtual memory."
+
+ // ProcessDiskIo is the metric conforming to the "process.disk.io" semantic
+ // conventions. It represents the disk bytes transferred.
+ // Instrument: counter
+ // Unit: By
+ // Stability: Experimental
+ ProcessDiskIoName = "process.disk.io"
+ ProcessDiskIoUnit = "By"
+ ProcessDiskIoDescription = "Disk bytes transferred."
+
+ // ProcessNetworkIo is the metric conforming to the "process.network.io"
+ // semantic conventions. It represents the network bytes transferred.
+ // Instrument: counter
+ // Unit: By
+ // Stability: Experimental
+ ProcessNetworkIoName = "process.network.io"
+ ProcessNetworkIoUnit = "By"
+ ProcessNetworkIoDescription = "Network bytes transferred."
+
+ // ProcessThreadCount is the metric conforming to the "process.thread.count"
+ // semantic conventions. It represents the process threads count.
+ // Instrument: updowncounter
+ // Unit: {thread}
+ // Stability: Experimental
+ ProcessThreadCountName = "process.thread.count"
+ ProcessThreadCountUnit = "{thread}"
+ ProcessThreadCountDescription = "Process threads count."
+
+ // ProcessOpenFileDescriptorCount is the metric conforming to the
+ // "process.open_file_descriptor.count" semantic conventions. It represents the
+ // number of file descriptors in use by the process.
+ // Instrument: updowncounter
+ // Unit: {count}
+ // Stability: Experimental
+ ProcessOpenFileDescriptorCountName = "process.open_file_descriptor.count"
+ ProcessOpenFileDescriptorCountUnit = "{count}"
+ ProcessOpenFileDescriptorCountDescription = "Number of file descriptors in use by the process."
+
+ // ProcessContextSwitches is the metric conforming to the
+ // "process.context_switches" semantic conventions. It represents the number of
+ // times the process has been context switched.
+ // Instrument: counter
+ // Unit: {count}
+ // Stability: Experimental
+ ProcessContextSwitchesName = "process.context_switches"
+ ProcessContextSwitchesUnit = "{count}"
+ ProcessContextSwitchesDescription = "Number of times the process has been context switched."
+
+ // ProcessPagingFaults is the metric conforming to the "process.paging.faults"
+ // semantic conventions. It represents the number of page faults the process
+ // has made.
+ // Instrument: counter
+ // Unit: {fault}
+ // Stability: Experimental
+ ProcessPagingFaultsName = "process.paging.faults"
+ ProcessPagingFaultsUnit = "{fault}"
+ ProcessPagingFaultsDescription = "Number of page faults the process has made."
+
+ // RPCServerDuration is the metric conforming to the "rpc.server.duration"
+ // semantic conventions. It represents the measures the duration of inbound
+ // RPC.
+ // Instrument: histogram
+ // Unit: ms
+ // Stability: Experimental
+ RPCServerDurationName = "rpc.server.duration"
+ RPCServerDurationUnit = "ms"
+ RPCServerDurationDescription = "Measures the duration of inbound RPC."
+
+ // RPCServerRequestSize is the metric conforming to the
+ // "rpc.server.request.size" semantic conventions. It represents the measures
+ // the size of RPC request messages (uncompressed).
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ RPCServerRequestSizeName = "rpc.server.request.size"
+ RPCServerRequestSizeUnit = "By"
+ RPCServerRequestSizeDescription = "Measures the size of RPC request messages (uncompressed)."
+
+ // RPCServerResponseSize is the metric conforming to the
+ // "rpc.server.response.size" semantic conventions. It represents the measures
+ // the size of RPC response messages (uncompressed).
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ RPCServerResponseSizeName = "rpc.server.response.size"
+ RPCServerResponseSizeUnit = "By"
+ RPCServerResponseSizeDescription = "Measures the size of RPC response messages (uncompressed)."
+
+ // RPCServerRequestsPerRPC is the metric conforming to the
+ // "rpc.server.requests_per_rpc" semantic conventions. It represents the
+ // measures the number of messages received per RPC.
+ // Instrument: histogram
+ // Unit: {count}
+ // Stability: Experimental
+ RPCServerRequestsPerRPCName = "rpc.server.requests_per_rpc"
+ RPCServerRequestsPerRPCUnit = "{count}"
+ RPCServerRequestsPerRPCDescription = "Measures the number of messages received per RPC."
+
+ // RPCServerResponsesPerRPC is the metric conforming to the
+ // "rpc.server.responses_per_rpc" semantic conventions. It represents the
+ // measures the number of messages sent per RPC.
+ // Instrument: histogram
+ // Unit: {count}
+ // Stability: Experimental
+ RPCServerResponsesPerRPCName = "rpc.server.responses_per_rpc"
+ RPCServerResponsesPerRPCUnit = "{count}"
+ RPCServerResponsesPerRPCDescription = "Measures the number of messages sent per RPC."
+
+ // RPCClientDuration is the metric conforming to the "rpc.client.duration"
+ // semantic conventions. It represents the measures the duration of outbound
+ // RPC.
+ // Instrument: histogram
+ // Unit: ms
+ // Stability: Experimental
+ RPCClientDurationName = "rpc.client.duration"
+ RPCClientDurationUnit = "ms"
+ RPCClientDurationDescription = "Measures the duration of outbound RPC."
+
+ // RPCClientRequestSize is the metric conforming to the
+ // "rpc.client.request.size" semantic conventions. It represents the measures
+ // the size of RPC request messages (uncompressed).
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ RPCClientRequestSizeName = "rpc.client.request.size"
+ RPCClientRequestSizeUnit = "By"
+ RPCClientRequestSizeDescription = "Measures the size of RPC request messages (uncompressed)."
+
+ // RPCClientResponseSize is the metric conforming to the
+ // "rpc.client.response.size" semantic conventions. It represents the measures
+ // the size of RPC response messages (uncompressed).
+ // Instrument: histogram
+ // Unit: By
+ // Stability: Experimental
+ RPCClientResponseSizeName = "rpc.client.response.size"
+ RPCClientResponseSizeUnit = "By"
+ RPCClientResponseSizeDescription = "Measures the size of RPC response messages (uncompressed)."
+
+ // RPCClientRequestsPerRPC is the metric conforming to the
+ // "rpc.client.requests_per_rpc" semantic conventions. It represents the
+ // measures the number of messages received per RPC.
+ // Instrument: histogram
+ // Unit: {count}
+ // Stability: Experimental
+ RPCClientRequestsPerRPCName = "rpc.client.requests_per_rpc"
+ RPCClientRequestsPerRPCUnit = "{count}"
+ RPCClientRequestsPerRPCDescription = "Measures the number of messages received per RPC."
+
+ // RPCClientResponsesPerRPC is the metric conforming to the
+ // "rpc.client.responses_per_rpc" semantic conventions. It represents the
+ // measures the number of messages sent per RPC.
+ // Instrument: histogram
+ // Unit: {count}
+ // Stability: Experimental
+ RPCClientResponsesPerRPCName = "rpc.client.responses_per_rpc"
+ RPCClientResponsesPerRPCUnit = "{count}"
+ RPCClientResponsesPerRPCDescription = "Measures the number of messages sent per RPC."
+
+ // SystemCPUTime is the metric conforming to the "system.cpu.time" semantic
+ // conventions. It represents the seconds each logical CPU spent on each mode.
+ // Instrument: counter
+ // Unit: s
+ // Stability: Experimental
+ SystemCPUTimeName = "system.cpu.time"
+ SystemCPUTimeUnit = "s"
+ SystemCPUTimeDescription = "Seconds each logical CPU spent on each mode"
+
+ // SystemCPUUtilization is the metric conforming to the
+ // "system.cpu.utilization" semantic conventions. It represents the difference
+ // in system.cpu.time since the last measurement, divided by the elapsed time
+ // and number of logical CPUs.
+ // Instrument: gauge
+ // Unit: 1
+ // Stability: Experimental
+ SystemCPUUtilizationName = "system.cpu.utilization"
+ SystemCPUUtilizationUnit = "1"
+ SystemCPUUtilizationDescription = "Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs"
+
+ // SystemCPUFrequency is the metric conforming to the "system.cpu.frequency"
+ // semantic conventions. It represents the reports the current frequency of the
+ // CPU in Hz.
+ // Instrument: gauge
+ // Unit: {Hz}
+ // Stability: Experimental
+ SystemCPUFrequencyName = "system.cpu.frequency"
+ SystemCPUFrequencyUnit = "{Hz}"
+ SystemCPUFrequencyDescription = "Reports the current frequency of the CPU in Hz"
+
+ // SystemCPUPhysicalCount is the metric conforming to the
+ // "system.cpu.physical.count" semantic conventions. It represents the reports
+ // the number of actual physical processor cores on the hardware.
+ // Instrument: updowncounter
+ // Unit: {cpu}
+ // Stability: Experimental
+ SystemCPUPhysicalCountName = "system.cpu.physical.count"
+ SystemCPUPhysicalCountUnit = "{cpu}"
+ SystemCPUPhysicalCountDescription = "Reports the number of actual physical processor cores on the hardware"
+
+ // SystemCPULogicalCount is the metric conforming to the
+ // "system.cpu.logical.count" semantic conventions. It represents the reports
+ // the number of logical (virtual) processor cores created by the operating
+ // system to manage multitasking.
+ // Instrument: updowncounter
+ // Unit: {cpu}
+ // Stability: Experimental
+ SystemCPULogicalCountName = "system.cpu.logical.count"
+ SystemCPULogicalCountUnit = "{cpu}"
+ SystemCPULogicalCountDescription = "Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking"
+
+ // SystemMemoryUsage is the metric conforming to the "system.memory.usage"
+ // semantic conventions. It represents the reports memory in use by state.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ SystemMemoryUsageName = "system.memory.usage"
+ SystemMemoryUsageUnit = "By"
+ SystemMemoryUsageDescription = "Reports memory in use by state."
+
+ // SystemMemoryLimit is the metric conforming to the "system.memory.limit"
+ // semantic conventions. It represents the total memory available in the
+ // system.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ SystemMemoryLimitName = "system.memory.limit"
+ SystemMemoryLimitUnit = "By"
+ SystemMemoryLimitDescription = "Total memory available in the system."
+
+ // SystemMemoryShared is the metric conforming to the "system.memory.shared"
+ // semantic conventions. It represents the shared memory used (mostly by
+ // tmpfs).
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ SystemMemorySharedName = "system.memory.shared"
+ SystemMemorySharedUnit = "By"
+ SystemMemorySharedDescription = "Shared memory used (mostly by tmpfs)."
+
+ // SystemMemoryUtilization is the metric conforming to the
+ // "system.memory.utilization" semantic conventions.
+ // Instrument: gauge
+ // Unit: 1
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemMemoryUtilizationName = "system.memory.utilization"
+ SystemMemoryUtilizationUnit = "1"
+
+ // SystemPagingUsage is the metric conforming to the "system.paging.usage"
+ // semantic conventions. It represents the unix swap or windows pagefile usage.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ SystemPagingUsageName = "system.paging.usage"
+ SystemPagingUsageUnit = "By"
+ SystemPagingUsageDescription = "Unix swap or windows pagefile usage"
+
+ // SystemPagingUtilization is the metric conforming to the
+ // "system.paging.utilization" semantic conventions.
+ // Instrument: gauge
+ // Unit: 1
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemPagingUtilizationName = "system.paging.utilization"
+ SystemPagingUtilizationUnit = "1"
+
+ // SystemPagingFaults is the metric conforming to the "system.paging.faults"
+ // semantic conventions.
+ // Instrument: counter
+ // Unit: {fault}
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemPagingFaultsName = "system.paging.faults"
+ SystemPagingFaultsUnit = "{fault}"
+
+ // SystemPagingOperations is the metric conforming to the
+ // "system.paging.operations" semantic conventions.
+ // Instrument: counter
+ // Unit: {operation}
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemPagingOperationsName = "system.paging.operations"
+ SystemPagingOperationsUnit = "{operation}"
+
+ // SystemDiskIo is the metric conforming to the "system.disk.io" semantic
+ // conventions.
+ // Instrument: counter
+ // Unit: By
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemDiskIoName = "system.disk.io"
+ SystemDiskIoUnit = "By"
+
+ // SystemDiskOperations is the metric conforming to the
+ // "system.disk.operations" semantic conventions.
+ // Instrument: counter
+ // Unit: {operation}
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemDiskOperationsName = "system.disk.operations"
+ SystemDiskOperationsUnit = "{operation}"
+
+ // SystemDiskIoTime is the metric conforming to the "system.disk.io_time"
+ // semantic conventions. It represents the time disk spent activated.
+ // Instrument: counter
+ // Unit: s
+ // Stability: Experimental
+ SystemDiskIoTimeName = "system.disk.io_time"
+ SystemDiskIoTimeUnit = "s"
+ SystemDiskIoTimeDescription = "Time disk spent activated"
+
+ // SystemDiskOperationTime is the metric conforming to the
+ // "system.disk.operation_time" semantic conventions. It represents the sum of
+ // the time each operation took to complete.
+ // Instrument: counter
+ // Unit: s
+ // Stability: Experimental
+ SystemDiskOperationTimeName = "system.disk.operation_time"
+ SystemDiskOperationTimeUnit = "s"
+ SystemDiskOperationTimeDescription = "Sum of the time each operation took to complete"
+
+ // SystemDiskMerged is the metric conforming to the "system.disk.merged"
+ // semantic conventions.
+ // Instrument: counter
+ // Unit: {operation}
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemDiskMergedName = "system.disk.merged"
+ SystemDiskMergedUnit = "{operation}"
+
+ // SystemFilesystemUsage is the metric conforming to the
+ // "system.filesystem.usage" semantic conventions.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemFilesystemUsageName = "system.filesystem.usage"
+ SystemFilesystemUsageUnit = "By"
+
+ // SystemFilesystemUtilization is the metric conforming to the
+ // "system.filesystem.utilization" semantic conventions.
+ // Instrument: gauge
+ // Unit: 1
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemFilesystemUtilizationName = "system.filesystem.utilization"
+ SystemFilesystemUtilizationUnit = "1"
+
+ // SystemNetworkDropped is the metric conforming to the
+ // "system.network.dropped" semantic conventions. It represents the count of
+ // packets that are dropped or discarded even though there was no error.
+ // Instrument: counter
+ // Unit: {packet}
+ // Stability: Experimental
+ SystemNetworkDroppedName = "system.network.dropped"
+ SystemNetworkDroppedUnit = "{packet}"
+ SystemNetworkDroppedDescription = "Count of packets that are dropped or discarded even though there was no error"
+
+ // SystemNetworkPackets is the metric conforming to the
+ // "system.network.packets" semantic conventions.
+ // Instrument: counter
+ // Unit: {packet}
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemNetworkPacketsName = "system.network.packets"
+ SystemNetworkPacketsUnit = "{packet}"
+
+ // SystemNetworkErrors is the metric conforming to the "system.network.errors"
+ // semantic conventions. It represents the count of network errors detected.
+ // Instrument: counter
+ // Unit: {error}
+ // Stability: Experimental
+ SystemNetworkErrorsName = "system.network.errors"
+ SystemNetworkErrorsUnit = "{error}"
+ SystemNetworkErrorsDescription = "Count of network errors detected"
+
+ // SystemNetworkIo is the metric conforming to the "system.network.io" semantic
+ // conventions.
+ // Instrument: counter
+ // Unit: By
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemNetworkIoName = "system.network.io"
+ SystemNetworkIoUnit = "By"
+
+ // SystemNetworkConnections is the metric conforming to the
+ // "system.network.connections" semantic conventions.
+ // Instrument: updowncounter
+ // Unit: {connection}
+ // Stability: Experimental
+ // NOTE: The description (brief) for this metric is not defined in the semantic-conventions repository.
+ SystemNetworkConnectionsName = "system.network.connections"
+ SystemNetworkConnectionsUnit = "{connection}"
+
+ // SystemProcessCount is the metric conforming to the "system.process.count"
+ // semantic conventions. It represents the total number of processes in each
+ // state.
+ // Instrument: updowncounter
+ // Unit: {process}
+ // Stability: Experimental
+ SystemProcessCountName = "system.process.count"
+ SystemProcessCountUnit = "{process}"
+ SystemProcessCountDescription = "Total number of processes in each state"
+
+ // SystemProcessCreated is the metric conforming to the
+ // "system.process.created" semantic conventions. It represents the total
+ // number of processes created over uptime of the host.
+ // Instrument: counter
+ // Unit: {process}
+ // Stability: Experimental
+ SystemProcessCreatedName = "system.process.created"
+ SystemProcessCreatedUnit = "{process}"
+ SystemProcessCreatedDescription = "Total number of processes created over uptime of the host"
+
+ // SystemLinuxMemoryAvailable is the metric conforming to the
+ // "system.linux.memory.available" semantic conventions. It represents an
+ // estimate of how much memory is available for starting new applications,
+ // without causing swapping.
+ // Instrument: updowncounter
+ // Unit: By
+ // Stability: Experimental
+ SystemLinuxMemoryAvailableName = "system.linux.memory.available"
+ SystemLinuxMemoryAvailableUnit = "By"
+ SystemLinuxMemoryAvailableDescription = "An estimate of how much memory is available for starting new applications, without causing swapping"
+)
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/schema.go b/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/schema.go
new file mode 100644
index 00000000..4c87c7ad
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.26.0/schema.go
@@ -0,0 +1,9 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package semconv // import "go.opentelemetry.io/otel/semconv/v1.26.0"
+
+// SchemaURL is the schema URL that matches the version of the semantic conventions
+// that this package defines. Semconv packages starting from v1.4.0 must declare
+// non-empty schema URL in the form https://opentelemetry.io/schemas/
+const SchemaURL = "https://opentelemetry.io/schemas/1.26.0"
diff --git a/vendor/go.opentelemetry.io/otel/trace.go b/vendor/go.opentelemetry.io/otel/trace.go
index caf7249d..6836c654 100644
--- a/vendor/go.opentelemetry.io/otel/trace.go
+++ b/vendor/go.opentelemetry.io/otel/trace.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package otel // import "go.opentelemetry.io/otel"
diff --git a/vendor/go.opentelemetry.io/otel/trace/README.md b/vendor/go.opentelemetry.io/otel/trace/README.md
new file mode 100644
index 00000000..58ccaba6
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/trace/README.md
@@ -0,0 +1,3 @@
+# Trace API
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/trace)](https://pkg.go.dev/go.opentelemetry.io/otel/trace)
diff --git a/vendor/go.opentelemetry.io/otel/trace/config.go b/vendor/go.opentelemetry.io/otel/trace/config.go
index 3aadc66c..273d58e0 100644
--- a/vendor/go.opentelemetry.io/otel/trace/config.go
+++ b/vendor/go.opentelemetry.io/otel/trace/config.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/trace"
diff --git a/vendor/go.opentelemetry.io/otel/trace/context.go b/vendor/go.opentelemetry.io/otel/trace/context.go
index 76f9a083..8c45a710 100644
--- a/vendor/go.opentelemetry.io/otel/trace/context.go
+++ b/vendor/go.opentelemetry.io/otel/trace/context.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/trace"
@@ -33,7 +22,7 @@ func ContextWithSpanContext(parent context.Context, sc SpanContext) context.Cont
return ContextWithSpan(parent, nonRecordingSpan{sc: sc})
}
-// ContextWithRemoteSpanContext returns a copy of parent with rsc set explicly
+// ContextWithRemoteSpanContext returns a copy of parent with rsc set explicitly
// as a remote SpanContext and as the current Span. The Span implementation
// that wraps rsc is non-recording and performs no operations other than to
// return rsc as the SpanContext from the SpanContext method.
@@ -47,12 +36,12 @@ func ContextWithRemoteSpanContext(parent context.Context, rsc SpanContext) conte
// performs no operations is returned.
func SpanFromContext(ctx context.Context) Span {
if ctx == nil {
- return noopSpan{}
+ return noopSpanInstance
}
if span, ok := ctx.Value(currentSpanKey).(Span); ok {
return span
}
- return noopSpan{}
+ return noopSpanInstance
}
// SpanContextFromContext returns the current Span's SpanContext.
diff --git a/vendor/go.opentelemetry.io/otel/trace/doc.go b/vendor/go.opentelemetry.io/otel/trace/doc.go
index 440f3d75..cdbf41d6 100644
--- a/vendor/go.opentelemetry.io/otel/trace/doc.go
+++ b/vendor/go.opentelemetry.io/otel/trace/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
/*
Package trace provides an implementation of the tracing part of the
@@ -107,7 +96,7 @@ can embed the API interface directly.
This option is not recommended. It will lead to publishing packages that
contain runtime panics when users update to newer versions of
-[go.opentelemetry.io/otel/trace], which may be done with a trasitive
+[go.opentelemetry.io/otel/trace], which may be done with a transitive
dependency.
Finally, an author can embed another implementation in theirs. The embedded
diff --git a/vendor/go.opentelemetry.io/otel/trace/embedded/README.md b/vendor/go.opentelemetry.io/otel/trace/embedded/README.md
new file mode 100644
index 00000000..7754a239
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/trace/embedded/README.md
@@ -0,0 +1,3 @@
+# Trace Embedded
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/trace/embedded)](https://pkg.go.dev/go.opentelemetry.io/otel/trace/embedded)
diff --git a/vendor/go.opentelemetry.io/otel/trace/embedded/embedded.go b/vendor/go.opentelemetry.io/otel/trace/embedded/embedded.go
index 898db5a7..3e359a00 100644
--- a/vendor/go.opentelemetry.io/otel/trace/embedded/embedded.go
+++ b/vendor/go.opentelemetry.io/otel/trace/embedded/embedded.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
// Package embedded provides interfaces embedded within the [OpenTelemetry
// trace API].
diff --git a/vendor/go.opentelemetry.io/otel/trace/nonrecording.go b/vendor/go.opentelemetry.io/otel/trace/nonrecording.go
index 88fcb816..c00221e7 100644
--- a/vendor/go.opentelemetry.io/otel/trace/nonrecording.go
+++ b/vendor/go.opentelemetry.io/otel/trace/nonrecording.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/trace"
diff --git a/vendor/go.opentelemetry.io/otel/trace/noop.go b/vendor/go.opentelemetry.io/otel/trace/noop.go
index c125491c..ca20e999 100644
--- a/vendor/go.opentelemetry.io/otel/trace/noop.go
+++ b/vendor/go.opentelemetry.io/otel/trace/noop.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/trace"
@@ -52,7 +41,7 @@ func (t noopTracer) Start(ctx context.Context, name string, _ ...SpanStartOption
span := SpanFromContext(ctx)
if _, ok := span.(nonRecordingSpan); !ok {
// span is likely already a noopSpan, but let's be sure
- span = noopSpan{}
+ span = noopSpanInstance
}
return ContextWithSpan(ctx, span), span
}
@@ -60,7 +49,7 @@ func (t noopTracer) Start(ctx context.Context, name string, _ ...SpanStartOption
// noopSpan is an implementation of Span that performs no operations.
type noopSpan struct{ embedded.Span }
-var _ Span = noopSpan{}
+var noopSpanInstance Span = noopSpan{}
// SpanContext returns an empty span context.
func (noopSpan) SpanContext() SpanContext { return SpanContext{} }
@@ -86,6 +75,9 @@ func (noopSpan) RecordError(error, ...EventOption) {}
// AddEvent does nothing.
func (noopSpan) AddEvent(string, ...EventOption) {}
+// AddLink does nothing.
+func (noopSpan) AddLink(Link) {}
+
// SetName does nothing.
func (noopSpan) SetName(string) {}
diff --git a/vendor/go.opentelemetry.io/otel/trace/provider.go b/vendor/go.opentelemetry.io/otel/trace/provider.go
new file mode 100644
index 00000000..ef85cb70
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/trace/provider.go
@@ -0,0 +1,59 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package trace // import "go.opentelemetry.io/otel/trace"
+
+import "go.opentelemetry.io/otel/trace/embedded"
+
+// TracerProvider provides Tracers that are used by instrumentation code to
+// trace computational workflows.
+//
+// A TracerProvider is the collection destination of all Spans from Tracers it
+// provides, it represents a unique telemetry collection pipeline. How that
+// pipeline is defined, meaning how those Spans are collected, processed, and
+// where they are exported, depends on its implementation. Instrumentation
+// authors do not need to define this implementation, rather just use the
+// provided Tracers to instrument code.
+//
+// Commonly, instrumentation code will accept a TracerProvider implementation
+// at runtime from its users or it can simply use the globally registered one
+// (see https://pkg.go.dev/go.opentelemetry.io/otel#GetTracerProvider).
+//
+// Warning: Methods may be added to this interface in minor releases. See
+// package documentation on API implementation for information on how to set
+// default behavior for unimplemented methods.
+type TracerProvider interface {
+ // Users of the interface can ignore this. This embedded type is only used
+ // by implementations of this interface. See the "API Implementations"
+ // section of the package documentation for more information.
+ embedded.TracerProvider
+
+ // Tracer returns a unique Tracer scoped to be used by instrumentation code
+ // to trace computational workflows. The scope and identity of that
+ // instrumentation code is uniquely defined by the name and options passed.
+ //
+ // The passed name needs to uniquely identify instrumentation code.
+ // Therefore, it is recommended that name is the Go package name of the
+ // library providing instrumentation (note: not the code being
+ // instrumented). Instrumentation libraries can have multiple versions,
+ // therefore, the WithInstrumentationVersion option should be used to
+ // distinguish these different codebases. Additionally, instrumentation
+ // libraries may sometimes use traces to communicate different domains of
+ // workflow data (i.e. using spans to communicate workflow events only). If
+ // this is the case, the WithScopeAttributes option should be used to
+ // uniquely identify Tracers that handle the different domains of workflow
+ // data.
+ //
+ // If the same name and options are passed multiple times, the same Tracer
+ // will be returned (it is up to the implementation if this will be the
+ // same underlying instance of that Tracer or not). It is not necessary to
+ // call this multiple times with the same name and options to get an
+ // up-to-date Tracer. All implementations will ensure any TracerProvider
+ // configuration changes are propagated to all provided Tracers.
+ //
+ // If name is empty, then an implementation defined default name will be
+ // used instead.
+ //
+ // This method is safe to call concurrently.
+ Tracer(name string, options ...TracerOption) Tracer
+}
diff --git a/vendor/go.opentelemetry.io/otel/trace/span.go b/vendor/go.opentelemetry.io/otel/trace/span.go
new file mode 100644
index 00000000..d3aa476e
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/trace/span.go
@@ -0,0 +1,177 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package trace // import "go.opentelemetry.io/otel/trace"
+
+import (
+ "context"
+
+ "go.opentelemetry.io/otel/attribute"
+ "go.opentelemetry.io/otel/codes"
+ "go.opentelemetry.io/otel/trace/embedded"
+)
+
+// Span is the individual component of a trace. It represents a single named
+// and timed operation of a workflow that is traced. A Tracer is used to
+// create a Span and it is then up to the operation the Span represents to
+// properly end the Span when the operation itself ends.
+//
+// Warning: Methods may be added to this interface in minor releases. See
+// package documentation on API implementation for information on how to set
+// default behavior for unimplemented methods.
+type Span interface {
+ // Users of the interface can ignore this. This embedded type is only used
+ // by implementations of this interface. See the "API Implementations"
+ // section of the package documentation for more information.
+ embedded.Span
+
+ // End completes the Span. The Span is considered complete and ready to be
+ // delivered through the rest of the telemetry pipeline after this method
+ // is called. Therefore, updates to the Span are not allowed after this
+ // method has been called.
+ End(options ...SpanEndOption)
+
+ // AddEvent adds an event with the provided name and options.
+ AddEvent(name string, options ...EventOption)
+
+ // AddLink adds a link.
+ // Adding links at span creation using WithLinks is preferred to calling AddLink
+ // later, for contexts that are available during span creation, because head
+ // sampling decisions can only consider information present during span creation.
+ AddLink(link Link)
+
+ // IsRecording returns the recording state of the Span. It will return
+ // true if the Span is active and events can be recorded.
+ IsRecording() bool
+
+ // RecordError will record err as an exception span event for this span. An
+ // additional call to SetStatus is required if the Status of the Span should
+ // be set to Error, as this method does not change the Span status. If this
+ // span is not being recorded or err is nil then this method does nothing.
+ RecordError(err error, options ...EventOption)
+
+ // SpanContext returns the SpanContext of the Span. The returned SpanContext
+ // is usable even after the End method has been called for the Span.
+ SpanContext() SpanContext
+
+ // SetStatus sets the status of the Span in the form of a code and a
+ // description, provided the status hasn't already been set to a higher
+ // value before (OK > Error > Unset). The description is only included in a
+ // status when the code is for an error.
+ SetStatus(code codes.Code, description string)
+
+ // SetName sets the Span name.
+ SetName(name string)
+
+ // SetAttributes sets kv as attributes of the Span. If a key from kv
+ // already exists for an attribute of the Span it will be overwritten with
+ // the value contained in kv.
+ SetAttributes(kv ...attribute.KeyValue)
+
+ // TracerProvider returns a TracerProvider that can be used to generate
+ // additional Spans on the same telemetry pipeline as the current Span.
+ TracerProvider() TracerProvider
+}
+
+// Link is the relationship between two Spans. The relationship can be within
+// the same Trace or across different Traces.
+//
+// For example, a Link is used in the following situations:
+//
+// 1. Batch Processing: A batch of operations may contain operations
+// associated with one or more traces/spans. Since there can only be one
+// parent SpanContext, a Link is used to keep reference to the
+// SpanContext of all operations in the batch.
+// 2. Public Endpoint: A SpanContext for an in incoming client request on a
+// public endpoint should be considered untrusted. In such a case, a new
+// trace with its own identity and sampling decision needs to be created,
+// but this new trace needs to be related to the original trace in some
+// form. A Link is used to keep reference to the original SpanContext and
+// track the relationship.
+type Link struct {
+ // SpanContext of the linked Span.
+ SpanContext SpanContext
+
+ // Attributes describe the aspects of the link.
+ Attributes []attribute.KeyValue
+}
+
+// LinkFromContext returns a link encapsulating the SpanContext in the provided
+// ctx.
+func LinkFromContext(ctx context.Context, attrs ...attribute.KeyValue) Link {
+ return Link{
+ SpanContext: SpanContextFromContext(ctx),
+ Attributes: attrs,
+ }
+}
+
+// SpanKind is the role a Span plays in a Trace.
+type SpanKind int
+
+// As a convenience, these match the proto definition, see
+// https://github.com/open-telemetry/opentelemetry-proto/blob/30d237e1ff3ab7aa50e0922b5bebdd93505090af/opentelemetry/proto/trace/v1/trace.proto#L101-L129
+//
+// The unspecified value is not a valid `SpanKind`. Use `ValidateSpanKind()`
+// to coerce a span kind to a valid value.
+const (
+ // SpanKindUnspecified is an unspecified SpanKind and is not a valid
+ // SpanKind. SpanKindUnspecified should be replaced with SpanKindInternal
+ // if it is received.
+ SpanKindUnspecified SpanKind = 0
+ // SpanKindInternal is a SpanKind for a Span that represents an internal
+ // operation within an application.
+ SpanKindInternal SpanKind = 1
+ // SpanKindServer is a SpanKind for a Span that represents the operation
+ // of handling a request from a client.
+ SpanKindServer SpanKind = 2
+ // SpanKindClient is a SpanKind for a Span that represents the operation
+ // of client making a request to a server.
+ SpanKindClient SpanKind = 3
+ // SpanKindProducer is a SpanKind for a Span that represents the operation
+ // of a producer sending a message to a message broker. Unlike
+ // SpanKindClient and SpanKindServer, there is often no direct
+ // relationship between this kind of Span and a SpanKindConsumer kind. A
+ // SpanKindProducer Span will end once the message is accepted by the
+ // message broker which might not overlap with the processing of that
+ // message.
+ SpanKindProducer SpanKind = 4
+ // SpanKindConsumer is a SpanKind for a Span that represents the operation
+ // of a consumer receiving a message from a message broker. Like
+ // SpanKindProducer Spans, there is often no direct relationship between
+ // this Span and the Span that produced the message.
+ SpanKindConsumer SpanKind = 5
+)
+
+// ValidateSpanKind returns a valid span kind value. This will coerce
+// invalid values into the default value, SpanKindInternal.
+func ValidateSpanKind(spanKind SpanKind) SpanKind {
+ switch spanKind {
+ case SpanKindInternal,
+ SpanKindServer,
+ SpanKindClient,
+ SpanKindProducer,
+ SpanKindConsumer:
+ // valid
+ return spanKind
+ default:
+ return SpanKindInternal
+ }
+}
+
+// String returns the specified name of the SpanKind in lower-case.
+func (sk SpanKind) String() string {
+ switch sk {
+ case SpanKindInternal:
+ return "internal"
+ case SpanKindServer:
+ return "server"
+ case SpanKindClient:
+ return "client"
+ case SpanKindProducer:
+ return "producer"
+ case SpanKindConsumer:
+ return "consumer"
+ default:
+ return "unspecified"
+ }
+}
diff --git a/vendor/go.opentelemetry.io/otel/trace/trace.go b/vendor/go.opentelemetry.io/otel/trace/trace.go
index 26a4b226..d49adf67 100644
--- a/vendor/go.opentelemetry.io/otel/trace/trace.go
+++ b/vendor/go.opentelemetry.io/otel/trace/trace.go
@@ -1,28 +1,12 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/trace"
import (
"bytes"
- "context"
"encoding/hex"
"encoding/json"
-
- "go.opentelemetry.io/otel/attribute"
- "go.opentelemetry.io/otel/codes"
- "go.opentelemetry.io/otel/trace/embedded"
)
const (
@@ -337,241 +321,3 @@ func (sc SpanContext) MarshalJSON() ([]byte, error) {
Remote: sc.remote,
})
}
-
-// Span is the individual component of a trace. It represents a single named
-// and timed operation of a workflow that is traced. A Tracer is used to
-// create a Span and it is then up to the operation the Span represents to
-// properly end the Span when the operation itself ends.
-//
-// Warning: Methods may be added to this interface in minor releases. See
-// package documentation on API implementation for information on how to set
-// default behavior for unimplemented methods.
-type Span interface {
- // Users of the interface can ignore this. This embedded type is only used
- // by implementations of this interface. See the "API Implementations"
- // section of the package documentation for more information.
- embedded.Span
-
- // End completes the Span. The Span is considered complete and ready to be
- // delivered through the rest of the telemetry pipeline after this method
- // is called. Therefore, updates to the Span are not allowed after this
- // method has been called.
- End(options ...SpanEndOption)
-
- // AddEvent adds an event with the provided name and options.
- AddEvent(name string, options ...EventOption)
-
- // IsRecording returns the recording state of the Span. It will return
- // true if the Span is active and events can be recorded.
- IsRecording() bool
-
- // RecordError will record err as an exception span event for this span. An
- // additional call to SetStatus is required if the Status of the Span should
- // be set to Error, as this method does not change the Span status. If this
- // span is not being recorded or err is nil then this method does nothing.
- RecordError(err error, options ...EventOption)
-
- // SpanContext returns the SpanContext of the Span. The returned SpanContext
- // is usable even after the End method has been called for the Span.
- SpanContext() SpanContext
-
- // SetStatus sets the status of the Span in the form of a code and a
- // description, provided the status hasn't already been set to a higher
- // value before (OK > Error > Unset). The description is only included in a
- // status when the code is for an error.
- SetStatus(code codes.Code, description string)
-
- // SetName sets the Span name.
- SetName(name string)
-
- // SetAttributes sets kv as attributes of the Span. If a key from kv
- // already exists for an attribute of the Span it will be overwritten with
- // the value contained in kv.
- SetAttributes(kv ...attribute.KeyValue)
-
- // TracerProvider returns a TracerProvider that can be used to generate
- // additional Spans on the same telemetry pipeline as the current Span.
- TracerProvider() TracerProvider
-}
-
-// Link is the relationship between two Spans. The relationship can be within
-// the same Trace or across different Traces.
-//
-// For example, a Link is used in the following situations:
-//
-// 1. Batch Processing: A batch of operations may contain operations
-// associated with one or more traces/spans. Since there can only be one
-// parent SpanContext, a Link is used to keep reference to the
-// SpanContext of all operations in the batch.
-// 2. Public Endpoint: A SpanContext for an in incoming client request on a
-// public endpoint should be considered untrusted. In such a case, a new
-// trace with its own identity and sampling decision needs to be created,
-// but this new trace needs to be related to the original trace in some
-// form. A Link is used to keep reference to the original SpanContext and
-// track the relationship.
-type Link struct {
- // SpanContext of the linked Span.
- SpanContext SpanContext
-
- // Attributes describe the aspects of the link.
- Attributes []attribute.KeyValue
-}
-
-// LinkFromContext returns a link encapsulating the SpanContext in the provided ctx.
-func LinkFromContext(ctx context.Context, attrs ...attribute.KeyValue) Link {
- return Link{
- SpanContext: SpanContextFromContext(ctx),
- Attributes: attrs,
- }
-}
-
-// SpanKind is the role a Span plays in a Trace.
-type SpanKind int
-
-// As a convenience, these match the proto definition, see
-// https://github.com/open-telemetry/opentelemetry-proto/blob/30d237e1ff3ab7aa50e0922b5bebdd93505090af/opentelemetry/proto/trace/v1/trace.proto#L101-L129
-//
-// The unspecified value is not a valid `SpanKind`. Use `ValidateSpanKind()`
-// to coerce a span kind to a valid value.
-const (
- // SpanKindUnspecified is an unspecified SpanKind and is not a valid
- // SpanKind. SpanKindUnspecified should be replaced with SpanKindInternal
- // if it is received.
- SpanKindUnspecified SpanKind = 0
- // SpanKindInternal is a SpanKind for a Span that represents an internal
- // operation within an application.
- SpanKindInternal SpanKind = 1
- // SpanKindServer is a SpanKind for a Span that represents the operation
- // of handling a request from a client.
- SpanKindServer SpanKind = 2
- // SpanKindClient is a SpanKind for a Span that represents the operation
- // of client making a request to a server.
- SpanKindClient SpanKind = 3
- // SpanKindProducer is a SpanKind for a Span that represents the operation
- // of a producer sending a message to a message broker. Unlike
- // SpanKindClient and SpanKindServer, there is often no direct
- // relationship between this kind of Span and a SpanKindConsumer kind. A
- // SpanKindProducer Span will end once the message is accepted by the
- // message broker which might not overlap with the processing of that
- // message.
- SpanKindProducer SpanKind = 4
- // SpanKindConsumer is a SpanKind for a Span that represents the operation
- // of a consumer receiving a message from a message broker. Like
- // SpanKindProducer Spans, there is often no direct relationship between
- // this Span and the Span that produced the message.
- SpanKindConsumer SpanKind = 5
-)
-
-// ValidateSpanKind returns a valid span kind value. This will coerce
-// invalid values into the default value, SpanKindInternal.
-func ValidateSpanKind(spanKind SpanKind) SpanKind {
- switch spanKind {
- case SpanKindInternal,
- SpanKindServer,
- SpanKindClient,
- SpanKindProducer,
- SpanKindConsumer:
- // valid
- return spanKind
- default:
- return SpanKindInternal
- }
-}
-
-// String returns the specified name of the SpanKind in lower-case.
-func (sk SpanKind) String() string {
- switch sk {
- case SpanKindInternal:
- return "internal"
- case SpanKindServer:
- return "server"
- case SpanKindClient:
- return "client"
- case SpanKindProducer:
- return "producer"
- case SpanKindConsumer:
- return "consumer"
- default:
- return "unspecified"
- }
-}
-
-// Tracer is the creator of Spans.
-//
-// Warning: Methods may be added to this interface in minor releases. See
-// package documentation on API implementation for information on how to set
-// default behavior for unimplemented methods.
-type Tracer interface {
- // Users of the interface can ignore this. This embedded type is only used
- // by implementations of this interface. See the "API Implementations"
- // section of the package documentation for more information.
- embedded.Tracer
-
- // Start creates a span and a context.Context containing the newly-created span.
- //
- // If the context.Context provided in `ctx` contains a Span then the newly-created
- // Span will be a child of that span, otherwise it will be a root span. This behavior
- // can be overridden by providing `WithNewRoot()` as a SpanOption, causing the
- // newly-created Span to be a root span even if `ctx` contains a Span.
- //
- // When creating a Span it is recommended to provide all known span attributes using
- // the `WithAttributes()` SpanOption as samplers will only have access to the
- // attributes provided when a Span is created.
- //
- // Any Span that is created MUST also be ended. This is the responsibility of the user.
- // Implementations of this API may leak memory or other resources if Spans are not ended.
- Start(ctx context.Context, spanName string, opts ...SpanStartOption) (context.Context, Span)
-}
-
-// TracerProvider provides Tracers that are used by instrumentation code to
-// trace computational workflows.
-//
-// A TracerProvider is the collection destination of all Spans from Tracers it
-// provides, it represents a unique telemetry collection pipeline. How that
-// pipeline is defined, meaning how those Spans are collected, processed, and
-// where they are exported, depends on its implementation. Instrumentation
-// authors do not need to define this implementation, rather just use the
-// provided Tracers to instrument code.
-//
-// Commonly, instrumentation code will accept a TracerProvider implementation
-// at runtime from its users or it can simply use the globally registered one
-// (see https://pkg.go.dev/go.opentelemetry.io/otel#GetTracerProvider).
-//
-// Warning: Methods may be added to this interface in minor releases. See
-// package documentation on API implementation for information on how to set
-// default behavior for unimplemented methods.
-type TracerProvider interface {
- // Users of the interface can ignore this. This embedded type is only used
- // by implementations of this interface. See the "API Implementations"
- // section of the package documentation for more information.
- embedded.TracerProvider
-
- // Tracer returns a unique Tracer scoped to be used by instrumentation code
- // to trace computational workflows. The scope and identity of that
- // instrumentation code is uniquely defined by the name and options passed.
- //
- // The passed name needs to uniquely identify instrumentation code.
- // Therefore, it is recommended that name is the Go package name of the
- // library providing instrumentation (note: not the code being
- // instrumented). Instrumentation libraries can have multiple versions,
- // therefore, the WithInstrumentationVersion option should be used to
- // distinguish these different codebases. Additionally, instrumentation
- // libraries may sometimes use traces to communicate different domains of
- // workflow data (i.e. using spans to communicate workflow events only). If
- // this is the case, the WithScopeAttributes option should be used to
- // uniquely identify Tracers that handle the different domains of workflow
- // data.
- //
- // If the same name and options are passed multiple times, the same Tracer
- // will be returned (it is up to the implementation if this will be the
- // same underlying instance of that Tracer or not). It is not necessary to
- // call this multiple times with the same name and options to get an
- // up-to-date Tracer. All implementations will ensure any TracerProvider
- // configuration changes are propagated to all provided Tracers.
- //
- // If name is empty, then an implementation defined default name will be
- // used instead.
- //
- // This method is safe to call concurrently.
- Tracer(name string, options ...TracerOption) Tracer
-}
diff --git a/vendor/go.opentelemetry.io/otel/trace/tracer.go b/vendor/go.opentelemetry.io/otel/trace/tracer.go
new file mode 100644
index 00000000..77952d2a
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/trace/tracer.go
@@ -0,0 +1,37 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package trace // import "go.opentelemetry.io/otel/trace"
+
+import (
+ "context"
+
+ "go.opentelemetry.io/otel/trace/embedded"
+)
+
+// Tracer is the creator of Spans.
+//
+// Warning: Methods may be added to this interface in minor releases. See
+// package documentation on API implementation for information on how to set
+// default behavior for unimplemented methods.
+type Tracer interface {
+ // Users of the interface can ignore this. This embedded type is only used
+ // by implementations of this interface. See the "API Implementations"
+ // section of the package documentation for more information.
+ embedded.Tracer
+
+ // Start creates a span and a context.Context containing the newly-created span.
+ //
+ // If the context.Context provided in `ctx` contains a Span then the newly-created
+ // Span will be a child of that span, otherwise it will be a root span. This behavior
+ // can be overridden by providing `WithNewRoot()` as a SpanOption, causing the
+ // newly-created Span to be a root span even if `ctx` contains a Span.
+ //
+ // When creating a Span it is recommended to provide all known span attributes using
+ // the `WithAttributes()` SpanOption as samplers will only have access to the
+ // attributes provided when a Span is created.
+ //
+ // Any Span that is created MUST also be ended. This is the responsibility of the user.
+ // Implementations of this API may leak memory or other resources if Spans are not ended.
+ Start(ctx context.Context, spanName string, opts ...SpanStartOption) (context.Context, Span)
+}
diff --git a/vendor/go.opentelemetry.io/otel/trace/tracestate.go b/vendor/go.opentelemetry.io/otel/trace/tracestate.go
index d1e47ca2..dc5e34ca 100644
--- a/vendor/go.opentelemetry.io/otel/trace/tracestate.go
+++ b/vendor/go.opentelemetry.io/otel/trace/tracestate.go
@@ -1,36 +1,19 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/trace"
import (
"encoding/json"
"fmt"
- "regexp"
"strings"
)
const (
maxListMembers = 32
- listDelimiter = ","
-
- // based on the W3C Trace Context specification, see
- // https://www.w3.org/TR/trace-context-1/#tracestate-header
- noTenantKeyFormat = `[a-z][_0-9a-z\-\*\/]*`
- withTenantKeyFormat = `[a-z0-9][_0-9a-z\-\*\/]*@[a-z][_0-9a-z\-\*\/]*`
- valueFormat = `[\x20-\x2b\x2d-\x3c\x3e-\x7e]*[\x21-\x2b\x2d-\x3c\x3e-\x7e]`
+ listDelimiters = ","
+ memberDelimiter = "="
errInvalidKey errorConst = "invalid tracestate key"
errInvalidValue errorConst = "invalid tracestate value"
@@ -39,43 +22,128 @@ const (
errDuplicate errorConst = "duplicate list-member in tracestate"
)
-var (
- noTenantKeyRe = regexp.MustCompile(`^` + noTenantKeyFormat + `$`)
- withTenantKeyRe = regexp.MustCompile(`^` + withTenantKeyFormat + `$`)
- valueRe = regexp.MustCompile(`^` + valueFormat + `$`)
- memberRe = regexp.MustCompile(`^\s*((?:` + noTenantKeyFormat + `)|(?:` + withTenantKeyFormat + `))=(` + valueFormat + `)\s*$`)
-)
-
type member struct {
Key string
Value string
}
-func newMember(key, value string) (member, error) {
- if len(key) > 256 {
- return member{}, fmt.Errorf("%w: %s", errInvalidKey, key)
+// according to (chr = %x20 / (nblk-char = %x21-2B / %x2D-3C / %x3E-7E) )
+// means (chr = %x20-2B / %x2D-3C / %x3E-7E) .
+func checkValueChar(v byte) bool {
+ return v >= '\x20' && v <= '\x7e' && v != '\x2c' && v != '\x3d'
+}
+
+// according to (nblk-chr = %x21-2B / %x2D-3C / %x3E-7E) .
+func checkValueLast(v byte) bool {
+ return v >= '\x21' && v <= '\x7e' && v != '\x2c' && v != '\x3d'
+}
+
+// based on the W3C Trace Context specification
+//
+// value = (0*255(chr)) nblk-chr
+// nblk-chr = %x21-2B / %x2D-3C / %x3E-7E
+// chr = %x20 / nblk-chr
+//
+// see https://www.w3.org/TR/trace-context-1/#value
+func checkValue(val string) bool {
+ n := len(val)
+ if n == 0 || n > 256 {
+ return false
+ }
+ for i := 0; i < n-1; i++ {
+ if !checkValueChar(val[i]) {
+ return false
+ }
}
- if !noTenantKeyRe.MatchString(key) {
- if !withTenantKeyRe.MatchString(key) {
- return member{}, fmt.Errorf("%w: %s", errInvalidKey, key)
+ return checkValueLast(val[n-1])
+}
+
+func checkKeyRemain(key string) bool {
+ // ( lcalpha / DIGIT / "_" / "-"/ "*" / "/" )
+ for _, v := range key {
+ if isAlphaNum(byte(v)) {
+ continue
}
- atIndex := strings.LastIndex(key, "@")
- if atIndex > 241 || len(key)-1-atIndex > 14 {
- return member{}, fmt.Errorf("%w: %s", errInvalidKey, key)
+ switch v {
+ case '_', '-', '*', '/':
+ continue
}
+ return false
+ }
+ return true
+}
+
+// according to
+//
+// simple-key = lcalpha (0*255( lcalpha / DIGIT / "_" / "-"/ "*" / "/" ))
+// system-id = lcalpha (0*13( lcalpha / DIGIT / "_" / "-"/ "*" / "/" ))
+//
+// param n is remain part length, should be 255 in simple-key or 13 in system-id.
+func checkKeyPart(key string, n int) bool {
+ if len(key) == 0 {
+ return false
+ }
+ first := key[0] // key's first char
+ ret := len(key[1:]) <= n
+ ret = ret && first >= 'a' && first <= 'z'
+ return ret && checkKeyRemain(key[1:])
+}
+
+func isAlphaNum(c byte) bool {
+ if c >= 'a' && c <= 'z' {
+ return true
+ }
+ return c >= '0' && c <= '9'
+}
+
+// according to
+//
+// tenant-id = ( lcalpha / DIGIT ) 0*240( lcalpha / DIGIT / "_" / "-"/ "*" / "/" )
+//
+// param n is remain part length, should be 240 exactly.
+func checkKeyTenant(key string, n int) bool {
+ if len(key) == 0 {
+ return false
+ }
+ return isAlphaNum(key[0]) && len(key[1:]) <= n && checkKeyRemain(key[1:])
+}
+
+// based on the W3C Trace Context specification
+//
+// key = simple-key / multi-tenant-key
+// simple-key = lcalpha (0*255( lcalpha / DIGIT / "_" / "-"/ "*" / "/" ))
+// multi-tenant-key = tenant-id "@" system-id
+// tenant-id = ( lcalpha / DIGIT ) (0*240( lcalpha / DIGIT / "_" / "-"/ "*" / "/" ))
+// system-id = lcalpha (0*13( lcalpha / DIGIT / "_" / "-"/ "*" / "/" ))
+// lcalpha = %x61-7A ; a-z
+//
+// see https://www.w3.org/TR/trace-context-1/#tracestate-header.
+func checkKey(key string) bool {
+ tenant, system, ok := strings.Cut(key, "@")
+ if !ok {
+ return checkKeyPart(key, 255)
}
- if len(value) > 256 || !valueRe.MatchString(value) {
- return member{}, fmt.Errorf("%w: %s", errInvalidValue, value)
+ return checkKeyTenant(tenant, 240) && checkKeyPart(system, 13)
+}
+
+func newMember(key, value string) (member, error) {
+ if !checkKey(key) {
+ return member{}, errInvalidKey
+ }
+ if !checkValue(value) {
+ return member{}, errInvalidValue
}
return member{Key: key, Value: value}, nil
}
func parseMember(m string) (member, error) {
- matches := memberRe.FindStringSubmatch(m)
- if len(matches) != 3 {
+ key, val, ok := strings.Cut(m, memberDelimiter)
+ if !ok {
return member{}, fmt.Errorf("%w: %s", errInvalidMember, m)
}
- result, e := newMember(matches[1], matches[2])
+ key = strings.TrimLeft(key, " \t")
+ val = strings.TrimRight(val, " \t")
+ result, e := newMember(key, val)
if e != nil {
return member{}, fmt.Errorf("%w: %s", errInvalidMember, m)
}
@@ -85,7 +153,7 @@ func parseMember(m string) (member, error) {
// String encodes member into a string compliant with the W3C Trace Context
// specification.
func (m member) String() string {
- return fmt.Sprintf("%s=%s", m.Key, m.Value)
+ return m.Key + "=" + m.Value
}
// TraceState provides additional vendor-specific trace identification
@@ -109,8 +177,8 @@ var _ json.Marshaler = TraceState{}
// ParseTraceState attempts to decode a TraceState from the passed
// string. It returns an error if the input is invalid according to the W3C
// Trace Context specification.
-func ParseTraceState(tracestate string) (TraceState, error) {
- if tracestate == "" {
+func ParseTraceState(ts string) (TraceState, error) {
+ if ts == "" {
return TraceState{}, nil
}
@@ -120,7 +188,9 @@ func ParseTraceState(tracestate string) (TraceState, error) {
var members []member
found := make(map[string]struct{})
- for _, memberStr := range strings.Split(tracestate, listDelimiter) {
+ for ts != "" {
+ var memberStr string
+ memberStr, ts, _ = strings.Cut(ts, listDelimiters)
if len(memberStr) == 0 {
continue
}
@@ -153,11 +223,29 @@ func (ts TraceState) MarshalJSON() ([]byte, error) {
// Trace Context specification. The returned string will be invalid if the
// TraceState contains any invalid members.
func (ts TraceState) String() string {
- members := make([]string, len(ts.list))
- for i, m := range ts.list {
- members[i] = m.String()
+ if len(ts.list) == 0 {
+ return ""
+ }
+ var n int
+ n += len(ts.list) // member delimiters: '='
+ n += len(ts.list) - 1 // list delimiters: ','
+ for _, mem := range ts.list {
+ n += len(mem.Key)
+ n += len(mem.Value)
}
- return strings.Join(members, listDelimiter)
+
+ var sb strings.Builder
+ sb.Grow(n)
+ _, _ = sb.WriteString(ts.list[0].Key)
+ _ = sb.WriteByte('=')
+ _, _ = sb.WriteString(ts.list[0].Value)
+ for i := 1; i < len(ts.list); i++ {
+ _ = sb.WriteByte(listDelimiters[0])
+ _, _ = sb.WriteString(ts.list[i].Key)
+ _ = sb.WriteByte('=')
+ _, _ = sb.WriteString(ts.list[i].Value)
+ }
+ return sb.String()
}
// Get returns the value paired with key from the corresponding TraceState
@@ -172,6 +260,16 @@ func (ts TraceState) Get(key string) string {
return ""
}
+// Walk walks all key value pairs in the TraceState by calling f
+// Iteration stops if f returns false.
+func (ts TraceState) Walk(f func(key, value string) bool) {
+ for _, m := range ts.list {
+ if !f(m.Key, m.Value) {
+ break
+ }
+ }
+}
+
// Insert adds a new list-member defined by the key/value pair to the
// TraceState. If a list-member already exists for the given key, that
// list-member's value is updated. The new or updated list-member is always
@@ -189,15 +287,25 @@ func (ts TraceState) Insert(key, value string) (TraceState, error) {
if err != nil {
return ts, err
}
-
- cTS := ts.Delete(key)
- if cTS.Len()+1 <= maxListMembers {
- cTS.list = append(cTS.list, member{})
+ n := len(ts.list)
+ found := n
+ for i := range ts.list {
+ if ts.list[i].Key == key {
+ found = i
+ }
+ }
+ cTS := TraceState{}
+ if found == n && n < maxListMembers {
+ cTS.list = make([]member, n+1)
+ } else {
+ cTS.list = make([]member, n)
}
- // When the number of members exceeds capacity, drop the "right-most".
- copy(cTS.list[1:], cTS.list)
cTS.list[0] = m
-
+ // When the number of members exceeds capacity, drop the "right-most".
+ copy(cTS.list[1:], ts.list[0:found])
+ if found < n {
+ copy(cTS.list[1+found:], ts.list[found+1:])
+ }
return cTS, nil
}
diff --git a/vendor/go.opentelemetry.io/otel/verify_examples.sh b/vendor/go.opentelemetry.io/otel/verify_examples.sh
deleted file mode 100644
index dbb61a42..00000000
--- a/vendor/go.opentelemetry.io/otel/verify_examples.sh
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/bin/bash
-
-# Copyright The OpenTelemetry 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.
-
-set -euo pipefail
-
-cd $(dirname $0)
-TOOLS_DIR=$(pwd)/.tools
-
-if [ -z "${GOPATH}" ] ; then
- printf "GOPATH is not defined.\n"
- exit -1
-fi
-
-if [ ! -d "${GOPATH}" ] ; then
- printf "GOPATH ${GOPATH} is invalid \n"
- exit -1
-fi
-
-# Pre-requisites
-if ! git diff --quiet; then \
- git status
- printf "\n\nError: working tree is not clean\n"
- exit -1
-fi
-
-if [ "$(git tag --contains $(git log -1 --pretty=format:"%H"))" = "" ] ; then
- printf "$(git log -1)"
- printf "\n\nError: HEAD is not pointing to a tagged version"
-fi
-
-make ${TOOLS_DIR}/gojq
-
-DIR_TMP="${GOPATH}/src/oteltmp/"
-rm -rf $DIR_TMP
-mkdir -p $DIR_TMP
-
-printf "Copy examples to ${DIR_TMP}\n"
-cp -a ./example ${DIR_TMP}
-
-# Update go.mod files
-printf "Update go.mod: rename module and remove replace\n"
-
-PACKAGE_DIRS=$(find . -mindepth 2 -type f -name 'go.mod' -exec dirname {} \; | egrep 'example' | sed 's/^\.\///' | sort)
-
-for dir in $PACKAGE_DIRS; do
- printf " Update go.mod for $dir\n"
- (cd "${DIR_TMP}/${dir}" && \
- # replaces is ("mod1" "mod2" …)
- replaces=($(go mod edit -json | ${TOOLS_DIR}/gojq '.Replace[].Old.Path')) && \
- # strip double quotes
- replaces=("${replaces[@]%\"}") && \
- replaces=("${replaces[@]#\"}") && \
- # make an array (-dropreplace=mod1 -dropreplace=mod2 …)
- dropreplaces=("${replaces[@]/#/-dropreplace=}") && \
- go mod edit -module "oteltmp/${dir}" "${dropreplaces[@]}" && \
- go mod tidy)
-done
-printf "Update done:\n\n"
-
-# Build directories that contain main package. These directories are different than
-# directories that contain go.mod files.
-printf "Build examples:\n"
-EXAMPLES=$(./get_main_pkgs.sh ./example)
-for ex in $EXAMPLES; do
- printf " Build $ex in ${DIR_TMP}/${ex}\n"
- (cd "${DIR_TMP}/${ex}" && \
- go build .)
-done
-
-# Cleanup
-printf "Remove copied files.\n"
-rm -rf $DIR_TMP
diff --git a/vendor/go.opentelemetry.io/otel/verify_readmes.sh b/vendor/go.opentelemetry.io/otel/verify_readmes.sh
new file mode 100644
index 00000000..1e87855e
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/verify_readmes.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+# Copyright The OpenTelemetry Authors
+# SPDX-License-Identifier: Apache-2.0
+
+set -euo pipefail
+
+dirs=$(find . -type d -not -path "*/internal*" -not -path "*/test*" -not -path "*/example*" -not -path "*/.*" | sort)
+
+missingReadme=false
+for dir in $dirs; do
+ if [ ! -f "$dir/README.md" ]; then
+ echo "couldn't find README.md for $dir"
+ missingReadme=true
+ fi
+done
+
+if [ "$missingReadme" = true ] ; then
+ echo "Error: some READMEs couldn't be found."
+ exit 1
+fi
diff --git a/vendor/go.opentelemetry.io/otel/verify_released_changelog.sh b/vendor/go.opentelemetry.io/otel/verify_released_changelog.sh
new file mode 100644
index 00000000..c9b7cdbb
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/verify_released_changelog.sh
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+# Copyright The OpenTelemetry Authors
+# SPDX-License-Identifier: Apache-2.0
+
+set -euo pipefail
+
+TARGET="${1:?Must provide target ref}"
+
+FILE="CHANGELOG.md"
+TEMP_DIR=$(mktemp -d)
+echo "Temp folder: $TEMP_DIR"
+
+# Only the latest commit of the feature branch is available
+# automatically. To diff with the base branch, we need to
+# fetch that too (and we only need its latest commit).
+git fetch origin "${TARGET}" --depth=1
+
+# Checkout the previous version on the base branch of the changelog to tmpfolder
+git --work-tree="$TEMP_DIR" checkout FETCH_HEAD $FILE
+
+PREVIOUS_FILE="$TEMP_DIR/$FILE"
+CURRENT_FILE="$FILE"
+PREVIOUS_LOCKED_FILE="$TEMP_DIR/previous_locked_section.md"
+CURRENT_LOCKED_FILE="$TEMP_DIR/current_locked_section.md"
+
+# Extract released sections from the previous version
+awk '/^/ {flag=1} /^/ {flag=0} flag' "$PREVIOUS_FILE" > "$PREVIOUS_LOCKED_FILE"
+
+# Extract released sections from the current version
+awk '/^/ {flag=1} /^/ {flag=0} flag' "$CURRENT_FILE" > "$CURRENT_LOCKED_FILE"
+
+# Compare the released sections
+if ! diff -q "$PREVIOUS_LOCKED_FILE" "$CURRENT_LOCKED_FILE"; then
+ echo "Error: The released sections of the changelog file have been modified."
+ diff "$PREVIOUS_LOCKED_FILE" "$CURRENT_LOCKED_FILE"
+ rm -rf "$TEMP_DIR"
+ false
+fi
+
+rm -rf "$TEMP_DIR"
+echo "The released sections remain unchanged."
diff --git a/vendor/go.opentelemetry.io/otel/version.go b/vendor/go.opentelemetry.io/otel/version.go
index e2f74358..59e24816 100644
--- a/vendor/go.opentelemetry.io/otel/version.go
+++ b/vendor/go.opentelemetry.io/otel/version.go
@@ -1,20 +1,9 @@
// Copyright The OpenTelemetry 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.
+// SPDX-License-Identifier: Apache-2.0
package otel // import "go.opentelemetry.io/otel"
// Version is the current release version of OpenTelemetry in use.
func Version() string {
- return "1.21.0"
+ return "1.32.0"
}
diff --git a/vendor/go.opentelemetry.io/otel/versions.yaml b/vendor/go.opentelemetry.io/otel/versions.yaml
index 3c153c9d..c04b12f6 100644
--- a/vendor/go.opentelemetry.io/otel/versions.yaml
+++ b/vendor/go.opentelemetry.io/otel/versions.yaml
@@ -1,32 +1,21 @@
# Copyright The OpenTelemetry 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.
+# SPDX-License-Identifier: Apache-2.0
module-sets:
stable-v1:
- version: v1.21.0
+ version: v1.32.0
modules:
- go.opentelemetry.io/otel
+ - go.opentelemetry.io/otel/bridge/opencensus
+ - go.opentelemetry.io/otel/bridge/opencensus/test
- go.opentelemetry.io/otel/bridge/opentracing
- go.opentelemetry.io/otel/bridge/opentracing/test
- - go.opentelemetry.io/otel/example/dice
- - go.opentelemetry.io/otel/example/namedtracer
- - go.opentelemetry.io/otel/example/otel-collector
- - go.opentelemetry.io/otel/example/passthrough
- - go.opentelemetry.io/otel/example/zipkin
+ - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc
+ - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp
- go.opentelemetry.io/otel/exporters/otlp/otlptrace
- go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc
- go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp
+ - go.opentelemetry.io/otel/exporters/stdout/stdoutmetric
- go.opentelemetry.io/otel/exporters/stdout/stdouttrace
- go.opentelemetry.io/otel/exporters/zipkin
- go.opentelemetry.io/otel/metric
@@ -34,18 +23,19 @@ module-sets:
- go.opentelemetry.io/otel/sdk/metric
- go.opentelemetry.io/otel/trace
experimental-metrics:
- version: v0.44.0
+ version: v0.54.0
modules:
- - go.opentelemetry.io/otel/bridge/opencensus
- - go.opentelemetry.io/otel/bridge/opencensus/test
- - go.opentelemetry.io/otel/example/opencensus
- - go.opentelemetry.io/otel/example/prometheus
- - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc
- - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp
- go.opentelemetry.io/otel/exporters/prometheus
- - go.opentelemetry.io/otel/exporters/stdout/stdoutmetric
+ experimental-logs:
+ version: v0.8.0
+ modules:
+ - go.opentelemetry.io/otel/log
+ - go.opentelemetry.io/otel/sdk/log
+ - go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc
+ - go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp
+ - go.opentelemetry.io/otel/exporters/stdout/stdoutlog
experimental-schema:
- version: v0.0.7
+ version: v0.0.11
modules:
- go.opentelemetry.io/otel/schema
excluded-modules:
diff --git a/vendor/golang.org/x/crypto/LICENSE b/vendor/golang.org/x/crypto/LICENSE
index 6a66aea5..2a7cf70d 100644
--- a/vendor/golang.org/x/crypto/LICENSE
+++ b/vendor/golang.org/x/crypto/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2009 The Go Authors. All rights reserved.
+Copyright 2009 The Go Authors.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@@ -10,7 +10,7 @@ notice, this list of conditions and the following disclaimer.
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
- * Neither the name of Google Inc. nor the names of its
+ * Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
diff --git a/vendor/golang.org/x/crypto/chacha20/chacha_noasm.go b/vendor/golang.org/x/crypto/chacha20/chacha_noasm.go
index db42e667..c709b728 100644
--- a/vendor/golang.org/x/crypto/chacha20/chacha_noasm.go
+++ b/vendor/golang.org/x/crypto/chacha20/chacha_noasm.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build (!arm64 && !s390x && !ppc64le) || !gc || purego
+//go:build (!arm64 && !s390x && !ppc64 && !ppc64le) || !gc || purego
package chacha20
diff --git a/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.go b/vendor/golang.org/x/crypto/chacha20/chacha_ppc64x.go
similarity index 89%
rename from vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.go
rename to vendor/golang.org/x/crypto/chacha20/chacha_ppc64x.go
index 3a4287f9..bd183d9b 100644
--- a/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.go
+++ b/vendor/golang.org/x/crypto/chacha20/chacha_ppc64x.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build gc && !purego
+//go:build gc && !purego && (ppc64 || ppc64le)
package chacha20
diff --git a/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.s b/vendor/golang.org/x/crypto/chacha20/chacha_ppc64x.s
similarity index 76%
rename from vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.s
rename to vendor/golang.org/x/crypto/chacha20/chacha_ppc64x.s
index c672ccf6..a660b411 100644
--- a/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.s
+++ b/vendor/golang.org/x/crypto/chacha20/chacha_ppc64x.s
@@ -19,7 +19,7 @@
// The differences in this and the original implementation are
// due to the calling conventions and initialization of constants.
-//go:build gc && !purego
+//go:build gc && !purego && (ppc64 || ppc64le)
#include "textflag.h"
@@ -36,32 +36,68 @@
// for VPERMXOR
#define MASK R18
-DATA consts<>+0x00(SB)/8, $0x3320646e61707865
-DATA consts<>+0x08(SB)/8, $0x6b20657479622d32
-DATA consts<>+0x10(SB)/8, $0x0000000000000001
-DATA consts<>+0x18(SB)/8, $0x0000000000000000
-DATA consts<>+0x20(SB)/8, $0x0000000000000004
-DATA consts<>+0x28(SB)/8, $0x0000000000000000
-DATA consts<>+0x30(SB)/8, $0x0a0b08090e0f0c0d
-DATA consts<>+0x38(SB)/8, $0x0203000106070405
-DATA consts<>+0x40(SB)/8, $0x090a0b080d0e0f0c
-DATA consts<>+0x48(SB)/8, $0x0102030005060704
-DATA consts<>+0x50(SB)/8, $0x6170786561707865
-DATA consts<>+0x58(SB)/8, $0x6170786561707865
-DATA consts<>+0x60(SB)/8, $0x3320646e3320646e
-DATA consts<>+0x68(SB)/8, $0x3320646e3320646e
-DATA consts<>+0x70(SB)/8, $0x79622d3279622d32
-DATA consts<>+0x78(SB)/8, $0x79622d3279622d32
-DATA consts<>+0x80(SB)/8, $0x6b2065746b206574
-DATA consts<>+0x88(SB)/8, $0x6b2065746b206574
-DATA consts<>+0x90(SB)/8, $0x0000000100000000
-DATA consts<>+0x98(SB)/8, $0x0000000300000002
-DATA consts<>+0xa0(SB)/8, $0x5566774411223300
-DATA consts<>+0xa8(SB)/8, $0xddeeffcc99aabb88
-DATA consts<>+0xb0(SB)/8, $0x6677445522330011
-DATA consts<>+0xb8(SB)/8, $0xeeffccddaabb8899
+DATA consts<>+0x00(SB)/4, $0x61707865
+DATA consts<>+0x04(SB)/4, $0x3320646e
+DATA consts<>+0x08(SB)/4, $0x79622d32
+DATA consts<>+0x0c(SB)/4, $0x6b206574
+DATA consts<>+0x10(SB)/4, $0x00000001
+DATA consts<>+0x14(SB)/4, $0x00000000
+DATA consts<>+0x18(SB)/4, $0x00000000
+DATA consts<>+0x1c(SB)/4, $0x00000000
+DATA consts<>+0x20(SB)/4, $0x00000004
+DATA consts<>+0x24(SB)/4, $0x00000000
+DATA consts<>+0x28(SB)/4, $0x00000000
+DATA consts<>+0x2c(SB)/4, $0x00000000
+DATA consts<>+0x30(SB)/4, $0x0e0f0c0d
+DATA consts<>+0x34(SB)/4, $0x0a0b0809
+DATA consts<>+0x38(SB)/4, $0x06070405
+DATA consts<>+0x3c(SB)/4, $0x02030001
+DATA consts<>+0x40(SB)/4, $0x0d0e0f0c
+DATA consts<>+0x44(SB)/4, $0x090a0b08
+DATA consts<>+0x48(SB)/4, $0x05060704
+DATA consts<>+0x4c(SB)/4, $0x01020300
+DATA consts<>+0x50(SB)/4, $0x61707865
+DATA consts<>+0x54(SB)/4, $0x61707865
+DATA consts<>+0x58(SB)/4, $0x61707865
+DATA consts<>+0x5c(SB)/4, $0x61707865
+DATA consts<>+0x60(SB)/4, $0x3320646e
+DATA consts<>+0x64(SB)/4, $0x3320646e
+DATA consts<>+0x68(SB)/4, $0x3320646e
+DATA consts<>+0x6c(SB)/4, $0x3320646e
+DATA consts<>+0x70(SB)/4, $0x79622d32
+DATA consts<>+0x74(SB)/4, $0x79622d32
+DATA consts<>+0x78(SB)/4, $0x79622d32
+DATA consts<>+0x7c(SB)/4, $0x79622d32
+DATA consts<>+0x80(SB)/4, $0x6b206574
+DATA consts<>+0x84(SB)/4, $0x6b206574
+DATA consts<>+0x88(SB)/4, $0x6b206574
+DATA consts<>+0x8c(SB)/4, $0x6b206574
+DATA consts<>+0x90(SB)/4, $0x00000000
+DATA consts<>+0x94(SB)/4, $0x00000001
+DATA consts<>+0x98(SB)/4, $0x00000002
+DATA consts<>+0x9c(SB)/4, $0x00000003
+DATA consts<>+0xa0(SB)/4, $0x11223300
+DATA consts<>+0xa4(SB)/4, $0x55667744
+DATA consts<>+0xa8(SB)/4, $0x99aabb88
+DATA consts<>+0xac(SB)/4, $0xddeeffcc
+DATA consts<>+0xb0(SB)/4, $0x22330011
+DATA consts<>+0xb4(SB)/4, $0x66774455
+DATA consts<>+0xb8(SB)/4, $0xaabb8899
+DATA consts<>+0xbc(SB)/4, $0xeeffccdd
GLOBL consts<>(SB), RODATA, $0xc0
+#ifdef GOARCH_ppc64
+#define BE_XXBRW_INIT() \
+ LVSL (R0)(R0), V24 \
+ VSPLTISB $3, V25 \
+ VXOR V24, V25, V24 \
+
+#define BE_XXBRW(vr) VPERM vr, vr, V24, vr
+#else
+#define BE_XXBRW_INIT()
+#define BE_XXBRW(vr)
+#endif
+
//func chaCha20_ctr32_vsx(out, inp *byte, len int, key *[8]uint32, counter *uint32)
TEXT ·chaCha20_ctr32_vsx(SB),NOSPLIT,$64-40
MOVD out+0(FP), OUT
@@ -94,6 +130,8 @@ TEXT ·chaCha20_ctr32_vsx(SB),NOSPLIT,$64-40
// Clear V27
VXOR V27, V27, V27
+ BE_XXBRW_INIT()
+
// V28
LXVW4X (CONSTBASE)(R11), VS60
@@ -299,6 +337,11 @@ loop_vsx:
VADDUWM V8, V18, V8
VADDUWM V12, V19, V12
+ BE_XXBRW(V0)
+ BE_XXBRW(V4)
+ BE_XXBRW(V8)
+ BE_XXBRW(V12)
+
CMPU LEN, $64
BLT tail_vsx
@@ -327,6 +370,11 @@ loop_vsx:
VADDUWM V9, V18, V8
VADDUWM V13, V19, V12
+ BE_XXBRW(V0)
+ BE_XXBRW(V4)
+ BE_XXBRW(V8)
+ BE_XXBRW(V12)
+
CMPU LEN, $64
BLT tail_vsx
@@ -334,8 +382,8 @@ loop_vsx:
LXVW4X (INP)(R8), VS60
LXVW4X (INP)(R9), VS61
LXVW4X (INP)(R10), VS62
- VXOR V27, V0, V27
+ VXOR V27, V0, V27
VXOR V28, V4, V28
VXOR V29, V8, V29
VXOR V30, V12, V30
@@ -354,6 +402,11 @@ loop_vsx:
VADDUWM V10, V18, V8
VADDUWM V14, V19, V12
+ BE_XXBRW(V0)
+ BE_XXBRW(V4)
+ BE_XXBRW(V8)
+ BE_XXBRW(V12)
+
CMPU LEN, $64
BLT tail_vsx
@@ -381,6 +434,11 @@ loop_vsx:
VADDUWM V11, V18, V8
VADDUWM V15, V19, V12
+ BE_XXBRW(V0)
+ BE_XXBRW(V4)
+ BE_XXBRW(V8)
+ BE_XXBRW(V12)
+
CMPU LEN, $64
BLT tail_vsx
@@ -408,9 +466,9 @@ loop_vsx:
done_vsx:
// Increment counter by number of 64 byte blocks
- MOVD (CNT), R14
+ MOVWZ (CNT), R14
ADD BLOCKS, R14
- MOVD R14, (CNT)
+ MOVWZ R14, (CNT)
RET
tail_vsx:
diff --git a/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305.go b/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305.go
index 93da7322..8cf5d811 100644
--- a/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305.go
+++ b/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305.go
@@ -5,7 +5,7 @@
// Package chacha20poly1305 implements the ChaCha20-Poly1305 AEAD and its
// extended nonce variant XChaCha20-Poly1305, as specified in RFC 8439 and
// draft-irtf-cfrg-xchacha-01.
-package chacha20poly1305 // import "golang.org/x/crypto/chacha20poly1305"
+package chacha20poly1305
import (
"crypto/cipher"
diff --git a/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.s b/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.s
index 731d2ac6..fd5ee845 100644
--- a/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.s
+++ b/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.s
@@ -1,2715 +1,9762 @@
-// Copyright 2016 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// This file was originally from https://golang.org/cl/24717 by Vlad Krasnov of CloudFlare.
+// Code generated by command: go run chacha20poly1305_amd64_asm.go -out ../chacha20poly1305_amd64.s -pkg chacha20poly1305. DO NOT EDIT.
//go:build gc && !purego
#include "textflag.h"
-// General register allocation
-#define oup DI
-#define inp SI
-#define inl BX
-#define adp CX // free to reuse, after we hash the additional data
-#define keyp R8 // free to reuse, when we copy the key to stack
-#define itr2 R9 // general iterator
-#define itr1 CX // general iterator
-#define acc0 R10
-#define acc1 R11
-#define acc2 R12
-#define t0 R13
-#define t1 R14
-#define t2 R15
-#define t3 R8
-// Register and stack allocation for the SSE code
-#define rStore (0*16)(BP)
-#define sStore (1*16)(BP)
-#define state1Store (2*16)(BP)
-#define state2Store (3*16)(BP)
-#define tmpStore (4*16)(BP)
-#define ctr0Store (5*16)(BP)
-#define ctr1Store (6*16)(BP)
-#define ctr2Store (7*16)(BP)
-#define ctr3Store (8*16)(BP)
-#define A0 X0
-#define A1 X1
-#define A2 X2
-#define B0 X3
-#define B1 X4
-#define B2 X5
-#define C0 X6
-#define C1 X7
-#define C2 X8
-#define D0 X9
-#define D1 X10
-#define D2 X11
-#define T0 X12
-#define T1 X13
-#define T2 X14
-#define T3 X15
-#define A3 T0
-#define B3 T1
-#define C3 T2
-#define D3 T3
-// Register and stack allocation for the AVX2 code
-#define rsStoreAVX2 (0*32)(BP)
-#define state1StoreAVX2 (1*32)(BP)
-#define state2StoreAVX2 (2*32)(BP)
-#define ctr0StoreAVX2 (3*32)(BP)
-#define ctr1StoreAVX2 (4*32)(BP)
-#define ctr2StoreAVX2 (5*32)(BP)
-#define ctr3StoreAVX2 (6*32)(BP)
-#define tmpStoreAVX2 (7*32)(BP) // 256 bytes on stack
-#define AA0 Y0
-#define AA1 Y5
-#define AA2 Y6
-#define AA3 Y7
-#define BB0 Y14
-#define BB1 Y9
-#define BB2 Y10
-#define BB3 Y11
-#define CC0 Y12
-#define CC1 Y13
-#define CC2 Y8
-#define CC3 Y15
-#define DD0 Y4
-#define DD1 Y1
-#define DD2 Y2
-#define DD3 Y3
-#define TT0 DD3
-#define TT1 AA3
-#define TT2 BB3
-#define TT3 CC3
-// ChaCha20 constants
-DATA ·chacha20Constants<>+0x00(SB)/4, $0x61707865
-DATA ·chacha20Constants<>+0x04(SB)/4, $0x3320646e
-DATA ·chacha20Constants<>+0x08(SB)/4, $0x79622d32
-DATA ·chacha20Constants<>+0x0c(SB)/4, $0x6b206574
-DATA ·chacha20Constants<>+0x10(SB)/4, $0x61707865
-DATA ·chacha20Constants<>+0x14(SB)/4, $0x3320646e
-DATA ·chacha20Constants<>+0x18(SB)/4, $0x79622d32
-DATA ·chacha20Constants<>+0x1c(SB)/4, $0x6b206574
-// <<< 16 with PSHUFB
-DATA ·rol16<>+0x00(SB)/8, $0x0504070601000302
-DATA ·rol16<>+0x08(SB)/8, $0x0D0C0F0E09080B0A
-DATA ·rol16<>+0x10(SB)/8, $0x0504070601000302
-DATA ·rol16<>+0x18(SB)/8, $0x0D0C0F0E09080B0A
-// <<< 8 with PSHUFB
-DATA ·rol8<>+0x00(SB)/8, $0x0605040702010003
-DATA ·rol8<>+0x08(SB)/8, $0x0E0D0C0F0A09080B
-DATA ·rol8<>+0x10(SB)/8, $0x0605040702010003
-DATA ·rol8<>+0x18(SB)/8, $0x0E0D0C0F0A09080B
-
-DATA ·avx2InitMask<>+0x00(SB)/8, $0x0
-DATA ·avx2InitMask<>+0x08(SB)/8, $0x0
-DATA ·avx2InitMask<>+0x10(SB)/8, $0x1
-DATA ·avx2InitMask<>+0x18(SB)/8, $0x0
-
-DATA ·avx2IncMask<>+0x00(SB)/8, $0x2
-DATA ·avx2IncMask<>+0x08(SB)/8, $0x0
-DATA ·avx2IncMask<>+0x10(SB)/8, $0x2
-DATA ·avx2IncMask<>+0x18(SB)/8, $0x0
-// Poly1305 key clamp
-DATA ·polyClampMask<>+0x00(SB)/8, $0x0FFFFFFC0FFFFFFF
-DATA ·polyClampMask<>+0x08(SB)/8, $0x0FFFFFFC0FFFFFFC
-DATA ·polyClampMask<>+0x10(SB)/8, $0xFFFFFFFFFFFFFFFF
-DATA ·polyClampMask<>+0x18(SB)/8, $0xFFFFFFFFFFFFFFFF
-
-DATA ·sseIncMask<>+0x00(SB)/8, $0x1
-DATA ·sseIncMask<>+0x08(SB)/8, $0x0
-// To load/store the last < 16 bytes in a buffer
-DATA ·andMask<>+0x00(SB)/8, $0x00000000000000ff
-DATA ·andMask<>+0x08(SB)/8, $0x0000000000000000
-DATA ·andMask<>+0x10(SB)/8, $0x000000000000ffff
-DATA ·andMask<>+0x18(SB)/8, $0x0000000000000000
-DATA ·andMask<>+0x20(SB)/8, $0x0000000000ffffff
-DATA ·andMask<>+0x28(SB)/8, $0x0000000000000000
-DATA ·andMask<>+0x30(SB)/8, $0x00000000ffffffff
-DATA ·andMask<>+0x38(SB)/8, $0x0000000000000000
-DATA ·andMask<>+0x40(SB)/8, $0x000000ffffffffff
-DATA ·andMask<>+0x48(SB)/8, $0x0000000000000000
-DATA ·andMask<>+0x50(SB)/8, $0x0000ffffffffffff
-DATA ·andMask<>+0x58(SB)/8, $0x0000000000000000
-DATA ·andMask<>+0x60(SB)/8, $0x00ffffffffffffff
-DATA ·andMask<>+0x68(SB)/8, $0x0000000000000000
-DATA ·andMask<>+0x70(SB)/8, $0xffffffffffffffff
-DATA ·andMask<>+0x78(SB)/8, $0x0000000000000000
-DATA ·andMask<>+0x80(SB)/8, $0xffffffffffffffff
-DATA ·andMask<>+0x88(SB)/8, $0x00000000000000ff
-DATA ·andMask<>+0x90(SB)/8, $0xffffffffffffffff
-DATA ·andMask<>+0x98(SB)/8, $0x000000000000ffff
-DATA ·andMask<>+0xa0(SB)/8, $0xffffffffffffffff
-DATA ·andMask<>+0xa8(SB)/8, $0x0000000000ffffff
-DATA ·andMask<>+0xb0(SB)/8, $0xffffffffffffffff
-DATA ·andMask<>+0xb8(SB)/8, $0x00000000ffffffff
-DATA ·andMask<>+0xc0(SB)/8, $0xffffffffffffffff
-DATA ·andMask<>+0xc8(SB)/8, $0x000000ffffffffff
-DATA ·andMask<>+0xd0(SB)/8, $0xffffffffffffffff
-DATA ·andMask<>+0xd8(SB)/8, $0x0000ffffffffffff
-DATA ·andMask<>+0xe0(SB)/8, $0xffffffffffffffff
-DATA ·andMask<>+0xe8(SB)/8, $0x00ffffffffffffff
-
-GLOBL ·chacha20Constants<>(SB), (NOPTR+RODATA), $32
-GLOBL ·rol16<>(SB), (NOPTR+RODATA), $32
-GLOBL ·rol8<>(SB), (NOPTR+RODATA), $32
-GLOBL ·sseIncMask<>(SB), (NOPTR+RODATA), $16
-GLOBL ·avx2IncMask<>(SB), (NOPTR+RODATA), $32
-GLOBL ·avx2InitMask<>(SB), (NOPTR+RODATA), $32
-GLOBL ·polyClampMask<>(SB), (NOPTR+RODATA), $32
-GLOBL ·andMask<>(SB), (NOPTR+RODATA), $240
-// No PALIGNR in Go ASM yet (but VPALIGNR is present).
-#define shiftB0Left BYTE $0x66; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xdb; BYTE $0x04 // PALIGNR $4, X3, X3
-#define shiftB1Left BYTE $0x66; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xe4; BYTE $0x04 // PALIGNR $4, X4, X4
-#define shiftB2Left BYTE $0x66; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xed; BYTE $0x04 // PALIGNR $4, X5, X5
-#define shiftB3Left BYTE $0x66; BYTE $0x45; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xed; BYTE $0x04 // PALIGNR $4, X13, X13
-#define shiftC0Left BYTE $0x66; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xf6; BYTE $0x08 // PALIGNR $8, X6, X6
-#define shiftC1Left BYTE $0x66; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xff; BYTE $0x08 // PALIGNR $8, X7, X7
-#define shiftC2Left BYTE $0x66; BYTE $0x45; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xc0; BYTE $0x08 // PALIGNR $8, X8, X8
-#define shiftC3Left BYTE $0x66; BYTE $0x45; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xf6; BYTE $0x08 // PALIGNR $8, X14, X14
-#define shiftD0Left BYTE $0x66; BYTE $0x45; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xc9; BYTE $0x0c // PALIGNR $12, X9, X9
-#define shiftD1Left BYTE $0x66; BYTE $0x45; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xd2; BYTE $0x0c // PALIGNR $12, X10, X10
-#define shiftD2Left BYTE $0x66; BYTE $0x45; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xdb; BYTE $0x0c // PALIGNR $12, X11, X11
-#define shiftD3Left BYTE $0x66; BYTE $0x45; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xff; BYTE $0x0c // PALIGNR $12, X15, X15
-#define shiftB0Right BYTE $0x66; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xdb; BYTE $0x0c // PALIGNR $12, X3, X3
-#define shiftB1Right BYTE $0x66; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xe4; BYTE $0x0c // PALIGNR $12, X4, X4
-#define shiftB2Right BYTE $0x66; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xed; BYTE $0x0c // PALIGNR $12, X5, X5
-#define shiftB3Right BYTE $0x66; BYTE $0x45; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xed; BYTE $0x0c // PALIGNR $12, X13, X13
-#define shiftC0Right shiftC0Left
-#define shiftC1Right shiftC1Left
-#define shiftC2Right shiftC2Left
-#define shiftC3Right shiftC3Left
-#define shiftD0Right BYTE $0x66; BYTE $0x45; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xc9; BYTE $0x04 // PALIGNR $4, X9, X9
-#define shiftD1Right BYTE $0x66; BYTE $0x45; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xd2; BYTE $0x04 // PALIGNR $4, X10, X10
-#define shiftD2Right BYTE $0x66; BYTE $0x45; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xdb; BYTE $0x04 // PALIGNR $4, X11, X11
-#define shiftD3Right BYTE $0x66; BYTE $0x45; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xff; BYTE $0x04 // PALIGNR $4, X15, X15
-
-// Some macros
-
-// ROL rotates the uint32s in register R left by N bits, using temporary T.
-#define ROL(N, R, T) \
- MOVO R, T; PSLLL $(N), T; PSRLL $(32-(N)), R; PXOR T, R
-
-// ROL16 rotates the uint32s in register R left by 16, using temporary T if needed.
-#ifdef GOAMD64_v2
-#define ROL16(R, T) PSHUFB ·rol16<>(SB), R
-#else
-#define ROL16(R, T) ROL(16, R, T)
-#endif
-
-// ROL8 rotates the uint32s in register R left by 8, using temporary T if needed.
-#ifdef GOAMD64_v2
-#define ROL8(R, T) PSHUFB ·rol8<>(SB), R
-#else
-#define ROL8(R, T) ROL(8, R, T)
-#endif
-
-#define chachaQR(A, B, C, D, T) \
- PADDD B, A; PXOR A, D; ROL16(D, T) \
- PADDD D, C; PXOR C, B; MOVO B, T; PSLLL $12, T; PSRLL $20, B; PXOR T, B \
- PADDD B, A; PXOR A, D; ROL8(D, T) \
- PADDD D, C; PXOR C, B; MOVO B, T; PSLLL $7, T; PSRLL $25, B; PXOR T, B
-
-#define chachaQR_AVX2(A, B, C, D, T) \
- VPADDD B, A, A; VPXOR A, D, D; VPSHUFB ·rol16<>(SB), D, D \
- VPADDD D, C, C; VPXOR C, B, B; VPSLLD $12, B, T; VPSRLD $20, B, B; VPXOR T, B, B \
- VPADDD B, A, A; VPXOR A, D, D; VPSHUFB ·rol8<>(SB), D, D \
- VPADDD D, C, C; VPXOR C, B, B; VPSLLD $7, B, T; VPSRLD $25, B, B; VPXOR T, B, B
-
-#define polyAdd(S) ADDQ S, acc0; ADCQ 8+S, acc1; ADCQ $1, acc2
-#define polyMulStage1 MOVQ (0*8)(BP), AX; MOVQ AX, t2; MULQ acc0; MOVQ AX, t0; MOVQ DX, t1; MOVQ (0*8)(BP), AX; MULQ acc1; IMULQ acc2, t2; ADDQ AX, t1; ADCQ DX, t2
-#define polyMulStage2 MOVQ (1*8)(BP), AX; MOVQ AX, t3; MULQ acc0; ADDQ AX, t1; ADCQ $0, DX; MOVQ DX, acc0; MOVQ (1*8)(BP), AX; MULQ acc1; ADDQ AX, t2; ADCQ $0, DX
-#define polyMulStage3 IMULQ acc2, t3; ADDQ acc0, t2; ADCQ DX, t3
-#define polyMulReduceStage MOVQ t0, acc0; MOVQ t1, acc1; MOVQ t2, acc2; ANDQ $3, acc2; MOVQ t2, t0; ANDQ $-4, t0; MOVQ t3, t1; SHRQ $2, t3, t2; SHRQ $2, t3; ADDQ t0, acc0; ADCQ t1, acc1; ADCQ $0, acc2; ADDQ t2, acc0; ADCQ t3, acc1; ADCQ $0, acc2
-
-#define polyMulStage1_AVX2 MOVQ (0*8)(BP), DX; MOVQ DX, t2; MULXQ acc0, t0, t1; IMULQ acc2, t2; MULXQ acc1, AX, DX; ADDQ AX, t1; ADCQ DX, t2
-#define polyMulStage2_AVX2 MOVQ (1*8)(BP), DX; MULXQ acc0, acc0, AX; ADDQ acc0, t1; MULXQ acc1, acc1, t3; ADCQ acc1, t2; ADCQ $0, t3
-#define polyMulStage3_AVX2 IMULQ acc2, DX; ADDQ AX, t2; ADCQ DX, t3
-
-#define polyMul polyMulStage1; polyMulStage2; polyMulStage3; polyMulReduceStage
-#define polyMulAVX2 polyMulStage1_AVX2; polyMulStage2_AVX2; polyMulStage3_AVX2; polyMulReduceStage
-// ----------------------------------------------------------------------------
+
+// func polyHashADInternal<>()
TEXT polyHashADInternal<>(SB), NOSPLIT, $0
- // adp points to beginning of additional data
- // itr2 holds ad length
- XORQ acc0, acc0
- XORQ acc1, acc1
- XORQ acc2, acc2
- CMPQ itr2, $13
- JNE hashADLoop
-
-openFastTLSAD:
- // Special treatment for the TLS case of 13 bytes
- MOVQ (adp), acc0
- MOVQ 5(adp), acc1
- SHRQ $24, acc1
- MOVQ $1, acc2
- polyMul
+ // Hack: Must declare #define macros inside of a function due to Avo constraints
+ // ROL rotates the uint32s in register R left by N bits, using temporary T.
+ #define ROL(N, R, T) \
+ MOVO R, T; \
+ PSLLL $(N), T; \
+ PSRLL $(32-(N)), R; \
+ PXOR T, R
+
+ // ROL8 rotates the uint32s in register R left by 8, using temporary T if needed.
+ #ifdef GOAMD64_v2
+ #define ROL8(R, T) PSHUFB ·rol8<>(SB), R
+ #else
+ #define ROL8(R, T) ROL(8, R, T)
+ #endif
+
+ // ROL16 rotates the uint32s in register R left by 16, using temporary T if needed.
+ #ifdef GOAMD64_v2
+ #define ROL16(R, T) PSHUFB ·rol16<>(SB), R
+ #else
+ #define ROL16(R, T) ROL(16, R, T)
+ #endif
+ XORQ R10, R10
+ XORQ R11, R11
+ XORQ R12, R12
+ CMPQ R9, $0x0d
+ JNE hashADLoop
+ MOVQ (CX), R10
+ MOVQ 5(CX), R11
+ SHRQ $0x18, R11
+ MOVQ $0x00000001, R12
+ MOVQ (BP), AX
+ MOVQ AX, R15
+ MULQ R10
+ MOVQ AX, R13
+ MOVQ DX, R14
+ MOVQ (BP), AX
+ MULQ R11
+ IMULQ R12, R15
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), AX
+ MOVQ AX, R8
+ MULQ R10
+ ADDQ AX, R14
+ ADCQ $0x00, DX
+ MOVQ DX, R10
+ MOVQ 8(BP), AX
+ MULQ R11
+ ADDQ AX, R15
+ ADCQ $0x00, DX
+ IMULQ R12, R8
+ ADDQ R10, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
RET
hashADLoop:
// Hash in 16 byte chunks
- CMPQ itr2, $16
- JB hashADTail
- polyAdd(0(adp))
- LEAQ (1*16)(adp), adp
- SUBQ $16, itr2
- polyMul
- JMP hashADLoop
+ CMPQ R9, $0x10
+ JB hashADTail
+ ADDQ (CX), R10
+ ADCQ 8(CX), R11
+ ADCQ $0x01, R12
+ LEAQ 16(CX), CX
+ SUBQ $0x10, R9
+ MOVQ (BP), AX
+ MOVQ AX, R15
+ MULQ R10
+ MOVQ AX, R13
+ MOVQ DX, R14
+ MOVQ (BP), AX
+ MULQ R11
+ IMULQ R12, R15
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), AX
+ MOVQ AX, R8
+ MULQ R10
+ ADDQ AX, R14
+ ADCQ $0x00, DX
+ MOVQ DX, R10
+ MOVQ 8(BP), AX
+ MULQ R11
+ ADDQ AX, R15
+ ADCQ $0x00, DX
+ IMULQ R12, R8
+ ADDQ R10, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ JMP hashADLoop
hashADTail:
- CMPQ itr2, $0
+ CMPQ R9, $0x00
JE hashADDone
// Hash last < 16 byte tail
- XORQ t0, t0
- XORQ t1, t1
- XORQ t2, t2
- ADDQ itr2, adp
+ XORQ R13, R13
+ XORQ R14, R14
+ XORQ R15, R15
+ ADDQ R9, CX
hashADTailLoop:
- SHLQ $8, t0, t1
- SHLQ $8, t0
- MOVB -1(adp), t2
- XORQ t2, t0
- DECQ adp
- DECQ itr2
- JNE hashADTailLoop
-
-hashADTailFinish:
- ADDQ t0, acc0; ADCQ t1, acc1; ADCQ $1, acc2
- polyMul
-
- // Finished AD
+ SHLQ $0x08, R13, R14
+ SHLQ $0x08, R13
+ MOVB -1(CX), R15
+ XORQ R15, R13
+ DECQ CX
+ DECQ R9
+ JNE hashADTailLoop
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x01, R12
+ MOVQ (BP), AX
+ MOVQ AX, R15
+ MULQ R10
+ MOVQ AX, R13
+ MOVQ DX, R14
+ MOVQ (BP), AX
+ MULQ R11
+ IMULQ R12, R15
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), AX
+ MOVQ AX, R8
+ MULQ R10
+ ADDQ AX, R14
+ ADCQ $0x00, DX
+ MOVQ DX, R10
+ MOVQ 8(BP), AX
+ MULQ R11
+ ADDQ AX, R15
+ ADCQ $0x00, DX
+ IMULQ R12, R8
+ ADDQ R10, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+
hashADDone:
RET
-// ----------------------------------------------------------------------------
-// func chacha20Poly1305Open(dst, key, src, ad []byte) bool
-TEXT ·chacha20Poly1305Open(SB), 0, $288-97
+// func chacha20Poly1305Open(dst []byte, key []uint32, src []byte, ad []byte) bool
+// Requires: AVX, AVX2, BMI2, CMOV, SSE2
+TEXT ·chacha20Poly1305Open(SB), $288-97
// For aligned stack access
MOVQ SP, BP
- ADDQ $32, BP
+ ADDQ $0x20, BP
ANDQ $-32, BP
- MOVQ dst+0(FP), oup
- MOVQ key+24(FP), keyp
- MOVQ src+48(FP), inp
- MOVQ src_len+56(FP), inl
- MOVQ ad+72(FP), adp
+ MOVQ dst_base+0(FP), DI
+ MOVQ key_base+24(FP), R8
+ MOVQ src_base+48(FP), SI
+ MOVQ src_len+56(FP), BX
+ MOVQ ad_base+72(FP), CX
// Check for AVX2 support
- CMPB ·useAVX2(SB), $1
+ CMPB ·useAVX2+0(SB), $0x01
JE chacha20Poly1305Open_AVX2
// Special optimization, for very short buffers
- CMPQ inl, $128
- JBE openSSE128 // About 16% faster
+ CMPQ BX, $0x80
+ JBE openSSE128
// For long buffers, prepare the poly key first
- MOVOU ·chacha20Constants<>(SB), A0
- MOVOU (1*16)(keyp), B0
- MOVOU (2*16)(keyp), C0
- MOVOU (3*16)(keyp), D0
- MOVO D0, T1
+ MOVOU ·chacha20Constants<>+0(SB), X0
+ MOVOU 16(R8), X3
+ MOVOU 32(R8), X6
+ MOVOU 48(R8), X9
+ MOVO X9, X13
// Store state on stack for future use
- MOVO B0, state1Store
- MOVO C0, state2Store
- MOVO D0, ctr3Store
- MOVQ $10, itr2
+ MOVO X3, 32(BP)
+ MOVO X6, 48(BP)
+ MOVO X9, 128(BP)
+ MOVQ $0x0000000a, R9
openSSEPreparePolyKey:
- chachaQR(A0, B0, C0, D0, T0)
- shiftB0Left; shiftC0Left; shiftD0Left
- chachaQR(A0, B0, C0, D0, T0)
- shiftB0Right; shiftC0Right; shiftD0Right
- DECQ itr2
- JNE openSSEPreparePolyKey
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL16(X9, X12)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X12
+ PSLLL $0x0c, X12
+ PSRLL $0x14, X3
+ PXOR X12, X3
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL8(X9, X12)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X12
+ PSLLL $0x07, X12
+ PSRLL $0x19, X3
+ PXOR X12, X3
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xdb
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xf6
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xc9
+ BYTE $0x0c
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL16(X9, X12)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X12
+ PSLLL $0x0c, X12
+ PSRLL $0x14, X3
+ PXOR X12, X3
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL8(X9, X12)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X12
+ PSLLL $0x07, X12
+ PSRLL $0x19, X3
+ PXOR X12, X3
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xdb
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xf6
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xc9
+ BYTE $0x04
+ DECQ R9
+ JNE openSSEPreparePolyKey
// A0|B0 hold the Poly1305 32-byte key, C0,D0 can be discarded
- PADDL ·chacha20Constants<>(SB), A0; PADDL state1Store, B0
+ PADDL ·chacha20Constants<>+0(SB), X0
+ PADDL 32(BP), X3
// Clamp and store the key
- PAND ·polyClampMask<>(SB), A0
- MOVO A0, rStore; MOVO B0, sStore
+ PAND ·polyClampMask<>+0(SB), X0
+ MOVO X0, (BP)
+ MOVO X3, 16(BP)
// Hash AAD
- MOVQ ad_len+80(FP), itr2
+ MOVQ ad_len+80(FP), R9
CALL polyHashADInternal<>(SB)
openSSEMainLoop:
- CMPQ inl, $256
+ CMPQ BX, $0x00000100
JB openSSEMainLoopDone
// Load state, increment counter blocks
- MOVO ·chacha20Constants<>(SB), A0; MOVO state1Store, B0; MOVO state2Store, C0; MOVO ctr3Store, D0; PADDL ·sseIncMask<>(SB), D0
- MOVO A0, A1; MOVO B0, B1; MOVO C0, C1; MOVO D0, D1; PADDL ·sseIncMask<>(SB), D1
- MOVO A1, A2; MOVO B1, B2; MOVO C1, C2; MOVO D1, D2; PADDL ·sseIncMask<>(SB), D2
- MOVO A2, A3; MOVO B2, B3; MOVO C2, C3; MOVO D2, D3; PADDL ·sseIncMask<>(SB), D3
+ MOVO ·chacha20Constants<>+0(SB), X0
+ MOVO 32(BP), X3
+ MOVO 48(BP), X6
+ MOVO 128(BP), X9
+ PADDL ·sseIncMask<>+0(SB), X9
+ MOVO X0, X1
+ MOVO X3, X4
+ MOVO X6, X7
+ MOVO X9, X10
+ PADDL ·sseIncMask<>+0(SB), X10
+ MOVO X1, X2
+ MOVO X4, X5
+ MOVO X7, X8
+ MOVO X10, X11
+ PADDL ·sseIncMask<>+0(SB), X11
+ MOVO X2, X12
+ MOVO X5, X13
+ MOVO X8, X14
+ MOVO X11, X15
+ PADDL ·sseIncMask<>+0(SB), X15
// Store counters
- MOVO D0, ctr0Store; MOVO D1, ctr1Store; MOVO D2, ctr2Store; MOVO D3, ctr3Store
+ MOVO X9, 80(BP)
+ MOVO X10, 96(BP)
+ MOVO X11, 112(BP)
+ MOVO X15, 128(BP)
- // There are 10 ChaCha20 iterations of 2QR each, so for 6 iterations we hash 2 blocks, and for the remaining 4 only 1 block - for a total of 16
- MOVQ $4, itr1
- MOVQ inp, itr2
+ // There are 10 ChaCha20 iterations of 2QR each, so for 6 iterations we hash
+ // 2 blocks, and for the remaining 4 only 1 block - for a total of 16
+ MOVQ $0x00000004, CX
+ MOVQ SI, R9
openSSEInternalLoop:
- MOVO C3, tmpStore
- chachaQR(A0, B0, C0, D0, C3); chachaQR(A1, B1, C1, D1, C3); chachaQR(A2, B2, C2, D2, C3)
- MOVO tmpStore, C3
- MOVO C1, tmpStore
- chachaQR(A3, B3, C3, D3, C1)
- MOVO tmpStore, C1
- polyAdd(0(itr2))
- shiftB0Left; shiftB1Left; shiftB2Left; shiftB3Left
- shiftC0Left; shiftC1Left; shiftC2Left; shiftC3Left
- shiftD0Left; shiftD1Left; shiftD2Left; shiftD3Left
- polyMulStage1
- polyMulStage2
- LEAQ (2*8)(itr2), itr2
- MOVO C3, tmpStore
- chachaQR(A0, B0, C0, D0, C3); chachaQR(A1, B1, C1, D1, C3); chachaQR(A2, B2, C2, D2, C3)
- MOVO tmpStore, C3
- MOVO C1, tmpStore
- polyMulStage3
- chachaQR(A3, B3, C3, D3, C1)
- MOVO tmpStore, C1
- polyMulReduceStage
- shiftB0Right; shiftB1Right; shiftB2Right; shiftB3Right
- shiftC0Right; shiftC1Right; shiftC2Right; shiftC3Right
- shiftD0Right; shiftD1Right; shiftD2Right; shiftD3Right
- DECQ itr1
- JGE openSSEInternalLoop
-
- polyAdd(0(itr2))
- polyMul
- LEAQ (2*8)(itr2), itr2
-
- CMPQ itr1, $-6
- JG openSSEInternalLoop
+ MOVO X14, 64(BP)
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL16(X9, X14)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X14
+ PSLLL $0x0c, X14
+ PSRLL $0x14, X3
+ PXOR X14, X3
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL8(X9, X14)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X14
+ PSLLL $0x07, X14
+ PSRLL $0x19, X3
+ PXOR X14, X3
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL16(X10, X14)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X14
+ PSLLL $0x0c, X14
+ PSRLL $0x14, X4
+ PXOR X14, X4
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL8(X10, X14)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X14
+ PSLLL $0x07, X14
+ PSRLL $0x19, X4
+ PXOR X14, X4
+ PADDD X5, X2
+ PXOR X2, X11
+ ROL16(X11, X14)
+ PADDD X11, X8
+ PXOR X8, X5
+ MOVO X5, X14
+ PSLLL $0x0c, X14
+ PSRLL $0x14, X5
+ PXOR X14, X5
+ PADDD X5, X2
+ PXOR X2, X11
+ ROL8(X11, X14)
+ PADDD X11, X8
+ PXOR X8, X5
+ MOVO X5, X14
+ PSLLL $0x07, X14
+ PSRLL $0x19, X5
+ PXOR X14, X5
+ MOVO 64(BP), X14
+ MOVO X7, 64(BP)
+ PADDD X13, X12
+ PXOR X12, X15
+ ROL16(X15, X7)
+ PADDD X15, X14
+ PXOR X14, X13
+ MOVO X13, X7
+ PSLLL $0x0c, X7
+ PSRLL $0x14, X13
+ PXOR X7, X13
+ PADDD X13, X12
+ PXOR X12, X15
+ ROL8(X15, X7)
+ PADDD X15, X14
+ PXOR X14, X13
+ MOVO X13, X7
+ PSLLL $0x07, X7
+ PSRLL $0x19, X13
+ PXOR X7, X13
+ MOVO 64(BP), X7
+ ADDQ (R9), R10
+ ADCQ 8(R9), R11
+ ADCQ $0x01, R12
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xdb
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xe4
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xed
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xed
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xf6
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xff
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xc0
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xf6
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xc9
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xd2
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xdb
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xff
+ BYTE $0x0c
+ MOVQ (BP), AX
+ MOVQ AX, R15
+ MULQ R10
+ MOVQ AX, R13
+ MOVQ DX, R14
+ MOVQ (BP), AX
+ MULQ R11
+ IMULQ R12, R15
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), AX
+ MOVQ AX, R8
+ MULQ R10
+ ADDQ AX, R14
+ ADCQ $0x00, DX
+ MOVQ DX, R10
+ MOVQ 8(BP), AX
+ MULQ R11
+ ADDQ AX, R15
+ ADCQ $0x00, DX
+ LEAQ 16(R9), R9
+ MOVO X14, 64(BP)
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL16(X9, X14)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X14
+ PSLLL $0x0c, X14
+ PSRLL $0x14, X3
+ PXOR X14, X3
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL8(X9, X14)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X14
+ PSLLL $0x07, X14
+ PSRLL $0x19, X3
+ PXOR X14, X3
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL16(X10, X14)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X14
+ PSLLL $0x0c, X14
+ PSRLL $0x14, X4
+ PXOR X14, X4
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL8(X10, X14)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X14
+ PSLLL $0x07, X14
+ PSRLL $0x19, X4
+ PXOR X14, X4
+ PADDD X5, X2
+ PXOR X2, X11
+ ROL16(X11, X14)
+ PADDD X11, X8
+ PXOR X8, X5
+ MOVO X5, X14
+ PSLLL $0x0c, X14
+ PSRLL $0x14, X5
+ PXOR X14, X5
+ PADDD X5, X2
+ PXOR X2, X11
+ ROL8(X11, X14)
+ PADDD X11, X8
+ PXOR X8, X5
+ MOVO X5, X14
+ PSLLL $0x07, X14
+ PSRLL $0x19, X5
+ PXOR X14, X5
+ MOVO 64(BP), X14
+ MOVO X7, 64(BP)
+ IMULQ R12, R8
+ ADDQ R10, R15
+ ADCQ DX, R8
+ PADDD X13, X12
+ PXOR X12, X15
+ ROL16(X15, X7)
+ PADDD X15, X14
+ PXOR X14, X13
+ MOVO X13, X7
+ PSLLL $0x0c, X7
+ PSRLL $0x14, X13
+ PXOR X7, X13
+ PADDD X13, X12
+ PXOR X12, X15
+ ROL8(X15, X7)
+ PADDD X15, X14
+ PXOR X14, X13
+ MOVO X13, X7
+ PSLLL $0x07, X7
+ PSRLL $0x19, X13
+ PXOR X7, X13
+ MOVO 64(BP), X7
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xdb
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xe4
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xed
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xed
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xf6
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xff
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xc0
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xf6
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xc9
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xd2
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xdb
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xff
+ BYTE $0x04
+ DECQ CX
+ JGE openSSEInternalLoop
+ ADDQ (R9), R10
+ ADCQ 8(R9), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), AX
+ MOVQ AX, R15
+ MULQ R10
+ MOVQ AX, R13
+ MOVQ DX, R14
+ MOVQ (BP), AX
+ MULQ R11
+ IMULQ R12, R15
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), AX
+ MOVQ AX, R8
+ MULQ R10
+ ADDQ AX, R14
+ ADCQ $0x00, DX
+ MOVQ DX, R10
+ MOVQ 8(BP), AX
+ MULQ R11
+ ADDQ AX, R15
+ ADCQ $0x00, DX
+ IMULQ R12, R8
+ ADDQ R10, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ LEAQ 16(R9), R9
+ CMPQ CX, $-6
+ JG openSSEInternalLoop
// Add in the state
- PADDD ·chacha20Constants<>(SB), A0; PADDD ·chacha20Constants<>(SB), A1; PADDD ·chacha20Constants<>(SB), A2; PADDD ·chacha20Constants<>(SB), A3
- PADDD state1Store, B0; PADDD state1Store, B1; PADDD state1Store, B2; PADDD state1Store, B3
- PADDD state2Store, C0; PADDD state2Store, C1; PADDD state2Store, C2; PADDD state2Store, C3
- PADDD ctr0Store, D0; PADDD ctr1Store, D1; PADDD ctr2Store, D2; PADDD ctr3Store, D3
+ PADDD ·chacha20Constants<>+0(SB), X0
+ PADDD ·chacha20Constants<>+0(SB), X1
+ PADDD ·chacha20Constants<>+0(SB), X2
+ PADDD ·chacha20Constants<>+0(SB), X12
+ PADDD 32(BP), X3
+ PADDD 32(BP), X4
+ PADDD 32(BP), X5
+ PADDD 32(BP), X13
+ PADDD 48(BP), X6
+ PADDD 48(BP), X7
+ PADDD 48(BP), X8
+ PADDD 48(BP), X14
+ PADDD 80(BP), X9
+ PADDD 96(BP), X10
+ PADDD 112(BP), X11
+ PADDD 128(BP), X15
// Load - xor - store
- MOVO D3, tmpStore
- MOVOU (0*16)(inp), D3; PXOR D3, A0; MOVOU A0, (0*16)(oup)
- MOVOU (1*16)(inp), D3; PXOR D3, B0; MOVOU B0, (1*16)(oup)
- MOVOU (2*16)(inp), D3; PXOR D3, C0; MOVOU C0, (2*16)(oup)
- MOVOU (3*16)(inp), D3; PXOR D3, D0; MOVOU D0, (3*16)(oup)
- MOVOU (4*16)(inp), D0; PXOR D0, A1; MOVOU A1, (4*16)(oup)
- MOVOU (5*16)(inp), D0; PXOR D0, B1; MOVOU B1, (5*16)(oup)
- MOVOU (6*16)(inp), D0; PXOR D0, C1; MOVOU C1, (6*16)(oup)
- MOVOU (7*16)(inp), D0; PXOR D0, D1; MOVOU D1, (7*16)(oup)
- MOVOU (8*16)(inp), D0; PXOR D0, A2; MOVOU A2, (8*16)(oup)
- MOVOU (9*16)(inp), D0; PXOR D0, B2; MOVOU B2, (9*16)(oup)
- MOVOU (10*16)(inp), D0; PXOR D0, C2; MOVOU C2, (10*16)(oup)
- MOVOU (11*16)(inp), D0; PXOR D0, D2; MOVOU D2, (11*16)(oup)
- MOVOU (12*16)(inp), D0; PXOR D0, A3; MOVOU A3, (12*16)(oup)
- MOVOU (13*16)(inp), D0; PXOR D0, B3; MOVOU B3, (13*16)(oup)
- MOVOU (14*16)(inp), D0; PXOR D0, C3; MOVOU C3, (14*16)(oup)
- MOVOU (15*16)(inp), D0; PXOR tmpStore, D0; MOVOU D0, (15*16)(oup)
- LEAQ 256(inp), inp
- LEAQ 256(oup), oup
- SUBQ $256, inl
+ MOVO X15, 64(BP)
+ MOVOU (SI), X15
+ PXOR X15, X0
+ MOVOU X0, (DI)
+ MOVOU 16(SI), X15
+ PXOR X15, X3
+ MOVOU X3, 16(DI)
+ MOVOU 32(SI), X15
+ PXOR X15, X6
+ MOVOU X6, 32(DI)
+ MOVOU 48(SI), X15
+ PXOR X15, X9
+ MOVOU X9, 48(DI)
+ MOVOU 64(SI), X9
+ PXOR X9, X1
+ MOVOU X1, 64(DI)
+ MOVOU 80(SI), X9
+ PXOR X9, X4
+ MOVOU X4, 80(DI)
+ MOVOU 96(SI), X9
+ PXOR X9, X7
+ MOVOU X7, 96(DI)
+ MOVOU 112(SI), X9
+ PXOR X9, X10
+ MOVOU X10, 112(DI)
+ MOVOU 128(SI), X9
+ PXOR X9, X2
+ MOVOU X2, 128(DI)
+ MOVOU 144(SI), X9
+ PXOR X9, X5
+ MOVOU X5, 144(DI)
+ MOVOU 160(SI), X9
+ PXOR X9, X8
+ MOVOU X8, 160(DI)
+ MOVOU 176(SI), X9
+ PXOR X9, X11
+ MOVOU X11, 176(DI)
+ MOVOU 192(SI), X9
+ PXOR X9, X12
+ MOVOU X12, 192(DI)
+ MOVOU 208(SI), X9
+ PXOR X9, X13
+ MOVOU X13, 208(DI)
+ MOVOU 224(SI), X9
+ PXOR X9, X14
+ MOVOU X14, 224(DI)
+ MOVOU 240(SI), X9
+ PXOR 64(BP), X9
+ MOVOU X9, 240(DI)
+ LEAQ 256(SI), SI
+ LEAQ 256(DI), DI
+ SUBQ $0x00000100, BX
JMP openSSEMainLoop
openSSEMainLoopDone:
// Handle the various tail sizes efficiently
- TESTQ inl, inl
+ TESTQ BX, BX
JE openSSEFinalize
- CMPQ inl, $64
+ CMPQ BX, $0x40
JBE openSSETail64
- CMPQ inl, $128
+ CMPQ BX, $0x80
JBE openSSETail128
- CMPQ inl, $192
+ CMPQ BX, $0xc0
JBE openSSETail192
JMP openSSETail256
openSSEFinalize:
// Hash in the PT, AAD lengths
- ADDQ ad_len+80(FP), acc0; ADCQ src_len+56(FP), acc1; ADCQ $1, acc2
- polyMul
+ ADDQ ad_len+80(FP), R10
+ ADCQ src_len+56(FP), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), AX
+ MOVQ AX, R15
+ MULQ R10
+ MOVQ AX, R13
+ MOVQ DX, R14
+ MOVQ (BP), AX
+ MULQ R11
+ IMULQ R12, R15
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), AX
+ MOVQ AX, R8
+ MULQ R10
+ ADDQ AX, R14
+ ADCQ $0x00, DX
+ MOVQ DX, R10
+ MOVQ 8(BP), AX
+ MULQ R11
+ ADDQ AX, R15
+ ADCQ $0x00, DX
+ IMULQ R12, R8
+ ADDQ R10, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
// Final reduce
- MOVQ acc0, t0
- MOVQ acc1, t1
- MOVQ acc2, t2
- SUBQ $-5, acc0
- SBBQ $-1, acc1
- SBBQ $3, acc2
- CMOVQCS t0, acc0
- CMOVQCS t1, acc1
- CMOVQCS t2, acc2
+ MOVQ R10, R13
+ MOVQ R11, R14
+ MOVQ R12, R15
+ SUBQ $-5, R10
+ SBBQ $-1, R11
+ SBBQ $0x03, R12
+ CMOVQCS R13, R10
+ CMOVQCS R14, R11
+ CMOVQCS R15, R12
// Add in the "s" part of the key
- ADDQ 0+sStore, acc0
- ADCQ 8+sStore, acc1
+ ADDQ 16(BP), R10
+ ADCQ 24(BP), R11
// Finally, constant time compare to the tag at the end of the message
XORQ AX, AX
- MOVQ $1, DX
- XORQ (0*8)(inp), acc0
- XORQ (1*8)(inp), acc1
- ORQ acc1, acc0
+ MOVQ $0x00000001, DX
+ XORQ (SI), R10
+ XORQ 8(SI), R11
+ ORQ R11, R10
CMOVQEQ DX, AX
// Return true iff tags are equal
MOVB AX, ret+96(FP)
RET
-// ----------------------------------------------------------------------------
-// Special optimization for buffers smaller than 129 bytes
openSSE128:
- // For up to 128 bytes of ciphertext and 64 bytes for the poly key, we require to process three blocks
- MOVOU ·chacha20Constants<>(SB), A0; MOVOU (1*16)(keyp), B0; MOVOU (2*16)(keyp), C0; MOVOU (3*16)(keyp), D0
- MOVO A0, A1; MOVO B0, B1; MOVO C0, C1; MOVO D0, D1; PADDL ·sseIncMask<>(SB), D1
- MOVO A1, A2; MOVO B1, B2; MOVO C1, C2; MOVO D1, D2; PADDL ·sseIncMask<>(SB), D2
- MOVO B0, T1; MOVO C0, T2; MOVO D1, T3
- MOVQ $10, itr2
+ MOVOU ·chacha20Constants<>+0(SB), X0
+ MOVOU 16(R8), X3
+ MOVOU 32(R8), X6
+ MOVOU 48(R8), X9
+ MOVO X0, X1
+ MOVO X3, X4
+ MOVO X6, X7
+ MOVO X9, X10
+ PADDL ·sseIncMask<>+0(SB), X10
+ MOVO X1, X2
+ MOVO X4, X5
+ MOVO X7, X8
+ MOVO X10, X11
+ PADDL ·sseIncMask<>+0(SB), X11
+ MOVO X3, X13
+ MOVO X6, X14
+ MOVO X10, X15
+ MOVQ $0x0000000a, R9
openSSE128InnerCipherLoop:
- chachaQR(A0, B0, C0, D0, T0); chachaQR(A1, B1, C1, D1, T0); chachaQR(A2, B2, C2, D2, T0)
- shiftB0Left; shiftB1Left; shiftB2Left
- shiftC0Left; shiftC1Left; shiftC2Left
- shiftD0Left; shiftD1Left; shiftD2Left
- chachaQR(A0, B0, C0, D0, T0); chachaQR(A1, B1, C1, D1, T0); chachaQR(A2, B2, C2, D2, T0)
- shiftB0Right; shiftB1Right; shiftB2Right
- shiftC0Right; shiftC1Right; shiftC2Right
- shiftD0Right; shiftD1Right; shiftD2Right
- DECQ itr2
- JNE openSSE128InnerCipherLoop
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL16(X9, X12)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X12
+ PSLLL $0x0c, X12
+ PSRLL $0x14, X3
+ PXOR X12, X3
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL8(X9, X12)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X12
+ PSLLL $0x07, X12
+ PSRLL $0x19, X3
+ PXOR X12, X3
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL16(X10, X12)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X12
+ PSLLL $0x0c, X12
+ PSRLL $0x14, X4
+ PXOR X12, X4
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL8(X10, X12)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X12
+ PSLLL $0x07, X12
+ PSRLL $0x19, X4
+ PXOR X12, X4
+ PADDD X5, X2
+ PXOR X2, X11
+ ROL16(X11, X12)
+ PADDD X11, X8
+ PXOR X8, X5
+ MOVO X5, X12
+ PSLLL $0x0c, X12
+ PSRLL $0x14, X5
+ PXOR X12, X5
+ PADDD X5, X2
+ PXOR X2, X11
+ ROL8(X11, X12)
+ PADDD X11, X8
+ PXOR X8, X5
+ MOVO X5, X12
+ PSLLL $0x07, X12
+ PSRLL $0x19, X5
+ PXOR X12, X5
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xdb
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xe4
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xed
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xf6
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xff
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xc0
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xc9
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xd2
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xdb
+ BYTE $0x0c
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL16(X9, X12)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X12
+ PSLLL $0x0c, X12
+ PSRLL $0x14, X3
+ PXOR X12, X3
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL8(X9, X12)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X12
+ PSLLL $0x07, X12
+ PSRLL $0x19, X3
+ PXOR X12, X3
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL16(X10, X12)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X12
+ PSLLL $0x0c, X12
+ PSRLL $0x14, X4
+ PXOR X12, X4
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL8(X10, X12)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X12
+ PSLLL $0x07, X12
+ PSRLL $0x19, X4
+ PXOR X12, X4
+ PADDD X5, X2
+ PXOR X2, X11
+ ROL16(X11, X12)
+ PADDD X11, X8
+ PXOR X8, X5
+ MOVO X5, X12
+ PSLLL $0x0c, X12
+ PSRLL $0x14, X5
+ PXOR X12, X5
+ PADDD X5, X2
+ PXOR X2, X11
+ ROL8(X11, X12)
+ PADDD X11, X8
+ PXOR X8, X5
+ MOVO X5, X12
+ PSLLL $0x07, X12
+ PSRLL $0x19, X5
+ PXOR X12, X5
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xdb
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xe4
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xed
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xf6
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xff
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xc0
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xc9
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xd2
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xdb
+ BYTE $0x04
+ DECQ R9
+ JNE openSSE128InnerCipherLoop
// A0|B0 hold the Poly1305 32-byte key, C0,D0 can be discarded
- PADDL ·chacha20Constants<>(SB), A0; PADDL ·chacha20Constants<>(SB), A1; PADDL ·chacha20Constants<>(SB), A2
- PADDL T1, B0; PADDL T1, B1; PADDL T1, B2
- PADDL T2, C1; PADDL T2, C2
- PADDL T3, D1; PADDL ·sseIncMask<>(SB), T3; PADDL T3, D2
+ PADDL ·chacha20Constants<>+0(SB), X0
+ PADDL ·chacha20Constants<>+0(SB), X1
+ PADDL ·chacha20Constants<>+0(SB), X2
+ PADDL X13, X3
+ PADDL X13, X4
+ PADDL X13, X5
+ PADDL X14, X7
+ PADDL X14, X8
+ PADDL X15, X10
+ PADDL ·sseIncMask<>+0(SB), X15
+ PADDL X15, X11
// Clamp and store the key
- PAND ·polyClampMask<>(SB), A0
- MOVOU A0, rStore; MOVOU B0, sStore
+ PAND ·polyClampMask<>+0(SB), X0
+ MOVOU X0, (BP)
+ MOVOU X3, 16(BP)
// Hash
- MOVQ ad_len+80(FP), itr2
+ MOVQ ad_len+80(FP), R9
CALL polyHashADInternal<>(SB)
openSSE128Open:
- CMPQ inl, $16
+ CMPQ BX, $0x10
JB openSSETail16
- SUBQ $16, inl
+ SUBQ $0x10, BX
// Load for hashing
- polyAdd(0(inp))
+ ADDQ (SI), R10
+ ADCQ 8(SI), R11
+ ADCQ $0x01, R12
// Load for decryption
- MOVOU (inp), T0; PXOR T0, A1; MOVOU A1, (oup)
- LEAQ (1*16)(inp), inp
- LEAQ (1*16)(oup), oup
- polyMul
+ MOVOU (SI), X12
+ PXOR X12, X1
+ MOVOU X1, (DI)
+ LEAQ 16(SI), SI
+ LEAQ 16(DI), DI
+ MOVQ (BP), AX
+ MOVQ AX, R15
+ MULQ R10
+ MOVQ AX, R13
+ MOVQ DX, R14
+ MOVQ (BP), AX
+ MULQ R11
+ IMULQ R12, R15
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), AX
+ MOVQ AX, R8
+ MULQ R10
+ ADDQ AX, R14
+ ADCQ $0x00, DX
+ MOVQ DX, R10
+ MOVQ 8(BP), AX
+ MULQ R11
+ ADDQ AX, R15
+ ADCQ $0x00, DX
+ IMULQ R12, R8
+ ADDQ R10, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
// Shift the stream "left"
- MOVO B1, A1
- MOVO C1, B1
- MOVO D1, C1
- MOVO A2, D1
- MOVO B2, A2
- MOVO C2, B2
- MOVO D2, C2
+ MOVO X4, X1
+ MOVO X7, X4
+ MOVO X10, X7
+ MOVO X2, X10
+ MOVO X5, X2
+ MOVO X8, X5
+ MOVO X11, X8
JMP openSSE128Open
openSSETail16:
- TESTQ inl, inl
+ TESTQ BX, BX
JE openSSEFinalize
// We can safely load the CT from the end, because it is padded with the MAC
- MOVQ inl, itr2
- SHLQ $4, itr2
- LEAQ ·andMask<>(SB), t0
- MOVOU (inp), T0
- ADDQ inl, inp
- PAND -16(t0)(itr2*1), T0
- MOVO T0, 0+tmpStore
- MOVQ T0, t0
- MOVQ 8+tmpStore, t1
- PXOR A1, T0
+ MOVQ BX, R9
+ SHLQ $0x04, R9
+ LEAQ ·andMask<>+0(SB), R13
+ MOVOU (SI), X12
+ ADDQ BX, SI
+ PAND -16(R13)(R9*1), X12
+ MOVO X12, 64(BP)
+ MOVQ X12, R13
+ MOVQ 72(BP), R14
+ PXOR X1, X12
// We can only store one byte at a time, since plaintext can be shorter than 16 bytes
openSSETail16Store:
- MOVQ T0, t3
- MOVB t3, (oup)
- PSRLDQ $1, T0
- INCQ oup
- DECQ inl
+ MOVQ X12, R8
+ MOVB R8, (DI)
+ PSRLDQ $0x01, X12
+ INCQ DI
+ DECQ BX
JNE openSSETail16Store
- ADDQ t0, acc0; ADCQ t1, acc1; ADCQ $1, acc2
- polyMul
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x01, R12
+ MOVQ (BP), AX
+ MOVQ AX, R15
+ MULQ R10
+ MOVQ AX, R13
+ MOVQ DX, R14
+ MOVQ (BP), AX
+ MULQ R11
+ IMULQ R12, R15
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), AX
+ MOVQ AX, R8
+ MULQ R10
+ ADDQ AX, R14
+ ADCQ $0x00, DX
+ MOVQ DX, R10
+ MOVQ 8(BP), AX
+ MULQ R11
+ ADDQ AX, R15
+ ADCQ $0x00, DX
+ IMULQ R12, R8
+ ADDQ R10, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
JMP openSSEFinalize
-// ----------------------------------------------------------------------------
-// Special optimization for the last 64 bytes of ciphertext
openSSETail64:
- // Need to decrypt up to 64 bytes - prepare single block
- MOVO ·chacha20Constants<>(SB), A0; MOVO state1Store, B0; MOVO state2Store, C0; MOVO ctr3Store, D0; PADDL ·sseIncMask<>(SB), D0; MOVO D0, ctr0Store
- XORQ itr2, itr2
- MOVQ inl, itr1
- CMPQ itr1, $16
- JB openSSETail64LoopB
+ MOVO ·chacha20Constants<>+0(SB), X0
+ MOVO 32(BP), X3
+ MOVO 48(BP), X6
+ MOVO 128(BP), X9
+ PADDL ·sseIncMask<>+0(SB), X9
+ MOVO X9, 80(BP)
+ XORQ R9, R9
+ MOVQ BX, CX
+ CMPQ CX, $0x10
+ JB openSSETail64LoopB
openSSETail64LoopA:
- // Perform ChaCha rounds, while hashing the remaining input
- polyAdd(0(inp)(itr2*1))
- polyMul
- SUBQ $16, itr1
+ ADDQ (SI)(R9*1), R10
+ ADCQ 8(SI)(R9*1), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), AX
+ MOVQ AX, R15
+ MULQ R10
+ MOVQ AX, R13
+ MOVQ DX, R14
+ MOVQ (BP), AX
+ MULQ R11
+ IMULQ R12, R15
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), AX
+ MOVQ AX, R8
+ MULQ R10
+ ADDQ AX, R14
+ ADCQ $0x00, DX
+ MOVQ DX, R10
+ MOVQ 8(BP), AX
+ MULQ R11
+ ADDQ AX, R15
+ ADCQ $0x00, DX
+ IMULQ R12, R8
+ ADDQ R10, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ SUBQ $0x10, CX
openSSETail64LoopB:
- ADDQ $16, itr2
- chachaQR(A0, B0, C0, D0, T0)
- shiftB0Left; shiftC0Left; shiftD0Left
- chachaQR(A0, B0, C0, D0, T0)
- shiftB0Right; shiftC0Right; shiftD0Right
-
- CMPQ itr1, $16
- JAE openSSETail64LoopA
-
- CMPQ itr2, $160
- JNE openSSETail64LoopB
-
- PADDL ·chacha20Constants<>(SB), A0; PADDL state1Store, B0; PADDL state2Store, C0; PADDL ctr0Store, D0
+ ADDQ $0x10, R9
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL16(X9, X12)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X12
+ PSLLL $0x0c, X12
+ PSRLL $0x14, X3
+ PXOR X12, X3
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL8(X9, X12)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X12
+ PSLLL $0x07, X12
+ PSRLL $0x19, X3
+ PXOR X12, X3
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xdb
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xf6
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xc9
+ BYTE $0x0c
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL16(X9, X12)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X12
+ PSLLL $0x0c, X12
+ PSRLL $0x14, X3
+ PXOR X12, X3
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL8(X9, X12)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X12
+ PSLLL $0x07, X12
+ PSRLL $0x19, X3
+ PXOR X12, X3
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xdb
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xf6
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xc9
+ BYTE $0x04
+ CMPQ CX, $0x10
+ JAE openSSETail64LoopA
+ CMPQ R9, $0xa0
+ JNE openSSETail64LoopB
+ PADDL ·chacha20Constants<>+0(SB), X0
+ PADDL 32(BP), X3
+ PADDL 48(BP), X6
+ PADDL 80(BP), X9
openSSETail64DecLoop:
- CMPQ inl, $16
+ CMPQ BX, $0x10
JB openSSETail64DecLoopDone
- SUBQ $16, inl
- MOVOU (inp), T0
- PXOR T0, A0
- MOVOU A0, (oup)
- LEAQ 16(inp), inp
- LEAQ 16(oup), oup
- MOVO B0, A0
- MOVO C0, B0
- MOVO D0, C0
+ SUBQ $0x10, BX
+ MOVOU (SI), X12
+ PXOR X12, X0
+ MOVOU X0, (DI)
+ LEAQ 16(SI), SI
+ LEAQ 16(DI), DI
+ MOVO X3, X0
+ MOVO X6, X3
+ MOVO X9, X6
JMP openSSETail64DecLoop
openSSETail64DecLoopDone:
- MOVO A0, A1
+ MOVO X0, X1
JMP openSSETail16
-// ----------------------------------------------------------------------------
-// Special optimization for the last 128 bytes of ciphertext
openSSETail128:
- // Need to decrypt up to 128 bytes - prepare two blocks
- MOVO ·chacha20Constants<>(SB), A1; MOVO state1Store, B1; MOVO state2Store, C1; MOVO ctr3Store, D1; PADDL ·sseIncMask<>(SB), D1; MOVO D1, ctr0Store
- MOVO A1, A0; MOVO B1, B0; MOVO C1, C0; MOVO D1, D0; PADDL ·sseIncMask<>(SB), D0; MOVO D0, ctr1Store
- XORQ itr2, itr2
- MOVQ inl, itr1
- ANDQ $-16, itr1
+ MOVO ·chacha20Constants<>+0(SB), X1
+ MOVO 32(BP), X4
+ MOVO 48(BP), X7
+ MOVO 128(BP), X10
+ PADDL ·sseIncMask<>+0(SB), X10
+ MOVO X10, 80(BP)
+ MOVO X1, X0
+ MOVO X4, X3
+ MOVO X7, X6
+ MOVO X10, X9
+ PADDL ·sseIncMask<>+0(SB), X9
+ MOVO X9, 96(BP)
+ XORQ R9, R9
+ MOVQ BX, CX
+ ANDQ $-16, CX
openSSETail128LoopA:
- // Perform ChaCha rounds, while hashing the remaining input
- polyAdd(0(inp)(itr2*1))
- polyMul
+ ADDQ (SI)(R9*1), R10
+ ADCQ 8(SI)(R9*1), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), AX
+ MOVQ AX, R15
+ MULQ R10
+ MOVQ AX, R13
+ MOVQ DX, R14
+ MOVQ (BP), AX
+ MULQ R11
+ IMULQ R12, R15
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), AX
+ MOVQ AX, R8
+ MULQ R10
+ ADDQ AX, R14
+ ADCQ $0x00, DX
+ MOVQ DX, R10
+ MOVQ 8(BP), AX
+ MULQ R11
+ ADDQ AX, R15
+ ADCQ $0x00, DX
+ IMULQ R12, R8
+ ADDQ R10, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
openSSETail128LoopB:
- ADDQ $16, itr2
- chachaQR(A0, B0, C0, D0, T0); chachaQR(A1, B1, C1, D1, T0)
- shiftB0Left; shiftC0Left; shiftD0Left
- shiftB1Left; shiftC1Left; shiftD1Left
- chachaQR(A0, B0, C0, D0, T0); chachaQR(A1, B1, C1, D1, T0)
- shiftB0Right; shiftC0Right; shiftD0Right
- shiftB1Right; shiftC1Right; shiftD1Right
-
- CMPQ itr2, itr1
- JB openSSETail128LoopA
-
- CMPQ itr2, $160
- JNE openSSETail128LoopB
-
- PADDL ·chacha20Constants<>(SB), A0; PADDL ·chacha20Constants<>(SB), A1
- PADDL state1Store, B0; PADDL state1Store, B1
- PADDL state2Store, C0; PADDL state2Store, C1
- PADDL ctr1Store, D0; PADDL ctr0Store, D1
-
- MOVOU (0*16)(inp), T0; MOVOU (1*16)(inp), T1; MOVOU (2*16)(inp), T2; MOVOU (3*16)(inp), T3
- PXOR T0, A1; PXOR T1, B1; PXOR T2, C1; PXOR T3, D1
- MOVOU A1, (0*16)(oup); MOVOU B1, (1*16)(oup); MOVOU C1, (2*16)(oup); MOVOU D1, (3*16)(oup)
-
- SUBQ $64, inl
- LEAQ 64(inp), inp
- LEAQ 64(oup), oup
- JMP openSSETail64DecLoop
-
-// ----------------------------------------------------------------------------
-// Special optimization for the last 192 bytes of ciphertext
+ ADDQ $0x10, R9
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL16(X9, X12)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X12
+ PSLLL $0x0c, X12
+ PSRLL $0x14, X3
+ PXOR X12, X3
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL8(X9, X12)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X12
+ PSLLL $0x07, X12
+ PSRLL $0x19, X3
+ PXOR X12, X3
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL16(X10, X12)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X12
+ PSLLL $0x0c, X12
+ PSRLL $0x14, X4
+ PXOR X12, X4
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL8(X10, X12)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X12
+ PSLLL $0x07, X12
+ PSRLL $0x19, X4
+ PXOR X12, X4
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xdb
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xf6
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xc9
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xe4
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xff
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xd2
+ BYTE $0x0c
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL16(X9, X12)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X12
+ PSLLL $0x0c, X12
+ PSRLL $0x14, X3
+ PXOR X12, X3
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL8(X9, X12)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X12
+ PSLLL $0x07, X12
+ PSRLL $0x19, X3
+ PXOR X12, X3
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL16(X10, X12)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X12
+ PSLLL $0x0c, X12
+ PSRLL $0x14, X4
+ PXOR X12, X4
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL8(X10, X12)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X12
+ PSLLL $0x07, X12
+ PSRLL $0x19, X4
+ PXOR X12, X4
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xdb
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xf6
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xc9
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xe4
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xff
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xd2
+ BYTE $0x04
+ CMPQ R9, CX
+ JB openSSETail128LoopA
+ CMPQ R9, $0xa0
+ JNE openSSETail128LoopB
+ PADDL ·chacha20Constants<>+0(SB), X0
+ PADDL ·chacha20Constants<>+0(SB), X1
+ PADDL 32(BP), X3
+ PADDL 32(BP), X4
+ PADDL 48(BP), X6
+ PADDL 48(BP), X7
+ PADDL 96(BP), X9
+ PADDL 80(BP), X10
+ MOVOU (SI), X12
+ MOVOU 16(SI), X13
+ MOVOU 32(SI), X14
+ MOVOU 48(SI), X15
+ PXOR X12, X1
+ PXOR X13, X4
+ PXOR X14, X7
+ PXOR X15, X10
+ MOVOU X1, (DI)
+ MOVOU X4, 16(DI)
+ MOVOU X7, 32(DI)
+ MOVOU X10, 48(DI)
+ SUBQ $0x40, BX
+ LEAQ 64(SI), SI
+ LEAQ 64(DI), DI
+ JMP openSSETail64DecLoop
+
openSSETail192:
- // Need to decrypt up to 192 bytes - prepare three blocks
- MOVO ·chacha20Constants<>(SB), A2; MOVO state1Store, B2; MOVO state2Store, C2; MOVO ctr3Store, D2; PADDL ·sseIncMask<>(SB), D2; MOVO D2, ctr0Store
- MOVO A2, A1; MOVO B2, B1; MOVO C2, C1; MOVO D2, D1; PADDL ·sseIncMask<>(SB), D1; MOVO D1, ctr1Store
- MOVO A1, A0; MOVO B1, B0; MOVO C1, C0; MOVO D1, D0; PADDL ·sseIncMask<>(SB), D0; MOVO D0, ctr2Store
-
- MOVQ inl, itr1
- MOVQ $160, itr2
- CMPQ itr1, $160
- CMOVQGT itr2, itr1
- ANDQ $-16, itr1
- XORQ itr2, itr2
+ MOVO ·chacha20Constants<>+0(SB), X2
+ MOVO 32(BP), X5
+ MOVO 48(BP), X8
+ MOVO 128(BP), X11
+ PADDL ·sseIncMask<>+0(SB), X11
+ MOVO X11, 80(BP)
+ MOVO X2, X1
+ MOVO X5, X4
+ MOVO X8, X7
+ MOVO X11, X10
+ PADDL ·sseIncMask<>+0(SB), X10
+ MOVO X10, 96(BP)
+ MOVO X1, X0
+ MOVO X4, X3
+ MOVO X7, X6
+ MOVO X10, X9
+ PADDL ·sseIncMask<>+0(SB), X9
+ MOVO X9, 112(BP)
+ MOVQ BX, CX
+ MOVQ $0x000000a0, R9
+ CMPQ CX, $0xa0
+ CMOVQGT R9, CX
+ ANDQ $-16, CX
+ XORQ R9, R9
openSSLTail192LoopA:
- // Perform ChaCha rounds, while hashing the remaining input
- polyAdd(0(inp)(itr2*1))
- polyMul
+ ADDQ (SI)(R9*1), R10
+ ADCQ 8(SI)(R9*1), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), AX
+ MOVQ AX, R15
+ MULQ R10
+ MOVQ AX, R13
+ MOVQ DX, R14
+ MOVQ (BP), AX
+ MULQ R11
+ IMULQ R12, R15
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), AX
+ MOVQ AX, R8
+ MULQ R10
+ ADDQ AX, R14
+ ADCQ $0x00, DX
+ MOVQ DX, R10
+ MOVQ 8(BP), AX
+ MULQ R11
+ ADDQ AX, R15
+ ADCQ $0x00, DX
+ IMULQ R12, R8
+ ADDQ R10, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
openSSLTail192LoopB:
- ADDQ $16, itr2
- chachaQR(A0, B0, C0, D0, T0); chachaQR(A1, B1, C1, D1, T0); chachaQR(A2, B2, C2, D2, T0)
- shiftB0Left; shiftC0Left; shiftD0Left
- shiftB1Left; shiftC1Left; shiftD1Left
- shiftB2Left; shiftC2Left; shiftD2Left
-
- chachaQR(A0, B0, C0, D0, T0); chachaQR(A1, B1, C1, D1, T0); chachaQR(A2, B2, C2, D2, T0)
- shiftB0Right; shiftC0Right; shiftD0Right
- shiftB1Right; shiftC1Right; shiftD1Right
- shiftB2Right; shiftC2Right; shiftD2Right
-
- CMPQ itr2, itr1
- JB openSSLTail192LoopA
-
- CMPQ itr2, $160
- JNE openSSLTail192LoopB
-
- CMPQ inl, $176
- JB openSSLTail192Store
-
- polyAdd(160(inp))
- polyMul
-
- CMPQ inl, $192
- JB openSSLTail192Store
-
- polyAdd(176(inp))
- polyMul
+ ADDQ $0x10, R9
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL16(X9, X12)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X12
+ PSLLL $0x0c, X12
+ PSRLL $0x14, X3
+ PXOR X12, X3
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL8(X9, X12)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X12
+ PSLLL $0x07, X12
+ PSRLL $0x19, X3
+ PXOR X12, X3
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL16(X10, X12)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X12
+ PSLLL $0x0c, X12
+ PSRLL $0x14, X4
+ PXOR X12, X4
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL8(X10, X12)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X12
+ PSLLL $0x07, X12
+ PSRLL $0x19, X4
+ PXOR X12, X4
+ PADDD X5, X2
+ PXOR X2, X11
+ ROL16(X11, X12)
+ PADDD X11, X8
+ PXOR X8, X5
+ MOVO X5, X12
+ PSLLL $0x0c, X12
+ PSRLL $0x14, X5
+ PXOR X12, X5
+ PADDD X5, X2
+ PXOR X2, X11
+ ROL8(X11, X12)
+ PADDD X11, X8
+ PXOR X8, X5
+ MOVO X5, X12
+ PSLLL $0x07, X12
+ PSRLL $0x19, X5
+ PXOR X12, X5
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xdb
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xf6
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xc9
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xe4
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xff
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xd2
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xed
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xc0
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xdb
+ BYTE $0x0c
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL16(X9, X12)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X12
+ PSLLL $0x0c, X12
+ PSRLL $0x14, X3
+ PXOR X12, X3
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL8(X9, X12)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X12
+ PSLLL $0x07, X12
+ PSRLL $0x19, X3
+ PXOR X12, X3
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL16(X10, X12)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X12
+ PSLLL $0x0c, X12
+ PSRLL $0x14, X4
+ PXOR X12, X4
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL8(X10, X12)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X12
+ PSLLL $0x07, X12
+ PSRLL $0x19, X4
+ PXOR X12, X4
+ PADDD X5, X2
+ PXOR X2, X11
+ ROL16(X11, X12)
+ PADDD X11, X8
+ PXOR X8, X5
+ MOVO X5, X12
+ PSLLL $0x0c, X12
+ PSRLL $0x14, X5
+ PXOR X12, X5
+ PADDD X5, X2
+ PXOR X2, X11
+ ROL8(X11, X12)
+ PADDD X11, X8
+ PXOR X8, X5
+ MOVO X5, X12
+ PSLLL $0x07, X12
+ PSRLL $0x19, X5
+ PXOR X12, X5
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xdb
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xf6
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xc9
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xe4
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xff
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xd2
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xed
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xc0
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xdb
+ BYTE $0x04
+ CMPQ R9, CX
+ JB openSSLTail192LoopA
+ CMPQ R9, $0xa0
+ JNE openSSLTail192LoopB
+ CMPQ BX, $0xb0
+ JB openSSLTail192Store
+ ADDQ 160(SI), R10
+ ADCQ 168(SI), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), AX
+ MOVQ AX, R15
+ MULQ R10
+ MOVQ AX, R13
+ MOVQ DX, R14
+ MOVQ (BP), AX
+ MULQ R11
+ IMULQ R12, R15
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), AX
+ MOVQ AX, R8
+ MULQ R10
+ ADDQ AX, R14
+ ADCQ $0x00, DX
+ MOVQ DX, R10
+ MOVQ 8(BP), AX
+ MULQ R11
+ ADDQ AX, R15
+ ADCQ $0x00, DX
+ IMULQ R12, R8
+ ADDQ R10, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ CMPQ BX, $0xc0
+ JB openSSLTail192Store
+ ADDQ 176(SI), R10
+ ADCQ 184(SI), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), AX
+ MOVQ AX, R15
+ MULQ R10
+ MOVQ AX, R13
+ MOVQ DX, R14
+ MOVQ (BP), AX
+ MULQ R11
+ IMULQ R12, R15
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), AX
+ MOVQ AX, R8
+ MULQ R10
+ ADDQ AX, R14
+ ADCQ $0x00, DX
+ MOVQ DX, R10
+ MOVQ 8(BP), AX
+ MULQ R11
+ ADDQ AX, R15
+ ADCQ $0x00, DX
+ IMULQ R12, R8
+ ADDQ R10, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
openSSLTail192Store:
- PADDL ·chacha20Constants<>(SB), A0; PADDL ·chacha20Constants<>(SB), A1; PADDL ·chacha20Constants<>(SB), A2
- PADDL state1Store, B0; PADDL state1Store, B1; PADDL state1Store, B2
- PADDL state2Store, C0; PADDL state2Store, C1; PADDL state2Store, C2
- PADDL ctr2Store, D0; PADDL ctr1Store, D1; PADDL ctr0Store, D2
-
- MOVOU (0*16)(inp), T0; MOVOU (1*16)(inp), T1; MOVOU (2*16)(inp), T2; MOVOU (3*16)(inp), T3
- PXOR T0, A2; PXOR T1, B2; PXOR T2, C2; PXOR T3, D2
- MOVOU A2, (0*16)(oup); MOVOU B2, (1*16)(oup); MOVOU C2, (2*16)(oup); MOVOU D2, (3*16)(oup)
-
- MOVOU (4*16)(inp), T0; MOVOU (5*16)(inp), T1; MOVOU (6*16)(inp), T2; MOVOU (7*16)(inp), T3
- PXOR T0, A1; PXOR T1, B1; PXOR T2, C1; PXOR T3, D1
- MOVOU A1, (4*16)(oup); MOVOU B1, (5*16)(oup); MOVOU C1, (6*16)(oup); MOVOU D1, (7*16)(oup)
-
- SUBQ $128, inl
- LEAQ 128(inp), inp
- LEAQ 128(oup), oup
- JMP openSSETail64DecLoop
-
-// ----------------------------------------------------------------------------
-// Special optimization for the last 256 bytes of ciphertext
+ PADDL ·chacha20Constants<>+0(SB), X0
+ PADDL ·chacha20Constants<>+0(SB), X1
+ PADDL ·chacha20Constants<>+0(SB), X2
+ PADDL 32(BP), X3
+ PADDL 32(BP), X4
+ PADDL 32(BP), X5
+ PADDL 48(BP), X6
+ PADDL 48(BP), X7
+ PADDL 48(BP), X8
+ PADDL 112(BP), X9
+ PADDL 96(BP), X10
+ PADDL 80(BP), X11
+ MOVOU (SI), X12
+ MOVOU 16(SI), X13
+ MOVOU 32(SI), X14
+ MOVOU 48(SI), X15
+ PXOR X12, X2
+ PXOR X13, X5
+ PXOR X14, X8
+ PXOR X15, X11
+ MOVOU X2, (DI)
+ MOVOU X5, 16(DI)
+ MOVOU X8, 32(DI)
+ MOVOU X11, 48(DI)
+ MOVOU 64(SI), X12
+ MOVOU 80(SI), X13
+ MOVOU 96(SI), X14
+ MOVOU 112(SI), X15
+ PXOR X12, X1
+ PXOR X13, X4
+ PXOR X14, X7
+ PXOR X15, X10
+ MOVOU X1, 64(DI)
+ MOVOU X4, 80(DI)
+ MOVOU X7, 96(DI)
+ MOVOU X10, 112(DI)
+ SUBQ $0x80, BX
+ LEAQ 128(SI), SI
+ LEAQ 128(DI), DI
+ JMP openSSETail64DecLoop
+
openSSETail256:
- // Need to decrypt up to 256 bytes - prepare four blocks
- MOVO ·chacha20Constants<>(SB), A0; MOVO state1Store, B0; MOVO state2Store, C0; MOVO ctr3Store, D0; PADDL ·sseIncMask<>(SB), D0
- MOVO A0, A1; MOVO B0, B1; MOVO C0, C1; MOVO D0, D1; PADDL ·sseIncMask<>(SB), D1
- MOVO A1, A2; MOVO B1, B2; MOVO C1, C2; MOVO D1, D2; PADDL ·sseIncMask<>(SB), D2
- MOVO A2, A3; MOVO B2, B3; MOVO C2, C3; MOVO D2, D3; PADDL ·sseIncMask<>(SB), D3
+ MOVO ·chacha20Constants<>+0(SB), X0
+ MOVO 32(BP), X3
+ MOVO 48(BP), X6
+ MOVO 128(BP), X9
+ PADDL ·sseIncMask<>+0(SB), X9
+ MOVO X0, X1
+ MOVO X3, X4
+ MOVO X6, X7
+ MOVO X9, X10
+ PADDL ·sseIncMask<>+0(SB), X10
+ MOVO X1, X2
+ MOVO X4, X5
+ MOVO X7, X8
+ MOVO X10, X11
+ PADDL ·sseIncMask<>+0(SB), X11
+ MOVO X2, X12
+ MOVO X5, X13
+ MOVO X8, X14
+ MOVO X11, X15
+ PADDL ·sseIncMask<>+0(SB), X15
// Store counters
- MOVO D0, ctr0Store; MOVO D1, ctr1Store; MOVO D2, ctr2Store; MOVO D3, ctr3Store
- XORQ itr2, itr2
+ MOVO X9, 80(BP)
+ MOVO X10, 96(BP)
+ MOVO X11, 112(BP)
+ MOVO X15, 128(BP)
+ XORQ R9, R9
openSSETail256Loop:
- // This loop inteleaves 8 ChaCha quarter rounds with 1 poly multiplication
- polyAdd(0(inp)(itr2*1))
- MOVO C3, tmpStore
- chachaQR(A0, B0, C0, D0, C3); chachaQR(A1, B1, C1, D1, C3); chachaQR(A2, B2, C2, D2, C3)
- MOVO tmpStore, C3
- MOVO C1, tmpStore
- chachaQR(A3, B3, C3, D3, C1)
- MOVO tmpStore, C1
- shiftB0Left; shiftB1Left; shiftB2Left; shiftB3Left
- shiftC0Left; shiftC1Left; shiftC2Left; shiftC3Left
- shiftD0Left; shiftD1Left; shiftD2Left; shiftD3Left
- polyMulStage1
- polyMulStage2
- MOVO C3, tmpStore
- chachaQR(A0, B0, C0, D0, C3); chachaQR(A1, B1, C1, D1, C3); chachaQR(A2, B2, C2, D2, C3)
- MOVO tmpStore, C3
- MOVO C1, tmpStore
- chachaQR(A3, B3, C3, D3, C1)
- MOVO tmpStore, C1
- polyMulStage3
- polyMulReduceStage
- shiftB0Right; shiftB1Right; shiftB2Right; shiftB3Right
- shiftC0Right; shiftC1Right; shiftC2Right; shiftC3Right
- shiftD0Right; shiftD1Right; shiftD2Right; shiftD3Right
- ADDQ $2*8, itr2
- CMPQ itr2, $160
- JB openSSETail256Loop
- MOVQ inl, itr1
- ANDQ $-16, itr1
+ ADDQ (SI)(R9*1), R10
+ ADCQ 8(SI)(R9*1), R11
+ ADCQ $0x01, R12
+ MOVO X14, 64(BP)
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL16(X9, X14)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X14
+ PSLLL $0x0c, X14
+ PSRLL $0x14, X3
+ PXOR X14, X3
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL8(X9, X14)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X14
+ PSLLL $0x07, X14
+ PSRLL $0x19, X3
+ PXOR X14, X3
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL16(X10, X14)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X14
+ PSLLL $0x0c, X14
+ PSRLL $0x14, X4
+ PXOR X14, X4
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL8(X10, X14)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X14
+ PSLLL $0x07, X14
+ PSRLL $0x19, X4
+ PXOR X14, X4
+ PADDD X5, X2
+ PXOR X2, X11
+ ROL16(X11, X14)
+ PADDD X11, X8
+ PXOR X8, X5
+ MOVO X5, X14
+ PSLLL $0x0c, X14
+ PSRLL $0x14, X5
+ PXOR X14, X5
+ PADDD X5, X2
+ PXOR X2, X11
+ ROL8(X11, X14)
+ PADDD X11, X8
+ PXOR X8, X5
+ MOVO X5, X14
+ PSLLL $0x07, X14
+ PSRLL $0x19, X5
+ PXOR X14, X5
+ MOVO 64(BP), X14
+ MOVO X7, 64(BP)
+ PADDD X13, X12
+ PXOR X12, X15
+ ROL16(X15, X7)
+ PADDD X15, X14
+ PXOR X14, X13
+ MOVO X13, X7
+ PSLLL $0x0c, X7
+ PSRLL $0x14, X13
+ PXOR X7, X13
+ PADDD X13, X12
+ PXOR X12, X15
+ ROL8(X15, X7)
+ PADDD X15, X14
+ PXOR X14, X13
+ MOVO X13, X7
+ PSLLL $0x07, X7
+ PSRLL $0x19, X13
+ PXOR X7, X13
+ MOVO 64(BP), X7
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xdb
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xe4
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xed
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xed
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xf6
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xff
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xc0
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xf6
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xc9
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xd2
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xdb
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xff
+ BYTE $0x0c
+ MOVQ (BP), AX
+ MOVQ AX, R15
+ MULQ R10
+ MOVQ AX, R13
+ MOVQ DX, R14
+ MOVQ (BP), AX
+ MULQ R11
+ IMULQ R12, R15
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), AX
+ MOVQ AX, R8
+ MULQ R10
+ ADDQ AX, R14
+ ADCQ $0x00, DX
+ MOVQ DX, R10
+ MOVQ 8(BP), AX
+ MULQ R11
+ ADDQ AX, R15
+ ADCQ $0x00, DX
+ MOVO X14, 64(BP)
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL16(X9, X14)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X14
+ PSLLL $0x0c, X14
+ PSRLL $0x14, X3
+ PXOR X14, X3
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL8(X9, X14)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X14
+ PSLLL $0x07, X14
+ PSRLL $0x19, X3
+ PXOR X14, X3
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL16(X10, X14)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X14
+ PSLLL $0x0c, X14
+ PSRLL $0x14, X4
+ PXOR X14, X4
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL8(X10, X14)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X14
+ PSLLL $0x07, X14
+ PSRLL $0x19, X4
+ PXOR X14, X4
+ PADDD X5, X2
+ PXOR X2, X11
+ ROL16(X11, X14)
+ PADDD X11, X8
+ PXOR X8, X5
+ MOVO X5, X14
+ PSLLL $0x0c, X14
+ PSRLL $0x14, X5
+ PXOR X14, X5
+ PADDD X5, X2
+ PXOR X2, X11
+ ROL8(X11, X14)
+ PADDD X11, X8
+ PXOR X8, X5
+ MOVO X5, X14
+ PSLLL $0x07, X14
+ PSRLL $0x19, X5
+ PXOR X14, X5
+ MOVO 64(BP), X14
+ MOVO X7, 64(BP)
+ PADDD X13, X12
+ PXOR X12, X15
+ ROL16(X15, X7)
+ PADDD X15, X14
+ PXOR X14, X13
+ MOVO X13, X7
+ PSLLL $0x0c, X7
+ PSRLL $0x14, X13
+ PXOR X7, X13
+ PADDD X13, X12
+ PXOR X12, X15
+ ROL8(X15, X7)
+ PADDD X15, X14
+ PXOR X14, X13
+ MOVO X13, X7
+ PSLLL $0x07, X7
+ PSRLL $0x19, X13
+ PXOR X7, X13
+ MOVO 64(BP), X7
+ IMULQ R12, R8
+ ADDQ R10, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xdb
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xe4
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xed
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xed
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xf6
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xff
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xc0
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xf6
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xc9
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xd2
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xdb
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xff
+ BYTE $0x04
+ ADDQ $0x10, R9
+ CMPQ R9, $0xa0
+ JB openSSETail256Loop
+ MOVQ BX, CX
+ ANDQ $-16, CX
openSSETail256HashLoop:
- polyAdd(0(inp)(itr2*1))
- polyMul
- ADDQ $2*8, itr2
- CMPQ itr2, itr1
- JB openSSETail256HashLoop
+ ADDQ (SI)(R9*1), R10
+ ADCQ 8(SI)(R9*1), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), AX
+ MOVQ AX, R15
+ MULQ R10
+ MOVQ AX, R13
+ MOVQ DX, R14
+ MOVQ (BP), AX
+ MULQ R11
+ IMULQ R12, R15
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), AX
+ MOVQ AX, R8
+ MULQ R10
+ ADDQ AX, R14
+ ADCQ $0x00, DX
+ MOVQ DX, R10
+ MOVQ 8(BP), AX
+ MULQ R11
+ ADDQ AX, R15
+ ADCQ $0x00, DX
+ IMULQ R12, R8
+ ADDQ R10, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ ADDQ $0x10, R9
+ CMPQ R9, CX
+ JB openSSETail256HashLoop
// Add in the state
- PADDD ·chacha20Constants<>(SB), A0; PADDD ·chacha20Constants<>(SB), A1; PADDD ·chacha20Constants<>(SB), A2; PADDD ·chacha20Constants<>(SB), A3
- PADDD state1Store, B0; PADDD state1Store, B1; PADDD state1Store, B2; PADDD state1Store, B3
- PADDD state2Store, C0; PADDD state2Store, C1; PADDD state2Store, C2; PADDD state2Store, C3
- PADDD ctr0Store, D0; PADDD ctr1Store, D1; PADDD ctr2Store, D2; PADDD ctr3Store, D3
- MOVO D3, tmpStore
+ PADDD ·chacha20Constants<>+0(SB), X0
+ PADDD ·chacha20Constants<>+0(SB), X1
+ PADDD ·chacha20Constants<>+0(SB), X2
+ PADDD ·chacha20Constants<>+0(SB), X12
+ PADDD 32(BP), X3
+ PADDD 32(BP), X4
+ PADDD 32(BP), X5
+ PADDD 32(BP), X13
+ PADDD 48(BP), X6
+ PADDD 48(BP), X7
+ PADDD 48(BP), X8
+ PADDD 48(BP), X14
+ PADDD 80(BP), X9
+ PADDD 96(BP), X10
+ PADDD 112(BP), X11
+ PADDD 128(BP), X15
+ MOVO X15, 64(BP)
// Load - xor - store
- MOVOU (0*16)(inp), D3; PXOR D3, A0
- MOVOU (1*16)(inp), D3; PXOR D3, B0
- MOVOU (2*16)(inp), D3; PXOR D3, C0
- MOVOU (3*16)(inp), D3; PXOR D3, D0
- MOVOU A0, (0*16)(oup)
- MOVOU B0, (1*16)(oup)
- MOVOU C0, (2*16)(oup)
- MOVOU D0, (3*16)(oup)
- MOVOU (4*16)(inp), A0; MOVOU (5*16)(inp), B0; MOVOU (6*16)(inp), C0; MOVOU (7*16)(inp), D0
- PXOR A0, A1; PXOR B0, B1; PXOR C0, C1; PXOR D0, D1
- MOVOU A1, (4*16)(oup); MOVOU B1, (5*16)(oup); MOVOU C1, (6*16)(oup); MOVOU D1, (7*16)(oup)
- MOVOU (8*16)(inp), A0; MOVOU (9*16)(inp), B0; MOVOU (10*16)(inp), C0; MOVOU (11*16)(inp), D0
- PXOR A0, A2; PXOR B0, B2; PXOR C0, C2; PXOR D0, D2
- MOVOU A2, (8*16)(oup); MOVOU B2, (9*16)(oup); MOVOU C2, (10*16)(oup); MOVOU D2, (11*16)(oup)
- LEAQ 192(inp), inp
- LEAQ 192(oup), oup
- SUBQ $192, inl
- MOVO A3, A0
- MOVO B3, B0
- MOVO C3, C0
- MOVO tmpStore, D0
-
- JMP openSSETail64DecLoop
-
-// ----------------------------------------------------------------------------
-// ------------------------- AVX2 Code ----------------------------------------
+ MOVOU (SI), X15
+ PXOR X15, X0
+ MOVOU 16(SI), X15
+ PXOR X15, X3
+ MOVOU 32(SI), X15
+ PXOR X15, X6
+ MOVOU 48(SI), X15
+ PXOR X15, X9
+ MOVOU X0, (DI)
+ MOVOU X3, 16(DI)
+ MOVOU X6, 32(DI)
+ MOVOU X9, 48(DI)
+ MOVOU 64(SI), X0
+ MOVOU 80(SI), X3
+ MOVOU 96(SI), X6
+ MOVOU 112(SI), X9
+ PXOR X0, X1
+ PXOR X3, X4
+ PXOR X6, X7
+ PXOR X9, X10
+ MOVOU X1, 64(DI)
+ MOVOU X4, 80(DI)
+ MOVOU X7, 96(DI)
+ MOVOU X10, 112(DI)
+ MOVOU 128(SI), X0
+ MOVOU 144(SI), X3
+ MOVOU 160(SI), X6
+ MOVOU 176(SI), X9
+ PXOR X0, X2
+ PXOR X3, X5
+ PXOR X6, X8
+ PXOR X9, X11
+ MOVOU X2, 128(DI)
+ MOVOU X5, 144(DI)
+ MOVOU X8, 160(DI)
+ MOVOU X11, 176(DI)
+ LEAQ 192(SI), SI
+ LEAQ 192(DI), DI
+ SUBQ $0xc0, BX
+ MOVO X12, X0
+ MOVO X13, X3
+ MOVO X14, X6
+ MOVO 64(BP), X9
+ JMP openSSETail64DecLoop
+
chacha20Poly1305Open_AVX2:
VZEROUPPER
- VMOVDQU ·chacha20Constants<>(SB), AA0
- BYTE $0xc4; BYTE $0x42; BYTE $0x7d; BYTE $0x5a; BYTE $0x70; BYTE $0x10 // broadcasti128 16(r8), ymm14
- BYTE $0xc4; BYTE $0x42; BYTE $0x7d; BYTE $0x5a; BYTE $0x60; BYTE $0x20 // broadcasti128 32(r8), ymm12
- BYTE $0xc4; BYTE $0xc2; BYTE $0x7d; BYTE $0x5a; BYTE $0x60; BYTE $0x30 // broadcasti128 48(r8), ymm4
- VPADDD ·avx2InitMask<>(SB), DD0, DD0
+ VMOVDQU ·chacha20Constants<>+0(SB), Y0
+ BYTE $0xc4
+ BYTE $0x42
+ BYTE $0x7d
+ BYTE $0x5a
+ BYTE $0x70
+ BYTE $0x10
+ BYTE $0xc4
+ BYTE $0x42
+ BYTE $0x7d
+ BYTE $0x5a
+ BYTE $0x60
+ BYTE $0x20
+ BYTE $0xc4
+ BYTE $0xc2
+ BYTE $0x7d
+ BYTE $0x5a
+ BYTE $0x60
+ BYTE $0x30
+ VPADDD ·avx2InitMask<>+0(SB), Y4, Y4
// Special optimization, for very short buffers
- CMPQ inl, $192
+ CMPQ BX, $0xc0
JBE openAVX2192
- CMPQ inl, $320
+ CMPQ BX, $0x00000140
JBE openAVX2320
// For the general key prepare the key first - as a byproduct we have 64 bytes of cipher stream
- VMOVDQA BB0, state1StoreAVX2
- VMOVDQA CC0, state2StoreAVX2
- VMOVDQA DD0, ctr3StoreAVX2
- MOVQ $10, itr2
+ VMOVDQA Y14, 32(BP)
+ VMOVDQA Y12, 64(BP)
+ VMOVDQA Y4, 192(BP)
+ MOVQ $0x0000000a, R9
openAVX2PreparePolyKey:
- chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0)
- VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $12, DD0, DD0, DD0
- chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0)
- VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $4, DD0, DD0, DD0
- DECQ itr2
- JNE openAVX2PreparePolyKey
-
- VPADDD ·chacha20Constants<>(SB), AA0, AA0
- VPADDD state1StoreAVX2, BB0, BB0
- VPADDD state2StoreAVX2, CC0, CC0
- VPADDD ctr3StoreAVX2, DD0, DD0
-
- VPERM2I128 $0x02, AA0, BB0, TT0
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol16<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x0c, Y14, Y3
+ VPSRLD $0x14, Y14, Y14
+ VPXOR Y3, Y14, Y14
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol8<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x07, Y14, Y3
+ VPSRLD $0x19, Y14, Y14
+ VPXOR Y3, Y14, Y14
+ VPALIGNR $0x04, Y14, Y14, Y14
+ VPALIGNR $0x08, Y12, Y12, Y12
+ VPALIGNR $0x0c, Y4, Y4, Y4
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol16<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x0c, Y14, Y3
+ VPSRLD $0x14, Y14, Y14
+ VPXOR Y3, Y14, Y14
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol8<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x07, Y14, Y3
+ VPSRLD $0x19, Y14, Y14
+ VPXOR Y3, Y14, Y14
+ VPALIGNR $0x0c, Y14, Y14, Y14
+ VPALIGNR $0x08, Y12, Y12, Y12
+ VPALIGNR $0x04, Y4, Y4, Y4
+ DECQ R9
+ JNE openAVX2PreparePolyKey
+ VPADDD ·chacha20Constants<>+0(SB), Y0, Y0
+ VPADDD 32(BP), Y14, Y14
+ VPADDD 64(BP), Y12, Y12
+ VPADDD 192(BP), Y4, Y4
+ VPERM2I128 $0x02, Y0, Y14, Y3
// Clamp and store poly key
- VPAND ·polyClampMask<>(SB), TT0, TT0
- VMOVDQA TT0, rsStoreAVX2
+ VPAND ·polyClampMask<>+0(SB), Y3, Y3
+ VMOVDQA Y3, (BP)
// Stream for the first 64 bytes
- VPERM2I128 $0x13, AA0, BB0, AA0
- VPERM2I128 $0x13, CC0, DD0, BB0
+ VPERM2I128 $0x13, Y0, Y14, Y0
+ VPERM2I128 $0x13, Y12, Y4, Y14
// Hash AD + first 64 bytes
- MOVQ ad_len+80(FP), itr2
+ MOVQ ad_len+80(FP), R9
CALL polyHashADInternal<>(SB)
- XORQ itr1, itr1
+ XORQ CX, CX
openAVX2InitialHash64:
- polyAdd(0(inp)(itr1*1))
- polyMulAVX2
- ADDQ $16, itr1
- CMPQ itr1, $64
- JNE openAVX2InitialHash64
+ ADDQ (SI)(CX*1), R10
+ ADCQ 8(SI)(CX*1), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), DX
+ MOVQ DX, R15
+ MULXQ R10, R13, R14
+ IMULQ R12, R15
+ MULXQ R11, AX, DX
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), DX
+ MULXQ R10, R10, AX
+ ADDQ R10, R14
+ MULXQ R11, R11, R8
+ ADCQ R11, R15
+ ADCQ $0x00, R8
+ IMULQ R12, DX
+ ADDQ AX, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ ADDQ $0x10, CX
+ CMPQ CX, $0x40
+ JNE openAVX2InitialHash64
// Decrypt the first 64 bytes
- VPXOR (0*32)(inp), AA0, AA0
- VPXOR (1*32)(inp), BB0, BB0
- VMOVDQU AA0, (0*32)(oup)
- VMOVDQU BB0, (1*32)(oup)
- LEAQ (2*32)(inp), inp
- LEAQ (2*32)(oup), oup
- SUBQ $64, inl
+ VPXOR (SI), Y0, Y0
+ VPXOR 32(SI), Y14, Y14
+ VMOVDQU Y0, (DI)
+ VMOVDQU Y14, 32(DI)
+ LEAQ 64(SI), SI
+ LEAQ 64(DI), DI
+ SUBQ $0x40, BX
openAVX2MainLoop:
- CMPQ inl, $512
+ CMPQ BX, $0x00000200
JB openAVX2MainLoopDone
// Load state, increment counter blocks, store the incremented counters
- VMOVDQU ·chacha20Constants<>(SB), AA0; VMOVDQA AA0, AA1; VMOVDQA AA0, AA2; VMOVDQA AA0, AA3
- VMOVDQA state1StoreAVX2, BB0; VMOVDQA BB0, BB1; VMOVDQA BB0, BB2; VMOVDQA BB0, BB3
- VMOVDQA state2StoreAVX2, CC0; VMOVDQA CC0, CC1; VMOVDQA CC0, CC2; VMOVDQA CC0, CC3
- VMOVDQA ctr3StoreAVX2, DD0; VPADDD ·avx2IncMask<>(SB), DD0, DD0; VPADDD ·avx2IncMask<>(SB), DD0, DD1; VPADDD ·avx2IncMask<>(SB), DD1, DD2; VPADDD ·avx2IncMask<>(SB), DD2, DD3
- VMOVDQA DD0, ctr0StoreAVX2; VMOVDQA DD1, ctr1StoreAVX2; VMOVDQA DD2, ctr2StoreAVX2; VMOVDQA DD3, ctr3StoreAVX2
- XORQ itr1, itr1
+ VMOVDQU ·chacha20Constants<>+0(SB), Y0
+ VMOVDQA Y0, Y5
+ VMOVDQA Y0, Y6
+ VMOVDQA Y0, Y7
+ VMOVDQA 32(BP), Y14
+ VMOVDQA Y14, Y9
+ VMOVDQA Y14, Y10
+ VMOVDQA Y14, Y11
+ VMOVDQA 64(BP), Y12
+ VMOVDQA Y12, Y13
+ VMOVDQA Y12, Y8
+ VMOVDQA Y12, Y15
+ VMOVDQA 192(BP), Y4
+ VPADDD ·avx2IncMask<>+0(SB), Y4, Y4
+ VPADDD ·avx2IncMask<>+0(SB), Y4, Y1
+ VPADDD ·avx2IncMask<>+0(SB), Y1, Y2
+ VPADDD ·avx2IncMask<>+0(SB), Y2, Y3
+ VMOVDQA Y4, 96(BP)
+ VMOVDQA Y1, 128(BP)
+ VMOVDQA Y2, 160(BP)
+ VMOVDQA Y3, 192(BP)
+ XORQ CX, CX
openAVX2InternalLoop:
- // Lets just say this spaghetti loop interleaves 2 quarter rounds with 3 poly multiplications
- // Effectively per 512 bytes of stream we hash 480 bytes of ciphertext
- polyAdd(0*8(inp)(itr1*1))
- VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3
- polyMulStage1_AVX2
- VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3
- VPSHUFB ·rol16<>(SB), DD0, DD0; VPSHUFB ·rol16<>(SB), DD1, DD1; VPSHUFB ·rol16<>(SB), DD2, DD2; VPSHUFB ·rol16<>(SB), DD3, DD3
- polyMulStage2_AVX2
- VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3
- VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3
- polyMulStage3_AVX2
- VMOVDQA CC3, tmpStoreAVX2
- VPSLLD $12, BB0, CC3; VPSRLD $20, BB0, BB0; VPXOR CC3, BB0, BB0
- VPSLLD $12, BB1, CC3; VPSRLD $20, BB1, BB1; VPXOR CC3, BB1, BB1
- VPSLLD $12, BB2, CC3; VPSRLD $20, BB2, BB2; VPXOR CC3, BB2, BB2
- VPSLLD $12, BB3, CC3; VPSRLD $20, BB3, BB3; VPXOR CC3, BB3, BB3
- VMOVDQA tmpStoreAVX2, CC3
- polyMulReduceStage
- VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3
- VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3
- VPSHUFB ·rol8<>(SB), DD0, DD0; VPSHUFB ·rol8<>(SB), DD1, DD1; VPSHUFB ·rol8<>(SB), DD2, DD2; VPSHUFB ·rol8<>(SB), DD3, DD3
- polyAdd(2*8(inp)(itr1*1))
- VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3
- polyMulStage1_AVX2
- VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3
- VMOVDQA CC3, tmpStoreAVX2
- VPSLLD $7, BB0, CC3; VPSRLD $25, BB0, BB0; VPXOR CC3, BB0, BB0
- VPSLLD $7, BB1, CC3; VPSRLD $25, BB1, BB1; VPXOR CC3, BB1, BB1
- VPSLLD $7, BB2, CC3; VPSRLD $25, BB2, BB2; VPXOR CC3, BB2, BB2
- VPSLLD $7, BB3, CC3; VPSRLD $25, BB3, BB3; VPXOR CC3, BB3, BB3
- VMOVDQA tmpStoreAVX2, CC3
- polyMulStage2_AVX2
- VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $4, BB1, BB1, BB1; VPALIGNR $4, BB2, BB2, BB2; VPALIGNR $4, BB3, BB3, BB3
- VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2; VPALIGNR $8, CC3, CC3, CC3
- VPALIGNR $12, DD0, DD0, DD0; VPALIGNR $12, DD1, DD1, DD1; VPALIGNR $12, DD2, DD2, DD2; VPALIGNR $12, DD3, DD3, DD3
- VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3
- polyMulStage3_AVX2
- VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3
- VPSHUFB ·rol16<>(SB), DD0, DD0; VPSHUFB ·rol16<>(SB), DD1, DD1; VPSHUFB ·rol16<>(SB), DD2, DD2; VPSHUFB ·rol16<>(SB), DD3, DD3
- polyMulReduceStage
- VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3
- VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3
- polyAdd(4*8(inp)(itr1*1))
- LEAQ (6*8)(itr1), itr1
- VMOVDQA CC3, tmpStoreAVX2
- VPSLLD $12, BB0, CC3; VPSRLD $20, BB0, BB0; VPXOR CC3, BB0, BB0
- VPSLLD $12, BB1, CC3; VPSRLD $20, BB1, BB1; VPXOR CC3, BB1, BB1
- VPSLLD $12, BB2, CC3; VPSRLD $20, BB2, BB2; VPXOR CC3, BB2, BB2
- VPSLLD $12, BB3, CC3; VPSRLD $20, BB3, BB3; VPXOR CC3, BB3, BB3
- VMOVDQA tmpStoreAVX2, CC3
- polyMulStage1_AVX2
- VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3
- VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3
- polyMulStage2_AVX2
- VPSHUFB ·rol8<>(SB), DD0, DD0; VPSHUFB ·rol8<>(SB), DD1, DD1; VPSHUFB ·rol8<>(SB), DD2, DD2; VPSHUFB ·rol8<>(SB), DD3, DD3
- VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3
- polyMulStage3_AVX2
- VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3
- VMOVDQA CC3, tmpStoreAVX2
- VPSLLD $7, BB0, CC3; VPSRLD $25, BB0, BB0; VPXOR CC3, BB0, BB0
- VPSLLD $7, BB1, CC3; VPSRLD $25, BB1, BB1; VPXOR CC3, BB1, BB1
- VPSLLD $7, BB2, CC3; VPSRLD $25, BB2, BB2; VPXOR CC3, BB2, BB2
- VPSLLD $7, BB3, CC3; VPSRLD $25, BB3, BB3; VPXOR CC3, BB3, BB3
- VMOVDQA tmpStoreAVX2, CC3
- polyMulReduceStage
- VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $12, BB1, BB1, BB1; VPALIGNR $12, BB2, BB2, BB2; VPALIGNR $12, BB3, BB3, BB3
- VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2; VPALIGNR $8, CC3, CC3, CC3
- VPALIGNR $4, DD0, DD0, DD0; VPALIGNR $4, DD1, DD1, DD1; VPALIGNR $4, DD2, DD2, DD2; VPALIGNR $4, DD3, DD3, DD3
- CMPQ itr1, $480
+ ADDQ (SI)(CX*1), R10
+ ADCQ 8(SI)(CX*1), R11
+ ADCQ $0x01, R12
+ VPADDD Y14, Y0, Y0
+ VPADDD Y9, Y5, Y5
+ VPADDD Y10, Y6, Y6
+ VPADDD Y11, Y7, Y7
+ MOVQ (BP), DX
+ MOVQ DX, R15
+ MULXQ R10, R13, R14
+ IMULQ R12, R15
+ MULXQ R11, AX, DX
+ ADDQ AX, R14
+ ADCQ DX, R15
+ VPXOR Y0, Y4, Y4
+ VPXOR Y5, Y1, Y1
+ VPXOR Y6, Y2, Y2
+ VPXOR Y7, Y3, Y3
+ VPSHUFB ·rol16<>+0(SB), Y4, Y4
+ VPSHUFB ·rol16<>+0(SB), Y1, Y1
+ VPSHUFB ·rol16<>+0(SB), Y2, Y2
+ VPSHUFB ·rol16<>+0(SB), Y3, Y3
+ MOVQ 8(BP), DX
+ MULXQ R10, R10, AX
+ ADDQ R10, R14
+ MULXQ R11, R11, R8
+ ADCQ R11, R15
+ ADCQ $0x00, R8
+ VPADDD Y4, Y12, Y12
+ VPADDD Y1, Y13, Y13
+ VPADDD Y2, Y8, Y8
+ VPADDD Y3, Y15, Y15
+ VPXOR Y12, Y14, Y14
+ VPXOR Y13, Y9, Y9
+ VPXOR Y8, Y10, Y10
+ VPXOR Y15, Y11, Y11
+ IMULQ R12, DX
+ ADDQ AX, R15
+ ADCQ DX, R8
+ VMOVDQA Y15, 224(BP)
+ VPSLLD $0x0c, Y14, Y15
+ VPSRLD $0x14, Y14, Y14
+ VPXOR Y15, Y14, Y14
+ VPSLLD $0x0c, Y9, Y15
+ VPSRLD $0x14, Y9, Y9
+ VPXOR Y15, Y9, Y9
+ VPSLLD $0x0c, Y10, Y15
+ VPSRLD $0x14, Y10, Y10
+ VPXOR Y15, Y10, Y10
+ VPSLLD $0x0c, Y11, Y15
+ VPSRLD $0x14, Y11, Y11
+ VPXOR Y15, Y11, Y11
+ VMOVDQA 224(BP), Y15
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ VPADDD Y14, Y0, Y0
+ VPADDD Y9, Y5, Y5
+ VPADDD Y10, Y6, Y6
+ VPADDD Y11, Y7, Y7
+ VPXOR Y0, Y4, Y4
+ VPXOR Y5, Y1, Y1
+ VPXOR Y6, Y2, Y2
+ VPXOR Y7, Y3, Y3
+ VPSHUFB ·rol8<>+0(SB), Y4, Y4
+ VPSHUFB ·rol8<>+0(SB), Y1, Y1
+ VPSHUFB ·rol8<>+0(SB), Y2, Y2
+ VPSHUFB ·rol8<>+0(SB), Y3, Y3
+ ADDQ 16(SI)(CX*1), R10
+ ADCQ 24(SI)(CX*1), R11
+ ADCQ $0x01, R12
+ VPADDD Y4, Y12, Y12
+ VPADDD Y1, Y13, Y13
+ VPADDD Y2, Y8, Y8
+ VPADDD Y3, Y15, Y15
+ MOVQ (BP), DX
+ MOVQ DX, R15
+ MULXQ R10, R13, R14
+ IMULQ R12, R15
+ MULXQ R11, AX, DX
+ ADDQ AX, R14
+ ADCQ DX, R15
+ VPXOR Y12, Y14, Y14
+ VPXOR Y13, Y9, Y9
+ VPXOR Y8, Y10, Y10
+ VPXOR Y15, Y11, Y11
+ VMOVDQA Y15, 224(BP)
+ VPSLLD $0x07, Y14, Y15
+ VPSRLD $0x19, Y14, Y14
+ VPXOR Y15, Y14, Y14
+ VPSLLD $0x07, Y9, Y15
+ VPSRLD $0x19, Y9, Y9
+ VPXOR Y15, Y9, Y9
+ VPSLLD $0x07, Y10, Y15
+ VPSRLD $0x19, Y10, Y10
+ VPXOR Y15, Y10, Y10
+ VPSLLD $0x07, Y11, Y15
+ VPSRLD $0x19, Y11, Y11
+ VPXOR Y15, Y11, Y11
+ VMOVDQA 224(BP), Y15
+ MOVQ 8(BP), DX
+ MULXQ R10, R10, AX
+ ADDQ R10, R14
+ MULXQ R11, R11, R8
+ ADCQ R11, R15
+ ADCQ $0x00, R8
+ VPALIGNR $0x04, Y14, Y14, Y14
+ VPALIGNR $0x04, Y9, Y9, Y9
+ VPALIGNR $0x04, Y10, Y10, Y10
+ VPALIGNR $0x04, Y11, Y11, Y11
+ VPALIGNR $0x08, Y12, Y12, Y12
+ VPALIGNR $0x08, Y13, Y13, Y13
+ VPALIGNR $0x08, Y8, Y8, Y8
+ VPALIGNR $0x08, Y15, Y15, Y15
+ VPALIGNR $0x0c, Y4, Y4, Y4
+ VPALIGNR $0x0c, Y1, Y1, Y1
+ VPALIGNR $0x0c, Y2, Y2, Y2
+ VPALIGNR $0x0c, Y3, Y3, Y3
+ VPADDD Y14, Y0, Y0
+ VPADDD Y9, Y5, Y5
+ VPADDD Y10, Y6, Y6
+ VPADDD Y11, Y7, Y7
+ IMULQ R12, DX
+ ADDQ AX, R15
+ ADCQ DX, R8
+ VPXOR Y0, Y4, Y4
+ VPXOR Y5, Y1, Y1
+ VPXOR Y6, Y2, Y2
+ VPXOR Y7, Y3, Y3
+ VPSHUFB ·rol16<>+0(SB), Y4, Y4
+ VPSHUFB ·rol16<>+0(SB), Y1, Y1
+ VPSHUFB ·rol16<>+0(SB), Y2, Y2
+ VPSHUFB ·rol16<>+0(SB), Y3, Y3
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ VPADDD Y4, Y12, Y12
+ VPADDD Y1, Y13, Y13
+ VPADDD Y2, Y8, Y8
+ VPADDD Y3, Y15, Y15
+ VPXOR Y12, Y14, Y14
+ VPXOR Y13, Y9, Y9
+ VPXOR Y8, Y10, Y10
+ VPXOR Y15, Y11, Y11
+ ADDQ 32(SI)(CX*1), R10
+ ADCQ 40(SI)(CX*1), R11
+ ADCQ $0x01, R12
+ LEAQ 48(CX), CX
+ VMOVDQA Y15, 224(BP)
+ VPSLLD $0x0c, Y14, Y15
+ VPSRLD $0x14, Y14, Y14
+ VPXOR Y15, Y14, Y14
+ VPSLLD $0x0c, Y9, Y15
+ VPSRLD $0x14, Y9, Y9
+ VPXOR Y15, Y9, Y9
+ VPSLLD $0x0c, Y10, Y15
+ VPSRLD $0x14, Y10, Y10
+ VPXOR Y15, Y10, Y10
+ VPSLLD $0x0c, Y11, Y15
+ VPSRLD $0x14, Y11, Y11
+ VPXOR Y15, Y11, Y11
+ VMOVDQA 224(BP), Y15
+ MOVQ (BP), DX
+ MOVQ DX, R15
+ MULXQ R10, R13, R14
+ IMULQ R12, R15
+ MULXQ R11, AX, DX
+ ADDQ AX, R14
+ ADCQ DX, R15
+ VPADDD Y14, Y0, Y0
+ VPADDD Y9, Y5, Y5
+ VPADDD Y10, Y6, Y6
+ VPADDD Y11, Y7, Y7
+ VPXOR Y0, Y4, Y4
+ VPXOR Y5, Y1, Y1
+ VPXOR Y6, Y2, Y2
+ VPXOR Y7, Y3, Y3
+ MOVQ 8(BP), DX
+ MULXQ R10, R10, AX
+ ADDQ R10, R14
+ MULXQ R11, R11, R8
+ ADCQ R11, R15
+ ADCQ $0x00, R8
+ VPSHUFB ·rol8<>+0(SB), Y4, Y4
+ VPSHUFB ·rol8<>+0(SB), Y1, Y1
+ VPSHUFB ·rol8<>+0(SB), Y2, Y2
+ VPSHUFB ·rol8<>+0(SB), Y3, Y3
+ VPADDD Y4, Y12, Y12
+ VPADDD Y1, Y13, Y13
+ VPADDD Y2, Y8, Y8
+ VPADDD Y3, Y15, Y15
+ IMULQ R12, DX
+ ADDQ AX, R15
+ ADCQ DX, R8
+ VPXOR Y12, Y14, Y14
+ VPXOR Y13, Y9, Y9
+ VPXOR Y8, Y10, Y10
+ VPXOR Y15, Y11, Y11
+ VMOVDQA Y15, 224(BP)
+ VPSLLD $0x07, Y14, Y15
+ VPSRLD $0x19, Y14, Y14
+ VPXOR Y15, Y14, Y14
+ VPSLLD $0x07, Y9, Y15
+ VPSRLD $0x19, Y9, Y9
+ VPXOR Y15, Y9, Y9
+ VPSLLD $0x07, Y10, Y15
+ VPSRLD $0x19, Y10, Y10
+ VPXOR Y15, Y10, Y10
+ VPSLLD $0x07, Y11, Y15
+ VPSRLD $0x19, Y11, Y11
+ VPXOR Y15, Y11, Y11
+ VMOVDQA 224(BP), Y15
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ VPALIGNR $0x0c, Y14, Y14, Y14
+ VPALIGNR $0x0c, Y9, Y9, Y9
+ VPALIGNR $0x0c, Y10, Y10, Y10
+ VPALIGNR $0x0c, Y11, Y11, Y11
+ VPALIGNR $0x08, Y12, Y12, Y12
+ VPALIGNR $0x08, Y13, Y13, Y13
+ VPALIGNR $0x08, Y8, Y8, Y8
+ VPALIGNR $0x08, Y15, Y15, Y15
+ VPALIGNR $0x04, Y4, Y4, Y4
+ VPALIGNR $0x04, Y1, Y1, Y1
+ VPALIGNR $0x04, Y2, Y2, Y2
+ VPALIGNR $0x04, Y3, Y3, Y3
+ CMPQ CX, $0x000001e0
JNE openAVX2InternalLoop
-
- VPADDD ·chacha20Constants<>(SB), AA0, AA0; VPADDD ·chacha20Constants<>(SB), AA1, AA1; VPADDD ·chacha20Constants<>(SB), AA2, AA2; VPADDD ·chacha20Constants<>(SB), AA3, AA3
- VPADDD state1StoreAVX2, BB0, BB0; VPADDD state1StoreAVX2, BB1, BB1; VPADDD state1StoreAVX2, BB2, BB2; VPADDD state1StoreAVX2, BB3, BB3
- VPADDD state2StoreAVX2, CC0, CC0; VPADDD state2StoreAVX2, CC1, CC1; VPADDD state2StoreAVX2, CC2, CC2; VPADDD state2StoreAVX2, CC3, CC3
- VPADDD ctr0StoreAVX2, DD0, DD0; VPADDD ctr1StoreAVX2, DD1, DD1; VPADDD ctr2StoreAVX2, DD2, DD2; VPADDD ctr3StoreAVX2, DD3, DD3
- VMOVDQA CC3, tmpStoreAVX2
+ VPADDD ·chacha20Constants<>+0(SB), Y0, Y0
+ VPADDD ·chacha20Constants<>+0(SB), Y5, Y5
+ VPADDD ·chacha20Constants<>+0(SB), Y6, Y6
+ VPADDD ·chacha20Constants<>+0(SB), Y7, Y7
+ VPADDD 32(BP), Y14, Y14
+ VPADDD 32(BP), Y9, Y9
+ VPADDD 32(BP), Y10, Y10
+ VPADDD 32(BP), Y11, Y11
+ VPADDD 64(BP), Y12, Y12
+ VPADDD 64(BP), Y13, Y13
+ VPADDD 64(BP), Y8, Y8
+ VPADDD 64(BP), Y15, Y15
+ VPADDD 96(BP), Y4, Y4
+ VPADDD 128(BP), Y1, Y1
+ VPADDD 160(BP), Y2, Y2
+ VPADDD 192(BP), Y3, Y3
+ VMOVDQA Y15, 224(BP)
// We only hashed 480 of the 512 bytes available - hash the remaining 32 here
- polyAdd(480(inp))
- polyMulAVX2
- VPERM2I128 $0x02, AA0, BB0, CC3; VPERM2I128 $0x13, AA0, BB0, BB0; VPERM2I128 $0x02, CC0, DD0, AA0; VPERM2I128 $0x13, CC0, DD0, CC0
- VPXOR (0*32)(inp), CC3, CC3; VPXOR (1*32)(inp), AA0, AA0; VPXOR (2*32)(inp), BB0, BB0; VPXOR (3*32)(inp), CC0, CC0
- VMOVDQU CC3, (0*32)(oup); VMOVDQU AA0, (1*32)(oup); VMOVDQU BB0, (2*32)(oup); VMOVDQU CC0, (3*32)(oup)
- VPERM2I128 $0x02, AA1, BB1, AA0; VPERM2I128 $0x02, CC1, DD1, BB0; VPERM2I128 $0x13, AA1, BB1, CC0; VPERM2I128 $0x13, CC1, DD1, DD0
- VPXOR (4*32)(inp), AA0, AA0; VPXOR (5*32)(inp), BB0, BB0; VPXOR (6*32)(inp), CC0, CC0; VPXOR (7*32)(inp), DD0, DD0
- VMOVDQU AA0, (4*32)(oup); VMOVDQU BB0, (5*32)(oup); VMOVDQU CC0, (6*32)(oup); VMOVDQU DD0, (7*32)(oup)
+ ADDQ 480(SI), R10
+ ADCQ 488(SI), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), DX
+ MOVQ DX, R15
+ MULXQ R10, R13, R14
+ IMULQ R12, R15
+ MULXQ R11, AX, DX
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), DX
+ MULXQ R10, R10, AX
+ ADDQ R10, R14
+ MULXQ R11, R11, R8
+ ADCQ R11, R15
+ ADCQ $0x00, R8
+ IMULQ R12, DX
+ ADDQ AX, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ VPERM2I128 $0x02, Y0, Y14, Y15
+ VPERM2I128 $0x13, Y0, Y14, Y14
+ VPERM2I128 $0x02, Y12, Y4, Y0
+ VPERM2I128 $0x13, Y12, Y4, Y12
+ VPXOR (SI), Y15, Y15
+ VPXOR 32(SI), Y0, Y0
+ VPXOR 64(SI), Y14, Y14
+ VPXOR 96(SI), Y12, Y12
+ VMOVDQU Y15, (DI)
+ VMOVDQU Y0, 32(DI)
+ VMOVDQU Y14, 64(DI)
+ VMOVDQU Y12, 96(DI)
+ VPERM2I128 $0x02, Y5, Y9, Y0
+ VPERM2I128 $0x02, Y13, Y1, Y14
+ VPERM2I128 $0x13, Y5, Y9, Y12
+ VPERM2I128 $0x13, Y13, Y1, Y4
+ VPXOR 128(SI), Y0, Y0
+ VPXOR 160(SI), Y14, Y14
+ VPXOR 192(SI), Y12, Y12
+ VPXOR 224(SI), Y4, Y4
+ VMOVDQU Y0, 128(DI)
+ VMOVDQU Y14, 160(DI)
+ VMOVDQU Y12, 192(DI)
+ VMOVDQU Y4, 224(DI)
// and here
- polyAdd(496(inp))
- polyMulAVX2
- VPERM2I128 $0x02, AA2, BB2, AA0; VPERM2I128 $0x02, CC2, DD2, BB0; VPERM2I128 $0x13, AA2, BB2, CC0; VPERM2I128 $0x13, CC2, DD2, DD0
- VPXOR (8*32)(inp), AA0, AA0; VPXOR (9*32)(inp), BB0, BB0; VPXOR (10*32)(inp), CC0, CC0; VPXOR (11*32)(inp), DD0, DD0
- VMOVDQU AA0, (8*32)(oup); VMOVDQU BB0, (9*32)(oup); VMOVDQU CC0, (10*32)(oup); VMOVDQU DD0, (11*32)(oup)
- VPERM2I128 $0x02, AA3, BB3, AA0; VPERM2I128 $0x02, tmpStoreAVX2, DD3, BB0; VPERM2I128 $0x13, AA3, BB3, CC0; VPERM2I128 $0x13, tmpStoreAVX2, DD3, DD0
- VPXOR (12*32)(inp), AA0, AA0; VPXOR (13*32)(inp), BB0, BB0; VPXOR (14*32)(inp), CC0, CC0; VPXOR (15*32)(inp), DD0, DD0
- VMOVDQU AA0, (12*32)(oup); VMOVDQU BB0, (13*32)(oup); VMOVDQU CC0, (14*32)(oup); VMOVDQU DD0, (15*32)(oup)
- LEAQ (32*16)(inp), inp
- LEAQ (32*16)(oup), oup
- SUBQ $(32*16), inl
+ ADDQ 496(SI), R10
+ ADCQ 504(SI), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), DX
+ MOVQ DX, R15
+ MULXQ R10, R13, R14
+ IMULQ R12, R15
+ MULXQ R11, AX, DX
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), DX
+ MULXQ R10, R10, AX
+ ADDQ R10, R14
+ MULXQ R11, R11, R8
+ ADCQ R11, R15
+ ADCQ $0x00, R8
+ IMULQ R12, DX
+ ADDQ AX, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ VPERM2I128 $0x02, Y6, Y10, Y0
+ VPERM2I128 $0x02, Y8, Y2, Y14
+ VPERM2I128 $0x13, Y6, Y10, Y12
+ VPERM2I128 $0x13, Y8, Y2, Y4
+ VPXOR 256(SI), Y0, Y0
+ VPXOR 288(SI), Y14, Y14
+ VPXOR 320(SI), Y12, Y12
+ VPXOR 352(SI), Y4, Y4
+ VMOVDQU Y0, 256(DI)
+ VMOVDQU Y14, 288(DI)
+ VMOVDQU Y12, 320(DI)
+ VMOVDQU Y4, 352(DI)
+ VPERM2I128 $0x02, Y7, Y11, Y0
+ VPERM2I128 $0x02, 224(BP), Y3, Y14
+ VPERM2I128 $0x13, Y7, Y11, Y12
+ VPERM2I128 $0x13, 224(BP), Y3, Y4
+ VPXOR 384(SI), Y0, Y0
+ VPXOR 416(SI), Y14, Y14
+ VPXOR 448(SI), Y12, Y12
+ VPXOR 480(SI), Y4, Y4
+ VMOVDQU Y0, 384(DI)
+ VMOVDQU Y14, 416(DI)
+ VMOVDQU Y12, 448(DI)
+ VMOVDQU Y4, 480(DI)
+ LEAQ 512(SI), SI
+ LEAQ 512(DI), DI
+ SUBQ $0x00000200, BX
JMP openAVX2MainLoop
openAVX2MainLoopDone:
// Handle the various tail sizes efficiently
- TESTQ inl, inl
+ TESTQ BX, BX
JE openSSEFinalize
- CMPQ inl, $128
+ CMPQ BX, $0x80
JBE openAVX2Tail128
- CMPQ inl, $256
+ CMPQ BX, $0x00000100
JBE openAVX2Tail256
- CMPQ inl, $384
+ CMPQ BX, $0x00000180
JBE openAVX2Tail384
JMP openAVX2Tail512
-// ----------------------------------------------------------------------------
-// Special optimization for buffers smaller than 193 bytes
openAVX2192:
- // For up to 192 bytes of ciphertext and 64 bytes for the poly key, we process four blocks
- VMOVDQA AA0, AA1
- VMOVDQA BB0, BB1
- VMOVDQA CC0, CC1
- VPADDD ·avx2IncMask<>(SB), DD0, DD1
- VMOVDQA AA0, AA2
- VMOVDQA BB0, BB2
- VMOVDQA CC0, CC2
- VMOVDQA DD0, DD2
- VMOVDQA DD1, TT3
- MOVQ $10, itr2
+ VMOVDQA Y0, Y5
+ VMOVDQA Y14, Y9
+ VMOVDQA Y12, Y13
+ VPADDD ·avx2IncMask<>+0(SB), Y4, Y1
+ VMOVDQA Y0, Y6
+ VMOVDQA Y14, Y10
+ VMOVDQA Y12, Y8
+ VMOVDQA Y4, Y2
+ VMOVDQA Y1, Y15
+ MOVQ $0x0000000a, R9
openAVX2192InnerCipherLoop:
- chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0)
- VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $4, BB1, BB1, BB1
- VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1
- VPALIGNR $12, DD0, DD0, DD0; VPALIGNR $12, DD1, DD1, DD1
- chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0)
- VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $12, BB1, BB1, BB1
- VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1
- VPALIGNR $4, DD0, DD0, DD0; VPALIGNR $4, DD1, DD1, DD1
- DECQ itr2
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol16<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x0c, Y14, Y3
+ VPSRLD $0x14, Y14, Y14
+ VPXOR Y3, Y14, Y14
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol8<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x07, Y14, Y3
+ VPSRLD $0x19, Y14, Y14
+ VPXOR Y3, Y14, Y14
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol16<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x0c, Y9, Y3
+ VPSRLD $0x14, Y9, Y9
+ VPXOR Y3, Y9, Y9
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol8<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x07, Y9, Y3
+ VPSRLD $0x19, Y9, Y9
+ VPXOR Y3, Y9, Y9
+ VPALIGNR $0x04, Y14, Y14, Y14
+ VPALIGNR $0x04, Y9, Y9, Y9
+ VPALIGNR $0x08, Y12, Y12, Y12
+ VPALIGNR $0x08, Y13, Y13, Y13
+ VPALIGNR $0x0c, Y4, Y4, Y4
+ VPALIGNR $0x0c, Y1, Y1, Y1
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol16<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x0c, Y14, Y3
+ VPSRLD $0x14, Y14, Y14
+ VPXOR Y3, Y14, Y14
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol8<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x07, Y14, Y3
+ VPSRLD $0x19, Y14, Y14
+ VPXOR Y3, Y14, Y14
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol16<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x0c, Y9, Y3
+ VPSRLD $0x14, Y9, Y9
+ VPXOR Y3, Y9, Y9
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol8<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x07, Y9, Y3
+ VPSRLD $0x19, Y9, Y9
+ VPXOR Y3, Y9, Y9
+ VPALIGNR $0x0c, Y14, Y14, Y14
+ VPALIGNR $0x0c, Y9, Y9, Y9
+ VPALIGNR $0x08, Y12, Y12, Y12
+ VPALIGNR $0x08, Y13, Y13, Y13
+ VPALIGNR $0x04, Y4, Y4, Y4
+ VPALIGNR $0x04, Y1, Y1, Y1
+ DECQ R9
JNE openAVX2192InnerCipherLoop
- VPADDD AA2, AA0, AA0; VPADDD AA2, AA1, AA1
- VPADDD BB2, BB0, BB0; VPADDD BB2, BB1, BB1
- VPADDD CC2, CC0, CC0; VPADDD CC2, CC1, CC1
- VPADDD DD2, DD0, DD0; VPADDD TT3, DD1, DD1
- VPERM2I128 $0x02, AA0, BB0, TT0
+ VPADDD Y6, Y0, Y0
+ VPADDD Y6, Y5, Y5
+ VPADDD Y10, Y14, Y14
+ VPADDD Y10, Y9, Y9
+ VPADDD Y8, Y12, Y12
+ VPADDD Y8, Y13, Y13
+ VPADDD Y2, Y4, Y4
+ VPADDD Y15, Y1, Y1
+ VPERM2I128 $0x02, Y0, Y14, Y3
// Clamp and store poly key
- VPAND ·polyClampMask<>(SB), TT0, TT0
- VMOVDQA TT0, rsStoreAVX2
+ VPAND ·polyClampMask<>+0(SB), Y3, Y3
+ VMOVDQA Y3, (BP)
// Stream for up to 192 bytes
- VPERM2I128 $0x13, AA0, BB0, AA0
- VPERM2I128 $0x13, CC0, DD0, BB0
- VPERM2I128 $0x02, AA1, BB1, CC0
- VPERM2I128 $0x02, CC1, DD1, DD0
- VPERM2I128 $0x13, AA1, BB1, AA1
- VPERM2I128 $0x13, CC1, DD1, BB1
+ VPERM2I128 $0x13, Y0, Y14, Y0
+ VPERM2I128 $0x13, Y12, Y4, Y14
+ VPERM2I128 $0x02, Y5, Y9, Y12
+ VPERM2I128 $0x02, Y13, Y1, Y4
+ VPERM2I128 $0x13, Y5, Y9, Y5
+ VPERM2I128 $0x13, Y13, Y1, Y9
openAVX2ShortOpen:
// Hash
- MOVQ ad_len+80(FP), itr2
+ MOVQ ad_len+80(FP), R9
CALL polyHashADInternal<>(SB)
openAVX2ShortOpenLoop:
- CMPQ inl, $32
+ CMPQ BX, $0x20
JB openAVX2ShortTail32
- SUBQ $32, inl
+ SUBQ $0x20, BX
// Load for hashing
- polyAdd(0*8(inp))
- polyMulAVX2
- polyAdd(2*8(inp))
- polyMulAVX2
+ ADDQ (SI), R10
+ ADCQ 8(SI), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), DX
+ MOVQ DX, R15
+ MULXQ R10, R13, R14
+ IMULQ R12, R15
+ MULXQ R11, AX, DX
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), DX
+ MULXQ R10, R10, AX
+ ADDQ R10, R14
+ MULXQ R11, R11, R8
+ ADCQ R11, R15
+ ADCQ $0x00, R8
+ IMULQ R12, DX
+ ADDQ AX, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ ADDQ 16(SI), R10
+ ADCQ 24(SI), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), DX
+ MOVQ DX, R15
+ MULXQ R10, R13, R14
+ IMULQ R12, R15
+ MULXQ R11, AX, DX
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), DX
+ MULXQ R10, R10, AX
+ ADDQ R10, R14
+ MULXQ R11, R11, R8
+ ADCQ R11, R15
+ ADCQ $0x00, R8
+ IMULQ R12, DX
+ ADDQ AX, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
// Load for decryption
- VPXOR (inp), AA0, AA0
- VMOVDQU AA0, (oup)
- LEAQ (1*32)(inp), inp
- LEAQ (1*32)(oup), oup
+ VPXOR (SI), Y0, Y0
+ VMOVDQU Y0, (DI)
+ LEAQ 32(SI), SI
+ LEAQ 32(DI), DI
// Shift stream left
- VMOVDQA BB0, AA0
- VMOVDQA CC0, BB0
- VMOVDQA DD0, CC0
- VMOVDQA AA1, DD0
- VMOVDQA BB1, AA1
- VMOVDQA CC1, BB1
- VMOVDQA DD1, CC1
- VMOVDQA AA2, DD1
- VMOVDQA BB2, AA2
+ VMOVDQA Y14, Y0
+ VMOVDQA Y12, Y14
+ VMOVDQA Y4, Y12
+ VMOVDQA Y5, Y4
+ VMOVDQA Y9, Y5
+ VMOVDQA Y13, Y9
+ VMOVDQA Y1, Y13
+ VMOVDQA Y6, Y1
+ VMOVDQA Y10, Y6
JMP openAVX2ShortOpenLoop
openAVX2ShortTail32:
- CMPQ inl, $16
- VMOVDQA A0, A1
+ CMPQ BX, $0x10
+ VMOVDQA X0, X1
JB openAVX2ShortDone
-
- SUBQ $16, inl
+ SUBQ $0x10, BX
// Load for hashing
- polyAdd(0*8(inp))
- polyMulAVX2
+ ADDQ (SI), R10
+ ADCQ 8(SI), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), DX
+ MOVQ DX, R15
+ MULXQ R10, R13, R14
+ IMULQ R12, R15
+ MULXQ R11, AX, DX
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), DX
+ MULXQ R10, R10, AX
+ ADDQ R10, R14
+ MULXQ R11, R11, R8
+ ADCQ R11, R15
+ ADCQ $0x00, R8
+ IMULQ R12, DX
+ ADDQ AX, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
// Load for decryption
- VPXOR (inp), A0, T0
- VMOVDQU T0, (oup)
- LEAQ (1*16)(inp), inp
- LEAQ (1*16)(oup), oup
- VPERM2I128 $0x11, AA0, AA0, AA0
- VMOVDQA A0, A1
+ VPXOR (SI), X0, X12
+ VMOVDQU X12, (DI)
+ LEAQ 16(SI), SI
+ LEAQ 16(DI), DI
+ VPERM2I128 $0x11, Y0, Y0, Y0
+ VMOVDQA X0, X1
openAVX2ShortDone:
VZEROUPPER
JMP openSSETail16
-// ----------------------------------------------------------------------------
-// Special optimization for buffers smaller than 321 bytes
openAVX2320:
- // For up to 320 bytes of ciphertext and 64 bytes for the poly key, we process six blocks
- VMOVDQA AA0, AA1; VMOVDQA BB0, BB1; VMOVDQA CC0, CC1; VPADDD ·avx2IncMask<>(SB), DD0, DD1
- VMOVDQA AA0, AA2; VMOVDQA BB0, BB2; VMOVDQA CC0, CC2; VPADDD ·avx2IncMask<>(SB), DD1, DD2
- VMOVDQA BB0, TT1; VMOVDQA CC0, TT2; VMOVDQA DD0, TT3
- MOVQ $10, itr2
+ VMOVDQA Y0, Y5
+ VMOVDQA Y14, Y9
+ VMOVDQA Y12, Y13
+ VPADDD ·avx2IncMask<>+0(SB), Y4, Y1
+ VMOVDQA Y0, Y6
+ VMOVDQA Y14, Y10
+ VMOVDQA Y12, Y8
+ VPADDD ·avx2IncMask<>+0(SB), Y1, Y2
+ VMOVDQA Y14, Y7
+ VMOVDQA Y12, Y11
+ VMOVDQA Y4, Y15
+ MOVQ $0x0000000a, R9
openAVX2320InnerCipherLoop:
- chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0); chachaQR_AVX2(AA2, BB2, CC2, DD2, TT0)
- VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $4, BB1, BB1, BB1; VPALIGNR $4, BB2, BB2, BB2
- VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2
- VPALIGNR $12, DD0, DD0, DD0; VPALIGNR $12, DD1, DD1, DD1; VPALIGNR $12, DD2, DD2, DD2
- chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0); chachaQR_AVX2(AA2, BB2, CC2, DD2, TT0)
- VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $12, BB1, BB1, BB1; VPALIGNR $12, BB2, BB2, BB2
- VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2
- VPALIGNR $4, DD0, DD0, DD0; VPALIGNR $4, DD1, DD1, DD1; VPALIGNR $4, DD2, DD2, DD2
- DECQ itr2
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol16<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x0c, Y14, Y3
+ VPSRLD $0x14, Y14, Y14
+ VPXOR Y3, Y14, Y14
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol8<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x07, Y14, Y3
+ VPSRLD $0x19, Y14, Y14
+ VPXOR Y3, Y14, Y14
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol16<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x0c, Y9, Y3
+ VPSRLD $0x14, Y9, Y9
+ VPXOR Y3, Y9, Y9
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol8<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x07, Y9, Y3
+ VPSRLD $0x19, Y9, Y9
+ VPXOR Y3, Y9, Y9
+ VPADDD Y10, Y6, Y6
+ VPXOR Y6, Y2, Y2
+ VPSHUFB ·rol16<>+0(SB), Y2, Y2
+ VPADDD Y2, Y8, Y8
+ VPXOR Y8, Y10, Y10
+ VPSLLD $0x0c, Y10, Y3
+ VPSRLD $0x14, Y10, Y10
+ VPXOR Y3, Y10, Y10
+ VPADDD Y10, Y6, Y6
+ VPXOR Y6, Y2, Y2
+ VPSHUFB ·rol8<>+0(SB), Y2, Y2
+ VPADDD Y2, Y8, Y8
+ VPXOR Y8, Y10, Y10
+ VPSLLD $0x07, Y10, Y3
+ VPSRLD $0x19, Y10, Y10
+ VPXOR Y3, Y10, Y10
+ VPALIGNR $0x04, Y14, Y14, Y14
+ VPALIGNR $0x04, Y9, Y9, Y9
+ VPALIGNR $0x04, Y10, Y10, Y10
+ VPALIGNR $0x08, Y12, Y12, Y12
+ VPALIGNR $0x08, Y13, Y13, Y13
+ VPALIGNR $0x08, Y8, Y8, Y8
+ VPALIGNR $0x0c, Y4, Y4, Y4
+ VPALIGNR $0x0c, Y1, Y1, Y1
+ VPALIGNR $0x0c, Y2, Y2, Y2
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol16<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x0c, Y14, Y3
+ VPSRLD $0x14, Y14, Y14
+ VPXOR Y3, Y14, Y14
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol8<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x07, Y14, Y3
+ VPSRLD $0x19, Y14, Y14
+ VPXOR Y3, Y14, Y14
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol16<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x0c, Y9, Y3
+ VPSRLD $0x14, Y9, Y9
+ VPXOR Y3, Y9, Y9
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol8<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x07, Y9, Y3
+ VPSRLD $0x19, Y9, Y9
+ VPXOR Y3, Y9, Y9
+ VPADDD Y10, Y6, Y6
+ VPXOR Y6, Y2, Y2
+ VPSHUFB ·rol16<>+0(SB), Y2, Y2
+ VPADDD Y2, Y8, Y8
+ VPXOR Y8, Y10, Y10
+ VPSLLD $0x0c, Y10, Y3
+ VPSRLD $0x14, Y10, Y10
+ VPXOR Y3, Y10, Y10
+ VPADDD Y10, Y6, Y6
+ VPXOR Y6, Y2, Y2
+ VPSHUFB ·rol8<>+0(SB), Y2, Y2
+ VPADDD Y2, Y8, Y8
+ VPXOR Y8, Y10, Y10
+ VPSLLD $0x07, Y10, Y3
+ VPSRLD $0x19, Y10, Y10
+ VPXOR Y3, Y10, Y10
+ VPALIGNR $0x0c, Y14, Y14, Y14
+ VPALIGNR $0x0c, Y9, Y9, Y9
+ VPALIGNR $0x0c, Y10, Y10, Y10
+ VPALIGNR $0x08, Y12, Y12, Y12
+ VPALIGNR $0x08, Y13, Y13, Y13
+ VPALIGNR $0x08, Y8, Y8, Y8
+ VPALIGNR $0x04, Y4, Y4, Y4
+ VPALIGNR $0x04, Y1, Y1, Y1
+ VPALIGNR $0x04, Y2, Y2, Y2
+ DECQ R9
JNE openAVX2320InnerCipherLoop
-
- VMOVDQA ·chacha20Constants<>(SB), TT0
- VPADDD TT0, AA0, AA0; VPADDD TT0, AA1, AA1; VPADDD TT0, AA2, AA2
- VPADDD TT1, BB0, BB0; VPADDD TT1, BB1, BB1; VPADDD TT1, BB2, BB2
- VPADDD TT2, CC0, CC0; VPADDD TT2, CC1, CC1; VPADDD TT2, CC2, CC2
- VMOVDQA ·avx2IncMask<>(SB), TT0
- VPADDD TT3, DD0, DD0; VPADDD TT0, TT3, TT3
- VPADDD TT3, DD1, DD1; VPADDD TT0, TT3, TT3
- VPADDD TT3, DD2, DD2
+ VMOVDQA ·chacha20Constants<>+0(SB), Y3
+ VPADDD Y3, Y0, Y0
+ VPADDD Y3, Y5, Y5
+ VPADDD Y3, Y6, Y6
+ VPADDD Y7, Y14, Y14
+ VPADDD Y7, Y9, Y9
+ VPADDD Y7, Y10, Y10
+ VPADDD Y11, Y12, Y12
+ VPADDD Y11, Y13, Y13
+ VPADDD Y11, Y8, Y8
+ VMOVDQA ·avx2IncMask<>+0(SB), Y3
+ VPADDD Y15, Y4, Y4
+ VPADDD Y3, Y15, Y15
+ VPADDD Y15, Y1, Y1
+ VPADDD Y3, Y15, Y15
+ VPADDD Y15, Y2, Y2
// Clamp and store poly key
- VPERM2I128 $0x02, AA0, BB0, TT0
- VPAND ·polyClampMask<>(SB), TT0, TT0
- VMOVDQA TT0, rsStoreAVX2
+ VPERM2I128 $0x02, Y0, Y14, Y3
+ VPAND ·polyClampMask<>+0(SB), Y3, Y3
+ VMOVDQA Y3, (BP)
// Stream for up to 320 bytes
- VPERM2I128 $0x13, AA0, BB0, AA0
- VPERM2I128 $0x13, CC0, DD0, BB0
- VPERM2I128 $0x02, AA1, BB1, CC0
- VPERM2I128 $0x02, CC1, DD1, DD0
- VPERM2I128 $0x13, AA1, BB1, AA1
- VPERM2I128 $0x13, CC1, DD1, BB1
- VPERM2I128 $0x02, AA2, BB2, CC1
- VPERM2I128 $0x02, CC2, DD2, DD1
- VPERM2I128 $0x13, AA2, BB2, AA2
- VPERM2I128 $0x13, CC2, DD2, BB2
+ VPERM2I128 $0x13, Y0, Y14, Y0
+ VPERM2I128 $0x13, Y12, Y4, Y14
+ VPERM2I128 $0x02, Y5, Y9, Y12
+ VPERM2I128 $0x02, Y13, Y1, Y4
+ VPERM2I128 $0x13, Y5, Y9, Y5
+ VPERM2I128 $0x13, Y13, Y1, Y9
+ VPERM2I128 $0x02, Y6, Y10, Y13
+ VPERM2I128 $0x02, Y8, Y2, Y1
+ VPERM2I128 $0x13, Y6, Y10, Y6
+ VPERM2I128 $0x13, Y8, Y2, Y10
JMP openAVX2ShortOpen
-// ----------------------------------------------------------------------------
-// Special optimization for the last 128 bytes of ciphertext
openAVX2Tail128:
// Need to decrypt up to 128 bytes - prepare two blocks
- VMOVDQA ·chacha20Constants<>(SB), AA1
- VMOVDQA state1StoreAVX2, BB1
- VMOVDQA state2StoreAVX2, CC1
- VMOVDQA ctr3StoreAVX2, DD1
- VPADDD ·avx2IncMask<>(SB), DD1, DD1
- VMOVDQA DD1, DD0
-
- XORQ itr2, itr2
- MOVQ inl, itr1
- ANDQ $-16, itr1
- TESTQ itr1, itr1
- JE openAVX2Tail128LoopB
+ VMOVDQA ·chacha20Constants<>+0(SB), Y5
+ VMOVDQA 32(BP), Y9
+ VMOVDQA 64(BP), Y13
+ VMOVDQA 192(BP), Y1
+ VPADDD ·avx2IncMask<>+0(SB), Y1, Y1
+ VMOVDQA Y1, Y4
+ XORQ R9, R9
+ MOVQ BX, CX
+ ANDQ $-16, CX
+ TESTQ CX, CX
+ JE openAVX2Tail128LoopB
openAVX2Tail128LoopA:
- // Perform ChaCha rounds, while hashing the remaining input
- polyAdd(0(inp)(itr2*1))
- polyMulAVX2
+ ADDQ (SI)(R9*1), R10
+ ADCQ 8(SI)(R9*1), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), DX
+ MOVQ DX, R15
+ MULXQ R10, R13, R14
+ IMULQ R12, R15
+ MULXQ R11, AX, DX
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), DX
+ MULXQ R10, R10, AX
+ ADDQ R10, R14
+ MULXQ R11, R11, R8
+ ADCQ R11, R15
+ ADCQ $0x00, R8
+ IMULQ R12, DX
+ ADDQ AX, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
openAVX2Tail128LoopB:
- ADDQ $16, itr2
- chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0)
- VPALIGNR $4, BB1, BB1, BB1
- VPALIGNR $8, CC1, CC1, CC1
- VPALIGNR $12, DD1, DD1, DD1
- chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0)
- VPALIGNR $12, BB1, BB1, BB1
- VPALIGNR $8, CC1, CC1, CC1
- VPALIGNR $4, DD1, DD1, DD1
- CMPQ itr2, itr1
- JB openAVX2Tail128LoopA
- CMPQ itr2, $160
- JNE openAVX2Tail128LoopB
-
- VPADDD ·chacha20Constants<>(SB), AA1, AA1
- VPADDD state1StoreAVX2, BB1, BB1
- VPADDD state2StoreAVX2, CC1, CC1
- VPADDD DD0, DD1, DD1
- VPERM2I128 $0x02, AA1, BB1, AA0; VPERM2I128 $0x02, CC1, DD1, BB0; VPERM2I128 $0x13, AA1, BB1, CC0; VPERM2I128 $0x13, CC1, DD1, DD0
+ ADDQ $0x10, R9
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol16<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x0c, Y9, Y3
+ VPSRLD $0x14, Y9, Y9
+ VPXOR Y3, Y9, Y9
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol8<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x07, Y9, Y3
+ VPSRLD $0x19, Y9, Y9
+ VPXOR Y3, Y9, Y9
+ VPALIGNR $0x04, Y9, Y9, Y9
+ VPALIGNR $0x08, Y13, Y13, Y13
+ VPALIGNR $0x0c, Y1, Y1, Y1
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol16<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x0c, Y9, Y3
+ VPSRLD $0x14, Y9, Y9
+ VPXOR Y3, Y9, Y9
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol8<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x07, Y9, Y3
+ VPSRLD $0x19, Y9, Y9
+ VPXOR Y3, Y9, Y9
+ VPALIGNR $0x0c, Y9, Y9, Y9
+ VPALIGNR $0x08, Y13, Y13, Y13
+ VPALIGNR $0x04, Y1, Y1, Y1
+ CMPQ R9, CX
+ JB openAVX2Tail128LoopA
+ CMPQ R9, $0xa0
+ JNE openAVX2Tail128LoopB
+ VPADDD ·chacha20Constants<>+0(SB), Y5, Y5
+ VPADDD 32(BP), Y9, Y9
+ VPADDD 64(BP), Y13, Y13
+ VPADDD Y4, Y1, Y1
+ VPERM2I128 $0x02, Y5, Y9, Y0
+ VPERM2I128 $0x02, Y13, Y1, Y14
+ VPERM2I128 $0x13, Y5, Y9, Y12
+ VPERM2I128 $0x13, Y13, Y1, Y4
openAVX2TailLoop:
- CMPQ inl, $32
+ CMPQ BX, $0x20
JB openAVX2Tail
- SUBQ $32, inl
+ SUBQ $0x20, BX
// Load for decryption
- VPXOR (inp), AA0, AA0
- VMOVDQU AA0, (oup)
- LEAQ (1*32)(inp), inp
- LEAQ (1*32)(oup), oup
- VMOVDQA BB0, AA0
- VMOVDQA CC0, BB0
- VMOVDQA DD0, CC0
+ VPXOR (SI), Y0, Y0
+ VMOVDQU Y0, (DI)
+ LEAQ 32(SI), SI
+ LEAQ 32(DI), DI
+ VMOVDQA Y14, Y0
+ VMOVDQA Y12, Y14
+ VMOVDQA Y4, Y12
JMP openAVX2TailLoop
openAVX2Tail:
- CMPQ inl, $16
- VMOVDQA A0, A1
+ CMPQ BX, $0x10
+ VMOVDQA X0, X1
JB openAVX2TailDone
- SUBQ $16, inl
+ SUBQ $0x10, BX
// Load for decryption
- VPXOR (inp), A0, T0
- VMOVDQU T0, (oup)
- LEAQ (1*16)(inp), inp
- LEAQ (1*16)(oup), oup
- VPERM2I128 $0x11, AA0, AA0, AA0
- VMOVDQA A0, A1
+ VPXOR (SI), X0, X12
+ VMOVDQU X12, (DI)
+ LEAQ 16(SI), SI
+ LEAQ 16(DI), DI
+ VPERM2I128 $0x11, Y0, Y0, Y0
+ VMOVDQA X0, X1
openAVX2TailDone:
VZEROUPPER
JMP openSSETail16
-// ----------------------------------------------------------------------------
-// Special optimization for the last 256 bytes of ciphertext
openAVX2Tail256:
- // Need to decrypt up to 256 bytes - prepare four blocks
- VMOVDQA ·chacha20Constants<>(SB), AA0; VMOVDQA AA0, AA1
- VMOVDQA state1StoreAVX2, BB0; VMOVDQA BB0, BB1
- VMOVDQA state2StoreAVX2, CC0; VMOVDQA CC0, CC1
- VMOVDQA ctr3StoreAVX2, DD0
- VPADDD ·avx2IncMask<>(SB), DD0, DD0
- VPADDD ·avx2IncMask<>(SB), DD0, DD1
- VMOVDQA DD0, TT1
- VMOVDQA DD1, TT2
+ VMOVDQA ·chacha20Constants<>+0(SB), Y0
+ VMOVDQA Y0, Y5
+ VMOVDQA 32(BP), Y14
+ VMOVDQA Y14, Y9
+ VMOVDQA 64(BP), Y12
+ VMOVDQA Y12, Y13
+ VMOVDQA 192(BP), Y4
+ VPADDD ·avx2IncMask<>+0(SB), Y4, Y4
+ VPADDD ·avx2IncMask<>+0(SB), Y4, Y1
+ VMOVDQA Y4, Y7
+ VMOVDQA Y1, Y11
// Compute the number of iterations that will hash data
- MOVQ inl, tmpStoreAVX2
- MOVQ inl, itr1
- SUBQ $128, itr1
- SHRQ $4, itr1
- MOVQ $10, itr2
- CMPQ itr1, $10
- CMOVQGT itr2, itr1
- MOVQ inp, inl
- XORQ itr2, itr2
+ MOVQ BX, 224(BP)
+ MOVQ BX, CX
+ SUBQ $0x80, CX
+ SHRQ $0x04, CX
+ MOVQ $0x0000000a, R9
+ CMPQ CX, $0x0a
+ CMOVQGT R9, CX
+ MOVQ SI, BX
+ XORQ R9, R9
openAVX2Tail256LoopA:
- polyAdd(0(inl))
- polyMulAVX2
- LEAQ 16(inl), inl
+ ADDQ (BX), R10
+ ADCQ 8(BX), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), DX
+ MOVQ DX, R15
+ MULXQ R10, R13, R14
+ IMULQ R12, R15
+ MULXQ R11, AX, DX
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), DX
+ MULXQ R10, R10, AX
+ ADDQ R10, R14
+ MULXQ R11, R11, R8
+ ADCQ R11, R15
+ ADCQ $0x00, R8
+ IMULQ R12, DX
+ ADDQ AX, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ LEAQ 16(BX), BX
- // Perform ChaCha rounds, while hashing the remaining input
openAVX2Tail256LoopB:
- chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0)
- VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $4, BB1, BB1, BB1
- VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1
- VPALIGNR $12, DD0, DD0, DD0; VPALIGNR $12, DD1, DD1, DD1
- INCQ itr2
- chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0)
- VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $12, BB1, BB1, BB1
- VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1
- VPALIGNR $4, DD0, DD0, DD0; VPALIGNR $4, DD1, DD1, DD1
- CMPQ itr2, itr1
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol16<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x0c, Y14, Y3
+ VPSRLD $0x14, Y14, Y14
+ VPXOR Y3, Y14, Y14
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol8<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x07, Y14, Y3
+ VPSRLD $0x19, Y14, Y14
+ VPXOR Y3, Y14, Y14
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol16<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x0c, Y9, Y3
+ VPSRLD $0x14, Y9, Y9
+ VPXOR Y3, Y9, Y9
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol8<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x07, Y9, Y3
+ VPSRLD $0x19, Y9, Y9
+ VPXOR Y3, Y9, Y9
+ VPALIGNR $0x04, Y14, Y14, Y14
+ VPALIGNR $0x04, Y9, Y9, Y9
+ VPALIGNR $0x08, Y12, Y12, Y12
+ VPALIGNR $0x08, Y13, Y13, Y13
+ VPALIGNR $0x0c, Y4, Y4, Y4
+ VPALIGNR $0x0c, Y1, Y1, Y1
+ INCQ R9
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol16<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x0c, Y14, Y3
+ VPSRLD $0x14, Y14, Y14
+ VPXOR Y3, Y14, Y14
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol8<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x07, Y14, Y3
+ VPSRLD $0x19, Y14, Y14
+ VPXOR Y3, Y14, Y14
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol16<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x0c, Y9, Y3
+ VPSRLD $0x14, Y9, Y9
+ VPXOR Y3, Y9, Y9
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol8<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x07, Y9, Y3
+ VPSRLD $0x19, Y9, Y9
+ VPXOR Y3, Y9, Y9
+ VPALIGNR $0x0c, Y14, Y14, Y14
+ VPALIGNR $0x0c, Y9, Y9, Y9
+ VPALIGNR $0x08, Y12, Y12, Y12
+ VPALIGNR $0x08, Y13, Y13, Y13
+ VPALIGNR $0x04, Y4, Y4, Y4
+ VPALIGNR $0x04, Y1, Y1, Y1
+ CMPQ R9, CX
JB openAVX2Tail256LoopA
+ CMPQ R9, $0x0a
+ JNE openAVX2Tail256LoopB
+ MOVQ BX, R9
+ SUBQ SI, BX
+ MOVQ BX, CX
+ MOVQ 224(BP), BX
- CMPQ itr2, $10
- JNE openAVX2Tail256LoopB
-
- MOVQ inl, itr2
- SUBQ inp, inl
- MOVQ inl, itr1
- MOVQ tmpStoreAVX2, inl
-
- // Hash the remainder of data (if any)
openAVX2Tail256Hash:
- ADDQ $16, itr1
- CMPQ itr1, inl
- JGT openAVX2Tail256HashEnd
- polyAdd (0(itr2))
- polyMulAVX2
- LEAQ 16(itr2), itr2
- JMP openAVX2Tail256Hash
-
-// Store 128 bytes safely, then go to store loop
+ ADDQ $0x10, CX
+ CMPQ CX, BX
+ JGT openAVX2Tail256HashEnd
+ ADDQ (R9), R10
+ ADCQ 8(R9), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), DX
+ MOVQ DX, R15
+ MULXQ R10, R13, R14
+ IMULQ R12, R15
+ MULXQ R11, AX, DX
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), DX
+ MULXQ R10, R10, AX
+ ADDQ R10, R14
+ MULXQ R11, R11, R8
+ ADCQ R11, R15
+ ADCQ $0x00, R8
+ IMULQ R12, DX
+ ADDQ AX, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ LEAQ 16(R9), R9
+ JMP openAVX2Tail256Hash
+
openAVX2Tail256HashEnd:
- VPADDD ·chacha20Constants<>(SB), AA0, AA0; VPADDD ·chacha20Constants<>(SB), AA1, AA1
- VPADDD state1StoreAVX2, BB0, BB0; VPADDD state1StoreAVX2, BB1, BB1
- VPADDD state2StoreAVX2, CC0, CC0; VPADDD state2StoreAVX2, CC1, CC1
- VPADDD TT1, DD0, DD0; VPADDD TT2, DD1, DD1
- VPERM2I128 $0x02, AA0, BB0, AA2; VPERM2I128 $0x02, CC0, DD0, BB2; VPERM2I128 $0x13, AA0, BB0, CC2; VPERM2I128 $0x13, CC0, DD0, DD2
- VPERM2I128 $0x02, AA1, BB1, AA0; VPERM2I128 $0x02, CC1, DD1, BB0; VPERM2I128 $0x13, AA1, BB1, CC0; VPERM2I128 $0x13, CC1, DD1, DD0
-
- VPXOR (0*32)(inp), AA2, AA2; VPXOR (1*32)(inp), BB2, BB2; VPXOR (2*32)(inp), CC2, CC2; VPXOR (3*32)(inp), DD2, DD2
- VMOVDQU AA2, (0*32)(oup); VMOVDQU BB2, (1*32)(oup); VMOVDQU CC2, (2*32)(oup); VMOVDQU DD2, (3*32)(oup)
- LEAQ (4*32)(inp), inp
- LEAQ (4*32)(oup), oup
- SUBQ $4*32, inl
-
- JMP openAVX2TailLoop
-
-// ----------------------------------------------------------------------------
-// Special optimization for the last 384 bytes of ciphertext
+ VPADDD ·chacha20Constants<>+0(SB), Y0, Y0
+ VPADDD ·chacha20Constants<>+0(SB), Y5, Y5
+ VPADDD 32(BP), Y14, Y14
+ VPADDD 32(BP), Y9, Y9
+ VPADDD 64(BP), Y12, Y12
+ VPADDD 64(BP), Y13, Y13
+ VPADDD Y7, Y4, Y4
+ VPADDD Y11, Y1, Y1
+ VPERM2I128 $0x02, Y0, Y14, Y6
+ VPERM2I128 $0x02, Y12, Y4, Y10
+ VPERM2I128 $0x13, Y0, Y14, Y8
+ VPERM2I128 $0x13, Y12, Y4, Y2
+ VPERM2I128 $0x02, Y5, Y9, Y0
+ VPERM2I128 $0x02, Y13, Y1, Y14
+ VPERM2I128 $0x13, Y5, Y9, Y12
+ VPERM2I128 $0x13, Y13, Y1, Y4
+ VPXOR (SI), Y6, Y6
+ VPXOR 32(SI), Y10, Y10
+ VPXOR 64(SI), Y8, Y8
+ VPXOR 96(SI), Y2, Y2
+ VMOVDQU Y6, (DI)
+ VMOVDQU Y10, 32(DI)
+ VMOVDQU Y8, 64(DI)
+ VMOVDQU Y2, 96(DI)
+ LEAQ 128(SI), SI
+ LEAQ 128(DI), DI
+ SUBQ $0x80, BX
+ JMP openAVX2TailLoop
+
openAVX2Tail384:
// Need to decrypt up to 384 bytes - prepare six blocks
- VMOVDQA ·chacha20Constants<>(SB), AA0; VMOVDQA AA0, AA1; VMOVDQA AA0, AA2
- VMOVDQA state1StoreAVX2, BB0; VMOVDQA BB0, BB1; VMOVDQA BB0, BB2
- VMOVDQA state2StoreAVX2, CC0; VMOVDQA CC0, CC1; VMOVDQA CC0, CC2
- VMOVDQA ctr3StoreAVX2, DD0
- VPADDD ·avx2IncMask<>(SB), DD0, DD0
- VPADDD ·avx2IncMask<>(SB), DD0, DD1
- VPADDD ·avx2IncMask<>(SB), DD1, DD2
- VMOVDQA DD0, ctr0StoreAVX2
- VMOVDQA DD1, ctr1StoreAVX2
- VMOVDQA DD2, ctr2StoreAVX2
+ VMOVDQA ·chacha20Constants<>+0(SB), Y0
+ VMOVDQA Y0, Y5
+ VMOVDQA Y0, Y6
+ VMOVDQA 32(BP), Y14
+ VMOVDQA Y14, Y9
+ VMOVDQA Y14, Y10
+ VMOVDQA 64(BP), Y12
+ VMOVDQA Y12, Y13
+ VMOVDQA Y12, Y8
+ VMOVDQA 192(BP), Y4
+ VPADDD ·avx2IncMask<>+0(SB), Y4, Y4
+ VPADDD ·avx2IncMask<>+0(SB), Y4, Y1
+ VPADDD ·avx2IncMask<>+0(SB), Y1, Y2
+ VMOVDQA Y4, 96(BP)
+ VMOVDQA Y1, 128(BP)
+ VMOVDQA Y2, 160(BP)
// Compute the number of iterations that will hash two blocks of data
- MOVQ inl, tmpStoreAVX2
- MOVQ inl, itr1
- SUBQ $256, itr1
- SHRQ $4, itr1
- ADDQ $6, itr1
- MOVQ $10, itr2
- CMPQ itr1, $10
- CMOVQGT itr2, itr1
- MOVQ inp, inl
- XORQ itr2, itr2
-
- // Perform ChaCha rounds, while hashing the remaining input
+ MOVQ BX, 224(BP)
+ MOVQ BX, CX
+ SUBQ $0x00000100, CX
+ SHRQ $0x04, CX
+ ADDQ $0x06, CX
+ MOVQ $0x0000000a, R9
+ CMPQ CX, $0x0a
+ CMOVQGT R9, CX
+ MOVQ SI, BX
+ XORQ R9, R9
+
openAVX2Tail384LoopB:
- polyAdd(0(inl))
- polyMulAVX2
- LEAQ 16(inl), inl
+ ADDQ (BX), R10
+ ADCQ 8(BX), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), DX
+ MOVQ DX, R15
+ MULXQ R10, R13, R14
+ IMULQ R12, R15
+ MULXQ R11, AX, DX
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), DX
+ MULXQ R10, R10, AX
+ ADDQ R10, R14
+ MULXQ R11, R11, R8
+ ADCQ R11, R15
+ ADCQ $0x00, R8
+ IMULQ R12, DX
+ ADDQ AX, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ LEAQ 16(BX), BX
openAVX2Tail384LoopA:
- chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0); chachaQR_AVX2(AA2, BB2, CC2, DD2, TT0)
- VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $4, BB1, BB1, BB1; VPALIGNR $4, BB2, BB2, BB2
- VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2
- VPALIGNR $12, DD0, DD0, DD0; VPALIGNR $12, DD1, DD1, DD1; VPALIGNR $12, DD2, DD2, DD2
- polyAdd(0(inl))
- polyMulAVX2
- LEAQ 16(inl), inl
- INCQ itr2
- chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0); chachaQR_AVX2(AA2, BB2, CC2, DD2, TT0)
- VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $12, BB1, BB1, BB1; VPALIGNR $12, BB2, BB2, BB2
- VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2
- VPALIGNR $4, DD0, DD0, DD0; VPALIGNR $4, DD1, DD1, DD1; VPALIGNR $4, DD2, DD2, DD2
-
- CMPQ itr2, itr1
- JB openAVX2Tail384LoopB
-
- CMPQ itr2, $10
- JNE openAVX2Tail384LoopA
-
- MOVQ inl, itr2
- SUBQ inp, inl
- MOVQ inl, itr1
- MOVQ tmpStoreAVX2, inl
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol16<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x0c, Y14, Y3
+ VPSRLD $0x14, Y14, Y14
+ VPXOR Y3, Y14, Y14
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol8<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x07, Y14, Y3
+ VPSRLD $0x19, Y14, Y14
+ VPXOR Y3, Y14, Y14
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol16<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x0c, Y9, Y3
+ VPSRLD $0x14, Y9, Y9
+ VPXOR Y3, Y9, Y9
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol8<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x07, Y9, Y3
+ VPSRLD $0x19, Y9, Y9
+ VPXOR Y3, Y9, Y9
+ VPADDD Y10, Y6, Y6
+ VPXOR Y6, Y2, Y2
+ VPSHUFB ·rol16<>+0(SB), Y2, Y2
+ VPADDD Y2, Y8, Y8
+ VPXOR Y8, Y10, Y10
+ VPSLLD $0x0c, Y10, Y3
+ VPSRLD $0x14, Y10, Y10
+ VPXOR Y3, Y10, Y10
+ VPADDD Y10, Y6, Y6
+ VPXOR Y6, Y2, Y2
+ VPSHUFB ·rol8<>+0(SB), Y2, Y2
+ VPADDD Y2, Y8, Y8
+ VPXOR Y8, Y10, Y10
+ VPSLLD $0x07, Y10, Y3
+ VPSRLD $0x19, Y10, Y10
+ VPXOR Y3, Y10, Y10
+ VPALIGNR $0x04, Y14, Y14, Y14
+ VPALIGNR $0x04, Y9, Y9, Y9
+ VPALIGNR $0x04, Y10, Y10, Y10
+ VPALIGNR $0x08, Y12, Y12, Y12
+ VPALIGNR $0x08, Y13, Y13, Y13
+ VPALIGNR $0x08, Y8, Y8, Y8
+ VPALIGNR $0x0c, Y4, Y4, Y4
+ VPALIGNR $0x0c, Y1, Y1, Y1
+ VPALIGNR $0x0c, Y2, Y2, Y2
+ ADDQ (BX), R10
+ ADCQ 8(BX), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), DX
+ MOVQ DX, R15
+ MULXQ R10, R13, R14
+ IMULQ R12, R15
+ MULXQ R11, AX, DX
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), DX
+ MULXQ R10, R10, AX
+ ADDQ R10, R14
+ MULXQ R11, R11, R8
+ ADCQ R11, R15
+ ADCQ $0x00, R8
+ IMULQ R12, DX
+ ADDQ AX, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ LEAQ 16(BX), BX
+ INCQ R9
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol16<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x0c, Y14, Y3
+ VPSRLD $0x14, Y14, Y14
+ VPXOR Y3, Y14, Y14
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol8<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x07, Y14, Y3
+ VPSRLD $0x19, Y14, Y14
+ VPXOR Y3, Y14, Y14
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol16<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x0c, Y9, Y3
+ VPSRLD $0x14, Y9, Y9
+ VPXOR Y3, Y9, Y9
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol8<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x07, Y9, Y3
+ VPSRLD $0x19, Y9, Y9
+ VPXOR Y3, Y9, Y9
+ VPADDD Y10, Y6, Y6
+ VPXOR Y6, Y2, Y2
+ VPSHUFB ·rol16<>+0(SB), Y2, Y2
+ VPADDD Y2, Y8, Y8
+ VPXOR Y8, Y10, Y10
+ VPSLLD $0x0c, Y10, Y3
+ VPSRLD $0x14, Y10, Y10
+ VPXOR Y3, Y10, Y10
+ VPADDD Y10, Y6, Y6
+ VPXOR Y6, Y2, Y2
+ VPSHUFB ·rol8<>+0(SB), Y2, Y2
+ VPADDD Y2, Y8, Y8
+ VPXOR Y8, Y10, Y10
+ VPSLLD $0x07, Y10, Y3
+ VPSRLD $0x19, Y10, Y10
+ VPXOR Y3, Y10, Y10
+ VPALIGNR $0x0c, Y14, Y14, Y14
+ VPALIGNR $0x0c, Y9, Y9, Y9
+ VPALIGNR $0x0c, Y10, Y10, Y10
+ VPALIGNR $0x08, Y12, Y12, Y12
+ VPALIGNR $0x08, Y13, Y13, Y13
+ VPALIGNR $0x08, Y8, Y8, Y8
+ VPALIGNR $0x04, Y4, Y4, Y4
+ VPALIGNR $0x04, Y1, Y1, Y1
+ VPALIGNR $0x04, Y2, Y2, Y2
+ CMPQ R9, CX
+ JB openAVX2Tail384LoopB
+ CMPQ R9, $0x0a
+ JNE openAVX2Tail384LoopA
+ MOVQ BX, R9
+ SUBQ SI, BX
+ MOVQ BX, CX
+ MOVQ 224(BP), BX
openAVX2Tail384Hash:
- ADDQ $16, itr1
- CMPQ itr1, inl
- JGT openAVX2Tail384HashEnd
- polyAdd(0(itr2))
- polyMulAVX2
- LEAQ 16(itr2), itr2
- JMP openAVX2Tail384Hash
-
-// Store 256 bytes safely, then go to store loop
+ ADDQ $0x10, CX
+ CMPQ CX, BX
+ JGT openAVX2Tail384HashEnd
+ ADDQ (R9), R10
+ ADCQ 8(R9), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), DX
+ MOVQ DX, R15
+ MULXQ R10, R13, R14
+ IMULQ R12, R15
+ MULXQ R11, AX, DX
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), DX
+ MULXQ R10, R10, AX
+ ADDQ R10, R14
+ MULXQ R11, R11, R8
+ ADCQ R11, R15
+ ADCQ $0x00, R8
+ IMULQ R12, DX
+ ADDQ AX, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ LEAQ 16(R9), R9
+ JMP openAVX2Tail384Hash
+
openAVX2Tail384HashEnd:
- VPADDD ·chacha20Constants<>(SB), AA0, AA0; VPADDD ·chacha20Constants<>(SB), AA1, AA1; VPADDD ·chacha20Constants<>(SB), AA2, AA2
- VPADDD state1StoreAVX2, BB0, BB0; VPADDD state1StoreAVX2, BB1, BB1; VPADDD state1StoreAVX2, BB2, BB2
- VPADDD state2StoreAVX2, CC0, CC0; VPADDD state2StoreAVX2, CC1, CC1; VPADDD state2StoreAVX2, CC2, CC2
- VPADDD ctr0StoreAVX2, DD0, DD0; VPADDD ctr1StoreAVX2, DD1, DD1; VPADDD ctr2StoreAVX2, DD2, DD2
- VPERM2I128 $0x02, AA0, BB0, TT0; VPERM2I128 $0x02, CC0, DD0, TT1; VPERM2I128 $0x13, AA0, BB0, TT2; VPERM2I128 $0x13, CC0, DD0, TT3
- VPXOR (0*32)(inp), TT0, TT0; VPXOR (1*32)(inp), TT1, TT1; VPXOR (2*32)(inp), TT2, TT2; VPXOR (3*32)(inp), TT3, TT3
- VMOVDQU TT0, (0*32)(oup); VMOVDQU TT1, (1*32)(oup); VMOVDQU TT2, (2*32)(oup); VMOVDQU TT3, (3*32)(oup)
- VPERM2I128 $0x02, AA1, BB1, TT0; VPERM2I128 $0x02, CC1, DD1, TT1; VPERM2I128 $0x13, AA1, BB1, TT2; VPERM2I128 $0x13, CC1, DD1, TT3
- VPXOR (4*32)(inp), TT0, TT0; VPXOR (5*32)(inp), TT1, TT1; VPXOR (6*32)(inp), TT2, TT2; VPXOR (7*32)(inp), TT3, TT3
- VMOVDQU TT0, (4*32)(oup); VMOVDQU TT1, (5*32)(oup); VMOVDQU TT2, (6*32)(oup); VMOVDQU TT3, (7*32)(oup)
- VPERM2I128 $0x02, AA2, BB2, AA0; VPERM2I128 $0x02, CC2, DD2, BB0; VPERM2I128 $0x13, AA2, BB2, CC0; VPERM2I128 $0x13, CC2, DD2, DD0
- LEAQ (8*32)(inp), inp
- LEAQ (8*32)(oup), oup
- SUBQ $8*32, inl
+ VPADDD ·chacha20Constants<>+0(SB), Y0, Y0
+ VPADDD ·chacha20Constants<>+0(SB), Y5, Y5
+ VPADDD ·chacha20Constants<>+0(SB), Y6, Y6
+ VPADDD 32(BP), Y14, Y14
+ VPADDD 32(BP), Y9, Y9
+ VPADDD 32(BP), Y10, Y10
+ VPADDD 64(BP), Y12, Y12
+ VPADDD 64(BP), Y13, Y13
+ VPADDD 64(BP), Y8, Y8
+ VPADDD 96(BP), Y4, Y4
+ VPADDD 128(BP), Y1, Y1
+ VPADDD 160(BP), Y2, Y2
+ VPERM2I128 $0x02, Y0, Y14, Y3
+ VPERM2I128 $0x02, Y12, Y4, Y7
+ VPERM2I128 $0x13, Y0, Y14, Y11
+ VPERM2I128 $0x13, Y12, Y4, Y15
+ VPXOR (SI), Y3, Y3
+ VPXOR 32(SI), Y7, Y7
+ VPXOR 64(SI), Y11, Y11
+ VPXOR 96(SI), Y15, Y15
+ VMOVDQU Y3, (DI)
+ VMOVDQU Y7, 32(DI)
+ VMOVDQU Y11, 64(DI)
+ VMOVDQU Y15, 96(DI)
+ VPERM2I128 $0x02, Y5, Y9, Y3
+ VPERM2I128 $0x02, Y13, Y1, Y7
+ VPERM2I128 $0x13, Y5, Y9, Y11
+ VPERM2I128 $0x13, Y13, Y1, Y15
+ VPXOR 128(SI), Y3, Y3
+ VPXOR 160(SI), Y7, Y7
+ VPXOR 192(SI), Y11, Y11
+ VPXOR 224(SI), Y15, Y15
+ VMOVDQU Y3, 128(DI)
+ VMOVDQU Y7, 160(DI)
+ VMOVDQU Y11, 192(DI)
+ VMOVDQU Y15, 224(DI)
+ VPERM2I128 $0x02, Y6, Y10, Y0
+ VPERM2I128 $0x02, Y8, Y2, Y14
+ VPERM2I128 $0x13, Y6, Y10, Y12
+ VPERM2I128 $0x13, Y8, Y2, Y4
+ LEAQ 256(SI), SI
+ LEAQ 256(DI), DI
+ SUBQ $0x00000100, BX
JMP openAVX2TailLoop
-// ----------------------------------------------------------------------------
-// Special optimization for the last 512 bytes of ciphertext
openAVX2Tail512:
- VMOVDQU ·chacha20Constants<>(SB), AA0; VMOVDQA AA0, AA1; VMOVDQA AA0, AA2; VMOVDQA AA0, AA3
- VMOVDQA state1StoreAVX2, BB0; VMOVDQA BB0, BB1; VMOVDQA BB0, BB2; VMOVDQA BB0, BB3
- VMOVDQA state2StoreAVX2, CC0; VMOVDQA CC0, CC1; VMOVDQA CC0, CC2; VMOVDQA CC0, CC3
- VMOVDQA ctr3StoreAVX2, DD0; VPADDD ·avx2IncMask<>(SB), DD0, DD0; VPADDD ·avx2IncMask<>(SB), DD0, DD1; VPADDD ·avx2IncMask<>(SB), DD1, DD2; VPADDD ·avx2IncMask<>(SB), DD2, DD3
- VMOVDQA DD0, ctr0StoreAVX2; VMOVDQA DD1, ctr1StoreAVX2; VMOVDQA DD2, ctr2StoreAVX2; VMOVDQA DD3, ctr3StoreAVX2
- XORQ itr1, itr1
- MOVQ inp, itr2
+ VMOVDQU ·chacha20Constants<>+0(SB), Y0
+ VMOVDQA Y0, Y5
+ VMOVDQA Y0, Y6
+ VMOVDQA Y0, Y7
+ VMOVDQA 32(BP), Y14
+ VMOVDQA Y14, Y9
+ VMOVDQA Y14, Y10
+ VMOVDQA Y14, Y11
+ VMOVDQA 64(BP), Y12
+ VMOVDQA Y12, Y13
+ VMOVDQA Y12, Y8
+ VMOVDQA Y12, Y15
+ VMOVDQA 192(BP), Y4
+ VPADDD ·avx2IncMask<>+0(SB), Y4, Y4
+ VPADDD ·avx2IncMask<>+0(SB), Y4, Y1
+ VPADDD ·avx2IncMask<>+0(SB), Y1, Y2
+ VPADDD ·avx2IncMask<>+0(SB), Y2, Y3
+ VMOVDQA Y4, 96(BP)
+ VMOVDQA Y1, 128(BP)
+ VMOVDQA Y2, 160(BP)
+ VMOVDQA Y3, 192(BP)
+ XORQ CX, CX
+ MOVQ SI, R9
openAVX2Tail512LoopB:
- polyAdd(0(itr2))
- polyMulAVX2
- LEAQ (2*8)(itr2), itr2
+ ADDQ (R9), R10
+ ADCQ 8(R9), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), DX
+ MOVQ DX, R15
+ MULXQ R10, R13, R14
+ IMULQ R12, R15
+ MULXQ R11, AX, DX
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), DX
+ MULXQ R10, R10, AX
+ ADDQ R10, R14
+ MULXQ R11, R11, R8
+ ADCQ R11, R15
+ ADCQ $0x00, R8
+ IMULQ R12, DX
+ ADDQ AX, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ LEAQ 16(R9), R9
openAVX2Tail512LoopA:
- VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3
- VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3
- VPSHUFB ·rol16<>(SB), DD0, DD0; VPSHUFB ·rol16<>(SB), DD1, DD1; VPSHUFB ·rol16<>(SB), DD2, DD2; VPSHUFB ·rol16<>(SB), DD3, DD3
- VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3
- VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3
- VMOVDQA CC3, tmpStoreAVX2
- VPSLLD $12, BB0, CC3; VPSRLD $20, BB0, BB0; VPXOR CC3, BB0, BB0
- VPSLLD $12, BB1, CC3; VPSRLD $20, BB1, BB1; VPXOR CC3, BB1, BB1
- VPSLLD $12, BB2, CC3; VPSRLD $20, BB2, BB2; VPXOR CC3, BB2, BB2
- VPSLLD $12, BB3, CC3; VPSRLD $20, BB3, BB3; VPXOR CC3, BB3, BB3
- VMOVDQA tmpStoreAVX2, CC3
- polyAdd(0*8(itr2))
- polyMulAVX2
- VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3
- VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3
- VPSHUFB ·rol8<>(SB), DD0, DD0; VPSHUFB ·rol8<>(SB), DD1, DD1; VPSHUFB ·rol8<>(SB), DD2, DD2; VPSHUFB ·rol8<>(SB), DD3, DD3
- VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3
- VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3
- VMOVDQA CC3, tmpStoreAVX2
- VPSLLD $7, BB0, CC3; VPSRLD $25, BB0, BB0; VPXOR CC3, BB0, BB0
- VPSLLD $7, BB1, CC3; VPSRLD $25, BB1, BB1; VPXOR CC3, BB1, BB1
- VPSLLD $7, BB2, CC3; VPSRLD $25, BB2, BB2; VPXOR CC3, BB2, BB2
- VPSLLD $7, BB3, CC3; VPSRLD $25, BB3, BB3; VPXOR CC3, BB3, BB3
- VMOVDQA tmpStoreAVX2, CC3
- VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $4, BB1, BB1, BB1; VPALIGNR $4, BB2, BB2, BB2; VPALIGNR $4, BB3, BB3, BB3
- VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2; VPALIGNR $8, CC3, CC3, CC3
- VPALIGNR $12, DD0, DD0, DD0; VPALIGNR $12, DD1, DD1, DD1; VPALIGNR $12, DD2, DD2, DD2; VPALIGNR $12, DD3, DD3, DD3
- VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3
- VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3
- VPSHUFB ·rol16<>(SB), DD0, DD0; VPSHUFB ·rol16<>(SB), DD1, DD1; VPSHUFB ·rol16<>(SB), DD2, DD2; VPSHUFB ·rol16<>(SB), DD3, DD3
- VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3
- VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3
- polyAdd(2*8(itr2))
- polyMulAVX2
- LEAQ (4*8)(itr2), itr2
- VMOVDQA CC3, tmpStoreAVX2
- VPSLLD $12, BB0, CC3; VPSRLD $20, BB0, BB0; VPXOR CC3, BB0, BB0
- VPSLLD $12, BB1, CC3; VPSRLD $20, BB1, BB1; VPXOR CC3, BB1, BB1
- VPSLLD $12, BB2, CC3; VPSRLD $20, BB2, BB2; VPXOR CC3, BB2, BB2
- VPSLLD $12, BB3, CC3; VPSRLD $20, BB3, BB3; VPXOR CC3, BB3, BB3
- VMOVDQA tmpStoreAVX2, CC3
- VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3
- VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3
- VPSHUFB ·rol8<>(SB), DD0, DD0; VPSHUFB ·rol8<>(SB), DD1, DD1; VPSHUFB ·rol8<>(SB), DD2, DD2; VPSHUFB ·rol8<>(SB), DD3, DD3
- VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3
- VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3
- VMOVDQA CC3, tmpStoreAVX2
- VPSLLD $7, BB0, CC3; VPSRLD $25, BB0, BB0; VPXOR CC3, BB0, BB0
- VPSLLD $7, BB1, CC3; VPSRLD $25, BB1, BB1; VPXOR CC3, BB1, BB1
- VPSLLD $7, BB2, CC3; VPSRLD $25, BB2, BB2; VPXOR CC3, BB2, BB2
- VPSLLD $7, BB3, CC3; VPSRLD $25, BB3, BB3; VPXOR CC3, BB3, BB3
- VMOVDQA tmpStoreAVX2, CC3
- VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $12, BB1, BB1, BB1; VPALIGNR $12, BB2, BB2, BB2; VPALIGNR $12, BB3, BB3, BB3
- VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2; VPALIGNR $8, CC3, CC3, CC3
- VPALIGNR $4, DD0, DD0, DD0; VPALIGNR $4, DD1, DD1, DD1; VPALIGNR $4, DD2, DD2, DD2; VPALIGNR $4, DD3, DD3, DD3
- INCQ itr1
- CMPQ itr1, $4
+ VPADDD Y14, Y0, Y0
+ VPADDD Y9, Y5, Y5
+ VPADDD Y10, Y6, Y6
+ VPADDD Y11, Y7, Y7
+ VPXOR Y0, Y4, Y4
+ VPXOR Y5, Y1, Y1
+ VPXOR Y6, Y2, Y2
+ VPXOR Y7, Y3, Y3
+ VPSHUFB ·rol16<>+0(SB), Y4, Y4
+ VPSHUFB ·rol16<>+0(SB), Y1, Y1
+ VPSHUFB ·rol16<>+0(SB), Y2, Y2
+ VPSHUFB ·rol16<>+0(SB), Y3, Y3
+ VPADDD Y4, Y12, Y12
+ VPADDD Y1, Y13, Y13
+ VPADDD Y2, Y8, Y8
+ VPADDD Y3, Y15, Y15
+ VPXOR Y12, Y14, Y14
+ VPXOR Y13, Y9, Y9
+ VPXOR Y8, Y10, Y10
+ VPXOR Y15, Y11, Y11
+ VMOVDQA Y15, 224(BP)
+ VPSLLD $0x0c, Y14, Y15
+ VPSRLD $0x14, Y14, Y14
+ VPXOR Y15, Y14, Y14
+ VPSLLD $0x0c, Y9, Y15
+ VPSRLD $0x14, Y9, Y9
+ VPXOR Y15, Y9, Y9
+ VPSLLD $0x0c, Y10, Y15
+ VPSRLD $0x14, Y10, Y10
+ VPXOR Y15, Y10, Y10
+ VPSLLD $0x0c, Y11, Y15
+ VPSRLD $0x14, Y11, Y11
+ VPXOR Y15, Y11, Y11
+ VMOVDQA 224(BP), Y15
+ ADDQ (R9), R10
+ ADCQ 8(R9), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), DX
+ MOVQ DX, R15
+ MULXQ R10, R13, R14
+ IMULQ R12, R15
+ MULXQ R11, AX, DX
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), DX
+ MULXQ R10, R10, AX
+ ADDQ R10, R14
+ MULXQ R11, R11, R8
+ ADCQ R11, R15
+ ADCQ $0x00, R8
+ IMULQ R12, DX
+ ADDQ AX, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ VPADDD Y14, Y0, Y0
+ VPADDD Y9, Y5, Y5
+ VPADDD Y10, Y6, Y6
+ VPADDD Y11, Y7, Y7
+ VPXOR Y0, Y4, Y4
+ VPXOR Y5, Y1, Y1
+ VPXOR Y6, Y2, Y2
+ VPXOR Y7, Y3, Y3
+ VPSHUFB ·rol8<>+0(SB), Y4, Y4
+ VPSHUFB ·rol8<>+0(SB), Y1, Y1
+ VPSHUFB ·rol8<>+0(SB), Y2, Y2
+ VPSHUFB ·rol8<>+0(SB), Y3, Y3
+ VPADDD Y4, Y12, Y12
+ VPADDD Y1, Y13, Y13
+ VPADDD Y2, Y8, Y8
+ VPADDD Y3, Y15, Y15
+ VPXOR Y12, Y14, Y14
+ VPXOR Y13, Y9, Y9
+ VPXOR Y8, Y10, Y10
+ VPXOR Y15, Y11, Y11
+ VMOVDQA Y15, 224(BP)
+ VPSLLD $0x07, Y14, Y15
+ VPSRLD $0x19, Y14, Y14
+ VPXOR Y15, Y14, Y14
+ VPSLLD $0x07, Y9, Y15
+ VPSRLD $0x19, Y9, Y9
+ VPXOR Y15, Y9, Y9
+ VPSLLD $0x07, Y10, Y15
+ VPSRLD $0x19, Y10, Y10
+ VPXOR Y15, Y10, Y10
+ VPSLLD $0x07, Y11, Y15
+ VPSRLD $0x19, Y11, Y11
+ VPXOR Y15, Y11, Y11
+ VMOVDQA 224(BP), Y15
+ VPALIGNR $0x04, Y14, Y14, Y14
+ VPALIGNR $0x04, Y9, Y9, Y9
+ VPALIGNR $0x04, Y10, Y10, Y10
+ VPALIGNR $0x04, Y11, Y11, Y11
+ VPALIGNR $0x08, Y12, Y12, Y12
+ VPALIGNR $0x08, Y13, Y13, Y13
+ VPALIGNR $0x08, Y8, Y8, Y8
+ VPALIGNR $0x08, Y15, Y15, Y15
+ VPALIGNR $0x0c, Y4, Y4, Y4
+ VPALIGNR $0x0c, Y1, Y1, Y1
+ VPALIGNR $0x0c, Y2, Y2, Y2
+ VPALIGNR $0x0c, Y3, Y3, Y3
+ VPADDD Y14, Y0, Y0
+ VPADDD Y9, Y5, Y5
+ VPADDD Y10, Y6, Y6
+ VPADDD Y11, Y7, Y7
+ VPXOR Y0, Y4, Y4
+ VPXOR Y5, Y1, Y1
+ VPXOR Y6, Y2, Y2
+ VPXOR Y7, Y3, Y3
+ VPSHUFB ·rol16<>+0(SB), Y4, Y4
+ VPSHUFB ·rol16<>+0(SB), Y1, Y1
+ VPSHUFB ·rol16<>+0(SB), Y2, Y2
+ VPSHUFB ·rol16<>+0(SB), Y3, Y3
+ VPADDD Y4, Y12, Y12
+ VPADDD Y1, Y13, Y13
+ VPADDD Y2, Y8, Y8
+ VPADDD Y3, Y15, Y15
+ VPXOR Y12, Y14, Y14
+ VPXOR Y13, Y9, Y9
+ VPXOR Y8, Y10, Y10
+ VPXOR Y15, Y11, Y11
+ ADDQ 16(R9), R10
+ ADCQ 24(R9), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), DX
+ MOVQ DX, R15
+ MULXQ R10, R13, R14
+ IMULQ R12, R15
+ MULXQ R11, AX, DX
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), DX
+ MULXQ R10, R10, AX
+ ADDQ R10, R14
+ MULXQ R11, R11, R8
+ ADCQ R11, R15
+ ADCQ $0x00, R8
+ IMULQ R12, DX
+ ADDQ AX, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ LEAQ 32(R9), R9
+ VMOVDQA Y15, 224(BP)
+ VPSLLD $0x0c, Y14, Y15
+ VPSRLD $0x14, Y14, Y14
+ VPXOR Y15, Y14, Y14
+ VPSLLD $0x0c, Y9, Y15
+ VPSRLD $0x14, Y9, Y9
+ VPXOR Y15, Y9, Y9
+ VPSLLD $0x0c, Y10, Y15
+ VPSRLD $0x14, Y10, Y10
+ VPXOR Y15, Y10, Y10
+ VPSLLD $0x0c, Y11, Y15
+ VPSRLD $0x14, Y11, Y11
+ VPXOR Y15, Y11, Y11
+ VMOVDQA 224(BP), Y15
+ VPADDD Y14, Y0, Y0
+ VPADDD Y9, Y5, Y5
+ VPADDD Y10, Y6, Y6
+ VPADDD Y11, Y7, Y7
+ VPXOR Y0, Y4, Y4
+ VPXOR Y5, Y1, Y1
+ VPXOR Y6, Y2, Y2
+ VPXOR Y7, Y3, Y3
+ VPSHUFB ·rol8<>+0(SB), Y4, Y4
+ VPSHUFB ·rol8<>+0(SB), Y1, Y1
+ VPSHUFB ·rol8<>+0(SB), Y2, Y2
+ VPSHUFB ·rol8<>+0(SB), Y3, Y3
+ VPADDD Y4, Y12, Y12
+ VPADDD Y1, Y13, Y13
+ VPADDD Y2, Y8, Y8
+ VPADDD Y3, Y15, Y15
+ VPXOR Y12, Y14, Y14
+ VPXOR Y13, Y9, Y9
+ VPXOR Y8, Y10, Y10
+ VPXOR Y15, Y11, Y11
+ VMOVDQA Y15, 224(BP)
+ VPSLLD $0x07, Y14, Y15
+ VPSRLD $0x19, Y14, Y14
+ VPXOR Y15, Y14, Y14
+ VPSLLD $0x07, Y9, Y15
+ VPSRLD $0x19, Y9, Y9
+ VPXOR Y15, Y9, Y9
+ VPSLLD $0x07, Y10, Y15
+ VPSRLD $0x19, Y10, Y10
+ VPXOR Y15, Y10, Y10
+ VPSLLD $0x07, Y11, Y15
+ VPSRLD $0x19, Y11, Y11
+ VPXOR Y15, Y11, Y11
+ VMOVDQA 224(BP), Y15
+ VPALIGNR $0x0c, Y14, Y14, Y14
+ VPALIGNR $0x0c, Y9, Y9, Y9
+ VPALIGNR $0x0c, Y10, Y10, Y10
+ VPALIGNR $0x0c, Y11, Y11, Y11
+ VPALIGNR $0x08, Y12, Y12, Y12
+ VPALIGNR $0x08, Y13, Y13, Y13
+ VPALIGNR $0x08, Y8, Y8, Y8
+ VPALIGNR $0x08, Y15, Y15, Y15
+ VPALIGNR $0x04, Y4, Y4, Y4
+ VPALIGNR $0x04, Y1, Y1, Y1
+ VPALIGNR $0x04, Y2, Y2, Y2
+ VPALIGNR $0x04, Y3, Y3, Y3
+ INCQ CX
+ CMPQ CX, $0x04
JLT openAVX2Tail512LoopB
-
- CMPQ itr1, $10
- JNE openAVX2Tail512LoopA
-
- MOVQ inl, itr1
- SUBQ $384, itr1
- ANDQ $-16, itr1
+ CMPQ CX, $0x0a
+ JNE openAVX2Tail512LoopA
+ MOVQ BX, CX
+ SUBQ $0x00000180, CX
+ ANDQ $-16, CX
openAVX2Tail512HashLoop:
- TESTQ itr1, itr1
+ TESTQ CX, CX
JE openAVX2Tail512HashEnd
- polyAdd(0(itr2))
- polyMulAVX2
- LEAQ 16(itr2), itr2
- SUBQ $16, itr1
+ ADDQ (R9), R10
+ ADCQ 8(R9), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), DX
+ MOVQ DX, R15
+ MULXQ R10, R13, R14
+ IMULQ R12, R15
+ MULXQ R11, AX, DX
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), DX
+ MULXQ R10, R10, AX
+ ADDQ R10, R14
+ MULXQ R11, R11, R8
+ ADCQ R11, R15
+ ADCQ $0x00, R8
+ IMULQ R12, DX
+ ADDQ AX, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ LEAQ 16(R9), R9
+ SUBQ $0x10, CX
JMP openAVX2Tail512HashLoop
openAVX2Tail512HashEnd:
- VPADDD ·chacha20Constants<>(SB), AA0, AA0; VPADDD ·chacha20Constants<>(SB), AA1, AA1; VPADDD ·chacha20Constants<>(SB), AA2, AA2; VPADDD ·chacha20Constants<>(SB), AA3, AA3
- VPADDD state1StoreAVX2, BB0, BB0; VPADDD state1StoreAVX2, BB1, BB1; VPADDD state1StoreAVX2, BB2, BB2; VPADDD state1StoreAVX2, BB3, BB3
- VPADDD state2StoreAVX2, CC0, CC0; VPADDD state2StoreAVX2, CC1, CC1; VPADDD state2StoreAVX2, CC2, CC2; VPADDD state2StoreAVX2, CC3, CC3
- VPADDD ctr0StoreAVX2, DD0, DD0; VPADDD ctr1StoreAVX2, DD1, DD1; VPADDD ctr2StoreAVX2, DD2, DD2; VPADDD ctr3StoreAVX2, DD3, DD3
- VMOVDQA CC3, tmpStoreAVX2
- VPERM2I128 $0x02, AA0, BB0, CC3; VPERM2I128 $0x13, AA0, BB0, BB0; VPERM2I128 $0x02, CC0, DD0, AA0; VPERM2I128 $0x13, CC0, DD0, CC0
- VPXOR (0*32)(inp), CC3, CC3; VPXOR (1*32)(inp), AA0, AA0; VPXOR (2*32)(inp), BB0, BB0; VPXOR (3*32)(inp), CC0, CC0
- VMOVDQU CC3, (0*32)(oup); VMOVDQU AA0, (1*32)(oup); VMOVDQU BB0, (2*32)(oup); VMOVDQU CC0, (3*32)(oup)
- VPERM2I128 $0x02, AA1, BB1, AA0; VPERM2I128 $0x02, CC1, DD1, BB0; VPERM2I128 $0x13, AA1, BB1, CC0; VPERM2I128 $0x13, CC1, DD1, DD0
- VPXOR (4*32)(inp), AA0, AA0; VPXOR (5*32)(inp), BB0, BB0; VPXOR (6*32)(inp), CC0, CC0; VPXOR (7*32)(inp), DD0, DD0
- VMOVDQU AA0, (4*32)(oup); VMOVDQU BB0, (5*32)(oup); VMOVDQU CC0, (6*32)(oup); VMOVDQU DD0, (7*32)(oup)
- VPERM2I128 $0x02, AA2, BB2, AA0; VPERM2I128 $0x02, CC2, DD2, BB0; VPERM2I128 $0x13, AA2, BB2, CC0; VPERM2I128 $0x13, CC2, DD2, DD0
- VPXOR (8*32)(inp), AA0, AA0; VPXOR (9*32)(inp), BB0, BB0; VPXOR (10*32)(inp), CC0, CC0; VPXOR (11*32)(inp), DD0, DD0
- VMOVDQU AA0, (8*32)(oup); VMOVDQU BB0, (9*32)(oup); VMOVDQU CC0, (10*32)(oup); VMOVDQU DD0, (11*32)(oup)
- VPERM2I128 $0x02, AA3, BB3, AA0; VPERM2I128 $0x02, tmpStoreAVX2, DD3, BB0; VPERM2I128 $0x13, AA3, BB3, CC0; VPERM2I128 $0x13, tmpStoreAVX2, DD3, DD0
-
- LEAQ (12*32)(inp), inp
- LEAQ (12*32)(oup), oup
- SUBQ $12*32, inl
-
- JMP openAVX2TailLoop
-
-// ----------------------------------------------------------------------------
-// ----------------------------------------------------------------------------
-// func chacha20Poly1305Seal(dst, key, src, ad []byte)
-TEXT ·chacha20Poly1305Seal(SB), 0, $288-96
- // For aligned stack access
+ VPADDD ·chacha20Constants<>+0(SB), Y0, Y0
+ VPADDD ·chacha20Constants<>+0(SB), Y5, Y5
+ VPADDD ·chacha20Constants<>+0(SB), Y6, Y6
+ VPADDD ·chacha20Constants<>+0(SB), Y7, Y7
+ VPADDD 32(BP), Y14, Y14
+ VPADDD 32(BP), Y9, Y9
+ VPADDD 32(BP), Y10, Y10
+ VPADDD 32(BP), Y11, Y11
+ VPADDD 64(BP), Y12, Y12
+ VPADDD 64(BP), Y13, Y13
+ VPADDD 64(BP), Y8, Y8
+ VPADDD 64(BP), Y15, Y15
+ VPADDD 96(BP), Y4, Y4
+ VPADDD 128(BP), Y1, Y1
+ VPADDD 160(BP), Y2, Y2
+ VPADDD 192(BP), Y3, Y3
+ VMOVDQA Y15, 224(BP)
+ VPERM2I128 $0x02, Y0, Y14, Y15
+ VPERM2I128 $0x13, Y0, Y14, Y14
+ VPERM2I128 $0x02, Y12, Y4, Y0
+ VPERM2I128 $0x13, Y12, Y4, Y12
+ VPXOR (SI), Y15, Y15
+ VPXOR 32(SI), Y0, Y0
+ VPXOR 64(SI), Y14, Y14
+ VPXOR 96(SI), Y12, Y12
+ VMOVDQU Y15, (DI)
+ VMOVDQU Y0, 32(DI)
+ VMOVDQU Y14, 64(DI)
+ VMOVDQU Y12, 96(DI)
+ VPERM2I128 $0x02, Y5, Y9, Y0
+ VPERM2I128 $0x02, Y13, Y1, Y14
+ VPERM2I128 $0x13, Y5, Y9, Y12
+ VPERM2I128 $0x13, Y13, Y1, Y4
+ VPXOR 128(SI), Y0, Y0
+ VPXOR 160(SI), Y14, Y14
+ VPXOR 192(SI), Y12, Y12
+ VPXOR 224(SI), Y4, Y4
+ VMOVDQU Y0, 128(DI)
+ VMOVDQU Y14, 160(DI)
+ VMOVDQU Y12, 192(DI)
+ VMOVDQU Y4, 224(DI)
+ VPERM2I128 $0x02, Y6, Y10, Y0
+ VPERM2I128 $0x02, Y8, Y2, Y14
+ VPERM2I128 $0x13, Y6, Y10, Y12
+ VPERM2I128 $0x13, Y8, Y2, Y4
+ VPXOR 256(SI), Y0, Y0
+ VPXOR 288(SI), Y14, Y14
+ VPXOR 320(SI), Y12, Y12
+ VPXOR 352(SI), Y4, Y4
+ VMOVDQU Y0, 256(DI)
+ VMOVDQU Y14, 288(DI)
+ VMOVDQU Y12, 320(DI)
+ VMOVDQU Y4, 352(DI)
+ VPERM2I128 $0x02, Y7, Y11, Y0
+ VPERM2I128 $0x02, 224(BP), Y3, Y14
+ VPERM2I128 $0x13, Y7, Y11, Y12
+ VPERM2I128 $0x13, 224(BP), Y3, Y4
+ LEAQ 384(SI), SI
+ LEAQ 384(DI), DI
+ SUBQ $0x00000180, BX
+ JMP openAVX2TailLoop
+
+DATA ·chacha20Constants<>+0(SB)/4, $0x61707865
+DATA ·chacha20Constants<>+4(SB)/4, $0x3320646e
+DATA ·chacha20Constants<>+8(SB)/4, $0x79622d32
+DATA ·chacha20Constants<>+12(SB)/4, $0x6b206574
+DATA ·chacha20Constants<>+16(SB)/4, $0x61707865
+DATA ·chacha20Constants<>+20(SB)/4, $0x3320646e
+DATA ·chacha20Constants<>+24(SB)/4, $0x79622d32
+DATA ·chacha20Constants<>+28(SB)/4, $0x6b206574
+GLOBL ·chacha20Constants<>(SB), RODATA|NOPTR, $32
+
+DATA ·polyClampMask<>+0(SB)/8, $0x0ffffffc0fffffff
+DATA ·polyClampMask<>+8(SB)/8, $0x0ffffffc0ffffffc
+DATA ·polyClampMask<>+16(SB)/8, $0xffffffffffffffff
+DATA ·polyClampMask<>+24(SB)/8, $0xffffffffffffffff
+GLOBL ·polyClampMask<>(SB), RODATA|NOPTR, $32
+
+DATA ·sseIncMask<>+0(SB)/8, $0x0000000000000001
+DATA ·sseIncMask<>+8(SB)/8, $0x0000000000000000
+GLOBL ·sseIncMask<>(SB), RODATA|NOPTR, $16
+
+DATA ·andMask<>+0(SB)/8, $0x00000000000000ff
+DATA ·andMask<>+8(SB)/8, $0x0000000000000000
+DATA ·andMask<>+16(SB)/8, $0x000000000000ffff
+DATA ·andMask<>+24(SB)/8, $0x0000000000000000
+DATA ·andMask<>+32(SB)/8, $0x0000000000ffffff
+DATA ·andMask<>+40(SB)/8, $0x0000000000000000
+DATA ·andMask<>+48(SB)/8, $0x00000000ffffffff
+DATA ·andMask<>+56(SB)/8, $0x0000000000000000
+DATA ·andMask<>+64(SB)/8, $0x000000ffffffffff
+DATA ·andMask<>+72(SB)/8, $0x0000000000000000
+DATA ·andMask<>+80(SB)/8, $0x0000ffffffffffff
+DATA ·andMask<>+88(SB)/8, $0x0000000000000000
+DATA ·andMask<>+96(SB)/8, $0x00ffffffffffffff
+DATA ·andMask<>+104(SB)/8, $0x0000000000000000
+DATA ·andMask<>+112(SB)/8, $0xffffffffffffffff
+DATA ·andMask<>+120(SB)/8, $0x0000000000000000
+DATA ·andMask<>+128(SB)/8, $0xffffffffffffffff
+DATA ·andMask<>+136(SB)/8, $0x00000000000000ff
+DATA ·andMask<>+144(SB)/8, $0xffffffffffffffff
+DATA ·andMask<>+152(SB)/8, $0x000000000000ffff
+DATA ·andMask<>+160(SB)/8, $0xffffffffffffffff
+DATA ·andMask<>+168(SB)/8, $0x0000000000ffffff
+DATA ·andMask<>+176(SB)/8, $0xffffffffffffffff
+DATA ·andMask<>+184(SB)/8, $0x00000000ffffffff
+DATA ·andMask<>+192(SB)/8, $0xffffffffffffffff
+DATA ·andMask<>+200(SB)/8, $0x000000ffffffffff
+DATA ·andMask<>+208(SB)/8, $0xffffffffffffffff
+DATA ·andMask<>+216(SB)/8, $0x0000ffffffffffff
+DATA ·andMask<>+224(SB)/8, $0xffffffffffffffff
+DATA ·andMask<>+232(SB)/8, $0x00ffffffffffffff
+GLOBL ·andMask<>(SB), RODATA|NOPTR, $240
+
+DATA ·avx2InitMask<>+0(SB)/8, $0x0000000000000000
+DATA ·avx2InitMask<>+8(SB)/8, $0x0000000000000000
+DATA ·avx2InitMask<>+16(SB)/8, $0x0000000000000001
+DATA ·avx2InitMask<>+24(SB)/8, $0x0000000000000000
+GLOBL ·avx2InitMask<>(SB), RODATA|NOPTR, $32
+
+DATA ·rol16<>+0(SB)/8, $0x0504070601000302
+DATA ·rol16<>+8(SB)/8, $0x0d0c0f0e09080b0a
+DATA ·rol16<>+16(SB)/8, $0x0504070601000302
+DATA ·rol16<>+24(SB)/8, $0x0d0c0f0e09080b0a
+GLOBL ·rol16<>(SB), RODATA|NOPTR, $32
+
+DATA ·rol8<>+0(SB)/8, $0x0605040702010003
+DATA ·rol8<>+8(SB)/8, $0x0e0d0c0f0a09080b
+DATA ·rol8<>+16(SB)/8, $0x0605040702010003
+DATA ·rol8<>+24(SB)/8, $0x0e0d0c0f0a09080b
+GLOBL ·rol8<>(SB), RODATA|NOPTR, $32
+
+DATA ·avx2IncMask<>+0(SB)/8, $0x0000000000000002
+DATA ·avx2IncMask<>+8(SB)/8, $0x0000000000000000
+DATA ·avx2IncMask<>+16(SB)/8, $0x0000000000000002
+DATA ·avx2IncMask<>+24(SB)/8, $0x0000000000000000
+GLOBL ·avx2IncMask<>(SB), RODATA|NOPTR, $32
+
+// func chacha20Poly1305Seal(dst []byte, key []uint32, src []byte, ad []byte)
+// Requires: AVX, AVX2, BMI2, CMOV, SSE2
+TEXT ·chacha20Poly1305Seal(SB), $288-96
MOVQ SP, BP
- ADDQ $32, BP
+ ADDQ $0x20, BP
ANDQ $-32, BP
- MOVQ dst+0(FP), oup
- MOVQ key+24(FP), keyp
- MOVQ src+48(FP), inp
- MOVQ src_len+56(FP), inl
- MOVQ ad+72(FP), adp
-
- CMPB ·useAVX2(SB), $1
+ MOVQ dst_base+0(FP), DI
+ MOVQ key_base+24(FP), R8
+ MOVQ src_base+48(FP), SI
+ MOVQ src_len+56(FP), BX
+ MOVQ ad_base+72(FP), CX
+ CMPB ·useAVX2+0(SB), $0x01
JE chacha20Poly1305Seal_AVX2
// Special optimization, for very short buffers
- CMPQ inl, $128
- JBE sealSSE128 // About 15% faster
+ CMPQ BX, $0x80
+ JBE sealSSE128
// In the seal case - prepare the poly key + 3 blocks of stream in the first iteration
- MOVOU ·chacha20Constants<>(SB), A0
- MOVOU (1*16)(keyp), B0
- MOVOU (2*16)(keyp), C0
- MOVOU (3*16)(keyp), D0
+ MOVOU ·chacha20Constants<>+0(SB), X0
+ MOVOU 16(R8), X3
+ MOVOU 32(R8), X6
+ MOVOU 48(R8), X9
// Store state on stack for future use
- MOVO B0, state1Store
- MOVO C0, state2Store
+ MOVO X3, 32(BP)
+ MOVO X6, 48(BP)
// Load state, increment counter blocks
- MOVO A0, A1; MOVO B0, B1; MOVO C0, C1; MOVO D0, D1; PADDL ·sseIncMask<>(SB), D1
- MOVO A1, A2; MOVO B1, B2; MOVO C1, C2; MOVO D1, D2; PADDL ·sseIncMask<>(SB), D2
- MOVO A2, A3; MOVO B2, B3; MOVO C2, C3; MOVO D2, D3; PADDL ·sseIncMask<>(SB), D3
+ MOVO X0, X1
+ MOVO X3, X4
+ MOVO X6, X7
+ MOVO X9, X10
+ PADDL ·sseIncMask<>+0(SB), X10
+ MOVO X1, X2
+ MOVO X4, X5
+ MOVO X7, X8
+ MOVO X10, X11
+ PADDL ·sseIncMask<>+0(SB), X11
+ MOVO X2, X12
+ MOVO X5, X13
+ MOVO X8, X14
+ MOVO X11, X15
+ PADDL ·sseIncMask<>+0(SB), X15
// Store counters
- MOVO D0, ctr0Store; MOVO D1, ctr1Store; MOVO D2, ctr2Store; MOVO D3, ctr3Store
- MOVQ $10, itr2
+ MOVO X9, 80(BP)
+ MOVO X10, 96(BP)
+ MOVO X11, 112(BP)
+ MOVO X15, 128(BP)
+ MOVQ $0x0000000a, R9
sealSSEIntroLoop:
- MOVO C3, tmpStore
- chachaQR(A0, B0, C0, D0, C3); chachaQR(A1, B1, C1, D1, C3); chachaQR(A2, B2, C2, D2, C3)
- MOVO tmpStore, C3
- MOVO C1, tmpStore
- chachaQR(A3, B3, C3, D3, C1)
- MOVO tmpStore, C1
- shiftB0Left; shiftB1Left; shiftB2Left; shiftB3Left
- shiftC0Left; shiftC1Left; shiftC2Left; shiftC3Left
- shiftD0Left; shiftD1Left; shiftD2Left; shiftD3Left
-
- MOVO C3, tmpStore
- chachaQR(A0, B0, C0, D0, C3); chachaQR(A1, B1, C1, D1, C3); chachaQR(A2, B2, C2, D2, C3)
- MOVO tmpStore, C3
- MOVO C1, tmpStore
- chachaQR(A3, B3, C3, D3, C1)
- MOVO tmpStore, C1
- shiftB0Right; shiftB1Right; shiftB2Right; shiftB3Right
- shiftC0Right; shiftC1Right; shiftC2Right; shiftC3Right
- shiftD0Right; shiftD1Right; shiftD2Right; shiftD3Right
- DECQ itr2
- JNE sealSSEIntroLoop
+ MOVO X14, 64(BP)
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL16(X9, X14)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X14
+ PSLLL $0x0c, X14
+ PSRLL $0x14, X3
+ PXOR X14, X3
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL8(X9, X14)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X14
+ PSLLL $0x07, X14
+ PSRLL $0x19, X3
+ PXOR X14, X3
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL16(X10, X14)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X14
+ PSLLL $0x0c, X14
+ PSRLL $0x14, X4
+ PXOR X14, X4
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL8(X10, X14)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X14
+ PSLLL $0x07, X14
+ PSRLL $0x19, X4
+ PXOR X14, X4
+ PADDD X5, X2
+ PXOR X2, X11
+ ROL16(X11, X14)
+ PADDD X11, X8
+ PXOR X8, X5
+ MOVO X5, X14
+ PSLLL $0x0c, X14
+ PSRLL $0x14, X5
+ PXOR X14, X5
+ PADDD X5, X2
+ PXOR X2, X11
+ ROL8(X11, X14)
+ PADDD X11, X8
+ PXOR X8, X5
+ MOVO X5, X14
+ PSLLL $0x07, X14
+ PSRLL $0x19, X5
+ PXOR X14, X5
+ MOVO 64(BP), X14
+ MOVO X7, 64(BP)
+ PADDD X13, X12
+ PXOR X12, X15
+ ROL16(X15, X7)
+ PADDD X15, X14
+ PXOR X14, X13
+ MOVO X13, X7
+ PSLLL $0x0c, X7
+ PSRLL $0x14, X13
+ PXOR X7, X13
+ PADDD X13, X12
+ PXOR X12, X15
+ ROL8(X15, X7)
+ PADDD X15, X14
+ PXOR X14, X13
+ MOVO X13, X7
+ PSLLL $0x07, X7
+ PSRLL $0x19, X13
+ PXOR X7, X13
+ MOVO 64(BP), X7
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xdb
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xe4
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xed
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xed
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xf6
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xff
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xc0
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xf6
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xc9
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xd2
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xdb
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xff
+ BYTE $0x0c
+ MOVO X14, 64(BP)
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL16(X9, X14)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X14
+ PSLLL $0x0c, X14
+ PSRLL $0x14, X3
+ PXOR X14, X3
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL8(X9, X14)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X14
+ PSLLL $0x07, X14
+ PSRLL $0x19, X3
+ PXOR X14, X3
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL16(X10, X14)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X14
+ PSLLL $0x0c, X14
+ PSRLL $0x14, X4
+ PXOR X14, X4
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL8(X10, X14)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X14
+ PSLLL $0x07, X14
+ PSRLL $0x19, X4
+ PXOR X14, X4
+ PADDD X5, X2
+ PXOR X2, X11
+ ROL16(X11, X14)
+ PADDD X11, X8
+ PXOR X8, X5
+ MOVO X5, X14
+ PSLLL $0x0c, X14
+ PSRLL $0x14, X5
+ PXOR X14, X5
+ PADDD X5, X2
+ PXOR X2, X11
+ ROL8(X11, X14)
+ PADDD X11, X8
+ PXOR X8, X5
+ MOVO X5, X14
+ PSLLL $0x07, X14
+ PSRLL $0x19, X5
+ PXOR X14, X5
+ MOVO 64(BP), X14
+ MOVO X7, 64(BP)
+ PADDD X13, X12
+ PXOR X12, X15
+ ROL16(X15, X7)
+ PADDD X15, X14
+ PXOR X14, X13
+ MOVO X13, X7
+ PSLLL $0x0c, X7
+ PSRLL $0x14, X13
+ PXOR X7, X13
+ PADDD X13, X12
+ PXOR X12, X15
+ ROL8(X15, X7)
+ PADDD X15, X14
+ PXOR X14, X13
+ MOVO X13, X7
+ PSLLL $0x07, X7
+ PSRLL $0x19, X13
+ PXOR X7, X13
+ MOVO 64(BP), X7
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xdb
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xe4
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xed
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xed
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xf6
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xff
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xc0
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xf6
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xc9
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xd2
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xdb
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xff
+ BYTE $0x04
+ DECQ R9
+ JNE sealSSEIntroLoop
// Add in the state
- PADDD ·chacha20Constants<>(SB), A0; PADDD ·chacha20Constants<>(SB), A1; PADDD ·chacha20Constants<>(SB), A2; PADDD ·chacha20Constants<>(SB), A3
- PADDD state1Store, B0; PADDD state1Store, B1; PADDD state1Store, B2; PADDD state1Store, B3
- PADDD state2Store, C1; PADDD state2Store, C2; PADDD state2Store, C3
- PADDD ctr1Store, D1; PADDD ctr2Store, D2; PADDD ctr3Store, D3
+ PADDD ·chacha20Constants<>+0(SB), X0
+ PADDD ·chacha20Constants<>+0(SB), X1
+ PADDD ·chacha20Constants<>+0(SB), X2
+ PADDD ·chacha20Constants<>+0(SB), X12
+ PADDD 32(BP), X3
+ PADDD 32(BP), X4
+ PADDD 32(BP), X5
+ PADDD 32(BP), X13
+ PADDD 48(BP), X7
+ PADDD 48(BP), X8
+ PADDD 48(BP), X14
+ PADDD 96(BP), X10
+ PADDD 112(BP), X11
+ PADDD 128(BP), X15
// Clamp and store the key
- PAND ·polyClampMask<>(SB), A0
- MOVO A0, rStore
- MOVO B0, sStore
+ PAND ·polyClampMask<>+0(SB), X0
+ MOVO X0, (BP)
+ MOVO X3, 16(BP)
// Hash AAD
- MOVQ ad_len+80(FP), itr2
- CALL polyHashADInternal<>(SB)
-
- MOVOU (0*16)(inp), A0; MOVOU (1*16)(inp), B0; MOVOU (2*16)(inp), C0; MOVOU (3*16)(inp), D0
- PXOR A0, A1; PXOR B0, B1; PXOR C0, C1; PXOR D0, D1
- MOVOU A1, (0*16)(oup); MOVOU B1, (1*16)(oup); MOVOU C1, (2*16)(oup); MOVOU D1, (3*16)(oup)
- MOVOU (4*16)(inp), A0; MOVOU (5*16)(inp), B0; MOVOU (6*16)(inp), C0; MOVOU (7*16)(inp), D0
- PXOR A0, A2; PXOR B0, B2; PXOR C0, C2; PXOR D0, D2
- MOVOU A2, (4*16)(oup); MOVOU B2, (5*16)(oup); MOVOU C2, (6*16)(oup); MOVOU D2, (7*16)(oup)
-
- MOVQ $128, itr1
- SUBQ $128, inl
- LEAQ 128(inp), inp
-
- MOVO A3, A1; MOVO B3, B1; MOVO C3, C1; MOVO D3, D1
-
- CMPQ inl, $64
- JBE sealSSE128SealHash
-
- MOVOU (0*16)(inp), A0; MOVOU (1*16)(inp), B0; MOVOU (2*16)(inp), C0; MOVOU (3*16)(inp), D0
- PXOR A0, A3; PXOR B0, B3; PXOR C0, C3; PXOR D0, D3
- MOVOU A3, (8*16)(oup); MOVOU B3, (9*16)(oup); MOVOU C3, (10*16)(oup); MOVOU D3, (11*16)(oup)
-
- ADDQ $64, itr1
- SUBQ $64, inl
- LEAQ 64(inp), inp
-
- MOVQ $2, itr1
- MOVQ $8, itr2
-
- CMPQ inl, $64
- JBE sealSSETail64
- CMPQ inl, $128
- JBE sealSSETail128
- CMPQ inl, $192
- JBE sealSSETail192
+ MOVQ ad_len+80(FP), R9
+ CALL polyHashADInternal<>(SB)
+ MOVOU (SI), X0
+ MOVOU 16(SI), X3
+ MOVOU 32(SI), X6
+ MOVOU 48(SI), X9
+ PXOR X0, X1
+ PXOR X3, X4
+ PXOR X6, X7
+ PXOR X9, X10
+ MOVOU X1, (DI)
+ MOVOU X4, 16(DI)
+ MOVOU X7, 32(DI)
+ MOVOU X10, 48(DI)
+ MOVOU 64(SI), X0
+ MOVOU 80(SI), X3
+ MOVOU 96(SI), X6
+ MOVOU 112(SI), X9
+ PXOR X0, X2
+ PXOR X3, X5
+ PXOR X6, X8
+ PXOR X9, X11
+ MOVOU X2, 64(DI)
+ MOVOU X5, 80(DI)
+ MOVOU X8, 96(DI)
+ MOVOU X11, 112(DI)
+ MOVQ $0x00000080, CX
+ SUBQ $0x80, BX
+ LEAQ 128(SI), SI
+ MOVO X12, X1
+ MOVO X13, X4
+ MOVO X14, X7
+ MOVO X15, X10
+ CMPQ BX, $0x40
+ JBE sealSSE128SealHash
+ MOVOU (SI), X0
+ MOVOU 16(SI), X3
+ MOVOU 32(SI), X6
+ MOVOU 48(SI), X9
+ PXOR X0, X12
+ PXOR X3, X13
+ PXOR X6, X14
+ PXOR X9, X15
+ MOVOU X12, 128(DI)
+ MOVOU X13, 144(DI)
+ MOVOU X14, 160(DI)
+ MOVOU X15, 176(DI)
+ ADDQ $0x40, CX
+ SUBQ $0x40, BX
+ LEAQ 64(SI), SI
+ MOVQ $0x00000002, CX
+ MOVQ $0x00000008, R9
+ CMPQ BX, $0x40
+ JBE sealSSETail64
+ CMPQ BX, $0x80
+ JBE sealSSETail128
+ CMPQ BX, $0xc0
+ JBE sealSSETail192
sealSSEMainLoop:
// Load state, increment counter blocks
- MOVO ·chacha20Constants<>(SB), A0; MOVO state1Store, B0; MOVO state2Store, C0; MOVO ctr3Store, D0; PADDL ·sseIncMask<>(SB), D0
- MOVO A0, A1; MOVO B0, B1; MOVO C0, C1; MOVO D0, D1; PADDL ·sseIncMask<>(SB), D1
- MOVO A1, A2; MOVO B1, B2; MOVO C1, C2; MOVO D1, D2; PADDL ·sseIncMask<>(SB), D2
- MOVO A2, A3; MOVO B2, B3; MOVO C2, C3; MOVO D2, D3; PADDL ·sseIncMask<>(SB), D3
+ MOVO ·chacha20Constants<>+0(SB), X0
+ MOVO 32(BP), X3
+ MOVO 48(BP), X6
+ MOVO 128(BP), X9
+ PADDL ·sseIncMask<>+0(SB), X9
+ MOVO X0, X1
+ MOVO X3, X4
+ MOVO X6, X7
+ MOVO X9, X10
+ PADDL ·sseIncMask<>+0(SB), X10
+ MOVO X1, X2
+ MOVO X4, X5
+ MOVO X7, X8
+ MOVO X10, X11
+ PADDL ·sseIncMask<>+0(SB), X11
+ MOVO X2, X12
+ MOVO X5, X13
+ MOVO X8, X14
+ MOVO X11, X15
+ PADDL ·sseIncMask<>+0(SB), X15
// Store counters
- MOVO D0, ctr0Store; MOVO D1, ctr1Store; MOVO D2, ctr2Store; MOVO D3, ctr3Store
+ MOVO X9, 80(BP)
+ MOVO X10, 96(BP)
+ MOVO X11, 112(BP)
+ MOVO X15, 128(BP)
sealSSEInnerLoop:
- MOVO C3, tmpStore
- chachaQR(A0, B0, C0, D0, C3); chachaQR(A1, B1, C1, D1, C3); chachaQR(A2, B2, C2, D2, C3)
- MOVO tmpStore, C3
- MOVO C1, tmpStore
- chachaQR(A3, B3, C3, D3, C1)
- MOVO tmpStore, C1
- polyAdd(0(oup))
- shiftB0Left; shiftB1Left; shiftB2Left; shiftB3Left
- shiftC0Left; shiftC1Left; shiftC2Left; shiftC3Left
- shiftD0Left; shiftD1Left; shiftD2Left; shiftD3Left
- polyMulStage1
- polyMulStage2
- LEAQ (2*8)(oup), oup
- MOVO C3, tmpStore
- chachaQR(A0, B0, C0, D0, C3); chachaQR(A1, B1, C1, D1, C3); chachaQR(A2, B2, C2, D2, C3)
- MOVO tmpStore, C3
- MOVO C1, tmpStore
- polyMulStage3
- chachaQR(A3, B3, C3, D3, C1)
- MOVO tmpStore, C1
- polyMulReduceStage
- shiftB0Right; shiftB1Right; shiftB2Right; shiftB3Right
- shiftC0Right; shiftC1Right; shiftC2Right; shiftC3Right
- shiftD0Right; shiftD1Right; shiftD2Right; shiftD3Right
- DECQ itr2
- JGE sealSSEInnerLoop
- polyAdd(0(oup))
- polyMul
- LEAQ (2*8)(oup), oup
- DECQ itr1
- JG sealSSEInnerLoop
+ MOVO X14, 64(BP)
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL16(X9, X14)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X14
+ PSLLL $0x0c, X14
+ PSRLL $0x14, X3
+ PXOR X14, X3
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL8(X9, X14)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X14
+ PSLLL $0x07, X14
+ PSRLL $0x19, X3
+ PXOR X14, X3
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL16(X10, X14)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X14
+ PSLLL $0x0c, X14
+ PSRLL $0x14, X4
+ PXOR X14, X4
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL8(X10, X14)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X14
+ PSLLL $0x07, X14
+ PSRLL $0x19, X4
+ PXOR X14, X4
+ PADDD X5, X2
+ PXOR X2, X11
+ ROL16(X11, X14)
+ PADDD X11, X8
+ PXOR X8, X5
+ MOVO X5, X14
+ PSLLL $0x0c, X14
+ PSRLL $0x14, X5
+ PXOR X14, X5
+ PADDD X5, X2
+ PXOR X2, X11
+ ROL8(X11, X14)
+ PADDD X11, X8
+ PXOR X8, X5
+ MOVO X5, X14
+ PSLLL $0x07, X14
+ PSRLL $0x19, X5
+ PXOR X14, X5
+ MOVO 64(BP), X14
+ MOVO X7, 64(BP)
+ PADDD X13, X12
+ PXOR X12, X15
+ ROL16(X15, X7)
+ PADDD X15, X14
+ PXOR X14, X13
+ MOVO X13, X7
+ PSLLL $0x0c, X7
+ PSRLL $0x14, X13
+ PXOR X7, X13
+ PADDD X13, X12
+ PXOR X12, X15
+ ROL8(X15, X7)
+ PADDD X15, X14
+ PXOR X14, X13
+ MOVO X13, X7
+ PSLLL $0x07, X7
+ PSRLL $0x19, X13
+ PXOR X7, X13
+ MOVO 64(BP), X7
+ ADDQ (DI), R10
+ ADCQ 8(DI), R11
+ ADCQ $0x01, R12
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xdb
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xe4
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xed
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xed
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xf6
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xff
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xc0
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xf6
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xc9
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xd2
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xdb
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xff
+ BYTE $0x0c
+ MOVQ (BP), AX
+ MOVQ AX, R15
+ MULQ R10
+ MOVQ AX, R13
+ MOVQ DX, R14
+ MOVQ (BP), AX
+ MULQ R11
+ IMULQ R12, R15
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), AX
+ MOVQ AX, R8
+ MULQ R10
+ ADDQ AX, R14
+ ADCQ $0x00, DX
+ MOVQ DX, R10
+ MOVQ 8(BP), AX
+ MULQ R11
+ ADDQ AX, R15
+ ADCQ $0x00, DX
+ LEAQ 16(DI), DI
+ MOVO X14, 64(BP)
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL16(X9, X14)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X14
+ PSLLL $0x0c, X14
+ PSRLL $0x14, X3
+ PXOR X14, X3
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL8(X9, X14)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X14
+ PSLLL $0x07, X14
+ PSRLL $0x19, X3
+ PXOR X14, X3
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL16(X10, X14)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X14
+ PSLLL $0x0c, X14
+ PSRLL $0x14, X4
+ PXOR X14, X4
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL8(X10, X14)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X14
+ PSLLL $0x07, X14
+ PSRLL $0x19, X4
+ PXOR X14, X4
+ PADDD X5, X2
+ PXOR X2, X11
+ ROL16(X11, X14)
+ PADDD X11, X8
+ PXOR X8, X5
+ MOVO X5, X14
+ PSLLL $0x0c, X14
+ PSRLL $0x14, X5
+ PXOR X14, X5
+ PADDD X5, X2
+ PXOR X2, X11
+ ROL8(X11, X14)
+ PADDD X11, X8
+ PXOR X8, X5
+ MOVO X5, X14
+ PSLLL $0x07, X14
+ PSRLL $0x19, X5
+ PXOR X14, X5
+ MOVO 64(BP), X14
+ MOVO X7, 64(BP)
+ IMULQ R12, R8
+ ADDQ R10, R15
+ ADCQ DX, R8
+ PADDD X13, X12
+ PXOR X12, X15
+ ROL16(X15, X7)
+ PADDD X15, X14
+ PXOR X14, X13
+ MOVO X13, X7
+ PSLLL $0x0c, X7
+ PSRLL $0x14, X13
+ PXOR X7, X13
+ PADDD X13, X12
+ PXOR X12, X15
+ ROL8(X15, X7)
+ PADDD X15, X14
+ PXOR X14, X13
+ MOVO X13, X7
+ PSLLL $0x07, X7
+ PSRLL $0x19, X13
+ PXOR X7, X13
+ MOVO 64(BP), X7
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xdb
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xe4
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xed
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xed
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xf6
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xff
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xc0
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xf6
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xc9
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xd2
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xdb
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xff
+ BYTE $0x04
+ DECQ R9
+ JGE sealSSEInnerLoop
+ ADDQ (DI), R10
+ ADCQ 8(DI), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), AX
+ MOVQ AX, R15
+ MULQ R10
+ MOVQ AX, R13
+ MOVQ DX, R14
+ MOVQ (BP), AX
+ MULQ R11
+ IMULQ R12, R15
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), AX
+ MOVQ AX, R8
+ MULQ R10
+ ADDQ AX, R14
+ ADCQ $0x00, DX
+ MOVQ DX, R10
+ MOVQ 8(BP), AX
+ MULQ R11
+ ADDQ AX, R15
+ ADCQ $0x00, DX
+ IMULQ R12, R8
+ ADDQ R10, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ LEAQ 16(DI), DI
+ DECQ CX
+ JG sealSSEInnerLoop
// Add in the state
- PADDD ·chacha20Constants<>(SB), A0; PADDD ·chacha20Constants<>(SB), A1; PADDD ·chacha20Constants<>(SB), A2; PADDD ·chacha20Constants<>(SB), A3
- PADDD state1Store, B0; PADDD state1Store, B1; PADDD state1Store, B2; PADDD state1Store, B3
- PADDD state2Store, C0; PADDD state2Store, C1; PADDD state2Store, C2; PADDD state2Store, C3
- PADDD ctr0Store, D0; PADDD ctr1Store, D1; PADDD ctr2Store, D2; PADDD ctr3Store, D3
- MOVO D3, tmpStore
+ PADDD ·chacha20Constants<>+0(SB), X0
+ PADDD ·chacha20Constants<>+0(SB), X1
+ PADDD ·chacha20Constants<>+0(SB), X2
+ PADDD ·chacha20Constants<>+0(SB), X12
+ PADDD 32(BP), X3
+ PADDD 32(BP), X4
+ PADDD 32(BP), X5
+ PADDD 32(BP), X13
+ PADDD 48(BP), X6
+ PADDD 48(BP), X7
+ PADDD 48(BP), X8
+ PADDD 48(BP), X14
+ PADDD 80(BP), X9
+ PADDD 96(BP), X10
+ PADDD 112(BP), X11
+ PADDD 128(BP), X15
+ MOVO X15, 64(BP)
// Load - xor - store
- MOVOU (0*16)(inp), D3; PXOR D3, A0
- MOVOU (1*16)(inp), D3; PXOR D3, B0
- MOVOU (2*16)(inp), D3; PXOR D3, C0
- MOVOU (3*16)(inp), D3; PXOR D3, D0
- MOVOU A0, (0*16)(oup)
- MOVOU B0, (1*16)(oup)
- MOVOU C0, (2*16)(oup)
- MOVOU D0, (3*16)(oup)
- MOVO tmpStore, D3
-
- MOVOU (4*16)(inp), A0; MOVOU (5*16)(inp), B0; MOVOU (6*16)(inp), C0; MOVOU (7*16)(inp), D0
- PXOR A0, A1; PXOR B0, B1; PXOR C0, C1; PXOR D0, D1
- MOVOU A1, (4*16)(oup); MOVOU B1, (5*16)(oup); MOVOU C1, (6*16)(oup); MOVOU D1, (7*16)(oup)
- MOVOU (8*16)(inp), A0; MOVOU (9*16)(inp), B0; MOVOU (10*16)(inp), C0; MOVOU (11*16)(inp), D0
- PXOR A0, A2; PXOR B0, B2; PXOR C0, C2; PXOR D0, D2
- MOVOU A2, (8*16)(oup); MOVOU B2, (9*16)(oup); MOVOU C2, (10*16)(oup); MOVOU D2, (11*16)(oup)
- ADDQ $192, inp
- MOVQ $192, itr1
- SUBQ $192, inl
- MOVO A3, A1
- MOVO B3, B1
- MOVO C3, C1
- MOVO D3, D1
- CMPQ inl, $64
+ MOVOU (SI), X15
+ PXOR X15, X0
+ MOVOU 16(SI), X15
+ PXOR X15, X3
+ MOVOU 32(SI), X15
+ PXOR X15, X6
+ MOVOU 48(SI), X15
+ PXOR X15, X9
+ MOVOU X0, (DI)
+ MOVOU X3, 16(DI)
+ MOVOU X6, 32(DI)
+ MOVOU X9, 48(DI)
+ MOVO 64(BP), X15
+ MOVOU 64(SI), X0
+ MOVOU 80(SI), X3
+ MOVOU 96(SI), X6
+ MOVOU 112(SI), X9
+ PXOR X0, X1
+ PXOR X3, X4
+ PXOR X6, X7
+ PXOR X9, X10
+ MOVOU X1, 64(DI)
+ MOVOU X4, 80(DI)
+ MOVOU X7, 96(DI)
+ MOVOU X10, 112(DI)
+ MOVOU 128(SI), X0
+ MOVOU 144(SI), X3
+ MOVOU 160(SI), X6
+ MOVOU 176(SI), X9
+ PXOR X0, X2
+ PXOR X3, X5
+ PXOR X6, X8
+ PXOR X9, X11
+ MOVOU X2, 128(DI)
+ MOVOU X5, 144(DI)
+ MOVOU X8, 160(DI)
+ MOVOU X11, 176(DI)
+ ADDQ $0xc0, SI
+ MOVQ $0x000000c0, CX
+ SUBQ $0xc0, BX
+ MOVO X12, X1
+ MOVO X13, X4
+ MOVO X14, X7
+ MOVO X15, X10
+ CMPQ BX, $0x40
JBE sealSSE128SealHash
- MOVOU (0*16)(inp), A0; MOVOU (1*16)(inp), B0; MOVOU (2*16)(inp), C0; MOVOU (3*16)(inp), D0
- PXOR A0, A3; PXOR B0, B3; PXOR C0, C3; PXOR D0, D3
- MOVOU A3, (12*16)(oup); MOVOU B3, (13*16)(oup); MOVOU C3, (14*16)(oup); MOVOU D3, (15*16)(oup)
- LEAQ 64(inp), inp
- SUBQ $64, inl
- MOVQ $6, itr1
- MOVQ $4, itr2
- CMPQ inl, $192
+ MOVOU (SI), X0
+ MOVOU 16(SI), X3
+ MOVOU 32(SI), X6
+ MOVOU 48(SI), X9
+ PXOR X0, X12
+ PXOR X3, X13
+ PXOR X6, X14
+ PXOR X9, X15
+ MOVOU X12, 192(DI)
+ MOVOU X13, 208(DI)
+ MOVOU X14, 224(DI)
+ MOVOU X15, 240(DI)
+ LEAQ 64(SI), SI
+ SUBQ $0x40, BX
+ MOVQ $0x00000006, CX
+ MOVQ $0x00000004, R9
+ CMPQ BX, $0xc0
JG sealSSEMainLoop
-
- MOVQ inl, itr1
- TESTQ inl, inl
+ MOVQ BX, CX
+ TESTQ BX, BX
JE sealSSE128SealHash
- MOVQ $6, itr1
- CMPQ inl, $64
+ MOVQ $0x00000006, CX
+ CMPQ BX, $0x40
JBE sealSSETail64
- CMPQ inl, $128
+ CMPQ BX, $0x80
JBE sealSSETail128
JMP sealSSETail192
-// ----------------------------------------------------------------------------
-// Special optimization for the last 64 bytes of plaintext
sealSSETail64:
- // Need to encrypt up to 64 bytes - prepare single block, hash 192 or 256 bytes
- MOVO ·chacha20Constants<>(SB), A1
- MOVO state1Store, B1
- MOVO state2Store, C1
- MOVO ctr3Store, D1
- PADDL ·sseIncMask<>(SB), D1
- MOVO D1, ctr0Store
+ MOVO ·chacha20Constants<>+0(SB), X1
+ MOVO 32(BP), X4
+ MOVO 48(BP), X7
+ MOVO 128(BP), X10
+ PADDL ·sseIncMask<>+0(SB), X10
+ MOVO X10, 80(BP)
sealSSETail64LoopA:
- // Perform ChaCha rounds, while hashing the previously encrypted ciphertext
- polyAdd(0(oup))
- polyMul
- LEAQ 16(oup), oup
+ ADDQ (DI), R10
+ ADCQ 8(DI), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), AX
+ MOVQ AX, R15
+ MULQ R10
+ MOVQ AX, R13
+ MOVQ DX, R14
+ MOVQ (BP), AX
+ MULQ R11
+ IMULQ R12, R15
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), AX
+ MOVQ AX, R8
+ MULQ R10
+ ADDQ AX, R14
+ ADCQ $0x00, DX
+ MOVQ DX, R10
+ MOVQ 8(BP), AX
+ MULQ R11
+ ADDQ AX, R15
+ ADCQ $0x00, DX
+ IMULQ R12, R8
+ ADDQ R10, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ LEAQ 16(DI), DI
sealSSETail64LoopB:
- chachaQR(A1, B1, C1, D1, T1)
- shiftB1Left; shiftC1Left; shiftD1Left
- chachaQR(A1, B1, C1, D1, T1)
- shiftB1Right; shiftC1Right; shiftD1Right
- polyAdd(0(oup))
- polyMul
- LEAQ 16(oup), oup
-
- DECQ itr1
- JG sealSSETail64LoopA
-
- DECQ itr2
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL16(X10, X13)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X13
+ PSLLL $0x0c, X13
+ PSRLL $0x14, X4
+ PXOR X13, X4
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL8(X10, X13)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X13
+ PSLLL $0x07, X13
+ PSRLL $0x19, X4
+ PXOR X13, X4
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xe4
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xff
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xd2
+ BYTE $0x0c
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL16(X10, X13)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X13
+ PSLLL $0x0c, X13
+ PSRLL $0x14, X4
+ PXOR X13, X4
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL8(X10, X13)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X13
+ PSLLL $0x07, X13
+ PSRLL $0x19, X4
+ PXOR X13, X4
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xe4
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xff
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xd2
+ BYTE $0x04
+ ADDQ (DI), R10
+ ADCQ 8(DI), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), AX
+ MOVQ AX, R15
+ MULQ R10
+ MOVQ AX, R13
+ MOVQ DX, R14
+ MOVQ (BP), AX
+ MULQ R11
+ IMULQ R12, R15
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), AX
+ MOVQ AX, R8
+ MULQ R10
+ ADDQ AX, R14
+ ADCQ $0x00, DX
+ MOVQ DX, R10
+ MOVQ 8(BP), AX
+ MULQ R11
+ ADDQ AX, R15
+ ADCQ $0x00, DX
+ IMULQ R12, R8
+ ADDQ R10, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ LEAQ 16(DI), DI
+ DECQ CX
+ JG sealSSETail64LoopA
+ DECQ R9
JGE sealSSETail64LoopB
- PADDL ·chacha20Constants<>(SB), A1
- PADDL state1Store, B1
- PADDL state2Store, C1
- PADDL ctr0Store, D1
+ PADDL ·chacha20Constants<>+0(SB), X1
+ PADDL 32(BP), X4
+ PADDL 48(BP), X7
+ PADDL 80(BP), X10
+ JMP sealSSE128Seal
- JMP sealSSE128Seal
-
-// ----------------------------------------------------------------------------
-// Special optimization for the last 128 bytes of plaintext
sealSSETail128:
- // Need to encrypt up to 128 bytes - prepare two blocks, hash 192 or 256 bytes
- MOVO ·chacha20Constants<>(SB), A0; MOVO state1Store, B0; MOVO state2Store, C0; MOVO ctr3Store, D0; PADDL ·sseIncMask<>(SB), D0; MOVO D0, ctr0Store
- MOVO A0, A1; MOVO B0, B1; MOVO C0, C1; MOVO D0, D1; PADDL ·sseIncMask<>(SB), D1; MOVO D1, ctr1Store
+ MOVO ·chacha20Constants<>+0(SB), X0
+ MOVO 32(BP), X3
+ MOVO 48(BP), X6
+ MOVO 128(BP), X9
+ PADDL ·sseIncMask<>+0(SB), X9
+ MOVO X9, 80(BP)
+ MOVO X0, X1
+ MOVO X3, X4
+ MOVO X6, X7
+ MOVO X9, X10
+ PADDL ·sseIncMask<>+0(SB), X10
+ MOVO X10, 96(BP)
sealSSETail128LoopA:
- // Perform ChaCha rounds, while hashing the previously encrypted ciphertext
- polyAdd(0(oup))
- polyMul
- LEAQ 16(oup), oup
+ ADDQ (DI), R10
+ ADCQ 8(DI), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), AX
+ MOVQ AX, R15
+ MULQ R10
+ MOVQ AX, R13
+ MOVQ DX, R14
+ MOVQ (BP), AX
+ MULQ R11
+ IMULQ R12, R15
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), AX
+ MOVQ AX, R8
+ MULQ R10
+ ADDQ AX, R14
+ ADCQ $0x00, DX
+ MOVQ DX, R10
+ MOVQ 8(BP), AX
+ MULQ R11
+ ADDQ AX, R15
+ ADCQ $0x00, DX
+ IMULQ R12, R8
+ ADDQ R10, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ LEAQ 16(DI), DI
sealSSETail128LoopB:
- chachaQR(A0, B0, C0, D0, T0); chachaQR(A1, B1, C1, D1, T0)
- shiftB0Left; shiftC0Left; shiftD0Left
- shiftB1Left; shiftC1Left; shiftD1Left
- polyAdd(0(oup))
- polyMul
- LEAQ 16(oup), oup
- chachaQR(A0, B0, C0, D0, T0); chachaQR(A1, B1, C1, D1, T0)
- shiftB0Right; shiftC0Right; shiftD0Right
- shiftB1Right; shiftC1Right; shiftD1Right
-
- DECQ itr1
- JG sealSSETail128LoopA
-
- DECQ itr2
- JGE sealSSETail128LoopB
-
- PADDL ·chacha20Constants<>(SB), A0; PADDL ·chacha20Constants<>(SB), A1
- PADDL state1Store, B0; PADDL state1Store, B1
- PADDL state2Store, C0; PADDL state2Store, C1
- PADDL ctr0Store, D0; PADDL ctr1Store, D1
-
- MOVOU (0*16)(inp), T0; MOVOU (1*16)(inp), T1; MOVOU (2*16)(inp), T2; MOVOU (3*16)(inp), T3
- PXOR T0, A0; PXOR T1, B0; PXOR T2, C0; PXOR T3, D0
- MOVOU A0, (0*16)(oup); MOVOU B0, (1*16)(oup); MOVOU C0, (2*16)(oup); MOVOU D0, (3*16)(oup)
-
- MOVQ $64, itr1
- LEAQ 64(inp), inp
- SUBQ $64, inl
-
- JMP sealSSE128SealHash
-
-// ----------------------------------------------------------------------------
-// Special optimization for the last 192 bytes of plaintext
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL16(X9, X12)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X12
+ PSLLL $0x0c, X12
+ PSRLL $0x14, X3
+ PXOR X12, X3
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL8(X9, X12)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X12
+ PSLLL $0x07, X12
+ PSRLL $0x19, X3
+ PXOR X12, X3
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL16(X10, X12)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X12
+ PSLLL $0x0c, X12
+ PSRLL $0x14, X4
+ PXOR X12, X4
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL8(X10, X12)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X12
+ PSLLL $0x07, X12
+ PSRLL $0x19, X4
+ PXOR X12, X4
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xdb
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xf6
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xc9
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xe4
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xff
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xd2
+ BYTE $0x0c
+ ADDQ (DI), R10
+ ADCQ 8(DI), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), AX
+ MOVQ AX, R15
+ MULQ R10
+ MOVQ AX, R13
+ MOVQ DX, R14
+ MOVQ (BP), AX
+ MULQ R11
+ IMULQ R12, R15
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), AX
+ MOVQ AX, R8
+ MULQ R10
+ ADDQ AX, R14
+ ADCQ $0x00, DX
+ MOVQ DX, R10
+ MOVQ 8(BP), AX
+ MULQ R11
+ ADDQ AX, R15
+ ADCQ $0x00, DX
+ IMULQ R12, R8
+ ADDQ R10, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ LEAQ 16(DI), DI
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL16(X9, X12)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X12
+ PSLLL $0x0c, X12
+ PSRLL $0x14, X3
+ PXOR X12, X3
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL8(X9, X12)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X12
+ PSLLL $0x07, X12
+ PSRLL $0x19, X3
+ PXOR X12, X3
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL16(X10, X12)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X12
+ PSLLL $0x0c, X12
+ PSRLL $0x14, X4
+ PXOR X12, X4
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL8(X10, X12)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X12
+ PSLLL $0x07, X12
+ PSRLL $0x19, X4
+ PXOR X12, X4
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xdb
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xf6
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xc9
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xe4
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xff
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xd2
+ BYTE $0x04
+ DECQ CX
+ JG sealSSETail128LoopA
+ DECQ R9
+ JGE sealSSETail128LoopB
+ PADDL ·chacha20Constants<>+0(SB), X0
+ PADDL ·chacha20Constants<>+0(SB), X1
+ PADDL 32(BP), X3
+ PADDL 32(BP), X4
+ PADDL 48(BP), X6
+ PADDL 48(BP), X7
+ PADDL 80(BP), X9
+ PADDL 96(BP), X10
+ MOVOU (SI), X12
+ MOVOU 16(SI), X13
+ MOVOU 32(SI), X14
+ MOVOU 48(SI), X15
+ PXOR X12, X0
+ PXOR X13, X3
+ PXOR X14, X6
+ PXOR X15, X9
+ MOVOU X0, (DI)
+ MOVOU X3, 16(DI)
+ MOVOU X6, 32(DI)
+ MOVOU X9, 48(DI)
+ MOVQ $0x00000040, CX
+ LEAQ 64(SI), SI
+ SUBQ $0x40, BX
+ JMP sealSSE128SealHash
+
sealSSETail192:
- // Need to encrypt up to 192 bytes - prepare three blocks, hash 192 or 256 bytes
- MOVO ·chacha20Constants<>(SB), A0; MOVO state1Store, B0; MOVO state2Store, C0; MOVO ctr3Store, D0; PADDL ·sseIncMask<>(SB), D0; MOVO D0, ctr0Store
- MOVO A0, A1; MOVO B0, B1; MOVO C0, C1; MOVO D0, D1; PADDL ·sseIncMask<>(SB), D1; MOVO D1, ctr1Store
- MOVO A1, A2; MOVO B1, B2; MOVO C1, C2; MOVO D1, D2; PADDL ·sseIncMask<>(SB), D2; MOVO D2, ctr2Store
+ MOVO ·chacha20Constants<>+0(SB), X0
+ MOVO 32(BP), X3
+ MOVO 48(BP), X6
+ MOVO 128(BP), X9
+ PADDL ·sseIncMask<>+0(SB), X9
+ MOVO X9, 80(BP)
+ MOVO X0, X1
+ MOVO X3, X4
+ MOVO X6, X7
+ MOVO X9, X10
+ PADDL ·sseIncMask<>+0(SB), X10
+ MOVO X10, 96(BP)
+ MOVO X1, X2
+ MOVO X4, X5
+ MOVO X7, X8
+ MOVO X10, X11
+ PADDL ·sseIncMask<>+0(SB), X11
+ MOVO X11, 112(BP)
sealSSETail192LoopA:
- // Perform ChaCha rounds, while hashing the previously encrypted ciphertext
- polyAdd(0(oup))
- polyMul
- LEAQ 16(oup), oup
+ ADDQ (DI), R10
+ ADCQ 8(DI), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), AX
+ MOVQ AX, R15
+ MULQ R10
+ MOVQ AX, R13
+ MOVQ DX, R14
+ MOVQ (BP), AX
+ MULQ R11
+ IMULQ R12, R15
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), AX
+ MOVQ AX, R8
+ MULQ R10
+ ADDQ AX, R14
+ ADCQ $0x00, DX
+ MOVQ DX, R10
+ MOVQ 8(BP), AX
+ MULQ R11
+ ADDQ AX, R15
+ ADCQ $0x00, DX
+ IMULQ R12, R8
+ ADDQ R10, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ LEAQ 16(DI), DI
sealSSETail192LoopB:
- chachaQR(A0, B0, C0, D0, T0); chachaQR(A1, B1, C1, D1, T0); chachaQR(A2, B2, C2, D2, T0)
- shiftB0Left; shiftC0Left; shiftD0Left
- shiftB1Left; shiftC1Left; shiftD1Left
- shiftB2Left; shiftC2Left; shiftD2Left
-
- polyAdd(0(oup))
- polyMul
- LEAQ 16(oup), oup
-
- chachaQR(A0, B0, C0, D0, T0); chachaQR(A1, B1, C1, D1, T0); chachaQR(A2, B2, C2, D2, T0)
- shiftB0Right; shiftC0Right; shiftD0Right
- shiftB1Right; shiftC1Right; shiftD1Right
- shiftB2Right; shiftC2Right; shiftD2Right
-
- DECQ itr1
- JG sealSSETail192LoopA
-
- DECQ itr2
- JGE sealSSETail192LoopB
-
- PADDL ·chacha20Constants<>(SB), A0; PADDL ·chacha20Constants<>(SB), A1; PADDL ·chacha20Constants<>(SB), A2
- PADDL state1Store, B0; PADDL state1Store, B1; PADDL state1Store, B2
- PADDL state2Store, C0; PADDL state2Store, C1; PADDL state2Store, C2
- PADDL ctr0Store, D0; PADDL ctr1Store, D1; PADDL ctr2Store, D2
-
- MOVOU (0*16)(inp), T0; MOVOU (1*16)(inp), T1; MOVOU (2*16)(inp), T2; MOVOU (3*16)(inp), T3
- PXOR T0, A0; PXOR T1, B0; PXOR T2, C0; PXOR T3, D0
- MOVOU A0, (0*16)(oup); MOVOU B0, (1*16)(oup); MOVOU C0, (2*16)(oup); MOVOU D0, (3*16)(oup)
- MOVOU (4*16)(inp), T0; MOVOU (5*16)(inp), T1; MOVOU (6*16)(inp), T2; MOVOU (7*16)(inp), T3
- PXOR T0, A1; PXOR T1, B1; PXOR T2, C1; PXOR T3, D1
- MOVOU A1, (4*16)(oup); MOVOU B1, (5*16)(oup); MOVOU C1, (6*16)(oup); MOVOU D1, (7*16)(oup)
-
- MOVO A2, A1
- MOVO B2, B1
- MOVO C2, C1
- MOVO D2, D1
- MOVQ $128, itr1
- LEAQ 128(inp), inp
- SUBQ $128, inl
-
- JMP sealSSE128SealHash
-
-// ----------------------------------------------------------------------------
-// Special seal optimization for buffers smaller than 129 bytes
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL16(X9, X12)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X12
+ PSLLL $0x0c, X12
+ PSRLL $0x14, X3
+ PXOR X12, X3
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL8(X9, X12)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X12
+ PSLLL $0x07, X12
+ PSRLL $0x19, X3
+ PXOR X12, X3
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL16(X10, X12)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X12
+ PSLLL $0x0c, X12
+ PSRLL $0x14, X4
+ PXOR X12, X4
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL8(X10, X12)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X12
+ PSLLL $0x07, X12
+ PSRLL $0x19, X4
+ PXOR X12, X4
+ PADDD X5, X2
+ PXOR X2, X11
+ ROL16(X11, X12)
+ PADDD X11, X8
+ PXOR X8, X5
+ MOVO X5, X12
+ PSLLL $0x0c, X12
+ PSRLL $0x14, X5
+ PXOR X12, X5
+ PADDD X5, X2
+ PXOR X2, X11
+ ROL8(X11, X12)
+ PADDD X11, X8
+ PXOR X8, X5
+ MOVO X5, X12
+ PSLLL $0x07, X12
+ PSRLL $0x19, X5
+ PXOR X12, X5
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xdb
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xf6
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xc9
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xe4
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xff
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xd2
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xed
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xc0
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xdb
+ BYTE $0x0c
+ ADDQ (DI), R10
+ ADCQ 8(DI), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), AX
+ MOVQ AX, R15
+ MULQ R10
+ MOVQ AX, R13
+ MOVQ DX, R14
+ MOVQ (BP), AX
+ MULQ R11
+ IMULQ R12, R15
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), AX
+ MOVQ AX, R8
+ MULQ R10
+ ADDQ AX, R14
+ ADCQ $0x00, DX
+ MOVQ DX, R10
+ MOVQ 8(BP), AX
+ MULQ R11
+ ADDQ AX, R15
+ ADCQ $0x00, DX
+ IMULQ R12, R8
+ ADDQ R10, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ LEAQ 16(DI), DI
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL16(X9, X12)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X12
+ PSLLL $0x0c, X12
+ PSRLL $0x14, X3
+ PXOR X12, X3
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL8(X9, X12)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X12
+ PSLLL $0x07, X12
+ PSRLL $0x19, X3
+ PXOR X12, X3
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL16(X10, X12)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X12
+ PSLLL $0x0c, X12
+ PSRLL $0x14, X4
+ PXOR X12, X4
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL8(X10, X12)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X12
+ PSLLL $0x07, X12
+ PSRLL $0x19, X4
+ PXOR X12, X4
+ PADDD X5, X2
+ PXOR X2, X11
+ ROL16(X11, X12)
+ PADDD X11, X8
+ PXOR X8, X5
+ MOVO X5, X12
+ PSLLL $0x0c, X12
+ PSRLL $0x14, X5
+ PXOR X12, X5
+ PADDD X5, X2
+ PXOR X2, X11
+ ROL8(X11, X12)
+ PADDD X11, X8
+ PXOR X8, X5
+ MOVO X5, X12
+ PSLLL $0x07, X12
+ PSRLL $0x19, X5
+ PXOR X12, X5
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xdb
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xf6
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xc9
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xe4
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xff
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xd2
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xed
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xc0
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xdb
+ BYTE $0x04
+ DECQ CX
+ JG sealSSETail192LoopA
+ DECQ R9
+ JGE sealSSETail192LoopB
+ PADDL ·chacha20Constants<>+0(SB), X0
+ PADDL ·chacha20Constants<>+0(SB), X1
+ PADDL ·chacha20Constants<>+0(SB), X2
+ PADDL 32(BP), X3
+ PADDL 32(BP), X4
+ PADDL 32(BP), X5
+ PADDL 48(BP), X6
+ PADDL 48(BP), X7
+ PADDL 48(BP), X8
+ PADDL 80(BP), X9
+ PADDL 96(BP), X10
+ PADDL 112(BP), X11
+ MOVOU (SI), X12
+ MOVOU 16(SI), X13
+ MOVOU 32(SI), X14
+ MOVOU 48(SI), X15
+ PXOR X12, X0
+ PXOR X13, X3
+ PXOR X14, X6
+ PXOR X15, X9
+ MOVOU X0, (DI)
+ MOVOU X3, 16(DI)
+ MOVOU X6, 32(DI)
+ MOVOU X9, 48(DI)
+ MOVOU 64(SI), X12
+ MOVOU 80(SI), X13
+ MOVOU 96(SI), X14
+ MOVOU 112(SI), X15
+ PXOR X12, X1
+ PXOR X13, X4
+ PXOR X14, X7
+ PXOR X15, X10
+ MOVOU X1, 64(DI)
+ MOVOU X4, 80(DI)
+ MOVOU X7, 96(DI)
+ MOVOU X10, 112(DI)
+ MOVO X2, X1
+ MOVO X5, X4
+ MOVO X8, X7
+ MOVO X11, X10
+ MOVQ $0x00000080, CX
+ LEAQ 128(SI), SI
+ SUBQ $0x80, BX
+ JMP sealSSE128SealHash
+
sealSSE128:
- // For up to 128 bytes of ciphertext and 64 bytes for the poly key, we require to process three blocks
- MOVOU ·chacha20Constants<>(SB), A0; MOVOU (1*16)(keyp), B0; MOVOU (2*16)(keyp), C0; MOVOU (3*16)(keyp), D0
- MOVO A0, A1; MOVO B0, B1; MOVO C0, C1; MOVO D0, D1; PADDL ·sseIncMask<>(SB), D1
- MOVO A1, A2; MOVO B1, B2; MOVO C1, C2; MOVO D1, D2; PADDL ·sseIncMask<>(SB), D2
- MOVO B0, T1; MOVO C0, T2; MOVO D1, T3
- MOVQ $10, itr2
+ MOVOU ·chacha20Constants<>+0(SB), X0
+ MOVOU 16(R8), X3
+ MOVOU 32(R8), X6
+ MOVOU 48(R8), X9
+ MOVO X0, X1
+ MOVO X3, X4
+ MOVO X6, X7
+ MOVO X9, X10
+ PADDL ·sseIncMask<>+0(SB), X10
+ MOVO X1, X2
+ MOVO X4, X5
+ MOVO X7, X8
+ MOVO X10, X11
+ PADDL ·sseIncMask<>+0(SB), X11
+ MOVO X3, X13
+ MOVO X6, X14
+ MOVO X10, X15
+ MOVQ $0x0000000a, R9
sealSSE128InnerCipherLoop:
- chachaQR(A0, B0, C0, D0, T0); chachaQR(A1, B1, C1, D1, T0); chachaQR(A2, B2, C2, D2, T0)
- shiftB0Left; shiftB1Left; shiftB2Left
- shiftC0Left; shiftC1Left; shiftC2Left
- shiftD0Left; shiftD1Left; shiftD2Left
- chachaQR(A0, B0, C0, D0, T0); chachaQR(A1, B1, C1, D1, T0); chachaQR(A2, B2, C2, D2, T0)
- shiftB0Right; shiftB1Right; shiftB2Right
- shiftC0Right; shiftC1Right; shiftC2Right
- shiftD0Right; shiftD1Right; shiftD2Right
- DECQ itr2
- JNE sealSSE128InnerCipherLoop
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL16(X9, X12)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X12
+ PSLLL $0x0c, X12
+ PSRLL $0x14, X3
+ PXOR X12, X3
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL8(X9, X12)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X12
+ PSLLL $0x07, X12
+ PSRLL $0x19, X3
+ PXOR X12, X3
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL16(X10, X12)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X12
+ PSLLL $0x0c, X12
+ PSRLL $0x14, X4
+ PXOR X12, X4
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL8(X10, X12)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X12
+ PSLLL $0x07, X12
+ PSRLL $0x19, X4
+ PXOR X12, X4
+ PADDD X5, X2
+ PXOR X2, X11
+ ROL16(X11, X12)
+ PADDD X11, X8
+ PXOR X8, X5
+ MOVO X5, X12
+ PSLLL $0x0c, X12
+ PSRLL $0x14, X5
+ PXOR X12, X5
+ PADDD X5, X2
+ PXOR X2, X11
+ ROL8(X11, X12)
+ PADDD X11, X8
+ PXOR X8, X5
+ MOVO X5, X12
+ PSLLL $0x07, X12
+ PSRLL $0x19, X5
+ PXOR X12, X5
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xdb
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xe4
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xed
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xf6
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xff
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xc0
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xc9
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xd2
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xdb
+ BYTE $0x0c
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL16(X9, X12)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X12
+ PSLLL $0x0c, X12
+ PSRLL $0x14, X3
+ PXOR X12, X3
+ PADDD X3, X0
+ PXOR X0, X9
+ ROL8(X9, X12)
+ PADDD X9, X6
+ PXOR X6, X3
+ MOVO X3, X12
+ PSLLL $0x07, X12
+ PSRLL $0x19, X3
+ PXOR X12, X3
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL16(X10, X12)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X12
+ PSLLL $0x0c, X12
+ PSRLL $0x14, X4
+ PXOR X12, X4
+ PADDD X4, X1
+ PXOR X1, X10
+ ROL8(X10, X12)
+ PADDD X10, X7
+ PXOR X7, X4
+ MOVO X4, X12
+ PSLLL $0x07, X12
+ PSRLL $0x19, X4
+ PXOR X12, X4
+ PADDD X5, X2
+ PXOR X2, X11
+ ROL16(X11, X12)
+ PADDD X11, X8
+ PXOR X8, X5
+ MOVO X5, X12
+ PSLLL $0x0c, X12
+ PSRLL $0x14, X5
+ PXOR X12, X5
+ PADDD X5, X2
+ PXOR X2, X11
+ ROL8(X11, X12)
+ PADDD X11, X8
+ PXOR X8, X5
+ MOVO X5, X12
+ PSLLL $0x07, X12
+ PSRLL $0x19, X5
+ PXOR X12, X5
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xdb
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xe4
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xed
+ BYTE $0x0c
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xf6
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xff
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xc0
+ BYTE $0x08
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xc9
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xd2
+ BYTE $0x04
+ BYTE $0x66
+ BYTE $0x45
+ BYTE $0x0f
+ BYTE $0x3a
+ BYTE $0x0f
+ BYTE $0xdb
+ BYTE $0x04
+ DECQ R9
+ JNE sealSSE128InnerCipherLoop
// A0|B0 hold the Poly1305 32-byte key, C0,D0 can be discarded
- PADDL ·chacha20Constants<>(SB), A0; PADDL ·chacha20Constants<>(SB), A1; PADDL ·chacha20Constants<>(SB), A2
- PADDL T1, B0; PADDL T1, B1; PADDL T1, B2
- PADDL T2, C1; PADDL T2, C2
- PADDL T3, D1; PADDL ·sseIncMask<>(SB), T3; PADDL T3, D2
- PAND ·polyClampMask<>(SB), A0
- MOVOU A0, rStore
- MOVOU B0, sStore
+ PADDL ·chacha20Constants<>+0(SB), X0
+ PADDL ·chacha20Constants<>+0(SB), X1
+ PADDL ·chacha20Constants<>+0(SB), X2
+ PADDL X13, X3
+ PADDL X13, X4
+ PADDL X13, X5
+ PADDL X14, X7
+ PADDL X14, X8
+ PADDL X15, X10
+ PADDL ·sseIncMask<>+0(SB), X15
+ PADDL X15, X11
+ PAND ·polyClampMask<>+0(SB), X0
+ MOVOU X0, (BP)
+ MOVOU X3, 16(BP)
// Hash
- MOVQ ad_len+80(FP), itr2
+ MOVQ ad_len+80(FP), R9
CALL polyHashADInternal<>(SB)
- XORQ itr1, itr1
+ XORQ CX, CX
sealSSE128SealHash:
- // itr1 holds the number of bytes encrypted but not yet hashed
- CMPQ itr1, $16
- JB sealSSE128Seal
- polyAdd(0(oup))
- polyMul
-
- SUBQ $16, itr1
- ADDQ $16, oup
-
- JMP sealSSE128SealHash
+ CMPQ CX, $0x10
+ JB sealSSE128Seal
+ ADDQ (DI), R10
+ ADCQ 8(DI), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), AX
+ MOVQ AX, R15
+ MULQ R10
+ MOVQ AX, R13
+ MOVQ DX, R14
+ MOVQ (BP), AX
+ MULQ R11
+ IMULQ R12, R15
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), AX
+ MOVQ AX, R8
+ MULQ R10
+ ADDQ AX, R14
+ ADCQ $0x00, DX
+ MOVQ DX, R10
+ MOVQ 8(BP), AX
+ MULQ R11
+ ADDQ AX, R15
+ ADCQ $0x00, DX
+ IMULQ R12, R8
+ ADDQ R10, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ SUBQ $0x10, CX
+ ADDQ $0x10, DI
+ JMP sealSSE128SealHash
sealSSE128Seal:
- CMPQ inl, $16
+ CMPQ BX, $0x10
JB sealSSETail
- SUBQ $16, inl
+ SUBQ $0x10, BX
// Load for decryption
- MOVOU (inp), T0
- PXOR T0, A1
- MOVOU A1, (oup)
- LEAQ (1*16)(inp), inp
- LEAQ (1*16)(oup), oup
+ MOVOU (SI), X12
+ PXOR X12, X1
+ MOVOU X1, (DI)
+ LEAQ 16(SI), SI
+ LEAQ 16(DI), DI
// Extract for hashing
- MOVQ A1, t0
- PSRLDQ $8, A1
- MOVQ A1, t1
- ADDQ t0, acc0; ADCQ t1, acc1; ADCQ $1, acc2
- polyMul
+ MOVQ X1, R13
+ PSRLDQ $0x08, X1
+ MOVQ X1, R14
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x01, R12
+ MOVQ (BP), AX
+ MOVQ AX, R15
+ MULQ R10
+ MOVQ AX, R13
+ MOVQ DX, R14
+ MOVQ (BP), AX
+ MULQ R11
+ IMULQ R12, R15
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), AX
+ MOVQ AX, R8
+ MULQ R10
+ ADDQ AX, R14
+ ADCQ $0x00, DX
+ MOVQ DX, R10
+ MOVQ 8(BP), AX
+ MULQ R11
+ ADDQ AX, R15
+ ADCQ $0x00, DX
+ IMULQ R12, R8
+ ADDQ R10, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
// Shift the stream "left"
- MOVO B1, A1
- MOVO C1, B1
- MOVO D1, C1
- MOVO A2, D1
- MOVO B2, A2
- MOVO C2, B2
- MOVO D2, C2
+ MOVO X4, X1
+ MOVO X7, X4
+ MOVO X10, X7
+ MOVO X2, X10
+ MOVO X5, X2
+ MOVO X8, X5
+ MOVO X11, X8
JMP sealSSE128Seal
sealSSETail:
- TESTQ inl, inl
+ TESTQ BX, BX
JE sealSSEFinalize
// We can only load the PT one byte at a time to avoid read after end of buffer
- MOVQ inl, itr2
- SHLQ $4, itr2
- LEAQ ·andMask<>(SB), t0
- MOVQ inl, itr1
- LEAQ -1(inp)(inl*1), inp
- XORQ t2, t2
- XORQ t3, t3
+ MOVQ BX, R9
+ SHLQ $0x04, R9
+ LEAQ ·andMask<>+0(SB), R13
+ MOVQ BX, CX
+ LEAQ -1(SI)(BX*1), SI
+ XORQ R15, R15
+ XORQ R8, R8
XORQ AX, AX
sealSSETailLoadLoop:
- SHLQ $8, t2, t3
- SHLQ $8, t2
- MOVB (inp), AX
- XORQ AX, t2
- LEAQ -1(inp), inp
- DECQ itr1
+ SHLQ $0x08, R15, R8
+ SHLQ $0x08, R15
+ MOVB (SI), AX
+ XORQ AX, R15
+ LEAQ -1(SI), SI
+ DECQ CX
JNE sealSSETailLoadLoop
- MOVQ t2, 0+tmpStore
- MOVQ t3, 8+tmpStore
- PXOR 0+tmpStore, A1
- MOVOU A1, (oup)
- MOVOU -16(t0)(itr2*1), T0
- PAND T0, A1
- MOVQ A1, t0
- PSRLDQ $8, A1
- MOVQ A1, t1
- ADDQ t0, acc0; ADCQ t1, acc1; ADCQ $1, acc2
- polyMul
-
- ADDQ inl, oup
+ MOVQ R15, 64(BP)
+ MOVQ R8, 72(BP)
+ PXOR 64(BP), X1
+ MOVOU X1, (DI)
+ MOVOU -16(R13)(R9*1), X12
+ PAND X12, X1
+ MOVQ X1, R13
+ PSRLDQ $0x08, X1
+ MOVQ X1, R14
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x01, R12
+ MOVQ (BP), AX
+ MOVQ AX, R15
+ MULQ R10
+ MOVQ AX, R13
+ MOVQ DX, R14
+ MOVQ (BP), AX
+ MULQ R11
+ IMULQ R12, R15
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), AX
+ MOVQ AX, R8
+ MULQ R10
+ ADDQ AX, R14
+ ADCQ $0x00, DX
+ MOVQ DX, R10
+ MOVQ 8(BP), AX
+ MULQ R11
+ ADDQ AX, R15
+ ADCQ $0x00, DX
+ IMULQ R12, R8
+ ADDQ R10, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ ADDQ BX, DI
sealSSEFinalize:
// Hash in the buffer lengths
- ADDQ ad_len+80(FP), acc0
- ADCQ src_len+56(FP), acc1
- ADCQ $1, acc2
- polyMul
+ ADDQ ad_len+80(FP), R10
+ ADCQ src_len+56(FP), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), AX
+ MOVQ AX, R15
+ MULQ R10
+ MOVQ AX, R13
+ MOVQ DX, R14
+ MOVQ (BP), AX
+ MULQ R11
+ IMULQ R12, R15
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), AX
+ MOVQ AX, R8
+ MULQ R10
+ ADDQ AX, R14
+ ADCQ $0x00, DX
+ MOVQ DX, R10
+ MOVQ 8(BP), AX
+ MULQ R11
+ ADDQ AX, R15
+ ADCQ $0x00, DX
+ IMULQ R12, R8
+ ADDQ R10, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
// Final reduce
- MOVQ acc0, t0
- MOVQ acc1, t1
- MOVQ acc2, t2
- SUBQ $-5, acc0
- SBBQ $-1, acc1
- SBBQ $3, acc2
- CMOVQCS t0, acc0
- CMOVQCS t1, acc1
- CMOVQCS t2, acc2
+ MOVQ R10, R13
+ MOVQ R11, R14
+ MOVQ R12, R15
+ SUBQ $-5, R10
+ SBBQ $-1, R11
+ SBBQ $0x03, R12
+ CMOVQCS R13, R10
+ CMOVQCS R14, R11
+ CMOVQCS R15, R12
// Add in the "s" part of the key
- ADDQ 0+sStore, acc0
- ADCQ 8+sStore, acc1
+ ADDQ 16(BP), R10
+ ADCQ 24(BP), R11
// Finally store the tag at the end of the message
- MOVQ acc0, (0*8)(oup)
- MOVQ acc1, (1*8)(oup)
+ MOVQ R10, (DI)
+ MOVQ R11, 8(DI)
RET
-// ----------------------------------------------------------------------------
-// ------------------------- AVX2 Code ----------------------------------------
chacha20Poly1305Seal_AVX2:
VZEROUPPER
- VMOVDQU ·chacha20Constants<>(SB), AA0
- BYTE $0xc4; BYTE $0x42; BYTE $0x7d; BYTE $0x5a; BYTE $0x70; BYTE $0x10 // broadcasti128 16(r8), ymm14
- BYTE $0xc4; BYTE $0x42; BYTE $0x7d; BYTE $0x5a; BYTE $0x60; BYTE $0x20 // broadcasti128 32(r8), ymm12
- BYTE $0xc4; BYTE $0xc2; BYTE $0x7d; BYTE $0x5a; BYTE $0x60; BYTE $0x30 // broadcasti128 48(r8), ymm4
- VPADDD ·avx2InitMask<>(SB), DD0, DD0
+ VMOVDQU ·chacha20Constants<>+0(SB), Y0
+ BYTE $0xc4
+ BYTE $0x42
+ BYTE $0x7d
+ BYTE $0x5a
+ BYTE $0x70
+ BYTE $0x10
+ BYTE $0xc4
+ BYTE $0x42
+ BYTE $0x7d
+ BYTE $0x5a
+ BYTE $0x60
+ BYTE $0x20
+ BYTE $0xc4
+ BYTE $0xc2
+ BYTE $0x7d
+ BYTE $0x5a
+ BYTE $0x60
+ BYTE $0x30
+ VPADDD ·avx2InitMask<>+0(SB), Y4, Y4
// Special optimizations, for very short buffers
- CMPQ inl, $192
- JBE seal192AVX2 // 33% faster
- CMPQ inl, $320
- JBE seal320AVX2 // 17% faster
+ CMPQ BX, $0x000000c0
+ JBE seal192AVX2
+ CMPQ BX, $0x00000140
+ JBE seal320AVX2
// For the general key prepare the key first - as a byproduct we have 64 bytes of cipher stream
- VMOVDQA AA0, AA1; VMOVDQA AA0, AA2; VMOVDQA AA0, AA3
- VMOVDQA BB0, BB1; VMOVDQA BB0, BB2; VMOVDQA BB0, BB3; VMOVDQA BB0, state1StoreAVX2
- VMOVDQA CC0, CC1; VMOVDQA CC0, CC2; VMOVDQA CC0, CC3; VMOVDQA CC0, state2StoreAVX2
- VPADDD ·avx2IncMask<>(SB), DD0, DD1; VMOVDQA DD0, ctr0StoreAVX2
- VPADDD ·avx2IncMask<>(SB), DD1, DD2; VMOVDQA DD1, ctr1StoreAVX2
- VPADDD ·avx2IncMask<>(SB), DD2, DD3; VMOVDQA DD2, ctr2StoreAVX2
- VMOVDQA DD3, ctr3StoreAVX2
- MOVQ $10, itr2
+ VMOVDQA Y0, Y5
+ VMOVDQA Y0, Y6
+ VMOVDQA Y0, Y7
+ VMOVDQA Y14, Y9
+ VMOVDQA Y14, Y10
+ VMOVDQA Y14, Y11
+ VMOVDQA Y14, 32(BP)
+ VMOVDQA Y12, Y13
+ VMOVDQA Y12, Y8
+ VMOVDQA Y12, Y15
+ VMOVDQA Y12, 64(BP)
+ VPADDD ·avx2IncMask<>+0(SB), Y4, Y1
+ VMOVDQA Y4, 96(BP)
+ VPADDD ·avx2IncMask<>+0(SB), Y1, Y2
+ VMOVDQA Y1, 128(BP)
+ VPADDD ·avx2IncMask<>+0(SB), Y2, Y3
+ VMOVDQA Y2, 160(BP)
+ VMOVDQA Y3, 192(BP)
+ MOVQ $0x0000000a, R9
sealAVX2IntroLoop:
- VMOVDQA CC3, tmpStoreAVX2
- chachaQR_AVX2(AA0, BB0, CC0, DD0, CC3); chachaQR_AVX2(AA1, BB1, CC1, DD1, CC3); chachaQR_AVX2(AA2, BB2, CC2, DD2, CC3)
- VMOVDQA tmpStoreAVX2, CC3
- VMOVDQA CC1, tmpStoreAVX2
- chachaQR_AVX2(AA3, BB3, CC3, DD3, CC1)
- VMOVDQA tmpStoreAVX2, CC1
-
- VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $12, DD0, DD0, DD0
- VPALIGNR $4, BB1, BB1, BB1; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $12, DD1, DD1, DD1
- VPALIGNR $4, BB2, BB2, BB2; VPALIGNR $8, CC2, CC2, CC2; VPALIGNR $12, DD2, DD2, DD2
- VPALIGNR $4, BB3, BB3, BB3; VPALIGNR $8, CC3, CC3, CC3; VPALIGNR $12, DD3, DD3, DD3
-
- VMOVDQA CC3, tmpStoreAVX2
- chachaQR_AVX2(AA0, BB0, CC0, DD0, CC3); chachaQR_AVX2(AA1, BB1, CC1, DD1, CC3); chachaQR_AVX2(AA2, BB2, CC2, DD2, CC3)
- VMOVDQA tmpStoreAVX2, CC3
- VMOVDQA CC1, tmpStoreAVX2
- chachaQR_AVX2(AA3, BB3, CC3, DD3, CC1)
- VMOVDQA tmpStoreAVX2, CC1
-
- VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $4, DD0, DD0, DD0
- VPALIGNR $12, BB1, BB1, BB1; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $4, DD1, DD1, DD1
- VPALIGNR $12, BB2, BB2, BB2; VPALIGNR $8, CC2, CC2, CC2; VPALIGNR $4, DD2, DD2, DD2
- VPALIGNR $12, BB3, BB3, BB3; VPALIGNR $8, CC3, CC3, CC3; VPALIGNR $4, DD3, DD3, DD3
- DECQ itr2
- JNE sealAVX2IntroLoop
-
- VPADDD ·chacha20Constants<>(SB), AA0, AA0; VPADDD ·chacha20Constants<>(SB), AA1, AA1; VPADDD ·chacha20Constants<>(SB), AA2, AA2; VPADDD ·chacha20Constants<>(SB), AA3, AA3
- VPADDD state1StoreAVX2, BB0, BB0; VPADDD state1StoreAVX2, BB1, BB1; VPADDD state1StoreAVX2, BB2, BB2; VPADDD state1StoreAVX2, BB3, BB3
- VPADDD state2StoreAVX2, CC0, CC0; VPADDD state2StoreAVX2, CC1, CC1; VPADDD state2StoreAVX2, CC2, CC2; VPADDD state2StoreAVX2, CC3, CC3
- VPADDD ctr0StoreAVX2, DD0, DD0; VPADDD ctr1StoreAVX2, DD1, DD1; VPADDD ctr2StoreAVX2, DD2, DD2; VPADDD ctr3StoreAVX2, DD3, DD3
-
- VPERM2I128 $0x13, CC0, DD0, CC0 // Stream bytes 96 - 127
- VPERM2I128 $0x02, AA0, BB0, DD0 // The Poly1305 key
- VPERM2I128 $0x13, AA0, BB0, AA0 // Stream bytes 64 - 95
+ VMOVDQA Y15, 224(BP)
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol16<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x0c, Y14, Y15
+ VPSRLD $0x14, Y14, Y14
+ VPXOR Y15, Y14, Y14
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol8<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x07, Y14, Y15
+ VPSRLD $0x19, Y14, Y14
+ VPXOR Y15, Y14, Y14
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol16<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x0c, Y9, Y15
+ VPSRLD $0x14, Y9, Y9
+ VPXOR Y15, Y9, Y9
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol8<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x07, Y9, Y15
+ VPSRLD $0x19, Y9, Y9
+ VPXOR Y15, Y9, Y9
+ VPADDD Y10, Y6, Y6
+ VPXOR Y6, Y2, Y2
+ VPSHUFB ·rol16<>+0(SB), Y2, Y2
+ VPADDD Y2, Y8, Y8
+ VPXOR Y8, Y10, Y10
+ VPSLLD $0x0c, Y10, Y15
+ VPSRLD $0x14, Y10, Y10
+ VPXOR Y15, Y10, Y10
+ VPADDD Y10, Y6, Y6
+ VPXOR Y6, Y2, Y2
+ VPSHUFB ·rol8<>+0(SB), Y2, Y2
+ VPADDD Y2, Y8, Y8
+ VPXOR Y8, Y10, Y10
+ VPSLLD $0x07, Y10, Y15
+ VPSRLD $0x19, Y10, Y10
+ VPXOR Y15, Y10, Y10
+ VMOVDQA 224(BP), Y15
+ VMOVDQA Y13, 224(BP)
+ VPADDD Y11, Y7, Y7
+ VPXOR Y7, Y3, Y3
+ VPSHUFB ·rol16<>+0(SB), Y3, Y3
+ VPADDD Y3, Y15, Y15
+ VPXOR Y15, Y11, Y11
+ VPSLLD $0x0c, Y11, Y13
+ VPSRLD $0x14, Y11, Y11
+ VPXOR Y13, Y11, Y11
+ VPADDD Y11, Y7, Y7
+ VPXOR Y7, Y3, Y3
+ VPSHUFB ·rol8<>+0(SB), Y3, Y3
+ VPADDD Y3, Y15, Y15
+ VPXOR Y15, Y11, Y11
+ VPSLLD $0x07, Y11, Y13
+ VPSRLD $0x19, Y11, Y11
+ VPXOR Y13, Y11, Y11
+ VMOVDQA 224(BP), Y13
+ VPALIGNR $0x04, Y14, Y14, Y14
+ VPALIGNR $0x08, Y12, Y12, Y12
+ VPALIGNR $0x0c, Y4, Y4, Y4
+ VPALIGNR $0x04, Y9, Y9, Y9
+ VPALIGNR $0x08, Y13, Y13, Y13
+ VPALIGNR $0x0c, Y1, Y1, Y1
+ VPALIGNR $0x04, Y10, Y10, Y10
+ VPALIGNR $0x08, Y8, Y8, Y8
+ VPALIGNR $0x0c, Y2, Y2, Y2
+ VPALIGNR $0x04, Y11, Y11, Y11
+ VPALIGNR $0x08, Y15, Y15, Y15
+ VPALIGNR $0x0c, Y3, Y3, Y3
+ VMOVDQA Y15, 224(BP)
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol16<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x0c, Y14, Y15
+ VPSRLD $0x14, Y14, Y14
+ VPXOR Y15, Y14, Y14
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol8<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x07, Y14, Y15
+ VPSRLD $0x19, Y14, Y14
+ VPXOR Y15, Y14, Y14
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol16<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x0c, Y9, Y15
+ VPSRLD $0x14, Y9, Y9
+ VPXOR Y15, Y9, Y9
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol8<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x07, Y9, Y15
+ VPSRLD $0x19, Y9, Y9
+ VPXOR Y15, Y9, Y9
+ VPADDD Y10, Y6, Y6
+ VPXOR Y6, Y2, Y2
+ VPSHUFB ·rol16<>+0(SB), Y2, Y2
+ VPADDD Y2, Y8, Y8
+ VPXOR Y8, Y10, Y10
+ VPSLLD $0x0c, Y10, Y15
+ VPSRLD $0x14, Y10, Y10
+ VPXOR Y15, Y10, Y10
+ VPADDD Y10, Y6, Y6
+ VPXOR Y6, Y2, Y2
+ VPSHUFB ·rol8<>+0(SB), Y2, Y2
+ VPADDD Y2, Y8, Y8
+ VPXOR Y8, Y10, Y10
+ VPSLLD $0x07, Y10, Y15
+ VPSRLD $0x19, Y10, Y10
+ VPXOR Y15, Y10, Y10
+ VMOVDQA 224(BP), Y15
+ VMOVDQA Y13, 224(BP)
+ VPADDD Y11, Y7, Y7
+ VPXOR Y7, Y3, Y3
+ VPSHUFB ·rol16<>+0(SB), Y3, Y3
+ VPADDD Y3, Y15, Y15
+ VPXOR Y15, Y11, Y11
+ VPSLLD $0x0c, Y11, Y13
+ VPSRLD $0x14, Y11, Y11
+ VPXOR Y13, Y11, Y11
+ VPADDD Y11, Y7, Y7
+ VPXOR Y7, Y3, Y3
+ VPSHUFB ·rol8<>+0(SB), Y3, Y3
+ VPADDD Y3, Y15, Y15
+ VPXOR Y15, Y11, Y11
+ VPSLLD $0x07, Y11, Y13
+ VPSRLD $0x19, Y11, Y11
+ VPXOR Y13, Y11, Y11
+ VMOVDQA 224(BP), Y13
+ VPALIGNR $0x0c, Y14, Y14, Y14
+ VPALIGNR $0x08, Y12, Y12, Y12
+ VPALIGNR $0x04, Y4, Y4, Y4
+ VPALIGNR $0x0c, Y9, Y9, Y9
+ VPALIGNR $0x08, Y13, Y13, Y13
+ VPALIGNR $0x04, Y1, Y1, Y1
+ VPALIGNR $0x0c, Y10, Y10, Y10
+ VPALIGNR $0x08, Y8, Y8, Y8
+ VPALIGNR $0x04, Y2, Y2, Y2
+ VPALIGNR $0x0c, Y11, Y11, Y11
+ VPALIGNR $0x08, Y15, Y15, Y15
+ VPALIGNR $0x04, Y3, Y3, Y3
+ DECQ R9
+ JNE sealAVX2IntroLoop
+ VPADDD ·chacha20Constants<>+0(SB), Y0, Y0
+ VPADDD ·chacha20Constants<>+0(SB), Y5, Y5
+ VPADDD ·chacha20Constants<>+0(SB), Y6, Y6
+ VPADDD ·chacha20Constants<>+0(SB), Y7, Y7
+ VPADDD 32(BP), Y14, Y14
+ VPADDD 32(BP), Y9, Y9
+ VPADDD 32(BP), Y10, Y10
+ VPADDD 32(BP), Y11, Y11
+ VPADDD 64(BP), Y12, Y12
+ VPADDD 64(BP), Y13, Y13
+ VPADDD 64(BP), Y8, Y8
+ VPADDD 64(BP), Y15, Y15
+ VPADDD 96(BP), Y4, Y4
+ VPADDD 128(BP), Y1, Y1
+ VPADDD 160(BP), Y2, Y2
+ VPADDD 192(BP), Y3, Y3
+ VPERM2I128 $0x13, Y12, Y4, Y12
+ VPERM2I128 $0x02, Y0, Y14, Y4
+ VPERM2I128 $0x13, Y0, Y14, Y0
// Clamp and store poly key
- VPAND ·polyClampMask<>(SB), DD0, DD0
- VMOVDQA DD0, rsStoreAVX2
+ VPAND ·polyClampMask<>+0(SB), Y4, Y4
+ VMOVDQA Y4, (BP)
// Hash AD
- MOVQ ad_len+80(FP), itr2
+ MOVQ ad_len+80(FP), R9
CALL polyHashADInternal<>(SB)
// Can store at least 320 bytes
- VPXOR (0*32)(inp), AA0, AA0
- VPXOR (1*32)(inp), CC0, CC0
- VMOVDQU AA0, (0*32)(oup)
- VMOVDQU CC0, (1*32)(oup)
-
- VPERM2I128 $0x02, AA1, BB1, AA0; VPERM2I128 $0x02, CC1, DD1, BB0; VPERM2I128 $0x13, AA1, BB1, CC0; VPERM2I128 $0x13, CC1, DD1, DD0
- VPXOR (2*32)(inp), AA0, AA0; VPXOR (3*32)(inp), BB0, BB0; VPXOR (4*32)(inp), CC0, CC0; VPXOR (5*32)(inp), DD0, DD0
- VMOVDQU AA0, (2*32)(oup); VMOVDQU BB0, (3*32)(oup); VMOVDQU CC0, (4*32)(oup); VMOVDQU DD0, (5*32)(oup)
- VPERM2I128 $0x02, AA2, BB2, AA0; VPERM2I128 $0x02, CC2, DD2, BB0; VPERM2I128 $0x13, AA2, BB2, CC0; VPERM2I128 $0x13, CC2, DD2, DD0
- VPXOR (6*32)(inp), AA0, AA0; VPXOR (7*32)(inp), BB0, BB0; VPXOR (8*32)(inp), CC0, CC0; VPXOR (9*32)(inp), DD0, DD0
- VMOVDQU AA0, (6*32)(oup); VMOVDQU BB0, (7*32)(oup); VMOVDQU CC0, (8*32)(oup); VMOVDQU DD0, (9*32)(oup)
-
- MOVQ $320, itr1
- SUBQ $320, inl
- LEAQ 320(inp), inp
-
- VPERM2I128 $0x02, AA3, BB3, AA0; VPERM2I128 $0x02, CC3, DD3, BB0; VPERM2I128 $0x13, AA3, BB3, CC0; VPERM2I128 $0x13, CC3, DD3, DD0
- CMPQ inl, $128
+ VPXOR (SI), Y0, Y0
+ VPXOR 32(SI), Y12, Y12
+ VMOVDQU Y0, (DI)
+ VMOVDQU Y12, 32(DI)
+ VPERM2I128 $0x02, Y5, Y9, Y0
+ VPERM2I128 $0x02, Y13, Y1, Y14
+ VPERM2I128 $0x13, Y5, Y9, Y12
+ VPERM2I128 $0x13, Y13, Y1, Y4
+ VPXOR 64(SI), Y0, Y0
+ VPXOR 96(SI), Y14, Y14
+ VPXOR 128(SI), Y12, Y12
+ VPXOR 160(SI), Y4, Y4
+ VMOVDQU Y0, 64(DI)
+ VMOVDQU Y14, 96(DI)
+ VMOVDQU Y12, 128(DI)
+ VMOVDQU Y4, 160(DI)
+ VPERM2I128 $0x02, Y6, Y10, Y0
+ VPERM2I128 $0x02, Y8, Y2, Y14
+ VPERM2I128 $0x13, Y6, Y10, Y12
+ VPERM2I128 $0x13, Y8, Y2, Y4
+ VPXOR 192(SI), Y0, Y0
+ VPXOR 224(SI), Y14, Y14
+ VPXOR 256(SI), Y12, Y12
+ VPXOR 288(SI), Y4, Y4
+ VMOVDQU Y0, 192(DI)
+ VMOVDQU Y14, 224(DI)
+ VMOVDQU Y12, 256(DI)
+ VMOVDQU Y4, 288(DI)
+ MOVQ $0x00000140, CX
+ SUBQ $0x00000140, BX
+ LEAQ 320(SI), SI
+ VPERM2I128 $0x02, Y7, Y11, Y0
+ VPERM2I128 $0x02, Y15, Y3, Y14
+ VPERM2I128 $0x13, Y7, Y11, Y12
+ VPERM2I128 $0x13, Y15, Y3, Y4
+ CMPQ BX, $0x80
JBE sealAVX2SealHash
-
- VPXOR (0*32)(inp), AA0, AA0; VPXOR (1*32)(inp), BB0, BB0; VPXOR (2*32)(inp), CC0, CC0; VPXOR (3*32)(inp), DD0, DD0
- VMOVDQU AA0, (10*32)(oup); VMOVDQU BB0, (11*32)(oup); VMOVDQU CC0, (12*32)(oup); VMOVDQU DD0, (13*32)(oup)
- SUBQ $128, inl
- LEAQ 128(inp), inp
-
- MOVQ $8, itr1
- MOVQ $2, itr2
-
- CMPQ inl, $128
- JBE sealAVX2Tail128
- CMPQ inl, $256
- JBE sealAVX2Tail256
- CMPQ inl, $384
- JBE sealAVX2Tail384
- CMPQ inl, $512
- JBE sealAVX2Tail512
+ VPXOR (SI), Y0, Y0
+ VPXOR 32(SI), Y14, Y14
+ VPXOR 64(SI), Y12, Y12
+ VPXOR 96(SI), Y4, Y4
+ VMOVDQU Y0, 320(DI)
+ VMOVDQU Y14, 352(DI)
+ VMOVDQU Y12, 384(DI)
+ VMOVDQU Y4, 416(DI)
+ SUBQ $0x80, BX
+ LEAQ 128(SI), SI
+ MOVQ $0x00000008, CX
+ MOVQ $0x00000002, R9
+ CMPQ BX, $0x80
+ JBE sealAVX2Tail128
+ CMPQ BX, $0x00000100
+ JBE sealAVX2Tail256
+ CMPQ BX, $0x00000180
+ JBE sealAVX2Tail384
+ CMPQ BX, $0x00000200
+ JBE sealAVX2Tail512
// We have 448 bytes to hash, but main loop hashes 512 bytes at a time - perform some rounds, before the main loop
- VMOVDQA ·chacha20Constants<>(SB), AA0; VMOVDQA AA0, AA1; VMOVDQA AA0, AA2; VMOVDQA AA0, AA3
- VMOVDQA state1StoreAVX2, BB0; VMOVDQA BB0, BB1; VMOVDQA BB0, BB2; VMOVDQA BB0, BB3
- VMOVDQA state2StoreAVX2, CC0; VMOVDQA CC0, CC1; VMOVDQA CC0, CC2; VMOVDQA CC0, CC3
- VMOVDQA ctr3StoreAVX2, DD0
- VPADDD ·avx2IncMask<>(SB), DD0, DD0; VPADDD ·avx2IncMask<>(SB), DD0, DD1; VPADDD ·avx2IncMask<>(SB), DD1, DD2; VPADDD ·avx2IncMask<>(SB), DD2, DD3
- VMOVDQA DD0, ctr0StoreAVX2; VMOVDQA DD1, ctr1StoreAVX2; VMOVDQA DD2, ctr2StoreAVX2; VMOVDQA DD3, ctr3StoreAVX2
-
- VMOVDQA CC3, tmpStoreAVX2
- chachaQR_AVX2(AA0, BB0, CC0, DD0, CC3); chachaQR_AVX2(AA1, BB1, CC1, DD1, CC3); chachaQR_AVX2(AA2, BB2, CC2, DD2, CC3)
- VMOVDQA tmpStoreAVX2, CC3
- VMOVDQA CC1, tmpStoreAVX2
- chachaQR_AVX2(AA3, BB3, CC3, DD3, CC1)
- VMOVDQA tmpStoreAVX2, CC1
-
- VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $12, DD0, DD0, DD0
- VPALIGNR $4, BB1, BB1, BB1; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $12, DD1, DD1, DD1
- VPALIGNR $4, BB2, BB2, BB2; VPALIGNR $8, CC2, CC2, CC2; VPALIGNR $12, DD2, DD2, DD2
- VPALIGNR $4, BB3, BB3, BB3; VPALIGNR $8, CC3, CC3, CC3; VPALIGNR $12, DD3, DD3, DD3
-
- VMOVDQA CC3, tmpStoreAVX2
- chachaQR_AVX2(AA0, BB0, CC0, DD0, CC3); chachaQR_AVX2(AA1, BB1, CC1, DD1, CC3); chachaQR_AVX2(AA2, BB2, CC2, DD2, CC3)
- VMOVDQA tmpStoreAVX2, CC3
- VMOVDQA CC1, tmpStoreAVX2
- chachaQR_AVX2(AA3, BB3, CC3, DD3, CC1)
- VMOVDQA tmpStoreAVX2, CC1
-
- VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $4, DD0, DD0, DD0
- VPALIGNR $12, BB1, BB1, BB1; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $4, DD1, DD1, DD1
- VPALIGNR $12, BB2, BB2, BB2; VPALIGNR $8, CC2, CC2, CC2; VPALIGNR $4, DD2, DD2, DD2
- VPALIGNR $12, BB3, BB3, BB3; VPALIGNR $8, CC3, CC3, CC3; VPALIGNR $4, DD3, DD3, DD3
- VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3
- VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3
- VPSHUFB ·rol16<>(SB), DD0, DD0; VPSHUFB ·rol16<>(SB), DD1, DD1; VPSHUFB ·rol16<>(SB), DD2, DD2; VPSHUFB ·rol16<>(SB), DD3, DD3
- VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3
- VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3
- VMOVDQA CC3, tmpStoreAVX2
- VPSLLD $12, BB0, CC3; VPSRLD $20, BB0, BB0; VPXOR CC3, BB0, BB0
- VPSLLD $12, BB1, CC3; VPSRLD $20, BB1, BB1; VPXOR CC3, BB1, BB1
- VPSLLD $12, BB2, CC3; VPSRLD $20, BB2, BB2; VPXOR CC3, BB2, BB2
- VPSLLD $12, BB3, CC3; VPSRLD $20, BB3, BB3; VPXOR CC3, BB3, BB3
- VMOVDQA tmpStoreAVX2, CC3
-
- SUBQ $16, oup // Adjust the pointer
- MOVQ $9, itr1
- JMP sealAVX2InternalLoopStart
+ VMOVDQA ·chacha20Constants<>+0(SB), Y0
+ VMOVDQA Y0, Y5
+ VMOVDQA Y0, Y6
+ VMOVDQA Y0, Y7
+ VMOVDQA 32(BP), Y14
+ VMOVDQA Y14, Y9
+ VMOVDQA Y14, Y10
+ VMOVDQA Y14, Y11
+ VMOVDQA 64(BP), Y12
+ VMOVDQA Y12, Y13
+ VMOVDQA Y12, Y8
+ VMOVDQA Y12, Y15
+ VMOVDQA 192(BP), Y4
+ VPADDD ·avx2IncMask<>+0(SB), Y4, Y4
+ VPADDD ·avx2IncMask<>+0(SB), Y4, Y1
+ VPADDD ·avx2IncMask<>+0(SB), Y1, Y2
+ VPADDD ·avx2IncMask<>+0(SB), Y2, Y3
+ VMOVDQA Y4, 96(BP)
+ VMOVDQA Y1, 128(BP)
+ VMOVDQA Y2, 160(BP)
+ VMOVDQA Y3, 192(BP)
+ VMOVDQA Y15, 224(BP)
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol16<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x0c, Y14, Y15
+ VPSRLD $0x14, Y14, Y14
+ VPXOR Y15, Y14, Y14
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol8<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x07, Y14, Y15
+ VPSRLD $0x19, Y14, Y14
+ VPXOR Y15, Y14, Y14
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol16<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x0c, Y9, Y15
+ VPSRLD $0x14, Y9, Y9
+ VPXOR Y15, Y9, Y9
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol8<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x07, Y9, Y15
+ VPSRLD $0x19, Y9, Y9
+ VPXOR Y15, Y9, Y9
+ VPADDD Y10, Y6, Y6
+ VPXOR Y6, Y2, Y2
+ VPSHUFB ·rol16<>+0(SB), Y2, Y2
+ VPADDD Y2, Y8, Y8
+ VPXOR Y8, Y10, Y10
+ VPSLLD $0x0c, Y10, Y15
+ VPSRLD $0x14, Y10, Y10
+ VPXOR Y15, Y10, Y10
+ VPADDD Y10, Y6, Y6
+ VPXOR Y6, Y2, Y2
+ VPSHUFB ·rol8<>+0(SB), Y2, Y2
+ VPADDD Y2, Y8, Y8
+ VPXOR Y8, Y10, Y10
+ VPSLLD $0x07, Y10, Y15
+ VPSRLD $0x19, Y10, Y10
+ VPXOR Y15, Y10, Y10
+ VMOVDQA 224(BP), Y15
+ VMOVDQA Y13, 224(BP)
+ VPADDD Y11, Y7, Y7
+ VPXOR Y7, Y3, Y3
+ VPSHUFB ·rol16<>+0(SB), Y3, Y3
+ VPADDD Y3, Y15, Y15
+ VPXOR Y15, Y11, Y11
+ VPSLLD $0x0c, Y11, Y13
+ VPSRLD $0x14, Y11, Y11
+ VPXOR Y13, Y11, Y11
+ VPADDD Y11, Y7, Y7
+ VPXOR Y7, Y3, Y3
+ VPSHUFB ·rol8<>+0(SB), Y3, Y3
+ VPADDD Y3, Y15, Y15
+ VPXOR Y15, Y11, Y11
+ VPSLLD $0x07, Y11, Y13
+ VPSRLD $0x19, Y11, Y11
+ VPXOR Y13, Y11, Y11
+ VMOVDQA 224(BP), Y13
+ VPALIGNR $0x04, Y14, Y14, Y14
+ VPALIGNR $0x08, Y12, Y12, Y12
+ VPALIGNR $0x0c, Y4, Y4, Y4
+ VPALIGNR $0x04, Y9, Y9, Y9
+ VPALIGNR $0x08, Y13, Y13, Y13
+ VPALIGNR $0x0c, Y1, Y1, Y1
+ VPALIGNR $0x04, Y10, Y10, Y10
+ VPALIGNR $0x08, Y8, Y8, Y8
+ VPALIGNR $0x0c, Y2, Y2, Y2
+ VPALIGNR $0x04, Y11, Y11, Y11
+ VPALIGNR $0x08, Y15, Y15, Y15
+ VPALIGNR $0x0c, Y3, Y3, Y3
+ VMOVDQA Y15, 224(BP)
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol16<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x0c, Y14, Y15
+ VPSRLD $0x14, Y14, Y14
+ VPXOR Y15, Y14, Y14
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol8<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x07, Y14, Y15
+ VPSRLD $0x19, Y14, Y14
+ VPXOR Y15, Y14, Y14
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol16<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x0c, Y9, Y15
+ VPSRLD $0x14, Y9, Y9
+ VPXOR Y15, Y9, Y9
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol8<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x07, Y9, Y15
+ VPSRLD $0x19, Y9, Y9
+ VPXOR Y15, Y9, Y9
+ VPADDD Y10, Y6, Y6
+ VPXOR Y6, Y2, Y2
+ VPSHUFB ·rol16<>+0(SB), Y2, Y2
+ VPADDD Y2, Y8, Y8
+ VPXOR Y8, Y10, Y10
+ VPSLLD $0x0c, Y10, Y15
+ VPSRLD $0x14, Y10, Y10
+ VPXOR Y15, Y10, Y10
+ VPADDD Y10, Y6, Y6
+ VPXOR Y6, Y2, Y2
+ VPSHUFB ·rol8<>+0(SB), Y2, Y2
+ VPADDD Y2, Y8, Y8
+ VPXOR Y8, Y10, Y10
+ VPSLLD $0x07, Y10, Y15
+ VPSRLD $0x19, Y10, Y10
+ VPXOR Y15, Y10, Y10
+ VMOVDQA 224(BP), Y15
+ VMOVDQA Y13, 224(BP)
+ VPADDD Y11, Y7, Y7
+ VPXOR Y7, Y3, Y3
+ VPSHUFB ·rol16<>+0(SB), Y3, Y3
+ VPADDD Y3, Y15, Y15
+ VPXOR Y15, Y11, Y11
+ VPSLLD $0x0c, Y11, Y13
+ VPSRLD $0x14, Y11, Y11
+ VPXOR Y13, Y11, Y11
+ VPADDD Y11, Y7, Y7
+ VPXOR Y7, Y3, Y3
+ VPSHUFB ·rol8<>+0(SB), Y3, Y3
+ VPADDD Y3, Y15, Y15
+ VPXOR Y15, Y11, Y11
+ VPSLLD $0x07, Y11, Y13
+ VPSRLD $0x19, Y11, Y11
+ VPXOR Y13, Y11, Y11
+ VMOVDQA 224(BP), Y13
+ VPALIGNR $0x0c, Y14, Y14, Y14
+ VPALIGNR $0x08, Y12, Y12, Y12
+ VPALIGNR $0x04, Y4, Y4, Y4
+ VPALIGNR $0x0c, Y9, Y9, Y9
+ VPALIGNR $0x08, Y13, Y13, Y13
+ VPALIGNR $0x04, Y1, Y1, Y1
+ VPALIGNR $0x0c, Y10, Y10, Y10
+ VPALIGNR $0x08, Y8, Y8, Y8
+ VPALIGNR $0x04, Y2, Y2, Y2
+ VPALIGNR $0x0c, Y11, Y11, Y11
+ VPALIGNR $0x08, Y15, Y15, Y15
+ VPALIGNR $0x04, Y3, Y3, Y3
+ VPADDD Y14, Y0, Y0
+ VPADDD Y9, Y5, Y5
+ VPADDD Y10, Y6, Y6
+ VPADDD Y11, Y7, Y7
+ VPXOR Y0, Y4, Y4
+ VPXOR Y5, Y1, Y1
+ VPXOR Y6, Y2, Y2
+ VPXOR Y7, Y3, Y3
+ VPSHUFB ·rol16<>+0(SB), Y4, Y4
+ VPSHUFB ·rol16<>+0(SB), Y1, Y1
+ VPSHUFB ·rol16<>+0(SB), Y2, Y2
+ VPSHUFB ·rol16<>+0(SB), Y3, Y3
+ VPADDD Y4, Y12, Y12
+ VPADDD Y1, Y13, Y13
+ VPADDD Y2, Y8, Y8
+ VPADDD Y3, Y15, Y15
+ VPXOR Y12, Y14, Y14
+ VPXOR Y13, Y9, Y9
+ VPXOR Y8, Y10, Y10
+ VPXOR Y15, Y11, Y11
+ VMOVDQA Y15, 224(BP)
+ VPSLLD $0x0c, Y14, Y15
+ VPSRLD $0x14, Y14, Y14
+ VPXOR Y15, Y14, Y14
+ VPSLLD $0x0c, Y9, Y15
+ VPSRLD $0x14, Y9, Y9
+ VPXOR Y15, Y9, Y9
+ VPSLLD $0x0c, Y10, Y15
+ VPSRLD $0x14, Y10, Y10
+ VPXOR Y15, Y10, Y10
+ VPSLLD $0x0c, Y11, Y15
+ VPSRLD $0x14, Y11, Y11
+ VPXOR Y15, Y11, Y11
+ VMOVDQA 224(BP), Y15
+ SUBQ $0x10, DI
+ MOVQ $0x00000009, CX
+ JMP sealAVX2InternalLoopStart
sealAVX2MainLoop:
- // Load state, increment counter blocks, store the incremented counters
- VMOVDQU ·chacha20Constants<>(SB), AA0; VMOVDQA AA0, AA1; VMOVDQA AA0, AA2; VMOVDQA AA0, AA3
- VMOVDQA state1StoreAVX2, BB0; VMOVDQA BB0, BB1; VMOVDQA BB0, BB2; VMOVDQA BB0, BB3
- VMOVDQA state2StoreAVX2, CC0; VMOVDQA CC0, CC1; VMOVDQA CC0, CC2; VMOVDQA CC0, CC3
- VMOVDQA ctr3StoreAVX2, DD0; VPADDD ·avx2IncMask<>(SB), DD0, DD0; VPADDD ·avx2IncMask<>(SB), DD0, DD1; VPADDD ·avx2IncMask<>(SB), DD1, DD2; VPADDD ·avx2IncMask<>(SB), DD2, DD3
- VMOVDQA DD0, ctr0StoreAVX2; VMOVDQA DD1, ctr1StoreAVX2; VMOVDQA DD2, ctr2StoreAVX2; VMOVDQA DD3, ctr3StoreAVX2
- MOVQ $10, itr1
+ VMOVDQU ·chacha20Constants<>+0(SB), Y0
+ VMOVDQA Y0, Y5
+ VMOVDQA Y0, Y6
+ VMOVDQA Y0, Y7
+ VMOVDQA 32(BP), Y14
+ VMOVDQA Y14, Y9
+ VMOVDQA Y14, Y10
+ VMOVDQA Y14, Y11
+ VMOVDQA 64(BP), Y12
+ VMOVDQA Y12, Y13
+ VMOVDQA Y12, Y8
+ VMOVDQA Y12, Y15
+ VMOVDQA 192(BP), Y4
+ VPADDD ·avx2IncMask<>+0(SB), Y4, Y4
+ VPADDD ·avx2IncMask<>+0(SB), Y4, Y1
+ VPADDD ·avx2IncMask<>+0(SB), Y1, Y2
+ VPADDD ·avx2IncMask<>+0(SB), Y2, Y3
+ VMOVDQA Y4, 96(BP)
+ VMOVDQA Y1, 128(BP)
+ VMOVDQA Y2, 160(BP)
+ VMOVDQA Y3, 192(BP)
+ MOVQ $0x0000000a, CX
sealAVX2InternalLoop:
- polyAdd(0*8(oup))
- VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3
- polyMulStage1_AVX2
- VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3
- VPSHUFB ·rol16<>(SB), DD0, DD0; VPSHUFB ·rol16<>(SB), DD1, DD1; VPSHUFB ·rol16<>(SB), DD2, DD2; VPSHUFB ·rol16<>(SB), DD3, DD3
- polyMulStage2_AVX2
- VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3
- VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3
- polyMulStage3_AVX2
- VMOVDQA CC3, tmpStoreAVX2
- VPSLLD $12, BB0, CC3; VPSRLD $20, BB0, BB0; VPXOR CC3, BB0, BB0
- VPSLLD $12, BB1, CC3; VPSRLD $20, BB1, BB1; VPXOR CC3, BB1, BB1
- VPSLLD $12, BB2, CC3; VPSRLD $20, BB2, BB2; VPXOR CC3, BB2, BB2
- VPSLLD $12, BB3, CC3; VPSRLD $20, BB3, BB3; VPXOR CC3, BB3, BB3
- VMOVDQA tmpStoreAVX2, CC3
- polyMulReduceStage
+ ADDQ (DI), R10
+ ADCQ 8(DI), R11
+ ADCQ $0x01, R12
+ VPADDD Y14, Y0, Y0
+ VPADDD Y9, Y5, Y5
+ VPADDD Y10, Y6, Y6
+ VPADDD Y11, Y7, Y7
+ MOVQ (BP), DX
+ MOVQ DX, R15
+ MULXQ R10, R13, R14
+ IMULQ R12, R15
+ MULXQ R11, AX, DX
+ ADDQ AX, R14
+ ADCQ DX, R15
+ VPXOR Y0, Y4, Y4
+ VPXOR Y5, Y1, Y1
+ VPXOR Y6, Y2, Y2
+ VPXOR Y7, Y3, Y3
+ VPSHUFB ·rol16<>+0(SB), Y4, Y4
+ VPSHUFB ·rol16<>+0(SB), Y1, Y1
+ VPSHUFB ·rol16<>+0(SB), Y2, Y2
+ VPSHUFB ·rol16<>+0(SB), Y3, Y3
+ MOVQ 8(BP), DX
+ MULXQ R10, R10, AX
+ ADDQ R10, R14
+ MULXQ R11, R11, R8
+ ADCQ R11, R15
+ ADCQ $0x00, R8
+ VPADDD Y4, Y12, Y12
+ VPADDD Y1, Y13, Y13
+ VPADDD Y2, Y8, Y8
+ VPADDD Y3, Y15, Y15
+ VPXOR Y12, Y14, Y14
+ VPXOR Y13, Y9, Y9
+ VPXOR Y8, Y10, Y10
+ VPXOR Y15, Y11, Y11
+ IMULQ R12, DX
+ ADDQ AX, R15
+ ADCQ DX, R8
+ VMOVDQA Y15, 224(BP)
+ VPSLLD $0x0c, Y14, Y15
+ VPSRLD $0x14, Y14, Y14
+ VPXOR Y15, Y14, Y14
+ VPSLLD $0x0c, Y9, Y15
+ VPSRLD $0x14, Y9, Y9
+ VPXOR Y15, Y9, Y9
+ VPSLLD $0x0c, Y10, Y15
+ VPSRLD $0x14, Y10, Y10
+ VPXOR Y15, Y10, Y10
+ VPSLLD $0x0c, Y11, Y15
+ VPSRLD $0x14, Y11, Y11
+ VPXOR Y15, Y11, Y11
+ VMOVDQA 224(BP), Y15
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
sealAVX2InternalLoopStart:
- VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3
- VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3
- VPSHUFB ·rol8<>(SB), DD0, DD0; VPSHUFB ·rol8<>(SB), DD1, DD1; VPSHUFB ·rol8<>(SB), DD2, DD2; VPSHUFB ·rol8<>(SB), DD3, DD3
- polyAdd(2*8(oup))
- VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3
- polyMulStage1_AVX2
- VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3
- VMOVDQA CC3, tmpStoreAVX2
- VPSLLD $7, BB0, CC3; VPSRLD $25, BB0, BB0; VPXOR CC3, BB0, BB0
- VPSLLD $7, BB1, CC3; VPSRLD $25, BB1, BB1; VPXOR CC3, BB1, BB1
- VPSLLD $7, BB2, CC3; VPSRLD $25, BB2, BB2; VPXOR CC3, BB2, BB2
- VPSLLD $7, BB3, CC3; VPSRLD $25, BB3, BB3; VPXOR CC3, BB3, BB3
- VMOVDQA tmpStoreAVX2, CC3
- polyMulStage2_AVX2
- VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $4, BB1, BB1, BB1; VPALIGNR $4, BB2, BB2, BB2; VPALIGNR $4, BB3, BB3, BB3
- VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2; VPALIGNR $8, CC3, CC3, CC3
- VPALIGNR $12, DD0, DD0, DD0; VPALIGNR $12, DD1, DD1, DD1; VPALIGNR $12, DD2, DD2, DD2; VPALIGNR $12, DD3, DD3, DD3
- VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3
- polyMulStage3_AVX2
- VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3
- VPSHUFB ·rol16<>(SB), DD0, DD0; VPSHUFB ·rol16<>(SB), DD1, DD1; VPSHUFB ·rol16<>(SB), DD2, DD2; VPSHUFB ·rol16<>(SB), DD3, DD3
- polyMulReduceStage
- VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3
- VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3
- polyAdd(4*8(oup))
- LEAQ (6*8)(oup), oup
- VMOVDQA CC3, tmpStoreAVX2
- VPSLLD $12, BB0, CC3; VPSRLD $20, BB0, BB0; VPXOR CC3, BB0, BB0
- VPSLLD $12, BB1, CC3; VPSRLD $20, BB1, BB1; VPXOR CC3, BB1, BB1
- VPSLLD $12, BB2, CC3; VPSRLD $20, BB2, BB2; VPXOR CC3, BB2, BB2
- VPSLLD $12, BB3, CC3; VPSRLD $20, BB3, BB3; VPXOR CC3, BB3, BB3
- VMOVDQA tmpStoreAVX2, CC3
- polyMulStage1_AVX2
- VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3
- VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3
- polyMulStage2_AVX2
- VPSHUFB ·rol8<>(SB), DD0, DD0; VPSHUFB ·rol8<>(SB), DD1, DD1; VPSHUFB ·rol8<>(SB), DD2, DD2; VPSHUFB ·rol8<>(SB), DD3, DD3
- VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3
- polyMulStage3_AVX2
- VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3
- VMOVDQA CC3, tmpStoreAVX2
- VPSLLD $7, BB0, CC3; VPSRLD $25, BB0, BB0; VPXOR CC3, BB0, BB0
- VPSLLD $7, BB1, CC3; VPSRLD $25, BB1, BB1; VPXOR CC3, BB1, BB1
- VPSLLD $7, BB2, CC3; VPSRLD $25, BB2, BB2; VPXOR CC3, BB2, BB2
- VPSLLD $7, BB3, CC3; VPSRLD $25, BB3, BB3; VPXOR CC3, BB3, BB3
- VMOVDQA tmpStoreAVX2, CC3
- polyMulReduceStage
- VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $12, BB1, BB1, BB1; VPALIGNR $12, BB2, BB2, BB2; VPALIGNR $12, BB3, BB3, BB3
- VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2; VPALIGNR $8, CC3, CC3, CC3
- VPALIGNR $4, DD0, DD0, DD0; VPALIGNR $4, DD1, DD1, DD1; VPALIGNR $4, DD2, DD2, DD2; VPALIGNR $4, DD3, DD3, DD3
- DECQ itr1
+ VPADDD Y14, Y0, Y0
+ VPADDD Y9, Y5, Y5
+ VPADDD Y10, Y6, Y6
+ VPADDD Y11, Y7, Y7
+ VPXOR Y0, Y4, Y4
+ VPXOR Y5, Y1, Y1
+ VPXOR Y6, Y2, Y2
+ VPXOR Y7, Y3, Y3
+ VPSHUFB ·rol8<>+0(SB), Y4, Y4
+ VPSHUFB ·rol8<>+0(SB), Y1, Y1
+ VPSHUFB ·rol8<>+0(SB), Y2, Y2
+ VPSHUFB ·rol8<>+0(SB), Y3, Y3
+ ADDQ 16(DI), R10
+ ADCQ 24(DI), R11
+ ADCQ $0x01, R12
+ VPADDD Y4, Y12, Y12
+ VPADDD Y1, Y13, Y13
+ VPADDD Y2, Y8, Y8
+ VPADDD Y3, Y15, Y15
+ MOVQ (BP), DX
+ MOVQ DX, R15
+ MULXQ R10, R13, R14
+ IMULQ R12, R15
+ MULXQ R11, AX, DX
+ ADDQ AX, R14
+ ADCQ DX, R15
+ VPXOR Y12, Y14, Y14
+ VPXOR Y13, Y9, Y9
+ VPXOR Y8, Y10, Y10
+ VPXOR Y15, Y11, Y11
+ VMOVDQA Y15, 224(BP)
+ VPSLLD $0x07, Y14, Y15
+ VPSRLD $0x19, Y14, Y14
+ VPXOR Y15, Y14, Y14
+ VPSLLD $0x07, Y9, Y15
+ VPSRLD $0x19, Y9, Y9
+ VPXOR Y15, Y9, Y9
+ VPSLLD $0x07, Y10, Y15
+ VPSRLD $0x19, Y10, Y10
+ VPXOR Y15, Y10, Y10
+ VPSLLD $0x07, Y11, Y15
+ VPSRLD $0x19, Y11, Y11
+ VPXOR Y15, Y11, Y11
+ VMOVDQA 224(BP), Y15
+ MOVQ 8(BP), DX
+ MULXQ R10, R10, AX
+ ADDQ R10, R14
+ MULXQ R11, R11, R8
+ ADCQ R11, R15
+ ADCQ $0x00, R8
+ VPALIGNR $0x04, Y14, Y14, Y14
+ VPALIGNR $0x04, Y9, Y9, Y9
+ VPALIGNR $0x04, Y10, Y10, Y10
+ VPALIGNR $0x04, Y11, Y11, Y11
+ VPALIGNR $0x08, Y12, Y12, Y12
+ VPALIGNR $0x08, Y13, Y13, Y13
+ VPALIGNR $0x08, Y8, Y8, Y8
+ VPALIGNR $0x08, Y15, Y15, Y15
+ VPALIGNR $0x0c, Y4, Y4, Y4
+ VPALIGNR $0x0c, Y1, Y1, Y1
+ VPALIGNR $0x0c, Y2, Y2, Y2
+ VPALIGNR $0x0c, Y3, Y3, Y3
+ VPADDD Y14, Y0, Y0
+ VPADDD Y9, Y5, Y5
+ VPADDD Y10, Y6, Y6
+ VPADDD Y11, Y7, Y7
+ IMULQ R12, DX
+ ADDQ AX, R15
+ ADCQ DX, R8
+ VPXOR Y0, Y4, Y4
+ VPXOR Y5, Y1, Y1
+ VPXOR Y6, Y2, Y2
+ VPXOR Y7, Y3, Y3
+ VPSHUFB ·rol16<>+0(SB), Y4, Y4
+ VPSHUFB ·rol16<>+0(SB), Y1, Y1
+ VPSHUFB ·rol16<>+0(SB), Y2, Y2
+ VPSHUFB ·rol16<>+0(SB), Y3, Y3
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ VPADDD Y4, Y12, Y12
+ VPADDD Y1, Y13, Y13
+ VPADDD Y2, Y8, Y8
+ VPADDD Y3, Y15, Y15
+ VPXOR Y12, Y14, Y14
+ VPXOR Y13, Y9, Y9
+ VPXOR Y8, Y10, Y10
+ VPXOR Y15, Y11, Y11
+ ADDQ 32(DI), R10
+ ADCQ 40(DI), R11
+ ADCQ $0x01, R12
+ LEAQ 48(DI), DI
+ VMOVDQA Y15, 224(BP)
+ VPSLLD $0x0c, Y14, Y15
+ VPSRLD $0x14, Y14, Y14
+ VPXOR Y15, Y14, Y14
+ VPSLLD $0x0c, Y9, Y15
+ VPSRLD $0x14, Y9, Y9
+ VPXOR Y15, Y9, Y9
+ VPSLLD $0x0c, Y10, Y15
+ VPSRLD $0x14, Y10, Y10
+ VPXOR Y15, Y10, Y10
+ VPSLLD $0x0c, Y11, Y15
+ VPSRLD $0x14, Y11, Y11
+ VPXOR Y15, Y11, Y11
+ VMOVDQA 224(BP), Y15
+ MOVQ (BP), DX
+ MOVQ DX, R15
+ MULXQ R10, R13, R14
+ IMULQ R12, R15
+ MULXQ R11, AX, DX
+ ADDQ AX, R14
+ ADCQ DX, R15
+ VPADDD Y14, Y0, Y0
+ VPADDD Y9, Y5, Y5
+ VPADDD Y10, Y6, Y6
+ VPADDD Y11, Y7, Y7
+ VPXOR Y0, Y4, Y4
+ VPXOR Y5, Y1, Y1
+ VPXOR Y6, Y2, Y2
+ VPXOR Y7, Y3, Y3
+ MOVQ 8(BP), DX
+ MULXQ R10, R10, AX
+ ADDQ R10, R14
+ MULXQ R11, R11, R8
+ ADCQ R11, R15
+ ADCQ $0x00, R8
+ VPSHUFB ·rol8<>+0(SB), Y4, Y4
+ VPSHUFB ·rol8<>+0(SB), Y1, Y1
+ VPSHUFB ·rol8<>+0(SB), Y2, Y2
+ VPSHUFB ·rol8<>+0(SB), Y3, Y3
+ VPADDD Y4, Y12, Y12
+ VPADDD Y1, Y13, Y13
+ VPADDD Y2, Y8, Y8
+ VPADDD Y3, Y15, Y15
+ IMULQ R12, DX
+ ADDQ AX, R15
+ ADCQ DX, R8
+ VPXOR Y12, Y14, Y14
+ VPXOR Y13, Y9, Y9
+ VPXOR Y8, Y10, Y10
+ VPXOR Y15, Y11, Y11
+ VMOVDQA Y15, 224(BP)
+ VPSLLD $0x07, Y14, Y15
+ VPSRLD $0x19, Y14, Y14
+ VPXOR Y15, Y14, Y14
+ VPSLLD $0x07, Y9, Y15
+ VPSRLD $0x19, Y9, Y9
+ VPXOR Y15, Y9, Y9
+ VPSLLD $0x07, Y10, Y15
+ VPSRLD $0x19, Y10, Y10
+ VPXOR Y15, Y10, Y10
+ VPSLLD $0x07, Y11, Y15
+ VPSRLD $0x19, Y11, Y11
+ VPXOR Y15, Y11, Y11
+ VMOVDQA 224(BP), Y15
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ VPALIGNR $0x0c, Y14, Y14, Y14
+ VPALIGNR $0x0c, Y9, Y9, Y9
+ VPALIGNR $0x0c, Y10, Y10, Y10
+ VPALIGNR $0x0c, Y11, Y11, Y11
+ VPALIGNR $0x08, Y12, Y12, Y12
+ VPALIGNR $0x08, Y13, Y13, Y13
+ VPALIGNR $0x08, Y8, Y8, Y8
+ VPALIGNR $0x08, Y15, Y15, Y15
+ VPALIGNR $0x04, Y4, Y4, Y4
+ VPALIGNR $0x04, Y1, Y1, Y1
+ VPALIGNR $0x04, Y2, Y2, Y2
+ VPALIGNR $0x04, Y3, Y3, Y3
+ DECQ CX
JNE sealAVX2InternalLoop
-
- VPADDD ·chacha20Constants<>(SB), AA0, AA0; VPADDD ·chacha20Constants<>(SB), AA1, AA1; VPADDD ·chacha20Constants<>(SB), AA2, AA2; VPADDD ·chacha20Constants<>(SB), AA3, AA3
- VPADDD state1StoreAVX2, BB0, BB0; VPADDD state1StoreAVX2, BB1, BB1; VPADDD state1StoreAVX2, BB2, BB2; VPADDD state1StoreAVX2, BB3, BB3
- VPADDD state2StoreAVX2, CC0, CC0; VPADDD state2StoreAVX2, CC1, CC1; VPADDD state2StoreAVX2, CC2, CC2; VPADDD state2StoreAVX2, CC3, CC3
- VPADDD ctr0StoreAVX2, DD0, DD0; VPADDD ctr1StoreAVX2, DD1, DD1; VPADDD ctr2StoreAVX2, DD2, DD2; VPADDD ctr3StoreAVX2, DD3, DD3
- VMOVDQA CC3, tmpStoreAVX2
+ VPADDD ·chacha20Constants<>+0(SB), Y0, Y0
+ VPADDD ·chacha20Constants<>+0(SB), Y5, Y5
+ VPADDD ·chacha20Constants<>+0(SB), Y6, Y6
+ VPADDD ·chacha20Constants<>+0(SB), Y7, Y7
+ VPADDD 32(BP), Y14, Y14
+ VPADDD 32(BP), Y9, Y9
+ VPADDD 32(BP), Y10, Y10
+ VPADDD 32(BP), Y11, Y11
+ VPADDD 64(BP), Y12, Y12
+ VPADDD 64(BP), Y13, Y13
+ VPADDD 64(BP), Y8, Y8
+ VPADDD 64(BP), Y15, Y15
+ VPADDD 96(BP), Y4, Y4
+ VPADDD 128(BP), Y1, Y1
+ VPADDD 160(BP), Y2, Y2
+ VPADDD 192(BP), Y3, Y3
+ VMOVDQA Y15, 224(BP)
// We only hashed 480 of the 512 bytes available - hash the remaining 32 here
- polyAdd(0*8(oup))
- polyMulAVX2
- LEAQ (4*8)(oup), oup
- VPERM2I128 $0x02, AA0, BB0, CC3; VPERM2I128 $0x13, AA0, BB0, BB0; VPERM2I128 $0x02, CC0, DD0, AA0; VPERM2I128 $0x13, CC0, DD0, CC0
- VPXOR (0*32)(inp), CC3, CC3; VPXOR (1*32)(inp), AA0, AA0; VPXOR (2*32)(inp), BB0, BB0; VPXOR (3*32)(inp), CC0, CC0
- VMOVDQU CC3, (0*32)(oup); VMOVDQU AA0, (1*32)(oup); VMOVDQU BB0, (2*32)(oup); VMOVDQU CC0, (3*32)(oup)
- VPERM2I128 $0x02, AA1, BB1, AA0; VPERM2I128 $0x02, CC1, DD1, BB0; VPERM2I128 $0x13, AA1, BB1, CC0; VPERM2I128 $0x13, CC1, DD1, DD0
- VPXOR (4*32)(inp), AA0, AA0; VPXOR (5*32)(inp), BB0, BB0; VPXOR (6*32)(inp), CC0, CC0; VPXOR (7*32)(inp), DD0, DD0
- VMOVDQU AA0, (4*32)(oup); VMOVDQU BB0, (5*32)(oup); VMOVDQU CC0, (6*32)(oup); VMOVDQU DD0, (7*32)(oup)
+ ADDQ (DI), R10
+ ADCQ 8(DI), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), DX
+ MOVQ DX, R15
+ MULXQ R10, R13, R14
+ IMULQ R12, R15
+ MULXQ R11, AX, DX
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), DX
+ MULXQ R10, R10, AX
+ ADDQ R10, R14
+ MULXQ R11, R11, R8
+ ADCQ R11, R15
+ ADCQ $0x00, R8
+ IMULQ R12, DX
+ ADDQ AX, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ LEAQ 32(DI), DI
+ VPERM2I128 $0x02, Y0, Y14, Y15
+ VPERM2I128 $0x13, Y0, Y14, Y14
+ VPERM2I128 $0x02, Y12, Y4, Y0
+ VPERM2I128 $0x13, Y12, Y4, Y12
+ VPXOR (SI), Y15, Y15
+ VPXOR 32(SI), Y0, Y0
+ VPXOR 64(SI), Y14, Y14
+ VPXOR 96(SI), Y12, Y12
+ VMOVDQU Y15, (DI)
+ VMOVDQU Y0, 32(DI)
+ VMOVDQU Y14, 64(DI)
+ VMOVDQU Y12, 96(DI)
+ VPERM2I128 $0x02, Y5, Y9, Y0
+ VPERM2I128 $0x02, Y13, Y1, Y14
+ VPERM2I128 $0x13, Y5, Y9, Y12
+ VPERM2I128 $0x13, Y13, Y1, Y4
+ VPXOR 128(SI), Y0, Y0
+ VPXOR 160(SI), Y14, Y14
+ VPXOR 192(SI), Y12, Y12
+ VPXOR 224(SI), Y4, Y4
+ VMOVDQU Y0, 128(DI)
+ VMOVDQU Y14, 160(DI)
+ VMOVDQU Y12, 192(DI)
+ VMOVDQU Y4, 224(DI)
// and here
- polyAdd(-2*8(oup))
- polyMulAVX2
- VPERM2I128 $0x02, AA2, BB2, AA0; VPERM2I128 $0x02, CC2, DD2, BB0; VPERM2I128 $0x13, AA2, BB2, CC0; VPERM2I128 $0x13, CC2, DD2, DD0
- VPXOR (8*32)(inp), AA0, AA0; VPXOR (9*32)(inp), BB0, BB0; VPXOR (10*32)(inp), CC0, CC0; VPXOR (11*32)(inp), DD0, DD0
- VMOVDQU AA0, (8*32)(oup); VMOVDQU BB0, (9*32)(oup); VMOVDQU CC0, (10*32)(oup); VMOVDQU DD0, (11*32)(oup)
- VPERM2I128 $0x02, AA3, BB3, AA0; VPERM2I128 $0x02, tmpStoreAVX2, DD3, BB0; VPERM2I128 $0x13, AA3, BB3, CC0; VPERM2I128 $0x13, tmpStoreAVX2, DD3, DD0
- VPXOR (12*32)(inp), AA0, AA0; VPXOR (13*32)(inp), BB0, BB0; VPXOR (14*32)(inp), CC0, CC0; VPXOR (15*32)(inp), DD0, DD0
- VMOVDQU AA0, (12*32)(oup); VMOVDQU BB0, (13*32)(oup); VMOVDQU CC0, (14*32)(oup); VMOVDQU DD0, (15*32)(oup)
- LEAQ (32*16)(inp), inp
- SUBQ $(32*16), inl
- CMPQ inl, $512
+ ADDQ -16(DI), R10
+ ADCQ -8(DI), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), DX
+ MOVQ DX, R15
+ MULXQ R10, R13, R14
+ IMULQ R12, R15
+ MULXQ R11, AX, DX
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), DX
+ MULXQ R10, R10, AX
+ ADDQ R10, R14
+ MULXQ R11, R11, R8
+ ADCQ R11, R15
+ ADCQ $0x00, R8
+ IMULQ R12, DX
+ ADDQ AX, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ VPERM2I128 $0x02, Y6, Y10, Y0
+ VPERM2I128 $0x02, Y8, Y2, Y14
+ VPERM2I128 $0x13, Y6, Y10, Y12
+ VPERM2I128 $0x13, Y8, Y2, Y4
+ VPXOR 256(SI), Y0, Y0
+ VPXOR 288(SI), Y14, Y14
+ VPXOR 320(SI), Y12, Y12
+ VPXOR 352(SI), Y4, Y4
+ VMOVDQU Y0, 256(DI)
+ VMOVDQU Y14, 288(DI)
+ VMOVDQU Y12, 320(DI)
+ VMOVDQU Y4, 352(DI)
+ VPERM2I128 $0x02, Y7, Y11, Y0
+ VPERM2I128 $0x02, 224(BP), Y3, Y14
+ VPERM2I128 $0x13, Y7, Y11, Y12
+ VPERM2I128 $0x13, 224(BP), Y3, Y4
+ VPXOR 384(SI), Y0, Y0
+ VPXOR 416(SI), Y14, Y14
+ VPXOR 448(SI), Y12, Y12
+ VPXOR 480(SI), Y4, Y4
+ VMOVDQU Y0, 384(DI)
+ VMOVDQU Y14, 416(DI)
+ VMOVDQU Y12, 448(DI)
+ VMOVDQU Y4, 480(DI)
+ LEAQ 512(SI), SI
+ SUBQ $0x00000200, BX
+ CMPQ BX, $0x00000200
JG sealAVX2MainLoop
// Tail can only hash 480 bytes
- polyAdd(0*8(oup))
- polyMulAVX2
- polyAdd(2*8(oup))
- polyMulAVX2
- LEAQ 32(oup), oup
-
- MOVQ $10, itr1
- MOVQ $0, itr2
- CMPQ inl, $128
- JBE sealAVX2Tail128
- CMPQ inl, $256
- JBE sealAVX2Tail256
- CMPQ inl, $384
- JBE sealAVX2Tail384
- JMP sealAVX2Tail512
-
-// ----------------------------------------------------------------------------
-// Special optimization for buffers smaller than 193 bytes
+ ADDQ (DI), R10
+ ADCQ 8(DI), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), DX
+ MOVQ DX, R15
+ MULXQ R10, R13, R14
+ IMULQ R12, R15
+ MULXQ R11, AX, DX
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), DX
+ MULXQ R10, R10, AX
+ ADDQ R10, R14
+ MULXQ R11, R11, R8
+ ADCQ R11, R15
+ ADCQ $0x00, R8
+ IMULQ R12, DX
+ ADDQ AX, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ ADDQ 16(DI), R10
+ ADCQ 24(DI), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), DX
+ MOVQ DX, R15
+ MULXQ R10, R13, R14
+ IMULQ R12, R15
+ MULXQ R11, AX, DX
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), DX
+ MULXQ R10, R10, AX
+ ADDQ R10, R14
+ MULXQ R11, R11, R8
+ ADCQ R11, R15
+ ADCQ $0x00, R8
+ IMULQ R12, DX
+ ADDQ AX, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ LEAQ 32(DI), DI
+ MOVQ $0x0000000a, CX
+ MOVQ $0x00000000, R9
+ CMPQ BX, $0x80
+ JBE sealAVX2Tail128
+ CMPQ BX, $0x00000100
+ JBE sealAVX2Tail256
+ CMPQ BX, $0x00000180
+ JBE sealAVX2Tail384
+ JMP sealAVX2Tail512
+
seal192AVX2:
- // For up to 192 bytes of ciphertext and 64 bytes for the poly key, we process four blocks
- VMOVDQA AA0, AA1
- VMOVDQA BB0, BB1
- VMOVDQA CC0, CC1
- VPADDD ·avx2IncMask<>(SB), DD0, DD1
- VMOVDQA AA0, AA2
- VMOVDQA BB0, BB2
- VMOVDQA CC0, CC2
- VMOVDQA DD0, DD2
- VMOVDQA DD1, TT3
- MOVQ $10, itr2
+ VMOVDQA Y0, Y5
+ VMOVDQA Y14, Y9
+ VMOVDQA Y12, Y13
+ VPADDD ·avx2IncMask<>+0(SB), Y4, Y1
+ VMOVDQA Y0, Y6
+ VMOVDQA Y14, Y10
+ VMOVDQA Y12, Y8
+ VMOVDQA Y4, Y2
+ VMOVDQA Y1, Y15
+ MOVQ $0x0000000a, R9
sealAVX2192InnerCipherLoop:
- chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0)
- VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $4, BB1, BB1, BB1
- VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1
- VPALIGNR $12, DD0, DD0, DD0; VPALIGNR $12, DD1, DD1, DD1
- chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0)
- VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $12, BB1, BB1, BB1
- VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1
- VPALIGNR $4, DD0, DD0, DD0; VPALIGNR $4, DD1, DD1, DD1
- DECQ itr2
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol16<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x0c, Y14, Y3
+ VPSRLD $0x14, Y14, Y14
+ VPXOR Y3, Y14, Y14
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol8<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x07, Y14, Y3
+ VPSRLD $0x19, Y14, Y14
+ VPXOR Y3, Y14, Y14
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol16<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x0c, Y9, Y3
+ VPSRLD $0x14, Y9, Y9
+ VPXOR Y3, Y9, Y9
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol8<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x07, Y9, Y3
+ VPSRLD $0x19, Y9, Y9
+ VPXOR Y3, Y9, Y9
+ VPALIGNR $0x04, Y14, Y14, Y14
+ VPALIGNR $0x04, Y9, Y9, Y9
+ VPALIGNR $0x08, Y12, Y12, Y12
+ VPALIGNR $0x08, Y13, Y13, Y13
+ VPALIGNR $0x0c, Y4, Y4, Y4
+ VPALIGNR $0x0c, Y1, Y1, Y1
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol16<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x0c, Y14, Y3
+ VPSRLD $0x14, Y14, Y14
+ VPXOR Y3, Y14, Y14
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol8<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x07, Y14, Y3
+ VPSRLD $0x19, Y14, Y14
+ VPXOR Y3, Y14, Y14
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol16<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x0c, Y9, Y3
+ VPSRLD $0x14, Y9, Y9
+ VPXOR Y3, Y9, Y9
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol8<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x07, Y9, Y3
+ VPSRLD $0x19, Y9, Y9
+ VPXOR Y3, Y9, Y9
+ VPALIGNR $0x0c, Y14, Y14, Y14
+ VPALIGNR $0x0c, Y9, Y9, Y9
+ VPALIGNR $0x08, Y12, Y12, Y12
+ VPALIGNR $0x08, Y13, Y13, Y13
+ VPALIGNR $0x04, Y4, Y4, Y4
+ VPALIGNR $0x04, Y1, Y1, Y1
+ DECQ R9
JNE sealAVX2192InnerCipherLoop
- VPADDD AA2, AA0, AA0; VPADDD AA2, AA1, AA1
- VPADDD BB2, BB0, BB0; VPADDD BB2, BB1, BB1
- VPADDD CC2, CC0, CC0; VPADDD CC2, CC1, CC1
- VPADDD DD2, DD0, DD0; VPADDD TT3, DD1, DD1
- VPERM2I128 $0x02, AA0, BB0, TT0
+ VPADDD Y6, Y0, Y0
+ VPADDD Y6, Y5, Y5
+ VPADDD Y10, Y14, Y14
+ VPADDD Y10, Y9, Y9
+ VPADDD Y8, Y12, Y12
+ VPADDD Y8, Y13, Y13
+ VPADDD Y2, Y4, Y4
+ VPADDD Y15, Y1, Y1
+ VPERM2I128 $0x02, Y0, Y14, Y3
// Clamp and store poly key
- VPAND ·polyClampMask<>(SB), TT0, TT0
- VMOVDQA TT0, rsStoreAVX2
+ VPAND ·polyClampMask<>+0(SB), Y3, Y3
+ VMOVDQA Y3, (BP)
// Stream for up to 192 bytes
- VPERM2I128 $0x13, AA0, BB0, AA0
- VPERM2I128 $0x13, CC0, DD0, BB0
- VPERM2I128 $0x02, AA1, BB1, CC0
- VPERM2I128 $0x02, CC1, DD1, DD0
- VPERM2I128 $0x13, AA1, BB1, AA1
- VPERM2I128 $0x13, CC1, DD1, BB1
+ VPERM2I128 $0x13, Y0, Y14, Y0
+ VPERM2I128 $0x13, Y12, Y4, Y14
+ VPERM2I128 $0x02, Y5, Y9, Y12
+ VPERM2I128 $0x02, Y13, Y1, Y4
+ VPERM2I128 $0x13, Y5, Y9, Y5
+ VPERM2I128 $0x13, Y13, Y1, Y9
sealAVX2ShortSeal:
// Hash aad
- MOVQ ad_len+80(FP), itr2
+ MOVQ ad_len+80(FP), R9
CALL polyHashADInternal<>(SB)
- XORQ itr1, itr1
+ XORQ CX, CX
sealAVX2SealHash:
// itr1 holds the number of bytes encrypted but not yet hashed
- CMPQ itr1, $16
- JB sealAVX2ShortSealLoop
- polyAdd(0(oup))
- polyMul
- SUBQ $16, itr1
- ADDQ $16, oup
- JMP sealAVX2SealHash
+ CMPQ CX, $0x10
+ JB sealAVX2ShortSealLoop
+ ADDQ (DI), R10
+ ADCQ 8(DI), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), AX
+ MOVQ AX, R15
+ MULQ R10
+ MOVQ AX, R13
+ MOVQ DX, R14
+ MOVQ (BP), AX
+ MULQ R11
+ IMULQ R12, R15
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), AX
+ MOVQ AX, R8
+ MULQ R10
+ ADDQ AX, R14
+ ADCQ $0x00, DX
+ MOVQ DX, R10
+ MOVQ 8(BP), AX
+ MULQ R11
+ ADDQ AX, R15
+ ADCQ $0x00, DX
+ IMULQ R12, R8
+ ADDQ R10, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ SUBQ $0x10, CX
+ ADDQ $0x10, DI
+ JMP sealAVX2SealHash
sealAVX2ShortSealLoop:
- CMPQ inl, $32
+ CMPQ BX, $0x20
JB sealAVX2ShortTail32
- SUBQ $32, inl
+ SUBQ $0x20, BX
// Load for encryption
- VPXOR (inp), AA0, AA0
- VMOVDQU AA0, (oup)
- LEAQ (1*32)(inp), inp
+ VPXOR (SI), Y0, Y0
+ VMOVDQU Y0, (DI)
+ LEAQ 32(SI), SI
// Now can hash
- polyAdd(0*8(oup))
- polyMulAVX2
- polyAdd(2*8(oup))
- polyMulAVX2
- LEAQ (1*32)(oup), oup
+ ADDQ (DI), R10
+ ADCQ 8(DI), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), DX
+ MOVQ DX, R15
+ MULXQ R10, R13, R14
+ IMULQ R12, R15
+ MULXQ R11, AX, DX
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), DX
+ MULXQ R10, R10, AX
+ ADDQ R10, R14
+ MULXQ R11, R11, R8
+ ADCQ R11, R15
+ ADCQ $0x00, R8
+ IMULQ R12, DX
+ ADDQ AX, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ ADDQ 16(DI), R10
+ ADCQ 24(DI), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), DX
+ MOVQ DX, R15
+ MULXQ R10, R13, R14
+ IMULQ R12, R15
+ MULXQ R11, AX, DX
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), DX
+ MULXQ R10, R10, AX
+ ADDQ R10, R14
+ MULXQ R11, R11, R8
+ ADCQ R11, R15
+ ADCQ $0x00, R8
+ IMULQ R12, DX
+ ADDQ AX, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ LEAQ 32(DI), DI
// Shift stream left
- VMOVDQA BB0, AA0
- VMOVDQA CC0, BB0
- VMOVDQA DD0, CC0
- VMOVDQA AA1, DD0
- VMOVDQA BB1, AA1
- VMOVDQA CC1, BB1
- VMOVDQA DD1, CC1
- VMOVDQA AA2, DD1
- VMOVDQA BB2, AA2
+ VMOVDQA Y14, Y0
+ VMOVDQA Y12, Y14
+ VMOVDQA Y4, Y12
+ VMOVDQA Y5, Y4
+ VMOVDQA Y9, Y5
+ VMOVDQA Y13, Y9
+ VMOVDQA Y1, Y13
+ VMOVDQA Y6, Y1
+ VMOVDQA Y10, Y6
JMP sealAVX2ShortSealLoop
sealAVX2ShortTail32:
- CMPQ inl, $16
- VMOVDQA A0, A1
+ CMPQ BX, $0x10
+ VMOVDQA X0, X1
JB sealAVX2ShortDone
-
- SUBQ $16, inl
+ SUBQ $0x10, BX
// Load for encryption
- VPXOR (inp), A0, T0
- VMOVDQU T0, (oup)
- LEAQ (1*16)(inp), inp
+ VPXOR (SI), X0, X12
+ VMOVDQU X12, (DI)
+ LEAQ 16(SI), SI
// Hash
- polyAdd(0*8(oup))
- polyMulAVX2
- LEAQ (1*16)(oup), oup
- VPERM2I128 $0x11, AA0, AA0, AA0
- VMOVDQA A0, A1
+ ADDQ (DI), R10
+ ADCQ 8(DI), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), DX
+ MOVQ DX, R15
+ MULXQ R10, R13, R14
+ IMULQ R12, R15
+ MULXQ R11, AX, DX
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), DX
+ MULXQ R10, R10, AX
+ ADDQ R10, R14
+ MULXQ R11, R11, R8
+ ADCQ R11, R15
+ ADCQ $0x00, R8
+ IMULQ R12, DX
+ ADDQ AX, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ LEAQ 16(DI), DI
+ VPERM2I128 $0x11, Y0, Y0, Y0
+ VMOVDQA X0, X1
sealAVX2ShortDone:
VZEROUPPER
JMP sealSSETail
-// ----------------------------------------------------------------------------
-// Special optimization for buffers smaller than 321 bytes
seal320AVX2:
- // For up to 320 bytes of ciphertext and 64 bytes for the poly key, we process six blocks
- VMOVDQA AA0, AA1; VMOVDQA BB0, BB1; VMOVDQA CC0, CC1; VPADDD ·avx2IncMask<>(SB), DD0, DD1
- VMOVDQA AA0, AA2; VMOVDQA BB0, BB2; VMOVDQA CC0, CC2; VPADDD ·avx2IncMask<>(SB), DD1, DD2
- VMOVDQA BB0, TT1; VMOVDQA CC0, TT2; VMOVDQA DD0, TT3
- MOVQ $10, itr2
+ VMOVDQA Y0, Y5
+ VMOVDQA Y14, Y9
+ VMOVDQA Y12, Y13
+ VPADDD ·avx2IncMask<>+0(SB), Y4, Y1
+ VMOVDQA Y0, Y6
+ VMOVDQA Y14, Y10
+ VMOVDQA Y12, Y8
+ VPADDD ·avx2IncMask<>+0(SB), Y1, Y2
+ VMOVDQA Y14, Y7
+ VMOVDQA Y12, Y11
+ VMOVDQA Y4, Y15
+ MOVQ $0x0000000a, R9
sealAVX2320InnerCipherLoop:
- chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0); chachaQR_AVX2(AA2, BB2, CC2, DD2, TT0)
- VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $4, BB1, BB1, BB1; VPALIGNR $4, BB2, BB2, BB2
- VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2
- VPALIGNR $12, DD0, DD0, DD0; VPALIGNR $12, DD1, DD1, DD1; VPALIGNR $12, DD2, DD2, DD2
- chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0); chachaQR_AVX2(AA2, BB2, CC2, DD2, TT0)
- VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $12, BB1, BB1, BB1; VPALIGNR $12, BB2, BB2, BB2
- VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2
- VPALIGNR $4, DD0, DD0, DD0; VPALIGNR $4, DD1, DD1, DD1; VPALIGNR $4, DD2, DD2, DD2
- DECQ itr2
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol16<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x0c, Y14, Y3
+ VPSRLD $0x14, Y14, Y14
+ VPXOR Y3, Y14, Y14
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol8<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x07, Y14, Y3
+ VPSRLD $0x19, Y14, Y14
+ VPXOR Y3, Y14, Y14
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol16<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x0c, Y9, Y3
+ VPSRLD $0x14, Y9, Y9
+ VPXOR Y3, Y9, Y9
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol8<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x07, Y9, Y3
+ VPSRLD $0x19, Y9, Y9
+ VPXOR Y3, Y9, Y9
+ VPADDD Y10, Y6, Y6
+ VPXOR Y6, Y2, Y2
+ VPSHUFB ·rol16<>+0(SB), Y2, Y2
+ VPADDD Y2, Y8, Y8
+ VPXOR Y8, Y10, Y10
+ VPSLLD $0x0c, Y10, Y3
+ VPSRLD $0x14, Y10, Y10
+ VPXOR Y3, Y10, Y10
+ VPADDD Y10, Y6, Y6
+ VPXOR Y6, Y2, Y2
+ VPSHUFB ·rol8<>+0(SB), Y2, Y2
+ VPADDD Y2, Y8, Y8
+ VPXOR Y8, Y10, Y10
+ VPSLLD $0x07, Y10, Y3
+ VPSRLD $0x19, Y10, Y10
+ VPXOR Y3, Y10, Y10
+ VPALIGNR $0x04, Y14, Y14, Y14
+ VPALIGNR $0x04, Y9, Y9, Y9
+ VPALIGNR $0x04, Y10, Y10, Y10
+ VPALIGNR $0x08, Y12, Y12, Y12
+ VPALIGNR $0x08, Y13, Y13, Y13
+ VPALIGNR $0x08, Y8, Y8, Y8
+ VPALIGNR $0x0c, Y4, Y4, Y4
+ VPALIGNR $0x0c, Y1, Y1, Y1
+ VPALIGNR $0x0c, Y2, Y2, Y2
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol16<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x0c, Y14, Y3
+ VPSRLD $0x14, Y14, Y14
+ VPXOR Y3, Y14, Y14
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol8<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x07, Y14, Y3
+ VPSRLD $0x19, Y14, Y14
+ VPXOR Y3, Y14, Y14
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol16<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x0c, Y9, Y3
+ VPSRLD $0x14, Y9, Y9
+ VPXOR Y3, Y9, Y9
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol8<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x07, Y9, Y3
+ VPSRLD $0x19, Y9, Y9
+ VPXOR Y3, Y9, Y9
+ VPADDD Y10, Y6, Y6
+ VPXOR Y6, Y2, Y2
+ VPSHUFB ·rol16<>+0(SB), Y2, Y2
+ VPADDD Y2, Y8, Y8
+ VPXOR Y8, Y10, Y10
+ VPSLLD $0x0c, Y10, Y3
+ VPSRLD $0x14, Y10, Y10
+ VPXOR Y3, Y10, Y10
+ VPADDD Y10, Y6, Y6
+ VPXOR Y6, Y2, Y2
+ VPSHUFB ·rol8<>+0(SB), Y2, Y2
+ VPADDD Y2, Y8, Y8
+ VPXOR Y8, Y10, Y10
+ VPSLLD $0x07, Y10, Y3
+ VPSRLD $0x19, Y10, Y10
+ VPXOR Y3, Y10, Y10
+ VPALIGNR $0x0c, Y14, Y14, Y14
+ VPALIGNR $0x0c, Y9, Y9, Y9
+ VPALIGNR $0x0c, Y10, Y10, Y10
+ VPALIGNR $0x08, Y12, Y12, Y12
+ VPALIGNR $0x08, Y13, Y13, Y13
+ VPALIGNR $0x08, Y8, Y8, Y8
+ VPALIGNR $0x04, Y4, Y4, Y4
+ VPALIGNR $0x04, Y1, Y1, Y1
+ VPALIGNR $0x04, Y2, Y2, Y2
+ DECQ R9
JNE sealAVX2320InnerCipherLoop
-
- VMOVDQA ·chacha20Constants<>(SB), TT0
- VPADDD TT0, AA0, AA0; VPADDD TT0, AA1, AA1; VPADDD TT0, AA2, AA2
- VPADDD TT1, BB0, BB0; VPADDD TT1, BB1, BB1; VPADDD TT1, BB2, BB2
- VPADDD TT2, CC0, CC0; VPADDD TT2, CC1, CC1; VPADDD TT2, CC2, CC2
- VMOVDQA ·avx2IncMask<>(SB), TT0
- VPADDD TT3, DD0, DD0; VPADDD TT0, TT3, TT3
- VPADDD TT3, DD1, DD1; VPADDD TT0, TT3, TT3
- VPADDD TT3, DD2, DD2
+ VMOVDQA ·chacha20Constants<>+0(SB), Y3
+ VPADDD Y3, Y0, Y0
+ VPADDD Y3, Y5, Y5
+ VPADDD Y3, Y6, Y6
+ VPADDD Y7, Y14, Y14
+ VPADDD Y7, Y9, Y9
+ VPADDD Y7, Y10, Y10
+ VPADDD Y11, Y12, Y12
+ VPADDD Y11, Y13, Y13
+ VPADDD Y11, Y8, Y8
+ VMOVDQA ·avx2IncMask<>+0(SB), Y3
+ VPADDD Y15, Y4, Y4
+ VPADDD Y3, Y15, Y15
+ VPADDD Y15, Y1, Y1
+ VPADDD Y3, Y15, Y15
+ VPADDD Y15, Y2, Y2
// Clamp and store poly key
- VPERM2I128 $0x02, AA0, BB0, TT0
- VPAND ·polyClampMask<>(SB), TT0, TT0
- VMOVDQA TT0, rsStoreAVX2
+ VPERM2I128 $0x02, Y0, Y14, Y3
+ VPAND ·polyClampMask<>+0(SB), Y3, Y3
+ VMOVDQA Y3, (BP)
// Stream for up to 320 bytes
- VPERM2I128 $0x13, AA0, BB0, AA0
- VPERM2I128 $0x13, CC0, DD0, BB0
- VPERM2I128 $0x02, AA1, BB1, CC0
- VPERM2I128 $0x02, CC1, DD1, DD0
- VPERM2I128 $0x13, AA1, BB1, AA1
- VPERM2I128 $0x13, CC1, DD1, BB1
- VPERM2I128 $0x02, AA2, BB2, CC1
- VPERM2I128 $0x02, CC2, DD2, DD1
- VPERM2I128 $0x13, AA2, BB2, AA2
- VPERM2I128 $0x13, CC2, DD2, BB2
+ VPERM2I128 $0x13, Y0, Y14, Y0
+ VPERM2I128 $0x13, Y12, Y4, Y14
+ VPERM2I128 $0x02, Y5, Y9, Y12
+ VPERM2I128 $0x02, Y13, Y1, Y4
+ VPERM2I128 $0x13, Y5, Y9, Y5
+ VPERM2I128 $0x13, Y13, Y1, Y9
+ VPERM2I128 $0x02, Y6, Y10, Y13
+ VPERM2I128 $0x02, Y8, Y2, Y1
+ VPERM2I128 $0x13, Y6, Y10, Y6
+ VPERM2I128 $0x13, Y8, Y2, Y10
JMP sealAVX2ShortSeal
-// ----------------------------------------------------------------------------
-// Special optimization for the last 128 bytes of ciphertext
sealAVX2Tail128:
- // Need to decrypt up to 128 bytes - prepare two blocks
- // If we got here after the main loop - there are 512 encrypted bytes waiting to be hashed
- // If we got here before the main loop - there are 448 encrpyred bytes waiting to be hashed
- VMOVDQA ·chacha20Constants<>(SB), AA0
- VMOVDQA state1StoreAVX2, BB0
- VMOVDQA state2StoreAVX2, CC0
- VMOVDQA ctr3StoreAVX2, DD0
- VPADDD ·avx2IncMask<>(SB), DD0, DD0
- VMOVDQA DD0, DD1
+ VMOVDQA ·chacha20Constants<>+0(SB), Y0
+ VMOVDQA 32(BP), Y14
+ VMOVDQA 64(BP), Y12
+ VMOVDQA 192(BP), Y4
+ VPADDD ·avx2IncMask<>+0(SB), Y4, Y4
+ VMOVDQA Y4, Y1
sealAVX2Tail128LoopA:
- polyAdd(0(oup))
- polyMul
- LEAQ 16(oup), oup
+ ADDQ (DI), R10
+ ADCQ 8(DI), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), AX
+ MOVQ AX, R15
+ MULQ R10
+ MOVQ AX, R13
+ MOVQ DX, R14
+ MOVQ (BP), AX
+ MULQ R11
+ IMULQ R12, R15
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), AX
+ MOVQ AX, R8
+ MULQ R10
+ ADDQ AX, R14
+ ADCQ $0x00, DX
+ MOVQ DX, R10
+ MOVQ 8(BP), AX
+ MULQ R11
+ ADDQ AX, R15
+ ADCQ $0x00, DX
+ IMULQ R12, R8
+ ADDQ R10, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ LEAQ 16(DI), DI
sealAVX2Tail128LoopB:
- chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0)
- polyAdd(0(oup))
- polyMul
- VPALIGNR $4, BB0, BB0, BB0
- VPALIGNR $8, CC0, CC0, CC0
- VPALIGNR $12, DD0, DD0, DD0
- chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0)
- polyAdd(16(oup))
- polyMul
- LEAQ 32(oup), oup
- VPALIGNR $12, BB0, BB0, BB0
- VPALIGNR $8, CC0, CC0, CC0
- VPALIGNR $4, DD0, DD0, DD0
- DECQ itr1
- JG sealAVX2Tail128LoopA
- DECQ itr2
- JGE sealAVX2Tail128LoopB
-
- VPADDD ·chacha20Constants<>(SB), AA0, AA1
- VPADDD state1StoreAVX2, BB0, BB1
- VPADDD state2StoreAVX2, CC0, CC1
- VPADDD DD1, DD0, DD1
-
- VPERM2I128 $0x02, AA1, BB1, AA0
- VPERM2I128 $0x02, CC1, DD1, BB0
- VPERM2I128 $0x13, AA1, BB1, CC0
- VPERM2I128 $0x13, CC1, DD1, DD0
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol16<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x0c, Y14, Y3
+ VPSRLD $0x14, Y14, Y14
+ VPXOR Y3, Y14, Y14
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol8<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x07, Y14, Y3
+ VPSRLD $0x19, Y14, Y14
+ VPXOR Y3, Y14, Y14
+ ADDQ (DI), R10
+ ADCQ 8(DI), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), AX
+ MOVQ AX, R15
+ MULQ R10
+ MOVQ AX, R13
+ MOVQ DX, R14
+ MOVQ (BP), AX
+ MULQ R11
+ IMULQ R12, R15
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), AX
+ MOVQ AX, R8
+ MULQ R10
+ ADDQ AX, R14
+ ADCQ $0x00, DX
+ MOVQ DX, R10
+ MOVQ 8(BP), AX
+ MULQ R11
+ ADDQ AX, R15
+ ADCQ $0x00, DX
+ IMULQ R12, R8
+ ADDQ R10, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ VPALIGNR $0x04, Y14, Y14, Y14
+ VPALIGNR $0x08, Y12, Y12, Y12
+ VPALIGNR $0x0c, Y4, Y4, Y4
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol16<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x0c, Y14, Y3
+ VPSRLD $0x14, Y14, Y14
+ VPXOR Y3, Y14, Y14
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol8<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x07, Y14, Y3
+ VPSRLD $0x19, Y14, Y14
+ VPXOR Y3, Y14, Y14
+ ADDQ 16(DI), R10
+ ADCQ 24(DI), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), AX
+ MOVQ AX, R15
+ MULQ R10
+ MOVQ AX, R13
+ MOVQ DX, R14
+ MOVQ (BP), AX
+ MULQ R11
+ IMULQ R12, R15
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), AX
+ MOVQ AX, R8
+ MULQ R10
+ ADDQ AX, R14
+ ADCQ $0x00, DX
+ MOVQ DX, R10
+ MOVQ 8(BP), AX
+ MULQ R11
+ ADDQ AX, R15
+ ADCQ $0x00, DX
+ IMULQ R12, R8
+ ADDQ R10, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ LEAQ 32(DI), DI
+ VPALIGNR $0x0c, Y14, Y14, Y14
+ VPALIGNR $0x08, Y12, Y12, Y12
+ VPALIGNR $0x04, Y4, Y4, Y4
+ DECQ CX
+ JG sealAVX2Tail128LoopA
+ DECQ R9
+ JGE sealAVX2Tail128LoopB
+ VPADDD ·chacha20Constants<>+0(SB), Y0, Y5
+ VPADDD 32(BP), Y14, Y9
+ VPADDD 64(BP), Y12, Y13
+ VPADDD Y1, Y4, Y1
+ VPERM2I128 $0x02, Y5, Y9, Y0
+ VPERM2I128 $0x02, Y13, Y1, Y14
+ VPERM2I128 $0x13, Y5, Y9, Y12
+ VPERM2I128 $0x13, Y13, Y1, Y4
JMP sealAVX2ShortSealLoop
-// ----------------------------------------------------------------------------
-// Special optimization for the last 256 bytes of ciphertext
sealAVX2Tail256:
- // Need to decrypt up to 256 bytes - prepare two blocks
- // If we got here after the main loop - there are 512 encrypted bytes waiting to be hashed
- // If we got here before the main loop - there are 448 encrpyred bytes waiting to be hashed
- VMOVDQA ·chacha20Constants<>(SB), AA0; VMOVDQA ·chacha20Constants<>(SB), AA1
- VMOVDQA state1StoreAVX2, BB0; VMOVDQA state1StoreAVX2, BB1
- VMOVDQA state2StoreAVX2, CC0; VMOVDQA state2StoreAVX2, CC1
- VMOVDQA ctr3StoreAVX2, DD0
- VPADDD ·avx2IncMask<>(SB), DD0, DD0
- VPADDD ·avx2IncMask<>(SB), DD0, DD1
- VMOVDQA DD0, TT1
- VMOVDQA DD1, TT2
+ VMOVDQA ·chacha20Constants<>+0(SB), Y0
+ VMOVDQA ·chacha20Constants<>+0(SB), Y5
+ VMOVDQA 32(BP), Y14
+ VMOVDQA 32(BP), Y9
+ VMOVDQA 64(BP), Y12
+ VMOVDQA 64(BP), Y13
+ VMOVDQA 192(BP), Y4
+ VPADDD ·avx2IncMask<>+0(SB), Y4, Y4
+ VPADDD ·avx2IncMask<>+0(SB), Y4, Y1
+ VMOVDQA Y4, Y7
+ VMOVDQA Y1, Y11
sealAVX2Tail256LoopA:
- polyAdd(0(oup))
- polyMul
- LEAQ 16(oup), oup
+ ADDQ (DI), R10
+ ADCQ 8(DI), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), AX
+ MOVQ AX, R15
+ MULQ R10
+ MOVQ AX, R13
+ MOVQ DX, R14
+ MOVQ (BP), AX
+ MULQ R11
+ IMULQ R12, R15
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), AX
+ MOVQ AX, R8
+ MULQ R10
+ ADDQ AX, R14
+ ADCQ $0x00, DX
+ MOVQ DX, R10
+ MOVQ 8(BP), AX
+ MULQ R11
+ ADDQ AX, R15
+ ADCQ $0x00, DX
+ IMULQ R12, R8
+ ADDQ R10, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ LEAQ 16(DI), DI
sealAVX2Tail256LoopB:
- chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0)
- polyAdd(0(oup))
- polyMul
- VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $4, BB1, BB1, BB1
- VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1
- VPALIGNR $12, DD0, DD0, DD0; VPALIGNR $12, DD1, DD1, DD1
- chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0)
- polyAdd(16(oup))
- polyMul
- LEAQ 32(oup), oup
- VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $12, BB1, BB1, BB1
- VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1
- VPALIGNR $4, DD0, DD0, DD0; VPALIGNR $4, DD1, DD1, DD1
- DECQ itr1
- JG sealAVX2Tail256LoopA
- DECQ itr2
- JGE sealAVX2Tail256LoopB
-
- VPADDD ·chacha20Constants<>(SB), AA0, AA0; VPADDD ·chacha20Constants<>(SB), AA1, AA1
- VPADDD state1StoreAVX2, BB0, BB0; VPADDD state1StoreAVX2, BB1, BB1
- VPADDD state2StoreAVX2, CC0, CC0; VPADDD state2StoreAVX2, CC1, CC1
- VPADDD TT1, DD0, DD0; VPADDD TT2, DD1, DD1
- VPERM2I128 $0x02, AA0, BB0, TT0
- VPERM2I128 $0x02, CC0, DD0, TT1
- VPERM2I128 $0x13, AA0, BB0, TT2
- VPERM2I128 $0x13, CC0, DD0, TT3
- VPXOR (0*32)(inp), TT0, TT0; VPXOR (1*32)(inp), TT1, TT1; VPXOR (2*32)(inp), TT2, TT2; VPXOR (3*32)(inp), TT3, TT3
- VMOVDQU TT0, (0*32)(oup); VMOVDQU TT1, (1*32)(oup); VMOVDQU TT2, (2*32)(oup); VMOVDQU TT3, (3*32)(oup)
- MOVQ $128, itr1
- LEAQ 128(inp), inp
- SUBQ $128, inl
- VPERM2I128 $0x02, AA1, BB1, AA0
- VPERM2I128 $0x02, CC1, DD1, BB0
- VPERM2I128 $0x13, AA1, BB1, CC0
- VPERM2I128 $0x13, CC1, DD1, DD0
-
- JMP sealAVX2SealHash
-
-// ----------------------------------------------------------------------------
-// Special optimization for the last 384 bytes of ciphertext
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol16<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x0c, Y14, Y3
+ VPSRLD $0x14, Y14, Y14
+ VPXOR Y3, Y14, Y14
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol8<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x07, Y14, Y3
+ VPSRLD $0x19, Y14, Y14
+ VPXOR Y3, Y14, Y14
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol16<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x0c, Y9, Y3
+ VPSRLD $0x14, Y9, Y9
+ VPXOR Y3, Y9, Y9
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol8<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x07, Y9, Y3
+ VPSRLD $0x19, Y9, Y9
+ VPXOR Y3, Y9, Y9
+ ADDQ (DI), R10
+ ADCQ 8(DI), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), AX
+ MOVQ AX, R15
+ MULQ R10
+ MOVQ AX, R13
+ MOVQ DX, R14
+ MOVQ (BP), AX
+ MULQ R11
+ IMULQ R12, R15
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), AX
+ MOVQ AX, R8
+ MULQ R10
+ ADDQ AX, R14
+ ADCQ $0x00, DX
+ MOVQ DX, R10
+ MOVQ 8(BP), AX
+ MULQ R11
+ ADDQ AX, R15
+ ADCQ $0x00, DX
+ IMULQ R12, R8
+ ADDQ R10, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ VPALIGNR $0x04, Y14, Y14, Y14
+ VPALIGNR $0x04, Y9, Y9, Y9
+ VPALIGNR $0x08, Y12, Y12, Y12
+ VPALIGNR $0x08, Y13, Y13, Y13
+ VPALIGNR $0x0c, Y4, Y4, Y4
+ VPALIGNR $0x0c, Y1, Y1, Y1
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol16<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x0c, Y14, Y3
+ VPSRLD $0x14, Y14, Y14
+ VPXOR Y3, Y14, Y14
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol8<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x07, Y14, Y3
+ VPSRLD $0x19, Y14, Y14
+ VPXOR Y3, Y14, Y14
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol16<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x0c, Y9, Y3
+ VPSRLD $0x14, Y9, Y9
+ VPXOR Y3, Y9, Y9
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol8<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x07, Y9, Y3
+ VPSRLD $0x19, Y9, Y9
+ VPXOR Y3, Y9, Y9
+ ADDQ 16(DI), R10
+ ADCQ 24(DI), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), AX
+ MOVQ AX, R15
+ MULQ R10
+ MOVQ AX, R13
+ MOVQ DX, R14
+ MOVQ (BP), AX
+ MULQ R11
+ IMULQ R12, R15
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), AX
+ MOVQ AX, R8
+ MULQ R10
+ ADDQ AX, R14
+ ADCQ $0x00, DX
+ MOVQ DX, R10
+ MOVQ 8(BP), AX
+ MULQ R11
+ ADDQ AX, R15
+ ADCQ $0x00, DX
+ IMULQ R12, R8
+ ADDQ R10, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ LEAQ 32(DI), DI
+ VPALIGNR $0x0c, Y14, Y14, Y14
+ VPALIGNR $0x0c, Y9, Y9, Y9
+ VPALIGNR $0x08, Y12, Y12, Y12
+ VPALIGNR $0x08, Y13, Y13, Y13
+ VPALIGNR $0x04, Y4, Y4, Y4
+ VPALIGNR $0x04, Y1, Y1, Y1
+ DECQ CX
+ JG sealAVX2Tail256LoopA
+ DECQ R9
+ JGE sealAVX2Tail256LoopB
+ VPADDD ·chacha20Constants<>+0(SB), Y0, Y0
+ VPADDD ·chacha20Constants<>+0(SB), Y5, Y5
+ VPADDD 32(BP), Y14, Y14
+ VPADDD 32(BP), Y9, Y9
+ VPADDD 64(BP), Y12, Y12
+ VPADDD 64(BP), Y13, Y13
+ VPADDD Y7, Y4, Y4
+ VPADDD Y11, Y1, Y1
+ VPERM2I128 $0x02, Y0, Y14, Y3
+ VPERM2I128 $0x02, Y12, Y4, Y7
+ VPERM2I128 $0x13, Y0, Y14, Y11
+ VPERM2I128 $0x13, Y12, Y4, Y15
+ VPXOR (SI), Y3, Y3
+ VPXOR 32(SI), Y7, Y7
+ VPXOR 64(SI), Y11, Y11
+ VPXOR 96(SI), Y15, Y15
+ VMOVDQU Y3, (DI)
+ VMOVDQU Y7, 32(DI)
+ VMOVDQU Y11, 64(DI)
+ VMOVDQU Y15, 96(DI)
+ MOVQ $0x00000080, CX
+ LEAQ 128(SI), SI
+ SUBQ $0x80, BX
+ VPERM2I128 $0x02, Y5, Y9, Y0
+ VPERM2I128 $0x02, Y13, Y1, Y14
+ VPERM2I128 $0x13, Y5, Y9, Y12
+ VPERM2I128 $0x13, Y13, Y1, Y4
+ JMP sealAVX2SealHash
+
sealAVX2Tail384:
- // Need to decrypt up to 384 bytes - prepare two blocks
- // If we got here after the main loop - there are 512 encrypted bytes waiting to be hashed
- // If we got here before the main loop - there are 448 encrpyred bytes waiting to be hashed
- VMOVDQA ·chacha20Constants<>(SB), AA0; VMOVDQA AA0, AA1; VMOVDQA AA0, AA2
- VMOVDQA state1StoreAVX2, BB0; VMOVDQA BB0, BB1; VMOVDQA BB0, BB2
- VMOVDQA state2StoreAVX2, CC0; VMOVDQA CC0, CC1; VMOVDQA CC0, CC2
- VMOVDQA ctr3StoreAVX2, DD0
- VPADDD ·avx2IncMask<>(SB), DD0, DD0; VPADDD ·avx2IncMask<>(SB), DD0, DD1; VPADDD ·avx2IncMask<>(SB), DD1, DD2
- VMOVDQA DD0, TT1; VMOVDQA DD1, TT2; VMOVDQA DD2, TT3
+ VMOVDQA ·chacha20Constants<>+0(SB), Y0
+ VMOVDQA Y0, Y5
+ VMOVDQA Y0, Y6
+ VMOVDQA 32(BP), Y14
+ VMOVDQA Y14, Y9
+ VMOVDQA Y14, Y10
+ VMOVDQA 64(BP), Y12
+ VMOVDQA Y12, Y13
+ VMOVDQA Y12, Y8
+ VMOVDQA 192(BP), Y4
+ VPADDD ·avx2IncMask<>+0(SB), Y4, Y4
+ VPADDD ·avx2IncMask<>+0(SB), Y4, Y1
+ VPADDD ·avx2IncMask<>+0(SB), Y1, Y2
+ VMOVDQA Y4, Y7
+ VMOVDQA Y1, Y11
+ VMOVDQA Y2, Y15
sealAVX2Tail384LoopA:
- polyAdd(0(oup))
- polyMul
- LEAQ 16(oup), oup
+ ADDQ (DI), R10
+ ADCQ 8(DI), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), AX
+ MOVQ AX, R15
+ MULQ R10
+ MOVQ AX, R13
+ MOVQ DX, R14
+ MOVQ (BP), AX
+ MULQ R11
+ IMULQ R12, R15
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), AX
+ MOVQ AX, R8
+ MULQ R10
+ ADDQ AX, R14
+ ADCQ $0x00, DX
+ MOVQ DX, R10
+ MOVQ 8(BP), AX
+ MULQ R11
+ ADDQ AX, R15
+ ADCQ $0x00, DX
+ IMULQ R12, R8
+ ADDQ R10, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ LEAQ 16(DI), DI
sealAVX2Tail384LoopB:
- chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0); chachaQR_AVX2(AA2, BB2, CC2, DD2, TT0)
- polyAdd(0(oup))
- polyMul
- VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $4, BB1, BB1, BB1; VPALIGNR $4, BB2, BB2, BB2
- VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2
- VPALIGNR $12, DD0, DD0, DD0; VPALIGNR $12, DD1, DD1, DD1; VPALIGNR $12, DD2, DD2, DD2
- chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0); chachaQR_AVX2(AA2, BB2, CC2, DD2, TT0)
- polyAdd(16(oup))
- polyMul
- LEAQ 32(oup), oup
- VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $12, BB1, BB1, BB1; VPALIGNR $12, BB2, BB2, BB2
- VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2
- VPALIGNR $4, DD0, DD0, DD0; VPALIGNR $4, DD1, DD1, DD1; VPALIGNR $4, DD2, DD2, DD2
- DECQ itr1
- JG sealAVX2Tail384LoopA
- DECQ itr2
- JGE sealAVX2Tail384LoopB
-
- VPADDD ·chacha20Constants<>(SB), AA0, AA0; VPADDD ·chacha20Constants<>(SB), AA1, AA1; VPADDD ·chacha20Constants<>(SB), AA2, AA2
- VPADDD state1StoreAVX2, BB0, BB0; VPADDD state1StoreAVX2, BB1, BB1; VPADDD state1StoreAVX2, BB2, BB2
- VPADDD state2StoreAVX2, CC0, CC0; VPADDD state2StoreAVX2, CC1, CC1; VPADDD state2StoreAVX2, CC2, CC2
- VPADDD TT1, DD0, DD0; VPADDD TT2, DD1, DD1; VPADDD TT3, DD2, DD2
- VPERM2I128 $0x02, AA0, BB0, TT0
- VPERM2I128 $0x02, CC0, DD0, TT1
- VPERM2I128 $0x13, AA0, BB0, TT2
- VPERM2I128 $0x13, CC0, DD0, TT3
- VPXOR (0*32)(inp), TT0, TT0; VPXOR (1*32)(inp), TT1, TT1; VPXOR (2*32)(inp), TT2, TT2; VPXOR (3*32)(inp), TT3, TT3
- VMOVDQU TT0, (0*32)(oup); VMOVDQU TT1, (1*32)(oup); VMOVDQU TT2, (2*32)(oup); VMOVDQU TT3, (3*32)(oup)
- VPERM2I128 $0x02, AA1, BB1, TT0
- VPERM2I128 $0x02, CC1, DD1, TT1
- VPERM2I128 $0x13, AA1, BB1, TT2
- VPERM2I128 $0x13, CC1, DD1, TT3
- VPXOR (4*32)(inp), TT0, TT0; VPXOR (5*32)(inp), TT1, TT1; VPXOR (6*32)(inp), TT2, TT2; VPXOR (7*32)(inp), TT3, TT3
- VMOVDQU TT0, (4*32)(oup); VMOVDQU TT1, (5*32)(oup); VMOVDQU TT2, (6*32)(oup); VMOVDQU TT3, (7*32)(oup)
- MOVQ $256, itr1
- LEAQ 256(inp), inp
- SUBQ $256, inl
- VPERM2I128 $0x02, AA2, BB2, AA0
- VPERM2I128 $0x02, CC2, DD2, BB0
- VPERM2I128 $0x13, AA2, BB2, CC0
- VPERM2I128 $0x13, CC2, DD2, DD0
-
- JMP sealAVX2SealHash
-
-// ----------------------------------------------------------------------------
-// Special optimization for the last 512 bytes of ciphertext
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol16<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x0c, Y14, Y3
+ VPSRLD $0x14, Y14, Y14
+ VPXOR Y3, Y14, Y14
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol8<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x07, Y14, Y3
+ VPSRLD $0x19, Y14, Y14
+ VPXOR Y3, Y14, Y14
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol16<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x0c, Y9, Y3
+ VPSRLD $0x14, Y9, Y9
+ VPXOR Y3, Y9, Y9
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol8<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x07, Y9, Y3
+ VPSRLD $0x19, Y9, Y9
+ VPXOR Y3, Y9, Y9
+ VPADDD Y10, Y6, Y6
+ VPXOR Y6, Y2, Y2
+ VPSHUFB ·rol16<>+0(SB), Y2, Y2
+ VPADDD Y2, Y8, Y8
+ VPXOR Y8, Y10, Y10
+ VPSLLD $0x0c, Y10, Y3
+ VPSRLD $0x14, Y10, Y10
+ VPXOR Y3, Y10, Y10
+ VPADDD Y10, Y6, Y6
+ VPXOR Y6, Y2, Y2
+ VPSHUFB ·rol8<>+0(SB), Y2, Y2
+ VPADDD Y2, Y8, Y8
+ VPXOR Y8, Y10, Y10
+ VPSLLD $0x07, Y10, Y3
+ VPSRLD $0x19, Y10, Y10
+ VPXOR Y3, Y10, Y10
+ ADDQ (DI), R10
+ ADCQ 8(DI), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), AX
+ MOVQ AX, R15
+ MULQ R10
+ MOVQ AX, R13
+ MOVQ DX, R14
+ MOVQ (BP), AX
+ MULQ R11
+ IMULQ R12, R15
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), AX
+ MOVQ AX, R8
+ MULQ R10
+ ADDQ AX, R14
+ ADCQ $0x00, DX
+ MOVQ DX, R10
+ MOVQ 8(BP), AX
+ MULQ R11
+ ADDQ AX, R15
+ ADCQ $0x00, DX
+ IMULQ R12, R8
+ ADDQ R10, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ VPALIGNR $0x04, Y14, Y14, Y14
+ VPALIGNR $0x04, Y9, Y9, Y9
+ VPALIGNR $0x04, Y10, Y10, Y10
+ VPALIGNR $0x08, Y12, Y12, Y12
+ VPALIGNR $0x08, Y13, Y13, Y13
+ VPALIGNR $0x08, Y8, Y8, Y8
+ VPALIGNR $0x0c, Y4, Y4, Y4
+ VPALIGNR $0x0c, Y1, Y1, Y1
+ VPALIGNR $0x0c, Y2, Y2, Y2
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol16<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x0c, Y14, Y3
+ VPSRLD $0x14, Y14, Y14
+ VPXOR Y3, Y14, Y14
+ VPADDD Y14, Y0, Y0
+ VPXOR Y0, Y4, Y4
+ VPSHUFB ·rol8<>+0(SB), Y4, Y4
+ VPADDD Y4, Y12, Y12
+ VPXOR Y12, Y14, Y14
+ VPSLLD $0x07, Y14, Y3
+ VPSRLD $0x19, Y14, Y14
+ VPXOR Y3, Y14, Y14
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol16<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x0c, Y9, Y3
+ VPSRLD $0x14, Y9, Y9
+ VPXOR Y3, Y9, Y9
+ VPADDD Y9, Y5, Y5
+ VPXOR Y5, Y1, Y1
+ VPSHUFB ·rol8<>+0(SB), Y1, Y1
+ VPADDD Y1, Y13, Y13
+ VPXOR Y13, Y9, Y9
+ VPSLLD $0x07, Y9, Y3
+ VPSRLD $0x19, Y9, Y9
+ VPXOR Y3, Y9, Y9
+ VPADDD Y10, Y6, Y6
+ VPXOR Y6, Y2, Y2
+ VPSHUFB ·rol16<>+0(SB), Y2, Y2
+ VPADDD Y2, Y8, Y8
+ VPXOR Y8, Y10, Y10
+ VPSLLD $0x0c, Y10, Y3
+ VPSRLD $0x14, Y10, Y10
+ VPXOR Y3, Y10, Y10
+ VPADDD Y10, Y6, Y6
+ VPXOR Y6, Y2, Y2
+ VPSHUFB ·rol8<>+0(SB), Y2, Y2
+ VPADDD Y2, Y8, Y8
+ VPXOR Y8, Y10, Y10
+ VPSLLD $0x07, Y10, Y3
+ VPSRLD $0x19, Y10, Y10
+ VPXOR Y3, Y10, Y10
+ ADDQ 16(DI), R10
+ ADCQ 24(DI), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), AX
+ MOVQ AX, R15
+ MULQ R10
+ MOVQ AX, R13
+ MOVQ DX, R14
+ MOVQ (BP), AX
+ MULQ R11
+ IMULQ R12, R15
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), AX
+ MOVQ AX, R8
+ MULQ R10
+ ADDQ AX, R14
+ ADCQ $0x00, DX
+ MOVQ DX, R10
+ MOVQ 8(BP), AX
+ MULQ R11
+ ADDQ AX, R15
+ ADCQ $0x00, DX
+ IMULQ R12, R8
+ ADDQ R10, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ LEAQ 32(DI), DI
+ VPALIGNR $0x0c, Y14, Y14, Y14
+ VPALIGNR $0x0c, Y9, Y9, Y9
+ VPALIGNR $0x0c, Y10, Y10, Y10
+ VPALIGNR $0x08, Y12, Y12, Y12
+ VPALIGNR $0x08, Y13, Y13, Y13
+ VPALIGNR $0x08, Y8, Y8, Y8
+ VPALIGNR $0x04, Y4, Y4, Y4
+ VPALIGNR $0x04, Y1, Y1, Y1
+ VPALIGNR $0x04, Y2, Y2, Y2
+ DECQ CX
+ JG sealAVX2Tail384LoopA
+ DECQ R9
+ JGE sealAVX2Tail384LoopB
+ VPADDD ·chacha20Constants<>+0(SB), Y0, Y0
+ VPADDD ·chacha20Constants<>+0(SB), Y5, Y5
+ VPADDD ·chacha20Constants<>+0(SB), Y6, Y6
+ VPADDD 32(BP), Y14, Y14
+ VPADDD 32(BP), Y9, Y9
+ VPADDD 32(BP), Y10, Y10
+ VPADDD 64(BP), Y12, Y12
+ VPADDD 64(BP), Y13, Y13
+ VPADDD 64(BP), Y8, Y8
+ VPADDD Y7, Y4, Y4
+ VPADDD Y11, Y1, Y1
+ VPADDD Y15, Y2, Y2
+ VPERM2I128 $0x02, Y0, Y14, Y3
+ VPERM2I128 $0x02, Y12, Y4, Y7
+ VPERM2I128 $0x13, Y0, Y14, Y11
+ VPERM2I128 $0x13, Y12, Y4, Y15
+ VPXOR (SI), Y3, Y3
+ VPXOR 32(SI), Y7, Y7
+ VPXOR 64(SI), Y11, Y11
+ VPXOR 96(SI), Y15, Y15
+ VMOVDQU Y3, (DI)
+ VMOVDQU Y7, 32(DI)
+ VMOVDQU Y11, 64(DI)
+ VMOVDQU Y15, 96(DI)
+ VPERM2I128 $0x02, Y5, Y9, Y3
+ VPERM2I128 $0x02, Y13, Y1, Y7
+ VPERM2I128 $0x13, Y5, Y9, Y11
+ VPERM2I128 $0x13, Y13, Y1, Y15
+ VPXOR 128(SI), Y3, Y3
+ VPXOR 160(SI), Y7, Y7
+ VPXOR 192(SI), Y11, Y11
+ VPXOR 224(SI), Y15, Y15
+ VMOVDQU Y3, 128(DI)
+ VMOVDQU Y7, 160(DI)
+ VMOVDQU Y11, 192(DI)
+ VMOVDQU Y15, 224(DI)
+ MOVQ $0x00000100, CX
+ LEAQ 256(SI), SI
+ SUBQ $0x00000100, BX
+ VPERM2I128 $0x02, Y6, Y10, Y0
+ VPERM2I128 $0x02, Y8, Y2, Y14
+ VPERM2I128 $0x13, Y6, Y10, Y12
+ VPERM2I128 $0x13, Y8, Y2, Y4
+ JMP sealAVX2SealHash
+
sealAVX2Tail512:
- // Need to decrypt up to 512 bytes - prepare two blocks
- // If we got here after the main loop - there are 512 encrypted bytes waiting to be hashed
- // If we got here before the main loop - there are 448 encrpyred bytes waiting to be hashed
- VMOVDQA ·chacha20Constants<>(SB), AA0; VMOVDQA AA0, AA1; VMOVDQA AA0, AA2; VMOVDQA AA0, AA3
- VMOVDQA state1StoreAVX2, BB0; VMOVDQA BB0, BB1; VMOVDQA BB0, BB2; VMOVDQA BB0, BB3
- VMOVDQA state2StoreAVX2, CC0; VMOVDQA CC0, CC1; VMOVDQA CC0, CC2; VMOVDQA CC0, CC3
- VMOVDQA ctr3StoreAVX2, DD0
- VPADDD ·avx2IncMask<>(SB), DD0, DD0; VPADDD ·avx2IncMask<>(SB), DD0, DD1; VPADDD ·avx2IncMask<>(SB), DD1, DD2; VPADDD ·avx2IncMask<>(SB), DD2, DD3
- VMOVDQA DD0, ctr0StoreAVX2; VMOVDQA DD1, ctr1StoreAVX2; VMOVDQA DD2, ctr2StoreAVX2; VMOVDQA DD3, ctr3StoreAVX2
+ VMOVDQA ·chacha20Constants<>+0(SB), Y0
+ VMOVDQA Y0, Y5
+ VMOVDQA Y0, Y6
+ VMOVDQA Y0, Y7
+ VMOVDQA 32(BP), Y14
+ VMOVDQA Y14, Y9
+ VMOVDQA Y14, Y10
+ VMOVDQA Y14, Y11
+ VMOVDQA 64(BP), Y12
+ VMOVDQA Y12, Y13
+ VMOVDQA Y12, Y8
+ VMOVDQA Y12, Y15
+ VMOVDQA 192(BP), Y4
+ VPADDD ·avx2IncMask<>+0(SB), Y4, Y4
+ VPADDD ·avx2IncMask<>+0(SB), Y4, Y1
+ VPADDD ·avx2IncMask<>+0(SB), Y1, Y2
+ VPADDD ·avx2IncMask<>+0(SB), Y2, Y3
+ VMOVDQA Y4, 96(BP)
+ VMOVDQA Y1, 128(BP)
+ VMOVDQA Y2, 160(BP)
+ VMOVDQA Y3, 192(BP)
sealAVX2Tail512LoopA:
- polyAdd(0(oup))
- polyMul
- LEAQ 16(oup), oup
+ ADDQ (DI), R10
+ ADCQ 8(DI), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), AX
+ MOVQ AX, R15
+ MULQ R10
+ MOVQ AX, R13
+ MOVQ DX, R14
+ MOVQ (BP), AX
+ MULQ R11
+ IMULQ R12, R15
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), AX
+ MOVQ AX, R8
+ MULQ R10
+ ADDQ AX, R14
+ ADCQ $0x00, DX
+ MOVQ DX, R10
+ MOVQ 8(BP), AX
+ MULQ R11
+ ADDQ AX, R15
+ ADCQ $0x00, DX
+ IMULQ R12, R8
+ ADDQ R10, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ LEAQ 16(DI), DI
sealAVX2Tail512LoopB:
- VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3
- VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3
- VPSHUFB ·rol16<>(SB), DD0, DD0; VPSHUFB ·rol16<>(SB), DD1, DD1; VPSHUFB ·rol16<>(SB), DD2, DD2; VPSHUFB ·rol16<>(SB), DD3, DD3
- VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3
- VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3
- VMOVDQA CC3, tmpStoreAVX2
- VPSLLD $12, BB0, CC3; VPSRLD $20, BB0, BB0; VPXOR CC3, BB0, BB0
- VPSLLD $12, BB1, CC3; VPSRLD $20, BB1, BB1; VPXOR CC3, BB1, BB1
- VPSLLD $12, BB2, CC3; VPSRLD $20, BB2, BB2; VPXOR CC3, BB2, BB2
- VPSLLD $12, BB3, CC3; VPSRLD $20, BB3, BB3; VPXOR CC3, BB3, BB3
- VMOVDQA tmpStoreAVX2, CC3
- polyAdd(0*8(oup))
- polyMulAVX2
- VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3
- VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3
- VPSHUFB ·rol8<>(SB), DD0, DD0; VPSHUFB ·rol8<>(SB), DD1, DD1; VPSHUFB ·rol8<>(SB), DD2, DD2; VPSHUFB ·rol8<>(SB), DD3, DD3
- VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3
- VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3
- VMOVDQA CC3, tmpStoreAVX2
- VPSLLD $7, BB0, CC3; VPSRLD $25, BB0, BB0; VPXOR CC3, BB0, BB0
- VPSLLD $7, BB1, CC3; VPSRLD $25, BB1, BB1; VPXOR CC3, BB1, BB1
- VPSLLD $7, BB2, CC3; VPSRLD $25, BB2, BB2; VPXOR CC3, BB2, BB2
- VPSLLD $7, BB3, CC3; VPSRLD $25, BB3, BB3; VPXOR CC3, BB3, BB3
- VMOVDQA tmpStoreAVX2, CC3
- VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $4, BB1, BB1, BB1; VPALIGNR $4, BB2, BB2, BB2; VPALIGNR $4, BB3, BB3, BB3
- VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2; VPALIGNR $8, CC3, CC3, CC3
- VPALIGNR $12, DD0, DD0, DD0; VPALIGNR $12, DD1, DD1, DD1; VPALIGNR $12, DD2, DD2, DD2; VPALIGNR $12, DD3, DD3, DD3
- VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3
- VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3
- VPSHUFB ·rol16<>(SB), DD0, DD0; VPSHUFB ·rol16<>(SB), DD1, DD1; VPSHUFB ·rol16<>(SB), DD2, DD2; VPSHUFB ·rol16<>(SB), DD3, DD3
- VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3
- VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3
- polyAdd(2*8(oup))
- polyMulAVX2
- LEAQ (4*8)(oup), oup
- VMOVDQA CC3, tmpStoreAVX2
- VPSLLD $12, BB0, CC3; VPSRLD $20, BB0, BB0; VPXOR CC3, BB0, BB0
- VPSLLD $12, BB1, CC3; VPSRLD $20, BB1, BB1; VPXOR CC3, BB1, BB1
- VPSLLD $12, BB2, CC3; VPSRLD $20, BB2, BB2; VPXOR CC3, BB2, BB2
- VPSLLD $12, BB3, CC3; VPSRLD $20, BB3, BB3; VPXOR CC3, BB3, BB3
- VMOVDQA tmpStoreAVX2, CC3
- VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3
- VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3
- VPSHUFB ·rol8<>(SB), DD0, DD0; VPSHUFB ·rol8<>(SB), DD1, DD1; VPSHUFB ·rol8<>(SB), DD2, DD2; VPSHUFB ·rol8<>(SB), DD3, DD3
- VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3
- VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3
- VMOVDQA CC3, tmpStoreAVX2
- VPSLLD $7, BB0, CC3; VPSRLD $25, BB0, BB0; VPXOR CC3, BB0, BB0
- VPSLLD $7, BB1, CC3; VPSRLD $25, BB1, BB1; VPXOR CC3, BB1, BB1
- VPSLLD $7, BB2, CC3; VPSRLD $25, BB2, BB2; VPXOR CC3, BB2, BB2
- VPSLLD $7, BB3, CC3; VPSRLD $25, BB3, BB3; VPXOR CC3, BB3, BB3
- VMOVDQA tmpStoreAVX2, CC3
- VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $12, BB1, BB1, BB1; VPALIGNR $12, BB2, BB2, BB2; VPALIGNR $12, BB3, BB3, BB3
- VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2; VPALIGNR $8, CC3, CC3, CC3
- VPALIGNR $4, DD0, DD0, DD0; VPALIGNR $4, DD1, DD1, DD1; VPALIGNR $4, DD2, DD2, DD2; VPALIGNR $4, DD3, DD3, DD3
-
- DECQ itr1
- JG sealAVX2Tail512LoopA
- DECQ itr2
- JGE sealAVX2Tail512LoopB
-
- VPADDD ·chacha20Constants<>(SB), AA0, AA0; VPADDD ·chacha20Constants<>(SB), AA1, AA1; VPADDD ·chacha20Constants<>(SB), AA2, AA2; VPADDD ·chacha20Constants<>(SB), AA3, AA3
- VPADDD state1StoreAVX2, BB0, BB0; VPADDD state1StoreAVX2, BB1, BB1; VPADDD state1StoreAVX2, BB2, BB2; VPADDD state1StoreAVX2, BB3, BB3
- VPADDD state2StoreAVX2, CC0, CC0; VPADDD state2StoreAVX2, CC1, CC1; VPADDD state2StoreAVX2, CC2, CC2; VPADDD state2StoreAVX2, CC3, CC3
- VPADDD ctr0StoreAVX2, DD0, DD0; VPADDD ctr1StoreAVX2, DD1, DD1; VPADDD ctr2StoreAVX2, DD2, DD2; VPADDD ctr3StoreAVX2, DD3, DD3
- VMOVDQA CC3, tmpStoreAVX2
- VPERM2I128 $0x02, AA0, BB0, CC3
- VPXOR (0*32)(inp), CC3, CC3
- VMOVDQU CC3, (0*32)(oup)
- VPERM2I128 $0x02, CC0, DD0, CC3
- VPXOR (1*32)(inp), CC3, CC3
- VMOVDQU CC3, (1*32)(oup)
- VPERM2I128 $0x13, AA0, BB0, CC3
- VPXOR (2*32)(inp), CC3, CC3
- VMOVDQU CC3, (2*32)(oup)
- VPERM2I128 $0x13, CC0, DD0, CC3
- VPXOR (3*32)(inp), CC3, CC3
- VMOVDQU CC3, (3*32)(oup)
-
- VPERM2I128 $0x02, AA1, BB1, AA0
- VPERM2I128 $0x02, CC1, DD1, BB0
- VPERM2I128 $0x13, AA1, BB1, CC0
- VPERM2I128 $0x13, CC1, DD1, DD0
- VPXOR (4*32)(inp), AA0, AA0; VPXOR (5*32)(inp), BB0, BB0; VPXOR (6*32)(inp), CC0, CC0; VPXOR (7*32)(inp), DD0, DD0
- VMOVDQU AA0, (4*32)(oup); VMOVDQU BB0, (5*32)(oup); VMOVDQU CC0, (6*32)(oup); VMOVDQU DD0, (7*32)(oup)
-
- VPERM2I128 $0x02, AA2, BB2, AA0
- VPERM2I128 $0x02, CC2, DD2, BB0
- VPERM2I128 $0x13, AA2, BB2, CC0
- VPERM2I128 $0x13, CC2, DD2, DD0
- VPXOR (8*32)(inp), AA0, AA0; VPXOR (9*32)(inp), BB0, BB0; VPXOR (10*32)(inp), CC0, CC0; VPXOR (11*32)(inp), DD0, DD0
- VMOVDQU AA0, (8*32)(oup); VMOVDQU BB0, (9*32)(oup); VMOVDQU CC0, (10*32)(oup); VMOVDQU DD0, (11*32)(oup)
-
- MOVQ $384, itr1
- LEAQ 384(inp), inp
- SUBQ $384, inl
- VPERM2I128 $0x02, AA3, BB3, AA0
- VPERM2I128 $0x02, tmpStoreAVX2, DD3, BB0
- VPERM2I128 $0x13, AA3, BB3, CC0
- VPERM2I128 $0x13, tmpStoreAVX2, DD3, DD0
-
- JMP sealAVX2SealHash
+ VPADDD Y14, Y0, Y0
+ VPADDD Y9, Y5, Y5
+ VPADDD Y10, Y6, Y6
+ VPADDD Y11, Y7, Y7
+ VPXOR Y0, Y4, Y4
+ VPXOR Y5, Y1, Y1
+ VPXOR Y6, Y2, Y2
+ VPXOR Y7, Y3, Y3
+ VPSHUFB ·rol16<>+0(SB), Y4, Y4
+ VPSHUFB ·rol16<>+0(SB), Y1, Y1
+ VPSHUFB ·rol16<>+0(SB), Y2, Y2
+ VPSHUFB ·rol16<>+0(SB), Y3, Y3
+ VPADDD Y4, Y12, Y12
+ VPADDD Y1, Y13, Y13
+ VPADDD Y2, Y8, Y8
+ VPADDD Y3, Y15, Y15
+ VPXOR Y12, Y14, Y14
+ VPXOR Y13, Y9, Y9
+ VPXOR Y8, Y10, Y10
+ VPXOR Y15, Y11, Y11
+ VMOVDQA Y15, 224(BP)
+ VPSLLD $0x0c, Y14, Y15
+ VPSRLD $0x14, Y14, Y14
+ VPXOR Y15, Y14, Y14
+ VPSLLD $0x0c, Y9, Y15
+ VPSRLD $0x14, Y9, Y9
+ VPXOR Y15, Y9, Y9
+ VPSLLD $0x0c, Y10, Y15
+ VPSRLD $0x14, Y10, Y10
+ VPXOR Y15, Y10, Y10
+ VPSLLD $0x0c, Y11, Y15
+ VPSRLD $0x14, Y11, Y11
+ VPXOR Y15, Y11, Y11
+ VMOVDQA 224(BP), Y15
+ ADDQ (DI), R10
+ ADCQ 8(DI), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), DX
+ MOVQ DX, R15
+ MULXQ R10, R13, R14
+ IMULQ R12, R15
+ MULXQ R11, AX, DX
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), DX
+ MULXQ R10, R10, AX
+ ADDQ R10, R14
+ MULXQ R11, R11, R8
+ ADCQ R11, R15
+ ADCQ $0x00, R8
+ IMULQ R12, DX
+ ADDQ AX, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ VPADDD Y14, Y0, Y0
+ VPADDD Y9, Y5, Y5
+ VPADDD Y10, Y6, Y6
+ VPADDD Y11, Y7, Y7
+ VPXOR Y0, Y4, Y4
+ VPXOR Y5, Y1, Y1
+ VPXOR Y6, Y2, Y2
+ VPXOR Y7, Y3, Y3
+ VPSHUFB ·rol8<>+0(SB), Y4, Y4
+ VPSHUFB ·rol8<>+0(SB), Y1, Y1
+ VPSHUFB ·rol8<>+0(SB), Y2, Y2
+ VPSHUFB ·rol8<>+0(SB), Y3, Y3
+ VPADDD Y4, Y12, Y12
+ VPADDD Y1, Y13, Y13
+ VPADDD Y2, Y8, Y8
+ VPADDD Y3, Y15, Y15
+ VPXOR Y12, Y14, Y14
+ VPXOR Y13, Y9, Y9
+ VPXOR Y8, Y10, Y10
+ VPXOR Y15, Y11, Y11
+ VMOVDQA Y15, 224(BP)
+ VPSLLD $0x07, Y14, Y15
+ VPSRLD $0x19, Y14, Y14
+ VPXOR Y15, Y14, Y14
+ VPSLLD $0x07, Y9, Y15
+ VPSRLD $0x19, Y9, Y9
+ VPXOR Y15, Y9, Y9
+ VPSLLD $0x07, Y10, Y15
+ VPSRLD $0x19, Y10, Y10
+ VPXOR Y15, Y10, Y10
+ VPSLLD $0x07, Y11, Y15
+ VPSRLD $0x19, Y11, Y11
+ VPXOR Y15, Y11, Y11
+ VMOVDQA 224(BP), Y15
+ VPALIGNR $0x04, Y14, Y14, Y14
+ VPALIGNR $0x04, Y9, Y9, Y9
+ VPALIGNR $0x04, Y10, Y10, Y10
+ VPALIGNR $0x04, Y11, Y11, Y11
+ VPALIGNR $0x08, Y12, Y12, Y12
+ VPALIGNR $0x08, Y13, Y13, Y13
+ VPALIGNR $0x08, Y8, Y8, Y8
+ VPALIGNR $0x08, Y15, Y15, Y15
+ VPALIGNR $0x0c, Y4, Y4, Y4
+ VPALIGNR $0x0c, Y1, Y1, Y1
+ VPALIGNR $0x0c, Y2, Y2, Y2
+ VPALIGNR $0x0c, Y3, Y3, Y3
+ VPADDD Y14, Y0, Y0
+ VPADDD Y9, Y5, Y5
+ VPADDD Y10, Y6, Y6
+ VPADDD Y11, Y7, Y7
+ VPXOR Y0, Y4, Y4
+ VPXOR Y5, Y1, Y1
+ VPXOR Y6, Y2, Y2
+ VPXOR Y7, Y3, Y3
+ VPSHUFB ·rol16<>+0(SB), Y4, Y4
+ VPSHUFB ·rol16<>+0(SB), Y1, Y1
+ VPSHUFB ·rol16<>+0(SB), Y2, Y2
+ VPSHUFB ·rol16<>+0(SB), Y3, Y3
+ VPADDD Y4, Y12, Y12
+ VPADDD Y1, Y13, Y13
+ VPADDD Y2, Y8, Y8
+ VPADDD Y3, Y15, Y15
+ VPXOR Y12, Y14, Y14
+ VPXOR Y13, Y9, Y9
+ VPXOR Y8, Y10, Y10
+ VPXOR Y15, Y11, Y11
+ ADDQ 16(DI), R10
+ ADCQ 24(DI), R11
+ ADCQ $0x01, R12
+ MOVQ (BP), DX
+ MOVQ DX, R15
+ MULXQ R10, R13, R14
+ IMULQ R12, R15
+ MULXQ R11, AX, DX
+ ADDQ AX, R14
+ ADCQ DX, R15
+ MOVQ 8(BP), DX
+ MULXQ R10, R10, AX
+ ADDQ R10, R14
+ MULXQ R11, R11, R8
+ ADCQ R11, R15
+ ADCQ $0x00, R8
+ IMULQ R12, DX
+ ADDQ AX, R15
+ ADCQ DX, R8
+ MOVQ R13, R10
+ MOVQ R14, R11
+ MOVQ R15, R12
+ ANDQ $0x03, R12
+ MOVQ R15, R13
+ ANDQ $-4, R13
+ MOVQ R8, R14
+ SHRQ $0x02, R8, R15
+ SHRQ $0x02, R8
+ ADDQ R13, R10
+ ADCQ R14, R11
+ ADCQ $0x00, R12
+ ADDQ R15, R10
+ ADCQ R8, R11
+ ADCQ $0x00, R12
+ LEAQ 32(DI), DI
+ VMOVDQA Y15, 224(BP)
+ VPSLLD $0x0c, Y14, Y15
+ VPSRLD $0x14, Y14, Y14
+ VPXOR Y15, Y14, Y14
+ VPSLLD $0x0c, Y9, Y15
+ VPSRLD $0x14, Y9, Y9
+ VPXOR Y15, Y9, Y9
+ VPSLLD $0x0c, Y10, Y15
+ VPSRLD $0x14, Y10, Y10
+ VPXOR Y15, Y10, Y10
+ VPSLLD $0x0c, Y11, Y15
+ VPSRLD $0x14, Y11, Y11
+ VPXOR Y15, Y11, Y11
+ VMOVDQA 224(BP), Y15
+ VPADDD Y14, Y0, Y0
+ VPADDD Y9, Y5, Y5
+ VPADDD Y10, Y6, Y6
+ VPADDD Y11, Y7, Y7
+ VPXOR Y0, Y4, Y4
+ VPXOR Y5, Y1, Y1
+ VPXOR Y6, Y2, Y2
+ VPXOR Y7, Y3, Y3
+ VPSHUFB ·rol8<>+0(SB), Y4, Y4
+ VPSHUFB ·rol8<>+0(SB), Y1, Y1
+ VPSHUFB ·rol8<>+0(SB), Y2, Y2
+ VPSHUFB ·rol8<>+0(SB), Y3, Y3
+ VPADDD Y4, Y12, Y12
+ VPADDD Y1, Y13, Y13
+ VPADDD Y2, Y8, Y8
+ VPADDD Y3, Y15, Y15
+ VPXOR Y12, Y14, Y14
+ VPXOR Y13, Y9, Y9
+ VPXOR Y8, Y10, Y10
+ VPXOR Y15, Y11, Y11
+ VMOVDQA Y15, 224(BP)
+ VPSLLD $0x07, Y14, Y15
+ VPSRLD $0x19, Y14, Y14
+ VPXOR Y15, Y14, Y14
+ VPSLLD $0x07, Y9, Y15
+ VPSRLD $0x19, Y9, Y9
+ VPXOR Y15, Y9, Y9
+ VPSLLD $0x07, Y10, Y15
+ VPSRLD $0x19, Y10, Y10
+ VPXOR Y15, Y10, Y10
+ VPSLLD $0x07, Y11, Y15
+ VPSRLD $0x19, Y11, Y11
+ VPXOR Y15, Y11, Y11
+ VMOVDQA 224(BP), Y15
+ VPALIGNR $0x0c, Y14, Y14, Y14
+ VPALIGNR $0x0c, Y9, Y9, Y9
+ VPALIGNR $0x0c, Y10, Y10, Y10
+ VPALIGNR $0x0c, Y11, Y11, Y11
+ VPALIGNR $0x08, Y12, Y12, Y12
+ VPALIGNR $0x08, Y13, Y13, Y13
+ VPALIGNR $0x08, Y8, Y8, Y8
+ VPALIGNR $0x08, Y15, Y15, Y15
+ VPALIGNR $0x04, Y4, Y4, Y4
+ VPALIGNR $0x04, Y1, Y1, Y1
+ VPALIGNR $0x04, Y2, Y2, Y2
+ VPALIGNR $0x04, Y3, Y3, Y3
+ DECQ CX
+ JG sealAVX2Tail512LoopA
+ DECQ R9
+ JGE sealAVX2Tail512LoopB
+ VPADDD ·chacha20Constants<>+0(SB), Y0, Y0
+ VPADDD ·chacha20Constants<>+0(SB), Y5, Y5
+ VPADDD ·chacha20Constants<>+0(SB), Y6, Y6
+ VPADDD ·chacha20Constants<>+0(SB), Y7, Y7
+ VPADDD 32(BP), Y14, Y14
+ VPADDD 32(BP), Y9, Y9
+ VPADDD 32(BP), Y10, Y10
+ VPADDD 32(BP), Y11, Y11
+ VPADDD 64(BP), Y12, Y12
+ VPADDD 64(BP), Y13, Y13
+ VPADDD 64(BP), Y8, Y8
+ VPADDD 64(BP), Y15, Y15
+ VPADDD 96(BP), Y4, Y4
+ VPADDD 128(BP), Y1, Y1
+ VPADDD 160(BP), Y2, Y2
+ VPADDD 192(BP), Y3, Y3
+ VMOVDQA Y15, 224(BP)
+ VPERM2I128 $0x02, Y0, Y14, Y15
+ VPXOR (SI), Y15, Y15
+ VMOVDQU Y15, (DI)
+ VPERM2I128 $0x02, Y12, Y4, Y15
+ VPXOR 32(SI), Y15, Y15
+ VMOVDQU Y15, 32(DI)
+ VPERM2I128 $0x13, Y0, Y14, Y15
+ VPXOR 64(SI), Y15, Y15
+ VMOVDQU Y15, 64(DI)
+ VPERM2I128 $0x13, Y12, Y4, Y15
+ VPXOR 96(SI), Y15, Y15
+ VMOVDQU Y15, 96(DI)
+ VPERM2I128 $0x02, Y5, Y9, Y0
+ VPERM2I128 $0x02, Y13, Y1, Y14
+ VPERM2I128 $0x13, Y5, Y9, Y12
+ VPERM2I128 $0x13, Y13, Y1, Y4
+ VPXOR 128(SI), Y0, Y0
+ VPXOR 160(SI), Y14, Y14
+ VPXOR 192(SI), Y12, Y12
+ VPXOR 224(SI), Y4, Y4
+ VMOVDQU Y0, 128(DI)
+ VMOVDQU Y14, 160(DI)
+ VMOVDQU Y12, 192(DI)
+ VMOVDQU Y4, 224(DI)
+ VPERM2I128 $0x02, Y6, Y10, Y0
+ VPERM2I128 $0x02, Y8, Y2, Y14
+ VPERM2I128 $0x13, Y6, Y10, Y12
+ VPERM2I128 $0x13, Y8, Y2, Y4
+ VPXOR 256(SI), Y0, Y0
+ VPXOR 288(SI), Y14, Y14
+ VPXOR 320(SI), Y12, Y12
+ VPXOR 352(SI), Y4, Y4
+ VMOVDQU Y0, 256(DI)
+ VMOVDQU Y14, 288(DI)
+ VMOVDQU Y12, 320(DI)
+ VMOVDQU Y4, 352(DI)
+ MOVQ $0x00000180, CX
+ LEAQ 384(SI), SI
+ SUBQ $0x00000180, BX
+ VPERM2I128 $0x02, Y7, Y11, Y0
+ VPERM2I128 $0x02, 224(BP), Y3, Y14
+ VPERM2I128 $0x13, Y7, Y11, Y12
+ VPERM2I128 $0x13, 224(BP), Y3, Y4
+ JMP sealAVX2SealHash
diff --git a/vendor/golang.org/x/crypto/cryptobyte/asn1/asn1.go b/vendor/golang.org/x/crypto/cryptobyte/asn1/asn1.go
index cda8e3ed..90ef6a24 100644
--- a/vendor/golang.org/x/crypto/cryptobyte/asn1/asn1.go
+++ b/vendor/golang.org/x/crypto/cryptobyte/asn1/asn1.go
@@ -4,7 +4,7 @@
// Package asn1 contains supporting types for parsing and building ASN.1
// messages with the cryptobyte package.
-package asn1 // import "golang.org/x/crypto/cryptobyte/asn1"
+package asn1
// Tag represents an ASN.1 identifier octet, consisting of a tag number
// (indicating a type) and class (such as context-specific or constructed).
diff --git a/vendor/golang.org/x/crypto/cryptobyte/string.go b/vendor/golang.org/x/crypto/cryptobyte/string.go
index 10692a8a..4b0f8097 100644
--- a/vendor/golang.org/x/crypto/cryptobyte/string.go
+++ b/vendor/golang.org/x/crypto/cryptobyte/string.go
@@ -15,7 +15,7 @@
//
// See the documentation and examples for the Builder and String types to get
// started.
-package cryptobyte // import "golang.org/x/crypto/cryptobyte"
+package cryptobyte
// String represents a string of bytes. It provides methods for parsing
// fixed-length and length-prefixed values from it.
diff --git a/vendor/golang.org/x/crypto/hkdf/hkdf.go b/vendor/golang.org/x/crypto/hkdf/hkdf.go
index f4ded5fe..3bee6629 100644
--- a/vendor/golang.org/x/crypto/hkdf/hkdf.go
+++ b/vendor/golang.org/x/crypto/hkdf/hkdf.go
@@ -8,7 +8,7 @@
// HKDF is a cryptographic key derivation function (KDF) with the goal of
// expanding limited input keying material into one or more cryptographically
// strong secret keys.
-package hkdf // import "golang.org/x/crypto/hkdf"
+package hkdf
import (
"crypto/hmac"
diff --git a/vendor/golang.org/x/crypto/internal/poly1305/mac_noasm.go b/vendor/golang.org/x/crypto/internal/poly1305/mac_noasm.go
index 333da285..bd896bdc 100644
--- a/vendor/golang.org/x/crypto/internal/poly1305/mac_noasm.go
+++ b/vendor/golang.org/x/crypto/internal/poly1305/mac_noasm.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build (!amd64 && !ppc64le && !s390x) || !gc || purego
+//go:build (!amd64 && !ppc64le && !ppc64 && !s390x) || !gc || purego
package poly1305
diff --git a/vendor/golang.org/x/crypto/internal/poly1305/sum_amd64.s b/vendor/golang.org/x/crypto/internal/poly1305/sum_amd64.s
index e0d3c647..13375738 100644
--- a/vendor/golang.org/x/crypto/internal/poly1305/sum_amd64.s
+++ b/vendor/golang.org/x/crypto/internal/poly1305/sum_amd64.s
@@ -1,108 +1,93 @@
-// Copyright 2012 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
+// Code generated by command: go run sum_amd64_asm.go -out ../sum_amd64.s -pkg poly1305. DO NOT EDIT.
//go:build gc && !purego
-#include "textflag.h"
-
-#define POLY1305_ADD(msg, h0, h1, h2) \
- ADDQ 0(msg), h0; \
- ADCQ 8(msg), h1; \
- ADCQ $1, h2; \
- LEAQ 16(msg), msg
-
-#define POLY1305_MUL(h0, h1, h2, r0, r1, t0, t1, t2, t3) \
- MOVQ r0, AX; \
- MULQ h0; \
- MOVQ AX, t0; \
- MOVQ DX, t1; \
- MOVQ r0, AX; \
- MULQ h1; \
- ADDQ AX, t1; \
- ADCQ $0, DX; \
- MOVQ r0, t2; \
- IMULQ h2, t2; \
- ADDQ DX, t2; \
- \
- MOVQ r1, AX; \
- MULQ h0; \
- ADDQ AX, t1; \
- ADCQ $0, DX; \
- MOVQ DX, h0; \
- MOVQ r1, t3; \
- IMULQ h2, t3; \
- MOVQ r1, AX; \
- MULQ h1; \
- ADDQ AX, t2; \
- ADCQ DX, t3; \
- ADDQ h0, t2; \
- ADCQ $0, t3; \
- \
- MOVQ t0, h0; \
- MOVQ t1, h1; \
- MOVQ t2, h2; \
- ANDQ $3, h2; \
- MOVQ t2, t0; \
- ANDQ $0xFFFFFFFFFFFFFFFC, t0; \
- ADDQ t0, h0; \
- ADCQ t3, h1; \
- ADCQ $0, h2; \
- SHRQ $2, t3, t2; \
- SHRQ $2, t3; \
- ADDQ t2, h0; \
- ADCQ t3, h1; \
- ADCQ $0, h2
-
-// func update(state *[7]uint64, msg []byte)
+// func update(state *macState, msg []byte)
TEXT ·update(SB), $0-32
MOVQ state+0(FP), DI
MOVQ msg_base+8(FP), SI
MOVQ msg_len+16(FP), R15
-
- MOVQ 0(DI), R8 // h0
- MOVQ 8(DI), R9 // h1
- MOVQ 16(DI), R10 // h2
- MOVQ 24(DI), R11 // r0
- MOVQ 32(DI), R12 // r1
-
- CMPQ R15, $16
+ MOVQ (DI), R8
+ MOVQ 8(DI), R9
+ MOVQ 16(DI), R10
+ MOVQ 24(DI), R11
+ MOVQ 32(DI), R12
+ CMPQ R15, $0x10
JB bytes_between_0_and_15
loop:
- POLY1305_ADD(SI, R8, R9, R10)
+ ADDQ (SI), R8
+ ADCQ 8(SI), R9
+ ADCQ $0x01, R10
+ LEAQ 16(SI), SI
multiply:
- POLY1305_MUL(R8, R9, R10, R11, R12, BX, CX, R13, R14)
- SUBQ $16, R15
- CMPQ R15, $16
- JAE loop
+ MOVQ R11, AX
+ MULQ R8
+ MOVQ AX, BX
+ MOVQ DX, CX
+ MOVQ R11, AX
+ MULQ R9
+ ADDQ AX, CX
+ ADCQ $0x00, DX
+ MOVQ R11, R13
+ IMULQ R10, R13
+ ADDQ DX, R13
+ MOVQ R12, AX
+ MULQ R8
+ ADDQ AX, CX
+ ADCQ $0x00, DX
+ MOVQ DX, R8
+ MOVQ R12, R14
+ IMULQ R10, R14
+ MOVQ R12, AX
+ MULQ R9
+ ADDQ AX, R13
+ ADCQ DX, R14
+ ADDQ R8, R13
+ ADCQ $0x00, R14
+ MOVQ BX, R8
+ MOVQ CX, R9
+ MOVQ R13, R10
+ ANDQ $0x03, R10
+ MOVQ R13, BX
+ ANDQ $-4, BX
+ ADDQ BX, R8
+ ADCQ R14, R9
+ ADCQ $0x00, R10
+ SHRQ $0x02, R14, R13
+ SHRQ $0x02, R14
+ ADDQ R13, R8
+ ADCQ R14, R9
+ ADCQ $0x00, R10
+ SUBQ $0x10, R15
+ CMPQ R15, $0x10
+ JAE loop
bytes_between_0_and_15:
TESTQ R15, R15
JZ done
- MOVQ $1, BX
+ MOVQ $0x00000001, BX
XORQ CX, CX
XORQ R13, R13
ADDQ R15, SI
flush_buffer:
- SHLQ $8, BX, CX
- SHLQ $8, BX
+ SHLQ $0x08, BX, CX
+ SHLQ $0x08, BX
MOVB -1(SI), R13
XORQ R13, BX
DECQ SI
DECQ R15
JNZ flush_buffer
-
ADDQ BX, R8
ADCQ CX, R9
- ADCQ $0, R10
- MOVQ $16, R15
+ ADCQ $0x00, R10
+ MOVQ $0x00000010, R15
JMP multiply
done:
- MOVQ R8, 0(DI)
+ MOVQ R8, (DI)
MOVQ R9, 8(DI)
MOVQ R10, 16(DI)
RET
diff --git a/vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64le.go b/vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64x.go
similarity index 95%
rename from vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64le.go
rename to vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64x.go
index 4aec4874..1a1679aa 100644
--- a/vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64le.go
+++ b/vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64x.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build gc && !purego
+//go:build gc && !purego && (ppc64 || ppc64le)
package poly1305
diff --git a/vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64le.s b/vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64x.s
similarity index 89%
rename from vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64le.s
rename to vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64x.s
index b3c1699b..6899a1da 100644
--- a/vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64le.s
+++ b/vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64x.s
@@ -2,15 +2,25 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build gc && !purego
+//go:build gc && !purego && (ppc64 || ppc64le)
#include "textflag.h"
// This was ported from the amd64 implementation.
+#ifdef GOARCH_ppc64le
+#define LE_MOVD MOVD
+#define LE_MOVWZ MOVWZ
+#define LE_MOVHZ MOVHZ
+#else
+#define LE_MOVD MOVDBR
+#define LE_MOVWZ MOVWBR
+#define LE_MOVHZ MOVHBR
+#endif
+
#define POLY1305_ADD(msg, h0, h1, h2, t0, t1, t2) \
- MOVD (msg), t0; \
- MOVD 8(msg), t1; \
+ LE_MOVD (msg)( R0), t0; \
+ LE_MOVD (msg)(R24), t1; \
MOVD $1, t2; \
ADDC t0, h0, h0; \
ADDE t1, h1, h1; \
@@ -50,10 +60,6 @@
ADDE t3, h1, h1; \
ADDZE h2
-DATA ·poly1305Mask<>+0x00(SB)/8, $0x0FFFFFFC0FFFFFFF
-DATA ·poly1305Mask<>+0x08(SB)/8, $0x0FFFFFFC0FFFFFFC
-GLOBL ·poly1305Mask<>(SB), RODATA, $16
-
// func update(state *[7]uint64, msg []byte)
TEXT ·update(SB), $0-32
MOVD state+0(FP), R3
@@ -66,6 +72,8 @@ TEXT ·update(SB), $0-32
MOVD 24(R3), R11 // r0
MOVD 32(R3), R12 // r1
+ MOVD $8, R24
+
CMP R5, $16
BLT bytes_between_0_and_15
@@ -94,7 +102,7 @@ flush_buffer:
// Greater than 8 -- load the rightmost remaining bytes in msg
// and put into R17 (h1)
- MOVD (R4)(R21), R17
+ LE_MOVD (R4)(R21), R17
MOVD $16, R22
// Find the offset to those bytes
@@ -118,7 +126,7 @@ just1:
BLT less8
// Exactly 8
- MOVD (R4), R16
+ LE_MOVD (R4), R16
CMP R17, $0
@@ -133,7 +141,7 @@ less8:
MOVD $0, R22 // shift count
CMP R5, $4
BLT less4
- MOVWZ (R4), R16
+ LE_MOVWZ (R4), R16
ADD $4, R4
ADD $-4, R5
MOVD $32, R22
@@ -141,7 +149,7 @@ less8:
less4:
CMP R5, $2
BLT less2
- MOVHZ (R4), R21
+ LE_MOVHZ (R4), R21
SLD R22, R21, R21
OR R16, R21, R16
ADD $16, R22
diff --git a/vendor/golang.org/x/mod/LICENSE b/vendor/golang.org/x/mod/LICENSE
index 6a66aea5..2a7cf70d 100644
--- a/vendor/golang.org/x/mod/LICENSE
+++ b/vendor/golang.org/x/mod/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2009 The Go Authors. All rights reserved.
+Copyright 2009 The Go Authors.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@@ -10,7 +10,7 @@ notice, this list of conditions and the following disclaimer.
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
- * Neither the name of Google Inc. nor the names of its
+ * Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
diff --git a/vendor/golang.org/x/mod/module/module.go b/vendor/golang.org/x/mod/module/module.go
index cac1a899..2a364b22 100644
--- a/vendor/golang.org/x/mod/module/module.go
+++ b/vendor/golang.org/x/mod/module/module.go
@@ -506,7 +506,6 @@ var badWindowsNames = []string{
"PRN",
"AUX",
"NUL",
- "COM0",
"COM1",
"COM2",
"COM3",
@@ -516,7 +515,6 @@ var badWindowsNames = []string{
"COM7",
"COM8",
"COM9",
- "LPT0",
"LPT1",
"LPT2",
"LPT3",
diff --git a/vendor/golang.org/x/net/LICENSE b/vendor/golang.org/x/net/LICENSE
index 6a66aea5..2a7cf70d 100644
--- a/vendor/golang.org/x/net/LICENSE
+++ b/vendor/golang.org/x/net/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2009 The Go Authors. All rights reserved.
+Copyright 2009 The Go Authors.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@@ -10,7 +10,7 @@ notice, this list of conditions and the following disclaimer.
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
- * Neither the name of Google Inc. nor the names of its
+ * Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
diff --git a/vendor/golang.org/x/net/http2/client_conn_pool.go b/vendor/golang.org/x/net/http2/client_conn_pool.go
index 780968d6..e81b73e6 100644
--- a/vendor/golang.org/x/net/http2/client_conn_pool.go
+++ b/vendor/golang.org/x/net/http2/client_conn_pool.go
@@ -8,8 +8,8 @@ package http2
import (
"context"
- "crypto/tls"
"errors"
+ "net"
"net/http"
"sync"
)
@@ -158,7 +158,7 @@ func (c *dialCall) dial(ctx context.Context, addr string) {
// This code decides which ones live or die.
// The return value used is whether c was used.
// c is never closed.
-func (p *clientConnPool) addConnIfNeeded(key string, t *Transport, c *tls.Conn) (used bool, err error) {
+func (p *clientConnPool) addConnIfNeeded(key string, t *Transport, c net.Conn) (used bool, err error) {
p.mu.Lock()
for _, cc := range p.conns[key] {
if cc.CanTakeNewRequest() {
@@ -194,8 +194,8 @@ type addConnCall struct {
err error
}
-func (c *addConnCall) run(t *Transport, key string, tc *tls.Conn) {
- cc, err := t.NewClientConn(tc)
+func (c *addConnCall) run(t *Transport, key string, nc net.Conn) {
+ cc, err := t.NewClientConn(nc)
p := c.p
p.mu.Lock()
diff --git a/vendor/golang.org/x/net/http2/config.go b/vendor/golang.org/x/net/http2/config.go
new file mode 100644
index 00000000..de58dfb8
--- /dev/null
+++ b/vendor/golang.org/x/net/http2/config.go
@@ -0,0 +1,122 @@
+// Copyright 2024 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package http2
+
+import (
+ "math"
+ "net/http"
+ "time"
+)
+
+// http2Config is a package-internal version of net/http.HTTP2Config.
+//
+// http.HTTP2Config was added in Go 1.24.
+// When running with a version of net/http that includes HTTP2Config,
+// we merge the configuration with the fields in Transport or Server
+// to produce an http2Config.
+//
+// Zero valued fields in http2Config are interpreted as in the
+// net/http.HTTPConfig documentation.
+//
+// Precedence order for reconciling configurations is:
+//
+// - Use the net/http.{Server,Transport}.HTTP2Config value, when non-zero.
+// - Otherwise use the http2.{Server.Transport} value.
+// - If the resulting value is zero or out of range, use a default.
+type http2Config struct {
+ MaxConcurrentStreams uint32
+ MaxDecoderHeaderTableSize uint32
+ MaxEncoderHeaderTableSize uint32
+ MaxReadFrameSize uint32
+ MaxUploadBufferPerConnection int32
+ MaxUploadBufferPerStream int32
+ SendPingTimeout time.Duration
+ PingTimeout time.Duration
+ WriteByteTimeout time.Duration
+ PermitProhibitedCipherSuites bool
+ CountError func(errType string)
+}
+
+// configFromServer merges configuration settings from
+// net/http.Server.HTTP2Config and http2.Server.
+func configFromServer(h1 *http.Server, h2 *Server) http2Config {
+ conf := http2Config{
+ MaxConcurrentStreams: h2.MaxConcurrentStreams,
+ MaxEncoderHeaderTableSize: h2.MaxEncoderHeaderTableSize,
+ MaxDecoderHeaderTableSize: h2.MaxDecoderHeaderTableSize,
+ MaxReadFrameSize: h2.MaxReadFrameSize,
+ MaxUploadBufferPerConnection: h2.MaxUploadBufferPerConnection,
+ MaxUploadBufferPerStream: h2.MaxUploadBufferPerStream,
+ SendPingTimeout: h2.ReadIdleTimeout,
+ PingTimeout: h2.PingTimeout,
+ WriteByteTimeout: h2.WriteByteTimeout,
+ PermitProhibitedCipherSuites: h2.PermitProhibitedCipherSuites,
+ CountError: h2.CountError,
+ }
+ fillNetHTTPServerConfig(&conf, h1)
+ setConfigDefaults(&conf, true)
+ return conf
+}
+
+// configFromServer merges configuration settings from h2 and h2.t1.HTTP2
+// (the net/http Transport).
+func configFromTransport(h2 *Transport) http2Config {
+ conf := http2Config{
+ MaxEncoderHeaderTableSize: h2.MaxEncoderHeaderTableSize,
+ MaxDecoderHeaderTableSize: h2.MaxDecoderHeaderTableSize,
+ MaxReadFrameSize: h2.MaxReadFrameSize,
+ SendPingTimeout: h2.ReadIdleTimeout,
+ PingTimeout: h2.PingTimeout,
+ WriteByteTimeout: h2.WriteByteTimeout,
+ }
+
+ // Unlike most config fields, where out-of-range values revert to the default,
+ // Transport.MaxReadFrameSize clips.
+ if conf.MaxReadFrameSize < minMaxFrameSize {
+ conf.MaxReadFrameSize = minMaxFrameSize
+ } else if conf.MaxReadFrameSize > maxFrameSize {
+ conf.MaxReadFrameSize = maxFrameSize
+ }
+
+ if h2.t1 != nil {
+ fillNetHTTPTransportConfig(&conf, h2.t1)
+ }
+ setConfigDefaults(&conf, false)
+ return conf
+}
+
+func setDefault[T ~int | ~int32 | ~uint32 | ~int64](v *T, minval, maxval, defval T) {
+ if *v < minval || *v > maxval {
+ *v = defval
+ }
+}
+
+func setConfigDefaults(conf *http2Config, server bool) {
+ setDefault(&conf.MaxConcurrentStreams, 1, math.MaxUint32, defaultMaxStreams)
+ setDefault(&conf.MaxEncoderHeaderTableSize, 1, math.MaxUint32, initialHeaderTableSize)
+ setDefault(&conf.MaxDecoderHeaderTableSize, 1, math.MaxUint32, initialHeaderTableSize)
+ if server {
+ setDefault(&conf.MaxUploadBufferPerConnection, initialWindowSize, math.MaxInt32, 1<<20)
+ } else {
+ setDefault(&conf.MaxUploadBufferPerConnection, initialWindowSize, math.MaxInt32, transportDefaultConnFlow)
+ }
+ if server {
+ setDefault(&conf.MaxUploadBufferPerStream, 1, math.MaxInt32, 1<<20)
+ } else {
+ setDefault(&conf.MaxUploadBufferPerStream, 1, math.MaxInt32, transportDefaultStreamFlow)
+ }
+ setDefault(&conf.MaxReadFrameSize, minMaxFrameSize, maxFrameSize, defaultMaxReadFrameSize)
+ setDefault(&conf.PingTimeout, 1, math.MaxInt64, 15*time.Second)
+}
+
+// adjustHTTP1MaxHeaderSize converts a limit in bytes on the size of an HTTP/1 header
+// to an HTTP/2 MAX_HEADER_LIST_SIZE value.
+func adjustHTTP1MaxHeaderSize(n int64) int64 {
+ // http2's count is in a slightly different unit and includes 32 bytes per pair.
+ // So, take the net/http.Server value and pad it up a bit, assuming 10 headers.
+ const perFieldOverhead = 32 // per http2 spec
+ const typicalHeaders = 10 // conservative
+ return n + typicalHeaders*perFieldOverhead
+}
diff --git a/vendor/golang.org/x/net/http2/config_go124.go b/vendor/golang.org/x/net/http2/config_go124.go
new file mode 100644
index 00000000..e3784123
--- /dev/null
+++ b/vendor/golang.org/x/net/http2/config_go124.go
@@ -0,0 +1,61 @@
+// Copyright 2024 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build go1.24
+
+package http2
+
+import "net/http"
+
+// fillNetHTTPServerConfig sets fields in conf from srv.HTTP2.
+func fillNetHTTPServerConfig(conf *http2Config, srv *http.Server) {
+ fillNetHTTPConfig(conf, srv.HTTP2)
+}
+
+// fillNetHTTPServerConfig sets fields in conf from tr.HTTP2.
+func fillNetHTTPTransportConfig(conf *http2Config, tr *http.Transport) {
+ fillNetHTTPConfig(conf, tr.HTTP2)
+}
+
+func fillNetHTTPConfig(conf *http2Config, h2 *http.HTTP2Config) {
+ if h2 == nil {
+ return
+ }
+ if h2.MaxConcurrentStreams != 0 {
+ conf.MaxConcurrentStreams = uint32(h2.MaxConcurrentStreams)
+ }
+ if h2.MaxEncoderHeaderTableSize != 0 {
+ conf.MaxEncoderHeaderTableSize = uint32(h2.MaxEncoderHeaderTableSize)
+ }
+ if h2.MaxDecoderHeaderTableSize != 0 {
+ conf.MaxDecoderHeaderTableSize = uint32(h2.MaxDecoderHeaderTableSize)
+ }
+ if h2.MaxConcurrentStreams != 0 {
+ conf.MaxConcurrentStreams = uint32(h2.MaxConcurrentStreams)
+ }
+ if h2.MaxReadFrameSize != 0 {
+ conf.MaxReadFrameSize = uint32(h2.MaxReadFrameSize)
+ }
+ if h2.MaxReceiveBufferPerConnection != 0 {
+ conf.MaxUploadBufferPerConnection = int32(h2.MaxReceiveBufferPerConnection)
+ }
+ if h2.MaxReceiveBufferPerStream != 0 {
+ conf.MaxUploadBufferPerStream = int32(h2.MaxReceiveBufferPerStream)
+ }
+ if h2.SendPingTimeout != 0 {
+ conf.SendPingTimeout = h2.SendPingTimeout
+ }
+ if h2.PingTimeout != 0 {
+ conf.PingTimeout = h2.PingTimeout
+ }
+ if h2.WriteByteTimeout != 0 {
+ conf.WriteByteTimeout = h2.WriteByteTimeout
+ }
+ if h2.PermitProhibitedCipherSuites {
+ conf.PermitProhibitedCipherSuites = true
+ }
+ if h2.CountError != nil {
+ conf.CountError = h2.CountError
+ }
+}
diff --git a/vendor/golang.org/x/net/http2/config_pre_go124.go b/vendor/golang.org/x/net/http2/config_pre_go124.go
new file mode 100644
index 00000000..060fd6c6
--- /dev/null
+++ b/vendor/golang.org/x/net/http2/config_pre_go124.go
@@ -0,0 +1,16 @@
+// Copyright 2024 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build !go1.24
+
+package http2
+
+import "net/http"
+
+// Pre-Go 1.24 fallback.
+// The Server.HTTP2 and Transport.HTTP2 config fields were added in Go 1.24.
+
+func fillNetHTTPServerConfig(conf *http2Config, srv *http.Server) {}
+
+func fillNetHTTPTransportConfig(conf *http2Config, tr *http.Transport) {}
diff --git a/vendor/golang.org/x/net/http2/http2.go b/vendor/golang.org/x/net/http2/http2.go
index 003e649f..7688c356 100644
--- a/vendor/golang.org/x/net/http2/http2.go
+++ b/vendor/golang.org/x/net/http2/http2.go
@@ -19,8 +19,9 @@ import (
"bufio"
"context"
"crypto/tls"
+ "errors"
"fmt"
- "io"
+ "net"
"net/http"
"os"
"sort"
@@ -237,13 +238,19 @@ func (cw closeWaiter) Wait() {
// Its buffered writer is lazily allocated as needed, to minimize
// idle memory usage with many connections.
type bufferedWriter struct {
- _ incomparable
- w io.Writer // immutable
- bw *bufio.Writer // non-nil when data is buffered
+ _ incomparable
+ group synctestGroupInterface // immutable
+ conn net.Conn // immutable
+ bw *bufio.Writer // non-nil when data is buffered
+ byteTimeout time.Duration // immutable, WriteByteTimeout
}
-func newBufferedWriter(w io.Writer) *bufferedWriter {
- return &bufferedWriter{w: w}
+func newBufferedWriter(group synctestGroupInterface, conn net.Conn, timeout time.Duration) *bufferedWriter {
+ return &bufferedWriter{
+ group: group,
+ conn: conn,
+ byteTimeout: timeout,
+ }
}
// bufWriterPoolBufferSize is the size of bufio.Writer's
@@ -270,7 +277,7 @@ func (w *bufferedWriter) Available() int {
func (w *bufferedWriter) Write(p []byte) (n int, err error) {
if w.bw == nil {
bw := bufWriterPool.Get().(*bufio.Writer)
- bw.Reset(w.w)
+ bw.Reset((*bufferedWriterTimeoutWriter)(w))
w.bw = bw
}
return w.bw.Write(p)
@@ -288,6 +295,38 @@ func (w *bufferedWriter) Flush() error {
return err
}
+type bufferedWriterTimeoutWriter bufferedWriter
+
+func (w *bufferedWriterTimeoutWriter) Write(p []byte) (n int, err error) {
+ return writeWithByteTimeout(w.group, w.conn, w.byteTimeout, p)
+}
+
+// writeWithByteTimeout writes to conn.
+// If more than timeout passes without any bytes being written to the connection,
+// the write fails.
+func writeWithByteTimeout(group synctestGroupInterface, conn net.Conn, timeout time.Duration, p []byte) (n int, err error) {
+ if timeout <= 0 {
+ return conn.Write(p)
+ }
+ for {
+ var now time.Time
+ if group == nil {
+ now = time.Now()
+ } else {
+ now = group.Now()
+ }
+ conn.SetWriteDeadline(now.Add(timeout))
+ nn, err := conn.Write(p[n:])
+ n += nn
+ if n == len(p) || nn == 0 || !errors.Is(err, os.ErrDeadlineExceeded) {
+ // Either we finished the write, made no progress, or hit the deadline.
+ // Whichever it is, we're done now.
+ conn.SetWriteDeadline(time.Time{})
+ return n, err
+ }
+ }
+}
+
func mustUint31(v int32) uint32 {
if v < 0 || v > 2147483647 {
panic("out of range")
diff --git a/vendor/golang.org/x/net/http2/server.go b/vendor/golang.org/x/net/http2/server.go
index 6c349f3e..832414b4 100644
--- a/vendor/golang.org/x/net/http2/server.go
+++ b/vendor/golang.org/x/net/http2/server.go
@@ -29,6 +29,7 @@ import (
"bufio"
"bytes"
"context"
+ "crypto/rand"
"crypto/tls"
"errors"
"fmt"
@@ -52,10 +53,14 @@ import (
)
const (
- prefaceTimeout = 10 * time.Second
- firstSettingsTimeout = 2 * time.Second // should be in-flight with preface anyway
- handlerChunkWriteSize = 4 << 10
- defaultMaxStreams = 250 // TODO: make this 100 as the GFE seems to?
+ prefaceTimeout = 10 * time.Second
+ firstSettingsTimeout = 2 * time.Second // should be in-flight with preface anyway
+ handlerChunkWriteSize = 4 << 10
+ defaultMaxStreams = 250 // TODO: make this 100 as the GFE seems to?
+
+ // maxQueuedControlFrames is the maximum number of control frames like
+ // SETTINGS, PING and RST_STREAM that will be queued for writing before
+ // the connection is closed to prevent memory exhaustion attacks.
maxQueuedControlFrames = 10000
)
@@ -127,6 +132,22 @@ type Server struct {
// If zero or negative, there is no timeout.
IdleTimeout time.Duration
+ // ReadIdleTimeout is the timeout after which a health check using a ping
+ // frame will be carried out if no frame is received on the connection.
+ // If zero, no health check is performed.
+ ReadIdleTimeout time.Duration
+
+ // PingTimeout is the timeout after which the connection will be closed
+ // if a response to a ping is not received.
+ // If zero, a default of 15 seconds is used.
+ PingTimeout time.Duration
+
+ // WriteByteTimeout is the timeout after which a connection will be
+ // closed if no data can be written to it. The timeout begins when data is
+ // available to write, and is extended whenever any bytes are written.
+ // If zero or negative, there is no timeout.
+ WriteByteTimeout time.Duration
+
// MaxUploadBufferPerConnection is the size of the initial flow
// control window for each connections. The HTTP/2 spec does not
// allow this to be smaller than 65535 or larger than 2^32-1.
@@ -189,57 +210,6 @@ func (s *Server) afterFunc(d time.Duration, f func()) timer {
return timeTimer{time.AfterFunc(d, f)}
}
-func (s *Server) initialConnRecvWindowSize() int32 {
- if s.MaxUploadBufferPerConnection >= initialWindowSize {
- return s.MaxUploadBufferPerConnection
- }
- return 1 << 20
-}
-
-func (s *Server) initialStreamRecvWindowSize() int32 {
- if s.MaxUploadBufferPerStream > 0 {
- return s.MaxUploadBufferPerStream
- }
- return 1 << 20
-}
-
-func (s *Server) maxReadFrameSize() uint32 {
- if v := s.MaxReadFrameSize; v >= minMaxFrameSize && v <= maxFrameSize {
- return v
- }
- return defaultMaxReadFrameSize
-}
-
-func (s *Server) maxConcurrentStreams() uint32 {
- if v := s.MaxConcurrentStreams; v > 0 {
- return v
- }
- return defaultMaxStreams
-}
-
-func (s *Server) maxDecoderHeaderTableSize() uint32 {
- if v := s.MaxDecoderHeaderTableSize; v > 0 {
- return v
- }
- return initialHeaderTableSize
-}
-
-func (s *Server) maxEncoderHeaderTableSize() uint32 {
- if v := s.MaxEncoderHeaderTableSize; v > 0 {
- return v
- }
- return initialHeaderTableSize
-}
-
-// maxQueuedControlFrames is the maximum number of control frames like
-// SETTINGS, PING and RST_STREAM that will be queued for writing before
-// the connection is closed to prevent memory exhaustion attacks.
-func (s *Server) maxQueuedControlFrames() int {
- // TODO: if anybody asks, add a Server field, and remember to define the
- // behavior of negative values.
- return maxQueuedControlFrames
-}
-
type serverInternalState struct {
mu sync.Mutex
activeConns map[*serverConn]struct{}
@@ -336,7 +306,7 @@ func ConfigureServer(s *http.Server, conf *Server) error {
if s.TLSNextProto == nil {
s.TLSNextProto = map[string]func(*http.Server, *tls.Conn, http.Handler){}
}
- protoHandler := func(hs *http.Server, c *tls.Conn, h http.Handler) {
+ protoHandler := func(hs *http.Server, c net.Conn, h http.Handler, sawClientPreface bool) {
if testHookOnConn != nil {
testHookOnConn()
}
@@ -353,12 +323,31 @@ func ConfigureServer(s *http.Server, conf *Server) error {
ctx = bc.BaseContext()
}
conf.ServeConn(c, &ServeConnOpts{
- Context: ctx,
- Handler: h,
- BaseConfig: hs,
+ Context: ctx,
+ Handler: h,
+ BaseConfig: hs,
+ SawClientPreface: sawClientPreface,
})
}
- s.TLSNextProto[NextProtoTLS] = protoHandler
+ s.TLSNextProto[NextProtoTLS] = func(hs *http.Server, c *tls.Conn, h http.Handler) {
+ protoHandler(hs, c, h, false)
+ }
+ // The "unencrypted_http2" TLSNextProto key is used to pass off non-TLS HTTP/2 conns.
+ //
+ // A connection passed in this method has already had the HTTP/2 preface read from it.
+ s.TLSNextProto[nextProtoUnencryptedHTTP2] = func(hs *http.Server, c *tls.Conn, h http.Handler) {
+ nc, err := unencryptedNetConnFromTLSConn(c)
+ if err != nil {
+ if lg := hs.ErrorLog; lg != nil {
+ lg.Print(err)
+ } else {
+ log.Print(err)
+ }
+ go c.Close()
+ return
+ }
+ protoHandler(hs, nc, h, true)
+ }
return nil
}
@@ -440,13 +429,15 @@ func (s *Server) serveConn(c net.Conn, opts *ServeConnOpts, newf func(*serverCon
baseCtx, cancel := serverConnBaseContext(c, opts)
defer cancel()
+ http1srv := opts.baseConfig()
+ conf := configFromServer(http1srv, s)
sc := &serverConn{
srv: s,
- hs: opts.baseConfig(),
+ hs: http1srv,
conn: c,
baseCtx: baseCtx,
remoteAddrStr: c.RemoteAddr().String(),
- bw: newBufferedWriter(c),
+ bw: newBufferedWriter(s.group, c, conf.WriteByteTimeout),
handler: opts.handler(),
streams: make(map[uint32]*stream),
readFrameCh: make(chan readFrameResult),
@@ -456,9 +447,12 @@ func (s *Server) serveConn(c net.Conn, opts *ServeConnOpts, newf func(*serverCon
bodyReadCh: make(chan bodyReadMsg), // buffering doesn't matter either way
doneServing: make(chan struct{}),
clientMaxStreams: math.MaxUint32, // Section 6.5.2: "Initially, there is no limit to this value"
- advMaxStreams: s.maxConcurrentStreams(),
+ advMaxStreams: conf.MaxConcurrentStreams,
initialStreamSendWindowSize: initialWindowSize,
+ initialStreamRecvWindowSize: conf.MaxUploadBufferPerStream,
maxFrameSize: initialMaxFrameSize,
+ pingTimeout: conf.PingTimeout,
+ countErrorFunc: conf.CountError,
serveG: newGoroutineLock(),
pushEnabled: true,
sawClientPreface: opts.SawClientPreface,
@@ -491,15 +485,15 @@ func (s *Server) serveConn(c net.Conn, opts *ServeConnOpts, newf func(*serverCon
sc.flow.add(initialWindowSize)
sc.inflow.init(initialWindowSize)
sc.hpackEncoder = hpack.NewEncoder(&sc.headerWriteBuf)
- sc.hpackEncoder.SetMaxDynamicTableSizeLimit(s.maxEncoderHeaderTableSize())
+ sc.hpackEncoder.SetMaxDynamicTableSizeLimit(conf.MaxEncoderHeaderTableSize)
fr := NewFramer(sc.bw, c)
- if s.CountError != nil {
- fr.countError = s.CountError
+ if conf.CountError != nil {
+ fr.countError = conf.CountError
}
- fr.ReadMetaHeaders = hpack.NewDecoder(s.maxDecoderHeaderTableSize(), nil)
+ fr.ReadMetaHeaders = hpack.NewDecoder(conf.MaxDecoderHeaderTableSize, nil)
fr.MaxHeaderListSize = sc.maxHeaderListSize()
- fr.SetMaxReadFrameSize(s.maxReadFrameSize())
+ fr.SetMaxReadFrameSize(conf.MaxReadFrameSize)
sc.framer = fr
if tc, ok := c.(connectionStater); ok {
@@ -532,7 +526,7 @@ func (s *Server) serveConn(c net.Conn, opts *ServeConnOpts, newf func(*serverCon
// So for now, do nothing here again.
}
- if !s.PermitProhibitedCipherSuites && isBadCipher(sc.tlsState.CipherSuite) {
+ if !conf.PermitProhibitedCipherSuites && isBadCipher(sc.tlsState.CipherSuite) {
// "Endpoints MAY choose to generate a connection error
// (Section 5.4.1) of type INADEQUATE_SECURITY if one of
// the prohibited cipher suites are negotiated."
@@ -569,7 +563,7 @@ func (s *Server) serveConn(c net.Conn, opts *ServeConnOpts, newf func(*serverCon
opts.UpgradeRequest = nil
}
- sc.serve()
+ sc.serve(conf)
}
func serverConnBaseContext(c net.Conn, opts *ServeConnOpts) (ctx context.Context, cancel func()) {
@@ -609,6 +603,7 @@ type serverConn struct {
tlsState *tls.ConnectionState // shared by all handlers, like net/http
remoteAddrStr string
writeSched WriteScheduler
+ countErrorFunc func(errType string)
// Everything following is owned by the serve loop; use serveG.check():
serveG goroutineLock // used to verify funcs are on serve()
@@ -628,6 +623,7 @@ type serverConn struct {
streams map[uint32]*stream
unstartedHandlers []unstartedHandler
initialStreamSendWindowSize int32
+ initialStreamRecvWindowSize int32
maxFrameSize int32
peerMaxHeaderListSize uint32 // zero means unknown (default)
canonHeader map[string]string // http2-lower-case -> Go-Canonical-Case
@@ -638,9 +634,14 @@ type serverConn struct {
inGoAway bool // we've started to or sent GOAWAY
inFrameScheduleLoop bool // whether we're in the scheduleFrameWrite loop
needToSendGoAway bool // we need to schedule a GOAWAY frame write
+ pingSent bool
+ sentPingData [8]byte
goAwayCode ErrCode
shutdownTimer timer // nil until used
idleTimer timer // nil if unused
+ readIdleTimeout time.Duration
+ pingTimeout time.Duration
+ readIdleTimer timer // nil if unused
// Owned by the writeFrameAsync goroutine:
headerWriteBuf bytes.Buffer
@@ -655,11 +656,7 @@ func (sc *serverConn) maxHeaderListSize() uint32 {
if n <= 0 {
n = http.DefaultMaxHeaderBytes
}
- // http2's count is in a slightly different unit and includes 32 bytes per pair.
- // So, take the net/http.Server value and pad it up a bit, assuming 10 headers.
- const perFieldOverhead = 32 // per http2 spec
- const typicalHeaders = 10 // conservative
- return uint32(n + typicalHeaders*perFieldOverhead)
+ return uint32(adjustHTTP1MaxHeaderSize(int64(n)))
}
func (sc *serverConn) curOpenStreams() uint32 {
@@ -923,7 +920,7 @@ func (sc *serverConn) notePanic() {
}
}
-func (sc *serverConn) serve() {
+func (sc *serverConn) serve(conf http2Config) {
sc.serveG.check()
defer sc.notePanic()
defer sc.conn.Close()
@@ -937,18 +934,18 @@ func (sc *serverConn) serve() {
sc.writeFrame(FrameWriteRequest{
write: writeSettings{
- {SettingMaxFrameSize, sc.srv.maxReadFrameSize()},
+ {SettingMaxFrameSize, conf.MaxReadFrameSize},
{SettingMaxConcurrentStreams, sc.advMaxStreams},
{SettingMaxHeaderListSize, sc.maxHeaderListSize()},
- {SettingHeaderTableSize, sc.srv.maxDecoderHeaderTableSize()},
- {SettingInitialWindowSize, uint32(sc.srv.initialStreamRecvWindowSize())},
+ {SettingHeaderTableSize, conf.MaxDecoderHeaderTableSize},
+ {SettingInitialWindowSize, uint32(sc.initialStreamRecvWindowSize)},
},
})
sc.unackedSettings++
// Each connection starts with initialWindowSize inflow tokens.
// If a higher value is configured, we add more tokens.
- if diff := sc.srv.initialConnRecvWindowSize() - initialWindowSize; diff > 0 {
+ if diff := conf.MaxUploadBufferPerConnection - initialWindowSize; diff > 0 {
sc.sendWindowUpdate(nil, int(diff))
}
@@ -968,11 +965,18 @@ func (sc *serverConn) serve() {
defer sc.idleTimer.Stop()
}
+ if conf.SendPingTimeout > 0 {
+ sc.readIdleTimeout = conf.SendPingTimeout
+ sc.readIdleTimer = sc.srv.afterFunc(conf.SendPingTimeout, sc.onReadIdleTimer)
+ defer sc.readIdleTimer.Stop()
+ }
+
go sc.readFrames() // closed by defer sc.conn.Close above
settingsTimer := sc.srv.afterFunc(firstSettingsTimeout, sc.onSettingsTimer)
defer settingsTimer.Stop()
+ lastFrameTime := sc.srv.now()
loopNum := 0
for {
loopNum++
@@ -986,6 +990,7 @@ func (sc *serverConn) serve() {
case res := <-sc.wroteFrameCh:
sc.wroteFrame(res)
case res := <-sc.readFrameCh:
+ lastFrameTime = sc.srv.now()
// Process any written frames before reading new frames from the client since a
// written frame could have triggered a new stream to be started.
if sc.writingFrameAsync {
@@ -1017,6 +1022,8 @@ func (sc *serverConn) serve() {
case idleTimerMsg:
sc.vlogf("connection is idle")
sc.goAway(ErrCodeNo)
+ case readIdleTimerMsg:
+ sc.handlePingTimer(lastFrameTime)
case shutdownTimerMsg:
sc.vlogf("GOAWAY close timer fired; closing conn from %v", sc.conn.RemoteAddr())
return
@@ -1039,7 +1046,7 @@ func (sc *serverConn) serve() {
// If the peer is causing us to generate a lot of control frames,
// but not reading them from us, assume they are trying to make us
// run out of memory.
- if sc.queuedControlFrames > sc.srv.maxQueuedControlFrames() {
+ if sc.queuedControlFrames > maxQueuedControlFrames {
sc.vlogf("http2: too many control frames in send queue, closing connection")
return
}
@@ -1055,12 +1062,39 @@ func (sc *serverConn) serve() {
}
}
+func (sc *serverConn) handlePingTimer(lastFrameReadTime time.Time) {
+ if sc.pingSent {
+ sc.vlogf("timeout waiting for PING response")
+ sc.conn.Close()
+ return
+ }
+
+ pingAt := lastFrameReadTime.Add(sc.readIdleTimeout)
+ now := sc.srv.now()
+ if pingAt.After(now) {
+ // We received frames since arming the ping timer.
+ // Reset it for the next possible timeout.
+ sc.readIdleTimer.Reset(pingAt.Sub(now))
+ return
+ }
+
+ sc.pingSent = true
+ // Ignore crypto/rand.Read errors: It generally can't fail, and worse case if it does
+ // is we send a PING frame containing 0s.
+ _, _ = rand.Read(sc.sentPingData[:])
+ sc.writeFrame(FrameWriteRequest{
+ write: &writePing{data: sc.sentPingData},
+ })
+ sc.readIdleTimer.Reset(sc.pingTimeout)
+}
+
type serverMessage int
// Message values sent to serveMsgCh.
var (
settingsTimerMsg = new(serverMessage)
idleTimerMsg = new(serverMessage)
+ readIdleTimerMsg = new(serverMessage)
shutdownTimerMsg = new(serverMessage)
gracefulShutdownMsg = new(serverMessage)
handlerDoneMsg = new(serverMessage)
@@ -1068,6 +1102,7 @@ var (
func (sc *serverConn) onSettingsTimer() { sc.sendServeMsg(settingsTimerMsg) }
func (sc *serverConn) onIdleTimer() { sc.sendServeMsg(idleTimerMsg) }
+func (sc *serverConn) onReadIdleTimer() { sc.sendServeMsg(readIdleTimerMsg) }
func (sc *serverConn) onShutdownTimer() { sc.sendServeMsg(shutdownTimerMsg) }
func (sc *serverConn) sendServeMsg(msg interface{}) {
@@ -1320,6 +1355,10 @@ func (sc *serverConn) wroteFrame(res frameWriteResult) {
sc.writingFrame = false
sc.writingFrameAsync = false
+ if res.err != nil {
+ sc.conn.Close()
+ }
+
wr := res.wr
if writeEndsStream(wr.write) {
@@ -1594,6 +1633,11 @@ func (sc *serverConn) processFrame(f Frame) error {
func (sc *serverConn) processPing(f *PingFrame) error {
sc.serveG.check()
if f.IsAck() {
+ if sc.pingSent && sc.sentPingData == f.Data {
+ // This is a response to a PING we sent.
+ sc.pingSent = false
+ sc.readIdleTimer.Reset(sc.readIdleTimeout)
+ }
// 6.7 PING: " An endpoint MUST NOT respond to PING frames
// containing this flag."
return nil
@@ -2160,7 +2204,7 @@ func (sc *serverConn) newStream(id, pusherID uint32, state streamState) *stream
st.cw.Init()
st.flow.conn = &sc.flow // link to conn-level counter
st.flow.add(sc.initialStreamSendWindowSize)
- st.inflow.init(sc.srv.initialStreamRecvWindowSize())
+ st.inflow.init(sc.initialStreamRecvWindowSize)
if sc.hs.WriteTimeout > 0 {
st.writeDeadline = sc.srv.afterFunc(sc.hs.WriteTimeout, st.onWriteTimeout)
}
@@ -2855,6 +2899,11 @@ func (w *responseWriter) SetWriteDeadline(deadline time.Time) error {
return nil
}
+func (w *responseWriter) EnableFullDuplex() error {
+ // We always support full duplex responses, so this is a no-op.
+ return nil
+}
+
func (w *responseWriter) Flush() {
w.FlushError()
}
@@ -3301,7 +3350,7 @@ func (sc *serverConn) countError(name string, err error) error {
if sc == nil || sc.srv == nil {
return err
}
- f := sc.srv.CountError
+ f := sc.countErrorFunc
if f == nil {
return err
}
diff --git a/vendor/golang.org/x/net/http2/transport.go b/vendor/golang.org/x/net/http2/transport.go
index 98a49c6b..f5968f44 100644
--- a/vendor/golang.org/x/net/http2/transport.go
+++ b/vendor/golang.org/x/net/http2/transport.go
@@ -25,7 +25,6 @@ import (
"net/http"
"net/http/httptrace"
"net/textproto"
- "os"
"sort"
"strconv"
"strings"
@@ -203,6 +202,20 @@ func (t *Transport) markNewGoroutine() {
}
}
+func (t *Transport) now() time.Time {
+ if t != nil && t.transportTestHooks != nil {
+ return t.transportTestHooks.group.Now()
+ }
+ return time.Now()
+}
+
+func (t *Transport) timeSince(when time.Time) time.Duration {
+ if t != nil && t.transportTestHooks != nil {
+ return t.now().Sub(when)
+ }
+ return time.Since(when)
+}
+
// newTimer creates a new time.Timer, or a synthetic timer in tests.
func (t *Transport) newTimer(d time.Duration) timer {
if t.transportTestHooks != nil {
@@ -227,40 +240,26 @@ func (t *Transport) contextWithTimeout(ctx context.Context, d time.Duration) (co
}
func (t *Transport) maxHeaderListSize() uint32 {
- if t.MaxHeaderListSize == 0 {
+ n := int64(t.MaxHeaderListSize)
+ if t.t1 != nil && t.t1.MaxResponseHeaderBytes != 0 {
+ n = t.t1.MaxResponseHeaderBytes
+ if n > 0 {
+ n = adjustHTTP1MaxHeaderSize(n)
+ }
+ }
+ if n <= 0 {
return 10 << 20
}
- if t.MaxHeaderListSize == 0xffffffff {
+ if n >= 0xffffffff {
return 0
}
- return t.MaxHeaderListSize
-}
-
-func (t *Transport) maxFrameReadSize() uint32 {
- if t.MaxReadFrameSize == 0 {
- return 0 // use the default provided by the peer
- }
- if t.MaxReadFrameSize < minMaxFrameSize {
- return minMaxFrameSize
- }
- if t.MaxReadFrameSize > maxFrameSize {
- return maxFrameSize
- }
- return t.MaxReadFrameSize
+ return uint32(n)
}
func (t *Transport) disableCompression() bool {
return t.DisableCompression || (t.t1 != nil && t.t1.DisableCompression)
}
-func (t *Transport) pingTimeout() time.Duration {
- if t.PingTimeout == 0 {
- return 15 * time.Second
- }
- return t.PingTimeout
-
-}
-
// ConfigureTransport configures a net/http HTTP/1 Transport to use HTTP/2.
// It returns an error if t1 has already been HTTP/2-enabled.
//
@@ -296,8 +295,8 @@ func configureTransports(t1 *http.Transport) (*Transport, error) {
if !strSliceContains(t1.TLSClientConfig.NextProtos, "http/1.1") {
t1.TLSClientConfig.NextProtos = append(t1.TLSClientConfig.NextProtos, "http/1.1")
}
- upgradeFn := func(authority string, c *tls.Conn) http.RoundTripper {
- addr := authorityAddr("https", authority)
+ upgradeFn := func(scheme, authority string, c net.Conn) http.RoundTripper {
+ addr := authorityAddr(scheme, authority)
if used, err := connPool.addConnIfNeeded(addr, t2, c); err != nil {
go c.Close()
return erringRoundTripper{err}
@@ -308,18 +307,37 @@ func configureTransports(t1 *http.Transport) (*Transport, error) {
// was unknown)
go c.Close()
}
+ if scheme == "http" {
+ return (*unencryptedTransport)(t2)
+ }
return t2
}
- if m := t1.TLSNextProto; len(m) == 0 {
- t1.TLSNextProto = map[string]func(string, *tls.Conn) http.RoundTripper{
- "h2": upgradeFn,
+ if t1.TLSNextProto == nil {
+ t1.TLSNextProto = make(map[string]func(string, *tls.Conn) http.RoundTripper)
+ }
+ t1.TLSNextProto[NextProtoTLS] = func(authority string, c *tls.Conn) http.RoundTripper {
+ return upgradeFn("https", authority, c)
+ }
+ // The "unencrypted_http2" TLSNextProto key is used to pass off non-TLS HTTP/2 conns.
+ t1.TLSNextProto[nextProtoUnencryptedHTTP2] = func(authority string, c *tls.Conn) http.RoundTripper {
+ nc, err := unencryptedNetConnFromTLSConn(c)
+ if err != nil {
+ go c.Close()
+ return erringRoundTripper{err}
}
- } else {
- m["h2"] = upgradeFn
+ return upgradeFn("http", authority, nc)
}
return t2, nil
}
+// unencryptedTransport is a Transport with a RoundTrip method that
+// always permits http:// URLs.
+type unencryptedTransport Transport
+
+func (t *unencryptedTransport) RoundTrip(req *http.Request) (*http.Response, error) {
+ return (*Transport)(t).RoundTripOpt(req, RoundTripOpt{allowHTTP: true})
+}
+
func (t *Transport) connPool() ClientConnPool {
t.connPoolOnce.Do(t.initConnPool)
return t.connPoolOrDef
@@ -339,7 +357,7 @@ type ClientConn struct {
t *Transport
tconn net.Conn // usually *tls.Conn, except specialized impls
tlsState *tls.ConnectionState // nil only for specialized impls
- reused uint32 // whether conn is being reused; atomic
+ atomicReused uint32 // whether conn is being reused; atomic
singleUse bool // whether being used for a single http.Request
getConnCalled bool // used by clientConnPool
@@ -370,11 +388,22 @@ type ClientConn struct {
lastActive time.Time
lastIdle time.Time // time last idle
// Settings from peer: (also guarded by wmu)
- maxFrameSize uint32
- maxConcurrentStreams uint32
- peerMaxHeaderListSize uint64
- peerMaxHeaderTableSize uint32
- initialWindowSize uint32
+ maxFrameSize uint32
+ maxConcurrentStreams uint32
+ peerMaxHeaderListSize uint64
+ peerMaxHeaderTableSize uint32
+ initialWindowSize uint32
+ initialStreamRecvWindowSize int32
+ readIdleTimeout time.Duration
+ pingTimeout time.Duration
+
+ // pendingResets is the number of RST_STREAM frames we have sent to the peer,
+ // without confirming that the peer has received them. When we send a RST_STREAM,
+ // we bundle it with a PING frame, unless a PING is already in flight. We count
+ // the reset stream against the connection's concurrency limit until we get
+ // a PING response. This limits the number of requests we'll try to send to a
+ // completely unresponsive connection.
+ pendingResets int
// reqHeaderMu is a 1-element semaphore channel controlling access to sending new requests.
// Write to reqHeaderMu to lock it, read from it to unlock.
@@ -432,12 +461,12 @@ type clientStream struct {
sentHeaders bool
// owned by clientConnReadLoop:
- firstByte bool // got the first response byte
- pastHeaders bool // got first MetaHeadersFrame (actual headers)
- pastTrailers bool // got optional second MetaHeadersFrame (trailers)
- num1xx uint8 // number of 1xx responses seen
- readClosed bool // peer sent an END_STREAM flag
- readAborted bool // read loop reset the stream
+ firstByte bool // got the first response byte
+ pastHeaders bool // got first MetaHeadersFrame (actual headers)
+ pastTrailers bool // got optional second MetaHeadersFrame (trailers)
+ readClosed bool // peer sent an END_STREAM flag
+ readAborted bool // read loop reset the stream
+ totalHeaderSize int64 // total size of 1xx headers seen
trailer http.Header // accumulated trailers
resTrailer *http.Header // client's Response.Trailer
@@ -499,6 +528,7 @@ func (cs *clientStream) closeReqBodyLocked() {
}
type stickyErrWriter struct {
+ group synctestGroupInterface
conn net.Conn
timeout time.Duration
err *error
@@ -508,22 +538,9 @@ func (sew stickyErrWriter) Write(p []byte) (n int, err error) {
if *sew.err != nil {
return 0, *sew.err
}
- for {
- if sew.timeout != 0 {
- sew.conn.SetWriteDeadline(time.Now().Add(sew.timeout))
- }
- nn, err := sew.conn.Write(p[n:])
- n += nn
- if n < len(p) && nn > 0 && errors.Is(err, os.ErrDeadlineExceeded) {
- // Keep extending the deadline so long as we're making progress.
- continue
- }
- if sew.timeout != 0 {
- sew.conn.SetWriteDeadline(time.Time{})
- }
- *sew.err = err
- return n, err
- }
+ n, err = writeWithByteTimeout(sew.group, sew.conn, sew.timeout, p)
+ *sew.err = err
+ return n, err
}
// noCachedConnError is the concrete type of ErrNoCachedConn, which
@@ -554,6 +571,8 @@ type RoundTripOpt struct {
// no cached connection is available, RoundTripOpt
// will return ErrNoCachedConn.
OnlyCachedConn bool
+
+ allowHTTP bool // allow http:// URLs
}
func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) {
@@ -586,7 +605,14 @@ func authorityAddr(scheme string, authority string) (addr string) {
// RoundTripOpt is like RoundTrip, but takes options.
func (t *Transport) RoundTripOpt(req *http.Request, opt RoundTripOpt) (*http.Response, error) {
- if !(req.URL.Scheme == "https" || (req.URL.Scheme == "http" && t.AllowHTTP)) {
+ switch req.URL.Scheme {
+ case "https":
+ // Always okay.
+ case "http":
+ if !t.AllowHTTP && !opt.allowHTTP {
+ return nil, errors.New("http2: unencrypted HTTP/2 not enabled")
+ }
+ default:
return nil, errors.New("http2: unsupported scheme")
}
@@ -597,7 +623,7 @@ func (t *Transport) RoundTripOpt(req *http.Request, opt RoundTripOpt) (*http.Res
t.vlogf("http2: Transport failed to get client conn for %s: %v", addr, err)
return nil, err
}
- reused := !atomic.CompareAndSwapUint32(&cc.reused, 0, 1)
+ reused := !atomic.CompareAndSwapUint32(&cc.atomicReused, 0, 1)
traceGotConn(req, cc, reused)
res, err := cc.RoundTrip(req)
if err != nil && retry <= 6 {
@@ -622,6 +648,22 @@ func (t *Transport) RoundTripOpt(req *http.Request, opt RoundTripOpt) (*http.Res
}
}
}
+ if err == errClientConnNotEstablished {
+ // This ClientConn was created recently,
+ // this is the first request to use it,
+ // and the connection is closed and not usable.
+ //
+ // In this state, cc.idleTimer will remove the conn from the pool
+ // when it fires. Stop the timer and remove it here so future requests
+ // won't try to use this connection.
+ //
+ // If the timer has already fired and we're racing it, the redundant
+ // call to MarkDead is harmless.
+ if cc.idleTimer != nil {
+ cc.idleTimer.Stop()
+ }
+ t.connPool().MarkDead(cc)
+ }
if err != nil {
t.vlogf("RoundTrip failure: %v", err)
return nil, err
@@ -640,9 +682,10 @@ func (t *Transport) CloseIdleConnections() {
}
var (
- errClientConnClosed = errors.New("http2: client conn is closed")
- errClientConnUnusable = errors.New("http2: client conn not usable")
- errClientConnGotGoAway = errors.New("http2: Transport received Server's graceful shutdown GOAWAY")
+ errClientConnClosed = errors.New("http2: client conn is closed")
+ errClientConnUnusable = errors.New("http2: client conn not usable")
+ errClientConnNotEstablished = errors.New("http2: client conn could not be established")
+ errClientConnGotGoAway = errors.New("http2: Transport received Server's graceful shutdown GOAWAY")
)
// shouldRetryRequest is called by RoundTrip when a request fails to get
@@ -758,44 +801,37 @@ func (t *Transport) expectContinueTimeout() time.Duration {
return t.t1.ExpectContinueTimeout
}
-func (t *Transport) maxDecoderHeaderTableSize() uint32 {
- if v := t.MaxDecoderHeaderTableSize; v > 0 {
- return v
- }
- return initialHeaderTableSize
-}
-
-func (t *Transport) maxEncoderHeaderTableSize() uint32 {
- if v := t.MaxEncoderHeaderTableSize; v > 0 {
- return v
- }
- return initialHeaderTableSize
-}
-
func (t *Transport) NewClientConn(c net.Conn) (*ClientConn, error) {
return t.newClientConn(c, t.disableKeepAlives())
}
func (t *Transport) newClientConn(c net.Conn, singleUse bool) (*ClientConn, error) {
+ conf := configFromTransport(t)
cc := &ClientConn{
- t: t,
- tconn: c,
- readerDone: make(chan struct{}),
- nextStreamID: 1,
- maxFrameSize: 16 << 10, // spec default
- initialWindowSize: 65535, // spec default
- maxConcurrentStreams: initialMaxConcurrentStreams, // "infinite", per spec. Use a smaller value until we have received server settings.
- peerMaxHeaderListSize: 0xffffffffffffffff, // "infinite", per spec. Use 2^64-1 instead.
- streams: make(map[uint32]*clientStream),
- singleUse: singleUse,
- wantSettingsAck: true,
- pings: make(map[[8]byte]chan struct{}),
- reqHeaderMu: make(chan struct{}, 1),
- }
+ t: t,
+ tconn: c,
+ readerDone: make(chan struct{}),
+ nextStreamID: 1,
+ maxFrameSize: 16 << 10, // spec default
+ initialWindowSize: 65535, // spec default
+ initialStreamRecvWindowSize: conf.MaxUploadBufferPerStream,
+ maxConcurrentStreams: initialMaxConcurrentStreams, // "infinite", per spec. Use a smaller value until we have received server settings.
+ peerMaxHeaderListSize: 0xffffffffffffffff, // "infinite", per spec. Use 2^64-1 instead.
+ streams: make(map[uint32]*clientStream),
+ singleUse: singleUse,
+ wantSettingsAck: true,
+ readIdleTimeout: conf.SendPingTimeout,
+ pingTimeout: conf.PingTimeout,
+ pings: make(map[[8]byte]chan struct{}),
+ reqHeaderMu: make(chan struct{}, 1),
+ lastActive: t.now(),
+ }
+ var group synctestGroupInterface
if t.transportTestHooks != nil {
t.markNewGoroutine()
t.transportTestHooks.newclientconn(cc)
c = cc.tconn
+ group = t.group
}
if VerboseLogs {
t.vlogf("http2: Transport creating client conn %p to %v", cc, c.RemoteAddr())
@@ -807,30 +843,25 @@ func (t *Transport) newClientConn(c net.Conn, singleUse bool) (*ClientConn, erro
// TODO: adjust this writer size to account for frame size +
// MTU + crypto/tls record padding.
cc.bw = bufio.NewWriter(stickyErrWriter{
+ group: group,
conn: c,
- timeout: t.WriteByteTimeout,
+ timeout: conf.WriteByteTimeout,
err: &cc.werr,
})
cc.br = bufio.NewReader(c)
cc.fr = NewFramer(cc.bw, cc.br)
- if t.maxFrameReadSize() != 0 {
- cc.fr.SetMaxReadFrameSize(t.maxFrameReadSize())
- }
+ cc.fr.SetMaxReadFrameSize(conf.MaxReadFrameSize)
if t.CountError != nil {
cc.fr.countError = t.CountError
}
- maxHeaderTableSize := t.maxDecoderHeaderTableSize()
+ maxHeaderTableSize := conf.MaxDecoderHeaderTableSize
cc.fr.ReadMetaHeaders = hpack.NewDecoder(maxHeaderTableSize, nil)
cc.fr.MaxHeaderListSize = t.maxHeaderListSize()
cc.henc = hpack.NewEncoder(&cc.hbuf)
- cc.henc.SetMaxDynamicTableSizeLimit(t.maxEncoderHeaderTableSize())
+ cc.henc.SetMaxDynamicTableSizeLimit(conf.MaxEncoderHeaderTableSize)
cc.peerMaxHeaderTableSize = initialHeaderTableSize
- if t.AllowHTTP {
- cc.nextStreamID = 3
- }
-
if cs, ok := c.(connectionStater); ok {
state := cs.ConnectionState()
cc.tlsState = &state
@@ -838,11 +869,9 @@ func (t *Transport) newClientConn(c net.Conn, singleUse bool) (*ClientConn, erro
initialSettings := []Setting{
{ID: SettingEnablePush, Val: 0},
- {ID: SettingInitialWindowSize, Val: transportDefaultStreamFlow},
- }
- if max := t.maxFrameReadSize(); max != 0 {
- initialSettings = append(initialSettings, Setting{ID: SettingMaxFrameSize, Val: max})
+ {ID: SettingInitialWindowSize, Val: uint32(cc.initialStreamRecvWindowSize)},
}
+ initialSettings = append(initialSettings, Setting{ID: SettingMaxFrameSize, Val: conf.MaxReadFrameSize})
if max := t.maxHeaderListSize(); max != 0 {
initialSettings = append(initialSettings, Setting{ID: SettingMaxHeaderListSize, Val: max})
}
@@ -852,8 +881,8 @@ func (t *Transport) newClientConn(c net.Conn, singleUse bool) (*ClientConn, erro
cc.bw.Write(clientPreface)
cc.fr.WriteSettings(initialSettings...)
- cc.fr.WriteWindowUpdate(0, transportDefaultConnFlow)
- cc.inflow.init(transportDefaultConnFlow + initialWindowSize)
+ cc.fr.WriteWindowUpdate(0, uint32(conf.MaxUploadBufferPerConnection))
+ cc.inflow.init(conf.MaxUploadBufferPerConnection + initialWindowSize)
cc.bw.Flush()
if cc.werr != nil {
cc.Close()
@@ -871,7 +900,7 @@ func (t *Transport) newClientConn(c net.Conn, singleUse bool) (*ClientConn, erro
}
func (cc *ClientConn) healthCheck() {
- pingTimeout := cc.t.pingTimeout()
+ pingTimeout := cc.pingTimeout
// We don't need to periodically ping in the health check, because the readLoop of ClientConn will
// trigger the healthCheck again if there is no frame received.
ctx, cancel := cc.t.contextWithTimeout(context.Background(), pingTimeout)
@@ -999,7 +1028,7 @@ func (cc *ClientConn) State() ClientConnState {
return ClientConnState{
Closed: cc.closed,
Closing: cc.closing || cc.singleUse || cc.doNotReuse || cc.goAway != nil,
- StreamsActive: len(cc.streams),
+ StreamsActive: len(cc.streams) + cc.pendingResets,
StreamsReserved: cc.streamsReserved,
StreamsPending: cc.pendingRequests,
LastIdle: cc.lastIdle,
@@ -1031,16 +1060,38 @@ func (cc *ClientConn) idleStateLocked() (st clientConnIdleState) {
// writing it.
maxConcurrentOkay = true
} else {
- maxConcurrentOkay = int64(len(cc.streams)+cc.streamsReserved+1) <= int64(cc.maxConcurrentStreams)
+ // We can take a new request if the total of
+ // - active streams;
+ // - reservation slots for new streams; and
+ // - streams for which we have sent a RST_STREAM and a PING,
+ // but received no subsequent frame
+ // is less than the concurrency limit.
+ maxConcurrentOkay = cc.currentRequestCountLocked() < int(cc.maxConcurrentStreams)
}
st.canTakeNewRequest = cc.goAway == nil && !cc.closed && !cc.closing && maxConcurrentOkay &&
!cc.doNotReuse &&
int64(cc.nextStreamID)+2*int64(cc.pendingRequests) < math.MaxInt32 &&
!cc.tooIdleLocked()
+
+ // If this connection has never been used for a request and is closed,
+ // then let it take a request (which will fail).
+ //
+ // This avoids a situation where an error early in a connection's lifetime
+ // goes unreported.
+ if cc.nextStreamID == 1 && cc.streamsReserved == 0 && cc.closed {
+ st.canTakeNewRequest = true
+ }
+
return
}
+// currentRequestCountLocked reports the number of concurrency slots currently in use,
+// including active streams, reserved slots, and reset streams waiting for acknowledgement.
+func (cc *ClientConn) currentRequestCountLocked() int {
+ return len(cc.streams) + cc.streamsReserved + cc.pendingResets
+}
+
func (cc *ClientConn) canTakeNewRequestLocked() bool {
st := cc.idleStateLocked()
return st.canTakeNewRequest
@@ -1053,7 +1104,7 @@ func (cc *ClientConn) tooIdleLocked() bool {
// times are compared based on their wall time. We don't want
// to reuse a connection that's been sitting idle during
// VM/laptop suspend if monotonic time was also frozen.
- return cc.idleTimeout != 0 && !cc.lastIdle.IsZero() && time.Since(cc.lastIdle.Round(0)) > cc.idleTimeout
+ return cc.idleTimeout != 0 && !cc.lastIdle.IsZero() && cc.t.timeSince(cc.lastIdle.Round(0)) > cc.idleTimeout
}
// onIdleTimeout is called from a time.AfterFunc goroutine. It will
@@ -1617,6 +1668,7 @@ func (cs *clientStream) cleanupWriteRequest(err error) {
cs.reqBodyClosed = make(chan struct{})
}
bodyClosed := cs.reqBodyClosed
+ closeOnIdle := cc.singleUse || cc.doNotReuse || cc.t.disableKeepAlives() || cc.goAway != nil
cc.mu.Unlock()
if mustCloseBody {
cs.reqBody.Close()
@@ -1641,16 +1693,40 @@ func (cs *clientStream) cleanupWriteRequest(err error) {
if cs.sentHeaders {
if se, ok := err.(StreamError); ok {
if se.Cause != errFromPeer {
- cc.writeStreamReset(cs.ID, se.Code, err)
+ cc.writeStreamReset(cs.ID, se.Code, false, err)
}
} else {
- cc.writeStreamReset(cs.ID, ErrCodeCancel, err)
+ // We're cancelling an in-flight request.
+ //
+ // This could be due to the server becoming unresponsive.
+ // To avoid sending too many requests on a dead connection,
+ // we let the request continue to consume a concurrency slot
+ // until we can confirm the server is still responding.
+ // We do this by sending a PING frame along with the RST_STREAM
+ // (unless a ping is already in flight).
+ //
+ // For simplicity, we don't bother tracking the PING payload:
+ // We reset cc.pendingResets any time we receive a PING ACK.
+ //
+ // We skip this if the conn is going to be closed on idle,
+ // because it's short lived and will probably be closed before
+ // we get the ping response.
+ ping := false
+ if !closeOnIdle {
+ cc.mu.Lock()
+ if cc.pendingResets == 0 {
+ ping = true
+ }
+ cc.pendingResets++
+ cc.mu.Unlock()
+ }
+ cc.writeStreamReset(cs.ID, ErrCodeCancel, ping, err)
}
}
cs.bufPipe.CloseWithError(err) // no-op if already closed
} else {
if cs.sentHeaders && !cs.sentEndStream {
- cc.writeStreamReset(cs.ID, ErrCodeNo, nil)
+ cc.writeStreamReset(cs.ID, ErrCodeNo, false, nil)
}
cs.bufPipe.CloseWithError(errRequestCanceled)
}
@@ -1672,12 +1748,17 @@ func (cs *clientStream) cleanupWriteRequest(err error) {
// Must hold cc.mu.
func (cc *ClientConn) awaitOpenSlotForStreamLocked(cs *clientStream) error {
for {
- cc.lastActive = time.Now()
+ if cc.closed && cc.nextStreamID == 1 && cc.streamsReserved == 0 {
+ // This is the very first request sent to this connection.
+ // Return a fatal error which aborts the retry loop.
+ return errClientConnNotEstablished
+ }
+ cc.lastActive = cc.t.now()
if cc.closed || !cc.canTakeNewRequestLocked() {
return errClientConnUnusable
}
cc.lastIdle = time.Time{}
- if int64(len(cc.streams)) < int64(cc.maxConcurrentStreams) {
+ if cc.currentRequestCountLocked() < int(cc.maxConcurrentStreams) {
return nil
}
cc.pendingRequests++
@@ -2203,7 +2284,7 @@ type resAndError struct {
func (cc *ClientConn) addStreamLocked(cs *clientStream) {
cs.flow.add(int32(cc.initialWindowSize))
cs.flow.setConnFlow(&cc.flow)
- cs.inflow.init(transportDefaultStreamFlow)
+ cs.inflow.init(cc.initialStreamRecvWindowSize)
cs.ID = cc.nextStreamID
cc.nextStreamID += 2
cc.streams[cs.ID] = cs
@@ -2219,10 +2300,10 @@ func (cc *ClientConn) forgetStreamID(id uint32) {
if len(cc.streams) != slen-1 {
panic("forgetting unknown stream id")
}
- cc.lastActive = time.Now()
+ cc.lastActive = cc.t.now()
if len(cc.streams) == 0 && cc.idleTimer != nil {
cc.idleTimer.Reset(cc.idleTimeout)
- cc.lastIdle = time.Now()
+ cc.lastIdle = cc.t.now()
}
// Wake up writeRequestBody via clientStream.awaitFlowControl and
// wake up RoundTrip if there is a pending request.
@@ -2282,7 +2363,6 @@ func isEOFOrNetReadError(err error) bool {
func (rl *clientConnReadLoop) cleanup() {
cc := rl.cc
- cc.t.connPool().MarkDead(cc)
defer cc.closeConn()
defer close(cc.readerDone)
@@ -2306,6 +2386,24 @@ func (rl *clientConnReadLoop) cleanup() {
}
cc.closed = true
+ // If the connection has never been used, and has been open for only a short time,
+ // leave it in the connection pool for a little while.
+ //
+ // This avoids a situation where new connections are constantly created,
+ // added to the pool, fail, and are removed from the pool, without any error
+ // being surfaced to the user.
+ const unusedWaitTime = 5 * time.Second
+ idleTime := cc.t.now().Sub(cc.lastActive)
+ if atomic.LoadUint32(&cc.atomicReused) == 0 && idleTime < unusedWaitTime {
+ cc.idleTimer = cc.t.afterFunc(unusedWaitTime-idleTime, func() {
+ cc.t.connPool().MarkDead(cc)
+ })
+ } else {
+ cc.mu.Unlock() // avoid any deadlocks in MarkDead
+ cc.t.connPool().MarkDead(cc)
+ cc.mu.Lock()
+ }
+
for _, cs := range cc.streams {
select {
case <-cs.peerClosed:
@@ -2349,7 +2447,7 @@ func (cc *ClientConn) countReadFrameError(err error) {
func (rl *clientConnReadLoop) run() error {
cc := rl.cc
gotSettings := false
- readIdleTimeout := cc.t.ReadIdleTimeout
+ readIdleTimeout := cc.readIdleTimeout
var t timer
if readIdleTimeout != 0 {
t = cc.t.afterFunc(readIdleTimeout, cc.healthCheck)
@@ -2533,15 +2631,34 @@ func (rl *clientConnReadLoop) handleResponse(cs *clientStream, f *MetaHeadersFra
if f.StreamEnded() {
return nil, errors.New("1xx informational response with END_STREAM flag")
}
- cs.num1xx++
- const max1xxResponses = 5 // arbitrary bound on number of informational responses, same as net/http
- if cs.num1xx > max1xxResponses {
- return nil, errors.New("http2: too many 1xx informational responses")
- }
if fn := cs.get1xxTraceFunc(); fn != nil {
+ // If the 1xx response is being delivered to the user,
+ // then they're responsible for limiting the number
+ // of responses.
if err := fn(statusCode, textproto.MIMEHeader(header)); err != nil {
return nil, err
}
+ } else {
+ // If the user didn't examine the 1xx response, then we
+ // limit the size of all 1xx headers.
+ //
+ // This differs a bit from the HTTP/1 implementation, which
+ // limits the size of all 1xx headers plus the final response.
+ // Use the larger limit of MaxHeaderListSize and
+ // net/http.Transport.MaxResponseHeaderBytes.
+ limit := int64(cs.cc.t.maxHeaderListSize())
+ if t1 := cs.cc.t.t1; t1 != nil && t1.MaxResponseHeaderBytes > limit {
+ limit = t1.MaxResponseHeaderBytes
+ }
+ for _, h := range f.Fields {
+ cs.totalHeaderSize += int64(h.Size())
+ }
+ if cs.totalHeaderSize > limit {
+ if VerboseLogs {
+ log.Printf("http2: 1xx informational responses too large")
+ }
+ return nil, errors.New("header list too large")
+ }
}
if statusCode == 100 {
traceGot100Continue(cs.trace)
@@ -3085,6 +3202,11 @@ func (rl *clientConnReadLoop) processPing(f *PingFrame) error {
close(c)
delete(cc.pings, f.Data)
}
+ if cc.pendingResets > 0 {
+ // See clientStream.cleanupWriteRequest.
+ cc.pendingResets = 0
+ cc.cond.Broadcast()
+ }
return nil
}
cc := rl.cc
@@ -3107,13 +3229,20 @@ func (rl *clientConnReadLoop) processPushPromise(f *PushPromiseFrame) error {
return ConnectionError(ErrCodeProtocol)
}
-func (cc *ClientConn) writeStreamReset(streamID uint32, code ErrCode, err error) {
+// writeStreamReset sends a RST_STREAM frame.
+// When ping is true, it also sends a PING frame with a random payload.
+func (cc *ClientConn) writeStreamReset(streamID uint32, code ErrCode, ping bool, err error) {
// TODO: map err to more interesting error codes, once the
// HTTP community comes up with some. But currently for
// RST_STREAM there's no equivalent to GOAWAY frame's debug
// data, and the error codes are all pretty vague ("cancel").
cc.wmu.Lock()
cc.fr.WriteRSTStream(streamID, code)
+ if ping {
+ var payload [8]byte
+ rand.Read(payload[:])
+ cc.fr.WritePing(false, payload)
+ }
cc.bw.Flush()
cc.wmu.Unlock()
}
@@ -3267,7 +3396,7 @@ func traceGotConn(req *http.Request, cc *ClientConn, reused bool) {
cc.mu.Lock()
ci.WasIdle = len(cc.streams) == 0 && reused
if ci.WasIdle && !cc.lastActive.IsZero() {
- ci.IdleTime = time.Since(cc.lastActive)
+ ci.IdleTime = cc.t.timeSince(cc.lastActive)
}
cc.mu.Unlock()
diff --git a/vendor/golang.org/x/net/http2/unencrypted.go b/vendor/golang.org/x/net/http2/unencrypted.go
new file mode 100644
index 00000000..b2de2116
--- /dev/null
+++ b/vendor/golang.org/x/net/http2/unencrypted.go
@@ -0,0 +1,32 @@
+// Copyright 2024 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package http2
+
+import (
+ "crypto/tls"
+ "errors"
+ "net"
+)
+
+const nextProtoUnencryptedHTTP2 = "unencrypted_http2"
+
+// unencryptedNetConnFromTLSConn retrieves a net.Conn wrapped in a *tls.Conn.
+//
+// TLSNextProto functions accept a *tls.Conn.
+//
+// When passing an unencrypted HTTP/2 connection to a TLSNextProto function,
+// we pass a *tls.Conn with an underlying net.Conn containing the unencrypted connection.
+// To be extra careful about mistakes (accidentally dropping TLS encryption in a place
+// where we want it), the tls.Conn contains a net.Conn with an UnencryptedNetConn method
+// that returns the actual connection we want to use.
+func unencryptedNetConnFromTLSConn(tc *tls.Conn) (net.Conn, error) {
+ conner, ok := tc.NetConn().(interface {
+ UnencryptedNetConn() net.Conn
+ })
+ if !ok {
+ return nil, errors.New("http2: TLS conn unexpectedly found in unencrypted handoff")
+ }
+ return conner.UnencryptedNetConn(), nil
+}
diff --git a/vendor/golang.org/x/net/http2/write.go b/vendor/golang.org/x/net/http2/write.go
index 33f61398..6ff6bee7 100644
--- a/vendor/golang.org/x/net/http2/write.go
+++ b/vendor/golang.org/x/net/http2/write.go
@@ -131,6 +131,16 @@ func (se StreamError) writeFrame(ctx writeContext) error {
func (se StreamError) staysWithinBuffer(max int) bool { return frameHeaderLen+4 <= max }
+type writePing struct {
+ data [8]byte
+}
+
+func (w writePing) writeFrame(ctx writeContext) error {
+ return ctx.Framer().WritePing(false, w.data)
+}
+
+func (w writePing) staysWithinBuffer(max int) bool { return frameHeaderLen+len(w.data) <= max }
+
type writePingAck struct{ pf *PingFrame }
func (w writePingAck) writeFrame(ctx writeContext) error {
diff --git a/vendor/golang.org/x/oauth2/LICENSE b/vendor/golang.org/x/oauth2/LICENSE
index 6a66aea5..2a7cf70d 100644
--- a/vendor/golang.org/x/oauth2/LICENSE
+++ b/vendor/golang.org/x/oauth2/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2009 The Go Authors. All rights reserved.
+Copyright 2009 The Go Authors.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@@ -10,7 +10,7 @@ notice, this list of conditions and the following disclaimer.
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
- * Neither the name of Google Inc. nor the names of its
+ * Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
diff --git a/vendor/golang.org/x/oauth2/README.md b/vendor/golang.org/x/oauth2/README.md
index 781770c2..48dbb9d8 100644
--- a/vendor/golang.org/x/oauth2/README.md
+++ b/vendor/golang.org/x/oauth2/README.md
@@ -5,15 +5,6 @@
oauth2 package contains a client implementation for OAuth 2.0 spec.
-## Installation
-
-~~~~
-go get golang.org/x/oauth2
-~~~~
-
-Or you can manually git clone the repository to
-`$(go env GOPATH)/src/golang.org/x/oauth2`.
-
See pkg.go.dev for further documentation and examples.
* [pkg.go.dev/golang.org/x/oauth2](https://pkg.go.dev/golang.org/x/oauth2)
@@ -33,7 +24,11 @@ The main issue tracker for the oauth2 repository is located at
https://github.com/golang/oauth2/issues.
This repository uses Gerrit for code changes. To learn how to submit changes to
-this repository, see https://golang.org/doc/contribute.html. In particular:
+this repository, see https://go.dev/doc/contribute.
+
+The git repository is https://go.googlesource.com/oauth2.
+
+Note:
* Excluding trivial changes, all contributions should be connected to an existing issue.
* API changes must go through the [change proposal process](https://go.dev/s/proposal-process) before they can be accepted.
diff --git a/vendor/golang.org/x/oauth2/clientcredentials/clientcredentials.go b/vendor/golang.org/x/oauth2/clientcredentials/clientcredentials.go
new file mode 100644
index 00000000..2459d069
--- /dev/null
+++ b/vendor/golang.org/x/oauth2/clientcredentials/clientcredentials.go
@@ -0,0 +1,124 @@
+// Copyright 2014 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Package clientcredentials implements the OAuth2.0 "client credentials" token flow,
+// also known as the "two-legged OAuth 2.0".
+//
+// This should be used when the client is acting on its own behalf or when the client
+// is the resource owner. It may also be used when requesting access to protected
+// resources based on an authorization previously arranged with the authorization
+// server.
+//
+// See https://tools.ietf.org/html/rfc6749#section-4.4
+package clientcredentials // import "golang.org/x/oauth2/clientcredentials"
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/url"
+ "strings"
+
+ "golang.org/x/oauth2"
+ "golang.org/x/oauth2/internal"
+)
+
+// Config describes a 2-legged OAuth2 flow, with both the
+// client application information and the server's endpoint URLs.
+type Config struct {
+ // ClientID is the application's ID.
+ ClientID string
+
+ // ClientSecret is the application's secret.
+ ClientSecret string
+
+ // TokenURL is the resource server's token endpoint
+ // URL. This is a constant specific to each server.
+ TokenURL string
+
+ // Scope specifies optional requested permissions.
+ Scopes []string
+
+ // EndpointParams specifies additional parameters for requests to the token endpoint.
+ EndpointParams url.Values
+
+ // AuthStyle optionally specifies how the endpoint wants the
+ // client ID & client secret sent. The zero value means to
+ // auto-detect.
+ AuthStyle oauth2.AuthStyle
+
+ // authStyleCache caches which auth style to use when Endpoint.AuthStyle is
+ // the zero value (AuthStyleAutoDetect).
+ authStyleCache internal.LazyAuthStyleCache
+}
+
+// Token uses client credentials to retrieve a token.
+//
+// The provided context optionally controls which HTTP client is used. See the oauth2.HTTPClient variable.
+func (c *Config) Token(ctx context.Context) (*oauth2.Token, error) {
+ return c.TokenSource(ctx).Token()
+}
+
+// Client returns an HTTP client using the provided token.
+// The token will auto-refresh as necessary.
+//
+// The provided context optionally controls which HTTP client
+// is returned. See the oauth2.HTTPClient variable.
+//
+// The returned Client and its Transport should not be modified.
+func (c *Config) Client(ctx context.Context) *http.Client {
+ return oauth2.NewClient(ctx, c.TokenSource(ctx))
+}
+
+// TokenSource returns a TokenSource that returns t until t expires,
+// automatically refreshing it as necessary using the provided context and the
+// client ID and client secret.
+//
+// Most users will use Config.Client instead.
+func (c *Config) TokenSource(ctx context.Context) oauth2.TokenSource {
+ source := &tokenSource{
+ ctx: ctx,
+ conf: c,
+ }
+ return oauth2.ReuseTokenSource(nil, source)
+}
+
+type tokenSource struct {
+ ctx context.Context
+ conf *Config
+}
+
+// Token refreshes the token by using a new client credentials request.
+// tokens received this way do not include a refresh token
+func (c *tokenSource) Token() (*oauth2.Token, error) {
+ v := url.Values{
+ "grant_type": {"client_credentials"},
+ }
+ if len(c.conf.Scopes) > 0 {
+ v.Set("scope", strings.Join(c.conf.Scopes, " "))
+ }
+ for k, p := range c.conf.EndpointParams {
+ // Allow grant_type to be overridden to allow interoperability with
+ // non-compliant implementations.
+ if _, ok := v[k]; ok && k != "grant_type" {
+ return nil, fmt.Errorf("oauth2: cannot overwrite parameter %q", k)
+ }
+ v[k] = p
+ }
+
+ tk, err := internal.RetrieveToken(c.ctx, c.conf.ClientID, c.conf.ClientSecret, c.conf.TokenURL, v, internal.AuthStyle(c.conf.AuthStyle), c.conf.authStyleCache.Get())
+ if err != nil {
+ if rErr, ok := err.(*internal.RetrieveError); ok {
+ return nil, (*oauth2.RetrieveError)(rErr)
+ }
+ return nil, err
+ }
+ t := &oauth2.Token{
+ AccessToken: tk.AccessToken,
+ TokenType: tk.TokenType,
+ RefreshToken: tk.RefreshToken,
+ Expiry: tk.Expiry,
+ }
+ return t.WithExtra(tk.Raw), nil
+}
diff --git a/vendor/golang.org/x/oauth2/token.go b/vendor/golang.org/x/oauth2/token.go
index 5bbb3321..109997d7 100644
--- a/vendor/golang.org/x/oauth2/token.go
+++ b/vendor/golang.org/x/oauth2/token.go
@@ -49,6 +49,13 @@ type Token struct {
// mechanisms for that TokenSource will not be used.
Expiry time.Time `json:"expiry,omitempty"`
+ // ExpiresIn is the OAuth2 wire format "expires_in" field,
+ // which specifies how many seconds later the token expires,
+ // relative to an unknown time base approximately around "now".
+ // It is the application's responsibility to populate
+ // `Expiry` from `ExpiresIn` when required.
+ ExpiresIn int64 `json:"expires_in,omitempty"`
+
// raw optionally contains extra metadata from the server
// when updating a token.
raw interface{}
diff --git a/vendor/golang.org/x/sync/LICENSE b/vendor/golang.org/x/sync/LICENSE
new file mode 100644
index 00000000..2a7cf70d
--- /dev/null
+++ b/vendor/golang.org/x/sync/LICENSE
@@ -0,0 +1,27 @@
+Copyright 2009 The Go Authors.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
+distribution.
+ * Neither the name of Google LLC nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/vendor/golang.org/x/sync/PATENTS b/vendor/golang.org/x/sync/PATENTS
new file mode 100644
index 00000000..73309904
--- /dev/null
+++ b/vendor/golang.org/x/sync/PATENTS
@@ -0,0 +1,22 @@
+Additional IP Rights Grant (Patents)
+
+"This implementation" means the copyrightable works distributed by
+Google as part of the Go project.
+
+Google hereby grants to You a perpetual, worldwide, non-exclusive,
+no-charge, royalty-free, irrevocable (except as stated in this section)
+patent license to make, have made, use, offer to sell, sell, import,
+transfer and otherwise run, modify and propagate the contents of this
+implementation of Go, where such license applies only to those patent
+claims, both currently owned or controlled by Google and acquired in
+the future, licensable by Google that are necessarily infringed by this
+implementation of Go. This grant does not include claims that would be
+infringed only as a consequence of further modification of this
+implementation. If you or your agent or exclusive licensee institute or
+order or agree to the institution of patent litigation against any
+entity (including a cross-claim or counterclaim in a lawsuit) alleging
+that this implementation of Go or any code incorporated within this
+implementation of Go constitutes direct or contributory patent
+infringement, or inducement of patent infringement, then any patent
+rights granted to you under this License for this implementation of Go
+shall terminate as of the date such litigation is filed.
diff --git a/vendor/golang.org/x/sync/errgroup/errgroup.go b/vendor/golang.org/x/sync/errgroup/errgroup.go
new file mode 100644
index 00000000..948a3ee6
--- /dev/null
+++ b/vendor/golang.org/x/sync/errgroup/errgroup.go
@@ -0,0 +1,135 @@
+// Copyright 2016 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Package errgroup provides synchronization, error propagation, and Context
+// cancelation for groups of goroutines working on subtasks of a common task.
+//
+// [errgroup.Group] is related to [sync.WaitGroup] but adds handling of tasks
+// returning errors.
+package errgroup
+
+import (
+ "context"
+ "fmt"
+ "sync"
+)
+
+type token struct{}
+
+// A Group is a collection of goroutines working on subtasks that are part of
+// the same overall task.
+//
+// A zero Group is valid, has no limit on the number of active goroutines,
+// and does not cancel on error.
+type Group struct {
+ cancel func(error)
+
+ wg sync.WaitGroup
+
+ sem chan token
+
+ errOnce sync.Once
+ err error
+}
+
+func (g *Group) done() {
+ if g.sem != nil {
+ <-g.sem
+ }
+ g.wg.Done()
+}
+
+// WithContext returns a new Group and an associated Context derived from ctx.
+//
+// The derived Context is canceled the first time a function passed to Go
+// returns a non-nil error or the first time Wait returns, whichever occurs
+// first.
+func WithContext(ctx context.Context) (*Group, context.Context) {
+ ctx, cancel := withCancelCause(ctx)
+ return &Group{cancel: cancel}, ctx
+}
+
+// Wait blocks until all function calls from the Go method have returned, then
+// returns the first non-nil error (if any) from them.
+func (g *Group) Wait() error {
+ g.wg.Wait()
+ if g.cancel != nil {
+ g.cancel(g.err)
+ }
+ return g.err
+}
+
+// Go calls the given function in a new goroutine.
+// It blocks until the new goroutine can be added without the number of
+// active goroutines in the group exceeding the configured limit.
+//
+// The first call to return a non-nil error cancels the group's context, if the
+// group was created by calling WithContext. The error will be returned by Wait.
+func (g *Group) Go(f func() error) {
+ if g.sem != nil {
+ g.sem <- token{}
+ }
+
+ g.wg.Add(1)
+ go func() {
+ defer g.done()
+
+ if err := f(); err != nil {
+ g.errOnce.Do(func() {
+ g.err = err
+ if g.cancel != nil {
+ g.cancel(g.err)
+ }
+ })
+ }
+ }()
+}
+
+// TryGo calls the given function in a new goroutine only if the number of
+// active goroutines in the group is currently below the configured limit.
+//
+// The return value reports whether the goroutine was started.
+func (g *Group) TryGo(f func() error) bool {
+ if g.sem != nil {
+ select {
+ case g.sem <- token{}:
+ // Note: this allows barging iff channels in general allow barging.
+ default:
+ return false
+ }
+ }
+
+ g.wg.Add(1)
+ go func() {
+ defer g.done()
+
+ if err := f(); err != nil {
+ g.errOnce.Do(func() {
+ g.err = err
+ if g.cancel != nil {
+ g.cancel(g.err)
+ }
+ })
+ }
+ }()
+ return true
+}
+
+// SetLimit limits the number of active goroutines in this group to at most n.
+// A negative value indicates no limit.
+//
+// Any subsequent call to the Go method will block until it can add an active
+// goroutine without exceeding the configured limit.
+//
+// The limit must not be modified while any goroutines in the group are active.
+func (g *Group) SetLimit(n int) {
+ if n < 0 {
+ g.sem = nil
+ return
+ }
+ if len(g.sem) != 0 {
+ panic(fmt.Errorf("errgroup: modify limit while %v goroutines in the group are still active", len(g.sem)))
+ }
+ g.sem = make(chan token, n)
+}
diff --git a/vendor/golang.org/x/sync/errgroup/go120.go b/vendor/golang.org/x/sync/errgroup/go120.go
new file mode 100644
index 00000000..f93c740b
--- /dev/null
+++ b/vendor/golang.org/x/sync/errgroup/go120.go
@@ -0,0 +1,13 @@
+// Copyright 2023 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build go1.20
+
+package errgroup
+
+import "context"
+
+func withCancelCause(parent context.Context) (context.Context, func(error)) {
+ return context.WithCancelCause(parent)
+}
diff --git a/vendor/golang.org/x/sync/errgroup/pre_go120.go b/vendor/golang.org/x/sync/errgroup/pre_go120.go
new file mode 100644
index 00000000..88ce3343
--- /dev/null
+++ b/vendor/golang.org/x/sync/errgroup/pre_go120.go
@@ -0,0 +1,14 @@
+// Copyright 2023 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build !go1.20
+
+package errgroup
+
+import "context"
+
+func withCancelCause(parent context.Context) (context.Context, func(error)) {
+ ctx, cancel := context.WithCancel(parent)
+ return ctx, func(error) { cancel() }
+}
diff --git a/vendor/golang.org/x/sys/LICENSE b/vendor/golang.org/x/sys/LICENSE
index 6a66aea5..2a7cf70d 100644
--- a/vendor/golang.org/x/sys/LICENSE
+++ b/vendor/golang.org/x/sys/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2009 The Go Authors. All rights reserved.
+Copyright 2009 The Go Authors.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@@ -10,7 +10,7 @@ notice, this list of conditions and the following disclaimer.
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
- * Neither the name of Google Inc. nor the names of its
+ * Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
diff --git a/vendor/golang.org/x/sys/cpu/asm_darwin_x86_gc.s b/vendor/golang.org/x/sys/cpu/asm_darwin_x86_gc.s
new file mode 100644
index 00000000..ec2acfe5
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/asm_darwin_x86_gc.s
@@ -0,0 +1,17 @@
+// Copyright 2024 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build darwin && amd64 && gc
+
+#include "textflag.h"
+
+TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0
+ JMP libc_sysctl(SB)
+GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8
+DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB)
+
+TEXT libc_sysctlbyname_trampoline<>(SB),NOSPLIT,$0-0
+ JMP libc_sysctlbyname(SB)
+GLOBL ·libc_sysctlbyname_trampoline_addr(SB), RODATA, $8
+DATA ·libc_sysctlbyname_trampoline_addr(SB)/8, $libc_sysctlbyname_trampoline<>(SB)
diff --git a/vendor/golang.org/x/sys/cpu/cpu.go b/vendor/golang.org/x/sys/cpu/cpu.go
index 8fa707aa..02609d5b 100644
--- a/vendor/golang.org/x/sys/cpu/cpu.go
+++ b/vendor/golang.org/x/sys/cpu/cpu.go
@@ -105,6 +105,8 @@ var ARM64 struct {
HasSVE bool // Scalable Vector Extensions
HasSVE2 bool // Scalable Vector Extensions 2
HasASIMDFHM bool // Advanced SIMD multiplication FP16 to FP32
+ HasDIT bool // Data Independent Timing support
+ HasI8MM bool // Advanced SIMD Int8 matrix multiplication instructions
_ CacheLinePad
}
@@ -199,6 +201,25 @@ var S390X struct {
_ CacheLinePad
}
+// RISCV64 contains the supported CPU features and performance characteristics for riscv64
+// platforms. The booleans in RISCV64, with the exception of HasFastMisaligned, indicate
+// the presence of RISC-V extensions.
+//
+// It is safe to assume that all the RV64G extensions are supported and so they are omitted from
+// this structure. As riscv64 Go programs require at least RV64G, the code that populates
+// this structure cannot run successfully if some of the RV64G extensions are missing.
+// The struct is padded to avoid false sharing.
+var RISCV64 struct {
+ _ CacheLinePad
+ HasFastMisaligned bool // Fast misaligned accesses
+ HasC bool // Compressed instruction-set extension
+ HasV bool // Vector extension compatible with RVV 1.0
+ HasZba bool // Address generation instructions extension
+ HasZbb bool // Basic bit-manipulation extension
+ HasZbs bool // Single-bit instructions extension
+ _ CacheLinePad
+}
+
func init() {
archInit()
initOptions()
diff --git a/vendor/golang.org/x/sys/cpu/cpu_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_arm64.go
index 0e27a21e..af2aa99f 100644
--- a/vendor/golang.org/x/sys/cpu/cpu_arm64.go
+++ b/vendor/golang.org/x/sys/cpu/cpu_arm64.go
@@ -38,6 +38,8 @@ func initOptions() {
{Name: "dcpop", Feature: &ARM64.HasDCPOP},
{Name: "asimddp", Feature: &ARM64.HasASIMDDP},
{Name: "asimdfhm", Feature: &ARM64.HasASIMDFHM},
+ {Name: "dit", Feature: &ARM64.HasDIT},
+ {Name: "i8mm", Feature: &ARM64.HasI8MM},
}
}
@@ -145,6 +147,11 @@ func parseARM64SystemRegisters(isar0, isar1, pfr0 uint64) {
ARM64.HasLRCPC = true
}
+ switch extractBits(isar1, 52, 55) {
+ case 1:
+ ARM64.HasI8MM = true
+ }
+
// ID_AA64PFR0_EL1
switch extractBits(pfr0, 16, 19) {
case 0:
@@ -168,6 +175,11 @@ func parseARM64SystemRegisters(isar0, isar1, pfr0 uint64) {
parseARM64SVERegister(getzfr0())
}
+
+ switch extractBits(pfr0, 48, 51) {
+ case 1:
+ ARM64.HasDIT = true
+ }
}
func parseARM64SVERegister(zfr0 uint64) {
diff --git a/vendor/golang.org/x/sys/cpu/cpu_darwin_x86.go b/vendor/golang.org/x/sys/cpu/cpu_darwin_x86.go
new file mode 100644
index 00000000..b838cb9e
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_darwin_x86.go
@@ -0,0 +1,61 @@
+// Copyright 2024 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build darwin && amd64 && gc
+
+package cpu
+
+// darwinSupportsAVX512 checks Darwin kernel for AVX512 support via sysctl
+// call (see issue 43089). It also restricts AVX512 support for Darwin to
+// kernel version 21.3.0 (MacOS 12.2.0) or later (see issue 49233).
+//
+// Background:
+// Darwin implements a special mechanism to economize on thread state when
+// AVX512 specific registers are not in use. This scheme minimizes state when
+// preempting threads that haven't yet used any AVX512 instructions, but adds
+// special requirements to check for AVX512 hardware support at runtime (e.g.
+// via sysctl call or commpage inspection). See issue 43089 and link below for
+// full background:
+// https://github.com/apple-oss-distributions/xnu/blob/xnu-11215.1.10/osfmk/i386/fpu.c#L214-L240
+//
+// Additionally, all versions of the Darwin kernel from 19.6.0 through 21.2.0
+// (corresponding to MacOS 10.15.6 - 12.1) have a bug that can cause corruption
+// of the AVX512 mask registers (K0-K7) upon signal return. For this reason
+// AVX512 is considered unsafe to use on Darwin for kernel versions prior to
+// 21.3.0, where a fix has been confirmed. See issue 49233 for full background.
+func darwinSupportsAVX512() bool {
+ return darwinSysctlEnabled([]byte("hw.optional.avx512f\x00")) && darwinKernelVersionCheck(21, 3, 0)
+}
+
+// Ensure Darwin kernel version is at least major.minor.patch, avoiding dependencies
+func darwinKernelVersionCheck(major, minor, patch int) bool {
+ var release [256]byte
+ err := darwinOSRelease(&release)
+ if err != nil {
+ return false
+ }
+
+ var mmp [3]int
+ c := 0
+Loop:
+ for _, b := range release[:] {
+ switch {
+ case b >= '0' && b <= '9':
+ mmp[c] = 10*mmp[c] + int(b-'0')
+ case b == '.':
+ c++
+ if c > 2 {
+ return false
+ }
+ case b == 0:
+ break Loop
+ default:
+ return false
+ }
+ }
+ if c != 2 {
+ return false
+ }
+ return mmp[0] > major || mmp[0] == major && (mmp[1] > minor || mmp[1] == minor && mmp[2] >= patch)
+}
diff --git a/vendor/golang.org/x/sys/cpu/cpu_gc_x86.go b/vendor/golang.org/x/sys/cpu/cpu_gc_x86.go
index 910728fb..32a44514 100644
--- a/vendor/golang.org/x/sys/cpu/cpu_gc_x86.go
+++ b/vendor/golang.org/x/sys/cpu/cpu_gc_x86.go
@@ -6,10 +6,10 @@
package cpu
-// cpuid is implemented in cpu_x86.s for gc compiler
+// cpuid is implemented in cpu_gc_x86.s for gc compiler
// and in cpu_gccgo.c for gccgo.
func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32)
-// xgetbv with ecx = 0 is implemented in cpu_x86.s for gc compiler
+// xgetbv with ecx = 0 is implemented in cpu_gc_x86.s for gc compiler
// and in cpu_gccgo.c for gccgo.
func xgetbv() (eax, edx uint32)
diff --git a/vendor/golang.org/x/sys/cpu/cpu_x86.s b/vendor/golang.org/x/sys/cpu/cpu_gc_x86.s
similarity index 94%
rename from vendor/golang.org/x/sys/cpu/cpu_x86.s
rename to vendor/golang.org/x/sys/cpu/cpu_gc_x86.s
index 7d7ba33e..ce208ce6 100644
--- a/vendor/golang.org/x/sys/cpu/cpu_x86.s
+++ b/vendor/golang.org/x/sys/cpu/cpu_gc_x86.s
@@ -18,7 +18,7 @@ TEXT ·cpuid(SB), NOSPLIT, $0-24
RET
// func xgetbv() (eax, edx uint32)
-TEXT ·xgetbv(SB),NOSPLIT,$0-8
+TEXT ·xgetbv(SB), NOSPLIT, $0-8
MOVL $0, CX
XGETBV
MOVL AX, eax+0(FP)
diff --git a/vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go b/vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go
index 99c60fe9..170d21dd 100644
--- a/vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go
+++ b/vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go
@@ -23,9 +23,3 @@ func xgetbv() (eax, edx uint32) {
gccgoXgetbv(&a, &d)
return a, d
}
-
-// gccgo doesn't build on Darwin, per:
-// https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/gcc.rb#L76
-func darwinSupportsAVX512() bool {
- return false
-}
diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go
index 3d386d0f..f1caf0f7 100644
--- a/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go
+++ b/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go
@@ -35,8 +35,10 @@ const (
hwcap_SHA512 = 1 << 21
hwcap_SVE = 1 << 22
hwcap_ASIMDFHM = 1 << 23
+ hwcap_DIT = 1 << 24
hwcap2_SVE2 = 1 << 1
+ hwcap2_I8MM = 1 << 13
)
// linuxKernelCanEmulateCPUID reports whether we're running
@@ -106,9 +108,11 @@ func doinit() {
ARM64.HasSHA512 = isSet(hwCap, hwcap_SHA512)
ARM64.HasSVE = isSet(hwCap, hwcap_SVE)
ARM64.HasASIMDFHM = isSet(hwCap, hwcap_ASIMDFHM)
+ ARM64.HasDIT = isSet(hwCap, hwcap_DIT)
// HWCAP2 feature bits
ARM64.HasSVE2 = isSet(hwCap2, hwcap2_SVE2)
+ ARM64.HasI8MM = isSet(hwCap2, hwcap2_I8MM)
}
func isSet(hwc uint, value uint) bool {
diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go b/vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go
index cd63e733..7d902b68 100644
--- a/vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go
+++ b/vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build linux && !arm && !arm64 && !mips64 && !mips64le && !ppc64 && !ppc64le && !s390x
+//go:build linux && !arm && !arm64 && !mips64 && !mips64le && !ppc64 && !ppc64le && !s390x && !riscv64
package cpu
diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux_riscv64.go b/vendor/golang.org/x/sys/cpu/cpu_linux_riscv64.go
new file mode 100644
index 00000000..cb4a0c57
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_linux_riscv64.go
@@ -0,0 +1,137 @@
+// Copyright 2024 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package cpu
+
+import (
+ "syscall"
+ "unsafe"
+)
+
+// RISC-V extension discovery code for Linux. The approach here is to first try the riscv_hwprobe
+// syscall falling back to HWCAP to check for the C extension if riscv_hwprobe is not available.
+//
+// A note on detection of the Vector extension using HWCAP.
+//
+// Support for the Vector extension version 1.0 was added to the Linux kernel in release 6.5.
+// Support for the riscv_hwprobe syscall was added in 6.4. It follows that if the riscv_hwprobe
+// syscall is not available then neither is the Vector extension (which needs kernel support).
+// The riscv_hwprobe syscall should then be all we need to detect the Vector extension.
+// However, some RISC-V board manufacturers ship boards with an older kernel on top of which
+// they have back-ported various versions of the Vector extension patches but not the riscv_hwprobe
+// patches. These kernels advertise support for the Vector extension using HWCAP. Falling
+// back to HWCAP to detect the Vector extension, if riscv_hwprobe is not available, or simply not
+// bothering with riscv_hwprobe at all and just using HWCAP may then seem like an attractive option.
+//
+// Unfortunately, simply checking the 'V' bit in AT_HWCAP will not work as this bit is used by
+// RISC-V board and cloud instance providers to mean different things. The Lichee Pi 4A board
+// and the Scaleway RV1 cloud instances use the 'V' bit to advertise their support for the unratified
+// 0.7.1 version of the Vector Specification. The Banana Pi BPI-F3 and the CanMV-K230 board use
+// it to advertise support for 1.0 of the Vector extension. Versions 0.7.1 and 1.0 of the Vector
+// extension are binary incompatible. HWCAP can then not be used in isolation to populate the
+// HasV field as this field indicates that the underlying CPU is compatible with RVV 1.0.
+//
+// There is a way at runtime to distinguish between versions 0.7.1 and 1.0 of the Vector
+// specification by issuing a RVV 1.0 vsetvli instruction and checking the vill bit of the vtype
+// register. This check would allow us to safely detect version 1.0 of the Vector extension
+// with HWCAP, if riscv_hwprobe were not available. However, the check cannot
+// be added until the assembler supports the Vector instructions.
+//
+// Note the riscv_hwprobe syscall does not suffer from these ambiguities by design as all of the
+// extensions it advertises support for are explicitly versioned. It's also worth noting that
+// the riscv_hwprobe syscall is the only way to detect multi-letter RISC-V extensions, e.g., Zba.
+// These cannot be detected using HWCAP and so riscv_hwprobe must be used to detect the majority
+// of RISC-V extensions.
+//
+// Please see https://docs.kernel.org/arch/riscv/hwprobe.html for more information.
+
+// golang.org/x/sys/cpu is not allowed to depend on golang.org/x/sys/unix so we must
+// reproduce the constants, types and functions needed to make the riscv_hwprobe syscall
+// here.
+
+const (
+ // Copied from golang.org/x/sys/unix/ztypes_linux_riscv64.go.
+ riscv_HWPROBE_KEY_IMA_EXT_0 = 0x4
+ riscv_HWPROBE_IMA_C = 0x2
+ riscv_HWPROBE_IMA_V = 0x4
+ riscv_HWPROBE_EXT_ZBA = 0x8
+ riscv_HWPROBE_EXT_ZBB = 0x10
+ riscv_HWPROBE_EXT_ZBS = 0x20
+ riscv_HWPROBE_KEY_CPUPERF_0 = 0x5
+ riscv_HWPROBE_MISALIGNED_FAST = 0x3
+ riscv_HWPROBE_MISALIGNED_MASK = 0x7
+)
+
+const (
+ // sys_RISCV_HWPROBE is copied from golang.org/x/sys/unix/zsysnum_linux_riscv64.go.
+ sys_RISCV_HWPROBE = 258
+)
+
+// riscvHWProbePairs is copied from golang.org/x/sys/unix/ztypes_linux_riscv64.go.
+type riscvHWProbePairs struct {
+ key int64
+ value uint64
+}
+
+const (
+ // CPU features
+ hwcap_RISCV_ISA_C = 1 << ('C' - 'A')
+)
+
+func doinit() {
+ // A slice of key/value pair structures is passed to the RISCVHWProbe syscall. The key
+ // field should be initialised with one of the key constants defined above, e.g.,
+ // RISCV_HWPROBE_KEY_IMA_EXT_0. The syscall will set the value field to the appropriate value.
+ // If the kernel does not recognise a key it will set the key field to -1 and the value field to 0.
+
+ pairs := []riscvHWProbePairs{
+ {riscv_HWPROBE_KEY_IMA_EXT_0, 0},
+ {riscv_HWPROBE_KEY_CPUPERF_0, 0},
+ }
+
+ // This call only indicates that extensions are supported if they are implemented on all cores.
+ if riscvHWProbe(pairs, 0) {
+ if pairs[0].key != -1 {
+ v := uint(pairs[0].value)
+ RISCV64.HasC = isSet(v, riscv_HWPROBE_IMA_C)
+ RISCV64.HasV = isSet(v, riscv_HWPROBE_IMA_V)
+ RISCV64.HasZba = isSet(v, riscv_HWPROBE_EXT_ZBA)
+ RISCV64.HasZbb = isSet(v, riscv_HWPROBE_EXT_ZBB)
+ RISCV64.HasZbs = isSet(v, riscv_HWPROBE_EXT_ZBS)
+ }
+ if pairs[1].key != -1 {
+ v := pairs[1].value & riscv_HWPROBE_MISALIGNED_MASK
+ RISCV64.HasFastMisaligned = v == riscv_HWPROBE_MISALIGNED_FAST
+ }
+ }
+
+ // Let's double check with HWCAP if the C extension does not appear to be supported.
+ // This may happen if we're running on a kernel older than 6.4.
+
+ if !RISCV64.HasC {
+ RISCV64.HasC = isSet(hwCap, hwcap_RISCV_ISA_C)
+ }
+}
+
+func isSet(hwc uint, value uint) bool {
+ return hwc&value != 0
+}
+
+// riscvHWProbe is a simplified version of the generated wrapper function found in
+// golang.org/x/sys/unix/zsyscall_linux_riscv64.go. We simplify it by removing the
+// cpuCount and cpus parameters which we do not need. We always want to pass 0 for
+// these parameters here so the kernel only reports the extensions that are present
+// on all cores.
+func riscvHWProbe(pairs []riscvHWProbePairs, flags uint) bool {
+ var _zero uintptr
+ var p0 unsafe.Pointer
+ if len(pairs) > 0 {
+ p0 = unsafe.Pointer(&pairs[0])
+ } else {
+ p0 = unsafe.Pointer(&_zero)
+ }
+
+ _, _, e1 := syscall.Syscall6(sys_RISCV_HWPROBE, uintptr(p0), uintptr(len(pairs)), uintptr(0), uintptr(0), uintptr(flags), 0)
+ return e1 == 0
+}
diff --git a/vendor/golang.org/x/sys/cpu/cpu_other_x86.go b/vendor/golang.org/x/sys/cpu/cpu_other_x86.go
new file mode 100644
index 00000000..a0fd7e2f
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_other_x86.go
@@ -0,0 +1,11 @@
+// Copyright 2024 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build 386 || amd64p32 || (amd64 && (!darwin || !gc))
+
+package cpu
+
+func darwinSupportsAVX512() bool {
+ panic("only implemented for gc && amd64 && darwin")
+}
diff --git a/vendor/golang.org/x/sys/cpu/cpu_riscv64.go b/vendor/golang.org/x/sys/cpu/cpu_riscv64.go
index 7f0c79c0..aca3199c 100644
--- a/vendor/golang.org/x/sys/cpu/cpu_riscv64.go
+++ b/vendor/golang.org/x/sys/cpu/cpu_riscv64.go
@@ -8,4 +8,13 @@ package cpu
const cacheLineSize = 64
-func initOptions() {}
+func initOptions() {
+ options = []option{
+ {Name: "fastmisaligned", Feature: &RISCV64.HasFastMisaligned},
+ {Name: "c", Feature: &RISCV64.HasC},
+ {Name: "v", Feature: &RISCV64.HasV},
+ {Name: "zba", Feature: &RISCV64.HasZba},
+ {Name: "zbb", Feature: &RISCV64.HasZbb},
+ {Name: "zbs", Feature: &RISCV64.HasZbs},
+ }
+}
diff --git a/vendor/golang.org/x/sys/cpu/cpu_x86.go b/vendor/golang.org/x/sys/cpu/cpu_x86.go
index c29f5e4c..600a6807 100644
--- a/vendor/golang.org/x/sys/cpu/cpu_x86.go
+++ b/vendor/golang.org/x/sys/cpu/cpu_x86.go
@@ -92,10 +92,8 @@ func archInit() {
osSupportsAVX = isSet(1, eax) && isSet(2, eax)
if runtime.GOOS == "darwin" {
- // Darwin doesn't save/restore AVX-512 mask registers correctly across signal handlers.
- // Since users can't rely on mask register contents, let's not advertise AVX-512 support.
- // See issue 49233.
- osSupportsAVX512 = false
+ // Darwin requires special AVX512 checks, see cpu_darwin_x86.go
+ osSupportsAVX512 = osSupportsAVX && darwinSupportsAVX512()
} else {
// Check if OPMASK and ZMM registers have OS support.
osSupportsAVX512 = osSupportsAVX && isSet(5, eax) && isSet(6, eax) && isSet(7, eax)
diff --git a/vendor/golang.org/x/sys/cpu/syscall_darwin_x86_gc.go b/vendor/golang.org/x/sys/cpu/syscall_darwin_x86_gc.go
new file mode 100644
index 00000000..4d0888b0
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/syscall_darwin_x86_gc.go
@@ -0,0 +1,98 @@
+// Copyright 2024 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Minimal copy of x/sys/unix so the cpu package can make a
+// system call on Darwin without depending on x/sys/unix.
+
+//go:build darwin && amd64 && gc
+
+package cpu
+
+import (
+ "syscall"
+ "unsafe"
+)
+
+type _C_int int32
+
+// adapted from unix.Uname() at x/sys/unix/syscall_darwin.go L419
+func darwinOSRelease(release *[256]byte) error {
+ // from x/sys/unix/zerrors_openbsd_amd64.go
+ const (
+ CTL_KERN = 0x1
+ KERN_OSRELEASE = 0x2
+ )
+
+ mib := []_C_int{CTL_KERN, KERN_OSRELEASE}
+ n := unsafe.Sizeof(*release)
+
+ return sysctl(mib, &release[0], &n, nil, 0)
+}
+
+type Errno = syscall.Errno
+
+var _zero uintptr // Single-word zero for use when we need a valid pointer to 0 bytes.
+
+// from x/sys/unix/zsyscall_darwin_amd64.go L791-807
+func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) error {
+ var _p0 unsafe.Pointer
+ if len(mib) > 0 {
+ _p0 = unsafe.Pointer(&mib[0])
+ } else {
+ _p0 = unsafe.Pointer(&_zero)
+ }
+ if _, _, err := syscall_syscall6(
+ libc_sysctl_trampoline_addr,
+ uintptr(_p0),
+ uintptr(len(mib)),
+ uintptr(unsafe.Pointer(old)),
+ uintptr(unsafe.Pointer(oldlen)),
+ uintptr(unsafe.Pointer(new)),
+ uintptr(newlen),
+ ); err != 0 {
+ return err
+ }
+
+ return nil
+}
+
+var libc_sysctl_trampoline_addr uintptr
+
+// adapted from internal/cpu/cpu_arm64_darwin.go
+func darwinSysctlEnabled(name []byte) bool {
+ out := int32(0)
+ nout := unsafe.Sizeof(out)
+ if ret := sysctlbyname(&name[0], (*byte)(unsafe.Pointer(&out)), &nout, nil, 0); ret != nil {
+ return false
+ }
+ return out > 0
+}
+
+//go:cgo_import_dynamic libc_sysctl sysctl "/usr/lib/libSystem.B.dylib"
+
+var libc_sysctlbyname_trampoline_addr uintptr
+
+// adapted from runtime/sys_darwin.go in the pattern of sysctl() above, as defined in x/sys/unix
+func sysctlbyname(name *byte, old *byte, oldlen *uintptr, new *byte, newlen uintptr) error {
+ if _, _, err := syscall_syscall6(
+ libc_sysctlbyname_trampoline_addr,
+ uintptr(unsafe.Pointer(name)),
+ uintptr(unsafe.Pointer(old)),
+ uintptr(unsafe.Pointer(oldlen)),
+ uintptr(unsafe.Pointer(new)),
+ uintptr(newlen),
+ 0,
+ ); err != 0 {
+ return err
+ }
+
+ return nil
+}
+
+//go:cgo_import_dynamic libc_sysctlbyname sysctlbyname "/usr/lib/libSystem.B.dylib"
+
+// Implemented in the runtime package (runtime/sys_darwin.go)
+func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)
+
+//go:linkname syscall_syscall6 syscall.syscall6
diff --git a/vendor/golang.org/x/sys/unix/README.md b/vendor/golang.org/x/sys/unix/README.md
index 7d3c060e..6e08a76a 100644
--- a/vendor/golang.org/x/sys/unix/README.md
+++ b/vendor/golang.org/x/sys/unix/README.md
@@ -156,7 +156,7 @@ from the generated architecture-specific files listed below, and merge these
into a common file for each OS.
The merge is performed in the following steps:
-1. Construct the set of common code that is idential in all architecture-specific files.
+1. Construct the set of common code that is identical in all architecture-specific files.
2. Write this common code to the merged file.
3. Remove the common code from all architecture-specific files.
diff --git a/vendor/golang.org/x/sys/unix/ioctl_linux.go b/vendor/golang.org/x/sys/unix/ioctl_linux.go
index dbe680ea..7ca4fa12 100644
--- a/vendor/golang.org/x/sys/unix/ioctl_linux.go
+++ b/vendor/golang.org/x/sys/unix/ioctl_linux.go
@@ -58,6 +58,102 @@ func IoctlGetEthtoolDrvinfo(fd int, ifname string) (*EthtoolDrvinfo, error) {
return &value, err
}
+// IoctlGetEthtoolTsInfo fetches ethtool timestamping and PHC
+// association for the network device specified by ifname.
+func IoctlGetEthtoolTsInfo(fd int, ifname string) (*EthtoolTsInfo, error) {
+ ifr, err := NewIfreq(ifname)
+ if err != nil {
+ return nil, err
+ }
+
+ value := EthtoolTsInfo{Cmd: ETHTOOL_GET_TS_INFO}
+ ifrd := ifr.withData(unsafe.Pointer(&value))
+
+ err = ioctlIfreqData(fd, SIOCETHTOOL, &ifrd)
+ return &value, err
+}
+
+// IoctlGetHwTstamp retrieves the hardware timestamping configuration
+// for the network device specified by ifname.
+func IoctlGetHwTstamp(fd int, ifname string) (*HwTstampConfig, error) {
+ ifr, err := NewIfreq(ifname)
+ if err != nil {
+ return nil, err
+ }
+
+ value := HwTstampConfig{}
+ ifrd := ifr.withData(unsafe.Pointer(&value))
+
+ err = ioctlIfreqData(fd, SIOCGHWTSTAMP, &ifrd)
+ return &value, err
+}
+
+// IoctlSetHwTstamp updates the hardware timestamping configuration for
+// the network device specified by ifname.
+func IoctlSetHwTstamp(fd int, ifname string, cfg *HwTstampConfig) error {
+ ifr, err := NewIfreq(ifname)
+ if err != nil {
+ return err
+ }
+ ifrd := ifr.withData(unsafe.Pointer(cfg))
+ return ioctlIfreqData(fd, SIOCSHWTSTAMP, &ifrd)
+}
+
+// FdToClockID derives the clock ID from the file descriptor number
+// - see clock_gettime(3), FD_TO_CLOCKID macros. The resulting ID is
+// suitable for system calls like ClockGettime.
+func FdToClockID(fd int) int32 { return int32((int(^fd) << 3) | 3) }
+
+// IoctlPtpClockGetcaps returns the description of a given PTP device.
+func IoctlPtpClockGetcaps(fd int) (*PtpClockCaps, error) {
+ var value PtpClockCaps
+ err := ioctlPtr(fd, PTP_CLOCK_GETCAPS2, unsafe.Pointer(&value))
+ return &value, err
+}
+
+// IoctlPtpSysOffsetPrecise returns a description of the clock
+// offset compared to the system clock.
+func IoctlPtpSysOffsetPrecise(fd int) (*PtpSysOffsetPrecise, error) {
+ var value PtpSysOffsetPrecise
+ err := ioctlPtr(fd, PTP_SYS_OFFSET_PRECISE2, unsafe.Pointer(&value))
+ return &value, err
+}
+
+// IoctlPtpSysOffsetExtended returns an extended description of the
+// clock offset compared to the system clock. The samples parameter
+// specifies the desired number of measurements.
+func IoctlPtpSysOffsetExtended(fd int, samples uint) (*PtpSysOffsetExtended, error) {
+ value := PtpSysOffsetExtended{Samples: uint32(samples)}
+ err := ioctlPtr(fd, PTP_SYS_OFFSET_EXTENDED2, unsafe.Pointer(&value))
+ return &value, err
+}
+
+// IoctlPtpPinGetfunc returns the configuration of the specified
+// I/O pin on given PTP device.
+func IoctlPtpPinGetfunc(fd int, index uint) (*PtpPinDesc, error) {
+ value := PtpPinDesc{Index: uint32(index)}
+ err := ioctlPtr(fd, PTP_PIN_GETFUNC2, unsafe.Pointer(&value))
+ return &value, err
+}
+
+// IoctlPtpPinSetfunc updates configuration of the specified PTP
+// I/O pin.
+func IoctlPtpPinSetfunc(fd int, pd *PtpPinDesc) error {
+ return ioctlPtr(fd, PTP_PIN_SETFUNC2, unsafe.Pointer(pd))
+}
+
+// IoctlPtpPeroutRequest configures the periodic output mode of the
+// PTP I/O pins.
+func IoctlPtpPeroutRequest(fd int, r *PtpPeroutRequest) error {
+ return ioctlPtr(fd, PTP_PEROUT_REQUEST2, unsafe.Pointer(r))
+}
+
+// IoctlPtpExttsRequest configures the external timestamping mode
+// of the PTP I/O pins.
+func IoctlPtpExttsRequest(fd int, r *PtpExttsRequest) error {
+ return ioctlPtr(fd, PTP_EXTTS_REQUEST2, unsafe.Pointer(r))
+}
+
// IoctlGetWatchdogInfo fetches information about a watchdog device from the
// Linux watchdog API. For more information, see:
// https://www.kernel.org/doc/html/latest/watchdog/watchdog-api.html.
diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh
index 4ed2e488..6ab02b6c 100644
--- a/vendor/golang.org/x/sys/unix/mkerrors.sh
+++ b/vendor/golang.org/x/sys/unix/mkerrors.sh
@@ -58,6 +58,7 @@ includes_Darwin='
#define _DARWIN_USE_64_BIT_INODE
#define __APPLE_USE_RFC_3542
#include
+#include
#include
#include
#include
@@ -157,6 +158,16 @@ includes_Linux='
#endif
#define _GNU_SOURCE
+// See the description in unix/linux/types.go
+#if defined(__ARM_EABI__) || \
+ (defined(__mips__) && (_MIPS_SIM == _ABIO32)) || \
+ (defined(__powerpc__) && (!defined(__powerpc64__)))
+# ifdef _TIME_BITS
+# undef _TIME_BITS
+# endif
+# define _TIME_BITS 32
+#endif
+
// is broken on powerpc64, as it fails to include definitions of
// these structures. We just include them copied from .
#if defined(__powerpc__)
@@ -255,6 +266,7 @@ struct ltchars {
#include
#include
#include
+#include
#include
#include
#include
@@ -526,6 +538,7 @@ ccflags="$@"
$2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|TCP|MCAST|EVFILT|NOTE|SHUT|PROT|MAP|MREMAP|MFD|T?PACKET|MSG|SCM|MCL|DT|MADV|PR|LOCAL|TCPOPT|UDP)_/ ||
$2 ~ /^NFC_(GENL|PROTO|COMM|RF|SE|DIRECTION|LLCP|SOCKPROTO)_/ ||
$2 ~ /^NFC_.*_(MAX)?SIZE$/ ||
+ $2 ~ /^PTP_/ ||
$2 ~ /^RAW_PAYLOAD_/ ||
$2 ~ /^[US]F_/ ||
$2 ~ /^TP_STATUS_/ ||
@@ -551,6 +564,7 @@ ccflags="$@"
$2 !~ /^RTC_VL_(ACCURACY|BACKUP|DATA)/ &&
$2 ~ /^(NETLINK|NLM|NLMSG|NLA|IFA|IFAN|RT|RTC|RTCF|RTN|RTPROT|RTNH|ARPHRD|ETH_P|NETNSA)_/ ||
$2 ~ /^SOCK_|SK_DIAG_|SKNLGRP_$/ ||
+ $2 ~ /^(CONNECT|SAE)_/ ||
$2 ~ /^FIORDCHK$/ ||
$2 ~ /^SIOC/ ||
$2 ~ /^TIOC/ ||
@@ -654,7 +668,7 @@ errors=$(
signals=$(
echo '#include ' | $CC -x c - -E -dM $ccflags |
awk '$1=="#define" && $2 ~ /^SIG[A-Z0-9]+$/ { print $2 }' |
- grep -v 'SIGSTKSIZE\|SIGSTKSZ\|SIGRT\|SIGMAX64' |
+ grep -E -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT|SIGMAX64)' |
sort
)
@@ -664,7 +678,7 @@ echo '#include ' | $CC -x c - -E -dM $ccflags |
sort >_error.grep
echo '#include ' | $CC -x c - -E -dM $ccflags |
awk '$1=="#define" && $2 ~ /^SIG[A-Z0-9]+$/ { print "^\t" $2 "[ \t]*=" }' |
- grep -v 'SIGSTKSIZE\|SIGSTKSZ\|SIGRT\|SIGMAX64' |
+ grep -E -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT|SIGMAX64)' |
sort >_signal.grep
echo '// mkerrors.sh' "$@"
diff --git a/vendor/golang.org/x/sys/unix/mremap.go b/vendor/golang.org/x/sys/unix/mremap.go
index fd45fe52..3a5e776f 100644
--- a/vendor/golang.org/x/sys/unix/mremap.go
+++ b/vendor/golang.org/x/sys/unix/mremap.go
@@ -50,3 +50,8 @@ func (m *mremapMmapper) Mremap(oldData []byte, newLength int, flags int) (data [
func Mremap(oldData []byte, newLength int, flags int) (data []byte, err error) {
return mapper.Mremap(oldData, newLength, flags)
}
+
+func MremapPtr(oldAddr unsafe.Pointer, oldSize uintptr, newAddr unsafe.Pointer, newSize uintptr, flags int) (ret unsafe.Pointer, err error) {
+ xaddr, err := mapper.mremap(uintptr(oldAddr), oldSize, newSize, flags, uintptr(newAddr))
+ return unsafe.Pointer(xaddr), err
+}
diff --git a/vendor/golang.org/x/sys/unix/syscall_aix.go b/vendor/golang.org/x/sys/unix/syscall_aix.go
index 67ce6cef..6f15ba1e 100644
--- a/vendor/golang.org/x/sys/unix/syscall_aix.go
+++ b/vendor/golang.org/x/sys/unix/syscall_aix.go
@@ -360,7 +360,7 @@ func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int,
var status _C_int
var r Pid_t
err = ERESTART
- // AIX wait4 may return with ERESTART errno, while the processus is still
+ // AIX wait4 may return with ERESTART errno, while the process is still
// active.
for err == ERESTART {
r, err = wait4(Pid_t(pid), &status, options, rusage)
diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin.go b/vendor/golang.org/x/sys/unix/syscall_darwin.go
index 59542a89..099867de 100644
--- a/vendor/golang.org/x/sys/unix/syscall_darwin.go
+++ b/vendor/golang.org/x/sys/unix/syscall_darwin.go
@@ -402,6 +402,18 @@ func IoctlSetIfreqMTU(fd int, ifreq *IfreqMTU) error {
return ioctlPtr(fd, SIOCSIFMTU, unsafe.Pointer(ifreq))
}
+//sys renamexNp(from string, to string, flag uint32) (err error)
+
+func RenamexNp(from string, to string, flag uint32) (err error) {
+ return renamexNp(from, to, flag)
+}
+
+//sys renameatxNp(fromfd int, from string, tofd int, to string, flag uint32) (err error)
+
+func RenameatxNp(fromfd int, from string, tofd int, to string, flag uint32) (err error) {
+ return renameatxNp(fromfd, from, tofd, to, flag)
+}
+
//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS_SYSCTL
func Uname(uname *Utsname) error {
@@ -542,6 +554,55 @@ func SysctlKinfoProcSlice(name string, args ...int) ([]KinfoProc, error) {
}
}
+//sys pthread_chdir_np(path string) (err error)
+
+func PthreadChdir(path string) (err error) {
+ return pthread_chdir_np(path)
+}
+
+//sys pthread_fchdir_np(fd int) (err error)
+
+func PthreadFchdir(fd int) (err error) {
+ return pthread_fchdir_np(fd)
+}
+
+// Connectx calls connectx(2) to initiate a connection on a socket.
+//
+// srcIf, srcAddr, and dstAddr are filled into a [SaEndpoints] struct and passed as the endpoints argument.
+//
+// - srcIf is the optional source interface index. 0 means unspecified.
+// - srcAddr is the optional source address. nil means unspecified.
+// - dstAddr is the destination address.
+//
+// On success, Connectx returns the number of bytes enqueued for transmission.
+func Connectx(fd int, srcIf uint32, srcAddr, dstAddr Sockaddr, associd SaeAssocID, flags uint32, iov []Iovec, connid *SaeConnID) (n uintptr, err error) {
+ endpoints := SaEndpoints{
+ Srcif: srcIf,
+ }
+
+ if srcAddr != nil {
+ addrp, addrlen, err := srcAddr.sockaddr()
+ if err != nil {
+ return 0, err
+ }
+ endpoints.Srcaddr = (*RawSockaddr)(addrp)
+ endpoints.Srcaddrlen = uint32(addrlen)
+ }
+
+ if dstAddr != nil {
+ addrp, addrlen, err := dstAddr.sockaddr()
+ if err != nil {
+ return 0, err
+ }
+ endpoints.Dstaddr = (*RawSockaddr)(addrp)
+ endpoints.Dstaddrlen = uint32(addrlen)
+ }
+
+ err = connectx(fd, &endpoints, associd, flags, iov, &n, connid)
+ return
+}
+
+//sys connectx(fd int, endpoints *SaEndpoints, associd SaeAssocID, flags uint32, iov []Iovec, n *uintptr, connid *SaeConnID) (err error)
//sys sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error)
//sys shmat(id int, addr uintptr, flag int) (ret uintptr, err error)
diff --git a/vendor/golang.org/x/sys/unix/syscall_hurd.go b/vendor/golang.org/x/sys/unix/syscall_hurd.go
index ba46651f..a6a2d2fc 100644
--- a/vendor/golang.org/x/sys/unix/syscall_hurd.go
+++ b/vendor/golang.org/x/sys/unix/syscall_hurd.go
@@ -11,6 +11,7 @@ package unix
int ioctl(int, unsigned long int, uintptr_t);
*/
import "C"
+import "unsafe"
func ioctl(fd int, req uint, arg uintptr) (err error) {
r0, er := C.ioctl(C.int(fd), C.ulong(req), C.uintptr_t(arg))
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux.go b/vendor/golang.org/x/sys/unix/syscall_linux.go
index 5682e262..230a9454 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux.go
@@ -1295,6 +1295,48 @@ func GetsockoptTCPInfo(fd, level, opt int) (*TCPInfo, error) {
return &value, err
}
+// GetsockoptTCPCCVegasInfo returns algorithm specific congestion control information for a socket using the "vegas"
+// algorithm.
+//
+// The socket's congestion control algorighm can be retrieved via [GetsockoptString] with the [TCP_CONGESTION] option:
+//
+// algo, err := unix.GetsockoptString(fd, unix.IPPROTO_TCP, unix.TCP_CONGESTION)
+func GetsockoptTCPCCVegasInfo(fd, level, opt int) (*TCPVegasInfo, error) {
+ var value [SizeofTCPCCInfo / 4]uint32 // ensure proper alignment
+ vallen := _Socklen(SizeofTCPCCInfo)
+ err := getsockopt(fd, level, opt, unsafe.Pointer(&value[0]), &vallen)
+ out := (*TCPVegasInfo)(unsafe.Pointer(&value[0]))
+ return out, err
+}
+
+// GetsockoptTCPCCDCTCPInfo returns algorithm specific congestion control information for a socket using the "dctp"
+// algorithm.
+//
+// The socket's congestion control algorighm can be retrieved via [GetsockoptString] with the [TCP_CONGESTION] option:
+//
+// algo, err := unix.GetsockoptString(fd, unix.IPPROTO_TCP, unix.TCP_CONGESTION)
+func GetsockoptTCPCCDCTCPInfo(fd, level, opt int) (*TCPDCTCPInfo, error) {
+ var value [SizeofTCPCCInfo / 4]uint32 // ensure proper alignment
+ vallen := _Socklen(SizeofTCPCCInfo)
+ err := getsockopt(fd, level, opt, unsafe.Pointer(&value[0]), &vallen)
+ out := (*TCPDCTCPInfo)(unsafe.Pointer(&value[0]))
+ return out, err
+}
+
+// GetsockoptTCPCCBBRInfo returns algorithm specific congestion control information for a socket using the "bbr"
+// algorithm.
+//
+// The socket's congestion control algorighm can be retrieved via [GetsockoptString] with the [TCP_CONGESTION] option:
+//
+// algo, err := unix.GetsockoptString(fd, unix.IPPROTO_TCP, unix.TCP_CONGESTION)
+func GetsockoptTCPCCBBRInfo(fd, level, opt int) (*TCPBBRInfo, error) {
+ var value [SizeofTCPCCInfo / 4]uint32 // ensure proper alignment
+ vallen := _Socklen(SizeofTCPCCInfo)
+ err := getsockopt(fd, level, opt, unsafe.Pointer(&value[0]), &vallen)
+ out := (*TCPBBRInfo)(unsafe.Pointer(&value[0]))
+ return out, err
+}
+
// GetsockoptString returns the string value of the socket option opt for the
// socket associated with fd at the given socket level.
func GetsockoptString(fd, level, opt int) (string, error) {
@@ -1818,6 +1860,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
//sys ClockAdjtime(clockid int32, buf *Timex) (state int, err error)
//sys ClockGetres(clockid int32, res *Timespec) (err error)
//sys ClockGettime(clockid int32, time *Timespec) (err error)
+//sys ClockSettime(clockid int32, time *Timespec) (err error)
//sys ClockNanosleep(clockid int32, flags int, request *Timespec, remain *Timespec) (err error)
//sys Close(fd int) (err error)
//sys CloseRange(first uint, last uint, flags uint) (err error)
@@ -1959,7 +2002,26 @@ func Getpgrp() (pid int) {
//sysnb Getpid() (pid int)
//sysnb Getppid() (ppid int)
//sys Getpriority(which int, who int) (prio int, err error)
-//sys Getrandom(buf []byte, flags int) (n int, err error)
+
+func Getrandom(buf []byte, flags int) (n int, err error) {
+ vdsoRet, supported := vgetrandom(buf, uint32(flags))
+ if supported {
+ if vdsoRet < 0 {
+ return 0, errnoErr(syscall.Errno(-vdsoRet))
+ }
+ return vdsoRet, nil
+ }
+ var p *byte
+ if len(buf) > 0 {
+ p = &buf[0]
+ }
+ r, _, e := Syscall(SYS_GETRANDOM, uintptr(unsafe.Pointer(p)), uintptr(len(buf)), uintptr(flags))
+ if e != 0 {
+ return 0, errnoErr(e)
+ }
+ return int(r), nil
+}
+
//sysnb Getrusage(who int, rusage *Rusage) (err error)
//sysnb Getsid(pid int) (sid int, err error)
//sysnb Gettid() (tid int)
@@ -2592,3 +2654,4 @@ func SchedGetAttr(pid int, flags uint) (*SchedAttr, error) {
}
//sys Cachestat(fd uint, crange *CachestatRange, cstat *Cachestat_t, flags uint) (err error)
+//sys Mseal(b []byte, flags uint) (err error)
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go b/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go
index cf2ee6c7..745e5c7e 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go
@@ -182,3 +182,5 @@ func KexecFileLoad(kernelFd int, initrdFd int, cmdline string, flags int) error
}
return kexecFileLoad(kernelFd, initrdFd, cmdlineLen, cmdline, flags)
}
+
+const SYS_FSTATAT = SYS_NEWFSTATAT
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go b/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go
index 3d0e9845..dd2262a4 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go
@@ -214,3 +214,5 @@ func KexecFileLoad(kernelFd int, initrdFd int, cmdline string, flags int) error
}
return kexecFileLoad(kernelFd, initrdFd, cmdlineLen, cmdline, flags)
}
+
+const SYS_FSTATAT = SYS_NEWFSTATAT
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go b/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go
index 6f5a2889..8cf3670b 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go
@@ -187,3 +187,5 @@ func RISCVHWProbe(pairs []RISCVHWProbePairs, set *CPUSet, flags uint) (err error
}
return riscvHWProbe(pairs, setSize, set, flags)
}
+
+const SYS_FSTATAT = SYS_NEWFSTATAT
diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd.go b/vendor/golang.org/x/sys/unix/syscall_openbsd.go
index b25343c7..b86ded54 100644
--- a/vendor/golang.org/x/sys/unix/syscall_openbsd.go
+++ b/vendor/golang.org/x/sys/unix/syscall_openbsd.go
@@ -293,6 +293,7 @@ func Uname(uname *Utsname) error {
//sys Mkfifoat(dirfd int, path string, mode uint32) (err error)
//sys Mknod(path string, mode uint32, dev int) (err error)
//sys Mknodat(dirfd int, path string, mode uint32, dev int) (err error)
+//sys Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error)
//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
//sys Open(path string, mode int, perm uint32) (fd int, err error)
//sys Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error)
diff --git a/vendor/golang.org/x/sys/unix/syscall_unix.go b/vendor/golang.org/x/sys/unix/syscall_unix.go
index 77081de8..4e92e5aa 100644
--- a/vendor/golang.org/x/sys/unix/syscall_unix.go
+++ b/vendor/golang.org/x/sys/unix/syscall_unix.go
@@ -154,6 +154,15 @@ func Munmap(b []byte) (err error) {
return mapper.Munmap(b)
}
+func MmapPtr(fd int, offset int64, addr unsafe.Pointer, length uintptr, prot int, flags int) (ret unsafe.Pointer, err error) {
+ xaddr, err := mapper.mmap(uintptr(addr), length, prot, flags, fd, offset)
+ return unsafe.Pointer(xaddr), err
+}
+
+func MunmapPtr(addr unsafe.Pointer, length uintptr) (err error) {
+ return mapper.munmap(uintptr(addr), length)
+}
+
func Read(fd int, p []byte) (n int, err error) {
n, err = read(fd, p)
if raceenabled {
diff --git a/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go b/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go
index 312ae6ac..7bf5c04b 100644
--- a/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go
+++ b/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go
@@ -768,6 +768,15 @@ func Munmap(b []byte) (err error) {
return mapper.Munmap(b)
}
+func MmapPtr(fd int, offset int64, addr unsafe.Pointer, length uintptr, prot int, flags int) (ret unsafe.Pointer, err error) {
+ xaddr, err := mapper.mmap(uintptr(addr), length, prot, flags, fd, offset)
+ return unsafe.Pointer(xaddr), err
+}
+
+func MunmapPtr(addr unsafe.Pointer, length uintptr) (err error) {
+ return mapper.munmap(uintptr(addr), length)
+}
+
//sys Gethostname(buf []byte) (err error) = SYS___GETHOSTNAME_A
//sysnb Getgid() (gid int)
//sysnb Getpid() (pid int)
@@ -816,10 +825,10 @@ func Lstat(path string, stat *Stat_t) (err error) {
// for checking symlinks begins with $VERSION/ $SYSNAME/ $SYSSYMR/ $SYSSYMA/
func isSpecialPath(path []byte) (v bool) {
var special = [4][8]byte{
- [8]byte{'V', 'E', 'R', 'S', 'I', 'O', 'N', '/'},
- [8]byte{'S', 'Y', 'S', 'N', 'A', 'M', 'E', '/'},
- [8]byte{'S', 'Y', 'S', 'S', 'Y', 'M', 'R', '/'},
- [8]byte{'S', 'Y', 'S', 'S', 'Y', 'M', 'A', '/'}}
+ {'V', 'E', 'R', 'S', 'I', 'O', 'N', '/'},
+ {'S', 'Y', 'S', 'N', 'A', 'M', 'E', '/'},
+ {'S', 'Y', 'S', 'S', 'Y', 'M', 'R', '/'},
+ {'S', 'Y', 'S', 'S', 'Y', 'M', 'A', '/'}}
var i, j int
for i = 0; i < len(special); i++ {
@@ -3115,3 +3124,90 @@ func legacy_Mkfifoat(dirfd int, path string, mode uint32) (err error) {
//sys Posix_openpt(oflag int) (fd int, err error) = SYS_POSIX_OPENPT
//sys Grantpt(fildes int) (rc int, err error) = SYS_GRANTPT
//sys Unlockpt(fildes int) (rc int, err error) = SYS_UNLOCKPT
+
+func fcntlAsIs(fd uintptr, cmd int, arg uintptr) (val int, err error) {
+ runtime.EnterSyscall()
+ r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FCNTL<<4, uintptr(fd), uintptr(cmd), arg)
+ runtime.ExitSyscall()
+ val = int(r0)
+ if int64(r0) == -1 {
+ err = errnoErr2(e1, e2)
+ }
+ return
+}
+
+func Fcntl(fd uintptr, cmd int, op interface{}) (ret int, err error) {
+ switch op.(type) {
+ case *Flock_t:
+ err = FcntlFlock(fd, cmd, op.(*Flock_t))
+ if err != nil {
+ ret = -1
+ }
+ return
+ case int:
+ return FcntlInt(fd, cmd, op.(int))
+ case *F_cnvrt:
+ return fcntlAsIs(fd, cmd, uintptr(unsafe.Pointer(op.(*F_cnvrt))))
+ case unsafe.Pointer:
+ return fcntlAsIs(fd, cmd, uintptr(op.(unsafe.Pointer)))
+ default:
+ return -1, EINVAL
+ }
+ return
+}
+
+func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
+ if raceenabled {
+ raceReleaseMerge(unsafe.Pointer(&ioSync))
+ }
+ return sendfile(outfd, infd, offset, count)
+}
+
+func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
+ // TODO: use LE call instead if the call is implemented
+ originalOffset, err := Seek(infd, 0, SEEK_CUR)
+ if err != nil {
+ return -1, err
+ }
+ //start reading data from in_fd
+ if offset != nil {
+ _, err := Seek(infd, *offset, SEEK_SET)
+ if err != nil {
+ return -1, err
+ }
+ }
+
+ buf := make([]byte, count)
+ readBuf := make([]byte, 0)
+ var n int = 0
+ for i := 0; i < count; i += n {
+ n, err := Read(infd, buf)
+ if n == 0 {
+ if err != nil {
+ return -1, err
+ } else { // EOF
+ break
+ }
+ }
+ readBuf = append(readBuf, buf...)
+ buf = buf[0:0]
+ }
+
+ n2, err := Write(outfd, readBuf)
+ if err != nil {
+ return -1, err
+ }
+
+ //When sendfile() returns, this variable will be set to the
+ // offset of the byte following the last byte that was read.
+ if offset != nil {
+ *offset = *offset + int64(n)
+ // If offset is not NULL, then sendfile() does not modify the file
+ // offset of in_fd
+ _, err := Seek(infd, originalOffset, SEEK_SET)
+ if err != nil {
+ return -1, err
+ }
+ }
+ return n2, nil
+}
diff --git a/vendor/golang.org/x/sys/unix/vgetrandom_linux.go b/vendor/golang.org/x/sys/unix/vgetrandom_linux.go
new file mode 100644
index 00000000..07ac8e09
--- /dev/null
+++ b/vendor/golang.org/x/sys/unix/vgetrandom_linux.go
@@ -0,0 +1,13 @@
+// Copyright 2024 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build linux && go1.24
+
+package unix
+
+import _ "unsafe"
+
+//go:linkname vgetrandom runtime.vgetrandom
+//go:noescape
+func vgetrandom(p []byte, flags uint32) (ret int, supported bool)
diff --git a/vendor/golang.org/x/sys/unix/vgetrandom_unsupported.go b/vendor/golang.org/x/sys/unix/vgetrandom_unsupported.go
new file mode 100644
index 00000000..297e97bc
--- /dev/null
+++ b/vendor/golang.org/x/sys/unix/vgetrandom_unsupported.go
@@ -0,0 +1,11 @@
+// Copyright 2024 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build !linux || !go1.24
+
+package unix
+
+func vgetrandom(p []byte, flags uint32) (ret int, supported bool) {
+ return -1, false
+}
diff --git a/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go
index e40fa852..d73c4652 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go
@@ -237,6 +237,9 @@ const (
CLOCK_UPTIME_RAW_APPROX = 0x9
CLONE_NOFOLLOW = 0x1
CLONE_NOOWNERCOPY = 0x2
+ CONNECT_DATA_AUTHENTICATED = 0x4
+ CONNECT_DATA_IDEMPOTENT = 0x2
+ CONNECT_RESUME_ON_READ_WRITE = 0x1
CR0 = 0x0
CR1 = 0x1000
CR2 = 0x2000
@@ -1169,6 +1172,11 @@ const (
PT_WRITE_D = 0x5
PT_WRITE_I = 0x4
PT_WRITE_U = 0x6
+ RENAME_EXCL = 0x4
+ RENAME_NOFOLLOW_ANY = 0x10
+ RENAME_RESERVED1 = 0x8
+ RENAME_SECLUDE = 0x1
+ RENAME_SWAP = 0x2
RLIMIT_AS = 0x5
RLIMIT_CORE = 0x4
RLIMIT_CPU = 0x0
@@ -1260,6 +1268,10 @@ const (
RTV_SSTHRESH = 0x20
RUSAGE_CHILDREN = -0x1
RUSAGE_SELF = 0x0
+ SAE_ASSOCID_ALL = 0xffffffff
+ SAE_ASSOCID_ANY = 0x0
+ SAE_CONNID_ALL = 0xffffffff
+ SAE_CONNID_ANY = 0x0
SCM_CREDS = 0x3
SCM_RIGHTS = 0x1
SCM_TIMESTAMP = 0x2
diff --git a/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go b/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go
index bb02aa6c..4a55a400 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go
@@ -237,6 +237,9 @@ const (
CLOCK_UPTIME_RAW_APPROX = 0x9
CLONE_NOFOLLOW = 0x1
CLONE_NOOWNERCOPY = 0x2
+ CONNECT_DATA_AUTHENTICATED = 0x4
+ CONNECT_DATA_IDEMPOTENT = 0x2
+ CONNECT_RESUME_ON_READ_WRITE = 0x1
CR0 = 0x0
CR1 = 0x1000
CR2 = 0x2000
@@ -1169,6 +1172,11 @@ const (
PT_WRITE_D = 0x5
PT_WRITE_I = 0x4
PT_WRITE_U = 0x6
+ RENAME_EXCL = 0x4
+ RENAME_NOFOLLOW_ANY = 0x10
+ RENAME_RESERVED1 = 0x8
+ RENAME_SECLUDE = 0x1
+ RENAME_SWAP = 0x2
RLIMIT_AS = 0x5
RLIMIT_CORE = 0x4
RLIMIT_CPU = 0x0
@@ -1260,6 +1268,10 @@ const (
RTV_SSTHRESH = 0x20
RUSAGE_CHILDREN = -0x1
RUSAGE_SELF = 0x0
+ SAE_ASSOCID_ALL = 0xffffffff
+ SAE_ASSOCID_ANY = 0x0
+ SAE_CONNID_ALL = 0xffffffff
+ SAE_CONNID_ANY = 0x0
SCM_CREDS = 0x3
SCM_RIGHTS = 0x1
SCM_TIMESTAMP = 0x2
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux.go b/vendor/golang.org/x/sys/unix/zerrors_linux.go
index 877a62b4..ccba391c 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux.go
@@ -457,6 +457,7 @@ const (
B600 = 0x8
B75 = 0x2
B9600 = 0xd
+ BCACHEFS_SUPER_MAGIC = 0xca451a4e
BDEVFS_MAGIC = 0x62646576
BINDERFS_SUPER_MAGIC = 0x6c6f6f70
BINFMTFS_MAGIC = 0x42494e4d
@@ -494,6 +495,7 @@ const (
BPF_F_TEST_REG_INVARIANTS = 0x80
BPF_F_TEST_RND_HI32 = 0x4
BPF_F_TEST_RUN_ON_CPU = 0x1
+ BPF_F_TEST_SKB_CHECKSUM_COMPLETE = 0x4
BPF_F_TEST_STATE_FREQ = 0x8
BPF_F_TEST_XDP_LIVE_FRAMES = 0x2
BPF_F_XDP_DEV_BOUND_ONLY = 0x40
@@ -928,6 +930,7 @@ const (
EPOLL_CTL_ADD = 0x1
EPOLL_CTL_DEL = 0x2
EPOLL_CTL_MOD = 0x3
+ EPOLL_IOC_TYPE = 0x8a
EROFS_SUPER_MAGIC_V1 = 0xe0f5e1e2
ESP_V4_FLOW = 0xa
ESP_V6_FLOW = 0xc
@@ -941,9 +944,6 @@ const (
ETHTOOL_FEC_OFF = 0x4
ETHTOOL_FEC_RS = 0x8
ETHTOOL_FLAG_ALL = 0x7
- ETHTOOL_FLAG_COMPACT_BITSETS = 0x1
- ETHTOOL_FLAG_OMIT_REPLY = 0x2
- ETHTOOL_FLAG_STATS = 0x4
ETHTOOL_FLASHDEV = 0x33
ETHTOOL_FLASH_MAX_FILENAME = 0x80
ETHTOOL_FWVERS_LEN = 0x20
@@ -1705,6 +1705,7 @@ const (
KEXEC_ARCH_S390 = 0x160000
KEXEC_ARCH_SH = 0x2a0000
KEXEC_ARCH_X86_64 = 0x3e0000
+ KEXEC_CRASH_HOTPLUG_SUPPORT = 0x8
KEXEC_FILE_DEBUG = 0x8
KEXEC_FILE_NO_INITRAMFS = 0x4
KEXEC_FILE_ON_CRASH = 0x2
@@ -1780,6 +1781,7 @@ const (
KEY_SPEC_USER_KEYRING = -0x4
KEY_SPEC_USER_SESSION_KEYRING = -0x5
LANDLOCK_ACCESS_FS_EXECUTE = 0x1
+ LANDLOCK_ACCESS_FS_IOCTL_DEV = 0x8000
LANDLOCK_ACCESS_FS_MAKE_BLOCK = 0x800
LANDLOCK_ACCESS_FS_MAKE_CHAR = 0x40
LANDLOCK_ACCESS_FS_MAKE_DIR = 0x80
@@ -1861,6 +1863,19 @@ const (
MAP_FILE = 0x0
MAP_FIXED = 0x10
MAP_FIXED_NOREPLACE = 0x100000
+ MAP_HUGE_16GB = 0x88000000
+ MAP_HUGE_16KB = 0x38000000
+ MAP_HUGE_16MB = 0x60000000
+ MAP_HUGE_1GB = 0x78000000
+ MAP_HUGE_1MB = 0x50000000
+ MAP_HUGE_256MB = 0x70000000
+ MAP_HUGE_2GB = 0x7c000000
+ MAP_HUGE_2MB = 0x54000000
+ MAP_HUGE_32MB = 0x64000000
+ MAP_HUGE_512KB = 0x4c000000
+ MAP_HUGE_512MB = 0x74000000
+ MAP_HUGE_64KB = 0x40000000
+ MAP_HUGE_8MB = 0x5c000000
MAP_HUGE_MASK = 0x3f
MAP_HUGE_SHIFT = 0x1a
MAP_PRIVATE = 0x2
@@ -1908,6 +1923,7 @@ const (
MNT_EXPIRE = 0x4
MNT_FORCE = 0x1
MNT_ID_REQ_SIZE_VER0 = 0x18
+ MNT_ID_REQ_SIZE_VER1 = 0x20
MODULE_INIT_COMPRESSED_FILE = 0x4
MODULE_INIT_IGNORE_MODVERSIONS = 0x1
MODULE_INIT_IGNORE_VERMAGIC = 0x2
@@ -2173,7 +2189,7 @@ const (
NFT_REG_SIZE = 0x10
NFT_REJECT_ICMPX_MAX = 0x3
NFT_RT_MAX = 0x4
- NFT_SECMARK_CTX_MAXLEN = 0x100
+ NFT_SECMARK_CTX_MAXLEN = 0x1000
NFT_SET_MAXNAMELEN = 0x100
NFT_SOCKET_MAX = 0x3
NFT_TABLE_F_MASK = 0x7
@@ -2342,9 +2358,11 @@ const (
PERF_MEM_LVLNUM_IO = 0xa
PERF_MEM_LVLNUM_L1 = 0x1
PERF_MEM_LVLNUM_L2 = 0x2
+ PERF_MEM_LVLNUM_L2_MHB = 0x5
PERF_MEM_LVLNUM_L3 = 0x3
PERF_MEM_LVLNUM_L4 = 0x4
PERF_MEM_LVLNUM_LFB = 0xc
+ PERF_MEM_LVLNUM_MSC = 0x6
PERF_MEM_LVLNUM_NA = 0xf
PERF_MEM_LVLNUM_PMEM = 0xe
PERF_MEM_LVLNUM_RAM = 0xd
@@ -2417,6 +2435,7 @@ const (
PRIO_PGRP = 0x1
PRIO_PROCESS = 0x0
PRIO_USER = 0x2
+ PROCFS_IOCTL_MAGIC = 'f'
PROC_SUPER_MAGIC = 0x9fa0
PROT_EXEC = 0x4
PROT_GROWSDOWN = 0x1000000
@@ -2498,6 +2517,23 @@ const (
PR_PAC_GET_ENABLED_KEYS = 0x3d
PR_PAC_RESET_KEYS = 0x36
PR_PAC_SET_ENABLED_KEYS = 0x3c
+ PR_PPC_DEXCR_CTRL_CLEAR = 0x4
+ PR_PPC_DEXCR_CTRL_CLEAR_ONEXEC = 0x10
+ PR_PPC_DEXCR_CTRL_EDITABLE = 0x1
+ PR_PPC_DEXCR_CTRL_MASK = 0x1f
+ PR_PPC_DEXCR_CTRL_SET = 0x2
+ PR_PPC_DEXCR_CTRL_SET_ONEXEC = 0x8
+ PR_PPC_DEXCR_IBRTPD = 0x1
+ PR_PPC_DEXCR_NPHIE = 0x3
+ PR_PPC_DEXCR_SBHE = 0x0
+ PR_PPC_DEXCR_SRAPD = 0x2
+ PR_PPC_GET_DEXCR = 0x48
+ PR_PPC_SET_DEXCR = 0x49
+ PR_RISCV_CTX_SW_FENCEI_OFF = 0x1
+ PR_RISCV_CTX_SW_FENCEI_ON = 0x0
+ PR_RISCV_SCOPE_PER_PROCESS = 0x0
+ PR_RISCV_SCOPE_PER_THREAD = 0x1
+ PR_RISCV_SET_ICACHE_FLUSH_CTX = 0x47
PR_RISCV_V_GET_CONTROL = 0x46
PR_RISCV_V_SET_CONTROL = 0x45
PR_RISCV_V_VSTATE_CTRL_CUR_MASK = 0x3
@@ -2589,6 +2625,28 @@ const (
PR_UNALIGN_NOPRINT = 0x1
PR_UNALIGN_SIGBUS = 0x2
PSTOREFS_MAGIC = 0x6165676c
+ PTP_CLK_MAGIC = '='
+ PTP_ENABLE_FEATURE = 0x1
+ PTP_EXTTS_EDGES = 0x6
+ PTP_EXTTS_EVENT_VALID = 0x1
+ PTP_EXTTS_V1_VALID_FLAGS = 0x7
+ PTP_EXTTS_VALID_FLAGS = 0x1f
+ PTP_EXT_OFFSET = 0x10
+ PTP_FALLING_EDGE = 0x4
+ PTP_MAX_SAMPLES = 0x19
+ PTP_PEROUT_DUTY_CYCLE = 0x2
+ PTP_PEROUT_ONE_SHOT = 0x1
+ PTP_PEROUT_PHASE = 0x4
+ PTP_PEROUT_V1_VALID_FLAGS = 0x0
+ PTP_PEROUT_VALID_FLAGS = 0x7
+ PTP_PIN_GETFUNC = 0xc0603d06
+ PTP_PIN_GETFUNC2 = 0xc0603d0f
+ PTP_RISING_EDGE = 0x2
+ PTP_STRICT_FLAGS = 0x8
+ PTP_SYS_OFFSET_EXTENDED = 0xc4c03d09
+ PTP_SYS_OFFSET_EXTENDED2 = 0xc4c03d12
+ PTP_SYS_OFFSET_PRECISE = 0xc0403d08
+ PTP_SYS_OFFSET_PRECISE2 = 0xc0403d11
PTRACE_ATTACH = 0x10
PTRACE_CONT = 0x7
PTRACE_DETACH = 0x11
@@ -2902,11 +2960,12 @@ const (
RUSAGE_SELF = 0x0
RUSAGE_THREAD = 0x1
RWF_APPEND = 0x10
+ RWF_ATOMIC = 0x40
RWF_DSYNC = 0x2
RWF_HIPRI = 0x1
RWF_NOAPPEND = 0x20
RWF_NOWAIT = 0x8
- RWF_SUPPORTED = 0x3f
+ RWF_SUPPORTED = 0x7f
RWF_SYNC = 0x4
RWF_WRITE_LIFE_NOT_SET = 0x0
SCHED_BATCH = 0x3
@@ -3179,6 +3238,7 @@ const (
STATX_ATTR_MOUNT_ROOT = 0x2000
STATX_ATTR_NODUMP = 0x40
STATX_ATTR_VERITY = 0x100000
+ STATX_ATTR_WRITE_ATOMIC = 0x400000
STATX_BASIC_STATS = 0x7ff
STATX_BLOCKS = 0x400
STATX_BTIME = 0x800
@@ -3192,8 +3252,10 @@ const (
STATX_MTIME = 0x40
STATX_NLINK = 0x4
STATX_SIZE = 0x200
+ STATX_SUBVOL = 0x8000
STATX_TYPE = 0x1
STATX_UID = 0x8
+ STATX_WRITE_ATOMIC = 0x10000
STATX__RESERVED = 0x80000000
SYNC_FILE_RANGE_WAIT_AFTER = 0x4
SYNC_FILE_RANGE_WAIT_BEFORE = 0x1
@@ -3592,6 +3654,7 @@ const (
XDP_UMEM_PGOFF_COMPLETION_RING = 0x180000000
XDP_UMEM_PGOFF_FILL_RING = 0x100000000
XDP_UMEM_REG = 0x4
+ XDP_UMEM_TX_METADATA_LEN = 0x4
XDP_UMEM_TX_SW_CSUM = 0x2
XDP_UMEM_UNALIGNED_CHUNK_FLAG = 0x1
XDP_USE_NEED_WAKEUP = 0x8
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go
index e4bc0bd5..0c00cb3f 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go
@@ -78,6 +78,8 @@ const (
ECHOPRT = 0x400
EFD_CLOEXEC = 0x80000
EFD_NONBLOCK = 0x800
+ EPIOCGPARAMS = 0x80088a02
+ EPIOCSPARAMS = 0x40088a01
EPOLL_CLOEXEC = 0x80000
EXTPROC = 0x10000
FF1 = 0x8000
@@ -151,9 +153,14 @@ const (
NFDBITS = 0x20
NLDLY = 0x100
NOFLSH = 0x80
+ NS_GET_MNTNS_ID = 0x8008b705
NS_GET_NSTYPE = 0xb703
NS_GET_OWNER_UID = 0xb704
NS_GET_PARENT = 0xb702
+ NS_GET_PID_FROM_PIDNS = 0x8004b706
+ NS_GET_PID_IN_PIDNS = 0x8004b708
+ NS_GET_TGID_FROM_PIDNS = 0x8004b707
+ NS_GET_TGID_IN_PIDNS = 0x8004b709
NS_GET_USERNS = 0xb701
OLCUC = 0x2
ONLCR = 0x4
@@ -230,6 +237,20 @@ const (
PPPIOCUNBRIDGECHAN = 0x7434
PPPIOCXFERUNIT = 0x744e
PR_SET_PTRACER_ANY = 0xffffffff
+ PTP_CLOCK_GETCAPS = 0x80503d01
+ PTP_CLOCK_GETCAPS2 = 0x80503d0a
+ PTP_ENABLE_PPS = 0x40043d04
+ PTP_ENABLE_PPS2 = 0x40043d0d
+ PTP_EXTTS_REQUEST = 0x40103d02
+ PTP_EXTTS_REQUEST2 = 0x40103d0b
+ PTP_MASK_CLEAR_ALL = 0x3d13
+ PTP_MASK_EN_SINGLE = 0x40043d14
+ PTP_PEROUT_REQUEST = 0x40383d03
+ PTP_PEROUT_REQUEST2 = 0x40383d0c
+ PTP_PIN_SETFUNC = 0x40603d07
+ PTP_PIN_SETFUNC2 = 0x40603d10
+ PTP_SYS_OFFSET = 0x43403d05
+ PTP_SYS_OFFSET2 = 0x43403d0e
PTRACE_GETFPREGS = 0xe
PTRACE_GETFPXREGS = 0x12
PTRACE_GET_THREAD_AREA = 0x19
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go
index 689317af..dfb36455 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go
@@ -78,6 +78,8 @@ const (
ECHOPRT = 0x400
EFD_CLOEXEC = 0x80000
EFD_NONBLOCK = 0x800
+ EPIOCGPARAMS = 0x80088a02
+ EPIOCSPARAMS = 0x40088a01
EPOLL_CLOEXEC = 0x80000
EXTPROC = 0x10000
FF1 = 0x8000
@@ -151,9 +153,14 @@ const (
NFDBITS = 0x40
NLDLY = 0x100
NOFLSH = 0x80
+ NS_GET_MNTNS_ID = 0x8008b705
NS_GET_NSTYPE = 0xb703
NS_GET_OWNER_UID = 0xb704
NS_GET_PARENT = 0xb702
+ NS_GET_PID_FROM_PIDNS = 0x8004b706
+ NS_GET_PID_IN_PIDNS = 0x8004b708
+ NS_GET_TGID_FROM_PIDNS = 0x8004b707
+ NS_GET_TGID_IN_PIDNS = 0x8004b709
NS_GET_USERNS = 0xb701
OLCUC = 0x2
ONLCR = 0x4
@@ -230,6 +237,20 @@ const (
PPPIOCUNBRIDGECHAN = 0x7434
PPPIOCXFERUNIT = 0x744e
PR_SET_PTRACER_ANY = 0xffffffffffffffff
+ PTP_CLOCK_GETCAPS = 0x80503d01
+ PTP_CLOCK_GETCAPS2 = 0x80503d0a
+ PTP_ENABLE_PPS = 0x40043d04
+ PTP_ENABLE_PPS2 = 0x40043d0d
+ PTP_EXTTS_REQUEST = 0x40103d02
+ PTP_EXTTS_REQUEST2 = 0x40103d0b
+ PTP_MASK_CLEAR_ALL = 0x3d13
+ PTP_MASK_EN_SINGLE = 0x40043d14
+ PTP_PEROUT_REQUEST = 0x40383d03
+ PTP_PEROUT_REQUEST2 = 0x40383d0c
+ PTP_PIN_SETFUNC = 0x40603d07
+ PTP_PIN_SETFUNC2 = 0x40603d10
+ PTP_SYS_OFFSET = 0x43403d05
+ PTP_SYS_OFFSET2 = 0x43403d0e
PTRACE_ARCH_PRCTL = 0x1e
PTRACE_GETFPREGS = 0xe
PTRACE_GETFPXREGS = 0x12
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go
index 5cca668a..d46dcf78 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go
@@ -78,6 +78,8 @@ const (
ECHOPRT = 0x400
EFD_CLOEXEC = 0x80000
EFD_NONBLOCK = 0x800
+ EPIOCGPARAMS = 0x80088a02
+ EPIOCSPARAMS = 0x40088a01
EPOLL_CLOEXEC = 0x80000
EXTPROC = 0x10000
FF1 = 0x8000
@@ -148,9 +150,14 @@ const (
NFDBITS = 0x20
NLDLY = 0x100
NOFLSH = 0x80
+ NS_GET_MNTNS_ID = 0x8008b705
NS_GET_NSTYPE = 0xb703
NS_GET_OWNER_UID = 0xb704
NS_GET_PARENT = 0xb702
+ NS_GET_PID_FROM_PIDNS = 0x8004b706
+ NS_GET_PID_IN_PIDNS = 0x8004b708
+ NS_GET_TGID_FROM_PIDNS = 0x8004b707
+ NS_GET_TGID_IN_PIDNS = 0x8004b709
NS_GET_USERNS = 0xb701
OLCUC = 0x2
ONLCR = 0x4
@@ -227,6 +234,20 @@ const (
PPPIOCUNBRIDGECHAN = 0x7434
PPPIOCXFERUNIT = 0x744e
PR_SET_PTRACER_ANY = 0xffffffff
+ PTP_CLOCK_GETCAPS = 0x80503d01
+ PTP_CLOCK_GETCAPS2 = 0x80503d0a
+ PTP_ENABLE_PPS = 0x40043d04
+ PTP_ENABLE_PPS2 = 0x40043d0d
+ PTP_EXTTS_REQUEST = 0x40103d02
+ PTP_EXTTS_REQUEST2 = 0x40103d0b
+ PTP_MASK_CLEAR_ALL = 0x3d13
+ PTP_MASK_EN_SINGLE = 0x40043d14
+ PTP_PEROUT_REQUEST = 0x40383d03
+ PTP_PEROUT_REQUEST2 = 0x40383d0c
+ PTP_PIN_SETFUNC = 0x40603d07
+ PTP_PIN_SETFUNC2 = 0x40603d10
+ PTP_SYS_OFFSET = 0x43403d05
+ PTP_SYS_OFFSET2 = 0x43403d0e
PTRACE_GETCRUNCHREGS = 0x19
PTRACE_GETFDPIC = 0x1f
PTRACE_GETFDPIC_EXEC = 0x0
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go
index 14270508..3af3248a 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go
@@ -78,6 +78,8 @@ const (
ECHOPRT = 0x400
EFD_CLOEXEC = 0x80000
EFD_NONBLOCK = 0x800
+ EPIOCGPARAMS = 0x80088a02
+ EPIOCSPARAMS = 0x40088a01
EPOLL_CLOEXEC = 0x80000
ESR_MAGIC = 0x45535201
EXTPROC = 0x10000
@@ -152,9 +154,14 @@ const (
NFDBITS = 0x40
NLDLY = 0x100
NOFLSH = 0x80
+ NS_GET_MNTNS_ID = 0x8008b705
NS_GET_NSTYPE = 0xb703
NS_GET_OWNER_UID = 0xb704
NS_GET_PARENT = 0xb702
+ NS_GET_PID_FROM_PIDNS = 0x8004b706
+ NS_GET_PID_IN_PIDNS = 0x8004b708
+ NS_GET_TGID_FROM_PIDNS = 0x8004b707
+ NS_GET_TGID_IN_PIDNS = 0x8004b709
NS_GET_USERNS = 0xb701
OLCUC = 0x2
ONLCR = 0x4
@@ -233,6 +240,20 @@ const (
PROT_BTI = 0x10
PROT_MTE = 0x20
PR_SET_PTRACER_ANY = 0xffffffffffffffff
+ PTP_CLOCK_GETCAPS = 0x80503d01
+ PTP_CLOCK_GETCAPS2 = 0x80503d0a
+ PTP_ENABLE_PPS = 0x40043d04
+ PTP_ENABLE_PPS2 = 0x40043d0d
+ PTP_EXTTS_REQUEST = 0x40103d02
+ PTP_EXTTS_REQUEST2 = 0x40103d0b
+ PTP_MASK_CLEAR_ALL = 0x3d13
+ PTP_MASK_EN_SINGLE = 0x40043d14
+ PTP_PEROUT_REQUEST = 0x40383d03
+ PTP_PEROUT_REQUEST2 = 0x40383d0c
+ PTP_PIN_SETFUNC = 0x40603d07
+ PTP_PIN_SETFUNC2 = 0x40603d10
+ PTP_SYS_OFFSET = 0x43403d05
+ PTP_SYS_OFFSET2 = 0x43403d0e
PTRACE_PEEKMTETAGS = 0x21
PTRACE_POKEMTETAGS = 0x22
PTRACE_SYSEMU = 0x1f
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go
index 28e39afd..292bcf02 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go
@@ -78,6 +78,8 @@ const (
ECHOPRT = 0x400
EFD_CLOEXEC = 0x80000
EFD_NONBLOCK = 0x800
+ EPIOCGPARAMS = 0x80088a02
+ EPIOCSPARAMS = 0x40088a01
EPOLL_CLOEXEC = 0x80000
EXTPROC = 0x10000
FF1 = 0x8000
@@ -152,9 +154,14 @@ const (
NFDBITS = 0x40
NLDLY = 0x100
NOFLSH = 0x80
+ NS_GET_MNTNS_ID = 0x8008b705
NS_GET_NSTYPE = 0xb703
NS_GET_OWNER_UID = 0xb704
NS_GET_PARENT = 0xb702
+ NS_GET_PID_FROM_PIDNS = 0x8004b706
+ NS_GET_PID_IN_PIDNS = 0x8004b708
+ NS_GET_TGID_FROM_PIDNS = 0x8004b707
+ NS_GET_TGID_IN_PIDNS = 0x8004b709
NS_GET_USERNS = 0xb701
OLCUC = 0x2
ONLCR = 0x4
@@ -231,6 +238,20 @@ const (
PPPIOCUNBRIDGECHAN = 0x7434
PPPIOCXFERUNIT = 0x744e
PR_SET_PTRACER_ANY = 0xffffffffffffffff
+ PTP_CLOCK_GETCAPS = 0x80503d01
+ PTP_CLOCK_GETCAPS2 = 0x80503d0a
+ PTP_ENABLE_PPS = 0x40043d04
+ PTP_ENABLE_PPS2 = 0x40043d0d
+ PTP_EXTTS_REQUEST = 0x40103d02
+ PTP_EXTTS_REQUEST2 = 0x40103d0b
+ PTP_MASK_CLEAR_ALL = 0x3d13
+ PTP_MASK_EN_SINGLE = 0x40043d14
+ PTP_PEROUT_REQUEST = 0x40383d03
+ PTP_PEROUT_REQUEST2 = 0x40383d0c
+ PTP_PIN_SETFUNC = 0x40603d07
+ PTP_PIN_SETFUNC2 = 0x40603d10
+ PTP_SYS_OFFSET = 0x43403d05
+ PTP_SYS_OFFSET2 = 0x43403d0e
PTRACE_SYSEMU = 0x1f
PTRACE_SYSEMU_SINGLESTEP = 0x20
RLIMIT_AS = 0x9
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go
index cd66e92c..782b7110 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go
@@ -78,6 +78,8 @@ const (
ECHOPRT = 0x400
EFD_CLOEXEC = 0x80000
EFD_NONBLOCK = 0x80
+ EPIOCGPARAMS = 0x40088a02
+ EPIOCSPARAMS = 0x80088a01
EPOLL_CLOEXEC = 0x80000
EXTPROC = 0x10000
FF1 = 0x8000
@@ -148,9 +150,14 @@ const (
NFDBITS = 0x20
NLDLY = 0x100
NOFLSH = 0x80
+ NS_GET_MNTNS_ID = 0x4008b705
NS_GET_NSTYPE = 0x2000b703
NS_GET_OWNER_UID = 0x2000b704
NS_GET_PARENT = 0x2000b702
+ NS_GET_PID_FROM_PIDNS = 0x4004b706
+ NS_GET_PID_IN_PIDNS = 0x4004b708
+ NS_GET_TGID_FROM_PIDNS = 0x4004b707
+ NS_GET_TGID_IN_PIDNS = 0x4004b709
NS_GET_USERNS = 0x2000b701
OLCUC = 0x2
ONLCR = 0x4
@@ -227,6 +234,20 @@ const (
PPPIOCUNBRIDGECHAN = 0x20007434
PPPIOCXFERUNIT = 0x2000744e
PR_SET_PTRACER_ANY = 0xffffffff
+ PTP_CLOCK_GETCAPS = 0x40503d01
+ PTP_CLOCK_GETCAPS2 = 0x40503d0a
+ PTP_ENABLE_PPS = 0x80043d04
+ PTP_ENABLE_PPS2 = 0x80043d0d
+ PTP_EXTTS_REQUEST = 0x80103d02
+ PTP_EXTTS_REQUEST2 = 0x80103d0b
+ PTP_MASK_CLEAR_ALL = 0x20003d13
+ PTP_MASK_EN_SINGLE = 0x80043d14
+ PTP_PEROUT_REQUEST = 0x80383d03
+ PTP_PEROUT_REQUEST2 = 0x80383d0c
+ PTP_PIN_SETFUNC = 0x80603d07
+ PTP_PIN_SETFUNC2 = 0x80603d10
+ PTP_SYS_OFFSET = 0x83403d05
+ PTP_SYS_OFFSET2 = 0x83403d0e
PTRACE_GETFPREGS = 0xe
PTRACE_GET_THREAD_AREA = 0x19
PTRACE_GET_THREAD_AREA_3264 = 0xc4
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go
index c1595eba..84973fd9 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go
@@ -78,6 +78,8 @@ const (
ECHOPRT = 0x400
EFD_CLOEXEC = 0x80000
EFD_NONBLOCK = 0x80
+ EPIOCGPARAMS = 0x40088a02
+ EPIOCSPARAMS = 0x80088a01
EPOLL_CLOEXEC = 0x80000
EXTPROC = 0x10000
FF1 = 0x8000
@@ -148,9 +150,14 @@ const (
NFDBITS = 0x40
NLDLY = 0x100
NOFLSH = 0x80
+ NS_GET_MNTNS_ID = 0x4008b705
NS_GET_NSTYPE = 0x2000b703
NS_GET_OWNER_UID = 0x2000b704
NS_GET_PARENT = 0x2000b702
+ NS_GET_PID_FROM_PIDNS = 0x4004b706
+ NS_GET_PID_IN_PIDNS = 0x4004b708
+ NS_GET_TGID_FROM_PIDNS = 0x4004b707
+ NS_GET_TGID_IN_PIDNS = 0x4004b709
NS_GET_USERNS = 0x2000b701
OLCUC = 0x2
ONLCR = 0x4
@@ -227,6 +234,20 @@ const (
PPPIOCUNBRIDGECHAN = 0x20007434
PPPIOCXFERUNIT = 0x2000744e
PR_SET_PTRACER_ANY = 0xffffffffffffffff
+ PTP_CLOCK_GETCAPS = 0x40503d01
+ PTP_CLOCK_GETCAPS2 = 0x40503d0a
+ PTP_ENABLE_PPS = 0x80043d04
+ PTP_ENABLE_PPS2 = 0x80043d0d
+ PTP_EXTTS_REQUEST = 0x80103d02
+ PTP_EXTTS_REQUEST2 = 0x80103d0b
+ PTP_MASK_CLEAR_ALL = 0x20003d13
+ PTP_MASK_EN_SINGLE = 0x80043d14
+ PTP_PEROUT_REQUEST = 0x80383d03
+ PTP_PEROUT_REQUEST2 = 0x80383d0c
+ PTP_PIN_SETFUNC = 0x80603d07
+ PTP_PIN_SETFUNC2 = 0x80603d10
+ PTP_SYS_OFFSET = 0x83403d05
+ PTP_SYS_OFFSET2 = 0x83403d0e
PTRACE_GETFPREGS = 0xe
PTRACE_GET_THREAD_AREA = 0x19
PTRACE_GET_THREAD_AREA_3264 = 0xc4
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go
index ee9456b0..6d9cbc3b 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go
@@ -78,6 +78,8 @@ const (
ECHOPRT = 0x400
EFD_CLOEXEC = 0x80000
EFD_NONBLOCK = 0x80
+ EPIOCGPARAMS = 0x40088a02
+ EPIOCSPARAMS = 0x80088a01
EPOLL_CLOEXEC = 0x80000
EXTPROC = 0x10000
FF1 = 0x8000
@@ -148,9 +150,14 @@ const (
NFDBITS = 0x40
NLDLY = 0x100
NOFLSH = 0x80
+ NS_GET_MNTNS_ID = 0x4008b705
NS_GET_NSTYPE = 0x2000b703
NS_GET_OWNER_UID = 0x2000b704
NS_GET_PARENT = 0x2000b702
+ NS_GET_PID_FROM_PIDNS = 0x4004b706
+ NS_GET_PID_IN_PIDNS = 0x4004b708
+ NS_GET_TGID_FROM_PIDNS = 0x4004b707
+ NS_GET_TGID_IN_PIDNS = 0x4004b709
NS_GET_USERNS = 0x2000b701
OLCUC = 0x2
ONLCR = 0x4
@@ -227,6 +234,20 @@ const (
PPPIOCUNBRIDGECHAN = 0x20007434
PPPIOCXFERUNIT = 0x2000744e
PR_SET_PTRACER_ANY = 0xffffffffffffffff
+ PTP_CLOCK_GETCAPS = 0x40503d01
+ PTP_CLOCK_GETCAPS2 = 0x40503d0a
+ PTP_ENABLE_PPS = 0x80043d04
+ PTP_ENABLE_PPS2 = 0x80043d0d
+ PTP_EXTTS_REQUEST = 0x80103d02
+ PTP_EXTTS_REQUEST2 = 0x80103d0b
+ PTP_MASK_CLEAR_ALL = 0x20003d13
+ PTP_MASK_EN_SINGLE = 0x80043d14
+ PTP_PEROUT_REQUEST = 0x80383d03
+ PTP_PEROUT_REQUEST2 = 0x80383d0c
+ PTP_PIN_SETFUNC = 0x80603d07
+ PTP_PIN_SETFUNC2 = 0x80603d10
+ PTP_SYS_OFFSET = 0x83403d05
+ PTP_SYS_OFFSET2 = 0x83403d0e
PTRACE_GETFPREGS = 0xe
PTRACE_GET_THREAD_AREA = 0x19
PTRACE_GET_THREAD_AREA_3264 = 0xc4
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go
index 8cfca81e..5f9fedbc 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go
@@ -78,6 +78,8 @@ const (
ECHOPRT = 0x400
EFD_CLOEXEC = 0x80000
EFD_NONBLOCK = 0x80
+ EPIOCGPARAMS = 0x40088a02
+ EPIOCSPARAMS = 0x80088a01
EPOLL_CLOEXEC = 0x80000
EXTPROC = 0x10000
FF1 = 0x8000
@@ -148,9 +150,14 @@ const (
NFDBITS = 0x20
NLDLY = 0x100
NOFLSH = 0x80
+ NS_GET_MNTNS_ID = 0x4008b705
NS_GET_NSTYPE = 0x2000b703
NS_GET_OWNER_UID = 0x2000b704
NS_GET_PARENT = 0x2000b702
+ NS_GET_PID_FROM_PIDNS = 0x4004b706
+ NS_GET_PID_IN_PIDNS = 0x4004b708
+ NS_GET_TGID_FROM_PIDNS = 0x4004b707
+ NS_GET_TGID_IN_PIDNS = 0x4004b709
NS_GET_USERNS = 0x2000b701
OLCUC = 0x2
ONLCR = 0x4
@@ -227,6 +234,20 @@ const (
PPPIOCUNBRIDGECHAN = 0x20007434
PPPIOCXFERUNIT = 0x2000744e
PR_SET_PTRACER_ANY = 0xffffffff
+ PTP_CLOCK_GETCAPS = 0x40503d01
+ PTP_CLOCK_GETCAPS2 = 0x40503d0a
+ PTP_ENABLE_PPS = 0x80043d04
+ PTP_ENABLE_PPS2 = 0x80043d0d
+ PTP_EXTTS_REQUEST = 0x80103d02
+ PTP_EXTTS_REQUEST2 = 0x80103d0b
+ PTP_MASK_CLEAR_ALL = 0x20003d13
+ PTP_MASK_EN_SINGLE = 0x80043d14
+ PTP_PEROUT_REQUEST = 0x80383d03
+ PTP_PEROUT_REQUEST2 = 0x80383d0c
+ PTP_PIN_SETFUNC = 0x80603d07
+ PTP_PIN_SETFUNC2 = 0x80603d10
+ PTP_SYS_OFFSET = 0x83403d05
+ PTP_SYS_OFFSET2 = 0x83403d0e
PTRACE_GETFPREGS = 0xe
PTRACE_GET_THREAD_AREA = 0x19
PTRACE_GET_THREAD_AREA_3264 = 0xc4
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go
index 60b0deb3..bb0026ee 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go
@@ -78,6 +78,8 @@ const (
ECHOPRT = 0x20
EFD_CLOEXEC = 0x80000
EFD_NONBLOCK = 0x800
+ EPIOCGPARAMS = 0x40088a02
+ EPIOCSPARAMS = 0x80088a01
EPOLL_CLOEXEC = 0x80000
EXTPROC = 0x10000000
FF1 = 0x4000
@@ -150,9 +152,14 @@ const (
NL3 = 0x300
NLDLY = 0x300
NOFLSH = 0x80000000
+ NS_GET_MNTNS_ID = 0x4008b705
NS_GET_NSTYPE = 0x2000b703
NS_GET_OWNER_UID = 0x2000b704
NS_GET_PARENT = 0x2000b702
+ NS_GET_PID_FROM_PIDNS = 0x4004b706
+ NS_GET_PID_IN_PIDNS = 0x4004b708
+ NS_GET_TGID_FROM_PIDNS = 0x4004b707
+ NS_GET_TGID_IN_PIDNS = 0x4004b709
NS_GET_USERNS = 0x2000b701
OLCUC = 0x4
ONLCR = 0x2
@@ -230,6 +237,20 @@ const (
PPPIOCXFERUNIT = 0x2000744e
PROT_SAO = 0x10
PR_SET_PTRACER_ANY = 0xffffffff
+ PTP_CLOCK_GETCAPS = 0x40503d01
+ PTP_CLOCK_GETCAPS2 = 0x40503d0a
+ PTP_ENABLE_PPS = 0x80043d04
+ PTP_ENABLE_PPS2 = 0x80043d0d
+ PTP_EXTTS_REQUEST = 0x80103d02
+ PTP_EXTTS_REQUEST2 = 0x80103d0b
+ PTP_MASK_CLEAR_ALL = 0x20003d13
+ PTP_MASK_EN_SINGLE = 0x80043d14
+ PTP_PEROUT_REQUEST = 0x80383d03
+ PTP_PEROUT_REQUEST2 = 0x80383d0c
+ PTP_PIN_SETFUNC = 0x80603d07
+ PTP_PIN_SETFUNC2 = 0x80603d10
+ PTP_SYS_OFFSET = 0x83403d05
+ PTP_SYS_OFFSET2 = 0x83403d0e
PTRACE_GETEVRREGS = 0x14
PTRACE_GETFPREGS = 0xe
PTRACE_GETREGS64 = 0x16
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go
index f90aa728..46120db5 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go
@@ -78,6 +78,8 @@ const (
ECHOPRT = 0x20
EFD_CLOEXEC = 0x80000
EFD_NONBLOCK = 0x800
+ EPIOCGPARAMS = 0x40088a02
+ EPIOCSPARAMS = 0x80088a01
EPOLL_CLOEXEC = 0x80000
EXTPROC = 0x10000000
FF1 = 0x4000
@@ -150,9 +152,14 @@ const (
NL3 = 0x300
NLDLY = 0x300
NOFLSH = 0x80000000
+ NS_GET_MNTNS_ID = 0x4008b705
NS_GET_NSTYPE = 0x2000b703
NS_GET_OWNER_UID = 0x2000b704
NS_GET_PARENT = 0x2000b702
+ NS_GET_PID_FROM_PIDNS = 0x4004b706
+ NS_GET_PID_IN_PIDNS = 0x4004b708
+ NS_GET_TGID_FROM_PIDNS = 0x4004b707
+ NS_GET_TGID_IN_PIDNS = 0x4004b709
NS_GET_USERNS = 0x2000b701
OLCUC = 0x4
ONLCR = 0x2
@@ -230,6 +237,20 @@ const (
PPPIOCXFERUNIT = 0x2000744e
PROT_SAO = 0x10
PR_SET_PTRACER_ANY = 0xffffffffffffffff
+ PTP_CLOCK_GETCAPS = 0x40503d01
+ PTP_CLOCK_GETCAPS2 = 0x40503d0a
+ PTP_ENABLE_PPS = 0x80043d04
+ PTP_ENABLE_PPS2 = 0x80043d0d
+ PTP_EXTTS_REQUEST = 0x80103d02
+ PTP_EXTTS_REQUEST2 = 0x80103d0b
+ PTP_MASK_CLEAR_ALL = 0x20003d13
+ PTP_MASK_EN_SINGLE = 0x80043d14
+ PTP_PEROUT_REQUEST = 0x80383d03
+ PTP_PEROUT_REQUEST2 = 0x80383d0c
+ PTP_PIN_SETFUNC = 0x80603d07
+ PTP_PIN_SETFUNC2 = 0x80603d10
+ PTP_SYS_OFFSET = 0x83403d05
+ PTP_SYS_OFFSET2 = 0x83403d0e
PTRACE_GETEVRREGS = 0x14
PTRACE_GETFPREGS = 0xe
PTRACE_GETREGS64 = 0x16
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go
index ba9e0150..5c951634 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go
@@ -78,6 +78,8 @@ const (
ECHOPRT = 0x20
EFD_CLOEXEC = 0x80000
EFD_NONBLOCK = 0x800
+ EPIOCGPARAMS = 0x40088a02
+ EPIOCSPARAMS = 0x80088a01
EPOLL_CLOEXEC = 0x80000
EXTPROC = 0x10000000
FF1 = 0x4000
@@ -150,9 +152,14 @@ const (
NL3 = 0x300
NLDLY = 0x300
NOFLSH = 0x80000000
+ NS_GET_MNTNS_ID = 0x4008b705
NS_GET_NSTYPE = 0x2000b703
NS_GET_OWNER_UID = 0x2000b704
NS_GET_PARENT = 0x2000b702
+ NS_GET_PID_FROM_PIDNS = 0x4004b706
+ NS_GET_PID_IN_PIDNS = 0x4004b708
+ NS_GET_TGID_FROM_PIDNS = 0x4004b707
+ NS_GET_TGID_IN_PIDNS = 0x4004b709
NS_GET_USERNS = 0x2000b701
OLCUC = 0x4
ONLCR = 0x2
@@ -230,6 +237,20 @@ const (
PPPIOCXFERUNIT = 0x2000744e
PROT_SAO = 0x10
PR_SET_PTRACER_ANY = 0xffffffffffffffff
+ PTP_CLOCK_GETCAPS = 0x40503d01
+ PTP_CLOCK_GETCAPS2 = 0x40503d0a
+ PTP_ENABLE_PPS = 0x80043d04
+ PTP_ENABLE_PPS2 = 0x80043d0d
+ PTP_EXTTS_REQUEST = 0x80103d02
+ PTP_EXTTS_REQUEST2 = 0x80103d0b
+ PTP_MASK_CLEAR_ALL = 0x20003d13
+ PTP_MASK_EN_SINGLE = 0x80043d14
+ PTP_PEROUT_REQUEST = 0x80383d03
+ PTP_PEROUT_REQUEST2 = 0x80383d0c
+ PTP_PIN_SETFUNC = 0x80603d07
+ PTP_PIN_SETFUNC2 = 0x80603d10
+ PTP_SYS_OFFSET = 0x83403d05
+ PTP_SYS_OFFSET2 = 0x83403d0e
PTRACE_GETEVRREGS = 0x14
PTRACE_GETFPREGS = 0xe
PTRACE_GETREGS64 = 0x16
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go
index 07cdfd6e..11a84d5a 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go
@@ -78,6 +78,8 @@ const (
ECHOPRT = 0x400
EFD_CLOEXEC = 0x80000
EFD_NONBLOCK = 0x800
+ EPIOCGPARAMS = 0x80088a02
+ EPIOCSPARAMS = 0x40088a01
EPOLL_CLOEXEC = 0x80000
EXTPROC = 0x10000
FF1 = 0x8000
@@ -148,9 +150,14 @@ const (
NFDBITS = 0x40
NLDLY = 0x100
NOFLSH = 0x80
+ NS_GET_MNTNS_ID = 0x8008b705
NS_GET_NSTYPE = 0xb703
NS_GET_OWNER_UID = 0xb704
NS_GET_PARENT = 0xb702
+ NS_GET_PID_FROM_PIDNS = 0x8004b706
+ NS_GET_PID_IN_PIDNS = 0x8004b708
+ NS_GET_TGID_FROM_PIDNS = 0x8004b707
+ NS_GET_TGID_IN_PIDNS = 0x8004b709
NS_GET_USERNS = 0xb701
OLCUC = 0x2
ONLCR = 0x4
@@ -227,6 +234,20 @@ const (
PPPIOCUNBRIDGECHAN = 0x7434
PPPIOCXFERUNIT = 0x744e
PR_SET_PTRACER_ANY = 0xffffffffffffffff
+ PTP_CLOCK_GETCAPS = 0x80503d01
+ PTP_CLOCK_GETCAPS2 = 0x80503d0a
+ PTP_ENABLE_PPS = 0x40043d04
+ PTP_ENABLE_PPS2 = 0x40043d0d
+ PTP_EXTTS_REQUEST = 0x40103d02
+ PTP_EXTTS_REQUEST2 = 0x40103d0b
+ PTP_MASK_CLEAR_ALL = 0x3d13
+ PTP_MASK_EN_SINGLE = 0x40043d14
+ PTP_PEROUT_REQUEST = 0x40383d03
+ PTP_PEROUT_REQUEST2 = 0x40383d0c
+ PTP_PIN_SETFUNC = 0x40603d07
+ PTP_PIN_SETFUNC2 = 0x40603d10
+ PTP_SYS_OFFSET = 0x43403d05
+ PTP_SYS_OFFSET2 = 0x43403d0e
PTRACE_GETFDPIC = 0x21
PTRACE_GETFDPIC_EXEC = 0x0
PTRACE_GETFDPIC_INTERP = 0x1
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go
index 2f1dd214..f78c4617 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go
@@ -78,6 +78,8 @@ const (
ECHOPRT = 0x400
EFD_CLOEXEC = 0x80000
EFD_NONBLOCK = 0x800
+ EPIOCGPARAMS = 0x80088a02
+ EPIOCSPARAMS = 0x40088a01
EPOLL_CLOEXEC = 0x80000
EXTPROC = 0x10000
FF1 = 0x8000
@@ -148,9 +150,14 @@ const (
NFDBITS = 0x40
NLDLY = 0x100
NOFLSH = 0x80
+ NS_GET_MNTNS_ID = 0x8008b705
NS_GET_NSTYPE = 0xb703
NS_GET_OWNER_UID = 0xb704
NS_GET_PARENT = 0xb702
+ NS_GET_PID_FROM_PIDNS = 0x8004b706
+ NS_GET_PID_IN_PIDNS = 0x8004b708
+ NS_GET_TGID_FROM_PIDNS = 0x8004b707
+ NS_GET_TGID_IN_PIDNS = 0x8004b709
NS_GET_USERNS = 0xb701
OLCUC = 0x2
ONLCR = 0x4
@@ -227,6 +234,20 @@ const (
PPPIOCUNBRIDGECHAN = 0x7434
PPPIOCXFERUNIT = 0x744e
PR_SET_PTRACER_ANY = 0xffffffffffffffff
+ PTP_CLOCK_GETCAPS = 0x80503d01
+ PTP_CLOCK_GETCAPS2 = 0x80503d0a
+ PTP_ENABLE_PPS = 0x40043d04
+ PTP_ENABLE_PPS2 = 0x40043d0d
+ PTP_EXTTS_REQUEST = 0x40103d02
+ PTP_EXTTS_REQUEST2 = 0x40103d0b
+ PTP_MASK_CLEAR_ALL = 0x3d13
+ PTP_MASK_EN_SINGLE = 0x40043d14
+ PTP_PEROUT_REQUEST = 0x40383d03
+ PTP_PEROUT_REQUEST2 = 0x40383d0c
+ PTP_PIN_SETFUNC = 0x40603d07
+ PTP_PIN_SETFUNC2 = 0x40603d10
+ PTP_SYS_OFFSET = 0x43403d05
+ PTP_SYS_OFFSET2 = 0x43403d0e
PTRACE_DISABLE_TE = 0x5010
PTRACE_ENABLE_TE = 0x5009
PTRACE_GET_LAST_BREAK = 0x5006
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go
index f40519d9..aeb777c3 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go
@@ -82,6 +82,8 @@ const (
EFD_CLOEXEC = 0x400000
EFD_NONBLOCK = 0x4000
EMT_TAGOVF = 0x1
+ EPIOCGPARAMS = 0x40088a02
+ EPIOCSPARAMS = 0x80088a01
EPOLL_CLOEXEC = 0x400000
EXTPROC = 0x10000
FF1 = 0x8000
@@ -153,9 +155,14 @@ const (
NFDBITS = 0x40
NLDLY = 0x100
NOFLSH = 0x80
+ NS_GET_MNTNS_ID = 0x4008b705
NS_GET_NSTYPE = 0x2000b703
NS_GET_OWNER_UID = 0x2000b704
NS_GET_PARENT = 0x2000b702
+ NS_GET_PID_FROM_PIDNS = 0x4004b706
+ NS_GET_PID_IN_PIDNS = 0x4004b708
+ NS_GET_TGID_FROM_PIDNS = 0x4004b707
+ NS_GET_TGID_IN_PIDNS = 0x4004b709
NS_GET_USERNS = 0x2000b701
OLCUC = 0x2
ONLCR = 0x4
@@ -232,6 +239,20 @@ const (
PPPIOCUNBRIDGECHAN = 0x20007434
PPPIOCXFERUNIT = 0x2000744e
PR_SET_PTRACER_ANY = 0xffffffffffffffff
+ PTP_CLOCK_GETCAPS = 0x40503d01
+ PTP_CLOCK_GETCAPS2 = 0x40503d0a
+ PTP_ENABLE_PPS = 0x80043d04
+ PTP_ENABLE_PPS2 = 0x80043d0d
+ PTP_EXTTS_REQUEST = 0x80103d02
+ PTP_EXTTS_REQUEST2 = 0x80103d0b
+ PTP_MASK_CLEAR_ALL = 0x20003d13
+ PTP_MASK_EN_SINGLE = 0x80043d14
+ PTP_PEROUT_REQUEST = 0x80383d03
+ PTP_PEROUT_REQUEST2 = 0x80383d0c
+ PTP_PIN_SETFUNC = 0x80603d07
+ PTP_PIN_SETFUNC2 = 0x80603d10
+ PTP_SYS_OFFSET = 0x83403d05
+ PTP_SYS_OFFSET2 = 0x83403d0e
PTRACE_GETFPAREGS = 0x14
PTRACE_GETFPREGS = 0xe
PTRACE_GETFPREGS64 = 0x19
diff --git a/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go b/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go
index da08b2ab..1ec2b140 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go
@@ -581,6 +581,8 @@ const (
AT_EMPTY_PATH = 0x1000
AT_REMOVEDIR = 0x200
RENAME_NOREPLACE = 1 << 0
+ ST_RDONLY = 1
+ ST_NOSUID = 2
)
const (
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go
index ccb02f24..24b346e1 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go
@@ -740,6 +740,54 @@ func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func renamexNp(from string, to string, flag uint32) (err error) {
+ var _p0 *byte
+ _p0, err = BytePtrFromString(from)
+ if err != nil {
+ return
+ }
+ var _p1 *byte
+ _p1, err = BytePtrFromString(to)
+ if err != nil {
+ return
+ }
+ _, _, e1 := syscall_syscall(libc_renamex_np_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flag))
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+var libc_renamex_np_trampoline_addr uintptr
+
+//go:cgo_import_dynamic libc_renamex_np renamex_np "/usr/lib/libSystem.B.dylib"
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func renameatxNp(fromfd int, from string, tofd int, to string, flag uint32) (err error) {
+ var _p0 *byte
+ _p0, err = BytePtrFromString(from)
+ if err != nil {
+ return
+ }
+ var _p1 *byte
+ _p1, err = BytePtrFromString(to)
+ if err != nil {
+ return
+ }
+ _, _, e1 := syscall_syscall6(libc_renameatx_np_trampoline_addr, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), uintptr(flag), 0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+var libc_renameatx_np_trampoline_addr uintptr
+
+//go:cgo_import_dynamic libc_renameatx_np renameatx_np "/usr/lib/libSystem.B.dylib"
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {
var _p0 unsafe.Pointer
if len(mib) > 0 {
@@ -760,6 +808,59 @@ var libc_sysctl_trampoline_addr uintptr
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func pthread_chdir_np(path string) (err error) {
+ var _p0 *byte
+ _p0, err = BytePtrFromString(path)
+ if err != nil {
+ return
+ }
+ _, _, e1 := syscall_syscall(libc_pthread_chdir_np_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+var libc_pthread_chdir_np_trampoline_addr uintptr
+
+//go:cgo_import_dynamic libc_pthread_chdir_np pthread_chdir_np "/usr/lib/libSystem.B.dylib"
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func pthread_fchdir_np(fd int) (err error) {
+ _, _, e1 := syscall_syscall(libc_pthread_fchdir_np_trampoline_addr, uintptr(fd), 0, 0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+var libc_pthread_fchdir_np_trampoline_addr uintptr
+
+//go:cgo_import_dynamic libc_pthread_fchdir_np pthread_fchdir_np "/usr/lib/libSystem.B.dylib"
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func connectx(fd int, endpoints *SaEndpoints, associd SaeAssocID, flags uint32, iov []Iovec, n *uintptr, connid *SaeConnID) (err error) {
+ var _p0 unsafe.Pointer
+ if len(iov) > 0 {
+ _p0 = unsafe.Pointer(&iov[0])
+ } else {
+ _p0 = unsafe.Pointer(&_zero)
+ }
+ _, _, e1 := syscall_syscall9(libc_connectx_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(endpoints)), uintptr(associd), uintptr(flags), uintptr(_p0), uintptr(len(iov)), uintptr(unsafe.Pointer(n)), uintptr(unsafe.Pointer(connid)), 0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+var libc_connectx_trampoline_addr uintptr
+
+//go:cgo_import_dynamic libc_connectx connectx "/usr/lib/libSystem.B.dylib"
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) {
_, _, e1 := syscall_syscall6(libc_sendfile_trampoline_addr, uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags))
if e1 != 0 {
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s
index 8b8bb284..ebd21310 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s
+++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s
@@ -223,11 +223,36 @@ TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0
GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $8
DATA ·libc_ioctl_trampoline_addr(SB)/8, $libc_ioctl_trampoline<>(SB)
+TEXT libc_renamex_np_trampoline<>(SB),NOSPLIT,$0-0
+ JMP libc_renamex_np(SB)
+GLOBL ·libc_renamex_np_trampoline_addr(SB), RODATA, $8
+DATA ·libc_renamex_np_trampoline_addr(SB)/8, $libc_renamex_np_trampoline<>(SB)
+
+TEXT libc_renameatx_np_trampoline<>(SB),NOSPLIT,$0-0
+ JMP libc_renameatx_np(SB)
+GLOBL ·libc_renameatx_np_trampoline_addr(SB), RODATA, $8
+DATA ·libc_renameatx_np_trampoline_addr(SB)/8, $libc_renameatx_np_trampoline<>(SB)
+
TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_sysctl(SB)
GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8
DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB)
+TEXT libc_pthread_chdir_np_trampoline<>(SB),NOSPLIT,$0-0
+ JMP libc_pthread_chdir_np(SB)
+GLOBL ·libc_pthread_chdir_np_trampoline_addr(SB), RODATA, $8
+DATA ·libc_pthread_chdir_np_trampoline_addr(SB)/8, $libc_pthread_chdir_np_trampoline<>(SB)
+
+TEXT libc_pthread_fchdir_np_trampoline<>(SB),NOSPLIT,$0-0
+ JMP libc_pthread_fchdir_np(SB)
+GLOBL ·libc_pthread_fchdir_np_trampoline_addr(SB), RODATA, $8
+DATA ·libc_pthread_fchdir_np_trampoline_addr(SB)/8, $libc_pthread_fchdir_np_trampoline<>(SB)
+
+TEXT libc_connectx_trampoline<>(SB),NOSPLIT,$0-0
+ JMP libc_connectx(SB)
+GLOBL ·libc_connectx_trampoline_addr(SB), RODATA, $8
+DATA ·libc_connectx_trampoline_addr(SB)/8, $libc_connectx_trampoline<>(SB)
+
TEXT libc_sendfile_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_sendfile(SB)
GLOBL ·libc_sendfile_trampoline_addr(SB), RODATA, $8
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go
index 1b40b997..824b9c2d 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go
@@ -740,6 +740,54 @@ func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func renamexNp(from string, to string, flag uint32) (err error) {
+ var _p0 *byte
+ _p0, err = BytePtrFromString(from)
+ if err != nil {
+ return
+ }
+ var _p1 *byte
+ _p1, err = BytePtrFromString(to)
+ if err != nil {
+ return
+ }
+ _, _, e1 := syscall_syscall(libc_renamex_np_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flag))
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+var libc_renamex_np_trampoline_addr uintptr
+
+//go:cgo_import_dynamic libc_renamex_np renamex_np "/usr/lib/libSystem.B.dylib"
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func renameatxNp(fromfd int, from string, tofd int, to string, flag uint32) (err error) {
+ var _p0 *byte
+ _p0, err = BytePtrFromString(from)
+ if err != nil {
+ return
+ }
+ var _p1 *byte
+ _p1, err = BytePtrFromString(to)
+ if err != nil {
+ return
+ }
+ _, _, e1 := syscall_syscall6(libc_renameatx_np_trampoline_addr, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), uintptr(flag), 0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+var libc_renameatx_np_trampoline_addr uintptr
+
+//go:cgo_import_dynamic libc_renameatx_np renameatx_np "/usr/lib/libSystem.B.dylib"
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {
var _p0 unsafe.Pointer
if len(mib) > 0 {
@@ -760,6 +808,59 @@ var libc_sysctl_trampoline_addr uintptr
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func pthread_chdir_np(path string) (err error) {
+ var _p0 *byte
+ _p0, err = BytePtrFromString(path)
+ if err != nil {
+ return
+ }
+ _, _, e1 := syscall_syscall(libc_pthread_chdir_np_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+var libc_pthread_chdir_np_trampoline_addr uintptr
+
+//go:cgo_import_dynamic libc_pthread_chdir_np pthread_chdir_np "/usr/lib/libSystem.B.dylib"
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func pthread_fchdir_np(fd int) (err error) {
+ _, _, e1 := syscall_syscall(libc_pthread_fchdir_np_trampoline_addr, uintptr(fd), 0, 0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+var libc_pthread_fchdir_np_trampoline_addr uintptr
+
+//go:cgo_import_dynamic libc_pthread_fchdir_np pthread_fchdir_np "/usr/lib/libSystem.B.dylib"
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func connectx(fd int, endpoints *SaEndpoints, associd SaeAssocID, flags uint32, iov []Iovec, n *uintptr, connid *SaeConnID) (err error) {
+ var _p0 unsafe.Pointer
+ if len(iov) > 0 {
+ _p0 = unsafe.Pointer(&iov[0])
+ } else {
+ _p0 = unsafe.Pointer(&_zero)
+ }
+ _, _, e1 := syscall_syscall9(libc_connectx_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(endpoints)), uintptr(associd), uintptr(flags), uintptr(_p0), uintptr(len(iov)), uintptr(unsafe.Pointer(n)), uintptr(unsafe.Pointer(connid)), 0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+var libc_connectx_trampoline_addr uintptr
+
+//go:cgo_import_dynamic libc_connectx connectx "/usr/lib/libSystem.B.dylib"
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) {
_, _, e1 := syscall_syscall6(libc_sendfile_trampoline_addr, uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags))
if e1 != 0 {
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s
index 08362c1a..4f178a22 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s
+++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s
@@ -223,11 +223,36 @@ TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0
GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $8
DATA ·libc_ioctl_trampoline_addr(SB)/8, $libc_ioctl_trampoline<>(SB)
+TEXT libc_renamex_np_trampoline<>(SB),NOSPLIT,$0-0
+ JMP libc_renamex_np(SB)
+GLOBL ·libc_renamex_np_trampoline_addr(SB), RODATA, $8
+DATA ·libc_renamex_np_trampoline_addr(SB)/8, $libc_renamex_np_trampoline<>(SB)
+
+TEXT libc_renameatx_np_trampoline<>(SB),NOSPLIT,$0-0
+ JMP libc_renameatx_np(SB)
+GLOBL ·libc_renameatx_np_trampoline_addr(SB), RODATA, $8
+DATA ·libc_renameatx_np_trampoline_addr(SB)/8, $libc_renameatx_np_trampoline<>(SB)
+
TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_sysctl(SB)
GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8
DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB)
+TEXT libc_pthread_chdir_np_trampoline<>(SB),NOSPLIT,$0-0
+ JMP libc_pthread_chdir_np(SB)
+GLOBL ·libc_pthread_chdir_np_trampoline_addr(SB), RODATA, $8
+DATA ·libc_pthread_chdir_np_trampoline_addr(SB)/8, $libc_pthread_chdir_np_trampoline<>(SB)
+
+TEXT libc_pthread_fchdir_np_trampoline<>(SB),NOSPLIT,$0-0
+ JMP libc_pthread_fchdir_np(SB)
+GLOBL ·libc_pthread_fchdir_np_trampoline_addr(SB), RODATA, $8
+DATA ·libc_pthread_fchdir_np_trampoline_addr(SB)/8, $libc_pthread_fchdir_np_trampoline<>(SB)
+
+TEXT libc_connectx_trampoline<>(SB),NOSPLIT,$0-0
+ JMP libc_connectx(SB)
+GLOBL ·libc_connectx_trampoline_addr(SB), RODATA, $8
+DATA ·libc_connectx_trampoline_addr(SB)/8, $libc_connectx_trampoline<>(SB)
+
TEXT libc_sendfile_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_sendfile(SB)
GLOBL ·libc_sendfile_trampoline_addr(SB), RODATA, $8
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux.go b/vendor/golang.org/x/sys/unix/zsyscall_linux.go
index 87d8612a..5cc1e8eb 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_linux.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_linux.go
@@ -592,6 +592,16 @@ func ClockGettime(clockid int32, time *Timespec) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func ClockSettime(clockid int32, time *Timespec) (err error) {
+ _, _, e1 := Syscall(SYS_CLOCK_SETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func ClockNanosleep(clockid int32, flags int, request *Timespec, remain *Timespec) (err error) {
_, _, e1 := Syscall6(SYS_CLOCK_NANOSLEEP, uintptr(clockid), uintptr(flags), uintptr(unsafe.Pointer(request)), uintptr(unsafe.Pointer(remain)), 0, 0)
if e1 != 0 {
@@ -971,23 +981,6 @@ func Getpriority(which int, who int) (prio int, err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Getrandom(buf []byte, flags int) (n int, err error) {
- var _p0 unsafe.Pointer
- if len(buf) > 0 {
- _p0 = unsafe.Pointer(&buf[0])
- } else {
- _p0 = unsafe.Pointer(&_zero)
- }
- r0, _, e1 := Syscall(SYS_GETRANDOM, uintptr(_p0), uintptr(len(buf)), uintptr(flags))
- n = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
func Getrusage(who int, rusage *Rusage) (err error) {
_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)
if e1 != 0 {
@@ -2229,3 +2222,19 @@ func Cachestat(fd uint, crange *CachestatRange, cstat *Cachestat_t, flags uint)
}
return
}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func Mseal(b []byte, flags uint) (err error) {
+ var _p0 unsafe.Pointer
+ if len(b) > 0 {
+ _p0 = unsafe.Pointer(&b[0])
+ } else {
+ _p0 = unsafe.Pointer(&_zero)
+ }
+ _, _, e1 := Syscall(SYS_MSEAL, uintptr(_p0), uintptr(len(b)), uintptr(flags))
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go
index 9dc42410..1851df14 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go
@@ -1493,6 +1493,30 @@ var libc_mknodat_trampoline_addr uintptr
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) {
+ var _p0 *byte
+ _p0, err = BytePtrFromString(fsType)
+ if err != nil {
+ return
+ }
+ var _p1 *byte
+ _p1, err = BytePtrFromString(dir)
+ if err != nil {
+ return
+ }
+ _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+var libc_mount_trampoline_addr uintptr
+
+//go:cgo_import_dynamic libc_mount mount "libc.so"
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
_, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)
if e1 != 0 {
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s
index 41b56173..0b43c693 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s
+++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s
@@ -463,6 +463,11 @@ TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0
GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $4
DATA ·libc_mknodat_trampoline_addr(SB)/4, $libc_mknodat_trampoline<>(SB)
+TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0
+ JMP libc_mount(SB)
+GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $4
+DATA ·libc_mount_trampoline_addr(SB)/4, $libc_mount_trampoline<>(SB)
+
TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_nanosleep(SB)
GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $4
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go
index 0d3a0751..e1ec0dbe 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go
@@ -1493,6 +1493,30 @@ var libc_mknodat_trampoline_addr uintptr
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) {
+ var _p0 *byte
+ _p0, err = BytePtrFromString(fsType)
+ if err != nil {
+ return
+ }
+ var _p1 *byte
+ _p1, err = BytePtrFromString(dir)
+ if err != nil {
+ return
+ }
+ _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+var libc_mount_trampoline_addr uintptr
+
+//go:cgo_import_dynamic libc_mount mount "libc.so"
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
_, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)
if e1 != 0 {
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s
index 4019a656..880c6d6e 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s
+++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s
@@ -463,6 +463,11 @@ TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0
GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $8
DATA ·libc_mknodat_trampoline_addr(SB)/8, $libc_mknodat_trampoline<>(SB)
+TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0
+ JMP libc_mount(SB)
+GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $8
+DATA ·libc_mount_trampoline_addr(SB)/8, $libc_mount_trampoline<>(SB)
+
TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_nanosleep(SB)
GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $8
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go
index c39f7776..7c8452a6 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go
@@ -1493,6 +1493,30 @@ var libc_mknodat_trampoline_addr uintptr
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) {
+ var _p0 *byte
+ _p0, err = BytePtrFromString(fsType)
+ if err != nil {
+ return
+ }
+ var _p1 *byte
+ _p1, err = BytePtrFromString(dir)
+ if err != nil {
+ return
+ }
+ _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+var libc_mount_trampoline_addr uintptr
+
+//go:cgo_import_dynamic libc_mount mount "libc.so"
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
_, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)
if e1 != 0 {
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s
index ac4af24f..b8ef95b0 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s
+++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s
@@ -463,6 +463,11 @@ TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0
GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $4
DATA ·libc_mknodat_trampoline_addr(SB)/4, $libc_mknodat_trampoline<>(SB)
+TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0
+ JMP libc_mount(SB)
+GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $4
+DATA ·libc_mount_trampoline_addr(SB)/4, $libc_mount_trampoline<>(SB)
+
TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_nanosleep(SB)
GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $4
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go
index 57571d07..2ffdf861 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go
@@ -1493,6 +1493,30 @@ var libc_mknodat_trampoline_addr uintptr
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) {
+ var _p0 *byte
+ _p0, err = BytePtrFromString(fsType)
+ if err != nil {
+ return
+ }
+ var _p1 *byte
+ _p1, err = BytePtrFromString(dir)
+ if err != nil {
+ return
+ }
+ _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+var libc_mount_trampoline_addr uintptr
+
+//go:cgo_import_dynamic libc_mount mount "libc.so"
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
_, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)
if e1 != 0 {
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s
index f77d5321..2af3b5c7 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s
+++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s
@@ -463,6 +463,11 @@ TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0
GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $8
DATA ·libc_mknodat_trampoline_addr(SB)/8, $libc_mknodat_trampoline<>(SB)
+TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0
+ JMP libc_mount(SB)
+GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $8
+DATA ·libc_mount_trampoline_addr(SB)/8, $libc_mount_trampoline<>(SB)
+
TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_nanosleep(SB)
GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $8
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go
index e62963e6..1da08d52 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go
@@ -1493,6 +1493,30 @@ var libc_mknodat_trampoline_addr uintptr
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) {
+ var _p0 *byte
+ _p0, err = BytePtrFromString(fsType)
+ if err != nil {
+ return
+ }
+ var _p1 *byte
+ _p1, err = BytePtrFromString(dir)
+ if err != nil {
+ return
+ }
+ _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+var libc_mount_trampoline_addr uintptr
+
+//go:cgo_import_dynamic libc_mount mount "libc.so"
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
_, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)
if e1 != 0 {
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s
index fae140b6..b7a25135 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s
+++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s
@@ -463,6 +463,11 @@ TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0
GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $8
DATA ·libc_mknodat_trampoline_addr(SB)/8, $libc_mknodat_trampoline<>(SB)
+TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0
+ JMP libc_mount(SB)
+GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $8
+DATA ·libc_mount_trampoline_addr(SB)/8, $libc_mount_trampoline<>(SB)
+
TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_nanosleep(SB)
GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $8
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go
index 00831354..6e85b0aa 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go
@@ -1493,6 +1493,30 @@ var libc_mknodat_trampoline_addr uintptr
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) {
+ var _p0 *byte
+ _p0, err = BytePtrFromString(fsType)
+ if err != nil {
+ return
+ }
+ var _p1 *byte
+ _p1, err = BytePtrFromString(dir)
+ if err != nil {
+ return
+ }
+ _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+var libc_mount_trampoline_addr uintptr
+
+//go:cgo_import_dynamic libc_mount mount "libc.so"
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
_, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)
if e1 != 0 {
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s
index 9d1e0ff0..f15dadf0 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s
+++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s
@@ -555,6 +555,12 @@ TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0
GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $8
DATA ·libc_mknodat_trampoline_addr(SB)/8, $libc_mknodat_trampoline<>(SB)
+TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0
+ CALL libc_mount(SB)
+ RET
+GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $8
+DATA ·libc_mount_trampoline_addr(SB)/8, $libc_mount_trampoline<>(SB)
+
TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0
CALL libc_nanosleep(SB)
RET
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go
index 79029ed5..28b487df 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go
@@ -1493,6 +1493,30 @@ var libc_mknodat_trampoline_addr uintptr
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) {
+ var _p0 *byte
+ _p0, err = BytePtrFromString(fsType)
+ if err != nil {
+ return
+ }
+ var _p1 *byte
+ _p1, err = BytePtrFromString(dir)
+ if err != nil {
+ return
+ }
+ _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+var libc_mount_trampoline_addr uintptr
+
+//go:cgo_import_dynamic libc_mount mount "libc.so"
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
_, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)
if e1 != 0 {
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s
index da115f9a..1e7f321e 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s
+++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s
@@ -463,6 +463,11 @@ TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0
GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $8
DATA ·libc_mknodat_trampoline_addr(SB)/8, $libc_mknodat_trampoline<>(SB)
+TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0
+ JMP libc_mount(SB)
+GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $8
+DATA ·libc_mount_trampoline_addr(SB)/8, $libc_mount_trampoline<>(SB)
+
TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_nanosleep(SB)
GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $8
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go
index 53aef5dc..524b0820 100644
--- a/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go
+++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go
@@ -457,4 +457,5 @@ const (
SYS_LSM_GET_SELF_ATTR = 459
SYS_LSM_SET_SELF_ATTR = 460
SYS_LSM_LIST_MODULES = 461
+ SYS_MSEAL = 462
)
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go
index 71d52476..f485dbf4 100644
--- a/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go
+++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go
@@ -341,6 +341,7 @@ const (
SYS_STATX = 332
SYS_IO_PGETEVENTS = 333
SYS_RSEQ = 334
+ SYS_URETPROBE = 335
SYS_PIDFD_SEND_SIGNAL = 424
SYS_IO_URING_SETUP = 425
SYS_IO_URING_ENTER = 426
@@ -379,4 +380,5 @@ const (
SYS_LSM_GET_SELF_ATTR = 459
SYS_LSM_SET_SELF_ATTR = 460
SYS_LSM_LIST_MODULES = 461
+ SYS_MSEAL = 462
)
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go
index c7477061..70b35bf3 100644
--- a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go
+++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go
@@ -421,4 +421,5 @@ const (
SYS_LSM_GET_SELF_ATTR = 459
SYS_LSM_SET_SELF_ATTR = 460
SYS_LSM_LIST_MODULES = 461
+ SYS_MSEAL = 462
)
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go
index f96e214f..1893e2fe 100644
--- a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go
+++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go
@@ -85,7 +85,7 @@ const (
SYS_SPLICE = 76
SYS_TEE = 77
SYS_READLINKAT = 78
- SYS_FSTATAT = 79
+ SYS_NEWFSTATAT = 79
SYS_FSTAT = 80
SYS_SYNC = 81
SYS_FSYNC = 82
@@ -324,4 +324,5 @@ const (
SYS_LSM_GET_SELF_ATTR = 459
SYS_LSM_SET_SELF_ATTR = 460
SYS_LSM_LIST_MODULES = 461
+ SYS_MSEAL = 462
)
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go
index 28425346..16a4017d 100644
--- a/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go
+++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go
@@ -84,6 +84,8 @@ const (
SYS_SPLICE = 76
SYS_TEE = 77
SYS_READLINKAT = 78
+ SYS_NEWFSTATAT = 79
+ SYS_FSTAT = 80
SYS_SYNC = 81
SYS_FSYNC = 82
SYS_FDATASYNC = 83
@@ -318,4 +320,5 @@ const (
SYS_LSM_GET_SELF_ATTR = 459
SYS_LSM_SET_SELF_ATTR = 460
SYS_LSM_LIST_MODULES = 461
+ SYS_MSEAL = 462
)
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go
index d0953018..7e567f1e 100644
--- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go
+++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go
@@ -441,4 +441,5 @@ const (
SYS_LSM_GET_SELF_ATTR = 4459
SYS_LSM_SET_SELF_ATTR = 4460
SYS_LSM_LIST_MODULES = 4461
+ SYS_MSEAL = 4462
)
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go
index 295c7f4b..38ae55e5 100644
--- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go
+++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go
@@ -371,4 +371,5 @@ const (
SYS_LSM_GET_SELF_ATTR = 5459
SYS_LSM_SET_SELF_ATTR = 5460
SYS_LSM_LIST_MODULES = 5461
+ SYS_MSEAL = 5462
)
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go
index d1a9eaca..55e92e60 100644
--- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go
+++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go
@@ -371,4 +371,5 @@ const (
SYS_LSM_GET_SELF_ATTR = 5459
SYS_LSM_SET_SELF_ATTR = 5460
SYS_LSM_LIST_MODULES = 5461
+ SYS_MSEAL = 5462
)
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go
index bec157c3..60658d6a 100644
--- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go
+++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go
@@ -441,4 +441,5 @@ const (
SYS_LSM_GET_SELF_ATTR = 4459
SYS_LSM_SET_SELF_ATTR = 4460
SYS_LSM_LIST_MODULES = 4461
+ SYS_MSEAL = 4462
)
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go
index 7ee7bdc4..e203e8a7 100644
--- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go
+++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go
@@ -448,4 +448,5 @@ const (
SYS_LSM_GET_SELF_ATTR = 459
SYS_LSM_SET_SELF_ATTR = 460
SYS_LSM_LIST_MODULES = 461
+ SYS_MSEAL = 462
)
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go
index fad1f25b..5944b97d 100644
--- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go
+++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go
@@ -420,4 +420,5 @@ const (
SYS_LSM_GET_SELF_ATTR = 459
SYS_LSM_SET_SELF_ATTR = 460
SYS_LSM_LIST_MODULES = 461
+ SYS_MSEAL = 462
)
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go
index 7d3e1635..c66d416d 100644
--- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go
+++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go
@@ -420,4 +420,5 @@ const (
SYS_LSM_GET_SELF_ATTR = 459
SYS_LSM_SET_SELF_ATTR = 460
SYS_LSM_LIST_MODULES = 461
+ SYS_MSEAL = 462
)
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go
index 0ed53ad9..a5459e76 100644
--- a/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go
+++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go
@@ -84,7 +84,7 @@ const (
SYS_SPLICE = 76
SYS_TEE = 77
SYS_READLINKAT = 78
- SYS_FSTATAT = 79
+ SYS_NEWFSTATAT = 79
SYS_FSTAT = 80
SYS_SYNC = 81
SYS_FSYNC = 82
@@ -325,4 +325,5 @@ const (
SYS_LSM_GET_SELF_ATTR = 459
SYS_LSM_SET_SELF_ATTR = 460
SYS_LSM_LIST_MODULES = 461
+ SYS_MSEAL = 462
)
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go
index 2fba04ad..01d86825 100644
--- a/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go
+++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go
@@ -386,4 +386,5 @@ const (
SYS_LSM_GET_SELF_ATTR = 459
SYS_LSM_SET_SELF_ATTR = 460
SYS_LSM_LIST_MODULES = 461
+ SYS_MSEAL = 462
)
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go
index 621d00d7..7b703e77 100644
--- a/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go
+++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go
@@ -399,4 +399,5 @@ const (
SYS_LSM_GET_SELF_ATTR = 459
SYS_LSM_SET_SELF_ATTR = 460
SYS_LSM_LIST_MODULES = 461
+ SYS_MSEAL = 462
)
diff --git a/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go
index 091d107f..d003c3d4 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go
@@ -306,6 +306,19 @@ type XVSockPgen struct {
type _Socklen uint32
+type SaeAssocID uint32
+
+type SaeConnID uint32
+
+type SaEndpoints struct {
+ Srcif uint32
+ Srcaddr *RawSockaddr
+ Srcaddrlen uint32
+ Dstaddr *RawSockaddr
+ Dstaddrlen uint32
+ _ [4]byte
+}
+
type Xucred struct {
Version uint32
Uid uint32
diff --git a/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go
index 28ff4ef7..0d45a941 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go
@@ -306,6 +306,19 @@ type XVSockPgen struct {
type _Socklen uint32
+type SaeAssocID uint32
+
+type SaeConnID uint32
+
+type SaEndpoints struct {
+ Srcif uint32
+ Srcaddr *RawSockaddr
+ Srcaddrlen uint32
+ Dstaddr *RawSockaddr
+ Dstaddrlen uint32
+ _ [4]byte
+}
+
type Xucred struct {
Version uint32
Uid uint32
diff --git a/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go b/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go
index 6cbd094a..51e13eb0 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go
@@ -625,6 +625,7 @@ const (
POLLRDNORM = 0x40
POLLWRBAND = 0x100
POLLWRNORM = 0x4
+ POLLRDHUP = 0x4000
)
type CapRights struct {
diff --git a/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go
index 7c03b6ee..d002d8ef 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go
@@ -630,6 +630,7 @@ const (
POLLRDNORM = 0x40
POLLWRBAND = 0x100
POLLWRNORM = 0x4
+ POLLRDHUP = 0x4000
)
type CapRights struct {
diff --git a/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go b/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go
index 422107ee..3f863d89 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go
@@ -616,6 +616,7 @@ const (
POLLRDNORM = 0x40
POLLWRBAND = 0x100
POLLWRNORM = 0x4
+ POLLRDHUP = 0x4000
)
type CapRights struct {
diff --git a/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go
index 505a12ac..61c72931 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go
@@ -610,6 +610,7 @@ const (
POLLRDNORM = 0x40
POLLWRBAND = 0x100
POLLWRNORM = 0x4
+ POLLRDHUP = 0x4000
)
type CapRights struct {
diff --git a/vendor/golang.org/x/sys/unix/ztypes_freebsd_riscv64.go b/vendor/golang.org/x/sys/unix/ztypes_freebsd_riscv64.go
index cc986c79..b5d17414 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_freebsd_riscv64.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_freebsd_riscv64.go
@@ -612,6 +612,7 @@ const (
POLLRDNORM = 0x40
POLLWRBAND = 0x100
POLLWRNORM = 0x4
+ POLLRDHUP = 0x4000
)
type CapRights struct {
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux.go b/vendor/golang.org/x/sys/unix/ztypes_linux.go
index 4740b834..8daaf3fa 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_linux.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_linux.go
@@ -87,30 +87,35 @@ type StatxTimestamp struct {
}
type Statx_t struct {
- Mask uint32
- Blksize uint32
- Attributes uint64
- Nlink uint32
- Uid uint32
- Gid uint32
- Mode uint16
- _ [1]uint16
- Ino uint64
- Size uint64
- Blocks uint64
- Attributes_mask uint64
- Atime StatxTimestamp
- Btime StatxTimestamp
- Ctime StatxTimestamp
- Mtime StatxTimestamp
- Rdev_major uint32
- Rdev_minor uint32
- Dev_major uint32
- Dev_minor uint32
- Mnt_id uint64
- Dio_mem_align uint32
- Dio_offset_align uint32
- _ [12]uint64
+ Mask uint32
+ Blksize uint32
+ Attributes uint64
+ Nlink uint32
+ Uid uint32
+ Gid uint32
+ Mode uint16
+ _ [1]uint16
+ Ino uint64
+ Size uint64
+ Blocks uint64
+ Attributes_mask uint64
+ Atime StatxTimestamp
+ Btime StatxTimestamp
+ Ctime StatxTimestamp
+ Mtime StatxTimestamp
+ Rdev_major uint32
+ Rdev_minor uint32
+ Dev_major uint32
+ Dev_minor uint32
+ Mnt_id uint64
+ Dio_mem_align uint32
+ Dio_offset_align uint32
+ Subvol uint64
+ Atomic_write_unit_min uint32
+ Atomic_write_unit_max uint32
+ Atomic_write_segments_max uint32
+ _ [1]uint32
+ _ [9]uint64
}
type Fsid struct {
@@ -515,6 +520,29 @@ type TCPInfo struct {
Total_rto_time uint32
}
+type TCPVegasInfo struct {
+ Enabled uint32
+ Rttcnt uint32
+ Rtt uint32
+ Minrtt uint32
+}
+
+type TCPDCTCPInfo struct {
+ Enabled uint16
+ Ce_state uint16
+ Alpha uint32
+ Ab_ecn uint32
+ Ab_tot uint32
+}
+
+type TCPBBRInfo struct {
+ Bw_lo uint32
+ Bw_hi uint32
+ Min_rtt uint32
+ Pacing_gain uint32
+ Cwnd_gain uint32
+}
+
type CanFilter struct {
Id uint32
Mask uint32
@@ -556,6 +584,7 @@ const (
SizeofICMPv6Filter = 0x20
SizeofUcred = 0xc
SizeofTCPInfo = 0xf8
+ SizeofTCPCCInfo = 0x14
SizeofCanFilter = 0x8
SizeofTCPRepairOpt = 0x8
)
@@ -1723,12 +1752,6 @@ const (
IFLA_IPVLAN_UNSPEC = 0x0
IFLA_IPVLAN_MODE = 0x1
IFLA_IPVLAN_FLAGS = 0x2
- NETKIT_NEXT = -0x1
- NETKIT_PASS = 0x0
- NETKIT_DROP = 0x2
- NETKIT_REDIRECT = 0x7
- NETKIT_L2 = 0x0
- NETKIT_L3 = 0x1
IFLA_NETKIT_UNSPEC = 0x0
IFLA_NETKIT_PEER_INFO = 0x1
IFLA_NETKIT_PRIMARY = 0x2
@@ -1767,6 +1790,7 @@ const (
IFLA_VXLAN_DF = 0x1d
IFLA_VXLAN_VNIFILTER = 0x1e
IFLA_VXLAN_LOCALBYPASS = 0x1f
+ IFLA_VXLAN_LABEL_POLICY = 0x20
IFLA_GENEVE_UNSPEC = 0x0
IFLA_GENEVE_ID = 0x1
IFLA_GENEVE_REMOTE = 0x2
@@ -1796,6 +1820,8 @@ const (
IFLA_GTP_ROLE = 0x4
IFLA_GTP_CREATE_SOCKETS = 0x5
IFLA_GTP_RESTART_COUNT = 0x6
+ IFLA_GTP_LOCAL = 0x7
+ IFLA_GTP_LOCAL6 = 0x8
IFLA_BOND_UNSPEC = 0x0
IFLA_BOND_MODE = 0x1
IFLA_BOND_ACTIVE_SLAVE = 0x2
@@ -1828,6 +1854,7 @@ const (
IFLA_BOND_AD_LACP_ACTIVE = 0x1d
IFLA_BOND_MISSED_MAX = 0x1e
IFLA_BOND_NS_IP6_TARGET = 0x1f
+ IFLA_BOND_COUPLED_CONTROL = 0x20
IFLA_BOND_AD_INFO_UNSPEC = 0x0
IFLA_BOND_AD_INFO_AGGREGATOR = 0x1
IFLA_BOND_AD_INFO_NUM_PORTS = 0x2
@@ -1896,6 +1923,7 @@ const (
IFLA_HSR_SEQ_NR = 0x5
IFLA_HSR_VERSION = 0x6
IFLA_HSR_PROTOCOL = 0x7
+ IFLA_HSR_INTERLINK = 0x8
IFLA_STATS_UNSPEC = 0x0
IFLA_STATS_LINK_64 = 0x1
IFLA_STATS_LINK_XSTATS = 0x2
@@ -1948,6 +1976,15 @@ const (
IFLA_DSA_MASTER = 0x1
)
+const (
+ NETKIT_NEXT = -0x1
+ NETKIT_PASS = 0x0
+ NETKIT_DROP = 0x2
+ NETKIT_REDIRECT = 0x7
+ NETKIT_L2 = 0x0
+ NETKIT_L3 = 0x1
+)
+
const (
NF_INET_PRE_ROUTING = 0x0
NF_INET_LOCAL_IN = 0x1
@@ -2485,7 +2522,7 @@ type XDPMmapOffsets struct {
type XDPUmemReg struct {
Addr uint64
Len uint64
- Chunk_size uint32
+ Size uint32
Headroom uint32
Flags uint32
Tx_metadata_len uint32
@@ -3473,7 +3510,7 @@ const (
DEVLINK_PORT_FN_ATTR_STATE = 0x2
DEVLINK_PORT_FN_ATTR_OPSTATE = 0x3
DEVLINK_PORT_FN_ATTR_CAPS = 0x4
- DEVLINK_PORT_FUNCTION_ATTR_MAX = 0x5
+ DEVLINK_PORT_FUNCTION_ATTR_MAX = 0x6
)
type FsverityDigest struct {
@@ -3765,7 +3802,7 @@ const (
ETHTOOL_MSG_PSE_GET = 0x24
ETHTOOL_MSG_PSE_SET = 0x25
ETHTOOL_MSG_RSS_GET = 0x26
- ETHTOOL_MSG_USER_MAX = 0x2b
+ ETHTOOL_MSG_USER_MAX = 0x2c
ETHTOOL_MSG_KERNEL_NONE = 0x0
ETHTOOL_MSG_STRSET_GET_REPLY = 0x1
ETHTOOL_MSG_LINKINFO_GET_REPLY = 0x2
@@ -3805,7 +3842,10 @@ const (
ETHTOOL_MSG_MODULE_NTF = 0x24
ETHTOOL_MSG_PSE_GET_REPLY = 0x25
ETHTOOL_MSG_RSS_GET_REPLY = 0x26
- ETHTOOL_MSG_KERNEL_MAX = 0x2b
+ ETHTOOL_MSG_KERNEL_MAX = 0x2c
+ ETHTOOL_FLAG_COMPACT_BITSETS = 0x1
+ ETHTOOL_FLAG_OMIT_REPLY = 0x2
+ ETHTOOL_FLAG_STATS = 0x4
ETHTOOL_A_HEADER_UNSPEC = 0x0
ETHTOOL_A_HEADER_DEV_INDEX = 0x1
ETHTOOL_A_HEADER_DEV_NAME = 0x2
@@ -3947,7 +3987,7 @@ const (
ETHTOOL_A_COALESCE_RATE_SAMPLE_INTERVAL = 0x17
ETHTOOL_A_COALESCE_USE_CQE_MODE_TX = 0x18
ETHTOOL_A_COALESCE_USE_CQE_MODE_RX = 0x19
- ETHTOOL_A_COALESCE_MAX = 0x1c
+ ETHTOOL_A_COALESCE_MAX = 0x1e
ETHTOOL_A_PAUSE_UNSPEC = 0x0
ETHTOOL_A_PAUSE_HEADER = 0x1
ETHTOOL_A_PAUSE_AUTONEG = 0x2
@@ -3975,7 +4015,7 @@ const (
ETHTOOL_A_TSINFO_TX_TYPES = 0x3
ETHTOOL_A_TSINFO_RX_FILTERS = 0x4
ETHTOOL_A_TSINFO_PHC_INDEX = 0x5
- ETHTOOL_A_TSINFO_MAX = 0x5
+ ETHTOOL_A_TSINFO_MAX = 0x6
ETHTOOL_A_CABLE_TEST_UNSPEC = 0x0
ETHTOOL_A_CABLE_TEST_HEADER = 0x1
ETHTOOL_A_CABLE_TEST_MAX = 0x1
@@ -4078,6 +4118,106 @@ type EthtoolDrvinfo struct {
Regdump_len uint32
}
+type EthtoolTsInfo struct {
+ Cmd uint32
+ So_timestamping uint32
+ Phc_index int32
+ Tx_types uint32
+ Tx_reserved [3]uint32
+ Rx_filters uint32
+ Rx_reserved [3]uint32
+}
+
+type HwTstampConfig struct {
+ Flags int32
+ Tx_type int32
+ Rx_filter int32
+}
+
+const (
+ HWTSTAMP_FILTER_NONE = 0x0
+ HWTSTAMP_FILTER_ALL = 0x1
+ HWTSTAMP_FILTER_SOME = 0x2
+ HWTSTAMP_FILTER_PTP_V1_L4_EVENT = 0x3
+ HWTSTAMP_FILTER_PTP_V2_L4_EVENT = 0x6
+ HWTSTAMP_FILTER_PTP_V2_L2_EVENT = 0x9
+ HWTSTAMP_FILTER_PTP_V2_EVENT = 0xc
+)
+
+const (
+ HWTSTAMP_TX_OFF = 0x0
+ HWTSTAMP_TX_ON = 0x1
+ HWTSTAMP_TX_ONESTEP_SYNC = 0x2
+)
+
+type (
+ PtpClockCaps struct {
+ Max_adj int32
+ N_alarm int32
+ N_ext_ts int32
+ N_per_out int32
+ Pps int32
+ N_pins int32
+ Cross_timestamping int32
+ Adjust_phase int32
+ Max_phase_adj int32
+ Rsv [11]int32
+ }
+ PtpClockTime struct {
+ Sec int64
+ Nsec uint32
+ Reserved uint32
+ }
+ PtpExttsEvent struct {
+ T PtpClockTime
+ Index uint32
+ Flags uint32
+ Rsv [2]uint32
+ }
+ PtpExttsRequest struct {
+ Index uint32
+ Flags uint32
+ Rsv [2]uint32
+ }
+ PtpPeroutRequest struct {
+ StartOrPhase PtpClockTime
+ Period PtpClockTime
+ Index uint32
+ Flags uint32
+ On PtpClockTime
+ }
+ PtpPinDesc struct {
+ Name [64]byte
+ Index uint32
+ Func uint32
+ Chan uint32
+ Rsv [5]uint32
+ }
+ PtpSysOffset struct {
+ Samples uint32
+ Rsv [3]uint32
+ Ts [51]PtpClockTime
+ }
+ PtpSysOffsetExtended struct {
+ Samples uint32
+ Rsv [3]uint32
+ Ts [25][3]PtpClockTime
+ }
+ PtpSysOffsetPrecise struct {
+ Device PtpClockTime
+ Realtime PtpClockTime
+ Monoraw PtpClockTime
+ Rsv [4]uint32
+ }
+)
+
+const (
+ PTP_PF_NONE = 0x0
+ PTP_PF_EXTTS = 0x1
+ PTP_PF_PEROUT = 0x2
+ PTP_PF_PHYSYNC = 0x3
+)
+
type (
HIDRawReportDescriptor struct {
Size uint32
@@ -4605,7 +4745,7 @@ const (
NL80211_ATTR_MAC_HINT = 0xc8
NL80211_ATTR_MAC_MASK = 0xd7
NL80211_ATTR_MAX_AP_ASSOC_STA = 0xca
- NL80211_ATTR_MAX = 0x14a
+ NL80211_ATTR_MAX = 0x14c
NL80211_ATTR_MAX_CRIT_PROT_DURATION = 0xb4
NL80211_ATTR_MAX_CSA_COUNTERS = 0xce
NL80211_ATTR_MAX_MATCH_SETS = 0x85
@@ -5209,7 +5349,7 @@ const (
NL80211_FREQUENCY_ATTR_GO_CONCURRENT = 0xf
NL80211_FREQUENCY_ATTR_INDOOR_ONLY = 0xe
NL80211_FREQUENCY_ATTR_IR_CONCURRENT = 0xf
- NL80211_FREQUENCY_ATTR_MAX = 0x20
+ NL80211_FREQUENCY_ATTR_MAX = 0x21
NL80211_FREQUENCY_ATTR_MAX_TX_POWER = 0x6
NL80211_FREQUENCY_ATTR_NO_10MHZ = 0x11
NL80211_FREQUENCY_ATTR_NO_160MHZ = 0xc
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go
index 15adc041..ad05b51a 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go
@@ -727,6 +727,37 @@ const (
RISCV_HWPROBE_EXT_ZBA = 0x8
RISCV_HWPROBE_EXT_ZBB = 0x10
RISCV_HWPROBE_EXT_ZBS = 0x20
+ RISCV_HWPROBE_EXT_ZICBOZ = 0x40
+ RISCV_HWPROBE_EXT_ZBC = 0x80
+ RISCV_HWPROBE_EXT_ZBKB = 0x100
+ RISCV_HWPROBE_EXT_ZBKC = 0x200
+ RISCV_HWPROBE_EXT_ZBKX = 0x400
+ RISCV_HWPROBE_EXT_ZKND = 0x800
+ RISCV_HWPROBE_EXT_ZKNE = 0x1000
+ RISCV_HWPROBE_EXT_ZKNH = 0x2000
+ RISCV_HWPROBE_EXT_ZKSED = 0x4000
+ RISCV_HWPROBE_EXT_ZKSH = 0x8000
+ RISCV_HWPROBE_EXT_ZKT = 0x10000
+ RISCV_HWPROBE_EXT_ZVBB = 0x20000
+ RISCV_HWPROBE_EXT_ZVBC = 0x40000
+ RISCV_HWPROBE_EXT_ZVKB = 0x80000
+ RISCV_HWPROBE_EXT_ZVKG = 0x100000
+ RISCV_HWPROBE_EXT_ZVKNED = 0x200000
+ RISCV_HWPROBE_EXT_ZVKNHA = 0x400000
+ RISCV_HWPROBE_EXT_ZVKNHB = 0x800000
+ RISCV_HWPROBE_EXT_ZVKSED = 0x1000000
+ RISCV_HWPROBE_EXT_ZVKSH = 0x2000000
+ RISCV_HWPROBE_EXT_ZVKT = 0x4000000
+ RISCV_HWPROBE_EXT_ZFH = 0x8000000
+ RISCV_HWPROBE_EXT_ZFHMIN = 0x10000000
+ RISCV_HWPROBE_EXT_ZIHINTNTL = 0x20000000
+ RISCV_HWPROBE_EXT_ZVFH = 0x40000000
+ RISCV_HWPROBE_EXT_ZVFHMIN = 0x80000000
+ RISCV_HWPROBE_EXT_ZFA = 0x100000000
+ RISCV_HWPROBE_EXT_ZTSO = 0x200000000
+ RISCV_HWPROBE_EXT_ZACAS = 0x400000000
+ RISCV_HWPROBE_EXT_ZICOND = 0x800000000
+ RISCV_HWPROBE_EXT_ZIHINTPAUSE = 0x1000000000
RISCV_HWPROBE_KEY_CPUPERF_0 = 0x5
RISCV_HWPROBE_MISALIGNED_UNKNOWN = 0x0
RISCV_HWPROBE_MISALIGNED_EMULATED = 0x1
@@ -734,4 +765,6 @@ const (
RISCV_HWPROBE_MISALIGNED_FAST = 0x3
RISCV_HWPROBE_MISALIGNED_UNSUPPORTED = 0x4
RISCV_HWPROBE_MISALIGNED_MASK = 0x7
+ RISCV_HWPROBE_KEY_ZICBOZ_BLOCK_SIZE = 0x6
+ RISCV_HWPROBE_WHICH_CPUS = 0x1
)
diff --git a/vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go b/vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go
index d9a13af4..2e5d5a44 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go
@@ -377,6 +377,12 @@ type Flock_t struct {
Pid int32
}
+type F_cnvrt struct {
+ Cvtcmd int32
+ Pccsid int16
+ Fccsid int16
+}
+
type Termios struct {
Cflag uint32
Iflag uint32
diff --git a/vendor/golang.org/x/sys/windows/dll_windows.go b/vendor/golang.org/x/sys/windows/dll_windows.go
index 115341fb..4e613cf6 100644
--- a/vendor/golang.org/x/sys/windows/dll_windows.go
+++ b/vendor/golang.org/x/sys/windows/dll_windows.go
@@ -65,7 +65,7 @@ func LoadDLL(name string) (dll *DLL, err error) {
return d, nil
}
-// MustLoadDLL is like LoadDLL but panics if load operation failes.
+// MustLoadDLL is like LoadDLL but panics if load operation fails.
func MustLoadDLL(name string) *DLL {
d, e := LoadDLL(name)
if e != nil {
diff --git a/vendor/golang.org/x/sys/windows/registry/key.go b/vendor/golang.org/x/sys/windows/registry/key.go
new file mode 100644
index 00000000..fd863244
--- /dev/null
+++ b/vendor/golang.org/x/sys/windows/registry/key.go
@@ -0,0 +1,205 @@
+// Copyright 2015 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build windows
+
+// Package registry provides access to the Windows registry.
+//
+// Here is a simple example, opening a registry key and reading a string value from it.
+//
+// k, err := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\Microsoft\Windows NT\CurrentVersion`, registry.QUERY_VALUE)
+// if err != nil {
+// log.Fatal(err)
+// }
+// defer k.Close()
+//
+// s, _, err := k.GetStringValue("SystemRoot")
+// if err != nil {
+// log.Fatal(err)
+// }
+// fmt.Printf("Windows system root is %q\n", s)
+package registry
+
+import (
+ "io"
+ "runtime"
+ "syscall"
+ "time"
+)
+
+const (
+ // Registry key security and access rights.
+ // See https://msdn.microsoft.com/en-us/library/windows/desktop/ms724878.aspx
+ // for details.
+ ALL_ACCESS = 0xf003f
+ CREATE_LINK = 0x00020
+ CREATE_SUB_KEY = 0x00004
+ ENUMERATE_SUB_KEYS = 0x00008
+ EXECUTE = 0x20019
+ NOTIFY = 0x00010
+ QUERY_VALUE = 0x00001
+ READ = 0x20019
+ SET_VALUE = 0x00002
+ WOW64_32KEY = 0x00200
+ WOW64_64KEY = 0x00100
+ WRITE = 0x20006
+)
+
+// Key is a handle to an open Windows registry key.
+// Keys can be obtained by calling OpenKey; there are
+// also some predefined root keys such as CURRENT_USER.
+// Keys can be used directly in the Windows API.
+type Key syscall.Handle
+
+const (
+ // Windows defines some predefined root keys that are always open.
+ // An application can use these keys as entry points to the registry.
+ // Normally these keys are used in OpenKey to open new keys,
+ // but they can also be used anywhere a Key is required.
+ CLASSES_ROOT = Key(syscall.HKEY_CLASSES_ROOT)
+ CURRENT_USER = Key(syscall.HKEY_CURRENT_USER)
+ LOCAL_MACHINE = Key(syscall.HKEY_LOCAL_MACHINE)
+ USERS = Key(syscall.HKEY_USERS)
+ CURRENT_CONFIG = Key(syscall.HKEY_CURRENT_CONFIG)
+ PERFORMANCE_DATA = Key(syscall.HKEY_PERFORMANCE_DATA)
+)
+
+// Close closes open key k.
+func (k Key) Close() error {
+ return syscall.RegCloseKey(syscall.Handle(k))
+}
+
+// OpenKey opens a new key with path name relative to key k.
+// It accepts any open key, including CURRENT_USER and others,
+// and returns the new key and an error.
+// The access parameter specifies desired access rights to the
+// key to be opened.
+func OpenKey(k Key, path string, access uint32) (Key, error) {
+ p, err := syscall.UTF16PtrFromString(path)
+ if err != nil {
+ return 0, err
+ }
+ var subkey syscall.Handle
+ err = syscall.RegOpenKeyEx(syscall.Handle(k), p, 0, access, &subkey)
+ if err != nil {
+ return 0, err
+ }
+ return Key(subkey), nil
+}
+
+// OpenRemoteKey opens a predefined registry key on another
+// computer pcname. The key to be opened is specified by k, but
+// can only be one of LOCAL_MACHINE, PERFORMANCE_DATA or USERS.
+// If pcname is "", OpenRemoteKey returns local computer key.
+func OpenRemoteKey(pcname string, k Key) (Key, error) {
+ var err error
+ var p *uint16
+ if pcname != "" {
+ p, err = syscall.UTF16PtrFromString(`\\` + pcname)
+ if err != nil {
+ return 0, err
+ }
+ }
+ var remoteKey syscall.Handle
+ err = regConnectRegistry(p, syscall.Handle(k), &remoteKey)
+ if err != nil {
+ return 0, err
+ }
+ return Key(remoteKey), nil
+}
+
+// ReadSubKeyNames returns the names of subkeys of key k.
+// The parameter n controls the number of returned names,
+// analogous to the way os.File.Readdirnames works.
+func (k Key) ReadSubKeyNames(n int) ([]string, error) {
+ // RegEnumKeyEx must be called repeatedly and to completion.
+ // During this time, this goroutine cannot migrate away from
+ // its current thread. See https://golang.org/issue/49320 and
+ // https://golang.org/issue/49466.
+ runtime.LockOSThread()
+ defer runtime.UnlockOSThread()
+
+ names := make([]string, 0)
+ // Registry key size limit is 255 bytes and described there:
+ // https://msdn.microsoft.com/library/windows/desktop/ms724872.aspx
+ buf := make([]uint16, 256) //plus extra room for terminating zero byte
+loopItems:
+ for i := uint32(0); ; i++ {
+ if n > 0 {
+ if len(names) == n {
+ return names, nil
+ }
+ }
+ l := uint32(len(buf))
+ for {
+ err := syscall.RegEnumKeyEx(syscall.Handle(k), i, &buf[0], &l, nil, nil, nil, nil)
+ if err == nil {
+ break
+ }
+ if err == syscall.ERROR_MORE_DATA {
+ // Double buffer size and try again.
+ l = uint32(2 * len(buf))
+ buf = make([]uint16, l)
+ continue
+ }
+ if err == _ERROR_NO_MORE_ITEMS {
+ break loopItems
+ }
+ return names, err
+ }
+ names = append(names, syscall.UTF16ToString(buf[:l]))
+ }
+ if n > len(names) {
+ return names, io.EOF
+ }
+ return names, nil
+}
+
+// CreateKey creates a key named path under open key k.
+// CreateKey returns the new key and a boolean flag that reports
+// whether the key already existed.
+// The access parameter specifies the access rights for the key
+// to be created.
+func CreateKey(k Key, path string, access uint32) (newk Key, openedExisting bool, err error) {
+ var h syscall.Handle
+ var d uint32
+ err = regCreateKeyEx(syscall.Handle(k), syscall.StringToUTF16Ptr(path),
+ 0, nil, _REG_OPTION_NON_VOLATILE, access, nil, &h, &d)
+ if err != nil {
+ return 0, false, err
+ }
+ return Key(h), d == _REG_OPENED_EXISTING_KEY, nil
+}
+
+// DeleteKey deletes the subkey path of key k and its values.
+func DeleteKey(k Key, path string) error {
+ return regDeleteKey(syscall.Handle(k), syscall.StringToUTF16Ptr(path))
+}
+
+// A KeyInfo describes the statistics of a key. It is returned by Stat.
+type KeyInfo struct {
+ SubKeyCount uint32
+ MaxSubKeyLen uint32 // size of the key's subkey with the longest name, in Unicode characters, not including the terminating zero byte
+ ValueCount uint32
+ MaxValueNameLen uint32 // size of the key's longest value name, in Unicode characters, not including the terminating zero byte
+ MaxValueLen uint32 // longest data component among the key's values, in bytes
+ lastWriteTime syscall.Filetime
+}
+
+// ModTime returns the key's last write time.
+func (ki *KeyInfo) ModTime() time.Time {
+ return time.Unix(0, ki.lastWriteTime.Nanoseconds())
+}
+
+// Stat retrieves information about the open key k.
+func (k Key) Stat() (*KeyInfo, error) {
+ var ki KeyInfo
+ err := syscall.RegQueryInfoKey(syscall.Handle(k), nil, nil, nil,
+ &ki.SubKeyCount, &ki.MaxSubKeyLen, nil, &ki.ValueCount,
+ &ki.MaxValueNameLen, &ki.MaxValueLen, nil, &ki.lastWriteTime)
+ if err != nil {
+ return nil, err
+ }
+ return &ki, nil
+}
diff --git a/vendor/golang.org/x/sys/windows/registry/mksyscall.go b/vendor/golang.org/x/sys/windows/registry/mksyscall.go
new file mode 100644
index 00000000..bbf86ccf
--- /dev/null
+++ b/vendor/golang.org/x/sys/windows/registry/mksyscall.go
@@ -0,0 +1,9 @@
+// Copyright 2015 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build generate
+
+package registry
+
+//go:generate go run golang.org/x/sys/windows/mkwinsyscall -output zsyscall_windows.go syscall.go
diff --git a/vendor/golang.org/x/sys/windows/registry/syscall.go b/vendor/golang.org/x/sys/windows/registry/syscall.go
new file mode 100644
index 00000000..f533091c
--- /dev/null
+++ b/vendor/golang.org/x/sys/windows/registry/syscall.go
@@ -0,0 +1,32 @@
+// Copyright 2015 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build windows
+
+package registry
+
+import "syscall"
+
+const (
+ _REG_OPTION_NON_VOLATILE = 0
+
+ _REG_CREATED_NEW_KEY = 1
+ _REG_OPENED_EXISTING_KEY = 2
+
+ _ERROR_NO_MORE_ITEMS syscall.Errno = 259
+)
+
+func LoadRegLoadMUIString() error {
+ return procRegLoadMUIStringW.Find()
+}
+
+//sys regCreateKeyEx(key syscall.Handle, subkey *uint16, reserved uint32, class *uint16, options uint32, desired uint32, sa *syscall.SecurityAttributes, result *syscall.Handle, disposition *uint32) (regerrno error) = advapi32.RegCreateKeyExW
+//sys regDeleteKey(key syscall.Handle, subkey *uint16) (regerrno error) = advapi32.RegDeleteKeyW
+//sys regSetValueEx(key syscall.Handle, valueName *uint16, reserved uint32, vtype uint32, buf *byte, bufsize uint32) (regerrno error) = advapi32.RegSetValueExW
+//sys regEnumValue(key syscall.Handle, index uint32, name *uint16, nameLen *uint32, reserved *uint32, valtype *uint32, buf *byte, buflen *uint32) (regerrno error) = advapi32.RegEnumValueW
+//sys regDeleteValue(key syscall.Handle, name *uint16) (regerrno error) = advapi32.RegDeleteValueW
+//sys regLoadMUIString(key syscall.Handle, name *uint16, buf *uint16, buflen uint32, buflenCopied *uint32, flags uint32, dir *uint16) (regerrno error) = advapi32.RegLoadMUIStringW
+//sys regConnectRegistry(machinename *uint16, key syscall.Handle, result *syscall.Handle) (regerrno error) = advapi32.RegConnectRegistryW
+
+//sys expandEnvironmentStrings(src *uint16, dst *uint16, size uint32) (n uint32, err error) = kernel32.ExpandEnvironmentStringsW
diff --git a/vendor/golang.org/x/sys/windows/registry/value.go b/vendor/golang.org/x/sys/windows/registry/value.go
new file mode 100644
index 00000000..74db26b9
--- /dev/null
+++ b/vendor/golang.org/x/sys/windows/registry/value.go
@@ -0,0 +1,386 @@
+// Copyright 2015 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build windows
+
+package registry
+
+import (
+ "errors"
+ "io"
+ "syscall"
+ "unicode/utf16"
+ "unsafe"
+)
+
+const (
+ // Registry value types.
+ NONE = 0
+ SZ = 1
+ EXPAND_SZ = 2
+ BINARY = 3
+ DWORD = 4
+ DWORD_BIG_ENDIAN = 5
+ LINK = 6
+ MULTI_SZ = 7
+ RESOURCE_LIST = 8
+ FULL_RESOURCE_DESCRIPTOR = 9
+ RESOURCE_REQUIREMENTS_LIST = 10
+ QWORD = 11
+)
+
+var (
+ // ErrShortBuffer is returned when the buffer was too short for the operation.
+ ErrShortBuffer = syscall.ERROR_MORE_DATA
+
+ // ErrNotExist is returned when a registry key or value does not exist.
+ ErrNotExist = syscall.ERROR_FILE_NOT_FOUND
+
+ // ErrUnexpectedType is returned by Get*Value when the value's type was unexpected.
+ ErrUnexpectedType = errors.New("unexpected key value type")
+)
+
+// GetValue retrieves the type and data for the specified value associated
+// with an open key k. It fills up buffer buf and returns the retrieved
+// byte count n. If buf is too small to fit the stored value it returns
+// ErrShortBuffer error along with the required buffer size n.
+// If no buffer is provided, it returns true and actual buffer size n.
+// If no buffer is provided, GetValue returns the value's type only.
+// If the value does not exist, the error returned is ErrNotExist.
+//
+// GetValue is a low level function. If value's type is known, use the appropriate
+// Get*Value function instead.
+func (k Key) GetValue(name string, buf []byte) (n int, valtype uint32, err error) {
+ pname, err := syscall.UTF16PtrFromString(name)
+ if err != nil {
+ return 0, 0, err
+ }
+ var pbuf *byte
+ if len(buf) > 0 {
+ pbuf = (*byte)(unsafe.Pointer(&buf[0]))
+ }
+ l := uint32(len(buf))
+ err = syscall.RegQueryValueEx(syscall.Handle(k), pname, nil, &valtype, pbuf, &l)
+ if err != nil {
+ return int(l), valtype, err
+ }
+ return int(l), valtype, nil
+}
+
+func (k Key) getValue(name string, buf []byte) (data []byte, valtype uint32, err error) {
+ p, err := syscall.UTF16PtrFromString(name)
+ if err != nil {
+ return nil, 0, err
+ }
+ var t uint32
+ n := uint32(len(buf))
+ for {
+ err = syscall.RegQueryValueEx(syscall.Handle(k), p, nil, &t, (*byte)(unsafe.Pointer(&buf[0])), &n)
+ if err == nil {
+ return buf[:n], t, nil
+ }
+ if err != syscall.ERROR_MORE_DATA {
+ return nil, 0, err
+ }
+ if n <= uint32(len(buf)) {
+ return nil, 0, err
+ }
+ buf = make([]byte, n)
+ }
+}
+
+// GetStringValue retrieves the string value for the specified
+// value name associated with an open key k. It also returns the value's type.
+// If value does not exist, GetStringValue returns ErrNotExist.
+// If value is not SZ or EXPAND_SZ, it will return the correct value
+// type and ErrUnexpectedType.
+func (k Key) GetStringValue(name string) (val string, valtype uint32, err error) {
+ data, typ, err2 := k.getValue(name, make([]byte, 64))
+ if err2 != nil {
+ return "", typ, err2
+ }
+ switch typ {
+ case SZ, EXPAND_SZ:
+ default:
+ return "", typ, ErrUnexpectedType
+ }
+ if len(data) == 0 {
+ return "", typ, nil
+ }
+ u := (*[1 << 29]uint16)(unsafe.Pointer(&data[0]))[: len(data)/2 : len(data)/2]
+ return syscall.UTF16ToString(u), typ, nil
+}
+
+// GetMUIStringValue retrieves the localized string value for
+// the specified value name associated with an open key k.
+// If the value name doesn't exist or the localized string value
+// can't be resolved, GetMUIStringValue returns ErrNotExist.
+// GetMUIStringValue panics if the system doesn't support
+// regLoadMUIString; use LoadRegLoadMUIString to check if
+// regLoadMUIString is supported before calling this function.
+func (k Key) GetMUIStringValue(name string) (string, error) {
+ pname, err := syscall.UTF16PtrFromString(name)
+ if err != nil {
+ return "", err
+ }
+
+ buf := make([]uint16, 1024)
+ var buflen uint32
+ var pdir *uint16
+
+ err = regLoadMUIString(syscall.Handle(k), pname, &buf[0], uint32(len(buf)), &buflen, 0, pdir)
+ if err == syscall.ERROR_FILE_NOT_FOUND { // Try fallback path
+
+ // Try to resolve the string value using the system directory as
+ // a DLL search path; this assumes the string value is of the form
+ // @[path]\dllname,-strID but with no path given, e.g. @tzres.dll,-320.
+
+ // This approach works with tzres.dll but may have to be revised
+ // in the future to allow callers to provide custom search paths.
+
+ var s string
+ s, err = ExpandString("%SystemRoot%\\system32\\")
+ if err != nil {
+ return "", err
+ }
+ pdir, err = syscall.UTF16PtrFromString(s)
+ if err != nil {
+ return "", err
+ }
+
+ err = regLoadMUIString(syscall.Handle(k), pname, &buf[0], uint32(len(buf)), &buflen, 0, pdir)
+ }
+
+ for err == syscall.ERROR_MORE_DATA { // Grow buffer if needed
+ if buflen <= uint32(len(buf)) {
+ break // Buffer not growing, assume race; break
+ }
+ buf = make([]uint16, buflen)
+ err = regLoadMUIString(syscall.Handle(k), pname, &buf[0], uint32(len(buf)), &buflen, 0, pdir)
+ }
+
+ if err != nil {
+ return "", err
+ }
+
+ return syscall.UTF16ToString(buf), nil
+}
+
+// ExpandString expands environment-variable strings and replaces
+// them with the values defined for the current user.
+// Use ExpandString to expand EXPAND_SZ strings.
+func ExpandString(value string) (string, error) {
+ if value == "" {
+ return "", nil
+ }
+ p, err := syscall.UTF16PtrFromString(value)
+ if err != nil {
+ return "", err
+ }
+ r := make([]uint16, 100)
+ for {
+ n, err := expandEnvironmentStrings(p, &r[0], uint32(len(r)))
+ if err != nil {
+ return "", err
+ }
+ if n <= uint32(len(r)) {
+ return syscall.UTF16ToString(r[:n]), nil
+ }
+ r = make([]uint16, n)
+ }
+}
+
+// GetStringsValue retrieves the []string value for the specified
+// value name associated with an open key k. It also returns the value's type.
+// If value does not exist, GetStringsValue returns ErrNotExist.
+// If value is not MULTI_SZ, it will return the correct value
+// type and ErrUnexpectedType.
+func (k Key) GetStringsValue(name string) (val []string, valtype uint32, err error) {
+ data, typ, err2 := k.getValue(name, make([]byte, 64))
+ if err2 != nil {
+ return nil, typ, err2
+ }
+ if typ != MULTI_SZ {
+ return nil, typ, ErrUnexpectedType
+ }
+ if len(data) == 0 {
+ return nil, typ, nil
+ }
+ p := (*[1 << 29]uint16)(unsafe.Pointer(&data[0]))[: len(data)/2 : len(data)/2]
+ if len(p) == 0 {
+ return nil, typ, nil
+ }
+ if p[len(p)-1] == 0 {
+ p = p[:len(p)-1] // remove terminating null
+ }
+ val = make([]string, 0, 5)
+ from := 0
+ for i, c := range p {
+ if c == 0 {
+ val = append(val, string(utf16.Decode(p[from:i])))
+ from = i + 1
+ }
+ }
+ return val, typ, nil
+}
+
+// GetIntegerValue retrieves the integer value for the specified
+// value name associated with an open key k. It also returns the value's type.
+// If value does not exist, GetIntegerValue returns ErrNotExist.
+// If value is not DWORD or QWORD, it will return the correct value
+// type and ErrUnexpectedType.
+func (k Key) GetIntegerValue(name string) (val uint64, valtype uint32, err error) {
+ data, typ, err2 := k.getValue(name, make([]byte, 8))
+ if err2 != nil {
+ return 0, typ, err2
+ }
+ switch typ {
+ case DWORD:
+ if len(data) != 4 {
+ return 0, typ, errors.New("DWORD value is not 4 bytes long")
+ }
+ var val32 uint32
+ copy((*[4]byte)(unsafe.Pointer(&val32))[:], data)
+ return uint64(val32), DWORD, nil
+ case QWORD:
+ if len(data) != 8 {
+ return 0, typ, errors.New("QWORD value is not 8 bytes long")
+ }
+ copy((*[8]byte)(unsafe.Pointer(&val))[:], data)
+ return val, QWORD, nil
+ default:
+ return 0, typ, ErrUnexpectedType
+ }
+}
+
+// GetBinaryValue retrieves the binary value for the specified
+// value name associated with an open key k. It also returns the value's type.
+// If value does not exist, GetBinaryValue returns ErrNotExist.
+// If value is not BINARY, it will return the correct value
+// type and ErrUnexpectedType.
+func (k Key) GetBinaryValue(name string) (val []byte, valtype uint32, err error) {
+ data, typ, err2 := k.getValue(name, make([]byte, 64))
+ if err2 != nil {
+ return nil, typ, err2
+ }
+ if typ != BINARY {
+ return nil, typ, ErrUnexpectedType
+ }
+ return data, typ, nil
+}
+
+func (k Key) setValue(name string, valtype uint32, data []byte) error {
+ p, err := syscall.UTF16PtrFromString(name)
+ if err != nil {
+ return err
+ }
+ if len(data) == 0 {
+ return regSetValueEx(syscall.Handle(k), p, 0, valtype, nil, 0)
+ }
+ return regSetValueEx(syscall.Handle(k), p, 0, valtype, &data[0], uint32(len(data)))
+}
+
+// SetDWordValue sets the data and type of a name value
+// under key k to value and DWORD.
+func (k Key) SetDWordValue(name string, value uint32) error {
+ return k.setValue(name, DWORD, (*[4]byte)(unsafe.Pointer(&value))[:])
+}
+
+// SetQWordValue sets the data and type of a name value
+// under key k to value and QWORD.
+func (k Key) SetQWordValue(name string, value uint64) error {
+ return k.setValue(name, QWORD, (*[8]byte)(unsafe.Pointer(&value))[:])
+}
+
+func (k Key) setStringValue(name string, valtype uint32, value string) error {
+ v, err := syscall.UTF16FromString(value)
+ if err != nil {
+ return err
+ }
+ buf := (*[1 << 29]byte)(unsafe.Pointer(&v[0]))[: len(v)*2 : len(v)*2]
+ return k.setValue(name, valtype, buf)
+}
+
+// SetStringValue sets the data and type of a name value
+// under key k to value and SZ. The value must not contain a zero byte.
+func (k Key) SetStringValue(name, value string) error {
+ return k.setStringValue(name, SZ, value)
+}
+
+// SetExpandStringValue sets the data and type of a name value
+// under key k to value and EXPAND_SZ. The value must not contain a zero byte.
+func (k Key) SetExpandStringValue(name, value string) error {
+ return k.setStringValue(name, EXPAND_SZ, value)
+}
+
+// SetStringsValue sets the data and type of a name value
+// under key k to value and MULTI_SZ. The value strings
+// must not contain a zero byte.
+func (k Key) SetStringsValue(name string, value []string) error {
+ ss := ""
+ for _, s := range value {
+ for i := 0; i < len(s); i++ {
+ if s[i] == 0 {
+ return errors.New("string cannot have 0 inside")
+ }
+ }
+ ss += s + "\x00"
+ }
+ v := utf16.Encode([]rune(ss + "\x00"))
+ buf := (*[1 << 29]byte)(unsafe.Pointer(&v[0]))[: len(v)*2 : len(v)*2]
+ return k.setValue(name, MULTI_SZ, buf)
+}
+
+// SetBinaryValue sets the data and type of a name value
+// under key k to value and BINARY.
+func (k Key) SetBinaryValue(name string, value []byte) error {
+ return k.setValue(name, BINARY, value)
+}
+
+// DeleteValue removes a named value from the key k.
+func (k Key) DeleteValue(name string) error {
+ return regDeleteValue(syscall.Handle(k), syscall.StringToUTF16Ptr(name))
+}
+
+// ReadValueNames returns the value names of key k.
+// The parameter n controls the number of returned names,
+// analogous to the way os.File.Readdirnames works.
+func (k Key) ReadValueNames(n int) ([]string, error) {
+ ki, err := k.Stat()
+ if err != nil {
+ return nil, err
+ }
+ names := make([]string, 0, ki.ValueCount)
+ buf := make([]uint16, ki.MaxValueNameLen+1) // extra room for terminating null character
+loopItems:
+ for i := uint32(0); ; i++ {
+ if n > 0 {
+ if len(names) == n {
+ return names, nil
+ }
+ }
+ l := uint32(len(buf))
+ for {
+ err := regEnumValue(syscall.Handle(k), i, &buf[0], &l, nil, nil, nil, nil)
+ if err == nil {
+ break
+ }
+ if err == syscall.ERROR_MORE_DATA {
+ // Double buffer size and try again.
+ l = uint32(2 * len(buf))
+ buf = make([]uint16, l)
+ continue
+ }
+ if err == _ERROR_NO_MORE_ITEMS {
+ break loopItems
+ }
+ return names, err
+ }
+ names = append(names, syscall.UTF16ToString(buf[:l]))
+ }
+ if n > len(names) {
+ return names, io.EOF
+ }
+ return names, nil
+}
diff --git a/vendor/golang.org/x/sys/windows/registry/zsyscall_windows.go b/vendor/golang.org/x/sys/windows/registry/zsyscall_windows.go
new file mode 100644
index 00000000..fc1835d8
--- /dev/null
+++ b/vendor/golang.org/x/sys/windows/registry/zsyscall_windows.go
@@ -0,0 +1,117 @@
+// Code generated by 'go generate'; DO NOT EDIT.
+
+package registry
+
+import (
+ "syscall"
+ "unsafe"
+
+ "golang.org/x/sys/windows"
+)
+
+var _ unsafe.Pointer
+
+// Do the interface allocations only once for common
+// Errno values.
+const (
+ errnoERROR_IO_PENDING = 997
+)
+
+var (
+ errERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING)
+ errERROR_EINVAL error = syscall.EINVAL
+)
+
+// errnoErr returns common boxed Errno values, to prevent
+// allocations at runtime.
+func errnoErr(e syscall.Errno) error {
+ switch e {
+ case 0:
+ return errERROR_EINVAL
+ case errnoERROR_IO_PENDING:
+ return errERROR_IO_PENDING
+ }
+ // TODO: add more here, after collecting data on the common
+ // error values see on Windows. (perhaps when running
+ // all.bat?)
+ return e
+}
+
+var (
+ modadvapi32 = windows.NewLazySystemDLL("advapi32.dll")
+ modkernel32 = windows.NewLazySystemDLL("kernel32.dll")
+
+ procRegConnectRegistryW = modadvapi32.NewProc("RegConnectRegistryW")
+ procRegCreateKeyExW = modadvapi32.NewProc("RegCreateKeyExW")
+ procRegDeleteKeyW = modadvapi32.NewProc("RegDeleteKeyW")
+ procRegDeleteValueW = modadvapi32.NewProc("RegDeleteValueW")
+ procRegEnumValueW = modadvapi32.NewProc("RegEnumValueW")
+ procRegLoadMUIStringW = modadvapi32.NewProc("RegLoadMUIStringW")
+ procRegSetValueExW = modadvapi32.NewProc("RegSetValueExW")
+ procExpandEnvironmentStringsW = modkernel32.NewProc("ExpandEnvironmentStringsW")
+)
+
+func regConnectRegistry(machinename *uint16, key syscall.Handle, result *syscall.Handle) (regerrno error) {
+ r0, _, _ := syscall.Syscall(procRegConnectRegistryW.Addr(), 3, uintptr(unsafe.Pointer(machinename)), uintptr(key), uintptr(unsafe.Pointer(result)))
+ if r0 != 0 {
+ regerrno = syscall.Errno(r0)
+ }
+ return
+}
+
+func regCreateKeyEx(key syscall.Handle, subkey *uint16, reserved uint32, class *uint16, options uint32, desired uint32, sa *syscall.SecurityAttributes, result *syscall.Handle, disposition *uint32) (regerrno error) {
+ r0, _, _ := syscall.Syscall9(procRegCreateKeyExW.Addr(), 9, uintptr(key), uintptr(unsafe.Pointer(subkey)), uintptr(reserved), uintptr(unsafe.Pointer(class)), uintptr(options), uintptr(desired), uintptr(unsafe.Pointer(sa)), uintptr(unsafe.Pointer(result)), uintptr(unsafe.Pointer(disposition)))
+ if r0 != 0 {
+ regerrno = syscall.Errno(r0)
+ }
+ return
+}
+
+func regDeleteKey(key syscall.Handle, subkey *uint16) (regerrno error) {
+ r0, _, _ := syscall.Syscall(procRegDeleteKeyW.Addr(), 2, uintptr(key), uintptr(unsafe.Pointer(subkey)), 0)
+ if r0 != 0 {
+ regerrno = syscall.Errno(r0)
+ }
+ return
+}
+
+func regDeleteValue(key syscall.Handle, name *uint16) (regerrno error) {
+ r0, _, _ := syscall.Syscall(procRegDeleteValueW.Addr(), 2, uintptr(key), uintptr(unsafe.Pointer(name)), 0)
+ if r0 != 0 {
+ regerrno = syscall.Errno(r0)
+ }
+ return
+}
+
+func regEnumValue(key syscall.Handle, index uint32, name *uint16, nameLen *uint32, reserved *uint32, valtype *uint32, buf *byte, buflen *uint32) (regerrno error) {
+ r0, _, _ := syscall.Syscall9(procRegEnumValueW.Addr(), 8, uintptr(key), uintptr(index), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(nameLen)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(valtype)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(buflen)), 0)
+ if r0 != 0 {
+ regerrno = syscall.Errno(r0)
+ }
+ return
+}
+
+func regLoadMUIString(key syscall.Handle, name *uint16, buf *uint16, buflen uint32, buflenCopied *uint32, flags uint32, dir *uint16) (regerrno error) {
+ r0, _, _ := syscall.Syscall9(procRegLoadMUIStringW.Addr(), 7, uintptr(key), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(buf)), uintptr(buflen), uintptr(unsafe.Pointer(buflenCopied)), uintptr(flags), uintptr(unsafe.Pointer(dir)), 0, 0)
+ if r0 != 0 {
+ regerrno = syscall.Errno(r0)
+ }
+ return
+}
+
+func regSetValueEx(key syscall.Handle, valueName *uint16, reserved uint32, vtype uint32, buf *byte, bufsize uint32) (regerrno error) {
+ r0, _, _ := syscall.Syscall6(procRegSetValueExW.Addr(), 6, uintptr(key), uintptr(unsafe.Pointer(valueName)), uintptr(reserved), uintptr(vtype), uintptr(unsafe.Pointer(buf)), uintptr(bufsize))
+ if r0 != 0 {
+ regerrno = syscall.Errno(r0)
+ }
+ return
+}
+
+func expandEnvironmentStrings(src *uint16, dst *uint16, size uint32) (n uint32, err error) {
+ r0, _, e1 := syscall.Syscall(procExpandEnvironmentStringsW.Addr(), 3, uintptr(unsafe.Pointer(src)), uintptr(unsafe.Pointer(dst)), uintptr(size))
+ n = uint32(r0)
+ if n == 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
diff --git a/vendor/golang.org/x/sys/windows/security_windows.go b/vendor/golang.org/x/sys/windows/security_windows.go
index 6f7d2ac7..b6e1ab76 100644
--- a/vendor/golang.org/x/sys/windows/security_windows.go
+++ b/vendor/golang.org/x/sys/windows/security_windows.go
@@ -894,7 +894,7 @@ type ACL struct {
aclRevision byte
sbz1 byte
aclSize uint16
- aceCount uint16
+ AceCount uint16
sbz2 uint16
}
@@ -1087,6 +1087,27 @@ type EXPLICIT_ACCESS struct {
Trustee TRUSTEE
}
+// https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-ace_header
+type ACE_HEADER struct {
+ AceType uint8
+ AceFlags uint8
+ AceSize uint16
+}
+
+// https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-access_allowed_ace
+type ACCESS_ALLOWED_ACE struct {
+ Header ACE_HEADER
+ Mask ACCESS_MASK
+ SidStart uint32
+}
+
+const (
+ // Constants for AceType
+ // https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-ace_header
+ ACCESS_ALLOWED_ACE_TYPE = 0
+ ACCESS_DENIED_ACE_TYPE = 1
+)
+
// This type is the union inside of TRUSTEE and must be created using one of the TrusteeValueFrom* functions.
type TrusteeValue uintptr
@@ -1158,6 +1179,7 @@ type OBJECTS_AND_NAME struct {
//sys makeSelfRelativeSD(absoluteSD *SECURITY_DESCRIPTOR, selfRelativeSD *SECURITY_DESCRIPTOR, selfRelativeSDSize *uint32) (err error) = advapi32.MakeSelfRelativeSD
//sys setEntriesInAcl(countExplicitEntries uint32, explicitEntries *EXPLICIT_ACCESS, oldACL *ACL, newACL **ACL) (ret error) = advapi32.SetEntriesInAclW
+//sys GetAce(acl *ACL, aceIndex uint32, pAce **ACCESS_ALLOWED_ACE) (err error) = advapi32.GetAce
// Control returns the security descriptor control bits.
func (sd *SECURITY_DESCRIPTOR) Control() (control SECURITY_DESCRIPTOR_CONTROL, revision uint32, err error) {
diff --git a/vendor/golang.org/x/sys/windows/syscall_windows.go b/vendor/golang.org/x/sys/windows/syscall_windows.go
index 6525c62f..4510bfc3 100644
--- a/vendor/golang.org/x/sys/windows/syscall_windows.go
+++ b/vendor/golang.org/x/sys/windows/syscall_windows.go
@@ -17,8 +17,10 @@ import (
"unsafe"
)
-type Handle uintptr
-type HWND uintptr
+type (
+ Handle uintptr
+ HWND uintptr
+)
const (
InvalidHandle = ^Handle(0)
@@ -211,6 +213,10 @@ func NewCallbackCDecl(fn interface{}) uintptr {
//sys OpenProcess(desiredAccess uint32, inheritHandle bool, processId uint32) (handle Handle, err error)
//sys ShellExecute(hwnd Handle, verb *uint16, file *uint16, args *uint16, cwd *uint16, showCmd int32) (err error) [failretval<=32] = shell32.ShellExecuteW
//sys GetWindowThreadProcessId(hwnd HWND, pid *uint32) (tid uint32, err error) = user32.GetWindowThreadProcessId
+//sys LoadKeyboardLayout(name *uint16, flags uint32) (hkl Handle, err error) [failretval==0] = user32.LoadKeyboardLayoutW
+//sys UnloadKeyboardLayout(hkl Handle) (err error) = user32.UnloadKeyboardLayout
+//sys GetKeyboardLayout(tid uint32) (hkl Handle) = user32.GetKeyboardLayout
+//sys ToUnicodeEx(vkey uint32, scancode uint32, keystate *byte, pwszBuff *uint16, cchBuff int32, flags uint32, hkl Handle) (ret int32) = user32.ToUnicodeEx
//sys GetShellWindow() (shellWindow HWND) = user32.GetShellWindow
//sys MessageBox(hwnd HWND, text *uint16, caption *uint16, boxtype uint32) (ret int32, err error) [failretval==0] = user32.MessageBoxW
//sys ExitWindowsEx(flags uint32, reason uint32) (err error) = user32.ExitWindowsEx
@@ -307,6 +313,10 @@ func NewCallbackCDecl(fn interface{}) uintptr {
//sys SetConsoleMode(console Handle, mode uint32) (err error) = kernel32.SetConsoleMode
//sys GetConsoleScreenBufferInfo(console Handle, info *ConsoleScreenBufferInfo) (err error) = kernel32.GetConsoleScreenBufferInfo
//sys setConsoleCursorPosition(console Handle, position uint32) (err error) = kernel32.SetConsoleCursorPosition
+//sys GetConsoleCP() (cp uint32, err error) = kernel32.GetConsoleCP
+//sys GetConsoleOutputCP() (cp uint32, err error) = kernel32.GetConsoleOutputCP
+//sys SetConsoleCP(cp uint32) (err error) = kernel32.SetConsoleCP
+//sys SetConsoleOutputCP(cp uint32) (err error) = kernel32.SetConsoleOutputCP
//sys WriteConsole(console Handle, buf *uint16, towrite uint32, written *uint32, reserved *byte) (err error) = kernel32.WriteConsoleW
//sys ReadConsole(console Handle, buf *uint16, toread uint32, read *uint32, inputControl *byte) (err error) = kernel32.ReadConsoleW
//sys resizePseudoConsole(pconsole Handle, size uint32) (hr error) = kernel32.ResizePseudoConsole
@@ -715,20 +725,12 @@ func DurationSinceBoot() time.Duration {
}
func Ftruncate(fd Handle, length int64) (err error) {
- curoffset, e := Seek(fd, 0, 1)
- if e != nil {
- return e
- }
- defer Seek(fd, curoffset, 0)
- _, e = Seek(fd, length, 0)
- if e != nil {
- return e
+ type _FILE_END_OF_FILE_INFO struct {
+ EndOfFile int64
}
- e = SetEndOfFile(fd)
- if e != nil {
- return e
- }
- return nil
+ var info _FILE_END_OF_FILE_INFO
+ info.EndOfFile = length
+ return SetFileInformationByHandle(fd, FileEndOfFileInfo, (*byte)(unsafe.Pointer(&info)), uint32(unsafe.Sizeof(info)))
}
func Gettimeofday(tv *Timeval) (err error) {
@@ -884,6 +886,11 @@ const socket_error = uintptr(^uint32(0))
//sys GetACP() (acp uint32) = kernel32.GetACP
//sys MultiByteToWideChar(codePage uint32, dwFlags uint32, str *byte, nstr int32, wchar *uint16, nwchar int32) (nwrite int32, err error) = kernel32.MultiByteToWideChar
//sys getBestInterfaceEx(sockaddr unsafe.Pointer, pdwBestIfIndex *uint32) (errcode error) = iphlpapi.GetBestInterfaceEx
+//sys GetIfEntry2Ex(level uint32, row *MibIfRow2) (errcode error) = iphlpapi.GetIfEntry2Ex
+//sys GetUnicastIpAddressEntry(row *MibUnicastIpAddressRow) (errcode error) = iphlpapi.GetUnicastIpAddressEntry
+//sys NotifyIpInterfaceChange(family uint16, callback uintptr, callerContext unsafe.Pointer, initialNotification bool, notificationHandle *Handle) (errcode error) = iphlpapi.NotifyIpInterfaceChange
+//sys NotifyUnicastIpAddressChange(family uint16, callback uintptr, callerContext unsafe.Pointer, initialNotification bool, notificationHandle *Handle) (errcode error) = iphlpapi.NotifyUnicastIpAddressChange
+//sys CancelMibChangeNotify2(notificationHandle Handle) (errcode error) = iphlpapi.CancelMibChangeNotify2
// For testing: clients can set this flag to force
// creation of IPv6 sockets to return EAFNOSUPPORT.
@@ -1368,9 +1375,11 @@ func SetsockoptLinger(fd Handle, level, opt int, l *Linger) (err error) {
func SetsockoptInet4Addr(fd Handle, level, opt int, value [4]byte) (err error) {
return Setsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(&value[0])), 4)
}
+
func SetsockoptIPMreq(fd Handle, level, opt int, mreq *IPMreq) (err error) {
return Setsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(mreq)), int32(unsafe.Sizeof(*mreq)))
}
+
func SetsockoptIPv6Mreq(fd Handle, level, opt int, mreq *IPv6Mreq) (err error) {
return syscall.EWINDOWS
}
@@ -1673,13 +1682,16 @@ func (s NTStatus) Error() string {
// do not use NTUnicodeString, and instead UTF16PtrFromString should be used for
// the more common *uint16 string type.
func NewNTUnicodeString(s string) (*NTUnicodeString, error) {
- var u NTUnicodeString
- s16, err := UTF16PtrFromString(s)
+ s16, err := UTF16FromString(s)
if err != nil {
return nil, err
}
- RtlInitUnicodeString(&u, s16)
- return &u, nil
+ n := uint16(len(s16) * 2)
+ return &NTUnicodeString{
+ Length: n - 2, // subtract 2 bytes for the NULL terminator
+ MaximumLength: n,
+ Buffer: &s16[0],
+ }, nil
}
// Slice returns a uint16 slice that aliases the data in the NTUnicodeString.
diff --git a/vendor/golang.org/x/sys/windows/types_windows.go b/vendor/golang.org/x/sys/windows/types_windows.go
index d8cb71db..51311e20 100644
--- a/vendor/golang.org/x/sys/windows/types_windows.go
+++ b/vendor/golang.org/x/sys/windows/types_windows.go
@@ -1060,6 +1060,7 @@ const (
SIO_GET_EXTENSION_FUNCTION_POINTER = IOC_INOUT | IOC_WS2 | 6
SIO_KEEPALIVE_VALS = IOC_IN | IOC_VENDOR | 4
SIO_UDP_CONNRESET = IOC_IN | IOC_VENDOR | 12
+ SIO_UDP_NETRESET = IOC_IN | IOC_VENDOR | 15
// cf. http://support.microsoft.com/default.aspx?scid=kb;en-us;257460
@@ -2003,7 +2004,21 @@ const (
MOVEFILE_FAIL_IF_NOT_TRACKABLE = 0x20
)
-const GAA_FLAG_INCLUDE_PREFIX = 0x00000010
+// Flags for GetAdaptersAddresses, see
+// https://learn.microsoft.com/en-us/windows/win32/api/iphlpapi/nf-iphlpapi-getadaptersaddresses.
+const (
+ GAA_FLAG_SKIP_UNICAST = 0x1
+ GAA_FLAG_SKIP_ANYCAST = 0x2
+ GAA_FLAG_SKIP_MULTICAST = 0x4
+ GAA_FLAG_SKIP_DNS_SERVER = 0x8
+ GAA_FLAG_INCLUDE_PREFIX = 0x10
+ GAA_FLAG_SKIP_FRIENDLY_NAME = 0x20
+ GAA_FLAG_INCLUDE_WINS_INFO = 0x40
+ GAA_FLAG_INCLUDE_GATEWAYS = 0x80
+ GAA_FLAG_INCLUDE_ALL_INTERFACES = 0x100
+ GAA_FLAG_INCLUDE_ALL_COMPARTMENTS = 0x200
+ GAA_FLAG_INCLUDE_TUNNEL_BINDINGORDER = 0x400
+)
const (
IF_TYPE_OTHER = 1
@@ -2017,6 +2032,50 @@ const (
IF_TYPE_IEEE1394 = 144
)
+// Enum NL_PREFIX_ORIGIN for [IpAdapterUnicastAddress], see
+// https://learn.microsoft.com/en-us/windows/win32/api/nldef/ne-nldef-nl_prefix_origin
+const (
+ IpPrefixOriginOther = 0
+ IpPrefixOriginManual = 1
+ IpPrefixOriginWellKnown = 2
+ IpPrefixOriginDhcp = 3
+ IpPrefixOriginRouterAdvertisement = 4
+ IpPrefixOriginUnchanged = 1 << 4
+)
+
+// Enum NL_SUFFIX_ORIGIN for [IpAdapterUnicastAddress], see
+// https://learn.microsoft.com/en-us/windows/win32/api/nldef/ne-nldef-nl_suffix_origin
+const (
+ NlsoOther = 0
+ NlsoManual = 1
+ NlsoWellKnown = 2
+ NlsoDhcp = 3
+ NlsoLinkLayerAddress = 4
+ NlsoRandom = 5
+ IpSuffixOriginOther = 0
+ IpSuffixOriginManual = 1
+ IpSuffixOriginWellKnown = 2
+ IpSuffixOriginDhcp = 3
+ IpSuffixOriginLinkLayerAddress = 4
+ IpSuffixOriginRandom = 5
+ IpSuffixOriginUnchanged = 1 << 4
+)
+
+// Enum NL_DAD_STATE for [IpAdapterUnicastAddress], see
+// https://learn.microsoft.com/en-us/windows/win32/api/nldef/ne-nldef-nl_dad_state
+const (
+ NldsInvalid = 0
+ NldsTentative = 1
+ NldsDuplicate = 2
+ NldsDeprecated = 3
+ NldsPreferred = 4
+ IpDadStateInvalid = 0
+ IpDadStateTentative = 1
+ IpDadStateDuplicate = 2
+ IpDadStateDeprecated = 3
+ IpDadStatePreferred = 4
+)
+
type SocketAddress struct {
Sockaddr *syscall.RawSockaddrAny
SockaddrLength int32
@@ -2144,6 +2203,132 @@ const (
IfOperStatusLowerLayerDown = 7
)
+const (
+ IF_MAX_PHYS_ADDRESS_LENGTH = 32
+ IF_MAX_STRING_SIZE = 256
+)
+
+// MIB_IF_ENTRY_LEVEL enumeration from netioapi.h or
+// https://learn.microsoft.com/en-us/windows/win32/api/netioapi/nf-netioapi-getifentry2ex.
+const (
+ MibIfEntryNormal = 0
+ MibIfEntryNormalWithoutStatistics = 2
+)
+
+// MIB_NOTIFICATION_TYPE enumeration from netioapi.h or
+// https://learn.microsoft.com/en-us/windows/win32/api/netioapi/ne-netioapi-mib_notification_type.
+const (
+ MibParameterNotification = 0
+ MibAddInstance = 1
+ MibDeleteInstance = 2
+ MibInitialNotification = 3
+)
+
+// MibIfRow2 stores information about a particular interface. See
+// https://learn.microsoft.com/en-us/windows/win32/api/netioapi/ns-netioapi-mib_if_row2.
+type MibIfRow2 struct {
+ InterfaceLuid uint64
+ InterfaceIndex uint32
+ InterfaceGuid GUID
+ Alias [IF_MAX_STRING_SIZE + 1]uint16
+ Description [IF_MAX_STRING_SIZE + 1]uint16
+ PhysicalAddressLength uint32
+ PhysicalAddress [IF_MAX_PHYS_ADDRESS_LENGTH]uint8
+ PermanentPhysicalAddress [IF_MAX_PHYS_ADDRESS_LENGTH]uint8
+ Mtu uint32
+ Type uint32
+ TunnelType uint32
+ MediaType uint32
+ PhysicalMediumType uint32
+ AccessType uint32
+ DirectionType uint32
+ InterfaceAndOperStatusFlags uint8
+ OperStatus uint32
+ AdminStatus uint32
+ MediaConnectState uint32
+ NetworkGuid GUID
+ ConnectionType uint32
+ TransmitLinkSpeed uint64
+ ReceiveLinkSpeed uint64
+ InOctets uint64
+ InUcastPkts uint64
+ InNUcastPkts uint64
+ InDiscards uint64
+ InErrors uint64
+ InUnknownProtos uint64
+ InUcastOctets uint64
+ InMulticastOctets uint64
+ InBroadcastOctets uint64
+ OutOctets uint64
+ OutUcastPkts uint64
+ OutNUcastPkts uint64
+ OutDiscards uint64
+ OutErrors uint64
+ OutUcastOctets uint64
+ OutMulticastOctets uint64
+ OutBroadcastOctets uint64
+ OutQLen uint64
+}
+
+// MIB_UNICASTIPADDRESS_ROW stores information about a unicast IP address. See
+// https://learn.microsoft.com/en-us/windows/win32/api/netioapi/ns-netioapi-mib_unicastipaddress_row.
+type MibUnicastIpAddressRow struct {
+ Address RawSockaddrInet6 // SOCKADDR_INET union
+ InterfaceLuid uint64
+ InterfaceIndex uint32
+ PrefixOrigin uint32
+ SuffixOrigin uint32
+ ValidLifetime uint32
+ PreferredLifetime uint32
+ OnLinkPrefixLength uint8
+ SkipAsSource uint8
+ DadState uint32
+ ScopeId uint32
+ CreationTimeStamp Filetime
+}
+
+const ScopeLevelCount = 16
+
+// MIB_IPINTERFACE_ROW stores interface management information for a particular IP address family on a network interface.
+// See https://learn.microsoft.com/en-us/windows/win32/api/netioapi/ns-netioapi-mib_ipinterface_row.
+type MibIpInterfaceRow struct {
+ Family uint16
+ InterfaceLuid uint64
+ InterfaceIndex uint32
+ MaxReassemblySize uint32
+ InterfaceIdentifier uint64
+ MinRouterAdvertisementInterval uint32
+ MaxRouterAdvertisementInterval uint32
+ AdvertisingEnabled uint8
+ ForwardingEnabled uint8
+ WeakHostSend uint8
+ WeakHostReceive uint8
+ UseAutomaticMetric uint8
+ UseNeighborUnreachabilityDetection uint8
+ ManagedAddressConfigurationSupported uint8
+ OtherStatefulConfigurationSupported uint8
+ AdvertiseDefaultRoute uint8
+ RouterDiscoveryBehavior uint32
+ DadTransmits uint32
+ BaseReachableTime uint32
+ RetransmitTime uint32
+ PathMtuDiscoveryTimeout uint32
+ LinkLocalAddressBehavior uint32
+ LinkLocalAddressTimeout uint32
+ ZoneIndices [ScopeLevelCount]uint32
+ SitePrefixLength uint32
+ Metric uint32
+ NlMtu uint32
+ Connected uint8
+ SupportsWakeUpPatterns uint8
+ SupportsNeighborDiscovery uint8
+ SupportsRouterDiscovery uint8
+ ReachableTime uint32
+ TransmitOffload uint32
+ ReceiveOffload uint32
+ DisableDefaultRoutes uint8
+}
+
// Console related constants used for the mode parameter to SetConsoleMode. See
// https://docs.microsoft.com/en-us/windows/console/setconsolemode for details.
@@ -3404,3 +3589,14 @@ type DCB struct {
EvtChar byte
wReserved1 uint16
}
+
+// Keyboard Layout Flags.
+// See https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-loadkeyboardlayoutw
+const (
+ KLF_ACTIVATE = 0x00000001
+ KLF_SUBSTITUTE_OK = 0x00000002
+ KLF_REORDER = 0x00000008
+ KLF_REPLACELANG = 0x00000010
+ KLF_NOTELLSHELL = 0x00000080
+ KLF_SETFORPROCESS = 0x00000100
+)
diff --git a/vendor/golang.org/x/sys/windows/zsyscall_windows.go b/vendor/golang.org/x/sys/windows/zsyscall_windows.go
index 9f73df75..6f525288 100644
--- a/vendor/golang.org/x/sys/windows/zsyscall_windows.go
+++ b/vendor/golang.org/x/sys/windows/zsyscall_windows.go
@@ -91,6 +91,7 @@ var (
procEnumServicesStatusExW = modadvapi32.NewProc("EnumServicesStatusExW")
procEqualSid = modadvapi32.NewProc("EqualSid")
procFreeSid = modadvapi32.NewProc("FreeSid")
+ procGetAce = modadvapi32.NewProc("GetAce")
procGetLengthSid = modadvapi32.NewProc("GetLengthSid")
procGetNamedSecurityInfoW = modadvapi32.NewProc("GetNamedSecurityInfoW")
procGetSecurityDescriptorControl = modadvapi32.NewProc("GetSecurityDescriptorControl")
@@ -180,10 +181,15 @@ var (
procDnsRecordListFree = moddnsapi.NewProc("DnsRecordListFree")
procDwmGetWindowAttribute = moddwmapi.NewProc("DwmGetWindowAttribute")
procDwmSetWindowAttribute = moddwmapi.NewProc("DwmSetWindowAttribute")
+ procCancelMibChangeNotify2 = modiphlpapi.NewProc("CancelMibChangeNotify2")
procGetAdaptersAddresses = modiphlpapi.NewProc("GetAdaptersAddresses")
procGetAdaptersInfo = modiphlpapi.NewProc("GetAdaptersInfo")
procGetBestInterfaceEx = modiphlpapi.NewProc("GetBestInterfaceEx")
procGetIfEntry = modiphlpapi.NewProc("GetIfEntry")
+ procGetIfEntry2Ex = modiphlpapi.NewProc("GetIfEntry2Ex")
+ procGetUnicastIpAddressEntry = modiphlpapi.NewProc("GetUnicastIpAddressEntry")
+ procNotifyIpInterfaceChange = modiphlpapi.NewProc("NotifyIpInterfaceChange")
+ procNotifyUnicastIpAddressChange = modiphlpapi.NewProc("NotifyUnicastIpAddressChange")
procAddDllDirectory = modkernel32.NewProc("AddDllDirectory")
procAssignProcessToJobObject = modkernel32.NewProc("AssignProcessToJobObject")
procCancelIo = modkernel32.NewProc("CancelIo")
@@ -246,7 +252,9 @@ var (
procGetCommandLineW = modkernel32.NewProc("GetCommandLineW")
procGetComputerNameExW = modkernel32.NewProc("GetComputerNameExW")
procGetComputerNameW = modkernel32.NewProc("GetComputerNameW")
+ procGetConsoleCP = modkernel32.NewProc("GetConsoleCP")
procGetConsoleMode = modkernel32.NewProc("GetConsoleMode")
+ procGetConsoleOutputCP = modkernel32.NewProc("GetConsoleOutputCP")
procGetConsoleScreenBufferInfo = modkernel32.NewProc("GetConsoleScreenBufferInfo")
procGetCurrentDirectoryW = modkernel32.NewProc("GetCurrentDirectoryW")
procGetCurrentProcessId = modkernel32.NewProc("GetCurrentProcessId")
@@ -346,8 +354,10 @@ var (
procSetCommMask = modkernel32.NewProc("SetCommMask")
procSetCommState = modkernel32.NewProc("SetCommState")
procSetCommTimeouts = modkernel32.NewProc("SetCommTimeouts")
+ procSetConsoleCP = modkernel32.NewProc("SetConsoleCP")
procSetConsoleCursorPosition = modkernel32.NewProc("SetConsoleCursorPosition")
procSetConsoleMode = modkernel32.NewProc("SetConsoleMode")
+ procSetConsoleOutputCP = modkernel32.NewProc("SetConsoleOutputCP")
procSetCurrentDirectoryW = modkernel32.NewProc("SetCurrentDirectoryW")
procSetDefaultDllDirectories = modkernel32.NewProc("SetDefaultDllDirectories")
procSetDllDirectoryW = modkernel32.NewProc("SetDllDirectoryW")
@@ -477,12 +487,16 @@ var (
procGetDesktopWindow = moduser32.NewProc("GetDesktopWindow")
procGetForegroundWindow = moduser32.NewProc("GetForegroundWindow")
procGetGUIThreadInfo = moduser32.NewProc("GetGUIThreadInfo")
+ procGetKeyboardLayout = moduser32.NewProc("GetKeyboardLayout")
procGetShellWindow = moduser32.NewProc("GetShellWindow")
procGetWindowThreadProcessId = moduser32.NewProc("GetWindowThreadProcessId")
procIsWindow = moduser32.NewProc("IsWindow")
procIsWindowUnicode = moduser32.NewProc("IsWindowUnicode")
procIsWindowVisible = moduser32.NewProc("IsWindowVisible")
+ procLoadKeyboardLayoutW = moduser32.NewProc("LoadKeyboardLayoutW")
procMessageBoxW = moduser32.NewProc("MessageBoxW")
+ procToUnicodeEx = moduser32.NewProc("ToUnicodeEx")
+ procUnloadKeyboardLayout = moduser32.NewProc("UnloadKeyboardLayout")
procCreateEnvironmentBlock = moduserenv.NewProc("CreateEnvironmentBlock")
procDestroyEnvironmentBlock = moduserenv.NewProc("DestroyEnvironmentBlock")
procGetUserProfileDirectoryW = moduserenv.NewProc("GetUserProfileDirectoryW")
@@ -788,6 +802,14 @@ func FreeSid(sid *SID) (err error) {
return
}
+func GetAce(acl *ACL, aceIndex uint32, pAce **ACCESS_ALLOWED_ACE) (err error) {
+ r1, _, e1 := syscall.Syscall(procGetAce.Addr(), 3, uintptr(unsafe.Pointer(acl)), uintptr(aceIndex), uintptr(unsafe.Pointer(pAce)))
+ if r1 == 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
func GetLengthSid(sid *SID) (len uint32) {
r0, _, _ := syscall.Syscall(procGetLengthSid.Addr(), 1, uintptr(unsafe.Pointer(sid)), 0, 0)
len = uint32(r0)
@@ -1589,6 +1611,14 @@ func DwmSetWindowAttribute(hwnd HWND, attribute uint32, value unsafe.Pointer, si
return
}
+func CancelMibChangeNotify2(notificationHandle Handle) (errcode error) {
+ r0, _, _ := syscall.SyscallN(procCancelMibChangeNotify2.Addr(), uintptr(notificationHandle))
+ if r0 != 0 {
+ errcode = syscall.Errno(r0)
+ }
+ return
+}
+
func GetAdaptersAddresses(family uint32, flags uint32, reserved uintptr, adapterAddresses *IpAdapterAddresses, sizePointer *uint32) (errcode error) {
r0, _, _ := syscall.Syscall6(procGetAdaptersAddresses.Addr(), 5, uintptr(family), uintptr(flags), uintptr(reserved), uintptr(unsafe.Pointer(adapterAddresses)), uintptr(unsafe.Pointer(sizePointer)), 0)
if r0 != 0 {
@@ -1621,6 +1651,46 @@ func GetIfEntry(pIfRow *MibIfRow) (errcode error) {
return
}
+func GetIfEntry2Ex(level uint32, row *MibIfRow2) (errcode error) {
+ r0, _, _ := syscall.SyscallN(procGetIfEntry2Ex.Addr(), uintptr(level), uintptr(unsafe.Pointer(row)))
+ if r0 != 0 {
+ errcode = syscall.Errno(r0)
+ }
+ return
+}
+
+func GetUnicastIpAddressEntry(row *MibUnicastIpAddressRow) (errcode error) {
+ r0, _, _ := syscall.SyscallN(procGetUnicastIpAddressEntry.Addr(), uintptr(unsafe.Pointer(row)))
+ if r0 != 0 {
+ errcode = syscall.Errno(r0)
+ }
+ return
+}
+
+func NotifyIpInterfaceChange(family uint16, callback uintptr, callerContext unsafe.Pointer, initialNotification bool, notificationHandle *Handle) (errcode error) {
+ var _p0 uint32
+ if initialNotification {
+ _p0 = 1
+ }
+ r0, _, _ := syscall.SyscallN(procNotifyIpInterfaceChange.Addr(), uintptr(family), uintptr(callback), uintptr(callerContext), uintptr(_p0), uintptr(unsafe.Pointer(notificationHandle)))
+ if r0 != 0 {
+ errcode = syscall.Errno(r0)
+ }
+ return
+}
+
+func NotifyUnicastIpAddressChange(family uint16, callback uintptr, callerContext unsafe.Pointer, initialNotification bool, notificationHandle *Handle) (errcode error) {
+ var _p0 uint32
+ if initialNotification {
+ _p0 = 1
+ }
+ r0, _, _ := syscall.SyscallN(procNotifyUnicastIpAddressChange.Addr(), uintptr(family), uintptr(callback), uintptr(callerContext), uintptr(_p0), uintptr(unsafe.Pointer(notificationHandle)))
+ if r0 != 0 {
+ errcode = syscall.Errno(r0)
+ }
+ return
+}
+
func AddDllDirectory(path *uint16) (cookie uintptr, err error) {
r0, _, e1 := syscall.Syscall(procAddDllDirectory.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0)
cookie = uintptr(r0)
@@ -2149,6 +2219,15 @@ func GetComputerName(buf *uint16, n *uint32) (err error) {
return
}
+func GetConsoleCP() (cp uint32, err error) {
+ r0, _, e1 := syscall.Syscall(procGetConsoleCP.Addr(), 0, 0, 0, 0)
+ cp = uint32(r0)
+ if cp == 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
func GetConsoleMode(console Handle, mode *uint32) (err error) {
r1, _, e1 := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(console), uintptr(unsafe.Pointer(mode)), 0)
if r1 == 0 {
@@ -2157,6 +2236,15 @@ func GetConsoleMode(console Handle, mode *uint32) (err error) {
return
}
+func GetConsoleOutputCP() (cp uint32, err error) {
+ r0, _, e1 := syscall.Syscall(procGetConsoleOutputCP.Addr(), 0, 0, 0, 0)
+ cp = uint32(r0)
+ if cp == 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
func GetConsoleScreenBufferInfo(console Handle, info *ConsoleScreenBufferInfo) (err error) {
r1, _, e1 := syscall.Syscall(procGetConsoleScreenBufferInfo.Addr(), 2, uintptr(console), uintptr(unsafe.Pointer(info)), 0)
if r1 == 0 {
@@ -3025,6 +3113,14 @@ func SetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error) {
return
}
+func SetConsoleCP(cp uint32) (err error) {
+ r1, _, e1 := syscall.Syscall(procSetConsoleCP.Addr(), 1, uintptr(cp), 0, 0)
+ if r1 == 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
func setConsoleCursorPosition(console Handle, position uint32) (err error) {
r1, _, e1 := syscall.Syscall(procSetConsoleCursorPosition.Addr(), 2, uintptr(console), uintptr(position), 0)
if r1 == 0 {
@@ -3041,6 +3137,14 @@ func SetConsoleMode(console Handle, mode uint32) (err error) {
return
}
+func SetConsoleOutputCP(cp uint32) (err error) {
+ r1, _, e1 := syscall.Syscall(procSetConsoleOutputCP.Addr(), 1, uintptr(cp), 0, 0)
+ if r1 == 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
func SetCurrentDirectory(path *uint16) (err error) {
r1, _, e1 := syscall.Syscall(procSetCurrentDirectoryW.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0)
if r1 == 0 {
@@ -4073,6 +4177,12 @@ func GetGUIThreadInfo(thread uint32, info *GUIThreadInfo) (err error) {
return
}
+func GetKeyboardLayout(tid uint32) (hkl Handle) {
+ r0, _, _ := syscall.Syscall(procGetKeyboardLayout.Addr(), 1, uintptr(tid), 0, 0)
+ hkl = Handle(r0)
+ return
+}
+
func GetShellWindow() (shellWindow HWND) {
r0, _, _ := syscall.Syscall(procGetShellWindow.Addr(), 0, 0, 0, 0)
shellWindow = HWND(r0)
@@ -4106,6 +4216,15 @@ func IsWindowVisible(hwnd HWND) (isVisible bool) {
return
}
+func LoadKeyboardLayout(name *uint16, flags uint32) (hkl Handle, err error) {
+ r0, _, e1 := syscall.Syscall(procLoadKeyboardLayoutW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(flags), 0)
+ hkl = Handle(r0)
+ if hkl == 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
func MessageBox(hwnd HWND, text *uint16, caption *uint16, boxtype uint32) (ret int32, err error) {
r0, _, e1 := syscall.Syscall6(procMessageBoxW.Addr(), 4, uintptr(hwnd), uintptr(unsafe.Pointer(text)), uintptr(unsafe.Pointer(caption)), uintptr(boxtype), 0, 0)
ret = int32(r0)
@@ -4115,6 +4234,20 @@ func MessageBox(hwnd HWND, text *uint16, caption *uint16, boxtype uint32) (ret i
return
}
+func ToUnicodeEx(vkey uint32, scancode uint32, keystate *byte, pwszBuff *uint16, cchBuff int32, flags uint32, hkl Handle) (ret int32) {
+ r0, _, _ := syscall.Syscall9(procToUnicodeEx.Addr(), 7, uintptr(vkey), uintptr(scancode), uintptr(unsafe.Pointer(keystate)), uintptr(unsafe.Pointer(pwszBuff)), uintptr(cchBuff), uintptr(flags), uintptr(hkl), 0, 0)
+ ret = int32(r0)
+ return
+}
+
+func UnloadKeyboardLayout(hkl Handle) (err error) {
+ r1, _, e1 := syscall.Syscall(procUnloadKeyboardLayout.Addr(), 1, uintptr(hkl), 0, 0)
+ if r1 == 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
func CreateEnvironmentBlock(block **uint16, token Token, inheritExisting bool) (err error) {
var _p0 uint32
if inheritExisting {
diff --git a/vendor/golang.org/x/term/LICENSE b/vendor/golang.org/x/term/LICENSE
index 6a66aea5..2a7cf70d 100644
--- a/vendor/golang.org/x/term/LICENSE
+++ b/vendor/golang.org/x/term/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2009 The Go Authors. All rights reserved.
+Copyright 2009 The Go Authors.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@@ -10,7 +10,7 @@ notice, this list of conditions and the following disclaimer.
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
- * Neither the name of Google Inc. nor the names of its
+ * Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
diff --git a/vendor/golang.org/x/term/README.md b/vendor/golang.org/x/term/README.md
index d03d0aef..05ff623f 100644
--- a/vendor/golang.org/x/term/README.md
+++ b/vendor/golang.org/x/term/README.md
@@ -4,16 +4,13 @@
This repository provides Go terminal and console support packages.
-## Download/Install
-
-The easiest way to install is to run `go get -u golang.org/x/term`. You can
-also manually git clone the repository to `$GOPATH/src/golang.org/x/term`.
-
## Report Issues / Send Patches
This repository uses Gerrit for code changes. To learn how to submit changes to
-this repository, see https://golang.org/doc/contribute.html.
+this repository, see https://go.dev/doc/contribute.
+
+The git repository is https://go.googlesource.com/term.
The main issue tracker for the term repository is located at
-https://github.com/golang/go/issues. Prefix your issue with "x/term:" in the
+https://go.dev/issues. Prefix your issue with "x/term:" in the
subject line, so it is easy to find.
diff --git a/vendor/golang.org/x/term/term_windows.go b/vendor/golang.org/x/term/term_windows.go
index 465f5606..df6bf948 100644
--- a/vendor/golang.org/x/term/term_windows.go
+++ b/vendor/golang.org/x/term/term_windows.go
@@ -26,6 +26,7 @@ func makeRaw(fd int) (*State, error) {
return nil, err
}
raw := st &^ (windows.ENABLE_ECHO_INPUT | windows.ENABLE_PROCESSED_INPUT | windows.ENABLE_LINE_INPUT | windows.ENABLE_PROCESSED_OUTPUT)
+ raw |= windows.ENABLE_VIRTUAL_TERMINAL_INPUT
if err := windows.SetConsoleMode(windows.Handle(fd), raw); err != nil {
return nil, err
}
diff --git a/vendor/golang.org/x/text/LICENSE b/vendor/golang.org/x/text/LICENSE
index 6a66aea5..2a7cf70d 100644
--- a/vendor/golang.org/x/text/LICENSE
+++ b/vendor/golang.org/x/text/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2009 The Go Authors. All rights reserved.
+Copyright 2009 The Go Authors.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@@ -10,7 +10,7 @@ notice, this list of conditions and the following disclaimer.
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
- * Neither the name of Google Inc. nor the names of its
+ * Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
diff --git a/vendor/golang.org/x/time/LICENSE b/vendor/golang.org/x/time/LICENSE
index 6a66aea5..2a7cf70d 100644
--- a/vendor/golang.org/x/time/LICENSE
+++ b/vendor/golang.org/x/time/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2009 The Go Authors. All rights reserved.
+Copyright 2009 The Go Authors.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@@ -10,7 +10,7 @@ notice, this list of conditions and the following disclaimer.
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
- * Neither the name of Google Inc. nor the names of its
+ * Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
diff --git a/vendor/golang.org/x/time/rate/rate.go b/vendor/golang.org/x/time/rate/rate.go
index 8f6c7f49..93a798ab 100644
--- a/vendor/golang.org/x/time/rate/rate.go
+++ b/vendor/golang.org/x/time/rate/rate.go
@@ -99,8 +99,9 @@ func (lim *Limiter) Tokens() float64 {
// bursts of at most b tokens.
func NewLimiter(r Limit, b int) *Limiter {
return &Limiter{
- limit: r,
- burst: b,
+ limit: r,
+ burst: b,
+ tokens: float64(b),
}
}
@@ -344,18 +345,6 @@ func (lim *Limiter) reserveN(t time.Time, n int, maxFutureReserve time.Duration)
tokens: n,
timeToAct: t,
}
- } else if lim.limit == 0 {
- var ok bool
- if lim.burst >= n {
- ok = true
- lim.burst -= n
- }
- return Reservation{
- ok: ok,
- lim: lim,
- tokens: lim.burst,
- timeToAct: t,
- }
}
t, tokens := lim.advance(t)
diff --git a/vendor/golang.org/x/tools/LICENSE b/vendor/golang.org/x/tools/LICENSE
index 6a66aea5..2a7cf70d 100644
--- a/vendor/golang.org/x/tools/LICENSE
+++ b/vendor/golang.org/x/tools/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2009 The Go Authors. All rights reserved.
+Copyright 2009 The Go Authors.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@@ -10,7 +10,7 @@ notice, this list of conditions and the following disclaimer.
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
- * Neither the name of Google Inc. nor the names of its
+ * Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
diff --git a/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go b/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go
index 2c4c4e23..6e34df46 100644
--- a/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go
+++ b/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go
@@ -106,8 +106,21 @@ func PathEnclosingInterval(root *ast.File, start, end token.Pos) (path []ast.Nod
// Does augmented child strictly contain [start, end)?
if augPos <= start && end <= augEnd {
- _, isToken := child.(tokenNode)
- return isToken || visit(child)
+ if is[tokenNode](child) {
+ return true
+ }
+
+ // childrenOf elides the FuncType node beneath FuncDecl.
+ // Add it back here for TypeParams, Params, Results,
+ // all FieldLists). But we don't add it back for the "func" token
+ // even though it is is the tree at FuncDecl.Type.Func.
+ if decl, ok := node.(*ast.FuncDecl); ok {
+ if fields, ok := child.(*ast.FieldList); ok && fields != decl.Recv {
+ path = append(path, decl.Type)
+ }
+ }
+
+ return visit(child)
}
// Does [start, end) overlap multiple children?
@@ -313,6 +326,8 @@ func childrenOf(n ast.Node) []ast.Node {
//
// As a workaround, we inline the case for FuncType
// here and order things correctly.
+ // We also need to insert the elided FuncType just
+ // before the 'visit' recursion.
//
children = nil // discard ast.Walk(FuncDecl) info subtrees
children = append(children, tok(n.Type.Func, len("func")))
@@ -632,3 +647,8 @@ func NodeDescription(n ast.Node) string {
}
panic(fmt.Sprintf("unexpected node type: %T", n))
}
+
+func is[T any](x any) bool {
+ _, ok := x.(T)
+ return ok
+}
diff --git a/vendor/golang.org/x/tools/go/ast/astutil/imports.go b/vendor/golang.org/x/tools/go/ast/astutil/imports.go
index 18d1adb0..a6b5ed0a 100644
--- a/vendor/golang.org/x/tools/go/ast/astutil/imports.go
+++ b/vendor/golang.org/x/tools/go/ast/astutil/imports.go
@@ -344,7 +344,12 @@ func RewriteImport(fset *token.FileSet, f *ast.File, oldPath, newPath string) (r
}
// UsesImport reports whether a given import is used.
+// The provided File must have been parsed with syntactic object resolution
+// (not using go/parser.SkipObjectResolution).
func UsesImport(f *ast.File, path string) (used bool) {
+ if f.Scope == nil {
+ panic("file f was not parsed with syntactic object resolution")
+ }
spec := importSpec(f, path)
if spec == nil {
return
diff --git a/vendor/golang.org/x/tools/go/ast/astutil/util.go b/vendor/golang.org/x/tools/go/ast/astutil/util.go
index 919d5305..ca71e3e1 100644
--- a/vendor/golang.org/x/tools/go/ast/astutil/util.go
+++ b/vendor/golang.org/x/tools/go/ast/astutil/util.go
@@ -7,12 +7,5 @@ package astutil
import "go/ast"
// Unparen returns e with any enclosing parentheses stripped.
-func Unparen(e ast.Expr) ast.Expr {
- for {
- p, ok := e.(*ast.ParenExpr)
- if !ok {
- return e
- }
- e = p.X
- }
-}
+// Deprecated: use [ast.Unparen].
+func Unparen(e ast.Expr) ast.Expr { return ast.Unparen(e) }
diff --git a/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go b/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go
new file mode 100644
index 00000000..f3ab0a2e
--- /dev/null
+++ b/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go
@@ -0,0 +1,245 @@
+// Copyright 2016 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Package gcexportdata provides functions for reading and writing
+// export data, which is a serialized description of the API of a Go
+// package including the names, kinds, types, and locations of all
+// exported declarations.
+//
+// The standard Go compiler (cmd/compile) writes an export data file
+// for each package it compiles, which it later reads when compiling
+// packages that import the earlier one. The compiler must thus
+// contain logic to both write and read export data.
+// (See the "Export" section in the cmd/compile/README file.)
+//
+// The [Read] function in this package can read files produced by the
+// compiler, producing [go/types] data structures. As a matter of
+// policy, Read supports export data files produced by only the last
+// two Go releases plus tip; see https://go.dev/issue/68898. The
+// export data files produced by the compiler contain additional
+// details related to generics, inlining, and other optimizations that
+// cannot be decoded by the [Read] function.
+//
+// In files written by the compiler, the export data is not at the
+// start of the file. Before calling Read, use [NewReader] to locate
+// the desired portion of the file.
+//
+// The [Write] function in this package encodes the exported API of a
+// Go package ([types.Package]) as a file. Such files can be later
+// decoded by Read, but cannot be consumed by the compiler.
+//
+// # Future changes
+//
+// Although Read supports the formats written by both Write and the
+// compiler, the two are quite different, and there is an open
+// proposal (https://go.dev/issue/69491) to separate these APIs.
+//
+// Under that proposal, this package would ultimately provide only the
+// Read operation for compiler export data, which must be defined in
+// this module (golang.org/x/tools), not in the standard library, to
+// avoid version skew for developer tools that need to read compiler
+// export data both before and after a Go release, such as from Go
+// 1.23 to Go 1.24. Because this package lives in the tools module,
+// clients can update their version of the module some time before the
+// Go 1.24 release and rebuild and redeploy their tools, which will
+// then be able to consume both Go 1.23 and Go 1.24 export data files,
+// so they will work before and after the Go update. (See discussion
+// at https://go.dev/issue/15651.)
+//
+// The operations to import and export [go/types] data structures
+// would be defined in the go/types package as Import and Export.
+// [Write] would (eventually) delegate to Export,
+// and [Read], when it detects a file produced by Export,
+// would delegate to Import.
+//
+// # Deprecations
+//
+// The [NewImporter] and [Find] functions are deprecated and should
+// not be used in new code. The [WriteBundle] and [ReadBundle]
+// functions are experimental, and there is an open proposal to
+// deprecate them (https://go.dev/issue/69573).
+package gcexportdata
+
+import (
+ "bufio"
+ "bytes"
+ "encoding/json"
+ "fmt"
+ "go/token"
+ "go/types"
+ "io"
+ "os/exec"
+
+ "golang.org/x/tools/internal/gcimporter"
+)
+
+// Find returns the name of an object (.o) or archive (.a) file
+// containing type information for the specified import path,
+// using the go command.
+// If no file was found, an empty filename is returned.
+//
+// A relative srcDir is interpreted relative to the current working directory.
+//
+// Find also returns the package's resolved (canonical) import path,
+// reflecting the effects of srcDir and vendoring on importPath.
+//
+// Deprecated: Use the higher-level API in golang.org/x/tools/go/packages,
+// which is more efficient.
+func Find(importPath, srcDir string) (filename, path string) {
+ cmd := exec.Command("go", "list", "-json", "-export", "--", importPath)
+ cmd.Dir = srcDir
+ out, err := cmd.Output()
+ if err != nil {
+ return "", ""
+ }
+ var data struct {
+ ImportPath string
+ Export string
+ }
+ json.Unmarshal(out, &data)
+ return data.Export, data.ImportPath
+}
+
+// NewReader returns a reader for the export data section of an object
+// (.o) or archive (.a) file read from r. The new reader may provide
+// additional trailing data beyond the end of the export data.
+func NewReader(r io.Reader) (io.Reader, error) {
+ buf := bufio.NewReader(r)
+ _, size, err := gcimporter.FindExportData(buf)
+ if err != nil {
+ return nil, err
+ }
+
+ if size >= 0 {
+ // We were given an archive and found the __.PKGDEF in it.
+ // This tells us the size of the export data, and we don't
+ // need to return the entire file.
+ return &io.LimitedReader{
+ R: buf,
+ N: size,
+ }, nil
+ } else {
+ // We were given an object file. As such, we don't know how large
+ // the export data is and must return the entire file.
+ return buf, nil
+ }
+}
+
+// readAll works the same way as io.ReadAll, but avoids allocations and copies
+// by preallocating a byte slice of the necessary size if the size is known up
+// front. This is always possible when the input is an archive. In that case,
+// NewReader will return the known size using an io.LimitedReader.
+func readAll(r io.Reader) ([]byte, error) {
+ if lr, ok := r.(*io.LimitedReader); ok {
+ data := make([]byte, lr.N)
+ _, err := io.ReadFull(lr, data)
+ return data, err
+ }
+ return io.ReadAll(r)
+}
+
+// Read reads export data from in, decodes it, and returns type
+// information for the package.
+//
+// Read is capable of reading export data produced by [Write] at the
+// same source code version, or by the last two Go releases (plus tip)
+// of the standard Go compiler. Reading files from older compilers may
+// produce an error.
+//
+// The package path (effectively its linker symbol prefix) is
+// specified by path, since unlike the package name, this information
+// may not be recorded in the export data.
+//
+// File position information is added to fset.
+//
+// Read may inspect and add to the imports map to ensure that references
+// within the export data to other packages are consistent. The caller
+// must ensure that imports[path] does not exist, or exists but is
+// incomplete (see types.Package.Complete), and Read inserts the
+// resulting package into this map entry.
+//
+// On return, the state of the reader is undefined.
+func Read(in io.Reader, fset *token.FileSet, imports map[string]*types.Package, path string) (*types.Package, error) {
+ data, err := readAll(in)
+ if err != nil {
+ return nil, fmt.Errorf("reading export data for %q: %v", path, err)
+ }
+
+ if bytes.HasPrefix(data, []byte("!")) {
+ return nil, fmt.Errorf("can't read export data for %q directly from an archive file (call gcexportdata.NewReader first to extract export data)", path)
+ }
+
+ // The indexed export format starts with an 'i'; the older
+ // binary export format starts with a 'c', 'd', or 'v'
+ // (from "version"). Select appropriate importer.
+ if len(data) > 0 {
+ switch data[0] {
+ case 'v', 'c', 'd':
+ // binary, produced by cmd/compile till go1.10
+ return nil, fmt.Errorf("binary (%c) import format is no longer supported", data[0])
+
+ case 'i':
+ // indexed, produced by cmd/compile till go1.19,
+ // and also by [Write].
+ //
+ // If proposal #69491 is accepted, go/types
+ // serialization will be implemented by
+ // types.Export, to which Write would eventually
+ // delegate (explicitly dropping any pretence at
+ // inter-version Write-Read compatibility).
+ // This [Read] function would delegate to types.Import
+ // when it detects that the file was produced by Export.
+ _, pkg, err := gcimporter.IImportData(fset, imports, data[1:], path)
+ return pkg, err
+
+ case 'u':
+ // unified, produced by cmd/compile since go1.20
+ _, pkg, err := gcimporter.UImportData(fset, imports, data[1:], path)
+ return pkg, err
+
+ default:
+ l := len(data)
+ if l > 10 {
+ l = 10
+ }
+ return nil, fmt.Errorf("unexpected export data with prefix %q for path %s", string(data[:l]), path)
+ }
+ }
+ return nil, fmt.Errorf("empty export data for %s", path)
+}
+
+// Write writes encoded type information for the specified package to out.
+// The FileSet provides file position information for named objects.
+func Write(out io.Writer, fset *token.FileSet, pkg *types.Package) error {
+ if _, err := io.WriteString(out, "i"); err != nil {
+ return err
+ }
+ return gcimporter.IExportData(out, fset, pkg)
+}
+
+// ReadBundle reads an export bundle from in, decodes it, and returns type
+// information for the packages.
+// File position information is added to fset.
+//
+// ReadBundle may inspect and add to the imports map to ensure that references
+// within the export bundle to other packages are consistent.
+//
+// On return, the state of the reader is undefined.
+//
+// Experimental: This API is experimental and may change in the future.
+func ReadBundle(in io.Reader, fset *token.FileSet, imports map[string]*types.Package) ([]*types.Package, error) {
+ data, err := readAll(in)
+ if err != nil {
+ return nil, fmt.Errorf("reading export bundle: %v", err)
+ }
+ return gcimporter.IImportBundle(fset, imports, data)
+}
+
+// WriteBundle writes encoded type information for the specified packages to out.
+// The FileSet provides file position information for named objects.
+//
+// Experimental: This API is experimental and may change in the future.
+func WriteBundle(out io.Writer, fset *token.FileSet, pkgs []*types.Package) error {
+ return gcimporter.IExportBundle(out, fset, pkgs)
+}
diff --git a/vendor/golang.org/x/tools/go/gcexportdata/importer.go b/vendor/golang.org/x/tools/go/gcexportdata/importer.go
new file mode 100644
index 00000000..37a7247e
--- /dev/null
+++ b/vendor/golang.org/x/tools/go/gcexportdata/importer.go
@@ -0,0 +1,75 @@
+// Copyright 2016 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package gcexportdata
+
+import (
+ "fmt"
+ "go/token"
+ "go/types"
+ "os"
+)
+
+// NewImporter returns a new instance of the types.Importer interface
+// that reads type information from export data files written by gc.
+// The Importer also satisfies types.ImporterFrom.
+//
+// Export data files are located using "go build" workspace conventions
+// and the build.Default context.
+//
+// Use this importer instead of go/importer.For("gc", ...) to avoid the
+// version-skew problems described in the documentation of this package,
+// or to control the FileSet or access the imports map populated during
+// package loading.
+//
+// Deprecated: Use the higher-level API in golang.org/x/tools/go/packages,
+// which is more efficient.
+func NewImporter(fset *token.FileSet, imports map[string]*types.Package) types.ImporterFrom {
+ return importer{fset, imports}
+}
+
+type importer struct {
+ fset *token.FileSet
+ imports map[string]*types.Package
+}
+
+func (imp importer) Import(importPath string) (*types.Package, error) {
+ return imp.ImportFrom(importPath, "", 0)
+}
+
+func (imp importer) ImportFrom(importPath, srcDir string, mode types.ImportMode) (_ *types.Package, err error) {
+ filename, path := Find(importPath, srcDir)
+ if filename == "" {
+ if importPath == "unsafe" {
+ // Even for unsafe, call Find first in case
+ // the package was vendored.
+ return types.Unsafe, nil
+ }
+ return nil, fmt.Errorf("can't find import: %s", importPath)
+ }
+
+ if pkg, ok := imp.imports[path]; ok && pkg.Complete() {
+ return pkg, nil // cache hit
+ }
+
+ // open file
+ f, err := os.Open(filename)
+ if err != nil {
+ return nil, err
+ }
+ defer func() {
+ f.Close()
+ if err != nil {
+ // add file name to error
+ err = fmt.Errorf("reading export data: %s: %v", filename, err)
+ }
+ }()
+
+ r, err := NewReader(f)
+ if err != nil {
+ return nil, err
+ }
+
+ return Read(r, imp.fset, imp.imports, path)
+}
diff --git a/vendor/golang.org/x/tools/go/packages/doc.go b/vendor/golang.org/x/tools/go/packages/doc.go
new file mode 100644
index 00000000..f1931d10
--- /dev/null
+++ b/vendor/golang.org/x/tools/go/packages/doc.go
@@ -0,0 +1,251 @@
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+/*
+Package packages loads Go packages for inspection and analysis.
+
+The [Load] function takes as input a list of patterns and returns a
+list of [Package] values describing individual packages matched by those
+patterns.
+A [Config] specifies configuration options, the most important of which is
+the [LoadMode], which controls the amount of detail in the loaded packages.
+
+Load passes most patterns directly to the underlying build tool.
+The default build tool is the go command.
+Its supported patterns are described at
+https://pkg.go.dev/cmd/go#hdr-Package_lists_and_patterns.
+Other build systems may be supported by providing a "driver";
+see [The driver protocol].
+
+All patterns with the prefix "query=", where query is a
+non-empty string of letters from [a-z], are reserved and may be
+interpreted as query operators.
+
+Two query operators are currently supported: "file" and "pattern".
+
+The query "file=path/to/file.go" matches the package or packages enclosing
+the Go source file path/to/file.go. For example "file=~/go/src/fmt/print.go"
+might return the packages "fmt" and "fmt [fmt.test]".
+
+The query "pattern=string" causes "string" to be passed directly to
+the underlying build tool. In most cases this is unnecessary,
+but an application can use Load("pattern=" + x) as an escaping mechanism
+to ensure that x is not interpreted as a query operator if it contains '='.
+
+All other query operators are reserved for future use and currently
+cause Load to report an error.
+
+The Package struct provides basic information about the package, including
+
+ - ID, a unique identifier for the package in the returned set;
+ - GoFiles, the names of the package's Go source files;
+ - Imports, a map from source import strings to the Packages they name;
+ - Types, the type information for the package's exported symbols;
+ - Syntax, the parsed syntax trees for the package's source code; and
+ - TypesInfo, the result of a complete type-check of the package syntax trees.
+
+(See the documentation for type Package for the complete list of fields
+and more detailed descriptions.)
+
+For example,
+
+ Load(nil, "bytes", "unicode...")
+
+returns four Package structs describing the standard library packages
+bytes, unicode, unicode/utf16, and unicode/utf8. Note that one pattern
+can match multiple packages and that a package might be matched by
+multiple patterns: in general it is not possible to determine which
+packages correspond to which patterns.
+
+Note that the list returned by Load contains only the packages matched
+by the patterns. Their dependencies can be found by walking the import
+graph using the Imports fields.
+
+The Load function can be configured by passing a pointer to a Config as
+the first argument. A nil Config is equivalent to the zero Config, which
+causes Load to run in [LoadFiles] mode, collecting minimal information.
+See the documentation for type Config for details.
+
+As noted earlier, the Config.Mode controls the amount of detail
+reported about the loaded packages. See the documentation for type LoadMode
+for details.
+
+Most tools should pass their command-line arguments (after any flags)
+uninterpreted to Load, so that it can interpret them
+according to the conventions of the underlying build system.
+
+See the Example function for typical usage.
+
+# The driver protocol
+
+Load may be used to load Go packages even in Go projects that use
+alternative build systems, by installing an appropriate "driver"
+program for the build system and specifying its location in the
+GOPACKAGESDRIVER environment variable.
+For example,
+https://github.com/bazelbuild/rules_go/wiki/Editor-and-tool-integration
+explains how to use the driver for Bazel.
+
+The driver program is responsible for interpreting patterns in its
+preferred notation and reporting information about the packages that
+those patterns identify. Drivers must also support the special "file="
+and "pattern=" patterns described above.
+
+The patterns are provided as positional command-line arguments. A
+JSON-encoded [DriverRequest] message providing additional information
+is written to the driver's standard input. The driver must write a
+JSON-encoded [DriverResponse] message to its standard output. (This
+message differs from the JSON schema produced by 'go list'.)
+
+The value of the PWD environment variable seen by the driver process
+is the preferred name of its working directory. (The working directory
+may have other aliases due to symbolic links; see the comment on the
+Dir field of [exec.Cmd] for related information.)
+When the driver process emits in its response the name of a file
+that is a descendant of this directory, it must use an absolute path
+that has the value of PWD as a prefix, to ensure that the returned
+filenames satisfy the original query.
+*/
+package packages // import "golang.org/x/tools/go/packages"
+
+/*
+
+Motivation and design considerations
+
+The new package's design solves problems addressed by two existing
+packages: go/build, which locates and describes packages, and
+golang.org/x/tools/go/loader, which loads, parses and type-checks them.
+The go/build.Package structure encodes too much of the 'go build' way
+of organizing projects, leaving us in need of a data type that describes a
+package of Go source code independent of the underlying build system.
+We wanted something that works equally well with go build and vgo, and
+also other build systems such as Bazel and Blaze, making it possible to
+construct analysis tools that work in all these environments.
+Tools such as errcheck and staticcheck were essentially unavailable to
+the Go community at Google, and some of Google's internal tools for Go
+are unavailable externally.
+This new package provides a uniform way to obtain package metadata by
+querying each of these build systems, optionally supporting their
+preferred command-line notations for packages, so that tools integrate
+neatly with users' build environments. The Metadata query function
+executes an external query tool appropriate to the current workspace.
+
+Loading packages always returns the complete import graph "all the way down",
+even if all you want is information about a single package, because the query
+mechanisms of all the build systems we currently support ({go,vgo} list, and
+blaze/bazel aspect-based query) cannot provide detailed information
+about one package without visiting all its dependencies too, so there is
+no additional asymptotic cost to providing transitive information.
+(This property might not be true of a hypothetical 5th build system.)
+
+In calls to TypeCheck, all initial packages, and any package that
+transitively depends on one of them, must be loaded from source.
+Consider A->B->C->D->E: if A,C are initial, A,B,C must be loaded from
+source; D may be loaded from export data, and E may not be loaded at all
+(though it's possible that D's export data mentions it, so a
+types.Package may be created for it and exposed.)
+
+The old loader had a feature to suppress type-checking of function
+bodies on a per-package basis, primarily intended to reduce the work of
+obtaining type information for imported packages. Now that imports are
+satisfied by export data, the optimization no longer seems necessary.
+
+Despite some early attempts, the old loader did not exploit export data,
+instead always using the equivalent of WholeProgram mode. This was due
+to the complexity of mixing source and export data packages (now
+resolved by the upward traversal mentioned above), and because export data
+files were nearly always missing or stale. Now that 'go build' supports
+caching, all the underlying build systems can guarantee to produce
+export data in a reasonable (amortized) time.
+
+Test "main" packages synthesized by the build system are now reported as
+first-class packages, avoiding the need for clients (such as go/ssa) to
+reinvent this generation logic.
+
+One way in which go/packages is simpler than the old loader is in its
+treatment of in-package tests. In-package tests are packages that
+consist of all the files of the library under test, plus the test files.
+The old loader constructed in-package tests by a two-phase process of
+mutation called "augmentation": first it would construct and type check
+all the ordinary library packages and type-check the packages that
+depend on them; then it would add more (test) files to the package and
+type-check again. This two-phase approach had four major problems:
+1) in processing the tests, the loader modified the library package,
+ leaving no way for a client application to see both the test
+ package and the library package; one would mutate into the other.
+2) because test files can declare additional methods on types defined in
+ the library portion of the package, the dispatch of method calls in
+ the library portion was affected by the presence of the test files.
+ This should have been a clue that the packages were logically
+ different.
+3) this model of "augmentation" assumed at most one in-package test
+ per library package, which is true of projects using 'go build',
+ but not other build systems.
+4) because of the two-phase nature of test processing, all packages that
+ import the library package had to be processed before augmentation,
+ forcing a "one-shot" API and preventing the client from calling Load
+ in several times in sequence as is now possible in WholeProgram mode.
+ (TypeCheck mode has a similar one-shot restriction for a different reason.)
+
+Early drafts of this package supported "multi-shot" operation.
+Although it allowed clients to make a sequence of calls (or concurrent
+calls) to Load, building up the graph of Packages incrementally,
+it was of marginal value: it complicated the API
+(since it allowed some options to vary across calls but not others),
+it complicated the implementation,
+it cannot be made to work in Types mode, as explained above,
+and it was less efficient than making one combined call (when this is possible).
+Among the clients we have inspected, none made multiple calls to load
+but could not be easily and satisfactorily modified to make only a single call.
+However, applications changes may be required.
+For example, the ssadump command loads the user-specified packages
+and in addition the runtime package. It is tempting to simply append
+"runtime" to the user-provided list, but that does not work if the user
+specified an ad-hoc package such as [a.go b.go].
+Instead, ssadump no longer requests the runtime package,
+but seeks it among the dependencies of the user-specified packages,
+and emits an error if it is not found.
+
+Questions & Tasks
+
+- Add GOARCH/GOOS?
+ They are not portable concepts, but could be made portable.
+ Our goal has been to allow users to express themselves using the conventions
+ of the underlying build system: if the build system honors GOARCH
+ during a build and during a metadata query, then so should
+ applications built atop that query mechanism.
+ Conversely, if the target architecture of the build is determined by
+ command-line flags, the application can pass the relevant
+ flags through to the build system using a command such as:
+ myapp -query_flag="--cpu=amd64" -query_flag="--os=darwin"
+ However, this approach is low-level, unwieldy, and non-portable.
+ GOOS and GOARCH seem important enough to warrant a dedicated option.
+
+- How should we handle partial failures such as a mixture of good and
+ malformed patterns, existing and non-existent packages, successful and
+ failed builds, import failures, import cycles, and so on, in a call to
+ Load?
+
+- Support bazel, blaze, and go1.10 list, not just go1.11 list.
+
+- Handle (and test) various partial success cases, e.g.
+ a mixture of good packages and:
+ invalid patterns
+ nonexistent packages
+ empty packages
+ packages with malformed package or import declarations
+ unreadable files
+ import cycles
+ other parse errors
+ type errors
+ Make sure we record errors at the correct place in the graph.
+
+- Missing packages among initial arguments are not reported.
+ Return bogus packages for them, like golist does.
+
+- "undeclared name" errors (for example) are reported out of source file
+ order. I suspect this is due to the breadth-first resolution now used
+ by go/types. Is that a bug? Discuss with gri.
+
+*/
diff --git a/vendor/golang.org/x/tools/go/packages/external.go b/vendor/golang.org/x/tools/go/packages/external.go
new file mode 100644
index 00000000..96db9daf
--- /dev/null
+++ b/vendor/golang.org/x/tools/go/packages/external.go
@@ -0,0 +1,156 @@
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package packages
+
+// This file defines the protocol that enables an external "driver"
+// tool to supply package metadata in place of 'go list'.
+
+import (
+ "bytes"
+ "encoding/json"
+ "fmt"
+ "os"
+ "os/exec"
+ "strings"
+)
+
+// DriverRequest defines the schema of a request for package metadata
+// from an external driver program. The JSON-encoded DriverRequest
+// message is provided to the driver program's standard input. The
+// query patterns are provided as command-line arguments.
+//
+// See the package documentation for an overview.
+type DriverRequest struct {
+ Mode LoadMode `json:"mode"`
+
+ // Env specifies the environment the underlying build system should be run in.
+ Env []string `json:"env"`
+
+ // BuildFlags are flags that should be passed to the underlying build system.
+ BuildFlags []string `json:"build_flags"`
+
+ // Tests specifies whether the patterns should also return test packages.
+ Tests bool `json:"tests"`
+
+ // Overlay maps file paths (relative to the driver's working directory)
+ // to the contents of overlay files (see Config.Overlay).
+ Overlay map[string][]byte `json:"overlay"`
+}
+
+// DriverResponse defines the schema of a response from an external
+// driver program, providing the results of a query for package
+// metadata. The driver program must write a JSON-encoded
+// DriverResponse message to its standard output.
+//
+// See the package documentation for an overview.
+type DriverResponse struct {
+ // NotHandled is returned if the request can't be handled by the current
+ // driver. If an external driver returns a response with NotHandled, the
+ // rest of the DriverResponse is ignored, and go/packages will fallback
+ // to the next driver. If go/packages is extended in the future to support
+ // lists of multiple drivers, go/packages will fall back to the next driver.
+ NotHandled bool
+
+ // Compiler and Arch are the arguments pass of types.SizesFor
+ // to get a types.Sizes to use when type checking.
+ Compiler string
+ Arch string
+
+ // Roots is the set of package IDs that make up the root packages.
+ // We have to encode this separately because when we encode a single package
+ // we cannot know if it is one of the roots as that requires knowledge of the
+ // graph it is part of.
+ Roots []string `json:",omitempty"`
+
+ // Packages is the full set of packages in the graph.
+ // The packages are not connected into a graph.
+ // The Imports if populated will be stubs that only have their ID set.
+ // Imports will be connected and then type and syntax information added in a
+ // later pass (see refine).
+ Packages []*Package
+
+ // GoVersion is the minor version number used by the driver
+ // (e.g. the go command on the PATH) when selecting .go files.
+ // Zero means unknown.
+ GoVersion int
+}
+
+// driver is the type for functions that query the build system for the
+// packages named by the patterns.
+type driver func(cfg *Config, patterns []string) (*DriverResponse, error)
+
+// findExternalDriver returns the file path of a tool that supplies
+// the build system package structure, or "" if not found.
+// If GOPACKAGESDRIVER is set in the environment findExternalTool returns its
+// value, otherwise it searches for a binary named gopackagesdriver on the PATH.
+func findExternalDriver(cfg *Config) driver {
+ const toolPrefix = "GOPACKAGESDRIVER="
+ tool := ""
+ for _, env := range cfg.Env {
+ if val := strings.TrimPrefix(env, toolPrefix); val != env {
+ tool = val
+ }
+ }
+ if tool != "" && tool == "off" {
+ return nil
+ }
+ if tool == "" {
+ var err error
+ tool, err = exec.LookPath("gopackagesdriver")
+ if err != nil {
+ return nil
+ }
+ }
+ return func(cfg *Config, patterns []string) (*DriverResponse, error) {
+ req, err := json.Marshal(DriverRequest{
+ Mode: cfg.Mode,
+ Env: cfg.Env,
+ BuildFlags: cfg.BuildFlags,
+ Tests: cfg.Tests,
+ Overlay: cfg.Overlay,
+ })
+ if err != nil {
+ return nil, fmt.Errorf("failed to encode message to driver tool: %v", err)
+ }
+
+ buf := new(bytes.Buffer)
+ stderr := new(bytes.Buffer)
+ cmd := exec.CommandContext(cfg.Context, tool, patterns...)
+ cmd.Dir = cfg.Dir
+ // The cwd gets resolved to the real path. On Darwin, where
+ // /tmp is a symlink, this breaks anything that expects the
+ // working directory to keep the original path, including the
+ // go command when dealing with modules.
+ //
+ // os.Getwd stdlib has a special feature where if the
+ // cwd and the PWD are the same node then it trusts
+ // the PWD, so by setting it in the env for the child
+ // process we fix up all the paths returned by the go
+ // command.
+ //
+ // (See similar trick in Invocation.run in ../../internal/gocommand/invoke.go)
+ cmd.Env = append(slicesClip(cfg.Env), "PWD="+cfg.Dir)
+ cmd.Stdin = bytes.NewReader(req)
+ cmd.Stdout = buf
+ cmd.Stderr = stderr
+
+ if err := cmd.Run(); err != nil {
+ return nil, fmt.Errorf("%v: %v: %s", tool, err, cmd.Stderr)
+ }
+ if len(stderr.Bytes()) != 0 && os.Getenv("GOPACKAGESPRINTDRIVERERRORS") != "" {
+ fmt.Fprintf(os.Stderr, "%s stderr: <<%s>>\n", cmdDebugStr(cmd), stderr)
+ }
+
+ var response DriverResponse
+ if err := json.Unmarshal(buf.Bytes(), &response); err != nil {
+ return nil, err
+ }
+ return &response, nil
+ }
+}
+
+// slicesClip removes unused capacity from the slice, returning s[:len(s):len(s)].
+// TODO(adonovan): use go1.21 slices.Clip.
+func slicesClip[S ~[]E, E any](s S) S { return s[:len(s):len(s)] }
diff --git a/vendor/golang.org/x/tools/go/packages/golist.go b/vendor/golang.org/x/tools/go/packages/golist.go
new file mode 100644
index 00000000..76f910ec
--- /dev/null
+++ b/vendor/golang.org/x/tools/go/packages/golist.go
@@ -0,0 +1,1080 @@
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package packages
+
+import (
+ "bytes"
+ "context"
+ "encoding/json"
+ "fmt"
+ "log"
+ "os"
+ "os/exec"
+ "path"
+ "path/filepath"
+ "reflect"
+ "sort"
+ "strconv"
+ "strings"
+ "sync"
+ "unicode"
+
+ "golang.org/x/tools/internal/gocommand"
+ "golang.org/x/tools/internal/packagesinternal"
+)
+
+// debug controls verbose logging.
+var debug, _ = strconv.ParseBool(os.Getenv("GOPACKAGESDEBUG"))
+
+// A goTooOldError reports that the go command
+// found by exec.LookPath is too old to use the new go list behavior.
+type goTooOldError struct {
+ error
+}
+
+// responseDeduper wraps a DriverResponse, deduplicating its contents.
+type responseDeduper struct {
+ seenRoots map[string]bool
+ seenPackages map[string]*Package
+ dr *DriverResponse
+}
+
+func newDeduper() *responseDeduper {
+ return &responseDeduper{
+ dr: &DriverResponse{},
+ seenRoots: map[string]bool{},
+ seenPackages: map[string]*Package{},
+ }
+}
+
+// addAll fills in r with a DriverResponse.
+func (r *responseDeduper) addAll(dr *DriverResponse) {
+ for _, pkg := range dr.Packages {
+ r.addPackage(pkg)
+ }
+ for _, root := range dr.Roots {
+ r.addRoot(root)
+ }
+ r.dr.GoVersion = dr.GoVersion
+}
+
+func (r *responseDeduper) addPackage(p *Package) {
+ if r.seenPackages[p.ID] != nil {
+ return
+ }
+ r.seenPackages[p.ID] = p
+ r.dr.Packages = append(r.dr.Packages, p)
+}
+
+func (r *responseDeduper) addRoot(id string) {
+ if r.seenRoots[id] {
+ return
+ }
+ r.seenRoots[id] = true
+ r.dr.Roots = append(r.dr.Roots, id)
+}
+
+type golistState struct {
+ cfg *Config
+ ctx context.Context
+
+ runner *gocommand.Runner
+
+ // overlay is the JSON file that encodes the Config.Overlay
+ // mapping, used by 'go list -overlay=...'.
+ overlay string
+
+ envOnce sync.Once
+ goEnvError error
+ goEnv map[string]string
+
+ rootsOnce sync.Once
+ rootDirsError error
+ rootDirs map[string]string
+
+ goVersionOnce sync.Once
+ goVersionError error
+ goVersion int // The X in Go 1.X.
+
+ // vendorDirs caches the (non)existence of vendor directories.
+ vendorDirs map[string]bool
+}
+
+// getEnv returns Go environment variables. Only specific variables are
+// populated -- computing all of them is slow.
+func (state *golistState) getEnv() (map[string]string, error) {
+ state.envOnce.Do(func() {
+ var b *bytes.Buffer
+ b, state.goEnvError = state.invokeGo("env", "-json", "GOMOD", "GOPATH")
+ if state.goEnvError != nil {
+ return
+ }
+
+ state.goEnv = make(map[string]string)
+ decoder := json.NewDecoder(b)
+ if state.goEnvError = decoder.Decode(&state.goEnv); state.goEnvError != nil {
+ return
+ }
+ })
+ return state.goEnv, state.goEnvError
+}
+
+// mustGetEnv is a convenience function that can be used if getEnv has already succeeded.
+func (state *golistState) mustGetEnv() map[string]string {
+ env, err := state.getEnv()
+ if err != nil {
+ panic(fmt.Sprintf("mustGetEnv: %v", err))
+ }
+ return env
+}
+
+// goListDriver uses the go list command to interpret the patterns and produce
+// the build system package structure.
+// See driver for more details.
+//
+// overlay is the JSON file that encodes the cfg.Overlay
+// mapping, used by 'go list -overlay=...'
+func goListDriver(cfg *Config, runner *gocommand.Runner, overlay string, patterns []string) (_ *DriverResponse, err error) {
+ // Make sure that any asynchronous go commands are killed when we return.
+ parentCtx := cfg.Context
+ if parentCtx == nil {
+ parentCtx = context.Background()
+ }
+ ctx, cancel := context.WithCancel(parentCtx)
+ defer cancel()
+
+ response := newDeduper()
+
+ state := &golistState{
+ cfg: cfg,
+ ctx: ctx,
+ vendorDirs: map[string]bool{},
+ overlay: overlay,
+ runner: runner,
+ }
+
+ // Fill in response.Sizes asynchronously if necessary.
+ if cfg.Mode&NeedTypesSizes != 0 || cfg.Mode&(NeedTypes|NeedTypesInfo) != 0 {
+ errCh := make(chan error)
+ go func() {
+ compiler, arch, err := getSizesForArgs(ctx, state.cfgInvocation(), runner)
+ response.dr.Compiler = compiler
+ response.dr.Arch = arch
+ errCh <- err
+ }()
+ defer func() {
+ if sizesErr := <-errCh; sizesErr != nil {
+ err = sizesErr
+ }
+ }()
+ }
+
+ // Determine files requested in contains patterns
+ var containFiles []string
+ restPatterns := make([]string, 0, len(patterns))
+ // Extract file= and other [querytype]= patterns. Report an error if querytype
+ // doesn't exist.
+extractQueries:
+ for _, pattern := range patterns {
+ eqidx := strings.Index(pattern, "=")
+ if eqidx < 0 {
+ restPatterns = append(restPatterns, pattern)
+ } else {
+ query, value := pattern[:eqidx], pattern[eqidx+len("="):]
+ switch query {
+ case "file":
+ containFiles = append(containFiles, value)
+ case "pattern":
+ restPatterns = append(restPatterns, value)
+ case "": // not a reserved query
+ restPatterns = append(restPatterns, pattern)
+ default:
+ for _, rune := range query {
+ if rune < 'a' || rune > 'z' { // not a reserved query
+ restPatterns = append(restPatterns, pattern)
+ continue extractQueries
+ }
+ }
+ // Reject all other patterns containing "="
+ return nil, fmt.Errorf("invalid query type %q in query pattern %q", query, pattern)
+ }
+ }
+ }
+
+ // See if we have any patterns to pass through to go list. Zero initial
+ // patterns also requires a go list call, since it's the equivalent of
+ // ".".
+ if len(restPatterns) > 0 || len(patterns) == 0 {
+ dr, err := state.createDriverResponse(restPatterns...)
+ if err != nil {
+ return nil, err
+ }
+ response.addAll(dr)
+ }
+
+ if len(containFiles) != 0 {
+ if err := state.runContainsQueries(response, containFiles); err != nil {
+ return nil, err
+ }
+ }
+
+ // (We may yet return an error due to defer.)
+ return response.dr, nil
+}
+
+func (state *golistState) runContainsQueries(response *responseDeduper, queries []string) error {
+ for _, query := range queries {
+ // TODO(matloob): Do only one query per directory.
+ fdir := filepath.Dir(query)
+ // Pass absolute path of directory to go list so that it knows to treat it as a directory,
+ // not a package path.
+ pattern, err := filepath.Abs(fdir)
+ if err != nil {
+ return fmt.Errorf("could not determine absolute path of file= query path %q: %v", query, err)
+ }
+ dirResponse, err := state.createDriverResponse(pattern)
+
+ // If there was an error loading the package, or no packages are returned,
+ // or the package is returned with errors, try to load the file as an
+ // ad-hoc package.
+ // Usually the error will appear in a returned package, but may not if we're
+ // in module mode and the ad-hoc is located outside a module.
+ if err != nil || len(dirResponse.Packages) == 0 || len(dirResponse.Packages) == 1 && len(dirResponse.Packages[0].GoFiles) == 0 &&
+ len(dirResponse.Packages[0].Errors) == 1 {
+ var queryErr error
+ if dirResponse, queryErr = state.adhocPackage(pattern, query); queryErr != nil {
+ return err // return the original error
+ }
+ }
+ isRoot := make(map[string]bool, len(dirResponse.Roots))
+ for _, root := range dirResponse.Roots {
+ isRoot[root] = true
+ }
+ for _, pkg := range dirResponse.Packages {
+ // Add any new packages to the main set
+ // We don't bother to filter packages that will be dropped by the changes of roots,
+ // that will happen anyway during graph construction outside this function.
+ // Over-reporting packages is not a problem.
+ response.addPackage(pkg)
+ // if the package was not a root one, it cannot have the file
+ if !isRoot[pkg.ID] {
+ continue
+ }
+ for _, pkgFile := range pkg.GoFiles {
+ if filepath.Base(query) == filepath.Base(pkgFile) {
+ response.addRoot(pkg.ID)
+ break
+ }
+ }
+ }
+ }
+ return nil
+}
+
+// adhocPackage attempts to load or construct an ad-hoc package for a given
+// query, if the original call to the driver produced inadequate results.
+func (state *golistState) adhocPackage(pattern, query string) (*DriverResponse, error) {
+ response, err := state.createDriverResponse(query)
+ if err != nil {
+ return nil, err
+ }
+ // If we get nothing back from `go list`,
+ // try to make this file into its own ad-hoc package.
+ // TODO(rstambler): Should this check against the original response?
+ if len(response.Packages) == 0 {
+ response.Packages = append(response.Packages, &Package{
+ ID: "command-line-arguments",
+ PkgPath: query,
+ GoFiles: []string{query},
+ CompiledGoFiles: []string{query},
+ Imports: make(map[string]*Package),
+ })
+ response.Roots = append(response.Roots, "command-line-arguments")
+ }
+ // Handle special cases.
+ if len(response.Packages) == 1 {
+ // golang/go#33482: If this is a file= query for ad-hoc packages where
+ // the file only exists on an overlay, and exists outside of a module,
+ // add the file to the package and remove the errors.
+ if response.Packages[0].ID == "command-line-arguments" ||
+ filepath.ToSlash(response.Packages[0].PkgPath) == filepath.ToSlash(query) {
+ if len(response.Packages[0].GoFiles) == 0 {
+ filename := filepath.Join(pattern, filepath.Base(query)) // avoid recomputing abspath
+ // TODO(matloob): check if the file is outside of a root dir?
+ for path := range state.cfg.Overlay {
+ if path == filename {
+ response.Packages[0].Errors = nil
+ response.Packages[0].GoFiles = []string{path}
+ response.Packages[0].CompiledGoFiles = []string{path}
+ }
+ }
+ }
+ }
+ }
+ return response, nil
+}
+
+// Fields must match go list;
+// see $GOROOT/src/cmd/go/internal/load/pkg.go.
+type jsonPackage struct {
+ ImportPath string
+ Dir string
+ Name string
+ Export string
+ GoFiles []string
+ CompiledGoFiles []string
+ IgnoredGoFiles []string
+ IgnoredOtherFiles []string
+ EmbedPatterns []string
+ EmbedFiles []string
+ CFiles []string
+ CgoFiles []string
+ CXXFiles []string
+ MFiles []string
+ HFiles []string
+ FFiles []string
+ SFiles []string
+ SwigFiles []string
+ SwigCXXFiles []string
+ SysoFiles []string
+ Imports []string
+ ImportMap map[string]string
+ Deps []string
+ Module *Module
+ TestGoFiles []string
+ TestImports []string
+ XTestGoFiles []string
+ XTestImports []string
+ ForTest string // q in a "p [q.test]" package, else ""
+ DepOnly bool
+
+ Error *packagesinternal.PackageError
+ DepsErrors []*packagesinternal.PackageError
+}
+
+type jsonPackageError struct {
+ ImportStack []string
+ Pos string
+ Err string
+}
+
+func otherFiles(p *jsonPackage) [][]string {
+ return [][]string{p.CFiles, p.CXXFiles, p.MFiles, p.HFiles, p.FFiles, p.SFiles, p.SwigFiles, p.SwigCXXFiles, p.SysoFiles}
+}
+
+// createDriverResponse uses the "go list" command to expand the pattern
+// words and return a response for the specified packages.
+func (state *golistState) createDriverResponse(words ...string) (*DriverResponse, error) {
+ // go list uses the following identifiers in ImportPath and Imports:
+ //
+ // "p" -- importable package or main (command)
+ // "q.test" -- q's test executable
+ // "p [q.test]" -- variant of p as built for q's test executable
+ // "q_test [q.test]" -- q's external test package
+ //
+ // The packages p that are built differently for a test q.test
+ // are q itself, plus any helpers used by the external test q_test,
+ // typically including "testing" and all its dependencies.
+
+ // Run "go list" for complete
+ // information on the specified packages.
+ goVersion, err := state.getGoVersion()
+ if err != nil {
+ return nil, err
+ }
+ buf, err := state.invokeGo("list", golistargs(state.cfg, words, goVersion)...)
+ if err != nil {
+ return nil, err
+ }
+
+ seen := make(map[string]*jsonPackage)
+ pkgs := make(map[string]*Package)
+ additionalErrors := make(map[string][]Error)
+ // Decode the JSON and convert it to Package form.
+ response := &DriverResponse{
+ GoVersion: goVersion,
+ }
+ for dec := json.NewDecoder(buf); dec.More(); {
+ p := new(jsonPackage)
+ if err := dec.Decode(p); err != nil {
+ return nil, fmt.Errorf("JSON decoding failed: %v", err)
+ }
+
+ if p.ImportPath == "" {
+ // The documentation for go list says that “[e]rroneous packages will have
+ // a non-empty ImportPath”. If for some reason it comes back empty, we
+ // prefer to error out rather than silently discarding data or handing
+ // back a package without any way to refer to it.
+ if p.Error != nil {
+ return nil, Error{
+ Pos: p.Error.Pos,
+ Msg: p.Error.Err,
+ }
+ }
+ return nil, fmt.Errorf("package missing import path: %+v", p)
+ }
+
+ // Work around https://golang.org/issue/33157:
+ // go list -e, when given an absolute path, will find the package contained at
+ // that directory. But when no package exists there, it will return a fake package
+ // with an error and the ImportPath set to the absolute path provided to go list.
+ // Try to convert that absolute path to what its package path would be if it's
+ // contained in a known module or GOPATH entry. This will allow the package to be
+ // properly "reclaimed" when overlays are processed.
+ if filepath.IsAbs(p.ImportPath) && p.Error != nil {
+ pkgPath, ok, err := state.getPkgPath(p.ImportPath)
+ if err != nil {
+ return nil, err
+ }
+ if ok {
+ p.ImportPath = pkgPath
+ }
+ }
+
+ if old, found := seen[p.ImportPath]; found {
+ // If one version of the package has an error, and the other doesn't, assume
+ // that this is a case where go list is reporting a fake dependency variant
+ // of the imported package: When a package tries to invalidly import another
+ // package, go list emits a variant of the imported package (with the same
+ // import path, but with an error on it, and the package will have a
+ // DepError set on it). An example of when this can happen is for imports of
+ // main packages: main packages can not be imported, but they may be
+ // separately matched and listed by another pattern.
+ // See golang.org/issue/36188 for more details.
+
+ // The plan is that eventually, hopefully in Go 1.15, the error will be
+ // reported on the importing package rather than the duplicate "fake"
+ // version of the imported package. Once all supported versions of Go
+ // have the new behavior this logic can be deleted.
+ // TODO(matloob): delete the workaround logic once all supported versions of
+ // Go return the errors on the proper package.
+
+ // There should be exactly one version of a package that doesn't have an
+ // error.
+ if old.Error == nil && p.Error == nil {
+ if !reflect.DeepEqual(p, old) {
+ return nil, fmt.Errorf("internal error: go list gives conflicting information for package %v", p.ImportPath)
+ }
+ continue
+ }
+
+ // Determine if this package's error needs to be bubbled up.
+ // This is a hack, and we expect for go list to eventually set the error
+ // on the package.
+ if old.Error != nil {
+ var errkind string
+ if strings.Contains(old.Error.Err, "not an importable package") {
+ errkind = "not an importable package"
+ } else if strings.Contains(old.Error.Err, "use of internal package") && strings.Contains(old.Error.Err, "not allowed") {
+ errkind = "use of internal package not allowed"
+ }
+ if errkind != "" {
+ if len(old.Error.ImportStack) < 1 {
+ return nil, fmt.Errorf(`internal error: go list gave a %q error with empty import stack`, errkind)
+ }
+ importingPkg := old.Error.ImportStack[len(old.Error.ImportStack)-1]
+ if importingPkg == old.ImportPath {
+ // Using an older version of Go which put this package itself on top of import
+ // stack, instead of the importer. Look for importer in second from top
+ // position.
+ if len(old.Error.ImportStack) < 2 {
+ return nil, fmt.Errorf(`internal error: go list gave a %q error with an import stack without importing package`, errkind)
+ }
+ importingPkg = old.Error.ImportStack[len(old.Error.ImportStack)-2]
+ }
+ additionalErrors[importingPkg] = append(additionalErrors[importingPkg], Error{
+ Pos: old.Error.Pos,
+ Msg: old.Error.Err,
+ Kind: ListError,
+ })
+ }
+ }
+
+ // Make sure that if there's a version of the package without an error,
+ // that's the one reported to the user.
+ if old.Error == nil {
+ continue
+ }
+
+ // This package will replace the old one at the end of the loop.
+ }
+ seen[p.ImportPath] = p
+
+ pkg := &Package{
+ Name: p.Name,
+ ID: p.ImportPath,
+ GoFiles: absJoin(p.Dir, p.GoFiles, p.CgoFiles),
+ CompiledGoFiles: absJoin(p.Dir, p.CompiledGoFiles),
+ OtherFiles: absJoin(p.Dir, otherFiles(p)...),
+ EmbedFiles: absJoin(p.Dir, p.EmbedFiles),
+ EmbedPatterns: absJoin(p.Dir, p.EmbedPatterns),
+ IgnoredFiles: absJoin(p.Dir, p.IgnoredGoFiles, p.IgnoredOtherFiles),
+ forTest: p.ForTest,
+ depsErrors: p.DepsErrors,
+ Module: p.Module,
+ }
+
+ if (state.cfg.Mode&typecheckCgo) != 0 && len(p.CgoFiles) != 0 {
+ if len(p.CompiledGoFiles) > len(p.GoFiles) {
+ // We need the cgo definitions, which are in the first
+ // CompiledGoFile after the non-cgo ones. This is a hack but there
+ // isn't currently a better way to find it. We also need the pure
+ // Go files and unprocessed cgo files, all of which are already
+ // in pkg.GoFiles.
+ cgoTypes := p.CompiledGoFiles[len(p.GoFiles)]
+ pkg.CompiledGoFiles = append([]string{cgoTypes}, pkg.GoFiles...)
+ } else {
+ // golang/go#38990: go list silently fails to do cgo processing
+ pkg.CompiledGoFiles = nil
+ pkg.Errors = append(pkg.Errors, Error{
+ Msg: "go list failed to return CompiledGoFiles. This may indicate failure to perform cgo processing; try building at the command line. See https://golang.org/issue/38990.",
+ Kind: ListError,
+ })
+ }
+ }
+
+ // Work around https://golang.org/issue/28749:
+ // cmd/go puts assembly, C, and C++ files in CompiledGoFiles.
+ // Remove files from CompiledGoFiles that are non-go files
+ // (or are not files that look like they are from the cache).
+ if len(pkg.CompiledGoFiles) > 0 {
+ out := pkg.CompiledGoFiles[:0]
+ for _, f := range pkg.CompiledGoFiles {
+ if ext := filepath.Ext(f); ext != ".go" && ext != "" { // ext == "" means the file is from the cache, so probably cgo-processed file
+ continue
+ }
+ out = append(out, f)
+ }
+ pkg.CompiledGoFiles = out
+ }
+
+ // Extract the PkgPath from the package's ID.
+ if i := strings.IndexByte(pkg.ID, ' '); i >= 0 {
+ pkg.PkgPath = pkg.ID[:i]
+ } else {
+ pkg.PkgPath = pkg.ID
+ }
+
+ if pkg.PkgPath == "unsafe" {
+ pkg.CompiledGoFiles = nil // ignore fake unsafe.go file (#59929)
+ } else if len(pkg.CompiledGoFiles) == 0 {
+ // Work around for pre-go.1.11 versions of go list.
+ // TODO(matloob): they should be handled by the fallback.
+ // Can we delete this?
+ pkg.CompiledGoFiles = pkg.GoFiles
+ }
+
+ // Assume go list emits only absolute paths for Dir.
+ if p.Dir != "" && !filepath.IsAbs(p.Dir) {
+ log.Fatalf("internal error: go list returned non-absolute Package.Dir: %s", p.Dir)
+ }
+
+ if p.Export != "" && !filepath.IsAbs(p.Export) {
+ pkg.ExportFile = filepath.Join(p.Dir, p.Export)
+ } else {
+ pkg.ExportFile = p.Export
+ }
+
+ // imports
+ //
+ // Imports contains the IDs of all imported packages.
+ // ImportsMap records (path, ID) only where they differ.
+ ids := make(map[string]bool)
+ for _, id := range p.Imports {
+ ids[id] = true
+ }
+ pkg.Imports = make(map[string]*Package)
+ for path, id := range p.ImportMap {
+ pkg.Imports[path] = &Package{ID: id} // non-identity import
+ delete(ids, id)
+ }
+ for id := range ids {
+ if id == "C" {
+ continue
+ }
+
+ pkg.Imports[id] = &Package{ID: id} // identity import
+ }
+ if !p.DepOnly {
+ response.Roots = append(response.Roots, pkg.ID)
+ }
+
+ // Temporary work-around for golang/go#39986. Parse filenames out of
+ // error messages. This happens if there are unrecoverable syntax
+ // errors in the source, so we can't match on a specific error message.
+ //
+ // TODO(rfindley): remove this heuristic, in favor of considering
+ // InvalidGoFiles from the list driver.
+ if err := p.Error; err != nil && state.shouldAddFilenameFromError(p) {
+ addFilenameFromPos := func(pos string) bool {
+ split := strings.Split(pos, ":")
+ if len(split) < 1 {
+ return false
+ }
+ filename := strings.TrimSpace(split[0])
+ if filename == "" {
+ return false
+ }
+ if !filepath.IsAbs(filename) {
+ filename = filepath.Join(state.cfg.Dir, filename)
+ }
+ info, _ := os.Stat(filename)
+ if info == nil {
+ return false
+ }
+ pkg.CompiledGoFiles = append(pkg.CompiledGoFiles, filename)
+ pkg.GoFiles = append(pkg.GoFiles, filename)
+ return true
+ }
+ found := addFilenameFromPos(err.Pos)
+ // In some cases, go list only reports the error position in the
+ // error text, not the error position. One such case is when the
+ // file's package name is a keyword (see golang.org/issue/39763).
+ if !found {
+ addFilenameFromPos(err.Err)
+ }
+ }
+
+ if p.Error != nil {
+ msg := strings.TrimSpace(p.Error.Err) // Trim to work around golang.org/issue/32363.
+ // Address golang.org/issue/35964 by appending import stack to error message.
+ if msg == "import cycle not allowed" && len(p.Error.ImportStack) != 0 {
+ msg += fmt.Sprintf(": import stack: %v", p.Error.ImportStack)
+ }
+ pkg.Errors = append(pkg.Errors, Error{
+ Pos: p.Error.Pos,
+ Msg: msg,
+ Kind: ListError,
+ })
+ }
+
+ pkgs[pkg.ID] = pkg
+ }
+
+ for id, errs := range additionalErrors {
+ if p, ok := pkgs[id]; ok {
+ p.Errors = append(p.Errors, errs...)
+ }
+ }
+ for _, pkg := range pkgs {
+ response.Packages = append(response.Packages, pkg)
+ }
+ sort.Slice(response.Packages, func(i, j int) bool { return response.Packages[i].ID < response.Packages[j].ID })
+
+ return response, nil
+}
+
+func (state *golistState) shouldAddFilenameFromError(p *jsonPackage) bool {
+ if len(p.GoFiles) > 0 || len(p.CompiledGoFiles) > 0 {
+ return false
+ }
+
+ goV, err := state.getGoVersion()
+ if err != nil {
+ return false
+ }
+
+ // On Go 1.14 and earlier, only add filenames from errors if the import stack is empty.
+ // The import stack behaves differently for these versions than newer Go versions.
+ if goV < 15 {
+ return len(p.Error.ImportStack) == 0
+ }
+
+ // On Go 1.15 and later, only parse filenames out of error if there's no import stack,
+ // or the current package is at the top of the import stack. This is not guaranteed
+ // to work perfectly, but should avoid some cases where files in errors don't belong to this
+ // package.
+ return len(p.Error.ImportStack) == 0 || p.Error.ImportStack[len(p.Error.ImportStack)-1] == p.ImportPath
+}
+
+// getGoVersion returns the effective minor version of the go command.
+func (state *golistState) getGoVersion() (int, error) {
+ state.goVersionOnce.Do(func() {
+ state.goVersion, state.goVersionError = gocommand.GoVersion(state.ctx, state.cfgInvocation(), state.runner)
+ })
+ return state.goVersion, state.goVersionError
+}
+
+// getPkgPath finds the package path of a directory if it's relative to a root
+// directory.
+func (state *golistState) getPkgPath(dir string) (string, bool, error) {
+ absDir, err := filepath.Abs(dir)
+ if err != nil {
+ return "", false, err
+ }
+ roots, err := state.determineRootDirs()
+ if err != nil {
+ return "", false, err
+ }
+
+ for rdir, rpath := range roots {
+ // Make sure that the directory is in the module,
+ // to avoid creating a path relative to another module.
+ if !strings.HasPrefix(absDir, rdir) {
+ continue
+ }
+ // TODO(matloob): This doesn't properly handle symlinks.
+ r, err := filepath.Rel(rdir, dir)
+ if err != nil {
+ continue
+ }
+ if rpath != "" {
+ // We choose only one root even though the directory even it can belong in multiple modules
+ // or GOPATH entries. This is okay because we only need to work with absolute dirs when a
+ // file is missing from disk, for instance when gopls calls go/packages in an overlay.
+ // Once the file is saved, gopls, or the next invocation of the tool will get the correct
+ // result straight from golist.
+ // TODO(matloob): Implement module tiebreaking?
+ return path.Join(rpath, filepath.ToSlash(r)), true, nil
+ }
+ return filepath.ToSlash(r), true, nil
+ }
+ return "", false, nil
+}
+
+// absJoin absolutizes and flattens the lists of files.
+func absJoin(dir string, fileses ...[]string) (res []string) {
+ for _, files := range fileses {
+ for _, file := range files {
+ if !filepath.IsAbs(file) {
+ file = filepath.Join(dir, file)
+ }
+ res = append(res, file)
+ }
+ }
+ return res
+}
+
+func jsonFlag(cfg *Config, goVersion int) string {
+ if goVersion < 19 {
+ return "-json"
+ }
+ var fields []string
+ added := make(map[string]bool)
+ addFields := func(fs ...string) {
+ for _, f := range fs {
+ if !added[f] {
+ added[f] = true
+ fields = append(fields, f)
+ }
+ }
+ }
+ addFields("Name", "ImportPath", "Error") // These fields are always needed
+ if cfg.Mode&NeedFiles != 0 || cfg.Mode&(NeedTypes|NeedTypesInfo) != 0 {
+ addFields("Dir", "GoFiles", "IgnoredGoFiles", "IgnoredOtherFiles", "CFiles",
+ "CgoFiles", "CXXFiles", "MFiles", "HFiles", "FFiles", "SFiles",
+ "SwigFiles", "SwigCXXFiles", "SysoFiles")
+ if cfg.Tests {
+ addFields("TestGoFiles", "XTestGoFiles")
+ }
+ }
+ if cfg.Mode&(NeedTypes|NeedTypesInfo) != 0 {
+ // CompiledGoFiles seems to be required for the test case TestCgoNoSyntax,
+ // even when -compiled isn't passed in.
+ // TODO(#52435): Should we make the test ask for -compiled, or automatically
+ // request CompiledGoFiles in certain circumstances?
+ addFields("Dir", "CompiledGoFiles")
+ }
+ if cfg.Mode&NeedCompiledGoFiles != 0 {
+ addFields("Dir", "CompiledGoFiles", "Export")
+ }
+ if cfg.Mode&NeedImports != 0 {
+ // When imports are requested, DepOnly is used to distinguish between packages
+ // explicitly requested and transitive imports of those packages.
+ addFields("DepOnly", "Imports", "ImportMap")
+ if cfg.Tests {
+ addFields("TestImports", "XTestImports")
+ }
+ }
+ if cfg.Mode&NeedDeps != 0 {
+ addFields("DepOnly")
+ }
+ if usesExportData(cfg) {
+ // Request Dir in the unlikely case Export is not absolute.
+ addFields("Dir", "Export")
+ }
+ if cfg.Mode&needInternalForTest != 0 {
+ addFields("ForTest")
+ }
+ if cfg.Mode&needInternalDepsErrors != 0 {
+ addFields("DepsErrors")
+ }
+ if cfg.Mode&NeedModule != 0 {
+ addFields("Module")
+ }
+ if cfg.Mode&NeedEmbedFiles != 0 {
+ addFields("EmbedFiles")
+ }
+ if cfg.Mode&NeedEmbedPatterns != 0 {
+ addFields("EmbedPatterns")
+ }
+ return "-json=" + strings.Join(fields, ",")
+}
+
+func golistargs(cfg *Config, words []string, goVersion int) []string {
+ const findFlags = NeedImports | NeedTypes | NeedSyntax | NeedTypesInfo
+ fullargs := []string{
+ "-e", jsonFlag(cfg, goVersion),
+ fmt.Sprintf("-compiled=%t", cfg.Mode&(NeedCompiledGoFiles|NeedSyntax|NeedTypes|NeedTypesInfo|NeedTypesSizes) != 0),
+ fmt.Sprintf("-test=%t", cfg.Tests),
+ fmt.Sprintf("-export=%t", usesExportData(cfg)),
+ fmt.Sprintf("-deps=%t", cfg.Mode&NeedImports != 0),
+ // go list doesn't let you pass -test and -find together,
+ // probably because you'd just get the TestMain.
+ fmt.Sprintf("-find=%t", !cfg.Tests && cfg.Mode&findFlags == 0 && !usesExportData(cfg)),
+ }
+
+ // golang/go#60456: with go1.21 and later, go list serves pgo variants, which
+ // can be costly to compute and may result in redundant processing for the
+ // caller. Disable these variants. If someone wants to add e.g. a NeedPGO
+ // mode flag, that should be a separate proposal.
+ if goVersion >= 21 {
+ fullargs = append(fullargs, "-pgo=off")
+ }
+
+ fullargs = append(fullargs, cfg.BuildFlags...)
+ fullargs = append(fullargs, "--")
+ fullargs = append(fullargs, words...)
+ return fullargs
+}
+
+// cfgInvocation returns an Invocation that reflects cfg's settings.
+func (state *golistState) cfgInvocation() gocommand.Invocation {
+ cfg := state.cfg
+ return gocommand.Invocation{
+ BuildFlags: cfg.BuildFlags,
+ ModFile: cfg.modFile,
+ ModFlag: cfg.modFlag,
+ CleanEnv: cfg.Env != nil,
+ Env: cfg.Env,
+ Logf: cfg.Logf,
+ WorkingDir: cfg.Dir,
+ Overlay: state.overlay,
+ }
+}
+
+// invokeGo returns the stdout of a go command invocation.
+func (state *golistState) invokeGo(verb string, args ...string) (*bytes.Buffer, error) {
+ cfg := state.cfg
+
+ inv := state.cfgInvocation()
+ inv.Verb = verb
+ inv.Args = args
+
+ stdout, stderr, friendlyErr, err := state.runner.RunRaw(cfg.Context, inv)
+ if err != nil {
+ // Check for 'go' executable not being found.
+ if ee, ok := err.(*exec.Error); ok && ee.Err == exec.ErrNotFound {
+ return nil, fmt.Errorf("'go list' driver requires 'go', but %s", exec.ErrNotFound)
+ }
+
+ exitErr, ok := err.(*exec.ExitError)
+ if !ok {
+ // Catastrophic error:
+ // - context cancellation
+ return nil, fmt.Errorf("couldn't run 'go': %w", err)
+ }
+
+ // Old go version?
+ if strings.Contains(stderr.String(), "flag provided but not defined") {
+ return nil, goTooOldError{fmt.Errorf("unsupported version of go: %s: %s", exitErr, stderr)}
+ }
+
+ // Related to #24854
+ if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "unexpected directory layout") {
+ return nil, friendlyErr
+ }
+
+ // Return an error if 'go list' failed due to missing tools in
+ // $GOROOT/pkg/tool/$GOOS_$GOARCH (#69606).
+ if len(stderr.String()) > 0 && strings.Contains(stderr.String(), `go: no such tool`) {
+ return nil, friendlyErr
+ }
+
+ // Is there an error running the C compiler in cgo? This will be reported in the "Error" field
+ // and should be suppressed by go list -e.
+ //
+ // This condition is not perfect yet because the error message can include other error messages than runtime/cgo.
+ isPkgPathRune := func(r rune) bool {
+ // From https://golang.org/ref/spec#Import_declarations:
+ // Implementation restriction: A compiler may restrict ImportPaths to non-empty strings
+ // using only characters belonging to Unicode's L, M, N, P, and S general categories
+ // (the Graphic characters without spaces) and may also exclude the
+ // characters !"#$%&'()*,:;<=>?[\]^`{|} and the Unicode replacement character U+FFFD.
+ return unicode.IsOneOf([]*unicode.RangeTable{unicode.L, unicode.M, unicode.N, unicode.P, unicode.S}, r) &&
+ !strings.ContainsRune("!\"#$%&'()*,:;<=>?[\\]^`{|}\uFFFD", r)
+ }
+ // golang/go#36770: Handle case where cmd/go prints module download messages before the error.
+ msg := stderr.String()
+ for strings.HasPrefix(msg, "go: downloading") {
+ msg = msg[strings.IndexRune(msg, '\n')+1:]
+ }
+ if len(stderr.String()) > 0 && strings.HasPrefix(stderr.String(), "# ") {
+ msg := msg[len("# "):]
+ if strings.HasPrefix(strings.TrimLeftFunc(msg, isPkgPathRune), "\n") {
+ return stdout, nil
+ }
+ // Treat pkg-config errors as a special case (golang.org/issue/36770).
+ if strings.HasPrefix(msg, "pkg-config") {
+ return stdout, nil
+ }
+ }
+
+ // This error only appears in stderr. See golang.org/cl/166398 for a fix in go list to show
+ // the error in the Err section of stdout in case -e option is provided.
+ // This fix is provided for backwards compatibility.
+ if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "named files must be .go files") {
+ output := fmt.Sprintf(`{"ImportPath": "command-line-arguments","Incomplete": true,"Error": {"Pos": "","Err": %q}}`,
+ strings.Trim(stderr.String(), "\n"))
+ return bytes.NewBufferString(output), nil
+ }
+
+ // Similar to the previous error, but currently lacks a fix in Go.
+ if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "named files must all be in one directory") {
+ output := fmt.Sprintf(`{"ImportPath": "command-line-arguments","Incomplete": true,"Error": {"Pos": "","Err": %q}}`,
+ strings.Trim(stderr.String(), "\n"))
+ return bytes.NewBufferString(output), nil
+ }
+
+ // Backwards compatibility for Go 1.11 because 1.12 and 1.13 put the directory in the ImportPath.
+ // If the package doesn't exist, put the absolute path of the directory into the error message,
+ // as Go 1.13 list does.
+ const noSuchDirectory = "no such directory"
+ if len(stderr.String()) > 0 && strings.Contains(stderr.String(), noSuchDirectory) {
+ errstr := stderr.String()
+ abspath := strings.TrimSpace(errstr[strings.Index(errstr, noSuchDirectory)+len(noSuchDirectory):])
+ output := fmt.Sprintf(`{"ImportPath": %q,"Incomplete": true,"Error": {"Pos": "","Err": %q}}`,
+ abspath, strings.Trim(stderr.String(), "\n"))
+ return bytes.NewBufferString(output), nil
+ }
+
+ // Workaround for #29280: go list -e has incorrect behavior when an ad-hoc package doesn't exist.
+ // Note that the error message we look for in this case is different that the one looked for above.
+ if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "no such file or directory") {
+ output := fmt.Sprintf(`{"ImportPath": "command-line-arguments","Incomplete": true,"Error": {"Pos": "","Err": %q}}`,
+ strings.Trim(stderr.String(), "\n"))
+ return bytes.NewBufferString(output), nil
+ }
+
+ // Workaround for #34273. go list -e with GO111MODULE=on has incorrect behavior when listing a
+ // directory outside any module.
+ if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "outside available modules") {
+ output := fmt.Sprintf(`{"ImportPath": %q,"Incomplete": true,"Error": {"Pos": "","Err": %q}}`,
+ // TODO(matloob): command-line-arguments isn't correct here.
+ "command-line-arguments", strings.Trim(stderr.String(), "\n"))
+ return bytes.NewBufferString(output), nil
+ }
+
+ // Another variation of the previous error
+ if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "outside module root") {
+ output := fmt.Sprintf(`{"ImportPath": %q,"Incomplete": true,"Error": {"Pos": "","Err": %q}}`,
+ // TODO(matloob): command-line-arguments isn't correct here.
+ "command-line-arguments", strings.Trim(stderr.String(), "\n"))
+ return bytes.NewBufferString(output), nil
+ }
+
+ // Workaround for an instance of golang.org/issue/26755: go list -e will return a non-zero exit
+ // status if there's a dependency on a package that doesn't exist. But it should return
+ // a zero exit status and set an error on that package.
+ if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "no Go files in") {
+ // Don't clobber stdout if `go list` actually returned something.
+ if len(stdout.String()) > 0 {
+ return stdout, nil
+ }
+ // try to extract package name from string
+ stderrStr := stderr.String()
+ var importPath string
+ colon := strings.Index(stderrStr, ":")
+ if colon > 0 && strings.HasPrefix(stderrStr, "go build ") {
+ importPath = stderrStr[len("go build "):colon]
+ }
+ output := fmt.Sprintf(`{"ImportPath": %q,"Incomplete": true,"Error": {"Pos": "","Err": %q}}`,
+ importPath, strings.Trim(stderrStr, "\n"))
+ return bytes.NewBufferString(output), nil
+ }
+
+ // Export mode entails a build.
+ // If that build fails, errors appear on stderr
+ // (despite the -e flag) and the Export field is blank.
+ // Do not fail in that case.
+ // The same is true if an ad-hoc package given to go list doesn't exist.
+ // TODO(matloob): Remove these once we can depend on go list to exit with a zero status with -e even when
+ // packages don't exist or a build fails.
+ if !usesExportData(cfg) && !containsGoFile(args) {
+ return nil, friendlyErr
+ }
+ }
+ return stdout, nil
+}
+
+func containsGoFile(s []string) bool {
+ for _, f := range s {
+ if strings.HasSuffix(f, ".go") {
+ return true
+ }
+ }
+ return false
+}
+
+func cmdDebugStr(cmd *exec.Cmd) string {
+ env := make(map[string]string)
+ for _, kv := range cmd.Env {
+ split := strings.SplitN(kv, "=", 2)
+ k, v := split[0], split[1]
+ env[k] = v
+ }
+
+ var args []string
+ for _, arg := range cmd.Args {
+ quoted := strconv.Quote(arg)
+ if quoted[1:len(quoted)-1] != arg || strings.Contains(arg, " ") {
+ args = append(args, quoted)
+ } else {
+ args = append(args, arg)
+ }
+ }
+ return fmt.Sprintf("GOROOT=%v GOPATH=%v GO111MODULE=%v GOPROXY=%v PWD=%v %v", env["GOROOT"], env["GOPATH"], env["GO111MODULE"], env["GOPROXY"], env["PWD"], strings.Join(args, " "))
+}
+
+// getSizesForArgs queries 'go list' for the appropriate
+// Compiler and GOARCH arguments to pass to [types.SizesFor].
+func getSizesForArgs(ctx context.Context, inv gocommand.Invocation, gocmdRunner *gocommand.Runner) (string, string, error) {
+ inv.Verb = "list"
+ inv.Args = []string{"-f", "{{context.GOARCH}} {{context.Compiler}}", "--", "unsafe"}
+ stdout, stderr, friendlyErr, rawErr := gocmdRunner.RunRaw(ctx, inv)
+ var goarch, compiler string
+ if rawErr != nil {
+ rawErrMsg := rawErr.Error()
+ if strings.Contains(rawErrMsg, "cannot find main module") ||
+ strings.Contains(rawErrMsg, "go.mod file not found") {
+ // User's running outside of a module.
+ // All bets are off. Get GOARCH and guess compiler is gc.
+ // TODO(matloob): Is this a problem in practice?
+ inv.Verb = "env"
+ inv.Args = []string{"GOARCH"}
+ envout, enverr := gocmdRunner.Run(ctx, inv)
+ if enverr != nil {
+ return "", "", enverr
+ }
+ goarch = strings.TrimSpace(envout.String())
+ compiler = "gc"
+ } else if friendlyErr != nil {
+ return "", "", friendlyErr
+ } else {
+ // This should be unreachable, but be defensive
+ // in case RunRaw's error results are inconsistent.
+ return "", "", rawErr
+ }
+ } else {
+ fields := strings.Fields(stdout.String())
+ if len(fields) < 2 {
+ return "", "", fmt.Errorf("could not parse GOARCH and Go compiler in format \" \":\nstdout: <<%s>>\nstderr: <<%s>>",
+ stdout.String(), stderr.String())
+ }
+ goarch = fields[0]
+ compiler = fields[1]
+ }
+ return compiler, goarch, nil
+}
diff --git a/vendor/golang.org/x/tools/go/packages/golist_overlay.go b/vendor/golang.org/x/tools/go/packages/golist_overlay.go
new file mode 100644
index 00000000..d823c474
--- /dev/null
+++ b/vendor/golang.org/x/tools/go/packages/golist_overlay.go
@@ -0,0 +1,83 @@
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package packages
+
+import (
+ "encoding/json"
+ "path/filepath"
+
+ "golang.org/x/tools/internal/gocommand"
+)
+
+// determineRootDirs returns a mapping from absolute directories that could
+// contain code to their corresponding import path prefixes.
+func (state *golistState) determineRootDirs() (map[string]string, error) {
+ env, err := state.getEnv()
+ if err != nil {
+ return nil, err
+ }
+ if env["GOMOD"] != "" {
+ state.rootsOnce.Do(func() {
+ state.rootDirs, state.rootDirsError = state.determineRootDirsModules()
+ })
+ } else {
+ state.rootsOnce.Do(func() {
+ state.rootDirs, state.rootDirsError = state.determineRootDirsGOPATH()
+ })
+ }
+ return state.rootDirs, state.rootDirsError
+}
+
+func (state *golistState) determineRootDirsModules() (map[string]string, error) {
+ // List all of the modules--the first will be the directory for the main
+ // module. Any replaced modules will also need to be treated as roots.
+ // Editing files in the module cache isn't a great idea, so we don't
+ // plan to ever support that.
+ out, err := state.invokeGo("list", "-m", "-json", "all")
+ if err != nil {
+ // 'go list all' will fail if we're outside of a module and
+ // GO111MODULE=on. Try falling back without 'all'.
+ var innerErr error
+ out, innerErr = state.invokeGo("list", "-m", "-json")
+ if innerErr != nil {
+ return nil, err
+ }
+ }
+ roots := map[string]string{}
+ modules := map[string]string{}
+ var i int
+ for dec := json.NewDecoder(out); dec.More(); {
+ mod := new(gocommand.ModuleJSON)
+ if err := dec.Decode(mod); err != nil {
+ return nil, err
+ }
+ if mod.Dir != "" && mod.Path != "" {
+ // This is a valid module; add it to the map.
+ absDir, err := filepath.Abs(mod.Dir)
+ if err != nil {
+ return nil, err
+ }
+ modules[absDir] = mod.Path
+ // The first result is the main module.
+ if i == 0 || mod.Replace != nil && mod.Replace.Path != "" {
+ roots[absDir] = mod.Path
+ }
+ }
+ i++
+ }
+ return roots, nil
+}
+
+func (state *golistState) determineRootDirsGOPATH() (map[string]string, error) {
+ m := map[string]string{}
+ for _, dir := range filepath.SplitList(state.mustGetEnv()["GOPATH"]) {
+ absDir, err := filepath.Abs(dir)
+ if err != nil {
+ return nil, err
+ }
+ m[filepath.Join(absDir, "src")] = ""
+ }
+ return m, nil
+}
diff --git a/vendor/golang.org/x/tools/go/packages/loadmode_string.go b/vendor/golang.org/x/tools/go/packages/loadmode_string.go
new file mode 100644
index 00000000..5fcad6ea
--- /dev/null
+++ b/vendor/golang.org/x/tools/go/packages/loadmode_string.go
@@ -0,0 +1,54 @@
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package packages
+
+import (
+ "fmt"
+ "strings"
+)
+
+var modes = [...]struct {
+ mode LoadMode
+ name string
+}{
+ {NeedName, "NeedName"},
+ {NeedFiles, "NeedFiles"},
+ {NeedCompiledGoFiles, "NeedCompiledGoFiles"},
+ {NeedImports, "NeedImports"},
+ {NeedDeps, "NeedDeps"},
+ {NeedExportFile, "NeedExportFile"},
+ {NeedTypes, "NeedTypes"},
+ {NeedSyntax, "NeedSyntax"},
+ {NeedTypesInfo, "NeedTypesInfo"},
+ {NeedTypesSizes, "NeedTypesSizes"},
+ {NeedModule, "NeedModule"},
+ {NeedEmbedFiles, "NeedEmbedFiles"},
+ {NeedEmbedPatterns, "NeedEmbedPatterns"},
+}
+
+func (mode LoadMode) String() string {
+ if mode == 0 {
+ return "LoadMode(0)"
+ }
+ var out []string
+ // named bits
+ for _, item := range modes {
+ if (mode & item.mode) != 0 {
+ mode ^= item.mode
+ out = append(out, item.name)
+ }
+ }
+ // unnamed residue
+ if mode != 0 {
+ if out == nil {
+ return fmt.Sprintf("LoadMode(%#x)", int(mode))
+ }
+ out = append(out, fmt.Sprintf("%#x", int(mode)))
+ }
+ if len(out) == 1 {
+ return out[0]
+ }
+ return "(" + strings.Join(out, "|") + ")"
+}
diff --git a/vendor/golang.org/x/tools/go/packages/packages.go b/vendor/golang.org/x/tools/go/packages/packages.go
new file mode 100644
index 00000000..2ecc6423
--- /dev/null
+++ b/vendor/golang.org/x/tools/go/packages/packages.go
@@ -0,0 +1,1562 @@
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package packages
+
+// See doc.go for package documentation and implementation notes.
+
+import (
+ "context"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "go/ast"
+ "go/parser"
+ "go/scanner"
+ "go/token"
+ "go/types"
+ "log"
+ "os"
+ "path/filepath"
+ "runtime"
+ "strings"
+ "sync"
+ "sync/atomic"
+ "time"
+
+ "golang.org/x/sync/errgroup"
+
+ "golang.org/x/tools/go/gcexportdata"
+ "golang.org/x/tools/internal/gocommand"
+ "golang.org/x/tools/internal/packagesinternal"
+ "golang.org/x/tools/internal/typesinternal"
+)
+
+// A LoadMode controls the amount of detail to return when loading.
+// The bits below can be combined to specify which fields should be
+// filled in the result packages.
+//
+// The zero value is a special case, equivalent to combining
+// the NeedName, NeedFiles, and NeedCompiledGoFiles bits.
+//
+// ID and Errors (if present) will always be filled.
+// [Load] may return more information than requested.
+//
+// Unfortunately there are a number of open bugs related to
+// interactions among the LoadMode bits:
+// - https://github.com/golang/go/issues/56633
+// - https://github.com/golang/go/issues/56677
+// - https://github.com/golang/go/issues/58726
+// - https://github.com/golang/go/issues/63517
+type LoadMode int
+
+const (
+ // NeedName adds Name and PkgPath.
+ NeedName LoadMode = 1 << iota
+
+ // NeedFiles adds GoFiles, OtherFiles, and IgnoredFiles
+ NeedFiles
+
+ // NeedCompiledGoFiles adds CompiledGoFiles.
+ NeedCompiledGoFiles
+
+ // NeedImports adds Imports. If NeedDeps is not set, the Imports field will contain
+ // "placeholder" Packages with only the ID set.
+ NeedImports
+
+ // NeedDeps adds the fields requested by the LoadMode in the packages in Imports.
+ NeedDeps
+
+ // NeedExportFile adds ExportFile.
+ NeedExportFile
+
+ // NeedTypes adds Types, Fset, and IllTyped.
+ NeedTypes
+
+ // NeedSyntax adds Syntax and Fset.
+ NeedSyntax
+
+ // NeedTypesInfo adds TypesInfo and Fset.
+ NeedTypesInfo
+
+ // NeedTypesSizes adds TypesSizes.
+ NeedTypesSizes
+
+ // needInternalDepsErrors adds the internal deps errors field for use by gopls.
+ needInternalDepsErrors
+
+ // needInternalForTest adds the internal forTest field.
+ // Tests must also be set on the context for this field to be populated.
+ needInternalForTest
+
+ // typecheckCgo enables full support for type checking cgo. Requires Go 1.15+.
+ // Modifies CompiledGoFiles and Types, and has no effect on its own.
+ typecheckCgo
+
+ // NeedModule adds Module.
+ NeedModule
+
+ // NeedEmbedFiles adds EmbedFiles.
+ NeedEmbedFiles
+
+ // NeedEmbedPatterns adds EmbedPatterns.
+ NeedEmbedPatterns
+
+ // Be sure to update loadmode_string.go when adding new items!
+)
+
+const (
+ // LoadFiles loads the name and file names for the initial packages.
+ //
+ // Deprecated: LoadFiles exists for historical compatibility
+ // and should not be used. Please directly specify the needed fields using the Need values.
+ LoadFiles = NeedName | NeedFiles | NeedCompiledGoFiles
+
+ // LoadImports loads the name, file names, and import mapping for the initial packages.
+ //
+ // Deprecated: LoadImports exists for historical compatibility
+ // and should not be used. Please directly specify the needed fields using the Need values.
+ LoadImports = LoadFiles | NeedImports
+
+ // LoadTypes loads exported type information for the initial packages.
+ //
+ // Deprecated: LoadTypes exists for historical compatibility
+ // and should not be used. Please directly specify the needed fields using the Need values.
+ LoadTypes = LoadImports | NeedTypes | NeedTypesSizes
+
+ // LoadSyntax loads typed syntax for the initial packages.
+ //
+ // Deprecated: LoadSyntax exists for historical compatibility
+ // and should not be used. Please directly specify the needed fields using the Need values.
+ LoadSyntax = LoadTypes | NeedSyntax | NeedTypesInfo
+
+ // LoadAllSyntax loads typed syntax for the initial packages and all dependencies.
+ //
+ // Deprecated: LoadAllSyntax exists for historical compatibility
+ // and should not be used. Please directly specify the needed fields using the Need values.
+ LoadAllSyntax = LoadSyntax | NeedDeps
+
+ // Deprecated: NeedExportsFile is a historical misspelling of NeedExportFile.
+ NeedExportsFile = NeedExportFile
+)
+
+// A Config specifies details about how packages should be loaded.
+// The zero value is a valid configuration.
+//
+// Calls to [Load] do not modify this struct.
+type Config struct {
+ // Mode controls the level of information returned for each package.
+ Mode LoadMode
+
+ // Context specifies the context for the load operation.
+ // Cancelling the context may cause [Load] to abort and
+ // return an error.
+ Context context.Context
+
+ // Logf is the logger for the config.
+ // If the user provides a logger, debug logging is enabled.
+ // If the GOPACKAGESDEBUG environment variable is set to true,
+ // but the logger is nil, default to log.Printf.
+ Logf func(format string, args ...interface{})
+
+ // Dir is the directory in which to run the build system's query tool
+ // that provides information about the packages.
+ // If Dir is empty, the tool is run in the current directory.
+ Dir string
+
+ // Env is the environment to use when invoking the build system's query tool.
+ // If Env is nil, the current environment is used.
+ // As in os/exec's Cmd, only the last value in the slice for
+ // each environment key is used. To specify the setting of only
+ // a few variables, append to the current environment, as in:
+ //
+ // opt.Env = append(os.Environ(), "GOOS=plan9", "GOARCH=386")
+ //
+ Env []string
+
+ // BuildFlags is a list of command-line flags to be passed through to
+ // the build system's query tool.
+ BuildFlags []string
+
+ // Fset provides source position information for syntax trees and types.
+ // If Fset is nil, Load will use a new fileset, but preserve Fset's value.
+ Fset *token.FileSet
+
+ // ParseFile is called to read and parse each file
+ // when preparing a package's type-checked syntax tree.
+ // It must be safe to call ParseFile simultaneously from multiple goroutines.
+ // If ParseFile is nil, the loader will uses parser.ParseFile.
+ //
+ // ParseFile should parse the source from src and use filename only for
+ // recording position information.
+ //
+ // An application may supply a custom implementation of ParseFile
+ // to change the effective file contents or the behavior of the parser,
+ // or to modify the syntax tree. For example, selectively eliminating
+ // unwanted function bodies can significantly accelerate type checking.
+ ParseFile func(fset *token.FileSet, filename string, src []byte) (*ast.File, error)
+
+ // If Tests is set, the loader includes not just the packages
+ // matching a particular pattern but also any related test packages,
+ // including test-only variants of the package and the test executable.
+ //
+ // For example, when using the go command, loading "fmt" with Tests=true
+ // returns four packages, with IDs "fmt" (the standard package),
+ // "fmt [fmt.test]" (the package as compiled for the test),
+ // "fmt_test" (the test functions from source files in package fmt_test),
+ // and "fmt.test" (the test binary).
+ //
+ // In build systems with explicit names for tests,
+ // setting Tests may have no effect.
+ Tests bool
+
+ // Overlay is a mapping from absolute file paths to file contents.
+ //
+ // For each map entry, [Load] uses the alternative file
+ // contents provided by the overlay mapping instead of reading
+ // from the file system. This mechanism can be used to enable
+ // editor-integrated tools to correctly analyze the contents
+ // of modified but unsaved buffers, for example.
+ //
+ // The overlay mapping is passed to the build system's driver
+ // (see "The driver protocol") so that it too can report
+ // consistent package metadata about unsaved files. However,
+ // drivers may vary in their level of support for overlays.
+ Overlay map[string][]byte
+
+ // -- Hidden configuration fields only for use in x/tools --
+
+ // modFile will be used for -modfile in go command invocations.
+ modFile string
+
+ // modFlag will be used for -modfile in go command invocations.
+ modFlag string
+}
+
+// Load loads and returns the Go packages named by the given patterns.
+//
+// The cfg parameter specifies loading options; nil behaves the same as an empty [Config].
+//
+// The [Config.Mode] field is a set of bits that determine what kinds
+// of information should be computed and returned. Modes that require
+// more information tend to be slower. See [LoadMode] for details
+// and important caveats. Its zero value is equivalent to
+// [NeedName] | [NeedFiles] | [NeedCompiledGoFiles].
+//
+// Each call to Load returns a new set of [Package] instances.
+// The Packages and their Imports form a directed acyclic graph.
+//
+// If the [NeedTypes] mode flag was set, each call to Load uses a new
+// [types.Importer], so [types.Object] and [types.Type] values from
+// different calls to Load must not be mixed as they will have
+// inconsistent notions of type identity.
+//
+// If any of the patterns was invalid as defined by the
+// underlying build system, Load returns an error.
+// It may return an empty list of packages without an error,
+// for instance for an empty expansion of a valid wildcard.
+// Errors associated with a particular package are recorded in the
+// corresponding Package's Errors list, and do not cause Load to
+// return an error. Clients may need to handle such errors before
+// proceeding with further analysis. The [PrintErrors] function is
+// provided for convenient display of all errors.
+func Load(cfg *Config, patterns ...string) ([]*Package, error) {
+ ld := newLoader(cfg)
+ response, external, err := defaultDriver(&ld.Config, patterns...)
+ if err != nil {
+ return nil, err
+ }
+
+ ld.sizes = types.SizesFor(response.Compiler, response.Arch)
+ if ld.sizes == nil && ld.Config.Mode&(NeedTypes|NeedTypesSizes|NeedTypesInfo) != 0 {
+ // Type size information is needed but unavailable.
+ if external {
+ // An external driver may fail to populate the Compiler/GOARCH fields,
+ // especially since they are relatively new (see #63700).
+ // Provide a sensible fallback in this case.
+ ld.sizes = types.SizesFor("gc", runtime.GOARCH)
+ if ld.sizes == nil { // gccgo-only arch
+ ld.sizes = types.SizesFor("gc", "amd64")
+ }
+ } else {
+ // Go list should never fail to deliver accurate size information.
+ // Reject the whole Load since the error is the same for every package.
+ return nil, fmt.Errorf("can't determine type sizes for compiler %q on GOARCH %q",
+ response.Compiler, response.Arch)
+ }
+ }
+
+ return ld.refine(response)
+}
+
+// defaultDriver is a driver that implements go/packages' fallback behavior.
+// It will try to request to an external driver, if one exists. If there's
+// no external driver, or the driver returns a response with NotHandled set,
+// defaultDriver will fall back to the go list driver.
+// The boolean result indicates that an external driver handled the request.
+func defaultDriver(cfg *Config, patterns ...string) (*DriverResponse, bool, error) {
+ const (
+ // windowsArgMax specifies the maximum command line length for
+ // the Windows' CreateProcess function.
+ windowsArgMax = 32767
+ // maxEnvSize is a very rough estimation of the maximum environment
+ // size of a user.
+ maxEnvSize = 16384
+ // safeArgMax specifies the maximum safe command line length to use
+ // by the underlying driver excl. the environment. We choose the Windows'
+ // ARG_MAX as the starting point because it's one of the lowest ARG_MAX
+ // constants out of the different supported platforms,
+ // e.g., https://www.in-ulm.de/~mascheck/various/argmax/#results.
+ safeArgMax = windowsArgMax - maxEnvSize
+ )
+ chunks, err := splitIntoChunks(patterns, safeArgMax)
+ if err != nil {
+ return nil, false, err
+ }
+
+ if driver := findExternalDriver(cfg); driver != nil {
+ response, err := callDriverOnChunks(driver, cfg, chunks)
+ if err != nil {
+ return nil, false, err
+ } else if !response.NotHandled {
+ return response, true, nil
+ }
+ // not handled: fall through
+ }
+
+ // go list fallback
+
+ // Write overlays once, as there are many calls
+ // to 'go list' (one per chunk plus others too).
+ overlayFile, cleanupOverlay, err := gocommand.WriteOverlays(cfg.Overlay)
+ if err != nil {
+ return nil, false, err
+ }
+ defer cleanupOverlay()
+
+ var runner gocommand.Runner // (shared across many 'go list' calls)
+ driver := func(cfg *Config, patterns []string) (*DriverResponse, error) {
+ return goListDriver(cfg, &runner, overlayFile, patterns)
+ }
+ response, err := callDriverOnChunks(driver, cfg, chunks)
+ if err != nil {
+ return nil, false, err
+ }
+ return response, false, err
+}
+
+// splitIntoChunks chunks the slice so that the total number of characters
+// in a chunk is no longer than argMax.
+func splitIntoChunks(patterns []string, argMax int) ([][]string, error) {
+ if argMax <= 0 {
+ return nil, errors.New("failed to split patterns into chunks, negative safe argMax value")
+ }
+ var chunks [][]string
+ charsInChunk := 0
+ nextChunkStart := 0
+ for i, v := range patterns {
+ vChars := len(v)
+ if vChars > argMax {
+ // a single pattern is longer than the maximum safe ARG_MAX, hardly should happen
+ return nil, errors.New("failed to split patterns into chunks, a pattern is too long")
+ }
+ charsInChunk += vChars + 1 // +1 is for a whitespace between patterns that has to be counted too
+ if charsInChunk > argMax {
+ chunks = append(chunks, patterns[nextChunkStart:i])
+ nextChunkStart = i
+ charsInChunk = vChars
+ }
+ }
+ // add the last chunk
+ if nextChunkStart < len(patterns) {
+ chunks = append(chunks, patterns[nextChunkStart:])
+ }
+ return chunks, nil
+}
+
+func callDriverOnChunks(driver driver, cfg *Config, chunks [][]string) (*DriverResponse, error) {
+ if len(chunks) == 0 {
+ return driver(cfg, nil)
+ }
+ responses := make([]*DriverResponse, len(chunks))
+ errNotHandled := errors.New("driver returned NotHandled")
+ var g errgroup.Group
+ for i, chunk := range chunks {
+ g.Go(func() (err error) {
+ responses[i], err = driver(cfg, chunk)
+ if responses[i] != nil && responses[i].NotHandled {
+ err = errNotHandled
+ }
+ return err
+ })
+ }
+ if err := g.Wait(); err != nil {
+ if errors.Is(err, errNotHandled) {
+ return &DriverResponse{NotHandled: true}, nil
+ }
+ return nil, err
+ }
+ return mergeResponses(responses...), nil
+}
+
+func mergeResponses(responses ...*DriverResponse) *DriverResponse {
+ if len(responses) == 0 {
+ return nil
+ }
+ response := newDeduper()
+ response.dr.NotHandled = false
+ response.dr.Compiler = responses[0].Compiler
+ response.dr.Arch = responses[0].Arch
+ response.dr.GoVersion = responses[0].GoVersion
+ for _, v := range responses {
+ response.addAll(v)
+ }
+ return response.dr
+}
+
+// A Package describes a loaded Go package.
+//
+// It also defines part of the JSON schema of [DriverResponse].
+// See the package documentation for an overview.
+type Package struct {
+ // ID is a unique identifier for a package,
+ // in a syntax provided by the underlying build system.
+ //
+ // Because the syntax varies based on the build system,
+ // clients should treat IDs as opaque and not attempt to
+ // interpret them.
+ ID string
+
+ // Name is the package name as it appears in the package source code.
+ Name string
+
+ // PkgPath is the package path as used by the go/types package.
+ PkgPath string
+
+ // Errors contains any errors encountered querying the metadata
+ // of the package, or while parsing or type-checking its files.
+ Errors []Error
+
+ // TypeErrors contains the subset of errors produced during type checking.
+ TypeErrors []types.Error
+
+ // GoFiles lists the absolute file paths of the package's Go source files.
+ // It may include files that should not be compiled, for example because
+ // they contain non-matching build tags, are documentary pseudo-files such as
+ // unsafe/unsafe.go or builtin/builtin.go, or are subject to cgo preprocessing.
+ GoFiles []string
+
+ // CompiledGoFiles lists the absolute file paths of the package's source
+ // files that are suitable for type checking.
+ // This may differ from GoFiles if files are processed before compilation.
+ CompiledGoFiles []string
+
+ // OtherFiles lists the absolute file paths of the package's non-Go source files,
+ // including assembly, C, C++, Fortran, Objective-C, SWIG, and so on.
+ OtherFiles []string
+
+ // EmbedFiles lists the absolute file paths of the package's files
+ // embedded with go:embed.
+ EmbedFiles []string
+
+ // EmbedPatterns lists the absolute file patterns of the package's
+ // files embedded with go:embed.
+ EmbedPatterns []string
+
+ // IgnoredFiles lists source files that are not part of the package
+ // using the current build configuration but that might be part of
+ // the package using other build configurations.
+ IgnoredFiles []string
+
+ // ExportFile is the absolute path to a file containing type
+ // information for the package as provided by the build system.
+ ExportFile string
+
+ // Imports maps import paths appearing in the package's Go source files
+ // to corresponding loaded Packages.
+ Imports map[string]*Package
+
+ // Module is the module information for the package if it exists.
+ //
+ // Note: it may be missing for std and cmd; see Go issue #65816.
+ Module *Module
+
+ // -- The following fields are not part of the driver JSON schema. --
+
+ // Types provides type information for the package.
+ // The NeedTypes LoadMode bit sets this field for packages matching the
+ // patterns; type information for dependencies may be missing or incomplete,
+ // unless NeedDeps and NeedImports are also set.
+ //
+ // Each call to [Load] returns a consistent set of type
+ // symbols, as defined by the comment at [types.Identical].
+ // Avoid mixing type information from two or more calls to [Load].
+ Types *types.Package `json:"-"`
+
+ // Fset provides position information for Types, TypesInfo, and Syntax.
+ // It is set only when Types is set.
+ Fset *token.FileSet `json:"-"`
+
+ // IllTyped indicates whether the package or any dependency contains errors.
+ // It is set only when Types is set.
+ IllTyped bool `json:"-"`
+
+ // Syntax is the package's syntax trees, for the files listed in CompiledGoFiles.
+ //
+ // The NeedSyntax LoadMode bit populates this field for packages matching the patterns.
+ // If NeedDeps and NeedImports are also set, this field will also be populated
+ // for dependencies.
+ //
+ // Syntax is kept in the same order as CompiledGoFiles, with the caveat that nils are
+ // removed. If parsing returned nil, Syntax may be shorter than CompiledGoFiles.
+ Syntax []*ast.File `json:"-"`
+
+ // TypesInfo provides type information about the package's syntax trees.
+ // It is set only when Syntax is set.
+ TypesInfo *types.Info `json:"-"`
+
+ // TypesSizes provides the effective size function for types in TypesInfo.
+ TypesSizes types.Sizes `json:"-"`
+
+ // -- internal --
+
+ // forTest is the package under test, if any.
+ forTest string
+
+ // depsErrors is the DepsErrors field from the go list response, if any.
+ depsErrors []*packagesinternal.PackageError
+}
+
+// Module provides module information for a package.
+//
+// It also defines part of the JSON schema of [DriverResponse].
+// See the package documentation for an overview.
+type Module struct {
+ Path string // module path
+ Version string // module version
+ Replace *Module // replaced by this module
+ Time *time.Time // time version was created
+ Main bool // is this the main module?
+ Indirect bool // is this module only an indirect dependency of main module?
+ Dir string // directory holding files for this module, if any
+ GoMod string // path to go.mod file used when loading this module, if any
+ GoVersion string // go version used in module
+ Error *ModuleError // error loading module
+}
+
+// ModuleError holds errors loading a module.
+type ModuleError struct {
+ Err string // the error itself
+}
+
+func init() {
+ packagesinternal.GetForTest = func(p interface{}) string {
+ return p.(*Package).forTest
+ }
+ packagesinternal.GetDepsErrors = func(p interface{}) []*packagesinternal.PackageError {
+ return p.(*Package).depsErrors
+ }
+ packagesinternal.SetModFile = func(config interface{}, value string) {
+ config.(*Config).modFile = value
+ }
+ packagesinternal.SetModFlag = func(config interface{}, value string) {
+ config.(*Config).modFlag = value
+ }
+ packagesinternal.TypecheckCgo = int(typecheckCgo)
+ packagesinternal.DepsErrors = int(needInternalDepsErrors)
+ packagesinternal.ForTest = int(needInternalForTest)
+}
+
+// An Error describes a problem with a package's metadata, syntax, or types.
+type Error struct {
+ Pos string // "file:line:col" or "file:line" or "" or "-"
+ Msg string
+ Kind ErrorKind
+}
+
+// ErrorKind describes the source of the error, allowing the user to
+// differentiate between errors generated by the driver, the parser, or the
+// type-checker.
+type ErrorKind int
+
+const (
+ UnknownError ErrorKind = iota
+ ListError
+ ParseError
+ TypeError
+)
+
+func (err Error) Error() string {
+ pos := err.Pos
+ if pos == "" {
+ pos = "-" // like token.Position{}.String()
+ }
+ return pos + ": " + err.Msg
+}
+
+// flatPackage is the JSON form of Package
+// It drops all the type and syntax fields, and transforms the Imports
+//
+// TODO(adonovan): identify this struct with Package, effectively
+// publishing the JSON protocol.
+type flatPackage struct {
+ ID string
+ Name string `json:",omitempty"`
+ PkgPath string `json:",omitempty"`
+ Errors []Error `json:",omitempty"`
+ GoFiles []string `json:",omitempty"`
+ CompiledGoFiles []string `json:",omitempty"`
+ OtherFiles []string `json:",omitempty"`
+ EmbedFiles []string `json:",omitempty"`
+ EmbedPatterns []string `json:",omitempty"`
+ IgnoredFiles []string `json:",omitempty"`
+ ExportFile string `json:",omitempty"`
+ Imports map[string]string `json:",omitempty"`
+}
+
+// MarshalJSON returns the Package in its JSON form.
+// For the most part, the structure fields are written out unmodified, and
+// the type and syntax fields are skipped.
+// The imports are written out as just a map of path to package id.
+// The errors are written using a custom type that tries to preserve the
+// structure of error types we know about.
+//
+// This method exists to enable support for additional build systems. It is
+// not intended for use by clients of the API and we may change the format.
+func (p *Package) MarshalJSON() ([]byte, error) {
+ flat := &flatPackage{
+ ID: p.ID,
+ Name: p.Name,
+ PkgPath: p.PkgPath,
+ Errors: p.Errors,
+ GoFiles: p.GoFiles,
+ CompiledGoFiles: p.CompiledGoFiles,
+ OtherFiles: p.OtherFiles,
+ EmbedFiles: p.EmbedFiles,
+ EmbedPatterns: p.EmbedPatterns,
+ IgnoredFiles: p.IgnoredFiles,
+ ExportFile: p.ExportFile,
+ }
+ if len(p.Imports) > 0 {
+ flat.Imports = make(map[string]string, len(p.Imports))
+ for path, ipkg := range p.Imports {
+ flat.Imports[path] = ipkg.ID
+ }
+ }
+ return json.Marshal(flat)
+}
+
+// UnmarshalJSON reads in a Package from its JSON format.
+// See MarshalJSON for details about the format accepted.
+func (p *Package) UnmarshalJSON(b []byte) error {
+ flat := &flatPackage{}
+ if err := json.Unmarshal(b, &flat); err != nil {
+ return err
+ }
+ *p = Package{
+ ID: flat.ID,
+ Name: flat.Name,
+ PkgPath: flat.PkgPath,
+ Errors: flat.Errors,
+ GoFiles: flat.GoFiles,
+ CompiledGoFiles: flat.CompiledGoFiles,
+ OtherFiles: flat.OtherFiles,
+ EmbedFiles: flat.EmbedFiles,
+ EmbedPatterns: flat.EmbedPatterns,
+ IgnoredFiles: flat.IgnoredFiles,
+ ExportFile: flat.ExportFile,
+ }
+ if len(flat.Imports) > 0 {
+ p.Imports = make(map[string]*Package, len(flat.Imports))
+ for path, id := range flat.Imports {
+ p.Imports[path] = &Package{ID: id}
+ }
+ }
+ return nil
+}
+
+func (p *Package) String() string { return p.ID }
+
+// loaderPackage augments Package with state used during the loading phase
+type loaderPackage struct {
+ *Package
+ importErrors map[string]error // maps each bad import to its error
+ preds []*loaderPackage // packages that import this one
+ unfinishedSuccs atomic.Int32 // number of direct imports not yet loaded
+ color uint8 // for cycle detection
+ needsrc bool // load from source (Mode >= LoadTypes)
+ needtypes bool // type information is either requested or depended on
+ initial bool // package was matched by a pattern
+ goVersion int // minor version number of go command on PATH
+}
+
+// loader holds the working state of a single call to load.
+type loader struct {
+ pkgs map[string]*loaderPackage // keyed by Package.ID
+ Config
+ sizes types.Sizes // non-nil if needed by mode
+ parseCache map[string]*parseValue
+ parseCacheMu sync.Mutex
+ exportMu sync.Mutex // enforces mutual exclusion of exportdata operations
+
+ // Config.Mode contains the implied mode (see impliedLoadMode).
+ // Implied mode contains all the fields we need the data for.
+ // In requestedMode there are the actually requested fields.
+ // We'll zero them out before returning packages to the user.
+ // This makes it easier for us to get the conditions where
+ // we need certain modes right.
+ requestedMode LoadMode
+}
+
+type parseValue struct {
+ f *ast.File
+ err error
+ ready chan struct{}
+}
+
+func newLoader(cfg *Config) *loader {
+ ld := &loader{
+ parseCache: map[string]*parseValue{},
+ }
+ if cfg != nil {
+ ld.Config = *cfg
+ // If the user has provided a logger, use it.
+ ld.Config.Logf = cfg.Logf
+ }
+ if ld.Config.Logf == nil {
+ // If the GOPACKAGESDEBUG environment variable is set to true,
+ // but the user has not provided a logger, default to log.Printf.
+ if debug {
+ ld.Config.Logf = log.Printf
+ } else {
+ ld.Config.Logf = func(format string, args ...interface{}) {}
+ }
+ }
+ if ld.Config.Mode == 0 {
+ ld.Config.Mode = NeedName | NeedFiles | NeedCompiledGoFiles // Preserve zero behavior of Mode for backwards compatibility.
+ }
+ if ld.Config.Env == nil {
+ ld.Config.Env = os.Environ()
+ }
+ if ld.Context == nil {
+ ld.Context = context.Background()
+ }
+ if ld.Dir == "" {
+ if dir, err := os.Getwd(); err == nil {
+ ld.Dir = dir
+ }
+ }
+
+ // Save the actually requested fields. We'll zero them out before returning packages to the user.
+ ld.requestedMode = ld.Mode
+ ld.Mode = impliedLoadMode(ld.Mode)
+
+ if ld.Mode&(NeedSyntax|NeedTypes|NeedTypesInfo) != 0 {
+ if ld.Fset == nil {
+ ld.Fset = token.NewFileSet()
+ }
+
+ // ParseFile is required even in LoadTypes mode
+ // because we load source if export data is missing.
+ if ld.ParseFile == nil {
+ ld.ParseFile = func(fset *token.FileSet, filename string, src []byte) (*ast.File, error) {
+ // We implicitly promise to keep doing ast.Object resolution. :(
+ const mode = parser.AllErrors | parser.ParseComments
+ return parser.ParseFile(fset, filename, src, mode)
+ }
+ }
+ }
+
+ return ld
+}
+
+// refine connects the supplied packages into a graph and then adds type
+// and syntax information as requested by the LoadMode.
+func (ld *loader) refine(response *DriverResponse) ([]*Package, error) {
+ roots := response.Roots
+ rootMap := make(map[string]int, len(roots))
+ for i, root := range roots {
+ rootMap[root] = i
+ }
+ ld.pkgs = make(map[string]*loaderPackage)
+ // first pass, fixup and build the map and roots
+ var initial = make([]*loaderPackage, len(roots))
+ for _, pkg := range response.Packages {
+ rootIndex := -1
+ if i, found := rootMap[pkg.ID]; found {
+ rootIndex = i
+ }
+
+ // Overlays can invalidate export data.
+ // TODO(matloob): make this check fine-grained based on dependencies on overlaid files
+ exportDataInvalid := len(ld.Overlay) > 0 || pkg.ExportFile == "" && pkg.PkgPath != "unsafe"
+ // This package needs type information if the caller requested types and the package is
+ // either a root, or it's a non-root and the user requested dependencies ...
+ needtypes := (ld.Mode&(NeedTypes|NeedTypesInfo) != 0 && (rootIndex >= 0 || ld.Mode&NeedDeps != 0))
+ // This package needs source if the call requested source (or types info, which implies source)
+ // and the package is either a root, or itas a non- root and the user requested dependencies...
+ needsrc := ((ld.Mode&(NeedSyntax|NeedTypesInfo) != 0 && (rootIndex >= 0 || ld.Mode&NeedDeps != 0)) ||
+ // ... or if we need types and the exportData is invalid. We fall back to (incompletely)
+ // typechecking packages from source if they fail to compile.
+ (ld.Mode&(NeedTypes|NeedTypesInfo) != 0 && exportDataInvalid)) && pkg.PkgPath != "unsafe"
+ lpkg := &loaderPackage{
+ Package: pkg,
+ needtypes: needtypes,
+ needsrc: needsrc,
+ goVersion: response.GoVersion,
+ }
+ ld.pkgs[lpkg.ID] = lpkg
+ if rootIndex >= 0 {
+ initial[rootIndex] = lpkg
+ lpkg.initial = true
+ }
+ }
+ for i, root := range roots {
+ if initial[i] == nil {
+ return nil, fmt.Errorf("root package %v is missing", root)
+ }
+ }
+
+ // Materialize the import graph if it is needed (NeedImports),
+ // or if we'll be using loadPackages (Need{Syntax|Types|TypesInfo}).
+ var leaves []*loaderPackage // packages with no unfinished successors
+ if ld.Mode&(NeedImports|NeedSyntax|NeedTypes|NeedTypesInfo) != 0 {
+ const (
+ white = 0 // new
+ grey = 1 // in progress
+ black = 2 // complete
+ )
+
+ // visit traverses the import graph, depth-first,
+ // and materializes the graph as Packages.Imports.
+ //
+ // Valid imports are saved in the Packages.Import map.
+ // Invalid imports (cycles and missing nodes) are saved in the importErrors map.
+ // Thus, even in the presence of both kinds of errors,
+ // the Import graph remains a DAG.
+ //
+ // visit returns whether the package needs src or has a transitive
+ // dependency on a package that does. These are the only packages
+ // for which we load source code.
+ var stack []*loaderPackage
+ var visit func(from, lpkg *loaderPackage) bool
+ visit = func(from, lpkg *loaderPackage) bool {
+ if lpkg.color == grey {
+ panic("internal error: grey node")
+ }
+ if lpkg.color == white {
+ lpkg.color = grey
+ stack = append(stack, lpkg) // push
+ stubs := lpkg.Imports // the structure form has only stubs with the ID in the Imports
+ lpkg.Imports = make(map[string]*Package, len(stubs))
+ for importPath, ipkg := range stubs {
+ var importErr error
+ imp := ld.pkgs[ipkg.ID]
+ if imp == nil {
+ // (includes package "C" when DisableCgo)
+ importErr = fmt.Errorf("missing package: %q", ipkg.ID)
+ } else if imp.color == grey {
+ importErr = fmt.Errorf("import cycle: %s", stack)
+ }
+ if importErr != nil {
+ if lpkg.importErrors == nil {
+ lpkg.importErrors = make(map[string]error)
+ }
+ lpkg.importErrors[importPath] = importErr
+ continue
+ }
+
+ if visit(lpkg, imp) {
+ lpkg.needsrc = true
+ }
+ lpkg.Imports[importPath] = imp.Package
+ }
+
+ // -- postorder --
+
+ // Complete type information is required for the
+ // immediate dependencies of each source package.
+ if lpkg.needsrc && ld.Mode&NeedTypes != 0 {
+ for _, ipkg := range lpkg.Imports {
+ ld.pkgs[ipkg.ID].needtypes = true
+ }
+ }
+
+ // NeedTypeSizes causes TypeSizes to be set even
+ // on packages for which types aren't needed.
+ if ld.Mode&NeedTypesSizes != 0 {
+ lpkg.TypesSizes = ld.sizes
+ }
+
+ // Add packages with no imports directly to the queue of leaves.
+ if len(lpkg.Imports) == 0 {
+ leaves = append(leaves, lpkg)
+ }
+
+ stack = stack[:len(stack)-1] // pop
+ lpkg.color = black
+ }
+
+ // Add edge from predecessor.
+ if from != nil {
+ from.unfinishedSuccs.Add(+1) // incref
+ lpkg.preds = append(lpkg.preds, from)
+ }
+
+ return lpkg.needsrc
+ }
+
+ // For each initial package, create its import DAG.
+ for _, lpkg := range initial {
+ visit(nil, lpkg)
+ }
+
+ } else {
+ // !NeedImports: drop the stub (ID-only) import packages
+ // that we are not even going to try to resolve.
+ for _, lpkg := range initial {
+ lpkg.Imports = nil
+ }
+ }
+
+ // Load type data and syntax if needed, starting at
+ // the initial packages (roots of the import DAG).
+ if ld.Mode&(NeedSyntax|NeedTypes|NeedTypesInfo) != 0 {
+
+ // We avoid using g.SetLimit to limit concurrency as
+ // it makes g.Go stop accepting work, which prevents
+ // workers from enqeuing, and thus finishing, and thus
+ // allowing the group to make progress: deadlock.
+ //
+ // Instead we use the ioLimit and cpuLimit semaphores.
+ g, _ := errgroup.WithContext(ld.Context)
+
+ // enqueues adds a package to the type-checking queue.
+ // It must have no unfinished successors.
+ var enqueue func(*loaderPackage)
+ enqueue = func(lpkg *loaderPackage) {
+ g.Go(func() error {
+ // Parse and type-check.
+ ld.loadPackage(lpkg)
+
+ // Notify each waiting predecessor,
+ // and enqueue it when it becomes a leaf.
+ for _, pred := range lpkg.preds {
+ if pred.unfinishedSuccs.Add(-1) == 0 { // decref
+ enqueue(pred)
+ }
+ }
+
+ return nil
+ })
+ }
+
+ // Load leaves first, adding new packages
+ // to the queue as they become leaves.
+ for _, leaf := range leaves {
+ enqueue(leaf)
+ }
+
+ if err := g.Wait(); err != nil {
+ return nil, err // cancelled
+ }
+ }
+
+ // If the context is done, return its error and
+ // throw out [likely] incomplete packages.
+ if err := ld.Context.Err(); err != nil {
+ return nil, err
+ }
+
+ result := make([]*Package, len(initial))
+ for i, lpkg := range initial {
+ result[i] = lpkg.Package
+ }
+ for i := range ld.pkgs {
+ // Clear all unrequested fields,
+ // to catch programs that use more than they request.
+ if ld.requestedMode&NeedName == 0 {
+ ld.pkgs[i].Name = ""
+ ld.pkgs[i].PkgPath = ""
+ }
+ if ld.requestedMode&NeedFiles == 0 {
+ ld.pkgs[i].GoFiles = nil
+ ld.pkgs[i].OtherFiles = nil
+ ld.pkgs[i].IgnoredFiles = nil
+ }
+ if ld.requestedMode&NeedEmbedFiles == 0 {
+ ld.pkgs[i].EmbedFiles = nil
+ }
+ if ld.requestedMode&NeedEmbedPatterns == 0 {
+ ld.pkgs[i].EmbedPatterns = nil
+ }
+ if ld.requestedMode&NeedCompiledGoFiles == 0 {
+ ld.pkgs[i].CompiledGoFiles = nil
+ }
+ if ld.requestedMode&NeedImports == 0 {
+ ld.pkgs[i].Imports = nil
+ }
+ if ld.requestedMode&NeedExportFile == 0 {
+ ld.pkgs[i].ExportFile = ""
+ }
+ if ld.requestedMode&NeedTypes == 0 {
+ ld.pkgs[i].Types = nil
+ ld.pkgs[i].IllTyped = false
+ }
+ if ld.requestedMode&NeedSyntax == 0 {
+ ld.pkgs[i].Syntax = nil
+ }
+ if ld.requestedMode&(NeedSyntax|NeedTypes|NeedTypesInfo) == 0 {
+ ld.pkgs[i].Fset = nil
+ }
+ if ld.requestedMode&NeedTypesInfo == 0 {
+ ld.pkgs[i].TypesInfo = nil
+ }
+ if ld.requestedMode&NeedTypesSizes == 0 {
+ ld.pkgs[i].TypesSizes = nil
+ }
+ if ld.requestedMode&NeedModule == 0 {
+ ld.pkgs[i].Module = nil
+ }
+ }
+
+ return result, nil
+}
+
+// loadPackage loads/parses/typechecks the specified package.
+// It must be called only once per Package,
+// after immediate dependencies are loaded.
+// Precondition: ld.Mode&(NeedSyntax|NeedTypes|NeedTypesInfo) != 0.
+func (ld *loader) loadPackage(lpkg *loaderPackage) {
+ if lpkg.PkgPath == "unsafe" {
+ // Fill in the blanks to avoid surprises.
+ lpkg.Types = types.Unsafe
+ lpkg.Fset = ld.Fset
+ lpkg.Syntax = []*ast.File{}
+ lpkg.TypesInfo = new(types.Info)
+ lpkg.TypesSizes = ld.sizes
+ return
+ }
+
+ // Call NewPackage directly with explicit name.
+ // This avoids skew between golist and go/types when the files'
+ // package declarations are inconsistent.
+ lpkg.Types = types.NewPackage(lpkg.PkgPath, lpkg.Name)
+ lpkg.Fset = ld.Fset
+
+ // Start shutting down if the context is done and do not load
+ // source or export data files.
+ // Packages that import this one will have ld.Context.Err() != nil.
+ // ld.Context.Err() will be returned later by refine.
+ if ld.Context.Err() != nil {
+ return
+ }
+
+ // Subtle: we populate all Types fields with an empty Package
+ // before loading export data so that export data processing
+ // never has to create a types.Package for an indirect dependency,
+ // which would then require that such created packages be explicitly
+ // inserted back into the Import graph as a final step after export data loading.
+ // (Hence this return is after the Types assignment.)
+ // The Diamond test exercises this case.
+ if !lpkg.needtypes && !lpkg.needsrc {
+ return
+ }
+
+ // TODO(adonovan): this condition looks wrong:
+ // I think it should be lpkg.needtypes && !lpg.needsrc,
+ // so that NeedSyntax without NeedTypes can be satisfied by export data.
+ if !lpkg.needsrc {
+ if err := ld.loadFromExportData(lpkg); err != nil {
+ lpkg.Errors = append(lpkg.Errors, Error{
+ Pos: "-",
+ Msg: err.Error(),
+ Kind: UnknownError, // e.g. can't find/open/parse export data
+ })
+ }
+ return // not a source package, don't get syntax trees
+ }
+
+ appendError := func(err error) {
+ // Convert various error types into the one true Error.
+ var errs []Error
+ switch err := err.(type) {
+ case Error:
+ // from driver
+ errs = append(errs, err)
+
+ case *os.PathError:
+ // from parser
+ errs = append(errs, Error{
+ Pos: err.Path + ":1",
+ Msg: err.Err.Error(),
+ Kind: ParseError,
+ })
+
+ case scanner.ErrorList:
+ // from parser
+ for _, err := range err {
+ errs = append(errs, Error{
+ Pos: err.Pos.String(),
+ Msg: err.Msg,
+ Kind: ParseError,
+ })
+ }
+
+ case types.Error:
+ // from type checker
+ lpkg.TypeErrors = append(lpkg.TypeErrors, err)
+ errs = append(errs, Error{
+ Pos: err.Fset.Position(err.Pos).String(),
+ Msg: err.Msg,
+ Kind: TypeError,
+ })
+
+ default:
+ // unexpected impoverished error from parser?
+ errs = append(errs, Error{
+ Pos: "-",
+ Msg: err.Error(),
+ Kind: UnknownError,
+ })
+
+ // If you see this error message, please file a bug.
+ log.Printf("internal error: error %q (%T) without position", err, err)
+ }
+
+ lpkg.Errors = append(lpkg.Errors, errs...)
+ }
+
+ // If the go command on the PATH is newer than the runtime,
+ // then the go/{scanner,ast,parser,types} packages from the
+ // standard library may be unable to process the files
+ // selected by go list.
+ //
+ // There is currently no way to downgrade the effective
+ // version of the go command (see issue 52078), so we proceed
+ // with the newer go command but, in case of parse or type
+ // errors, we emit an additional diagnostic.
+ //
+ // See:
+ // - golang.org/issue/52078 (flag to set release tags)
+ // - golang.org/issue/50825 (gopls legacy version support)
+ // - golang.org/issue/55883 (go/packages confusing error)
+ //
+ // Should we assert a hard minimum of (currently) go1.16 here?
+ var runtimeVersion int
+ if _, err := fmt.Sscanf(runtime.Version(), "go1.%d", &runtimeVersion); err == nil && runtimeVersion < lpkg.goVersion {
+ defer func() {
+ if len(lpkg.Errors) > 0 {
+ appendError(Error{
+ Pos: "-",
+ Msg: fmt.Sprintf("This application uses version go1.%d of the source-processing packages but runs version go1.%d of 'go list'. It may fail to process source files that rely on newer language features. If so, rebuild the application using a newer version of Go.", runtimeVersion, lpkg.goVersion),
+ Kind: UnknownError,
+ })
+ }
+ }()
+ }
+
+ if ld.Config.Mode&NeedTypes != 0 && len(lpkg.CompiledGoFiles) == 0 && lpkg.ExportFile != "" {
+ // The config requested loading sources and types, but sources are missing.
+ // Add an error to the package and fall back to loading from export data.
+ appendError(Error{"-", fmt.Sprintf("sources missing for package %s", lpkg.ID), ParseError})
+ _ = ld.loadFromExportData(lpkg) // ignore any secondary errors
+
+ return // can't get syntax trees for this package
+ }
+
+ files, errs := ld.parseFiles(lpkg.CompiledGoFiles)
+ for _, err := range errs {
+ appendError(err)
+ }
+
+ lpkg.Syntax = files
+ if ld.Config.Mode&(NeedTypes|NeedTypesInfo) == 0 {
+ return
+ }
+
+ // Start shutting down if the context is done and do not type check.
+ // Packages that import this one will have ld.Context.Err() != nil.
+ // ld.Context.Err() will be returned later by refine.
+ if ld.Context.Err() != nil {
+ return
+ }
+
+ // Populate TypesInfo only if needed, as it
+ // causes the type checker to work much harder.
+ if ld.Config.Mode&NeedTypesInfo != 0 {
+ lpkg.TypesInfo = &types.Info{
+ Types: make(map[ast.Expr]types.TypeAndValue),
+ Defs: make(map[*ast.Ident]types.Object),
+ Uses: make(map[*ast.Ident]types.Object),
+ Implicits: make(map[ast.Node]types.Object),
+ Instances: make(map[*ast.Ident]types.Instance),
+ Scopes: make(map[ast.Node]*types.Scope),
+ Selections: make(map[*ast.SelectorExpr]*types.Selection),
+ FileVersions: make(map[*ast.File]string),
+ }
+ }
+ lpkg.TypesSizes = ld.sizes
+
+ importer := importerFunc(func(path string) (*types.Package, error) {
+ if path == "unsafe" {
+ return types.Unsafe, nil
+ }
+
+ // The imports map is keyed by import path.
+ ipkg := lpkg.Imports[path]
+ if ipkg == nil {
+ if err := lpkg.importErrors[path]; err != nil {
+ return nil, err
+ }
+ // There was skew between the metadata and the
+ // import declarations, likely due to an edit
+ // race, or because the ParseFile feature was
+ // used to supply alternative file contents.
+ return nil, fmt.Errorf("no metadata for %s", path)
+ }
+
+ if ipkg.Types != nil && ipkg.Types.Complete() {
+ return ipkg.Types, nil
+ }
+ log.Fatalf("internal error: package %q without types was imported from %q", path, lpkg)
+ panic("unreachable")
+ })
+
+ // type-check
+ tc := &types.Config{
+ Importer: importer,
+
+ // Type-check bodies of functions only in initial packages.
+ // Example: for import graph A->B->C and initial packages {A,C},
+ // we can ignore function bodies in B.
+ IgnoreFuncBodies: ld.Mode&NeedDeps == 0 && !lpkg.initial,
+
+ Error: appendError,
+ Sizes: ld.sizes, // may be nil
+ }
+ if lpkg.Module != nil && lpkg.Module.GoVersion != "" {
+ tc.GoVersion = "go" + lpkg.Module.GoVersion
+ }
+ if (ld.Mode & typecheckCgo) != 0 {
+ if !typesinternal.SetUsesCgo(tc) {
+ appendError(Error{
+ Msg: "typecheckCgo requires Go 1.15+",
+ Kind: ListError,
+ })
+ return
+ }
+ }
+
+ // Type-checking is CPU intensive.
+ cpuLimit <- unit{} // acquire a token
+ defer func() { <-cpuLimit }() // release a token
+
+ typErr := types.NewChecker(tc, ld.Fset, lpkg.Types, lpkg.TypesInfo).Files(lpkg.Syntax)
+ lpkg.importErrors = nil // no longer needed
+
+ // In go/types go1.21 and go1.22, Checker.Files failed fast with a
+ // a "too new" error, without calling tc.Error and without
+ // proceeding to type-check the package (#66525).
+ // We rely on the runtimeVersion error to give the suggested remedy.
+ if typErr != nil && len(lpkg.Errors) == 0 && len(lpkg.Syntax) > 0 {
+ if msg := typErr.Error(); strings.HasPrefix(msg, "package requires newer Go version") {
+ appendError(types.Error{
+ Fset: ld.Fset,
+ Pos: lpkg.Syntax[0].Package,
+ Msg: msg,
+ })
+ }
+ }
+
+ // If !Cgo, the type-checker uses FakeImportC mode, so
+ // it doesn't invoke the importer for import "C",
+ // nor report an error for the import,
+ // or for any undefined C.f reference.
+ // We must detect this explicitly and correctly
+ // mark the package as IllTyped (by reporting an error).
+ // TODO(adonovan): if these errors are annoying,
+ // we could just set IllTyped quietly.
+ if tc.FakeImportC {
+ outer:
+ for _, f := range lpkg.Syntax {
+ for _, imp := range f.Imports {
+ if imp.Path.Value == `"C"` {
+ err := types.Error{Fset: ld.Fset, Pos: imp.Pos(), Msg: `import "C" ignored`}
+ appendError(err)
+ break outer
+ }
+ }
+ }
+ }
+
+ // If types.Checker.Files had an error that was unreported,
+ // make sure to report the unknown error so the package is illTyped.
+ if typErr != nil && len(lpkg.Errors) == 0 {
+ appendError(typErr)
+ }
+
+ // Record accumulated errors.
+ illTyped := len(lpkg.Errors) > 0
+ if !illTyped {
+ for _, imp := range lpkg.Imports {
+ if imp.IllTyped {
+ illTyped = true
+ break
+ }
+ }
+ }
+ lpkg.IllTyped = illTyped
+}
+
+// An importFunc is an implementation of the single-method
+// types.Importer interface based on a function value.
+type importerFunc func(path string) (*types.Package, error)
+
+func (f importerFunc) Import(path string) (*types.Package, error) { return f(path) }
+
+// We use a counting semaphore to limit
+// the number of parallel I/O calls or CPU threads per process.
+var (
+ ioLimit = make(chan unit, 20)
+ cpuLimit = make(chan unit, runtime.GOMAXPROCS(0))
+)
+
+func (ld *loader) parseFile(filename string) (*ast.File, error) {
+ ld.parseCacheMu.Lock()
+ v, ok := ld.parseCache[filename]
+ if ok {
+ // cache hit
+ ld.parseCacheMu.Unlock()
+ <-v.ready
+ } else {
+ // cache miss
+ v = &parseValue{ready: make(chan struct{})}
+ ld.parseCache[filename] = v
+ ld.parseCacheMu.Unlock()
+
+ var src []byte
+ for f, contents := range ld.Config.Overlay {
+ // TODO(adonovan): Inefficient for large overlays.
+ // Do an exact name-based map lookup
+ // (for nonexistent files) followed by a
+ // FileID-based map lookup (for existing ones).
+ if sameFile(f, filename) {
+ src = contents
+ break
+ }
+ }
+ var err error
+ if src == nil {
+ ioLimit <- unit{} // acquire a token
+ src, err = os.ReadFile(filename)
+ <-ioLimit // release a token
+ }
+ if err != nil {
+ v.err = err
+ } else {
+ // Parsing is CPU intensive.
+ cpuLimit <- unit{} // acquire a token
+ v.f, v.err = ld.ParseFile(ld.Fset, filename, src)
+ <-cpuLimit // release a token
+ }
+
+ close(v.ready)
+ }
+ return v.f, v.err
+}
+
+// parseFiles reads and parses the Go source files and returns the ASTs
+// of the ones that could be at least partially parsed, along with a
+// list of I/O and parse errors encountered.
+//
+// Because files are scanned in parallel, the token.Pos
+// positions of the resulting ast.Files are not ordered.
+func (ld *loader) parseFiles(filenames []string) ([]*ast.File, []error) {
+ var (
+ n = len(filenames)
+ parsed = make([]*ast.File, n)
+ errors = make([]error, n)
+ )
+ var g errgroup.Group
+ for i, filename := range filenames {
+ // This creates goroutines unnecessarily in the
+ // cache-hit case, but that case is uncommon.
+ g.Go(func() error {
+ parsed[i], errors[i] = ld.parseFile(filename)
+ return nil
+ })
+ }
+ g.Wait()
+
+ // Eliminate nils, preserving order.
+ var o int
+ for _, f := range parsed {
+ if f != nil {
+ parsed[o] = f
+ o++
+ }
+ }
+ parsed = parsed[:o]
+
+ o = 0
+ for _, err := range errors {
+ if err != nil {
+ errors[o] = err
+ o++
+ }
+ }
+ errors = errors[:o]
+
+ return parsed, errors
+}
+
+// sameFile returns true if x and y have the same basename and denote
+// the same file.
+func sameFile(x, y string) bool {
+ if x == y {
+ // It could be the case that y doesn't exist.
+ // For instance, it may be an overlay file that
+ // hasn't been written to disk. To handle that case
+ // let x == y through. (We added the exact absolute path
+ // string to the CompiledGoFiles list, so the unwritten
+ // overlay case implies x==y.)
+ return true
+ }
+ if strings.EqualFold(filepath.Base(x), filepath.Base(y)) { // (optimisation)
+ if xi, err := os.Stat(x); err == nil {
+ if yi, err := os.Stat(y); err == nil {
+ return os.SameFile(xi, yi)
+ }
+ }
+ }
+ return false
+}
+
+// loadFromExportData ensures that type information is present for the specified
+// package, loading it from an export data file on the first request.
+// On success it sets lpkg.Types to a new Package.
+func (ld *loader) loadFromExportData(lpkg *loaderPackage) error {
+ if lpkg.PkgPath == "" {
+ log.Fatalf("internal error: Package %s has no PkgPath", lpkg)
+ }
+
+ // Because gcexportdata.Read has the potential to create or
+ // modify the types.Package for each node in the transitive
+ // closure of dependencies of lpkg, all exportdata operations
+ // must be sequential. (Finer-grained locking would require
+ // changes to the gcexportdata API.)
+ //
+ // The exportMu lock guards the lpkg.Types field and the
+ // types.Package it points to, for each loaderPackage in the graph.
+ //
+ // Not all accesses to Package.Pkg need to be protected by exportMu:
+ // graph ordering ensures that direct dependencies of source
+ // packages are fully loaded before the importer reads their Pkg field.
+ ld.exportMu.Lock()
+ defer ld.exportMu.Unlock()
+
+ if tpkg := lpkg.Types; tpkg != nil && tpkg.Complete() {
+ return nil // cache hit
+ }
+
+ lpkg.IllTyped = true // fail safe
+
+ if lpkg.ExportFile == "" {
+ // Errors while building export data will have been printed to stderr.
+ return fmt.Errorf("no export data file")
+ }
+ f, err := os.Open(lpkg.ExportFile)
+ if err != nil {
+ return err
+ }
+ defer f.Close()
+
+ // Read gc export data.
+ //
+ // We don't currently support gccgo export data because all
+ // underlying workspaces use the gc toolchain. (Even build
+ // systems that support gccgo don't use it for workspace
+ // queries.)
+ r, err := gcexportdata.NewReader(f)
+ if err != nil {
+ return fmt.Errorf("reading %s: %v", lpkg.ExportFile, err)
+ }
+
+ // Build the view.
+ //
+ // The gcexportdata machinery has no concept of package ID.
+ // It identifies packages by their PkgPath, which although not
+ // globally unique is unique within the scope of one invocation
+ // of the linker, type-checker, or gcexportdata.
+ //
+ // So, we must build a PkgPath-keyed view of the global
+ // (conceptually ID-keyed) cache of packages and pass it to
+ // gcexportdata. The view must contain every existing
+ // package that might possibly be mentioned by the
+ // current package---its transitive closure.
+ //
+ // In loadPackage, we unconditionally create a types.Package for
+ // each dependency so that export data loading does not
+ // create new ones.
+ //
+ // TODO(adonovan): it would be simpler and more efficient
+ // if the export data machinery invoked a callback to
+ // get-or-create a package instead of a map.
+ //
+ view := make(map[string]*types.Package) // view seen by gcexportdata
+ seen := make(map[*loaderPackage]bool) // all visited packages
+ var visit func(pkgs map[string]*Package)
+ visit = func(pkgs map[string]*Package) {
+ for _, p := range pkgs {
+ lpkg := ld.pkgs[p.ID]
+ if !seen[lpkg] {
+ seen[lpkg] = true
+ view[lpkg.PkgPath] = lpkg.Types
+ visit(lpkg.Imports)
+ }
+ }
+ }
+ visit(lpkg.Imports)
+
+ viewLen := len(view) + 1 // adding the self package
+ // Parse the export data.
+ // (May modify incomplete packages in view but not create new ones.)
+ tpkg, err := gcexportdata.Read(r, ld.Fset, view, lpkg.PkgPath)
+ if err != nil {
+ return fmt.Errorf("reading %s: %v", lpkg.ExportFile, err)
+ }
+ if _, ok := view["go.shape"]; ok {
+ // Account for the pseudopackage "go.shape" that gets
+ // created by generic code.
+ viewLen++
+ }
+ if viewLen != len(view) {
+ log.Panicf("golang.org/x/tools/go/packages: unexpected new packages during load of %s", lpkg.PkgPath)
+ }
+
+ lpkg.Types = tpkg
+ lpkg.IllTyped = false
+ return nil
+}
+
+// impliedLoadMode returns loadMode with its dependencies.
+func impliedLoadMode(loadMode LoadMode) LoadMode {
+ if loadMode&(NeedDeps|NeedTypes|NeedTypesInfo) != 0 {
+ // All these things require knowing the import graph.
+ loadMode |= NeedImports
+ }
+ if loadMode&NeedTypes != 0 {
+ // Types require the GoVersion from Module.
+ loadMode |= NeedModule
+ }
+
+ return loadMode
+}
+
+func usesExportData(cfg *Config) bool {
+ return cfg.Mode&NeedExportFile != 0 || cfg.Mode&NeedTypes != 0 && cfg.Mode&NeedDeps == 0
+}
+
+type unit struct{}
diff --git a/vendor/golang.org/x/tools/go/packages/visit.go b/vendor/golang.org/x/tools/go/packages/visit.go
new file mode 100644
index 00000000..df14ffd9
--- /dev/null
+++ b/vendor/golang.org/x/tools/go/packages/visit.go
@@ -0,0 +1,68 @@
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package packages
+
+import (
+ "fmt"
+ "os"
+ "sort"
+)
+
+// Visit visits all the packages in the import graph whose roots are
+// pkgs, calling the optional pre function the first time each package
+// is encountered (preorder), and the optional post function after a
+// package's dependencies have been visited (postorder).
+// The boolean result of pre(pkg) determines whether
+// the imports of package pkg are visited.
+func Visit(pkgs []*Package, pre func(*Package) bool, post func(*Package)) {
+ seen := make(map[*Package]bool)
+ var visit func(*Package)
+ visit = func(pkg *Package) {
+ if !seen[pkg] {
+ seen[pkg] = true
+
+ if pre == nil || pre(pkg) {
+ paths := make([]string, 0, len(pkg.Imports))
+ for path := range pkg.Imports {
+ paths = append(paths, path)
+ }
+ sort.Strings(paths) // Imports is a map, this makes visit stable
+ for _, path := range paths {
+ visit(pkg.Imports[path])
+ }
+ }
+
+ if post != nil {
+ post(pkg)
+ }
+ }
+ }
+ for _, pkg := range pkgs {
+ visit(pkg)
+ }
+}
+
+// PrintErrors prints to os.Stderr the accumulated errors of all
+// packages in the import graph rooted at pkgs, dependencies first.
+// PrintErrors returns the number of errors printed.
+func PrintErrors(pkgs []*Package) int {
+ var n int
+ errModules := make(map[*Module]bool)
+ Visit(pkgs, nil, func(pkg *Package) {
+ for _, err := range pkg.Errors {
+ fmt.Fprintln(os.Stderr, err)
+ n++
+ }
+
+ // Print pkg.Module.Error once if present.
+ mod := pkg.Module
+ if mod != nil && mod.Error != nil && !errModules[mod] {
+ errModules[mod] = true
+ fmt.Fprintln(os.Stderr, mod.Error.Err)
+ n++
+ }
+ })
+ return n
+}
diff --git a/vendor/golang.org/x/tools/go/types/objectpath/objectpath.go b/vendor/golang.org/x/tools/go/types/objectpath/objectpath.go
new file mode 100644
index 00000000..16ed3c17
--- /dev/null
+++ b/vendor/golang.org/x/tools/go/types/objectpath/objectpath.go
@@ -0,0 +1,817 @@
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Package objectpath defines a naming scheme for types.Objects
+// (that is, named entities in Go programs) relative to their enclosing
+// package.
+//
+// Type-checker objects are canonical, so they are usually identified by
+// their address in memory (a pointer), but a pointer has meaning only
+// within one address space. By contrast, objectpath names allow the
+// identity of an object to be sent from one program to another,
+// establishing a correspondence between types.Object variables that are
+// distinct but logically equivalent.
+//
+// A single object may have multiple paths. In this example,
+//
+// type A struct{ X int }
+// type B A
+//
+// the field X has two paths due to its membership of both A and B.
+// The For(obj) function always returns one of these paths, arbitrarily
+// but consistently.
+package objectpath
+
+import (
+ "fmt"
+ "go/types"
+ "strconv"
+ "strings"
+
+ "golang.org/x/tools/internal/aliases"
+ "golang.org/x/tools/internal/typesinternal"
+)
+
+// TODO(adonovan): think about generic aliases.
+
+// A Path is an opaque name that identifies a types.Object
+// relative to its package. Conceptually, the name consists of a
+// sequence of destructuring operations applied to the package scope
+// to obtain the original object.
+// The name does not include the package itself.
+type Path string
+
+// Encoding
+//
+// An object path is a textual and (with training) human-readable encoding
+// of a sequence of destructuring operators, starting from a types.Package.
+// The sequences represent a path through the package/object/type graph.
+// We classify these operators by their type:
+//
+// PO package->object Package.Scope.Lookup
+// OT object->type Object.Type
+// TT type->type Type.{Elem,Key,{,{,Recv}Type}Params,Results,Underlying,Rhs} [EKPRUTrCa]
+// TO type->object Type.{At,Field,Method,Obj} [AFMO]
+//
+// All valid paths start with a package and end at an object
+// and thus may be defined by the regular language:
+//
+// objectpath = PO (OT TT* TO)*
+//
+// The concrete encoding follows directly:
+// - The only PO operator is Package.Scope.Lookup, which requires an identifier.
+// - The only OT operator is Object.Type,
+// which we encode as '.' because dot cannot appear in an identifier.
+// - The TT operators are encoded as [EKPRUTrCa];
+// two of these ({,Recv}TypeParams) require an integer operand,
+// which is encoded as a string of decimal digits.
+// - The TO operators are encoded as [AFMO];
+// three of these (At,Field,Method) require an integer operand,
+// which is encoded as a string of decimal digits.
+// These indices are stable across different representations
+// of the same package, even source and export data.
+// The indices used are implementation specific and may not correspond to
+// the argument to the go/types function.
+//
+// In the example below,
+//
+// package p
+//
+// type T interface {
+// f() (a string, b struct{ X int })
+// }
+//
+// field X has the path "T.UM0.RA1.F0",
+// representing the following sequence of operations:
+//
+// p.Lookup("T") T
+// .Type().Underlying().Method(0). f
+// .Type().Results().At(1) b
+// .Type().Field(0) X
+//
+// The encoding is not maximally compact---every R or P is
+// followed by an A, for example---but this simplifies the
+// encoder and decoder.
+const (
+ // object->type operators
+ opType = '.' // .Type() (Object)
+
+ // type->type operators
+ opElem = 'E' // .Elem() (Pointer, Slice, Array, Chan, Map)
+ opKey = 'K' // .Key() (Map)
+ opParams = 'P' // .Params() (Signature)
+ opResults = 'R' // .Results() (Signature)
+ opUnderlying = 'U' // .Underlying() (Named)
+ opTypeParam = 'T' // .TypeParams.At(i) (Named, Signature)
+ opRecvTypeParam = 'r' // .RecvTypeParams.At(i) (Signature)
+ opConstraint = 'C' // .Constraint() (TypeParam)
+ opRhs = 'a' // .Rhs() (Alias)
+
+ // type->object operators
+ opAt = 'A' // .At(i) (Tuple)
+ opField = 'F' // .Field(i) (Struct)
+ opMethod = 'M' // .Method(i) (Named or Interface; not Struct: "promoted" names are ignored)
+ opObj = 'O' // .Obj() (Named, TypeParam)
+)
+
+// For is equivalent to new(Encoder).For(obj).
+//
+// It may be more efficient to reuse a single Encoder across several calls.
+func For(obj types.Object) (Path, error) {
+ return new(Encoder).For(obj)
+}
+
+// An Encoder amortizes the cost of encoding the paths of multiple objects.
+// The zero value of an Encoder is ready to use.
+type Encoder struct {
+ scopeMemo map[*types.Scope][]types.Object // memoization of scopeObjects
+}
+
+// For returns the path to an object relative to its package,
+// or an error if the object is not accessible from the package's Scope.
+//
+// The For function guarantees to return a path only for the following objects:
+// - package-level types
+// - exported package-level non-types
+// - methods
+// - parameter and result variables
+// - struct fields
+// These objects are sufficient to define the API of their package.
+// The objects described by a package's export data are drawn from this set.
+//
+// The set of objects accessible from a package's Scope depends on
+// whether the package was produced by type-checking syntax, or
+// reading export data; the latter may have a smaller Scope since
+// export data trims objects that are not reachable from an exported
+// declaration. For example, the For function will return a path for
+// an exported method of an unexported type that is not reachable
+// from any public declaration; this path will cause the Object
+// function to fail if called on a package loaded from export data.
+// TODO(adonovan): is this a bug or feature? Should this package
+// compute accessibility in the same way?
+//
+// For does not return a path for predeclared names, imported package
+// names, local names, and unexported package-level names (except
+// types).
+//
+// Example: given this definition,
+//
+// package p
+//
+// type T interface {
+// f() (a string, b struct{ X int })
+// }
+//
+// For(X) would return a path that denotes the following sequence of operations:
+//
+// p.Scope().Lookup("T") (TypeName T)
+// .Type().Underlying().Method(0). (method Func f)
+// .Type().Results().At(1) (field Var b)
+// .Type().Field(0) (field Var X)
+//
+// where p is the package (*types.Package) to which X belongs.
+func (enc *Encoder) For(obj types.Object) (Path, error) {
+ pkg := obj.Pkg()
+
+ // This table lists the cases of interest.
+ //
+ // Object Action
+ // ------ ------
+ // nil reject
+ // builtin reject
+ // pkgname reject
+ // label reject
+ // var
+ // package-level accept
+ // func param/result accept
+ // local reject
+ // struct field accept
+ // const
+ // package-level accept
+ // local reject
+ // func
+ // package-level accept
+ // init functions reject
+ // concrete method accept
+ // interface method accept
+ // type
+ // package-level accept
+ // local reject
+ //
+ // The only accessible package-level objects are members of pkg itself.
+ //
+ // The cases are handled in four steps:
+ //
+ // 1. reject nil and builtin
+ // 2. accept package-level objects
+ // 3. reject obviously invalid objects
+ // 4. search the API for the path to the param/result/field/method.
+
+ // 1. reference to nil or builtin?
+ if pkg == nil {
+ return "", fmt.Errorf("predeclared %s has no path", obj)
+ }
+ scope := pkg.Scope()
+
+ // 2. package-level object?
+ if scope.Lookup(obj.Name()) == obj {
+ // Only exported objects (and non-exported types) have a path.
+ // Non-exported types may be referenced by other objects.
+ if _, ok := obj.(*types.TypeName); !ok && !obj.Exported() {
+ return "", fmt.Errorf("no path for non-exported %v", obj)
+ }
+ return Path(obj.Name()), nil
+ }
+
+ // 3. Not a package-level object.
+ // Reject obviously non-viable cases.
+ switch obj := obj.(type) {
+ case *types.TypeName:
+ if _, ok := types.Unalias(obj.Type()).(*types.TypeParam); !ok {
+ // With the exception of type parameters, only package-level type names
+ // have a path.
+ return "", fmt.Errorf("no path for %v", obj)
+ }
+ case *types.Const, // Only package-level constants have a path.
+ *types.Label, // Labels are function-local.
+ *types.PkgName: // PkgNames are file-local.
+ return "", fmt.Errorf("no path for %v", obj)
+
+ case *types.Var:
+ // Could be:
+ // - a field (obj.IsField())
+ // - a func parameter or result
+ // - a local var.
+ // Sadly there is no way to distinguish
+ // a param/result from a local
+ // so we must proceed to the find.
+
+ case *types.Func:
+ // A func, if not package-level, must be a method.
+ if recv := obj.Type().(*types.Signature).Recv(); recv == nil {
+ return "", fmt.Errorf("func is not a method: %v", obj)
+ }
+
+ if path, ok := enc.concreteMethod(obj); ok {
+ // Fast path for concrete methods that avoids looping over scope.
+ return path, nil
+ }
+
+ default:
+ panic(obj)
+ }
+
+ // 4. Search the API for the path to the var (field/param/result) or method.
+
+ // First inspect package-level named types.
+ // In the presence of path aliases, these give
+ // the best paths because non-types may
+ // refer to types, but not the reverse.
+ empty := make([]byte, 0, 48) // initial space
+ objs := enc.scopeObjects(scope)
+ for _, o := range objs {
+ tname, ok := o.(*types.TypeName)
+ if !ok {
+ continue // handle non-types in second pass
+ }
+
+ path := append(empty, o.Name()...)
+ path = append(path, opType)
+
+ T := o.Type()
+ if alias, ok := T.(*types.Alias); ok {
+ if r := findTypeParam(obj, aliases.TypeParams(alias), path, opTypeParam); r != nil {
+ return Path(r), nil
+ }
+ if r := find(obj, aliases.Rhs(alias), append(path, opRhs)); r != nil {
+ return Path(r), nil
+ }
+
+ } else if tname.IsAlias() {
+ // legacy alias
+ if r := find(obj, T, path); r != nil {
+ return Path(r), nil
+ }
+
+ } else if named, ok := T.(*types.Named); ok {
+ // defined (named) type
+ if r := findTypeParam(obj, named.TypeParams(), path, opTypeParam); r != nil {
+ return Path(r), nil
+ }
+ if r := find(obj, named.Underlying(), append(path, opUnderlying)); r != nil {
+ return Path(r), nil
+ }
+ }
+ }
+
+ // Then inspect everything else:
+ // non-types, and declared methods of defined types.
+ for _, o := range objs {
+ path := append(empty, o.Name()...)
+ if _, ok := o.(*types.TypeName); !ok {
+ if o.Exported() {
+ // exported non-type (const, var, func)
+ if r := find(obj, o.Type(), append(path, opType)); r != nil {
+ return Path(r), nil
+ }
+ }
+ continue
+ }
+
+ // Inspect declared methods of defined types.
+ if T, ok := types.Unalias(o.Type()).(*types.Named); ok {
+ path = append(path, opType)
+ // The method index here is always with respect
+ // to the underlying go/types data structures,
+ // which ultimately derives from source order
+ // and must be preserved by export data.
+ for i := 0; i < T.NumMethods(); i++ {
+ m := T.Method(i)
+ path2 := appendOpArg(path, opMethod, i)
+ if m == obj {
+ return Path(path2), nil // found declared method
+ }
+ if r := find(obj, m.Type(), append(path2, opType)); r != nil {
+ return Path(r), nil
+ }
+ }
+ }
+ }
+
+ return "", fmt.Errorf("can't find path for %v in %s", obj, pkg.Path())
+}
+
+func appendOpArg(path []byte, op byte, arg int) []byte {
+ path = append(path, op)
+ path = strconv.AppendInt(path, int64(arg), 10)
+ return path
+}
+
+// concreteMethod returns the path for meth, which must have a non-nil receiver.
+// The second return value indicates success and may be false if the method is
+// an interface method or if it is an instantiated method.
+//
+// This function is just an optimization that avoids the general scope walking
+// approach. You are expected to fall back to the general approach if this
+// function fails.
+func (enc *Encoder) concreteMethod(meth *types.Func) (Path, bool) {
+ // Concrete methods can only be declared on package-scoped named types. For
+ // that reason we can skip the expensive walk over the package scope: the
+ // path will always be package -> named type -> method. We can trivially get
+ // the type name from the receiver, and only have to look over the type's
+ // methods to find the method index.
+ //
+ // Methods on generic types require special consideration, however. Consider
+ // the following package:
+ //
+ // L1: type S[T any] struct{}
+ // L2: func (recv S[A]) Foo() { recv.Bar() }
+ // L3: func (recv S[B]) Bar() { }
+ // L4: type Alias = S[int]
+ // L5: func _[T any]() { var s S[int]; s.Foo() }
+ //
+ // The receivers of methods on generic types are instantiations. L2 and L3
+ // instantiate S with the type-parameters A and B, which are scoped to the
+ // respective methods. L4 and L5 each instantiate S with int. Each of these
+ // instantiations has its own method set, full of methods (and thus objects)
+ // with receivers whose types are the respective instantiations. In other
+ // words, we have
+ //
+ // S[A].Foo, S[A].Bar
+ // S[B].Foo, S[B].Bar
+ // S[int].Foo, S[int].Bar
+ //
+ // We may thus be trying to produce object paths for any of these objects.
+ //
+ // S[A].Foo and S[B].Bar are the origin methods, and their paths are S.Foo
+ // and S.Bar, which are the paths that this function naturally produces.
+ //
+ // S[A].Bar, S[B].Foo, and both methods on S[int] are instantiations that
+ // don't correspond to the origin methods. For S[int], this is significant.
+ // The most precise object path for S[int].Foo, for example, is Alias.Foo,
+ // not S.Foo. Our function, however, would produce S.Foo, which would
+ // resolve to a different object.
+ //
+ // For S[A].Bar and S[B].Foo it could be argued that S.Bar and S.Foo are
+ // still the correct paths, since only the origin methods have meaningful
+ // paths. But this is likely only true for trivial cases and has edge cases.
+ // Since this function is only an optimization, we err on the side of giving
+ // up, deferring to the slower but definitely correct algorithm. Most users
+ // of objectpath will only be giving us origin methods, anyway, as referring
+ // to instantiated methods is usually not useful.
+
+ if meth.Origin() != meth {
+ return "", false
+ }
+
+ _, named := typesinternal.ReceiverNamed(meth.Type().(*types.Signature).Recv())
+ if named == nil {
+ return "", false
+ }
+
+ if types.IsInterface(named) {
+ // Named interfaces don't have to be package-scoped
+ //
+ // TODO(dominikh): opt: if scope.Lookup(name) == named, then we can apply this optimization to interface
+ // methods, too, I think.
+ return "", false
+ }
+
+ // Preallocate space for the name, opType, opMethod, and some digits.
+ name := named.Obj().Name()
+ path := make([]byte, 0, len(name)+8)
+ path = append(path, name...)
+ path = append(path, opType)
+
+ // Method indices are w.r.t. the go/types data structures,
+ // ultimately deriving from source order,
+ // which is preserved by export data.
+ for i := 0; i < named.NumMethods(); i++ {
+ if named.Method(i) == meth {
+ path = appendOpArg(path, opMethod, i)
+ return Path(path), true
+ }
+ }
+
+ // Due to golang/go#59944, go/types fails to associate the receiver with
+ // certain methods on cgo types.
+ //
+ // TODO(rfindley): replace this panic once golang/go#59944 is fixed in all Go
+ // versions gopls supports.
+ return "", false
+ // panic(fmt.Sprintf("couldn't find method %s on type %s; methods: %#v", meth, named, enc.namedMethods(named)))
+}
+
+// find finds obj within type T, returning the path to it, or nil if not found.
+//
+// The seen map is used to short circuit cycles through type parameters. If
+// nil, it will be allocated as necessary.
+//
+// The seenMethods map is used internally to short circuit cycles through
+// interface methods, such as occur in the following example:
+//
+// type I interface { f() interface{I} }
+//
+// See golang/go#68046 for details.
+func find(obj types.Object, T types.Type, path []byte) []byte {
+ return (&finder{obj: obj}).find(T, path)
+}
+
+// finder closes over search state for a call to find.
+type finder struct {
+ obj types.Object // the sought object
+ seenTParamNames map[*types.TypeName]bool // for cycle breaking through type parameters
+ seenMethods map[*types.Func]bool // for cycle breaking through recursive interfaces
+}
+
+func (f *finder) find(T types.Type, path []byte) []byte {
+ switch T := T.(type) {
+ case *types.Alias:
+ return f.find(types.Unalias(T), path)
+ case *types.Basic, *types.Named:
+ // Named types belonging to pkg were handled already,
+ // so T must belong to another package. No path.
+ return nil
+ case *types.Pointer:
+ return f.find(T.Elem(), append(path, opElem))
+ case *types.Slice:
+ return f.find(T.Elem(), append(path, opElem))
+ case *types.Array:
+ return f.find(T.Elem(), append(path, opElem))
+ case *types.Chan:
+ return f.find(T.Elem(), append(path, opElem))
+ case *types.Map:
+ if r := f.find(T.Key(), append(path, opKey)); r != nil {
+ return r
+ }
+ return f.find(T.Elem(), append(path, opElem))
+ case *types.Signature:
+ if r := f.findTypeParam(T.RecvTypeParams(), path, opRecvTypeParam); r != nil {
+ return r
+ }
+ if r := f.findTypeParam(T.TypeParams(), path, opTypeParam); r != nil {
+ return r
+ }
+ if r := f.find(T.Params(), append(path, opParams)); r != nil {
+ return r
+ }
+ return f.find(T.Results(), append(path, opResults))
+ case *types.Struct:
+ for i := 0; i < T.NumFields(); i++ {
+ fld := T.Field(i)
+ path2 := appendOpArg(path, opField, i)
+ if fld == f.obj {
+ return path2 // found field var
+ }
+ if r := f.find(fld.Type(), append(path2, opType)); r != nil {
+ return r
+ }
+ }
+ return nil
+ case *types.Tuple:
+ for i := 0; i < T.Len(); i++ {
+ v := T.At(i)
+ path2 := appendOpArg(path, opAt, i)
+ if v == f.obj {
+ return path2 // found param/result var
+ }
+ if r := f.find(v.Type(), append(path2, opType)); r != nil {
+ return r
+ }
+ }
+ return nil
+ case *types.Interface:
+ for i := 0; i < T.NumMethods(); i++ {
+ m := T.Method(i)
+ if f.seenMethods[m] {
+ return nil
+ }
+ path2 := appendOpArg(path, opMethod, i)
+ if m == f.obj {
+ return path2 // found interface method
+ }
+ if f.seenMethods == nil {
+ f.seenMethods = make(map[*types.Func]bool)
+ }
+ f.seenMethods[m] = true
+ if r := f.find(m.Type(), append(path2, opType)); r != nil {
+ return r
+ }
+ }
+ return nil
+ case *types.TypeParam:
+ name := T.Obj()
+ if f.seenTParamNames[name] {
+ return nil
+ }
+ if name == f.obj {
+ return append(path, opObj)
+ }
+ if f.seenTParamNames == nil {
+ f.seenTParamNames = make(map[*types.TypeName]bool)
+ }
+ f.seenTParamNames[name] = true
+ if r := f.find(T.Constraint(), append(path, opConstraint)); r != nil {
+ return r
+ }
+ return nil
+ }
+ panic(T)
+}
+
+func findTypeParam(obj types.Object, list *types.TypeParamList, path []byte, op byte) []byte {
+ return (&finder{obj: obj}).findTypeParam(list, path, op)
+}
+
+func (f *finder) findTypeParam(list *types.TypeParamList, path []byte, op byte) []byte {
+ for i := 0; i < list.Len(); i++ {
+ tparam := list.At(i)
+ path2 := appendOpArg(path, op, i)
+ if r := f.find(tparam, path2); r != nil {
+ return r
+ }
+ }
+ return nil
+}
+
+// Object returns the object denoted by path p within the package pkg.
+func Object(pkg *types.Package, p Path) (types.Object, error) {
+ pathstr := string(p)
+ if pathstr == "" {
+ return nil, fmt.Errorf("empty path")
+ }
+
+ var pkgobj, suffix string
+ if dot := strings.IndexByte(pathstr, opType); dot < 0 {
+ pkgobj = pathstr
+ } else {
+ pkgobj = pathstr[:dot]
+ suffix = pathstr[dot:] // suffix starts with "."
+ }
+
+ obj := pkg.Scope().Lookup(pkgobj)
+ if obj == nil {
+ return nil, fmt.Errorf("package %s does not contain %q", pkg.Path(), pkgobj)
+ }
+
+ // abstraction of *types.{Pointer,Slice,Array,Chan,Map}
+ type hasElem interface {
+ Elem() types.Type
+ }
+ // abstraction of *types.{Named,Signature}
+ type hasTypeParams interface {
+ TypeParams() *types.TypeParamList
+ }
+ // abstraction of *types.{Named,TypeParam}
+ type hasObj interface {
+ Obj() *types.TypeName
+ }
+
+ // The loop state is the pair (t, obj),
+ // exactly one of which is non-nil, initially obj.
+ // All suffixes start with '.' (the only object->type operation),
+ // followed by optional type->type operations,
+ // then a type->object operation.
+ // The cycle then repeats.
+ var t types.Type
+ for suffix != "" {
+ code := suffix[0]
+ suffix = suffix[1:]
+
+ // Codes [AFMTr] have an integer operand.
+ var index int
+ switch code {
+ case opAt, opField, opMethod, opTypeParam, opRecvTypeParam:
+ rest := strings.TrimLeft(suffix, "0123456789")
+ numerals := suffix[:len(suffix)-len(rest)]
+ suffix = rest
+ i, err := strconv.Atoi(numerals)
+ if err != nil {
+ return nil, fmt.Errorf("invalid path: bad numeric operand %q for code %q", numerals, code)
+ }
+ index = int(i)
+ case opObj:
+ // no operand
+ default:
+ // The suffix must end with a type->object operation.
+ if suffix == "" {
+ return nil, fmt.Errorf("invalid path: ends with %q, want [AFMO]", code)
+ }
+ }
+
+ if code == opType {
+ if t != nil {
+ return nil, fmt.Errorf("invalid path: unexpected %q in type context", opType)
+ }
+ t = obj.Type()
+ obj = nil
+ continue
+ }
+
+ if t == nil {
+ return nil, fmt.Errorf("invalid path: code %q in object context", code)
+ }
+
+ // Inv: t != nil, obj == nil
+
+ t = types.Unalias(t)
+ switch code {
+ case opElem:
+ hasElem, ok := t.(hasElem) // Pointer, Slice, Array, Chan, Map
+ if !ok {
+ return nil, fmt.Errorf("cannot apply %q to %s (got %T, want pointer, slice, array, chan or map)", code, t, t)
+ }
+ t = hasElem.Elem()
+
+ case opKey:
+ mapType, ok := t.(*types.Map)
+ if !ok {
+ return nil, fmt.Errorf("cannot apply %q to %s (got %T, want map)", code, t, t)
+ }
+ t = mapType.Key()
+
+ case opParams:
+ sig, ok := t.(*types.Signature)
+ if !ok {
+ return nil, fmt.Errorf("cannot apply %q to %s (got %T, want signature)", code, t, t)
+ }
+ t = sig.Params()
+
+ case opResults:
+ sig, ok := t.(*types.Signature)
+ if !ok {
+ return nil, fmt.Errorf("cannot apply %q to %s (got %T, want signature)", code, t, t)
+ }
+ t = sig.Results()
+
+ case opUnderlying:
+ named, ok := t.(*types.Named)
+ if !ok {
+ return nil, fmt.Errorf("cannot apply %q to %s (got %T, want named)", code, t, t)
+ }
+ t = named.Underlying()
+
+ case opRhs:
+ if alias, ok := t.(*types.Alias); ok {
+ t = aliases.Rhs(alias)
+ } else if false && aliases.Enabled() {
+ // The Enabled check is too expensive, so for now we
+ // simply assume that aliases are not enabled.
+ // TODO(adonovan): replace with "if true {" when go1.24 is assured.
+ return nil, fmt.Errorf("cannot apply %q to %s (got %T, want alias)", code, t, t)
+ }
+
+ case opTypeParam:
+ hasTypeParams, ok := t.(hasTypeParams) // Named, Signature
+ if !ok {
+ return nil, fmt.Errorf("cannot apply %q to %s (got %T, want named or signature)", code, t, t)
+ }
+ tparams := hasTypeParams.TypeParams()
+ if n := tparams.Len(); index >= n {
+ return nil, fmt.Errorf("tuple index %d out of range [0-%d)", index, n)
+ }
+ t = tparams.At(index)
+
+ case opRecvTypeParam:
+ sig, ok := t.(*types.Signature) // Signature
+ if !ok {
+ return nil, fmt.Errorf("cannot apply %q to %s (got %T, want signature)", code, t, t)
+ }
+ rtparams := sig.RecvTypeParams()
+ if n := rtparams.Len(); index >= n {
+ return nil, fmt.Errorf("tuple index %d out of range [0-%d)", index, n)
+ }
+ t = rtparams.At(index)
+
+ case opConstraint:
+ tparam, ok := t.(*types.TypeParam)
+ if !ok {
+ return nil, fmt.Errorf("cannot apply %q to %s (got %T, want type parameter)", code, t, t)
+ }
+ t = tparam.Constraint()
+
+ case opAt:
+ tuple, ok := t.(*types.Tuple)
+ if !ok {
+ return nil, fmt.Errorf("cannot apply %q to %s (got %T, want tuple)", code, t, t)
+ }
+ if n := tuple.Len(); index >= n {
+ return nil, fmt.Errorf("tuple index %d out of range [0-%d)", index, n)
+ }
+ obj = tuple.At(index)
+ t = nil
+
+ case opField:
+ structType, ok := t.(*types.Struct)
+ if !ok {
+ return nil, fmt.Errorf("cannot apply %q to %s (got %T, want struct)", code, t, t)
+ }
+ if n := structType.NumFields(); index >= n {
+ return nil, fmt.Errorf("field index %d out of range [0-%d)", index, n)
+ }
+ obj = structType.Field(index)
+ t = nil
+
+ case opMethod:
+ switch t := t.(type) {
+ case *types.Interface:
+ if index >= t.NumMethods() {
+ return nil, fmt.Errorf("method index %d out of range [0-%d)", index, t.NumMethods())
+ }
+ obj = t.Method(index) // Id-ordered
+
+ case *types.Named:
+ if index >= t.NumMethods() {
+ return nil, fmt.Errorf("method index %d out of range [0-%d)", index, t.NumMethods())
+ }
+ obj = t.Method(index)
+
+ default:
+ return nil, fmt.Errorf("cannot apply %q to %s (got %T, want interface or named)", code, t, t)
+ }
+ t = nil
+
+ case opObj:
+ hasObj, ok := t.(hasObj)
+ if !ok {
+ return nil, fmt.Errorf("cannot apply %q to %s (got %T, want named or type param)", code, t, t)
+ }
+ obj = hasObj.Obj()
+ t = nil
+
+ default:
+ return nil, fmt.Errorf("invalid path: unknown code %q", code)
+ }
+ }
+
+ if obj == nil {
+ panic(p) // path does not end in an object-valued operator
+ }
+
+ if obj.Pkg() != pkg {
+ return nil, fmt.Errorf("path denotes %s, which belongs to a different package", obj)
+ }
+
+ return obj, nil // success
+}
+
+// scopeObjects is a memoization of scope objects.
+// Callers must not modify the result.
+func (enc *Encoder) scopeObjects(scope *types.Scope) []types.Object {
+ m := enc.scopeMemo
+ if m == nil {
+ m = make(map[*types.Scope][]types.Object)
+ enc.scopeMemo = m
+ }
+ objs, ok := m[scope]
+ if !ok {
+ names := scope.Names() // allocates and sorts
+ objs = make([]types.Object, len(names))
+ for i, name := range names {
+ objs[i] = scope.Lookup(name)
+ }
+ m[scope] = objs
+ }
+ return objs
+}
diff --git a/vendor/golang.org/x/tools/go/types/typeutil/callee.go b/vendor/golang.org/x/tools/go/types/typeutil/callee.go
new file mode 100644
index 00000000..75438035
--- /dev/null
+++ b/vendor/golang.org/x/tools/go/types/typeutil/callee.go
@@ -0,0 +1,68 @@
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package typeutil
+
+import (
+ "go/ast"
+ "go/types"
+
+ "golang.org/x/tools/internal/typeparams"
+)
+
+// Callee returns the named target of a function call, if any:
+// a function, method, builtin, or variable.
+//
+// Functions and methods may potentially have type parameters.
+func Callee(info *types.Info, call *ast.CallExpr) types.Object {
+ fun := ast.Unparen(call.Fun)
+
+ // Look through type instantiation if necessary.
+ isInstance := false
+ switch fun.(type) {
+ case *ast.IndexExpr, *ast.IndexListExpr:
+ // When extracting the callee from an *IndexExpr, we need to check that
+ // it is a *types.Func and not a *types.Var.
+ // Example: Don't match a slice m within the expression `m[0]()`.
+ isInstance = true
+ fun, _, _, _ = typeparams.UnpackIndexExpr(fun)
+ }
+
+ var obj types.Object
+ switch fun := fun.(type) {
+ case *ast.Ident:
+ obj = info.Uses[fun] // type, var, builtin, or declared func
+ case *ast.SelectorExpr:
+ if sel, ok := info.Selections[fun]; ok {
+ obj = sel.Obj() // method or field
+ } else {
+ obj = info.Uses[fun.Sel] // qualified identifier?
+ }
+ }
+ if _, ok := obj.(*types.TypeName); ok {
+ return nil // T(x) is a conversion, not a call
+ }
+ // A Func is required to match instantiations.
+ if _, ok := obj.(*types.Func); isInstance && !ok {
+ return nil // Was not a Func.
+ }
+ return obj
+}
+
+// StaticCallee returns the target (function or method) of a static function
+// call, if any. It returns nil for calls to builtins.
+//
+// Note: for calls of instantiated functions and methods, StaticCallee returns
+// the corresponding generic function or method on the generic type.
+func StaticCallee(info *types.Info, call *ast.CallExpr) *types.Func {
+ if f, ok := Callee(info, call).(*types.Func); ok && !interfaceMethod(f) {
+ return f
+ }
+ return nil
+}
+
+func interfaceMethod(f *types.Func) bool {
+ recv := f.Type().(*types.Signature).Recv()
+ return recv != nil && types.IsInterface(recv.Type())
+}
diff --git a/vendor/golang.org/x/tools/go/types/typeutil/imports.go b/vendor/golang.org/x/tools/go/types/typeutil/imports.go
new file mode 100644
index 00000000..b81ce0c3
--- /dev/null
+++ b/vendor/golang.org/x/tools/go/types/typeutil/imports.go
@@ -0,0 +1,30 @@
+// Copyright 2014 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package typeutil
+
+import "go/types"
+
+// Dependencies returns all dependencies of the specified packages.
+//
+// Dependent packages appear in topological order: if package P imports
+// package Q, Q appears earlier than P in the result.
+// The algorithm follows import statements in the order they
+// appear in the source code, so the result is a total order.
+func Dependencies(pkgs ...*types.Package) []*types.Package {
+ var result []*types.Package
+ seen := make(map[*types.Package]bool)
+ var visit func(pkgs []*types.Package)
+ visit = func(pkgs []*types.Package) {
+ for _, p := range pkgs {
+ if !seen[p] {
+ seen[p] = true
+ visit(p.Imports())
+ result = append(result, p)
+ }
+ }
+ }
+ visit(pkgs)
+ return result
+}
diff --git a/vendor/golang.org/x/tools/go/types/typeutil/map.go b/vendor/golang.org/x/tools/go/types/typeutil/map.go
new file mode 100644
index 00000000..8d824f71
--- /dev/null
+++ b/vendor/golang.org/x/tools/go/types/typeutil/map.go
@@ -0,0 +1,517 @@
+// Copyright 2014 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Package typeutil defines various utilities for types, such as Map,
+// a mapping from types.Type to any values.
+package typeutil // import "golang.org/x/tools/go/types/typeutil"
+
+import (
+ "bytes"
+ "fmt"
+ "go/types"
+ "reflect"
+
+ "golang.org/x/tools/internal/typeparams"
+)
+
+// Map is a hash-table-based mapping from types (types.Type) to
+// arbitrary any values. The concrete types that implement
+// the Type interface are pointers. Since they are not canonicalized,
+// == cannot be used to check for equivalence, and thus we cannot
+// simply use a Go map.
+//
+// Just as with map[K]V, a nil *Map is a valid empty map.
+//
+// Not thread-safe.
+type Map struct {
+ hasher Hasher // shared by many Maps
+ table map[uint32][]entry // maps hash to bucket; entry.key==nil means unused
+ length int // number of map entries
+}
+
+// entry is an entry (key/value association) in a hash bucket.
+type entry struct {
+ key types.Type
+ value any
+}
+
+// SetHasher sets the hasher used by Map.
+//
+// All Hashers are functionally equivalent but contain internal state
+// used to cache the results of hashing previously seen types.
+//
+// A single Hasher created by MakeHasher() may be shared among many
+// Maps. This is recommended if the instances have many keys in
+// common, as it will amortize the cost of hash computation.
+//
+// A Hasher may grow without bound as new types are seen. Even when a
+// type is deleted from the map, the Hasher never shrinks, since other
+// types in the map may reference the deleted type indirectly.
+//
+// Hashers are not thread-safe, and read-only operations such as
+// Map.Lookup require updates to the hasher, so a full Mutex lock (not a
+// read-lock) is require around all Map operations if a shared
+// hasher is accessed from multiple threads.
+//
+// If SetHasher is not called, the Map will create a private hasher at
+// the first call to Insert.
+func (m *Map) SetHasher(hasher Hasher) {
+ m.hasher = hasher
+}
+
+// Delete removes the entry with the given key, if any.
+// It returns true if the entry was found.
+func (m *Map) Delete(key types.Type) bool {
+ if m != nil && m.table != nil {
+ hash := m.hasher.Hash(key)
+ bucket := m.table[hash]
+ for i, e := range bucket {
+ if e.key != nil && types.Identical(key, e.key) {
+ // We can't compact the bucket as it
+ // would disturb iterators.
+ bucket[i] = entry{}
+ m.length--
+ return true
+ }
+ }
+ }
+ return false
+}
+
+// At returns the map entry for the given key.
+// The result is nil if the entry is not present.
+func (m *Map) At(key types.Type) any {
+ if m != nil && m.table != nil {
+ for _, e := range m.table[m.hasher.Hash(key)] {
+ if e.key != nil && types.Identical(key, e.key) {
+ return e.value
+ }
+ }
+ }
+ return nil
+}
+
+// Set sets the map entry for key to val,
+// and returns the previous entry, if any.
+func (m *Map) Set(key types.Type, value any) (prev any) {
+ if m.table != nil {
+ hash := m.hasher.Hash(key)
+ bucket := m.table[hash]
+ var hole *entry
+ for i, e := range bucket {
+ if e.key == nil {
+ hole = &bucket[i]
+ } else if types.Identical(key, e.key) {
+ prev = e.value
+ bucket[i].value = value
+ return
+ }
+ }
+
+ if hole != nil {
+ *hole = entry{key, value} // overwrite deleted entry
+ } else {
+ m.table[hash] = append(bucket, entry{key, value})
+ }
+ } else {
+ if m.hasher.memo == nil {
+ m.hasher = MakeHasher()
+ }
+ hash := m.hasher.Hash(key)
+ m.table = map[uint32][]entry{hash: {entry{key, value}}}
+ }
+
+ m.length++
+ return
+}
+
+// Len returns the number of map entries.
+func (m *Map) Len() int {
+ if m != nil {
+ return m.length
+ }
+ return 0
+}
+
+// Iterate calls function f on each entry in the map in unspecified order.
+//
+// If f should mutate the map, Iterate provides the same guarantees as
+// Go maps: if f deletes a map entry that Iterate has not yet reached,
+// f will not be invoked for it, but if f inserts a map entry that
+// Iterate has not yet reached, whether or not f will be invoked for
+// it is unspecified.
+func (m *Map) Iterate(f func(key types.Type, value any)) {
+ if m != nil {
+ for _, bucket := range m.table {
+ for _, e := range bucket {
+ if e.key != nil {
+ f(e.key, e.value)
+ }
+ }
+ }
+ }
+}
+
+// Keys returns a new slice containing the set of map keys.
+// The order is unspecified.
+func (m *Map) Keys() []types.Type {
+ keys := make([]types.Type, 0, m.Len())
+ m.Iterate(func(key types.Type, _ any) {
+ keys = append(keys, key)
+ })
+ return keys
+}
+
+func (m *Map) toString(values bool) string {
+ if m == nil {
+ return "{}"
+ }
+ var buf bytes.Buffer
+ fmt.Fprint(&buf, "{")
+ sep := ""
+ m.Iterate(func(key types.Type, value any) {
+ fmt.Fprint(&buf, sep)
+ sep = ", "
+ fmt.Fprint(&buf, key)
+ if values {
+ fmt.Fprintf(&buf, ": %q", value)
+ }
+ })
+ fmt.Fprint(&buf, "}")
+ return buf.String()
+}
+
+// String returns a string representation of the map's entries.
+// Values are printed using fmt.Sprintf("%v", v).
+// Order is unspecified.
+func (m *Map) String() string {
+ return m.toString(true)
+}
+
+// KeysString returns a string representation of the map's key set.
+// Order is unspecified.
+func (m *Map) KeysString() string {
+ return m.toString(false)
+}
+
+////////////////////////////////////////////////////////////////////////
+// Hasher
+
+// A Hasher maps each type to its hash value.
+// For efficiency, a hasher uses memoization; thus its memory
+// footprint grows monotonically over time.
+// Hashers are not thread-safe.
+// Hashers have reference semantics.
+// Call MakeHasher to create a Hasher.
+type Hasher struct {
+ memo map[types.Type]uint32
+
+ // ptrMap records pointer identity.
+ ptrMap map[any]uint32
+
+ // sigTParams holds type parameters from the signature being hashed.
+ // Signatures are considered identical modulo renaming of type parameters, so
+ // within the scope of a signature type the identity of the signature's type
+ // parameters is just their index.
+ //
+ // Since the language does not currently support referring to uninstantiated
+ // generic types or functions, and instantiated signatures do not have type
+ // parameter lists, we should never encounter a second non-empty type
+ // parameter list when hashing a generic signature.
+ sigTParams *types.TypeParamList
+}
+
+// MakeHasher returns a new Hasher instance.
+func MakeHasher() Hasher {
+ return Hasher{
+ memo: make(map[types.Type]uint32),
+ ptrMap: make(map[any]uint32),
+ sigTParams: nil,
+ }
+}
+
+// Hash computes a hash value for the given type t such that
+// Identical(t, t') => Hash(t) == Hash(t').
+func (h Hasher) Hash(t types.Type) uint32 {
+ hash, ok := h.memo[t]
+ if !ok {
+ hash = h.hashFor(t)
+ h.memo[t] = hash
+ }
+ return hash
+}
+
+// hashString computes the Fowler–Noll–Vo hash of s.
+func hashString(s string) uint32 {
+ var h uint32
+ for i := 0; i < len(s); i++ {
+ h ^= uint32(s[i])
+ h *= 16777619
+ }
+ return h
+}
+
+// hashFor computes the hash of t.
+func (h Hasher) hashFor(t types.Type) uint32 {
+ // See Identical for rationale.
+ switch t := t.(type) {
+ case *types.Basic:
+ return uint32(t.Kind())
+
+ case *types.Alias:
+ return h.Hash(types.Unalias(t))
+
+ case *types.Array:
+ return 9043 + 2*uint32(t.Len()) + 3*h.Hash(t.Elem())
+
+ case *types.Slice:
+ return 9049 + 2*h.Hash(t.Elem())
+
+ case *types.Struct:
+ var hash uint32 = 9059
+ for i, n := 0, t.NumFields(); i < n; i++ {
+ f := t.Field(i)
+ if f.Anonymous() {
+ hash += 8861
+ }
+ hash += hashString(t.Tag(i))
+ hash += hashString(f.Name()) // (ignore f.Pkg)
+ hash += h.Hash(f.Type())
+ }
+ return hash
+
+ case *types.Pointer:
+ return 9067 + 2*h.Hash(t.Elem())
+
+ case *types.Signature:
+ var hash uint32 = 9091
+ if t.Variadic() {
+ hash *= 8863
+ }
+
+ // Use a separate hasher for types inside of the signature, where type
+ // parameter identity is modified to be (index, constraint). We must use a
+ // new memo for this hasher as type identity may be affected by this
+ // masking. For example, in func[T any](*T), the identity of *T depends on
+ // whether we are mapping the argument in isolation, or recursively as part
+ // of hashing the signature.
+ //
+ // We should never encounter a generic signature while hashing another
+ // generic signature, but defensively set sigTParams only if h.mask is
+ // unset.
+ tparams := t.TypeParams()
+ if h.sigTParams == nil && tparams.Len() != 0 {
+ h = Hasher{
+ // There may be something more efficient than discarding the existing
+ // memo, but it would require detecting whether types are 'tainted' by
+ // references to type parameters.
+ memo: make(map[types.Type]uint32),
+ // Re-using ptrMap ensures that pointer identity is preserved in this
+ // hasher.
+ ptrMap: h.ptrMap,
+ sigTParams: tparams,
+ }
+ }
+
+ for i := 0; i < tparams.Len(); i++ {
+ tparam := tparams.At(i)
+ hash += 7 * h.Hash(tparam.Constraint())
+ }
+
+ return hash + 3*h.hashTuple(t.Params()) + 5*h.hashTuple(t.Results())
+
+ case *types.Union:
+ return h.hashUnion(t)
+
+ case *types.Interface:
+ // Interfaces are identical if they have the same set of methods, with
+ // identical names and types, and they have the same set of type
+ // restrictions. See go/types.identical for more details.
+ var hash uint32 = 9103
+
+ // Hash methods.
+ for i, n := 0, t.NumMethods(); i < n; i++ {
+ // Method order is not significant.
+ // Ignore m.Pkg().
+ m := t.Method(i)
+ // Use shallow hash on method signature to
+ // avoid anonymous interface cycles.
+ hash += 3*hashString(m.Name()) + 5*h.shallowHash(m.Type())
+ }
+
+ // Hash type restrictions.
+ terms, err := typeparams.InterfaceTermSet(t)
+ // if err != nil t has invalid type restrictions.
+ if err == nil {
+ hash += h.hashTermSet(terms)
+ }
+
+ return hash
+
+ case *types.Map:
+ return 9109 + 2*h.Hash(t.Key()) + 3*h.Hash(t.Elem())
+
+ case *types.Chan:
+ return 9127 + 2*uint32(t.Dir()) + 3*h.Hash(t.Elem())
+
+ case *types.Named:
+ hash := h.hashPtr(t.Obj())
+ targs := t.TypeArgs()
+ for i := 0; i < targs.Len(); i++ {
+ targ := targs.At(i)
+ hash += 2 * h.Hash(targ)
+ }
+ return hash
+
+ case *types.TypeParam:
+ return h.hashTypeParam(t)
+
+ case *types.Tuple:
+ return h.hashTuple(t)
+ }
+
+ panic(fmt.Sprintf("%T: %v", t, t))
+}
+
+func (h Hasher) hashTuple(tuple *types.Tuple) uint32 {
+ // See go/types.identicalTypes for rationale.
+ n := tuple.Len()
+ hash := 9137 + 2*uint32(n)
+ for i := 0; i < n; i++ {
+ hash += 3 * h.Hash(tuple.At(i).Type())
+ }
+ return hash
+}
+
+func (h Hasher) hashUnion(t *types.Union) uint32 {
+ // Hash type restrictions.
+ terms, err := typeparams.UnionTermSet(t)
+ // if err != nil t has invalid type restrictions. Fall back on a non-zero
+ // hash.
+ if err != nil {
+ return 9151
+ }
+ return h.hashTermSet(terms)
+}
+
+func (h Hasher) hashTermSet(terms []*types.Term) uint32 {
+ hash := 9157 + 2*uint32(len(terms))
+ for _, term := range terms {
+ // term order is not significant.
+ termHash := h.Hash(term.Type())
+ if term.Tilde() {
+ termHash *= 9161
+ }
+ hash += 3 * termHash
+ }
+ return hash
+}
+
+// hashTypeParam returns a hash of the type parameter t, with a hash value
+// depending on whether t is contained in h.sigTParams.
+//
+// If h.sigTParams is set and contains t, then we are in the process of hashing
+// a signature, and the hash value of t must depend only on t's index and
+// constraint: signatures are considered identical modulo type parameter
+// renaming. To avoid infinite recursion, we only hash the type parameter
+// index, and rely on types.Identical to handle signatures where constraints
+// are not identical.
+//
+// Otherwise the hash of t depends only on t's pointer identity.
+func (h Hasher) hashTypeParam(t *types.TypeParam) uint32 {
+ if h.sigTParams != nil {
+ i := t.Index()
+ if i >= 0 && i < h.sigTParams.Len() && t == h.sigTParams.At(i) {
+ return 9173 + 3*uint32(i)
+ }
+ }
+ return h.hashPtr(t.Obj())
+}
+
+// hashPtr hashes the pointer identity of ptr. It uses h.ptrMap to ensure that
+// pointers values are not dependent on the GC.
+func (h Hasher) hashPtr(ptr any) uint32 {
+ if hash, ok := h.ptrMap[ptr]; ok {
+ return hash
+ }
+ hash := uint32(reflect.ValueOf(ptr).Pointer())
+ h.ptrMap[ptr] = hash
+ return hash
+}
+
+// shallowHash computes a hash of t without looking at any of its
+// element Types, to avoid potential anonymous cycles in the types of
+// interface methods.
+//
+// When an unnamed non-empty interface type appears anywhere among the
+// arguments or results of an interface method, there is a potential
+// for endless recursion. Consider:
+//
+// type X interface { m() []*interface { X } }
+//
+// The problem is that the Methods of the interface in m's result type
+// include m itself; there is no mention of the named type X that
+// might help us break the cycle.
+// (See comment in go/types.identical, case *Interface, for more.)
+func (h Hasher) shallowHash(t types.Type) uint32 {
+ // t is the type of an interface method (Signature),
+ // its params or results (Tuples), or their immediate
+ // elements (mostly Slice, Pointer, Basic, Named),
+ // so there's no need to optimize anything else.
+ switch t := t.(type) {
+ case *types.Alias:
+ return h.shallowHash(types.Unalias(t))
+
+ case *types.Signature:
+ var hash uint32 = 604171
+ if t.Variadic() {
+ hash *= 971767
+ }
+ // The Signature/Tuple recursion is always finite
+ // and invariably shallow.
+ return hash + 1062599*h.shallowHash(t.Params()) + 1282529*h.shallowHash(t.Results())
+
+ case *types.Tuple:
+ n := t.Len()
+ hash := 9137 + 2*uint32(n)
+ for i := 0; i < n; i++ {
+ hash += 53471161 * h.shallowHash(t.At(i).Type())
+ }
+ return hash
+
+ case *types.Basic:
+ return 45212177 * uint32(t.Kind())
+
+ case *types.Array:
+ return 1524181 + 2*uint32(t.Len())
+
+ case *types.Slice:
+ return 2690201
+
+ case *types.Struct:
+ return 3326489
+
+ case *types.Pointer:
+ return 4393139
+
+ case *types.Union:
+ return 562448657
+
+ case *types.Interface:
+ return 2124679 // no recursion here
+
+ case *types.Map:
+ return 9109
+
+ case *types.Chan:
+ return 9127
+
+ case *types.Named:
+ return h.hashPtr(t.Obj())
+
+ case *types.TypeParam:
+ return h.hashPtr(t.Obj())
+ }
+ panic(fmt.Sprintf("shallowHash: %T: %v", t, t))
+}
diff --git a/vendor/golang.org/x/tools/go/types/typeutil/methodsetcache.go b/vendor/golang.org/x/tools/go/types/typeutil/methodsetcache.go
new file mode 100644
index 00000000..f7666028
--- /dev/null
+++ b/vendor/golang.org/x/tools/go/types/typeutil/methodsetcache.go
@@ -0,0 +1,71 @@
+// Copyright 2014 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// This file implements a cache of method sets.
+
+package typeutil
+
+import (
+ "go/types"
+ "sync"
+)
+
+// A MethodSetCache records the method set of each type T for which
+// MethodSet(T) is called so that repeat queries are fast.
+// The zero value is a ready-to-use cache instance.
+type MethodSetCache struct {
+ mu sync.Mutex
+ named map[*types.Named]struct{ value, pointer *types.MethodSet } // method sets for named N and *N
+ others map[types.Type]*types.MethodSet // all other types
+}
+
+// MethodSet returns the method set of type T. It is thread-safe.
+//
+// If cache is nil, this function is equivalent to types.NewMethodSet(T).
+// Utility functions can thus expose an optional *MethodSetCache
+// parameter to clients that care about performance.
+func (cache *MethodSetCache) MethodSet(T types.Type) *types.MethodSet {
+ if cache == nil {
+ return types.NewMethodSet(T)
+ }
+ cache.mu.Lock()
+ defer cache.mu.Unlock()
+
+ switch T := types.Unalias(T).(type) {
+ case *types.Named:
+ return cache.lookupNamed(T).value
+
+ case *types.Pointer:
+ if N, ok := types.Unalias(T.Elem()).(*types.Named); ok {
+ return cache.lookupNamed(N).pointer
+ }
+ }
+
+ // all other types
+ // (The map uses pointer equivalence, not type identity.)
+ mset := cache.others[T]
+ if mset == nil {
+ mset = types.NewMethodSet(T)
+ if cache.others == nil {
+ cache.others = make(map[types.Type]*types.MethodSet)
+ }
+ cache.others[T] = mset
+ }
+ return mset
+}
+
+func (cache *MethodSetCache) lookupNamed(named *types.Named) struct{ value, pointer *types.MethodSet } {
+ if cache.named == nil {
+ cache.named = make(map[*types.Named]struct{ value, pointer *types.MethodSet })
+ }
+ // Avoid recomputing mset(*T) for each distinct Pointer
+ // instance whose underlying type is a named type.
+ msets, ok := cache.named[named]
+ if !ok {
+ msets.value = types.NewMethodSet(named)
+ msets.pointer = types.NewMethodSet(types.NewPointer(named))
+ cache.named[named] = msets
+ }
+ return msets
+}
diff --git a/vendor/golang.org/x/tools/go/types/typeutil/ui.go b/vendor/golang.org/x/tools/go/types/typeutil/ui.go
new file mode 100644
index 00000000..9dda6a25
--- /dev/null
+++ b/vendor/golang.org/x/tools/go/types/typeutil/ui.go
@@ -0,0 +1,53 @@
+// Copyright 2014 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package typeutil
+
+// This file defines utilities for user interfaces that display types.
+
+import (
+ "go/types"
+)
+
+// IntuitiveMethodSet returns the intuitive method set of a type T,
+// which is the set of methods you can call on an addressable value of
+// that type.
+//
+// The result always contains MethodSet(T), and is exactly MethodSet(T)
+// for interface types and for pointer-to-concrete types.
+// For all other concrete types T, the result additionally
+// contains each method belonging to *T if there is no identically
+// named method on T itself.
+//
+// This corresponds to user intuition about method sets;
+// this function is intended only for user interfaces.
+//
+// The order of the result is as for types.MethodSet(T).
+func IntuitiveMethodSet(T types.Type, msets *MethodSetCache) []*types.Selection {
+ isPointerToConcrete := func(T types.Type) bool {
+ ptr, ok := types.Unalias(T).(*types.Pointer)
+ return ok && !types.IsInterface(ptr.Elem())
+ }
+
+ var result []*types.Selection
+ mset := msets.MethodSet(T)
+ if types.IsInterface(T) || isPointerToConcrete(T) {
+ for i, n := 0, mset.Len(); i < n; i++ {
+ result = append(result, mset.At(i))
+ }
+ } else {
+ // T is some other concrete type.
+ // Report methods of T and *T, preferring those of T.
+ pmset := msets.MethodSet(types.NewPointer(T))
+ for i, n := 0, pmset.Len(); i < n; i++ {
+ meth := pmset.At(i)
+ if m := mset.Lookup(meth.Obj().Pkg(), meth.Obj().Name()); m != nil {
+ meth = m
+ }
+ result = append(result, meth)
+ }
+
+ }
+ return result
+}
diff --git a/vendor/golang.org/x/tools/internal/aliases/aliases.go b/vendor/golang.org/x/tools/internal/aliases/aliases.go
new file mode 100644
index 00000000..b9425f5a
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/aliases/aliases.go
@@ -0,0 +1,38 @@
+// Copyright 2024 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package aliases
+
+import (
+ "go/token"
+ "go/types"
+)
+
+// Package aliases defines backward compatible shims
+// for the types.Alias type representation added in 1.22.
+// This defines placeholders for x/tools until 1.26.
+
+// NewAlias creates a new TypeName in Package pkg that
+// is an alias for the type rhs.
+//
+// The enabled parameter determines whether the resulting [TypeName]'s
+// type is an [types.Alias]. Its value must be the result of a call to
+// [Enabled], which computes the effective value of
+// GODEBUG=gotypesalias=... by invoking the type checker. The Enabled
+// function is expensive and should be called once per task (e.g.
+// package import), not once per call to NewAlias.
+//
+// Precondition: enabled || len(tparams)==0.
+// If materialized aliases are disabled, there must not be any type parameters.
+func NewAlias(enabled bool, pos token.Pos, pkg *types.Package, name string, rhs types.Type, tparams []*types.TypeParam) *types.TypeName {
+ if enabled {
+ tname := types.NewTypeName(pos, pkg, name, nil)
+ SetTypeParams(types.NewAlias(tname, rhs), tparams)
+ return tname
+ }
+ if len(tparams) > 0 {
+ panic("cannot create an alias with type parameters when gotypesalias is not enabled")
+ }
+ return types.NewTypeName(pos, pkg, name, rhs)
+}
diff --git a/vendor/golang.org/x/tools/internal/aliases/aliases_go122.go b/vendor/golang.org/x/tools/internal/aliases/aliases_go122.go
new file mode 100644
index 00000000..7716a333
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/aliases/aliases_go122.go
@@ -0,0 +1,80 @@
+// Copyright 2024 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package aliases
+
+import (
+ "go/ast"
+ "go/parser"
+ "go/token"
+ "go/types"
+)
+
+// Rhs returns the type on the right-hand side of the alias declaration.
+func Rhs(alias *types.Alias) types.Type {
+ if alias, ok := any(alias).(interface{ Rhs() types.Type }); ok {
+ return alias.Rhs() // go1.23+
+ }
+
+ // go1.22's Alias didn't have the Rhs method,
+ // so Unalias is the best we can do.
+ return types.Unalias(alias)
+}
+
+// TypeParams returns the type parameter list of the alias.
+func TypeParams(alias *types.Alias) *types.TypeParamList {
+ if alias, ok := any(alias).(interface{ TypeParams() *types.TypeParamList }); ok {
+ return alias.TypeParams() // go1.23+
+ }
+ return nil
+}
+
+// SetTypeParams sets the type parameters of the alias type.
+func SetTypeParams(alias *types.Alias, tparams []*types.TypeParam) {
+ if alias, ok := any(alias).(interface {
+ SetTypeParams(tparams []*types.TypeParam)
+ }); ok {
+ alias.SetTypeParams(tparams) // go1.23+
+ } else if len(tparams) > 0 {
+ panic("cannot set type parameters of an Alias type in go1.22")
+ }
+}
+
+// TypeArgs returns the type arguments used to instantiate the Alias type.
+func TypeArgs(alias *types.Alias) *types.TypeList {
+ if alias, ok := any(alias).(interface{ TypeArgs() *types.TypeList }); ok {
+ return alias.TypeArgs() // go1.23+
+ }
+ return nil // empty (go1.22)
+}
+
+// Origin returns the generic Alias type of which alias is an instance.
+// If alias is not an instance of a generic alias, Origin returns alias.
+func Origin(alias *types.Alias) *types.Alias {
+ if alias, ok := any(alias).(interface{ Origin() *types.Alias }); ok {
+ return alias.Origin() // go1.23+
+ }
+ return alias // not an instance of a generic alias (go1.22)
+}
+
+// Enabled reports whether [NewAlias] should create [types.Alias] types.
+//
+// This function is expensive! Call it sparingly.
+func Enabled() bool {
+ // The only reliable way to compute the answer is to invoke go/types.
+ // We don't parse the GODEBUG environment variable, because
+ // (a) it's tricky to do so in a manner that is consistent
+ // with the godebug package; in particular, a simple
+ // substring check is not good enough. The value is a
+ // rightmost-wins list of options. But more importantly:
+ // (b) it is impossible to detect changes to the effective
+ // setting caused by os.Setenv("GODEBUG"), as happens in
+ // many tests. Therefore any attempt to cache the result
+ // is just incorrect.
+ fset := token.NewFileSet()
+ f, _ := parser.ParseFile(fset, "a.go", "package p; type A = int", parser.SkipObjectResolution)
+ pkg, _ := new(types.Config).Check("p", fset, []*ast.File{f}, nil)
+ _, enabled := pkg.Scope().Lookup("A").Type().(*types.Alias)
+ return enabled
+}
diff --git a/vendor/golang.org/x/tools/internal/gcimporter/bimport.go b/vendor/golang.org/x/tools/internal/gcimporter/bimport.go
new file mode 100644
index 00000000..d79a605e
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/gcimporter/bimport.go
@@ -0,0 +1,89 @@
+// Copyright 2015 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// This file contains the remaining vestiges of
+// $GOROOT/src/go/internal/gcimporter/bimport.go.
+
+package gcimporter
+
+import (
+ "fmt"
+ "go/token"
+ "go/types"
+ "sync"
+)
+
+func errorf(format string, args ...interface{}) {
+ panic(fmt.Sprintf(format, args...))
+}
+
+const deltaNewFile = -64 // see cmd/compile/internal/gc/bexport.go
+
+// Synthesize a token.Pos
+type fakeFileSet struct {
+ fset *token.FileSet
+ files map[string]*fileInfo
+}
+
+type fileInfo struct {
+ file *token.File
+ lastline int
+}
+
+const maxlines = 64 * 1024
+
+func (s *fakeFileSet) pos(file string, line, column int) token.Pos {
+ // TODO(mdempsky): Make use of column.
+
+ // Since we don't know the set of needed file positions, we reserve maxlines
+ // positions per file. We delay calling token.File.SetLines until all
+ // positions have been calculated (by way of fakeFileSet.setLines), so that
+ // we can avoid setting unnecessary lines. See also golang/go#46586.
+ f := s.files[file]
+ if f == nil {
+ f = &fileInfo{file: s.fset.AddFile(file, -1, maxlines)}
+ s.files[file] = f
+ }
+ if line > maxlines {
+ line = 1
+ }
+ if line > f.lastline {
+ f.lastline = line
+ }
+
+ // Return a fake position assuming that f.file consists only of newlines.
+ return token.Pos(f.file.Base() + line - 1)
+}
+
+func (s *fakeFileSet) setLines() {
+ fakeLinesOnce.Do(func() {
+ fakeLines = make([]int, maxlines)
+ for i := range fakeLines {
+ fakeLines[i] = i
+ }
+ })
+ for _, f := range s.files {
+ f.file.SetLines(fakeLines[:f.lastline])
+ }
+}
+
+var (
+ fakeLines []int
+ fakeLinesOnce sync.Once
+)
+
+func chanDir(d int) types.ChanDir {
+ // tag values must match the constants in cmd/compile/internal/gc/go.go
+ switch d {
+ case 1 /* Crecv */ :
+ return types.RecvOnly
+ case 2 /* Csend */ :
+ return types.SendOnly
+ case 3 /* Cboth */ :
+ return types.SendRecv
+ default:
+ errorf("unexpected channel dir %d", d)
+ return 0
+ }
+}
diff --git a/vendor/golang.org/x/tools/internal/gcimporter/exportdata.go b/vendor/golang.org/x/tools/internal/gcimporter/exportdata.go
new file mode 100644
index 00000000..f6437feb
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/gcimporter/exportdata.go
@@ -0,0 +1,99 @@
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// This file is a copy of $GOROOT/src/go/internal/gcimporter/exportdata.go.
+
+// This file implements FindExportData.
+
+package gcimporter
+
+import (
+ "bufio"
+ "fmt"
+ "io"
+ "strconv"
+ "strings"
+)
+
+func readGopackHeader(r *bufio.Reader) (name string, size int64, err error) {
+ // See $GOROOT/include/ar.h.
+ hdr := make([]byte, 16+12+6+6+8+10+2)
+ _, err = io.ReadFull(r, hdr)
+ if err != nil {
+ return
+ }
+ // leave for debugging
+ if false {
+ fmt.Printf("header: %s", hdr)
+ }
+ s := strings.TrimSpace(string(hdr[16+12+6+6+8:][:10]))
+ length, err := strconv.Atoi(s)
+ size = int64(length)
+ if err != nil || hdr[len(hdr)-2] != '`' || hdr[len(hdr)-1] != '\n' {
+ err = fmt.Errorf("invalid archive header")
+ return
+ }
+ name = strings.TrimSpace(string(hdr[:16]))
+ return
+}
+
+// FindExportData positions the reader r at the beginning of the
+// export data section of an underlying GC-created object/archive
+// file by reading from it. The reader must be positioned at the
+// start of the file before calling this function. The hdr result
+// is the string before the export data, either "$$" or "$$B".
+// The size result is the length of the export data in bytes, or -1 if not known.
+func FindExportData(r *bufio.Reader) (hdr string, size int64, err error) {
+ // Read first line to make sure this is an object file.
+ line, err := r.ReadSlice('\n')
+ if err != nil {
+ err = fmt.Errorf("can't find export data (%v)", err)
+ return
+ }
+
+ if string(line) == "!\n" {
+ // Archive file. Scan to __.PKGDEF.
+ var name string
+ if name, size, err = readGopackHeader(r); err != nil {
+ return
+ }
+
+ // First entry should be __.PKGDEF.
+ if name != "__.PKGDEF" {
+ err = fmt.Errorf("go archive is missing __.PKGDEF")
+ return
+ }
+
+ // Read first line of __.PKGDEF data, so that line
+ // is once again the first line of the input.
+ if line, err = r.ReadSlice('\n'); err != nil {
+ err = fmt.Errorf("can't find export data (%v)", err)
+ return
+ }
+ size -= int64(len(line))
+ }
+
+ // Now at __.PKGDEF in archive or still at beginning of file.
+ // Either way, line should begin with "go object ".
+ if !strings.HasPrefix(string(line), "go object ") {
+ err = fmt.Errorf("not a Go object file")
+ return
+ }
+
+ // Skip over object header to export data.
+ // Begins after first line starting with $$.
+ for line[0] != '$' {
+ if line, err = r.ReadSlice('\n'); err != nil {
+ err = fmt.Errorf("can't find export data (%v)", err)
+ return
+ }
+ size -= int64(len(line))
+ }
+ hdr = string(line)
+ if size < 0 {
+ size = -1
+ }
+
+ return
+}
diff --git a/vendor/golang.org/x/tools/internal/gcimporter/gcimporter.go b/vendor/golang.org/x/tools/internal/gcimporter/gcimporter.go
new file mode 100644
index 00000000..e6c5d51f
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/gcimporter/gcimporter.go
@@ -0,0 +1,271 @@
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// This file is a reduced copy of $GOROOT/src/go/internal/gcimporter/gcimporter.go.
+
+// Package gcimporter provides various functions for reading
+// gc-generated object files that can be used to implement the
+// Importer interface defined by the Go 1.5 standard library package.
+//
+// The encoding is deterministic: if the encoder is applied twice to
+// the same types.Package data structure, both encodings are equal.
+// This property may be important to avoid spurious changes in
+// applications such as build systems.
+//
+// However, the encoder is not necessarily idempotent. Importing an
+// exported package may yield a types.Package that, while it
+// represents the same set of Go types as the original, may differ in
+// the details of its internal representation. Because of these
+// differences, re-encoding the imported package may yield a
+// different, but equally valid, encoding of the package.
+package gcimporter // import "golang.org/x/tools/internal/gcimporter"
+
+import (
+ "bufio"
+ "bytes"
+ "fmt"
+ "go/build"
+ "go/token"
+ "go/types"
+ "io"
+ "os"
+ "os/exec"
+ "path/filepath"
+ "strings"
+ "sync"
+)
+
+const (
+ // Enable debug during development: it adds some additional checks, and
+ // prevents errors from being recovered.
+ debug = false
+
+ // If trace is set, debugging output is printed to std out.
+ trace = false
+)
+
+var exportMap sync.Map // package dir → func() (string, bool)
+
+// lookupGorootExport returns the location of the export data
+// (normally found in the build cache, but located in GOROOT/pkg
+// in prior Go releases) for the package located in pkgDir.
+//
+// (We use the package's directory instead of its import path
+// mainly to simplify handling of the packages in src/vendor
+// and cmd/vendor.)
+func lookupGorootExport(pkgDir string) (string, bool) {
+ f, ok := exportMap.Load(pkgDir)
+ if !ok {
+ var (
+ listOnce sync.Once
+ exportPath string
+ )
+ f, _ = exportMap.LoadOrStore(pkgDir, func() (string, bool) {
+ listOnce.Do(func() {
+ cmd := exec.Command("go", "list", "-export", "-f", "{{.Export}}", pkgDir)
+ cmd.Dir = build.Default.GOROOT
+ var output []byte
+ output, err := cmd.Output()
+ if err != nil {
+ return
+ }
+
+ exports := strings.Split(string(bytes.TrimSpace(output)), "\n")
+ if len(exports) != 1 {
+ return
+ }
+
+ exportPath = exports[0]
+ })
+
+ return exportPath, exportPath != ""
+ })
+ }
+
+ return f.(func() (string, bool))()
+}
+
+var pkgExts = [...]string{".a", ".o"}
+
+// FindPkg returns the filename and unique package id for an import
+// path based on package information provided by build.Import (using
+// the build.Default build.Context). A relative srcDir is interpreted
+// relative to the current working directory.
+// If no file was found, an empty filename is returned.
+func FindPkg(path, srcDir string) (filename, id string) {
+ if path == "" {
+ return
+ }
+
+ var noext string
+ switch {
+ default:
+ // "x" -> "$GOPATH/pkg/$GOOS_$GOARCH/x.ext", "x"
+ // Don't require the source files to be present.
+ if abs, err := filepath.Abs(srcDir); err == nil { // see issue 14282
+ srcDir = abs
+ }
+ bp, _ := build.Import(path, srcDir, build.FindOnly|build.AllowBinary)
+ if bp.PkgObj == "" {
+ var ok bool
+ if bp.Goroot && bp.Dir != "" {
+ filename, ok = lookupGorootExport(bp.Dir)
+ }
+ if !ok {
+ id = path // make sure we have an id to print in error message
+ return
+ }
+ } else {
+ noext = strings.TrimSuffix(bp.PkgObj, ".a")
+ id = bp.ImportPath
+ }
+
+ case build.IsLocalImport(path):
+ // "./x" -> "/this/directory/x.ext", "/this/directory/x"
+ noext = filepath.Join(srcDir, path)
+ id = noext
+
+ case filepath.IsAbs(path):
+ // for completeness only - go/build.Import
+ // does not support absolute imports
+ // "/x" -> "/x.ext", "/x"
+ noext = path
+ id = path
+ }
+
+ if false { // for debugging
+ if path != id {
+ fmt.Printf("%s -> %s\n", path, id)
+ }
+ }
+
+ if filename != "" {
+ if f, err := os.Stat(filename); err == nil && !f.IsDir() {
+ return
+ }
+ }
+
+ // try extensions
+ for _, ext := range pkgExts {
+ filename = noext + ext
+ if f, err := os.Stat(filename); err == nil && !f.IsDir() {
+ return
+ }
+ }
+
+ filename = "" // not found
+ return
+}
+
+// Import imports a gc-generated package given its import path and srcDir, adds
+// the corresponding package object to the packages map, and returns the object.
+// The packages map must contain all packages already imported.
+func Import(packages map[string]*types.Package, path, srcDir string, lookup func(path string) (io.ReadCloser, error)) (pkg *types.Package, err error) {
+ var rc io.ReadCloser
+ var filename, id string
+ if lookup != nil {
+ // With custom lookup specified, assume that caller has
+ // converted path to a canonical import path for use in the map.
+ if path == "unsafe" {
+ return types.Unsafe, nil
+ }
+ id = path
+
+ // No need to re-import if the package was imported completely before.
+ if pkg = packages[id]; pkg != nil && pkg.Complete() {
+ return
+ }
+ f, err := lookup(path)
+ if err != nil {
+ return nil, err
+ }
+ rc = f
+ } else {
+ filename, id = FindPkg(path, srcDir)
+ if filename == "" {
+ if path == "unsafe" {
+ return types.Unsafe, nil
+ }
+ return nil, fmt.Errorf("can't find import: %q", id)
+ }
+
+ // no need to re-import if the package was imported completely before
+ if pkg = packages[id]; pkg != nil && pkg.Complete() {
+ return
+ }
+
+ // open file
+ f, err := os.Open(filename)
+ if err != nil {
+ return nil, err
+ }
+ defer func() {
+ if err != nil {
+ // add file name to error
+ err = fmt.Errorf("%s: %v", filename, err)
+ }
+ }()
+ rc = f
+ }
+ defer rc.Close()
+
+ var hdr string
+ var size int64
+ buf := bufio.NewReader(rc)
+ if hdr, size, err = FindExportData(buf); err != nil {
+ return
+ }
+
+ switch hdr {
+ case "$$B\n":
+ var data []byte
+ data, err = io.ReadAll(buf)
+ if err != nil {
+ break
+ }
+
+ // TODO(gri): allow clients of go/importer to provide a FileSet.
+ // Or, define a new standard go/types/gcexportdata package.
+ fset := token.NewFileSet()
+
+ // Select appropriate importer.
+ if len(data) > 0 {
+ switch data[0] {
+ case 'v', 'c', 'd':
+ // binary: emitted by cmd/compile till go1.10; obsolete.
+ return nil, fmt.Errorf("binary (%c) import format is no longer supported", data[0])
+
+ case 'i':
+ // indexed: emitted by cmd/compile till go1.19;
+ // now used only for serializing go/types.
+ // See https://github.com/golang/go/issues/69491.
+ _, pkg, err := IImportData(fset, packages, data[1:], id)
+ return pkg, err
+
+ case 'u':
+ // unified: emitted by cmd/compile since go1.20.
+ _, pkg, err := UImportData(fset, packages, data[1:size], id)
+ return pkg, err
+
+ default:
+ l := len(data)
+ if l > 10 {
+ l = 10
+ }
+ return nil, fmt.Errorf("unexpected export data with prefix %q for path %s", string(data[:l]), id)
+ }
+ }
+
+ default:
+ err = fmt.Errorf("unknown export data header: %q", hdr)
+ }
+
+ return
+}
+
+type byPath []*types.Package
+
+func (a byPath) Len() int { return len(a) }
+func (a byPath) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
+func (a byPath) Less(i, j int) bool { return a[i].Path() < a[j].Path() }
diff --git a/vendor/golang.org/x/tools/internal/gcimporter/iexport.go b/vendor/golang.org/x/tools/internal/gcimporter/iexport.go
new file mode 100644
index 00000000..7dfc31a3
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/gcimporter/iexport.go
@@ -0,0 +1,1588 @@
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Indexed package export.
+//
+// The indexed export data format is an evolution of the previous
+// binary export data format. Its chief contribution is introducing an
+// index table, which allows efficient random access of individual
+// declarations and inline function bodies. In turn, this allows
+// avoiding unnecessary work for compilation units that import large
+// packages.
+//
+//
+// The top-level data format is structured as:
+//
+// Header struct {
+// Tag byte // 'i'
+// Version uvarint
+// StringSize uvarint
+// DataSize uvarint
+// }
+//
+// Strings [StringSize]byte
+// Data [DataSize]byte
+//
+// MainIndex []struct{
+// PkgPath stringOff
+// PkgName stringOff
+// PkgHeight uvarint
+//
+// Decls []struct{
+// Name stringOff
+// Offset declOff
+// }
+// }
+//
+// Fingerprint [8]byte
+//
+// uvarint means a uint64 written out using uvarint encoding.
+//
+// []T means a uvarint followed by that many T objects. In other
+// words:
+//
+// Len uvarint
+// Elems [Len]T
+//
+// stringOff means a uvarint that indicates an offset within the
+// Strings section. At that offset is another uvarint, followed by
+// that many bytes, which form the string value.
+//
+// declOff means a uvarint that indicates an offset within the Data
+// section where the associated declaration can be found.
+//
+//
+// There are five kinds of declarations, distinguished by their first
+// byte:
+//
+// type Var struct {
+// Tag byte // 'V'
+// Pos Pos
+// Type typeOff
+// }
+//
+// type Func struct {
+// Tag byte // 'F' or 'G'
+// Pos Pos
+// TypeParams []typeOff // only present if Tag == 'G'
+// Signature Signature
+// }
+//
+// type Const struct {
+// Tag byte // 'C'
+// Pos Pos
+// Value Value
+// }
+//
+// type Type struct {
+// Tag byte // 'T' or 'U'
+// Pos Pos
+// TypeParams []typeOff // only present if Tag == 'U'
+// Underlying typeOff
+//
+// Methods []struct{ // omitted if Underlying is an interface type
+// Pos Pos
+// Name stringOff
+// Recv Param
+// Signature Signature
+// }
+// }
+//
+// type Alias struct {
+// Tag byte // 'A' or 'B'
+// Pos Pos
+// TypeParams []typeOff // only present if Tag == 'B'
+// Type typeOff
+// }
+//
+// // "Automatic" declaration of each typeparam
+// type TypeParam struct {
+// Tag byte // 'P'
+// Pos Pos
+// Implicit bool
+// Constraint typeOff
+// }
+//
+// typeOff means a uvarint that either indicates a predeclared type,
+// or an offset into the Data section. If the uvarint is less than
+// predeclReserved, then it indicates the index into the predeclared
+// types list (see predeclared in bexport.go for order). Otherwise,
+// subtracting predeclReserved yields the offset of a type descriptor.
+//
+// Value means a type, kind, and type-specific value. See
+// (*exportWriter).value for details.
+//
+//
+// There are twelve kinds of type descriptors, distinguished by an itag:
+//
+// type DefinedType struct {
+// Tag itag // definedType
+// Name stringOff
+// PkgPath stringOff
+// }
+//
+// type PointerType struct {
+// Tag itag // pointerType
+// Elem typeOff
+// }
+//
+// type SliceType struct {
+// Tag itag // sliceType
+// Elem typeOff
+// }
+//
+// type ArrayType struct {
+// Tag itag // arrayType
+// Len uint64
+// Elem typeOff
+// }
+//
+// type ChanType struct {
+// Tag itag // chanType
+// Dir uint64 // 1 RecvOnly; 2 SendOnly; 3 SendRecv
+// Elem typeOff
+// }
+//
+// type MapType struct {
+// Tag itag // mapType
+// Key typeOff
+// Elem typeOff
+// }
+//
+// type FuncType struct {
+// Tag itag // signatureType
+// PkgPath stringOff
+// Signature Signature
+// }
+//
+// type StructType struct {
+// Tag itag // structType
+// PkgPath stringOff
+// Fields []struct {
+// Pos Pos
+// Name stringOff
+// Type typeOff
+// Embedded bool
+// Note stringOff
+// }
+// }
+//
+// type InterfaceType struct {
+// Tag itag // interfaceType
+// PkgPath stringOff
+// Embeddeds []struct {
+// Pos Pos
+// Type typeOff
+// }
+// Methods []struct {
+// Pos Pos
+// Name stringOff
+// Signature Signature
+// }
+// }
+//
+// // Reference to a type param declaration
+// type TypeParamType struct {
+// Tag itag // typeParamType
+// Name stringOff
+// PkgPath stringOff
+// }
+//
+// // Instantiation of a generic type (like List[T2] or List[int])
+// type InstanceType struct {
+// Tag itag // instanceType
+// Pos pos
+// TypeArgs []typeOff
+// BaseType typeOff
+// }
+//
+// type UnionType struct {
+// Tag itag // interfaceType
+// Terms []struct {
+// tilde bool
+// Type typeOff
+// }
+// }
+//
+//
+//
+// type Signature struct {
+// Params []Param
+// Results []Param
+// Variadic bool // omitted if Results is empty
+// }
+//
+// type Param struct {
+// Pos Pos
+// Name stringOff
+// Type typOff
+// }
+//
+//
+// Pos encodes a file:line:column triple, incorporating a simple delta
+// encoding scheme within a data object. See exportWriter.pos for
+// details.
+
+package gcimporter
+
+import (
+ "bytes"
+ "encoding/binary"
+ "fmt"
+ "go/constant"
+ "go/token"
+ "go/types"
+ "io"
+ "math/big"
+ "reflect"
+ "sort"
+ "strconv"
+ "strings"
+
+ "golang.org/x/tools/go/types/objectpath"
+ "golang.org/x/tools/internal/aliases"
+)
+
+// IExportShallow encodes "shallow" export data for the specified package.
+//
+// For types, we use "shallow" export data. Historically, the Go
+// compiler always produced a summary of the types for a given package
+// that included types from other packages that it indirectly
+// referenced: "deep" export data. This had the advantage that the
+// compiler (and analogous tools such as gopls) need only load one
+// file per direct import. However, it meant that the files tended to
+// get larger based on the level of the package in the import
+// graph. For example, higher-level packages in the kubernetes module
+// have over 1MB of "deep" export data, even when they have almost no
+// content of their own, merely because they mention a major type that
+// references many others. In pathological cases the export data was
+// 300x larger than the source for a package due to this quadratic
+// growth.
+//
+// "Shallow" export data means that the serialized types describe only
+// a single package. If those types mention types from other packages,
+// the type checker may need to request additional packages beyond
+// just the direct imports. Type information for the entire transitive
+// closure of imports is provided (lazily) by the DAG.
+//
+// No promises are made about the encoding other than that it can be decoded by
+// the same version of IIExportShallow. If you plan to save export data in the
+// file system, be sure to include a cryptographic digest of the executable in
+// the key to avoid version skew.
+//
+// If the provided reportf func is non-nil, it will be used for reporting bugs
+// encountered during export.
+// TODO(rfindley): remove reportf when we are confident enough in the new
+// objectpath encoding.
+func IExportShallow(fset *token.FileSet, pkg *types.Package, reportf ReportFunc) ([]byte, error) {
+ // In principle this operation can only fail if out.Write fails,
+ // but that's impossible for bytes.Buffer---and as a matter of
+ // fact iexportCommon doesn't even check for I/O errors.
+ // TODO(adonovan): handle I/O errors properly.
+ // TODO(adonovan): use byte slices throughout, avoiding copying.
+ const bundle, shallow = false, true
+ var out bytes.Buffer
+ err := iexportCommon(&out, fset, bundle, shallow, iexportVersion, []*types.Package{pkg})
+ return out.Bytes(), err
+}
+
+// IImportShallow decodes "shallow" types.Package data encoded by
+// [IExportShallow] in the same executable. This function cannot import data
+// from cmd/compile or gcexportdata.Write.
+//
+// The importer calls getPackages to obtain package symbols for all
+// packages mentioned in the export data, including the one being
+// decoded.
+//
+// If the provided reportf func is non-nil, it will be used for reporting bugs
+// encountered during import.
+// TODO(rfindley): remove reportf when we are confident enough in the new
+// objectpath encoding.
+func IImportShallow(fset *token.FileSet, getPackages GetPackagesFunc, data []byte, path string, reportf ReportFunc) (*types.Package, error) {
+ const bundle = false
+ const shallow = true
+ pkgs, err := iimportCommon(fset, getPackages, data, bundle, path, shallow, reportf)
+ if err != nil {
+ return nil, err
+ }
+ return pkgs[0], nil
+}
+
+// ReportFunc is the type of a function used to report formatted bugs.
+type ReportFunc = func(string, ...interface{})
+
+// Current bundled export format version. Increase with each format change.
+// 0: initial implementation
+const bundleVersion = 0
+
+// IExportData writes indexed export data for pkg to out.
+//
+// If no file set is provided, position info will be missing.
+// The package path of the top-level package will not be recorded,
+// so that calls to IImportData can override with a provided package path.
+func IExportData(out io.Writer, fset *token.FileSet, pkg *types.Package) error {
+ const bundle, shallow = false, false
+ return iexportCommon(out, fset, bundle, shallow, iexportVersion, []*types.Package{pkg})
+}
+
+// IExportBundle writes an indexed export bundle for pkgs to out.
+func IExportBundle(out io.Writer, fset *token.FileSet, pkgs []*types.Package) error {
+ const bundle, shallow = true, false
+ return iexportCommon(out, fset, bundle, shallow, iexportVersion, pkgs)
+}
+
+func iexportCommon(out io.Writer, fset *token.FileSet, bundle, shallow bool, version int, pkgs []*types.Package) (err error) {
+ if !debug {
+ defer func() {
+ if e := recover(); e != nil {
+ if ierr, ok := e.(internalError); ok {
+ err = ierr
+ return
+ }
+ // Not an internal error; panic again.
+ panic(e)
+ }
+ }()
+ }
+
+ p := iexporter{
+ fset: fset,
+ version: version,
+ shallow: shallow,
+ allPkgs: map[*types.Package]bool{},
+ stringIndex: map[string]uint64{},
+ declIndex: map[types.Object]uint64{},
+ tparamNames: map[types.Object]string{},
+ typIndex: map[types.Type]uint64{},
+ }
+ if !bundle {
+ p.localpkg = pkgs[0]
+ }
+
+ for i, pt := range predeclared() {
+ p.typIndex[pt] = uint64(i)
+ }
+ if len(p.typIndex) > predeclReserved {
+ panic(internalErrorf("too many predeclared types: %d > %d", len(p.typIndex), predeclReserved))
+ }
+
+ // Initialize work queue with exported declarations.
+ for _, pkg := range pkgs {
+ scope := pkg.Scope()
+ for _, name := range scope.Names() {
+ if token.IsExported(name) {
+ p.pushDecl(scope.Lookup(name))
+ }
+ }
+
+ if bundle {
+ // Ensure pkg and its imports are included in the index.
+ p.allPkgs[pkg] = true
+ for _, imp := range pkg.Imports() {
+ p.allPkgs[imp] = true
+ }
+ }
+ }
+
+ // Loop until no more work.
+ for !p.declTodo.empty() {
+ p.doDecl(p.declTodo.popHead())
+ }
+
+ // Produce index of offset of each file record in files.
+ var files intWriter
+ var fileOffset []uint64 // fileOffset[i] is offset in files of file encoded as i
+ if p.shallow {
+ fileOffset = make([]uint64, len(p.fileInfos))
+ for i, info := range p.fileInfos {
+ fileOffset[i] = uint64(files.Len())
+ p.encodeFile(&files, info.file, info.needed)
+ }
+ }
+
+ // Append indices to data0 section.
+ dataLen := uint64(p.data0.Len())
+ w := p.newWriter()
+ w.writeIndex(p.declIndex)
+
+ if bundle {
+ w.uint64(uint64(len(pkgs)))
+ for _, pkg := range pkgs {
+ w.pkg(pkg)
+ imps := pkg.Imports()
+ w.uint64(uint64(len(imps)))
+ for _, imp := range imps {
+ w.pkg(imp)
+ }
+ }
+ }
+ w.flush()
+
+ // Assemble header.
+ var hdr intWriter
+ if bundle {
+ hdr.uint64(bundleVersion)
+ }
+ hdr.uint64(uint64(p.version))
+ hdr.uint64(uint64(p.strings.Len()))
+ if p.shallow {
+ hdr.uint64(uint64(files.Len()))
+ hdr.uint64(uint64(len(fileOffset)))
+ for _, offset := range fileOffset {
+ hdr.uint64(offset)
+ }
+ }
+ hdr.uint64(dataLen)
+
+ // Flush output.
+ io.Copy(out, &hdr)
+ io.Copy(out, &p.strings)
+ if p.shallow {
+ io.Copy(out, &files)
+ }
+ io.Copy(out, &p.data0)
+
+ return nil
+}
+
+// encodeFile writes to w a representation of the file sufficient to
+// faithfully restore position information about all needed offsets.
+// Mutates the needed array.
+func (p *iexporter) encodeFile(w *intWriter, file *token.File, needed []uint64) {
+ _ = needed[0] // precondition: needed is non-empty
+
+ w.uint64(p.stringOff(file.Name()))
+
+ size := uint64(file.Size())
+ w.uint64(size)
+
+ // Sort the set of needed offsets. Duplicates are harmless.
+ sort.Slice(needed, func(i, j int) bool { return needed[i] < needed[j] })
+
+ lines := file.Lines() // byte offset of each line start
+ w.uint64(uint64(len(lines)))
+
+ // Rather than record the entire array of line start offsets,
+ // we save only a sparse list of (index, offset) pairs for
+ // the start of each line that contains a needed position.
+ var sparse [][2]int // (index, offset) pairs
+outer:
+ for i, lineStart := range lines {
+ lineEnd := size
+ if i < len(lines)-1 {
+ lineEnd = uint64(lines[i+1])
+ }
+ // Does this line contains a needed offset?
+ if needed[0] < lineEnd {
+ sparse = append(sparse, [2]int{i, lineStart})
+ for needed[0] < lineEnd {
+ needed = needed[1:]
+ if len(needed) == 0 {
+ break outer
+ }
+ }
+ }
+ }
+
+ // Delta-encode the columns.
+ w.uint64(uint64(len(sparse)))
+ var prev [2]int
+ for _, pair := range sparse {
+ w.uint64(uint64(pair[0] - prev[0]))
+ w.uint64(uint64(pair[1] - prev[1]))
+ prev = pair
+ }
+}
+
+// writeIndex writes out an object index. mainIndex indicates whether
+// we're writing out the main index, which is also read by
+// non-compiler tools and includes a complete package description
+// (i.e., name and height).
+func (w *exportWriter) writeIndex(index map[types.Object]uint64) {
+ type pkgObj struct {
+ obj types.Object
+ name string // qualified name; differs from obj.Name for type params
+ }
+ // Build a map from packages to objects from that package.
+ pkgObjs := map[*types.Package][]pkgObj{}
+
+ // For the main index, make sure to include every package that
+ // we reference, even if we're not exporting (or reexporting)
+ // any symbols from it.
+ if w.p.localpkg != nil {
+ pkgObjs[w.p.localpkg] = nil
+ }
+ for pkg := range w.p.allPkgs {
+ pkgObjs[pkg] = nil
+ }
+
+ for obj := range index {
+ name := w.p.exportName(obj)
+ pkgObjs[obj.Pkg()] = append(pkgObjs[obj.Pkg()], pkgObj{obj, name})
+ }
+
+ var pkgs []*types.Package
+ for pkg, objs := range pkgObjs {
+ pkgs = append(pkgs, pkg)
+
+ sort.Slice(objs, func(i, j int) bool {
+ return objs[i].name < objs[j].name
+ })
+ }
+
+ sort.Slice(pkgs, func(i, j int) bool {
+ return w.exportPath(pkgs[i]) < w.exportPath(pkgs[j])
+ })
+
+ w.uint64(uint64(len(pkgs)))
+ for _, pkg := range pkgs {
+ w.string(w.exportPath(pkg))
+ w.string(pkg.Name())
+ w.uint64(uint64(0)) // package height is not needed for go/types
+
+ objs := pkgObjs[pkg]
+ w.uint64(uint64(len(objs)))
+ for _, obj := range objs {
+ w.string(obj.name)
+ w.uint64(index[obj.obj])
+ }
+ }
+}
+
+// exportName returns the 'exported' name of an object. It differs from
+// obj.Name() only for type parameters (see tparamExportName for details).
+func (p *iexporter) exportName(obj types.Object) (res string) {
+ if name := p.tparamNames[obj]; name != "" {
+ return name
+ }
+ return obj.Name()
+}
+
+type iexporter struct {
+ fset *token.FileSet
+ out *bytes.Buffer
+ version int
+
+ shallow bool // don't put types from other packages in the index
+ objEncoder *objectpath.Encoder // encodes objects from other packages in shallow mode; lazily allocated
+ localpkg *types.Package // (nil in bundle mode)
+
+ // allPkgs tracks all packages that have been referenced by
+ // the export data, so we can ensure to include them in the
+ // main index.
+ allPkgs map[*types.Package]bool
+
+ declTodo objQueue
+
+ strings intWriter
+ stringIndex map[string]uint64
+
+ // In shallow mode, object positions are encoded as (file, offset).
+ // Each file is recorded as a line-number table.
+ // Only the lines of needed positions are saved faithfully.
+ fileInfo map[*token.File]uint64 // value is index in fileInfos
+ fileInfos []*filePositions
+
+ data0 intWriter
+ declIndex map[types.Object]uint64
+ tparamNames map[types.Object]string // typeparam->exported name
+ typIndex map[types.Type]uint64
+
+ indent int // for tracing support
+}
+
+type filePositions struct {
+ file *token.File
+ needed []uint64 // unordered list of needed file offsets
+}
+
+func (p *iexporter) trace(format string, args ...interface{}) {
+ if !trace {
+ // Call sites should also be guarded, but having this check here allows
+ // easily enabling/disabling debug trace statements.
+ return
+ }
+ fmt.Printf(strings.Repeat("..", p.indent)+format+"\n", args...)
+}
+
+// objectpathEncoder returns the lazily allocated objectpath.Encoder to use
+// when encoding objects in other packages during shallow export.
+//
+// Using a shared Encoder amortizes some of cost of objectpath search.
+func (p *iexporter) objectpathEncoder() *objectpath.Encoder {
+ if p.objEncoder == nil {
+ p.objEncoder = new(objectpath.Encoder)
+ }
+ return p.objEncoder
+}
+
+// stringOff returns the offset of s within the string section.
+// If not already present, it's added to the end.
+func (p *iexporter) stringOff(s string) uint64 {
+ off, ok := p.stringIndex[s]
+ if !ok {
+ off = uint64(p.strings.Len())
+ p.stringIndex[s] = off
+
+ p.strings.uint64(uint64(len(s)))
+ p.strings.WriteString(s)
+ }
+ return off
+}
+
+// fileIndexAndOffset returns the index of the token.File and the byte offset of pos within it.
+func (p *iexporter) fileIndexAndOffset(file *token.File, pos token.Pos) (uint64, uint64) {
+ index, ok := p.fileInfo[file]
+ if !ok {
+ index = uint64(len(p.fileInfo))
+ p.fileInfos = append(p.fileInfos, &filePositions{file: file})
+ if p.fileInfo == nil {
+ p.fileInfo = make(map[*token.File]uint64)
+ }
+ p.fileInfo[file] = index
+ }
+ // Record each needed offset.
+ info := p.fileInfos[index]
+ offset := uint64(file.Offset(pos))
+ info.needed = append(info.needed, offset)
+
+ return index, offset
+}
+
+// pushDecl adds n to the declaration work queue, if not already present.
+func (p *iexporter) pushDecl(obj types.Object) {
+ // Package unsafe is known to the compiler and predeclared.
+ // Caller should not ask us to do export it.
+ if obj.Pkg() == types.Unsafe {
+ panic("cannot export package unsafe")
+ }
+
+ // Shallow export data: don't index decls from other packages.
+ if p.shallow && obj.Pkg() != p.localpkg {
+ return
+ }
+
+ if _, ok := p.declIndex[obj]; ok {
+ return
+ }
+
+ p.declIndex[obj] = ^uint64(0) // mark obj present in work queue
+ p.declTodo.pushTail(obj)
+}
+
+// exportWriter handles writing out individual data section chunks.
+type exportWriter struct {
+ p *iexporter
+
+ data intWriter
+ prevFile string
+ prevLine int64
+ prevColumn int64
+}
+
+func (w *exportWriter) exportPath(pkg *types.Package) string {
+ if pkg == w.p.localpkg {
+ return ""
+ }
+ return pkg.Path()
+}
+
+func (p *iexporter) doDecl(obj types.Object) {
+ if trace {
+ p.trace("exporting decl %v (%T)", obj, obj)
+ p.indent++
+ defer func() {
+ p.indent--
+ p.trace("=> %s", obj)
+ }()
+ }
+ w := p.newWriter()
+
+ switch obj := obj.(type) {
+ case *types.Var:
+ w.tag(varTag)
+ w.pos(obj.Pos())
+ w.typ(obj.Type(), obj.Pkg())
+
+ case *types.Func:
+ sig, _ := obj.Type().(*types.Signature)
+ if sig.Recv() != nil {
+ // We shouldn't see methods in the package scope,
+ // but the type checker may repair "func () F() {}"
+ // to "func (Invalid) F()" and then treat it like "func F()",
+ // so allow that. See golang/go#57729.
+ if sig.Recv().Type() != types.Typ[types.Invalid] {
+ panic(internalErrorf("unexpected method: %v", sig))
+ }
+ }
+
+ // Function.
+ if sig.TypeParams().Len() == 0 {
+ w.tag(funcTag)
+ } else {
+ w.tag(genericFuncTag)
+ }
+ w.pos(obj.Pos())
+ // The tparam list of the function type is the declaration of the type
+ // params. So, write out the type params right now. Then those type params
+ // will be referenced via their type offset (via typOff) in all other
+ // places in the signature and function where they are used.
+ //
+ // While importing the type parameters, tparamList computes and records
+ // their export name, so that it can be later used when writing the index.
+ if tparams := sig.TypeParams(); tparams.Len() > 0 {
+ w.tparamList(obj.Name(), tparams, obj.Pkg())
+ }
+ w.signature(sig)
+
+ case *types.Const:
+ w.tag(constTag)
+ w.pos(obj.Pos())
+ w.value(obj.Type(), obj.Val())
+
+ case *types.TypeName:
+ t := obj.Type()
+
+ if tparam, ok := types.Unalias(t).(*types.TypeParam); ok {
+ w.tag(typeParamTag)
+ w.pos(obj.Pos())
+ constraint := tparam.Constraint()
+ if p.version >= iexportVersionGo1_18 {
+ implicit := false
+ if iface, _ := types.Unalias(constraint).(*types.Interface); iface != nil {
+ implicit = iface.IsImplicit()
+ }
+ w.bool(implicit)
+ }
+ w.typ(constraint, obj.Pkg())
+ break
+ }
+
+ if obj.IsAlias() {
+ alias, materialized := t.(*types.Alias) // may fail when aliases are not enabled
+
+ var tparams *types.TypeParamList
+ if materialized {
+ tparams = aliases.TypeParams(alias)
+ }
+ if tparams.Len() == 0 {
+ w.tag(aliasTag)
+ } else {
+ w.tag(genericAliasTag)
+ }
+ w.pos(obj.Pos())
+ if tparams.Len() > 0 {
+ w.tparamList(obj.Name(), tparams, obj.Pkg())
+ }
+ if materialized {
+ // Preserve materialized aliases,
+ // even of non-exported types.
+ t = aliases.Rhs(alias)
+ }
+ w.typ(t, obj.Pkg())
+ break
+ }
+
+ // Defined type.
+ named, ok := t.(*types.Named)
+ if !ok {
+ panic(internalErrorf("%s is not a defined type", t))
+ }
+
+ if named.TypeParams().Len() == 0 {
+ w.tag(typeTag)
+ } else {
+ w.tag(genericTypeTag)
+ }
+ w.pos(obj.Pos())
+
+ if named.TypeParams().Len() > 0 {
+ // While importing the type parameters, tparamList computes and records
+ // their export name, so that it can be later used when writing the index.
+ w.tparamList(obj.Name(), named.TypeParams(), obj.Pkg())
+ }
+
+ underlying := named.Underlying()
+ w.typ(underlying, obj.Pkg())
+
+ if types.IsInterface(t) {
+ break
+ }
+
+ n := named.NumMethods()
+ w.uint64(uint64(n))
+ for i := 0; i < n; i++ {
+ m := named.Method(i)
+ w.pos(m.Pos())
+ w.string(m.Name())
+ sig, _ := m.Type().(*types.Signature)
+
+ // Receiver type parameters are type arguments of the receiver type, so
+ // their name must be qualified before exporting recv.
+ if rparams := sig.RecvTypeParams(); rparams.Len() > 0 {
+ prefix := obj.Name() + "." + m.Name()
+ for i := 0; i < rparams.Len(); i++ {
+ rparam := rparams.At(i)
+ name := tparamExportName(prefix, rparam)
+ w.p.tparamNames[rparam.Obj()] = name
+ }
+ }
+ w.param(sig.Recv())
+ w.signature(sig)
+ }
+
+ default:
+ panic(internalErrorf("unexpected object: %v", obj))
+ }
+
+ p.declIndex[obj] = w.flush()
+}
+
+func (w *exportWriter) tag(tag byte) {
+ w.data.WriteByte(tag)
+}
+
+func (w *exportWriter) pos(pos token.Pos) {
+ if w.p.shallow {
+ w.posV2(pos)
+ } else if w.p.version >= iexportVersionPosCol {
+ w.posV1(pos)
+ } else {
+ w.posV0(pos)
+ }
+}
+
+// posV2 encoding (used only in shallow mode) records positions as
+// (file, offset), where file is the index in the token.File table
+// (which records the file name and newline offsets) and offset is a
+// byte offset. It effectively ignores //line directives.
+func (w *exportWriter) posV2(pos token.Pos) {
+ if pos == token.NoPos {
+ w.uint64(0)
+ return
+ }
+ file := w.p.fset.File(pos) // fset must be non-nil
+ index, offset := w.p.fileIndexAndOffset(file, pos)
+ w.uint64(1 + index)
+ w.uint64(offset)
+}
+
+func (w *exportWriter) posV1(pos token.Pos) {
+ if w.p.fset == nil {
+ w.int64(0)
+ return
+ }
+
+ p := w.p.fset.Position(pos)
+ file := p.Filename
+ line := int64(p.Line)
+ column := int64(p.Column)
+
+ deltaColumn := (column - w.prevColumn) << 1
+ deltaLine := (line - w.prevLine) << 1
+
+ if file != w.prevFile {
+ deltaLine |= 1
+ }
+ if deltaLine != 0 {
+ deltaColumn |= 1
+ }
+
+ w.int64(deltaColumn)
+ if deltaColumn&1 != 0 {
+ w.int64(deltaLine)
+ if deltaLine&1 != 0 {
+ w.string(file)
+ }
+ }
+
+ w.prevFile = file
+ w.prevLine = line
+ w.prevColumn = column
+}
+
+func (w *exportWriter) posV0(pos token.Pos) {
+ if w.p.fset == nil {
+ w.int64(0)
+ return
+ }
+
+ p := w.p.fset.Position(pos)
+ file := p.Filename
+ line := int64(p.Line)
+
+ // When file is the same as the last position (common case),
+ // we can save a few bytes by delta encoding just the line
+ // number.
+ //
+ // Note: Because data objects may be read out of order (or not
+ // at all), we can only apply delta encoding within a single
+ // object. This is handled implicitly by tracking prevFile and
+ // prevLine as fields of exportWriter.
+
+ if file == w.prevFile {
+ delta := line - w.prevLine
+ w.int64(delta)
+ if delta == deltaNewFile {
+ w.int64(-1)
+ }
+ } else {
+ w.int64(deltaNewFile)
+ w.int64(line) // line >= 0
+ w.string(file)
+ w.prevFile = file
+ }
+ w.prevLine = line
+}
+
+func (w *exportWriter) pkg(pkg *types.Package) {
+ // Ensure any referenced packages are declared in the main index.
+ w.p.allPkgs[pkg] = true
+
+ w.string(w.exportPath(pkg))
+}
+
+func (w *exportWriter) qualifiedType(obj *types.TypeName) {
+ name := w.p.exportName(obj)
+
+ // Ensure any referenced declarations are written out too.
+ w.p.pushDecl(obj)
+ w.string(name)
+ w.pkg(obj.Pkg())
+}
+
+// TODO(rfindley): what does 'pkg' even mean here? It would be better to pass
+// it in explicitly into signatures and structs that may use it for
+// constructing fields.
+func (w *exportWriter) typ(t types.Type, pkg *types.Package) {
+ w.data.uint64(w.p.typOff(t, pkg))
+}
+
+func (p *iexporter) newWriter() *exportWriter {
+ return &exportWriter{p: p}
+}
+
+func (w *exportWriter) flush() uint64 {
+ off := uint64(w.p.data0.Len())
+ io.Copy(&w.p.data0, &w.data)
+ return off
+}
+
+func (p *iexporter) typOff(t types.Type, pkg *types.Package) uint64 {
+ off, ok := p.typIndex[t]
+ if !ok {
+ w := p.newWriter()
+ w.doTyp(t, pkg)
+ off = predeclReserved + w.flush()
+ p.typIndex[t] = off
+ }
+ return off
+}
+
+func (w *exportWriter) startType(k itag) {
+ w.data.uint64(uint64(k))
+}
+
+func (w *exportWriter) doTyp(t types.Type, pkg *types.Package) {
+ if trace {
+ w.p.trace("exporting type %s (%T)", t, t)
+ w.p.indent++
+ defer func() {
+ w.p.indent--
+ w.p.trace("=> %s", t)
+ }()
+ }
+ switch t := t.(type) {
+ case *types.Alias:
+ if targs := aliases.TypeArgs(t); targs.Len() > 0 {
+ w.startType(instanceType)
+ w.pos(t.Obj().Pos())
+ w.typeList(targs, pkg)
+ w.typ(aliases.Origin(t), pkg)
+ return
+ }
+ w.startType(aliasType)
+ w.qualifiedType(t.Obj())
+
+ case *types.Named:
+ if targs := t.TypeArgs(); targs.Len() > 0 {
+ w.startType(instanceType)
+ // TODO(rfindley): investigate if this position is correct, and if it
+ // matters.
+ w.pos(t.Obj().Pos())
+ w.typeList(targs, pkg)
+ w.typ(t.Origin(), pkg)
+ return
+ }
+ w.startType(definedType)
+ w.qualifiedType(t.Obj())
+
+ case *types.TypeParam:
+ w.startType(typeParamType)
+ w.qualifiedType(t.Obj())
+
+ case *types.Pointer:
+ w.startType(pointerType)
+ w.typ(t.Elem(), pkg)
+
+ case *types.Slice:
+ w.startType(sliceType)
+ w.typ(t.Elem(), pkg)
+
+ case *types.Array:
+ w.startType(arrayType)
+ w.uint64(uint64(t.Len()))
+ w.typ(t.Elem(), pkg)
+
+ case *types.Chan:
+ w.startType(chanType)
+ // 1 RecvOnly; 2 SendOnly; 3 SendRecv
+ var dir uint64
+ switch t.Dir() {
+ case types.RecvOnly:
+ dir = 1
+ case types.SendOnly:
+ dir = 2
+ case types.SendRecv:
+ dir = 3
+ }
+ w.uint64(dir)
+ w.typ(t.Elem(), pkg)
+
+ case *types.Map:
+ w.startType(mapType)
+ w.typ(t.Key(), pkg)
+ w.typ(t.Elem(), pkg)
+
+ case *types.Signature:
+ w.startType(signatureType)
+ w.pkg(pkg)
+ w.signature(t)
+
+ case *types.Struct:
+ w.startType(structType)
+ n := t.NumFields()
+ // Even for struct{} we must emit some qualifying package, because that's
+ // what the compiler does, and thus that's what the importer expects.
+ fieldPkg := pkg
+ if n > 0 {
+ fieldPkg = t.Field(0).Pkg()
+ }
+ if fieldPkg == nil {
+ // TODO(rfindley): improve this very hacky logic.
+ //
+ // The importer expects a package to be set for all struct types, even
+ // those with no fields. A better encoding might be to set NumFields
+ // before pkg. setPkg panics with a nil package, which may be possible
+ // to reach with invalid packages (and perhaps valid packages, too?), so
+ // (arbitrarily) set the localpkg if available.
+ //
+ // Alternatively, we may be able to simply guarantee that pkg != nil, by
+ // reconsidering the encoding of constant values.
+ if w.p.shallow {
+ fieldPkg = w.p.localpkg
+ } else {
+ panic(internalErrorf("no package to set for empty struct"))
+ }
+ }
+ w.pkg(fieldPkg)
+ w.uint64(uint64(n))
+
+ for i := 0; i < n; i++ {
+ f := t.Field(i)
+ if w.p.shallow {
+ w.objectPath(f)
+ }
+ w.pos(f.Pos())
+ w.string(f.Name()) // unexported fields implicitly qualified by prior setPkg
+ w.typ(f.Type(), fieldPkg)
+ w.bool(f.Anonymous())
+ w.string(t.Tag(i)) // note (or tag)
+ }
+
+ case *types.Interface:
+ w.startType(interfaceType)
+ w.pkg(pkg)
+
+ n := t.NumEmbeddeds()
+ w.uint64(uint64(n))
+ for i := 0; i < n; i++ {
+ ft := t.EmbeddedType(i)
+ tPkg := pkg
+ if named, _ := types.Unalias(ft).(*types.Named); named != nil {
+ w.pos(named.Obj().Pos())
+ } else {
+ w.pos(token.NoPos)
+ }
+ w.typ(ft, tPkg)
+ }
+
+ // See comment for struct fields. In shallow mode we change the encoding
+ // for interface methods that are promoted from other packages.
+
+ n = t.NumExplicitMethods()
+ w.uint64(uint64(n))
+ for i := 0; i < n; i++ {
+ m := t.ExplicitMethod(i)
+ if w.p.shallow {
+ w.objectPath(m)
+ }
+ w.pos(m.Pos())
+ w.string(m.Name())
+ sig, _ := m.Type().(*types.Signature)
+ w.signature(sig)
+ }
+
+ case *types.Union:
+ w.startType(unionType)
+ nt := t.Len()
+ w.uint64(uint64(nt))
+ for i := 0; i < nt; i++ {
+ term := t.Term(i)
+ w.bool(term.Tilde())
+ w.typ(term.Type(), pkg)
+ }
+
+ default:
+ panic(internalErrorf("unexpected type: %v, %v", t, reflect.TypeOf(t)))
+ }
+}
+
+// objectPath writes the package and objectPath to use to look up obj in a
+// different package, when encoding in "shallow" mode.
+//
+// When doing a shallow import, the importer creates only the local package,
+// and requests package symbols for dependencies from the client.
+// However, certain types defined in the local package may hold objects defined
+// (perhaps deeply) within another package.
+//
+// For example, consider the following:
+//
+// package a
+// func F() chan * map[string] struct { X int }
+//
+// package b
+// import "a"
+// var B = a.F()
+//
+// In this example, the type of b.B holds fields defined in package a.
+// In order to have the correct canonical objects for the field defined in the
+// type of B, they are encoded as objectPaths and later looked up in the
+// importer. The same problem applies to interface methods.
+func (w *exportWriter) objectPath(obj types.Object) {
+ if obj.Pkg() == nil || obj.Pkg() == w.p.localpkg {
+ // obj.Pkg() may be nil for the builtin error.Error.
+ // In this case, or if obj is declared in the local package, no need to
+ // encode.
+ w.string("")
+ return
+ }
+ objectPath, err := w.p.objectpathEncoder().For(obj)
+ if err != nil {
+ // Fall back to the empty string, which will cause the importer to create a
+ // new object, which matches earlier behavior. Creating a new object is
+ // sufficient for many purposes (such as type checking), but causes certain
+ // references algorithms to fail (golang/go#60819). However, we didn't
+ // notice this problem during months of gopls@v0.12.0 testing.
+ //
+ // TODO(golang/go#61674): this workaround is insufficient, as in the case
+ // where the field forwarded from an instantiated type that may not appear
+ // in the export data of the original package:
+ //
+ // // package a
+ // type A[P any] struct{ F P }
+ //
+ // // package b
+ // type B a.A[int]
+ //
+ // We need to update references algorithms not to depend on this
+ // de-duplication, at which point we may want to simply remove the
+ // workaround here.
+ w.string("")
+ return
+ }
+ w.string(string(objectPath))
+ w.pkg(obj.Pkg())
+}
+
+func (w *exportWriter) signature(sig *types.Signature) {
+ w.paramList(sig.Params())
+ w.paramList(sig.Results())
+ if sig.Params().Len() > 0 {
+ w.bool(sig.Variadic())
+ }
+}
+
+func (w *exportWriter) typeList(ts *types.TypeList, pkg *types.Package) {
+ w.uint64(uint64(ts.Len()))
+ for i := 0; i < ts.Len(); i++ {
+ w.typ(ts.At(i), pkg)
+ }
+}
+
+func (w *exportWriter) tparamList(prefix string, list *types.TypeParamList, pkg *types.Package) {
+ ll := uint64(list.Len())
+ w.uint64(ll)
+ for i := 0; i < list.Len(); i++ {
+ tparam := list.At(i)
+ // Set the type parameter exportName before exporting its type.
+ exportName := tparamExportName(prefix, tparam)
+ w.p.tparamNames[tparam.Obj()] = exportName
+ w.typ(list.At(i), pkg)
+ }
+}
+
+const blankMarker = "$"
+
+// tparamExportName returns the 'exported' name of a type parameter, which
+// differs from its actual object name: it is prefixed with a qualifier, and
+// blank type parameter names are disambiguated by their index in the type
+// parameter list.
+func tparamExportName(prefix string, tparam *types.TypeParam) string {
+ assert(prefix != "")
+ name := tparam.Obj().Name()
+ if name == "_" {
+ name = blankMarker + strconv.Itoa(tparam.Index())
+ }
+ return prefix + "." + name
+}
+
+// tparamName returns the real name of a type parameter, after stripping its
+// qualifying prefix and reverting blank-name encoding. See tparamExportName
+// for details.
+func tparamName(exportName string) string {
+ // Remove the "path" from the type param name that makes it unique.
+ ix := strings.LastIndex(exportName, ".")
+ if ix < 0 {
+ errorf("malformed type parameter export name %s: missing prefix", exportName)
+ }
+ name := exportName[ix+1:]
+ if strings.HasPrefix(name, blankMarker) {
+ return "_"
+ }
+ return name
+}
+
+func (w *exportWriter) paramList(tup *types.Tuple) {
+ n := tup.Len()
+ w.uint64(uint64(n))
+ for i := 0; i < n; i++ {
+ w.param(tup.At(i))
+ }
+}
+
+func (w *exportWriter) param(obj types.Object) {
+ w.pos(obj.Pos())
+ w.localIdent(obj)
+ w.typ(obj.Type(), obj.Pkg())
+}
+
+func (w *exportWriter) value(typ types.Type, v constant.Value) {
+ w.typ(typ, nil)
+ if w.p.version >= iexportVersionGo1_18 {
+ w.int64(int64(v.Kind()))
+ }
+
+ if v.Kind() == constant.Unknown {
+ // golang/go#60605: treat unknown constant values as if they have invalid type
+ //
+ // This loses some fidelity over the package type-checked from source, but that
+ // is acceptable.
+ //
+ // TODO(rfindley): we should switch on the recorded constant kind rather
+ // than the constant type
+ return
+ }
+
+ switch b := typ.Underlying().(*types.Basic); b.Info() & types.IsConstType {
+ case types.IsBoolean:
+ w.bool(constant.BoolVal(v))
+ case types.IsInteger:
+ var i big.Int
+ if i64, exact := constant.Int64Val(v); exact {
+ i.SetInt64(i64)
+ } else if ui64, exact := constant.Uint64Val(v); exact {
+ i.SetUint64(ui64)
+ } else {
+ i.SetString(v.ExactString(), 10)
+ }
+ w.mpint(&i, typ)
+ case types.IsFloat:
+ f := constantToFloat(v)
+ w.mpfloat(f, typ)
+ case types.IsComplex:
+ w.mpfloat(constantToFloat(constant.Real(v)), typ)
+ w.mpfloat(constantToFloat(constant.Imag(v)), typ)
+ case types.IsString:
+ w.string(constant.StringVal(v))
+ default:
+ if b.Kind() == types.Invalid {
+ // package contains type errors
+ break
+ }
+ panic(internalErrorf("unexpected type %v (%v)", typ, typ.Underlying()))
+ }
+}
+
+// constantToFloat converts a constant.Value with kind constant.Float to a
+// big.Float.
+func constantToFloat(x constant.Value) *big.Float {
+ x = constant.ToFloat(x)
+ // Use the same floating-point precision (512) as cmd/compile
+ // (see Mpprec in cmd/compile/internal/gc/mpfloat.go).
+ const mpprec = 512
+ var f big.Float
+ f.SetPrec(mpprec)
+ if v, exact := constant.Float64Val(x); exact {
+ // float64
+ f.SetFloat64(v)
+ } else if num, denom := constant.Num(x), constant.Denom(x); num.Kind() == constant.Int {
+ // TODO(gri): add big.Rat accessor to constant.Value.
+ n := valueToRat(num)
+ d := valueToRat(denom)
+ f.SetRat(n.Quo(n, d))
+ } else {
+ // Value too large to represent as a fraction => inaccessible.
+ // TODO(gri): add big.Float accessor to constant.Value.
+ _, ok := f.SetString(x.ExactString())
+ assert(ok)
+ }
+ return &f
+}
+
+func valueToRat(x constant.Value) *big.Rat {
+ // Convert little-endian to big-endian.
+ // I can't believe this is necessary.
+ bytes := constant.Bytes(x)
+ for i := 0; i < len(bytes)/2; i++ {
+ bytes[i], bytes[len(bytes)-1-i] = bytes[len(bytes)-1-i], bytes[i]
+ }
+ return new(big.Rat).SetInt(new(big.Int).SetBytes(bytes))
+}
+
+// mpint exports a multi-precision integer.
+//
+// For unsigned types, small values are written out as a single
+// byte. Larger values are written out as a length-prefixed big-endian
+// byte string, where the length prefix is encoded as its complement.
+// For example, bytes 0, 1, and 2 directly represent the integer
+// values 0, 1, and 2; while bytes 255, 254, and 253 indicate a 1-,
+// 2-, and 3-byte big-endian string follow.
+//
+// Encoding for signed types use the same general approach as for
+// unsigned types, except small values use zig-zag encoding and the
+// bottom bit of length prefix byte for large values is reserved as a
+// sign bit.
+//
+// The exact boundary between small and large encodings varies
+// according to the maximum number of bytes needed to encode a value
+// of type typ. As a special case, 8-bit types are always encoded as a
+// single byte.
+//
+// TODO(mdempsky): Is this level of complexity really worthwhile?
+func (w *exportWriter) mpint(x *big.Int, typ types.Type) {
+ basic, ok := typ.Underlying().(*types.Basic)
+ if !ok {
+ panic(internalErrorf("unexpected type %v (%T)", typ.Underlying(), typ.Underlying()))
+ }
+
+ signed, maxBytes := intSize(basic)
+
+ negative := x.Sign() < 0
+ if !signed && negative {
+ panic(internalErrorf("negative unsigned integer; type %v, value %v", typ, x))
+ }
+
+ b := x.Bytes()
+ if len(b) > 0 && b[0] == 0 {
+ panic(internalErrorf("leading zeros"))
+ }
+ if uint(len(b)) > maxBytes {
+ panic(internalErrorf("bad mpint length: %d > %d (type %v, value %v)", len(b), maxBytes, typ, x))
+ }
+
+ maxSmall := 256 - maxBytes
+ if signed {
+ maxSmall = 256 - 2*maxBytes
+ }
+ if maxBytes == 1 {
+ maxSmall = 256
+ }
+
+ // Check if x can use small value encoding.
+ if len(b) <= 1 {
+ var ux uint
+ if len(b) == 1 {
+ ux = uint(b[0])
+ }
+ if signed {
+ ux <<= 1
+ if negative {
+ ux--
+ }
+ }
+ if ux < maxSmall {
+ w.data.WriteByte(byte(ux))
+ return
+ }
+ }
+
+ n := 256 - uint(len(b))
+ if signed {
+ n = 256 - 2*uint(len(b))
+ if negative {
+ n |= 1
+ }
+ }
+ if n < maxSmall || n >= 256 {
+ panic(internalErrorf("encoding mistake: %d, %v, %v => %d", len(b), signed, negative, n))
+ }
+
+ w.data.WriteByte(byte(n))
+ w.data.Write(b)
+}
+
+// mpfloat exports a multi-precision floating point number.
+//
+// The number's value is decomposed into mantissa × 2**exponent, where
+// mantissa is an integer. The value is written out as mantissa (as a
+// multi-precision integer) and then the exponent, except exponent is
+// omitted if mantissa is zero.
+func (w *exportWriter) mpfloat(f *big.Float, typ types.Type) {
+ if f.IsInf() {
+ panic("infinite constant")
+ }
+
+ // Break into f = mant × 2**exp, with 0.5 <= mant < 1.
+ var mant big.Float
+ exp := int64(f.MantExp(&mant))
+
+ // Scale so that mant is an integer.
+ prec := mant.MinPrec()
+ mant.SetMantExp(&mant, int(prec))
+ exp -= int64(prec)
+
+ manti, acc := mant.Int(nil)
+ if acc != big.Exact {
+ panic(internalErrorf("mantissa scaling failed for %f (%s)", f, acc))
+ }
+ w.mpint(manti, typ)
+ if manti.Sign() != 0 {
+ w.int64(exp)
+ }
+}
+
+func (w *exportWriter) bool(b bool) bool {
+ var x uint64
+ if b {
+ x = 1
+ }
+ w.uint64(x)
+ return b
+}
+
+func (w *exportWriter) int64(x int64) { w.data.int64(x) }
+func (w *exportWriter) uint64(x uint64) { w.data.uint64(x) }
+func (w *exportWriter) string(s string) { w.uint64(w.p.stringOff(s)) }
+
+func (w *exportWriter) localIdent(obj types.Object) {
+ // Anonymous parameters.
+ if obj == nil {
+ w.string("")
+ return
+ }
+
+ name := obj.Name()
+ if name == "_" {
+ w.string("_")
+ return
+ }
+
+ w.string(name)
+}
+
+type intWriter struct {
+ bytes.Buffer
+}
+
+func (w *intWriter) int64(x int64) {
+ var buf [binary.MaxVarintLen64]byte
+ n := binary.PutVarint(buf[:], x)
+ w.Write(buf[:n])
+}
+
+func (w *intWriter) uint64(x uint64) {
+ var buf [binary.MaxVarintLen64]byte
+ n := binary.PutUvarint(buf[:], x)
+ w.Write(buf[:n])
+}
+
+func assert(cond bool) {
+ if !cond {
+ panic("internal error: assertion failed")
+ }
+}
+
+// The below is copied from go/src/cmd/compile/internal/gc/syntax.go.
+
+// objQueue is a FIFO queue of types.Object. The zero value of objQueue is
+// a ready-to-use empty queue.
+type objQueue struct {
+ ring []types.Object
+ head, tail int
+}
+
+// empty returns true if q contains no Nodes.
+func (q *objQueue) empty() bool {
+ return q.head == q.tail
+}
+
+// pushTail appends n to the tail of the queue.
+func (q *objQueue) pushTail(obj types.Object) {
+ if len(q.ring) == 0 {
+ q.ring = make([]types.Object, 16)
+ } else if q.head+len(q.ring) == q.tail {
+ // Grow the ring.
+ nring := make([]types.Object, len(q.ring)*2)
+ // Copy the old elements.
+ part := q.ring[q.head%len(q.ring):]
+ if q.tail-q.head <= len(part) {
+ part = part[:q.tail-q.head]
+ copy(nring, part)
+ } else {
+ pos := copy(nring, part)
+ copy(nring[pos:], q.ring[:q.tail%len(q.ring)])
+ }
+ q.ring, q.head, q.tail = nring, 0, q.tail-q.head
+ }
+
+ q.ring[q.tail%len(q.ring)] = obj
+ q.tail++
+}
+
+// popHead pops a node from the head of the queue. It panics if q is empty.
+func (q *objQueue) popHead() types.Object {
+ if q.empty() {
+ panic("dequeue empty")
+ }
+ obj := q.ring[q.head%len(q.ring)]
+ q.head++
+ return obj
+}
+
+// internalError represents an error generated inside this package.
+type internalError string
+
+func (e internalError) Error() string { return "gcimporter: " + string(e) }
+
+// TODO(adonovan): make this call panic, so that it's symmetric with errorf.
+// Otherwise it's easy to forget to do anything with the error.
+//
+// TODO(adonovan): also, consider switching the names "errorf" and
+// "internalErrorf" as the former is used for bugs, whose cause is
+// internal inconsistency, whereas the latter is used for ordinary
+// situations like bad input, whose cause is external.
+func internalErrorf(format string, args ...interface{}) error {
+ return internalError(fmt.Sprintf(format, args...))
+}
diff --git a/vendor/golang.org/x/tools/internal/gcimporter/iimport.go b/vendor/golang.org/x/tools/internal/gcimporter/iimport.go
new file mode 100644
index 00000000..e260c0e8
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/gcimporter/iimport.go
@@ -0,0 +1,1113 @@
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Indexed package import.
+// See iexport.go for the export data format.
+
+// This file is a copy of $GOROOT/src/go/internal/gcimporter/iimport.go.
+
+package gcimporter
+
+import (
+ "bytes"
+ "encoding/binary"
+ "fmt"
+ "go/constant"
+ "go/token"
+ "go/types"
+ "io"
+ "math/big"
+ "sort"
+ "strings"
+
+ "golang.org/x/tools/go/types/objectpath"
+ "golang.org/x/tools/internal/aliases"
+ "golang.org/x/tools/internal/typesinternal"
+)
+
+type intReader struct {
+ *bytes.Reader
+ path string
+}
+
+func (r *intReader) int64() int64 {
+ i, err := binary.ReadVarint(r.Reader)
+ if err != nil {
+ errorf("import %q: read varint error: %v", r.path, err)
+ }
+ return i
+}
+
+func (r *intReader) uint64() uint64 {
+ i, err := binary.ReadUvarint(r.Reader)
+ if err != nil {
+ errorf("import %q: read varint error: %v", r.path, err)
+ }
+ return i
+}
+
+// Keep this in sync with constants in iexport.go.
+const (
+ iexportVersionGo1_11 = 0
+ iexportVersionPosCol = 1
+ iexportVersionGo1_18 = 2
+ iexportVersionGenerics = 2
+ iexportVersion = iexportVersionGenerics
+
+ iexportVersionCurrent = 2
+)
+
+type ident struct {
+ pkg *types.Package
+ name string
+}
+
+const predeclReserved = 32
+
+type itag uint64
+
+const (
+ // Types
+ definedType itag = iota
+ pointerType
+ sliceType
+ arrayType
+ chanType
+ mapType
+ signatureType
+ structType
+ interfaceType
+ typeParamType
+ instanceType
+ unionType
+ aliasType
+)
+
+// Object tags
+const (
+ varTag = 'V'
+ funcTag = 'F'
+ genericFuncTag = 'G'
+ constTag = 'C'
+ aliasTag = 'A'
+ genericAliasTag = 'B'
+ typeParamTag = 'P'
+ typeTag = 'T'
+ genericTypeTag = 'U'
+)
+
+// IImportData imports a package from the serialized package data
+// and returns 0 and a reference to the package.
+// If the export data version is not recognized or the format is otherwise
+// compromised, an error is returned.
+func IImportData(fset *token.FileSet, imports map[string]*types.Package, data []byte, path string) (int, *types.Package, error) {
+ pkgs, err := iimportCommon(fset, GetPackagesFromMap(imports), data, false, path, false, nil)
+ if err != nil {
+ return 0, nil, err
+ }
+ return 0, pkgs[0], nil
+}
+
+// IImportBundle imports a set of packages from the serialized package bundle.
+func IImportBundle(fset *token.FileSet, imports map[string]*types.Package, data []byte) ([]*types.Package, error) {
+ return iimportCommon(fset, GetPackagesFromMap(imports), data, true, "", false, nil)
+}
+
+// A GetPackagesFunc function obtains the non-nil symbols for a set of
+// packages, creating and recursively importing them as needed. An
+// implementation should store each package symbol is in the Pkg
+// field of the items array.
+//
+// Any error causes importing to fail. This can be used to quickly read
+// the import manifest of an export data file without fully decoding it.
+type GetPackagesFunc = func(items []GetPackagesItem) error
+
+// A GetPackagesItem is a request from the importer for the package
+// symbol of the specified name and path.
+type GetPackagesItem struct {
+ Name, Path string
+ Pkg *types.Package // to be filled in by GetPackagesFunc call
+
+ // private importer state
+ pathOffset uint64
+ nameIndex map[string]uint64
+}
+
+// GetPackagesFromMap returns a GetPackagesFunc that retrieves
+// packages from the given map of package path to package.
+//
+// The returned function may mutate m: each requested package that is not
+// found is created with types.NewPackage and inserted into m.
+func GetPackagesFromMap(m map[string]*types.Package) GetPackagesFunc {
+ return func(items []GetPackagesItem) error {
+ for i, item := range items {
+ pkg, ok := m[item.Path]
+ if !ok {
+ pkg = types.NewPackage(item.Path, item.Name)
+ m[item.Path] = pkg
+ }
+ items[i].Pkg = pkg
+ }
+ return nil
+ }
+}
+
+func iimportCommon(fset *token.FileSet, getPackages GetPackagesFunc, data []byte, bundle bool, path string, shallow bool, reportf ReportFunc) (pkgs []*types.Package, err error) {
+ const currentVersion = iexportVersionCurrent
+ version := int64(-1)
+ if !debug {
+ defer func() {
+ if e := recover(); e != nil {
+ if bundle {
+ err = fmt.Errorf("%v", e)
+ } else if version > currentVersion {
+ err = fmt.Errorf("cannot import %q (%v), export data is newer version - update tool", path, e)
+ } else {
+ err = fmt.Errorf("internal error while importing %q (%v); please report an issue", path, e)
+ }
+ }
+ }()
+ }
+
+ r := &intReader{bytes.NewReader(data), path}
+
+ if bundle {
+ if v := r.uint64(); v != bundleVersion {
+ errorf("unknown bundle format version %d", v)
+ }
+ }
+
+ version = int64(r.uint64())
+ switch version {
+ case iexportVersionGo1_18, iexportVersionPosCol, iexportVersionGo1_11:
+ default:
+ if version > iexportVersionGo1_18 {
+ errorf("unstable iexport format version %d, just rebuild compiler and std library", version)
+ } else {
+ errorf("unknown iexport format version %d", version)
+ }
+ }
+
+ sLen := int64(r.uint64())
+ var fLen int64
+ var fileOffset []uint64
+ if shallow {
+ // Shallow mode uses a different position encoding.
+ fLen = int64(r.uint64())
+ fileOffset = make([]uint64, r.uint64())
+ for i := range fileOffset {
+ fileOffset[i] = r.uint64()
+ }
+ }
+ dLen := int64(r.uint64())
+
+ whence, _ := r.Seek(0, io.SeekCurrent)
+ stringData := data[whence : whence+sLen]
+ fileData := data[whence+sLen : whence+sLen+fLen]
+ declData := data[whence+sLen+fLen : whence+sLen+fLen+dLen]
+ r.Seek(sLen+fLen+dLen, io.SeekCurrent)
+
+ p := iimporter{
+ version: int(version),
+ ipath: path,
+ aliases: aliases.Enabled(),
+ shallow: shallow,
+ reportf: reportf,
+
+ stringData: stringData,
+ stringCache: make(map[uint64]string),
+ fileOffset: fileOffset,
+ fileData: fileData,
+ fileCache: make([]*token.File, len(fileOffset)),
+ pkgCache: make(map[uint64]*types.Package),
+
+ declData: declData,
+ pkgIndex: make(map[*types.Package]map[string]uint64),
+ typCache: make(map[uint64]types.Type),
+ // Separate map for typeparams, keyed by their package and unique
+ // name.
+ tparamIndex: make(map[ident]types.Type),
+
+ fake: fakeFileSet{
+ fset: fset,
+ files: make(map[string]*fileInfo),
+ },
+ }
+ defer p.fake.setLines() // set lines for files in fset
+
+ for i, pt := range predeclared() {
+ p.typCache[uint64(i)] = pt
+ }
+
+ // Gather the relevant packages from the manifest.
+ items := make([]GetPackagesItem, r.uint64())
+ uniquePkgPaths := make(map[string]bool)
+ for i := range items {
+ pkgPathOff := r.uint64()
+ pkgPath := p.stringAt(pkgPathOff)
+ pkgName := p.stringAt(r.uint64())
+ _ = r.uint64() // package height; unused by go/types
+
+ if pkgPath == "" {
+ pkgPath = path
+ }
+ items[i].Name = pkgName
+ items[i].Path = pkgPath
+ items[i].pathOffset = pkgPathOff
+
+ // Read index for package.
+ nameIndex := make(map[string]uint64)
+ nSyms := r.uint64()
+ // In shallow mode, only the current package (i=0) has an index.
+ assert(!(shallow && i > 0 && nSyms != 0))
+ for ; nSyms > 0; nSyms-- {
+ name := p.stringAt(r.uint64())
+ nameIndex[name] = r.uint64()
+ }
+
+ items[i].nameIndex = nameIndex
+
+ uniquePkgPaths[pkgPath] = true
+ }
+ // Debugging #63822; hypothesis: there are duplicate PkgPaths.
+ if len(uniquePkgPaths) != len(items) {
+ reportf("found duplicate PkgPaths while reading export data manifest: %v", items)
+ }
+
+ // Request packages all at once from the client,
+ // enabling a parallel implementation.
+ if err := getPackages(items); err != nil {
+ return nil, err // don't wrap this error
+ }
+
+ // Check the results and complete the index.
+ pkgList := make([]*types.Package, len(items))
+ for i, item := range items {
+ pkg := item.Pkg
+ if pkg == nil {
+ errorf("internal error: getPackages returned nil package for %q", item.Path)
+ } else if pkg.Path() != item.Path {
+ errorf("internal error: getPackages returned wrong path %q, want %q", pkg.Path(), item.Path)
+ } else if pkg.Name() != item.Name {
+ errorf("internal error: getPackages returned wrong name %s for package %q, want %s", pkg.Name(), item.Path, item.Name)
+ }
+ p.pkgCache[item.pathOffset] = pkg
+ p.pkgIndex[pkg] = item.nameIndex
+ pkgList[i] = pkg
+ }
+
+ if bundle {
+ pkgs = make([]*types.Package, r.uint64())
+ for i := range pkgs {
+ pkg := p.pkgAt(r.uint64())
+ imps := make([]*types.Package, r.uint64())
+ for j := range imps {
+ imps[j] = p.pkgAt(r.uint64())
+ }
+ pkg.SetImports(imps)
+ pkgs[i] = pkg
+ }
+ } else {
+ if len(pkgList) == 0 {
+ errorf("no packages found for %s", path)
+ panic("unreachable")
+ }
+ pkgs = pkgList[:1]
+
+ // record all referenced packages as imports
+ list := append(([]*types.Package)(nil), pkgList[1:]...)
+ sort.Sort(byPath(list))
+ pkgs[0].SetImports(list)
+ }
+
+ for _, pkg := range pkgs {
+ if pkg.Complete() {
+ continue
+ }
+
+ names := make([]string, 0, len(p.pkgIndex[pkg]))
+ for name := range p.pkgIndex[pkg] {
+ names = append(names, name)
+ }
+ sort.Strings(names)
+ for _, name := range names {
+ p.doDecl(pkg, name)
+ }
+
+ // package was imported completely and without errors
+ pkg.MarkComplete()
+ }
+
+ // SetConstraint can't be called if the constraint type is not yet complete.
+ // When type params are created in the typeParamTag case of (*importReader).obj(),
+ // the associated constraint type may not be complete due to recursion.
+ // Therefore, we defer calling SetConstraint there, and call it here instead
+ // after all types are complete.
+ for _, d := range p.later {
+ d.t.SetConstraint(d.constraint)
+ }
+
+ for _, typ := range p.interfaceList {
+ typ.Complete()
+ }
+
+ // Workaround for golang/go#61561. See the doc for instanceList for details.
+ for _, typ := range p.instanceList {
+ if iface, _ := typ.Underlying().(*types.Interface); iface != nil {
+ iface.Complete()
+ }
+ }
+
+ return pkgs, nil
+}
+
+type setConstraintArgs struct {
+ t *types.TypeParam
+ constraint types.Type
+}
+
+type iimporter struct {
+ version int
+ ipath string
+
+ aliases bool
+ shallow bool
+ reportf ReportFunc // if non-nil, used to report bugs
+
+ stringData []byte
+ stringCache map[uint64]string
+ fileOffset []uint64 // fileOffset[i] is offset in fileData for info about file encoded as i
+ fileData []byte
+ fileCache []*token.File // memoized decoding of file encoded as i
+ pkgCache map[uint64]*types.Package
+
+ declData []byte
+ pkgIndex map[*types.Package]map[string]uint64
+ typCache map[uint64]types.Type
+ tparamIndex map[ident]types.Type
+
+ fake fakeFileSet
+ interfaceList []*types.Interface
+
+ // Workaround for the go/types bug golang/go#61561: instances produced during
+ // instantiation may contain incomplete interfaces. Here we only complete the
+ // underlying type of the instance, which is the most common case but doesn't
+ // handle parameterized interface literals defined deeper in the type.
+ instanceList []types.Type // instances for later completion (see golang/go#61561)
+
+ // Arguments for calls to SetConstraint that are deferred due to recursive types
+ later []setConstraintArgs
+
+ indent int // for tracing support
+}
+
+func (p *iimporter) trace(format string, args ...interface{}) {
+ if !trace {
+ // Call sites should also be guarded, but having this check here allows
+ // easily enabling/disabling debug trace statements.
+ return
+ }
+ fmt.Printf(strings.Repeat("..", p.indent)+format+"\n", args...)
+}
+
+func (p *iimporter) doDecl(pkg *types.Package, name string) {
+ if debug {
+ p.trace("import decl %s", name)
+ p.indent++
+ defer func() {
+ p.indent--
+ p.trace("=> %s", name)
+ }()
+ }
+ // See if we've already imported this declaration.
+ if obj := pkg.Scope().Lookup(name); obj != nil {
+ return
+ }
+
+ off, ok := p.pkgIndex[pkg][name]
+ if !ok {
+ // In deep mode, the index should be complete. In shallow
+ // mode, we should have already recursively loaded necessary
+ // dependencies so the above Lookup succeeds.
+ errorf("%v.%v not in index", pkg, name)
+ }
+
+ r := &importReader{p: p, currPkg: pkg}
+ r.declReader.Reset(p.declData[off:])
+
+ r.obj(name)
+}
+
+func (p *iimporter) stringAt(off uint64) string {
+ if s, ok := p.stringCache[off]; ok {
+ return s
+ }
+
+ slen, n := binary.Uvarint(p.stringData[off:])
+ if n <= 0 {
+ errorf("varint failed")
+ }
+ spos := off + uint64(n)
+ s := string(p.stringData[spos : spos+slen])
+ p.stringCache[off] = s
+ return s
+}
+
+func (p *iimporter) fileAt(index uint64) *token.File {
+ file := p.fileCache[index]
+ if file == nil {
+ off := p.fileOffset[index]
+ file = p.decodeFile(intReader{bytes.NewReader(p.fileData[off:]), p.ipath})
+ p.fileCache[index] = file
+ }
+ return file
+}
+
+func (p *iimporter) decodeFile(rd intReader) *token.File {
+ filename := p.stringAt(rd.uint64())
+ size := int(rd.uint64())
+ file := p.fake.fset.AddFile(filename, -1, size)
+
+ // SetLines requires a nondecreasing sequence.
+ // Because it is common for clients to derive the interval
+ // [start, start+len(name)] from a start position, and we
+ // want to ensure that the end offset is on the same line,
+ // we fill in the gaps of the sparse encoding with values
+ // that strictly increase by the largest possible amount.
+ // This allows us to avoid having to record the actual end
+ // offset of each needed line.
+
+ lines := make([]int, int(rd.uint64()))
+ var index, offset int
+ for i, n := 0, int(rd.uint64()); i < n; i++ {
+ index += int(rd.uint64())
+ offset += int(rd.uint64())
+ lines[index] = offset
+
+ // Ensure monotonicity between points.
+ for j := index - 1; j > 0 && lines[j] == 0; j-- {
+ lines[j] = lines[j+1] - 1
+ }
+ }
+
+ // Ensure monotonicity after last point.
+ for j := len(lines) - 1; j > 0 && lines[j] == 0; j-- {
+ size--
+ lines[j] = size
+ }
+
+ if !file.SetLines(lines) {
+ errorf("SetLines failed: %d", lines) // can't happen
+ }
+ return file
+}
+
+func (p *iimporter) pkgAt(off uint64) *types.Package {
+ if pkg, ok := p.pkgCache[off]; ok {
+ return pkg
+ }
+ path := p.stringAt(off)
+ errorf("missing package %q in %q", path, p.ipath)
+ return nil
+}
+
+func (p *iimporter) typAt(off uint64, base *types.Named) types.Type {
+ if t, ok := p.typCache[off]; ok && canReuse(base, t) {
+ return t
+ }
+
+ if off < predeclReserved {
+ errorf("predeclared type missing from cache: %v", off)
+ }
+
+ r := &importReader{p: p}
+ r.declReader.Reset(p.declData[off-predeclReserved:])
+ t := r.doType(base)
+
+ if canReuse(base, t) {
+ p.typCache[off] = t
+ }
+ return t
+}
+
+// canReuse reports whether the type rhs on the RHS of the declaration for def
+// may be re-used.
+//
+// Specifically, if def is non-nil and rhs is an interface type with methods, it
+// may not be re-used because we have a convention of setting the receiver type
+// for interface methods to def.
+func canReuse(def *types.Named, rhs types.Type) bool {
+ if def == nil {
+ return true
+ }
+ iface, _ := types.Unalias(rhs).(*types.Interface)
+ if iface == nil {
+ return true
+ }
+ // Don't use iface.Empty() here as iface may not be complete.
+ return iface.NumEmbeddeds() == 0 && iface.NumExplicitMethods() == 0
+}
+
+type importReader struct {
+ p *iimporter
+ declReader bytes.Reader
+ currPkg *types.Package
+ prevFile string
+ prevLine int64
+ prevColumn int64
+}
+
+// markBlack is redefined in iimport_go123.go, to work around golang/go#69912.
+//
+// If TypeNames are not marked black (in the sense of go/types cycle
+// detection), they may be mutated when dot-imported. Fix this by punching a
+// hole through the type, when compiling with Go 1.23. (The bug has been fixed
+// for 1.24, but the fix was not worth back-porting).
+var markBlack = func(name *types.TypeName) {}
+
+func (r *importReader) obj(name string) {
+ tag := r.byte()
+ pos := r.pos()
+
+ switch tag {
+ case aliasTag, genericAliasTag:
+ var tparams []*types.TypeParam
+ if tag == genericAliasTag {
+ tparams = r.tparamList()
+ }
+ typ := r.typ()
+ obj := aliases.NewAlias(r.p.aliases, pos, r.currPkg, name, typ, tparams)
+ markBlack(obj) // workaround for golang/go#69912
+ r.declare(obj)
+
+ case constTag:
+ typ, val := r.value()
+
+ r.declare(types.NewConst(pos, r.currPkg, name, typ, val))
+
+ case funcTag, genericFuncTag:
+ var tparams []*types.TypeParam
+ if tag == genericFuncTag {
+ tparams = r.tparamList()
+ }
+ sig := r.signature(nil, nil, tparams)
+ r.declare(types.NewFunc(pos, r.currPkg, name, sig))
+
+ case typeTag, genericTypeTag:
+ // Types can be recursive. We need to setup a stub
+ // declaration before recursing.
+ obj := types.NewTypeName(pos, r.currPkg, name, nil)
+ named := types.NewNamed(obj, nil, nil)
+
+ markBlack(obj) // workaround for golang/go#69912
+
+ // Declare obj before calling r.tparamList, so the new type name is recognized
+ // if used in the constraint of one of its own typeparams (see #48280).
+ r.declare(obj)
+ if tag == genericTypeTag {
+ tparams := r.tparamList()
+ named.SetTypeParams(tparams)
+ }
+
+ underlying := r.p.typAt(r.uint64(), named).Underlying()
+ named.SetUnderlying(underlying)
+
+ if !isInterface(underlying) {
+ for n := r.uint64(); n > 0; n-- {
+ mpos := r.pos()
+ mname := r.ident()
+ recv := r.param()
+
+ // If the receiver has any targs, set those as the
+ // rparams of the method (since those are the
+ // typeparams being used in the method sig/body).
+ _, recvNamed := typesinternal.ReceiverNamed(recv)
+ targs := recvNamed.TypeArgs()
+ var rparams []*types.TypeParam
+ if targs.Len() > 0 {
+ rparams = make([]*types.TypeParam, targs.Len())
+ for i := range rparams {
+ rparams[i] = types.Unalias(targs.At(i)).(*types.TypeParam)
+ }
+ }
+ msig := r.signature(recv, rparams, nil)
+
+ named.AddMethod(types.NewFunc(mpos, r.currPkg, mname, msig))
+ }
+ }
+
+ case typeParamTag:
+ // We need to "declare" a typeparam in order to have a name that
+ // can be referenced recursively (if needed) in the type param's
+ // bound.
+ if r.p.version < iexportVersionGenerics {
+ errorf("unexpected type param type")
+ }
+ name0 := tparamName(name)
+ tn := types.NewTypeName(pos, r.currPkg, name0, nil)
+ t := types.NewTypeParam(tn, nil)
+
+ // To handle recursive references to the typeparam within its
+ // bound, save the partial type in tparamIndex before reading the bounds.
+ id := ident{r.currPkg, name}
+ r.p.tparamIndex[id] = t
+ var implicit bool
+ if r.p.version >= iexportVersionGo1_18 {
+ implicit = r.bool()
+ }
+ constraint := r.typ()
+ if implicit {
+ iface, _ := types.Unalias(constraint).(*types.Interface)
+ if iface == nil {
+ errorf("non-interface constraint marked implicit")
+ }
+ iface.MarkImplicit()
+ }
+ // The constraint type may not be complete, if we
+ // are in the middle of a type recursion involving type
+ // constraints. So, we defer SetConstraint until we have
+ // completely set up all types in ImportData.
+ r.p.later = append(r.p.later, setConstraintArgs{t: t, constraint: constraint})
+
+ case varTag:
+ typ := r.typ()
+
+ r.declare(types.NewVar(pos, r.currPkg, name, typ))
+
+ default:
+ errorf("unexpected tag: %v", tag)
+ }
+}
+
+func (r *importReader) declare(obj types.Object) {
+ obj.Pkg().Scope().Insert(obj)
+}
+
+func (r *importReader) value() (typ types.Type, val constant.Value) {
+ typ = r.typ()
+ if r.p.version >= iexportVersionGo1_18 {
+ // TODO: add support for using the kind.
+ _ = constant.Kind(r.int64())
+ }
+
+ switch b := typ.Underlying().(*types.Basic); b.Info() & types.IsConstType {
+ case types.IsBoolean:
+ val = constant.MakeBool(r.bool())
+
+ case types.IsString:
+ val = constant.MakeString(r.string())
+
+ case types.IsInteger:
+ var x big.Int
+ r.mpint(&x, b)
+ val = constant.Make(&x)
+
+ case types.IsFloat:
+ val = r.mpfloat(b)
+
+ case types.IsComplex:
+ re := r.mpfloat(b)
+ im := r.mpfloat(b)
+ val = constant.BinaryOp(re, token.ADD, constant.MakeImag(im))
+
+ default:
+ if b.Kind() == types.Invalid {
+ val = constant.MakeUnknown()
+ return
+ }
+ errorf("unexpected type %v", typ) // panics
+ panic("unreachable")
+ }
+
+ return
+}
+
+func intSize(b *types.Basic) (signed bool, maxBytes uint) {
+ if (b.Info() & types.IsUntyped) != 0 {
+ return true, 64
+ }
+
+ switch b.Kind() {
+ case types.Float32, types.Complex64:
+ return true, 3
+ case types.Float64, types.Complex128:
+ return true, 7
+ }
+
+ signed = (b.Info() & types.IsUnsigned) == 0
+ switch b.Kind() {
+ case types.Int8, types.Uint8:
+ maxBytes = 1
+ case types.Int16, types.Uint16:
+ maxBytes = 2
+ case types.Int32, types.Uint32:
+ maxBytes = 4
+ default:
+ maxBytes = 8
+ }
+
+ return
+}
+
+func (r *importReader) mpint(x *big.Int, typ *types.Basic) {
+ signed, maxBytes := intSize(typ)
+
+ maxSmall := 256 - maxBytes
+ if signed {
+ maxSmall = 256 - 2*maxBytes
+ }
+ if maxBytes == 1 {
+ maxSmall = 256
+ }
+
+ n, _ := r.declReader.ReadByte()
+ if uint(n) < maxSmall {
+ v := int64(n)
+ if signed {
+ v >>= 1
+ if n&1 != 0 {
+ v = ^v
+ }
+ }
+ x.SetInt64(v)
+ return
+ }
+
+ v := -n
+ if signed {
+ v = -(n &^ 1) >> 1
+ }
+ if v < 1 || uint(v) > maxBytes {
+ errorf("weird decoding: %v, %v => %v", n, signed, v)
+ }
+ b := make([]byte, v)
+ io.ReadFull(&r.declReader, b)
+ x.SetBytes(b)
+ if signed && n&1 != 0 {
+ x.Neg(x)
+ }
+}
+
+func (r *importReader) mpfloat(typ *types.Basic) constant.Value {
+ var mant big.Int
+ r.mpint(&mant, typ)
+ var f big.Float
+ f.SetInt(&mant)
+ if f.Sign() != 0 {
+ f.SetMantExp(&f, int(r.int64()))
+ }
+ return constant.Make(&f)
+}
+
+func (r *importReader) ident() string {
+ return r.string()
+}
+
+func (r *importReader) qualifiedIdent() (*types.Package, string) {
+ name := r.string()
+ pkg := r.pkg()
+ return pkg, name
+}
+
+func (r *importReader) pos() token.Pos {
+ if r.p.shallow {
+ // precise offsets are encoded only in shallow mode
+ return r.posv2()
+ }
+ if r.p.version >= iexportVersionPosCol {
+ r.posv1()
+ } else {
+ r.posv0()
+ }
+
+ if r.prevFile == "" && r.prevLine == 0 && r.prevColumn == 0 {
+ return token.NoPos
+ }
+ return r.p.fake.pos(r.prevFile, int(r.prevLine), int(r.prevColumn))
+}
+
+func (r *importReader) posv0() {
+ delta := r.int64()
+ if delta != deltaNewFile {
+ r.prevLine += delta
+ } else if l := r.int64(); l == -1 {
+ r.prevLine += deltaNewFile
+ } else {
+ r.prevFile = r.string()
+ r.prevLine = l
+ }
+}
+
+func (r *importReader) posv1() {
+ delta := r.int64()
+ r.prevColumn += delta >> 1
+ if delta&1 != 0 {
+ delta = r.int64()
+ r.prevLine += delta >> 1
+ if delta&1 != 0 {
+ r.prevFile = r.string()
+ }
+ }
+}
+
+func (r *importReader) posv2() token.Pos {
+ file := r.uint64()
+ if file == 0 {
+ return token.NoPos
+ }
+ tf := r.p.fileAt(file - 1)
+ return tf.Pos(int(r.uint64()))
+}
+
+func (r *importReader) typ() types.Type {
+ return r.p.typAt(r.uint64(), nil)
+}
+
+func isInterface(t types.Type) bool {
+ _, ok := types.Unalias(t).(*types.Interface)
+ return ok
+}
+
+func (r *importReader) pkg() *types.Package { return r.p.pkgAt(r.uint64()) }
+func (r *importReader) string() string { return r.p.stringAt(r.uint64()) }
+
+func (r *importReader) doType(base *types.Named) (res types.Type) {
+ k := r.kind()
+ if debug {
+ r.p.trace("importing type %d (base: %v)", k, base)
+ r.p.indent++
+ defer func() {
+ r.p.indent--
+ r.p.trace("=> %s", res)
+ }()
+ }
+ switch k {
+ default:
+ errorf("unexpected kind tag in %q: %v", r.p.ipath, k)
+ return nil
+
+ case aliasType, definedType:
+ pkg, name := r.qualifiedIdent()
+ r.p.doDecl(pkg, name)
+ return pkg.Scope().Lookup(name).(*types.TypeName).Type()
+ case pointerType:
+ return types.NewPointer(r.typ())
+ case sliceType:
+ return types.NewSlice(r.typ())
+ case arrayType:
+ n := r.uint64()
+ return types.NewArray(r.typ(), int64(n))
+ case chanType:
+ dir := chanDir(int(r.uint64()))
+ return types.NewChan(dir, r.typ())
+ case mapType:
+ return types.NewMap(r.typ(), r.typ())
+ case signatureType:
+ r.currPkg = r.pkg()
+ return r.signature(nil, nil, nil)
+
+ case structType:
+ r.currPkg = r.pkg()
+
+ fields := make([]*types.Var, r.uint64())
+ tags := make([]string, len(fields))
+ for i := range fields {
+ var field *types.Var
+ if r.p.shallow {
+ field, _ = r.objectPathObject().(*types.Var)
+ }
+
+ fpos := r.pos()
+ fname := r.ident()
+ ftyp := r.typ()
+ emb := r.bool()
+ tag := r.string()
+
+ // Either this is not a shallow import, the field is local, or the
+ // encoded objectPath failed to produce an object (a bug).
+ //
+ // Even in this last, buggy case, fall back on creating a new field. As
+ // discussed in iexport.go, this is not correct, but mostly works and is
+ // preferable to failing (for now at least).
+ if field == nil {
+ field = types.NewField(fpos, r.currPkg, fname, ftyp, emb)
+ }
+
+ fields[i] = field
+ tags[i] = tag
+ }
+ return types.NewStruct(fields, tags)
+
+ case interfaceType:
+ r.currPkg = r.pkg()
+
+ embeddeds := make([]types.Type, r.uint64())
+ for i := range embeddeds {
+ _ = r.pos()
+ embeddeds[i] = r.typ()
+ }
+
+ methods := make([]*types.Func, r.uint64())
+ for i := range methods {
+ var method *types.Func
+ if r.p.shallow {
+ method, _ = r.objectPathObject().(*types.Func)
+ }
+
+ mpos := r.pos()
+ mname := r.ident()
+
+ // TODO(mdempsky): Matches bimport.go, but I
+ // don't agree with this.
+ var recv *types.Var
+ if base != nil {
+ recv = types.NewVar(token.NoPos, r.currPkg, "", base)
+ }
+ msig := r.signature(recv, nil, nil)
+
+ if method == nil {
+ method = types.NewFunc(mpos, r.currPkg, mname, msig)
+ }
+ methods[i] = method
+ }
+
+ typ := types.NewInterfaceType(methods, embeddeds)
+ r.p.interfaceList = append(r.p.interfaceList, typ)
+ return typ
+
+ case typeParamType:
+ if r.p.version < iexportVersionGenerics {
+ errorf("unexpected type param type")
+ }
+ pkg, name := r.qualifiedIdent()
+ id := ident{pkg, name}
+ if t, ok := r.p.tparamIndex[id]; ok {
+ // We're already in the process of importing this typeparam.
+ return t
+ }
+ // Otherwise, import the definition of the typeparam now.
+ r.p.doDecl(pkg, name)
+ return r.p.tparamIndex[id]
+
+ case instanceType:
+ if r.p.version < iexportVersionGenerics {
+ errorf("unexpected instantiation type")
+ }
+ // pos does not matter for instances: they are positioned on the original
+ // type.
+ _ = r.pos()
+ len := r.uint64()
+ targs := make([]types.Type, len)
+ for i := range targs {
+ targs[i] = r.typ()
+ }
+ baseType := r.typ()
+ // The imported instantiated type doesn't include any methods, so
+ // we must always use the methods of the base (orig) type.
+ // TODO provide a non-nil *Environment
+ t, _ := types.Instantiate(nil, baseType, targs, false)
+
+ // Workaround for golang/go#61561. See the doc for instanceList for details.
+ r.p.instanceList = append(r.p.instanceList, t)
+ return t
+
+ case unionType:
+ if r.p.version < iexportVersionGenerics {
+ errorf("unexpected instantiation type")
+ }
+ terms := make([]*types.Term, r.uint64())
+ for i := range terms {
+ terms[i] = types.NewTerm(r.bool(), r.typ())
+ }
+ return types.NewUnion(terms)
+ }
+}
+
+func (r *importReader) kind() itag {
+ return itag(r.uint64())
+}
+
+// objectPathObject is the inverse of exportWriter.objectPath.
+//
+// In shallow mode, certain fields and methods may need to be looked up in an
+// imported package. See the doc for exportWriter.objectPath for a full
+// explanation.
+func (r *importReader) objectPathObject() types.Object {
+ objPath := objectpath.Path(r.string())
+ if objPath == "" {
+ return nil
+ }
+ pkg := r.pkg()
+ obj, err := objectpath.Object(pkg, objPath)
+ if err != nil {
+ if r.p.reportf != nil {
+ r.p.reportf("failed to find object for objectPath %q: %v", objPath, err)
+ }
+ }
+ return obj
+}
+
+func (r *importReader) signature(recv *types.Var, rparams []*types.TypeParam, tparams []*types.TypeParam) *types.Signature {
+ params := r.paramList()
+ results := r.paramList()
+ variadic := params.Len() > 0 && r.bool()
+ return types.NewSignatureType(recv, rparams, tparams, params, results, variadic)
+}
+
+func (r *importReader) tparamList() []*types.TypeParam {
+ n := r.uint64()
+ if n == 0 {
+ return nil
+ }
+ xs := make([]*types.TypeParam, n)
+ for i := range xs {
+ // Note: the standard library importer is tolerant of nil types here,
+ // though would panic in SetTypeParams.
+ xs[i] = types.Unalias(r.typ()).(*types.TypeParam)
+ }
+ return xs
+}
+
+func (r *importReader) paramList() *types.Tuple {
+ xs := make([]*types.Var, r.uint64())
+ for i := range xs {
+ xs[i] = r.param()
+ }
+ return types.NewTuple(xs...)
+}
+
+func (r *importReader) param() *types.Var {
+ pos := r.pos()
+ name := r.ident()
+ typ := r.typ()
+ return types.NewParam(pos, r.currPkg, name, typ)
+}
+
+func (r *importReader) bool() bool {
+ return r.uint64() != 0
+}
+
+func (r *importReader) int64() int64 {
+ n, err := binary.ReadVarint(&r.declReader)
+ if err != nil {
+ errorf("readVarint: %v", err)
+ }
+ return n
+}
+
+func (r *importReader) uint64() uint64 {
+ n, err := binary.ReadUvarint(&r.declReader)
+ if err != nil {
+ errorf("readUvarint: %v", err)
+ }
+ return n
+}
+
+func (r *importReader) byte() byte {
+ x, err := r.declReader.ReadByte()
+ if err != nil {
+ errorf("declReader.ReadByte: %v", err)
+ }
+ return x
+}
diff --git a/vendor/golang.org/x/tools/internal/gcimporter/iimport_go122.go b/vendor/golang.org/x/tools/internal/gcimporter/iimport_go122.go
new file mode 100644
index 00000000..7586bfac
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/gcimporter/iimport_go122.go
@@ -0,0 +1,53 @@
+// Copyright 2024 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build go1.22 && !go1.24
+
+package gcimporter
+
+import (
+ "go/token"
+ "go/types"
+ "unsafe"
+)
+
+// TODO(rfindley): delete this workaround once go1.24 is assured.
+
+func init() {
+ // Update markBlack so that it correctly sets the color
+ // of imported TypeNames.
+ //
+ // See the doc comment for markBlack for details.
+
+ type color uint32
+ const (
+ white color = iota
+ black
+ grey
+ )
+ type object struct {
+ _ *types.Scope
+ _ token.Pos
+ _ *types.Package
+ _ string
+ _ types.Type
+ _ uint32
+ color_ color
+ _ token.Pos
+ }
+ type typeName struct {
+ object
+ }
+
+ // If the size of types.TypeName changes, this will fail to compile.
+ const delta = int64(unsafe.Sizeof(typeName{})) - int64(unsafe.Sizeof(types.TypeName{}))
+ var _ [-delta * delta]int
+
+ markBlack = func(obj *types.TypeName) {
+ type uP = unsafe.Pointer
+ var ptr *typeName
+ *(*uP)(uP(&ptr)) = uP(obj)
+ ptr.color_ = black
+ }
+}
diff --git a/vendor/golang.org/x/tools/internal/gcimporter/predeclared.go b/vendor/golang.org/x/tools/internal/gcimporter/predeclared.go
new file mode 100644
index 00000000..907c8557
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/gcimporter/predeclared.go
@@ -0,0 +1,91 @@
+// Copyright 2024 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package gcimporter
+
+import (
+ "go/types"
+ "sync"
+)
+
+// predecl is a cache for the predeclared types in types.Universe.
+//
+// Cache a distinct result based on the runtime value of any.
+// The pointer value of the any type varies based on GODEBUG settings.
+var predeclMu sync.Mutex
+var predecl map[types.Type][]types.Type
+
+func predeclared() []types.Type {
+ anyt := types.Universe.Lookup("any").Type()
+
+ predeclMu.Lock()
+ defer predeclMu.Unlock()
+
+ if pre, ok := predecl[anyt]; ok {
+ return pre
+ }
+
+ if predecl == nil {
+ predecl = make(map[types.Type][]types.Type)
+ }
+
+ decls := []types.Type{ // basic types
+ types.Typ[types.Bool],
+ types.Typ[types.Int],
+ types.Typ[types.Int8],
+ types.Typ[types.Int16],
+ types.Typ[types.Int32],
+ types.Typ[types.Int64],
+ types.Typ[types.Uint],
+ types.Typ[types.Uint8],
+ types.Typ[types.Uint16],
+ types.Typ[types.Uint32],
+ types.Typ[types.Uint64],
+ types.Typ[types.Uintptr],
+ types.Typ[types.Float32],
+ types.Typ[types.Float64],
+ types.Typ[types.Complex64],
+ types.Typ[types.Complex128],
+ types.Typ[types.String],
+
+ // basic type aliases
+ types.Universe.Lookup("byte").Type(),
+ types.Universe.Lookup("rune").Type(),
+
+ // error
+ types.Universe.Lookup("error").Type(),
+
+ // untyped types
+ types.Typ[types.UntypedBool],
+ types.Typ[types.UntypedInt],
+ types.Typ[types.UntypedRune],
+ types.Typ[types.UntypedFloat],
+ types.Typ[types.UntypedComplex],
+ types.Typ[types.UntypedString],
+ types.Typ[types.UntypedNil],
+
+ // package unsafe
+ types.Typ[types.UnsafePointer],
+
+ // invalid type
+ types.Typ[types.Invalid], // only appears in packages with errors
+
+ // used internally by gc; never used by this package or in .a files
+ anyType{},
+
+ // comparable
+ types.Universe.Lookup("comparable").Type(),
+
+ // any
+ anyt,
+ }
+
+ predecl[anyt] = decls
+ return decls
+}
+
+type anyType struct{}
+
+func (t anyType) Underlying() types.Type { return t }
+func (t anyType) String() string { return "any" }
diff --git a/vendor/golang.org/x/tools/internal/gcimporter/ureader_yes.go b/vendor/golang.org/x/tools/internal/gcimporter/ureader_yes.go
new file mode 100644
index 00000000..1db40861
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/gcimporter/ureader_yes.go
@@ -0,0 +1,754 @@
+// Copyright 2021 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Derived from go/internal/gcimporter/ureader.go
+
+package gcimporter
+
+import (
+ "fmt"
+ "go/token"
+ "go/types"
+ "sort"
+ "strings"
+
+ "golang.org/x/tools/internal/aliases"
+ "golang.org/x/tools/internal/pkgbits"
+)
+
+// A pkgReader holds the shared state for reading a unified IR package
+// description.
+type pkgReader struct {
+ pkgbits.PkgDecoder
+
+ fake fakeFileSet
+
+ ctxt *types.Context
+ imports map[string]*types.Package // previously imported packages, indexed by path
+ aliases bool // create types.Alias nodes
+
+ // lazily initialized arrays corresponding to the unified IR
+ // PosBase, Pkg, and Type sections, respectively.
+ posBases []string // position bases (i.e., file names)
+ pkgs []*types.Package
+ typs []types.Type
+
+ // laterFns holds functions that need to be invoked at the end of
+ // import reading.
+ laterFns []func()
+ // laterFors is used in case of 'type A B' to ensure that B is processed before A.
+ laterFors map[types.Type]int
+
+ // ifaces holds a list of constructed Interfaces, which need to have
+ // Complete called after importing is done.
+ ifaces []*types.Interface
+}
+
+// later adds a function to be invoked at the end of import reading.
+func (pr *pkgReader) later(fn func()) {
+ pr.laterFns = append(pr.laterFns, fn)
+}
+
+// See cmd/compile/internal/noder.derivedInfo.
+type derivedInfo struct {
+ idx pkgbits.Index
+}
+
+// See cmd/compile/internal/noder.typeInfo.
+type typeInfo struct {
+ idx pkgbits.Index
+ derived bool
+}
+
+func UImportData(fset *token.FileSet, imports map[string]*types.Package, data []byte, path string) (_ int, pkg *types.Package, err error) {
+ if !debug {
+ defer func() {
+ if x := recover(); x != nil {
+ err = fmt.Errorf("internal error in importing %q (%v); please report an issue", path, x)
+ }
+ }()
+ }
+
+ s := string(data)
+ s = s[:strings.LastIndex(s, "\n$$\n")]
+ input := pkgbits.NewPkgDecoder(path, s)
+ pkg = readUnifiedPackage(fset, nil, imports, input)
+ return
+}
+
+// laterFor adds a function to be invoked at the end of import reading, and records the type that function is finishing.
+func (pr *pkgReader) laterFor(t types.Type, fn func()) {
+ if pr.laterFors == nil {
+ pr.laterFors = make(map[types.Type]int)
+ }
+ pr.laterFors[t] = len(pr.laterFns)
+ pr.laterFns = append(pr.laterFns, fn)
+}
+
+// readUnifiedPackage reads a package description from the given
+// unified IR export data decoder.
+func readUnifiedPackage(fset *token.FileSet, ctxt *types.Context, imports map[string]*types.Package, input pkgbits.PkgDecoder) *types.Package {
+ pr := pkgReader{
+ PkgDecoder: input,
+
+ fake: fakeFileSet{
+ fset: fset,
+ files: make(map[string]*fileInfo),
+ },
+
+ ctxt: ctxt,
+ imports: imports,
+ aliases: aliases.Enabled(),
+
+ posBases: make([]string, input.NumElems(pkgbits.RelocPosBase)),
+ pkgs: make([]*types.Package, input.NumElems(pkgbits.RelocPkg)),
+ typs: make([]types.Type, input.NumElems(pkgbits.RelocType)),
+ }
+ defer pr.fake.setLines()
+
+ r := pr.newReader(pkgbits.RelocMeta, pkgbits.PublicRootIdx, pkgbits.SyncPublic)
+ pkg := r.pkg()
+ if r.Version().Has(pkgbits.HasInit) {
+ r.Bool()
+ }
+
+ for i, n := 0, r.Len(); i < n; i++ {
+ // As if r.obj(), but avoiding the Scope.Lookup call,
+ // to avoid eager loading of imports.
+ r.Sync(pkgbits.SyncObject)
+ if r.Version().Has(pkgbits.DerivedFuncInstance) {
+ assert(!r.Bool())
+ }
+ r.p.objIdx(r.Reloc(pkgbits.RelocObj))
+ assert(r.Len() == 0)
+ }
+
+ r.Sync(pkgbits.SyncEOF)
+
+ for _, fn := range pr.laterFns {
+ fn()
+ }
+
+ for _, iface := range pr.ifaces {
+ iface.Complete()
+ }
+
+ // Imports() of pkg are all of the transitive packages that were loaded.
+ var imps []*types.Package
+ for _, imp := range pr.pkgs {
+ if imp != nil && imp != pkg {
+ imps = append(imps, imp)
+ }
+ }
+ sort.Sort(byPath(imps))
+ pkg.SetImports(imps)
+
+ pkg.MarkComplete()
+ return pkg
+}
+
+// A reader holds the state for reading a single unified IR element
+// within a package.
+type reader struct {
+ pkgbits.Decoder
+
+ p *pkgReader
+
+ dict *readerDict
+}
+
+// A readerDict holds the state for type parameters that parameterize
+// the current unified IR element.
+type readerDict struct {
+ // bounds is a slice of typeInfos corresponding to the underlying
+ // bounds of the element's type parameters.
+ bounds []typeInfo
+
+ // tparams is a slice of the constructed TypeParams for the element.
+ tparams []*types.TypeParam
+
+ // derived is a slice of types derived from tparams, which may be
+ // instantiated while reading the current element.
+ derived []derivedInfo
+ derivedTypes []types.Type // lazily instantiated from derived
+}
+
+func (pr *pkgReader) newReader(k pkgbits.RelocKind, idx pkgbits.Index, marker pkgbits.SyncMarker) *reader {
+ return &reader{
+ Decoder: pr.NewDecoder(k, idx, marker),
+ p: pr,
+ }
+}
+
+func (pr *pkgReader) tempReader(k pkgbits.RelocKind, idx pkgbits.Index, marker pkgbits.SyncMarker) *reader {
+ return &reader{
+ Decoder: pr.TempDecoder(k, idx, marker),
+ p: pr,
+ }
+}
+
+func (pr *pkgReader) retireReader(r *reader) {
+ pr.RetireDecoder(&r.Decoder)
+}
+
+// @@@ Positions
+
+func (r *reader) pos() token.Pos {
+ r.Sync(pkgbits.SyncPos)
+ if !r.Bool() {
+ return token.NoPos
+ }
+
+ // TODO(mdempsky): Delta encoding.
+ posBase := r.posBase()
+ line := r.Uint()
+ col := r.Uint()
+ return r.p.fake.pos(posBase, int(line), int(col))
+}
+
+func (r *reader) posBase() string {
+ return r.p.posBaseIdx(r.Reloc(pkgbits.RelocPosBase))
+}
+
+func (pr *pkgReader) posBaseIdx(idx pkgbits.Index) string {
+ if b := pr.posBases[idx]; b != "" {
+ return b
+ }
+
+ var filename string
+ {
+ r := pr.tempReader(pkgbits.RelocPosBase, idx, pkgbits.SyncPosBase)
+
+ // Within types2, position bases have a lot more details (e.g.,
+ // keeping track of where //line directives appeared exactly).
+ //
+ // For go/types, we just track the file name.
+
+ filename = r.String()
+
+ if r.Bool() { // file base
+ // Was: "b = token.NewTrimmedFileBase(filename, true)"
+ } else { // line base
+ pos := r.pos()
+ line := r.Uint()
+ col := r.Uint()
+
+ // Was: "b = token.NewLineBase(pos, filename, true, line, col)"
+ _, _, _ = pos, line, col
+ }
+ pr.retireReader(r)
+ }
+ b := filename
+ pr.posBases[idx] = b
+ return b
+}
+
+// @@@ Packages
+
+func (r *reader) pkg() *types.Package {
+ r.Sync(pkgbits.SyncPkg)
+ return r.p.pkgIdx(r.Reloc(pkgbits.RelocPkg))
+}
+
+func (pr *pkgReader) pkgIdx(idx pkgbits.Index) *types.Package {
+ // TODO(mdempsky): Consider using some non-nil pointer to indicate
+ // the universe scope, so we don't need to keep re-reading it.
+ if pkg := pr.pkgs[idx]; pkg != nil {
+ return pkg
+ }
+
+ pkg := pr.newReader(pkgbits.RelocPkg, idx, pkgbits.SyncPkgDef).doPkg()
+ pr.pkgs[idx] = pkg
+ return pkg
+}
+
+func (r *reader) doPkg() *types.Package {
+ path := r.String()
+ switch path {
+ case "":
+ path = r.p.PkgPath()
+ case "builtin":
+ return nil // universe
+ case "unsafe":
+ return types.Unsafe
+ }
+
+ if pkg := r.p.imports[path]; pkg != nil {
+ return pkg
+ }
+
+ name := r.String()
+
+ pkg := types.NewPackage(path, name)
+ r.p.imports[path] = pkg
+
+ return pkg
+}
+
+// @@@ Types
+
+func (r *reader) typ() types.Type {
+ return r.p.typIdx(r.typInfo(), r.dict)
+}
+
+func (r *reader) typInfo() typeInfo {
+ r.Sync(pkgbits.SyncType)
+ if r.Bool() {
+ return typeInfo{idx: pkgbits.Index(r.Len()), derived: true}
+ }
+ return typeInfo{idx: r.Reloc(pkgbits.RelocType), derived: false}
+}
+
+func (pr *pkgReader) typIdx(info typeInfo, dict *readerDict) types.Type {
+ idx := info.idx
+ var where *types.Type
+ if info.derived {
+ where = &dict.derivedTypes[idx]
+ idx = dict.derived[idx].idx
+ } else {
+ where = &pr.typs[idx]
+ }
+
+ if typ := *where; typ != nil {
+ return typ
+ }
+
+ var typ types.Type
+ {
+ r := pr.tempReader(pkgbits.RelocType, idx, pkgbits.SyncTypeIdx)
+ r.dict = dict
+
+ typ = r.doTyp()
+ assert(typ != nil)
+ pr.retireReader(r)
+ }
+ // See comment in pkgReader.typIdx explaining how this happens.
+ if prev := *where; prev != nil {
+ return prev
+ }
+
+ *where = typ
+ return typ
+}
+
+func (r *reader) doTyp() (res types.Type) {
+ switch tag := pkgbits.CodeType(r.Code(pkgbits.SyncType)); tag {
+ default:
+ errorf("unhandled type tag: %v", tag)
+ panic("unreachable")
+
+ case pkgbits.TypeBasic:
+ return types.Typ[r.Len()]
+
+ case pkgbits.TypeNamed:
+ obj, targs := r.obj()
+ name := obj.(*types.TypeName)
+ if len(targs) != 0 {
+ t, _ := types.Instantiate(r.p.ctxt, name.Type(), targs, false)
+ return t
+ }
+ return name.Type()
+
+ case pkgbits.TypeTypeParam:
+ return r.dict.tparams[r.Len()]
+
+ case pkgbits.TypeArray:
+ len := int64(r.Uint64())
+ return types.NewArray(r.typ(), len)
+ case pkgbits.TypeChan:
+ dir := types.ChanDir(r.Len())
+ return types.NewChan(dir, r.typ())
+ case pkgbits.TypeMap:
+ return types.NewMap(r.typ(), r.typ())
+ case pkgbits.TypePointer:
+ return types.NewPointer(r.typ())
+ case pkgbits.TypeSignature:
+ return r.signature(nil, nil, nil)
+ case pkgbits.TypeSlice:
+ return types.NewSlice(r.typ())
+ case pkgbits.TypeStruct:
+ return r.structType()
+ case pkgbits.TypeInterface:
+ return r.interfaceType()
+ case pkgbits.TypeUnion:
+ return r.unionType()
+ }
+}
+
+func (r *reader) structType() *types.Struct {
+ fields := make([]*types.Var, r.Len())
+ var tags []string
+ for i := range fields {
+ pos := r.pos()
+ pkg, name := r.selector()
+ ftyp := r.typ()
+ tag := r.String()
+ embedded := r.Bool()
+
+ fields[i] = types.NewField(pos, pkg, name, ftyp, embedded)
+ if tag != "" {
+ for len(tags) < i {
+ tags = append(tags, "")
+ }
+ tags = append(tags, tag)
+ }
+ }
+ return types.NewStruct(fields, tags)
+}
+
+func (r *reader) unionType() *types.Union {
+ terms := make([]*types.Term, r.Len())
+ for i := range terms {
+ terms[i] = types.NewTerm(r.Bool(), r.typ())
+ }
+ return types.NewUnion(terms)
+}
+
+func (r *reader) interfaceType() *types.Interface {
+ methods := make([]*types.Func, r.Len())
+ embeddeds := make([]types.Type, r.Len())
+ implicit := len(methods) == 0 && len(embeddeds) == 1 && r.Bool()
+
+ for i := range methods {
+ pos := r.pos()
+ pkg, name := r.selector()
+ mtyp := r.signature(nil, nil, nil)
+ methods[i] = types.NewFunc(pos, pkg, name, mtyp)
+ }
+
+ for i := range embeddeds {
+ embeddeds[i] = r.typ()
+ }
+
+ iface := types.NewInterfaceType(methods, embeddeds)
+ if implicit {
+ iface.MarkImplicit()
+ }
+
+ // We need to call iface.Complete(), but if there are any embedded
+ // defined types, then we may not have set their underlying
+ // interface type yet. So we need to defer calling Complete until
+ // after we've called SetUnderlying everywhere.
+ //
+ // TODO(mdempsky): After CL 424876 lands, it should be safe to call
+ // iface.Complete() immediately.
+ r.p.ifaces = append(r.p.ifaces, iface)
+
+ return iface
+}
+
+func (r *reader) signature(recv *types.Var, rtparams, tparams []*types.TypeParam) *types.Signature {
+ r.Sync(pkgbits.SyncSignature)
+
+ params := r.params()
+ results := r.params()
+ variadic := r.Bool()
+
+ return types.NewSignatureType(recv, rtparams, tparams, params, results, variadic)
+}
+
+func (r *reader) params() *types.Tuple {
+ r.Sync(pkgbits.SyncParams)
+
+ params := make([]*types.Var, r.Len())
+ for i := range params {
+ params[i] = r.param()
+ }
+
+ return types.NewTuple(params...)
+}
+
+func (r *reader) param() *types.Var {
+ r.Sync(pkgbits.SyncParam)
+
+ pos := r.pos()
+ pkg, name := r.localIdent()
+ typ := r.typ()
+
+ return types.NewParam(pos, pkg, name, typ)
+}
+
+// @@@ Objects
+
+func (r *reader) obj() (types.Object, []types.Type) {
+ r.Sync(pkgbits.SyncObject)
+
+ if r.Version().Has(pkgbits.DerivedFuncInstance) {
+ assert(!r.Bool())
+ }
+
+ pkg, name := r.p.objIdx(r.Reloc(pkgbits.RelocObj))
+ obj := pkgScope(pkg).Lookup(name)
+
+ targs := make([]types.Type, r.Len())
+ for i := range targs {
+ targs[i] = r.typ()
+ }
+
+ return obj, targs
+}
+
+func (pr *pkgReader) objIdx(idx pkgbits.Index) (*types.Package, string) {
+
+ var objPkg *types.Package
+ var objName string
+ var tag pkgbits.CodeObj
+ {
+ rname := pr.tempReader(pkgbits.RelocName, idx, pkgbits.SyncObject1)
+
+ objPkg, objName = rname.qualifiedIdent()
+ assert(objName != "")
+
+ tag = pkgbits.CodeObj(rname.Code(pkgbits.SyncCodeObj))
+ pr.retireReader(rname)
+ }
+
+ if tag == pkgbits.ObjStub {
+ assert(objPkg == nil || objPkg == types.Unsafe)
+ return objPkg, objName
+ }
+
+ // Ignore local types promoted to global scope (#55110).
+ if _, suffix := splitVargenSuffix(objName); suffix != "" {
+ return objPkg, objName
+ }
+
+ if objPkg.Scope().Lookup(objName) == nil {
+ dict := pr.objDictIdx(idx)
+
+ r := pr.newReader(pkgbits.RelocObj, idx, pkgbits.SyncObject1)
+ r.dict = dict
+
+ declare := func(obj types.Object) {
+ objPkg.Scope().Insert(obj)
+ }
+
+ switch tag {
+ default:
+ panic("weird")
+
+ case pkgbits.ObjAlias:
+ pos := r.pos()
+ var tparams []*types.TypeParam
+ if r.Version().Has(pkgbits.AliasTypeParamNames) {
+ tparams = r.typeParamNames()
+ }
+ typ := r.typ()
+ declare(aliases.NewAlias(r.p.aliases, pos, objPkg, objName, typ, tparams))
+
+ case pkgbits.ObjConst:
+ pos := r.pos()
+ typ := r.typ()
+ val := r.Value()
+ declare(types.NewConst(pos, objPkg, objName, typ, val))
+
+ case pkgbits.ObjFunc:
+ pos := r.pos()
+ tparams := r.typeParamNames()
+ sig := r.signature(nil, nil, tparams)
+ declare(types.NewFunc(pos, objPkg, objName, sig))
+
+ case pkgbits.ObjType:
+ pos := r.pos()
+
+ obj := types.NewTypeName(pos, objPkg, objName, nil)
+ named := types.NewNamed(obj, nil, nil)
+ declare(obj)
+
+ named.SetTypeParams(r.typeParamNames())
+
+ setUnderlying := func(underlying types.Type) {
+ // If the underlying type is an interface, we need to
+ // duplicate its methods so we can replace the receiver
+ // parameter's type (#49906).
+ if iface, ok := types.Unalias(underlying).(*types.Interface); ok && iface.NumExplicitMethods() != 0 {
+ methods := make([]*types.Func, iface.NumExplicitMethods())
+ for i := range methods {
+ fn := iface.ExplicitMethod(i)
+ sig := fn.Type().(*types.Signature)
+
+ recv := types.NewVar(fn.Pos(), fn.Pkg(), "", named)
+ methods[i] = types.NewFunc(fn.Pos(), fn.Pkg(), fn.Name(), types.NewSignature(recv, sig.Params(), sig.Results(), sig.Variadic()))
+ }
+
+ embeds := make([]types.Type, iface.NumEmbeddeds())
+ for i := range embeds {
+ embeds[i] = iface.EmbeddedType(i)
+ }
+
+ newIface := types.NewInterfaceType(methods, embeds)
+ r.p.ifaces = append(r.p.ifaces, newIface)
+ underlying = newIface
+ }
+
+ named.SetUnderlying(underlying)
+ }
+
+ // Since go.dev/cl/455279, we can assume rhs.Underlying() will
+ // always be non-nil. However, to temporarily support users of
+ // older snapshot releases, we continue to fallback to the old
+ // behavior for now.
+ //
+ // TODO(mdempsky): Remove fallback code and simplify after
+ // allowing time for snapshot users to upgrade.
+ rhs := r.typ()
+ if underlying := rhs.Underlying(); underlying != nil {
+ setUnderlying(underlying)
+ } else {
+ pk := r.p
+ pk.laterFor(named, func() {
+ // First be sure that the rhs is initialized, if it needs to be initialized.
+ delete(pk.laterFors, named) // prevent cycles
+ if i, ok := pk.laterFors[rhs]; ok {
+ f := pk.laterFns[i]
+ pk.laterFns[i] = func() {} // function is running now, so replace it with a no-op
+ f() // initialize RHS
+ }
+ setUnderlying(rhs.Underlying())
+ })
+ }
+
+ for i, n := 0, r.Len(); i < n; i++ {
+ named.AddMethod(r.method())
+ }
+
+ case pkgbits.ObjVar:
+ pos := r.pos()
+ typ := r.typ()
+ declare(types.NewVar(pos, objPkg, objName, typ))
+ }
+ }
+
+ return objPkg, objName
+}
+
+func (pr *pkgReader) objDictIdx(idx pkgbits.Index) *readerDict {
+
+ var dict readerDict
+
+ {
+ r := pr.tempReader(pkgbits.RelocObjDict, idx, pkgbits.SyncObject1)
+ if implicits := r.Len(); implicits != 0 {
+ errorf("unexpected object with %v implicit type parameter(s)", implicits)
+ }
+
+ dict.bounds = make([]typeInfo, r.Len())
+ for i := range dict.bounds {
+ dict.bounds[i] = r.typInfo()
+ }
+
+ dict.derived = make([]derivedInfo, r.Len())
+ dict.derivedTypes = make([]types.Type, len(dict.derived))
+ for i := range dict.derived {
+ dict.derived[i] = derivedInfo{idx: r.Reloc(pkgbits.RelocType)}
+ if r.Version().Has(pkgbits.DerivedInfoNeeded) {
+ assert(!r.Bool())
+ }
+ }
+
+ pr.retireReader(r)
+ }
+ // function references follow, but reader doesn't need those
+
+ return &dict
+}
+
+func (r *reader) typeParamNames() []*types.TypeParam {
+ r.Sync(pkgbits.SyncTypeParamNames)
+
+ // Note: This code assumes it only processes objects without
+ // implement type parameters. This is currently fine, because
+ // reader is only used to read in exported declarations, which are
+ // always package scoped.
+
+ if len(r.dict.bounds) == 0 {
+ return nil
+ }
+
+ // Careful: Type parameter lists may have cycles. To allow for this,
+ // we construct the type parameter list in two passes: first we
+ // create all the TypeNames and TypeParams, then we construct and
+ // set the bound type.
+
+ r.dict.tparams = make([]*types.TypeParam, len(r.dict.bounds))
+ for i := range r.dict.bounds {
+ pos := r.pos()
+ pkg, name := r.localIdent()
+
+ tname := types.NewTypeName(pos, pkg, name, nil)
+ r.dict.tparams[i] = types.NewTypeParam(tname, nil)
+ }
+
+ typs := make([]types.Type, len(r.dict.bounds))
+ for i, bound := range r.dict.bounds {
+ typs[i] = r.p.typIdx(bound, r.dict)
+ }
+
+ // TODO(mdempsky): This is subtle, elaborate further.
+ //
+ // We have to save tparams outside of the closure, because
+ // typeParamNames() can be called multiple times with the same
+ // dictionary instance.
+ //
+ // Also, this needs to happen later to make sure SetUnderlying has
+ // been called.
+ //
+ // TODO(mdempsky): Is it safe to have a single "later" slice or do
+ // we need to have multiple passes? See comments on CL 386002 and
+ // go.dev/issue/52104.
+ tparams := r.dict.tparams
+ r.p.later(func() {
+ for i, typ := range typs {
+ tparams[i].SetConstraint(typ)
+ }
+ })
+
+ return r.dict.tparams
+}
+
+func (r *reader) method() *types.Func {
+ r.Sync(pkgbits.SyncMethod)
+ pos := r.pos()
+ pkg, name := r.selector()
+
+ rparams := r.typeParamNames()
+ sig := r.signature(r.param(), rparams, nil)
+
+ _ = r.pos() // TODO(mdempsky): Remove; this is a hacker for linker.go.
+ return types.NewFunc(pos, pkg, name, sig)
+}
+
+func (r *reader) qualifiedIdent() (*types.Package, string) { return r.ident(pkgbits.SyncSym) }
+func (r *reader) localIdent() (*types.Package, string) { return r.ident(pkgbits.SyncLocalIdent) }
+func (r *reader) selector() (*types.Package, string) { return r.ident(pkgbits.SyncSelector) }
+
+func (r *reader) ident(marker pkgbits.SyncMarker) (*types.Package, string) {
+ r.Sync(marker)
+ return r.pkg(), r.String()
+}
+
+// pkgScope returns pkg.Scope().
+// If pkg is nil, it returns types.Universe instead.
+//
+// TODO(mdempsky): Remove after x/tools can depend on Go 1.19.
+func pkgScope(pkg *types.Package) *types.Scope {
+ if pkg != nil {
+ return pkg.Scope()
+ }
+ return types.Universe
+}
+
+// See cmd/compile/internal/types.SplitVargenSuffix.
+func splitVargenSuffix(name string) (base, suffix string) {
+ i := len(name)
+ for i > 0 && name[i-1] >= '0' && name[i-1] <= '9' {
+ i--
+ }
+ const dot = "·"
+ if i >= len(dot) && name[i-len(dot):i] == dot {
+ i -= len(dot)
+ return name[:i], name[i:]
+ }
+ return name, ""
+}
diff --git a/vendor/golang.org/x/tools/internal/gocommand/invoke.go b/vendor/golang.org/x/tools/internal/gocommand/invoke.go
index af0ee6c6..e333efc8 100644
--- a/vendor/golang.org/x/tools/internal/gocommand/invoke.go
+++ b/vendor/golang.org/x/tools/internal/gocommand/invoke.go
@@ -16,7 +16,6 @@ import (
"os"
"os/exec"
"path/filepath"
- "reflect"
"regexp"
"runtime"
"strconv"
@@ -200,12 +199,14 @@ func (i *Invocation) runWithFriendlyError(ctx context.Context, stdout, stderr io
return
}
-func (i *Invocation) run(ctx context.Context, stdout, stderr io.Writer) error {
- log := i.Logf
- if log == nil {
- log = func(string, ...interface{}) {}
+// logf logs if i.Logf is non-nil.
+func (i *Invocation) logf(format string, args ...any) {
+ if i.Logf != nil {
+ i.Logf(format, args...)
}
+}
+func (i *Invocation) run(ctx context.Context, stdout, stderr io.Writer) error {
goArgs := []string{i.Verb}
appendModFile := func() {
@@ -248,16 +249,13 @@ func (i *Invocation) run(ctx context.Context, stdout, stderr io.Writer) error {
cmd.Stdout = stdout
cmd.Stderr = stderr
- // cmd.WaitDelay was added only in go1.20 (see #50436).
- if waitDelay := reflect.ValueOf(cmd).Elem().FieldByName("WaitDelay"); waitDelay.IsValid() {
- // https://go.dev/issue/59541: don't wait forever copying stderr
- // after the command has exited.
- // After CL 484741 we copy stdout manually, so we we'll stop reading that as
- // soon as ctx is done. However, we also don't want to wait around forever
- // for stderr. Give a much-longer-than-reasonable delay and then assume that
- // something has wedged in the kernel or runtime.
- waitDelay.Set(reflect.ValueOf(30 * time.Second))
- }
+ // https://go.dev/issue/59541: don't wait forever copying stderr
+ // after the command has exited.
+ // After CL 484741 we copy stdout manually, so we we'll stop reading that as
+ // soon as ctx is done. However, we also don't want to wait around forever
+ // for stderr. Give a much-longer-than-reasonable delay and then assume that
+ // something has wedged in the kernel or runtime.
+ cmd.WaitDelay = 30 * time.Second
// The cwd gets resolved to the real path. On Darwin, where
// /tmp is a symlink, this breaks anything that expects the
@@ -277,7 +275,12 @@ func (i *Invocation) run(ctx context.Context, stdout, stderr io.Writer) error {
cmd.Dir = i.WorkingDir
}
- defer func(start time.Time) { log("%s for %v", time.Since(start), cmdDebugStr(cmd)) }(time.Now())
+ debugStr := cmdDebugStr(cmd)
+ i.logf("starting %v", debugStr)
+ start := time.Now()
+ defer func() {
+ i.logf("%s for %v", time.Since(start), debugStr)
+ }()
return runCmdContext(ctx, cmd)
}
@@ -514,7 +517,7 @@ func WriteOverlays(overlay map[string][]byte) (filename string, cleanup func(),
for k, v := range overlay {
// Use a unique basename for each file (001-foo.go),
// to avoid creating nested directories.
- base := fmt.Sprintf("%d-%s.go", 1+len(overlays), filepath.Base(k))
+ base := fmt.Sprintf("%d-%s", 1+len(overlays), filepath.Base(k))
filename := filepath.Join(dir, base)
err := os.WriteFile(filename, v, 0666)
if err != nil {
diff --git a/vendor/golang.org/x/tools/internal/imports/fix.go b/vendor/golang.org/x/tools/internal/imports/fix.go
index 4569313a..5ae57697 100644
--- a/vendor/golang.org/x/tools/internal/imports/fix.go
+++ b/vendor/golang.org/x/tools/internal/imports/fix.go
@@ -90,18 +90,6 @@ type ImportFix struct {
Relevance float64 // see pkg
}
-// An ImportInfo represents a single import statement.
-type ImportInfo struct {
- ImportPath string // import path, e.g. "crypto/rand".
- Name string // import name, e.g. "crand", or "" if none.
-}
-
-// A packageInfo represents what's known about a package.
-type packageInfo struct {
- name string // real package name, if known.
- exports map[string]bool // known exports.
-}
-
// parseOtherFiles parses all the Go files in srcDir except filename, including
// test files if filename looks like a test.
//
@@ -130,7 +118,7 @@ func parseOtherFiles(ctx context.Context, fset *token.FileSet, srcDir, filename
continue
}
- f, err := parser.ParseFile(fset, filepath.Join(srcDir, fi.Name()), nil, 0)
+ f, err := parser.ParseFile(fset, filepath.Join(srcDir, fi.Name()), nil, parser.SkipObjectResolution)
if err != nil {
continue
}
@@ -161,8 +149,8 @@ func addGlobals(f *ast.File, globals map[string]bool) {
// collectReferences builds a map of selector expressions, from
// left hand side (X) to a set of right hand sides (Sel).
-func collectReferences(f *ast.File) references {
- refs := references{}
+func collectReferences(f *ast.File) References {
+ refs := References{}
var visitor visitFn
visitor = func(node ast.Node) ast.Visitor {
@@ -232,7 +220,7 @@ func (p *pass) findMissingImport(pkg string, syms map[string]bool) *ImportInfo {
allFound := true
for right := range syms {
- if !pkgInfo.exports[right] {
+ if !pkgInfo.Exports[right] {
allFound = false
break
}
@@ -245,11 +233,6 @@ func (p *pass) findMissingImport(pkg string, syms map[string]bool) *ImportInfo {
return nil
}
-// references is set of references found in a Go file. The first map key is the
-// left hand side of a selector expression, the second key is the right hand
-// side, and the value should always be true.
-type references map[string]map[string]bool
-
// A pass contains all the inputs and state necessary to fix a file's imports.
// It can be modified in some ways during use; see comments below.
type pass struct {
@@ -257,27 +240,29 @@ type pass struct {
fset *token.FileSet // fset used to parse f and its siblings.
f *ast.File // the file being fixed.
srcDir string // the directory containing f.
- env *ProcessEnv // the environment to use for go commands, etc.
- loadRealPackageNames bool // if true, load package names from disk rather than guessing them.
- otherFiles []*ast.File // sibling files.
+ logf func(string, ...any)
+ source Source // the environment to use for go commands, etc.
+ loadRealPackageNames bool // if true, load package names from disk rather than guessing them.
+ otherFiles []*ast.File // sibling files.
+ goroot string
// Intermediate state, generated by load.
existingImports map[string][]*ImportInfo
- allRefs references
- missingRefs references
+ allRefs References
+ missingRefs References
// Inputs to fix. These can be augmented between successive fix calls.
lastTry bool // indicates that this is the last call and fix should clean up as best it can.
candidates []*ImportInfo // candidate imports in priority order.
- knownPackages map[string]*packageInfo // information about all known packages.
+ knownPackages map[string]*PackageInfo // information about all known packages.
}
// loadPackageNames saves the package names for everything referenced by imports.
-func (p *pass) loadPackageNames(imports []*ImportInfo) error {
- if p.env.Logf != nil {
- p.env.Logf("loading package names for %v packages", len(imports))
+func (p *pass) loadPackageNames(ctx context.Context, imports []*ImportInfo) error {
+ if p.logf != nil {
+ p.logf("loading package names for %v packages", len(imports))
defer func() {
- p.env.Logf("done loading package names for %v packages", len(imports))
+ p.logf("done loading package names for %v packages", len(imports))
}()
}
var unknown []string
@@ -288,20 +273,17 @@ func (p *pass) loadPackageNames(imports []*ImportInfo) error {
unknown = append(unknown, imp.ImportPath)
}
- resolver, err := p.env.GetResolver()
- if err != nil {
- return err
- }
-
- names, err := resolver.loadPackageNames(unknown, p.srcDir)
+ names, err := p.source.LoadPackageNames(ctx, p.srcDir, unknown)
if err != nil {
return err
}
+ // TODO(rfindley): revisit this. Why do we need to store known packages with
+ // no exports? The inconsistent data is confusing.
for path, name := range names {
- p.knownPackages[path] = &packageInfo{
- name: name,
- exports: map[string]bool{},
+ p.knownPackages[path] = &PackageInfo{
+ Name: name,
+ Exports: map[string]bool{},
}
}
return nil
@@ -329,8 +311,8 @@ func (p *pass) importIdentifier(imp *ImportInfo) string {
return imp.Name
}
known := p.knownPackages[imp.ImportPath]
- if known != nil && known.name != "" {
- return withoutVersion(known.name)
+ if known != nil && known.Name != "" {
+ return withoutVersion(known.Name)
}
return ImportPathToAssumedName(imp.ImportPath)
}
@@ -338,9 +320,9 @@ func (p *pass) importIdentifier(imp *ImportInfo) string {
// load reads in everything necessary to run a pass, and reports whether the
// file already has all the imports it needs. It fills in p.missingRefs with the
// file's missing symbols, if any, or removes unused imports if not.
-func (p *pass) load() ([]*ImportFix, bool) {
- p.knownPackages = map[string]*packageInfo{}
- p.missingRefs = references{}
+func (p *pass) load(ctx context.Context) ([]*ImportFix, bool) {
+ p.knownPackages = map[string]*PackageInfo{}
+ p.missingRefs = References{}
p.existingImports = map[string][]*ImportInfo{}
// Load basic information about the file in question.
@@ -363,10 +345,10 @@ func (p *pass) load() ([]*ImportFix, bool) {
// f's imports by the identifier they introduce.
imports := collectImports(p.f)
if p.loadRealPackageNames {
- err := p.loadPackageNames(append(imports, p.candidates...))
+ err := p.loadPackageNames(ctx, append(imports, p.candidates...))
if err != nil {
- if p.env.Logf != nil {
- p.env.Logf("loading package names: %v", err)
+ if p.logf != nil {
+ p.logf("loading package names: %v", err)
}
return nil, false
}
@@ -536,9 +518,10 @@ func (p *pass) assumeSiblingImportsValid() {
// We have the stdlib in memory; no need to guess.
rights = symbolNameSet(m)
}
- p.addCandidate(imp, &packageInfo{
+ // TODO(rfindley): we should set package name here, for consistency.
+ p.addCandidate(imp, &PackageInfo{
// no name; we already know it.
- exports: rights,
+ Exports: rights,
})
}
}
@@ -547,14 +530,14 @@ func (p *pass) assumeSiblingImportsValid() {
// addCandidate adds a candidate import to p, and merges in the information
// in pkg.
-func (p *pass) addCandidate(imp *ImportInfo, pkg *packageInfo) {
+func (p *pass) addCandidate(imp *ImportInfo, pkg *PackageInfo) {
p.candidates = append(p.candidates, imp)
if existing, ok := p.knownPackages[imp.ImportPath]; ok {
- if existing.name == "" {
- existing.name = pkg.name
+ if existing.Name == "" {
+ existing.Name = pkg.Name
}
- for export := range pkg.exports {
- existing.exports[export] = true
+ for export := range pkg.Exports {
+ existing.Exports[export] = true
}
} else {
p.knownPackages[imp.ImportPath] = pkg
@@ -563,7 +546,14 @@ func (p *pass) addCandidate(imp *ImportInfo, pkg *packageInfo) {
// fixImports adds and removes imports from f so that all its references are
// satisfied and there are no unused imports.
-func fixImports(fset *token.FileSet, f *ast.File, filename string, env *ProcessEnv) error {
+//
+// This is declared as a variable rather than a function so goimports can
+// easily be extended by adding a file with an init function.
+//
+// DO NOT REMOVE: used internally at Google.
+var fixImports = fixImportsDefault
+
+func fixImportsDefault(fset *token.FileSet, f *ast.File, filename string, env *ProcessEnv) error {
fixes, err := getFixes(context.Background(), fset, f, filename, env)
if err != nil {
return err
@@ -575,21 +565,42 @@ func fixImports(fset *token.FileSet, f *ast.File, filename string, env *ProcessE
// getFixes gets the import fixes that need to be made to f in order to fix the imports.
// It does not modify the ast.
func getFixes(ctx context.Context, fset *token.FileSet, f *ast.File, filename string, env *ProcessEnv) ([]*ImportFix, error) {
+ source, err := NewProcessEnvSource(env, filename, f.Name.Name)
+ if err != nil {
+ return nil, err
+ }
+ goEnv, err := env.goEnv()
+ if err != nil {
+ return nil, err
+ }
+ return getFixesWithSource(ctx, fset, f, filename, goEnv["GOROOT"], env.logf, source)
+}
+
+func getFixesWithSource(ctx context.Context, fset *token.FileSet, f *ast.File, filename string, goroot string, logf func(string, ...any), source Source) ([]*ImportFix, error) {
+ // This logic is defensively duplicated from getFixes.
abs, err := filepath.Abs(filename)
if err != nil {
return nil, err
}
srcDir := filepath.Dir(abs)
- if env.Logf != nil {
- env.Logf("fixImports(filename=%q), abs=%q, srcDir=%q ...", filename, abs, srcDir)
+
+ if logf != nil {
+ logf("fixImports(filename=%q), srcDir=%q ...", filename, abs, srcDir)
}
// First pass: looking only at f, and using the naive algorithm to
// derive package names from import paths, see if the file is already
// complete. We can't add any imports yet, because we don't know
// if missing references are actually package vars.
- p := &pass{fset: fset, f: f, srcDir: srcDir, env: env}
- if fixes, done := p.load(); done {
+ p := &pass{
+ fset: fset,
+ f: f,
+ srcDir: srcDir,
+ logf: logf,
+ goroot: goroot,
+ source: source,
+ }
+ if fixes, done := p.load(ctx); done {
return fixes, nil
}
@@ -601,7 +612,7 @@ func getFixes(ctx context.Context, fset *token.FileSet, f *ast.File, filename st
// Second pass: add information from other files in the same package,
// like their package vars and imports.
p.otherFiles = otherFiles
- if fixes, done := p.load(); done {
+ if fixes, done := p.load(ctx); done {
return fixes, nil
}
@@ -614,10 +625,17 @@ func getFixes(ctx context.Context, fset *token.FileSet, f *ast.File, filename st
// Third pass: get real package names where we had previously used
// the naive algorithm.
- p = &pass{fset: fset, f: f, srcDir: srcDir, env: env}
+ p = &pass{
+ fset: fset,
+ f: f,
+ srcDir: srcDir,
+ logf: logf,
+ goroot: goroot,
+ source: p.source, // safe to reuse, as it's just a wrapper around env
+ }
p.loadRealPackageNames = true
p.otherFiles = otherFiles
- if fixes, done := p.load(); done {
+ if fixes, done := p.load(ctx); done {
return fixes, nil
}
@@ -831,7 +849,7 @@ func GetPackageExports(ctx context.Context, wrapped func(PackageExport), searchP
return true
},
dirFound: func(pkg *pkg) bool {
- return pkgIsCandidate(filename, references{searchPkg: nil}, pkg)
+ return pkgIsCandidate(filename, References{searchPkg: nil}, pkg)
},
packageNameLoaded: func(pkg *pkg) bool {
return pkg.packageName == searchPkg
@@ -1014,16 +1032,26 @@ func (e *ProcessEnv) GetResolver() (Resolver, error) {
// already know the view type.
if len(e.Env["GOMOD"]) == 0 && len(e.Env["GOWORK"]) == 0 {
e.resolver = newGopathResolver(e)
+ e.logf("created gopath resolver")
} else if r, err := newModuleResolver(e, e.ModCache); err != nil {
e.resolverErr = err
+ e.logf("failed to create module resolver: %v", err)
} else {
e.resolver = Resolver(r)
+ e.logf("created module resolver")
}
}
return e.resolver, e.resolverErr
}
+// logf logs if e.Logf is non-nil.
+func (e *ProcessEnv) logf(format string, args ...any) {
+ if e.Logf != nil {
+ e.Logf(format, args...)
+ }
+}
+
// buildContext returns the build.Context to use for matching files.
//
// TODO(rfindley): support dynamic GOOS, GOARCH here, when doing cross-platform
@@ -1072,11 +1100,7 @@ func (e *ProcessEnv) invokeGo(ctx context.Context, verb string, args ...string)
return e.GocmdRunner.Run(ctx, inv)
}
-func addStdlibCandidates(pass *pass, refs references) error {
- goenv, err := pass.env.goEnv()
- if err != nil {
- return err
- }
+func addStdlibCandidates(pass *pass, refs References) error {
localbase := func(nm string) string {
ans := path.Base(nm)
if ans[0] == 'v' {
@@ -1091,13 +1115,13 @@ func addStdlibCandidates(pass *pass, refs references) error {
}
add := func(pkg string) {
// Prevent self-imports.
- if path.Base(pkg) == pass.f.Name.Name && filepath.Join(goenv["GOROOT"], "src", pkg) == pass.srcDir {
+ if path.Base(pkg) == pass.f.Name.Name && filepath.Join(pass.goroot, "src", pkg) == pass.srcDir {
return
}
exports := symbolNameSet(stdlib.PackageSymbols[pkg])
pass.addCandidate(
&ImportInfo{ImportPath: pkg},
- &packageInfo{name: localbase(pkg), exports: exports})
+ &PackageInfo{Name: localbase(pkg), Exports: exports})
}
for left := range refs {
if left == "rand" {
@@ -1127,8 +1151,8 @@ type Resolver interface {
// scan works with callback to search for packages. See scanCallback for details.
scan(ctx context.Context, callback *scanCallback) error
- // loadExports returns the set of exported symbols in the package at dir.
- // loadExports may be called concurrently.
+ // loadExports returns the package name and set of exported symbols in the
+ // package at dir. loadExports may be called concurrently.
loadExports(ctx context.Context, pkg *pkg, includeTest bool) (string, []stdlib.Symbol, error)
// scoreImportPath returns the relevance for an import path.
@@ -1161,101 +1185,22 @@ type scanCallback struct {
exportsLoaded func(pkg *pkg, exports []stdlib.Symbol)
}
-func addExternalCandidates(ctx context.Context, pass *pass, refs references, filename string) error {
+func addExternalCandidates(ctx context.Context, pass *pass, refs References, filename string) error {
ctx, done := event.Start(ctx, "imports.addExternalCandidates")
defer done()
- var mu sync.Mutex
- found := make(map[string][]pkgDistance)
- callback := &scanCallback{
- rootFound: func(gopathwalk.Root) bool {
- return true // We want everything.
- },
- dirFound: func(pkg *pkg) bool {
- return pkgIsCandidate(filename, refs, pkg)
- },
- packageNameLoaded: func(pkg *pkg) bool {
- if _, want := refs[pkg.packageName]; !want {
- return false
- }
- if pkg.dir == pass.srcDir && pass.f.Name.Name == pkg.packageName {
- // The candidate is in the same directory and has the
- // same package name. Don't try to import ourselves.
- return false
- }
- if !canUse(filename, pkg.dir) {
- return false
- }
- mu.Lock()
- defer mu.Unlock()
- found[pkg.packageName] = append(found[pkg.packageName], pkgDistance{pkg, distance(pass.srcDir, pkg.dir)})
- return false // We'll do our own loading after we sort.
- },
- }
- resolver, err := pass.env.GetResolver()
+ results, err := pass.source.ResolveReferences(ctx, filename, refs)
if err != nil {
return err
}
- if err = resolver.scan(ctx, callback); err != nil {
- return err
- }
-
- // Search for imports matching potential package references.
- type result struct {
- imp *ImportInfo
- pkg *packageInfo
- }
- results := make(chan result, len(refs))
-
- ctx, cancel := context.WithCancel(ctx)
- var wg sync.WaitGroup
- defer func() {
- cancel()
- wg.Wait()
- }()
- var (
- firstErr error
- firstErrOnce sync.Once
- )
- for pkgName, symbols := range refs {
- wg.Add(1)
- go func(pkgName string, symbols map[string]bool) {
- defer wg.Done()
-
- found, err := findImport(ctx, pass, found[pkgName], pkgName, symbols)
-
- if err != nil {
- firstErrOnce.Do(func() {
- firstErr = err
- cancel()
- })
- return
- }
-
- if found == nil {
- return // No matching package.
- }
-
- imp := &ImportInfo{
- ImportPath: found.importPathShort,
- }
-
- pkg := &packageInfo{
- name: pkgName,
- exports: symbols,
- }
- results <- result{imp, pkg}
- }(pkgName, symbols)
- }
- go func() {
- wg.Wait()
- close(results)
- }()
- for result := range results {
+ for _, result := range results {
+ if result == nil {
+ continue
+ }
// Don't offer completions that would shadow predeclared
// names, such as github.com/coreos/etcd/error.
- if types.Universe.Lookup(result.pkg.name) != nil { // predeclared
+ if types.Universe.Lookup(result.Package.Name) != nil { // predeclared
// Ideally we would skip this candidate only
// if the predeclared name is actually
// referenced by the file, but that's a lot
@@ -1264,9 +1209,9 @@ func addExternalCandidates(ctx context.Context, pass *pass, refs references, fil
// user before long.
continue
}
- pass.addCandidate(result.imp, result.pkg)
+ pass.addCandidate(result.Import, result.Package)
}
- return firstErr
+ return nil
}
// notIdentifier reports whether ch is an invalid identifier character.
@@ -1608,11 +1553,10 @@ func loadExportsFromFiles(ctx context.Context, env *ProcessEnv, dir string, incl
}
fullFile := filepath.Join(dir, fi.Name())
+ // Legacy ast.Object resolution is needed here.
f, err := parser.ParseFile(fset, fullFile, nil, 0)
if err != nil {
- if env.Logf != nil {
- env.Logf("error parsing %v: %v", fullFile, err)
- }
+ env.logf("error parsing %v: %v", fullFile, err)
continue
}
if f.Name.Name == "documentation" {
@@ -1648,9 +1592,7 @@ func loadExportsFromFiles(ctx context.Context, env *ProcessEnv, dir string, incl
}
sortSymbols(exports)
- if env.Logf != nil {
- env.Logf("loaded exports in dir %v (package %v): %v", dir, pkgName, exports)
- }
+ env.logf("loaded exports in dir %v (package %v): %v", dir, pkgName, exports)
return pkgName, exports, nil
}
@@ -1660,25 +1602,39 @@ func sortSymbols(syms []stdlib.Symbol) {
})
}
-// findImport searches for a package with the given symbols.
-// If no package is found, findImport returns ("", false, nil)
-func findImport(ctx context.Context, pass *pass, candidates []pkgDistance, pkgName string, symbols map[string]bool) (*pkg, error) {
+// A symbolSearcher searches for a package with a set of symbols, among a set
+// of candidates. See [symbolSearcher.search].
+//
+// The search occurs within the scope of a single file, with context captured
+// in srcDir and xtest.
+type symbolSearcher struct {
+ logf func(string, ...any)
+ srcDir string // directory containing the file
+ xtest bool // if set, the file containing is an x_test file
+ loadExports func(ctx context.Context, pkg *pkg, includeTest bool) (string, []stdlib.Symbol, error)
+}
+
+// search searches the provided candidates for a package containing all
+// exported symbols.
+//
+// If successful, returns the resulting package.
+func (s *symbolSearcher) search(ctx context.Context, candidates []pkgDistance, pkgName string, symbols map[string]bool) (*pkg, error) {
// Sort the candidates by their import package length,
// assuming that shorter package names are better than long
// ones. Note that this sorts by the de-vendored name, so
// there's no "penalty" for vendoring.
sort.Sort(byDistanceOrImportPathShortLength(candidates))
- if pass.env.Logf != nil {
+ if s.logf != nil {
for i, c := range candidates {
- pass.env.Logf("%s candidate %d/%d: %v in %v", pkgName, i+1, len(candidates), c.pkg.importPathShort, c.pkg.dir)
+ s.logf("%s candidate %d/%d: %v in %v", pkgName, i+1, len(candidates), c.pkg.importPathShort, c.pkg.dir)
}
}
- resolver, err := pass.env.GetResolver()
- if err != nil {
- return nil, err
- }
- // Collect exports for packages with matching names.
+ // Arrange rescv so that we can we can await results in order of relevance
+ // and exit as soon as we find the first match.
+ //
+ // Search with bounded concurrency, returning as soon as the first result
+ // among rescv is non-nil.
rescv := make([]chan *pkg, len(candidates))
for i := range candidates {
rescv[i] = make(chan *pkg, 1)
@@ -1686,6 +1642,7 @@ func findImport(ctx context.Context, pass *pass, candidates []pkgDistance, pkgNa
const maxConcurrentPackageImport = 4
loadExportsSem := make(chan struct{}, maxConcurrentPackageImport)
+ // Ensure that all work is completed at exit.
ctx, cancel := context.WithCancel(ctx)
var wg sync.WaitGroup
defer func() {
@@ -1693,6 +1650,7 @@ func findImport(ctx context.Context, pass *pass, candidates []pkgDistance, pkgNa
wg.Wait()
}()
+ // Start the search.
wg.Add(1)
go func() {
defer wg.Done()
@@ -1703,55 +1661,67 @@ func findImport(ctx context.Context, pass *pass, candidates []pkgDistance, pkgNa
return
}
+ i := i
+ c := c
wg.Add(1)
- go func(c pkgDistance, resc chan<- *pkg) {
+ go func() {
defer func() {
<-loadExportsSem
wg.Done()
}()
-
- if pass.env.Logf != nil {
- pass.env.Logf("loading exports in dir %s (seeking package %s)", c.pkg.dir, pkgName)
+ if s.logf != nil {
+ s.logf("loading exports in dir %s (seeking package %s)", c.pkg.dir, pkgName)
}
- // If we're an x_test, load the package under test's test variant.
- includeTest := strings.HasSuffix(pass.f.Name.Name, "_test") && c.pkg.dir == pass.srcDir
- _, exports, err := resolver.loadExports(ctx, c.pkg, includeTest)
+ pkg, err := s.searchOne(ctx, c, symbols)
if err != nil {
- if pass.env.Logf != nil {
- pass.env.Logf("loading exports in dir %s (seeking package %s): %v", c.pkg.dir, pkgName, err)
- }
- resc <- nil
- return
- }
-
- exportsMap := make(map[string]bool, len(exports))
- for _, sym := range exports {
- exportsMap[sym.Name] = true
- }
-
- // If it doesn't have the right
- // symbols, send nil to mean no match.
- for symbol := range symbols {
- if !exportsMap[symbol] {
- resc <- nil
- return
+ if s.logf != nil && ctx.Err() == nil {
+ s.logf("loading exports in dir %s (seeking package %s): %v", c.pkg.dir, pkgName, err)
}
+ pkg = nil
}
- resc <- c.pkg
- }(c, rescv[i])
+ rescv[i] <- pkg // may be nil
+ }()
}
}()
+ // Await the first (best) result.
for _, resc := range rescv {
- pkg := <-resc
- if pkg == nil {
- continue
+ select {
+ case r := <-resc:
+ if r != nil {
+ return r, nil
+ }
+ case <-ctx.Done():
+ return nil, ctx.Err()
}
- return pkg, nil
}
return nil, nil
}
+func (s *symbolSearcher) searchOne(ctx context.Context, c pkgDistance, symbols map[string]bool) (*pkg, error) {
+ if ctx.Err() != nil {
+ return nil, ctx.Err()
+ }
+ // If we're considering the package under test from an x_test, load the
+ // test variant.
+ includeTest := s.xtest && c.pkg.dir == s.srcDir
+ _, exports, err := s.loadExports(ctx, c.pkg, includeTest)
+ if err != nil {
+ return nil, err
+ }
+
+ exportsMap := make(map[string]bool, len(exports))
+ for _, sym := range exports {
+ exportsMap[sym.Name] = true
+ }
+ for symbol := range symbols {
+ if !exportsMap[symbol] {
+ return nil, nil // no match
+ }
+ }
+ return c.pkg, nil
+}
+
// pkgIsCandidate reports whether pkg is a candidate for satisfying the
// finding which package pkgIdent in the file named by filename is trying
// to refer to.
@@ -1764,65 +1734,31 @@ func findImport(ctx context.Context, pass *pass, candidates []pkgDistance, pkgNa
// filename is the file being formatted.
// pkgIdent is the package being searched for, like "client" (if
// searching for "client.New")
-func pkgIsCandidate(filename string, refs references, pkg *pkg) bool {
+func pkgIsCandidate(filename string, refs References, pkg *pkg) bool {
// Check "internal" and "vendor" visibility:
if !canUse(filename, pkg.dir) {
return false
}
// Speed optimization to minimize disk I/O:
- // the last two components on disk must contain the
- // package name somewhere.
//
- // This permits mismatch naming like directory
- // "go-foo" being package "foo", or "pkg.v3" being "pkg",
- // or directory "google.golang.org/api/cloudbilling/v1"
- // being package "cloudbilling", but doesn't
- // permit a directory "foo" to be package
- // "bar", which is strongly discouraged
- // anyway. There's no reason goimports needs
- // to be slow just to accommodate that.
+ // Use the matchesPath heuristic to filter to package paths that could
+ // reasonably match a dangling reference.
+ //
+ // This permits mismatch naming like directory "go-foo" being package "foo",
+ // or "pkg.v3" being "pkg", or directory
+ // "google.golang.org/api/cloudbilling/v1" being package "cloudbilling", but
+ // doesn't permit a directory "foo" to be package "bar", which is strongly
+ // discouraged anyway. There's no reason goimports needs to be slow just to
+ // accommodate that.
for pkgIdent := range refs {
- lastTwo := lastTwoComponents(pkg.importPathShort)
- if strings.Contains(lastTwo, pkgIdent) {
+ if matchesPath(pkgIdent, pkg.importPathShort) {
return true
}
- if hasHyphenOrUpperASCII(lastTwo) && !hasHyphenOrUpperASCII(pkgIdent) {
- lastTwo = lowerASCIIAndRemoveHyphen(lastTwo)
- if strings.Contains(lastTwo, pkgIdent) {
- return true
- }
- }
}
return false
}
-func hasHyphenOrUpperASCII(s string) bool {
- for i := 0; i < len(s); i++ {
- b := s[i]
- if b == '-' || ('A' <= b && b <= 'Z') {
- return true
- }
- }
- return false
-}
-
-func lowerASCIIAndRemoveHyphen(s string) (ret string) {
- buf := make([]byte, 0, len(s))
- for i := 0; i < len(s); i++ {
- b := s[i]
- switch {
- case b == '-':
- continue
- case 'A' <= b && b <= 'Z':
- buf = append(buf, b+('a'-'A'))
- default:
- buf = append(buf, b)
- }
- }
- return string(buf)
-}
-
// canUse reports whether the package in dir is usable from filename,
// respecting the Go "internal" and "vendor" visibility rules.
func canUse(filename, dir string) bool {
@@ -1863,19 +1799,84 @@ func canUse(filename, dir string) bool {
return !strings.Contains(relSlash, "/vendor/") && !strings.Contains(relSlash, "/internal/") && !strings.HasSuffix(relSlash, "/internal")
}
-// lastTwoComponents returns at most the last two path components
-// of v, using either / or \ as the path separator.
-func lastTwoComponents(v string) string {
+// matchesPath reports whether ident may match a potential package name
+// referred to by path, using heuristics to filter out unidiomatic package
+// names.
+//
+// Specifically, it checks whether either of the last two '/'- or '\'-delimited
+// path segments matches the identifier. The segment-matching heuristic must
+// allow for various conventions around segment naming, including go-foo,
+// foo-go, and foo.v3. To handle all of these, matching considers both (1) the
+// entire segment, ignoring '-' and '.', as well as (2) the last subsegment
+// separated by '-' or '.'. So the segment foo-go matches all of the following
+// identifiers: foo, go, and foogo. All matches are case insensitive (for ASCII
+// identifiers).
+//
+// See the docstring for [pkgIsCandidate] for an explanation of how this
+// heuristic filters potential candidate packages.
+func matchesPath(ident, path string) bool {
+ // Ignore case, for ASCII.
+ lowerIfASCII := func(b byte) byte {
+ if 'A' <= b && b <= 'Z' {
+ return b + ('a' - 'A')
+ }
+ return b
+ }
+
+ // match reports whether path[start:end] matches ident, ignoring [.-].
+ match := func(start, end int) bool {
+ ii := len(ident) - 1 // current byte in ident
+ pi := end - 1 // current byte in path
+ for ; pi >= start && ii >= 0; pi-- {
+ pb := path[pi]
+ if pb == '-' || pb == '.' {
+ continue
+ }
+ pb = lowerIfASCII(pb)
+ ib := lowerIfASCII(ident[ii])
+ if pb != ib {
+ return false
+ }
+ ii--
+ }
+ return ii < 0 && pi < start // all bytes matched
+ }
+
+ // segmentEnd and subsegmentEnd hold the end points of the current segment
+ // and subsegment intervals.
+ segmentEnd := len(path)
+ subsegmentEnd := len(path)
+
+ // Count slashes; we only care about the last two segments.
nslash := 0
- for i := len(v) - 1; i >= 0; i-- {
- if v[i] == '/' || v[i] == '\\' {
+
+ for i := len(path) - 1; i >= 0; i-- {
+ switch b := path[i]; b {
+ // TODO(rfindley): we handle backlashes here only because the previous
+ // heuristic handled backslashes. This is perhaps overly defensive, but is
+ // the result of many lessons regarding Chesterton's fence and the
+ // goimports codebase.
+ //
+ // However, this function is only ever called with something called an
+ // 'importPath'. Is it possible that this is a real import path, and
+ // therefore we need only consider forward slashes?
+ case '/', '\\':
+ if match(i+1, segmentEnd) || match(i+1, subsegmentEnd) {
+ return true
+ }
nslash++
if nslash == 2 {
- return v[i:]
+ return false // did not match above
+ }
+ segmentEnd, subsegmentEnd = i, i // reset
+ case '-', '.':
+ if match(i+1, subsegmentEnd) {
+ return true
}
+ subsegmentEnd = i
}
}
- return v
+ return match(0, segmentEnd) || match(0, subsegmentEnd)
}
type visitFn func(node ast.Node) ast.Visitor
diff --git a/vendor/golang.org/x/tools/internal/imports/imports.go b/vendor/golang.org/x/tools/internal/imports/imports.go
index f8346552..2215a128 100644
--- a/vendor/golang.org/x/tools/internal/imports/imports.go
+++ b/vendor/golang.org/x/tools/internal/imports/imports.go
@@ -47,7 +47,14 @@ type Options struct {
// Process implements golang.org/x/tools/imports.Process with explicit context in opt.Env.
func Process(filename string, src []byte, opt *Options) (formatted []byte, err error) {
fileSet := token.NewFileSet()
- file, adjust, err := parse(fileSet, filename, src, opt)
+ var parserMode parser.Mode
+ if opt.Comments {
+ parserMode |= parser.ParseComments
+ }
+ if opt.AllErrors {
+ parserMode |= parser.AllErrors
+ }
+ file, adjust, err := parse(fileSet, filename, src, parserMode, opt.Fragment)
if err != nil {
return nil, err
}
@@ -66,17 +73,19 @@ func Process(filename string, src []byte, opt *Options) (formatted []byte, err e
//
// Note that filename's directory influences which imports can be chosen,
// so it is important that filename be accurate.
-func FixImports(ctx context.Context, filename string, src []byte, opt *Options) (fixes []*ImportFix, err error) {
+func FixImports(ctx context.Context, filename string, src []byte, goroot string, logf func(string, ...any), source Source) (fixes []*ImportFix, err error) {
ctx, done := event.Start(ctx, "imports.FixImports")
defer done()
fileSet := token.NewFileSet()
- file, _, err := parse(fileSet, filename, src, opt)
+ // TODO(rfindley): these default values for ParseComments and AllErrors were
+ // extracted from gopls, but are they even needed?
+ file, _, err := parse(fileSet, filename, src, parser.ParseComments|parser.AllErrors, true)
if err != nil {
return nil, err
}
- return getFixes(ctx, fileSet, file, filename, opt.Env)
+ return getFixesWithSource(ctx, fileSet, file, filename, goroot, logf, source)
}
// ApplyFixes applies all of the fixes to the file and formats it. extraMode
@@ -86,7 +95,7 @@ func ApplyFixes(fixes []*ImportFix, filename string, src []byte, opt *Options, e
// Don't use parse() -- we don't care about fragments or statement lists
// here, and we need to work with unparseable files.
fileSet := token.NewFileSet()
- parserMode := parser.Mode(0)
+ parserMode := parser.SkipObjectResolution
if opt.Comments {
parserMode |= parser.ParseComments
}
@@ -114,7 +123,7 @@ func ApplyFixes(fixes []*ImportFix, filename string, src []byte, opt *Options, e
// formatted file, and returns the postpocessed result.
func formatFile(fset *token.FileSet, file *ast.File, src []byte, adjust func(orig []byte, src []byte) []byte, opt *Options) ([]byte, error) {
mergeImports(file)
- sortImports(opt.LocalPrefix, fset.File(file.Pos()), file)
+ sortImports(opt.LocalPrefix, fset.File(file.FileStart), file)
var spacesBefore []string // import paths we need spaces before
for _, impSection := range astutil.Imports(fset, file) {
// Within each block of contiguous imports, see if any
@@ -164,13 +173,9 @@ func formatFile(fset *token.FileSet, file *ast.File, src []byte, adjust func(ori
// parse parses src, which was read from filename,
// as a Go source file or statement list.
-func parse(fset *token.FileSet, filename string, src []byte, opt *Options) (*ast.File, func(orig, src []byte) []byte, error) {
- parserMode := parser.Mode(0)
- if opt.Comments {
- parserMode |= parser.ParseComments
- }
- if opt.AllErrors {
- parserMode |= parser.AllErrors
+func parse(fset *token.FileSet, filename string, src []byte, parserMode parser.Mode, fragment bool) (*ast.File, func(orig, src []byte) []byte, error) {
+ if parserMode&parser.SkipObjectResolution != 0 {
+ panic("legacy ast.Object resolution is required")
}
// Try as whole source file.
@@ -181,7 +186,7 @@ func parse(fset *token.FileSet, filename string, src []byte, opt *Options) (*ast
// If the error is that the source file didn't begin with a
// package line and we accept fragmented input, fall through to
// try as a source fragment. Stop and return on any other error.
- if !opt.Fragment || !strings.Contains(err.Error(), "expected 'package'") {
+ if !fragment || !strings.Contains(err.Error(), "expected 'package'") {
return nil, nil, err
}
diff --git a/vendor/golang.org/x/tools/internal/imports/mod.go b/vendor/golang.org/x/tools/internal/imports/mod.go
index 82fe644a..8555e3f8 100644
--- a/vendor/golang.org/x/tools/internal/imports/mod.go
+++ b/vendor/golang.org/x/tools/internal/imports/mod.go
@@ -245,7 +245,10 @@ func newModuleResolver(e *ProcessEnv, moduleCacheCache *DirInfoCache) (*ModuleRe
// 2. Use this to separate module cache scanning from other scanning.
func gomodcacheForEnv(goenv map[string]string) string {
if gmc := goenv["GOMODCACHE"]; gmc != "" {
- return gmc
+ // golang/go#67156: ensure that the module cache is clean, since it is
+ // assumed as a prefix to directories scanned by gopathwalk, which are
+ // themselves clean.
+ return filepath.Clean(gmc)
}
gopaths := filepath.SplitList(goenv["GOPATH"])
if len(gopaths) == 0 {
@@ -265,9 +268,7 @@ func (r *ModuleResolver) initAllMods() error {
return err
}
if mod.Dir == "" {
- if r.env.Logf != nil {
- r.env.Logf("module %v has not been downloaded and will be ignored", mod.Path)
- }
+ r.env.logf("module %v has not been downloaded and will be ignored", mod.Path)
// Can't do anything with a module that's not downloaded.
continue
}
@@ -742,8 +743,8 @@ func (r *ModuleResolver) loadExports(ctx context.Context, pkg *pkg, includeTest
func (r *ModuleResolver) scanDirForPackage(root gopathwalk.Root, dir string) directoryPackageInfo {
subdir := ""
- if dir != root.Path {
- subdir = dir[len(root.Path)+len("/"):]
+ if prefix := root.Path + string(filepath.Separator); strings.HasPrefix(dir, prefix) {
+ subdir = dir[len(prefix):]
}
importPath := filepath.ToSlash(subdir)
if strings.HasPrefix(importPath, "vendor/") {
@@ -766,9 +767,7 @@ func (r *ModuleResolver) scanDirForPackage(root gopathwalk.Root, dir string) dir
}
modPath, err := module.UnescapePath(filepath.ToSlash(matches[1]))
if err != nil {
- if r.env.Logf != nil {
- r.env.Logf("decoding module cache path %q: %v", subdir, err)
- }
+ r.env.logf("decoding module cache path %q: %v", subdir, err)
return directoryPackageInfo{
status: directoryScanned,
err: fmt.Errorf("decoding module cache path %q: %v", subdir, err),
diff --git a/vendor/golang.org/x/tools/internal/imports/source.go b/vendor/golang.org/x/tools/internal/imports/source.go
new file mode 100644
index 00000000..5d2aeeeb
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/imports/source.go
@@ -0,0 +1,63 @@
+// Copyright 2024 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package imports
+
+import "context"
+
+// These types document the APIs below.
+//
+// TODO(rfindley): consider making these defined types rather than aliases.
+type (
+ ImportPath = string
+ PackageName = string
+ Symbol = string
+
+ // References is set of References found in a Go file. The first map key is the
+ // left hand side of a selector expression, the second key is the right hand
+ // side, and the value should always be true.
+ References = map[PackageName]map[Symbol]bool
+)
+
+// A Result satisfies a missing import.
+//
+// The Import field describes the missing import spec, and the Package field
+// summarizes the package exports.
+type Result struct {
+ Import *ImportInfo
+ Package *PackageInfo
+}
+
+// An ImportInfo represents a single import statement.
+type ImportInfo struct {
+ ImportPath string // import path, e.g. "crypto/rand".
+ Name string // import name, e.g. "crand", or "" if none.
+}
+
+// A PackageInfo represents what's known about a package.
+type PackageInfo struct {
+ Name string // package name in the package declaration, if known
+ Exports map[string]bool // set of names of known package level sortSymbols
+}
+
+// A Source provides imports to satisfy unresolved references in the file being
+// fixed.
+type Source interface {
+ // LoadPackageNames queries PackageName information for the requested import
+ // paths, when operating from the provided srcDir.
+ //
+ // TODO(rfindley): try to refactor to remove this operation.
+ LoadPackageNames(ctx context.Context, srcDir string, paths []ImportPath) (map[ImportPath]PackageName, error)
+
+ // ResolveReferences asks the Source for the best package name to satisfy
+ // each of the missing references, in the context of fixing the given
+ // filename.
+ //
+ // Returns a map from package name to a [Result] for that package name that
+ // provides the required symbols. Keys may be omitted in the map if no
+ // candidates satisfy all missing references for that package name. It is up
+ // to each data source to select the best result for each entry in the
+ // missing map.
+ ResolveReferences(ctx context.Context, filename string, missing References) (map[PackageName]*Result, error)
+}
diff --git a/vendor/golang.org/x/tools/internal/imports/source_env.go b/vendor/golang.org/x/tools/internal/imports/source_env.go
new file mode 100644
index 00000000..ff9555d2
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/imports/source_env.go
@@ -0,0 +1,125 @@
+// Copyright 2024 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package imports
+
+import (
+ "context"
+ "path/filepath"
+ "strings"
+ "sync"
+
+ "golang.org/x/sync/errgroup"
+ "golang.org/x/tools/internal/gopathwalk"
+)
+
+// ProcessEnvSource implements the [Source] interface using the legacy
+// [ProcessEnv] abstraction.
+type ProcessEnvSource struct {
+ env *ProcessEnv
+ srcDir string
+ filename string
+ pkgName string
+}
+
+// NewProcessEnvSource returns a [ProcessEnvSource] wrapping the given
+// env, to be used for fixing imports in the file with name filename in package
+// named pkgName.
+func NewProcessEnvSource(env *ProcessEnv, filename, pkgName string) (*ProcessEnvSource, error) {
+ abs, err := filepath.Abs(filename)
+ if err != nil {
+ return nil, err
+ }
+ srcDir := filepath.Dir(abs)
+ return &ProcessEnvSource{
+ env: env,
+ srcDir: srcDir,
+ filename: filename,
+ pkgName: pkgName,
+ }, nil
+}
+
+func (s *ProcessEnvSource) LoadPackageNames(ctx context.Context, srcDir string, unknown []string) (map[string]string, error) {
+ r, err := s.env.GetResolver()
+ if err != nil {
+ return nil, err
+ }
+ return r.loadPackageNames(unknown, srcDir)
+}
+
+func (s *ProcessEnvSource) ResolveReferences(ctx context.Context, filename string, refs map[string]map[string]bool) (map[string]*Result, error) {
+ var mu sync.Mutex
+ found := make(map[string][]pkgDistance)
+ callback := &scanCallback{
+ rootFound: func(gopathwalk.Root) bool {
+ return true // We want everything.
+ },
+ dirFound: func(pkg *pkg) bool {
+ return pkgIsCandidate(filename, refs, pkg)
+ },
+ packageNameLoaded: func(pkg *pkg) bool {
+ if _, want := refs[pkg.packageName]; !want {
+ return false
+ }
+ if pkg.dir == s.srcDir && s.pkgName == pkg.packageName {
+ // The candidate is in the same directory and has the
+ // same package name. Don't try to import ourselves.
+ return false
+ }
+ if !canUse(filename, pkg.dir) {
+ return false
+ }
+ mu.Lock()
+ defer mu.Unlock()
+ found[pkg.packageName] = append(found[pkg.packageName], pkgDistance{pkg, distance(s.srcDir, pkg.dir)})
+ return false // We'll do our own loading after we sort.
+ },
+ }
+ resolver, err := s.env.GetResolver()
+ if err != nil {
+ return nil, err
+ }
+ if err := resolver.scan(ctx, callback); err != nil {
+ return nil, err
+ }
+
+ g, ctx := errgroup.WithContext(ctx)
+
+ searcher := symbolSearcher{
+ logf: s.env.logf,
+ srcDir: s.srcDir,
+ xtest: strings.HasSuffix(s.pkgName, "_test"),
+ loadExports: resolver.loadExports,
+ }
+
+ var resultMu sync.Mutex
+ results := make(map[string]*Result, len(refs))
+ for pkgName, symbols := range refs {
+ g.Go(func() error {
+ found, err := searcher.search(ctx, found[pkgName], pkgName, symbols)
+ if err != nil {
+ return err
+ }
+ if found == nil {
+ return nil // No matching package.
+ }
+
+ imp := &ImportInfo{
+ ImportPath: found.importPathShort,
+ }
+ pkg := &PackageInfo{
+ Name: pkgName,
+ Exports: symbols,
+ }
+ resultMu.Lock()
+ results[pkgName] = &Result{Import: imp, Package: pkg}
+ resultMu.Unlock()
+ return nil
+ })
+ }
+ if err := g.Wait(); err != nil {
+ return nil, err
+ }
+ return results, nil
+}
diff --git a/vendor/golang.org/x/tools/internal/packagesinternal/packages.go b/vendor/golang.org/x/tools/internal/packagesinternal/packages.go
new file mode 100644
index 00000000..44719de1
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/packagesinternal/packages.go
@@ -0,0 +1,22 @@
+// Copyright 2020 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Package packagesinternal exposes internal-only fields from go/packages.
+package packagesinternal
+
+var GetForTest = func(p interface{}) string { return "" }
+var GetDepsErrors = func(p interface{}) []*PackageError { return nil }
+
+type PackageError struct {
+ ImportStack []string // shortest path from package named on command line to this one
+ Pos string // position of error (if present, file:line:col)
+ Err string // the error itself
+}
+
+var TypecheckCgo int
+var DepsErrors int // must be set as a LoadMode to call GetDepsErrors
+var ForTest int // must be set as a LoadMode to call GetForTest
+
+var SetModFlag = func(config interface{}, value string) {}
+var SetModFile = func(config interface{}, value string) {}
diff --git a/vendor/golang.org/x/tools/internal/pkgbits/codes.go b/vendor/golang.org/x/tools/internal/pkgbits/codes.go
new file mode 100644
index 00000000..f0cabde9
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/pkgbits/codes.go
@@ -0,0 +1,77 @@
+// Copyright 2021 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package pkgbits
+
+// A Code is an enum value that can be encoded into bitstreams.
+//
+// Code types are preferable for enum types, because they allow
+// Decoder to detect desyncs.
+type Code interface {
+ // Marker returns the SyncMarker for the Code's dynamic type.
+ Marker() SyncMarker
+
+ // Value returns the Code's ordinal value.
+ Value() int
+}
+
+// A CodeVal distinguishes among go/constant.Value encodings.
+type CodeVal int
+
+func (c CodeVal) Marker() SyncMarker { return SyncVal }
+func (c CodeVal) Value() int { return int(c) }
+
+// Note: These values are public and cannot be changed without
+// updating the go/types importers.
+
+const (
+ ValBool CodeVal = iota
+ ValString
+ ValInt64
+ ValBigInt
+ ValBigRat
+ ValBigFloat
+)
+
+// A CodeType distinguishes among go/types.Type encodings.
+type CodeType int
+
+func (c CodeType) Marker() SyncMarker { return SyncType }
+func (c CodeType) Value() int { return int(c) }
+
+// Note: These values are public and cannot be changed without
+// updating the go/types importers.
+
+const (
+ TypeBasic CodeType = iota
+ TypeNamed
+ TypePointer
+ TypeSlice
+ TypeArray
+ TypeChan
+ TypeMap
+ TypeSignature
+ TypeStruct
+ TypeInterface
+ TypeUnion
+ TypeTypeParam
+)
+
+// A CodeObj distinguishes among go/types.Object encodings.
+type CodeObj int
+
+func (c CodeObj) Marker() SyncMarker { return SyncCodeObj }
+func (c CodeObj) Value() int { return int(c) }
+
+// Note: These values are public and cannot be changed without
+// updating the go/types importers.
+
+const (
+ ObjAlias CodeObj = iota
+ ObjConst
+ ObjType
+ ObjFunc
+ ObjVar
+ ObjStub
+)
diff --git a/vendor/golang.org/x/tools/internal/pkgbits/decoder.go b/vendor/golang.org/x/tools/internal/pkgbits/decoder.go
new file mode 100644
index 00000000..f6cb37c5
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/pkgbits/decoder.go
@@ -0,0 +1,519 @@
+// Copyright 2021 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package pkgbits
+
+import (
+ "encoding/binary"
+ "errors"
+ "fmt"
+ "go/constant"
+ "go/token"
+ "io"
+ "math/big"
+ "os"
+ "runtime"
+ "strings"
+)
+
+// A PkgDecoder provides methods for decoding a package's Unified IR
+// export data.
+type PkgDecoder struct {
+ // version is the file format version.
+ version Version
+
+ // sync indicates whether the file uses sync markers.
+ sync bool
+
+ // pkgPath is the package path for the package to be decoded.
+ //
+ // TODO(mdempsky): Remove; unneeded since CL 391014.
+ pkgPath string
+
+ // elemData is the full data payload of the encoded package.
+ // Elements are densely and contiguously packed together.
+ //
+ // The last 8 bytes of elemData are the package fingerprint.
+ elemData string
+
+ // elemEnds stores the byte-offset end positions of element
+ // bitstreams within elemData.
+ //
+ // For example, element I's bitstream data starts at elemEnds[I-1]
+ // (or 0, if I==0) and ends at elemEnds[I].
+ //
+ // Note: elemEnds is indexed by absolute indices, not
+ // section-relative indices.
+ elemEnds []uint32
+
+ // elemEndsEnds stores the index-offset end positions of relocation
+ // sections within elemEnds.
+ //
+ // For example, section K's end positions start at elemEndsEnds[K-1]
+ // (or 0, if K==0) and end at elemEndsEnds[K].
+ elemEndsEnds [numRelocs]uint32
+
+ scratchRelocEnt []RelocEnt
+}
+
+// PkgPath returns the package path for the package
+//
+// TODO(mdempsky): Remove; unneeded since CL 391014.
+func (pr *PkgDecoder) PkgPath() string { return pr.pkgPath }
+
+// SyncMarkers reports whether pr uses sync markers.
+func (pr *PkgDecoder) SyncMarkers() bool { return pr.sync }
+
+// NewPkgDecoder returns a PkgDecoder initialized to read the Unified
+// IR export data from input. pkgPath is the package path for the
+// compilation unit that produced the export data.
+func NewPkgDecoder(pkgPath, input string) PkgDecoder {
+ pr := PkgDecoder{
+ pkgPath: pkgPath,
+ }
+
+ // TODO(mdempsky): Implement direct indexing of input string to
+ // avoid copying the position information.
+
+ r := strings.NewReader(input)
+
+ var ver uint32
+ assert(binary.Read(r, binary.LittleEndian, &ver) == nil)
+ pr.version = Version(ver)
+
+ if pr.version >= numVersions {
+ panic(fmt.Errorf("cannot decode %q, export data version %d is greater than maximum supported version %d", pkgPath, pr.version, numVersions-1))
+ }
+
+ if pr.version.Has(Flags) {
+ var flags uint32
+ assert(binary.Read(r, binary.LittleEndian, &flags) == nil)
+ pr.sync = flags&flagSyncMarkers != 0
+ }
+
+ assert(binary.Read(r, binary.LittleEndian, pr.elemEndsEnds[:]) == nil)
+
+ pr.elemEnds = make([]uint32, pr.elemEndsEnds[len(pr.elemEndsEnds)-1])
+ assert(binary.Read(r, binary.LittleEndian, pr.elemEnds[:]) == nil)
+
+ pos, err := r.Seek(0, io.SeekCurrent)
+ assert(err == nil)
+
+ pr.elemData = input[pos:]
+
+ const fingerprintSize = 8
+ assert(len(pr.elemData)-fingerprintSize == int(pr.elemEnds[len(pr.elemEnds)-1]))
+
+ return pr
+}
+
+// NumElems returns the number of elements in section k.
+func (pr *PkgDecoder) NumElems(k RelocKind) int {
+ count := int(pr.elemEndsEnds[k])
+ if k > 0 {
+ count -= int(pr.elemEndsEnds[k-1])
+ }
+ return count
+}
+
+// TotalElems returns the total number of elements across all sections.
+func (pr *PkgDecoder) TotalElems() int {
+ return len(pr.elemEnds)
+}
+
+// Fingerprint returns the package fingerprint.
+func (pr *PkgDecoder) Fingerprint() [8]byte {
+ var fp [8]byte
+ copy(fp[:], pr.elemData[len(pr.elemData)-8:])
+ return fp
+}
+
+// AbsIdx returns the absolute index for the given (section, index)
+// pair.
+func (pr *PkgDecoder) AbsIdx(k RelocKind, idx Index) int {
+ absIdx := int(idx)
+ if k > 0 {
+ absIdx += int(pr.elemEndsEnds[k-1])
+ }
+ if absIdx >= int(pr.elemEndsEnds[k]) {
+ panicf("%v:%v is out of bounds; %v", k, idx, pr.elemEndsEnds)
+ }
+ return absIdx
+}
+
+// DataIdx returns the raw element bitstream for the given (section,
+// index) pair.
+func (pr *PkgDecoder) DataIdx(k RelocKind, idx Index) string {
+ absIdx := pr.AbsIdx(k, idx)
+
+ var start uint32
+ if absIdx > 0 {
+ start = pr.elemEnds[absIdx-1]
+ }
+ end := pr.elemEnds[absIdx]
+
+ return pr.elemData[start:end]
+}
+
+// StringIdx returns the string value for the given string index.
+func (pr *PkgDecoder) StringIdx(idx Index) string {
+ return pr.DataIdx(RelocString, idx)
+}
+
+// NewDecoder returns a Decoder for the given (section, index) pair,
+// and decodes the given SyncMarker from the element bitstream.
+func (pr *PkgDecoder) NewDecoder(k RelocKind, idx Index, marker SyncMarker) Decoder {
+ r := pr.NewDecoderRaw(k, idx)
+ r.Sync(marker)
+ return r
+}
+
+// TempDecoder returns a Decoder for the given (section, index) pair,
+// and decodes the given SyncMarker from the element bitstream.
+// If possible the Decoder should be RetireDecoder'd when it is no longer
+// needed, this will avoid heap allocations.
+func (pr *PkgDecoder) TempDecoder(k RelocKind, idx Index, marker SyncMarker) Decoder {
+ r := pr.TempDecoderRaw(k, idx)
+ r.Sync(marker)
+ return r
+}
+
+func (pr *PkgDecoder) RetireDecoder(d *Decoder) {
+ pr.scratchRelocEnt = d.Relocs
+ d.Relocs = nil
+}
+
+// NewDecoderRaw returns a Decoder for the given (section, index) pair.
+//
+// Most callers should use NewDecoder instead.
+func (pr *PkgDecoder) NewDecoderRaw(k RelocKind, idx Index) Decoder {
+ r := Decoder{
+ common: pr,
+ k: k,
+ Idx: idx,
+ }
+
+ r.Data.Reset(pr.DataIdx(k, idx))
+ r.Sync(SyncRelocs)
+ r.Relocs = make([]RelocEnt, r.Len())
+ for i := range r.Relocs {
+ r.Sync(SyncReloc)
+ r.Relocs[i] = RelocEnt{RelocKind(r.Len()), Index(r.Len())}
+ }
+
+ return r
+}
+
+func (pr *PkgDecoder) TempDecoderRaw(k RelocKind, idx Index) Decoder {
+ r := Decoder{
+ common: pr,
+ k: k,
+ Idx: idx,
+ }
+
+ r.Data.Reset(pr.DataIdx(k, idx))
+ r.Sync(SyncRelocs)
+ l := r.Len()
+ if cap(pr.scratchRelocEnt) >= l {
+ r.Relocs = pr.scratchRelocEnt[:l]
+ pr.scratchRelocEnt = nil
+ } else {
+ r.Relocs = make([]RelocEnt, l)
+ }
+ for i := range r.Relocs {
+ r.Sync(SyncReloc)
+ r.Relocs[i] = RelocEnt{RelocKind(r.Len()), Index(r.Len())}
+ }
+
+ return r
+}
+
+// A Decoder provides methods for decoding an individual element's
+// bitstream data.
+type Decoder struct {
+ common *PkgDecoder
+
+ Relocs []RelocEnt
+ Data strings.Reader
+
+ k RelocKind
+ Idx Index
+}
+
+func (r *Decoder) checkErr(err error) {
+ if err != nil {
+ panicf("unexpected decoding error: %w", err)
+ }
+}
+
+func (r *Decoder) rawUvarint() uint64 {
+ x, err := readUvarint(&r.Data)
+ r.checkErr(err)
+ return x
+}
+
+// readUvarint is a type-specialized copy of encoding/binary.ReadUvarint.
+// This avoids the interface conversion and thus has better escape properties,
+// which flows up the stack.
+func readUvarint(r *strings.Reader) (uint64, error) {
+ var x uint64
+ var s uint
+ for i := 0; i < binary.MaxVarintLen64; i++ {
+ b, err := r.ReadByte()
+ if err != nil {
+ if i > 0 && err == io.EOF {
+ err = io.ErrUnexpectedEOF
+ }
+ return x, err
+ }
+ if b < 0x80 {
+ if i == binary.MaxVarintLen64-1 && b > 1 {
+ return x, overflow
+ }
+ return x | uint64(b)<> 1)
+ if ux&1 != 0 {
+ x = ^x
+ }
+ return x
+}
+
+func (r *Decoder) rawReloc(k RelocKind, idx int) Index {
+ e := r.Relocs[idx]
+ assert(e.Kind == k)
+ return e.Idx
+}
+
+// Sync decodes a sync marker from the element bitstream and asserts
+// that it matches the expected marker.
+//
+// If r.common.sync is false, then Sync is a no-op.
+func (r *Decoder) Sync(mWant SyncMarker) {
+ if !r.common.sync {
+ return
+ }
+
+ pos, _ := r.Data.Seek(0, io.SeekCurrent)
+ mHave := SyncMarker(r.rawUvarint())
+ writerPCs := make([]int, r.rawUvarint())
+ for i := range writerPCs {
+ writerPCs[i] = int(r.rawUvarint())
+ }
+
+ if mHave == mWant {
+ return
+ }
+
+ // There's some tension here between printing:
+ //
+ // (1) full file paths that tools can recognize (e.g., so emacs
+ // hyperlinks the "file:line" text for easy navigation), or
+ //
+ // (2) short file paths that are easier for humans to read (e.g., by
+ // omitting redundant or irrelevant details, so it's easier to
+ // focus on the useful bits that remain).
+ //
+ // The current formatting favors the former, as it seems more
+ // helpful in practice. But perhaps the formatting could be improved
+ // to better address both concerns. For example, use relative file
+ // paths if they would be shorter, or rewrite file paths to contain
+ // "$GOROOT" (like objabi.AbsFile does) if tools can be taught how
+ // to reliably expand that again.
+
+ fmt.Printf("export data desync: package %q, section %v, index %v, offset %v\n", r.common.pkgPath, r.k, r.Idx, pos)
+
+ fmt.Printf("\nfound %v, written at:\n", mHave)
+ if len(writerPCs) == 0 {
+ fmt.Printf("\t[stack trace unavailable; recompile package %q with -d=syncframes]\n", r.common.pkgPath)
+ }
+ for _, pc := range writerPCs {
+ fmt.Printf("\t%s\n", r.common.StringIdx(r.rawReloc(RelocString, pc)))
+ }
+
+ fmt.Printf("\nexpected %v, reading at:\n", mWant)
+ var readerPCs [32]uintptr // TODO(mdempsky): Dynamically size?
+ n := runtime.Callers(2, readerPCs[:])
+ for _, pc := range fmtFrames(readerPCs[:n]...) {
+ fmt.Printf("\t%s\n", pc)
+ }
+
+ // We already printed a stack trace for the reader, so now we can
+ // simply exit. Printing a second one with panic or base.Fatalf
+ // would just be noise.
+ os.Exit(1)
+}
+
+// Bool decodes and returns a bool value from the element bitstream.
+func (r *Decoder) Bool() bool {
+ r.Sync(SyncBool)
+ x, err := r.Data.ReadByte()
+ r.checkErr(err)
+ assert(x < 2)
+ return x != 0
+}
+
+// Int64 decodes and returns an int64 value from the element bitstream.
+func (r *Decoder) Int64() int64 {
+ r.Sync(SyncInt64)
+ return r.rawVarint()
+}
+
+// Uint64 decodes and returns a uint64 value from the element bitstream.
+func (r *Decoder) Uint64() uint64 {
+ r.Sync(SyncUint64)
+ return r.rawUvarint()
+}
+
+// Len decodes and returns a non-negative int value from the element bitstream.
+func (r *Decoder) Len() int { x := r.Uint64(); v := int(x); assert(uint64(v) == x); return v }
+
+// Int decodes and returns an int value from the element bitstream.
+func (r *Decoder) Int() int { x := r.Int64(); v := int(x); assert(int64(v) == x); return v }
+
+// Uint decodes and returns a uint value from the element bitstream.
+func (r *Decoder) Uint() uint { x := r.Uint64(); v := uint(x); assert(uint64(v) == x); return v }
+
+// Code decodes a Code value from the element bitstream and returns
+// its ordinal value. It's the caller's responsibility to convert the
+// result to an appropriate Code type.
+//
+// TODO(mdempsky): Ideally this method would have signature "Code[T
+// Code] T" instead, but we don't allow generic methods and the
+// compiler can't depend on generics yet anyway.
+func (r *Decoder) Code(mark SyncMarker) int {
+ r.Sync(mark)
+ return r.Len()
+}
+
+// Reloc decodes a relocation of expected section k from the element
+// bitstream and returns an index to the referenced element.
+func (r *Decoder) Reloc(k RelocKind) Index {
+ r.Sync(SyncUseReloc)
+ return r.rawReloc(k, r.Len())
+}
+
+// String decodes and returns a string value from the element
+// bitstream.
+func (r *Decoder) String() string {
+ r.Sync(SyncString)
+ return r.common.StringIdx(r.Reloc(RelocString))
+}
+
+// Strings decodes and returns a variable-length slice of strings from
+// the element bitstream.
+func (r *Decoder) Strings() []string {
+ res := make([]string, r.Len())
+ for i := range res {
+ res[i] = r.String()
+ }
+ return res
+}
+
+// Value decodes and returns a constant.Value from the element
+// bitstream.
+func (r *Decoder) Value() constant.Value {
+ r.Sync(SyncValue)
+ isComplex := r.Bool()
+ val := r.scalar()
+ if isComplex {
+ val = constant.BinaryOp(val, token.ADD, constant.MakeImag(r.scalar()))
+ }
+ return val
+}
+
+func (r *Decoder) scalar() constant.Value {
+ switch tag := CodeVal(r.Code(SyncVal)); tag {
+ default:
+ panic(fmt.Errorf("unexpected scalar tag: %v", tag))
+
+ case ValBool:
+ return constant.MakeBool(r.Bool())
+ case ValString:
+ return constant.MakeString(r.String())
+ case ValInt64:
+ return constant.MakeInt64(r.Int64())
+ case ValBigInt:
+ return constant.Make(r.bigInt())
+ case ValBigRat:
+ num := r.bigInt()
+ denom := r.bigInt()
+ return constant.Make(new(big.Rat).SetFrac(num, denom))
+ case ValBigFloat:
+ return constant.Make(r.bigFloat())
+ }
+}
+
+func (r *Decoder) bigInt() *big.Int {
+ v := new(big.Int).SetBytes([]byte(r.String()))
+ if r.Bool() {
+ v.Neg(v)
+ }
+ return v
+}
+
+func (r *Decoder) bigFloat() *big.Float {
+ v := new(big.Float).SetPrec(512)
+ assert(v.UnmarshalText([]byte(r.String())) == nil)
+ return v
+}
+
+// @@@ Helpers
+
+// TODO(mdempsky): These should probably be removed. I think they're a
+// smell that the export data format is not yet quite right.
+
+// PeekPkgPath returns the package path for the specified package
+// index.
+func (pr *PkgDecoder) PeekPkgPath(idx Index) string {
+ var path string
+ {
+ r := pr.TempDecoder(RelocPkg, idx, SyncPkgDef)
+ path = r.String()
+ pr.RetireDecoder(&r)
+ }
+ if path == "" {
+ path = pr.pkgPath
+ }
+ return path
+}
+
+// PeekObj returns the package path, object name, and CodeObj for the
+// specified object index.
+func (pr *PkgDecoder) PeekObj(idx Index) (string, string, CodeObj) {
+ var ridx Index
+ var name string
+ var rcode int
+ {
+ r := pr.TempDecoder(RelocName, idx, SyncObject1)
+ r.Sync(SyncSym)
+ r.Sync(SyncPkg)
+ ridx = r.Reloc(RelocPkg)
+ name = r.String()
+ rcode = r.Code(SyncCodeObj)
+ pr.RetireDecoder(&r)
+ }
+
+ path := pr.PeekPkgPath(ridx)
+ assert(name != "")
+
+ tag := CodeObj(rcode)
+
+ return path, name, tag
+}
+
+// Version reports the version of the bitstream.
+func (w *Decoder) Version() Version { return w.common.version }
diff --git a/vendor/golang.org/x/tools/internal/pkgbits/doc.go b/vendor/golang.org/x/tools/internal/pkgbits/doc.go
new file mode 100644
index 00000000..c8a2796b
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/pkgbits/doc.go
@@ -0,0 +1,32 @@
+// Copyright 2022 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Package pkgbits implements low-level coding abstractions for
+// Unified IR's export data format.
+//
+// At a low-level, a package is a collection of bitstream elements.
+// Each element has a "kind" and a dense, non-negative index.
+// Elements can be randomly accessed given their kind and index.
+//
+// Individual elements are sequences of variable-length values (e.g.,
+// integers, booleans, strings, go/constant values, cross-references
+// to other elements). Package pkgbits provides APIs for encoding and
+// decoding these low-level values, but the details of mapping
+// higher-level Go constructs into elements is left to higher-level
+// abstractions.
+//
+// Elements may cross-reference each other with "relocations." For
+// example, an element representing a pointer type has a relocation
+// referring to the element type.
+//
+// Go constructs may be composed as a constellation of multiple
+// elements. For example, a declared function may have one element to
+// describe the object (e.g., its name, type, position), and a
+// separate element to describe its function body. This allows readers
+// some flexibility in efficiently seeking or re-reading data (e.g.,
+// inlining requires re-reading the function body for each inlined
+// call, without needing to re-read the object-level details).
+//
+// This is a copy of internal/pkgbits in the Go implementation.
+package pkgbits
diff --git a/vendor/golang.org/x/tools/internal/pkgbits/encoder.go b/vendor/golang.org/x/tools/internal/pkgbits/encoder.go
new file mode 100644
index 00000000..c17a1239
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/pkgbits/encoder.go
@@ -0,0 +1,392 @@
+// Copyright 2021 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package pkgbits
+
+import (
+ "bytes"
+ "crypto/md5"
+ "encoding/binary"
+ "go/constant"
+ "io"
+ "math/big"
+ "runtime"
+ "strings"
+)
+
+// A PkgEncoder provides methods for encoding a package's Unified IR
+// export data.
+type PkgEncoder struct {
+ // version of the bitstream.
+ version Version
+
+ // elems holds the bitstream for previously encoded elements.
+ elems [numRelocs][]string
+
+ // stringsIdx maps previously encoded strings to their index within
+ // the RelocString section, to allow deduplication. That is,
+ // elems[RelocString][stringsIdx[s]] == s (if present).
+ stringsIdx map[string]Index
+
+ // syncFrames is the number of frames to write at each sync
+ // marker. A negative value means sync markers are omitted.
+ syncFrames int
+}
+
+// SyncMarkers reports whether pw uses sync markers.
+func (pw *PkgEncoder) SyncMarkers() bool { return pw.syncFrames >= 0 }
+
+// NewPkgEncoder returns an initialized PkgEncoder.
+//
+// syncFrames is the number of caller frames that should be serialized
+// at Sync points. Serializing additional frames results in larger
+// export data files, but can help diagnosing desync errors in
+// higher-level Unified IR reader/writer code. If syncFrames is
+// negative, then sync markers are omitted entirely.
+func NewPkgEncoder(version Version, syncFrames int) PkgEncoder {
+ return PkgEncoder{
+ version: version,
+ stringsIdx: make(map[string]Index),
+ syncFrames: syncFrames,
+ }
+}
+
+// DumpTo writes the package's encoded data to out0 and returns the
+// package fingerprint.
+func (pw *PkgEncoder) DumpTo(out0 io.Writer) (fingerprint [8]byte) {
+ h := md5.New()
+ out := io.MultiWriter(out0, h)
+
+ writeUint32 := func(x uint32) {
+ assert(binary.Write(out, binary.LittleEndian, x) == nil)
+ }
+
+ writeUint32(uint32(pw.version))
+
+ if pw.version.Has(Flags) {
+ var flags uint32
+ if pw.SyncMarkers() {
+ flags |= flagSyncMarkers
+ }
+ writeUint32(flags)
+ }
+
+ // Write elemEndsEnds.
+ var sum uint32
+ for _, elems := range &pw.elems {
+ sum += uint32(len(elems))
+ writeUint32(sum)
+ }
+
+ // Write elemEnds.
+ sum = 0
+ for _, elems := range &pw.elems {
+ for _, elem := range elems {
+ sum += uint32(len(elem))
+ writeUint32(sum)
+ }
+ }
+
+ // Write elemData.
+ for _, elems := range &pw.elems {
+ for _, elem := range elems {
+ _, err := io.WriteString(out, elem)
+ assert(err == nil)
+ }
+ }
+
+ // Write fingerprint.
+ copy(fingerprint[:], h.Sum(nil))
+ _, err := out0.Write(fingerprint[:])
+ assert(err == nil)
+
+ return
+}
+
+// StringIdx adds a string value to the strings section, if not
+// already present, and returns its index.
+func (pw *PkgEncoder) StringIdx(s string) Index {
+ if idx, ok := pw.stringsIdx[s]; ok {
+ assert(pw.elems[RelocString][idx] == s)
+ return idx
+ }
+
+ idx := Index(len(pw.elems[RelocString]))
+ pw.elems[RelocString] = append(pw.elems[RelocString], s)
+ pw.stringsIdx[s] = idx
+ return idx
+}
+
+// NewEncoder returns an Encoder for a new element within the given
+// section, and encodes the given SyncMarker as the start of the
+// element bitstream.
+func (pw *PkgEncoder) NewEncoder(k RelocKind, marker SyncMarker) Encoder {
+ e := pw.NewEncoderRaw(k)
+ e.Sync(marker)
+ return e
+}
+
+// NewEncoderRaw returns an Encoder for a new element within the given
+// section.
+//
+// Most callers should use NewEncoder instead.
+func (pw *PkgEncoder) NewEncoderRaw(k RelocKind) Encoder {
+ idx := Index(len(pw.elems[k]))
+ pw.elems[k] = append(pw.elems[k], "") // placeholder
+
+ return Encoder{
+ p: pw,
+ k: k,
+ Idx: idx,
+ }
+}
+
+// An Encoder provides methods for encoding an individual element's
+// bitstream data.
+type Encoder struct {
+ p *PkgEncoder
+
+ Relocs []RelocEnt
+ RelocMap map[RelocEnt]uint32
+ Data bytes.Buffer // accumulated element bitstream data
+
+ encodingRelocHeader bool
+
+ k RelocKind
+ Idx Index // index within relocation section
+}
+
+// Flush finalizes the element's bitstream and returns its Index.
+func (w *Encoder) Flush() Index {
+ var sb strings.Builder
+
+ // Backup the data so we write the relocations at the front.
+ var tmp bytes.Buffer
+ io.Copy(&tmp, &w.Data)
+
+ // TODO(mdempsky): Consider writing these out separately so they're
+ // easier to strip, along with function bodies, so that we can prune
+ // down to just the data that's relevant to go/types.
+ if w.encodingRelocHeader {
+ panic("encodingRelocHeader already true; recursive flush?")
+ }
+ w.encodingRelocHeader = true
+ w.Sync(SyncRelocs)
+ w.Len(len(w.Relocs))
+ for _, rEnt := range w.Relocs {
+ w.Sync(SyncReloc)
+ w.Len(int(rEnt.Kind))
+ w.Len(int(rEnt.Idx))
+ }
+
+ io.Copy(&sb, &w.Data)
+ io.Copy(&sb, &tmp)
+ w.p.elems[w.k][w.Idx] = sb.String()
+
+ return w.Idx
+}
+
+func (w *Encoder) checkErr(err error) {
+ if err != nil {
+ panicf("unexpected encoding error: %v", err)
+ }
+}
+
+func (w *Encoder) rawUvarint(x uint64) {
+ var buf [binary.MaxVarintLen64]byte
+ n := binary.PutUvarint(buf[:], x)
+ _, err := w.Data.Write(buf[:n])
+ w.checkErr(err)
+}
+
+func (w *Encoder) rawVarint(x int64) {
+ // Zig-zag encode.
+ ux := uint64(x) << 1
+ if x < 0 {
+ ux = ^ux
+ }
+
+ w.rawUvarint(ux)
+}
+
+func (w *Encoder) rawReloc(r RelocKind, idx Index) int {
+ e := RelocEnt{r, idx}
+ if w.RelocMap != nil {
+ if i, ok := w.RelocMap[e]; ok {
+ return int(i)
+ }
+ } else {
+ w.RelocMap = make(map[RelocEnt]uint32)
+ }
+
+ i := len(w.Relocs)
+ w.RelocMap[e] = uint32(i)
+ w.Relocs = append(w.Relocs, e)
+ return i
+}
+
+func (w *Encoder) Sync(m SyncMarker) {
+ if !w.p.SyncMarkers() {
+ return
+ }
+
+ // Writing out stack frame string references requires working
+ // relocations, but writing out the relocations themselves involves
+ // sync markers. To prevent infinite recursion, we simply trim the
+ // stack frame for sync markers within the relocation header.
+ var frames []string
+ if !w.encodingRelocHeader && w.p.syncFrames > 0 {
+ pcs := make([]uintptr, w.p.syncFrames)
+ n := runtime.Callers(2, pcs)
+ frames = fmtFrames(pcs[:n]...)
+ }
+
+ // TODO(mdempsky): Save space by writing out stack frames as a
+ // linked list so we can share common stack frames.
+ w.rawUvarint(uint64(m))
+ w.rawUvarint(uint64(len(frames)))
+ for _, frame := range frames {
+ w.rawUvarint(uint64(w.rawReloc(RelocString, w.p.StringIdx(frame))))
+ }
+}
+
+// Bool encodes and writes a bool value into the element bitstream,
+// and then returns the bool value.
+//
+// For simple, 2-alternative encodings, the idiomatic way to call Bool
+// is something like:
+//
+// if w.Bool(x != 0) {
+// // alternative #1
+// } else {
+// // alternative #2
+// }
+//
+// For multi-alternative encodings, use Code instead.
+func (w *Encoder) Bool(b bool) bool {
+ w.Sync(SyncBool)
+ var x byte
+ if b {
+ x = 1
+ }
+ err := w.Data.WriteByte(x)
+ w.checkErr(err)
+ return b
+}
+
+// Int64 encodes and writes an int64 value into the element bitstream.
+func (w *Encoder) Int64(x int64) {
+ w.Sync(SyncInt64)
+ w.rawVarint(x)
+}
+
+// Uint64 encodes and writes a uint64 value into the element bitstream.
+func (w *Encoder) Uint64(x uint64) {
+ w.Sync(SyncUint64)
+ w.rawUvarint(x)
+}
+
+// Len encodes and writes a non-negative int value into the element bitstream.
+func (w *Encoder) Len(x int) { assert(x >= 0); w.Uint64(uint64(x)) }
+
+// Int encodes and writes an int value into the element bitstream.
+func (w *Encoder) Int(x int) { w.Int64(int64(x)) }
+
+// Uint encodes and writes a uint value into the element bitstream.
+func (w *Encoder) Uint(x uint) { w.Uint64(uint64(x)) }
+
+// Reloc encodes and writes a relocation for the given (section,
+// index) pair into the element bitstream.
+//
+// Note: Only the index is formally written into the element
+// bitstream, so bitstream decoders must know from context which
+// section an encoded relocation refers to.
+func (w *Encoder) Reloc(r RelocKind, idx Index) {
+ w.Sync(SyncUseReloc)
+ w.Len(w.rawReloc(r, idx))
+}
+
+// Code encodes and writes a Code value into the element bitstream.
+func (w *Encoder) Code(c Code) {
+ w.Sync(c.Marker())
+ w.Len(c.Value())
+}
+
+// String encodes and writes a string value into the element
+// bitstream.
+//
+// Internally, strings are deduplicated by adding them to the strings
+// section (if not already present), and then writing a relocation
+// into the element bitstream.
+func (w *Encoder) String(s string) {
+ w.StringRef(w.p.StringIdx(s))
+}
+
+// StringRef writes a reference to the given index, which must be a
+// previously encoded string value.
+func (w *Encoder) StringRef(idx Index) {
+ w.Sync(SyncString)
+ w.Reloc(RelocString, idx)
+}
+
+// Strings encodes and writes a variable-length slice of strings into
+// the element bitstream.
+func (w *Encoder) Strings(ss []string) {
+ w.Len(len(ss))
+ for _, s := range ss {
+ w.String(s)
+ }
+}
+
+// Value encodes and writes a constant.Value into the element
+// bitstream.
+func (w *Encoder) Value(val constant.Value) {
+ w.Sync(SyncValue)
+ if w.Bool(val.Kind() == constant.Complex) {
+ w.scalar(constant.Real(val))
+ w.scalar(constant.Imag(val))
+ } else {
+ w.scalar(val)
+ }
+}
+
+func (w *Encoder) scalar(val constant.Value) {
+ switch v := constant.Val(val).(type) {
+ default:
+ panicf("unhandled %v (%v)", val, val.Kind())
+ case bool:
+ w.Code(ValBool)
+ w.Bool(v)
+ case string:
+ w.Code(ValString)
+ w.String(v)
+ case int64:
+ w.Code(ValInt64)
+ w.Int64(v)
+ case *big.Int:
+ w.Code(ValBigInt)
+ w.bigInt(v)
+ case *big.Rat:
+ w.Code(ValBigRat)
+ w.bigInt(v.Num())
+ w.bigInt(v.Denom())
+ case *big.Float:
+ w.Code(ValBigFloat)
+ w.bigFloat(v)
+ }
+}
+
+func (w *Encoder) bigInt(v *big.Int) {
+ b := v.Bytes()
+ w.String(string(b)) // TODO: More efficient encoding.
+ w.Bool(v.Sign() < 0)
+}
+
+func (w *Encoder) bigFloat(v *big.Float) {
+ b := v.Append(nil, 'p', -1)
+ w.String(string(b)) // TODO: More efficient encoding.
+}
+
+// Version reports the version of the bitstream.
+func (w *Encoder) Version() Version { return w.p.version }
diff --git a/vendor/golang.org/x/tools/internal/pkgbits/flags.go b/vendor/golang.org/x/tools/internal/pkgbits/flags.go
new file mode 100644
index 00000000..65422274
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/pkgbits/flags.go
@@ -0,0 +1,9 @@
+// Copyright 2022 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package pkgbits
+
+const (
+ flagSyncMarkers = 1 << iota // file format contains sync markers
+)
diff --git a/vendor/golang.org/x/tools/internal/pkgbits/reloc.go b/vendor/golang.org/x/tools/internal/pkgbits/reloc.go
new file mode 100644
index 00000000..fcdfb97c
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/pkgbits/reloc.go
@@ -0,0 +1,42 @@
+// Copyright 2021 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package pkgbits
+
+// A RelocKind indicates a particular section within a unified IR export.
+type RelocKind int32
+
+// An Index represents a bitstream element index within a particular
+// section.
+type Index int32
+
+// A relocEnt (relocation entry) is an entry in an element's local
+// reference table.
+//
+// TODO(mdempsky): Rename this too.
+type RelocEnt struct {
+ Kind RelocKind
+ Idx Index
+}
+
+// Reserved indices within the meta relocation section.
+const (
+ PublicRootIdx Index = 0
+ PrivateRootIdx Index = 1
+)
+
+const (
+ RelocString RelocKind = iota
+ RelocMeta
+ RelocPosBase
+ RelocPkg
+ RelocName
+ RelocType
+ RelocObj
+ RelocObjExt
+ RelocObjDict
+ RelocBody
+
+ numRelocs = iota
+)
diff --git a/vendor/golang.org/x/tools/internal/pkgbits/support.go b/vendor/golang.org/x/tools/internal/pkgbits/support.go
new file mode 100644
index 00000000..50534a29
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/pkgbits/support.go
@@ -0,0 +1,17 @@
+// Copyright 2022 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package pkgbits
+
+import "fmt"
+
+func assert(b bool) {
+ if !b {
+ panic("assertion failed")
+ }
+}
+
+func panicf(format string, args ...any) {
+ panic(fmt.Errorf(format, args...))
+}
diff --git a/vendor/golang.org/x/tools/internal/pkgbits/sync.go b/vendor/golang.org/x/tools/internal/pkgbits/sync.go
new file mode 100644
index 00000000..1520b73a
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/pkgbits/sync.go
@@ -0,0 +1,136 @@
+// Copyright 2021 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package pkgbits
+
+import (
+ "fmt"
+ "runtime"
+ "strings"
+)
+
+// fmtFrames formats a backtrace for reporting reader/writer desyncs.
+func fmtFrames(pcs ...uintptr) []string {
+ res := make([]string, 0, len(pcs))
+ walkFrames(pcs, func(file string, line int, name string, offset uintptr) {
+ // Trim package from function name. It's just redundant noise.
+ name = strings.TrimPrefix(name, "cmd/compile/internal/noder.")
+
+ res = append(res, fmt.Sprintf("%s:%v: %s +0x%v", file, line, name, offset))
+ })
+ return res
+}
+
+type frameVisitor func(file string, line int, name string, offset uintptr)
+
+// walkFrames calls visit for each call frame represented by pcs.
+//
+// pcs should be a slice of PCs, as returned by runtime.Callers.
+func walkFrames(pcs []uintptr, visit frameVisitor) {
+ if len(pcs) == 0 {
+ return
+ }
+
+ frames := runtime.CallersFrames(pcs)
+ for {
+ frame, more := frames.Next()
+ visit(frame.File, frame.Line, frame.Function, frame.PC-frame.Entry)
+ if !more {
+ return
+ }
+ }
+}
+
+// SyncMarker is an enum type that represents markers that may be
+// written to export data to ensure the reader and writer stay
+// synchronized.
+type SyncMarker int
+
+//go:generate stringer -type=SyncMarker -trimprefix=Sync
+
+const (
+ _ SyncMarker = iota
+
+ // Public markers (known to go/types importers).
+
+ // Low-level coding markers.
+ SyncEOF
+ SyncBool
+ SyncInt64
+ SyncUint64
+ SyncString
+ SyncValue
+ SyncVal
+ SyncRelocs
+ SyncReloc
+ SyncUseReloc
+
+ // Higher-level object and type markers.
+ SyncPublic
+ SyncPos
+ SyncPosBase
+ SyncObject
+ SyncObject1
+ SyncPkg
+ SyncPkgDef
+ SyncMethod
+ SyncType
+ SyncTypeIdx
+ SyncTypeParamNames
+ SyncSignature
+ SyncParams
+ SyncParam
+ SyncCodeObj
+ SyncSym
+ SyncLocalIdent
+ SyncSelector
+
+ // Private markers (only known to cmd/compile).
+ SyncPrivate
+
+ SyncFuncExt
+ SyncVarExt
+ SyncTypeExt
+ SyncPragma
+
+ SyncExprList
+ SyncExprs
+ SyncExpr
+ SyncExprType
+ SyncAssign
+ SyncOp
+ SyncFuncLit
+ SyncCompLit
+
+ SyncDecl
+ SyncFuncBody
+ SyncOpenScope
+ SyncCloseScope
+ SyncCloseAnotherScope
+ SyncDeclNames
+ SyncDeclName
+
+ SyncStmts
+ SyncBlockStmt
+ SyncIfStmt
+ SyncForStmt
+ SyncSwitchStmt
+ SyncRangeStmt
+ SyncCaseClause
+ SyncCommClause
+ SyncSelectStmt
+ SyncDecls
+ SyncLabeledStmt
+ SyncUseObjLocal
+ SyncAddLocal
+ SyncLinkname
+ SyncStmt1
+ SyncStmtsEnd
+ SyncLabel
+ SyncOptLabel
+
+ SyncMultiExpr
+ SyncRType
+ SyncConvRTTI
+)
diff --git a/vendor/golang.org/x/tools/internal/pkgbits/syncmarker_string.go b/vendor/golang.org/x/tools/internal/pkgbits/syncmarker_string.go
new file mode 100644
index 00000000..582ad56d
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/pkgbits/syncmarker_string.go
@@ -0,0 +1,92 @@
+// Code generated by "stringer -type=SyncMarker -trimprefix=Sync"; DO NOT EDIT.
+
+package pkgbits
+
+import "strconv"
+
+func _() {
+ // An "invalid array index" compiler error signifies that the constant values have changed.
+ // Re-run the stringer command to generate them again.
+ var x [1]struct{}
+ _ = x[SyncEOF-1]
+ _ = x[SyncBool-2]
+ _ = x[SyncInt64-3]
+ _ = x[SyncUint64-4]
+ _ = x[SyncString-5]
+ _ = x[SyncValue-6]
+ _ = x[SyncVal-7]
+ _ = x[SyncRelocs-8]
+ _ = x[SyncReloc-9]
+ _ = x[SyncUseReloc-10]
+ _ = x[SyncPublic-11]
+ _ = x[SyncPos-12]
+ _ = x[SyncPosBase-13]
+ _ = x[SyncObject-14]
+ _ = x[SyncObject1-15]
+ _ = x[SyncPkg-16]
+ _ = x[SyncPkgDef-17]
+ _ = x[SyncMethod-18]
+ _ = x[SyncType-19]
+ _ = x[SyncTypeIdx-20]
+ _ = x[SyncTypeParamNames-21]
+ _ = x[SyncSignature-22]
+ _ = x[SyncParams-23]
+ _ = x[SyncParam-24]
+ _ = x[SyncCodeObj-25]
+ _ = x[SyncSym-26]
+ _ = x[SyncLocalIdent-27]
+ _ = x[SyncSelector-28]
+ _ = x[SyncPrivate-29]
+ _ = x[SyncFuncExt-30]
+ _ = x[SyncVarExt-31]
+ _ = x[SyncTypeExt-32]
+ _ = x[SyncPragma-33]
+ _ = x[SyncExprList-34]
+ _ = x[SyncExprs-35]
+ _ = x[SyncExpr-36]
+ _ = x[SyncExprType-37]
+ _ = x[SyncAssign-38]
+ _ = x[SyncOp-39]
+ _ = x[SyncFuncLit-40]
+ _ = x[SyncCompLit-41]
+ _ = x[SyncDecl-42]
+ _ = x[SyncFuncBody-43]
+ _ = x[SyncOpenScope-44]
+ _ = x[SyncCloseScope-45]
+ _ = x[SyncCloseAnotherScope-46]
+ _ = x[SyncDeclNames-47]
+ _ = x[SyncDeclName-48]
+ _ = x[SyncStmts-49]
+ _ = x[SyncBlockStmt-50]
+ _ = x[SyncIfStmt-51]
+ _ = x[SyncForStmt-52]
+ _ = x[SyncSwitchStmt-53]
+ _ = x[SyncRangeStmt-54]
+ _ = x[SyncCaseClause-55]
+ _ = x[SyncCommClause-56]
+ _ = x[SyncSelectStmt-57]
+ _ = x[SyncDecls-58]
+ _ = x[SyncLabeledStmt-59]
+ _ = x[SyncUseObjLocal-60]
+ _ = x[SyncAddLocal-61]
+ _ = x[SyncLinkname-62]
+ _ = x[SyncStmt1-63]
+ _ = x[SyncStmtsEnd-64]
+ _ = x[SyncLabel-65]
+ _ = x[SyncOptLabel-66]
+ _ = x[SyncMultiExpr-67]
+ _ = x[SyncRType-68]
+ _ = x[SyncConvRTTI-69]
+}
+
+const _SyncMarker_name = "EOFBoolInt64Uint64StringValueValRelocsRelocUseRelocPublicPosPosBaseObjectObject1PkgPkgDefMethodTypeTypeIdxTypeParamNamesSignatureParamsParamCodeObjSymLocalIdentSelectorPrivateFuncExtVarExtTypeExtPragmaExprListExprsExprExprTypeAssignOpFuncLitCompLitDeclFuncBodyOpenScopeCloseScopeCloseAnotherScopeDeclNamesDeclNameStmtsBlockStmtIfStmtForStmtSwitchStmtRangeStmtCaseClauseCommClauseSelectStmtDeclsLabeledStmtUseObjLocalAddLocalLinknameStmt1StmtsEndLabelOptLabelMultiExprRTypeConvRTTI"
+
+var _SyncMarker_index = [...]uint16{0, 3, 7, 12, 18, 24, 29, 32, 38, 43, 51, 57, 60, 67, 73, 80, 83, 89, 95, 99, 106, 120, 129, 135, 140, 147, 150, 160, 168, 175, 182, 188, 195, 201, 209, 214, 218, 226, 232, 234, 241, 248, 252, 260, 269, 279, 296, 305, 313, 318, 327, 333, 340, 350, 359, 369, 379, 389, 394, 405, 416, 424, 432, 437, 445, 450, 458, 467, 472, 480}
+
+func (i SyncMarker) String() string {
+ i -= 1
+ if i < 0 || i >= SyncMarker(len(_SyncMarker_index)-1) {
+ return "SyncMarker(" + strconv.FormatInt(int64(i+1), 10) + ")"
+ }
+ return _SyncMarker_name[_SyncMarker_index[i]:_SyncMarker_index[i+1]]
+}
diff --git a/vendor/golang.org/x/tools/internal/pkgbits/version.go b/vendor/golang.org/x/tools/internal/pkgbits/version.go
new file mode 100644
index 00000000..53af9df2
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/pkgbits/version.go
@@ -0,0 +1,85 @@
+// Copyright 2024 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package pkgbits
+
+// Version indicates a version of a unified IR bitstream.
+// Each Version indicates the addition, removal, or change of
+// new data in the bitstream.
+//
+// These are serialized to disk and the interpretation remains fixed.
+type Version uint32
+
+const (
+ // V0: initial prototype.
+ //
+ // All data that is not assigned a Field is in version V0
+ // and has not been deprecated.
+ V0 Version = iota
+
+ // V1: adds the Flags uint32 word
+ V1
+
+ // V2: removes unused legacy fields and supports type parameters for aliases.
+ // - remove the legacy "has init" bool from the public root
+ // - remove obj's "derived func instance" bool
+ // - add a TypeParamNames field to ObjAlias
+ // - remove derived info "needed" bool
+ V2
+
+ numVersions = iota
+)
+
+// Field denotes a unit of data in the serialized unified IR bitstream.
+// It is conceptually a like field in a structure.
+//
+// We only really need Fields when the data may or may not be present
+// in a stream based on the Version of the bitstream.
+//
+// Unlike much of pkgbits, Fields are not serialized and
+// can change values as needed.
+type Field int
+
+const (
+ // Flags in a uint32 in the header of a bitstream
+ // that is used to indicate whether optional features are enabled.
+ Flags Field = iota
+
+ // Deprecated: HasInit was a bool indicating whether a package
+ // has any init functions.
+ HasInit
+
+ // Deprecated: DerivedFuncInstance was a bool indicating
+ // whether an object was a function instance.
+ DerivedFuncInstance
+
+ // ObjAlias has a list of TypeParamNames.
+ AliasTypeParamNames
+
+ // Deprecated: DerivedInfoNeeded was a bool indicating
+ // whether a type was a derived type.
+ DerivedInfoNeeded
+
+ numFields = iota
+)
+
+// introduced is the version a field was added.
+var introduced = [numFields]Version{
+ Flags: V1,
+ AliasTypeParamNames: V2,
+}
+
+// removed is the version a field was removed in or 0 for fields
+// that have not yet been deprecated.
+// (So removed[f]-1 is the last version it is included in.)
+var removed = [numFields]Version{
+ HasInit: V2,
+ DerivedFuncInstance: V2,
+ DerivedInfoNeeded: V2,
+}
+
+// Has reports whether field f is present in a bitstream at version v.
+func (v Version) Has(f Field) bool {
+ return introduced[f] <= v && (v < removed[f] || removed[f] == V0)
+}
diff --git a/vendor/golang.org/x/tools/internal/stdlib/manifest.go b/vendor/golang.org/x/tools/internal/stdlib/manifest.go
index fd689207..cdaac9ab 100644
--- a/vendor/golang.org/x/tools/internal/stdlib/manifest.go
+++ b/vendor/golang.org/x/tools/internal/stdlib/manifest.go
@@ -23,6 +23,7 @@ var PackageSymbols = map[string][]Symbol{
{"ErrWriteAfterClose", Var, 0},
{"ErrWriteTooLong", Var, 0},
{"FileInfoHeader", Func, 1},
+ {"FileInfoNames", Type, 23},
{"Format", Type, 10},
{"FormatGNU", Const, 10},
{"FormatPAX", Const, 10},
@@ -820,6 +821,7 @@ var PackageSymbols = map[string][]Symbol{
{"(*ConnectionState).ExportKeyingMaterial", Method, 11},
{"(*Dialer).Dial", Method, 15},
{"(*Dialer).DialContext", Method, 15},
+ {"(*ECHRejectionError).Error", Method, 23},
{"(*QUICConn).Close", Method, 21},
{"(*QUICConn).ConnectionState", Method, 21},
{"(*QUICConn).HandleData", Method, 21},
@@ -827,6 +829,7 @@ var PackageSymbols = map[string][]Symbol{
{"(*QUICConn).SendSessionTicket", Method, 21},
{"(*QUICConn).SetTransportParameters", Method, 21},
{"(*QUICConn).Start", Method, 21},
+ {"(*QUICConn).StoreSession", Method, 23},
{"(*SessionState).Bytes", Method, 21},
{"(AlertError).Error", Method, 21},
{"(ClientAuthType).String", Method, 15},
@@ -877,6 +880,8 @@ var PackageSymbols = map[string][]Symbol{
{"Config.ClientSessionCache", Field, 3},
{"Config.CurvePreferences", Field, 3},
{"Config.DynamicRecordSizingDisabled", Field, 7},
+ {"Config.EncryptedClientHelloConfigList", Field, 23},
+ {"Config.EncryptedClientHelloRejectionVerify", Field, 23},
{"Config.GetCertificate", Field, 4},
{"Config.GetClientCertificate", Field, 8},
{"Config.GetConfigForClient", Field, 8},
@@ -902,6 +907,7 @@ var PackageSymbols = map[string][]Symbol{
{"ConnectionState", Type, 0},
{"ConnectionState.CipherSuite", Field, 0},
{"ConnectionState.DidResume", Field, 1},
+ {"ConnectionState.ECHAccepted", Field, 23},
{"ConnectionState.HandshakeComplete", Field, 0},
{"ConnectionState.NegotiatedProtocol", Field, 0},
{"ConnectionState.NegotiatedProtocolIsMutual", Field, 0},
@@ -925,6 +931,8 @@ var PackageSymbols = map[string][]Symbol{
{"ECDSAWithP384AndSHA384", Const, 8},
{"ECDSAWithP521AndSHA512", Const, 8},
{"ECDSAWithSHA1", Const, 10},
+ {"ECHRejectionError", Type, 23},
+ {"ECHRejectionError.RetryConfigList", Field, 23},
{"Ed25519", Const, 13},
{"InsecureCipherSuites", Func, 14},
{"Listen", Func, 0},
@@ -943,6 +951,7 @@ var PackageSymbols = map[string][]Symbol{
{"ParseSessionState", Func, 21},
{"QUICClient", Func, 21},
{"QUICConfig", Type, 21},
+ {"QUICConfig.EnableSessionEvents", Field, 23},
{"QUICConfig.TLSConfig", Field, 21},
{"QUICConn", Type, 21},
{"QUICEncryptionLevel", Type, 21},
@@ -954,16 +963,20 @@ var PackageSymbols = map[string][]Symbol{
{"QUICEvent.Data", Field, 21},
{"QUICEvent.Kind", Field, 21},
{"QUICEvent.Level", Field, 21},
+ {"QUICEvent.SessionState", Field, 23},
{"QUICEvent.Suite", Field, 21},
{"QUICEventKind", Type, 21},
{"QUICHandshakeDone", Const, 21},
{"QUICNoEvent", Const, 21},
{"QUICRejectedEarlyData", Const, 21},
+ {"QUICResumeSession", Const, 23},
{"QUICServer", Func, 21},
{"QUICSessionTicketOptions", Type, 21},
{"QUICSessionTicketOptions.EarlyData", Field, 21},
+ {"QUICSessionTicketOptions.Extra", Field, 23},
{"QUICSetReadSecret", Const, 21},
{"QUICSetWriteSecret", Const, 21},
+ {"QUICStoreSession", Const, 23},
{"QUICTransportParameters", Const, 21},
{"QUICTransportParametersRequired", Const, 21},
{"QUICWriteData", Const, 21},
@@ -1036,6 +1049,8 @@ var PackageSymbols = map[string][]Symbol{
{"(*Certificate).Verify", Method, 0},
{"(*Certificate).VerifyHostname", Method, 0},
{"(*CertificateRequest).CheckSignature", Method, 5},
+ {"(*OID).UnmarshalBinary", Method, 23},
+ {"(*OID).UnmarshalText", Method, 23},
{"(*RevocationList).CheckSignatureFrom", Method, 19},
{"(CertificateInvalidError).Error", Method, 0},
{"(ConstraintViolationError).Error", Method, 0},
@@ -1043,6 +1058,8 @@ var PackageSymbols = map[string][]Symbol{
{"(InsecureAlgorithmError).Error", Method, 6},
{"(OID).Equal", Method, 22},
{"(OID).EqualASN1OID", Method, 22},
+ {"(OID).MarshalBinary", Method, 23},
+ {"(OID).MarshalText", Method, 23},
{"(OID).String", Method, 22},
{"(PublicKeyAlgorithm).String", Method, 10},
{"(SignatureAlgorithm).String", Method, 6},
@@ -1196,6 +1213,7 @@ var PackageSymbols = map[string][]Symbol{
{"ParseCertificates", Func, 0},
{"ParseDERCRL", Func, 0},
{"ParseECPrivateKey", Func, 1},
+ {"ParseOID", Func, 23},
{"ParsePKCS1PrivateKey", Func, 0},
{"ParsePKCS1PublicKey", Func, 10},
{"ParsePKCS8PrivateKey", Func, 0},
@@ -2541,6 +2559,7 @@ var PackageSymbols = map[string][]Symbol{
{"PT_NOTE", Const, 0},
{"PT_NULL", Const, 0},
{"PT_OPENBSD_BOOTDATA", Const, 16},
+ {"PT_OPENBSD_NOBTCFI", Const, 23},
{"PT_OPENBSD_RANDOMIZE", Const, 16},
{"PT_OPENBSD_WXNEEDED", Const, 16},
{"PT_PAX_FLAGS", Const, 16},
@@ -3620,13 +3639,16 @@ var PackageSymbols = map[string][]Symbol{
{"STT_COMMON", Const, 0},
{"STT_FILE", Const, 0},
{"STT_FUNC", Const, 0},
+ {"STT_GNU_IFUNC", Const, 23},
{"STT_HIOS", Const, 0},
{"STT_HIPROC", Const, 0},
{"STT_LOOS", Const, 0},
{"STT_LOPROC", Const, 0},
{"STT_NOTYPE", Const, 0},
{"STT_OBJECT", Const, 0},
+ {"STT_RELC", Const, 23},
{"STT_SECTION", Const, 0},
+ {"STT_SRELC", Const, 23},
{"STT_TLS", Const, 0},
{"STV_DEFAULT", Const, 0},
{"STV_HIDDEN", Const, 0},
@@ -4544,11 +4566,14 @@ var PackageSymbols = map[string][]Symbol{
{"URLEncoding", Var, 0},
},
"encoding/binary": {
+ {"Append", Func, 23},
{"AppendByteOrder", Type, 19},
{"AppendUvarint", Func, 19},
{"AppendVarint", Func, 19},
{"BigEndian", Var, 0},
{"ByteOrder", Type, 0},
+ {"Decode", Func, 23},
+ {"Encode", Func, 23},
{"LittleEndian", Var, 0},
{"MaxVarintLen16", Const, 0},
{"MaxVarintLen32", Const, 0},
@@ -5308,6 +5333,7 @@ var PackageSymbols = map[string][]Symbol{
{"ParenExpr.Rparen", Field, 0},
{"ParenExpr.X", Field, 0},
{"Pkg", Const, 0},
+ {"Preorder", Func, 23},
{"Print", Func, 0},
{"RECV", Const, 0},
{"RangeStmt", Type, 0},
@@ -5898,7 +5924,12 @@ var PackageSymbols = map[string][]Symbol{
},
"go/types": {
{"(*Alias).Obj", Method, 22},
+ {"(*Alias).Origin", Method, 23},
+ {"(*Alias).Rhs", Method, 23},
+ {"(*Alias).SetTypeParams", Method, 23},
{"(*Alias).String", Method, 22},
+ {"(*Alias).TypeArgs", Method, 23},
+ {"(*Alias).TypeParams", Method, 23},
{"(*Alias).Underlying", Method, 22},
{"(*ArgumentError).Error", Method, 18},
{"(*ArgumentError).Unwrap", Method, 18},
@@ -5943,6 +5974,7 @@ var PackageSymbols = map[string][]Symbol{
{"(*Func).Pkg", Method, 5},
{"(*Func).Pos", Method, 5},
{"(*Func).Scope", Method, 5},
+ {"(*Func).Signature", Method, 23},
{"(*Func).String", Method, 5},
{"(*Func).Type", Method, 5},
{"(*Info).ObjectOf", Method, 5},
@@ -6992,6 +7024,12 @@ var PackageSymbols = map[string][]Symbol{
{"TempFile", Func, 0},
{"WriteFile", Func, 0},
},
+ "iter": {
+ {"Pull", Func, 23},
+ {"Pull2", Func, 23},
+ {"Seq", Type, 23},
+ {"Seq2", Type, 23},
+ },
"log": {
{"(*Logger).Fatal", Method, 0},
{"(*Logger).Fatalf", Method, 0},
@@ -7222,11 +7260,16 @@ var PackageSymbols = map[string][]Symbol{
{"Writer", Type, 0},
},
"maps": {
+ {"All", Func, 23},
{"Clone", Func, 21},
+ {"Collect", Func, 23},
{"Copy", Func, 21},
{"DeleteFunc", Func, 21},
{"Equal", Func, 21},
{"EqualFunc", Func, 21},
+ {"Insert", Func, 23},
+ {"Keys", Func, 23},
+ {"Values", Func, 23},
},
"math": {
{"Abs", Func, 0},
@@ -7617,6 +7660,7 @@ var PackageSymbols = map[string][]Symbol{
},
"math/rand/v2": {
{"(*ChaCha8).MarshalBinary", Method, 22},
+ {"(*ChaCha8).Read", Method, 23},
{"(*ChaCha8).Seed", Method, 22},
{"(*ChaCha8).Uint64", Method, 22},
{"(*ChaCha8).UnmarshalBinary", Method, 22},
@@ -7636,6 +7680,7 @@ var PackageSymbols = map[string][]Symbol{
{"(*Rand).NormFloat64", Method, 22},
{"(*Rand).Perm", Method, 22},
{"(*Rand).Shuffle", Method, 22},
+ {"(*Rand).Uint", Method, 23},
{"(*Rand).Uint32", Method, 22},
{"(*Rand).Uint32N", Method, 22},
{"(*Rand).Uint64", Method, 22},
@@ -7663,6 +7708,7 @@ var PackageSymbols = map[string][]Symbol{
{"Rand", Type, 22},
{"Shuffle", Func, 22},
{"Source", Type, 22},
+ {"Uint", Func, 23},
{"Uint32", Func, 22},
{"Uint32N", Func, 22},
{"Uint64", Func, 22},
@@ -7743,6 +7789,7 @@ var PackageSymbols = map[string][]Symbol{
{"(*DNSError).Error", Method, 0},
{"(*DNSError).Temporary", Method, 0},
{"(*DNSError).Timeout", Method, 0},
+ {"(*DNSError).Unwrap", Method, 23},
{"(*Dialer).Dial", Method, 1},
{"(*Dialer).DialContext", Method, 7},
{"(*Dialer).MultipathTCP", Method, 21},
@@ -7809,6 +7856,7 @@ var PackageSymbols = map[string][]Symbol{
{"(*TCPConn).RemoteAddr", Method, 0},
{"(*TCPConn).SetDeadline", Method, 0},
{"(*TCPConn).SetKeepAlive", Method, 0},
+ {"(*TCPConn).SetKeepAliveConfig", Method, 23},
{"(*TCPConn).SetKeepAlivePeriod", Method, 2},
{"(*TCPConn).SetLinger", Method, 0},
{"(*TCPConn).SetNoDelay", Method, 0},
@@ -7922,6 +7970,7 @@ var PackageSymbols = map[string][]Symbol{
{"DNSError.IsTimeout", Field, 0},
{"DNSError.Name", Field, 0},
{"DNSError.Server", Field, 0},
+ {"DNSError.UnwrapErr", Field, 23},
{"DefaultResolver", Var, 8},
{"Dial", Func, 0},
{"DialIP", Func, 0},
@@ -7937,6 +7986,7 @@ var PackageSymbols = map[string][]Symbol{
{"Dialer.DualStack", Field, 2},
{"Dialer.FallbackDelay", Field, 5},
{"Dialer.KeepAlive", Field, 3},
+ {"Dialer.KeepAliveConfig", Field, 23},
{"Dialer.LocalAddr", Field, 1},
{"Dialer.Resolver", Field, 8},
{"Dialer.Timeout", Field, 1},
@@ -7989,10 +8039,16 @@ var PackageSymbols = map[string][]Symbol{
{"Interfaces", Func, 0},
{"InvalidAddrError", Type, 0},
{"JoinHostPort", Func, 0},
+ {"KeepAliveConfig", Type, 23},
+ {"KeepAliveConfig.Count", Field, 23},
+ {"KeepAliveConfig.Enable", Field, 23},
+ {"KeepAliveConfig.Idle", Field, 23},
+ {"KeepAliveConfig.Interval", Field, 23},
{"Listen", Func, 0},
{"ListenConfig", Type, 11},
{"ListenConfig.Control", Field, 11},
{"ListenConfig.KeepAlive", Field, 13},
+ {"ListenConfig.KeepAliveConfig", Field, 23},
{"ListenIP", Func, 0},
{"ListenMulticastUDP", Func, 0},
{"ListenPacket", Func, 0},
@@ -8081,6 +8137,7 @@ var PackageSymbols = map[string][]Symbol{
{"(*Request).Context", Method, 7},
{"(*Request).Cookie", Method, 0},
{"(*Request).Cookies", Method, 0},
+ {"(*Request).CookiesNamed", Method, 23},
{"(*Request).FormFile", Method, 0},
{"(*Request).FormValue", Method, 0},
{"(*Request).MultipartReader", Method, 0},
@@ -8148,7 +8205,9 @@ var PackageSymbols = map[string][]Symbol{
{"Cookie.HttpOnly", Field, 0},
{"Cookie.MaxAge", Field, 0},
{"Cookie.Name", Field, 0},
+ {"Cookie.Partitioned", Field, 23},
{"Cookie.Path", Field, 0},
+ {"Cookie.Quoted", Field, 23},
{"Cookie.Raw", Field, 0},
{"Cookie.RawExpires", Field, 0},
{"Cookie.SameSite", Field, 11},
@@ -8225,7 +8284,9 @@ var PackageSymbols = map[string][]Symbol{
{"NoBody", Var, 8},
{"NotFound", Func, 0},
{"NotFoundHandler", Func, 0},
+ {"ParseCookie", Func, 23},
{"ParseHTTPVersion", Func, 0},
+ {"ParseSetCookie", Func, 23},
{"ParseTime", Func, 1},
{"Post", Func, 0},
{"PostForm", Func, 0},
@@ -8252,6 +8313,7 @@ var PackageSymbols = map[string][]Symbol{
{"Request.Host", Field, 0},
{"Request.Method", Field, 0},
{"Request.MultipartForm", Field, 0},
+ {"Request.Pattern", Field, 23},
{"Request.PostForm", Field, 1},
{"Request.Proto", Field, 0},
{"Request.ProtoMajor", Field, 0},
@@ -8453,6 +8515,7 @@ var PackageSymbols = map[string][]Symbol{
{"DefaultRemoteAddr", Const, 0},
{"NewRecorder", Func, 0},
{"NewRequest", Func, 7},
+ {"NewRequestWithContext", Func, 23},
{"NewServer", Func, 0},
{"NewTLSServer", Func, 0},
{"NewUnstartedServer", Func, 0},
@@ -8917,6 +8980,7 @@ var PackageSymbols = map[string][]Symbol{
{"Chown", Func, 0},
{"Chtimes", Func, 0},
{"Clearenv", Func, 0},
+ {"CopyFS", Func, 23},
{"Create", Func, 0},
{"CreateTemp", Func, 16},
{"DevNull", Const, 0},
@@ -9150,6 +9214,7 @@ var PackageSymbols = map[string][]Symbol{
{"IsLocal", Func, 20},
{"Join", Func, 0},
{"ListSeparator", Const, 0},
+ {"Localize", Func, 23},
{"Match", Func, 0},
{"Rel", Func, 0},
{"Separator", Const, 0},
@@ -9232,6 +9297,8 @@ var PackageSymbols = map[string][]Symbol{
{"(Value).Pointer", Method, 0},
{"(Value).Recv", Method, 0},
{"(Value).Send", Method, 0},
+ {"(Value).Seq", Method, 23},
+ {"(Value).Seq2", Method, 23},
{"(Value).Set", Method, 0},
{"(Value).SetBool", Method, 0},
{"(Value).SetBytes", Method, 0},
@@ -9314,6 +9381,7 @@ var PackageSymbols = map[string][]Symbol{
{"SelectSend", Const, 1},
{"SendDir", Const, 0},
{"Slice", Const, 0},
+ {"SliceAt", Func, 23},
{"SliceHeader", Type, 0},
{"SliceHeader.Cap", Field, 0},
{"SliceHeader.Data", Field, 0},
@@ -9655,6 +9723,7 @@ var PackageSymbols = map[string][]Symbol{
{"BuildSetting", Type, 18},
{"BuildSetting.Key", Field, 18},
{"BuildSetting.Value", Field, 18},
+ {"CrashOptions", Type, 23},
{"FreeOSMemory", Func, 1},
{"GCStats", Type, 1},
{"GCStats.LastGC", Field, 1},
@@ -9672,6 +9741,7 @@ var PackageSymbols = map[string][]Symbol{
{"PrintStack", Func, 0},
{"ReadBuildInfo", Func, 12},
{"ReadGCStats", Func, 1},
+ {"SetCrashOutput", Func, 23},
{"SetGCPercent", Func, 1},
{"SetMaxStack", Func, 2},
{"SetMaxThreads", Func, 2},
@@ -9742,10 +9812,15 @@ var PackageSymbols = map[string][]Symbol{
{"WithRegion", Func, 11},
},
"slices": {
+ {"All", Func, 23},
+ {"AppendSeq", Func, 23},
+ {"Backward", Func, 23},
{"BinarySearch", Func, 21},
{"BinarySearchFunc", Func, 21},
+ {"Chunk", Func, 23},
{"Clip", Func, 21},
{"Clone", Func, 21},
+ {"Collect", Func, 23},
{"Compact", Func, 21},
{"CompactFunc", Func, 21},
{"Compare", Func, 21},
@@ -9767,11 +9842,16 @@ var PackageSymbols = map[string][]Symbol{
{"MaxFunc", Func, 21},
{"Min", Func, 21},
{"MinFunc", Func, 21},
+ {"Repeat", Func, 23},
{"Replace", Func, 21},
{"Reverse", Func, 21},
{"Sort", Func, 21},
{"SortFunc", Func, 21},
{"SortStableFunc", Func, 21},
+ {"Sorted", Func, 23},
+ {"SortedFunc", Func, 23},
+ {"SortedStableFunc", Func, 23},
+ {"Values", Func, 23},
},
"sort": {
{"(Float64Slice).Len", Method, 0},
@@ -9936,10 +10016,14 @@ var PackageSymbols = map[string][]Symbol{
{"TrimSpace", Func, 0},
{"TrimSuffix", Func, 1},
},
+ "structs": {
+ {"HostLayout", Type, 23},
+ },
"sync": {
{"(*Cond).Broadcast", Method, 0},
{"(*Cond).Signal", Method, 0},
{"(*Cond).Wait", Method, 0},
+ {"(*Map).Clear", Method, 23},
{"(*Map).CompareAndDelete", Method, 20},
{"(*Map).CompareAndSwap", Method, 20},
{"(*Map).Delete", Method, 9},
@@ -9986,13 +10070,17 @@ var PackageSymbols = map[string][]Symbol{
{"(*Bool).Store", Method, 19},
{"(*Bool).Swap", Method, 19},
{"(*Int32).Add", Method, 19},
+ {"(*Int32).And", Method, 23},
{"(*Int32).CompareAndSwap", Method, 19},
{"(*Int32).Load", Method, 19},
+ {"(*Int32).Or", Method, 23},
{"(*Int32).Store", Method, 19},
{"(*Int32).Swap", Method, 19},
{"(*Int64).Add", Method, 19},
+ {"(*Int64).And", Method, 23},
{"(*Int64).CompareAndSwap", Method, 19},
{"(*Int64).Load", Method, 19},
+ {"(*Int64).Or", Method, 23},
{"(*Int64).Store", Method, 19},
{"(*Int64).Swap", Method, 19},
{"(*Pointer).CompareAndSwap", Method, 19},
@@ -10000,18 +10088,24 @@ var PackageSymbols = map[string][]Symbol{
{"(*Pointer).Store", Method, 19},
{"(*Pointer).Swap", Method, 19},
{"(*Uint32).Add", Method, 19},
+ {"(*Uint32).And", Method, 23},
{"(*Uint32).CompareAndSwap", Method, 19},
{"(*Uint32).Load", Method, 19},
+ {"(*Uint32).Or", Method, 23},
{"(*Uint32).Store", Method, 19},
{"(*Uint32).Swap", Method, 19},
{"(*Uint64).Add", Method, 19},
+ {"(*Uint64).And", Method, 23},
{"(*Uint64).CompareAndSwap", Method, 19},
{"(*Uint64).Load", Method, 19},
+ {"(*Uint64).Or", Method, 23},
{"(*Uint64).Store", Method, 19},
{"(*Uint64).Swap", Method, 19},
{"(*Uintptr).Add", Method, 19},
+ {"(*Uintptr).And", Method, 23},
{"(*Uintptr).CompareAndSwap", Method, 19},
{"(*Uintptr).Load", Method, 19},
+ {"(*Uintptr).Or", Method, 23},
{"(*Uintptr).Store", Method, 19},
{"(*Uintptr).Swap", Method, 19},
{"(*Value).CompareAndSwap", Method, 17},
@@ -10023,6 +10117,11 @@ var PackageSymbols = map[string][]Symbol{
{"AddUint32", Func, 0},
{"AddUint64", Func, 0},
{"AddUintptr", Func, 0},
+ {"AndInt32", Func, 23},
+ {"AndInt64", Func, 23},
+ {"AndUint32", Func, 23},
+ {"AndUint64", Func, 23},
+ {"AndUintptr", Func, 23},
{"Bool", Type, 19},
{"CompareAndSwapInt32", Func, 0},
{"CompareAndSwapInt64", Func, 0},
@@ -10038,6 +10137,11 @@ var PackageSymbols = map[string][]Symbol{
{"LoadUint32", Func, 0},
{"LoadUint64", Func, 0},
{"LoadUintptr", Func, 0},
+ {"OrInt32", Func, 23},
+ {"OrInt64", Func, 23},
+ {"OrUint32", Func, 23},
+ {"OrUint64", Func, 23},
+ {"OrUintptr", Func, 23},
{"Pointer", Type, 19},
{"StoreInt32", Func, 0},
{"StoreInt64", Func, 0},
@@ -16200,6 +16304,7 @@ var PackageSymbols = map[string][]Symbol{
{"WSAEACCES", Const, 2},
{"WSAECONNABORTED", Const, 9},
{"WSAECONNRESET", Const, 3},
+ {"WSAENOPROTOOPT", Const, 23},
{"WSAEnumProtocols", Func, 2},
{"WSAID_CONNECTEX", Var, 1},
{"WSAIoctl", Func, 0},
@@ -17284,6 +17389,7 @@ var PackageSymbols = map[string][]Symbol{
{"Encode", Func, 0},
{"EncodeRune", Func, 0},
{"IsSurrogate", Func, 0},
+ {"RuneLen", Func, 23},
},
"unicode/utf8": {
{"AppendRune", Func, 18},
@@ -17306,6 +17412,11 @@ var PackageSymbols = map[string][]Symbol{
{"ValidRune", Func, 1},
{"ValidString", Func, 0},
},
+ "unique": {
+ {"(Handle).Value", Method, 23},
+ {"Handle", Type, 23},
+ {"Make", Func, 23},
+ },
"unsafe": {
{"Add", Func, 0},
{"Alignof", Func, 0},
diff --git a/vendor/golang.org/x/tools/internal/typeparams/common.go b/vendor/golang.org/x/tools/internal/typeparams/common.go
new file mode 100644
index 00000000..0b84acc5
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/typeparams/common.go
@@ -0,0 +1,140 @@
+// Copyright 2021 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Package typeparams contains common utilities for writing tools that
+// interact with generic Go code, as introduced with Go 1.18. It
+// supplements the standard library APIs. Notably, the StructuralTerms
+// API computes a minimal representation of the structural
+// restrictions on a type parameter.
+//
+// An external version of these APIs is available in the
+// golang.org/x/exp/typeparams module.
+package typeparams
+
+import (
+ "go/ast"
+ "go/token"
+ "go/types"
+)
+
+// UnpackIndexExpr extracts data from AST nodes that represent index
+// expressions.
+//
+// For an ast.IndexExpr, the resulting indices slice will contain exactly one
+// index expression. For an ast.IndexListExpr (go1.18+), it may have a variable
+// number of index expressions.
+//
+// For nodes that don't represent index expressions, the first return value of
+// UnpackIndexExpr will be nil.
+func UnpackIndexExpr(n ast.Node) (x ast.Expr, lbrack token.Pos, indices []ast.Expr, rbrack token.Pos) {
+ switch e := n.(type) {
+ case *ast.IndexExpr:
+ return e.X, e.Lbrack, []ast.Expr{e.Index}, e.Rbrack
+ case *ast.IndexListExpr:
+ return e.X, e.Lbrack, e.Indices, e.Rbrack
+ }
+ return nil, token.NoPos, nil, token.NoPos
+}
+
+// PackIndexExpr returns an *ast.IndexExpr or *ast.IndexListExpr, depending on
+// the cardinality of indices. Calling PackIndexExpr with len(indices) == 0
+// will panic.
+func PackIndexExpr(x ast.Expr, lbrack token.Pos, indices []ast.Expr, rbrack token.Pos) ast.Expr {
+ switch len(indices) {
+ case 0:
+ panic("empty indices")
+ case 1:
+ return &ast.IndexExpr{
+ X: x,
+ Lbrack: lbrack,
+ Index: indices[0],
+ Rbrack: rbrack,
+ }
+ default:
+ return &ast.IndexListExpr{
+ X: x,
+ Lbrack: lbrack,
+ Indices: indices,
+ Rbrack: rbrack,
+ }
+ }
+}
+
+// IsTypeParam reports whether t is a type parameter (or an alias of one).
+func IsTypeParam(t types.Type) bool {
+ _, ok := types.Unalias(t).(*types.TypeParam)
+ return ok
+}
+
+// GenericAssignableTo is a generalization of types.AssignableTo that
+// implements the following rule for uninstantiated generic types:
+//
+// If V and T are generic named types, then V is considered assignable to T if,
+// for every possible instantiation of V[A_1, ..., A_N], the instantiation
+// T[A_1, ..., A_N] is valid and V[A_1, ..., A_N] implements T[A_1, ..., A_N].
+//
+// If T has structural constraints, they must be satisfied by V.
+//
+// For example, consider the following type declarations:
+//
+// type Interface[T any] interface {
+// Accept(T)
+// }
+//
+// type Container[T any] struct {
+// Element T
+// }
+//
+// func (c Container[T]) Accept(t T) { c.Element = t }
+//
+// In this case, GenericAssignableTo reports that instantiations of Container
+// are assignable to the corresponding instantiation of Interface.
+func GenericAssignableTo(ctxt *types.Context, V, T types.Type) bool {
+ V = types.Unalias(V)
+ T = types.Unalias(T)
+
+ // If V and T are not both named, or do not have matching non-empty type
+ // parameter lists, fall back on types.AssignableTo.
+
+ VN, Vnamed := V.(*types.Named)
+ TN, Tnamed := T.(*types.Named)
+ if !Vnamed || !Tnamed {
+ return types.AssignableTo(V, T)
+ }
+
+ vtparams := VN.TypeParams()
+ ttparams := TN.TypeParams()
+ if vtparams.Len() == 0 || vtparams.Len() != ttparams.Len() || VN.TypeArgs().Len() != 0 || TN.TypeArgs().Len() != 0 {
+ return types.AssignableTo(V, T)
+ }
+
+ // V and T have the same (non-zero) number of type params. Instantiate both
+ // with the type parameters of V. This must always succeed for V, and will
+ // succeed for T if and only if the type set of each type parameter of V is a
+ // subset of the type set of the corresponding type parameter of T, meaning
+ // that every instantiation of V corresponds to a valid instantiation of T.
+
+ // Minor optimization: ensure we share a context across the two
+ // instantiations below.
+ if ctxt == nil {
+ ctxt = types.NewContext()
+ }
+
+ var targs []types.Type
+ for i := 0; i < vtparams.Len(); i++ {
+ targs = append(targs, vtparams.At(i))
+ }
+
+ vinst, err := types.Instantiate(ctxt, V, targs, true)
+ if err != nil {
+ panic("type parameters should satisfy their own constraints")
+ }
+
+ tinst, err := types.Instantiate(ctxt, T, targs, true)
+ if err != nil {
+ return false
+ }
+
+ return types.AssignableTo(vinst, tinst)
+}
diff --git a/vendor/golang.org/x/tools/internal/typeparams/coretype.go b/vendor/golang.org/x/tools/internal/typeparams/coretype.go
new file mode 100644
index 00000000..6e83c6fb
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/typeparams/coretype.go
@@ -0,0 +1,150 @@
+// Copyright 2022 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package typeparams
+
+import (
+ "fmt"
+ "go/types"
+)
+
+// CoreType returns the core type of T or nil if T does not have a core type.
+//
+// See https://go.dev/ref/spec#Core_types for the definition of a core type.
+func CoreType(T types.Type) types.Type {
+ U := T.Underlying()
+ if _, ok := U.(*types.Interface); !ok {
+ return U // for non-interface types,
+ }
+
+ terms, err := NormalTerms(U)
+ if len(terms) == 0 || err != nil {
+ // len(terms) -> empty type set of interface.
+ // err != nil => U is invalid, exceeds complexity bounds, or has an empty type set.
+ return nil // no core type.
+ }
+
+ U = terms[0].Type().Underlying()
+ var identical int // i in [0,identical) => Identical(U, terms[i].Type().Underlying())
+ for identical = 1; identical < len(terms); identical++ {
+ if !types.Identical(U, terms[identical].Type().Underlying()) {
+ break
+ }
+ }
+
+ if identical == len(terms) {
+ // https://go.dev/ref/spec#Core_types
+ // "There is a single type U which is the underlying type of all types in the type set of T"
+ return U
+ }
+ ch, ok := U.(*types.Chan)
+ if !ok {
+ return nil // no core type as identical < len(terms) and U is not a channel.
+ }
+ // https://go.dev/ref/spec#Core_types
+ // "the type chan E if T contains only bidirectional channels, or the type chan<- E or
+ // <-chan E depending on the direction of the directional channels present."
+ for chans := identical; chans < len(terms); chans++ {
+ curr, ok := terms[chans].Type().Underlying().(*types.Chan)
+ if !ok {
+ return nil
+ }
+ if !types.Identical(ch.Elem(), curr.Elem()) {
+ return nil // channel elements are not identical.
+ }
+ if ch.Dir() == types.SendRecv {
+ // ch is bidirectional. We can safely always use curr's direction.
+ ch = curr
+ } else if curr.Dir() != types.SendRecv && ch.Dir() != curr.Dir() {
+ // ch and curr are not bidirectional and not the same direction.
+ return nil
+ }
+ }
+ return ch
+}
+
+// NormalTerms returns a slice of terms representing the normalized structural
+// type restrictions of a type, if any.
+//
+// For all types other than *types.TypeParam, *types.Interface, and
+// *types.Union, this is just a single term with Tilde() == false and
+// Type() == typ. For *types.TypeParam, *types.Interface, and *types.Union, see
+// below.
+//
+// Structural type restrictions of a type parameter are created via
+// non-interface types embedded in its constraint interface (directly, or via a
+// chain of interface embeddings). For example, in the declaration type
+// T[P interface{~int; m()}] int the structural restriction of the type
+// parameter P is ~int.
+//
+// With interface embedding and unions, the specification of structural type
+// restrictions may be arbitrarily complex. For example, consider the
+// following:
+//
+// type A interface{ ~string|~[]byte }
+//
+// type B interface{ int|string }
+//
+// type C interface { ~string|~int }
+//
+// type T[P interface{ A|B; C }] int
+//
+// In this example, the structural type restriction of P is ~string|int: A|B
+// expands to ~string|~[]byte|int|string, which reduces to ~string|~[]byte|int,
+// which when intersected with C (~string|~int) yields ~string|int.
+//
+// NormalTerms computes these expansions and reductions, producing a
+// "normalized" form of the embeddings. A structural restriction is normalized
+// if it is a single union containing no interface terms, and is minimal in the
+// sense that removing any term changes the set of types satisfying the
+// constraint. It is left as a proof for the reader that, modulo sorting, there
+// is exactly one such normalized form.
+//
+// Because the minimal representation always takes this form, NormalTerms
+// returns a slice of tilde terms corresponding to the terms of the union in
+// the normalized structural restriction. An error is returned if the type is
+// invalid, exceeds complexity bounds, or has an empty type set. In the latter
+// case, NormalTerms returns ErrEmptyTypeSet.
+//
+// NormalTerms makes no guarantees about the order of terms, except that it
+// is deterministic.
+func NormalTerms(typ types.Type) ([]*types.Term, error) {
+ switch typ := typ.Underlying().(type) {
+ case *types.TypeParam:
+ return StructuralTerms(typ)
+ case *types.Union:
+ return UnionTermSet(typ)
+ case *types.Interface:
+ return InterfaceTermSet(typ)
+ default:
+ return []*types.Term{types.NewTerm(false, typ)}, nil
+ }
+}
+
+// Deref returns the type of the variable pointed to by t,
+// if t's core type is a pointer; otherwise it returns t.
+//
+// Do not assume that Deref(T)==T implies T is not a pointer:
+// consider "type T *T", for example.
+//
+// TODO(adonovan): ideally this would live in typesinternal, but that
+// creates an import cycle. Move there when we melt this package down.
+func Deref(t types.Type) types.Type {
+ if ptr, ok := CoreType(t).(*types.Pointer); ok {
+ return ptr.Elem()
+ }
+ return t
+}
+
+// MustDeref returns the type of the variable pointed to by t.
+// It panics if t's core type is not a pointer.
+//
+// TODO(adonovan): ideally this would live in typesinternal, but that
+// creates an import cycle. Move there when we melt this package down.
+func MustDeref(t types.Type) types.Type {
+ if ptr, ok := CoreType(t).(*types.Pointer); ok {
+ return ptr.Elem()
+ }
+ panic(fmt.Sprintf("%v is not a pointer", t))
+}
diff --git a/vendor/golang.org/x/tools/internal/typeparams/free.go b/vendor/golang.org/x/tools/internal/typeparams/free.go
new file mode 100644
index 00000000..0ade5c29
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/typeparams/free.go
@@ -0,0 +1,131 @@
+// Copyright 2024 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package typeparams
+
+import (
+ "go/types"
+
+ "golang.org/x/tools/internal/aliases"
+)
+
+// Free is a memoization of the set of free type parameters within a
+// type. It makes a sequence of calls to [Free.Has] for overlapping
+// types more efficient. The zero value is ready for use.
+//
+// NOTE: Adapted from go/types/infer.go. If it is later exported, factor.
+type Free struct {
+ seen map[types.Type]bool
+}
+
+// Has reports whether the specified type has a free type parameter.
+func (w *Free) Has(typ types.Type) (res bool) {
+ // detect cycles
+ if x, ok := w.seen[typ]; ok {
+ return x
+ }
+ if w.seen == nil {
+ w.seen = make(map[types.Type]bool)
+ }
+ w.seen[typ] = false
+ defer func() {
+ w.seen[typ] = res
+ }()
+
+ switch t := typ.(type) {
+ case nil, *types.Basic: // TODO(gri) should nil be handled here?
+ break
+
+ case *types.Alias:
+ if aliases.TypeParams(t).Len() > aliases.TypeArgs(t).Len() {
+ return true // This is an uninstantiated Alias.
+ }
+ // The expansion of an alias can have free type parameters,
+ // whether or not the alias itself has type parameters:
+ //
+ // func _[K comparable]() {
+ // type Set = map[K]bool // free(Set) = {K}
+ // type MapTo[V] = map[K]V // free(Map[foo]) = {V}
+ // }
+ //
+ // So, we must Unalias.
+ return w.Has(types.Unalias(t))
+
+ case *types.Array:
+ return w.Has(t.Elem())
+
+ case *types.Slice:
+ return w.Has(t.Elem())
+
+ case *types.Struct:
+ for i, n := 0, t.NumFields(); i < n; i++ {
+ if w.Has(t.Field(i).Type()) {
+ return true
+ }
+ }
+
+ case *types.Pointer:
+ return w.Has(t.Elem())
+
+ case *types.Tuple:
+ n := t.Len()
+ for i := 0; i < n; i++ {
+ if w.Has(t.At(i).Type()) {
+ return true
+ }
+ }
+
+ case *types.Signature:
+ // t.tparams may not be nil if we are looking at a signature
+ // of a generic function type (or an interface method) that is
+ // part of the type we're testing. We don't care about these type
+ // parameters.
+ // Similarly, the receiver of a method may declare (rather than
+ // use) type parameters, we don't care about those either.
+ // Thus, we only need to look at the input and result parameters.
+ return w.Has(t.Params()) || w.Has(t.Results())
+
+ case *types.Interface:
+ for i, n := 0, t.NumMethods(); i < n; i++ {
+ if w.Has(t.Method(i).Type()) {
+ return true
+ }
+ }
+ terms, err := InterfaceTermSet(t)
+ if err != nil {
+ return false // ill typed
+ }
+ for _, term := range terms {
+ if w.Has(term.Type()) {
+ return true
+ }
+ }
+
+ case *types.Map:
+ return w.Has(t.Key()) || w.Has(t.Elem())
+
+ case *types.Chan:
+ return w.Has(t.Elem())
+
+ case *types.Named:
+ args := t.TypeArgs()
+ if params := t.TypeParams(); params.Len() > args.Len() {
+ return true // this is an uninstantiated named type.
+ }
+ for i, n := 0, args.Len(); i < n; i++ {
+ if w.Has(args.At(i)) {
+ return true
+ }
+ }
+ return w.Has(t.Underlying()) // recurse for types local to parameterized functions
+
+ case *types.TypeParam:
+ return true
+
+ default:
+ panic(t) // unreachable
+ }
+
+ return false
+}
diff --git a/vendor/golang.org/x/tools/internal/typeparams/normalize.go b/vendor/golang.org/x/tools/internal/typeparams/normalize.go
new file mode 100644
index 00000000..93c80fdc
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/typeparams/normalize.go
@@ -0,0 +1,218 @@
+// Copyright 2021 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package typeparams
+
+import (
+ "errors"
+ "fmt"
+ "go/types"
+ "os"
+ "strings"
+)
+
+//go:generate go run copytermlist.go
+
+const debug = false
+
+var ErrEmptyTypeSet = errors.New("empty type set")
+
+// StructuralTerms returns a slice of terms representing the normalized
+// structural type restrictions of a type parameter, if any.
+//
+// Structural type restrictions of a type parameter are created via
+// non-interface types embedded in its constraint interface (directly, or via a
+// chain of interface embeddings). For example, in the declaration
+//
+// type T[P interface{~int; m()}] int
+//
+// the structural restriction of the type parameter P is ~int.
+//
+// With interface embedding and unions, the specification of structural type
+// restrictions may be arbitrarily complex. For example, consider the
+// following:
+//
+// type A interface{ ~string|~[]byte }
+//
+// type B interface{ int|string }
+//
+// type C interface { ~string|~int }
+//
+// type T[P interface{ A|B; C }] int
+//
+// In this example, the structural type restriction of P is ~string|int: A|B
+// expands to ~string|~[]byte|int|string, which reduces to ~string|~[]byte|int,
+// which when intersected with C (~string|~int) yields ~string|int.
+//
+// StructuralTerms computes these expansions and reductions, producing a
+// "normalized" form of the embeddings. A structural restriction is normalized
+// if it is a single union containing no interface terms, and is minimal in the
+// sense that removing any term changes the set of types satisfying the
+// constraint. It is left as a proof for the reader that, modulo sorting, there
+// is exactly one such normalized form.
+//
+// Because the minimal representation always takes this form, StructuralTerms
+// returns a slice of tilde terms corresponding to the terms of the union in
+// the normalized structural restriction. An error is returned if the
+// constraint interface is invalid, exceeds complexity bounds, or has an empty
+// type set. In the latter case, StructuralTerms returns ErrEmptyTypeSet.
+//
+// StructuralTerms makes no guarantees about the order of terms, except that it
+// is deterministic.
+func StructuralTerms(tparam *types.TypeParam) ([]*types.Term, error) {
+ constraint := tparam.Constraint()
+ if constraint == nil {
+ return nil, fmt.Errorf("%s has nil constraint", tparam)
+ }
+ iface, _ := constraint.Underlying().(*types.Interface)
+ if iface == nil {
+ return nil, fmt.Errorf("constraint is %T, not *types.Interface", constraint.Underlying())
+ }
+ return InterfaceTermSet(iface)
+}
+
+// InterfaceTermSet computes the normalized terms for a constraint interface,
+// returning an error if the term set cannot be computed or is empty. In the
+// latter case, the error will be ErrEmptyTypeSet.
+//
+// See the documentation of StructuralTerms for more information on
+// normalization.
+func InterfaceTermSet(iface *types.Interface) ([]*types.Term, error) {
+ return computeTermSet(iface)
+}
+
+// UnionTermSet computes the normalized terms for a union, returning an error
+// if the term set cannot be computed or is empty. In the latter case, the
+// error will be ErrEmptyTypeSet.
+//
+// See the documentation of StructuralTerms for more information on
+// normalization.
+func UnionTermSet(union *types.Union) ([]*types.Term, error) {
+ return computeTermSet(union)
+}
+
+func computeTermSet(typ types.Type) ([]*types.Term, error) {
+ tset, err := computeTermSetInternal(typ, make(map[types.Type]*termSet), 0)
+ if err != nil {
+ return nil, err
+ }
+ if tset.terms.isEmpty() {
+ return nil, ErrEmptyTypeSet
+ }
+ if tset.terms.isAll() {
+ return nil, nil
+ }
+ var terms []*types.Term
+ for _, term := range tset.terms {
+ terms = append(terms, types.NewTerm(term.tilde, term.typ))
+ }
+ return terms, nil
+}
+
+// A termSet holds the normalized set of terms for a given type.
+//
+// The name termSet is intentionally distinct from 'type set': a type set is
+// all types that implement a type (and includes method restrictions), whereas
+// a term set just represents the structural restrictions on a type.
+type termSet struct {
+ complete bool
+ terms termlist
+}
+
+func indentf(depth int, format string, args ...interface{}) {
+ fmt.Fprintf(os.Stderr, strings.Repeat(".", depth)+format+"\n", args...)
+}
+
+func computeTermSetInternal(t types.Type, seen map[types.Type]*termSet, depth int) (res *termSet, err error) {
+ if t == nil {
+ panic("nil type")
+ }
+
+ if debug {
+ indentf(depth, "%s", t.String())
+ defer func() {
+ if err != nil {
+ indentf(depth, "=> %s", err)
+ } else {
+ indentf(depth, "=> %s", res.terms.String())
+ }
+ }()
+ }
+
+ const maxTermCount = 100
+ if tset, ok := seen[t]; ok {
+ if !tset.complete {
+ return nil, fmt.Errorf("cycle detected in the declaration of %s", t)
+ }
+ return tset, nil
+ }
+
+ // Mark the current type as seen to avoid infinite recursion.
+ tset := new(termSet)
+ defer func() {
+ tset.complete = true
+ }()
+ seen[t] = tset
+
+ switch u := t.Underlying().(type) {
+ case *types.Interface:
+ // The term set of an interface is the intersection of the term sets of its
+ // embedded types.
+ tset.terms = allTermlist
+ for i := 0; i < u.NumEmbeddeds(); i++ {
+ embedded := u.EmbeddedType(i)
+ if _, ok := embedded.Underlying().(*types.TypeParam); ok {
+ return nil, fmt.Errorf("invalid embedded type %T", embedded)
+ }
+ tset2, err := computeTermSetInternal(embedded, seen, depth+1)
+ if err != nil {
+ return nil, err
+ }
+ tset.terms = tset.terms.intersect(tset2.terms)
+ }
+ case *types.Union:
+ // The term set of a union is the union of term sets of its terms.
+ tset.terms = nil
+ for i := 0; i < u.Len(); i++ {
+ t := u.Term(i)
+ var terms termlist
+ switch t.Type().Underlying().(type) {
+ case *types.Interface:
+ tset2, err := computeTermSetInternal(t.Type(), seen, depth+1)
+ if err != nil {
+ return nil, err
+ }
+ terms = tset2.terms
+ case *types.TypeParam, *types.Union:
+ // A stand-alone type parameter or union is not permitted as union
+ // term.
+ return nil, fmt.Errorf("invalid union term %T", t)
+ default:
+ if t.Type() == types.Typ[types.Invalid] {
+ continue
+ }
+ terms = termlist{{t.Tilde(), t.Type()}}
+ }
+ tset.terms = tset.terms.union(terms)
+ if len(tset.terms) > maxTermCount {
+ return nil, fmt.Errorf("exceeded max term count %d", maxTermCount)
+ }
+ }
+ case *types.TypeParam:
+ panic("unreachable")
+ default:
+ // For all other types, the term set is just a single non-tilde term
+ // holding the type itself.
+ if u != types.Typ[types.Invalid] {
+ tset.terms = termlist{{false, t}}
+ }
+ }
+ return tset, nil
+}
+
+// under is a facade for the go/types internal function of the same name. It is
+// used by typeterm.go.
+func under(t types.Type) types.Type {
+ return t.Underlying()
+}
diff --git a/vendor/golang.org/x/tools/internal/typeparams/termlist.go b/vendor/golang.org/x/tools/internal/typeparams/termlist.go
new file mode 100644
index 00000000..cbd12f80
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/typeparams/termlist.go
@@ -0,0 +1,163 @@
+// Copyright 2021 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Code generated by copytermlist.go DO NOT EDIT.
+
+package typeparams
+
+import (
+ "bytes"
+ "go/types"
+)
+
+// A termlist represents the type set represented by the union
+// t1 ∪ y2 ∪ ... tn of the type sets of the terms t1 to tn.
+// A termlist is in normal form if all terms are disjoint.
+// termlist operations don't require the operands to be in
+// normal form.
+type termlist []*term
+
+// allTermlist represents the set of all types.
+// It is in normal form.
+var allTermlist = termlist{new(term)}
+
+// String prints the termlist exactly (without normalization).
+func (xl termlist) String() string {
+ if len(xl) == 0 {
+ return "∅"
+ }
+ var buf bytes.Buffer
+ for i, x := range xl {
+ if i > 0 {
+ buf.WriteString(" | ")
+ }
+ buf.WriteString(x.String())
+ }
+ return buf.String()
+}
+
+// isEmpty reports whether the termlist xl represents the empty set of types.
+func (xl termlist) isEmpty() bool {
+ // If there's a non-nil term, the entire list is not empty.
+ // If the termlist is in normal form, this requires at most
+ // one iteration.
+ for _, x := range xl {
+ if x != nil {
+ return false
+ }
+ }
+ return true
+}
+
+// isAll reports whether the termlist xl represents the set of all types.
+func (xl termlist) isAll() bool {
+ // If there's a 𝓤 term, the entire list is 𝓤.
+ // If the termlist is in normal form, this requires at most
+ // one iteration.
+ for _, x := range xl {
+ if x != nil && x.typ == nil {
+ return true
+ }
+ }
+ return false
+}
+
+// norm returns the normal form of xl.
+func (xl termlist) norm() termlist {
+ // Quadratic algorithm, but good enough for now.
+ // TODO(gri) fix asymptotic performance
+ used := make([]bool, len(xl))
+ var rl termlist
+ for i, xi := range xl {
+ if xi == nil || used[i] {
+ continue
+ }
+ for j := i + 1; j < len(xl); j++ {
+ xj := xl[j]
+ if xj == nil || used[j] {
+ continue
+ }
+ if u1, u2 := xi.union(xj); u2 == nil {
+ // If we encounter a 𝓤 term, the entire list is 𝓤.
+ // Exit early.
+ // (Note that this is not just an optimization;
+ // if we continue, we may end up with a 𝓤 term
+ // and other terms and the result would not be
+ // in normal form.)
+ if u1.typ == nil {
+ return allTermlist
+ }
+ xi = u1
+ used[j] = true // xj is now unioned into xi - ignore it in future iterations
+ }
+ }
+ rl = append(rl, xi)
+ }
+ return rl
+}
+
+// union returns the union xl ∪ yl.
+func (xl termlist) union(yl termlist) termlist {
+ return append(xl, yl...).norm()
+}
+
+// intersect returns the intersection xl ∩ yl.
+func (xl termlist) intersect(yl termlist) termlist {
+ if xl.isEmpty() || yl.isEmpty() {
+ return nil
+ }
+
+ // Quadratic algorithm, but good enough for now.
+ // TODO(gri) fix asymptotic performance
+ var rl termlist
+ for _, x := range xl {
+ for _, y := range yl {
+ if r := x.intersect(y); r != nil {
+ rl = append(rl, r)
+ }
+ }
+ }
+ return rl.norm()
+}
+
+// equal reports whether xl and yl represent the same type set.
+func (xl termlist) equal(yl termlist) bool {
+ // TODO(gri) this should be more efficient
+ return xl.subsetOf(yl) && yl.subsetOf(xl)
+}
+
+// includes reports whether t ∈ xl.
+func (xl termlist) includes(t types.Type) bool {
+ for _, x := range xl {
+ if x.includes(t) {
+ return true
+ }
+ }
+ return false
+}
+
+// supersetOf reports whether y ⊆ xl.
+func (xl termlist) supersetOf(y *term) bool {
+ for _, x := range xl {
+ if y.subsetOf(x) {
+ return true
+ }
+ }
+ return false
+}
+
+// subsetOf reports whether xl ⊆ yl.
+func (xl termlist) subsetOf(yl termlist) bool {
+ if yl.isEmpty() {
+ return xl.isEmpty()
+ }
+
+ // each term x of xl must be a subset of yl
+ for _, x := range xl {
+ if !yl.supersetOf(x) {
+ return false // x is not a subset yl
+ }
+ }
+ return true
+}
diff --git a/vendor/golang.org/x/tools/internal/typeparams/typeterm.go b/vendor/golang.org/x/tools/internal/typeparams/typeterm.go
new file mode 100644
index 00000000..7350bb70
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/typeparams/typeterm.go
@@ -0,0 +1,169 @@
+// Copyright 2021 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Code generated by copytermlist.go DO NOT EDIT.
+
+package typeparams
+
+import "go/types"
+
+// A term describes elementary type sets:
+//
+// ∅: (*term)(nil) == ∅ // set of no types (empty set)
+// 𝓤: &term{} == 𝓤 // set of all types (𝓤niverse)
+// T: &term{false, T} == {T} // set of type T
+// ~t: &term{true, t} == {t' | under(t') == t} // set of types with underlying type t
+type term struct {
+ tilde bool // valid if typ != nil
+ typ types.Type
+}
+
+func (x *term) String() string {
+ switch {
+ case x == nil:
+ return "∅"
+ case x.typ == nil:
+ return "𝓤"
+ case x.tilde:
+ return "~" + x.typ.String()
+ default:
+ return x.typ.String()
+ }
+}
+
+// equal reports whether x and y represent the same type set.
+func (x *term) equal(y *term) bool {
+ // easy cases
+ switch {
+ case x == nil || y == nil:
+ return x == y
+ case x.typ == nil || y.typ == nil:
+ return x.typ == y.typ
+ }
+ // ∅ ⊂ x, y ⊂ 𝓤
+
+ return x.tilde == y.tilde && types.Identical(x.typ, y.typ)
+}
+
+// union returns the union x ∪ y: zero, one, or two non-nil terms.
+func (x *term) union(y *term) (_, _ *term) {
+ // easy cases
+ switch {
+ case x == nil && y == nil:
+ return nil, nil // ∅ ∪ ∅ == ∅
+ case x == nil:
+ return y, nil // ∅ ∪ y == y
+ case y == nil:
+ return x, nil // x ∪ ∅ == x
+ case x.typ == nil:
+ return x, nil // 𝓤 ∪ y == 𝓤
+ case y.typ == nil:
+ return y, nil // x ∪ 𝓤 == 𝓤
+ }
+ // ∅ ⊂ x, y ⊂ 𝓤
+
+ if x.disjoint(y) {
+ return x, y // x ∪ y == (x, y) if x ∩ y == ∅
+ }
+ // x.typ == y.typ
+
+ // ~t ∪ ~t == ~t
+ // ~t ∪ T == ~t
+ // T ∪ ~t == ~t
+ // T ∪ T == T
+ if x.tilde || !y.tilde {
+ return x, nil
+ }
+ return y, nil
+}
+
+// intersect returns the intersection x ∩ y.
+func (x *term) intersect(y *term) *term {
+ // easy cases
+ switch {
+ case x == nil || y == nil:
+ return nil // ∅ ∩ y == ∅ and ∩ ∅ == ∅
+ case x.typ == nil:
+ return y // 𝓤 ∩ y == y
+ case y.typ == nil:
+ return x // x ∩ 𝓤 == x
+ }
+ // ∅ ⊂ x, y ⊂ 𝓤
+
+ if x.disjoint(y) {
+ return nil // x ∩ y == ∅ if x ∩ y == ∅
+ }
+ // x.typ == y.typ
+
+ // ~t ∩ ~t == ~t
+ // ~t ∩ T == T
+ // T ∩ ~t == T
+ // T ∩ T == T
+ if !x.tilde || y.tilde {
+ return x
+ }
+ return y
+}
+
+// includes reports whether t ∈ x.
+func (x *term) includes(t types.Type) bool {
+ // easy cases
+ switch {
+ case x == nil:
+ return false // t ∈ ∅ == false
+ case x.typ == nil:
+ return true // t ∈ 𝓤 == true
+ }
+ // ∅ ⊂ x ⊂ 𝓤
+
+ u := t
+ if x.tilde {
+ u = under(u)
+ }
+ return types.Identical(x.typ, u)
+}
+
+// subsetOf reports whether x ⊆ y.
+func (x *term) subsetOf(y *term) bool {
+ // easy cases
+ switch {
+ case x == nil:
+ return true // ∅ ⊆ y == true
+ case y == nil:
+ return false // x ⊆ ∅ == false since x != ∅
+ case y.typ == nil:
+ return true // x ⊆ 𝓤 == true
+ case x.typ == nil:
+ return false // 𝓤 ⊆ y == false since y != 𝓤
+ }
+ // ∅ ⊂ x, y ⊂ 𝓤
+
+ if x.disjoint(y) {
+ return false // x ⊆ y == false if x ∩ y == ∅
+ }
+ // x.typ == y.typ
+
+ // ~t ⊆ ~t == true
+ // ~t ⊆ T == false
+ // T ⊆ ~t == true
+ // T ⊆ T == true
+ return !x.tilde || y.tilde
+}
+
+// disjoint reports whether x ∩ y == ∅.
+// x.typ and y.typ must not be nil.
+func (x *term) disjoint(y *term) bool {
+ if debug && (x.typ == nil || y.typ == nil) {
+ panic("invalid argument(s)")
+ }
+ ux := x.typ
+ if y.tilde {
+ ux = under(ux)
+ }
+ uy := y.typ
+ if x.tilde {
+ uy = under(uy)
+ }
+ return !types.Identical(ux, uy)
+}
diff --git a/vendor/golang.org/x/tools/internal/typesinternal/element.go b/vendor/golang.org/x/tools/internal/typesinternal/element.go
new file mode 100644
index 00000000..4957f021
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/typesinternal/element.go
@@ -0,0 +1,133 @@
+// Copyright 2024 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package typesinternal
+
+import (
+ "fmt"
+ "go/types"
+
+ "golang.org/x/tools/go/types/typeutil"
+)
+
+// ForEachElement calls f for type T and each type reachable from its
+// type through reflection. It does this by recursively stripping off
+// type constructors; in addition, for each named type N, the type *N
+// is added to the result as it may have additional methods.
+//
+// The caller must provide an initially empty set used to de-duplicate
+// identical types, potentially across multiple calls to ForEachElement.
+// (Its final value holds all the elements seen, matching the arguments
+// passed to f.)
+//
+// TODO(adonovan): share/harmonize with go/callgraph/rta.
+func ForEachElement(rtypes *typeutil.Map, msets *typeutil.MethodSetCache, T types.Type, f func(types.Type)) {
+ var visit func(T types.Type, skip bool)
+ visit = func(T types.Type, skip bool) {
+ if !skip {
+ if seen, _ := rtypes.Set(T, true).(bool); seen {
+ return // de-dup
+ }
+
+ f(T) // notify caller of new element type
+ }
+
+ // Recursion over signatures of each method.
+ tmset := msets.MethodSet(T)
+ for i := 0; i < tmset.Len(); i++ {
+ sig := tmset.At(i).Type().(*types.Signature)
+ // It is tempting to call visit(sig, false)
+ // but, as noted in golang.org/cl/65450043,
+ // the Signature.Recv field is ignored by
+ // types.Identical and typeutil.Map, which
+ // is confusing at best.
+ //
+ // More importantly, the true signature rtype
+ // reachable from a method using reflection
+ // has no receiver but an extra ordinary parameter.
+ // For the Read method of io.Reader we want:
+ // func(Reader, []byte) (int, error)
+ // but here sig is:
+ // func([]byte) (int, error)
+ // with .Recv = Reader (though it is hard to
+ // notice because it doesn't affect Signature.String
+ // or types.Identical).
+ //
+ // TODO(adonovan): construct and visit the correct
+ // non-method signature with an extra parameter
+ // (though since unnamed func types have no methods
+ // there is essentially no actual demand for this).
+ //
+ // TODO(adonovan): document whether or not it is
+ // safe to skip non-exported methods (as RTA does).
+ visit(sig.Params(), true) // skip the Tuple
+ visit(sig.Results(), true) // skip the Tuple
+ }
+
+ switch T := T.(type) {
+ case *types.Alias:
+ visit(types.Unalias(T), skip) // emulates the pre-Alias behavior
+
+ case *types.Basic:
+ // nop
+
+ case *types.Interface:
+ // nop---handled by recursion over method set.
+
+ case *types.Pointer:
+ visit(T.Elem(), false)
+
+ case *types.Slice:
+ visit(T.Elem(), false)
+
+ case *types.Chan:
+ visit(T.Elem(), false)
+
+ case *types.Map:
+ visit(T.Key(), false)
+ visit(T.Elem(), false)
+
+ case *types.Signature:
+ if T.Recv() != nil {
+ panic(fmt.Sprintf("Signature %s has Recv %s", T, T.Recv()))
+ }
+ visit(T.Params(), true) // skip the Tuple
+ visit(T.Results(), true) // skip the Tuple
+
+ case *types.Named:
+ // A pointer-to-named type can be derived from a named
+ // type via reflection. It may have methods too.
+ visit(types.NewPointer(T), false)
+
+ // Consider 'type T struct{S}' where S has methods.
+ // Reflection provides no way to get from T to struct{S},
+ // only to S, so the method set of struct{S} is unwanted,
+ // so set 'skip' flag during recursion.
+ visit(T.Underlying(), true) // skip the unnamed type
+
+ case *types.Array:
+ visit(T.Elem(), false)
+
+ case *types.Struct:
+ for i, n := 0, T.NumFields(); i < n; i++ {
+ // TODO(adonovan): document whether or not
+ // it is safe to skip non-exported fields.
+ visit(T.Field(i).Type(), false)
+ }
+
+ case *types.Tuple:
+ for i, n := 0, T.Len(); i < n; i++ {
+ visit(T.At(i).Type(), false)
+ }
+
+ case *types.TypeParam, *types.Union:
+ // forEachReachable must not be called on parameterized types.
+ panic(T)
+
+ default:
+ panic(T)
+ }
+ }
+ visit(T, false)
+}
diff --git a/vendor/golang.org/x/tools/internal/typesinternal/errorcode.go b/vendor/golang.org/x/tools/internal/typesinternal/errorcode.go
new file mode 100644
index 00000000..131caab2
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/typesinternal/errorcode.go
@@ -0,0 +1,1560 @@
+// Copyright 2020 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package typesinternal
+
+//go:generate stringer -type=ErrorCode
+
+type ErrorCode int
+
+// This file defines the error codes that can be produced during type-checking.
+// Collectively, these codes provide an identifier that may be used to
+// implement special handling for certain types of errors.
+//
+// Error codes should be fine-grained enough that the exact nature of the error
+// can be easily determined, but coarse enough that they are not an
+// implementation detail of the type checking algorithm. As a rule-of-thumb,
+// errors should be considered equivalent if there is a theoretical refactoring
+// of the type checker in which they are emitted in exactly one place. For
+// example, the type checker emits different error messages for "too many
+// arguments" and "too few arguments", but one can imagine an alternative type
+// checker where this check instead just emits a single "wrong number of
+// arguments", so these errors should have the same code.
+//
+// Error code names should be as brief as possible while retaining accuracy and
+// distinctiveness. In most cases names should start with an adjective
+// describing the nature of the error (e.g. "invalid", "unused", "misplaced"),
+// and end with a noun identifying the relevant language object. For example,
+// "DuplicateDecl" or "InvalidSliceExpr". For brevity, naming follows the
+// convention that "bad" implies a problem with syntax, and "invalid" implies a
+// problem with types.
+
+const (
+ // InvalidSyntaxTree occurs if an invalid syntax tree is provided
+ // to the type checker. It should never happen.
+ InvalidSyntaxTree ErrorCode = -1
+)
+
+const (
+ _ ErrorCode = iota
+
+ // Test is reserved for errors that only apply while in self-test mode.
+ Test
+
+ /* package names */
+
+ // BlankPkgName occurs when a package name is the blank identifier "_".
+ //
+ // Per the spec:
+ // "The PackageName must not be the blank identifier."
+ BlankPkgName
+
+ // MismatchedPkgName occurs when a file's package name doesn't match the
+ // package name already established by other files.
+ MismatchedPkgName
+
+ // InvalidPkgUse occurs when a package identifier is used outside of a
+ // selector expression.
+ //
+ // Example:
+ // import "fmt"
+ //
+ // var _ = fmt
+ InvalidPkgUse
+
+ /* imports */
+
+ // BadImportPath occurs when an import path is not valid.
+ BadImportPath
+
+ // BrokenImport occurs when importing a package fails.
+ //
+ // Example:
+ // import "amissingpackage"
+ BrokenImport
+
+ // ImportCRenamed occurs when the special import "C" is renamed. "C" is a
+ // pseudo-package, and must not be renamed.
+ //
+ // Example:
+ // import _ "C"
+ ImportCRenamed
+
+ // UnusedImport occurs when an import is unused.
+ //
+ // Example:
+ // import "fmt"
+ //
+ // func main() {}
+ UnusedImport
+
+ /* initialization */
+
+ // InvalidInitCycle occurs when an invalid cycle is detected within the
+ // initialization graph.
+ //
+ // Example:
+ // var x int = f()
+ //
+ // func f() int { return x }
+ InvalidInitCycle
+
+ /* decls */
+
+ // DuplicateDecl occurs when an identifier is declared multiple times.
+ //
+ // Example:
+ // var x = 1
+ // var x = 2
+ DuplicateDecl
+
+ // InvalidDeclCycle occurs when a declaration cycle is not valid.
+ //
+ // Example:
+ // import "unsafe"
+ //
+ // type T struct {
+ // a [n]int
+ // }
+ //
+ // var n = unsafe.Sizeof(T{})
+ InvalidDeclCycle
+
+ // InvalidTypeCycle occurs when a cycle in type definitions results in a
+ // type that is not well-defined.
+ //
+ // Example:
+ // import "unsafe"
+ //
+ // type T [unsafe.Sizeof(T{})]int
+ InvalidTypeCycle
+
+ /* decls > const */
+
+ // InvalidConstInit occurs when a const declaration has a non-constant
+ // initializer.
+ //
+ // Example:
+ // var x int
+ // const _ = x
+ InvalidConstInit
+
+ // InvalidConstVal occurs when a const value cannot be converted to its
+ // target type.
+ //
+ // TODO(findleyr): this error code and example are not very clear. Consider
+ // removing it.
+ //
+ // Example:
+ // const _ = 1 << "hello"
+ InvalidConstVal
+
+ // InvalidConstType occurs when the underlying type in a const declaration
+ // is not a valid constant type.
+ //
+ // Example:
+ // const c *int = 4
+ InvalidConstType
+
+ /* decls > var (+ other variable assignment codes) */
+
+ // UntypedNilUse occurs when the predeclared (untyped) value nil is used to
+ // initialize a variable declared without an explicit type.
+ //
+ // Example:
+ // var x = nil
+ UntypedNilUse
+
+ // WrongAssignCount occurs when the number of values on the right-hand side
+ // of an assignment or initialization expression does not match the number
+ // of variables on the left-hand side.
+ //
+ // Example:
+ // var x = 1, 2
+ WrongAssignCount
+
+ // UnassignableOperand occurs when the left-hand side of an assignment is
+ // not assignable.
+ //
+ // Example:
+ // func f() {
+ // const c = 1
+ // c = 2
+ // }
+ UnassignableOperand
+
+ // NoNewVar occurs when a short variable declaration (':=') does not declare
+ // new variables.
+ //
+ // Example:
+ // func f() {
+ // x := 1
+ // x := 2
+ // }
+ NoNewVar
+
+ // MultiValAssignOp occurs when an assignment operation (+=, *=, etc) does
+ // not have single-valued left-hand or right-hand side.
+ //
+ // Per the spec:
+ // "In assignment operations, both the left- and right-hand expression lists
+ // must contain exactly one single-valued expression"
+ //
+ // Example:
+ // func f() int {
+ // x, y := 1, 2
+ // x, y += 1
+ // return x + y
+ // }
+ MultiValAssignOp
+
+ // InvalidIfaceAssign occurs when a value of type T is used as an
+ // interface, but T does not implement a method of the expected interface.
+ //
+ // Example:
+ // type I interface {
+ // f()
+ // }
+ //
+ // type T int
+ //
+ // var x I = T(1)
+ InvalidIfaceAssign
+
+ // InvalidChanAssign occurs when a chan assignment is invalid.
+ //
+ // Per the spec, a value x is assignable to a channel type T if:
+ // "x is a bidirectional channel value, T is a channel type, x's type V and
+ // T have identical element types, and at least one of V or T is not a
+ // defined type."
+ //
+ // Example:
+ // type T1 chan int
+ // type T2 chan int
+ //
+ // var x T1
+ // // Invalid assignment because both types are named
+ // var _ T2 = x
+ InvalidChanAssign
+
+ // IncompatibleAssign occurs when the type of the right-hand side expression
+ // in an assignment cannot be assigned to the type of the variable being
+ // assigned.
+ //
+ // Example:
+ // var x []int
+ // var _ int = x
+ IncompatibleAssign
+
+ // UnaddressableFieldAssign occurs when trying to assign to a struct field
+ // in a map value.
+ //
+ // Example:
+ // func f() {
+ // m := make(map[string]struct{i int})
+ // m["foo"].i = 42
+ // }
+ UnaddressableFieldAssign
+
+ /* decls > type (+ other type expression codes) */
+
+ // NotAType occurs when the identifier used as the underlying type in a type
+ // declaration or the right-hand side of a type alias does not denote a type.
+ //
+ // Example:
+ // var S = 2
+ //
+ // type T S
+ NotAType
+
+ // InvalidArrayLen occurs when an array length is not a constant value.
+ //
+ // Example:
+ // var n = 3
+ // var _ = [n]int{}
+ InvalidArrayLen
+
+ // BlankIfaceMethod occurs when a method name is '_'.
+ //
+ // Per the spec:
+ // "The name of each explicitly specified method must be unique and not
+ // blank."
+ //
+ // Example:
+ // type T interface {
+ // _(int)
+ // }
+ BlankIfaceMethod
+
+ // IncomparableMapKey occurs when a map key type does not support the == and
+ // != operators.
+ //
+ // Per the spec:
+ // "The comparison operators == and != must be fully defined for operands of
+ // the key type; thus the key type must not be a function, map, or slice."
+ //
+ // Example:
+ // var x map[T]int
+ //
+ // type T []int
+ IncomparableMapKey
+
+ // InvalidIfaceEmbed occurs when a non-interface type is embedded in an
+ // interface.
+ //
+ // Example:
+ // type T struct {}
+ //
+ // func (T) m()
+ //
+ // type I interface {
+ // T
+ // }
+ InvalidIfaceEmbed
+
+ // InvalidPtrEmbed occurs when an embedded field is of the pointer form *T,
+ // and T itself is itself a pointer, an unsafe.Pointer, or an interface.
+ //
+ // Per the spec:
+ // "An embedded field must be specified as a type name T or as a pointer to
+ // a non-interface type name *T, and T itself may not be a pointer type."
+ //
+ // Example:
+ // type T *int
+ //
+ // type S struct {
+ // *T
+ // }
+ InvalidPtrEmbed
+
+ /* decls > func and method */
+
+ // BadRecv occurs when a method declaration does not have exactly one
+ // receiver parameter.
+ //
+ // Example:
+ // func () _() {}
+ BadRecv
+
+ // InvalidRecv occurs when a receiver type expression is not of the form T
+ // or *T, or T is a pointer type.
+ //
+ // Example:
+ // type T struct {}
+ //
+ // func (**T) m() {}
+ InvalidRecv
+
+ // DuplicateFieldAndMethod occurs when an identifier appears as both a field
+ // and method name.
+ //
+ // Example:
+ // type T struct {
+ // m int
+ // }
+ //
+ // func (T) m() {}
+ DuplicateFieldAndMethod
+
+ // DuplicateMethod occurs when two methods on the same receiver type have
+ // the same name.
+ //
+ // Example:
+ // type T struct {}
+ // func (T) m() {}
+ // func (T) m(i int) int { return i }
+ DuplicateMethod
+
+ /* decls > special */
+
+ // InvalidBlank occurs when a blank identifier is used as a value or type.
+ //
+ // Per the spec:
+ // "The blank identifier may appear as an operand only on the left-hand side
+ // of an assignment."
+ //
+ // Example:
+ // var x = _
+ InvalidBlank
+
+ // InvalidIota occurs when the predeclared identifier iota is used outside
+ // of a constant declaration.
+ //
+ // Example:
+ // var x = iota
+ InvalidIota
+
+ // MissingInitBody occurs when an init function is missing its body.
+ //
+ // Example:
+ // func init()
+ MissingInitBody
+
+ // InvalidInitSig occurs when an init function declares parameters or
+ // results.
+ //
+ // Example:
+ // func init() int { return 1 }
+ InvalidInitSig
+
+ // InvalidInitDecl occurs when init is declared as anything other than a
+ // function.
+ //
+ // Example:
+ // var init = 1
+ InvalidInitDecl
+
+ // InvalidMainDecl occurs when main is declared as anything other than a
+ // function, in a main package.
+ InvalidMainDecl
+
+ /* exprs */
+
+ // TooManyValues occurs when a function returns too many values for the
+ // expression context in which it is used.
+ //
+ // Example:
+ // func ReturnTwo() (int, int) {
+ // return 1, 2
+ // }
+ //
+ // var x = ReturnTwo()
+ TooManyValues
+
+ // NotAnExpr occurs when a type expression is used where a value expression
+ // is expected.
+ //
+ // Example:
+ // type T struct {}
+ //
+ // func f() {
+ // T
+ // }
+ NotAnExpr
+
+ /* exprs > const */
+
+ // TruncatedFloat occurs when a float constant is truncated to an integer
+ // value.
+ //
+ // Example:
+ // var _ int = 98.6
+ TruncatedFloat
+
+ // NumericOverflow occurs when a numeric constant overflows its target type.
+ //
+ // Example:
+ // var x int8 = 1000
+ NumericOverflow
+
+ /* exprs > operation */
+
+ // UndefinedOp occurs when an operator is not defined for the type(s) used
+ // in an operation.
+ //
+ // Example:
+ // var c = "a" - "b"
+ UndefinedOp
+
+ // MismatchedTypes occurs when operand types are incompatible in a binary
+ // operation.
+ //
+ // Example:
+ // var a = "hello"
+ // var b = 1
+ // var c = a - b
+ MismatchedTypes
+
+ // DivByZero occurs when a division operation is provable at compile
+ // time to be a division by zero.
+ //
+ // Example:
+ // const divisor = 0
+ // var x int = 1/divisor
+ DivByZero
+
+ // NonNumericIncDec occurs when an increment or decrement operator is
+ // applied to a non-numeric value.
+ //
+ // Example:
+ // func f() {
+ // var c = "c"
+ // c++
+ // }
+ NonNumericIncDec
+
+ /* exprs > ptr */
+
+ // UnaddressableOperand occurs when the & operator is applied to an
+ // unaddressable expression.
+ //
+ // Example:
+ // var x = &1
+ UnaddressableOperand
+
+ // InvalidIndirection occurs when a non-pointer value is indirected via the
+ // '*' operator.
+ //
+ // Example:
+ // var x int
+ // var y = *x
+ InvalidIndirection
+
+ /* exprs > [] */
+
+ // NonIndexableOperand occurs when an index operation is applied to a value
+ // that cannot be indexed.
+ //
+ // Example:
+ // var x = 1
+ // var y = x[1]
+ NonIndexableOperand
+
+ // InvalidIndex occurs when an index argument is not of integer type,
+ // negative, or out-of-bounds.
+ //
+ // Example:
+ // var s = [...]int{1,2,3}
+ // var x = s[5]
+ //
+ // Example:
+ // var s = []int{1,2,3}
+ // var _ = s[-1]
+ //
+ // Example:
+ // var s = []int{1,2,3}
+ // var i string
+ // var _ = s[i]
+ InvalidIndex
+
+ // SwappedSliceIndices occurs when constant indices in a slice expression
+ // are decreasing in value.
+ //
+ // Example:
+ // var _ = []int{1,2,3}[2:1]
+ SwappedSliceIndices
+
+ /* operators > slice */
+
+ // NonSliceableOperand occurs when a slice operation is applied to a value
+ // whose type is not sliceable, or is unaddressable.
+ //
+ // Example:
+ // var x = [...]int{1, 2, 3}[:1]
+ //
+ // Example:
+ // var x = 1
+ // var y = 1[:1]
+ NonSliceableOperand
+
+ // InvalidSliceExpr occurs when a three-index slice expression (a[x:y:z]) is
+ // applied to a string.
+ //
+ // Example:
+ // var s = "hello"
+ // var x = s[1:2:3]
+ InvalidSliceExpr
+
+ /* exprs > shift */
+
+ // InvalidShiftCount occurs when the right-hand side of a shift operation is
+ // either non-integer, negative, or too large.
+ //
+ // Example:
+ // var (
+ // x string
+ // y int = 1 << x
+ // )
+ InvalidShiftCount
+
+ // InvalidShiftOperand occurs when the shifted operand is not an integer.
+ //
+ // Example:
+ // var s = "hello"
+ // var x = s << 2
+ InvalidShiftOperand
+
+ /* exprs > chan */
+
+ // InvalidReceive occurs when there is a channel receive from a value that
+ // is either not a channel, or is a send-only channel.
+ //
+ // Example:
+ // func f() {
+ // var x = 1
+ // <-x
+ // }
+ InvalidReceive
+
+ // InvalidSend occurs when there is a channel send to a value that is not a
+ // channel, or is a receive-only channel.
+ //
+ // Example:
+ // func f() {
+ // var x = 1
+ // x <- "hello!"
+ // }
+ InvalidSend
+
+ /* exprs > literal */
+
+ // DuplicateLitKey occurs when an index is duplicated in a slice, array, or
+ // map literal.
+ //
+ // Example:
+ // var _ = []int{0:1, 0:2}
+ //
+ // Example:
+ // var _ = map[string]int{"a": 1, "a": 2}
+ DuplicateLitKey
+
+ // MissingLitKey occurs when a map literal is missing a key expression.
+ //
+ // Example:
+ // var _ = map[string]int{1}
+ MissingLitKey
+
+ // InvalidLitIndex occurs when the key in a key-value element of a slice or
+ // array literal is not an integer constant.
+ //
+ // Example:
+ // var i = 0
+ // var x = []string{i: "world"}
+ InvalidLitIndex
+
+ // OversizeArrayLit occurs when an array literal exceeds its length.
+ //
+ // Example:
+ // var _ = [2]int{1,2,3}
+ OversizeArrayLit
+
+ // MixedStructLit occurs when a struct literal contains a mix of positional
+ // and named elements.
+ //
+ // Example:
+ // var _ = struct{i, j int}{i: 1, 2}
+ MixedStructLit
+
+ // InvalidStructLit occurs when a positional struct literal has an incorrect
+ // number of values.
+ //
+ // Example:
+ // var _ = struct{i, j int}{1,2,3}
+ InvalidStructLit
+
+ // MissingLitField occurs when a struct literal refers to a field that does
+ // not exist on the struct type.
+ //
+ // Example:
+ // var _ = struct{i int}{j: 2}
+ MissingLitField
+
+ // DuplicateLitField occurs when a struct literal contains duplicated
+ // fields.
+ //
+ // Example:
+ // var _ = struct{i int}{i: 1, i: 2}
+ DuplicateLitField
+
+ // UnexportedLitField occurs when a positional struct literal implicitly
+ // assigns an unexported field of an imported type.
+ UnexportedLitField
+
+ // InvalidLitField occurs when a field name is not a valid identifier.
+ //
+ // Example:
+ // var _ = struct{i int}{1: 1}
+ InvalidLitField
+
+ // UntypedLit occurs when a composite literal omits a required type
+ // identifier.
+ //
+ // Example:
+ // type outer struct{
+ // inner struct { i int }
+ // }
+ //
+ // var _ = outer{inner: {1}}
+ UntypedLit
+
+ // InvalidLit occurs when a composite literal expression does not match its
+ // type.
+ //
+ // Example:
+ // type P *struct{
+ // x int
+ // }
+ // var _ = P {}
+ InvalidLit
+
+ /* exprs > selector */
+
+ // AmbiguousSelector occurs when a selector is ambiguous.
+ //
+ // Example:
+ // type E1 struct { i int }
+ // type E2 struct { i int }
+ // type T struct { E1; E2 }
+ //
+ // var x T
+ // var _ = x.i
+ AmbiguousSelector
+
+ // UndeclaredImportedName occurs when a package-qualified identifier is
+ // undeclared by the imported package.
+ //
+ // Example:
+ // import "go/types"
+ //
+ // var _ = types.NotAnActualIdentifier
+ UndeclaredImportedName
+
+ // UnexportedName occurs when a selector refers to an unexported identifier
+ // of an imported package.
+ //
+ // Example:
+ // import "reflect"
+ //
+ // type _ reflect.flag
+ UnexportedName
+
+ // UndeclaredName occurs when an identifier is not declared in the current
+ // scope.
+ //
+ // Example:
+ // var x T
+ UndeclaredName
+
+ // MissingFieldOrMethod occurs when a selector references a field or method
+ // that does not exist.
+ //
+ // Example:
+ // type T struct {}
+ //
+ // var x = T{}.f
+ MissingFieldOrMethod
+
+ /* exprs > ... */
+
+ // BadDotDotDotSyntax occurs when a "..." occurs in a context where it is
+ // not valid.
+ //
+ // Example:
+ // var _ = map[int][...]int{0: {}}
+ BadDotDotDotSyntax
+
+ // NonVariadicDotDotDot occurs when a "..." is used on the final argument to
+ // a non-variadic function.
+ //
+ // Example:
+ // func printArgs(s []string) {
+ // for _, a := range s {
+ // println(a)
+ // }
+ // }
+ //
+ // func f() {
+ // s := []string{"a", "b", "c"}
+ // printArgs(s...)
+ // }
+ NonVariadicDotDotDot
+
+ // MisplacedDotDotDot occurs when a "..." is used somewhere other than the
+ // final argument to a function call.
+ //
+ // Example:
+ // func printArgs(args ...int) {
+ // for _, a := range args {
+ // println(a)
+ // }
+ // }
+ //
+ // func f() {
+ // a := []int{1,2,3}
+ // printArgs(0, a...)
+ // }
+ MisplacedDotDotDot
+
+ // InvalidDotDotDotOperand occurs when a "..." operator is applied to a
+ // single-valued operand.
+ //
+ // Example:
+ // func printArgs(args ...int) {
+ // for _, a := range args {
+ // println(a)
+ // }
+ // }
+ //
+ // func f() {
+ // a := 1
+ // printArgs(a...)
+ // }
+ //
+ // Example:
+ // func args() (int, int) {
+ // return 1, 2
+ // }
+ //
+ // func printArgs(args ...int) {
+ // for _, a := range args {
+ // println(a)
+ // }
+ // }
+ //
+ // func g() {
+ // printArgs(args()...)
+ // }
+ InvalidDotDotDotOperand
+
+ // InvalidDotDotDot occurs when a "..." is used in a non-variadic built-in
+ // function.
+ //
+ // Example:
+ // var s = []int{1, 2, 3}
+ // var l = len(s...)
+ InvalidDotDotDot
+
+ /* exprs > built-in */
+
+ // UncalledBuiltin occurs when a built-in function is used as a
+ // function-valued expression, instead of being called.
+ //
+ // Per the spec:
+ // "The built-in functions do not have standard Go types, so they can only
+ // appear in call expressions; they cannot be used as function values."
+ //
+ // Example:
+ // var _ = copy
+ UncalledBuiltin
+
+ // InvalidAppend occurs when append is called with a first argument that is
+ // not a slice.
+ //
+ // Example:
+ // var _ = append(1, 2)
+ InvalidAppend
+
+ // InvalidCap occurs when an argument to the cap built-in function is not of
+ // supported type.
+ //
+ // See https://golang.org/ref/spec#Length_and_capacity for information on
+ // which underlying types are supported as arguments to cap and len.
+ //
+ // Example:
+ // var s = 2
+ // var x = cap(s)
+ InvalidCap
+
+ // InvalidClose occurs when close(...) is called with an argument that is
+ // not of channel type, or that is a receive-only channel.
+ //
+ // Example:
+ // func f() {
+ // var x int
+ // close(x)
+ // }
+ InvalidClose
+
+ // InvalidCopy occurs when the arguments are not of slice type or do not
+ // have compatible type.
+ //
+ // See https://golang.org/ref/spec#Appending_and_copying_slices for more
+ // information on the type requirements for the copy built-in.
+ //
+ // Example:
+ // func f() {
+ // var x []int
+ // y := []int64{1,2,3}
+ // copy(x, y)
+ // }
+ InvalidCopy
+
+ // InvalidComplex occurs when the complex built-in function is called with
+ // arguments with incompatible types.
+ //
+ // Example:
+ // var _ = complex(float32(1), float64(2))
+ InvalidComplex
+
+ // InvalidDelete occurs when the delete built-in function is called with a
+ // first argument that is not a map.
+ //
+ // Example:
+ // func f() {
+ // m := "hello"
+ // delete(m, "e")
+ // }
+ InvalidDelete
+
+ // InvalidImag occurs when the imag built-in function is called with an
+ // argument that does not have complex type.
+ //
+ // Example:
+ // var _ = imag(int(1))
+ InvalidImag
+
+ // InvalidLen occurs when an argument to the len built-in function is not of
+ // supported type.
+ //
+ // See https://golang.org/ref/spec#Length_and_capacity for information on
+ // which underlying types are supported as arguments to cap and len.
+ //
+ // Example:
+ // var s = 2
+ // var x = len(s)
+ InvalidLen
+
+ // SwappedMakeArgs occurs when make is called with three arguments, and its
+ // length argument is larger than its capacity argument.
+ //
+ // Example:
+ // var x = make([]int, 3, 2)
+ SwappedMakeArgs
+
+ // InvalidMake occurs when make is called with an unsupported type argument.
+ //
+ // See https://golang.org/ref/spec#Making_slices_maps_and_channels for
+ // information on the types that may be created using make.
+ //
+ // Example:
+ // var x = make(int)
+ InvalidMake
+
+ // InvalidReal occurs when the real built-in function is called with an
+ // argument that does not have complex type.
+ //
+ // Example:
+ // var _ = real(int(1))
+ InvalidReal
+
+ /* exprs > assertion */
+
+ // InvalidAssert occurs when a type assertion is applied to a
+ // value that is not of interface type.
+ //
+ // Example:
+ // var x = 1
+ // var _ = x.(float64)
+ InvalidAssert
+
+ // ImpossibleAssert occurs for a type assertion x.(T) when the value x of
+ // interface cannot have dynamic type T, due to a missing or mismatching
+ // method on T.
+ //
+ // Example:
+ // type T int
+ //
+ // func (t *T) m() int { return int(*t) }
+ //
+ // type I interface { m() int }
+ //
+ // var x I
+ // var _ = x.(T)
+ ImpossibleAssert
+
+ /* exprs > conversion */
+
+ // InvalidConversion occurs when the argument type cannot be converted to the
+ // target.
+ //
+ // See https://golang.org/ref/spec#Conversions for the rules of
+ // convertibility.
+ //
+ // Example:
+ // var x float64
+ // var _ = string(x)
+ InvalidConversion
+
+ // InvalidUntypedConversion occurs when an there is no valid implicit
+ // conversion from an untyped value satisfying the type constraints of the
+ // context in which it is used.
+ //
+ // Example:
+ // var _ = 1 + ""
+ InvalidUntypedConversion
+
+ /* offsetof */
+
+ // BadOffsetofSyntax occurs when unsafe.Offsetof is called with an argument
+ // that is not a selector expression.
+ //
+ // Example:
+ // import "unsafe"
+ //
+ // var x int
+ // var _ = unsafe.Offsetof(x)
+ BadOffsetofSyntax
+
+ // InvalidOffsetof occurs when unsafe.Offsetof is called with a method
+ // selector, rather than a field selector, or when the field is embedded via
+ // a pointer.
+ //
+ // Per the spec:
+ //
+ // "If f is an embedded field, it must be reachable without pointer
+ // indirections through fields of the struct. "
+ //
+ // Example:
+ // import "unsafe"
+ //
+ // type T struct { f int }
+ // type S struct { *T }
+ // var s S
+ // var _ = unsafe.Offsetof(s.f)
+ //
+ // Example:
+ // import "unsafe"
+ //
+ // type S struct{}
+ //
+ // func (S) m() {}
+ //
+ // var s S
+ // var _ = unsafe.Offsetof(s.m)
+ InvalidOffsetof
+
+ /* control flow > scope */
+
+ // UnusedExpr occurs when a side-effect free expression is used as a
+ // statement. Such a statement has no effect.
+ //
+ // Example:
+ // func f(i int) {
+ // i*i
+ // }
+ UnusedExpr
+
+ // UnusedVar occurs when a variable is declared but unused.
+ //
+ // Example:
+ // func f() {
+ // x := 1
+ // }
+ UnusedVar
+
+ // MissingReturn occurs when a function with results is missing a return
+ // statement.
+ //
+ // Example:
+ // func f() int {}
+ MissingReturn
+
+ // WrongResultCount occurs when a return statement returns an incorrect
+ // number of values.
+ //
+ // Example:
+ // func ReturnOne() int {
+ // return 1, 2
+ // }
+ WrongResultCount
+
+ // OutOfScopeResult occurs when the name of a value implicitly returned by
+ // an empty return statement is shadowed in a nested scope.
+ //
+ // Example:
+ // func factor(n int) (i int) {
+ // for i := 2; i < n; i++ {
+ // if n%i == 0 {
+ // return
+ // }
+ // }
+ // return 0
+ // }
+ OutOfScopeResult
+
+ /* control flow > if */
+
+ // InvalidCond occurs when an if condition is not a boolean expression.
+ //
+ // Example:
+ // func checkReturn(i int) {
+ // if i {
+ // panic("non-zero return")
+ // }
+ // }
+ InvalidCond
+
+ /* control flow > for */
+
+ // InvalidPostDecl occurs when there is a declaration in a for-loop post
+ // statement.
+ //
+ // Example:
+ // func f() {
+ // for i := 0; i < 10; j := 0 {}
+ // }
+ InvalidPostDecl
+
+ // InvalidChanRange occurs when a send-only channel used in a range
+ // expression.
+ //
+ // Example:
+ // func sum(c chan<- int) {
+ // s := 0
+ // for i := range c {
+ // s += i
+ // }
+ // }
+ InvalidChanRange
+
+ // InvalidIterVar occurs when two iteration variables are used while ranging
+ // over a channel.
+ //
+ // Example:
+ // func f(c chan int) {
+ // for k, v := range c {
+ // println(k, v)
+ // }
+ // }
+ InvalidIterVar
+
+ // InvalidRangeExpr occurs when the type of a range expression is not array,
+ // slice, string, map, or channel.
+ //
+ // Example:
+ // func f(i int) {
+ // for j := range i {
+ // println(j)
+ // }
+ // }
+ InvalidRangeExpr
+
+ /* control flow > switch */
+
+ // MisplacedBreak occurs when a break statement is not within a for, switch,
+ // or select statement of the innermost function definition.
+ //
+ // Example:
+ // func f() {
+ // break
+ // }
+ MisplacedBreak
+
+ // MisplacedContinue occurs when a continue statement is not within a for
+ // loop of the innermost function definition.
+ //
+ // Example:
+ // func sumeven(n int) int {
+ // proceed := func() {
+ // continue
+ // }
+ // sum := 0
+ // for i := 1; i <= n; i++ {
+ // if i % 2 != 0 {
+ // proceed()
+ // }
+ // sum += i
+ // }
+ // return sum
+ // }
+ MisplacedContinue
+
+ // MisplacedFallthrough occurs when a fallthrough statement is not within an
+ // expression switch.
+ //
+ // Example:
+ // func typename(i interface{}) string {
+ // switch i.(type) {
+ // case int64:
+ // fallthrough
+ // case int:
+ // return "int"
+ // }
+ // return "unsupported"
+ // }
+ MisplacedFallthrough
+
+ // DuplicateCase occurs when a type or expression switch has duplicate
+ // cases.
+ //
+ // Example:
+ // func printInt(i int) {
+ // switch i {
+ // case 1:
+ // println("one")
+ // case 1:
+ // println("One")
+ // }
+ // }
+ DuplicateCase
+
+ // DuplicateDefault occurs when a type or expression switch has multiple
+ // default clauses.
+ //
+ // Example:
+ // func printInt(i int) {
+ // switch i {
+ // case 1:
+ // println("one")
+ // default:
+ // println("One")
+ // default:
+ // println("1")
+ // }
+ // }
+ DuplicateDefault
+
+ // BadTypeKeyword occurs when a .(type) expression is used anywhere other
+ // than a type switch.
+ //
+ // Example:
+ // type I interface {
+ // m()
+ // }
+ // var t I
+ // var _ = t.(type)
+ BadTypeKeyword
+
+ // InvalidTypeSwitch occurs when .(type) is used on an expression that is
+ // not of interface type.
+ //
+ // Example:
+ // func f(i int) {
+ // switch x := i.(type) {}
+ // }
+ InvalidTypeSwitch
+
+ // InvalidExprSwitch occurs when a switch expression is not comparable.
+ //
+ // Example:
+ // func _() {
+ // var a struct{ _ func() }
+ // switch a /* ERROR cannot switch on a */ {
+ // }
+ // }
+ InvalidExprSwitch
+
+ /* control flow > select */
+
+ // InvalidSelectCase occurs when a select case is not a channel send or
+ // receive.
+ //
+ // Example:
+ // func checkChan(c <-chan int) bool {
+ // select {
+ // case c:
+ // return true
+ // default:
+ // return false
+ // }
+ // }
+ InvalidSelectCase
+
+ /* control flow > labels and jumps */
+
+ // UndeclaredLabel occurs when an undeclared label is jumped to.
+ //
+ // Example:
+ // func f() {
+ // goto L
+ // }
+ UndeclaredLabel
+
+ // DuplicateLabel occurs when a label is declared more than once.
+ //
+ // Example:
+ // func f() int {
+ // L:
+ // L:
+ // return 1
+ // }
+ DuplicateLabel
+
+ // MisplacedLabel occurs when a break or continue label is not on a for,
+ // switch, or select statement.
+ //
+ // Example:
+ // func f() {
+ // L:
+ // a := []int{1,2,3}
+ // for _, e := range a {
+ // if e > 10 {
+ // break L
+ // }
+ // println(a)
+ // }
+ // }
+ MisplacedLabel
+
+ // UnusedLabel occurs when a label is declared but not used.
+ //
+ // Example:
+ // func f() {
+ // L:
+ // }
+ UnusedLabel
+
+ // JumpOverDecl occurs when a label jumps over a variable declaration.
+ //
+ // Example:
+ // func f() int {
+ // goto L
+ // x := 2
+ // L:
+ // x++
+ // return x
+ // }
+ JumpOverDecl
+
+ // JumpIntoBlock occurs when a forward jump goes to a label inside a nested
+ // block.
+ //
+ // Example:
+ // func f(x int) {
+ // goto L
+ // if x > 0 {
+ // L:
+ // print("inside block")
+ // }
+ // }
+ JumpIntoBlock
+
+ /* control flow > calls */
+
+ // InvalidMethodExpr occurs when a pointer method is called but the argument
+ // is not addressable.
+ //
+ // Example:
+ // type T struct {}
+ //
+ // func (*T) m() int { return 1 }
+ //
+ // var _ = T.m(T{})
+ InvalidMethodExpr
+
+ // WrongArgCount occurs when too few or too many arguments are passed by a
+ // function call.
+ //
+ // Example:
+ // func f(i int) {}
+ // var x = f()
+ WrongArgCount
+
+ // InvalidCall occurs when an expression is called that is not of function
+ // type.
+ //
+ // Example:
+ // var x = "x"
+ // var y = x()
+ InvalidCall
+
+ /* control flow > suspended */
+
+ // UnusedResults occurs when a restricted expression-only built-in function
+ // is suspended via go or defer. Such a suspension discards the results of
+ // these side-effect free built-in functions, and therefore is ineffectual.
+ //
+ // Example:
+ // func f(a []int) int {
+ // defer len(a)
+ // return i
+ // }
+ UnusedResults
+
+ // InvalidDefer occurs when a deferred expression is not a function call,
+ // for example if the expression is a type conversion.
+ //
+ // Example:
+ // func f(i int) int {
+ // defer int32(i)
+ // return i
+ // }
+ InvalidDefer
+
+ // InvalidGo occurs when a go expression is not a function call, for example
+ // if the expression is a type conversion.
+ //
+ // Example:
+ // func f(i int) int {
+ // go int32(i)
+ // return i
+ // }
+ InvalidGo
+
+ // All codes below were added in Go 1.17.
+
+ /* decl */
+
+ // BadDecl occurs when a declaration has invalid syntax.
+ BadDecl
+
+ // RepeatedDecl occurs when an identifier occurs more than once on the left
+ // hand side of a short variable declaration.
+ //
+ // Example:
+ // func _() {
+ // x, y, y := 1, 2, 3
+ // }
+ RepeatedDecl
+
+ /* unsafe */
+
+ // InvalidUnsafeAdd occurs when unsafe.Add is called with a
+ // length argument that is not of integer type.
+ //
+ // Example:
+ // import "unsafe"
+ //
+ // var p unsafe.Pointer
+ // var _ = unsafe.Add(p, float64(1))
+ InvalidUnsafeAdd
+
+ // InvalidUnsafeSlice occurs when unsafe.Slice is called with a
+ // pointer argument that is not of pointer type or a length argument
+ // that is not of integer type, negative, or out of bounds.
+ //
+ // Example:
+ // import "unsafe"
+ //
+ // var x int
+ // var _ = unsafe.Slice(x, 1)
+ //
+ // Example:
+ // import "unsafe"
+ //
+ // var x int
+ // var _ = unsafe.Slice(&x, float64(1))
+ //
+ // Example:
+ // import "unsafe"
+ //
+ // var x int
+ // var _ = unsafe.Slice(&x, -1)
+ //
+ // Example:
+ // import "unsafe"
+ //
+ // var x int
+ // var _ = unsafe.Slice(&x, uint64(1) << 63)
+ InvalidUnsafeSlice
+
+ // All codes below were added in Go 1.18.
+
+ /* features */
+
+ // UnsupportedFeature occurs when a language feature is used that is not
+ // supported at this Go version.
+ UnsupportedFeature
+
+ /* type params */
+
+ // NotAGenericType occurs when a non-generic type is used where a generic
+ // type is expected: in type or function instantiation.
+ //
+ // Example:
+ // type T int
+ //
+ // var _ T[int]
+ NotAGenericType
+
+ // WrongTypeArgCount occurs when a type or function is instantiated with an
+ // incorrect number of type arguments, including when a generic type or
+ // function is used without instantiation.
+ //
+ // Errors involving failed type inference are assigned other error codes.
+ //
+ // Example:
+ // type T[p any] int
+ //
+ // var _ T[int, string]
+ //
+ // Example:
+ // func f[T any]() {}
+ //
+ // var x = f
+ WrongTypeArgCount
+
+ // CannotInferTypeArgs occurs when type or function type argument inference
+ // fails to infer all type arguments.
+ //
+ // Example:
+ // func f[T any]() {}
+ //
+ // func _() {
+ // f()
+ // }
+ //
+ // Example:
+ // type N[P, Q any] struct{}
+ //
+ // var _ N[int]
+ CannotInferTypeArgs
+
+ // InvalidTypeArg occurs when a type argument does not satisfy its
+ // corresponding type parameter constraints.
+ //
+ // Example:
+ // type T[P ~int] struct{}
+ //
+ // var _ T[string]
+ InvalidTypeArg // arguments? InferenceFailed
+
+ // InvalidInstanceCycle occurs when an invalid cycle is detected
+ // within the instantiation graph.
+ //
+ // Example:
+ // func f[T any]() { f[*T]() }
+ InvalidInstanceCycle
+
+ // InvalidUnion occurs when an embedded union or approximation element is
+ // not valid.
+ //
+ // Example:
+ // type _ interface {
+ // ~int | interface{ m() }
+ // }
+ InvalidUnion
+
+ // MisplacedConstraintIface occurs when a constraint-type interface is used
+ // outside of constraint position.
+ //
+ // Example:
+ // type I interface { ~int }
+ //
+ // var _ I
+ MisplacedConstraintIface
+
+ // InvalidMethodTypeParams occurs when methods have type parameters.
+ //
+ // It cannot be encountered with an AST parsed using go/parser.
+ InvalidMethodTypeParams
+
+ // MisplacedTypeParam occurs when a type parameter is used in a place where
+ // it is not permitted.
+ //
+ // Example:
+ // type T[P any] P
+ //
+ // Example:
+ // type T[P any] struct{ *P }
+ MisplacedTypeParam
+
+ // InvalidUnsafeSliceData occurs when unsafe.SliceData is called with
+ // an argument that is not of slice type. It also occurs if it is used
+ // in a package compiled for a language version before go1.20.
+ //
+ // Example:
+ // import "unsafe"
+ //
+ // var x int
+ // var _ = unsafe.SliceData(x)
+ InvalidUnsafeSliceData
+
+ // InvalidUnsafeString occurs when unsafe.String is called with
+ // a length argument that is not of integer type, negative, or
+ // out of bounds. It also occurs if it is used in a package
+ // compiled for a language version before go1.20.
+ //
+ // Example:
+ // import "unsafe"
+ //
+ // var b [10]byte
+ // var _ = unsafe.String(&b[0], -1)
+ InvalidUnsafeString
+
+ // InvalidUnsafeStringData occurs if it is used in a package
+ // compiled for a language version before go1.20.
+ _ // not used anymore
+
+)
diff --git a/vendor/golang.org/x/tools/internal/typesinternal/errorcode_string.go b/vendor/golang.org/x/tools/internal/typesinternal/errorcode_string.go
new file mode 100644
index 00000000..15ecf7c5
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/typesinternal/errorcode_string.go
@@ -0,0 +1,179 @@
+// Code generated by "stringer -type=ErrorCode"; DO NOT EDIT.
+
+package typesinternal
+
+import "strconv"
+
+func _() {
+ // An "invalid array index" compiler error signifies that the constant values have changed.
+ // Re-run the stringer command to generate them again.
+ var x [1]struct{}
+ _ = x[InvalidSyntaxTree - -1]
+ _ = x[Test-1]
+ _ = x[BlankPkgName-2]
+ _ = x[MismatchedPkgName-3]
+ _ = x[InvalidPkgUse-4]
+ _ = x[BadImportPath-5]
+ _ = x[BrokenImport-6]
+ _ = x[ImportCRenamed-7]
+ _ = x[UnusedImport-8]
+ _ = x[InvalidInitCycle-9]
+ _ = x[DuplicateDecl-10]
+ _ = x[InvalidDeclCycle-11]
+ _ = x[InvalidTypeCycle-12]
+ _ = x[InvalidConstInit-13]
+ _ = x[InvalidConstVal-14]
+ _ = x[InvalidConstType-15]
+ _ = x[UntypedNilUse-16]
+ _ = x[WrongAssignCount-17]
+ _ = x[UnassignableOperand-18]
+ _ = x[NoNewVar-19]
+ _ = x[MultiValAssignOp-20]
+ _ = x[InvalidIfaceAssign-21]
+ _ = x[InvalidChanAssign-22]
+ _ = x[IncompatibleAssign-23]
+ _ = x[UnaddressableFieldAssign-24]
+ _ = x[NotAType-25]
+ _ = x[InvalidArrayLen-26]
+ _ = x[BlankIfaceMethod-27]
+ _ = x[IncomparableMapKey-28]
+ _ = x[InvalidIfaceEmbed-29]
+ _ = x[InvalidPtrEmbed-30]
+ _ = x[BadRecv-31]
+ _ = x[InvalidRecv-32]
+ _ = x[DuplicateFieldAndMethod-33]
+ _ = x[DuplicateMethod-34]
+ _ = x[InvalidBlank-35]
+ _ = x[InvalidIota-36]
+ _ = x[MissingInitBody-37]
+ _ = x[InvalidInitSig-38]
+ _ = x[InvalidInitDecl-39]
+ _ = x[InvalidMainDecl-40]
+ _ = x[TooManyValues-41]
+ _ = x[NotAnExpr-42]
+ _ = x[TruncatedFloat-43]
+ _ = x[NumericOverflow-44]
+ _ = x[UndefinedOp-45]
+ _ = x[MismatchedTypes-46]
+ _ = x[DivByZero-47]
+ _ = x[NonNumericIncDec-48]
+ _ = x[UnaddressableOperand-49]
+ _ = x[InvalidIndirection-50]
+ _ = x[NonIndexableOperand-51]
+ _ = x[InvalidIndex-52]
+ _ = x[SwappedSliceIndices-53]
+ _ = x[NonSliceableOperand-54]
+ _ = x[InvalidSliceExpr-55]
+ _ = x[InvalidShiftCount-56]
+ _ = x[InvalidShiftOperand-57]
+ _ = x[InvalidReceive-58]
+ _ = x[InvalidSend-59]
+ _ = x[DuplicateLitKey-60]
+ _ = x[MissingLitKey-61]
+ _ = x[InvalidLitIndex-62]
+ _ = x[OversizeArrayLit-63]
+ _ = x[MixedStructLit-64]
+ _ = x[InvalidStructLit-65]
+ _ = x[MissingLitField-66]
+ _ = x[DuplicateLitField-67]
+ _ = x[UnexportedLitField-68]
+ _ = x[InvalidLitField-69]
+ _ = x[UntypedLit-70]
+ _ = x[InvalidLit-71]
+ _ = x[AmbiguousSelector-72]
+ _ = x[UndeclaredImportedName-73]
+ _ = x[UnexportedName-74]
+ _ = x[UndeclaredName-75]
+ _ = x[MissingFieldOrMethod-76]
+ _ = x[BadDotDotDotSyntax-77]
+ _ = x[NonVariadicDotDotDot-78]
+ _ = x[MisplacedDotDotDot-79]
+ _ = x[InvalidDotDotDotOperand-80]
+ _ = x[InvalidDotDotDot-81]
+ _ = x[UncalledBuiltin-82]
+ _ = x[InvalidAppend-83]
+ _ = x[InvalidCap-84]
+ _ = x[InvalidClose-85]
+ _ = x[InvalidCopy-86]
+ _ = x[InvalidComplex-87]
+ _ = x[InvalidDelete-88]
+ _ = x[InvalidImag-89]
+ _ = x[InvalidLen-90]
+ _ = x[SwappedMakeArgs-91]
+ _ = x[InvalidMake-92]
+ _ = x[InvalidReal-93]
+ _ = x[InvalidAssert-94]
+ _ = x[ImpossibleAssert-95]
+ _ = x[InvalidConversion-96]
+ _ = x[InvalidUntypedConversion-97]
+ _ = x[BadOffsetofSyntax-98]
+ _ = x[InvalidOffsetof-99]
+ _ = x[UnusedExpr-100]
+ _ = x[UnusedVar-101]
+ _ = x[MissingReturn-102]
+ _ = x[WrongResultCount-103]
+ _ = x[OutOfScopeResult-104]
+ _ = x[InvalidCond-105]
+ _ = x[InvalidPostDecl-106]
+ _ = x[InvalidChanRange-107]
+ _ = x[InvalidIterVar-108]
+ _ = x[InvalidRangeExpr-109]
+ _ = x[MisplacedBreak-110]
+ _ = x[MisplacedContinue-111]
+ _ = x[MisplacedFallthrough-112]
+ _ = x[DuplicateCase-113]
+ _ = x[DuplicateDefault-114]
+ _ = x[BadTypeKeyword-115]
+ _ = x[InvalidTypeSwitch-116]
+ _ = x[InvalidExprSwitch-117]
+ _ = x[InvalidSelectCase-118]
+ _ = x[UndeclaredLabel-119]
+ _ = x[DuplicateLabel-120]
+ _ = x[MisplacedLabel-121]
+ _ = x[UnusedLabel-122]
+ _ = x[JumpOverDecl-123]
+ _ = x[JumpIntoBlock-124]
+ _ = x[InvalidMethodExpr-125]
+ _ = x[WrongArgCount-126]
+ _ = x[InvalidCall-127]
+ _ = x[UnusedResults-128]
+ _ = x[InvalidDefer-129]
+ _ = x[InvalidGo-130]
+ _ = x[BadDecl-131]
+ _ = x[RepeatedDecl-132]
+ _ = x[InvalidUnsafeAdd-133]
+ _ = x[InvalidUnsafeSlice-134]
+ _ = x[UnsupportedFeature-135]
+ _ = x[NotAGenericType-136]
+ _ = x[WrongTypeArgCount-137]
+ _ = x[CannotInferTypeArgs-138]
+ _ = x[InvalidTypeArg-139]
+ _ = x[InvalidInstanceCycle-140]
+ _ = x[InvalidUnion-141]
+ _ = x[MisplacedConstraintIface-142]
+ _ = x[InvalidMethodTypeParams-143]
+ _ = x[MisplacedTypeParam-144]
+ _ = x[InvalidUnsafeSliceData-145]
+ _ = x[InvalidUnsafeString-146]
+}
+
+const (
+ _ErrorCode_name_0 = "InvalidSyntaxTree"
+ _ErrorCode_name_1 = "TestBlankPkgNameMismatchedPkgNameInvalidPkgUseBadImportPathBrokenImportImportCRenamedUnusedImportInvalidInitCycleDuplicateDeclInvalidDeclCycleInvalidTypeCycleInvalidConstInitInvalidConstValInvalidConstTypeUntypedNilUseWrongAssignCountUnassignableOperandNoNewVarMultiValAssignOpInvalidIfaceAssignInvalidChanAssignIncompatibleAssignUnaddressableFieldAssignNotATypeInvalidArrayLenBlankIfaceMethodIncomparableMapKeyInvalidIfaceEmbedInvalidPtrEmbedBadRecvInvalidRecvDuplicateFieldAndMethodDuplicateMethodInvalidBlankInvalidIotaMissingInitBodyInvalidInitSigInvalidInitDeclInvalidMainDeclTooManyValuesNotAnExprTruncatedFloatNumericOverflowUndefinedOpMismatchedTypesDivByZeroNonNumericIncDecUnaddressableOperandInvalidIndirectionNonIndexableOperandInvalidIndexSwappedSliceIndicesNonSliceableOperandInvalidSliceExprInvalidShiftCountInvalidShiftOperandInvalidReceiveInvalidSendDuplicateLitKeyMissingLitKeyInvalidLitIndexOversizeArrayLitMixedStructLitInvalidStructLitMissingLitFieldDuplicateLitFieldUnexportedLitFieldInvalidLitFieldUntypedLitInvalidLitAmbiguousSelectorUndeclaredImportedNameUnexportedNameUndeclaredNameMissingFieldOrMethodBadDotDotDotSyntaxNonVariadicDotDotDotMisplacedDotDotDotInvalidDotDotDotOperandInvalidDotDotDotUncalledBuiltinInvalidAppendInvalidCapInvalidCloseInvalidCopyInvalidComplexInvalidDeleteInvalidImagInvalidLenSwappedMakeArgsInvalidMakeInvalidRealInvalidAssertImpossibleAssertInvalidConversionInvalidUntypedConversionBadOffsetofSyntaxInvalidOffsetofUnusedExprUnusedVarMissingReturnWrongResultCountOutOfScopeResultInvalidCondInvalidPostDeclInvalidChanRangeInvalidIterVarInvalidRangeExprMisplacedBreakMisplacedContinueMisplacedFallthroughDuplicateCaseDuplicateDefaultBadTypeKeywordInvalidTypeSwitchInvalidExprSwitchInvalidSelectCaseUndeclaredLabelDuplicateLabelMisplacedLabelUnusedLabelJumpOverDeclJumpIntoBlockInvalidMethodExprWrongArgCountInvalidCallUnusedResultsInvalidDeferInvalidGoBadDeclRepeatedDeclInvalidUnsafeAddInvalidUnsafeSliceUnsupportedFeatureNotAGenericTypeWrongTypeArgCountCannotInferTypeArgsInvalidTypeArgInvalidInstanceCycleInvalidUnionMisplacedConstraintIfaceInvalidMethodTypeParamsMisplacedTypeParamInvalidUnsafeSliceDataInvalidUnsafeString"
+)
+
+var (
+ _ErrorCode_index_1 = [...]uint16{0, 4, 16, 33, 46, 59, 71, 85, 97, 113, 126, 142, 158, 174, 189, 205, 218, 234, 253, 261, 277, 295, 312, 330, 354, 362, 377, 393, 411, 428, 443, 450, 461, 484, 499, 511, 522, 537, 551, 566, 581, 594, 603, 617, 632, 643, 658, 667, 683, 703, 721, 740, 752, 771, 790, 806, 823, 842, 856, 867, 882, 895, 910, 926, 940, 956, 971, 988, 1006, 1021, 1031, 1041, 1058, 1080, 1094, 1108, 1128, 1146, 1166, 1184, 1207, 1223, 1238, 1251, 1261, 1273, 1284, 1298, 1311, 1322, 1332, 1347, 1358, 1369, 1382, 1398, 1415, 1439, 1456, 1471, 1481, 1490, 1503, 1519, 1535, 1546, 1561, 1577, 1591, 1607, 1621, 1638, 1658, 1671, 1687, 1701, 1718, 1735, 1752, 1767, 1781, 1795, 1806, 1818, 1831, 1848, 1861, 1872, 1885, 1897, 1906, 1913, 1925, 1941, 1959, 1977, 1992, 2009, 2028, 2042, 2062, 2074, 2098, 2121, 2139, 2161, 2180}
+)
+
+func (i ErrorCode) String() string {
+ switch {
+ case i == -1:
+ return _ErrorCode_name_0
+ case 1 <= i && i <= 146:
+ i -= 1
+ return _ErrorCode_name_1[_ErrorCode_index_1[i]:_ErrorCode_index_1[i+1]]
+ default:
+ return "ErrorCode(" + strconv.FormatInt(int64(i), 10) + ")"
+ }
+}
diff --git a/vendor/golang.org/x/tools/internal/typesinternal/recv.go b/vendor/golang.org/x/tools/internal/typesinternal/recv.go
new file mode 100644
index 00000000..ba6f4f4e
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/typesinternal/recv.go
@@ -0,0 +1,41 @@
+// Copyright 2024 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package typesinternal
+
+import (
+ "go/types"
+)
+
+// ReceiverNamed returns the named type (if any) associated with the
+// type of recv, which may be of the form N or *N, or aliases thereof.
+// It also reports whether a Pointer was present.
+func ReceiverNamed(recv *types.Var) (isPtr bool, named *types.Named) {
+ t := recv.Type()
+ if ptr, ok := types.Unalias(t).(*types.Pointer); ok {
+ isPtr = true
+ t = ptr.Elem()
+ }
+ named, _ = types.Unalias(t).(*types.Named)
+ return
+}
+
+// Unpointer returns T given *T or an alias thereof.
+// For all other types it is the identity function.
+// It does not look at underlying types.
+// The result may be an alias.
+//
+// Use this function to strip off the optional pointer on a receiver
+// in a field or method selection, without losing the named type
+// (which is needed to compute the method set).
+//
+// See also [typeparams.MustDeref], which removes one level of
+// indirection from the type, regardless of named types (analogous to
+// a LOAD instruction).
+func Unpointer(t types.Type) types.Type {
+ if ptr, ok := types.Unalias(t).(*types.Pointer); ok {
+ return ptr.Elem()
+ }
+ return t
+}
diff --git a/vendor/golang.org/x/tools/internal/typesinternal/toonew.go b/vendor/golang.org/x/tools/internal/typesinternal/toonew.go
new file mode 100644
index 00000000..cc86487e
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/typesinternal/toonew.go
@@ -0,0 +1,89 @@
+// Copyright 2024 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package typesinternal
+
+import (
+ "go/types"
+
+ "golang.org/x/tools/internal/stdlib"
+ "golang.org/x/tools/internal/versions"
+)
+
+// TooNewStdSymbols computes the set of package-level symbols
+// exported by pkg that are not available at the specified version.
+// The result maps each symbol to its minimum version.
+//
+// The pkg is allowed to contain type errors.
+func TooNewStdSymbols(pkg *types.Package, version string) map[types.Object]string {
+ disallowed := make(map[types.Object]string)
+
+ // Pass 1: package-level symbols.
+ symbols := stdlib.PackageSymbols[pkg.Path()]
+ for _, sym := range symbols {
+ symver := sym.Version.String()
+ if versions.Before(version, symver) {
+ switch sym.Kind {
+ case stdlib.Func, stdlib.Var, stdlib.Const, stdlib.Type:
+ disallowed[pkg.Scope().Lookup(sym.Name)] = symver
+ }
+ }
+ }
+
+ // Pass 2: fields and methods.
+ //
+ // We allow fields and methods if their associated type is
+ // disallowed, as otherwise we would report false positives
+ // for compatibility shims. Consider:
+ //
+ // //go:build go1.22
+ // type T struct { F std.Real } // correct new API
+ //
+ // //go:build !go1.22
+ // type T struct { F fake } // shim
+ // type fake struct { ... }
+ // func (fake) M () {}
+ //
+ // These alternative declarations of T use either the std.Real
+ // type, introduced in go1.22, or a fake type, for the field
+ // F. (The fakery could be arbitrarily deep, involving more
+ // nested fields and methods than are shown here.) Clients
+ // that use the compatibility shim T will compile with any
+ // version of go, whether older or newer than go1.22, but only
+ // the newer version will use the std.Real implementation.
+ //
+ // Now consider a reference to method M in new(T).F.M() in a
+ // module that requires a minimum of go1.21. The analysis may
+ // occur using a version of Go higher than 1.21, selecting the
+ // first version of T, so the method M is Real.M. This would
+ // spuriously cause the analyzer to report a reference to a
+ // too-new symbol even though this expression compiles just
+ // fine (with the fake implementation) using go1.21.
+ for _, sym := range symbols {
+ symVersion := sym.Version.String()
+ if !versions.Before(version, symVersion) {
+ continue // allowed
+ }
+
+ var obj types.Object
+ switch sym.Kind {
+ case stdlib.Field:
+ typename, name := sym.SplitField()
+ if t := pkg.Scope().Lookup(typename); t != nil && disallowed[t] == "" {
+ obj, _, _ = types.LookupFieldOrMethod(t.Type(), false, pkg, name)
+ }
+
+ case stdlib.Method:
+ ptr, recvname, name := sym.SplitMethod()
+ if t := pkg.Scope().Lookup(recvname); t != nil && disallowed[t] == "" {
+ obj, _, _ = types.LookupFieldOrMethod(t.Type(), ptr, pkg, name)
+ }
+ }
+ if obj != nil {
+ disallowed[obj] = symVersion
+ }
+ }
+
+ return disallowed
+}
diff --git a/vendor/golang.org/x/tools/internal/typesinternal/types.go b/vendor/golang.org/x/tools/internal/typesinternal/types.go
new file mode 100644
index 00000000..df3ea521
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/typesinternal/types.go
@@ -0,0 +1,121 @@
+// Copyright 2020 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Package typesinternal provides access to internal go/types APIs that are not
+// yet exported.
+package typesinternal
+
+import (
+ "go/token"
+ "go/types"
+ "reflect"
+ "unsafe"
+
+ "golang.org/x/tools/internal/aliases"
+)
+
+func SetUsesCgo(conf *types.Config) bool {
+ v := reflect.ValueOf(conf).Elem()
+
+ f := v.FieldByName("go115UsesCgo")
+ if !f.IsValid() {
+ f = v.FieldByName("UsesCgo")
+ if !f.IsValid() {
+ return false
+ }
+ }
+
+ addr := unsafe.Pointer(f.UnsafeAddr())
+ *(*bool)(addr) = true
+
+ return true
+}
+
+// ReadGo116ErrorData extracts additional information from types.Error values
+// generated by Go version 1.16 and later: the error code, start position, and
+// end position. If all positions are valid, start <= err.Pos <= end.
+//
+// If the data could not be read, the final result parameter will be false.
+func ReadGo116ErrorData(err types.Error) (code ErrorCode, start, end token.Pos, ok bool) {
+ var data [3]int
+ // By coincidence all of these fields are ints, which simplifies things.
+ v := reflect.ValueOf(err)
+ for i, name := range []string{"go116code", "go116start", "go116end"} {
+ f := v.FieldByName(name)
+ if !f.IsValid() {
+ return 0, 0, 0, false
+ }
+ data[i] = int(f.Int())
+ }
+ return ErrorCode(data[0]), token.Pos(data[1]), token.Pos(data[2]), true
+}
+
+// NameRelativeTo returns a types.Qualifier that qualifies members of
+// all packages other than pkg, using only the package name.
+// (By contrast, [types.RelativeTo] uses the complete package path,
+// which is often excessive.)
+//
+// If pkg is nil, it is equivalent to [*types.Package.Name].
+func NameRelativeTo(pkg *types.Package) types.Qualifier {
+ return func(other *types.Package) string {
+ if pkg != nil && pkg == other {
+ return "" // same package; unqualified
+ }
+ return other.Name()
+ }
+}
+
+// A NamedOrAlias is a [types.Type] that is named (as
+// defined by the spec) and capable of bearing type parameters: it
+// abstracts aliases ([types.Alias]) and defined types
+// ([types.Named]).
+//
+// Every type declared by an explicit "type" declaration is a
+// NamedOrAlias. (Built-in type symbols may additionally
+// have type [types.Basic], which is not a NamedOrAlias,
+// though the spec regards them as "named".)
+//
+// NamedOrAlias cannot expose the Origin method, because
+// [types.Alias.Origin] and [types.Named.Origin] have different
+// (covariant) result types; use [Origin] instead.
+type NamedOrAlias interface {
+ types.Type
+ Obj() *types.TypeName
+}
+
+// TypeParams is a light shim around t.TypeParams().
+// (go/types.Alias).TypeParams requires >= 1.23.
+func TypeParams(t NamedOrAlias) *types.TypeParamList {
+ switch t := t.(type) {
+ case *types.Alias:
+ return aliases.TypeParams(t)
+ case *types.Named:
+ return t.TypeParams()
+ }
+ return nil
+}
+
+// TypeArgs is a light shim around t.TypeArgs().
+// (go/types.Alias).TypeArgs requires >= 1.23.
+func TypeArgs(t NamedOrAlias) *types.TypeList {
+ switch t := t.(type) {
+ case *types.Alias:
+ return aliases.TypeArgs(t)
+ case *types.Named:
+ return t.TypeArgs()
+ }
+ return nil
+}
+
+// Origin returns the generic type of the Named or Alias type t if it
+// is instantiated, otherwise it returns t.
+func Origin(t NamedOrAlias) NamedOrAlias {
+ switch t := t.(type) {
+ case *types.Alias:
+ return aliases.Origin(t)
+ case *types.Named:
+ return t.Origin()
+ }
+ return t
+}
diff --git a/vendor/golang.org/x/tools/internal/versions/constraint.go b/vendor/golang.org/x/tools/internal/versions/constraint.go
new file mode 100644
index 00000000..179063d4
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/versions/constraint.go
@@ -0,0 +1,13 @@
+// Copyright 2024 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package versions
+
+import "go/build/constraint"
+
+// ConstraintGoVersion is constraint.GoVersion (if built with go1.21+).
+// Otherwise nil.
+//
+// Deprecate once x/tools is after go1.21.
+var ConstraintGoVersion func(x constraint.Expr) string
diff --git a/vendor/golang.org/x/tools/internal/versions/constraint_go121.go b/vendor/golang.org/x/tools/internal/versions/constraint_go121.go
new file mode 100644
index 00000000..38011407
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/versions/constraint_go121.go
@@ -0,0 +1,14 @@
+// Copyright 2024 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build go1.21
+// +build go1.21
+
+package versions
+
+import "go/build/constraint"
+
+func init() {
+ ConstraintGoVersion = constraint.GoVersion
+}
diff --git a/vendor/golang.org/x/tools/internal/versions/features.go b/vendor/golang.org/x/tools/internal/versions/features.go
new file mode 100644
index 00000000..b53f1786
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/versions/features.go
@@ -0,0 +1,43 @@
+// Copyright 2023 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package versions
+
+// This file contains predicates for working with file versions to
+// decide when a tool should consider a language feature enabled.
+
+// GoVersions that features in x/tools can be gated to.
+const (
+ Go1_18 = "go1.18"
+ Go1_19 = "go1.19"
+ Go1_20 = "go1.20"
+ Go1_21 = "go1.21"
+ Go1_22 = "go1.22"
+)
+
+// Future is an invalid unknown Go version sometime in the future.
+// Do not use directly with Compare.
+const Future = ""
+
+// AtLeast reports whether the file version v comes after a Go release.
+//
+// Use this predicate to enable a behavior once a certain Go release
+// has happened (and stays enabled in the future).
+func AtLeast(v, release string) bool {
+ if v == Future {
+ return true // an unknown future version is always after y.
+ }
+ return Compare(Lang(v), Lang(release)) >= 0
+}
+
+// Before reports whether the file version v is strictly before a Go release.
+//
+// Use this predicate to disable a behavior once a certain Go release
+// has happened (and stays enabled in the future).
+func Before(v, release string) bool {
+ if v == Future {
+ return false // an unknown future version happens after y.
+ }
+ return Compare(Lang(v), Lang(release)) < 0
+}
diff --git a/vendor/golang.org/x/tools/internal/versions/gover.go b/vendor/golang.org/x/tools/internal/versions/gover.go
new file mode 100644
index 00000000..bbabcd22
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/versions/gover.go
@@ -0,0 +1,172 @@
+// Copyright 2023 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// This is a fork of internal/gover for use by x/tools until
+// go1.21 and earlier are no longer supported by x/tools.
+
+package versions
+
+import "strings"
+
+// A gover is a parsed Go gover: major[.Minor[.Patch]][kind[pre]]
+// The numbers are the original decimal strings to avoid integer overflows
+// and since there is very little actual math. (Probably overflow doesn't matter in practice,
+// but at the time this code was written, there was an existing test that used
+// go1.99999999999, which does not fit in an int on 32-bit platforms.
+// The "big decimal" representation avoids the problem entirely.)
+type gover struct {
+ major string // decimal
+ minor string // decimal or ""
+ patch string // decimal or ""
+ kind string // "", "alpha", "beta", "rc"
+ pre string // decimal or ""
+}
+
+// compare returns -1, 0, or +1 depending on whether
+// x < y, x == y, or x > y, interpreted as toolchain versions.
+// The versions x and y must not begin with a "go" prefix: just "1.21" not "go1.21".
+// Malformed versions compare less than well-formed versions and equal to each other.
+// The language version "1.21" compares less than the release candidate and eventual releases "1.21rc1" and "1.21.0".
+func compare(x, y string) int {
+ vx := parse(x)
+ vy := parse(y)
+
+ if c := cmpInt(vx.major, vy.major); c != 0 {
+ return c
+ }
+ if c := cmpInt(vx.minor, vy.minor); c != 0 {
+ return c
+ }
+ if c := cmpInt(vx.patch, vy.patch); c != 0 {
+ return c
+ }
+ if c := strings.Compare(vx.kind, vy.kind); c != 0 { // "" < alpha < beta < rc
+ return c
+ }
+ if c := cmpInt(vx.pre, vy.pre); c != 0 {
+ return c
+ }
+ return 0
+}
+
+// lang returns the Go language version. For example, lang("1.2.3") == "1.2".
+func lang(x string) string {
+ v := parse(x)
+ if v.minor == "" || v.major == "1" && v.minor == "0" {
+ return v.major
+ }
+ return v.major + "." + v.minor
+}
+
+// isValid reports whether the version x is valid.
+func isValid(x string) bool {
+ return parse(x) != gover{}
+}
+
+// parse parses the Go version string x into a version.
+// It returns the zero version if x is malformed.
+func parse(x string) gover {
+ var v gover
+
+ // Parse major version.
+ var ok bool
+ v.major, x, ok = cutInt(x)
+ if !ok {
+ return gover{}
+ }
+ if x == "" {
+ // Interpret "1" as "1.0.0".
+ v.minor = "0"
+ v.patch = "0"
+ return v
+ }
+
+ // Parse . before minor version.
+ if x[0] != '.' {
+ return gover{}
+ }
+
+ // Parse minor version.
+ v.minor, x, ok = cutInt(x[1:])
+ if !ok {
+ return gover{}
+ }
+ if x == "" {
+ // Patch missing is same as "0" for older versions.
+ // Starting in Go 1.21, patch missing is different from explicit .0.
+ if cmpInt(v.minor, "21") < 0 {
+ v.patch = "0"
+ }
+ return v
+ }
+
+ // Parse patch if present.
+ if x[0] == '.' {
+ v.patch, x, ok = cutInt(x[1:])
+ if !ok || x != "" {
+ // Note that we are disallowing prereleases (alpha, beta, rc) for patch releases here (x != "").
+ // Allowing them would be a bit confusing because we already have:
+ // 1.21 < 1.21rc1
+ // But a prerelease of a patch would have the opposite effect:
+ // 1.21.3rc1 < 1.21.3
+ // We've never needed them before, so let's not start now.
+ return gover{}
+ }
+ return v
+ }
+
+ // Parse prerelease.
+ i := 0
+ for i < len(x) && (x[i] < '0' || '9' < x[i]) {
+ if x[i] < 'a' || 'z' < x[i] {
+ return gover{}
+ }
+ i++
+ }
+ if i == 0 {
+ return gover{}
+ }
+ v.kind, x = x[:i], x[i:]
+ if x == "" {
+ return v
+ }
+ v.pre, x, ok = cutInt(x)
+ if !ok || x != "" {
+ return gover{}
+ }
+
+ return v
+}
+
+// cutInt scans the leading decimal number at the start of x to an integer
+// and returns that value and the rest of the string.
+func cutInt(x string) (n, rest string, ok bool) {
+ i := 0
+ for i < len(x) && '0' <= x[i] && x[i] <= '9' {
+ i++
+ }
+ if i == 0 || x[0] == '0' && i != 1 { // no digits or unnecessary leading zero
+ return "", "", false
+ }
+ return x[:i], x[i:], true
+}
+
+// cmpInt returns cmp.Compare(x, y) interpreting x and y as decimal numbers.
+// (Copied from golang.org/x/mod/semver's compareInt.)
+func cmpInt(x, y string) int {
+ if x == y {
+ return 0
+ }
+ if len(x) < len(y) {
+ return -1
+ }
+ if len(x) > len(y) {
+ return +1
+ }
+ if x < y {
+ return -1
+ } else {
+ return +1
+ }
+}
diff --git a/vendor/golang.org/x/tools/internal/versions/types.go b/vendor/golang.org/x/tools/internal/versions/types.go
new file mode 100644
index 00000000..0fc10ce4
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/versions/types.go
@@ -0,0 +1,33 @@
+// Copyright 2023 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package versions
+
+import (
+ "go/ast"
+ "go/types"
+)
+
+// FileVersion returns a file's Go version.
+// The reported version is an unknown Future version if a
+// version cannot be determined.
+func FileVersion(info *types.Info, file *ast.File) string {
+ // In tools built with Go >= 1.22, the Go version of a file
+ // follow a cascades of sources:
+ // 1) types.Info.FileVersion, which follows the cascade:
+ // 1.a) file version (ast.File.GoVersion),
+ // 1.b) the package version (types.Config.GoVersion), or
+ // 2) is some unknown Future version.
+ //
+ // File versions require a valid package version to be provided to types
+ // in Config.GoVersion. Config.GoVersion is either from the package's module
+ // or the toolchain (go run). This value should be provided by go/packages
+ // or unitchecker.Config.GoVersion.
+ if v := info.FileVersions[file]; IsValid(v) {
+ return v
+ }
+ // Note: we could instead return runtime.Version() [if valid].
+ // This would act as a max version on what a tool can support.
+ return Future
+}
diff --git a/vendor/golang.org/x/tools/internal/versions/versions.go b/vendor/golang.org/x/tools/internal/versions/versions.go
new file mode 100644
index 00000000..8d1f7453
--- /dev/null
+++ b/vendor/golang.org/x/tools/internal/versions/versions.go
@@ -0,0 +1,57 @@
+// Copyright 2023 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package versions
+
+import (
+ "strings"
+)
+
+// Note: If we use build tags to use go/versions when go >=1.22,
+// we run into go.dev/issue/53737. Under some operations users would see an
+// import of "go/versions" even if they would not compile the file.
+// For example, during `go get -u ./...` (go.dev/issue/64490) we do not try to include
+// For this reason, this library just a clone of go/versions for the moment.
+
+// Lang returns the Go language version for version x.
+// If x is not a valid version, Lang returns the empty string.
+// For example:
+//
+// Lang("go1.21rc2") = "go1.21"
+// Lang("go1.21.2") = "go1.21"
+// Lang("go1.21") = "go1.21"
+// Lang("go1") = "go1"
+// Lang("bad") = ""
+// Lang("1.21") = ""
+func Lang(x string) string {
+ v := lang(stripGo(x))
+ if v == "" {
+ return ""
+ }
+ return x[:2+len(v)] // "go"+v without allocation
+}
+
+// Compare returns -1, 0, or +1 depending on whether
+// x < y, x == y, or x > y, interpreted as Go versions.
+// The versions x and y must begin with a "go" prefix: "go1.21" not "1.21".
+// Invalid versions, including the empty string, compare less than
+// valid versions and equal to each other.
+// The language version "go1.21" compares less than the
+// release candidate and eventual releases "go1.21rc1" and "go1.21.0".
+// Custom toolchain suffixes are ignored during comparison:
+// "go1.21.0" and "go1.21.0-bigcorp" are equal.
+func Compare(x, y string) int { return compare(stripGo(x), stripGo(y)) }
+
+// IsValid reports whether the version x is valid.
+func IsValid(x string) bool { return isValid(stripGo(x)) }
+
+// stripGo converts from a "go1.21" version to a "1.21" version.
+// If v does not start with "go", stripGo returns the empty string (a known invalid version).
+func stripGo(v string) string {
+ v, _, _ = strings.Cut(v, "-") // strip -bigcorp suffix.
+ if len(v) < 2 || v[:2] != "go" {
+ return ""
+ }
+ return v[2:]
+}
diff --git a/vendor/google.golang.org/api/compute/v1/compute-api.json b/vendor/google.golang.org/api/compute/v1/compute-api.json
index 92948da6..8fe8c383 100644
--- a/vendor/google.golang.org/api/compute/v1/compute-api.json
+++ b/vendor/google.golang.org/api/compute/v1/compute-api.json
@@ -126,7 +126,7 @@
"acceleratorTypes": {
"methods": {
"aggregatedList": {
- "description": "Retrieves an aggregated list of accelerator types.",
+ "description": "Retrieves an aggregated list of accelerator types. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
"flatPath": "projects/{project}/aggregated/acceleratorTypes",
"httpMethod": "GET",
"id": "compute.acceleratorTypes.aggregatedList",
@@ -170,11 +170,12 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
"serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
"format": "int64",
"location": "query",
"type": "string"
@@ -274,7 +275,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
@@ -301,7 +302,7 @@
"addresses": {
"methods": {
"aggregatedList": {
- "description": "Retrieves an aggregated list of addresses.",
+ "description": "Retrieves an aggregated list of addresses. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
"flatPath": "projects/{project}/aggregated/addresses",
"httpMethod": "GET",
"id": "compute.addresses.aggregatedList",
@@ -345,11 +346,12 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
"serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
"format": "int64",
"location": "query",
"type": "string"
@@ -545,7 +547,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -665,7 +667,7 @@
"autoscalers": {
"methods": {
"aggregatedList": {
- "description": "Retrieves an aggregated list of autoscalers.",
+ "description": "Retrieves an aggregated list of autoscalers. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
"flatPath": "projects/{project}/aggregated/autoscalers",
"httpMethod": "GET",
"id": "compute.autoscalers.aggregatedList",
@@ -709,11 +711,12 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
"serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
"format": "int64",
"location": "query",
"type": "string"
@@ -902,7 +905,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
@@ -1299,7 +1302,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -1560,7 +1563,7 @@
]
},
"aggregatedList": {
- "description": "Retrieves the list of all BackendService resources, regional and global, available to the specified project.",
+ "description": "Retrieves the list of all BackendService resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
"flatPath": "projects/{project}/aggregated/backendServices",
"httpMethod": "GET",
"id": "compute.backendServices.aggregatedList",
@@ -1604,11 +1607,12 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
"serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
"format": "int64",
"location": "query",
"type": "string"
@@ -1895,7 +1899,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -1911,7 +1915,7 @@
]
},
"listUsable": {
- "description": "Retrieves an aggregated list of all usable backend services in the specified project.",
+ "description": "Retrieves a list of all usable backend services in the specified project.",
"flatPath": "projects/{project}/global/backendServices/listUsable",
"httpMethod": "GET",
"id": "compute.backendServices.listUsable",
@@ -1950,7 +1954,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -2211,7 +2215,7 @@
"diskTypes": {
"methods": {
"aggregatedList": {
- "description": "Retrieves an aggregated list of disk types.",
+ "description": "Retrieves an aggregated list of disk types. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
"flatPath": "projects/{project}/aggregated/diskTypes",
"httpMethod": "GET",
"id": "compute.diskTypes.aggregatedList",
@@ -2255,11 +2259,12 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
"serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
"format": "int64",
"location": "query",
"type": "string"
@@ -2359,7 +2364,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
@@ -2436,7 +2441,7 @@
]
},
"aggregatedList": {
- "description": "Retrieves an aggregated list of persistent disks.",
+ "description": "Retrieves an aggregated list of persistent disks. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
"flatPath": "projects/{project}/aggregated/disks",
"httpMethod": "GET",
"id": "compute.disks.aggregatedList",
@@ -2480,11 +2485,12 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
"serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
"format": "int64",
"location": "query",
"type": "string"
@@ -2823,7 +2829,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
@@ -3438,7 +3444,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -3861,7 +3867,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -4292,7 +4298,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -4396,7 +4402,7 @@
"forwardingRules": {
"methods": {
"aggregatedList": {
- "description": "Retrieves an aggregated list of forwarding rules.",
+ "description": "Retrieves an aggregated list of forwarding rules. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
"flatPath": "projects/{project}/aggregated/forwardingRules",
"httpMethod": "GET",
"id": "compute.forwardingRules.aggregatedList",
@@ -4440,11 +4446,12 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
"serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
"format": "int64",
"location": "query",
"type": "string"
@@ -4640,7 +4647,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -4957,7 +4964,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -5203,7 +5210,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -5571,7 +5578,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -5633,7 +5640,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -5653,7 +5660,7 @@
"globalOperations": {
"methods": {
"aggregatedList": {
- "description": "Retrieves an aggregated list of all operations.",
+ "description": "Retrieves an aggregated list of all operations. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
"flatPath": "projects/{project}/aggregated/operations",
"httpMethod": "GET",
"id": "compute.globalOperations.aggregatedList",
@@ -5697,11 +5704,12 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
"serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
"format": "int64",
"location": "query",
"type": "string"
@@ -5728,7 +5736,7 @@
],
"parameters": {
"operation": {
- "description": "Name of the Operations resource to delete.",
+ "description": "Name of the Operations resource to delete, or its unique numeric identifier.",
"location": "path",
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
"required": true,
@@ -5759,7 +5767,7 @@
],
"parameters": {
"operation": {
- "description": "Name of the Operations resource to return.",
+ "description": "Name of the Operations resource to return, or its unique numeric identifier.",
"location": "path",
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
"required": true,
@@ -5823,7 +5831,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -5849,7 +5857,7 @@
],
"parameters": {
"operation": {
- "description": "Name of the Operations resource to return.",
+ "description": "Name of the Operations resource to return, or its unique numeric identifier.",
"location": "path",
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
"required": true,
@@ -5887,7 +5895,7 @@
],
"parameters": {
"operation": {
- "description": "Name of the Operations resource to delete.",
+ "description": "Name of the Operations resource to delete, or its unique numeric identifier.",
"location": "path",
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
"required": true,
@@ -5915,7 +5923,7 @@
],
"parameters": {
"operation": {
- "description": "Name of the Operations resource to return.",
+ "description": "Name of the Operations resource to return, or its unique numeric identifier.",
"location": "path",
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
"required": true,
@@ -5972,7 +5980,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -6139,7 +6147,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -6201,7 +6209,7 @@
"healthChecks": {
"methods": {
"aggregatedList": {
- "description": "Retrieves the list of all HealthCheck resources, regional and global, available to the specified project.",
+ "description": "Retrieves the list of all HealthCheck resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
"flatPath": "projects/{project}/aggregated/healthChecks",
"httpMethod": "GET",
"id": "compute.healthChecks.aggregatedList",
@@ -6245,11 +6253,12 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
"serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
"format": "int64",
"location": "query",
"type": "string"
@@ -6413,7 +6422,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -6664,7 +6673,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -6915,7 +6924,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -7339,7 +7348,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -7510,6 +7519,279 @@
}
}
},
+ "instanceGroupManagerResizeRequests": {
+ "methods": {
+ "cancel": {
+ "description": "Cancels the specified resize request and removes it from the queue. Cancelled resize request does no longer wait for the resources to be provisioned. Cancel is only possible for requests that are accepted in the queue.",
+ "flatPath": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests/{resizeRequest}/cancel",
+ "httpMethod": "POST",
+ "id": "compute.instanceGroupManagerResizeRequests.cancel",
+ "parameterOrder": [
+ "project",
+ "zone",
+ "instanceGroupManager",
+ "resizeRequest"
+ ],
+ "parameters": {
+ "instanceGroupManager": {
+ "description": "The name of the managed instance group. The name should conform to RFC1035 or be a resource ID.",
+ "location": "path",
+ "required": true,
+ "type": "string"
+ },
+ "project": {
+ "description": "Project ID for this request.",
+ "location": "path",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "required": true,
+ "type": "string"
+ },
+ "requestId": {
+ "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
+ "location": "query",
+ "type": "string"
+ },
+ "resizeRequest": {
+ "description": "The name of the resize request to cancel. The name should conform to RFC1035 or be a resource ID.",
+ "location": "path",
+ "required": true,
+ "type": "string"
+ },
+ "zone": {
+ "description": "The name of the zone where the managed instance group is located. The name should conform to RFC1035.",
+ "location": "path",
+ "required": true,
+ "type": "string"
+ }
+ },
+ "path": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests/{resizeRequest}/cancel",
+ "response": {
+ "$ref": "Operation"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute"
+ ]
+ },
+ "delete": {
+ "description": "Deletes the specified, inactive resize request. Requests that are still active cannot be deleted. Deleting request does not delete instances that were provisioned previously.",
+ "flatPath": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests/{resizeRequest}",
+ "httpMethod": "DELETE",
+ "id": "compute.instanceGroupManagerResizeRequests.delete",
+ "parameterOrder": [
+ "project",
+ "zone",
+ "instanceGroupManager",
+ "resizeRequest"
+ ],
+ "parameters": {
+ "instanceGroupManager": {
+ "description": "The name of the managed instance group. The name should conform to RFC1035 or be a resource ID.",
+ "location": "path",
+ "required": true,
+ "type": "string"
+ },
+ "project": {
+ "description": "Project ID for this request.",
+ "location": "path",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "required": true,
+ "type": "string"
+ },
+ "requestId": {
+ "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
+ "location": "query",
+ "type": "string"
+ },
+ "resizeRequest": {
+ "description": "The name of the resize request to delete. The name should conform to RFC1035 or be a resource ID.",
+ "location": "path",
+ "required": true,
+ "type": "string"
+ },
+ "zone": {
+ "description": "The name of the zone where the managed instance group is located. The name should conform to RFC1035.",
+ "location": "path",
+ "required": true,
+ "type": "string"
+ }
+ },
+ "path": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests/{resizeRequest}",
+ "response": {
+ "$ref": "Operation"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute"
+ ]
+ },
+ "get": {
+ "description": "Returns all of the details about the specified resize request.",
+ "flatPath": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests/{resizeRequest}",
+ "httpMethod": "GET",
+ "id": "compute.instanceGroupManagerResizeRequests.get",
+ "parameterOrder": [
+ "project",
+ "zone",
+ "instanceGroupManager",
+ "resizeRequest"
+ ],
+ "parameters": {
+ "instanceGroupManager": {
+ "description": "The name of the managed instance group. Name should conform to RFC1035 or be a resource ID.",
+ "location": "path",
+ "required": true,
+ "type": "string"
+ },
+ "project": {
+ "description": "Project ID for this request.",
+ "location": "path",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "required": true,
+ "type": "string"
+ },
+ "resizeRequest": {
+ "description": "The name of the resize request. Name should conform to RFC1035 or be a resource ID.",
+ "location": "path",
+ "required": true,
+ "type": "string"
+ },
+ "zone": {
+ "description": "Name of the href=\"/compute/docs/regions-zones/#available\"\u003ezone scoping this request. Name should conform to RFC1035.",
+ "location": "path",
+ "required": true,
+ "type": "string"
+ }
+ },
+ "path": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests/{resizeRequest}",
+ "response": {
+ "$ref": "InstanceGroupManagerResizeRequest"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute",
+ "https://www.googleapis.com/auth/compute.readonly"
+ ]
+ },
+ "insert": {
+ "description": "Creates a new resize request that starts provisioning VMs immediately or queues VM creation.",
+ "flatPath": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests",
+ "httpMethod": "POST",
+ "id": "compute.instanceGroupManagerResizeRequests.insert",
+ "parameterOrder": [
+ "project",
+ "zone",
+ "instanceGroupManager"
+ ],
+ "parameters": {
+ "instanceGroupManager": {
+ "description": "The name of the managed instance group to which the resize request will be added. Name should conform to RFC1035 or be a resource ID.",
+ "location": "path",
+ "required": true,
+ "type": "string"
+ },
+ "project": {
+ "description": "Project ID for this request.",
+ "location": "path",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "required": true,
+ "type": "string"
+ },
+ "requestId": {
+ "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
+ "location": "query",
+ "type": "string"
+ },
+ "zone": {
+ "description": "The name of the zone where the managed instance group is located and where the resize request will be created. Name should conform to RFC1035.",
+ "location": "path",
+ "required": true,
+ "type": "string"
+ }
+ },
+ "path": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests",
+ "request": {
+ "$ref": "InstanceGroupManagerResizeRequest"
+ },
+ "response": {
+ "$ref": "Operation"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute"
+ ]
+ },
+ "list": {
+ "description": "Retrieves a list of resize requests that are contained in the managed instance group.",
+ "flatPath": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests",
+ "httpMethod": "GET",
+ "id": "compute.instanceGroupManagerResizeRequests.list",
+ "parameterOrder": [
+ "project",
+ "zone",
+ "instanceGroupManager"
+ ],
+ "parameters": {
+ "filter": {
+ "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
+ "location": "query",
+ "type": "string"
+ },
+ "instanceGroupManager": {
+ "description": "The name of the managed instance group. The name should conform to RFC1035.",
+ "location": "path",
+ "required": true,
+ "type": "string"
+ },
+ "maxResults": {
+ "default": "500",
+ "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
+ "format": "uint32",
+ "location": "query",
+ "minimum": "0",
+ "type": "integer"
+ },
+ "orderBy": {
+ "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
+ "location": "query",
+ "type": "string"
+ },
+ "pageToken": {
+ "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
+ "location": "query",
+ "type": "string"
+ },
+ "project": {
+ "description": "Project ID for this request.",
+ "location": "path",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "required": true,
+ "type": "string"
+ },
+ "returnPartialSuccess": {
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
+ "location": "query",
+ "type": "boolean"
+ },
+ "zone": {
+ "description": "The name of the zone where the managed instance group is located. The name should conform to RFC1035.",
+ "location": "path",
+ "required": true,
+ "type": "string"
+ }
+ },
+ "path": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests",
+ "response": {
+ "$ref": "InstanceGroupManagerResizeRequestsListResponse"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute",
+ "https://www.googleapis.com/auth/compute.readonly"
+ ]
+ }
+ }
+ },
"instanceGroupManagers": {
"methods": {
"abandonInstances": {
@@ -7561,7 +7843,7 @@
]
},
"aggregatedList": {
- "description": "Retrieves the list of managed instance groups and groups them by zone.",
+ "description": "Retrieves the list of managed instance groups and groups them by zone. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
"flatPath": "projects/{project}/aggregated/instanceGroupManagers",
"httpMethod": "GET",
"id": "compute.instanceGroupManagers.aggregatedList",
@@ -7605,11 +7887,12 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
"serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
"format": "int64",
"location": "query",
"type": "string"
@@ -7975,7 +8258,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
@@ -8044,7 +8327,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
@@ -8113,7 +8396,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
@@ -8182,7 +8465,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
@@ -8597,7 +8880,7 @@
]
},
"aggregatedList": {
- "description": "Retrieves the list of instance groups and sorts them by zone.",
+ "description": "Retrieves the list of instance groups and sorts them by zone. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
"flatPath": "projects/{project}/aggregated/instanceGroups",
"httpMethod": "GET",
"id": "compute.instanceGroups.aggregatedList",
@@ -8641,11 +8924,12 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
"serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
"format": "int64",
"location": "query",
"type": "string"
@@ -8829,7 +9113,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
@@ -8898,7 +9182,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
@@ -9020,10 +9304,96 @@
}
}
},
+ "instanceSettings": {
+ "methods": {
+ "get": {
+ "description": "Get Instance settings.",
+ "flatPath": "projects/{project}/zones/{zone}/instanceSettings",
+ "httpMethod": "GET",
+ "id": "compute.instanceSettings.get",
+ "parameterOrder": [
+ "project",
+ "zone"
+ ],
+ "parameters": {
+ "project": {
+ "description": "Project ID for this request.",
+ "location": "path",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "required": true,
+ "type": "string"
+ },
+ "zone": {
+ "description": "Name of the zone for this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "required": true,
+ "type": "string"
+ }
+ },
+ "path": "projects/{project}/zones/{zone}/instanceSettings",
+ "response": {
+ "$ref": "InstanceSettings"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute",
+ "https://www.googleapis.com/auth/compute.readonly"
+ ]
+ },
+ "patch": {
+ "description": "Patch Instance settings",
+ "flatPath": "projects/{project}/zones/{zone}/instanceSettings",
+ "httpMethod": "PATCH",
+ "id": "compute.instanceSettings.patch",
+ "parameterOrder": [
+ "project",
+ "zone"
+ ],
+ "parameters": {
+ "project": {
+ "description": "Project ID for this request.",
+ "location": "path",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "required": true,
+ "type": "string"
+ },
+ "requestId": {
+ "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
+ "location": "query",
+ "type": "string"
+ },
+ "updateMask": {
+ "description": "update_mask indicates fields to be updated as part of this request.",
+ "format": "google-fieldmask",
+ "location": "query",
+ "type": "string"
+ },
+ "zone": {
+ "description": "The zone scoping this request. It should conform to RFC1035.",
+ "location": "path",
+ "required": true,
+ "type": "string"
+ }
+ },
+ "path": "projects/{project}/zones/{zone}/instanceSettings",
+ "request": {
+ "$ref": "InstanceSettings"
+ },
+ "response": {
+ "$ref": "Operation"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute"
+ ]
+ }
+ }
+ },
"instanceTemplates": {
"methods": {
"aggregatedList": {
- "description": "Retrieves the list of all InstanceTemplates resources, regional and global, available to the specified project.",
+ "description": "Retrieves the list of all InstanceTemplates resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
"flatPath": "projects/{project}/aggregated/instanceTemplates",
"httpMethod": "GET",
"id": "compute.instanceTemplates.aggregatedList",
@@ -9067,11 +9437,12 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
"serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
"format": "int64",
"location": "query",
"type": "string"
@@ -9276,7 +9647,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -9478,7 +9849,7 @@
]
},
"aggregatedList": {
- "description": "Retrieves an aggregated list of all of the instances in your project across all regions and zones. The performance of this method degrades when a filter is specified on a project that has a very large number of instances.",
+ "description": "Retrieves an aggregated list of all of the instances in your project across all regions and zones. The performance of this method degrades when a filter is specified on a project that has a very large number of instances. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
"flatPath": "projects/{project}/aggregated/instances",
"httpMethod": "GET",
"id": "compute.instances.aggregatedList",
@@ -9522,11 +9893,12 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
"serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
"format": "int64",
"location": "query",
"type": "string"
@@ -10233,7 +10605,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
@@ -10304,7 +10676,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
@@ -11864,10 +12236,465 @@
}
}
},
+ "instantSnapshots": {
+ "methods": {
+ "aggregatedList": {
+ "description": "Retrieves an aggregated list of instantSnapshots. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
+ "flatPath": "projects/{project}/aggregated/instantSnapshots",
+ "httpMethod": "GET",
+ "id": "compute.instantSnapshots.aggregatedList",
+ "parameterOrder": [
+ "project"
+ ],
+ "parameters": {
+ "filter": {
+ "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
+ "location": "query",
+ "type": "string"
+ },
+ "includeAllScopes": {
+ "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
+ "location": "query",
+ "type": "boolean"
+ },
+ "maxResults": {
+ "default": "500",
+ "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
+ "format": "uint32",
+ "location": "query",
+ "minimum": "0",
+ "type": "integer"
+ },
+ "orderBy": {
+ "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
+ "location": "query",
+ "type": "string"
+ },
+ "pageToken": {
+ "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
+ "location": "query",
+ "type": "string"
+ },
+ "project": {
+ "description": "Project ID for this request.",
+ "location": "path",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "required": true,
+ "type": "string"
+ },
+ "returnPartialSuccess": {
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
+ "location": "query",
+ "type": "boolean"
+ },
+ "serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
+ "format": "int64",
+ "location": "query",
+ "type": "string"
+ }
+ },
+ "path": "projects/{project}/aggregated/instantSnapshots",
+ "response": {
+ "$ref": "InstantSnapshotAggregatedList"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute",
+ "https://www.googleapis.com/auth/compute.readonly"
+ ]
+ },
+ "delete": {
+ "description": "Deletes the specified InstantSnapshot resource. Keep in mind that deleting a single instantSnapshot might not necessarily delete all the data on that instantSnapshot. If any data on the instantSnapshot that is marked for deletion is needed for subsequent instantSnapshots, the data will be moved to the next corresponding instantSnapshot. For more information, see Deleting instantSnapshots.",
+ "flatPath": "projects/{project}/zones/{zone}/instantSnapshots/{instantSnapshot}",
+ "httpMethod": "DELETE",
+ "id": "compute.instantSnapshots.delete",
+ "parameterOrder": [
+ "project",
+ "zone",
+ "instantSnapshot"
+ ],
+ "parameters": {
+ "instantSnapshot": {
+ "description": "Name of the InstantSnapshot resource to delete.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
+ "required": true,
+ "type": "string"
+ },
+ "project": {
+ "description": "Project ID for this request.",
+ "location": "path",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "required": true,
+ "type": "string"
+ },
+ "requestId": {
+ "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
+ "location": "query",
+ "type": "string"
+ },
+ "zone": {
+ "description": "The name of the zone for this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "required": true,
+ "type": "string"
+ }
+ },
+ "path": "projects/{project}/zones/{zone}/instantSnapshots/{instantSnapshot}",
+ "response": {
+ "$ref": "Operation"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute"
+ ]
+ },
+ "get": {
+ "description": "Returns the specified InstantSnapshot resource in the specified zone.",
+ "flatPath": "projects/{project}/zones/{zone}/instantSnapshots/{instantSnapshot}",
+ "httpMethod": "GET",
+ "id": "compute.instantSnapshots.get",
+ "parameterOrder": [
+ "project",
+ "zone",
+ "instantSnapshot"
+ ],
+ "parameters": {
+ "instantSnapshot": {
+ "description": "Name of the InstantSnapshot resource to return.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
+ "required": true,
+ "type": "string"
+ },
+ "project": {
+ "description": "Project ID for this request.",
+ "location": "path",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "required": true,
+ "type": "string"
+ },
+ "zone": {
+ "description": "The name of the zone for this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "required": true,
+ "type": "string"
+ }
+ },
+ "path": "projects/{project}/zones/{zone}/instantSnapshots/{instantSnapshot}",
+ "response": {
+ "$ref": "InstantSnapshot"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute",
+ "https://www.googleapis.com/auth/compute.readonly"
+ ]
+ },
+ "getIamPolicy": {
+ "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
+ "flatPath": "projects/{project}/zones/{zone}/instantSnapshots/{resource}/getIamPolicy",
+ "httpMethod": "GET",
+ "id": "compute.instantSnapshots.getIamPolicy",
+ "parameterOrder": [
+ "project",
+ "zone",
+ "resource"
+ ],
+ "parameters": {
+ "optionsRequestedPolicyVersion": {
+ "description": "Requested IAM Policy version.",
+ "format": "int32",
+ "location": "query",
+ "type": "integer"
+ },
+ "project": {
+ "description": "Project ID for this request.",
+ "location": "path",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "required": true,
+ "type": "string"
+ },
+ "resource": {
+ "description": "Name or id of the resource for this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
+ "required": true,
+ "type": "string"
+ },
+ "zone": {
+ "description": "The name of the zone for this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "required": true,
+ "type": "string"
+ }
+ },
+ "path": "projects/{project}/zones/{zone}/instantSnapshots/{resource}/getIamPolicy",
+ "response": {
+ "$ref": "Policy"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute",
+ "https://www.googleapis.com/auth/compute.readonly"
+ ]
+ },
+ "insert": {
+ "description": "Creates an instant snapshot in the specified zone.",
+ "flatPath": "projects/{project}/zones/{zone}/instantSnapshots",
+ "httpMethod": "POST",
+ "id": "compute.instantSnapshots.insert",
+ "parameterOrder": [
+ "project",
+ "zone"
+ ],
+ "parameters": {
+ "project": {
+ "description": "Project ID for this request.",
+ "location": "path",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "required": true,
+ "type": "string"
+ },
+ "requestId": {
+ "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
+ "location": "query",
+ "type": "string"
+ },
+ "zone": {
+ "description": "Name of the zone for this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "required": true,
+ "type": "string"
+ }
+ },
+ "path": "projects/{project}/zones/{zone}/instantSnapshots",
+ "request": {
+ "$ref": "InstantSnapshot"
+ },
+ "response": {
+ "$ref": "Operation"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute"
+ ]
+ },
+ "list": {
+ "description": "Retrieves the list of InstantSnapshot resources contained within the specified zone.",
+ "flatPath": "projects/{project}/zones/{zone}/instantSnapshots",
+ "httpMethod": "GET",
+ "id": "compute.instantSnapshots.list",
+ "parameterOrder": [
+ "project",
+ "zone"
+ ],
+ "parameters": {
+ "filter": {
+ "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
+ "location": "query",
+ "type": "string"
+ },
+ "maxResults": {
+ "default": "500",
+ "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
+ "format": "uint32",
+ "location": "query",
+ "minimum": "0",
+ "type": "integer"
+ },
+ "orderBy": {
+ "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
+ "location": "query",
+ "type": "string"
+ },
+ "pageToken": {
+ "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
+ "location": "query",
+ "type": "string"
+ },
+ "project": {
+ "description": "Project ID for this request.",
+ "location": "path",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "required": true,
+ "type": "string"
+ },
+ "returnPartialSuccess": {
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
+ "location": "query",
+ "type": "boolean"
+ },
+ "zone": {
+ "description": "The name of the zone for this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "required": true,
+ "type": "string"
+ }
+ },
+ "path": "projects/{project}/zones/{zone}/instantSnapshots",
+ "response": {
+ "$ref": "InstantSnapshotList"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute",
+ "https://www.googleapis.com/auth/compute.readonly"
+ ]
+ },
+ "setIamPolicy": {
+ "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
+ "flatPath": "projects/{project}/zones/{zone}/instantSnapshots/{resource}/setIamPolicy",
+ "httpMethod": "POST",
+ "id": "compute.instantSnapshots.setIamPolicy",
+ "parameterOrder": [
+ "project",
+ "zone",
+ "resource"
+ ],
+ "parameters": {
+ "project": {
+ "description": "Project ID for this request.",
+ "location": "path",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "required": true,
+ "type": "string"
+ },
+ "resource": {
+ "description": "Name or id of the resource for this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
+ "required": true,
+ "type": "string"
+ },
+ "zone": {
+ "description": "The name of the zone for this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "required": true,
+ "type": "string"
+ }
+ },
+ "path": "projects/{project}/zones/{zone}/instantSnapshots/{resource}/setIamPolicy",
+ "request": {
+ "$ref": "ZoneSetPolicyRequest"
+ },
+ "response": {
+ "$ref": "Policy"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute"
+ ]
+ },
+ "setLabels": {
+ "description": "Sets the labels on a instantSnapshot in the given zone. To learn more about labels, read the Labeling Resources documentation.",
+ "flatPath": "projects/{project}/zones/{zone}/instantSnapshots/{resource}/setLabels",
+ "httpMethod": "POST",
+ "id": "compute.instantSnapshots.setLabels",
+ "parameterOrder": [
+ "project",
+ "zone",
+ "resource"
+ ],
+ "parameters": {
+ "project": {
+ "description": "Project ID for this request.",
+ "location": "path",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "required": true,
+ "type": "string"
+ },
+ "requestId": {
+ "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
+ "location": "query",
+ "type": "string"
+ },
+ "resource": {
+ "description": "Name or id of the resource for this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
+ "required": true,
+ "type": "string"
+ },
+ "zone": {
+ "description": "The name of the zone for this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "required": true,
+ "type": "string"
+ }
+ },
+ "path": "projects/{project}/zones/{zone}/instantSnapshots/{resource}/setLabels",
+ "request": {
+ "$ref": "ZoneSetLabelsRequest"
+ },
+ "response": {
+ "$ref": "Operation"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute"
+ ]
+ },
+ "testIamPermissions": {
+ "description": "Returns permissions that a caller has on the specified resource.",
+ "flatPath": "projects/{project}/zones/{zone}/instantSnapshots/{resource}/testIamPermissions",
+ "httpMethod": "POST",
+ "id": "compute.instantSnapshots.testIamPermissions",
+ "parameterOrder": [
+ "project",
+ "zone",
+ "resource"
+ ],
+ "parameters": {
+ "project": {
+ "description": "Project ID for this request.",
+ "location": "path",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "required": true,
+ "type": "string"
+ },
+ "resource": {
+ "description": "Name or id of the resource for this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
+ "required": true,
+ "type": "string"
+ },
+ "zone": {
+ "description": "The name of the zone for this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "required": true,
+ "type": "string"
+ }
+ },
+ "path": "projects/{project}/zones/{zone}/instantSnapshots/{resource}/testIamPermissions",
+ "request": {
+ "$ref": "TestPermissionsRequest"
+ },
+ "response": {
+ "$ref": "TestPermissionsResponse"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute",
+ "https://www.googleapis.com/auth/compute.readonly"
+ ]
+ }
+ }
+ },
"interconnectAttachments": {
"methods": {
"aggregatedList": {
- "description": "Retrieves an aggregated list of interconnect attachments.",
+ "description": "Retrieves an aggregated list of interconnect attachments. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
"flatPath": "projects/{project}/aggregated/interconnectAttachments",
"httpMethod": "GET",
"id": "compute.interconnectAttachments.aggregatedList",
@@ -11911,11 +12738,12 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
"serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
"format": "int64",
"location": "query",
"type": "string"
@@ -12116,7 +12944,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -12310,7 +13138,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -12404,7 +13232,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -12641,7 +13469,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -13008,7 +13836,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -13296,7 +14124,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -13391,7 +14219,7 @@
"machineTypes": {
"methods": {
"aggregatedList": {
- "description": "Retrieves an aggregated list of machine types.",
+ "description": "Retrieves an aggregated list of machine types. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
"flatPath": "projects/{project}/aggregated/machineTypes",
"httpMethod": "GET",
"id": "compute.machineTypes.aggregatedList",
@@ -13435,11 +14263,12 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
"serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
"format": "int64",
"location": "query",
"type": "string"
@@ -13539,7 +14368,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
@@ -13566,7 +14395,7 @@
"networkAttachments": {
"methods": {
"aggregatedList": {
- "description": "Retrieves the list of all NetworkAttachment resources, regional and global, available to the specified project.",
+ "description": "Retrieves the list of all NetworkAttachment resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
"flatPath": "projects/{project}/aggregated/networkAttachments",
"httpMethod": "GET",
"id": "compute.networkAttachments.aggregatedList",
@@ -13610,11 +14439,12 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
"serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
"format": "int64",
"location": "query",
"type": "string"
@@ -13859,7 +14689,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -14020,7 +14850,7 @@
"networkEdgeSecurityServices": {
"methods": {
"aggregatedList": {
- "description": "Retrieves the list of all NetworkEdgeSecurityService resources available to the specified project.",
+ "description": "Retrieves the list of all NetworkEdgeSecurityService resources available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
"flatPath": "projects/{project}/aggregated/networkEdgeSecurityServices",
"httpMethod": "GET",
"id": "compute.networkEdgeSecurityServices.aggregatedList",
@@ -14064,11 +14894,12 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
"serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
"format": "int64",
"location": "query",
"type": "string"
@@ -14287,7 +15118,7 @@
"networkEndpointGroups": {
"methods": {
"aggregatedList": {
- "description": "Retrieves the list of network endpoint groups and sorts them by zone.",
+ "description": "Retrieves the list of network endpoint groups and sorts them by zone. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
"flatPath": "projects/{project}/aggregated/networkEndpointGroups",
"httpMethod": "GET",
"id": "compute.networkEndpointGroups.aggregatedList",
@@ -14331,11 +15162,12 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
"serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
"format": "int64",
"location": "query",
"type": "string"
@@ -14615,7 +15447,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
@@ -14684,7 +15516,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
@@ -15173,7 +16005,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -15671,7 +16503,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -15757,7 +16589,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -15773,7 +16605,7 @@
]
},
"patch": {
- "description": "Patches the specified network with the data included in the request. Only the following fields can be modified: routingConfig.routingMode.",
+ "description": "Patches the specified network with the data included in the request. Only routingConfig can be modified.",
"flatPath": "projects/{project}/global/networks/{network}",
"httpMethod": "PATCH",
"id": "compute.networks.patch",
@@ -15992,7 +16824,7 @@
]
},
"aggregatedList": {
- "description": "Retrieves an aggregated list of node groups. Note: use nodeGroups.listNodes for more details about each group.",
+ "description": "Retrieves an aggregated list of node groups. Note: use nodeGroups.listNodes for more details about each group. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
"flatPath": "projects/{project}/aggregated/nodeGroups",
"httpMethod": "GET",
"id": "compute.nodeGroups.aggregatedList",
@@ -16036,11 +16868,12 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
"serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
"format": "int64",
"location": "query",
"type": "string"
@@ -16336,7 +17169,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
@@ -16407,7 +17240,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
@@ -16479,6 +17312,56 @@
"https://www.googleapis.com/auth/compute"
]
},
+ "performMaintenance": {
+ "description": "Perform maintenance on a subset of nodes in the node group.",
+ "flatPath": "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}/performMaintenance",
+ "httpMethod": "POST",
+ "id": "compute.nodeGroups.performMaintenance",
+ "parameterOrder": [
+ "project",
+ "zone",
+ "nodeGroup"
+ ],
+ "parameters": {
+ "nodeGroup": {
+ "description": "Name of the node group scoping this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
+ "required": true,
+ "type": "string"
+ },
+ "project": {
+ "description": "Project ID for this request.",
+ "location": "path",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "required": true,
+ "type": "string"
+ },
+ "requestId": {
+ "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
+ "location": "query",
+ "type": "string"
+ },
+ "zone": {
+ "description": "The name of the zone for this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "required": true,
+ "type": "string"
+ }
+ },
+ "path": "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}/performMaintenance",
+ "request": {
+ "$ref": "NodeGroupsPerformMaintenanceRequest"
+ },
+ "response": {
+ "$ref": "Operation"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute"
+ ]
+ },
"setIamPolicy": {
"description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
"flatPath": "projects/{project}/zones/{zone}/nodeGroups/{resource}/setIamPolicy",
@@ -16675,7 +17558,7 @@
"nodeTemplates": {
"methods": {
"aggregatedList": {
- "description": "Retrieves an aggregated list of node templates.",
+ "description": "Retrieves an aggregated list of node templates. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
"flatPath": "projects/{project}/aggregated/nodeTemplates",
"httpMethod": "GET",
"id": "compute.nodeTemplates.aggregatedList",
@@ -16719,11 +17602,12 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
"serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
"format": "int64",
"location": "query",
"type": "string"
@@ -16968,7 +17852,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -17079,7 +17963,7 @@
"nodeTypes": {
"methods": {
"aggregatedList": {
- "description": "Retrieves an aggregated list of node types.",
+ "description": "Retrieves an aggregated list of node types. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
"flatPath": "projects/{project}/aggregated/nodeTypes",
"httpMethod": "GET",
"id": "compute.nodeTypes.aggregatedList",
@@ -17123,11 +18007,12 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
"serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
"format": "int64",
"location": "query",
"type": "string"
@@ -17227,7 +18112,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
@@ -17254,7 +18139,7 @@
"packetMirrorings": {
"methods": {
"aggregatedList": {
- "description": "Retrieves an aggregated list of packetMirrorings.",
+ "description": "Retrieves an aggregated list of packetMirrorings. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
"flatPath": "projects/{project}/aggregated/packetMirrorings",
"httpMethod": "GET",
"id": "compute.packetMirrorings.aggregatedList",
@@ -17298,11 +18183,12 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
"serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
"format": "int64",
"location": "query",
"type": "string"
@@ -17498,7 +18384,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -17836,7 +18722,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -17890,7 +18776,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -17976,6 +18862,40 @@
"https://www.googleapis.com/auth/compute"
]
},
+ "setCloudArmorTier": {
+ "description": "Sets the Cloud Armor tier of the project. To set ENTERPRISE or above the billing account of the project must be subscribed to Cloud Armor Enterprise. See Subscribing to Cloud Armor Enterprise for more information.",
+ "flatPath": "projects/{project}/setCloudArmorTier",
+ "httpMethod": "POST",
+ "id": "compute.projects.setCloudArmorTier",
+ "parameterOrder": [
+ "project"
+ ],
+ "parameters": {
+ "project": {
+ "description": "Project ID for this request.",
+ "location": "path",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "required": true,
+ "type": "string"
+ },
+ "requestId": {
+ "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
+ "location": "query",
+ "type": "string"
+ }
+ },
+ "path": "projects/{project}/setCloudArmorTier",
+ "request": {
+ "$ref": "ProjectsSetCloudArmorTierRequest"
+ },
+ "response": {
+ "$ref": "Operation"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute"
+ ]
+ },
"setCommonInstanceMetadata": {
"description": "Sets metadata common to all instances within the specified project using the data included in the request.",
"flatPath": "projects/{project}/setCommonInstanceMetadata",
@@ -18271,7 +19191,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -18371,7 +19291,7 @@
"publicDelegatedPrefixes": {
"methods": {
"aggregatedList": {
- "description": "Lists all PublicDelegatedPrefix resources owned by the specific project across all scopes.",
+ "description": "Lists all PublicDelegatedPrefix resources owned by the specific project across all scopes. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
"flatPath": "projects/{project}/aggregated/publicDelegatedPrefixes",
"httpMethod": "GET",
"id": "compute.publicDelegatedPrefixes.aggregatedList",
@@ -18415,11 +19335,12 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
"serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
"format": "int64",
"location": "query",
"type": "string"
@@ -18660,7 +19581,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -18954,7 +19875,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -19343,7 +20264,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -19359,7 +20280,7 @@
]
},
"listUsable": {
- "description": "Retrieves an aggregated list of all usable backend services in the specified project in the given region.",
+ "description": "Retrieves a list of all usable backend services in the specified project in the given region.",
"flatPath": "projects/{project}/regions/{region}/backendServices/listUsable",
"httpMethod": "GET",
"id": "compute.regionBackendServices.listUsable",
@@ -19405,7 +20326,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -19665,7 +20586,7 @@
"regionCommitments": {
"methods": {
"aggregatedList": {
- "description": "Retrieves an aggregated list of commitments by region.",
+ "description": "Retrieves an aggregated list of commitments by region. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
"flatPath": "projects/{project}/aggregated/commitments",
"httpMethod": "GET",
"id": "compute.regionCommitments.aggregatedList",
@@ -19709,11 +20630,12 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
"serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
"format": "int64",
"location": "query",
"type": "string"
@@ -19862,7 +20784,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -20033,7 +20955,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -20427,7 +21349,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -21065,7 +21987,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -21313,7 +22235,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -21836,7 +22758,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -21905,7 +22827,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -21974,7 +22896,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -22043,7 +22965,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -22492,7 +23414,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -22561,7 +23483,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -22811,7 +23733,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -22874,6 +23796,395 @@
}
}
},
+ "regionInstantSnapshots": {
+ "methods": {
+ "delete": {
+ "description": "Deletes the specified InstantSnapshot resource. Keep in mind that deleting a single instantSnapshot might not necessarily delete all the data on that instantSnapshot. If any data on the instantSnapshot that is marked for deletion is needed for subsequent instantSnapshots, the data will be moved to the next corresponding instantSnapshot. For more information, see Deleting instantSnapshots.",
+ "flatPath": "projects/{project}/regions/{region}/instantSnapshots/{instantSnapshot}",
+ "httpMethod": "DELETE",
+ "id": "compute.regionInstantSnapshots.delete",
+ "parameterOrder": [
+ "project",
+ "region",
+ "instantSnapshot"
+ ],
+ "parameters": {
+ "instantSnapshot": {
+ "description": "Name of the InstantSnapshot resource to delete.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
+ "required": true,
+ "type": "string"
+ },
+ "project": {
+ "description": "Project ID for this request.",
+ "location": "path",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "required": true,
+ "type": "string"
+ },
+ "region": {
+ "description": "The name of the region for this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "required": true,
+ "type": "string"
+ },
+ "requestId": {
+ "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
+ "location": "query",
+ "type": "string"
+ }
+ },
+ "path": "projects/{project}/regions/{region}/instantSnapshots/{instantSnapshot}",
+ "response": {
+ "$ref": "Operation"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute"
+ ]
+ },
+ "get": {
+ "description": "Returns the specified InstantSnapshot resource in the specified region.",
+ "flatPath": "projects/{project}/regions/{region}/instantSnapshots/{instantSnapshot}",
+ "httpMethod": "GET",
+ "id": "compute.regionInstantSnapshots.get",
+ "parameterOrder": [
+ "project",
+ "region",
+ "instantSnapshot"
+ ],
+ "parameters": {
+ "instantSnapshot": {
+ "description": "Name of the InstantSnapshot resource to return.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
+ "required": true,
+ "type": "string"
+ },
+ "project": {
+ "description": "Project ID for this request.",
+ "location": "path",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "required": true,
+ "type": "string"
+ },
+ "region": {
+ "description": "The name of the region for this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "required": true,
+ "type": "string"
+ }
+ },
+ "path": "projects/{project}/regions/{region}/instantSnapshots/{instantSnapshot}",
+ "response": {
+ "$ref": "InstantSnapshot"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute",
+ "https://www.googleapis.com/auth/compute.readonly"
+ ]
+ },
+ "getIamPolicy": {
+ "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
+ "flatPath": "projects/{project}/regions/{region}/instantSnapshots/{resource}/getIamPolicy",
+ "httpMethod": "GET",
+ "id": "compute.regionInstantSnapshots.getIamPolicy",
+ "parameterOrder": [
+ "project",
+ "region",
+ "resource"
+ ],
+ "parameters": {
+ "optionsRequestedPolicyVersion": {
+ "description": "Requested IAM Policy version.",
+ "format": "int32",
+ "location": "query",
+ "type": "integer"
+ },
+ "project": {
+ "description": "Project ID for this request.",
+ "location": "path",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "required": true,
+ "type": "string"
+ },
+ "region": {
+ "description": "The name of the region for this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "required": true,
+ "type": "string"
+ },
+ "resource": {
+ "description": "Name or id of the resource for this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
+ "required": true,
+ "type": "string"
+ }
+ },
+ "path": "projects/{project}/regions/{region}/instantSnapshots/{resource}/getIamPolicy",
+ "response": {
+ "$ref": "Policy"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute",
+ "https://www.googleapis.com/auth/compute.readonly"
+ ]
+ },
+ "insert": {
+ "description": "Creates an instant snapshot in the specified region.",
+ "flatPath": "projects/{project}/regions/{region}/instantSnapshots",
+ "httpMethod": "POST",
+ "id": "compute.regionInstantSnapshots.insert",
+ "parameterOrder": [
+ "project",
+ "region"
+ ],
+ "parameters": {
+ "project": {
+ "description": "Project ID for this request.",
+ "location": "path",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "required": true,
+ "type": "string"
+ },
+ "region": {
+ "description": "Name of the region for this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "required": true,
+ "type": "string"
+ },
+ "requestId": {
+ "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
+ "location": "query",
+ "type": "string"
+ }
+ },
+ "path": "projects/{project}/regions/{region}/instantSnapshots",
+ "request": {
+ "$ref": "InstantSnapshot"
+ },
+ "response": {
+ "$ref": "Operation"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute"
+ ]
+ },
+ "list": {
+ "description": "Retrieves the list of InstantSnapshot resources contained within the specified region.",
+ "flatPath": "projects/{project}/regions/{region}/instantSnapshots",
+ "httpMethod": "GET",
+ "id": "compute.regionInstantSnapshots.list",
+ "parameterOrder": [
+ "project",
+ "region"
+ ],
+ "parameters": {
+ "filter": {
+ "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
+ "location": "query",
+ "type": "string"
+ },
+ "maxResults": {
+ "default": "500",
+ "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
+ "format": "uint32",
+ "location": "query",
+ "minimum": "0",
+ "type": "integer"
+ },
+ "orderBy": {
+ "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
+ "location": "query",
+ "type": "string"
+ },
+ "pageToken": {
+ "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
+ "location": "query",
+ "type": "string"
+ },
+ "project": {
+ "description": "Project ID for this request.",
+ "location": "path",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "required": true,
+ "type": "string"
+ },
+ "region": {
+ "description": "The name of the region for this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "required": true,
+ "type": "string"
+ },
+ "returnPartialSuccess": {
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
+ "location": "query",
+ "type": "boolean"
+ }
+ },
+ "path": "projects/{project}/regions/{region}/instantSnapshots",
+ "response": {
+ "$ref": "InstantSnapshotList"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute",
+ "https://www.googleapis.com/auth/compute.readonly"
+ ]
+ },
+ "setIamPolicy": {
+ "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
+ "flatPath": "projects/{project}/regions/{region}/instantSnapshots/{resource}/setIamPolicy",
+ "httpMethod": "POST",
+ "id": "compute.regionInstantSnapshots.setIamPolicy",
+ "parameterOrder": [
+ "project",
+ "region",
+ "resource"
+ ],
+ "parameters": {
+ "project": {
+ "description": "Project ID for this request.",
+ "location": "path",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "required": true,
+ "type": "string"
+ },
+ "region": {
+ "description": "The name of the region for this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "required": true,
+ "type": "string"
+ },
+ "resource": {
+ "description": "Name or id of the resource for this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
+ "required": true,
+ "type": "string"
+ }
+ },
+ "path": "projects/{project}/regions/{region}/instantSnapshots/{resource}/setIamPolicy",
+ "request": {
+ "$ref": "RegionSetPolicyRequest"
+ },
+ "response": {
+ "$ref": "Policy"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute"
+ ]
+ },
+ "setLabels": {
+ "description": "Sets the labels on a instantSnapshot in the given region. To learn more about labels, read the Labeling Resources documentation.",
+ "flatPath": "projects/{project}/regions/{region}/instantSnapshots/{resource}/setLabels",
+ "httpMethod": "POST",
+ "id": "compute.regionInstantSnapshots.setLabels",
+ "parameterOrder": [
+ "project",
+ "region",
+ "resource"
+ ],
+ "parameters": {
+ "project": {
+ "description": "Project ID for this request.",
+ "location": "path",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "required": true,
+ "type": "string"
+ },
+ "region": {
+ "description": "The region for this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "required": true,
+ "type": "string"
+ },
+ "requestId": {
+ "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
+ "location": "query",
+ "type": "string"
+ },
+ "resource": {
+ "description": "Name or id of the resource for this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
+ "required": true,
+ "type": "string"
+ }
+ },
+ "path": "projects/{project}/regions/{region}/instantSnapshots/{resource}/setLabels",
+ "request": {
+ "$ref": "RegionSetLabelsRequest"
+ },
+ "response": {
+ "$ref": "Operation"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute"
+ ]
+ },
+ "testIamPermissions": {
+ "description": "Returns permissions that a caller has on the specified resource.",
+ "flatPath": "projects/{project}/regions/{region}/instantSnapshots/{resource}/testIamPermissions",
+ "httpMethod": "POST",
+ "id": "compute.regionInstantSnapshots.testIamPermissions",
+ "parameterOrder": [
+ "project",
+ "region",
+ "resource"
+ ],
+ "parameters": {
+ "project": {
+ "description": "Project ID for this request.",
+ "location": "path",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "required": true,
+ "type": "string"
+ },
+ "region": {
+ "description": "The name of the region for this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "required": true,
+ "type": "string"
+ },
+ "resource": {
+ "description": "Name or id of the resource for this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
+ "required": true,
+ "type": "string"
+ }
+ },
+ "path": "projects/{project}/regions/{region}/instantSnapshots/{resource}/testIamPermissions",
+ "request": {
+ "$ref": "TestPermissionsRequest"
+ },
+ "response": {
+ "$ref": "TestPermissionsResponse"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute",
+ "https://www.googleapis.com/auth/compute.readonly"
+ ]
+ }
+ }
+ },
"regionNetworkEndpointGroups": {
"methods": {
"attachNetworkEndpoints": {
@@ -23146,7 +24457,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -23215,7 +24526,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -23771,7 +25082,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -24272,7 +25583,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -24303,7 +25614,7 @@
],
"parameters": {
"operation": {
- "description": "Name of the Operations resource to delete.",
+ "description": "Name of the Operations resource to delete, or its unique numeric identifier.",
"location": "path",
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
"required": true,
@@ -24342,7 +25653,7 @@
],
"parameters": {
"operation": {
- "description": "Name of the Operations resource to return.",
+ "description": "Name of the Operations resource to return, or its unique numeric identifier.",
"location": "path",
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
"required": true,
@@ -24421,7 +25732,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -24448,7 +25759,7 @@
],
"parameters": {
"operation": {
- "description": "Name of the Operations resource to return.",
+ "description": "Name of the Operations resource to return, or its unique numeric identifier.",
"location": "path",
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
"required": true,
@@ -24767,7 +26078,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -25132,7 +26443,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -25329,7 +26640,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -25392,7 +26703,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -25640,7 +26951,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -25889,7 +27200,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -26238,7 +27549,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -26437,7 +27748,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -26649,7 +27960,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -26669,7 +27980,7 @@
"regions": {
"methods": {
"get": {
- "description": "Returns the specified Region resource. To decrease latency for this method, you can optionally omit any unneeded information from the response by using a field mask. This practice is especially recommended for unused quota information (the `quotas` field). To exclude one or more fields, set your request's `fields` query parameter to only include the fields you need. For example, to only include the `id` and `selfLink` fields, add the query parameter `?fields=id,selfLink` to your request.",
+ "description": "Returns the specified Region resource. To decrease latency for this method, you can optionally omit any unneeded information from the response by using a field mask. This practice is especially recommended for unused quota information (the `quotas` field). To exclude one or more fields, set your request's `fields` query parameter to only include the fields you need. For example, to only include the `id` and `selfLink` fields, add the query parameter `?fields=id,selfLink` to your request. This method fails if the quota information is unavailable for the region and if the organization policy constraint compute.requireBasicQuotaInResponse is enforced. This constraint, when enforced, disables the fail-open behaviour when quota information (the `items.quotas` field) is unavailable for the region. It is recommended to use the default setting for the constraint unless your application requires the fail-closed behaviour for this method.",
"flatPath": "projects/{project}/regions/{region}",
"httpMethod": "GET",
"id": "compute.regions.get",
@@ -26704,7 +28015,7 @@
]
},
"list": {
- "description": "Retrieves the list of region resources available to the specified project. To decrease latency for this method, you can optionally omit any unneeded information from the response by using a field mask. This practice is especially recommended for unused quota information (the `items.quotas` field). To exclude one or more fields, set your request's `fields` query parameter to only include the fields you need. For example, to only include the `id` and `selfLink` fields, add the query parameter `?fields=id,selfLink` to your request.",
+ "description": "Retrieves the list of region resources available to the specified project. To decrease latency for this method, you can optionally omit any unneeded information from the response by using a field mask. This practice is especially recommended for unused quota information (the `items.quotas` field). To exclude one or more fields, set your request's `fields` query parameter to only include the fields you need. For example, to only include the `id` and `selfLink` fields, add the query parameter `?fields=id,selfLink` to your request. This method fails if the quota information is unavailable for the region and if the organization policy constraint compute.requireBasicQuotaInResponse is enforced. This constraint, when enforced, disables the fail-open behaviour when quota information (the `items.quotas` field) is unavailable for the region. It is recommended to use the default setting for the constraint unless your application requires the fail-closed behaviour for this method.",
"flatPath": "projects/{project}/regions",
"httpMethod": "GET",
"id": "compute.regions.list",
@@ -26743,7 +28054,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -26763,7 +28074,7 @@
"reservations": {
"methods": {
"aggregatedList": {
- "description": "Retrieves an aggregated list of reservations.",
+ "description": "Retrieves an aggregated list of reservations. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
"flatPath": "projects/{project}/aggregated/reservations",
"httpMethod": "GET",
"id": "compute.reservations.aggregatedList",
@@ -26807,11 +28118,12 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
"serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
"format": "int64",
"location": "query",
"type": "string"
@@ -27049,7 +28361,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
@@ -27278,7 +28590,7 @@
"resourcePolicies": {
"methods": {
"aggregatedList": {
- "description": "Retrieves an aggregated list of resource policies.",
+ "description": "Retrieves an aggregated list of resource policies. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
"flatPath": "projects/{project}/aggregated/resourcePolicies",
"httpMethod": "GET",
"id": "compute.resourcePolicies.aggregatedList",
@@ -27322,11 +28634,12 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
"serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
"format": "int64",
"location": "query",
"type": "string"
@@ -27571,7 +28884,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -27738,7 +29051,7 @@
"routers": {
"methods": {
"aggregatedList": {
- "description": "Retrieves an aggregated list of routers.",
+ "description": "Retrieves an aggregated list of routers. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
"flatPath": "projects/{project}/aggregated/routers",
"httpMethod": "GET",
"id": "compute.routers.aggregatedList",
@@ -27782,11 +29095,12 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
"serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
"format": "int64",
"location": "query",
"type": "string"
@@ -27993,7 +29307,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
@@ -28148,7 +29462,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -28461,7 +29775,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -28523,7 +29837,7 @@
]
},
"aggregatedList": {
- "description": "Retrieves the list of all SecurityPolicy resources, regional and global, available to the specified project.",
+ "description": "Retrieves the list of all SecurityPolicy resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
"flatPath": "projects/{project}/aggregated/securityPolicies",
"httpMethod": "GET",
"id": "compute.securityPolicies.aggregatedList",
@@ -28567,11 +29881,12 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
"serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
"format": "int64",
"location": "query",
"type": "string"
@@ -28781,7 +30096,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -28836,7 +30151,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -29035,7 +30350,7 @@
"serviceAttachments": {
"methods": {
"aggregatedList": {
- "description": "Retrieves the list of all ServiceAttachment resources, regional and global, available to the specified project.",
+ "description": "Retrieves the list of all ServiceAttachment resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
"flatPath": "projects/{project}/aggregated/serviceAttachments",
"httpMethod": "GET",
"id": "compute.serviceAttachments.aggregatedList",
@@ -29079,11 +30394,12 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
"serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
"format": "int64",
"location": "query",
"type": "string"
@@ -29328,7 +30644,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -29746,7 +31062,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -29878,7 +31194,7 @@
"sslCertificates": {
"methods": {
"aggregatedList": {
- "description": "Retrieves the list of all SslCertificate resources, regional and global, available to the specified project.",
+ "description": "Retrieves the list of all SslCertificate resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
"flatPath": "projects/{project}/aggregated/sslCertificates",
"httpMethod": "GET",
"id": "compute.sslCertificates.aggregatedList",
@@ -29922,11 +31238,12 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
"serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
"format": "int64",
"location": "query",
"type": "string"
@@ -30090,7 +31407,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -30110,7 +31427,7 @@
"sslPolicies": {
"methods": {
"aggregatedList": {
- "description": "Retrieves the list of all SslPolicy resources, regional and global, available to the specified project.",
+ "description": "Retrieves the list of all SslPolicy resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
"flatPath": "projects/{project}/aggregated/sslPolicies",
"httpMethod": "GET",
"id": "compute.sslPolicies.aggregatedList",
@@ -30154,11 +31471,12 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
"serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
"format": "int64",
"location": "query",
"type": "string"
@@ -30320,7 +31638,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -30375,7 +31693,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -30433,13 +31751,13 @@
}
}
},
- "subnetworks": {
+ "storagePoolTypes": {
"methods": {
"aggregatedList": {
- "description": "Retrieves an aggregated list of subnetworks.",
- "flatPath": "projects/{project}/aggregated/subnetworks",
+ "description": "Retrieves an aggregated list of storage pool types. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
+ "flatPath": "projects/{project}/aggregated/storagePoolTypes",
"httpMethod": "GET",
- "id": "compute.subnetworks.aggregatedList",
+ "id": "compute.storagePoolTypes.aggregatedList",
"parameterOrder": [
"project"
],
@@ -30480,19 +31798,20 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
"serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
"format": "int64",
"location": "query",
"type": "string"
}
},
- "path": "projects/{project}/aggregated/subnetworks",
+ "path": "projects/{project}/aggregated/storagePoolTypes",
"response": {
- "$ref": "SubnetworkAggregatedList"
+ "$ref": "StoragePoolTypeAggregatedList"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
@@ -30500,15 +31819,15 @@
"https://www.googleapis.com/auth/compute.readonly"
]
},
- "delete": {
- "description": "Deletes the specified subnetwork.",
- "flatPath": "projects/{project}/regions/{region}/subnetworks/{subnetwork}",
- "httpMethod": "DELETE",
- "id": "compute.subnetworks.delete",
+ "get": {
+ "description": "Returns the specified storage pool type.",
+ "flatPath": "projects/{project}/zones/{zone}/storagePoolTypes/{storagePoolType}",
+ "httpMethod": "GET",
+ "id": "compute.storagePoolTypes.get",
"parameterOrder": [
"project",
- "region",
- "subnetwork"
+ "zone",
+ "storagePoolType"
],
"parameters": {
"project": {
@@ -30518,46 +31837,135 @@
"required": true,
"type": "string"
},
- "region": {
- "description": "Name of the region scoping this request.",
+ "storagePoolType": {
+ "description": "Name of the storage pool type to return.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
+ "required": true,
+ "type": "string"
+ },
+ "zone": {
+ "description": "The name of the zone for this request.",
"location": "path",
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
"required": true,
"type": "string"
+ }
+ },
+ "path": "projects/{project}/zones/{zone}/storagePoolTypes/{storagePoolType}",
+ "response": {
+ "$ref": "StoragePoolType"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute",
+ "https://www.googleapis.com/auth/compute.readonly"
+ ]
+ },
+ "list": {
+ "description": "Retrieves a list of storage pool types available to the specified project.",
+ "flatPath": "projects/{project}/zones/{zone}/storagePoolTypes",
+ "httpMethod": "GET",
+ "id": "compute.storagePoolTypes.list",
+ "parameterOrder": [
+ "project",
+ "zone"
+ ],
+ "parameters": {
+ "filter": {
+ "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
+ "location": "query",
+ "type": "string"
},
- "requestId": {
- "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
+ "maxResults": {
+ "default": "500",
+ "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
+ "format": "uint32",
+ "location": "query",
+ "minimum": "0",
+ "type": "integer"
+ },
+ "orderBy": {
+ "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
"location": "query",
"type": "string"
},
- "subnetwork": {
- "description": "Name of the Subnetwork resource to delete.",
+ "pageToken": {
+ "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
+ "location": "query",
+ "type": "string"
+ },
+ "project": {
+ "description": "Project ID for this request.",
"location": "path",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "required": true,
+ "type": "string"
+ },
+ "returnPartialSuccess": {
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
+ "location": "query",
+ "type": "boolean"
+ },
+ "zone": {
+ "description": "The name of the zone for this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
"required": true,
"type": "string"
}
},
- "path": "projects/{project}/regions/{region}/subnetworks/{subnetwork}",
+ "path": "projects/{project}/zones/{zone}/storagePoolTypes",
"response": {
- "$ref": "Operation"
+ "$ref": "StoragePoolTypeList"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/compute"
+ "https://www.googleapis.com/auth/compute",
+ "https://www.googleapis.com/auth/compute.readonly"
]
- },
- "expandIpCidrRange": {
- "description": "Expands the IP CIDR range of the subnetwork to a specified value.",
- "flatPath": "projects/{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange",
- "httpMethod": "POST",
- "id": "compute.subnetworks.expandIpCidrRange",
+ }
+ }
+ },
+ "storagePools": {
+ "methods": {
+ "aggregatedList": {
+ "description": "Retrieves an aggregated list of storage pools. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
+ "flatPath": "projects/{project}/aggregated/storagePools",
+ "httpMethod": "GET",
+ "id": "compute.storagePools.aggregatedList",
"parameterOrder": [
- "project",
- "region",
- "subnetwork"
+ "project"
],
"parameters": {
+ "filter": {
+ "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
+ "location": "query",
+ "type": "string"
+ },
+ "includeAllScopes": {
+ "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
+ "location": "query",
+ "type": "boolean"
+ },
+ "maxResults": {
+ "default": "500",
+ "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
+ "format": "uint32",
+ "location": "query",
+ "minimum": "0",
+ "type": "integer"
+ },
+ "orderBy": {
+ "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
+ "location": "query",
+ "type": "string"
+ },
+ "pageToken": {
+ "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
+ "location": "query",
+ "type": "string"
+ },
"project": {
"description": "Project ID for this request.",
"location": "path",
@@ -30565,10 +31973,43 @@
"required": true,
"type": "string"
},
- "region": {
- "description": "Name of the region scoping this request.",
+ "returnPartialSuccess": {
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
+ "location": "query",
+ "type": "boolean"
+ },
+ "serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
+ "format": "int64",
+ "location": "query",
+ "type": "string"
+ }
+ },
+ "path": "projects/{project}/aggregated/storagePools",
+ "response": {
+ "$ref": "StoragePoolAggregatedList"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute",
+ "https://www.googleapis.com/auth/compute.readonly"
+ ]
+ },
+ "delete": {
+ "description": "Deletes the specified storage pool. Deleting a storagePool removes its data permanently and is irreversible. However, deleting a storagePool does not delete any snapshots previously made from the storagePool. You must separately delete snapshots.",
+ "flatPath": "projects/{project}/zones/{zone}/storagePools/{storagePool}",
+ "httpMethod": "DELETE",
+ "id": "compute.storagePools.delete",
+ "parameterOrder": [
+ "project",
+ "zone",
+ "storagePool"
+ ],
+ "parameters": {
+ "project": {
+ "description": "Project ID for this request.",
"location": "path",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
"required": true,
"type": "string"
},
@@ -30577,18 +32018,21 @@
"location": "query",
"type": "string"
},
- "subnetwork": {
- "description": "Name of the Subnetwork resource to update.",
+ "storagePool": {
+ "description": "Name of the storage pool to delete.",
"location": "path",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
+ "required": true,
+ "type": "string"
+ },
+ "zone": {
+ "description": "The name of the zone for this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
"required": true,
"type": "string"
}
},
- "path": "projects/{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange",
- "request": {
- "$ref": "SubnetworksExpandIpCidrRangeRequest"
- },
+ "path": "projects/{project}/zones/{zone}/storagePools/{storagePool}",
"response": {
"$ref": "Operation"
},
@@ -30598,14 +32042,14 @@
]
},
"get": {
- "description": "Returns the specified subnetwork.",
- "flatPath": "projects/{project}/regions/{region}/subnetworks/{subnetwork}",
+ "description": "Returns a specified storage pool. Gets a list of available storage pools by making a list() request.",
+ "flatPath": "projects/{project}/zones/{zone}/storagePools/{storagePool}",
"httpMethod": "GET",
- "id": "compute.subnetworks.get",
+ "id": "compute.storagePools.get",
"parameterOrder": [
"project",
- "region",
- "subnetwork"
+ "zone",
+ "storagePool"
],
"parameters": {
"project": {
@@ -30615,24 +32059,24 @@
"required": true,
"type": "string"
},
- "region": {
- "description": "Name of the region scoping this request.",
+ "storagePool": {
+ "description": "Name of the storage pool to return.",
"location": "path",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
"required": true,
"type": "string"
},
- "subnetwork": {
- "description": "Name of the Subnetwork resource to return.",
+ "zone": {
+ "description": "The name of the zone for this request.",
"location": "path",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
"required": true,
"type": "string"
}
},
- "path": "projects/{project}/regions/{region}/subnetworks/{subnetwork}",
+ "path": "projects/{project}/zones/{zone}/storagePools/{storagePool}",
"response": {
- "$ref": "Subnetwork"
+ "$ref": "StoragePool"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
@@ -30642,12 +32086,12 @@
},
"getIamPolicy": {
"description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
- "flatPath": "projects/{project}/regions/{region}/subnetworks/{resource}/getIamPolicy",
+ "flatPath": "projects/{project}/zones/{zone}/storagePools/{resource}/getIamPolicy",
"httpMethod": "GET",
- "id": "compute.subnetworks.getIamPolicy",
+ "id": "compute.storagePools.getIamPolicy",
"parameterOrder": [
"project",
- "region",
+ "zone",
"resource"
],
"parameters": {
@@ -30664,22 +32108,22 @@
"required": true,
"type": "string"
},
- "region": {
- "description": "The name of the region for this request.",
+ "resource": {
+ "description": "Name or id of the resource for this request.",
"location": "path",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
"required": true,
"type": "string"
},
- "resource": {
- "description": "Name or id of the resource for this request.",
+ "zone": {
+ "description": "The name of the zone for this request.",
"location": "path",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
"required": true,
"type": "string"
}
},
- "path": "projects/{project}/regions/{region}/subnetworks/{resource}/getIamPolicy",
+ "path": "projects/{project}/zones/{zone}/storagePools/{resource}/getIamPolicy",
"response": {
"$ref": "Policy"
},
@@ -30690,13 +32134,13 @@
]
},
"insert": {
- "description": "Creates a subnetwork in the specified project using the data included in the request.",
- "flatPath": "projects/{project}/regions/{region}/subnetworks",
+ "description": "Creates a storage pool in the specified project using the data in the request.",
+ "flatPath": "projects/{project}/zones/{zone}/storagePools",
"httpMethod": "POST",
- "id": "compute.subnetworks.insert",
+ "id": "compute.storagePools.insert",
"parameterOrder": [
"project",
- "region"
+ "zone"
],
"parameters": {
"project": {
@@ -30706,22 +32150,22 @@
"required": true,
"type": "string"
},
- "region": {
- "description": "Name of the region scoping this request.",
- "location": "path",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- "required": true,
- "type": "string"
- },
"requestId": {
"description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
"location": "query",
"type": "string"
+ },
+ "zone": {
+ "description": "The name of the zone for this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "required": true,
+ "type": "string"
}
},
- "path": "projects/{project}/regions/{region}/subnetworks",
+ "path": "projects/{project}/zones/{zone}/storagePools",
"request": {
- "$ref": "Subnetwork"
+ "$ref": "StoragePool"
},
"response": {
"$ref": "Operation"
@@ -30732,13 +32176,13 @@
]
},
"list": {
- "description": "Retrieves a list of subnetworks available to the specified project.",
- "flatPath": "projects/{project}/regions/{region}/subnetworks",
+ "description": "Retrieves a list of storage pools contained within the specified zone.",
+ "flatPath": "projects/{project}/zones/{zone}/storagePools",
"httpMethod": "GET",
- "id": "compute.subnetworks.list",
+ "id": "compute.storagePools.list",
"parameterOrder": [
"project",
- "region"
+ "zone"
],
"parameters": {
"filter": {
@@ -30771,22 +32215,22 @@
"required": true,
"type": "string"
},
- "region": {
- "description": "Name of the region scoping this request.",
+ "returnPartialSuccess": {
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
+ "location": "query",
+ "type": "boolean"
+ },
+ "zone": {
+ "description": "The name of the zone for this request.",
"location": "path",
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
"required": true,
"type": "string"
- },
- "returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- "location": "query",
- "type": "boolean"
}
},
- "path": "projects/{project}/regions/{region}/subnetworks",
+ "path": "projects/{project}/zones/{zone}/storagePools",
"response": {
- "$ref": "SubnetworkList"
+ "$ref": "StoragePoolList"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
@@ -30794,13 +32238,15 @@
"https://www.googleapis.com/auth/compute.readonly"
]
},
- "listUsable": {
- "description": "Retrieves an aggregated list of all usable subnetworks in the project.",
- "flatPath": "projects/{project}/aggregated/subnetworks/listUsable",
+ "listDisks": {
+ "description": "Lists the disks in a specified storage pool.",
+ "flatPath": "projects/{project}/zones/{zone}/storagePools/{storagePool}/listDisks",
"httpMethod": "GET",
- "id": "compute.subnetworks.listUsable",
+ "id": "compute.storagePools.listDisks",
"parameterOrder": [
- "project"
+ "project",
+ "zone",
+ "storagePool"
],
"parameters": {
"filter": {
@@ -30834,14 +32280,28 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
+ },
+ "storagePool": {
+ "description": "Name of the storage pool to list disks of.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
+ "required": true,
+ "type": "string"
+ },
+ "zone": {
+ "description": "The name of the zone for this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "required": true,
+ "type": "string"
}
},
- "path": "projects/{project}/aggregated/subnetworks/listUsable",
+ "path": "projects/{project}/zones/{zone}/storagePools/{storagePool}/listDisks",
"response": {
- "$ref": "UsableSubnetworksAggregatedList"
+ "$ref": "StoragePoolListDisks"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
@@ -30849,23 +32309,17 @@
"https://www.googleapis.com/auth/compute.readonly"
]
},
- "patch": {
- "description": "Patches the specified subnetwork with the data included in the request. Only certain fields can be updated with a patch request as indicated in the field descriptions. You must specify the current fingerprint of the subnetwork resource being patched.",
- "flatPath": "projects/{project}/regions/{region}/subnetworks/{subnetwork}",
- "httpMethod": "PATCH",
- "id": "compute.subnetworks.patch",
+ "setIamPolicy": {
+ "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
+ "flatPath": "projects/{project}/zones/{zone}/storagePools/{resource}/setIamPolicy",
+ "httpMethod": "POST",
+ "id": "compute.storagePools.setIamPolicy",
"parameterOrder": [
"project",
- "region",
- "subnetwork"
+ "zone",
+ "resource"
],
"parameters": {
- "drainTimeoutSeconds": {
- "description": "The drain timeout specifies the upper bound in seconds on the amount of time allowed to drain connections from the current ACTIVE subnetwork to the current BACKUP subnetwork. The drain timeout is only applicable when the following conditions are true: - the subnetwork being patched has purpose = INTERNAL_HTTPS_LOAD_BALANCER - the subnetwork being patched has role = BACKUP - the patch request is setting the role to ACTIVE. Note that after this patch operation the roles of the ACTIVE and BACKUP subnetworks will be swapped.",
- "format": "int32",
- "location": "query",
- "type": "integer"
- },
"project": {
"description": "Project ID for this request.",
"location": "path",
@@ -30873,46 +32327,41 @@
"required": true,
"type": "string"
},
- "region": {
- "description": "Name of the region scoping this request.",
+ "resource": {
+ "description": "Name or id of the resource for this request.",
"location": "path",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
"required": true,
"type": "string"
},
- "requestId": {
- "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- "location": "query",
- "type": "string"
- },
- "subnetwork": {
- "description": "Name of the Subnetwork resource to patch.",
+ "zone": {
+ "description": "The name of the zone for this request.",
"location": "path",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
"required": true,
"type": "string"
}
},
- "path": "projects/{project}/regions/{region}/subnetworks/{subnetwork}",
+ "path": "projects/{project}/zones/{zone}/storagePools/{resource}/setIamPolicy",
"request": {
- "$ref": "Subnetwork"
+ "$ref": "ZoneSetPolicyRequest"
},
"response": {
- "$ref": "Operation"
+ "$ref": "Policy"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/compute"
]
},
- "setIamPolicy": {
- "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
- "flatPath": "projects/{project}/regions/{region}/subnetworks/{resource}/setIamPolicy",
+ "testIamPermissions": {
+ "description": "Returns permissions that a caller has on the specified resource.",
+ "flatPath": "projects/{project}/zones/{zone}/storagePools/{resource}/testIamPermissions",
"httpMethod": "POST",
- "id": "compute.subnetworks.setIamPolicy",
+ "id": "compute.storagePools.testIamPermissions",
"parameterOrder": [
"project",
- "region",
+ "zone",
"resource"
],
"parameters": {
@@ -30923,42 +32372,43 @@
"required": true,
"type": "string"
},
- "region": {
- "description": "The name of the region for this request.",
+ "resource": {
+ "description": "Name or id of the resource for this request.",
"location": "path",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
"required": true,
"type": "string"
},
- "resource": {
- "description": "Name or id of the resource for this request.",
+ "zone": {
+ "description": "The name of the zone for this request.",
"location": "path",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
"required": true,
"type": "string"
}
},
- "path": "projects/{project}/regions/{region}/subnetworks/{resource}/setIamPolicy",
+ "path": "projects/{project}/zones/{zone}/storagePools/{resource}/testIamPermissions",
"request": {
- "$ref": "RegionSetPolicyRequest"
+ "$ref": "TestPermissionsRequest"
},
"response": {
- "$ref": "Policy"
+ "$ref": "TestPermissionsResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/compute"
+ "https://www.googleapis.com/auth/compute",
+ "https://www.googleapis.com/auth/compute.readonly"
]
},
- "setPrivateIpGoogleAccess": {
- "description": "Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access.",
- "flatPath": "projects/{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess",
- "httpMethod": "POST",
- "id": "compute.subnetworks.setPrivateIpGoogleAccess",
+ "update": {
+ "description": "Updates the specified storagePool with the data included in the request. The update is performed only on selected fields included as part of update-mask. Only the following fields can be modified: pool_provisioned_capacity_gb, pool_provisioned_iops and pool_provisioned_throughput.",
+ "flatPath": "projects/{project}/zones/{zone}/storagePools/{storagePool}",
+ "httpMethod": "PATCH",
+ "id": "compute.storagePools.update",
"parameterOrder": [
"project",
- "region",
- "subnetwork"
+ "zone",
+ "storagePool"
],
"parameters": {
"project": {
@@ -30968,29 +32418,35 @@
"required": true,
"type": "string"
},
- "region": {
- "description": "Name of the region scoping this request.",
+ "requestId": {
+ "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
+ "location": "query",
+ "type": "string"
+ },
+ "storagePool": {
+ "description": "The storagePool name for this request.",
"location": "path",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
"required": true,
"type": "string"
},
- "requestId": {
- "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
+ "updateMask": {
+ "description": "update_mask indicates fields to be updated as part of this request.",
+ "format": "google-fieldmask",
"location": "query",
"type": "string"
},
- "subnetwork": {
- "description": "Name of the Subnetwork resource.",
+ "zone": {
+ "description": "The name of the zone for this request.",
"location": "path",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
"required": true,
"type": "string"
}
},
- "path": "projects/{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess",
+ "path": "projects/{project}/zones/{zone}/storagePools/{storagePool}",
"request": {
- "$ref": "SubnetworksSetPrivateIpGoogleAccessRequest"
+ "$ref": "StoragePool"
},
"response": {
"$ref": "Operation"
@@ -30999,18 +32455,48 @@
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/compute"
]
- },
- "testIamPermissions": {
- "description": "Returns permissions that a caller has on the specified resource.",
- "flatPath": "projects/{project}/regions/{region}/subnetworks/{resource}/testIamPermissions",
- "httpMethod": "POST",
- "id": "compute.subnetworks.testIamPermissions",
+ }
+ }
+ },
+ "subnetworks": {
+ "methods": {
+ "aggregatedList": {
+ "description": "Retrieves an aggregated list of subnetworks. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
+ "flatPath": "projects/{project}/aggregated/subnetworks",
+ "httpMethod": "GET",
+ "id": "compute.subnetworks.aggregatedList",
"parameterOrder": [
- "project",
- "region",
- "resource"
+ "project"
],
"parameters": {
+ "filter": {
+ "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
+ "location": "query",
+ "type": "string"
+ },
+ "includeAllScopes": {
+ "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
+ "location": "query",
+ "type": "boolean"
+ },
+ "maxResults": {
+ "default": "500",
+ "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
+ "format": "uint32",
+ "location": "query",
+ "minimum": "0",
+ "type": "integer"
+ },
+ "orderBy": {
+ "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
+ "location": "query",
+ "type": "string"
+ },
+ "pageToken": {
+ "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
+ "location": "query",
+ "type": "string"
+ },
"project": {
"description": "Project ID for this request.",
"location": "path",
@@ -31018,46 +32504,37 @@
"required": true,
"type": "string"
},
- "region": {
- "description": "The name of the region for this request.",
- "location": "path",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- "required": true,
- "type": "string"
+ "returnPartialSuccess": {
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
+ "location": "query",
+ "type": "boolean"
},
- "resource": {
- "description": "Name or id of the resource for this request.",
- "location": "path",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- "required": true,
+ "serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
+ "format": "int64",
+ "location": "query",
"type": "string"
}
},
- "path": "projects/{project}/regions/{region}/subnetworks/{resource}/testIamPermissions",
- "request": {
- "$ref": "TestPermissionsRequest"
- },
+ "path": "projects/{project}/aggregated/subnetworks",
"response": {
- "$ref": "TestPermissionsResponse"
+ "$ref": "SubnetworkAggregatedList"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/compute",
"https://www.googleapis.com/auth/compute.readonly"
]
- }
- }
- },
- "targetGrpcProxies": {
- "methods": {
+ },
"delete": {
- "description": "Deletes the specified TargetGrpcProxy in the given scope",
- "flatPath": "projects/{project}/global/targetGrpcProxies/{targetGrpcProxy}",
+ "description": "Deletes the specified subnetwork.",
+ "flatPath": "projects/{project}/regions/{region}/subnetworks/{subnetwork}",
"httpMethod": "DELETE",
- "id": "compute.targetGrpcProxies.delete",
+ "id": "compute.subnetworks.delete",
"parameterOrder": [
"project",
- "targetGrpcProxy"
+ "region",
+ "subnetwork"
],
"parameters": {
"project": {
@@ -31067,20 +32544,27 @@
"required": true,
"type": "string"
},
+ "region": {
+ "description": "Name of the region scoping this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "required": true,
+ "type": "string"
+ },
"requestId": {
"description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
"location": "query",
"type": "string"
},
- "targetGrpcProxy": {
- "description": "Name of the TargetGrpcProxy resource to delete.",
+ "subnetwork": {
+ "description": "Name of the Subnetwork resource to delete.",
"location": "path",
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
"required": true,
"type": "string"
}
},
- "path": "projects/{project}/global/targetGrpcProxies/{targetGrpcProxy}",
+ "path": "projects/{project}/regions/{region}/subnetworks/{subnetwork}",
"response": {
"$ref": "Operation"
},
@@ -31089,14 +32573,15 @@
"https://www.googleapis.com/auth/compute"
]
},
- "get": {
- "description": "Returns the specified TargetGrpcProxy resource in the given scope.",
- "flatPath": "projects/{project}/global/targetGrpcProxies/{targetGrpcProxy}",
- "httpMethod": "GET",
- "id": "compute.targetGrpcProxies.get",
+ "expandIpCidrRange": {
+ "description": "Expands the IP CIDR range of the subnetwork to a specified value.",
+ "flatPath": "projects/{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange",
+ "httpMethod": "POST",
+ "id": "compute.subnetworks.expandIpCidrRange",
"parameterOrder": [
"project",
- "targetGrpcProxy"
+ "region",
+ "subnetwork"
],
"parameters": {
"project": {
@@ -31106,31 +32591,47 @@
"required": true,
"type": "string"
},
- "targetGrpcProxy": {
- "description": "Name of the TargetGrpcProxy resource to return.",
+ "region": {
+ "description": "Name of the region scoping this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "required": true,
+ "type": "string"
+ },
+ "requestId": {
+ "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
+ "location": "query",
+ "type": "string"
+ },
+ "subnetwork": {
+ "description": "Name of the Subnetwork resource to update.",
"location": "path",
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
"required": true,
"type": "string"
}
},
- "path": "projects/{project}/global/targetGrpcProxies/{targetGrpcProxy}",
+ "path": "projects/{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange",
+ "request": {
+ "$ref": "SubnetworksExpandIpCidrRangeRequest"
+ },
"response": {
- "$ref": "TargetGrpcProxy"
+ "$ref": "Operation"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/compute",
- "https://www.googleapis.com/auth/compute.readonly"
+ "https://www.googleapis.com/auth/compute"
]
},
- "insert": {
- "description": "Creates a TargetGrpcProxy in the specified project in the given scope using the parameters that are included in the request.",
- "flatPath": "projects/{project}/global/targetGrpcProxies",
- "httpMethod": "POST",
- "id": "compute.targetGrpcProxies.insert",
+ "get": {
+ "description": "Returns the specified subnetwork.",
+ "flatPath": "projects/{project}/regions/{region}/subnetworks/{subnetwork}",
+ "httpMethod": "GET",
+ "id": "compute.subnetworks.get",
"parameterOrder": [
- "project"
+ "project",
+ "region",
+ "subnetwork"
],
"parameters": {
"project": {
@@ -31140,56 +32641,48 @@
"required": true,
"type": "string"
},
- "requestId": {
- "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- "location": "query",
+ "region": {
+ "description": "Name of the region scoping this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "required": true,
+ "type": "string"
+ },
+ "subnetwork": {
+ "description": "Name of the Subnetwork resource to return.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
+ "required": true,
"type": "string"
}
},
- "path": "projects/{project}/global/targetGrpcProxies",
- "request": {
- "$ref": "TargetGrpcProxy"
- },
+ "path": "projects/{project}/regions/{region}/subnetworks/{subnetwork}",
"response": {
- "$ref": "Operation"
+ "$ref": "Subnetwork"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/compute"
+ "https://www.googleapis.com/auth/compute",
+ "https://www.googleapis.com/auth/compute.readonly"
]
},
- "list": {
- "description": "Lists the TargetGrpcProxies for a project in the given scope.",
- "flatPath": "projects/{project}/global/targetGrpcProxies",
+ "getIamPolicy": {
+ "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
+ "flatPath": "projects/{project}/regions/{region}/subnetworks/{resource}/getIamPolicy",
"httpMethod": "GET",
- "id": "compute.targetGrpcProxies.list",
+ "id": "compute.subnetworks.getIamPolicy",
"parameterOrder": [
- "project"
+ "project",
+ "region",
+ "resource"
],
"parameters": {
- "filter": {
- "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- "location": "query",
- "type": "string"
- },
- "maxResults": {
- "default": "500",
- "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- "format": "uint32",
+ "optionsRequestedPolicyVersion": {
+ "description": "Requested IAM Policy version.",
+ "format": "int32",
"location": "query",
- "minimum": "0",
"type": "integer"
},
- "orderBy": {
- "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- "location": "query",
- "type": "string"
- },
- "pageToken": {
- "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- "location": "query",
- "type": "string"
- },
"project": {
"description": "Project ID for this request.",
"location": "path",
@@ -31197,15 +32690,24 @@
"required": true,
"type": "string"
},
- "returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- "location": "query",
- "type": "boolean"
+ "region": {
+ "description": "The name of the region for this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "required": true,
+ "type": "string"
+ },
+ "resource": {
+ "description": "Name or id of the resource for this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
+ "required": true,
+ "type": "string"
}
},
- "path": "projects/{project}/global/targetGrpcProxies",
+ "path": "projects/{project}/regions/{region}/subnetworks/{resource}/getIamPolicy",
"response": {
- "$ref": "TargetGrpcProxyList"
+ "$ref": "Policy"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
@@ -31213,14 +32715,14 @@
"https://www.googleapis.com/auth/compute.readonly"
]
},
- "patch": {
- "description": "Patches the specified TargetGrpcProxy resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules.",
- "flatPath": "projects/{project}/global/targetGrpcProxies/{targetGrpcProxy}",
- "httpMethod": "PATCH",
- "id": "compute.targetGrpcProxies.patch",
+ "insert": {
+ "description": "Creates a subnetwork in the specified project using the data included in the request.",
+ "flatPath": "projects/{project}/regions/{region}/subnetworks",
+ "httpMethod": "POST",
+ "id": "compute.subnetworks.insert",
"parameterOrder": [
"project",
- "targetGrpcProxy"
+ "region"
],
"parameters": {
"project": {
@@ -31230,22 +32732,22 @@
"required": true,
"type": "string"
},
+ "region": {
+ "description": "Name of the region scoping this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "required": true,
+ "type": "string"
+ },
"requestId": {
"description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
"location": "query",
"type": "string"
- },
- "targetGrpcProxy": {
- "description": "Name of the TargetGrpcProxy resource to patch.",
- "location": "path",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- "required": true,
- "type": "string"
}
},
- "path": "projects/{project}/global/targetGrpcProxies/{targetGrpcProxy}",
+ "path": "projects/{project}/regions/{region}/subnetworks",
"request": {
- "$ref": "TargetGrpcProxy"
+ "$ref": "Subnetwork"
},
"response": {
"$ref": "Operation"
@@ -31254,18 +32756,15 @@
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/compute"
]
- }
- }
- },
- "targetHttpProxies": {
- "methods": {
- "aggregatedList": {
- "description": "Retrieves the list of all TargetHttpProxy resources, regional and global, available to the specified project.",
- "flatPath": "projects/{project}/aggregated/targetHttpProxies",
+ },
+ "list": {
+ "description": "Retrieves a list of subnetworks available to the specified project.",
+ "flatPath": "projects/{project}/regions/{region}/subnetworks",
"httpMethod": "GET",
- "id": "compute.targetHttpProxies.aggregatedList",
+ "id": "compute.subnetworks.list",
"parameterOrder": [
- "project"
+ "project",
+ "region"
],
"parameters": {
"filter": {
@@ -31273,11 +32772,6 @@
"location": "query",
"type": "string"
},
- "includeAllScopes": {
- "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- "location": "query",
- "type": "boolean"
- },
"maxResults": {
"default": "500",
"description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
@@ -31296,44 +32790,6 @@
"location": "query",
"type": "string"
},
- "project": {
- "description": "Name of the project scoping this request.",
- "location": "path",
- "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- "required": true,
- "type": "string"
- },
- "returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- "location": "query",
- "type": "boolean"
- },
- "serviceProjectNumber": {
- "format": "int64",
- "location": "query",
- "type": "string"
- }
- },
- "path": "projects/{project}/aggregated/targetHttpProxies",
- "response": {
- "$ref": "TargetHttpProxyAggregatedList"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/compute",
- "https://www.googleapis.com/auth/compute.readonly"
- ]
- },
- "delete": {
- "description": "Deletes the specified TargetHttpProxy resource.",
- "flatPath": "projects/{project}/global/targetHttpProxies/{targetHttpProxy}",
- "httpMethod": "DELETE",
- "id": "compute.targetHttpProxies.delete",
- "parameterOrder": [
- "project",
- "targetHttpProxy"
- ],
- "parameters": {
"project": {
"description": "Project ID for this request.",
"location": "path",
@@ -31341,56 +32797,22 @@
"required": true,
"type": "string"
},
- "requestId": {
- "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- "location": "query",
- "type": "string"
- },
- "targetHttpProxy": {
- "description": "Name of the TargetHttpProxy resource to delete.",
- "location": "path",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- "required": true,
- "type": "string"
- }
- },
- "path": "projects/{project}/global/targetHttpProxies/{targetHttpProxy}",
- "response": {
- "$ref": "Operation"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/compute"
- ]
- },
- "get": {
- "description": "Returns the specified TargetHttpProxy resource.",
- "flatPath": "projects/{project}/global/targetHttpProxies/{targetHttpProxy}",
- "httpMethod": "GET",
- "id": "compute.targetHttpProxies.get",
- "parameterOrder": [
- "project",
- "targetHttpProxy"
- ],
- "parameters": {
- "project": {
- "description": "Project ID for this request.",
+ "region": {
+ "description": "Name of the region scoping this request.",
"location": "path",
- "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
"required": true,
"type": "string"
},
- "targetHttpProxy": {
- "description": "Name of the TargetHttpProxy resource to return.",
- "location": "path",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- "required": true,
- "type": "string"
+ "returnPartialSuccess": {
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
+ "location": "query",
+ "type": "boolean"
}
},
- "path": "projects/{project}/global/targetHttpProxies/{targetHttpProxy}",
+ "path": "projects/{project}/regions/{region}/subnetworks",
"response": {
- "$ref": "TargetHttpProxy"
+ "$ref": "SubnetworkList"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
@@ -31398,45 +32820,11 @@
"https://www.googleapis.com/auth/compute.readonly"
]
},
- "insert": {
- "description": "Creates a TargetHttpProxy resource in the specified project using the data included in the request.",
- "flatPath": "projects/{project}/global/targetHttpProxies",
- "httpMethod": "POST",
- "id": "compute.targetHttpProxies.insert",
- "parameterOrder": [
- "project"
- ],
- "parameters": {
- "project": {
- "description": "Project ID for this request.",
- "location": "path",
- "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- "required": true,
- "type": "string"
- },
- "requestId": {
- "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- "location": "query",
- "type": "string"
- }
- },
- "path": "projects/{project}/global/targetHttpProxies",
- "request": {
- "$ref": "TargetHttpProxy"
- },
- "response": {
- "$ref": "Operation"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/compute"
- ]
- },
- "list": {
- "description": "Retrieves the list of TargetHttpProxy resources available to the specified project.",
- "flatPath": "projects/{project}/global/targetHttpProxies",
+ "listUsable": {
+ "description": "Retrieves an aggregated list of all usable subnetworks in the project.",
+ "flatPath": "projects/{project}/aggregated/subnetworks/listUsable",
"httpMethod": "GET",
- "id": "compute.targetHttpProxies.list",
+ "id": "compute.subnetworks.listUsable",
"parameterOrder": [
"project"
],
@@ -31472,14 +32860,14 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
},
- "path": "projects/{project}/global/targetHttpProxies",
+ "path": "projects/{project}/aggregated/subnetworks/listUsable",
"response": {
- "$ref": "TargetHttpProxyList"
+ "$ref": "UsableSubnetworksAggregatedList"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
@@ -31488,15 +32876,22 @@
]
},
"patch": {
- "description": "Patches the specified TargetHttpProxy resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules.",
- "flatPath": "projects/{project}/global/targetHttpProxies/{targetHttpProxy}",
+ "description": "Patches the specified subnetwork with the data included in the request. Only certain fields can be updated with a patch request as indicated in the field descriptions. You must specify the current fingerprint of the subnetwork resource being patched.",
+ "flatPath": "projects/{project}/regions/{region}/subnetworks/{subnetwork}",
"httpMethod": "PATCH",
- "id": "compute.targetHttpProxies.patch",
+ "id": "compute.subnetworks.patch",
"parameterOrder": [
"project",
- "targetHttpProxy"
+ "region",
+ "subnetwork"
],
"parameters": {
+ "drainTimeoutSeconds": {
+ "description": "The drain timeout specifies the upper bound in seconds on the amount of time allowed to drain connections from the current ACTIVE subnetwork to the current BACKUP subnetwork. The drain timeout is only applicable when the following conditions are true: - the subnetwork being patched has purpose = INTERNAL_HTTPS_LOAD_BALANCER - the subnetwork being patched has role = BACKUP - the patch request is setting the role to ACTIVE. Note that after this patch operation the roles of the ACTIVE and BACKUP subnetworks will be swapped.",
+ "format": "int32",
+ "location": "query",
+ "type": "integer"
+ },
"project": {
"description": "Project ID for this request.",
"location": "path",
@@ -31504,22 +32899,29 @@
"required": true,
"type": "string"
},
+ "region": {
+ "description": "Name of the region scoping this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "required": true,
+ "type": "string"
+ },
"requestId": {
"description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
"location": "query",
"type": "string"
},
- "targetHttpProxy": {
- "description": "Name of the TargetHttpProxy resource to patch.",
+ "subnetwork": {
+ "description": "Name of the Subnetwork resource to patch.",
"location": "path",
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
"required": true,
"type": "string"
}
},
- "path": "projects/{project}/global/targetHttpProxies/{targetHttpProxy}",
+ "path": "projects/{project}/regions/{region}/subnetworks/{subnetwork}",
"request": {
- "$ref": "TargetHttpProxy"
+ "$ref": "Subnetwork"
},
"response": {
"$ref": "Operation"
@@ -31529,14 +32931,15 @@
"https://www.googleapis.com/auth/compute"
]
},
- "setUrlMap": {
- "description": "Changes the URL map for TargetHttpProxy.",
- "flatPath": "projects/{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap",
+ "setIamPolicy": {
+ "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
+ "flatPath": "projects/{project}/regions/{region}/subnetworks/{resource}/setIamPolicy",
"httpMethod": "POST",
- "id": "compute.targetHttpProxies.setUrlMap",
+ "id": "compute.subnetworks.setIamPolicy",
"parameterOrder": [
"project",
- "targetHttpProxy"
+ "region",
+ "resource"
],
"parameters": {
"project": {
@@ -31546,108 +32949,141 @@
"required": true,
"type": "string"
},
- "requestId": {
- "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- "location": "query",
+ "region": {
+ "description": "The name of the region for this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "required": true,
"type": "string"
},
- "targetHttpProxy": {
- "description": "Name of the TargetHttpProxy to set a URL map for.",
+ "resource": {
+ "description": "Name or id of the resource for this request.",
"location": "path",
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
"required": true,
"type": "string"
}
},
- "path": "projects/{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap",
+ "path": "projects/{project}/regions/{region}/subnetworks/{resource}/setIamPolicy",
"request": {
- "$ref": "UrlMapReference"
+ "$ref": "RegionSetPolicyRequest"
},
"response": {
- "$ref": "Operation"
+ "$ref": "Policy"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/compute"
]
- }
- }
- },
- "targetHttpsProxies": {
- "methods": {
- "aggregatedList": {
- "description": "Retrieves the list of all TargetHttpsProxy resources, regional and global, available to the specified project.",
- "flatPath": "projects/{project}/aggregated/targetHttpsProxies",
- "httpMethod": "GET",
- "id": "compute.targetHttpsProxies.aggregatedList",
+ },
+ "setPrivateIpGoogleAccess": {
+ "description": "Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access.",
+ "flatPath": "projects/{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess",
+ "httpMethod": "POST",
+ "id": "compute.subnetworks.setPrivateIpGoogleAccess",
"parameterOrder": [
- "project"
+ "project",
+ "region",
+ "subnetwork"
],
"parameters": {
- "filter": {
- "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- "location": "query",
+ "project": {
+ "description": "Project ID for this request.",
+ "location": "path",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "required": true,
"type": "string"
},
- "includeAllScopes": {
- "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- "location": "query",
- "type": "boolean"
- },
- "maxResults": {
- "default": "500",
- "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- "format": "uint32",
- "location": "query",
- "minimum": "0",
- "type": "integer"
- },
- "orderBy": {
- "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- "location": "query",
+ "region": {
+ "description": "Name of the region scoping this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "required": true,
"type": "string"
},
- "pageToken": {
- "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
+ "requestId": {
+ "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
"location": "query",
"type": "string"
},
+ "subnetwork": {
+ "description": "Name of the Subnetwork resource.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
+ "required": true,
+ "type": "string"
+ }
+ },
+ "path": "projects/{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess",
+ "request": {
+ "$ref": "SubnetworksSetPrivateIpGoogleAccessRequest"
+ },
+ "response": {
+ "$ref": "Operation"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute"
+ ]
+ },
+ "testIamPermissions": {
+ "description": "Returns permissions that a caller has on the specified resource.",
+ "flatPath": "projects/{project}/regions/{region}/subnetworks/{resource}/testIamPermissions",
+ "httpMethod": "POST",
+ "id": "compute.subnetworks.testIamPermissions",
+ "parameterOrder": [
+ "project",
+ "region",
+ "resource"
+ ],
+ "parameters": {
"project": {
- "description": "Name of the project scoping this request.",
+ "description": "Project ID for this request.",
"location": "path",
"pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
"required": true,
"type": "string"
},
- "returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- "location": "query",
- "type": "boolean"
+ "region": {
+ "description": "The name of the region for this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "required": true,
+ "type": "string"
},
- "serviceProjectNumber": {
- "format": "int64",
- "location": "query",
+ "resource": {
+ "description": "Name or id of the resource for this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
+ "required": true,
"type": "string"
}
},
- "path": "projects/{project}/aggregated/targetHttpsProxies",
+ "path": "projects/{project}/regions/{region}/subnetworks/{resource}/testIamPermissions",
+ "request": {
+ "$ref": "TestPermissionsRequest"
+ },
"response": {
- "$ref": "TargetHttpsProxyAggregatedList"
+ "$ref": "TestPermissionsResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/compute",
"https://www.googleapis.com/auth/compute.readonly"
]
- },
+ }
+ }
+ },
+ "targetGrpcProxies": {
+ "methods": {
"delete": {
- "description": "Deletes the specified TargetHttpsProxy resource.",
- "flatPath": "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}",
+ "description": "Deletes the specified TargetGrpcProxy in the given scope",
+ "flatPath": "projects/{project}/global/targetGrpcProxies/{targetGrpcProxy}",
"httpMethod": "DELETE",
- "id": "compute.targetHttpsProxies.delete",
+ "id": "compute.targetGrpcProxies.delete",
"parameterOrder": [
"project",
- "targetHttpsProxy"
+ "targetGrpcProxy"
],
"parameters": {
"project": {
@@ -31662,15 +33098,15 @@
"location": "query",
"type": "string"
},
- "targetHttpsProxy": {
- "description": "Name of the TargetHttpsProxy resource to delete.",
+ "targetGrpcProxy": {
+ "description": "Name of the TargetGrpcProxy resource to delete.",
"location": "path",
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
"required": true,
"type": "string"
}
},
- "path": "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}",
+ "path": "projects/{project}/global/targetGrpcProxies/{targetGrpcProxy}",
"response": {
"$ref": "Operation"
},
@@ -31680,13 +33116,13 @@
]
},
"get": {
- "description": "Returns the specified TargetHttpsProxy resource.",
- "flatPath": "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}",
+ "description": "Returns the specified TargetGrpcProxy resource in the given scope.",
+ "flatPath": "projects/{project}/global/targetGrpcProxies/{targetGrpcProxy}",
"httpMethod": "GET",
- "id": "compute.targetHttpsProxies.get",
+ "id": "compute.targetGrpcProxies.get",
"parameterOrder": [
"project",
- "targetHttpsProxy"
+ "targetGrpcProxy"
],
"parameters": {
"project": {
@@ -31696,17 +33132,17 @@
"required": true,
"type": "string"
},
- "targetHttpsProxy": {
- "description": "Name of the TargetHttpsProxy resource to return.",
+ "targetGrpcProxy": {
+ "description": "Name of the TargetGrpcProxy resource to return.",
"location": "path",
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
"required": true,
"type": "string"
}
},
- "path": "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}",
+ "path": "projects/{project}/global/targetGrpcProxies/{targetGrpcProxy}",
"response": {
- "$ref": "TargetHttpsProxy"
+ "$ref": "TargetGrpcProxy"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
@@ -31715,10 +33151,10 @@
]
},
"insert": {
- "description": "Creates a TargetHttpsProxy resource in the specified project using the data included in the request.",
- "flatPath": "projects/{project}/global/targetHttpsProxies",
+ "description": "Creates a TargetGrpcProxy in the specified project in the given scope using the parameters that are included in the request.",
+ "flatPath": "projects/{project}/global/targetGrpcProxies",
"httpMethod": "POST",
- "id": "compute.targetHttpsProxies.insert",
+ "id": "compute.targetGrpcProxies.insert",
"parameterOrder": [
"project"
],
@@ -31736,9 +33172,9 @@
"type": "string"
}
},
- "path": "projects/{project}/global/targetHttpsProxies",
+ "path": "projects/{project}/global/targetGrpcProxies",
"request": {
- "$ref": "TargetHttpsProxy"
+ "$ref": "TargetGrpcProxy"
},
"response": {
"$ref": "Operation"
@@ -31749,10 +33185,10 @@
]
},
"list": {
- "description": "Retrieves the list of TargetHttpsProxy resources available to the specified project.",
- "flatPath": "projects/{project}/global/targetHttpsProxies",
+ "description": "Lists the TargetGrpcProxies for a project in the given scope.",
+ "flatPath": "projects/{project}/global/targetGrpcProxies",
"httpMethod": "GET",
- "id": "compute.targetHttpsProxies.list",
+ "id": "compute.targetGrpcProxies.list",
"parameterOrder": [
"project"
],
@@ -31788,14 +33224,14 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
},
- "path": "projects/{project}/global/targetHttpsProxies",
+ "path": "projects/{project}/global/targetGrpcProxies",
"response": {
- "$ref": "TargetHttpsProxyList"
+ "$ref": "TargetGrpcProxyList"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
@@ -31804,13 +33240,13 @@
]
},
"patch": {
- "description": "Patches the specified TargetHttpsProxy resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules.",
- "flatPath": "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}",
+ "description": "Patches the specified TargetGrpcProxy resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules.",
+ "flatPath": "projects/{project}/global/targetGrpcProxies/{targetGrpcProxy}",
"httpMethod": "PATCH",
- "id": "compute.targetHttpsProxies.patch",
+ "id": "compute.targetGrpcProxies.patch",
"parameterOrder": [
"project",
- "targetHttpsProxy"
+ "targetGrpcProxy"
],
"parameters": {
"project": {
@@ -31825,17 +33261,17 @@
"location": "query",
"type": "string"
},
- "targetHttpsProxy": {
- "description": "Name of the TargetHttpsProxy resource to patch.",
+ "targetGrpcProxy": {
+ "description": "Name of the TargetGrpcProxy resource to patch.",
"location": "path",
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
"required": true,
"type": "string"
}
},
- "path": "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}",
+ "path": "projects/{project}/global/targetGrpcProxies/{targetGrpcProxy}",
"request": {
- "$ref": "TargetHttpsProxy"
+ "$ref": "TargetGrpcProxy"
},
"response": {
"$ref": "Operation"
@@ -31844,15 +33280,85 @@
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/compute"
]
+ }
+ }
+ },
+ "targetHttpProxies": {
+ "methods": {
+ "aggregatedList": {
+ "description": "Retrieves the list of all TargetHttpProxy resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
+ "flatPath": "projects/{project}/aggregated/targetHttpProxies",
+ "httpMethod": "GET",
+ "id": "compute.targetHttpProxies.aggregatedList",
+ "parameterOrder": [
+ "project"
+ ],
+ "parameters": {
+ "filter": {
+ "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
+ "location": "query",
+ "type": "string"
+ },
+ "includeAllScopes": {
+ "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
+ "location": "query",
+ "type": "boolean"
+ },
+ "maxResults": {
+ "default": "500",
+ "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
+ "format": "uint32",
+ "location": "query",
+ "minimum": "0",
+ "type": "integer"
+ },
+ "orderBy": {
+ "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
+ "location": "query",
+ "type": "string"
+ },
+ "pageToken": {
+ "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
+ "location": "query",
+ "type": "string"
+ },
+ "project": {
+ "description": "Name of the project scoping this request.",
+ "location": "path",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "required": true,
+ "type": "string"
+ },
+ "returnPartialSuccess": {
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
+ "location": "query",
+ "type": "boolean"
+ },
+ "serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
+ "format": "int64",
+ "location": "query",
+ "type": "string"
+ }
+ },
+ "path": "projects/{project}/aggregated/targetHttpProxies",
+ "response": {
+ "$ref": "TargetHttpProxyAggregatedList"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute",
+ "https://www.googleapis.com/auth/compute.readonly"
+ ]
},
- "setCertificateMap": {
- "description": "Changes the Certificate Map for TargetHttpsProxy.",
- "flatPath": "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}/setCertificateMap",
- "httpMethod": "POST",
- "id": "compute.targetHttpsProxies.setCertificateMap",
+ "delete": {
+ "description": "Deletes the specified TargetHttpProxy resource.",
+ "flatPath": "projects/{project}/global/targetHttpProxies/{targetHttpProxy}",
+ "httpMethod": "DELETE",
+ "id": "compute.targetHttpProxies.delete",
"parameterOrder": [
"project",
- "targetHttpsProxy"
+ "targetHttpProxy"
],
"parameters": {
"project": {
@@ -31867,17 +33373,15 @@
"location": "query",
"type": "string"
},
- "targetHttpsProxy": {
- "description": "Name of the TargetHttpsProxy resource whose CertificateMap is to be set. The name must be 1-63 characters long, and comply with RFC1035.",
+ "targetHttpProxy": {
+ "description": "Name of the TargetHttpProxy resource to delete.",
"location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
"required": true,
"type": "string"
}
},
- "path": "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}/setCertificateMap",
- "request": {
- "$ref": "TargetHttpsProxiesSetCertificateMapRequest"
- },
+ "path": "projects/{project}/global/targetHttpProxies/{targetHttpProxy}",
"response": {
"$ref": "Operation"
},
@@ -31886,14 +33390,14 @@
"https://www.googleapis.com/auth/compute"
]
},
- "setQuicOverride": {
- "description": "Sets the QUIC override policy for TargetHttpsProxy.",
- "flatPath": "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}/setQuicOverride",
- "httpMethod": "POST",
- "id": "compute.targetHttpsProxies.setQuicOverride",
+ "get": {
+ "description": "Returns the specified TargetHttpProxy resource.",
+ "flatPath": "projects/{project}/global/targetHttpProxies/{targetHttpProxy}",
+ "httpMethod": "GET",
+ "id": "compute.targetHttpProxies.get",
"parameterOrder": [
"project",
- "targetHttpsProxy"
+ "targetHttpProxy"
],
"parameters": {
"project": {
@@ -31903,38 +33407,31 @@
"required": true,
"type": "string"
},
- "requestId": {
- "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- "location": "query",
- "type": "string"
- },
- "targetHttpsProxy": {
- "description": "Name of the TargetHttpsProxy resource to set the QUIC override policy for. The name should conform to RFC1035.",
+ "targetHttpProxy": {
+ "description": "Name of the TargetHttpProxy resource to return.",
"location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
"required": true,
"type": "string"
}
},
- "path": "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}/setQuicOverride",
- "request": {
- "$ref": "TargetHttpsProxiesSetQuicOverrideRequest"
- },
+ "path": "projects/{project}/global/targetHttpProxies/{targetHttpProxy}",
"response": {
- "$ref": "Operation"
+ "$ref": "TargetHttpProxy"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/compute"
+ "https://www.googleapis.com/auth/compute",
+ "https://www.googleapis.com/auth/compute.readonly"
]
},
- "setSslCertificates": {
- "description": "Replaces SslCertificates for TargetHttpsProxy.",
- "flatPath": "projects/{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates",
+ "insert": {
+ "description": "Creates a TargetHttpProxy resource in the specified project using the data included in the request.",
+ "flatPath": "projects/{project}/global/targetHttpProxies",
"httpMethod": "POST",
- "id": "compute.targetHttpsProxies.setSslCertificates",
+ "id": "compute.targetHttpProxies.insert",
"parameterOrder": [
- "project",
- "targetHttpsProxy"
+ "project"
],
"parameters": {
"project": {
@@ -31948,18 +33445,11 @@
"description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
"location": "query",
"type": "string"
- },
- "targetHttpsProxy": {
- "description": "Name of the TargetHttpsProxy resource to set an SslCertificates resource for.",
- "location": "path",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- "required": true,
- "type": "string"
}
},
- "path": "projects/{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates",
+ "path": "projects/{project}/global/targetHttpProxies",
"request": {
- "$ref": "TargetHttpsProxiesSetSslCertificatesRequest"
+ "$ref": "TargetHttpProxy"
},
"response": {
"$ref": "Operation"
@@ -31969,14 +33459,69 @@
"https://www.googleapis.com/auth/compute"
]
},
- "setSslPolicy": {
- "description": "Sets the SSL policy for TargetHttpsProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the HTTPS proxy load balancer. They do not affect the connection between the load balancer and the backends.",
- "flatPath": "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}/setSslPolicy",
- "httpMethod": "POST",
- "id": "compute.targetHttpsProxies.setSslPolicy",
+ "list": {
+ "description": "Retrieves the list of TargetHttpProxy resources available to the specified project.",
+ "flatPath": "projects/{project}/global/targetHttpProxies",
+ "httpMethod": "GET",
+ "id": "compute.targetHttpProxies.list",
+ "parameterOrder": [
+ "project"
+ ],
+ "parameters": {
+ "filter": {
+ "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
+ "location": "query",
+ "type": "string"
+ },
+ "maxResults": {
+ "default": "500",
+ "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
+ "format": "uint32",
+ "location": "query",
+ "minimum": "0",
+ "type": "integer"
+ },
+ "orderBy": {
+ "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
+ "location": "query",
+ "type": "string"
+ },
+ "pageToken": {
+ "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
+ "location": "query",
+ "type": "string"
+ },
+ "project": {
+ "description": "Project ID for this request.",
+ "location": "path",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "required": true,
+ "type": "string"
+ },
+ "returnPartialSuccess": {
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
+ "location": "query",
+ "type": "boolean"
+ }
+ },
+ "path": "projects/{project}/global/targetHttpProxies",
+ "response": {
+ "$ref": "TargetHttpProxyList"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute",
+ "https://www.googleapis.com/auth/compute.readonly"
+ ]
+ },
+ "patch": {
+ "description": "Patches the specified TargetHttpProxy resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules.",
+ "flatPath": "projects/{project}/global/targetHttpProxies/{targetHttpProxy}",
+ "httpMethod": "PATCH",
+ "id": "compute.targetHttpProxies.patch",
"parameterOrder": [
"project",
- "targetHttpsProxy"
+ "targetHttpProxy"
],
"parameters": {
"project": {
@@ -31991,16 +33536,17 @@
"location": "query",
"type": "string"
},
- "targetHttpsProxy": {
- "description": "Name of the TargetHttpsProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035.",
+ "targetHttpProxy": {
+ "description": "Name of the TargetHttpProxy resource to patch.",
"location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
"required": true,
"type": "string"
}
},
- "path": "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}/setSslPolicy",
+ "path": "projects/{project}/global/targetHttpProxies/{targetHttpProxy}",
"request": {
- "$ref": "SslPolicyReference"
+ "$ref": "TargetHttpProxy"
},
"response": {
"$ref": "Operation"
@@ -32011,13 +33557,13 @@
]
},
"setUrlMap": {
- "description": "Changes the URL map for TargetHttpsProxy.",
- "flatPath": "projects/{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap",
+ "description": "Changes the URL map for TargetHttpProxy.",
+ "flatPath": "projects/{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap",
"httpMethod": "POST",
- "id": "compute.targetHttpsProxies.setUrlMap",
+ "id": "compute.targetHttpProxies.setUrlMap",
"parameterOrder": [
"project",
- "targetHttpsProxy"
+ "targetHttpProxy"
],
"parameters": {
"project": {
@@ -32032,15 +33578,15 @@
"location": "query",
"type": "string"
},
- "targetHttpsProxy": {
- "description": "Name of the TargetHttpsProxy resource whose URL map is to be set.",
+ "targetHttpProxy": {
+ "description": "Name of the TargetHttpProxy to set a URL map for.",
"location": "path",
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
"required": true,
"type": "string"
}
},
- "path": "projects/{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap",
+ "path": "projects/{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap",
"request": {
"$ref": "UrlMapReference"
},
@@ -32054,13 +33600,13 @@
}
}
},
- "targetInstances": {
+ "targetHttpsProxies": {
"methods": {
"aggregatedList": {
- "description": "Retrieves an aggregated list of target instances.",
- "flatPath": "projects/{project}/aggregated/targetInstances",
+ "description": "Retrieves the list of all TargetHttpsProxy resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
+ "flatPath": "projects/{project}/aggregated/targetHttpsProxies",
"httpMethod": "GET",
- "id": "compute.targetInstances.aggregatedList",
+ "id": "compute.targetHttpsProxies.aggregatedList",
"parameterOrder": [
"project"
],
@@ -32094,26 +33640,27 @@
"type": "string"
},
"project": {
- "description": "Project ID for this request.",
+ "description": "Name of the project scoping this request.",
"location": "path",
"pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
"required": true,
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
"serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
"format": "int64",
"location": "query",
"type": "string"
}
},
- "path": "projects/{project}/aggregated/targetInstances",
+ "path": "projects/{project}/aggregated/targetHttpsProxies",
"response": {
- "$ref": "TargetInstanceAggregatedList"
+ "$ref": "TargetHttpsProxyAggregatedList"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
@@ -32122,14 +33669,13 @@
]
},
"delete": {
- "description": "Deletes the specified TargetInstance resource.",
- "flatPath": "projects/{project}/zones/{zone}/targetInstances/{targetInstance}",
+ "description": "Deletes the specified TargetHttpsProxy resource.",
+ "flatPath": "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}",
"httpMethod": "DELETE",
- "id": "compute.targetInstances.delete",
+ "id": "compute.targetHttpsProxies.delete",
"parameterOrder": [
"project",
- "zone",
- "targetInstance"
+ "targetHttpsProxy"
],
"parameters": {
"project": {
@@ -32144,22 +33690,15 @@
"location": "query",
"type": "string"
},
- "targetInstance": {
- "description": "Name of the TargetInstance resource to delete.",
+ "targetHttpsProxy": {
+ "description": "Name of the TargetHttpsProxy resource to delete.",
"location": "path",
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
"required": true,
"type": "string"
- },
- "zone": {
- "description": "Name of the zone scoping this request.",
- "location": "path",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- "required": true,
- "type": "string"
}
},
- "path": "projects/{project}/zones/{zone}/targetInstances/{targetInstance}",
+ "path": "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}",
"response": {
"$ref": "Operation"
},
@@ -32169,14 +33708,13 @@
]
},
"get": {
- "description": "Returns the specified TargetInstance resource.",
- "flatPath": "projects/{project}/zones/{zone}/targetInstances/{targetInstance}",
+ "description": "Returns the specified TargetHttpsProxy resource.",
+ "flatPath": "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}",
"httpMethod": "GET",
- "id": "compute.targetInstances.get",
+ "id": "compute.targetHttpsProxies.get",
"parameterOrder": [
"project",
- "zone",
- "targetInstance"
+ "targetHttpsProxy"
],
"parameters": {
"project": {
@@ -32186,24 +33724,17 @@
"required": true,
"type": "string"
},
- "targetInstance": {
- "description": "Name of the TargetInstance resource to return.",
+ "targetHttpsProxy": {
+ "description": "Name of the TargetHttpsProxy resource to return.",
"location": "path",
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
"required": true,
"type": "string"
- },
- "zone": {
- "description": "Name of the zone scoping this request.",
- "location": "path",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- "required": true,
- "type": "string"
}
},
- "path": "projects/{project}/zones/{zone}/targetInstances/{targetInstance}",
+ "path": "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}",
"response": {
- "$ref": "TargetInstance"
+ "$ref": "TargetHttpsProxy"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
@@ -32212,13 +33743,12 @@
]
},
"insert": {
- "description": "Creates a TargetInstance resource in the specified project and zone using the data included in the request.",
- "flatPath": "projects/{project}/zones/{zone}/targetInstances",
+ "description": "Creates a TargetHttpsProxy resource in the specified project using the data included in the request.",
+ "flatPath": "projects/{project}/global/targetHttpsProxies",
"httpMethod": "POST",
- "id": "compute.targetInstances.insert",
+ "id": "compute.targetHttpsProxies.insert",
"parameterOrder": [
- "project",
- "zone"
+ "project"
],
"parameters": {
"project": {
@@ -32232,18 +33762,11 @@
"description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
"location": "query",
"type": "string"
- },
- "zone": {
- "description": "Name of the zone scoping this request.",
- "location": "path",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- "required": true,
- "type": "string"
}
},
- "path": "projects/{project}/zones/{zone}/targetInstances",
+ "path": "projects/{project}/global/targetHttpsProxies",
"request": {
- "$ref": "TargetInstance"
+ "$ref": "TargetHttpsProxy"
},
"response": {
"$ref": "Operation"
@@ -32254,13 +33777,12 @@
]
},
"list": {
- "description": "Retrieves a list of TargetInstance resources available to the specified project and zone.",
- "flatPath": "projects/{project}/zones/{zone}/targetInstances",
+ "description": "Retrieves the list of TargetHttpsProxy resources available to the specified project.",
+ "flatPath": "projects/{project}/global/targetHttpsProxies",
"httpMethod": "GET",
- "id": "compute.targetInstances.list",
+ "id": "compute.targetHttpsProxies.list",
"parameterOrder": [
- "project",
- "zone"
+ "project"
],
"parameters": {
"filter": {
@@ -32294,21 +33816,14 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
- },
- "zone": {
- "description": "Name of the zone scoping this request.",
- "location": "path",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- "required": true,
- "type": "string"
}
},
- "path": "projects/{project}/zones/{zone}/targetInstances",
+ "path": "projects/{project}/global/targetHttpsProxies",
"response": {
- "$ref": "TargetInstanceList"
+ "$ref": "TargetHttpsProxyList"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
@@ -32316,15 +33831,14 @@
"https://www.googleapis.com/auth/compute.readonly"
]
},
- "setSecurityPolicy": {
- "description": "Sets the Google Cloud Armor security policy for the specified target instance. For more information, see Google Cloud Armor Overview",
- "flatPath": "projects/{project}/zones/{zone}/targetInstances/{targetInstance}/setSecurityPolicy",
- "httpMethod": "POST",
- "id": "compute.targetInstances.setSecurityPolicy",
+ "patch": {
+ "description": "Patches the specified TargetHttpsProxy resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules.",
+ "flatPath": "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}",
+ "httpMethod": "PATCH",
+ "id": "compute.targetHttpsProxies.patch",
"parameterOrder": [
"project",
- "zone",
- "targetInstance"
+ "targetHttpsProxy"
],
"parameters": {
"project": {
@@ -32339,23 +33853,17 @@
"location": "query",
"type": "string"
},
- "targetInstance": {
- "description": "Name of the TargetInstance resource to which the security policy should be set. The name should conform to RFC1035.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "zone": {
- "description": "Name of the zone scoping this request.",
+ "targetHttpsProxy": {
+ "description": "Name of the TargetHttpsProxy resource to patch.",
"location": "path",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
"required": true,
"type": "string"
}
},
- "path": "projects/{project}/zones/{zone}/targetInstances/{targetInstance}/setSecurityPolicy",
+ "path": "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}",
"request": {
- "$ref": "SecurityPolicyReference"
+ "$ref": "TargetHttpsProxy"
},
"response": {
"$ref": "Operation"
@@ -32364,20 +33872,15 @@
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/compute"
]
- }
- }
- },
- "targetPools": {
- "methods": {
- "addHealthCheck": {
- "description": "Adds health check URLs to a target pool.",
- "flatPath": "projects/{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck",
+ },
+ "setCertificateMap": {
+ "description": "Changes the Certificate Map for TargetHttpsProxy.",
+ "flatPath": "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}/setCertificateMap",
"httpMethod": "POST",
- "id": "compute.targetPools.addHealthCheck",
+ "id": "compute.targetHttpsProxies.setCertificateMap",
"parameterOrder": [
"project",
- "region",
- "targetPool"
+ "targetHttpsProxy"
],
"parameters": {
"project": {
@@ -32387,29 +33890,21 @@
"required": true,
"type": "string"
},
- "region": {
- "description": "Name of the region scoping this request.",
- "location": "path",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- "required": true,
- "type": "string"
- },
"requestId": {
"description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
"location": "query",
"type": "string"
},
- "targetPool": {
- "description": "Name of the target pool to add a health check to.",
+ "targetHttpsProxy": {
+ "description": "Name of the TargetHttpsProxy resource whose CertificateMap is to be set. The name must be 1-63 characters long, and comply with RFC1035.",
"location": "path",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
"required": true,
"type": "string"
}
},
- "path": "projects/{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck",
+ "path": "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}/setCertificateMap",
"request": {
- "$ref": "TargetPoolsAddHealthCheckRequest"
+ "$ref": "TargetHttpsProxiesSetCertificateMapRequest"
},
"response": {
"$ref": "Operation"
@@ -32419,15 +33914,14 @@
"https://www.googleapis.com/auth/compute"
]
},
- "addInstance": {
- "description": "Adds an instance to a target pool.",
- "flatPath": "projects/{project}/regions/{region}/targetPools/{targetPool}/addInstance",
+ "setQuicOverride": {
+ "description": "Sets the QUIC override policy for TargetHttpsProxy.",
+ "flatPath": "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}/setQuicOverride",
"httpMethod": "POST",
- "id": "compute.targetPools.addInstance",
+ "id": "compute.targetHttpsProxies.setQuicOverride",
"parameterOrder": [
"project",
- "region",
- "targetPool"
+ "targetHttpsProxy"
],
"parameters": {
"project": {
@@ -32437,29 +33931,21 @@
"required": true,
"type": "string"
},
- "region": {
- "description": "Name of the region scoping this request.",
- "location": "path",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- "required": true,
- "type": "string"
- },
"requestId": {
"description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
"location": "query",
"type": "string"
},
- "targetPool": {
- "description": "Name of the TargetPool resource to add instances to.",
+ "targetHttpsProxy": {
+ "description": "Name of the TargetHttpsProxy resource to set the QUIC override policy for. The name should conform to RFC1035.",
"location": "path",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
"required": true,
"type": "string"
}
},
- "path": "projects/{project}/regions/{region}/targetPools/{targetPool}/addInstance",
+ "path": "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}/setQuicOverride",
"request": {
- "$ref": "TargetPoolsAddInstanceRequest"
+ "$ref": "TargetHttpsProxiesSetQuicOverrideRequest"
},
"response": {
"$ref": "Operation"
@@ -32469,43 +33955,16 @@
"https://www.googleapis.com/auth/compute"
]
},
- "aggregatedList": {
- "description": "Retrieves an aggregated list of target pools.",
- "flatPath": "projects/{project}/aggregated/targetPools",
- "httpMethod": "GET",
- "id": "compute.targetPools.aggregatedList",
+ "setSslCertificates": {
+ "description": "Replaces SslCertificates for TargetHttpsProxy.",
+ "flatPath": "projects/{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates",
+ "httpMethod": "POST",
+ "id": "compute.targetHttpsProxies.setSslCertificates",
"parameterOrder": [
- "project"
+ "project",
+ "targetHttpsProxy"
],
"parameters": {
- "filter": {
- "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- "location": "query",
- "type": "string"
- },
- "includeAllScopes": {
- "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- "location": "query",
- "type": "boolean"
- },
- "maxResults": {
- "default": "500",
- "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- "format": "uint32",
- "location": "query",
- "minimum": "0",
- "type": "integer"
- },
- "orderBy": {
- "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- "location": "query",
- "type": "string"
- },
- "pageToken": {
- "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- "location": "query",
- "type": "string"
- },
"project": {
"description": "Project ID for this request.",
"location": "path",
@@ -32513,36 +33972,39 @@
"required": true,
"type": "string"
},
- "returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "requestId": {
+ "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
"location": "query",
- "type": "boolean"
+ "type": "string"
},
- "serviceProjectNumber": {
- "format": "int64",
- "location": "query",
+ "targetHttpsProxy": {
+ "description": "Name of the TargetHttpsProxy resource to set an SslCertificates resource for.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
+ "required": true,
"type": "string"
}
},
- "path": "projects/{project}/aggregated/targetPools",
+ "path": "projects/{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates",
+ "request": {
+ "$ref": "TargetHttpsProxiesSetSslCertificatesRequest"
+ },
"response": {
- "$ref": "TargetPoolAggregatedList"
+ "$ref": "Operation"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/compute",
- "https://www.googleapis.com/auth/compute.readonly"
+ "https://www.googleapis.com/auth/compute"
]
},
- "delete": {
- "description": "Deletes the specified target pool.",
- "flatPath": "projects/{project}/regions/{region}/targetPools/{targetPool}",
- "httpMethod": "DELETE",
- "id": "compute.targetPools.delete",
+ "setSslPolicy": {
+ "description": "Sets the SSL policy for TargetHttpsProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the HTTPS proxy load balancer. They do not affect the connection between the load balancer and the backends.",
+ "flatPath": "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}/setSslPolicy",
+ "httpMethod": "POST",
+ "id": "compute.targetHttpsProxies.setSslPolicy",
"parameterOrder": [
"project",
- "region",
- "targetPool"
+ "targetHttpsProxy"
],
"parameters": {
"project": {
@@ -32552,44 +34014,38 @@
"required": true,
"type": "string"
},
- "region": {
- "description": "Name of the region scoping this request.",
- "location": "path",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- "required": true,
- "type": "string"
- },
"requestId": {
"description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
"location": "query",
"type": "string"
},
- "targetPool": {
- "description": "Name of the TargetPool resource to delete.",
+ "targetHttpsProxy": {
+ "description": "Name of the TargetHttpsProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035.",
"location": "path",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
"required": true,
"type": "string"
}
},
- "path": "projects/{project}/regions/{region}/targetPools/{targetPool}",
- "response": {
- "$ref": "Operation"
+ "path": "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}/setSslPolicy",
+ "request": {
+ "$ref": "SslPolicyReference"
+ },
+ "response": {
+ "$ref": "Operation"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/compute"
]
},
- "get": {
- "description": "Returns the specified target pool.",
- "flatPath": "projects/{project}/regions/{region}/targetPools/{targetPool}",
- "httpMethod": "GET",
- "id": "compute.targetPools.get",
+ "setUrlMap": {
+ "description": "Changes the URL map for TargetHttpsProxy.",
+ "flatPath": "projects/{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap",
+ "httpMethod": "POST",
+ "id": "compute.targetHttpsProxies.setUrlMap",
"parameterOrder": [
"project",
- "region",
- "targetPool"
+ "targetHttpsProxy"
],
"parameters": {
"project": {
@@ -32599,24 +34055,94 @@
"required": true,
"type": "string"
},
- "region": {
- "description": "Name of the region scoping this request.",
+ "requestId": {
+ "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
+ "location": "query",
+ "type": "string"
+ },
+ "targetHttpsProxy": {
+ "description": "Name of the TargetHttpsProxy resource whose URL map is to be set.",
"location": "path",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
"required": true,
"type": "string"
+ }
+ },
+ "path": "projects/{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap",
+ "request": {
+ "$ref": "UrlMapReference"
+ },
+ "response": {
+ "$ref": "Operation"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute"
+ ]
+ }
+ }
+ },
+ "targetInstances": {
+ "methods": {
+ "aggregatedList": {
+ "description": "Retrieves an aggregated list of target instances. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
+ "flatPath": "projects/{project}/aggregated/targetInstances",
+ "httpMethod": "GET",
+ "id": "compute.targetInstances.aggregatedList",
+ "parameterOrder": [
+ "project"
+ ],
+ "parameters": {
+ "filter": {
+ "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
+ "location": "query",
+ "type": "string"
},
- "targetPool": {
- "description": "Name of the TargetPool resource to return.",
+ "includeAllScopes": {
+ "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
+ "location": "query",
+ "type": "boolean"
+ },
+ "maxResults": {
+ "default": "500",
+ "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
+ "format": "uint32",
+ "location": "query",
+ "minimum": "0",
+ "type": "integer"
+ },
+ "orderBy": {
+ "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
+ "location": "query",
+ "type": "string"
+ },
+ "pageToken": {
+ "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
+ "location": "query",
+ "type": "string"
+ },
+ "project": {
+ "description": "Project ID for this request.",
"location": "path",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
"required": true,
"type": "string"
+ },
+ "returnPartialSuccess": {
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
+ "location": "query",
+ "type": "boolean"
+ },
+ "serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
+ "format": "int64",
+ "location": "query",
+ "type": "string"
}
},
- "path": "projects/{project}/regions/{region}/targetPools/{targetPool}",
+ "path": "projects/{project}/aggregated/targetInstances",
"response": {
- "$ref": "TargetPool"
+ "$ref": "TargetInstanceAggregatedList"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
@@ -32624,15 +34150,15 @@
"https://www.googleapis.com/auth/compute.readonly"
]
},
- "getHealth": {
- "description": "Gets the most recent health check results for each IP for the instance that is referenced by the given target pool.",
- "flatPath": "projects/{project}/regions/{region}/targetPools/{targetPool}/getHealth",
- "httpMethod": "POST",
- "id": "compute.targetPools.getHealth",
+ "delete": {
+ "description": "Deletes the specified TargetInstance resource.",
+ "flatPath": "projects/{project}/zones/{zone}/targetInstances/{targetInstance}",
+ "httpMethod": "DELETE",
+ "id": "compute.targetInstances.delete",
"parameterOrder": [
"project",
- "region",
- "targetPool"
+ "zone",
+ "targetInstance"
],
"parameters": {
"project": {
@@ -32642,27 +34168,71 @@
"required": true,
"type": "string"
},
- "region": {
- "description": "Name of the region scoping this request.",
+ "requestId": {
+ "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
+ "location": "query",
+ "type": "string"
+ },
+ "targetInstance": {
+ "description": "Name of the TargetInstance resource to delete.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
+ "required": true,
+ "type": "string"
+ },
+ "zone": {
+ "description": "Name of the zone scoping this request.",
"location": "path",
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
"required": true,
"type": "string"
+ }
+ },
+ "path": "projects/{project}/zones/{zone}/targetInstances/{targetInstance}",
+ "response": {
+ "$ref": "Operation"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute"
+ ]
+ },
+ "get": {
+ "description": "Returns the specified TargetInstance resource.",
+ "flatPath": "projects/{project}/zones/{zone}/targetInstances/{targetInstance}",
+ "httpMethod": "GET",
+ "id": "compute.targetInstances.get",
+ "parameterOrder": [
+ "project",
+ "zone",
+ "targetInstance"
+ ],
+ "parameters": {
+ "project": {
+ "description": "Project ID for this request.",
+ "location": "path",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "required": true,
+ "type": "string"
},
- "targetPool": {
- "description": "Name of the TargetPool resource to which the queried instance belongs.",
+ "targetInstance": {
+ "description": "Name of the TargetInstance resource to return.",
"location": "path",
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
"required": true,
"type": "string"
+ },
+ "zone": {
+ "description": "Name of the zone scoping this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "required": true,
+ "type": "string"
}
},
- "path": "projects/{project}/regions/{region}/targetPools/{targetPool}/getHealth",
- "request": {
- "$ref": "InstanceReference"
- },
+ "path": "projects/{project}/zones/{zone}/targetInstances/{targetInstance}",
"response": {
- "$ref": "TargetPoolInstanceHealth"
+ "$ref": "TargetInstance"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
@@ -32671,13 +34241,13 @@
]
},
"insert": {
- "description": "Creates a target pool in the specified project and region using the data included in the request.",
- "flatPath": "projects/{project}/regions/{region}/targetPools",
+ "description": "Creates a TargetInstance resource in the specified project and zone using the data included in the request.",
+ "flatPath": "projects/{project}/zones/{zone}/targetInstances",
"httpMethod": "POST",
- "id": "compute.targetPools.insert",
+ "id": "compute.targetInstances.insert",
"parameterOrder": [
"project",
- "region"
+ "zone"
],
"parameters": {
"project": {
@@ -32687,22 +34257,22 @@
"required": true,
"type": "string"
},
- "region": {
- "description": "Name of the region scoping this request.",
- "location": "path",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- "required": true,
- "type": "string"
- },
"requestId": {
"description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
"location": "query",
"type": "string"
+ },
+ "zone": {
+ "description": "Name of the zone scoping this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "required": true,
+ "type": "string"
}
},
- "path": "projects/{project}/regions/{region}/targetPools",
+ "path": "projects/{project}/zones/{zone}/targetInstances",
"request": {
- "$ref": "TargetPool"
+ "$ref": "TargetInstance"
},
"response": {
"$ref": "Operation"
@@ -32713,13 +34283,13 @@
]
},
"list": {
- "description": "Retrieves a list of target pools available to the specified project and region.",
- "flatPath": "projects/{project}/regions/{region}/targetPools",
+ "description": "Retrieves a list of TargetInstance resources available to the specified project and zone.",
+ "flatPath": "projects/{project}/zones/{zone}/targetInstances",
"httpMethod": "GET",
- "id": "compute.targetPools.list",
+ "id": "compute.targetInstances.list",
"parameterOrder": [
"project",
- "region"
+ "zone"
],
"parameters": {
"filter": {
@@ -32752,22 +34322,22 @@
"required": true,
"type": "string"
},
- "region": {
- "description": "Name of the region scoping this request.",
+ "returnPartialSuccess": {
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
+ "location": "query",
+ "type": "boolean"
+ },
+ "zone": {
+ "description": "Name of the zone scoping this request.",
"location": "path",
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
"required": true,
"type": "string"
- },
- "returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- "location": "query",
- "type": "boolean"
}
},
- "path": "projects/{project}/regions/{region}/targetPools",
+ "path": "projects/{project}/zones/{zone}/targetInstances",
"response": {
- "$ref": "TargetPoolList"
+ "$ref": "TargetInstanceList"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
@@ -32775,15 +34345,15 @@
"https://www.googleapis.com/auth/compute.readonly"
]
},
- "removeHealthCheck": {
- "description": "Removes health check URL from a target pool.",
- "flatPath": "projects/{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck",
+ "setSecurityPolicy": {
+ "description": "Sets the Google Cloud Armor security policy for the specified target instance. For more information, see Google Cloud Armor Overview",
+ "flatPath": "projects/{project}/zones/{zone}/targetInstances/{targetInstance}/setSecurityPolicy",
"httpMethod": "POST",
- "id": "compute.targetPools.removeHealthCheck",
+ "id": "compute.targetInstances.setSecurityPolicy",
"parameterOrder": [
"project",
- "region",
- "targetPool"
+ "zone",
+ "targetInstance"
],
"parameters": {
"project": {
@@ -32793,29 +34363,28 @@
"required": true,
"type": "string"
},
- "region": {
- "description": "Name of the region for this request.",
- "location": "path",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- "required": true,
- "type": "string"
- },
"requestId": {
"description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
"location": "query",
"type": "string"
},
- "targetPool": {
- "description": "Name of the target pool to remove health checks from.",
+ "targetInstance": {
+ "description": "Name of the TargetInstance resource to which the security policy should be set. The name should conform to RFC1035.",
"location": "path",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
+ "required": true,
+ "type": "string"
+ },
+ "zone": {
+ "description": "Name of the zone scoping this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
"required": true,
"type": "string"
}
},
- "path": "projects/{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck",
+ "path": "projects/{project}/zones/{zone}/targetInstances/{targetInstance}/setSecurityPolicy",
"request": {
- "$ref": "TargetPoolsRemoveHealthCheckRequest"
+ "$ref": "SecurityPolicyReference"
},
"response": {
"$ref": "Operation"
@@ -32824,12 +34393,16 @@
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/compute"
]
- },
- "removeInstance": {
- "description": "Removes instance URL from a target pool.",
- "flatPath": "projects/{project}/regions/{region}/targetPools/{targetPool}/removeInstance",
+ }
+ }
+ },
+ "targetPools": {
+ "methods": {
+ "addHealthCheck": {
+ "description": "Adds health check URLs to a target pool.",
+ "flatPath": "projects/{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck",
"httpMethod": "POST",
- "id": "compute.targetPools.removeInstance",
+ "id": "compute.targetPools.addHealthCheck",
"parameterOrder": [
"project",
"region",
@@ -32856,16 +34429,16 @@
"type": "string"
},
"targetPool": {
- "description": "Name of the TargetPool resource to remove instances from.",
+ "description": "Name of the target pool to add a health check to.",
"location": "path",
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
"required": true,
"type": "string"
}
},
- "path": "projects/{project}/regions/{region}/targetPools/{targetPool}/removeInstance",
+ "path": "projects/{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck",
"request": {
- "$ref": "TargetPoolsRemoveInstanceRequest"
+ "$ref": "TargetPoolsAddHealthCheckRequest"
},
"response": {
"$ref": "Operation"
@@ -32875,23 +34448,17 @@
"https://www.googleapis.com/auth/compute"
]
},
- "setBackup": {
- "description": "Changes a backup target pool's configurations.",
- "flatPath": "projects/{project}/regions/{region}/targetPools/{targetPool}/setBackup",
+ "addInstance": {
+ "description": "Adds an instance to a target pool.",
+ "flatPath": "projects/{project}/regions/{region}/targetPools/{targetPool}/addInstance",
"httpMethod": "POST",
- "id": "compute.targetPools.setBackup",
+ "id": "compute.targetPools.addInstance",
"parameterOrder": [
"project",
"region",
"targetPool"
],
"parameters": {
- "failoverRatio": {
- "description": "New failoverRatio value for the target pool.",
- "format": "float",
- "location": "query",
- "type": "number"
- },
"project": {
"description": "Project ID for this request.",
"location": "path",
@@ -32912,16 +34479,16 @@
"type": "string"
},
"targetPool": {
- "description": "Name of the TargetPool resource to set a backup pool for.",
+ "description": "Name of the TargetPool resource to add instances to.",
"location": "path",
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
"required": true,
"type": "string"
}
},
- "path": "projects/{project}/regions/{region}/targetPools/{targetPool}/setBackup",
+ "path": "projects/{project}/regions/{region}/targetPools/{targetPool}/addInstance",
"request": {
- "$ref": "TargetReference"
+ "$ref": "TargetPoolsAddInstanceRequest"
},
"response": {
"$ref": "Operation"
@@ -32931,11 +34498,77 @@
"https://www.googleapis.com/auth/compute"
]
},
- "setSecurityPolicy": {
- "description": "Sets the Google Cloud Armor security policy for the specified target pool. For more information, see Google Cloud Armor Overview",
- "flatPath": "projects/{project}/regions/{region}/targetPools/{targetPool}/setSecurityPolicy",
- "httpMethod": "POST",
- "id": "compute.targetPools.setSecurityPolicy",
+ "aggregatedList": {
+ "description": "Retrieves an aggregated list of target pools. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
+ "flatPath": "projects/{project}/aggregated/targetPools",
+ "httpMethod": "GET",
+ "id": "compute.targetPools.aggregatedList",
+ "parameterOrder": [
+ "project"
+ ],
+ "parameters": {
+ "filter": {
+ "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
+ "location": "query",
+ "type": "string"
+ },
+ "includeAllScopes": {
+ "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
+ "location": "query",
+ "type": "boolean"
+ },
+ "maxResults": {
+ "default": "500",
+ "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
+ "format": "uint32",
+ "location": "query",
+ "minimum": "0",
+ "type": "integer"
+ },
+ "orderBy": {
+ "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
+ "location": "query",
+ "type": "string"
+ },
+ "pageToken": {
+ "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
+ "location": "query",
+ "type": "string"
+ },
+ "project": {
+ "description": "Project ID for this request.",
+ "location": "path",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "required": true,
+ "type": "string"
+ },
+ "returnPartialSuccess": {
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
+ "location": "query",
+ "type": "boolean"
+ },
+ "serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
+ "format": "int64",
+ "location": "query",
+ "type": "string"
+ }
+ },
+ "path": "projects/{project}/aggregated/targetPools",
+ "response": {
+ "$ref": "TargetPoolAggregatedList"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute",
+ "https://www.googleapis.com/auth/compute.readonly"
+ ]
+ },
+ "delete": {
+ "description": "Deletes the specified target pool.",
+ "flatPath": "projects/{project}/regions/{region}/targetPools/{targetPool}",
+ "httpMethod": "DELETE",
+ "id": "compute.targetPools.delete",
"parameterOrder": [
"project",
"region",
@@ -32962,16 +34595,14 @@
"type": "string"
},
"targetPool": {
- "description": "Name of the TargetPool resource to which the security policy should be set. The name should conform to RFC1035.",
+ "description": "Name of the TargetPool resource to delete.",
"location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
"required": true,
"type": "string"
}
},
- "path": "projects/{project}/regions/{region}/targetPools/{targetPool}/setSecurityPolicy",
- "request": {
- "$ref": "SecurityPolicyReference"
- },
+ "path": "projects/{project}/regions/{region}/targetPools/{targetPool}",
"response": {
"$ref": "Operation"
},
@@ -32979,19 +34610,16 @@
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/compute"
]
- }
- }
- },
- "targetSslProxies": {
- "methods": {
- "delete": {
- "description": "Deletes the specified TargetSslProxy resource.",
- "flatPath": "projects/{project}/global/targetSslProxies/{targetSslProxy}",
- "httpMethod": "DELETE",
- "id": "compute.targetSslProxies.delete",
+ },
+ "get": {
+ "description": "Returns the specified target pool.",
+ "flatPath": "projects/{project}/regions/{region}/targetPools/{targetPool}",
+ "httpMethod": "GET",
+ "id": "compute.targetPools.get",
"parameterOrder": [
"project",
- "targetSslProxy"
+ "region",
+ "targetPool"
],
"parameters": {
"project": {
@@ -33001,36 +34629,40 @@
"required": true,
"type": "string"
},
- "requestId": {
- "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- "location": "query",
+ "region": {
+ "description": "Name of the region scoping this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "required": true,
"type": "string"
},
- "targetSslProxy": {
- "description": "Name of the TargetSslProxy resource to delete.",
+ "targetPool": {
+ "description": "Name of the TargetPool resource to return.",
"location": "path",
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
"required": true,
"type": "string"
}
},
- "path": "projects/{project}/global/targetSslProxies/{targetSslProxy}",
+ "path": "projects/{project}/regions/{region}/targetPools/{targetPool}",
"response": {
- "$ref": "Operation"
+ "$ref": "TargetPool"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/compute"
+ "https://www.googleapis.com/auth/compute",
+ "https://www.googleapis.com/auth/compute.readonly"
]
},
- "get": {
- "description": "Returns the specified TargetSslProxy resource.",
- "flatPath": "projects/{project}/global/targetSslProxies/{targetSslProxy}",
- "httpMethod": "GET",
- "id": "compute.targetSslProxies.get",
+ "getHealth": {
+ "description": "Gets the most recent health check results for each IP for the instance that is referenced by the given target pool.",
+ "flatPath": "projects/{project}/regions/{region}/targetPools/{targetPool}/getHealth",
+ "httpMethod": "POST",
+ "id": "compute.targetPools.getHealth",
"parameterOrder": [
"project",
- "targetSslProxy"
+ "region",
+ "targetPool"
],
"parameters": {
"project": {
@@ -33040,17 +34672,27 @@
"required": true,
"type": "string"
},
- "targetSslProxy": {
- "description": "Name of the TargetSslProxy resource to return.",
+ "region": {
+ "description": "Name of the region scoping this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "required": true,
+ "type": "string"
+ },
+ "targetPool": {
+ "description": "Name of the TargetPool resource to which the queried instance belongs.",
"location": "path",
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
"required": true,
"type": "string"
}
},
- "path": "projects/{project}/global/targetSslProxies/{targetSslProxy}",
+ "path": "projects/{project}/regions/{region}/targetPools/{targetPool}/getHealth",
+ "request": {
+ "$ref": "InstanceReference"
+ },
"response": {
- "$ref": "TargetSslProxy"
+ "$ref": "TargetPoolInstanceHealth"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
@@ -33059,12 +34701,13 @@
]
},
"insert": {
- "description": "Creates a TargetSslProxy resource in the specified project using the data included in the request.",
- "flatPath": "projects/{project}/global/targetSslProxies",
+ "description": "Creates a target pool in the specified project and region using the data included in the request.",
+ "flatPath": "projects/{project}/regions/{region}/targetPools",
"httpMethod": "POST",
- "id": "compute.targetSslProxies.insert",
+ "id": "compute.targetPools.insert",
"parameterOrder": [
- "project"
+ "project",
+ "region"
],
"parameters": {
"project": {
@@ -33074,15 +34717,22 @@
"required": true,
"type": "string"
},
+ "region": {
+ "description": "Name of the region scoping this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "required": true,
+ "type": "string"
+ },
"requestId": {
"description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
"location": "query",
"type": "string"
}
},
- "path": "projects/{project}/global/targetSslProxies",
+ "path": "projects/{project}/regions/{region}/targetPools",
"request": {
- "$ref": "TargetSslProxy"
+ "$ref": "TargetPool"
},
"response": {
"$ref": "Operation"
@@ -33093,12 +34743,13 @@
]
},
"list": {
- "description": "Retrieves the list of TargetSslProxy resources available to the specified project.",
- "flatPath": "projects/{project}/global/targetSslProxies",
+ "description": "Retrieves a list of target pools available to the specified project and region.",
+ "flatPath": "projects/{project}/regions/{region}/targetPools",
"httpMethod": "GET",
- "id": "compute.targetSslProxies.list",
+ "id": "compute.targetPools.list",
"parameterOrder": [
- "project"
+ "project",
+ "region"
],
"parameters": {
"filter": {
@@ -33131,15 +34782,22 @@
"required": true,
"type": "string"
},
+ "region": {
+ "description": "Name of the region scoping this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "required": true,
+ "type": "string"
+ },
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
},
- "path": "projects/{project}/global/targetSslProxies",
+ "path": "projects/{project}/regions/{region}/targetPools",
"response": {
- "$ref": "TargetSslProxyList"
+ "$ref": "TargetPoolList"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
@@ -33147,14 +34805,15 @@
"https://www.googleapis.com/auth/compute.readonly"
]
},
- "setBackendService": {
- "description": "Changes the BackendService for TargetSslProxy.",
- "flatPath": "projects/{project}/global/targetSslProxies/{targetSslProxy}/setBackendService",
+ "removeHealthCheck": {
+ "description": "Removes health check URL from a target pool.",
+ "flatPath": "projects/{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck",
"httpMethod": "POST",
- "id": "compute.targetSslProxies.setBackendService",
+ "id": "compute.targetPools.removeHealthCheck",
"parameterOrder": [
"project",
- "targetSslProxy"
+ "region",
+ "targetPool"
],
"parameters": {
"project": {
@@ -33164,12 +34823,383 @@
"required": true,
"type": "string"
},
+ "region": {
+ "description": "Name of the region for this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "required": true,
+ "type": "string"
+ },
"requestId": {
"description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
"location": "query",
"type": "string"
},
- "targetSslProxy": {
+ "targetPool": {
+ "description": "Name of the target pool to remove health checks from.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
+ "required": true,
+ "type": "string"
+ }
+ },
+ "path": "projects/{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck",
+ "request": {
+ "$ref": "TargetPoolsRemoveHealthCheckRequest"
+ },
+ "response": {
+ "$ref": "Operation"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute"
+ ]
+ },
+ "removeInstance": {
+ "description": "Removes instance URL from a target pool.",
+ "flatPath": "projects/{project}/regions/{region}/targetPools/{targetPool}/removeInstance",
+ "httpMethod": "POST",
+ "id": "compute.targetPools.removeInstance",
+ "parameterOrder": [
+ "project",
+ "region",
+ "targetPool"
+ ],
+ "parameters": {
+ "project": {
+ "description": "Project ID for this request.",
+ "location": "path",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "required": true,
+ "type": "string"
+ },
+ "region": {
+ "description": "Name of the region scoping this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "required": true,
+ "type": "string"
+ },
+ "requestId": {
+ "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
+ "location": "query",
+ "type": "string"
+ },
+ "targetPool": {
+ "description": "Name of the TargetPool resource to remove instances from.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
+ "required": true,
+ "type": "string"
+ }
+ },
+ "path": "projects/{project}/regions/{region}/targetPools/{targetPool}/removeInstance",
+ "request": {
+ "$ref": "TargetPoolsRemoveInstanceRequest"
+ },
+ "response": {
+ "$ref": "Operation"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute"
+ ]
+ },
+ "setBackup": {
+ "description": "Changes a backup target pool's configurations.",
+ "flatPath": "projects/{project}/regions/{region}/targetPools/{targetPool}/setBackup",
+ "httpMethod": "POST",
+ "id": "compute.targetPools.setBackup",
+ "parameterOrder": [
+ "project",
+ "region",
+ "targetPool"
+ ],
+ "parameters": {
+ "failoverRatio": {
+ "description": "New failoverRatio value for the target pool.",
+ "format": "float",
+ "location": "query",
+ "type": "number"
+ },
+ "project": {
+ "description": "Project ID for this request.",
+ "location": "path",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "required": true,
+ "type": "string"
+ },
+ "region": {
+ "description": "Name of the region scoping this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "required": true,
+ "type": "string"
+ },
+ "requestId": {
+ "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
+ "location": "query",
+ "type": "string"
+ },
+ "targetPool": {
+ "description": "Name of the TargetPool resource to set a backup pool for.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
+ "required": true,
+ "type": "string"
+ }
+ },
+ "path": "projects/{project}/regions/{region}/targetPools/{targetPool}/setBackup",
+ "request": {
+ "$ref": "TargetReference"
+ },
+ "response": {
+ "$ref": "Operation"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute"
+ ]
+ },
+ "setSecurityPolicy": {
+ "description": "Sets the Google Cloud Armor security policy for the specified target pool. For more information, see Google Cloud Armor Overview",
+ "flatPath": "projects/{project}/regions/{region}/targetPools/{targetPool}/setSecurityPolicy",
+ "httpMethod": "POST",
+ "id": "compute.targetPools.setSecurityPolicy",
+ "parameterOrder": [
+ "project",
+ "region",
+ "targetPool"
+ ],
+ "parameters": {
+ "project": {
+ "description": "Project ID for this request.",
+ "location": "path",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "required": true,
+ "type": "string"
+ },
+ "region": {
+ "description": "Name of the region scoping this request.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "required": true,
+ "type": "string"
+ },
+ "requestId": {
+ "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
+ "location": "query",
+ "type": "string"
+ },
+ "targetPool": {
+ "description": "Name of the TargetPool resource to which the security policy should be set. The name should conform to RFC1035.",
+ "location": "path",
+ "required": true,
+ "type": "string"
+ }
+ },
+ "path": "projects/{project}/regions/{region}/targetPools/{targetPool}/setSecurityPolicy",
+ "request": {
+ "$ref": "SecurityPolicyReference"
+ },
+ "response": {
+ "$ref": "Operation"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute"
+ ]
+ }
+ }
+ },
+ "targetSslProxies": {
+ "methods": {
+ "delete": {
+ "description": "Deletes the specified TargetSslProxy resource.",
+ "flatPath": "projects/{project}/global/targetSslProxies/{targetSslProxy}",
+ "httpMethod": "DELETE",
+ "id": "compute.targetSslProxies.delete",
+ "parameterOrder": [
+ "project",
+ "targetSslProxy"
+ ],
+ "parameters": {
+ "project": {
+ "description": "Project ID for this request.",
+ "location": "path",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "required": true,
+ "type": "string"
+ },
+ "requestId": {
+ "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
+ "location": "query",
+ "type": "string"
+ },
+ "targetSslProxy": {
+ "description": "Name of the TargetSslProxy resource to delete.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
+ "required": true,
+ "type": "string"
+ }
+ },
+ "path": "projects/{project}/global/targetSslProxies/{targetSslProxy}",
+ "response": {
+ "$ref": "Operation"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute"
+ ]
+ },
+ "get": {
+ "description": "Returns the specified TargetSslProxy resource.",
+ "flatPath": "projects/{project}/global/targetSslProxies/{targetSslProxy}",
+ "httpMethod": "GET",
+ "id": "compute.targetSslProxies.get",
+ "parameterOrder": [
+ "project",
+ "targetSslProxy"
+ ],
+ "parameters": {
+ "project": {
+ "description": "Project ID for this request.",
+ "location": "path",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "required": true,
+ "type": "string"
+ },
+ "targetSslProxy": {
+ "description": "Name of the TargetSslProxy resource to return.",
+ "location": "path",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
+ "required": true,
+ "type": "string"
+ }
+ },
+ "path": "projects/{project}/global/targetSslProxies/{targetSslProxy}",
+ "response": {
+ "$ref": "TargetSslProxy"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute",
+ "https://www.googleapis.com/auth/compute.readonly"
+ ]
+ },
+ "insert": {
+ "description": "Creates a TargetSslProxy resource in the specified project using the data included in the request.",
+ "flatPath": "projects/{project}/global/targetSslProxies",
+ "httpMethod": "POST",
+ "id": "compute.targetSslProxies.insert",
+ "parameterOrder": [
+ "project"
+ ],
+ "parameters": {
+ "project": {
+ "description": "Project ID for this request.",
+ "location": "path",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "required": true,
+ "type": "string"
+ },
+ "requestId": {
+ "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
+ "location": "query",
+ "type": "string"
+ }
+ },
+ "path": "projects/{project}/global/targetSslProxies",
+ "request": {
+ "$ref": "TargetSslProxy"
+ },
+ "response": {
+ "$ref": "Operation"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute"
+ ]
+ },
+ "list": {
+ "description": "Retrieves the list of TargetSslProxy resources available to the specified project.",
+ "flatPath": "projects/{project}/global/targetSslProxies",
+ "httpMethod": "GET",
+ "id": "compute.targetSslProxies.list",
+ "parameterOrder": [
+ "project"
+ ],
+ "parameters": {
+ "filter": {
+ "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
+ "location": "query",
+ "type": "string"
+ },
+ "maxResults": {
+ "default": "500",
+ "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
+ "format": "uint32",
+ "location": "query",
+ "minimum": "0",
+ "type": "integer"
+ },
+ "orderBy": {
+ "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
+ "location": "query",
+ "type": "string"
+ },
+ "pageToken": {
+ "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
+ "location": "query",
+ "type": "string"
+ },
+ "project": {
+ "description": "Project ID for this request.",
+ "location": "path",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "required": true,
+ "type": "string"
+ },
+ "returnPartialSuccess": {
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
+ "location": "query",
+ "type": "boolean"
+ }
+ },
+ "path": "projects/{project}/global/targetSslProxies",
+ "response": {
+ "$ref": "TargetSslProxyList"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/compute",
+ "https://www.googleapis.com/auth/compute.readonly"
+ ]
+ },
+ "setBackendService": {
+ "description": "Changes the BackendService for TargetSslProxy.",
+ "flatPath": "projects/{project}/global/targetSslProxies/{targetSslProxy}/setBackendService",
+ "httpMethod": "POST",
+ "id": "compute.targetSslProxies.setBackendService",
+ "parameterOrder": [
+ "project",
+ "targetSslProxy"
+ ],
+ "parameters": {
+ "project": {
+ "description": "Project ID for this request.",
+ "location": "path",
+ "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
+ "required": true,
+ "type": "string"
+ },
+ "requestId": {
+ "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
+ "location": "query",
+ "type": "string"
+ },
+ "targetSslProxy": {
"description": "Name of the TargetSslProxy resource whose BackendService resource is to be set.",
"location": "path",
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
@@ -33360,7 +35390,7 @@
"targetTcpProxies": {
"methods": {
"aggregatedList": {
- "description": "Retrieves the list of all TargetTcpProxy resources, regional and global, available to the specified project.",
+ "description": "Retrieves the list of all TargetTcpProxy resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
"flatPath": "projects/{project}/aggregated/targetTcpProxies",
"httpMethod": "GET",
"id": "compute.targetTcpProxies.aggregatedList",
@@ -33404,11 +35434,12 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
"serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
"format": "int64",
"location": "query",
"type": "string"
@@ -33572,7 +35603,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -33676,7 +35707,7 @@
"targetVpnGateways": {
"methods": {
"aggregatedList": {
- "description": "Retrieves an aggregated list of target VPN gateways.",
+ "description": "Retrieves an aggregated list of target VPN gateways. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
"flatPath": "projects/{project}/aggregated/targetVpnGateways",
"httpMethod": "GET",
"id": "compute.targetVpnGateways.aggregatedList",
@@ -33720,11 +35751,12 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
"serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
"format": "int64",
"location": "query",
"type": "string"
@@ -33920,7 +35952,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -33990,7 +36022,7 @@
"urlMaps": {
"methods": {
"aggregatedList": {
- "description": "Retrieves the list of all UrlMap resources, regional and global, available to the specified project.",
+ "description": "Retrieves the list of all UrlMap resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
"flatPath": "projects/{project}/aggregated/urlMaps",
"httpMethod": "GET",
"id": "compute.urlMaps.aggregatedList",
@@ -34034,11 +36066,12 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
"serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
"format": "int64",
"location": "query",
"type": "string"
@@ -34244,7 +36277,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -34385,7 +36418,7 @@
"vpnGateways": {
"methods": {
"aggregatedList": {
- "description": "Retrieves an aggregated list of VPN gateways.",
+ "description": "Retrieves an aggregated list of VPN gateways. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
"flatPath": "projects/{project}/aggregated/vpnGateways",
"httpMethod": "GET",
"id": "compute.vpnGateways.aggregatedList",
@@ -34429,11 +36462,12 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
"serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
"format": "int64",
"location": "query",
"type": "string"
@@ -34672,7 +36706,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -34788,7 +36822,7 @@
"vpnTunnels": {
"methods": {
"aggregatedList": {
- "description": "Retrieves an aggregated list of VPN tunnels.",
+ "description": "Retrieves an aggregated list of VPN tunnels. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.",
"flatPath": "projects/{project}/aggregated/vpnTunnels",
"httpMethod": "GET",
"id": "compute.vpnTunnels.aggregatedList",
@@ -34832,11 +36866,12 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
"serviceProjectNumber": {
+ "description": "The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api.",
"format": "int64",
"location": "query",
"type": "string"
@@ -35032,7 +37067,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -35113,7 +37148,7 @@
],
"parameters": {
"operation": {
- "description": "Name of the Operations resource to delete.",
+ "description": "Name of the Operations resource to delete, or its unique numeric identifier.",
"location": "path",
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
"required": true,
@@ -35152,7 +37187,7 @@
],
"parameters": {
"operation": {
- "description": "Name of the Operations resource to return.",
+ "description": "Name of the Operations resource to return, or its unique numeric identifier.",
"location": "path",
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
"required": true,
@@ -35224,7 +37259,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
},
@@ -35258,7 +37293,7 @@
],
"parameters": {
"operation": {
- "description": "Name of the Operations resource to return.",
+ "description": "Name of the Operations resource to return, or its unique numeric identifier.",
"location": "path",
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
"required": true,
@@ -35368,7 +37403,7 @@
"type": "string"
},
"returnPartialSuccess": {
- "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
+ "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.",
"location": "query",
"type": "boolean"
}
@@ -35386,7 +37421,7 @@
}
}
},
- "revision": "20240109",
+ "revision": "20241105",
"rootUrl": "https://compute.googleapis.com/",
"schemas": {
"AWSV4Signature": {
@@ -35963,7 +37998,7 @@
"type": "string"
},
"publicPtrDomainName": {
- "description": "The DNS domain name for the public PTR record. You can set this field only if the `setPublicPtr` field is enabled in accessConfig. If this field is unspecified in ipv6AccessConfig, a default PTR record will be createc for first IP in associated external IPv6 range.",
+ "description": "The DNS domain name for the public PTR record. You can set this field only if the `setPublicPtr` field is enabled in accessConfig. If this field is unspecified in ipv6AccessConfig, a default PTR record will be created for first IP in associated external IPv6 range.",
"type": "string"
},
"securityPolicy": {
@@ -36619,11 +38654,31 @@
"description": "Whether to enable UEFI networking for instance creation.",
"type": "boolean"
},
+ "performanceMonitoringUnit": {
+ "description": "Type of Performance Monitoring Unit requested on instance.",
+ "enum": [
+ "ARCHITECTURAL",
+ "ENHANCED",
+ "PERFORMANCE_MONITORING_UNIT_UNSPECIFIED",
+ "STANDARD"
+ ],
+ "enumDescriptions": [
+ "Architecturally defined non-LLC events.",
+ "Most documented core/L2 and LLC events.",
+ "",
+ "Most documented core/L2 events."
+ ],
+ "type": "string"
+ },
"threadsPerCore": {
"description": "The number of threads per physical core. To disable simultaneous multithreading (SMT) set this to 1. If unset, the maximum number of threads supported per core by the underlying processor is assumed.",
"format": "int32",
"type": "integer"
},
+ "turboMode": {
+ "description": "Turbo frequency mode to use for the instance. Supported modes include: * ALL_CORE_MAX Using empty string or not setting this field will use the platform-specific default turbo mode.",
+ "type": "string"
+ },
"visibleCoreCount": {
"description": "The number of physical cores to expose to an instance. Multiply by the number of threads per core to compute the total number of virtual CPUs to expose to the instance. If unset, the number of cores is inferred from the instance's nominal CPU count and the underlying platform's SMT width.",
"format": "int32",
@@ -36668,11 +38723,15 @@
"vmFamily": {
"description": "The VM family that all instances scheduled against this reservation must belong to.",
"enum": [
+ "VM_FAMILY_CLOUD_TPU_DEVICE_CT3",
"VM_FAMILY_CLOUD_TPU_LITE_DEVICE_CT5L",
"VM_FAMILY_CLOUD_TPU_LITE_POD_SLICE_CT5LP",
+ "VM_FAMILY_CLOUD_TPU_POD_SLICE_CT3P",
"VM_FAMILY_CLOUD_TPU_POD_SLICE_CT4P"
],
"enumDescriptions": [
+ "",
+ "",
"",
"",
""
@@ -36800,7 +38859,7 @@
"type": "object"
},
"AllocationSpecificSKUReservation": {
- "description": "This reservation type allows to pre allocate specific instance configuration. Next ID: 6",
+ "description": "This reservation type allows to pre allocate specific instance configuration.",
"id": "AllocationSpecificSKUReservation",
"properties": {
"assuredCount": {
@@ -36861,7 +38920,7 @@
},
"diskEncryptionKey": {
"$ref": "CustomerEncryptionKey",
- "description": "Encrypts or decrypts a disk using a customer-supplied encryption key. If you are creating a new disk, this field encrypts the new disk using an encryption key that you provide. If you are attaching an existing disk that is already encrypted, this field decrypts the disk using the customer-supplied encryption key. If you encrypt a disk using a customer-supplied key, you must provide the same key again when you attempt to use this resource at a later time. For example, you must provide the key when you create a snapshot or an image from the disk or when you attach the disk to a virtual machine instance. If you do not provide an encryption key, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later. Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group."
+ "description": "Encrypts or decrypts a disk using a customer-supplied encryption key. If you are creating a new disk, this field encrypts the new disk using an encryption key that you provide. If you are attaching an existing disk that is already encrypted, this field decrypts the disk using the customer-supplied encryption key. If you encrypt a disk using a customer-supplied key, you must provide the same key again when you attempt to use this resource at a later time. For example, you must provide the key when you create a snapshot or an image from the disk or when you attach the disk to a virtual machine instance. If you do not provide an encryption key, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later. Note: Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group. You cannot create VMs that have disks with customer-supplied keys using the bulk insert method."
},
"diskSizeGb": {
"description": "The size of the disk in GB.",
@@ -36941,7 +39000,7 @@
"description": "[Output Only] shielded vm initial state stored on disk"
},
"source": {
- "description": "Specifies a valid partial or full URL to an existing Persistent Disk resource. When creating a new instance, one of initializeParams.sourceImage or initializeParams.sourceSnapshot or disks.source is required except for local SSD. If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks. Note that for InstanceTemplate, specify the disk name for zonal disk, and the URL for regional disk.",
+ "description": "Specifies a valid partial or full URL to an existing Persistent Disk resource. When creating a new instance boot disk, one of initializeParams.sourceImage or initializeParams.sourceSnapshot or disks.source is required. If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks. Note that for InstanceTemplate, specify the disk name for zonal disk, and the URL for regional disk.",
"type": "string"
},
"type": {
@@ -37032,7 +39091,7 @@
"type": "string"
},
"provisionedThroughput": {
- "description": "Indicates how much throughput to provision for the disk. This sets the number of throughput mb per second that the disk can handle. Values must be between 1 and 7,124.",
+ "description": "Indicates how much throughput to provision for the disk. This sets the number of throughput mb per second that the disk can handle. Values must greater than or equal to 1.",
"format": "int64",
"type": "string"
},
@@ -37058,7 +39117,7 @@
"type": "array"
},
"sourceImage": {
- "description": "The source image to create this disk. When creating a new instance, one of initializeParams.sourceImage or initializeParams.sourceSnapshot or disks.source is required except for local SSD. To create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-9 to use the latest Debian 9 image: projects/debian-cloud/global/images/family/debian-9 Alternatively, use a specific version of a public operating system image: projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD To create a disk with a custom image that you created, specify the image name in the following format: global/images/my-custom-image You can also specify a custom image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name: global/images/family/my-image-family If the source image is deleted later, this field will not be set.",
+ "description": "The source image to create this disk. When creating a new instance boot disk, one of initializeParams.sourceImage or initializeParams.sourceSnapshot or disks.source is required. To create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-9 to use the latest Debian 9 image: projects/debian-cloud/global/images/family/debian-9 Alternatively, use a specific version of a public operating system image: projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD To create a disk with a custom image that you created, specify the image name in the following format: global/images/my-custom-image You can also specify a custom image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name: global/images/family/my-image-family If the source image is deleted later, this field will not be set.",
"type": "string"
},
"sourceImageEncryptionKey": {
@@ -37066,18 +39125,22 @@
"description": "The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key. InstanceTemplate and InstancePropertiesPatch do not store customer-supplied encryption keys, so you cannot create disks for instances in a managed instance group if the source images are encrypted with your own keys."
},
"sourceSnapshot": {
- "description": "The source snapshot to create this disk. When creating a new instance, one of initializeParams.sourceSnapshot or initializeParams.sourceImage or disks.source is required except for local SSD. To create a disk with a snapshot that you created, specify the snapshot name in the following format: global/snapshots/my-backup If the source snapshot is deleted later, this field will not be set.",
+ "description": "The source snapshot to create this disk. When creating a new instance boot disk, one of initializeParams.sourceSnapshot or initializeParams.sourceImage or disks.source is required. To create a disk with a snapshot that you created, specify the snapshot name in the following format: global/snapshots/my-backup If the source snapshot is deleted later, this field will not be set.",
"type": "string"
},
"sourceSnapshotEncryptionKey": {
"$ref": "CustomerEncryptionKey",
"description": "The customer-supplied encryption key of the source snapshot."
+ },
+ "storagePool": {
+ "description": "The storage pool in which the new disk is created. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /storagePools/storagePool - projects/project/zones/zone/storagePools/storagePool - zones/zone/storagePools/storagePool ",
+ "type": "string"
}
},
"type": "object"
},
"AuditConfig": {
- "description": "Specifies the audit configuration for a service. The configuration determines which permission types are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs. If there are AuditConfigs for both `allServices` and a specific service, the union of the two AuditConfigs is used for that service: the log_types specified in each AuditConfig are enabled, and the exempted_members in each AuditLogConfig are exempted. Example Policy with multiple AuditConfigs: { \"audit_configs\": [ { \"service\": \"allServices\", \"audit_log_configs\": [ { \"log_type\": \"DATA_READ\", \"exempted_members\": [ \"user:jose@example.com\" ] }, { \"log_type\": \"DATA_WRITE\" }, { \"log_type\": \"ADMIN_READ\" } ] }, { \"service\": \"sampleservice.googleapis.com\", \"audit_log_configs\": [ { \"log_type\": \"DATA_READ\" }, { \"log_type\": \"DATA_WRITE\", \"exempted_members\": [ \"user:aliya@example.com\" ] } ] } ] } For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts jose@example.com from DATA_READ logging, and aliya@example.com from DATA_WRITE logging.",
+ "description": "Specifies the audit configuration for a service. The configuration determines which permission types are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs. If there are AuditConfigs for both `allServices` and a specific service, the union of the two AuditConfigs is used for that service: the log_types specified in each AuditConfig are enabled, and the exempted_members in each AuditLogConfig are exempted. Example Policy with multiple AuditConfigs: { \"audit_configs\": [ { \"service\": \"allServices\", \"audit_log_configs\": [ { \"log_type\": \"DATA_READ\", \"exempted_members\": [ \"user:jose@example.com\" ] }, { \"log_type\": \"DATA_WRITE\" }, { \"log_type\": \"ADMIN_READ\" } ] }, { \"service\": \"sampleservice.googleapis.com\", \"audit_log_configs\": [ { \"log_type\": \"DATA_READ\" }, { \"log_type\": \"DATA_WRITE\", \"exempted_members\": [ \"user:aliya@example.com\" ] } ] } ] } For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts `jose@example.com` from DATA_READ logging, and `aliya@example.com` from DATA_WRITE logging.",
"id": "AuditConfig",
"properties": {
"auditLogConfigs": {
@@ -37087,13 +39150,6 @@
},
"type": "array"
},
- "exemptedMembers": {
- "description": "This is deprecated and has no effect. Do not use.",
- "items": {
- "type": "string"
- },
- "type": "array"
- },
"service": {
"description": "Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all services.",
"type": "string"
@@ -37112,10 +39168,6 @@
},
"type": "array"
},
- "ignoreChildExemptions": {
- "description": "This is deprecated and has no effect. Do not use.",
- "type": "boolean"
- },
"logType": {
"description": "The log type that this config enables.",
"enum": [
@@ -37135,31 +39187,6 @@
},
"type": "object"
},
- "AuthorizationLoggingOptions": {
- "description": "This is deprecated and has no effect. Do not use.",
- "id": "AuthorizationLoggingOptions",
- "properties": {
- "permissionType": {
- "description": "This is deprecated and has no effect. Do not use.",
- "enum": [
- "ADMIN_READ",
- "ADMIN_WRITE",
- "DATA_READ",
- "DATA_WRITE",
- "PERMISSION_TYPE_UNSPECIFIED"
- ],
- "enumDescriptions": [
- "This is deprecated and has no effect. Do not use.",
- "This is deprecated and has no effect. Do not use.",
- "This is deprecated and has no effect. Do not use.",
- "This is deprecated and has no effect. Do not use.",
- "This is deprecated and has no effect. Do not use."
- ],
- "type": "string"
- }
- },
- "type": "object"
- },
"Autoscaler": {
"description": "Represents an Autoscaler resource. Google Compute Engine has two Autoscaler resources: * [Zonal](/compute/docs/reference/rest/v1/autoscalers) * [Regional](/compute/docs/reference/rest/v1/regionAutoscalers) Use autoscalers to automatically add or delete instances from a managed instance group according to your defined autoscaling policy. For more information, read Autoscaling Groups of Instances. For zonal managed instance groups resource, use the autoscaler resource. For regional managed instance groups, use the regionAutoscalers resource.",
"id": "Autoscaler",
@@ -38009,6 +40036,20 @@
"description": "Optional parameter to define a target capacity for the UTILIZATION balancing mode. The valid range is [0.0, 1.0]. For usage guidelines, see Utilization balancing mode.",
"format": "float",
"type": "number"
+ },
+ "preference": {
+ "description": "This field indicates whether this backend should be fully utilized before sending traffic to backends with default preference. The possible values are: - PREFERRED: Backends with this preference level will be filled up to their capacity limits first, based on RTT. - DEFAULT: If preferred backends don't have enough capacity, backends in this layer would be used and traffic would be assigned based on the load balancing algorithm you use. This is the default ",
+ "enum": [
+ "DEFAULT",
+ "PREFERENCE_UNSPECIFIED",
+ "PREFERRED"
+ ],
+ "enumDescriptions": [
+ "No preference.",
+ "If preference is unspecified, we set it to the DEFAULT value",
+ "Traffic will be sent to this backend first."
+ ],
+ "type": "string"
}
},
"type": "object"
@@ -38078,6 +40119,13 @@
"selfLink": {
"description": "[Output Only] Server-defined URL for the resource.",
"type": "string"
+ },
+ "usedBy": {
+ "description": "[Output Only] List of resources referencing that backend bucket.",
+ "items": {
+ "$ref": "BackendBucketUsedBy"
+ },
+ "type": "array"
}
},
"type": "object"
@@ -38364,6 +40412,16 @@
},
"type": "object"
},
+ "BackendBucketUsedBy": {
+ "id": "BackendBucketUsedBy",
+ "properties": {
+ "reference": {
+ "description": "[Output Only] Server-defined URL for UrlMaps referencing that BackendBucket.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
"BackendService": {
"description": "Represents a Backend Service resource. A backend service defines how Google Cloud load balancers distribute traffic. The backend service configuration contains a set of values, such as the protocol used to connect to backends, various distribution and session settings, health checks, and timeouts. These settings provide fine-grained control over how your load balancer behaves. Most of the settings have default values that allow for easy configuration if you need to get started quickly. Backend services in Google Compute Engine can be either regionally or globally scoped. * [Global](https://cloud.google.com/compute/docs/reference/rest/v1/backendServices) * [Regional](https://cloud.google.com/compute/docs/reference/rest/v1/regionBackendServices) For more information, see Backend Services.",
"id": "BackendService",
@@ -38465,6 +40523,22 @@
"format": "uint64",
"type": "string"
},
+ "ipAddressSelectionPolicy": {
+ "description": "Specifies a preference for traffic sent from the proxy to the backend (or from the client to the backend for proxyless gRPC). The possible values are: - IPV4_ONLY: Only send IPv4 traffic to the backends of the backend service (Instance Group, Managed Instance Group, Network Endpoint Group), regardless of traffic from the client to the proxy. Only IPv4 health checks are used to check the health of the backends. This is the default setting. - PREFER_IPV6: Prioritize the connection to the endpoint's IPv6 address over its IPv4 address (provided there is a healthy IPv6 address). - IPV6_ONLY: Only send IPv6 traffic to the backends of the backend service (Instance Group, Managed Instance Group, Network Endpoint Group), regardless of traffic from the client to the proxy. Only IPv6 health checks are used to check the health of the backends. This field is applicable to either: - Advanced global external Application Load Balancer (load balancing scheme EXTERNAL_MANAGED), - Regional external Application Load Balancer, - Internal proxy Network Load Balancer (load balancing scheme INTERNAL_MANAGED), - Regional internal Application Load Balancer (load balancing scheme INTERNAL_MANAGED), - Traffic Director with Envoy proxies and proxyless gRPC (load balancing scheme INTERNAL_SELF_MANAGED). ",
+ "enum": [
+ "IPV4_ONLY",
+ "IPV6_ONLY",
+ "IP_ADDRESS_SELECTION_POLICY_UNSPECIFIED",
+ "PREFER_IPV6"
+ ],
+ "enumDescriptions": [
+ "Only send IPv4 traffic to the backends of the Backend Service (Instance Group, Managed Instance Group, Network Endpoint Group) regardless of traffic from the client to the proxy. Only IPv4 health-checks are used to check the health of the backends. This is the default setting.",
+ "Only send IPv6 traffic to the backends of the Backend Service (Instance Group, Managed Instance Group, Network Endpoint Group) regardless of traffic from the client to the proxy. Only IPv6 health-checks are used to check the health of the backends.",
+ "Unspecified IP address selection policy.",
+ "Prioritize the connection to the endpoints IPv6 address over its IPv4 address (provided there is a healthy IPv6 address)."
+ ],
+ "type": "string"
+ },
"kind": {
"default": "compute#backendService",
"description": "[Output Only] Type of resource. Always compute#backendService for backend services.",
@@ -38498,7 +40572,7 @@
"type": "array"
},
"localityLbPolicy": {
- "description": "The load balancing algorithm used within the scope of the locality. The possible values are: - ROUND_ROBIN: This is a simple policy in which each healthy backend is selected in round robin order. This is the default. - LEAST_REQUEST: An O(1) algorithm which selects two random healthy hosts and picks the host which has fewer active requests. - RING_HASH: The ring/modulo hash load balancer implements consistent hashing to backends. The algorithm has the property that the addition/removal of a host from a set of N hosts only affects 1/N of the requests. - RANDOM: The load balancer selects a random healthy host. - ORIGINAL_DESTINATION: Backend host is selected based on the client connection metadata, i.e., connections are opened to the same address as the destination address of the incoming connection before the connection was redirected to the load balancer. - MAGLEV: used as a drop in replacement for the ring hash load balancer. Maglev is not as stable as ring hash but has faster table lookup build times and host selection times. For more information about Maglev, see https://ai.google/research/pubs/pub44824 This field is applicable to either: - A regional backend service with the service_protocol set to HTTP, HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED. - A global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED, INTERNAL_MANAGED, or EXTERNAL_MANAGED. If sessionAffinity is not NONE, and this field is not set to MAGLEV or RING_HASH, session affinity settings will not take effect. Only ROUND_ROBIN and RING_HASH are supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true.",
+ "description": "The load balancing algorithm used within the scope of the locality. The possible values are: - ROUND_ROBIN: This is a simple policy in which each healthy backend is selected in round robin order. This is the default. - LEAST_REQUEST: An O(1) algorithm which selects two random healthy hosts and picks the host which has fewer active requests. - RING_HASH: The ring/modulo hash load balancer implements consistent hashing to backends. The algorithm has the property that the addition/removal of a host from a set of N hosts only affects 1/N of the requests. - RANDOM: The load balancer selects a random healthy host. - ORIGINAL_DESTINATION: Backend host is selected based on the client connection metadata, i.e., connections are opened to the same address as the destination address of the incoming connection before the connection was redirected to the load balancer. - MAGLEV: used as a drop in replacement for the ring hash load balancer. Maglev is not as stable as ring hash but has faster table lookup build times and host selection times. For more information about Maglev, see https://ai.google/research/pubs/pub44824 This field is applicable to either: - A regional backend service with the service_protocol set to HTTP, HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED. - A global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED, INTERNAL_MANAGED, or EXTERNAL_MANAGED. If sessionAffinity is not configured—that is, if session affinity remains at the default value of NONE—then the default value for localityLbPolicy is ROUND_ROBIN. If session affinity is set to a value other than NONE, then the default value for localityLbPolicy is MAGLEV. Only ROUND_ROBIN and RING_HASH are supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true.",
"enum": [
"INVALID_LB_POLICY",
"LEAST_REQUEST",
@@ -38606,6 +40680,10 @@
},
"type": "array"
},
+ "serviceLbPolicy": {
+ "description": "URL to networkservices.ServiceLbPolicy resource. Can only be set if load balancing scheme is EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED or INTERNAL_SELF_MANAGED and the scope is global.",
+ "type": "string"
+ },
"sessionAffinity": {
"description": "Type of session affinity to use. The default is NONE. Only NONE and HEADER_FIELD are supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true. For more details, see: [Session Affinity](https://cloud.google.com/load-balancing/docs/backend-service#session_affinity).",
"enum": [
@@ -38616,7 +40694,8 @@
"GENERATED_COOKIE",
"HEADER_FIELD",
"HTTP_COOKIE",
- "NONE"
+ "NONE",
+ "STRONG_COOKIE_AFFINITY"
],
"enumDescriptions": [
"2-tuple hash on packet's source and destination IP addresses. Connections from the same source IP address to the same destination IP address will be served by the same backend VM while that VM remains healthy.",
@@ -38626,10 +40705,15 @@
"Hash based on a cookie generated by the L7 loadbalancer. Only valid for HTTP(S) load balancing.",
"The hash is based on a user specified header field.",
"The hash is based on a user provided cookie.",
- "No session affinity. Connections from the same client IP may go to any instance in the pool."
+ "No session affinity. Connections from the same client IP may go to any instance in the pool.",
+ "Strong cookie-based affinity. Connections bearing the same cookie will be served by the same backend VM while that VM remains healthy, as long as the cookie has not expired."
],
"type": "string"
},
+ "strongSessionAffinityCookie": {
+ "$ref": "BackendServiceHttpCookie",
+ "description": "Describes the HTTP cookie used for stateful session affinity. This field is applicable and required if the sessionAffinity is set to STRONG_COOKIE_AFFINITY."
+ },
"subsetting": {
"$ref": "Subsetting"
},
@@ -38639,6 +40723,7 @@
"type": "integer"
},
"usedBy": {
+ "description": "[Output Only] List of resources referencing given backend service.",
"items": {
"$ref": "BackendServiceUsedBy"
},
@@ -39005,6 +41090,25 @@
},
"type": "object"
},
+ "BackendServiceHttpCookie": {
+ "description": "The HTTP cookie used for stateful session affinity.",
+ "id": "BackendServiceHttpCookie",
+ "properties": {
+ "name": {
+ "description": "Name of the cookie.",
+ "type": "string"
+ },
+ "path": {
+ "description": "Path to set for the cookie.",
+ "type": "string"
+ },
+ "ttl": {
+ "$ref": "Duration",
+ "description": "Lifetime of the cookie."
+ }
+ },
+ "type": "object"
+ },
"BackendServiceIAP": {
"description": "Identity-Aware Proxy",
"id": "BackendServiceIAP",
@@ -39441,6 +41545,7 @@
"id": "BackendServiceUsedBy",
"properties": {
"reference": {
+ "description": "[Output Only] Server-defined URL for resources referencing given BackendService like UrlMaps, TargetTcpProxies, TargetSslProxies and ForwardingRule.",
"type": "string"
}
},
@@ -39827,10 +41932,6 @@
"description": "Associates `members`, or principals, with a `role`.",
"id": "Binding",
"properties": {
- "bindingId": {
- "description": "This is deprecated and has no effect. Do not use.",
- "type": "string"
- },
"condition": {
"$ref": "Expr",
"description": "The condition that is associated with this binding. If the condition evaluates to `true`, then this binding applies to the current request. If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the principals in this binding. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies)."
@@ -39843,7 +41944,7 @@
"type": "array"
},
"role": {
- "description": "Role that is assigned to the list of `members`, or principals. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.",
+ "description": "Role that is assigned to the list of `members`, or principals. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview of the IAM roles and permissions, see the [IAM documentation](https://cloud.google.com/iam/docs/roles-overview). For a list of the available pre-defined roles, see [here](https://cloud.google.com/iam/docs/understanding-roles).",
"type": "string"
}
},
@@ -39875,7 +41976,7 @@
},
"locationPolicy": {
"$ref": "LocationPolicy",
- "description": "Policy for chosing target zone. For more information, see Create VMs in bulk ."
+ "description": "Policy for choosing target zone. For more information, see Create VMs in bulk."
},
"minCount": {
"description": "The minimum number of instances to create. If no min_count is specified then count is used as the default value. If min_count instances cannot be created, then no instances will be created and instances already created will be deleted.",
@@ -40075,6 +42176,10 @@
"description": "[Output Only] Creation timestamp in RFC3339 text format.",
"type": "string"
},
+ "customEndTimestamp": {
+ "description": "[Input Only] Optional, specifies the CUD end time requested by the customer in RFC3339 text format. Needed when the customer wants CUD's end date is later than the start date + term duration.",
+ "type": "string"
+ },
"description": {
"description": "An optional description of this resource. Provide this property when you create the resource.",
"type": "string"
@@ -40141,6 +42246,10 @@
},
"type": "array"
},
+ "resourceStatus": {
+ "$ref": "CommitmentResourceStatus",
+ "description": "[Output Only] Status information for Commitment resource."
+ },
"resources": {
"description": "A list of commitment amounts for particular resources. Note that VCPU and MEMORY resource commitments must occur together.",
"items": {
@@ -40187,19 +42296,24 @@
"enum": [
"ACCELERATOR_OPTIMIZED",
"ACCELERATOR_OPTIMIZED_A3",
+ "ACCELERATOR_OPTIMIZED_A3_MEGA",
"COMPUTE_OPTIMIZED",
"COMPUTE_OPTIMIZED_C2D",
"COMPUTE_OPTIMIZED_C3",
"COMPUTE_OPTIMIZED_C3D",
"COMPUTE_OPTIMIZED_H3",
"GENERAL_PURPOSE",
+ "GENERAL_PURPOSE_C4",
+ "GENERAL_PURPOSE_C4A",
"GENERAL_PURPOSE_E2",
"GENERAL_PURPOSE_N2",
"GENERAL_PURPOSE_N2D",
+ "GENERAL_PURPOSE_N4",
"GENERAL_PURPOSE_T2D",
"GRAPHICS_OPTIMIZED",
"MEMORY_OPTIMIZED",
"MEMORY_OPTIMIZED_M3",
+ "STORAGE_OPTIMIZED_Z3",
"TYPE_UNSPECIFIED"
],
"enumDescriptions": [
@@ -40218,6 +42332,11 @@
"",
"",
"",
+ "",
+ "",
+ "",
+ "",
+ "",
""
],
"type": "string"
@@ -40536,6 +42655,17 @@
},
"type": "object"
},
+ "CommitmentResourceStatus": {
+ "description": "[Output Only] Contains output only fields.",
+ "id": "CommitmentResourceStatus",
+ "properties": {
+ "customTermEligibilityEndTimestamp": {
+ "description": "[Output Only] Indicates the end time of customer's eligibility to send custom term requests in RFC3339 text format. Term extension requests that (not the end time in the request) after this time will be rejected.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
"CommitmentsScopedList": {
"id": "CommitmentsScopedList",
"properties": {
@@ -40670,90 +42800,26 @@
},
"type": "object"
},
- "Condition": {
- "description": "This is deprecated and has no effect. Do not use.",
- "id": "Condition",
+ "ConfidentialInstanceConfig": {
+ "description": "A set of Confidential Instance options.",
+ "id": "ConfidentialInstanceConfig",
"properties": {
- "iam": {
- "description": "This is deprecated and has no effect. Do not use.",
- "enum": [
- "APPROVER",
- "ATTRIBUTION",
- "AUTHORITY",
- "CREDENTIALS_TYPE",
- "CREDS_ASSERTION",
- "JUSTIFICATION_TYPE",
- "NO_ATTR",
- "SECURITY_REALM"
- ],
- "enumDescriptions": [
- "This is deprecated and has no effect. Do not use.",
- "This is deprecated and has no effect. Do not use.",
- "This is deprecated and has no effect. Do not use.",
- "This is deprecated and has no effect. Do not use.",
- "This is deprecated and has no effect. Do not use.",
- "This is deprecated and has no effect. Do not use.",
- "This is deprecated and has no effect. Do not use.",
- "This is deprecated and has no effect. Do not use."
- ],
- "type": "string"
- },
- "op": {
- "description": "This is deprecated and has no effect. Do not use.",
- "enum": [
- "DISCHARGED",
- "EQUALS",
- "IN",
- "NOT_EQUALS",
- "NOT_IN",
- "NO_OP"
- ],
- "enumDescriptions": [
- "This is deprecated and has no effect. Do not use.",
- "This is deprecated and has no effect. Do not use.",
- "This is deprecated and has no effect. Do not use.",
- "This is deprecated and has no effect. Do not use.",
- "This is deprecated and has no effect. Do not use.",
- "This is deprecated and has no effect. Do not use."
- ],
- "type": "string"
- },
- "svc": {
- "description": "This is deprecated and has no effect. Do not use.",
- "type": "string"
- },
- "sys": {
- "description": "This is deprecated and has no effect. Do not use.",
+ "confidentialInstanceType": {
+ "description": "Defines the type of technology used by the confidential instance.",
"enum": [
- "IP",
- "NAME",
- "NO_ATTR",
- "REGION",
- "SERVICE"
+ "CONFIDENTIAL_INSTANCE_TYPE_UNSPECIFIED",
+ "SEV",
+ "SEV_SNP",
+ "TDX"
],
"enumDescriptions": [
- "This is deprecated and has no effect. Do not use.",
- "This is deprecated and has no effect. Do not use.",
- "This is deprecated and has no effect. Do not use.",
- "This is deprecated and has no effect. Do not use.",
- "This is deprecated and has no effect. Do not use."
+ "No type specified. Do not use this value.",
+ "AMD Secure Encrypted Virtualization.",
+ "AMD Secure Encrypted Virtualization - Secure Nested Paging.",
+ "Intel Trust Domain eXtension."
],
"type": "string"
},
- "values": {
- "description": "This is deprecated and has no effect. Do not use.",
- "items": {
- "type": "string"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "ConfidentialInstanceConfig": {
- "description": "A set of Confidential Instance options.",
- "id": "ConfidentialInstanceConfig",
- "properties": {
"enableConfidentialCompute": {
"description": "Defines whether the instance should have confidential compute enabled.",
"type": "boolean"
@@ -40835,7 +42901,7 @@
"type": "array"
},
"allowOriginRegexes": {
- "description": "Specifies a regular expression that matches allowed origins. For more information about the regular expression syntax, see Syntax. An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes. Regular expressions can only be used when the loadBalancingScheme is set to INTERNAL_SELF_MANAGED.",
+ "description": "Specifies a regular expression that matches allowed origins. For more information, see regular expression syntax . An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes. Regular expressions can only be used when the loadBalancingScheme is set to INTERNAL_SELF_MANAGED.",
"items": {
"type": "string"
},
@@ -40849,7 +42915,7 @@
"type": "array"
},
"disabled": {
- "description": "If true, the setting specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect.",
+ "description": "If true, disables the CORS policy. The default value is false, which indicates that the CORS policy is in effect.",
"type": "boolean"
},
"exposeHeaders": {
@@ -40867,6 +42933,47 @@
},
"type": "object"
},
+ "CustomErrorResponsePolicy": {
+ "description": "Specifies the custom error response policy that must be applied when the backend service or backend bucket responds with an error.",
+ "id": "CustomErrorResponsePolicy",
+ "properties": {
+ "errorResponseRules": {
+ "description": "Specifies rules for returning error responses. In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect.",
+ "items": {
+ "$ref": "CustomErrorResponsePolicyCustomErrorResponseRule"
+ },
+ "type": "array"
+ },
+ "errorService": {
+ "description": "The full or partial URL to the BackendBucket resource that contains the custom error content. Examples are: - https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket - compute/v1/projects/project/global/backendBuckets/myBackendBucket - global/backendBuckets/myBackendBucket If errorService is not specified at lower levels like pathMatcher, pathRule and routeRule, an errorService specified at a higher level in the UrlMap will be used. If UrlMap.defaultCustomErrorResponsePolicy contains one or more errorResponseRules[], it must specify errorService. If load balancer cannot reach the backendBucket, a simple Not Found Error will be returned, with the original response code (or overrideResponseCode if configured). errorService is not supported for internal or regional HTTP/HTTPS load balancers.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "CustomErrorResponsePolicyCustomErrorResponseRule": {
+ "description": "Specifies the mapping between the response code that will be returned along with the custom error content and the response code returned by the backend service.",
+ "id": "CustomErrorResponsePolicyCustomErrorResponseRule",
+ "properties": {
+ "matchResponseCodes": {
+ "description": "Valid values include: - A number between 400 and 599: For example 401 or 503, in which case the load balancer applies the policy if the error code exactly matches this value. - 5xx: Load Balancer will apply the policy if the backend service responds with any response code in the range of 500 to 599. - 4xx: Load Balancer will apply the policy if the backend service responds with any response code in the range of 400 to 499. Values must be unique within matchResponseCodes and across all errorResponseRules of CustomErrorResponsePolicy.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "overrideResponseCode": {
+ "description": "The HTTP status code returned with the response containing the custom error content. If overrideResponseCode is not supplied, the same response code returned by the original backend bucket or backend service is returned to the client.",
+ "format": "int32",
+ "type": "integer"
+ },
+ "path": {
+ "description": "The full path to a file within backendBucket . For example: /errors/defaultError.html path must start with a leading slash. path cannot have trailing slashes. If the file is not available in backendBucket or the load balancer cannot reach the BackendBucket, a simple Not Found Error is returned to the client. The value must be from 1 to 1024 characters",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
"CustomerEncryptionKey": {
"id": "CustomerEncryptionKey",
"properties": {
@@ -40950,6 +43057,20 @@
"description": "Represents a Persistent Disk resource. Google Compute Engine has two Disk resources: * [Zonal](/compute/docs/reference/rest/v1/disks) * [Regional](/compute/docs/reference/rest/v1/regionDisks) Persistent disks are required for running your VM instances. Create both boot and non-boot (data) persistent disks. For more information, read Persistent Disks. For more storage options, read Storage options. The disks resource represents a zonal persistent disk. For more information, read Zonal persistent disks. The regionDisks resource represents a regional persistent disk. For more information, read Regional resources.",
"id": "Disk",
"properties": {
+ "accessMode": {
+ "description": "The access mode of the disk. - READ_WRITE_SINGLE: The default AccessMode, means the disk can be attached to single instance in RW mode. - READ_WRITE_MANY: The AccessMode means the disk can be attached to multiple instances in RW mode. - READ_ONLY_MANY: The AccessMode means the disk can be attached to multiple instances in RO mode. The AccessMode is only valid for Hyperdisk disk types.",
+ "enum": [
+ "READ_ONLY_MANY",
+ "READ_WRITE_MANY",
+ "READ_WRITE_SINGLE"
+ ],
+ "enumDescriptions": [
+ "The AccessMode means the disk can be attached to multiple instances in RO mode.",
+ "The AccessMode means the disk can be attached to multiple instances in RW mode.",
+ "The default AccessMode, means the disk can be attached to single instance in RW mode."
+ ],
+ "type": "string"
+ },
"architecture": {
"description": "The architecture of the disk. Valid values are ARM64 or X86_64.",
"enum": [
@@ -41076,7 +43197,7 @@
"type": "string"
},
"provisionedThroughput": {
- "description": "Indicates how much throughput to provision for the disk. This sets the number of throughput mb per second that the disk can handle. Values must be between 1 and 7,124.",
+ "description": "Indicates how much throughput to provision for the disk. This sets the number of throughput mb per second that the disk can handle. Values must be greater than or equal to 1.",
"format": "int64",
"type": "string"
},
@@ -41148,6 +43269,14 @@
"description": "[Output Only] The ID value of the image used to create this disk. This value identifies the exact image that was used to create this persistent disk. For example, if you created the persistent disk from an image that was later deleted and recreated under the same name, the source image ID would identify the exact version of the image that was used.",
"type": "string"
},
+ "sourceInstantSnapshot": {
+ "description": "The source instant snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /instantSnapshots/instantSnapshot - projects/project/zones/zone/instantSnapshots/instantSnapshot - zones/zone/instantSnapshots/instantSnapshot ",
+ "type": "string"
+ },
+ "sourceInstantSnapshotId": {
+ "description": "[Output Only] The unique ID of the instant snapshot used to create this disk. This value identifies the exact instant snapshot that was used to create this persistent disk. For example, if you created the persistent disk from an instant snapshot that was later deleted and recreated under the same name, the source instant snapshot ID would identify the exact version of the instant snapshot that was used.",
+ "type": "string"
+ },
"sourceSnapshot": {
"description": "The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project /global/snapshots/snapshot - projects/project/global/snapshots/snapshot - global/snapshots/snapshot ",
"type": "string"
@@ -41171,17 +43300,23 @@
"DELETING",
"FAILED",
"READY",
- "RESTORING"
+ "RESTORING",
+ "UNAVAILABLE"
],
"enumDescriptions": [
"Disk is provisioning",
"Disk is deleting.",
"Disk creation failed.",
"Disk is ready for use.",
- "Source data is being copied into the disk."
+ "Source data is being copied into the disk.",
+ "Disk is currently unavailable and cannot be accessed, attached or detached."
],
"type": "string"
},
+ "storagePool": {
+ "description": "The storage pool in which the new disk is created. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /storagePools/storagePool - projects/project/zones/zone/storagePools/storagePool - zones/zone/storagePools/storagePool ",
+ "type": "string"
+ },
"type": {
"description": "URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk. For example: projects/project /zones/zone/diskTypes/pd-ssd . See Persistent disk types.",
"type": "string"
@@ -42428,7 +44563,7 @@
"additionalProperties": {
"type": "string"
},
- "description": "Additional structured details about this error. Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in length. When identifying the current value of an exceeded limit, the units should be contained in the key, not the value. For example, rather than {\"instanceLimit\": \"100/request\"}, should be returned as, {\"instanceLimitPerRequest\": \"100\"}, if the client exceeds the number of instances that can be created in a single (batch) request.",
+ "description": "Additional structured details about this error. Keys must match /a-z+/ but should ideally be lowerCamelCase. Also they must be limited to 64 characters in length. When identifying the current value of an exceeded limit, the units should be contained in the key, not the value. For example, rather than {\"instanceLimit\": \"100/request\"}, should be returned as, {\"instanceLimitPerRequest\": \"100\"}, if the client exceeds the number of instances that can be created in a single (batch) request.",
"type": "object"
},
"reason": {
@@ -42733,6 +44868,10 @@
"ipAddress": {
"description": "IP address of the interface in the external VPN gateway. Only IPv4 is supported. This IP address can be either from your on-premise gateway or another Cloud provider's VPN gateway, it cannot be an IP address from Google Compute Engine.",
"type": "string"
+ },
+ "ipv6Address": {
+ "description": "IPv6 address of the interface in the external VPN gateway. This IPv6 address can be either from your on-premise gateway or another Cloud provider's VPN gateway, it cannot be an IP address from Google Compute Engine. Must specify an IPv6 address (not IPV4-mapped) using any format described in RFC 4291 (e.g. 2001:db8:0:0:2d9:51:0:0). The output format is RFC 5952 format (e.g. 2001:db8::2d9:51:0:0).",
+ "type": "string"
}
},
"type": "object"
@@ -43520,7 +45659,7 @@
"id": "FirewallPolicyRule",
"properties": {
"action": {
- "description": "The Action to perform when the client connection triggers the rule. Valid actions are \"allow\", \"deny\" and \"goto_next\".",
+ "description": "The Action to perform when the client connection triggers the rule. Valid actions for firewall rules are: \"allow\", \"deny\", \"apply_security_profile_group\" and \"goto_next\". Valid actions for packet mirroring rules are: \"mirror\", \"do_not_mirror\" and \"goto_next\".",
"type": "string"
},
"description": {
@@ -43549,7 +45688,7 @@
},
"kind": {
"default": "compute#firewallPolicyRule",
- "description": "[Output only] Type of the resource. Always compute#firewallPolicyRule for firewall policy rules",
+ "description": "[Output only] Type of the resource. Returns compute#firewallPolicyRule for firewall rules and compute#packetMirroringRule for packet mirroring rules.",
"type": "string"
},
"match": {
@@ -43557,7 +45696,7 @@
"description": "A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced."
},
"priority": {
- "description": "An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority.",
+ "description": "An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest priority.",
"format": "int32",
"type": "integer"
},
@@ -43570,6 +45709,10 @@
"format": "int32",
"type": "integer"
},
+ "securityProfileGroup": {
+ "description": "A fully-qualified URL of a SecurityProfile resource instance. Example: https://networksecurity.googleapis.com/v1/projects/{project}/locations/{location}/securityProfileGroups/my-security-profile-group Must be specified if action is one of 'apply_security_profile_group' or 'mirror'. Cannot be specified for other actions.",
+ "type": "string"
+ },
"targetResources": {
"description": "A list of network resource URLs to which this rule applies. This field allows you to control which network's VMs get this rule. If this field is left blank, all VMs within the organization will receive the rule.",
"items": {
@@ -43590,6 +45733,10 @@
"type": "string"
},
"type": "array"
+ },
+ "tlsInspect": {
+ "description": "Boolean flag indicating if the traffic should be TLS decrypted. Can be set only if action = 'apply_security_profile_group' and cannot be set for other actions.",
+ "type": "boolean"
}
},
"type": "object"
@@ -43815,6 +45962,10 @@
"format": "uint64",
"type": "string"
},
+ "ipCollection": {
+ "description": "Resource reference of a PublicDelegatedPrefix. The PDP must be a sub-PDP in EXTERNAL_IPV6_FORWARDING_RULE_CREATION mode. Use one of the following formats to specify a sub-PDP when creating an IPv6 NetLB forwarding rule using BYOIP: Full resource URL, as in https://www.googleapis.com/compute/v1/projects/project_id/regions/region /publicDelegatedPrefixes/sub-pdp-name Partial URL, as in: - projects/project_id/regions/region/publicDelegatedPrefixes/sub-pdp-name - regions/region/publicDelegatedPrefixes/sub-pdp-name ",
+ "type": "string"
+ },
"ipVersion": {
"description": "The IP Version that will be used by this forwarding rule. Valid options are IPV4 or IPV6.",
"enum": [
@@ -44660,7 +46811,7 @@
"id": "GuestOsFeature",
"properties": {
"type": {
- "description": "The ID of a supported feature. To add multiple values, use commas to separate values. Set to one or more of the following values: - VIRTIO_SCSI_MULTIQUEUE - WINDOWS - MULTI_IP_SUBNET - UEFI_COMPATIBLE - GVNIC - SEV_CAPABLE - SUSPEND_RESUME_COMPATIBLE - SEV_LIVE_MIGRATABLE - SEV_SNP_CAPABLE - TDX_CAPABLE - IDPF For more information, see Enabling guest operating system features.",
+ "description": "The ID of a supported feature. To add multiple values, use commas to separate values. Set to one or more of the following values: - VIRTIO_SCSI_MULTIQUEUE - WINDOWS - MULTI_IP_SUBNET - UEFI_COMPATIBLE - GVNIC - SEV_CAPABLE - SUSPEND_RESUME_COMPATIBLE - SEV_LIVE_MIGRATABLE_V2 - SEV_SNP_CAPABLE - TDX_CAPABLE - IDPF For more information, see Enabling guest operating system features.",
"enum": [
"FEATURE_TYPE_UNSPECIFIED",
"GVNIC",
@@ -44671,6 +46822,7 @@
"SEV_LIVE_MIGRATABLE",
"SEV_LIVE_MIGRATABLE_V2",
"SEV_SNP_CAPABLE",
+ "TDX_CAPABLE",
"UEFI_COMPATIBLE",
"VIRTIO_SCSI_MULTIQUEUE",
"WINDOWS"
@@ -44687,6 +46839,7 @@
"",
"",
"",
+ "",
""
],
"type": "string"
@@ -44737,7 +46890,7 @@
"type": "string"
},
"requestPath": {
- "description": "The request path of the HTTP/2 health check request. The default value is /.",
+ "description": "The request path of the HTTP/2 health check request. The default value is /. Must comply with RFC3986.",
"type": "string"
},
"response": {
@@ -44790,7 +46943,7 @@
"type": "string"
},
"requestPath": {
- "description": "The request path of the HTTP health check request. The default value is /.",
+ "description": "The request path of the HTTP health check request. The default value is /. Must comply with RFC3986.",
"type": "string"
},
"response": {
@@ -44843,7 +46996,7 @@
"type": "string"
},
"requestPath": {
- "description": "The request path of the HTTPS health check request. The default value is /.",
+ "description": "The request path of the HTTPS health check request. The default value is /. Must comply with RFC3986.",
"type": "string"
},
"response": {
@@ -44914,6 +47067,13 @@
"description": "[Output Only] Server-defined URL for the resource.",
"type": "string"
},
+ "sourceRegions": {
+ "description": "The list of cloud regions from which health checks are performed. If any regions are specified, then exactly 3 regions should be specified. The region names must be valid names of Google Cloud regions. This can only be set for global health check. If this list is non-empty, then there are restrictions on what other health check fields are supported and what other resources can use this health check: - SSL, HTTP2, and GRPC protocols are not supported. - The TCP request field is not supported. - The proxyHeader field for HTTP, HTTPS, and TCP is not supported. - The checkIntervalSec field must be at least 30. - The health check cannot be used with BackendService nor with managed instance group auto-healing. ",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
"sslHealthCheck": {
"$ref": "SSLHealthCheck"
},
@@ -45696,6 +47856,21 @@
"description": "For target pool based Network Load Balancing, it indicates the forwarding rule's IP address assigned to this instance. For other types of load balancing, the field indicates VM internal ip.",
"type": "string"
},
+ "ipv6Address": {
+ "type": "string"
+ },
+ "ipv6HealthState": {
+ "description": "Health state of the IPv6 address of the instance.",
+ "enum": [
+ "HEALTHY",
+ "UNHEALTHY"
+ ],
+ "enumDescriptions": [
+ "",
+ ""
+ ],
+ "type": "string"
+ },
"port": {
"description": "The named port of the instance group, not necessarily the port that is health-checked.",
"format": "int32",
@@ -45756,6 +47931,22 @@
"Health status of the endpoint is unknown."
],
"type": "string"
+ },
+ "ipv6HealthState": {
+ "description": "Health state of the ipv6 network endpoint determined based on the health checks configured.",
+ "enum": [
+ "DRAINING",
+ "HEALTHY",
+ "UNHEALTHY",
+ "UNKNOWN"
+ ],
+ "enumDescriptions": [
+ "Endpoint is being drained.",
+ "Endpoint is healthy.",
+ "Endpoint is unhealthy.",
+ "Health status of the endpoint is unknown."
+ ],
+ "type": "string"
}
},
"type": "object"
@@ -46307,6 +48498,10 @@
"description": "The HttpRouteRule setting specifies how to match an HTTP request and the corresponding routing action that load balancing proxies perform.",
"id": "HttpRouteRule",
"properties": {
+ "customErrorResponsePolicy": {
+ "$ref": "CustomErrorResponsePolicy",
+ "description": "customErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendServiceor BackendBucket responds with an error. If a policy for an error code is not configured for the RouteRule, a policy for the error code configured in pathMatcher.defaultCustomErrorResponsePolicy is applied. If one is not specified in pathMatcher.defaultCustomErrorResponsePolicy, the policy configured in UrlMap.defaultCustomErrorResponsePolicy takes effect. For example, consider a UrlMap with the following configuration: - UrlMap.defaultCustomErrorResponsePolicy are configured with policies for 5xx and 4xx errors - A RouteRule for /coming_soon/ is configured for the error code 404. If the request is for www.myotherdomain.com and a 404 is encountered, the policy under UrlMap.defaultCustomErrorResponsePolicy takes effect. If a 404 response is encountered for the request www.example.com/current_events/, the pathMatcher's policy takes effect. If however, the request for www.example.com/coming_soon/ encounters a 404, the policy in RouteRule.customErrorResponsePolicy takes effect. If any of the requests in this example encounter a 500 error code, the policy at UrlMap.defaultCustomErrorResponsePolicy takes effect. When used in conjunction with routeRules.routeAction.retryPolicy, retries take precedence. Only once all retries are exhausted, the customErrorResponsePolicy is applied. While attempting a retry, if load balancer is successful in reaching the service, the customErrorResponsePolicy is ignored and the response from the service is returned to the client. customErrorResponsePolicy is supported only for global external Application Load Balancers."
+ },
"description": {
"description": "The short description conveying the intent of this routeRule. The description can have a maximum length of 1024 characters.",
"type": "string"
@@ -47870,6 +50065,10 @@
"description": "Represents a Managed Instance Group resource. An instance group is a collection of VM instances that you can manage as a single entity. For more information, read Instance groups. For zonal Managed Instance Group, use the instanceGroupManagers resource. For regional Managed Instance Group, use the regionInstanceGroupManagers resource.",
"id": "InstanceGroupManager",
"properties": {
+ "allInstancesConfig": {
+ "$ref": "InstanceGroupManagerAllInstancesConfig",
+ "description": "Specifies configuration that overrides the instance template configuration for the group."
+ },
"autoHealingPolicies": {
"description": "The autohealing policy for this managed instance group. You can specify only one value.",
"items": {
@@ -47878,8 +50077,7 @@
"type": "array"
},
"baseInstanceName": {
- "description": "The base instance name to use for instances in this group. The value must be 1-58 characters long. Instances are named by appending a hyphen and a random four-character string to the base instance name. The base instance name must comply with RFC1035.",
- "pattern": "[a-z][-a-z0-9]{0,57}",
+ "description": "The base instance name is a prefix that you want to attach to the names of all VMs in a MIG. The maximum character length is 58 and the name must comply with RFC1035 format. When a VM is created in the group, the MIG appends a hyphen and a random four-character string to the base instance name. If you want the MIG to assign sequential numbers instead of a random string, then end the base instance name with a hyphen followed by one or more hash symbols. The hash symbols indicate the number of digits. For example, a base instance name of \"vm-###\" results in \"vm-001\" as a VM name. @pattern [a-z](([-a-z0-9]{0,57})|([-a-z0-9]{0,51}-#{1,10}(\\\\[[0-9]{1,10}\\\\])?))",
"type": "string"
},
"creationTimestamp": {
@@ -47908,6 +50106,10 @@
"format": "uint64",
"type": "string"
},
+ "instanceFlexibilityPolicy": {
+ "$ref": "InstanceGroupManagerInstanceFlexibilityPolicy",
+ "description": "Instance flexibility allowing MIG to create VMs from multiple types of machines. Instance flexibility configuration on MIG overrides instance template configuration."
+ },
"instanceGroup": {
"description": "[Output Only] The URL of the Instance Group resource.",
"type": "string"
@@ -47949,7 +50151,7 @@
"type": "string"
},
"namedPorts": {
- "description": "Named ports configured for the Instance Groups complementary to this Instance Group Manager.",
+ "description": "[Output Only] Named ports configured on the Instance Groups complementary to this Instance Group Manager.",
"items": {
"$ref": "NamedPort"
},
@@ -47959,6 +50161,14 @@
"description": "[Output Only] The URL of the region where the managed instance group resides (for regional resources).",
"type": "string"
},
+ "satisfiesPzi": {
+ "description": "[Output Only] Reserved for future use.",
+ "type": "boolean"
+ },
+ "satisfiesPzs": {
+ "description": "[Output Only] Reserved for future use.",
+ "type": "boolean"
+ },
"selfLink": {
"description": "[Output Only] The URL for this managed instance group. The server defines this URL.",
"type": "string"
@@ -48237,6 +50447,16 @@
},
"type": "object"
},
+ "InstanceGroupManagerAllInstancesConfig": {
+ "id": "InstanceGroupManagerAllInstancesConfig",
+ "properties": {
+ "properties": {
+ "$ref": "InstancePropertiesPatch",
+ "description": "Properties to set on all instances in the group. You can add or modify properties using the instanceGroupManagers.patch or regionInstanceGroupManagers.patch. After setting allInstancesConfig on the group, you must update the group's instances to apply the configuration. To apply the configuration, set the group's updatePolicy.type field to use proactive updates or use the applyUpdatesToInstances method."
+ }
+ },
+ "type": "object"
+ },
"InstanceGroupManagerAutoHealingPolicy": {
"id": "InstanceGroupManagerAutoHealingPolicy",
"properties": {
@@ -48252,9 +50472,52 @@
},
"type": "object"
},
+ "InstanceGroupManagerInstanceFlexibilityPolicy": {
+ "id": "InstanceGroupManagerInstanceFlexibilityPolicy",
+ "properties": {
+ "instanceSelections": {
+ "additionalProperties": {
+ "$ref": "InstanceGroupManagerInstanceFlexibilityPolicyInstanceSelection"
+ },
+ "description": "Named instance selections configuring properties that the group will use when creating new VMs.",
+ "type": "object"
+ }
+ },
+ "type": "object"
+ },
+ "InstanceGroupManagerInstanceFlexibilityPolicyInstanceSelection": {
+ "id": "InstanceGroupManagerInstanceFlexibilityPolicyInstanceSelection",
+ "properties": {
+ "machineTypes": {
+ "description": "Full machine-type names, e.g. \"n1-standard-16\".",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "rank": {
+ "description": "Preference of this instance selection. Lower number means higher preference. MIG will first try to create a VM based on the machine-type with lowest rank and fallback to next rank based on availability. Machine types and instance selections with the same rank have the same preference.",
+ "format": "int32",
+ "type": "integer"
+ }
+ },
+ "type": "object"
+ },
"InstanceGroupManagerInstanceLifecyclePolicy": {
"id": "InstanceGroupManagerInstanceLifecyclePolicy",
"properties": {
+ "defaultActionOnFailure": {
+ "description": "The action that a MIG performs on a failed or an unhealthy VM. A VM is marked as unhealthy when the application running on that VM fails a health check. Valid values are - REPAIR (default): MIG automatically repairs a failed or an unhealthy VM by recreating it. For more information, see About repairing VMs in a MIG. - DO_NOTHING: MIG does not repair a failed or an unhealthy VM. ",
+ "enum": [
+ "DO_NOTHING",
+ "REPAIR"
+ ],
+ "enumDescriptions": [
+ "MIG does not repair a failed or an unhealthy VM.",
+ "(Default) MIG automatically repairs a failed or an unhealthy VM by recreating it. For more information, see About repairing VMs in a MIG."
+ ],
+ "type": "string"
+ },
"forceUpdateOnRepair": {
"description": "A bit indicating whether to forcefully apply the group's latest configuration when repairing a VM. Valid options are: - NO (default): If configuration updates are available, they are not forcefully applied during repair. Instead, configuration updates are applied according to the group's update policy. - YES: If configuration updates are available, they are applied during repair. ",
"enum": [
@@ -48422,9 +50685,357 @@
},
"type": "object"
},
+ "InstanceGroupManagerResizeRequest": {
+ "description": "InstanceGroupManagerResizeRequest represents a request to create a number of VMs: either immediately or by queuing the request for the specified time. This resize request is nested under InstanceGroupManager and the VMs created by this request are added to the owning InstanceGroupManager.",
+ "id": "InstanceGroupManagerResizeRequest",
+ "properties": {
+ "creationTimestamp": {
+ "description": "[Output Only] The creation timestamp for this resize request in RFC3339 text format.",
+ "type": "string"
+ },
+ "description": {
+ "description": "An optional description of this resource.",
+ "type": "string"
+ },
+ "id": {
+ "description": "[Output Only] A unique identifier for this resource type. The server generates this identifier.",
+ "format": "uint64",
+ "type": "string"
+ },
+ "kind": {
+ "default": "compute#instanceGroupManagerResizeRequest",
+ "description": "[Output Only] The resource type, which is always compute#instanceGroupManagerResizeRequest for resize requests.",
+ "type": "string"
+ },
+ "name": {
+ "annotations": {
+ "required": [
+ "compute.instanceGroupManagerResizeRequests.insert"
+ ]
+ },
+ "description": "The name of this resize request. The name must be 1-63 characters long, and comply with RFC1035.",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "type": "string"
+ },
+ "requestedRunDuration": {
+ "$ref": "Duration",
+ "description": "Requested run duration for instances that will be created by this request. At the end of the run duration instance will be deleted."
+ },
+ "resizeBy": {
+ "description": "The number of instances to be created by this resize request. The group's target size will be increased by this number. This field cannot be used together with 'instances'.",
+ "format": "int32",
+ "type": "integer"
+ },
+ "selfLink": {
+ "description": "[Output Only] The URL for this resize request. The server defines this URL.",
+ "type": "string"
+ },
+ "selfLinkWithId": {
+ "description": "[Output Only] Server-defined URL for this resource with the resource id.",
+ "type": "string"
+ },
+ "state": {
+ "description": "[Output only] Current state of the request.",
+ "enum": [
+ "ACCEPTED",
+ "CANCELLED",
+ "CREATING",
+ "FAILED",
+ "STATE_UNSPECIFIED",
+ "SUCCEEDED"
+ ],
+ "enumDescriptions": [
+ "The request was created successfully and was accepted for provisioning when the capacity becomes available.",
+ "The request is cancelled.",
+ "Resize request is being created and may still fail creation.",
+ "The request failed before or during provisioning. If the request fails during provisioning, any VMs that were created during provisioning are rolled back and removed from the MIG.",
+ "Default value. This value should never be returned.",
+ "The request succeeded."
+ ],
+ "type": "string"
+ },
+ "status": {
+ "$ref": "InstanceGroupManagerResizeRequestStatus",
+ "description": "[Output only] Status of the request."
+ },
+ "zone": {
+ "description": "[Output Only] The URL of a zone where the resize request is located. Populated only for zonal resize requests.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "InstanceGroupManagerResizeRequestStatus": {
+ "id": "InstanceGroupManagerResizeRequestStatus",
+ "properties": {
+ "error": {
+ "description": "[Output only] Fatal errors encountered during the queueing or provisioning phases of the ResizeRequest that caused the transition to the FAILED state. Contrary to the last_attempt errors, this field is final and errors are never removed from here, as the ResizeRequest is not going to retry.",
+ "properties": {
+ "errors": {
+ "description": "[Output Only] The array of errors encountered while processing this operation.",
+ "items": {
+ "properties": {
+ "code": {
+ "description": "[Output Only] The error type identifier for this error.",
+ "type": "string"
+ },
+ "errorDetails": {
+ "description": "[Output Only] An optional list of messages that contain the error details. There is a set of defined message types to use for providing details.The syntax depends on the error code. For example, QuotaExceededInfo will have details when the error code is QUOTA_EXCEEDED.",
+ "items": {
+ "properties": {
+ "errorInfo": {
+ "$ref": "ErrorInfo"
+ },
+ "help": {
+ "$ref": "Help"
+ },
+ "localizedMessage": {
+ "$ref": "LocalizedMessage"
+ },
+ "quotaInfo": {
+ "$ref": "QuotaExceededInfo"
+ }
+ },
+ "type": "object"
+ },
+ "type": "array"
+ },
+ "location": {
+ "description": "[Output Only] Indicates the field in the request that caused the error. This property is optional.",
+ "type": "string"
+ },
+ "message": {
+ "description": "[Output Only] An optional, human-readable error message.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "type": "array"
+ }
+ },
+ "type": "object"
+ },
+ "lastAttempt": {
+ "$ref": "InstanceGroupManagerResizeRequestStatusLastAttempt",
+ "description": "[Output only] Information about the last attempt to fulfill the request. The value is temporary since the ResizeRequest can retry, as long as it's still active and the last attempt value can either be cleared or replaced with a different error. Since ResizeRequest retries infrequently, the value may be stale and no longer show an active problem. The value is cleared when ResizeRequest transitions to the final state (becomes inactive). If the final state is FAILED the error describing it will be storred in the \"error\" field only."
+ }
+ },
+ "type": "object"
+ },
+ "InstanceGroupManagerResizeRequestStatusLastAttempt": {
+ "id": "InstanceGroupManagerResizeRequestStatusLastAttempt",
+ "properties": {
+ "error": {
+ "description": "Errors that prevented the ResizeRequest to be fulfilled.",
+ "properties": {
+ "errors": {
+ "description": "[Output Only] The array of errors encountered while processing this operation.",
+ "items": {
+ "properties": {
+ "code": {
+ "description": "[Output Only] The error type identifier for this error.",
+ "type": "string"
+ },
+ "errorDetails": {
+ "description": "[Output Only] An optional list of messages that contain the error details. There is a set of defined message types to use for providing details.The syntax depends on the error code. For example, QuotaExceededInfo will have details when the error code is QUOTA_EXCEEDED.",
+ "items": {
+ "properties": {
+ "errorInfo": {
+ "$ref": "ErrorInfo"
+ },
+ "help": {
+ "$ref": "Help"
+ },
+ "localizedMessage": {
+ "$ref": "LocalizedMessage"
+ },
+ "quotaInfo": {
+ "$ref": "QuotaExceededInfo"
+ }
+ },
+ "type": "object"
+ },
+ "type": "array"
+ },
+ "location": {
+ "description": "[Output Only] Indicates the field in the request that caused the error. This property is optional.",
+ "type": "string"
+ },
+ "message": {
+ "description": "[Output Only] An optional, human-readable error message.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "type": "array"
+ }
+ },
+ "type": "object"
+ }
+ },
+ "type": "object"
+ },
+ "InstanceGroupManagerResizeRequestsListResponse": {
+ "description": "[Output Only] A list of resize requests.",
+ "id": "InstanceGroupManagerResizeRequestsListResponse",
+ "properties": {
+ "id": {
+ "description": "[Output Only] Unique identifier for the resource; defined by the server.",
+ "type": "string"
+ },
+ "items": {
+ "description": "A list of resize request resources.",
+ "items": {
+ "$ref": "InstanceGroupManagerResizeRequest"
+ },
+ "type": "array"
+ },
+ "kind": {
+ "default": "compute#instanceGroupManagerResizeRequestList",
+ "description": "[Output Only] Type of the resource. Always compute#instanceGroupManagerResizeRequestList for a list of resize requests.",
+ "type": "string"
+ },
+ "nextPageToken": {
+ "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
+ "type": "string"
+ },
+ "selfLink": {
+ "description": "[Output Only] Server-defined URL for this resource.",
+ "type": "string"
+ },
+ "warning": {
+ "description": "[Output Only] Informational warning message.",
+ "properties": {
+ "code": {
+ "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.",
+ "enum": [
+ "CLEANUP_FAILED",
+ "DEPRECATED_RESOURCE_USED",
+ "DEPRECATED_TYPE_USED",
+ "DISK_SIZE_LARGER_THAN_IMAGE_SIZE",
+ "EXPERIMENTAL_TYPE_USED",
+ "EXTERNAL_API_WARNING",
+ "FIELD_VALUE_OVERRIDEN",
+ "INJECTED_KERNELS_DEPRECATED",
+ "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB",
+ "LARGE_DEPLOYMENT_WARNING",
+ "LIST_OVERHEAD_QUOTA_EXCEED",
+ "MISSING_TYPE_DEPENDENCY",
+ "NEXT_HOP_ADDRESS_NOT_ASSIGNED",
+ "NEXT_HOP_CANNOT_IP_FORWARD",
+ "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE",
+ "NEXT_HOP_INSTANCE_NOT_FOUND",
+ "NEXT_HOP_INSTANCE_NOT_ON_NETWORK",
+ "NEXT_HOP_NOT_RUNNING",
+ "NOT_CRITICAL_ERROR",
+ "NO_RESULTS_ON_PAGE",
+ "PARTIAL_SUCCESS",
+ "REQUIRED_TOS_AGREEMENT",
+ "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING",
+ "RESOURCE_NOT_DELETED",
+ "SCHEMA_VALIDATION_IGNORED",
+ "SINGLE_INSTANCE_PROPERTY_TEMPLATE",
+ "UNDECLARED_PROPERTIES",
+ "UNREACHABLE"
+ ],
+ "enumDeprecated": [
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ true,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false
+ ],
+ "enumDescriptions": [
+ "Warning about failed cleanup of transient changes made by a failed operation.",
+ "A link to a deprecated resource was created.",
+ "When deploying and at least one of the resources has a type marked as deprecated",
+ "The user created a boot disk that is larger than image size.",
+ "When deploying and at least one of the resources has a type marked as experimental",
+ "Warning that is present in an external api call",
+ "Warning that value of a field has been overridden. Deprecated unused field.",
+ "The operation involved use of an injected kernel, which is deprecated.",
+ "A WEIGHTED_MAGLEV backend service is associated with a health check that is not of type HTTP/HTTPS/HTTP2.",
+ "When deploying a deployment with a exceedingly large number of resources",
+ "Resource can't be retrieved due to list overhead quota exceed which captures the amount of resources filtered out by user-defined list filter.",
+ "A resource depends on a missing type",
+ "The route's nextHopIp address is not assigned to an instance on the network.",
+ "The route's next hop instance cannot ip forward.",
+ "The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route.",
+ "The route's nextHopInstance URL refers to an instance that does not exist.",
+ "The route's nextHopInstance URL refers to an instance that is not on the same network as the route.",
+ "The route's next hop instance does not have a status of RUNNING.",
+ "Error which is not critical. We decided to continue the process despite the mentioned error.",
+ "No results are present on a particular list page.",
+ "Success is reported, but some results may be missing due to errors",
+ "The user attempted to use a resource that requires a TOS they have not accepted.",
+ "Warning that a resource is in use.",
+ "One or more of the resources set to auto-delete could not be deleted because they were in use.",
+ "When a resource schema validation is ignored.",
+ "Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group.",
+ "When undeclared properties in the schema are present",
+ "A given scope cannot be reached."
+ ],
+ "type": "string"
+ },
+ "data": {
+ "description": "[Output Only] Metadata about this warning in key: value format. For example: \"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" } ",
+ "items": {
+ "properties": {
+ "key": {
+ "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).",
+ "type": "string"
+ },
+ "value": {
+ "description": "[Output Only] A warning data value corresponding to the key.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "type": "array"
+ },
+ "message": {
+ "description": "[Output Only] A human-readable description of the warning code.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ }
+ },
+ "type": "object"
+ },
"InstanceGroupManagerStatus": {
"id": "InstanceGroupManagerStatus",
"properties": {
+ "allInstancesConfig": {
+ "$ref": "InstanceGroupManagerStatusAllInstancesConfig",
+ "description": "[Output only] Status of all-instances configuration on the group."
+ },
"autoscaler": {
"description": "[Output Only] The URL of the Autoscaler that targets this instance group manager.",
"type": "string"
@@ -48444,6 +51055,20 @@
},
"type": "object"
},
+ "InstanceGroupManagerStatusAllInstancesConfig": {
+ "id": "InstanceGroupManagerStatusAllInstancesConfig",
+ "properties": {
+ "currentRevision": {
+ "description": "[Output Only] Current all-instances configuration revision. This value is in RFC3339 text format.",
+ "type": "string"
+ },
+ "effective": {
+ "description": "[Output Only] A bit indicating whether this configuration has been applied to all managed instances in the group.",
+ "type": "boolean"
+ }
+ },
+ "type": "object"
+ },
"InstanceGroupManagerStatusStateful": {
"id": "InstanceGroupManagerStatusStateful",
"properties": {
@@ -48453,7 +51078,7 @@
},
"perInstanceConfigs": {
"$ref": "InstanceGroupManagerStatusStatefulPerInstanceConfigs",
- "description": "[Output Only] Status of per-instance configurations on the instance."
+ "description": "[Output Only] Status of per-instance configurations on the instances."
}
},
"type": "object"
@@ -49880,7 +52505,7 @@
"compute.instanceTemplates.insert"
]
},
- "description": "The machine type to use for instances that are created from these properties.",
+ "description": "The machine type to use for instances that are created from these properties. This field only accepts a machine type name, for example `n2-standard-4`. If you use the machine type full or partial URL, for example `projects/my-l7ilb-project/zones/us-central1-a/machineTypes/n2-standard-4`, the request will result in an `INTERNAL_ERROR`.",
"type": "string"
},
"metadata": {
@@ -49956,6 +52581,27 @@
},
"type": "object"
},
+ "InstancePropertiesPatch": {
+ "description": "Represents the change that you want to make to the instance properties.",
+ "id": "InstancePropertiesPatch",
+ "properties": {
+ "labels": {
+ "additionalProperties": {
+ "type": "string"
+ },
+ "description": "The label key-value pairs that you want to patch onto the instance.",
+ "type": "object"
+ },
+ "metadata": {
+ "additionalProperties": {
+ "type": "string"
+ },
+ "description": "The metadata key-value pairs that you want to patch onto the instance. For more information, see Project and instance metadata.",
+ "type": "object"
+ }
+ },
+ "type": "object"
+ },
"InstanceReference": {
"id": "InstanceReference",
"properties": {
@@ -49966,6 +52612,49 @@
},
"type": "object"
},
+ "InstanceSettings": {
+ "description": "Represents a Instance Settings resource. You can use instance settings to configure default settings for Compute Engine VM instances. For example, you can use it to configure default machine type of Compute Engine VM instances.",
+ "id": "InstanceSettings",
+ "properties": {
+ "fingerprint": {
+ "description": "Specifies a fingerprint for instance settings, which is essentially a hash of the instance settings resource's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update the instance settings resource. You must always provide an up-to-date fingerprint hash in order to update or change the resource, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the resource.",
+ "format": "byte",
+ "type": "string"
+ },
+ "kind": {
+ "default": "compute#instanceSettings",
+ "description": "[Output Only] Type of the resource. Always compute#instance_settings for instance settings.",
+ "type": "string"
+ },
+ "metadata": {
+ "$ref": "InstanceSettingsMetadata",
+ "description": "The metadata key/value pairs assigned to all the instances in the corresponding scope."
+ },
+ "zone": {
+ "description": "[Output Only] URL of the zone where the resource resides You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "InstanceSettingsMetadata": {
+ "id": "InstanceSettingsMetadata",
+ "properties": {
+ "items": {
+ "additionalProperties": {
+ "type": "string"
+ },
+ "description": "A metadata key/value items map. The total size of all keys and values must be less than 512KB.",
+ "type": "object"
+ },
+ "kind": {
+ "default": "compute#metadata",
+ "description": "[Output Only] Type of the resource. Always compute#metadata for metadata.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
"InstanceTemplate": {
"description": "Represents an Instance Template resource. Google Compute Engine has two Instance Template resources: * [Global](/compute/docs/reference/rest/v1/instanceTemplates) * [Regional](/compute/docs/reference/rest/v1/regionInstanceTemplates) You can reuse a global instance template in different regions whereas you can use a regional instance template in a specified region only. If you want to reduce cross-region dependency or achieve data residency, use a regional instance template. To create VMs, managed instance groups, and reservations, you can use either global or regional instance templates. For more information, read Instance Templates.",
"id": "InstanceTemplate",
@@ -50535,7 +53224,7 @@
"id": "InstancesGetEffectiveFirewallsResponse",
"properties": {
"firewallPolicys": {
- "description": "Effective firewalls from firewall policies.",
+ "description": "[Output Only] Effective firewalls from firewall policies.",
"items": {
"$ref": "InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy"
},
@@ -50563,8 +53252,13 @@
"description": "[Output Only] The name of the firewall policy.",
"type": "string"
},
+ "priority": {
+ "description": "[Output only] Priority of firewall policy association. Not applicable for type=HIERARCHY.",
+ "format": "int32",
+ "type": "integer"
+ },
"rules": {
- "description": "The rules that apply to the network.",
+ "description": "[Output Only] The rules that apply to the instance. Only rules that target the specific VM instance are returned if target service accounts or target secure tags are specified in the rules.",
"items": {
"$ref": "FirewallPolicyRule"
},
@@ -50575,14 +53269,18 @@
"type": "string"
},
"type": {
- "description": "[Output Only] The type of the firewall policy. Can be one of HIERARCHY, NETWORK, NETWORK_REGIONAL.",
+ "description": "[Output Only] The type of the firewall policy. Can be one of HIERARCHY, NETWORK, NETWORK_REGIONAL, SYSTEM_GLOBAL, SYSTEM_REGIONAL.",
"enum": [
"HIERARCHY",
"NETWORK",
"NETWORK_REGIONAL",
+ "SYSTEM_GLOBAL",
+ "SYSTEM_REGIONAL",
"UNSPECIFIED"
],
"enumDescriptions": [
+ "",
+ "",
"",
"",
"",
@@ -50851,76 +53549,35 @@
},
"type": "object"
},
- "Int64RangeMatch": {
- "description": "HttpRouteRuleMatch criteria for field values that must stay within the specified integer range.",
- "id": "Int64RangeMatch",
+ "InstantSnapshot": {
+ "description": "Represents a InstantSnapshot resource. You can use instant snapshots to create disk rollback points quickly..",
+ "id": "InstantSnapshot",
"properties": {
- "rangeEnd": {
- "description": "The end of the range (exclusive) in signed long integer format.",
- "format": "int64",
- "type": "string"
- },
- "rangeStart": {
- "description": "The start of the range (inclusive) in signed long integer format.",
- "format": "int64",
+ "architecture": {
+ "description": "[Output Only] The architecture of the instant snapshot. Valid values are ARM64 or X86_64.",
+ "enum": [
+ "ARCHITECTURE_UNSPECIFIED",
+ "ARM64",
+ "X86_64"
+ ],
+ "enumDescriptions": [
+ "Default value indicating Architecture is not set.",
+ "Machines with architecture ARM64",
+ "Machines with architecture X86_64"
+ ],
"type": "string"
- }
- },
- "type": "object"
- },
- "Interconnect": {
- "description": "Represents an Interconnect resource. An Interconnect resource is a dedicated connection between the Google Cloud network and your on-premises network. For more information, read the Dedicated Interconnect Overview.",
- "id": "Interconnect",
- "properties": {
- "adminEnabled": {
- "description": "Administrative status of the interconnect. When this is set to true, the Interconnect is functional and can carry traffic. When set to false, no packets can be carried over the interconnect and no BGP routes are exchanged over it. By default, the status is set to true.",
- "type": "boolean"
- },
- "availableFeatures": {
- "description": "[Output only] List of features available for this Interconnect connection, which can take one of the following values: - MACSEC If present then the Interconnect connection is provisioned on MACsec capable hardware ports. If not present then the Interconnect connection is provisioned on non-MACsec capable ports and MACsec isn't supported and enabling MACsec fails.",
- "items": {
- "enum": [
- "IF_MACSEC"
- ],
- "enumDescriptions": [
- "Media Access Control security (MACsec)"
- ],
- "type": "string"
- },
- "type": "array"
- },
- "circuitInfos": {
- "description": "[Output Only] A list of CircuitInfo objects, that describe the individual circuits in this LAG.",
- "items": {
- "$ref": "InterconnectCircuitInfo"
- },
- "type": "array"
},
"creationTimestamp": {
"description": "[Output Only] Creation timestamp in RFC3339 text format.",
"type": "string"
},
- "customerName": {
- "description": "Customer name, to put in the Letter of Authorization as the party authorized to request a crossconnect.",
- "type": "string"
- },
"description": {
"description": "An optional description of this resource. Provide this property when you create the resource.",
"type": "string"
},
- "expectedOutages": {
- "description": "[Output Only] A list of outages expected for this Interconnect.",
- "items": {
- "$ref": "InterconnectOutageNotification"
- },
- "type": "array"
- },
- "googleIpAddress": {
- "description": "[Output Only] IP address configured on the Google side of the Interconnect link. This can be used only for ping tests.",
- "type": "string"
- },
- "googleReferenceId": {
- "description": "[Output Only] Google reference ID to be used when raising support tickets with Google or otherwise to debug backend connectivity issues.",
+ "diskSizeGb": {
+ "description": "[Output Only] Size of the source disk, specified in GB.",
+ "format": "int64",
"type": "string"
},
"id": {
@@ -50928,34 +53585,13 @@
"format": "uint64",
"type": "string"
},
- "interconnectAttachments": {
- "description": "[Output Only] A list of the URLs of all InterconnectAttachments configured to use this Interconnect.",
- "items": {
- "type": "string"
- },
- "type": "array"
- },
- "interconnectType": {
- "description": "Type of interconnect, which can take one of the following values: - PARTNER: A partner-managed interconnection shared between customers though a partner. - DEDICATED: A dedicated physical interconnection with the customer. Note that a value IT_PRIVATE has been deprecated in favor of DEDICATED.",
- "enum": [
- "DEDICATED",
- "IT_PRIVATE",
- "PARTNER"
- ],
- "enumDescriptions": [
- "A dedicated physical interconnection with the customer.",
- "[Deprecated] A private, physical interconnection with the customer.",
- "A partner-managed interconnection shared between customers via partner."
- ],
- "type": "string"
- },
"kind": {
- "default": "compute#interconnect",
- "description": "[Output Only] Type of the resource. Always compute#interconnect for interconnects.",
+ "default": "compute#instantSnapshot",
+ "description": "[Output Only] Type of the resource. Always compute#instantSnapshot for InstantSnapshot resources.",
"type": "string"
},
"labelFingerprint": {
- "description": "A fingerprint for the labels being applied to this Interconnect, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve an Interconnect.",
+ "description": "A fingerprint for the labels being applied to this InstantSnapshot, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a InstantSnapshot.",
"format": "byte",
"type": "string"
},
@@ -50963,89 +53599,26 @@
"additionalProperties": {
"type": "string"
},
- "description": "Labels for this resource. These can only be added or modified by the setLabels method. Each label key/value pair must comply with RFC1035. Label values may be empty.",
+ "description": "Labels to apply to this InstantSnapshot. These can be later modified by the setLabels method. Label values may be empty.",
"type": "object"
},
- "linkType": {
- "description": "Type of link requested, which can take one of the following values: - LINK_TYPE_ETHERNET_10G_LR: A 10G Ethernet with LR optics - LINK_TYPE_ETHERNET_100G_LR: A 100G Ethernet with LR optics. Note that this field indicates the speed of each of the links in the bundle, not the speed of the entire bundle.",
- "enum": [
- "LINK_TYPE_ETHERNET_100G_LR",
- "LINK_TYPE_ETHERNET_10G_LR"
- ],
- "enumDescriptions": [
- "100G Ethernet, LR Optics.",
- "10G Ethernet, LR Optics. [(rate_bps) = 10000000000];"
- ],
- "type": "string"
- },
- "location": {
- "description": "URL of the InterconnectLocation object that represents where this connection is to be provisioned.",
- "type": "string"
- },
- "macsec": {
- "$ref": "InterconnectMacsec",
- "description": "Configuration that enables Media Access Control security (MACsec) on the Cloud Interconnect connection between Google and your on-premises router."
- },
- "macsecEnabled": {
- "description": "Enable or disable MACsec on this Interconnect connection. MACsec enablement fails if the MACsec object is not specified.",
- "type": "boolean"
- },
"name": {
- "annotations": {
- "required": [
- "compute.interconnects.insert"
- ]
- },
- "description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.",
+ "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.",
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
"type": "string"
},
- "nocContactEmail": {
- "description": "Email address to contact the customer NOC for operations and maintenance notifications regarding this Interconnect. If specified, this will be used for notifications in addition to all other forms described, such as Cloud Monitoring logs alerting and Cloud Notifications. This field is required for users who sign up for Cloud Interconnect using workforce identity federation.",
- "type": "string"
- },
- "operationalStatus": {
- "description": "[Output Only] The current status of this Interconnect's functionality, which can take one of the following values: - OS_ACTIVE: A valid Interconnect, which is turned up and is ready to use. Attachments may be provisioned on this Interconnect. - OS_UNPROVISIONED: An Interconnect that has not completed turnup. No attachments may be provisioned on this Interconnect. - OS_UNDER_MAINTENANCE: An Interconnect that is undergoing internal maintenance. No attachments may be provisioned or updated on this Interconnect. ",
- "enum": [
- "OS_ACTIVE",
- "OS_UNPROVISIONED"
- ],
- "enumDescriptions": [
- "The interconnect is valid, turned up, and ready to use. Attachments may be provisioned on this interconnect.",
- "The interconnect has not completed turnup. No attachments may be provisioned on this interconnect."
- ],
- "type": "string"
- },
- "peerIpAddress": {
- "description": "[Output Only] IP address configured on the customer side of the Interconnect link. The customer should configure this IP address during turnup when prompted by Google NOC. This can be used only for ping tests.",
- "type": "string"
- },
- "provisionedLinkCount": {
- "description": "[Output Only] Number of links actually provisioned in this interconnect.",
- "format": "int32",
- "type": "integer"
- },
- "remoteLocation": {
- "description": "Indicates that this is a Cross-Cloud Interconnect. This field specifies the location outside of Google's network that the interconnect is connected to.",
+ "region": {
+ "description": "[Output Only] URL of the region where the instant snapshot resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.",
"type": "string"
},
- "requestedFeatures": {
- "description": "Optional. List of features requested for this Interconnect connection, which can take one of the following values: - MACSEC If specified then the connection is created on MACsec capable hardware ports. If not specified, the default value is false, which allocates non-MACsec capable ports first if available. This parameter can be provided only with Interconnect INSERT. It isn't valid for Interconnect PATCH.",
- "items": {
- "enum": [
- "IF_MACSEC"
- ],
- "enumDescriptions": [
- "Media Access Control security (MACsec)"
- ],
- "type": "string"
- },
- "type": "array"
+ "resourceStatus": {
+ "$ref": "InstantSnapshotResourceStatus",
+ "description": "[Output Only] Status information for the instant snapshot resource."
},
- "requestedLinkCount": {
- "description": "Target number of physical links in the link bundle, as requested by the customer.",
- "format": "int32",
- "type": "integer"
+ "satisfiesPzi": {
+ "description": "Output only. Reserved for future use.",
+ "readOnly": true,
+ "type": "boolean"
},
"satisfiesPzs": {
"description": "[Output Only] Reserved for future use.",
@@ -51055,335 +53628,230 @@
"description": "[Output Only] Server-defined URL for the resource.",
"type": "string"
},
- "state": {
- "description": "[Output Only] The current state of Interconnect functionality, which can take one of the following values: - ACTIVE: The Interconnect is valid, turned up and ready to use. Attachments may be provisioned on this Interconnect. - UNPROVISIONED: The Interconnect has not completed turnup. No attachments may be provisioned on this Interconnect. - UNDER_MAINTENANCE: The Interconnect is undergoing internal maintenance. No attachments may be provisioned or updated on this Interconnect. ",
+ "selfLinkWithId": {
+ "description": "[Output Only] Server-defined URL for this resource's resource id.",
+ "type": "string"
+ },
+ "sourceDisk": {
+ "description": "URL of the source disk used to create this instant snapshot. Note that the source disk must be in the same zone/region as the instant snapshot to be created. This can be a full or valid partial URL. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - https://www.googleapis.com/compute/v1/projects/project/regions/region /disks/disk - projects/project/zones/zone/disks/disk - projects/project/regions/region/disks/disk - zones/zone/disks/disk - regions/region/disks/disk ",
+ "type": "string"
+ },
+ "sourceDiskId": {
+ "description": "[Output Only] The ID value of the disk used to create this InstantSnapshot. This value may be used to determine whether the InstantSnapshot was taken from the current or a previous instance of a given disk name.",
+ "type": "string"
+ },
+ "status": {
+ "description": "[Output Only] The status of the instantSnapshot. This can be CREATING, DELETING, FAILED, or READY.",
"enum": [
- "ACTIVE",
- "UNPROVISIONED"
+ "CREATING",
+ "DELETING",
+ "FAILED",
+ "READY",
+ "UNAVAILABLE"
],
"enumDescriptions": [
- "The interconnect is valid, turned up, and ready to use. Attachments may be provisioned on this interconnect.",
- "The interconnect has not completed turnup. No attachments may be provisioned on this interconnect."
+ "InstantSnapshot creation is in progress.",
+ "InstantSnapshot is currently being deleted.",
+ "InstantSnapshot creation failed.",
+ "InstantSnapshot has been created successfully.",
+ "InstantSnapshot is currently unavailable and cannot be used for Disk restoration"
],
"type": "string"
+ },
+ "zone": {
+ "description": "[Output Only] URL of the zone where the instant snapshot resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.",
+ "type": "string"
}
},
"type": "object"
},
- "InterconnectAttachment": {
- "description": "Represents an Interconnect Attachment (VLAN) resource. You can use Interconnect attachments (VLANS) to connect your Virtual Private Cloud networks to your on-premises networks through an Interconnect. For more information, read Creating VLAN Attachments.",
- "id": "InterconnectAttachment",
+ "InstantSnapshotAggregatedList": {
+ "id": "InstantSnapshotAggregatedList",
"properties": {
- "adminEnabled": {
- "description": "Determines whether this Attachment will carry packets. Not present for PARTNER_PROVIDER.",
- "type": "boolean"
- },
- "bandwidth": {
- "description": "Provisioned bandwidth capacity for the interconnect attachment. For attachments of type DEDICATED, the user can set the bandwidth. For attachments of type PARTNER, the Google Partner that is operating the interconnect must set the bandwidth. Output only for PARTNER type, mutable for PARTNER_PROVIDER and DEDICATED, and can take one of the following values: - BPS_50M: 50 Mbit/s - BPS_100M: 100 Mbit/s - BPS_200M: 200 Mbit/s - BPS_300M: 300 Mbit/s - BPS_400M: 400 Mbit/s - BPS_500M: 500 Mbit/s - BPS_1G: 1 Gbit/s - BPS_2G: 2 Gbit/s - BPS_5G: 5 Gbit/s - BPS_10G: 10 Gbit/s - BPS_20G: 20 Gbit/s - BPS_50G: 50 Gbit/s ",
- "enum": [
- "BPS_100M",
- "BPS_10G",
- "BPS_1G",
- "BPS_200M",
- "BPS_20G",
- "BPS_2G",
- "BPS_300M",
- "BPS_400M",
- "BPS_500M",
- "BPS_50G",
- "BPS_50M",
- "BPS_5G"
- ],
- "enumDescriptions": [
- "100 Mbit/s",
- "10 Gbit/s",
- "1 Gbit/s",
- "200 Mbit/s",
- "20 Gbit/s",
- "2 Gbit/s",
- "300 Mbit/s",
- "400 Mbit/s",
- "500 Mbit/s",
- "50 Gbit/s",
- "50 Mbit/s",
- "5 Gbit/s"
- ],
+ "id": {
+ "description": "[Output Only] Unique identifier for the resource; defined by the server.",
"type": "string"
},
- "candidateIpv6Subnets": {
- "description": "This field is not available.",
- "items": {
- "type": "string"
- },
- "type": "array"
- },
- "candidateSubnets": {
- "description": "Up to 16 candidate prefixes that can be used to restrict the allocation of cloudRouterIpAddress and customerRouterIpAddress for this attachment. All prefixes must be within link-local address space (169.254.0.0/16) and must be /29 or shorter (/28, /27, etc). Google will attempt to select an unused /29 from the supplied candidate prefix(es). The request will fail if all possible /29s are in use on Google's edge. If not supplied, Google will randomly select an unused /29 from all of link-local space.",
- "items": {
- "type": "string"
+ "items": {
+ "additionalProperties": {
+ "$ref": "InstantSnapshotsScopedList",
+ "description": "[Output Only] Name of the scope containing this set of instantSnapshots."
},
- "type": "array"
- },
- "cloudRouterIpAddress": {
- "description": "[Output Only] IPv4 address + prefix length to be configured on Cloud Router Interface for this interconnect attachment.",
- "type": "string"
- },
- "cloudRouterIpv6Address": {
- "description": "[Output Only] IPv6 address + prefix length to be configured on Cloud Router Interface for this interconnect attachment.",
- "type": "string"
+ "description": "A list of InstantSnapshotsScopedList resources.",
+ "type": "object"
},
- "cloudRouterIpv6InterfaceId": {
- "description": "This field is not available.",
+ "kind": {
+ "default": "compute#instantSnapshotAggregatedList",
+ "description": "[Output Only] Type of resource. Always compute#instantSnapshotAggregatedList for aggregated lists of instantSnapshots.",
"type": "string"
},
- "configurationConstraints": {
- "$ref": "InterconnectAttachmentConfigurationConstraints",
- "description": "[Output Only] Constraints for this attachment, if any. The attachment does not work if these constraints are not met."
- },
- "creationTimestamp": {
- "description": "[Output Only] Creation timestamp in RFC3339 text format.",
+ "nextPageToken": {
+ "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
"type": "string"
},
- "customerRouterIpAddress": {
- "description": "[Output Only] IPv4 address + prefix length to be configured on the customer router subinterface for this interconnect attachment.",
+ "selfLink": {
+ "description": "[Output Only] Server-defined URL for this resource.",
"type": "string"
},
- "customerRouterIpv6Address": {
- "description": "[Output Only] IPv6 address + prefix length to be configured on the customer router subinterface for this interconnect attachment.",
- "type": "string"
+ "unreachables": {
+ "description": "[Output Only] Unreachable resources.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
},
- "customerRouterIpv6InterfaceId": {
- "description": "This field is not available.",
+ "warning": {
+ "description": "[Output Only] Informational warning message.",
+ "properties": {
+ "code": {
+ "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.",
+ "enum": [
+ "CLEANUP_FAILED",
+ "DEPRECATED_RESOURCE_USED",
+ "DEPRECATED_TYPE_USED",
+ "DISK_SIZE_LARGER_THAN_IMAGE_SIZE",
+ "EXPERIMENTAL_TYPE_USED",
+ "EXTERNAL_API_WARNING",
+ "FIELD_VALUE_OVERRIDEN",
+ "INJECTED_KERNELS_DEPRECATED",
+ "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB",
+ "LARGE_DEPLOYMENT_WARNING",
+ "LIST_OVERHEAD_QUOTA_EXCEED",
+ "MISSING_TYPE_DEPENDENCY",
+ "NEXT_HOP_ADDRESS_NOT_ASSIGNED",
+ "NEXT_HOP_CANNOT_IP_FORWARD",
+ "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE",
+ "NEXT_HOP_INSTANCE_NOT_FOUND",
+ "NEXT_HOP_INSTANCE_NOT_ON_NETWORK",
+ "NEXT_HOP_NOT_RUNNING",
+ "NOT_CRITICAL_ERROR",
+ "NO_RESULTS_ON_PAGE",
+ "PARTIAL_SUCCESS",
+ "REQUIRED_TOS_AGREEMENT",
+ "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING",
+ "RESOURCE_NOT_DELETED",
+ "SCHEMA_VALIDATION_IGNORED",
+ "SINGLE_INSTANCE_PROPERTY_TEMPLATE",
+ "UNDECLARED_PROPERTIES",
+ "UNREACHABLE"
+ ],
+ "enumDeprecated": [
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ true,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false
+ ],
+ "enumDescriptions": [
+ "Warning about failed cleanup of transient changes made by a failed operation.",
+ "A link to a deprecated resource was created.",
+ "When deploying and at least one of the resources has a type marked as deprecated",
+ "The user created a boot disk that is larger than image size.",
+ "When deploying and at least one of the resources has a type marked as experimental",
+ "Warning that is present in an external api call",
+ "Warning that value of a field has been overridden. Deprecated unused field.",
+ "The operation involved use of an injected kernel, which is deprecated.",
+ "A WEIGHTED_MAGLEV backend service is associated with a health check that is not of type HTTP/HTTPS/HTTP2.",
+ "When deploying a deployment with a exceedingly large number of resources",
+ "Resource can't be retrieved due to list overhead quota exceed which captures the amount of resources filtered out by user-defined list filter.",
+ "A resource depends on a missing type",
+ "The route's nextHopIp address is not assigned to an instance on the network.",
+ "The route's next hop instance cannot ip forward.",
+ "The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route.",
+ "The route's nextHopInstance URL refers to an instance that does not exist.",
+ "The route's nextHopInstance URL refers to an instance that is not on the same network as the route.",
+ "The route's next hop instance does not have a status of RUNNING.",
+ "Error which is not critical. We decided to continue the process despite the mentioned error.",
+ "No results are present on a particular list page.",
+ "Success is reported, but some results may be missing due to errors",
+ "The user attempted to use a resource that requires a TOS they have not accepted.",
+ "Warning that a resource is in use.",
+ "One or more of the resources set to auto-delete could not be deleted because they were in use.",
+ "When a resource schema validation is ignored.",
+ "Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group.",
+ "When undeclared properties in the schema are present",
+ "A given scope cannot be reached."
+ ],
+ "type": "string"
+ },
+ "data": {
+ "description": "[Output Only] Metadata about this warning in key: value format. For example: \"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" } ",
+ "items": {
+ "properties": {
+ "key": {
+ "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).",
+ "type": "string"
+ },
+ "value": {
+ "description": "[Output Only] A warning data value corresponding to the key.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "type": "array"
+ },
+ "message": {
+ "description": "[Output Only] A human-readable description of the warning code.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ }
+ },
+ "type": "object"
+ },
+ "InstantSnapshotList": {
+ "description": "Contains a list of InstantSnapshot resources.",
+ "id": "InstantSnapshotList",
+ "properties": {
+ "id": {
+ "description": "[Output Only] Unique identifier for the resource; defined by the server.",
"type": "string"
},
- "dataplaneVersion": {
- "description": "[Output Only] Dataplane version for this InterconnectAttachment. This field is only present for Dataplane version 2 and higher. Absence of this field in the API output indicates that the Dataplane is version 1.",
- "format": "int32",
- "type": "integer"
- },
- "description": {
- "description": "An optional description of this resource.",
- "type": "string"
+ "items": {
+ "description": "A list of InstantSnapshot resources.",
+ "items": {
+ "$ref": "InstantSnapshot"
+ },
+ "type": "array"
},
- "edgeAvailabilityDomain": {
- "description": "Desired availability domain for the attachment. Only available for type PARTNER, at creation time, and can take one of the following values: - AVAILABILITY_DOMAIN_ANY - AVAILABILITY_DOMAIN_1 - AVAILABILITY_DOMAIN_2 For improved reliability, customers should configure a pair of attachments, one per availability domain. The selected availability domain will be provided to the Partner via the pairing key, so that the provisioned circuit will lie in the specified domain. If not specified, the value will default to AVAILABILITY_DOMAIN_ANY.",
- "enum": [
- "AVAILABILITY_DOMAIN_1",
- "AVAILABILITY_DOMAIN_2",
- "AVAILABILITY_DOMAIN_ANY"
- ],
- "enumDescriptions": [
- "",
- "",
- ""
- ],
+ "kind": {
+ "default": "compute#instantSnapshotList",
+ "description": "Type of resource.",
"type": "string"
},
- "encryption": {
- "description": "Indicates the user-supplied encryption option of this VLAN attachment (interconnectAttachment). Can only be specified at attachment creation for PARTNER or DEDICATED attachments. Possible values are: - NONE - This is the default value, which means that the VLAN attachment carries unencrypted traffic. VMs are able to send traffic to, or receive traffic from, such a VLAN attachment. - IPSEC - The VLAN attachment carries only encrypted traffic that is encrypted by an IPsec device, such as an HA VPN gateway or third-party IPsec VPN. VMs cannot directly send traffic to, or receive traffic from, such a VLAN attachment. To use *HA VPN over Cloud Interconnect*, the VLAN attachment must be created with this option. ",
- "enum": [
- "IPSEC",
- "NONE"
- ],
- "enumDescriptions": [
- "The interconnect attachment will carry only encrypted traffic that is encrypted by an IPsec device such as HA VPN gateway; VMs cannot directly send traffic to or receive traffic from such an interconnect attachment. To use HA VPN over Cloud Interconnect, the interconnect attachment must be created with this option.",
- "This is the default value, which means the Interconnect Attachment will carry unencrypted traffic. VMs will be able to send traffic to or receive traffic from such interconnect attachment."
- ],
+ "nextPageToken": {
+ "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
"type": "string"
},
- "googleReferenceId": {
- "deprecated": true,
- "description": "[Output Only] Google reference ID, to be used when raising support tickets with Google or otherwise to debug backend connectivity issues. [Deprecated] This field is not used.",
+ "selfLink": {
+ "description": "[Output Only] Server-defined URL for this resource.",
"type": "string"
},
- "id": {
- "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.",
- "format": "uint64",
- "type": "string"
- },
- "interconnect": {
- "description": "URL of the underlying Interconnect object that this attachment's traffic will traverse through.",
- "type": "string"
- },
- "ipsecInternalAddresses": {
- "description": "A list of URLs of addresses that have been reserved for the VLAN attachment. Used only for the VLAN attachment that has the encryption option as IPSEC. The addresses must be regional internal IP address ranges. When creating an HA VPN gateway over the VLAN attachment, if the attachment is configured to use a regional internal IP address, then the VPN gateway's IP address is allocated from the IP address range specified here. For example, if the HA VPN gateway's interface 0 is paired to this VLAN attachment, then a regional internal IP address for the VPN gateway interface 0 will be allocated from the IP address specified for this VLAN attachment. If this field is not specified when creating the VLAN attachment, then later on when creating an HA VPN gateway on this VLAN attachment, the HA VPN gateway's IP address is allocated from the regional external IP address pool.",
- "items": {
- "type": "string"
- },
- "type": "array"
- },
- "kind": {
- "default": "compute#interconnectAttachment",
- "description": "[Output Only] Type of the resource. Always compute#interconnectAttachment for interconnect attachments.",
- "type": "string"
- },
- "labelFingerprint": {
- "description": "A fingerprint for the labels being applied to this InterconnectAttachment, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve an InterconnectAttachment.",
- "format": "byte",
- "type": "string"
- },
- "labels": {
- "additionalProperties": {
- "type": "string"
- },
- "description": "Labels for this resource. These can only be added or modified by the setLabels method. Each label key/value pair must comply with RFC1035. Label values may be empty.",
- "type": "object"
- },
- "mtu": {
- "description": "Maximum Transmission Unit (MTU), in bytes, of packets passing through this interconnect attachment. Only 1440 and 1500 are allowed. If not specified, the value will default to 1440.",
- "format": "int32",
- "type": "integer"
- },
- "name": {
- "description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- "type": "string"
- },
- "operationalStatus": {
- "description": "[Output Only] The current status of whether or not this interconnect attachment is functional, which can take one of the following values: - OS_ACTIVE: The attachment has been turned up and is ready to use. - OS_UNPROVISIONED: The attachment is not ready to use yet, because turnup is not complete. ",
- "enum": [
- "OS_ACTIVE",
- "OS_UNPROVISIONED"
- ],
- "enumDescriptions": [
- "Indicates that attachment has been turned up and is ready to use.",
- "Indicates that attachment is not ready to use yet, because turnup is not complete."
- ],
- "type": "string"
- },
- "pairingKey": {
- "description": "[Output only for type PARTNER. Input only for PARTNER_PROVIDER. Not present for DEDICATED]. The opaque identifier of a PARTNER attachment used to initiate provisioning with a selected partner. Of the form \"XXXXX/region/domain\"",
- "type": "string"
- },
- "partnerAsn": {
- "description": "Optional BGP ASN for the router supplied by a Layer 3 Partner if they configured BGP on behalf of the customer. Output only for PARTNER type, input only for PARTNER_PROVIDER, not available for DEDICATED.",
- "format": "int64",
- "type": "string"
- },
- "partnerMetadata": {
- "$ref": "InterconnectAttachmentPartnerMetadata",
- "description": "Informational metadata about Partner attachments from Partners to display to customers. Output only for PARTNER type, mutable for PARTNER_PROVIDER, not available for DEDICATED."
- },
- "privateInterconnectInfo": {
- "$ref": "InterconnectAttachmentPrivateInfo",
- "description": "[Output Only] Information specific to an InterconnectAttachment. This property is populated if the interconnect that this is attached to is of type DEDICATED."
- },
- "region": {
- "description": "[Output Only] URL of the region where the regional interconnect attachment resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.",
- "type": "string"
- },
- "remoteService": {
- "description": "[Output Only] If the attachment is on a Cross-Cloud Interconnect connection, this field contains the interconnect's remote location service provider. Example values: \"Amazon Web Services\" \"Microsoft Azure\". The field is set only for attachments on Cross-Cloud Interconnect connections. Its value is copied from the InterconnectRemoteLocation remoteService field.",
- "type": "string"
- },
- "router": {
- "description": "URL of the Cloud Router to be used for dynamic routing. This router must be in the same region as this InterconnectAttachment. The InterconnectAttachment will automatically connect the Interconnect to the network \u0026 region within which the Cloud Router is configured.",
- "type": "string"
- },
- "satisfiesPzs": {
- "description": "[Output Only] Reserved for future use.",
- "type": "boolean"
- },
- "selfLink": {
- "description": "[Output Only] Server-defined URL for the resource.",
- "type": "string"
- },
- "stackType": {
- "description": "The stack type for this interconnect attachment to identify whether the IPv6 feature is enabled or not. If not specified, IPV4_ONLY will be used. This field can be both set at interconnect attachments creation and update interconnect attachment operations.",
- "enum": [
- "IPV4_IPV6",
- "IPV4_ONLY"
- ],
- "enumDescriptions": [
- "The interconnect attachment can have both IPv4 and IPv6 addresses.",
- "The interconnect attachment will only be assigned IPv4 addresses."
- ],
- "type": "string"
- },
- "state": {
- "description": "[Output Only] The current state of this attachment's functionality. Enum values ACTIVE and UNPROVISIONED are shared by DEDICATED/PRIVATE, PARTNER, and PARTNER_PROVIDER interconnect attachments, while enum values PENDING_PARTNER, PARTNER_REQUEST_RECEIVED, and PENDING_CUSTOMER are used for only PARTNER and PARTNER_PROVIDER interconnect attachments. This state can take one of the following values: - ACTIVE: The attachment has been turned up and is ready to use. - UNPROVISIONED: The attachment is not ready to use yet, because turnup is not complete. - PENDING_PARTNER: A newly-created PARTNER attachment that has not yet been configured on the Partner side. - PARTNER_REQUEST_RECEIVED: A PARTNER attachment is in the process of provisioning after a PARTNER_PROVIDER attachment was created that references it. - PENDING_CUSTOMER: A PARTNER or PARTNER_PROVIDER attachment that is waiting for a customer to activate it. - DEFUNCT: The attachment was deleted externally and is no longer functional. This could be because the associated Interconnect was removed, or because the other side of a Partner attachment was deleted. ",
- "enum": [
- "ACTIVE",
- "DEFUNCT",
- "PARTNER_REQUEST_RECEIVED",
- "PENDING_CUSTOMER",
- "PENDING_PARTNER",
- "STATE_UNSPECIFIED",
- "UNPROVISIONED"
- ],
- "enumDescriptions": [
- "Indicates that attachment has been turned up and is ready to use.",
- "The attachment was deleted externally and is no longer functional. This could be because the associated Interconnect was wiped out, or because the other side of a Partner attachment was deleted.",
- "A PARTNER attachment is in the process of provisioning after a PARTNER_PROVIDER attachment was created that references it.",
- "PARTNER or PARTNER_PROVIDER attachment that is waiting for the customer to activate.",
- "A newly created PARTNER attachment that has not yet been configured on the Partner side.",
- "",
- "Indicates that attachment is not ready to use yet, because turnup is not complete."
- ],
- "type": "string"
- },
- "subnetLength": {
- "description": "Length of the IPv4 subnet mask. Allowed values: - 29 (default) - 30 The default value is 29, except for Cross-Cloud Interconnect connections that use an InterconnectRemoteLocation with a constraints.subnetLengthRange.min equal to 30. For example, connections that use an Azure remote location fall into this category. In these cases, the default value is 30, and requesting 29 returns an error. Where both 29 and 30 are allowed, 29 is preferred, because it gives Google Cloud Support more debugging visibility. ",
- "format": "int32",
- "type": "integer"
- },
- "type": {
- "description": "The type of interconnect attachment this is, which can take one of the following values: - DEDICATED: an attachment to a Dedicated Interconnect. - PARTNER: an attachment to a Partner Interconnect, created by the customer. - PARTNER_PROVIDER: an attachment to a Partner Interconnect, created by the partner. ",
- "enum": [
- "DEDICATED",
- "PARTNER",
- "PARTNER_PROVIDER"
- ],
- "enumDescriptions": [
- "Attachment to a dedicated interconnect.",
- "Attachment to a partner interconnect, created by the customer.",
- "Attachment to a partner interconnect, created by the partner."
- ],
- "type": "string"
- },
- "vlanTag8021q": {
- "description": "The IEEE 802.1Q VLAN tag for this attachment, in the range 2-4093. Only specified at creation time.",
- "format": "int32",
- "type": "integer"
- }
- },
- "type": "object"
- },
- "InterconnectAttachmentAggregatedList": {
- "id": "InterconnectAttachmentAggregatedList",
- "properties": {
- "id": {
- "description": "[Output Only] Unique identifier for the resource; defined by the server.",
- "type": "string"
- },
- "items": {
- "additionalProperties": {
- "$ref": "InterconnectAttachmentsScopedList",
- "description": "Name of the scope containing this set of interconnect attachments."
- },
- "description": "A list of InterconnectAttachmentsScopedList resources.",
- "type": "object"
- },
- "kind": {
- "default": "compute#interconnectAttachmentAggregatedList",
- "description": "[Output Only] Type of resource. Always compute#interconnectAttachmentAggregatedList for aggregated lists of interconnect attachments.",
- "type": "string"
- },
- "nextPageToken": {
- "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
- "type": "string"
- },
- "selfLink": {
- "description": "[Output Only] Server-defined URL for this resource.",
- "type": "string"
- },
- "unreachables": {
- "description": "[Output Only] Unreachable resources.",
- "items": {
- "type": "string"
- },
- "type": "array"
- },
"warning": {
"description": "[Output Only] Informational warning message.",
"properties": {
@@ -51508,77 +53976,29 @@
},
"type": "object"
},
- "InterconnectAttachmentConfigurationConstraints": {
- "id": "InterconnectAttachmentConfigurationConstraints",
+ "InstantSnapshotResourceStatus": {
+ "id": "InstantSnapshotResourceStatus",
"properties": {
- "bgpMd5": {
- "description": "[Output Only] Whether the attachment's BGP session requires/allows/disallows BGP MD5 authentication. This can take one of the following values: MD5_OPTIONAL, MD5_REQUIRED, MD5_UNSUPPORTED. For example, a Cross-Cloud Interconnect connection to a remote cloud provider that requires BGP MD5 authentication has the interconnectRemoteLocation attachment_configuration_constraints.bgp_md5 field set to MD5_REQUIRED, and that property is propagated to the attachment. Similarly, if BGP MD5 is MD5_UNSUPPORTED, an error is returned if MD5 is requested.",
- "enum": [
- "MD5_OPTIONAL",
- "MD5_REQUIRED",
- "MD5_UNSUPPORTED"
- ],
- "enumDescriptions": [
- "MD5_OPTIONAL: BGP MD5 authentication is supported and can optionally be configured.",
- "MD5_REQUIRED: BGP MD5 authentication must be configured.",
- "MD5_UNSUPPORTED: BGP MD5 authentication must not be configured"
- ],
+ "storageSizeBytes": {
+ "description": "[Output Only] The storage size of this instant snapshot.",
+ "format": "int64",
"type": "string"
- },
- "bgpPeerAsnRanges": {
- "description": "[Output Only] List of ASN ranges that the remote location is known to support. Formatted as an array of inclusive ranges {min: min-value, max: max-value}. For example, [{min: 123, max: 123}, {min: 64512, max: 65534}] allows the peer ASN to be 123 or anything in the range 64512-65534. This field is only advisory. Although the API accepts other ranges, these are the ranges that we recommend.",
- "items": {
- "$ref": "InterconnectAttachmentConfigurationConstraintsBgpPeerASNRange"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "InterconnectAttachmentConfigurationConstraintsBgpPeerASNRange": {
- "id": "InterconnectAttachmentConfigurationConstraintsBgpPeerASNRange",
- "properties": {
- "max": {
- "format": "uint32",
- "type": "integer"
- },
- "min": {
- "format": "uint32",
- "type": "integer"
}
},
"type": "object"
},
- "InterconnectAttachmentList": {
- "description": "Response to the list request, and contains a list of interconnect attachments.",
- "id": "InterconnectAttachmentList",
+ "InstantSnapshotsScopedList": {
+ "id": "InstantSnapshotsScopedList",
"properties": {
- "id": {
- "description": "[Output Only] Unique identifier for the resource; defined by the server.",
- "type": "string"
- },
- "items": {
- "description": "A list of InterconnectAttachment resources.",
+ "instantSnapshots": {
+ "description": "[Output Only] A list of instantSnapshots contained in this scope.",
"items": {
- "$ref": "InterconnectAttachment"
+ "$ref": "InstantSnapshot"
},
"type": "array"
},
- "kind": {
- "default": "compute#interconnectAttachmentList",
- "description": "[Output Only] Type of resource. Always compute#interconnectAttachmentList for lists of interconnect attachments.",
- "type": "string"
- },
- "nextPageToken": {
- "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
- "type": "string"
- },
- "selfLink": {
- "description": "[Output Only] Server-defined URL for this resource.",
- "type": "string"
- },
"warning": {
- "description": "[Output Only] Informational warning message.",
+ "description": "[Output Only] Informational warning which replaces the list of instantSnapshots when the list is empty.",
"properties": {
"code": {
"description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.",
@@ -51701,390 +54121,522 @@
},
"type": "object"
},
- "InterconnectAttachmentPartnerMetadata": {
- "description": "Informational metadata about Partner attachments from Partners to display to customers. These fields are propagated from PARTNER_PROVIDER attachments to their corresponding PARTNER attachments.",
- "id": "InterconnectAttachmentPartnerMetadata",
+ "Int64RangeMatch": {
+ "description": "HttpRouteRuleMatch criteria for field values that must stay within the specified integer range.",
+ "id": "Int64RangeMatch",
"properties": {
- "interconnectName": {
- "description": "Plain text name of the Interconnect this attachment is connected to, as displayed in the Partner's portal. For instance \"Chicago 1\". This value may be validated to match approved Partner values.",
- "type": "string"
- },
- "partnerName": {
- "description": "Plain text name of the Partner providing this attachment. This value may be validated to match approved Partner values.",
+ "rangeEnd": {
+ "description": "The end of the range (exclusive) in signed long integer format.",
+ "format": "int64",
"type": "string"
},
- "portalUrl": {
- "description": "URL of the Partner's portal for this Attachment. Partners may customise this to be a deep link to the specific resource on the Partner portal. This value may be validated to match approved Partner values.",
+ "rangeStart": {
+ "description": "The start of the range (inclusive) in signed long integer format.",
+ "format": "int64",
"type": "string"
}
},
"type": "object"
},
- "InterconnectAttachmentPrivateInfo": {
- "description": "Information for an interconnect attachment when this belongs to an interconnect of type DEDICATED.",
- "id": "InterconnectAttachmentPrivateInfo",
- "properties": {
- "tag8021q": {
- "description": "[Output Only] 802.1q encapsulation tag to be used for traffic between Google and the customer, going to and from this network and region.",
- "format": "uint32",
- "type": "integer"
- }
- },
- "type": "object"
- },
- "InterconnectAttachmentsScopedList": {
- "id": "InterconnectAttachmentsScopedList",
+ "Interconnect": {
+ "description": "Represents an Interconnect resource. An Interconnect resource is a dedicated connection between the Google Cloud network and your on-premises network. For more information, read the Dedicated Interconnect Overview.",
+ "id": "Interconnect",
"properties": {
- "interconnectAttachments": {
- "description": "A list of interconnect attachments contained in this scope.",
+ "adminEnabled": {
+ "description": "Administrative status of the interconnect. When this is set to true, the Interconnect is functional and can carry traffic. When set to false, no packets can be carried over the interconnect and no BGP routes are exchanged over it. By default, the status is set to true.",
+ "type": "boolean"
+ },
+ "availableFeatures": {
+ "description": "[Output only] List of features available for this Interconnect connection, which can take one of the following values: - IF_MACSEC If present then the Interconnect connection is provisioned on MACsec capable hardware ports. If not present then the Interconnect connection is provisioned on non-MACsec capable ports and MACsec isn't supported and enabling MACsec fails.",
"items": {
- "$ref": "InterconnectAttachment"
+ "enum": [
+ "IF_MACSEC"
+ ],
+ "enumDescriptions": [
+ "Media Access Control security (MACsec)"
+ ],
+ "type": "string"
},
"type": "array"
},
- "warning": {
- "description": "Informational warning which replaces the list of addresses when the list is empty.",
- "properties": {
- "code": {
- "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.",
- "enum": [
- "CLEANUP_FAILED",
- "DEPRECATED_RESOURCE_USED",
- "DEPRECATED_TYPE_USED",
- "DISK_SIZE_LARGER_THAN_IMAGE_SIZE",
- "EXPERIMENTAL_TYPE_USED",
- "EXTERNAL_API_WARNING",
- "FIELD_VALUE_OVERRIDEN",
- "INJECTED_KERNELS_DEPRECATED",
- "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB",
- "LARGE_DEPLOYMENT_WARNING",
- "LIST_OVERHEAD_QUOTA_EXCEED",
- "MISSING_TYPE_DEPENDENCY",
- "NEXT_HOP_ADDRESS_NOT_ASSIGNED",
- "NEXT_HOP_CANNOT_IP_FORWARD",
- "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE",
- "NEXT_HOP_INSTANCE_NOT_FOUND",
- "NEXT_HOP_INSTANCE_NOT_ON_NETWORK",
- "NEXT_HOP_NOT_RUNNING",
- "NOT_CRITICAL_ERROR",
- "NO_RESULTS_ON_PAGE",
- "PARTIAL_SUCCESS",
- "REQUIRED_TOS_AGREEMENT",
- "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING",
- "RESOURCE_NOT_DELETED",
- "SCHEMA_VALIDATION_IGNORED",
- "SINGLE_INSTANCE_PROPERTY_TEMPLATE",
- "UNDECLARED_PROPERTIES",
- "UNREACHABLE"
- ],
- "enumDeprecated": [
- false,
- false,
- false,
- false,
- false,
- false,
- true,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false
- ],
- "enumDescriptions": [
- "Warning about failed cleanup of transient changes made by a failed operation.",
- "A link to a deprecated resource was created.",
- "When deploying and at least one of the resources has a type marked as deprecated",
- "The user created a boot disk that is larger than image size.",
- "When deploying and at least one of the resources has a type marked as experimental",
- "Warning that is present in an external api call",
- "Warning that value of a field has been overridden. Deprecated unused field.",
- "The operation involved use of an injected kernel, which is deprecated.",
- "A WEIGHTED_MAGLEV backend service is associated with a health check that is not of type HTTP/HTTPS/HTTP2.",
- "When deploying a deployment with a exceedingly large number of resources",
- "Resource can't be retrieved due to list overhead quota exceed which captures the amount of resources filtered out by user-defined list filter.",
- "A resource depends on a missing type",
- "The route's nextHopIp address is not assigned to an instance on the network.",
- "The route's next hop instance cannot ip forward.",
- "The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route.",
- "The route's nextHopInstance URL refers to an instance that does not exist.",
- "The route's nextHopInstance URL refers to an instance that is not on the same network as the route.",
- "The route's next hop instance does not have a status of RUNNING.",
- "Error which is not critical. We decided to continue the process despite the mentioned error.",
- "No results are present on a particular list page.",
- "Success is reported, but some results may be missing due to errors",
- "The user attempted to use a resource that requires a TOS they have not accepted.",
- "Warning that a resource is in use.",
- "One or more of the resources set to auto-delete could not be deleted because they were in use.",
- "When a resource schema validation is ignored.",
- "Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group.",
- "When undeclared properties in the schema are present",
- "A given scope cannot be reached."
- ],
- "type": "string"
- },
- "data": {
- "description": "[Output Only] Metadata about this warning in key: value format. For example: \"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" } ",
- "items": {
- "properties": {
- "key": {
- "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).",
- "type": "string"
- },
- "value": {
- "description": "[Output Only] A warning data value corresponding to the key.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "type": "array"
- },
- "message": {
- "description": "[Output Only] A human-readable description of the warning code.",
- "type": "string"
- }
+ "circuitInfos": {
+ "description": "[Output Only] A list of CircuitInfo objects, that describe the individual circuits in this LAG.",
+ "items": {
+ "$ref": "InterconnectCircuitInfo"
},
- "type": "object"
- }
- },
- "type": "object"
- },
- "InterconnectCircuitInfo": {
- "description": "Describes a single physical circuit between the Customer and Google. CircuitInfo objects are created by Google, so all fields are output only.",
- "id": "InterconnectCircuitInfo",
- "properties": {
- "customerDemarcId": {
- "description": "Customer-side demarc ID for this circuit.",
+ "type": "array"
+ },
+ "creationTimestamp": {
+ "description": "[Output Only] Creation timestamp in RFC3339 text format.",
"type": "string"
},
- "googleCircuitId": {
- "description": "Google-assigned unique ID for this circuit. Assigned at circuit turn-up.",
+ "customerName": {
+ "description": "Customer name, to put in the Letter of Authorization as the party authorized to request a crossconnect.",
"type": "string"
},
- "googleDemarcId": {
- "description": "Google-side demarc ID for this circuit. Assigned at circuit turn-up and provided by Google to the customer in the LOA.",
+ "description": {
+ "description": "An optional description of this resource. Provide this property when you create the resource.",
"type": "string"
- }
- },
- "type": "object"
- },
- "InterconnectDiagnostics": {
- "description": "Diagnostics information about the Interconnect connection, which contains detailed and current technical information about Google's side of the connection.",
- "id": "InterconnectDiagnostics",
- "properties": {
- "arpCaches": {
- "description": "A list of InterconnectDiagnostics.ARPEntry objects, describing individual neighbors currently seen by the Google router in the ARP cache for the Interconnect. This will be empty when the Interconnect is not bundled.",
+ },
+ "expectedOutages": {
+ "description": "[Output Only] A list of outages expected for this Interconnect.",
"items": {
- "$ref": "InterconnectDiagnosticsARPEntry"
+ "$ref": "InterconnectOutageNotification"
},
"type": "array"
},
- "bundleAggregationType": {
- "description": "The aggregation type of the bundle interface.",
- "enum": [
- "BUNDLE_AGGREGATION_TYPE_LACP",
- "BUNDLE_AGGREGATION_TYPE_STATIC"
- ],
- "enumDescriptions": [
- "LACP is enabled.",
- "LACP is disabled."
- ],
+ "googleIpAddress": {
+ "description": "[Output Only] IP address configured on the Google side of the Interconnect link. This can be used only for ping tests.",
"type": "string"
},
- "bundleOperationalStatus": {
- "description": "The operational status of the bundle interface.",
- "enum": [
- "BUNDLE_OPERATIONAL_STATUS_DOWN",
- "BUNDLE_OPERATIONAL_STATUS_UP"
- ],
- "enumDescriptions": [
- "If bundleAggregationType is LACP: LACP is not established and/or all links in the bundle have DOWN operational status. If bundleAggregationType is STATIC: one or more links in the bundle has DOWN operational status.",
- "If bundleAggregationType is LACP: LACP is established and at least one link in the bundle has UP operational status. If bundleAggregationType is STATIC: all links in the bundle (typically just one) have UP operational status."
- ],
+ "googleReferenceId": {
+ "description": "[Output Only] Google reference ID to be used when raising support tickets with Google or otherwise to debug backend connectivity issues.",
"type": "string"
},
- "links": {
- "description": "A list of InterconnectDiagnostics.LinkStatus objects, describing the status for each link on the Interconnect.",
+ "id": {
+ "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.",
+ "format": "uint64",
+ "type": "string"
+ },
+ "interconnectAttachments": {
+ "description": "[Output Only] A list of the URLs of all InterconnectAttachments configured to use this Interconnect.",
"items": {
- "$ref": "InterconnectDiagnosticsLinkStatus"
+ "type": "string"
},
"type": "array"
},
- "macAddress": {
- "description": "The MAC address of the Interconnect's bundle interface.",
+ "interconnectType": {
+ "description": "Type of interconnect, which can take one of the following values: - PARTNER: A partner-managed interconnection shared between customers though a partner. - DEDICATED: A dedicated physical interconnection with the customer. Note that a value IT_PRIVATE has been deprecated in favor of DEDICATED.",
+ "enum": [
+ "DEDICATED",
+ "IT_PRIVATE",
+ "PARTNER"
+ ],
+ "enumDescriptions": [
+ "A dedicated physical interconnection with the customer.",
+ "[Deprecated] A private, physical interconnection with the customer.",
+ "A partner-managed interconnection shared between customers via partner."
+ ],
"type": "string"
- }
- },
- "type": "object"
- },
- "InterconnectDiagnosticsARPEntry": {
- "description": "Describing the ARP neighbor entries seen on this link",
- "id": "InterconnectDiagnosticsARPEntry",
- "properties": {
- "ipAddress": {
- "description": "The IP address of this ARP neighbor.",
+ },
+ "kind": {
+ "default": "compute#interconnect",
+ "description": "[Output Only] Type of the resource. Always compute#interconnect for interconnects.",
"type": "string"
},
- "macAddress": {
- "description": "The MAC address of this ARP neighbor.",
+ "labelFingerprint": {
+ "description": "A fingerprint for the labels being applied to this Interconnect, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve an Interconnect.",
+ "format": "byte",
"type": "string"
- }
- },
- "type": "object"
- },
- "InterconnectDiagnosticsLinkLACPStatus": {
- "id": "InterconnectDiagnosticsLinkLACPStatus",
- "properties": {
- "googleSystemId": {
- "description": "System ID of the port on Google's side of the LACP exchange.",
+ },
+ "labels": {
+ "additionalProperties": {
+ "type": "string"
+ },
+ "description": "Labels for this resource. These can only be added or modified by the setLabels method. Each label key/value pair must comply with RFC1035. Label values may be empty.",
+ "type": "object"
+ },
+ "linkType": {
+ "description": "Type of link requested, which can take one of the following values: - LINK_TYPE_ETHERNET_10G_LR: A 10G Ethernet with LR optics - LINK_TYPE_ETHERNET_100G_LR: A 100G Ethernet with LR optics. Note that this field indicates the speed of each of the links in the bundle, not the speed of the entire bundle.",
+ "enum": [
+ "LINK_TYPE_ETHERNET_100G_LR",
+ "LINK_TYPE_ETHERNET_10G_LR"
+ ],
+ "enumDescriptions": [
+ "100G Ethernet, LR Optics.",
+ "10G Ethernet, LR Optics. [(rate_bps) = 10000000000];"
+ ],
"type": "string"
},
- "neighborSystemId": {
- "description": "System ID of the port on the neighbor's side of the LACP exchange.",
+ "location": {
+ "description": "URL of the InterconnectLocation object that represents where this connection is to be provisioned.",
+ "type": "string"
+ },
+ "macsec": {
+ "$ref": "InterconnectMacsec",
+ "description": "Configuration that enables Media Access Control security (MACsec) on the Cloud Interconnect connection between Google and your on-premises router."
+ },
+ "macsecEnabled": {
+ "description": "Enable or disable MACsec on this Interconnect connection. MACsec enablement fails if the MACsec object is not specified.",
+ "type": "boolean"
+ },
+ "name": {
+ "annotations": {
+ "required": [
+ "compute.interconnects.insert"
+ ]
+ },
+ "description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "type": "string"
+ },
+ "nocContactEmail": {
+ "description": "Email address to contact the customer NOC for operations and maintenance notifications regarding this Interconnect. If specified, this will be used for notifications in addition to all other forms described, such as Cloud Monitoring logs alerting and Cloud Notifications. This field is required for users who sign up for Cloud Interconnect using workforce identity federation.",
+ "type": "string"
+ },
+ "operationalStatus": {
+ "description": "[Output Only] The current status of this Interconnect's functionality, which can take one of the following values: - OS_ACTIVE: A valid Interconnect, which is turned up and is ready to use. Attachments may be provisioned on this Interconnect. - OS_UNPROVISIONED: An Interconnect that has not completed turnup. No attachments may be provisioned on this Interconnect. - OS_UNDER_MAINTENANCE: An Interconnect that is undergoing internal maintenance. No attachments may be provisioned or updated on this Interconnect. ",
+ "enum": [
+ "OS_ACTIVE",
+ "OS_UNPROVISIONED"
+ ],
+ "enumDescriptions": [
+ "The interconnect is valid, turned up, and ready to use. Attachments may be provisioned on this interconnect.",
+ "The interconnect has not completed turnup. No attachments may be provisioned on this interconnect."
+ ],
+ "type": "string"
+ },
+ "peerIpAddress": {
+ "description": "[Output Only] IP address configured on the customer side of the Interconnect link. The customer should configure this IP address during turnup when prompted by Google NOC. This can be used only for ping tests.",
+ "type": "string"
+ },
+ "provisionedLinkCount": {
+ "description": "[Output Only] Number of links actually provisioned in this interconnect.",
+ "format": "int32",
+ "type": "integer"
+ },
+ "remoteLocation": {
+ "description": "Indicates that this is a Cross-Cloud Interconnect. This field specifies the location outside of Google's network that the interconnect is connected to.",
+ "type": "string"
+ },
+ "requestedFeatures": {
+ "description": "Optional. List of features requested for this Interconnect connection, which can take one of the following values: - IF_MACSEC If specified then the connection is created on MACsec capable hardware ports. If not specified, the default value is false, which allocates non-MACsec capable ports first if available. This parameter can be provided only with Interconnect INSERT. It isn't valid for Interconnect PATCH.",
+ "items": {
+ "enum": [
+ "IF_MACSEC"
+ ],
+ "enumDescriptions": [
+ "Media Access Control security (MACsec)"
+ ],
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "requestedLinkCount": {
+ "description": "Target number of physical links in the link bundle, as requested by the customer.",
+ "format": "int32",
+ "type": "integer"
+ },
+ "satisfiesPzs": {
+ "description": "[Output Only] Reserved for future use.",
+ "type": "boolean"
+ },
+ "selfLink": {
+ "description": "[Output Only] Server-defined URL for the resource.",
"type": "string"
},
"state": {
- "description": "The state of a LACP link, which can take one of the following values: - ACTIVE: The link is configured and active within the bundle. - DETACHED: The link is not configured within the bundle. This means that the rest of the object should be empty. ",
+ "description": "[Output Only] The current state of Interconnect functionality, which can take one of the following values: - ACTIVE: The Interconnect is valid, turned up and ready to use. Attachments may be provisioned on this Interconnect. - UNPROVISIONED: The Interconnect has not completed turnup. No attachments may be provisioned on this Interconnect. - UNDER_MAINTENANCE: The Interconnect is undergoing internal maintenance. No attachments may be provisioned or updated on this Interconnect. ",
"enum": [
"ACTIVE",
- "DETACHED"
+ "UNPROVISIONED"
],
"enumDescriptions": [
- "The link is configured and active within the bundle.",
- "The link is not configured within the bundle, this means the rest of the object should be empty."
+ "The interconnect is valid, turned up, and ready to use. Attachments may be provisioned on this interconnect.",
+ "The interconnect has not completed turnup. No attachments may be provisioned on this interconnect."
],
"type": "string"
}
},
"type": "object"
},
- "InterconnectDiagnosticsLinkOpticalPower": {
- "id": "InterconnectDiagnosticsLinkOpticalPower",
+ "InterconnectAttachment": {
+ "description": "Represents an Interconnect Attachment (VLAN) resource. You can use Interconnect attachments (VLANS) to connect your Virtual Private Cloud networks to your on-premises networks through an Interconnect. For more information, read Creating VLAN Attachments.",
+ "id": "InterconnectAttachment",
"properties": {
- "state": {
- "description": "The status of the current value when compared to the warning and alarm levels for the receiving or transmitting transceiver. Possible states include: - OK: The value has not crossed a warning threshold. - LOW_WARNING: The value has crossed below the low warning threshold. - HIGH_WARNING: The value has crossed above the high warning threshold. - LOW_ALARM: The value has crossed below the low alarm threshold. - HIGH_ALARM: The value has crossed above the high alarm threshold. ",
+ "adminEnabled": {
+ "description": "Determines whether this Attachment will carry packets. Not present for PARTNER_PROVIDER.",
+ "type": "boolean"
+ },
+ "bandwidth": {
+ "description": "Provisioned bandwidth capacity for the interconnect attachment. For attachments of type DEDICATED, the user can set the bandwidth. For attachments of type PARTNER, the Google Partner that is operating the interconnect must set the bandwidth. Output only for PARTNER type, mutable for PARTNER_PROVIDER and DEDICATED, and can take one of the following values: - BPS_50M: 50 Mbit/s - BPS_100M: 100 Mbit/s - BPS_200M: 200 Mbit/s - BPS_300M: 300 Mbit/s - BPS_400M: 400 Mbit/s - BPS_500M: 500 Mbit/s - BPS_1G: 1 Gbit/s - BPS_2G: 2 Gbit/s - BPS_5G: 5 Gbit/s - BPS_10G: 10 Gbit/s - BPS_20G: 20 Gbit/s - BPS_50G: 50 Gbit/s ",
"enum": [
- "HIGH_ALARM",
- "HIGH_WARNING",
- "LOW_ALARM",
- "LOW_WARNING",
- "OK"
+ "BPS_100M",
+ "BPS_10G",
+ "BPS_1G",
+ "BPS_200M",
+ "BPS_20G",
+ "BPS_2G",
+ "BPS_300M",
+ "BPS_400M",
+ "BPS_500M",
+ "BPS_50G",
+ "BPS_50M",
+ "BPS_5G"
],
"enumDescriptions": [
- "The value has crossed above the high alarm threshold.",
- "The value of the current optical power has crossed above the high warning threshold.",
- "The value of the current optical power has crossed below the low alarm threshold.",
- "The value of the current optical power has crossed below the low warning threshold.",
- "The value of the current optical power has not crossed a warning threshold."
+ "100 Mbit/s",
+ "10 Gbit/s",
+ "1 Gbit/s",
+ "200 Mbit/s",
+ "20 Gbit/s",
+ "2 Gbit/s",
+ "300 Mbit/s",
+ "400 Mbit/s",
+ "500 Mbit/s",
+ "50 Gbit/s",
+ "50 Mbit/s",
+ "5 Gbit/s"
],
"type": "string"
},
- "value": {
- "description": "Value of the current receiving or transmitting optical power, read in dBm. Take a known good optical value, give it a 10% margin and trigger warnings relative to that value. In general, a -7dBm warning and a -11dBm alarm are good optical value estimates for most links.",
- "format": "float",
- "type": "number"
- }
- },
- "type": "object"
- },
- "InterconnectDiagnosticsLinkStatus": {
- "id": "InterconnectDiagnosticsLinkStatus",
- "properties": {
- "arpCaches": {
- "description": "A list of InterconnectDiagnostics.ARPEntry objects, describing the ARP neighbor entries seen on this link. This will be empty if the link is bundled",
+ "candidateIpv6Subnets": {
+ "description": "This field is not available.",
"items": {
- "$ref": "InterconnectDiagnosticsARPEntry"
+ "type": "string"
},
"type": "array"
},
- "circuitId": {
- "description": "The unique ID for this link assigned during turn up by Google.",
+ "candidateSubnets": {
+ "description": "Up to 16 candidate prefixes that can be used to restrict the allocation of cloudRouterIpAddress and customerRouterIpAddress for this attachment. All prefixes must be within link-local address space (169.254.0.0/16) and must be /29 or shorter (/28, /27, etc). Google will attempt to select an unused /29 from the supplied candidate prefix(es). The request will fail if all possible /29s are in use on Google's edge. If not supplied, Google will randomly select an unused /29 from all of link-local space.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "cloudRouterIpAddress": {
+ "description": "[Output Only] IPv4 address + prefix length to be configured on Cloud Router Interface for this interconnect attachment.",
"type": "string"
},
- "googleDemarc": {
- "description": "The Demarc address assigned by Google and provided in the LoA.",
+ "cloudRouterIpv6Address": {
+ "description": "[Output Only] IPv6 address + prefix length to be configured on Cloud Router Interface for this interconnect attachment.",
"type": "string"
},
- "lacpStatus": {
- "$ref": "InterconnectDiagnosticsLinkLACPStatus"
+ "cloudRouterIpv6InterfaceId": {
+ "description": "This field is not available.",
+ "type": "string"
},
- "macsec": {
- "$ref": "InterconnectDiagnosticsMacsecStatus",
- "description": "Describes the status of MACsec encryption on this link."
+ "configurationConstraints": {
+ "$ref": "InterconnectAttachmentConfigurationConstraints",
+ "description": "[Output Only] Constraints for this attachment, if any. The attachment does not work if these constraints are not met."
+ },
+ "creationTimestamp": {
+ "description": "[Output Only] Creation timestamp in RFC3339 text format.",
+ "type": "string"
+ },
+ "customerRouterIpAddress": {
+ "description": "[Output Only] IPv4 address + prefix length to be configured on the customer router subinterface for this interconnect attachment.",
+ "type": "string"
+ },
+ "customerRouterIpv6Address": {
+ "description": "[Output Only] IPv6 address + prefix length to be configured on the customer router subinterface for this interconnect attachment.",
+ "type": "string"
+ },
+ "customerRouterIpv6InterfaceId": {
+ "description": "This field is not available.",
+ "type": "string"
+ },
+ "dataplaneVersion": {
+ "description": "[Output Only] Dataplane version for this InterconnectAttachment. This field is only present for Dataplane version 2 and higher. Absence of this field in the API output indicates that the Dataplane is version 1.",
+ "format": "int32",
+ "type": "integer"
+ },
+ "description": {
+ "description": "An optional description of this resource.",
+ "type": "string"
+ },
+ "edgeAvailabilityDomain": {
+ "description": "Desired availability domain for the attachment. Only available for type PARTNER, at creation time, and can take one of the following values: - AVAILABILITY_DOMAIN_ANY - AVAILABILITY_DOMAIN_1 - AVAILABILITY_DOMAIN_2 For improved reliability, customers should configure a pair of attachments, one per availability domain. The selected availability domain will be provided to the Partner via the pairing key, so that the provisioned circuit will lie in the specified domain. If not specified, the value will default to AVAILABILITY_DOMAIN_ANY.",
+ "enum": [
+ "AVAILABILITY_DOMAIN_1",
+ "AVAILABILITY_DOMAIN_2",
+ "AVAILABILITY_DOMAIN_ANY"
+ ],
+ "enumDescriptions": [
+ "",
+ "",
+ ""
+ ],
+ "type": "string"
+ },
+ "encryption": {
+ "description": "Indicates the user-supplied encryption option of this VLAN attachment (interconnectAttachment). Can only be specified at attachment creation for PARTNER or DEDICATED attachments. Possible values are: - NONE - This is the default value, which means that the VLAN attachment carries unencrypted traffic. VMs are able to send traffic to, or receive traffic from, such a VLAN attachment. - IPSEC - The VLAN attachment carries only encrypted traffic that is encrypted by an IPsec device, such as an HA VPN gateway or third-party IPsec VPN. VMs cannot directly send traffic to, or receive traffic from, such a VLAN attachment. To use *HA VPN over Cloud Interconnect*, the VLAN attachment must be created with this option. ",
+ "enum": [
+ "IPSEC",
+ "NONE"
+ ],
+ "enumDescriptions": [
+ "The interconnect attachment will carry only encrypted traffic that is encrypted by an IPsec device such as HA VPN gateway; VMs cannot directly send traffic to or receive traffic from such an interconnect attachment. To use HA VPN over Cloud Interconnect, the interconnect attachment must be created with this option.",
+ "This is the default value, which means the Interconnect Attachment will carry unencrypted traffic. VMs will be able to send traffic to or receive traffic from such interconnect attachment."
+ ],
+ "type": "string"
+ },
+ "googleReferenceId": {
+ "deprecated": true,
+ "description": "[Output Only] Google reference ID, to be used when raising support tickets with Google or otherwise to debug backend connectivity issues. [Deprecated] This field is not used.",
+ "type": "string"
+ },
+ "id": {
+ "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.",
+ "format": "uint64",
+ "type": "string"
+ },
+ "interconnect": {
+ "description": "URL of the underlying Interconnect object that this attachment's traffic will traverse through.",
+ "type": "string"
+ },
+ "ipsecInternalAddresses": {
+ "description": "A list of URLs of addresses that have been reserved for the VLAN attachment. Used only for the VLAN attachment that has the encryption option as IPSEC. The addresses must be regional internal IP address ranges. When creating an HA VPN gateway over the VLAN attachment, if the attachment is configured to use a regional internal IP address, then the VPN gateway's IP address is allocated from the IP address range specified here. For example, if the HA VPN gateway's interface 0 is paired to this VLAN attachment, then a regional internal IP address for the VPN gateway interface 0 will be allocated from the IP address specified for this VLAN attachment. If this field is not specified when creating the VLAN attachment, then later on when creating an HA VPN gateway on this VLAN attachment, the HA VPN gateway's IP address is allocated from the regional external IP address pool.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "kind": {
+ "default": "compute#interconnectAttachment",
+ "description": "[Output Only] Type of the resource. Always compute#interconnectAttachment for interconnect attachments.",
+ "type": "string"
+ },
+ "labelFingerprint": {
+ "description": "A fingerprint for the labels being applied to this InterconnectAttachment, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve an InterconnectAttachment.",
+ "format": "byte",
+ "type": "string"
+ },
+ "labels": {
+ "additionalProperties": {
+ "type": "string"
+ },
+ "description": "Labels for this resource. These can only be added or modified by the setLabels method. Each label key/value pair must comply with RFC1035. Label values may be empty.",
+ "type": "object"
+ },
+ "mtu": {
+ "description": "Maximum Transmission Unit (MTU), in bytes, of packets passing through this interconnect attachment. Only 1440 and 1500 are allowed. If not specified, the value will default to 1440.",
+ "format": "int32",
+ "type": "integer"
+ },
+ "name": {
+ "description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "type": "string"
},
"operationalStatus": {
- "description": "The operational status of the link.",
+ "description": "[Output Only] The current status of whether or not this interconnect attachment is functional, which can take one of the following values: - OS_ACTIVE: The attachment has been turned up and is ready to use. - OS_UNPROVISIONED: The attachment is not ready to use yet, because turnup is not complete. ",
"enum": [
- "LINK_OPERATIONAL_STATUS_DOWN",
- "LINK_OPERATIONAL_STATUS_UP"
+ "OS_ACTIVE",
+ "OS_UNPROVISIONED"
],
"enumDescriptions": [
- "The interface is unable to communicate with the remote end.",
- "The interface has low level communication with the remote end."
+ "Indicates that attachment has been turned up and is ready to use.",
+ "Indicates that attachment is not ready to use yet, because turnup is not complete."
],
"type": "string"
},
- "receivingOpticalPower": {
- "$ref": "InterconnectDiagnosticsLinkOpticalPower",
- "description": "An InterconnectDiagnostics.LinkOpticalPower object, describing the current value and status of the received light level."
+ "pairingKey": {
+ "description": "[Output only for type PARTNER. Input only for PARTNER_PROVIDER. Not present for DEDICATED]. The opaque identifier of a PARTNER attachment used to initiate provisioning with a selected partner. Of the form \"XXXXX/region/domain\"",
+ "type": "string"
},
- "transmittingOpticalPower": {
- "$ref": "InterconnectDiagnosticsLinkOpticalPower",
- "description": "An InterconnectDiagnostics.LinkOpticalPower object, describing the current value and status of the transmitted light level."
- }
- },
- "type": "object"
- },
- "InterconnectDiagnosticsMacsecStatus": {
- "description": "Describes the status of MACsec encryption on the link.",
- "id": "InterconnectDiagnosticsMacsecStatus",
- "properties": {
- "ckn": {
- "description": "Indicates the Connectivity Association Key Name (CKN) currently being used if MACsec is operational.",
+ "partnerAsn": {
+ "description": "Optional BGP ASN for the router supplied by a Layer 3 Partner if they configured BGP on behalf of the customer. Output only for PARTNER type, input only for PARTNER_PROVIDER, not available for DEDICATED.",
+ "format": "int64",
"type": "string"
},
- "operational": {
- "description": "Indicates whether or not MACsec is operational on this link.",
+ "partnerMetadata": {
+ "$ref": "InterconnectAttachmentPartnerMetadata",
+ "description": "Informational metadata about Partner attachments from Partners to display to customers. Output only for PARTNER type, mutable for PARTNER_PROVIDER, not available for DEDICATED."
+ },
+ "privateInterconnectInfo": {
+ "$ref": "InterconnectAttachmentPrivateInfo",
+ "description": "[Output Only] Information specific to an InterconnectAttachment. This property is populated if the interconnect that this is attached to is of type DEDICATED."
+ },
+ "region": {
+ "description": "[Output Only] URL of the region where the regional interconnect attachment resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.",
+ "type": "string"
+ },
+ "remoteService": {
+ "description": "[Output Only] If the attachment is on a Cross-Cloud Interconnect connection, this field contains the interconnect's remote location service provider. Example values: \"Amazon Web Services\" \"Microsoft Azure\". The field is set only for attachments on Cross-Cloud Interconnect connections. Its value is copied from the InterconnectRemoteLocation remoteService field.",
+ "type": "string"
+ },
+ "router": {
+ "description": "URL of the Cloud Router to be used for dynamic routing. This router must be in the same region as this InterconnectAttachment. The InterconnectAttachment will automatically connect the Interconnect to the network \u0026 region within which the Cloud Router is configured.",
+ "type": "string"
+ },
+ "satisfiesPzs": {
+ "description": "[Output Only] Reserved for future use.",
"type": "boolean"
+ },
+ "selfLink": {
+ "description": "[Output Only] Server-defined URL for the resource.",
+ "type": "string"
+ },
+ "stackType": {
+ "description": "The stack type for this interconnect attachment to identify whether the IPv6 feature is enabled or not. If not specified, IPV4_ONLY will be used. This field can be both set at interconnect attachments creation and update interconnect attachment operations.",
+ "enum": [
+ "IPV4_IPV6",
+ "IPV4_ONLY"
+ ],
+ "enumDescriptions": [
+ "The interconnect attachment can have both IPv4 and IPv6 addresses.",
+ "The interconnect attachment will only be assigned IPv4 addresses."
+ ],
+ "type": "string"
+ },
+ "state": {
+ "description": "[Output Only] The current state of this attachment's functionality. Enum values ACTIVE and UNPROVISIONED are shared by DEDICATED/PRIVATE, PARTNER, and PARTNER_PROVIDER interconnect attachments, while enum values PENDING_PARTNER, PARTNER_REQUEST_RECEIVED, and PENDING_CUSTOMER are used for only PARTNER and PARTNER_PROVIDER interconnect attachments. This state can take one of the following values: - ACTIVE: The attachment has been turned up and is ready to use. - UNPROVISIONED: The attachment is not ready to use yet, because turnup is not complete. - PENDING_PARTNER: A newly-created PARTNER attachment that has not yet been configured on the Partner side. - PARTNER_REQUEST_RECEIVED: A PARTNER attachment is in the process of provisioning after a PARTNER_PROVIDER attachment was created that references it. - PENDING_CUSTOMER: A PARTNER or PARTNER_PROVIDER attachment that is waiting for a customer to activate it. - DEFUNCT: The attachment was deleted externally and is no longer functional. This could be because the associated Interconnect was removed, or because the other side of a Partner attachment was deleted. ",
+ "enum": [
+ "ACTIVE",
+ "DEFUNCT",
+ "PARTNER_REQUEST_RECEIVED",
+ "PENDING_CUSTOMER",
+ "PENDING_PARTNER",
+ "STATE_UNSPECIFIED",
+ "UNPROVISIONED"
+ ],
+ "enumDescriptions": [
+ "Indicates that attachment has been turned up and is ready to use.",
+ "The attachment was deleted externally and is no longer functional. This could be because the associated Interconnect was wiped out, or because the other side of a Partner attachment was deleted.",
+ "A PARTNER attachment is in the process of provisioning after a PARTNER_PROVIDER attachment was created that references it.",
+ "PARTNER or PARTNER_PROVIDER attachment that is waiting for the customer to activate.",
+ "A newly created PARTNER attachment that has not yet been configured on the Partner side.",
+ "",
+ "Indicates that attachment is not ready to use yet, because turnup is not complete."
+ ],
+ "type": "string"
+ },
+ "subnetLength": {
+ "description": "Length of the IPv4 subnet mask. Allowed values: - 29 (default) - 30 The default value is 29, except for Cross-Cloud Interconnect connections that use an InterconnectRemoteLocation with a constraints.subnetLengthRange.min equal to 30. For example, connections that use an Azure remote location fall into this category. In these cases, the default value is 30, and requesting 29 returns an error. Where both 29 and 30 are allowed, 29 is preferred, because it gives Google Cloud Support more debugging visibility. ",
+ "format": "int32",
+ "type": "integer"
+ },
+ "type": {
+ "description": "The type of interconnect attachment this is, which can take one of the following values: - DEDICATED: an attachment to a Dedicated Interconnect. - PARTNER: an attachment to a Partner Interconnect, created by the customer. - PARTNER_PROVIDER: an attachment to a Partner Interconnect, created by the partner. ",
+ "enum": [
+ "DEDICATED",
+ "PARTNER",
+ "PARTNER_PROVIDER"
+ ],
+ "enumDescriptions": [
+ "Attachment to a dedicated interconnect.",
+ "Attachment to a partner interconnect, created by the customer.",
+ "Attachment to a partner interconnect, created by the partner."
+ ],
+ "type": "string"
+ },
+ "vlanTag8021q": {
+ "description": "The IEEE 802.1Q VLAN tag for this attachment, in the range 2-4093. Only specified at creation time.",
+ "format": "int32",
+ "type": "integer"
}
},
"type": "object"
},
- "InterconnectList": {
- "description": "Response to the list request, and contains a list of interconnects.",
- "id": "InterconnectList",
+ "InterconnectAttachmentAggregatedList": {
+ "id": "InterconnectAttachmentAggregatedList",
"properties": {
"id": {
"description": "[Output Only] Unique identifier for the resource; defined by the server.",
"type": "string"
},
"items": {
- "description": "A list of Interconnect resources.",
- "items": {
- "$ref": "Interconnect"
+ "additionalProperties": {
+ "$ref": "InterconnectAttachmentsScopedList",
+ "description": "Name of the scope containing this set of interconnect attachments."
},
- "type": "array"
+ "description": "A list of InterconnectAttachmentsScopedList resources.",
+ "type": "object"
},
"kind": {
- "default": "compute#interconnectList",
- "description": "[Output Only] Type of resource. Always compute#interconnectList for lists of interconnects.",
+ "default": "compute#interconnectAttachmentAggregatedList",
+ "description": "[Output Only] Type of resource. Always compute#interconnectAttachmentAggregatedList for aggregated lists of interconnect attachments.",
"type": "string"
},
"nextPageToken": {
@@ -52095,6 +54647,13 @@
"description": "[Output Only] Server-defined URL for this resource.",
"type": "string"
},
+ "unreachables": {
+ "description": "[Output Only] Unreachable resources.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
"warning": {
"description": "[Output Only] Informational warning message.",
"properties": {
@@ -52219,160 +54778,65 @@
},
"type": "object"
},
- "InterconnectLocation": {
- "description": "Represents an Interconnect Attachment (VLAN) Location resource. You can use this resource to find location details about an Interconnect attachment (VLAN). For more information about interconnect attachments, read Creating VLAN Attachments.",
- "id": "InterconnectLocation",
+ "InterconnectAttachmentConfigurationConstraints": {
+ "id": "InterconnectAttachmentConfigurationConstraints",
"properties": {
- "address": {
- "description": "[Output Only] The postal address of the Point of Presence, each line in the address is separated by a newline character.",
- "type": "string"
- },
- "availabilityZone": {
- "description": "[Output Only] Availability zone for this InterconnectLocation. Within a metropolitan area (metro), maintenance will not be simultaneously scheduled in more than one availability zone. Example: \"zone1\" or \"zone2\".",
+ "bgpMd5": {
+ "description": "[Output Only] Whether the attachment's BGP session requires/allows/disallows BGP MD5 authentication. This can take one of the following values: MD5_OPTIONAL, MD5_REQUIRED, MD5_UNSUPPORTED. For example, a Cross-Cloud Interconnect connection to a remote cloud provider that requires BGP MD5 authentication has the interconnectRemoteLocation attachment_configuration_constraints.bgp_md5 field set to MD5_REQUIRED, and that property is propagated to the attachment. Similarly, if BGP MD5 is MD5_UNSUPPORTED, an error is returned if MD5 is requested.",
+ "enum": [
+ "MD5_OPTIONAL",
+ "MD5_REQUIRED",
+ "MD5_UNSUPPORTED"
+ ],
+ "enumDescriptions": [
+ "MD5_OPTIONAL: BGP MD5 authentication is supported and can optionally be configured.",
+ "MD5_REQUIRED: BGP MD5 authentication must be configured.",
+ "MD5_UNSUPPORTED: BGP MD5 authentication must not be configured"
+ ],
"type": "string"
},
- "availableFeatures": {
- "description": "[Output only] List of features available at this InterconnectLocation, which can take one of the following values: - MACSEC ",
+ "bgpPeerAsnRanges": {
+ "description": "[Output Only] List of ASN ranges that the remote location is known to support. Formatted as an array of inclusive ranges {min: min-value, max: max-value}. For example, [{min: 123, max: 123}, {min: 64512, max: 65534}] allows the peer ASN to be 123 or anything in the range 64512-65534. This field is only advisory. Although the API accepts other ranges, these are the ranges that we recommend.",
"items": {
- "enum": [
- "IF_MACSEC"
- ],
- "enumDescriptions": [
- "Media Access Control security (MACsec)"
- ],
- "type": "string"
+ "$ref": "InterconnectAttachmentConfigurationConstraintsBgpPeerASNRange"
},
"type": "array"
+ }
+ },
+ "type": "object"
+ },
+ "InterconnectAttachmentConfigurationConstraintsBgpPeerASNRange": {
+ "id": "InterconnectAttachmentConfigurationConstraintsBgpPeerASNRange",
+ "properties": {
+ "max": {
+ "format": "uint32",
+ "type": "integer"
},
- "availableLinkTypes": {
- "description": "[Output only] List of link types available at this InterconnectLocation, which can take one of the following values: - LINK_TYPE_ETHERNET_10G_LR - LINK_TYPE_ETHERNET_100G_LR ",
- "items": {
- "enum": [
- "LINK_TYPE_ETHERNET_100G_LR",
- "LINK_TYPE_ETHERNET_10G_LR"
- ],
- "enumDescriptions": [
- "100G Ethernet, LR Optics.",
- "10G Ethernet, LR Optics. [(rate_bps) = 10000000000];"
- ],
- "type": "string"
- },
- "type": "array"
- },
- "city": {
- "description": "[Output Only] Metropolitan area designator that indicates which city an interconnect is located. For example: \"Chicago, IL\", \"Amsterdam, Netherlands\".",
- "type": "string"
- },
- "continent": {
- "description": "[Output Only] Continent for this location, which can take one of the following values: - AFRICA - ASIA_PAC - EUROPE - NORTH_AMERICA - SOUTH_AMERICA ",
- "enum": [
- "AFRICA",
- "ASIA_PAC",
- "C_AFRICA",
- "C_ASIA_PAC",
- "C_EUROPE",
- "C_NORTH_AMERICA",
- "C_SOUTH_AMERICA",
- "EUROPE",
- "NORTH_AMERICA",
- "SOUTH_AMERICA"
- ],
- "enumDescriptions": [
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- ""
- ],
- "type": "string"
- },
- "creationTimestamp": {
- "description": "[Output Only] Creation timestamp in RFC3339 text format.",
- "type": "string"
- },
- "description": {
- "description": "[Output Only] An optional description of the resource.",
- "type": "string"
- },
- "facilityProvider": {
- "description": "[Output Only] The name of the provider for this facility (e.g., EQUINIX).",
- "type": "string"
- },
- "facilityProviderFacilityId": {
- "description": "[Output Only] A provider-assigned Identifier for this facility (e.g., Ashburn-DC1).",
- "type": "string"
- },
- "id": {
- "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.",
- "format": "uint64",
- "type": "string"
- },
- "kind": {
- "default": "compute#interconnectLocation",
- "description": "[Output Only] Type of the resource. Always compute#interconnectLocation for interconnect locations.",
- "type": "string"
- },
- "name": {
- "description": "[Output Only] Name of the resource.",
- "type": "string"
- },
- "peeringdbFacilityId": {
- "description": "[Output Only] The peeringdb identifier for this facility (corresponding with a netfac type in peeringdb).",
- "type": "string"
- },
- "regionInfos": {
- "description": "[Output Only] A list of InterconnectLocation.RegionInfo objects, that describe parameters pertaining to the relation between this InterconnectLocation and various Google Cloud regions.",
- "items": {
- "$ref": "InterconnectLocationRegionInfo"
- },
- "type": "array"
- },
- "selfLink": {
- "description": "[Output Only] Server-defined URL for the resource.",
- "type": "string"
- },
- "status": {
- "description": "[Output Only] The status of this InterconnectLocation, which can take one of the following values: - CLOSED: The InterconnectLocation is closed and is unavailable for provisioning new Interconnects. - AVAILABLE: The InterconnectLocation is available for provisioning new Interconnects. ",
- "enum": [
- "AVAILABLE",
- "CLOSED"
- ],
- "enumDescriptions": [
- "The InterconnectLocation is available for provisioning new Interconnects.",
- "The InterconnectLocation is closed for provisioning new Interconnects."
- ],
- "type": "string"
- },
- "supportsPzs": {
- "description": "[Output Only] Reserved for future use.",
- "type": "boolean"
+ "min": {
+ "format": "uint32",
+ "type": "integer"
}
},
"type": "object"
},
- "InterconnectLocationList": {
- "description": "Response to the list request, and contains a list of interconnect locations.",
- "id": "InterconnectLocationList",
+ "InterconnectAttachmentList": {
+ "description": "Response to the list request, and contains a list of interconnect attachments.",
+ "id": "InterconnectAttachmentList",
"properties": {
"id": {
"description": "[Output Only] Unique identifier for the resource; defined by the server.",
"type": "string"
},
"items": {
- "description": "A list of InterconnectLocation resources.",
+ "description": "A list of InterconnectAttachment resources.",
"items": {
- "$ref": "InterconnectLocation"
+ "$ref": "InterconnectAttachment"
},
"type": "array"
},
"kind": {
- "default": "compute#interconnectLocationList",
- "description": "[Output Only] Type of resource. Always compute#interconnectLocationList for lists of interconnect locations.",
+ "default": "compute#interconnectAttachmentList",
+ "description": "[Output Only] Type of resource. Always compute#interconnectAttachmentList for lists of interconnect attachments.",
"type": "string"
},
"nextPageToken": {
@@ -52507,388 +54971,49 @@
},
"type": "object"
},
- "InterconnectLocationRegionInfo": {
- "description": "Information about any potential InterconnectAttachments between an Interconnect at a specific InterconnectLocation, and a specific Cloud Region.",
- "id": "InterconnectLocationRegionInfo",
- "properties": {
- "expectedRttMs": {
- "description": "Expected round-trip time in milliseconds, from this InterconnectLocation to a VM in this region.",
- "format": "int64",
- "type": "string"
- },
- "locationPresence": {
- "description": "Identifies the network presence of this location.",
- "enum": [
- "GLOBAL",
- "LOCAL_REGION",
- "LP_GLOBAL",
- "LP_LOCAL_REGION"
- ],
- "enumDescriptions": [
- "This region is not in any common network presence with this InterconnectLocation.",
- "This region shares the same regional network presence as this InterconnectLocation.",
- "[Deprecated] This region is not in any common network presence with this InterconnectLocation.",
- "[Deprecated] This region shares the same regional network presence as this InterconnectLocation."
- ],
- "type": "string"
- },
- "region": {
- "description": "URL for the region of this location.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "InterconnectMacsec": {
- "description": "Configuration information for enabling Media Access Control security (MACsec) on this Cloud Interconnect connection between Google and your on-premises router.",
- "id": "InterconnectMacsec",
- "properties": {
- "failOpen": {
- "description": "If set to true, the Interconnect connection is configured with a should-secure MACsec security policy, that allows the Google router to fallback to cleartext traffic if the MKA session cannot be established. By default, the Interconnect connection is configured with a must-secure security policy that drops all traffic if the MKA session cannot be established with your router.",
- "type": "boolean"
- },
- "preSharedKeys": {
- "description": "Required. A keychain placeholder describing a set of named key objects along with their start times. A MACsec CKN/CAK is generated for each key in the key chain. Google router automatically picks the key with the most recent startTime when establishing or re-establishing a MACsec secure link.",
- "items": {
- "$ref": "InterconnectMacsecPreSharedKey"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "InterconnectMacsecConfig": {
- "description": "MACsec configuration information for the Interconnect connection. Contains the generated Connectivity Association Key Name (CKN) and the key (CAK) for this Interconnect connection.",
- "id": "InterconnectMacsecConfig",
- "properties": {
- "preSharedKeys": {
- "description": "A keychain placeholder describing a set of named key objects along with their start times. A MACsec CKN/CAK is generated for each key in the key chain. Google router automatically picks the key with the most recent startTime when establishing or re-establishing a MACsec secure link.",
- "items": {
- "$ref": "InterconnectMacsecConfigPreSharedKey"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "InterconnectMacsecConfigPreSharedKey": {
- "description": "Describes a pre-shared key used to setup MACsec in static connectivity association key (CAK) mode.",
- "id": "InterconnectMacsecConfigPreSharedKey",
- "properties": {
- "cak": {
- "description": "An auto-generated Connectivity Association Key (CAK) for this key.",
- "type": "string"
- },
- "ckn": {
- "description": "An auto-generated Connectivity Association Key Name (CKN) for this key.",
- "type": "string"
- },
- "name": {
- "description": "User provided name for this pre-shared key.",
- "type": "string"
- },
- "startTime": {
- "description": "User provided timestamp on or after which this key is valid.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "InterconnectMacsecPreSharedKey": {
- "description": "Describes a pre-shared key used to setup MACsec in static connectivity association key (CAK) mode.",
- "id": "InterconnectMacsecPreSharedKey",
- "properties": {
- "name": {
- "description": "Required. A name for this pre-shared key. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.",
- "type": "string"
- },
- "startTime": {
- "description": "A RFC3339 timestamp on or after which the key is valid. startTime can be in the future. If the keychain has a single key, startTime can be omitted. If the keychain has multiple keys, startTime is mandatory for each key. The start times of keys must be in increasing order. The start times of two consecutive keys must be at least 6 hours apart.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "InterconnectOutageNotification": {
- "description": "Description of a planned outage on this Interconnect.",
- "id": "InterconnectOutageNotification",
- "properties": {
- "affectedCircuits": {
- "description": "If issue_type is IT_PARTIAL_OUTAGE, a list of the Google-side circuit IDs that will be affected.",
- "items": {
- "type": "string"
- },
- "type": "array"
- },
- "description": {
- "description": "A description about the purpose of the outage.",
- "type": "string"
- },
- "endTime": {
- "description": "Scheduled end time for the outage (milliseconds since Unix epoch).",
- "format": "int64",
- "type": "string"
- },
- "issueType": {
- "description": "Form this outage is expected to take, which can take one of the following values: - OUTAGE: The Interconnect may be completely out of service for some or all of the specified window. - PARTIAL_OUTAGE: Some circuits comprising the Interconnect as a whole should remain up, but with reduced bandwidth. Note that the versions of this enum prefixed with \"IT_\" have been deprecated in favor of the unprefixed values.",
- "enum": [
- "IT_OUTAGE",
- "IT_PARTIAL_OUTAGE",
- "OUTAGE",
- "PARTIAL_OUTAGE"
- ],
- "enumDescriptions": [
- "[Deprecated] The Interconnect may be completely out of service for some or all of the specified window.",
- "[Deprecated] Some circuits comprising the Interconnect will be out of service during the expected window. The interconnect as a whole should remain up, albeit with reduced bandwidth.",
- "The Interconnect may be completely out of service for some or all of the specified window.",
- "Some circuits comprising the Interconnect will be out of service during the expected window. The interconnect as a whole should remain up, albeit with reduced bandwidth."
- ],
- "type": "string"
- },
- "name": {
- "description": "Unique identifier for this outage notification.",
- "type": "string"
- },
- "source": {
- "description": "The party that generated this notification, which can take the following value: - GOOGLE: this notification as generated by Google. Note that the value of NSRC_GOOGLE has been deprecated in favor of GOOGLE.",
- "enum": [
- "GOOGLE",
- "NSRC_GOOGLE"
- ],
- "enumDescriptions": [
- "This notification was generated by Google.",
- "[Deprecated] This notification was generated by Google."
- ],
- "type": "string"
- },
- "startTime": {
- "description": "Scheduled start time for the outage (milliseconds since Unix epoch).",
- "format": "int64",
- "type": "string"
- },
- "state": {
- "description": "State of this notification, which can take one of the following values: - ACTIVE: This outage notification is active. The event could be in the past, present, or future. See start_time and end_time for scheduling. - CANCELLED: The outage associated with this notification was cancelled before the outage was due to start. - COMPLETED: The outage associated with this notification is complete. Note that the versions of this enum prefixed with \"NS_\" have been deprecated in favor of the unprefixed values.",
- "enum": [
- "ACTIVE",
- "CANCELLED",
- "COMPLETED",
- "NS_ACTIVE",
- "NS_CANCELED"
- ],
- "enumDescriptions": [
- "This outage notification is active. The event could be in the future, present, or past. See start_time and end_time for scheduling.",
- "The outage associated with this notification was cancelled before the outage was due to start.",
- "The outage associated with this notification is complete.",
- "[Deprecated] This outage notification is active. The event could be in the future, present, or past. See start_time and end_time for scheduling.",
- "[Deprecated] The outage associated with this notification was canceled before the outage was due to start."
- ],
- "type": "string"
- }
- },
- "type": "object"
- },
- "InterconnectRemoteLocation": {
- "description": "Represents a Cross-Cloud Interconnect Remote Location resource. You can use this resource to find remote location details about an Interconnect attachment (VLAN).",
- "id": "InterconnectRemoteLocation",
+ "InterconnectAttachmentPartnerMetadata": {
+ "description": "Informational metadata about Partner attachments from Partners to display to customers. These fields are propagated from PARTNER_PROVIDER attachments to their corresponding PARTNER attachments.",
+ "id": "InterconnectAttachmentPartnerMetadata",
"properties": {
- "address": {
- "description": "[Output Only] The postal address of the Point of Presence, each line in the address is separated by a newline character.",
- "type": "string"
- },
- "attachmentConfigurationConstraints": {
- "$ref": "InterconnectAttachmentConfigurationConstraints",
- "description": "[Output Only] Subset of fields from InterconnectAttachment's |configurationConstraints| field that apply to all attachments for this remote location."
- },
- "city": {
- "description": "[Output Only] Metropolitan area designator that indicates which city an interconnect is located. For example: \"Chicago, IL\", \"Amsterdam, Netherlands\".",
- "type": "string"
- },
- "constraints": {
- "$ref": "InterconnectRemoteLocationConstraints",
- "description": "[Output Only] Constraints on the parameters for creating Cross-Cloud Interconnect and associated InterconnectAttachments."
- },
- "continent": {
- "description": "[Output Only] Continent for this location, which can take one of the following values: - AFRICA - ASIA_PAC - EUROPE - NORTH_AMERICA - SOUTH_AMERICA ",
- "enum": [
- "AFRICA",
- "ASIA_PAC",
- "EUROPE",
- "NORTH_AMERICA",
- "SOUTH_AMERICA"
- ],
- "enumDescriptions": [
- "",
- "",
- "",
- "",
- ""
- ],
- "type": "string"
- },
- "creationTimestamp": {
- "description": "[Output Only] Creation timestamp in RFC3339 text format.",
- "type": "string"
- },
- "description": {
- "description": "[Output Only] An optional description of the resource.",
- "type": "string"
- },
- "facilityProvider": {
- "description": "[Output Only] The name of the provider for this facility (e.g., EQUINIX).",
- "type": "string"
- },
- "facilityProviderFacilityId": {
- "description": "[Output Only] A provider-assigned Identifier for this facility (e.g., Ashburn-DC1).",
- "type": "string"
- },
- "id": {
- "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.",
- "format": "uint64",
- "type": "string"
- },
- "kind": {
- "default": "compute#interconnectRemoteLocation",
- "description": "[Output Only] Type of the resource. Always compute#interconnectRemoteLocation for interconnect remote locations.",
- "type": "string"
- },
- "lacp": {
- "description": "[Output Only] Link Aggregation Control Protocol (LACP) constraints, which can take one of the following values: LACP_SUPPORTED, LACP_UNSUPPORTED",
- "enum": [
- "LACP_SUPPORTED",
- "LACP_UNSUPPORTED"
- ],
- "enumDescriptions": [
- "LACP_SUPPORTED: LACP is supported, and enabled by default on the Cross-Cloud Interconnect.",
- "LACP_UNSUPPORTED: LACP is not supported and is not be enabled on this port. GetDiagnostics shows bundleAggregationType as \"static\". GCP does not support LAGs without LACP, so requestedLinkCount must be 1."
- ],
- "type": "string"
- },
- "maxLagSize100Gbps": {
- "description": "[Output Only] The maximum number of 100 Gbps ports supported in a link aggregation group (LAG). When linkType is 100 Gbps, requestedLinkCount cannot exceed max_lag_size_100_gbps.",
- "format": "int32",
- "type": "integer"
- },
- "maxLagSize10Gbps": {
- "description": "[Output Only] The maximum number of 10 Gbps ports supported in a link aggregation group (LAG). When linkType is 10 Gbps, requestedLinkCount cannot exceed max_lag_size_10_gbps.",
- "format": "int32",
- "type": "integer"
- },
- "name": {
- "description": "[Output Only] Name of the resource.",
- "type": "string"
- },
- "peeringdbFacilityId": {
- "description": "[Output Only] The peeringdb identifier for this facility (corresponding with a netfac type in peeringdb).",
- "type": "string"
- },
- "permittedConnections": {
- "description": "[Output Only] Permitted connections.",
- "items": {
- "$ref": "InterconnectRemoteLocationPermittedConnections"
- },
- "type": "array"
- },
- "remoteService": {
- "description": "[Output Only] Indicates the service provider present at the remote location. Example values: \"Amazon Web Services\", \"Microsoft Azure\".",
- "type": "string"
- },
- "selfLink": {
- "description": "[Output Only] Server-defined URL for the resource.",
+ "interconnectName": {
+ "description": "Plain text name of the Interconnect this attachment is connected to, as displayed in the Partner's portal. For instance \"Chicago 1\". This value may be validated to match approved Partner values.",
"type": "string"
},
- "status": {
- "description": "[Output Only] The status of this InterconnectRemoteLocation, which can take one of the following values: - CLOSED: The InterconnectRemoteLocation is closed and is unavailable for provisioning new Cross-Cloud Interconnects. - AVAILABLE: The InterconnectRemoteLocation is available for provisioning new Cross-Cloud Interconnects. ",
- "enum": [
- "AVAILABLE",
- "CLOSED"
- ],
- "enumDescriptions": [
- "The InterconnectRemoteLocation is available for provisioning new Cross-Cloud Interconnects.",
- "The InterconnectRemoteLocation is closed for provisioning new Cross-Cloud Interconnects."
- ],
- "type": "string"
- }
- },
- "type": "object"
- },
- "InterconnectRemoteLocationConstraints": {
- "id": "InterconnectRemoteLocationConstraints",
- "properties": {
- "portPairRemoteLocation": {
- "description": "[Output Only] Port pair remote location constraints, which can take one of the following values: PORT_PAIR_UNCONSTRAINED_REMOTE_LOCATION, PORT_PAIR_MATCHING_REMOTE_LOCATION. GCP's API refers only to individual ports, but the UI uses this field when ordering a pair of ports, to prevent users from accidentally ordering something that is incompatible with their cloud provider. Specifically, when ordering a redundant pair of Cross-Cloud Interconnect ports, and one of them uses a remote location with portPairMatchingRemoteLocation set to matching, the UI requires that both ports use the same remote location.",
- "enum": [
- "PORT_PAIR_MATCHING_REMOTE_LOCATION",
- "PORT_PAIR_UNCONSTRAINED_REMOTE_LOCATION"
- ],
- "enumDescriptions": [
- "If PORT_PAIR_MATCHING_REMOTE_LOCATION, the remote cloud provider allocates ports in pairs, and the user should choose the same remote location for both ports.",
- "If PORT_PAIR_UNCONSTRAINED_REMOTE_LOCATION, a user may opt to provision a redundant pair of Cross-Cloud Interconnects using two different remote locations in the same city."
- ],
+ "partnerName": {
+ "description": "Plain text name of the Partner providing this attachment. This value may be validated to match approved Partner values.",
"type": "string"
},
- "portPairVlan": {
- "description": "[Output Only] Port pair VLAN constraints, which can take one of the following values: PORT_PAIR_UNCONSTRAINED_VLAN, PORT_PAIR_MATCHING_VLAN",
- "enum": [
- "PORT_PAIR_MATCHING_VLAN",
- "PORT_PAIR_UNCONSTRAINED_VLAN"
- ],
- "enumDescriptions": [
- "If PORT_PAIR_MATCHING_VLAN, the Interconnect for this attachment is part of a pair of ports that should have matching VLAN allocations. This occurs with Cross-Cloud Interconnect to Azure remote locations. While GCP's API does not explicitly group pairs of ports, the UI uses this field to ensure matching VLAN ids when configuring a redundant VLAN pair.",
- "PORT_PAIR_UNCONSTRAINED_VLAN means there is no constraint."
- ],
+ "portalUrl": {
+ "description": "URL of the Partner's portal for this Attachment. Partners may customise this to be a deep link to the specific resource on the Partner portal. This value may be validated to match approved Partner values.",
"type": "string"
- },
- "subnetLengthRange": {
- "$ref": "InterconnectRemoteLocationConstraintsSubnetLengthRange",
- "description": "[Output Only] [min-length, max-length] The minimum and maximum value (inclusive) for the IPv4 subnet length. For example, an interconnectRemoteLocation for Azure has {min: 30, max: 30} because Azure requires /30 subnets. This range specifies the values supported by both cloud providers. Interconnect currently supports /29 and /30 IPv4 subnet lengths. If a remote cloud has no constraint on IPv4 subnet length, the range would thus be {min: 29, max: 30}. "
}
},
"type": "object"
},
- "InterconnectRemoteLocationConstraintsSubnetLengthRange": {
- "id": "InterconnectRemoteLocationConstraintsSubnetLengthRange",
+ "InterconnectAttachmentPrivateInfo": {
+ "description": "Information for an interconnect attachment when this belongs to an interconnect of type DEDICATED.",
+ "id": "InterconnectAttachmentPrivateInfo",
"properties": {
- "max": {
- "format": "int32",
- "type": "integer"
- },
- "min": {
- "format": "int32",
+ "tag8021q": {
+ "description": "[Output Only] 802.1q encapsulation tag to be used for traffic between Google and the customer, going to and from this network and region.",
+ "format": "uint32",
"type": "integer"
}
},
"type": "object"
},
- "InterconnectRemoteLocationList": {
- "description": "Response to the list request, and contains a list of interconnect remote locations.",
- "id": "InterconnectRemoteLocationList",
+ "InterconnectAttachmentsScopedList": {
+ "id": "InterconnectAttachmentsScopedList",
"properties": {
- "id": {
- "description": "[Output Only] Unique identifier for the resource; defined by the server.",
- "type": "string"
- },
- "items": {
- "description": "A list of InterconnectRemoteLocation resources.",
+ "interconnectAttachments": {
+ "description": "A list of interconnect attachments contained in this scope.",
"items": {
- "$ref": "InterconnectRemoteLocation"
+ "$ref": "InterconnectAttachment"
},
"type": "array"
},
- "kind": {
- "default": "compute#interconnectRemoteLocationList",
- "description": "[Output Only] Type of resource. Always compute#interconnectRemoteLocationList for lists of interconnect remote locations.",
- "type": "string"
- },
- "nextPageToken": {
- "description": "[Output Only] This token lets you get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
- "type": "string"
- },
- "selfLink": {
- "description": "[Output Only] Server-defined URL for this resource.",
- "type": "string"
- },
"warning": {
- "description": "[Output Only] Informational warning message.",
+ "description": "Informational warning which replaces the list of addresses when the list is empty.",
"properties": {
"code": {
"description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.",
@@ -53011,227 +55136,227 @@
},
"type": "object"
},
- "InterconnectRemoteLocationPermittedConnections": {
- "id": "InterconnectRemoteLocationPermittedConnections",
+ "InterconnectCircuitInfo": {
+ "description": "Describes a single physical circuit between the Customer and Google. CircuitInfo objects are created by Google, so all fields are output only.",
+ "id": "InterconnectCircuitInfo",
"properties": {
- "interconnectLocation": {
- "description": "[Output Only] URL of an Interconnect location that is permitted to connect to this Interconnect remote location.",
+ "customerDemarcId": {
+ "description": "Customer-side demarc ID for this circuit.",
+ "type": "string"
+ },
+ "googleCircuitId": {
+ "description": "Google-assigned unique ID for this circuit. Assigned at circuit turn-up.",
+ "type": "string"
+ },
+ "googleDemarcId": {
+ "description": "Google-side demarc ID for this circuit. Assigned at circuit turn-up and provided by Google to the customer in the LOA.",
"type": "string"
}
},
"type": "object"
},
- "InterconnectsGetDiagnosticsResponse": {
- "description": "Response for the InterconnectsGetDiagnosticsRequest.",
- "id": "InterconnectsGetDiagnosticsResponse",
- "properties": {
- "result": {
- "$ref": "InterconnectDiagnostics"
- }
- },
- "type": "object"
- },
- "InterconnectsGetMacsecConfigResponse": {
- "description": "Response for the InterconnectsGetMacsecConfigRequest.",
- "id": "InterconnectsGetMacsecConfigResponse",
- "properties": {
- "etag": {
- "description": "end_interface: MixerGetResponseWithEtagBuilder",
- "type": "string"
- },
- "result": {
- "$ref": "InterconnectMacsecConfig"
- }
- },
- "type": "object"
- },
- "License": {
- "description": "Represents a License resource. A License represents billing and aggregate usage data for public and marketplace images. *Caution* This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. ",
- "id": "License",
+ "InterconnectDiagnostics": {
+ "description": "Diagnostics information about the Interconnect connection, which contains detailed and current technical information about Google's side of the connection.",
+ "id": "InterconnectDiagnostics",
"properties": {
- "chargesUseFee": {
- "description": "[Output Only] Deprecated. This field no longer reflects whether a license charges a usage fee.",
- "type": "boolean"
- },
- "creationTimestamp": {
- "description": "[Output Only] Creation timestamp in RFC3339 text format.",
- "type": "string"
- },
- "description": {
- "description": "An optional textual description of the resource; provided by the client when the resource is created.",
- "type": "string"
- },
- "id": {
- "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.",
- "format": "uint64",
- "type": "string"
+ "arpCaches": {
+ "description": "A list of InterconnectDiagnostics.ARPEntry objects, describing individual neighbors currently seen by the Google router in the ARP cache for the Interconnect. This will be empty when the Interconnect is not bundled.",
+ "items": {
+ "$ref": "InterconnectDiagnosticsARPEntry"
+ },
+ "type": "array"
},
- "kind": {
- "default": "compute#license",
- "description": "[Output Only] Type of resource. Always compute#license for licenses.",
+ "bundleAggregationType": {
+ "description": "The aggregation type of the bundle interface.",
+ "enum": [
+ "BUNDLE_AGGREGATION_TYPE_LACP",
+ "BUNDLE_AGGREGATION_TYPE_STATIC"
+ ],
+ "enumDescriptions": [
+ "LACP is enabled.",
+ "LACP is disabled."
+ ],
"type": "string"
},
- "licenseCode": {
- "description": "[Output Only] The unique code used to attach this license to images, snapshots, and disks.",
- "format": "uint64",
+ "bundleOperationalStatus": {
+ "description": "The operational status of the bundle interface.",
+ "enum": [
+ "BUNDLE_OPERATIONAL_STATUS_DOWN",
+ "BUNDLE_OPERATIONAL_STATUS_UP"
+ ],
+ "enumDescriptions": [
+ "If bundleAggregationType is LACP: LACP is not established and/or all links in the bundle have DOWN operational status. If bundleAggregationType is STATIC: one or more links in the bundle has DOWN operational status.",
+ "If bundleAggregationType is LACP: LACP is established and at least one link in the bundle has UP operational status. If bundleAggregationType is STATIC: all links in the bundle (typically just one) have UP operational status."
+ ],
"type": "string"
},
- "name": {
- "annotations": {
- "required": [
- "compute.images.insert"
- ]
+ "links": {
+ "description": "A list of InterconnectDiagnostics.LinkStatus objects, describing the status for each link on the Interconnect.",
+ "items": {
+ "$ref": "InterconnectDiagnosticsLinkStatus"
},
- "description": "Name of the resource. The name must be 1-63 characters long and comply with RFC1035.",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- "type": "string"
- },
- "resourceRequirements": {
- "$ref": "LicenseResourceRequirements"
+ "type": "array"
},
- "selfLink": {
- "description": "[Output Only] Server-defined URL for the resource.",
+ "macAddress": {
+ "description": "The MAC address of the Interconnect's bundle interface.",
"type": "string"
- },
- "transferable": {
- "description": "If false, licenses will not be copied from the source resource when creating an image from a disk, disk from snapshot, or snapshot from disk.",
- "type": "boolean"
}
},
"type": "object"
},
- "LicenseCode": {
- "description": "Represents a License Code resource. A License Code is a unique identifier used to represent a license resource. *Caution* This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. ",
- "id": "LicenseCode",
+ "InterconnectDiagnosticsARPEntry": {
+ "description": "Describing the ARP neighbor entries seen on this link",
+ "id": "InterconnectDiagnosticsARPEntry",
"properties": {
- "creationTimestamp": {
- "description": "[Output Only] Creation timestamp in RFC3339 text format.",
- "type": "string"
- },
- "description": {
- "description": "[Output Only] Description of this License Code.",
- "type": "string"
- },
- "id": {
- "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.",
- "format": "uint64",
+ "ipAddress": {
+ "description": "The IP address of this ARP neighbor.",
"type": "string"
},
- "kind": {
- "default": "compute#licenseCode",
- "description": "[Output Only] Type of resource. Always compute#licenseCode for licenses.",
+ "macAddress": {
+ "description": "The MAC address of this ARP neighbor.",
"type": "string"
- },
- "licenseAlias": {
- "description": "[Output Only] URL and description aliases of Licenses with the same License Code.",
- "items": {
- "$ref": "LicenseCodeLicenseAlias"
- },
- "type": "array"
- },
- "name": {
- "annotations": {
- "required": [
- "compute.licenses.insert"
- ]
- },
- "description": "[Output Only] Name of the resource. The name is 1-20 characters long and must be a valid 64 bit integer.",
- "pattern": "[0-9]{0,20}?",
+ }
+ },
+ "type": "object"
+ },
+ "InterconnectDiagnosticsLinkLACPStatus": {
+ "id": "InterconnectDiagnosticsLinkLACPStatus",
+ "properties": {
+ "googleSystemId": {
+ "description": "System ID of the port on Google's side of the LACP exchange.",
"type": "string"
},
- "selfLink": {
- "description": "[Output Only] Server-defined URL for the resource.",
+ "neighborSystemId": {
+ "description": "System ID of the port on the neighbor's side of the LACP exchange.",
"type": "string"
},
"state": {
- "description": "[Output Only] Current state of this License Code.",
+ "description": "The state of a LACP link, which can take one of the following values: - ACTIVE: The link is configured and active within the bundle. - DETACHED: The link is not configured within the bundle. This means that the rest of the object should be empty. ",
"enum": [
- "DISABLED",
- "ENABLED",
- "RESTRICTED",
- "STATE_UNSPECIFIED",
- "TERMINATED"
+ "ACTIVE",
+ "DETACHED"
],
"enumDescriptions": [
- "Machines are not allowed to attach boot disks with this License Code. Requests to create new resources with this license will be rejected.",
- "Use is allowed for anyone with USE_READ_ONLY access to this License Code.",
- "Use of this license is limited to a project whitelist.",
- "",
- "Reserved state."
+ "The link is configured and active within the bundle.",
+ "The link is not configured within the bundle, this means the rest of the object should be empty."
],
"type": "string"
- },
- "transferable": {
- "description": "[Output Only] If true, the license will remain attached when creating images or snapshots from disks. Otherwise, the license is not transferred.",
- "type": "boolean"
}
},
"type": "object"
},
- "LicenseCodeLicenseAlias": {
- "id": "LicenseCodeLicenseAlias",
+ "InterconnectDiagnosticsLinkOpticalPower": {
+ "id": "InterconnectDiagnosticsLinkOpticalPower",
"properties": {
- "description": {
- "description": "[Output Only] Description of this License Code.",
+ "state": {
+ "description": "The status of the current value when compared to the warning and alarm levels for the receiving or transmitting transceiver. Possible states include: - OK: The value has not crossed a warning threshold. - LOW_WARNING: The value has crossed below the low warning threshold. - HIGH_WARNING: The value has crossed above the high warning threshold. - LOW_ALARM: The value has crossed below the low alarm threshold. - HIGH_ALARM: The value has crossed above the high alarm threshold. ",
+ "enum": [
+ "HIGH_ALARM",
+ "HIGH_WARNING",
+ "LOW_ALARM",
+ "LOW_WARNING",
+ "OK"
+ ],
+ "enumDescriptions": [
+ "The value has crossed above the high alarm threshold.",
+ "The value of the current optical power has crossed above the high warning threshold.",
+ "The value of the current optical power has crossed below the low alarm threshold.",
+ "The value of the current optical power has crossed below the low warning threshold.",
+ "The value of the current optical power has not crossed a warning threshold."
+ ],
"type": "string"
},
- "selfLink": {
- "description": "[Output Only] URL of license corresponding to this License Code.",
- "type": "string"
+ "value": {
+ "description": "Value of the current receiving or transmitting optical power, read in dBm. Take a known good optical value, give it a 10% margin and trigger warnings relative to that value. In general, a -7dBm warning and a -11dBm alarm are good optical value estimates for most links.",
+ "format": "float",
+ "type": "number"
}
},
"type": "object"
},
- "LicenseResourceCommitment": {
- "description": "Commitment for a particular license resource.",
- "id": "LicenseResourceCommitment",
+ "InterconnectDiagnosticsLinkStatus": {
+ "id": "InterconnectDiagnosticsLinkStatus",
"properties": {
- "amount": {
- "description": "The number of licenses purchased.",
- "format": "int64",
+ "arpCaches": {
+ "description": "A list of InterconnectDiagnostics.ARPEntry objects, describing the ARP neighbor entries seen on this link. This will be empty if the link is bundled",
+ "items": {
+ "$ref": "InterconnectDiagnosticsARPEntry"
+ },
+ "type": "array"
+ },
+ "circuitId": {
+ "description": "The unique ID for this link assigned during turn up by Google.",
"type": "string"
},
- "coresPerLicense": {
- "description": "Specifies the core range of the instance for which this license applies.",
+ "googleDemarc": {
+ "description": "The Demarc address assigned by Google and provided in the LoA.",
"type": "string"
},
- "license": {
- "description": "Any applicable license URI.",
+ "lacpStatus": {
+ "$ref": "InterconnectDiagnosticsLinkLACPStatus"
+ },
+ "macsec": {
+ "$ref": "InterconnectDiagnosticsMacsecStatus",
+ "description": "Describes the status of MACsec encryption on this link."
+ },
+ "operationalStatus": {
+ "description": "The operational status of the link.",
+ "enum": [
+ "LINK_OPERATIONAL_STATUS_DOWN",
+ "LINK_OPERATIONAL_STATUS_UP"
+ ],
+ "enumDescriptions": [
+ "The interface is unable to communicate with the remote end.",
+ "The interface has low level communication with the remote end."
+ ],
"type": "string"
+ },
+ "receivingOpticalPower": {
+ "$ref": "InterconnectDiagnosticsLinkOpticalPower",
+ "description": "An InterconnectDiagnostics.LinkOpticalPower object, describing the current value and status of the received light level."
+ },
+ "transmittingOpticalPower": {
+ "$ref": "InterconnectDiagnosticsLinkOpticalPower",
+ "description": "An InterconnectDiagnostics.LinkOpticalPower object, describing the current value and status of the transmitted light level."
}
},
"type": "object"
},
- "LicenseResourceRequirements": {
- "id": "LicenseResourceRequirements",
+ "InterconnectDiagnosticsMacsecStatus": {
+ "description": "Describes the status of MACsec encryption on the link.",
+ "id": "InterconnectDiagnosticsMacsecStatus",
"properties": {
- "minGuestCpuCount": {
- "description": "Minimum number of guest cpus required to use the Instance. Enforced at Instance creation and Instance start.",
- "format": "int32",
- "type": "integer"
+ "ckn": {
+ "description": "Indicates the Connectivity Association Key Name (CKN) currently being used if MACsec is operational.",
+ "type": "string"
},
- "minMemoryMb": {
- "description": "Minimum memory required to use the Instance. Enforced at Instance creation and Instance start.",
- "format": "int32",
- "type": "integer"
+ "operational": {
+ "description": "Indicates whether or not MACsec is operational on this link.",
+ "type": "boolean"
}
},
"type": "object"
},
- "LicensesListResponse": {
- "id": "LicensesListResponse",
+ "InterconnectList": {
+ "description": "Response to the list request, and contains a list of interconnects.",
+ "id": "InterconnectList",
"properties": {
"id": {
"description": "[Output Only] Unique identifier for the resource; defined by the server.",
"type": "string"
},
"items": {
- "description": "A list of License resources.",
+ "description": "A list of Interconnect resources.",
"items": {
- "$ref": "License"
+ "$ref": "Interconnect"
},
"type": "array"
},
+ "kind": {
+ "default": "compute#interconnectList",
+ "description": "[Output Only] Type of resource. Always compute#interconnectList for lists of interconnects.",
+ "type": "string"
+ },
"nextPageToken": {
"description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
"type": "string"
@@ -53364,335 +55489,160 @@
},
"type": "object"
},
- "LocalDisk": {
- "id": "LocalDisk",
- "properties": {
- "diskCount": {
- "description": "Specifies the number of such disks.",
- "format": "int32",
- "type": "integer"
- },
- "diskSizeGb": {
- "description": "Specifies the size of the disk in base-2 GB.",
- "format": "int32",
- "type": "integer"
- },
- "diskType": {
- "description": "Specifies the desired disk type on the node. This disk type must be a local storage type (e.g.: local-ssd). Note that for nodeTemplates, this should be the name of the disk type and not its URL.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "LocalizedMessage": {
- "description": "Provides a localized error message that is safe to return to the user which can be attached to an RPC error.",
- "id": "LocalizedMessage",
+ "InterconnectLocation": {
+ "description": "Represents an Interconnect Attachment (VLAN) Location resource. You can use this resource to find location details about an Interconnect attachment (VLAN). For more information about interconnect attachments, read Creating VLAN Attachments.",
+ "id": "InterconnectLocation",
"properties": {
- "locale": {
- "description": "The locale used following the specification defined at https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Examples are: \"en-US\", \"fr-CH\", \"es-MX\"",
+ "address": {
+ "description": "[Output Only] The postal address of the Point of Presence, each line in the address is separated by a newline character.",
"type": "string"
},
- "message": {
- "description": "The localized error message in the above locale.",
+ "availabilityZone": {
+ "description": "[Output Only] Availability zone for this InterconnectLocation. Within a metropolitan area (metro), maintenance will not be simultaneously scheduled in more than one availability zone. Example: \"zone1\" or \"zone2\".",
"type": "string"
- }
- },
- "type": "object"
- },
- "LocationPolicy": {
- "description": "Configuration for location policy among multiple possible locations (e.g. preferences for zone selection among zones in a single region).",
- "id": "LocationPolicy",
- "properties": {
- "locations": {
- "additionalProperties": {
- "$ref": "LocationPolicyLocation"
+ },
+ "availableFeatures": {
+ "description": "[Output only] List of features available at this InterconnectLocation, which can take one of the following values: - MACSEC ",
+ "items": {
+ "enum": [
+ "IF_MACSEC"
+ ],
+ "enumDescriptions": [
+ "Media Access Control security (MACsec)"
+ ],
+ "type": "string"
},
- "description": "Location configurations mapped by location name. Currently only zone names are supported and must be represented as valid internal URLs, such as zones/us-central1-a.",
- "type": "object"
+ "type": "array"
},
- "targetShape": {
- "description": "Strategy for distributing VMs across zones in a region.",
- "enum": [
- "ANY",
- "ANY_SINGLE_ZONE",
- "BALANCED"
- ],
- "enumDescriptions": [
- "GCE picks zones for creating VM instances to fulfill the requested number of VMs within present resource constraints and to maximize utilization of unused zonal reservations. Recommended for batch workloads that do not require high availability.",
- "GCE always selects a single zone for all the VMs, optimizing for resource quotas, available reservations and general capacity. Recommended for batch workloads that cannot tollerate distribution over multiple zones. This the default shape in Bulk Insert and Capacity Advisor APIs.",
- "GCE prioritizes acquisition of resources, scheduling VMs in zones where resources are available while distributing VMs as evenly as possible across allowed zones to minimize the impact of zonal failure. Recommended for highly available serving workloads."
- ],
+ "availableLinkTypes": {
+ "description": "[Output only] List of link types available at this InterconnectLocation, which can take one of the following values: - LINK_TYPE_ETHERNET_10G_LR - LINK_TYPE_ETHERNET_100G_LR ",
+ "items": {
+ "enum": [
+ "LINK_TYPE_ETHERNET_100G_LR",
+ "LINK_TYPE_ETHERNET_10G_LR"
+ ],
+ "enumDescriptions": [
+ "100G Ethernet, LR Optics.",
+ "10G Ethernet, LR Optics. [(rate_bps) = 10000000000];"
+ ],
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "city": {
+ "description": "[Output Only] Metropolitan area designator that indicates which city an interconnect is located. For example: \"Chicago, IL\", \"Amsterdam, Netherlands\".",
"type": "string"
- }
- },
- "type": "object"
- },
- "LocationPolicyLocation": {
- "id": "LocationPolicyLocation",
- "properties": {
- "constraints": {
- "$ref": "LocationPolicyLocationConstraints",
- "description": "Constraints that the caller requires on the result distribution in this zone."
},
- "preference": {
- "description": "Preference for a given location. Set to either ALLOW or DENY.",
+ "continent": {
+ "description": "[Output Only] Continent for this location, which can take one of the following values: - AFRICA - ASIA_PAC - EUROPE - NORTH_AMERICA - SOUTH_AMERICA ",
"enum": [
- "ALLOW",
- "DENY",
- "PREFERENCE_UNSPECIFIED"
+ "AFRICA",
+ "ASIA_PAC",
+ "C_AFRICA",
+ "C_ASIA_PAC",
+ "C_EUROPE",
+ "C_NORTH_AMERICA",
+ "C_SOUTH_AMERICA",
+ "EUROPE",
+ "NORTH_AMERICA",
+ "SOUTH_AMERICA"
],
"enumDescriptions": [
- "Location is allowed for use.",
- "Location is prohibited.",
- "Default value, unused."
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
],
"type": "string"
- }
- },
- "type": "object"
- },
- "LocationPolicyLocationConstraints": {
- "description": "Per-zone constraints on location policy for this zone.",
- "id": "LocationPolicyLocationConstraints",
- "properties": {
- "maxCount": {
- "description": "Maximum number of items that are allowed to be placed in this zone. The value must be non-negative.",
- "format": "int32",
- "type": "integer"
- }
- },
- "type": "object"
- },
- "LogConfig": {
- "description": "This is deprecated and has no effect. Do not use.",
- "id": "LogConfig",
- "properties": {
- "cloudAudit": {
- "$ref": "LogConfigCloudAuditOptions",
- "description": "This is deprecated and has no effect. Do not use."
},
- "counter": {
- "$ref": "LogConfigCounterOptions",
- "description": "This is deprecated and has no effect. Do not use."
+ "creationTimestamp": {
+ "description": "[Output Only] Creation timestamp in RFC3339 text format.",
+ "type": "string"
},
- "dataAccess": {
- "$ref": "LogConfigDataAccessOptions",
- "description": "This is deprecated and has no effect. Do not use."
- }
- },
- "type": "object"
- },
- "LogConfigCloudAuditOptions": {
- "description": "This is deprecated and has no effect. Do not use.",
- "id": "LogConfigCloudAuditOptions",
- "properties": {
- "authorizationLoggingOptions": {
- "$ref": "AuthorizationLoggingOptions",
- "description": "This is deprecated and has no effect. Do not use."
+ "description": {
+ "description": "[Output Only] An optional description of the resource.",
+ "type": "string"
},
- "logName": {
- "description": "This is deprecated and has no effect. Do not use.",
- "enum": [
- "ADMIN_ACTIVITY",
- "DATA_ACCESS",
- "UNSPECIFIED_LOG_NAME"
- ],
- "enumDescriptions": [
- "This is deprecated and has no effect. Do not use.",
- "This is deprecated and has no effect. Do not use.",
- "This is deprecated and has no effect. Do not use."
- ],
+ "facilityProvider": {
+ "description": "[Output Only] The name of the provider for this facility (e.g., EQUINIX).",
"type": "string"
- }
- },
- "type": "object"
- },
- "LogConfigCounterOptions": {
- "description": "This is deprecated and has no effect. Do not use.",
- "id": "LogConfigCounterOptions",
- "properties": {
- "customFields": {
- "description": "This is deprecated and has no effect. Do not use.",
- "items": {
- "$ref": "LogConfigCounterOptionsCustomField"
- },
- "type": "array"
},
- "field": {
- "description": "This is deprecated and has no effect. Do not use.",
+ "facilityProviderFacilityId": {
+ "description": "[Output Only] A provider-assigned Identifier for this facility (e.g., Ashburn-DC1).",
"type": "string"
},
- "metric": {
- "description": "This is deprecated and has no effect. Do not use.",
+ "id": {
+ "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.",
+ "format": "uint64",
"type": "string"
- }
- },
- "type": "object"
- },
- "LogConfigCounterOptionsCustomField": {
- "description": "This is deprecated and has no effect. Do not use.",
- "id": "LogConfigCounterOptionsCustomField",
- "properties": {
+ },
+ "kind": {
+ "default": "compute#interconnectLocation",
+ "description": "[Output Only] Type of the resource. Always compute#interconnectLocation for interconnect locations.",
+ "type": "string"
+ },
"name": {
- "description": "This is deprecated and has no effect. Do not use.",
+ "description": "[Output Only] Name of the resource.",
"type": "string"
},
- "value": {
- "description": "This is deprecated and has no effect. Do not use.",
+ "peeringdbFacilityId": {
+ "description": "[Output Only] The peeringdb identifier for this facility (corresponding with a netfac type in peeringdb).",
"type": "string"
- }
- },
- "type": "object"
- },
- "LogConfigDataAccessOptions": {
- "description": "This is deprecated and has no effect. Do not use.",
- "id": "LogConfigDataAccessOptions",
- "properties": {
- "logMode": {
- "description": "This is deprecated and has no effect. Do not use.",
+ },
+ "regionInfos": {
+ "description": "[Output Only] A list of InterconnectLocation.RegionInfo objects, that describe parameters pertaining to the relation between this InterconnectLocation and various Google Cloud regions.",
+ "items": {
+ "$ref": "InterconnectLocationRegionInfo"
+ },
+ "type": "array"
+ },
+ "selfLink": {
+ "description": "[Output Only] Server-defined URL for the resource.",
+ "type": "string"
+ },
+ "status": {
+ "description": "[Output Only] The status of this InterconnectLocation, which can take one of the following values: - CLOSED: The InterconnectLocation is closed and is unavailable for provisioning new Interconnects. - AVAILABLE: The InterconnectLocation is available for provisioning new Interconnects. ",
"enum": [
- "LOG_FAIL_CLOSED",
- "LOG_MODE_UNSPECIFIED"
+ "AVAILABLE",
+ "CLOSED"
],
"enumDescriptions": [
- "This is deprecated and has no effect. Do not use.",
- "This is deprecated and has no effect. Do not use."
+ "The InterconnectLocation is available for provisioning new Interconnects.",
+ "The InterconnectLocation is closed for provisioning new Interconnects."
],
"type": "string"
+ },
+ "supportsPzs": {
+ "description": "[Output Only] Reserved for future use.",
+ "type": "boolean"
}
},
"type": "object"
},
- "MachineImage": {
- "description": "Represents a machine image resource. A machine image is a Compute Engine resource that stores all the configuration, metadata, permissions, and data from one or more disks required to create a Virtual machine (VM) instance. For more information, see Machine images.",
- "id": "MachineImage",
- "properties": {
- "creationTimestamp": {
- "description": "[Output Only] The creation timestamp for this machine image in RFC3339 text format.",
- "type": "string"
- },
- "description": {
- "description": "An optional description of this resource. Provide this property when you create the resource.",
- "type": "string"
- },
- "guestFlush": {
- "description": "[Input Only] Whether to attempt an application consistent machine image by informing the OS to prepare for the snapshot process.",
- "type": "boolean"
- },
- "id": {
- "description": "[Output Only] A unique identifier for this machine image. The server defines this identifier.",
- "format": "uint64",
- "type": "string"
- },
- "instanceProperties": {
- "$ref": "InstanceProperties",
- "description": "[Output Only] Properties of source instance"
- },
- "kind": {
- "default": "compute#machineImage",
- "description": "[Output Only] The resource type, which is always compute#machineImage for machine image.",
- "type": "string"
- },
- "machineImageEncryptionKey": {
- "$ref": "CustomerEncryptionKey",
- "description": "Encrypts the machine image using a customer-supplied encryption key. After you encrypt a machine image using a customer-supplied key, you must provide the same key if you use the machine image later. For example, you must provide the encryption key when you create an instance from the encrypted machine image in a future request. Customer-supplied encryption keys do not protect access to metadata of the machine image. If you do not provide an encryption key when creating the machine image, then the machine image will be encrypted using an automatically generated key and you do not need to provide a key to use the machine image later."
- },
- "name": {
- "annotations": {
- "required": [
- "compute.machineImages.insert"
- ]
- },
- "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- "type": "string"
- },
- "satisfiesPzi": {
- "description": "Output only. Reserved for future use.",
- "readOnly": true,
- "type": "boolean"
- },
- "satisfiesPzs": {
- "description": "[Output Only] Reserved for future use.",
- "type": "boolean"
- },
- "savedDisks": {
- "description": "An array of Machine Image specific properties for disks attached to the source instance",
- "items": {
- "$ref": "SavedDisk"
- },
- "type": "array"
- },
- "selfLink": {
- "description": "[Output Only] The URL for this machine image. The server defines this URL.",
- "type": "string"
- },
- "sourceDiskEncryptionKeys": {
- "description": "[Input Only] The customer-supplied encryption key of the disks attached to the source instance. Required if the source disk is protected by a customer-supplied encryption key.",
- "items": {
- "$ref": "SourceDiskEncryptionKey"
- },
- "type": "array"
- },
- "sourceInstance": {
- "description": "The source instance used to create the machine image. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /instances/instance - projects/project/zones/zone/instances/instance ",
- "type": "string"
- },
- "sourceInstanceProperties": {
- "$ref": "SourceInstanceProperties",
- "description": "[Output Only] DEPRECATED: Please use instance_properties instead for source instance related properties. New properties will not be added to this field."
- },
- "status": {
- "description": "[Output Only] The status of the machine image. One of the following values: INVALID, CREATING, READY, DELETING, and UPLOADING.",
- "enum": [
- "CREATING",
- "DELETING",
- "INVALID",
- "READY",
- "UPLOADING"
- ],
- "enumDescriptions": [
- "",
- "",
- "",
- "",
- ""
- ],
- "type": "string"
- },
- "storageLocations": {
- "description": "The regional or multi-regional Cloud Storage bucket location where the machine image is stored.",
- "items": {
- "type": "string"
- },
- "type": "array"
- },
- "totalStorageBytes": {
- "description": "[Output Only] Total size of the storage used by the machine image.",
- "format": "int64",
- "type": "string"
- }
- },
- "type": "object"
- },
- "MachineImageList": {
- "description": "A list of machine images.",
- "id": "MachineImageList",
+ "InterconnectLocationList": {
+ "description": "Response to the list request, and contains a list of interconnect locations.",
+ "id": "InterconnectLocationList",
"properties": {
"id": {
"description": "[Output Only] Unique identifier for the resource; defined by the server.",
"type": "string"
},
"items": {
- "description": "A list of MachineImage resources.",
+ "description": "A list of InterconnectLocation resources.",
"items": {
- "$ref": "MachineImage"
+ "$ref": "InterconnectLocation"
},
"type": "array"
},
"kind": {
- "default": "compute#machineImageList",
- "description": "[Output Only] The resource type, which is always compute#machineImagesListResponse for machine image lists.",
+ "default": "compute#interconnectLocationList",
+ "description": "[Output Only] Type of resource. Always compute#interconnectLocationList for lists of interconnect locations.",
"type": "string"
},
"nextPageToken": {
@@ -53827,144 +55777,386 @@
},
"type": "object"
},
- "MachineType": {
- "description": "Represents a Machine Type resource. You can use specific machine types for your VM instances based on performance and pricing requirements. For more information, read Machine Types.",
- "id": "MachineType",
+ "InterconnectLocationRegionInfo": {
+ "description": "Information about any potential InterconnectAttachments between an Interconnect at a specific InterconnectLocation, and a specific Cloud Region.",
+ "id": "InterconnectLocationRegionInfo",
"properties": {
- "accelerators": {
- "description": "[Output Only] A list of accelerator configurations assigned to this machine type.",
+ "expectedRttMs": {
+ "description": "Expected round-trip time in milliseconds, from this InterconnectLocation to a VM in this region.",
+ "format": "int64",
+ "type": "string"
+ },
+ "locationPresence": {
+ "description": "Identifies the network presence of this location.",
+ "enum": [
+ "GLOBAL",
+ "LOCAL_REGION",
+ "LP_GLOBAL",
+ "LP_LOCAL_REGION"
+ ],
+ "enumDescriptions": [
+ "This region is not in any common network presence with this InterconnectLocation.",
+ "This region shares the same regional network presence as this InterconnectLocation.",
+ "[Deprecated] This region is not in any common network presence with this InterconnectLocation.",
+ "[Deprecated] This region shares the same regional network presence as this InterconnectLocation."
+ ],
+ "type": "string"
+ },
+ "region": {
+ "description": "URL for the region of this location.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "InterconnectMacsec": {
+ "description": "Configuration information for enabling Media Access Control security (MACsec) on this Cloud Interconnect connection between Google and your on-premises router.",
+ "id": "InterconnectMacsec",
+ "properties": {
+ "failOpen": {
+ "description": "If set to true, the Interconnect connection is configured with a should-secure MACsec security policy, that allows the Google router to fallback to cleartext traffic if the MKA session cannot be established. By default, the Interconnect connection is configured with a must-secure security policy that drops all traffic if the MKA session cannot be established with your router.",
+ "type": "boolean"
+ },
+ "preSharedKeys": {
+ "description": "Required. A keychain placeholder describing a set of named key objects along with their start times. A MACsec CKN/CAK is generated for each key in the key chain. Google router automatically picks the key with the most recent startTime when establishing or re-establishing a MACsec secure link.",
"items": {
- "properties": {
- "guestAcceleratorCount": {
- "description": "Number of accelerator cards exposed to the guest.",
- "format": "int32",
- "type": "integer"
- },
- "guestAcceleratorType": {
- "description": "The accelerator type resource name, not a full URL, e.g. nvidia-tesla-t4.",
- "type": "string"
- }
- },
- "type": "object"
+ "$ref": "InterconnectMacsecPreSharedKey"
+ },
+ "type": "array"
+ }
+ },
+ "type": "object"
+ },
+ "InterconnectMacsecConfig": {
+ "description": "MACsec configuration information for the Interconnect connection. Contains the generated Connectivity Association Key Name (CKN) and the key (CAK) for this Interconnect connection.",
+ "id": "InterconnectMacsecConfig",
+ "properties": {
+ "preSharedKeys": {
+ "description": "A keychain placeholder describing a set of named key objects along with their start times. A MACsec CKN/CAK is generated for each key in the key chain. Google router automatically picks the key with the most recent startTime when establishing or re-establishing a MACsec secure link.",
+ "items": {
+ "$ref": "InterconnectMacsecConfigPreSharedKey"
+ },
+ "type": "array"
+ }
+ },
+ "type": "object"
+ },
+ "InterconnectMacsecConfigPreSharedKey": {
+ "description": "Describes a pre-shared key used to setup MACsec in static connectivity association key (CAK) mode.",
+ "id": "InterconnectMacsecConfigPreSharedKey",
+ "properties": {
+ "cak": {
+ "description": "An auto-generated Connectivity Association Key (CAK) for this key.",
+ "type": "string"
+ },
+ "ckn": {
+ "description": "An auto-generated Connectivity Association Key Name (CKN) for this key.",
+ "type": "string"
+ },
+ "name": {
+ "description": "User provided name for this pre-shared key.",
+ "type": "string"
+ },
+ "startTime": {
+ "description": "User provided timestamp on or after which this key is valid.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "InterconnectMacsecPreSharedKey": {
+ "description": "Describes a pre-shared key used to setup MACsec in static connectivity association key (CAK) mode.",
+ "id": "InterconnectMacsecPreSharedKey",
+ "properties": {
+ "name": {
+ "description": "Required. A name for this pre-shared key. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.",
+ "type": "string"
+ },
+ "startTime": {
+ "description": "A RFC3339 timestamp on or after which the key is valid. startTime can be in the future. If the keychain has a single key, startTime can be omitted. If the keychain has multiple keys, startTime is mandatory for each key. The start times of keys must be in increasing order. The start times of two consecutive keys must be at least 6 hours apart.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "InterconnectOutageNotification": {
+ "description": "Description of a planned outage on this Interconnect.",
+ "id": "InterconnectOutageNotification",
+ "properties": {
+ "affectedCircuits": {
+ "description": "If issue_type is IT_PARTIAL_OUTAGE, a list of the Google-side circuit IDs that will be affected.",
+ "items": {
+ "type": "string"
},
"type": "array"
},
+ "description": {
+ "description": "A description about the purpose of the outage.",
+ "type": "string"
+ },
+ "endTime": {
+ "description": "Scheduled end time for the outage (milliseconds since Unix epoch).",
+ "format": "int64",
+ "type": "string"
+ },
+ "issueType": {
+ "description": "Form this outage is expected to take, which can take one of the following values: - OUTAGE: The Interconnect may be completely out of service for some or all of the specified window. - PARTIAL_OUTAGE: Some circuits comprising the Interconnect as a whole should remain up, but with reduced bandwidth. Note that the versions of this enum prefixed with \"IT_\" have been deprecated in favor of the unprefixed values.",
+ "enum": [
+ "IT_OUTAGE",
+ "IT_PARTIAL_OUTAGE",
+ "OUTAGE",
+ "PARTIAL_OUTAGE"
+ ],
+ "enumDescriptions": [
+ "[Deprecated] The Interconnect may be completely out of service for some or all of the specified window.",
+ "[Deprecated] Some circuits comprising the Interconnect will be out of service during the expected window. The interconnect as a whole should remain up, albeit with reduced bandwidth.",
+ "The Interconnect may be completely out of service for some or all of the specified window.",
+ "Some circuits comprising the Interconnect will be out of service during the expected window. The interconnect as a whole should remain up, albeit with reduced bandwidth."
+ ],
+ "type": "string"
+ },
+ "name": {
+ "description": "Unique identifier for this outage notification.",
+ "type": "string"
+ },
+ "source": {
+ "description": "The party that generated this notification, which can take the following value: - GOOGLE: this notification as generated by Google. Note that the value of NSRC_GOOGLE has been deprecated in favor of GOOGLE.",
+ "enum": [
+ "GOOGLE",
+ "NSRC_GOOGLE"
+ ],
+ "enumDescriptions": [
+ "This notification was generated by Google.",
+ "[Deprecated] This notification was generated by Google."
+ ],
+ "type": "string"
+ },
+ "startTime": {
+ "description": "Scheduled start time for the outage (milliseconds since Unix epoch).",
+ "format": "int64",
+ "type": "string"
+ },
+ "state": {
+ "description": "State of this notification, which can take one of the following values: - ACTIVE: This outage notification is active. The event could be in the past, present, or future. See start_time and end_time for scheduling. - CANCELLED: The outage associated with this notification was cancelled before the outage was due to start. - COMPLETED: The outage associated with this notification is complete. Note that the versions of this enum prefixed with \"NS_\" have been deprecated in favor of the unprefixed values.",
+ "enum": [
+ "ACTIVE",
+ "CANCELLED",
+ "COMPLETED",
+ "NS_ACTIVE",
+ "NS_CANCELED"
+ ],
+ "enumDescriptions": [
+ "This outage notification is active. The event could be in the future, present, or past. See start_time and end_time for scheduling.",
+ "The outage associated with this notification was cancelled before the outage was due to start.",
+ "The outage associated with this notification is complete.",
+ "[Deprecated] This outage notification is active. The event could be in the future, present, or past. See start_time and end_time for scheduling.",
+ "[Deprecated] The outage associated with this notification was canceled before the outage was due to start."
+ ],
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "InterconnectRemoteLocation": {
+ "description": "Represents a Cross-Cloud Interconnect Remote Location resource. You can use this resource to find remote location details about an Interconnect attachment (VLAN).",
+ "id": "InterconnectRemoteLocation",
+ "properties": {
+ "address": {
+ "description": "[Output Only] The postal address of the Point of Presence, each line in the address is separated by a newline character.",
+ "type": "string"
+ },
+ "attachmentConfigurationConstraints": {
+ "$ref": "InterconnectAttachmentConfigurationConstraints",
+ "description": "[Output Only] Subset of fields from InterconnectAttachment's |configurationConstraints| field that apply to all attachments for this remote location."
+ },
+ "city": {
+ "description": "[Output Only] Metropolitan area designator that indicates which city an interconnect is located. For example: \"Chicago, IL\", \"Amsterdam, Netherlands\".",
+ "type": "string"
+ },
+ "constraints": {
+ "$ref": "InterconnectRemoteLocationConstraints",
+ "description": "[Output Only] Constraints on the parameters for creating Cross-Cloud Interconnect and associated InterconnectAttachments."
+ },
+ "continent": {
+ "description": "[Output Only] Continent for this location, which can take one of the following values: - AFRICA - ASIA_PAC - EUROPE - NORTH_AMERICA - SOUTH_AMERICA ",
+ "enum": [
+ "AFRICA",
+ "ASIA_PAC",
+ "EUROPE",
+ "NORTH_AMERICA",
+ "SOUTH_AMERICA"
+ ],
+ "enumDescriptions": [
+ "",
+ "",
+ "",
+ "",
+ ""
+ ],
+ "type": "string"
+ },
"creationTimestamp": {
"description": "[Output Only] Creation timestamp in RFC3339 text format.",
"type": "string"
},
- "deprecated": {
- "$ref": "DeprecationStatus",
- "description": "[Output Only] The deprecation status associated with this machine type. Only applicable if the machine type is unavailable."
- },
"description": {
- "description": "[Output Only] An optional textual description of the resource.",
+ "description": "[Output Only] An optional description of the resource.",
"type": "string"
},
- "guestCpus": {
- "description": "[Output Only] The number of virtual CPUs that are available to the instance.",
- "format": "int32",
- "type": "integer"
+ "facilityProvider": {
+ "description": "[Output Only] The name of the provider for this facility (e.g., EQUINIX).",
+ "type": "string"
+ },
+ "facilityProviderFacilityId": {
+ "description": "[Output Only] A provider-assigned Identifier for this facility (e.g., Ashburn-DC1).",
+ "type": "string"
},
"id": {
"description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.",
"format": "uint64",
"type": "string"
},
- "imageSpaceGb": {
- "description": "[Deprecated] This property is deprecated and will never be populated with any relevant values.",
- "format": "int32",
- "type": "integer"
- },
- "isSharedCpu": {
- "description": "[Output Only] Whether this machine type has a shared CPU. See Shared-core machine types for more information.",
- "type": "boolean"
- },
"kind": {
- "default": "compute#machineType",
- "description": "[Output Only] The type of the resource. Always compute#machineType for machine types.",
+ "default": "compute#interconnectRemoteLocation",
+ "description": "[Output Only] Type of the resource. Always compute#interconnectRemoteLocation for interconnect remote locations.",
"type": "string"
},
- "maximumPersistentDisks": {
- "description": "[Output Only] Maximum persistent disks allowed.",
+ "lacp": {
+ "description": "[Output Only] Link Aggregation Control Protocol (LACP) constraints, which can take one of the following values: LACP_SUPPORTED, LACP_UNSUPPORTED",
+ "enum": [
+ "LACP_SUPPORTED",
+ "LACP_UNSUPPORTED"
+ ],
+ "enumDescriptions": [
+ "LACP_SUPPORTED: LACP is supported, and enabled by default on the Cross-Cloud Interconnect.",
+ "LACP_UNSUPPORTED: LACP is not supported and is not be enabled on this port. GetDiagnostics shows bundleAggregationType as \"static\". GCP does not support LAGs without LACP, so requestedLinkCount must be 1."
+ ],
+ "type": "string"
+ },
+ "maxLagSize100Gbps": {
+ "description": "[Output Only] The maximum number of 100 Gbps ports supported in a link aggregation group (LAG). When linkType is 100 Gbps, requestedLinkCount cannot exceed max_lag_size_100_gbps.",
"format": "int32",
"type": "integer"
},
- "maximumPersistentDisksSizeGb": {
- "description": "[Output Only] Maximum total persistent disks size (GB) allowed.",
- "format": "int64",
- "type": "string"
- },
- "memoryMb": {
- "description": "[Output Only] The amount of physical memory available to the instance, defined in MB.",
+ "maxLagSize10Gbps": {
+ "description": "[Output Only] The maximum number of 10 Gbps ports supported in a link aggregation group (LAG). When linkType is 10 Gbps, requestedLinkCount cannot exceed max_lag_size_10_gbps.",
"format": "int32",
"type": "integer"
},
"name": {
"description": "[Output Only] Name of the resource.",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
"type": "string"
},
- "scratchDisks": {
- "description": "[Output Only] A list of extended scratch disks assigned to the instance.",
+ "peeringdbFacilityId": {
+ "description": "[Output Only] The peeringdb identifier for this facility (corresponding with a netfac type in peeringdb).",
+ "type": "string"
+ },
+ "permittedConnections": {
+ "description": "[Output Only] Permitted connections.",
"items": {
- "properties": {
- "diskGb": {
- "description": "Size of the scratch disk, defined in GB.",
- "format": "int32",
- "type": "integer"
- }
- },
- "type": "object"
+ "$ref": "InterconnectRemoteLocationPermittedConnections"
},
"type": "array"
},
+ "remoteService": {
+ "description": "[Output Only] Indicates the service provider present at the remote location. Example values: \"Amazon Web Services\", \"Microsoft Azure\".",
+ "type": "string"
+ },
"selfLink": {
"description": "[Output Only] Server-defined URL for the resource.",
"type": "string"
},
- "zone": {
- "description": "[Output Only] The name of the zone where the machine type resides, such as us-central1-a.",
+ "status": {
+ "description": "[Output Only] The status of this InterconnectRemoteLocation, which can take one of the following values: - CLOSED: The InterconnectRemoteLocation is closed and is unavailable for provisioning new Cross-Cloud Interconnects. - AVAILABLE: The InterconnectRemoteLocation is available for provisioning new Cross-Cloud Interconnects. ",
+ "enum": [
+ "AVAILABLE",
+ "CLOSED"
+ ],
+ "enumDescriptions": [
+ "The InterconnectRemoteLocation is available for provisioning new Cross-Cloud Interconnects.",
+ "The InterconnectRemoteLocation is closed for provisioning new Cross-Cloud Interconnects."
+ ],
"type": "string"
}
},
"type": "object"
},
- "MachineTypeAggregatedList": {
- "id": "MachineTypeAggregatedList",
+ "InterconnectRemoteLocationConstraints": {
+ "id": "InterconnectRemoteLocationConstraints",
+ "properties": {
+ "portPairRemoteLocation": {
+ "description": "[Output Only] Port pair remote location constraints, which can take one of the following values: PORT_PAIR_UNCONSTRAINED_REMOTE_LOCATION, PORT_PAIR_MATCHING_REMOTE_LOCATION. Google Cloud API refers only to individual ports, but the UI uses this field when ordering a pair of ports, to prevent users from accidentally ordering something that is incompatible with their cloud provider. Specifically, when ordering a redundant pair of Cross-Cloud Interconnect ports, and one of them uses a remote location with portPairMatchingRemoteLocation set to matching, the UI requires that both ports use the same remote location.",
+ "enum": [
+ "PORT_PAIR_MATCHING_REMOTE_LOCATION",
+ "PORT_PAIR_UNCONSTRAINED_REMOTE_LOCATION"
+ ],
+ "enumDescriptions": [
+ "If PORT_PAIR_MATCHING_REMOTE_LOCATION, the remote cloud provider allocates ports in pairs, and the user should choose the same remote location for both ports.",
+ "If PORT_PAIR_UNCONSTRAINED_REMOTE_LOCATION, a user may opt to provision a redundant pair of Cross-Cloud Interconnects using two different remote locations in the same city."
+ ],
+ "type": "string"
+ },
+ "portPairVlan": {
+ "description": "[Output Only] Port pair VLAN constraints, which can take one of the following values: PORT_PAIR_UNCONSTRAINED_VLAN, PORT_PAIR_MATCHING_VLAN",
+ "enum": [
+ "PORT_PAIR_MATCHING_VLAN",
+ "PORT_PAIR_UNCONSTRAINED_VLAN"
+ ],
+ "enumDescriptions": [
+ "If PORT_PAIR_MATCHING_VLAN, the Interconnect for this attachment is part of a pair of ports that should have matching VLAN allocations. This occurs with Cross-Cloud Interconnect to Azure remote locations. While GCP's API does not explicitly group pairs of ports, the UI uses this field to ensure matching VLAN ids when configuring a redundant VLAN pair.",
+ "PORT_PAIR_UNCONSTRAINED_VLAN means there is no constraint."
+ ],
+ "type": "string"
+ },
+ "subnetLengthRange": {
+ "$ref": "InterconnectRemoteLocationConstraintsSubnetLengthRange",
+ "description": "[Output Only] [min-length, max-length] The minimum and maximum value (inclusive) for the IPv4 subnet length. For example, an interconnectRemoteLocation for Azure has {min: 30, max: 30} because Azure requires /30 subnets. This range specifies the values supported by both cloud providers. Interconnect currently supports /29 and /30 IPv4 subnet lengths. If a remote cloud has no constraint on IPv4 subnet length, the range would thus be {min: 29, max: 30}. "
+ }
+ },
+ "type": "object"
+ },
+ "InterconnectRemoteLocationConstraintsSubnetLengthRange": {
+ "id": "InterconnectRemoteLocationConstraintsSubnetLengthRange",
+ "properties": {
+ "max": {
+ "format": "int32",
+ "type": "integer"
+ },
+ "min": {
+ "format": "int32",
+ "type": "integer"
+ }
+ },
+ "type": "object"
+ },
+ "InterconnectRemoteLocationList": {
+ "description": "Response to the list request, and contains a list of interconnect remote locations.",
+ "id": "InterconnectRemoteLocationList",
"properties": {
"id": {
"description": "[Output Only] Unique identifier for the resource; defined by the server.",
"type": "string"
},
"items": {
- "additionalProperties": {
- "$ref": "MachineTypesScopedList",
- "description": "[Output Only] Name of the scope containing this set of machine types."
+ "description": "A list of InterconnectRemoteLocation resources.",
+ "items": {
+ "$ref": "InterconnectRemoteLocation"
},
- "description": "A list of MachineTypesScopedList resources.",
- "type": "object"
+ "type": "array"
},
"kind": {
- "default": "compute#machineTypeAggregatedList",
- "description": "[Output Only] Type of resource. Always compute#machineTypeAggregatedList for aggregated lists of machine types.",
+ "default": "compute#interconnectRemoteLocationList",
+ "description": "[Output Only] Type of resource. Always compute#interconnectRemoteLocationList for lists of interconnect remote locations.",
"type": "string"
},
"nextPageToken": {
- "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
+ "description": "[Output Only] This token lets you get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
"type": "string"
},
"selfLink": {
"description": "[Output Only] Server-defined URL for this resource.",
"type": "string"
},
- "unreachables": {
- "description": "[Output Only] Unreachable resources.",
- "items": {
- "type": "string"
- },
- "type": "array"
- },
"warning": {
"description": "[Output Only] Informational warning message.",
"properties": {
@@ -54089,26 +56281,227 @@
},
"type": "object"
},
- "MachineTypeList": {
- "description": "Contains a list of machine types.",
- "id": "MachineTypeList",
+ "InterconnectRemoteLocationPermittedConnections": {
+ "id": "InterconnectRemoteLocationPermittedConnections",
+ "properties": {
+ "interconnectLocation": {
+ "description": "[Output Only] URL of an Interconnect location that is permitted to connect to this Interconnect remote location.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "InterconnectsGetDiagnosticsResponse": {
+ "description": "Response for the InterconnectsGetDiagnosticsRequest.",
+ "id": "InterconnectsGetDiagnosticsResponse",
+ "properties": {
+ "result": {
+ "$ref": "InterconnectDiagnostics"
+ }
+ },
+ "type": "object"
+ },
+ "InterconnectsGetMacsecConfigResponse": {
+ "description": "Response for the InterconnectsGetMacsecConfigRequest.",
+ "id": "InterconnectsGetMacsecConfigResponse",
+ "properties": {
+ "etag": {
+ "description": "end_interface: MixerGetResponseWithEtagBuilder",
+ "type": "string"
+ },
+ "result": {
+ "$ref": "InterconnectMacsecConfig"
+ }
+ },
+ "type": "object"
+ },
+ "License": {
+ "description": "Represents a License resource. A License represents billing and aggregate usage data for public and marketplace images. *Caution* This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. ",
+ "id": "License",
"properties": {
+ "chargesUseFee": {
+ "description": "[Output Only] Deprecated. This field no longer reflects whether a license charges a usage fee.",
+ "type": "boolean"
+ },
+ "creationTimestamp": {
+ "description": "[Output Only] Creation timestamp in RFC3339 text format.",
+ "type": "string"
+ },
+ "description": {
+ "description": "An optional textual description of the resource; provided by the client when the resource is created.",
+ "type": "string"
+ },
"id": {
- "description": "[Output Only] Unique identifier for the resource; defined by the server.",
+ "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.",
+ "format": "uint64",
"type": "string"
},
- "items": {
- "description": "A list of MachineType resources.",
+ "kind": {
+ "default": "compute#license",
+ "description": "[Output Only] Type of resource. Always compute#license for licenses.",
+ "type": "string"
+ },
+ "licenseCode": {
+ "description": "[Output Only] The unique code used to attach this license to images, snapshots, and disks.",
+ "format": "uint64",
+ "type": "string"
+ },
+ "name": {
+ "annotations": {
+ "required": [
+ "compute.images.insert"
+ ]
+ },
+ "description": "Name of the resource. The name must be 1-63 characters long and comply with RFC1035.",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "type": "string"
+ },
+ "resourceRequirements": {
+ "$ref": "LicenseResourceRequirements"
+ },
+ "selfLink": {
+ "description": "[Output Only] Server-defined URL for the resource.",
+ "type": "string"
+ },
+ "transferable": {
+ "description": "If false, licenses will not be copied from the source resource when creating an image from a disk, disk from snapshot, or snapshot from disk.",
+ "type": "boolean"
+ }
+ },
+ "type": "object"
+ },
+ "LicenseCode": {
+ "description": "Represents a License Code resource. A License Code is a unique identifier used to represent a license resource. *Caution* This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. ",
+ "id": "LicenseCode",
+ "properties": {
+ "creationTimestamp": {
+ "description": "[Output Only] Creation timestamp in RFC3339 text format.",
+ "type": "string"
+ },
+ "description": {
+ "description": "[Output Only] Description of this License Code.",
+ "type": "string"
+ },
+ "id": {
+ "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.",
+ "format": "uint64",
+ "type": "string"
+ },
+ "kind": {
+ "default": "compute#licenseCode",
+ "description": "[Output Only] Type of resource. Always compute#licenseCode for licenses.",
+ "type": "string"
+ },
+ "licenseAlias": {
+ "description": "[Output Only] URL and description aliases of Licenses with the same License Code.",
"items": {
- "$ref": "MachineType"
+ "$ref": "LicenseCodeLicenseAlias"
},
"type": "array"
},
- "kind": {
- "default": "compute#machineTypeList",
- "description": "[Output Only] Type of resource. Always compute#machineTypeList for lists of machine types.",
+ "name": {
+ "annotations": {
+ "required": [
+ "compute.licenses.insert"
+ ]
+ },
+ "description": "[Output Only] Name of the resource. The name is 1-20 characters long and must be a valid 64 bit integer.",
+ "pattern": "[0-9]{0,20}?",
+ "type": "string"
+ },
+ "selfLink": {
+ "description": "[Output Only] Server-defined URL for the resource.",
+ "type": "string"
+ },
+ "state": {
+ "description": "[Output Only] Current state of this License Code.",
+ "enum": [
+ "DISABLED",
+ "ENABLED",
+ "RESTRICTED",
+ "STATE_UNSPECIFIED",
+ "TERMINATED"
+ ],
+ "enumDescriptions": [
+ "Machines are not allowed to attach boot disks with this License Code. Requests to create new resources with this license will be rejected.",
+ "Use is allowed for anyone with USE_READ_ONLY access to this License Code.",
+ "Use of this license is limited to a project whitelist.",
+ "",
+ "Reserved state."
+ ],
+ "type": "string"
+ },
+ "transferable": {
+ "description": "[Output Only] If true, the license will remain attached when creating images or snapshots from disks. Otherwise, the license is not transferred.",
+ "type": "boolean"
+ }
+ },
+ "type": "object"
+ },
+ "LicenseCodeLicenseAlias": {
+ "id": "LicenseCodeLicenseAlias",
+ "properties": {
+ "description": {
+ "description": "[Output Only] Description of this License Code.",
+ "type": "string"
+ },
+ "selfLink": {
+ "description": "[Output Only] URL of license corresponding to this License Code.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "LicenseResourceCommitment": {
+ "description": "Commitment for a particular license resource.",
+ "id": "LicenseResourceCommitment",
+ "properties": {
+ "amount": {
+ "description": "The number of licenses purchased.",
+ "format": "int64",
+ "type": "string"
+ },
+ "coresPerLicense": {
+ "description": "Specifies the core range of the instance for which this license applies.",
+ "type": "string"
+ },
+ "license": {
+ "description": "Any applicable license URI.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "LicenseResourceRequirements": {
+ "id": "LicenseResourceRequirements",
+ "properties": {
+ "minGuestCpuCount": {
+ "description": "Minimum number of guest cpus required to use the Instance. Enforced at Instance creation and Instance start.",
+ "format": "int32",
+ "type": "integer"
+ },
+ "minMemoryMb": {
+ "description": "Minimum memory required to use the Instance. Enforced at Instance creation and Instance start.",
+ "format": "int32",
+ "type": "integer"
+ }
+ },
+ "type": "object"
+ },
+ "LicensesListResponse": {
+ "id": "LicensesListResponse",
+ "properties": {
+ "id": {
+ "description": "[Output Only] Unique identifier for the resource; defined by the server.",
"type": "string"
},
+ "items": {
+ "description": "A list of License resources.",
+ "items": {
+ "$ref": "License"
+ },
+ "type": "array"
+ },
"nextPageToken": {
"description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
"type": "string"
@@ -54241,18 +56634,247 @@
},
"type": "object"
},
- "MachineTypesScopedList": {
- "id": "MachineTypesScopedList",
+ "LocalDisk": {
+ "id": "LocalDisk",
"properties": {
- "machineTypes": {
- "description": "[Output Only] A list of machine types contained in this scope.",
+ "diskCount": {
+ "description": "Specifies the number of such disks.",
+ "format": "int32",
+ "type": "integer"
+ },
+ "diskSizeGb": {
+ "description": "Specifies the size of the disk in base-2 GB.",
+ "format": "int32",
+ "type": "integer"
+ },
+ "diskType": {
+ "description": "Specifies the desired disk type on the node. This disk type must be a local storage type (e.g.: local-ssd). Note that for nodeTemplates, this should be the name of the disk type and not its URL.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "LocalizedMessage": {
+ "description": "Provides a localized error message that is safe to return to the user which can be attached to an RPC error.",
+ "id": "LocalizedMessage",
+ "properties": {
+ "locale": {
+ "description": "The locale used following the specification defined at https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Examples are: \"en-US\", \"fr-CH\", \"es-MX\"",
+ "type": "string"
+ },
+ "message": {
+ "description": "The localized error message in the above locale.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "LocationPolicy": {
+ "description": "Configuration for location policy among multiple possible locations (e.g. preferences for zone selection among zones in a single region).",
+ "id": "LocationPolicy",
+ "properties": {
+ "locations": {
+ "additionalProperties": {
+ "$ref": "LocationPolicyLocation"
+ },
+ "description": "Location configurations mapped by location name. Currently only zone names are supported and must be represented as valid internal URLs, such as zones/us-central1-a.",
+ "type": "object"
+ },
+ "targetShape": {
+ "description": "Strategy for distributing VMs across zones in a region.",
+ "enum": [
+ "ANY",
+ "ANY_SINGLE_ZONE",
+ "BALANCED"
+ ],
+ "enumDescriptions": [
+ "GCE picks zones for creating VM instances to fulfill the requested number of VMs within present resource constraints and to maximize utilization of unused zonal reservations. Recommended for batch workloads that do not require high availability.",
+ "GCE always selects a single zone for all the VMs, optimizing for resource quotas, available reservations and general capacity. Recommended for batch workloads that cannot tollerate distribution over multiple zones. This the default shape in Bulk Insert and Capacity Advisor APIs.",
+ "GCE prioritizes acquisition of resources, scheduling VMs in zones where resources are available while distributing VMs as evenly as possible across allowed zones to minimize the impact of zonal failure. Recommended for highly available serving workloads."
+ ],
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "LocationPolicyLocation": {
+ "id": "LocationPolicyLocation",
+ "properties": {
+ "constraints": {
+ "$ref": "LocationPolicyLocationConstraints",
+ "description": "Constraints that the caller requires on the result distribution in this zone."
+ },
+ "preference": {
+ "description": "Preference for a given location. Set to either ALLOW or DENY.",
+ "enum": [
+ "ALLOW",
+ "DENY",
+ "PREFERENCE_UNSPECIFIED"
+ ],
+ "enumDescriptions": [
+ "Location is allowed for use.",
+ "Location is prohibited.",
+ "Default value, unused."
+ ],
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "LocationPolicyLocationConstraints": {
+ "description": "Per-zone constraints on location policy for this zone.",
+ "id": "LocationPolicyLocationConstraints",
+ "properties": {
+ "maxCount": {
+ "description": "Maximum number of items that are allowed to be placed in this zone. The value must be non-negative.",
+ "format": "int32",
+ "type": "integer"
+ }
+ },
+ "type": "object"
+ },
+ "MachineImage": {
+ "description": "Represents a machine image resource. A machine image is a Compute Engine resource that stores all the configuration, metadata, permissions, and data from one or more disks required to create a Virtual machine (VM) instance. For more information, see Machine images.",
+ "id": "MachineImage",
+ "properties": {
+ "creationTimestamp": {
+ "description": "[Output Only] The creation timestamp for this machine image in RFC3339 text format.",
+ "type": "string"
+ },
+ "description": {
+ "description": "An optional description of this resource. Provide this property when you create the resource.",
+ "type": "string"
+ },
+ "guestFlush": {
+ "description": "[Input Only] Whether to attempt an application consistent machine image by informing the OS to prepare for the snapshot process.",
+ "type": "boolean"
+ },
+ "id": {
+ "description": "[Output Only] A unique identifier for this machine image. The server defines this identifier.",
+ "format": "uint64",
+ "type": "string"
+ },
+ "instanceProperties": {
+ "$ref": "InstanceProperties",
+ "description": "[Output Only] Properties of source instance"
+ },
+ "kind": {
+ "default": "compute#machineImage",
+ "description": "[Output Only] The resource type, which is always compute#machineImage for machine image.",
+ "type": "string"
+ },
+ "machineImageEncryptionKey": {
+ "$ref": "CustomerEncryptionKey",
+ "description": "Encrypts the machine image using a customer-supplied encryption key. After you encrypt a machine image using a customer-supplied key, you must provide the same key if you use the machine image later. For example, you must provide the encryption key when you create an instance from the encrypted machine image in a future request. Customer-supplied encryption keys do not protect access to metadata of the machine image. If you do not provide an encryption key when creating the machine image, then the machine image will be encrypted using an automatically generated key and you do not need to provide a key to use the machine image later."
+ },
+ "name": {
+ "annotations": {
+ "required": [
+ "compute.machineImages.insert"
+ ]
+ },
+ "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "type": "string"
+ },
+ "satisfiesPzi": {
+ "description": "Output only. Reserved for future use.",
+ "readOnly": true,
+ "type": "boolean"
+ },
+ "satisfiesPzs": {
+ "description": "[Output Only] Reserved for future use.",
+ "type": "boolean"
+ },
+ "savedDisks": {
+ "description": "An array of Machine Image specific properties for disks attached to the source instance",
"items": {
- "$ref": "MachineType"
+ "$ref": "SavedDisk"
+ },
+ "type": "array"
+ },
+ "selfLink": {
+ "description": "[Output Only] The URL for this machine image. The server defines this URL.",
+ "type": "string"
+ },
+ "sourceDiskEncryptionKeys": {
+ "description": "[Input Only] The customer-supplied encryption key of the disks attached to the source instance. Required if the source disk is protected by a customer-supplied encryption key.",
+ "items": {
+ "$ref": "SourceDiskEncryptionKey"
+ },
+ "type": "array"
+ },
+ "sourceInstance": {
+ "description": "The source instance used to create the machine image. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /instances/instance - projects/project/zones/zone/instances/instance ",
+ "type": "string"
+ },
+ "sourceInstanceProperties": {
+ "$ref": "SourceInstanceProperties",
+ "description": "[Output Only] DEPRECATED: Please use instance_properties instead for source instance related properties. New properties will not be added to this field."
+ },
+ "status": {
+ "description": "[Output Only] The status of the machine image. One of the following values: INVALID, CREATING, READY, DELETING, and UPLOADING.",
+ "enum": [
+ "CREATING",
+ "DELETING",
+ "INVALID",
+ "READY",
+ "UPLOADING"
+ ],
+ "enumDescriptions": [
+ "",
+ "",
+ "",
+ "",
+ ""
+ ],
+ "type": "string"
+ },
+ "storageLocations": {
+ "description": "The regional or multi-regional Cloud Storage bucket location where the machine image is stored.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "totalStorageBytes": {
+ "description": "[Output Only] Total size of the storage used by the machine image.",
+ "format": "int64",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "MachineImageList": {
+ "description": "A list of machine images.",
+ "id": "MachineImageList",
+ "properties": {
+ "id": {
+ "description": "[Output Only] Unique identifier for the resource; defined by the server.",
+ "type": "string"
+ },
+ "items": {
+ "description": "A list of MachineImage resources.",
+ "items": {
+ "$ref": "MachineImage"
},
"type": "array"
},
+ "kind": {
+ "default": "compute#machineImageList",
+ "description": "[Output Only] The resource type, which is always compute#machineImagesListResponse for machine image lists.",
+ "type": "string"
+ },
+ "nextPageToken": {
+ "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
+ "type": "string"
+ },
+ "selfLink": {
+ "description": "[Output Only] Server-defined URL for this resource.",
+ "type": "string"
+ },
"warning": {
- "description": "[Output Only] An informational warning that appears when the machine types list is empty.",
+ "description": "[Output Only] Informational warning message.",
"properties": {
"code": {
"description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.",
@@ -54375,37 +56997,599 @@
},
"type": "object"
},
- "ManagedInstance": {
- "description": "A Managed Instance resource.",
- "id": "ManagedInstance",
+ "MachineType": {
+ "description": "Represents a Machine Type resource. You can use specific machine types for your VM instances based on performance and pricing requirements. For more information, read Machine Types.",
+ "id": "MachineType",
"properties": {
- "currentAction": {
- "description": "[Output Only] The current action that the managed instance group has scheduled for the instance. Possible values: - NONE The instance is running, and the managed instance group does not have any scheduled actions for this instance. - CREATING The managed instance group is creating this instance. If the group fails to create this instance, it will try again until it is successful. - CREATING_WITHOUT_RETRIES The managed instance group is attempting to create this instance only once. If the group fails to create this instance, it does not try again and the group's targetSize value is decreased instead. - RECREATING The managed instance group is recreating this instance. - DELETING The managed instance group is permanently deleting this instance. - ABANDONING The managed instance group is abandoning this instance. The instance will be removed from the instance group and from any target pools that are associated with this group. - RESTARTING The managed instance group is restarting the instance. - REFRESHING The managed instance group is applying configuration changes to the instance without stopping it. For example, the group can update the target pool list for an instance without stopping that instance. - VERIFYING The managed instance group has created the instance and it is in the process of being verified. ",
+ "accelerators": {
+ "description": "[Output Only] A list of accelerator configurations assigned to this machine type.",
+ "items": {
+ "properties": {
+ "guestAcceleratorCount": {
+ "description": "Number of accelerator cards exposed to the guest.",
+ "format": "int32",
+ "type": "integer"
+ },
+ "guestAcceleratorType": {
+ "description": "The accelerator type resource name, not a full URL, e.g. nvidia-tesla-t4.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "type": "array"
+ },
+ "architecture": {
+ "description": "[Output Only] The architecture of the machine type.",
"enum": [
- "ABANDONING",
- "CREATING",
- "CREATING_WITHOUT_RETRIES",
- "DELETING",
- "NONE",
- "RECREATING",
- "REFRESHING",
- "RESTARTING",
- "RESUMING",
- "STARTING",
- "STOPPING",
- "SUSPENDING",
- "VERIFYING"
+ "ARCHITECTURE_UNSPECIFIED",
+ "ARM64",
+ "X86_64"
],
"enumDescriptions": [
- "The managed instance group is abandoning this instance. The instance will be removed from the instance group and from any target pools that are associated with this group.",
- "The managed instance group is creating this instance. If the group fails to create this instance, it will try again until it is successful.",
- "The managed instance group is attempting to create this instance only once. If the group fails to create this instance, it does not try again and the group's targetSize value is decreased.",
- "The managed instance group is permanently deleting this instance.",
- "The managed instance group has not scheduled any actions for this instance.",
- "The managed instance group is recreating this instance.",
- "The managed instance group is applying configuration changes to the instance without stopping it. For example, the group can update the target pool list for an instance without stopping that instance.",
- "The managed instance group is restarting this instance.",
- "The managed instance group is resuming this instance.",
+ "Default value indicating Architecture is not set.",
+ "Machines with architecture ARM64",
+ "Machines with architecture X86_64"
+ ],
+ "type": "string"
+ },
+ "creationTimestamp": {
+ "description": "[Output Only] Creation timestamp in RFC3339 text format.",
+ "type": "string"
+ },
+ "deprecated": {
+ "$ref": "DeprecationStatus",
+ "description": "[Output Only] The deprecation status associated with this machine type. Only applicable if the machine type is unavailable."
+ },
+ "description": {
+ "description": "[Output Only] An optional textual description of the resource.",
+ "type": "string"
+ },
+ "guestCpus": {
+ "description": "[Output Only] The number of virtual CPUs that are available to the instance.",
+ "format": "int32",
+ "type": "integer"
+ },
+ "id": {
+ "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.",
+ "format": "uint64",
+ "type": "string"
+ },
+ "imageSpaceGb": {
+ "description": "[Deprecated] This property is deprecated and will never be populated with any relevant values.",
+ "format": "int32",
+ "type": "integer"
+ },
+ "isSharedCpu": {
+ "description": "[Output Only] Whether this machine type has a shared CPU. See Shared-core machine types for more information.",
+ "type": "boolean"
+ },
+ "kind": {
+ "default": "compute#machineType",
+ "description": "[Output Only] The type of the resource. Always compute#machineType for machine types.",
+ "type": "string"
+ },
+ "maximumPersistentDisks": {
+ "description": "[Output Only] Maximum persistent disks allowed.",
+ "format": "int32",
+ "type": "integer"
+ },
+ "maximumPersistentDisksSizeGb": {
+ "description": "[Output Only] Maximum total persistent disks size (GB) allowed.",
+ "format": "int64",
+ "type": "string"
+ },
+ "memoryMb": {
+ "description": "[Output Only] The amount of physical memory available to the instance, defined in MB.",
+ "format": "int32",
+ "type": "integer"
+ },
+ "name": {
+ "description": "[Output Only] Name of the resource.",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "type": "string"
+ },
+ "scratchDisks": {
+ "description": "[Output Only] A list of extended scratch disks assigned to the instance.",
+ "items": {
+ "properties": {
+ "diskGb": {
+ "description": "Size of the scratch disk, defined in GB.",
+ "format": "int32",
+ "type": "integer"
+ }
+ },
+ "type": "object"
+ },
+ "type": "array"
+ },
+ "selfLink": {
+ "description": "[Output Only] Server-defined URL for the resource.",
+ "type": "string"
+ },
+ "zone": {
+ "description": "[Output Only] The name of the zone where the machine type resides, such as us-central1-a.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "MachineTypeAggregatedList": {
+ "id": "MachineTypeAggregatedList",
+ "properties": {
+ "id": {
+ "description": "[Output Only] Unique identifier for the resource; defined by the server.",
+ "type": "string"
+ },
+ "items": {
+ "additionalProperties": {
+ "$ref": "MachineTypesScopedList",
+ "description": "[Output Only] Name of the scope containing this set of machine types."
+ },
+ "description": "A list of MachineTypesScopedList resources.",
+ "type": "object"
+ },
+ "kind": {
+ "default": "compute#machineTypeAggregatedList",
+ "description": "[Output Only] Type of resource. Always compute#machineTypeAggregatedList for aggregated lists of machine types.",
+ "type": "string"
+ },
+ "nextPageToken": {
+ "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
+ "type": "string"
+ },
+ "selfLink": {
+ "description": "[Output Only] Server-defined URL for this resource.",
+ "type": "string"
+ },
+ "unreachables": {
+ "description": "[Output Only] Unreachable resources.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "warning": {
+ "description": "[Output Only] Informational warning message.",
+ "properties": {
+ "code": {
+ "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.",
+ "enum": [
+ "CLEANUP_FAILED",
+ "DEPRECATED_RESOURCE_USED",
+ "DEPRECATED_TYPE_USED",
+ "DISK_SIZE_LARGER_THAN_IMAGE_SIZE",
+ "EXPERIMENTAL_TYPE_USED",
+ "EXTERNAL_API_WARNING",
+ "FIELD_VALUE_OVERRIDEN",
+ "INJECTED_KERNELS_DEPRECATED",
+ "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB",
+ "LARGE_DEPLOYMENT_WARNING",
+ "LIST_OVERHEAD_QUOTA_EXCEED",
+ "MISSING_TYPE_DEPENDENCY",
+ "NEXT_HOP_ADDRESS_NOT_ASSIGNED",
+ "NEXT_HOP_CANNOT_IP_FORWARD",
+ "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE",
+ "NEXT_HOP_INSTANCE_NOT_FOUND",
+ "NEXT_HOP_INSTANCE_NOT_ON_NETWORK",
+ "NEXT_HOP_NOT_RUNNING",
+ "NOT_CRITICAL_ERROR",
+ "NO_RESULTS_ON_PAGE",
+ "PARTIAL_SUCCESS",
+ "REQUIRED_TOS_AGREEMENT",
+ "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING",
+ "RESOURCE_NOT_DELETED",
+ "SCHEMA_VALIDATION_IGNORED",
+ "SINGLE_INSTANCE_PROPERTY_TEMPLATE",
+ "UNDECLARED_PROPERTIES",
+ "UNREACHABLE"
+ ],
+ "enumDeprecated": [
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ true,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false
+ ],
+ "enumDescriptions": [
+ "Warning about failed cleanup of transient changes made by a failed operation.",
+ "A link to a deprecated resource was created.",
+ "When deploying and at least one of the resources has a type marked as deprecated",
+ "The user created a boot disk that is larger than image size.",
+ "When deploying and at least one of the resources has a type marked as experimental",
+ "Warning that is present in an external api call",
+ "Warning that value of a field has been overridden. Deprecated unused field.",
+ "The operation involved use of an injected kernel, which is deprecated.",
+ "A WEIGHTED_MAGLEV backend service is associated with a health check that is not of type HTTP/HTTPS/HTTP2.",
+ "When deploying a deployment with a exceedingly large number of resources",
+ "Resource can't be retrieved due to list overhead quota exceed which captures the amount of resources filtered out by user-defined list filter.",
+ "A resource depends on a missing type",
+ "The route's nextHopIp address is not assigned to an instance on the network.",
+ "The route's next hop instance cannot ip forward.",
+ "The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route.",
+ "The route's nextHopInstance URL refers to an instance that does not exist.",
+ "The route's nextHopInstance URL refers to an instance that is not on the same network as the route.",
+ "The route's next hop instance does not have a status of RUNNING.",
+ "Error which is not critical. We decided to continue the process despite the mentioned error.",
+ "No results are present on a particular list page.",
+ "Success is reported, but some results may be missing due to errors",
+ "The user attempted to use a resource that requires a TOS they have not accepted.",
+ "Warning that a resource is in use.",
+ "One or more of the resources set to auto-delete could not be deleted because they were in use.",
+ "When a resource schema validation is ignored.",
+ "Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group.",
+ "When undeclared properties in the schema are present",
+ "A given scope cannot be reached."
+ ],
+ "type": "string"
+ },
+ "data": {
+ "description": "[Output Only] Metadata about this warning in key: value format. For example: \"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" } ",
+ "items": {
+ "properties": {
+ "key": {
+ "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).",
+ "type": "string"
+ },
+ "value": {
+ "description": "[Output Only] A warning data value corresponding to the key.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "type": "array"
+ },
+ "message": {
+ "description": "[Output Only] A human-readable description of the warning code.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ }
+ },
+ "type": "object"
+ },
+ "MachineTypeList": {
+ "description": "Contains a list of machine types.",
+ "id": "MachineTypeList",
+ "properties": {
+ "id": {
+ "description": "[Output Only] Unique identifier for the resource; defined by the server.",
+ "type": "string"
+ },
+ "items": {
+ "description": "A list of MachineType resources.",
+ "items": {
+ "$ref": "MachineType"
+ },
+ "type": "array"
+ },
+ "kind": {
+ "default": "compute#machineTypeList",
+ "description": "[Output Only] Type of resource. Always compute#machineTypeList for lists of machine types.",
+ "type": "string"
+ },
+ "nextPageToken": {
+ "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
+ "type": "string"
+ },
+ "selfLink": {
+ "description": "[Output Only] Server-defined URL for this resource.",
+ "type": "string"
+ },
+ "warning": {
+ "description": "[Output Only] Informational warning message.",
+ "properties": {
+ "code": {
+ "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.",
+ "enum": [
+ "CLEANUP_FAILED",
+ "DEPRECATED_RESOURCE_USED",
+ "DEPRECATED_TYPE_USED",
+ "DISK_SIZE_LARGER_THAN_IMAGE_SIZE",
+ "EXPERIMENTAL_TYPE_USED",
+ "EXTERNAL_API_WARNING",
+ "FIELD_VALUE_OVERRIDEN",
+ "INJECTED_KERNELS_DEPRECATED",
+ "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB",
+ "LARGE_DEPLOYMENT_WARNING",
+ "LIST_OVERHEAD_QUOTA_EXCEED",
+ "MISSING_TYPE_DEPENDENCY",
+ "NEXT_HOP_ADDRESS_NOT_ASSIGNED",
+ "NEXT_HOP_CANNOT_IP_FORWARD",
+ "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE",
+ "NEXT_HOP_INSTANCE_NOT_FOUND",
+ "NEXT_HOP_INSTANCE_NOT_ON_NETWORK",
+ "NEXT_HOP_NOT_RUNNING",
+ "NOT_CRITICAL_ERROR",
+ "NO_RESULTS_ON_PAGE",
+ "PARTIAL_SUCCESS",
+ "REQUIRED_TOS_AGREEMENT",
+ "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING",
+ "RESOURCE_NOT_DELETED",
+ "SCHEMA_VALIDATION_IGNORED",
+ "SINGLE_INSTANCE_PROPERTY_TEMPLATE",
+ "UNDECLARED_PROPERTIES",
+ "UNREACHABLE"
+ ],
+ "enumDeprecated": [
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ true,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false
+ ],
+ "enumDescriptions": [
+ "Warning about failed cleanup of transient changes made by a failed operation.",
+ "A link to a deprecated resource was created.",
+ "When deploying and at least one of the resources has a type marked as deprecated",
+ "The user created a boot disk that is larger than image size.",
+ "When deploying and at least one of the resources has a type marked as experimental",
+ "Warning that is present in an external api call",
+ "Warning that value of a field has been overridden. Deprecated unused field.",
+ "The operation involved use of an injected kernel, which is deprecated.",
+ "A WEIGHTED_MAGLEV backend service is associated with a health check that is not of type HTTP/HTTPS/HTTP2.",
+ "When deploying a deployment with a exceedingly large number of resources",
+ "Resource can't be retrieved due to list overhead quota exceed which captures the amount of resources filtered out by user-defined list filter.",
+ "A resource depends on a missing type",
+ "The route's nextHopIp address is not assigned to an instance on the network.",
+ "The route's next hop instance cannot ip forward.",
+ "The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route.",
+ "The route's nextHopInstance URL refers to an instance that does not exist.",
+ "The route's nextHopInstance URL refers to an instance that is not on the same network as the route.",
+ "The route's next hop instance does not have a status of RUNNING.",
+ "Error which is not critical. We decided to continue the process despite the mentioned error.",
+ "No results are present on a particular list page.",
+ "Success is reported, but some results may be missing due to errors",
+ "The user attempted to use a resource that requires a TOS they have not accepted.",
+ "Warning that a resource is in use.",
+ "One or more of the resources set to auto-delete could not be deleted because they were in use.",
+ "When a resource schema validation is ignored.",
+ "Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group.",
+ "When undeclared properties in the schema are present",
+ "A given scope cannot be reached."
+ ],
+ "type": "string"
+ },
+ "data": {
+ "description": "[Output Only] Metadata about this warning in key: value format. For example: \"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" } ",
+ "items": {
+ "properties": {
+ "key": {
+ "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).",
+ "type": "string"
+ },
+ "value": {
+ "description": "[Output Only] A warning data value corresponding to the key.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "type": "array"
+ },
+ "message": {
+ "description": "[Output Only] A human-readable description of the warning code.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ }
+ },
+ "type": "object"
+ },
+ "MachineTypesScopedList": {
+ "id": "MachineTypesScopedList",
+ "properties": {
+ "machineTypes": {
+ "description": "[Output Only] A list of machine types contained in this scope.",
+ "items": {
+ "$ref": "MachineType"
+ },
+ "type": "array"
+ },
+ "warning": {
+ "description": "[Output Only] An informational warning that appears when the machine types list is empty.",
+ "properties": {
+ "code": {
+ "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.",
+ "enum": [
+ "CLEANUP_FAILED",
+ "DEPRECATED_RESOURCE_USED",
+ "DEPRECATED_TYPE_USED",
+ "DISK_SIZE_LARGER_THAN_IMAGE_SIZE",
+ "EXPERIMENTAL_TYPE_USED",
+ "EXTERNAL_API_WARNING",
+ "FIELD_VALUE_OVERRIDEN",
+ "INJECTED_KERNELS_DEPRECATED",
+ "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB",
+ "LARGE_DEPLOYMENT_WARNING",
+ "LIST_OVERHEAD_QUOTA_EXCEED",
+ "MISSING_TYPE_DEPENDENCY",
+ "NEXT_HOP_ADDRESS_NOT_ASSIGNED",
+ "NEXT_HOP_CANNOT_IP_FORWARD",
+ "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE",
+ "NEXT_HOP_INSTANCE_NOT_FOUND",
+ "NEXT_HOP_INSTANCE_NOT_ON_NETWORK",
+ "NEXT_HOP_NOT_RUNNING",
+ "NOT_CRITICAL_ERROR",
+ "NO_RESULTS_ON_PAGE",
+ "PARTIAL_SUCCESS",
+ "REQUIRED_TOS_AGREEMENT",
+ "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING",
+ "RESOURCE_NOT_DELETED",
+ "SCHEMA_VALIDATION_IGNORED",
+ "SINGLE_INSTANCE_PROPERTY_TEMPLATE",
+ "UNDECLARED_PROPERTIES",
+ "UNREACHABLE"
+ ],
+ "enumDeprecated": [
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ true,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false
+ ],
+ "enumDescriptions": [
+ "Warning about failed cleanup of transient changes made by a failed operation.",
+ "A link to a deprecated resource was created.",
+ "When deploying and at least one of the resources has a type marked as deprecated",
+ "The user created a boot disk that is larger than image size.",
+ "When deploying and at least one of the resources has a type marked as experimental",
+ "Warning that is present in an external api call",
+ "Warning that value of a field has been overridden. Deprecated unused field.",
+ "The operation involved use of an injected kernel, which is deprecated.",
+ "A WEIGHTED_MAGLEV backend service is associated with a health check that is not of type HTTP/HTTPS/HTTP2.",
+ "When deploying a deployment with a exceedingly large number of resources",
+ "Resource can't be retrieved due to list overhead quota exceed which captures the amount of resources filtered out by user-defined list filter.",
+ "A resource depends on a missing type",
+ "The route's nextHopIp address is not assigned to an instance on the network.",
+ "The route's next hop instance cannot ip forward.",
+ "The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route.",
+ "The route's nextHopInstance URL refers to an instance that does not exist.",
+ "The route's nextHopInstance URL refers to an instance that is not on the same network as the route.",
+ "The route's next hop instance does not have a status of RUNNING.",
+ "Error which is not critical. We decided to continue the process despite the mentioned error.",
+ "No results are present on a particular list page.",
+ "Success is reported, but some results may be missing due to errors",
+ "The user attempted to use a resource that requires a TOS they have not accepted.",
+ "Warning that a resource is in use.",
+ "One or more of the resources set to auto-delete could not be deleted because they were in use.",
+ "When a resource schema validation is ignored.",
+ "Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group.",
+ "When undeclared properties in the schema are present",
+ "A given scope cannot be reached."
+ ],
+ "type": "string"
+ },
+ "data": {
+ "description": "[Output Only] Metadata about this warning in key: value format. For example: \"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" } ",
+ "items": {
+ "properties": {
+ "key": {
+ "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).",
+ "type": "string"
+ },
+ "value": {
+ "description": "[Output Only] A warning data value corresponding to the key.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "type": "array"
+ },
+ "message": {
+ "description": "[Output Only] A human-readable description of the warning code.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ }
+ },
+ "type": "object"
+ },
+ "ManagedInstance": {
+ "description": "A Managed Instance resource.",
+ "id": "ManagedInstance",
+ "properties": {
+ "currentAction": {
+ "description": "[Output Only] The current action that the managed instance group has scheduled for the instance. Possible values: - NONE The instance is running, and the managed instance group does not have any scheduled actions for this instance. - CREATING The managed instance group is creating this instance. If the group fails to create this instance, it will try again until it is successful. - CREATING_WITHOUT_RETRIES The managed instance group is attempting to create this instance only once. If the group fails to create this instance, it does not try again and the group's targetSize value is decreased instead. - RECREATING The managed instance group is recreating this instance. - DELETING The managed instance group is permanently deleting this instance. - ABANDONING The managed instance group is abandoning this instance. The instance will be removed from the instance group and from any target pools that are associated with this group. - RESTARTING The managed instance group is restarting the instance. - REFRESHING The managed instance group is applying configuration changes to the instance without stopping it. For example, the group can update the target pool list for an instance without stopping that instance. - VERIFYING The managed instance group has created the instance and it is in the process of being verified. ",
+ "enum": [
+ "ABANDONING",
+ "CREATING",
+ "CREATING_WITHOUT_RETRIES",
+ "DELETING",
+ "NONE",
+ "RECREATING",
+ "REFRESHING",
+ "RESTARTING",
+ "RESUMING",
+ "STARTING",
+ "STOPPING",
+ "SUSPENDING",
+ "VERIFYING"
+ ],
+ "enumDescriptions": [
+ "The managed instance group is abandoning this instance. The instance will be removed from the instance group and from any target pools that are associated with this group.",
+ "The managed instance group is creating this instance. If the group fails to create this instance, it will try again until it is successful.",
+ "The managed instance group is attempting to create this instance only once. If the group fails to create this instance, it does not try again and the group's targetSize value is decreased.",
+ "The managed instance group is permanently deleting this instance.",
+ "The managed instance group has not scheduled any actions for this instance.",
+ "The managed instance group is recreating this instance.",
+ "The managed instance group is applying configuration changes to the instance without stopping it. For example, the group can update the target pool list for an instance without stopping that instance.",
+ "The managed instance group is restarting this instance.",
+ "The managed instance group is resuming this instance.",
"The managed instance group is starting this instance.",
"The managed instance group is stopping this instance.",
"The managed instance group is suspending this instance.",
@@ -54473,6 +57657,10 @@
"$ref": "PreservedState",
"description": "[Output Only] Preserved state generated based on stateful policy for this instance."
},
+ "propertiesFromFlexibilityPolicy": {
+ "$ref": "ManagedInstancePropertiesFromFlexibilityPolicy",
+ "description": "[Output Only] Instance properties selected for this instance resulting from InstanceFlexibilityPolicy."
+ },
"version": {
"$ref": "ManagedInstanceVersion",
"description": "[Output Only] Intended version of this instance."
@@ -54562,6 +57750,16 @@
},
"type": "object"
},
+ "ManagedInstancePropertiesFromFlexibilityPolicy": {
+ "id": "ManagedInstancePropertiesFromFlexibilityPolicy",
+ "properties": {
+ "machineType": {
+ "description": "The machine type to be used for this instance.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
"ManagedInstanceVersion": {
"id": "ManagedInstanceVersion",
"properties": {
@@ -55799,20 +58997,29 @@
"description": "Metadata defined as annotations on the network endpoint.",
"type": "object"
},
+ "clientDestinationPort": {
+ "description": "Represents the port number to which PSC consumer sends packets. Only valid for network endpoint groups created with GCE_VM_IP_PORTMAP endpoint type.",
+ "format": "int32",
+ "type": "integer"
+ },
"fqdn": {
"description": "Optional fully qualified domain name of network endpoint. This can only be specified when NetworkEndpointGroup.network_endpoint_type is NON_GCP_FQDN_PORT.",
"type": "string"
},
"instance": {
- "description": "The name or a URL of a specific VM instance that the IP address belongs to. This is required for network endpoints of type GCE_VM_IP_PORT. The instance must be in the same zone of network endpoint group (for zonal NEGs) or in the zone within the region of the NEG (for regional NEGs). The name must be 1-63 characters long, and comply with RFC1035 or be a valid URL pointing to an existing instance.",
+ "description": "The name or a URL of VM instance of this network endpoint. This field is required for network endpoints of type GCE_VM_IP and GCE_VM_IP_PORT. The instance must be in the same zone of network endpoint group (for zonal NEGs) or in the zone within the region of the NEG (for regional NEGs). If the ipAddress is specified, it must belongs to the VM instance. The name must be 1-63 characters long, and comply with RFC1035 or be a valid URL pointing to an existing instance.",
"type": "string"
},
"ipAddress": {
- "description": "Optional IPv4 address of network endpoint. The IP address must belong to a VM in Compute Engine (either the primary IP or as part of an aliased IP range). If the IP address is not specified, then the primary IP address for the VM instance in the network that the network endpoint group belongs to will be used.",
+ "description": "Optional IPv4 address of network endpoint. The IP address must belong to a VM in Compute Engine (either the primary IP or as part of an aliased IP range). If the IP address is not specified, then the primary IP address for the VM instance in the network that the network endpoint group belongs to will be used. This field is redundant and need not be set for network endpoints of type GCE_VM_IP. If set, it must be set to the primary internal IP address of the attached VM instance that matches the subnetwork of the NEG. The primary internal IP address from any NIC of a multi-NIC VM instance can be added to a NEG as long as it matches the NEG subnetwork.",
+ "type": "string"
+ },
+ "ipv6Address": {
+ "description": "Optional IPv6 address of network endpoint.",
"type": "string"
},
"port": {
- "description": "Optional port number of network endpoint. If not specified, the defaultPort for the network endpoint group will be used.",
+ "description": "Optional port number of network endpoint. If not specified, the defaultPort for the network endpoint group will be used. This field can not be set for network endpoints of type GCE_VM_IP.",
"format": "int32",
"type": "integer"
}
@@ -55832,22 +59039,22 @@
},
"appEngine": {
"$ref": "NetworkEndpointGroupAppEngine",
- "description": "Only valid when networkEndpointType is \"SERVERLESS\". Only one of cloudRun, appEngine or cloudFunction may be set."
+ "description": "Only valid when networkEndpointType is SERVERLESS. Only one of cloudRun, appEngine or cloudFunction may be set."
},
"cloudFunction": {
"$ref": "NetworkEndpointGroupCloudFunction",
- "description": "Only valid when networkEndpointType is \"SERVERLESS\". Only one of cloudRun, appEngine or cloudFunction may be set."
+ "description": "Only valid when networkEndpointType is SERVERLESS. Only one of cloudRun, appEngine or cloudFunction may be set."
},
"cloudRun": {
"$ref": "NetworkEndpointGroupCloudRun",
- "description": "Only valid when networkEndpointType is \"SERVERLESS\". Only one of cloudRun, appEngine or cloudFunction may be set."
+ "description": "Only valid when networkEndpointType is SERVERLESS. Only one of cloudRun, appEngine or cloudFunction may be set."
},
"creationTimestamp": {
"description": "[Output Only] Creation timestamp in RFC3339 text format.",
"type": "string"
},
"defaultPort": {
- "description": "The default port used if the port number is not specified in the network endpoint.",
+ "description": "The default port used if the port number is not specified in the network endpoint. If the network endpoint type is either GCE_VM_IP, SERVERLESS or PRIVATE_SERVICE_CONNECT, this field must not be specified.",
"format": "int32",
"type": "integer"
},
@@ -55870,14 +59077,15 @@
"type": "string"
},
"network": {
- "description": "The URL of the network to which all network endpoints in the NEG belong. Uses \"default\" project network if unspecified.",
+ "description": "The URL of the network to which all network endpoints in the NEG belong. Uses default project network if unspecified.",
"type": "string"
},
"networkEndpointType": {
- "description": "Type of network endpoints in this network endpoint group. Can be one of GCE_VM_IP, GCE_VM_IP_PORT, NON_GCP_PRIVATE_IP_PORT, INTERNET_FQDN_PORT, INTERNET_IP_PORT, SERVERLESS, PRIVATE_SERVICE_CONNECT.",
+ "description": "Type of network endpoints in this network endpoint group. Can be one of GCE_VM_IP, GCE_VM_IP_PORT, NON_GCP_PRIVATE_IP_PORT, INTERNET_FQDN_PORT, INTERNET_IP_PORT, SERVERLESS, PRIVATE_SERVICE_CONNECT, GCE_VM_IP_PORTMAP.",
"enum": [
"GCE_VM_IP",
"GCE_VM_IP_PORT",
+ "GCE_VM_IP_PORTMAP",
"INTERNET_FQDN_PORT",
"INTERNET_IP_PORT",
"NON_GCP_PRIVATE_IP_PORT",
@@ -55887,6 +59095,7 @@
"enumDescriptions": [
"The network endpoint is represented by an IP address.",
"The network endpoint is represented by IP address and port pair.",
+ "The network endpoint is represented by an IP, Port and Client Destination Port.",
"The network endpoint is represented by fully qualified domain name and port.",
"The network endpoint is represented by an internet IP address and port.",
"The network endpoint is represented by an IP address and port. The endpoint belongs to a VM or pod running in a customer's on-premises.",
@@ -55899,7 +59108,7 @@
"$ref": "NetworkEndpointGroupPscData"
},
"pscTargetService": {
- "description": "The target service url used to set up private service connection to a Google API or a PSC Producer Service Attachment. An example value is: \"asia-northeast3-cloudkms.googleapis.com\"",
+ "description": "The target service url used to set up private service connection to a Google API or a PSC Producer Service Attachment. An example value is: asia-northeast3-cloudkms.googleapis.com",
"type": "string"
},
"region": {
@@ -56090,15 +59299,15 @@
"id": "NetworkEndpointGroupAppEngine",
"properties": {
"service": {
- "description": "Optional serving service. The service name is case-sensitive and must be 1-63 characters long. Example value: \"default\", \"my-service\".",
+ "description": "Optional serving service. The service name is case-sensitive and must be 1-63 characters long. Example value: default, my-service.",
"type": "string"
},
"urlMask": {
- "description": "A template to parse service and version fields from a request URL. URL mask allows for routing to multiple App Engine services without having to create multiple Network Endpoint Groups and backend services. For example, the request URLs \"foo1-dot-appname.appspot.com/v1\" and \"foo1-dot-appname.appspot.com/v2\" can be backed by the same Serverless NEG with URL mask \"\u003cservice\u003e-dot-appname.appspot.com/\u003cversion\u003e\". The URL mask will parse them to { service = \"foo1\", version = \"v1\" } and { service = \"foo1\", version = \"v2\" } respectively.",
+ "description": "An URL mask is one of the main components of the Cloud Function. A template to parse service and version fields from a request URL. URL mask allows for routing to multiple App Engine services without having to create multiple Network Endpoint Groups and backend services. For example, the request URLs foo1-dot-appname.appspot.com/v1 and foo1-dot-appname.appspot.com/v2 can be backed by the same Serverless NEG with URL mask \u003cservice\u003e-dot-appname.appspot.com/\u003cversion\u003e. The URL mask will parse them to { service = \"foo1\", version = \"v1\" } and { service = \"foo1\", version = \"v2\" } respectively.",
"type": "string"
},
"version": {
- "description": "Optional serving version. The version name is case-sensitive and must be 1-100 characters long. Example value: \"v1\", \"v2\".",
+ "description": "Optional serving version. The version name is case-sensitive and must be 1-100 characters long. Example value: v1, v2.",
"type": "string"
}
},
@@ -56109,11 +59318,11 @@
"id": "NetworkEndpointGroupCloudFunction",
"properties": {
"function": {
- "description": "A user-defined name of the Cloud Function. The function name is case-sensitive and must be 1-63 characters long. Example value: \"func1\".",
+ "description": "A user-defined name of the Cloud Function. The function name is case-sensitive and must be 1-63 characters long. Example value: func1.",
"type": "string"
},
"urlMask": {
- "description": "A template to parse function field from a request URL. URL mask allows for routing to multiple Cloud Functions without having to create multiple Network Endpoint Groups and backend services. For example, request URLs \" mydomain.com/function1\" and \"mydomain.com/function2\" can be backed by the same Serverless NEG with URL mask \"/\u003cfunction\u003e\". The URL mask will parse them to { function = \"function1\" } and { function = \"function2\" } respectively.",
+ "description": "An URL mask is one of the main components of the Cloud Function. A template to parse function field from a request URL. URL mask allows for routing to multiple Cloud Functions without having to create multiple Network Endpoint Groups and backend services. For example, request URLs mydomain.com/function1 and mydomain.com/function2 can be backed by the same Serverless NEG with URL mask /\u003cfunction\u003e. The URL mask will parse them to { function = \"function1\" } and { function = \"function2\" } respectively.",
"type": "string"
}
},
@@ -56132,7 +59341,7 @@
"type": "string"
},
"urlMask": {
- "description": "A template to parse \u003cservice\u003e and \u003ctag\u003e fields from a request URL. URL mask allows for routing to multiple Run services without having to create multiple network endpoint groups and backend services. For example, request URLs \"foo1.domain.com/bar1\" and \"foo1.domain.com/bar2\" can be backed by the same Serverless Network Endpoint Group (NEG) with URL mask \"\u003ctag\u003e.domain.com/\u003cservice\u003e\". The URL mask will parse them to { service=\"bar1\", tag=\"foo1\" } and { service=\"bar2\", tag=\"foo2\" } respectively.",
+ "description": "An URL mask is one of the main components of the Cloud Function. A template to parse \u003cservice\u003e and \u003ctag\u003e fields from a request URL. URL mask allows for routing to multiple Run services without having to create multiple network endpoint groups and backend services. For example, request URLs foo1.domain.com/bar1 and foo1.domain.com/bar2 can be backed by the same Serverless Network Endpoint Group (NEG) with URL mask \u003ctag\u003e.domain.com/\u003cservice\u003e. The URL mask will parse them to { service=\"bar1\", tag=\"foo1\" } and { service=\"bar2\", tag=\"foo2\" } respectively.",
"type": "string"
}
},
@@ -56297,6 +59506,11 @@
"description": "[Output Only] Address allocated from given subnetwork for PSC. This IP address acts as a VIP for a PSC NEG, allowing it to act as an endpoint in L7 PSC-XLB.",
"type": "string"
},
+ "producerPort": {
+ "description": "The psc producer port is used to connect PSC NEG with specific port on the PSC Producer side; should only be used for the PRIVATE_SERVICE_CONNECT NEG type",
+ "format": "int32",
+ "type": "integer"
+ },
"pscConnectionId": {
"description": "[Output Only] The PSC connection id of the PSC Network Endpoint Group Consumer.",
"format": "uint64",
@@ -56743,11 +59957,13 @@
"description": "The type of vNIC to be used on this interface. This may be gVNIC or VirtioNet.",
"enum": [
"GVNIC",
+ "IDPF",
"UNSPECIFIED_NIC_TYPE",
"VIRTIO_NET"
],
"enumDescriptions": [
"GVNIC",
+ "IDPF",
"No type specified.",
"VIRTIO"
],
@@ -56762,11 +59978,13 @@
"description": "The stack type for this network interface. To assign only IPv4 addresses, use IPV4_ONLY. To assign both IPv4 and IPv6 addresses, use IPV4_IPV6. If not specified, IPV4_ONLY is used. This field can be both set at instance creation and update network interface operations.",
"enum": [
"IPV4_IPV6",
- "IPV4_ONLY"
+ "IPV4_ONLY",
+ "IPV6_ONLY"
],
"enumDescriptions": [
"The network interface can have both IPv4 and IPv6 addresses.",
- "The network interface will be assigned IPv4 address."
+ "The network interface will only be assigned IPv4 addresses.",
+ "The network interface will only be assigned IPv6 addresses."
],
"type": "string"
},
@@ -57068,7 +60286,7 @@
"id": "NetworksGetEffectiveFirewallsResponse",
"properties": {
"firewallPolicys": {
- "description": "Effective firewalls from firewall policy.",
+ "description": "[Output Only] Effective firewalls from firewall policy. It returns Global Network Firewall Policies and Hierarchical Firewall Policies. Use regionNetworkFirewallPolicies.getEffectiveFirewalls to get Regional Network Firewall Policies as well.",
"items": {
"$ref": "NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy"
},
@@ -57096,8 +60314,13 @@
"description": "[Output Only] The name of the firewall policy.",
"type": "string"
},
+ "priority": {
+ "description": "[Output only] Priority of firewall policy association. Not applicable for type=HIERARCHY.",
+ "format": "int32",
+ "type": "integer"
+ },
"rules": {
- "description": "The rules that apply to the network.",
+ "description": "[Output Only] The rules that apply to the network.",
"items": {
"$ref": "FirewallPolicyRule"
},
@@ -57112,9 +60335,11 @@
"enum": [
"HIERARCHY",
"NETWORK",
+ "SYSTEM",
"UNSPECIFIED"
],
"enumDescriptions": [
+ "",
"",
"",
""
@@ -57177,6 +60402,18 @@
"description": "An opaque location hint used to place the Node close to other resources. This field is for use by internal tools that use the public API. The location hint here on the NodeGroup overrides any location_hint present in the NodeTemplate.",
"type": "string"
},
+ "maintenanceInterval": {
+ "description": "Specifies the frequency of planned maintenance events. The accepted values are: `AS_NEEDED` and `RECURRENT`.",
+ "enum": [
+ "AS_NEEDED",
+ "RECURRENT"
+ ],
+ "enumDescriptions": [
+ "VMs are eligible to receive infrastructure and hypervisor updates as they become available. This may result in more maintenance operations (live migrations or terminations) for the VM than the PERIODIC and RECURRENT options.",
+ "VMs receive infrastructure and hypervisor updates on a periodic basis, minimizing the number of maintenance operations (live migrations or terminations) on an individual VM. This may mean a VM will take longer to receive an update than if it was configured for AS_NEEDED. Security updates will still be applied as soon as they are available. RECURRENT is used for GEN3 and Slice of Hardware VMs."
+ ],
+ "type": "string"
+ },
"maintenancePolicy": {
"description": "Specifies how to handle instances when a node in the group undergoes maintenance. Set to one of: DEFAULT, RESTART_IN_PLACE, or MIGRATE_WITHIN_NODE_GROUP. The default value is DEFAULT. For more information, see Maintenance policies.",
"enum": [
@@ -57686,6 +60923,10 @@
"totalResources": {
"$ref": "InstanceConsumptionInfo",
"description": "Total amount of available resources on the node."
+ },
+ "upcomingMaintenance": {
+ "$ref": "UpcomingMaintenance",
+ "description": "[Output Only] The information about an upcoming maintenance event."
}
},
"type": "object"
@@ -57865,6 +61106,23 @@
},
"type": "object"
},
+ "NodeGroupsPerformMaintenanceRequest": {
+ "id": "NodeGroupsPerformMaintenanceRequest",
+ "properties": {
+ "nodes": {
+ "description": "[Required] List of nodes affected by the call.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "startTime": {
+ "description": "The start time of the schedule. The timestamp is an RFC3339 string.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
"NodeGroupsScopedList": {
"id": "NodeGroupsScopedList",
"properties": {
@@ -59462,7 +62720,7 @@
"type": "string"
},
"targetLink": {
- "description": "[Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.",
+ "description": "[Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the disk that the snapshot was created from.",
"type": "string"
},
"user": {
@@ -60194,7 +63452,7 @@
},
"filter": {
"$ref": "PacketMirroringFilter",
- "description": "Filter for mirrored traffic. If unspecified, all traffic is mirrored."
+ "description": "Filter for mirrored traffic. If unspecified, all IPv4 traffic is mirrored."
},
"id": {
"description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.",
@@ -60416,7 +63674,7 @@
"type": "array"
},
"cidrRanges": {
- "description": "One or more IPv4 or IPv6 CIDR ranges that apply as filter on the source (ingress) or destination (egress) IP in the IP header. If no ranges are specified, all IPv4 traffic that matches the specified IPProtocols is mirrored. If neither cidrRanges nor IPProtocols is specified, all IPv4 traffic is mirrored. To mirror all IPv4 and IPv6 traffic, use \"0.0.0.0/0,::/0\". Note: Support for IPv6 traffic is in preview.",
+ "description": "One or more IPv4 or IPv6 CIDR ranges that apply as filters on the source (ingress) or destination (egress) IP in the IP header. If no ranges are specified, all IPv4 traffic that matches the specified IPProtocols is mirrored. If neither cidrRanges nor IPProtocols is specified, all IPv4 traffic is mirrored. To mirror all IPv4 and IPv6 traffic, use \"0.0.0.0/0,::/0\".",
"items": {
"type": "string"
},
@@ -60812,17 +64070,21 @@
"description": "A matcher for the path portion of the URL. The BackendService from the longest-matched rule will serve the URL. If no rule was matched, the default service is used.",
"id": "PathMatcher",
"properties": {
+ "defaultCustomErrorResponsePolicy": {
+ "$ref": "CustomErrorResponsePolicy",
+ "description": "defaultCustomErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendServiceor BackendBucket responds with an error. This policy takes effect at the PathMatcher level and applies only when no policy has been defined for the error code at lower levels like RouteRule and PathRule within this PathMatcher. If an error code does not have a policy defined in defaultCustomErrorResponsePolicy, then a policy defined for the error code in UrlMap.defaultCustomErrorResponsePolicy takes effect. For example, consider a UrlMap with the following configuration: - UrlMap.defaultCustomErrorResponsePolicy is configured with policies for 5xx and 4xx errors - A RouteRule for /coming_soon/ is configured for the error code 404. If the request is for www.myotherdomain.com and a 404 is encountered, the policy under UrlMap.defaultCustomErrorResponsePolicy takes effect. If a 404 response is encountered for the request www.example.com/current_events/, the pathMatcher's policy takes effect. If however, the request for www.example.com/coming_soon/ encounters a 404, the policy in RouteRule.customErrorResponsePolicy takes effect. If any of the requests in this example encounter a 500 error code, the policy at UrlMap.defaultCustomErrorResponsePolicy takes effect. When used in conjunction with pathMatcher.defaultRouteAction.retryPolicy, retries take precedence. Only once all retries are exhausted, the defaultCustomErrorResponsePolicy is applied. While attempting a retry, if load balancer is successful in reaching the service, the defaultCustomErrorResponsePolicy is ignored and the response from the service is returned to the client. defaultCustomErrorResponsePolicy is supported only for global external Application Load Balancers."
+ },
"defaultRouteAction": {
"$ref": "HttpRouteAction",
- "description": "defaultRouteAction takes effect when none of the pathRules or routeRules match. The load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. Only one of defaultRouteAction or defaultUrlRedirect must be set. URL maps for classic Application Load Balancers only support the urlRewrite action within a path matcher's defaultRouteAction."
+ "description": "defaultRouteAction takes effect when none of the pathRules or routeRules match. The load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. If defaultRouteAction is specified, don't set defaultUrlRedirect. If defaultRouteAction.weightedBackendServices is specified, don't set defaultService. URL maps for classic Application Load Balancers only support the urlRewrite action within a path matcher's defaultRouteAction."
},
"defaultService": {
- "description": "The full or partial URL to the BackendService resource. This URL is used if none of the pathRules or routeRules defined by this PathMatcher are matched. For example, the following are all valid URLs to a BackendService resource: - https://www.googleapis.com/compute/v1/projects/project /global/backendServices/backendService - compute/v1/projects/project/global/backendServices/backendService - global/backendServices/backendService If defaultRouteAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. However, if defaultService is specified, defaultRouteAction cannot contain any weightedBackendServices. Conversely, if defaultRouteAction specifies any weightedBackendServices, defaultService must not be specified. Only one of defaultService, defaultUrlRedirect , or defaultRouteAction.weightedBackendService must be set. Authorization requires one or more of the following Google IAM permissions on the specified resource default_service: - compute.backendBuckets.use - compute.backendServices.use ",
+ "description": "The full or partial URL to the BackendService resource. This URL is used if none of the pathRules or routeRules defined by this PathMatcher are matched. For example, the following are all valid URLs to a BackendService resource: - https://www.googleapis.com/compute/v1/projects/project /global/backendServices/backendService - compute/v1/projects/project/global/backendServices/backendService - global/backendServices/backendService If defaultRouteAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. However, if defaultService is specified, defaultRouteAction cannot contain any weightedBackendServices. Conversely, if defaultRouteAction specifies any weightedBackendServices, defaultService must not be specified. If defaultService is specified, then set either defaultUrlRedirect or defaultRouteAction.weightedBackendService. Don't set both. Authorization requires one or more of the following Google IAM permissions on the specified resource default_service: - compute.backendBuckets.use - compute.backendServices.use ",
"type": "string"
},
"defaultUrlRedirect": {
"$ref": "HttpRedirectAction",
- "description": "When none of the specified pathRules or routeRules match, the request is redirected to a URL specified by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService or defaultRouteAction must not be set. Not supported when the URL map is bound to a target gRPC proxy."
+ "description": "When none of the specified pathRules or routeRules match, the request is redirected to a URL specified by defaultUrlRedirect. If defaultUrlRedirect is specified, then set either defaultService or defaultRouteAction. Don't set both. Not supported when the URL map is bound to a target gRPC proxy."
},
"description": {
"description": "An optional description of this resource. Provide this property when you create the resource.",
@@ -60857,6 +64119,10 @@
"description": "A path-matching rule for a URL. If matched, will use the specified BackendService to handle the traffic arriving at this URL.",
"id": "PathRule",
"properties": {
+ "customErrorResponsePolicy": {
+ "$ref": "CustomErrorResponsePolicy",
+ "description": "customErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendServiceor BackendBucket responds with an error. If a policy for an error code is not configured for the PathRule, a policy for the error code configured in pathMatcher.defaultCustomErrorResponsePolicy is applied. If one is not specified in pathMatcher.defaultCustomErrorResponsePolicy, the policy configured in UrlMap.defaultCustomErrorResponsePolicy takes effect. For example, consider a UrlMap with the following configuration: - UrlMap.defaultCustomErrorResponsePolicy are configured with policies for 5xx and 4xx errors - A PathRule for /coming_soon/ is configured for the error code 404. If the request is for www.myotherdomain.com and a 404 is encountered, the policy under UrlMap.defaultCustomErrorResponsePolicy takes effect. If a 404 response is encountered for the request www.example.com/current_events/, the pathMatcher's policy takes effect. If however, the request for www.example.com/coming_soon/ encounters a 404, the policy in PathRule.customErrorResponsePolicy takes effect. If any of the requests in this example encounter a 500 error code, the policy at UrlMap.defaultCustomErrorResponsePolicy takes effect. customErrorResponsePolicy is supported only for global external Application Load Balancers."
+ },
"paths": {
"description": "The list of path patterns to match. Each must start with / and the only place a * is allowed is at the end following a /. The string fed to the path matcher does not include any text after the first ? or #, and those chars are not allowed here.",
"items": {
@@ -60941,13 +64207,6 @@
"format": "byte",
"type": "string"
},
- "rules": {
- "description": "This is deprecated and has no effect. Do not use.",
- "items": {
- "$ref": "Rule"
- },
- "type": "array"
- },
"version": {
"description": "Specifies the format of the policy. Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected. Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations: * Getting a policy that includes a conditional role binding * Adding a conditional role binding to a policy * Changing a conditional role binding in a policy * Removing any role binding, with or without a condition, from a policy that includes conditions **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).",
"format": "int32",
@@ -61078,6 +64337,20 @@
"description": "Represents a Project resource. A project is used to organize resources in a Google Cloud Platform environment. For more information, read about the Resource Hierarchy.",
"id": "Project",
"properties": {
+ "cloudArmorTier": {
+ "description": "[Output Only] The Cloud Armor tier for this project. It can be one of the following values: CA_STANDARD, CA_ENTERPRISE_PAYGO. If this field is not specified, it is assumed to be CA_STANDARD.",
+ "enum": [
+ "CA_ENTERPRISE_ANNUAL",
+ "CA_ENTERPRISE_PAYGO",
+ "CA_STANDARD"
+ ],
+ "enumDescriptions": [
+ "Enterprise tier protection billed annually.",
+ "Enterprise tier protection billed monthly.",
+ "Standard protection."
+ ],
+ "type": "string"
+ },
"commonInstanceMetadata": {
"$ref": "Metadata",
"description": "Metadata key/value pairs available to all instances contained in this project. See Custom metadata for more information."
@@ -61197,64 +64470,382 @@
},
"type": "object"
},
- "ProjectsGetXpnResources": {
- "id": "ProjectsGetXpnResources",
+ "ProjectsGetXpnResources": {
+ "id": "ProjectsGetXpnResources",
+ "properties": {
+ "kind": {
+ "default": "compute#projectsGetXpnResources",
+ "description": "[Output Only] Type of resource. Always compute#projectsGetXpnResources for lists of service resources (a.k.a service projects)",
+ "type": "string"
+ },
+ "nextPageToken": {
+ "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
+ "type": "string"
+ },
+ "resources": {
+ "description": "Service resources (a.k.a service projects) attached to this project as their shared VPC host.",
+ "items": {
+ "$ref": "XpnResourceId"
+ },
+ "type": "array"
+ }
+ },
+ "type": "object"
+ },
+ "ProjectsListXpnHostsRequest": {
+ "id": "ProjectsListXpnHostsRequest",
+ "properties": {
+ "organization": {
+ "description": "Optional organization ID managed by Cloud Resource Manager, for which to list shared VPC host projects. If not specified, the organization will be inferred from the project.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "ProjectsSetCloudArmorTierRequest": {
+ "id": "ProjectsSetCloudArmorTierRequest",
+ "properties": {
+ "cloudArmorTier": {
+ "description": "Managed protection tier to be set.",
+ "enum": [
+ "CA_ENTERPRISE_ANNUAL",
+ "CA_ENTERPRISE_PAYGO",
+ "CA_STANDARD"
+ ],
+ "enumDescriptions": [
+ "Enterprise tier protection billed annually.",
+ "Enterprise tier protection billed monthly.",
+ "Standard protection."
+ ],
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "ProjectsSetDefaultNetworkTierRequest": {
+ "id": "ProjectsSetDefaultNetworkTierRequest",
+ "properties": {
+ "networkTier": {
+ "description": "Default network tier to be set.",
+ "enum": [
+ "FIXED_STANDARD",
+ "PREMIUM",
+ "STANDARD",
+ "STANDARD_OVERRIDES_FIXED_STANDARD"
+ ],
+ "enumDescriptions": [
+ "Public internet quality with fixed bandwidth.",
+ "High quality, Google-grade network tier, support for all networking products.",
+ "Public internet quality, only limited support for other networking products.",
+ "(Output only) Temporary tier for FIXED_STANDARD when fixed standard tier is expired or not configured."
+ ],
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "PublicAdvertisedPrefix": {
+ "description": "A public advertised prefix represents an aggregated IP prefix or netblock which customers bring to cloud. The IP prefix is a single unit of route advertisement and is announced globally to the internet.",
+ "id": "PublicAdvertisedPrefix",
+ "properties": {
+ "byoipApiVersion": {
+ "description": "[Output Only] The version of BYOIP API.",
+ "enum": [
+ "V1",
+ "V2"
+ ],
+ "enumDescriptions": [
+ "This public advertised prefix can be used to create both regional and global public delegated prefixes. It usually takes 4 weeks to create or delete a public delegated prefix. The BGP status cannot be changed.",
+ "This public advertised prefix can only be used to create regional public delegated prefixes. Public delegated prefix creation and deletion takes minutes and the BGP status can be modified."
+ ],
+ "type": "string"
+ },
+ "creationTimestamp": {
+ "description": "[Output Only] Creation timestamp in RFC3339 text format.",
+ "type": "string"
+ },
+ "description": {
+ "description": "An optional description of this resource. Provide this property when you create the resource.",
+ "type": "string"
+ },
+ "dnsVerificationIp": {
+ "description": "The address to be used for reverse DNS verification.",
+ "type": "string"
+ },
+ "fingerprint": {
+ "description": "Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a new PublicAdvertisedPrefix. An up-to-date fingerprint must be provided in order to update the PublicAdvertisedPrefix, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a PublicAdvertisedPrefix.",
+ "format": "byte",
+ "type": "string"
+ },
+ "id": {
+ "description": "[Output Only] The unique identifier for the resource type. The server generates this identifier.",
+ "format": "uint64",
+ "type": "string"
+ },
+ "ipCidrRange": {
+ "description": "The address range, in CIDR format, represented by this public advertised prefix.",
+ "type": "string"
+ },
+ "kind": {
+ "default": "compute#publicAdvertisedPrefix",
+ "description": "[Output Only] Type of the resource. Always compute#publicAdvertisedPrefix for public advertised prefixes.",
+ "type": "string"
+ },
+ "name": {
+ "annotations": {
+ "required": [
+ "compute.publicAdvertisedPrefixes.insert"
+ ]
+ },
+ "description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "type": "string"
+ },
+ "pdpScope": {
+ "description": "Specifies how child public delegated prefix will be scoped. It could be one of following values: - `REGIONAL`: The public delegated prefix is regional only. The provisioning will take a few minutes. - `GLOBAL`: The public delegated prefix is global only. The provisioning will take ~4 weeks. - `GLOBAL_AND_REGIONAL` [output only]: The public delegated prefixes is BYOIP V1 legacy prefix. This is output only value and no longer supported in BYOIP V2. ",
+ "enum": [
+ "GLOBAL",
+ "GLOBAL_AND_REGIONAL",
+ "REGIONAL"
+ ],
+ "enumDescriptions": [
+ "The public delegated prefix is global only. The provisioning will take ~4 weeks.",
+ "The public delegated prefixes is BYOIP V1 legacy prefix. This is output only value and no longer supported in BYOIP V2.",
+ "The public delegated prefix is regional only. The provisioning will take a few minutes."
+ ],
+ "type": "string"
+ },
+ "publicDelegatedPrefixs": {
+ "description": "[Output Only] The list of public delegated prefixes that exist for this public advertised prefix.",
+ "items": {
+ "$ref": "PublicAdvertisedPrefixPublicDelegatedPrefix"
+ },
+ "type": "array"
+ },
+ "selfLink": {
+ "description": "[Output Only] Server-defined URL for the resource.",
+ "type": "string"
+ },
+ "sharedSecret": {
+ "description": "[Output Only] The shared secret to be used for reverse DNS verification.",
+ "type": "string"
+ },
+ "status": {
+ "description": "The status of the public advertised prefix. Possible values include: - `INITIAL`: RPKI validation is complete. - `PTR_CONFIGURED`: User has configured the PTR. - `VALIDATED`: Reverse DNS lookup is successful. - `REVERSE_DNS_LOOKUP_FAILED`: Reverse DNS lookup failed. - `PREFIX_CONFIGURATION_IN_PROGRESS`: The prefix is being configured. - `PREFIX_CONFIGURATION_COMPLETE`: The prefix is fully configured. - `PREFIX_REMOVAL_IN_PROGRESS`: The prefix is being removed. ",
+ "enum": [
+ "ANNOUNCED_TO_INTERNET",
+ "INITIAL",
+ "PREFIX_CONFIGURATION_COMPLETE",
+ "PREFIX_CONFIGURATION_IN_PROGRESS",
+ "PREFIX_REMOVAL_IN_PROGRESS",
+ "PTR_CONFIGURED",
+ "READY_TO_ANNOUNCE",
+ "REVERSE_DNS_LOOKUP_FAILED",
+ "VALIDATED"
+ ],
+ "enumDescriptions": [
+ "The prefix is announced to Internet.",
+ "RPKI validation is complete.",
+ "The prefix is fully configured.",
+ "The prefix is being configured.",
+ "The prefix is being removed.",
+ "User has configured the PTR.",
+ "The prefix is currently withdrawn but ready to be announced.",
+ "Reverse DNS lookup failed.",
+ "Reverse DNS lookup is successful."
+ ],
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "PublicAdvertisedPrefixList": {
+ "id": "PublicAdvertisedPrefixList",
+ "properties": {
+ "id": {
+ "description": "[Output Only] Unique identifier for the resource; defined by the server.",
+ "type": "string"
+ },
+ "items": {
+ "description": "A list of PublicAdvertisedPrefix resources.",
+ "items": {
+ "$ref": "PublicAdvertisedPrefix"
+ },
+ "type": "array"
+ },
+ "kind": {
+ "default": "compute#publicAdvertisedPrefixList",
+ "description": "[Output Only] Type of the resource. Always compute#publicAdvertisedPrefix for public advertised prefixes.",
+ "type": "string"
+ },
+ "nextPageToken": {
+ "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
+ "type": "string"
+ },
+ "selfLink": {
+ "description": "[Output Only] Server-defined URL for this resource.",
+ "type": "string"
+ },
+ "warning": {
+ "description": "[Output Only] Informational warning message.",
+ "properties": {
+ "code": {
+ "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.",
+ "enum": [
+ "CLEANUP_FAILED",
+ "DEPRECATED_RESOURCE_USED",
+ "DEPRECATED_TYPE_USED",
+ "DISK_SIZE_LARGER_THAN_IMAGE_SIZE",
+ "EXPERIMENTAL_TYPE_USED",
+ "EXTERNAL_API_WARNING",
+ "FIELD_VALUE_OVERRIDEN",
+ "INJECTED_KERNELS_DEPRECATED",
+ "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB",
+ "LARGE_DEPLOYMENT_WARNING",
+ "LIST_OVERHEAD_QUOTA_EXCEED",
+ "MISSING_TYPE_DEPENDENCY",
+ "NEXT_HOP_ADDRESS_NOT_ASSIGNED",
+ "NEXT_HOP_CANNOT_IP_FORWARD",
+ "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE",
+ "NEXT_HOP_INSTANCE_NOT_FOUND",
+ "NEXT_HOP_INSTANCE_NOT_ON_NETWORK",
+ "NEXT_HOP_NOT_RUNNING",
+ "NOT_CRITICAL_ERROR",
+ "NO_RESULTS_ON_PAGE",
+ "PARTIAL_SUCCESS",
+ "REQUIRED_TOS_AGREEMENT",
+ "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING",
+ "RESOURCE_NOT_DELETED",
+ "SCHEMA_VALIDATION_IGNORED",
+ "SINGLE_INSTANCE_PROPERTY_TEMPLATE",
+ "UNDECLARED_PROPERTIES",
+ "UNREACHABLE"
+ ],
+ "enumDeprecated": [
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ true,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false
+ ],
+ "enumDescriptions": [
+ "Warning about failed cleanup of transient changes made by a failed operation.",
+ "A link to a deprecated resource was created.",
+ "When deploying and at least one of the resources has a type marked as deprecated",
+ "The user created a boot disk that is larger than image size.",
+ "When deploying and at least one of the resources has a type marked as experimental",
+ "Warning that is present in an external api call",
+ "Warning that value of a field has been overridden. Deprecated unused field.",
+ "The operation involved use of an injected kernel, which is deprecated.",
+ "A WEIGHTED_MAGLEV backend service is associated with a health check that is not of type HTTP/HTTPS/HTTP2.",
+ "When deploying a deployment with a exceedingly large number of resources",
+ "Resource can't be retrieved due to list overhead quota exceed which captures the amount of resources filtered out by user-defined list filter.",
+ "A resource depends on a missing type",
+ "The route's nextHopIp address is not assigned to an instance on the network.",
+ "The route's next hop instance cannot ip forward.",
+ "The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route.",
+ "The route's nextHopInstance URL refers to an instance that does not exist.",
+ "The route's nextHopInstance URL refers to an instance that is not on the same network as the route.",
+ "The route's next hop instance does not have a status of RUNNING.",
+ "Error which is not critical. We decided to continue the process despite the mentioned error.",
+ "No results are present on a particular list page.",
+ "Success is reported, but some results may be missing due to errors",
+ "The user attempted to use a resource that requires a TOS they have not accepted.",
+ "Warning that a resource is in use.",
+ "One or more of the resources set to auto-delete could not be deleted because they were in use.",
+ "When a resource schema validation is ignored.",
+ "Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group.",
+ "When undeclared properties in the schema are present",
+ "A given scope cannot be reached."
+ ],
+ "type": "string"
+ },
+ "data": {
+ "description": "[Output Only] Metadata about this warning in key: value format. For example: \"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" } ",
+ "items": {
+ "properties": {
+ "key": {
+ "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).",
+ "type": "string"
+ },
+ "value": {
+ "description": "[Output Only] A warning data value corresponding to the key.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "type": "array"
+ },
+ "message": {
+ "description": "[Output Only] A human-readable description of the warning code.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ }
+ },
+ "type": "object"
+ },
+ "PublicAdvertisedPrefixPublicDelegatedPrefix": {
+ "description": "Represents a CIDR range which can be used to assign addresses.",
+ "id": "PublicAdvertisedPrefixPublicDelegatedPrefix",
"properties": {
- "kind": {
- "default": "compute#projectsGetXpnResources",
- "description": "[Output Only] Type of resource. Always compute#projectsGetXpnResources for lists of service resources (a.k.a service projects)",
+ "ipRange": {
+ "description": "The IP address range of the public delegated prefix",
"type": "string"
},
- "nextPageToken": {
- "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
+ "name": {
+ "description": "The name of the public delegated prefix",
"type": "string"
},
- "resources": {
- "description": "Service resources (a.k.a service projects) attached to this project as their shared VPC host.",
- "items": {
- "$ref": "XpnResourceId"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "ProjectsListXpnHostsRequest": {
- "id": "ProjectsListXpnHostsRequest",
- "properties": {
- "organization": {
- "description": "Optional organization ID managed by Cloud Resource Manager, for which to list shared VPC host projects. If not specified, the organization will be inferred from the project.",
+ "project": {
+ "description": "The project number of the public delegated prefix",
"type": "string"
- }
- },
- "type": "object"
- },
- "ProjectsSetDefaultNetworkTierRequest": {
- "id": "ProjectsSetDefaultNetworkTierRequest",
- "properties": {
- "networkTier": {
- "description": "Default network tier to be set.",
- "enum": [
- "FIXED_STANDARD",
- "PREMIUM",
- "STANDARD",
- "STANDARD_OVERRIDES_FIXED_STANDARD"
- ],
- "enumDescriptions": [
- "Public internet quality with fixed bandwidth.",
- "High quality, Google-grade network tier, support for all networking products.",
- "Public internet quality, only limited support for other networking products.",
- "(Output only) Temporary tier for FIXED_STANDARD when fixed standard tier is expired or not configured."
- ],
+ },
+ "region": {
+ "description": "The region of the public delegated prefix if it is regional. If absent, the prefix is global.",
+ "type": "string"
+ },
+ "status": {
+ "description": "The status of the public delegated prefix. Possible values are: INITIALIZING: The public delegated prefix is being initialized and addresses cannot be created yet. ANNOUNCED: The public delegated prefix is active.",
"type": "string"
}
},
"type": "object"
},
- "PublicAdvertisedPrefix": {
- "description": "A public advertised prefix represents an aggregated IP prefix or netblock which customers bring to cloud. The IP prefix is a single unit of route advertisement and is announced globally to the internet.",
- "id": "PublicAdvertisedPrefix",
+ "PublicDelegatedPrefix": {
+ "description": "A PublicDelegatedPrefix resource represents an IP block within a PublicAdvertisedPrefix that is configured within a single cloud scope (global or region). IPs in the block can be allocated to resources within that scope. Public delegated prefixes may be further broken up into smaller IP blocks in the same scope as the parent block.",
+ "id": "PublicDelegatedPrefix",
"properties": {
+ "allocatablePrefixLength": {
+ "description": "The allocatable prefix length supported by this public delegated prefix. This field is optional and cannot be set for prefixes in DELEGATION mode. It cannot be set for IPv4 prefixes either, and it always defaults to 32.",
+ "format": "int32",
+ "type": "integer"
+ },
"byoipApiVersion": {
"description": "[Output Only] The version of BYOIP API.",
"enum": [
@@ -61262,8 +64853,8 @@
"V2"
],
"enumDescriptions": [
- "This public advertised prefix can be used to create both regional and global public delegated prefixes. It usually takes 4 weeks to create or delete a public delegated prefix. The BGP status cannot be changed.",
- "This public advertised prefix can only be used to create regional public delegated prefixes. Public delegated prefix creation and deletion takes minutes and the BGP status can be modified."
+ "This public delegated prefix usually takes 4 weeks to delete, and the BGP status cannot be changed. Announce and Withdraw APIs can not be used on this prefix.",
+ "This public delegated prefix takes minutes to delete. Announce and Withdraw APIs can be used on this prefix to change the BGP status."
],
"type": "string"
},
@@ -61275,12 +64866,8 @@
"description": "An optional description of this resource. Provide this property when you create the resource.",
"type": "string"
},
- "dnsVerificationIp": {
- "description": "The address to be used for reverse DNS verification.",
- "type": "string"
- },
"fingerprint": {
- "description": "Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a new PublicAdvertisedPrefix. An up-to-date fingerprint must be provided in order to update the PublicAdvertisedPrefix, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a PublicAdvertisedPrefix.",
+ "description": "Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a new PublicDelegatedPrefix. An up-to-date fingerprint must be provided in order to update the PublicDelegatedPrefix, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a PublicDelegatedPrefix.",
"format": "byte",
"type": "string"
},
@@ -61290,111 +64877,464 @@
"type": "string"
},
"ipCidrRange": {
- "description": "The address range, in CIDR format, represented by this public advertised prefix.",
+ "description": "The IP address range, in CIDR format, represented by this public delegated prefix.",
"type": "string"
},
+ "isLiveMigration": {
+ "description": "If true, the prefix will be live migrated.",
+ "type": "boolean"
+ },
"kind": {
- "default": "compute#publicAdvertisedPrefix",
- "description": "[Output Only] Type of the resource. Always compute#publicAdvertisedPrefix for public advertised prefixes.",
+ "default": "compute#publicDelegatedPrefix",
+ "description": "[Output Only] Type of the resource. Always compute#publicDelegatedPrefix for public delegated prefixes.",
+ "type": "string"
+ },
+ "mode": {
+ "description": "The public delegated prefix mode for IPv6 only.",
+ "enum": [
+ "DELEGATION",
+ "EXTERNAL_IPV6_FORWARDING_RULE_CREATION"
+ ],
+ "enumDescriptions": [
+ "The public delegated prefix is used for further sub-delegation only. Such prefixes cannot set allocatablePrefixLength.",
+ "The public delegated prefix is used for creating forwarding rules only. Such prefixes cannot set publicDelegatedSubPrefixes."
+ ],
"type": "string"
},
"name": {
"annotations": {
"required": [
- "compute.publicAdvertisedPrefixes.insert"
+ "compute.publicDelegatedPrefixes.insert"
]
},
"description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.",
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
"type": "string"
},
- "pdpScope": {
- "description": "Specifies how child public delegated prefix will be scoped. It could be one of following values: - `REGIONAL`: The public delegated prefix is regional only. The provisioning will take a few minutes. - `GLOBAL`: The public delegated prefix is global only. The provisioning will take ~4 weeks. - `GLOBAL_AND_REGIONAL` [output only]: The public delegated prefixes is BYOIP V1 legacy prefix. This is output only value and no longer supported in BYOIP V2. ",
+ "parentPrefix": {
+ "description": "The URL of parent prefix. Either PublicAdvertisedPrefix or PublicDelegatedPrefix.",
+ "type": "string"
+ },
+ "publicDelegatedSubPrefixs": {
+ "description": "The list of sub public delegated prefixes that exist for this public delegated prefix.",
+ "items": {
+ "$ref": "PublicDelegatedPrefixPublicDelegatedSubPrefix"
+ },
+ "type": "array"
+ },
+ "region": {
+ "description": "[Output Only] URL of the region where the public delegated prefix resides. This field applies only to the region resource. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.",
+ "type": "string"
+ },
+ "selfLink": {
+ "description": "[Output Only] Server-defined URL for the resource.",
+ "type": "string"
+ },
+ "status": {
+ "description": "[Output Only] The status of the public delegated prefix, which can be one of following values: - `INITIALIZING` The public delegated prefix is being initialized and addresses cannot be created yet. - `READY_TO_ANNOUNCE` The public delegated prefix is a live migration prefix and is active. - `ANNOUNCED` The public delegated prefix is active. - `DELETING` The public delegated prefix is being deprovsioned. ",
"enum": [
- "GLOBAL",
- "GLOBAL_AND_REGIONAL",
- "REGIONAL"
+ "ANNOUNCED",
+ "ANNOUNCED_TO_GOOGLE",
+ "ANNOUNCED_TO_INTERNET",
+ "DELETING",
+ "INITIALIZING",
+ "READY_TO_ANNOUNCE"
],
"enumDescriptions": [
- "The public delegated prefix is global only. The provisioning will take ~4 weeks.",
- "The public delegated prefixes is BYOIP V1 legacy prefix. This is output only value and no longer supported in BYOIP V2.",
- "The public delegated prefix is regional only. The provisioning will take a few minutes."
+ "The public delegated prefix is active.",
+ "The prefix is announced within Google network.",
+ "The prefix is announced to Internet and within Google.",
+ "The public delegated prefix is being deprovsioned.",
+ "The public delegated prefix is being initialized and addresses cannot be created yet.",
+ "The public delegated prefix is currently withdrawn but ready to be announced."
],
"type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "PublicDelegatedPrefixAggregatedList": {
+ "id": "PublicDelegatedPrefixAggregatedList",
+ "properties": {
+ "id": {
+ "description": "[Output Only] Unique identifier for the resource; defined by the server.",
+ "type": "string"
},
- "publicDelegatedPrefixs": {
- "description": "[Output Only] The list of public delegated prefixes that exist for this public advertised prefix.",
+ "items": {
+ "additionalProperties": {
+ "$ref": "PublicDelegatedPrefixesScopedList",
+ "description": "[Output Only] Name of the scope containing this set of PublicDelegatedPrefixes."
+ },
+ "description": "A list of PublicDelegatedPrefixesScopedList resources.",
+ "type": "object"
+ },
+ "kind": {
+ "default": "compute#publicDelegatedPrefixAggregatedList",
+ "description": "[Output Only] Type of the resource. Always compute#publicDelegatedPrefixAggregatedList for aggregated lists of public delegated prefixes.",
+ "type": "string"
+ },
+ "nextPageToken": {
+ "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
+ "type": "string"
+ },
+ "selfLink": {
+ "description": "[Output Only] Server-defined URL for this resource.",
+ "type": "string"
+ },
+ "unreachables": {
+ "description": "[Output Only] Unreachable resources.",
"items": {
- "$ref": "PublicAdvertisedPrefixPublicDelegatedPrefix"
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "warning": {
+ "description": "[Output Only] Informational warning message.",
+ "properties": {
+ "code": {
+ "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.",
+ "enum": [
+ "CLEANUP_FAILED",
+ "DEPRECATED_RESOURCE_USED",
+ "DEPRECATED_TYPE_USED",
+ "DISK_SIZE_LARGER_THAN_IMAGE_SIZE",
+ "EXPERIMENTAL_TYPE_USED",
+ "EXTERNAL_API_WARNING",
+ "FIELD_VALUE_OVERRIDEN",
+ "INJECTED_KERNELS_DEPRECATED",
+ "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB",
+ "LARGE_DEPLOYMENT_WARNING",
+ "LIST_OVERHEAD_QUOTA_EXCEED",
+ "MISSING_TYPE_DEPENDENCY",
+ "NEXT_HOP_ADDRESS_NOT_ASSIGNED",
+ "NEXT_HOP_CANNOT_IP_FORWARD",
+ "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE",
+ "NEXT_HOP_INSTANCE_NOT_FOUND",
+ "NEXT_HOP_INSTANCE_NOT_ON_NETWORK",
+ "NEXT_HOP_NOT_RUNNING",
+ "NOT_CRITICAL_ERROR",
+ "NO_RESULTS_ON_PAGE",
+ "PARTIAL_SUCCESS",
+ "REQUIRED_TOS_AGREEMENT",
+ "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING",
+ "RESOURCE_NOT_DELETED",
+ "SCHEMA_VALIDATION_IGNORED",
+ "SINGLE_INSTANCE_PROPERTY_TEMPLATE",
+ "UNDECLARED_PROPERTIES",
+ "UNREACHABLE"
+ ],
+ "enumDeprecated": [
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ true,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false
+ ],
+ "enumDescriptions": [
+ "Warning about failed cleanup of transient changes made by a failed operation.",
+ "A link to a deprecated resource was created.",
+ "When deploying and at least one of the resources has a type marked as deprecated",
+ "The user created a boot disk that is larger than image size.",
+ "When deploying and at least one of the resources has a type marked as experimental",
+ "Warning that is present in an external api call",
+ "Warning that value of a field has been overridden. Deprecated unused field.",
+ "The operation involved use of an injected kernel, which is deprecated.",
+ "A WEIGHTED_MAGLEV backend service is associated with a health check that is not of type HTTP/HTTPS/HTTP2.",
+ "When deploying a deployment with a exceedingly large number of resources",
+ "Resource can't be retrieved due to list overhead quota exceed which captures the amount of resources filtered out by user-defined list filter.",
+ "A resource depends on a missing type",
+ "The route's nextHopIp address is not assigned to an instance on the network.",
+ "The route's next hop instance cannot ip forward.",
+ "The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route.",
+ "The route's nextHopInstance URL refers to an instance that does not exist.",
+ "The route's nextHopInstance URL refers to an instance that is not on the same network as the route.",
+ "The route's next hop instance does not have a status of RUNNING.",
+ "Error which is not critical. We decided to continue the process despite the mentioned error.",
+ "No results are present on a particular list page.",
+ "Success is reported, but some results may be missing due to errors",
+ "The user attempted to use a resource that requires a TOS they have not accepted.",
+ "Warning that a resource is in use.",
+ "One or more of the resources set to auto-delete could not be deleted because they were in use.",
+ "When a resource schema validation is ignored.",
+ "Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group.",
+ "When undeclared properties in the schema are present",
+ "A given scope cannot be reached."
+ ],
+ "type": "string"
+ },
+ "data": {
+ "description": "[Output Only] Metadata about this warning in key: value format. For example: \"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" } ",
+ "items": {
+ "properties": {
+ "key": {
+ "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).",
+ "type": "string"
+ },
+ "value": {
+ "description": "[Output Only] A warning data value corresponding to the key.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "type": "array"
+ },
+ "message": {
+ "description": "[Output Only] A human-readable description of the warning code.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ }
+ },
+ "type": "object"
+ },
+ "PublicDelegatedPrefixList": {
+ "id": "PublicDelegatedPrefixList",
+ "properties": {
+ "id": {
+ "description": "[Output Only] Unique identifier for the resource; defined by the server.",
+ "type": "string"
+ },
+ "items": {
+ "description": "A list of PublicDelegatedPrefix resources.",
+ "items": {
+ "$ref": "PublicDelegatedPrefix"
},
"type": "array"
},
+ "kind": {
+ "default": "compute#publicDelegatedPrefixList",
+ "description": "[Output Only] Type of the resource. Always compute#publicDelegatedPrefixList for public delegated prefixes.",
+ "type": "string"
+ },
+ "nextPageToken": {
+ "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
+ "type": "string"
+ },
"selfLink": {
- "description": "[Output Only] Server-defined URL for the resource.",
+ "description": "[Output Only] Server-defined URL for this resource.",
"type": "string"
},
- "sharedSecret": {
- "description": "[Output Only] The shared secret to be used for reverse DNS verification.",
+ "warning": {
+ "description": "[Output Only] Informational warning message.",
+ "properties": {
+ "code": {
+ "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.",
+ "enum": [
+ "CLEANUP_FAILED",
+ "DEPRECATED_RESOURCE_USED",
+ "DEPRECATED_TYPE_USED",
+ "DISK_SIZE_LARGER_THAN_IMAGE_SIZE",
+ "EXPERIMENTAL_TYPE_USED",
+ "EXTERNAL_API_WARNING",
+ "FIELD_VALUE_OVERRIDEN",
+ "INJECTED_KERNELS_DEPRECATED",
+ "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB",
+ "LARGE_DEPLOYMENT_WARNING",
+ "LIST_OVERHEAD_QUOTA_EXCEED",
+ "MISSING_TYPE_DEPENDENCY",
+ "NEXT_HOP_ADDRESS_NOT_ASSIGNED",
+ "NEXT_HOP_CANNOT_IP_FORWARD",
+ "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE",
+ "NEXT_HOP_INSTANCE_NOT_FOUND",
+ "NEXT_HOP_INSTANCE_NOT_ON_NETWORK",
+ "NEXT_HOP_NOT_RUNNING",
+ "NOT_CRITICAL_ERROR",
+ "NO_RESULTS_ON_PAGE",
+ "PARTIAL_SUCCESS",
+ "REQUIRED_TOS_AGREEMENT",
+ "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING",
+ "RESOURCE_NOT_DELETED",
+ "SCHEMA_VALIDATION_IGNORED",
+ "SINGLE_INSTANCE_PROPERTY_TEMPLATE",
+ "UNDECLARED_PROPERTIES",
+ "UNREACHABLE"
+ ],
+ "enumDeprecated": [
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ true,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false
+ ],
+ "enumDescriptions": [
+ "Warning about failed cleanup of transient changes made by a failed operation.",
+ "A link to a deprecated resource was created.",
+ "When deploying and at least one of the resources has a type marked as deprecated",
+ "The user created a boot disk that is larger than image size.",
+ "When deploying and at least one of the resources has a type marked as experimental",
+ "Warning that is present in an external api call",
+ "Warning that value of a field has been overridden. Deprecated unused field.",
+ "The operation involved use of an injected kernel, which is deprecated.",
+ "A WEIGHTED_MAGLEV backend service is associated with a health check that is not of type HTTP/HTTPS/HTTP2.",
+ "When deploying a deployment with a exceedingly large number of resources",
+ "Resource can't be retrieved due to list overhead quota exceed which captures the amount of resources filtered out by user-defined list filter.",
+ "A resource depends on a missing type",
+ "The route's nextHopIp address is not assigned to an instance on the network.",
+ "The route's next hop instance cannot ip forward.",
+ "The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route.",
+ "The route's nextHopInstance URL refers to an instance that does not exist.",
+ "The route's nextHopInstance URL refers to an instance that is not on the same network as the route.",
+ "The route's next hop instance does not have a status of RUNNING.",
+ "Error which is not critical. We decided to continue the process despite the mentioned error.",
+ "No results are present on a particular list page.",
+ "Success is reported, but some results may be missing due to errors",
+ "The user attempted to use a resource that requires a TOS they have not accepted.",
+ "Warning that a resource is in use.",
+ "One or more of the resources set to auto-delete could not be deleted because they were in use.",
+ "When a resource schema validation is ignored.",
+ "Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group.",
+ "When undeclared properties in the schema are present",
+ "A given scope cannot be reached."
+ ],
+ "type": "string"
+ },
+ "data": {
+ "description": "[Output Only] Metadata about this warning in key: value format. For example: \"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" } ",
+ "items": {
+ "properties": {
+ "key": {
+ "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).",
+ "type": "string"
+ },
+ "value": {
+ "description": "[Output Only] A warning data value corresponding to the key.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "type": "array"
+ },
+ "message": {
+ "description": "[Output Only] A human-readable description of the warning code.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ }
+ },
+ "type": "object"
+ },
+ "PublicDelegatedPrefixPublicDelegatedSubPrefix": {
+ "description": "Represents a sub PublicDelegatedPrefix.",
+ "id": "PublicDelegatedPrefixPublicDelegatedSubPrefix",
+ "properties": {
+ "allocatablePrefixLength": {
+ "description": "The allocatable prefix length supported by this PublicDelegatedSubPrefix.",
+ "format": "int32",
+ "type": "integer"
+ },
+ "delegateeProject": {
+ "description": "Name of the project scoping this PublicDelegatedSubPrefix.",
+ "type": "string"
+ },
+ "description": {
+ "description": "An optional description of this resource. Provide this property when you create the resource.",
+ "type": "string"
+ },
+ "ipCidrRange": {
+ "description": "The IP address range, in CIDR format, represented by this sub public delegated prefix.",
+ "type": "string"
+ },
+ "isAddress": {
+ "description": "Whether the sub prefix is delegated to create Address resources in the delegatee project.",
+ "type": "boolean"
+ },
+ "mode": {
+ "description": "The PublicDelegatedSubPrefix mode for IPv6 only.",
+ "enum": [
+ "DELEGATION",
+ "EXTERNAL_IPV6_FORWARDING_RULE_CREATION"
+ ],
+ "enumDescriptions": [
+ "The public delegated prefix is used for further sub-delegation only. Such prefixes cannot set allocatablePrefixLength.",
+ "The public delegated prefix is used for creating forwarding rules only. Such prefixes cannot set publicDelegatedSubPrefixes."
+ ],
+ "type": "string"
+ },
+ "name": {
+ "description": "The name of the sub public delegated prefix.",
+ "type": "string"
+ },
+ "region": {
+ "description": "[Output Only] The region of the sub public delegated prefix if it is regional. If absent, the sub prefix is global.",
"type": "string"
},
"status": {
- "description": "The status of the public advertised prefix. Possible values include: - `INITIAL`: RPKI validation is complete. - `PTR_CONFIGURED`: User has configured the PTR. - `VALIDATED`: Reverse DNS lookup is successful. - `REVERSE_DNS_LOOKUP_FAILED`: Reverse DNS lookup failed. - `PREFIX_CONFIGURATION_IN_PROGRESS`: The prefix is being configured. - `PREFIX_CONFIGURATION_COMPLETE`: The prefix is fully configured. - `PREFIX_REMOVAL_IN_PROGRESS`: The prefix is being removed. ",
+ "description": "[Output Only] The status of the sub public delegated prefix.",
"enum": [
- "ANNOUNCED_TO_INTERNET",
- "INITIAL",
- "PREFIX_CONFIGURATION_COMPLETE",
- "PREFIX_CONFIGURATION_IN_PROGRESS",
- "PREFIX_REMOVAL_IN_PROGRESS",
- "PTR_CONFIGURED",
- "READY_TO_ANNOUNCE",
- "REVERSE_DNS_LOOKUP_FAILED",
- "VALIDATED"
+ "ACTIVE",
+ "INACTIVE"
],
"enumDescriptions": [
- "The prefix is announced to Internet.",
- "RPKI validation is complete.",
- "The prefix is fully configured.",
- "The prefix is being configured.",
- "The prefix is being removed.",
- "User has configured the PTR.",
- "The prefix is currently withdrawn but ready to be announced.",
- "Reverse DNS lookup failed.",
- "Reverse DNS lookup is successful."
+ "",
+ ""
],
"type": "string"
}
},
"type": "object"
},
- "PublicAdvertisedPrefixList": {
- "id": "PublicAdvertisedPrefixList",
+ "PublicDelegatedPrefixesScopedList": {
+ "id": "PublicDelegatedPrefixesScopedList",
"properties": {
- "id": {
- "description": "[Output Only] Unique identifier for the resource; defined by the server.",
- "type": "string"
- },
- "items": {
- "description": "A list of PublicAdvertisedPrefix resources.",
+ "publicDelegatedPrefixes": {
+ "description": "[Output Only] A list of PublicDelegatedPrefixes contained in this scope.",
"items": {
- "$ref": "PublicAdvertisedPrefix"
+ "$ref": "PublicDelegatedPrefix"
},
"type": "array"
},
- "kind": {
- "default": "compute#publicAdvertisedPrefixList",
- "description": "[Output Only] Type of the resource. Always compute#publicAdvertisedPrefix for public advertised prefixes.",
- "type": "string"
- },
- "nextPageToken": {
- "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
- "type": "string"
- },
- "selfLink": {
- "description": "[Output Only] Server-defined URL for this resource.",
- "type": "string"
- },
"warning": {
- "description": "[Output Only] Informational warning message.",
+ "description": "[Output Only] Informational warning which replaces the list of public delegated prefixes when the list is empty.",
"properties": {
"code": {
"description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.",
@@ -61517,169 +65457,463 @@
},
"type": "object"
},
- "PublicAdvertisedPrefixPublicDelegatedPrefix": {
- "description": "Represents a CIDR range which can be used to assign addresses.",
- "id": "PublicAdvertisedPrefixPublicDelegatedPrefix",
+ "Quota": {
+ "description": "A quotas entry.",
+ "id": "Quota",
"properties": {
- "ipRange": {
- "description": "The IP address range of the public delegated prefix",
- "type": "string"
- },
- "name": {
- "description": "The name of the public delegated prefix",
- "type": "string"
+ "limit": {
+ "description": "[Output Only] Quota limit for this metric.",
+ "format": "double",
+ "type": "number"
},
- "project": {
- "description": "The project number of the public delegated prefix",
+ "metric": {
+ "description": "[Output Only] Name of the quota metric.",
+ "enum": [
+ "A2_CPUS",
+ "AFFINITY_GROUPS",
+ "AUTOSCALERS",
+ "BACKEND_BUCKETS",
+ "BACKEND_SERVICES",
+ "C2D_CPUS",
+ "C2_CPUS",
+ "C3_CPUS",
+ "COMMITMENTS",
+ "COMMITTED_A2_CPUS",
+ "COMMITTED_C2D_CPUS",
+ "COMMITTED_C2_CPUS",
+ "COMMITTED_C3_CPUS",
+ "COMMITTED_CPUS",
+ "COMMITTED_E2_CPUS",
+ "COMMITTED_LICENSES",
+ "COMMITTED_LOCAL_SSD_TOTAL_GB",
+ "COMMITTED_M3_CPUS",
+ "COMMITTED_MEMORY_OPTIMIZED_CPUS",
+ "COMMITTED_N2A_CPUS",
+ "COMMITTED_N2D_CPUS",
+ "COMMITTED_N2_CPUS",
+ "COMMITTED_NVIDIA_A100_80GB_GPUS",
+ "COMMITTED_NVIDIA_A100_GPUS",
+ "COMMITTED_NVIDIA_H100_GPUS",
+ "COMMITTED_NVIDIA_K80_GPUS",
+ "COMMITTED_NVIDIA_L4_GPUS",
+ "COMMITTED_NVIDIA_P100_GPUS",
+ "COMMITTED_NVIDIA_P4_GPUS",
+ "COMMITTED_NVIDIA_T4_GPUS",
+ "COMMITTED_NVIDIA_V100_GPUS",
+ "COMMITTED_T2A_CPUS",
+ "COMMITTED_T2D_CPUS",
+ "COMMITTED_Z3_CPUS",
+ "CPUS",
+ "CPUS_ALL_REGIONS",
+ "DISKS_TOTAL_GB",
+ "E2_CPUS",
+ "EXTERNAL_MANAGED_FORWARDING_RULES",
+ "EXTERNAL_NETWORK_LB_FORWARDING_RULES",
+ "EXTERNAL_PROTOCOL_FORWARDING_RULES",
+ "EXTERNAL_VPN_GATEWAYS",
+ "FIREWALLS",
+ "FORWARDING_RULES",
+ "GLOBAL_EXTERNAL_MANAGED_BACKEND_SERVICES",
+ "GLOBAL_EXTERNAL_MANAGED_FORWARDING_RULES",
+ "GLOBAL_EXTERNAL_PROXY_LB_BACKEND_SERVICES",
+ "GLOBAL_INTERNAL_ADDRESSES",
+ "GLOBAL_INTERNAL_MANAGED_BACKEND_SERVICES",
+ "GLOBAL_INTERNAL_TRAFFIC_DIRECTOR_BACKEND_SERVICES",
+ "GPUS_ALL_REGIONS",
+ "HDB_TOTAL_GB",
+ "HDB_TOTAL_IOPS",
+ "HDB_TOTAL_THROUGHPUT",
+ "HEALTH_CHECKS",
+ "IMAGES",
+ "INSTANCES",
+ "INSTANCE_GROUPS",
+ "INSTANCE_GROUP_MANAGERS",
+ "INSTANCE_TEMPLATES",
+ "INTERCONNECTS",
+ "INTERCONNECT_ATTACHMENTS_PER_REGION",
+ "INTERCONNECT_ATTACHMENTS_TOTAL_MBPS",
+ "INTERCONNECT_TOTAL_GBPS",
+ "INTERNAL_ADDRESSES",
+ "INTERNAL_TRAFFIC_DIRECTOR_FORWARDING_RULES",
+ "IN_PLACE_SNAPSHOTS",
+ "IN_USE_ADDRESSES",
+ "IN_USE_BACKUP_SCHEDULES",
+ "IN_USE_SNAPSHOT_SCHEDULES",
+ "LOCAL_SSD_TOTAL_GB",
+ "M1_CPUS",
+ "M2_CPUS",
+ "M3_CPUS",
+ "MACHINE_IMAGES",
+ "N2A_CPUS",
+ "N2D_CPUS",
+ "N2_CPUS",
+ "NETWORKS",
+ "NETWORK_ATTACHMENTS",
+ "NETWORK_ENDPOINT_GROUPS",
+ "NETWORK_FIREWALL_POLICIES",
+ "NET_LB_SECURITY_POLICIES_PER_REGION",
+ "NET_LB_SECURITY_POLICY_RULES_PER_REGION",
+ "NET_LB_SECURITY_POLICY_RULE_ATTRIBUTES_PER_REGION",
+ "NODE_GROUPS",
+ "NODE_TEMPLATES",
+ "NVIDIA_A100_80GB_GPUS",
+ "NVIDIA_A100_GPUS",
+ "NVIDIA_K80_GPUS",
+ "NVIDIA_L4_GPUS",
+ "NVIDIA_P100_GPUS",
+ "NVIDIA_P100_VWS_GPUS",
+ "NVIDIA_P4_GPUS",
+ "NVIDIA_P4_VWS_GPUS",
+ "NVIDIA_T4_GPUS",
+ "NVIDIA_T4_VWS_GPUS",
+ "NVIDIA_V100_GPUS",
+ "PACKET_MIRRORINGS",
+ "PD_EXTREME_TOTAL_PROVISIONED_IOPS",
+ "PREEMPTIBLE_CPUS",
+ "PREEMPTIBLE_LOCAL_SSD_GB",
+ "PREEMPTIBLE_NVIDIA_A100_80GB_GPUS",
+ "PREEMPTIBLE_NVIDIA_A100_GPUS",
+ "PREEMPTIBLE_NVIDIA_H100_GPUS",
+ "PREEMPTIBLE_NVIDIA_K80_GPUS",
+ "PREEMPTIBLE_NVIDIA_L4_GPUS",
+ "PREEMPTIBLE_NVIDIA_P100_GPUS",
+ "PREEMPTIBLE_NVIDIA_P100_VWS_GPUS",
+ "PREEMPTIBLE_NVIDIA_P4_GPUS",
+ "PREEMPTIBLE_NVIDIA_P4_VWS_GPUS",
+ "PREEMPTIBLE_NVIDIA_T4_GPUS",
+ "PREEMPTIBLE_NVIDIA_T4_VWS_GPUS",
+ "PREEMPTIBLE_NVIDIA_V100_GPUS",
+ "PREEMPTIBLE_TPU_LITE_DEVICE_V5",
+ "PREEMPTIBLE_TPU_LITE_PODSLICE_V5",
+ "PREEMPTIBLE_TPU_PODSLICE_V4",
+ "PSC_ILB_CONSUMER_FORWARDING_RULES_PER_PRODUCER_NETWORK",
+ "PSC_INTERNAL_LB_FORWARDING_RULES",
+ "PUBLIC_ADVERTISED_PREFIXES",
+ "PUBLIC_DELEGATED_PREFIXES",
+ "REGIONAL_AUTOSCALERS",
+ "REGIONAL_EXTERNAL_MANAGED_BACKEND_SERVICES",
+ "REGIONAL_EXTERNAL_NETWORK_LB_BACKEND_SERVICES",
+ "REGIONAL_INSTANCE_GROUP_MANAGERS",
+ "REGIONAL_INTERNAL_LB_BACKEND_SERVICES",
+ "REGIONAL_INTERNAL_MANAGED_BACKEND_SERVICES",
+ "REGIONAL_INTERNAL_TRAFFIC_DIRECTOR_BACKEND_SERVICES",
+ "RESERVATIONS",
+ "RESOURCE_POLICIES",
+ "ROUTERS",
+ "ROUTES",
+ "SECURITY_POLICIES",
+ "SECURITY_POLICIES_PER_REGION",
+ "SECURITY_POLICY_ADVANCED_RULES_PER_REGION",
+ "SECURITY_POLICY_CEVAL_RULES",
+ "SECURITY_POLICY_RULES",
+ "SECURITY_POLICY_RULES_PER_REGION",
+ "SERVICE_ATTACHMENTS",
+ "SNAPSHOTS",
+ "SSD_TOTAL_GB",
+ "SSL_CERTIFICATES",
+ "SSL_POLICIES",
+ "STATIC_ADDRESSES",
+ "STATIC_BYOIP_ADDRESSES",
+ "STATIC_EXTERNAL_IPV6_ADDRESS_RANGES",
+ "SUBNETWORKS",
+ "T2A_CPUS",
+ "T2D_CPUS",
+ "TARGET_HTTPS_PROXIES",
+ "TARGET_HTTP_PROXIES",
+ "TARGET_INSTANCES",
+ "TARGET_POOLS",
+ "TARGET_SSL_PROXIES",
+ "TARGET_TCP_PROXIES",
+ "TARGET_VPN_GATEWAYS",
+ "TPU_LITE_DEVICE_V5",
+ "TPU_LITE_PODSLICE_V5",
+ "TPU_PODSLICE_V4",
+ "URL_MAPS",
+ "VARIABLE_IPV6_PUBLIC_DELEGATED_PREFIXES",
+ "VPN_GATEWAYS",
+ "VPN_TUNNELS",
+ "XPN_SERVICE_PROJECTS"
+ ],
+ "enumDescriptions": [
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "Guest CPUs",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "The total number of snapshots allowed for a single project.",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ ],
"type": "string"
},
- "region": {
- "description": "The region of the public delegated prefix if it is regional. If absent, the prefix is global.",
+ "owner": {
+ "description": "[Output Only] Owning resource. This is the resource on which this quota is applied.",
"type": "string"
},
- "status": {
- "description": "The status of the public delegated prefix. Possible values are: INITIALIZING: The public delegated prefix is being initialized and addresses cannot be created yet. ANNOUNCED: The public delegated prefix is active.",
- "type": "string"
+ "usage": {
+ "description": "[Output Only] Current usage of this metric.",
+ "format": "double",
+ "type": "number"
}
},
"type": "object"
},
- "PublicDelegatedPrefix": {
- "description": "A PublicDelegatedPrefix resource represents an IP block within a PublicAdvertisedPrefix that is configured within a single cloud scope (global or region). IPs in the block can be allocated to resources within that scope. Public delegated prefixes may be further broken up into smaller IP blocks in the same scope as the parent block.",
- "id": "PublicDelegatedPrefix",
+ "QuotaExceededInfo": {
+ "description": "Additional details for quota exceeded error for resource quota.",
+ "id": "QuotaExceededInfo",
"properties": {
- "byoipApiVersion": {
- "description": "[Output Only] The version of BYOIP API.",
- "enum": [
- "V1",
- "V2"
- ],
- "enumDescriptions": [
- "This public delegated prefix usually takes 4 weeks to delete, and the BGP status cannot be changed. Announce and Withdraw APIs can not be used on this prefix.",
- "This public delegated prefix takes minutes to delete. Announce and Withdraw APIs can be used on this prefix to change the BGP status."
- ],
- "type": "string"
+ "dimensions": {
+ "additionalProperties": {
+ "type": "string"
+ },
+ "description": "The map holding related quota dimensions.",
+ "type": "object"
},
- "creationTimestamp": {
- "description": "[Output Only] Creation timestamp in RFC3339 text format.",
- "type": "string"
+ "futureLimit": {
+ "description": "Future quota limit being rolled out. The limit's unit depends on the quota type or metric.",
+ "format": "double",
+ "type": "number"
},
- "description": {
- "description": "An optional description of this resource. Provide this property when you create the resource.",
- "type": "string"
+ "limit": {
+ "description": "Current effective quota limit. The limit's unit depends on the quota type or metric.",
+ "format": "double",
+ "type": "number"
},
- "fingerprint": {
- "description": "Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a new PublicDelegatedPrefix. An up-to-date fingerprint must be provided in order to update the PublicDelegatedPrefix, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a PublicDelegatedPrefix.",
- "format": "byte",
+ "limitName": {
+ "description": "The name of the quota limit.",
"type": "string"
},
- "id": {
- "description": "[Output Only] The unique identifier for the resource type. The server generates this identifier.",
- "format": "uint64",
+ "metricName": {
+ "description": "The Compute Engine quota metric name.",
"type": "string"
},
- "ipCidrRange": {
- "description": "The IP address range, in CIDR format, represented by this public delegated prefix.",
+ "rolloutStatus": {
+ "description": "Rollout status of the future quota limit.",
+ "enum": [
+ "IN_PROGRESS",
+ "ROLLOUT_STATUS_UNSPECIFIED"
+ ],
+ "enumDescriptions": [
+ "IN_PROGRESS - A rollout is in process which will change the limit value to future limit.",
+ "ROLLOUT_STATUS_UNSPECIFIED - Rollout status is not specified. The default value."
+ ],
"type": "string"
- },
- "isLiveMigration": {
- "description": "If true, the prefix will be live migrated.",
- "type": "boolean"
- },
+ }
+ },
+ "type": "object"
+ },
+ "Reference": {
+ "description": "Represents a reference to a resource.",
+ "id": "Reference",
+ "properties": {
"kind": {
- "default": "compute#publicDelegatedPrefix",
- "description": "[Output Only] Type of the resource. Always compute#publicDelegatedPrefix for public delegated prefixes.",
- "type": "string"
- },
- "name": {
- "annotations": {
- "required": [
- "compute.publicDelegatedPrefixes.insert"
- ]
- },
- "description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- "type": "string"
- },
- "parentPrefix": {
- "description": "The URL of parent prefix. Either PublicAdvertisedPrefix or PublicDelegatedPrefix.",
+ "default": "compute#reference",
+ "description": "[Output Only] Type of the resource. Always compute#reference for references.",
"type": "string"
},
- "publicDelegatedSubPrefixs": {
- "description": "The list of sub public delegated prefixes that exist for this public delegated prefix.",
- "items": {
- "$ref": "PublicDelegatedPrefixPublicDelegatedSubPrefix"
- },
- "type": "array"
- },
- "region": {
- "description": "[Output Only] URL of the region where the public delegated prefix resides. This field applies only to the region resource. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.",
+ "referenceType": {
+ "description": "A description of the reference type with no implied semantics. Possible values include: 1. MEMBER_OF ",
"type": "string"
},
- "selfLink": {
- "description": "[Output Only] Server-defined URL for the resource.",
+ "referrer": {
+ "description": "URL of the resource which refers to the target.",
"type": "string"
},
- "status": {
- "description": "[Output Only] The status of the public delegated prefix, which can be one of following values: - `INITIALIZING` The public delegated prefix is being initialized and addresses cannot be created yet. - `READY_TO_ANNOUNCE` The public delegated prefix is a live migration prefix and is active. - `ANNOUNCED` The public delegated prefix is active. - `DELETING` The public delegated prefix is being deprovsioned. ",
- "enum": [
- "ANNOUNCED",
- "ANNOUNCED_TO_GOOGLE",
- "ANNOUNCED_TO_INTERNET",
- "DELETING",
- "INITIALIZING",
- "READY_TO_ANNOUNCE"
- ],
- "enumDescriptions": [
- "The public delegated prefix is active.",
- "The prefix is announced within Google network.",
- "The prefix is announced to Internet and within Google.",
- "The public delegated prefix is being deprovsioned.",
- "The public delegated prefix is being initialized and addresses cannot be created yet.",
- "The public delegated prefix is currently withdrawn but ready to be announced."
- ],
+ "target": {
+ "description": "URL of the resource to which this reference points.",
"type": "string"
}
},
"type": "object"
},
- "PublicDelegatedPrefixAggregatedList": {
- "id": "PublicDelegatedPrefixAggregatedList",
+ "Region": {
+ "description": "Represents a Region resource. A region is a geographical area where a resource is located. For more information, read Regions and Zones.",
+ "id": "Region",
"properties": {
- "id": {
- "description": "[Output Only] Unique identifier for the resource; defined by the server.",
+ "creationTimestamp": {
+ "description": "[Output Only] Creation timestamp in RFC3339 text format.",
"type": "string"
},
- "items": {
- "additionalProperties": {
- "$ref": "PublicDelegatedPrefixesScopedList",
- "description": "[Output Only] Name of the scope containing this set of PublicDelegatedPrefixes."
- },
- "description": "A list of PublicDelegatedPrefixesScopedList resources.",
- "type": "object"
+ "deprecated": {
+ "$ref": "DeprecationStatus",
+ "description": "[Output Only] The deprecation status associated with this region."
},
- "kind": {
- "default": "compute#publicDelegatedPrefixAggregatedList",
- "description": "[Output Only] Type of the resource. Always compute#publicDelegatedPrefixAggregatedList for aggregated lists of public delegated prefixes.",
+ "description": {
+ "description": "[Output Only] Textual description of the resource.",
"type": "string"
},
- "nextPageToken": {
- "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
+ "id": {
+ "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.",
+ "format": "uint64",
"type": "string"
},
- "selfLink": {
- "description": "[Output Only] Server-defined URL for this resource.",
+ "kind": {
+ "default": "compute#region",
+ "description": "[Output Only] Type of the resource. Always compute#region for regions.",
"type": "string"
},
- "unreachables": {
- "description": "[Output Only] Unreachable resources.",
- "items": {
- "type": "string"
- },
- "type": "array"
+ "name": {
+ "description": "[Output Only] Name of the resource.",
+ "type": "string"
},
- "warning": {
- "description": "[Output Only] Informational warning message.",
+ "quotaStatusWarning": {
+ "description": "[Output Only] Warning of fetching the `quotas` field for this region. This field is populated only if fetching of the `quotas` field fails.",
"properties": {
"code": {
"description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.",
@@ -61798,27 +66032,76 @@
}
},
"type": "object"
+ },
+ "quotas": {
+ "description": "[Output Only] Quotas assigned to this region.",
+ "items": {
+ "$ref": "Quota"
+ },
+ "type": "array"
+ },
+ "selfLink": {
+ "description": "[Output Only] Server-defined URL for the resource.",
+ "type": "string"
+ },
+ "status": {
+ "description": "[Output Only] Status of the region, either UP or DOWN.",
+ "enum": [
+ "DOWN",
+ "UP"
+ ],
+ "enumDescriptions": [
+ "",
+ ""
+ ],
+ "type": "string"
+ },
+ "supportsPzs": {
+ "description": "[Output Only] Reserved for future use.",
+ "type": "boolean"
+ },
+ "zones": {
+ "description": "[Output Only] A list of zones available in this region, in the form of resource URLs.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
}
},
"type": "object"
},
- "PublicDelegatedPrefixList": {
- "id": "PublicDelegatedPrefixList",
+ "RegionAddressesMoveRequest": {
+ "id": "RegionAddressesMoveRequest",
+ "properties": {
+ "description": {
+ "description": "An optional destination address description if intended to be different from the source.",
+ "type": "string"
+ },
+ "destinationAddress": {
+ "description": "The URL of the destination address to move to. This can be a full or partial URL. For example, the following are all valid URLs to a address: - https://www.googleapis.com/compute/v1/projects/project/regions/region /addresses/address - projects/project/regions/region/addresses/address Note that destination project must be different from the source project. So /regions/region/addresses/address is not valid partial url.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "RegionAutoscalerList": {
+ "description": "Contains a list of autoscalers.",
+ "id": "RegionAutoscalerList",
"properties": {
"id": {
"description": "[Output Only] Unique identifier for the resource; defined by the server.",
"type": "string"
},
"items": {
- "description": "A list of PublicDelegatedPrefix resources.",
+ "description": "A list of Autoscaler resources.",
"items": {
- "$ref": "PublicDelegatedPrefix"
+ "$ref": "Autoscaler"
},
"type": "array"
},
"kind": {
- "default": "compute#publicDelegatedPrefixList",
- "description": "[Output Only] Type of the resource. Always compute#publicDelegatedPrefixList for public delegated prefixes.",
+ "default": "compute#regionAutoscalerList",
+ "description": "Type of resource.",
"type": "string"
},
"nextPageToken": {
@@ -61953,61 +66236,35 @@
},
"type": "object"
},
- "PublicDelegatedPrefixPublicDelegatedSubPrefix": {
- "description": "Represents a sub PublicDelegatedPrefix.",
- "id": "PublicDelegatedPrefixPublicDelegatedSubPrefix",
+ "RegionDiskTypeList": {
+ "id": "RegionDiskTypeList",
"properties": {
- "delegateeProject": {
- "description": "Name of the project scoping this PublicDelegatedSubPrefix.",
- "type": "string"
- },
- "description": {
- "description": "An optional description of this resource. Provide this property when you create the resource.",
- "type": "string"
- },
- "ipCidrRange": {
- "description": "The IP address range, in CIDR format, represented by this sub public delegated prefix.",
+ "id": {
+ "description": "[Output Only] Unique identifier for the resource; defined by the server.",
"type": "string"
},
- "isAddress": {
- "description": "Whether the sub prefix is delegated to create Address resources in the delegatee project.",
- "type": "boolean"
+ "items": {
+ "description": "A list of DiskType resources.",
+ "items": {
+ "$ref": "DiskType"
+ },
+ "type": "array"
},
- "name": {
- "description": "The name of the sub public delegated prefix.",
+ "kind": {
+ "default": "compute#regionDiskTypeList",
+ "description": "[Output Only] Type of resource. Always compute#regionDiskTypeList for region disk types.",
"type": "string"
},
- "region": {
- "description": "[Output Only] The region of the sub public delegated prefix if it is regional. If absent, the sub prefix is global.",
+ "nextPageToken": {
+ "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
"type": "string"
},
- "status": {
- "description": "[Output Only] The status of the sub public delegated prefix.",
- "enum": [
- "ACTIVE",
- "INACTIVE"
- ],
- "enumDescriptions": [
- "",
- ""
- ],
+ "selfLink": {
+ "description": "[Output Only] Server-defined URL for this resource.",
"type": "string"
- }
- },
- "type": "object"
- },
- "PublicDelegatedPrefixesScopedList": {
- "id": "PublicDelegatedPrefixesScopedList",
- "properties": {
- "publicDelegatedPrefixes": {
- "description": "[Output Only] A list of PublicDelegatedPrefixes contained in this scope.",
- "items": {
- "$ref": "PublicDelegatedPrefix"
- },
- "type": "array"
},
"warning": {
- "description": "[Output Only] Informational warning which replaces the list of public delegated prefixes when the list is empty.",
+ "description": "[Output Only] Informational warning message.",
"properties": {
"code": {
"description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.",
@@ -62130,516 +66387,237 @@
},
"type": "object"
},
- "Quota": {
- "description": "A quotas entry.",
- "id": "Quota",
- "properties": {
- "limit": {
- "description": "[Output Only] Quota limit for this metric.",
- "format": "double",
- "type": "number"
- },
- "metric": {
- "description": "[Output Only] Name of the quota metric.",
- "enum": [
- "A2_CPUS",
- "AFFINITY_GROUPS",
- "AUTOSCALERS",
- "BACKEND_BUCKETS",
- "BACKEND_SERVICES",
- "C2D_CPUS",
- "C2_CPUS",
- "C3_CPUS",
- "COMMITMENTS",
- "COMMITTED_A2_CPUS",
- "COMMITTED_C2D_CPUS",
- "COMMITTED_C2_CPUS",
- "COMMITTED_C3_CPUS",
- "COMMITTED_CPUS",
- "COMMITTED_E2_CPUS",
- "COMMITTED_LICENSES",
- "COMMITTED_LOCAL_SSD_TOTAL_GB",
- "COMMITTED_M3_CPUS",
- "COMMITTED_MEMORY_OPTIMIZED_CPUS",
- "COMMITTED_N2A_CPUS",
- "COMMITTED_N2D_CPUS",
- "COMMITTED_N2_CPUS",
- "COMMITTED_NVIDIA_A100_80GB_GPUS",
- "COMMITTED_NVIDIA_A100_GPUS",
- "COMMITTED_NVIDIA_H100_GPUS",
- "COMMITTED_NVIDIA_K80_GPUS",
- "COMMITTED_NVIDIA_L4_GPUS",
- "COMMITTED_NVIDIA_P100_GPUS",
- "COMMITTED_NVIDIA_P4_GPUS",
- "COMMITTED_NVIDIA_T4_GPUS",
- "COMMITTED_NVIDIA_V100_GPUS",
- "COMMITTED_T2A_CPUS",
- "COMMITTED_T2D_CPUS",
- "CPUS",
- "CPUS_ALL_REGIONS",
- "DISKS_TOTAL_GB",
- "E2_CPUS",
- "EXTERNAL_MANAGED_FORWARDING_RULES",
- "EXTERNAL_NETWORK_LB_FORWARDING_RULES",
- "EXTERNAL_PROTOCOL_FORWARDING_RULES",
- "EXTERNAL_VPN_GATEWAYS",
- "FIREWALLS",
- "FORWARDING_RULES",
- "GLOBAL_EXTERNAL_MANAGED_BACKEND_SERVICES",
- "GLOBAL_EXTERNAL_MANAGED_FORWARDING_RULES",
- "GLOBAL_EXTERNAL_PROXY_LB_BACKEND_SERVICES",
- "GLOBAL_INTERNAL_ADDRESSES",
- "GLOBAL_INTERNAL_MANAGED_BACKEND_SERVICES",
- "GLOBAL_INTERNAL_TRAFFIC_DIRECTOR_BACKEND_SERVICES",
- "GPUS_ALL_REGIONS",
- "HEALTH_CHECKS",
- "IMAGES",
- "INSTANCES",
- "INSTANCE_GROUPS",
- "INSTANCE_GROUP_MANAGERS",
- "INSTANCE_TEMPLATES",
- "INTERCONNECTS",
- "INTERCONNECT_ATTACHMENTS_PER_REGION",
- "INTERCONNECT_ATTACHMENTS_TOTAL_MBPS",
- "INTERCONNECT_TOTAL_GBPS",
- "INTERNAL_ADDRESSES",
- "INTERNAL_TRAFFIC_DIRECTOR_FORWARDING_RULES",
- "IN_PLACE_SNAPSHOTS",
- "IN_USE_ADDRESSES",
- "IN_USE_BACKUP_SCHEDULES",
- "IN_USE_SNAPSHOT_SCHEDULES",
- "LOCAL_SSD_TOTAL_GB",
- "M1_CPUS",
- "M2_CPUS",
- "M3_CPUS",
- "MACHINE_IMAGES",
- "N2A_CPUS",
- "N2D_CPUS",
- "N2_CPUS",
- "NETWORKS",
- "NETWORK_ATTACHMENTS",
- "NETWORK_ENDPOINT_GROUPS",
- "NETWORK_FIREWALL_POLICIES",
- "NET_LB_SECURITY_POLICIES_PER_REGION",
- "NET_LB_SECURITY_POLICY_RULES_PER_REGION",
- "NET_LB_SECURITY_POLICY_RULE_ATTRIBUTES_PER_REGION",
- "NODE_GROUPS",
- "NODE_TEMPLATES",
- "NVIDIA_A100_80GB_GPUS",
- "NVIDIA_A100_GPUS",
- "NVIDIA_K80_GPUS",
- "NVIDIA_L4_GPUS",
- "NVIDIA_P100_GPUS",
- "NVIDIA_P100_VWS_GPUS",
- "NVIDIA_P4_GPUS",
- "NVIDIA_P4_VWS_GPUS",
- "NVIDIA_T4_GPUS",
- "NVIDIA_T4_VWS_GPUS",
- "NVIDIA_V100_GPUS",
- "PACKET_MIRRORINGS",
- "PD_EXTREME_TOTAL_PROVISIONED_IOPS",
- "PREEMPTIBLE_CPUS",
- "PREEMPTIBLE_LOCAL_SSD_GB",
- "PREEMPTIBLE_NVIDIA_A100_80GB_GPUS",
- "PREEMPTIBLE_NVIDIA_A100_GPUS",
- "PREEMPTIBLE_NVIDIA_H100_GPUS",
- "PREEMPTIBLE_NVIDIA_K80_GPUS",
- "PREEMPTIBLE_NVIDIA_L4_GPUS",
- "PREEMPTIBLE_NVIDIA_P100_GPUS",
- "PREEMPTIBLE_NVIDIA_P100_VWS_GPUS",
- "PREEMPTIBLE_NVIDIA_P4_GPUS",
- "PREEMPTIBLE_NVIDIA_P4_VWS_GPUS",
- "PREEMPTIBLE_NVIDIA_T4_GPUS",
- "PREEMPTIBLE_NVIDIA_T4_VWS_GPUS",
- "PREEMPTIBLE_NVIDIA_V100_GPUS",
- "PREEMPTIBLE_TPU_LITE_DEVICE_V5",
- "PREEMPTIBLE_TPU_LITE_PODSLICE_V5",
- "PREEMPTIBLE_TPU_PODSLICE_V4",
- "PSC_ILB_CONSUMER_FORWARDING_RULES_PER_PRODUCER_NETWORK",
- "PSC_INTERNAL_LB_FORWARDING_RULES",
- "PUBLIC_ADVERTISED_PREFIXES",
- "PUBLIC_DELEGATED_PREFIXES",
- "REGIONAL_AUTOSCALERS",
- "REGIONAL_EXTERNAL_MANAGED_BACKEND_SERVICES",
- "REGIONAL_EXTERNAL_NETWORK_LB_BACKEND_SERVICES",
- "REGIONAL_INSTANCE_GROUP_MANAGERS",
- "REGIONAL_INTERNAL_LB_BACKEND_SERVICES",
- "REGIONAL_INTERNAL_MANAGED_BACKEND_SERVICES",
- "RESERVATIONS",
- "RESOURCE_POLICIES",
- "ROUTERS",
- "ROUTES",
- "SECURITY_POLICIES",
- "SECURITY_POLICIES_PER_REGION",
- "SECURITY_POLICY_ADVANCED_RULES_PER_REGION",
- "SECURITY_POLICY_CEVAL_RULES",
- "SECURITY_POLICY_RULES",
- "SECURITY_POLICY_RULES_PER_REGION",
- "SERVICE_ATTACHMENTS",
- "SNAPSHOTS",
- "SSD_TOTAL_GB",
- "SSL_CERTIFICATES",
- "STATIC_ADDRESSES",
- "STATIC_BYOIP_ADDRESSES",
- "STATIC_EXTERNAL_IPV6_ADDRESS_RANGES",
- "SUBNETWORKS",
- "T2A_CPUS",
- "T2D_CPUS",
- "TARGET_HTTPS_PROXIES",
- "TARGET_HTTP_PROXIES",
- "TARGET_INSTANCES",
- "TARGET_POOLS",
- "TARGET_SSL_PROXIES",
- "TARGET_TCP_PROXIES",
- "TARGET_VPN_GATEWAYS",
- "TPU_LITE_DEVICE_V5",
- "TPU_LITE_PODSLICE_V5",
- "TPU_PODSLICE_V4",
- "URL_MAPS",
- "VPN_GATEWAYS",
- "VPN_TUNNELS",
- "XPN_SERVICE_PROJECTS"
- ],
- "enumDescriptions": [
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "Guest CPUs",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "The total number of snapshots allowed for a single project.",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- ""
- ],
- "type": "string"
- },
- "owner": {
- "description": "[Output Only] Owning resource. This is the resource on which this quota is applied.",
- "type": "string"
- },
- "usage": {
- "description": "[Output Only] Current usage of this metric.",
- "format": "double",
- "type": "number"
- }
- },
- "type": "object"
- },
- "QuotaExceededInfo": {
- "description": "Additional details for quota exceeded error for resource quota.",
- "id": "QuotaExceededInfo",
+ "RegionDisksAddResourcePoliciesRequest": {
+ "id": "RegionDisksAddResourcePoliciesRequest",
"properties": {
- "dimensions": {
- "additionalProperties": {
+ "resourcePolicies": {
+ "description": "Resource policies to be added to this disk.",
+ "items": {
"type": "string"
},
- "description": "The map holding related quota dimensions.",
- "type": "object"
- },
- "futureLimit": {
- "description": "Future quota limit being rolled out. The limit's unit depends on the quota type or metric.",
- "format": "double",
- "type": "number"
- },
- "limit": {
- "description": "Current effective quota limit. The limit's unit depends on the quota type or metric.",
- "format": "double",
- "type": "number"
- },
- "limitName": {
- "description": "The name of the quota limit.",
- "type": "string"
- },
- "metricName": {
- "description": "The Compute Engine quota metric name.",
- "type": "string"
- },
- "rolloutStatus": {
- "description": "Rollout status of the future quota limit.",
- "enum": [
- "IN_PROGRESS",
- "ROLLOUT_STATUS_UNSPECIFIED"
- ],
- "enumDescriptions": [
- "IN_PROGRESS - A rollout is in process which will change the limit value to future limit.",
- "ROLLOUT_STATUS_UNSPECIFIED - Rollout status is not specified. The default value."
- ],
- "type": "string"
+ "type": "array"
}
},
"type": "object"
},
- "Reference": {
- "description": "Represents a reference to a resource.",
- "id": "Reference",
+ "RegionDisksRemoveResourcePoliciesRequest": {
+ "id": "RegionDisksRemoveResourcePoliciesRequest",
"properties": {
- "kind": {
- "default": "compute#reference",
- "description": "[Output Only] Type of the resource. Always compute#reference for references.",
- "type": "string"
- },
- "referenceType": {
- "description": "A description of the reference type with no implied semantics. Possible values include: 1. MEMBER_OF ",
- "type": "string"
- },
- "referrer": {
- "description": "URL of the resource which refers to the target.",
- "type": "string"
- },
- "target": {
- "description": "URL of the resource to which this reference points.",
- "type": "string"
+ "resourcePolicies": {
+ "description": "Resource policies to be removed from this disk.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
}
},
"type": "object"
},
- "Region": {
- "description": "Represents a Region resource. A region is a geographical area where a resource is located. For more information, read Regions and Zones.",
- "id": "Region",
+ "RegionDisksResizeRequest": {
+ "id": "RegionDisksResizeRequest",
"properties": {
- "creationTimestamp": {
- "description": "[Output Only] Creation timestamp in RFC3339 text format.",
+ "sizeGb": {
+ "description": "The new size of the regional persistent disk, which is specified in GB.",
+ "format": "int64",
"type": "string"
- },
- "deprecated": {
- "$ref": "DeprecationStatus",
- "description": "[Output Only] The deprecation status associated with this region."
- },
- "description": {
- "description": "[Output Only] Textual description of the resource.",
+ }
+ },
+ "type": "object"
+ },
+ "RegionDisksStartAsyncReplicationRequest": {
+ "id": "RegionDisksStartAsyncReplicationRequest",
+ "properties": {
+ "asyncSecondaryDisk": {
+ "description": "The secondary disk to start asynchronous replication to. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - https://www.googleapis.com/compute/v1/projects/project/regions/region /disks/disk - projects/project/zones/zone/disks/disk - projects/project/regions/region/disks/disk - zones/zone/disks/disk - regions/region/disks/disk ",
"type": "string"
- },
+ }
+ },
+ "type": "object"
+ },
+ "RegionInstanceGroupList": {
+ "description": "Contains a list of InstanceGroup resources.",
+ "id": "RegionInstanceGroupList",
+ "properties": {
"id": {
- "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.",
- "format": "uint64",
- "type": "string"
- },
- "kind": {
- "default": "compute#region",
- "description": "[Output Only] Type of the resource. Always compute#region for regions.",
- "type": "string"
- },
- "name": {
- "description": "[Output Only] Name of the resource.",
+ "description": "[Output Only] Unique identifier for the resource; defined by the server.",
"type": "string"
},
- "quotas": {
- "description": "[Output Only] Quotas assigned to this region.",
+ "items": {
+ "description": "A list of InstanceGroup resources.",
"items": {
- "$ref": "Quota"
+ "$ref": "InstanceGroup"
},
"type": "array"
},
- "selfLink": {
- "description": "[Output Only] Server-defined URL for the resource.",
+ "kind": {
+ "default": "compute#regionInstanceGroupList",
+ "description": "The resource type.",
"type": "string"
},
- "status": {
- "description": "[Output Only] Status of the region, either UP or DOWN.",
- "enum": [
- "DOWN",
- "UP"
- ],
- "enumDescriptions": [
- "",
- ""
- ],
+ "nextPageToken": {
+ "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
"type": "string"
},
- "supportsPzs": {
- "description": "[Output Only] Reserved for future use.",
- "type": "boolean"
+ "selfLink": {
+ "description": "[Output Only] Server-defined URL for this resource.",
+ "type": "string"
},
- "zones": {
- "description": "[Output Only] A list of zones available in this region, in the form of resource URLs.",
- "items": {
- "type": "string"
+ "warning": {
+ "description": "[Output Only] Informational warning message.",
+ "properties": {
+ "code": {
+ "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.",
+ "enum": [
+ "CLEANUP_FAILED",
+ "DEPRECATED_RESOURCE_USED",
+ "DEPRECATED_TYPE_USED",
+ "DISK_SIZE_LARGER_THAN_IMAGE_SIZE",
+ "EXPERIMENTAL_TYPE_USED",
+ "EXTERNAL_API_WARNING",
+ "FIELD_VALUE_OVERRIDEN",
+ "INJECTED_KERNELS_DEPRECATED",
+ "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB",
+ "LARGE_DEPLOYMENT_WARNING",
+ "LIST_OVERHEAD_QUOTA_EXCEED",
+ "MISSING_TYPE_DEPENDENCY",
+ "NEXT_HOP_ADDRESS_NOT_ASSIGNED",
+ "NEXT_HOP_CANNOT_IP_FORWARD",
+ "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE",
+ "NEXT_HOP_INSTANCE_NOT_FOUND",
+ "NEXT_HOP_INSTANCE_NOT_ON_NETWORK",
+ "NEXT_HOP_NOT_RUNNING",
+ "NOT_CRITICAL_ERROR",
+ "NO_RESULTS_ON_PAGE",
+ "PARTIAL_SUCCESS",
+ "REQUIRED_TOS_AGREEMENT",
+ "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING",
+ "RESOURCE_NOT_DELETED",
+ "SCHEMA_VALIDATION_IGNORED",
+ "SINGLE_INSTANCE_PROPERTY_TEMPLATE",
+ "UNDECLARED_PROPERTIES",
+ "UNREACHABLE"
+ ],
+ "enumDeprecated": [
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ true,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false
+ ],
+ "enumDescriptions": [
+ "Warning about failed cleanup of transient changes made by a failed operation.",
+ "A link to a deprecated resource was created.",
+ "When deploying and at least one of the resources has a type marked as deprecated",
+ "The user created a boot disk that is larger than image size.",
+ "When deploying and at least one of the resources has a type marked as experimental",
+ "Warning that is present in an external api call",
+ "Warning that value of a field has been overridden. Deprecated unused field.",
+ "The operation involved use of an injected kernel, which is deprecated.",
+ "A WEIGHTED_MAGLEV backend service is associated with a health check that is not of type HTTP/HTTPS/HTTP2.",
+ "When deploying a deployment with a exceedingly large number of resources",
+ "Resource can't be retrieved due to list overhead quota exceed which captures the amount of resources filtered out by user-defined list filter.",
+ "A resource depends on a missing type",
+ "The route's nextHopIp address is not assigned to an instance on the network.",
+ "The route's next hop instance cannot ip forward.",
+ "The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route.",
+ "The route's nextHopInstance URL refers to an instance that does not exist.",
+ "The route's nextHopInstance URL refers to an instance that is not on the same network as the route.",
+ "The route's next hop instance does not have a status of RUNNING.",
+ "Error which is not critical. We decided to continue the process despite the mentioned error.",
+ "No results are present on a particular list page.",
+ "Success is reported, but some results may be missing due to errors",
+ "The user attempted to use a resource that requires a TOS they have not accepted.",
+ "Warning that a resource is in use.",
+ "One or more of the resources set to auto-delete could not be deleted because they were in use.",
+ "When a resource schema validation is ignored.",
+ "Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group.",
+ "When undeclared properties in the schema are present",
+ "A given scope cannot be reached."
+ ],
+ "type": "string"
+ },
+ "data": {
+ "description": "[Output Only] Metadata about this warning in key: value format. For example: \"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" } ",
+ "items": {
+ "properties": {
+ "key": {
+ "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).",
+ "type": "string"
+ },
+ "value": {
+ "description": "[Output Only] A warning data value corresponding to the key.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "type": "array"
+ },
+ "message": {
+ "description": "[Output Only] A human-readable description of the warning code.",
+ "type": "string"
+ }
},
- "type": "array"
+ "type": "object"
}
},
"type": "object"
},
- "RegionAddressesMoveRequest": {
- "id": "RegionAddressesMoveRequest",
+ "RegionInstanceGroupManagerDeleteInstanceConfigReq": {
+ "description": "RegionInstanceGroupManagers.deletePerInstanceConfigs",
+ "id": "RegionInstanceGroupManagerDeleteInstanceConfigReq",
"properties": {
- "description": {
- "description": "An optional destination address description if intended to be different from the source.",
- "type": "string"
- },
- "destinationAddress": {
- "description": "The URL of the destination address to move to. This can be a full or partial URL. For example, the following are all valid URLs to a address: - https://www.googleapis.com/compute/v1/projects/project/regions/region /addresses/address - projects/project/regions/region/addresses/address Note that destination project must be different from the source project. So /regions/region/addresses/address is not valid partial url.",
- "type": "string"
+ "names": {
+ "description": "The list of instance names for which we want to delete per-instance configs on this managed instance group.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
}
},
"type": "object"
},
- "RegionAutoscalerList": {
- "description": "Contains a list of autoscalers.",
- "id": "RegionAutoscalerList",
+ "RegionInstanceGroupManagerList": {
+ "description": "Contains a list of managed instance groups.",
+ "id": "RegionInstanceGroupManagerList",
"properties": {
"id": {
"description": "[Output Only] Unique identifier for the resource; defined by the server.",
"type": "string"
},
"items": {
- "description": "A list of Autoscaler resources.",
+ "description": "A list of InstanceGroupManager resources.",
"items": {
- "$ref": "Autoscaler"
+ "$ref": "InstanceGroupManager"
},
"type": "array"
},
"kind": {
- "default": "compute#regionAutoscalerList",
- "description": "Type of resource.",
+ "default": "compute#regionInstanceGroupManagerList",
+ "description": "[Output Only] The resource type, which is always compute#instanceGroupManagerList for a list of managed instance groups that exist in th regional scope.",
"type": "string"
},
"nextPageToken": {
@@ -62774,31 +66752,157 @@
},
"type": "object"
},
- "RegionDiskTypeList": {
- "id": "RegionDiskTypeList",
+ "RegionInstanceGroupManagerPatchInstanceConfigReq": {
+ "description": "RegionInstanceGroupManagers.patchPerInstanceConfigs",
+ "id": "RegionInstanceGroupManagerPatchInstanceConfigReq",
"properties": {
- "id": {
- "description": "[Output Only] Unique identifier for the resource; defined by the server.",
- "type": "string"
+ "perInstanceConfigs": {
+ "description": "The list of per-instance configurations to insert or patch on this managed instance group.",
+ "items": {
+ "$ref": "PerInstanceConfig"
+ },
+ "type": "array"
+ }
+ },
+ "type": "object"
+ },
+ "RegionInstanceGroupManagerUpdateInstanceConfigReq": {
+ "description": "RegionInstanceGroupManagers.updatePerInstanceConfigs",
+ "id": "RegionInstanceGroupManagerUpdateInstanceConfigReq",
+ "properties": {
+ "perInstanceConfigs": {
+ "description": "The list of per-instance configurations to insert or patch on this managed instance group.",
+ "items": {
+ "$ref": "PerInstanceConfig"
+ },
+ "type": "array"
+ }
+ },
+ "type": "object"
+ },
+ "RegionInstanceGroupManagersAbandonInstancesRequest": {
+ "id": "RegionInstanceGroupManagersAbandonInstancesRequest",
+ "properties": {
+ "instances": {
+ "description": "The URLs of one or more instances to abandon. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME].",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ }
+ },
+ "type": "object"
+ },
+ "RegionInstanceGroupManagersApplyUpdatesRequest": {
+ "description": "RegionInstanceGroupManagers.applyUpdatesToInstances",
+ "id": "RegionInstanceGroupManagersApplyUpdatesRequest",
+ "properties": {
+ "allInstances": {
+ "description": "Flag to update all instances instead of specified list of “instances”. If the flag is set to true then the instances may not be specified in the request.",
+ "type": "boolean"
},
- "items": {
- "description": "A list of DiskType resources.",
+ "instances": {
+ "description": "The list of URLs of one or more instances for which you want to apply updates. Each URL can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME].",
"items": {
- "$ref": "DiskType"
+ "type": "string"
},
"type": "array"
},
- "kind": {
- "default": "compute#regionDiskTypeList",
- "description": "[Output Only] Type of resource. Always compute#regionDiskTypeList for region disk types.",
+ "minimalAction": {
+ "description": "The minimal action that you want to perform on each instance during the update: - REPLACE: At minimum, delete the instance and create it again. - RESTART: Stop the instance and start it again. - REFRESH: Do not stop the instance and limit disruption as much as possible. - NONE: Do not disrupt the instance at all. By default, the minimum action is NONE. If your update requires a more disruptive action than you set with this flag, the necessary action is performed to execute the update.",
+ "enum": [
+ "NONE",
+ "REFRESH",
+ "REPLACE",
+ "RESTART"
+ ],
+ "enumDescriptions": [
+ "Do not perform any action.",
+ "Do not stop the instance.",
+ "(Default.) Replace the instance according to the replacement method option.",
+ "Stop the instance and start it again."
+ ],
+ "type": "string"
+ },
+ "mostDisruptiveAllowedAction": {
+ "description": "The most disruptive action that you want to perform on each instance during the update: - REPLACE: Delete the instance and create it again. - RESTART: Stop the instance and start it again. - REFRESH: Do not stop the instance and limit disruption as much as possible. - NONE: Do not disrupt the instance at all. By default, the most disruptive allowed action is REPLACE. If your update requires a more disruptive action than you set with this flag, the update request will fail.",
+ "enum": [
+ "NONE",
+ "REFRESH",
+ "REPLACE",
+ "RESTART"
+ ],
+ "enumDescriptions": [
+ "Do not perform any action.",
+ "Do not stop the instance.",
+ "(Default.) Replace the instance according to the replacement method option.",
+ "Stop the instance and start it again."
+ ],
"type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "RegionInstanceGroupManagersCreateInstancesRequest": {
+ "description": "RegionInstanceGroupManagers.createInstances",
+ "id": "RegionInstanceGroupManagersCreateInstancesRequest",
+ "properties": {
+ "instances": {
+ "description": "[Required] List of specifications of per-instance configs.",
+ "items": {
+ "$ref": "PerInstanceConfig"
+ },
+ "type": "array"
+ }
+ },
+ "type": "object"
+ },
+ "RegionInstanceGroupManagersDeleteInstancesRequest": {
+ "id": "RegionInstanceGroupManagersDeleteInstancesRequest",
+ "properties": {
+ "instances": {
+ "description": "The URLs of one or more instances to delete. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME].",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "skipInstancesOnValidationError": {
+ "description": "Specifies whether the request should proceed despite the inclusion of instances that are not members of the group or that are already in the process of being deleted or abandoned. If this field is set to `false` and such an instance is specified in the request, the operation fails. The operation always fails if the request contains a malformed instance URL or a reference to an instance that exists in a zone or region other than the group's zone or region.",
+ "type": "boolean"
+ }
+ },
+ "type": "object"
+ },
+ "RegionInstanceGroupManagersListErrorsResponse": {
+ "id": "RegionInstanceGroupManagersListErrorsResponse",
+ "properties": {
+ "items": {
+ "description": "[Output Only] The list of errors of the managed instance group.",
+ "items": {
+ "$ref": "InstanceManagedByIgmError"
+ },
+ "type": "array"
},
"nextPageToken": {
"description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
"type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "RegionInstanceGroupManagersListInstanceConfigsResp": {
+ "id": "RegionInstanceGroupManagersListInstanceConfigsResp",
+ "properties": {
+ "items": {
+ "description": "[Output Only] The list of PerInstanceConfig.",
+ "items": {
+ "$ref": "PerInstanceConfig"
+ },
+ "type": "array"
},
- "selfLink": {
- "description": "[Output Only] Server-defined URL for this resource.",
+ "nextPageToken": {
+ "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
"type": "string"
},
"warning": {
@@ -62925,24 +67029,28 @@
},
"type": "object"
},
- "RegionDisksAddResourcePoliciesRequest": {
- "id": "RegionDisksAddResourcePoliciesRequest",
+ "RegionInstanceGroupManagersListInstancesResponse": {
+ "id": "RegionInstanceGroupManagersListInstancesResponse",
"properties": {
- "resourcePolicies": {
- "description": "Resource policies to be added to this disk.",
+ "managedInstances": {
+ "description": "A list of managed instances.",
"items": {
- "type": "string"
+ "$ref": "ManagedInstance"
},
"type": "array"
+ },
+ "nextPageToken": {
+ "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
+ "type": "string"
}
},
"type": "object"
},
- "RegionDisksRemoveResourcePoliciesRequest": {
- "id": "RegionDisksRemoveResourcePoliciesRequest",
+ "RegionInstanceGroupManagersRecreateRequest": {
+ "id": "RegionInstanceGroupManagersRecreateRequest",
"properties": {
- "resourcePolicies": {
- "description": "Resource policies to be removed from this disk.",
+ "instances": {
+ "description": "The URLs of one or more instances to recreate. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME].",
"items": {
"type": "string"
},
@@ -62951,44 +67059,50 @@
},
"type": "object"
},
- "RegionDisksResizeRequest": {
- "id": "RegionDisksResizeRequest",
+ "RegionInstanceGroupManagersSetTargetPoolsRequest": {
+ "id": "RegionInstanceGroupManagersSetTargetPoolsRequest",
"properties": {
- "sizeGb": {
- "description": "The new size of the regional persistent disk, which is specified in GB.",
- "format": "int64",
+ "fingerprint": {
+ "description": "Fingerprint of the target pools information, which is a hash of the contents. This field is used for optimistic locking when you update the target pool entries. This field is optional.",
+ "format": "byte",
"type": "string"
+ },
+ "targetPools": {
+ "description": "The URL of all TargetPool resources to which instances in the instanceGroup field are added. The target pools automatically apply to all of the instances in the managed instance group.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
}
},
"type": "object"
},
- "RegionDisksStartAsyncReplicationRequest": {
- "id": "RegionDisksStartAsyncReplicationRequest",
+ "RegionInstanceGroupManagersSetTemplateRequest": {
+ "id": "RegionInstanceGroupManagersSetTemplateRequest",
"properties": {
- "asyncSecondaryDisk": {
- "description": "The secondary disk to start asynchronous replication to. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - https://www.googleapis.com/compute/v1/projects/project/regions/region /disks/disk - projects/project/zones/zone/disks/disk - projects/project/regions/region/disks/disk - zones/zone/disks/disk - regions/region/disks/disk ",
+ "instanceTemplate": {
+ "description": "URL of the InstanceTemplate resource from which all new instances will be created.",
"type": "string"
}
},
"type": "object"
},
- "RegionInstanceGroupList": {
- "description": "Contains a list of InstanceGroup resources.",
- "id": "RegionInstanceGroupList",
+ "RegionInstanceGroupsListInstances": {
+ "id": "RegionInstanceGroupsListInstances",
"properties": {
"id": {
"description": "[Output Only] Unique identifier for the resource; defined by the server.",
"type": "string"
},
"items": {
- "description": "A list of InstanceGroup resources.",
+ "description": "A list of InstanceWithNamedPorts resources.",
"items": {
- "$ref": "InstanceGroup"
+ "$ref": "InstanceWithNamedPorts"
},
"type": "array"
},
"kind": {
- "default": "compute#regionInstanceGroupList",
+ "default": "compute#regionInstanceGroupsListInstances",
"description": "The resource type.",
"type": "string"
},
@@ -63124,38 +67238,65 @@
},
"type": "object"
},
- "RegionInstanceGroupManagerDeleteInstanceConfigReq": {
- "description": "RegionInstanceGroupManagers.deletePerInstanceConfigs",
- "id": "RegionInstanceGroupManagerDeleteInstanceConfigReq",
+ "RegionInstanceGroupsListInstancesRequest": {
+ "id": "RegionInstanceGroupsListInstancesRequest",
"properties": {
- "names": {
- "description": "The list of instance names for which we want to delete per-instance configs on this managed instance group.",
+ "instanceState": {
+ "description": "Instances in which state should be returned. Valid options are: 'ALL', 'RUNNING'. By default, it lists all instances.",
+ "enum": [
+ "ALL",
+ "RUNNING"
+ ],
+ "enumDescriptions": [
+ "Matches any status of the instances, running, non-running and others.",
+ "Instance is in RUNNING state if it is running."
+ ],
+ "type": "string"
+ },
+ "portName": {
+ "description": "Name of port user is interested in. It is optional. If it is set, only information about this ports will be returned. If it is not set, all the named ports will be returned. Always lists all instances.",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "RegionInstanceGroupsSetNamedPortsRequest": {
+ "id": "RegionInstanceGroupsSetNamedPortsRequest",
+ "properties": {
+ "fingerprint": {
+ "description": "The fingerprint of the named ports information for this instance group. Use this optional property to prevent conflicts when multiple users change the named ports settings concurrently. Obtain the fingerprint with the instanceGroups.get method. Then, include the fingerprint in your request to ensure that you do not overwrite changes that were applied from another concurrent request.",
+ "format": "byte",
+ "type": "string"
+ },
+ "namedPorts": {
+ "description": "The list of named ports to set for this instance group.",
"items": {
- "type": "string"
+ "$ref": "NamedPort"
},
"type": "array"
}
},
"type": "object"
},
- "RegionInstanceGroupManagerList": {
- "description": "Contains a list of managed instance groups.",
- "id": "RegionInstanceGroupManagerList",
+ "RegionList": {
+ "description": "Contains a list of region resources.",
+ "id": "RegionList",
"properties": {
"id": {
"description": "[Output Only] Unique identifier for the resource; defined by the server.",
"type": "string"
},
"items": {
- "description": "A list of InstanceGroupManager resources.",
+ "description": "A list of Region resources.",
"items": {
- "$ref": "InstanceGroupManager"
+ "$ref": "Region"
},
"type": "array"
},
"kind": {
- "default": "compute#regionInstanceGroupManagerList",
- "description": "[Output Only] The resource type, which is always compute#instanceGroupManagerList for a list of managed instance groups that exist in th regional scope.",
+ "default": "compute#regionList",
+ "description": "[Output Only] Type of resource. Always compute#regionList for lists of regions.",
"type": "string"
},
"nextPageToken": {
@@ -63290,159 +67431,329 @@
},
"type": "object"
},
- "RegionInstanceGroupManagerPatchInstanceConfigReq": {
- "description": "RegionInstanceGroupManagers.patchPerInstanceConfigs",
- "id": "RegionInstanceGroupManagerPatchInstanceConfigReq",
+ "RegionNetworkEndpointGroupsAttachEndpointsRequest": {
+ "id": "RegionNetworkEndpointGroupsAttachEndpointsRequest",
"properties": {
- "perInstanceConfigs": {
- "description": "The list of per-instance configurations to insert or patch on this managed instance group.",
+ "networkEndpoints": {
+ "description": "The list of network endpoints to be attached.",
"items": {
- "$ref": "PerInstanceConfig"
+ "$ref": "NetworkEndpoint"
},
"type": "array"
}
},
"type": "object"
},
- "RegionInstanceGroupManagerUpdateInstanceConfigReq": {
- "description": "RegionInstanceGroupManagers.updatePerInstanceConfigs",
- "id": "RegionInstanceGroupManagerUpdateInstanceConfigReq",
+ "RegionNetworkEndpointGroupsDetachEndpointsRequest": {
+ "id": "RegionNetworkEndpointGroupsDetachEndpointsRequest",
"properties": {
- "perInstanceConfigs": {
- "description": "The list of per-instance configurations to insert or patch on this managed instance group.",
+ "networkEndpoints": {
+ "description": "The list of network endpoints to be detached.",
"items": {
- "$ref": "PerInstanceConfig"
+ "$ref": "NetworkEndpoint"
},
"type": "array"
}
},
"type": "object"
},
- "RegionInstanceGroupManagersAbandonInstancesRequest": {
- "id": "RegionInstanceGroupManagersAbandonInstancesRequest",
+ "RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponse": {
+ "id": "RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponse",
"properties": {
- "instances": {
- "description": "The URLs of one or more instances to abandon. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME].",
+ "firewallPolicys": {
+ "description": "[Output only] Effective firewalls from firewall policy. It applies to Regional Network Firewall Policies in the specified region, Global Network Firewall Policies and Hierachial Firewall Policies which are associated with the network.",
"items": {
- "type": "string"
+ "$ref": "RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy"
+ },
+ "type": "array"
+ },
+ "firewalls": {
+ "description": "Effective firewalls on the network.",
+ "items": {
+ "$ref": "Firewall"
},
"type": "array"
}
},
"type": "object"
},
- "RegionInstanceGroupManagersApplyUpdatesRequest": {
- "description": "RegionInstanceGroupManagers.applyUpdatesToInstances",
- "id": "RegionInstanceGroupManagersApplyUpdatesRequest",
+ "RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy": {
+ "id": "RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy",
"properties": {
- "allInstances": {
- "description": "Flag to update all instances instead of specified list of “instances”. If the flag is set to true then the instances may not be specified in the request.",
- "type": "boolean"
+ "displayName": {
+ "description": "[Output Only] The display name of the firewall policy.",
+ "type": "string"
},
- "instances": {
- "description": "The list of URLs of one or more instances for which you want to apply updates. Each URL can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME].",
+ "name": {
+ "description": "[Output Only] The name of the firewall policy.",
+ "type": "string"
+ },
+ "rules": {
+ "description": "[Output only] The rules that apply to the network.",
"items": {
- "type": "string"
+ "$ref": "FirewallPolicyRule"
},
"type": "array"
},
- "minimalAction": {
- "description": "The minimal action that you want to perform on each instance during the update: - REPLACE: At minimum, delete the instance and create it again. - RESTART: Stop the instance and start it again. - REFRESH: Do not stop the instance and limit disruption as much as possible. - NONE: Do not disrupt the instance at all. By default, the minimum action is NONE. If your update requires a more disruptive action than you set with this flag, the necessary action is performed to execute the update.",
+ "type": {
+ "description": "[Output Only] The type of the firewall policy. Can be one of HIERARCHY, NETWORK, NETWORK_REGIONAL, SYSTEM_GLOBAL, SYSTEM_REGIONAL.",
"enum": [
- "NONE",
- "REFRESH",
- "REPLACE",
- "RESTART"
+ "HIERARCHY",
+ "NETWORK",
+ "NETWORK_REGIONAL",
+ "UNSPECIFIED"
],
"enumDescriptions": [
- "Do not perform any action.",
- "Do not stop the instance.",
- "(Default.) Replace the instance according to the replacement method option.",
- "Stop the instance and start it again."
+ "",
+ "",
+ "",
+ ""
],
"type": "string"
- },
- "mostDisruptiveAllowedAction": {
- "description": "The most disruptive action that you want to perform on each instance during the update: - REPLACE: Delete the instance and create it again. - RESTART: Stop the instance and start it again. - REFRESH: Do not stop the instance and limit disruption as much as possible. - NONE: Do not disrupt the instance at all. By default, the most disruptive allowed action is REPLACE. If your update requires a more disruptive action than you set with this flag, the update request will fail.",
- "enum": [
- "NONE",
- "REFRESH",
- "REPLACE",
- "RESTART"
- ],
- "enumDescriptions": [
- "Do not perform any action.",
- "Do not stop the instance.",
- "(Default.) Replace the instance according to the replacement method option.",
- "Stop the instance and start it again."
- ],
+ }
+ },
+ "type": "object"
+ },
+ "RegionSetLabelsRequest": {
+ "id": "RegionSetLabelsRequest",
+ "properties": {
+ "labelFingerprint": {
+ "description": "The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels. Make a get() request to the resource to get the latest fingerprint.",
+ "format": "byte",
"type": "string"
+ },
+ "labels": {
+ "additionalProperties": {
+ "type": "string"
+ },
+ "description": "The labels to set for this resource.",
+ "type": "object"
}
},
"type": "object"
},
- "RegionInstanceGroupManagersCreateInstancesRequest": {
- "description": "RegionInstanceGroupManagers.createInstances",
- "id": "RegionInstanceGroupManagersCreateInstancesRequest",
+ "RegionSetPolicyRequest": {
+ "id": "RegionSetPolicyRequest",
"properties": {
- "instances": {
- "description": "[Required] List of specifications of per-instance configs.",
+ "bindings": {
+ "description": "Flatten Policy to create a backwacd compatible wire-format. Deprecated. Use 'policy' to specify bindings.",
"items": {
- "$ref": "PerInstanceConfig"
+ "$ref": "Binding"
},
"type": "array"
+ },
+ "etag": {
+ "description": "Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify the etag.",
+ "format": "byte",
+ "type": "string"
+ },
+ "policy": {
+ "$ref": "Policy",
+ "description": "REQUIRED: The complete policy to be applied to the 'resource'. The size of the policy is limited to a few 10s of KB. An empty policy is in general a valid policy but certain services (like Projects) might reject them."
}
},
"type": "object"
},
- "RegionInstanceGroupManagersDeleteInstancesRequest": {
- "id": "RegionInstanceGroupManagersDeleteInstancesRequest",
+ "RegionTargetHttpsProxiesSetSslCertificatesRequest": {
+ "id": "RegionTargetHttpsProxiesSetSslCertificatesRequest",
"properties": {
- "instances": {
- "description": "The URLs of one or more instances to delete. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME].",
+ "sslCertificates": {
+ "description": "New set of SslCertificate resources to associate with this TargetHttpsProxy resource.",
"items": {
"type": "string"
},
"type": "array"
+ }
+ },
+ "type": "object"
+ },
+ "RegionUrlMapsValidateRequest": {
+ "id": "RegionUrlMapsValidateRequest",
+ "properties": {
+ "resource": {
+ "$ref": "UrlMap",
+ "description": "Content of the UrlMap to be validated."
+ }
+ },
+ "type": "object"
+ },
+ "RequestMirrorPolicy": {
+ "description": "A policy that specifies how requests intended for the route's backends are shadowed to a separate mirrored backend service. The load balancer doesn't wait for responses from the shadow service. Before sending traffic to the shadow service, the host or authority header is suffixed with -shadow.",
+ "id": "RequestMirrorPolicy",
+ "properties": {
+ "backendService": {
+ "description": "The full or partial URL to the BackendService resource being mirrored to. The backend service configured for a mirroring policy must reference backends that are of the same type as the original backend service matched in the URL map. Serverless NEG backends are not currently supported as a mirrored backend service. ",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "Reservation": {
+ "description": "Represents a reservation resource. A reservation ensures that capacity is held in a specific zone even if the reserved VMs are not running. For more information, read Reserving zonal resources.",
+ "id": "Reservation",
+ "properties": {
+ "aggregateReservation": {
+ "$ref": "AllocationAggregateReservation",
+ "description": "Reservation for aggregated resources, providing shape flexibility."
},
- "skipInstancesOnValidationError": {
- "description": "Specifies whether the request should proceed despite the inclusion of instances that are not members of the group or that are already in the process of being deleted or abandoned. If this field is set to `false` and such an instance is specified in the request, the operation fails. The operation always fails if the request contains a malformed instance URL or a reference to an instance that exists in a zone or region other than the group's zone or region.",
+ "commitment": {
+ "description": "[Output Only] Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment.",
+ "type": "string"
+ },
+ "creationTimestamp": {
+ "description": "[Output Only] Creation timestamp in RFC3339 text format.",
+ "type": "string"
+ },
+ "description": {
+ "description": "An optional description of this resource. Provide this property when you create the resource.",
+ "type": "string"
+ },
+ "id": {
+ "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.",
+ "format": "uint64",
+ "type": "string"
+ },
+ "kind": {
+ "default": "compute#reservation",
+ "description": "[Output Only] Type of the resource. Always compute#reservations for reservations.",
+ "type": "string"
+ },
+ "name": {
+ "annotations": {
+ "required": [
+ "compute.instances.insert"
+ ]
+ },
+ "description": "The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "type": "string"
+ },
+ "resourcePolicies": {
+ "additionalProperties": {
+ "type": "string"
+ },
+ "description": "Resource policies to be added to this reservation. The key is defined by user, and the value is resource policy url. This is to define placement policy with reservation.",
+ "type": "object"
+ },
+ "resourceStatus": {
+ "$ref": "AllocationResourceStatus",
+ "description": "[Output Only] Status information for Reservation resource."
+ },
+ "satisfiesPzs": {
+ "description": "[Output Only] Reserved for future use.",
+ "type": "boolean"
+ },
+ "selfLink": {
+ "description": "[Output Only] Server-defined fully-qualified URL for this resource.",
+ "type": "string"
+ },
+ "shareSettings": {
+ "$ref": "ShareSettings",
+ "description": "Specify share-settings to create a shared reservation. This property is optional. For more information about the syntax and options for this field and its subfields, see the guide for creating a shared reservation."
+ },
+ "specificReservation": {
+ "$ref": "AllocationSpecificSKUReservation",
+ "description": "Reservation for instances with specific machine shapes."
+ },
+ "specificReservationRequired": {
+ "description": "Indicates whether the reservation can be consumed by VMs with affinity for \"any\" reservation. If the field is set, then only VMs that target the reservation by name can consume from this reservation.",
"type": "boolean"
+ },
+ "status": {
+ "description": "[Output Only] The status of the reservation. - CREATING: Reservation resources are being allocated. - READY: Reservation resources have been allocated, and the reservation is ready for use. - DELETING: Reservation deletion is in progress. - UPDATING: Reservation update is in progress. ",
+ "enum": [
+ "CREATING",
+ "DELETING",
+ "INVALID",
+ "READY",
+ "UPDATING"
+ ],
+ "enumDescriptions": [
+ "Reservation resources are being allocated.",
+ "Reservation deletion is in progress.",
+ "",
+ "Reservation resources have been allocated, and the reservation is ready for use.",
+ "Reservation update is in progress."
+ ],
+ "type": "string"
+ },
+ "zone": {
+ "description": "Zone in which the reservation resides. A zone must be provided if the reservation is created within a commitment.",
+ "type": "string"
}
},
"type": "object"
},
- "RegionInstanceGroupManagersListErrorsResponse": {
- "id": "RegionInstanceGroupManagersListErrorsResponse",
+ "ReservationAffinity": {
+ "description": "Specifies the reservations that this instance can consume from.",
+ "id": "ReservationAffinity",
"properties": {
- "items": {
- "description": "[Output Only] The list of errors of the managed instance group.",
+ "consumeReservationType": {
+ "description": "Specifies the type of reservation from which this instance can consume resources: ANY_RESERVATION (default), SPECIFIC_RESERVATION, or NO_RESERVATION. See Consuming reserved instances for examples.",
+ "enum": [
+ "ANY_RESERVATION",
+ "NO_RESERVATION",
+ "SPECIFIC_RESERVATION",
+ "UNSPECIFIED"
+ ],
+ "enumDescriptions": [
+ "Consume any allocation available.",
+ "Do not consume from any allocated capacity.",
+ "Must consume from a specific reservation. Must specify key value fields for specifying the reservations.",
+ ""
+ ],
+ "type": "string"
+ },
+ "key": {
+ "description": "Corresponds to the label key of a reservation resource. To target a SPECIFIC_RESERVATION by name, specify googleapis.com/reservation-name as the key and specify the name of your reservation as its value.",
+ "type": "string"
+ },
+ "values": {
+ "description": "Corresponds to the label values of a reservation resource. This can be either a name to a reservation in the same project or \"projects/different-project/reservations/some-reservation-name\" to target a shared reservation in the same zone but in a different project.",
"items": {
- "$ref": "InstanceManagedByIgmError"
+ "type": "string"
},
"type": "array"
- },
- "nextPageToken": {
- "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
- "type": "string"
}
},
"type": "object"
},
- "RegionInstanceGroupManagersListInstanceConfigsResp": {
- "id": "RegionInstanceGroupManagersListInstanceConfigsResp",
+ "ReservationAggregatedList": {
+ "description": "Contains a list of reservations.",
+ "id": "ReservationAggregatedList",
"properties": {
+ "id": {
+ "description": "[Output Only] Unique identifier for the resource; defined by the server.",
+ "type": "string"
+ },
"items": {
- "description": "[Output Only] The list of PerInstanceConfig.",
- "items": {
- "$ref": "PerInstanceConfig"
+ "additionalProperties": {
+ "$ref": "ReservationsScopedList",
+ "description": "Name of the scope containing this set of reservations."
},
- "type": "array"
+ "description": "A list of Allocation resources.",
+ "type": "object"
+ },
+ "kind": {
+ "default": "compute#reservationAggregatedList",
+ "description": "Type of resource.",
+ "type": "string"
},
"nextPageToken": {
"description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
"type": "string"
},
+ "selfLink": {
+ "description": "[Output Only] Server-defined URL for this resource.",
+ "type": "string"
+ },
+ "unreachables": {
+ "description": "[Output Only] Unreachable resources.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
"warning": {
"description": "[Output Only] Informational warning message.",
"properties": {
@@ -63567,81 +67878,23 @@
},
"type": "object"
},
- "RegionInstanceGroupManagersListInstancesResponse": {
- "id": "RegionInstanceGroupManagersListInstancesResponse",
- "properties": {
- "managedInstances": {
- "description": "A list of managed instances.",
- "items": {
- "$ref": "ManagedInstance"
- },
- "type": "array"
- },
- "nextPageToken": {
- "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "RegionInstanceGroupManagersRecreateRequest": {
- "id": "RegionInstanceGroupManagersRecreateRequest",
- "properties": {
- "instances": {
- "description": "The URLs of one or more instances to recreate. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME].",
- "items": {
- "type": "string"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "RegionInstanceGroupManagersSetTargetPoolsRequest": {
- "id": "RegionInstanceGroupManagersSetTargetPoolsRequest",
- "properties": {
- "fingerprint": {
- "description": "Fingerprint of the target pools information, which is a hash of the contents. This field is used for optimistic locking when you update the target pool entries. This field is optional.",
- "format": "byte",
- "type": "string"
- },
- "targetPools": {
- "description": "The URL of all TargetPool resources to which instances in the instanceGroup field are added. The target pools automatically apply to all of the instances in the managed instance group.",
- "items": {
- "type": "string"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "RegionInstanceGroupManagersSetTemplateRequest": {
- "id": "RegionInstanceGroupManagersSetTemplateRequest",
- "properties": {
- "instanceTemplate": {
- "description": "URL of the InstanceTemplate resource from which all new instances will be created.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "RegionInstanceGroupsListInstances": {
- "id": "RegionInstanceGroupsListInstances",
+ "ReservationList": {
+ "id": "ReservationList",
"properties": {
"id": {
- "description": "[Output Only] Unique identifier for the resource; defined by the server.",
+ "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.",
"type": "string"
},
"items": {
- "description": "A list of InstanceWithNamedPorts resources.",
+ "description": "[Output Only] A list of Allocation resources.",
"items": {
- "$ref": "InstanceWithNamedPorts"
+ "$ref": "Reservation"
},
"type": "array"
},
"kind": {
- "default": "compute#regionInstanceGroupsListInstances",
- "description": "The resource type.",
+ "default": "compute#reservationList",
+ "description": "[Output Only] Type of resource.Always compute#reservationsList for listsof reservations",
"type": "string"
},
"nextPageToken": {
@@ -63776,77 +68029,29 @@
},
"type": "object"
},
- "RegionInstanceGroupsListInstancesRequest": {
- "id": "RegionInstanceGroupsListInstancesRequest",
- "properties": {
- "instanceState": {
- "description": "Instances in which state should be returned. Valid options are: 'ALL', 'RUNNING'. By default, it lists all instances.",
- "enum": [
- "ALL",
- "RUNNING"
- ],
- "enumDescriptions": [
- "Matches any status of the instances, running, non-running and others.",
- "Instance is in RUNNING state if it is running."
- ],
- "type": "string"
- },
- "portName": {
- "description": "Name of port user is interested in. It is optional. If it is set, only information about this ports will be returned. If it is not set, all the named ports will be returned. Always lists all instances.",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- "type": "string"
- }
- },
- "type": "object"
- },
- "RegionInstanceGroupsSetNamedPortsRequest": {
- "id": "RegionInstanceGroupsSetNamedPortsRequest",
+ "ReservationsResizeRequest": {
+ "id": "ReservationsResizeRequest",
"properties": {
- "fingerprint": {
- "description": "The fingerprint of the named ports information for this instance group. Use this optional property to prevent conflicts when multiple users change the named ports settings concurrently. Obtain the fingerprint with the instanceGroups.get method. Then, include the fingerprint in your request to ensure that you do not overwrite changes that were applied from another concurrent request.",
- "format": "byte",
+ "specificSkuCount": {
+ "description": "Number of allocated resources can be resized with minimum = 1 and maximum = 1000.",
+ "format": "int64",
"type": "string"
- },
- "namedPorts": {
- "description": "The list of named ports to set for this instance group.",
- "items": {
- "$ref": "NamedPort"
- },
- "type": "array"
}
},
- "type": "object"
- },
- "RegionList": {
- "description": "Contains a list of region resources.",
- "id": "RegionList",
- "properties": {
- "id": {
- "description": "[Output Only] Unique identifier for the resource; defined by the server.",
- "type": "string"
- },
- "items": {
- "description": "A list of Region resources.",
- "items": {
- "$ref": "Region"
- },
- "type": "array"
- },
- "kind": {
- "default": "compute#regionList",
- "description": "[Output Only] Type of resource. Always compute#regionList for lists of regions.",
- "type": "string"
- },
- "nextPageToken": {
- "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
- "type": "string"
- },
- "selfLink": {
- "description": "[Output Only] Server-defined URL for this resource.",
- "type": "string"
+ "type": "object"
+ },
+ "ReservationsScopedList": {
+ "id": "ReservationsScopedList",
+ "properties": {
+ "reservations": {
+ "description": "A list of reservations contained in this scope.",
+ "items": {
+ "$ref": "Reservation"
+ },
+ "type": "array"
},
"warning": {
- "description": "[Output Only] Informational warning message.",
+ "description": "Informational warning which replaces the list of reservations when the list is empty.",
"properties": {
"code": {
"description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.",
@@ -63969,82 +68174,33 @@
},
"type": "object"
},
- "RegionNetworkEndpointGroupsAttachEndpointsRequest": {
- "id": "RegionNetworkEndpointGroupsAttachEndpointsRequest",
- "properties": {
- "networkEndpoints": {
- "description": "The list of network endpoints to be attached.",
- "items": {
- "$ref": "NetworkEndpoint"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "RegionNetworkEndpointGroupsDetachEndpointsRequest": {
- "id": "RegionNetworkEndpointGroupsDetachEndpointsRequest",
- "properties": {
- "networkEndpoints": {
- "description": "The list of network endpoints to be detached.",
- "items": {
- "$ref": "NetworkEndpoint"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponse": {
- "id": "RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponse",
- "properties": {
- "firewallPolicys": {
- "description": "Effective firewalls from firewall policy.",
- "items": {
- "$ref": "RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy"
- },
- "type": "array"
- },
- "firewalls": {
- "description": "Effective firewalls on the network.",
- "items": {
- "$ref": "Firewall"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy": {
- "id": "RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy",
+ "ResourceCommitment": {
+ "description": "Commitment for a particular resource (a Commitment is composed of one or more of these).",
+ "id": "ResourceCommitment",
"properties": {
- "displayName": {
- "description": "[Output Only] The display name of the firewall policy.",
+ "acceleratorType": {
+ "description": "Name of the accelerator type resource. Applicable only when the type is ACCELERATOR.",
"type": "string"
},
- "name": {
- "description": "[Output Only] The name of the firewall policy.",
+ "amount": {
+ "description": "The amount of the resource purchased (in a type-dependent unit, such as bytes). For vCPUs, this can just be an integer. For memory, this must be provided in MB. Memory must be a multiple of 256 MB, with up to 6.5GB of memory per every vCPU.",
+ "format": "int64",
"type": "string"
},
- "rules": {
- "description": "The rules that apply to the network.",
- "items": {
- "$ref": "FirewallPolicyRule"
- },
- "type": "array"
- },
"type": {
- "description": "[Output Only] The type of the firewall policy. Can be one of HIERARCHY, NETWORK, NETWORK_REGIONAL.",
+ "description": "Type of resource for which this commitment applies. Possible values are VCPU, MEMORY, LOCAL_SSD, and ACCELERATOR.",
"enum": [
- "HIERARCHY",
- "NETWORK",
- "NETWORK_REGIONAL",
- "UNSPECIFIED"
+ "ACCELERATOR",
+ "LOCAL_SSD",
+ "MEMORY",
+ "UNSPECIFIED",
+ "VCPU"
],
"enumDescriptions": [
"",
"",
"",
+ "",
""
],
"type": "string"
@@ -64052,248 +68208,28 @@
},
"type": "object"
},
- "RegionSetLabelsRequest": {
- "id": "RegionSetLabelsRequest",
- "properties": {
- "labelFingerprint": {
- "description": "The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels. Make a get() request to the resource to get the latest fingerprint.",
- "format": "byte",
- "type": "string"
- },
- "labels": {
- "additionalProperties": {
- "type": "string"
- },
- "description": "The labels to set for this resource.",
- "type": "object"
- }
- },
- "type": "object"
- },
- "RegionSetPolicyRequest": {
- "id": "RegionSetPolicyRequest",
- "properties": {
- "bindings": {
- "description": "Flatten Policy to create a backwacd compatible wire-format. Deprecated. Use 'policy' to specify bindings.",
- "items": {
- "$ref": "Binding"
- },
- "type": "array"
- },
- "etag": {
- "description": "Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify the etag.",
- "format": "byte",
- "type": "string"
- },
- "policy": {
- "$ref": "Policy",
- "description": "REQUIRED: The complete policy to be applied to the 'resource'. The size of the policy is limited to a few 10s of KB. An empty policy is in general a valid policy but certain services (like Projects) might reject them."
- }
- },
- "type": "object"
- },
- "RegionTargetHttpsProxiesSetSslCertificatesRequest": {
- "id": "RegionTargetHttpsProxiesSetSslCertificatesRequest",
- "properties": {
- "sslCertificates": {
- "description": "New set of SslCertificate resources to associate with this TargetHttpsProxy resource.",
- "items": {
- "type": "string"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "RegionUrlMapsValidateRequest": {
- "id": "RegionUrlMapsValidateRequest",
- "properties": {
- "resource": {
- "$ref": "UrlMap",
- "description": "Content of the UrlMap to be validated."
- }
- },
- "type": "object"
- },
- "RequestMirrorPolicy": {
- "description": "A policy that specifies how requests intended for the route's backends are shadowed to a separate mirrored backend service. The load balancer doesn't wait for responses from the shadow service. Before sending traffic to the shadow service, the host or authority header is suffixed with -shadow.",
- "id": "RequestMirrorPolicy",
+ "ResourceGroupReference": {
+ "id": "ResourceGroupReference",
"properties": {
- "backendService": {
- "description": "The full or partial URL to the BackendService resource being mirrored to. The backend service configured for a mirroring policy must reference backends that are of the same type as the original backend service matched in the URL map. Serverless NEG backends are not currently supported as a mirrored backend service. ",
+ "group": {
+ "description": "A URI referencing one of the instance groups or network endpoint groups listed in the backend service.",
"type": "string"
}
},
"type": "object"
},
- "Reservation": {
- "description": "Represents a reservation resource. A reservation ensures that capacity is held in a specific zone even if the reserved VMs are not running. For more information, read Reserving zonal resources.",
- "id": "Reservation",
+ "ResourcePoliciesScopedList": {
+ "id": "ResourcePoliciesScopedList",
"properties": {
- "aggregateReservation": {
- "$ref": "AllocationAggregateReservation",
- "description": "Reservation for aggregated resources, providing shape flexibility."
- },
- "commitment": {
- "description": "[Output Only] Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment.",
- "type": "string"
- },
- "creationTimestamp": {
- "description": "[Output Only] Creation timestamp in RFC3339 text format.",
- "type": "string"
- },
- "description": {
- "description": "An optional description of this resource. Provide this property when you create the resource.",
- "type": "string"
- },
- "id": {
- "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.",
- "format": "uint64",
- "type": "string"
- },
- "kind": {
- "default": "compute#reservation",
- "description": "[Output Only] Type of the resource. Always compute#reservations for reservations.",
- "type": "string"
- },
- "name": {
- "annotations": {
- "required": [
- "compute.instances.insert"
- ]
- },
- "description": "The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- "type": "string"
- },
"resourcePolicies": {
- "additionalProperties": {
- "type": "string"
- },
- "description": "Resource policies to be added to this reservation. The key is defined by user, and the value is resource policy url. This is to define placement policy with reservation.",
- "type": "object"
- },
- "resourceStatus": {
- "$ref": "AllocationResourceStatus",
- "description": "[Output Only] Status information for Reservation resource."
- },
- "satisfiesPzs": {
- "description": "[Output Only] Reserved for future use.",
- "type": "boolean"
- },
- "selfLink": {
- "description": "[Output Only] Server-defined fully-qualified URL for this resource.",
- "type": "string"
- },
- "shareSettings": {
- "$ref": "ShareSettings",
- "description": "Specify share-settings to create a shared reservation. This property is optional. For more information about the syntax and options for this field and its subfields, see the guide for creating a shared reservation."
- },
- "specificReservation": {
- "$ref": "AllocationSpecificSKUReservation",
- "description": "Reservation for instances with specific machine shapes."
- },
- "specificReservationRequired": {
- "description": "Indicates whether the reservation can be consumed by VMs with affinity for \"any\" reservation. If the field is set, then only VMs that target the reservation by name can consume from this reservation.",
- "type": "boolean"
- },
- "status": {
- "description": "[Output Only] The status of the reservation.",
- "enum": [
- "CREATING",
- "DELETING",
- "INVALID",
- "READY",
- "UPDATING"
- ],
- "enumDescriptions": [
- "Resources are being allocated for the reservation.",
- "Reservation is currently being deleted.",
- "",
- "Reservation has allocated all its resources.",
- "Reservation is currently being resized."
- ],
- "type": "string"
- },
- "zone": {
- "description": "Zone in which the reservation resides. A zone must be provided if the reservation is created within a commitment.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "ReservationAffinity": {
- "description": "Specifies the reservations that this instance can consume from.",
- "id": "ReservationAffinity",
- "properties": {
- "consumeReservationType": {
- "description": "Specifies the type of reservation from which this instance can consume resources: ANY_RESERVATION (default), SPECIFIC_RESERVATION, or NO_RESERVATION. See Consuming reserved instances for examples.",
- "enum": [
- "ANY_RESERVATION",
- "NO_RESERVATION",
- "SPECIFIC_RESERVATION",
- "UNSPECIFIED"
- ],
- "enumDescriptions": [
- "Consume any allocation available.",
- "Do not consume from any allocated capacity.",
- "Must consume from a specific reservation. Must specify key value fields for specifying the reservations.",
- ""
- ],
- "type": "string"
- },
- "key": {
- "description": "Corresponds to the label key of a reservation resource. To target a SPECIFIC_RESERVATION by name, specify googleapis.com/reservation-name as the key and specify the name of your reservation as its value.",
- "type": "string"
- },
- "values": {
- "description": "Corresponds to the label values of a reservation resource. This can be either a name to a reservation in the same project or \"projects/different-project/reservations/some-reservation-name\" to target a shared reservation in the same zone but in a different project.",
- "items": {
- "type": "string"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "ReservationAggregatedList": {
- "description": "Contains a list of reservations.",
- "id": "ReservationAggregatedList",
- "properties": {
- "id": {
- "description": "[Output Only] Unique identifier for the resource; defined by the server.",
- "type": "string"
- },
- "items": {
- "additionalProperties": {
- "$ref": "ReservationsScopedList",
- "description": "Name of the scope containing this set of reservations."
- },
- "description": "A list of Allocation resources.",
- "type": "object"
- },
- "kind": {
- "default": "compute#reservationAggregatedList",
- "description": "Type of resource.",
- "type": "string"
- },
- "nextPageToken": {
- "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
- "type": "string"
- },
- "selfLink": {
- "description": "[Output Only] Server-defined URL for this resource.",
- "type": "string"
- },
- "unreachables": {
- "description": "[Output Only] Unreachable resources.",
+ "description": "A list of resourcePolicies contained in this scope.",
"items": {
- "type": "string"
+ "$ref": "ResourcePolicy"
},
"type": "array"
},
"warning": {
- "description": "[Output Only] Informational warning message.",
+ "description": "Informational warning which replaces the list of resourcePolicies when the list is empty.",
"properties": {
"code": {
"description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.",
@@ -64416,23 +68352,107 @@
},
"type": "object"
},
- "ReservationList": {
- "id": "ReservationList",
+ "ResourcePolicy": {
+ "description": "Represents a Resource Policy resource. You can use resource policies to schedule actions for some Compute Engine resources. For example, you can use them to schedule persistent disk snapshots.",
+ "id": "ResourcePolicy",
"properties": {
+ "creationTimestamp": {
+ "description": "[Output Only] Creation timestamp in RFC3339 text format.",
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "diskConsistencyGroupPolicy": {
+ "$ref": "ResourcePolicyDiskConsistencyGroupPolicy",
+ "description": "Resource policy for disk consistency groups."
+ },
+ "groupPlacementPolicy": {
+ "$ref": "ResourcePolicyGroupPlacementPolicy",
+ "description": "Resource policy for instances for placement configuration."
+ },
"id": {
"description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.",
+ "format": "uint64",
+ "type": "string"
+ },
+ "instanceSchedulePolicy": {
+ "$ref": "ResourcePolicyInstanceSchedulePolicy",
+ "description": "Resource policy for scheduling instance operations."
+ },
+ "kind": {
+ "default": "compute#resourcePolicy",
+ "description": "[Output Only] Type of the resource. Always compute#resource_policies for resource policies.",
+ "type": "string"
+ },
+ "name": {
+ "annotations": {
+ "required": [
+ "compute.instances.insert"
+ ]
+ },
+ "description": "The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "type": "string"
+ },
+ "region": {
+ "type": "string"
+ },
+ "resourceStatus": {
+ "$ref": "ResourcePolicyResourceStatus",
+ "description": "[Output Only] The system status of the resource policy."
+ },
+ "selfLink": {
+ "description": "[Output Only] Server-defined fully-qualified URL for this resource.",
+ "type": "string"
+ },
+ "snapshotSchedulePolicy": {
+ "$ref": "ResourcePolicySnapshotSchedulePolicy",
+ "description": "Resource policy for persistent disks for creating snapshots."
+ },
+ "status": {
+ "description": "[Output Only] The status of resource policy creation.",
+ "enum": [
+ "CREATING",
+ "DELETING",
+ "EXPIRED",
+ "INVALID",
+ "READY"
+ ],
+ "enumDescriptions": [
+ "Resource policy is being created.",
+ "Resource policy is being deleted.",
+ "Resource policy is expired and will not run again.",
+ "",
+ "Resource policy is ready to be used."
+ ],
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "ResourcePolicyAggregatedList": {
+ "description": "Contains a list of resourcePolicies.",
+ "id": "ResourcePolicyAggregatedList",
+ "properties": {
+ "etag": {
+ "type": "string"
+ },
+ "id": {
+ "description": "[Output Only] Unique identifier for the resource; defined by the server.",
"type": "string"
},
"items": {
- "description": "[Output Only] A list of Allocation resources.",
- "items": {
- "$ref": "Reservation"
+ "additionalProperties": {
+ "$ref": "ResourcePoliciesScopedList",
+ "description": "Name of the scope containing this set of resourcePolicies."
},
- "type": "array"
+ "description": "A list of ResourcePolicy resources.",
+ "type": "object"
},
"kind": {
- "default": "compute#reservationList",
- "description": "[Output Only] Type of resource.Always compute#reservationsList for listsof reservations",
+ "default": "compute#resourcePolicyAggregatedList",
+ "description": "Type of resource.",
"type": "string"
},
"nextPageToken": {
@@ -64443,6 +68463,13 @@
"description": "[Output Only] Server-defined URL for this resource.",
"type": "string"
},
+ "unreachables": {
+ "description": "[Output Only] Unreachable resources.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
"warning": {
"description": "[Output Only] Informational warning message.",
"properties": {
@@ -64567,29 +68594,151 @@
},
"type": "object"
},
- "ReservationsResizeRequest": {
- "id": "ReservationsResizeRequest",
+ "ResourcePolicyDailyCycle": {
+ "description": "Time window specified for daily operations.",
+ "id": "ResourcePolicyDailyCycle",
+ "properties": {
+ "daysInCycle": {
+ "description": "Defines a schedule with units measured in days. The value determines how many days pass between the start of each cycle.",
+ "format": "int32",
+ "type": "integer"
+ },
+ "duration": {
+ "description": "[Output only] A predetermined duration for the window, automatically chosen to be the smallest possible in the given scenario.",
+ "type": "string"
+ },
+ "startTime": {
+ "description": "Start time of the window. This must be in UTC format that resolves to one of 00:00, 04:00, 08:00, 12:00, 16:00, or 20:00. For example, both 13:00-5 and 08:00 are valid.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "ResourcePolicyDiskConsistencyGroupPolicy": {
+ "description": "Resource policy for disk consistency groups.",
+ "id": "ResourcePolicyDiskConsistencyGroupPolicy",
+ "properties": {},
+ "type": "object"
+ },
+ "ResourcePolicyGroupPlacementPolicy": {
+ "description": "A GroupPlacementPolicy specifies resource placement configuration. It specifies the failure bucket separation",
+ "id": "ResourcePolicyGroupPlacementPolicy",
+ "properties": {
+ "availabilityDomainCount": {
+ "description": "The number of availability domains to spread instances across. If two instances are in different availability domain, they are not in the same low latency network.",
+ "format": "int32",
+ "type": "integer"
+ },
+ "collocation": {
+ "description": "Specifies network collocation",
+ "enum": [
+ "COLLOCATED",
+ "UNSPECIFIED_COLLOCATION"
+ ],
+ "enumDescriptions": [
+ "",
+ ""
+ ],
+ "type": "string"
+ },
+ "vmCount": {
+ "description": "Number of VMs in this placement group. Google does not recommend that you use this field unless you use a compact policy and you want your policy to work only if it contains this exact number of VMs.",
+ "format": "int32",
+ "type": "integer"
+ }
+ },
+ "type": "object"
+ },
+ "ResourcePolicyHourlyCycle": {
+ "description": "Time window specified for hourly operations.",
+ "id": "ResourcePolicyHourlyCycle",
+ "properties": {
+ "duration": {
+ "description": "[Output only] Duration of the time window, automatically chosen to be smallest possible in the given scenario.",
+ "type": "string"
+ },
+ "hoursInCycle": {
+ "description": "Defines a schedule with units measured in hours. The value determines how many hours pass between the start of each cycle.",
+ "format": "int32",
+ "type": "integer"
+ },
+ "startTime": {
+ "description": "Time within the window to start the operations. It must be in format \"HH:MM\", where HH : [00-23] and MM : [00-00] GMT.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "ResourcePolicyInstanceSchedulePolicy": {
+ "description": "An InstanceSchedulePolicy specifies when and how frequent certain operations are performed on the instance.",
+ "id": "ResourcePolicyInstanceSchedulePolicy",
+ "properties": {
+ "expirationTime": {
+ "description": "The expiration time of the schedule. The timestamp is an RFC3339 string.",
+ "type": "string"
+ },
+ "startTime": {
+ "description": "The start time of the schedule. The timestamp is an RFC3339 string.",
+ "type": "string"
+ },
+ "timeZone": {
+ "description": "Specifies the time zone to be used in interpreting Schedule.schedule. The value of this field must be a time zone name from the tz database: https://wikipedia.org/wiki/Tz_database.",
+ "type": "string"
+ },
+ "vmStartSchedule": {
+ "$ref": "ResourcePolicyInstanceSchedulePolicySchedule",
+ "description": "Specifies the schedule for starting instances."
+ },
+ "vmStopSchedule": {
+ "$ref": "ResourcePolicyInstanceSchedulePolicySchedule",
+ "description": "Specifies the schedule for stopping instances."
+ }
+ },
+ "type": "object"
+ },
+ "ResourcePolicyInstanceSchedulePolicySchedule": {
+ "description": "Schedule for an instance operation.",
+ "id": "ResourcePolicyInstanceSchedulePolicySchedule",
"properties": {
- "specificSkuCount": {
- "description": "Number of allocated resources can be resized with minimum = 1 and maximum = 1000.",
- "format": "int64",
+ "schedule": {
+ "description": "Specifies the frequency for the operation, using the unix-cron format.",
"type": "string"
}
},
"type": "object"
},
- "ReservationsScopedList": {
- "id": "ReservationsScopedList",
+ "ResourcePolicyList": {
+ "id": "ResourcePolicyList",
"properties": {
- "reservations": {
- "description": "A list of reservations contained in this scope.",
+ "etag": {
+ "type": "string"
+ },
+ "id": {
+ "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.",
+ "type": "string"
+ },
+ "items": {
+ "description": "[Output Only] A list of ResourcePolicy resources.",
"items": {
- "$ref": "Reservation"
+ "$ref": "ResourcePolicy"
},
"type": "array"
},
+ "kind": {
+ "default": "compute#resourcePolicyList",
+ "description": "[Output Only] Type of resource.Always compute#resourcePoliciesList for listsof resourcePolicies",
+ "type": "string"
+ },
+ "nextPageToken": {
+ "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
+ "type": "string"
+ },
+ "selfLink": {
+ "description": "[Output Only] Server-defined URL for this resource.",
+ "type": "string"
+ },
"warning": {
- "description": "Informational warning which replaces the list of reservations when the list is empty.",
+ "description": "[Output Only] Informational warning message.",
"properties": {
"code": {
"description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.",
@@ -64693,52 +68842,517 @@
"description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).",
"type": "string"
},
- "value": {
- "description": "[Output Only] A warning data value corresponding to the key.",
- "type": "string"
- }
+ "value": {
+ "description": "[Output Only] A warning data value corresponding to the key.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "type": "array"
+ },
+ "message": {
+ "description": "[Output Only] A human-readable description of the warning code.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ }
+ },
+ "type": "object"
+ },
+ "ResourcePolicyResourceStatus": {
+ "description": "Contains output only fields. Use this sub-message for all output fields set on ResourcePolicy. The internal structure of this \"status\" field should mimic the structure of ResourcePolicy proto specification.",
+ "id": "ResourcePolicyResourceStatus",
+ "properties": {
+ "instanceSchedulePolicy": {
+ "$ref": "ResourcePolicyResourceStatusInstanceSchedulePolicyStatus",
+ "description": "[Output Only] Specifies a set of output values reffering to the instance_schedule_policy system status. This field should have the same name as corresponding policy field."
+ }
+ },
+ "type": "object"
+ },
+ "ResourcePolicyResourceStatusInstanceSchedulePolicyStatus": {
+ "id": "ResourcePolicyResourceStatusInstanceSchedulePolicyStatus",
+ "properties": {
+ "lastRunStartTime": {
+ "description": "[Output Only] The last time the schedule successfully ran. The timestamp is an RFC3339 string.",
+ "type": "string"
+ },
+ "nextRunStartTime": {
+ "description": "[Output Only] The next time the schedule is planned to run. The actual time might be slightly different. The timestamp is an RFC3339 string.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "ResourcePolicySnapshotSchedulePolicy": {
+ "description": "A snapshot schedule policy specifies when and how frequently snapshots are to be created for the target disk. Also specifies how many and how long these scheduled snapshots should be retained.",
+ "id": "ResourcePolicySnapshotSchedulePolicy",
+ "properties": {
+ "retentionPolicy": {
+ "$ref": "ResourcePolicySnapshotSchedulePolicyRetentionPolicy",
+ "description": "Retention policy applied to snapshots created by this resource policy."
+ },
+ "schedule": {
+ "$ref": "ResourcePolicySnapshotSchedulePolicySchedule",
+ "description": "A Vm Maintenance Policy specifies what kind of infrastructure maintenance we are allowed to perform on this VM and when. Schedule that is applied to disks covered by this policy."
+ },
+ "snapshotProperties": {
+ "$ref": "ResourcePolicySnapshotSchedulePolicySnapshotProperties",
+ "description": "Properties with which snapshots are created such as labels, encryption keys."
+ }
+ },
+ "type": "object"
+ },
+ "ResourcePolicySnapshotSchedulePolicyRetentionPolicy": {
+ "description": "Policy for retention of scheduled snapshots.",
+ "id": "ResourcePolicySnapshotSchedulePolicyRetentionPolicy",
+ "properties": {
+ "maxRetentionDays": {
+ "description": "Maximum age of the snapshot that is allowed to be kept.",
+ "format": "int32",
+ "type": "integer"
+ },
+ "onSourceDiskDelete": {
+ "description": "Specifies the behavior to apply to scheduled snapshots when the source disk is deleted.",
+ "enum": [
+ "APPLY_RETENTION_POLICY",
+ "KEEP_AUTO_SNAPSHOTS",
+ "UNSPECIFIED_ON_SOURCE_DISK_DELETE"
+ ],
+ "enumDescriptions": [
+ "",
+ "",
+ ""
+ ],
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "ResourcePolicySnapshotSchedulePolicySchedule": {
+ "description": "A schedule for disks where the schedueled operations are performed.",
+ "id": "ResourcePolicySnapshotSchedulePolicySchedule",
+ "properties": {
+ "dailySchedule": {
+ "$ref": "ResourcePolicyDailyCycle"
+ },
+ "hourlySchedule": {
+ "$ref": "ResourcePolicyHourlyCycle"
+ },
+ "weeklySchedule": {
+ "$ref": "ResourcePolicyWeeklyCycle"
+ }
+ },
+ "type": "object"
+ },
+ "ResourcePolicySnapshotSchedulePolicySnapshotProperties": {
+ "description": "Specified snapshot properties for scheduled snapshots created by this policy.",
+ "id": "ResourcePolicySnapshotSchedulePolicySnapshotProperties",
+ "properties": {
+ "chainName": {
+ "description": "Chain name that the snapshot is created in.",
+ "type": "string"
+ },
+ "guestFlush": {
+ "description": "Indication to perform a 'guest aware' snapshot.",
+ "type": "boolean"
+ },
+ "labels": {
+ "additionalProperties": {
+ "type": "string"
+ },
+ "description": "Labels to apply to scheduled snapshots. These can be later modified by the setLabels method. Label values may be empty.",
+ "type": "object"
+ },
+ "storageLocations": {
+ "description": "Cloud Storage bucket storage location of the auto snapshot (regional or multi-regional).",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ }
+ },
+ "type": "object"
+ },
+ "ResourcePolicyWeeklyCycle": {
+ "description": "Time window specified for weekly operations.",
+ "id": "ResourcePolicyWeeklyCycle",
+ "properties": {
+ "dayOfWeeks": {
+ "description": "Up to 7 intervals/windows, one for each day of the week.",
+ "items": {
+ "$ref": "ResourcePolicyWeeklyCycleDayOfWeek"
+ },
+ "type": "array"
+ }
+ },
+ "type": "object"
+ },
+ "ResourcePolicyWeeklyCycleDayOfWeek": {
+ "id": "ResourcePolicyWeeklyCycleDayOfWeek",
+ "properties": {
+ "day": {
+ "description": "Defines a schedule that runs on specific days of the week. Specify one or more days. The following options are available: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY.",
+ "enum": [
+ "FRIDAY",
+ "INVALID",
+ "MONDAY",
+ "SATURDAY",
+ "SUNDAY",
+ "THURSDAY",
+ "TUESDAY",
+ "WEDNESDAY"
+ ],
+ "enumDescriptions": [
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ ],
+ "type": "string"
+ },
+ "duration": {
+ "description": "[Output only] Duration of the time window, automatically chosen to be smallest possible in the given scenario.",
+ "type": "string"
+ },
+ "startTime": {
+ "description": "Time within the window to start the operations. It must be in format \"HH:MM\", where HH : [00-23] and MM : [00-00] GMT.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "ResourceStatus": {
+ "description": "Contains output only fields. Use this sub-message for actual values set on Instance attributes as compared to the value requested by the user (intent) in their instance CRUD calls.",
+ "id": "ResourceStatus",
+ "properties": {
+ "physicalHost": {
+ "description": "[Output Only] An opaque ID of the host on which the VM is running.",
+ "type": "string"
+ },
+ "scheduling": {
+ "$ref": "ResourceStatusScheduling"
+ },
+ "upcomingMaintenance": {
+ "$ref": "UpcomingMaintenance"
+ }
+ },
+ "type": "object"
+ },
+ "ResourceStatusScheduling": {
+ "id": "ResourceStatusScheduling",
+ "properties": {
+ "availabilityDomain": {
+ "description": "Specifies the availability domain to place the instance in. The value must be a number between 1 and the number of availability domains specified in the spread placement policy attached to the instance.",
+ "format": "int32",
+ "type": "integer"
+ }
+ },
+ "type": "object"
+ },
+ "Route": {
+ "description": "Represents a Route resource. A route defines a path from VM instances in the VPC network to a specific destination. This destination can be inside or outside the VPC network. For more information, read the Routes overview.",
+ "id": "Route",
+ "properties": {
+ "asPaths": {
+ "description": "[Output Only] AS path.",
+ "items": {
+ "$ref": "RouteAsPath"
+ },
+ "type": "array"
+ },
+ "creationTimestamp": {
+ "description": "[Output Only] Creation timestamp in RFC3339 text format.",
+ "type": "string"
+ },
+ "description": {
+ "description": "An optional description of this resource. Provide this field when you create the resource.",
+ "type": "string"
+ },
+ "destRange": {
+ "annotations": {
+ "required": [
+ "compute.routes.insert"
+ ]
+ },
+ "description": "The destination range of outgoing packets that this route applies to. Both IPv4 and IPv6 are supported. Must specify an IPv4 range (e.g. 192.0.2.0/24) or an IPv6 range in RFC 4291 format (e.g. 2001:db8::/32). IPv6 range will be displayed using RFC 5952 compressed format.",
+ "type": "string"
+ },
+ "id": {
+ "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.",
+ "format": "uint64",
+ "type": "string"
+ },
+ "kind": {
+ "default": "compute#route",
+ "description": "[Output Only] Type of this resource. Always compute#routes for Route resources.",
+ "type": "string"
+ },
+ "name": {
+ "annotations": {
+ "required": [
+ "compute.routes.insert"
+ ]
+ },
+ "description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`. The first character must be a lowercase letter, and all following characters (except for the last character) must be a dash, lowercase letter, or digit. The last character must be a lowercase letter or digit.",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "type": "string"
+ },
+ "network": {
+ "annotations": {
+ "required": [
+ "compute.routes.insert"
+ ]
+ },
+ "description": "Fully-qualified URL of the network that this route applies to.",
+ "type": "string"
+ },
+ "nextHopGateway": {
+ "description": "The URL to a gateway that should handle matching packets. You can only specify the internet gateway using a full or partial valid URL: projects/ project/global/gateways/default-internet-gateway",
+ "type": "string"
+ },
+ "nextHopHub": {
+ "description": "[Output Only] The full resource name of the Network Connectivity Center hub that will handle matching packets.",
+ "type": "string"
+ },
+ "nextHopIlb": {
+ "description": "The URL to a forwarding rule of type loadBalancingScheme=INTERNAL that should handle matching packets or the IP address of the forwarding Rule. For example, the following are all valid URLs: - https://www.googleapis.com/compute/v1/projects/project/regions/region /forwardingRules/forwardingRule - regions/region/forwardingRules/forwardingRule If an IP address is provided, must specify an IPv4 address in dot-decimal notation or an IPv6 address in RFC 4291 format. For example, the following are all valid IP addresses: - 10.128.0.56 - 2001:db8::2d9:51:0:0 - 2001:db8:0:0:2d9:51:0:0 IPv6 addresses will be displayed using RFC 5952 compressed format (e.g. 2001:db8::2d9:51:0:0). Should never be an IPv4-mapped IPv6 address.",
+ "type": "string"
+ },
+ "nextHopInstance": {
+ "description": "The URL to an instance that should handle matching packets. You can specify this as a full or partial URL. For example: https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/",
+ "type": "string"
+ },
+ "nextHopIp": {
+ "description": "The network IP address of an instance that should handle matching packets. Both IPv6 address and IPv4 addresses are supported. Must specify an IPv4 address in dot-decimal notation (e.g. 192.0.2.99) or an IPv6 address in RFC 4291 format (e.g. 2001:db8::2d9:51:0:0 or 2001:db8:0:0:2d9:51:0:0). IPv6 addresses will be displayed using RFC 5952 compressed format (e.g. 2001:db8::2d9:51:0:0). Should never be an IPv4-mapped IPv6 address.",
+ "type": "string"
+ },
+ "nextHopNetwork": {
+ "description": "The URL of the local network if it should handle matching packets.",
+ "type": "string"
+ },
+ "nextHopPeering": {
+ "description": "[Output Only] The network peering name that should handle matching packets, which should conform to RFC1035.",
+ "type": "string"
+ },
+ "nextHopVpnTunnel": {
+ "description": "The URL to a VpnTunnel that should handle matching packets.",
+ "type": "string"
+ },
+ "priority": {
+ "annotations": {
+ "required": [
+ "compute.routes.insert"
+ ]
+ },
+ "description": "The priority of this route. Priority is used to break ties in cases where there is more than one matching route of equal prefix length. In cases where multiple routes have equal prefix length, the one with the lowest-numbered priority value wins. The default value is `1000`. The priority value must be from `0` to `65535`, inclusive.",
+ "format": "uint32",
+ "type": "integer"
+ },
+ "routeStatus": {
+ "description": "[Output only] The status of the route.",
+ "enum": [
+ "ACTIVE",
+ "DROPPED",
+ "INACTIVE",
+ "PENDING"
+ ],
+ "enumDescriptions": [
+ "This route is processed and active.",
+ "The route is dropped due to the VPC exceeding the dynamic route limit. For dynamic route limit, please refer to the Learned route example",
+ "This route is processed but inactive due to failure from the backend. The backend may have rejected the route",
+ "This route is being processed internally. The status will change once processed."
+ ],
+ "type": "string"
+ },
+ "routeType": {
+ "description": "[Output Only] The type of this route, which can be one of the following values: - 'TRANSIT' for a transit route that this router learned from another Cloud Router and will readvertise to one of its BGP peers - 'SUBNET' for a route from a subnet of the VPC - 'BGP' for a route learned from a BGP peer of this router - 'STATIC' for a static route",
+ "enum": [
+ "BGP",
+ "STATIC",
+ "SUBNET",
+ "TRANSIT"
+ ],
+ "enumDescriptions": [
+ "",
+ "",
+ "",
+ ""
+ ],
+ "type": "string"
+ },
+ "selfLink": {
+ "description": "[Output Only] Server-defined fully-qualified URL for this resource.",
+ "type": "string"
+ },
+ "tags": {
+ "annotations": {
+ "required": [
+ "compute.routes.insert"
+ ]
+ },
+ "description": "A list of instance tags to which this route applies.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "warnings": {
+ "description": "[Output Only] If potential misconfigurations are detected for this route, this field will be populated with warning messages.",
+ "items": {
+ "properties": {
+ "code": {
+ "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.",
+ "enum": [
+ "CLEANUP_FAILED",
+ "DEPRECATED_RESOURCE_USED",
+ "DEPRECATED_TYPE_USED",
+ "DISK_SIZE_LARGER_THAN_IMAGE_SIZE",
+ "EXPERIMENTAL_TYPE_USED",
+ "EXTERNAL_API_WARNING",
+ "FIELD_VALUE_OVERRIDEN",
+ "INJECTED_KERNELS_DEPRECATED",
+ "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB",
+ "LARGE_DEPLOYMENT_WARNING",
+ "LIST_OVERHEAD_QUOTA_EXCEED",
+ "MISSING_TYPE_DEPENDENCY",
+ "NEXT_HOP_ADDRESS_NOT_ASSIGNED",
+ "NEXT_HOP_CANNOT_IP_FORWARD",
+ "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE",
+ "NEXT_HOP_INSTANCE_NOT_FOUND",
+ "NEXT_HOP_INSTANCE_NOT_ON_NETWORK",
+ "NEXT_HOP_NOT_RUNNING",
+ "NOT_CRITICAL_ERROR",
+ "NO_RESULTS_ON_PAGE",
+ "PARTIAL_SUCCESS",
+ "REQUIRED_TOS_AGREEMENT",
+ "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING",
+ "RESOURCE_NOT_DELETED",
+ "SCHEMA_VALIDATION_IGNORED",
+ "SINGLE_INSTANCE_PROPERTY_TEMPLATE",
+ "UNDECLARED_PROPERTIES",
+ "UNREACHABLE"
+ ],
+ "enumDeprecated": [
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ true,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false
+ ],
+ "enumDescriptions": [
+ "Warning about failed cleanup of transient changes made by a failed operation.",
+ "A link to a deprecated resource was created.",
+ "When deploying and at least one of the resources has a type marked as deprecated",
+ "The user created a boot disk that is larger than image size.",
+ "When deploying and at least one of the resources has a type marked as experimental",
+ "Warning that is present in an external api call",
+ "Warning that value of a field has been overridden. Deprecated unused field.",
+ "The operation involved use of an injected kernel, which is deprecated.",
+ "A WEIGHTED_MAGLEV backend service is associated with a health check that is not of type HTTP/HTTPS/HTTP2.",
+ "When deploying a deployment with a exceedingly large number of resources",
+ "Resource can't be retrieved due to list overhead quota exceed which captures the amount of resources filtered out by user-defined list filter.",
+ "A resource depends on a missing type",
+ "The route's nextHopIp address is not assigned to an instance on the network.",
+ "The route's next hop instance cannot ip forward.",
+ "The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route.",
+ "The route's nextHopInstance URL refers to an instance that does not exist.",
+ "The route's nextHopInstance URL refers to an instance that is not on the same network as the route.",
+ "The route's next hop instance does not have a status of RUNNING.",
+ "Error which is not critical. We decided to continue the process despite the mentioned error.",
+ "No results are present on a particular list page.",
+ "Success is reported, but some results may be missing due to errors",
+ "The user attempted to use a resource that requires a TOS they have not accepted.",
+ "Warning that a resource is in use.",
+ "One or more of the resources set to auto-delete could not be deleted because they were in use.",
+ "When a resource schema validation is ignored.",
+ "Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group.",
+ "When undeclared properties in the schema are present",
+ "A given scope cannot be reached."
+ ],
+ "type": "string"
+ },
+ "data": {
+ "description": "[Output Only] Metadata about this warning in key: value format. For example: \"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" } ",
+ "items": {
+ "properties": {
+ "key": {
+ "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).",
+ "type": "string"
+ },
+ "value": {
+ "description": "[Output Only] A warning data value corresponding to the key.",
+ "type": "string"
+ }
+ },
+ "type": "object"
},
- "type": "object"
+ "type": "array"
},
- "type": "array"
+ "message": {
+ "description": "[Output Only] A human-readable description of the warning code.",
+ "type": "string"
+ }
},
- "message": {
- "description": "[Output Only] A human-readable description of the warning code.",
- "type": "string"
- }
+ "type": "object"
},
- "type": "object"
+ "type": "array"
}
},
"type": "object"
},
- "ResourceCommitment": {
- "description": "Commitment for a particular resource (a Commitment is composed of one or more of these).",
- "id": "ResourceCommitment",
+ "RouteAsPath": {
+ "id": "RouteAsPath",
"properties": {
- "acceleratorType": {
- "description": "Name of the accelerator type resource. Applicable only when the type is ACCELERATOR.",
- "type": "string"
- },
- "amount": {
- "description": "The amount of the resource purchased (in a type-dependent unit, such as bytes). For vCPUs, this can just be an integer. For memory, this must be provided in MB. Memory must be a multiple of 256 MB, with up to 6.5GB of memory per every vCPU.",
- "format": "int64",
- "type": "string"
+ "asLists": {
+ "description": "[Output Only] The AS numbers of the AS Path.",
+ "items": {
+ "format": "uint32",
+ "type": "integer"
+ },
+ "type": "array"
},
- "type": {
- "description": "Type of resource for which this commitment applies. Possible values are VCPU, MEMORY, LOCAL_SSD, and ACCELERATOR.",
+ "pathSegmentType": {
+ "description": "[Output Only] The type of the AS Path, which can be one of the following values: - 'AS_SET': unordered set of autonomous systems that the route in has traversed - 'AS_SEQUENCE': ordered set of autonomous systems that the route has traversed - 'AS_CONFED_SEQUENCE': ordered set of Member Autonomous Systems in the local confederation that the route has traversed - 'AS_CONFED_SET': unordered set of Member Autonomous Systems in the local confederation that the route has traversed ",
"enum": [
- "ACCELERATOR",
- "LOCAL_SSD",
- "MEMORY",
- "UNSPECIFIED",
- "VCPU"
+ "AS_CONFED_SEQUENCE",
+ "AS_CONFED_SET",
+ "AS_SEQUENCE",
+ "AS_SET"
],
"enumDescriptions": [
"",
"",
"",
- "",
""
],
"type": "string"
@@ -64746,28 +69360,36 @@
},
"type": "object"
},
- "ResourceGroupReference": {
- "id": "ResourceGroupReference",
+ "RouteList": {
+ "description": "Contains a list of Route resources.",
+ "id": "RouteList",
"properties": {
- "group": {
- "description": "A URI referencing one of the instance groups or network endpoint groups listed in the backend service.",
+ "id": {
+ "description": "[Output Only] Unique identifier for the resource; defined by the server.",
"type": "string"
- }
- },
- "type": "object"
- },
- "ResourcePoliciesScopedList": {
- "id": "ResourcePoliciesScopedList",
- "properties": {
- "resourcePolicies": {
- "description": "A list of resourcePolicies contained in this scope.",
+ },
+ "items": {
+ "description": "A list of Route resources.",
"items": {
- "$ref": "ResourcePolicy"
+ "$ref": "Route"
},
"type": "array"
},
+ "kind": {
+ "default": "compute#routeList",
+ "description": "Type of resource.",
+ "type": "string"
+ },
+ "nextPageToken": {
+ "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
+ "type": "string"
+ },
+ "selfLink": {
+ "description": "[Output Only] Server-defined URL for this resource.",
+ "type": "string"
+ },
"warning": {
- "description": "Informational warning which replaces the list of resourcePolicies when the list is empty.",
+ "description": "[Output Only] Informational warning message.",
"properties": {
"code": {
"description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.",
@@ -64890,106 +69512,128 @@
},
"type": "object"
},
- "ResourcePolicy": {
- "description": "Represents a Resource Policy resource. You can use resource policies to schedule actions for some Compute Engine resources. For example, you can use them to schedule persistent disk snapshots.",
- "id": "ResourcePolicy",
+ "Router": {
+ "description": "Represents a Cloud Router resource. For more information about Cloud Router, read the Cloud Router overview.",
+ "id": "Router",
"properties": {
+ "bgp": {
+ "$ref": "RouterBgp",
+ "description": "BGP information specific to this router."
+ },
+ "bgpPeers": {
+ "description": "BGP information that must be configured into the routing stack to establish BGP peering. This information must specify the peer ASN and either the interface name, IP address, or peer IP address. Please refer to RFC4273.",
+ "items": {
+ "$ref": "RouterBgpPeer"
+ },
+ "type": "array"
+ },
"creationTimestamp": {
"description": "[Output Only] Creation timestamp in RFC3339 text format.",
"type": "string"
},
"description": {
+ "description": "An optional description of this resource. Provide this property when you create the resource.",
"type": "string"
},
- "diskConsistencyGroupPolicy": {
- "$ref": "ResourcePolicyDiskConsistencyGroupPolicy",
- "description": "Resource policy for disk consistency groups."
- },
- "groupPlacementPolicy": {
- "$ref": "ResourcePolicyGroupPlacementPolicy",
- "description": "Resource policy for instances for placement configuration."
+ "encryptedInterconnectRouter": {
+ "description": "Indicates if a router is dedicated for use with encrypted VLAN attachments (interconnectAttachments).",
+ "type": "boolean"
},
"id": {
"description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.",
"format": "uint64",
"type": "string"
},
- "instanceSchedulePolicy": {
- "$ref": "ResourcePolicyInstanceSchedulePolicy",
- "description": "Resource policy for scheduling instance operations."
+ "interfaces": {
+ "description": "Router interfaces. To create a BGP peer that uses a router interface, the interface must have one of the following fields specified: - linkedVpnTunnel - linkedInterconnectAttachment - subnetwork You can create a router interface without any of these fields specified. However, you cannot create a BGP peer that uses that interface.",
+ "items": {
+ "$ref": "RouterInterface"
+ },
+ "type": "array"
},
"kind": {
- "default": "compute#resourcePolicy",
- "description": "[Output Only] Type of the resource. Always compute#resource_policies for resource policies.",
+ "default": "compute#router",
+ "description": "[Output Only] Type of resource. Always compute#router for routers.",
"type": "string"
},
+ "md5AuthenticationKeys": {
+ "description": "Keys used for MD5 authentication.",
+ "items": {
+ "$ref": "RouterMd5AuthenticationKey"
+ },
+ "type": "array"
+ },
"name": {
"annotations": {
"required": [
- "compute.instances.insert"
+ "compute.routers.insert"
]
},
- "description": "The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.",
+ "description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.",
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
"type": "string"
},
- "region": {
- "type": "string"
- },
- "resourceStatus": {
- "$ref": "ResourcePolicyResourceStatus",
- "description": "[Output Only] The system status of the resource policy."
+ "nats": {
+ "description": "A list of NAT services created in this router.",
+ "items": {
+ "$ref": "RouterNat"
+ },
+ "type": "array"
},
- "selfLink": {
- "description": "[Output Only] Server-defined fully-qualified URL for this resource.",
+ "network": {
+ "annotations": {
+ "required": [
+ "compute.routers.insert",
+ "compute.routers.update"
+ ]
+ },
+ "description": "URI of the network to which this router belongs.",
"type": "string"
},
- "snapshotSchedulePolicy": {
- "$ref": "ResourcePolicySnapshotSchedulePolicy",
- "description": "Resource policy for persistent disks for creating snapshots."
+ "region": {
+ "description": "[Output Only] URI of the region where the router resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.",
+ "type": "string"
},
- "status": {
- "description": "[Output Only] The status of resource policy creation.",
- "enum": [
- "CREATING",
- "DELETING",
- "EXPIRED",
- "INVALID",
- "READY"
- ],
- "enumDescriptions": [
- "Resource policy is being created.",
- "Resource policy is being deleted.",
- "Resource policy is expired and will not run again.",
- "",
- "Resource policy is ready to be used."
- ],
+ "selfLink": {
+ "description": "[Output Only] Server-defined URL for the resource.",
"type": "string"
}
},
"type": "object"
},
- "ResourcePolicyAggregatedList": {
- "description": "Contains a list of resourcePolicies.",
- "id": "ResourcePolicyAggregatedList",
+ "RouterAdvertisedIpRange": {
+ "description": "Description-tagged IP ranges for the router to advertise.",
+ "id": "RouterAdvertisedIpRange",
"properties": {
- "etag": {
+ "description": {
+ "description": "User-specified description for the IP range.",
"type": "string"
},
+ "range": {
+ "description": "The IP range to advertise. The value must be a CIDR-formatted string.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "RouterAggregatedList": {
+ "description": "Contains a list of routers.",
+ "id": "RouterAggregatedList",
+ "properties": {
"id": {
"description": "[Output Only] Unique identifier for the resource; defined by the server.",
"type": "string"
},
"items": {
"additionalProperties": {
- "$ref": "ResourcePoliciesScopedList",
- "description": "Name of the scope containing this set of resourcePolicies."
+ "$ref": "RoutersScopedList",
+ "description": "Name of the scope containing this set of routers."
},
- "description": "A list of ResourcePolicy resources.",
+ "description": "A list of Router resources.",
"type": "object"
},
"kind": {
- "default": "compute#resourcePolicyAggregatedList",
+ "default": "compute#routerAggregatedList",
"description": "Type of resource.",
"type": "string"
},
@@ -65132,46 +69776,119 @@
},
"type": "object"
},
- "ResourcePolicyDailyCycle": {
- "description": "Time window specified for daily operations.",
- "id": "ResourcePolicyDailyCycle",
+ "RouterBgp": {
+ "id": "RouterBgp",
"properties": {
- "daysInCycle": {
- "description": "Defines a schedule with units measured in days. The value determines how many days pass between the start of each cycle.",
- "format": "int32",
+ "advertiseMode": {
+ "description": "User-specified flag to indicate which mode to use for advertisement. The options are DEFAULT or CUSTOM.",
+ "enum": [
+ "CUSTOM",
+ "DEFAULT"
+ ],
+ "enumDescriptions": [
+ "",
+ ""
+ ],
+ "type": "string"
+ },
+ "advertisedGroups": {
+ "description": "User-specified list of prefix groups to advertise in custom mode. This field can only be populated if advertise_mode is CUSTOM and is advertised to all peers of the router. These groups will be advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups.",
+ "items": {
+ "enum": [
+ "ALL_SUBNETS"
+ ],
+ "enumDescriptions": [
+ "Advertise all available subnets (including peer VPC subnets)."
+ ],
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "advertisedIpRanges": {
+ "description": "User-specified list of individual IP ranges to advertise in custom mode. This field can only be populated if advertise_mode is CUSTOM and is advertised to all peers of the router. These IP ranges will be advertised in addition to any specified groups. Leave this field blank to advertise no custom IP ranges.",
+ "items": {
+ "$ref": "RouterAdvertisedIpRange"
+ },
+ "type": "array"
+ },
+ "asn": {
+ "description": "Local BGP Autonomous System Number (ASN). Must be an RFC6996 private ASN, either 16-bit or 32-bit. The value will be fixed for this router resource. All VPN tunnels that link to this router will have the same local ASN.",
+ "format": "uint32",
"type": "integer"
},
- "duration": {
- "description": "[Output only] A predetermined duration for the window, automatically chosen to be the smallest possible in the given scenario.",
+ "identifierRange": {
+ "description": "Explicitly specifies a range of valid BGP Identifiers for this Router. It is provided as a link-local IPv4 range (from 169.254.0.0/16), of size at least /30, even if the BGP sessions are over IPv6. It must not overlap with any IPv4 BGP session ranges. Other vendors commonly call this \"router ID\".",
"type": "string"
},
- "startTime": {
- "description": "Start time of the window. This must be in UTC format that resolves to one of 00:00, 04:00, 08:00, 12:00, 16:00, or 20:00. For example, both 13:00-5 and 08:00 are valid.",
- "type": "string"
+ "keepaliveInterval": {
+ "description": "The interval in seconds between BGP keepalive messages that are sent to the peer. Hold time is three times the interval at which keepalive messages are sent, and the hold time is the maximum number of seconds allowed to elapse between successive keepalive messages that BGP receives from a peer. BGP will use the smaller of either the local hold time value or the peer's hold time value as the hold time for the BGP connection between the two peers. If set, this value must be between 20 and 60. The default is 20.",
+ "format": "uint32",
+ "type": "integer"
}
},
"type": "object"
},
- "ResourcePolicyDiskConsistencyGroupPolicy": {
- "description": "Resource policy for disk consistency groups.",
- "id": "ResourcePolicyDiskConsistencyGroupPolicy",
- "properties": {},
- "type": "object"
- },
- "ResourcePolicyGroupPlacementPolicy": {
- "description": "A GroupPlacementPolicy specifies resource placement configuration. It specifies the failure bucket separation as well as network locality",
- "id": "ResourcePolicyGroupPlacementPolicy",
+ "RouterBgpPeer": {
+ "id": "RouterBgpPeer",
"properties": {
- "availabilityDomainCount": {
- "description": "The number of availability domains to spread instances across. If two instances are in different availability domain, they are not in the same low latency network.",
+ "advertiseMode": {
+ "description": "User-specified flag to indicate which mode to use for advertisement.",
+ "enum": [
+ "CUSTOM",
+ "DEFAULT"
+ ],
+ "enumDescriptions": [
+ "",
+ ""
+ ],
+ "type": "string"
+ },
+ "advertisedGroups": {
+ "description": "User-specified list of prefix groups to advertise in custom mode, which currently supports the following option: - ALL_SUBNETS: Advertises all of the router's own VPC subnets. This excludes any routes learned for subnets that use VPC Network Peering. Note that this field can only be populated if advertise_mode is CUSTOM and overrides the list defined for the router (in the \"bgp\" message). These groups are advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups.",
+ "items": {
+ "enum": [
+ "ALL_SUBNETS"
+ ],
+ "enumDescriptions": [
+ "Advertise all available subnets (including peer VPC subnets)."
+ ],
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "advertisedIpRanges": {
+ "description": "User-specified list of individual IP ranges to advertise in custom mode. This field can only be populated if advertise_mode is CUSTOM and overrides the list defined for the router (in the \"bgp\" message). These IP ranges are advertised in addition to any specified groups. Leave this field blank to advertise no custom IP ranges.",
+ "items": {
+ "$ref": "RouterAdvertisedIpRange"
+ },
+ "type": "array"
+ },
+ "advertisedRoutePriority": {
+ "description": "The priority of routes advertised to this BGP peer. Where there is more than one matching route of maximum length, the routes with the lowest priority value win.",
+ "format": "uint32",
+ "type": "integer"
+ },
+ "bfd": {
+ "$ref": "RouterBgpPeerBfd",
+ "description": "BFD configuration for the BGP peering."
+ },
+ "customLearnedIpRanges": {
+ "description": "A list of user-defined custom learned route IP address ranges for a BGP session.",
+ "items": {
+ "$ref": "RouterBgpPeerCustomLearnedIpRange"
+ },
+ "type": "array"
+ },
+ "customLearnedRoutePriority": {
+ "description": "The user-defined custom learned route priority for a BGP session. This value is applied to all custom learned route ranges for the session. You can choose a value from `0` to `65335`. If you don't provide a value, Google Cloud assigns a priority of `100` to the ranges.",
"format": "int32",
"type": "integer"
},
- "collocation": {
- "description": "Specifies network collocation",
+ "enable": {
+ "description": "The status of the BGP peer connection. If set to FALSE, any active session with the peer is terminated and all associated routing information is removed. If set to TRUE, the peer connection can be established with routing information. The default is TRUE.",
"enum": [
- "COLLOCATED",
- "UNSPECIFIED_COLLOCATION"
+ "FALSE",
+ "TRUE"
],
"enumDescriptions": [
"",
@@ -65179,92 +69896,227 @@
],
"type": "string"
},
- "vmCount": {
- "description": "Number of VMs in this placement group. Google does not recommend that you use this field unless you use a compact policy and you want your policy to work only if it contains this exact number of VMs.",
- "format": "int32",
+ "enableIpv4": {
+ "description": "Enable IPv4 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 4.",
+ "type": "boolean"
+ },
+ "enableIpv6": {
+ "description": "Enable IPv6 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 6.",
+ "type": "boolean"
+ },
+ "exportPolicies": {
+ "description": "List of export policies applied to this peer, in the order they must be evaluated. The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_EXPORT type. Note that Route Policies are currently available in preview. Please use Beta API to use Route Policies.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "importPolicies": {
+ "description": "List of import policies applied to this peer, in the order they must be evaluated. The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_IMPORT type. Note that Route Policies are currently available in preview. Please use Beta API to use Route Policies.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "interfaceName": {
+ "description": "Name of the interface the BGP peer is associated with.",
+ "type": "string"
+ },
+ "ipAddress": {
+ "description": "IP address of the interface inside Google Cloud Platform.",
+ "type": "string"
+ },
+ "ipv4NexthopAddress": {
+ "description": "IPv4 address of the interface inside Google Cloud Platform.",
+ "type": "string"
+ },
+ "ipv6NexthopAddress": {
+ "description": "IPv6 address of the interface inside Google Cloud Platform.",
+ "type": "string"
+ },
+ "managementType": {
+ "description": "[Output Only] The resource that configures and manages this BGP peer. - MANAGED_BY_USER is the default value and can be managed by you or other users - MANAGED_BY_ATTACHMENT is a BGP peer that is configured and managed by Cloud Interconnect, specifically by an InterconnectAttachment of type PARTNER. Google automatically creates, updates, and deletes this type of BGP peer when the PARTNER InterconnectAttachment is created, updated, or deleted. ",
+ "enum": [
+ "MANAGED_BY_ATTACHMENT",
+ "MANAGED_BY_USER"
+ ],
+ "enumDescriptions": [
+ "The BGP peer is automatically created for PARTNER type InterconnectAttachment; Google will automatically create/delete this BGP peer when the PARTNER InterconnectAttachment is created/deleted, and Google will update the ipAddress and peerIpAddress when the PARTNER InterconnectAttachment is provisioned. This type of BGP peer cannot be created or deleted, but can be modified for all fields except for name, ipAddress and peerIpAddress.",
+ "Default value, the BGP peer is manually created and managed by user."
+ ],
+ "type": "string"
+ },
+ "md5AuthenticationKeyName": {
+ "description": "Present if MD5 authentication is enabled for the peering. Must be the name of one of the entries in the Router.md5_authentication_keys. The field must comply with RFC1035.",
+ "type": "string"
+ },
+ "name": {
+ "annotations": {
+ "required": [
+ "compute.routers.insert"
+ ]
+ },
+ "description": "Name of this BGP peer. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "type": "string"
+ },
+ "peerAsn": {
+ "annotations": {
+ "required": [
+ "compute.routers.insert"
+ ]
+ },
+ "description": "Peer BGP Autonomous System Number (ASN). Each BGP interface may use a different value.",
+ "format": "uint32",
"type": "integer"
+ },
+ "peerIpAddress": {
+ "description": "IP address of the BGP interface outside Google Cloud Platform.",
+ "type": "string"
+ },
+ "peerIpv4NexthopAddress": {
+ "description": "IPv4 address of the BGP interface outside Google Cloud Platform.",
+ "type": "string"
+ },
+ "peerIpv6NexthopAddress": {
+ "description": "IPv6 address of the BGP interface outside Google Cloud Platform.",
+ "type": "string"
+ },
+ "routerApplianceInstance": {
+ "description": "URI of the VM instance that is used as third-party router appliances such as Next Gen Firewalls, Virtual Routers, or Router Appliances. The VM instance must be located in zones contained in the same region as this Cloud Router. The VM instance is the peer side of the BGP session.",
+ "type": "string"
}
},
"type": "object"
},
- "ResourcePolicyHourlyCycle": {
- "description": "Time window specified for hourly operations.",
- "id": "ResourcePolicyHourlyCycle",
+ "RouterBgpPeerBfd": {
+ "id": "RouterBgpPeerBfd",
"properties": {
- "duration": {
- "description": "[Output only] Duration of the time window, automatically chosen to be smallest possible in the given scenario.",
- "type": "string"
+ "minReceiveInterval": {
+ "description": "The minimum interval, in milliseconds, between BFD control packets received from the peer router. The actual value is negotiated between the two routers and is equal to the greater of this value and the transmit interval of the other router. If set, this value must be between 1000 and 30000. The default is 1000.",
+ "format": "uint32",
+ "type": "integer"
},
- "hoursInCycle": {
- "description": "Defines a schedule with units measured in hours. The value determines how many hours pass between the start of each cycle.",
- "format": "int32",
+ "minTransmitInterval": {
+ "description": "The minimum interval, in milliseconds, between BFD control packets transmitted to the peer router. The actual value is negotiated between the two routers and is equal to the greater of this value and the corresponding receive interval of the other router. If set, this value must be between 1000 and 30000. The default is 1000.",
+ "format": "uint32",
"type": "integer"
},
- "startTime": {
- "description": "Time within the window to start the operations. It must be in format \"HH:MM\", where HH : [00-23] and MM : [00-00] GMT.",
+ "multiplier": {
+ "description": "The number of consecutive BFD packets that must be missed before BFD declares that a peer is unavailable. If set, the value must be a value between 5 and 16. The default is 5.",
+ "format": "uint32",
+ "type": "integer"
+ },
+ "sessionInitializationMode": {
+ "description": "The BFD session initialization mode for this BGP peer. If set to ACTIVE, the Cloud Router will initiate the BFD session for this BGP peer. If set to PASSIVE, the Cloud Router will wait for the peer router to initiate the BFD session for this BGP peer. If set to DISABLED, BFD is disabled for this BGP peer. The default is DISABLED.",
+ "enum": [
+ "ACTIVE",
+ "DISABLED",
+ "PASSIVE"
+ ],
+ "enumDescriptions": [
+ "",
+ "",
+ ""
+ ],
"type": "string"
}
},
"type": "object"
},
- "ResourcePolicyInstanceSchedulePolicy": {
- "description": "An InstanceSchedulePolicy specifies when and how frequent certain operations are performed on the instance.",
- "id": "ResourcePolicyInstanceSchedulePolicy",
+ "RouterBgpPeerCustomLearnedIpRange": {
+ "id": "RouterBgpPeerCustomLearnedIpRange",
"properties": {
- "expirationTime": {
- "description": "The expiration time of the schedule. The timestamp is an RFC3339 string.",
+ "range": {
+ "description": "The custom learned route IP address range. Must be a valid CIDR-formatted prefix. If an IP address is provided without a subnet mask, it is interpreted as, for IPv4, a `/32` singular IP address range, and, for IPv6, `/128`.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "RouterInterface": {
+ "id": "RouterInterface",
+ "properties": {
+ "ipRange": {
+ "description": "IP address and range of the interface. - For Internet Protocol version 4 (IPv4), the IP range must be in the RFC3927 link-local IP address space. The value must be a CIDR-formatted string, for example, 169.254.0.1/30. Note: Do not truncate the IP address, as it represents the IP address of the interface. - For Internet Protocol version 6 (IPv6), the value must be a unique local address (ULA) range from fdff:1::/64 with a mask length of 126 or less. This value should be a CIDR-formatted string, for example, fc00:0:1:1::1/112. Within the router's VPC, this IPv6 prefix will be reserved exclusively for this connection and cannot be used for any other purpose. ",
+ "type": "string"
+ },
+ "ipVersion": {
+ "description": "IP version of this interface.",
+ "enum": [
+ "IPV4",
+ "IPV6"
+ ],
+ "enumDescriptions": [
+ "",
+ ""
+ ],
+ "type": "string"
+ },
+ "linkedInterconnectAttachment": {
+ "description": "URI of the linked Interconnect attachment. It must be in the same region as the router. Each interface can have one linked resource, which can be a VPN tunnel, an Interconnect attachment, or a subnetwork.",
+ "type": "string"
+ },
+ "linkedVpnTunnel": {
+ "description": "URI of the linked VPN tunnel, which must be in the same region as the router. Each interface can have one linked resource, which can be a VPN tunnel, an Interconnect attachment, or a subnetwork.",
+ "type": "string"
+ },
+ "managementType": {
+ "description": "[Output Only] The resource that configures and manages this interface. - MANAGED_BY_USER is the default value and can be managed directly by users. - MANAGED_BY_ATTACHMENT is an interface that is configured and managed by Cloud Interconnect, specifically, by an InterconnectAttachment of type PARTNER. Google automatically creates, updates, and deletes this type of interface when the PARTNER InterconnectAttachment is created, updated, or deleted. ",
+ "enum": [
+ "MANAGED_BY_ATTACHMENT",
+ "MANAGED_BY_USER"
+ ],
+ "enumDescriptions": [
+ "The interface is automatically created for PARTNER type InterconnectAttachment, Google will automatically create/update/delete this interface when the PARTNER InterconnectAttachment is created/provisioned/deleted. This type of interface cannot be manually managed by user.",
+ "Default value, the interface is manually created and managed by user."
+ ],
"type": "string"
},
- "startTime": {
- "description": "The start time of the schedule. The timestamp is an RFC3339 string.",
+ "name": {
+ "annotations": {
+ "required": [
+ "compute.routers.insert"
+ ]
+ },
+ "description": "Name of this interface entry. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
"type": "string"
},
- "timeZone": {
- "description": "Specifies the time zone to be used in interpreting Schedule.schedule. The value of this field must be a time zone name from the tz database: https://wikipedia.org/wiki/Tz_database.",
+ "privateIpAddress": {
+ "description": "The regional private internal IP address that is used to establish BGP sessions to a VM instance acting as a third-party Router Appliance, such as a Next Gen Firewall, a Virtual Router, or an SD-WAN VM.",
"type": "string"
},
- "vmStartSchedule": {
- "$ref": "ResourcePolicyInstanceSchedulePolicySchedule",
- "description": "Specifies the schedule for starting instances."
+ "redundantInterface": {
+ "description": "Name of the interface that will be redundant with the current interface you are creating. The redundantInterface must belong to the same Cloud Router as the interface here. To establish the BGP session to a Router Appliance VM, you must create two BGP peers. The two BGP peers must be attached to two separate interfaces that are redundant with each other. The redundant_interface must be 1-63 characters long, and comply with RFC1035. Specifically, the redundant_interface must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "type": "string"
},
- "vmStopSchedule": {
- "$ref": "ResourcePolicyInstanceSchedulePolicySchedule",
- "description": "Specifies the schedule for stopping instances."
- }
- },
- "type": "object"
- },
- "ResourcePolicyInstanceSchedulePolicySchedule": {
- "description": "Schedule for an instance operation.",
- "id": "ResourcePolicyInstanceSchedulePolicySchedule",
- "properties": {
- "schedule": {
- "description": "Specifies the frequency for the operation, using the unix-cron format.",
+ "subnetwork": {
+ "description": "The URI of the subnetwork resource that this interface belongs to, which must be in the same region as the Cloud Router. When you establish a BGP session to a VM instance using this interface, the VM instance must belong to the same subnetwork as the subnetwork specified here.",
"type": "string"
}
},
"type": "object"
},
- "ResourcePolicyList": {
- "id": "ResourcePolicyList",
+ "RouterList": {
+ "description": "Contains a list of Router resources.",
+ "id": "RouterList",
"properties": {
- "etag": {
- "type": "string"
- },
"id": {
- "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.",
+ "description": "[Output Only] Unique identifier for the resource; defined by the server.",
"type": "string"
},
"items": {
- "description": "[Output Only] A list of ResourcePolicy resources.",
+ "description": "A list of Router resources.",
"items": {
- "$ref": "ResourcePolicy"
+ "$ref": "Router"
},
"type": "array"
},
"kind": {
- "default": "compute#resourcePolicyList",
- "description": "[Output Only] Type of resource.Always compute#resourcePoliciesList for listsof resourcePolicies",
+ "default": "compute#routerList",
+ "description": "[Output Only] Type of resource. Always compute#router for routers.",
"type": "string"
},
"nextPageToken": {
@@ -65399,785 +70251,587 @@
},
"type": "object"
},
- "ResourcePolicyResourceStatus": {
- "description": "Contains output only fields. Use this sub-message for all output fields set on ResourcePolicy. The internal structure of this \"status\" field should mimic the structure of ResourcePolicy proto specification.",
- "id": "ResourcePolicyResourceStatus",
- "properties": {
- "instanceSchedulePolicy": {
- "$ref": "ResourcePolicyResourceStatusInstanceSchedulePolicyStatus",
- "description": "[Output Only] Specifies a set of output values reffering to the instance_schedule_policy system status. This field should have the same name as corresponding policy field."
- }
- },
- "type": "object"
- },
- "ResourcePolicyResourceStatusInstanceSchedulePolicyStatus": {
- "id": "ResourcePolicyResourceStatusInstanceSchedulePolicyStatus",
+ "RouterMd5AuthenticationKey": {
+ "id": "RouterMd5AuthenticationKey",
"properties": {
- "lastRunStartTime": {
- "description": "[Output Only] The last time the schedule successfully ran. The timestamp is an RFC3339 string.",
+ "key": {
+ "annotations": {
+ "required": [
+ "compute.routers.insert"
+ ]
+ },
+ "description": "[Input only] Value of the key. For patch and update calls, it can be skipped to copy the value from the previous configuration. This is allowed if the key with the same name existed before the operation. Maximum length is 80 characters. Can only contain printable ASCII characters.",
"type": "string"
},
- "nextRunStartTime": {
- "description": "[Output Only] The next time the schedule is planned to run. The actual time might be slightly different. The timestamp is an RFC3339 string.",
+ "name": {
+ "annotations": {
+ "required": [
+ "compute.routers.insert",
+ "compute.routers.update"
+ ]
+ },
+ "description": "Name used to identify the key. Must be unique within a router. Must be referenced by exactly one bgpPeer. Must comply with RFC1035.",
"type": "string"
}
},
"type": "object"
},
- "ResourcePolicySnapshotSchedulePolicy": {
- "description": "A snapshot schedule policy specifies when and how frequently snapshots are to be created for the target disk. Also specifies how many and how long these scheduled snapshots should be retained.",
- "id": "ResourcePolicySnapshotSchedulePolicy",
+ "RouterNat": {
+ "description": "Represents a Nat resource. It enables the VMs within the specified subnetworks to access Internet without external IP addresses. It specifies a list of subnetworks (and the ranges within) that want to use NAT. Customers can also provide the external IPs that would be used for NAT. GCP would auto-allocate ephemeral IPs if no external IPs are provided.",
+ "id": "RouterNat",
"properties": {
- "retentionPolicy": {
- "$ref": "ResourcePolicySnapshotSchedulePolicyRetentionPolicy",
- "description": "Retention policy applied to snapshots created by this resource policy."
+ "autoNetworkTier": {
+ "description": "The network tier to use when automatically reserving NAT IP addresses. Must be one of: PREMIUM, STANDARD. If not specified, then the current project-level default tier is used.",
+ "enum": [
+ "FIXED_STANDARD",
+ "PREMIUM",
+ "STANDARD",
+ "STANDARD_OVERRIDES_FIXED_STANDARD"
+ ],
+ "enumDescriptions": [
+ "Public internet quality with fixed bandwidth.",
+ "High quality, Google-grade network tier, support for all networking products.",
+ "Public internet quality, only limited support for other networking products.",
+ "(Output only) Temporary tier for FIXED_STANDARD when fixed standard tier is expired or not configured."
+ ],
+ "type": "string"
},
- "schedule": {
- "$ref": "ResourcePolicySnapshotSchedulePolicySchedule",
- "description": "A Vm Maintenance Policy specifies what kind of infrastructure maintenance we are allowed to perform on this VM and when. Schedule that is applied to disks covered by this policy."
+ "drainNatIps": {
+ "description": "A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT only.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
},
- "snapshotProperties": {
- "$ref": "ResourcePolicySnapshotSchedulePolicySnapshotProperties",
- "description": "Properties with which snapshots are created such as labels, encryption keys."
+ "enableDynamicPortAllocation": {
+ "description": "Enable Dynamic Port Allocation. If not specified, it is disabled by default. If set to true, - Dynamic Port Allocation will be enabled on this NAT config. - enableEndpointIndependentMapping cannot be set to true. - If minPorts is set, minPortsPerVm must be set to a power of two greater than or equal to 32. If minPortsPerVm is not set, a minimum of 32 ports will be allocated to a VM from this NAT config. ",
+ "type": "boolean"
+ },
+ "enableEndpointIndependentMapping": {
+ "type": "boolean"
+ },
+ "endpointTypes": {
+ "description": "List of NAT-ted endpoint types supported by the Nat Gateway. If the list is empty, then it will be equivalent to include ENDPOINT_TYPE_VM",
+ "items": {
+ "enum": [
+ "ENDPOINT_TYPE_MANAGED_PROXY_LB",
+ "ENDPOINT_TYPE_SWG",
+ "ENDPOINT_TYPE_VM"
+ ],
+ "enumDescriptions": [
+ "This is used for regional Application Load Balancers (internal and external) and regional proxy Network Load Balancers (internal and external) endpoints.",
+ "This is used for Secure Web Gateway endpoints.",
+ "This is the default."
+ ],
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "icmpIdleTimeoutSec": {
+ "description": "Timeout (in seconds) for ICMP connections. Defaults to 30s if not set.",
+ "format": "int32",
+ "type": "integer"
+ },
+ "logConfig": {
+ "$ref": "RouterNatLogConfig",
+ "description": "Configure logging on this NAT."
+ },
+ "maxPortsPerVm": {
+ "description": "Maximum number of ports allocated to a VM from this NAT config when Dynamic Port Allocation is enabled. If Dynamic Port Allocation is not enabled, this field has no effect. If Dynamic Port Allocation is enabled, and this field is set, it must be set to a power of two greater than minPortsPerVm, or 64 if minPortsPerVm is not set. If Dynamic Port Allocation is enabled and this field is not set, a maximum of 65536 ports will be allocated to a VM from this NAT config.",
+ "format": "int32",
+ "type": "integer"
+ },
+ "minPortsPerVm": {
+ "description": "Minimum number of ports allocated to a VM from this NAT config. If not set, a default number of ports is allocated to a VM. This is rounded up to the nearest power of 2. For example, if the value of this field is 50, at least 64 ports are allocated to a VM.",
+ "format": "int32",
+ "type": "integer"
+ },
+ "name": {
+ "description": "Unique name of this Nat service. The name must be 1-63 characters long and comply with RFC1035.",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "type": "string"
+ },
+ "natIpAllocateOption": {
+ "description": "Specify the NatIpAllocateOption, which can take one of the following values: - MANUAL_ONLY: Uses only Nat IP addresses provided by customers. When there are not enough specified Nat IPs, the Nat service fails for new VMs. - AUTO_ONLY: Nat IPs are allocated by Google Cloud Platform; customers can't specify any Nat IPs. When choosing AUTO_ONLY, then nat_ip should be empty. ",
+ "enum": [
+ "AUTO_ONLY",
+ "MANUAL_ONLY"
+ ],
+ "enumDescriptions": [
+ "Nat IPs are allocated by GCP; customers can not specify any Nat IPs.",
+ "Only use Nat IPs provided by customers. When specified Nat IPs are not enough then the Nat service fails for new VMs."
+ ],
+ "type": "string"
+ },
+ "natIps": {
+ "description": "A list of URLs of the IP resources used for this Nat service. These IP addresses must be valid static external IP addresses assigned to the project.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "rules": {
+ "description": "A list of rules associated with this NAT.",
+ "items": {
+ "$ref": "RouterNatRule"
+ },
+ "type": "array"
+ },
+ "sourceSubnetworkIpRangesToNat": {
+ "description": "Specify the Nat option, which can take one of the following values: - ALL_SUBNETWORKS_ALL_IP_RANGES: All of the IP ranges in every Subnetwork are allowed to Nat. - ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES: All of the primary IP ranges in every Subnetwork are allowed to Nat. - LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below) The default is SUBNETWORK_IP_RANGE_TO_NAT_OPTION_UNSPECIFIED. Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES then there should not be any other Router.Nat section in any Router for this network in this region.",
+ "enum": [
+ "ALL_SUBNETWORKS_ALL_IP_RANGES",
+ "ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES",
+ "LIST_OF_SUBNETWORKS"
+ ],
+ "enumDescriptions": [
+ "All the IP ranges in every Subnetwork are allowed to Nat.",
+ "All the primary IP ranges in every Subnetwork are allowed to Nat.",
+ "A list of Subnetworks are allowed to Nat (specified in the field subnetwork below)"
+ ],
+ "type": "string"
+ },
+ "subnetworks": {
+ "description": "A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.",
+ "items": {
+ "$ref": "RouterNatSubnetworkToNat"
+ },
+ "type": "array"
+ },
+ "tcpEstablishedIdleTimeoutSec": {
+ "description": "Timeout (in seconds) for TCP established connections. Defaults to 1200s if not set.",
+ "format": "int32",
+ "type": "integer"
+ },
+ "tcpTimeWaitTimeoutSec": {
+ "description": "Timeout (in seconds) for TCP connections that are in TIME_WAIT state. Defaults to 120s if not set.",
+ "format": "int32",
+ "type": "integer"
+ },
+ "tcpTransitoryIdleTimeoutSec": {
+ "description": "Timeout (in seconds) for TCP transitory connections. Defaults to 30s if not set.",
+ "format": "int32",
+ "type": "integer"
+ },
+ "type": {
+ "description": "Indicates whether this NAT is used for public or private IP translation. If unspecified, it defaults to PUBLIC.",
+ "enum": [
+ "PRIVATE",
+ "PUBLIC"
+ ],
+ "enumDescriptions": [
+ "NAT used for private IP translation.",
+ "NAT used for public IP translation. This is the default."
+ ],
+ "type": "string"
+ },
+ "udpIdleTimeoutSec": {
+ "description": "Timeout (in seconds) for UDP connections. Defaults to 30s if not set.",
+ "format": "int32",
+ "type": "integer"
}
},
"type": "object"
},
- "ResourcePolicySnapshotSchedulePolicyRetentionPolicy": {
- "description": "Policy for retention of scheduled snapshots.",
- "id": "ResourcePolicySnapshotSchedulePolicyRetentionPolicy",
+ "RouterNatLogConfig": {
+ "description": "Configuration of logging on a NAT.",
+ "id": "RouterNatLogConfig",
"properties": {
- "maxRetentionDays": {
- "description": "Maximum age of the snapshot that is allowed to be kept.",
- "format": "int32",
- "type": "integer"
+ "enable": {
+ "description": "Indicates whether or not to export logs. This is false by default.",
+ "type": "boolean"
},
- "onSourceDiskDelete": {
- "description": "Specifies the behavior to apply to scheduled snapshots when the source disk is deleted.",
+ "filter": {
+ "description": "Specify the desired filtering of logs on this NAT. If unspecified, logs are exported for all connections handled by this NAT. This option can take one of the following values: - ERRORS_ONLY: Export logs only for connection failures. - TRANSLATIONS_ONLY: Export logs only for successful connections. - ALL: Export logs for all connections, successful and unsuccessful. ",
"enum": [
- "APPLY_RETENTION_POLICY",
- "KEEP_AUTO_SNAPSHOTS",
- "UNSPECIFIED_ON_SOURCE_DISK_DELETE"
+ "ALL",
+ "ERRORS_ONLY",
+ "TRANSLATIONS_ONLY"
],
"enumDescriptions": [
- "",
- "",
- ""
+ "Export logs for all (successful and unsuccessful) connections.",
+ "Export logs for connection failures only.",
+ "Export logs for successful connections only."
],
"type": "string"
}
},
"type": "object"
},
- "ResourcePolicySnapshotSchedulePolicySchedule": {
- "description": "A schedule for disks where the schedueled operations are performed.",
- "id": "ResourcePolicySnapshotSchedulePolicySchedule",
+ "RouterNatRule": {
+ "id": "RouterNatRule",
"properties": {
- "dailySchedule": {
- "$ref": "ResourcePolicyDailyCycle"
+ "action": {
+ "$ref": "RouterNatRuleAction",
+ "description": "The action to be enforced for traffic that matches this rule."
},
- "hourlySchedule": {
- "$ref": "ResourcePolicyHourlyCycle"
+ "description": {
+ "description": "An optional description of this rule.",
+ "type": "string"
},
- "weeklySchedule": {
- "$ref": "ResourcePolicyWeeklyCycle"
+ "match": {
+ "description": "CEL expression that specifies the match condition that egress traffic from a VM is evaluated against. If it evaluates to true, the corresponding `action` is enforced. The following examples are valid match expressions for public NAT: `inIpRange(destination.ip, '1.1.0.0/16') || inIpRange(destination.ip, '2.2.0.0/16')` `destination.ip == '1.1.0.1' || destination.ip == '8.8.8.8'` The following example is a valid match expression for private NAT: `nexthop.hub == '//networkconnectivity.googleapis.com/projects/my-project/locations/global/hubs/hub-1'`",
+ "type": "string"
+ },
+ "ruleNumber": {
+ "description": "An integer uniquely identifying a rule in the list. The rule number must be a positive value between 0 and 65000, and must be unique among rules within a NAT.",
+ "format": "uint32",
+ "type": "integer"
}
},
"type": "object"
},
- "ResourcePolicySnapshotSchedulePolicySnapshotProperties": {
- "description": "Specified snapshot properties for scheduled snapshots created by this policy.",
- "id": "ResourcePolicySnapshotSchedulePolicySnapshotProperties",
+ "RouterNatRuleAction": {
+ "id": "RouterNatRuleAction",
"properties": {
- "chainName": {
- "description": "Chain name that the snapshot is created in.",
- "type": "string"
- },
- "guestFlush": {
- "description": "Indication to perform a 'guest aware' snapshot.",
- "type": "boolean"
+ "sourceNatActiveIps": {
+ "description": "A list of URLs of the IP resources used for this NAT rule. These IP addresses must be valid static external IP addresses assigned to the project. This field is used for public NAT.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
},
- "labels": {
- "additionalProperties": {
+ "sourceNatActiveRanges": {
+ "description": "A list of URLs of the subnetworks used as source ranges for this NAT Rule. These subnetworks must have purpose set to PRIVATE_NAT. This field is used for private NAT.",
+ "items": {
"type": "string"
},
- "description": "Labels to apply to scheduled snapshots. These can be later modified by the setLabels method. Label values may be empty.",
- "type": "object"
+ "type": "array"
},
- "storageLocations": {
- "description": "Cloud Storage bucket storage location of the auto snapshot (regional or multi-regional).",
+ "sourceNatDrainIps": {
+ "description": "A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT rule only. This field is used for public NAT.",
"items": {
"type": "string"
},
"type": "array"
- }
- },
- "type": "object"
- },
- "ResourcePolicyWeeklyCycle": {
- "description": "Time window specified for weekly operations.",
- "id": "ResourcePolicyWeeklyCycle",
- "properties": {
- "dayOfWeeks": {
- "description": "Up to 7 intervals/windows, one for each day of the week.",
+ },
+ "sourceNatDrainRanges": {
+ "description": "A list of URLs of subnetworks representing source ranges to be drained. This is only supported on patch/update, and these subnetworks must have previously been used as active ranges in this NAT Rule. This field is used for private NAT.",
"items": {
- "$ref": "ResourcePolicyWeeklyCycleDayOfWeek"
+ "type": "string"
},
"type": "array"
}
},
"type": "object"
},
- "ResourcePolicyWeeklyCycleDayOfWeek": {
- "id": "ResourcePolicyWeeklyCycleDayOfWeek",
+ "RouterNatSubnetworkToNat": {
+ "description": "Defines the IP ranges that want to use NAT for a subnetwork.",
+ "id": "RouterNatSubnetworkToNat",
"properties": {
- "day": {
- "description": "Defines a schedule that runs on specific days of the week. Specify one or more days. The following options are available: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY.",
- "enum": [
- "FRIDAY",
- "INVALID",
- "MONDAY",
- "SATURDAY",
- "SUNDAY",
- "THURSDAY",
- "TUESDAY",
- "WEDNESDAY"
- ],
- "enumDescriptions": [
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- ""
- ],
+ "name": {
+ "description": "URL for the subnetwork resource that will use NAT.",
"type": "string"
},
- "duration": {
- "description": "[Output only] Duration of the time window, automatically chosen to be smallest possible in the given scenario.",
- "type": "string"
+ "secondaryIpRangeNames": {
+ "description": "A list of the secondary ranges of the Subnetwork that are allowed to use NAT. This can be populated only if \"LIST_OF_SECONDARY_IP_RANGES\" is one of the values in source_ip_ranges_to_nat.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
},
- "startTime": {
- "description": "Time within the window to start the operations. It must be in format \"HH:MM\", where HH : [00-23] and MM : [00-00] GMT.",
- "type": "string"
+ "sourceIpRangesToNat": {
+ "description": "Specify the options for NAT ranges in the Subnetwork. All options of a single value are valid except NAT_IP_RANGE_OPTION_UNSPECIFIED. The only valid option with multiple values is: [\"PRIMARY_IP_RANGE\", \"LIST_OF_SECONDARY_IP_RANGES\"] Default: [ALL_IP_RANGES]",
+ "items": {
+ "enum": [
+ "ALL_IP_RANGES",
+ "LIST_OF_SECONDARY_IP_RANGES",
+ "PRIMARY_IP_RANGE"
+ ],
+ "enumDescriptions": [
+ "The primary and all the secondary ranges are allowed to Nat.",
+ "A list of secondary ranges are allowed to Nat.",
+ "The primary range is allowed to Nat."
+ ],
+ "type": "string"
+ },
+ "type": "array"
}
},
"type": "object"
},
- "ResourceStatus": {
- "description": "Contains output only fields. Use this sub-message for actual values set on Instance attributes as compared to the value requested by the user (intent) in their instance CRUD calls.",
- "id": "ResourceStatus",
+ "RouterStatus": {
+ "id": "RouterStatus",
"properties": {
- "physicalHost": {
- "description": "[Output Only] An opaque ID of the host on which the VM is running.",
- "type": "string"
+ "bestRoutes": {
+ "description": "A list of the best dynamic routes for this Cloud Router's Virtual Private Cloud (VPC) network in the same region as this Cloud Router. Lists all of the best routes per prefix that are programmed into this region's VPC data plane. When global dynamic routing mode is turned on in the VPC network, this list can include cross-region dynamic routes from Cloud Routers in other regions.",
+ "items": {
+ "$ref": "Route"
+ },
+ "type": "array"
},
- "upcomingMaintenance": {
- "$ref": "UpcomingMaintenance"
+ "bestRoutesForRouter": {
+ "description": "A list of the best BGP routes learned by this Cloud Router. It is possible that routes listed might not be programmed into the data plane, if the Google Cloud control plane finds a more optimal route for a prefix than a route learned by this Cloud Router.",
+ "items": {
+ "$ref": "Route"
+ },
+ "type": "array"
+ },
+ "bgpPeerStatus": {
+ "items": {
+ "$ref": "RouterStatusBgpPeerStatus"
+ },
+ "type": "array"
+ },
+ "natStatus": {
+ "items": {
+ "$ref": "RouterStatusNatStatus"
+ },
+ "type": "array"
+ },
+ "network": {
+ "description": "URI of the network to which this router belongs.",
+ "type": "string"
}
},
"type": "object"
},
- "Route": {
- "description": "Represents a Route resource. A route defines a path from VM instances in the VPC network to a specific destination. This destination can be inside or outside the VPC network. For more information, read the Routes overview.",
- "id": "Route",
+ "RouterStatusBgpPeerStatus": {
+ "id": "RouterStatusBgpPeerStatus",
"properties": {
- "asPaths": {
- "description": "[Output Only] AS path.",
+ "advertisedRoutes": {
+ "description": "Routes that were advertised to the remote BGP peer",
"items": {
- "$ref": "RouteAsPath"
+ "$ref": "Route"
},
"type": "array"
},
- "creationTimestamp": {
- "description": "[Output Only] Creation timestamp in RFC3339 text format.",
- "type": "string"
+ "bfdStatus": {
+ "$ref": "BfdStatus"
},
- "description": {
- "description": "An optional description of this resource. Provide this field when you create the resource.",
- "type": "string"
+ "enableIpv4": {
+ "description": "Enable IPv4 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 4.",
+ "type": "boolean"
},
- "destRange": {
- "annotations": {
- "required": [
- "compute.routes.insert"
- ]
- },
- "description": "The destination range of outgoing packets that this route applies to. Both IPv4 and IPv6 are supported. Must specify an IPv4 range (e.g. 192.0.2.0/24) or an IPv6 range in RFC 4291 format (e.g. 2001:db8::/32). IPv6 range will be displayed using RFC 5952 compressed format.",
- "type": "string"
+ "enableIpv6": {
+ "description": "Enable IPv6 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 6.",
+ "type": "boolean"
},
- "id": {
- "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.",
- "format": "uint64",
+ "ipAddress": {
+ "description": "IP address of the local BGP interface.",
"type": "string"
},
- "kind": {
- "default": "compute#route",
- "description": "[Output Only] Type of this resource. Always compute#routes for Route resources.",
+ "ipv4NexthopAddress": {
+ "description": "IPv4 address of the local BGP interface.",
"type": "string"
},
- "name": {
- "annotations": {
- "required": [
- "compute.routes.insert"
- ]
- },
- "description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`. The first character must be a lowercase letter, and all following characters (except for the last character) must be a dash, lowercase letter, or digit. The last character must be a lowercase letter or digit.",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "ipv6NexthopAddress": {
+ "description": "IPv6 address of the local BGP interface.",
"type": "string"
},
- "network": {
- "annotations": {
- "required": [
- "compute.routes.insert"
- ]
- },
- "description": "Fully-qualified URL of the network that this route applies to.",
+ "linkedVpnTunnel": {
+ "description": "URL of the VPN tunnel that this BGP peer controls.",
"type": "string"
},
- "nextHopGateway": {
- "description": "The URL to a gateway that should handle matching packets. You can only specify the internet gateway using a full or partial valid URL: projects/ project/global/gateways/default-internet-gateway",
- "type": "string"
+ "md5AuthEnabled": {
+ "description": "Informs whether MD5 authentication is enabled on this BGP peer.",
+ "type": "boolean"
},
- "nextHopHub": {
- "description": "[Output Only] The full resource name of the Network Connectivity Center hub that will handle matching packets.",
+ "name": {
+ "description": "Name of this BGP peer. Unique within the Routers resource.",
"type": "string"
},
- "nextHopIlb": {
- "description": "The URL to a forwarding rule of type loadBalancingScheme=INTERNAL that should handle matching packets or the IP address of the forwarding Rule. For example, the following are all valid URLs: - 10.128.0.56 - https://www.googleapis.com/compute/v1/projects/project/regions/region /forwardingRules/forwardingRule - regions/region/forwardingRules/forwardingRule ",
- "type": "string"
+ "numLearnedRoutes": {
+ "description": "Number of routes learned from the remote BGP Peer.",
+ "format": "uint32",
+ "type": "integer"
},
- "nextHopInstance": {
- "description": "The URL to an instance that should handle matching packets. You can specify this as a full or partial URL. For example: https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/",
+ "peerIpAddress": {
+ "description": "IP address of the remote BGP interface.",
"type": "string"
},
- "nextHopIp": {
- "description": "The network IP address of an instance that should handle matching packets. Both IPv6 address and IPv4 addresses are supported. Must specify an IPv4 address in dot-decimal notation (e.g. 192.0.2.99) or an IPv6 address in RFC 4291 format (e.g. 2001:db8::2d9:51:0:0 or 2001:db8:0:0:2d9:51:0:0). IPv6 addresses will be displayed using RFC 5952 compressed format (e.g. 2001:db8::2d9:51:0:0). Should never be an IPv4-mapped IPv6 address.",
+ "peerIpv4NexthopAddress": {
+ "description": "IPv4 address of the remote BGP interface.",
"type": "string"
},
- "nextHopNetwork": {
- "description": "The URL of the local network if it should handle matching packets.",
+ "peerIpv6NexthopAddress": {
+ "description": "IPv6 address of the remote BGP interface.",
"type": "string"
},
- "nextHopPeering": {
- "description": "[Output Only] The network peering name that should handle matching packets, which should conform to RFC1035.",
+ "routerApplianceInstance": {
+ "description": "[Output only] URI of the VM instance that is used as third-party router appliances such as Next Gen Firewalls, Virtual Routers, or Router Appliances. The VM instance is the peer side of the BGP session.",
"type": "string"
},
- "nextHopVpnTunnel": {
- "description": "The URL to a VpnTunnel that should handle matching packets.",
+ "state": {
+ "description": "The state of the BGP session. For a list of possible values for this field, see BGP session states.",
"type": "string"
},
- "priority": {
- "annotations": {
- "required": [
- "compute.routes.insert"
- ]
- },
- "description": "The priority of this route. Priority is used to break ties in cases where there is more than one matching route of equal prefix length. In cases where multiple routes have equal prefix length, the one with the lowest-numbered priority value wins. The default value is `1000`. The priority value must be from `0` to `65535`, inclusive.",
- "format": "uint32",
- "type": "integer"
- },
- "routeStatus": {
- "description": "[Output only] The status of the route.",
+ "status": {
+ "description": "Status of the BGP peer: {UP, DOWN}",
"enum": [
- "ACTIVE",
- "DROPPED",
- "INACTIVE",
- "PENDING"
+ "DOWN",
+ "UNKNOWN",
+ "UP"
],
"enumDescriptions": [
- "This route is processed and active.",
- "The route is dropped due to the VPC exceeding the dynamic route limit. For dynamic route limit, please refer to the Learned route example",
- "This route is processed but inactive due to failure from the backend. The backend may have rejected the route",
- "This route is being processed internally. The status will change once processed."
+ "",
+ "",
+ ""
],
"type": "string"
},
- "routeType": {
- "description": "[Output Only] The type of this route, which can be one of the following values: - 'TRANSIT' for a transit route that this router learned from another Cloud Router and will readvertise to one of its BGP peers - 'SUBNET' for a route from a subnet of the VPC - 'BGP' for a route learned from a BGP peer of this router - 'STATIC' for a static route",
+ "statusReason": {
+ "description": "Indicates why particular status was returned.",
"enum": [
- "BGP",
- "STATIC",
- "SUBNET",
- "TRANSIT"
+ "IPV4_PEER_ON_IPV6_ONLY_CONNECTION",
+ "IPV6_PEER_ON_IPV4_ONLY_CONNECTION",
+ "MD5_AUTH_INTERNAL_PROBLEM",
+ "STATUS_REASON_UNSPECIFIED"
],
"enumDescriptions": [
- "",
- "",
- "",
+ "BGP peer disabled because it requires IPv4 but the underlying connection is IPv6-only.",
+ "BGP peer disabled because it requires IPv6 but the underlying connection is IPv4-only.",
+ "Indicates internal problems with configuration of MD5 authentication. This particular reason can only be returned when md5AuthEnabled is true and status is DOWN.",
""
],
"type": "string"
},
- "selfLink": {
- "description": "[Output Only] Server-defined fully-qualified URL for this resource.",
+ "uptime": {
+ "description": "Time this session has been up. Format: 14 years, 51 weeks, 6 days, 23 hours, 59 minutes, 59 seconds",
"type": "string"
},
- "tags": {
- "annotations": {
- "required": [
- "compute.routes.insert"
- ]
- },
- "description": "A list of instance tags to which this route applies.",
- "items": {
- "type": "string"
- },
- "type": "array"
- },
- "warnings": {
- "description": "[Output Only] If potential misconfigurations are detected for this route, this field will be populated with warning messages.",
- "items": {
- "properties": {
- "code": {
- "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.",
- "enum": [
- "CLEANUP_FAILED",
- "DEPRECATED_RESOURCE_USED",
- "DEPRECATED_TYPE_USED",
- "DISK_SIZE_LARGER_THAN_IMAGE_SIZE",
- "EXPERIMENTAL_TYPE_USED",
- "EXTERNAL_API_WARNING",
- "FIELD_VALUE_OVERRIDEN",
- "INJECTED_KERNELS_DEPRECATED",
- "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB",
- "LARGE_DEPLOYMENT_WARNING",
- "LIST_OVERHEAD_QUOTA_EXCEED",
- "MISSING_TYPE_DEPENDENCY",
- "NEXT_HOP_ADDRESS_NOT_ASSIGNED",
- "NEXT_HOP_CANNOT_IP_FORWARD",
- "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE",
- "NEXT_HOP_INSTANCE_NOT_FOUND",
- "NEXT_HOP_INSTANCE_NOT_ON_NETWORK",
- "NEXT_HOP_NOT_RUNNING",
- "NOT_CRITICAL_ERROR",
- "NO_RESULTS_ON_PAGE",
- "PARTIAL_SUCCESS",
- "REQUIRED_TOS_AGREEMENT",
- "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING",
- "RESOURCE_NOT_DELETED",
- "SCHEMA_VALIDATION_IGNORED",
- "SINGLE_INSTANCE_PROPERTY_TEMPLATE",
- "UNDECLARED_PROPERTIES",
- "UNREACHABLE"
- ],
- "enumDeprecated": [
- false,
- false,
- false,
- false,
- false,
- false,
- true,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false
- ],
- "enumDescriptions": [
- "Warning about failed cleanup of transient changes made by a failed operation.",
- "A link to a deprecated resource was created.",
- "When deploying and at least one of the resources has a type marked as deprecated",
- "The user created a boot disk that is larger than image size.",
- "When deploying and at least one of the resources has a type marked as experimental",
- "Warning that is present in an external api call",
- "Warning that value of a field has been overridden. Deprecated unused field.",
- "The operation involved use of an injected kernel, which is deprecated.",
- "A WEIGHTED_MAGLEV backend service is associated with a health check that is not of type HTTP/HTTPS/HTTP2.",
- "When deploying a deployment with a exceedingly large number of resources",
- "Resource can't be retrieved due to list overhead quota exceed which captures the amount of resources filtered out by user-defined list filter.",
- "A resource depends on a missing type",
- "The route's nextHopIp address is not assigned to an instance on the network.",
- "The route's next hop instance cannot ip forward.",
- "The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route.",
- "The route's nextHopInstance URL refers to an instance that does not exist.",
- "The route's nextHopInstance URL refers to an instance that is not on the same network as the route.",
- "The route's next hop instance does not have a status of RUNNING.",
- "Error which is not critical. We decided to continue the process despite the mentioned error.",
- "No results are present on a particular list page.",
- "Success is reported, but some results may be missing due to errors",
- "The user attempted to use a resource that requires a TOS they have not accepted.",
- "Warning that a resource is in use.",
- "One or more of the resources set to auto-delete could not be deleted because they were in use.",
- "When a resource schema validation is ignored.",
- "Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group.",
- "When undeclared properties in the schema are present",
- "A given scope cannot be reached."
- ],
- "type": "string"
- },
- "data": {
- "description": "[Output Only] Metadata about this warning in key: value format. For example: \"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" } ",
- "items": {
- "properties": {
- "key": {
- "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).",
- "type": "string"
- },
- "value": {
- "description": "[Output Only] A warning data value corresponding to the key.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "type": "array"
- },
- "message": {
- "description": "[Output Only] A human-readable description of the warning code.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "type": "array"
+ "uptimeSeconds": {
+ "description": "Time this session has been up, in seconds. Format: 145",
+ "type": "string"
}
},
"type": "object"
},
- "RouteAsPath": {
- "id": "RouteAsPath",
+ "RouterStatusNatStatus": {
+ "description": "Status of a NAT contained in this router.",
+ "id": "RouterStatusNatStatus",
"properties": {
- "asLists": {
- "description": "[Output Only] The AS numbers of the AS Path.",
+ "autoAllocatedNatIps": {
+ "description": "A list of IPs auto-allocated for NAT. Example: [\"1.1.1.1\", \"129.2.16.89\"]",
"items": {
- "format": "uint32",
- "type": "integer"
+ "type": "string"
},
"type": "array"
},
- "pathSegmentType": {
- "description": "[Output Only] The type of the AS Path, which can be one of the following values: - 'AS_SET': unordered set of autonomous systems that the route in has traversed - 'AS_SEQUENCE': ordered set of autonomous systems that the route has traversed - 'AS_CONFED_SEQUENCE': ordered set of Member Autonomous Systems in the local confederation that the route has traversed - 'AS_CONFED_SET': unordered set of Member Autonomous Systems in the local confederation that the route has traversed ",
- "enum": [
- "AS_CONFED_SEQUENCE",
- "AS_CONFED_SET",
- "AS_SEQUENCE",
- "AS_SET"
- ],
- "enumDescriptions": [
- "",
- "",
- "",
- ""
- ],
- "type": "string"
- }
- },
- "type": "object"
- },
- "RouteList": {
- "description": "Contains a list of Route resources.",
- "id": "RouteList",
- "properties": {
- "id": {
- "description": "[Output Only] Unique identifier for the resource; defined by the server.",
- "type": "string"
- },
- "items": {
- "description": "A list of Route resources.",
+ "drainAutoAllocatedNatIps": {
+ "description": "A list of IPs auto-allocated for NAT that are in drain mode. Example: [\"1.1.1.1\", \"179.12.26.133\"].",
"items": {
- "$ref": "Route"
+ "type": "string"
},
"type": "array"
},
- "kind": {
- "default": "compute#routeList",
- "description": "Type of resource.",
- "type": "string"
- },
- "nextPageToken": {
- "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
- "type": "string"
- },
- "selfLink": {
- "description": "[Output Only] Server-defined URL for this resource.",
- "type": "string"
- },
- "warning": {
- "description": "[Output Only] Informational warning message.",
- "properties": {
- "code": {
- "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.",
- "enum": [
- "CLEANUP_FAILED",
- "DEPRECATED_RESOURCE_USED",
- "DEPRECATED_TYPE_USED",
- "DISK_SIZE_LARGER_THAN_IMAGE_SIZE",
- "EXPERIMENTAL_TYPE_USED",
- "EXTERNAL_API_WARNING",
- "FIELD_VALUE_OVERRIDEN",
- "INJECTED_KERNELS_DEPRECATED",
- "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB",
- "LARGE_DEPLOYMENT_WARNING",
- "LIST_OVERHEAD_QUOTA_EXCEED",
- "MISSING_TYPE_DEPENDENCY",
- "NEXT_HOP_ADDRESS_NOT_ASSIGNED",
- "NEXT_HOP_CANNOT_IP_FORWARD",
- "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE",
- "NEXT_HOP_INSTANCE_NOT_FOUND",
- "NEXT_HOP_INSTANCE_NOT_ON_NETWORK",
- "NEXT_HOP_NOT_RUNNING",
- "NOT_CRITICAL_ERROR",
- "NO_RESULTS_ON_PAGE",
- "PARTIAL_SUCCESS",
- "REQUIRED_TOS_AGREEMENT",
- "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING",
- "RESOURCE_NOT_DELETED",
- "SCHEMA_VALIDATION_IGNORED",
- "SINGLE_INSTANCE_PROPERTY_TEMPLATE",
- "UNDECLARED_PROPERTIES",
- "UNREACHABLE"
- ],
- "enumDeprecated": [
- false,
- false,
- false,
- false,
- false,
- false,
- true,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false
- ],
- "enumDescriptions": [
- "Warning about failed cleanup of transient changes made by a failed operation.",
- "A link to a deprecated resource was created.",
- "When deploying and at least one of the resources has a type marked as deprecated",
- "The user created a boot disk that is larger than image size.",
- "When deploying and at least one of the resources has a type marked as experimental",
- "Warning that is present in an external api call",
- "Warning that value of a field has been overridden. Deprecated unused field.",
- "The operation involved use of an injected kernel, which is deprecated.",
- "A WEIGHTED_MAGLEV backend service is associated with a health check that is not of type HTTP/HTTPS/HTTP2.",
- "When deploying a deployment with a exceedingly large number of resources",
- "Resource can't be retrieved due to list overhead quota exceed which captures the amount of resources filtered out by user-defined list filter.",
- "A resource depends on a missing type",
- "The route's nextHopIp address is not assigned to an instance on the network.",
- "The route's next hop instance cannot ip forward.",
- "The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route.",
- "The route's nextHopInstance URL refers to an instance that does not exist.",
- "The route's nextHopInstance URL refers to an instance that is not on the same network as the route.",
- "The route's next hop instance does not have a status of RUNNING.",
- "Error which is not critical. We decided to continue the process despite the mentioned error.",
- "No results are present on a particular list page.",
- "Success is reported, but some results may be missing due to errors",
- "The user attempted to use a resource that requires a TOS they have not accepted.",
- "Warning that a resource is in use.",
- "One or more of the resources set to auto-delete could not be deleted because they were in use.",
- "When a resource schema validation is ignored.",
- "Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group.",
- "When undeclared properties in the schema are present",
- "A given scope cannot be reached."
- ],
- "type": "string"
- },
- "data": {
- "description": "[Output Only] Metadata about this warning in key: value format. For example: \"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" } ",
- "items": {
- "properties": {
- "key": {
- "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).",
- "type": "string"
- },
- "value": {
- "description": "[Output Only] A warning data value corresponding to the key.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "type": "array"
- },
- "message": {
- "description": "[Output Only] A human-readable description of the warning code.",
- "type": "string"
- }
- },
- "type": "object"
- }
- },
- "type": "object"
- },
- "Router": {
- "description": "Represents a Cloud Router resource. For more information about Cloud Router, read the Cloud Router overview.",
- "id": "Router",
- "properties": {
- "bgp": {
- "$ref": "RouterBgp",
- "description": "BGP information specific to this router."
- },
- "bgpPeers": {
- "description": "BGP information that must be configured into the routing stack to establish BGP peering. This information must specify the peer ASN and either the interface name, IP address, or peer IP address. Please refer to RFC4273.",
+ "drainUserAllocatedNatIps": {
+ "description": "A list of IPs user-allocated for NAT that are in drain mode. Example: [\"1.1.1.1\", \"179.12.26.133\"].",
"items": {
- "$ref": "RouterBgpPeer"
+ "type": "string"
},
"type": "array"
},
- "creationTimestamp": {
- "description": "[Output Only] Creation timestamp in RFC3339 text format.",
- "type": "string"
+ "minExtraNatIpsNeeded": {
+ "description": "The number of extra IPs to allocate. This will be greater than 0 only if user-specified IPs are NOT enough to allow all configured VMs to use NAT. This value is meaningful only when auto-allocation of NAT IPs is *not* used.",
+ "format": "int32",
+ "type": "integer"
},
- "description": {
- "description": "An optional description of this resource. Provide this property when you create the resource.",
+ "name": {
+ "description": "Unique name of this NAT.",
"type": "string"
},
- "encryptedInterconnectRouter": {
- "description": "Indicates if a router is dedicated for use with encrypted VLAN attachments (interconnectAttachments).",
- "type": "boolean"
- },
- "id": {
- "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.",
- "format": "uint64",
- "type": "string"
+ "numVmEndpointsWithNatMappings": {
+ "description": "Number of VM endpoints (i.e., Nics) that can use NAT.",
+ "format": "int32",
+ "type": "integer"
},
- "interfaces": {
- "description": "Router interfaces. To create a BGP peer that uses a router interface, the interface must have one of the following fields specified: - linkedVpnTunnel - linkedInterconnectAttachment - subnetwork You can create a router interface without any of these fields specified. However, you cannot create a BGP peer that uses that interface.",
+ "ruleStatus": {
+ "description": "Status of rules in this NAT.",
"items": {
- "$ref": "RouterInterface"
+ "$ref": "RouterStatusNatStatusNatRuleStatus"
},
"type": "array"
},
- "kind": {
- "default": "compute#router",
- "description": "[Output Only] Type of resource. Always compute#router for routers.",
- "type": "string"
- },
- "md5AuthenticationKeys": {
- "description": "Keys used for MD5 authentication.",
+ "userAllocatedNatIpResources": {
+ "description": "A list of fully qualified URLs of reserved IP address resources.",
"items": {
- "$ref": "RouterMd5AuthenticationKey"
+ "type": "string"
},
"type": "array"
},
- "name": {
- "annotations": {
- "required": [
- "compute.routers.insert"
- ]
+ "userAllocatedNatIps": {
+ "description": "A list of IPs user-allocated for NAT. They will be raw IP strings like \"179.12.26.133\".",
+ "items": {
+ "type": "string"
},
- "description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- "type": "string"
- },
- "nats": {
- "description": "A list of NAT services created in this router.",
+ "type": "array"
+ }
+ },
+ "type": "object"
+ },
+ "RouterStatusNatStatusNatRuleStatus": {
+ "description": "Status of a NAT Rule contained in this NAT.",
+ "id": "RouterStatusNatStatusNatRuleStatus",
+ "properties": {
+ "activeNatIps": {
+ "description": "A list of active IPs for NAT. Example: [\"1.1.1.1\", \"179.12.26.133\"].",
"items": {
- "$ref": "RouterNat"
+ "type": "string"
},
"type": "array"
},
- "network": {
- "annotations": {
- "required": [
- "compute.routers.insert",
- "compute.routers.update"
- ]
+ "drainNatIps": {
+ "description": "A list of IPs for NAT that are in drain mode. Example: [\"1.1.1.1\", \"179.12.26.133\"].",
+ "items": {
+ "type": "string"
},
- "description": "URI of the network to which this router belongs.",
- "type": "string"
+ "type": "array"
},
- "region": {
- "description": "[Output Only] URI of the region where the router resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.",
- "type": "string"
+ "minExtraIpsNeeded": {
+ "description": "The number of extra IPs to allocate. This will be greater than 0 only if the existing IPs in this NAT Rule are NOT enough to allow all configured VMs to use NAT.",
+ "format": "int32",
+ "type": "integer"
},
- "selfLink": {
- "description": "[Output Only] Server-defined URL for the resource.",
+ "numVmEndpointsWithNatMappings": {
+ "description": "Number of VM endpoints (i.e., NICs) that have NAT Mappings from this NAT Rule.",
+ "format": "int32",
+ "type": "integer"
+ },
+ "ruleNumber": {
+ "description": "Rule number of the rule.",
+ "format": "int32",
+ "type": "integer"
+ }
+ },
+ "type": "object"
+ },
+ "RouterStatusResponse": {
+ "id": "RouterStatusResponse",
+ "properties": {
+ "kind": {
+ "default": "compute#routerStatusResponse",
+ "description": "Type of resource.",
"type": "string"
+ },
+ "result": {
+ "$ref": "RouterStatus"
}
},
"type": "object"
},
- "RouterAdvertisedIpRange": {
- "description": "Description-tagged IP ranges for the router to advertise.",
- "id": "RouterAdvertisedIpRange",
+ "RoutersPreviewResponse": {
+ "id": "RoutersPreviewResponse",
"properties": {
- "description": {
- "description": "User-specified description for the IP range.",
- "type": "string"
- },
- "range": {
- "description": "The IP range to advertise. The value must be a CIDR-formatted string.",
- "type": "string"
+ "resource": {
+ "$ref": "Router",
+ "description": "Preview of given router."
}
},
"type": "object"
},
- "RouterAggregatedList": {
- "description": "Contains a list of routers.",
- "id": "RouterAggregatedList",
+ "RoutersScopedList": {
+ "id": "RoutersScopedList",
"properties": {
- "id": {
- "description": "[Output Only] Unique identifier for the resource; defined by the server.",
- "type": "string"
- },
- "items": {
- "additionalProperties": {
- "$ref": "RoutersScopedList",
- "description": "Name of the scope containing this set of routers."
- },
- "description": "A list of Router resources.",
- "type": "object"
- },
- "kind": {
- "default": "compute#routerAggregatedList",
- "description": "Type of resource.",
- "type": "string"
- },
- "nextPageToken": {
- "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
- "type": "string"
- },
- "selfLink": {
- "description": "[Output Only] Server-defined URL for this resource.",
- "type": "string"
- },
- "unreachables": {
- "description": "[Output Only] Unreachable resources.",
+ "routers": {
+ "description": "A list of routers contained in this scope.",
"items": {
- "type": "string"
+ "$ref": "Router"
},
"type": "array"
},
"warning": {
- "description": "[Output Only] Informational warning message.",
+ "description": "Informational warning which replaces the list of routers when the list is empty.",
"properties": {
"code": {
"description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.",
@@ -66300,14 +70954,37 @@
},
"type": "object"
},
- "RouterBgp": {
- "id": "RouterBgp",
+ "SSLHealthCheck": {
+ "id": "SSLHealthCheck",
"properties": {
- "advertiseMode": {
- "description": "User-specified flag to indicate which mode to use for advertisement. The options are DEFAULT or CUSTOM.",
+ "port": {
+ "description": "The TCP port number to which the health check prober sends packets. The default value is 443. Valid values are 1 through 65535.",
+ "format": "int32",
+ "type": "integer"
+ },
+ "portName": {
+ "description": "Not supported.",
+ "type": "string"
+ },
+ "portSpecification": {
+ "description": "Specifies how a port is selected for health checking. Can be one of the following values: USE_FIXED_PORT: Specifies a port number explicitly using the port field in the health check. Supported by backend services for passthrough load balancers and backend services for proxy load balancers. Not supported by target pools. The health check supports all backends supported by the backend service provided the backend can be health checked. For example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT network endpoint groups, and instance group backends. USE_NAMED_PORT: Not supported. USE_SERVING_PORT: Provides an indirect method of specifying the health check port by referring to the backend service. Only supported by backend services for proxy load balancers. Not supported by target pools. Not supported by backend services for passthrough load balancers. Supports all backends that can be health checked; for example, GCE_VM_IP_PORT network endpoint groups and instance group backends. For GCE_VM_IP_PORT network endpoint group backends, the health check uses the port number specified for each endpoint in the network endpoint group. For instance group backends, the health check uses the port number determined by looking up the backend service's named port in the instance group's list of named ports.",
"enum": [
- "CUSTOM",
- "DEFAULT"
+ "USE_FIXED_PORT",
+ "USE_NAMED_PORT",
+ "USE_SERVING_PORT"
+ ],
+ "enumDescriptions": [
+ "The port number in the health check's port is used for health checking. Applies to network endpoint group and instance group backends.",
+ "Not supported.",
+ "For network endpoint group backends, the health check uses the port number specified on each endpoint in the network endpoint group. For instance group backends, the health check uses the port number specified for the backend service's named port defined in the instance group's named ports."
+ ],
+ "type": "string"
+ },
+ "proxyHeader": {
+ "description": "Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE.",
+ "enum": [
+ "NONE",
+ "PROXY_V1"
],
"enumDescriptions": [
"",
@@ -66315,100 +70992,63 @@
],
"type": "string"
},
- "advertisedGroups": {
- "description": "User-specified list of prefix groups to advertise in custom mode. This field can only be populated if advertise_mode is CUSTOM and is advertised to all peers of the router. These groups will be advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups.",
- "items": {
- "enum": [
- "ALL_SUBNETS"
- ],
- "enumDescriptions": [
- "Advertise all available subnets (including peer VPC subnets)."
- ],
- "type": "string"
- },
- "type": "array"
- },
- "advertisedIpRanges": {
- "description": "User-specified list of individual IP ranges to advertise in custom mode. This field can only be populated if advertise_mode is CUSTOM and is advertised to all peers of the router. These IP ranges will be advertised in addition to any specified groups. Leave this field blank to advertise no custom IP ranges.",
- "items": {
- "$ref": "RouterAdvertisedIpRange"
- },
- "type": "array"
- },
- "asn": {
- "description": "Local BGP Autonomous System Number (ASN). Must be an RFC6996 private ASN, either 16-bit or 32-bit. The value will be fixed for this router resource. All VPN tunnels that link to this router will have the same local ASN.",
- "format": "uint32",
- "type": "integer"
+ "request": {
+ "description": "Instructs the health check prober to send this exact ASCII string, up to 1024 bytes in length, after establishing the TCP connection and SSL handshake.",
+ "type": "string"
},
- "keepaliveInterval": {
- "description": "The interval in seconds between BGP keepalive messages that are sent to the peer. Hold time is three times the interval at which keepalive messages are sent, and the hold time is the maximum number of seconds allowed to elapse between successive keepalive messages that BGP receives from a peer. BGP will use the smaller of either the local hold time value or the peer's hold time value as the hold time for the BGP connection between the two peers. If set, this value must be between 20 and 60. The default is 20.",
- "format": "uint32",
- "type": "integer"
+ "response": {
+ "description": "Creates a content-based SSL health check. In addition to establishing a TCP connection and the TLS handshake, you can configure the health check to pass only when the backend sends this exact response ASCII string, up to 1024 bytes in length. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#criteria-protocol-ssl-tcp",
+ "type": "string"
}
},
"type": "object"
},
- "RouterBgpPeer": {
- "id": "RouterBgpPeer",
+ "SavedAttachedDisk": {
+ "description": "DEPRECATED: Please use compute#savedDisk instead. An instance-attached disk resource.",
+ "id": "SavedAttachedDisk",
"properties": {
- "advertiseMode": {
- "description": "User-specified flag to indicate which mode to use for advertisement.",
- "enum": [
- "CUSTOM",
- "DEFAULT"
- ],
- "enumDescriptions": [
- "",
- ""
- ],
- "type": "string"
+ "autoDelete": {
+ "description": "Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance).",
+ "type": "boolean"
},
- "advertisedGroups": {
- "description": "User-specified list of prefix groups to advertise in custom mode, which currently supports the following option: - ALL_SUBNETS: Advertises all of the router's own VPC subnets. This excludes any routes learned for subnets that use VPC Network Peering. Note that this field can only be populated if advertise_mode is CUSTOM and overrides the list defined for the router (in the \"bgp\" message). These groups are advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups.",
- "items": {
- "enum": [
- "ALL_SUBNETS"
- ],
- "enumDescriptions": [
- "Advertise all available subnets (including peer VPC subnets)."
- ],
- "type": "string"
- },
- "type": "array"
+ "boot": {
+ "description": "Indicates that this is a boot disk. The virtual machine will use the first partition of the disk for its root filesystem.",
+ "type": "boolean"
},
- "advertisedIpRanges": {
- "description": "User-specified list of individual IP ranges to advertise in custom mode. This field can only be populated if advertise_mode is CUSTOM and overrides the list defined for the router (in the \"bgp\" message). These IP ranges are advertised in addition to any specified groups. Leave this field blank to advertise no custom IP ranges.",
- "items": {
- "$ref": "RouterAdvertisedIpRange"
- },
- "type": "array"
+ "deviceName": {
+ "description": "Specifies the name of the disk attached to the source instance.",
+ "type": "string"
},
- "advertisedRoutePriority": {
- "description": "The priority of routes advertised to this BGP peer. Where there is more than one matching route of maximum length, the routes with the lowest priority value win.",
- "format": "uint32",
- "type": "integer"
+ "diskEncryptionKey": {
+ "$ref": "CustomerEncryptionKey",
+ "description": "The encryption key for the disk."
},
- "bfd": {
- "$ref": "RouterBgpPeerBfd",
- "description": "BFD configuration for the BGP peering."
+ "diskSizeGb": {
+ "description": "The size of the disk in base-2 GB.",
+ "format": "int64",
+ "type": "string"
},
- "customLearnedIpRanges": {
- "description": "A list of user-defined custom learned route IP address ranges for a BGP session.",
+ "diskType": {
+ "description": "[Output Only] URL of the disk type resource. For example: projects/project /zones/zone/diskTypes/pd-standard or pd-ssd",
+ "type": "string"
+ },
+ "guestOsFeatures": {
+ "description": "A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options.",
"items": {
- "$ref": "RouterBgpPeerCustomLearnedIpRange"
+ "$ref": "GuestOsFeature"
},
"type": "array"
},
- "customLearnedRoutePriority": {
- "description": "The user-defined custom learned route priority for a BGP session. This value is applied to all custom learned route ranges for the session. You can choose a value from `0` to `65335`. If you don't provide a value, Google Cloud assigns a priority of `100` to the ranges.",
+ "index": {
+ "description": "Specifies zero-based index of the disk that is attached to the source instance.",
"format": "int32",
"type": "integer"
},
- "enable": {
- "description": "The status of the BGP peer connection. If set to FALSE, any active session with the peer is terminated and all associated routing information is removed. If set to TRUE, the peer connection can be established with routing information. The default is TRUE.",
+ "interface": {
+ "description": "Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME.",
"enum": [
- "FALSE",
- "TRUE"
+ "NVME",
+ "SCSI"
],
"enumDescriptions": [
"",
@@ -66416,100 +71056,105 @@
],
"type": "string"
},
- "enableIpv6": {
- "description": "Enable IPv6 traffic over BGP Peer. If not specified, it is disabled by default.",
- "type": "boolean"
- },
- "interfaceName": {
- "description": "Name of the interface the BGP peer is associated with.",
- "type": "string"
- },
- "ipAddress": {
- "description": "IP address of the interface inside Google Cloud Platform. Only IPv4 is supported.",
+ "kind": {
+ "default": "compute#savedAttachedDisk",
+ "description": "[Output Only] Type of the resource. Always compute#attachedDisk for attached disks.",
"type": "string"
},
- "ipv6NexthopAddress": {
- "description": "IPv6 address of the interface inside Google Cloud Platform.",
- "type": "string"
+ "licenses": {
+ "description": "[Output Only] Any valid publicly visible licenses.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
},
- "managementType": {
- "description": "[Output Only] The resource that configures and manages this BGP peer. - MANAGED_BY_USER is the default value and can be managed by you or other users - MANAGED_BY_ATTACHMENT is a BGP peer that is configured and managed by Cloud Interconnect, specifically by an InterconnectAttachment of type PARTNER. Google automatically creates, updates, and deletes this type of BGP peer when the PARTNER InterconnectAttachment is created, updated, or deleted. ",
+ "mode": {
+ "description": "The mode in which this disk is attached to the source instance, either READ_WRITE or READ_ONLY.",
"enum": [
- "MANAGED_BY_ATTACHMENT",
- "MANAGED_BY_USER"
+ "READ_ONLY",
+ "READ_WRITE"
],
"enumDescriptions": [
- "The BGP peer is automatically created for PARTNER type InterconnectAttachment; Google will automatically create/delete this BGP peer when the PARTNER InterconnectAttachment is created/deleted, and Google will update the ipAddress and peerIpAddress when the PARTNER InterconnectAttachment is provisioned. This type of BGP peer cannot be created or deleted, but can be modified for all fields except for name, ipAddress and peerIpAddress.",
- "Default value, the BGP peer is manually created and managed by user."
+ "Attaches this disk in read-only mode. Multiple virtual machines can use a disk in read-only mode at a time.",
+ "*[Default]* Attaches this disk in read-write mode. Only one virtual machine at a time can be attached to a disk in read-write mode."
],
"type": "string"
},
- "md5AuthenticationKeyName": {
- "description": "Present if MD5 authentication is enabled for the peering. Must be the name of one of the entries in the Router.md5_authentication_keys. The field must comply with RFC1035.",
- "type": "string"
- },
- "name": {
- "annotations": {
- "required": [
- "compute.routers.insert"
- ]
- },
- "description": "Name of this BGP peer. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "source": {
+ "description": "Specifies a URL of the disk attached to the source instance.",
"type": "string"
},
- "peerAsn": {
- "annotations": {
- "required": [
- "compute.routers.insert"
- ]
- },
- "description": "Peer BGP Autonomous System Number (ASN). Each BGP interface may use a different value.",
- "format": "uint32",
- "type": "integer"
- },
- "peerIpAddress": {
- "description": "IP address of the BGP interface outside Google Cloud Platform. Only IPv4 is supported.",
+ "storageBytes": {
+ "description": "[Output Only] A size of the storage used by the disk's snapshot by this machine image.",
+ "format": "int64",
"type": "string"
},
- "peerIpv6NexthopAddress": {
- "description": "IPv6 address of the BGP interface outside Google Cloud Platform.",
+ "storageBytesStatus": {
+ "description": "[Output Only] An indicator whether storageBytes is in a stable state or it is being adjusted as a result of shared storage reallocation. This status can either be UPDATING, meaning the size of the snapshot is being updated, or UP_TO_DATE, meaning the size of the snapshot is up-to-date.",
+ "enum": [
+ "UPDATING",
+ "UP_TO_DATE"
+ ],
+ "enumDescriptions": [
+ "",
+ ""
+ ],
"type": "string"
},
- "routerApplianceInstance": {
- "description": "URI of the VM instance that is used as third-party router appliances such as Next Gen Firewalls, Virtual Routers, or Router Appliances. The VM instance must be located in zones contained in the same region as this Cloud Router. The VM instance is the peer side of the BGP session.",
+ "type": {
+ "description": "Specifies the type of the attached disk, either SCRATCH or PERSISTENT.",
+ "enum": [
+ "PERSISTENT",
+ "SCRATCH"
+ ],
+ "enumDescriptions": [
+ "",
+ ""
+ ],
"type": "string"
}
},
"type": "object"
},
- "RouterBgpPeerBfd": {
- "id": "RouterBgpPeerBfd",
+ "SavedDisk": {
+ "description": "An instance-attached disk resource.",
+ "id": "SavedDisk",
"properties": {
- "minReceiveInterval": {
- "description": "The minimum interval, in milliseconds, between BFD control packets received from the peer router. The actual value is negotiated between the two routers and is equal to the greater of this value and the transmit interval of the other router. If set, this value must be between 1000 and 30000. The default is 1000.",
- "format": "uint32",
- "type": "integer"
+ "architecture": {
+ "description": "[Output Only] The architecture of the attached disk.",
+ "enum": [
+ "ARCHITECTURE_UNSPECIFIED",
+ "ARM64",
+ "X86_64"
+ ],
+ "enumDescriptions": [
+ "Default value indicating Architecture is not set.",
+ "Machines with architecture ARM64",
+ "Machines with architecture X86_64"
+ ],
+ "type": "string"
},
- "minTransmitInterval": {
- "description": "The minimum interval, in milliseconds, between BFD control packets transmitted to the peer router. The actual value is negotiated between the two routers and is equal to the greater of this value and the corresponding receive interval of the other router. If set, this value must be between 1000 and 30000. The default is 1000.",
- "format": "uint32",
- "type": "integer"
+ "kind": {
+ "default": "compute#savedDisk",
+ "description": "[Output Only] Type of the resource. Always compute#savedDisk for attached disks.",
+ "type": "string"
},
- "multiplier": {
- "description": "The number of consecutive BFD packets that must be missed before BFD declares that a peer is unavailable. If set, the value must be a value between 5 and 16. The default is 5.",
- "format": "uint32",
- "type": "integer"
+ "sourceDisk": {
+ "description": "Specifies a URL of the disk attached to the source instance.",
+ "type": "string"
},
- "sessionInitializationMode": {
- "description": "The BFD session initialization mode for this BGP peer. If set to ACTIVE, the Cloud Router will initiate the BFD session for this BGP peer. If set to PASSIVE, the Cloud Router will wait for the peer router to initiate the BFD session for this BGP peer. If set to DISABLED, BFD is disabled for this BGP peer. The default is DISABLED.",
+ "storageBytes": {
+ "description": "[Output Only] Size of the individual disk snapshot used by this machine image.",
+ "format": "int64",
+ "type": "string"
+ },
+ "storageBytesStatus": {
+ "description": "[Output Only] An indicator whether storageBytes is in a stable state or it is being adjusted as a result of shared storage reallocation. This status can either be UPDATING, meaning the size of the snapshot is being updated, or UP_TO_DATE, meaning the size of the snapshot is up-to-date.",
"enum": [
- "ACTIVE",
- "DISABLED",
- "PASSIVE"
+ "UPDATING",
+ "UP_TO_DATE"
],
"enumDescriptions": [
- "",
"",
""
],
@@ -66518,87 +71163,205 @@
},
"type": "object"
},
- "RouterBgpPeerCustomLearnedIpRange": {
- "id": "RouterBgpPeerCustomLearnedIpRange",
+ "ScalingScheduleStatus": {
+ "id": "ScalingScheduleStatus",
"properties": {
- "range": {
- "description": "The custom learned route IP address range. Must be a valid CIDR-formatted prefix. If an IP address is provided without a subnet mask, it is interpreted as, for IPv4, a `/32` singular IP address range, and, for IPv6, `/128`.",
+ "lastStartTime": {
+ "description": "[Output Only] The last time the scaling schedule became active. Note: this is a timestamp when a schedule actually became active, not when it was planned to do so. The timestamp is in RFC3339 text format.",
+ "type": "string"
+ },
+ "nextStartTime": {
+ "description": "[Output Only] The next time the scaling schedule is to become active. Note: this is a timestamp when a schedule is planned to run, but the actual time might be slightly different. The timestamp is in RFC3339 text format.",
+ "type": "string"
+ },
+ "state": {
+ "description": "[Output Only] The current state of a scaling schedule.",
+ "enum": [
+ "ACTIVE",
+ "DISABLED",
+ "OBSOLETE",
+ "READY"
+ ],
+ "enumDescriptions": [
+ "The current autoscaling recommendation is influenced by this scaling schedule.",
+ "This scaling schedule has been disabled by the user.",
+ "This scaling schedule will never become active again.",
+ "The current autoscaling recommendation is not influenced by this scaling schedule."
+ ],
"type": "string"
}
},
"type": "object"
},
- "RouterInterface": {
- "id": "RouterInterface",
+ "Scheduling": {
+ "description": "Sets the scheduling options for an Instance.",
+ "id": "Scheduling",
"properties": {
- "ipRange": {
- "description": "IP address and range of the interface. The IP range must be in the RFC3927 link-local IP address space. The value must be a CIDR-formatted string, for example: 169.254.0.1/30. NOTE: Do not truncate the address as it represents the IP address of the interface.",
+ "automaticRestart": {
+ "description": "Specifies whether the instance should be automatically restarted if it is terminated by Compute Engine (not terminated by a user). You can only set the automatic restart option for standard instances. Preemptible instances cannot be automatically restarted. By default, this is set to true so an instance is automatically restarted if it is terminated by Compute Engine.",
+ "type": "boolean"
+ },
+ "availabilityDomain": {
+ "description": "Specifies the availability domain to place the instance in. The value must be a number between 1 and the number of availability domains specified in the spread placement policy attached to the instance.",
+ "format": "int32",
+ "type": "integer"
+ },
+ "instanceTerminationAction": {
+ "description": "Specifies the termination action for the instance.",
+ "enum": [
+ "DELETE",
+ "INSTANCE_TERMINATION_ACTION_UNSPECIFIED",
+ "STOP"
+ ],
+ "enumDescriptions": [
+ "Delete the VM.",
+ "Default value. This value is unused.",
+ "Stop the VM without storing in-memory content. default action."
+ ],
"type": "string"
},
- "linkedInterconnectAttachment": {
- "description": "URI of the linked Interconnect attachment. It must be in the same region as the router. Each interface can have one linked resource, which can be a VPN tunnel, an Interconnect attachment, or a subnetwork.",
+ "localSsdRecoveryTimeout": {
+ "$ref": "Duration",
+ "description": "Specifies the maximum amount of time a Local Ssd Vm should wait while recovery of the Local Ssd state is attempted. Its value should be in between 0 and 168 hours with hour granularity and the default value being 1 hour."
+ },
+ "locationHint": {
+ "description": "An opaque location hint used to place the instance close to other resources. This field is for use by internal tools that use the public API.",
"type": "string"
},
- "linkedVpnTunnel": {
- "description": "URI of the linked VPN tunnel, which must be in the same region as the router. Each interface can have one linked resource, which can be a VPN tunnel, an Interconnect attachment, or a subnetwork.",
+ "maxRunDuration": {
+ "$ref": "Duration",
+ "description": "Specifies the max run duration for the given instance. If specified, the instance termination action will be performed at the end of the run duration."
+ },
+ "minNodeCpus": {
+ "description": "The minimum number of virtual CPUs this instance will consume when running on a sole-tenant node.",
+ "format": "int32",
+ "type": "integer"
+ },
+ "nodeAffinities": {
+ "description": "A set of node affinity and anti-affinity configurations. Refer to Configuring node affinity for more information. Overrides reservationAffinity.",
+ "items": {
+ "$ref": "SchedulingNodeAffinity"
+ },
+ "type": "array"
+ },
+ "onHostMaintenance": {
+ "description": "Defines the maintenance behavior for this instance. For standard instances, the default behavior is MIGRATE. For preemptible instances, the default and only possible behavior is TERMINATE. For more information, see Set VM host maintenance policy.",
+ "enum": [
+ "MIGRATE",
+ "TERMINATE"
+ ],
+ "enumDescriptions": [
+ "*[Default]* Allows Compute Engine to automatically migrate instances out of the way of maintenance events.",
+ "Tells Compute Engine to terminate and (optionally) restart the instance away from the maintenance activity. If you would like your instance to be restarted, set the automaticRestart flag to true. Your instance may be restarted more than once, and it may be restarted outside the window of maintenance events."
+ ],
"type": "string"
},
- "managementType": {
- "description": "[Output Only] The resource that configures and manages this interface. - MANAGED_BY_USER is the default value and can be managed directly by users. - MANAGED_BY_ATTACHMENT is an interface that is configured and managed by Cloud Interconnect, specifically, by an InterconnectAttachment of type PARTNER. Google automatically creates, updates, and deletes this type of interface when the PARTNER InterconnectAttachment is created, updated, or deleted. ",
+ "onInstanceStopAction": {
+ "$ref": "SchedulingOnInstanceStopAction"
+ },
+ "preemptible": {
+ "description": "Defines whether the instance is preemptible. This can only be set during instance creation or while the instance is stopped and therefore, in a `TERMINATED` state. See Instance Life Cycle for more information on the possible instance states.",
+ "type": "boolean"
+ },
+ "provisioningModel": {
+ "description": "Specifies the provisioning model of the instance.",
"enum": [
- "MANAGED_BY_ATTACHMENT",
- "MANAGED_BY_USER"
+ "SPOT",
+ "STANDARD"
],
"enumDescriptions": [
- "The interface is automatically created for PARTNER type InterconnectAttachment, Google will automatically create/update/delete this interface when the PARTNER InterconnectAttachment is created/provisioned/deleted. This type of interface cannot be manually managed by user.",
- "Default value, the interface is manually created and managed by user."
+ "Heavily discounted, no guaranteed runtime.",
+ "Standard provisioning with user controlled runtime, no discounts."
],
"type": "string"
},
- "name": {
- "annotations": {
- "required": [
- "compute.routers.insert"
- ]
- },
- "description": "Name of this interface entry. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "terminationTime": {
+ "description": "Specifies the timestamp, when the instance will be terminated, in RFC3339 text format. If specified, the instance termination action will be performed at the termination time.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "SchedulingNodeAffinity": {
+ "description": "Node Affinity: the configuration of desired nodes onto which this Instance could be scheduled.",
+ "id": "SchedulingNodeAffinity",
+ "properties": {
+ "key": {
+ "description": "Corresponds to the label key of Node resource.",
"type": "string"
},
- "privateIpAddress": {
- "description": "The regional private internal IP address that is used to establish BGP sessions to a VM instance acting as a third-party Router Appliance, such as a Next Gen Firewall, a Virtual Router, or an SD-WAN VM.",
+ "operator": {
+ "description": "Defines the operation of node selection. Valid operators are IN for affinity and NOT_IN for anti-affinity.",
+ "enum": [
+ "IN",
+ "NOT_IN",
+ "OPERATOR_UNSPECIFIED"
+ ],
+ "enumDescriptions": [
+ "Requires Compute Engine to seek for matched nodes.",
+ "Requires Compute Engine to avoid certain nodes.",
+ ""
+ ],
"type": "string"
},
- "redundantInterface": {
- "description": "Name of the interface that will be redundant with the current interface you are creating. The redundantInterface must belong to the same Cloud Router as the interface here. To establish the BGP session to a Router Appliance VM, you must create two BGP peers. The two BGP peers must be attached to two separate interfaces that are redundant with each other. The redundant_interface must be 1-63 characters long, and comply with RFC1035. Specifically, the redundant_interface must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "values": {
+ "description": "Corresponds to the label values of Node resource.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ }
+ },
+ "type": "object"
+ },
+ "SchedulingOnInstanceStopAction": {
+ "description": "Defines the behaviour for instances with the instance_termination_action STOP.",
+ "id": "SchedulingOnInstanceStopAction",
+ "properties": {
+ "discardLocalSsd": {
+ "description": "If true, the contents of any attached Local SSD disks will be discarded else, the Local SSD data will be preserved when the instance is stopped at the end of the run duration/termination time.",
+ "type": "boolean"
+ }
+ },
+ "type": "object"
+ },
+ "Screenshot": {
+ "description": "An instance's screenshot.",
+ "id": "Screenshot",
+ "properties": {
+ "contents": {
+ "description": "[Output Only] The Base64-encoded screenshot data.",
"type": "string"
},
- "subnetwork": {
- "description": "The URI of the subnetwork resource that this interface belongs to, which must be in the same region as the Cloud Router. When you establish a BGP session to a VM instance using this interface, the VM instance must belong to the same subnetwork as the subnetwork specified here.",
+ "kind": {
+ "default": "compute#screenshot",
+ "description": "[Output Only] Type of the resource. Always compute#screenshot for the screenshots.",
"type": "string"
}
},
"type": "object"
- },
- "RouterList": {
- "description": "Contains a list of Router resources.",
- "id": "RouterList",
+ },
+ "SecurityPoliciesAggregatedList": {
+ "id": "SecurityPoliciesAggregatedList",
"properties": {
+ "etag": {
+ "type": "string"
+ },
"id": {
"description": "[Output Only] Unique identifier for the resource; defined by the server.",
"type": "string"
},
"items": {
- "description": "A list of Router resources.",
- "items": {
- "$ref": "Router"
+ "additionalProperties": {
+ "$ref": "SecurityPoliciesScopedList",
+ "description": "Name of the scope containing this set of security policies."
},
- "type": "array"
+ "description": "A list of SecurityPoliciesScopedList resources.",
+ "type": "object"
},
"kind": {
- "default": "compute#routerList",
- "description": "[Output Only] Type of resource. Always compute#router for routers.",
+ "default": "compute#securityPoliciesAggregatedList",
+ "description": "[Output Only] Type of resource. Always compute#securityPolicyAggregatedList for lists of Security Policies.",
"type": "string"
},
"nextPageToken": {
@@ -66609,6 +71372,13 @@
"description": "[Output Only] Server-defined URL for this resource.",
"type": "string"
},
+ "unreachables": {
+ "description": "[Output Only] Unreachable resources.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
"warning": {
"description": "[Output Only] Informational warning message.",
"properties": {
@@ -66733,405 +71503,235 @@
},
"type": "object"
},
- "RouterMd5AuthenticationKey": {
- "id": "RouterMd5AuthenticationKey",
+ "SecurityPoliciesListPreconfiguredExpressionSetsResponse": {
+ "id": "SecurityPoliciesListPreconfiguredExpressionSetsResponse",
"properties": {
- "key": {
- "annotations": {
- "required": [
- "compute.routers.insert"
- ]
- },
- "description": "[Input only] Value of the key. For patch and update calls, it can be skipped to copy the value from the previous configuration. This is allowed if the key with the same name existed before the operation. Maximum length is 80 characters. Can only contain printable ASCII characters.",
- "type": "string"
- },
- "name": {
- "annotations": {
- "required": [
- "compute.routers.insert",
- "compute.routers.update"
- ]
- },
- "description": "Name used to identify the key. Must be unique within a router. Must be referenced by exactly one bgpPeer. Must comply with RFC1035.",
- "type": "string"
+ "preconfiguredExpressionSets": {
+ "$ref": "SecurityPoliciesWafConfig"
}
},
"type": "object"
},
- "RouterNat": {
- "description": "Represents a Nat resource. It enables the VMs within the specified subnetworks to access Internet without external IP addresses. It specifies a list of subnetworks (and the ranges within) that want to use NAT. Customers can also provide the external IPs that would be used for NAT. GCP would auto-allocate ephemeral IPs if no external IPs are provided.",
- "id": "RouterNat",
+ "SecurityPoliciesScopedList": {
+ "id": "SecurityPoliciesScopedList",
"properties": {
- "autoNetworkTier": {
- "description": "The network tier to use when automatically reserving NAT IP addresses. Must be one of: PREMIUM, STANDARD. If not specified, then the current project-level default tier is used.",
- "enum": [
- "FIXED_STANDARD",
- "PREMIUM",
- "STANDARD",
- "STANDARD_OVERRIDES_FIXED_STANDARD"
- ],
- "enumDescriptions": [
- "Public internet quality with fixed bandwidth.",
- "High quality, Google-grade network tier, support for all networking products.",
- "Public internet quality, only limited support for other networking products.",
- "(Output only) Temporary tier for FIXED_STANDARD when fixed standard tier is expired or not configured."
- ],
- "type": "string"
- },
- "drainNatIps": {
- "description": "A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT only.",
- "items": {
- "type": "string"
- },
- "type": "array"
- },
- "enableDynamicPortAllocation": {
- "description": "Enable Dynamic Port Allocation. If not specified, it is disabled by default. If set to true, - Dynamic Port Allocation will be enabled on this NAT config. - enableEndpointIndependentMapping cannot be set to true. - If minPorts is set, minPortsPerVm must be set to a power of two greater than or equal to 32. If minPortsPerVm is not set, a minimum of 32 ports will be allocated to a VM from this NAT config. ",
- "type": "boolean"
- },
- "enableEndpointIndependentMapping": {
- "type": "boolean"
- },
- "endpointTypes": {
- "description": "List of NAT-ted endpoint types supported by the Nat Gateway. If the list is empty, then it will be equivalent to include ENDPOINT_TYPE_VM",
- "items": {
- "enum": [
- "ENDPOINT_TYPE_MANAGED_PROXY_LB",
- "ENDPOINT_TYPE_SWG",
- "ENDPOINT_TYPE_VM"
- ],
- "enumDescriptions": [
- "This is used for regional Application Load Balancers (internal and external) and regional proxy Network Load Balancers (internal and external) endpoints.",
- "This is used for Secure Web Gateway endpoints.",
- "This is the default."
- ],
- "type": "string"
- },
- "type": "array"
- },
- "icmpIdleTimeoutSec": {
- "description": "Timeout (in seconds) for ICMP connections. Defaults to 30s if not set.",
- "format": "int32",
- "type": "integer"
- },
- "logConfig": {
- "$ref": "RouterNatLogConfig",
- "description": "Configure logging on this NAT."
- },
- "maxPortsPerVm": {
- "description": "Maximum number of ports allocated to a VM from this NAT config when Dynamic Port Allocation is enabled. If Dynamic Port Allocation is not enabled, this field has no effect. If Dynamic Port Allocation is enabled, and this field is set, it must be set to a power of two greater than minPortsPerVm, or 64 if minPortsPerVm is not set. If Dynamic Port Allocation is enabled and this field is not set, a maximum of 65536 ports will be allocated to a VM from this NAT config.",
- "format": "int32",
- "type": "integer"
- },
- "minPortsPerVm": {
- "description": "Minimum number of ports allocated to a VM from this NAT config. If not set, a default number of ports is allocated to a VM. This is rounded up to the nearest power of 2. For example, if the value of this field is 50, at least 64 ports are allocated to a VM.",
- "format": "int32",
- "type": "integer"
- },
- "name": {
- "description": "Unique name of this Nat service. The name must be 1-63 characters long and comply with RFC1035.",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- "type": "string"
- },
- "natIpAllocateOption": {
- "description": "Specify the NatIpAllocateOption, which can take one of the following values: - MANUAL_ONLY: Uses only Nat IP addresses provided by customers. When there are not enough specified Nat IPs, the Nat service fails for new VMs. - AUTO_ONLY: Nat IPs are allocated by Google Cloud Platform; customers can't specify any Nat IPs. When choosing AUTO_ONLY, then nat_ip should be empty. ",
- "enum": [
- "AUTO_ONLY",
- "MANUAL_ONLY"
- ],
- "enumDescriptions": [
- "Nat IPs are allocated by GCP; customers can not specify any Nat IPs.",
- "Only use Nat IPs provided by customers. When specified Nat IPs are not enough then the Nat service fails for new VMs."
- ],
- "type": "string"
- },
- "natIps": {
- "description": "A list of URLs of the IP resources used for this Nat service. These IP addresses must be valid static external IP addresses assigned to the project.",
- "items": {
- "type": "string"
- },
- "type": "array"
- },
- "rules": {
- "description": "A list of rules associated with this NAT.",
+ "securityPolicies": {
+ "description": "A list of SecurityPolicies contained in this scope.",
"items": {
- "$ref": "RouterNatRule"
+ "$ref": "SecurityPolicy"
},
"type": "array"
},
- "sourceSubnetworkIpRangesToNat": {
- "description": "Specify the Nat option, which can take one of the following values: - ALL_SUBNETWORKS_ALL_IP_RANGES: All of the IP ranges in every Subnetwork are allowed to Nat. - ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES: All of the primary IP ranges in every Subnetwork are allowed to Nat. - LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below) The default is SUBNETWORK_IP_RANGE_TO_NAT_OPTION_UNSPECIFIED. Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES then there should not be any other Router.Nat section in any Router for this network in this region.",
- "enum": [
- "ALL_SUBNETWORKS_ALL_IP_RANGES",
- "ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES",
- "LIST_OF_SUBNETWORKS"
- ],
- "enumDescriptions": [
- "All the IP ranges in every Subnetwork are allowed to Nat.",
- "All the primary IP ranges in every Subnetwork are allowed to Nat.",
- "A list of Subnetworks are allowed to Nat (specified in the field subnetwork below)"
- ],
- "type": "string"
- },
- "subnetworks": {
- "description": "A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above.",
- "items": {
- "$ref": "RouterNatSubnetworkToNat"
+ "warning": {
+ "description": "Informational warning which replaces the list of security policies when the list is empty.",
+ "properties": {
+ "code": {
+ "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.",
+ "enum": [
+ "CLEANUP_FAILED",
+ "DEPRECATED_RESOURCE_USED",
+ "DEPRECATED_TYPE_USED",
+ "DISK_SIZE_LARGER_THAN_IMAGE_SIZE",
+ "EXPERIMENTAL_TYPE_USED",
+ "EXTERNAL_API_WARNING",
+ "FIELD_VALUE_OVERRIDEN",
+ "INJECTED_KERNELS_DEPRECATED",
+ "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB",
+ "LARGE_DEPLOYMENT_WARNING",
+ "LIST_OVERHEAD_QUOTA_EXCEED",
+ "MISSING_TYPE_DEPENDENCY",
+ "NEXT_HOP_ADDRESS_NOT_ASSIGNED",
+ "NEXT_HOP_CANNOT_IP_FORWARD",
+ "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE",
+ "NEXT_HOP_INSTANCE_NOT_FOUND",
+ "NEXT_HOP_INSTANCE_NOT_ON_NETWORK",
+ "NEXT_HOP_NOT_RUNNING",
+ "NOT_CRITICAL_ERROR",
+ "NO_RESULTS_ON_PAGE",
+ "PARTIAL_SUCCESS",
+ "REQUIRED_TOS_AGREEMENT",
+ "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING",
+ "RESOURCE_NOT_DELETED",
+ "SCHEMA_VALIDATION_IGNORED",
+ "SINGLE_INSTANCE_PROPERTY_TEMPLATE",
+ "UNDECLARED_PROPERTIES",
+ "UNREACHABLE"
+ ],
+ "enumDeprecated": [
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ true,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false
+ ],
+ "enumDescriptions": [
+ "Warning about failed cleanup of transient changes made by a failed operation.",
+ "A link to a deprecated resource was created.",
+ "When deploying and at least one of the resources has a type marked as deprecated",
+ "The user created a boot disk that is larger than image size.",
+ "When deploying and at least one of the resources has a type marked as experimental",
+ "Warning that is present in an external api call",
+ "Warning that value of a field has been overridden. Deprecated unused field.",
+ "The operation involved use of an injected kernel, which is deprecated.",
+ "A WEIGHTED_MAGLEV backend service is associated with a health check that is not of type HTTP/HTTPS/HTTP2.",
+ "When deploying a deployment with a exceedingly large number of resources",
+ "Resource can't be retrieved due to list overhead quota exceed which captures the amount of resources filtered out by user-defined list filter.",
+ "A resource depends on a missing type",
+ "The route's nextHopIp address is not assigned to an instance on the network.",
+ "The route's next hop instance cannot ip forward.",
+ "The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route.",
+ "The route's nextHopInstance URL refers to an instance that does not exist.",
+ "The route's nextHopInstance URL refers to an instance that is not on the same network as the route.",
+ "The route's next hop instance does not have a status of RUNNING.",
+ "Error which is not critical. We decided to continue the process despite the mentioned error.",
+ "No results are present on a particular list page.",
+ "Success is reported, but some results may be missing due to errors",
+ "The user attempted to use a resource that requires a TOS they have not accepted.",
+ "Warning that a resource is in use.",
+ "One or more of the resources set to auto-delete could not be deleted because they were in use.",
+ "When a resource schema validation is ignored.",
+ "Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group.",
+ "When undeclared properties in the schema are present",
+ "A given scope cannot be reached."
+ ],
+ "type": "string"
+ },
+ "data": {
+ "description": "[Output Only] Metadata about this warning in key: value format. For example: \"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" } ",
+ "items": {
+ "properties": {
+ "key": {
+ "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).",
+ "type": "string"
+ },
+ "value": {
+ "description": "[Output Only] A warning data value corresponding to the key.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "type": "array"
+ },
+ "message": {
+ "description": "[Output Only] A human-readable description of the warning code.",
+ "type": "string"
+ }
},
- "type": "array"
- },
- "tcpEstablishedIdleTimeoutSec": {
- "description": "Timeout (in seconds) for TCP established connections. Defaults to 1200s if not set.",
- "format": "int32",
- "type": "integer"
- },
- "tcpTimeWaitTimeoutSec": {
- "description": "Timeout (in seconds) for TCP connections that are in TIME_WAIT state. Defaults to 120s if not set.",
- "format": "int32",
- "type": "integer"
- },
- "tcpTransitoryIdleTimeoutSec": {
- "description": "Timeout (in seconds) for TCP transitory connections. Defaults to 30s if not set.",
- "format": "int32",
- "type": "integer"
- },
- "type": {
- "description": "Indicates whether this NAT is used for public or private IP translation. If unspecified, it defaults to PUBLIC.",
- "enum": [
- "PRIVATE",
- "PUBLIC"
- ],
- "enumDescriptions": [
- "NAT used for private IP translation.",
- "NAT used for public IP translation. This is the default."
- ],
- "type": "string"
- },
- "udpIdleTimeoutSec": {
- "description": "Timeout (in seconds) for UDP connections. Defaults to 30s if not set.",
- "format": "int32",
- "type": "integer"
+ "type": "object"
}
},
"type": "object"
},
- "RouterNatLogConfig": {
- "description": "Configuration of logging on a NAT.",
- "id": "RouterNatLogConfig",
+ "SecurityPoliciesWafConfig": {
+ "id": "SecurityPoliciesWafConfig",
"properties": {
- "enable": {
- "description": "Indicates whether or not to export logs. This is false by default.",
- "type": "boolean"
- },
- "filter": {
- "description": "Specify the desired filtering of logs on this NAT. If unspecified, logs are exported for all connections handled by this NAT. This option can take one of the following values: - ERRORS_ONLY: Export logs only for connection failures. - TRANSLATIONS_ONLY: Export logs only for successful connections. - ALL: Export logs for all connections, successful and unsuccessful. ",
- "enum": [
- "ALL",
- "ERRORS_ONLY",
- "TRANSLATIONS_ONLY"
- ],
- "enumDescriptions": [
- "Export logs for all (successful and unsuccessful) connections.",
- "Export logs for connection failures only.",
- "Export logs for successful connections only."
- ],
- "type": "string"
+ "wafRules": {
+ "$ref": "PreconfiguredWafSet"
}
},
"type": "object"
},
- "RouterNatRule": {
- "id": "RouterNatRule",
+ "SecurityPolicy": {
+ "description": "Represents a Google Cloud Armor security policy resource. Only external backend services that use load balancers can reference a security policy. For more information, see Google Cloud Armor security policy overview.",
+ "id": "SecurityPolicy",
"properties": {
- "action": {
- "$ref": "RouterNatRuleAction",
- "description": "The action to be enforced for traffic that matches this rule."
+ "adaptiveProtectionConfig": {
+ "$ref": "SecurityPolicyAdaptiveProtectionConfig"
},
- "description": {
- "description": "An optional description of this rule.",
- "type": "string"
+ "advancedOptionsConfig": {
+ "$ref": "SecurityPolicyAdvancedOptionsConfig"
},
- "match": {
- "description": "CEL expression that specifies the match condition that egress traffic from a VM is evaluated against. If it evaluates to true, the corresponding `action` is enforced. The following examples are valid match expressions for public NAT: \"inIpRange(destination.ip, '1.1.0.0/16') || inIpRange(destination.ip, '2.2.0.0/16')\" \"destination.ip == '1.1.0.1' || destination.ip == '8.8.8.8'\" The following example is a valid match expression for private NAT: \"nexthop.hub == '//networkconnectivity.googleapis.com/projects/my-project/locations/global/hubs/hub-1'\"",
+ "creationTimestamp": {
+ "description": "[Output Only] Creation timestamp in RFC3339 text format.",
"type": "string"
},
- "ruleNumber": {
- "description": "An integer uniquely identifying a rule in the list. The rule number must be a positive value between 0 and 65000, and must be unique among rules within a NAT.",
- "format": "uint32",
- "type": "integer"
- }
- },
- "type": "object"
- },
- "RouterNatRuleAction": {
- "id": "RouterNatRuleAction",
- "properties": {
- "sourceNatActiveIps": {
- "description": "A list of URLs of the IP resources used for this NAT rule. These IP addresses must be valid static external IP addresses assigned to the project. This field is used for public NAT.",
- "items": {
- "type": "string"
- },
- "type": "array"
- },
- "sourceNatActiveRanges": {
- "description": "A list of URLs of the subnetworks used as source ranges for this NAT Rule. These subnetworks must have purpose set to PRIVATE_NAT. This field is used for private NAT.",
- "items": {
- "type": "string"
- },
- "type": "array"
- },
- "sourceNatDrainIps": {
- "description": "A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT rule only. This field is used for public NAT.",
- "items": {
- "type": "string"
- },
- "type": "array"
+ "ddosProtectionConfig": {
+ "$ref": "SecurityPolicyDdosProtectionConfig"
},
- "sourceNatDrainRanges": {
- "description": "A list of URLs of subnetworks representing source ranges to be drained. This is only supported on patch/update, and these subnetworks must have previously been used as active ranges in this NAT Rule. This field is used for private NAT.",
- "items": {
- "type": "string"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "RouterNatSubnetworkToNat": {
- "description": "Defines the IP ranges that want to use NAT for a subnetwork.",
- "id": "RouterNatSubnetworkToNat",
- "properties": {
- "name": {
- "description": "URL for the subnetwork resource that will use NAT.",
+ "description": {
+ "description": "An optional description of this resource. Provide this property when you create the resource.",
"type": "string"
},
- "secondaryIpRangeNames": {
- "description": "A list of the secondary ranges of the Subnetwork that are allowed to use NAT. This can be populated only if \"LIST_OF_SECONDARY_IP_RANGES\" is one of the values in source_ip_ranges_to_nat.",
- "items": {
- "type": "string"
- },
- "type": "array"
- },
- "sourceIpRangesToNat": {
- "description": "Specify the options for NAT ranges in the Subnetwork. All options of a single value are valid except NAT_IP_RANGE_OPTION_UNSPECIFIED. The only valid option with multiple values is: [\"PRIMARY_IP_RANGE\", \"LIST_OF_SECONDARY_IP_RANGES\"] Default: [ALL_IP_RANGES]",
- "items": {
- "enum": [
- "ALL_IP_RANGES",
- "LIST_OF_SECONDARY_IP_RANGES",
- "PRIMARY_IP_RANGE"
- ],
- "enumDescriptions": [
- "The primary and all the secondary ranges are allowed to Nat.",
- "A list of secondary ranges are allowed to Nat.",
- "The primary range is allowed to Nat."
- ],
- "type": "string"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "RouterStatus": {
- "id": "RouterStatus",
- "properties": {
- "bestRoutes": {
- "description": "Best routes for this router's network.",
- "items": {
- "$ref": "Route"
- },
- "type": "array"
- },
- "bestRoutesForRouter": {
- "description": "Best routes learned by this router.",
- "items": {
- "$ref": "Route"
- },
- "type": "array"
- },
- "bgpPeerStatus": {
- "items": {
- "$ref": "RouterStatusBgpPeerStatus"
- },
- "type": "array"
- },
- "natStatus": {
- "items": {
- "$ref": "RouterStatusNatStatus"
- },
- "type": "array"
- },
- "network": {
- "description": "URI of the network to which this router belongs.",
+ "fingerprint": {
+ "description": "Specifies a fingerprint for this resource, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make get() request to the security policy.",
+ "format": "byte",
"type": "string"
- }
- },
- "type": "object"
- },
- "RouterStatusBgpPeerStatus": {
- "id": "RouterStatusBgpPeerStatus",
- "properties": {
- "advertisedRoutes": {
- "description": "Routes that were advertised to the remote BGP peer",
- "items": {
- "$ref": "Route"
- },
- "type": "array"
- },
- "bfdStatus": {
- "$ref": "BfdStatus"
- },
- "enableIpv6": {
- "description": "Enable IPv6 traffic over BGP Peer. If not specified, it is disabled by default.",
- "type": "boolean"
},
- "ipAddress": {
- "description": "IP address of the local BGP interface.",
+ "id": {
+ "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.",
+ "format": "uint64",
"type": "string"
},
- "ipv6NexthopAddress": {
- "description": "IPv6 address of the local BGP interface.",
+ "kind": {
+ "default": "compute#securityPolicy",
+ "description": "[Output only] Type of the resource. Always compute#securityPolicyfor security policies",
"type": "string"
},
- "linkedVpnTunnel": {
- "description": "URL of the VPN tunnel that this BGP peer controls.",
+ "labelFingerprint": {
+ "description": "A fingerprint for the labels being applied to this security policy, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels. To see the latest fingerprint, make get() request to the security policy.",
+ "format": "byte",
"type": "string"
},
- "md5AuthEnabled": {
- "description": "Informs whether MD5 authentication is enabled on this BGP peer.",
- "type": "boolean"
+ "labels": {
+ "additionalProperties": {
+ "type": "string"
+ },
+ "description": "Labels for this resource. These can only be added or modified by the setLabels method. Each label key/value pair must comply with RFC1035. Label values may be empty.",
+ "type": "object"
},
"name": {
- "description": "Name of this BGP peer. Unique within the Routers resource.",
+ "description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
"type": "string"
},
- "numLearnedRoutes": {
- "description": "Number of routes learned from the remote BGP Peer.",
- "format": "uint32",
- "type": "integer"
- },
- "peerIpAddress": {
- "description": "IP address of the remote BGP interface.",
- "type": "string"
+ "recaptchaOptionsConfig": {
+ "$ref": "SecurityPolicyRecaptchaOptionsConfig"
},
- "peerIpv6NexthopAddress": {
- "description": "IPv6 address of the remote BGP interface.",
+ "region": {
+ "description": "[Output Only] URL of the region where the regional security policy resides. This field is not applicable to global security policies.",
"type": "string"
},
- "routerApplianceInstance": {
- "description": "[Output only] URI of the VM instance that is used as third-party router appliances such as Next Gen Firewalls, Virtual Routers, or Router Appliances. The VM instance is the peer side of the BGP session.",
- "type": "string"
+ "rules": {
+ "description": "A list of rules that belong to this policy. There must always be a default rule which is a rule with priority 2147483647 and match all condition (for the match condition this means match \"*\" for srcIpRanges and for the networkMatch condition every field must be either match \"*\" or not set). If no rules are provided when creating a security policy, a default rule with action \"allow\" will be added.",
+ "items": {
+ "$ref": "SecurityPolicyRule"
+ },
+ "type": "array"
},
- "state": {
- "description": "The state of the BGP session. For a list of possible values for this field, see BGP session states.",
+ "selfLink": {
+ "description": "[Output Only] Server-defined URL for the resource.",
"type": "string"
},
- "status": {
- "description": "Status of the BGP peer: {UP, DOWN}",
+ "type": {
+ "description": "The type indicates the intended use of the security policy. - CLOUD_ARMOR: Cloud Armor backend security policies can be configured to filter incoming HTTP requests targeting backend services. They filter requests before they hit the origin servers. - CLOUD_ARMOR_EDGE: Cloud Armor edge security policies can be configured to filter incoming HTTP requests targeting backend services (including Cloud CDN-enabled) as well as backend buckets (Cloud Storage). They filter requests before the request is served from Google's cache. - CLOUD_ARMOR_INTERNAL_SERVICE: Cloud Armor internal service policies can be configured to filter HTTP requests targeting services managed by Traffic Director in a service mesh. They filter requests before the request is served from the application. - CLOUD_ARMOR_NETWORK: Cloud Armor network policies can be configured to filter packets targeting network load balancing resources such as backend services, target pools, target instances, and instances with external IPs. They filter requests before the request is served from the application. This field can be set only at resource creation time.",
"enum": [
- "DOWN",
- "UNKNOWN",
- "UP"
+ "CLOUD_ARMOR",
+ "CLOUD_ARMOR_EDGE",
+ "CLOUD_ARMOR_NETWORK"
],
"enumDescriptions": [
"",
@@ -67140,164 +71740,228 @@
],
"type": "string"
},
- "statusReason": {
- "description": "Indicates why particular status was returned.",
+ "userDefinedFields": {
+ "description": "Definitions of user-defined fields for CLOUD_ARMOR_NETWORK policies. A user-defined field consists of up to 4 bytes extracted from a fixed offset in the packet, relative to the IPv4, IPv6, TCP, or UDP header, with an optional mask to select certain bits. Rules may then specify matching values for these fields. Example: userDefinedFields: - name: \"ipv4_fragment_offset\" base: IPV4 offset: 6 size: 2 mask: \"0x1fff\"",
+ "items": {
+ "$ref": "SecurityPolicyUserDefinedField"
+ },
+ "type": "array"
+ }
+ },
+ "type": "object"
+ },
+ "SecurityPolicyAdaptiveProtectionConfig": {
+ "description": "Configuration options for Cloud Armor Adaptive Protection (CAAP).",
+ "id": "SecurityPolicyAdaptiveProtectionConfig",
+ "properties": {
+ "layer7DdosDefenseConfig": {
+ "$ref": "SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfig",
+ "description": "If set to true, enables Cloud Armor Machine Learning."
+ }
+ },
+ "type": "object"
+ },
+ "SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfig": {
+ "description": "Configuration options for L7 DDoS detection. This field is only supported in Global Security Policies of type CLOUD_ARMOR.",
+ "id": "SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfig",
+ "properties": {
+ "enable": {
+ "description": "If set to true, enables CAAP for L7 DDoS detection. This field is only supported in Global Security Policies of type CLOUD_ARMOR.",
+ "type": "boolean"
+ },
+ "ruleVisibility": {
+ "description": "Rule visibility can be one of the following: STANDARD - opaque rules. (default) PREMIUM - transparent rules. This field is only supported in Global Security Policies of type CLOUD_ARMOR.",
"enum": [
- "MD5_AUTH_INTERNAL_PROBLEM",
- "STATUS_REASON_UNSPECIFIED"
+ "PREMIUM",
+ "STANDARD"
],
"enumDescriptions": [
- "Indicates internal problems with configuration of MD5 authentication. This particular reason can only be returned when md5AuthEnabled is true and status is DOWN.",
+ "",
""
],
"type": "string"
},
- "uptime": {
- "description": "Time this session has been up. Format: 14 years, 51 weeks, 6 days, 23 hours, 59 minutes, 59 seconds",
- "type": "string"
- },
- "uptimeSeconds": {
- "description": "Time this session has been up, in seconds. Format: 145",
- "type": "string"
+ "thresholdConfigs": {
+ "description": "Configuration options for layer7 adaptive protection for various customizable thresholds.",
+ "items": {
+ "$ref": "SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfig"
+ },
+ "type": "array"
}
},
"type": "object"
},
- "RouterStatusNatStatus": {
- "description": "Status of a NAT contained in this router.",
- "id": "RouterStatusNatStatus",
+ "SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfig": {
+ "id": "SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfig",
"properties": {
- "autoAllocatedNatIps": {
- "description": "A list of IPs auto-allocated for NAT. Example: [\"1.1.1.1\", \"129.2.16.89\"]",
- "items": {
- "type": "string"
- },
- "type": "array"
- },
- "drainAutoAllocatedNatIps": {
- "description": "A list of IPs auto-allocated for NAT that are in drain mode. Example: [\"1.1.1.1\", \"179.12.26.133\"].",
- "items": {
- "type": "string"
- },
- "type": "array"
- },
- "drainUserAllocatedNatIps": {
- "description": "A list of IPs user-allocated for NAT that are in drain mode. Example: [\"1.1.1.1\", \"179.12.26.133\"].",
- "items": {
- "type": "string"
- },
- "type": "array"
+ "autoDeployConfidenceThreshold": {
+ "format": "float",
+ "type": "number"
},
- "minExtraNatIpsNeeded": {
- "description": "The number of extra IPs to allocate. This will be greater than 0 only if user-specified IPs are NOT enough to allow all configured VMs to use NAT. This value is meaningful only when auto-allocation of NAT IPs is *not* used.",
+ "autoDeployExpirationSec": {
"format": "int32",
"type": "integer"
},
+ "autoDeployImpactedBaselineThreshold": {
+ "format": "float",
+ "type": "number"
+ },
+ "autoDeployLoadThreshold": {
+ "format": "float",
+ "type": "number"
+ },
+ "detectionAbsoluteQps": {
+ "format": "float",
+ "type": "number"
+ },
+ "detectionLoadThreshold": {
+ "format": "float",
+ "type": "number"
+ },
+ "detectionRelativeToBaselineQps": {
+ "format": "float",
+ "type": "number"
+ },
"name": {
- "description": "Unique name of this NAT.",
+ "description": "The name must be 1-63 characters long, and comply with RFC1035. The name must be unique within the security policy.",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
"type": "string"
},
- "numVmEndpointsWithNatMappings": {
- "description": "Number of VM endpoints (i.e., Nics) that can use NAT.",
- "format": "int32",
- "type": "integer"
- },
- "ruleStatus": {
- "description": "Status of rules in this NAT.",
+ "trafficGranularityConfigs": {
+ "description": "Configuration options for enabling Adaptive Protection to operate on specified granular traffic units.",
"items": {
- "$ref": "RouterStatusNatStatusNatRuleStatus"
+ "$ref": "SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfigTrafficGranularityConfig"
},
"type": "array"
+ }
+ },
+ "type": "object"
+ },
+ "SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfigTrafficGranularityConfig": {
+ "description": "Configurations to specifc granular traffic units processed by Adaptive Protection.",
+ "id": "SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfigTrafficGranularityConfig",
+ "properties": {
+ "enableEachUniqueValue": {
+ "description": "If enabled, traffic matching each unique value for the specified type constitutes a separate traffic unit. It can only be set to true if `value` is empty.",
+ "type": "boolean"
},
- "userAllocatedNatIpResources": {
- "description": "A list of fully qualified URLs of reserved IP address resources.",
- "items": {
- "type": "string"
- },
- "type": "array"
+ "type": {
+ "description": "Type of this configuration.",
+ "enum": [
+ "HTTP_HEADER_HOST",
+ "HTTP_PATH",
+ "UNSPECIFIED_TYPE"
+ ],
+ "enumDescriptions": [
+ "",
+ "",
+ ""
+ ],
+ "type": "string"
},
- "userAllocatedNatIps": {
- "description": "A list of IPs user-allocated for NAT. They will be raw IP strings like \"179.12.26.133\".",
- "items": {
- "type": "string"
- },
- "type": "array"
+ "value": {
+ "description": "Requests that match this value constitute a granular traffic unit.",
+ "type": "string"
}
},
"type": "object"
},
- "RouterStatusNatStatusNatRuleStatus": {
- "description": "Status of a NAT Rule contained in this NAT.",
- "id": "RouterStatusNatStatusNatRuleStatus",
+ "SecurityPolicyAdvancedOptionsConfig": {
+ "id": "SecurityPolicyAdvancedOptionsConfig",
"properties": {
- "activeNatIps": {
- "description": "A list of active IPs for NAT. Example: [\"1.1.1.1\", \"179.12.26.133\"].",
- "items": {
- "type": "string"
- },
- "type": "array"
+ "jsonCustomConfig": {
+ "$ref": "SecurityPolicyAdvancedOptionsConfigJsonCustomConfig",
+ "description": "Custom configuration to apply the JSON parsing. Only applicable when json_parsing is set to STANDARD."
},
- "drainNatIps": {
- "description": "A list of IPs for NAT that are in drain mode. Example: [\"1.1.1.1\", \"179.12.26.133\"].",
+ "jsonParsing": {
+ "enum": [
+ "DISABLED",
+ "STANDARD",
+ "STANDARD_WITH_GRAPHQL"
+ ],
+ "enumDescriptions": [
+ "",
+ "",
+ ""
+ ],
+ "type": "string"
+ },
+ "logLevel": {
+ "enum": [
+ "NORMAL",
+ "VERBOSE"
+ ],
+ "enumDescriptions": [
+ "",
+ ""
+ ],
+ "type": "string"
+ },
+ "userIpRequestHeaders": {
+ "description": "An optional list of case-insensitive request header names to use for resolving the callers client IP address.",
"items": {
"type": "string"
},
"type": "array"
- },
- "minExtraIpsNeeded": {
- "description": "The number of extra IPs to allocate. This will be greater than 0 only if the existing IPs in this NAT Rule are NOT enough to allow all configured VMs to use NAT.",
- "format": "int32",
- "type": "integer"
- },
- "numVmEndpointsWithNatMappings": {
- "description": "Number of VM endpoints (i.e., NICs) that have NAT Mappings from this NAT Rule.",
- "format": "int32",
- "type": "integer"
- },
- "ruleNumber": {
- "description": "Rule number of the rule.",
- "format": "int32",
- "type": "integer"
}
},
"type": "object"
},
- "RouterStatusResponse": {
- "id": "RouterStatusResponse",
+ "SecurityPolicyAdvancedOptionsConfigJsonCustomConfig": {
+ "id": "SecurityPolicyAdvancedOptionsConfigJsonCustomConfig",
"properties": {
- "kind": {
- "default": "compute#routerStatusResponse",
- "description": "Type of resource.",
- "type": "string"
- },
- "result": {
- "$ref": "RouterStatus"
+ "contentTypes": {
+ "description": "A list of custom Content-Type header values to apply the JSON parsing. As per RFC 1341, a Content-Type header value has the following format: Content-Type := type \"/\" subtype *[\";\" parameter] When configuring a custom Content-Type header value, only the type/subtype needs to be specified, and the parameters should be excluded.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
}
},
"type": "object"
},
- "RoutersPreviewResponse": {
- "id": "RoutersPreviewResponse",
+ "SecurityPolicyDdosProtectionConfig": {
+ "id": "SecurityPolicyDdosProtectionConfig",
"properties": {
- "resource": {
- "$ref": "Router",
- "description": "Preview of given router."
+ "ddosProtection": {
+ "enum": [
+ "ADVANCED",
+ "STANDARD"
+ ],
+ "enumDescriptions": [
+ "",
+ ""
+ ],
+ "type": "string"
}
},
"type": "object"
},
- "RoutersScopedList": {
- "id": "RoutersScopedList",
+ "SecurityPolicyList": {
+ "id": "SecurityPolicyList",
"properties": {
- "routers": {
- "description": "A list of routers contained in this scope.",
+ "id": {
+ "description": "[Output Only] Unique identifier for the resource; defined by the server.",
+ "type": "string"
+ },
+ "items": {
+ "description": "A list of SecurityPolicy resources.",
"items": {
- "$ref": "Router"
+ "$ref": "SecurityPolicy"
},
"type": "array"
},
+ "kind": {
+ "default": "compute#securityPolicyList",
+ "description": "[Output Only] Type of resource. Always compute#securityPolicyList for listsof securityPolicies",
+ "type": "string"
+ },
+ "nextPageToken": {
+ "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
+ "type": "string"
+ },
"warning": {
- "description": "Informational warning which replaces the list of routers when the list is empty.",
+ "description": "[Output Only] Informational warning message.",
"properties": {
"code": {
"description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.",
@@ -67415,229 +72079,485 @@
"type": "string"
}
},
- "type": "object"
+ "type": "object"
+ }
+ },
+ "type": "object"
+ },
+ "SecurityPolicyRecaptchaOptionsConfig": {
+ "id": "SecurityPolicyRecaptchaOptionsConfig",
+ "properties": {
+ "redirectSiteKey": {
+ "description": "An optional field to supply a reCAPTCHA site key to be used for all the rules using the redirect action with the type of GOOGLE_RECAPTCHA under the security policy. The specified site key needs to be created from the reCAPTCHA API. The user is responsible for the validity of the specified site key. If not specified, a Google-managed site key is used. This field is only supported in Global Security Policies of type CLOUD_ARMOR.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "SecurityPolicyReference": {
+ "id": "SecurityPolicyReference",
+ "properties": {
+ "securityPolicy": {
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "SecurityPolicyRule": {
+ "description": "Represents a rule that describes one or more match conditions along with the action to be taken when traffic matches this condition (allow or deny).",
+ "id": "SecurityPolicyRule",
+ "properties": {
+ "action": {
+ "description": "The Action to perform when the rule is matched. The following are the valid actions: - allow: allow access to target. - deny(STATUS): deny access to target, returns the HTTP response code specified. Valid values for `STATUS` are 403, 404, and 502. - rate_based_ban: limit client traffic to the configured threshold and ban the client if the traffic exceeds the threshold. Configure parameters for this action in RateLimitOptions. Requires rate_limit_options to be set. - redirect: redirect to a different target. This can either be an internal reCAPTCHA redirect, or an external URL-based redirect via a 302 response. Parameters for this action can be configured via redirectOptions. This action is only supported in Global Security Policies of type CLOUD_ARMOR. - throttle: limit client traffic to the configured threshold. Configure parameters for this action in rateLimitOptions. Requires rate_limit_options to be set for this. ",
+ "type": "string"
+ },
+ "description": {
+ "description": "An optional description of this resource. Provide this property when you create the resource.",
+ "type": "string"
+ },
+ "headerAction": {
+ "$ref": "SecurityPolicyRuleHttpHeaderAction",
+ "description": "Optional, additional actions that are performed on headers. This field is only supported in Global Security Policies of type CLOUD_ARMOR."
+ },
+ "kind": {
+ "default": "compute#securityPolicyRule",
+ "description": "[Output only] Type of the resource. Always compute#securityPolicyRule for security policy rules",
+ "type": "string"
+ },
+ "match": {
+ "$ref": "SecurityPolicyRuleMatcher",
+ "description": "A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced."
+ },
+ "networkMatch": {
+ "$ref": "SecurityPolicyRuleNetworkMatcher",
+ "description": "A match condition that incoming packets are evaluated against for CLOUD_ARMOR_NETWORK security policies. If it matches, the corresponding 'action' is enforced. The match criteria for a rule consists of built-in match fields (like 'srcIpRanges') and potentially multiple user-defined match fields ('userDefinedFields'). Field values may be extracted directly from the packet or derived from it (e.g. 'srcRegionCodes'). Some fields may not be present in every packet (e.g. 'srcPorts'). A user-defined field is only present if the base header is found in the packet and the entire field is in bounds. Each match field may specify which values can match it, listing one or more ranges, prefixes, or exact values that are considered a match for the field. A field value must be present in order to match a specified match field. If no match values are specified for a match field, then any field value is considered to match it, and it's not required to be present. For strings specifying '*' is also equivalent to match all. For a packet to match a rule, all specified match fields must match the corresponding field values derived from the packet. Example: networkMatch: srcIpRanges: - \"192.0.2.0/24\" - \"198.51.100.0/24\" userDefinedFields: - name: \"ipv4_fragment_offset\" values: - \"1-0x1fff\" The above match condition matches packets with a source IP in 192.0.2.0/24 or 198.51.100.0/24 and a user-defined field named \"ipv4_fragment_offset\" with a value between 1 and 0x1fff inclusive."
+ },
+ "preconfiguredWafConfig": {
+ "$ref": "SecurityPolicyRulePreconfiguredWafConfig",
+ "description": "Preconfigured WAF configuration to be applied for the rule. If the rule does not evaluate preconfigured WAF rules, i.e., if evaluatePreconfiguredWaf() is not used, this field will have no effect."
+ },
+ "preview": {
+ "description": "If set to true, the specified action is not enforced.",
+ "type": "boolean"
+ },
+ "priority": {
+ "description": "An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest priority.",
+ "format": "int32",
+ "type": "integer"
+ },
+ "rateLimitOptions": {
+ "$ref": "SecurityPolicyRuleRateLimitOptions",
+ "description": "Must be specified if the action is \"rate_based_ban\" or \"throttle\". Cannot be specified for any other actions."
+ },
+ "redirectOptions": {
+ "$ref": "SecurityPolicyRuleRedirectOptions",
+ "description": "Parameters defining the redirect action. Cannot be specified for any other actions. This field is only supported in Global Security Policies of type CLOUD_ARMOR."
+ }
+ },
+ "type": "object"
+ },
+ "SecurityPolicyRuleHttpHeaderAction": {
+ "id": "SecurityPolicyRuleHttpHeaderAction",
+ "properties": {
+ "requestHeadersToAdds": {
+ "description": "The list of request headers to add or overwrite if they're already present.",
+ "items": {
+ "$ref": "SecurityPolicyRuleHttpHeaderActionHttpHeaderOption"
+ },
+ "type": "array"
+ }
+ },
+ "type": "object"
+ },
+ "SecurityPolicyRuleHttpHeaderActionHttpHeaderOption": {
+ "id": "SecurityPolicyRuleHttpHeaderActionHttpHeaderOption",
+ "properties": {
+ "headerName": {
+ "description": "The name of the header to set.",
+ "type": "string"
+ },
+ "headerValue": {
+ "description": "The value to set the named header to.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "SecurityPolicyRuleMatcher": {
+ "description": "Represents a match condition that incoming traffic is evaluated against. Exactly one field must be specified.",
+ "id": "SecurityPolicyRuleMatcher",
+ "properties": {
+ "config": {
+ "$ref": "SecurityPolicyRuleMatcherConfig",
+ "description": "The configuration options available when specifying versioned_expr. This field must be specified if versioned_expr is specified and cannot be specified if versioned_expr is not specified."
+ },
+ "expr": {
+ "$ref": "Expr",
+ "description": "User defined CEVAL expression. A CEVAL expression is used to specify match criteria such as origin.ip, source.region_code and contents in the request header. Expressions containing `evaluateThreatIntelligence` require Cloud Armor Managed Protection Plus tier and are not supported in Edge Policies nor in Regional Policies. Expressions containing `evaluatePreconfiguredExpr('sourceiplist-*')` require Cloud Armor Managed Protection Plus tier and are only supported in Global Security Policies."
+ },
+ "exprOptions": {
+ "$ref": "SecurityPolicyRuleMatcherExprOptions",
+ "description": "The configuration options available when specifying a user defined CEVAL expression (i.e., 'expr')."
+ },
+ "versionedExpr": {
+ "description": "Preconfigured versioned expression. If this field is specified, config must also be specified. Available preconfigured expressions along with their requirements are: SRC_IPS_V1 - must specify the corresponding src_ip_range field in config.",
+ "enum": [
+ "SRC_IPS_V1"
+ ],
+ "enumDescriptions": [
+ "Matches the source IP address of a request to the IP ranges supplied in config."
+ ],
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "SecurityPolicyRuleMatcherConfig": {
+ "id": "SecurityPolicyRuleMatcherConfig",
+ "properties": {
+ "srcIpRanges": {
+ "description": "CIDR IP address range. Maximum number of src_ip_ranges allowed is 10.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ }
+ },
+ "type": "object"
+ },
+ "SecurityPolicyRuleMatcherExprOptions": {
+ "id": "SecurityPolicyRuleMatcherExprOptions",
+ "properties": {
+ "recaptchaOptions": {
+ "$ref": "SecurityPolicyRuleMatcherExprOptionsRecaptchaOptions",
+ "description": "reCAPTCHA configuration options to be applied for the rule. If the rule does not evaluate reCAPTCHA tokens, this field has no effect."
+ }
+ },
+ "type": "object"
+ },
+ "SecurityPolicyRuleMatcherExprOptionsRecaptchaOptions": {
+ "id": "SecurityPolicyRuleMatcherExprOptionsRecaptchaOptions",
+ "properties": {
+ "actionTokenSiteKeys": {
+ "description": "A list of site keys to be used during the validation of reCAPTCHA action-tokens. The provided site keys need to be created from reCAPTCHA API under the same project where the security policy is created.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "sessionTokenSiteKeys": {
+ "description": "A list of site keys to be used during the validation of reCAPTCHA session-tokens. The provided site keys need to be created from reCAPTCHA API under the same project where the security policy is created.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ }
+ },
+ "type": "object"
+ },
+ "SecurityPolicyRuleNetworkMatcher": {
+ "description": "Represents a match condition that incoming network traffic is evaluated against.",
+ "id": "SecurityPolicyRuleNetworkMatcher",
+ "properties": {
+ "destIpRanges": {
+ "description": "Destination IPv4/IPv6 addresses or CIDR prefixes, in standard text format.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "destPorts": {
+ "description": "Destination port numbers for TCP/UDP/SCTP. Each element can be a 16-bit unsigned decimal number (e.g. \"80\") or range (e.g. \"0-1023\").",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "ipProtocols": {
+ "description": "IPv4 protocol / IPv6 next header (after extension headers). Each element can be an 8-bit unsigned decimal number (e.g. \"6\"), range (e.g. \"253-254\"), or one of the following protocol names: \"tcp\", \"udp\", \"icmp\", \"esp\", \"ah\", \"ipip\", or \"sctp\".",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "srcAsns": {
+ "description": "BGP Autonomous System Number associated with the source IP address.",
+ "items": {
+ "format": "uint32",
+ "type": "integer"
+ },
+ "type": "array"
+ },
+ "srcIpRanges": {
+ "description": "Source IPv4/IPv6 addresses or CIDR prefixes, in standard text format.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "srcPorts": {
+ "description": "Source port numbers for TCP/UDP/SCTP. Each element can be a 16-bit unsigned decimal number (e.g. \"80\") or range (e.g. \"0-1023\").",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "srcRegionCodes": {
+ "description": "Two-letter ISO 3166-1 alpha-2 country code associated with the source IP address.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "userDefinedFields": {
+ "description": "User-defined fields. Each element names a defined field and lists the matching values for that field.",
+ "items": {
+ "$ref": "SecurityPolicyRuleNetworkMatcherUserDefinedFieldMatch"
+ },
+ "type": "array"
}
},
"type": "object"
},
- "Rule": {
- "description": "This is deprecated and has no effect. Do not use.",
- "id": "Rule",
+ "SecurityPolicyRuleNetworkMatcherUserDefinedFieldMatch": {
+ "id": "SecurityPolicyRuleNetworkMatcherUserDefinedFieldMatch",
"properties": {
- "action": {
- "description": "This is deprecated and has no effect. Do not use.",
- "enum": [
- "ALLOW",
- "ALLOW_WITH_LOG",
- "DENY",
- "DENY_WITH_LOG",
- "LOG",
- "NO_ACTION"
- ],
- "enumDescriptions": [
- "This is deprecated and has no effect. Do not use.",
- "This is deprecated and has no effect. Do not use.",
- "This is deprecated and has no effect. Do not use.",
- "This is deprecated and has no effect. Do not use.",
- "This is deprecated and has no effect. Do not use.",
- "This is deprecated and has no effect. Do not use."
- ],
+ "name": {
+ "description": "Name of the user-defined field, as given in the definition.",
"type": "string"
},
- "conditions": {
- "description": "This is deprecated and has no effect. Do not use.",
+ "values": {
+ "description": "Matching values of the field. Each element can be a 32-bit unsigned decimal or hexadecimal (starting with \"0x\") number (e.g. \"64\") or range (e.g. \"0x400-0x7ff\").",
"items": {
- "$ref": "Condition"
+ "type": "string"
+ },
+ "type": "array"
+ }
+ },
+ "type": "object"
+ },
+ "SecurityPolicyRulePreconfiguredWafConfig": {
+ "id": "SecurityPolicyRulePreconfiguredWafConfig",
+ "properties": {
+ "exclusions": {
+ "description": "A list of exclusions to apply during preconfigured WAF evaluation.",
+ "items": {
+ "$ref": "SecurityPolicyRulePreconfiguredWafConfigExclusion"
+ },
+ "type": "array"
+ }
+ },
+ "type": "object"
+ },
+ "SecurityPolicyRulePreconfiguredWafConfigExclusion": {
+ "id": "SecurityPolicyRulePreconfiguredWafConfigExclusion",
+ "properties": {
+ "requestCookiesToExclude": {
+ "description": "A list of request cookie names whose value will be excluded from inspection during preconfigured WAF evaluation.",
+ "items": {
+ "$ref": "SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams"
},
"type": "array"
},
- "description": {
- "description": "This is deprecated and has no effect. Do not use.",
- "type": "string"
- },
- "ins": {
- "description": "This is deprecated and has no effect. Do not use.",
+ "requestHeadersToExclude": {
+ "description": "A list of request header names whose value will be excluded from inspection during preconfigured WAF evaluation.",
"items": {
- "type": "string"
+ "$ref": "SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams"
},
"type": "array"
},
- "logConfigs": {
- "description": "This is deprecated and has no effect. Do not use.",
+ "requestQueryParamsToExclude": {
+ "description": "A list of request query parameter names whose value will be excluded from inspection during preconfigured WAF evaluation. Note that the parameter can be in the query string or in the POST body.",
"items": {
- "$ref": "LogConfig"
+ "$ref": "SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams"
},
"type": "array"
},
- "notIns": {
- "description": "This is deprecated and has no effect. Do not use.",
+ "requestUrisToExclude": {
+ "description": "A list of request URIs from the request line to be excluded from inspection during preconfigured WAF evaluation. When specifying this field, the query or fragment part should be excluded.",
"items": {
- "type": "string"
+ "$ref": "SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams"
},
"type": "array"
},
- "permissions": {
- "description": "This is deprecated and has no effect. Do not use.",
+ "targetRuleIds": {
+ "description": "A list of target rule IDs under the WAF rule set to apply the preconfigured WAF exclusion. If omitted, it refers to all the rule IDs under the WAF rule set.",
"items": {
"type": "string"
},
"type": "array"
+ },
+ "targetRuleSet": {
+ "description": "Target WAF rule set to apply the preconfigured WAF exclusion.",
+ "type": "string"
}
},
"type": "object"
},
- "SSLHealthCheck": {
- "id": "SSLHealthCheck",
+ "SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams": {
+ "id": "SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams",
"properties": {
- "port": {
- "description": "The TCP port number to which the health check prober sends packets. The default value is 443. Valid values are 1 through 65535.",
- "format": "int32",
- "type": "integer"
- },
- "portName": {
- "description": "Not supported.",
- "type": "string"
- },
- "portSpecification": {
- "description": "Specifies how a port is selected for health checking. Can be one of the following values: USE_FIXED_PORT: Specifies a port number explicitly using the port field in the health check. Supported by backend services for passthrough load balancers and backend services for proxy load balancers. Not supported by target pools. The health check supports all backends supported by the backend service provided the backend can be health checked. For example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT network endpoint groups, and instance group backends. USE_NAMED_PORT: Not supported. USE_SERVING_PORT: Provides an indirect method of specifying the health check port by referring to the backend service. Only supported by backend services for proxy load balancers. Not supported by target pools. Not supported by backend services for passthrough load balancers. Supports all backends that can be health checked; for example, GCE_VM_IP_PORT network endpoint groups and instance group backends. For GCE_VM_IP_PORT network endpoint group backends, the health check uses the port number specified for each endpoint in the network endpoint group. For instance group backends, the health check uses the port number determined by looking up the backend service's named port in the instance group's list of named ports.",
- "enum": [
- "USE_FIXED_PORT",
- "USE_NAMED_PORT",
- "USE_SERVING_PORT"
- ],
- "enumDescriptions": [
- "The port number in the health check's port is used for health checking. Applies to network endpoint group and instance group backends.",
- "Not supported.",
- "For network endpoint group backends, the health check uses the port number specified on each endpoint in the network endpoint group. For instance group backends, the health check uses the port number specified for the backend service's named port defined in the instance group's named ports."
- ],
- "type": "string"
- },
- "proxyHeader": {
- "description": "Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE.",
+ "op": {
+ "description": "The match operator for the field.",
"enum": [
- "NONE",
- "PROXY_V1"
+ "CONTAINS",
+ "ENDS_WITH",
+ "EQUALS",
+ "EQUALS_ANY",
+ "STARTS_WITH"
],
"enumDescriptions": [
- "",
- ""
+ "The operator matches if the field value contains the specified value.",
+ "The operator matches if the field value ends with the specified value.",
+ "The operator matches if the field value equals the specified value.",
+ "The operator matches if the field value is any value.",
+ "The operator matches if the field value starts with the specified value."
],
"type": "string"
},
- "request": {
- "description": "Instructs the health check prober to send this exact ASCII string, up to 1024 bytes in length, after establishing the TCP connection and SSL handshake.",
- "type": "string"
- },
- "response": {
- "description": "Creates a content-based SSL health check. In addition to establishing a TCP connection and the TLS handshake, you can configure the health check to pass only when the backend sends this exact response ASCII string, up to 1024 bytes in length. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#criteria-protocol-ssl-tcp",
+ "val": {
+ "description": "The value of the field.",
"type": "string"
}
},
"type": "object"
},
- "SavedAttachedDisk": {
- "description": "DEPRECATED: Please use compute#savedDisk instead. An instance-attached disk resource.",
- "id": "SavedAttachedDisk",
+ "SecurityPolicyRuleRateLimitOptions": {
+ "id": "SecurityPolicyRuleRateLimitOptions",
"properties": {
- "autoDelete": {
- "description": "Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance).",
- "type": "boolean"
- },
- "boot": {
- "description": "Indicates that this is a boot disk. The virtual machine will use the first partition of the disk for its root filesystem.",
- "type": "boolean"
- },
- "deviceName": {
- "description": "Specifies the name of the disk attached to the source instance.",
- "type": "string"
- },
- "diskEncryptionKey": {
- "$ref": "CustomerEncryptionKey",
- "description": "The encryption key for the disk."
+ "banDurationSec": {
+ "description": "Can only be specified if the action for the rule is \"rate_based_ban\". If specified, determines the time (in seconds) the traffic will continue to be banned by the rate limit after the rate falls below the threshold.",
+ "format": "int32",
+ "type": "integer"
},
- "diskSizeGb": {
- "description": "The size of the disk in base-2 GB.",
- "format": "int64",
- "type": "string"
+ "banThreshold": {
+ "$ref": "SecurityPolicyRuleRateLimitOptionsThreshold",
+ "description": "Can only be specified if the action for the rule is \"rate_based_ban\". If specified, the key will be banned for the configured 'ban_duration_sec' when the number of requests that exceed the 'rate_limit_threshold' also exceed this 'ban_threshold'."
},
- "diskType": {
- "description": "[Output Only] URL of the disk type resource. For example: projects/project /zones/zone/diskTypes/pd-standard or pd-ssd",
+ "conformAction": {
+ "description": "Action to take for requests that are under the configured rate limit threshold. Valid option is \"allow\" only.",
"type": "string"
},
- "guestOsFeatures": {
- "description": "A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options.",
- "items": {
- "$ref": "GuestOsFeature"
- },
- "type": "array"
- },
- "index": {
- "description": "Specifies zero-based index of the disk that is attached to the source instance.",
- "format": "int32",
- "type": "integer"
- },
- "interface": {
- "description": "Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME.",
+ "enforceOnKey": {
+ "description": "Determines the key to enforce the rate_limit_threshold on. Possible values are: - ALL: A single rate limit threshold is applied to all the requests matching this rule. This is the default value if \"enforceOnKey\" is not configured. - IP: The source IP address of the request is the key. Each IP has this limit enforced separately. - HTTP_HEADER: The value of the HTTP header whose name is configured under \"enforceOnKeyName\". The key value is truncated to the first 128 bytes of the header value. If no such header is present in the request, the key type defaults to ALL. - XFF_IP: The first IP address (i.e. the originating client IP address) specified in the list of IPs under X-Forwarded-For HTTP header. If no such header is present or the value is not a valid IP, the key defaults to the source IP address of the request i.e. key type IP. - HTTP_COOKIE: The value of the HTTP cookie whose name is configured under \"enforceOnKeyName\". The key value is truncated to the first 128 bytes of the cookie value. If no such cookie is present in the request, the key type defaults to ALL. - HTTP_PATH: The URL path of the HTTP request. The key value is truncated to the first 128 bytes. - SNI: Server name indication in the TLS session of the HTTPS request. The key value is truncated to the first 128 bytes. The key type defaults to ALL on a HTTP session. - REGION_CODE: The country/region from which the request originates. - TLS_JA3_FINGERPRINT: JA3 TLS/SSL fingerprint if the client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the key type defaults to ALL. - USER_IP: The IP address of the originating client, which is resolved based on \"userIpRequestHeaders\" configured with the security policy. If there is no \"userIpRequestHeaders\" configuration or an IP address cannot be resolved from it, the key type defaults to IP. ",
"enum": [
- "NVME",
- "SCSI"
+ "ALL",
+ "HTTP_COOKIE",
+ "HTTP_HEADER",
+ "HTTP_PATH",
+ "IP",
+ "REGION_CODE",
+ "SNI",
+ "TLS_JA3_FINGERPRINT",
+ "USER_IP",
+ "XFF_IP"
],
"enumDescriptions": [
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
"",
""
],
"type": "string"
},
- "kind": {
- "default": "compute#savedAttachedDisk",
- "description": "[Output Only] Type of the resource. Always compute#attachedDisk for attached disks.",
- "type": "string"
- },
- "licenses": {
- "description": "[Output Only] Any valid publicly visible licenses.",
+ "enforceOnKeyConfigs": {
+ "description": "If specified, any combination of values of enforce_on_key_type/enforce_on_key_name is treated as the key on which ratelimit threshold/action is enforced. You can specify up to 3 enforce_on_key_configs. If enforce_on_key_configs is specified, enforce_on_key must not be specified.",
"items": {
- "type": "string"
+ "$ref": "SecurityPolicyRuleRateLimitOptionsEnforceOnKeyConfig"
},
"type": "array"
},
- "mode": {
- "description": "The mode in which this disk is attached to the source instance, either READ_WRITE or READ_ONLY.",
- "enum": [
- "READ_ONLY",
- "READ_WRITE"
- ],
- "enumDescriptions": [
- "Attaches this disk in read-only mode. Multiple virtual machines can use a disk in read-only mode at a time.",
- "*[Default]* Attaches this disk in read-write mode. Only one virtual machine at a time can be attached to a disk in read-write mode."
- ],
+ "enforceOnKeyName": {
+ "description": "Rate limit key name applicable only for the following key types: HTTP_HEADER -- Name of the HTTP header whose value is taken as the key value. HTTP_COOKIE -- Name of the HTTP cookie whose value is taken as the key value.",
"type": "string"
},
- "source": {
- "description": "Specifies a URL of the disk attached to the source instance.",
+ "exceedAction": {
+ "description": "Action to take for requests that are above the configured rate limit threshold, to either deny with a specified HTTP response code, or redirect to a different endpoint. Valid options are `deny(STATUS)`, where valid values for `STATUS` are 403, 404, 429, and 502, and `redirect`, where the redirect parameters come from `exceedRedirectOptions` below. The `redirect` action is only supported in Global Security Policies of type CLOUD_ARMOR.",
"type": "string"
},
- "storageBytes": {
- "description": "[Output Only] A size of the storage used by the disk's snapshot by this machine image.",
- "format": "int64",
+ "exceedRedirectOptions": {
+ "$ref": "SecurityPolicyRuleRedirectOptions",
+ "description": "Parameters defining the redirect action that is used as the exceed action. Cannot be specified if the exceed action is not redirect. This field is only supported in Global Security Policies of type CLOUD_ARMOR."
+ },
+ "rateLimitThreshold": {
+ "$ref": "SecurityPolicyRuleRateLimitOptionsThreshold",
+ "description": "Threshold at which to begin ratelimiting."
+ }
+ },
+ "type": "object"
+ },
+ "SecurityPolicyRuleRateLimitOptionsEnforceOnKeyConfig": {
+ "id": "SecurityPolicyRuleRateLimitOptionsEnforceOnKeyConfig",
+ "properties": {
+ "enforceOnKeyName": {
+ "description": "Rate limit key name applicable only for the following key types: HTTP_HEADER -- Name of the HTTP header whose value is taken as the key value. HTTP_COOKIE -- Name of the HTTP cookie whose value is taken as the key value.",
"type": "string"
},
- "storageBytesStatus": {
- "description": "[Output Only] An indicator whether storageBytes is in a stable state or it is being adjusted as a result of shared storage reallocation. This status can either be UPDATING, meaning the size of the snapshot is being updated, or UP_TO_DATE, meaning the size of the snapshot is up-to-date.",
+ "enforceOnKeyType": {
+ "description": "Determines the key to enforce the rate_limit_threshold on. Possible values are: - ALL: A single rate limit threshold is applied to all the requests matching this rule. This is the default value if \"enforceOnKeyConfigs\" is not configured. - IP: The source IP address of the request is the key. Each IP has this limit enforced separately. - HTTP_HEADER: The value of the HTTP header whose name is configured under \"enforceOnKeyName\". The key value is truncated to the first 128 bytes of the header value. If no such header is present in the request, the key type defaults to ALL. - XFF_IP: The first IP address (i.e. the originating client IP address) specified in the list of IPs under X-Forwarded-For HTTP header. If no such header is present or the value is not a valid IP, the key defaults to the source IP address of the request i.e. key type IP. - HTTP_COOKIE: The value of the HTTP cookie whose name is configured under \"enforceOnKeyName\". The key value is truncated to the first 128 bytes of the cookie value. If no such cookie is present in the request, the key type defaults to ALL. - HTTP_PATH: The URL path of the HTTP request. The key value is truncated to the first 128 bytes. - SNI: Server name indication in the TLS session of the HTTPS request. The key value is truncated to the first 128 bytes. The key type defaults to ALL on a HTTP session. - REGION_CODE: The country/region from which the request originates. - TLS_JA3_FINGERPRINT: JA3 TLS/SSL fingerprint if the client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the key type defaults to ALL. - USER_IP: The IP address of the originating client, which is resolved based on \"userIpRequestHeaders\" configured with the security policy. If there is no \"userIpRequestHeaders\" configuration or an IP address cannot be resolved from it, the key type defaults to IP. ",
"enum": [
- "UPDATING",
- "UP_TO_DATE"
+ "ALL",
+ "HTTP_COOKIE",
+ "HTTP_HEADER",
+ "HTTP_PATH",
+ "IP",
+ "REGION_CODE",
+ "SNI",
+ "TLS_JA3_FINGERPRINT",
+ "USER_IP",
+ "XFF_IP"
],
"enumDescriptions": [
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
"",
""
],
"type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "SecurityPolicyRuleRateLimitOptionsThreshold": {
+ "id": "SecurityPolicyRuleRateLimitOptionsThreshold",
+ "properties": {
+ "count": {
+ "description": "Number of HTTP(S) requests for calculating the threshold.",
+ "format": "int32",
+ "type": "integer"
+ },
+ "intervalSec": {
+ "description": "Interval over which the threshold is computed.",
+ "format": "int32",
+ "type": "integer"
+ }
+ },
+ "type": "object"
+ },
+ "SecurityPolicyRuleRedirectOptions": {
+ "id": "SecurityPolicyRuleRedirectOptions",
+ "properties": {
+ "target": {
+ "description": "Target for the redirect action. This is required if the type is EXTERNAL_302 and cannot be specified for GOOGLE_RECAPTCHA.",
+ "type": "string"
},
"type": {
- "description": "Specifies the type of the attached disk, either SCRATCH or PERSISTENT.",
+ "description": "Type of the redirect action.",
"enum": [
- "PERSISTENT",
- "SCRATCH"
+ "EXTERNAL_302",
+ "GOOGLE_RECAPTCHA"
],
"enumDescriptions": [
"",
@@ -67648,225 +72568,277 @@
},
"type": "object"
},
- "SavedDisk": {
- "description": "An instance-attached disk resource.",
- "id": "SavedDisk",
+ "SecurityPolicyUserDefinedField": {
+ "id": "SecurityPolicyUserDefinedField",
"properties": {
- "architecture": {
- "description": "[Output Only] The architecture of the attached disk.",
+ "base": {
+ "description": "The base relative to which 'offset' is measured. Possible values are: - IPV4: Points to the beginning of the IPv4 header. - IPV6: Points to the beginning of the IPv6 header. - TCP: Points to the beginning of the TCP header, skipping over any IPv4 options or IPv6 extension headers. Not present for non-first fragments. - UDP: Points to the beginning of the UDP header, skipping over any IPv4 options or IPv6 extension headers. Not present for non-first fragments. required",
"enum": [
- "ARCHITECTURE_UNSPECIFIED",
- "ARM64",
- "X86_64"
+ "IPV4",
+ "IPV6",
+ "TCP",
+ "UDP"
],
"enumDescriptions": [
- "Default value indicating Architecture is not set.",
- "Machines with architecture ARM64",
- "Machines with architecture X86_64"
+ "",
+ "",
+ "",
+ ""
],
"type": "string"
},
- "kind": {
- "default": "compute#savedDisk",
- "description": "[Output Only] Type of the resource. Always compute#savedDisk for attached disks.",
+ "mask": {
+ "description": "If specified, apply this mask (bitwise AND) to the field to ignore bits before matching. Encoded as a hexadecimal number (starting with \"0x\"). The last byte of the field (in network byte order) corresponds to the least significant byte of the mask.",
"type": "string"
},
- "sourceDisk": {
- "description": "Specifies a URL of the disk attached to the source instance.",
+ "name": {
+ "description": "The name of this field. Must be unique within the policy.",
"type": "string"
},
- "storageBytes": {
- "description": "[Output Only] Size of the individual disk snapshot used by this machine image.",
- "format": "int64",
- "type": "string"
+ "offset": {
+ "description": "Offset of the first byte of the field (in network byte order) relative to 'base'.",
+ "format": "int32",
+ "type": "integer"
},
- "storageBytesStatus": {
- "description": "[Output Only] An indicator whether storageBytes is in a stable state or it is being adjusted as a result of shared storage reallocation. This status can either be UPDATING, meaning the size of the snapshot is being updated, or UP_TO_DATE, meaning the size of the snapshot is up-to-date.",
- "enum": [
- "UPDATING",
- "UP_TO_DATE"
- ],
- "enumDescriptions": [
- "",
- ""
- ],
+ "size": {
+ "description": "Size of the field in bytes. Valid values: 1-4.",
+ "format": "int32",
+ "type": "integer"
+ }
+ },
+ "type": "object"
+ },
+ "SecuritySettings": {
+ "description": "The authentication and authorization settings for a BackendService.",
+ "id": "SecuritySettings",
+ "properties": {
+ "awsV4Authentication": {
+ "$ref": "AWSV4Signature",
+ "description": "The configuration needed to generate a signature for access to private storage buckets that support AWS's Signature Version 4 for authentication. Allowed only for INTERNET_IP_PORT and INTERNET_FQDN_PORT NEG backends."
+ },
+ "clientTlsPolicy": {
+ "description": "Optional. A URL referring to a networksecurity.ClientTlsPolicy resource that describes how clients should authenticate with this service's backends. clientTlsPolicy only applies to a global BackendService with the loadBalancingScheme set to INTERNAL_SELF_MANAGED. If left blank, communications are not encrypted.",
"type": "string"
+ },
+ "subjectAltNames": {
+ "description": "Optional. A list of Subject Alternative Names (SANs) that the client verifies during a mutual TLS handshake with an server/endpoint for this BackendService. When the server presents its X.509 certificate to the client, the client inspects the certificate's subjectAltName field. If the field contains one of the specified values, the communication continues. Otherwise, it fails. This additional check enables the client to verify that the server is authorized to run the requested service. Note that the contents of the server certificate's subjectAltName field are configured by the Public Key Infrastructure which provisions server identities. Only applies to a global BackendService with loadBalancingScheme set to INTERNAL_SELF_MANAGED. Only applies when BackendService has an attached clientTlsPolicy with clientCertificate (mTLS mode).",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
}
},
"type": "object"
},
- "ScalingScheduleStatus": {
- "id": "ScalingScheduleStatus",
+ "SerialPortOutput": {
+ "description": "An instance serial console output.",
+ "id": "SerialPortOutput",
"properties": {
- "lastStartTime": {
- "description": "[Output Only] The last time the scaling schedule became active. Note: this is a timestamp when a schedule actually became active, not when it was planned to do so. The timestamp is in RFC3339 text format.",
+ "contents": {
+ "description": "[Output Only] The contents of the console output.",
"type": "string"
},
- "nextStartTime": {
- "description": "[Output Only] The next time the scaling schedule is to become active. Note: this is a timestamp when a schedule is planned to run, but the actual time might be slightly different. The timestamp is in RFC3339 text format.",
+ "kind": {
+ "default": "compute#serialPortOutput",
+ "description": "[Output Only] Type of the resource. Always compute#serialPortOutput for serial port output.",
"type": "string"
},
- "state": {
- "description": "[Output Only] The current state of a scaling schedule.",
+ "next": {
+ "description": "[Output Only] The position of the next byte of content, regardless of whether the content exists, following the output returned in the `contents` property. Use this value in the next request as the start parameter.",
+ "format": "int64",
+ "type": "string"
+ },
+ "selfLink": {
+ "description": "[Output Only] Server-defined URL for this resource.",
+ "type": "string"
+ },
+ "start": {
+ "description": "The starting byte position of the output that was returned. This should match the start parameter sent with the request. If the serial console output exceeds the size of the buffer (1 MB), older output is overwritten by newer content. The output start value will indicate the byte position of the output that was returned, which might be different than the `start` value that was specified in the request.",
+ "format": "int64",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "ServerBinding": {
+ "id": "ServerBinding",
+ "properties": {
+ "type": {
"enum": [
- "ACTIVE",
- "DISABLED",
- "OBSOLETE",
- "READY"
+ "RESTART_NODE_ON_ANY_SERVER",
+ "RESTART_NODE_ON_MINIMAL_SERVERS",
+ "SERVER_BINDING_TYPE_UNSPECIFIED"
],
"enumDescriptions": [
- "The current autoscaling recommendation is influenced by this scaling schedule.",
- "This scaling schedule has been disabled by the user.",
- "This scaling schedule will never become active again.",
- "The current autoscaling recommendation is not influenced by this scaling schedule."
+ "Node may associate with any physical server over its lifetime.",
+ "Node may associate with minimal physical servers over its lifetime.",
+ ""
],
"type": "string"
}
},
"type": "object"
},
- "Scheduling": {
- "description": "Sets the scheduling options for an Instance.",
- "id": "Scheduling",
+ "ServiceAccount": {
+ "description": "A service account.",
+ "id": "ServiceAccount",
"properties": {
- "automaticRestart": {
- "description": "Specifies whether the instance should be automatically restarted if it is terminated by Compute Engine (not terminated by a user). You can only set the automatic restart option for standard instances. Preemptible instances cannot be automatically restarted. By default, this is set to true so an instance is automatically restarted if it is terminated by Compute Engine.",
- "type": "boolean"
+ "email": {
+ "description": "Email address of the service account.",
+ "type": "string"
},
- "instanceTerminationAction": {
- "description": "Specifies the termination action for the instance.",
+ "scopes": {
+ "description": "The list of scopes to be made available for this service account.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ }
+ },
+ "type": "object"
+ },
+ "ServiceAttachment": {
+ "description": "Represents a ServiceAttachment resource. A service attachment represents a service that a producer has exposed. It encapsulates the load balancer which fronts the service runs and a list of NAT IP ranges that the producers uses to represent the consumers connecting to the service.",
+ "id": "ServiceAttachment",
+ "properties": {
+ "connectedEndpoints": {
+ "description": "[Output Only] An array of connections for all the consumers connected to this service attachment.",
+ "items": {
+ "$ref": "ServiceAttachmentConnectedEndpoint"
+ },
+ "type": "array"
+ },
+ "connectionPreference": {
+ "description": "The connection preference of service attachment. The value can be set to ACCEPT_AUTOMATIC. An ACCEPT_AUTOMATIC service attachment is one that always accepts the connection from consumer forwarding rules.",
"enum": [
- "DELETE",
- "INSTANCE_TERMINATION_ACTION_UNSPECIFIED",
- "STOP"
+ "ACCEPT_AUTOMATIC",
+ "ACCEPT_MANUAL",
+ "CONNECTION_PREFERENCE_UNSPECIFIED"
],
"enumDescriptions": [
- "Delete the VM.",
- "Default value. This value is unused.",
- "Stop the VM without storing in-memory content. default action."
+ "",
+ "",
+ ""
],
"type": "string"
},
- "localSsdRecoveryTimeout": {
- "$ref": "Duration",
- "description": "Specifies the maximum amount of time a Local Ssd Vm should wait while recovery of the Local Ssd state is attempted. Its value should be in between 0 and 168 hours with hour granularity and the default value being 1 hour."
+ "consumerAcceptLists": {
+ "description": "Specifies which consumer projects or networks are allowed to connect to the service attachment. Each project or network has a connection limit. A given service attachment can manage connections at either the project or network level. Therefore, both the accept and reject lists for a given service attachment must contain either only projects or only networks.",
+ "items": {
+ "$ref": "ServiceAttachmentConsumerProjectLimit"
+ },
+ "type": "array"
},
- "locationHint": {
- "description": "An opaque location hint used to place the instance close to other resources. This field is for use by internal tools that use the public API.",
- "type": "string"
+ "consumerRejectLists": {
+ "description": "Specifies a list of projects or networks that are not allowed to connect to this service attachment. The project can be specified using its project ID or project number and the network can be specified using its URL. A given service attachment can manage connections at either the project or network level. Therefore, both the reject and accept lists for a given service attachment must contain either only projects or only networks.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
},
- "minNodeCpus": {
- "description": "The minimum number of virtual CPUs this instance will consume when running on a sole-tenant node.",
- "format": "int32",
- "type": "integer"
+ "creationTimestamp": {
+ "description": "[Output Only] Creation timestamp in RFC3339 text format.",
+ "type": "string"
},
- "nodeAffinities": {
- "description": "A set of node affinity and anti-affinity configurations. Refer to Configuring node affinity for more information. Overrides reservationAffinity.",
+ "description": {
+ "description": "An optional description of this resource. Provide this property when you create the resource.",
+ "type": "string"
+ },
+ "domainNames": {
+ "description": "If specified, the domain name will be used during the integration between the PSC connected endpoints and the Cloud DNS. For example, this is a valid domain name: \"p.mycompany.com.\". Current max number of domain names supported is 1.",
"items": {
- "$ref": "SchedulingNodeAffinity"
+ "type": "string"
},
"type": "array"
},
- "onHostMaintenance": {
- "description": "Defines the maintenance behavior for this instance. For standard instances, the default behavior is MIGRATE. For preemptible instances, the default and only possible behavior is TERMINATE. For more information, see Set VM host maintenance policy.",
- "enum": [
- "MIGRATE",
- "TERMINATE"
- ],
- "enumDescriptions": [
- "*[Default]* Allows Compute Engine to automatically migrate instances out of the way of maintenance events.",
- "Tells Compute Engine to terminate and (optionally) restart the instance away from the maintenance activity. If you would like your instance to be restarted, set the automaticRestart flag to true. Your instance may be restarted more than once, and it may be restarted outside the window of maintenance events."
- ],
- "type": "string"
- },
- "preemptible": {
- "description": "Defines whether the instance is preemptible. This can only be set during instance creation or while the instance is stopped and therefore, in a `TERMINATED` state. See Instance Life Cycle for more information on the possible instance states.",
+ "enableProxyProtocol": {
+ "description": "If true, enable the proxy protocol which is for supplying client TCP/IP address data in TCP connections that traverse proxies on their way to destination servers.",
"type": "boolean"
},
- "provisioningModel": {
- "description": "Specifies the provisioning model of the instance.",
- "enum": [
- "SPOT",
- "STANDARD"
- ],
- "enumDescriptions": [
- "Heavily discounted, no guaranteed runtime.",
- "Standard provisioning with user controlled runtime, no discounts."
- ],
+ "fingerprint": {
+ "description": "Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a ServiceAttachment. An up-to-date fingerprint must be provided in order to patch/update the ServiceAttachment; otherwise, the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the ServiceAttachment.",
+ "format": "byte",
"type": "string"
- }
- },
- "type": "object"
- },
- "SchedulingNodeAffinity": {
- "description": "Node Affinity: the configuration of desired nodes onto which this Instance could be scheduled.",
- "id": "SchedulingNodeAffinity",
- "properties": {
- "key": {
- "description": "Corresponds to the label key of Node resource.",
+ },
+ "id": {
+ "description": "[Output Only] The unique identifier for the resource type. The server generates this identifier.",
+ "format": "uint64",
"type": "string"
},
- "operator": {
- "description": "Defines the operation of node selection. Valid operators are IN for affinity and NOT_IN for anti-affinity.",
- "enum": [
- "IN",
- "NOT_IN",
- "OPERATOR_UNSPECIFIED"
- ],
- "enumDescriptions": [
- "Requires Compute Engine to seek for matched nodes.",
- "Requires Compute Engine to avoid certain nodes.",
- ""
- ],
+ "kind": {
+ "default": "compute#serviceAttachment",
+ "description": "[Output Only] Type of the resource. Always compute#serviceAttachment for service attachments.",
"type": "string"
},
- "values": {
- "description": "Corresponds to the label values of Node resource.",
+ "name": {
+ "annotations": {
+ "required": [
+ "compute.serviceAttachments.insert"
+ ]
+ },
+ "description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "type": "string"
+ },
+ "natSubnets": {
+ "description": "An array of URLs where each entry is the URL of a subnet provided by the service producer to use for NAT in this service attachment.",
"items": {
"type": "string"
},
"type": "array"
- }
- },
- "type": "object"
- },
- "Screenshot": {
- "description": "An instance's screenshot.",
- "id": "Screenshot",
- "properties": {
- "contents": {
- "description": "[Output Only] The Base64-encoded screenshot data.",
+ },
+ "producerForwardingRule": {
+ "deprecated": true,
+ "description": "The URL of a forwarding rule with loadBalancingScheme INTERNAL* that is serving the endpoint identified by this service attachment.",
"type": "string"
},
- "kind": {
- "default": "compute#screenshot",
- "description": "[Output Only] Type of the resource. Always compute#screenshot for the screenshots.",
+ "propagatedConnectionLimit": {
+ "description": "The number of consumer spokes that connected Private Service Connect endpoints can be propagated to through Network Connectivity Center. This limit lets the service producer limit how many propagated Private Service Connect connections can be established to this service attachment from a single consumer. If the connection preference of the service attachment is ACCEPT_MANUAL, the limit applies to each project or network that is listed in the consumer accept list. If the connection preference of the service attachment is ACCEPT_AUTOMATIC, the limit applies to each project that contains a connected endpoint. If unspecified, the default propagated connection limit is 250.",
+ "format": "uint32",
+ "type": "integer"
+ },
+ "pscServiceAttachmentId": {
+ "$ref": "Uint128",
+ "description": "[Output Only] An 128-bit global unique ID of the PSC service attachment."
+ },
+ "reconcileConnections": {
+ "description": "This flag determines whether a consumer accept/reject list change can reconcile the statuses of existing ACCEPTED or REJECTED PSC endpoints. - If false, connection policy update will only affect existing PENDING PSC endpoints. Existing ACCEPTED/REJECTED endpoints will remain untouched regardless how the connection policy is modified . - If true, update will affect both PENDING and ACCEPTED/REJECTED PSC endpoints. For example, an ACCEPTED PSC endpoint will be moved to REJECTED if its project is added to the reject list. For newly created service attachment, this boolean defaults to false.",
+ "type": "boolean"
+ },
+ "region": {
+ "description": "[Output Only] URL of the region where the service attachment resides. This field applies only to the region resource. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.",
+ "type": "string"
+ },
+ "selfLink": {
+ "description": "[Output Only] Server-defined URL for the resource.",
+ "type": "string"
+ },
+ "targetService": {
+ "description": "The URL of a service serving the endpoint identified by this service attachment.",
"type": "string"
}
},
"type": "object"
},
- "SecurityPoliciesAggregatedList": {
- "id": "SecurityPoliciesAggregatedList",
+ "ServiceAttachmentAggregatedList": {
+ "description": "Contains a list of ServiceAttachmentsScopedList.",
+ "id": "ServiceAttachmentAggregatedList",
"properties": {
- "etag": {
- "type": "string"
- },
"id": {
"description": "[Output Only] Unique identifier for the resource; defined by the server.",
"type": "string"
},
"items": {
"additionalProperties": {
- "$ref": "SecurityPoliciesScopedList",
- "description": "Name of the scope containing this set of security policies."
+ "$ref": "ServiceAttachmentsScopedList",
+ "description": "Name of the scope containing this set of ServiceAttachments."
},
- "description": "A list of SecurityPoliciesScopedList resources.",
+ "description": "A list of ServiceAttachmentsScopedList resources.",
"type": "object"
},
"kind": {
- "default": "compute#securityPoliciesAggregatedList",
- "description": "[Output Only] Type of resource. Always compute#securityPolicyAggregatedList for lists of Security Policies.",
+ "default": "compute#serviceAttachmentAggregatedList",
+ "description": "Type of resource.",
"type": "string"
},
"nextPageToken": {
@@ -68008,27 +72980,99 @@
},
"type": "object"
},
- "SecurityPoliciesListPreconfiguredExpressionSetsResponse": {
- "id": "SecurityPoliciesListPreconfiguredExpressionSetsResponse",
+ "ServiceAttachmentConnectedEndpoint": {
+ "description": "[Output Only] A connection connected to this service attachment.",
+ "id": "ServiceAttachmentConnectedEndpoint",
"properties": {
- "preconfiguredExpressionSets": {
- "$ref": "SecurityPoliciesWafConfig"
+ "consumerNetwork": {
+ "description": "The url of the consumer network.",
+ "type": "string"
+ },
+ "endpoint": {
+ "description": "The url of a connected endpoint.",
+ "type": "string"
+ },
+ "propagatedConnectionCount": {
+ "description": "The number of consumer Network Connectivity Center spokes that the connected Private Service Connect endpoint has propagated to.",
+ "format": "uint32",
+ "type": "integer"
+ },
+ "pscConnectionId": {
+ "description": "The PSC connection id of the connected endpoint.",
+ "format": "uint64",
+ "type": "string"
+ },
+ "status": {
+ "description": "The status of a connected endpoint to this service attachment.",
+ "enum": [
+ "ACCEPTED",
+ "CLOSED",
+ "NEEDS_ATTENTION",
+ "PENDING",
+ "REJECTED",
+ "STATUS_UNSPECIFIED"
+ ],
+ "enumDescriptions": [
+ "The connection has been accepted by the producer.",
+ "The connection has been closed by the producer.",
+ "The connection has been accepted by the producer, but the producer needs to take further action before the forwarding rule can serve traffic.",
+ "The connection is pending acceptance by the producer.",
+ "The consumer is still connected but not using the connection.",
+ ""
+ ],
+ "type": "string"
}
},
"type": "object"
},
- "SecurityPoliciesScopedList": {
- "id": "SecurityPoliciesScopedList",
+ "ServiceAttachmentConsumerProjectLimit": {
+ "id": "ServiceAttachmentConsumerProjectLimit",
"properties": {
- "securityPolicies": {
- "description": "A list of SecurityPolicies contained in this scope.",
+ "connectionLimit": {
+ "description": "The value of the limit to set.",
+ "format": "uint32",
+ "type": "integer"
+ },
+ "networkUrl": {
+ "description": "The network URL for the network to set the limit for.",
+ "type": "string"
+ },
+ "projectIdOrNum": {
+ "description": "The project id or number for the project to set the limit for.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "ServiceAttachmentList": {
+ "id": "ServiceAttachmentList",
+ "properties": {
+ "id": {
+ "description": "[Output Only] Unique identifier for the resource; defined by the server.",
+ "type": "string"
+ },
+ "items": {
+ "description": "A list of ServiceAttachment resources.",
"items": {
- "$ref": "SecurityPolicy"
+ "$ref": "ServiceAttachment"
},
"type": "array"
},
+ "kind": {
+ "default": "compute#serviceAttachmentList",
+ "description": "[Output Only] Type of the resource. Always compute#serviceAttachment for service attachments.",
+ "type": "string"
+ },
+ "nextPageToken": {
+ "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
+ "type": "string"
+ },
+ "selfLink": {
+ "description": "[Output Only] Server-defined URL for this resource.",
+ "type": "string"
+ },
"warning": {
- "description": "Informational warning which replaces the list of security policies when the list is empty.",
+ "description": "[Output Only] Informational warning message.",
"properties": {
"code": {
"description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.",
@@ -68087,338 +73131,82 @@
false,
false,
false,
- false,
- false,
- false,
- false
- ],
- "enumDescriptions": [
- "Warning about failed cleanup of transient changes made by a failed operation.",
- "A link to a deprecated resource was created.",
- "When deploying and at least one of the resources has a type marked as deprecated",
- "The user created a boot disk that is larger than image size.",
- "When deploying and at least one of the resources has a type marked as experimental",
- "Warning that is present in an external api call",
- "Warning that value of a field has been overridden. Deprecated unused field.",
- "The operation involved use of an injected kernel, which is deprecated.",
- "A WEIGHTED_MAGLEV backend service is associated with a health check that is not of type HTTP/HTTPS/HTTP2.",
- "When deploying a deployment with a exceedingly large number of resources",
- "Resource can't be retrieved due to list overhead quota exceed which captures the amount of resources filtered out by user-defined list filter.",
- "A resource depends on a missing type",
- "The route's nextHopIp address is not assigned to an instance on the network.",
- "The route's next hop instance cannot ip forward.",
- "The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route.",
- "The route's nextHopInstance URL refers to an instance that does not exist.",
- "The route's nextHopInstance URL refers to an instance that is not on the same network as the route.",
- "The route's next hop instance does not have a status of RUNNING.",
- "Error which is not critical. We decided to continue the process despite the mentioned error.",
- "No results are present on a particular list page.",
- "Success is reported, but some results may be missing due to errors",
- "The user attempted to use a resource that requires a TOS they have not accepted.",
- "Warning that a resource is in use.",
- "One or more of the resources set to auto-delete could not be deleted because they were in use.",
- "When a resource schema validation is ignored.",
- "Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group.",
- "When undeclared properties in the schema are present",
- "A given scope cannot be reached."
- ],
- "type": "string"
- },
- "data": {
- "description": "[Output Only] Metadata about this warning in key: value format. For example: \"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" } ",
- "items": {
- "properties": {
- "key": {
- "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).",
- "type": "string"
- },
- "value": {
- "description": "[Output Only] A warning data value corresponding to the key.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "type": "array"
- },
- "message": {
- "description": "[Output Only] A human-readable description of the warning code.",
- "type": "string"
- }
- },
- "type": "object"
- }
- },
- "type": "object"
- },
- "SecurityPoliciesWafConfig": {
- "id": "SecurityPoliciesWafConfig",
- "properties": {
- "wafRules": {
- "$ref": "PreconfiguredWafSet"
- }
- },
- "type": "object"
- },
- "SecurityPolicy": {
- "description": "Represents a Google Cloud Armor security policy resource. Only external backend services that use load balancers can reference a security policy. For more information, see Google Cloud Armor security policy overview.",
- "id": "SecurityPolicy",
- "properties": {
- "adaptiveProtectionConfig": {
- "$ref": "SecurityPolicyAdaptiveProtectionConfig"
- },
- "advancedOptionsConfig": {
- "$ref": "SecurityPolicyAdvancedOptionsConfig"
- },
- "creationTimestamp": {
- "description": "[Output Only] Creation timestamp in RFC3339 text format.",
- "type": "string"
- },
- "ddosProtectionConfig": {
- "$ref": "SecurityPolicyDdosProtectionConfig"
- },
- "description": {
- "description": "An optional description of this resource. Provide this property when you create the resource.",
- "type": "string"
- },
- "fingerprint": {
- "description": "Specifies a fingerprint for this resource, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make get() request to the security policy.",
- "format": "byte",
- "type": "string"
- },
- "id": {
- "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.",
- "format": "uint64",
- "type": "string"
- },
- "kind": {
- "default": "compute#securityPolicy",
- "description": "[Output only] Type of the resource. Always compute#securityPolicyfor security policies",
- "type": "string"
- },
- "labelFingerprint": {
- "description": "A fingerprint for the labels being applied to this security policy, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels. To see the latest fingerprint, make get() request to the security policy.",
- "format": "byte",
- "type": "string"
- },
- "labels": {
- "additionalProperties": {
- "type": "string"
- },
- "description": "Labels for this resource. These can only be added or modified by the setLabels method. Each label key/value pair must comply with RFC1035. Label values may be empty.",
- "type": "object"
- },
- "name": {
- "description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- "type": "string"
- },
- "recaptchaOptionsConfig": {
- "$ref": "SecurityPolicyRecaptchaOptionsConfig"
- },
- "region": {
- "description": "[Output Only] URL of the region where the regional security policy resides. This field is not applicable to global security policies.",
- "type": "string"
- },
- "rules": {
- "description": "A list of rules that belong to this policy. There must always be a default rule which is a rule with priority 2147483647 and match all condition (for the match condition this means match \"*\" for srcIpRanges and for the networkMatch condition every field must be either match \"*\" or not set). If no rules are provided when creating a security policy, a default rule with action \"allow\" will be added.",
- "items": {
- "$ref": "SecurityPolicyRule"
- },
- "type": "array"
- },
- "selfLink": {
- "description": "[Output Only] Server-defined URL for the resource.",
- "type": "string"
- },
- "type": {
- "description": "The type indicates the intended use of the security policy. - CLOUD_ARMOR: Cloud Armor backend security policies can be configured to filter incoming HTTP requests targeting backend services. They filter requests before they hit the origin servers. - CLOUD_ARMOR_EDGE: Cloud Armor edge security policies can be configured to filter incoming HTTP requests targeting backend services (including Cloud CDN-enabled) as well as backend buckets (Cloud Storage). They filter requests before the request is served from Google's cache. - CLOUD_ARMOR_INTERNAL_SERVICE: Cloud Armor internal service policies can be configured to filter HTTP requests targeting services managed by Traffic Director in a service mesh. They filter requests before the request is served from the application. - CLOUD_ARMOR_NETWORK: Cloud Armor network policies can be configured to filter packets targeting network load balancing resources such as backend services, target pools, target instances, and instances with external IPs. They filter requests before the request is served from the application. This field can be set only at resource creation time.",
- "enum": [
- "CLOUD_ARMOR",
- "CLOUD_ARMOR_EDGE",
- "CLOUD_ARMOR_NETWORK"
- ],
- "enumDescriptions": [
- "",
- "",
- ""
- ],
- "type": "string"
- },
- "userDefinedFields": {
- "description": "Definitions of user-defined fields for CLOUD_ARMOR_NETWORK policies. A user-defined field consists of up to 4 bytes extracted from a fixed offset in the packet, relative to the IPv4, IPv6, TCP, or UDP header, with an optional mask to select certain bits. Rules may then specify matching values for these fields. Example: userDefinedFields: - name: \"ipv4_fragment_offset\" base: IPV4 offset: 6 size: 2 mask: \"0x1fff\"",
- "items": {
- "$ref": "SecurityPolicyUserDefinedField"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "SecurityPolicyAdaptiveProtectionConfig": {
- "description": "Configuration options for Cloud Armor Adaptive Protection (CAAP).",
- "id": "SecurityPolicyAdaptiveProtectionConfig",
- "properties": {
- "layer7DdosDefenseConfig": {
- "$ref": "SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfig",
- "description": "If set to true, enables Cloud Armor Machine Learning."
- }
- },
- "type": "object"
- },
- "SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfig": {
- "description": "Configuration options for L7 DDoS detection. This field is only supported in Global Security Policies of type CLOUD_ARMOR.",
- "id": "SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfig",
- "properties": {
- "enable": {
- "description": "If set to true, enables CAAP for L7 DDoS detection. This field is only supported in Global Security Policies of type CLOUD_ARMOR.",
- "type": "boolean"
- },
- "ruleVisibility": {
- "description": "Rule visibility can be one of the following: STANDARD - opaque rules. (default) PREMIUM - transparent rules. This field is only supported in Global Security Policies of type CLOUD_ARMOR.",
- "enum": [
- "PREMIUM",
- "STANDARD"
- ],
- "enumDescriptions": [
- "",
- ""
- ],
- "type": "string"
- },
- "thresholdConfigs": {
- "description": "Configuration options for layer7 adaptive protection for various customizable thresholds.",
- "items": {
- "$ref": "SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfig"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfig": {
- "id": "SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfig",
- "properties": {
- "autoDeployConfidenceThreshold": {
- "format": "float",
- "type": "number"
- },
- "autoDeployExpirationSec": {
- "format": "int32",
- "type": "integer"
- },
- "autoDeployImpactedBaselineThreshold": {
- "format": "float",
- "type": "number"
- },
- "autoDeployLoadThreshold": {
- "format": "float",
- "type": "number"
- },
- "name": {
- "description": "The name must be 1-63 characters long, and comply with RFC1035. The name must be unique within the security policy.",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- "type": "string"
- }
- },
- "type": "object"
- },
- "SecurityPolicyAdvancedOptionsConfig": {
- "id": "SecurityPolicyAdvancedOptionsConfig",
- "properties": {
- "jsonCustomConfig": {
- "$ref": "SecurityPolicyAdvancedOptionsConfigJsonCustomConfig",
- "description": "Custom configuration to apply the JSON parsing. Only applicable when json_parsing is set to STANDARD."
- },
- "jsonParsing": {
- "enum": [
- "DISABLED",
- "STANDARD",
- "STANDARD_WITH_GRAPHQL"
- ],
- "enumDescriptions": [
- "",
- "",
- ""
- ],
- "type": "string"
- },
- "logLevel": {
- "enum": [
- "NORMAL",
- "VERBOSE"
- ],
- "enumDescriptions": [
- "",
- ""
- ],
- "type": "string"
- },
- "userIpRequestHeaders": {
- "description": "An optional list of case-insensitive request header names to use for resolving the callers client IP address.",
- "items": {
- "type": "string"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "SecurityPolicyAdvancedOptionsConfigJsonCustomConfig": {
- "id": "SecurityPolicyAdvancedOptionsConfigJsonCustomConfig",
- "properties": {
- "contentTypes": {
- "description": "A list of custom Content-Type header values to apply the JSON parsing. As per RFC 1341, a Content-Type header value has the following format: Content-Type := type \"/\" subtype *[\";\" parameter] When configuring a custom Content-Type header value, only the type/subtype needs to be specified, and the parameters should be excluded.",
- "items": {
- "type": "string"
+ false,
+ false,
+ false,
+ false
+ ],
+ "enumDescriptions": [
+ "Warning about failed cleanup of transient changes made by a failed operation.",
+ "A link to a deprecated resource was created.",
+ "When deploying and at least one of the resources has a type marked as deprecated",
+ "The user created a boot disk that is larger than image size.",
+ "When deploying and at least one of the resources has a type marked as experimental",
+ "Warning that is present in an external api call",
+ "Warning that value of a field has been overridden. Deprecated unused field.",
+ "The operation involved use of an injected kernel, which is deprecated.",
+ "A WEIGHTED_MAGLEV backend service is associated with a health check that is not of type HTTP/HTTPS/HTTP2.",
+ "When deploying a deployment with a exceedingly large number of resources",
+ "Resource can't be retrieved due to list overhead quota exceed which captures the amount of resources filtered out by user-defined list filter.",
+ "A resource depends on a missing type",
+ "The route's nextHopIp address is not assigned to an instance on the network.",
+ "The route's next hop instance cannot ip forward.",
+ "The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route.",
+ "The route's nextHopInstance URL refers to an instance that does not exist.",
+ "The route's nextHopInstance URL refers to an instance that is not on the same network as the route.",
+ "The route's next hop instance does not have a status of RUNNING.",
+ "Error which is not critical. We decided to continue the process despite the mentioned error.",
+ "No results are present on a particular list page.",
+ "Success is reported, but some results may be missing due to errors",
+ "The user attempted to use a resource that requires a TOS they have not accepted.",
+ "Warning that a resource is in use.",
+ "One or more of the resources set to auto-delete could not be deleted because they were in use.",
+ "When a resource schema validation is ignored.",
+ "Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group.",
+ "When undeclared properties in the schema are present",
+ "A given scope cannot be reached."
+ ],
+ "type": "string"
+ },
+ "data": {
+ "description": "[Output Only] Metadata about this warning in key: value format. For example: \"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" } ",
+ "items": {
+ "properties": {
+ "key": {
+ "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).",
+ "type": "string"
+ },
+ "value": {
+ "description": "[Output Only] A warning data value corresponding to the key.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "type": "array"
+ },
+ "message": {
+ "description": "[Output Only] A human-readable description of the warning code.",
+ "type": "string"
+ }
},
- "type": "array"
- }
- },
- "type": "object"
- },
- "SecurityPolicyDdosProtectionConfig": {
- "id": "SecurityPolicyDdosProtectionConfig",
- "properties": {
- "ddosProtection": {
- "enum": [
- "ADVANCED",
- "STANDARD"
- ],
- "enumDescriptions": [
- "",
- ""
- ],
- "type": "string"
+ "type": "object"
}
},
"type": "object"
},
- "SecurityPolicyList": {
- "id": "SecurityPolicyList",
+ "ServiceAttachmentsScopedList": {
+ "id": "ServiceAttachmentsScopedList",
"properties": {
- "id": {
- "description": "[Output Only] Unique identifier for the resource; defined by the server.",
- "type": "string"
- },
- "items": {
- "description": "A list of SecurityPolicy resources.",
+ "serviceAttachments": {
+ "description": "A list of ServiceAttachments contained in this scope.",
"items": {
- "$ref": "SecurityPolicy"
+ "$ref": "ServiceAttachment"
},
"type": "array"
},
- "kind": {
- "default": "compute#securityPolicyList",
- "description": "[Output Only] Type of resource. Always compute#securityPolicyList for listsof securityPolicies",
- "type": "string"
- },
- "nextPageToken": {
- "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
- "type": "string"
- },
"warning": {
- "description": "[Output Only] Informational warning message.",
+ "description": "Informational warning which replaces the list of service attachments when the list is empty.",
"properties": {
"code": {
"description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.",
@@ -68541,544 +73329,389 @@
},
"type": "object"
},
- "SecurityPolicyRecaptchaOptionsConfig": {
- "id": "SecurityPolicyRecaptchaOptionsConfig",
+ "SetCommonInstanceMetadataOperationMetadata": {
+ "id": "SetCommonInstanceMetadataOperationMetadata",
"properties": {
- "redirectSiteKey": {
- "description": "An optional field to supply a reCAPTCHA site key to be used for all the rules using the redirect action with the type of GOOGLE_RECAPTCHA under the security policy. The specified site key needs to be created from the reCAPTCHA API. The user is responsible for the validity of the specified site key. If not specified, a Google-managed site key is used. This field is only supported in Global Security Policies of type CLOUD_ARMOR.",
+ "clientOperationId": {
+ "description": "[Output Only] The client operation id.",
"type": "string"
+ },
+ "perLocationOperations": {
+ "additionalProperties": {
+ "$ref": "SetCommonInstanceMetadataOperationMetadataPerLocationOperationInfo"
+ },
+ "description": "[Output Only] Status information per location (location name is key). Example key: zones/us-central1-a",
+ "type": "object"
}
},
"type": "object"
},
- "SecurityPolicyReference": {
- "id": "SecurityPolicyReference",
+ "SetCommonInstanceMetadataOperationMetadataPerLocationOperationInfo": {
+ "id": "SetCommonInstanceMetadataOperationMetadataPerLocationOperationInfo",
"properties": {
- "securityPolicy": {
+ "error": {
+ "$ref": "Status",
+ "description": "[Output Only] If state is `ABANDONED` or `FAILED`, this field is populated."
+ },
+ "state": {
+ "description": "[Output Only] Status of the action, which can be one of the following: `PROPAGATING`, `PROPAGATED`, `ABANDONED`, `FAILED`, or `DONE`.",
+ "enum": [
+ "ABANDONED",
+ "DONE",
+ "FAILED",
+ "PROPAGATED",
+ "PROPAGATING",
+ "UNSPECIFIED"
+ ],
+ "enumDescriptions": [
+ "Operation not tracked in this location e.g. zone is marked as DOWN.",
+ "Operation has completed successfully.",
+ "Operation is in an error state.",
+ "Operation is confirmed to be in the location.",
+ "Operation is not yet confirmed to have been created in the location.",
+ ""
+ ],
"type": "string"
}
},
"type": "object"
},
- "SecurityPolicyRule": {
- "description": "Represents a rule that describes one or more match conditions along with the action to be taken when traffic matches this condition (allow or deny).",
- "id": "SecurityPolicyRule",
+ "ShareSettings": {
+ "description": "The share setting for reservations and sole tenancy node groups.",
+ "id": "ShareSettings",
"properties": {
- "action": {
- "description": "The Action to perform when the rule is matched. The following are the valid actions: - allow: allow access to target. - deny(STATUS): deny access to target, returns the HTTP response code specified. Valid values for `STATUS` are 403, 404, and 502. - rate_based_ban: limit client traffic to the configured threshold and ban the client if the traffic exceeds the threshold. Configure parameters for this action in RateLimitOptions. Requires rate_limit_options to be set. - redirect: redirect to a different target. This can either be an internal reCAPTCHA redirect, or an external URL-based redirect via a 302 response. Parameters for this action can be configured via redirectOptions. This action is only supported in Global Security Policies of type CLOUD_ARMOR. - throttle: limit client traffic to the configured threshold. Configure parameters for this action in rateLimitOptions. Requires rate_limit_options to be set for this. ",
- "type": "string"
- },
- "description": {
- "description": "An optional description of this resource. Provide this property when you create the resource.",
- "type": "string"
- },
- "headerAction": {
- "$ref": "SecurityPolicyRuleHttpHeaderAction",
- "description": "Optional, additional actions that are performed on headers. This field is only supported in Global Security Policies of type CLOUD_ARMOR."
+ "projectMap": {
+ "additionalProperties": {
+ "$ref": "ShareSettingsProjectConfig"
+ },
+ "description": "A map of project id and project config. This is only valid when share_type's value is SPECIFIC_PROJECTS.",
+ "type": "object"
},
- "kind": {
- "default": "compute#securityPolicyRule",
- "description": "[Output only] Type of the resource. Always compute#securityPolicyRule for security policy rules",
+ "shareType": {
+ "description": "Type of sharing for this shared-reservation",
+ "enum": [
+ "LOCAL",
+ "ORGANIZATION",
+ "SHARE_TYPE_UNSPECIFIED",
+ "SPECIFIC_PROJECTS"
+ ],
+ "enumDescriptions": [
+ "Default value.",
+ "Shared-reservation is open to entire Organization",
+ "Default value. This value is unused.",
+ "Shared-reservation is open to specific projects"
+ ],
"type": "string"
- },
- "match": {
- "$ref": "SecurityPolicyRuleMatcher",
- "description": "A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced."
- },
- "networkMatch": {
- "$ref": "SecurityPolicyRuleNetworkMatcher",
- "description": "A match condition that incoming packets are evaluated against for CLOUD_ARMOR_NETWORK security policies. If it matches, the corresponding 'action' is enforced. The match criteria for a rule consists of built-in match fields (like 'srcIpRanges') and potentially multiple user-defined match fields ('userDefinedFields'). Field values may be extracted directly from the packet or derived from it (e.g. 'srcRegionCodes'). Some fields may not be present in every packet (e.g. 'srcPorts'). A user-defined field is only present if the base header is found in the packet and the entire field is in bounds. Each match field may specify which values can match it, listing one or more ranges, prefixes, or exact values that are considered a match for the field. A field value must be present in order to match a specified match field. If no match values are specified for a match field, then any field value is considered to match it, and it's not required to be present. For strings specifying '*' is also equivalent to match all. For a packet to match a rule, all specified match fields must match the corresponding field values derived from the packet. Example: networkMatch: srcIpRanges: - \"192.0.2.0/24\" - \"198.51.100.0/24\" userDefinedFields: - name: \"ipv4_fragment_offset\" values: - \"1-0x1fff\" The above match condition matches packets with a source IP in 192.0.2.0/24 or 198.51.100.0/24 and a user-defined field named \"ipv4_fragment_offset\" with a value between 1 and 0x1fff inclusive."
- },
- "preconfiguredWafConfig": {
- "$ref": "SecurityPolicyRulePreconfiguredWafConfig",
- "description": "Preconfigured WAF configuration to be applied for the rule. If the rule does not evaluate preconfigured WAF rules, i.e., if evaluatePreconfiguredWaf() is not used, this field will have no effect."
- },
- "preview": {
- "description": "If set to true, the specified action is not enforced.",
- "type": "boolean"
- },
- "priority": {
- "description": "An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest priority.",
- "format": "int32",
- "type": "integer"
- },
- "rateLimitOptions": {
- "$ref": "SecurityPolicyRuleRateLimitOptions",
- "description": "Must be specified if the action is \"rate_based_ban\" or \"throttle\". Cannot be specified for any other actions."
- },
- "redirectOptions": {
- "$ref": "SecurityPolicyRuleRedirectOptions",
- "description": "Parameters defining the redirect action. Cannot be specified for any other actions. This field is only supported in Global Security Policies of type CLOUD_ARMOR."
}
},
"type": "object"
},
- "SecurityPolicyRuleHttpHeaderAction": {
- "id": "SecurityPolicyRuleHttpHeaderAction",
+ "ShareSettingsProjectConfig": {
+ "description": "Config for each project in the share settings.",
+ "id": "ShareSettingsProjectConfig",
"properties": {
- "requestHeadersToAdds": {
- "description": "The list of request headers to add or overwrite if they're already present.",
- "items": {
- "$ref": "SecurityPolicyRuleHttpHeaderActionHttpHeaderOption"
- },
- "type": "array"
+ "projectId": {
+ "description": "The project ID, should be same as the key of this project config in the parent map.",
+ "type": "string"
}
},
"type": "object"
},
- "SecurityPolicyRuleHttpHeaderActionHttpHeaderOption": {
- "id": "SecurityPolicyRuleHttpHeaderActionHttpHeaderOption",
+ "ShieldedInstanceConfig": {
+ "description": "A set of Shielded Instance options.",
+ "id": "ShieldedInstanceConfig",
"properties": {
- "headerName": {
- "description": "The name of the header to set.",
- "type": "string"
+ "enableIntegrityMonitoring": {
+ "description": "Defines whether the instance has integrity monitoring enabled. Enabled by default.",
+ "type": "boolean"
},
- "headerValue": {
- "description": "The value to set the named header to.",
- "type": "string"
+ "enableSecureBoot": {
+ "description": "Defines whether the instance has Secure Boot enabled. Disabled by default.",
+ "type": "boolean"
+ },
+ "enableVtpm": {
+ "description": "Defines whether the instance has the vTPM enabled. Enabled by default.",
+ "type": "boolean"
}
},
"type": "object"
},
- "SecurityPolicyRuleMatcher": {
- "description": "Represents a match condition that incoming traffic is evaluated against. Exactly one field must be specified.",
- "id": "SecurityPolicyRuleMatcher",
+ "ShieldedInstanceIdentity": {
+ "description": "A Shielded Instance Identity.",
+ "id": "ShieldedInstanceIdentity",
"properties": {
- "config": {
- "$ref": "SecurityPolicyRuleMatcherConfig",
- "description": "The configuration options available when specifying versioned_expr. This field must be specified if versioned_expr is specified and cannot be specified if versioned_expr is not specified."
- },
- "expr": {
- "$ref": "Expr",
- "description": "User defined CEVAL expression. A CEVAL expression is used to specify match criteria such as origin.ip, source.region_code and contents in the request header. Expressions containing `evaluateThreatIntelligence` require Cloud Armor Managed Protection Plus tier and are not supported in Edge Policies nor in Regional Policies. Expressions containing `evaluatePreconfiguredExpr('sourceiplist-*')` require Cloud Armor Managed Protection Plus tier and are only supported in Global Security Policies."
- },
- "exprOptions": {
- "$ref": "SecurityPolicyRuleMatcherExprOptions",
- "description": "The configuration options available when specifying a user defined CEVAL expression (i.e., 'expr')."
+ "encryptionKey": {
+ "$ref": "ShieldedInstanceIdentityEntry",
+ "description": "An Endorsement Key (EK) made by the RSA 2048 algorithm issued to the Shielded Instance's vTPM."
},
- "versionedExpr": {
- "description": "Preconfigured versioned expression. If this field is specified, config must also be specified. Available preconfigured expressions along with their requirements are: SRC_IPS_V1 - must specify the corresponding src_ip_range field in config.",
- "enum": [
- "SRC_IPS_V1"
- ],
- "enumDescriptions": [
- "Matches the source IP address of a request to the IP ranges supplied in config."
- ],
+ "kind": {
+ "default": "compute#shieldedInstanceIdentity",
+ "description": "[Output Only] Type of the resource. Always compute#shieldedInstanceIdentity for shielded Instance identity entry.",
"type": "string"
+ },
+ "signingKey": {
+ "$ref": "ShieldedInstanceIdentityEntry",
+ "description": "An Attestation Key (AK) made by the RSA 2048 algorithm issued to the Shielded Instance's vTPM."
}
},
"type": "object"
},
- "SecurityPolicyRuleMatcherConfig": {
- "id": "SecurityPolicyRuleMatcherConfig",
+ "ShieldedInstanceIdentityEntry": {
+ "description": "A Shielded Instance Identity Entry.",
+ "id": "ShieldedInstanceIdentityEntry",
"properties": {
- "srcIpRanges": {
- "description": "CIDR IP address range. Maximum number of src_ip_ranges allowed is 10.",
- "items": {
- "type": "string"
- },
- "type": "array"
+ "ekCert": {
+ "description": "A PEM-encoded X.509 certificate. This field can be empty.",
+ "type": "string"
+ },
+ "ekPub": {
+ "description": "A PEM-encoded public key.",
+ "type": "string"
}
},
"type": "object"
},
- "SecurityPolicyRuleMatcherExprOptions": {
- "id": "SecurityPolicyRuleMatcherExprOptions",
+ "ShieldedInstanceIntegrityPolicy": {
+ "description": "The policy describes the baseline against which Instance boot integrity is measured.",
+ "id": "ShieldedInstanceIntegrityPolicy",
"properties": {
- "recaptchaOptions": {
- "$ref": "SecurityPolicyRuleMatcherExprOptionsRecaptchaOptions",
- "description": "reCAPTCHA configuration options to be applied for the rule. If the rule does not evaluate reCAPTCHA tokens, this field has no effect."
+ "updateAutoLearnPolicy": {
+ "description": "Updates the integrity policy baseline using the measurements from the VM instance's most recent boot.",
+ "type": "boolean"
}
},
"type": "object"
},
- "SecurityPolicyRuleMatcherExprOptionsRecaptchaOptions": {
- "id": "SecurityPolicyRuleMatcherExprOptionsRecaptchaOptions",
+ "SignedUrlKey": {
+ "description": "Represents a customer-supplied Signing Key used by Cloud CDN Signed URLs",
+ "id": "SignedUrlKey",
"properties": {
- "actionTokenSiteKeys": {
- "description": "A list of site keys to be used during the validation of reCAPTCHA action-tokens. The provided site keys need to be created from reCAPTCHA API under the same project where the security policy is created.",
- "items": {
- "type": "string"
- },
- "type": "array"
+ "keyName": {
+ "description": "Name of the key. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "type": "string"
},
- "sessionTokenSiteKeys": {
- "description": "A list of site keys to be used during the validation of reCAPTCHA session-tokens. The provided site keys need to be created from reCAPTCHA API under the same project where the security policy is created.",
- "items": {
- "type": "string"
- },
- "type": "array"
+ "keyValue": {
+ "description": "128-bit key value used for signing the URL. The key value must be a valid RFC 4648 Section 5 base64url encoded string.",
+ "type": "string"
}
},
"type": "object"
},
- "SecurityPolicyRuleNetworkMatcher": {
- "description": "Represents a match condition that incoming network traffic is evaluated against.",
- "id": "SecurityPolicyRuleNetworkMatcher",
+ "Snapshot": {
+ "description": "Represents a Persistent Disk Snapshot resource. You can use snapshots to back up data on a regular interval. For more information, read Creating persistent disk snapshots.",
+ "id": "Snapshot",
"properties": {
- "destIpRanges": {
- "description": "Destination IPv4/IPv6 addresses or CIDR prefixes, in standard text format.",
- "items": {
- "type": "string"
- },
- "type": "array"
+ "architecture": {
+ "description": "[Output Only] The architecture of the snapshot. Valid values are ARM64 or X86_64.",
+ "enum": [
+ "ARCHITECTURE_UNSPECIFIED",
+ "ARM64",
+ "X86_64"
+ ],
+ "enumDescriptions": [
+ "Default value indicating Architecture is not set.",
+ "Machines with architecture ARM64",
+ "Machines with architecture X86_64"
+ ],
+ "type": "string"
},
- "destPorts": {
- "description": "Destination port numbers for TCP/UDP/SCTP. Each element can be a 16-bit unsigned decimal number (e.g. \"80\") or range (e.g. \"0-1023\").",
- "items": {
- "type": "string"
- },
- "type": "array"
+ "autoCreated": {
+ "description": "[Output Only] Set to true if snapshots are automatically created by applying resource policy on the target disk.",
+ "type": "boolean"
},
- "ipProtocols": {
- "description": "IPv4 protocol / IPv6 next header (after extension headers). Each element can be an 8-bit unsigned decimal number (e.g. \"6\"), range (e.g. \"253-254\"), or one of the following protocol names: \"tcp\", \"udp\", \"icmp\", \"esp\", \"ah\", \"ipip\", or \"sctp\".",
- "items": {
- "type": "string"
- },
- "type": "array"
+ "chainName": {
+ "description": "Creates the new snapshot in the snapshot chain labeled with the specified name. The chain name must be 1-63 characters long and comply with RFC1035. This is an uncommon option only for advanced service owners who needs to create separate snapshot chains, for example, for chargeback tracking. When you describe your snapshot resource, this field is visible only if it has a non-empty value.",
+ "type": "string"
},
- "srcAsns": {
- "description": "BGP Autonomous System Number associated with the source IP address.",
- "items": {
- "format": "uint32",
- "type": "integer"
- },
- "type": "array"
+ "creationSizeBytes": {
+ "description": "[Output Only] Size in bytes of the snapshot at creation time.",
+ "format": "int64",
+ "type": "string"
},
- "srcIpRanges": {
- "description": "Source IPv4/IPv6 addresses or CIDR prefixes, in standard text format.",
- "items": {
- "type": "string"
- },
- "type": "array"
+ "creationTimestamp": {
+ "description": "[Output Only] Creation timestamp in RFC3339 text format.",
+ "type": "string"
},
- "srcPorts": {
- "description": "Source port numbers for TCP/UDP/SCTP. Each element can be a 16-bit unsigned decimal number (e.g. \"80\") or range (e.g. \"0-1023\").",
- "items": {
- "type": "string"
- },
- "type": "array"
+ "description": {
+ "description": "An optional description of this resource. Provide this property when you create the resource.",
+ "type": "string"
},
- "srcRegionCodes": {
- "description": "Two-letter ISO 3166-1 alpha-2 country code associated with the source IP address.",
- "items": {
- "type": "string"
- },
- "type": "array"
+ "diskSizeGb": {
+ "description": "[Output Only] Size of the source disk, specified in GB.",
+ "format": "int64",
+ "type": "string"
},
- "userDefinedFields": {
- "description": "User-defined fields. Each element names a defined field and lists the matching values for that field.",
- "items": {
- "$ref": "SecurityPolicyRuleNetworkMatcherUserDefinedFieldMatch"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "SecurityPolicyRuleNetworkMatcherUserDefinedFieldMatch": {
- "id": "SecurityPolicyRuleNetworkMatcherUserDefinedFieldMatch",
- "properties": {
- "name": {
- "description": "Name of the user-defined field, as given in the definition.",
+ "downloadBytes": {
+ "description": "[Output Only] Number of bytes downloaded to restore a snapshot to a disk.",
+ "format": "int64",
"type": "string"
},
- "values": {
- "description": "Matching values of the field. Each element can be a 32-bit unsigned decimal or hexadecimal (starting with \"0x\") number (e.g. \"64\") or range (e.g. \"0x400-0x7ff\").",
- "items": {
- "type": "string"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "SecurityPolicyRulePreconfiguredWafConfig": {
- "id": "SecurityPolicyRulePreconfiguredWafConfig",
- "properties": {
- "exclusions": {
- "description": "A list of exclusions to apply during preconfigured WAF evaluation.",
- "items": {
- "$ref": "SecurityPolicyRulePreconfiguredWafConfigExclusion"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "SecurityPolicyRulePreconfiguredWafConfigExclusion": {
- "id": "SecurityPolicyRulePreconfiguredWafConfigExclusion",
- "properties": {
- "requestCookiesToExclude": {
- "description": "A list of request cookie names whose value will be excluded from inspection during preconfigured WAF evaluation.",
- "items": {
- "$ref": "SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams"
- },
- "type": "array"
+ "enableConfidentialCompute": {
+ "description": "Whether this snapshot is created from a confidential compute mode disk. [Output Only]: This field is not set by user, but from source disk.",
+ "type": "boolean"
},
- "requestHeadersToExclude": {
- "description": "A list of request header names whose value will be excluded from inspection during preconfigured WAF evaluation.",
+ "guestOsFeatures": {
+ "description": "[Output Only] A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options.",
"items": {
- "$ref": "SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams"
+ "$ref": "GuestOsFeature"
},
"type": "array"
},
- "requestQueryParamsToExclude": {
- "description": "A list of request query parameter names whose value will be excluded from inspection during preconfigured WAF evaluation. Note that the parameter can be in the query string or in the POST body.",
- "items": {
- "$ref": "SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams"
+ "id": {
+ "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.",
+ "format": "uint64",
+ "type": "string"
+ },
+ "kind": {
+ "default": "compute#snapshot",
+ "description": "[Output Only] Type of the resource. Always compute#snapshot for Snapshot resources.",
+ "type": "string"
+ },
+ "labelFingerprint": {
+ "description": "A fingerprint for the labels being applied to this snapshot, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a snapshot.",
+ "format": "byte",
+ "type": "string"
+ },
+ "labels": {
+ "additionalProperties": {
+ "type": "string"
},
- "type": "array"
+ "description": "Labels to apply to this snapshot. These can be later modified by the setLabels method. Label values may be empty.",
+ "type": "object"
},
- "requestUrisToExclude": {
- "description": "A list of request URIs from the request line to be excluded from inspection during preconfigured WAF evaluation. When specifying this field, the query or fragment part should be excluded.",
+ "licenseCodes": {
+ "description": "[Output Only] Integer license codes indicating which licenses are attached to this snapshot.",
"items": {
- "$ref": "SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams"
+ "format": "int64",
+ "type": "string"
},
"type": "array"
},
- "targetRuleIds": {
- "description": "A list of target rule IDs under the WAF rule set to apply the preconfigured WAF exclusion. If omitted, it refers to all the rule IDs under the WAF rule set.",
+ "licenses": {
+ "description": "[Output Only] A list of public visible licenses that apply to this snapshot. This can be because the original image had licenses attached (such as a Windows image).",
"items": {
"type": "string"
},
"type": "array"
},
- "targetRuleSet": {
- "description": "Target WAF rule set to apply the preconfigured WAF exclusion.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams": {
- "id": "SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams",
- "properties": {
- "op": {
- "description": "The match operator for the field.",
- "enum": [
- "CONTAINS",
- "ENDS_WITH",
- "EQUALS",
- "EQUALS_ANY",
- "STARTS_WITH"
- ],
- "enumDescriptions": [
- "The operator matches if the field value contains the specified value.",
- "The operator matches if the field value ends with the specified value.",
- "The operator matches if the field value equals the specified value.",
- "The operator matches if the field value is any value.",
- "The operator matches if the field value starts with the specified value."
- ],
+ "locationHint": {
+ "description": "An opaque location hint used to place the snapshot close to other resources. This field is for use by internal tools that use the public API.",
"type": "string"
},
- "val": {
- "description": "The value of the field.",
+ "name": {
+ "annotations": {
+ "required": [
+ "compute.disks.createSnapshot",
+ "compute.snapshots.insert"
+ ]
+ },
+ "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
"type": "string"
- }
- },
- "type": "object"
- },
- "SecurityPolicyRuleRateLimitOptions": {
- "id": "SecurityPolicyRuleRateLimitOptions",
- "properties": {
- "banDurationSec": {
- "description": "Can only be specified if the action for the rule is \"rate_based_ban\". If specified, determines the time (in seconds) the traffic will continue to be banned by the rate limit after the rate falls below the threshold.",
- "format": "int32",
- "type": "integer"
},
- "banThreshold": {
- "$ref": "SecurityPolicyRuleRateLimitOptionsThreshold",
- "description": "Can only be specified if the action for the rule is \"rate_based_ban\". If specified, the key will be banned for the configured 'ban_duration_sec' when the number of requests that exceed the 'rate_limit_threshold' also exceed this 'ban_threshold'."
+ "satisfiesPzi": {
+ "description": "Output only. Reserved for future use.",
+ "readOnly": true,
+ "type": "boolean"
},
- "conformAction": {
- "description": "Action to take for requests that are under the configured rate limit threshold. Valid option is \"allow\" only.",
+ "satisfiesPzs": {
+ "description": "[Output Only] Reserved for future use.",
+ "type": "boolean"
+ },
+ "selfLink": {
+ "description": "[Output Only] Server-defined URL for the resource.",
"type": "string"
},
- "enforceOnKey": {
- "description": "Determines the key to enforce the rate_limit_threshold on. Possible values are: - ALL: A single rate limit threshold is applied to all the requests matching this rule. This is the default value if \"enforceOnKey\" is not configured. - IP: The source IP address of the request is the key. Each IP has this limit enforced separately. - HTTP_HEADER: The value of the HTTP header whose name is configured under \"enforceOnKeyName\". The key value is truncated to the first 128 bytes of the header value. If no such header is present in the request, the key type defaults to ALL. - XFF_IP: The first IP address (i.e. the originating client IP address) specified in the list of IPs under X-Forwarded-For HTTP header. If no such header is present or the value is not a valid IP, the key defaults to the source IP address of the request i.e. key type IP. - HTTP_COOKIE: The value of the HTTP cookie whose name is configured under \"enforceOnKeyName\". The key value is truncated to the first 128 bytes of the cookie value. If no such cookie is present in the request, the key type defaults to ALL. - HTTP_PATH: The URL path of the HTTP request. The key value is truncated to the first 128 bytes. - SNI: Server name indication in the TLS session of the HTTPS request. The key value is truncated to the first 128 bytes. The key type defaults to ALL on a HTTP session. - REGION_CODE: The country/region from which the request originates. - TLS_JA3_FINGERPRINT: JA3 TLS/SSL fingerprint if the client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the key type defaults to ALL. - USER_IP: The IP address of the originating client, which is resolved based on \"userIpRequestHeaders\" configured with the security policy. If there is no \"userIpRequestHeaders\" configuration or an IP address cannot be resolved from it, the key type defaults to IP. ",
+ "snapshotEncryptionKey": {
+ "$ref": "CustomerEncryptionKey",
+ "description": "Encrypts the snapshot using a customer-supplied encryption key. After you encrypt a snapshot using a customer-supplied key, you must provide the same key if you use the snapshot later. For example, you must provide the encryption key when you create a disk from the encrypted snapshot in a future request. Customer-supplied encryption keys do not protect access to metadata of the snapshot. If you do not provide an encryption key when creating the snapshot, then the snapshot will be encrypted using an automatically generated key and you do not need to provide a key to use the snapshot later."
+ },
+ "snapshotType": {
+ "description": "Indicates the type of the snapshot.",
"enum": [
- "ALL",
- "HTTP_COOKIE",
- "HTTP_HEADER",
- "HTTP_PATH",
- "IP",
- "REGION_CODE",
- "SNI",
- "TLS_JA3_FINGERPRINT",
- "USER_IP",
- "XFF_IP"
+ "ARCHIVE",
+ "STANDARD"
],
"enumDescriptions": [
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
"",
""
],
"type": "string"
},
- "enforceOnKeyConfigs": {
- "description": "If specified, any combination of values of enforce_on_key_type/enforce_on_key_name is treated as the key on which ratelimit threshold/action is enforced. You can specify up to 3 enforce_on_key_configs. If enforce_on_key_configs is specified, enforce_on_key must not be specified.",
- "items": {
- "$ref": "SecurityPolicyRuleRateLimitOptionsEnforceOnKeyConfig"
- },
- "type": "array"
+ "sourceDisk": {
+ "description": "The source disk used to create this snapshot.",
+ "type": "string"
},
- "enforceOnKeyName": {
- "description": "Rate limit key name applicable only for the following key types: HTTP_HEADER -- Name of the HTTP header whose value is taken as the key value. HTTP_COOKIE -- Name of the HTTP cookie whose value is taken as the key value.",
+ "sourceDiskEncryptionKey": {
+ "$ref": "CustomerEncryptionKey",
+ "description": "The customer-supplied encryption key of the source disk. Required if the source disk is protected by a customer-supplied encryption key."
+ },
+ "sourceDiskForRecoveryCheckpoint": {
+ "description": "The source disk whose recovery checkpoint will be used to create this snapshot.",
"type": "string"
},
- "exceedAction": {
- "description": "Action to take for requests that are above the configured rate limit threshold, to either deny with a specified HTTP response code, or redirect to a different endpoint. Valid options are `deny(STATUS)`, where valid values for `STATUS` are 403, 404, 429, and 502, and `redirect`, where the redirect parameters come from `exceedRedirectOptions` below. The `redirect` action is only supported in Global Security Policies of type CLOUD_ARMOR.",
+ "sourceDiskId": {
+ "description": "[Output Only] The ID value of the disk used to create this snapshot. This value may be used to determine whether the snapshot was taken from the current or a previous instance of a given disk name.",
"type": "string"
},
- "exceedRedirectOptions": {
- "$ref": "SecurityPolicyRuleRedirectOptions",
- "description": "Parameters defining the redirect action that is used as the exceed action. Cannot be specified if the exceed action is not redirect. This field is only supported in Global Security Policies of type CLOUD_ARMOR."
+ "sourceInstantSnapshot": {
+ "description": "The source instant snapshot used to create this snapshot. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /instantSnapshots/instantSnapshot - projects/project/zones/zone/instantSnapshots/instantSnapshot - zones/zone/instantSnapshots/instantSnapshot ",
+ "type": "string"
},
- "rateLimitThreshold": {
- "$ref": "SecurityPolicyRuleRateLimitOptionsThreshold",
- "description": "Threshold at which to begin ratelimiting."
- }
- },
- "type": "object"
- },
- "SecurityPolicyRuleRateLimitOptionsEnforceOnKeyConfig": {
- "id": "SecurityPolicyRuleRateLimitOptionsEnforceOnKeyConfig",
- "properties": {
- "enforceOnKeyName": {
- "description": "Rate limit key name applicable only for the following key types: HTTP_HEADER -- Name of the HTTP header whose value is taken as the key value. HTTP_COOKIE -- Name of the HTTP cookie whose value is taken as the key value.",
+ "sourceInstantSnapshotEncryptionKey": {
+ "$ref": "CustomerEncryptionKey",
+ "description": "Customer provided encryption key when creating Snapshot from Instant Snapshot."
+ },
+ "sourceInstantSnapshotId": {
+ "description": "[Output Only] The unique ID of the instant snapshot used to create this snapshot. This value identifies the exact instant snapshot that was used to create this persistent disk. For example, if you created the persistent disk from an instant snapshot that was later deleted and recreated under the same name, the source instant snapshot ID would identify the exact instant snapshot that was used.",
"type": "string"
},
- "enforceOnKeyType": {
- "description": "Determines the key to enforce the rate_limit_threshold on. Possible values are: - ALL: A single rate limit threshold is applied to all the requests matching this rule. This is the default value if \"enforceOnKeyConfigs\" is not configured. - IP: The source IP address of the request is the key. Each IP has this limit enforced separately. - HTTP_HEADER: The value of the HTTP header whose name is configured under \"enforceOnKeyName\". The key value is truncated to the first 128 bytes of the header value. If no such header is present in the request, the key type defaults to ALL. - XFF_IP: The first IP address (i.e. the originating client IP address) specified in the list of IPs under X-Forwarded-For HTTP header. If no such header is present or the value is not a valid IP, the key defaults to the source IP address of the request i.e. key type IP. - HTTP_COOKIE: The value of the HTTP cookie whose name is configured under \"enforceOnKeyName\". The key value is truncated to the first 128 bytes of the cookie value. If no such cookie is present in the request, the key type defaults to ALL. - HTTP_PATH: The URL path of the HTTP request. The key value is truncated to the first 128 bytes. - SNI: Server name indication in the TLS session of the HTTPS request. The key value is truncated to the first 128 bytes. The key type defaults to ALL on a HTTP session. - REGION_CODE: The country/region from which the request originates. - TLS_JA3_FINGERPRINT: JA3 TLS/SSL fingerprint if the client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the key type defaults to ALL. - USER_IP: The IP address of the originating client, which is resolved based on \"userIpRequestHeaders\" configured with the security policy. If there is no \"userIpRequestHeaders\" configuration or an IP address cannot be resolved from it, the key type defaults to IP. ",
- "enum": [
- "ALL",
- "HTTP_COOKIE",
- "HTTP_HEADER",
- "HTTP_PATH",
- "IP",
- "REGION_CODE",
- "SNI",
- "TLS_JA3_FINGERPRINT",
- "USER_IP",
- "XFF_IP"
- ],
- "enumDescriptions": [
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- ""
- ],
+ "sourceSnapshotSchedulePolicy": {
+ "description": "[Output Only] URL of the resource policy which created this scheduled snapshot.",
"type": "string"
- }
- },
- "type": "object"
- },
- "SecurityPolicyRuleRateLimitOptionsThreshold": {
- "id": "SecurityPolicyRuleRateLimitOptionsThreshold",
- "properties": {
- "count": {
- "description": "Number of HTTP(S) requests for calculating the threshold.",
- "format": "int32",
- "type": "integer"
},
- "intervalSec": {
- "description": "Interval over which the threshold is computed.",
- "format": "int32",
- "type": "integer"
- }
- },
- "type": "object"
- },
- "SecurityPolicyRuleRedirectOptions": {
- "id": "SecurityPolicyRuleRedirectOptions",
- "properties": {
- "target": {
- "description": "Target for the redirect action. This is required if the type is EXTERNAL_302 and cannot be specified for GOOGLE_RECAPTCHA.",
+ "sourceSnapshotSchedulePolicyId": {
+ "description": "[Output Only] ID of the resource policy which created this scheduled snapshot.",
"type": "string"
},
- "type": {
- "description": "Type of the redirect action.",
+ "status": {
+ "description": "[Output Only] The status of the snapshot. This can be CREATING, DELETING, FAILED, READY, or UPLOADING.",
"enum": [
- "EXTERNAL_302",
- "GOOGLE_RECAPTCHA"
+ "CREATING",
+ "DELETING",
+ "FAILED",
+ "READY",
+ "UPLOADING"
],
"enumDescriptions": [
- "",
- ""
+ "Snapshot creation is in progress.",
+ "Snapshot is currently being deleted.",
+ "Snapshot creation failed.",
+ "Snapshot has been created successfully.",
+ "Snapshot is being uploaded."
],
"type": "string"
- }
- },
- "type": "object"
- },
- "SecurityPolicyUserDefinedField": {
- "id": "SecurityPolicyUserDefinedField",
- "properties": {
- "base": {
- "description": "The base relative to which 'offset' is measured. Possible values are: - IPV4: Points to the beginning of the IPv4 header. - IPV6: Points to the beginning of the IPv6 header. - TCP: Points to the beginning of the TCP header, skipping over any IPv4 options or IPv6 extension headers. Not present for non-first fragments. - UDP: Points to the beginning of the UDP header, skipping over any IPv4 options or IPv6 extension headers. Not present for non-first fragments. required",
+ },
+ "storageBytes": {
+ "description": "[Output Only] A size of the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot creation/deletion.",
+ "format": "int64",
+ "type": "string"
+ },
+ "storageBytesStatus": {
+ "description": "[Output Only] An indicator whether storageBytes is in a stable state or it is being adjusted as a result of shared storage reallocation. This status can either be UPDATING, meaning the size of the snapshot is being updated, or UP_TO_DATE, meaning the size of the snapshot is up-to-date.",
"enum": [
- "IPV4",
- "IPV6",
- "TCP",
- "UDP"
+ "UPDATING",
+ "UP_TO_DATE"
],
"enumDescriptions": [
- "",
- "",
"",
""
],
"type": "string"
},
- "mask": {
- "description": "If specified, apply this mask (bitwise AND) to the field to ignore bits before matching. Encoded as a hexadecimal number (starting with \"0x\"). The last byte of the field (in network byte order) corresponds to the least significant byte of the mask.",
- "type": "string"
- },
- "name": {
- "description": "The name of this field. Must be unique within the policy.",
- "type": "string"
- },
- "offset": {
- "description": "Offset of the first byte of the field (in network byte order) relative to 'base'.",
- "format": "int32",
- "type": "integer"
- },
- "size": {
- "description": "Size of the field in bytes. Valid values: 1-4.",
- "format": "int32",
- "type": "integer"
- }
- },
- "type": "object"
- },
- "SecuritySettings": {
- "description": "The authentication and authorization settings for a BackendService.",
- "id": "SecuritySettings",
- "properties": {
- "awsV4Authentication": {
- "$ref": "AWSV4Signature",
- "description": "The configuration needed to generate a signature for access to private storage buckets that support AWS's Signature Version 4 for authentication. Allowed only for INTERNET_IP_PORT and INTERNET_FQDN_PORT NEG backends."
- },
- "clientTlsPolicy": {
- "description": "Optional. A URL referring to a networksecurity.ClientTlsPolicy resource that describes how clients should authenticate with this service's backends. clientTlsPolicy only applies to a global BackendService with the loadBalancingScheme set to INTERNAL_SELF_MANAGED. If left blank, communications are not encrypted.",
- "type": "string"
- },
- "subjectAltNames": {
- "description": "Optional. A list of Subject Alternative Names (SANs) that the client verifies during a mutual TLS handshake with an server/endpoint for this BackendService. When the server presents its X.509 certificate to the client, the client inspects the certificate's subjectAltName field. If the field contains one of the specified values, the communication continues. Otherwise, it fails. This additional check enables the client to verify that the server is authorized to run the requested service. Note that the contents of the server certificate's subjectAltName field are configured by the Public Key Infrastructure which provisions server identities. Only applies to a global BackendService with loadBalancingScheme set to INTERNAL_SELF_MANAGED. Only applies when BackendService has an attached clientTlsPolicy with clientCertificate (mTLS mode).",
+ "storageLocations": {
+ "description": "Cloud Storage bucket storage location of the snapshot (regional or multi-regional).",
"items": {
"type": "string"
},
@@ -69087,48 +73720,190 @@
},
"type": "object"
},
- "SerialPortOutput": {
- "description": "An instance serial console output.",
- "id": "SerialPortOutput",
+ "SnapshotList": {
+ "description": "Contains a list of Snapshot resources.",
+ "id": "SnapshotList",
"properties": {
- "contents": {
- "description": "[Output Only] The contents of the console output.",
+ "id": {
+ "description": "[Output Only] Unique identifier for the resource; defined by the server.",
"type": "string"
},
+ "items": {
+ "description": "A list of Snapshot resources.",
+ "items": {
+ "$ref": "Snapshot"
+ },
+ "type": "array"
+ },
"kind": {
- "default": "compute#serialPortOutput",
- "description": "[Output Only] Type of the resource. Always compute#serialPortOutput for serial port output.",
+ "default": "compute#snapshotList",
+ "description": "Type of resource.",
"type": "string"
},
- "next": {
- "description": "[Output Only] The position of the next byte of content, regardless of whether the content exists, following the output returned in the `contents` property. Use this value in the next request as the start parameter.",
- "format": "int64",
+ "nextPageToken": {
+ "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
"type": "string"
},
"selfLink": {
"description": "[Output Only] Server-defined URL for this resource.",
"type": "string"
},
- "start": {
- "description": "The starting byte position of the output that was returned. This should match the start parameter sent with the request. If the serial console output exceeds the size of the buffer (1 MB), older output is overwritten by newer content. The output start value will indicate the byte position of the output that was returned, which might be different than the `start` value that was specified in the request.",
- "format": "int64",
- "type": "string"
+ "warning": {
+ "description": "[Output Only] Informational warning message.",
+ "properties": {
+ "code": {
+ "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.",
+ "enum": [
+ "CLEANUP_FAILED",
+ "DEPRECATED_RESOURCE_USED",
+ "DEPRECATED_TYPE_USED",
+ "DISK_SIZE_LARGER_THAN_IMAGE_SIZE",
+ "EXPERIMENTAL_TYPE_USED",
+ "EXTERNAL_API_WARNING",
+ "FIELD_VALUE_OVERRIDEN",
+ "INJECTED_KERNELS_DEPRECATED",
+ "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB",
+ "LARGE_DEPLOYMENT_WARNING",
+ "LIST_OVERHEAD_QUOTA_EXCEED",
+ "MISSING_TYPE_DEPENDENCY",
+ "NEXT_HOP_ADDRESS_NOT_ASSIGNED",
+ "NEXT_HOP_CANNOT_IP_FORWARD",
+ "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE",
+ "NEXT_HOP_INSTANCE_NOT_FOUND",
+ "NEXT_HOP_INSTANCE_NOT_ON_NETWORK",
+ "NEXT_HOP_NOT_RUNNING",
+ "NOT_CRITICAL_ERROR",
+ "NO_RESULTS_ON_PAGE",
+ "PARTIAL_SUCCESS",
+ "REQUIRED_TOS_AGREEMENT",
+ "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING",
+ "RESOURCE_NOT_DELETED",
+ "SCHEMA_VALIDATION_IGNORED",
+ "SINGLE_INSTANCE_PROPERTY_TEMPLATE",
+ "UNDECLARED_PROPERTIES",
+ "UNREACHABLE"
+ ],
+ "enumDeprecated": [
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ true,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false
+ ],
+ "enumDescriptions": [
+ "Warning about failed cleanup of transient changes made by a failed operation.",
+ "A link to a deprecated resource was created.",
+ "When deploying and at least one of the resources has a type marked as deprecated",
+ "The user created a boot disk that is larger than image size.",
+ "When deploying and at least one of the resources has a type marked as experimental",
+ "Warning that is present in an external api call",
+ "Warning that value of a field has been overridden. Deprecated unused field.",
+ "The operation involved use of an injected kernel, which is deprecated.",
+ "A WEIGHTED_MAGLEV backend service is associated with a health check that is not of type HTTP/HTTPS/HTTP2.",
+ "When deploying a deployment with a exceedingly large number of resources",
+ "Resource can't be retrieved due to list overhead quota exceed which captures the amount of resources filtered out by user-defined list filter.",
+ "A resource depends on a missing type",
+ "The route's nextHopIp address is not assigned to an instance on the network.",
+ "The route's next hop instance cannot ip forward.",
+ "The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route.",
+ "The route's nextHopInstance URL refers to an instance that does not exist.",
+ "The route's nextHopInstance URL refers to an instance that is not on the same network as the route.",
+ "The route's next hop instance does not have a status of RUNNING.",
+ "Error which is not critical. We decided to continue the process despite the mentioned error.",
+ "No results are present on a particular list page.",
+ "Success is reported, but some results may be missing due to errors",
+ "The user attempted to use a resource that requires a TOS they have not accepted.",
+ "Warning that a resource is in use.",
+ "One or more of the resources set to auto-delete could not be deleted because they were in use.",
+ "When a resource schema validation is ignored.",
+ "Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group.",
+ "When undeclared properties in the schema are present",
+ "A given scope cannot be reached."
+ ],
+ "type": "string"
+ },
+ "data": {
+ "description": "[Output Only] Metadata about this warning in key: value format. For example: \"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" } ",
+ "items": {
+ "properties": {
+ "key": {
+ "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).",
+ "type": "string"
+ },
+ "value": {
+ "description": "[Output Only] A warning data value corresponding to the key.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "type": "array"
+ },
+ "message": {
+ "description": "[Output Only] A human-readable description of the warning code.",
+ "type": "string"
+ }
+ },
+ "type": "object"
}
},
"type": "object"
},
- "ServerBinding": {
- "id": "ServerBinding",
+ "SnapshotSettings": {
+ "id": "SnapshotSettings",
"properties": {
- "type": {
+ "storageLocation": {
+ "$ref": "SnapshotSettingsStorageLocationSettings",
+ "description": "Policy of which storage location is going to be resolved, and additional data that particularizes how the policy is going to be carried out."
+ }
+ },
+ "type": "object"
+ },
+ "SnapshotSettingsStorageLocationSettings": {
+ "id": "SnapshotSettingsStorageLocationSettings",
+ "properties": {
+ "locations": {
+ "additionalProperties": {
+ "$ref": "SnapshotSettingsStorageLocationSettingsStorageLocationPreference"
+ },
+ "description": "When the policy is SPECIFIC_LOCATIONS, snapshots will be stored in the locations listed in this field. Keys are Cloud Storage bucket locations. Only one location can be specified.",
+ "type": "object"
+ },
+ "policy": {
+ "description": "The chosen location policy.",
"enum": [
- "RESTART_NODE_ON_ANY_SERVER",
- "RESTART_NODE_ON_MINIMAL_SERVERS",
- "SERVER_BINDING_TYPE_UNSPECIFIED"
+ "LOCAL_REGION",
+ "NEAREST_MULTI_REGION",
+ "SPECIFIC_LOCATIONS",
+ "STORAGE_LOCATION_POLICY_UNSPECIFIED"
],
"enumDescriptions": [
- "Node may associate with any physical server over its lifetime.",
- "Node may associate with minimal physical servers over its lifetime.",
+ "Store snapshot in the same region as with the originating disk. No additional parameters are needed.",
+ "Store snapshot in the nearest multi region Cloud Storage bucket, relative to the originating disk. No additional parameters are needed.",
+ "Store snapshot in the specific locations, as specified by the user. The list of regions to store must be defined under the `locations` field.",
""
],
"type": "string"
@@ -69136,63 +73911,141 @@
},
"type": "object"
},
- "ServiceAccount": {
- "description": "A service account.",
- "id": "ServiceAccount",
+ "SnapshotSettingsStorageLocationSettingsStorageLocationPreference": {
+ "description": "A structure for specifying storage locations.",
+ "id": "SnapshotSettingsStorageLocationSettingsStorageLocationPreference",
"properties": {
- "email": {
- "description": "Email address of the service account.",
+ "name": {
+ "description": "Name of the location. It should be one of the Cloud Storage buckets. Only one location can be specified.",
"type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "SourceDiskEncryptionKey": {
+ "id": "SourceDiskEncryptionKey",
+ "properties": {
+ "diskEncryptionKey": {
+ "$ref": "CustomerEncryptionKey",
+ "description": "The customer-supplied encryption key of the source disk. Required if the source disk is protected by a customer-supplied encryption key."
},
- "scopes": {
- "description": "The list of scopes to be made available for this service account.",
+ "sourceDisk": {
+ "description": "URL of the disk attached to the source instance. This can be a full or valid partial URL. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - projects/project/zones/zone/disks/disk - zones/zone/disks/disk ",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "SourceInstanceParams": {
+ "description": "A specification of the parameters to use when creating the instance template from a source instance.",
+ "id": "SourceInstanceParams",
+ "properties": {
+ "diskConfigs": {
+ "description": "Attached disks configuration. If not provided, defaults are applied: For boot disk and any other R/W disks, the source images for each disk will be used. For read-only disks, they will be attached in read-only mode. Local SSD disks will be created as blank volumes.",
"items": {
- "type": "string"
+ "$ref": "DiskInstantiationConfig"
},
"type": "array"
}
},
"type": "object"
},
- "ServiceAttachment": {
- "description": "Represents a ServiceAttachment resource. A service attachment represents a service that a producer has exposed. It encapsulates the load balancer which fronts the service runs and a list of NAT IP ranges that the producers uses to represent the consumers connecting to the service.",
- "id": "ServiceAttachment",
+ "SourceInstanceProperties": {
+ "description": "DEPRECATED: Please use compute#instanceProperties instead. New properties will not be added to this field.",
+ "id": "SourceInstanceProperties",
"properties": {
- "connectedEndpoints": {
- "description": "[Output Only] An array of connections for all the consumers connected to this service attachment.",
+ "canIpForward": {
+ "description": "Enables instances created based on this machine image to send packets with source IP addresses other than their own and receive packets with destination IP addresses other than their own. If these instances will be used as an IP gateway or it will be set as the next-hop in a Route resource, specify true. If unsure, leave this set to false. See the Enable IP forwarding documentation for more information.",
+ "type": "boolean"
+ },
+ "deletionProtection": {
+ "description": "Whether the instance created from this machine image should be protected against deletion.",
+ "type": "boolean"
+ },
+ "description": {
+ "description": "An optional text description for the instances that are created from this machine image.",
+ "type": "string"
+ },
+ "disks": {
+ "description": "An array of disks that are associated with the instances that are created from this machine image.",
+ "items": {
+ "$ref": "SavedAttachedDisk"
+ },
+ "type": "array"
+ },
+ "guestAccelerators": {
+ "description": "A list of guest accelerator cards' type and count to use for instances created from this machine image.",
"items": {
- "$ref": "ServiceAttachmentConnectedEndpoint"
+ "$ref": "AcceleratorConfig"
},
"type": "array"
},
- "connectionPreference": {
- "description": "The connection preference of service attachment. The value can be set to ACCEPT_AUTOMATIC. An ACCEPT_AUTOMATIC service attachment is one that always accepts the connection from consumer forwarding rules.",
+ "keyRevocationActionType": {
+ "description": "KeyRevocationActionType of the instance. Supported options are \"STOP\" and \"NONE\". The default value is \"NONE\" if it is not specified.",
"enum": [
- "ACCEPT_AUTOMATIC",
- "ACCEPT_MANUAL",
- "CONNECTION_PREFERENCE_UNSPECIFIED"
+ "KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED",
+ "NONE",
+ "STOP"
],
"enumDescriptions": [
- "",
- "",
- ""
+ "Default value. This value is unused.",
+ "Indicates user chose no operation.",
+ "Indicates user chose to opt for VM shutdown on key revocation."
],
"type": "string"
},
- "consumerAcceptLists": {
- "description": "Projects that are allowed to connect to this service attachment.",
+ "labels": {
+ "additionalProperties": {
+ "type": "string"
+ },
+ "description": "Labels to apply to instances that are created from this machine image.",
+ "type": "object"
+ },
+ "machineType": {
+ "description": "The machine type to use for instances that are created from this machine image.",
+ "type": "string"
+ },
+ "metadata": {
+ "$ref": "Metadata",
+ "description": "The metadata key/value pairs to assign to instances that are created from this machine image. These pairs can consist of custom metadata or predefined keys. See Project and instance metadata for more information."
+ },
+ "minCpuPlatform": {
+ "description": "Minimum cpu/platform to be used by instances created from this machine image. The instance may be scheduled on the specified or newer cpu/platform. Applicable values are the friendly names of CPU platforms, such as minCpuPlatform: \"Intel Haswell\" or minCpuPlatform: \"Intel Sandy Bridge\". For more information, read Specifying a Minimum CPU Platform.",
+ "type": "string"
+ },
+ "networkInterfaces": {
+ "description": "An array of network access configurations for this interface.",
"items": {
- "$ref": "ServiceAttachmentConsumerProjectLimit"
+ "$ref": "NetworkInterface"
},
"type": "array"
},
- "consumerRejectLists": {
- "description": "Projects that are not allowed to connect to this service attachment. The project can be specified using its id or number.",
+ "scheduling": {
+ "$ref": "Scheduling",
+ "description": "Specifies the scheduling options for the instances that are created from this machine image."
+ },
+ "serviceAccounts": {
+ "description": "A list of service accounts with specified scopes. Access tokens for these service accounts are available to the instances that are created from this machine image. Use metadata queries to obtain the access tokens for these instances.",
"items": {
- "type": "string"
+ "$ref": "ServiceAccount"
},
"type": "array"
},
+ "tags": {
+ "$ref": "Tags",
+ "description": "A list of tags to apply to the instances that are created from this machine image. The tags identify valid sources or targets for network firewalls. The setTags method can modify this list of tags. Each tag within the list must comply with RFC1035."
+ }
+ },
+ "type": "object"
+ },
+ "SslCertificate": {
+ "description": "Represents an SSL certificate resource. Google Compute Engine has two SSL certificate resources: * [Global](/compute/docs/reference/rest/v1/sslCertificates) * [Regional](/compute/docs/reference/rest/v1/regionSslCertificates) The global SSL certificates (sslCertificates) are used by: - Global external Application Load Balancers - Classic Application Load Balancers - Proxy Network Load Balancers (with target SSL proxies) The regional SSL certificates (regionSslCertificates) are used by: - Regional external Application Load Balancers - Regional internal Application Load Balancers Optionally, certificate file contents that you upload can contain a set of up to five PEM-encoded certificates. The API call creates an object (sslCertificate) that holds this data. You can use SSL keys and certificates to secure connections to a load balancer. For more information, read Creating and using SSL certificates, SSL certificates quotas and limits, and Troubleshooting SSL certificates.",
+ "id": "SslCertificate",
+ "properties": {
+ "certificate": {
+ "description": "A value read into memory from a certificate file. The certificate file must be in PEM format. The certificate chain must be no greater than 5 certs long. The chain must include at least one intermediate cert.",
+ "type": "string"
+ },
"creationTimestamp": {
"description": "[Output Only] Creation timestamp in RFC3339 text format.",
"type": "string"
@@ -69201,95 +74054,245 @@
"description": "An optional description of this resource. Provide this property when you create the resource.",
"type": "string"
},
- "domainNames": {
- "description": "If specified, the domain name will be used during the integration between the PSC connected endpoints and the Cloud DNS. For example, this is a valid domain name: \"p.mycompany.com.\". Current max number of domain names supported is 1.",
- "items": {
- "type": "string"
- },
- "type": "array"
- },
- "enableProxyProtocol": {
- "description": "If true, enable the proxy protocol which is for supplying client TCP/IP address data in TCP connections that traverse proxies on their way to destination servers.",
- "type": "boolean"
- },
- "fingerprint": {
- "description": "Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a ServiceAttachment. An up-to-date fingerprint must be provided in order to patch/update the ServiceAttachment; otherwise, the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the ServiceAttachment.",
- "format": "byte",
+ "expireTime": {
+ "description": "[Output Only] Expire time of the certificate. RFC3339",
"type": "string"
},
"id": {
- "description": "[Output Only] The unique identifier for the resource type. The server generates this identifier.",
+ "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.",
"format": "uint64",
"type": "string"
},
"kind": {
- "default": "compute#serviceAttachment",
- "description": "[Output Only] Type of the resource. Always compute#serviceAttachment for service attachments.",
+ "default": "compute#sslCertificate",
+ "description": "[Output Only] Type of the resource. Always compute#sslCertificate for SSL certificates.",
"type": "string"
},
+ "managed": {
+ "$ref": "SslCertificateManagedSslCertificate",
+ "description": "Configuration and status of a managed SSL certificate."
+ },
"name": {
- "annotations": {
- "required": [
- "compute.serviceAttachments.insert"
- ]
- },
"description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.",
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
"type": "string"
},
- "natSubnets": {
- "description": "An array of URLs where each entry is the URL of a subnet provided by the service producer to use for NAT in this service attachment.",
+ "privateKey": {
+ "description": "A value read into memory from a write-only private key file. The private key file must be in PEM format. For security, only insert requests include this field.",
+ "type": "string"
+ },
+ "region": {
+ "description": "[Output Only] URL of the region where the regional SSL Certificate resides. This field is not applicable to global SSL Certificate.",
+ "type": "string"
+ },
+ "selfLink": {
+ "description": "[Output only] Server-defined URL for the resource.",
+ "type": "string"
+ },
+ "selfManaged": {
+ "$ref": "SslCertificateSelfManagedSslCertificate",
+ "description": "Configuration and status of a self-managed SSL certificate."
+ },
+ "subjectAlternativeNames": {
+ "description": "[Output Only] Domains associated with the certificate via Subject Alternative Name.",
"items": {
"type": "string"
},
"type": "array"
},
- "producerForwardingRule": {
- "deprecated": true,
- "description": "The URL of a forwarding rule with loadBalancingScheme INTERNAL* that is serving the endpoint identified by this service attachment.",
+ "type": {
+ "description": "(Optional) Specifies the type of SSL certificate, either \"SELF_MANAGED\" or \"MANAGED\". If not specified, the certificate is self-managed and the fields certificate and private_key are used.",
+ "enum": [
+ "MANAGED",
+ "SELF_MANAGED",
+ "TYPE_UNSPECIFIED"
+ ],
+ "enumDescriptions": [
+ "Google-managed SSLCertificate.",
+ "Certificate uploaded by user.",
+ ""
+ ],
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "SslCertificateAggregatedList": {
+ "id": "SslCertificateAggregatedList",
+ "properties": {
+ "id": {
+ "description": "[Output Only] Unique identifier for the resource; defined by the server.",
"type": "string"
},
- "pscServiceAttachmentId": {
- "$ref": "Uint128",
- "description": "[Output Only] An 128-bit global unique ID of the PSC service attachment."
+ "items": {
+ "additionalProperties": {
+ "$ref": "SslCertificatesScopedList",
+ "description": "Name of the scope containing this set of SslCertificates."
+ },
+ "description": "A list of SslCertificatesScopedList resources.",
+ "type": "object"
},
- "reconcileConnections": {
- "description": "This flag determines whether a consumer accept/reject list change can reconcile the statuses of existing ACCEPTED or REJECTED PSC endpoints. - If false, connection policy update will only affect existing PENDING PSC endpoints. Existing ACCEPTED/REJECTED endpoints will remain untouched regardless how the connection policy is modified . - If true, update will affect both PENDING and ACCEPTED/REJECTED PSC endpoints. For example, an ACCEPTED PSC endpoint will be moved to REJECTED if its project is added to the reject list. For newly created service attachment, this boolean defaults to false.",
- "type": "boolean"
+ "kind": {
+ "default": "compute#sslCertificateAggregatedList",
+ "description": "[Output Only] Type of resource. Always compute#sslCertificateAggregatedList for lists of SSL Certificates.",
+ "type": "string"
},
- "region": {
- "description": "[Output Only] URL of the region where the service attachment resides. This field applies only to the region resource. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.",
+ "nextPageToken": {
+ "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
"type": "string"
},
"selfLink": {
- "description": "[Output Only] Server-defined URL for the resource.",
+ "description": "[Output Only] Server-defined URL for this resource.",
"type": "string"
},
- "targetService": {
- "description": "The URL of a service serving the endpoint identified by this service attachment.",
- "type": "string"
+ "unreachables": {
+ "description": "[Output Only] Unreachable resources.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "warning": {
+ "description": "[Output Only] Informational warning message.",
+ "properties": {
+ "code": {
+ "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.",
+ "enum": [
+ "CLEANUP_FAILED",
+ "DEPRECATED_RESOURCE_USED",
+ "DEPRECATED_TYPE_USED",
+ "DISK_SIZE_LARGER_THAN_IMAGE_SIZE",
+ "EXPERIMENTAL_TYPE_USED",
+ "EXTERNAL_API_WARNING",
+ "FIELD_VALUE_OVERRIDEN",
+ "INJECTED_KERNELS_DEPRECATED",
+ "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB",
+ "LARGE_DEPLOYMENT_WARNING",
+ "LIST_OVERHEAD_QUOTA_EXCEED",
+ "MISSING_TYPE_DEPENDENCY",
+ "NEXT_HOP_ADDRESS_NOT_ASSIGNED",
+ "NEXT_HOP_CANNOT_IP_FORWARD",
+ "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE",
+ "NEXT_HOP_INSTANCE_NOT_FOUND",
+ "NEXT_HOP_INSTANCE_NOT_ON_NETWORK",
+ "NEXT_HOP_NOT_RUNNING",
+ "NOT_CRITICAL_ERROR",
+ "NO_RESULTS_ON_PAGE",
+ "PARTIAL_SUCCESS",
+ "REQUIRED_TOS_AGREEMENT",
+ "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING",
+ "RESOURCE_NOT_DELETED",
+ "SCHEMA_VALIDATION_IGNORED",
+ "SINGLE_INSTANCE_PROPERTY_TEMPLATE",
+ "UNDECLARED_PROPERTIES",
+ "UNREACHABLE"
+ ],
+ "enumDeprecated": [
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ true,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false
+ ],
+ "enumDescriptions": [
+ "Warning about failed cleanup of transient changes made by a failed operation.",
+ "A link to a deprecated resource was created.",
+ "When deploying and at least one of the resources has a type marked as deprecated",
+ "The user created a boot disk that is larger than image size.",
+ "When deploying and at least one of the resources has a type marked as experimental",
+ "Warning that is present in an external api call",
+ "Warning that value of a field has been overridden. Deprecated unused field.",
+ "The operation involved use of an injected kernel, which is deprecated.",
+ "A WEIGHTED_MAGLEV backend service is associated with a health check that is not of type HTTP/HTTPS/HTTP2.",
+ "When deploying a deployment with a exceedingly large number of resources",
+ "Resource can't be retrieved due to list overhead quota exceed which captures the amount of resources filtered out by user-defined list filter.",
+ "A resource depends on a missing type",
+ "The route's nextHopIp address is not assigned to an instance on the network.",
+ "The route's next hop instance cannot ip forward.",
+ "The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route.",
+ "The route's nextHopInstance URL refers to an instance that does not exist.",
+ "The route's nextHopInstance URL refers to an instance that is not on the same network as the route.",
+ "The route's next hop instance does not have a status of RUNNING.",
+ "Error which is not critical. We decided to continue the process despite the mentioned error.",
+ "No results are present on a particular list page.",
+ "Success is reported, but some results may be missing due to errors",
+ "The user attempted to use a resource that requires a TOS they have not accepted.",
+ "Warning that a resource is in use.",
+ "One or more of the resources set to auto-delete could not be deleted because they were in use.",
+ "When a resource schema validation is ignored.",
+ "Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group.",
+ "When undeclared properties in the schema are present",
+ "A given scope cannot be reached."
+ ],
+ "type": "string"
+ },
+ "data": {
+ "description": "[Output Only] Metadata about this warning in key: value format. For example: \"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" } ",
+ "items": {
+ "properties": {
+ "key": {
+ "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).",
+ "type": "string"
+ },
+ "value": {
+ "description": "[Output Only] A warning data value corresponding to the key.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "type": "array"
+ },
+ "message": {
+ "description": "[Output Only] A human-readable description of the warning code.",
+ "type": "string"
+ }
+ },
+ "type": "object"
}
},
"type": "object"
},
- "ServiceAttachmentAggregatedList": {
- "description": "Contains a list of ServiceAttachmentsScopedList.",
- "id": "ServiceAttachmentAggregatedList",
+ "SslCertificateList": {
+ "description": "Contains a list of SslCertificate resources.",
+ "id": "SslCertificateList",
"properties": {
"id": {
"description": "[Output Only] Unique identifier for the resource; defined by the server.",
"type": "string"
},
"items": {
- "additionalProperties": {
- "$ref": "ServiceAttachmentsScopedList",
- "description": "Name of the scope containing this set of ServiceAttachments."
+ "description": "A list of SslCertificate resources.",
+ "items": {
+ "$ref": "SslCertificate"
},
- "description": "A list of ServiceAttachmentsScopedList resources.",
- "type": "object"
+ "type": "array"
},
"kind": {
- "default": "compute#serviceAttachmentAggregatedList",
+ "default": "compute#sslCertificateList",
"description": "Type of resource.",
"type": "string"
},
@@ -69301,15 +74304,216 @@
"description": "[Output Only] Server-defined URL for this resource.",
"type": "string"
},
- "unreachables": {
- "description": "[Output Only] Unreachable resources.",
+ "warning": {
+ "description": "[Output Only] Informational warning message.",
+ "properties": {
+ "code": {
+ "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.",
+ "enum": [
+ "CLEANUP_FAILED",
+ "DEPRECATED_RESOURCE_USED",
+ "DEPRECATED_TYPE_USED",
+ "DISK_SIZE_LARGER_THAN_IMAGE_SIZE",
+ "EXPERIMENTAL_TYPE_USED",
+ "EXTERNAL_API_WARNING",
+ "FIELD_VALUE_OVERRIDEN",
+ "INJECTED_KERNELS_DEPRECATED",
+ "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB",
+ "LARGE_DEPLOYMENT_WARNING",
+ "LIST_OVERHEAD_QUOTA_EXCEED",
+ "MISSING_TYPE_DEPENDENCY",
+ "NEXT_HOP_ADDRESS_NOT_ASSIGNED",
+ "NEXT_HOP_CANNOT_IP_FORWARD",
+ "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE",
+ "NEXT_HOP_INSTANCE_NOT_FOUND",
+ "NEXT_HOP_INSTANCE_NOT_ON_NETWORK",
+ "NEXT_HOP_NOT_RUNNING",
+ "NOT_CRITICAL_ERROR",
+ "NO_RESULTS_ON_PAGE",
+ "PARTIAL_SUCCESS",
+ "REQUIRED_TOS_AGREEMENT",
+ "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING",
+ "RESOURCE_NOT_DELETED",
+ "SCHEMA_VALIDATION_IGNORED",
+ "SINGLE_INSTANCE_PROPERTY_TEMPLATE",
+ "UNDECLARED_PROPERTIES",
+ "UNREACHABLE"
+ ],
+ "enumDeprecated": [
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ true,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false
+ ],
+ "enumDescriptions": [
+ "Warning about failed cleanup of transient changes made by a failed operation.",
+ "A link to a deprecated resource was created.",
+ "When deploying and at least one of the resources has a type marked as deprecated",
+ "The user created a boot disk that is larger than image size.",
+ "When deploying and at least one of the resources has a type marked as experimental",
+ "Warning that is present in an external api call",
+ "Warning that value of a field has been overridden. Deprecated unused field.",
+ "The operation involved use of an injected kernel, which is deprecated.",
+ "A WEIGHTED_MAGLEV backend service is associated with a health check that is not of type HTTP/HTTPS/HTTP2.",
+ "When deploying a deployment with a exceedingly large number of resources",
+ "Resource can't be retrieved due to list overhead quota exceed which captures the amount of resources filtered out by user-defined list filter.",
+ "A resource depends on a missing type",
+ "The route's nextHopIp address is not assigned to an instance on the network.",
+ "The route's next hop instance cannot ip forward.",
+ "The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route.",
+ "The route's nextHopInstance URL refers to an instance that does not exist.",
+ "The route's nextHopInstance URL refers to an instance that is not on the same network as the route.",
+ "The route's next hop instance does not have a status of RUNNING.",
+ "Error which is not critical. We decided to continue the process despite the mentioned error.",
+ "No results are present on a particular list page.",
+ "Success is reported, but some results may be missing due to errors",
+ "The user attempted to use a resource that requires a TOS they have not accepted.",
+ "Warning that a resource is in use.",
+ "One or more of the resources set to auto-delete could not be deleted because they were in use.",
+ "When a resource schema validation is ignored.",
+ "Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group.",
+ "When undeclared properties in the schema are present",
+ "A given scope cannot be reached."
+ ],
+ "type": "string"
+ },
+ "data": {
+ "description": "[Output Only] Metadata about this warning in key: value format. For example: \"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" } ",
+ "items": {
+ "properties": {
+ "key": {
+ "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).",
+ "type": "string"
+ },
+ "value": {
+ "description": "[Output Only] A warning data value corresponding to the key.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "type": "array"
+ },
+ "message": {
+ "description": "[Output Only] A human-readable description of the warning code.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ }
+ },
+ "type": "object"
+ },
+ "SslCertificateManagedSslCertificate": {
+ "description": "Configuration and status of a managed SSL certificate.",
+ "id": "SslCertificateManagedSslCertificate",
+ "properties": {
+ "domainStatus": {
+ "additionalProperties": {
+ "enum": [
+ "ACTIVE",
+ "DOMAIN_STATUS_UNSPECIFIED",
+ "FAILED_CAA_CHECKING",
+ "FAILED_CAA_FORBIDDEN",
+ "FAILED_NOT_VISIBLE",
+ "FAILED_RATE_LIMITED",
+ "PROVISIONING"
+ ],
+ "enumDescriptions": [
+ "A managed certificate can be provisioned, no issues for this domain.",
+ "",
+ "Failed to check CAA records for the domain.",
+ "Certificate issuance forbidden by an explicit CAA record for the domain.",
+ "There seems to be problem with the user's DNS or load balancer configuration for this domain.",
+ "Reached rate-limit for certificates per top-level private domain.",
+ "Certificate provisioning for this domain is under way. GCP will attempt to provision the first certificate."
+ ],
+ "type": "string"
+ },
+ "description": "[Output only] Detailed statuses of the domains specified for managed certificate resource.",
+ "type": "object"
+ },
+ "domains": {
+ "description": "The domains for which a managed SSL certificate will be generated. Each Google-managed SSL certificate supports up to the [maximum number of domains per Google-managed SSL certificate](/load-balancing/docs/quotas#ssl_certificates).",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "status": {
+ "description": "[Output only] Status of the managed certificate resource.",
+ "enum": [
+ "ACTIVE",
+ "MANAGED_CERTIFICATE_STATUS_UNSPECIFIED",
+ "PROVISIONING",
+ "PROVISIONING_FAILED",
+ "PROVISIONING_FAILED_PERMANENTLY",
+ "RENEWAL_FAILED"
+ ],
+ "enumDescriptions": [
+ "The certificate management is working, and a certificate has been provisioned.",
+ "",
+ "The certificate management is working. GCP will attempt to provision the first certificate.",
+ "Certificate provisioning failed due to an issue with the DNS or load balancing configuration. For details of which domain failed, consult domain_status field.",
+ "Certificate provisioning failed due to an issue with the DNS or load balancing configuration. It won't be retried. To try again delete and create a new managed SslCertificate resource. For details of which domain failed, consult domain_status field.",
+ "Renewal of the certificate has failed due to an issue with the DNS or load balancing configuration. The existing cert is still serving; however, it will expire shortly. To provision a renewed certificate, delete and create a new managed SslCertificate resource. For details on which domain failed, consult domain_status field."
+ ],
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "SslCertificateSelfManagedSslCertificate": {
+ "description": "Configuration and status of a self-managed SSL certificate.",
+ "id": "SslCertificateSelfManagedSslCertificate",
+ "properties": {
+ "certificate": {
+ "description": "A local certificate file. The certificate must be in PEM format. The certificate chain must be no greater than 5 certs long. The chain must include at least one intermediate cert.",
+ "type": "string"
+ },
+ "privateKey": {
+ "description": "A write-only private key in PEM format. Only insert requests will include this field.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "SslCertificatesScopedList": {
+ "id": "SslCertificatesScopedList",
+ "properties": {
+ "sslCertificates": {
+ "description": "List of SslCertificates contained in this scope.",
"items": {
- "type": "string"
+ "$ref": "SslCertificate"
},
"type": "array"
},
"warning": {
- "description": "[Output Only] Informational warning message.",
+ "description": "Informational warning which replaces the list of backend services when the list is empty.",
"properties": {
"code": {
"description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.",
@@ -69432,82 +74636,27 @@
},
"type": "object"
},
- "ServiceAttachmentConnectedEndpoint": {
- "description": "[Output Only] A connection connected to this service attachment.",
- "id": "ServiceAttachmentConnectedEndpoint",
- "properties": {
- "consumerNetwork": {
- "description": "The url of the consumer network.",
- "type": "string"
- },
- "endpoint": {
- "description": "The url of a connected endpoint.",
- "type": "string"
- },
- "pscConnectionId": {
- "description": "The PSC connection id of the connected endpoint.",
- "format": "uint64",
- "type": "string"
- },
- "status": {
- "description": "The status of a connected endpoint to this service attachment.",
- "enum": [
- "ACCEPTED",
- "CLOSED",
- "NEEDS_ATTENTION",
- "PENDING",
- "REJECTED",
- "STATUS_UNSPECIFIED"
- ],
- "enumDescriptions": [
- "The connection has been accepted by the producer.",
- "The connection has been closed by the producer.",
- "The connection has been accepted by the producer, but the producer needs to take further action before the forwarding rule can serve traffic.",
- "The connection is pending acceptance by the producer.",
- "The consumer is still connected but not using the connection.",
- ""
- ],
- "type": "string"
- }
- },
- "type": "object"
- },
- "ServiceAttachmentConsumerProjectLimit": {
- "id": "ServiceAttachmentConsumerProjectLimit",
+ "SslPoliciesAggregatedList": {
+ "id": "SslPoliciesAggregatedList",
"properties": {
- "connectionLimit": {
- "description": "The value of the limit to set.",
- "format": "uint32",
- "type": "integer"
- },
- "networkUrl": {
- "description": "The network URL for the network to set the limit for.",
+ "etag": {
"type": "string"
},
- "projectIdOrNum": {
- "description": "The project id or number for the project to set the limit for.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "ServiceAttachmentList": {
- "id": "ServiceAttachmentList",
- "properties": {
"id": {
"description": "[Output Only] Unique identifier for the resource; defined by the server.",
"type": "string"
},
"items": {
- "description": "A list of ServiceAttachment resources.",
- "items": {
- "$ref": "ServiceAttachment"
+ "additionalProperties": {
+ "$ref": "SslPoliciesScopedList",
+ "description": "Name of the scope containing this set of SSL policies."
},
- "type": "array"
+ "description": "A list of SslPoliciesScopedList resources.",
+ "type": "object"
},
"kind": {
- "default": "compute#serviceAttachmentList",
- "description": "[Output Only] Type of the resource. Always compute#serviceAttachment for service attachments.",
+ "default": "compute#sslPoliciesAggregatedList",
+ "description": "[Output Only] Type of resource. Always compute#sslPolicyAggregatedList for lists of SSL Policies.",
"type": "string"
},
"nextPageToken": {
@@ -69518,6 +74667,13 @@
"description": "[Output Only] Server-defined URL for this resource.",
"type": "string"
},
+ "unreachables": {
+ "description": "[Output Only] Unreachable resources.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
"warning": {
"description": "[Output Only] Informational warning message.",
"properties": {
@@ -69642,18 +74798,35 @@
},
"type": "object"
},
- "ServiceAttachmentsScopedList": {
- "id": "ServiceAttachmentsScopedList",
+ "SslPoliciesList": {
+ "id": "SslPoliciesList",
"properties": {
- "serviceAttachments": {
- "description": "A list of ServiceAttachments contained in this scope.",
+ "id": {
+ "description": "[Output Only] Unique identifier for the resource; defined by the server.",
+ "type": "string"
+ },
+ "items": {
+ "description": "A list of SslPolicy resources.",
"items": {
- "$ref": "ServiceAttachment"
+ "$ref": "SslPolicy"
},
"type": "array"
},
+ "kind": {
+ "default": "compute#sslPoliciesList",
+ "description": "[Output Only] Type of the resource. Always compute#sslPoliciesList for lists of sslPolicies.",
+ "type": "string"
+ },
+ "nextPageToken": {
+ "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
+ "type": "string"
+ },
+ "selfLink": {
+ "description": "[Output Only] Server-defined URL for this resource.",
+ "type": "string"
+ },
"warning": {
- "description": "Informational warning which replaces the list of service attachments when the list is empty.",
+ "description": "[Output Only] Informational warning message.",
"properties": {
"code": {
"description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.",
@@ -69776,377 +74949,10 @@
},
"type": "object"
},
- "SetCommonInstanceMetadataOperationMetadata": {
- "id": "SetCommonInstanceMetadataOperationMetadata",
- "properties": {
- "clientOperationId": {
- "description": "[Output Only] The client operation id.",
- "type": "string"
- },
- "perLocationOperations": {
- "additionalProperties": {
- "$ref": "SetCommonInstanceMetadataOperationMetadataPerLocationOperationInfo"
- },
- "description": "[Output Only] Status information per location (location name is key). Example key: zones/us-central1-a",
- "type": "object"
- }
- },
- "type": "object"
- },
- "SetCommonInstanceMetadataOperationMetadataPerLocationOperationInfo": {
- "id": "SetCommonInstanceMetadataOperationMetadataPerLocationOperationInfo",
- "properties": {
- "error": {
- "$ref": "Status",
- "description": "[Output Only] If state is `ABANDONED` or `FAILED`, this field is populated."
- },
- "state": {
- "description": "[Output Only] Status of the action, which can be one of the following: `PROPAGATING`, `PROPAGATED`, `ABANDONED`, `FAILED`, or `DONE`.",
- "enum": [
- "ABANDONED",
- "DONE",
- "FAILED",
- "PROPAGATED",
- "PROPAGATING",
- "UNSPECIFIED"
- ],
- "enumDescriptions": [
- "Operation not tracked in this location e.g. zone is marked as DOWN.",
- "Operation has completed successfully.",
- "Operation is in an error state.",
- "Operation is confirmed to be in the location.",
- "Operation is not yet confirmed to have been created in the location.",
- ""
- ],
- "type": "string"
- }
- },
- "type": "object"
- },
- "ShareSettings": {
- "description": "The share setting for reservations and sole tenancy node groups.",
- "id": "ShareSettings",
- "properties": {
- "projectMap": {
- "additionalProperties": {
- "$ref": "ShareSettingsProjectConfig"
- },
- "description": "A map of project id and project config. This is only valid when share_type's value is SPECIFIC_PROJECTS.",
- "type": "object"
- },
- "shareType": {
- "description": "Type of sharing for this shared-reservation",
- "enum": [
- "LOCAL",
- "ORGANIZATION",
- "SHARE_TYPE_UNSPECIFIED",
- "SPECIFIC_PROJECTS"
- ],
- "enumDescriptions": [
- "Default value.",
- "Shared-reservation is open to entire Organization",
- "Default value. This value is unused.",
- "Shared-reservation is open to specific projects"
- ],
- "type": "string"
- }
- },
- "type": "object"
- },
- "ShareSettingsProjectConfig": {
- "description": "Config for each project in the share settings.",
- "id": "ShareSettingsProjectConfig",
- "properties": {
- "projectId": {
- "description": "The project ID, should be same as the key of this project config in the parent map.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "ShieldedInstanceConfig": {
- "description": "A set of Shielded Instance options.",
- "id": "ShieldedInstanceConfig",
- "properties": {
- "enableIntegrityMonitoring": {
- "description": "Defines whether the instance has integrity monitoring enabled. Enabled by default.",
- "type": "boolean"
- },
- "enableSecureBoot": {
- "description": "Defines whether the instance has Secure Boot enabled. Disabled by default.",
- "type": "boolean"
- },
- "enableVtpm": {
- "description": "Defines whether the instance has the vTPM enabled. Enabled by default.",
- "type": "boolean"
- }
- },
- "type": "object"
- },
- "ShieldedInstanceIdentity": {
- "description": "A Shielded Instance Identity.",
- "id": "ShieldedInstanceIdentity",
- "properties": {
- "encryptionKey": {
- "$ref": "ShieldedInstanceIdentityEntry",
- "description": "An Endorsement Key (EK) made by the RSA 2048 algorithm issued to the Shielded Instance's vTPM."
- },
- "kind": {
- "default": "compute#shieldedInstanceIdentity",
- "description": "[Output Only] Type of the resource. Always compute#shieldedInstanceIdentity for shielded Instance identity entry.",
- "type": "string"
- },
- "signingKey": {
- "$ref": "ShieldedInstanceIdentityEntry",
- "description": "An Attestation Key (AK) made by the RSA 2048 algorithm issued to the Shielded Instance's vTPM."
- }
- },
- "type": "object"
- },
- "ShieldedInstanceIdentityEntry": {
- "description": "A Shielded Instance Identity Entry.",
- "id": "ShieldedInstanceIdentityEntry",
- "properties": {
- "ekCert": {
- "description": "A PEM-encoded X.509 certificate. This field can be empty.",
- "type": "string"
- },
- "ekPub": {
- "description": "A PEM-encoded public key.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "ShieldedInstanceIntegrityPolicy": {
- "description": "The policy describes the baseline against which Instance boot integrity is measured.",
- "id": "ShieldedInstanceIntegrityPolicy",
- "properties": {
- "updateAutoLearnPolicy": {
- "description": "Updates the integrity policy baseline using the measurements from the VM instance's most recent boot.",
- "type": "boolean"
- }
- },
- "type": "object"
- },
- "SignedUrlKey": {
- "description": "Represents a customer-supplied Signing Key used by Cloud CDN Signed URLs",
- "id": "SignedUrlKey",
- "properties": {
- "keyName": {
- "description": "Name of the key. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- "type": "string"
- },
- "keyValue": {
- "description": "128-bit key value used for signing the URL. The key value must be a valid RFC 4648 Section 5 base64url encoded string.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "Snapshot": {
- "description": "Represents a Persistent Disk Snapshot resource. You can use snapshots to back up data on a regular interval. For more information, read Creating persistent disk snapshots.",
- "id": "Snapshot",
+ "SslPoliciesListAvailableFeaturesResponse": {
+ "id": "SslPoliciesListAvailableFeaturesResponse",
"properties": {
- "architecture": {
- "description": "[Output Only] The architecture of the snapshot. Valid values are ARM64 or X86_64.",
- "enum": [
- "ARCHITECTURE_UNSPECIFIED",
- "ARM64",
- "X86_64"
- ],
- "enumDescriptions": [
- "Default value indicating Architecture is not set.",
- "Machines with architecture ARM64",
- "Machines with architecture X86_64"
- ],
- "type": "string"
- },
- "autoCreated": {
- "description": "[Output Only] Set to true if snapshots are automatically created by applying resource policy on the target disk.",
- "type": "boolean"
- },
- "chainName": {
- "description": "Creates the new snapshot in the snapshot chain labeled with the specified name. The chain name must be 1-63 characters long and comply with RFC1035. This is an uncommon option only for advanced service owners who needs to create separate snapshot chains, for example, for chargeback tracking. When you describe your snapshot resource, this field is visible only if it has a non-empty value.",
- "type": "string"
- },
- "creationSizeBytes": {
- "description": "[Output Only] Size in bytes of the snapshot at creation time.",
- "format": "int64",
- "type": "string"
- },
- "creationTimestamp": {
- "description": "[Output Only] Creation timestamp in RFC3339 text format.",
- "type": "string"
- },
- "description": {
- "description": "An optional description of this resource. Provide this property when you create the resource.",
- "type": "string"
- },
- "diskSizeGb": {
- "description": "[Output Only] Size of the source disk, specified in GB.",
- "format": "int64",
- "type": "string"
- },
- "downloadBytes": {
- "description": "[Output Only] Number of bytes downloaded to restore a snapshot to a disk.",
- "format": "int64",
- "type": "string"
- },
- "enableConfidentialCompute": {
- "description": "Whether this snapshot is created from a confidential compute mode disk. [Output Only]: This field is not set by user, but from source disk.",
- "type": "boolean"
- },
- "guestOsFeatures": {
- "description": "[Output Only] A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options.",
- "items": {
- "$ref": "GuestOsFeature"
- },
- "type": "array"
- },
- "id": {
- "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.",
- "format": "uint64",
- "type": "string"
- },
- "kind": {
- "default": "compute#snapshot",
- "description": "[Output Only] Type of the resource. Always compute#snapshot for Snapshot resources.",
- "type": "string"
- },
- "labelFingerprint": {
- "description": "A fingerprint for the labels being applied to this snapshot, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a snapshot.",
- "format": "byte",
- "type": "string"
- },
- "labels": {
- "additionalProperties": {
- "type": "string"
- },
- "description": "Labels to apply to this snapshot. These can be later modified by the setLabels method. Label values may be empty.",
- "type": "object"
- },
- "licenseCodes": {
- "description": "[Output Only] Integer license codes indicating which licenses are attached to this snapshot.",
- "items": {
- "format": "int64",
- "type": "string"
- },
- "type": "array"
- },
- "licenses": {
- "description": "[Output Only] A list of public visible licenses that apply to this snapshot. This can be because the original image had licenses attached (such as a Windows image).",
- "items": {
- "type": "string"
- },
- "type": "array"
- },
- "locationHint": {
- "description": "An opaque location hint used to place the snapshot close to other resources. This field is for use by internal tools that use the public API.",
- "type": "string"
- },
- "name": {
- "annotations": {
- "required": [
- "compute.disks.createSnapshot",
- "compute.snapshots.insert"
- ]
- },
- "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- "type": "string"
- },
- "satisfiesPzi": {
- "description": "Output only. Reserved for future use.",
- "readOnly": true,
- "type": "boolean"
- },
- "satisfiesPzs": {
- "description": "[Output Only] Reserved for future use.",
- "type": "boolean"
- },
- "selfLink": {
- "description": "[Output Only] Server-defined URL for the resource.",
- "type": "string"
- },
- "snapshotEncryptionKey": {
- "$ref": "CustomerEncryptionKey",
- "description": "Encrypts the snapshot using a customer-supplied encryption key. After you encrypt a snapshot using a customer-supplied key, you must provide the same key if you use the snapshot later. For example, you must provide the encryption key when you create a disk from the encrypted snapshot in a future request. Customer-supplied encryption keys do not protect access to metadata of the snapshot. If you do not provide an encryption key when creating the snapshot, then the snapshot will be encrypted using an automatically generated key and you do not need to provide a key to use the snapshot later."
- },
- "snapshotType": {
- "description": "Indicates the type of the snapshot.",
- "enum": [
- "ARCHIVE",
- "STANDARD"
- ],
- "enumDescriptions": [
- "",
- ""
- ],
- "type": "string"
- },
- "sourceDisk": {
- "description": "The source disk used to create this snapshot.",
- "type": "string"
- },
- "sourceDiskEncryptionKey": {
- "$ref": "CustomerEncryptionKey",
- "description": "The customer-supplied encryption key of the source disk. Required if the source disk is protected by a customer-supplied encryption key."
- },
- "sourceDiskForRecoveryCheckpoint": {
- "description": "The source disk whose recovery checkpoint will be used to create this snapshot.",
- "type": "string"
- },
- "sourceDiskId": {
- "description": "[Output Only] The ID value of the disk used to create this snapshot. This value may be used to determine whether the snapshot was taken from the current or a previous instance of a given disk name.",
- "type": "string"
- },
- "sourceSnapshotSchedulePolicy": {
- "description": "[Output Only] URL of the resource policy which created this scheduled snapshot.",
- "type": "string"
- },
- "sourceSnapshotSchedulePolicyId": {
- "description": "[Output Only] ID of the resource policy which created this scheduled snapshot.",
- "type": "string"
- },
- "status": {
- "description": "[Output Only] The status of the snapshot. This can be CREATING, DELETING, FAILED, READY, or UPLOADING.",
- "enum": [
- "CREATING",
- "DELETING",
- "FAILED",
- "READY",
- "UPLOADING"
- ],
- "enumDescriptions": [
- "Snapshot creation is in progress.",
- "Snapshot is currently being deleted.",
- "Snapshot creation failed.",
- "Snapshot has been created successfully.",
- "Snapshot is being uploaded."
- ],
- "type": "string"
- },
- "storageBytes": {
- "description": "[Output Only] A size of the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot creation/deletion.",
- "format": "int64",
- "type": "string"
- },
- "storageBytesStatus": {
- "description": "[Output Only] An indicator whether storageBytes is in a stable state or it is being adjusted as a result of shared storage reallocation. This status can either be UPDATING, meaning the size of the snapshot is being updated, or UP_TO_DATE, meaning the size of the snapshot is up-to-date.",
- "enum": [
- "UPDATING",
- "UP_TO_DATE"
- ],
- "enumDescriptions": [
- "",
- ""
- ],
- "type": "string"
- },
- "storageLocations": {
- "description": "Cloud Storage bucket storage location of the snapshot (regional or multi-regional).",
+ "features": {
"items": {
"type": "string"
},
@@ -70155,36 +74961,18 @@
},
"type": "object"
},
- "SnapshotList": {
- "description": "Contains a list of Snapshot resources.",
- "id": "SnapshotList",
+ "SslPoliciesScopedList": {
+ "id": "SslPoliciesScopedList",
"properties": {
- "id": {
- "description": "[Output Only] Unique identifier for the resource; defined by the server.",
- "type": "string"
- },
- "items": {
- "description": "A list of Snapshot resources.",
+ "sslPolicies": {
+ "description": "A list of SslPolicies contained in this scope.",
"items": {
- "$ref": "Snapshot"
+ "$ref": "SslPolicy"
},
"type": "array"
},
- "kind": {
- "default": "compute#snapshotList",
- "description": "Type of resource.",
- "type": "string"
- },
- "nextPageToken": {
- "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
- "type": "string"
- },
- "selfLink": {
- "description": "[Output Only] Server-defined URL for this resource.",
- "type": "string"
- },
"warning": {
- "description": "[Output Only] Informational warning message.",
+ "description": "Informational warning which replaces the list of SSL policies when the list is empty.",
"properties": {
"code": {
"description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.",
@@ -70307,178 +75095,343 @@
},
"type": "object"
},
- "SnapshotSettings": {
- "id": "SnapshotSettings",
- "properties": {
- "storageLocation": {
- "$ref": "SnapshotSettingsStorageLocationSettings",
- "description": "Policy of which storage location is going to be resolved, and additional data that particularizes how the policy is going to be carried out."
- }
- },
- "type": "object"
- },
- "SnapshotSettingsStorageLocationSettings": {
- "id": "SnapshotSettingsStorageLocationSettings",
+ "SslPolicy": {
+ "description": "Represents an SSL Policy resource. Use SSL policies to control SSL features, such as versions and cipher suites, that are offered by Application Load Balancers and proxy Network Load Balancers. For more information, read SSL policies overview.",
+ "id": "SslPolicy",
"properties": {
- "locations": {
- "additionalProperties": {
- "$ref": "SnapshotSettingsStorageLocationSettingsStorageLocationPreference"
+ "creationTimestamp": {
+ "description": "[Output Only] Creation timestamp in RFC3339 text format.",
+ "type": "string"
+ },
+ "customFeatures": {
+ "description": "A list of features enabled when the selected profile is CUSTOM. The method returns the set of features that can be specified in this list. This field must be empty if the profile is not CUSTOM.",
+ "items": {
+ "type": "string"
},
- "description": "When the policy is SPECIFIC_LOCATIONS, snapshots will be stored in the locations listed in this field. Keys are GCS bucket locations.",
- "type": "object"
+ "type": "array"
},
- "policy": {
- "description": "The chosen location policy.",
+ "description": {
+ "description": "An optional description of this resource. Provide this property when you create the resource.",
+ "type": "string"
+ },
+ "enabledFeatures": {
+ "description": "[Output Only] The list of features enabled in the SSL policy.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "fingerprint": {
+ "description": "Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a SslPolicy. An up-to-date fingerprint must be provided in order to update the SslPolicy, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve an SslPolicy.",
+ "format": "byte",
+ "type": "string"
+ },
+ "id": {
+ "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.",
+ "format": "uint64",
+ "type": "string"
+ },
+ "kind": {
+ "default": "compute#sslPolicy",
+ "description": "[Output only] Type of the resource. Always compute#sslPolicyfor SSL policies.",
+ "type": "string"
+ },
+ "minTlsVersion": {
+ "description": "The minimum version of SSL protocol that can be used by the clients to establish a connection with the load balancer. This can be one of TLS_1_0, TLS_1_1, TLS_1_2.",
"enum": [
- "LOCAL_REGION",
- "NEAREST_MULTI_REGION",
- "SPECIFIC_LOCATIONS",
- "STORAGE_LOCATION_POLICY_UNSPECIFIED"
+ "TLS_1_0",
+ "TLS_1_1",
+ "TLS_1_2"
],
"enumDescriptions": [
- "Store snapshot in the same region as with the originating disk. No additional parameters are needed.",
- "Store snapshot to the nearest multi region GCS bucket, relative to the originating disk. No additional parameters are needed.",
- "Store snapshot in the specific locations, as specified by the user. The list of regions to store must be defined under the `locations` field.",
- ""
+ "TLS 1.0",
+ "TLS 1.1",
+ "TLS 1.2"
],
"type": "string"
- }
- },
- "type": "object"
- },
- "SnapshotSettingsStorageLocationSettingsStorageLocationPreference": {
- "description": "A structure for specifying storage locations.",
- "id": "SnapshotSettingsStorageLocationSettingsStorageLocationPreference",
- "properties": {
+ },
"name": {
- "description": "Name of the location. It should be one of the GCS buckets.",
+ "description": "Name of the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "type": "string"
+ },
+ "profile": {
+ "description": "Profile specifies the set of SSL features that can be used by the load balancer when negotiating SSL with clients. This can be one of COMPATIBLE, MODERN, RESTRICTED, or CUSTOM. If using CUSTOM, the set of SSL features to enable must be specified in the customFeatures field.",
+ "enum": [
+ "COMPATIBLE",
+ "CUSTOM",
+ "MODERN",
+ "RESTRICTED"
+ ],
+ "enumDescriptions": [
+ "Compatible profile. Allows the broadset set of clients, even those which support only out-of-date SSL features to negotiate with the load balancer.",
+ "Custom profile. Allow only the set of allowed SSL features specified in the customFeatures field.",
+ "Modern profile. Supports a wide set of SSL features, allowing modern clients to negotiate SSL with the load balancer.",
+ "Restricted profile. Supports a reduced set of SSL features, intended to meet stricter compliance requirements."
+ ],
+ "type": "string"
+ },
+ "region": {
+ "description": "[Output Only] URL of the region where the regional SSL policy resides. This field is not applicable to global SSL policies.",
+ "type": "string"
+ },
+ "selfLink": {
+ "description": "[Output Only] Server-defined URL for the resource.",
"type": "string"
+ },
+ "warnings": {
+ "description": "[Output Only] If potential misconfigurations are detected for this SSL policy, this field will be populated with warning messages.",
+ "items": {
+ "properties": {
+ "code": {
+ "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.",
+ "enum": [
+ "CLEANUP_FAILED",
+ "DEPRECATED_RESOURCE_USED",
+ "DEPRECATED_TYPE_USED",
+ "DISK_SIZE_LARGER_THAN_IMAGE_SIZE",
+ "EXPERIMENTAL_TYPE_USED",
+ "EXTERNAL_API_WARNING",
+ "FIELD_VALUE_OVERRIDEN",
+ "INJECTED_KERNELS_DEPRECATED",
+ "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB",
+ "LARGE_DEPLOYMENT_WARNING",
+ "LIST_OVERHEAD_QUOTA_EXCEED",
+ "MISSING_TYPE_DEPENDENCY",
+ "NEXT_HOP_ADDRESS_NOT_ASSIGNED",
+ "NEXT_HOP_CANNOT_IP_FORWARD",
+ "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE",
+ "NEXT_HOP_INSTANCE_NOT_FOUND",
+ "NEXT_HOP_INSTANCE_NOT_ON_NETWORK",
+ "NEXT_HOP_NOT_RUNNING",
+ "NOT_CRITICAL_ERROR",
+ "NO_RESULTS_ON_PAGE",
+ "PARTIAL_SUCCESS",
+ "REQUIRED_TOS_AGREEMENT",
+ "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING",
+ "RESOURCE_NOT_DELETED",
+ "SCHEMA_VALIDATION_IGNORED",
+ "SINGLE_INSTANCE_PROPERTY_TEMPLATE",
+ "UNDECLARED_PROPERTIES",
+ "UNREACHABLE"
+ ],
+ "enumDeprecated": [
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ true,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false
+ ],
+ "enumDescriptions": [
+ "Warning about failed cleanup of transient changes made by a failed operation.",
+ "A link to a deprecated resource was created.",
+ "When deploying and at least one of the resources has a type marked as deprecated",
+ "The user created a boot disk that is larger than image size.",
+ "When deploying and at least one of the resources has a type marked as experimental",
+ "Warning that is present in an external api call",
+ "Warning that value of a field has been overridden. Deprecated unused field.",
+ "The operation involved use of an injected kernel, which is deprecated.",
+ "A WEIGHTED_MAGLEV backend service is associated with a health check that is not of type HTTP/HTTPS/HTTP2.",
+ "When deploying a deployment with a exceedingly large number of resources",
+ "Resource can't be retrieved due to list overhead quota exceed which captures the amount of resources filtered out by user-defined list filter.",
+ "A resource depends on a missing type",
+ "The route's nextHopIp address is not assigned to an instance on the network.",
+ "The route's next hop instance cannot ip forward.",
+ "The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route.",
+ "The route's nextHopInstance URL refers to an instance that does not exist.",
+ "The route's nextHopInstance URL refers to an instance that is not on the same network as the route.",
+ "The route's next hop instance does not have a status of RUNNING.",
+ "Error which is not critical. We decided to continue the process despite the mentioned error.",
+ "No results are present on a particular list page.",
+ "Success is reported, but some results may be missing due to errors",
+ "The user attempted to use a resource that requires a TOS they have not accepted.",
+ "Warning that a resource is in use.",
+ "One or more of the resources set to auto-delete could not be deleted because they were in use.",
+ "When a resource schema validation is ignored.",
+ "Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group.",
+ "When undeclared properties in the schema are present",
+ "A given scope cannot be reached."
+ ],
+ "type": "string"
+ },
+ "data": {
+ "description": "[Output Only] Metadata about this warning in key: value format. For example: \"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" } ",
+ "items": {
+ "properties": {
+ "key": {
+ "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).",
+ "type": "string"
+ },
+ "value": {
+ "description": "[Output Only] A warning data value corresponding to the key.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "type": "array"
+ },
+ "message": {
+ "description": "[Output Only] A human-readable description of the warning code.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "type": "array"
}
},
"type": "object"
},
- "SourceDiskEncryptionKey": {
- "id": "SourceDiskEncryptionKey",
+ "SslPolicyReference": {
+ "id": "SslPolicyReference",
"properties": {
- "diskEncryptionKey": {
- "$ref": "CustomerEncryptionKey",
- "description": "The customer-supplied encryption key of the source disk. Required if the source disk is protected by a customer-supplied encryption key."
- },
- "sourceDisk": {
- "description": "URL of the disk attached to the source instance. This can be a full or valid partial URL. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - projects/project/zones/zone/disks/disk - zones/zone/disks/disk ",
+ "sslPolicy": {
+ "description": "URL of the SSL policy resource. Set this to empty string to clear any existing SSL policy associated with the target proxy resource.",
"type": "string"
}
},
"type": "object"
},
- "SourceInstanceParams": {
- "description": "A specification of the parameters to use when creating the instance template from a source instance.",
- "id": "SourceInstanceParams",
+ "StatefulPolicy": {
+ "id": "StatefulPolicy",
"properties": {
- "diskConfigs": {
- "description": "Attached disks configuration. If not provided, defaults are applied: For boot disk and any other R/W disks, the source images for each disk will be used. For read-only disks, they will be attached in read-only mode. Local SSD disks will be created as blank volumes.",
- "items": {
- "$ref": "DiskInstantiationConfig"
- },
- "type": "array"
+ "preservedState": {
+ "$ref": "StatefulPolicyPreservedState"
}
},
"type": "object"
},
- "SourceInstanceProperties": {
- "description": "DEPRECATED: Please use compute#instanceProperties instead. New properties will not be added to this field.",
- "id": "SourceInstanceProperties",
+ "StatefulPolicyPreservedState": {
+ "description": "Configuration of preserved resources.",
+ "id": "StatefulPolicyPreservedState",
"properties": {
- "canIpForward": {
- "description": "Enables instances created based on this machine image to send packets with source IP addresses other than their own and receive packets with destination IP addresses other than their own. If these instances will be used as an IP gateway or it will be set as the next-hop in a Route resource, specify true. If unsure, leave this set to false. See the Enable IP forwarding documentation for more information.",
- "type": "boolean"
- },
- "deletionProtection": {
- "description": "Whether the instance created from this machine image should be protected against deletion.",
- "type": "boolean"
- },
- "description": {
- "description": "An optional text description for the instances that are created from this machine image.",
- "type": "string"
- },
"disks": {
- "description": "An array of disks that are associated with the instances that are created from this machine image.",
- "items": {
- "$ref": "SavedAttachedDisk"
+ "additionalProperties": {
+ "$ref": "StatefulPolicyPreservedStateDiskDevice"
},
- "type": "array"
+ "description": "Disks created on the instances that will be preserved on instance delete, update, etc. This map is keyed with the device names of the disks.",
+ "type": "object"
},
- "guestAccelerators": {
- "description": "A list of guest accelerator cards' type and count to use for instances created from this machine image.",
- "items": {
- "$ref": "AcceleratorConfig"
+ "externalIPs": {
+ "additionalProperties": {
+ "$ref": "StatefulPolicyPreservedStateNetworkIp"
},
- "type": "array"
+ "description": "External network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name.",
+ "type": "object"
},
- "keyRevocationActionType": {
- "description": "KeyRevocationActionType of the instance. Supported options are \"STOP\" and \"NONE\". The default value is \"NONE\" if it is not specified.",
+ "internalIPs": {
+ "additionalProperties": {
+ "$ref": "StatefulPolicyPreservedStateNetworkIp"
+ },
+ "description": "Internal network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name.",
+ "type": "object"
+ }
+ },
+ "type": "object"
+ },
+ "StatefulPolicyPreservedStateDiskDevice": {
+ "id": "StatefulPolicyPreservedStateDiskDevice",
+ "properties": {
+ "autoDelete": {
+ "description": "These stateful disks will never be deleted during autohealing, update or VM instance recreate operations. This flag is used to configure if the disk should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. Note: disks attached in READ_ONLY mode cannot be auto-deleted.",
"enum": [
- "KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED",
- "NONE",
- "STOP"
+ "NEVER",
+ "ON_PERMANENT_INSTANCE_DELETION"
],
"enumDescriptions": [
- "Default value. This value is unused.",
- "Indicates user chose no operation.",
- "Indicates user chose to opt for VM shutdown on key revocation."
+ "",
+ ""
],
"type": "string"
- },
- "labels": {
- "additionalProperties": {
- "type": "string"
- },
- "description": "Labels to apply to instances that are created from this machine image.",
- "type": "object"
- },
- "machineType": {
- "description": "The machine type to use for instances that are created from this machine image.",
- "type": "string"
- },
- "metadata": {
- "$ref": "Metadata",
- "description": "The metadata key/value pairs to assign to instances that are created from this machine image. These pairs can consist of custom metadata or predefined keys. See Project and instance metadata for more information."
- },
- "minCpuPlatform": {
- "description": "Minimum cpu/platform to be used by instances created from this machine image. The instance may be scheduled on the specified or newer cpu/platform. Applicable values are the friendly names of CPU platforms, such as minCpuPlatform: \"Intel Haswell\" or minCpuPlatform: \"Intel Sandy Bridge\". For more information, read Specifying a Minimum CPU Platform.",
+ }
+ },
+ "type": "object"
+ },
+ "StatefulPolicyPreservedStateNetworkIp": {
+ "id": "StatefulPolicyPreservedStateNetworkIp",
+ "properties": {
+ "autoDelete": {
+ "description": "These stateful IPs will never be released during autohealing, update or VM instance recreate operations. This flag is used to configure if the IP reservation should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted.",
+ "enum": [
+ "NEVER",
+ "ON_PERMANENT_INSTANCE_DELETION"
+ ],
+ "enumDescriptions": [
+ "",
+ ""
+ ],
"type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "Status": {
+ "description": "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). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).",
+ "id": "Status",
+ "properties": {
+ "code": {
+ "description": "The status code, which should be an enum value of google.rpc.Code.",
+ "format": "int32",
+ "type": "integer"
},
- "networkInterfaces": {
- "description": "An array of network access configurations for this interface.",
- "items": {
- "$ref": "NetworkInterface"
- },
- "type": "array"
- },
- "scheduling": {
- "$ref": "Scheduling",
- "description": "Specifies the scheduling options for the instances that are created from this machine image."
- },
- "serviceAccounts": {
- "description": "A list of service accounts with specified scopes. Access tokens for these service accounts are available to the instances that are created from this machine image. Use metadata queries to obtain the access tokens for these instances.",
+ "details": {
+ "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
"items": {
- "$ref": "ServiceAccount"
+ "additionalProperties": {
+ "description": "Properties of the object. Contains field @type with type URL.",
+ "type": "any"
+ },
+ "type": "object"
},
"type": "array"
},
- "tags": {
- "$ref": "Tags",
- "description": "A list of tags to apply to the instances that are created from this machine image. The tags identify valid sources or targets for network firewalls. The setTags method can modify this list of tags. Each tag within the list must comply with RFC1035."
+ "message": {
+ "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.",
+ "type": "string"
}
},
"type": "object"
},
- "SslCertificate": {
- "description": "Represents an SSL certificate resource. Google Compute Engine has two SSL certificate resources: * [Global](/compute/docs/reference/rest/v1/sslCertificates) * [Regional](/compute/docs/reference/rest/v1/regionSslCertificates) The global SSL certificates (sslCertificates) are used by: - Global external Application Load Balancers - Classic Application Load Balancers - Proxy Network Load Balancers (with target SSL proxies) The regional SSL certificates (regionSslCertificates) are used by: - Regional external Application Load Balancers - Regional internal Application Load Balancers Optionally, certificate file contents that you upload can contain a set of up to five PEM-encoded certificates. The API call creates an object (sslCertificate) that holds this data. You can use SSL keys and certificates to secure connections to a load balancer. For more information, read Creating and using SSL certificates, SSL certificates quotas and limits, and Troubleshooting SSL certificates.",
- "id": "SslCertificate",
+ "StoragePool": {
+ "description": "Represents a zonal storage pool resource.",
+ "id": "StoragePool",
"properties": {
- "certificate": {
- "description": "A value read into memory from a certificate file. The certificate file must be in PEM format. The certificate chain must be no greater than 5 certs long. The chain must include at least one intermediate cert.",
+ "capacityProvisioningType": {
+ "description": "Provisioning type of the byte capacity of the pool.",
+ "enum": [
+ "ADVANCED",
+ "STANDARD",
+ "UNSPECIFIED"
+ ],
+ "enumDescriptions": [
+ "Advanced provisioning \"thinly\" allocates the related resource.",
+ "Standard provisioning allocates the related resource for the pool disks' exclusive use.",
+ ""
+ ],
"type": "string"
},
"creationTimestamp": {
@@ -70489,87 +75442,136 @@
"description": "An optional description of this resource. Provide this property when you create the resource.",
"type": "string"
},
- "expireTime": {
- "description": "[Output Only] Expire time of the certificate. RFC3339",
- "type": "string"
- },
"id": {
"description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.",
"format": "uint64",
"type": "string"
},
"kind": {
- "default": "compute#sslCertificate",
- "description": "[Output Only] Type of the resource. Always compute#sslCertificate for SSL certificates.",
+ "default": "compute#storagePool",
+ "description": "[Output Only] Type of the resource. Always compute#storagePool for storage pools.",
"type": "string"
},
- "managed": {
- "$ref": "SslCertificateManagedSslCertificate",
- "description": "Configuration and status of a managed SSL certificate."
+ "labelFingerprint": {
+ "description": "A fingerprint for the labels being applied to this storage pool, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a storage pool.",
+ "format": "byte",
+ "type": "string"
+ },
+ "labels": {
+ "additionalProperties": {
+ "type": "string"
+ },
+ "description": "Labels to apply to this storage pool. These can be later modified by the setLabels method.",
+ "type": "object"
},
"name": {
+ "annotations": {
+ "required": [
+ "compute.storagePools.insert"
+ ]
+ },
"description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.",
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
"type": "string"
},
- "privateKey": {
- "description": "A value read into memory from a write-only private key file. The private key file must be in PEM format. For security, only insert requests include this field.",
+ "performanceProvisioningType": {
+ "description": "Provisioning type of the performance-related parameters of the pool, such as throughput and IOPS.",
+ "enum": [
+ "ADVANCED",
+ "STANDARD",
+ "UNSPECIFIED"
+ ],
+ "enumDescriptions": [
+ "Advanced provisioning \"thinly\" allocates the related resource.",
+ "Standard provisioning allocates the related resource for the pool disks' exclusive use.",
+ ""
+ ],
"type": "string"
},
- "region": {
- "description": "[Output Only] URL of the region where the regional SSL Certificate resides. This field is not applicable to global SSL Certificate.",
+ "poolProvisionedCapacityGb": {
+ "annotations": {
+ "required": [
+ "compute.storagePools.insert"
+ ]
+ },
+ "description": "Size, in GiB, of the storage pool. For more information about the size limits, see https://cloud.google.com/compute/docs/disks/storage-pools.",
+ "format": "int64",
"type": "string"
},
- "selfLink": {
- "description": "[Output only] Server-defined URL for the resource.",
+ "poolProvisionedIops": {
+ "description": "Provisioned IOPS of the storage pool. Only relevant if the storage pool type is hyperdisk-balanced.",
+ "format": "int64",
"type": "string"
},
- "selfManaged": {
- "$ref": "SslCertificateSelfManagedSslCertificate",
- "description": "Configuration and status of a self-managed SSL certificate."
+ "poolProvisionedThroughput": {
+ "description": "Provisioned throughput of the storage pool. Only relevant if the storage pool type is hyperdisk-balanced or hyperdisk-throughput.",
+ "format": "int64",
+ "type": "string"
},
- "subjectAlternativeNames": {
- "description": "[Output Only] Domains associated with the certificate via Subject Alternative Name.",
- "items": {
- "type": "string"
- },
- "type": "array"
+ "resourceStatus": {
+ "$ref": "StoragePoolResourceStatus",
+ "description": "[Output Only] Status information for the storage pool resource."
},
- "type": {
- "description": "(Optional) Specifies the type of SSL certificate, either \"SELF_MANAGED\" or \"MANAGED\". If not specified, the certificate is self-managed and the fields certificate and private_key are used.",
+ "selfLink": {
+ "description": "[Output Only] Server-defined fully-qualified URL for this resource.",
+ "type": "string"
+ },
+ "selfLinkWithId": {
+ "description": "[Output Only] Server-defined URL for this resource's resource id.",
+ "type": "string"
+ },
+ "state": {
+ "description": "[Output Only] The status of storage pool creation. - CREATING: Storage pool is provisioning. storagePool. - FAILED: Storage pool creation failed. - READY: Storage pool is ready for use. - DELETING: Storage pool is deleting. ",
"enum": [
- "MANAGED",
- "SELF_MANAGED",
- "TYPE_UNSPECIFIED"
+ "CREATING",
+ "DELETING",
+ "FAILED",
+ "READY"
],
"enumDescriptions": [
- "Google-managed SSLCertificate.",
- "Certificate uploaded by user.",
- ""
+ "StoragePool is provisioning",
+ "StoragePool is deleting.",
+ "StoragePool creation failed.",
+ "StoragePool is ready for use."
],
"type": "string"
+ },
+ "status": {
+ "$ref": "StoragePoolResourceStatus",
+ "description": "[Output Only] Status information for the storage pool resource."
+ },
+ "storagePoolType": {
+ "description": "Type of the storage pool.",
+ "type": "string"
+ },
+ "zone": {
+ "description": "[Output Only] URL of the zone where the storage pool resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.",
+ "type": "string"
}
},
"type": "object"
},
- "SslCertificateAggregatedList": {
- "id": "SslCertificateAggregatedList",
+ "StoragePoolAggregatedList": {
+ "id": "StoragePoolAggregatedList",
"properties": {
+ "etag": {
+ "type": "string"
+ },
"id": {
"description": "[Output Only] Unique identifier for the resource; defined by the server.",
"type": "string"
},
"items": {
"additionalProperties": {
- "$ref": "SslCertificatesScopedList",
- "description": "Name of the scope containing this set of SslCertificates."
+ "$ref": "StoragePoolsScopedList",
+ "description": "[Output Only] Name of the scope containing this set of storage pool."
},
- "description": "A list of SslCertificatesScopedList resources.",
+ "description": "A list of StoragePoolsScopedList resources.",
"type": "object"
},
"kind": {
- "default": "compute#sslCertificateAggregatedList",
- "description": "[Output Only] Type of resource. Always compute#sslCertificateAggregatedList for lists of SSL Certificates.",
+ "default": "compute#storagePoolAggregatedList",
+ "description": "[Output Only] Type of resource. Always compute#storagePoolAggregatedList for aggregated lists of storage pools.",
"type": "string"
},
"nextPageToken": {
@@ -70711,24 +75713,103 @@
},
"type": "object"
},
- "SslCertificateList": {
- "description": "Contains a list of SslCertificate resources.",
- "id": "SslCertificateList",
+ "StoragePoolDisk": {
+ "id": "StoragePoolDisk",
+ "properties": {
+ "attachedInstances": {
+ "description": "[Output Only] Instances this disk is attached to.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "creationTimestamp": {
+ "description": "[Output Only] Creation timestamp in RFC3339 text format.",
+ "type": "string"
+ },
+ "disk": {
+ "description": "[Output Only] The URL of the disk.",
+ "type": "string"
+ },
+ "name": {
+ "description": "[Output Only] The name of the disk.",
+ "type": "string"
+ },
+ "provisionedIops": {
+ "description": "[Output Only] The number of IOPS provisioned for the disk.",
+ "format": "int64",
+ "type": "string"
+ },
+ "provisionedThroughput": {
+ "description": "[Output Only] The throughput provisioned for the disk.",
+ "format": "int64",
+ "type": "string"
+ },
+ "resourcePolicies": {
+ "description": "[Output Only] Resource policies applied to disk for automatic snapshot creations.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "sizeGb": {
+ "description": "[Output Only] The disk size, in GB.",
+ "format": "int64",
+ "type": "string"
+ },
+ "status": {
+ "description": "[Output Only] The disk status.",
+ "enum": [
+ "CREATING",
+ "DELETING",
+ "FAILED",
+ "READY",
+ "RESTORING",
+ "UNAVAILABLE"
+ ],
+ "enumDescriptions": [
+ "Disk is provisioning",
+ "Disk is deleting.",
+ "Disk creation failed.",
+ "Disk is ready for use.",
+ "Source data is being copied into the disk.",
+ "Disk is currently unavailable and cannot be accessed, attached or detached."
+ ],
+ "type": "string"
+ },
+ "type": {
+ "description": "[Output Only] The disk type.",
+ "type": "string"
+ },
+ "usedBytes": {
+ "description": "[Output Only] Amount of disk space used.",
+ "format": "int64",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "StoragePoolList": {
+ "description": "A list of StoragePool resources.",
+ "id": "StoragePoolList",
"properties": {
+ "etag": {
+ "type": "string"
+ },
"id": {
"description": "[Output Only] Unique identifier for the resource; defined by the server.",
"type": "string"
},
"items": {
- "description": "A list of SslCertificate resources.",
+ "description": "A list of StoragePool resources.",
"items": {
- "$ref": "SslCertificate"
+ "$ref": "StoragePool"
},
"type": "array"
},
"kind": {
- "default": "compute#sslCertificateList",
- "description": "Type of resource.",
+ "default": "compute#storagePoolList",
+ "description": "[Output Only] Type of resource. Always compute#storagePoolList for lists of storagePools.",
"type": "string"
},
"nextPageToken": {
@@ -70739,6 +75820,13 @@
"description": "[Output Only] Server-defined URL for this resource.",
"type": "string"
},
+ "unreachables": {
+ "description": "[Output Only] Unreachable resources. end_interface: MixerListResponseWithEtagBuilder",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
"warning": {
"description": "[Output Only] Informational warning message.",
"properties": {
@@ -70863,92 +75951,45 @@
},
"type": "object"
},
- "SslCertificateManagedSslCertificate": {
- "description": "Configuration and status of a managed SSL certificate.",
- "id": "SslCertificateManagedSslCertificate",
+ "StoragePoolListDisks": {
+ "id": "StoragePoolListDisks",
"properties": {
- "domainStatus": {
- "additionalProperties": {
- "enum": [
- "ACTIVE",
- "DOMAIN_STATUS_UNSPECIFIED",
- "FAILED_CAA_CHECKING",
- "FAILED_CAA_FORBIDDEN",
- "FAILED_NOT_VISIBLE",
- "FAILED_RATE_LIMITED",
- "PROVISIONING"
- ],
- "enumDescriptions": [
- "A managed certificate can be provisioned, no issues for this domain.",
- "",
- "Failed to check CAA records for the domain.",
- "Certificate issuance forbidden by an explicit CAA record for the domain.",
- "There seems to be problem with the user's DNS or load balancer configuration for this domain.",
- "Reached rate-limit for certificates per top-level private domain.",
- "Certificate provisioning for this domain is under way. GCP will attempt to provision the first certificate."
- ],
- "type": "string"
- },
- "description": "[Output only] Detailed statuses of the domains specified for managed certificate resource.",
- "type": "object"
+ "etag": {
+ "type": "string"
},
- "domains": {
- "description": "The domains for which a managed SSL certificate will be generated. Each Google-managed SSL certificate supports up to the [maximum number of domains per Google-managed SSL certificate](/load-balancing/docs/quotas#ssl_certificates).",
+ "id": {
+ "description": "[Output Only] Unique identifier for the resource; defined by the server.",
+ "type": "string"
+ },
+ "items": {
+ "description": "A list of StoragePoolDisk resources.",
"items": {
- "type": "string"
+ "$ref": "StoragePoolDisk"
},
"type": "array"
},
- "status": {
- "description": "[Output only] Status of the managed certificate resource.",
- "enum": [
- "ACTIVE",
- "MANAGED_CERTIFICATE_STATUS_UNSPECIFIED",
- "PROVISIONING",
- "PROVISIONING_FAILED",
- "PROVISIONING_FAILED_PERMANENTLY",
- "RENEWAL_FAILED"
- ],
- "enumDescriptions": [
- "The certificate management is working, and a certificate has been provisioned.",
- "",
- "The certificate management is working. GCP will attempt to provision the first certificate.",
- "Certificate provisioning failed due to an issue with the DNS or load balancing configuration. For details of which domain failed, consult domain_status field.",
- "Certificate provisioning failed due to an issue with the DNS or load balancing configuration. It won't be retried. To try again delete and create a new managed SslCertificate resource. For details of which domain failed, consult domain_status field.",
- "Renewal of the certificate has failed due to an issue with the DNS or load balancing configuration. The existing cert is still serving; however, it will expire shortly. To provision a renewed certificate, delete and create a new managed SslCertificate resource. For details on which domain failed, consult domain_status field."
- ],
+ "kind": {
+ "default": "compute#storagePoolListDisks",
+ "description": "[Output Only] Type of resource. Always compute#storagePoolListDisks for lists of disks in a storagePool.",
"type": "string"
- }
- },
- "type": "object"
- },
- "SslCertificateSelfManagedSslCertificate": {
- "description": "Configuration and status of a self-managed SSL certificate.",
- "id": "SslCertificateSelfManagedSslCertificate",
- "properties": {
- "certificate": {
- "description": "A local certificate file. The certificate must be in PEM format. The certificate chain must be no greater than 5 certs long. The chain must include at least one intermediate cert.",
+ },
+ "nextPageToken": {
+ "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.",
"type": "string"
},
- "privateKey": {
- "description": "A write-only private key in PEM format. Only insert requests will include this field.",
+ "selfLink": {
+ "description": "[Output Only] Server-defined URL for this resource.",
"type": "string"
- }
- },
- "type": "object"
- },
- "SslCertificatesScopedList": {
- "id": "SslCertificatesScopedList",
- "properties": {
- "sslCertificates": {
- "description": "List of SslCertificates contained in this scope.",
+ },
+ "unreachables": {
+ "description": "[Output Only] Unreachable resources. end_interface: MixerListResponseWithEtagBuilder",
"items": {
- "$ref": "SslCertificate"
+ "type": "string"
},
"type": "array"
},
"warning": {
- "description": "Informational warning which replaces the list of backend services when the list is empty.",
+ "description": "[Output Only] Informational warning message.",
"properties": {
"code": {
"description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.",
@@ -71071,27 +76112,167 @@
},
"type": "object"
},
- "SslPoliciesAggregatedList": {
- "id": "SslPoliciesAggregatedList",
+ "StoragePoolResourceStatus": {
+ "description": "[Output Only] Contains output only fields.",
+ "id": "StoragePoolResourceStatus",
"properties": {
- "etag": {
+ "diskCount": {
+ "description": "[Output Only] Number of disks used.",
+ "format": "int64",
+ "type": "string"
+ },
+ "lastResizeTimestamp": {
+ "description": "[Output Only] Timestamp of the last successful resize in RFC3339 text format.",
+ "type": "string"
+ },
+ "maxTotalProvisionedDiskCapacityGb": {
+ "description": "[Output Only] Maximum allowed aggregate disk size in gigabytes.",
+ "format": "int64",
+ "type": "string"
+ },
+ "poolUsedCapacityBytes": {
+ "description": "[Output Only] Space used by data stored in disks within the storage pool (in bytes). This will reflect the total number of bytes written to the disks in the pool, in contrast to the capacity of those disks.",
+ "format": "int64",
+ "type": "string"
+ },
+ "poolUsedIops": {
+ "description": "[Output Only] Sum of all the disks' provisioned IOPS, minus some amount that is allowed per disk that is not counted towards pool's IOPS capacity. For more information, see https://cloud.google.com/compute/docs/disks/storage-pools.",
+ "format": "int64",
+ "type": "string"
+ },
+ "poolUsedThroughput": {
+ "description": "[Output Only] Sum of all the disks' provisioned throughput in MB/s.",
+ "format": "int64",
+ "type": "string"
+ },
+ "poolUserWrittenBytes": {
+ "description": "[Output Only] Amount of data written into the pool, before it is compacted.",
+ "format": "int64",
+ "type": "string"
+ },
+ "totalProvisionedDiskCapacityGb": {
+ "description": "[Output Only] Sum of all the capacity provisioned in disks in this storage pool. A disk's provisioned capacity is the same as its total capacity.",
+ "format": "int64",
+ "type": "string"
+ },
+ "totalProvisionedDiskIops": {
+ "description": "[Output Only] Sum of all the disks' provisioned IOPS.",
+ "format": "int64",
+ "type": "string"
+ },
+ "totalProvisionedDiskThroughput": {
+ "description": "[Output Only] Sum of all the disks' provisioned throughput in MB/s, minus some amount that is allowed per disk that is not counted towards pool's throughput capacity.",
+ "format": "int64",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "StoragePoolType": {
+ "id": "StoragePoolType",
+ "properties": {
+ "creationTimestamp": {
+ "description": "[Output Only] Creation timestamp in RFC3339 text format.",
+ "type": "string"
+ },
+ "deprecated": {
+ "$ref": "DeprecationStatus",
+ "description": "[Output Only] The deprecation status associated with this storage pool type."
+ },
+ "description": {
+ "description": "[Output Only] An optional description of this resource.",
"type": "string"
},
+ "id": {
+ "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.",
+ "format": "uint64",
+ "type": "string"
+ },
+ "kind": {
+ "default": "compute#storagePoolType",
+ "description": "[Output Only] Type of the resource. Always compute#storagePoolType for storage pool types.",
+ "type": "string"
+ },
+ "maxPoolProvisionedCapacityGb": {
+ "description": "[Output Only] Maximum storage pool size in GB.",
+ "format": "int64",
+ "type": "string"
+ },
+ "maxPoolProvisionedIops": {
+ "description": "[Output Only] Maximum provisioned IOPS.",
+ "format": "int64",
+ "type": "string"
+ },
+ "maxPoolProvisionedThroughput": {
+ "description": "[Output Only] Maximum provisioned throughput.",
+ "format": "int64",
+ "type": "string"
+ },
+ "minPoolProvisionedCapacityGb": {
+ "description": "[Output Only] Minimum storage pool size in GB.",
+ "format": "int64",
+ "type": "string"
+ },
+ "minPoolProvisionedIops": {
+ "description": "[Output Only] Minimum provisioned IOPS.",
+ "format": "int64",
+ "type": "string"
+ },
+ "minPoolProvisionedThroughput": {
+ "description": "[Output Only] Minimum provisioned throughput.",
+ "format": "int64",
+ "type": "string"
+ },
+ "minSizeGb": {
+ "description": "[Deprecated] This field is deprecated. Use minPoolProvisionedCapacityGb instead.",
+ "format": "int64",
+ "type": "string"
+ },
+ "name": {
+ "description": "[Output Only] Name of the resource.",
+ "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
+ "type": "string"
+ },
+ "selfLink": {
+ "description": "[Output Only] Server-defined URL for the resource.",
+ "type": "string"
+ },
+ "selfLinkWithId": {
+ "description": "[Output Only] Server-defined URL for this resource with the resource id.",
+ "type": "string"
+ },
+ "supportedDiskTypes": {
+ "description": "[Output Only] The list of disk types supported in this storage pool type.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "zone": {
+ "description": "[Output Only] URL of the zone where the storage pool type resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "StoragePoolTypeAggregatedList": {
+ "id": "StoragePoolTypeAggregatedList",
+ "properties": {
"id": {
"description": "[Output Only] Unique identifier for the resource; defined by the server.",
"type": "string"
},
"items": {
"additionalProperties": {
- "$ref": "SslPoliciesScopedList",
- "description": "Name of the scope containing this set of SSL policies."
+ "$ref": "StoragePoolTypesScopedList",
+ "description": "[Output Only] Name of the scope containing this set of storage pool types."
},
- "description": "A list of SslPoliciesScopedList resources.",
+ "description": "A list of StoragePoolTypesScopedList resources.",
"type": "object"
},
"kind": {
- "default": "compute#sslPoliciesAggregatedList",
- "description": "[Output Only] Type of resource. Always compute#sslPolicyAggregatedList for lists of SSL Policies.",
+ "default": "compute#storagePoolTypeAggregatedList",
+ "description": "[Output Only] Type of resource. Always compute#storagePoolTypeAggregatedList .",
"type": "string"
},
"nextPageToken": {
@@ -71102,13 +76283,6 @@
"description": "[Output Only] Server-defined URL for this resource.",
"type": "string"
},
- "unreachables": {
- "description": "[Output Only] Unreachable resources.",
- "items": {
- "type": "string"
- },
- "type": "array"
- },
"warning": {
"description": "[Output Only] Informational warning message.",
"properties": {
@@ -71233,23 +76407,24 @@
},
"type": "object"
},
- "SslPoliciesList": {
- "id": "SslPoliciesList",
+ "StoragePoolTypeList": {
+ "description": "Contains a list of storage pool types.",
+ "id": "StoragePoolTypeList",
"properties": {
"id": {
"description": "[Output Only] Unique identifier for the resource; defined by the server.",
"type": "string"
},
"items": {
- "description": "A list of SslPolicy resources.",
+ "description": "A list of StoragePoolType resources.",
"items": {
- "$ref": "SslPolicy"
+ "$ref": "StoragePoolType"
},
"type": "array"
},
"kind": {
- "default": "compute#sslPoliciesList",
- "description": "[Output Only] Type of the resource. Always compute#sslPoliciesList for lists of sslPolicies.",
+ "default": "compute#storagePoolTypeList",
+ "description": "[Output Only] Type of resource. Always compute#storagePoolTypeList for storage pool types.",
"type": "string"
},
"nextPageToken": {
@@ -71384,30 +76559,152 @@
},
"type": "object"
},
- "SslPoliciesListAvailableFeaturesResponse": {
- "id": "SslPoliciesListAvailableFeaturesResponse",
+ "StoragePoolTypesScopedList": {
+ "id": "StoragePoolTypesScopedList",
"properties": {
- "features": {
+ "storagePoolTypes": {
+ "description": "[Output Only] A list of storage pool types contained in this scope.",
"items": {
- "type": "string"
+ "$ref": "StoragePoolType"
},
"type": "array"
+ },
+ "warning": {
+ "description": "[Output Only] Informational warning which replaces the list of storage pool types when the list is empty.",
+ "properties": {
+ "code": {
+ "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.",
+ "enum": [
+ "CLEANUP_FAILED",
+ "DEPRECATED_RESOURCE_USED",
+ "DEPRECATED_TYPE_USED",
+ "DISK_SIZE_LARGER_THAN_IMAGE_SIZE",
+ "EXPERIMENTAL_TYPE_USED",
+ "EXTERNAL_API_WARNING",
+ "FIELD_VALUE_OVERRIDEN",
+ "INJECTED_KERNELS_DEPRECATED",
+ "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB",
+ "LARGE_DEPLOYMENT_WARNING",
+ "LIST_OVERHEAD_QUOTA_EXCEED",
+ "MISSING_TYPE_DEPENDENCY",
+ "NEXT_HOP_ADDRESS_NOT_ASSIGNED",
+ "NEXT_HOP_CANNOT_IP_FORWARD",
+ "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE",
+ "NEXT_HOP_INSTANCE_NOT_FOUND",
+ "NEXT_HOP_INSTANCE_NOT_ON_NETWORK",
+ "NEXT_HOP_NOT_RUNNING",
+ "NOT_CRITICAL_ERROR",
+ "NO_RESULTS_ON_PAGE",
+ "PARTIAL_SUCCESS",
+ "REQUIRED_TOS_AGREEMENT",
+ "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING",
+ "RESOURCE_NOT_DELETED",
+ "SCHEMA_VALIDATION_IGNORED",
+ "SINGLE_INSTANCE_PROPERTY_TEMPLATE",
+ "UNDECLARED_PROPERTIES",
+ "UNREACHABLE"
+ ],
+ "enumDeprecated": [
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ true,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false
+ ],
+ "enumDescriptions": [
+ "Warning about failed cleanup of transient changes made by a failed operation.",
+ "A link to a deprecated resource was created.",
+ "When deploying and at least one of the resources has a type marked as deprecated",
+ "The user created a boot disk that is larger than image size.",
+ "When deploying and at least one of the resources has a type marked as experimental",
+ "Warning that is present in an external api call",
+ "Warning that value of a field has been overridden. Deprecated unused field.",
+ "The operation involved use of an injected kernel, which is deprecated.",
+ "A WEIGHTED_MAGLEV backend service is associated with a health check that is not of type HTTP/HTTPS/HTTP2.",
+ "When deploying a deployment with a exceedingly large number of resources",
+ "Resource can't be retrieved due to list overhead quota exceed which captures the amount of resources filtered out by user-defined list filter.",
+ "A resource depends on a missing type",
+ "The route's nextHopIp address is not assigned to an instance on the network.",
+ "The route's next hop instance cannot ip forward.",
+ "The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route.",
+ "The route's nextHopInstance URL refers to an instance that does not exist.",
+ "The route's nextHopInstance URL refers to an instance that is not on the same network as the route.",
+ "The route's next hop instance does not have a status of RUNNING.",
+ "Error which is not critical. We decided to continue the process despite the mentioned error.",
+ "No results are present on a particular list page.",
+ "Success is reported, but some results may be missing due to errors",
+ "The user attempted to use a resource that requires a TOS they have not accepted.",
+ "Warning that a resource is in use.",
+ "One or more of the resources set to auto-delete could not be deleted because they were in use.",
+ "When a resource schema validation is ignored.",
+ "Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group.",
+ "When undeclared properties in the schema are present",
+ "A given scope cannot be reached."
+ ],
+ "type": "string"
+ },
+ "data": {
+ "description": "[Output Only] Metadata about this warning in key: value format. For example: \"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" } ",
+ "items": {
+ "properties": {
+ "key": {
+ "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).",
+ "type": "string"
+ },
+ "value": {
+ "description": "[Output Only] A warning data value corresponding to the key.",
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "type": "array"
+ },
+ "message": {
+ "description": "[Output Only] A human-readable description of the warning code.",
+ "type": "string"
+ }
+ },
+ "type": "object"
}
},
"type": "object"
},
- "SslPoliciesScopedList": {
- "id": "SslPoliciesScopedList",
+ "StoragePoolsScopedList": {
+ "id": "StoragePoolsScopedList",
"properties": {
- "sslPolicies": {
- "description": "A list of SslPolicies contained in this scope.",
+ "storagePools": {
+ "description": "[Output Only] A list of storage pool contained in this scope.",
"items": {
- "$ref": "SslPolicy"
+ "$ref": "StoragePool"
},
"type": "array"
},
"warning": {
- "description": "Informational warning which replaces the list of SSL policies when the list is empty.",
+ "description": "[Output Only] Informational warning which replaces the list of storage pool when the list is empty.",
"properties": {
"code": {
"description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.",
@@ -71530,327 +76827,6 @@
},
"type": "object"
},
- "SslPolicy": {
- "description": "Represents an SSL Policy resource. Use SSL policies to control SSL features, such as versions and cipher suites, that are offered by Application Load Balancers and proxy Network Load Balancers. For more information, read SSL policies overview.",
- "id": "SslPolicy",
- "properties": {
- "creationTimestamp": {
- "description": "[Output Only] Creation timestamp in RFC3339 text format.",
- "type": "string"
- },
- "customFeatures": {
- "description": "A list of features enabled when the selected profile is CUSTOM. The method returns the set of features that can be specified in this list. This field must be empty if the profile is not CUSTOM.",
- "items": {
- "type": "string"
- },
- "type": "array"
- },
- "description": {
- "description": "An optional description of this resource. Provide this property when you create the resource.",
- "type": "string"
- },
- "enabledFeatures": {
- "description": "[Output Only] The list of features enabled in the SSL policy.",
- "items": {
- "type": "string"
- },
- "type": "array"
- },
- "fingerprint": {
- "description": "Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a SslPolicy. An up-to-date fingerprint must be provided in order to update the SslPolicy, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve an SslPolicy.",
- "format": "byte",
- "type": "string"
- },
- "id": {
- "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.",
- "format": "uint64",
- "type": "string"
- },
- "kind": {
- "default": "compute#sslPolicy",
- "description": "[Output only] Type of the resource. Always compute#sslPolicyfor SSL policies.",
- "type": "string"
- },
- "minTlsVersion": {
- "description": "The minimum version of SSL protocol that can be used by the clients to establish a connection with the load balancer. This can be one of TLS_1_0, TLS_1_1, TLS_1_2.",
- "enum": [
- "TLS_1_0",
- "TLS_1_1",
- "TLS_1_2"
- ],
- "enumDescriptions": [
- "TLS 1.0",
- "TLS 1.1",
- "TLS 1.2"
- ],
- "type": "string"
- },
- "name": {
- "description": "Name of the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.",
- "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- "type": "string"
- },
- "profile": {
- "description": "Profile specifies the set of SSL features that can be used by the load balancer when negotiating SSL with clients. This can be one of COMPATIBLE, MODERN, RESTRICTED, or CUSTOM. If using CUSTOM, the set of SSL features to enable must be specified in the customFeatures field.",
- "enum": [
- "COMPATIBLE",
- "CUSTOM",
- "MODERN",
- "RESTRICTED"
- ],
- "enumDescriptions": [
- "Compatible profile. Allows the broadset set of clients, even those which support only out-of-date SSL features to negotiate with the load balancer.",
- "Custom profile. Allow only the set of allowed SSL features specified in the customFeatures field.",
- "Modern profile. Supports a wide set of SSL features, allowing modern clients to negotiate SSL with the load balancer.",
- "Restricted profile. Supports a reduced set of SSL features, intended to meet stricter compliance requirements."
- ],
- "type": "string"
- },
- "region": {
- "description": "[Output Only] URL of the region where the regional SSL policy resides. This field is not applicable to global SSL policies.",
- "type": "string"
- },
- "selfLink": {
- "description": "[Output Only] Server-defined URL for the resource.",
- "type": "string"
- },
- "warnings": {
- "description": "[Output Only] If potential misconfigurations are detected for this SSL policy, this field will be populated with warning messages.",
- "items": {
- "properties": {
- "code": {
- "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.",
- "enum": [
- "CLEANUP_FAILED",
- "DEPRECATED_RESOURCE_USED",
- "DEPRECATED_TYPE_USED",
- "DISK_SIZE_LARGER_THAN_IMAGE_SIZE",
- "EXPERIMENTAL_TYPE_USED",
- "EXTERNAL_API_WARNING",
- "FIELD_VALUE_OVERRIDEN",
- "INJECTED_KERNELS_DEPRECATED",
- "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB",
- "LARGE_DEPLOYMENT_WARNING",
- "LIST_OVERHEAD_QUOTA_EXCEED",
- "MISSING_TYPE_DEPENDENCY",
- "NEXT_HOP_ADDRESS_NOT_ASSIGNED",
- "NEXT_HOP_CANNOT_IP_FORWARD",
- "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE",
- "NEXT_HOP_INSTANCE_NOT_FOUND",
- "NEXT_HOP_INSTANCE_NOT_ON_NETWORK",
- "NEXT_HOP_NOT_RUNNING",
- "NOT_CRITICAL_ERROR",
- "NO_RESULTS_ON_PAGE",
- "PARTIAL_SUCCESS",
- "REQUIRED_TOS_AGREEMENT",
- "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING",
- "RESOURCE_NOT_DELETED",
- "SCHEMA_VALIDATION_IGNORED",
- "SINGLE_INSTANCE_PROPERTY_TEMPLATE",
- "UNDECLARED_PROPERTIES",
- "UNREACHABLE"
- ],
- "enumDeprecated": [
- false,
- false,
- false,
- false,
- false,
- false,
- true,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false
- ],
- "enumDescriptions": [
- "Warning about failed cleanup of transient changes made by a failed operation.",
- "A link to a deprecated resource was created.",
- "When deploying and at least one of the resources has a type marked as deprecated",
- "The user created a boot disk that is larger than image size.",
- "When deploying and at least one of the resources has a type marked as experimental",
- "Warning that is present in an external api call",
- "Warning that value of a field has been overridden. Deprecated unused field.",
- "The operation involved use of an injected kernel, which is deprecated.",
- "A WEIGHTED_MAGLEV backend service is associated with a health check that is not of type HTTP/HTTPS/HTTP2.",
- "When deploying a deployment with a exceedingly large number of resources",
- "Resource can't be retrieved due to list overhead quota exceed which captures the amount of resources filtered out by user-defined list filter.",
- "A resource depends on a missing type",
- "The route's nextHopIp address is not assigned to an instance on the network.",
- "The route's next hop instance cannot ip forward.",
- "The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route.",
- "The route's nextHopInstance URL refers to an instance that does not exist.",
- "The route's nextHopInstance URL refers to an instance that is not on the same network as the route.",
- "The route's next hop instance does not have a status of RUNNING.",
- "Error which is not critical. We decided to continue the process despite the mentioned error.",
- "No results are present on a particular list page.",
- "Success is reported, but some results may be missing due to errors",
- "The user attempted to use a resource that requires a TOS they have not accepted.",
- "Warning that a resource is in use.",
- "One or more of the resources set to auto-delete could not be deleted because they were in use.",
- "When a resource schema validation is ignored.",
- "Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group.",
- "When undeclared properties in the schema are present",
- "A given scope cannot be reached."
- ],
- "type": "string"
- },
- "data": {
- "description": "[Output Only] Metadata about this warning in key: value format. For example: \"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" } ",
- "items": {
- "properties": {
- "key": {
- "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).",
- "type": "string"
- },
- "value": {
- "description": "[Output Only] A warning data value corresponding to the key.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "type": "array"
- },
- "message": {
- "description": "[Output Only] A human-readable description of the warning code.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "SslPolicyReference": {
- "id": "SslPolicyReference",
- "properties": {
- "sslPolicy": {
- "description": "URL of the SSL policy resource. Set this to empty string to clear any existing SSL policy associated with the target proxy resource.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "StatefulPolicy": {
- "id": "StatefulPolicy",
- "properties": {
- "preservedState": {
- "$ref": "StatefulPolicyPreservedState"
- }
- },
- "type": "object"
- },
- "StatefulPolicyPreservedState": {
- "description": "Configuration of preserved resources.",
- "id": "StatefulPolicyPreservedState",
- "properties": {
- "disks": {
- "additionalProperties": {
- "$ref": "StatefulPolicyPreservedStateDiskDevice"
- },
- "description": "Disks created on the instances that will be preserved on instance delete, update, etc. This map is keyed with the device names of the disks.",
- "type": "object"
- },
- "externalIPs": {
- "additionalProperties": {
- "$ref": "StatefulPolicyPreservedStateNetworkIp"
- },
- "description": "External network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name.",
- "type": "object"
- },
- "internalIPs": {
- "additionalProperties": {
- "$ref": "StatefulPolicyPreservedStateNetworkIp"
- },
- "description": "Internal network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name.",
- "type": "object"
- }
- },
- "type": "object"
- },
- "StatefulPolicyPreservedStateDiskDevice": {
- "id": "StatefulPolicyPreservedStateDiskDevice",
- "properties": {
- "autoDelete": {
- "description": "These stateful disks will never be deleted during autohealing, update or VM instance recreate operations. This flag is used to configure if the disk should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. Note: disks attached in READ_ONLY mode cannot be auto-deleted.",
- "enum": [
- "NEVER",
- "ON_PERMANENT_INSTANCE_DELETION"
- ],
- "enumDescriptions": [
- "",
- ""
- ],
- "type": "string"
- }
- },
- "type": "object"
- },
- "StatefulPolicyPreservedStateNetworkIp": {
- "id": "StatefulPolicyPreservedStateNetworkIp",
- "properties": {
- "autoDelete": {
- "description": "These stateful IPs will never be released during autohealing, update or VM instance recreate operations. This flag is used to configure if the IP reservation should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted.",
- "enum": [
- "NEVER",
- "ON_PERMANENT_INSTANCE_DELETION"
- ],
- "enumDescriptions": [
- "",
- ""
- ],
- "type": "string"
- }
- },
- "type": "object"
- },
- "Status": {
- "description": "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). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).",
- "id": "Status",
- "properties": {
- "code": {
- "description": "The status code, which should be an enum value of google.rpc.Code.",
- "format": "int32",
- "type": "integer"
- },
- "details": {
- "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
- "items": {
- "additionalProperties": {
- "description": "Properties of the object. Contains field @type with type URL.",
- "type": "any"
- },
- "type": "object"
- },
- "type": "array"
- },
- "message": {
- "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.",
- "type": "string"
- }
- },
- "type": "object"
- },
"Subnetwork": {
"description": "Represents a Subnetwork resource. A subnetwork (also known as a subnet) is a logical partition of a Virtual Private Cloud network with one primary IP range and zero or more secondary IP ranges. For more information, read Virtual Private Cloud (VPC) Network.",
"id": "Subnetwork",
@@ -71886,7 +76862,7 @@
"type": "string"
},
"internalIpv6Prefix": {
- "description": "[Output Only] The internal IPv6 address range that is assigned to this subnetwork.",
+ "description": "The internal IPv6 address range that is owned by this subnetwork.",
"type": "string"
},
"ipCidrRange": {
@@ -72002,11 +76978,13 @@
"description": "The stack type for the subnet. If set to IPV4_ONLY, new VMs in the subnet are assigned IPv4 addresses only. If set to IPV4_IPV6, new VMs in the subnet can be assigned both IPv4 and IPv6 addresses. If not specified, IPV4_ONLY is used. This field can be both set at resource creation time and updated using patch.",
"enum": [
"IPV4_IPV6",
- "IPV4_ONLY"
+ "IPV4_ONLY",
+ "IPV6_ONLY"
],
"enumDescriptions": [
"New VMs in this subnet can have both IPv4 and IPv6 addresses.",
- "New VMs in this subnet will only be assigned IPv4 addresses."
+ "New VMs in this subnet will only be assigned IPv4 addresses.",
+ "New VMs in this subnet will only be assigned IPv6 addresses."
],
"type": "string"
},
@@ -73429,7 +78407,7 @@
"type": "string"
},
"certificateMap": {
- "description": "URL of a certificate map that identifies a certificate map associated with the given target proxy. This field can only be set for global target proxies. If set, sslCertificates will be ignored. Accepted format is //certificatemanager.googleapis.com/projects/{project }/locations/{location}/certificateMaps/{resourceName}.",
+ "description": "URL of a certificate map that identifies a certificate map associated with the given target proxy. This field can only be set for Global external Application Load Balancer or Classic Application Load Balancer. For other products use Certificate Manager Certificates instead. If set, sslCertificates will be ignored. Accepted format is //certificatemanager.googleapis.com/projects/{project }/locations/{location}/certificateMaps/{resourceName}.",
"type": "string"
},
"creationTimestamp": {
@@ -73496,7 +78474,7 @@
"type": "string"
},
"sslCertificates": {
- "description": "URLs to SslCertificate resources that are used to authenticate connections between users and the load balancer. At least one SSL certificate must be specified. Currently, you may specify up to 15 SSL certificates. sslCertificates do not apply when the load balancing scheme is set to INTERNAL_SELF_MANAGED.",
+ "description": "URLs to SslCertificate resources that are used to authenticate connections between users and the load balancer. At least one SSL certificate must be specified. SslCertificates do not apply when the load balancing scheme is set to INTERNAL_SELF_MANAGED. The URLs should refer to a SSL Certificate resource or Certificate Manager Certificate resource. Mixing Classic Certificates and Certificate Manager Certificates is not allowed. Certificate Manager Certificates must include the certificatemanager API. Certificate Manager Certificates are not supported by Global external Application Load Balancer or Classic Application Load Balancer, use certificate_map instead. Currently, you may specify up to 15 Classic SSL Certificates. Certificate Manager Certificates accepted formats are: - //certificatemanager.googleapis.com/projects/{project}/locations/{ location}/certificates/{resourceName}. - https://certificatemanager.googleapis.com/v1alpha1/projects/{project }/locations/{location}/certificates/{resourceName}. ",
"items": {
"type": "string"
},
@@ -73506,6 +78484,20 @@
"description": "URL of SslPolicy resource that will be associated with the TargetHttpsProxy resource. If not set, the TargetHttpsProxy resource has no SSL policy configured.",
"type": "string"
},
+ "tlsEarlyData": {
+ "description": " Specifies whether TLS 1.3 0-RTT Data (\"Early Data\") should be accepted for this service. Early Data allows a TLS resumption handshake to include the initial application payload (a HTTP request) alongside the handshake, reducing the effective round trips to \"zero\". This applies to TLS 1.3 connections over TCP (HTTP/2) as well as over UDP (QUIC/h3). This can improve application performance, especially on networks where interruptions may be common, such as on mobile. Requests with Early Data will have the \"Early-Data\" HTTP header set on the request, with a value of \"1\", to allow the backend to determine whether Early Data was included. Note: TLS Early Data may allow requests to be replayed, as the data is sent to the backend before the handshake has fully completed. Applications that allow idempotent HTTP methods to make non-idempotent changes, such as a GET request updating a database, should not accept Early Data on those requests, and reject requests with the \"Early-Data: 1\" HTTP header by returning a HTTP 425 (Too Early) status code, in order to remain RFC compliant. The default value is DISABLED.",
+ "enum": [
+ "DISABLED",
+ "PERMISSIVE",
+ "STRICT"
+ ],
+ "enumDescriptions": [
+ "TLS 1.3 Early Data is not advertised, and any (invalid) attempts to send Early Data will be rejected by closing the connection.",
+ "This enables TLS 1.3 0-RTT, and only allows Early Data to be included on requests with safe HTTP methods (GET, HEAD, OPTIONS, TRACE). This mode does not enforce any other limitations for requests with Early Data. The application owner should validate that Early Data is acceptable for a given request path.",
+ "This enables TLS 1.3 0-RTT, and only allows Early Data to be included on requests with safe HTTP methods (GET, HEAD, OPTIONS, TRACE) without query parameters. Requests that send Early Data with non-idempotent HTTP methods or with query parameters will be rejected with a HTTP 425."
+ ],
+ "type": "string"
+ },
"urlMap": {
"description": "A fully-qualified or valid partial URL to the UrlMap resource that defines the mapping from URL to the BackendService. For example, the following are all valid URLs for specifying a URL map: - https://www.googleapis.compute/v1/projects/project/global/urlMaps/ url-map - projects/project/global/urlMaps/url-map - global/urlMaps/url-map ",
"type": "string"
@@ -74401,7 +79393,8 @@
"GENERATED_COOKIE",
"HEADER_FIELD",
"HTTP_COOKIE",
- "NONE"
+ "NONE",
+ "STRONG_COOKIE_AFFINITY"
],
"enumDescriptions": [
"2-tuple hash on packet's source and destination IP addresses. Connections from the same source IP address to the same destination IP address will be served by the same backend VM while that VM remains healthy.",
@@ -74411,7 +79404,8 @@
"Hash based on a cookie generated by the L7 loadbalancer. Only valid for HTTP(S) load balancing.",
"The hash is based on a user specified header field.",
"The hash is based on a user provided cookie.",
- "No session affinity. Connections from the same client IP may go to any instance in the pool."
+ "No session affinity. Connections from the same client IP may go to any instance in the pool.",
+ "Strong cookie-based affinity. Connections bearing the same cookie will be served by the same backend VM while that VM remains healthy, as long as the cookie has not expired."
],
"type": "string"
}
@@ -76417,19 +81411,23 @@
"type": "object"
},
"UrlMap": {
- "description": "Represents a URL Map resource. Compute Engine has two URL Map resources: * [Global](/compute/docs/reference/rest/v1/urlMaps) * [Regional](/compute/docs/reference/rest/v1/regionUrlMaps) A URL map resource is a component of certain types of cloud load balancers and Traffic Director: * urlMaps are used by global external Application Load Balancers, classic Application Load Balancers, and cross-region internal Application Load Balancers. * regionUrlMaps are used by internal Application Load Balancers, regional external Application Load Balancers and regional internal Application Load Balancers. For a list of supported URL map features by the load balancer type, see the Load balancing features: Routing and traffic management table. For a list of supported URL map features for Traffic Director, see the Traffic Director features: Routing and traffic management table. This resource defines mappings from hostnames and URL paths to either a backend service or a backend bucket. To use the global urlMaps resource, the backend service must have a loadBalancingScheme of either EXTERNAL or INTERNAL_SELF_MANAGED. To use the regionUrlMaps resource, the backend service must have a loadBalancingScheme of INTERNAL_MANAGED. For more information, read URL Map Concepts.",
+ "description": "Represents a URL Map resource. Compute Engine has two URL Map resources: * [Global](/compute/docs/reference/rest/v1/urlMaps) * [Regional](/compute/docs/reference/rest/v1/regionUrlMaps) A URL map resource is a component of certain types of cloud load balancers and Traffic Director: * urlMaps are used by global external Application Load Balancers, classic Application Load Balancers, and cross-region internal Application Load Balancers. * regionUrlMaps are used by internal Application Load Balancers, regional external Application Load Balancers and regional internal Application Load Balancers. For a list of supported URL map features by the load balancer type, see the Load balancing features: Routing and traffic management table. For a list of supported URL map features for Traffic Director, see the Traffic Director features: Routing and traffic management table. This resource defines mappings from hostnames and URL paths to either a backend service or a backend bucket. To use the global urlMaps resource, the backend service must have a loadBalancingScheme of either EXTERNAL, EXTERNAL_MANAGED, or INTERNAL_SELF_MANAGED. To use the regionUrlMaps resource, the backend service must have a loadBalancingScheme of INTERNAL_MANAGED. For more information, read URL Map Concepts.",
"id": "UrlMap",
"properties": {
"creationTimestamp": {
"description": "[Output Only] Creation timestamp in RFC3339 text format.",
"type": "string"
},
+ "defaultCustomErrorResponsePolicy": {
+ "$ref": "CustomErrorResponsePolicy",
+ "description": "defaultCustomErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendServiceor BackendBucket responds with an error. This policy takes effect at the load balancer level and applies only when no policy has been defined for the error code at lower levels like PathMatcher, RouteRule and PathRule within this UrlMap. For example, consider a UrlMap with the following configuration: - defaultCustomErrorResponsePolicy containing policies for responding to 5xx and 4xx errors - A PathMatcher configured for *.example.com has defaultCustomErrorResponsePolicy for 4xx. If a request for http://www.example.com/ encounters a 404, the policy in pathMatcher.defaultCustomErrorResponsePolicy will be enforced. When the request for http://www.example.com/ encounters a 502, the policy in UrlMap.defaultCustomErrorResponsePolicy will be enforced. When a request that does not match any host in *.example.com such as http://www.myotherexample.com/, encounters a 404, UrlMap.defaultCustomErrorResponsePolicy takes effect. When used in conjunction with defaultRouteAction.retryPolicy, retries take precedence. Only once all retries are exhausted, the defaultCustomErrorResponsePolicy is applied. While attempting a retry, if load balancer is successful in reaching the service, the defaultCustomErrorResponsePolicy is ignored and the response from the service is returned to the client. defaultCustomErrorResponsePolicy is supported only for global external Application Load Balancers."
+ },
"defaultRouteAction": {
"$ref": "HttpRouteAction",
"description": "defaultRouteAction takes effect when none of the hostRules match. The load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. Only one of defaultRouteAction or defaultUrlRedirect must be set. URL maps for classic Application Load Balancers only support the urlRewrite action within defaultRouteAction. defaultRouteAction has no effect when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true."
},
"defaultService": {
- "description": "The full or partial URL of the defaultService resource to which traffic is directed if none of the hostRules match. If defaultRouteAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. However, if defaultService is specified, defaultRouteAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. Only one of defaultService, defaultUrlRedirect , or defaultRouteAction.weightedBackendService must be set. defaultService has no effect when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true.",
+ "description": "The full or partial URL of the defaultService resource to which traffic is directed if none of the hostRules match. If defaultRouteAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. However, if defaultService is specified, defaultRouteAction cannot contain any defaultRouteAction.weightedBackendServices. Conversely, if defaultRouteAction specifies any defaultRouteAction.weightedBackendServices, defaultService must not be specified. If defaultService is specified, then set either defaultUrlRedirect , or defaultRouteAction.weightedBackendService Don't set both. defaultService has no effect when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true.",
"type": "string"
},
"defaultUrlRedirect": {
@@ -77163,11 +82161,13 @@
"description": "The stack type for the subnet. If set to IPV4_ONLY, new VMs in the subnet are assigned IPv4 addresses only. If set to IPV4_IPV6, new VMs in the subnet can be assigned both IPv4 and IPv6 addresses. If not specified, IPV4_ONLY is used. This field can be both set at resource creation time and updated using patch.",
"enum": [
"IPV4_IPV6",
- "IPV4_ONLY"
+ "IPV4_ONLY",
+ "IPV6_ONLY"
],
"enumDescriptions": [
"New VMs in this subnet can have both IPv4 and IPv6 addresses.",
- "New VMs in this subnet will only be assigned IPv4 addresses."
+ "New VMs in this subnet will only be assigned IPv4 addresses.",
+ "New VMs in this subnet will only be assigned IPv6 addresses."
],
"type": "string"
},
@@ -77622,6 +82622,18 @@
"description": "An optional description of this resource. Provide this property when you create the resource.",
"type": "string"
},
+ "gatewayIpVersion": {
+ "description": "The IP family of the gateway IPs for the HA-VPN gateway interfaces. If not specified, IPV4 will be used.",
+ "enum": [
+ "IPV4",
+ "IPV6"
+ ],
+ "enumDescriptions": [
+ "Every HA-VPN gateway interface is configured with an IPv4 address.",
+ "Every HA-VPN gateway interface is configured with an IPv6 address."
+ ],
+ "type": "string"
+ },
"id": {
"description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.",
"format": "uint64",
@@ -77672,14 +82684,16 @@
"type": "string"
},
"stackType": {
- "description": "The stack type for this VPN gateway to identify the IP protocols that are enabled. Possible values are: IPV4_ONLY, IPV4_IPV6. If not specified, IPV4_ONLY will be used.",
+ "description": "The stack type for this VPN gateway to identify the IP protocols that are enabled. Possible values are: IPV4_ONLY, IPV4_IPV6, IPV6_ONLY. If not specified, IPV4_ONLY is used if the gateway IP version is IPV4, or IPV4_IPV6 if the gateway IP version is IPV6.",
"enum": [
"IPV4_IPV6",
- "IPV4_ONLY"
+ "IPV4_ONLY",
+ "IPV6_ONLY"
],
"enumDescriptions": [
"Enable VPN gateway with both IPv4 and IPv6 protocols.",
- "Enable VPN gateway with only IPv4 protocol."
+ "Enable VPN gateway with only IPv4 protocol.",
+ "Enable VPN gateway with only IPv6 protocol."
],
"type": "string"
},
@@ -78109,6 +83123,10 @@
"ipAddress": {
"description": "[Output Only] IP address for this VPN interface associated with the VPN gateway. The IP address could be either a regional external IP address or a regional internal IP address. The two IP addresses for a VPN gateway must be all regional external or regional internal IP addresses. There cannot be a mix of regional external IP addresses and regional internal IP addresses. For HA VPN over Cloud Interconnect, the IP addresses for both interfaces could either be regional internal IP addresses or regional external IP addresses. For regular (non HA VPN over Cloud Interconnect) HA VPN tunnels, the IP address must be a regional external IP address.",
"type": "string"
+ },
+ "ipv6Address": {
+ "description": "[Output Only] IPv6 address for this VPN interface associated with the VPN gateway. The IPv6 address must be a regional external IPv6 address. The format is RFC 5952 format (e.g. 2001:db8::2d9:51:0:0).",
+ "type": "string"
}
},
"type": "object"
@@ -78300,7 +83318,7 @@
"type": "object"
},
"localTrafficSelector": {
- "description": "Local traffic selector to use when establishing the VPN tunnel with the peer VPN gateway. The value should be a CIDR formatted string, for example: 192.168.0.0/16. The ranges must be disjoint. Only IPv4 is supported.",
+ "description": "Local traffic selector to use when establishing the VPN tunnel with the peer VPN gateway. The value should be a CIDR formatted string, for example: 192.168.0.0/16. The ranges must be disjoint. Only IPv4 is supported for Classic VPN tunnels. This field is output only for HA VPN tunnels.",
"items": {
"type": "string"
},
@@ -78330,7 +83348,7 @@
"type": "string"
},
"peerIp": {
- "description": "IP address of the peer VPN gateway. Only IPv4 is supported.",
+ "description": "IP address of the peer VPN gateway. Only IPv4 is supported. This field can be set only for Classic VPN tunnels.",
"type": "string"
},
"region": {
@@ -78338,7 +83356,7 @@
"type": "string"
},
"remoteTrafficSelector": {
- "description": "Remote traffic selectors to use when establishing the VPN tunnel with the peer VPN gateway. The value should be a CIDR formatted string, for example: 192.168.0.0/16. The ranges should be disjoint. Only IPv4 is supported.",
+ "description": "Remote traffic selectors to use when establishing the VPN tunnel with the peer VPN gateway. The value should be a CIDR formatted string, for example: 192.168.0.0/16. The ranges should be disjoint. Only IPv4 is supported for Classic VPN tunnels. This field is output only for HA VPN tunnels.",
"items": {
"type": "string"
},
@@ -78395,7 +83413,7 @@
"type": "string"
},
"targetVpnGateway": {
- "description": "URL of the Target VPN gateway with which this VPN tunnel is associated. Provided by the client when the VPN tunnel is created.",
+ "description": "URL of the Target VPN gateway with which this VPN tunnel is associated. Provided by the client when the VPN tunnel is created. This field can be set only for Classic VPN tunnels.",
"type": "string"
},
"vpnGateway": {
@@ -78907,7 +83925,7 @@
"description": "Specifies changes to request and response headers that need to take effect for the selected backendService. headerAction specified here take effect before headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. headerAction is not supported for load balancers that have their loadBalancingScheme set to EXTERNAL. Not supported when the URL map is bound to a target gRPC proxy that has validateForProxyless field set to true."
},
"weight": {
- "description": "Specifies the fraction of traffic sent to a backend service, computed as weight / (sum of all weightedBackendService weights in routeAction) . The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backend service, subsequent requests are sent to the same backend service as determined by the backend service's session affinity policy. The value must be from 0 to 1000.",
+ "description": "Specifies the fraction of traffic sent to a backend service, computed as weight / (sum of all weightedBackendService weights in routeAction) . The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backend service, subsequent requests are sent to the same backend service as determined by the backend service's session affinity policy. Don't configure session affinity if you're using weighted traffic splitting. If you do, the weighted traffic splitting configuration takes precedence. The value must be from 0 to 1000.",
"format": "uint32",
"type": "integer"
}
@@ -79089,7 +84107,7 @@
"type": "object"
},
"Zone": {
- "description": "Represents a Zone resource. A zone is a deployment area. These deployment areas are subsets of a region. For example the zone us-east1-a is located in the us-east1 region. For more information, read Regions and Zones.",
+ "description": "Represents a Zone resource. A zone is a deployment area. These deployment areas are subsets of a region. For example the zone us-east1-b is located in the us-east1 region. For more information, read Regions and Zones.",
"id": "Zone",
"properties": {
"availableCpuPlatforms": {
diff --git a/vendor/google.golang.org/api/compute/v1/compute-gen.go b/vendor/google.golang.org/api/compute/v1/compute-gen.go
index 071ce572..b437b422 100644
--- a/vendor/google.golang.org/api/compute/v1/compute-gen.go
+++ b/vendor/google.golang.org/api/compute/v1/compute-gen.go
@@ -97,12 +97,11 @@ const apiVersion = "v1"
const basePath = "https://compute.googleapis.com/compute/v1/"
const basePathTemplate = "https://compute.UNIVERSE_DOMAIN/compute/v1/"
const mtlsBasePath = "https://compute.mtls.googleapis.com/compute/v1/"
-const defaultUniverseDomain = "googleapis.com"
// OAuth2 scopes used by this API.
const (
- // See, edit, configure, and delete your Google Cloud data and see the
- // email address for your Google Account.
+ // See, edit, configure, and delete your Google Cloud data and see the email
+ // address for your Google Account.
CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
// View and manage your Google Compute Engine resources
@@ -111,15 +110,15 @@ const (
// View your Google Compute Engine resources
ComputeReadonlyScope = "https://www.googleapis.com/auth/compute.readonly"
- // Manage your data and permissions in Cloud Storage and see the email
- // address for your Google Account
+ // Manage your data and permissions in Cloud Storage and see the email address
+ // for your Google Account
DevstorageFullControlScope = "https://www.googleapis.com/auth/devstorage.full_control"
// View your data in Google Cloud Storage
DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devstorage.read_only"
- // Manage your data in Cloud Storage and see the email address of your
- // Google Account
+ // Manage your data in Cloud Storage and see the email address of your Google
+ // Account
DevstorageReadWriteScope = "https://www.googleapis.com/auth/devstorage.read_write"
)
@@ -138,7 +137,7 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err
opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
- opts = append(opts, internaloption.WithDefaultUniverseDomain(defaultUniverseDomain))
+ opts = append(opts, internaloption.EnableNewAuthLibrary())
client, endpoint, err := htransport.NewClient(ctx, opts...)
if err != nil {
return nil, err
@@ -185,10 +184,13 @@ func New(client *http.Client) (*Service, error) {
s.HttpsHealthChecks = NewHttpsHealthChecksService(s)
s.ImageFamilyViews = NewImageFamilyViewsService(s)
s.Images = NewImagesService(s)
+ s.InstanceGroupManagerResizeRequests = NewInstanceGroupManagerResizeRequestsService(s)
s.InstanceGroupManagers = NewInstanceGroupManagersService(s)
s.InstanceGroups = NewInstanceGroupsService(s)
+ s.InstanceSettings = NewInstanceSettingsService(s)
s.InstanceTemplates = NewInstanceTemplatesService(s)
s.Instances = NewInstancesService(s)
+ s.InstantSnapshots = NewInstantSnapshotsService(s)
s.InterconnectAttachments = NewInterconnectAttachmentsService(s)
s.InterconnectLocations = NewInterconnectLocationsService(s)
s.InterconnectRemoteLocations = NewInterconnectRemoteLocationsService(s)
@@ -220,6 +222,7 @@ func New(client *http.Client) (*Service, error) {
s.RegionInstanceGroups = NewRegionInstanceGroupsService(s)
s.RegionInstanceTemplates = NewRegionInstanceTemplatesService(s)
s.RegionInstances = NewRegionInstancesService(s)
+ s.RegionInstantSnapshots = NewRegionInstantSnapshotsService(s)
s.RegionNetworkEndpointGroups = NewRegionNetworkEndpointGroupsService(s)
s.RegionNetworkFirewallPolicies = NewRegionNetworkFirewallPoliciesService(s)
s.RegionNotificationEndpoints = NewRegionNotificationEndpointsService(s)
@@ -243,6 +246,8 @@ func New(client *http.Client) (*Service, error) {
s.Snapshots = NewSnapshotsService(s)
s.SslCertificates = NewSslCertificatesService(s)
s.SslPolicies = NewSslPoliciesService(s)
+ s.StoragePoolTypes = NewStoragePoolTypesService(s)
+ s.StoragePools = NewStoragePoolsService(s)
s.Subnetworks = NewSubnetworksService(s)
s.TargetGrpcProxies = NewTargetGrpcProxiesService(s)
s.TargetHttpProxies = NewTargetHttpProxiesService(s)
@@ -309,14 +314,20 @@ type Service struct {
Images *ImagesService
+ InstanceGroupManagerResizeRequests *InstanceGroupManagerResizeRequestsService
+
InstanceGroupManagers *InstanceGroupManagersService
InstanceGroups *InstanceGroupsService
+ InstanceSettings *InstanceSettingsService
+
InstanceTemplates *InstanceTemplatesService
Instances *InstancesService
+ InstantSnapshots *InstantSnapshotsService
+
InterconnectAttachments *InterconnectAttachmentsService
InterconnectLocations *InterconnectLocationsService
@@ -379,6 +390,8 @@ type Service struct {
RegionInstances *RegionInstancesService
+ RegionInstantSnapshots *RegionInstantSnapshotsService
+
RegionNetworkEndpointGroups *RegionNetworkEndpointGroupsService
RegionNetworkFirewallPolicies *RegionNetworkFirewallPoliciesService
@@ -425,6 +438,10 @@ type Service struct {
SslPolicies *SslPoliciesService
+ StoragePoolTypes *StoragePoolTypesService
+
+ StoragePools *StoragePoolsService
+
Subnetworks *SubnetworksService
TargetGrpcProxies *TargetGrpcProxiesService
@@ -659,6 +676,15 @@ type ImagesService struct {
s *Service
}
+func NewInstanceGroupManagerResizeRequestsService(s *Service) *InstanceGroupManagerResizeRequestsService {
+ rs := &InstanceGroupManagerResizeRequestsService{s: s}
+ return rs
+}
+
+type InstanceGroupManagerResizeRequestsService struct {
+ s *Service
+}
+
func NewInstanceGroupManagersService(s *Service) *InstanceGroupManagersService {
rs := &InstanceGroupManagersService{s: s}
return rs
@@ -677,6 +703,15 @@ type InstanceGroupsService struct {
s *Service
}
+func NewInstanceSettingsService(s *Service) *InstanceSettingsService {
+ rs := &InstanceSettingsService{s: s}
+ return rs
+}
+
+type InstanceSettingsService struct {
+ s *Service
+}
+
func NewInstanceTemplatesService(s *Service) *InstanceTemplatesService {
rs := &InstanceTemplatesService{s: s}
return rs
@@ -695,6 +730,15 @@ type InstancesService struct {
s *Service
}
+func NewInstantSnapshotsService(s *Service) *InstantSnapshotsService {
+ rs := &InstantSnapshotsService{s: s}
+ return rs
+}
+
+type InstantSnapshotsService struct {
+ s *Service
+}
+
func NewInterconnectAttachmentsService(s *Service) *InterconnectAttachmentsService {
rs := &InterconnectAttachmentsService{s: s}
return rs
@@ -974,6 +1018,15 @@ type RegionInstancesService struct {
s *Service
}
+func NewRegionInstantSnapshotsService(s *Service) *RegionInstantSnapshotsService {
+ rs := &RegionInstantSnapshotsService{s: s}
+ return rs
+}
+
+type RegionInstantSnapshotsService struct {
+ s *Service
+}
+
func NewRegionNetworkEndpointGroupsService(s *Service) *RegionNetworkEndpointGroupsService {
rs := &RegionNetworkEndpointGroupsService{s: s}
return rs
@@ -1181,6 +1234,24 @@ type SslPoliciesService struct {
s *Service
}
+func NewStoragePoolTypesService(s *Service) *StoragePoolTypesService {
+ rs := &StoragePoolTypesService{s: s}
+ return rs
+}
+
+type StoragePoolTypesService struct {
+ s *Service
+}
+
+func NewStoragePoolsService(s *Service) *StoragePoolsService {
+ rs := &StoragePoolsService{s: s}
+ return rs
+}
+
+type StoragePoolsService struct {
+ s *Service
+}
+
func NewSubnetworksService(s *Service) *SubnetworksService {
rs := &SubnetworksService{s: s}
return rs
@@ -1308,2389 +1379,1918 @@ type ZonesService struct {
}
// AWSV4Signature: Contains the configurations necessary to generate a
-// signature for access to private storage buckets that support
-// Signature Version 4 for authentication. The service name for
-// generating the authentication header will always default to 's3'.
+// signature for access to private storage buckets that support Signature
+// Version 4 for authentication. The service name for generating the
+// authentication header will always default to 's3'.
type AWSV4Signature struct {
- // AccessKey: The access key used for s3 bucket authentication. Required
- // for updating or creating a backend that uses AWS v4 signature
- // authentication, but will not be returned as part of the configuration
- // when queried with a REST API GET request. @InputOnly
+ // AccessKey: The access key used for s3 bucket authentication. Required for
+ // updating or creating a backend that uses AWS v4 signature authentication,
+ // but will not be returned as part of the configuration when queried with a
+ // REST API GET request. @InputOnly
AccessKey string `json:"accessKey,omitempty"`
-
// AccessKeyId: The identifier of an access key used for s3 bucket
// authentication.
AccessKeyId string `json:"accessKeyId,omitempty"`
-
- // AccessKeyVersion: The optional version identifier for the access key.
- // You can use this to keep track of different iterations of your access
- // key.
+ // AccessKeyVersion: The optional version identifier for the access key. You
+ // can use this to keep track of different iterations of your access key.
AccessKeyVersion string `json:"accessKeyVersion,omitempty"`
-
// OriginRegion: The name of the cloud region of your origin. This is a
- // free-form field with the name of the region your cloud uses to host
- // your origin. For example, "us-east-1" for AWS or "us-ashburn-1" for
- // OCI.
+ // free-form field with the name of the region your cloud uses to host your
+ // origin. For example, "us-east-1" for AWS or "us-ashburn-1" for OCI.
OriginRegion string `json:"originRegion,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "AccessKey") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "AccessKey") 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. "AccessKey") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AWSV4Signature) MarshalJSON() ([]byte, error) {
+func (s AWSV4Signature) MarshalJSON() ([]byte, error) {
type NoMethod AWSV4Signature
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// AcceleratorConfig: A specification of the type and number of
-// accelerator cards attached to the instance.
+// AcceleratorConfig: A specification of the type and number of accelerator
+// cards attached to the instance.
type AcceleratorConfig struct {
- // AcceleratorCount: The number of the guest accelerator cards exposed
- // to this instance.
+ // AcceleratorCount: The number of the guest accelerator cards exposed to this
+ // instance.
AcceleratorCount int64 `json:"acceleratorCount,omitempty"`
-
- // AcceleratorType: Full or partial URL of the accelerator type resource
- // to attach to this instance. For example:
- // projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-
- // p100 If you are creating an instance template, specify only the
- // accelerator name. See GPUs on Compute Engine for a full list of
- // accelerator types.
+ // AcceleratorType: Full or partial URL of the accelerator type resource to
+ // attach to this instance. For example:
+ // projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100
+ // If you are creating an instance template, specify only the accelerator name.
+ // See GPUs on Compute Engine for a full list of accelerator types.
AcceleratorType string `json:"acceleratorType,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "AcceleratorCount") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "AcceleratorCount") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "AcceleratorCount") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AcceleratorConfig) MarshalJSON() ([]byte, error) {
+func (s AcceleratorConfig) MarshalJSON() ([]byte, error) {
type NoMethod AcceleratorConfig
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// AcceleratorType: Represents an Accelerator Type resource. Google
-// Cloud Platform provides graphics processing units (accelerators) that
-// you can add to VM instances to improve or accelerate performance when
-// working with intensive workloads. For more information, read GPUs on
-// Compute Engine.
+// AcceleratorType: Represents an Accelerator Type resource. Google Cloud
+// Platform provides graphics processing units (accelerators) that you can add
+// to VM instances to improve or accelerate performance when working with
+// intensive workloads. For more information, read GPUs on Compute Engine.
type AcceleratorType struct {
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Deprecated -- [Output Only] The deprecation status associated with
- // this accelerator type.
+ // Deprecated -- [Output Only] The deprecation status associated with this
+ // accelerator type.
Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
-
- // Description: [Output Only] An optional textual description of the
- // resource.
+ // Description: [Output Only] An optional textual description of the resource.
Description string `json:"description,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
- // Kind: [Output Only] The type of the resource. Always
- // compute#acceleratorType for accelerator types.
+ // Kind: [Output Only] The type of the resource. Always compute#acceleratorType
+ // for accelerator types.
Kind string `json:"kind,omitempty"`
-
- // MaximumCardsPerInstance: [Output Only] Maximum number of accelerator
- // cards allowed per instance.
+ // MaximumCardsPerInstance: [Output Only] Maximum number of accelerator cards
+ // allowed per instance.
MaximumCardsPerInstance int64 `json:"maximumCardsPerInstance,omitempty"`
-
// Name: [Output Only] Name of the resource.
Name string `json:"name,omitempty"`
-
// SelfLink: [Output Only] Server-defined, fully qualified URL for this
// resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // Zone: [Output Only] The name of the zone where the accelerator type
- // resides, such as us-central1-a. You must specify this field as part
- // of the HTTP request URL. It is not settable as a field in the request
- // body.
+ // Zone: [Output Only] The name of the zone where the accelerator type resides,
+ // such as us-central1-a. You must specify this field as part of the HTTP
+ // request URL. It is not settable as a field in the request body.
Zone string `json:"zone,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "CreationTimestamp") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CreationTimestamp") 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. "CreationTimestamp") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AcceleratorType) MarshalJSON() ([]byte, error) {
+func (s AcceleratorType) MarshalJSON() ([]byte, error) {
type NoMethod AcceleratorType
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type AcceleratorTypeAggregatedList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of AcceleratorTypesScopedList resources.
Items map[string]AcceleratorTypesScopedList `json:"items,omitempty"`
-
// Kind: [Output Only] Type of resource. Always
- // compute#acceleratorTypeAggregatedList for aggregated lists of
- // accelerator types.
+ // compute#acceleratorTypeAggregatedList for aggregated lists of accelerator
+ // types.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Unreachables: [Output Only] Unreachable resources.
Unreachables []string `json:"unreachables,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *AcceleratorTypeAggregatedListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AcceleratorTypeAggregatedList) MarshalJSON() ([]byte, error) {
+func (s AcceleratorTypeAggregatedList) MarshalJSON() ([]byte, error) {
type NoMethod AcceleratorTypeAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// AcceleratorTypeAggregatedListWarning: [Output Only] Informational
-// warning message.
+// AcceleratorTypeAggregatedListWarning: [Output Only] Informational warning
+// message.
type AcceleratorTypeAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*AcceleratorTypeAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AcceleratorTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
+func (s AcceleratorTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod AcceleratorTypeAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type AcceleratorTypeAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AcceleratorTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+func (s AcceleratorTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod AcceleratorTypeAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// AcceleratorTypeList: Contains a list of accelerator types.
type AcceleratorTypeList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of AcceleratorType resources.
Items []*AcceleratorType `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource. Always
- // compute#acceleratorTypeList for lists of accelerator types.
+ // Kind: [Output Only] Type of resource. Always compute#acceleratorTypeList for
+ // lists of accelerator types.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *AcceleratorTypeListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AcceleratorTypeList) MarshalJSON() ([]byte, error) {
+func (s AcceleratorTypeList) MarshalJSON() ([]byte, error) {
type NoMethod AcceleratorTypeList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// AcceleratorTypeListWarning: [Output Only] Informational warning
-// message.
+// AcceleratorTypeListWarning: [Output Only] Informational warning message.
type AcceleratorTypeListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*AcceleratorTypeListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AcceleratorTypeListWarning) MarshalJSON() ([]byte, error) {
+func (s AcceleratorTypeListWarning) MarshalJSON() ([]byte, error) {
type NoMethod AcceleratorTypeListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type AcceleratorTypeListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AcceleratorTypeListWarningData) MarshalJSON() ([]byte, error) {
+func (s AcceleratorTypeListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod AcceleratorTypeListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type AcceleratorTypesScopedList struct {
- // AcceleratorTypes: [Output Only] A list of accelerator types contained
- // in this scope.
+ // AcceleratorTypes: [Output Only] A list of accelerator types contained in
+ // this scope.
AcceleratorTypes []*AcceleratorType `json:"acceleratorTypes,omitempty"`
-
// Warning: [Output Only] An informational warning that appears when the
// accelerator types list is empty.
Warning *AcceleratorTypesScopedListWarning `json:"warning,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "AcceleratorTypes") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "AcceleratorTypes") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "AcceleratorTypes") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AcceleratorTypesScopedList) MarshalJSON() ([]byte, error) {
+func (s AcceleratorTypesScopedList) MarshalJSON() ([]byte, error) {
type NoMethod AcceleratorTypesScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// AcceleratorTypesScopedListWarning: [Output Only] An informational
-// warning that appears when the accelerator types list is empty.
+// AcceleratorTypesScopedListWarning: [Output Only] An informational warning
+// that appears when the accelerator types list is empty.
type AcceleratorTypesScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*AcceleratorTypesScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AcceleratorTypesScopedListWarning) MarshalJSON() ([]byte, error) {
+func (s AcceleratorTypesScopedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod AcceleratorTypesScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type AcceleratorTypesScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AcceleratorTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
+func (s AcceleratorTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod AcceleratorTypesScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// AccessConfig: An access configuration attached to an instance's
-// network interface. Only one access config per instance is supported.
+// AccessConfig: An access configuration attached to an instance's network
+// interface. Only one access config per instance is supported.
type AccessConfig struct {
- // ExternalIpv6: Applies to ipv6AccessConfigs only. The first IPv6
- // address of the external IPv6 range associated with this instance,
- // prefix length is stored in externalIpv6PrefixLength in
- // ipv6AccessConfig. To use a static external IP address, it must be
- // unused and in the same region as the instance's zone. If not
- // specified, Google Cloud will automatically assign an external IPv6
- // address from the instance's subnetwork.
+ // ExternalIpv6: Applies to ipv6AccessConfigs only. The first IPv6 address of
+ // the external IPv6 range associated with this instance, prefix length is
+ // stored in externalIpv6PrefixLength in ipv6AccessConfig. To use a static
+ // external IP address, it must be unused and in the same region as the
+ // instance's zone. If not specified, Google Cloud will automatically assign an
+ // external IPv6 address from the instance's subnetwork.
ExternalIpv6 string `json:"externalIpv6,omitempty"`
-
- // ExternalIpv6PrefixLength: Applies to ipv6AccessConfigs only. The
- // prefix length of the external IPv6 range.
+ // ExternalIpv6PrefixLength: Applies to ipv6AccessConfigs only. The prefix
+ // length of the external IPv6 range.
ExternalIpv6PrefixLength int64 `json:"externalIpv6PrefixLength,omitempty"`
-
- // Kind: [Output Only] Type of the resource. Always compute#accessConfig
- // for access configs.
+ // Kind: [Output Only] Type of the resource. Always compute#accessConfig for
+ // access configs.
Kind string `json:"kind,omitempty"`
-
- // Name: The name of this access configuration. In accessConfigs (IPv4),
- // the default and recommended name is External NAT, but you can use any
- // arbitrary string, such as My external IP or Network Access. In
- // ipv6AccessConfigs, the recommend name is External IPv6.
+ // Name: The name of this access configuration. In accessConfigs (IPv4), the
+ // default and recommended name is External NAT, but you can use any arbitrary
+ // string, such as My external IP or Network Access. In ipv6AccessConfigs, the
+ // recommend name is External IPv6.
Name string `json:"name,omitempty"`
-
// NatIP: Applies to accessConfigs (IPv4) only. An external IP address
- // associated with this instance. Specify an unused static external IP
- // address available to the project or leave this field undefined to use
- // an IP from a shared ephemeral IP address pool. If you specify a
- // static external IP address, it must live in the same region as the
- // zone of the instance.
+ // associated with this instance. Specify an unused static external IP address
+ // available to the project or leave this field undefined to use an IP from a
+ // shared ephemeral IP address pool. If you specify a static external IP
+ // address, it must live in the same region as the zone of the instance.
NatIP string `json:"natIP,omitempty"`
-
- // NetworkTier: This signifies the networking tier used for configuring
- // this access configuration and can only take the following values:
- // PREMIUM, STANDARD. If an AccessConfig is specified without a valid
- // external IP address, an ephemeral IP will be created with this
- // networkTier. If an AccessConfig with a valid external IP address is
- // specified, it must match that of the networkTier associated with the
- // Address resource owning that IP.
+ // NetworkTier: This signifies the networking tier used for configuring this
+ // access configuration and can only take the following values: PREMIUM,
+ // STANDARD. If an AccessConfig is specified without a valid external IP
+ // address, an ephemeral IP will be created with this networkTier. If an
+ // AccessConfig with a valid external IP address is specified, it must match
+ // that of the networkTier associated with the Address resource owning that IP.
//
// Possible values:
// "FIXED_STANDARD" - Public internet quality with fixed bandwidth.
- // "PREMIUM" - High quality, Google-grade network tier, support for
- // all networking products.
- // "STANDARD" - Public internet quality, only limited support for
- // other networking products.
- // "STANDARD_OVERRIDES_FIXED_STANDARD" - (Output only) Temporary tier
- // for FIXED_STANDARD when fixed standard tier is expired or not
- // configured.
+ // "PREMIUM" - High quality, Google-grade network tier, support for all
+ // networking products.
+ // "STANDARD" - Public internet quality, only limited support for other
+ // networking products.
+ // "STANDARD_OVERRIDES_FIXED_STANDARD" - (Output only) Temporary tier for
+ // FIXED_STANDARD when fixed standard tier is expired or not configured.
NetworkTier string `json:"networkTier,omitempty"`
-
- // PublicPtrDomainName: The DNS domain name for the public PTR record.
- // You can set this field only if the `setPublicPtr` field is enabled in
- // accessConfig. If this field is unspecified in ipv6AccessConfig, a
- // default PTR record will be createc for first IP in associated
- // external IPv6 range.
+ // PublicPtrDomainName: The DNS domain name for the public PTR record. You can
+ // set this field only if the `setPublicPtr` field is enabled in accessConfig.
+ // If this field is unspecified in ipv6AccessConfig, a default PTR record will
+ // be created for first IP in associated external IPv6 range.
PublicPtrDomainName string `json:"publicPtrDomainName,omitempty"`
-
- // SecurityPolicy: [Output Only] The resource URL for the security
- // policy associated with this access config.
+ // SecurityPolicy: [Output Only] The resource URL for the security policy
+ // associated with this access config.
SecurityPolicy string `json:"securityPolicy,omitempty"`
-
- // SetPublicPtr: Specifies whether a public DNS 'PTR' record should be
- // created to map the external IP address of the instance to a DNS
- // domain name. This field is not used in ipv6AccessConfig. A default
- // PTR record will be created if the VM has external IPv6 range
- // associated.
+ // SetPublicPtr: Specifies whether a public DNS 'PTR' record should be created
+ // to map the external IP address of the instance to a DNS domain name. This
+ // field is not used in ipv6AccessConfig. A default PTR record will be created
+ // if the VM has external IPv6 range associated.
SetPublicPtr bool `json:"setPublicPtr,omitempty"`
-
- // Type: The type of configuration. In accessConfigs (IPv4), the default
- // and only option is ONE_TO_ONE_NAT. In ipv6AccessConfigs, the default
- // and only option is DIRECT_IPV6.
+ // Type: The type of configuration. In accessConfigs (IPv4), the default and
+ // only option is ONE_TO_ONE_NAT. In ipv6AccessConfigs, the default and only
+ // option is DIRECT_IPV6.
//
// Possible values:
// "DIRECT_IPV6"
// "ONE_TO_ONE_NAT"
Type string `json:"type,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "ExternalIpv6") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "ExternalIpv6") 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. "ExternalIpv6") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AccessConfig) MarshalJSON() ([]byte, error) {
+func (s AccessConfig) MarshalJSON() ([]byte, error) {
type NoMethod AccessConfig
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// Address: Represents an IP Address resource. Google Compute Engine has
-// two IP Address resources: * Global (external and internal)
-// (https://cloud.google.com/compute/docs/reference/rest/v1/globalAddresses)
-// * Regional (external and internal)
-// (https://cloud.google.com/compute/docs/reference/rest/v1/addresses)
-// For more information, see Reserving a static external IP address.
+// Address: Represents an IP Address resource. Google Compute Engine has two IP
+// Address resources: * Global (external and internal)
+// (https://cloud.google.com/compute/docs/reference/rest/v1/globalAddresses) *
+// Regional (external and internal)
+// (https://cloud.google.com/compute/docs/reference/rest/v1/addresses) For more
+// information, see Reserving a static external IP address.
type Address struct {
// Address: The static IP address represented by this resource.
Address string `json:"address,omitempty"`
-
- // AddressType: The type of address to reserve, either INTERNAL or
- // EXTERNAL. If unspecified, defaults to EXTERNAL.
+ // AddressType: The type of address to reserve, either INTERNAL or EXTERNAL. If
+ // unspecified, defaults to EXTERNAL.
//
// Possible values:
// "EXTERNAL" - A publicly visible external IP address.
- // "INTERNAL" - A private network IP address, for use with an Instance
- // or Internal Load Balancer forwarding rule.
+ // "INTERNAL" - A private network IP address, for use with an Instance or
+ // Internal Load Balancer forwarding rule.
// "UNSPECIFIED_TYPE"
AddressType string `json:"addressType,omitempty"`
-
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // field when you create the resource.
+ // Description: An optional description of this resource. Provide this field
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
- // IpVersion: The IP version that will be used by this address. Valid
- // options are IPV4 or IPV6.
+ // IpVersion: The IP version that will be used by this address. Valid options
+ // are IPV4 or IPV6.
//
// Possible values:
// "IPV4"
// "IPV6"
// "UNSPECIFIED_VERSION"
IpVersion string `json:"ipVersion,omitempty"`
-
- // Ipv6EndpointType: The endpoint type of this address, which should be
- // VM or NETLB. This is used for deciding which type of endpoint this
- // address can be used after the external IPv6 address reservation.
+ // Ipv6EndpointType: The endpoint type of this address, which should be VM or
+ // NETLB. This is used for deciding which type of endpoint this address can be
+ // used after the external IPv6 address reservation.
//
// Possible values:
- // "NETLB" - Reserved IPv6 address can be used on network load
- // balancer.
+ // "NETLB" - Reserved IPv6 address can be used on network load balancer.
// "VM" - Reserved IPv6 address can be used on VM.
Ipv6EndpointType string `json:"ipv6EndpointType,omitempty"`
-
// Kind: [Output Only] Type of the resource. Always compute#address for
// addresses.
Kind string `json:"kind,omitempty"`
-
// LabelFingerprint: A fingerprint for the labels being applied to this
- // Address, which is essentially a hash of the labels set used for
- // optimistic locking. The fingerprint is initially generated by Compute
- // Engine and changes after every request to modify or update labels.
- // You must always provide an up-to-date fingerprint hash in order to
- // update or change labels, otherwise the request will fail with error
- // 412 conditionNotMet. To see the latest fingerprint, make a get()
- // request to retrieve an Address.
+ // Address, which is essentially a hash of the labels set used for optimistic
+ // locking. The fingerprint is initially generated by Compute Engine and
+ // changes after every request to modify or update labels. You must always
+ // provide an up-to-date fingerprint hash in order to update or change labels,
+ // otherwise the request will fail with error 412 conditionNotMet. To see the
+ // latest fingerprint, make a get() request to retrieve an Address.
LabelFingerprint string `json:"labelFingerprint,omitempty"`
-
- // Labels: Labels for this resource. These can only be added or modified
- // by the setLabels method. Each label key/value pair must comply with
- // RFC1035. Label values may be empty.
+ // Labels: Labels for this resource. These can only be added or modified by the
+ // setLabels method. Each label key/value pair must comply with RFC1035. Label
+ // values may be empty.
Labels map[string]string `json:"labels,omitempty"`
-
- // Name: Name of the resource. Provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`. The first
- // character must be a lowercase letter, and all following characters
- // (except for the last character) must be a dash, lowercase letter, or
- // digit. The last character must be a lowercase letter or digit.
+ // Name: Name of the resource. Provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?`. The first character must be a
+ // lowercase letter, and all following characters (except for the last
+ // character) must be a dash, lowercase letter, or digit. The last character
+ // must be a lowercase letter or digit.
Name string `json:"name,omitempty"`
-
- // Network: The URL of the network in which to reserve the address. This
- // field can only be used with INTERNAL type with the VPC_PEERING
- // purpose.
+ // Network: The URL of the network in which to reserve the address. This field
+ // can only be used with INTERNAL type with the VPC_PEERING purpose.
Network string `json:"network,omitempty"`
-
- // NetworkTier: This signifies the networking tier used for configuring
- // this address and can only take the following values: PREMIUM or
- // STANDARD. Internal IP addresses are always Premium Tier; global
- // external IP addresses are always Premium Tier; regional external IP
- // addresses can be either Standard or Premium Tier. If this field is
- // not specified, it is assumed to be PREMIUM.
+ // NetworkTier: This signifies the networking tier used for configuring this
+ // address and can only take the following values: PREMIUM or STANDARD.
+ // Internal IP addresses are always Premium Tier; global external IP addresses
+ // are always Premium Tier; regional external IP addresses can be either
+ // Standard or Premium Tier. If this field is not specified, it is assumed to
+ // be PREMIUM.
//
// Possible values:
// "FIXED_STANDARD" - Public internet quality with fixed bandwidth.
- // "PREMIUM" - High quality, Google-grade network tier, support for
- // all networking products.
- // "STANDARD" - Public internet quality, only limited support for
- // other networking products.
- // "STANDARD_OVERRIDES_FIXED_STANDARD" - (Output only) Temporary tier
- // for FIXED_STANDARD when fixed standard tier is expired or not
- // configured.
+ // "PREMIUM" - High quality, Google-grade network tier, support for all
+ // networking products.
+ // "STANDARD" - Public internet quality, only limited support for other
+ // networking products.
+ // "STANDARD_OVERRIDES_FIXED_STANDARD" - (Output only) Temporary tier for
+ // FIXED_STANDARD when fixed standard tier is expired or not configured.
NetworkTier string `json:"networkTier,omitempty"`
-
- // PrefixLength: The prefix length if the resource represents an IP
- // range.
+ // PrefixLength: The prefix length if the resource represents an IP range.
PrefixLength int64 `json:"prefixLength,omitempty"`
-
- // Purpose: The purpose of this resource, which can be one of the
- // following values: - GCE_ENDPOINT for addresses that are used by VM
- // instances, alias IP ranges, load balancers, and similar resources. -
- // DNS_RESOLVER for a DNS resolver address in a subnetwork for a Cloud
- // DNS inbound forwarder IP addresses (regional internal IP address in a
- // subnet of a VPC network) - VPC_PEERING for global internal IP
- // addresses used for private services access allocated ranges. -
- // NAT_AUTO for the regional external IP addresses used by Cloud NAT
- // when allocating addresses using automatic NAT IP address allocation.
- // - IPSEC_INTERCONNECT for addresses created from a private IP range
- // that are reserved for a VLAN attachment in an *HA VPN over Cloud
- // Interconnect* configuration. These addresses are regional resources.
- // - `SHARED_LOADBALANCER_VIP` for an internal IP address that is
- // assigned to multiple internal forwarding rules. -
- // `PRIVATE_SERVICE_CONNECT` for a private network address that is used
- // to configure Private Service Connect. Only global internal addresses
- // can use this purpose.
+ // Purpose: The purpose of this resource, which can be one of the following
+ // values: - GCE_ENDPOINT for addresses that are used by VM instances, alias IP
+ // ranges, load balancers, and similar resources. - DNS_RESOLVER for a DNS
+ // resolver address in a subnetwork for a Cloud DNS inbound forwarder IP
+ // addresses (regional internal IP address in a subnet of a VPC network) -
+ // VPC_PEERING for global internal IP addresses used for private services
+ // access allocated ranges. - NAT_AUTO for the regional external IP addresses
+ // used by Cloud NAT when allocating addresses using automatic NAT IP address
+ // allocation. - IPSEC_INTERCONNECT for addresses created from a private IP
+ // range that are reserved for a VLAN attachment in an *HA VPN over Cloud
+ // Interconnect* configuration. These addresses are regional resources. -
+ // `SHARED_LOADBALANCER_VIP` for an internal IP address that is assigned to
+ // multiple internal forwarding rules. - `PRIVATE_SERVICE_CONNECT` for a
+ // private network address that is used to configure Private Service Connect.
+ // Only global internal addresses can use this purpose.
//
// Possible values:
// "DNS_RESOLVER" - DNS resolver address in the subnetwork.
// "GCE_ENDPOINT" - VM internal/alias IP, Internal LB service IP, etc.
- // "IPSEC_INTERCONNECT" - A regional internal IP address range
- // reserved for the VLAN attachment that is used in HA VPN over Cloud
- // Interconnect. This regional internal IP address range must not
- // overlap with any IP address range of subnet/route in the VPC network
- // and its peering networks. After the VLAN attachment is created with
- // the reserved IP address range, when creating a new VPN gateway, its
- // interface IP address is allocated from the associated VLAN
- // attachment’s IP address range.
+ // "IPSEC_INTERCONNECT" - A regional internal IP address range reserved for
+ // the VLAN attachment that is used in HA VPN over Cloud Interconnect. This
+ // regional internal IP address range must not overlap with any IP address
+ // range of subnet/route in the VPC network and its peering networks. After the
+ // VLAN attachment is created with the reserved IP address range, when creating
+ // a new VPN gateway, its interface IP address is allocated from the associated
+ // VLAN attachment’s IP address range.
// "NAT_AUTO" - External IP automatically reserved for Cloud NAT.
- // "PRIVATE_SERVICE_CONNECT" - A private network IP address that can
- // be used to configure Private Service Connect. This purpose can be
- // specified only for GLOBAL addresses of Type INTERNAL
+ // "PRIVATE_SERVICE_CONNECT" - A private network IP address that can be used
+ // to configure Private Service Connect. This purpose can be specified only for
+ // GLOBAL addresses of Type INTERNAL
// "SERVERLESS" - A regional internal IP address range reserved for
// Serverless.
- // "SHARED_LOADBALANCER_VIP" - A private network IP address that can
- // be shared by multiple Internal Load Balancer forwarding rules.
+ // "SHARED_LOADBALANCER_VIP" - A private network IP address that can be
+ // shared by multiple Internal Load Balancer forwarding rules.
// "VPC_PEERING" - IP range for peer networks.
Purpose string `json:"purpose,omitempty"`
-
// Region: [Output Only] The URL of the region where a regional address
- // resides. For regional addresses, you must specify the region as a
- // path parameter in the HTTP request URL. *This field is not applicable
- // to global addresses.*
+ // resides. For regional addresses, you must specify the region as a path
+ // parameter in the HTTP request URL. *This field is not applicable to global
+ // addresses.*
Region string `json:"region,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Status: [Output Only] The status of the address, which can be one of
- // RESERVING, RESERVED, or IN_USE. An address that is RESERVING is
- // currently in the process of being reserved. A RESERVED address is
- // currently reserved and available to use. An IN_USE address is
- // currently being used by another resource and is not available.
+ // RESERVING, RESERVED, or IN_USE. An address that is RESERVING is currently in
+ // the process of being reserved. A RESERVED address is currently reserved and
+ // available to use. An IN_USE address is currently being used by another
+ // resource and is not available.
//
// Possible values:
- // "IN_USE" - Address is being used by another resource and is not
- // available.
+ // "IN_USE" - Address is being used by another resource and is not available.
// "RESERVED" - Address is reserved and available to use.
// "RESERVING" - Address is being reserved.
Status string `json:"status,omitempty"`
-
- // Subnetwork: The URL of the subnetwork in which to reserve the
- // address. If an IP address is specified, it must be within the
- // subnetwork's IP range. This field can only be used with INTERNAL type
- // with a GCE_ENDPOINT or DNS_RESOLVER purpose.
+ // Subnetwork: The URL of the subnetwork in which to reserve the address. If an
+ // IP address is specified, it must be within the subnetwork's IP range. This
+ // field can only be used with INTERNAL type with a GCE_ENDPOINT or
+ // DNS_RESOLVER purpose.
Subnetwork string `json:"subnetwork,omitempty"`
-
- // Users: [Output Only] The URLs of the resources that are using this
- // address.
+ // Users: [Output Only] The URLs of the resources that are using this address.
Users []string `json:"users,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Address") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Address") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Address") 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. "Address") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *Address) MarshalJSON() ([]byte, error) {
+func (s Address) MarshalJSON() ([]byte, error) {
type NoMethod Address
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type AddressAggregatedList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of AddressesScopedList resources.
Items map[string]AddressesScopedList `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource. Always
- // compute#addressAggregatedList for aggregated lists of addresses.
+ // Kind: [Output Only] Type of resource. Always compute#addressAggregatedList
+ // for aggregated lists of addresses.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Unreachables: [Output Only] Unreachable resources.
Unreachables []string `json:"unreachables,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *AddressAggregatedListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AddressAggregatedList) MarshalJSON() ([]byte, error) {
+func (s AddressAggregatedList) MarshalJSON() ([]byte, error) {
type NoMethod AddressAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// AddressAggregatedListWarning: [Output Only] Informational warning
-// message.
+// AddressAggregatedListWarning: [Output Only] Informational warning message.
type AddressAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*AddressAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AddressAggregatedListWarning) MarshalJSON() ([]byte, error) {
+func (s AddressAggregatedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod AddressAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type AddressAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AddressAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+func (s AddressAggregatedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod AddressAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// AddressList: Contains a list of addresses.
type AddressList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of Address resources.
Items []*Address `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource. Always compute#addressList for
- // lists of addresses.
+ // Kind: [Output Only] Type of resource. Always compute#addressList for lists
+ // of addresses.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *AddressListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AddressList) MarshalJSON() ([]byte, error) {
+func (s AddressList) MarshalJSON() ([]byte, error) {
type NoMethod AddressList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// AddressListWarning: [Output Only] Informational warning message.
type AddressListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*AddressListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AddressListWarning) MarshalJSON() ([]byte, error) {
+func (s AddressListWarning) MarshalJSON() ([]byte, error) {
type NoMethod AddressListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type AddressListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AddressListWarningData) MarshalJSON() ([]byte, error) {
+func (s AddressListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod AddressListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type AddressesScopedList struct {
// Addresses: [Output Only] A list of addresses contained in this scope.
Addresses []*Address `json:"addresses,omitempty"`
-
- // Warning: [Output Only] Informational warning which replaces the list
- // of addresses when the list is empty.
+ // Warning: [Output Only] Informational warning which replaces the list of
+ // addresses when the list is empty.
Warning *AddressesScopedListWarning `json:"warning,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Addresses") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Addresses") 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. "Addresses") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AddressesScopedList) MarshalJSON() ([]byte, error) {
+func (s AddressesScopedList) MarshalJSON() ([]byte, error) {
type NoMethod AddressesScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// AddressesScopedListWarning: [Output Only] Informational warning which
// replaces the list of addresses when the list is empty.
type AddressesScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*AddressesScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AddressesScopedListWarning) MarshalJSON() ([]byte, error) {
+func (s AddressesScopedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod AddressesScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type AddressesScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AddressesScopedListWarningData) MarshalJSON() ([]byte, error) {
+func (s AddressesScopedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod AddressesScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// AdvancedMachineFeatures: Specifies options for controlling advanced
-// machine features. Options that would traditionally be configured in a
-// BIOS belong here. Features that require operating system support may
-// have corresponding entries in the GuestOsFeatures of an Image (e.g.,
-// whether or not the OS in the Image supports nested virtualization
-// being enabled or disabled).
+// AdvancedMachineFeatures: Specifies options for controlling advanced machine
+// features. Options that would traditionally be configured in a BIOS belong
+// here. Features that require operating system support may have corresponding
+// entries in the GuestOsFeatures of an Image (e.g., whether or not the OS in
+// the Image supports nested virtualization being enabled or disabled).
type AdvancedMachineFeatures struct {
- // EnableNestedVirtualization: Whether to enable nested virtualization
- // or not (default is false).
+ // EnableNestedVirtualization: Whether to enable nested virtualization or not
+ // (default is false).
EnableNestedVirtualization bool `json:"enableNestedVirtualization,omitempty"`
-
// EnableUefiNetworking: Whether to enable UEFI networking for instance
// creation.
EnableUefiNetworking bool `json:"enableUefiNetworking,omitempty"`
-
+ // PerformanceMonitoringUnit: Type of Performance Monitoring Unit requested on
+ // instance.
+ //
+ // Possible values:
+ // "ARCHITECTURAL" - Architecturally defined non-LLC events.
+ // "ENHANCED" - Most documented core/L2 and LLC events.
+ // "PERFORMANCE_MONITORING_UNIT_UNSPECIFIED"
+ // "STANDARD" - Most documented core/L2 events.
+ PerformanceMonitoringUnit string `json:"performanceMonitoringUnit,omitempty"`
// ThreadsPerCore: The number of threads per physical core. To disable
- // simultaneous multithreading (SMT) set this to 1. If unset, the
- // maximum number of threads supported per core by the underlying
- // processor is assumed.
+ // simultaneous multithreading (SMT) set this to 1. If unset, the maximum
+ // number of threads supported per core by the underlying processor is assumed.
ThreadsPerCore int64 `json:"threadsPerCore,omitempty"`
-
- // VisibleCoreCount: The number of physical cores to expose to an
- // instance. Multiply by the number of threads per core to compute the
- // total number of virtual CPUs to expose to the instance. If unset, the
- // number of cores is inferred from the instance's nominal CPU count and
- // the underlying platform's SMT width.
+ // TurboMode: Turbo frequency mode to use for the instance. Supported modes
+ // include: * ALL_CORE_MAX Using empty string or not setting this field will
+ // use the platform-specific default turbo mode.
+ TurboMode string `json:"turboMode,omitempty"`
+ // VisibleCoreCount: The number of physical cores to expose to an instance.
+ // Multiply by the number of threads per core to compute the total number of
+ // virtual CPUs to expose to the instance. If unset, the number of cores is
+ // inferred from the instance's nominal CPU count and the underlying platform's
+ // SMT width.
VisibleCoreCount int64 `json:"visibleCoreCount,omitempty"`
-
- // ForceSendFields is a list of field names (e.g.
- // "EnableNestedVirtualization") to unconditionally include in API
- // requests. By default, fields with empty or default 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 is a list of field names (e.g. "EnableNestedVirtualization")
+ // to unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g.
- // "EnableNestedVirtualization") 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. "EnableNestedVirtualization") to
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AdvancedMachineFeatures) MarshalJSON() ([]byte, error) {
+func (s AdvancedMachineFeatures) MarshalJSON() ([]byte, error) {
type NoMethod AdvancedMachineFeatures
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// AliasIpRange: An alias IP range attached to an instance's network
-// interface.
+// AliasIpRange: An alias IP range attached to an instance's network interface.
type AliasIpRange struct {
- // IpCidrRange: The IP alias ranges to allocate for this interface. This
- // IP CIDR range must belong to the specified subnetwork and cannot
- // contain IP addresses reserved by system or used by other network
- // interfaces. This range may be a single IP address (such as 10.2.3.4),
- // a netmask (such as /24) or a CIDR-formatted string (such as
- // 10.1.2.0/24).
+ // IpCidrRange: The IP alias ranges to allocate for this interface. This IP
+ // CIDR range must belong to the specified subnetwork and cannot contain IP
+ // addresses reserved by system or used by other network interfaces. This range
+ // may be a single IP address (such as 10.2.3.4), a netmask (such as /24) or a
+ // CIDR-formatted string (such as 10.1.2.0/24).
IpCidrRange string `json:"ipCidrRange,omitempty"`
-
- // SubnetworkRangeName: The name of a subnetwork secondary IP range from
- // which to allocate an IP alias range. If not specified, the primary
- // range of the subnetwork is used.
+ // SubnetworkRangeName: The name of a subnetwork secondary IP range from which
+ // to allocate an IP alias range. If not specified, the primary range of the
+ // subnetwork is used.
SubnetworkRangeName string `json:"subnetworkRangeName,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "IpCidrRange") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "IpCidrRange") 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. "IpCidrRange") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AliasIpRange) MarshalJSON() ([]byte, error) {
+func (s AliasIpRange) MarshalJSON() ([]byte, error) {
type NoMethod AliasIpRange
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// AllocationAggregateReservation: This reservation type is specified by
-// total resource amounts (e.g. total count of CPUs) and can account for
-// multiple instance SKUs. In other words, one can create instances of
-// varying shapes against this reservation.
+// AllocationAggregateReservation: This reservation type is specified by total
+// resource amounts (e.g. total count of CPUs) and can account for multiple
+// instance SKUs. In other words, one can create instances of varying shapes
+// against this reservation.
type AllocationAggregateReservation struct {
// InUseResources: [Output only] List of resources currently in use.
InUseResources []*AllocationAggregateReservationReservedResourceInfo `json:"inUseResources,omitempty"`
-
- // ReservedResources: List of reserved resources (CPUs, memory,
- // accelerators).
+ // ReservedResources: List of reserved resources (CPUs, memory, accelerators).
ReservedResources []*AllocationAggregateReservationReservedResourceInfo `json:"reservedResources,omitempty"`
-
// VmFamily: The VM family that all instances scheduled against this
// reservation must belong to.
//
// Possible values:
+ // "VM_FAMILY_CLOUD_TPU_DEVICE_CT3"
// "VM_FAMILY_CLOUD_TPU_LITE_DEVICE_CT5L"
// "VM_FAMILY_CLOUD_TPU_LITE_POD_SLICE_CT5LP"
+ // "VM_FAMILY_CLOUD_TPU_POD_SLICE_CT3P"
// "VM_FAMILY_CLOUD_TPU_POD_SLICE_CT4P"
VmFamily string `json:"vmFamily,omitempty"`
-
- // WorkloadType: The workload type of the instances that will target
- // this reservation.
+ // WorkloadType: The workload type of the instances that will target this
+ // reservation.
//
// Possible values:
- // "BATCH" - Reserved resources will be optimized for BATCH workloads,
- // such as ML training.
- // "SERVING" - Reserved resources will be optimized for SERVING
- // workloads, such as ML inference.
+ // "BATCH" - Reserved resources will be optimized for BATCH workloads, such
+ // as ML training.
+ // "SERVING" - Reserved resources will be optimized for SERVING workloads,
+ // such as ML inference.
// "UNSPECIFIED"
WorkloadType string `json:"workloadType,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "InUseResources") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "InUseResources") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "InUseResources") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AllocationAggregateReservation) MarshalJSON() ([]byte, error) {
+func (s AllocationAggregateReservation) MarshalJSON() ([]byte, error) {
type NoMethod AllocationAggregateReservation
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type AllocationAggregateReservationReservedResourceInfo struct {
// Accelerator: Properties of accelerator resources in this reservation.
Accelerator *AllocationAggregateReservationReservedResourceInfoAccelerator `json:"accelerator,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Accelerator") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Accelerator") 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. "Accelerator") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AllocationAggregateReservationReservedResourceInfo) MarshalJSON() ([]byte, error) {
+func (s AllocationAggregateReservationReservedResourceInfo) MarshalJSON() ([]byte, error) {
type NoMethod AllocationAggregateReservationReservedResourceInfo
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type AllocationAggregateReservationReservedResourceInfoAccelerator struct {
// AcceleratorCount: Number of accelerators of specified type.
AcceleratorCount int64 `json:"acceleratorCount,omitempty"`
-
// AcceleratorType: Full or partial URL to accelerator type. e.g.
// "projects/{PROJECT}/zones/{ZONE}/acceleratorTypes/ct4l"
AcceleratorType string `json:"acceleratorType,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "AcceleratorCount") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "AcceleratorCount") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "AcceleratorCount") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AllocationAggregateReservationReservedResourceInfoAccelerator) MarshalJSON() ([]byte, error) {
+func (s AllocationAggregateReservationReservedResourceInfoAccelerator) MarshalJSON() ([]byte, error) {
type NoMethod AllocationAggregateReservationReservedResourceInfoAccelerator
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// AllocationResourceStatus: [Output Only] Contains output only fields.
type AllocationResourceStatus struct {
// SpecificSkuAllocation: Allocation Properties of this reservation.
SpecificSkuAllocation *AllocationResourceStatusSpecificSKUAllocation `json:"specificSkuAllocation,omitempty"`
-
- // ForceSendFields is a list of field names (e.g.
- // "SpecificSkuAllocation") to unconditionally include in API requests.
- // By default, fields with empty or default 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 is a list of field names (e.g. "SpecificSkuAllocation") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "SpecificSkuAllocation") 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.
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AllocationResourceStatus) MarshalJSON() ([]byte, error) {
+func (s AllocationResourceStatus) MarshalJSON() ([]byte, error) {
type NoMethod AllocationResourceStatus
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// AllocationResourceStatusSpecificSKUAllocation: Contains Properties
-// set for the reservation.
+// AllocationResourceStatusSpecificSKUAllocation: Contains Properties set for
+// the reservation.
type AllocationResourceStatusSpecificSKUAllocation struct {
- // SourceInstanceTemplateId: ID of the instance template used to
- // populate reservation properties.
+ // SourceInstanceTemplateId: ID of the instance template used to populate
+ // reservation properties.
SourceInstanceTemplateId string `json:"sourceInstanceTemplateId,omitempty"`
-
- // ForceSendFields is a list of field names (e.g.
- // "SourceInstanceTemplateId") to unconditionally include in API
- // requests. By default, fields with empty or default 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. "SourceInstanceTemplateId")
- // 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.
+ // ForceSendFields is a list of field names (e.g. "SourceInstanceTemplateId")
+ // to unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "SourceInstanceTemplateId") to
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AllocationResourceStatusSpecificSKUAllocation) MarshalJSON() ([]byte, error) {
+func (s AllocationResourceStatusSpecificSKUAllocation) MarshalJSON() ([]byte, error) {
type NoMethod AllocationResourceStatusSpecificSKUAllocation
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk struct {
// DiskSizeGb: Specifies the size of the disk in base-2 GB.
DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
-
- // Interface: Specifies the disk interface to use for attaching this
- // disk, which is either SCSI or NVME. The default is SCSI. For
- // performance characteristics of SCSI over NVMe, see Local SSD
- // performance.
+ // Interface: Specifies the disk interface to use for attaching this disk,
+ // which is either SCSI or NVME. The default is SCSI. For performance
+ // characteristics of SCSI over NVMe, see Local SSD performance.
//
// Possible values:
// "NVME"
// "SCSI"
Interface string `json:"interface,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "DiskSizeGb") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "DiskSizeGb") 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. "DiskSizeGb") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk) MarshalJSON() ([]byte, error) {
+func (s AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk) MarshalJSON() ([]byte, error) {
type NoMethod AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// AllocationSpecificSKUAllocationReservedInstanceProperties: Properties
-// of the SKU instances being reserved. Next ID: 9
+// AllocationSpecificSKUAllocationReservedInstanceProperties: Properties of the
+// SKU instances being reserved. Next ID: 9
type AllocationSpecificSKUAllocationReservedInstanceProperties struct {
// GuestAccelerators: Specifies accelerator type and count.
GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
-
- // LocalSsds: Specifies amount of local ssd to reserve with each
- // instance. The type of disk is local-ssd.
+ // LocalSsds: Specifies amount of local ssd to reserve with each instance. The
+ // type of disk is local-ssd.
LocalSsds []*AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk `json:"localSsds,omitempty"`
-
- // LocationHint: An opaque location hint used to place the allocation
- // close to other resources. This field is for use by internal tools
- // that use the public API.
+ // LocationHint: An opaque location hint used to place the allocation close to
+ // other resources. This field is for use by internal tools that use the public
+ // API.
LocationHint string `json:"locationHint,omitempty"`
-
- // MachineType: Specifies type of machine (name only) which has fixed
- // number of vCPUs and fixed amount of memory. This also includes
- // specifying custom machine type following
- // custom-NUMBER_OF_CPUS-AMOUNT_OF_MEMORY pattern.
+ // MachineType: Specifies type of machine (name only) which has fixed number of
+ // vCPUs and fixed amount of memory. This also includes specifying custom
+ // machine type following custom-NUMBER_OF_CPUS-AMOUNT_OF_MEMORY pattern.
MachineType string `json:"machineType,omitempty"`
-
// MinCpuPlatform: Minimum cpu platform the reservation.
MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "GuestAccelerators")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "GuestAccelerators") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "GuestAccelerators") 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. "GuestAccelerators") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AllocationSpecificSKUAllocationReservedInstanceProperties) MarshalJSON() ([]byte, error) {
+func (s AllocationSpecificSKUAllocationReservedInstanceProperties) MarshalJSON() ([]byte, error) {
type NoMethod AllocationSpecificSKUAllocationReservedInstanceProperties
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// AllocationSpecificSKUReservation: This reservation type allows to pre
-// allocate specific instance configuration. Next ID: 6
+// allocate specific instance configuration.
type AllocationSpecificSKUReservation struct {
- // AssuredCount: [Output Only] Indicates how many instances are actually
- // usable currently.
+ // AssuredCount: [Output Only] Indicates how many instances are actually usable
+ // currently.
AssuredCount int64 `json:"assuredCount,omitempty,string"`
-
// Count: Specifies the number of resources that are allocated.
Count int64 `json:"count,omitempty,string"`
-
// InUseCount: [Output Only] Indicates how many instances are in use.
InUseCount int64 `json:"inUseCount,omitempty,string"`
-
// InstanceProperties: The instance properties for the reservation.
InstanceProperties *AllocationSpecificSKUAllocationReservedInstanceProperties `json:"instanceProperties,omitempty"`
-
// SourceInstanceTemplate: Specifies the instance template to create the
- // reservation. If you use this field, you must exclude the
- // instanceProperties field. This field is optional, and it can be a
- // full or partial URL. For example, the following are all valid URLs to
- // an instance template: -
+ // reservation. If you use this field, you must exclude the instanceProperties
+ // field. This field is optional, and it can be a full or partial URL. For
+ // example, the following are all valid URLs to an instance template: -
// https://www.googleapis.com/compute/v1/projects/project
// /global/instanceTemplates/instanceTemplate -
// projects/project/global/instanceTemplates/instanceTemplate -
// global/instanceTemplates/instanceTemplate
SourceInstanceTemplate string `json:"sourceInstanceTemplate,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "AssuredCount") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "AssuredCount") 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. "AssuredCount") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AllocationSpecificSKUReservation) MarshalJSON() ([]byte, error) {
+func (s AllocationSpecificSKUReservation) MarshalJSON() ([]byte, error) {
type NoMethod AllocationSpecificSKUReservation
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// AttachedDisk: An instance-attached disk resource.
type AttachedDisk struct {
- // Architecture: [Output Only] The architecture of the attached disk.
- // Valid values are ARM64 or X86_64.
+ // Architecture: [Output Only] The architecture of the attached disk. Valid
+ // values are ARM64 or X86_64.
//
// Possible values:
- // "ARCHITECTURE_UNSPECIFIED" - Default value indicating Architecture
- // is not set.
+ // "ARCHITECTURE_UNSPECIFIED" - Default value indicating Architecture is not
+ // set.
// "ARM64" - Machines with architecture ARM64
// "X86_64" - Machines with architecture X86_64
Architecture string `json:"architecture,omitempty"`
-
// AutoDelete: Specifies whether the disk will be auto-deleted when the
- // instance is deleted (but not when the disk is detached from the
- // instance).
+ // instance is deleted (but not when the disk is detached from the instance).
AutoDelete bool `json:"autoDelete,omitempty"`
-
- // Boot: Indicates that this is a boot disk. The virtual machine will
- // use the first partition of the disk for its root filesystem.
+ // Boot: Indicates that this is a boot disk. The virtual machine will use the
+ // first partition of the disk for its root filesystem.
Boot bool `json:"boot,omitempty"`
-
- // DeviceName: Specifies a unique device name of your choice that is
- // reflected into the /dev/disk/by-id/google-* tree of a Linux operating
- // system running within the instance. This name can be used to
- // reference the device for mounting, resizing, and so on, from within
- // the instance. If not specified, the server chooses a default device
- // name to apply to this disk, in the form persistent-disk-x, where x is
- // a number assigned by Google Compute Engine. This field is only
- // applicable for persistent disks.
+ // DeviceName: Specifies a unique device name of your choice that is reflected
+ // into the /dev/disk/by-id/google-* tree of a Linux operating system running
+ // within the instance. This name can be used to reference the device for
+ // mounting, resizing, and so on, from within the instance. If not specified,
+ // the server chooses a default device name to apply to this disk, in the form
+ // persistent-disk-x, where x is a number assigned by Google Compute Engine.
+ // This field is only applicable for persistent disks.
DeviceName string `json:"deviceName,omitempty"`
-
- // DiskEncryptionKey: Encrypts or decrypts a disk using a
- // customer-supplied encryption key. If you are creating a new disk,
- // this field encrypts the new disk using an encryption key that you
- // provide. If you are attaching an existing disk that is already
- // encrypted, this field decrypts the disk using the customer-supplied
- // encryption key. If you encrypt a disk using a customer-supplied key,
- // you must provide the same key again when you attempt to use this
- // resource at a later time. For example, you must provide the key when
- // you create a snapshot or an image from the disk or when you attach
- // the disk to a virtual machine instance. If you do not provide an
- // encryption key, then the disk will be encrypted using an
- // automatically generated key and you do not need to provide a key to
- // use the disk later. Instance templates do not store customer-supplied
- // encryption keys, so you cannot use your own keys to encrypt disks in
- // a managed instance group.
+ // DiskEncryptionKey: Encrypts or decrypts a disk using a customer-supplied
+ // encryption key. If you are creating a new disk, this field encrypts the new
+ // disk using an encryption key that you provide. If you are attaching an
+ // existing disk that is already encrypted, this field decrypts the disk using
+ // the customer-supplied encryption key. If you encrypt a disk using a
+ // customer-supplied key, you must provide the same key again when you attempt
+ // to use this resource at a later time. For example, you must provide the key
+ // when you create a snapshot or an image from the disk or when you attach the
+ // disk to a virtual machine instance. If you do not provide an encryption key,
+ // then the disk will be encrypted using an automatically generated key and you
+ // do not need to provide a key to use the disk later. Note: Instance templates
+ // do not store customer-supplied encryption keys, so you cannot use your own
+ // keys to encrypt disks in a managed instance group. You cannot create VMs
+ // that have disks with customer-supplied keys using the bulk insert method.
DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
-
// DiskSizeGb: The size of the disk in GB.
DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
-
- // ForceAttach: [Input Only] Whether to force attach the regional disk
- // even if it's currently attached to another instance. If you try to
- // force attach a zonal disk to an instance, you will receive an error.
+ // ForceAttach: [Input Only] Whether to force attach the regional disk even if
+ // it's currently attached to another instance. If you try to force attach a
+ // zonal disk to an instance, you will receive an error.
ForceAttach bool `json:"forceAttach,omitempty"`
-
- // GuestOsFeatures: A list of features to enable on the guest operating
- // system. Applicable only for bootable images. Read Enabling guest
- // operating system features to see a list of available options.
+ // GuestOsFeatures: A list of features to enable on the guest operating system.
+ // Applicable only for bootable images. Read Enabling guest operating system
+ // features to see a list of available options.
GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
-
- // Index: [Output Only] A zero-based index to this disk, where 0 is
- // reserved for the boot disk. If you have many disks attached to an
- // instance, each disk would have a unique index number.
+ // Index: [Output Only] A zero-based index to this disk, where 0 is reserved
+ // for the boot disk. If you have many disks attached to an instance, each disk
+ // would have a unique index number.
Index int64 `json:"index,omitempty"`
-
- // InitializeParams: [Input Only] Specifies the parameters for a new
- // disk that will be created alongside the new instance. Use
- // initialization parameters to create boot disks or local SSDs attached
- // to the new instance. This property is mutually exclusive with the
- // source property; you can only define one or the other, but not both.
+ // InitializeParams: [Input Only] Specifies the parameters for a new disk that
+ // will be created alongside the new instance. Use initialization parameters to
+ // create boot disks or local SSDs attached to the new instance. This property
+ // is mutually exclusive with the source property; you can only define one or
+ // the other, but not both.
InitializeParams *AttachedDiskInitializeParams `json:"initializeParams,omitempty"`
-
- // Interface: Specifies the disk interface to use for attaching this
- // disk, which is either SCSI or NVME. For most machine types, the
- // default is SCSI. Local SSDs can use either NVME or SCSI. In certain
- // configurations, persistent disks can use NVMe. For more information,
- // see About persistent disks.
+ // Interface: Specifies the disk interface to use for attaching this disk,
+ // which is either SCSI or NVME. For most machine types, the default is SCSI.
+ // Local SSDs can use either NVME or SCSI. In certain configurations,
+ // persistent disks can use NVMe. For more information, see About persistent
+ // disks.
//
// Possible values:
// "NVME"
// "SCSI"
Interface string `json:"interface,omitempty"`
-
- // Kind: [Output Only] Type of the resource. Always compute#attachedDisk
- // for attached disks.
+ // Kind: [Output Only] Type of the resource. Always compute#attachedDisk for
+ // attached disks.
Kind string `json:"kind,omitempty"`
-
// Licenses: [Output Only] Any valid publicly visible licenses.
Licenses []string `json:"licenses,omitempty"`
-
- // Mode: The mode in which to attach this disk, either READ_WRITE or
- // READ_ONLY. If not specified, the default is to attach the disk in
- // READ_WRITE mode.
+ // Mode: The mode in which to attach this disk, either READ_WRITE or READ_ONLY.
+ // If not specified, the default is to attach the disk in READ_WRITE mode.
//
// Possible values:
- // "READ_ONLY" - Attaches this disk in read-only mode. Multiple
- // virtual machines can use a disk in read-only mode at a time.
- // "READ_WRITE" - *[Default]* Attaches this disk in read-write mode.
- // Only one virtual machine at a time can be attached to a disk in
- // read-write mode.
+ // "READ_ONLY" - Attaches this disk in read-only mode. Multiple virtual
+ // machines can use a disk in read-only mode at a time.
+ // "READ_WRITE" - *[Default]* Attaches this disk in read-write mode. Only one
+ // virtual machine at a time can be attached to a disk in read-write mode.
Mode string `json:"mode,omitempty"`
-
- // SavedState: For LocalSSD disks on VM Instances in STOPPED or
- // SUSPENDED state, this field is set to PRESERVED if the LocalSSD data
- // has been saved to a persistent location by customer request. (see the
- // discard_local_ssd option on Stop/Suspend). Read-only in the api.
+ // SavedState: For LocalSSD disks on VM Instances in STOPPED or SUSPENDED
+ // state, this field is set to PRESERVED if the LocalSSD data has been saved to
+ // a persistent location by customer request. (see the discard_local_ssd option
+ // on Stop/Suspend). Read-only in the api.
//
// Possible values:
- // "DISK_SAVED_STATE_UNSPECIFIED" - *[Default]* Disk state has not
- // been preserved.
+ // "DISK_SAVED_STATE_UNSPECIFIED" - *[Default]* Disk state has not been
+ // preserved.
// "PRESERVED" - Disk state has been preserved.
SavedState string `json:"savedState,omitempty"`
-
- // ShieldedInstanceInitialState: [Output Only] shielded vm initial state
- // stored on disk
+ // ShieldedInstanceInitialState: [Output Only] shielded vm initial state stored
+ // on disk
ShieldedInstanceInitialState *InitialStateConfig `json:"shieldedInstanceInitialState,omitempty"`
-
- // Source: Specifies a valid partial or full URL to an existing
- // Persistent Disk resource. When creating a new instance, one of
+ // Source: Specifies a valid partial or full URL to an existing Persistent Disk
+ // resource. When creating a new instance boot disk, one of
// initializeParams.sourceImage or initializeParams.sourceSnapshot or
- // disks.source is required except for local SSD. If desired, you can
- // also attach existing non-root persistent disks using this property.
- // This field is only applicable for persistent disks. Note that for
- // InstanceTemplate, specify the disk name for zonal disk, and the URL
- // for regional disk.
+ // disks.source is required. If desired, you can also attach existing non-root
+ // persistent disks using this property. This field is only applicable for
+ // persistent disks. Note that for InstanceTemplate, specify the disk name for
+ // zonal disk, and the URL for regional disk.
Source string `json:"source,omitempty"`
-
- // Type: Specifies the type of the disk, either SCRATCH or PERSISTENT.
- // If not specified, the default is PERSISTENT.
+ // Type: Specifies the type of the disk, either SCRATCH or PERSISTENT. If not
+ // specified, the default is PERSISTENT.
//
// Possible values:
// "PERSISTENT"
// "SCRATCH"
Type string `json:"type,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Architecture") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Architecture") 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. "Architecture") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AttachedDisk) MarshalJSON() ([]byte, error) {
+func (s AttachedDisk) MarshalJSON() ([]byte, error) {
type NoMethod AttachedDisk
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// AttachedDiskInitializeParams: [Input Only] Specifies the parameters
-// for a new disk that will be created alongside the new instance. Use
-// initialization parameters to create boot disks or local SSDs attached
-// to the new instance. This field is persisted and returned for
-// instanceTemplate and not returned in the context of instance. This
-// property is mutually exclusive with the source property; you can only
-// define one or the other, but not both.
+// AttachedDiskInitializeParams: [Input Only] Specifies the parameters for a
+// new disk that will be created alongside the new instance. Use initialization
+// parameters to create boot disks or local SSDs attached to the new instance.
+// This field is persisted and returned for instanceTemplate and not returned
+// in the context of instance. This property is mutually exclusive with the
+// source property; you can only define one or the other, but not both.
type AttachedDiskInitializeParams struct {
- // Architecture: The architecture of the attached disk. Valid values are
- // arm64 or x86_64.
+ // Architecture: The architecture of the attached disk. Valid values are arm64
+ // or x86_64.
//
// Possible values:
- // "ARCHITECTURE_UNSPECIFIED" - Default value indicating Architecture
- // is not set.
+ // "ARCHITECTURE_UNSPECIFIED" - Default value indicating Architecture is not
+ // set.
// "ARM64" - Machines with architecture ARM64
// "X86_64" - Machines with architecture X86_64
Architecture string `json:"architecture,omitempty"`
-
- // Description: An optional description. Provide this property when
- // creating the disk.
+ // Description: An optional description. Provide this property when creating
+ // the disk.
Description string `json:"description,omitempty"`
-
- // DiskName: Specifies the disk name. If not specified, the default is
- // to use the name of the instance. If a disk with the same name already
- // exists in the given region, the existing disk is attached to the new
- // instance and the new disk is not created.
+ // DiskName: Specifies the disk name. If not specified, the default is to use
+ // the name of the instance. If a disk with the same name already exists in the
+ // given region, the existing disk is attached to the new instance and the new
+ // disk is not created.
DiskName string `json:"diskName,omitempty"`
-
- // DiskSizeGb: Specifies the size of the disk in base-2 GB. The size
- // must be at least 10 GB. If you specify a sourceImage, which is
- // required for boot disks, the default size is the size of the
- // sourceImage. If you do not specify a sourceImage, the default disk
- // size is 500 GB.
+ // DiskSizeGb: Specifies the size of the disk in base-2 GB. The size must be at
+ // least 10 GB. If you specify a sourceImage, which is required for boot disks,
+ // the default size is the size of the sourceImage. If you do not specify a
+ // sourceImage, the default disk size is 500 GB.
DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
-
- // DiskType: Specifies the disk type to use to create the instance. If
- // not specified, the default is pd-standard, specified using the full
- // URL. For example:
- // https://www.googleapis.com/compute/v1/projects/project/zones/zone
- // /diskTypes/pd-standard For a full list of acceptable values, see
- // Persistent disk types. If you specify this field when creating a VM,
- // you can provide either the full or partial URL. For example, the
- // following values are valid: -
- // https://www.googleapis.com/compute/v1/projects/project/zones/zone
- // /diskTypes/diskType - projects/project/zones/zone/diskTypes/diskType
- // - zones/zone/diskTypes/diskType If you specify this field when
- // creating or updating an instance template or all-instances
- // configuration, specify the type of the disk, not the URL. For
- // example: pd-standard.
+ // DiskType: Specifies the disk type to use to create the instance. If not
+ // specified, the default is pd-standard, specified using the full URL. For
+ // example: https://www.googleapis.com/compute/v1/projects/project/zones/zone
+ // /diskTypes/pd-standard For a full list of acceptable values, see Persistent
+ // disk types. If you specify this field when creating a VM, you can provide
+ // either the full or partial URL. For example, the following values are valid:
+ // - https://www.googleapis.com/compute/v1/projects/project/zones/zone
+ // /diskTypes/diskType - projects/project/zones/zone/diskTypes/diskType -
+ // zones/zone/diskTypes/diskType If you specify this field when creating or
+ // updating an instance template or all-instances configuration, specify the
+ // type of the disk, not the URL. For example: pd-standard.
DiskType string `json:"diskType,omitempty"`
-
- // EnableConfidentialCompute: Whether this disk is using confidential
- // compute mode.
+ // EnableConfidentialCompute: Whether this disk is using confidential compute
+ // mode.
EnableConfidentialCompute bool `json:"enableConfidentialCompute,omitempty"`
-
- // Labels: Labels to apply to this disk. These can be later modified by
- // the disks.setLabels method. This field is only applicable for
- // persistent disks.
+ // Labels: Labels to apply to this disk. These can be later modified by the
+ // disks.setLabels method. This field is only applicable for persistent disks.
Labels map[string]string `json:"labels,omitempty"`
-
- // Licenses: A list of publicly visible licenses. Reserved for Google's
- // use.
+ // Licenses: A list of publicly visible licenses. Reserved for Google's use.
Licenses []string `json:"licenses,omitempty"`
-
- // OnUpdateAction: Specifies which action to take on instance update
- // with this disk. Default is to use the existing disk.
+ // OnUpdateAction: Specifies which action to take on instance update with this
+ // disk. Default is to use the existing disk.
//
// Possible values:
// "RECREATE_DISK" - Always recreate the disk.
- // "RECREATE_DISK_IF_SOURCE_CHANGED" - Recreate the disk if source
- // (image, snapshot) of this disk is different from source of existing
- // disk.
+ // "RECREATE_DISK_IF_SOURCE_CHANGED" - Recreate the disk if source (image,
+ // snapshot) of this disk is different from source of existing disk.
// "USE_EXISTING_DISK" - Use the existing disk, this is the default
// behaviour.
OnUpdateAction string `json:"onUpdateAction,omitempty"`
-
- // ProvisionedIops: Indicates how many IOPS to provision for the disk.
- // This sets the number of I/O operations per second that the disk can
- // handle. Values must be between 10,000 and 120,000. For more details,
- // see the Extreme persistent disk documentation.
+ // ProvisionedIops: Indicates how many IOPS to provision for the disk. This
+ // sets the number of I/O operations per second that the disk can handle.
+ // Values must be between 10,000 and 120,000. For more details, see the Extreme
+ // persistent disk documentation.
ProvisionedIops int64 `json:"provisionedIops,omitempty,string"`
-
- // ProvisionedThroughput: Indicates how much throughput to provision for
- // the disk. This sets the number of throughput mb per second that the
- // disk can handle. Values must be between 1 and 7,124.
+ // ProvisionedThroughput: Indicates how much throughput to provision for the
+ // disk. This sets the number of throughput mb per second that the disk can
+ // handle. Values must greater than or equal to 1.
ProvisionedThroughput int64 `json:"provisionedThroughput,omitempty,string"`
-
- // ReplicaZones: Required for each regional disk associated with the
- // instance. Specify the URLs of the zones where the disk should be
- // replicated to. You must provide exactly two replica zones, and one
- // zone must be the same as the instance zone.
+ // ReplicaZones: Required for each regional disk associated with the instance.
+ // Specify the URLs of the zones where the disk should be replicated to. You
+ // must provide exactly two replica zones, and one zone must be the same as the
+ // instance zone.
ReplicaZones []string `json:"replicaZones,omitempty"`
-
- // ResourceManagerTags: Resource manager tags to be bound to the disk.
- // Tag keys and values have the same definition as resource manager
- // tags. Keys must be in the format `tagKeys/{tag_key_id}`, and values
- // are in the format `tagValues/456`. The field is ignored (both PUT &
- // PATCH) when empty.
+ // ResourceManagerTags: Resource manager tags to be bound to the disk. Tag keys
+ // and values have the same definition as resource manager tags. Keys must be
+ // in the format `tagKeys/{tag_key_id}`, and values are in the format
+ // `tagValues/456`. The field is ignored (both PUT & PATCH) when empty.
ResourceManagerTags map[string]string `json:"resourceManagerTags,omitempty"`
-
- // ResourcePolicies: Resource policies applied to this disk for
- // automatic snapshot creations. Specified using the full or partial
- // URL. For instance template, specify only the resource policy name.
+ // ResourcePolicies: Resource policies applied to this disk for automatic
+ // snapshot creations. Specified using the full or partial URL. For instance
+ // template, specify only the resource policy name.
ResourcePolicies []string `json:"resourcePolicies,omitempty"`
-
- // SourceImage: The source image to create this disk. When creating a
- // new instance, one of initializeParams.sourceImage or
- // initializeParams.sourceSnapshot or disks.source is required except
- // for local SSD. To create a disk with one of the public operating
- // system images, specify the image by its family name. For example,
- // specify family/debian-9 to use the latest Debian 9 image:
- // projects/debian-cloud/global/images/family/debian-9 Alternatively,
- // use a specific version of a public operating system image:
- // projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD To
- // create a disk with a custom image that you created, specify the image
- // name in the following format: global/images/my-custom-image You can
- // also specify a custom image by its image family, which returns the
- // latest version of the image in that family. Replace the image name
- // with family/family-name: global/images/family/my-image-family If the
- // source image is deleted later, this field will not be set.
+ // SourceImage: The source image to create this disk. When creating a new
+ // instance boot disk, one of initializeParams.sourceImage or
+ // initializeParams.sourceSnapshot or disks.source is required. To create a
+ // disk with one of the public operating system images, specify the image by
+ // its family name. For example, specify family/debian-9 to use the latest
+ // Debian 9 image: projects/debian-cloud/global/images/family/debian-9
+ // Alternatively, use a specific version of a public operating system image:
+ // projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD To create a
+ // disk with a custom image that you created, specify the image name in the
+ // following format: global/images/my-custom-image You can also specify a
+ // custom image by its image family, which returns the latest version of the
+ // image in that family. Replace the image name with family/family-name:
+ // global/images/family/my-image-family If the source image is deleted later,
+ // this field will not be set.
SourceImage string `json:"sourceImage,omitempty"`
-
- // SourceImageEncryptionKey: The customer-supplied encryption key of the
- // source image. Required if the source image is protected by a
- // customer-supplied encryption key. InstanceTemplate and
- // InstancePropertiesPatch do not store customer-supplied encryption
- // keys, so you cannot create disks for instances in a managed instance
- // group if the source images are encrypted with your own keys.
+ // SourceImageEncryptionKey: The customer-supplied encryption key of the source
+ // image. Required if the source image is protected by a customer-supplied
+ // encryption key. InstanceTemplate and InstancePropertiesPatch do not store
+ // customer-supplied encryption keys, so you cannot create disks for instances
+ // in a managed instance group if the source images are encrypted with your own
+ // keys.
SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"`
-
- // SourceSnapshot: The source snapshot to create this disk. When
- // creating a new instance, one of initializeParams.sourceSnapshot or
- // initializeParams.sourceImage or disks.source is required except for
- // local SSD. To create a disk with a snapshot that you created, specify
- // the snapshot name in the following format: global/snapshots/my-backup
- // If the source snapshot is deleted later, this field will not be set.
+ // SourceSnapshot: The source snapshot to create this disk. When creating a new
+ // instance boot disk, one of initializeParams.sourceSnapshot or
+ // initializeParams.sourceImage or disks.source is required. To create a disk
+ // with a snapshot that you created, specify the snapshot name in the following
+ // format: global/snapshots/my-backup If the source snapshot is deleted later,
+ // this field will not be set.
SourceSnapshot string `json:"sourceSnapshot,omitempty"`
-
- // SourceSnapshotEncryptionKey: The customer-supplied encryption key of
- // the source snapshot.
+ // SourceSnapshotEncryptionKey: The customer-supplied encryption key of the
+ // source snapshot.
SourceSnapshotEncryptionKey *CustomerEncryptionKey `json:"sourceSnapshotEncryptionKey,omitempty"`
-
+ // StoragePool: The storage pool in which the new disk is created. You can
+ // provide this as a partial or full URL to the resource. For example, the
+ // following are valid values: -
+ // https://www.googleapis.com/compute/v1/projects/project/zones/zone
+ // /storagePools/storagePool -
+ // projects/project/zones/zone/storagePools/storagePool -
+ // zones/zone/storagePools/storagePool
+ StoragePool string `json:"storagePool,omitempty"`
// ForceSendFields is a list of field names (e.g. "Architecture") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Architecture") 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. "Architecture") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AttachedDiskInitializeParams) MarshalJSON() ([]byte, error) {
+func (s AttachedDiskInitializeParams) MarshalJSON() ([]byte, error) {
type NoMethod AttachedDiskInitializeParams
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// AuditConfig: Specifies the audit configuration for a service. The
// configuration determines which permission types are logged, and what
-// identities, if any, are exempted from logging. An AuditConfig must
-// have one or more AuditLogConfigs. If there are AuditConfigs for both
-// `allServices` and a specific service, the union of the two
-// AuditConfigs is used for that service: the log_types specified in
-// each AuditConfig are enabled, and the exempted_members in each
-// AuditLogConfig are exempted. Example Policy with multiple
-// AuditConfigs: { "audit_configs": [ { "service": "allServices",
-// "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members":
-// [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" }, {
-// "log_type": "ADMIN_READ" } ] }, { "service":
-// "sampleservice.googleapis.com", "audit_log_configs": [ { "log_type":
-// "DATA_READ" }, { "log_type": "DATA_WRITE", "exempted_members": [
-// "user:aliya@example.com" ] } ] } ] } For sampleservice, this policy
-// enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts
-// jose@example.com from DATA_READ logging, and aliya@example.com from
-// DATA_WRITE logging.
+// identities, if any, are exempted from logging. An AuditConfig must have one
+// or more AuditLogConfigs. If there are AuditConfigs for both `allServices`
+// and a specific service, the union of the two AuditConfigs is used for that
+// service: the log_types specified in each AuditConfig are enabled, and the
+// exempted_members in each AuditLogConfig are exempted. Example Policy with
+// multiple AuditConfigs: { "audit_configs": [ { "service": "allServices",
+// "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [
+// "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" }, { "log_type":
+// "ADMIN_READ" } ] }, { "service": "sampleservice.googleapis.com",
+// "audit_log_configs": [ { "log_type": "DATA_READ" }, { "log_type":
+// "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] } ] } ] } For
+// sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ
+// logging. It also exempts `jose@example.com` from DATA_READ logging, and
+// `aliya@example.com` from DATA_WRITE logging.
type AuditConfig struct {
- // AuditLogConfigs: The configuration for logging of each type of
- // permission.
+ // AuditLogConfigs: The configuration for logging of each type of permission.
AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
-
- // ExemptedMembers: This is deprecated and has no effect. Do not use.
- ExemptedMembers []string `json:"exemptedMembers,omitempty"`
-
- // Service: Specifies a service that will be enabled for audit logging.
- // For example, `storage.googleapis.com`, `cloudsql.googleapis.com`.
- // `allServices` is a special value that covers all services.
+ // Service: Specifies a service that will be enabled for audit logging. For
+ // example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices`
+ // is a special value that covers all services.
Service string `json:"service,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "AuditLogConfigs") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "AuditLogConfigs") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AuditConfig) MarshalJSON() ([]byte, error) {
+func (s AuditConfig) MarshalJSON() ([]byte, error) {
type NoMethod AuditConfig
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// AuditLogConfig: Provides the configuration for logging a type of
-// permissions. Example: { "audit_log_configs": [ { "log_type":
-// "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, {
-// "log_type": "DATA_WRITE" } ] } This enables 'DATA_READ' and
-// 'DATA_WRITE' logging, while exempting jose@example.com from DATA_READ
-// logging.
+// permissions. Example: { "audit_log_configs": [ { "log_type": "DATA_READ",
+// "exempted_members": [ "user:jose@example.com" ] }, { "log_type":
+// "DATA_WRITE" } ] } This enables 'DATA_READ' and 'DATA_WRITE' logging, while
+// exempting jose@example.com from DATA_READ logging.
type AuditLogConfig struct {
- // ExemptedMembers: Specifies the identities that do not cause logging
- // for this type of permission. Follows the same format of
- // Binding.members.
+ // ExemptedMembers: Specifies the identities that do not cause logging for this
+ // type of permission. Follows the same format of Binding.members.
ExemptedMembers []string `json:"exemptedMembers,omitempty"`
-
- // IgnoreChildExemptions: This is deprecated and has no effect. Do not
- // use.
- IgnoreChildExemptions bool `json:"ignoreChildExemptions,omitempty"`
-
// LogType: The log type that this config enables.
//
// Possible values:
@@ -3699,1003 +3299,781 @@ type AuditLogConfig struct {
// "DATA_WRITE" - Data writes. Example: CloudSQL Users create
// "LOG_TYPE_UNSPECIFIED" - Default case. Should never be this.
LogType string `json:"logType,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "ExemptedMembers") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "ExemptedMembers") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "ExemptedMembers") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
+func (s AuditLogConfig) MarshalJSON() ([]byte, error) {
type NoMethod AuditLogConfig
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// AuthorizationLoggingOptions: This is deprecated and has no effect. Do
-// not use.
-type AuthorizationLoggingOptions struct {
- // PermissionType: This is deprecated and has no effect. Do not use.
- //
- // Possible values:
- // "ADMIN_READ" - This is deprecated and has no effect. Do not use.
- // "ADMIN_WRITE" - This is deprecated and has no effect. Do not use.
- // "DATA_READ" - This is deprecated and has no effect. Do not use.
- // "DATA_WRITE" - This is deprecated and has no effect. Do not use.
- // "PERMISSION_TYPE_UNSPECIFIED" - This is deprecated and has no
- // effect. Do not use.
- PermissionType string `json:"permissionType,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "PermissionType") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "PermissionType") 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 *AuthorizationLoggingOptions) MarshalJSON() ([]byte, error) {
- type NoMethod AuthorizationLoggingOptions
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// Autoscaler: Represents an Autoscaler resource. Google Compute Engine
-// has two Autoscaler resources: * Zonal
-// (/compute/docs/reference/rest/v1/autoscalers) * Regional
-// (/compute/docs/reference/rest/v1/regionAutoscalers) Use autoscalers
-// to automatically add or delete instances from a managed instance
-// group according to your defined autoscaling policy. For more
-// information, read Autoscaling Groups of Instances. For zonal managed
-// instance groups resource, use the autoscaler resource. For regional
-// managed instance groups, use the regionAutoscalers resource.
+// Autoscaler: Represents an Autoscaler resource. Google Compute Engine has two
+// Autoscaler resources: * Zonal (/compute/docs/reference/rest/v1/autoscalers)
+// * Regional (/compute/docs/reference/rest/v1/regionAutoscalers) Use
+// autoscalers to automatically add or delete instances from a managed instance
+// group according to your defined autoscaling policy. For more information,
+// read Autoscaling Groups of Instances. For zonal managed instance groups
+// resource, use the autoscaler resource. For regional managed instance groups,
+// use the regionAutoscalers resource.
type Autoscaler struct {
// AutoscalingPolicy: The configuration parameters for the autoscaling
// algorithm. You can define one or more signals for an autoscaler:
- // cpuUtilization, customMetricUtilizations, and
- // loadBalancingUtilization. If none of these are specified, the default
- // will be to autoscale based on cpuUtilization to 0.6 or 60%.
+ // cpuUtilization, customMetricUtilizations, and loadBalancingUtilization. If
+ // none of these are specified, the default will be to autoscale based on
+ // cpuUtilization to 0.6 or 60%.
AutoscalingPolicy *AutoscalingPolicy `json:"autoscalingPolicy,omitempty"`
-
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
- // Kind: [Output Only] Type of the resource. Always compute#autoscaler
- // for autoscalers.
+ // Kind: [Output Only] Type of the resource. Always compute#autoscaler for
+ // autoscalers.
Kind string `json:"kind,omitempty"`
-
- // Name: Name of the resource. Provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
- // the first character must be a lowercase letter, and all following
- // characters must be a dash, lowercase letter, or digit, except the
- // last character, which cannot be a dash.
+ // Name: Name of the resource. Provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must
+ // be a lowercase letter, and all following characters must be a dash,
+ // lowercase letter, or digit, except the last character, which cannot be a
+ // dash.
Name string `json:"name,omitempty"`
-
// RecommendedSize: [Output Only] Target recommended MIG size (number of
- // instances) computed by autoscaler. Autoscaler calculates the
- // recommended MIG size even when the autoscaling policy mode is
- // different from ON. This field is empty when autoscaler is not
- // connected to an existing managed instance group or autoscaler did not
- // generate its prediction.
+ // instances) computed by autoscaler. Autoscaler calculates the recommended MIG
+ // size even when the autoscaling policy mode is different from ON. This field
+ // is empty when autoscaler is not connected to an existing managed instance
+ // group or autoscaler did not generate its prediction.
RecommendedSize int64 `json:"recommendedSize,omitempty"`
-
- // Region: [Output Only] URL of the region where the instance group
- // resides (for autoscalers living in regional scope).
+ // Region: [Output Only] URL of the region where the instance group resides
+ // (for autoscalers living in regional scope).
Region string `json:"region,omitempty"`
-
- // ScalingScheduleStatus: [Output Only] Status information of existing
- // scaling schedules.
+ // ScalingScheduleStatus: [Output Only] Status information of existing scaling
+ // schedules.
ScalingScheduleStatus map[string]ScalingScheduleStatus `json:"scalingScheduleStatus,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // Status: [Output Only] The status of the autoscaler configuration.
- // Current set of possible values: - PENDING: Autoscaler backend hasn't
- // read new/updated configuration. - DELETING: Configuration is being
- // deleted. - ACTIVE: Configuration is acknowledged to be effective.
- // Some warnings might be present in the statusDetails field. - ERROR:
- // Configuration has errors. Actionable for users. Details are present
- // in the statusDetails field. New values might be added in the future.
+ // Status: [Output Only] The status of the autoscaler configuration. Current
+ // set of possible values: - PENDING: Autoscaler backend hasn't read
+ // new/updated configuration. - DELETING: Configuration is being deleted. -
+ // ACTIVE: Configuration is acknowledged to be effective. Some warnings might
+ // be present in the statusDetails field. - ERROR: Configuration has errors.
+ // Actionable for users. Details are present in the statusDetails field. New
+ // values might be added in the future.
//
// Possible values:
// "ACTIVE" - Configuration is acknowledged to be effective
// "DELETING" - Configuration is being deleted
// "ERROR" - Configuration has errors. Actionable for users.
- // "PENDING" - Autoscaler backend hasn't read new/updated
- // configuration
+ // "PENDING" - Autoscaler backend hasn't read new/updated configuration
Status string `json:"status,omitempty"`
-
- // StatusDetails: [Output Only] Human-readable details about the current
- // state of the autoscaler. Read the documentation for Commonly returned
- // status messages for examples of status messages you might encounter.
+ // StatusDetails: [Output Only] Human-readable details about the current state
+ // of the autoscaler. Read the documentation for Commonly returned status
+ // messages for examples of status messages you might encounter.
StatusDetails []*AutoscalerStatusDetails `json:"statusDetails,omitempty"`
-
- // Target: URL of the managed instance group that this autoscaler will
- // scale. This field is required when creating an autoscaler.
+ // Target: URL of the managed instance group that this autoscaler will scale.
+ // This field is required when creating an autoscaler.
Target string `json:"target,omitempty"`
-
- // Zone: [Output Only] URL of the zone where the instance group resides
- // (for autoscalers living in zonal scope).
+ // Zone: [Output Only] URL of the zone where the instance group resides (for
+ // autoscalers living in zonal scope).
Zone string `json:"zone,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "AutoscalingPolicy")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "AutoscalingPolicy") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "AutoscalingPolicy") 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. "AutoscalingPolicy") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *Autoscaler) MarshalJSON() ([]byte, error) {
+func (s Autoscaler) MarshalJSON() ([]byte, error) {
type NoMethod Autoscaler
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type AutoscalerAggregatedList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of AutoscalersScopedList resources.
Items map[string]AutoscalersScopedList `json:"items,omitempty"`
-
// Kind: [Output Only] Type of resource. Always
// compute#autoscalerAggregatedList for aggregated lists of autoscalers.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Unreachables: [Output Only] Unreachable resources. end_interface:
// MixerListResponseWithEtagBuilder
Unreachables []string `json:"unreachables,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *AutoscalerAggregatedListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AutoscalerAggregatedList) MarshalJSON() ([]byte, error) {
+func (s AutoscalerAggregatedList) MarshalJSON() ([]byte, error) {
type NoMethod AutoscalerAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// AutoscalerAggregatedListWarning: [Output Only] Informational warning
// message.
type AutoscalerAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*AutoscalerAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AutoscalerAggregatedListWarning) MarshalJSON() ([]byte, error) {
+func (s AutoscalerAggregatedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod AutoscalerAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type AutoscalerAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AutoscalerAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+func (s AutoscalerAggregatedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod AutoscalerAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// AutoscalerList: Contains a list of Autoscaler resources.
type AutoscalerList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of Autoscaler resources.
Items []*Autoscaler `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource. Always compute#autoscalerList
- // for lists of autoscalers.
+ // Kind: [Output Only] Type of resource. Always compute#autoscalerList for
+ // lists of autoscalers.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *AutoscalerListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AutoscalerList) MarshalJSON() ([]byte, error) {
+func (s AutoscalerList) MarshalJSON() ([]byte, error) {
type NoMethod AutoscalerList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// AutoscalerListWarning: [Output Only] Informational warning message.
type AutoscalerListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*AutoscalerListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AutoscalerListWarning) MarshalJSON() ([]byte, error) {
+func (s AutoscalerListWarning) MarshalJSON() ([]byte, error) {
type NoMethod AutoscalerListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type AutoscalerListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AutoscalerListWarningData) MarshalJSON() ([]byte, error) {
+func (s AutoscalerListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod AutoscalerListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type AutoscalerStatusDetails struct {
// Message: The status message.
Message string `json:"message,omitempty"`
-
// Type: The type of error, warning, or notice returned. Current set of
- // possible values: - ALL_INSTANCES_UNHEALTHY (WARNING): All instances
- // in the instance group are unhealthy (not in RUNNING state). -
- // BACKEND_SERVICE_DOES_NOT_EXIST (ERROR): There is no backend service
- // attached to the instance group. - CAPPED_AT_MAX_NUM_REPLICAS
- // (WARNING): Autoscaler recommends a size greater than maxNumReplicas.
- // - CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE (WARNING): The custom metric
- // samples are not exported often enough to be a credible base for
- // autoscaling. - CUSTOM_METRIC_INVALID (ERROR): The custom metric that
- // was specified does not exist or does not have the necessary labels. -
- // MIN_EQUALS_MAX (WARNING): The minNumReplicas is equal to
- // maxNumReplicas. This means the autoscaler cannot add or remove
- // instances from the instance group. -
- // MISSING_CUSTOM_METRIC_DATA_POINTS (WARNING): The autoscaler did not
- // receive any data from the custom metric configured for autoscaling. -
- // MISSING_LOAD_BALANCING_DATA_POINTS (WARNING): The autoscaler is
- // configured to scale based on a load balancing signal but the instance
- // group has not received any requests from the load balancer. -
- // MODE_OFF (WARNING): Autoscaling is turned off. The number of
- // instances in the group won't change automatically. The autoscaling
- // configuration is preserved. - MODE_ONLY_UP (WARNING): Autoscaling is
- // in the "Autoscale only out" mode. The autoscaler can add instances
- // but not remove any. - MORE_THAN_ONE_BACKEND_SERVICE (ERROR): The
- // instance group cannot be autoscaled because it has more than one
- // backend service attached to it. - NOT_ENOUGH_QUOTA_AVAILABLE (ERROR):
- // There is insufficient quota for the necessary resources, such as CPU
- // or number of instances. - REGION_RESOURCE_STOCKOUT (ERROR): Shown
- // only for regional autoscalers: there is a resource stockout in the
- // chosen region. - SCALING_TARGET_DOES_NOT_EXIST (ERROR): The target to
- // be scaled does not exist. -
- // UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION (ERROR):
+ // possible values: - ALL_INSTANCES_UNHEALTHY (WARNING): All instances in the
+ // instance group are unhealthy (not in RUNNING state). -
+ // BACKEND_SERVICE_DOES_NOT_EXIST (ERROR): There is no backend service attached
+ // to the instance group. - CAPPED_AT_MAX_NUM_REPLICAS (WARNING): Autoscaler
+ // recommends a size greater than maxNumReplicas. -
+ // CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE (WARNING): The custom metric samples
+ // are not exported often enough to be a credible base for autoscaling. -
+ // CUSTOM_METRIC_INVALID (ERROR): The custom metric that was specified does not
+ // exist or does not have the necessary labels. - MIN_EQUALS_MAX (WARNING): The
+ // minNumReplicas is equal to maxNumReplicas. This means the autoscaler cannot
+ // add or remove instances from the instance group. -
+ // MISSING_CUSTOM_METRIC_DATA_POINTS (WARNING): The autoscaler did not receive
+ // any data from the custom metric configured for autoscaling. -
+ // MISSING_LOAD_BALANCING_DATA_POINTS (WARNING): The autoscaler is configured
+ // to scale based on a load balancing signal but the instance group has not
+ // received any requests from the load balancer. - MODE_OFF (WARNING):
+ // Autoscaling is turned off. The number of instances in the group won't change
+ // automatically. The autoscaling configuration is preserved. - MODE_ONLY_UP
+ // (WARNING): Autoscaling is in the "Autoscale only out" mode. The autoscaler
+ // can add instances but not remove any. - MORE_THAN_ONE_BACKEND_SERVICE
+ // (ERROR): The instance group cannot be autoscaled because it has more than
+ // one backend service attached to it. - NOT_ENOUGH_QUOTA_AVAILABLE (ERROR):
+ // There is insufficient quota for the necessary resources, such as CPU or
+ // number of instances. - REGION_RESOURCE_STOCKOUT (ERROR): Shown only for
+ // regional autoscalers: there is a resource stockout in the chosen region. -
+ // SCALING_TARGET_DOES_NOT_EXIST (ERROR): The target to be scaled does not
+ // exist. - UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION (ERROR):
// Autoscaling does not work with an HTTP/S load balancer that has been
// configured for maxRate. - ZONE_RESOURCE_STOCKOUT (ERROR): For zonal
- // autoscalers: there is a resource stockout in the chosen zone. For
- // regional autoscalers: in at least one of the zones you're using there
- // is a resource stockout. New values might be added in the future. Some
- // of the values might not be available in all API versions.
+ // autoscalers: there is a resource stockout in the chosen zone. For regional
+ // autoscalers: in at least one of the zones you're using there is a resource
+ // stockout. New values might be added in the future. Some of the values might
+ // not be available in all API versions.
//
// Possible values:
// "ALL_INSTANCES_UNHEALTHY" - All instances in the instance group are
// unhealthy (not in RUNNING state).
- // "BACKEND_SERVICE_DOES_NOT_EXIST" - There is no backend service
- // attached to the instance group.
- // "CAPPED_AT_MAX_NUM_REPLICAS" - Autoscaler recommends a size greater
- // than maxNumReplicas.
- // "CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE" - The custom metric samples
- // are not exported often enough to be a credible base for autoscaling.
- // "CUSTOM_METRIC_INVALID" - The custom metric that was specified does
- // not exist or does not have the necessary labels.
- // "MIN_EQUALS_MAX" - The minNumReplicas is equal to maxNumReplicas.
- // This means the autoscaler cannot add or remove instances from the
- // instance group.
- // "MISSING_CUSTOM_METRIC_DATA_POINTS" - The autoscaler did not
- // receive any data from the custom metric configured for autoscaling.
- // "MISSING_LOAD_BALANCING_DATA_POINTS" - The autoscaler is configured
- // to scale based on a load balancing signal but the instance group has
- // not received any requests from the load balancer.
- // "MODE_OFF" - Autoscaling is turned off. The number of instances in
- // the group won't change automatically. The autoscaling configuration
- // is preserved.
- // "MODE_ONLY_SCALE_OUT" - Autoscaling is in the "Autoscale only scale
- // out" mode. Instances in the group will be only added.
+ // "BACKEND_SERVICE_DOES_NOT_EXIST" - There is no backend service attached to
+ // the instance group.
+ // "CAPPED_AT_MAX_NUM_REPLICAS" - Autoscaler recommends a size greater than
+ // maxNumReplicas.
+ // "CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE" - The custom metric samples are not
+ // exported often enough to be a credible base for autoscaling.
+ // "CUSTOM_METRIC_INVALID" - The custom metric that was specified does not
+ // exist or does not have the necessary labels.
+ // "MIN_EQUALS_MAX" - The minNumReplicas is equal to maxNumReplicas. This
+ // means the autoscaler cannot add or remove instances from the instance group.
+ // "MISSING_CUSTOM_METRIC_DATA_POINTS" - The autoscaler did not receive any
+ // data from the custom metric configured for autoscaling.
+ // "MISSING_LOAD_BALANCING_DATA_POINTS" - The autoscaler is configured to
+ // scale based on a load balancing signal but the instance group has not
+ // received any requests from the load balancer.
+ // "MODE_OFF" - Autoscaling is turned off. The number of instances in the
+ // group won't change automatically. The autoscaling configuration is
+ // preserved.
+ // "MODE_ONLY_SCALE_OUT" - Autoscaling is in the "Autoscale only scale out"
+ // mode. Instances in the group will be only added.
// "MODE_ONLY_UP" - Autoscaling is in the "Autoscale only out" mode.
// Instances in the group will be only added.
- // "MORE_THAN_ONE_BACKEND_SERVICE" - The instance group cannot be
- // autoscaled because it has more than one backend service attached to
- // it.
+ // "MORE_THAN_ONE_BACKEND_SERVICE" - The instance group cannot be autoscaled
+ // because it has more than one backend service attached to it.
// "NOT_ENOUGH_QUOTA_AVAILABLE" - There is insufficient quota for the
// necessary resources, such as CPU or number of instances.
- // "REGION_RESOURCE_STOCKOUT" - Showed only for regional autoscalers:
- // there is a resource stockout in the chosen region.
- // "SCALING_TARGET_DOES_NOT_EXIST" - The target to be scaled does not
- // exist.
- // "SCHEDULED_INSTANCES_GREATER_THAN_AUTOSCALER_MAX" - For some
- // scaling schedules minRequiredReplicas is greater than maxNumReplicas.
- // Autoscaler always recommends at most maxNumReplicas instances.
+ // "REGION_RESOURCE_STOCKOUT" - Showed only for regional autoscalers: there
+ // is a resource stockout in the chosen region.
+ // "SCALING_TARGET_DOES_NOT_EXIST" - The target to be scaled does not exist.
+ // "SCHEDULED_INSTANCES_GREATER_THAN_AUTOSCALER_MAX" - For some scaling
+ // schedules minRequiredReplicas is greater than maxNumReplicas. Autoscaler
+ // always recommends at most maxNumReplicas instances.
// "SCHEDULED_INSTANCES_LESS_THAN_AUTOSCALER_MIN" - For some scaling
- // schedules minRequiredReplicas is less than minNumReplicas. Autoscaler
- // always recommends at least minNumReplicas instances.
+ // schedules minRequiredReplicas is less than minNumReplicas. Autoscaler always
+ // recommends at least minNumReplicas instances.
// "UNKNOWN"
- // "UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION" - Autoscaling
- // does not work with an HTTP/S load balancer that has been configured
- // for maxRate.
- // "ZONE_RESOURCE_STOCKOUT" - For zonal autoscalers: there is a
- // resource stockout in the chosen zone. For regional autoscalers: in at
- // least one of the zones you're using there is a resource stockout.
+ // "UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION" - Autoscaling does not
+ // work with an HTTP/S load balancer that has been configured for maxRate.
+ // "ZONE_RESOURCE_STOCKOUT" - For zonal autoscalers: there is a resource
+ // stockout in the chosen zone. For regional autoscalers: in at least one of
+ // the zones you're using there is a resource stockout.
Type string `json:"type,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Message") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Message") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Message") 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. "Message") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AutoscalerStatusDetails) MarshalJSON() ([]byte, error) {
+func (s AutoscalerStatusDetails) MarshalJSON() ([]byte, error) {
type NoMethod AutoscalerStatusDetails
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type AutoscalersScopedList struct {
- // Autoscalers: [Output Only] A list of autoscalers contained in this
- // scope.
+ // Autoscalers: [Output Only] A list of autoscalers contained in this scope.
Autoscalers []*Autoscaler `json:"autoscalers,omitempty"`
-
- // Warning: [Output Only] Informational warning which replaces the list
- // of autoscalers when the list is empty.
+ // Warning: [Output Only] Informational warning which replaces the list of
+ // autoscalers when the list is empty.
Warning *AutoscalersScopedListWarning `json:"warning,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Autoscalers") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Autoscalers") 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. "Autoscalers") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AutoscalersScopedList) MarshalJSON() ([]byte, error) {
+func (s AutoscalersScopedList) MarshalJSON() ([]byte, error) {
type NoMethod AutoscalersScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// AutoscalersScopedListWarning: [Output Only] Informational warning
-// which replaces the list of autoscalers when the list is empty.
+// AutoscalersScopedListWarning: [Output Only] Informational warning which
+// replaces the list of autoscalers when the list is empty.
type AutoscalersScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*AutoscalersScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AutoscalersScopedListWarning) MarshalJSON() ([]byte, error) {
+func (s AutoscalersScopedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod AutoscalersScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type AutoscalersScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AutoscalersScopedListWarningData) MarshalJSON() ([]byte, error) {
+func (s AutoscalersScopedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod AutoscalersScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// AutoscalingPolicy: Cloud Autoscaler policy.
type AutoscalingPolicy struct {
- // CoolDownPeriodSec: The number of seconds that your application takes
- // to initialize on a VM instance. This is referred to as the
- // initialization period (/compute/docs/autoscaler#cool_down_period).
- // Specifying an accurate initialization period improves autoscaler
- // decisions. For example, when scaling out, the autoscaler ignores data
- // from VMs that are still initializing because those VMs might not yet
- // represent normal usage of your application. The default
- // initialization period is 60 seconds. Initialization periods might
- // vary because of numerous factors. We recommend that you test how long
- // your application takes to initialize. To do this, create a VM and
+ // CoolDownPeriodSec: The number of seconds that your application takes to
+ // initialize on a VM instance. This is referred to as the initialization
+ // period (/compute/docs/autoscaler#cool_down_period). Specifying an accurate
+ // initialization period improves autoscaler decisions. For example, when
+ // scaling out, the autoscaler ignores data from VMs that are still
+ // initializing because those VMs might not yet represent normal usage of your
+ // application. The default initialization period is 60 seconds. Initialization
+ // periods might vary because of numerous factors. We recommend that you test
+ // how long your application takes to initialize. To do this, create a VM and
// time your application's startup process.
CoolDownPeriodSec int64 `json:"coolDownPeriodSec,omitempty"`
-
// CpuUtilization: Defines the CPU utilization policy that allows the
// autoscaler to scale based on the average CPU utilization of a managed
// instance group.
CpuUtilization *AutoscalingPolicyCpuUtilization `json:"cpuUtilization,omitempty"`
-
- // CustomMetricUtilizations: Configuration parameters of autoscaling
- // based on a custom metric.
+ // CustomMetricUtilizations: Configuration parameters of autoscaling based on a
+ // custom metric.
CustomMetricUtilizations []*AutoscalingPolicyCustomMetricUtilization `json:"customMetricUtilizations,omitempty"`
-
- // LoadBalancingUtilization: Configuration parameters of autoscaling
- // based on load balancer.
+ // LoadBalancingUtilization: Configuration parameters of autoscaling based on
+ // load balancer.
LoadBalancingUtilization *AutoscalingPolicyLoadBalancingUtilization `json:"loadBalancingUtilization,omitempty"`
-
- // MaxNumReplicas: The maximum number of instances that the autoscaler
- // can scale out to. This is required when creating or updating an
- // autoscaler. The maximum number of replicas must not be lower than
- // minimal number of replicas.
+ // MaxNumReplicas: The maximum number of instances that the autoscaler can
+ // scale out to. This is required when creating or updating an autoscaler. The
+ // maximum number of replicas must not be lower than minimal number of
+ // replicas.
MaxNumReplicas int64 `json:"maxNumReplicas,omitempty"`
-
- // MinNumReplicas: The minimum number of replicas that the autoscaler
- // can scale in to. This cannot be less than 0. If not provided,
- // autoscaler chooses a default value depending on maximum number of
- // instances allowed.
+ // MinNumReplicas: The minimum number of replicas that the autoscaler can scale
+ // in to. This cannot be less than 0. If not provided, autoscaler chooses a
+ // default value depending on maximum number of instances allowed.
MinNumReplicas int64 `json:"minNumReplicas,omitempty"`
-
- // Mode: Defines the operating mode for this policy. The following modes
- // are available: - OFF: Disables the autoscaler but maintains its
- // configuration. - ONLY_SCALE_OUT: Restricts the autoscaler to add VM
- // instances only. - ON: Enables all autoscaler activities according to
- // its policy. For more information, see "Turning off or restricting an
- // autoscaler"
+ // Mode: Defines the operating mode for this policy. The following modes are
+ // available: - OFF: Disables the autoscaler but maintains its configuration. -
+ // ONLY_SCALE_OUT: Restricts the autoscaler to add VM instances only. - ON:
+ // Enables all autoscaler activities according to its policy. For more
+ // information, see "Turning off or restricting an autoscaler"
//
// Possible values:
- // "OFF" - Do not automatically scale the MIG in or out. The
- // recommended_size field contains the size of MIG that would be set if
- // the actuation mode was enabled.
- // "ON" - Automatically scale the MIG in and out according to the
- // policy.
- // "ONLY_SCALE_OUT" - Automatically create VMs according to the
- // policy, but do not scale the MIG in.
- // "ONLY_UP" - Automatically create VMs according to the policy, but
+ // "OFF" - Do not automatically scale the MIG in or out. The recommended_size
+ // field contains the size of MIG that would be set if the actuation mode was
+ // enabled.
+ // "ON" - Automatically scale the MIG in and out according to the policy.
+ // "ONLY_SCALE_OUT" - Automatically create VMs according to the policy, but
// do not scale the MIG in.
- Mode string `json:"mode,omitempty"`
-
+ // "ONLY_UP" - Automatically create VMs according to the policy, but do not
+ // scale the MIG in.
+ Mode string `json:"mode,omitempty"`
ScaleInControl *AutoscalingPolicyScaleInControl `json:"scaleInControl,omitempty"`
-
- // ScalingSchedules: Scaling schedules defined for an autoscaler.
- // Multiple schedules can be set on an autoscaler, and they can overlap.
- // During overlapping periods the greatest min_required_replicas of all
- // scaling schedules is applied. Up to 128 scaling schedules are
- // allowed.
+ // ScalingSchedules: Scaling schedules defined for an autoscaler. Multiple
+ // schedules can be set on an autoscaler, and they can overlap. During
+ // overlapping periods the greatest min_required_replicas of all scaling
+ // schedules is applied. Up to 128 scaling schedules are allowed.
ScalingSchedules map[string]AutoscalingPolicyScalingSchedule `json:"scalingSchedules,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "CoolDownPeriodSec")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "CoolDownPeriodSec") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CoolDownPeriodSec") 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. "CoolDownPeriodSec") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AutoscalingPolicy) MarshalJSON() ([]byte, error) {
+func (s AutoscalingPolicy) MarshalJSON() ([]byte, error) {
type NoMethod AutoscalingPolicy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// AutoscalingPolicyCpuUtilization: CPU utilization policy.
type AutoscalingPolicyCpuUtilization struct {
- // PredictiveMethod: Indicates whether predictive autoscaling based on
- // CPU metric is enabled. Valid values are: * NONE (default). No
- // predictive method is used. The autoscaler scales the group to meet
- // current demand based on real-time metrics. * OPTIMIZE_AVAILABILITY.
- // Predictive autoscaling improves availability by monitoring daily and
- // weekly load patterns and scaling out ahead of anticipated demand.
- //
- // Possible values:
- // "NONE" - No predictive method is used. The autoscaler scales the
- // group to meet current demand based on real-time metrics
- // "OPTIMIZE_AVAILABILITY" - Predictive autoscaling improves
- // availability by monitoring daily and weekly load patterns and scaling
- // out ahead of anticipated demand.
+ // PredictiveMethod: Indicates whether predictive autoscaling based on CPU
+ // metric is enabled. Valid values are: * NONE (default). No predictive method
+ // is used. The autoscaler scales the group to meet current demand based on
+ // real-time metrics. * OPTIMIZE_AVAILABILITY. Predictive autoscaling improves
+ // availability by monitoring daily and weekly load patterns and scaling out
+ // ahead of anticipated demand.
+ //
+ // Possible values:
+ // "NONE" - No predictive method is used. The autoscaler scales the group to
+ // meet current demand based on real-time metrics
+ // "OPTIMIZE_AVAILABILITY" - Predictive autoscaling improves availability by
+ // monitoring daily and weekly load patterns and scaling out ahead of
+ // anticipated demand.
PredictiveMethod string `json:"predictiveMethod,omitempty"`
-
- // UtilizationTarget: The target CPU utilization that the autoscaler
- // maintains. Must be a float value in the range (0, 1]. If not
- // specified, the default is 0.6. If the CPU level is below the target
- // utilization, the autoscaler scales in the number of instances until
- // it reaches the minimum number of instances you specified or until the
- // average CPU of your instances reaches the target utilization. If the
- // average CPU is above the target utilization, the autoscaler scales
- // out until it reaches the maximum number of instances you specified or
- // until the average utilization reaches the target utilization.
+ // UtilizationTarget: The target CPU utilization that the autoscaler maintains.
+ // Must be a float value in the range (0, 1]. If not specified, the default is
+ // 0.6. If the CPU level is below the target utilization, the autoscaler scales
+ // in the number of instances until it reaches the minimum number of instances
+ // you specified or until the average CPU of your instances reaches the target
+ // utilization. If the average CPU is above the target utilization, the
+ // autoscaler scales out until it reaches the maximum number of instances you
+ // specified or until the average utilization reaches the target utilization.
UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "PredictiveMethod") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "PredictiveMethod") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "PredictiveMethod") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AutoscalingPolicyCpuUtilization) MarshalJSON() ([]byte, error) {
+func (s AutoscalingPolicyCpuUtilization) MarshalJSON() ([]byte, error) {
type NoMethod AutoscalingPolicyCpuUtilization
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
func (s *AutoscalingPolicyCpuUtilization) UnmarshalJSON(data []byte) error {
@@ -4712,104 +4090,84 @@ func (s *AutoscalingPolicyCpuUtilization) UnmarshalJSON(data []byte) error {
return nil
}
-// AutoscalingPolicyCustomMetricUtilization: Custom utilization metric
-// policy.
+// AutoscalingPolicyCustomMetricUtilization: Custom utilization metric policy.
type AutoscalingPolicyCustomMetricUtilization struct {
- // Filter: A filter string, compatible with a Stackdriver Monitoring
- // filter string for TimeSeries.list API call. This filter is used to
- // select a specific TimeSeries for the purpose of autoscaling and to
- // determine whether the metric is exporting per-instance or per-group
- // data. For the filter to be valid for autoscaling purposes, the
- // following rules apply: - You can only use the AND operator for
- // joining selectors. - You can only use direct equality comparison
- // operator (=) without any functions for each selector. - You can
- // specify the metric in both the filter string and in the metric field.
- // However, if specified in both places, the metric must be identical. -
- // The monitored resource type determines what kind of values are
- // expected for the metric. If it is a gce_instance, the autoscaler
- // expects the metric to include a separate TimeSeries for each instance
- // in a group. In such a case, you cannot filter on resource labels. If
- // the resource type is any other value, the autoscaler expects this
- // metric to contain values that apply to the entire autoscaled instance
- // group and resource label filtering can be performed to point
- // autoscaler at the correct TimeSeries to scale upon. This is called a
- // *per-group metric* for the purpose of autoscaling. If not specified,
- // the type defaults to gce_instance. Try to provide a filter that is
- // selective enough to pick just one TimeSeries for the autoscaled group
- // or for each of the instances (if you are using gce_instance resource
- // type). If multiple TimeSeries are returned upon the query execution,
- // the autoscaler will sum their respective values to obtain its scaling
- // value.
+ // Filter: A filter string, compatible with a Stackdriver Monitoring filter
+ // string for TimeSeries.list API call. This filter is used to select a
+ // specific TimeSeries for the purpose of autoscaling and to determine whether
+ // the metric is exporting per-instance or per-group data. For the filter to be
+ // valid for autoscaling purposes, the following rules apply: - You can only
+ // use the AND operator for joining selectors. - You can only use direct
+ // equality comparison operator (=) without any functions for each selector. -
+ // You can specify the metric in both the filter string and in the metric
+ // field. However, if specified in both places, the metric must be identical. -
+ // The monitored resource type determines what kind of values are expected for
+ // the metric. If it is a gce_instance, the autoscaler expects the metric to
+ // include a separate TimeSeries for each instance in a group. In such a case,
+ // you cannot filter on resource labels. If the resource type is any other
+ // value, the autoscaler expects this metric to contain values that apply to
+ // the entire autoscaled instance group and resource label filtering can be
+ // performed to point autoscaler at the correct TimeSeries to scale upon. This
+ // is called a *per-group metric* for the purpose of autoscaling. If not
+ // specified, the type defaults to gce_instance. Try to provide a filter that
+ // is selective enough to pick just one TimeSeries for the autoscaled group or
+ // for each of the instances (if you are using gce_instance resource type). If
+ // multiple TimeSeries are returned upon the query execution, the autoscaler
+ // will sum their respective values to obtain its scaling value.
Filter string `json:"filter,omitempty"`
-
- // Metric: The identifier (type) of the Stackdriver Monitoring metric.
- // The metric cannot have negative values. The metric must have a value
- // type of INT64 or DOUBLE.
+ // Metric: The identifier (type) of the Stackdriver Monitoring metric. The
+ // metric cannot have negative values. The metric must have a value type of
+ // INT64 or DOUBLE.
Metric string `json:"metric,omitempty"`
-
- // SingleInstanceAssignment: If scaling is based on a per-group metric
- // value that represents the total amount of work to be done or resource
- // usage, set this value to an amount assigned for a single instance of
- // the scaled group. Autoscaler keeps the number of instances
- // proportional to the value of this metric. The metric itself does not
- // change value due to group resizing. A good metric to use with the
- // target is for example
- // pubsub.googleapis.com/subscription/num_undelivered_messages or a
- // custom metric exporting the total number of requests coming to your
- // instances. A bad example would be a metric exporting an average or
- // median latency, since this value can't include a chunk assignable to
- // a single instance, it could be better used with utilization_target
- // instead.
+ // SingleInstanceAssignment: If scaling is based on a per-group metric value
+ // that represents the total amount of work to be done or resource usage, set
+ // this value to an amount assigned for a single instance of the scaled group.
+ // Autoscaler keeps the number of instances proportional to the value of this
+ // metric. The metric itself does not change value due to group resizing. A
+ // good metric to use with the target is for example
+ // pubsub.googleapis.com/subscription/num_undelivered_messages or a custom
+ // metric exporting the total number of requests coming to your instances. A
+ // bad example would be a metric exporting an average or median latency, since
+ // this value can't include a chunk assignable to a single instance, it could
+ // be better used with utilization_target instead.
SingleInstanceAssignment float64 `json:"singleInstanceAssignment,omitempty"`
-
- // UtilizationTarget: The target value of the metric that autoscaler
- // maintains. This must be a positive value. A utilization metric scales
- // number of virtual machines handling requests to increase or decrease
- // proportionally to the metric. For example, a good metric to use as a
- // utilization_target is
+ // UtilizationTarget: The target value of the metric that autoscaler maintains.
+ // This must be a positive value. A utilization metric scales number of virtual
+ // machines handling requests to increase or decrease proportionally to the
+ // metric. For example, a good metric to use as a utilization_target is
// https://www.googleapis.com/compute/v1/instance/network/received_bytes_count.
- // The autoscaler works to keep this value constant for each of the
- // instances.
+ // The autoscaler works to keep this value constant for each of the instances.
UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
-
- // UtilizationTargetType: Defines how target utilization value is
- // expressed for a Stackdriver Monitoring metric. Either GAUGE,
- // DELTA_PER_SECOND, or DELTA_PER_MINUTE.
+ // UtilizationTargetType: Defines how target utilization value is expressed for
+ // a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or
+ // DELTA_PER_MINUTE.
//
// Possible values:
- // "DELTA_PER_MINUTE" - Sets the utilization target value for a
- // cumulative or delta metric, expressed as the rate of growth per
- // minute.
- // "DELTA_PER_SECOND" - Sets the utilization target value for a
- // cumulative or delta metric, expressed as the rate of growth per
- // second.
+ // "DELTA_PER_MINUTE" - Sets the utilization target value for a cumulative or
+ // delta metric, expressed as the rate of growth per minute.
+ // "DELTA_PER_SECOND" - Sets the utilization target value for a cumulative or
+ // delta metric, expressed as the rate of growth per second.
// "GAUGE" - Sets the utilization target value for a gauge metric. The
- // autoscaler will collect the average utilization of the virtual
- // machines from the last couple of minutes, and compare the value to
- // the utilization target value to perform autoscaling.
+ // autoscaler will collect the average utilization of the virtual machines from
+ // the last couple of minutes, and compare the value to the utilization target
+ // value to perform autoscaling.
UtilizationTargetType string `json:"utilizationTargetType,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Filter") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Filter") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Filter") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AutoscalingPolicyCustomMetricUtilization) MarshalJSON() ([]byte, error) {
+func (s AutoscalingPolicyCustomMetricUtilization) MarshalJSON() ([]byte, error) {
type NoMethod AutoscalingPolicyCustomMetricUtilization
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
func (s *AutoscalingPolicyCustomMetricUtilization) UnmarshalJSON(data []byte) error {
@@ -4828,36 +4186,29 @@ func (s *AutoscalingPolicyCustomMetricUtilization) UnmarshalJSON(data []byte) er
return nil
}
-// AutoscalingPolicyLoadBalancingUtilization: Configuration parameters
-// of autoscaling based on load balancing.
+// AutoscalingPolicyLoadBalancingUtilization: Configuration parameters of
+// autoscaling based on load balancing.
type AutoscalingPolicyLoadBalancingUtilization struct {
- // UtilizationTarget: Fraction of backend capacity utilization (set in
- // HTTP(S) load balancing configuration) that the autoscaler maintains.
- // Must be a positive float value. If not defined, the default is 0.8.
+ // UtilizationTarget: Fraction of backend capacity utilization (set in HTTP(S)
+ // load balancing configuration) that the autoscaler maintains. Must be a
+ // positive float value. If not defined, the default is 0.8.
UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "UtilizationTarget")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "UtilizationTarget") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "UtilizationTarget") 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. "UtilizationTarget") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AutoscalingPolicyLoadBalancingUtilization) MarshalJSON() ([]byte, error) {
+func (s AutoscalingPolicyLoadBalancingUtilization) MarshalJSON() ([]byte, error) {
type NoMethod AutoscalingPolicyLoadBalancingUtilization
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
func (s *AutoscalingPolicyLoadBalancingUtilization) UnmarshalJSON(data []byte) error {
@@ -4874,221 +4225,191 @@ func (s *AutoscalingPolicyLoadBalancingUtilization) UnmarshalJSON(data []byte) e
return nil
}
-// AutoscalingPolicyScaleInControl: Configuration that allows for slower
-// scale in so that even if Autoscaler recommends an abrupt scale in of
-// a MIG, it will be throttled as specified by the parameters below.
+// AutoscalingPolicyScaleInControl: Configuration that allows for slower scale
+// in so that even if Autoscaler recommends an abrupt scale in of a MIG, it
+// will be throttled as specified by the parameters below.
type AutoscalingPolicyScaleInControl struct {
// MaxScaledInReplicas: Maximum allowed number (or %) of VMs that can be
- // deducted from the peak recommendation during the window autoscaler
- // looks at when computing recommendations. Possibly all these VMs can
- // be deleted at once so user service needs to be prepared to lose that
- // many VMs in one step.
+ // deducted from the peak recommendation during the window autoscaler looks at
+ // when computing recommendations. Possibly all these VMs can be deleted at
+ // once so user service needs to be prepared to lose that many VMs in one step.
MaxScaledInReplicas *FixedOrPercent `json:"maxScaledInReplicas,omitempty"`
-
- // TimeWindowSec: How far back autoscaling looks when computing
- // recommendations to include directives regarding slower scale in, as
- // described above.
+ // TimeWindowSec: How far back autoscaling looks when computing recommendations
+ // to include directives regarding slower scale in, as described above.
TimeWindowSec int64 `json:"timeWindowSec,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "MaxScaledInReplicas")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "MaxScaledInReplicas") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "MaxScaledInReplicas") 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. "MaxScaledInReplicas") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AutoscalingPolicyScaleInControl) MarshalJSON() ([]byte, error) {
+func (s AutoscalingPolicyScaleInControl) MarshalJSON() ([]byte, error) {
type NoMethod AutoscalingPolicyScaleInControl
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// AutoscalingPolicyScalingSchedule: Scaling based on user-defined
-// schedule. The message describes a single scaling schedule. A scaling
-// schedule changes the minimum number of VM instances an autoscaler can
-// recommend, which can trigger scaling out.
+// AutoscalingPolicyScalingSchedule: Scaling based on user-defined schedule.
+// The message describes a single scaling schedule. A scaling schedule changes
+// the minimum number of VM instances an autoscaler can recommend, which can
+// trigger scaling out.
type AutoscalingPolicyScalingSchedule struct {
// Description: A description of a scaling schedule.
Description string `json:"description,omitempty"`
-
- // Disabled: A boolean value that specifies whether a scaling schedule
- // can influence autoscaler recommendations. If set to true, then a
- // scaling schedule has no effect. This field is optional, and its value
- // is false by default.
+ // Disabled: A boolean value that specifies whether a scaling schedule can
+ // influence autoscaler recommendations. If set to true, then a scaling
+ // schedule has no effect. This field is optional, and its value is false by
+ // default.
Disabled bool `json:"disabled,omitempty"`
-
- // DurationSec: The duration of time intervals, in seconds, for which
- // this scaling schedule is to run. The minimum allowed value is 300.
- // This field is required.
+ // DurationSec: The duration of time intervals, in seconds, for which this
+ // scaling schedule is to run. The minimum allowed value is 300. This field is
+ // required.
DurationSec int64 `json:"durationSec,omitempty"`
-
- // MinRequiredReplicas: The minimum number of VM instances that the
- // autoscaler will recommend in time intervals starting according to
- // schedule. This field is required.
+ // MinRequiredReplicas: The minimum number of VM instances that the autoscaler
+ // will recommend in time intervals starting according to schedule. This field
+ // is required.
MinRequiredReplicas int64 `json:"minRequiredReplicas,omitempty"`
-
- // Schedule: The start timestamps of time intervals when this scaling
- // schedule is to provide a scaling signal. This field uses the extended
- // cron format (with an optional year field). The expression can
- // describe a single timestamp if the optional year is set, in which
- // case the scaling schedule runs once. The schedule is interpreted with
- // respect to time_zone. This field is required. Note: These timestamps
- // only describe when autoscaler starts providing the scaling signal.
- // The VMs need additional time to become serving.
+ // Schedule: The start timestamps of time intervals when this scaling schedule
+ // is to provide a scaling signal. This field uses the extended cron format
+ // (with an optional year field). The expression can describe a single
+ // timestamp if the optional year is set, in which case the scaling schedule
+ // runs once. The schedule is interpreted with respect to time_zone. This field
+ // is required. Note: These timestamps only describe when autoscaler starts
+ // providing the scaling signal. The VMs need additional time to become
+ // serving.
Schedule string `json:"schedule,omitempty"`
-
- // TimeZone: The time zone to use when interpreting the schedule. The
- // value of this field must be a time zone name from the tz database:
- // https://en.wikipedia.org/wiki/Tz_database. This field is assigned a
- // default value of "UTC" if left empty.
+ // TimeZone: The time zone to use when interpreting the schedule. The value of
+ // this field must be a time zone name from the tz database:
+ // https://en.wikipedia.org/wiki/Tz_database. This field is assigned a default
+ // value of "UTC" if left empty.
TimeZone string `json:"timeZone,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Description") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Description") to include
- // in API requests with the JSON null value. By default, fields with
- // empty values are omitted from API requests. However, any field with
- // an empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields 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. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *AutoscalingPolicyScalingSchedule) MarshalJSON() ([]byte, error) {
+func (s AutoscalingPolicyScalingSchedule) MarshalJSON() ([]byte, error) {
type NoMethod AutoscalingPolicyScalingSchedule
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// Backend: Message containing information of one individual backend.
type Backend struct {
- // BalancingMode: Specifies how to determine whether the backend of a
- // load balancer can handle additional traffic or is fully loaded. For
- // usage guidelines, see Connection balancing mode. Backends must use
- // compatible balancing modes. For more information, see Supported
- // balancing modes and target capacity settings and Restrictions and
- // guidance for instance groups. Note: Currently, if you use the API to
- // configure incompatible balancing modes, the configuration might be
- // accepted even though it has no impact and is ignored. Specifically,
- // Backend.maxUtilization is ignored when Backend.balancingMode is RATE.
- // In the future, this incompatible combination will be rejected.
+ // BalancingMode: Specifies how to determine whether the backend of a load
+ // balancer can handle additional traffic or is fully loaded. For usage
+ // guidelines, see Connection balancing mode. Backends must use compatible
+ // balancing modes. For more information, see Supported balancing modes and
+ // target capacity settings and Restrictions and guidance for instance groups.
+ // Note: Currently, if you use the API to configure incompatible balancing
+ // modes, the configuration might be accepted even though it has no impact and
+ // is ignored. Specifically, Backend.maxUtilization is ignored when
+ // Backend.balancingMode is RATE. In the future, this incompatible combination
+ // will be rejected.
//
// Possible values:
- // "CONNECTION" - Balance based on the number of simultaneous
- // connections.
+ // "CONNECTION" - Balance based on the number of simultaneous connections.
// "RATE" - Balance based on requests per second (RPS).
// "UTILIZATION" - Balance based on the backend utilization.
BalancingMode string `json:"balancingMode,omitempty"`
-
- // CapacityScaler: A multiplier applied to the backend's target capacity
- // of its balancing mode. The default value is 1, which means the group
- // serves up to 100% of its configured capacity (depending on
- // balancingMode). A setting of 0 means the group is completely drained,
- // offering 0% of its available capacity. The valid ranges are 0.0 and
- // [0.1,1.0]. You cannot configure a setting larger than 0 and smaller
- // than 0.1. You cannot configure a setting of 0 when there is only one
- // backend attached to the backend service. Not available with backends
- // that don't support using a balancingMode. This includes backends such
- // as global internet NEGs, regional serverless NEGs, and PSC NEGs.
+ // CapacityScaler: A multiplier applied to the backend's target capacity of its
+ // balancing mode. The default value is 1, which means the group serves up to
+ // 100% of its configured capacity (depending on balancingMode). A setting of 0
+ // means the group is completely drained, offering 0% of its available
+ // capacity. The valid ranges are 0.0 and [0.1,1.0]. You cannot configure a
+ // setting larger than 0 and smaller than 0.1. You cannot configure a setting
+ // of 0 when there is only one backend attached to the backend service. Not
+ // available with backends that don't support using a balancingMode. This
+ // includes backends such as global internet NEGs, regional serverless NEGs,
+ // and PSC NEGs.
CapacityScaler float64 `json:"capacityScaler,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // Failover: This field designates whether this is a failover backend.
- // More than one failover backend can be configured for a given
- // BackendService.
+ // Failover: This field designates whether this is a failover backend. More
+ // than one failover backend can be configured for a given BackendService.
Failover bool `json:"failover,omitempty"`
-
- // Group: The fully-qualified URL of an instance group or network
- // endpoint group (NEG) resource. To determine what types of backends a
- // load balancer supports, see the Backend services overview
- // (https://cloud.google.com/load-balancing/docs/backend-service#backends).
- // You must use the *fully-qualified* URL (starting with
- // https://www.googleapis.com/) to specify the instance group or NEG.
- // Partial URLs are not supported.
+ // Group: The fully-qualified URL of an instance group or network endpoint
+ // group (NEG) resource. To determine what types of backends a load balancer
+ // supports, see the Backend services overview
+ // (https://cloud.google.com/load-balancing/docs/backend-service#backends). You
+ // must use the *fully-qualified* URL (starting with
+ // https://www.googleapis.com/) to specify the instance group or NEG. Partial
+ // URLs are not supported.
Group string `json:"group,omitempty"`
-
- // MaxConnections: Defines a target maximum number of simultaneous
- // connections. For usage guidelines, see Connection balancing mode and
- // Utilization balancing mode. Not available if the backend's
- // balancingMode is RATE.
+ // MaxConnections: Defines a target maximum number of simultaneous connections.
+ // For usage guidelines, see Connection balancing mode and Utilization
+ // balancing mode. Not available if the backend's balancingMode is RATE.
MaxConnections int64 `json:"maxConnections,omitempty"`
-
- // MaxConnectionsPerEndpoint: Defines a target maximum number of
- // simultaneous connections. For usage guidelines, see Connection
- // balancing mode and Utilization balancing mode. Not available if the
- // backend's balancingMode is RATE.
+ // MaxConnectionsPerEndpoint: Defines a target maximum number of simultaneous
+ // connections. For usage guidelines, see Connection balancing mode and
+ // Utilization balancing mode. Not available if the backend's balancingMode is
+ // RATE.
MaxConnectionsPerEndpoint int64 `json:"maxConnectionsPerEndpoint,omitempty"`
-
- // MaxConnectionsPerInstance: Defines a target maximum number of
- // simultaneous connections. For usage guidelines, see Connection
- // balancing mode and Utilization balancing mode. Not available if the
- // backend's balancingMode is RATE.
+ // MaxConnectionsPerInstance: Defines a target maximum number of simultaneous
+ // connections. For usage guidelines, see Connection balancing mode and
+ // Utilization balancing mode. Not available if the backend's balancingMode is
+ // RATE.
MaxConnectionsPerInstance int64 `json:"maxConnectionsPerInstance,omitempty"`
-
- // MaxRate: Defines a maximum number of HTTP requests per second (RPS).
- // For usage guidelines, see Rate balancing mode and Utilization
- // balancing mode. Not available if the backend's balancingMode is
- // CONNECTION.
+ // MaxRate: Defines a maximum number of HTTP requests per second (RPS). For
+ // usage guidelines, see Rate balancing mode and Utilization balancing mode.
+ // Not available if the backend's balancingMode is CONNECTION.
MaxRate int64 `json:"maxRate,omitempty"`
-
- // MaxRatePerEndpoint: Defines a maximum target for requests per second
- // (RPS). For usage guidelines, see Rate balancing mode and Utilization
- // balancing mode. Not available if the backend's balancingMode is
- // CONNECTION.
+ // MaxRatePerEndpoint: Defines a maximum target for requests per second (RPS).
+ // For usage guidelines, see Rate balancing mode and Utilization balancing
+ // mode. Not available if the backend's balancingMode is CONNECTION.
MaxRatePerEndpoint float64 `json:"maxRatePerEndpoint,omitempty"`
-
- // MaxRatePerInstance: Defines a maximum target for requests per second
- // (RPS). For usage guidelines, see Rate balancing mode and Utilization
- // balancing mode. Not available if the backend's balancingMode is
- // CONNECTION.
+ // MaxRatePerInstance: Defines a maximum target for requests per second (RPS).
+ // For usage guidelines, see Rate balancing mode and Utilization balancing
+ // mode. Not available if the backend's balancingMode is CONNECTION.
MaxRatePerInstance float64 `json:"maxRatePerInstance,omitempty"`
-
- // MaxUtilization: Optional parameter to define a target capacity for
- // the UTILIZATION balancing mode. The valid range is [0.0, 1.0]. For
- // usage guidelines, see Utilization balancing mode.
+ // MaxUtilization: Optional parameter to define a target capacity for the
+ // UTILIZATION balancing mode. The valid range is [0.0, 1.0]. For usage
+ // guidelines, see Utilization balancing mode.
MaxUtilization float64 `json:"maxUtilization,omitempty"`
-
+ // Preference: This field indicates whether this backend should be fully
+ // utilized before sending traffic to backends with default preference. The
+ // possible values are: - PREFERRED: Backends with this preference level will
+ // be filled up to their capacity limits first, based on RTT. - DEFAULT: If
+ // preferred backends don't have enough capacity, backends in this layer would
+ // be used and traffic would be assigned based on the load balancing algorithm
+ // you use. This is the default
+ //
+ // Possible values:
+ // "DEFAULT" - No preference.
+ // "PREFERENCE_UNSPECIFIED" - If preference is unspecified, we set it to the
+ // DEFAULT value
+ // "PREFERRED" - Traffic will be sent to this backend first.
+ Preference string `json:"preference,omitempty"`
// ForceSendFields is a list of field names (e.g. "BalancingMode") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "BalancingMode") 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. "BalancingMode") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *Backend) MarshalJSON() ([]byte, error) {
+func (s Backend) MarshalJSON() ([]byte, error) {
type NoMethod Backend
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
func (s *Backend) UnmarshalJSON(data []byte) error {
@@ -5112,859 +4433,758 @@ func (s *Backend) UnmarshalJSON(data []byte) error {
}
// BackendBucket: Represents a Cloud Storage Bucket resource. This Cloud
-// Storage bucket resource is referenced by a URL map of a load
-// balancer. For more information, read Backend Buckets.
+// Storage bucket resource is referenced by a URL map of a load balancer. For
+// more information, read Backend Buckets.
type BackendBucket struct {
// BucketName: Cloud Storage bucket name.
BucketName string `json:"bucketName,omitempty"`
-
// CdnPolicy: Cloud CDN configuration for this BackendBucket.
CdnPolicy *BackendBucketCdnPolicy `json:"cdnPolicy,omitempty"`
-
- // CompressionMode: Compress text responses using Brotli or gzip
- // compression, based on the client's Accept-Encoding header.
+ // CompressionMode: Compress text responses using Brotli or gzip compression,
+ // based on the client's Accept-Encoding header.
//
// Possible values:
// "AUTOMATIC" - Automatically uses the best compression based on the
// Accept-Encoding header sent by the client.
- // "DISABLED" - Disables compression. Existing compressed responses
- // cached by Cloud CDN will not be served to clients.
+ // "DISABLED" - Disables compression. Existing compressed responses cached by
+ // Cloud CDN will not be served to clients.
CompressionMode string `json:"compressionMode,omitempty"`
-
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // CustomResponseHeaders: Headers that the Application Load Balancer
- // should add to proxied responses.
+ // CustomResponseHeaders: Headers that the Application Load Balancer should add
+ // to proxied responses.
CustomResponseHeaders []string `json:"customResponseHeaders,omitempty"`
-
- // Description: An optional textual description of the resource;
- // provided by the client when the resource is created.
+ // Description: An optional textual description of the resource; provided by
+ // the client when the resource is created.
Description string `json:"description,omitempty"`
-
- // EdgeSecurityPolicy: [Output Only] The resource URL for the edge
- // security policy associated with this backend bucket.
+ // EdgeSecurityPolicy: [Output Only] The resource URL for the edge security
+ // policy associated with this backend bucket.
EdgeSecurityPolicy string `json:"edgeSecurityPolicy,omitempty"`
-
// EnableCdn: If true, enable Cloud CDN for this BackendBucket.
EnableCdn bool `json:"enableCdn,omitempty"`
-
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
// Kind: Type of the resource.
Kind string `json:"kind,omitempty"`
-
- // Name: Name of the resource. Provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
- // the first character must be a lowercase letter, and all following
- // characters must be a dash, lowercase letter, or digit, except the
- // last character, which cannot be a dash.
+ // Name: Name of the resource. Provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must
+ // be a lowercase letter, and all following characters must be a dash,
+ // lowercase letter, or digit, except the last character, which cannot be a
+ // dash.
Name string `json:"name,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
+ // UsedBy: [Output Only] List of resources referencing that backend bucket.
+ UsedBy []*BackendBucketUsedBy `json:"usedBy,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
// ForceSendFields is a list of field names (e.g. "BucketName") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "BucketName") 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. "BucketName") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *BackendBucket) MarshalJSON() ([]byte, error) {
+func (s BackendBucket) MarshalJSON() ([]byte, error) {
type NoMethod BackendBucket
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// BackendBucketCdnPolicy: Message containing Cloud CDN configuration
-// for a backend bucket.
+// BackendBucketCdnPolicy: Message containing Cloud CDN configuration for a
+// backend bucket.
type BackendBucketCdnPolicy struct {
- // BypassCacheOnRequestHeaders: Bypass the cache when the specified
- // request headers are matched - e.g. Pragma or Authorization headers.
- // Up to 5 headers can be specified. The cache is bypassed for all
- // cdnPolicy.cacheMode settings.
+ // BypassCacheOnRequestHeaders: Bypass the cache when the specified request
+ // headers are matched - e.g. Pragma or Authorization headers. Up to 5 headers
+ // can be specified. The cache is bypassed for all cdnPolicy.cacheMode
+ // settings.
BypassCacheOnRequestHeaders []*BackendBucketCdnPolicyBypassCacheOnRequestHeader `json:"bypassCacheOnRequestHeaders,omitempty"`
-
// CacheKeyPolicy: The CacheKeyPolicy for this CdnPolicy.
CacheKeyPolicy *BackendBucketCdnPolicyCacheKeyPolicy `json:"cacheKeyPolicy,omitempty"`
-
- // CacheMode: Specifies the cache setting for all responses from this
- // backend. The possible values are: USE_ORIGIN_HEADERS Requires the
- // origin to set valid caching headers to cache content. Responses
- // without these headers will not be cached at Google's edge, and will
- // require a full trip to the origin on every request, potentially
- // impacting performance and increasing load on the origin server.
- // FORCE_CACHE_ALL Cache all content, ignoring any "private", "no-store"
- // or "no-cache" directives in Cache-Control response headers. Warning:
- // this may result in Cloud CDN caching private, per-user (user
- // identifiable) content. CACHE_ALL_STATIC Automatically cache static
- // content, including common image formats, media (video and audio), and
- // web assets (JavaScript and CSS). Requests and responses that are
- // marked as uncacheable, as well as dynamic content (including HTML),
- // will not be cached.
- //
- // Possible values:
- // "CACHE_ALL_STATIC" - Automatically cache static content, including
- // common image formats, media (video and audio), and web assets
- // (JavaScript and CSS). Requests and responses that are marked as
- // uncacheable, as well as dynamic content (including HTML), will not be
- // cached.
- // "FORCE_CACHE_ALL" - Cache all content, ignoring any "private",
- // "no-store" or "no-cache" directives in Cache-Control response
- // headers. Warning: this may result in Cloud CDN caching private,
- // per-user (user identifiable) content.
+ // CacheMode: Specifies the cache setting for all responses from this backend.
+ // The possible values are: USE_ORIGIN_HEADERS Requires the origin to set valid
+ // caching headers to cache content. Responses without these headers will not
+ // be cached at Google's edge, and will require a full trip to the origin on
+ // every request, potentially impacting performance and increasing load on the
+ // origin server. FORCE_CACHE_ALL Cache all content, ignoring any "private",
+ // "no-store" or "no-cache" directives in Cache-Control response headers.
+ // Warning: this may result in Cloud CDN caching private, per-user (user
+ // identifiable) content. CACHE_ALL_STATIC Automatically cache static content,
+ // including common image formats, media (video and audio), and web assets
+ // (JavaScript and CSS). Requests and responses that are marked as uncacheable,
+ // as well as dynamic content (including HTML), will not be cached.
+ //
+ // Possible values:
+ // "CACHE_ALL_STATIC" - Automatically cache static content, including common
+ // image formats, media (video and audio), and web assets (JavaScript and CSS).
+ // Requests and responses that are marked as uncacheable, as well as dynamic
+ // content (including HTML), will not be cached.
+ // "FORCE_CACHE_ALL" - Cache all content, ignoring any "private", "no-store"
+ // or "no-cache" directives in Cache-Control response headers. Warning: this
+ // may result in Cloud CDN caching private, per-user (user identifiable)
+ // content.
// "INVALID_CACHE_MODE"
- // "USE_ORIGIN_HEADERS" - Requires the origin to set valid caching
- // headers to cache content. Responses without these headers will not be
- // cached at Google's edge, and will require a full trip to the origin
- // on every request, potentially impacting performance and increasing
- // load on the origin server.
+ // "USE_ORIGIN_HEADERS" - Requires the origin to set valid caching headers to
+ // cache content. Responses without these headers will not be cached at
+ // Google's edge, and will require a full trip to the origin on every request,
+ // potentially impacting performance and increasing load on the origin server.
CacheMode string `json:"cacheMode,omitempty"`
-
- // ClientTtl: Specifies a separate client (e.g. browser client) maximum
- // TTL. This is used to clamp the max-age (or Expires) value sent to the
- // client. With FORCE_CACHE_ALL, the lesser of client_ttl and
- // default_ttl is used for the response max-age directive, along with a
- // "public" directive. For cacheable content in CACHE_ALL_STATIC mode,
- // client_ttl clamps the max-age from the origin (if specified), or else
- // sets the response max-age directive to the lesser of the client_ttl
- // and default_ttl, and also ensures a "public" cache-control directive
- // is present. If a client TTL is not specified, a default value (1
- // hour) will be used. The maximum allowed value is 31,622,400s (1
- // year).
+ // ClientTtl: Specifies a separate client (e.g. browser client) maximum TTL.
+ // This is used to clamp the max-age (or Expires) value sent to the client.
+ // With FORCE_CACHE_ALL, the lesser of client_ttl and default_ttl is used for
+ // the response max-age directive, along with a "public" directive. For
+ // cacheable content in CACHE_ALL_STATIC mode, client_ttl clamps the max-age
+ // from the origin (if specified), or else sets the response max-age directive
+ // to the lesser of the client_ttl and default_ttl, and also ensures a "public"
+ // cache-control directive is present. If a client TTL is not specified, a
+ // default value (1 hour) will be used. The maximum allowed value is
+ // 31,622,400s (1 year).
ClientTtl int64 `json:"clientTtl,omitempty"`
-
- // DefaultTtl: Specifies the default TTL for cached content served by
- // this origin for responses that do not have an existing valid TTL
- // (max-age or s-max-age). Setting a TTL of "0" means "always
- // revalidate". The value of defaultTTL cannot be set to a value greater
- // than that of maxTTL, but can be equal. When the cacheMode is set to
- // FORCE_CACHE_ALL, the defaultTTL will overwrite the TTL set in all
- // responses. The maximum allowed value is 31,622,400s (1 year), noting
- // that infrequently accessed objects may be evicted from the cache
- // before the defined TTL.
+ // DefaultTtl: Specifies the default TTL for cached content served by this
+ // origin for responses that do not have an existing valid TTL (max-age or
+ // s-max-age). Setting a TTL of "0" means "always revalidate". The value of
+ // defaultTTL cannot be set to a value greater than that of maxTTL, but can be
+ // equal. When the cacheMode is set to FORCE_CACHE_ALL, the defaultTTL will
+ // overwrite the TTL set in all responses. The maximum allowed value is
+ // 31,622,400s (1 year), noting that infrequently accessed objects may be
+ // evicted from the cache before the defined TTL.
DefaultTtl int64 `json:"defaultTtl,omitempty"`
-
- // MaxTtl: Specifies the maximum allowed TTL for cached content served
- // by this origin. Cache directives that attempt to set a max-age or
- // s-maxage higher than this, or an Expires header more than maxTTL
- // seconds in the future will be capped at the value of maxTTL, as if it
- // were the value of an s-maxage Cache-Control directive. Headers sent
- // to the client will not be modified. Setting a TTL of "0" means
- // "always revalidate". The maximum allowed value is 31,622,400s (1
- // year), noting that infrequently accessed objects may be evicted from
- // the cache before the defined TTL.
+ // MaxTtl: Specifies the maximum allowed TTL for cached content served by this
+ // origin. Cache directives that attempt to set a max-age or s-maxage higher
+ // than this, or an Expires header more than maxTTL seconds in the future will
+ // be capped at the value of maxTTL, as if it were the value of an s-maxage
+ // Cache-Control directive. Headers sent to the client will not be modified.
+ // Setting a TTL of "0" means "always revalidate". The maximum allowed value is
+ // 31,622,400s (1 year), noting that infrequently accessed objects may be
+ // evicted from the cache before the defined TTL.
MaxTtl int64 `json:"maxTtl,omitempty"`
-
- // NegativeCaching: Negative caching allows per-status code TTLs to be
- // set, in order to apply fine-grained caching for common errors or
- // redirects. This can reduce the load on your origin and improve
- // end-user experience by reducing response latency. When the cache mode
- // is set to CACHE_ALL_STATIC or USE_ORIGIN_HEADERS, negative caching
- // applies to responses with the specified response code that lack any
- // Cache-Control, Expires, or Pragma: no-cache directives. When the
- // cache mode is set to FORCE_CACHE_ALL, negative caching applies to all
- // responses with the specified response code, and override any caching
- // headers. By default, Cloud CDN will apply the following default TTLs
- // to these status codes: HTTP 300 (Multiple Choice), 301, 308
- // (Permanent Redirects): 10m HTTP 404 (Not Found), 410 (Gone), 451
- // (Unavailable For Legal Reasons): 120s HTTP 405 (Method Not Found),
- // 421 (Misdirected Request), 501 (Not Implemented): 60s. These defaults
- // can be overridden in negative_caching_policy.
+ // NegativeCaching: Negative caching allows per-status code TTLs to be set, in
+ // order to apply fine-grained caching for common errors or redirects. This can
+ // reduce the load on your origin and improve end-user experience by reducing
+ // response latency. When the cache mode is set to CACHE_ALL_STATIC or
+ // USE_ORIGIN_HEADERS, negative caching applies to responses with the specified
+ // response code that lack any Cache-Control, Expires, or Pragma: no-cache
+ // directives. When the cache mode is set to FORCE_CACHE_ALL, negative caching
+ // applies to all responses with the specified response code, and override any
+ // caching headers. By default, Cloud CDN will apply the following default TTLs
+ // to these status codes: HTTP 300 (Multiple Choice), 301, 308 (Permanent
+ // Redirects): 10m HTTP 404 (Not Found), 410 (Gone), 451 (Unavailable For Legal
+ // Reasons): 120s HTTP 405 (Method Not Found), 421 (Misdirected Request), 501
+ // (Not Implemented): 60s. These defaults can be overridden in
+ // negative_caching_policy.
NegativeCaching bool `json:"negativeCaching,omitempty"`
-
- // NegativeCachingPolicy: Sets a cache TTL for the specified HTTP status
- // code. negative_caching must be enabled to configure
- // negative_caching_policy. Omitting the policy and leaving
- // negative_caching enabled will use Cloud CDN's default cache TTLs.
- // Note that when specifying an explicit negative_caching_policy, you
- // should take care to specify a cache TTL for all response codes that
- // you wish to cache. Cloud CDN will not apply any default negative
- // caching when a policy exists.
+ // NegativeCachingPolicy: Sets a cache TTL for the specified HTTP status code.
+ // negative_caching must be enabled to configure negative_caching_policy.
+ // Omitting the policy and leaving negative_caching enabled will use Cloud
+ // CDN's default cache TTLs. Note that when specifying an explicit
+ // negative_caching_policy, you should take care to specify a cache TTL for all
+ // response codes that you wish to cache. Cloud CDN will not apply any default
+ // negative caching when a policy exists.
NegativeCachingPolicy []*BackendBucketCdnPolicyNegativeCachingPolicy `json:"negativeCachingPolicy,omitempty"`
-
- // RequestCoalescing: If true then Cloud CDN will combine multiple
- // concurrent cache fill requests into a small number of requests to the
- // origin.
+ // RequestCoalescing: If true then Cloud CDN will combine multiple concurrent
+ // cache fill requests into a small number of requests to the origin.
RequestCoalescing bool `json:"requestCoalescing,omitempty"`
-
- // ServeWhileStale: Serve existing content from the cache (if available)
- // when revalidating content with the origin, or when an error is
- // encountered when refreshing the cache. This setting defines the
- // default "max-stale" duration for any cached responses that do not
- // specify a max-stale directive. Stale responses that exceed the TTL
- // configured here will not be served. The default limit (max-stale) is
- // 86400s (1 day), which will allow stale content to be served up to
- // this limit beyond the max-age (or s-max-age) of a cached response.
- // The maximum allowed value is 604800 (1 week). Set this to zero (0) to
- // disable serve-while-stale.
+ // ServeWhileStale: Serve existing content from the cache (if available) when
+ // revalidating content with the origin, or when an error is encountered when
+ // refreshing the cache. This setting defines the default "max-stale" duration
+ // for any cached responses that do not specify a max-stale directive. Stale
+ // responses that exceed the TTL configured here will not be served. The
+ // default limit (max-stale) is 86400s (1 day), which will allow stale content
+ // to be served up to this limit beyond the max-age (or s-max-age) of a cached
+ // response. The maximum allowed value is 604800 (1 week). Set this to zero (0)
+ // to disable serve-while-stale.
ServeWhileStale int64 `json:"serveWhileStale,omitempty"`
-
- // SignedUrlCacheMaxAgeSec: Maximum number of seconds the response to a
- // signed URL request will be considered fresh. After this time period,
- // the response will be revalidated before being served. Defaults to 1hr
- // (3600s). When serving responses to signed URL requests, Cloud CDN
- // will internally behave as though all responses from this backend had
- // a "Cache-Control: public, max-age=[TTL]" header, regardless of any
- // existing Cache-Control header. The actual headers served in responses
- // will not be altered.
+ // SignedUrlCacheMaxAgeSec: Maximum number of seconds the response to a signed
+ // URL request will be considered fresh. After this time period, the response
+ // will be revalidated before being served. Defaults to 1hr (3600s). When
+ // serving responses to signed URL requests, Cloud CDN will internally behave
+ // as though all responses from this backend had a "Cache-Control: public,
+ // max-age=[TTL]" header, regardless of any existing Cache-Control header. The
+ // actual headers served in responses will not be altered.
SignedUrlCacheMaxAgeSec int64 `json:"signedUrlCacheMaxAgeSec,omitempty,string"`
-
- // SignedUrlKeyNames: [Output Only] Names of the keys for signing
- // request URLs.
+ // SignedUrlKeyNames: [Output Only] Names of the keys for signing request URLs.
SignedUrlKeyNames []string `json:"signedUrlKeyNames,omitempty"`
-
// ForceSendFields is a list of field names (e.g.
- // "BypassCacheOnRequestHeaders") to unconditionally include in API
- // requests. By default, fields with empty or default 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.
+ // "BypassCacheOnRequestHeaders") to unconditionally include in API requests.
+ // By default, fields with empty or default values are omitted from API
+ // requests. See https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields
+ // for more details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g.
- // "BypassCacheOnRequestHeaders") 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. "BypassCacheOnRequestHeaders") to
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *BackendBucketCdnPolicy) MarshalJSON() ([]byte, error) {
+func (s BackendBucketCdnPolicy) MarshalJSON() ([]byte, error) {
type NoMethod BackendBucketCdnPolicy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// BackendBucketCdnPolicyBypassCacheOnRequestHeader: Bypass the cache
-// when the specified request headers are present, e.g. Pragma or
-// Authorization headers. Values are case insensitive. The presence of
-// such a header overrides the cache_mode setting.
+// BackendBucketCdnPolicyBypassCacheOnRequestHeader: Bypass the cache when the
+// specified request headers are present, e.g. Pragma or Authorization headers.
+// Values are case insensitive. The presence of such a header overrides the
+// cache_mode setting.
type BackendBucketCdnPolicyBypassCacheOnRequestHeader struct {
- // HeaderName: The header field name to match on when bypassing cache.
- // Values are case-insensitive.
+ // HeaderName: The header field name to match on when bypassing cache. Values
+ // are case-insensitive.
HeaderName string `json:"headerName,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "HeaderName") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "HeaderName") 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. "HeaderName") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *BackendBucketCdnPolicyBypassCacheOnRequestHeader) MarshalJSON() ([]byte, error) {
+func (s BackendBucketCdnPolicyBypassCacheOnRequestHeader) MarshalJSON() ([]byte, error) {
type NoMethod BackendBucketCdnPolicyBypassCacheOnRequestHeader
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// BackendBucketCdnPolicyCacheKeyPolicy: Message containing what to
-// include in the cache key for a request for Cloud CDN.
+// BackendBucketCdnPolicyCacheKeyPolicy: Message containing what to include in
+// the cache key for a request for Cloud CDN.
type BackendBucketCdnPolicyCacheKeyPolicy struct {
- // IncludeHttpHeaders: Allows HTTP request headers (by name) to be used
- // in the cache key.
+ // IncludeHttpHeaders: Allows HTTP request headers (by name) to be used in the
+ // cache key.
IncludeHttpHeaders []string `json:"includeHttpHeaders,omitempty"`
-
- // QueryStringWhitelist: Names of query string parameters to include in
- // cache keys. Default parameters are always included. '&' and '=' will
- // be percent encoded and not treated as delimiters.
+ // QueryStringWhitelist: Names of query string parameters to include in cache
+ // keys. Default parameters are always included. '&' and '=' will be percent
+ // encoded and not treated as delimiters.
QueryStringWhitelist []string `json:"queryStringWhitelist,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "IncludeHttpHeaders")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "IncludeHttpHeaders") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "IncludeHttpHeaders") 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. "IncludeHttpHeaders") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *BackendBucketCdnPolicyCacheKeyPolicy) MarshalJSON() ([]byte, error) {
+func (s BackendBucketCdnPolicyCacheKeyPolicy) MarshalJSON() ([]byte, error) {
type NoMethod BackendBucketCdnPolicyCacheKeyPolicy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// BackendBucketCdnPolicyNegativeCachingPolicy: Specify CDN TTLs for
-// response error codes.
+// BackendBucketCdnPolicyNegativeCachingPolicy: Specify CDN TTLs for response
+// error codes.
type BackendBucketCdnPolicyNegativeCachingPolicy struct {
- // Code: The HTTP status code to define a TTL against. Only HTTP status
- // codes 300, 301, 302, 307, 308, 404, 405, 410, 421, 451 and 501 are
- // can be specified as values, and you cannot specify a status code more
- // than once.
+ // Code: The HTTP status code to define a TTL against. Only HTTP status codes
+ // 300, 301, 302, 307, 308, 404, 405, 410, 421, 451 and 501 are can be
+ // specified as values, and you cannot specify a status code more than once.
Code int64 `json:"code,omitempty"`
-
// Ttl: The TTL (in seconds) for which to cache responses with the
- // corresponding status code. The maximum allowed value is 1800s (30
- // minutes), noting that infrequently accessed objects may be evicted
- // from the cache before the defined TTL.
+ // corresponding status code. The maximum allowed value is 1800s (30 minutes),
+ // noting that infrequently accessed objects may be evicted from the cache
+ // before the defined TTL.
Ttl int64 `json:"ttl,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *BackendBucketCdnPolicyNegativeCachingPolicy) MarshalJSON() ([]byte, error) {
+func (s BackendBucketCdnPolicyNegativeCachingPolicy) MarshalJSON() ([]byte, error) {
type NoMethod BackendBucketCdnPolicyNegativeCachingPolicy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// BackendBucketList: Contains a list of BackendBucket resources.
type BackendBucketList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of BackendBucket resources.
Items []*BackendBucket `json:"items,omitempty"`
-
// Kind: Type of resource.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *BackendBucketListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *BackendBucketList) MarshalJSON() ([]byte, error) {
+func (s BackendBucketList) MarshalJSON() ([]byte, error) {
type NoMethod BackendBucketList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// BackendBucketListWarning: [Output Only] Informational warning
-// message.
+// BackendBucketListWarning: [Output Only] Informational warning message.
type BackendBucketListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*BackendBucketListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *BackendBucketListWarning) MarshalJSON() ([]byte, error) {
+func (s BackendBucketListWarning) MarshalJSON() ([]byte, error) {
type NoMethod BackendBucketListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type BackendBucketListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *BackendBucketListWarningData) MarshalJSON() ([]byte, error) {
+func (s BackendBucketListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod BackendBucketListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// BackendService: Represents a Backend Service resource. A backend
-// service defines how Google Cloud load balancers distribute traffic.
-// The backend service configuration contains a set of values, such as
-// the protocol used to connect to backends, various distribution and
-// session settings, health checks, and timeouts. These settings provide
-// fine-grained control over how your load balancer behaves. Most of the
-// settings have default values that allow for easy configuration if you
-// need to get started quickly. Backend services in Google Compute
-// Engine can be either regionally or globally scoped. * Global
-// (https://cloud.google.com/compute/docs/reference/rest/v1/backendServices)
-// * Regional
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+type BackendBucketUsedBy struct {
+ // Reference: [Output Only] Server-defined URL for UrlMaps referencing that
+ // BackendBucket.
+ Reference string `json:"reference,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Reference") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Reference") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s BackendBucketUsedBy) MarshalJSON() ([]byte, error) {
+ type NoMethod BackendBucketUsedBy
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+// BackendService: Represents a Backend Service resource. A backend service
+// defines how Google Cloud load balancers distribute traffic. The backend
+// service configuration contains a set of values, such as the protocol used to
+// connect to backends, various distribution and session settings, health
+// checks, and timeouts. These settings provide fine-grained control over how
+// your load balancer behaves. Most of the settings have default values that
+// allow for easy configuration if you need to get started quickly. Backend
+// services in Google Compute Engine can be either regionally or globally
+// scoped. * Global
+// (https://cloud.google.com/compute/docs/reference/rest/v1/backendServices) *
+// Regional
// (https://cloud.google.com/compute/docs/reference/rest/v1/regionBackendServices)
// For more information, see Backend Services.
type BackendService struct {
// AffinityCookieTtlSec: Lifetime of cookies in seconds. This setting is
- // applicable to Application Load Balancers and Traffic Director and
- // requires GENERATED_COOKIE or HTTP_COOKIE session affinity. If set to
- // 0, the cookie is non-persistent and lasts only until the end of the
- // browser session (or equivalent). The maximum allowed value is two
- // weeks (1,209,600). Not supported when the backend service is
- // referenced by a URL map that is bound to target gRPC proxy that has
- // validateForProxyless field set to true.
+ // applicable to Application Load Balancers and Traffic Director and requires
+ // GENERATED_COOKIE or HTTP_COOKIE session affinity. If set to 0, the cookie is
+ // non-persistent and lasts only until the end of the browser session (or
+ // equivalent). The maximum allowed value is two weeks (1,209,600). Not
+ // supported when the backend service is referenced by a URL map that is bound
+ // to target gRPC proxy that has validateForProxyless field set to true.
AffinityCookieTtlSec int64 `json:"affinityCookieTtlSec,omitempty"`
-
// Backends: The list of backends that serve this BackendService.
Backends []*Backend `json:"backends,omitempty"`
-
- // CdnPolicy: Cloud CDN configuration for this BackendService. Only
- // available for specified load balancer types.
- CdnPolicy *BackendServiceCdnPolicy `json:"cdnPolicy,omitempty"`
-
- CircuitBreakers *CircuitBreakers `json:"circuitBreakers,omitempty"`
-
- // CompressionMode: Compress text responses using Brotli or gzip
- // compression, based on the client's Accept-Encoding header.
+ // CdnPolicy: Cloud CDN configuration for this BackendService. Only available
+ // for specified load balancer types.
+ CdnPolicy *BackendServiceCdnPolicy `json:"cdnPolicy,omitempty"`
+ CircuitBreakers *CircuitBreakers `json:"circuitBreakers,omitempty"`
+ // CompressionMode: Compress text responses using Brotli or gzip compression,
+ // based on the client's Accept-Encoding header.
//
// Possible values:
// "AUTOMATIC" - Automatically uses the best compression based on the
// Accept-Encoding header sent by the client.
- // "DISABLED" - Disables compression. Existing compressed responses
- // cached by Cloud CDN will not be served to clients.
- CompressionMode string `json:"compressionMode,omitempty"`
-
+ // "DISABLED" - Disables compression. Existing compressed responses cached by
+ // Cloud CDN will not be served to clients.
+ CompressionMode string `json:"compressionMode,omitempty"`
ConnectionDraining *ConnectionDraining `json:"connectionDraining,omitempty"`
-
// ConnectionTrackingPolicy: Connection Tracking configuration for this
- // BackendService. Connection tracking policy settings are only
- // available for external passthrough Network Load Balancers and
- // internal passthrough Network Load Balancers.
+ // BackendService. Connection tracking policy settings are only available for
+ // external passthrough Network Load Balancers and internal passthrough Network
+ // Load Balancers.
ConnectionTrackingPolicy *BackendServiceConnectionTrackingPolicy `json:"connectionTrackingPolicy,omitempty"`
-
- // ConsistentHash: Consistent Hash-based load balancing can be used to
- // provide soft session affinity based on HTTP headers, cookies or other
- // properties. This load balancing policy is applicable only for HTTP
- // connections. The affinity to a particular destination host will be
- // lost when one or more hosts are added/removed from the destination
- // service. This field specifies parameters that control consistent
- // hashing. This field is only applicable when localityLbPolicy is set
- // to MAGLEV or RING_HASH. This field is applicable to either: - A
- // regional backend service with the service_protocol set to HTTP,
- // HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED. -
- // A global backend service with the load_balancing_scheme set to
- // INTERNAL_SELF_MANAGED.
+ // ConsistentHash: Consistent Hash-based load balancing can be used to provide
+ // soft session affinity based on HTTP headers, cookies or other properties.
+ // This load balancing policy is applicable only for HTTP connections. The
+ // affinity to a particular destination host will be lost when one or more
+ // hosts are added/removed from the destination service. This field specifies
+ // parameters that control consistent hashing. This field is only applicable
+ // when localityLbPolicy is set to MAGLEV or RING_HASH. This field is
+ // applicable to either: - A regional backend service with the service_protocol
+ // set to HTTP, HTTPS, or HTTP2, and load_balancing_scheme set to
+ // INTERNAL_MANAGED. - A global backend service with the load_balancing_scheme
+ // set to INTERNAL_SELF_MANAGED.
ConsistentHash *ConsistentHashLoadBalancerSettings `json:"consistentHash,omitempty"`
-
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
// CustomRequestHeaders: Headers that the load balancer adds to proxied
// requests. See Creating custom headers
// (https://cloud.google.com/load-balancing/docs/custom-headers).
CustomRequestHeaders []string `json:"customRequestHeaders,omitempty"`
-
// CustomResponseHeaders: Headers that the load balancer adds to proxied
// responses. See Creating custom headers
// (https://cloud.google.com/load-balancing/docs/custom-headers).
CustomResponseHeaders []string `json:"customResponseHeaders,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // EdgeSecurityPolicy: [Output Only] The resource URL for the edge
- // security policy associated with this backend service.
+ // EdgeSecurityPolicy: [Output Only] The resource URL for the edge security
+ // policy associated with this backend service.
EdgeSecurityPolicy string `json:"edgeSecurityPolicy,omitempty"`
-
- // EnableCDN: If true, enables Cloud CDN for the backend service of a
- // global external Application Load Balancer.
+ // EnableCDN: If true, enables Cloud CDN for the backend service of a global
+ // external Application Load Balancer.
EnableCDN bool `json:"enableCDN,omitempty"`
-
- // FailoverPolicy: Requires at least one backend instance group to be
- // defined as a backup (failover) backend. For load balancers that have
- // configurable failover: Internal passthrough Network Load Balancers
+ // FailoverPolicy: Requires at least one backend instance group to be defined
+ // as a backup (failover) backend. For load balancers that have configurable
+ // failover: Internal passthrough Network Load Balancers
// (https://cloud.google.com/load-balancing/docs/internal/failover-overview)
// and external passthrough Network Load Balancers
// (https://cloud.google.com/load-balancing/docs/network/networklb-failover-overview).
FailoverPolicy *BackendServiceFailoverPolicy `json:"failoverPolicy,omitempty"`
-
- // Fingerprint: Fingerprint of this resource. A hash of the contents
- // stored in this object. This field is used in optimistic locking. This
- // field will be ignored when inserting a BackendService. An up-to-date
- // fingerprint must be provided in order to update the BackendService,
- // otherwise the request will fail with error 412 conditionNotMet. To
- // see the latest fingerprint, make a get() request to retrieve a
- // BackendService.
+ // Fingerprint: Fingerprint of this resource. A hash of the contents stored in
+ // this object. This field is used in optimistic locking. This field will be
+ // ignored when inserting a BackendService. An up-to-date fingerprint must be
+ // provided in order to update the BackendService, otherwise the request will
+ // fail with error 412 conditionNotMet. To see the latest fingerprint, make a
+ // get() request to retrieve a BackendService.
Fingerprint string `json:"fingerprint,omitempty"`
-
// HealthChecks: The list of URLs to the healthChecks, httpHealthChecks
- // (legacy), or httpsHealthChecks (legacy) resource for health checking
- // this backend service. Not all backend services support legacy health
- // checks. See Load balancer guide. Currently, at most one health check
- // can be specified for each backend service. Backend services with
- // instance group or zonal NEG backends must have a health check.
- // Backend services with internet or serverless NEG backends must not
- // have a health check.
+ // (legacy), or httpsHealthChecks (legacy) resource for health checking this
+ // backend service. Not all backend services support legacy health checks. See
+ // Load balancer guide. Currently, at most one health check can be specified
+ // for each backend service. Backend services with instance group or zonal NEG
+ // backends must have a health check. Backend services with internet or
+ // serverless NEG backends must not have a health check.
HealthChecks []string `json:"healthChecks,omitempty"`
-
- // Iap: The configurations for Identity-Aware Proxy on this resource.
- // Not available for internal passthrough Network Load Balancers and
- // external passthrough Network Load Balancers.
+ // Iap: The configurations for Identity-Aware Proxy on this resource. Not
+ // available for internal passthrough Network Load Balancers and external
+ // passthrough Network Load Balancers.
Iap *BackendServiceIAP `json:"iap,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
- // Kind: [Output Only] Type of resource. Always compute#backendService
- // for backend services.
+ // IpAddressSelectionPolicy: Specifies a preference for traffic sent from the
+ // proxy to the backend (or from the client to the backend for proxyless gRPC).
+ // The possible values are: - IPV4_ONLY: Only send IPv4 traffic to the backends
+ // of the backend service (Instance Group, Managed Instance Group, Network
+ // Endpoint Group), regardless of traffic from the client to the proxy. Only
+ // IPv4 health checks are used to check the health of the backends. This is the
+ // default setting. - PREFER_IPV6: Prioritize the connection to the endpoint's
+ // IPv6 address over its IPv4 address (provided there is a healthy IPv6
+ // address). - IPV6_ONLY: Only send IPv6 traffic to the backends of the backend
+ // service (Instance Group, Managed Instance Group, Network Endpoint Group),
+ // regardless of traffic from the client to the proxy. Only IPv6 health checks
+ // are used to check the health of the backends. This field is applicable to
+ // either: - Advanced global external Application Load Balancer (load balancing
+ // scheme EXTERNAL_MANAGED), - Regional external Application Load Balancer, -
+ // Internal proxy Network Load Balancer (load balancing scheme
+ // INTERNAL_MANAGED), - Regional internal Application Load Balancer (load
+ // balancing scheme INTERNAL_MANAGED), - Traffic Director with Envoy proxies
+ // and proxyless gRPC (load balancing scheme INTERNAL_SELF_MANAGED).
+ //
+ // Possible values:
+ // "IPV4_ONLY" - Only send IPv4 traffic to the backends of the Backend
+ // Service (Instance Group, Managed Instance Group, Network Endpoint Group)
+ // regardless of traffic from the client to the proxy. Only IPv4 health-checks
+ // are used to check the health of the backends. This is the default setting.
+ // "IPV6_ONLY" - Only send IPv6 traffic to the backends of the Backend
+ // Service (Instance Group, Managed Instance Group, Network Endpoint Group)
+ // regardless of traffic from the client to the proxy. Only IPv6 health-checks
+ // are used to check the health of the backends.
+ // "IP_ADDRESS_SELECTION_POLICY_UNSPECIFIED" - Unspecified IP address
+ // selection policy.
+ // "PREFER_IPV6" - Prioritize the connection to the endpoints IPv6 address
+ // over its IPv4 address (provided there is a healthy IPv6 address).
+ IpAddressSelectionPolicy string `json:"ipAddressSelectionPolicy,omitempty"`
+ // Kind: [Output Only] Type of resource. Always compute#backendService for
+ // backend services.
Kind string `json:"kind,omitempty"`
-
- // LoadBalancingScheme: Specifies the load balancer type. A backend
- // service created for one type of load balancer cannot be used with
- // another. For more information, refer to Choosing a load balancer.
+ // LoadBalancingScheme: Specifies the load balancer type. A backend service
+ // created for one type of load balancer cannot be used with another. For more
+ // information, refer to Choosing a load balancer.
//
// Possible values:
- // "EXTERNAL" - Signifies that this will be used for classic
- // Application Load Balancers, global external proxy Network Load
- // Balancers, or external passthrough Network Load Balancers.
- // "EXTERNAL_MANAGED" - Signifies that this will be used for global
- // external Application Load Balancers, regional external Application
- // Load Balancers, or regional external proxy Network Load Balancers.
- // "INTERNAL" - Signifies that this will be used for internal
+ // "EXTERNAL" - Signifies that this will be used for classic Application Load
+ // Balancers, global external proxy Network Load Balancers, or external
// passthrough Network Load Balancers.
+ // "EXTERNAL_MANAGED" - Signifies that this will be used for global external
+ // Application Load Balancers, regional external Application Load Balancers, or
+ // regional external proxy Network Load Balancers.
+ // "INTERNAL" - Signifies that this will be used for internal passthrough
+ // Network Load Balancers.
// "INTERNAL_MANAGED" - Signifies that this will be used for internal
// Application Load Balancers.
- // "INTERNAL_SELF_MANAGED" - Signifies that this will be used by
- // Traffic Director.
+ // "INTERNAL_SELF_MANAGED" - Signifies that this will be used by Traffic
+ // Director.
// "INVALID_LOAD_BALANCING_SCHEME"
LoadBalancingScheme string `json:"loadBalancingScheme,omitempty"`
-
- // LocalityLbPolicies: A list of locality load-balancing policies to be
- // used in order of preference. When you use localityLbPolicies, you
- // must set at least one value for either the
- // localityLbPolicies[].policy or the localityLbPolicies[].customPolicy
- // field. localityLbPolicies overrides any value set in the
- // localityLbPolicy field. For an example of how to use this field, see
- // Define a list of preferred policies. Caution: This field and its
- // children are intended for use in a service mesh that includes gRPC
- // clients only. Envoy proxies can't use backend services that have this
- // configuration.
+ // LocalityLbPolicies: A list of locality load-balancing policies to be used in
+ // order of preference. When you use localityLbPolicies, you must set at least
+ // one value for either the localityLbPolicies[].policy or the
+ // localityLbPolicies[].customPolicy field. localityLbPolicies overrides any
+ // value set in the localityLbPolicy field. For an example of how to use this
+ // field, see Define a list of preferred policies. Caution: This field and its
+ // children are intended for use in a service mesh that includes gRPC clients
+ // only. Envoy proxies can't use backend services that have this configuration.
LocalityLbPolicies []*BackendServiceLocalityLoadBalancingPolicyConfig `json:"localityLbPolicies,omitempty"`
-
- // LocalityLbPolicy: The load balancing algorithm used within the scope
- // of the locality. The possible values are: - ROUND_ROBIN: This is a
- // simple policy in which each healthy backend is selected in round
- // robin order. This is the default. - LEAST_REQUEST: An O(1) algorithm
- // which selects two random healthy hosts and picks the host which has
- // fewer active requests. - RING_HASH: The ring/modulo hash load
- // balancer implements consistent hashing to backends. The algorithm has
- // the property that the addition/removal of a host from a set of N
- // hosts only affects 1/N of the requests. - RANDOM: The load balancer
- // selects a random healthy host. - ORIGINAL_DESTINATION: Backend host
- // is selected based on the client connection metadata, i.e.,
- // connections are opened to the same address as the destination address
- // of the incoming connection before the connection was redirected to
- // the load balancer. - MAGLEV: used as a drop in replacement for the
- // ring hash load balancer. Maglev is not as stable as ring hash but has
- // faster table lookup build times and host selection times. For more
- // information about Maglev, see
- // https://ai.google/research/pubs/pub44824 This field is applicable to
- // either: - A regional backend service with the service_protocol set to
- // HTTP, HTTPS, or HTTP2, and load_balancing_scheme set to
- // INTERNAL_MANAGED. - A global backend service with the
- // load_balancing_scheme set to INTERNAL_SELF_MANAGED, INTERNAL_MANAGED,
- // or EXTERNAL_MANAGED. If sessionAffinity is not NONE, and this field
- // is not set to MAGLEV or RING_HASH, session affinity settings will not
- // take effect. Only ROUND_ROBIN and RING_HASH are supported when the
- // backend service is referenced by a URL map that is bound to target
+ // LocalityLbPolicy: The load balancing algorithm used within the scope of the
+ // locality. The possible values are: - ROUND_ROBIN: This is a simple policy in
+ // which each healthy backend is selected in round robin order. This is the
+ // default. - LEAST_REQUEST: An O(1) algorithm which selects two random healthy
+ // hosts and picks the host which has fewer active requests. - RING_HASH: The
+ // ring/modulo hash load balancer implements consistent hashing to backends.
+ // The algorithm has the property that the addition/removal of a host from a
+ // set of N hosts only affects 1/N of the requests. - RANDOM: The load balancer
+ // selects a random healthy host. - ORIGINAL_DESTINATION: Backend host is
+ // selected based on the client connection metadata, i.e., connections are
+ // opened to the same address as the destination address of the incoming
+ // connection before the connection was redirected to the load balancer. -
+ // MAGLEV: used as a drop in replacement for the ring hash load balancer.
+ // Maglev is not as stable as ring hash but has faster table lookup build times
+ // and host selection times. For more information about Maglev, see
+ // https://ai.google/research/pubs/pub44824 This field is applicable to either:
+ // - A regional backend service with the service_protocol set to HTTP, HTTPS,
+ // or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED. - A global
+ // backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED,
+ // INTERNAL_MANAGED, or EXTERNAL_MANAGED. If sessionAffinity is not
+ // configured—that is, if session affinity remains at the default value of
+ // NONE—then the default value for localityLbPolicy is ROUND_ROBIN. If
+ // session affinity is set to a value other than NONE, then the default value
+ // for localityLbPolicy is MAGLEV. Only ROUND_ROBIN and RING_HASH are supported
+ // when the backend service is referenced by a URL map that is bound to target
// gRPC proxy that has validateForProxyless field set to true.
//
// Possible values:
// "INVALID_LB_POLICY"
- // "LEAST_REQUEST" - An O(1) algorithm which selects two random
- // healthy hosts and picks the host which has fewer active requests.
- // "MAGLEV" - This algorithm implements consistent hashing to
- // backends. Maglev can be used as a drop in replacement for the ring
- // hash load balancer. Maglev is not as stable as ring hash but has
- // faster table lookup build times and host selection times. For more
- // information about Maglev, see
+ // "LEAST_REQUEST" - An O(1) algorithm which selects two random healthy hosts
+ // and picks the host which has fewer active requests.
+ // "MAGLEV" - This algorithm implements consistent hashing to backends.
+ // Maglev can be used as a drop in replacement for the ring hash load balancer.
+ // Maglev is not as stable as ring hash but has faster table lookup build times
+ // and host selection times. For more information about Maglev, see
// https://ai.google/research/pubs/pub44824
- // "ORIGINAL_DESTINATION" - Backend host is selected based on the
- // client connection metadata, i.e., connections are opened to the same
- // address as the destination address of the incoming connection before
- // the connection was redirected to the load balancer.
+ // "ORIGINAL_DESTINATION" - Backend host is selected based on the client
+ // connection metadata, i.e., connections are opened to the same address as the
+ // destination address of the incoming connection before the connection was
+ // redirected to the load balancer.
// "RANDOM" - The load balancer selects a random healthy host.
- // "RING_HASH" - The ring/modulo hash load balancer implements
- // consistent hashing to backends. The algorithm has the property that
- // the addition/removal of a host from a set of N hosts only affects 1/N
- // of the requests.
- // "ROUND_ROBIN" - This is a simple policy in which each healthy
- // backend is selected in round robin order. This is the default.
- // "WEIGHTED_MAGLEV" - Per-instance weighted Load Balancing via health
- // check reported weights. If set, the Backend Service must configure a
- // non legacy HTTP-based Health Check, and health check replies are
- // expected to contain non-standard HTTP response header field
- // X-Load-Balancing-Endpoint-Weight to specify the per-instance weights.
- // If set, Load Balancing is weighted based on the per-instance weights
- // reported in the last processed health check replies, as long as every
- // instance either reported a valid weight or had UNAVAILABLE_WEIGHT.
- // Otherwise, Load Balancing remains equal-weight. This option is only
- // supported in Network Load Balancing.
+ // "RING_HASH" - The ring/modulo hash load balancer implements consistent
+ // hashing to backends. The algorithm has the property that the
+ // addition/removal of a host from a set of N hosts only affects 1/N of the
+ // requests.
+ // "ROUND_ROBIN" - This is a simple policy in which each healthy backend is
+ // selected in round robin order. This is the default.
+ // "WEIGHTED_MAGLEV" - Per-instance weighted Load Balancing via health check
+ // reported weights. If set, the Backend Service must configure a non legacy
+ // HTTP-based Health Check, and health check replies are expected to contain
+ // non-standard HTTP response header field X-Load-Balancing-Endpoint-Weight to
+ // specify the per-instance weights. If set, Load Balancing is weighted based
+ // on the per-instance weights reported in the last processed health check
+ // replies, as long as every instance either reported a valid weight or had
+ // UNAVAILABLE_WEIGHT. Otherwise, Load Balancing remains equal-weight. This
+ // option is only supported in Network Load Balancing.
LocalityLbPolicy string `json:"localityLbPolicy,omitempty"`
-
- // LogConfig: This field denotes the logging options for the load
- // balancer traffic served by this backend service. If logging is
- // enabled, logs will be exported to Stackdriver.
+ // LogConfig: This field denotes the logging options for the load balancer
+ // traffic served by this backend service. If logging is enabled, logs will be
+ // exported to Stackdriver.
LogConfig *BackendServiceLogConfig `json:"logConfig,omitempty"`
-
- // MaxStreamDuration: Specifies the default maximum duration (timeout)
- // for streams to this service. Duration is computed from the beginning
- // of the stream until the response has been completely processed,
- // including all retries. A stream that does not complete in this
- // duration is closed. If not specified, there will be no timeout limit,
- // i.e. the maximum duration is infinite. This value can be overridden
- // in the PathMatcher configuration of the UrlMap that references this
- // backend service. This field is only allowed when the
- // loadBalancingScheme of the backend service is INTERNAL_SELF_MANAGED.
+ // MaxStreamDuration: Specifies the default maximum duration (timeout) for
+ // streams to this service. Duration is computed from the beginning of the
+ // stream until the response has been completely processed, including all
+ // retries. A stream that does not complete in this duration is closed. If not
+ // specified, there will be no timeout limit, i.e. the maximum duration is
+ // infinite. This value can be overridden in the PathMatcher configuration of
+ // the UrlMap that references this backend service. This field is only allowed
+ // when the loadBalancingScheme of the backend service is
+ // INTERNAL_SELF_MANAGED.
MaxStreamDuration *Duration `json:"maxStreamDuration,omitempty"`
-
- // Metadatas: Deployment metadata associated with the resource to be set
- // by a GKE hub controller and read by the backend RCTH
+ // Metadatas: Deployment metadata associated with the resource to be set by a
+ // GKE hub controller and read by the backend RCTH
Metadatas map[string]string `json:"metadatas,omitempty"`
-
- // Name: Name of the resource. Provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
- // the first character must be a lowercase letter, and all following
- // characters must be a dash, lowercase letter, or digit, except the
- // last character, which cannot be a dash.
+ // Name: Name of the resource. Provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must
+ // be a lowercase letter, and all following characters must be a dash,
+ // lowercase letter, or digit, except the last character, which cannot be a
+ // dash.
Name string `json:"name,omitempty"`
-
- // Network: The URL of the network to which this backend service
- // belongs. This field can only be specified when the load balancing
- // scheme is set to INTERNAL.
+ // Network: The URL of the network to which this backend service belongs. This
+ // field can only be specified when the load balancing scheme is set to
+ // INTERNAL.
Network string `json:"network,omitempty"`
-
- // OutlierDetection: Settings controlling the ejection of unhealthy
- // backend endpoints from the load balancing pool of each individual
- // proxy instance that processes the traffic for the given backend
- // service. If not set, this feature is considered disabled. Results of
- // the outlier detection algorithm (ejection of endpoints from the load
- // balancing pool and returning them back to the pool) are executed
- // independently by each proxy instance of the load balancer. In most
- // cases, more than one proxy instance handles the traffic received by a
- // backend service. Thus, it is possible that an unhealthy endpoint is
- // detected and ejected by only some of the proxies, and while this
- // happens, other proxies may continue to send requests to the same
- // unhealthy endpoint until they detect and eject the unhealthy
- // endpoint. Applicable backend endpoints can be: - VM instances in an
- // Instance Group - Endpoints in a Zonal NEG (GCE_VM_IP, GCE_VM_IP_PORT)
- // - Endpoints in a Hybrid Connectivity NEG (NON_GCP_PRIVATE_IP_PORT) -
- // Serverless NEGs, that resolve to Cloud Run, App Engine, or Cloud
- // Functions Services - Private Service Connect NEGs, that resolve to
- // Google-managed regional API endpoints or managed services published
- // using Private Service Connect Applicable backend service types can
+ // OutlierDetection: Settings controlling the ejection of unhealthy backend
+ // endpoints from the load balancing pool of each individual proxy instance
+ // that processes the traffic for the given backend service. If not set, this
+ // feature is considered disabled. Results of the outlier detection algorithm
+ // (ejection of endpoints from the load balancing pool and returning them back
+ // to the pool) are executed independently by each proxy instance of the load
+ // balancer. In most cases, more than one proxy instance handles the traffic
+ // received by a backend service. Thus, it is possible that an unhealthy
+ // endpoint is detected and ejected by only some of the proxies, and while this
+ // happens, other proxies may continue to send requests to the same unhealthy
+ // endpoint until they detect and eject the unhealthy endpoint. Applicable
+ // backend endpoints can be: - VM instances in an Instance Group - Endpoints in
+ // a Zonal NEG (GCE_VM_IP, GCE_VM_IP_PORT) - Endpoints in a Hybrid Connectivity
+ // NEG (NON_GCP_PRIVATE_IP_PORT) - Serverless NEGs, that resolve to Cloud Run,
+ // App Engine, or Cloud Functions Services - Private Service Connect NEGs, that
+ // resolve to Google-managed regional API endpoints or managed services
+ // published using Private Service Connect Applicable backend service types can
// be: - A global backend service with the loadBalancingScheme set to
- // INTERNAL_SELF_MANAGED or EXTERNAL_MANAGED. - A regional backend
- // service with the serviceProtocol set to HTTP, HTTPS, or HTTP2, and
- // loadBalancingScheme set to INTERNAL_MANAGED or EXTERNAL_MANAGED. Not
- // supported for Serverless NEGs. Not supported when the backend service
- // is referenced by a URL map that is bound to target gRPC proxy that
- // has validateForProxyless field set to true.
+ // INTERNAL_SELF_MANAGED or EXTERNAL_MANAGED. - A regional backend service with
+ // the serviceProtocol set to HTTP, HTTPS, or HTTP2, and loadBalancingScheme
+ // set to INTERNAL_MANAGED or EXTERNAL_MANAGED. Not supported for Serverless
+ // NEGs. Not supported when the backend service is referenced by a URL map that
+ // is bound to target gRPC proxy that has validateForProxyless field set to
+ // true.
OutlierDetection *OutlierDetection `json:"outlierDetection,omitempty"`
-
// Port: Deprecated in favor of portName. The TCP port to connect on the
- // backend. The default value is 80. For internal passthrough Network
- // Load Balancers and external passthrough Network Load Balancers, omit
- // port.
+ // backend. The default value is 80. For internal passthrough Network Load
+ // Balancers and external passthrough Network Load Balancers, omit port.
Port int64 `json:"port,omitempty"`
-
- // PortName: A named port on a backend instance group representing the
- // port for communication to the backend VMs in that group. The named
- // port must be defined on each backend instance group
+ // PortName: A named port on a backend instance group representing the port for
+ // communication to the backend VMs in that group. The named port must be
+ // defined on each backend instance group
// (https://cloud.google.com/load-balancing/docs/backend-service#named_ports).
// This parameter has no meaning if the backends are NEGs. For internal
- // passthrough Network Load Balancers and external passthrough Network
- // Load Balancers, omit port_name.
+ // passthrough Network Load Balancers and external passthrough Network Load
+ // Balancers, omit port_name.
PortName string `json:"portName,omitempty"`
-
// Protocol: The protocol this BackendService uses to communicate with
- // backends. Possible values are HTTP, HTTPS, HTTP2, TCP, SSL, UDP or
- // GRPC. depending on the chosen load balancer or Traffic Director
- // configuration. Refer to the documentation for the load balancers or
- // for Traffic Director for more information. Must be set to GRPC when
- // the backend service is referenced by a URL map that is bound to
- // target gRPC proxy.
+ // backends. Possible values are HTTP, HTTPS, HTTP2, TCP, SSL, UDP or GRPC.
+ // depending on the chosen load balancer or Traffic Director configuration.
+ // Refer to the documentation for the load balancers or for Traffic Director
+ // for more information. Must be set to GRPC when the backend service is
+ // referenced by a URL map that is bound to target gRPC proxy.
//
// Possible values:
// "GRPC" - gRPC (available for Traffic Director).
@@ -5974,561 +5194,464 @@ type BackendService struct {
// "SSL" - TCP proxying with SSL.
// "TCP" - TCP proxying or TCP pass-through.
// "UDP" - UDP.
- // "UNSPECIFIED" - If a Backend Service has UNSPECIFIED as its
- // protocol, it can be used with any L3/L4 Forwarding Rules.
+ // "UNSPECIFIED" - If a Backend Service has UNSPECIFIED as its protocol, it
+ // can be used with any L3/L4 Forwarding Rules.
Protocol string `json:"protocol,omitempty"`
-
- // Region: [Output Only] URL of the region where the regional backend
- // service resides. This field is not applicable to global backend
- // services. You must specify this field as part of the HTTP request
- // URL. It is not settable as a field in the request body.
+ // Region: [Output Only] URL of the region where the regional backend service
+ // resides. This field is not applicable to global backend services. You must
+ // specify this field as part of the HTTP request URL. It is not settable as a
+ // field in the request body.
Region string `json:"region,omitempty"`
-
- // SecurityPolicy: [Output Only] The resource URL for the security
- // policy associated with this backend service.
+ // SecurityPolicy: [Output Only] The resource URL for the security policy
+ // associated with this backend service.
SecurityPolicy string `json:"securityPolicy,omitempty"`
-
- // SecuritySettings: This field specifies the security settings that
- // apply to this backend service. This field is applicable to a global
- // backend service with the load_balancing_scheme set to
- // INTERNAL_SELF_MANAGED.
+ // SecuritySettings: This field specifies the security settings that apply to
+ // this backend service. This field is applicable to a global backend service
+ // with the load_balancing_scheme set to INTERNAL_SELF_MANAGED.
SecuritySettings *SecuritySettings `json:"securitySettings,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // ServiceBindings: URLs of networkservices.ServiceBinding resources.
- // Can only be set if load balancing scheme is INTERNAL_SELF_MANAGED. If
- // set, lists of backends and health checks must be both empty.
+ // ServiceBindings: URLs of networkservices.ServiceBinding resources. Can only
+ // be set if load balancing scheme is INTERNAL_SELF_MANAGED. If set, lists of
+ // backends and health checks must be both empty.
ServiceBindings []string `json:"serviceBindings,omitempty"`
-
- // SessionAffinity: Type of session affinity to use. The default is
- // NONE. Only NONE and HEADER_FIELD are supported when the backend
- // service is referenced by a URL map that is bound to target gRPC proxy
- // that has validateForProxyless field set to true. For more details,
- // see: Session Affinity
+ // ServiceLbPolicy: URL to networkservices.ServiceLbPolicy resource. Can only
+ // be set if load balancing scheme is EXTERNAL, EXTERNAL_MANAGED,
+ // INTERNAL_MANAGED or INTERNAL_SELF_MANAGED and the scope is global.
+ ServiceLbPolicy string `json:"serviceLbPolicy,omitempty"`
+ // SessionAffinity: Type of session affinity to use. The default is NONE. Only
+ // NONE and HEADER_FIELD are supported when the backend service is referenced
+ // by a URL map that is bound to target gRPC proxy that has
+ // validateForProxyless field set to true. For more details, see: Session
+ // Affinity
// (https://cloud.google.com/load-balancing/docs/backend-service#session_affinity).
//
// Possible values:
// "CLIENT_IP" - 2-tuple hash on packet's source and destination IP
// addresses. Connections from the same source IP address to the same
- // destination IP address will be served by the same backend VM while
- // that VM remains healthy.
- // "CLIENT_IP_NO_DESTINATION" - 1-tuple hash only on packet's source
- // IP address. Connections from the same source IP address will be
- // served by the same backend VM while that VM remains healthy. This
- // option can only be used for Internal TCP/UDP Load Balancing.
- // "CLIENT_IP_PORT_PROTO" - 5-tuple hash on packet's source and
- // destination IP addresses, IP protocol, and source and destination
- // ports. Connections for the same IP protocol from the same source IP
- // address and port to the same destination IP address and port will be
- // served by the same backend VM while that VM remains healthy. This
- // option cannot be used for HTTP(S) load balancing.
- // "CLIENT_IP_PROTO" - 3-tuple hash on packet's source and destination
- // IP addresses, and IP protocol. Connections for the same IP protocol
- // from the same source IP address to the same destination IP address
- // will be served by the same backend VM while that VM remains healthy.
- // This option cannot be used for HTTP(S) load balancing.
+ // destination IP address will be served by the same backend VM while that VM
+ // remains healthy.
+ // "CLIENT_IP_NO_DESTINATION" - 1-tuple hash only on packet's source IP
+ // address. Connections from the same source IP address will be served by the
+ // same backend VM while that VM remains healthy. This option can only be used
+ // for Internal TCP/UDP Load Balancing.
+ // "CLIENT_IP_PORT_PROTO" - 5-tuple hash on packet's source and destination
+ // IP addresses, IP protocol, and source and destination ports. Connections for
+ // the same IP protocol from the same source IP address and port to the same
+ // destination IP address and port will be served by the same backend VM while
+ // that VM remains healthy. This option cannot be used for HTTP(S) load
+ // balancing.
+ // "CLIENT_IP_PROTO" - 3-tuple hash on packet's source and destination IP
+ // addresses, and IP protocol. Connections for the same IP protocol from the
+ // same source IP address to the same destination IP address will be served by
+ // the same backend VM while that VM remains healthy. This option cannot be
+ // used for HTTP(S) load balancing.
// "GENERATED_COOKIE" - Hash based on a cookie generated by the L7
// loadbalancer. Only valid for HTTP(S) load balancing.
- // "HEADER_FIELD" - The hash is based on a user specified header
- // field.
+ // "HEADER_FIELD" - The hash is based on a user specified header field.
// "HTTP_COOKIE" - The hash is based on a user provided cookie.
- // "NONE" - No session affinity. Connections from the same client IP
- // may go to any instance in the pool.
+ // "NONE" - No session affinity. Connections from the same client IP may go
+ // to any instance in the pool.
+ // "STRONG_COOKIE_AFFINITY" - Strong cookie-based affinity. Connections
+ // bearing the same cookie will be served by the same backend VM while that VM
+ // remains healthy, as long as the cookie has not expired.
SessionAffinity string `json:"sessionAffinity,omitempty"`
-
- Subsetting *Subsetting `json:"subsetting,omitempty"`
-
- // TimeoutSec: The backend service timeout has a different meaning
- // depending on the type of load balancer. For more information see,
- // Backend service settings. The default is 30 seconds. The full range
- // of timeout values allowed goes from 1 through 2,147,483,647 seconds.
- // This value can be overridden in the PathMatcher configuration of the
- // UrlMap that references this backend service. Not supported when the
- // backend service is referenced by a URL map that is bound to target
- // gRPC proxy that has validateForProxyless field set to true. Instead,
- // use maxStreamDuration.
+ // StrongSessionAffinityCookie: Describes the HTTP cookie used for stateful
+ // session affinity. This field is applicable and required if the
+ // sessionAffinity is set to STRONG_COOKIE_AFFINITY.
+ StrongSessionAffinityCookie *BackendServiceHttpCookie `json:"strongSessionAffinityCookie,omitempty"`
+ Subsetting *Subsetting `json:"subsetting,omitempty"`
+ // TimeoutSec: The backend service timeout has a different meaning depending on
+ // the type of load balancer. For more information see, Backend service
+ // settings. The default is 30 seconds. The full range of timeout values
+ // allowed goes from 1 through 2,147,483,647 seconds. This value can be
+ // overridden in the PathMatcher configuration of the UrlMap that references
+ // this backend service. Not supported when the backend service is referenced
+ // by a URL map that is bound to target gRPC proxy that has
+ // validateForProxyless field set to true. Instead, use maxStreamDuration.
TimeoutSec int64 `json:"timeoutSec,omitempty"`
-
+ // UsedBy: [Output Only] List of resources referencing given backend service.
UsedBy []*BackendServiceUsedBy `json:"usedBy,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g.
- // "AffinityCookieTtlSec") to unconditionally include in API requests.
- // By default, fields with empty or default 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. "AffinityCookieTtlSec") 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.
+ // ForceSendFields is a list of field names (e.g. "AffinityCookieTtlSec") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "AffinityCookieTtlSec") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *BackendService) MarshalJSON() ([]byte, error) {
+func (s BackendService) MarshalJSON() ([]byte, error) {
type NoMethod BackendService
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// BackendServiceAggregatedList: Contains a list of
-// BackendServicesScopedList.
+// BackendServiceAggregatedList: Contains a list of BackendServicesScopedList.
type BackendServiceAggregatedList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of BackendServicesScopedList resources.
Items map[string]BackendServicesScopedList `json:"items,omitempty"`
-
// Kind: Type of resource.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Unreachables: [Output Only] Unreachable resources.
Unreachables []string `json:"unreachables,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *BackendServiceAggregatedListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *BackendServiceAggregatedList) MarshalJSON() ([]byte, error) {
+func (s BackendServiceAggregatedList) MarshalJSON() ([]byte, error) {
type NoMethod BackendServiceAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// BackendServiceAggregatedListWarning: [Output Only] Informational
-// warning message.
+// BackendServiceAggregatedListWarning: [Output Only] Informational warning
+// message.
type BackendServiceAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*BackendServiceAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *BackendServiceAggregatedListWarning) MarshalJSON() ([]byte, error) {
+func (s BackendServiceAggregatedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod BackendServiceAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type BackendServiceAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *BackendServiceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+func (s BackendServiceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod BackendServiceAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// BackendServiceCdnPolicy: Message containing Cloud CDN configuration
-// for a backend service.
+// BackendServiceCdnPolicy: Message containing Cloud CDN configuration for a
+// backend service.
type BackendServiceCdnPolicy struct {
- // BypassCacheOnRequestHeaders: Bypass the cache when the specified
- // request headers are matched - e.g. Pragma or Authorization headers.
- // Up to 5 headers can be specified. The cache is bypassed for all
- // cdnPolicy.cacheMode settings.
+ // BypassCacheOnRequestHeaders: Bypass the cache when the specified request
+ // headers are matched - e.g. Pragma or Authorization headers. Up to 5 headers
+ // can be specified. The cache is bypassed for all cdnPolicy.cacheMode
+ // settings.
BypassCacheOnRequestHeaders []*BackendServiceCdnPolicyBypassCacheOnRequestHeader `json:"bypassCacheOnRequestHeaders,omitempty"`
-
// CacheKeyPolicy: The CacheKeyPolicy for this CdnPolicy.
CacheKeyPolicy *CacheKeyPolicy `json:"cacheKeyPolicy,omitempty"`
-
- // CacheMode: Specifies the cache setting for all responses from this
- // backend. The possible values are: USE_ORIGIN_HEADERS Requires the
- // origin to set valid caching headers to cache content. Responses
- // without these headers will not be cached at Google's edge, and will
- // require a full trip to the origin on every request, potentially
- // impacting performance and increasing load on the origin server.
- // FORCE_CACHE_ALL Cache all content, ignoring any "private", "no-store"
- // or "no-cache" directives in Cache-Control response headers. Warning:
- // this may result in Cloud CDN caching private, per-user (user
- // identifiable) content. CACHE_ALL_STATIC Automatically cache static
- // content, including common image formats, media (video and audio), and
- // web assets (JavaScript and CSS). Requests and responses that are
- // marked as uncacheable, as well as dynamic content (including HTML),
- // will not be cached.
- //
- // Possible values:
- // "CACHE_ALL_STATIC" - Automatically cache static content, including
- // common image formats, media (video and audio), and web assets
- // (JavaScript and CSS). Requests and responses that are marked as
- // uncacheable, as well as dynamic content (including HTML), will not be
- // cached.
- // "FORCE_CACHE_ALL" - Cache all content, ignoring any "private",
- // "no-store" or "no-cache" directives in Cache-Control response
- // headers. Warning: this may result in Cloud CDN caching private,
- // per-user (user identifiable) content.
+ // CacheMode: Specifies the cache setting for all responses from this backend.
+ // The possible values are: USE_ORIGIN_HEADERS Requires the origin to set valid
+ // caching headers to cache content. Responses without these headers will not
+ // be cached at Google's edge, and will require a full trip to the origin on
+ // every request, potentially impacting performance and increasing load on the
+ // origin server. FORCE_CACHE_ALL Cache all content, ignoring any "private",
+ // "no-store" or "no-cache" directives in Cache-Control response headers.
+ // Warning: this may result in Cloud CDN caching private, per-user (user
+ // identifiable) content. CACHE_ALL_STATIC Automatically cache static content,
+ // including common image formats, media (video and audio), and web assets
+ // (JavaScript and CSS). Requests and responses that are marked as uncacheable,
+ // as well as dynamic content (including HTML), will not be cached.
+ //
+ // Possible values:
+ // "CACHE_ALL_STATIC" - Automatically cache static content, including common
+ // image formats, media (video and audio), and web assets (JavaScript and CSS).
+ // Requests and responses that are marked as uncacheable, as well as dynamic
+ // content (including HTML), will not be cached.
+ // "FORCE_CACHE_ALL" - Cache all content, ignoring any "private", "no-store"
+ // or "no-cache" directives in Cache-Control response headers. Warning: this
+ // may result in Cloud CDN caching private, per-user (user identifiable)
+ // content.
// "INVALID_CACHE_MODE"
- // "USE_ORIGIN_HEADERS" - Requires the origin to set valid caching
- // headers to cache content. Responses without these headers will not be
- // cached at Google's edge, and will require a full trip to the origin
- // on every request, potentially impacting performance and increasing
- // load on the origin server.
+ // "USE_ORIGIN_HEADERS" - Requires the origin to set valid caching headers to
+ // cache content. Responses without these headers will not be cached at
+ // Google's edge, and will require a full trip to the origin on every request,
+ // potentially impacting performance and increasing load on the origin server.
CacheMode string `json:"cacheMode,omitempty"`
-
- // ClientTtl: Specifies a separate client (e.g. browser client) maximum
- // TTL. This is used to clamp the max-age (or Expires) value sent to the
- // client. With FORCE_CACHE_ALL, the lesser of client_ttl and
- // default_ttl is used for the response max-age directive, along with a
- // "public" directive. For cacheable content in CACHE_ALL_STATIC mode,
- // client_ttl clamps the max-age from the origin (if specified), or else
- // sets the response max-age directive to the lesser of the client_ttl
- // and default_ttl, and also ensures a "public" cache-control directive
- // is present. If a client TTL is not specified, a default value (1
- // hour) will be used. The maximum allowed value is 31,622,400s (1
- // year).
+ // ClientTtl: Specifies a separate client (e.g. browser client) maximum TTL.
+ // This is used to clamp the max-age (or Expires) value sent to the client.
+ // With FORCE_CACHE_ALL, the lesser of client_ttl and default_ttl is used for
+ // the response max-age directive, along with a "public" directive. For
+ // cacheable content in CACHE_ALL_STATIC mode, client_ttl clamps the max-age
+ // from the origin (if specified), or else sets the response max-age directive
+ // to the lesser of the client_ttl and default_ttl, and also ensures a "public"
+ // cache-control directive is present. If a client TTL is not specified, a
+ // default value (1 hour) will be used. The maximum allowed value is
+ // 31,622,400s (1 year).
ClientTtl int64 `json:"clientTtl,omitempty"`
-
- // DefaultTtl: Specifies the default TTL for cached content served by
- // this origin for responses that do not have an existing valid TTL
- // (max-age or s-max-age). Setting a TTL of "0" means "always
- // revalidate". The value of defaultTTL cannot be set to a value greater
- // than that of maxTTL, but can be equal. When the cacheMode is set to
- // FORCE_CACHE_ALL, the defaultTTL will overwrite the TTL set in all
- // responses. The maximum allowed value is 31,622,400s (1 year), noting
- // that infrequently accessed objects may be evicted from the cache
- // before the defined TTL.
+ // DefaultTtl: Specifies the default TTL for cached content served by this
+ // origin for responses that do not have an existing valid TTL (max-age or
+ // s-max-age). Setting a TTL of "0" means "always revalidate". The value of
+ // defaultTTL cannot be set to a value greater than that of maxTTL, but can be
+ // equal. When the cacheMode is set to FORCE_CACHE_ALL, the defaultTTL will
+ // overwrite the TTL set in all responses. The maximum allowed value is
+ // 31,622,400s (1 year), noting that infrequently accessed objects may be
+ // evicted from the cache before the defined TTL.
DefaultTtl int64 `json:"defaultTtl,omitempty"`
-
- // MaxTtl: Specifies the maximum allowed TTL for cached content served
- // by this origin. Cache directives that attempt to set a max-age or
- // s-maxage higher than this, or an Expires header more than maxTTL
- // seconds in the future will be capped at the value of maxTTL, as if it
- // were the value of an s-maxage Cache-Control directive. Headers sent
- // to the client will not be modified. Setting a TTL of "0" means
- // "always revalidate". The maximum allowed value is 31,622,400s (1
- // year), noting that infrequently accessed objects may be evicted from
- // the cache before the defined TTL.
+ // MaxTtl: Specifies the maximum allowed TTL for cached content served by this
+ // origin. Cache directives that attempt to set a max-age or s-maxage higher
+ // than this, or an Expires header more than maxTTL seconds in the future will
+ // be capped at the value of maxTTL, as if it were the value of an s-maxage
+ // Cache-Control directive. Headers sent to the client will not be modified.
+ // Setting a TTL of "0" means "always revalidate". The maximum allowed value is
+ // 31,622,400s (1 year), noting that infrequently accessed objects may be
+ // evicted from the cache before the defined TTL.
MaxTtl int64 `json:"maxTtl,omitempty"`
-
- // NegativeCaching: Negative caching allows per-status code TTLs to be
- // set, in order to apply fine-grained caching for common errors or
- // redirects. This can reduce the load on your origin and improve
- // end-user experience by reducing response latency. When the cache mode
- // is set to CACHE_ALL_STATIC or USE_ORIGIN_HEADERS, negative caching
- // applies to responses with the specified response code that lack any
- // Cache-Control, Expires, or Pragma: no-cache directives. When the
- // cache mode is set to FORCE_CACHE_ALL, negative caching applies to all
- // responses with the specified response code, and override any caching
- // headers. By default, Cloud CDN will apply the following default TTLs
- // to these status codes: HTTP 300 (Multiple Choice), 301, 308
- // (Permanent Redirects): 10m HTTP 404 (Not Found), 410 (Gone), 451
- // (Unavailable For Legal Reasons): 120s HTTP 405 (Method Not Found),
- // 421 (Misdirected Request), 501 (Not Implemented): 60s. These defaults
- // can be overridden in negative_caching_policy.
+ // NegativeCaching: Negative caching allows per-status code TTLs to be set, in
+ // order to apply fine-grained caching for common errors or redirects. This can
+ // reduce the load on your origin and improve end-user experience by reducing
+ // response latency. When the cache mode is set to CACHE_ALL_STATIC or
+ // USE_ORIGIN_HEADERS, negative caching applies to responses with the specified
+ // response code that lack any Cache-Control, Expires, or Pragma: no-cache
+ // directives. When the cache mode is set to FORCE_CACHE_ALL, negative caching
+ // applies to all responses with the specified response code, and override any
+ // caching headers. By default, Cloud CDN will apply the following default TTLs
+ // to these status codes: HTTP 300 (Multiple Choice), 301, 308 (Permanent
+ // Redirects): 10m HTTP 404 (Not Found), 410 (Gone), 451 (Unavailable For Legal
+ // Reasons): 120s HTTP 405 (Method Not Found), 421 (Misdirected Request), 501
+ // (Not Implemented): 60s. These defaults can be overridden in
+ // negative_caching_policy.
NegativeCaching bool `json:"negativeCaching,omitempty"`
-
- // NegativeCachingPolicy: Sets a cache TTL for the specified HTTP status
- // code. negative_caching must be enabled to configure
- // negative_caching_policy. Omitting the policy and leaving
- // negative_caching enabled will use Cloud CDN's default cache TTLs.
- // Note that when specifying an explicit negative_caching_policy, you
- // should take care to specify a cache TTL for all response codes that
- // you wish to cache. Cloud CDN will not apply any default negative
- // caching when a policy exists.
+ // NegativeCachingPolicy: Sets a cache TTL for the specified HTTP status code.
+ // negative_caching must be enabled to configure negative_caching_policy.
+ // Omitting the policy and leaving negative_caching enabled will use Cloud
+ // CDN's default cache TTLs. Note that when specifying an explicit
+ // negative_caching_policy, you should take care to specify a cache TTL for all
+ // response codes that you wish to cache. Cloud CDN will not apply any default
+ // negative caching when a policy exists.
NegativeCachingPolicy []*BackendServiceCdnPolicyNegativeCachingPolicy `json:"negativeCachingPolicy,omitempty"`
-
- // RequestCoalescing: If true then Cloud CDN will combine multiple
- // concurrent cache fill requests into a small number of requests to the
- // origin.
+ // RequestCoalescing: If true then Cloud CDN will combine multiple concurrent
+ // cache fill requests into a small number of requests to the origin.
RequestCoalescing bool `json:"requestCoalescing,omitempty"`
-
- // ServeWhileStale: Serve existing content from the cache (if available)
- // when revalidating content with the origin, or when an error is
- // encountered when refreshing the cache. This setting defines the
- // default "max-stale" duration for any cached responses that do not
- // specify a max-stale directive. Stale responses that exceed the TTL
- // configured here will not be served. The default limit (max-stale) is
- // 86400s (1 day), which will allow stale content to be served up to
- // this limit beyond the max-age (or s-max-age) of a cached response.
- // The maximum allowed value is 604800 (1 week). Set this to zero (0) to
- // disable serve-while-stale.
+ // ServeWhileStale: Serve existing content from the cache (if available) when
+ // revalidating content with the origin, or when an error is encountered when
+ // refreshing the cache. This setting defines the default "max-stale" duration
+ // for any cached responses that do not specify a max-stale directive. Stale
+ // responses that exceed the TTL configured here will not be served. The
+ // default limit (max-stale) is 86400s (1 day), which will allow stale content
+ // to be served up to this limit beyond the max-age (or s-max-age) of a cached
+ // response. The maximum allowed value is 604800 (1 week). Set this to zero (0)
+ // to disable serve-while-stale.
ServeWhileStale int64 `json:"serveWhileStale,omitempty"`
-
- // SignedUrlCacheMaxAgeSec: Maximum number of seconds the response to a
- // signed URL request will be considered fresh. After this time period,
- // the response will be revalidated before being served. Defaults to 1hr
- // (3600s). When serving responses to signed URL requests, Cloud CDN
- // will internally behave as though all responses from this backend had
- // a "Cache-Control: public, max-age=[TTL]" header, regardless of any
- // existing Cache-Control header. The actual headers served in responses
- // will not be altered.
+ // SignedUrlCacheMaxAgeSec: Maximum number of seconds the response to a signed
+ // URL request will be considered fresh. After this time period, the response
+ // will be revalidated before being served. Defaults to 1hr (3600s). When
+ // serving responses to signed URL requests, Cloud CDN will internally behave
+ // as though all responses from this backend had a "Cache-Control: public,
+ // max-age=[TTL]" header, regardless of any existing Cache-Control header. The
+ // actual headers served in responses will not be altered.
SignedUrlCacheMaxAgeSec int64 `json:"signedUrlCacheMaxAgeSec,omitempty,string"`
-
- // SignedUrlKeyNames: [Output Only] Names of the keys for signing
- // request URLs.
+ // SignedUrlKeyNames: [Output Only] Names of the keys for signing request URLs.
SignedUrlKeyNames []string `json:"signedUrlKeyNames,omitempty"`
-
// ForceSendFields is a list of field names (e.g.
- // "BypassCacheOnRequestHeaders") to unconditionally include in API
- // requests. By default, fields with empty or default 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.
+ // "BypassCacheOnRequestHeaders") to unconditionally include in API requests.
+ // By default, fields with empty or default values are omitted from API
+ // requests. See https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields
+ // for more details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g.
- // "BypassCacheOnRequestHeaders") 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. "BypassCacheOnRequestHeaders") to
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *BackendServiceCdnPolicy) MarshalJSON() ([]byte, error) {
+func (s BackendServiceCdnPolicy) MarshalJSON() ([]byte, error) {
type NoMethod BackendServiceCdnPolicy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// BackendServiceCdnPolicyBypassCacheOnRequestHeader: Bypass the cache
-// when the specified request headers are present, e.g. Pragma or
-// Authorization headers. Values are case insensitive. The presence of
-// such a header overrides the cache_mode setting.
+// BackendServiceCdnPolicyBypassCacheOnRequestHeader: Bypass the cache when the
+// specified request headers are present, e.g. Pragma or Authorization headers.
+// Values are case insensitive. The presence of such a header overrides the
+// cache_mode setting.
type BackendServiceCdnPolicyBypassCacheOnRequestHeader struct {
- // HeaderName: The header field name to match on when bypassing cache.
- // Values are case-insensitive.
+ // HeaderName: The header field name to match on when bypassing cache. Values
+ // are case-insensitive.
HeaderName string `json:"headerName,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "HeaderName") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "HeaderName") 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. "HeaderName") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *BackendServiceCdnPolicyBypassCacheOnRequestHeader) MarshalJSON() ([]byte, error) {
+func (s BackendServiceCdnPolicyBypassCacheOnRequestHeader) MarshalJSON() ([]byte, error) {
type NoMethod BackendServiceCdnPolicyBypassCacheOnRequestHeader
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// BackendServiceCdnPolicyNegativeCachingPolicy: Specify CDN TTLs for
-// response error codes.
+// BackendServiceCdnPolicyNegativeCachingPolicy: Specify CDN TTLs for response
+// error codes.
type BackendServiceCdnPolicyNegativeCachingPolicy struct {
- // Code: The HTTP status code to define a TTL against. Only HTTP status
- // codes 300, 301, 302, 307, 308, 404, 405, 410, 421, 451 and 501 are
- // can be specified as values, and you cannot specify a status code more
- // than once.
+ // Code: The HTTP status code to define a TTL against. Only HTTP status codes
+ // 300, 301, 302, 307, 308, 404, 405, 410, 421, 451 and 501 are can be
+ // specified as values, and you cannot specify a status code more than once.
Code int64 `json:"code,omitempty"`
-
// Ttl: The TTL (in seconds) for which to cache responses with the
- // corresponding status code. The maximum allowed value is 1800s (30
- // minutes), noting that infrequently accessed objects may be evicted
- // from the cache before the defined TTL.
+ // corresponding status code. The maximum allowed value is 1800s (30 minutes),
+ // noting that infrequently accessed objects may be evicted from the cache
+ // before the defined TTL.
Ttl int64 `json:"ttl,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *BackendServiceCdnPolicyNegativeCachingPolicy) MarshalJSON() ([]byte, error) {
+func (s BackendServiceCdnPolicyNegativeCachingPolicy) MarshalJSON() ([]byte, error) {
type NoMethod BackendServiceCdnPolicyNegativeCachingPolicy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// BackendServiceConnectionTrackingPolicy: Connection Tracking
-// configuration for this BackendService.
+// BackendServiceConnectionTrackingPolicy: Connection Tracking configuration
+// for this BackendService.
type BackendServiceConnectionTrackingPolicy struct {
- // ConnectionPersistenceOnUnhealthyBackends: Specifies connection
- // persistence when backends are unhealthy. The default value is
- // DEFAULT_FOR_PROTOCOL. If set to DEFAULT_FOR_PROTOCOL, the existing
- // connections persist on unhealthy backends only for
- // connection-oriented protocols (TCP and SCTP) and only if the Tracking
- // Mode is PER_CONNECTION (default tracking mode) or the Session
- // Affinity is configured for 5-tuple. They do not persist for UDP. If
- // set to NEVER_PERSIST, after a backend becomes unhealthy, the existing
- // connections on the unhealthy backend are never persisted on the
- // unhealthy backend. They are always diverted to newly selected healthy
- // backends (unless all backends are unhealthy). If set to
- // ALWAYS_PERSIST, existing connections always persist on unhealthy
- // backends regardless of protocol and session affinity. It is generally
- // not recommended to use this mode overriding the default. For more
- // details, see Connection Persistence for Network Load Balancing
+ // ConnectionPersistenceOnUnhealthyBackends: Specifies connection persistence
+ // when backends are unhealthy. The default value is DEFAULT_FOR_PROTOCOL. If
+ // set to DEFAULT_FOR_PROTOCOL, the existing connections persist on unhealthy
+ // backends only for connection-oriented protocols (TCP and SCTP) and only if
+ // the Tracking Mode is PER_CONNECTION (default tracking mode) or the Session
+ // Affinity is configured for 5-tuple. They do not persist for UDP. If set to
+ // NEVER_PERSIST, after a backend becomes unhealthy, the existing connections
+ // on the unhealthy backend are never persisted on the unhealthy backend. They
+ // are always diverted to newly selected healthy backends (unless all backends
+ // are unhealthy). If set to ALWAYS_PERSIST, existing connections always
+ // persist on unhealthy backends regardless of protocol and session affinity.
+ // It is generally not recommended to use this mode overriding the default. For
+ // more details, see Connection Persistence for Network Load Balancing
// (https://cloud.google.com/load-balancing/docs/network/networklb-backend-service#connection-persistence)
// and Connection Persistence for Internal TCP/UDP Load Balancing
// (https://cloud.google.com/load-balancing/docs/internal#connection-persistence).
@@ -6538,29 +5661,24 @@ type BackendServiceConnectionTrackingPolicy struct {
// "DEFAULT_FOR_PROTOCOL"
// "NEVER_PERSIST"
ConnectionPersistenceOnUnhealthyBackends string `json:"connectionPersistenceOnUnhealthyBackends,omitempty"`
-
// EnableStrongAffinity: Enable Strong Session Affinity for external
- // passthrough Network Load Balancers. This option is not available
- // publicly.
+ // passthrough Network Load Balancers. This option is not available publicly.
EnableStrongAffinity bool `json:"enableStrongAffinity,omitempty"`
-
- // IdleTimeoutSec: Specifies how long to keep a Connection Tracking
- // entry while there is no matching traffic (in seconds). For internal
- // passthrough Network Load Balancers: - The minimum (default) is 10
- // minutes and the maximum is 16 hours. - It can be set only if
- // Connection Tracking is less than 5-tuple (i.e. Session Affinity is
- // CLIENT_IP_NO_DESTINATION, CLIENT_IP or CLIENT_IP_PROTO, and Tracking
- // Mode is PER_SESSION). For external passthrough Network Load Balancers
- // the default is 60 seconds. This option is not available publicly.
+ // IdleTimeoutSec: Specifies how long to keep a Connection Tracking entry while
+ // there is no matching traffic (in seconds). For internal passthrough Network
+ // Load Balancers: - The minimum (default) is 10 minutes and the maximum is 16
+ // hours. - It can be set only if Connection Tracking is less than 5-tuple
+ // (i.e. Session Affinity is CLIENT_IP_NO_DESTINATION, CLIENT_IP or
+ // CLIENT_IP_PROTO, and Tracking Mode is PER_SESSION). For external passthrough
+ // Network Load Balancers the default is 60 seconds. This option is not
+ // available publicly.
IdleTimeoutSec int64 `json:"idleTimeoutSec,omitempty"`
-
- // TrackingMode: Specifies the key used for connection tracking. There
- // are two options: - PER_CONNECTION: This is the default mode. The
- // Connection Tracking is performed as per the Connection Key (default
- // Hash Method) for the specific protocol. - PER_SESSION: The Connection
- // Tracking is performed as per the configured Session Affinity. It
- // matches the configured Session Affinity. For more details, see
- // Tracking Mode for Network Load Balancing
+ // TrackingMode: Specifies the key used for connection tracking. There are two
+ // options: - PER_CONNECTION: This is the default mode. The Connection Tracking
+ // is performed as per the Connection Key (default Hash Method) for the
+ // specific protocol. - PER_SESSION: The Connection Tracking is performed as
+ // per the configured Session Affinity. It matches the configured Session
+ // Affinity. For more details, see Tracking Mode for Network Load Balancing
// (https://cloud.google.com/load-balancing/docs/network/networklb-backend-service#tracking-mode)
// and Tracking Mode for Internal TCP/UDP Load Balancing
// (https://cloud.google.com/load-balancing/docs/internal#tracking-mode).
@@ -6570,95 +5688,80 @@ type BackendServiceConnectionTrackingPolicy struct {
// "PER_CONNECTION"
// "PER_SESSION"
TrackingMode string `json:"trackingMode,omitempty"`
-
// ForceSendFields is a list of field names (e.g.
- // "ConnectionPersistenceOnUnhealthyBackends") to unconditionally
- // include in API requests. By default, fields with empty or default
- // 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.
+ // "ConnectionPersistenceOnUnhealthyBackends") to unconditionally include in
+ // API requests. By default, fields with empty or default values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g.
- // "ConnectionPersistenceOnUnhealthyBackends") 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.
+ // "ConnectionPersistenceOnUnhealthyBackends") to include in API requests with
+ // the JSON null value. By default, fields with empty values are omitted from
+ // API requests. See https://pkg.go.dev/google.golang.org/api#hdr-NullFields
+ // for more details.
NullFields []string `json:"-"`
}
-func (s *BackendServiceConnectionTrackingPolicy) MarshalJSON() ([]byte, error) {
+func (s BackendServiceConnectionTrackingPolicy) MarshalJSON() ([]byte, error) {
type NoMethod BackendServiceConnectionTrackingPolicy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// BackendServiceFailoverPolicy: For load balancers that have
-// configurable failover: Internal passthrough Network Load Balancers
+// BackendServiceFailoverPolicy: For load balancers that have configurable
+// failover: Internal passthrough Network Load Balancers
// (https://cloud.google.com/load-balancing/docs/internal/failover-overview)
// and external passthrough Network Load Balancers
// (https://cloud.google.com/load-balancing/docs/network/networklb-failover-overview).
-// On failover or failback, this field indicates whether connection
-// draining will be honored. Google Cloud has a fixed connection
-// draining timeout of 10 minutes. A setting of true terminates existing
-// TCP connections to the active pool during failover and failback,
-// immediately draining traffic. A setting of false allows existing TCP
-// connections to persist, even on VMs no longer in the active pool, for
-// up to the duration of the connection draining timeout (10 minutes).
+// On failover or failback, this field indicates whether connection draining
+// will be honored. Google Cloud has a fixed connection draining timeout of 10
+// minutes. A setting of true terminates existing TCP connections to the active
+// pool during failover and failback, immediately draining traffic. A setting
+// of false allows existing TCP connections to persist, even on VMs no longer
+// in the active pool, for up to the duration of the connection draining
+// timeout (10 minutes).
type BackendServiceFailoverPolicy struct {
// DisableConnectionDrainOnFailover: This can be set to true only if the
// protocol is TCP. The default is false.
DisableConnectionDrainOnFailover bool `json:"disableConnectionDrainOnFailover,omitempty"`
-
- // DropTrafficIfUnhealthy: If set to true, connections to the load
- // balancer are dropped when all primary and all backup backend VMs are
- // unhealthy.If set to false, connections are distributed among all
- // primary VMs when all primary and all backup backend VMs are
- // unhealthy. For load balancers that have configurable failover:
- // Internal passthrough Network Load Balancers
+ // DropTrafficIfUnhealthy: If set to true, connections to the load balancer are
+ // dropped when all primary and all backup backend VMs are unhealthy.If set to
+ // false, connections are distributed among all primary VMs when all primary
+ // and all backup backend VMs are unhealthy. For load balancers that have
+ // configurable failover: Internal passthrough Network Load Balancers
// (https://cloud.google.com/load-balancing/docs/internal/failover-overview)
// and external passthrough Network Load Balancers
// (https://cloud.google.com/load-balancing/docs/network/networklb-failover-overview).
// The default is false.
DropTrafficIfUnhealthy bool `json:"dropTrafficIfUnhealthy,omitempty"`
-
- // FailoverRatio: The value of the field must be in the range [0, 1]. If
- // the value is 0, the load balancer performs a failover when the number
- // of healthy primary VMs equals zero. For all other values, the load
- // balancer performs a failover when the total number of healthy primary
- // VMs is less than this ratio. For load balancers that have
- // configurable failover: Internal TCP/UDP Load Balancing
+ // FailoverRatio: The value of the field must be in the range [0, 1]. If the
+ // value is 0, the load balancer performs a failover when the number of healthy
+ // primary VMs equals zero. For all other values, the load balancer performs a
+ // failover when the total number of healthy primary VMs is less than this
+ // ratio. For load balancers that have configurable failover: Internal TCP/UDP
+ // Load Balancing
// (https://cloud.google.com/load-balancing/docs/internal/failover-overview)
// and external TCP/UDP Load Balancing
// (https://cloud.google.com/load-balancing/docs/network/networklb-failover-overview).
FailoverRatio float64 `json:"failoverRatio,omitempty"`
-
// ForceSendFields is a list of field names (e.g.
// "DisableConnectionDrainOnFailover") to unconditionally include in API
- // requests. By default, fields with empty or default 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.
+ // requests. By default, fields with empty or default values are omitted from
+ // API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g.
- // "DisableConnectionDrainOnFailover") 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.
+ // "DisableConnectionDrainOnFailover") to include in API requests with the JSON
+ // null value. By default, fields with empty values are omitted from API
+ // requests. See https://pkg.go.dev/google.golang.org/api#hdr-NullFields for
+ // more details.
NullFields []string `json:"-"`
}
-func (s *BackendServiceFailoverPolicy) MarshalJSON() ([]byte, error) {
+func (s BackendServiceFailoverPolicy) MarshalJSON() ([]byte, error) {
type NoMethod BackendServiceFailoverPolicy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
func (s *BackendServiceFailoverPolicy) UnmarshalJSON(data []byte) error {
@@ -6676,666 +5779,564 @@ func (s *BackendServiceFailoverPolicy) UnmarshalJSON(data []byte) error {
}
type BackendServiceGroupHealth struct {
- // Annotations: Metadata defined as annotations on the network endpoint
- // group.
+ // Annotations: Metadata defined as annotations on the network endpoint group.
Annotations map[string]string `json:"annotations,omitempty"`
-
// HealthStatus: Health state of the backend instances or endpoints in
- // requested instance or network endpoint group, determined based on
- // configured health checks.
+ // requested instance or network endpoint group, determined based on configured
+ // health checks.
HealthStatus []*HealthStatus `json:"healthStatus,omitempty"`
-
// Kind: [Output Only] Type of resource. Always
// compute#backendServiceGroupHealth for the health of backend services.
Kind string `json:"kind,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
// ForceSendFields is a list of field names (e.g. "Annotations") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Annotations") 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. "Annotations") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *BackendServiceGroupHealth) MarshalJSON() ([]byte, error) {
+func (s BackendServiceGroupHealth) MarshalJSON() ([]byte, error) {
type NoMethod BackendServiceGroupHealth
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+// BackendServiceHttpCookie: The HTTP cookie used for stateful session
+// affinity.
+type BackendServiceHttpCookie struct {
+ // Name: Name of the cookie.
+ Name string `json:"name,omitempty"`
+ // Path: Path to set for the cookie.
+ Path string `json:"path,omitempty"`
+ // Ttl: Lifetime of the cookie.
+ Ttl *Duration `json:"ttl,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Name") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ 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. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s BackendServiceHttpCookie) MarshalJSON() ([]byte, error) {
+ type NoMethod BackendServiceHttpCookie
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// BackendServiceIAP: Identity-Aware Proxy
type BackendServiceIAP struct {
- // Enabled: Whether the serving infrastructure will authenticate and
- // authorize all incoming requests.
+ // Enabled: Whether the serving infrastructure will authenticate and authorize
+ // all incoming requests.
Enabled bool `json:"enabled,omitempty"`
-
// Oauth2ClientId: OAuth2 client ID to use for the authentication flow.
Oauth2ClientId string `json:"oauth2ClientId,omitempty"`
-
- // Oauth2ClientSecret: OAuth2 client secret to use for the
- // authentication flow. For security reasons, this value cannot be
- // retrieved via the API. Instead, the SHA-256 hash of the value is
- // returned in the oauth2ClientSecretSha256 field. @InputOnly
+ // Oauth2ClientSecret: OAuth2 client secret to use for the authentication flow.
+ // For security reasons, this value cannot be retrieved via the API. Instead,
+ // the SHA-256 hash of the value is returned in the oauth2ClientSecretSha256
+ // field. @InputOnly
Oauth2ClientSecret string `json:"oauth2ClientSecret,omitempty"`
-
- // Oauth2ClientSecretSha256: [Output Only] SHA256 hash value for the
- // field oauth2_client_secret above.
+ // Oauth2ClientSecretSha256: [Output Only] SHA256 hash value for the field
+ // oauth2_client_secret above.
Oauth2ClientSecretSha256 string `json:"oauth2ClientSecretSha256,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Enabled") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Enabled") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Enabled") 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. "Enabled") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *BackendServiceIAP) MarshalJSON() ([]byte, error) {
+func (s BackendServiceIAP) MarshalJSON() ([]byte, error) {
type NoMethod BackendServiceIAP
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// BackendServiceList: Contains a list of BackendService resources.
type BackendServiceList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of BackendService resources.
Items []*BackendService `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource. Always
- // compute#backendServiceList for lists of backend services.
+ // Kind: [Output Only] Type of resource. Always compute#backendServiceList for
+ // lists of backend services.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *BackendServiceListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *BackendServiceList) MarshalJSON() ([]byte, error) {
+func (s BackendServiceList) MarshalJSON() ([]byte, error) {
type NoMethod BackendServiceList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// BackendServiceListWarning: [Output Only] Informational warning
-// message.
+// BackendServiceListWarning: [Output Only] Informational warning message.
type BackendServiceListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*BackendServiceListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *BackendServiceListWarning) MarshalJSON() ([]byte, error) {
+func (s BackendServiceListWarning) MarshalJSON() ([]byte, error) {
type NoMethod BackendServiceListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type BackendServiceListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *BackendServiceListWarningData) MarshalJSON() ([]byte, error) {
+func (s BackendServiceListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod BackendServiceListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// BackendServiceListUsable: Contains a list of usable BackendService
// resources.
type BackendServiceListUsable struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of BackendService resources.
Items []*BackendService `json:"items,omitempty"`
-
// Kind: [Output Only] Type of resource. Always
- // compute#usableBackendServiceList for lists of usable backend
- // services.
+ // compute#usableBackendServiceList for lists of usable backend services.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *BackendServiceListUsableWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *BackendServiceListUsable) MarshalJSON() ([]byte, error) {
+func (s BackendServiceListUsable) MarshalJSON() ([]byte, error) {
type NoMethod BackendServiceListUsable
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// BackendServiceListUsableWarning: [Output Only] Informational warning
// message.
type BackendServiceListUsableWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*BackendServiceListUsableWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *BackendServiceListUsableWarning) MarshalJSON() ([]byte, error) {
+func (s BackendServiceListUsableWarning) MarshalJSON() ([]byte, error) {
type NoMethod BackendServiceListUsableWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type BackendServiceListUsableWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *BackendServiceListUsableWarningData) MarshalJSON() ([]byte, error) {
+func (s BackendServiceListUsableWarningData) MarshalJSON() ([]byte, error) {
type NoMethod BackendServiceListUsableWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// BackendServiceLocalityLoadBalancingPolicyConfig: Container for either
-// a built-in LB policy supported by gRPC or Envoy or a custom one
-// implemented by the end user.
+// BackendServiceLocalityLoadBalancingPolicyConfig: Container for either a
+// built-in LB policy supported by gRPC or Envoy or a custom one implemented by
+// the end user.
type BackendServiceLocalityLoadBalancingPolicyConfig struct {
CustomPolicy *BackendServiceLocalityLoadBalancingPolicyConfigCustomPolicy `json:"customPolicy,omitempty"`
-
- Policy *BackendServiceLocalityLoadBalancingPolicyConfigPolicy `json:"policy,omitempty"`
-
+ Policy *BackendServiceLocalityLoadBalancingPolicyConfigPolicy `json:"policy,omitempty"`
// ForceSendFields is a list of field names (e.g. "CustomPolicy") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CustomPolicy") 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. "CustomPolicy") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *BackendServiceLocalityLoadBalancingPolicyConfig) MarshalJSON() ([]byte, error) {
+func (s BackendServiceLocalityLoadBalancingPolicyConfig) MarshalJSON() ([]byte, error) {
type NoMethod BackendServiceLocalityLoadBalancingPolicyConfig
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// BackendServiceLocalityLoadBalancingPolicyConfigCustomPolicy: The
-// configuration for a custom policy implemented by the user and
-// deployed with the client.
+// configuration for a custom policy implemented by the user and deployed with
+// the client.
type BackendServiceLocalityLoadBalancingPolicyConfigCustomPolicy struct {
- // Data: An optional, arbitrary JSON object with configuration data,
- // understood by a locally installed custom policy implementation.
+ // Data: An optional, arbitrary JSON object with configuration data, understood
+ // by a locally installed custom policy implementation.
Data string `json:"data,omitempty"`
-
- // Name: Identifies the custom policy. The value should match the name
- // of a custom implementation registered on the gRPC clients. It should
- // follow protocol buffer message naming conventions and include the
- // full path (for example, myorg.CustomLbPolicy). The maximum length is
- // 256 characters. Do not specify the same custom policy more than once
- // for a backend. If you do, the configuration is rejected. For an
- // example of how to use this field, see Use a custom policy.
+ // Name: Identifies the custom policy. The value should match the name of a
+ // custom implementation registered on the gRPC clients. It should follow
+ // protocol buffer message naming conventions and include the full path (for
+ // example, myorg.CustomLbPolicy). The maximum length is 256 characters. Do not
+ // specify the same custom policy more than once for a backend. If you do, the
+ // configuration is rejected. For an example of how to use this field, see Use
+ // a custom policy.
Name string `json:"name,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Data") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Data") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Data") 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. "Data") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *BackendServiceLocalityLoadBalancingPolicyConfigCustomPolicy) MarshalJSON() ([]byte, error) {
+func (s BackendServiceLocalityLoadBalancingPolicyConfigCustomPolicy) MarshalJSON() ([]byte, error) {
type NoMethod BackendServiceLocalityLoadBalancingPolicyConfigCustomPolicy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// BackendServiceLocalityLoadBalancingPolicyConfigPolicy: The
-// configuration for a built-in load balancing policy.
+// BackendServiceLocalityLoadBalancingPolicyConfigPolicy: The configuration for
+// a built-in load balancing policy.
type BackendServiceLocalityLoadBalancingPolicyConfigPolicy struct {
- // Name: The name of a locality load-balancing policy. Valid values
- // include ROUND_ROBIN and, for Java clients, LEAST_REQUEST. For
- // information about these values, see the description of
- // localityLbPolicy. Do not specify the same policy more than once for a
- // backend. If you do, the configuration is rejected.
+ // Name: The name of a locality load-balancing policy. Valid values include
+ // ROUND_ROBIN and, for Java clients, LEAST_REQUEST. For information about
+ // these values, see the description of localityLbPolicy. Do not specify the
+ // same policy more than once for a backend. If you do, the configuration is
+ // rejected.
//
// Possible values:
// "INVALID_LB_POLICY"
- // "LEAST_REQUEST" - An O(1) algorithm which selects two random
- // healthy hosts and picks the host which has fewer active requests.
- // "MAGLEV" - This algorithm implements consistent hashing to
- // backends. Maglev can be used as a drop in replacement for the ring
- // hash load balancer. Maglev is not as stable as ring hash but has
- // faster table lookup build times and host selection times. For more
- // information about Maglev, see
+ // "LEAST_REQUEST" - An O(1) algorithm which selects two random healthy hosts
+ // and picks the host which has fewer active requests.
+ // "MAGLEV" - This algorithm implements consistent hashing to backends.
+ // Maglev can be used as a drop in replacement for the ring hash load balancer.
+ // Maglev is not as stable as ring hash but has faster table lookup build times
+ // and host selection times. For more information about Maglev, see
// https://ai.google/research/pubs/pub44824
- // "ORIGINAL_DESTINATION" - Backend host is selected based on the
- // client connection metadata, i.e., connections are opened to the same
- // address as the destination address of the incoming connection before
- // the connection was redirected to the load balancer.
+ // "ORIGINAL_DESTINATION" - Backend host is selected based on the client
+ // connection metadata, i.e., connections are opened to the same address as the
+ // destination address of the incoming connection before the connection was
+ // redirected to the load balancer.
// "RANDOM" - The load balancer selects a random healthy host.
- // "RING_HASH" - The ring/modulo hash load balancer implements
- // consistent hashing to backends. The algorithm has the property that
- // the addition/removal of a host from a set of N hosts only affects 1/N
- // of the requests.
- // "ROUND_ROBIN" - This is a simple policy in which each healthy
- // backend is selected in round robin order. This is the default.
- // "WEIGHTED_MAGLEV" - Per-instance weighted Load Balancing via health
- // check reported weights. If set, the Backend Service must configure a
- // non legacy HTTP-based Health Check, and health check replies are
- // expected to contain non-standard HTTP response header field
- // X-Load-Balancing-Endpoint-Weight to specify the per-instance weights.
- // If set, Load Balancing is weighted based on the per-instance weights
- // reported in the last processed health check replies, as long as every
- // instance either reported a valid weight or had UNAVAILABLE_WEIGHT.
- // Otherwise, Load Balancing remains equal-weight. This option is only
- // supported in Network Load Balancing.
+ // "RING_HASH" - The ring/modulo hash load balancer implements consistent
+ // hashing to backends. The algorithm has the property that the
+ // addition/removal of a host from a set of N hosts only affects 1/N of the
+ // requests.
+ // "ROUND_ROBIN" - This is a simple policy in which each healthy backend is
+ // selected in round robin order. This is the default.
+ // "WEIGHTED_MAGLEV" - Per-instance weighted Load Balancing via health check
+ // reported weights. If set, the Backend Service must configure a non legacy
+ // HTTP-based Health Check, and health check replies are expected to contain
+ // non-standard HTTP response header field X-Load-Balancing-Endpoint-Weight to
+ // specify the per-instance weights. If set, Load Balancing is weighted based
+ // on the per-instance weights reported in the last processed health check
+ // replies, as long as every instance either reported a valid weight or had
+ // UNAVAILABLE_WEIGHT. Otherwise, Load Balancing remains equal-weight. This
+ // option is only supported in Network Load Balancing.
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 or default 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 is a list of field names (e.g. "Name") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
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 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. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *BackendServiceLocalityLoadBalancingPolicyConfigPolicy) MarshalJSON() ([]byte, error) {
+func (s BackendServiceLocalityLoadBalancingPolicyConfigPolicy) MarshalJSON() ([]byte, error) {
type NoMethod BackendServiceLocalityLoadBalancingPolicyConfigPolicy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// BackendServiceLogConfig: The available logging options for the load
-// balancer traffic served by this backend service.
+// BackendServiceLogConfig: The available logging options for the load balancer
+// traffic served by this backend service.
type BackendServiceLogConfig struct {
- // Enable: Denotes whether to enable logging for the load balancer
- // traffic served by this backend service. The default value is false.
+ // Enable: Denotes whether to enable logging for the load balancer traffic
+ // served by this backend service. The default value is false.
Enable bool `json:"enable,omitempty"`
-
- // OptionalFields: This field can only be specified if logging is
- // enabled for this backend service and "logConfig.optionalMode" was set
- // to CUSTOM. Contains a list of optional fields you want to include in
- // the logs. For example: serverInstance, serverGkeDetails.cluster,
+ // OptionalFields: This field can only be specified if logging is enabled for
+ // this backend service and "logConfig.optionalMode" was set to CUSTOM.
+ // Contains a list of optional fields you want to include in the logs. For
+ // example: serverInstance, serverGkeDetails.cluster,
// serverGkeDetails.pod.podNamespace
OptionalFields []string `json:"optionalFields,omitempty"`
-
- // OptionalMode: This field can only be specified if logging is enabled
- // for this backend service. Configures whether all, none or a subset of
- // optional fields should be added to the reported logs. One of
- // [INCLUDE_ALL_OPTIONAL, EXCLUDE_ALL_OPTIONAL, CUSTOM]. Default is
- // EXCLUDE_ALL_OPTIONAL.
+ // OptionalMode: This field can only be specified if logging is enabled for
+ // this backend service. Configures whether all, none or a subset of optional
+ // fields should be added to the reported logs. One of [INCLUDE_ALL_OPTIONAL,
+ // EXCLUDE_ALL_OPTIONAL, CUSTOM]. Default is EXCLUDE_ALL_OPTIONAL.
//
// Possible values:
// "CUSTOM" - A subset of optional fields.
// "EXCLUDE_ALL_OPTIONAL" - None optional fields.
// "INCLUDE_ALL_OPTIONAL" - All optional fields.
OptionalMode string `json:"optionalMode,omitempty"`
-
- // SampleRate: This field can only be specified if logging is enabled
- // for this backend service. The value of the field must be in [0, 1].
- // This configures the sampling rate of requests to the load balancer
- // where 1.0 means all logged requests are reported and 0.0 means no
- // logged requests are reported. The default value is 1.0.
+ // SampleRate: This field can only be specified if logging is enabled for this
+ // backend service. The value of the field must be in [0, 1]. This configures
+ // the sampling rate of requests to the load balancer where 1.0 means all
+ // logged requests are reported and 0.0 means no logged requests are reported.
+ // The default value is 1.0.
SampleRate float64 `json:"sampleRate,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Enable") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Enable") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Enable") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *BackendServiceLogConfig) MarshalJSON() ([]byte, error) {
+func (s BackendServiceLogConfig) MarshalJSON() ([]byte, error) {
type NoMethod BackendServiceLogConfig
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
func (s *BackendServiceLogConfig) UnmarshalJSON(data []byte) error {
@@ -7354,245 +6355,200 @@ func (s *BackendServiceLogConfig) UnmarshalJSON(data []byte) error {
type BackendServiceReference struct {
BackendService string `json:"backendService,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "BackendService") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "BackendService") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "BackendService") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *BackendServiceReference) MarshalJSON() ([]byte, error) {
+func (s BackendServiceReference) MarshalJSON() ([]byte, error) {
type NoMethod BackendServiceReference
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type BackendServiceUsedBy struct {
+ // Reference: [Output Only] Server-defined URL for resources referencing given
+ // BackendService like UrlMaps, TargetTcpProxies, TargetSslProxies and
+ // ForwardingRule.
Reference string `json:"reference,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Reference") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Reference") 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. "Reference") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *BackendServiceUsedBy) MarshalJSON() ([]byte, error) {
+func (s BackendServiceUsedBy) MarshalJSON() ([]byte, error) {
type NoMethod BackendServiceUsedBy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type BackendServicesScopedList struct {
// BackendServices: A list of BackendServices contained in this scope.
BackendServices []*BackendService `json:"backendServices,omitempty"`
-
- // Warning: Informational warning which replaces the list of backend
- // services when the list is empty.
+ // Warning: Informational warning which replaces the list of backend services
+ // when the list is empty.
Warning *BackendServicesScopedListWarning `json:"warning,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "BackendServices") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "BackendServices") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "BackendServices") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *BackendServicesScopedList) MarshalJSON() ([]byte, error) {
+func (s BackendServicesScopedList) MarshalJSON() ([]byte, error) {
type NoMethod BackendServicesScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// BackendServicesScopedListWarning: Informational warning which
-// replaces the list of backend services when the list is empty.
+// BackendServicesScopedListWarning: Informational warning which replaces the
+// list of backend services when the list is empty.
type BackendServicesScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*BackendServicesScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *BackendServicesScopedListWarning) MarshalJSON() ([]byte, error) {
+func (s BackendServicesScopedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod BackendServicesScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type BackendServicesScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *BackendServicesScopedListWarningData) MarshalJSON() ([]byte, error) {
+func (s BackendServicesScopedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod BackendServicesScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type BfdPacket struct {
- // AuthenticationPresent: The Authentication Present bit of the BFD
- // packet. This is specified in section 4.1 of RFC5880
+ // AuthenticationPresent: The Authentication Present bit of the BFD packet.
+ // This is specified in section 4.1 of RFC5880
AuthenticationPresent bool `json:"authenticationPresent,omitempty"`
-
// ControlPlaneIndependent: The Control Plane Independent bit of the BFD
// packet. This is specified in section 4.1 of RFC5880
ControlPlaneIndependent bool `json:"controlPlaneIndependent,omitempty"`
-
- // Demand: The demand bit of the BFD packet. This is specified in
- // section 4.1 of RFC5880
+ // Demand: The demand bit of the BFD packet. This is specified in section 4.1
+ // of RFC5880
Demand bool `json:"demand,omitempty"`
-
- // Diagnostic: The diagnostic code specifies the local system's reason
- // for the last change in session state. This allows remote systems to
- // determine the reason that the previous session failed, for example.
- // These diagnostic codes are specified in section 4.1 of RFC5880
+ // Diagnostic: The diagnostic code specifies the local system's reason for the
+ // last change in session state. This allows remote systems to determine the
+ // reason that the previous session failed, for example. These diagnostic codes
+ // are specified in section 4.1 of RFC5880
//
// Possible values:
// "ADMINISTRATIVELY_DOWN"
@@ -7606,45 +6562,35 @@ type BfdPacket struct {
// "PATH_DOWN"
// "REVERSE_CONCATENATED_PATH_DOWN"
Diagnostic string `json:"diagnostic,omitempty"`
-
- // Final: The Final bit of the BFD packet. This is specified in section
- // 4.1 of RFC5880
+ // Final: The Final bit of the BFD packet. This is specified in section 4.1 of
+ // RFC5880
Final bool `json:"final,omitempty"`
-
- // Length: The length of the BFD Control packet in bytes. This is
- // specified in section 4.1 of RFC5880
+ // Length: The length of the BFD Control packet in bytes. This is specified in
+ // section 4.1 of RFC5880
Length int64 `json:"length,omitempty"`
-
- // MinEchoRxIntervalMs: The Required Min Echo RX Interval value in the
- // BFD packet. This is specified in section 4.1 of RFC5880
- MinEchoRxIntervalMs int64 `json:"minEchoRxIntervalMs,omitempty"`
-
- // MinRxIntervalMs: The Required Min RX Interval value in the BFD
+ // MinEchoRxIntervalMs: The Required Min Echo RX Interval value in the BFD
// packet. This is specified in section 4.1 of RFC5880
+ MinEchoRxIntervalMs int64 `json:"minEchoRxIntervalMs,omitempty"`
+ // MinRxIntervalMs: The Required Min RX Interval value in the BFD packet. This
+ // is specified in section 4.1 of RFC5880
MinRxIntervalMs int64 `json:"minRxIntervalMs,omitempty"`
-
- // MinTxIntervalMs: The Desired Min TX Interval value in the BFD packet.
- // This is specified in section 4.1 of RFC5880
+ // MinTxIntervalMs: The Desired Min TX Interval value in the BFD packet. This
+ // is specified in section 4.1 of RFC5880
MinTxIntervalMs int64 `json:"minTxIntervalMs,omitempty"`
-
// Multiplier: The detection time multiplier of the BFD packet. This is
// specified in section 4.1 of RFC5880
Multiplier int64 `json:"multiplier,omitempty"`
-
- // Multipoint: The multipoint bit of the BFD packet. This is specified
- // in section 4.1 of RFC5880
+ // Multipoint: The multipoint bit of the BFD packet. This is specified in
+ // section 4.1 of RFC5880
Multipoint bool `json:"multipoint,omitempty"`
-
- // MyDiscriminator: The My Discriminator value in the BFD packet. This
- // is specified in section 4.1 of RFC5880
+ // MyDiscriminator: The My Discriminator value in the BFD packet. This is
+ // specified in section 4.1 of RFC5880
MyDiscriminator int64 `json:"myDiscriminator,omitempty"`
-
- // Poll: The Poll bit of the BFD packet. This is specified in section
- // 4.1 of RFC5880
+ // Poll: The Poll bit of the BFD packet. This is specified in section 4.1 of
+ // RFC5880
Poll bool `json:"poll,omitempty"`
-
- // State: The current BFD session state as seen by the transmitting
- // system. These states are specified in section 4.1 of RFC5880
+ // State: The current BFD session state as seen by the transmitting system.
+ // These states are specified in section 4.1 of RFC5880
//
// Possible values:
// "ADMIN_DOWN"
@@ -7653,71 +6599,55 @@ type BfdPacket struct {
// "STATE_UNSPECIFIED"
// "UP"
State string `json:"state,omitempty"`
-
- // Version: The version number of the BFD protocol, as specified in
- // section 4.1 of RFC5880.
+ // Version: The version number of the BFD protocol, as specified in section 4.1
+ // of RFC5880.
Version int64 `json:"version,omitempty"`
-
- // YourDiscriminator: The Your Discriminator value in the BFD packet.
- // This is specified in section 4.1 of RFC5880
+ // YourDiscriminator: The Your Discriminator value in the BFD packet. This is
+ // specified in section 4.1 of RFC5880
YourDiscriminator int64 `json:"yourDiscriminator,omitempty"`
-
- // ForceSendFields is a list of field names (e.g.
- // "AuthenticationPresent") to unconditionally include in API requests.
- // By default, fields with empty or default 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 is a list of field names (e.g. "AuthenticationPresent") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "AuthenticationPresent") 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.
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *BfdPacket) MarshalJSON() ([]byte, error) {
+func (s BfdPacket) MarshalJSON() ([]byte, error) {
type NoMethod BfdPacket
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// BfdStatus: Next free: 15
type BfdStatus struct {
- // BfdSessionInitializationMode: The BFD session initialization mode for
- // this BGP peer. If set to ACTIVE, the Cloud Router will initiate the
- // BFD session for this BGP peer. If set to PASSIVE, the Cloud Router
- // will wait for the peer router to initiate the BFD session for this
- // BGP peer. If set to DISABLED, BFD is disabled for this BGP peer.
+ // BfdSessionInitializationMode: The BFD session initialization mode for this
+ // BGP peer. If set to ACTIVE, the Cloud Router will initiate the BFD session
+ // for this BGP peer. If set to PASSIVE, the Cloud Router will wait for the
+ // peer router to initiate the BFD session for this BGP peer. If set to
+ // DISABLED, BFD is disabled for this BGP peer.
//
// Possible values:
// "ACTIVE"
// "DISABLED"
// "PASSIVE"
BfdSessionInitializationMode string `json:"bfdSessionInitializationMode,omitempty"`
-
// ConfigUpdateTimestampMicros: Unix timestamp of the most recent config
// update.
ConfigUpdateTimestampMicros int64 `json:"configUpdateTimestampMicros,omitempty,string"`
-
- // ControlPacketCounts: Control packet counts for the current BFD
- // session.
+ // ControlPacketCounts: Control packet counts for the current BFD session.
ControlPacketCounts *BfdStatusPacketCounts `json:"controlPacketCounts,omitempty"`
-
- // ControlPacketIntervals: Inter-packet time interval statistics for
- // control packets.
+ // ControlPacketIntervals: Inter-packet time interval statistics for control
+ // packets.
ControlPacketIntervals []*PacketIntervals `json:"controlPacketIntervals,omitempty"`
-
- // LocalDiagnostic: The diagnostic code specifies the local system's
- // reason for the last change in session state. This allows remote
- // systems to determine the reason that the previous session failed, for
- // example. These diagnostic codes are specified in section 4.1 of
- // RFC5880
+ // LocalDiagnostic: The diagnostic code specifies the local system's reason for
+ // the last change in session state. This allows remote systems to determine
+ // the reason that the previous session failed, for example. These diagnostic
+ // codes are specified in section 4.1 of RFC5880
//
// Possible values:
// "ADMINISTRATIVELY_DOWN"
@@ -7731,7 +6661,6 @@ type BfdStatus struct {
// "PATH_DOWN"
// "REVERSE_CONCATENATED_PATH_DOWN"
LocalDiagnostic string `json:"localDiagnostic,omitempty"`
-
// LocalState: The current BFD session state as seen by the transmitting
// system. These states are specified in section 4.1 of RFC5880
//
@@ -7742,359 +6671,291 @@ type BfdStatus struct {
// "STATE_UNSPECIFIED"
// "UP"
LocalState string `json:"localState,omitempty"`
-
- // NegotiatedLocalControlTxIntervalMs: Negotiated transmit interval for
- // control packets.
+ // NegotiatedLocalControlTxIntervalMs: Negotiated transmit interval for control
+ // packets.
NegotiatedLocalControlTxIntervalMs int64 `json:"negotiatedLocalControlTxIntervalMs,omitempty"`
-
// RxPacket: The most recent Rx control packet for this BFD session.
RxPacket *BfdPacket `json:"rxPacket,omitempty"`
-
// TxPacket: The most recent Tx control packet for this BFD session.
TxPacket *BfdPacket `json:"txPacket,omitempty"`
-
- // UptimeMs: Session uptime in milliseconds. Value will be 0 if session
- // is not up.
+ // UptimeMs: Session uptime in milliseconds. Value will be 0 if session is not
+ // up.
UptimeMs int64 `json:"uptimeMs,omitempty,string"`
-
// ForceSendFields is a list of field names (e.g.
- // "BfdSessionInitializationMode") to unconditionally include in API
- // requests. By default, fields with empty or default 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.
+ // "BfdSessionInitializationMode") to unconditionally include in API requests.
+ // By default, fields with empty or default values are omitted from API
+ // requests. See https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields
+ // for more details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g.
- // "BfdSessionInitializationMode") 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. "BfdSessionInitializationMode") to
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *BfdStatus) MarshalJSON() ([]byte, error) {
+func (s BfdStatus) MarshalJSON() ([]byte, error) {
type NoMethod BfdStatus
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type BfdStatusPacketCounts struct {
- // NumRx: Number of packets received since the beginning of the current
- // BFD session.
+ // NumRx: Number of packets received since the beginning of the current BFD
+ // session.
NumRx int64 `json:"numRx,omitempty"`
-
- // NumRxRejected: Number of packets received that were rejected because
- // of errors since the beginning of the current BFD session.
+ // NumRxRejected: Number of packets received that were rejected because of
+ // errors since the beginning of the current BFD session.
NumRxRejected int64 `json:"numRxRejected,omitempty"`
-
- // NumRxSuccessful: Number of packets received that were successfully
- // processed since the beginning of the current BFD session.
+ // NumRxSuccessful: Number of packets received that were successfully processed
+ // since the beginning of the current BFD session.
NumRxSuccessful int64 `json:"numRxSuccessful,omitempty"`
-
- // NumTx: Number of packets transmitted since the beginning of the
- // current BFD session.
+ // NumTx: Number of packets transmitted since the beginning of the current BFD
+ // session.
NumTx int64 `json:"numTx,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "NumRx") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "NumRx") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "NumRx") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *BfdStatusPacketCounts) MarshalJSON() ([]byte, error) {
+func (s BfdStatusPacketCounts) MarshalJSON() ([]byte, error) {
type NoMethod BfdStatusPacketCounts
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// Binding: Associates `members`, or principals, with a `role`.
type Binding struct {
- // BindingId: This is deprecated and has no effect. Do not use.
- BindingId string `json:"bindingId,omitempty"`
-
// Condition: The condition that is associated with this binding. If the
- // condition evaluates to `true`, then this binding applies to the
- // current request. If the condition evaluates to `false`, then this
- // binding does not apply to the current request. However, a different
- // role binding might grant the same role to one or more of the
- // principals in this binding. To learn which resources support
- // conditions in their IAM policies, see the IAM documentation
+ // condition evaluates to `true`, then this binding applies to the current
+ // request. If the condition evaluates to `false`, then this binding does not
+ // apply to the current request. However, a different role binding might grant
+ // the same role to one or more of the principals in this binding. To learn
+ // which resources support conditions in their IAM policies, see the IAM
+ // documentation
// (https://cloud.google.com/iam/help/conditions/resource-policies).
Condition *Expr `json:"condition,omitempty"`
-
- // Members: Specifies the principals requesting access for a Google
- // Cloud resource. `members` can have the following values: *
- // `allUsers`: A special identifier that represents anyone who is on the
- // internet; with or without a Google account. *
- // `allAuthenticatedUsers`: A special identifier that represents anyone
- // who is authenticated with a Google account or a service account. Does
- // not include identities that come from external identity providers
- // (IdPs) through identity federation. * `user:{emailid}`: An email
+ // Members: Specifies the principals requesting access for a Google Cloud
+ // resource. `members` can have the following values: * `allUsers`: A special
+ // identifier that represents anyone who is on the internet; with or without a
+ // Google account. * `allAuthenticatedUsers`: A special identifier that
+ // represents anyone who is authenticated with a Google account or a service
+ // account. Does not include identities that come from external identity
+ // providers (IdPs) through identity federation. * `user:{emailid}`: An email
// address that represents a specific Google account. For example,
- // `alice@example.com` . * `serviceAccount:{emailid}`: An email address
- // that represents a Google service account. For example,
+ // `alice@example.com` . * `serviceAccount:{emailid}`: An email address that
+ // represents a Google service account. For example,
// `my-other-app@appspot.gserviceaccount.com`. *
- // `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`:
- // An identifier for a Kubernetes service account
+ // `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An
+ // identifier for a Kubernetes service account
// (https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts).
- // For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`.
- // * `group:{emailid}`: An email address that represents a Google group.
- // For example, `admins@example.com`. * `domain:{domain}`: The G Suite
- // domain (primary) that represents all the users of that domain. For
- // example, `google.com` or `example.com`. *
- // `principal://iam.googleapis.com/locations/global/workforcePools/{pool_
- // id}/subject/{subject_attribute_value}`: A single identity in a
- // workforce identity pool. *
- // `principalSet://iam.googleapis.com/locations/global/workforcePools/{po
- // ol_id}/group/{group_id}`: All workforce identities in a group. *
- // `principalSet://iam.googleapis.com/locations/global/workforcePools/{po
- // ol_id}/attribute.{attribute_name}/{attribute_value}`: All workforce
- // identities with a specific attribute value. *
- // `principalSet://iam.googleapis.com/locations/global/workforcePools/{po
- // ol_id}/*`: All identities in a workforce identity pool. *
- // `principal://iam.googleapis.com/projects/{project_number}/locations/gl
- // obal/workloadIdentityPools/{pool_id}/subject/{subject_attribute_value}
- // `: A single identity in a workload identity pool. *
- // `principalSet://iam.googleapis.com/projects/{project_number}/locations
- // /global/workloadIdentityPools/{pool_id}/group/{group_id}`: A workload
- // identity pool group. *
- // `principalSet://iam.googleapis.com/projects/{project_number}/locations
- // /global/workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{at
- // tribute_value}`: All identities in a workload identity pool with a
- // certain attribute. *
- // `principalSet://iam.googleapis.com/projects/{project_number}/locations
- // /global/workloadIdentityPools/{pool_id}/*`: All identities in a
- // workload identity pool. * `deleted:user:{emailid}?uid={uniqueid}`: An
- // email address (plus unique identifier) representing a user that has
- // been recently deleted. For example,
- // `alice@example.com?uid=123456789012345678901`. If the user is
- // recovered, this value reverts to `user:{emailid}` and the recovered
- // user retains the role in the binding. *
- // `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address
- // (plus unique identifier) representing a service account that has been
+ // For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. *
+ // `group:{emailid}`: An email address that represents a Google group. For
+ // example, `admins@example.com`. * `domain:{domain}`: The G Suite domain
+ // (primary) that represents all the users of that domain. For example,
+ // `google.com` or `example.com`. *
+ // `principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/sub
+ // ject/{subject_attribute_value}`: A single identity in a workforce identity
+ // pool. *
+ // `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
+ // group/{group_id}`: All workforce identities in a group. *
+ // `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
+ // attribute.{attribute_name}/{attribute_value}`: All workforce identities with
+ // a specific attribute value. *
+ // `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
+ // *`: All identities in a workforce identity pool. *
+ // `principal://iam.googleapis.com/projects/{project_number}/locations/global/wo
+ // rkloadIdentityPools/{pool_id}/subject/{subject_attribute_value}`: A single
+ // identity in a workload identity pool. *
+ // `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
+ // /workloadIdentityPools/{pool_id}/group/{group_id}`: A workload identity pool
+ // group. *
+ // `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
+ // /workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value}
+ // `: All identities in a workload identity pool with a certain attribute. *
+ // `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
+ // /workloadIdentityPools/{pool_id}/*`: All identities in a workload identity
+ // pool. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus
+ // unique identifier) representing a user that has been recently deleted. For
+ // example, `alice@example.com?uid=123456789012345678901`. If the user is
+ // recovered, this value reverts to `user:{emailid}` and the recovered user
+ // retains the role in the binding. *
+ // `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
+ // unique identifier) representing a service account that has been recently
+ // deleted. For example,
+ // `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the
+ // service account is undeleted, this value reverts to
+ // `serviceAccount:{emailid}` and the undeleted service account retains the
+ // role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email
+ // address (plus unique identifier) representing a Google group that has been
// recently deleted. For example,
- // `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
- // If the service account is undeleted, this value reverts to
- // `serviceAccount:{emailid}` and the undeleted service account retains
- // the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`:
- // An email address (plus unique identifier) representing a Google group
- // that has been recently deleted. For example,
- // `admins@example.com?uid=123456789012345678901`. If the group is
- // recovered, this value reverts to `group:{emailid}` and the recovered
- // group retains the role in the binding. *
- // `deleted:principal://iam.googleapis.com/locations/global/workforcePool
- // s/{pool_id}/subject/{subject_attribute_value}`: Deleted single
- // identity in a workforce identity pool. For example,
- // `deleted:principal://iam.googleapis.com/locations/global/workforcePool
- // s/my-pool-id/subject/my-subject-attribute-value`.
+ // `admins@example.com?uid=123456789012345678901`. If the group is recovered,
+ // this value reverts to `group:{emailid}` and the recovered group retains the
+ // role in the binding. *
+ // `deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool
+ // _id}/subject/{subject_attribute_value}`: Deleted single identity in a
+ // workforce identity pool. For example,
+ // `deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-po
+ // ol-id/subject/my-subject-attribute-value`.
Members []string `json:"members,omitempty"`
-
- // Role: Role that is assigned to the list of `members`, or principals.
- // For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
+ // Role: Role that is assigned to the list of `members`, or principals. For
+ // example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview
+ // of the IAM roles and permissions, see the IAM documentation
+ // (https://cloud.google.com/iam/docs/roles-overview). For a list of the
+ // available pre-defined roles, see here
+ // (https://cloud.google.com/iam/docs/understanding-roles).
Role string `json:"role,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "BindingId") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Condition") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "BindingId") 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. "Condition") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *Binding) MarshalJSON() ([]byte, error) {
+func (s Binding) MarshalJSON() ([]byte, error) {
type NoMethod Binding
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// BulkInsertDiskResource: A transient resource used in
-// compute.disks.bulkInsert and compute.regionDisks.bulkInsert. It is
-// only used to process requests and is not persisted.
+// compute.disks.bulkInsert and compute.regionDisks.bulkInsert. It is only used
+// to process requests and is not persisted.
type BulkInsertDiskResource struct {
- // SourceConsistencyGroupPolicy: The URL of the
- // DiskConsistencyGroupPolicy for the group of disks to clone. This may
- // be a full or partial URL, such as: -
+ // SourceConsistencyGroupPolicy: The URL of the DiskConsistencyGroupPolicy for
+ // the group of disks to clone. This may be a full or partial URL, such as: -
// https://www.googleapis.com/compute/v1/projects/project/regions/region
// /resourcePolicies/resourcePolicy -
// projects/project/regions/region/resourcePolicies/resourcePolicy -
// regions/region/resourcePolicies/resourcePolicy
SourceConsistencyGroupPolicy string `json:"sourceConsistencyGroupPolicy,omitempty"`
-
// ForceSendFields is a list of field names (e.g.
- // "SourceConsistencyGroupPolicy") to unconditionally include in API
- // requests. By default, fields with empty or default 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.
+ // "SourceConsistencyGroupPolicy") to unconditionally include in API requests.
+ // By default, fields with empty or default values are omitted from API
+ // requests. See https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields
+ // for more details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g.
- // "SourceConsistencyGroupPolicy") 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. "SourceConsistencyGroupPolicy") to
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *BulkInsertDiskResource) MarshalJSON() ([]byte, error) {
+func (s BulkInsertDiskResource) MarshalJSON() ([]byte, error) {
type NoMethod BulkInsertDiskResource
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// BulkInsertInstanceResource: A transient resource used in
-// compute.instances.bulkInsert and compute.regionInstances.bulkInsert .
-// This resource is not persisted anywhere, it is used only for
-// processing the requests.
+// compute.instances.bulkInsert and compute.regionInstances.bulkInsert . This
+// resource is not persisted anywhere, it is used only for processing the
+// requests.
type BulkInsertInstanceResource struct {
// Count: The maximum number of instances to create.
Count int64 `json:"count,omitempty,string"`
-
- // InstanceProperties: The instance properties defining the VM instances
- // to be created. Required if sourceInstanceTemplate is not provided.
+ // InstanceProperties: The instance properties defining the VM instances to be
+ // created. Required if sourceInstanceTemplate is not provided.
InstanceProperties *InstanceProperties `json:"instanceProperties,omitempty"`
-
- // LocationPolicy: Policy for chosing target zone. For more information,
- // see Create VMs in bulk .
+ // LocationPolicy: Policy for choosing target zone. For more information, see
+ // Create VMs in bulk.
LocationPolicy *LocationPolicy `json:"locationPolicy,omitempty"`
-
- // MinCount: The minimum number of instances to create. If no min_count
- // is specified then count is used as the default value. If min_count
- // instances cannot be created, then no instances will be created and
- // instances already created will be deleted.
+ // MinCount: The minimum number of instances to create. If no min_count is
+ // specified then count is used as the default value. If min_count instances
+ // cannot be created, then no instances will be created and instances already
+ // created will be deleted.
MinCount int64 `json:"minCount,omitempty,string"`
-
// NamePattern: The string pattern used for the names of the VMs. Either
// name_pattern or per_instance_properties must be set. The pattern must
- // contain one continuous sequence of placeholder hash characters (#)
- // with each character corresponding to one digit of the generated
- // instance name. Example: a name_pattern of inst-#### generates
- // instance names such as inst-0001 and inst-0002. If existing instances
- // in the same project and zone have names that match the name pattern
- // then the generated instance numbers start after the biggest existing
- // number. For example, if there exists an instance with name inst-0050,
- // then instance names generated using the pattern inst-#### begin with
- // inst-0051. The name pattern placeholder #...# can contain up to 18
- // characters.
+ // contain one continuous sequence of placeholder hash characters (#) with each
+ // character corresponding to one digit of the generated instance name.
+ // Example: a name_pattern of inst-#### generates instance names such as
+ // inst-0001 and inst-0002. If existing instances in the same project and zone
+ // have names that match the name pattern then the generated instance numbers
+ // start after the biggest existing number. For example, if there exists an
+ // instance with name inst-0050, then instance names generated using the
+ // pattern inst-#### begin with inst-0051. The name pattern placeholder #...#
+ // can contain up to 18 characters.
NamePattern string `json:"namePattern,omitempty"`
-
- // PerInstanceProperties: Per-instance properties to be set on
- // individual instances. Keys of this map specify requested instance
- // names. Can be empty if name_pattern is used.
+ // PerInstanceProperties: Per-instance properties to be set on individual
+ // instances. Keys of this map specify requested instance names. Can be empty
+ // if name_pattern is used.
PerInstanceProperties map[string]BulkInsertInstanceResourcePerInstanceProperties `json:"perInstanceProperties,omitempty"`
-
- // SourceInstanceTemplate: Specifies the instance template from which to
- // create instances. You may combine sourceInstanceTemplate with
- // instanceProperties to override specific values from an existing
- // instance template. Bulk API follows the semantics of JSON Merge Patch
- // described by RFC 7396. It can be a full or partial URL. For example,
- // the following are all valid URLs to an instance template: -
- // https://www.googleapis.com/compute/v1/projects/project
+ // SourceInstanceTemplate: Specifies the instance template from which to create
+ // instances. You may combine sourceInstanceTemplate with instanceProperties to
+ // override specific values from an existing instance template. Bulk API
+ // follows the semantics of JSON Merge Patch described by RFC 7396. It can be a
+ // full or partial URL. For example, the following are all valid URLs to an
+ // instance template: - https://www.googleapis.com/compute/v1/projects/project
// /global/instanceTemplates/instanceTemplate -
// projects/project/global/instanceTemplates/instanceTemplate -
// global/instanceTemplates/instanceTemplate This field is optional.
SourceInstanceTemplate string `json:"sourceInstanceTemplate,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Count") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Count") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Count") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *BulkInsertInstanceResource) MarshalJSON() ([]byte, error) {
+func (s BulkInsertInstanceResource) MarshalJSON() ([]byte, error) {
type NoMethod BulkInsertInstanceResource
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// BulkInsertInstanceResourcePerInstanceProperties: Per-instance
-// properties to be set on individual instances. To be extended in the
-// future.
+// BulkInsertInstanceResourcePerInstanceProperties: Per-instance properties to
+// be set on individual instances. To be extended in the future.
type BulkInsertInstanceResourcePerInstanceProperties struct {
// Hostname: Specifies the hostname of the instance. More details in:
// https://cloud.google.com/compute/docs/instances/custom-hostname-vm#naming_convention
Hostname string `json:"hostname,omitempty"`
-
- // Name: This field is only temporary. It will be removed. Do not use
- // it.
+ // Name: This field is only temporary. It will be removed. Do not use it.
Name string `json:"name,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Hostname") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Hostname") 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. "Hostname") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *BulkInsertInstanceResourcePerInstanceProperties) MarshalJSON() ([]byte, error) {
+func (s BulkInsertInstanceResourcePerInstanceProperties) MarshalJSON() ([]byte, error) {
type NoMethod BulkInsertInstanceResourcePerInstanceProperties
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type BulkInsertOperationStatus struct {
- // CreatedVmCount: [Output Only] Count of VMs successfully created so
- // far.
+ // CreatedVmCount: [Output Only] Count of VMs successfully created so far.
CreatedVmCount int64 `json:"createdVmCount,omitempty"`
-
- // DeletedVmCount: [Output Only] Count of VMs that got deleted during
- // rollback.
+ // DeletedVmCount: [Output Only] Count of VMs that got deleted during rollback.
DeletedVmCount int64 `json:"deletedVmCount,omitempty"`
-
- // FailedToCreateVmCount: [Output Only] Count of VMs that started
- // creating but encountered an error.
+ // FailedToCreateVmCount: [Output Only] Count of VMs that started creating but
+ // encountered an error.
FailedToCreateVmCount int64 `json:"failedToCreateVmCount,omitempty"`
-
- // Status: [Output Only] Creation status of BulkInsert operation -
- // information if the flow is rolling forward or rolling back.
+ // Status: [Output Only] Creation status of BulkInsert operation - information
+ // if the flow is rolling forward or rolling back.
//
// Possible values:
// "CREATING" - Rolling forward - creating VMs.
@@ -8102,1335 +6963,1129 @@ type BulkInsertOperationStatus struct {
// "ROLLING_BACK" - Rolling back - cleaning up after an error.
// "STATUS_UNSPECIFIED"
Status string `json:"status,omitempty"`
-
- // TargetVmCount: [Output Only] Count of VMs originally planned to be
- // created.
+ // TargetVmCount: [Output Only] Count of VMs originally planned to be created.
TargetVmCount int64 `json:"targetVmCount,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "CreatedVmCount") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "CreatedVmCount") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "CreatedVmCount") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *BulkInsertOperationStatus) MarshalJSON() ([]byte, error) {
+func (s BulkInsertOperationStatus) MarshalJSON() ([]byte, error) {
type NoMethod BulkInsertOperationStatus
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type CacheInvalidationRule struct {
- // Host: If set, this invalidation rule will only apply to requests with
- // a Host header matching host.
+ // Host: If set, this invalidation rule will only apply to requests with a Host
+ // header matching host.
Host string `json:"host,omitempty"`
-
Path string `json:"path,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Host") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Host") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Host") 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. "Host") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *CacheInvalidationRule) MarshalJSON() ([]byte, error) {
+func (s CacheInvalidationRule) MarshalJSON() ([]byte, error) {
type NoMethod CacheInvalidationRule
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// CacheKeyPolicy: Message containing what to include in the cache key
-// for a request for Cloud CDN.
+// CacheKeyPolicy: Message containing what to include in the cache key for a
+// request for Cloud CDN.
type CacheKeyPolicy struct {
- // IncludeHost: If true, requests to different hosts will be cached
- // separately.
+ // IncludeHost: If true, requests to different hosts will be cached separately.
IncludeHost bool `json:"includeHost,omitempty"`
-
- // IncludeHttpHeaders: Allows HTTP request headers (by name) to be used
- // in the cache key.
+ // IncludeHttpHeaders: Allows HTTP request headers (by name) to be used in the
+ // cache key.
IncludeHttpHeaders []string `json:"includeHttpHeaders,omitempty"`
-
- // IncludeNamedCookies: Allows HTTP cookies (by name) to be used in the
- // cache key. The name=value pair will be used in the cache key Cloud
- // CDN generates.
+ // IncludeNamedCookies: Allows HTTP cookies (by name) to be used in the cache
+ // key. The name=value pair will be used in the cache key Cloud CDN generates.
IncludeNamedCookies []string `json:"includeNamedCookies,omitempty"`
-
- // IncludeProtocol: If true, http and https requests will be cached
- // separately.
+ // IncludeProtocol: If true, http and https requests will be cached separately.
IncludeProtocol bool `json:"includeProtocol,omitempty"`
-
- // IncludeQueryString: If true, include query string parameters in the
- // cache key according to query_string_whitelist and
- // query_string_blacklist. If neither is set, the entire query string
- // will be included. If false, the query string will be excluded from
- // the cache key entirely.
+ // IncludeQueryString: If true, include query string parameters in the cache
+ // key according to query_string_whitelist and query_string_blacklist. If
+ // neither is set, the entire query string will be included. If false, the
+ // query string will be excluded from the cache key entirely.
IncludeQueryString bool `json:"includeQueryString,omitempty"`
-
- // QueryStringBlacklist: Names of query string parameters to exclude in
- // cache keys. All other parameters will be included. Either specify
- // query_string_whitelist or query_string_blacklist, not both. '&' and
- // '=' will be percent encoded and not treated as delimiters.
+ // QueryStringBlacklist: Names of query string parameters to exclude in cache
+ // keys. All other parameters will be included. Either specify
+ // query_string_whitelist or query_string_blacklist, not both. '&' and '=' will
+ // be percent encoded and not treated as delimiters.
QueryStringBlacklist []string `json:"queryStringBlacklist,omitempty"`
-
- // QueryStringWhitelist: Names of query string parameters to include in
- // cache keys. All other parameters will be excluded. Either specify
- // query_string_whitelist or query_string_blacklist, not both. '&' and
- // '=' will be percent encoded and not treated as delimiters.
+ // QueryStringWhitelist: Names of query string parameters to include in cache
+ // keys. All other parameters will be excluded. Either specify
+ // query_string_whitelist or query_string_blacklist, not both. '&' and '=' will
+ // be percent encoded and not treated as delimiters.
QueryStringWhitelist []string `json:"queryStringWhitelist,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "IncludeHost") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "IncludeHost") 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. "IncludeHost") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *CacheKeyPolicy) MarshalJSON() ([]byte, error) {
+func (s CacheKeyPolicy) MarshalJSON() ([]byte, error) {
type NoMethod CacheKeyPolicy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// CircuitBreakers: Settings controlling the volume of requests,
-// connections and retries to this backend service.
+// CircuitBreakers: Settings controlling the volume of requests, connections
+// and retries to this backend service.
type CircuitBreakers struct {
- // MaxConnections: The maximum number of connections to the backend
- // service. If not specified, there is no limit. Not supported when the
- // backend service is referenced by a URL map that is bound to target
- // gRPC proxy that has validateForProxyless field set to true.
+ // MaxConnections: The maximum number of connections to the backend service. If
+ // not specified, there is no limit. Not supported when the backend service is
+ // referenced by a URL map that is bound to target gRPC proxy that has
+ // validateForProxyless field set to true.
MaxConnections int64 `json:"maxConnections,omitempty"`
-
- // MaxPendingRequests: The maximum number of pending requests allowed to
- // the backend service. If not specified, there is no limit. Not
- // supported when the backend service is referenced by a URL map that is
- // bound to target gRPC proxy that has validateForProxyless field set to
- // true.
+ // MaxPendingRequests: The maximum number of pending requests allowed to the
+ // backend service. If not specified, there is no limit. Not supported when the
+ // backend service is referenced by a URL map that is bound to target gRPC
+ // proxy that has validateForProxyless field set to true.
MaxPendingRequests int64 `json:"maxPendingRequests,omitempty"`
-
- // MaxRequests: The maximum number of parallel requests that allowed to
- // the backend service. If not specified, there is no limit.
+ // MaxRequests: The maximum number of parallel requests that allowed to the
+ // backend service. If not specified, there is no limit.
MaxRequests int64 `json:"maxRequests,omitempty"`
-
- // MaxRequestsPerConnection: Maximum requests for a single connection to
- // the backend service. This parameter is respected by both the HTTP/1.1
- // and HTTP/2 implementations. If not specified, there is no limit.
- // Setting this parameter to 1 will effectively disable keep alive. Not
- // supported when the backend service is referenced by a URL map that is
- // bound to target gRPC proxy that has validateForProxyless field set to
- // true.
+ // MaxRequestsPerConnection: Maximum requests for a single connection to the
+ // backend service. This parameter is respected by both the HTTP/1.1 and HTTP/2
+ // implementations. If not specified, there is no limit. Setting this parameter
+ // to 1 will effectively disable keep alive. Not supported when the backend
+ // service is referenced by a URL map that is bound to target gRPC proxy that
+ // has validateForProxyless field set to true.
MaxRequestsPerConnection int64 `json:"maxRequestsPerConnection,omitempty"`
-
- // MaxRetries: The maximum number of parallel retries allowed to the
- // backend cluster. If not specified, the default is 1. Not supported
- // when the backend service is referenced by a URL map that is bound to
- // target gRPC proxy that has validateForProxyless field set to true.
+ // MaxRetries: The maximum number of parallel retries allowed to the backend
+ // cluster. If not specified, the default is 1. Not supported when the backend
+ // service is referenced by a URL map that is bound to target gRPC proxy that
+ // has validateForProxyless field set to true.
MaxRetries int64 `json:"maxRetries,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "MaxConnections") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "MaxConnections") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "MaxConnections") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *CircuitBreakers) MarshalJSON() ([]byte, error) {
+func (s CircuitBreakers) MarshalJSON() ([]byte, error) {
type NoMethod CircuitBreakers
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// Commitment: Represents a regional Commitment resource. Creating a
-// commitment resource means that you are purchasing a committed use
-// contract with an explicit start and end time. You can create
-// commitments based on vCPUs and memory usage and receive discounted
-// rates. For full details, read Signing Up for Committed Use Discounts.
+// Commitment: Represents a regional Commitment resource. Creating a commitment
+// resource means that you are purchasing a committed use contract with an
+// explicit start and end time. You can create commitments based on vCPUs and
+// memory usage and receive discounted rates. For full details, read Signing Up
+// for Committed Use Discounts.
type Commitment struct {
- // AutoRenew: Specifies whether to enable automatic renewal for the
- // commitment. The default value is false if not specified. The field
- // can be updated until the day of the commitment expiration at 12:00am
- // PST. If the field is set to true, the commitment will be
- // automatically renewed for either one or three years according to the
- // terms of the existing commitment.
+ // AutoRenew: Specifies whether to enable automatic renewal for the commitment.
+ // The default value is false if not specified. The field can be updated until
+ // the day of the commitment expiration at 12:00am PST. If the field is set to
+ // true, the commitment will be automatically renewed for either one or three
+ // years according to the terms of the existing commitment.
AutoRenew bool `json:"autoRenew,omitempty"`
-
// Category: The category of the commitment. Category MACHINE specifies
- // commitments composed of machine resources such as VCPU or MEMORY,
- // listed in resources. Category LICENSE specifies commitments composed
- // of software licenses, listed in licenseResources. Note that only
- // MACHINE commitments should have a Type specified.
+ // commitments composed of machine resources such as VCPU or MEMORY, listed in
+ // resources. Category LICENSE specifies commitments composed of software
+ // licenses, listed in licenseResources. Note that only MACHINE commitments
+ // should have a Type specified.
//
// Possible values:
// "CATEGORY_UNSPECIFIED"
// "LICENSE"
// "MACHINE"
Category string `json:"category,omitempty"`
-
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // CustomEndTimestamp: [Input Only] Optional, specifies the CUD end time
+ // requested by the customer in RFC3339 text format. Needed when the customer
+ // wants CUD's end date is later than the start date + term duration.
+ CustomEndTimestamp string `json:"customEndTimestamp,omitempty"`
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // EndTimestamp: [Output Only] Commitment end time in RFC3339 text
- // format.
+ // EndTimestamp: [Output Only] Commitment end time in RFC3339 text format.
EndTimestamp string `json:"endTimestamp,omitempty"`
-
- // ExistingReservations: Specifies the already existing reservations to
- // attach to the Commitment. This field is optional, and it can be a
- // full or partial URL. For example, the following are valid URLs to an
- // reservation: -
+ // ExistingReservations: Specifies the already existing reservations to attach
+ // to the Commitment. This field is optional, and it can be a full or partial
+ // URL. For example, the following are valid URLs to an reservation: -
// https://www.googleapis.com/compute/v1/projects/project/zones/zone
// /reservations/reservation -
// projects/project/zones/zone/reservations/reservation
ExistingReservations []string `json:"existingReservations,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
- // Kind: [Output Only] Type of the resource. Always compute#commitment
- // for commitments.
+ // Kind: [Output Only] Type of the resource. Always compute#commitment for
+ // commitments.
Kind string `json:"kind,omitempty"`
-
- // LicenseResource: The license specification required as part of a
- // license commitment.
+ // LicenseResource: The license specification required as part of a license
+ // commitment.
LicenseResource *LicenseResourceCommitment `json:"licenseResource,omitempty"`
-
- // MergeSourceCommitments: List of source commitments to be merged into
- // a new commitment.
+ // MergeSourceCommitments: List of source commitments to be merged into a new
+ // commitment.
MergeSourceCommitments []string `json:"mergeSourceCommitments,omitempty"`
-
- // Name: Name of the resource. Provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
- // the first character must be a lowercase letter, and all following
- // characters must be a dash, lowercase letter, or digit, except the
- // last character, which cannot be a dash.
+ // Name: Name of the resource. Provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must
+ // be a lowercase letter, and all following characters must be a dash,
+ // lowercase letter, or digit, except the last character, which cannot be a
+ // dash.
Name string `json:"name,omitempty"`
-
- // Plan: The plan for this commitment, which determines duration and
- // discount rate. The currently supported plans are TWELVE_MONTH (1
- // year), and THIRTY_SIX_MONTH (3 years).
+ // Plan: The plan for this commitment, which determines duration and discount
+ // rate. The currently supported plans are TWELVE_MONTH (1 year), and
+ // THIRTY_SIX_MONTH (3 years).
//
// Possible values:
// "INVALID"
// "THIRTY_SIX_MONTH"
// "TWELVE_MONTH"
Plan string `json:"plan,omitempty"`
-
- // Region: [Output Only] URL of the region where this commitment may be
- // used.
+ // Region: [Output Only] URL of the region where this commitment may be used.
Region string `json:"region,omitempty"`
-
- // Reservations: List of create-on-create reservations for this
- // commitment.
+ // Reservations: List of create-on-create reservations for this commitment.
Reservations []*Reservation `json:"reservations,omitempty"`
-
- // Resources: A list of commitment amounts for particular resources.
- // Note that VCPU and MEMORY resource commitments must occur together.
+ // ResourceStatus: [Output Only] Status information for Commitment resource.
+ ResourceStatus *CommitmentResourceStatus `json:"resourceStatus,omitempty"`
+ // Resources: A list of commitment amounts for particular resources. Note that
+ // VCPU and MEMORY resource commitments must occur together.
Resources []*ResourceCommitment `json:"resources,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // SplitSourceCommitment: Source commitment to be split into a new
- // commitment.
+ // SplitSourceCommitment: Source commitment to be split into a new commitment.
SplitSourceCommitment string `json:"splitSourceCommitment,omitempty"`
-
- // StartTimestamp: [Output Only] Commitment start time in RFC3339 text
- // format.
+ // StartTimestamp: [Output Only] Commitment start time in RFC3339 text format.
StartTimestamp string `json:"startTimestamp,omitempty"`
-
- // Status: [Output Only] Status of the commitment with regards to
- // eventual expiration (each commitment has an end date defined). One of
- // the following values: NOT_YET_ACTIVE, ACTIVE, EXPIRED.
+ // Status: [Output Only] Status of the commitment with regards to eventual
+ // expiration (each commitment has an end date defined). One of the following
+ // values: NOT_YET_ACTIVE, ACTIVE, EXPIRED.
//
// Possible values:
// "ACTIVE"
- // "CANCELLED" - Deprecate CANCELED status. Will use separate status
- // to differentiate cancel by mergeCud or manual cancellation.
+ // "CANCELLED" - Deprecate CANCELED status. Will use separate status to
+ // differentiate cancel by mergeCud or manual cancellation.
// "CREATING"
// "EXPIRED"
// "NOT_YET_ACTIVE"
Status string `json:"status,omitempty"`
-
- // StatusMessage: [Output Only] An optional, human-readable explanation
- // of the status.
+ // StatusMessage: [Output Only] An optional, human-readable explanation of the
+ // status.
StatusMessage string `json:"statusMessage,omitempty"`
-
// Type: The type of commitment, which affects the discount rate and the
- // eligible resources. Type MEMORY_OPTIMIZED specifies a commitment that
- // will only apply to memory optimized machines. Type
- // ACCELERATOR_OPTIMIZED specifies a commitment that will only apply to
- // accelerator optimized machines.
+ // eligible resources. Type MEMORY_OPTIMIZED specifies a commitment that will
+ // only apply to memory optimized machines. Type ACCELERATOR_OPTIMIZED
+ // specifies a commitment that will only apply to accelerator optimized
+ // machines.
//
// Possible values:
// "ACCELERATOR_OPTIMIZED"
// "ACCELERATOR_OPTIMIZED_A3"
+ // "ACCELERATOR_OPTIMIZED_A3_MEGA"
// "COMPUTE_OPTIMIZED"
// "COMPUTE_OPTIMIZED_C2D"
// "COMPUTE_OPTIMIZED_C3"
// "COMPUTE_OPTIMIZED_C3D"
// "COMPUTE_OPTIMIZED_H3"
// "GENERAL_PURPOSE"
+ // "GENERAL_PURPOSE_C4"
+ // "GENERAL_PURPOSE_C4A"
// "GENERAL_PURPOSE_E2"
// "GENERAL_PURPOSE_N2"
// "GENERAL_PURPOSE_N2D"
+ // "GENERAL_PURPOSE_N4"
// "GENERAL_PURPOSE_T2D"
// "GRAPHICS_OPTIMIZED"
// "MEMORY_OPTIMIZED"
// "MEMORY_OPTIMIZED_M3"
+ // "STORAGE_OPTIMIZED_Z3"
// "TYPE_UNSPECIFIED"
Type string `json:"type,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
// ForceSendFields is a list of field names (e.g. "AutoRenew") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "AutoRenew") 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. "AutoRenew") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *Commitment) MarshalJSON() ([]byte, error) {
+func (s Commitment) MarshalJSON() ([]byte, error) {
type NoMethod Commitment
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type CommitmentAggregatedList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of CommitmentsScopedList resources.
Items map[string]CommitmentsScopedList `json:"items,omitempty"`
-
// Kind: [Output Only] Type of resource. Always
// compute#commitmentAggregatedList for aggregated lists of commitments.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Unreachables: [Output Only] Unreachable resources.
Unreachables []string `json:"unreachables,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *CommitmentAggregatedListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *CommitmentAggregatedList) MarshalJSON() ([]byte, error) {
+func (s CommitmentAggregatedList) MarshalJSON() ([]byte, error) {
type NoMethod CommitmentAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// CommitmentAggregatedListWarning: [Output Only] Informational warning
// message.
type CommitmentAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*CommitmentAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *CommitmentAggregatedListWarning) MarshalJSON() ([]byte, error) {
+func (s CommitmentAggregatedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod CommitmentAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type CommitmentAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *CommitmentAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+func (s CommitmentAggregatedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod CommitmentAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// CommitmentList: Contains a list of Commitment resources.
type CommitmentList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of Commitment resources.
Items []*Commitment `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource. Always compute#commitmentList
- // for lists of commitments.
+ // Kind: [Output Only] Type of resource. Always compute#commitmentList for
+ // lists of commitments.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *CommitmentListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *CommitmentList) MarshalJSON() ([]byte, error) {
+func (s CommitmentList) MarshalJSON() ([]byte, error) {
type NoMethod CommitmentList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// CommitmentListWarning: [Output Only] Informational warning message.
type CommitmentListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*CommitmentListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *CommitmentListWarning) MarshalJSON() ([]byte, error) {
+func (s CommitmentListWarning) MarshalJSON() ([]byte, error) {
type NoMethod CommitmentListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type CommitmentListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *CommitmentListWarningData) MarshalJSON() ([]byte, error) {
+func (s CommitmentListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod CommitmentListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+// CommitmentResourceStatus: [Output Only] Contains output only fields.
+type CommitmentResourceStatus struct {
+ // CustomTermEligibilityEndTimestamp: [Output Only] Indicates the end time of
+ // customer's eligibility to send custom term requests in RFC3339 text format.
+ // Term extension requests that (not the end time in the request) after this
+ // time will be rejected.
+ CustomTermEligibilityEndTimestamp string `json:"customTermEligibilityEndTimestamp,omitempty"`
+ // ForceSendFields is a list of field names (e.g.
+ // "CustomTermEligibilityEndTimestamp") to unconditionally include in API
+ // requests. By default, fields with empty or default values are omitted from
+ // API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g.
+ // "CustomTermEligibilityEndTimestamp") to include in API requests with the
+ // JSON null value. By default, fields with empty values are omitted from API
+ // requests. See https://pkg.go.dev/google.golang.org/api#hdr-NullFields for
+ // more details.
+ NullFields []string `json:"-"`
+}
+
+func (s CommitmentResourceStatus) MarshalJSON() ([]byte, error) {
+ type NoMethod CommitmentResourceStatus
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type CommitmentsScopedList struct {
- // Commitments: [Output Only] A list of commitments contained in this
- // scope.
+ // Commitments: [Output Only] A list of commitments contained in this scope.
Commitments []*Commitment `json:"commitments,omitempty"`
-
- // Warning: [Output Only] Informational warning which replaces the list
- // of commitments when the list is empty.
+ // Warning: [Output Only] Informational warning which replaces the list of
+ // commitments when the list is empty.
Warning *CommitmentsScopedListWarning `json:"warning,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Commitments") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Commitments") 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. "Commitments") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *CommitmentsScopedList) MarshalJSON() ([]byte, error) {
+func (s CommitmentsScopedList) MarshalJSON() ([]byte, error) {
type NoMethod CommitmentsScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// CommitmentsScopedListWarning: [Output Only] Informational warning
-// which replaces the list of commitments when the list is empty.
+// CommitmentsScopedListWarning: [Output Only] Informational warning which
+// replaces the list of commitments when the list is empty.
type CommitmentsScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*CommitmentsScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *CommitmentsScopedListWarning) MarshalJSON() ([]byte, error) {
+func (s CommitmentsScopedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod CommitmentsScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type CommitmentsScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *CommitmentsScopedListWarningData) MarshalJSON() ([]byte, error) {
+func (s CommitmentsScopedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod CommitmentsScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// Condition: This is deprecated and has no effect. Do not use.
-type Condition struct {
- // Iam: This is deprecated and has no effect. Do not use.
- //
- // Possible values:
- // "APPROVER" - This is deprecated and has no effect. Do not use.
- // "ATTRIBUTION" - This is deprecated and has no effect. Do not use.
- // "AUTHORITY" - This is deprecated and has no effect. Do not use.
- // "CREDENTIALS_TYPE" - This is deprecated and has no effect. Do not
- // use.
- // "CREDS_ASSERTION" - This is deprecated and has no effect. Do not
- // use.
- // "JUSTIFICATION_TYPE" - This is deprecated and has no effect. Do not
- // use.
- // "NO_ATTR" - This is deprecated and has no effect. Do not use.
- // "SECURITY_REALM" - This is deprecated and has no effect. Do not
- // use.
- Iam string `json:"iam,omitempty"`
-
- // Op: This is deprecated and has no effect. Do not use.
- //
- // Possible values:
- // "DISCHARGED" - This is deprecated and has no effect. Do not use.
- // "EQUALS" - This is deprecated and has no effect. Do not use.
- // "IN" - This is deprecated and has no effect. Do not use.
- // "NOT_EQUALS" - This is deprecated and has no effect. Do not use.
- // "NOT_IN" - This is deprecated and has no effect. Do not use.
- // "NO_OP" - This is deprecated and has no effect. Do not use.
- Op string `json:"op,omitempty"`
-
- // Svc: This is deprecated and has no effect. Do not use.
- Svc string `json:"svc,omitempty"`
-
- // Sys: This is deprecated and has no effect. Do not use.
- //
- // Possible values:
- // "IP" - This is deprecated and has no effect. Do not use.
- // "NAME" - This is deprecated and has no effect. Do not use.
- // "NO_ATTR" - This is deprecated and has no effect. Do not use.
- // "REGION" - This is deprecated and has no effect. Do not use.
- // "SERVICE" - This is deprecated and has no effect. Do not use.
- Sys string `json:"sys,omitempty"`
-
- // Values: This is deprecated and has no effect. Do not use.
- Values []string `json:"values,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Iam") to
- // unconditionally include in API requests. By default, fields with
- // empty or default values are omitted from API requests. However, any
- // non-pointer, non-interface field appearing in ForceSendFields will be
- // sent to the server regardless of whether the field is empty or not.
- // This may be used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Iam") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
-}
-
-func (s *Condition) MarshalJSON() ([]byte, error) {
- type NoMethod Condition
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// ConfidentialInstanceConfig: A set of Confidential Instance options.
type ConfidentialInstanceConfig struct {
+ // ConfidentialInstanceType: Defines the type of technology used by the
+ // confidential instance.
+ //
+ // Possible values:
+ // "CONFIDENTIAL_INSTANCE_TYPE_UNSPECIFIED" - No type specified. Do not use
+ // this value.
+ // "SEV" - AMD Secure Encrypted Virtualization.
+ // "SEV_SNP" - AMD Secure Encrypted Virtualization - Secure Nested Paging.
+ // "TDX" - Intel Trust Domain eXtension.
+ ConfidentialInstanceType string `json:"confidentialInstanceType,omitempty"`
// EnableConfidentialCompute: Defines whether the instance should have
// confidential compute enabled.
EnableConfidentialCompute bool `json:"enableConfidentialCompute,omitempty"`
-
- // ForceSendFields is a list of field names (e.g.
- // "EnableConfidentialCompute") to unconditionally include in API
- // requests. By default, fields with empty or default 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 is a list of field names (e.g. "ConfidentialInstanceType")
+ // to unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g.
- // "EnableConfidentialCompute") 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. "ConfidentialInstanceType") to
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ConfidentialInstanceConfig) MarshalJSON() ([]byte, error) {
+func (s ConfidentialInstanceConfig) MarshalJSON() ([]byte, error) {
type NoMethod ConfidentialInstanceConfig
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// ConnectionDraining: Message containing connection draining
-// configuration.
+// ConnectionDraining: Message containing connection draining configuration.
type ConnectionDraining struct {
- // DrainingTimeoutSec: Configures a duration timeout for existing
- // requests on a removed backend instance. For supported load balancers
- // and protocols, as described in Enabling connection draining.
+ // DrainingTimeoutSec: Configures a duration timeout for existing requests on a
+ // removed backend instance. For supported load balancers and protocols, as
+ // described in Enabling connection draining.
DrainingTimeoutSec int64 `json:"drainingTimeoutSec,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "DrainingTimeoutSec")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "DrainingTimeoutSec") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "DrainingTimeoutSec") 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. "DrainingTimeoutSec") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ConnectionDraining) MarshalJSON() ([]byte, error) {
+func (s ConnectionDraining) MarshalJSON() ([]byte, error) {
type NoMethod ConnectionDraining
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// ConsistentHashLoadBalancerSettings: This message defines settings for
-// a consistent hash style load balancer.
+// ConsistentHashLoadBalancerSettings: This message defines settings for a
+// consistent hash style load balancer.
type ConsistentHashLoadBalancerSettings struct {
- // HttpCookie: Hash is based on HTTP Cookie. This field describes a HTTP
- // cookie that will be used as the hash key for the consistent hash load
- // balancer. If the cookie is not present, it will be generated. This
- // field is applicable if the sessionAffinity is set to HTTP_COOKIE. Not
- // supported when the backend service is referenced by a URL map that is
- // bound to target gRPC proxy that has validateForProxyless field set to
- // true.
+ // HttpCookie: Hash is based on HTTP Cookie. This field describes a HTTP cookie
+ // that will be used as the hash key for the consistent hash load balancer. If
+ // the cookie is not present, it will be generated. This field is applicable if
+ // the sessionAffinity is set to HTTP_COOKIE. Not supported when the backend
+ // service is referenced by a URL map that is bound to target gRPC proxy that
+ // has validateForProxyless field set to true.
HttpCookie *ConsistentHashLoadBalancerSettingsHttpCookie `json:"httpCookie,omitempty"`
-
- // HttpHeaderName: The hash based on the value of the specified header
- // field. This field is applicable if the sessionAffinity is set to
- // HEADER_FIELD.
+ // HttpHeaderName: The hash based on the value of the specified header field.
+ // This field is applicable if the sessionAffinity is set to HEADER_FIELD.
HttpHeaderName string `json:"httpHeaderName,omitempty"`
-
- // MinimumRingSize: The minimum number of virtual nodes to use for the
- // hash ring. Defaults to 1024. Larger ring sizes result in more
- // granular load distributions. If the number of hosts in the load
- // balancing pool is larger than the ring size, each host will be
- // assigned a single virtual node.
+ // MinimumRingSize: The minimum number of virtual nodes to use for the hash
+ // ring. Defaults to 1024. Larger ring sizes result in more granular load
+ // distributions. If the number of hosts in the load balancing pool is larger
+ // than the ring size, each host will be assigned a single virtual node.
MinimumRingSize int64 `json:"minimumRingSize,omitempty,string"`
-
// ForceSendFields is a list of field names (e.g. "HttpCookie") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "HttpCookie") 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. "HttpCookie") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ConsistentHashLoadBalancerSettings) MarshalJSON() ([]byte, error) {
+func (s ConsistentHashLoadBalancerSettings) MarshalJSON() ([]byte, error) {
type NoMethod ConsistentHashLoadBalancerSettings
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// ConsistentHashLoadBalancerSettingsHttpCookie: The information about
-// the HTTP Cookie on which the hash function is based for load
-// balancing policies that use a consistent hash.
+// ConsistentHashLoadBalancerSettingsHttpCookie: The information about the HTTP
+// Cookie on which the hash function is based for load balancing policies that
+// use a consistent hash.
type ConsistentHashLoadBalancerSettingsHttpCookie struct {
// Name: Name of the cookie.
Name string `json:"name,omitempty"`
-
// Path: Path to set for the cookie.
Path string `json:"path,omitempty"`
-
// Ttl: Lifetime of the cookie.
Ttl *Duration `json:"ttl,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Name") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Name") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
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 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. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ConsistentHashLoadBalancerSettingsHttpCookie) MarshalJSON() ([]byte, error) {
+func (s ConsistentHashLoadBalancerSettingsHttpCookie) MarshalJSON() ([]byte, error) {
type NoMethod ConsistentHashLoadBalancerSettingsHttpCookie
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// CorsPolicy: The specification for allowing client-side cross-origin
-// requests. For more information about the W3C recommendation for
-// cross-origin resource sharing (CORS), see Fetch API Living Standard.
+// requests. For more information about the W3C recommendation for cross-origin
+// resource sharing (CORS), see Fetch API Living Standard.
type CorsPolicy struct {
- // AllowCredentials: In response to a preflight request, setting this to
- // true indicates that the actual request can include user credentials.
- // This field translates to the Access-Control-Allow-Credentials header.
- // Default is false.
+ // AllowCredentials: In response to a preflight request, setting this to true
+ // indicates that the actual request can include user credentials. This field
+ // translates to the Access-Control-Allow-Credentials header. Default is false.
AllowCredentials bool `json:"allowCredentials,omitempty"`
-
- // AllowHeaders: Specifies the content for the
- // Access-Control-Allow-Headers header.
+ // AllowHeaders: Specifies the content for the Access-Control-Allow-Headers
+ // header.
AllowHeaders []string `json:"allowHeaders,omitempty"`
-
- // AllowMethods: Specifies the content for the
- // Access-Control-Allow-Methods header.
+ // AllowMethods: Specifies the content for the Access-Control-Allow-Methods
+ // header.
AllowMethods []string `json:"allowMethods,omitempty"`
-
- // AllowOriginRegexes: Specifies a regular expression that matches
- // allowed origins. For more information about the regular expression
- // syntax, see Syntax. An origin is allowed if it matches either an item
- // in allowOrigins or an item in allowOriginRegexes. Regular expressions
- // can only be used when the loadBalancingScheme is set to
- // INTERNAL_SELF_MANAGED.
+ // AllowOriginRegexes: Specifies a regular expression that matches allowed
+ // origins. For more information, see regular expression syntax . An origin is
+ // allowed if it matches either an item in allowOrigins or an item in
+ // allowOriginRegexes. Regular expressions can only be used when the
+ // loadBalancingScheme is set to INTERNAL_SELF_MANAGED.
AllowOriginRegexes []string `json:"allowOriginRegexes,omitempty"`
-
- // AllowOrigins: Specifies the list of origins that is allowed to do
- // CORS requests. An origin is allowed if it matches either an item in
- // allowOrigins or an item in allowOriginRegexes.
+ // AllowOrigins: Specifies the list of origins that is allowed to do CORS
+ // requests. An origin is allowed if it matches either an item in allowOrigins
+ // or an item in allowOriginRegexes.
AllowOrigins []string `json:"allowOrigins,omitempty"`
-
- // Disabled: If true, the setting specifies the CORS policy is disabled.
- // The default value of false, which indicates that the CORS policy is
- // in effect.
+ // Disabled: If true, disables the CORS policy. The default value is false,
+ // which indicates that the CORS policy is in effect.
Disabled bool `json:"disabled,omitempty"`
-
- // ExposeHeaders: Specifies the content for the
- // Access-Control-Expose-Headers header.
+ // ExposeHeaders: Specifies the content for the Access-Control-Expose-Headers
+ // header.
ExposeHeaders []string `json:"exposeHeaders,omitempty"`
-
- // MaxAge: Specifies how long results of a preflight request can be
- // cached in seconds. This field translates to the
- // Access-Control-Max-Age header.
+ // MaxAge: Specifies how long results of a preflight request can be cached in
+ // seconds. This field translates to the Access-Control-Max-Age header.
MaxAge int64 `json:"maxAge,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "AllowCredentials") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "AllowCredentials") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "AllowCredentials") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *CorsPolicy) MarshalJSON() ([]byte, error) {
+func (s CorsPolicy) MarshalJSON() ([]byte, error) {
type NoMethod CorsPolicy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+// CustomErrorResponsePolicy: Specifies the custom error response policy that
+// must be applied when the backend service or backend bucket responds with an
+// error.
+type CustomErrorResponsePolicy struct {
+ // ErrorResponseRules: Specifies rules for returning error responses. In a
+ // given policy, if you specify rules for both a range of error codes as well
+ // as rules for specific error codes then rules with specific error codes have
+ // a higher priority. For example, assume that you configure a rule for 401
+ // (Un-authorized) code, and another for all 4 series error codes (4XX). If the
+ // backend service returns a 401, then the rule for 401 will be applied.
+ // However if the backend service returns a 403, the rule for 4xx takes effect.
+ ErrorResponseRules []*CustomErrorResponsePolicyCustomErrorResponseRule `json:"errorResponseRules,omitempty"`
+ // ErrorService: The full or partial URL to the BackendBucket resource that
+ // contains the custom error content. Examples are: -
+ // https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket
+ // - compute/v1/projects/project/global/backendBuckets/myBackendBucket -
+ // global/backendBuckets/myBackendBucket If errorService is not specified at
+ // lower levels like pathMatcher, pathRule and routeRule, an errorService
+ // specified at a higher level in the UrlMap will be used. If
+ // UrlMap.defaultCustomErrorResponsePolicy contains one or more
+ // errorResponseRules[], it must specify errorService. If load balancer cannot
+ // reach the backendBucket, a simple Not Found Error will be returned, with the
+ // original response code (or overrideResponseCode if configured). errorService
+ // is not supported for internal or regional HTTP/HTTPS load balancers.
+ ErrorService string `json:"errorService,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "ErrorResponseRules") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "ErrorResponseRules") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s CustomErrorResponsePolicy) MarshalJSON() ([]byte, error) {
+ type NoMethod CustomErrorResponsePolicy
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+// CustomErrorResponsePolicyCustomErrorResponseRule: Specifies the mapping
+// between the response code that will be returned along with the custom error
+// content and the response code returned by the backend service.
+type CustomErrorResponsePolicyCustomErrorResponseRule struct {
+ // MatchResponseCodes: Valid values include: - A number between 400 and 599:
+ // For example 401 or 503, in which case the load balancer applies the policy
+ // if the error code exactly matches this value. - 5xx: Load Balancer will
+ // apply the policy if the backend service responds with any response code in
+ // the range of 500 to 599. - 4xx: Load Balancer will apply the policy if the
+ // backend service responds with any response code in the range of 400 to 499.
+ // Values must be unique within matchResponseCodes and across all
+ // errorResponseRules of CustomErrorResponsePolicy.
+ MatchResponseCodes []string `json:"matchResponseCodes,omitempty"`
+ // OverrideResponseCode: The HTTP status code returned with the response
+ // containing the custom error content. If overrideResponseCode is not
+ // supplied, the same response code returned by the original backend bucket or
+ // backend service is returned to the client.
+ OverrideResponseCode int64 `json:"overrideResponseCode,omitempty"`
+ // Path: The full path to a file within backendBucket . For example:
+ // /errors/defaultError.html path must start with a leading slash. path cannot
+ // have trailing slashes. If the file is not available in backendBucket or the
+ // load balancer cannot reach the BackendBucket, a simple Not Found Error is
+ // returned to the client. The value must be from 1 to 1024 characters
+ Path string `json:"path,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "MatchResponseCodes") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "MatchResponseCodes") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s CustomErrorResponsePolicyCustomErrorResponseRule) MarshalJSON() ([]byte, error) {
+ type NoMethod CustomErrorResponsePolicyCustomErrorResponseRule
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type CustomerEncryptionKey struct {
- // KmsKeyName: The name of the encryption key that is stored in Google
- // Cloud KMS. For example: "kmsKeyName":
+ // KmsKeyName: The name of the encryption key that is stored in Google Cloud
+ // KMS. For example: "kmsKeyName":
// "projects/kms_project_id/locations/region/keyRings/
- // key_region/cryptoKeys/key The fully-qualifed key name may be returned
- // for resource GET requests. For example: "kmsKeyName":
+ // key_region/cryptoKeys/key The fully-qualifed key name may be returned for
+ // resource GET requests. For example: "kmsKeyName":
// "projects/kms_project_id/locations/region/keyRings/
// key_region/cryptoKeys/key /cryptoKeyVersions/1
KmsKeyName string `json:"kmsKeyName,omitempty"`
-
- // KmsKeyServiceAccount: The service account being used for the
- // encryption request for the given KMS key. If absent, the Compute
- // Engine default service account is used. For example:
- // "kmsKeyServiceAccount": "name@project_id.iam.gserviceaccount.com/
+ // KmsKeyServiceAccount: The service account being used for the encryption
+ // request for the given KMS key. If absent, the Compute Engine default service
+ // account is used. For example: "kmsKeyServiceAccount":
+ // "name@project_id.iam.gserviceaccount.com/
KmsKeyServiceAccount string `json:"kmsKeyServiceAccount,omitempty"`
-
- // RawKey: Specifies a 256-bit customer-supplied encryption key, encoded
- // in RFC 4648 base64 to either encrypt or decrypt this resource. You
- // can provide either the rawKey or the rsaEncryptedKey. For example:
- // "rawKey": "SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0="
+ // RawKey: Specifies a 256-bit customer-supplied encryption key, encoded in RFC
+ // 4648 base64 to either encrypt or decrypt this resource. You can provide
+ // either the rawKey or the rsaEncryptedKey. For example: "rawKey":
+ // "SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0="
RawKey string `json:"rawKey,omitempty"`
-
- // RsaEncryptedKey: Specifies an RFC 4648 base64 encoded, RSA-wrapped
- // 2048-bit customer-supplied encryption key to either encrypt or
- // decrypt this resource. You can provide either the rawKey or the
- // rsaEncryptedKey. For example: "rsaEncryptedKey":
- // "ieCx/NcW06PcT7Ep1X6LUTc/hLvUDYyzSZPPVCVPTVEohpeHASqC8uw5TzyO9U+Fka9JF
- // H
- // z0mBibXUInrC/jEk014kCK/NPjYgEMOyssZ4ZINPKxlUh2zn1bV+MCaTICrdmuSBTWlUUi
- // FoD
- // D6PYznLwh8ZNdaheCeZ8ewEXgFQ8V+sDroLaN3Xs3MDTXQEMMoNUXMCZEIpg9Vtp9x2oe=
- // =" The key must meet the following requirements before you can
- // provide it to Compute Engine: 1. The key is wrapped using a RSA
- // public key certificate provided by Google. 2. After being wrapped,
- // the key must be encoded in RFC 4648 base64 encoding. Gets the RSA
- // public key certificate provided by Google at:
- // https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
+ // RsaEncryptedKey: Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit
+ // customer-supplied encryption key to either encrypt or decrypt this resource.
+ // You can provide either the rawKey or the rsaEncryptedKey. For example:
+ // "rsaEncryptedKey":
+ // "ieCx/NcW06PcT7Ep1X6LUTc/hLvUDYyzSZPPVCVPTVEohpeHASqC8uw5TzyO9U+Fka9JFH
+ // z0mBibXUInrC/jEk014kCK/NPjYgEMOyssZ4ZINPKxlUh2zn1bV+MCaTICrdmuSBTWlUUiFoD
+ // D6PYznLwh8ZNdaheCeZ8ewEXgFQ8V+sDroLaN3Xs3MDTXQEMMoNUXMCZEIpg9Vtp9x2oe==" The
+ // key must meet the following requirements before you can provide it to
+ // Compute Engine: 1. The key is wrapped using a RSA public key certificate
+ // provided by Google. 2. After being wrapped, the key must be encoded in RFC
+ // 4648 base64 encoding. Gets the RSA public key certificate provided by Google
+ // at: https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
RsaEncryptedKey string `json:"rsaEncryptedKey,omitempty"`
-
// Sha256: [Output only] The RFC 4648 base64 encoded SHA-256 hash of the
// customer-supplied encryption key that protects this resource.
Sha256 string `json:"sha256,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "KmsKeyName") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "KmsKeyName") 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. "KmsKeyName") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *CustomerEncryptionKey) MarshalJSON() ([]byte, error) {
+func (s CustomerEncryptionKey) MarshalJSON() ([]byte, error) {
type NoMethod CustomerEncryptionKey
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type CustomerEncryptionKeyProtectedDisk struct {
// DiskEncryptionKey: Decrypts data associated with the disk with a
// customer-supplied encryption key.
DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
-
- // Source: Specifies a valid partial or full URL to an existing
- // Persistent Disk resource. This field is only applicable for
- // persistent disks. For example: "source":
- // "/compute/v1/projects/project_id/zones/zone/disks/ disk_name
+ // Source: Specifies a valid partial or full URL to an existing Persistent Disk
+ // resource. This field is only applicable for persistent disks. For example:
+ // "source": "/compute/v1/projects/project_id/zones/zone/disks/ disk_name
Source string `json:"source,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "DiskEncryptionKey")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "DiskEncryptionKey") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "DiskEncryptionKey") 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. "DiskEncryptionKey") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *CustomerEncryptionKeyProtectedDisk) MarshalJSON() ([]byte, error) {
+func (s CustomerEncryptionKeyProtectedDisk) MarshalJSON() ([]byte, error) {
type NoMethod CustomerEncryptionKeyProtectedDisk
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// DeprecationStatus: Deprecation status for a public resource.
type DeprecationStatus struct {
- // Deleted: An optional RFC3339 timestamp on or after which the state of
- // this resource is intended to change to DELETED. This is only
- // informational and the status will not change unless the client
- // explicitly changes it.
+ // Deleted: An optional RFC3339 timestamp on or after which the state of this
+ // resource is intended to change to DELETED. This is only informational and
+ // the status will not change unless the client explicitly changes it.
Deleted string `json:"deleted,omitempty"`
-
- // Deprecated -- An optional RFC3339 timestamp on or after which the
- // state of this resource is intended to change to DEPRECATED. This is
- // only informational and the status will not change unless the client
- // explicitly changes it.
+ // Deprecated -- An optional RFC3339 timestamp on or after which the state of
+ // this resource is intended to change to DEPRECATED. This is only
+ // informational and the status will not change unless the client explicitly
+ // changes it.
Deprecated string `json:"deprecated,omitempty"`
-
- // Obsolete: An optional RFC3339 timestamp on or after which the state
- // of this resource is intended to change to OBSOLETE. This is only
- // informational and the status will not change unless the client
- // explicitly changes it.
+ // Obsolete: An optional RFC3339 timestamp on or after which the state of this
+ // resource is intended to change to OBSOLETE. This is only informational and
+ // the status will not change unless the client explicitly changes it.
Obsolete string `json:"obsolete,omitempty"`
-
- // Replacement: The URL of the suggested replacement for a deprecated
- // resource. The suggested replacement resource must be the same kind of
- // resource as the deprecated resource.
+ // Replacement: The URL of the suggested replacement for a deprecated resource.
+ // The suggested replacement resource must be the same kind of resource as the
+ // deprecated resource.
Replacement string `json:"replacement,omitempty"`
-
// State: The deprecation state of this resource. This can be ACTIVE,
- // DEPRECATED, OBSOLETE, or DELETED. Operations which communicate the
- // end of life date for an image, can use ACTIVE. Operations which
- // create a new resource using a DEPRECATED resource will return
- // successfully, but with a warning indicating the deprecated resource
- // and recommending its replacement. Operations which use OBSOLETE or
- // DELETED resources will be rejected and result in an error.
+ // DEPRECATED, OBSOLETE, or DELETED. Operations which communicate the end of
+ // life date for an image, can use ACTIVE. Operations which create a new
+ // resource using a DEPRECATED resource will return successfully, but with a
+ // warning indicating the deprecated resource and recommending its replacement.
+ // Operations which use OBSOLETE or DELETED resources will be rejected and
+ // result in an error.
//
// Possible values:
// "ACTIVE"
@@ -9438,220 +8093,187 @@ type DeprecationStatus struct {
// "DEPRECATED"
// "OBSOLETE"
State string `json:"state,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Deleted") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Deleted") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Deleted") 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. "Deleted") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *DeprecationStatus) MarshalJSON() ([]byte, error) {
+func (s DeprecationStatus) MarshalJSON() ([]byte, error) {
type NoMethod DeprecationStatus
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// Disk: Represents a Persistent Disk resource. Google Compute Engine
-// has two Disk resources: * Zonal
-// (/compute/docs/reference/rest/v1/disks) * Regional
-// (/compute/docs/reference/rest/v1/regionDisks) Persistent disks are
-// required for running your VM instances. Create both boot and non-boot
-// (data) persistent disks. For more information, read Persistent Disks.
-// For more storage options, read Storage options. The disks resource
-// represents a zonal persistent disk. For more information, read Zonal
-// persistent disks. The regionDisks resource represents a regional
-// persistent disk. For more information, read Regional resources.
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+// Disk: Represents a Persistent Disk resource. Google Compute Engine has two
+// Disk resources: * Zonal (/compute/docs/reference/rest/v1/disks) * Regional
+// (/compute/docs/reference/rest/v1/regionDisks) Persistent disks are required
+// for running your VM instances. Create both boot and non-boot (data)
+// persistent disks. For more information, read Persistent Disks. For more
+// storage options, read Storage options. The disks resource represents a zonal
+// persistent disk. For more information, read Zonal persistent disks. The
+// regionDisks resource represents a regional persistent disk. For more
+// information, read Regional resources.
type Disk struct {
+ // AccessMode: The access mode of the disk. - READ_WRITE_SINGLE: The default
+ // AccessMode, means the disk can be attached to single instance in RW mode. -
+ // READ_WRITE_MANY: The AccessMode means the disk can be attached to multiple
+ // instances in RW mode. - READ_ONLY_MANY: The AccessMode means the disk can be
+ // attached to multiple instances in RO mode. The AccessMode is only valid for
+ // Hyperdisk disk types.
+ //
+ // Possible values:
+ // "READ_ONLY_MANY" - The AccessMode means the disk can be attached to
+ // multiple instances in RO mode.
+ // "READ_WRITE_MANY" - The AccessMode means the disk can be attached to
+ // multiple instances in RW mode.
+ // "READ_WRITE_SINGLE" - The default AccessMode, means the disk can be
+ // attached to single instance in RW mode.
+ AccessMode string `json:"accessMode,omitempty"`
// Architecture: The architecture of the disk. Valid values are ARM64 or
// X86_64.
//
// Possible values:
- // "ARCHITECTURE_UNSPECIFIED" - Default value indicating Architecture
- // is not set.
+ // "ARCHITECTURE_UNSPECIFIED" - Default value indicating Architecture is not
+ // set.
// "ARM64" - Machines with architecture ARM64
// "X86_64" - Machines with architecture X86_64
Architecture string `json:"architecture,omitempty"`
-
// AsyncPrimaryDisk: Disk asynchronously replicated into this disk.
AsyncPrimaryDisk *DiskAsyncReplication `json:"asyncPrimaryDisk,omitempty"`
-
// AsyncSecondaryDisks: [Output Only] A list of disks this disk is
// asynchronously replicated to.
AsyncSecondaryDisks map[string]DiskAsyncReplicationList `json:"asyncSecondaryDisks,omitempty"`
-
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // DiskEncryptionKey: Encrypts the disk using a customer-supplied
- // encryption key or a customer-managed encryption key. Encryption keys
- // do not protect access to metadata of the disk. After you encrypt a
- // disk with a customer-supplied key, you must provide the same key if
- // you use the disk later. For example, to create a disk snapshot, to
- // create a disk image, to create a machine image, or to attach the disk
- // to a virtual machine. After you encrypt a disk with a
- // customer-managed key, the diskEncryptionKey.kmsKeyName is set to a
- // key *version* name once the disk is created. The disk is encrypted
- // with this version of the key. In the response,
- // diskEncryptionKey.kmsKeyName appears in the following format:
+ // DiskEncryptionKey: Encrypts the disk using a customer-supplied encryption
+ // key or a customer-managed encryption key. Encryption keys do not protect
+ // access to metadata of the disk. After you encrypt a disk with a
+ // customer-supplied key, you must provide the same key if you use the disk
+ // later. For example, to create a disk snapshot, to create a disk image, to
+ // create a machine image, or to attach the disk to a virtual machine. After
+ // you encrypt a disk with a customer-managed key, the
+ // diskEncryptionKey.kmsKeyName is set to a key *version* name once the disk is
+ // created. The disk is encrypted with this version of the key. In the
+ // response, diskEncryptionKey.kmsKeyName appears in the following format:
// "diskEncryptionKey.kmsKeyName":
// "projects/kms_project_id/locations/region/keyRings/
- // key_region/cryptoKeys/key /cryptoKeysVersions/version If you do not
- // provide an encryption key when creating the disk, then the disk is
- // encrypted using an automatically generated key and you don't need to
- // provide a key to use the disk later.
+ // key_region/cryptoKeys/key /cryptoKeysVersions/version If you do not provide
+ // an encryption key when creating the disk, then the disk is encrypted using
+ // an automatically generated key and you don't need to provide a key to use
+ // the disk later.
DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
-
- // EnableConfidentialCompute: Whether this disk is using confidential
- // compute mode.
+ // EnableConfidentialCompute: Whether this disk is using confidential compute
+ // mode.
EnableConfidentialCompute bool `json:"enableConfidentialCompute,omitempty"`
-
- // GuestOsFeatures: A list of features to enable on the guest operating
- // system. Applicable only for bootable images. Read Enabling guest
- // operating system features to see a list of available options.
+ // GuestOsFeatures: A list of features to enable on the guest operating system.
+ // Applicable only for bootable images. Read Enabling guest operating system
+ // features to see a list of available options.
GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
- // Kind: [Output Only] Type of the resource. Always compute#disk for
- // disks.
+ // Kind: [Output Only] Type of the resource. Always compute#disk for disks.
Kind string `json:"kind,omitempty"`
-
- // LabelFingerprint: A fingerprint for the labels being applied to this
- // disk, which is essentially a hash of the labels set used for
- // optimistic locking. The fingerprint is initially generated by Compute
- // Engine and changes after every request to modify or update labels.
- // You must always provide an up-to-date fingerprint hash in order to
- // update or change labels, otherwise the request will fail with error
- // 412 conditionNotMet. To see the latest fingerprint, make a get()
- // request to retrieve a disk.
+ // LabelFingerprint: A fingerprint for the labels being applied to this disk,
+ // which is essentially a hash of the labels set used for optimistic locking.
+ // The fingerprint is initially generated by Compute Engine and changes after
+ // every request to modify or update labels. You must always provide an
+ // up-to-date fingerprint hash in order to update or change labels, otherwise
+ // the request will fail with error 412 conditionNotMet. To see the latest
+ // fingerprint, make a get() request to retrieve a disk.
LabelFingerprint string `json:"labelFingerprint,omitempty"`
-
- // Labels: Labels to apply to this disk. These can be later modified by
- // the setLabels method.
+ // Labels: Labels to apply to this disk. These can be later modified by the
+ // setLabels method.
Labels map[string]string `json:"labels,omitempty"`
-
- // LastAttachTimestamp: [Output Only] Last attach timestamp in RFC3339
- // text format.
+ // LastAttachTimestamp: [Output Only] Last attach timestamp in RFC3339 text
+ // format.
LastAttachTimestamp string `json:"lastAttachTimestamp,omitempty"`
-
- // LastDetachTimestamp: [Output Only] Last detach timestamp in RFC3339
- // text format.
+ // LastDetachTimestamp: [Output Only] Last detach timestamp in RFC3339 text
+ // format.
LastDetachTimestamp string `json:"lastDetachTimestamp,omitempty"`
-
- // LicenseCodes: Integer license codes indicating which licenses are
- // attached to this disk.
+ // LicenseCodes: Integer license codes indicating which licenses are attached
+ // to this disk.
LicenseCodes googleapi.Int64s `json:"licenseCodes,omitempty"`
-
- // Licenses: A list of publicly visible licenses. Reserved for Google's
- // use.
+ // Licenses: A list of publicly visible licenses. Reserved for Google's use.
Licenses []string `json:"licenses,omitempty"`
-
- // LocationHint: An opaque location hint used to place the disk close to
- // other resources. This field is for use by internal tools that use the
- // public API.
+ // LocationHint: An opaque location hint used to place the disk close to other
+ // resources. This field is for use by internal tools that use the public API.
LocationHint string `json:"locationHint,omitempty"`
-
- // Name: Name of the resource. Provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
- // the first character must be a lowercase letter, and all following
- // characters must be a dash, lowercase letter, or digit, except the
- // last character, which cannot be a dash.
+ // Name: Name of the resource. Provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must
+ // be a lowercase letter, and all following characters must be a dash,
+ // lowercase letter, or digit, except the last character, which cannot be a
+ // dash.
Name string `json:"name,omitempty"`
-
// Options: Internal use only.
Options string `json:"options,omitempty"`
-
- // Params: Input only. [Input Only] Additional params passed with the
- // request, but not persisted as part of resource payload.
+ // Params: Input only. [Input Only] Additional params passed with the request,
+ // but not persisted as part of resource payload.
Params *DiskParams `json:"params,omitempty"`
-
- // PhysicalBlockSizeBytes: Physical block size of the persistent disk,
- // in bytes. If not present in a request, a default value is used. The
- // currently supported size is 4096, other sizes may be added in the
- // future. If an unsupported value is requested, the error message will
- // list the supported values for the caller's project.
+ // PhysicalBlockSizeBytes: Physical block size of the persistent disk, in
+ // bytes. If not present in a request, a default value is used. The currently
+ // supported size is 4096, other sizes may be added in the future. If an
+ // unsupported value is requested, the error message will list the supported
+ // values for the caller's project.
PhysicalBlockSizeBytes int64 `json:"physicalBlockSizeBytes,omitempty,string"`
-
- // ProvisionedIops: Indicates how many IOPS to provision for the disk.
- // This sets the number of I/O operations per second that the disk can
- // handle. Values must be between 10,000 and 120,000. For more details,
- // see the Extreme persistent disk documentation.
+ // ProvisionedIops: Indicates how many IOPS to provision for the disk. This
+ // sets the number of I/O operations per second that the disk can handle.
+ // Values must be between 10,000 and 120,000. For more details, see the Extreme
+ // persistent disk documentation.
ProvisionedIops int64 `json:"provisionedIops,omitempty,string"`
-
- // ProvisionedThroughput: Indicates how much throughput to provision for
- // the disk. This sets the number of throughput mb per second that the
- // disk can handle. Values must be between 1 and 7,124.
+ // ProvisionedThroughput: Indicates how much throughput to provision for the
+ // disk. This sets the number of throughput mb per second that the disk can
+ // handle. Values must be greater than or equal to 1.
ProvisionedThroughput int64 `json:"provisionedThroughput,omitempty,string"`
-
// Region: [Output Only] URL of the region where the disk resides. Only
- // applicable for regional resources. You must specify this field as
- // part of the HTTP request URL. It is not settable as a field in the
- // request body.
+ // applicable for regional resources. You must specify this field as part of
+ // the HTTP request URL. It is not settable as a field in the request body.
Region string `json:"region,omitempty"`
-
- // ReplicaZones: URLs of the zones where the disk should be replicated
- // to. Only applicable for regional resources.
+ // ReplicaZones: URLs of the zones where the disk should be replicated to. Only
+ // applicable for regional resources.
ReplicaZones []string `json:"replicaZones,omitempty"`
-
- // ResourcePolicies: Resource policies applied to this disk for
- // automatic snapshot creations.
+ // ResourcePolicies: Resource policies applied to this disk for automatic
+ // snapshot creations.
ResourcePolicies []string `json:"resourcePolicies,omitempty"`
-
- // ResourceStatus: [Output Only] Status information for the disk
- // resource.
+ // ResourceStatus: [Output Only] Status information for the disk resource.
ResourceStatus *DiskResourceStatus `json:"resourceStatus,omitempty"`
-
// SatisfiesPzi: Output only. Reserved for future use.
SatisfiesPzi bool `json:"satisfiesPzi,omitempty"`
-
// SatisfiesPzs: [Output Only] Reserved for future use.
SatisfiesPzs bool `json:"satisfiesPzs,omitempty"`
-
// SelfLink: [Output Only] Server-defined fully-qualified URL for this
// resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // SizeGb: Size, in GB, of the persistent disk. You can specify this
- // field when creating a persistent disk using the sourceImage,
- // sourceSnapshot, or sourceDisk parameter, or specify it alone to
- // create an empty persistent disk. If you specify this field along with
- // a source, the value of sizeGb must not be less than the size of the
- // source. Acceptable values are greater than 0.
+ // SizeGb: Size, in GB, of the persistent disk. You can specify this field when
+ // creating a persistent disk using the sourceImage, sourceSnapshot, or
+ // sourceDisk parameter, or specify it alone to create an empty persistent
+ // disk. If you specify this field along with a source, the value of sizeGb
+ // must not be less than the size of the source. Acceptable values are greater
+ // than 0.
SizeGb int64 `json:"sizeGb,omitempty,string"`
-
// SourceConsistencyGroupPolicy: [Output Only] URL of the
- // DiskConsistencyGroupPolicy for a secondary disk that was created
- // using a consistency group.
+ // DiskConsistencyGroupPolicy for a secondary disk that was created using a
+ // consistency group.
SourceConsistencyGroupPolicy string `json:"sourceConsistencyGroupPolicy,omitempty"`
-
// SourceConsistencyGroupPolicyId: [Output Only] ID of the
- // DiskConsistencyGroupPolicy for a secondary disk that was created
- // using a consistency group.
+ // DiskConsistencyGroupPolicy for a secondary disk that was created using a
+ // consistency group.
SourceConsistencyGroupPolicyId string `json:"sourceConsistencyGroupPolicyId,omitempty"`
-
- // SourceDisk: The source disk used to create this disk. You can provide
- // this as a partial or full URL to the resource. For example, the
- // following are valid values: -
+ // SourceDisk: The source disk used to create this disk. You can provide this
+ // as a partial or full URL to the resource. For example, the following are
+ // valid values: -
// https://www.googleapis.com/compute/v1/projects/project/zones/zone
// /disks/disk -
// https://www.googleapis.com/compute/v1/projects/project/regions/region
@@ -9659,77 +8281,80 @@ type Disk struct {
// projects/project/regions/region/disks/disk - zones/zone/disks/disk -
// regions/region/disks/disk
SourceDisk string `json:"sourceDisk,omitempty"`
-
- // SourceDiskId: [Output Only] The unique ID of the disk used to create
- // this disk. This value identifies the exact disk that was used to
- // create this persistent disk. For example, if you created the
- // persistent disk from a disk that was later deleted and recreated
- // under the same name, the source disk ID would identify the exact
- // version of the disk that was used.
+ // SourceDiskId: [Output Only] The unique ID of the disk used to create this
+ // disk. This value identifies the exact disk that was used to create this
+ // persistent disk. For example, if you created the persistent disk from a disk
+ // that was later deleted and recreated under the same name, the source disk ID
+ // would identify the exact version of the disk that was used.
SourceDiskId string `json:"sourceDiskId,omitempty"`
-
- // SourceImage: The source image used to create this disk. If the source
- // image is deleted, this field will not be set. To create a disk with
- // one of the public operating system images, specify the image by its
- // family name. For example, specify family/debian-9 to use the latest
- // Debian 9 image: projects/debian-cloud/global/images/family/debian-9
- // Alternatively, use a specific version of a public operating system
- // image: projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD
- // To create a disk with a custom image that you created, specify the
- // image name in the following format: global/images/my-custom-image You
- // can also specify a custom image by its image family, which returns
- // the latest version of the image in that family. Replace the image
- // name with family/family-name: global/images/family/my-image-family
+ // SourceImage: The source image used to create this disk. If the source image
+ // is deleted, this field will not be set. To create a disk with one of the
+ // public operating system images, specify the image by its family name. For
+ // example, specify family/debian-9 to use the latest Debian 9 image:
+ // projects/debian-cloud/global/images/family/debian-9 Alternatively, use a
+ // specific version of a public operating system image:
+ // projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD To create a
+ // disk with a custom image that you created, specify the image name in the
+ // following format: global/images/my-custom-image You can also specify a
+ // custom image by its image family, which returns the latest version of the
+ // image in that family. Replace the image name with family/family-name:
+ // global/images/family/my-image-family
SourceImage string `json:"sourceImage,omitempty"`
-
- // SourceImageEncryptionKey: The customer-supplied encryption key of the
- // source image. Required if the source image is protected by a
- // customer-supplied encryption key.
+ // SourceImageEncryptionKey: The customer-supplied encryption key of the source
+ // image. Required if the source image is protected by a customer-supplied
+ // encryption key.
SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"`
-
- // SourceImageId: [Output Only] The ID value of the image used to create
- // this disk. This value identifies the exact image that was used to
- // create this persistent disk. For example, if you created the
- // persistent disk from an image that was later deleted and recreated
- // under the same name, the source image ID would identify the exact
- // version of the image that was used.
+ // SourceImageId: [Output Only] The ID value of the image used to create this
+ // disk. This value identifies the exact image that was used to create this
+ // persistent disk. For example, if you created the persistent disk from an
+ // image that was later deleted and recreated under the same name, the source
+ // image ID would identify the exact version of the image that was used.
SourceImageId string `json:"sourceImageId,omitempty"`
-
- // SourceSnapshot: The source snapshot used to create this disk. You can
- // provide this as a partial or full URL to the resource. For example,
+ // SourceInstantSnapshot: The source instant snapshot used to create this disk.
+ // You can provide this as a partial or full URL to the resource. For example,
// the following are valid values: -
+ // https://www.googleapis.com/compute/v1/projects/project/zones/zone
+ // /instantSnapshots/instantSnapshot -
+ // projects/project/zones/zone/instantSnapshots/instantSnapshot -
+ // zones/zone/instantSnapshots/instantSnapshot
+ SourceInstantSnapshot string `json:"sourceInstantSnapshot,omitempty"`
+ // SourceInstantSnapshotId: [Output Only] The unique ID of the instant snapshot
+ // used to create this disk. This value identifies the exact instant snapshot
+ // that was used to create this persistent disk. For example, if you created
+ // the persistent disk from an instant snapshot that was later deleted and
+ // recreated under the same name, the source instant snapshot ID would identify
+ // the exact version of the instant snapshot that was used.
+ SourceInstantSnapshotId string `json:"sourceInstantSnapshotId,omitempty"`
+ // SourceSnapshot: The source snapshot used to create this disk. You can
+ // provide this as a partial or full URL to the resource. For example, the
+ // following are valid values: -
// https://www.googleapis.com/compute/v1/projects/project
- // /global/snapshots/snapshot -
- // projects/project/global/snapshots/snapshot -
+ // /global/snapshots/snapshot - projects/project/global/snapshots/snapshot -
// global/snapshots/snapshot
SourceSnapshot string `json:"sourceSnapshot,omitempty"`
-
- // SourceSnapshotEncryptionKey: The customer-supplied encryption key of
- // the source snapshot. Required if the source snapshot is protected by
- // a customer-supplied encryption key.
+ // SourceSnapshotEncryptionKey: The customer-supplied encryption key of the
+ // source snapshot. Required if the source snapshot is protected by a
+ // customer-supplied encryption key.
SourceSnapshotEncryptionKey *CustomerEncryptionKey `json:"sourceSnapshotEncryptionKey,omitempty"`
-
- // SourceSnapshotId: [Output Only] The unique ID of the snapshot used to
- // create this disk. This value identifies the exact snapshot that was
- // used to create this persistent disk. For example, if you created the
- // persistent disk from a snapshot that was later deleted and recreated
- // under the same name, the source snapshot ID would identify the exact
- // version of the snapshot that was used.
+ // SourceSnapshotId: [Output Only] The unique ID of the snapshot used to create
+ // this disk. This value identifies the exact snapshot that was used to create
+ // this persistent disk. For example, if you created the persistent disk from a
+ // snapshot that was later deleted and recreated under the same name, the
+ // source snapshot ID would identify the exact version of the snapshot that was
+ // used.
SourceSnapshotId string `json:"sourceSnapshotId,omitempty"`
-
- // SourceStorageObject: The full Google Cloud Storage URI where the disk
- // image is stored. This file must be a gzip-compressed tarball whose
- // name ends in .tar.gz or virtual machine disk whose name ends in vmdk.
- // Valid URIs may start with gs:// or https://storage.googleapis.com/.
- // This flag is not optimized for creating multiple disks from a source
- // storage object. To create many disks from a source storage object,
- // use gcloud compute images import instead.
+ // SourceStorageObject: The full Google Cloud Storage URI where the disk image
+ // is stored. This file must be a gzip-compressed tarball whose name ends in
+ // .tar.gz or virtual machine disk whose name ends in vmdk. Valid URIs may
+ // start with gs:// or https://storage.googleapis.com/. This flag is not
+ // optimized for creating multiple disks from a source storage object. To
+ // create many disks from a source storage object, use gcloud compute images
+ // import instead.
SourceStorageObject string `json:"sourceStorageObject,omitempty"`
-
- // Status: [Output Only] The status of disk creation. - CREATING: Disk
- // is provisioning. - RESTORING: Source data is being copied into the
- // disk. - FAILED: Disk creation failed. - READY: Disk is ready for use.
- // - DELETING: Disk is deleting.
+ // Status: [Output Only] The status of disk creation. - CREATING: Disk is
+ // provisioning. - RESTORING: Source data is being copied into the disk. -
+ // FAILED: Disk creation failed. - READY: Disk is ready for use. - DELETING:
+ // Disk is deleting.
//
// Possible values:
// "CREATING" - Disk is provisioning
@@ -9737,1633 +8362,1300 @@ type Disk struct {
// "FAILED" - Disk creation failed.
// "READY" - Disk is ready for use.
// "RESTORING" - Source data is being copied into the disk.
+ // "UNAVAILABLE" - Disk is currently unavailable and cannot be accessed,
+ // attached or detached.
Status string `json:"status,omitempty"`
-
- // Type: URL of the disk type resource describing which disk type to use
- // to create the disk. Provide this when creating the disk. For example:
- // projects/project /zones/zone/diskTypes/pd-ssd . See Persistent disk
- // types.
+ // StoragePool: The storage pool in which the new disk is created. You can
+ // provide this as a partial or full URL to the resource. For example, the
+ // following are valid values: -
+ // https://www.googleapis.com/compute/v1/projects/project/zones/zone
+ // /storagePools/storagePool -
+ // projects/project/zones/zone/storagePools/storagePool -
+ // zones/zone/storagePools/storagePool
+ StoragePool string `json:"storagePool,omitempty"`
+ // Type: URL of the disk type resource describing which disk type to use to
+ // create the disk. Provide this when creating the disk. For example:
+ // projects/project /zones/zone/diskTypes/pd-ssd . See Persistent disk types.
Type string `json:"type,omitempty"`
-
- // Users: [Output Only] Links to the users of the disk (attached
- // instances) in form: projects/project/zones/zone/instances/instance
+ // Users: [Output Only] Links to the users of the disk (attached instances) in
+ // form: projects/project/zones/zone/instances/instance
Users []string `json:"users,omitempty"`
-
- // Zone: [Output Only] URL of the zone where the disk resides. You must
- // specify this field as part of the HTTP request URL. It is not
- // settable as a field in the request body.
+ // Zone: [Output Only] URL of the zone where the disk resides. You must specify
+ // this field as part of the HTTP request URL. It is not settable as a field in
+ // the request body.
Zone string `json:"zone,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Architecture") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "AccessMode") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Architecture") 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. "AccessMode") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *Disk) MarshalJSON() ([]byte, error) {
+func (s Disk) MarshalJSON() ([]byte, error) {
type NoMethod Disk
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type DiskAggregatedList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of DisksScopedList resources.
Items map[string]DisksScopedList `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource. Always
- // compute#diskAggregatedList for aggregated lists of persistent disks.
+ // Kind: [Output Only] Type of resource. Always compute#diskAggregatedList for
+ // aggregated lists of persistent disks.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Unreachables: [Output Only] Unreachable resources.
Unreachables []string `json:"unreachables,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *DiskAggregatedListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *DiskAggregatedList) MarshalJSON() ([]byte, error) {
+func (s DiskAggregatedList) MarshalJSON() ([]byte, error) {
type NoMethod DiskAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// DiskAggregatedListWarning: [Output Only] Informational warning
-// message.
+// DiskAggregatedListWarning: [Output Only] Informational warning message.
type DiskAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*DiskAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *DiskAggregatedListWarning) MarshalJSON() ([]byte, error) {
+func (s DiskAggregatedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod DiskAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type DiskAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *DiskAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+func (s DiskAggregatedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod DiskAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type DiskAsyncReplication struct {
- // ConsistencyGroupPolicy: [Output Only] URL of the
- // DiskConsistencyGroupPolicy if replication was started on the disk as
- // a member of a group.
+ // ConsistencyGroupPolicy: [Output Only] URL of the DiskConsistencyGroupPolicy
+ // if replication was started on the disk as a member of a group.
ConsistencyGroupPolicy string `json:"consistencyGroupPolicy,omitempty"`
-
- // ConsistencyGroupPolicyId: [Output Only] ID of the
- // DiskConsistencyGroupPolicy if replication was started on the disk as
- // a member of a group.
+ // ConsistencyGroupPolicyId: [Output Only] ID of the DiskConsistencyGroupPolicy
+ // if replication was started on the disk as a member of a group.
ConsistencyGroupPolicyId string `json:"consistencyGroupPolicyId,omitempty"`
-
- // Disk: The other disk asynchronously replicated to or from the current
- // disk. You can provide this as a partial or full URL to the resource.
- // For example, the following are valid values: -
+ // Disk: The other disk asynchronously replicated to or from the current disk.
+ // You can provide this as a partial or full URL to the resource. For example,
+ // the following are valid values: -
// https://www.googleapis.com/compute/v1/projects/project/zones/zone
- // /disks/disk - projects/project/zones/zone/disks/disk -
- // zones/zone/disks/disk
+ // /disks/disk - projects/project/zones/zone/disks/disk - zones/zone/disks/disk
Disk string `json:"disk,omitempty"`
-
// DiskId: [Output Only] The unique ID of the other disk asynchronously
- // replicated to or from the current disk. This value identifies the
- // exact disk that was used to create this replication. For example, if
- // you started replicating the persistent disk from a disk that was
- // later deleted and recreated under the same name, the disk ID would
- // identify the exact version of the disk that was used.
+ // replicated to or from the current disk. This value identifies the exact disk
+ // that was used to create this replication. For example, if you started
+ // replicating the persistent disk from a disk that was later deleted and
+ // recreated under the same name, the disk ID would identify the exact version
+ // of the disk that was used.
DiskId string `json:"diskId,omitempty"`
-
- // ForceSendFields is a list of field names (e.g.
- // "ConsistencyGroupPolicy") to unconditionally include in API requests.
- // By default, fields with empty or default 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. "ConsistencyGroupPolicy")
- // 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.
+ // ForceSendFields is a list of field names (e.g. "ConsistencyGroupPolicy") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "ConsistencyGroupPolicy") to
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *DiskAsyncReplication) MarshalJSON() ([]byte, error) {
+func (s DiskAsyncReplication) MarshalJSON() ([]byte, error) {
type NoMethod DiskAsyncReplication
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type DiskAsyncReplicationList struct {
AsyncReplicationDisk *DiskAsyncReplication `json:"asyncReplicationDisk,omitempty"`
-
- // ForceSendFields is a list of field names (e.g.
- // "AsyncReplicationDisk") to unconditionally include in API requests.
- // By default, fields with empty or default 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. "AsyncReplicationDisk") 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.
+ // ForceSendFields is a list of field names (e.g. "AsyncReplicationDisk") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "AsyncReplicationDisk") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *DiskAsyncReplicationList) MarshalJSON() ([]byte, error) {
+func (s DiskAsyncReplicationList) MarshalJSON() ([]byte, error) {
type NoMethod DiskAsyncReplicationList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// DiskInstantiationConfig: A specification of the desired way to
-// instantiate a disk in the instance template when its created from a
-// source instance.
+// DiskInstantiationConfig: A specification of the desired way to instantiate a
+// disk in the instance template when its created from a source instance.
type DiskInstantiationConfig struct {
// AutoDelete: Specifies whether the disk will be auto-deleted when the
- // instance is deleted (but not when the disk is detached from the
- // instance).
+ // instance is deleted (but not when the disk is detached from the instance).
AutoDelete bool `json:"autoDelete,omitempty"`
-
- // CustomImage: The custom source image to be used to restore this disk
- // when instantiating this instance template.
+ // CustomImage: The custom source image to be used to restore this disk when
+ // instantiating this instance template.
CustomImage string `json:"customImage,omitempty"`
-
// DeviceName: Specifies the device name of the disk to which the
// configurations apply to.
DeviceName string `json:"deviceName,omitempty"`
-
- // InstantiateFrom: Specifies whether to include the disk and what image
- // to use. Possible values are: - source-image: to use the same image
- // that was used to create the source instance's corresponding disk.
+ // InstantiateFrom: Specifies whether to include the disk and what image to
+ // use. Possible values are: - source-image: to use the same image that was
+ // used to create the source instance's corresponding disk. Applicable to the
+ // boot disk and additional read-write disks. - source-image-family: to use the
+ // same image family that was used to create the source instance's
+ // corresponding disk. Applicable to the boot disk and additional read-write
+ // disks. - custom-image: to use a user-provided image url for disk creation.
// Applicable to the boot disk and additional read-write disks. -
- // source-image-family: to use the same image family that was used to
- // create the source instance's corresponding disk. Applicable to the
- // boot disk and additional read-write disks. - custom-image: to use a
- // user-provided image url for disk creation. Applicable to the boot
- // disk and additional read-write disks. - attach-read-only: to attach a
- // read-only disk. Applicable to read-only disks. - do-not-include: to
- // exclude a disk from the template. Applicable to additional read-write
- // disks, local SSDs, and read-only disks.
- //
- // Possible values:
- // "ATTACH_READ_ONLY" - Attach the existing disk in read-only mode.
- // The request will fail if the disk was attached in read-write mode on
- // the source instance. Applicable to: read-only disks.
- // "BLANK" - Create a blank disk. The disk will be created
- // unformatted. Applicable to: additional read-write disks, local SSDs.
- // "CUSTOM_IMAGE" - Use the custom image specified in the custom_image
- // field. Applicable to: boot disk, additional read-write disks.
- // "DEFAULT" - Use the default instantiation option for the
- // corresponding type of disk. For boot disk and any other R/W disks,
- // new custom images will be created from each disk. For read-only
- // disks, they will be attached in read-only mode. Local SSD disks will
- // be created as blank volumes.
- // "DO_NOT_INCLUDE" - Do not include the disk in the instance
- // template. Applicable to: additional read-write disks, local SSDs,
- // read-only disks.
- // "SOURCE_IMAGE" - Use the same source image used for creation of the
- // source instance's corresponding disk. The request will fail if the
- // source VM's disk was created from a snapshot. Applicable to: boot
- // disk, additional read-write disks.
- // "SOURCE_IMAGE_FAMILY" - Use the same source image family used for
- // creation of the source instance's corresponding disk. The request
- // will fail if the source image of the source disk does not belong to
- // any image family. Applicable to: boot disk, additional read-write
+ // attach-read-only: to attach a read-only disk. Applicable to read-only disks.
+ // - do-not-include: to exclude a disk from the template. Applicable to
+ // additional read-write disks, local SSDs, and read-only disks.
+ //
+ // Possible values:
+ // "ATTACH_READ_ONLY" - Attach the existing disk in read-only mode. The
+ // request will fail if the disk was attached in read-write mode on the source
+ // instance. Applicable to: read-only disks.
+ // "BLANK" - Create a blank disk. The disk will be created unformatted.
+ // Applicable to: additional read-write disks, local SSDs.
+ // "CUSTOM_IMAGE" - Use the custom image specified in the custom_image field.
+ // Applicable to: boot disk, additional read-write disks.
+ // "DEFAULT" - Use the default instantiation option for the corresponding
+ // type of disk. For boot disk and any other R/W disks, new custom images will
+ // be created from each disk. For read-only disks, they will be attached in
+ // read-only mode. Local SSD disks will be created as blank volumes.
+ // "DO_NOT_INCLUDE" - Do not include the disk in the instance template.
+ // Applicable to: additional read-write disks, local SSDs, read-only disks.
+ // "SOURCE_IMAGE" - Use the same source image used for creation of the source
+ // instance's corresponding disk. The request will fail if the source VM's disk
+ // was created from a snapshot. Applicable to: boot disk, additional read-write
// disks.
+ // "SOURCE_IMAGE_FAMILY" - Use the same source image family used for creation
+ // of the source instance's corresponding disk. The request will fail if the
+ // source image of the source disk does not belong to any image family.
+ // Applicable to: boot disk, additional read-write disks.
InstantiateFrom string `json:"instantiateFrom,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "AutoDelete") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "AutoDelete") 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. "AutoDelete") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *DiskInstantiationConfig) MarshalJSON() ([]byte, error) {
+func (s DiskInstantiationConfig) MarshalJSON() ([]byte, error) {
type NoMethod DiskInstantiationConfig
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// DiskList: A list of Disk resources.
type DiskList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of Disk resources.
Items []*Disk `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource. Always compute#diskList for
- // lists of disks.
+ // Kind: [Output Only] Type of resource. Always compute#diskList for lists of
+ // disks.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *DiskListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *DiskList) MarshalJSON() ([]byte, error) {
+func (s DiskList) MarshalJSON() ([]byte, error) {
type NoMethod DiskList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// DiskListWarning: [Output Only] Informational warning message.
type DiskListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*DiskListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *DiskListWarning) MarshalJSON() ([]byte, error) {
+func (s DiskListWarning) MarshalJSON() ([]byte, error) {
type NoMethod DiskListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type DiskListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *DiskListWarningData) MarshalJSON() ([]byte, error) {
+func (s DiskListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod DiskListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type DiskMoveRequest struct {
- // DestinationZone: The URL of the destination zone to move the disk.
- // This can be a full or partial URL. For example, the following are all
- // valid URLs to a zone: -
- // https://www.googleapis.com/compute/v1/projects/project/zones/zone -
+ // DestinationZone: The URL of the destination zone to move the disk. This can
+ // be a full or partial URL. For example, the following are all valid URLs to a
+ // zone: - https://www.googleapis.com/compute/v1/projects/project/zones/zone -
// projects/project/zones/zone - zones/zone
DestinationZone string `json:"destinationZone,omitempty"`
-
// TargetDisk: The URL of the target disk to move. This can be a full or
- // partial URL. For example, the following are all valid URLs to a disk:
- // - https://www.googleapis.com/compute/v1/projects/project/zones/zone
- // /disks/disk - projects/project/zones/zone/disks/disk -
- // zones/zone/disks/disk
+ // partial URL. For example, the following are all valid URLs to a disk: -
+ // https://www.googleapis.com/compute/v1/projects/project/zones/zone
+ // /disks/disk - projects/project/zones/zone/disks/disk - zones/zone/disks/disk
TargetDisk string `json:"targetDisk,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "DestinationZone") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "DestinationZone") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "DestinationZone") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *DiskMoveRequest) MarshalJSON() ([]byte, error) {
+func (s DiskMoveRequest) MarshalJSON() ([]byte, error) {
type NoMethod DiskMoveRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// DiskParams: Additional disk params.
type DiskParams struct {
- // ResourceManagerTags: Resource manager tags to be bound to the disk.
- // Tag keys and values have the same definition as resource manager
- // tags. Keys must be in the format `tagKeys/{tag_key_id}`, and values
- // are in the format `tagValues/456`. The field is ignored (both PUT &
- // PATCH) when empty.
+ // ResourceManagerTags: Resource manager tags to be bound to the disk. Tag keys
+ // and values have the same definition as resource manager tags. Keys must be
+ // in the format `tagKeys/{tag_key_id}`, and values are in the format
+ // `tagValues/456`. The field is ignored (both PUT & PATCH) when empty.
ResourceManagerTags map[string]string `json:"resourceManagerTags,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "ResourceManagerTags")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "ResourceManagerTags") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "ResourceManagerTags") 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. "ResourceManagerTags") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *DiskParams) MarshalJSON() ([]byte, error) {
+func (s DiskParams) MarshalJSON() ([]byte, error) {
type NoMethod DiskParams
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type DiskResourceStatus struct {
AsyncPrimaryDisk *DiskResourceStatusAsyncReplicationStatus `json:"asyncPrimaryDisk,omitempty"`
-
// AsyncSecondaryDisks: Key: disk, value: AsyncReplicationStatus message
AsyncSecondaryDisks map[string]DiskResourceStatusAsyncReplicationStatus `json:"asyncSecondaryDisks,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "AsyncPrimaryDisk") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "AsyncPrimaryDisk") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "AsyncPrimaryDisk") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *DiskResourceStatus) MarshalJSON() ([]byte, error) {
+func (s DiskResourceStatus) MarshalJSON() ([]byte, error) {
type NoMethod DiskResourceStatus
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type DiskResourceStatusAsyncReplicationStatus struct {
// Possible values:
// "ACTIVE" - Replication is active.
- // "CREATED" - Secondary disk is created and is waiting for
- // replication to start.
+ // "CREATED" - Secondary disk is created and is waiting for replication to
+ // start.
// "STARTING" - Replication is starting.
// "STATE_UNSPECIFIED"
// "STOPPED" - Replication is stopped.
// "STOPPING" - Replication is stopping.
State string `json:"state,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "State") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "State") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "State") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *DiskResourceStatusAsyncReplicationStatus) MarshalJSON() ([]byte, error) {
+func (s DiskResourceStatusAsyncReplicationStatus) MarshalJSON() ([]byte, error) {
type NoMethod DiskResourceStatusAsyncReplicationStatus
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// DiskType: Represents a Disk Type resource. Google Compute Engine has
-// two Disk Type resources: * Regional
+// DiskType: Represents a Disk Type resource. Google Compute Engine has two
+// Disk Type resources: * Regional
// (/compute/docs/reference/rest/v1/regionDiskTypes) * Zonal
-// (/compute/docs/reference/rest/v1/diskTypes) You can choose from a
-// variety of disk types based on your needs. For more information, read
-// Storage options. The diskTypes resource represents disk types for a
-// zonal persistent disk. For more information, read Zonal persistent
-// disks. The regionDiskTypes resource represents disk types for a
-// regional persistent disk. For more information, read Regional
-// persistent disks.
+// (/compute/docs/reference/rest/v1/diskTypes) You can choose from a variety of
+// disk types based on your needs. For more information, read Storage options.
+// The diskTypes resource represents disk types for a zonal persistent disk.
+// For more information, read Zonal persistent disks. The regionDiskTypes
+// resource represents disk types for a regional persistent disk. For more
+// information, read Regional persistent disks.
type DiskType struct {
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // DefaultDiskSizeGb: [Output Only] Server-defined default disk size in
- // GB.
+ // DefaultDiskSizeGb: [Output Only] Server-defined default disk size in GB.
DefaultDiskSizeGb int64 `json:"defaultDiskSizeGb,omitempty,string"`
-
- // Deprecated -- [Output Only] The deprecation status associated with
- // this disk type.
+ // Deprecated -- [Output Only] The deprecation status associated with this disk
+ // type.
Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
-
// Description: [Output Only] An optional description of this resource.
Description string `json:"description,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
- // Kind: [Output Only] Type of the resource. Always compute#diskType for
- // disk types.
+ // Kind: [Output Only] Type of the resource. Always compute#diskType for disk
+ // types.
Kind string `json:"kind,omitempty"`
-
// Name: [Output Only] Name of the resource.
Name string `json:"name,omitempty"`
-
- // Region: [Output Only] URL of the region where the disk type resides.
- // Only applicable for regional resources. You must specify this field
- // as part of the HTTP request URL. It is not settable as a field in the
- // request body.
+ // Region: [Output Only] URL of the region where the disk type resides. Only
+ // applicable for regional resources. You must specify this field as part of
+ // the HTTP request URL. It is not settable as a field in the request body.
Region string `json:"region,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // ValidDiskSize: [Output Only] An optional textual description of the
- // valid disk size, such as "10GB-10TB".
+ // ValidDiskSize: [Output Only] An optional textual description of the valid
+ // disk size, such as "10GB-10TB".
ValidDiskSize string `json:"validDiskSize,omitempty"`
-
- // Zone: [Output Only] URL of the zone where the disk type resides. You
- // must specify this field as part of the HTTP request URL. It is not
- // settable as a field in the request body.
+ // Zone: [Output Only] URL of the zone where the disk type resides. You must
+ // specify this field as part of the HTTP request URL. It is not settable as a
+ // field in the request body.
Zone string `json:"zone,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "CreationTimestamp") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CreationTimestamp") 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. "CreationTimestamp") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *DiskType) MarshalJSON() ([]byte, error) {
+func (s DiskType) MarshalJSON() ([]byte, error) {
type NoMethod DiskType
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type DiskTypeAggregatedList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of DiskTypesScopedList resources.
Items map[string]DiskTypesScopedList `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource. Always
- // compute#diskTypeAggregatedList.
+ // Kind: [Output Only] Type of resource. Always compute#diskTypeAggregatedList.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Unreachables: [Output Only] Unreachable resources.
Unreachables []string `json:"unreachables,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *DiskTypeAggregatedListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *DiskTypeAggregatedList) MarshalJSON() ([]byte, error) {
+func (s DiskTypeAggregatedList) MarshalJSON() ([]byte, error) {
type NoMethod DiskTypeAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// DiskTypeAggregatedListWarning: [Output Only] Informational warning
-// message.
+// DiskTypeAggregatedListWarning: [Output Only] Informational warning message.
type DiskTypeAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*DiskTypeAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *DiskTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
+func (s DiskTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod DiskTypeAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type DiskTypeAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *DiskTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+func (s DiskTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod DiskTypeAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// DiskTypeList: Contains a list of disk types.
type DiskTypeList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of DiskType resources.
Items []*DiskType `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource. Always compute#diskTypeList for
- // disk types.
+ // Kind: [Output Only] Type of resource. Always compute#diskTypeList for disk
+ // types.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *DiskTypeListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *DiskTypeList) MarshalJSON() ([]byte, error) {
+func (s DiskTypeList) MarshalJSON() ([]byte, error) {
type NoMethod DiskTypeList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// DiskTypeListWarning: [Output Only] Informational warning message.
type DiskTypeListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*DiskTypeListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *DiskTypeListWarning) MarshalJSON() ([]byte, error) {
+func (s DiskTypeListWarning) MarshalJSON() ([]byte, error) {
type NoMethod DiskTypeListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type DiskTypeListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *DiskTypeListWarningData) MarshalJSON() ([]byte, error) {
+func (s DiskTypeListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod DiskTypeListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type DiskTypesScopedList struct {
- // DiskTypes: [Output Only] A list of disk types contained in this
- // scope.
+ // DiskTypes: [Output Only] A list of disk types contained in this scope.
DiskTypes []*DiskType `json:"diskTypes,omitempty"`
-
- // Warning: [Output Only] Informational warning which replaces the list
- // of disk types when the list is empty.
+ // Warning: [Output Only] Informational warning which replaces the list of disk
+ // types when the list is empty.
Warning *DiskTypesScopedListWarning `json:"warning,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "DiskTypes") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "DiskTypes") 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. "DiskTypes") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *DiskTypesScopedList) MarshalJSON() ([]byte, error) {
+func (s DiskTypesScopedList) MarshalJSON() ([]byte, error) {
type NoMethod DiskTypesScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// DiskTypesScopedListWarning: [Output Only] Informational warning which
// replaces the list of disk types when the list is empty.
type DiskTypesScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*DiskTypesScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *DiskTypesScopedListWarning) MarshalJSON() ([]byte, error) {
+func (s DiskTypesScopedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod DiskTypesScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type DiskTypesScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *DiskTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
+func (s DiskTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod DiskTypesScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type DisksAddResourcePoliciesRequest struct {
- // ResourcePolicies: Full or relative path to the resource policy to be
- // added to this disk. You can only specify one resource policy.
+ // ResourcePolicies: Full or relative path to the resource policy to be added
+ // to this disk. You can only specify one resource policy.
ResourcePolicies []string `json:"resourcePolicies,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "ResourcePolicies") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "ResourcePolicies") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *DisksAddResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
+func (s DisksAddResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
type NoMethod DisksAddResourcePoliciesRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type DisksRemoveResourcePoliciesRequest struct {
// ResourcePolicies: Resource policies to be removed from this disk.
ResourcePolicies []string `json:"resourcePolicies,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "ResourcePolicies") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "ResourcePolicies") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *DisksRemoveResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
+func (s DisksRemoveResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
type NoMethod DisksRemoveResourcePoliciesRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type DisksResizeRequest struct {
- // SizeGb: The new size of the persistent disk, which is specified in
- // GB.
+ // SizeGb: The new size of the persistent disk, which is specified in GB.
SizeGb int64 `json:"sizeGb,omitempty,string"`
-
- // ForceSendFields is a list of field names (e.g. "SizeGb") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "SizeGb") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "SizeGb") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *DisksResizeRequest) MarshalJSON() ([]byte, error) {
+func (s DisksResizeRequest) MarshalJSON() ([]byte, error) {
type NoMethod DisksResizeRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type DisksScopedList struct {
// Disks: [Output Only] A list of disks contained in this scope.
Disks []*Disk `json:"disks,omitempty"`
-
- // Warning: [Output Only] Informational warning which replaces the list
- // of disks when the list is empty.
+ // Warning: [Output Only] Informational warning which replaces the list of
+ // disks when the list is empty.
Warning *DisksScopedListWarning `json:"warning,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Disks") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Disks") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Disks") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *DisksScopedList) MarshalJSON() ([]byte, error) {
+func (s DisksScopedList) MarshalJSON() ([]byte, error) {
type NoMethod DisksScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// DisksScopedListWarning: [Output Only] Informational warning which
-// replaces the list of disks when the list is empty.
+// DisksScopedListWarning: [Output Only] Informational warning which replaces
+// the list of disks when the list is empty.
type DisksScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*DisksScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *DisksScopedListWarning) MarshalJSON() ([]byte, error) {
+func (s DisksScopedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod DisksScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type DisksScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *DisksScopedListWarningData) MarshalJSON() ([]byte, error) {
+func (s DisksScopedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod DisksScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type DisksStartAsyncReplicationRequest struct {
- // AsyncSecondaryDisk: The secondary disk to start asynchronous
- // replication to. You can provide this as a partial or full URL to the
- // resource. For example, the following are valid values: -
+ // AsyncSecondaryDisk: The secondary disk to start asynchronous replication to.
+ // You can provide this as a partial or full URL to the resource. For example,
+ // the following are valid values: -
// https://www.googleapis.com/compute/v1/projects/project/zones/zone
// /disks/disk -
// https://www.googleapis.com/compute/v1/projects/project/regions/region
@@ -11371,935 +9663,754 @@ type DisksStartAsyncReplicationRequest struct {
// projects/project/regions/region/disks/disk - zones/zone/disks/disk -
// regions/region/disks/disk
AsyncSecondaryDisk string `json:"asyncSecondaryDisk,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "AsyncSecondaryDisk")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "AsyncSecondaryDisk") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "AsyncSecondaryDisk") 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. "AsyncSecondaryDisk") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *DisksStartAsyncReplicationRequest) MarshalJSON() ([]byte, error) {
+func (s DisksStartAsyncReplicationRequest) MarshalJSON() ([]byte, error) {
type NoMethod DisksStartAsyncReplicationRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// DisksStopGroupAsyncReplicationResource: A transient resource used in
// compute.disks.stopGroupAsyncReplication and
-// compute.regionDisks.stopGroupAsyncReplication. It is only used to
-// process requests and is not persisted.
+// compute.regionDisks.stopGroupAsyncReplication. It is only used to process
+// requests and is not persisted.
type DisksStopGroupAsyncReplicationResource struct {
- // ResourcePolicy: The URL of the DiskConsistencyGroupPolicy for the
- // group of disks to stop. This may be a full or partial URL, such as: -
+ // ResourcePolicy: The URL of the DiskConsistencyGroupPolicy for the group of
+ // disks to stop. This may be a full or partial URL, such as: -
// https://www.googleapis.com/compute/v1/projects/project/regions/region
// /resourcePolicies/resourcePolicy -
// projects/project/regions/region/resourcePolicies/resourcePolicy -
// regions/region/resourcePolicies/resourcePolicy
ResourcePolicy string `json:"resourcePolicy,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "ResourcePolicy") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "ResourcePolicy") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "ResourcePolicy") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *DisksStopGroupAsyncReplicationResource) MarshalJSON() ([]byte, error) {
+func (s DisksStopGroupAsyncReplicationResource) MarshalJSON() ([]byte, error) {
type NoMethod DisksStopGroupAsyncReplicationResource
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// DisplayDevice: A set of Display Device options
type DisplayDevice struct {
// EnableDisplay: Defines whether the instance has Display enabled.
EnableDisplay bool `json:"enableDisplay,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "EnableDisplay") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "EnableDisplay") 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. "EnableDisplay") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *DisplayDevice) MarshalJSON() ([]byte, error) {
+func (s DisplayDevice) MarshalJSON() ([]byte, error) {
type NoMethod DisplayDevice
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type DistributionPolicy struct {
- // TargetShape: The distribution shape to which the group converges
- // either proactively or on resize events (depending on the value set in
+ // TargetShape: The distribution shape to which the group converges either
+ // proactively or on resize events (depending on the value set in
// updatePolicy.instanceRedistributionType).
//
// Possible values:
- // "ANY" - The group picks zones for creating VM instances to fulfill
- // the requested number of VMs within present resource constraints and
- // to maximize utilization of unused zonal reservations. Recommended for
- // batch workloads that do not require high availability.
- // "ANY_SINGLE_ZONE" - The group creates all VM instances within a
- // single zone. The zone is selected based on the present resource
- // constraints and to maximize utilization of unused zonal reservations.
- // Recommended for batch workloads with heavy interprocess
- // communication.
- // "BALANCED" - The group prioritizes acquisition of resources,
- // scheduling VMs in zones where resources are available while
- // distributing VMs as evenly as possible across selected zones to
- // minimize the impact of zonal failure. Recommended for highly
- // available serving workloads.
- // "EVEN" - The group schedules VM instance creation and deletion to
- // achieve and maintain an even number of managed instances across the
- // selected zones. The distribution is even when the number of managed
- // instances does not differ by more than 1 between any two zones.
+ // "ANY" - The group picks zones for creating VM instances to fulfill the
+ // requested number of VMs within present resource constraints and to maximize
+ // utilization of unused zonal reservations. Recommended for batch workloads
+ // that do not require high availability.
+ // "ANY_SINGLE_ZONE" - The group creates all VM instances within a single
+ // zone. The zone is selected based on the present resource constraints and to
+ // maximize utilization of unused zonal reservations. Recommended for batch
+ // workloads with heavy interprocess communication.
+ // "BALANCED" - The group prioritizes acquisition of resources, scheduling
+ // VMs in zones where resources are available while distributing VMs as evenly
+ // as possible across selected zones to minimize the impact of zonal failure.
// Recommended for highly available serving workloads.
+ // "EVEN" - The group schedules VM instance creation and deletion to achieve
+ // and maintain an even number of managed instances across the selected zones.
+ // The distribution is even when the number of managed instances does not
+ // differ by more than 1 between any two zones. Recommended for highly
+ // available serving workloads.
TargetShape string `json:"targetShape,omitempty"`
-
- // Zones: Zones where the regional managed instance group will create
- // and manage its instances.
+ // Zones: Zones where the regional managed instance group will create and
+ // manage its instances.
Zones []*DistributionPolicyZoneConfiguration `json:"zones,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "TargetShape") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "TargetShape") 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. "TargetShape") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *DistributionPolicy) MarshalJSON() ([]byte, error) {
+func (s DistributionPolicy) MarshalJSON() ([]byte, error) {
type NoMethod DistributionPolicy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type DistributionPolicyZoneConfiguration struct {
- // Zone: The URL of the zone. The zone must exist in the region where
- // the managed instance group is located.
+ // Zone: The URL of the zone. The zone must exist in the region where the
+ // managed instance group is located.
Zone string `json:"zone,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Zone") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Zone") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Zone") 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. "Zone") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *DistributionPolicyZoneConfiguration) MarshalJSON() ([]byte, error) {
+func (s DistributionPolicyZoneConfiguration) MarshalJSON() ([]byte, error) {
type NoMethod DistributionPolicyZoneConfiguration
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// Duration: A Duration represents a fixed-length span of time
-// represented as a count of seconds and fractions of seconds at
-// nanosecond resolution. It is independent of any calendar and concepts
-// like "day" or "month". Range is approximately 10,000 years.
+// Duration: A Duration represents a fixed-length span of time represented as a
+// count of seconds and fractions of seconds at nanosecond resolution. It is
+// independent of any calendar and concepts like "day" or "month". Range is
+// approximately 10,000 years.
type Duration struct {
- // Nanos: Span of time that's a fraction of a second at nanosecond
- // resolution. Durations less than one second are represented with a 0
- // `seconds` field and a positive `nanos` field. Must be from 0 to
- // 999,999,999 inclusive.
+ // Nanos: Span of time that's a fraction of a second at nanosecond resolution.
+ // Durations less than one second are represented with a 0 `seconds` field and
+ // a positive `nanos` field. Must be from 0 to 999,999,999 inclusive.
Nanos int64 `json:"nanos,omitempty"`
-
// Seconds: Span of time at a resolution of a second. Must be from 0 to
- // 315,576,000,000 inclusive. Note: these bounds are computed from: 60
- // sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
+ // 315,576,000,000 inclusive. Note: these bounds are computed from: 60 sec/min
+ // * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
Seconds int64 `json:"seconds,omitempty,string"`
-
- // ForceSendFields is a list of field names (e.g. "Nanos") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Nanos") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Nanos") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *Duration) MarshalJSON() ([]byte, error) {
+func (s Duration) MarshalJSON() ([]byte, error) {
type NoMethod Duration
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// ErrorInfo: Describes the cause of the error with structured details.
-// Example of an error when contacting the "pubsub.googleapis.com" API
-// when it is not enabled: { "reason": "API_DISABLED" "domain":
-// "googleapis.com" "metadata": { "resource": "projects/123", "service":
-// "pubsub.googleapis.com" } } This response indicates that the
-// pubsub.googleapis.com API is not enabled. Example of an error that is
-// returned when attempting to create a Spanner instance in a region
-// that is out of stock: { "reason": "STOCKOUT" "domain":
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+// ErrorInfo: Describes the cause of the error with structured details. Example
+// of an error when contacting the "pubsub.googleapis.com" API when it is not
+// enabled: { "reason": "API_DISABLED" "domain": "googleapis.com" "metadata": {
+// "resource": "projects/123", "service": "pubsub.googleapis.com" } } This
+// response indicates that the pubsub.googleapis.com API is not enabled.
+// Example of an error that is returned when attempting to create a Spanner
+// instance in a region that is out of stock: { "reason": "STOCKOUT" "domain":
// "spanner.googleapis.com", "metadata": { "availableRegions":
// "us-central1,us-east2" } }
type ErrorInfo struct {
- // Domain: The logical grouping to which the "reason" belongs. The error
- // domain is typically the registered service name of the tool or
- // product that generates the error. Example: "pubsub.googleapis.com".
- // If the error is generated by some common infrastructure, the error
- // domain must be a globally unique value that identifies the
- // infrastructure. For Google API infrastructure, the error domain is
- // "googleapis.com".
+ // Domain: The logical grouping to which the "reason" belongs. The error domain
+ // is typically the registered service name of the tool or product that
+ // generates the error. Example: "pubsub.googleapis.com". If the error is
+ // generated by some common infrastructure, the error domain must be a globally
+ // unique value that identifies the infrastructure. For Google API
+ // infrastructure, the error domain is "googleapis.com".
Domain string `json:"domain,omitempty"`
-
- // Metadatas: Additional structured details about this error. Keys
- // should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in
- // length. When identifying the current value of an exceeded limit, the
- // units should be contained in the key, not the value. For example,
+ // Metadatas: Additional structured details about this error. Keys must match
+ // /a-z+/ but should ideally be lowerCamelCase. Also they must be limited to 64
+ // characters in length. When identifying the current value of an exceeded
+ // limit, the units should be contained in the key, not the value. For example,
// rather than {"instanceLimit": "100/request"}, should be returned as,
- // {"instanceLimitPerRequest": "100"}, if the client exceeds the number
- // of instances that can be created in a single (batch) request.
+ // {"instanceLimitPerRequest": "100"}, if the client exceeds the number of
+ // instances that can be created in a single (batch) request.
Metadatas map[string]string `json:"metadatas,omitempty"`
-
- // Reason: The reason of the error. This is a constant value that
- // identifies the proximate cause of the error. Error reasons are unique
- // within a particular domain of errors. This should be at most 63
- // characters and match a regular expression of `A-Z+[A-Z0-9]`, which
- // represents UPPER_SNAKE_CASE.
+ // Reason: The reason of the error. This is a constant value that identifies
+ // the proximate cause of the error. Error reasons are unique within a
+ // particular domain of errors. This should be at most 63 characters and match
+ // a regular expression of `A-Z+[A-Z0-9]`, which represents UPPER_SNAKE_CASE.
Reason string `json:"reason,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Domain") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Domain") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Domain") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ErrorInfo) MarshalJSON() ([]byte, error) {
+func (s ErrorInfo) MarshalJSON() ([]byte, error) {
type NoMethod ErrorInfo
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ExchangedPeeringRoute struct {
// DestRange: The destination range of the route.
DestRange string `json:"destRange,omitempty"`
-
- // Imported: True if the peering route has been imported from a peer.
- // The actual import happens if the field
- // networkPeering.importCustomRoutes is true for this network, and
- // networkPeering.exportCustomRoutes is true for the peer network, and
- // the import does not result in a route conflict.
+ // Imported: True if the peering route has been imported from a peer. The
+ // actual import happens if the field networkPeering.importCustomRoutes is true
+ // for this network, and networkPeering.exportCustomRoutes is true for the peer
+ // network, and the import does not result in a route conflict.
Imported bool `json:"imported,omitempty"`
-
- // NextHopRegion: The region of peering route next hop, only applies to
- // dynamic routes.
+ // NextHopRegion: The region of peering route next hop, only applies to dynamic
+ // routes.
NextHopRegion string `json:"nextHopRegion,omitempty"`
-
// Priority: The priority of the peering route.
Priority int64 `json:"priority,omitempty"`
-
// Type: The type of the peering route.
//
// Possible values:
// "DYNAMIC_PEERING_ROUTE" - For routes exported from local network.
// "STATIC_PEERING_ROUTE" - The peering route.
- // "SUBNET_PEERING_ROUTE" - The peering route corresponding to
- // subnetwork range.
+ // "SUBNET_PEERING_ROUTE" - The peering route corresponding to subnetwork
+ // range.
Type string `json:"type,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "DestRange") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "DestRange") 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. "DestRange") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ExchangedPeeringRoute) MarshalJSON() ([]byte, error) {
+func (s ExchangedPeeringRoute) MarshalJSON() ([]byte, error) {
type NoMethod ExchangedPeeringRoute
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ExchangedPeeringRoutesList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of ExchangedPeeringRoute resources.
Items []*ExchangedPeeringRoute `json:"items,omitempty"`
-
// Kind: [Output Only] Type of resource. Always
- // compute#exchangedPeeringRoutesList for exchanged peering routes
- // lists.
+ // compute#exchangedPeeringRoutesList for exchanged peering routes lists.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *ExchangedPeeringRoutesListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ExchangedPeeringRoutesList) MarshalJSON() ([]byte, error) {
+func (s ExchangedPeeringRoutesList) MarshalJSON() ([]byte, error) {
type NoMethod ExchangedPeeringRoutesList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// ExchangedPeeringRoutesListWarning: [Output Only] Informational
-// warning message.
+// ExchangedPeeringRoutesListWarning: [Output Only] Informational warning
+// message.
type ExchangedPeeringRoutesListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*ExchangedPeeringRoutesListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ExchangedPeeringRoutesListWarning) MarshalJSON() ([]byte, error) {
+func (s ExchangedPeeringRoutesListWarning) MarshalJSON() ([]byte, error) {
type NoMethod ExchangedPeeringRoutesListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ExchangedPeeringRoutesListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ExchangedPeeringRoutesListWarningData) MarshalJSON() ([]byte, error) {
+func (s ExchangedPeeringRoutesListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod ExchangedPeeringRoutesListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// Expr: Represents a textual expression in the Common Expression
-// Language (CEL) syntax. CEL is a C-like expression language. The
-// syntax and semantics of CEL are documented at
-// https://github.com/google/cel-spec. Example (Comparison): title:
-// "Summary size limit" description: "Determines if a summary is less
-// than 100 chars" expression: "document.summary.size() < 100" Example
-// (Equality): title: "Requestor is owner" description: "Determines if
+// Expr: Represents a textual expression in the Common Expression Language
+// (CEL) syntax. CEL is a C-like expression language. The syntax and semantics
+// of CEL are documented at https://github.com/google/cel-spec. Example
+// (Comparison): title: "Summary size limit" description: "Determines if a
+// summary is less than 100 chars" expression: "document.summary.size() < 100"
+// Example (Equality): title: "Requestor is owner" description: "Determines if
// requestor is the document owner" expression: "document.owner ==
// request.auth.claims.email" Example (Logic): title: "Public documents"
-// description: "Determine whether the document should be publicly
-// visible" expression: "document.type != 'private' && document.type !=
-// 'internal'" Example (Data Manipulation): title: "Notification string"
-// description: "Create a notification string with a timestamp."
-// expression: "'New message received at ' +
-// string(document.create_time)" The exact variables and functions that
-// may be referenced within an expression are determined by the service
-// that evaluates it. See the service documentation for additional
+// description: "Determine whether the document should be publicly visible"
+// expression: "document.type != 'private' && document.type != 'internal'"
+// Example (Data Manipulation): title: "Notification string" description:
+// "Create a notification string with a timestamp." expression: "'New message
+// received at ' + string(document.create_time)" The exact variables and
+// functions that may be referenced within an expression are determined by the
+// service that evaluates it. See the service documentation for additional
// information.
type Expr struct {
- // Description: Optional. Description of the expression. This is a
- // longer text which describes the expression, e.g. when hovered over it
- // in a UI.
+ // Description: Optional. Description of the expression. This is a longer text
+ // which describes the expression, e.g. when hovered over it in a UI.
Description string `json:"description,omitempty"`
-
- // Expression: Textual representation of an expression in Common
- // Expression Language syntax.
+ // Expression: Textual representation of an expression in Common Expression
+ // Language syntax.
Expression string `json:"expression,omitempty"`
-
- // Location: Optional. String indicating the location of the expression
- // for error reporting, e.g. a file name and a position in the file.
+ // Location: Optional. String indicating the location of the expression for
+ // error reporting, e.g. a file name and a position in the file.
Location string `json:"location,omitempty"`
-
- // Title: Optional. Title for the expression, i.e. a short string
- // describing its purpose. This can be used e.g. in UIs which allow to
- // enter the expression.
+ // Title: Optional. Title for the expression, i.e. a short string describing
+ // its purpose. This can be used e.g. in UIs which allow to enter the
+ // expression.
Title string `json:"title,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Description") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Description") to include
- // in API requests with the JSON null value. By default, fields with
- // empty values are omitted from API requests. However, any field with
- // an empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields 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. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *Expr) MarshalJSON() ([]byte, error) {
+func (s Expr) MarshalJSON() ([]byte, error) {
type NoMethod Expr
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// ExternalVpnGateway: Represents an external VPN gateway. External VPN
-// gateway is the on-premises VPN gateway(s) or another cloud provider's
-// VPN gateway that connects to your Google Cloud VPN gateway. To create
-// a highly available VPN from Google Cloud Platform to your VPN gateway
-// or another cloud provider's VPN gateway, you must create a external
-// VPN gateway resource with information about the other gateway. For
-// more information about using external VPN gateways, see Creating an
-// HA VPN gateway and tunnel pair to a peer VPN.
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+// ExternalVpnGateway: Represents an external VPN gateway. External VPN gateway
+// is the on-premises VPN gateway(s) or another cloud provider's VPN gateway
+// that connects to your Google Cloud VPN gateway. To create a highly available
+// VPN from Google Cloud Platform to your VPN gateway or another cloud
+// provider's VPN gateway, you must create a external VPN gateway resource with
+// information about the other gateway. For more information about using
+// external VPN gateways, see Creating an HA VPN gateway and tunnel pair to a
+// peer VPN.
type ExternalVpnGateway struct {
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id *uint64 `json:"id,omitempty,string"`
-
- // Interfaces: A list of interfaces for this external VPN gateway. If
- // your peer-side gateway is an on-premises gateway and non-AWS cloud
- // providers' gateway, at most two interfaces can be provided for an
- // external VPN gateway. If your peer side is an AWS virtual private
- // gateway, four interfaces should be provided for an external VPN
- // gateway.
+ // Interfaces: A list of interfaces for this external VPN gateway. If your
+ // peer-side gateway is an on-premises gateway and non-AWS cloud providers'
+ // gateway, at most two interfaces can be provided for an external VPN gateway.
+ // If your peer side is an AWS virtual private gateway, four interfaces should
+ // be provided for an external VPN gateway.
Interfaces []*ExternalVpnGatewayInterface `json:"interfaces,omitempty"`
-
- // Kind: [Output Only] Type of the resource. Always
- // compute#externalVpnGateway for externalVpnGateways.
+ // Kind: [Output Only] Type of the resource. Always compute#externalVpnGateway
+ // for externalVpnGateways.
Kind string `json:"kind,omitempty"`
-
// LabelFingerprint: A fingerprint for the labels being applied to this
- // ExternalVpnGateway, which is essentially a hash of the labels set
- // used for optimistic locking. The fingerprint is initially generated
- // by Compute Engine and changes after every request to modify or update
- // labels. You must always provide an up-to-date fingerprint hash in
- // order to update or change labels, otherwise the request will fail
- // with error 412 conditionNotMet. To see the latest fingerprint, make a
- // get() request to retrieve an ExternalVpnGateway.
+ // ExternalVpnGateway, which is essentially a hash of the labels set used for
+ // optimistic locking. The fingerprint is initially generated by Compute Engine
+ // and changes after every request to modify or update labels. You must always
+ // provide an up-to-date fingerprint hash in order to update or change labels,
+ // otherwise the request will fail with error 412 conditionNotMet. To see the
+ // latest fingerprint, make a get() request to retrieve an ExternalVpnGateway.
LabelFingerprint string `json:"labelFingerprint,omitempty"`
-
- // Labels: Labels for this resource. These can only be added or modified
- // by the setLabels method. Each label key/value pair must comply with
- // RFC1035. Label values may be empty.
+ // Labels: Labels for this resource. These can only be added or modified by the
+ // setLabels method. Each label key/value pair must comply with RFC1035. Label
+ // values may be empty.
Labels map[string]string `json:"labels,omitempty"`
-
- // Name: Name of the resource. Provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
- // the first character must be a lowercase letter, and all following
- // characters must be a dash, lowercase letter, or digit, except the
- // last character, which cannot be a dash.
+ // Name: Name of the resource. Provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must
+ // be a lowercase letter, and all following characters must be a dash,
+ // lowercase letter, or digit, except the last character, which cannot be a
+ // dash.
Name string `json:"name,omitempty"`
-
- // RedundancyType: Indicates the user-supplied redundancy type of this
- // external VPN gateway.
+ // RedundancyType: Indicates the user-supplied redundancy type of this external
+ // VPN gateway.
//
// Possible values:
// "FOUR_IPS_REDUNDANCY" - The external VPN gateway has four public IP
- // addresses; at the time of writing this API, the AWS virtual private
- // gateway is an example which has four public IP addresses for high
- // availability connections; there should be two VPN connections in the
- // AWS virtual private gateway , each AWS VPN connection has two public
- // IP addresses; please make sure to put two public IP addresses from
- // one AWS VPN connection into interfaces 0 and 1 of this external VPN
- // gateway, and put the other two public IP addresses from another AWS
- // VPN connection into interfaces 2 and 3 of this external VPN gateway.
- // When displaying highly available configuration status for the VPN
- // tunnels connected to FOUR_IPS_REDUNDANCY external VPN gateway, Google
- // will always detect whether interfaces 0 and 1 are connected on one
- // interface of HA Cloud VPN gateway, and detect whether interfaces 2
+ // addresses; at the time of writing this API, the AWS virtual private gateway
+ // is an example which has four public IP addresses for high availability
+ // connections; there should be two VPN connections in the AWS virtual private
+ // gateway , each AWS VPN connection has two public IP addresses; please make
+ // sure to put two public IP addresses from one AWS VPN connection into
+ // interfaces 0 and 1 of this external VPN gateway, and put the other two
+ // public IP addresses from another AWS VPN connection into interfaces 2 and 3
+ // of this external VPN gateway. When displaying highly available configuration
+ // status for the VPN tunnels connected to FOUR_IPS_REDUNDANCY external VPN
+ // gateway, Google will always detect whether interfaces 0 and 1 are connected
+ // on one interface of HA Cloud VPN gateway, and detect whether interfaces 2
// and 3 are connected to another interface of the HA Cloud VPN gateway.
- // "SINGLE_IP_INTERNALLY_REDUNDANT" - The external VPN gateway has
- // only one public IP address which internally provide redundancy or
- // failover.
+ // "SINGLE_IP_INTERNALLY_REDUNDANT" - The external VPN gateway has only one
+ // public IP address which internally provide redundancy or failover.
// "TWO_IPS_REDUNDANCY" - The external VPN gateway has two public IP
- // addresses which are redundant with each other, the following two
- // types of setup on your on-premises side would have this type of
- // redundancy: (1) Two separate on-premises gateways, each with one
- // public IP address, the two on-premises gateways are redundant with
- // each other. (2) A single on-premise gateway with two public IP
- // addresses that are redundant with eatch other.
+ // addresses which are redundant with each other, the following two types of
+ // setup on your on-premises side would have this type of redundancy: (1) Two
+ // separate on-premises gateways, each with one public IP address, the two
+ // on-premises gateways are redundant with each other. (2) A single on-premise
+ // gateway with two public IP addresses that are redundant with eatch other.
RedundancyType string `json:"redundancyType,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "CreationTimestamp") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CreationTimestamp") 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. "CreationTimestamp") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ExternalVpnGateway) MarshalJSON() ([]byte, error) {
+func (s ExternalVpnGateway) MarshalJSON() ([]byte, error) {
type NoMethod ExternalVpnGateway
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// ExternalVpnGatewayInterface: The interface for the external VPN
-// gateway.
+// ExternalVpnGatewayInterface: The interface for the external VPN gateway.
type ExternalVpnGatewayInterface struct {
- // Id: The numeric ID of this interface. The allowed input values for
- // this id for different redundancy types of external VPN gateway: -
+ // Id: The numeric ID of this interface. The allowed input values for this id
+ // for different redundancy types of external VPN gateway: -
// SINGLE_IP_INTERNALLY_REDUNDANT - 0 - TWO_IPS_REDUNDANCY - 0, 1 -
// FOUR_IPS_REDUNDANCY - 0, 1, 2, 3
Id int64 `json:"id,omitempty"`
-
- // IpAddress: IP address of the interface in the external VPN gateway.
- // Only IPv4 is supported. This IP address can be either from your
- // on-premise gateway or another Cloud provider's VPN gateway, it cannot
- // be an IP address from Google Compute Engine.
+ // IpAddress: IP address of the interface in the external VPN gateway. Only
+ // IPv4 is supported. This IP address can be either from your on-premise
+ // gateway or another Cloud provider's VPN gateway, it cannot be an IP address
+ // from Google Compute Engine.
IpAddress string `json:"ipAddress,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // Ipv6Address: IPv6 address of the interface in the external VPN gateway. This
+ // IPv6 address can be either from your on-premise gateway or another Cloud
+ // provider's VPN gateway, it cannot be an IP address from Google Compute
+ // Engine. Must specify an IPv6 address (not IPV4-mapped) using any format
+ // described in RFC 4291 (e.g. 2001:db8:0:0:2d9:51:0:0). The output format is
+ // RFC 5952 format (e.g. 2001:db8::2d9:51:0:0).
+ Ipv6Address string `json:"ipv6Address,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ExternalVpnGatewayInterface) MarshalJSON() ([]byte, error) {
+func (s ExternalVpnGatewayInterface) MarshalJSON() ([]byte, error) {
type NoMethod ExternalVpnGatewayInterface
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// ExternalVpnGatewayList: Response to the list request, and contains a
-// list of externalVpnGateways.
+// ExternalVpnGatewayList: Response to the list request, and contains a list of
+// externalVpnGateways.
type ExternalVpnGatewayList struct {
Etag string `json:"etag,omitempty"`
-
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of ExternalVpnGateway resources.
Items []*ExternalVpnGateway `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource. Always
- // compute#externalVpnGatewayList for lists of externalVpnGateways.
+ // Kind: [Output Only] Type of resource. Always compute#externalVpnGatewayList
+ // for lists of externalVpnGateways.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *ExternalVpnGatewayListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Etag") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Etag") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Etag") 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. "Etag") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ExternalVpnGatewayList) MarshalJSON() ([]byte, error) {
+func (s ExternalVpnGatewayList) MarshalJSON() ([]byte, error) {
type NoMethod ExternalVpnGatewayList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// ExternalVpnGatewayListWarning: [Output Only] Informational warning
-// message.
+// ExternalVpnGatewayListWarning: [Output Only] Informational warning message.
type ExternalVpnGatewayListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*ExternalVpnGatewayListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ExternalVpnGatewayListWarning) MarshalJSON() ([]byte, error) {
+func (s ExternalVpnGatewayListWarning) MarshalJSON() ([]byte, error) {
type NoMethod ExternalVpnGatewayListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ExternalVpnGatewayListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ExternalVpnGatewayListWarningData) MarshalJSON() ([]byte, error) {
+func (s ExternalVpnGatewayListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod ExternalVpnGatewayListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type FileContentBuffer struct {
// Content: The raw content in the secure keys file.
Content string `json:"content,omitempty"`
-
// FileType: The file type of source file.
//
// Possible values:
@@ -12307,465 +10418,372 @@ type FileContentBuffer struct {
// "UNDEFINED"
// "X509"
FileType string `json:"fileType,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Content") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Content") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Content") 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. "Content") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *FileContentBuffer) MarshalJSON() ([]byte, error) {
+func (s FileContentBuffer) MarshalJSON() ([]byte, error) {
type NoMethod FileContentBuffer
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// Firewall: Represents a Firewall Rule resource. Firewall rules allow
-// or deny ingress traffic to, and egress traffic from your instances.
-// For more information, read Firewall rules.
+// Firewall: Represents a Firewall Rule resource. Firewall rules allow or deny
+// ingress traffic to, and egress traffic from your instances. For more
+// information, read Firewall rules.
type Firewall struct {
- // Allowed: The list of ALLOW rules specified by this firewall. Each
- // rule specifies a protocol and port-range tuple that describes a
- // permitted connection.
+ // Allowed: The list of ALLOW rules specified by this firewall. Each rule
+ // specifies a protocol and port-range tuple that describes a permitted
+ // connection.
Allowed []*FirewallAllowed `json:"allowed,omitempty"`
-
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
// Denied: The list of DENY rules specified by this firewall. Each rule
// specifies a protocol and port-range tuple that describes a denied
// connection.
Denied []*FirewallDenied `json:"denied,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // field when you create the resource.
+ // Description: An optional description of this resource. Provide this field
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // DestinationRanges: If destination ranges are specified, the firewall
- // rule applies only to traffic that has destination IP address in these
- // ranges. These ranges must be expressed in CIDR format. Both IPv4 and
- // IPv6 are supported.
+ // DestinationRanges: If destination ranges are specified, the firewall rule
+ // applies only to traffic that has destination IP address in these ranges.
+ // These ranges must be expressed in CIDR format. Both IPv4 and IPv6 are
+ // supported.
DestinationRanges []string `json:"destinationRanges,omitempty"`
-
- // Direction: Direction of traffic to which this firewall applies,
- // either `INGRESS` or `EGRESS`. The default is `INGRESS`. For `EGRESS`
- // traffic, you cannot specify the sourceTags fields.
+ // Direction: Direction of traffic to which this firewall applies, either
+ // `INGRESS` or `EGRESS`. The default is `INGRESS`. For `EGRESS` traffic, you
+ // cannot specify the sourceTags fields.
//
// Possible values:
- // "EGRESS" - Indicates that firewall should apply to outgoing
- // traffic.
- // "INGRESS" - Indicates that firewall should apply to incoming
- // traffic.
+ // "EGRESS" - Indicates that firewall should apply to outgoing traffic.
+ // "INGRESS" - Indicates that firewall should apply to incoming traffic.
Direction string `json:"direction,omitempty"`
-
- // Disabled: Denotes whether the firewall rule is disabled. When set to
- // true, the firewall rule is not enforced and the network behaves as if
- // it did not exist. If this is unspecified, the firewall rule will be
- // enabled.
+ // Disabled: Denotes whether the firewall rule is disabled. When set to true,
+ // the firewall rule is not enforced and the network behaves as if it did not
+ // exist. If this is unspecified, the firewall rule will be enabled.
Disabled bool `json:"disabled,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
// Kind: [Output Only] Type of the resource. Always compute#firewall for
// firewall rules.
Kind string `json:"kind,omitempty"`
-
- // LogConfig: This field denotes the logging options for a particular
- // firewall rule. If logging is enabled, logs will be exported to Cloud
- // Logging.
+ // LogConfig: This field denotes the logging options for a particular firewall
+ // rule. If logging is enabled, logs will be exported to Cloud Logging.
LogConfig *FirewallLogConfig `json:"logConfig,omitempty"`
-
- // Name: Name of the resource; provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`. The first
- // character must be a lowercase letter, and all following characters
- // (except for the last character) must be a dash, lowercase letter, or
- // digit. The last character must be a lowercase letter or digit.
+ // Name: Name of the resource; provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?`. The first character must be a
+ // lowercase letter, and all following characters (except for the last
+ // character) must be a dash, lowercase letter, or digit. The last character
+ // must be a lowercase letter or digit.
Name string `json:"name,omitempty"`
-
// Network: URL of the network resource for this firewall rule. If not
// specified when creating a firewall rule, the default network is used:
- // global/networks/default If you choose to specify this field, you can
- // specify the network as a full or partial URL. For example, the
- // following are all valid URLs: -
+ // global/networks/default If you choose to specify this field, you can specify
+ // the network as a full or partial URL. For example, the following are all
+ // valid URLs: -
// https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network
- // - projects/myproject/global/networks/my-network -
- // global/networks/default
+ // - projects/myproject/global/networks/my-network - global/networks/default
Network string `json:"network,omitempty"`
-
// Priority: Priority for this rule. This is an integer between `0` and
- // `65535`, both inclusive. The default value is `1000`. Relative
- // priorities determine which rule takes effect if multiple rules apply.
- // Lower values indicate higher priority. For example, a rule with
- // priority `0` has higher precedence than a rule with priority `1`.
- // DENY rules take precedence over ALLOW rules if they have equal
- // priority. Note that VPC networks have implied rules with a priority
- // of `65535`. To avoid conflicts with the implied rules, use a priority
- // number less than `65535`.
+ // `65535`, both inclusive. The default value is `1000`. Relative priorities
+ // determine which rule takes effect if multiple rules apply. Lower values
+ // indicate higher priority. For example, a rule with priority `0` has higher
+ // precedence than a rule with priority `1`. DENY rules take precedence over
+ // ALLOW rules if they have equal priority. Note that VPC networks have implied
+ // rules with a priority of `65535`. To avoid conflicts with the implied rules,
+ // use a priority number less than `65535`.
Priority int64 `json:"priority,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // SourceRanges: If source ranges are specified, the firewall rule
- // applies only to traffic that has a source IP address in these ranges.
- // These ranges must be expressed in CIDR format. One or both of
- // sourceRanges and sourceTags may be set. If both fields are set, the
- // rule applies to traffic that has a source IP address within
- // sourceRanges OR a source IP from a resource with a matching tag
- // listed in the sourceTags field. The connection does not need to match
- // both fields for the rule to apply. Both IPv4 and IPv6 are supported.
+ // SourceRanges: If source ranges are specified, the firewall rule applies only
+ // to traffic that has a source IP address in these ranges. These ranges must
+ // be expressed in CIDR format. One or both of sourceRanges and sourceTags may
+ // be set. If both fields are set, the rule applies to traffic that has a
+ // source IP address within sourceRanges OR a source IP from a resource with a
+ // matching tag listed in the sourceTags field. The connection does not need to
+ // match both fields for the rule to apply. Both IPv4 and IPv6 are supported.
SourceRanges []string `json:"sourceRanges,omitempty"`
-
// SourceServiceAccounts: If source service accounts are specified, the
- // firewall rules apply only to traffic originating from an instance
- // with a service account in this list. Source service accounts cannot
- // be used to control traffic to an instance's external IP address
- // because service accounts are associated with an instance, not an IP
- // address. sourceRanges can be set at the same time as
- // sourceServiceAccounts. If both are set, the firewall applies to
- // traffic that has a source IP address within the sourceRanges OR a
- // source IP that belongs to an instance with service account listed in
- // sourceServiceAccount. The connection does not need to match both
- // fields for the firewall to apply. sourceServiceAccounts cannot be
- // used at the same time as sourceTags or targetTags.
+ // firewall rules apply only to traffic originating from an instance with a
+ // service account in this list. Source service accounts cannot be used to
+ // control traffic to an instance's external IP address because service
+ // accounts are associated with an instance, not an IP address. sourceRanges
+ // can be set at the same time as sourceServiceAccounts. If both are set, the
+ // firewall applies to traffic that has a source IP address within the
+ // sourceRanges OR a source IP that belongs to an instance with service account
+ // listed in sourceServiceAccount. The connection does not need to match both
+ // fields for the firewall to apply. sourceServiceAccounts cannot be used at
+ // the same time as sourceTags or targetTags.
SourceServiceAccounts []string `json:"sourceServiceAccounts,omitempty"`
-
- // SourceTags: If source tags are specified, the firewall rule applies
- // only to traffic with source IPs that match the primary network
- // interfaces of VM instances that have the tag and are in the same VPC
- // network. Source tags cannot be used to control traffic to an
- // instance's external IP address, it only applies to traffic between
- // instances in the same virtual network. Because tags are associated
- // with instances, not IP addresses. One or both of sourceRanges and
- // sourceTags may be set. If both fields are set, the firewall applies
- // to traffic that has a source IP address within sourceRanges OR a
- // source IP from a resource with a matching tag listed in the
- // sourceTags field. The connection does not need to match both fields
- // for the firewall to apply.
+ // SourceTags: If source tags are specified, the firewall rule applies only to
+ // traffic with source IPs that match the primary network interfaces of VM
+ // instances that have the tag and are in the same VPC network. Source tags
+ // cannot be used to control traffic to an instance's external IP address, it
+ // only applies to traffic between instances in the same virtual network.
+ // Because tags are associated with instances, not IP addresses. One or both of
+ // sourceRanges and sourceTags may be set. If both fields are set, the firewall
+ // applies to traffic that has a source IP address within sourceRanges OR a
+ // source IP from a resource with a matching tag listed in the sourceTags
+ // field. The connection does not need to match both fields for the firewall to
+ // apply.
SourceTags []string `json:"sourceTags,omitempty"`
-
// TargetServiceAccounts: A list of service accounts indicating sets of
// instances located in the network that may make network connections as
- // specified in allowed[]. targetServiceAccounts cannot be used at the
- // same time as targetTags or sourceTags. If neither
- // targetServiceAccounts nor targetTags are specified, the firewall rule
- // applies to all instances on the specified network.
+ // specified in allowed[]. targetServiceAccounts cannot be used at the same
+ // time as targetTags or sourceTags. If neither targetServiceAccounts nor
+ // targetTags are specified, the firewall rule applies to all instances on the
+ // specified network.
TargetServiceAccounts []string `json:"targetServiceAccounts,omitempty"`
-
- // TargetTags: A list of tags that controls which instances the firewall
- // rule applies to. If targetTags are specified, then the firewall rule
- // applies only to instances in the VPC network that have one of those
- // tags. If no targetTags are specified, the firewall rule applies to
- // all instances on the specified network.
+ // TargetTags: A list of tags that controls which instances the firewall rule
+ // applies to. If targetTags are specified, then the firewall rule applies only
+ // to instances in the VPC network that have one of those tags. If no
+ // targetTags are specified, the firewall rule applies to all instances on the
+ // specified network.
TargetTags []string `json:"targetTags,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Allowed") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Allowed") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Allowed") 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. "Allowed") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *Firewall) MarshalJSON() ([]byte, error) {
+func (s Firewall) MarshalJSON() ([]byte, error) {
type NoMethod Firewall
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type FirewallAllowed struct {
- // IPProtocol: The IP protocol to which this rule applies. The protocol
- // type is required when creating a firewall rule. This value can either
- // be one of the following well known protocol strings (tcp, udp, icmp,
- // esp, ah, ipip, sctp) or the IP protocol number.
+ // IPProtocol: The IP protocol to which this rule applies. The protocol type is
+ // required when creating a firewall rule. This value can either be one of the
+ // following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp)
+ // or the IP protocol number.
IPProtocol string `json:"IPProtocol,omitempty"`
-
- // Ports: An optional list of ports to which this rule applies. This
- // field is only applicable for the UDP or TCP protocol. Each entry must
- // be either an integer or a range. If not specified, this rule applies
- // to connections through any port. Example inputs include: ["22"],
- // ["80","443"], and ["12345-12349"].
+ // Ports: An optional list of ports to which this rule applies. This field is
+ // only applicable for the UDP or TCP protocol. Each entry must be either an
+ // integer or a range. If not specified, this rule applies to connections
+ // through any port. Example inputs include: ["22"], ["80","443"], and
+ // ["12345-12349"].
Ports []string `json:"ports,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "IPProtocol") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "IPProtocol") 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. "IPProtocol") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *FirewallAllowed) MarshalJSON() ([]byte, error) {
+func (s FirewallAllowed) MarshalJSON() ([]byte, error) {
type NoMethod FirewallAllowed
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type FirewallDenied struct {
- // IPProtocol: The IP protocol to which this rule applies. The protocol
- // type is required when creating a firewall rule. This value can either
- // be one of the following well known protocol strings (tcp, udp, icmp,
- // esp, ah, ipip, sctp) or the IP protocol number.
+ // IPProtocol: The IP protocol to which this rule applies. The protocol type is
+ // required when creating a firewall rule. This value can either be one of the
+ // following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp)
+ // or the IP protocol number.
IPProtocol string `json:"IPProtocol,omitempty"`
-
- // Ports: An optional list of ports to which this rule applies. This
- // field is only applicable for the UDP or TCP protocol. Each entry must
- // be either an integer or a range. If not specified, this rule applies
- // to connections through any port. Example inputs include: ["22"],
- // ["80","443"], and ["12345-12349"].
+ // Ports: An optional list of ports to which this rule applies. This field is
+ // only applicable for the UDP or TCP protocol. Each entry must be either an
+ // integer or a range. If not specified, this rule applies to connections
+ // through any port. Example inputs include: ["22"], ["80","443"], and
+ // ["12345-12349"].
Ports []string `json:"ports,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "IPProtocol") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "IPProtocol") 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. "IPProtocol") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *FirewallDenied) MarshalJSON() ([]byte, error) {
+func (s FirewallDenied) MarshalJSON() ([]byte, error) {
type NoMethod FirewallDenied
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// FirewallList: Contains a list of firewalls.
type FirewallList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of Firewall resources.
Items []*Firewall `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource. Always compute#firewallList for
- // lists of firewalls.
+ // Kind: [Output Only] Type of resource. Always compute#firewallList for lists
+ // of firewalls.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *FirewallListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *FirewallList) MarshalJSON() ([]byte, error) {
+func (s FirewallList) MarshalJSON() ([]byte, error) {
type NoMethod FirewallList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// FirewallListWarning: [Output Only] Informational warning message.
type FirewallListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*FirewallListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *FirewallListWarning) MarshalJSON() ([]byte, error) {
+func (s FirewallListWarning) MarshalJSON() ([]byte, error) {
type NoMethod FirewallListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type FirewallListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *FirewallListWarningData) MarshalJSON() ([]byte, error) {
+func (s FirewallListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod FirewallListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// FirewallLogConfig: The available logging options for a firewall rule.
@@ -12773,771 +10791,622 @@ type FirewallLogConfig struct {
// Enable: This field denotes whether to enable logging for a particular
// firewall rule.
Enable bool `json:"enable,omitempty"`
-
- // Metadata: This field can only be specified for a particular firewall
- // rule if logging is enabled for that rule. This field denotes whether
- // to include or exclude metadata for firewall logs.
+ // Metadata: This field can only be specified for a particular firewall rule if
+ // logging is enabled for that rule. This field denotes whether to include or
+ // exclude metadata for firewall logs.
//
// Possible values:
// "EXCLUDE_ALL_METADATA"
// "INCLUDE_ALL_METADATA"
Metadata string `json:"metadata,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Enable") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Enable") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Enable") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *FirewallLogConfig) MarshalJSON() ([]byte, error) {
+func (s FirewallLogConfig) MarshalJSON() ([]byte, error) {
type NoMethod FirewallLogConfig
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type FirewallPoliciesListAssociationsResponse struct {
// Associations: A list of associations.
Associations []*FirewallPolicyAssociation `json:"associations,omitempty"`
-
// Kind: [Output Only] Type of firewallPolicy associations. Always
// compute#FirewallPoliciesListAssociations for lists of firewallPolicy
// associations.
Kind string `json:"kind,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
// ForceSendFields is a list of field names (e.g. "Associations") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Associations") 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. "Associations") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *FirewallPoliciesListAssociationsResponse) MarshalJSON() ([]byte, error) {
+func (s FirewallPoliciesListAssociationsResponse) MarshalJSON() ([]byte, error) {
type NoMethod FirewallPoliciesListAssociationsResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// FirewallPolicy: Represents a Firewall Policy resource.
type FirewallPolicy struct {
- // Associations: A list of associations that belong to this firewall
- // policy.
+ // Associations: A list of associations that belong to this firewall policy.
Associations []*FirewallPolicyAssociation `json:"associations,omitempty"`
-
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // DisplayName: Deprecated, please use short name instead. User-provided
- // name of the Organization firewall policy. The name should be unique
- // in the organization in which the firewall policy is created. This
- // field is not applicable to network firewall policies. This name must
- // be set on creation and cannot be changed. The name must be 1-63
- // characters long, and comply with RFC1035. Specifically, the name must
- // be 1-63 characters long and match the regular expression
- // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
- // a lowercase letter, and all following characters must be a dash,
- // lowercase letter, or digit, except the last character, which cannot
- // be a dash.
+ // DisplayName: Deprecated, please use short name instead. User-provided name
+ // of the Organization firewall policy. The name should be unique in the
+ // organization in which the firewall policy is created. This field is not
+ // applicable to network firewall policies. This name must be set on creation
+ // and cannot be changed. The name must be 1-63 characters long, and comply
+ // with RFC1035. Specifically, the name must be 1-63 characters long and match
+ // the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first
+ // character must be a lowercase letter, and all following characters must be a
+ // dash, lowercase letter, or digit, except the last character, which cannot be
+ // a dash.
DisplayName string `json:"displayName,omitempty"`
-
- // Fingerprint: Specifies a fingerprint for this resource, which is
- // essentially a hash of the metadata's contents and used for optimistic
- // locking. The fingerprint is initially generated by Compute Engine and
- // changes after every request to modify or update metadata. You must
- // always provide an up-to-date fingerprint hash in order to update or
- // change metadata, otherwise the request will fail with error 412
- // conditionNotMet. To see the latest fingerprint, make get() request to
- // the firewall policy.
+ // Fingerprint: Specifies a fingerprint for this resource, which is essentially
+ // a hash of the metadata's contents and used for optimistic locking. The
+ // fingerprint is initially generated by Compute Engine and changes after every
+ // request to modify or update metadata. You must always provide an up-to-date
+ // fingerprint hash in order to update or change metadata, otherwise the
+ // request will fail with error 412 conditionNotMet. To see the latest
+ // fingerprint, make get() request to the firewall policy.
Fingerprint string `json:"fingerprint,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
- // Kind: [Output only] Type of the resource. Always
- // compute#firewallPolicyfor firewall policies
+ // Kind: [Output only] Type of the resource. Always compute#firewallPolicyfor
+ // firewall policies
Kind string `json:"kind,omitempty"`
-
// Name: Name of the resource. For Organization Firewall Policies it's a
- // [Output Only] numeric ID allocated by Google Cloud which uniquely
- // identifies the Organization Firewall Policy.
+ // [Output Only] numeric ID allocated by Google Cloud which uniquely identifies
+ // the Organization Firewall Policy.
Name string `json:"name,omitempty"`
-
- // Parent: [Output Only] The parent of the firewall policy. This field
- // is not applicable to network firewall policies.
+ // Parent: [Output Only] The parent of the firewall policy. This field is not
+ // applicable to network firewall policies.
Parent string `json:"parent,omitempty"`
-
- // Region: [Output Only] URL of the region where the regional firewall
- // policy resides. This field is not applicable to global firewall
- // policies. You must specify this field as part of the HTTP request
- // URL. It is not settable as a field in the request body.
+ // Region: [Output Only] URL of the region where the regional firewall policy
+ // resides. This field is not applicable to global firewall policies. You must
+ // specify this field as part of the HTTP request URL. It is not settable as a
+ // field in the request body.
Region string `json:"region,omitempty"`
-
// RuleTupleCount: [Output Only] Total count of all firewall policy rule
// tuples. A firewall policy can not exceed a set number of tuples.
RuleTupleCount int64 `json:"ruleTupleCount,omitempty"`
-
- // Rules: A list of rules that belong to this policy. There must always
- // be a default rule (rule with priority 2147483647 and match "*"). If
- // no rules are provided when creating a firewall policy, a default rule
- // with action "allow" will be added.
+ // Rules: A list of rules that belong to this policy. There must always be a
+ // default rule (rule with priority 2147483647 and match "*"). If no rules are
+ // provided when creating a firewall policy, a default rule with action "allow"
+ // will be added.
Rules []*FirewallPolicyRule `json:"rules,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // SelfLinkWithId: [Output Only] Server-defined URL for this resource
- // with the resource id.
+ // SelfLinkWithId: [Output Only] Server-defined URL for this resource with the
+ // resource id.
SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
-
- // ShortName: User-provided name of the Organization firewall policy.
- // The name should be unique in the organization in which the firewall
- // policy is created. This field is not applicable to network firewall
- // policies. This name must be set on creation and cannot be changed.
- // The name must be 1-63 characters long, and comply with RFC1035.
- // Specifically, the name must be 1-63 characters long and match the
- // regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first
- // character must be a lowercase letter, and all following characters
- // must be a dash, lowercase letter, or digit, except the last
- // character, which cannot be a dash.
+ // ShortName: User-provided name of the Organization firewall policy. The name
+ // should be unique in the organization in which the firewall policy is
+ // created. This field is not applicable to network firewall policies. This
+ // name must be set on creation and cannot be changed. The name must be 1-63
+ // characters long, and comply with RFC1035. Specifically, the name must be
+ // 1-63 characters long and match the regular expression
+ // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a
+ // lowercase letter, and all following characters must be a dash, lowercase
+ // letter, or digit, except the last character, which cannot be a dash.
ShortName string `json:"shortName,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
// ForceSendFields is a list of field names (e.g. "Associations") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Associations") 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. "Associations") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *FirewallPolicy) MarshalJSON() ([]byte, error) {
+func (s FirewallPolicy) MarshalJSON() ([]byte, error) {
type NoMethod FirewallPolicy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type FirewallPolicyAssociation struct {
// AttachmentTarget: The target that the firewall policy is attached to.
AttachmentTarget string `json:"attachmentTarget,omitempty"`
-
- // DisplayName: [Output Only] Deprecated, please use short name instead.
- // The display name of the firewall policy of the association.
+ // DisplayName: [Output Only] Deprecated, please use short name instead. The
+ // display name of the firewall policy of the association.
DisplayName string `json:"displayName,omitempty"`
-
- // FirewallPolicyId: [Output Only] The firewall policy ID of the
- // association.
+ // FirewallPolicyId: [Output Only] The firewall policy ID of the association.
FirewallPolicyId string `json:"firewallPolicyId,omitempty"`
-
// Name: The name for an association.
Name string `json:"name,omitempty"`
-
// ShortName: [Output Only] The short name of the firewall policy of the
// association.
ShortName string `json:"shortName,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
// ForceSendFields is a list of field names (e.g. "AttachmentTarget") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "AttachmentTarget") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "AttachmentTarget") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *FirewallPolicyAssociation) MarshalJSON() ([]byte, error) {
+func (s FirewallPolicyAssociation) MarshalJSON() ([]byte, error) {
type NoMethod FirewallPolicyAssociation
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type FirewallPolicyList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of FirewallPolicy resources.
Items []*FirewallPolicy `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource. Always
- // compute#firewallPolicyList for listsof FirewallPolicies
+ // Kind: [Output Only] Type of resource. Always compute#firewallPolicyList for
+ // listsof FirewallPolicies
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *FirewallPolicyListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *FirewallPolicyList) MarshalJSON() ([]byte, error) {
+func (s FirewallPolicyList) MarshalJSON() ([]byte, error) {
type NoMethod FirewallPolicyList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// FirewallPolicyListWarning: [Output Only] Informational warning
-// message.
+// FirewallPolicyListWarning: [Output Only] Informational warning message.
type FirewallPolicyListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*FirewallPolicyListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *FirewallPolicyListWarning) MarshalJSON() ([]byte, error) {
+func (s FirewallPolicyListWarning) MarshalJSON() ([]byte, error) {
type NoMethod FirewallPolicyListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type FirewallPolicyListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *FirewallPolicyListWarningData) MarshalJSON() ([]byte, error) {
+func (s FirewallPolicyListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod FirewallPolicyListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// FirewallPolicyRule: Represents a rule that describes one or more
-// match conditions along with the action to be taken when traffic
-// matches this condition (allow or deny).
+// FirewallPolicyRule: Represents a rule that describes one or more match
+// conditions along with the action to be taken when traffic matches this
+// condition (allow or deny).
type FirewallPolicyRule struct {
- // Action: The Action to perform when the client connection triggers the
- // rule. Valid actions are "allow", "deny" and "goto_next".
+ // Action: The Action to perform when the client connection triggers the rule.
+ // Valid actions for firewall rules are: "allow", "deny",
+ // "apply_security_profile_group" and "goto_next". Valid actions for packet
+ // mirroring rules are: "mirror", "do_not_mirror" and "goto_next".
Action string `json:"action,omitempty"`
-
// Description: An optional description for this resource.
Description string `json:"description,omitempty"`
-
// Direction: The direction in which this rule applies.
//
// Possible values:
// "EGRESS"
// "INGRESS"
Direction string `json:"direction,omitempty"`
-
- // Disabled: Denotes whether the firewall policy rule is disabled. When
- // set to true, the firewall policy rule is not enforced and traffic
- // behaves as if it did not exist. If this is unspecified, the firewall
- // policy rule will be enabled.
+ // Disabled: Denotes whether the firewall policy rule is disabled. When set to
+ // true, the firewall policy rule is not enforced and traffic behaves as if it
+ // did not exist. If this is unspecified, the firewall policy rule will be
+ // enabled.
Disabled bool `json:"disabled,omitempty"`
-
- // EnableLogging: Denotes whether to enable logging for a particular
- // rule. If logging is enabled, logs will be exported to the configured
- // export destination in Stackdriver. Logs may be exported to BigQuery
- // or Pub/Sub. Note: you cannot enable logging on "goto_next" rules.
+ // EnableLogging: Denotes whether to enable logging for a particular rule. If
+ // logging is enabled, logs will be exported to the configured export
+ // destination in Stackdriver. Logs may be exported to BigQuery or Pub/Sub.
+ // Note: you cannot enable logging on "goto_next" rules.
EnableLogging bool `json:"enableLogging,omitempty"`
-
- // Kind: [Output only] Type of the resource. Always
- // compute#firewallPolicyRule for firewall policy rules
+ // Kind: [Output only] Type of the resource. Returns compute#firewallPolicyRule
+ // for firewall rules and compute#packetMirroringRule for packet mirroring
+ // rules.
Kind string `json:"kind,omitempty"`
-
- // Match: A match condition that incoming traffic is evaluated against.
- // If it evaluates to true, the corresponding 'action' is enforced.
+ // Match: A match condition that incoming traffic is evaluated against. If it
+ // evaluates to true, the corresponding 'action' is enforced.
Match *FirewallPolicyRuleMatcher `json:"match,omitempty"`
-
- // Priority: An integer indicating the priority of a rule in the list.
- // The priority must be a positive value between 0 and 2147483647. Rules
- // are evaluated from highest to lowest priority where 0 is the highest
- // priority and 2147483647 is the lowest prority.
+ // Priority: An integer indicating the priority of a rule in the list. The
+ // priority must be a positive value between 0 and 2147483647. Rules are
+ // evaluated from highest to lowest priority where 0 is the highest priority
+ // and 2147483647 is the lowest priority.
Priority int64 `json:"priority,omitempty"`
-
// RuleName: An optional name for the rule. This field is not a unique
// identifier and can be updated.
RuleName string `json:"ruleName,omitempty"`
-
- // RuleTupleCount: [Output Only] Calculation of the complexity of a
- // single firewall policy rule.
+ // RuleTupleCount: [Output Only] Calculation of the complexity of a single
+ // firewall policy rule.
RuleTupleCount int64 `json:"ruleTupleCount,omitempty"`
-
- // TargetResources: A list of network resource URLs to which this rule
- // applies. This field allows you to control which network's VMs get
- // this rule. If this field is left blank, all VMs within the
- // organization will receive the rule.
+ // SecurityProfileGroup: A fully-qualified URL of a SecurityProfile resource
+ // instance. Example:
+ // https://networksecurity.googleapis.com/v1/projects/{project}/locations/{location}/securityProfileGroups/my-security-profile-group
+ // Must be specified if action is one of 'apply_security_profile_group' or
+ // 'mirror'. Cannot be specified for other actions.
+ SecurityProfileGroup string `json:"securityProfileGroup,omitempty"`
+ // TargetResources: A list of network resource URLs to which this rule applies.
+ // This field allows you to control which network's VMs get this rule. If this
+ // field is left blank, all VMs within the organization will receive the rule.
TargetResources []string `json:"targetResources,omitempty"`
-
- // TargetSecureTags: A list of secure tags that controls which instances
- // the firewall rule applies to. If targetSecureTag are specified, then
- // the firewall rule applies only to instances in the VPC network that
- // have one of those EFFECTIVE secure tags, if all the target_secure_tag
- // are in INEFFECTIVE state, then this rule will be ignored.
- // targetSecureTag may not be set at the same time as
- // targetServiceAccounts. If neither targetServiceAccounts nor
- // targetSecureTag are specified, the firewall rule applies to all
- // instances on the specified network. Maximum number of target label
- // tags allowed is 256.
+ // TargetSecureTags: A list of secure tags that controls which instances the
+ // firewall rule applies to. If targetSecureTag are specified, then the
+ // firewall rule applies only to instances in the VPC network that have one of
+ // those EFFECTIVE secure tags, if all the target_secure_tag are in INEFFECTIVE
+ // state, then this rule will be ignored. targetSecureTag may not be set at the
+ // same time as targetServiceAccounts. If neither targetServiceAccounts nor
+ // targetSecureTag are specified, the firewall rule applies to all instances on
+ // the specified network. Maximum number of target label tags allowed is 256.
TargetSecureTags []*FirewallPolicyRuleSecureTag `json:"targetSecureTags,omitempty"`
-
- // TargetServiceAccounts: A list of service accounts indicating the sets
- // of instances that are applied with this rule.
+ // TargetServiceAccounts: A list of service accounts indicating the sets of
+ // instances that are applied with this rule.
TargetServiceAccounts []string `json:"targetServiceAccounts,omitempty"`
+ // TlsInspect: Boolean flag indicating if the traffic should be TLS decrypted.
+ // Can be set only if action = 'apply_security_profile_group' and cannot be set
+ // for other actions.
+ TlsInspect bool `json:"tlsInspect,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Action") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Action") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Action") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *FirewallPolicyRule) MarshalJSON() ([]byte, error) {
+func (s FirewallPolicyRule) MarshalJSON() ([]byte, error) {
type NoMethod FirewallPolicyRule
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// FirewallPolicyRuleMatcher: Represents a match condition that incoming
// traffic is evaluated against. Exactly one field must be specified.
type FirewallPolicyRuleMatcher struct {
// DestAddressGroups: Address groups which should be matched against the
- // traffic destination. Maximum number of destination address groups is
- // 10.
+ // traffic destination. Maximum number of destination address groups is 10.
DestAddressGroups []string `json:"destAddressGroups,omitempty"`
-
// DestFqdns: Fully Qualified Domain Name (FQDN) which should be matched
- // against traffic destination. Maximum number of destination fqdn
- // allowed is 100.
+ // against traffic destination. Maximum number of destination fqdn allowed is
+ // 100.
DestFqdns []string `json:"destFqdns,omitempty"`
-
- // DestIpRanges: CIDR IP address range. Maximum number of destination
- // CIDR IP ranges allowed is 5000.
+ // DestIpRanges: CIDR IP address range. Maximum number of destination CIDR IP
+ // ranges allowed is 5000.
DestIpRanges []string `json:"destIpRanges,omitempty"`
-
- // DestRegionCodes: Region codes whose IP addresses will be used to
- // match for destination of traffic. Should be specified as 2 letter
- // country code defined as per ISO 3166 alpha-2 country codes. ex."US"
- // Maximum number of dest region codes allowed is 5000.
+ // DestRegionCodes: Region codes whose IP addresses will be used to match for
+ // destination of traffic. Should be specified as 2 letter country code defined
+ // as per ISO 3166 alpha-2 country codes. ex."US" Maximum number of dest region
+ // codes allowed is 5000.
DestRegionCodes []string `json:"destRegionCodes,omitempty"`
-
- // DestThreatIntelligences: Names of Network Threat Intelligence lists.
- // The IPs in these lists will be matched against traffic destination.
+ // DestThreatIntelligences: Names of Network Threat Intelligence lists. The IPs
+ // in these lists will be matched against traffic destination.
DestThreatIntelligences []string `json:"destThreatIntelligences,omitempty"`
-
- // Layer4Configs: Pairs of IP protocols and ports that the rule should
- // match.
+ // Layer4Configs: Pairs of IP protocols and ports that the rule should match.
Layer4Configs []*FirewallPolicyRuleMatcherLayer4Config `json:"layer4Configs,omitempty"`
-
- // SrcAddressGroups: Address groups which should be matched against the
- // traffic source. Maximum number of source address groups is 10.
+ // SrcAddressGroups: Address groups which should be matched against the traffic
+ // source. Maximum number of source address groups is 10.
SrcAddressGroups []string `json:"srcAddressGroups,omitempty"`
-
- // SrcFqdns: Fully Qualified Domain Name (FQDN) which should be matched
- // against traffic source. Maximum number of source fqdn allowed is 100.
+ // SrcFqdns: Fully Qualified Domain Name (FQDN) which should be matched against
+ // traffic source. Maximum number of source fqdn allowed is 100.
SrcFqdns []string `json:"srcFqdns,omitempty"`
-
- // SrcIpRanges: CIDR IP address range. Maximum number of source CIDR IP
- // ranges allowed is 5000.
+ // SrcIpRanges: CIDR IP address range. Maximum number of source CIDR IP ranges
+ // allowed is 5000.
SrcIpRanges []string `json:"srcIpRanges,omitempty"`
-
- // SrcRegionCodes: Region codes whose IP addresses will be used to match
- // for source of traffic. Should be specified as 2 letter country code
- // defined as per ISO 3166 alpha-2 country codes. ex."US" Maximum number
- // of source region codes allowed is 5000.
+ // SrcRegionCodes: Region codes whose IP addresses will be used to match for
+ // source of traffic. Should be specified as 2 letter country code defined as
+ // per ISO 3166 alpha-2 country codes. ex."US" Maximum number of source region
+ // codes allowed is 5000.
SrcRegionCodes []string `json:"srcRegionCodes,omitempty"`
-
- // SrcSecureTags: List of secure tag values, which should be matched at
- // the source of the traffic. For INGRESS rule, if all the srcSecureTag
- // are INEFFECTIVE, and there is no srcIpRange, this rule will be
- // ignored. Maximum number of source tag values allowed is 256.
+ // SrcSecureTags: List of secure tag values, which should be matched at the
+ // source of the traffic. For INGRESS rule, if all the srcSecureTag are
+ // INEFFECTIVE, and there is no srcIpRange, this rule will be ignored. Maximum
+ // number of source tag values allowed is 256.
SrcSecureTags []*FirewallPolicyRuleSecureTag `json:"srcSecureTags,omitempty"`
-
- // SrcThreatIntelligences: Names of Network Threat Intelligence lists.
- // The IPs in these lists will be matched against traffic source.
+ // SrcThreatIntelligences: Names of Network Threat Intelligence lists. The IPs
+ // in these lists will be matched against traffic source.
SrcThreatIntelligences []string `json:"srcThreatIntelligences,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "DestAddressGroups")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "DestAddressGroups") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "DestAddressGroups") 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. "DestAddressGroups") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *FirewallPolicyRuleMatcher) MarshalJSON() ([]byte, error) {
+func (s FirewallPolicyRuleMatcher) MarshalJSON() ([]byte, error) {
type NoMethod FirewallPolicyRuleMatcher
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type FirewallPolicyRuleMatcherLayer4Config struct {
- // IpProtocol: The IP protocol to which this rule applies. The protocol
- // type is required when creating a firewall rule. This value can either
- // be one of the following well known protocol strings (tcp, udp, icmp,
- // esp, ah, ipip, sctp), or the IP protocol number.
+ // IpProtocol: The IP protocol to which this rule applies. The protocol type is
+ // required when creating a firewall rule. This value can either be one of the
+ // following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp),
+ // or the IP protocol number.
IpProtocol string `json:"ipProtocol,omitempty"`
-
- // Ports: An optional list of ports to which this rule applies. This
- // field is only applicable for UDP or TCP protocol. Each entry must be
- // either an integer or a range. If not specified, this rule applies to
- // connections through any port. Example inputs include: ["22"],
- // ["80","443"], and ["12345-12349"].
+ // Ports: An optional list of ports to which this rule applies. This field is
+ // only applicable for UDP or TCP protocol. Each entry must be either an
+ // integer or a range. If not specified, this rule applies to connections
+ // through any port. Example inputs include: ["22"], ["80","443"], and
+ // ["12345-12349"].
Ports []string `json:"ports,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "IpProtocol") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "IpProtocol") 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. "IpProtocol") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *FirewallPolicyRuleMatcherLayer4Config) MarshalJSON() ([]byte, error) {
+func (s FirewallPolicyRuleMatcherLayer4Config) MarshalJSON() ([]byte, error) {
type NoMethod FirewallPolicyRuleMatcherLayer4Config
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type FirewallPolicyRuleSecureTag struct {
// Name: Name of the secure tag, created with TagManager's TagValue API.
Name string `json:"name,omitempty"`
-
// State: [Output Only] State of the secure tag, either `EFFECTIVE` or
- // `INEFFECTIVE`. A secure tag is `INEFFECTIVE` when it is deleted or
- // its network is deleted.
+ // `INEFFECTIVE`. A secure tag is `INEFFECTIVE` when it is deleted or its
+ // network is deleted.
//
// Possible values:
// "EFFECTIVE"
// "INEFFECTIVE"
State string `json:"state,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Name") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Name") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
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 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. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *FirewallPolicyRuleSecureTag) MarshalJSON() ([]byte, error) {
+func (s FirewallPolicyRuleSecureTag) MarshalJSON() ([]byte, error) {
type NoMethod FirewallPolicyRuleSecureTag
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// FixedOrPercent: Encapsulates numeric value that can be either
-// absolute or relative.
+// FixedOrPercent: Encapsulates numeric value that can be either absolute or
+// relative.
type FixedOrPercent struct {
- // Calculated: [Output Only] Absolute value of VM instances calculated
- // based on the specific mode. - If the value is fixed, then the
- // calculated value is equal to the fixed value. - If the value is a
- // percent, then the calculated value is percent/100 * targetSize. For
- // example, the calculated value of a 80% of a managed instance group
- // with 150 instances would be (80/100 * 150) = 120 VM instances. If
- // there is a remainder, the number is rounded.
+ // Calculated: [Output Only] Absolute value of VM instances calculated based on
+ // the specific mode. - If the value is fixed, then the calculated value is
+ // equal to the fixed value. - If the value is a percent, then the calculated
+ // value is percent/100 * targetSize. For example, the calculated value of a
+ // 80% of a managed instance group with 150 instances would be (80/100 * 150) =
+ // 120 VM instances. If there is a remainder, the number is rounded.
Calculated int64 `json:"calculated,omitempty"`
-
- // Fixed: Specifies a fixed number of VM instances. This must be a
- // positive integer.
+ // Fixed: Specifies a fixed number of VM instances. This must be a positive
+ // integer.
Fixed int64 `json:"fixed,omitempty"`
-
- // Percent: Specifies a percentage of instances between 0 to 100%,
- // inclusive. For example, specify 80 for 80%.
+ // Percent: Specifies a percentage of instances between 0 to 100%, inclusive.
+ // For example, specify 80 for 80%.
Percent int64 `json:"percent,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Calculated") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Calculated") 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. "Calculated") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *FixedOrPercent) MarshalJSON() ([]byte, error) {
+func (s FixedOrPercent) MarshalJSON() ([]byte, error) {
type NoMethod FixedOrPercent
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// ForwardingRule: Represents a Forwarding Rule resource. Forwarding
-// rule resources in Google Cloud can be either regional or global in
-// scope: * Global
+// ForwardingRule: Represents a Forwarding Rule resource. Forwarding rule
+// resources in Google Cloud can be either regional or global in scope: *
+// Global
// (https://cloud.google.com/compute/docs/reference/rest/v1/globalForwardingRules)
// * Regional
-// (https://cloud.google.com/compute/docs/reference/rest/v1/forwardingRules)
-// A forwarding rule and its corresponding IP address represent the
-// frontend configuration of a Google Cloud load balancer. Forwarding
-// rules can also reference target instances and Cloud VPN Classic
-// gateways (targetVpnGateway). For more information, read Forwarding
-// rule concepts and Using protocol forwarding.
+// (https://cloud.google.com/compute/docs/reference/rest/v1/forwardingRules) A
+// forwarding rule and its corresponding IP address represent the frontend
+// configuration of a Google Cloud load balancer. Forwarding rules can also
+// reference target instances and Cloud VPN Classic gateways
+// (targetVpnGateway). For more information, read Forwarding rule concepts and
+// Using protocol forwarding.
type ForwardingRule struct {
- // IPAddress: IP address for which this forwarding rule accepts traffic.
- // When a client sends traffic to this IP address, the forwarding rule
- // directs the traffic to the referenced target or backendService. While
- // creating a forwarding rule, specifying an IPAddress is required under
- // the following circumstances: - When the target is set to
- // targetGrpcProxy and validateForProxyless is set to true, the
- // IPAddress should be set to 0.0.0.0. - When the target is a Private
- // Service Connect Google APIs bundle, you must specify an IPAddress.
- // Otherwise, you can optionally specify an IP address that references
- // an existing static (reserved) IP address resource. When omitted,
- // Google Cloud assigns an ephemeral IP address. Use one of the
- // following formats to specify an IP address while creating a
- // forwarding rule: * IP address number, as in `100.1.2.3` * IPv6
- // address range, as in `2600:1234::/96` * Full resource URL, as in
+ // IPAddress: IP address for which this forwarding rule accepts traffic. When a
+ // client sends traffic to this IP address, the forwarding rule directs the
+ // traffic to the referenced target or backendService. While creating a
+ // forwarding rule, specifying an IPAddress is required under the following
+ // circumstances: - When the target is set to targetGrpcProxy and
+ // validateForProxyless is set to true, the IPAddress should be set to 0.0.0.0.
+ // - When the target is a Private Service Connect Google APIs bundle, you must
+ // specify an IPAddress. Otherwise, you can optionally specify an IP address
+ // that references an existing static (reserved) IP address resource. When
+ // omitted, Google Cloud assigns an ephemeral IP address. Use one of the
+ // following formats to specify an IP address while creating a forwarding rule:
+ // * IP address number, as in `100.1.2.3` * IPv6 address range, as in
+ // `2600:1234::/96` * Full resource URL, as in
// https://www.googleapis.com/compute/v1/projects/
- // project_id/regions/region/addresses/address-name * Partial URL or by
- // name, as in: -
- // projects/project_id/regions/region/addresses/address-name -
- // regions/region/addresses/address-name - global/addresses/address-name
- // - address-name The forwarding rule's target or backendService, and in
- // most cases, also the loadBalancingScheme, determine the type of IP
- // address that you can use. For detailed information, see IP address
- // specifications
+ // project_id/regions/region/addresses/address-name * Partial URL or by name,
+ // as in: - projects/project_id/regions/region/addresses/address-name -
+ // regions/region/addresses/address-name - global/addresses/address-name -
+ // address-name The forwarding rule's target or backendService, and in most
+ // cases, also the loadBalancingScheme, determine the type of IP address that
+ // you can use. For detailed information, see IP address specifications
// (https://cloud.google.com/load-balancing/docs/forwarding-rule-concepts#ip_address_specifications).
- // When reading an IPAddress, the API always returns the IP address
- // number.
+ // When reading an IPAddress, the API always returns the IP address number.
IPAddress string `json:"IPAddress,omitempty"`
-
// IPProtocol: The IP protocol to which this rule applies. For protocol
- // forwarding, valid options are TCP, UDP, ESP, AH, SCTP, ICMP and
- // L3_DEFAULT. The valid IP protocols are different for different load
- // balancing products as described in Load balancing features
+ // forwarding, valid options are TCP, UDP, ESP, AH, SCTP, ICMP and L3_DEFAULT.
+ // The valid IP protocols are different for different load balancing products
+ // as described in Load balancing features
// (https://cloud.google.com/load-balancing/docs/features#protocols_from_the_load_balancer_to_the_backends).
//
// Possible values:
@@ -13549,109 +11418,94 @@ type ForwardingRule struct {
// "TCP"
// "UDP"
IPProtocol string `json:"IPProtocol,omitempty"`
-
- // AllPorts: The ports, portRange, and allPorts fields are mutually
- // exclusive. Only packets addressed to ports in the specified range
- // will be forwarded to the backends configured with this forwarding
- // rule. The allPorts field has the following limitations: - It requires
- // that the forwarding rule IPProtocol be TCP, UDP, SCTP, or L3_DEFAULT.
- // - It's applicable only to the following products: internal
- // passthrough Network Load Balancers, backend service-based external
- // passthrough Network Load Balancers, and internal and external
- // protocol forwarding. - Set this field to true to allow packets
- // addressed to any port or packets lacking destination port information
- // (for example, UDP fragments after the first fragment) to be forwarded
- // to the backends configured with this forwarding rule. The L3_DEFAULT
- // protocol requires allPorts be set to true.
+ // AllPorts: The ports, portRange, and allPorts fields are mutually exclusive.
+ // Only packets addressed to ports in the specified range will be forwarded to
+ // the backends configured with this forwarding rule. The allPorts field has
+ // the following limitations: - It requires that the forwarding rule IPProtocol
+ // be TCP, UDP, SCTP, or L3_DEFAULT. - It's applicable only to the following
+ // products: internal passthrough Network Load Balancers, backend service-based
+ // external passthrough Network Load Balancers, and internal and external
+ // protocol forwarding. - Set this field to true to allow packets addressed to
+ // any port or packets lacking destination port information (for example, UDP
+ // fragments after the first fragment) to be forwarded to the backends
+ // configured with this forwarding rule. The L3_DEFAULT protocol requires
+ // allPorts be set to true.
AllPorts bool `json:"allPorts,omitempty"`
-
// AllowGlobalAccess: If set to true, clients can access the internal
- // passthrough Network Load Balancers, the regional internal Application
- // Load Balancer, and the regional internal proxy Network Load Balancer
- // from all regions. If false, only allows access from the local region
- // the load balancer is located at. Note that for INTERNAL_MANAGED
- // forwarding rules, this field cannot be changed after the forwarding
- // rule is created.
+ // passthrough Network Load Balancers, the regional internal Application Load
+ // Balancer, and the regional internal proxy Network Load Balancer from all
+ // regions. If false, only allows access from the local region the load
+ // balancer is located at. Note that for INTERNAL_MANAGED forwarding rules,
+ // this field cannot be changed after the forwarding rule is created.
AllowGlobalAccess bool `json:"allowGlobalAccess,omitempty"`
-
- // AllowPscGlobalAccess: This is used in PSC consumer ForwardingRule to
- // control whether the PSC endpoint can be accessed from another region.
+ // AllowPscGlobalAccess: This is used in PSC consumer ForwardingRule to control
+ // whether the PSC endpoint can be accessed from another region.
AllowPscGlobalAccess bool `json:"allowPscGlobalAccess,omitempty"`
-
- // BackendService: Identifies the backend service to which the
- // forwarding rule sends traffic. Required for internal and external
- // passthrough Network Load Balancers; must be omitted for all other
- // load balancer types.
+ // BackendService: Identifies the backend service to which the forwarding rule
+ // sends traffic. Required for internal and external passthrough Network Load
+ // Balancers; must be omitted for all other load balancer types.
BackendService string `json:"backendService,omitempty"`
-
// BaseForwardingRule: [Output Only] The URL for the corresponding base
- // forwarding rule. By base forwarding rule, we mean the forwarding rule
- // that has the same IP address, protocol, and port settings with the
- // current forwarding rule, but without sourceIPRanges specified. Always
- // empty if the current forwarding rule does not have sourceIPRanges
- // specified.
+ // forwarding rule. By base forwarding rule, we mean the forwarding rule that
+ // has the same IP address, protocol, and port settings with the current
+ // forwarding rule, but without sourceIPRanges specified. Always empty if the
+ // current forwarding rule does not have sourceIPRanges specified.
BaseForwardingRule string `json:"baseForwardingRule,omitempty"`
-
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // Fingerprint: Fingerprint of this resource. A hash of the contents
- // stored in this object. This field is used in optimistic locking. This
- // field will be ignored when inserting a ForwardingRule. Include the
- // fingerprint in patch request to ensure that you do not overwrite
- // changes that were applied from another concurrent request. To see the
- // latest fingerprint, make a get() request to retrieve a
- // ForwardingRule.
+ // Fingerprint: Fingerprint of this resource. A hash of the contents stored in
+ // this object. This field is used in optimistic locking. This field will be
+ // ignored when inserting a ForwardingRule. Include the fingerprint in patch
+ // request to ensure that you do not overwrite changes that were applied from
+ // another concurrent request. To see the latest fingerprint, make a get()
+ // request to retrieve a ForwardingRule.
Fingerprint string `json:"fingerprint,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
- // IpVersion: The IP Version that will be used by this forwarding rule.
- // Valid options are IPV4 or IPV6.
+ // IpCollection: Resource reference of a PublicDelegatedPrefix. The PDP must be
+ // a sub-PDP in EXTERNAL_IPV6_FORWARDING_RULE_CREATION mode. Use one of the
+ // following formats to specify a sub-PDP when creating an IPv6 NetLB
+ // forwarding rule using BYOIP: Full resource URL, as in
+ // https://www.googleapis.com/compute/v1/projects/project_id/regions/region
+ // /publicDelegatedPrefixes/sub-pdp-name Partial URL, as in: -
+ // projects/project_id/regions/region/publicDelegatedPrefixes/sub-pdp-name -
+ // regions/region/publicDelegatedPrefixes/sub-pdp-name
+ IpCollection string `json:"ipCollection,omitempty"`
+ // IpVersion: The IP Version that will be used by this forwarding rule. Valid
+ // options are IPV4 or IPV6.
//
// Possible values:
// "IPV4"
// "IPV6"
// "UNSPECIFIED_VERSION"
IpVersion string `json:"ipVersion,omitempty"`
-
- // IsMirroringCollector: Indicates whether or not this load balancer can
- // be used as a collector for packet mirroring. To prevent mirroring
- // loops, instances behind this load balancer will not have their
- // traffic mirrored even if a PacketMirroring rule applies to them. This
- // can only be set to true for load balancers that have their
- // loadBalancingScheme set to INTERNAL.
+ // IsMirroringCollector: Indicates whether or not this load balancer can be
+ // used as a collector for packet mirroring. To prevent mirroring loops,
+ // instances behind this load balancer will not have their traffic mirrored
+ // even if a PacketMirroring rule applies to them. This can only be set to true
+ // for load balancers that have their loadBalancingScheme set to INTERNAL.
IsMirroringCollector bool `json:"isMirroringCollector,omitempty"`
-
- // Kind: [Output Only] Type of the resource. Always
- // compute#forwardingRule for forwarding rule resources.
+ // Kind: [Output Only] Type of the resource. Always compute#forwardingRule for
+ // forwarding rule resources.
Kind string `json:"kind,omitempty"`
-
// LabelFingerprint: A fingerprint for the labels being applied to this
- // resource, which is essentially a hash of the labels set used for
- // optimistic locking. The fingerprint is initially generated by Compute
- // Engine and changes after every request to modify or update labels.
- // You must always provide an up-to-date fingerprint hash in order to
- // update or change labels, otherwise the request will fail with error
- // 412 conditionNotMet. To see the latest fingerprint, make a get()
- // request to retrieve a ForwardingRule.
+ // resource, which is essentially a hash of the labels set used for optimistic
+ // locking. The fingerprint is initially generated by Compute Engine and
+ // changes after every request to modify or update labels. You must always
+ // provide an up-to-date fingerprint hash in order to update or change labels,
+ // otherwise the request will fail with error 412 conditionNotMet. To see the
+ // latest fingerprint, make a get() request to retrieve a ForwardingRule.
LabelFingerprint string `json:"labelFingerprint,omitempty"`
-
- // Labels: Labels for this resource. These can only be added or modified
- // by the setLabels method. Each label key/value pair must comply with
- // RFC1035. Label values may be empty.
+ // Labels: Labels for this resource. These can only be added or modified by the
+ // setLabels method. Each label key/value pair must comply with RFC1035. Label
+ // values may be empty.
Labels map[string]string `json:"labels,omitempty"`
-
// LoadBalancingScheme: Specifies the forwarding rule type. For more
- // information about forwarding rules, refer to Forwarding rule
- // concepts.
+ // information about forwarding rules, refer to Forwarding rule concepts.
//
// Possible values:
// "EXTERNAL"
@@ -13661,1245 +11515,992 @@ type ForwardingRule struct {
// "INTERNAL_SELF_MANAGED"
// "INVALID"
LoadBalancingScheme string `json:"loadBalancingScheme,omitempty"`
-
- // MetadataFilters: Opaque filter criteria used by load balancer to
- // restrict routing configuration to a limited set of xDS compliant
- // clients. In their xDS requests to load balancer, xDS clients present
- // node metadata. When there is a match, the relevant configuration is
- // made available to those proxies. Otherwise, all the resources (e.g.
- // TargetHttpProxy, UrlMap) referenced by the ForwardingRule are not
- // visible to those proxies. For each metadataFilter in this list, if
- // its filterMatchCriteria is set to MATCH_ANY, at least one of the
- // filterLabels must match the corresponding label provided in the
- // metadata. If its filterMatchCriteria is set to MATCH_ALL, then all of
- // its filterLabels must match with corresponding labels provided in the
- // metadata. If multiple metadataFilters are specified, all of them need
- // to be satisfied in order to be considered a match. metadataFilters
- // specified here will be applifed before those specified in the UrlMap
- // that this ForwardingRule references. metadataFilters only applies to
- // Loadbalancers that have their loadBalancingScheme set to
- // INTERNAL_SELF_MANAGED.
+ // MetadataFilters: Opaque filter criteria used by load balancer to restrict
+ // routing configuration to a limited set of xDS compliant clients. In their
+ // xDS requests to load balancer, xDS clients present node metadata. When there
+ // is a match, the relevant configuration is made available to those proxies.
+ // Otherwise, all the resources (e.g. TargetHttpProxy, UrlMap) referenced by
+ // the ForwardingRule are not visible to those proxies. For each metadataFilter
+ // in this list, if its filterMatchCriteria is set to MATCH_ANY, at least one
+ // of the filterLabels must match the corresponding label provided in the
+ // metadata. If its filterMatchCriteria is set to MATCH_ALL, then all of its
+ // filterLabels must match with corresponding labels provided in the metadata.
+ // If multiple metadataFilters are specified, all of them need to be satisfied
+ // in order to be considered a match. metadataFilters specified here will be
+ // applifed before those specified in the UrlMap that this ForwardingRule
+ // references. metadataFilters only applies to Loadbalancers that have their
+ // loadBalancingScheme set to INTERNAL_SELF_MANAGED.
MetadataFilters []*MetadataFilter `json:"metadataFilters,omitempty"`
-
- // Name: Name of the resource; provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
- // the first character must be a lowercase letter, and all following
- // characters must be a dash, lowercase letter, or digit, except the
- // last character, which cannot be a dash. For Private Service Connect
- // forwarding rules that forward traffic to Google APIs, the forwarding
- // rule name must be a 1-20 characters string with lowercase letters and
- // numbers and must start with a letter.
+ // Name: Name of the resource; provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must
+ // be a lowercase letter, and all following characters must be a dash,
+ // lowercase letter, or digit, except the last character, which cannot be a
+ // dash. For Private Service Connect forwarding rules that forward traffic to
+ // Google APIs, the forwarding rule name must be a 1-20 characters string with
+ // lowercase letters and numbers and must start with a letter.
Name string `json:"name,omitempty"`
-
- // Network: This field is not used for global external load balancing.
- // For internal passthrough Network Load Balancers, this field
- // identifies the network that the load balanced IP should belong to for
- // this forwarding rule. If the subnetwork is specified, the network of
- // the subnetwork will be used. If neither subnetwork nor this field is
- // specified, the default network will be used. For Private Service
- // Connect forwarding rules that forward traffic to Google APIs, a
- // network must be provided.
+ // Network: This field is not used for global external load balancing. For
+ // internal passthrough Network Load Balancers, this field identifies the
+ // network that the load balanced IP should belong to for this forwarding rule.
+ // If the subnetwork is specified, the network of the subnetwork will be used.
+ // If neither subnetwork nor this field is specified, the default network will
+ // be used. For Private Service Connect forwarding rules that forward traffic
+ // to Google APIs, a network must be provided.
Network string `json:"network,omitempty"`
-
- // NetworkTier: This signifies the networking tier used for configuring
- // this load balancer and can only take the following values: PREMIUM,
- // STANDARD. For regional ForwardingRule, the valid values are PREMIUM
- // and STANDARD. For GlobalForwardingRule, the valid value is PREMIUM.
- // If this field is not specified, it is assumed to be PREMIUM. If
- // IPAddress is specified, this value must be equal to the networkTier
- // of the Address.
+ // NetworkTier: This signifies the networking tier used for configuring this
+ // load balancer and can only take the following values: PREMIUM, STANDARD. For
+ // regional ForwardingRule, the valid values are PREMIUM and STANDARD. For
+ // GlobalForwardingRule, the valid value is PREMIUM. If this field is not
+ // specified, it is assumed to be PREMIUM. If IPAddress is specified, this
+ // value must be equal to the networkTier of the Address.
//
// Possible values:
// "FIXED_STANDARD" - Public internet quality with fixed bandwidth.
- // "PREMIUM" - High quality, Google-grade network tier, support for
- // all networking products.
- // "STANDARD" - Public internet quality, only limited support for
- // other networking products.
- // "STANDARD_OVERRIDES_FIXED_STANDARD" - (Output only) Temporary tier
- // for FIXED_STANDARD when fixed standard tier is expired or not
- // configured.
+ // "PREMIUM" - High quality, Google-grade network tier, support for all
+ // networking products.
+ // "STANDARD" - Public internet quality, only limited support for other
+ // networking products.
+ // "STANDARD_OVERRIDES_FIXED_STANDARD" - (Output only) Temporary tier for
+ // FIXED_STANDARD when fixed standard tier is expired or not configured.
NetworkTier string `json:"networkTier,omitempty"`
-
- // NoAutomateDnsZone: This is used in PSC consumer ForwardingRule to
- // control whether it should try to auto-generate a DNS zone or not.
- // Non-PSC forwarding rules do not use this field. Once set, this field
- // is not mutable.
+ // NoAutomateDnsZone: This is used in PSC consumer ForwardingRule to control
+ // whether it should try to auto-generate a DNS zone or not. Non-PSC forwarding
+ // rules do not use this field. Once set, this field is not mutable.
NoAutomateDnsZone bool `json:"noAutomateDnsZone,omitempty"`
-
- // PortRange: The ports, portRange, and allPorts fields are mutually
- // exclusive. Only packets addressed to ports in the specified range
- // will be forwarded to the backends configured with this forwarding
- // rule. The portRange field has the following limitations: - It
- // requires that the forwarding rule IPProtocol be TCP, UDP, or SCTP,
- // and - It's applicable only to the following products: external
- // passthrough Network Load Balancers, internal and external proxy
- // Network Load Balancers, internal and external Application Load
- // Balancers, external protocol forwarding, and Classic VPN. - Some
- // products have restrictions on what ports can be used. See port
- // specifications for details. For external forwarding rules, two or
- // more forwarding rules cannot use the same [IPAddress, IPProtocol]
- // pair, and cannot have overlapping portRanges. For internal forwarding
- // rules within the same VPC network, two or more forwarding rules
- // cannot use the same [IPAddress, IPProtocol] pair, and cannot have
- // overlapping portRanges. @pattern: \\d+(?:-\\d+)?
+ // PortRange: The ports, portRange, and allPorts fields are mutually exclusive.
+ // Only packets addressed to ports in the specified range will be forwarded to
+ // the backends configured with this forwarding rule. The portRange field has
+ // the following limitations: - It requires that the forwarding rule IPProtocol
+ // be TCP, UDP, or SCTP, and - It's applicable only to the following products:
+ // external passthrough Network Load Balancers, internal and external proxy
+ // Network Load Balancers, internal and external Application Load Balancers,
+ // external protocol forwarding, and Classic VPN. - Some products have
+ // restrictions on what ports can be used. See port specifications for details.
+ // For external forwarding rules, two or more forwarding rules cannot use the
+ // same [IPAddress, IPProtocol] pair, and cannot have overlapping portRanges.
+ // For internal forwarding rules within the same VPC network, two or more
+ // forwarding rules cannot use the same [IPAddress, IPProtocol] pair, and
+ // cannot have overlapping portRanges. @pattern: \\d+(?:-\\d+)?
PortRange string `json:"portRange,omitempty"`
-
- // Ports: The ports, portRange, and allPorts fields are mutually
- // exclusive. Only packets addressed to ports in the specified range
- // will be forwarded to the backends configured with this forwarding
- // rule. The ports field has the following limitations: - It requires
- // that the forwarding rule IPProtocol be TCP, UDP, or SCTP, and - It's
- // applicable only to the following products: internal passthrough
- // Network Load Balancers, backend service-based external passthrough
- // Network Load Balancers, and internal protocol forwarding. - You can
- // specify a list of up to five ports by number, separated by commas.
- // The ports can be contiguous or discontiguous. For external forwarding
- // rules, two or more forwarding rules cannot use the same [IPAddress,
- // IPProtocol] pair if they share at least one port number. For internal
- // forwarding rules within the same VPC network, two or more forwarding
- // rules cannot use the same [IPAddress, IPProtocol] pair if they share
- // at least one port number. @pattern: \\d+(?:-\\d+)?
+ // Ports: The ports, portRange, and allPorts fields are mutually exclusive.
+ // Only packets addressed to ports in the specified range will be forwarded to
+ // the backends configured with this forwarding rule. The ports field has the
+ // following limitations: - It requires that the forwarding rule IPProtocol be
+ // TCP, UDP, or SCTP, and - It's applicable only to the following products:
+ // internal passthrough Network Load Balancers, backend service-based external
+ // passthrough Network Load Balancers, and internal protocol forwarding. - You
+ // can specify a list of up to five ports by number, separated by commas. The
+ // ports can be contiguous or discontiguous. For external forwarding rules, two
+ // or more forwarding rules cannot use the same [IPAddress, IPProtocol] pair if
+ // they share at least one port number. For internal forwarding rules within
+ // the same VPC network, two or more forwarding rules cannot use the same
+ // [IPAddress, IPProtocol] pair if they share at least one port number.
+ // @pattern: \\d+(?:-\\d+)?
Ports []string `json:"ports,omitempty"`
-
- // PscConnectionId: [Output Only] The PSC connection id of the PSC
- // forwarding rule.
+ // PscConnectionId: [Output Only] The PSC connection id of the PSC forwarding
+ // rule.
PscConnectionId uint64 `json:"pscConnectionId,omitempty,string"`
-
// Possible values:
// "ACCEPTED" - The connection has been accepted by the producer.
- // "CLOSED" - The connection has been closed by the producer and will
- // not serve traffic going forward.
- // "NEEDS_ATTENTION" - The connection has been accepted by the
- // producer, but the producer needs to take further action before the
- // forwarding rule can serve traffic.
+ // "CLOSED" - The connection has been closed by the producer and will not
+ // serve traffic going forward.
+ // "NEEDS_ATTENTION" - The connection has been accepted by the producer, but
+ // the producer needs to take further action before the forwarding rule can
+ // serve traffic.
// "PENDING" - The connection is pending acceptance by the producer.
// "REJECTED" - The connection has been rejected by the producer.
// "STATUS_UNSPECIFIED"
PscConnectionStatus string `json:"pscConnectionStatus,omitempty"`
-
- // Region: [Output Only] URL of the region where the regional forwarding
- // rule resides. This field is not applicable to global forwarding
- // rules. You must specify this field as part of the HTTP request URL.
- // It is not settable as a field in the request body.
+ // Region: [Output Only] URL of the region where the regional forwarding rule
+ // resides. This field is not applicable to global forwarding rules. You must
+ // specify this field as part of the HTTP request URL. It is not settable as a
+ // field in the request body.
Region string `json:"region,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // ServiceDirectoryRegistrations: Service Directory resources to
- // register this forwarding rule with. Currently, only supports a single
- // Service Directory resource.
+ // ServiceDirectoryRegistrations: Service Directory resources to register this
+ // forwarding rule with. Currently, only supports a single Service Directory
+ // resource.
ServiceDirectoryRegistrations []*ForwardingRuleServiceDirectoryRegistration `json:"serviceDirectoryRegistrations,omitempty"`
-
- // ServiceLabel: An optional prefix to the service name for this
- // forwarding rule. If specified, the prefix is the first label of the
- // fully qualified service name. The label must be 1-63 characters long,
- // and comply with RFC1035. Specifically, the label must be 1-63
- // characters long and match the regular expression
- // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
- // a lowercase letter, and all following characters must be a dash,
- // lowercase letter, or digit, except the last character, which cannot
- // be a dash. This field is only used for internal load balancing.
+ // ServiceLabel: An optional prefix to the service name for this forwarding
+ // rule. If specified, the prefix is the first label of the fully qualified
+ // service name. The label must be 1-63 characters long, and comply with
+ // RFC1035. Specifically, the label must be 1-63 characters long and match the
+ // regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first
+ // character must be a lowercase letter, and all following characters must be a
+ // dash, lowercase letter, or digit, except the last character, which cannot be
+ // a dash. This field is only used for internal load balancing.
ServiceLabel string `json:"serviceLabel,omitempty"`
-
- // ServiceName: [Output Only] The internal fully qualified service name
- // for this forwarding rule. This field is only used for internal load
- // balancing.
+ // ServiceName: [Output Only] The internal fully qualified service name for
+ // this forwarding rule. This field is only used for internal load balancing.
ServiceName string `json:"serviceName,omitempty"`
-
- // SourceIpRanges: If not empty, this forwarding rule will only forward
- // the traffic when the source IP address matches one of the IP
- // addresses or CIDR ranges set here. Note that a forwarding rule can
- // only have up to 64 source IP ranges, and this field can only be used
- // with a regional forwarding rule whose scheme is EXTERNAL. Each
- // source_ip_range entry should be either an IP address (for example,
- // 1.2.3.4) or a CIDR range (for example, 1.2.3.0/24).
+ // SourceIpRanges: If not empty, this forwarding rule will only forward the
+ // traffic when the source IP address matches one of the IP addresses or CIDR
+ // ranges set here. Note that a forwarding rule can only have up to 64 source
+ // IP ranges, and this field can only be used with a regional forwarding rule
+ // whose scheme is EXTERNAL. Each source_ip_range entry should be either an IP
+ // address (for example, 1.2.3.4) or a CIDR range (for example, 1.2.3.0/24).
SourceIpRanges []string `json:"sourceIpRanges,omitempty"`
-
- // Subnetwork: This field identifies the subnetwork that the load
- // balanced IP should belong to for this forwarding rule, used with
- // internal load balancers and external passthrough Network Load
- // Balancers with IPv6. If the network specified is in auto subnet mode,
- // this field is optional. However, a subnetwork must be specified if
- // the network is in custom subnet mode or when creating external
- // forwarding rule with IPv6.
+ // Subnetwork: This field identifies the subnetwork that the load balanced IP
+ // should belong to for this forwarding rule, used with internal load balancers
+ // and external passthrough Network Load Balancers with IPv6. If the network
+ // specified is in auto subnet mode, this field is optional. However, a
+ // subnetwork must be specified if the network is in custom subnet mode or when
+ // creating external forwarding rule with IPv6.
Subnetwork string `json:"subnetwork,omitempty"`
-
- // Target: The URL of the target resource to receive the matched
- // traffic. For regional forwarding rules, this target must be in the
- // same region as the forwarding rule. For global forwarding rules, this
- // target must be a global load balancing resource. The forwarded
- // traffic must be of a type appropriate to the target object. - For
- // load balancers, see the "Target" column in Port specifications
+ // Target: The URL of the target resource to receive the matched traffic. For
+ // regional forwarding rules, this target must be in the same region as the
+ // forwarding rule. For global forwarding rules, this target must be a global
+ // load balancing resource. The forwarded traffic must be of a type appropriate
+ // to the target object. - For load balancers, see the "Target" column in Port
+ // specifications
// (https://cloud.google.com/load-balancing/docs/forwarding-rule-concepts#ip_address_specifications).
- // - For Private Service Connect forwarding rules that forward traffic
- // to Google APIs, provide the name of a supported Google API bundle: -
- // vpc-sc - APIs that support VPC Service Controls. - all-apis - All
- // supported Google APIs. - For Private Service Connect forwarding rules
- // that forward traffic to managed services, the target must be a
- // service attachment. The target is not mutable once set as a service
- // attachment.
+ // - For Private Service Connect forwarding rules that forward traffic to
+ // Google APIs, provide the name of a supported Google API bundle: - vpc-sc -
+ // APIs that support VPC Service Controls. - all-apis - All supported Google
+ // APIs. - For Private Service Connect forwarding rules that forward traffic to
+ // managed services, the target must be a service attachment. The target is not
+ // mutable once set as a service attachment.
Target string `json:"target,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
// ForceSendFields is a list of field names (e.g. "IPAddress") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "IPAddress") 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. "IPAddress") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ForwardingRule) MarshalJSON() ([]byte, error) {
+func (s ForwardingRule) MarshalJSON() ([]byte, error) {
type NoMethod ForwardingRule
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ForwardingRuleAggregatedList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of ForwardingRulesScopedList resources.
Items map[string]ForwardingRulesScopedList `json:"items,omitempty"`
-
// Kind: [Output Only] Type of resource. Always
// compute#forwardingRuleAggregatedList for lists of forwarding rules.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Unreachables: [Output Only] Unreachable resources.
Unreachables []string `json:"unreachables,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *ForwardingRuleAggregatedListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ForwardingRuleAggregatedList) MarshalJSON() ([]byte, error) {
+func (s ForwardingRuleAggregatedList) MarshalJSON() ([]byte, error) {
type NoMethod ForwardingRuleAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// ForwardingRuleAggregatedListWarning: [Output Only] Informational
-// warning message.
+// ForwardingRuleAggregatedListWarning: [Output Only] Informational warning
+// message.
type ForwardingRuleAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*ForwardingRuleAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ForwardingRuleAggregatedListWarning) MarshalJSON() ([]byte, error) {
+func (s ForwardingRuleAggregatedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod ForwardingRuleAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ForwardingRuleAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ForwardingRuleAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+func (s ForwardingRuleAggregatedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod ForwardingRuleAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// ForwardingRuleList: Contains a list of ForwardingRule resources.
type ForwardingRuleList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of ForwardingRule resources.
Items []*ForwardingRule `json:"items,omitempty"`
-
// Kind: Type of resource.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *ForwardingRuleListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ForwardingRuleList) MarshalJSON() ([]byte, error) {
+func (s ForwardingRuleList) MarshalJSON() ([]byte, error) {
type NoMethod ForwardingRuleList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// ForwardingRuleListWarning: [Output Only] Informational warning
-// message.
+// ForwardingRuleListWarning: [Output Only] Informational warning message.
type ForwardingRuleListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*ForwardingRuleListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ForwardingRuleListWarning) MarshalJSON() ([]byte, error) {
+func (s ForwardingRuleListWarning) MarshalJSON() ([]byte, error) {
type NoMethod ForwardingRuleListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ForwardingRuleListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ForwardingRuleListWarningData) MarshalJSON() ([]byte, error) {
+func (s ForwardingRuleListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod ForwardingRuleListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ForwardingRuleReference struct {
ForwardingRule string `json:"forwardingRule,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "ForwardingRule") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "ForwardingRule") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "ForwardingRule") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ForwardingRuleReference) MarshalJSON() ([]byte, error) {
+func (s ForwardingRuleReference) MarshalJSON() ([]byte, error) {
type NoMethod ForwardingRuleReference
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// ForwardingRuleServiceDirectoryRegistration: Describes the
-// auto-registration of the forwarding rule to Service Directory. The
-// region and project of the Service Directory resource generated from
-// this registration will be the same as this forwarding rule.
+// ForwardingRuleServiceDirectoryRegistration: Describes the auto-registration
+// of the forwarding rule to Service Directory. The region and project of the
+// Service Directory resource generated from this registration will be the same
+// as this forwarding rule.
type ForwardingRuleServiceDirectoryRegistration struct {
- // Namespace: Service Directory namespace to register the forwarding
- // rule under.
- Namespace string `json:"namespace,omitempty"`
-
- // Service: Service Directory service to register the forwarding rule
+ // Namespace: Service Directory namespace to register the forwarding rule
// under.
+ Namespace string `json:"namespace,omitempty"`
+ // Service: Service Directory service to register the forwarding rule under.
Service string `json:"service,omitempty"`
-
- // ServiceDirectoryRegion: [Optional] Service Directory region to
- // register this global forwarding rule under. Default to "us-central1".
- // Only used for PSC for Google APIs. All PSC for Google APIs forwarding
- // rules on the same network should use the same Service Directory
- // region.
+ // ServiceDirectoryRegion: [Optional] Service Directory region to register this
+ // global forwarding rule under. Default to "us-central1". Only used for PSC
+ // for Google APIs. All PSC for Google APIs forwarding rules on the same
+ // network should use the same Service Directory region.
ServiceDirectoryRegion string `json:"serviceDirectoryRegion,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Namespace") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Namespace") 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. "Namespace") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ForwardingRuleServiceDirectoryRegistration) MarshalJSON() ([]byte, error) {
+func (s ForwardingRuleServiceDirectoryRegistration) MarshalJSON() ([]byte, error) {
type NoMethod ForwardingRuleServiceDirectoryRegistration
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ForwardingRulesScopedList struct {
// ForwardingRules: A list of forwarding rules contained in this scope.
ForwardingRules []*ForwardingRule `json:"forwardingRules,omitempty"`
-
- // Warning: Informational warning which replaces the list of forwarding
- // rules when the list is empty.
+ // Warning: Informational warning which replaces the list of forwarding rules
+ // when the list is empty.
Warning *ForwardingRulesScopedListWarning `json:"warning,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "ForwardingRules") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "ForwardingRules") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "ForwardingRules") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ForwardingRulesScopedList) MarshalJSON() ([]byte, error) {
+func (s ForwardingRulesScopedList) MarshalJSON() ([]byte, error) {
type NoMethod ForwardingRulesScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// ForwardingRulesScopedListWarning: Informational warning which
-// replaces the list of forwarding rules when the list is empty.
+// ForwardingRulesScopedListWarning: Informational warning which replaces the
+// list of forwarding rules when the list is empty.
type ForwardingRulesScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*ForwardingRulesScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ForwardingRulesScopedListWarning) MarshalJSON() ([]byte, error) {
+func (s ForwardingRulesScopedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod ForwardingRulesScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ForwardingRulesScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ForwardingRulesScopedListWarningData) MarshalJSON() ([]byte, error) {
+func (s ForwardingRulesScopedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod ForwardingRulesScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type GRPCHealthCheck struct {
- // GrpcServiceName: The gRPC service name for the health check. This
- // field is optional. The value of grpc_service_name has the following
- // meanings by convention: - Empty service_name means the overall status
- // of all services at the backend. - Non-empty service_name means the
- // health of that gRPC service, as defined by the owner of the service.
- // The grpc_service_name can only be ASCII.
+ // GrpcServiceName: The gRPC service name for the health check. This field is
+ // optional. The value of grpc_service_name has the following meanings by
+ // convention: - Empty service_name means the overall status of all services at
+ // the backend. - Non-empty service_name means the health of that gRPC service,
+ // as defined by the owner of the service. The grpc_service_name can only be
+ // ASCII.
GrpcServiceName string `json:"grpcServiceName,omitempty"`
-
- // Port: The TCP port number to which the health check prober sends
- // packets. Valid values are 1 through 65535.
+ // Port: The TCP port number to which the health check prober sends packets.
+ // Valid values are 1 through 65535.
Port int64 `json:"port,omitempty"`
-
// PortName: Not supported.
PortName string `json:"portName,omitempty"`
-
- // PortSpecification: Specifies how a port is selected for health
- // checking. Can be one of the following values: USE_FIXED_PORT:
- // Specifies a port number explicitly using the port field in the health
- // check. Supported by backend services for passthrough load balancers
- // and backend services for proxy load balancers. Not supported by
- // target pools. The health check supports all backends supported by the
- // backend service provided the backend can be health checked. For
- // example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT network
- // endpoint groups, and instance group backends. USE_NAMED_PORT: Not
- // supported. USE_SERVING_PORT: Provides an indirect method of
- // specifying the health check port by referring to the backend service.
- // Only supported by backend services for proxy load balancers. Not
- // supported by target pools. Not supported by backend services for
- // passthrough load balancers. Supports all backends that can be health
- // checked; for example, GCE_VM_IP_PORT network endpoint groups and
- // instance group backends. For GCE_VM_IP_PORT network endpoint group
- // backends, the health check uses the port number specified for each
- // endpoint in the network endpoint group. For instance group backends,
- // the health check uses the port number determined by looking up the
- // backend service's named port in the instance group's list of named
- // ports.
- //
- // Possible values:
- // "USE_FIXED_PORT" - The port number in the health check's port is
- // used for health checking. Applies to network endpoint group and
- // instance group backends.
+ // PortSpecification: Specifies how a port is selected for health checking. Can
+ // be one of the following values: USE_FIXED_PORT: Specifies a port number
+ // explicitly using the port field in the health check. Supported by backend
+ // services for passthrough load balancers and backend services for proxy load
+ // balancers. Not supported by target pools. The health check supports all
+ // backends supported by the backend service provided the backend can be health
+ // checked. For example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT
+ // network endpoint groups, and instance group backends. USE_NAMED_PORT: Not
+ // supported. USE_SERVING_PORT: Provides an indirect method of specifying the
+ // health check port by referring to the backend service. Only supported by
+ // backend services for proxy load balancers. Not supported by target pools.
+ // Not supported by backend services for passthrough load balancers. Supports
+ // all backends that can be health checked; for example, GCE_VM_IP_PORT network
+ // endpoint groups and instance group backends. For GCE_VM_IP_PORT network
+ // endpoint group backends, the health check uses the port number specified for
+ // each endpoint in the network endpoint group. For instance group backends,
+ // the health check uses the port number determined by looking up the backend
+ // service's named port in the instance group's list of named ports.
+ //
+ // Possible values:
+ // "USE_FIXED_PORT" - The port number in the health check's port is used for
+ // health checking. Applies to network endpoint group and instance group
+ // backends.
// "USE_NAMED_PORT" - Not supported.
- // "USE_SERVING_PORT" - For network endpoint group backends, the
- // health check uses the port number specified on each endpoint in the
- // network endpoint group. For instance group backends, the health check
- // uses the port number specified for the backend service's named port
- // defined in the instance group's named ports.
+ // "USE_SERVING_PORT" - For network endpoint group backends, the health check
+ // uses the port number specified on each endpoint in the network endpoint
+ // group. For instance group backends, the health check uses the port number
+ // specified for the backend service's named port defined in the instance
+ // group's named ports.
PortSpecification string `json:"portSpecification,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "GrpcServiceName") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "GrpcServiceName") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "GrpcServiceName") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *GRPCHealthCheck) MarshalJSON() ([]byte, error) {
+func (s GRPCHealthCheck) MarshalJSON() ([]byte, error) {
type NoMethod GRPCHealthCheck
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type GlobalAddressesMoveRequest struct {
- // Description: An optional destination address description if intended
- // to be different from the source.
+ // Description: An optional destination address description if intended to be
+ // different from the source.
Description string `json:"description,omitempty"`
-
- // DestinationAddress: The URL of the destination address to move to.
- // This can be a full or partial URL. For example, the following are all
- // valid URLs to a address: -
- // https://www.googleapis.com/compute/v1/projects/project
- // /global/addresses/address - projects/project/global/addresses/address
- // Note that destination project must be different from the source
- // project. So /global/addresses/address is not valid partial url.
+ // DestinationAddress: The URL of the destination address to move to. This can
+ // be a full or partial URL. For example, the following are all valid URLs to a
+ // address: - https://www.googleapis.com/compute/v1/projects/project
+ // /global/addresses/address - projects/project/global/addresses/address Note
+ // that destination project must be different from the source project. So
+ // /global/addresses/address is not valid partial url.
DestinationAddress string `json:"destinationAddress,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Description") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Description") to include
- // in API requests with the JSON null value. By default, fields with
- // empty values are omitted from API requests. However, any field with
- // an empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields 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. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *GlobalAddressesMoveRequest) MarshalJSON() ([]byte, error) {
+func (s GlobalAddressesMoveRequest) MarshalJSON() ([]byte, error) {
type NoMethod GlobalAddressesMoveRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type GlobalNetworkEndpointGroupsAttachEndpointsRequest struct {
// NetworkEndpoints: The list of network endpoints to be attached.
NetworkEndpoints []*NetworkEndpoint `json:"networkEndpoints,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "NetworkEndpoints") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "NetworkEndpoints") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "NetworkEndpoints") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *GlobalNetworkEndpointGroupsAttachEndpointsRequest) MarshalJSON() ([]byte, error) {
+func (s GlobalNetworkEndpointGroupsAttachEndpointsRequest) MarshalJSON() ([]byte, error) {
type NoMethod GlobalNetworkEndpointGroupsAttachEndpointsRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type GlobalNetworkEndpointGroupsDetachEndpointsRequest struct {
// NetworkEndpoints: The list of network endpoints to be detached.
NetworkEndpoints []*NetworkEndpoint `json:"networkEndpoints,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "NetworkEndpoints") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "NetworkEndpoints") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "NetworkEndpoints") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *GlobalNetworkEndpointGroupsDetachEndpointsRequest) MarshalJSON() ([]byte, error) {
+func (s GlobalNetworkEndpointGroupsDetachEndpointsRequest) MarshalJSON() ([]byte, error) {
type NoMethod GlobalNetworkEndpointGroupsDetachEndpointsRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type GlobalOrganizationSetPolicyRequest struct {
// Bindings: Flatten Policy to create a backward compatible wire-format.
// Deprecated. Use 'policy' to specify bindings.
Bindings []*Binding `json:"bindings,omitempty"`
-
// Etag: Flatten Policy to create a backward compatible wire-format.
// Deprecated. Use 'policy' to specify the etag.
Etag string `json:"etag,omitempty"`
-
- // Policy: REQUIRED: The complete policy to be applied to the
- // 'resource'. The size of the policy is limited to a few 10s of KB. An
- // empty policy is in general a valid policy but certain services (like
- // Projects) might reject them.
+ // Policy: REQUIRED: The complete policy to be applied to the 'resource'. The
+ // size of the policy is limited to a few 10s of KB. An empty policy is in
+ // general a valid policy but certain services (like Projects) might reject
+ // them.
Policy *Policy `json:"policy,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Bindings") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Bindings") 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. "Bindings") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *GlobalOrganizationSetPolicyRequest) MarshalJSON() ([]byte, error) {
+func (s GlobalOrganizationSetPolicyRequest) MarshalJSON() ([]byte, error) {
type NoMethod GlobalOrganizationSetPolicyRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type GlobalSetLabelsRequest struct {
- // LabelFingerprint: The fingerprint of the previous set of labels for
- // this resource, used to detect conflicts. The fingerprint is initially
- // generated by Compute Engine and changes after every request to modify
- // or update labels. You must always provide an up-to-date fingerprint
- // hash when updating or changing labels, otherwise the request will
- // fail with error 412 conditionNotMet. Make a get() request to the
- // resource to get the latest fingerprint.
+ // LabelFingerprint: The fingerprint of the previous set of labels for this
+ // resource, used to detect conflicts. The fingerprint is initially generated
+ // by Compute Engine and changes after every request to modify or update
+ // labels. You must always provide an up-to-date fingerprint hash when updating
+ // or changing labels, otherwise the request will fail with error 412
+ // conditionNotMet. Make a get() request to the resource to get the latest
+ // fingerprint.
LabelFingerprint string `json:"labelFingerprint,omitempty"`
-
- // Labels: A list of labels to apply for this resource. Each label must
- // comply with the requirements for labels. For example,
- // "webserver-frontend": "images". A label value can also be empty (e.g.
- // "my-label": "").
+ // Labels: A list of labels to apply for this resource. Each label must comply
+ // with the requirements for labels. For example, "webserver-frontend":
+ // "images". A label value can also be empty (e.g. "my-label": "").
Labels map[string]string `json:"labels,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "LabelFingerprint") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "LabelFingerprint") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *GlobalSetLabelsRequest) MarshalJSON() ([]byte, error) {
+func (s GlobalSetLabelsRequest) MarshalJSON() ([]byte, error) {
type NoMethod GlobalSetLabelsRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type GlobalSetPolicyRequest struct {
// Bindings: Flatten Policy to create a backward compatible wire-format.
// Deprecated. Use 'policy' to specify bindings.
Bindings []*Binding `json:"bindings,omitempty"`
-
// Etag: Flatten Policy to create a backward compatible wire-format.
// Deprecated. Use 'policy' to specify the etag.
Etag string `json:"etag,omitempty"`
-
- // Policy: REQUIRED: The complete policy to be applied to the
- // 'resource'. The size of the policy is limited to a few 10s of KB. An
- // empty policy is in general a valid policy but certain services (like
- // Projects) might reject them.
+ // Policy: REQUIRED: The complete policy to be applied to the 'resource'. The
+ // size of the policy is limited to a few 10s of KB. An empty policy is in
+ // general a valid policy but certain services (like Projects) might reject
+ // them.
Policy *Policy `json:"policy,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Bindings") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Bindings") 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. "Bindings") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *GlobalSetPolicyRequest) MarshalJSON() ([]byte, error) {
+func (s GlobalSetPolicyRequest) MarshalJSON() ([]byte, error) {
type NoMethod GlobalSetPolicyRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// GuestAttributes: A guest attributes entry.
type GuestAttributes struct {
- // Kind: [Output Only] Type of the resource. Always
- // compute#guestAttributes for guest attributes entry.
+ // Kind: [Output Only] Type of the resource. Always compute#guestAttributes for
+ // guest attributes entry.
Kind string `json:"kind,omitempty"`
-
- // QueryPath: The path to be queried. This can be the default namespace
- // ('') or a nested namespace ('\/') or a specified key ('\/\').
+ // QueryPath: The path to be queried. This can be the default namespace ('') or
+ // a nested namespace ('\/') or a specified key ('\/\').
QueryPath string `json:"queryPath,omitempty"`
-
// QueryValue: [Output Only] The value of the requested queried path.
QueryValue *GuestAttributesValue `json:"queryValue,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// VariableKey: The key to search for.
VariableKey string `json:"variableKey,omitempty"`
-
// VariableValue: [Output Only] The value found for the requested key.
VariableValue string `json:"variableValue,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Kind") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Kind") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
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 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. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *GuestAttributes) MarshalJSON() ([]byte, error) {
+func (s GuestAttributes) MarshalJSON() ([]byte, error) {
type NoMethod GuestAttributes
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// GuestAttributesEntry: A guest attributes namespace/key/value entry.
type GuestAttributesEntry struct {
// Key: Key for the guest attribute entry.
Key string `json:"key,omitempty"`
-
// Namespace: Namespace for the guest attribute entry.
Namespace string `json:"namespace,omitempty"`
-
// Value: Value for the guest attribute entry.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *GuestAttributesEntry) MarshalJSON() ([]byte, error) {
+func (s GuestAttributesEntry) MarshalJSON() ([]byte, error) {
type NoMethod GuestAttributesEntry
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// GuestAttributesValue: Array of guest attribute namespace/key/value
-// tuples.
+// GuestAttributesValue: Array of guest attribute namespace/key/value tuples.
type GuestAttributesValue struct {
Items []*GuestAttributesEntry `json:"items,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Items") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Items") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Items") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *GuestAttributesValue) MarshalJSON() ([]byte, error) {
+func (s GuestAttributesValue) MarshalJSON() ([]byte, error) {
type NoMethod GuestAttributesValue
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// GuestOsFeature: Guest OS features.
type GuestOsFeature struct {
- // Type: The ID of a supported feature. To add multiple values, use
- // commas to separate values. Set to one or more of the following
- // values: - VIRTIO_SCSI_MULTIQUEUE - WINDOWS - MULTI_IP_SUBNET -
- // UEFI_COMPATIBLE - GVNIC - SEV_CAPABLE - SUSPEND_RESUME_COMPATIBLE -
- // SEV_LIVE_MIGRATABLE - SEV_SNP_CAPABLE - TDX_CAPABLE - IDPF For more
- // information, see Enabling guest operating system features.
+ // Type: The ID of a supported feature. To add multiple values, use commas to
+ // separate values. Set to one or more of the following values: -
+ // VIRTIO_SCSI_MULTIQUEUE - WINDOWS - MULTI_IP_SUBNET - UEFI_COMPATIBLE - GVNIC
+ // - SEV_CAPABLE - SUSPEND_RESUME_COMPATIBLE - SEV_LIVE_MIGRATABLE_V2 -
+ // SEV_SNP_CAPABLE - TDX_CAPABLE - IDPF For more information, see Enabling
+ // guest operating system features.
//
// Possible values:
// "FEATURE_TYPE_UNSPECIFIED"
@@ -14911,393 +12512,326 @@ type GuestOsFeature struct {
// "SEV_LIVE_MIGRATABLE"
// "SEV_LIVE_MIGRATABLE_V2"
// "SEV_SNP_CAPABLE"
+ // "TDX_CAPABLE"
// "UEFI_COMPATIBLE"
// "VIRTIO_SCSI_MULTIQUEUE"
// "WINDOWS"
Type string `json:"type,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Type") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Type") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Type") 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. "Type") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *GuestOsFeature) MarshalJSON() ([]byte, error) {
+func (s GuestOsFeature) MarshalJSON() ([]byte, error) {
type NoMethod GuestOsFeature
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type HTTP2HealthCheck struct {
- // Host: The value of the host header in the HTTP/2 health check
- // request. If left empty (default value), the host header is set to the
- // destination IP address to which health check packets are sent. The
- // destination IP address depends on the type of load balancer. For
- // details, see:
+ // Host: The value of the host header in the HTTP/2 health check request. If
+ // left empty (default value), the host header is set to the destination IP
+ // address to which health check packets are sent. The destination IP address
+ // depends on the type of load balancer. For details, see:
// https://cloud.google.com/load-balancing/docs/health-check-concepts#hc-packet-dest
Host string `json:"host,omitempty"`
-
- // Port: The TCP port number to which the health check prober sends
- // packets. The default value is 443. Valid values are 1 through 65535.
+ // Port: The TCP port number to which the health check prober sends packets.
+ // The default value is 443. Valid values are 1 through 65535.
Port int64 `json:"port,omitempty"`
-
// PortName: Not supported.
PortName string `json:"portName,omitempty"`
-
- // PortSpecification: Specifies how a port is selected for health
- // checking. Can be one of the following values: USE_FIXED_PORT:
- // Specifies a port number explicitly using the port field in the health
- // check. Supported by backend services for passthrough load balancers
- // and backend services for proxy load balancers. Not supported by
- // target pools. The health check supports all backends supported by the
- // backend service provided the backend can be health checked. For
- // example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT network
- // endpoint groups, and instance group backends. USE_NAMED_PORT: Not
- // supported. USE_SERVING_PORT: Provides an indirect method of
- // specifying the health check port by referring to the backend service.
- // Only supported by backend services for proxy load balancers. Not
- // supported by target pools. Not supported by backend services for
- // passthrough load balancers. Supports all backends that can be health
- // checked; for example, GCE_VM_IP_PORT network endpoint groups and
- // instance group backends. For GCE_VM_IP_PORT network endpoint group
- // backends, the health check uses the port number specified for each
- // endpoint in the network endpoint group. For instance group backends,
- // the health check uses the port number determined by looking up the
- // backend service's named port in the instance group's list of named
- // ports.
- //
- // Possible values:
- // "USE_FIXED_PORT" - The port number in the health check's port is
- // used for health checking. Applies to network endpoint group and
- // instance group backends.
+ // PortSpecification: Specifies how a port is selected for health checking. Can
+ // be one of the following values: USE_FIXED_PORT: Specifies a port number
+ // explicitly using the port field in the health check. Supported by backend
+ // services for passthrough load balancers and backend services for proxy load
+ // balancers. Not supported by target pools. The health check supports all
+ // backends supported by the backend service provided the backend can be health
+ // checked. For example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT
+ // network endpoint groups, and instance group backends. USE_NAMED_PORT: Not
+ // supported. USE_SERVING_PORT: Provides an indirect method of specifying the
+ // health check port by referring to the backend service. Only supported by
+ // backend services for proxy load balancers. Not supported by target pools.
+ // Not supported by backend services for passthrough load balancers. Supports
+ // all backends that can be health checked; for example, GCE_VM_IP_PORT network
+ // endpoint groups and instance group backends. For GCE_VM_IP_PORT network
+ // endpoint group backends, the health check uses the port number specified for
+ // each endpoint in the network endpoint group. For instance group backends,
+ // the health check uses the port number determined by looking up the backend
+ // service's named port in the instance group's list of named ports.
+ //
+ // Possible values:
+ // "USE_FIXED_PORT" - The port number in the health check's port is used for
+ // health checking. Applies to network endpoint group and instance group
+ // backends.
// "USE_NAMED_PORT" - Not supported.
- // "USE_SERVING_PORT" - For network endpoint group backends, the
- // health check uses the port number specified on each endpoint in the
- // network endpoint group. For instance group backends, the health check
- // uses the port number specified for the backend service's named port
- // defined in the instance group's named ports.
+ // "USE_SERVING_PORT" - For network endpoint group backends, the health check
+ // uses the port number specified on each endpoint in the network endpoint
+ // group. For instance group backends, the health check uses the port number
+ // specified for the backend service's named port defined in the instance
+ // group's named ports.
PortSpecification string `json:"portSpecification,omitempty"`
-
- // ProxyHeader: Specifies the type of proxy header to append before
- // sending data to the backend, either NONE or PROXY_V1. The default is
- // NONE.
+ // ProxyHeader: Specifies the type of proxy header to append before sending
+ // data to the backend, either NONE or PROXY_V1. The default is NONE.
//
// Possible values:
// "NONE"
// "PROXY_V1"
ProxyHeader string `json:"proxyHeader,omitempty"`
-
// RequestPath: The request path of the HTTP/2 health check request. The
- // default value is /.
+ // default value is /. Must comply with RFC3986.
RequestPath string `json:"requestPath,omitempty"`
-
- // Response: Creates a content-based HTTP/2 health check. In addition to
- // the required HTTP 200 (OK) status code, you can configure the health
- // check to pass only when the backend sends this specific ASCII
- // response string within the first 1024 bytes of the HTTP response
- // body. For details, see:
+ // Response: Creates a content-based HTTP/2 health check. In addition to the
+ // required HTTP 200 (OK) status code, you can configure the health check to
+ // pass only when the backend sends this specific ASCII response string within
+ // the first 1024 bytes of the HTTP response body. For details, see:
// https://cloud.google.com/load-balancing/docs/health-check-concepts#criteria-protocol-http
Response string `json:"response,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Host") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Host") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Host") 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. "Host") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HTTP2HealthCheck) MarshalJSON() ([]byte, error) {
+func (s HTTP2HealthCheck) MarshalJSON() ([]byte, error) {
type NoMethod HTTP2HealthCheck
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type HTTPHealthCheck struct {
- // Host: The value of the host header in the HTTP health check request.
- // If left empty (default value), the host header is set to the
- // destination IP address to which health check packets are sent. The
- // destination IP address depends on the type of load balancer. For
- // details, see:
+ // Host: The value of the host header in the HTTP health check request. If left
+ // empty (default value), the host header is set to the destination IP address
+ // to which health check packets are sent. The destination IP address depends
+ // on the type of load balancer. For details, see:
// https://cloud.google.com/load-balancing/docs/health-check-concepts#hc-packet-dest
Host string `json:"host,omitempty"`
-
- // Port: The TCP port number to which the health check prober sends
- // packets. The default value is 80. Valid values are 1 through 65535.
+ // Port: The TCP port number to which the health check prober sends packets.
+ // The default value is 80. Valid values are 1 through 65535.
Port int64 `json:"port,omitempty"`
-
// PortName: Not supported.
PortName string `json:"portName,omitempty"`
-
- // PortSpecification: Specifies how a port is selected for health
- // checking. Can be one of the following values: USE_FIXED_PORT:
- // Specifies a port number explicitly using the port field in the health
- // check. Supported by backend services for passthrough load balancers
- // and backend services for proxy load balancers. Also supported in
- // legacy HTTP health checks for target pools. The health check supports
- // all backends supported by the backend service provided the backend
- // can be health checked. For example, GCE_VM_IP network endpoint
- // groups, GCE_VM_IP_PORT network endpoint groups, and instance group
- // backends. USE_NAMED_PORT: Not supported. USE_SERVING_PORT: Provides
- // an indirect method of specifying the health check port by referring
- // to the backend service. Only supported by backend services for proxy
- // load balancers. Not supported by target pools. Not supported by
- // backend services for pass-through load balancers. Supports all
- // backends that can be health checked; for example, GCE_VM_IP_PORT
- // network endpoint groups and instance group backends. For
- // GCE_VM_IP_PORT network endpoint group backends, the health check uses
- // the port number specified for each endpoint in the network endpoint
- // group. For instance group backends, the health check uses the port
- // number determined by looking up the backend service's named port in
- // the instance group's list of named ports.
- //
- // Possible values:
- // "USE_FIXED_PORT" - The port number in the health check's port is
- // used for health checking. Applies to network endpoint group and
- // instance group backends.
+ // PortSpecification: Specifies how a port is selected for health checking. Can
+ // be one of the following values: USE_FIXED_PORT: Specifies a port number
+ // explicitly using the port field in the health check. Supported by backend
+ // services for passthrough load balancers and backend services for proxy load
+ // balancers. Also supported in legacy HTTP health checks for target pools. The
+ // health check supports all backends supported by the backend service provided
+ // the backend can be health checked. For example, GCE_VM_IP network endpoint
+ // groups, GCE_VM_IP_PORT network endpoint groups, and instance group backends.
+ // USE_NAMED_PORT: Not supported. USE_SERVING_PORT: Provides an indirect method
+ // of specifying the health check port by referring to the backend service.
+ // Only supported by backend services for proxy load balancers. Not supported
+ // by target pools. Not supported by backend services for pass-through load
+ // balancers. Supports all backends that can be health checked; for example,
+ // GCE_VM_IP_PORT network endpoint groups and instance group backends. For
+ // GCE_VM_IP_PORT network endpoint group backends, the health check uses the
+ // port number specified for each endpoint in the network endpoint group. For
+ // instance group backends, the health check uses the port number determined by
+ // looking up the backend service's named port in the instance group's list of
+ // named ports.
+ //
+ // Possible values:
+ // "USE_FIXED_PORT" - The port number in the health check's port is used for
+ // health checking. Applies to network endpoint group and instance group
+ // backends.
// "USE_NAMED_PORT" - Not supported.
- // "USE_SERVING_PORT" - For network endpoint group backends, the
- // health check uses the port number specified on each endpoint in the
- // network endpoint group. For instance group backends, the health check
- // uses the port number specified for the backend service's named port
- // defined in the instance group's named ports.
+ // "USE_SERVING_PORT" - For network endpoint group backends, the health check
+ // uses the port number specified on each endpoint in the network endpoint
+ // group. For instance group backends, the health check uses the port number
+ // specified for the backend service's named port defined in the instance
+ // group's named ports.
PortSpecification string `json:"portSpecification,omitempty"`
-
- // ProxyHeader: Specifies the type of proxy header to append before
- // sending data to the backend, either NONE or PROXY_V1. The default is
- // NONE.
+ // ProxyHeader: Specifies the type of proxy header to append before sending
+ // data to the backend, either NONE or PROXY_V1. The default is NONE.
//
// Possible values:
// "NONE"
// "PROXY_V1"
ProxyHeader string `json:"proxyHeader,omitempty"`
-
- // RequestPath: The request path of the HTTP health check request. The
- // default value is /.
+ // RequestPath: The request path of the HTTP health check request. The default
+ // value is /. Must comply with RFC3986.
RequestPath string `json:"requestPath,omitempty"`
-
- // Response: Creates a content-based HTTP health check. In addition to
- // the required HTTP 200 (OK) status code, you can configure the health
- // check to pass only when the backend sends this specific ASCII
- // response string within the first 1024 bytes of the HTTP response
- // body. For details, see:
+ // Response: Creates a content-based HTTP health check. In addition to the
+ // required HTTP 200 (OK) status code, you can configure the health check to
+ // pass only when the backend sends this specific ASCII response string within
+ // the first 1024 bytes of the HTTP response body. For details, see:
// https://cloud.google.com/load-balancing/docs/health-check-concepts#criteria-protocol-http
Response string `json:"response,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Host") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Host") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Host") 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. "Host") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HTTPHealthCheck) MarshalJSON() ([]byte, error) {
+func (s HTTPHealthCheck) MarshalJSON() ([]byte, error) {
type NoMethod HTTPHealthCheck
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type HTTPSHealthCheck struct {
- // Host: The value of the host header in the HTTPS health check request.
- // If left empty (default value), the host header is set to the
- // destination IP address to which health check packets are sent. The
- // destination IP address depends on the type of load balancer. For
- // details, see:
+ // Host: The value of the host header in the HTTPS health check request. If
+ // left empty (default value), the host header is set to the destination IP
+ // address to which health check packets are sent. The destination IP address
+ // depends on the type of load balancer. For details, see:
// https://cloud.google.com/load-balancing/docs/health-check-concepts#hc-packet-dest
Host string `json:"host,omitempty"`
-
- // Port: The TCP port number to which the health check prober sends
- // packets. The default value is 443. Valid values are 1 through 65535.
+ // Port: The TCP port number to which the health check prober sends packets.
+ // The default value is 443. Valid values are 1 through 65535.
Port int64 `json:"port,omitempty"`
-
// PortName: Not supported.
PortName string `json:"portName,omitempty"`
-
- // PortSpecification: Specifies how a port is selected for health
- // checking. Can be one of the following values: USE_FIXED_PORT:
- // Specifies a port number explicitly using the port field in the health
- // check. Supported by backend services for passthrough load balancers
- // and backend services for proxy load balancers. Not supported by
- // target pools. The health check supports all backends supported by the
- // backend service provided the backend can be health checked. For
- // example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT network
- // endpoint groups, and instance group backends. USE_NAMED_PORT: Not
- // supported. USE_SERVING_PORT: Provides an indirect method of
- // specifying the health check port by referring to the backend service.
- // Only supported by backend services for proxy load balancers. Not
- // supported by target pools. Not supported by backend services for
- // passthrough load balancers. Supports all backends that can be health
- // checked; for example, GCE_VM_IP_PORT network endpoint groups and
- // instance group backends. For GCE_VM_IP_PORT network endpoint group
- // backends, the health check uses the port number specified for each
- // endpoint in the network endpoint group. For instance group backends,
- // the health check uses the port number determined by looking up the
- // backend service's named port in the instance group's list of named
- // ports.
- //
- // Possible values:
- // "USE_FIXED_PORT" - The port number in the health check's port is
- // used for health checking. Applies to network endpoint group and
- // instance group backends.
+ // PortSpecification: Specifies how a port is selected for health checking. Can
+ // be one of the following values: USE_FIXED_PORT: Specifies a port number
+ // explicitly using the port field in the health check. Supported by backend
+ // services for passthrough load balancers and backend services for proxy load
+ // balancers. Not supported by target pools. The health check supports all
+ // backends supported by the backend service provided the backend can be health
+ // checked. For example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT
+ // network endpoint groups, and instance group backends. USE_NAMED_PORT: Not
+ // supported. USE_SERVING_PORT: Provides an indirect method of specifying the
+ // health check port by referring to the backend service. Only supported by
+ // backend services for proxy load balancers. Not supported by target pools.
+ // Not supported by backend services for passthrough load balancers. Supports
+ // all backends that can be health checked; for example, GCE_VM_IP_PORT network
+ // endpoint groups and instance group backends. For GCE_VM_IP_PORT network
+ // endpoint group backends, the health check uses the port number specified for
+ // each endpoint in the network endpoint group. For instance group backends,
+ // the health check uses the port number determined by looking up the backend
+ // service's named port in the instance group's list of named ports.
+ //
+ // Possible values:
+ // "USE_FIXED_PORT" - The port number in the health check's port is used for
+ // health checking. Applies to network endpoint group and instance group
+ // backends.
// "USE_NAMED_PORT" - Not supported.
- // "USE_SERVING_PORT" - For network endpoint group backends, the
- // health check uses the port number specified on each endpoint in the
- // network endpoint group. For instance group backends, the health check
- // uses the port number specified for the backend service's named port
- // defined in the instance group's named ports.
+ // "USE_SERVING_PORT" - For network endpoint group backends, the health check
+ // uses the port number specified on each endpoint in the network endpoint
+ // group. For instance group backends, the health check uses the port number
+ // specified for the backend service's named port defined in the instance
+ // group's named ports.
PortSpecification string `json:"portSpecification,omitempty"`
-
- // ProxyHeader: Specifies the type of proxy header to append before
- // sending data to the backend, either NONE or PROXY_V1. The default is
- // NONE.
+ // ProxyHeader: Specifies the type of proxy header to append before sending
+ // data to the backend, either NONE or PROXY_V1. The default is NONE.
//
// Possible values:
// "NONE"
// "PROXY_V1"
ProxyHeader string `json:"proxyHeader,omitempty"`
-
- // RequestPath: The request path of the HTTPS health check request. The
- // default value is /.
+ // RequestPath: The request path of the HTTPS health check request. The default
+ // value is /. Must comply with RFC3986.
RequestPath string `json:"requestPath,omitempty"`
-
- // Response: Creates a content-based HTTPS health check. In addition to
- // the required HTTP 200 (OK) status code, you can configure the health
- // check to pass only when the backend sends this specific ASCII
- // response string within the first 1024 bytes of the HTTP response
- // body. For details, see:
+ // Response: Creates a content-based HTTPS health check. In addition to the
+ // required HTTP 200 (OK) status code, you can configure the health check to
+ // pass only when the backend sends this specific ASCII response string within
+ // the first 1024 bytes of the HTTP response body. For details, see:
// https://cloud.google.com/load-balancing/docs/health-check-concepts#criteria-protocol-http
Response string `json:"response,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Host") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Host") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Host") 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. "Host") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HTTPSHealthCheck) MarshalJSON() ([]byte, error) {
+func (s HTTPSHealthCheck) MarshalJSON() ([]byte, error) {
type NoMethod HTTPSHealthCheck
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// HealthCheck: Represents a health check resource. Google Compute
-// Engine has two health check resources: * Regional
+// HealthCheck: Represents a health check resource. Google Compute Engine has
+// two health check resources: * Regional
// (/compute/docs/reference/rest/v1/regionHealthChecks) * Global
-// (/compute/docs/reference/rest/v1/healthChecks) These health check
-// resources can be used for load balancing and for autohealing VMs in a
-// managed instance group (MIG). **Load balancing** Health check
-// requirements vary depending on the type of load balancer. For details
-// about the type of health check supported for each load balancer and
-// corresponding backend type, see Health checks overview: Load balancer
-// guide. **Autohealing in MIGs** The health checks that you use for
-// autohealing VMs in a MIG can be either regional or global. For more
-// information, see Set up an application health check and autohealing.
-// For more information, see Health checks overview.
+// (/compute/docs/reference/rest/v1/healthChecks) These health check resources
+// can be used for load balancing and for autohealing VMs in a managed instance
+// group (MIG). **Load balancing** Health check requirements vary depending on
+// the type of load balancer. For details about the type of health check
+// supported for each load balancer and corresponding backend type, see Health
+// checks overview: Load balancer guide. **Autohealing in MIGs** The health
+// checks that you use for autohealing VMs in a MIG can be either regional or
+// global. For more information, see Set up an application health check and
+// autohealing. For more information, see Health checks overview.
type HealthCheck struct {
- // CheckIntervalSec: How often (in seconds) to send a health check. The
- // default value is 5 seconds.
+ // CheckIntervalSec: How often (in seconds) to send a health check. The default
+ // value is 5 seconds.
CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
-
- // CreationTimestamp: [Output Only] Creation timestamp in 3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in 3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
- Description string `json:"description,omitempty"`
-
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
+ Description string `json:"description,omitempty"`
GrpcHealthCheck *GRPCHealthCheck `json:"grpcHealthCheck,omitempty"`
-
- // HealthyThreshold: A so-far unhealthy instance will be marked healthy
- // after this many consecutive successes. The default value is 2.
- HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
-
+ // HealthyThreshold: A so-far unhealthy instance will be marked healthy after
+ // this many consecutive successes. The default value is 2.
+ HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
Http2HealthCheck *HTTP2HealthCheck `json:"http2HealthCheck,omitempty"`
-
- HttpHealthCheck *HTTPHealthCheck `json:"httpHealthCheck,omitempty"`
-
+ HttpHealthCheck *HTTPHealthCheck `json:"httpHealthCheck,omitempty"`
HttpsHealthCheck *HTTPSHealthCheck `json:"httpsHealthCheck,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
// Kind: Type of the resource.
Kind string `json:"kind,omitempty"`
-
// LogConfig: Configure logging on this health check.
LogConfig *HealthCheckLogConfig `json:"logConfig,omitempty"`
-
- // Name: Name of the resource. Provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. For example, a name that is 1-63 characters long, matches
- // the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`, and otherwise
- // complies with RFC1035. This regular expression describes a name where
- // the first character is a lowercase letter, and all following
- // characters are a dash, lowercase letter, or digit, except the last
- // character, which isn't a dash.
+ // Name: Name of the resource. Provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035. For
+ // example, a name that is 1-63 characters long, matches the regular expression
+ // `[a-z]([-a-z0-9]*[a-z0-9])?`, and otherwise complies with RFC1035. This
+ // regular expression describes a name where the first character is a lowercase
+ // letter, and all following characters are a dash, lowercase letter, or digit,
+ // except the last character, which isn't a dash.
Name string `json:"name,omitempty"`
-
- // Region: [Output Only] Region where the health check resides. Not
- // applicable to global health checks.
+ // Region: [Output Only] Region where the health check resides. Not applicable
+ // to global health checks.
Region string `json:"region,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
+ // SourceRegions: The list of cloud regions from which health checks are
+ // performed. If any regions are specified, then exactly 3 regions should be
+ // specified. The region names must be valid names of Google Cloud regions.
+ // This can only be set for global health check. If this list is non-empty,
+ // then there are restrictions on what other health check fields are supported
+ // and what other resources can use this health check: - SSL, HTTP2, and GRPC
+ // protocols are not supported. - The TCP request field is not supported. - The
+ // proxyHeader field for HTTP, HTTPS, and TCP is not supported. - The
+ // checkIntervalSec field must be at least 30. - The health check cannot be
+ // used with BackendService nor with managed instance group auto-healing.
+ SourceRegions []string `json:"sourceRegions,omitempty"`
SslHealthCheck *SSLHealthCheck `json:"sslHealthCheck,omitempty"`
-
TcpHealthCheck *TCPHealthCheck `json:"tcpHealthCheck,omitempty"`
-
- // TimeoutSec: How long (in seconds) to wait before claiming failure.
- // The default value is 5 seconds. It is invalid for timeoutSec to have
- // greater value than checkIntervalSec.
+ // TimeoutSec: How long (in seconds) to wait before claiming failure. The
+ // default value is 5 seconds. It is invalid for timeoutSec to have greater
+ // value than checkIntervalSec.
TimeoutSec int64 `json:"timeoutSec,omitempty"`
-
- // Type: Specifies the type of the healthCheck, either TCP, SSL, HTTP,
- // HTTPS, HTTP2 or GRPC. Exactly one of the protocol-specific health
- // check fields must be specified, which must match type field.
+ // Type: Specifies the type of the healthCheck, either TCP, SSL, HTTP, HTTPS,
+ // HTTP2 or GRPC. Exactly one of the protocol-specific health check fields must
+ // be specified, which must match type field.
//
// Possible values:
// "GRPC"
@@ -15308,1099 +12842,884 @@ type HealthCheck struct {
// "SSL"
// "TCP"
Type string `json:"type,omitempty"`
-
- // UnhealthyThreshold: A so-far healthy instance will be marked
- // unhealthy after this many consecutive failures. The default value is
- // 2.
+ // UnhealthyThreshold: A so-far healthy instance will be marked unhealthy after
+ // this many consecutive failures. The default value is 2.
UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
// ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "CheckIntervalSec") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "CheckIntervalSec") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HealthCheck) MarshalJSON() ([]byte, error) {
+func (s HealthCheck) MarshalJSON() ([]byte, error) {
type NoMethod HealthCheck
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// HealthCheckList: Contains a list of HealthCheck resources.
type HealthCheckList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of HealthCheck resources.
Items []*HealthCheck `json:"items,omitempty"`
-
// Kind: Type of resource.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *HealthCheckListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HealthCheckList) MarshalJSON() ([]byte, error) {
+func (s HealthCheckList) MarshalJSON() ([]byte, error) {
type NoMethod HealthCheckList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// HealthCheckListWarning: [Output Only] Informational warning message.
type HealthCheckListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*HealthCheckListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HealthCheckListWarning) MarshalJSON() ([]byte, error) {
+func (s HealthCheckListWarning) MarshalJSON() ([]byte, error) {
type NoMethod HealthCheckListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type HealthCheckListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HealthCheckListWarningData) MarshalJSON() ([]byte, error) {
+func (s HealthCheckListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod HealthCheckListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// HealthCheckLogConfig: Configuration of logging on a health check. If
-// logging is enabled, logs will be exported to Stackdriver.
+// HealthCheckLogConfig: Configuration of logging on a health check. If logging
+// is enabled, logs will be exported to Stackdriver.
type HealthCheckLogConfig struct {
- // Enable: Indicates whether or not to export logs. This is false by
- // default, which means no health check logging will be done.
+ // Enable: Indicates whether or not to export logs. This is false by default,
+ // which means no health check logging will be done.
Enable bool `json:"enable,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Enable") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Enable") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Enable") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HealthCheckLogConfig) MarshalJSON() ([]byte, error) {
+func (s HealthCheckLogConfig) MarshalJSON() ([]byte, error) {
type NoMethod HealthCheckLogConfig
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// HealthCheckReference: A full or valid partial URL to a health check.
-// For example, the following are valid URLs: -
+// HealthCheckReference: A full or valid partial URL to a health check. For
+// example, the following are valid URLs: -
// https://www.googleapis.com/compute/beta/projects/project-id/global/httpHealthChecks/health-check
// - projects/project-id/global/httpHealthChecks/health-check -
// global/httpHealthChecks/health-check
type HealthCheckReference struct {
HealthCheck string `json:"healthCheck,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "HealthCheck") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "HealthCheck") 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. "HealthCheck") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HealthCheckReference) MarshalJSON() ([]byte, error) {
+func (s HealthCheckReference) MarshalJSON() ([]byte, error) {
type NoMethod HealthCheckReference
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// HealthCheckService: Represents a Health-Check as a Service resource.
type HealthCheckService struct {
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // Fingerprint: Fingerprint of this resource. A hash of the contents
- // stored in this object. This field is used in optimistic locking. This
- // field will be ignored when inserting a HealthCheckService. An
- // up-to-date fingerprint must be provided in order to patch/update the
- // HealthCheckService; Otherwise, the request will fail with error 412
- // conditionNotMet. To see the latest fingerprint, make a get() request
- // to retrieve the HealthCheckService.
+ // Fingerprint: Fingerprint of this resource. A hash of the contents stored in
+ // this object. This field is used in optimistic locking. This field will be
+ // ignored when inserting a HealthCheckService. An up-to-date fingerprint must
+ // be provided in order to patch/update the HealthCheckService; Otherwise, the
+ // request will fail with error 412 conditionNotMet. To see the latest
+ // fingerprint, make a get() request to retrieve the HealthCheckService.
Fingerprint string `json:"fingerprint,omitempty"`
-
- // HealthChecks: A list of URLs to the HealthCheck resources. Must have
- // at least one HealthCheck, and not more than 10 for regional
- // HealthCheckService, and not more than 1 for global
- // HealthCheckService. HealthCheck resources must have
- // portSpecification=USE_SERVING_PORT or
- // portSpecification=USE_FIXED_PORT. For regional HealthCheckService,
- // the HealthCheck must be regional and in the same region. For global
- // HealthCheckService, HealthCheck must be global. Mix of regional and
- // global HealthChecks is not supported. Multiple regional HealthChecks
- // must belong to the same region. Regional HealthChecks must belong to
- // the same region as zones of NetworkEndpointGroups. For global
- // HealthCheckService using global INTERNET_IP_PORT
- // NetworkEndpointGroups, the global HealthChecks must specify
- // sourceRegions, and HealthChecks that specify sourceRegions can only
- // be used with global INTERNET_IP_PORT NetworkEndpointGroups.
+ // HealthChecks: A list of URLs to the HealthCheck resources. Must have at
+ // least one HealthCheck, and not more than 10 for regional HealthCheckService,
+ // and not more than 1 for global HealthCheckService. HealthCheck resources
+ // must have portSpecification=USE_SERVING_PORT or
+ // portSpecification=USE_FIXED_PORT. For regional HealthCheckService, the
+ // HealthCheck must be regional and in the same region. For global
+ // HealthCheckService, HealthCheck must be global. Mix of regional and global
+ // HealthChecks is not supported. Multiple regional HealthChecks must belong to
+ // the same region. Regional HealthChecks must belong to the same region as
+ // zones of NetworkEndpointGroups. For global HealthCheckService using global
+ // INTERNET_IP_PORT NetworkEndpointGroups, the global HealthChecks must specify
+ // sourceRegions, and HealthChecks that specify sourceRegions can only be used
+ // with global INTERNET_IP_PORT NetworkEndpointGroups.
HealthChecks []string `json:"healthChecks,omitempty"`
-
- // HealthStatusAggregationPolicy: Optional. Policy for how the results
- // from multiple health checks for the same endpoint are aggregated.
- // Defaults to NO_AGGREGATION if unspecified. - NO_AGGREGATION. An
- // EndpointHealth message is returned for each pair in the health check
- // service. - AND. If any health check of an endpoint reports UNHEALTHY,
- // then UNHEALTHY is the HealthState of the endpoint. If all health
- // checks report HEALTHY, the HealthState of the endpoint is HEALTHY. .
- // This is only allowed with regional HealthCheckService.
- //
- // Possible values:
- // "AND" - If any backend's health check reports UNHEALTHY, then
- // UNHEALTHY is the HealthState of the entire health check service. If
- // all backend's are healthy, the HealthState of the health check
- // service is HEALTHY.
- // "NO_AGGREGATION" - An EndpointHealth message is returned for each
- // backend in the health check service.
+ // HealthStatusAggregationPolicy: Optional. Policy for how the results from
+ // multiple health checks for the same endpoint are aggregated. Defaults to
+ // NO_AGGREGATION if unspecified. - NO_AGGREGATION. An EndpointHealth message
+ // is returned for each pair in the health check service. - AND. If any health
+ // check of an endpoint reports UNHEALTHY, then UNHEALTHY is the HealthState of
+ // the endpoint. If all health checks report HEALTHY, the HealthState of the
+ // endpoint is HEALTHY. . This is only allowed with regional
+ // HealthCheckService.
+ //
+ // Possible values:
+ // "AND" - If any backend's health check reports UNHEALTHY, then UNHEALTHY is
+ // the HealthState of the entire health check service. If all backend's are
+ // healthy, the HealthState of the health check service is HEALTHY.
+ // "NO_AGGREGATION" - An EndpointHealth message is returned for each backend
+ // in the health check service.
HealthStatusAggregationPolicy string `json:"healthStatusAggregationPolicy,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
// Kind: [Output only] Type of the resource. Always
// compute#healthCheckServicefor health check services.
Kind string `json:"kind,omitempty"`
-
- // Name: Name of the resource. The name must be 1-63 characters long,
- // and comply with RFC1035. Specifically, the name must be 1-63
- // characters long and match the regular expression
- // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
- // a lowercase letter, and all following characters must be a dash,
- // lowercase letter, or digit, except the last character, which cannot
- // be a dash.
+ // Name: Name of the resource. The name must be 1-63 characters long, and
+ // comply with RFC1035. Specifically, the name must be 1-63 characters long and
+ // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the
+ // first character must be a lowercase letter, and all following characters
+ // must be a dash, lowercase letter, or digit, except the last character, which
+ // cannot be a dash.
Name string `json:"name,omitempty"`
-
- // NetworkEndpointGroups: A list of URLs to the NetworkEndpointGroup
- // resources. Must not have more than 100. For regional
- // HealthCheckService, NEGs must be in zones in the region of the
- // HealthCheckService. For global HealthCheckServices, the
- // NetworkEndpointGroups must be global INTERNET_IP_PORT.
+ // NetworkEndpointGroups: A list of URLs to the NetworkEndpointGroup resources.
+ // Must not have more than 100. For regional HealthCheckService, NEGs must be
+ // in zones in the region of the HealthCheckService. For global
+ // HealthCheckServices, the NetworkEndpointGroups must be global
+ // INTERNET_IP_PORT.
NetworkEndpointGroups []string `json:"networkEndpointGroups,omitempty"`
-
- // NotificationEndpoints: A list of URLs to the NotificationEndpoint
- // resources. Must not have more than 10. A list of endpoints for
- // receiving notifications of change in health status. For regional
- // HealthCheckService, NotificationEndpoint must be regional and in the
- // same region. For global HealthCheckService, NotificationEndpoint must
- // be global.
+ // NotificationEndpoints: A list of URLs to the NotificationEndpoint resources.
+ // Must not have more than 10. A list of endpoints for receiving notifications
+ // of change in health status. For regional HealthCheckService,
+ // NotificationEndpoint must be regional and in the same region. For global
+ // HealthCheckService, NotificationEndpoint must be global.
NotificationEndpoints []string `json:"notificationEndpoints,omitempty"`
-
- // Region: [Output Only] URL of the region where the health check
- // service resides. This field is not applicable to global health check
- // services. You must specify this field as part of the HTTP request
- // URL. It is not settable as a field in the request body.
+ // Region: [Output Only] URL of the region where the health check service
+ // resides. This field is not applicable to global health check services. You
+ // must specify this field as part of the HTTP request URL. It is not settable
+ // as a field in the request body.
Region string `json:"region,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "CreationTimestamp") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CreationTimestamp") 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. "CreationTimestamp") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HealthCheckService) MarshalJSON() ([]byte, error) {
+func (s HealthCheckService) MarshalJSON() ([]byte, error) {
type NoMethod HealthCheckService
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// HealthCheckServiceReference: A full or valid partial URL to a health
-// check service. For example, the following are valid URLs: -
+// HealthCheckServiceReference: A full or valid partial URL to a health check
+// service. For example, the following are valid URLs: -
// https://www.googleapis.com/compute/beta/projects/project-id/regions/us-west1/healthCheckServices/health-check-service
// -
-// projects/project-id/regions/us-west1/healthCheckServices/health-check-
-// service - regions/us-west1/healthCheckServices/health-check-service
+// projects/project-id/regions/us-west1/healthCheckServices/health-check-service
+// - regions/us-west1/healthCheckServices/health-check-service
type HealthCheckServiceReference struct {
HealthCheckService string `json:"healthCheckService,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "HealthCheckService")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "HealthCheckService") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "HealthCheckService") 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. "HealthCheckService") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HealthCheckServiceReference) MarshalJSON() ([]byte, error) {
+func (s HealthCheckServiceReference) MarshalJSON() ([]byte, error) {
type NoMethod HealthCheckServiceReference
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type HealthCheckServicesList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of HealthCheckService resources.
Items []*HealthCheckService `json:"items,omitempty"`
-
// Kind: [Output Only] Type of the resource. Always
// compute#healthCheckServicesList for lists of HealthCheckServices.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *HealthCheckServicesListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HealthCheckServicesList) MarshalJSON() ([]byte, error) {
+func (s HealthCheckServicesList) MarshalJSON() ([]byte, error) {
type NoMethod HealthCheckServicesList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// HealthCheckServicesListWarning: [Output Only] Informational warning
-// message.
+// HealthCheckServicesListWarning: [Output Only] Informational warning message.
type HealthCheckServicesListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*HealthCheckServicesListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HealthCheckServicesListWarning) MarshalJSON() ([]byte, error) {
+func (s HealthCheckServicesListWarning) MarshalJSON() ([]byte, error) {
type NoMethod HealthCheckServicesListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type HealthCheckServicesListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HealthCheckServicesListWarningData) MarshalJSON() ([]byte, error) {
+func (s HealthCheckServicesListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod HealthCheckServicesListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type HealthChecksAggregatedList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of HealthChecksScopedList resources.
Items map[string]HealthChecksScopedList `json:"items,omitempty"`
-
// Kind: Type of resource.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Unreachables: [Output Only] Unreachable resources.
Unreachables []string `json:"unreachables,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *HealthChecksAggregatedListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HealthChecksAggregatedList) MarshalJSON() ([]byte, error) {
+func (s HealthChecksAggregatedList) MarshalJSON() ([]byte, error) {
type NoMethod HealthChecksAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// HealthChecksAggregatedListWarning: [Output Only] Informational
-// warning message.
+// HealthChecksAggregatedListWarning: [Output Only] Informational warning
+// message.
type HealthChecksAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*HealthChecksAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HealthChecksAggregatedListWarning) MarshalJSON() ([]byte, error) {
+func (s HealthChecksAggregatedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod HealthChecksAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type HealthChecksAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HealthChecksAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+func (s HealthChecksAggregatedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod HealthChecksAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type HealthChecksScopedList struct {
// HealthChecks: A list of HealthChecks contained in this scope.
HealthChecks []*HealthCheck `json:"healthChecks,omitempty"`
-
- // Warning: Informational warning which replaces the list of backend
- // services when the list is empty.
+ // Warning: Informational warning which replaces the list of backend services
+ // when the list is empty.
Warning *HealthChecksScopedListWarning `json:"warning,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "HealthChecks") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "HealthChecks") 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. "HealthChecks") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HealthChecksScopedList) MarshalJSON() ([]byte, error) {
+func (s HealthChecksScopedList) MarshalJSON() ([]byte, error) {
type NoMethod HealthChecksScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// HealthChecksScopedListWarning: Informational warning which replaces
-// the list of backend services when the list is empty.
+// HealthChecksScopedListWarning: Informational warning which replaces the list
+// of backend services when the list is empty.
type HealthChecksScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*HealthChecksScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HealthChecksScopedListWarning) MarshalJSON() ([]byte, error) {
+func (s HealthChecksScopedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod HealthChecksScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type HealthChecksScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HealthChecksScopedListWarningData) MarshalJSON() ([]byte, error) {
+func (s HealthChecksScopedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod HealthChecksScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type HealthStatus struct {
// Annotations: Metadata defined as annotations for network endpoint.
Annotations map[string]string `json:"annotations,omitempty"`
-
- // ForwardingRule: URL of the forwarding rule associated with the health
- // status of the instance.
+ // ForwardingRule: URL of the forwarding rule associated with the health status
+ // of the instance.
ForwardingRule string `json:"forwardingRule,omitempty"`
-
- // ForwardingRuleIp: A forwarding rule IP address assigned to this
- // instance.
+ // ForwardingRuleIp: A forwarding rule IP address assigned to this instance.
ForwardingRuleIp string `json:"forwardingRuleIp,omitempty"`
-
// HealthState: Health state of the IPv4 address of the instance.
//
// Possible values:
// "HEALTHY"
// "UNHEALTHY"
HealthState string `json:"healthState,omitempty"`
-
// Instance: URL of the instance resource.
Instance string `json:"instance,omitempty"`
-
- // IpAddress: For target pool based Network Load Balancing, it indicates
- // the forwarding rule's IP address assigned to this instance. For other
- // types of load balancing, the field indicates VM internal ip.
- IpAddress string `json:"ipAddress,omitempty"`
-
- // Port: The named port of the instance group, not necessarily the port
- // that is health-checked.
- Port int64 `json:"port,omitempty"`
-
+ // IpAddress: For target pool based Network Load Balancing, it indicates the
+ // forwarding rule's IP address assigned to this instance. For other types of
+ // load balancing, the field indicates VM internal ip.
+ IpAddress string `json:"ipAddress,omitempty"`
+ Ipv6Address string `json:"ipv6Address,omitempty"`
+ // Ipv6HealthState: Health state of the IPv6 address of the instance.
+ //
+ // Possible values:
+ // "HEALTHY"
+ // "UNHEALTHY"
+ Ipv6HealthState string `json:"ipv6HealthState,omitempty"`
+ // Port: The named port of the instance group, not necessarily the port that is
+ // health-checked.
+ Port int64 `json:"port,omitempty"`
Weight string `json:"weight,omitempty"`
-
// Possible values:
- // "INVALID_WEIGHT" - The response to a Health Check probe had the
- // HTTP response header field X-Load-Balancing-Endpoint-Weight, but its
- // content was invalid (i.e., not a non-negative single-precision
- // floating-point number in decimal string representation).
- // "MISSING_WEIGHT" - The response to a Health Check probe did not
- // have the HTTP response header field X-Load-Balancing-Endpoint-Weight.
- // "UNAVAILABLE_WEIGHT" - This is the value when the accompanied
- // health status is either TIMEOUT (i.e.,the Health Check probe was not
- // able to get a response in time) or UNKNOWN. For the latter, it should
- // be typically because there has not been sufficient time to parse and
- // report the weight for a new backend (which is with 0.0.0.0 ip
- // address). However, it can be also due to an outage case for which the
- // health status is explicitly reset to UNKNOWN.
+ // "INVALID_WEIGHT" - The response to a Health Check probe had the HTTP
+ // response header field X-Load-Balancing-Endpoint-Weight, but its content was
+ // invalid (i.e., not a non-negative single-precision floating-point number in
+ // decimal string representation).
+ // "MISSING_WEIGHT" - The response to a Health Check probe did not have the
+ // HTTP response header field X-Load-Balancing-Endpoint-Weight.
+ // "UNAVAILABLE_WEIGHT" - This is the value when the accompanied health
+ // status is either TIMEOUT (i.e.,the Health Check probe was not able to get a
+ // response in time) or UNKNOWN. For the latter, it should be typically because
+ // there has not been sufficient time to parse and report the weight for a new
+ // backend (which is with 0.0.0.0 ip address). However, it can be also due to
+ // an outage case for which the health status is explicitly reset to UNKNOWN.
// "WEIGHT_NONE" - This is the default value when WeightReportMode is
// DISABLE, and is also the initial value when WeightReportMode has just
- // updated to ENABLE or DRY_RUN and there has not been sufficient time
- // to parse and report the backend weight.
+ // updated to ENABLE or DRY_RUN and there has not been sufficient time to parse
+ // and report the backend weight.
WeightError string `json:"weightError,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Annotations") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Annotations") 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. "Annotations") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HealthStatus) MarshalJSON() ([]byte, error) {
+func (s HealthStatus) MarshalJSON() ([]byte, error) {
type NoMethod HealthStatus
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type HealthStatusForNetworkEndpoint struct {
- // BackendService: URL of the backend service associated with the health
- // state of the network endpoint.
+ // BackendService: URL of the backend service associated with the health state
+ // of the network endpoint.
BackendService *BackendServiceReference `json:"backendService,omitempty"`
-
- // ForwardingRule: URL of the forwarding rule associated with the health
- // state of the network endpoint.
- ForwardingRule *ForwardingRuleReference `json:"forwardingRule,omitempty"`
-
- // HealthCheck: URL of the health check associated with the health state
+ // ForwardingRule: URL of the forwarding rule associated with the health state
// of the network endpoint.
+ ForwardingRule *ForwardingRuleReference `json:"forwardingRule,omitempty"`
+ // HealthCheck: URL of the health check associated with the health state of the
+ // network endpoint.
HealthCheck *HealthCheckReference `json:"healthCheck,omitempty"`
-
- // HealthCheckService: URL of the health check service associated with
- // the health state of the network endpoint.
+ // HealthCheckService: URL of the health check service associated with the
+ // health state of the network endpoint.
HealthCheckService *HealthCheckServiceReference `json:"healthCheckService,omitempty"`
-
- // HealthState: Health state of the network endpoint determined based on
- // the health checks configured.
+ // HealthState: Health state of the network endpoint determined based on the
+ // health checks configured.
//
// Possible values:
// "DRAINING" - Endpoint is being drained.
@@ -16408,174 +13727,147 @@ type HealthStatusForNetworkEndpoint struct {
// "UNHEALTHY" - Endpoint is unhealthy.
// "UNKNOWN" - Health status of the endpoint is unknown.
HealthState string `json:"healthState,omitempty"`
-
+ // Ipv6HealthState: Health state of the ipv6 network endpoint determined based
+ // on the health checks configured.
+ //
+ // Possible values:
+ // "DRAINING" - Endpoint is being drained.
+ // "HEALTHY" - Endpoint is healthy.
+ // "UNHEALTHY" - Endpoint is unhealthy.
+ // "UNKNOWN" - Health status of the endpoint is unknown.
+ Ipv6HealthState string `json:"ipv6HealthState,omitempty"`
// ForceSendFields is a list of field names (e.g. "BackendService") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "BackendService") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "BackendService") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HealthStatusForNetworkEndpoint) MarshalJSON() ([]byte, error) {
+func (s HealthStatusForNetworkEndpoint) MarshalJSON() ([]byte, error) {
type NoMethod HealthStatusForNetworkEndpoint
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// Help: Provides links to documentation or for performing an out of
-// band action. For example, if a quota check failed with an error
-// indicating the calling project hasn't enabled the accessed service,
-// this can contain a URL pointing directly to the right place in the
-// developer console to flip the bit.
+// Help: Provides links to documentation or for performing an out of band
+// action. For example, if a quota check failed with an error indicating the
+// calling project hasn't enabled the accessed service, this can contain a URL
+// pointing directly to the right place in the developer console to flip the
+// bit.
type Help struct {
- // Links: URL(s) pointing to additional information on handling the
- // current error.
+ // Links: URL(s) pointing to additional information on handling the current
+ // error.
Links []*HelpLink `json:"links,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Links") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Links") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Links") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *Help) MarshalJSON() ([]byte, error) {
+func (s Help) MarshalJSON() ([]byte, error) {
type NoMethod Help
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// HelpLink: Describes a URL link.
type HelpLink struct {
// Description: Describes what the link offers.
Description string `json:"description,omitempty"`
-
// Url: The URL of the link.
Url string `json:"url,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Description") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Description") to include
- // in API requests with the JSON null value. By default, fields with
- // empty values are omitted from API requests. However, any field with
- // an empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields 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. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HelpLink) MarshalJSON() ([]byte, error) {
+func (s HelpLink) MarshalJSON() ([]byte, error) {
type NoMethod HelpLink
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// HostRule: UrlMaps A host-matching rule for a URL. If matched, will
-// use the named PathMatcher to select the BackendService.
+// HostRule: UrlMaps A host-matching rule for a URL. If matched, will use the
+// named PathMatcher to select the BackendService.
type HostRule struct {
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // Hosts: The list of host patterns to match. They must be valid
- // hostnames with optional port numbers in the format host:port. *
- // matches any string of ([a-z0-9-.]*). In that case, * must be the
- // first character, and if followed by anything, the immediate following
- // character must be either - or .. * based matching is not supported
- // when the URL map is bound to a target gRPC proxy that has the
- // validateForProxyless field set to true.
+ // Hosts: The list of host patterns to match. They must be valid hostnames with
+ // optional port numbers in the format host:port. * matches any string of
+ // ([a-z0-9-.]*). In that case, * must be the first character, and if followed
+ // by anything, the immediate following character must be either - or .. *
+ // based matching is not supported when the URL map is bound to a target gRPC
+ // proxy that has the validateForProxyless field set to true.
Hosts []string `json:"hosts,omitempty"`
-
- // PathMatcher: The name of the PathMatcher to use to match the path
- // portion of the URL if the hostRule matches the URL's host portion.
+ // PathMatcher: The name of the PathMatcher to use to match the path portion of
+ // the URL if the hostRule matches the URL's host portion.
PathMatcher string `json:"pathMatcher,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Description") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Description") to include
- // in API requests with the JSON null value. By default, fields with
- // empty values are omitted from API requests. However, any field with
- // an empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields 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. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HostRule) MarshalJSON() ([]byte, error) {
+func (s HostRule) MarshalJSON() ([]byte, error) {
type NoMethod HostRule
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// HttpFaultAbort: Specification for how requests are aborted as part of
-// fault injection.
+// HttpFaultAbort: Specification for how requests are aborted as part of fault
+// injection.
type HttpFaultAbort struct {
- // HttpStatus: The HTTP status code used to abort the request. The value
- // must be from 200 to 599 inclusive. For gRPC protocol, the gRPC status
- // code is mapped to HTTP status code according to this mapping table.
- // HTTP status 200 is mapped to gRPC status UNKNOWN. Injecting an OK
- // status is currently not supported by Traffic Director.
+ // HttpStatus: The HTTP status code used to abort the request. The value must
+ // be from 200 to 599 inclusive. For gRPC protocol, the gRPC status code is
+ // mapped to HTTP status code according to this mapping table. HTTP status 200
+ // is mapped to gRPC status UNKNOWN. Injecting an OK status is currently not
+ // supported by Traffic Director.
HttpStatus int64 `json:"httpStatus,omitempty"`
-
// Percentage: The percentage of traffic for connections, operations, or
- // requests that is aborted as part of fault injection. The value must
- // be from 0.0 to 100.0 inclusive.
+ // requests that is aborted as part of fault injection. The value must be from
+ // 0.0 to 100.0 inclusive.
Percentage float64 `json:"percentage,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "HttpStatus") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "HttpStatus") 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. "HttpStatus") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HttpFaultAbort) MarshalJSON() ([]byte, error) {
+func (s HttpFaultAbort) MarshalJSON() ([]byte, error) {
type NoMethod HttpFaultAbort
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
func (s *HttpFaultAbort) UnmarshalJSON(data []byte) error {
@@ -16592,39 +13884,31 @@ func (s *HttpFaultAbort) UnmarshalJSON(data []byte) error {
return nil
}
-// HttpFaultDelay: Specifies the delay introduced by the load balancer
-// before forwarding the request to the backend service as part of fault
-// injection.
+// HttpFaultDelay: Specifies the delay introduced by the load balancer before
+// forwarding the request to the backend service as part of fault injection.
type HttpFaultDelay struct {
// FixedDelay: Specifies the value of the fixed delay interval.
FixedDelay *Duration `json:"fixedDelay,omitempty"`
-
// Percentage: The percentage of traffic for connections, operations, or
- // requests for which a delay is introduced as part of fault injection.
- // The value must be from 0.0 to 100.0 inclusive.
+ // requests for which a delay is introduced as part of fault injection. The
+ // value must be from 0.0 to 100.0 inclusive.
Percentage float64 `json:"percentage,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "FixedDelay") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "FixedDelay") 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. "FixedDelay") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HttpFaultDelay) MarshalJSON() ([]byte, error) {
+func (s HttpFaultDelay) MarshalJSON() ([]byte, error) {
type NoMethod HttpFaultDelay
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
func (s *HttpFaultDelay) UnmarshalJSON(data []byte) error {
@@ -16641,176 +13925,140 @@ func (s *HttpFaultDelay) UnmarshalJSON(data []byte) error {
return nil
}
-// HttpFaultInjection: The specification for fault injection introduced
-// into traffic to test the resiliency of clients to backend service
-// failure. As part of fault injection, when clients send requests to a
-// backend service, delays can be introduced by the load balancer on a
-// percentage of requests before sending those request to the backend
-// service. Similarly requests from clients can be aborted by the load
-// balancer for a percentage of requests.
+// HttpFaultInjection: The specification for fault injection introduced into
+// traffic to test the resiliency of clients to backend service failure. As
+// part of fault injection, when clients send requests to a backend service,
+// delays can be introduced by the load balancer on a percentage of requests
+// before sending those request to the backend service. Similarly requests from
+// clients can be aborted by the load balancer for a percentage of requests.
type HttpFaultInjection struct {
- // Abort: The specification for how client requests are aborted as part
- // of fault injection.
+ // Abort: The specification for how client requests are aborted as part of
+ // fault injection.
Abort *HttpFaultAbort `json:"abort,omitempty"`
-
- // Delay: The specification for how client requests are delayed as part
- // of fault injection, before being sent to a backend service.
+ // Delay: The specification for how client requests are delayed as part of
+ // fault injection, before being sent to a backend service.
Delay *HttpFaultDelay `json:"delay,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Abort") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Abort") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Abort") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HttpFaultInjection) MarshalJSON() ([]byte, error) {
+func (s HttpFaultInjection) MarshalJSON() ([]byte, error) {
type NoMethod HttpFaultInjection
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// HttpHeaderAction: The request and response header transformations
-// that take effect before the request is passed along to the selected
-// backendService.
+// HttpHeaderAction: The request and response header transformations that take
+// effect before the request is passed along to the selected backendService.
type HttpHeaderAction struct {
- // RequestHeadersToAdd: Headers to add to a matching request before
- // forwarding the request to the backendService.
+ // RequestHeadersToAdd: Headers to add to a matching request before forwarding
+ // the request to the backendService.
RequestHeadersToAdd []*HttpHeaderOption `json:"requestHeadersToAdd,omitempty"`
-
- // RequestHeadersToRemove: A list of header names for headers that need
- // to be removed from the request before forwarding the request to the
+ // RequestHeadersToRemove: A list of header names for headers that need to be
+ // removed from the request before forwarding the request to the
// backendService.
RequestHeadersToRemove []string `json:"requestHeadersToRemove,omitempty"`
-
// ResponseHeadersToAdd: Headers to add the response before sending the
// response back to the client.
ResponseHeadersToAdd []*HttpHeaderOption `json:"responseHeadersToAdd,omitempty"`
-
- // ResponseHeadersToRemove: A list of header names for headers that need
- // to be removed from the response before sending the response back to
- // the client.
+ // ResponseHeadersToRemove: A list of header names for headers that need to be
+ // removed from the response before sending the response back to the client.
ResponseHeadersToRemove []string `json:"responseHeadersToRemove,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "RequestHeadersToAdd")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "RequestHeadersToAdd") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "RequestHeadersToAdd") 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. "RequestHeadersToAdd") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HttpHeaderAction) MarshalJSON() ([]byte, error) {
+func (s HttpHeaderAction) MarshalJSON() ([]byte, error) {
type NoMethod HttpHeaderAction
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// HttpHeaderMatch: matchRule criteria for request header matches.
type HttpHeaderMatch struct {
- // ExactMatch: The value should exactly match contents of exactMatch.
- // Only one of exactMatch, prefixMatch, suffixMatch, regexMatch,
- // presentMatch or rangeMatch must be set.
+ // ExactMatch: The value should exactly match contents of exactMatch. Only one
+ // of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or
+ // rangeMatch must be set.
ExactMatch string `json:"exactMatch,omitempty"`
-
- // HeaderName: The name of the HTTP header to match. For matching
- // against the HTTP request's authority, use a headerMatch with the
- // header name ":authority". For matching a request's method, use the
- // headerName ":method". When the URL map is bound to a target gRPC
- // proxy that has the validateForProxyless field set to true, only
- // non-binary user-specified custom metadata and the `content-type`
- // header are supported. The following transport-level headers cannot be
- // used in header matching rules: `:authority`, `:method`, `:path`,
- // `:scheme`, `user-agent`, `accept-encoding`, `content-encoding`,
- // `grpc-accept-encoding`, `grpc-encoding`,
- // `grpc-previous-rpc-attempts`, `grpc-tags-bin`, `grpc-timeout` and
- // `grpc-trace-bin`.
+ // HeaderName: The name of the HTTP header to match. For matching against the
+ // HTTP request's authority, use a headerMatch with the header name
+ // ":authority". For matching a request's method, use the headerName ":method".
+ // When the URL map is bound to a target gRPC proxy that has the
+ // validateForProxyless field set to true, only non-binary user-specified
+ // custom metadata and the `content-type` header are supported. The following
+ // transport-level headers cannot be used in header matching rules:
+ // `:authority`, `:method`, `:path`, `:scheme`, `user-agent`,
+ // `accept-encoding`, `content-encoding`, `grpc-accept-encoding`,
+ // `grpc-encoding`, `grpc-previous-rpc-attempts`, `grpc-tags-bin`,
+ // `grpc-timeout` and `grpc-trace-bin`.
HeaderName string `json:"headerName,omitempty"`
-
- // InvertMatch: If set to false, the headerMatch is considered a match
- // if the preceding match criteria are met. If set to true, the
- // headerMatch is considered a match if the preceding match criteria are
- // NOT met. The default setting is false.
+ // InvertMatch: If set to false, the headerMatch is considered a match if the
+ // preceding match criteria are met. If set to true, the headerMatch is
+ // considered a match if the preceding match criteria are NOT met. The default
+ // setting is false.
InvertMatch bool `json:"invertMatch,omitempty"`
-
// PrefixMatch: The value of the header must start with the contents of
- // prefixMatch. Only one of exactMatch, prefixMatch, suffixMatch,
- // regexMatch, presentMatch or rangeMatch must be set.
- PrefixMatch string `json:"prefixMatch,omitempty"`
-
- // PresentMatch: A header with the contents of headerName must exist.
- // The match takes place whether or not the request's header has a
- // value. Only one of exactMatch, prefixMatch, suffixMatch, regexMatch,
+ // prefixMatch. Only one of exactMatch, prefixMatch, suffixMatch, regexMatch,
// presentMatch or rangeMatch must be set.
+ PrefixMatch string `json:"prefixMatch,omitempty"`
+ // PresentMatch: A header with the contents of headerName must exist. The match
+ // takes place whether or not the request's header has a value. Only one of
+ // exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch
+ // must be set.
PresentMatch bool `json:"presentMatch,omitempty"`
-
- // RangeMatch: The header value must be an integer and its value must be
- // in the range specified in rangeMatch. If the header does not contain
- // an integer, number or is empty, the match fails. For example for a
- // range [-5, 0] - -3 will match. - 0 will not match. - 0.25 will not
- // match. - -3someString will not match. Only one of exactMatch,
- // prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must
- // be set. rangeMatch is not supported for load balancers that have
- // loadBalancingScheme set to EXTERNAL.
+ // RangeMatch: The header value must be an integer and its value must be in the
+ // range specified in rangeMatch. If the header does not contain an integer,
+ // number or is empty, the match fails. For example for a range [-5, 0] - -3
+ // will match. - 0 will not match. - 0.25 will not match. - -3someString will
+ // not match. Only one of exactMatch, prefixMatch, suffixMatch, regexMatch,
+ // presentMatch or rangeMatch must be set. rangeMatch is not supported for load
+ // balancers that have loadBalancingScheme set to EXTERNAL.
RangeMatch *Int64RangeMatch `json:"rangeMatch,omitempty"`
-
// RegexMatch: The value of the header must match the regular expression
- // specified in regexMatch. For more information about regular
- // expression syntax, see Syntax. For matching against a port specified
- // in the HTTP request, use a headerMatch with headerName set to PORT
- // and a regular expression that satisfies the RFC2616 Host header's
- // port specifier. Only one of exactMatch, prefixMatch, suffixMatch,
- // regexMatch, presentMatch or rangeMatch must be set. Regular
- // expressions can only be used when the loadBalancingScheme is set to
- // INTERNAL_SELF_MANAGED.
+ // specified in regexMatch. For more information about regular expression
+ // syntax, see Syntax. For matching against a port specified in the HTTP
+ // request, use a headerMatch with headerName set to PORT and a regular
+ // expression that satisfies the RFC2616 Host header's port specifier. Only one
+ // of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or
+ // rangeMatch must be set. Regular expressions can only be used when the
+ // loadBalancingScheme is set to INTERNAL_SELF_MANAGED.
RegexMatch string `json:"regexMatch,omitempty"`
-
// SuffixMatch: The value of the header must end with the contents of
- // suffixMatch. Only one of exactMatch, prefixMatch, suffixMatch,
- // regexMatch, presentMatch or rangeMatch must be set.
+ // suffixMatch. Only one of exactMatch, prefixMatch, suffixMatch, regexMatch,
+ // presentMatch or rangeMatch must be set.
SuffixMatch string `json:"suffixMatch,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "ExactMatch") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "ExactMatch") 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. "ExactMatch") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HttpHeaderMatch) MarshalJSON() ([]byte, error) {
+func (s HttpHeaderMatch) MarshalJSON() ([]byte, error) {
type NoMethod HttpHeaderMatch
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// HttpHeaderOption: Specification determining how headers are added to
@@ -16818,1275 +14066,1041 @@ func (s *HttpHeaderMatch) MarshalJSON() ([]byte, error) {
type HttpHeaderOption struct {
// HeaderName: The name of the header.
HeaderName string `json:"headerName,omitempty"`
-
// HeaderValue: The value of the header to add.
HeaderValue string `json:"headerValue,omitempty"`
-
- // Replace: If false, headerValue is appended to any values that already
- // exist for the header. If true, headerValue is set for the header,
- // discarding any values that were set for that header. The default
- // value is false.
+ // Replace: If false, headerValue is appended to any values that already exist
+ // for the header. If true, headerValue is set for the header, discarding any
+ // values that were set for that header. The default value is false.
Replace bool `json:"replace,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "HeaderName") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "HeaderName") 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. "HeaderName") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HttpHeaderOption) MarshalJSON() ([]byte, error) {
+func (s HttpHeaderOption) MarshalJSON() ([]byte, error) {
type NoMethod HttpHeaderOption
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// HttpHealthCheck: Represents a legacy HTTP Health Check resource.
-// Legacy HTTP health checks are now only required by target pool-based
-// network load balancers. For all other load balancers, including
-// backend service-based network load balancers, and for managed
-// instance group auto-healing, you must use modern (non-legacy) health
-// checks. For more information, see Health checks overview .
+// HttpHealthCheck: Represents a legacy HTTP Health Check resource. Legacy HTTP
+// health checks are now only required by target pool-based network load
+// balancers. For all other load balancers, including backend service-based
+// network load balancers, and for managed instance group auto-healing, you
+// must use modern (non-legacy) health checks. For more information, see Health
+// checks overview .
type HttpHealthCheck struct {
- // CheckIntervalSec: How often (in seconds) to send a health check. The
- // default value is 5 seconds.
+ // CheckIntervalSec: How often (in seconds) to send a health check. The default
+ // value is 5 seconds.
CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
-
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // HealthyThreshold: A so-far unhealthy instance will be marked healthy
- // after this many consecutive successes. The default value is 2.
+ // HealthyThreshold: A so-far unhealthy instance will be marked healthy after
+ // this many consecutive successes. The default value is 2.
HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
-
- // Host: The value of the host header in the HTTP health check request.
- // If left empty (default value), the public IP on behalf of which this
- // health check is performed will be used.
+ // Host: The value of the host header in the HTTP health check request. If left
+ // empty (default value), the public IP on behalf of which this health check is
+ // performed will be used.
Host string `json:"host,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
- // Kind: [Output Only] Type of the resource. Always
- // compute#httpHealthCheck for HTTP health checks.
+ // Kind: [Output Only] Type of the resource. Always compute#httpHealthCheck for
+ // HTTP health checks.
Kind string `json:"kind,omitempty"`
-
- // Name: Name of the resource. Provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
- // the first character must be a lowercase letter, and all following
- // characters must be a dash, lowercase letter, or digit, except the
- // last character, which cannot be a dash.
+ // Name: Name of the resource. Provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must
+ // be a lowercase letter, and all following characters must be a dash,
+ // lowercase letter, or digit, except the last character, which cannot be a
+ // dash.
Name string `json:"name,omitempty"`
-
- // Port: The TCP port number for the HTTP health check request. The
- // default value is 80.
+ // Port: The TCP port number for the HTTP health check request. The default
+ // value is 80.
Port int64 `json:"port,omitempty"`
-
- // RequestPath: The request path of the HTTP health check request. The
- // default value is /. This field does not support query parameters.
- // Must comply with RFC3986.
+ // RequestPath: The request path of the HTTP health check request. The default
+ // value is /. This field does not support query parameters. Must comply with
+ // RFC3986.
RequestPath string `json:"requestPath,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // TimeoutSec: How long (in seconds) to wait before claiming failure.
- // The default value is 5 seconds. It is invalid for timeoutSec to have
- // greater value than checkIntervalSec.
+ // TimeoutSec: How long (in seconds) to wait before claiming failure. The
+ // default value is 5 seconds. It is invalid for timeoutSec to have greater
+ // value than checkIntervalSec.
TimeoutSec int64 `json:"timeoutSec,omitempty"`
-
- // UnhealthyThreshold: A so-far healthy instance will be marked
- // unhealthy after this many consecutive failures. The default value is
- // 2.
+ // UnhealthyThreshold: A so-far healthy instance will be marked unhealthy after
+ // this many consecutive failures. The default value is 2.
UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
// ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "CheckIntervalSec") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "CheckIntervalSec") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HttpHealthCheck) MarshalJSON() ([]byte, error) {
+func (s HttpHealthCheck) MarshalJSON() ([]byte, error) {
type NoMethod HttpHealthCheck
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// HttpHealthCheckList: Contains a list of HttpHealthCheck resources.
type HttpHealthCheckList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of HttpHealthCheck resources.
Items []*HttpHealthCheck `json:"items,omitempty"`
-
// Kind: Type of resource.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *HttpHealthCheckListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HttpHealthCheckList) MarshalJSON() ([]byte, error) {
+func (s HttpHealthCheckList) MarshalJSON() ([]byte, error) {
type NoMethod HttpHealthCheckList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// HttpHealthCheckListWarning: [Output Only] Informational warning
-// message.
+// HttpHealthCheckListWarning: [Output Only] Informational warning message.
type HttpHealthCheckListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*HttpHealthCheckListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HttpHealthCheckListWarning) MarshalJSON() ([]byte, error) {
+func (s HttpHealthCheckListWarning) MarshalJSON() ([]byte, error) {
type NoMethod HttpHealthCheckListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type HttpHealthCheckListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HttpHealthCheckListWarningData) MarshalJSON() ([]byte, error) {
+func (s HttpHealthCheckListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod HttpHealthCheckListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// HttpQueryParameterMatch: HttpRouteRuleMatch criteria for a request's
-// query parameter.
+// HttpQueryParameterMatch: HttpRouteRuleMatch criteria for a request's query
+// parameter.
type HttpQueryParameterMatch struct {
- // ExactMatch: The queryParameterMatch matches if the value of the
- // parameter exactly matches the contents of exactMatch. Only one of
- // presentMatch, exactMatch, or regexMatch must be set.
+ // ExactMatch: The queryParameterMatch matches if the value of the parameter
+ // exactly matches the contents of exactMatch. Only one of presentMatch,
+ // exactMatch, or regexMatch must be set.
ExactMatch string `json:"exactMatch,omitempty"`
-
- // Name: The name of the query parameter to match. The query parameter
- // must exist in the request, in the absence of which the request match
- // fails.
+ // Name: The name of the query parameter to match. The query parameter must
+ // exist in the request, in the absence of which the request match fails.
Name string `json:"name,omitempty"`
-
- // PresentMatch: Specifies that the queryParameterMatch matches if the
- // request contains the query parameter, irrespective of whether the
- // parameter has a value or not. Only one of presentMatch, exactMatch,
- // or regexMatch must be set.
+ // PresentMatch: Specifies that the queryParameterMatch matches if the request
+ // contains the query parameter, irrespective of whether the parameter has a
+ // value or not. Only one of presentMatch, exactMatch, or regexMatch must be
+ // set.
PresentMatch bool `json:"presentMatch,omitempty"`
-
- // RegexMatch: The queryParameterMatch matches if the value of the
- // parameter matches the regular expression specified by regexMatch. For
- // more information about regular expression syntax, see Syntax. Only
- // one of presentMatch, exactMatch, or regexMatch must be set. Regular
- // expressions can only be used when the loadBalancingScheme is set to
- // INTERNAL_SELF_MANAGED.
+ // RegexMatch: The queryParameterMatch matches if the value of the parameter
+ // matches the regular expression specified by regexMatch. For more information
+ // about regular expression syntax, see Syntax. Only one of presentMatch,
+ // exactMatch, or regexMatch must be set. Regular expressions can only be used
+ // when the loadBalancingScheme is set to INTERNAL_SELF_MANAGED.
RegexMatch string `json:"regexMatch,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "ExactMatch") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "ExactMatch") 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. "ExactMatch") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HttpQueryParameterMatch) MarshalJSON() ([]byte, error) {
+func (s HttpQueryParameterMatch) MarshalJSON() ([]byte, error) {
type NoMethod HttpQueryParameterMatch
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// HttpRedirectAction: Specifies settings for an HTTP redirect.
type HttpRedirectAction struct {
- // HostRedirect: The host that is used in the redirect response instead
- // of the one that was supplied in the request. The value must be from 1
- // to 255 characters.
+ // HostRedirect: The host that is used in the redirect response instead of the
+ // one that was supplied in the request. The value must be from 1 to 255
+ // characters.
HostRedirect string `json:"hostRedirect,omitempty"`
-
- // HttpsRedirect: If set to true, the URL scheme in the redirected
- // request is set to HTTPS. If set to false, the URL scheme of the
- // redirected request remains the same as that of the request. This must
- // only be set for URL maps used in TargetHttpProxys. Setting this true
- // for TargetHttpsProxy is not permitted. The default is set to false.
+ // HttpsRedirect: If set to true, the URL scheme in the redirected request is
+ // set to HTTPS. If set to false, the URL scheme of the redirected request
+ // remains the same as that of the request. This must only be set for URL maps
+ // used in TargetHttpProxys. Setting this true for TargetHttpsProxy is not
+ // permitted. The default is set to false.
HttpsRedirect bool `json:"httpsRedirect,omitempty"`
-
- // PathRedirect: The path that is used in the redirect response instead
- // of the one that was supplied in the request. pathRedirect cannot be
- // supplied together with prefixRedirect. Supply one alone or neither.
- // If neither is supplied, the path of the original request is used for
- // the redirect. The value must be from 1 to 1024 characters.
+ // PathRedirect: The path that is used in the redirect response instead of the
+ // one that was supplied in the request. pathRedirect cannot be supplied
+ // together with prefixRedirect. Supply one alone or neither. If neither is
+ // supplied, the path of the original request is used for the redirect. The
+ // value must be from 1 to 1024 characters.
PathRedirect string `json:"pathRedirect,omitempty"`
-
- // PrefixRedirect: The prefix that replaces the prefixMatch specified in
- // the HttpRouteRuleMatch, retaining the remaining portion of the URL
- // before redirecting the request. prefixRedirect cannot be supplied
- // together with pathRedirect. Supply one alone or neither. If neither
- // is supplied, the path of the original request is used for the
- // redirect. The value must be from 1 to 1024 characters.
+ // PrefixRedirect: The prefix that replaces the prefixMatch specified in the
+ // HttpRouteRuleMatch, retaining the remaining portion of the URL before
+ // redirecting the request. prefixRedirect cannot be supplied together with
+ // pathRedirect. Supply one alone or neither. If neither is supplied, the path
+ // of the original request is used for the redirect. The value must be from 1
+ // to 1024 characters.
PrefixRedirect string `json:"prefixRedirect,omitempty"`
-
- // RedirectResponseCode: The HTTP Status code to use for this
- // RedirectAction. Supported values are: - MOVED_PERMANENTLY_DEFAULT,
- // which is the default value and corresponds to 301. - FOUND, which
- // corresponds to 302. - SEE_OTHER which corresponds to 303. -
- // TEMPORARY_REDIRECT, which corresponds to 307. In this case, the
- // request method is retained. - PERMANENT_REDIRECT, which corresponds
- // to 308. In this case, the request method is retained.
+ // RedirectResponseCode: The HTTP Status code to use for this RedirectAction.
+ // Supported values are: - MOVED_PERMANENTLY_DEFAULT, which is the default
+ // value and corresponds to 301. - FOUND, which corresponds to 302. - SEE_OTHER
+ // which corresponds to 303. - TEMPORARY_REDIRECT, which corresponds to 307. In
+ // this case, the request method is retained. - PERMANENT_REDIRECT, which
+ // corresponds to 308. In this case, the request method is retained.
//
// Possible values:
// "FOUND" - Http Status Code 302 - Found.
- // "MOVED_PERMANENTLY_DEFAULT" - Http Status Code 301 - Moved
- // Permanently.
+ // "MOVED_PERMANENTLY_DEFAULT" - Http Status Code 301 - Moved Permanently.
// "PERMANENT_REDIRECT" - Http Status Code 308 - Permanent Redirect
// maintaining HTTP method.
// "SEE_OTHER" - Http Status Code 303 - See Other.
// "TEMPORARY_REDIRECT" - Http Status Code 307 - Temporary Redirect
// maintaining HTTP method.
RedirectResponseCode string `json:"redirectResponseCode,omitempty"`
-
- // StripQuery: If set to true, any accompanying query portion of the
- // original URL is removed before redirecting the request. If set to
- // false, the query portion of the original URL is retained. The default
- // is set to false.
+ // StripQuery: If set to true, any accompanying query portion of the original
+ // URL is removed before redirecting the request. If set to false, the query
+ // portion of the original URL is retained. The default is set to false.
StripQuery bool `json:"stripQuery,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "HostRedirect") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "HostRedirect") 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. "HostRedirect") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HttpRedirectAction) MarshalJSON() ([]byte, error) {
+func (s HttpRedirectAction) MarshalJSON() ([]byte, error) {
type NoMethod HttpRedirectAction
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// HttpRetryPolicy: The retry policy associates with HttpRouteRule
type HttpRetryPolicy struct {
- // NumRetries: Specifies the allowed number retries. This number must be
- // > 0. If not specified, defaults to 1.
+ // NumRetries: Specifies the allowed number retries. This number must be > 0.
+ // If not specified, defaults to 1.
NumRetries int64 `json:"numRetries,omitempty"`
-
// PerTryTimeout: Specifies a non-zero timeout per retry attempt. If not
- // specified, will use the timeout set in the HttpRouteAction field. If
- // timeout in the HttpRouteAction field is not set, this field uses the
- // largest timeout among all backend services associated with the route.
- // Not supported when the URL map is bound to a target gRPC proxy that
- // has the validateForProxyless field set to true.
+ // specified, will use the timeout set in the HttpRouteAction field. If timeout
+ // in the HttpRouteAction field is not set, this field uses the largest timeout
+ // among all backend services associated with the route. Not supported when the
+ // URL map is bound to a target gRPC proxy that has the validateForProxyless
+ // field set to true.
PerTryTimeout *Duration `json:"perTryTimeout,omitempty"`
-
- // RetryConditions: Specifies one or more conditions when this retry
- // policy applies. Valid values are: - 5xx: retry is attempted if the
- // instance or endpoint responds with any 5xx response code, or if the
- // instance or endpoint does not respond at all. For example,
- // disconnects, reset, read timeout, connection failure, and refused
- // streams. - gateway-error: Similar to 5xx, but only applies to
- // response codes 502, 503 or 504. - connect-failure: a retry is
- // attempted on failures connecting to the instance or endpoint. For
- // example, connection timeouts. - retriable-4xx: a retry is attempted
- // if the instance or endpoint responds with a 4xx response code. The
- // only error that you can retry is error code 409. - refused-stream: a
- // retry is attempted if the instance or endpoint resets the stream with
- // a REFUSED_STREAM error code. This reset type indicates that it is
- // safe to retry. - cancelled: a retry is attempted if the gRPC status
- // code in the response header is set to cancelled. - deadline-exceeded:
- // a retry is attempted if the gRPC status code in the response header
- // is set to deadline-exceeded. - internal: a retry is attempted if the
- // gRPC status code in the response header is set to internal. -
- // resource-exhausted: a retry is attempted if the gRPC status code in
- // the response header is set to resource-exhausted. - unavailable: a
- // retry is attempted if the gRPC status code in the response header is
- // set to unavailable. Only the following codes are supported when the
- // URL map is bound to target gRPC proxy that has validateForProxyless
- // field set to true. - cancelled - deadline-exceeded - internal -
- // resource-exhausted - unavailable
+ // RetryConditions: Specifies one or more conditions when this retry policy
+ // applies. Valid values are: - 5xx: retry is attempted if the instance or
+ // endpoint responds with any 5xx response code, or if the instance or endpoint
+ // does not respond at all. For example, disconnects, reset, read timeout,
+ // connection failure, and refused streams. - gateway-error: Similar to 5xx,
+ // but only applies to response codes 502, 503 or 504. - connect-failure: a
+ // retry is attempted on failures connecting to the instance or endpoint. For
+ // example, connection timeouts. - retriable-4xx: a retry is attempted if the
+ // instance or endpoint responds with a 4xx response code. The only error that
+ // you can retry is error code 409. - refused-stream: a retry is attempted if
+ // the instance or endpoint resets the stream with a REFUSED_STREAM error code.
+ // This reset type indicates that it is safe to retry. - cancelled: a retry is
+ // attempted if the gRPC status code in the response header is set to
+ // cancelled. - deadline-exceeded: a retry is attempted if the gRPC status code
+ // in the response header is set to deadline-exceeded. - internal: a retry is
+ // attempted if the gRPC status code in the response header is set to internal.
+ // - resource-exhausted: a retry is attempted if the gRPC status code in the
+ // response header is set to resource-exhausted. - unavailable: a retry is
+ // attempted if the gRPC status code in the response header is set to
+ // unavailable. Only the following codes are supported when the URL map is
+ // bound to target gRPC proxy that has validateForProxyless field set to true.
+ // - cancelled - deadline-exceeded - internal - resource-exhausted -
+ // unavailable
RetryConditions []string `json:"retryConditions,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "NumRetries") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "NumRetries") 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. "NumRetries") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HttpRetryPolicy) MarshalJSON() ([]byte, error) {
+func (s HttpRetryPolicy) MarshalJSON() ([]byte, error) {
type NoMethod HttpRetryPolicy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type HttpRouteAction struct {
// CorsPolicy: The specification for allowing client-side cross-origin
- // requests. For more information about the W3C recommendation for
- // cross-origin resource sharing (CORS), see Fetch API Living Standard.
- // Not supported when the URL map is bound to a target gRPC proxy.
+ // requests. For more information about the W3C recommendation for cross-origin
+ // resource sharing (CORS), see Fetch API Living Standard. Not supported when
+ // the URL map is bound to a target gRPC proxy.
CorsPolicy *CorsPolicy `json:"corsPolicy,omitempty"`
-
- // FaultInjectionPolicy: The specification for fault injection
- // introduced into traffic to test the resiliency of clients to backend
- // service failure. As part of fault injection, when clients send
- // requests to a backend service, delays can be introduced by a load
- // balancer on a percentage of requests before sending those requests to
- // the backend service. Similarly requests from clients can be aborted
- // by the load balancer for a percentage of requests. timeout and
- // retry_policy is ignored by clients that are configured with a
- // fault_injection_policy if: 1. The traffic is generated by fault
- // injection AND 2. The fault injection is not a delay fault injection.
- // Fault injection is not supported with the classic Application Load
- // Balancer . To see which load balancers support fault injection, see
- // Load balancing: Routing and traffic management features.
+ // FaultInjectionPolicy: The specification for fault injection introduced into
+ // traffic to test the resiliency of clients to backend service failure. As
+ // part of fault injection, when clients send requests to a backend service,
+ // delays can be introduced by a load balancer on a percentage of requests
+ // before sending those requests to the backend service. Similarly requests
+ // from clients can be aborted by the load balancer for a percentage of
+ // requests. timeout and retry_policy is ignored by clients that are configured
+ // with a fault_injection_policy if: 1. The traffic is generated by fault
+ // injection AND 2. The fault injection is not a delay fault injection. Fault
+ // injection is not supported with the classic Application Load Balancer . To
+ // see which load balancers support fault injection, see Load balancing:
+ // Routing and traffic management features.
FaultInjectionPolicy *HttpFaultInjection `json:"faultInjectionPolicy,omitempty"`
-
- // MaxStreamDuration: Specifies the maximum duration (timeout) for
- // streams on the selected route. Unlike the timeout field where the
- // timeout duration starts from the time the request has been fully
- // processed (known as *end-of-stream*), the duration in this field is
- // computed from the beginning of the stream until the response has been
- // processed, including all retries. A stream that does not complete in
- // this duration is closed. If not specified, this field uses the
- // maximum maxStreamDuration value among all backend services associated
- // with the route. This field is only allowed if the Url map is used
- // with backend services with loadBalancingScheme set to
+ // MaxStreamDuration: Specifies the maximum duration (timeout) for streams on
+ // the selected route. Unlike the timeout field where the timeout duration
+ // starts from the time the request has been fully processed (known as
+ // *end-of-stream*), the duration in this field is computed from the beginning
+ // of the stream until the response has been processed, including all retries.
+ // A stream that does not complete in this duration is closed. If not
+ // specified, this field uses the maximum maxStreamDuration value among all
+ // backend services associated with the route. This field is only allowed if
+ // the Url map is used with backend services with loadBalancingScheme set to
// INTERNAL_SELF_MANAGED.
MaxStreamDuration *Duration `json:"maxStreamDuration,omitempty"`
-
- // RequestMirrorPolicy: Specifies the policy on how requests intended
- // for the route's backends are shadowed to a separate mirrored backend
- // service. The load balancer does not wait for responses from the
- // shadow service. Before sending traffic to the shadow service, the
- // host / authority header is suffixed with -shadow. Not supported when
- // the URL map is bound to a target gRPC proxy that has the
- // validateForProxyless field set to true.
+ // RequestMirrorPolicy: Specifies the policy on how requests intended for the
+ // route's backends are shadowed to a separate mirrored backend service. The
+ // load balancer does not wait for responses from the shadow service. Before
+ // sending traffic to the shadow service, the host / authority header is
+ // suffixed with -shadow. Not supported when the URL map is bound to a target
+ // gRPC proxy that has the validateForProxyless field set to true.
RequestMirrorPolicy *RequestMirrorPolicy `json:"requestMirrorPolicy,omitempty"`
-
// RetryPolicy: Specifies the retry policy associated with this route.
RetryPolicy *HttpRetryPolicy `json:"retryPolicy,omitempty"`
-
- // Timeout: Specifies the timeout for the selected route. Timeout is
- // computed from the time the request has been fully processed (known as
- // *end-of-stream*) up until the response has been processed. Timeout
- // includes all retries. If not specified, this field uses the largest
- // timeout among all backend services associated with the route. Not
- // supported when the URL map is bound to a target gRPC proxy that has
- // validateForProxyless field set to true.
+ // Timeout: Specifies the timeout for the selected route. Timeout is computed
+ // from the time the request has been fully processed (known as
+ // *end-of-stream*) up until the response has been processed. Timeout includes
+ // all retries. If not specified, this field uses the largest timeout among all
+ // backend services associated with the route. Not supported when the URL map
+ // is bound to a target gRPC proxy that has validateForProxyless field set to
+ // true.
Timeout *Duration `json:"timeout,omitempty"`
-
- // UrlRewrite: The spec to modify the URL of the request, before
- // forwarding the request to the matched service. urlRewrite is the only
- // action supported in UrlMaps for classic Application Load Balancers.
- // Not supported when the URL map is bound to a target gRPC proxy that
- // has the validateForProxyless field set to true.
+ // UrlRewrite: The spec to modify the URL of the request, before forwarding the
+ // request to the matched service. urlRewrite is the only action supported in
+ // UrlMaps for classic Application Load Balancers. Not supported when the URL
+ // map is bound to a target gRPC proxy that has the validateForProxyless field
+ // set to true.
UrlRewrite *UrlRewrite `json:"urlRewrite,omitempty"`
-
- // WeightedBackendServices: A list of weighted backend services to send
- // traffic to when a route match occurs. The weights determine the
- // fraction of traffic that flows to their corresponding backend
- // service. If all traffic needs to go to a single backend service,
- // there must be one weightedBackendService with weight set to a
- // non-zero number. After a backend service is identified and before
- // forwarding the request to the backend service, advanced routing
+ // WeightedBackendServices: A list of weighted backend services to send traffic
+ // to when a route match occurs. The weights determine the fraction of traffic
+ // that flows to their corresponding backend service. If all traffic needs to
+ // go to a single backend service, there must be one weightedBackendService
+ // with weight set to a non-zero number. After a backend service is identified
+ // and before forwarding the request to the backend service, advanced routing
// actions such as URL rewrites and header transformations are applied
// depending on additional settings specified in this HttpRouteAction.
WeightedBackendServices []*WeightedBackendService `json:"weightedBackendServices,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "CorsPolicy") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CorsPolicy") 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. "CorsPolicy") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HttpRouteAction) MarshalJSON() ([]byte, error) {
+func (s HttpRouteAction) MarshalJSON() ([]byte, error) {
type NoMethod HttpRouteAction
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// HttpRouteRule: The HttpRouteRule setting specifies how to match an
-// HTTP request and the corresponding routing action that load balancing
-// proxies perform.
+// HttpRouteRule: The HttpRouteRule setting specifies how to match an HTTP
+// request and the corresponding routing action that load balancing proxies
+// perform.
type HttpRouteRule struct {
- // Description: The short description conveying the intent of this
- // routeRule. The description can have a maximum length of 1024
- // characters.
+ // CustomErrorResponsePolicy: customErrorResponsePolicy specifies how the Load
+ // Balancer returns error responses when BackendServiceor BackendBucket
+ // responds with an error. If a policy for an error code is not configured for
+ // the RouteRule, a policy for the error code configured in
+ // pathMatcher.defaultCustomErrorResponsePolicy is applied. If one is not
+ // specified in pathMatcher.defaultCustomErrorResponsePolicy, the policy
+ // configured in UrlMap.defaultCustomErrorResponsePolicy takes effect. For
+ // example, consider a UrlMap with the following configuration: -
+ // UrlMap.defaultCustomErrorResponsePolicy are configured with policies for 5xx
+ // and 4xx errors - A RouteRule for /coming_soon/ is configured for the error
+ // code 404. If the request is for www.myotherdomain.com and a 404 is
+ // encountered, the policy under UrlMap.defaultCustomErrorResponsePolicy takes
+ // effect. If a 404 response is encountered for the request
+ // www.example.com/current_events/, the pathMatcher's policy takes effect. If
+ // however, the request for www.example.com/coming_soon/ encounters a 404, the
+ // policy in RouteRule.customErrorResponsePolicy takes effect. If any of the
+ // requests in this example encounter a 500 error code, the policy at
+ // UrlMap.defaultCustomErrorResponsePolicy takes effect. When used in
+ // conjunction with routeRules.routeAction.retryPolicy, retries take
+ // precedence. Only once all retries are exhausted, the
+ // customErrorResponsePolicy is applied. While attempting a retry, if load
+ // balancer is successful in reaching the service, the
+ // customErrorResponsePolicy is ignored and the response from the service is
+ // returned to the client. customErrorResponsePolicy is supported only for
+ // global external Application Load Balancers.
+ CustomErrorResponsePolicy *CustomErrorResponsePolicy `json:"customErrorResponsePolicy,omitempty"`
+ // Description: The short description conveying the intent of this routeRule.
+ // The description can have a maximum length of 1024 characters.
Description string `json:"description,omitempty"`
-
- // HeaderAction: Specifies changes to request and response headers that
- // need to take effect for the selected backendService. The headerAction
- // value specified here is applied before the matching
- // pathMatchers[].headerAction and after
- // pathMatchers[].routeRules[].routeAction.weightedBackendService.backend
- // ServiceWeightAction[].headerAction HeaderAction is not supported for
- // load balancers that have their loadBalancingScheme set to EXTERNAL.
- // Not supported when the URL map is bound to a target gRPC proxy that
- // has validateForProxyless field set to true.
+ // HeaderAction: Specifies changes to request and response headers that need to
+ // take effect for the selected backendService. The headerAction value
+ // specified here is applied before the matching pathMatchers[].headerAction
+ // and after
+ // pathMatchers[].routeRules[].routeAction.weightedBackendService.backendService
+ // WeightAction[].headerAction HeaderAction is not supported for load balancers
+ // that have their loadBalancingScheme set to EXTERNAL. Not supported when the
+ // URL map is bound to a target gRPC proxy that has validateForProxyless field
+ // set to true.
HeaderAction *HttpHeaderAction `json:"headerAction,omitempty"`
-
- // MatchRules: The list of criteria for matching attributes of a request
- // to this routeRule. This list has OR semantics: the request matches
- // this routeRule when any of the matchRules are satisfied. However
- // predicates within a given matchRule have AND semantics. All
- // predicates within a matchRule must match for the request to match the
- // rule.
+ // MatchRules: The list of criteria for matching attributes of a request to
+ // this routeRule. This list has OR semantics: the request matches this
+ // routeRule when any of the matchRules are satisfied. However predicates
+ // within a given matchRule have AND semantics. All predicates within a
+ // matchRule must match for the request to match the rule.
MatchRules []*HttpRouteRuleMatch `json:"matchRules,omitempty"`
-
- // Priority: For routeRules within a given pathMatcher, priority
- // determines the order in which a load balancer interprets routeRules.
- // RouteRules are evaluated in order of priority, from the lowest to
- // highest number. The priority of a rule decreases as its number
- // increases (1, 2, 3, N+1). The first rule that matches the request is
- // applied. You cannot configure two or more routeRules with the same
- // priority. Priority for each rule must be set to a number from 0 to
- // 2147483647 inclusive. Priority numbers can have gaps, which enable
- // you to add or remove rules in the future without affecting the rest
- // of the rules. For example, 1, 2, 3, 4, 5, 9, 12, 16 is a valid series
- // of priority numbers to which you could add rules numbered from 6 to
- // 8, 10 to 11, and 13 to 15 in the future without any impact on
- // existing rules.
+ // Priority: For routeRules within a given pathMatcher, priority determines the
+ // order in which a load balancer interprets routeRules. RouteRules are
+ // evaluated in order of priority, from the lowest to highest number. The
+ // priority of a rule decreases as its number increases (1, 2, 3, N+1). The
+ // first rule that matches the request is applied. You cannot configure two or
+ // more routeRules with the same priority. Priority for each rule must be set
+ // to a number from 0 to 2147483647 inclusive. Priority numbers can have gaps,
+ // which enable you to add or remove rules in the future without affecting the
+ // rest of the rules. For example, 1, 2, 3, 4, 5, 9, 12, 16 is a valid series
+ // of priority numbers to which you could add rules numbered from 6 to 8, 10 to
+ // 11, and 13 to 15 in the future without any impact on existing rules.
Priority int64 `json:"priority,omitempty"`
-
- // RouteAction: In response to a matching matchRule, the load balancer
- // performs advanced routing actions, such as URL rewrites and header
- // transformations, before forwarding the request to the selected
- // backend. If routeAction specifies any weightedBackendServices,
- // service must not be set. Conversely if service is set, routeAction
- // cannot contain any weightedBackendServices. Only one of urlRedirect,
- // service or routeAction.weightedBackendService must be set. URL maps
- // for classic Application Load Balancers only support the urlRewrite
- // action within a route rule's routeAction.
+ // RouteAction: In response to a matching matchRule, the load balancer performs
+ // advanced routing actions, such as URL rewrites and header transformations,
+ // before forwarding the request to the selected backend. If routeAction
+ // specifies any weightedBackendServices, service must not be set. Conversely
+ // if service is set, routeAction cannot contain any weightedBackendServices.
+ // Only one of urlRedirect, service or routeAction.weightedBackendService must
+ // be set. URL maps for classic Application Load Balancers only support the
+ // urlRewrite action within a route rule's routeAction.
RouteAction *HttpRouteAction `json:"routeAction,omitempty"`
-
- // Service: The full or partial URL of the backend service resource to
- // which traffic is directed if this rule is matched. If routeAction is
- // also specified, advanced routing actions, such as URL rewrites, take
- // effect before sending the request to the backend. However, if service
- // is specified, routeAction cannot contain any weightedBackendServices.
- // Conversely, if routeAction specifies any weightedBackendServices,
- // service must not be specified. Only one of urlRedirect, service or
+ // Service: The full or partial URL of the backend service resource to which
+ // traffic is directed if this rule is matched. If routeAction is also
+ // specified, advanced routing actions, such as URL rewrites, take effect
+ // before sending the request to the backend. However, if service is specified,
+ // routeAction cannot contain any weightedBackendServices. Conversely, if
+ // routeAction specifies any weightedBackendServices, service must not be
+ // specified. Only one of urlRedirect, service or
// routeAction.weightedBackendService must be set.
Service string `json:"service,omitempty"`
-
- // UrlRedirect: When this rule is matched, the request is redirected to
- // a URL specified by urlRedirect. If urlRedirect is specified, service
- // or routeAction must not be set. Not supported when the URL map is
- // bound to a target gRPC proxy.
+ // UrlRedirect: When this rule is matched, the request is redirected to a URL
+ // specified by urlRedirect. If urlRedirect is specified, service or
+ // routeAction must not be set. Not supported when the URL map is bound to a
+ // target gRPC proxy.
UrlRedirect *HttpRedirectAction `json:"urlRedirect,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Description") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "CustomErrorResponsePolicy")
+ // to unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Description") to include
- // in API requests with the JSON null value. By default, fields with
- // empty values are omitted from API requests. However, any field with
- // an empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "CustomErrorResponsePolicy") to
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HttpRouteRule) MarshalJSON() ([]byte, error) {
+func (s HttpRouteRule) MarshalJSON() ([]byte, error) {
type NoMethod HttpRouteRule
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// HttpRouteRuleMatch: HttpRouteRuleMatch specifies a set of criteria
-// for matching requests to an HttpRouteRule. All specified criteria
-// must be satisfied for a match to occur.
+// HttpRouteRuleMatch: HttpRouteRuleMatch specifies a set of criteria for
+// matching requests to an HttpRouteRule. All specified criteria must be
+// satisfied for a match to occur.
type HttpRouteRuleMatch struct {
- // FullPathMatch: For satisfying the matchRule condition, the path of
- // the request must exactly match the value specified in fullPathMatch
- // after removing any query parameters and anchor that may be part of
- // the original URL. fullPathMatch must be from 1 to 1024 characters.
- // Only one of prefixMatch, fullPathMatch or regexMatch must be
- // specified.
+ // FullPathMatch: For satisfying the matchRule condition, the path of the
+ // request must exactly match the value specified in fullPathMatch after
+ // removing any query parameters and anchor that may be part of the original
+ // URL. fullPathMatch must be from 1 to 1024 characters. Only one of
+ // prefixMatch, fullPathMatch or regexMatch must be specified.
FullPathMatch string `json:"fullPathMatch,omitempty"`
-
- // HeaderMatches: Specifies a list of header match criteria, all of
- // which must match corresponding headers in the request.
+ // HeaderMatches: Specifies a list of header match criteria, all of which must
+ // match corresponding headers in the request.
HeaderMatches []*HttpHeaderMatch `json:"headerMatches,omitempty"`
-
- // IgnoreCase: Specifies that prefixMatch and fullPathMatch matches are
- // case sensitive. The default value is false. ignoreCase must not be
- // used with regexMatch. Not supported when the URL map is bound to a
- // target gRPC proxy.
+ // IgnoreCase: Specifies that prefixMatch and fullPathMatch matches are case
+ // sensitive. The default value is false. ignoreCase must not be used with
+ // regexMatch. Not supported when the URL map is bound to a target gRPC proxy.
IgnoreCase bool `json:"ignoreCase,omitempty"`
-
// MetadataFilters: Opaque filter criteria used by the load balancer to
- // restrict routing configuration to a limited set of xDS compliant
- // clients. In their xDS requests to the load balancer, xDS clients
- // present node metadata. When there is a match, the relevant routing
- // configuration is made available to those proxies. For each
- // metadataFilter in this list, if its filterMatchCriteria is set to
- // MATCH_ANY, at least one of the filterLabels must match the
- // corresponding label provided in the metadata. If its
- // filterMatchCriteria is set to MATCH_ALL, then all of its filterLabels
- // must match with corresponding labels provided in the metadata. If
- // multiple metadata filters are specified, all of them need to be
- // satisfied in order to be considered a match. metadataFilters
- // specified here is applied after those specified in ForwardingRule
- // that refers to the UrlMap this HttpRouteRuleMatch belongs to.
- // metadataFilters only applies to load balancers that have
- // loadBalancingScheme set to INTERNAL_SELF_MANAGED. Not supported when
- // the URL map is bound to a target gRPC proxy that has
+ // restrict routing configuration to a limited set of xDS compliant clients. In
+ // their xDS requests to the load balancer, xDS clients present node metadata.
+ // When there is a match, the relevant routing configuration is made available
+ // to those proxies. For each metadataFilter in this list, if its
+ // filterMatchCriteria is set to MATCH_ANY, at least one of the filterLabels
+ // must match the corresponding label provided in the metadata. If its
+ // filterMatchCriteria is set to MATCH_ALL, then all of its filterLabels must
+ // match with corresponding labels provided in the metadata. If multiple
+ // metadata filters are specified, all of them need to be satisfied in order to
+ // be considered a match. metadataFilters specified here is applied after those
+ // specified in ForwardingRule that refers to the UrlMap this
+ // HttpRouteRuleMatch belongs to. metadataFilters only applies to load
+ // balancers that have loadBalancingScheme set to INTERNAL_SELF_MANAGED. Not
+ // supported when the URL map is bound to a target gRPC proxy that has
// validateForProxyless field set to true.
MetadataFilters []*MetadataFilter `json:"metadataFilters,omitempty"`
-
- // PathTemplateMatch: If specified, the route is a pattern match
- // expression that must match the :path header once the query string is
- // removed. A pattern match allows you to match - The value must be
- // between 1 and 1024 characters - The pattern must start with a leading
- // slash ("/") - There may be no more than 5 operators in pattern
- // Precisely one of prefix_match, full_path_match, regex_match or
- // path_template_match must be set.
+ // PathTemplateMatch: If specified, the route is a pattern match expression
+ // that must match the :path header once the query string is removed. A pattern
+ // match allows you to match - The value must be between 1 and 1024 characters
+ // - The pattern must start with a leading slash ("/") - There may be no more
+ // than 5 operators in pattern Precisely one of prefix_match, full_path_match,
+ // regex_match or path_template_match must be set.
PathTemplateMatch string `json:"pathTemplateMatch,omitempty"`
-
- // PrefixMatch: For satisfying the matchRule condition, the request's
- // path must begin with the specified prefixMatch. prefixMatch must
- // begin with a /. The value must be from 1 to 1024 characters. Only one
- // of prefixMatch, fullPathMatch or regexMatch must be specified.
+ // PrefixMatch: For satisfying the matchRule condition, the request's path must
+ // begin with the specified prefixMatch. prefixMatch must begin with a /. The
+ // value must be from 1 to 1024 characters. Only one of prefixMatch,
+ // fullPathMatch or regexMatch must be specified.
PrefixMatch string `json:"prefixMatch,omitempty"`
-
- // QueryParameterMatches: Specifies a list of query parameter match
- // criteria, all of which must match corresponding query parameters in
- // the request. Not supported when the URL map is bound to a target gRPC
- // proxy.
+ // QueryParameterMatches: Specifies a list of query parameter match criteria,
+ // all of which must match corresponding query parameters in the request. Not
+ // supported when the URL map is bound to a target gRPC proxy.
QueryParameterMatches []*HttpQueryParameterMatch `json:"queryParameterMatches,omitempty"`
-
- // RegexMatch: For satisfying the matchRule condition, the path of the
- // request must satisfy the regular expression specified in regexMatch
- // after removing any query parameters and anchor supplied with the
- // original URL. For more information about regular expression syntax,
- // see Syntax. Only one of prefixMatch, fullPathMatch or regexMatch must
- // be specified. Regular expressions can only be used when the
- // loadBalancingScheme is set to INTERNAL_SELF_MANAGED.
+ // RegexMatch: For satisfying the matchRule condition, the path of the request
+ // must satisfy the regular expression specified in regexMatch after removing
+ // any query parameters and anchor supplied with the original URL. For more
+ // information about regular expression syntax, see Syntax. Only one of
+ // prefixMatch, fullPathMatch or regexMatch must be specified. Regular
+ // expressions can only be used when the loadBalancingScheme is set to
+ // INTERNAL_SELF_MANAGED.
RegexMatch string `json:"regexMatch,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "FullPathMatch") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "FullPathMatch") 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. "FullPathMatch") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HttpRouteRuleMatch) MarshalJSON() ([]byte, error) {
+func (s HttpRouteRuleMatch) MarshalJSON() ([]byte, error) {
type NoMethod HttpRouteRuleMatch
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// HttpsHealthCheck: Represents a legacy HTTPS Health Check resource.
-// Legacy HTTPS health checks have been deprecated. If you are using a
-// target pool-based network load balancer, you must use a legacy HTTP
-// (not HTTPS) health check. For all other load balancers, including
-// backend service-based network load balancers, and for managed
-// instance group auto-healing, you must use modern (non-legacy) health
-// checks. For more information, see Health checks overview .
+// HttpsHealthCheck: Represents a legacy HTTPS Health Check resource. Legacy
+// HTTPS health checks have been deprecated. If you are using a target
+// pool-based network load balancer, you must use a legacy HTTP (not HTTPS)
+// health check. For all other load balancers, including backend service-based
+// network load balancers, and for managed instance group auto-healing, you
+// must use modern (non-legacy) health checks. For more information, see Health
+// checks overview .
type HttpsHealthCheck struct {
- // CheckIntervalSec: How often (in seconds) to send a health check. The
- // default value is 5 seconds.
+ // CheckIntervalSec: How often (in seconds) to send a health check. The default
+ // value is 5 seconds.
CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
-
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // HealthyThreshold: A so-far unhealthy instance will be marked healthy
- // after this many consecutive successes. The default value is 2.
+ // HealthyThreshold: A so-far unhealthy instance will be marked healthy after
+ // this many consecutive successes. The default value is 2.
HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
-
- // Host: The value of the host header in the HTTPS health check request.
- // If left empty (default value), the public IP on behalf of which this
- // health check is performed will be used.
+ // Host: The value of the host header in the HTTPS health check request. If
+ // left empty (default value), the public IP on behalf of which this health
+ // check is performed will be used.
Host string `json:"host,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
// Kind: Type of the resource.
Kind string `json:"kind,omitempty"`
-
- // Name: Name of the resource. Provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
- // the first character must be a lowercase letter, and all following
- // characters must be a dash, lowercase letter, or digit, except the
- // last character, which cannot be a dash.
+ // Name: Name of the resource. Provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must
+ // be a lowercase letter, and all following characters must be a dash,
+ // lowercase letter, or digit, except the last character, which cannot be a
+ // dash.
Name string `json:"name,omitempty"`
-
- // Port: The TCP port number for the HTTPS health check request. The
- // default value is 443.
+ // Port: The TCP port number for the HTTPS health check request. The default
+ // value is 443.
Port int64 `json:"port,omitempty"`
-
- // RequestPath: The request path of the HTTPS health check request. The
- // default value is "/". Must comply with RFC3986.
+ // RequestPath: The request path of the HTTPS health check request. The default
+ // value is "/". Must comply with RFC3986.
RequestPath string `json:"requestPath,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // TimeoutSec: How long (in seconds) to wait before claiming failure.
- // The default value is 5 seconds. It is invalid for timeoutSec to have
- // a greater value than checkIntervalSec.
+ // TimeoutSec: How long (in seconds) to wait before claiming failure. The
+ // default value is 5 seconds. It is invalid for timeoutSec to have a greater
+ // value than checkIntervalSec.
TimeoutSec int64 `json:"timeoutSec,omitempty"`
-
- // UnhealthyThreshold: A so-far healthy instance will be marked
- // unhealthy after this many consecutive failures. The default value is
- // 2.
+ // UnhealthyThreshold: A so-far healthy instance will be marked unhealthy after
+ // this many consecutive failures. The default value is 2.
UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
// ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "CheckIntervalSec") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "CheckIntervalSec") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HttpsHealthCheck) MarshalJSON() ([]byte, error) {
+func (s HttpsHealthCheck) MarshalJSON() ([]byte, error) {
type NoMethod HttpsHealthCheck
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// HttpsHealthCheckList: Contains a list of HttpsHealthCheck resources.
type HttpsHealthCheckList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of HttpsHealthCheck resources.
Items []*HttpsHealthCheck `json:"items,omitempty"`
-
// Kind: Type of resource.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *HttpsHealthCheckListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HttpsHealthCheckList) MarshalJSON() ([]byte, error) {
+func (s HttpsHealthCheckList) MarshalJSON() ([]byte, error) {
type NoMethod HttpsHealthCheckList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// HttpsHealthCheckListWarning: [Output Only] Informational warning
-// message.
+// HttpsHealthCheckListWarning: [Output Only] Informational warning message.
type HttpsHealthCheckListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*HttpsHealthCheckListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HttpsHealthCheckListWarning) MarshalJSON() ([]byte, error) {
+func (s HttpsHealthCheckListWarning) MarshalJSON() ([]byte, error) {
type NoMethod HttpsHealthCheckListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type HttpsHealthCheckListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *HttpsHealthCheckListWarningData) MarshalJSON() ([]byte, error) {
+func (s HttpsHealthCheckListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod HttpsHealthCheckListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// Image: Represents an Image resource. You can use images to create
-// boot disks for your VM instances. For more information, read Images.
+// Image: Represents an Image resource. You can use images to create boot disks
+// for your VM instances. For more information, read Images.
type Image struct {
- // Architecture: The architecture of the image. Valid values are ARM64
- // or X86_64.
+ // Architecture: The architecture of the image. Valid values are ARM64 or
+ // X86_64.
//
// Possible values:
- // "ARCHITECTURE_UNSPECIFIED" - Default value indicating Architecture
- // is not set.
+ // "ARCHITECTURE_UNSPECIFIED" - Default value indicating Architecture is not
+ // set.
// "ARM64" - Machines with architecture ARM64
// "X86_64" - Machines with architecture X86_64
Architecture string `json:"architecture,omitempty"`
-
- // ArchiveSizeBytes: Size of the image tar.gz archive stored in Google
- // Cloud Storage (in bytes).
+ // ArchiveSizeBytes: Size of the image tar.gz archive stored in Google Cloud
+ // Storage (in bytes).
ArchiveSizeBytes int64 `json:"archiveSizeBytes,omitempty,string"`
-
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
// Deprecated -- The deprecation status associated with this image.
Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // DiskSizeGb: Size of the image when restored onto a persistent disk
- // (in GB).
+ // DiskSizeGb: Size of the image when restored onto a persistent disk (in GB).
DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
-
- // EnableConfidentialCompute: Whether this image is created from a
- // confidential compute mode disk. [Output Only]: This field is not set
- // by user, but from source disk.
+ // EnableConfidentialCompute: Whether this image is created from a confidential
+ // compute mode disk. [Output Only]: This field is not set by user, but from
+ // source disk.
EnableConfidentialCompute bool `json:"enableConfidentialCompute,omitempty"`
-
- // Family: The name of the image family to which this image belongs. The
- // image family name can be from a publicly managed image family
- // provided by Compute Engine, or from a custom image family you create.
- // For example, centos-stream-9 is a publicly available image family.
- // For more information, see Image family best practices. When creating
- // disks, you can specify an image family instead of a specific image
- // name. The image family always returns its latest image that is not
- // deprecated. The name of the image family must comply with RFC1035.
+ // Family: The name of the image family to which this image belongs. The image
+ // family name can be from a publicly managed image family provided by Compute
+ // Engine, or from a custom image family you create. For example,
+ // centos-stream-9 is a publicly available image family. For more information,
+ // see Image family best practices. When creating disks, you can specify an
+ // image family instead of a specific image name. The image family always
+ // returns its latest image that is not deprecated. The name of the image
+ // family must comply with RFC1035.
Family string `json:"family,omitempty"`
-
- // GuestOsFeatures: A list of features to enable on the guest operating
- // system. Applicable only for bootable images. To see a list of
- // available options, see the guestOSfeatures[].type parameter.
+ // GuestOsFeatures: A list of features to enable on the guest operating system.
+ // Applicable only for bootable images. To see a list of available options, see
+ // the guestOSfeatures[].type parameter.
GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
- // ImageEncryptionKey: Encrypts the image using a customer-supplied
- // encryption key. After you encrypt an image with a customer-supplied
- // key, you must provide the same key if you use the image later (e.g.
- // to create a disk from the image). Customer-supplied encryption keys
- // do not protect access to metadata of the disk. If you do not provide
- // an encryption key when creating the image, then the disk will be
- // encrypted using an automatically generated key and you do not need to
- // provide a key to use the image later.
+ // ImageEncryptionKey: Encrypts the image using a customer-supplied encryption
+ // key. After you encrypt an image with a customer-supplied key, you must
+ // provide the same key if you use the image later (e.g. to create a disk from
+ // the image). Customer-supplied encryption keys do not protect access to
+ // metadata of the disk. If you do not provide an encryption key when creating
+ // the image, then the disk will be encrypted using an automatically generated
+ // key and you do not need to provide a key to use the image later.
ImageEncryptionKey *CustomerEncryptionKey `json:"imageEncryptionKey,omitempty"`
-
- // Kind: [Output Only] Type of the resource. Always compute#image for
- // images.
+ // Kind: [Output Only] Type of the resource. Always compute#image for images.
Kind string `json:"kind,omitempty"`
-
- // LabelFingerprint: A fingerprint for the labels being applied to this
- // image, which is essentially a hash of the labels used for optimistic
- // locking. The fingerprint is initially generated by Compute Engine and
- // changes after every request to modify or update labels. You must
- // always provide an up-to-date fingerprint hash in order to update or
- // change labels, otherwise the request will fail with error 412
- // conditionNotMet. To see the latest fingerprint, make a get() request
- // to retrieve an image.
+ // LabelFingerprint: A fingerprint for the labels being applied to this image,
+ // which is essentially a hash of the labels used for optimistic locking. The
+ // fingerprint is initially generated by Compute Engine and changes after every
+ // request to modify or update labels. You must always provide an up-to-date
+ // fingerprint hash in order to update or change labels, otherwise the request
+ // will fail with error 412 conditionNotMet. To see the latest fingerprint,
+ // make a get() request to retrieve an image.
LabelFingerprint string `json:"labelFingerprint,omitempty"`
-
- // Labels: Labels to apply to this image. These can be later modified by
- // the setLabels method.
+ // Labels: Labels to apply to this image. These can be later modified by the
+ // setLabels method.
Labels map[string]string `json:"labels,omitempty"`
-
- // LicenseCodes: Integer license codes indicating which licenses are
- // attached to this image.
+ // LicenseCodes: Integer license codes indicating which licenses are attached
+ // to this image.
LicenseCodes googleapi.Int64s `json:"licenseCodes,omitempty"`
-
// Licenses: Any applicable license URI.
Licenses []string `json:"licenses,omitempty"`
-
- // Name: Name of the resource; provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
- // the first character must be a lowercase letter, and all following
- // characters must be a dash, lowercase letter, or digit, except the
- // last character, which cannot be a dash.
+ // Name: Name of the resource; provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must
+ // be a lowercase letter, and all following characters must be a dash,
+ // lowercase letter, or digit, except the last character, which cannot be a
+ // dash.
Name string `json:"name,omitempty"`
-
// RawDisk: The parameters of the raw disk image.
RawDisk *ImageRawDisk `json:"rawDisk,omitempty"`
-
// SatisfiesPzi: Output only. Reserved for future use.
SatisfiesPzi bool `json:"satisfiesPzi,omitempty"`
-
// SatisfiesPzs: [Output Only] Reserved for future use.
SatisfiesPzs bool `json:"satisfiesPzs,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // ShieldedInstanceInitialState: Set the secure boot keys of shielded
- // instance.
+ // ShieldedInstanceInitialState: Set the secure boot keys of shielded instance.
ShieldedInstanceInitialState *InitialStateConfig `json:"shieldedInstanceInitialState,omitempty"`
-
- // SourceDisk: URL of the source disk used to create this image. For
- // example, the following are valid values: -
+ // SourceDisk: URL of the source disk used to create this image. For example,
+ // the following are valid values: -
// https://www.googleapis.com/compute/v1/projects/project/zones/zone
- // /disks/disk - projects/project/zones/zone/disks/disk -
- // zones/zone/disks/disk In order to create an image, you must provide
- // the full or partial URL of one of the following: - The rawDisk.source
- // URL - The sourceDisk URL - The sourceImage URL - The sourceSnapshot
- // URL
+ // /disks/disk - projects/project/zones/zone/disks/disk - zones/zone/disks/disk
+ // In order to create an image, you must provide the full or partial URL of one
+ // of the following: - The rawDisk.source URL - The sourceDisk URL - The
+ // sourceImage URL - The sourceSnapshot URL
SourceDisk string `json:"sourceDisk,omitempty"`
-
- // SourceDiskEncryptionKey: The customer-supplied encryption key of the
- // source disk. Required if the source disk is protected by a
- // customer-supplied encryption key.
+ // SourceDiskEncryptionKey: The customer-supplied encryption key of the source
+ // disk. Required if the source disk is protected by a customer-supplied
+ // encryption key.
SourceDiskEncryptionKey *CustomerEncryptionKey `json:"sourceDiskEncryptionKey,omitempty"`
-
- // SourceDiskId: [Output Only] The ID value of the disk used to create
- // this image. This value may be used to determine whether the image was
- // taken from the current or a previous instance of a given disk name.
+ // SourceDiskId: [Output Only] The ID value of the disk used to create this
+ // image. This value may be used to determine whether the image was taken from
+ // the current or a previous instance of a given disk name.
SourceDiskId string `json:"sourceDiskId,omitempty"`
-
// SourceImage: URL of the source image used to create this image. The
// following are valid formats for the URL: -
// https://www.googleapis.com/compute/v1/projects/project_id/global/
- // images/image_name - projects/project_id/global/images/image_name In
- // order to create an image, you must provide the full or partial URL of
- // one of the following: - The rawDisk.source URL - The sourceDisk URL -
- // The sourceImage URL - The sourceSnapshot URL
+ // images/image_name - projects/project_id/global/images/image_name In order to
+ // create an image, you must provide the full or partial URL of one of the
+ // following: - The rawDisk.source URL - The sourceDisk URL - The sourceImage
+ // URL - The sourceSnapshot URL
SourceImage string `json:"sourceImage,omitempty"`
-
- // SourceImageEncryptionKey: The customer-supplied encryption key of the
- // source image. Required if the source image is protected by a
- // customer-supplied encryption key.
+ // SourceImageEncryptionKey: The customer-supplied encryption key of the source
+ // image. Required if the source image is protected by a customer-supplied
+ // encryption key.
SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"`
-
- // SourceImageId: [Output Only] The ID value of the image used to create
- // this image. This value may be used to determine whether the image was
- // taken from the current or a previous instance of a given image name.
+ // SourceImageId: [Output Only] The ID value of the image used to create this
+ // image. This value may be used to determine whether the image was taken from
+ // the current or a previous instance of a given image name.
SourceImageId string `json:"sourceImageId,omitempty"`
-
- // SourceSnapshot: URL of the source snapshot used to create this image.
- // The following are valid formats for the URL: -
+ // SourceSnapshot: URL of the source snapshot used to create this image. The
+ // following are valid formats for the URL: -
// https://www.googleapis.com/compute/v1/projects/project_id/global/
- // snapshots/snapshot_name -
- // projects/project_id/global/snapshots/snapshot_name In order to create
- // an image, you must provide the full or partial URL of one of the
- // following: - The rawDisk.source URL - The sourceDisk URL - The
+ // snapshots/snapshot_name - projects/project_id/global/snapshots/snapshot_name
+ // In order to create an image, you must provide the full or partial URL of one
+ // of the following: - The rawDisk.source URL - The sourceDisk URL - The
// sourceImage URL - The sourceSnapshot URL
SourceSnapshot string `json:"sourceSnapshot,omitempty"`
-
- // SourceSnapshotEncryptionKey: The customer-supplied encryption key of
- // the source snapshot. Required if the source snapshot is protected by
- // a customer-supplied encryption key.
+ // SourceSnapshotEncryptionKey: The customer-supplied encryption key of the
+ // source snapshot. Required if the source snapshot is protected by a
+ // customer-supplied encryption key.
SourceSnapshotEncryptionKey *CustomerEncryptionKey `json:"sourceSnapshotEncryptionKey,omitempty"`
-
- // SourceSnapshotId: [Output Only] The ID value of the snapshot used to
- // create this image. This value may be used to determine whether the
- // snapshot was taken from the current or a previous instance of a given
- // snapshot name.
+ // SourceSnapshotId: [Output Only] The ID value of the snapshot used to create
+ // this image. This value may be used to determine whether the snapshot was
+ // taken from the current or a previous instance of a given snapshot name.
SourceSnapshotId string `json:"sourceSnapshotId,omitempty"`
-
- // SourceType: The type of the image used to create this disk. The
- // default and only valid value is RAW.
+ // SourceType: The type of the image used to create this disk. The default and
+ // only valid value is RAW.
//
// Possible values:
// "RAW" (default)
SourceType string `json:"sourceType,omitempty"`
-
- // Status: [Output Only] The status of the image. An image can be used
- // to create other resources, such as instances, only after the image
- // has been successfully created and the status is set to READY.
- // Possible values are FAILED, PENDING, or READY.
+ // Status: [Output Only] The status of the image. An image can be used to
+ // create other resources, such as instances, only after the image has been
+ // successfully created and the status is set to READY. Possible values are
+ // FAILED, PENDING, or READY.
//
// Possible values:
// "DELETING" - Image is deleting.
@@ -18094,2527 +15108,2566 @@ type Image struct {
// "PENDING" - Image hasn't been created as yet.
// "READY" - Image has been successfully created.
Status string `json:"status,omitempty"`
-
// StorageLocations: Cloud Storage bucket storage location of the image
// (regional or multi-regional).
StorageLocations []string `json:"storageLocations,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
// ForceSendFields is a list of field names (e.g. "Architecture") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Architecture") 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. "Architecture") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *Image) MarshalJSON() ([]byte, error) {
+func (s Image) MarshalJSON() ([]byte, error) {
type NoMethod Image
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// ImageRawDisk: The parameters of the raw disk image.
type ImageRawDisk struct {
- // ContainerType: The format used to encode and transmit the block
- // device, which should be TAR. This is just a container and
- // transmission format and not a runtime format. Provided by the client
- // when the disk image is created.
+ // ContainerType: The format used to encode and transmit the block device,
+ // which should be TAR. This is just a container and transmission format and
+ // not a runtime format. Provided by the client when the disk image is created.
//
// Possible values:
// "TAR"
ContainerType string `json:"containerType,omitempty"`
-
// Sha1Checksum: [Deprecated] This field is deprecated. An optional SHA1
- // checksum of the disk image before unpackaging provided by the client
- // when the disk image is created.
+ // checksum of the disk image before unpackaging provided by the client when
+ // the disk image is created.
Sha1Checksum string `json:"sha1Checksum,omitempty"`
-
- // Source: The full Google Cloud Storage URL where the raw disk image
- // archive is stored. The following are valid formats for the URL: -
+ // Source: The full Google Cloud Storage URL where the raw disk image archive
+ // is stored. The following are valid formats for the URL: -
// https://storage.googleapis.com/bucket_name/image_archive_name -
- // https://storage.googleapis.com/bucket_name/folder_name/
- // image_archive_name In order to create an image, you must provide the
- // full or partial URL of one of the following: - The rawDisk.source URL
- // - The sourceDisk URL - The sourceImage URL - The sourceSnapshot URL
+ // https://storage.googleapis.com/bucket_name/folder_name/ image_archive_name
+ // In order to create an image, you must provide the full or partial URL of one
+ // of the following: - The rawDisk.source URL - The sourceDisk URL - The
+ // sourceImage URL - The sourceSnapshot URL
Source string `json:"source,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "ContainerType") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "ContainerType") 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. "ContainerType") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ImageRawDisk) MarshalJSON() ([]byte, error) {
+func (s ImageRawDisk) MarshalJSON() ([]byte, error) {
type NoMethod ImageRawDisk
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ImageFamilyView struct {
- // Image: The latest image that is part of the specified image family in
- // the requested location, and that is not deprecated.
+ // Image: The latest image that is part of the specified image family in the
+ // requested location, and that is not deprecated.
Image *Image `json:"image,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Image") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Image") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Image") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ImageFamilyView) MarshalJSON() ([]byte, error) {
+func (s ImageFamilyView) MarshalJSON() ([]byte, error) {
type NoMethod ImageFamilyView
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// ImageList: Contains a list of images.
type ImageList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of Image resources.
Items []*Image `json:"items,omitempty"`
-
// Kind: Type of resource.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *ImageListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ImageList) MarshalJSON() ([]byte, error) {
+func (s ImageList) MarshalJSON() ([]byte, error) {
type NoMethod ImageList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// ImageListWarning: [Output Only] Informational warning message.
type ImageListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*ImageListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ImageListWarning) MarshalJSON() ([]byte, error) {
+func (s ImageListWarning) MarshalJSON() ([]byte, error) {
type NoMethod ImageListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ImageListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ImageListWarningData) MarshalJSON() ([]byte, error) {
+func (s ImageListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod ImageListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// InitialStateConfig: Initial State for shielded instance, these are
-// public keys which are safe to store in public
+// InitialStateConfig: Initial State for shielded instance, these are public
+// keys which are safe to store in public
type InitialStateConfig struct {
// Dbs: The Key Database (db).
Dbs []*FileContentBuffer `json:"dbs,omitempty"`
-
// Dbxs: The forbidden key database (dbx).
Dbxs []*FileContentBuffer `json:"dbxs,omitempty"`
-
// Keks: The Key Exchange Key (KEK).
Keks []*FileContentBuffer `json:"keks,omitempty"`
-
// Pk: The Platform Key (PK).
Pk *FileContentBuffer `json:"pk,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Dbs") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Dbs") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Dbs") 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. "Dbs") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InitialStateConfig) MarshalJSON() ([]byte, error) {
+func (s InitialStateConfig) MarshalJSON() ([]byte, error) {
type NoMethod InitialStateConfig
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// Instance: Represents an Instance resource. An instance is a virtual
-// machine that is hosted on Google Cloud Platform. For more
-// information, read Virtual Machine Instances.
+// Instance: Represents an Instance resource. An instance is a virtual machine
+// that is hosted on Google Cloud Platform. For more information, read Virtual
+// Machine Instances.
type Instance struct {
- // AdvancedMachineFeatures: Controls for advanced machine-related
- // behavior features.
+ // AdvancedMachineFeatures: Controls for advanced machine-related behavior
+ // features.
AdvancedMachineFeatures *AdvancedMachineFeatures `json:"advancedMachineFeatures,omitempty"`
-
// CanIpForward: Allows this instance to send and receive packets with
- // non-matching destination or source IPs. This is required if you plan
- // to use this instance to forward routes. For more information, see
- // Enabling IP Forwarding .
- CanIpForward bool `json:"canIpForward,omitempty"`
-
+ // non-matching destination or source IPs. This is required if you plan to use
+ // this instance to forward routes. For more information, see Enabling IP
+ // Forwarding .
+ CanIpForward bool `json:"canIpForward,omitempty"`
ConfidentialInstanceConfig *ConfidentialInstanceConfig `json:"confidentialInstanceConfig,omitempty"`
-
// CpuPlatform: [Output Only] The CPU platform used by this instance.
CpuPlatform string `json:"cpuPlatform,omitempty"`
-
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
// DeletionProtection: Whether the resource should be protected against
// deletion.
DeletionProtection bool `json:"deletionProtection,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // Disks: Array of disks associated with this instance. Persistent disks
- // must be created before you can assign them.
+ // Disks: Array of disks associated with this instance. Persistent disks must
+ // be created before you can assign them.
Disks []*AttachedDisk `json:"disks,omitempty"`
-
// DisplayDevice: Enables display device for the instance.
DisplayDevice *DisplayDevice `json:"displayDevice,omitempty"`
-
- // Fingerprint: Specifies a fingerprint for this resource, which is
- // essentially a hash of the instance's contents and used for optimistic
- // locking. The fingerprint is initially generated by Compute Engine and
- // changes after every request to modify or update the instance. You
- // must always provide an up-to-date fingerprint hash in order to update
- // the instance. To see the latest fingerprint, make get() request to
- // the instance.
+ // Fingerprint: Specifies a fingerprint for this resource, which is essentially
+ // a hash of the instance's contents and used for optimistic locking. The
+ // fingerprint is initially generated by Compute Engine and changes after every
+ // request to modify or update the instance. You must always provide an
+ // up-to-date fingerprint hash in order to update the instance. To see the
+ // latest fingerprint, make get() request to the instance.
Fingerprint string `json:"fingerprint,omitempty"`
-
// GuestAccelerators: A list of the type and count of accelerator cards
// attached to the instance.
GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
-
- // Hostname: Specifies the hostname of the instance. The specified
- // hostname must be RFC1035 compliant. If hostname is not specified, the
- // default hostname is [INSTANCE_NAME].c.[PROJECT_ID].internal when
- // using the global DNS, and
- // [INSTANCE_NAME].[ZONE].c.[PROJECT_ID].internal when using zonal DNS.
+ // Hostname: Specifies the hostname of the instance. The specified hostname
+ // must be RFC1035 compliant. If hostname is not specified, the default
+ // hostname is [INSTANCE_NAME].c.[PROJECT_ID].internal when using the global
+ // DNS, and [INSTANCE_NAME].[ZONE].c.[PROJECT_ID].internal when using zonal
+ // DNS.
Hostname string `json:"hostname,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
// InstanceEncryptionKey: Encrypts suspended data for an instance with a
- // customer-managed encryption key. If you are creating a new instance,
- // this field will encrypt the local SSD and in-memory contents of the
- // instance during the suspend operation. If you do not provide an
- // encryption key when creating the instance, then the local SSD and
- // in-memory contents will be encrypted using an automatically generated
- // key during the suspend operation.
+ // customer-managed encryption key. If you are creating a new instance, this
+ // field will encrypt the local SSD and in-memory contents of the instance
+ // during the suspend operation. If you do not provide an encryption key when
+ // creating the instance, then the local SSD and in-memory contents will be
+ // encrypted using an automatically generated key during the suspend operation.
InstanceEncryptionKey *CustomerEncryptionKey `json:"instanceEncryptionKey,omitempty"`
-
- // KeyRevocationActionType: KeyRevocationActionType of the instance.
- // Supported options are "STOP" and "NONE". The default value is "NONE"
- // if it is not specified.
+ // KeyRevocationActionType: KeyRevocationActionType of the instance. Supported
+ // options are "STOP" and "NONE". The default value is "NONE" if it is not
+ // specified.
//
// Possible values:
- // "KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED" - Default value. This
- // value is unused.
+ // "KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED" - Default value. This value is
+ // unused.
// "NONE" - Indicates user chose no operation.
- // "STOP" - Indicates user chose to opt for VM shutdown on key
- // revocation.
+ // "STOP" - Indicates user chose to opt for VM shutdown on key revocation.
KeyRevocationActionType string `json:"keyRevocationActionType,omitempty"`
-
// Kind: [Output Only] Type of the resource. Always compute#instance for
// instances.
Kind string `json:"kind,omitempty"`
-
- // LabelFingerprint: A fingerprint for this request, which is
- // essentially a hash of the label's contents and used for optimistic
- // locking. The fingerprint is initially generated by Compute Engine and
- // changes after every request to modify or update labels. You must
- // always provide an up-to-date fingerprint hash in order to update or
- // change labels. To see the latest fingerprint, make get() request to
- // the instance.
+ // LabelFingerprint: A fingerprint for this request, which is essentially a
+ // hash of the label's contents and used for optimistic locking. The
+ // fingerprint is initially generated by Compute Engine and changes after every
+ // request to modify or update labels. You must always provide an up-to-date
+ // fingerprint hash in order to update or change labels. To see the latest
+ // fingerprint, make get() request to the instance.
LabelFingerprint string `json:"labelFingerprint,omitempty"`
-
- // Labels: Labels to apply to this instance. These can be later modified
- // by the setLabels method.
+ // Labels: Labels to apply to this instance. These can be later modified by the
+ // setLabels method.
Labels map[string]string `json:"labels,omitempty"`
-
- // LastStartTimestamp: [Output Only] Last start timestamp in RFC3339
- // text format.
- LastStartTimestamp string `json:"lastStartTimestamp,omitempty"`
-
- // LastStopTimestamp: [Output Only] Last stop timestamp in RFC3339 text
+ // LastStartTimestamp: [Output Only] Last start timestamp in RFC3339 text
// format.
+ LastStartTimestamp string `json:"lastStartTimestamp,omitempty"`
+ // LastStopTimestamp: [Output Only] Last stop timestamp in RFC3339 text format.
LastStopTimestamp string `json:"lastStopTimestamp,omitempty"`
-
- // LastSuspendedTimestamp: [Output Only] Last suspended timestamp in
- // RFC3339 text format.
+ // LastSuspendedTimestamp: [Output Only] Last suspended timestamp in RFC3339
+ // text format.
LastSuspendedTimestamp string `json:"lastSuspendedTimestamp,omitempty"`
-
- // MachineType: Full or partial URL of the machine type resource to use
- // for this instance, in the format:
- // zones/zone/machineTypes/machine-type. This is provided by the client
- // when the instance is created. For example, the following is a valid
- // partial url to a predefined machine type:
- // zones/us-central1-f/machineTypes/n1-standard-1 To create a custom
- // machine type, provide a URL to a machine type in the following
- // format, where CPUS is 1 or an even number up to 32 (2, 4, 6, ... 24,
- // etc), and MEMORY is the total memory for this instance. Memory must
- // be a multiple of 256 MB and must be supplied in MB (e.g. 5 GB of
- // memory is 5120 MB): zones/zone/machineTypes/custom-CPUS-MEMORY For
- // example: zones/us-central1-f/machineTypes/custom-4-5120 For a full
- // list of restrictions, read the Specifications for custom machine
- // types.
+ // MachineType: Full or partial URL of the machine type resource to use for
+ // this instance, in the format: zones/zone/machineTypes/machine-type. This is
+ // provided by the client when the instance is created. For example, the
+ // following is a valid partial url to a predefined machine type:
+ // zones/us-central1-f/machineTypes/n1-standard-1 To create a custom machine
+ // type, provide a URL to a machine type in the following format, where CPUS is
+ // 1 or an even number up to 32 (2, 4, 6, ... 24, etc), and MEMORY is the total
+ // memory for this instance. Memory must be a multiple of 256 MB and must be
+ // supplied in MB (e.g. 5 GB of memory is 5120 MB):
+ // zones/zone/machineTypes/custom-CPUS-MEMORY For example:
+ // zones/us-central1-f/machineTypes/custom-4-5120 For a full list of
+ // restrictions, read the Specifications for custom machine types.
MachineType string `json:"machineType,omitempty"`
-
- // Metadata: The metadata key/value pairs assigned to this instance.
- // This includes custom metadata and predefined keys.
+ // Metadata: The metadata key/value pairs assigned to this instance. This
+ // includes custom metadata and predefined keys.
Metadata *Metadata `json:"metadata,omitempty"`
-
// MinCpuPlatform: Specifies a minimum CPU platform for the VM instance.
// Applicable values are the friendly names of CPU platforms, such as
- // minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy
- // Bridge".
+ // minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy Bridge".
MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
-
// Name: The name of the resource, provided by the client when initially
- // creating the resource. The resource name must be 1-63 characters
- // long, and comply with RFC1035. Specifically, the name must be 1-63
- // characters long and match the regular expression
- // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
- // a lowercase letter, and all following characters must be a dash,
- // lowercase letter, or digit, except the last character, which cannot
- // be a dash.
+ // creating the resource. The resource name must be 1-63 characters long, and
+ // comply with RFC1035. Specifically, the name must be 1-63 characters long and
+ // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the
+ // first character must be a lowercase letter, and all following characters
+ // must be a dash, lowercase letter, or digit, except the last character, which
+ // cannot be a dash.
Name string `json:"name,omitempty"`
-
- // NetworkInterfaces: An array of network configurations for this
- // instance. These specify how interfaces are configured to interact
- // with other network services, such as connecting to the internet.
- // Multiple interfaces are supported per instance.
- NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"`
-
+ // NetworkInterfaces: An array of network configurations for this instance.
+ // These specify how interfaces are configured to interact with other network
+ // services, such as connecting to the internet. Multiple interfaces are
+ // supported per instance.
+ NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"`
NetworkPerformanceConfig *NetworkPerformanceConfig `json:"networkPerformanceConfig,omitempty"`
-
- // Params: Input only. [Input Only] Additional params passed with the
- // request, but not persisted as part of resource payload.
+ // Params: Input only. [Input Only] Additional params passed with the request,
+ // but not persisted as part of resource payload.
Params *InstanceParams `json:"params,omitempty"`
-
- // PrivateIpv6GoogleAccess: The private IPv6 google access type for the
- // VM. If not specified, use INHERIT_FROM_SUBNETWORK as default.
- //
- // Possible values:
- // "ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE" - Bidirectional private
- // IPv6 access to/from Google services. If specified, the subnetwork who
- // is attached to the instance's default network interface will be
- // assigned an internal IPv6 prefix if it doesn't have before.
- // "ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE" - Outbound private IPv6
- // access from VMs in this subnet to Google services. If specified, the
- // subnetwork who is attached to the instance's default network
- // interface will be assigned an internal IPv6 prefix if it doesn't have
- // before.
+ // PrivateIpv6GoogleAccess: The private IPv6 google access type for the VM. If
+ // not specified, use INHERIT_FROM_SUBNETWORK as default.
+ //
+ // Possible values:
+ // "ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE" - Bidirectional private IPv6
+ // access to/from Google services. If specified, the subnetwork who is attached
+ // to the instance's default network interface will be assigned an internal
+ // IPv6 prefix if it doesn't have before.
+ // "ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE" - Outbound private IPv6 access from
+ // VMs in this subnet to Google services. If specified, the subnetwork who is
+ // attached to the instance's default network interface will be assigned an
+ // internal IPv6 prefix if it doesn't have before.
// "INHERIT_FROM_SUBNETWORK" - Each network interface inherits
// PrivateIpv6GoogleAccess from its subnetwork.
PrivateIpv6GoogleAccess string `json:"privateIpv6GoogleAccess,omitempty"`
-
- // ReservationAffinity: Specifies the reservations that this instance
- // can consume from.
+ // ReservationAffinity: Specifies the reservations that this instance can
+ // consume from.
ReservationAffinity *ReservationAffinity `json:"reservationAffinity,omitempty"`
-
// ResourcePolicies: Resource policies applied to this instance.
ResourcePolicies []string `json:"resourcePolicies,omitempty"`
-
- // ResourceStatus: [Output Only] Specifies values set for instance
- // attributes as compared to the values requested by user in the
- // corresponding input only field.
+ // ResourceStatus: [Output Only] Specifies values set for instance attributes
+ // as compared to the values requested by user in the corresponding input only
+ // field.
ResourceStatus *ResourceStatus `json:"resourceStatus,omitempty"`
-
// SatisfiesPzi: [Output Only] Reserved for future use.
SatisfiesPzi bool `json:"satisfiesPzi,omitempty"`
-
// SatisfiesPzs: [Output Only] Reserved for future use.
SatisfiesPzs bool `json:"satisfiesPzs,omitempty"`
-
// Scheduling: Sets the scheduling options for this instance.
Scheduling *Scheduling `json:"scheduling,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // ServiceAccounts: A list of service accounts, with their specified
- // scopes, authorized for this instance. Only one service account per VM
- // instance is supported. Service accounts generate access tokens that
- // can be accessed through the metadata server and used to authenticate
- // applications on the instance. See Service Accounts for more
- // information.
- ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"`
-
- ShieldedInstanceConfig *ShieldedInstanceConfig `json:"shieldedInstanceConfig,omitempty"`
-
+ // ServiceAccounts: A list of service accounts, with their specified scopes,
+ // authorized for this instance. Only one service account per VM instance is
+ // supported. Service accounts generate access tokens that can be accessed
+ // through the metadata server and used to authenticate applications on the
+ // instance. See Service Accounts for more information.
+ ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"`
+ ShieldedInstanceConfig *ShieldedInstanceConfig `json:"shieldedInstanceConfig,omitempty"`
ShieldedInstanceIntegrityPolicy *ShieldedInstanceIntegrityPolicy `json:"shieldedInstanceIntegrityPolicy,omitempty"`
-
// SourceMachineImage: Source machine image
SourceMachineImage string `json:"sourceMachineImage,omitempty"`
-
- // SourceMachineImageEncryptionKey: Source machine image encryption key
- // when creating an instance from a machine image.
+ // SourceMachineImageEncryptionKey: Source machine image encryption key when
+ // creating an instance from a machine image.
SourceMachineImageEncryptionKey *CustomerEncryptionKey `json:"sourceMachineImageEncryptionKey,omitempty"`
-
- // StartRestricted: [Output Only] Whether a VM has been restricted for
- // start because Compute Engine has detected suspicious activity.
+ // StartRestricted: [Output Only] Whether a VM has been restricted for start
+ // because Compute Engine has detected suspicious activity.
StartRestricted bool `json:"startRestricted,omitempty"`
-
- // Status: [Output Only] The status of the instance. One of the
- // following values: PROVISIONING, STAGING, RUNNING, STOPPING,
- // SUSPENDING, SUSPENDED, REPAIRING, and TERMINATED. For more
- // information about the status of the instance, see Instance life
- // cycle.
+ // Status: [Output Only] The status of the instance. One of the following
+ // values: PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDING, SUSPENDED,
+ // REPAIRING, and TERMINATED. For more information about the status of the
+ // instance, see Instance life cycle.
//
// Possible values:
- // "DEPROVISIONING" - The instance is halted and we are performing
- // tear down tasks like network deprogramming, releasing quota, IP,
- // tearing down disks etc.
+ // "DEPROVISIONING" - The instance is halted and we are performing tear down
+ // tasks like network deprogramming, releasing quota, IP, tearing down disks
+ // etc.
// "PROVISIONING" - Resources are being allocated for the instance.
// "REPAIRING" - The instance is in repair.
// "RUNNING" - The instance is running.
- // "STAGING" - All required resources have been allocated and the
- // instance is being started.
+ // "STAGING" - All required resources have been allocated and the instance is
+ // being started.
// "STOPPED" - The instance has stopped successfully.
- // "STOPPING" - The instance is currently stopping (either being
- // deleted or killed).
+ // "STOPPING" - The instance is currently stopping (either being deleted or
+ // killed).
// "SUSPENDED" - The instance has suspended.
// "SUSPENDING" - The instance is suspending.
- // "TERMINATED" - The instance has stopped (either by explicit action
- // or underlying failure).
+ // "TERMINATED" - The instance has stopped (either by explicit action or
+ // underlying failure).
Status string `json:"status,omitempty"`
-
- // StatusMessage: [Output Only] An optional, human-readable explanation
- // of the status.
+ // StatusMessage: [Output Only] An optional, human-readable explanation of the
+ // status.
StatusMessage string `json:"statusMessage,omitempty"`
-
// Tags: Tags to apply to this instance. Tags are used to identify valid
- // sources or targets for network firewalls and are specified by the
- // client during instance creation. The tags can be later modified by
- // the setTags method. Each tag within the list must comply with
- // RFC1035. Multiple tags can be specified via the 'tags.items' field.
+ // sources or targets for network firewalls and are specified by the client
+ // during instance creation. The tags can be later modified by the setTags
+ // method. Each tag within the list must comply with RFC1035. Multiple tags can
+ // be specified via the 'tags.items' field.
Tags *Tags `json:"tags,omitempty"`
-
- // Zone: [Output Only] URL of the zone where the instance resides. You
- // must specify this field as part of the HTTP request URL. It is not
- // settable as a field in the request body.
+ // Zone: [Output Only] URL of the zone where the instance resides. You must
+ // specify this field as part of the HTTP request URL. It is not settable as a
+ // field in the request body.
Zone string `json:"zone,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g.
- // "AdvancedMachineFeatures") to unconditionally include in API
- // requests. By default, fields with empty or default 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. "AdvancedMachineFeatures")
- // 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.
+ // ForceSendFields is a list of field names (e.g. "AdvancedMachineFeatures") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "AdvancedMachineFeatures") to
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *Instance) MarshalJSON() ([]byte, error) {
+func (s Instance) MarshalJSON() ([]byte, error) {
type NoMethod Instance
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceAggregatedList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: An object that contains a list of instances scoped by zone.
Items map[string]InstancesScopedList `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource. Always
- // compute#instanceAggregatedList for aggregated lists of Instance
- // resources.
+ // Kind: [Output Only] Type of resource. Always compute#instanceAggregatedList
+ // for aggregated lists of Instance resources.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Unreachables: [Output Only] Unreachable resources.
Unreachables []string `json:"unreachables,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *InstanceAggregatedListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceAggregatedList) MarshalJSON() ([]byte, error) {
+func (s InstanceAggregatedList) MarshalJSON() ([]byte, error) {
type NoMethod InstanceAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// InstanceAggregatedListWarning: [Output Only] Informational warning
-// message.
+// InstanceAggregatedListWarning: [Output Only] Informational warning message.
type InstanceAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*InstanceAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceAggregatedListWarning) MarshalJSON() ([]byte, error) {
+func (s InstanceAggregatedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod InstanceAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+func (s InstanceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod InstanceAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceConsumptionData struct {
// ConsumptionInfo: Resources consumed by the instance.
ConsumptionInfo *InstanceConsumptionInfo `json:"consumptionInfo,omitempty"`
-
// Instance: Server-defined URL for the instance.
Instance string `json:"instance,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "ConsumptionInfo") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "ConsumptionInfo") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "ConsumptionInfo") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceConsumptionData) MarshalJSON() ([]byte, error) {
+func (s InstanceConsumptionData) MarshalJSON() ([]byte, error) {
type NoMethod InstanceConsumptionData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceConsumptionInfo struct {
- // GuestCpus: The number of virtual CPUs that are available to the
- // instance.
+ // GuestCpus: The number of virtual CPUs that are available to the instance.
GuestCpus int64 `json:"guestCpus,omitempty"`
-
- // LocalSsdGb: The amount of local SSD storage available to the
- // instance, defined in GiB.
+ // LocalSsdGb: The amount of local SSD storage available to the instance,
+ // defined in GiB.
LocalSsdGb int64 `json:"localSsdGb,omitempty"`
-
- // MemoryMb: The amount of physical memory available to the instance,
- // defined in MiB.
+ // MemoryMb: The amount of physical memory available to the instance, defined
+ // in MiB.
MemoryMb int64 `json:"memoryMb,omitempty"`
-
// MinNodeCpus: The minimal guaranteed number of virtual CPUs that are
// reserved.
MinNodeCpus int64 `json:"minNodeCpus,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "GuestCpus") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "GuestCpus") 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. "GuestCpus") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceConsumptionInfo) MarshalJSON() ([]byte, error) {
+func (s InstanceConsumptionInfo) MarshalJSON() ([]byte, error) {
type NoMethod InstanceConsumptionInfo
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// InstanceGroup: Represents an Instance Group resource. Instance Groups
-// can be used to configure a target for load balancing. Instance groups
-// can either be managed or unmanaged. To create managed instance
-// groups, use the instanceGroupManager or regionInstanceGroupManager
-// resource instead. Use zonal unmanaged instance groups if you need to
-// apply load balancing to groups of heterogeneous instances or if you
-// need to manage the instances yourself. You cannot create regional
-// unmanaged instance groups. For more information, read Instance
-// groups.
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+// InstanceGroup: Represents an Instance Group resource. Instance Groups can be
+// used to configure a target for load balancing. Instance groups can either be
+// managed or unmanaged. To create managed instance groups, use the
+// instanceGroupManager or regionInstanceGroupManager resource instead. Use
+// zonal unmanaged instance groups if you need to apply load balancing to
+// groups of heterogeneous instances or if you need to manage the instances
+// yourself. You cannot create regional unmanaged instance groups. For more
+// information, read Instance groups.
type InstanceGroup struct {
- // CreationTimestamp: [Output Only] The creation timestamp for this
- // instance group in RFC3339 text format.
+ // CreationTimestamp: [Output Only] The creation timestamp for this instance
+ // group in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // Fingerprint: [Output Only] The fingerprint of the named ports. The
- // system uses this fingerprint to detect conflicts when multiple users
- // change the named ports concurrently.
+ // Fingerprint: [Output Only] The fingerprint of the named ports. The system
+ // uses this fingerprint to detect conflicts when multiple users change the
+ // named ports concurrently.
Fingerprint string `json:"fingerprint,omitempty"`
-
- // Id: [Output Only] A unique identifier for this instance group,
- // generated by the server.
+ // Id: [Output Only] A unique identifier for this instance group, generated by
+ // the server.
Id uint64 `json:"id,omitempty,string"`
-
- // Kind: [Output Only] The resource type, which is always
- // compute#instanceGroup for instance groups.
+ // Kind: [Output Only] The resource type, which is always compute#instanceGroup
+ // for instance groups.
Kind string `json:"kind,omitempty"`
-
- // Name: The name of the instance group. The name must be 1-63
- // characters long, and comply with RFC1035.
+ // Name: The name of the instance group. The name must be 1-63 characters long,
+ // and comply with RFC1035.
Name string `json:"name,omitempty"`
-
- // NamedPorts: Assigns a name to a port number. For example: {name:
- // "http", port: 80} This allows the system to reference ports by the
- // assigned name instead of a port number. Named ports can also contain
- // multiple ports. For example: [{name: "app1", port: 8080}, {name:
- // "app1", port: 8081}, {name: "app2", port: 8082}] Named ports apply to
- // all instances in this instance group.
+ // NamedPorts: Assigns a name to a port number. For example: {name: "http",
+ // port: 80} This allows the system to reference ports by the assigned name
+ // instead of a port number. Named ports can also contain multiple ports. For
+ // example: [{name: "app1", port: 8080}, {name: "app1", port: 8081}, {name:
+ // "app2", port: 8082}] Named ports apply to all instances in this instance
+ // group.
NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
-
- // Network: [Output Only] The URL of the network to which all instances
- // in the instance group belong. If your instance has multiple network
- // interfaces, then the network and subnetwork fields only refer to the
- // network and subnet used by your primary interface (nic0).
+ // Network: [Output Only] The URL of the network to which all instances in the
+ // instance group belong. If your instance has multiple network interfaces,
+ // then the network and subnetwork fields only refer to the network and subnet
+ // used by your primary interface (nic0).
Network string `json:"network,omitempty"`
-
- // Region: [Output Only] The URL of the region where the instance group
- // is located (for regional resources).
+ // Region: [Output Only] The URL of the region where the instance group is
+ // located (for regional resources).
Region string `json:"region,omitempty"`
-
// SelfLink: [Output Only] The URL for this instance group. The server
// generates this URL.
SelfLink string `json:"selfLink,omitempty"`
-
- // Size: [Output Only] The total number of instances in the instance
- // group.
+ // Size: [Output Only] The total number of instances in the instance group.
Size int64 `json:"size,omitempty"`
-
- // Subnetwork: [Output Only] The URL of the subnetwork to which all
- // instances in the instance group belong. If your instance has multiple
- // network interfaces, then the network and subnetwork fields only refer
- // to the network and subnet used by your primary interface (nic0).
+ // Subnetwork: [Output Only] The URL of the subnetwork to which all instances
+ // in the instance group belong. If your instance has multiple network
+ // interfaces, then the network and subnetwork fields only refer to the network
+ // and subnet used by your primary interface (nic0).
Subnetwork string `json:"subnetwork,omitempty"`
-
- // Zone: [Output Only] The URL of the zone where the instance group is
- // located (for zonal resources).
+ // Zone: [Output Only] The URL of the zone where the instance group is located
+ // (for zonal resources).
Zone string `json:"zone,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "CreationTimestamp") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CreationTimestamp") 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. "CreationTimestamp") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroup) MarshalJSON() ([]byte, error) {
+func (s InstanceGroup) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroup
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceGroupAggregatedList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of InstanceGroupsScopedList resources.
Items map[string]InstanceGroupsScopedList `json:"items,omitempty"`
-
// Kind: [Output Only] The resource type, which is always
- // compute#instanceGroupAggregatedList for aggregated lists of instance
- // groups.
+ // compute#instanceGroupAggregatedList for aggregated lists of instance groups.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Unreachables: [Output Only] Unreachable resources.
Unreachables []string `json:"unreachables,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *InstanceGroupAggregatedListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupAggregatedList) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupAggregatedList) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// InstanceGroupAggregatedListWarning: [Output Only] Informational
-// warning message.
+// InstanceGroupAggregatedListWarning: [Output Only] Informational warning
+// message.
type InstanceGroupAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*InstanceGroupAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupAggregatedListWarning) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupAggregatedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceGroupAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupAggregatedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// InstanceGroupList: A list of InstanceGroup resources.
type InstanceGroupList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of InstanceGroup resources.
Items []*InstanceGroup `json:"items,omitempty"`
-
// Kind: [Output Only] The resource type, which is always
// compute#instanceGroupList for instance group lists.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *InstanceGroupListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupList) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupList) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// InstanceGroupListWarning: [Output Only] Informational warning
-// message.
+// InstanceGroupListWarning: [Output Only] Informational warning message.
type InstanceGroupListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*InstanceGroupListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupListWarning) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupListWarning) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceGroupListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupListWarningData) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// InstanceGroupManager: Represents a Managed Instance Group resource.
-// An instance group is a collection of VM instances that you can manage
-// as a single entity. For more information, read Instance groups. For
-// zonal Managed Instance Group, use the instanceGroupManagers resource.
-// For regional Managed Instance Group, use the
-// regionInstanceGroupManagers resource.
+// InstanceGroupManager: Represents a Managed Instance Group resource. An
+// instance group is a collection of VM instances that you can manage as a
+// single entity. For more information, read Instance groups. For zonal Managed
+// Instance Group, use the instanceGroupManagers resource. For regional Managed
+// Instance Group, use the regionInstanceGroupManagers resource.
type InstanceGroupManager struct {
- // AutoHealingPolicies: The autohealing policy for this managed instance
- // group. You can specify only one value.
+ // AllInstancesConfig: Specifies configuration that overrides the instance
+ // template configuration for the group.
+ AllInstancesConfig *InstanceGroupManagerAllInstancesConfig `json:"allInstancesConfig,omitempty"`
+ // AutoHealingPolicies: The autohealing policy for this managed instance group.
+ // You can specify only one value.
AutoHealingPolicies []*InstanceGroupManagerAutoHealingPolicy `json:"autoHealingPolicies,omitempty"`
-
- // BaseInstanceName: The base instance name to use for instances in this
- // group. The value must be 1-58 characters long. Instances are named by
- // appending a hyphen and a random four-character string to the base
- // instance name. The base instance name must comply with RFC1035.
+ // BaseInstanceName: The base instance name is a prefix that you want to attach
+ // to the names of all VMs in a MIG. The maximum character length is 58 and the
+ // name must comply with RFC1035 format. When a VM is created in the group, the
+ // MIG appends a hyphen and a random four-character string to the base instance
+ // name. If you want the MIG to assign sequential numbers instead of a random
+ // string, then end the base instance name with a hyphen followed by one or
+ // more hash symbols. The hash symbols indicate the number of digits. For
+ // example, a base instance name of "vm-###" results in "vm-001" as a VM name.
+ // @pattern a-z
+ // (([-a-z0-9]{0,57})|([-a-z0-9]{0,51}-#{1,10}(\\[[0-9]{1,10}\\])?))
BaseInstanceName string `json:"baseInstanceName,omitempty"`
-
- // CreationTimestamp: [Output Only] The creation timestamp for this
- // managed instance group in RFC3339 text format.
+ // CreationTimestamp: [Output Only] The creation timestamp for this managed
+ // instance group in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // CurrentActions: [Output Only] The list of instance actions and the
- // number of instances in this managed instance group that are scheduled
- // for each of those actions.
+ // CurrentActions: [Output Only] The list of instance actions and the number of
+ // instances in this managed instance group that are scheduled for each of
+ // those actions.
CurrentActions *InstanceGroupManagerActionsSummary `json:"currentActions,omitempty"`
-
// Description: An optional description of this resource.
Description string `json:"description,omitempty"`
-
- // DistributionPolicy: Policy specifying the intended distribution of
- // managed instances across zones in a regional managed instance group.
+ // DistributionPolicy: Policy specifying the intended distribution of managed
+ // instances across zones in a regional managed instance group.
DistributionPolicy *DistributionPolicy `json:"distributionPolicy,omitempty"`
-
// Fingerprint: Fingerprint of this resource. This field may be used in
// optimistic locking. It will be ignored when inserting an
- // InstanceGroupManager. An up-to-date fingerprint must be provided in
- // order to update the InstanceGroupManager, otherwise the request will
- // fail with error 412 conditionNotMet. To see the latest fingerprint,
- // make a get() request to retrieve an InstanceGroupManager.
+ // InstanceGroupManager. An up-to-date fingerprint must be provided in order to
+ // update the InstanceGroupManager, otherwise the request will fail with error
+ // 412 conditionNotMet. To see the latest fingerprint, make a get() request to
+ // retrieve an InstanceGroupManager.
Fingerprint string `json:"fingerprint,omitempty"`
-
- // Id: [Output Only] A unique identifier for this resource type. The
- // server generates this identifier.
+ // Id: [Output Only] A unique identifier for this resource type. The server
+ // generates this identifier.
Id uint64 `json:"id,omitempty,string"`
-
+ // InstanceFlexibilityPolicy: Instance flexibility allowing MIG to create VMs
+ // from multiple types of machines. Instance flexibility configuration on MIG
+ // overrides instance template configuration.
+ InstanceFlexibilityPolicy *InstanceGroupManagerInstanceFlexibilityPolicy `json:"instanceFlexibilityPolicy,omitempty"`
// InstanceGroup: [Output Only] The URL of the Instance Group resource.
InstanceGroup string `json:"instanceGroup,omitempty"`
-
- // InstanceLifecyclePolicy: The repair policy for this managed instance
- // group.
+ // InstanceLifecyclePolicy: The repair policy for this managed instance group.
InstanceLifecyclePolicy *InstanceGroupManagerInstanceLifecyclePolicy `json:"instanceLifecyclePolicy,omitempty"`
-
- // InstanceTemplate: The URL of the instance template that is specified
- // for this managed instance group. The group uses this template to
- // create all new instances in the managed instance group. The templates
- // for existing instances in the group do not change unless you run
- // recreateInstances, run applyUpdatesToInstances, or set the group's
- // updatePolicy.type to PROACTIVE.
+ // InstanceTemplate: The URL of the instance template that is specified for
+ // this managed instance group. The group uses this template to create all new
+ // instances in the managed instance group. The templates for existing
+ // instances in the group do not change unless you run recreateInstances, run
+ // applyUpdatesToInstances, or set the group's updatePolicy.type to PROACTIVE.
InstanceTemplate string `json:"instanceTemplate,omitempty"`
-
// Kind: [Output Only] The resource type, which is always
// compute#instanceGroupManager for managed instance groups.
Kind string `json:"kind,omitempty"`
-
- // ListManagedInstancesResults: Pagination behavior of the
- // listManagedInstances API method for this managed instance group.
+ // ListManagedInstancesResults: Pagination behavior of the listManagedInstances
+ // API method for this managed instance group.
//
// Possible values:
// "PAGELESS" - (Default) Pagination is disabled for the group's
- // listManagedInstances API method. maxResults and pageToken query
- // parameters are ignored and all instances are returned in a single
- // response.
- // "PAGINATED" - Pagination is enabled for the group's
- // listManagedInstances API method. maxResults and pageToken query
- // parameters are respected.
+ // listManagedInstances API method. maxResults and pageToken query parameters
+ // are ignored and all instances are returned in a single response.
+ // "PAGINATED" - Pagination is enabled for the group's listManagedInstances
+ // API method. maxResults and pageToken query parameters are respected.
ListManagedInstancesResults string `json:"listManagedInstancesResults,omitempty"`
-
// Name: The name of the managed instance group. The name must be 1-63
// characters long, and comply with RFC1035.
Name string `json:"name,omitempty"`
-
- // NamedPorts: Named ports configured for the Instance Groups
+ // NamedPorts: [Output Only] Named ports configured on the Instance Groups
// complementary to this Instance Group Manager.
NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
-
- // Region: [Output Only] The URL of the region where the managed
- // instance group resides (for regional resources).
+ // Region: [Output Only] The URL of the region where the managed instance group
+ // resides (for regional resources).
Region string `json:"region,omitempty"`
-
- // SelfLink: [Output Only] The URL for this managed instance group. The
- // server defines this URL.
+ // SatisfiesPzi: [Output Only] Reserved for future use.
+ SatisfiesPzi bool `json:"satisfiesPzi,omitempty"`
+ // SatisfiesPzs: [Output Only] Reserved for future use.
+ SatisfiesPzs bool `json:"satisfiesPzs,omitempty"`
+ // SelfLink: [Output Only] The URL for this managed instance group. The server
+ // defines this URL.
SelfLink string `json:"selfLink,omitempty"`
-
- // StatefulPolicy: Stateful configuration for this Instanced Group
- // Manager
+ // StatefulPolicy: Stateful configuration for this Instanced Group Manager
StatefulPolicy *StatefulPolicy `json:"statefulPolicy,omitempty"`
-
// Status: [Output Only] The status of this managed instance group.
Status *InstanceGroupManagerStatus `json:"status,omitempty"`
-
- // TargetPools: The URLs for all TargetPool resources to which instances
- // in the instanceGroup field are added. The target pools automatically
- // apply to all of the instances in the managed instance group.
+ // TargetPools: The URLs for all TargetPool resources to which instances in the
+ // instanceGroup field are added. The target pools automatically apply to all
+ // of the instances in the managed instance group.
TargetPools []string `json:"targetPools,omitempty"`
-
- // TargetSize: The target number of running instances for this managed
- // instance group. You can reduce this number by using the
- // instanceGroupManager deleteInstances or abandonInstances methods.
- // Resizing the group also changes this number.
+ // TargetSize: The target number of running instances for this managed instance
+ // group. You can reduce this number by using the instanceGroupManager
+ // deleteInstances or abandonInstances methods. Resizing the group also changes
+ // this number.
TargetSize int64 `json:"targetSize,omitempty"`
-
// UpdatePolicy: The update policy for this managed instance group.
UpdatePolicy *InstanceGroupManagerUpdatePolicy `json:"updatePolicy,omitempty"`
-
- // Versions: Specifies the instance templates used by this managed
- // instance group to create instances. Each version is defined by an
- // instanceTemplate and a name. Every version can appear at most once
- // per instance group. This field overrides the top-level
- // instanceTemplate field. Read more about the relationships between
- // these fields. Exactly one version must leave the targetSize field
- // unset. That version will be applied to all remaining instances. For
- // more information, read about canary updates.
+ // Versions: Specifies the instance templates used by this managed instance
+ // group to create instances. Each version is defined by an instanceTemplate
+ // and a name. Every version can appear at most once per instance group. This
+ // field overrides the top-level instanceTemplate field. Read more about the
+ // relationships between these fields. Exactly one version must leave the
+ // targetSize field unset. That version will be applied to all remaining
+ // instances. For more information, read about canary updates.
Versions []*InstanceGroupManagerVersion `json:"versions,omitempty"`
-
- // Zone: [Output Only] The URL of a zone where the managed instance
- // group is located (for zonal resources).
+ // Zone: [Output Only] The URL of a zone where the managed instance group is
+ // located (for zonal resources).
Zone string `json:"zone,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "AutoHealingPolicies")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "AllInstancesConfig") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "AutoHealingPolicies") 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. "AllInstancesConfig") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupManager) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupManager) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupManager
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceGroupManagerActionsSummary struct {
- // Abandoning: [Output Only] The total number of instances in the
- // managed instance group that are scheduled to be abandoned. Abandoning
- // an instance removes it from the managed instance group without
- // deleting it.
+ // Abandoning: [Output Only] The total number of instances in the managed
+ // instance group that are scheduled to be abandoned. Abandoning an instance
+ // removes it from the managed instance group without deleting it.
Abandoning int64 `json:"abandoning,omitempty"`
-
- // Creating: [Output Only] The number of instances in the managed
- // instance group that are scheduled to be created or are currently
- // being created. If the group fails to create any of these instances,
- // it tries again until it creates the instance successfully. If you
- // have disabled creation retries, this field will not be populated;
- // instead, the creatingWithoutRetries field will be populated.
+ // Creating: [Output Only] The number of instances in the managed instance
+ // group that are scheduled to be created or are currently being created. If
+ // the group fails to create any of these instances, it tries again until it
+ // creates the instance successfully. If you have disabled creation retries,
+ // this field will not be populated; instead, the creatingWithoutRetries field
+ // will be populated.
Creating int64 `json:"creating,omitempty"`
-
- // CreatingWithoutRetries: [Output Only] The number of instances that
- // the managed instance group will attempt to create. The group attempts
- // to create each instance only once. If the group fails to create any
- // of these instances, it decreases the group's targetSize value
- // accordingly.
+ // CreatingWithoutRetries: [Output Only] The number of instances that the
+ // managed instance group will attempt to create. The group attempts to create
+ // each instance only once. If the group fails to create any of these
+ // instances, it decreases the group's targetSize value accordingly.
CreatingWithoutRetries int64 `json:"creatingWithoutRetries,omitempty"`
-
- // Deleting: [Output Only] The number of instances in the managed
- // instance group that are scheduled to be deleted or are currently
- // being deleted.
+ // Deleting: [Output Only] The number of instances in the managed instance
+ // group that are scheduled to be deleted or are currently being deleted.
Deleting int64 `json:"deleting,omitempty"`
-
- // None: [Output Only] The number of instances in the managed instance
- // group that are running and have no scheduled actions.
+ // None: [Output Only] The number of instances in the managed instance group
+ // that are running and have no scheduled actions.
None int64 `json:"none,omitempty"`
-
- // Recreating: [Output Only] The number of instances in the managed
- // instance group that are scheduled to be recreated or are currently
- // being being recreated. Recreating an instance deletes the existing
- // root persistent disk and creates a new disk from the image that is
- // defined in the instance template.
+ // Recreating: [Output Only] The number of instances in the managed instance
+ // group that are scheduled to be recreated or are currently being being
+ // recreated. Recreating an instance deletes the existing root persistent disk
+ // and creates a new disk from the image that is defined in the instance
+ // template.
Recreating int64 `json:"recreating,omitempty"`
-
- // Refreshing: [Output Only] The number of instances in the managed
- // instance group that are being reconfigured with properties that do
- // not require a restart or a recreate action. For example, setting or
- // removing target pools for the instance.
+ // Refreshing: [Output Only] The number of instances in the managed instance
+ // group that are being reconfigured with properties that do not require a
+ // restart or a recreate action. For example, setting or removing target pools
+ // for the instance.
Refreshing int64 `json:"refreshing,omitempty"`
-
- // Restarting: [Output Only] The number of instances in the managed
- // instance group that are scheduled to be restarted or are currently
- // being restarted.
+ // Restarting: [Output Only] The number of instances in the managed instance
+ // group that are scheduled to be restarted or are currently being restarted.
Restarting int64 `json:"restarting,omitempty"`
-
- // Resuming: [Output Only] The number of instances in the managed
- // instance group that are scheduled to be resumed or are currently
- // being resumed.
+ // Resuming: [Output Only] The number of instances in the managed instance
+ // group that are scheduled to be resumed or are currently being resumed.
Resuming int64 `json:"resuming,omitempty"`
-
- // Starting: [Output Only] The number of instances in the managed
- // instance group that are scheduled to be started or are currently
- // being started.
+ // Starting: [Output Only] The number of instances in the managed instance
+ // group that are scheduled to be started or are currently being started.
Starting int64 `json:"starting,omitempty"`
-
- // Stopping: [Output Only] The number of instances in the managed
- // instance group that are scheduled to be stopped or are currently
- // being stopped.
+ // Stopping: [Output Only] The number of instances in the managed instance
+ // group that are scheduled to be stopped or are currently being stopped.
Stopping int64 `json:"stopping,omitempty"`
-
- // Suspending: [Output Only] The number of instances in the managed
- // instance group that are scheduled to be suspended or are currently
- // being suspended.
+ // Suspending: [Output Only] The number of instances in the managed instance
+ // group that are scheduled to be suspended or are currently being suspended.
Suspending int64 `json:"suspending,omitempty"`
-
- // Verifying: [Output Only] The number of instances in the managed
- // instance group that are being verified. See the
- // managedInstances[].currentAction property in the listManagedInstances
- // method documentation.
+ // Verifying: [Output Only] The number of instances in the managed instance
+ // group that are being verified. See the managedInstances[].currentAction
+ // property in the listManagedInstances method documentation.
Verifying int64 `json:"verifying,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Abandoning") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Abandoning") 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. "Abandoning") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupManagerActionsSummary) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupManagerActionsSummary) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupManagerActionsSummary
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceGroupManagerAggregatedList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of InstanceGroupManagersScopedList resources.
Items map[string]InstanceGroupManagersScopedList `json:"items,omitempty"`
-
// Kind: [Output Only] The resource type, which is always
- // compute#instanceGroupManagerAggregatedList for an aggregated list of
- // managed instance groups.
+ // compute#instanceGroupManagerAggregatedList for an aggregated list of managed
+ // instance groups.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Unreachables: [Output Only] Unreachable resources.
Unreachables []string `json:"unreachables,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *InstanceGroupManagerAggregatedListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupManagerAggregatedList) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupManagerAggregatedList) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupManagerAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// InstanceGroupManagerAggregatedListWarning: [Output Only]
-// Informational warning message.
+// InstanceGroupManagerAggregatedListWarning: [Output Only] Informational
+// warning message.
type InstanceGroupManagerAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*InstanceGroupManagerAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupManagerAggregatedListWarning) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupManagerAggregatedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupManagerAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceGroupManagerAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupManagerAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupManagerAggregatedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupManagerAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+type InstanceGroupManagerAllInstancesConfig struct {
+ // Properties: Properties to set on all instances in the group. You can add or
+ // modify properties using the instanceGroupManagers.patch or
+ // regionInstanceGroupManagers.patch. After setting allInstancesConfig on the
+ // group, you must update the group's instances to apply the configuration. To
+ // apply the configuration, set the group's updatePolicy.type field to use
+ // proactive updates or use the applyUpdatesToInstances method.
+ Properties *InstancePropertiesPatch `json:"properties,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Properties") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Properties") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s InstanceGroupManagerAllInstancesConfig) MarshalJSON() ([]byte, error) {
+ type NoMethod InstanceGroupManagerAllInstancesConfig
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceGroupManagerAutoHealingPolicy struct {
// HealthCheck: The URL for the health check that signals autohealing.
HealthCheck string `json:"healthCheck,omitempty"`
-
- // InitialDelaySec: The initial delay is the number of seconds that a
- // new VM takes to initialize and run its startup script. During a VM's
- // initial delay period, the MIG ignores unsuccessful health checks
- // because the VM might be in the startup process. This prevents the MIG
- // from prematurely recreating a VM. If the health check receives a
- // healthy response during the initial delay, it indicates that the
- // startup process is complete and the VM is ready. The value of initial
- // delay must be between 0 and 3600 seconds. The default value is 0.
+ // InitialDelaySec: The initial delay is the number of seconds that a new VM
+ // takes to initialize and run its startup script. During a VM's initial delay
+ // period, the MIG ignores unsuccessful health checks because the VM might be
+ // in the startup process. This prevents the MIG from prematurely recreating a
+ // VM. If the health check receives a healthy response during the initial
+ // delay, it indicates that the startup process is complete and the VM is
+ // ready. The value of initial delay must be between 0 and 3600 seconds. The
+ // default value is 0.
InitialDelaySec int64 `json:"initialDelaySec,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "HealthCheck") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "HealthCheck") 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. "HealthCheck") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupManagerAutoHealingPolicy) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupManagerAutoHealingPolicy) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupManagerAutoHealingPolicy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+type InstanceGroupManagerInstanceFlexibilityPolicy struct {
+ // InstanceSelections: Named instance selections configuring properties that
+ // the group will use when creating new VMs.
+ InstanceSelections map[string]InstanceGroupManagerInstanceFlexibilityPolicyInstanceSelection `json:"instanceSelections,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "InstanceSelections") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "InstanceSelections") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s InstanceGroupManagerInstanceFlexibilityPolicy) MarshalJSON() ([]byte, error) {
+ type NoMethod InstanceGroupManagerInstanceFlexibilityPolicy
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+type InstanceGroupManagerInstanceFlexibilityPolicyInstanceSelection struct {
+ // MachineTypes: Full machine-type names, e.g. "n1-standard-16".
+ MachineTypes []string `json:"machineTypes,omitempty"`
+ // Rank: Preference of this instance selection. Lower number means higher
+ // preference. MIG will first try to create a VM based on the machine-type with
+ // lowest rank and fallback to next rank based on availability. Machine types
+ // and instance selections with the same rank have the same preference.
+ Rank int64 `json:"rank,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "MachineTypes") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "MachineTypes") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s InstanceGroupManagerInstanceFlexibilityPolicyInstanceSelection) MarshalJSON() ([]byte, error) {
+ type NoMethod InstanceGroupManagerInstanceFlexibilityPolicyInstanceSelection
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceGroupManagerInstanceLifecyclePolicy struct {
+ // DefaultActionOnFailure: The action that a MIG performs on a failed or an
+ // unhealthy VM. A VM is marked as unhealthy when the application running on
+ // that VM fails a health check. Valid values are - REPAIR (default): MIG
+ // automatically repairs a failed or an unhealthy VM by recreating it. For more
+ // information, see About repairing VMs in a MIG. - DO_NOTHING: MIG does not
+ // repair a failed or an unhealthy VM.
+ //
+ // Possible values:
+ // "DO_NOTHING" - MIG does not repair a failed or an unhealthy VM.
+ // "REPAIR" - (Default) MIG automatically repairs a failed or an unhealthy VM
+ // by recreating it. For more information, see About repairing VMs in a MIG.
+ DefaultActionOnFailure string `json:"defaultActionOnFailure,omitempty"`
// ForceUpdateOnRepair: A bit indicating whether to forcefully apply the
- // group's latest configuration when repairing a VM. Valid options are:
- // - NO (default): If configuration updates are available, they are not
- // forcefully applied during repair. Instead, configuration updates are
- // applied according to the group's update policy. - YES: If
- // configuration updates are available, they are applied during repair.
+ // group's latest configuration when repairing a VM. Valid options are: - NO
+ // (default): If configuration updates are available, they are not forcefully
+ // applied during repair. Instead, configuration updates are applied according
+ // to the group's update policy. - YES: If configuration updates are available,
+ // they are applied during repair.
//
// Possible values:
// "NO"
// "YES"
ForceUpdateOnRepair string `json:"forceUpdateOnRepair,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "ForceUpdateOnRepair")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "DefaultActionOnFailure") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "ForceUpdateOnRepair") 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. "DefaultActionOnFailure") to
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupManagerInstanceLifecyclePolicy) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupManagerInstanceLifecyclePolicy) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupManagerInstanceLifecyclePolicy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// InstanceGroupManagerList: [Output Only] A list of managed instance
-// groups.
+// InstanceGroupManagerList: [Output Only] A list of managed instance groups.
type InstanceGroupManagerList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of InstanceGroupManager resources.
Items []*InstanceGroupManager `json:"items,omitempty"`
-
// Kind: [Output Only] The resource type, which is always
- // compute#instanceGroupManagerList for a list of managed instance
- // groups.
+ // compute#instanceGroupManagerList for a list of managed instance groups.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *InstanceGroupManagerListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupManagerList) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupManagerList) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupManagerList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// InstanceGroupManagerListWarning: [Output Only] Informational warning
// message.
type InstanceGroupManagerListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*InstanceGroupManagerListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupManagerListWarning) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupManagerListWarning) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupManagerListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceGroupManagerListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s InstanceGroupManagerListWarningData) MarshalJSON() ([]byte, error) {
+ type NoMethod InstanceGroupManagerListWarningData
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+// InstanceGroupManagerResizeRequest: InstanceGroupManagerResizeRequest
+// represents a request to create a number of VMs: either immediately or by
+// queuing the request for the specified time. This resize request is nested
+// under InstanceGroupManager and the VMs created by this request are added to
+// the owning InstanceGroupManager.
+type InstanceGroupManagerResizeRequest struct {
+ // CreationTimestamp: [Output Only] The creation timestamp for this resize
+ // request in RFC3339 text format.
+ CreationTimestamp string `json:"creationTimestamp,omitempty"`
+ // Description: An optional description of this resource.
+ Description string `json:"description,omitempty"`
+ // Id: [Output Only] A unique identifier for this resource type. The server
+ // generates this identifier.
+ Id uint64 `json:"id,omitempty,string"`
+ // Kind: [Output Only] The resource type, which is always
+ // compute#instanceGroupManagerResizeRequest for resize requests.
+ Kind string `json:"kind,omitempty"`
+ // Name: The name of this resize request. The name must be 1-63 characters
+ // long, and comply with RFC1035.
+ Name string `json:"name,omitempty"`
+ // RequestedRunDuration: Requested run duration for instances that will be
+ // created by this request. At the end of the run duration instance will be
+ // deleted.
+ RequestedRunDuration *Duration `json:"requestedRunDuration,omitempty"`
+ // ResizeBy: The number of instances to be created by this resize request. The
+ // group's target size will be increased by this number. This field cannot be
+ // used together with 'instances'.
+ ResizeBy int64 `json:"resizeBy,omitempty"`
+ // SelfLink: [Output Only] The URL for this resize request. The server defines
+ // this URL.
+ SelfLink string `json:"selfLink,omitempty"`
+ // SelfLinkWithId: [Output Only] Server-defined URL for this resource with the
+ // resource id.
+ SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
+ // State: [Output only] Current state of the request.
+ //
+ // Possible values:
+ // "ACCEPTED" - The request was created successfully and was accepted for
+ // provisioning when the capacity becomes available.
+ // "CANCELLED" - The request is cancelled.
+ // "CREATING" - Resize request is being created and may still fail creation.
+ // "FAILED" - The request failed before or during provisioning. If the
+ // request fails during provisioning, any VMs that were created during
+ // provisioning are rolled back and removed from the MIG.
+ // "STATE_UNSPECIFIED" - Default value. This value should never be returned.
+ // "SUCCEEDED" - The request succeeded.
+ State string `json:"state,omitempty"`
+ // Status: [Output only] Status of the request.
+ Status *InstanceGroupManagerResizeRequestStatus `json:"status,omitempty"`
+ // Zone: [Output Only] The URL of a zone where the resize request is located.
+ // Populated only for zonal resize requests.
+ Zone string `json:"zone,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "CreationTimestamp") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "CreationTimestamp") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s InstanceGroupManagerResizeRequest) MarshalJSON() ([]byte, error) {
+ type NoMethod InstanceGroupManagerResizeRequest
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+type InstanceGroupManagerResizeRequestStatus struct {
+ // Error: [Output only] Fatal errors encountered during the queueing or
+ // provisioning phases of the ResizeRequest that caused the transition to the
+ // FAILED state. Contrary to the last_attempt errors, this field is final and
+ // errors are never removed from here, as the ResizeRequest is not going to
+ // retry.
+ Error *InstanceGroupManagerResizeRequestStatusError `json:"error,omitempty"`
+ // LastAttempt: [Output only] Information about the last attempt to fulfill the
+ // request. The value is temporary since the ResizeRequest can retry, as long
+ // as it's still active and the last attempt value can either be cleared or
+ // replaced with a different error. Since ResizeRequest retries infrequently,
+ // the value may be stale and no longer show an active problem. The value is
+ // cleared when ResizeRequest transitions to the final state (becomes
+ // inactive). If the final state is FAILED the error describing it will be
+ // storred in the "error" field only.
+ LastAttempt *InstanceGroupManagerResizeRequestStatusLastAttempt `json:"lastAttempt,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Error") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Error") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+func (s InstanceGroupManagerResizeRequestStatus) MarshalJSON() ([]byte, error) {
+ type NoMethod InstanceGroupManagerResizeRequestStatus
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+// InstanceGroupManagerResizeRequestStatusError: [Output only] Fatal errors
+// encountered during the queueing or provisioning phases of the ResizeRequest
+// that caused the transition to the FAILED state. Contrary to the last_attempt
+// errors, this field is final and errors are never removed from here, as the
+// ResizeRequest is not going to retry.
+type InstanceGroupManagerResizeRequestStatusError struct {
+ // Errors: [Output Only] The array of errors encountered while processing this
+ // operation.
+ Errors []*InstanceGroupManagerResizeRequestStatusErrorErrors `json:"errors,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Errors") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Errors") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s InstanceGroupManagerResizeRequestStatusError) MarshalJSON() ([]byte, error) {
+ type NoMethod InstanceGroupManagerResizeRequestStatusError
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
- // NullFields is a list of field names (e.g. "Key") 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.
+type InstanceGroupManagerResizeRequestStatusErrorErrors struct {
+ // Code: [Output Only] The error type identifier for this error.
+ Code string `json:"code,omitempty"`
+ // ErrorDetails: [Output Only] An optional list of messages that contain the
+ // error details. There is a set of defined message types to use for providing
+ // details.The syntax depends on the error code. For example, QuotaExceededInfo
+ // will have details when the error code is QUOTA_EXCEEDED.
+ ErrorDetails []*InstanceGroupManagerResizeRequestStatusErrorErrorsErrorDetails `json:"errorDetails,omitempty"`
+ // Location: [Output Only] Indicates the field in the request that caused the
+ // error. This property is optional.
+ Location string `json:"location,omitempty"`
+ // Message: [Output Only] An optional, human-readable error message.
+ Message string `json:"message,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupManagerListWarningData) MarshalJSON() ([]byte, error) {
- type NoMethod InstanceGroupManagerListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s InstanceGroupManagerResizeRequestStatusErrorErrors) MarshalJSON() ([]byte, error) {
+ type NoMethod InstanceGroupManagerResizeRequestStatusErrorErrors
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+type InstanceGroupManagerResizeRequestStatusErrorErrorsErrorDetails struct {
+ ErrorInfo *ErrorInfo `json:"errorInfo,omitempty"`
+ Help *Help `json:"help,omitempty"`
+ LocalizedMessage *LocalizedMessage `json:"localizedMessage,omitempty"`
+ QuotaInfo *QuotaExceededInfo `json:"quotaInfo,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "ErrorInfo") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "ErrorInfo") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s InstanceGroupManagerResizeRequestStatusErrorErrorsErrorDetails) MarshalJSON() ([]byte, error) {
+ type NoMethod InstanceGroupManagerResizeRequestStatusErrorErrorsErrorDetails
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+type InstanceGroupManagerResizeRequestStatusLastAttempt struct {
+ // Error: Errors that prevented the ResizeRequest to be fulfilled.
+ Error *InstanceGroupManagerResizeRequestStatusLastAttemptError `json:"error,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Error") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Error") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s InstanceGroupManagerResizeRequestStatusLastAttempt) MarshalJSON() ([]byte, error) {
+ type NoMethod InstanceGroupManagerResizeRequestStatusLastAttempt
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+// InstanceGroupManagerResizeRequestStatusLastAttemptError: Errors that
+// prevented the ResizeRequest to be fulfilled.
+type InstanceGroupManagerResizeRequestStatusLastAttemptError struct {
+ // Errors: [Output Only] The array of errors encountered while processing this
+ // operation.
+ Errors []*InstanceGroupManagerResizeRequestStatusLastAttemptErrorErrors `json:"errors,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Errors") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Errors") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s InstanceGroupManagerResizeRequestStatusLastAttemptError) MarshalJSON() ([]byte, error) {
+ type NoMethod InstanceGroupManagerResizeRequestStatusLastAttemptError
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+type InstanceGroupManagerResizeRequestStatusLastAttemptErrorErrors struct {
+ // Code: [Output Only] The error type identifier for this error.
+ Code string `json:"code,omitempty"`
+ // ErrorDetails: [Output Only] An optional list of messages that contain the
+ // error details. There is a set of defined message types to use for providing
+ // details.The syntax depends on the error code. For example, QuotaExceededInfo
+ // will have details when the error code is QUOTA_EXCEEDED.
+ ErrorDetails []*InstanceGroupManagerResizeRequestStatusLastAttemptErrorErrorsErrorDetails `json:"errorDetails,omitempty"`
+ // Location: [Output Only] Indicates the field in the request that caused the
+ // error. This property is optional.
+ Location string `json:"location,omitempty"`
+ // Message: [Output Only] An optional, human-readable error message.
+ Message string `json:"message,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s InstanceGroupManagerResizeRequestStatusLastAttemptErrorErrors) MarshalJSON() ([]byte, error) {
+ type NoMethod InstanceGroupManagerResizeRequestStatusLastAttemptErrorErrors
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+type InstanceGroupManagerResizeRequestStatusLastAttemptErrorErrorsErrorDetails struct {
+ ErrorInfo *ErrorInfo `json:"errorInfo,omitempty"`
+ Help *Help `json:"help,omitempty"`
+ LocalizedMessage *LocalizedMessage `json:"localizedMessage,omitempty"`
+ QuotaInfo *QuotaExceededInfo `json:"quotaInfo,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "ErrorInfo") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "ErrorInfo") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s InstanceGroupManagerResizeRequestStatusLastAttemptErrorErrorsErrorDetails) MarshalJSON() ([]byte, error) {
+ type NoMethod InstanceGroupManagerResizeRequestStatusLastAttemptErrorErrorsErrorDetails
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+// InstanceGroupManagerResizeRequestsListResponse: [Output Only] A list of
+// resize requests.
+type InstanceGroupManagerResizeRequestsListResponse struct {
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
+ Id string `json:"id,omitempty"`
+ // Items: A list of resize request resources.
+ Items []*InstanceGroupManagerResizeRequest `json:"items,omitempty"`
+ // Kind: [Output Only] Type of the resource. Always
+ // compute#instanceGroupManagerResizeRequestList for a list of resize requests.
+ Kind string `json:"kind,omitempty"`
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
+ NextPageToken string `json:"nextPageToken,omitempty"`
+ // SelfLink: [Output Only] Server-defined URL for this resource.
+ SelfLink string `json:"selfLink,omitempty"`
+ // Warning: [Output Only] Informational warning message.
+ Warning *InstanceGroupManagerResizeRequestsListResponseWarning `json:"warning,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s InstanceGroupManagerResizeRequestsListResponse) MarshalJSON() ([]byte, error) {
+ type NoMethod InstanceGroupManagerResizeRequestsListResponse
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+// InstanceGroupManagerResizeRequestsListResponseWarning: [Output Only]
+// Informational warning message.
+type InstanceGroupManagerResizeRequestsListResponseWarning struct {
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
+ //
+ // Possible values:
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
+ // "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
+ // resources has a type marked as experimental
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
+ // "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
+ // overridden. Deprecated unused field.
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
+ // HTTP/HTTPS/HTTP2.
+ // "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
+ // exceedingly large number of resources
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
+ // "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
+ // "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
+ // ignored.
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
+ // "UNREACHABLE" - A given scope cannot be reached.
+ Code string `json:"code,omitempty"`
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
+ Data []*InstanceGroupManagerResizeRequestsListResponseWarningData `json:"data,omitempty"`
+ // Message: [Output Only] A human-readable description of the warning code.
+ Message string `json:"message,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s InstanceGroupManagerResizeRequestsListResponseWarning) MarshalJSON() ([]byte, error) {
+ type NoMethod InstanceGroupManagerResizeRequestsListResponseWarning
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+type InstanceGroupManagerResizeRequestsListResponseWarningData struct {
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
+ Key string `json:"key,omitempty"`
+ // Value: [Output Only] A warning data value corresponding to the key.
+ Value string `json:"value,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s InstanceGroupManagerResizeRequestsListResponseWarningData) MarshalJSON() ([]byte, error) {
+ type NoMethod InstanceGroupManagerResizeRequestsListResponseWarningData
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceGroupManagerStatus struct {
+ // AllInstancesConfig: [Output only] Status of all-instances configuration on
+ // the group.
+ AllInstancesConfig *InstanceGroupManagerStatusAllInstancesConfig `json:"allInstancesConfig,omitempty"`
// Autoscaler: [Output Only] The URL of the Autoscaler that targets this
// instance group manager.
Autoscaler string `json:"autoscaler,omitempty"`
-
- // IsStable: [Output Only] A bit indicating whether the managed instance
- // group is in a stable state. A stable state means that: none of the
- // instances in the managed instance group is currently undergoing any
- // type of change (for example, creation, restart, or deletion); no
- // future changes are scheduled for instances in the managed instance
- // group; and the managed instance group itself is not being modified.
+ // IsStable: [Output Only] A bit indicating whether the managed instance group
+ // is in a stable state. A stable state means that: none of the instances in
+ // the managed instance group is currently undergoing any type of change (for
+ // example, creation, restart, or deletion); no future changes are scheduled
+ // for instances in the managed instance group; and the managed instance group
+ // itself is not being modified.
IsStable bool `json:"isStable,omitempty"`
-
- // Stateful: [Output Only] Stateful status of the given Instance Group
- // Manager.
+ // Stateful: [Output Only] Stateful status of the given Instance Group Manager.
Stateful *InstanceGroupManagerStatusStateful `json:"stateful,omitempty"`
-
- // VersionTarget: [Output Only] A status of consistency of Instances'
- // versions with their target version specified by version field on
- // Instance Group Manager.
+ // VersionTarget: [Output Only] A status of consistency of Instances' versions
+ // with their target version specified by version field on Instance Group
+ // Manager.
VersionTarget *InstanceGroupManagerStatusVersionTarget `json:"versionTarget,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Autoscaler") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "AllInstancesConfig") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Autoscaler") 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. "AllInstancesConfig") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupManagerStatus) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupManagerStatus) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupManagerStatus
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+type InstanceGroupManagerStatusAllInstancesConfig struct {
+ // CurrentRevision: [Output Only] Current all-instances configuration revision.
+ // This value is in RFC3339 text format.
+ CurrentRevision string `json:"currentRevision,omitempty"`
+ // Effective: [Output Only] A bit indicating whether this configuration has
+ // been applied to all managed instances in the group.
+ Effective bool `json:"effective,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "CurrentRevision") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "CurrentRevision") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s InstanceGroupManagerStatusAllInstancesConfig) MarshalJSON() ([]byte, error) {
+ type NoMethod InstanceGroupManagerStatusAllInstancesConfig
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceGroupManagerStatusStateful struct {
// HasStatefulConfig: [Output Only] A bit indicating whether the managed
- // instance group has stateful configuration, that is, if you have
- // configured any items in a stateful policy or in per-instance configs.
- // The group might report that it has no stateful configuration even
- // when there is still some preserved state on a managed instance, for
- // example, if you have deleted all PICs but not yet applied those
- // deletions.
+ // instance group has stateful configuration, that is, if you have configured
+ // any items in a stateful policy or in per-instance configs. The group might
+ // report that it has no stateful configuration even when there is still some
+ // preserved state on a managed instance, for example, if you have deleted all
+ // PICs but not yet applied those deletions.
HasStatefulConfig bool `json:"hasStatefulConfig,omitempty"`
-
- // PerInstanceConfigs: [Output Only] Status of per-instance
- // configurations on the instance.
+ // PerInstanceConfigs: [Output Only] Status of per-instance configurations on
+ // the instances.
PerInstanceConfigs *InstanceGroupManagerStatusStatefulPerInstanceConfigs `json:"perInstanceConfigs,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "HasStatefulConfig")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "HasStatefulConfig") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "HasStatefulConfig") 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. "HasStatefulConfig") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupManagerStatusStateful) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupManagerStatusStateful) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupManagerStatusStateful
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceGroupManagerStatusStatefulPerInstanceConfigs struct {
// AllEffective: A bit indicating if all of the group's per-instance
- // configurations (listed in the output of a listPerInstanceConfigs API
- // call) have status EFFECTIVE or there are no per-instance-configs.
+ // configurations (listed in the output of a listPerInstanceConfigs API call)
+ // have status EFFECTIVE or there are no per-instance-configs.
AllEffective bool `json:"allEffective,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "AllEffective") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "AllEffective") 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. "AllEffective") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupManagerStatusStatefulPerInstanceConfigs) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupManagerStatusStatefulPerInstanceConfigs) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupManagerStatusStatefulPerInstanceConfigs
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceGroupManagerStatusVersionTarget struct {
- // IsReached: [Output Only] A bit indicating whether version target has
- // been reached in this managed instance group, i.e. all instances are
- // in their target version. Instances' target version are specified by
- // version field on Instance Group Manager.
+ // IsReached: [Output Only] A bit indicating whether version target has been
+ // reached in this managed instance group, i.e. all instances are in their
+ // target version. Instances' target version are specified by version field on
+ // Instance Group Manager.
IsReached bool `json:"isReached,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "IsReached") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "IsReached") 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. "IsReached") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupManagerStatusVersionTarget) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupManagerStatusVersionTarget) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupManagerStatusVersionTarget
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceGroupManagerUpdatePolicy struct {
- // InstanceRedistributionType: The instance redistribution policy for
- // regional managed instance groups. Valid values are: - PROACTIVE
- // (default): The group attempts to maintain an even distribution of VM
- // instances across zones in the region. - NONE: For non-autoscaled
- // groups, proactive redistribution is disabled.
+ // InstanceRedistributionType: The instance redistribution policy for regional
+ // managed instance groups. Valid values are: - PROACTIVE (default): The group
+ // attempts to maintain an even distribution of VM instances across zones in
+ // the region. - NONE: For non-autoscaled groups, proactive redistribution is
+ // disabled.
//
// Possible values:
- // "NONE" - No action is being proactively performed in order to bring
- // this IGM to its target instance distribution.
- // "PROACTIVE" - This IGM will actively converge to its target
- // instance distribution.
+ // "NONE" - No action is being proactively performed in order to bring this
+ // IGM to its target instance distribution.
+ // "PROACTIVE" - This IGM will actively converge to its target instance
+ // distribution.
InstanceRedistributionType string `json:"instanceRedistributionType,omitempty"`
-
- // MaxSurge: The maximum number of instances that can be created above
- // the specified targetSize during the update process. This value can be
- // either a fixed number or, if the group has 10 or more instances, a
- // percentage. If you set a percentage, the number of instances is
- // rounded if necessary. The default value for maxSurge is a fixed value
- // equal to the number of zones in which the managed instance group
- // operates. At least one of either maxSurge or maxUnavailable must be
- // greater than 0. Learn more about maxSurge.
+ // MaxSurge: The maximum number of instances that can be created above the
+ // specified targetSize during the update process. This value can be either a
+ // fixed number or, if the group has 10 or more instances, a percentage. If you
+ // set a percentage, the number of instances is rounded if necessary. The
+ // default value for maxSurge is a fixed value equal to the number of zones in
+ // which the managed instance group operates. At least one of either maxSurge
+ // or maxUnavailable must be greater than 0. Learn more about maxSurge.
MaxSurge *FixedOrPercent `json:"maxSurge,omitempty"`
-
- // MaxUnavailable: The maximum number of instances that can be
- // unavailable during the update process. An instance is considered
- // available if all of the following conditions are satisfied: - The
- // instance's status is RUNNING. - If there is a health check on the
- // instance group, the instance's health check status must be HEALTHY at
- // least once. If there is no health check on the group, then the
- // instance only needs to have a status of RUNNING to be considered
- // available. This value can be either a fixed number or, if the group
- // has 10 or more instances, a percentage. If you set a percentage, the
+ // MaxUnavailable: The maximum number of instances that can be unavailable
+ // during the update process. An instance is considered available if all of the
+ // following conditions are satisfied: - The instance's status is RUNNING. - If
+ // there is a health check on the instance group, the instance's health check
+ // status must be HEALTHY at least once. If there is no health check on the
+ // group, then the instance only needs to have a status of RUNNING to be
+ // considered available. This value can be either a fixed number or, if the
+ // group has 10 or more instances, a percentage. If you set a percentage, the
// number of instances is rounded if necessary. The default value for
- // maxUnavailable is a fixed value equal to the number of zones in which
- // the managed instance group operates. At least one of either maxSurge
- // or maxUnavailable must be greater than 0. Learn more about
- // maxUnavailable.
+ // maxUnavailable is a fixed value equal to the number of zones in which the
+ // managed instance group operates. At least one of either maxSurge or
+ // maxUnavailable must be greater than 0. Learn more about maxUnavailable.
MaxUnavailable *FixedOrPercent `json:"maxUnavailable,omitempty"`
-
- // MinimalAction: Minimal action to be taken on an instance. Use this
- // option to minimize disruption as much as possible or to apply a more
- // disruptive action than is necessary. - To limit disruption as much as
- // possible, set the minimal action to REFRESH. If your update requires
- // a more disruptive action, Compute Engine performs the necessary
- // action to execute the update. - To apply a more disruptive action
- // than is strictly necessary, set the minimal action to RESTART or
- // REPLACE. For example, Compute Engine does not need to restart a VM to
- // change its metadata. But if your application reads instance metadata
- // only when a VM is restarted, you can set the minimal action to
+ // MinimalAction: Minimal action to be taken on an instance. Use this option to
+ // minimize disruption as much as possible or to apply a more disruptive action
+ // than is necessary. - To limit disruption as much as possible, set the
+ // minimal action to REFRESH. If your update requires a more disruptive action,
+ // Compute Engine performs the necessary action to execute the update. - To
+ // apply a more disruptive action than is strictly necessary, set the minimal
+ // action to RESTART or REPLACE. For example, Compute Engine does not need to
+ // restart a VM to change its metadata. But if your application reads instance
+ // metadata only when a VM is restarted, you can set the minimal action to
// RESTART in order to pick up metadata changes.
//
// Possible values:
// "NONE" - Do not perform any action.
// "REFRESH" - Do not stop the instance.
- // "REPLACE" - (Default.) Replace the instance according to the
- // replacement method option.
+ // "REPLACE" - (Default.) Replace the instance according to the replacement
+ // method option.
// "RESTART" - Stop the instance and start it again.
MinimalAction string `json:"minimalAction,omitempty"`
-
- // MostDisruptiveAllowedAction: Most disruptive action that is allowed
- // to be taken on an instance. You can specify either NONE to forbid any
- // actions, REFRESH to avoid restarting the VM and to limit disruption
- // as much as possible. RESTART to allow actions that can be applied
- // without instance replacing or REPLACE to allow all possible actions.
- // If the Updater determines that the minimal update action needed is
- // more disruptive than most disruptive allowed action you specify it
- // will not perform the update at all.
+ // MostDisruptiveAllowedAction: Most disruptive action that is allowed to be
+ // taken on an instance. You can specify either NONE to forbid any actions,
+ // REFRESH to avoid restarting the VM and to limit disruption as much as
+ // possible. RESTART to allow actions that can be applied without instance
+ // replacing or REPLACE to allow all possible actions. If the Updater
+ // determines that the minimal update action needed is more disruptive than
+ // most disruptive allowed action you specify it will not perform the update at
+ // all.
//
// Possible values:
// "NONE" - Do not perform any action.
// "REFRESH" - Do not stop the instance.
- // "REPLACE" - (Default.) Replace the instance according to the
- // replacement method option.
+ // "REPLACE" - (Default.) Replace the instance according to the replacement
+ // method option.
// "RESTART" - Stop the instance and start it again.
MostDisruptiveAllowedAction string `json:"mostDisruptiveAllowedAction,omitempty"`
-
- // ReplacementMethod: What action should be used to replace instances.
- // See minimal_action.REPLACE
+ // ReplacementMethod: What action should be used to replace instances. See
+ // minimal_action.REPLACE
//
// Possible values:
// "RECREATE" - Instances will be recreated (with the same name)
- // "SUBSTITUTE" - Default option: instances will be deleted and
- // created (with a new name)
+ // "SUBSTITUTE" - Default option: instances will be deleted and created (with
+ // a new name)
ReplacementMethod string `json:"replacementMethod,omitempty"`
-
- // Type: The type of update process. You can specify either PROACTIVE so
- // that the MIG automatically updates VMs to the latest configurations
- // or OPPORTUNISTIC so that you can select the VMs that you want to
- // update.
+ // Type: The type of update process. You can specify either PROACTIVE so that
+ // the MIG automatically updates VMs to the latest configurations or
+ // OPPORTUNISTIC so that you can select the VMs that you want to update.
//
// Possible values:
- // "OPPORTUNISTIC" - MIG will apply new configurations to existing VMs
- // only when you selectively target specific or all VMs to be updated.
- // "PROACTIVE" - MIG will automatically apply new configurations to
- // all or a subset of existing VMs and also to new VMs that are added to
- // the group.
+ // "OPPORTUNISTIC" - MIG will apply new configurations to existing VMs only
+ // when you selectively target specific or all VMs to be updated.
+ // "PROACTIVE" - MIG will automatically apply new configurations to all or a
+ // subset of existing VMs and also to new VMs that are added to the group.
Type string `json:"type,omitempty"`
-
- // ForceSendFields is a list of field names (e.g.
- // "InstanceRedistributionType") to unconditionally include in API
- // requests. By default, fields with empty or default 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 is a list of field names (e.g. "InstanceRedistributionType")
+ // to unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g.
- // "InstanceRedistributionType") 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. "InstanceRedistributionType") to
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupManagerUpdatePolicy) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupManagerUpdatePolicy) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupManagerUpdatePolicy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceGroupManagerVersion struct {
- // InstanceTemplate: The URL of the instance template that is specified
- // for this managed instance group. The group uses this template to
- // create new instances in the managed instance group until the
- // `targetSize` for this version is reached. The templates for existing
- // instances in the group do not change unless you run
- // recreateInstances, run applyUpdatesToInstances, or set the group's
- // updatePolicy.type to PROACTIVE; in those cases, existing instances
- // are updated until the `targetSize` for this version is reached.
+ // InstanceTemplate: The URL of the instance template that is specified for
+ // this managed instance group. The group uses this template to create new
+ // instances in the managed instance group until the `targetSize` for this
+ // version is reached. The templates for existing instances in the group do not
+ // change unless you run recreateInstances, run applyUpdatesToInstances, or set
+ // the group's updatePolicy.type to PROACTIVE; in those cases, existing
+ // instances are updated until the `targetSize` for this version is reached.
InstanceTemplate string `json:"instanceTemplate,omitempty"`
-
- // Name: Name of the version. Unique among all versions in the scope of
- // this managed instance group.
+ // Name: Name of the version. Unique among all versions in the scope of this
+ // managed instance group.
Name string `json:"name,omitempty"`
-
- // TargetSize: Specifies the intended number of instances to be created
- // from the instanceTemplate. The final number of instances created from
- // the template will be equal to: - If expressed as a fixed number, the
- // minimum of either targetSize.fixed or instanceGroupManager.targetSize
- // is used. - if expressed as a percent, the targetSize would be
- // (targetSize.percent/100 * InstanceGroupManager.targetSize) If there
- // is a remainder, the number is rounded. If unset, this version will
- // update any remaining instances not updated by another version. Read
- // Starting a canary update for more information.
+ // TargetSize: Specifies the intended number of instances to be created from
+ // the instanceTemplate. The final number of instances created from the
+ // template will be equal to: - If expressed as a fixed number, the minimum of
+ // either targetSize.fixed or instanceGroupManager.targetSize is used. - if
+ // expressed as a percent, the targetSize would be (targetSize.percent/100 *
+ // InstanceGroupManager.targetSize) If there is a remainder, the number is
+ // rounded. If unset, this version will update any remaining instances not
+ // updated by another version. Read Starting a canary update for more
+ // information.
TargetSize *FixedOrPercent `json:"targetSize,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "InstanceTemplate") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "InstanceTemplate") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupManagerVersion) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupManagerVersion) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupManagerVersion
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceGroupManagersAbandonInstancesRequest struct {
- // Instances: The URLs of one or more instances to abandon. This can be
- // a full URL or a partial URL, such as
- // zones/[ZONE]/instances/[INSTANCE_NAME].
+ // Instances: The URLs of one or more instances to abandon. This can be a full
+ // URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME].
Instances []string `json:"instances,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Instances") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Instances") 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. "Instances") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupManagersAbandonInstancesRequest) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupManagersAbandonInstancesRequest) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupManagersAbandonInstancesRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// InstanceGroupManagersApplyUpdatesRequest:
// InstanceGroupManagers.applyUpdatesToInstances
type InstanceGroupManagersApplyUpdatesRequest struct {
- // AllInstances: Flag to update all instances instead of specified list
- // of “instances”. If the flag is set to true then the instances may
- // not be specified in the request.
+ // AllInstances: Flag to update all instances instead of specified list of
+ // “instances”. If the flag is set to true then the instances may not be
+ // specified in the request.
AllInstances bool `json:"allInstances,omitempty"`
-
- // Instances: The list of URLs of one or more instances for which you
- // want to apply updates. Each URL can be a full URL or a partial URL,
- // such as zones/[ZONE]/instances/[INSTANCE_NAME].
+ // Instances: The list of URLs of one or more instances for which you want to
+ // apply updates. Each URL can be a full URL or a partial URL, such as
+ // zones/[ZONE]/instances/[INSTANCE_NAME].
Instances []string `json:"instances,omitempty"`
-
- // MinimalAction: The minimal action that you want to perform on each
- // instance during the update: - REPLACE: At minimum, delete the
- // instance and create it again. - RESTART: Stop the instance and start
- // it again. - REFRESH: Do not stop the instance and limit disruption as
- // much as possible. - NONE: Do not disrupt the instance at all. By
- // default, the minimum action is NONE. If your update requires a more
- // disruptive action than you set with this flag, the necessary action
- // is performed to execute the update.
+ // MinimalAction: The minimal action that you want to perform on each instance
+ // during the update: - REPLACE: At minimum, delete the instance and create it
+ // again. - RESTART: Stop the instance and start it again. - REFRESH: Do not
+ // stop the instance and limit disruption as much as possible. - NONE: Do not
+ // disrupt the instance at all. By default, the minimum action is NONE. If your
+ // update requires a more disruptive action than you set with this flag, the
+ // necessary action is performed to execute the update.
//
// Possible values:
// "NONE" - Do not perform any action.
// "REFRESH" - Do not stop the instance.
- // "REPLACE" - (Default.) Replace the instance according to the
- // replacement method option.
+ // "REPLACE" - (Default.) Replace the instance according to the replacement
+ // method option.
// "RESTART" - Stop the instance and start it again.
MinimalAction string `json:"minimalAction,omitempty"`
-
- // MostDisruptiveAllowedAction: The most disruptive action that you want
- // to perform on each instance during the update: - REPLACE: Delete the
- // instance and create it again. - RESTART: Stop the instance and start
- // it again. - REFRESH: Do not stop the instance and limit disruption as
- // much as possible. - NONE: Do not disrupt the instance at all. By
- // default, the most disruptive allowed action is REPLACE. If your
- // update requires a more disruptive action than you set with this flag,
- // the update request will fail.
+ // MostDisruptiveAllowedAction: The most disruptive action that you want to
+ // perform on each instance during the update: - REPLACE: Delete the instance
+ // and create it again. - RESTART: Stop the instance and start it again. -
+ // REFRESH: Do not stop the instance and limit disruption as much as possible.
+ // - NONE: Do not disrupt the instance at all. By default, the most disruptive
+ // allowed action is REPLACE. If your update requires a more disruptive action
+ // than you set with this flag, the update request will fail.
//
// Possible values:
// "NONE" - Do not perform any action.
// "REFRESH" - Do not stop the instance.
- // "REPLACE" - (Default.) Replace the instance according to the
- // replacement method option.
+ // "REPLACE" - (Default.) Replace the instance according to the replacement
+ // method option.
// "RESTART" - Stop the instance and start it again.
MostDisruptiveAllowedAction string `json:"mostDisruptiveAllowedAction,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "AllInstances") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "AllInstances") 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. "AllInstances") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupManagersApplyUpdatesRequest) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupManagersApplyUpdatesRequest) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupManagersApplyUpdatesRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// InstanceGroupManagersCreateInstancesRequest:
@@ -20622,3487 +17675,3458 @@ func (s *InstanceGroupManagersApplyUpdatesRequest) MarshalJSON() ([]byte, error)
type InstanceGroupManagersCreateInstancesRequest struct {
// Instances: [Required] List of specifications of per-instance configs.
Instances []*PerInstanceConfig `json:"instances,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Instances") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Instances") 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. "Instances") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupManagersCreateInstancesRequest) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupManagersCreateInstancesRequest) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupManagersCreateInstancesRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceGroupManagersDeleteInstancesRequest struct {
- // Instances: The URLs of one or more instances to delete. This can be a
- // full URL or a partial URL, such as
- // zones/[ZONE]/instances/[INSTANCE_NAME]. Queued instances do not have
- // URL and can be deleted only by name. One cannot specify both URLs and
- // names in a single request.
+ // Instances: The URLs of one or more instances to delete. This can be a full
+ // URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. Queued
+ // instances do not have URL and can be deleted only by name. One cannot
+ // specify both URLs and names in a single request.
Instances []string `json:"instances,omitempty"`
-
- // SkipInstancesOnValidationError: Specifies whether the request should
- // proceed despite the inclusion of instances that are not members of
- // the group or that are already in the process of being deleted or
- // abandoned. If this field is set to `false` and such an instance is
- // specified in the request, the operation fails. The operation always
- // fails if the request contains a malformed instance URL or a reference
- // to an instance that exists in a zone or region other than the group's
- // zone or region.
+ // SkipInstancesOnValidationError: Specifies whether the request should proceed
+ // despite the inclusion of instances that are not members of the group or that
+ // are already in the process of being deleted or abandoned. If this field is
+ // set to `false` and such an instance is specified in the request, the
+ // operation fails. The operation always fails if the request contains a
+ // malformed instance URL or a reference to an instance that exists in a zone
+ // or region other than the group's zone or region.
SkipInstancesOnValidationError bool `json:"skipInstancesOnValidationError,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Instances") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Instances") 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. "Instances") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupManagersDeleteInstancesRequest) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupManagersDeleteInstancesRequest) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupManagersDeleteInstancesRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// InstanceGroupManagersDeletePerInstanceConfigsReq:
// InstanceGroupManagers.deletePerInstanceConfigs
type InstanceGroupManagersDeletePerInstanceConfigsReq struct {
- // Names: The list of instance names for which we want to delete
- // per-instance configs on this managed instance group.
+ // Names: The list of instance names for which we want to delete per-instance
+ // configs on this managed instance group.
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 or default 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 is a list of field names (e.g. "Names") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupManagersDeletePerInstanceConfigsReq) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupManagersDeletePerInstanceConfigsReq) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupManagersDeletePerInstanceConfigsReq
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceGroupManagersListErrorsResponse struct {
- // Items: [Output Only] The list of errors of the managed instance
- // group.
+ // Items: [Output Only] The list of errors of the managed instance group.
Items []*InstanceManagedByIgmError `json:"items,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Items") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Items") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Items") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupManagersListErrorsResponse) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupManagersListErrorsResponse) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupManagersListErrorsResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceGroupManagersListManagedInstancesResponse struct {
// ManagedInstances: [Output Only] The list of instances in the managed
// instance group.
ManagedInstances []*ManagedInstance `json:"managedInstances,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
// ForceSendFields is a list of field names (e.g. "ManagedInstances") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "ManagedInstances") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "ManagedInstances") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupManagersListManagedInstancesResponse) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupManagersListManagedInstancesResponse) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupManagersListManagedInstancesResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceGroupManagersListPerInstanceConfigsResp struct {
// Items: [Output Only] The list of PerInstanceConfig.
Items []*PerInstanceConfig `json:"items,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *InstanceGroupManagersListPerInstanceConfigsRespWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Items") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Items") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Items") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupManagersListPerInstanceConfigsResp) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupManagersListPerInstanceConfigsResp) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupManagersListPerInstanceConfigsResp
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// InstanceGroupManagersListPerInstanceConfigsRespWarning: [Output Only]
// Informational warning message.
type InstanceGroupManagersListPerInstanceConfigsRespWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*InstanceGroupManagersListPerInstanceConfigsRespWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupManagersListPerInstanceConfigsRespWarning) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupManagersListPerInstanceConfigsRespWarning) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupManagersListPerInstanceConfigsRespWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceGroupManagersListPerInstanceConfigsRespWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupManagersListPerInstanceConfigsRespWarningData) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupManagersListPerInstanceConfigsRespWarningData) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupManagersListPerInstanceConfigsRespWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// InstanceGroupManagersPatchPerInstanceConfigsReq:
// InstanceGroupManagers.patchPerInstanceConfigs
type InstanceGroupManagersPatchPerInstanceConfigsReq struct {
- // PerInstanceConfigs: The list of per-instance configurations to insert
- // or patch on this managed instance group.
+ // PerInstanceConfigs: The list of per-instance configurations to insert or
+ // patch on this managed instance group.
PerInstanceConfigs []*PerInstanceConfig `json:"perInstanceConfigs,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "PerInstanceConfigs")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "PerInstanceConfigs") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "PerInstanceConfigs") 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. "PerInstanceConfigs") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupManagersPatchPerInstanceConfigsReq) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupManagersPatchPerInstanceConfigsReq) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupManagersPatchPerInstanceConfigsReq
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceGroupManagersRecreateInstancesRequest struct {
- // Instances: The URLs of one or more instances to recreate. This can be
- // a full URL or a partial URL, such as
- // zones/[ZONE]/instances/[INSTANCE_NAME].
+ // Instances: The URLs of one or more instances to recreate. This can be a full
+ // URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME].
Instances []string `json:"instances,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Instances") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Instances") 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. "Instances") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupManagersRecreateInstancesRequest) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupManagersRecreateInstancesRequest) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupManagersRecreateInstancesRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceGroupManagersScopedList struct {
- // InstanceGroupManagers: [Output Only] The list of managed instance
- // groups that are contained in the specified project and zone.
+ // InstanceGroupManagers: [Output Only] The list of managed instance groups
+ // that are contained in the specified project and zone.
InstanceGroupManagers []*InstanceGroupManager `json:"instanceGroupManagers,omitempty"`
-
// Warning: [Output Only] The warning that replaces the list of managed
// instance groups when the list is empty.
Warning *InstanceGroupManagersScopedListWarning `json:"warning,omitempty"`
-
- // ForceSendFields is a list of field names (e.g.
- // "InstanceGroupManagers") to unconditionally include in API requests.
- // By default, fields with empty or default 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 is a list of field names (e.g. "InstanceGroupManagers") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "InstanceGroupManagers") 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.
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupManagersScopedList) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupManagersScopedList) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupManagersScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// InstanceGroupManagersScopedListWarning: [Output Only] The warning
-// that replaces the list of managed instance groups when the list is
-// empty.
+// InstanceGroupManagersScopedListWarning: [Output Only] The warning that
+// replaces the list of managed instance groups when the list is empty.
type InstanceGroupManagersScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*InstanceGroupManagersScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupManagersScopedListWarning) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupManagersScopedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupManagersScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceGroupManagersScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupManagersScopedListWarningData) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupManagersScopedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupManagersScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceGroupManagersSetInstanceTemplateRequest struct {
- // InstanceTemplate: The URL of the instance template that is specified
- // for this managed instance group. The group uses this template to
- // create all new instances in the managed instance group. The templates
- // for existing instances in the group do not change unless you run
- // recreateInstances, run applyUpdatesToInstances, or set the group's
- // updatePolicy.type to PROACTIVE.
+ // InstanceTemplate: The URL of the instance template that is specified for
+ // this managed instance group. The group uses this template to create all new
+ // instances in the managed instance group. The templates for existing
+ // instances in the group do not change unless you run recreateInstances, run
+ // applyUpdatesToInstances, or set the group's updatePolicy.type to PROACTIVE.
InstanceTemplate string `json:"instanceTemplate,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "InstanceTemplate") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "InstanceTemplate") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupManagersSetInstanceTemplateRequest) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupManagersSetInstanceTemplateRequest) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupManagersSetInstanceTemplateRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceGroupManagersSetTargetPoolsRequest struct {
- // Fingerprint: The fingerprint of the target pools information. Use
- // this optional property to prevent conflicts when multiple users
- // change the target pools settings concurrently. Obtain the fingerprint
- // with the instanceGroupManagers.get method. Then, include the
- // fingerprint in your request to ensure that you do not overwrite
- // changes that were applied from another concurrent request.
+ // Fingerprint: The fingerprint of the target pools information. Use this
+ // optional property to prevent conflicts when multiple users change the target
+ // pools settings concurrently. Obtain the fingerprint with the
+ // instanceGroupManagers.get method. Then, include the fingerprint in your
+ // request to ensure that you do not overwrite changes that were applied from
+ // another concurrent request.
Fingerprint string `json:"fingerprint,omitempty"`
-
- // TargetPools: The list of target pool URLs that instances in this
- // managed instance group belong to. The managed instance group applies
- // these target pools to all of the instances in the group. Existing
- // instances and new instances in the group all receive these target
- // pool settings.
+ // TargetPools: The list of target pool URLs that instances in this managed
+ // instance group belong to. The managed instance group applies these target
+ // pools to all of the instances in the group. Existing instances and new
+ // instances in the group all receive these target pool settings.
TargetPools []string `json:"targetPools,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Fingerprint") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Fingerprint") 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. "Fingerprint") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupManagersSetTargetPoolsRequest) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupManagersSetTargetPoolsRequest) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupManagersSetTargetPoolsRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// InstanceGroupManagersUpdatePerInstanceConfigsReq:
// InstanceGroupManagers.updatePerInstanceConfigs
type InstanceGroupManagersUpdatePerInstanceConfigsReq struct {
- // PerInstanceConfigs: The list of per-instance configurations to insert
- // or patch on this managed instance group.
+ // PerInstanceConfigs: The list of per-instance configurations to insert or
+ // patch on this managed instance group.
PerInstanceConfigs []*PerInstanceConfig `json:"perInstanceConfigs,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "PerInstanceConfigs")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "PerInstanceConfigs") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "PerInstanceConfigs") 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. "PerInstanceConfigs") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupManagersUpdatePerInstanceConfigsReq) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupManagersUpdatePerInstanceConfigsReq) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupManagersUpdatePerInstanceConfigsReq
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceGroupsAddInstancesRequest struct {
// Instances: The list of instances to add to the instance group.
Instances []*InstanceReference `json:"instances,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Instances") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Instances") 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. "Instances") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupsAddInstancesRequest) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupsAddInstancesRequest) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupsAddInstancesRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceGroupsListInstances struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of InstanceWithNamedPorts resources.
Items []*InstanceWithNamedPorts `json:"items,omitempty"`
-
// Kind: [Output Only] The resource type, which is always
// compute#instanceGroupsListInstances for the list of instances in the
// specified instance group.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *InstanceGroupsListInstancesWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupsListInstances) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupsListInstances) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupsListInstances
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// InstanceGroupsListInstancesWarning: [Output Only] Informational
-// warning message.
+// InstanceGroupsListInstancesWarning: [Output Only] Informational warning
+// message.
type InstanceGroupsListInstancesWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*InstanceGroupsListInstancesWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupsListInstancesWarning) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupsListInstancesWarning) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupsListInstancesWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceGroupsListInstancesWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupsListInstancesWarningData) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupsListInstancesWarningData) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupsListInstancesWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceGroupsListInstancesRequest struct {
- // InstanceState: A filter for the state of the instances in the
- // instance group. Valid options are ALL or RUNNING. If you do not
- // specify this parameter the list includes all instances regardless of
- // their state.
+ // InstanceState: A filter for the state of the instances in the instance
+ // group. Valid options are ALL or RUNNING. If you do not specify this
+ // parameter the list includes all instances regardless of their state.
//
// Possible values:
- // "ALL" - Includes all instances in the generated list regardless of
- // their state.
- // "RUNNING" - Includes instances in the generated list only if they
- // have a RUNNING state.
+ // "ALL" - Includes all instances in the generated list regardless of their
+ // state.
+ // "RUNNING" - Includes instances in the generated list only if they have a
+ // RUNNING state.
InstanceState string `json:"instanceState,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "InstanceState") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "InstanceState") 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. "InstanceState") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupsListInstancesRequest) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupsListInstancesRequest) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupsListInstancesRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceGroupsRemoveInstancesRequest struct {
// Instances: The list of instances to remove from the instance group.
Instances []*InstanceReference `json:"instances,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Instances") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Instances") 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. "Instances") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupsRemoveInstancesRequest) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupsRemoveInstancesRequest) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupsRemoveInstancesRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceGroupsScopedList struct {
- // InstanceGroups: [Output Only] The list of instance groups that are
- // contained in this scope.
+ // InstanceGroups: [Output Only] The list of instance groups that are contained
+ // in this scope.
InstanceGroups []*InstanceGroup `json:"instanceGroups,omitempty"`
-
- // Warning: [Output Only] An informational warning that replaces the
- // list of instance groups when the list is empty.
+ // Warning: [Output Only] An informational warning that replaces the list of
+ // instance groups when the list is empty.
Warning *InstanceGroupsScopedListWarning `json:"warning,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "InstanceGroups") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "InstanceGroups") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "InstanceGroups") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupsScopedList) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupsScopedList) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupsScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// InstanceGroupsScopedListWarning: [Output Only] An informational
-// warning that replaces the list of instance groups when the list is
-// empty.
+// InstanceGroupsScopedListWarning: [Output Only] An informational warning that
+// replaces the list of instance groups when the list is empty.
type InstanceGroupsScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*InstanceGroupsScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupsScopedListWarning) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupsScopedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupsScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceGroupsScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupsScopedListWarningData) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupsScopedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupsScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceGroupsSetNamedPortsRequest struct {
// Fingerprint: The fingerprint of the named ports information for this
// instance group. Use this optional property to prevent conflicts when
- // multiple users change the named ports settings concurrently. Obtain
- // the fingerprint with the instanceGroups.get method. Then, include the
- // fingerprint in your request to ensure that you do not overwrite
- // changes that were applied from another concurrent request. A request
- // with an incorrect fingerprint will fail with error 412
- // conditionNotMet.
+ // multiple users change the named ports settings concurrently. Obtain the
+ // fingerprint with the instanceGroups.get method. Then, include the
+ // fingerprint in your request to ensure that you do not overwrite changes that
+ // were applied from another concurrent request. A request with an incorrect
+ // fingerprint will fail with error 412 conditionNotMet.
Fingerprint string `json:"fingerprint,omitempty"`
-
// NamedPorts: The list of named ports to set for this instance group.
NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Fingerprint") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Fingerprint") 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. "Fingerprint") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceGroupsSetNamedPortsRequest) MarshalJSON() ([]byte, error) {
+func (s InstanceGroupsSetNamedPortsRequest) MarshalJSON() ([]byte, error) {
type NoMethod InstanceGroupsSetNamedPortsRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// InstanceList: Contains a list of instances.
type InstanceList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of Instance resources.
Items []*Instance `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource. Always compute#instanceList for
- // lists of Instance resources.
+ // Kind: [Output Only] Type of resource. Always compute#instanceList for lists
+ // of Instance resources.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *InstanceListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceList) MarshalJSON() ([]byte, error) {
+func (s InstanceList) MarshalJSON() ([]byte, error) {
type NoMethod InstanceList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// InstanceListWarning: [Output Only] Informational warning message.
type InstanceListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*InstanceListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceListWarning) MarshalJSON() ([]byte, error) {
+func (s InstanceListWarning) MarshalJSON() ([]byte, error) {
type NoMethod InstanceListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceListWarningData) MarshalJSON() ([]byte, error) {
+func (s InstanceListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod InstanceListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// InstanceListReferrers: Contains a list of instance referrers.
type InstanceListReferrers struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of Reference resources.
Items []*Reference `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource. Always
- // compute#instanceListReferrers for lists of Instance referrers.
+ // Kind: [Output Only] Type of resource. Always compute#instanceListReferrers
+ // for lists of Instance referrers.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *InstanceListReferrersWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceListReferrers) MarshalJSON() ([]byte, error) {
+func (s InstanceListReferrers) MarshalJSON() ([]byte, error) {
type NoMethod InstanceListReferrers
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// InstanceListReferrersWarning: [Output Only] Informational warning
-// message.
+// InstanceListReferrersWarning: [Output Only] Informational warning message.
type InstanceListReferrersWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*InstanceListReferrersWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceListReferrersWarning) MarshalJSON() ([]byte, error) {
+func (s InstanceListReferrersWarning) MarshalJSON() ([]byte, error) {
type NoMethod InstanceListReferrersWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceListReferrersWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceListReferrersWarningData) MarshalJSON() ([]byte, error) {
+func (s InstanceListReferrersWarningData) MarshalJSON() ([]byte, error) {
type NoMethod InstanceListReferrersWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceManagedByIgmError struct {
// Error: [Output Only] Contents of the error.
Error *InstanceManagedByIgmErrorManagedInstanceError `json:"error,omitempty"`
-
- // InstanceActionDetails: [Output Only] Details of the instance action
- // that triggered this error. May be null, if the error was not caused
- // by an action on an instance. This field is optional.
+ // InstanceActionDetails: [Output Only] Details of the instance action that
+ // triggered this error. May be null, if the error was not caused by an action
+ // on an instance. This field is optional.
InstanceActionDetails *InstanceManagedByIgmErrorInstanceActionDetails `json:"instanceActionDetails,omitempty"`
-
- // Timestamp: [Output Only] The time that this error occurred. This
- // value is in RFC3339 text format.
+ // Timestamp: [Output Only] The time that this error occurred. This value is in
+ // RFC3339 text format.
Timestamp string `json:"timestamp,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Error") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Error") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Error") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceManagedByIgmError) MarshalJSON() ([]byte, error) {
+func (s InstanceManagedByIgmError) MarshalJSON() ([]byte, error) {
type NoMethod InstanceManagedByIgmError
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceManagedByIgmErrorInstanceActionDetails struct {
- // Action: [Output Only] Action that managed instance group was
- // executing on the instance when the error occurred. Possible values:
- //
- // Possible values:
- // "ABANDONING" - The managed instance group is abandoning this
- // instance. The instance will be removed from the instance group and
- // from any target pools that are associated with this group.
- // "CREATING" - The managed instance group is creating this instance.
- // If the group fails to create this instance, it will try again until
- // it is successful.
- // "CREATING_WITHOUT_RETRIES" - The managed instance group is
- // attempting to create this instance only once. If the group fails to
- // create this instance, it does not try again and the group's
- // targetSize value is decreased.
- // "DELETING" - The managed instance group is permanently deleting
- // this instance.
- // "NONE" - The managed instance group has not scheduled any actions
- // for this instance.
- // "RECREATING" - The managed instance group is recreating this
- // instance.
- // "REFRESHING" - The managed instance group is applying configuration
- // changes to the instance without stopping it. For example, the group
- // can update the target pool list for an instance without stopping that
+ // Action: [Output Only] Action that managed instance group was executing on
+ // the instance when the error occurred. Possible values:
+ //
+ // Possible values:
+ // "ABANDONING" - The managed instance group is abandoning this instance. The
+ // instance will be removed from the instance group and from any target pools
+ // that are associated with this group.
+ // "CREATING" - The managed instance group is creating this instance. If the
+ // group fails to create this instance, it will try again until it is
+ // successful.
+ // "CREATING_WITHOUT_RETRIES" - The managed instance group is attempting to
+ // create this instance only once. If the group fails to create this instance,
+ // it does not try again and the group's targetSize value is decreased.
+ // "DELETING" - The managed instance group is permanently deleting this
// instance.
- // "RESTARTING" - The managed instance group is restarting this
+ // "NONE" - The managed instance group has not scheduled any actions for this
// instance.
+ // "RECREATING" - The managed instance group is recreating this instance.
+ // "REFRESHING" - The managed instance group is applying configuration
+ // changes to the instance without stopping it. For example, the group can
+ // update the target pool list for an instance without stopping that instance.
+ // "RESTARTING" - The managed instance group is restarting this instance.
// "RESUMING" - The managed instance group is resuming this instance.
// "STARTING" - The managed instance group is starting this instance.
// "STOPPING" - The managed instance group is stopping this instance.
- // "SUSPENDING" - The managed instance group is suspending this
- // instance.
- // "VERIFYING" - The managed instance group is verifying this already
- // created instance. Verification happens every time the instance is
- // (re)created or restarted and consists of: 1. Waiting until health
- // check specified as part of this managed instance group's autohealing
- // policy reports HEALTHY. Note: Applies only if autohealing policy has
- // a health check specified 2. Waiting for addition verification steps
- // performed as post-instance creation (subject to future extensions).
+ // "SUSPENDING" - The managed instance group is suspending this instance.
+ // "VERIFYING" - The managed instance group is verifying this already created
+ // instance. Verification happens every time the instance is (re)created or
+ // restarted and consists of: 1. Waiting until health check specified as part
+ // of this managed instance group's autohealing policy reports HEALTHY. Note:
+ // Applies only if autohealing policy has a health check specified 2. Waiting
+ // for addition verification steps performed as post-instance creation (subject
+ // to future extensions).
Action string `json:"action,omitempty"`
-
- // Instance: [Output Only] The URL of the instance. The URL can be set
- // even if the instance has not yet been created.
+ // Instance: [Output Only] The URL of the instance. The URL can be set even if
+ // the instance has not yet been created.
Instance string `json:"instance,omitempty"`
-
- // Version: [Output Only] Version this instance was created from, or was
- // being created from, but the creation failed. Corresponds to one of
- // the versions that were set on the Instance Group Manager resource at
- // the time this instance was being created.
+ // Version: [Output Only] Version this instance was created from, or was being
+ // created from, but the creation failed. Corresponds to one of the versions
+ // that were set on the Instance Group Manager resource at the time this
+ // instance was being created.
Version *ManagedInstanceVersion `json:"version,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Action") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Action") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Action") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceManagedByIgmErrorInstanceActionDetails) MarshalJSON() ([]byte, error) {
+func (s InstanceManagedByIgmErrorInstanceActionDetails) MarshalJSON() ([]byte, error) {
type NoMethod InstanceManagedByIgmErrorInstanceActionDetails
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceManagedByIgmErrorManagedInstanceError struct {
// Code: [Output Only] Error code.
Code string `json:"code,omitempty"`
-
// Message: [Output Only] Error message.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceManagedByIgmErrorManagedInstanceError) MarshalJSON() ([]byte, error) {
+func (s InstanceManagedByIgmErrorManagedInstanceError) MarshalJSON() ([]byte, error) {
type NoMethod InstanceManagedByIgmErrorManagedInstanceError
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceMoveRequest struct {
- // DestinationZone: The URL of the destination zone to move the
- // instance. This can be a full or partial URL. For example, the
- // following are all valid URLs to a zone: -
+ // DestinationZone: The URL of the destination zone to move the instance. This
+ // can be a full or partial URL. For example, the following are all valid URLs
+ // to a zone: -
// https://www.googleapis.com/compute/v1/projects/project/zones/zone -
// projects/project/zones/zone - zones/zone
DestinationZone string `json:"destinationZone,omitempty"`
-
- // TargetInstance: The URL of the target instance to move. This can be a
- // full or partial URL. For example, the following are all valid URLs to
- // an instance: -
+ // TargetInstance: The URL of the target instance to move. This can be a full
+ // or partial URL. For example, the following are all valid URLs to an
+ // instance: -
// https://www.googleapis.com/compute/v1/projects/project/zones/zone
- // /instances/instance - projects/project/zones/zone/instances/instance
- // - zones/zone/instances/instance
+ // /instances/instance - projects/project/zones/zone/instances/instance -
+ // zones/zone/instances/instance
TargetInstance string `json:"targetInstance,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "DestinationZone") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "DestinationZone") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "DestinationZone") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceMoveRequest) MarshalJSON() ([]byte, error) {
+func (s InstanceMoveRequest) MarshalJSON() ([]byte, error) {
type NoMethod InstanceMoveRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// InstanceParams: Additional instance params.
type InstanceParams struct {
- // ResourceManagerTags: Resource manager tags to be bound to the
- // instance. Tag keys and values have the same definition as resource
- // manager tags. Keys must be in the format `tagKeys/{tag_key_id}`, and
- // values are in the format `tagValues/456`. The field is ignored (both
- // PUT & PATCH) when empty.
+ // ResourceManagerTags: Resource manager tags to be bound to the instance. Tag
+ // keys and values have the same definition as resource manager tags. Keys must
+ // be in the format `tagKeys/{tag_key_id}`, and values are in the format
+ // `tagValues/456`. The field is ignored (both PUT & PATCH) when empty.
ResourceManagerTags map[string]string `json:"resourceManagerTags,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "ResourceManagerTags")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "ResourceManagerTags") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "ResourceManagerTags") 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. "ResourceManagerTags") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceParams) MarshalJSON() ([]byte, error) {
+func (s InstanceParams) MarshalJSON() ([]byte, error) {
type NoMethod InstanceParams
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceProperties struct {
- // AdvancedMachineFeatures: Controls for advanced machine-related
- // behavior features. Note that for MachineImage, this is not supported
- // yet.
+ // AdvancedMachineFeatures: Controls for advanced machine-related behavior
+ // features. Note that for MachineImage, this is not supported yet.
AdvancedMachineFeatures *AdvancedMachineFeatures `json:"advancedMachineFeatures,omitempty"`
-
- // CanIpForward: Enables instances created based on these properties to
- // send packets with source IP addresses other than their own and
- // receive packets with destination IP addresses other than their own.
- // If these instances will be used as an IP gateway or it will be set as
- // the next-hop in a Route resource, specify true. If unsure, leave this
- // set to false. See the Enable IP forwarding documentation for more
- // information.
+ // CanIpForward: Enables instances created based on these properties to send
+ // packets with source IP addresses other than their own and receive packets
+ // with destination IP addresses other than their own. If these instances will
+ // be used as an IP gateway or it will be set as the next-hop in a Route
+ // resource, specify true. If unsure, leave this set to false. See the Enable
+ // IP forwarding documentation for more information.
CanIpForward bool `json:"canIpForward,omitempty"`
-
- // ConfidentialInstanceConfig: Specifies the Confidential Instance
- // options. Note that for MachineImage, this is not supported yet.
+ // ConfidentialInstanceConfig: Specifies the Confidential Instance options.
+ // Note that for MachineImage, this is not supported yet.
ConfidentialInstanceConfig *ConfidentialInstanceConfig `json:"confidentialInstanceConfig,omitempty"`
-
- // Description: An optional text description for the instances that are
- // created from these properties.
+ // Description: An optional text description for the instances that are created
+ // from these properties.
Description string `json:"description,omitempty"`
-
- // Disks: An array of disks that are associated with the instances that
- // are created from these properties.
+ // Disks: An array of disks that are associated with the instances that are
+ // created from these properties.
Disks []*AttachedDisk `json:"disks,omitempty"`
-
- // GuestAccelerators: A list of guest accelerator cards' type and count
- // to use for instances created from these properties.
+ // GuestAccelerators: A list of guest accelerator cards' type and count to use
+ // for instances created from these properties.
GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
-
- // KeyRevocationActionType: KeyRevocationActionType of the instance.
- // Supported options are "STOP" and "NONE". The default value is "NONE"
- // if it is not specified.
+ // KeyRevocationActionType: KeyRevocationActionType of the instance. Supported
+ // options are "STOP" and "NONE". The default value is "NONE" if it is not
+ // specified.
//
// Possible values:
- // "KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED" - Default value. This
- // value is unused.
+ // "KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED" - Default value. This value is
+ // unused.
// "NONE" - Indicates user chose no operation.
- // "STOP" - Indicates user chose to opt for VM shutdown on key
- // revocation.
+ // "STOP" - Indicates user chose to opt for VM shutdown on key revocation.
KeyRevocationActionType string `json:"keyRevocationActionType,omitempty"`
-
- // Labels: Labels to apply to instances that are created from these
- // properties.
+ // Labels: Labels to apply to instances that are created from these properties.
Labels map[string]string `json:"labels,omitempty"`
-
- // MachineType: The machine type to use for instances that are created
- // from these properties.
+ // MachineType: The machine type to use for instances that are created from
+ // these properties. This field only accepts a machine type name, for example
+ // `n2-standard-4`. If you use the machine type full or partial URL, for
+ // example
+ // `projects/my-l7ilb-project/zones/us-central1-a/machineTypes/n2-standard-4`,
+ // the request will result in an `INTERNAL_ERROR`.
MachineType string `json:"machineType,omitempty"`
-
- // Metadata: The metadata key/value pairs to assign to instances that
- // are created from these properties. These pairs can consist of custom
- // metadata or predefined keys. See Project and instance metadata for
- // more information.
+ // Metadata: The metadata key/value pairs to assign to instances that are
+ // created from these properties. These pairs can consist of custom metadata or
+ // predefined keys. See Project and instance metadata for more information.
Metadata *Metadata `json:"metadata,omitempty"`
-
- // MinCpuPlatform: Minimum cpu/platform to be used by instances. The
- // instance may be scheduled on the specified or newer cpu/platform.
- // Applicable values are the friendly names of CPU platforms, such as
- // minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy
- // Bridge". For more information, read Specifying a Minimum CPU
- // Platform.
+ // MinCpuPlatform: Minimum cpu/platform to be used by instances. The instance
+ // may be scheduled on the specified or newer cpu/platform. Applicable values
+ // are the friendly names of CPU platforms, such as minCpuPlatform: "Intel
+ // Haswell" or minCpuPlatform: "Intel Sandy Bridge". For more information, read
+ // Specifying a Minimum CPU Platform.
MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
-
// NetworkInterfaces: An array of network access configurations for this
// interface.
NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"`
-
- // NetworkPerformanceConfig: Note that for MachineImage, this is not
- // supported yet.
+ // NetworkPerformanceConfig: Note that for MachineImage, this is not supported
+ // yet.
NetworkPerformanceConfig *NetworkPerformanceConfig `json:"networkPerformanceConfig,omitempty"`
-
- // PrivateIpv6GoogleAccess: The private IPv6 google access type for VMs.
- // If not specified, use INHERIT_FROM_SUBNETWORK as default. Note that
- // for MachineImage, this is not supported yet.
- //
- // Possible values:
- // "ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE" - Bidirectional private
- // IPv6 access to/from Google services. If specified, the subnetwork who
- // is attached to the instance's default network interface will be
- // assigned an internal IPv6 prefix if it doesn't have before.
- // "ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE" - Outbound private IPv6
- // access from VMs in this subnet to Google services. If specified, the
- // subnetwork who is attached to the instance's default network
- // interface will be assigned an internal IPv6 prefix if it doesn't have
- // before.
+ // PrivateIpv6GoogleAccess: The private IPv6 google access type for VMs. If not
+ // specified, use INHERIT_FROM_SUBNETWORK as default. Note that for
+ // MachineImage, this is not supported yet.
+ //
+ // Possible values:
+ // "ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE" - Bidirectional private IPv6
+ // access to/from Google services. If specified, the subnetwork who is attached
+ // to the instance's default network interface will be assigned an internal
+ // IPv6 prefix if it doesn't have before.
+ // "ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE" - Outbound private IPv6 access from
+ // VMs in this subnet to Google services. If specified, the subnetwork who is
+ // attached to the instance's default network interface will be assigned an
+ // internal IPv6 prefix if it doesn't have before.
// "INHERIT_FROM_SUBNETWORK" - Each network interface inherits
// PrivateIpv6GoogleAccess from its subnetwork.
PrivateIpv6GoogleAccess string `json:"privateIpv6GoogleAccess,omitempty"`
-
- // ReservationAffinity: Specifies the reservations that instances can
- // consume from. Note that for MachineImage, this is not supported yet.
+ // ReservationAffinity: Specifies the reservations that instances can consume
+ // from. Note that for MachineImage, this is not supported yet.
ReservationAffinity *ReservationAffinity `json:"reservationAffinity,omitempty"`
-
- // ResourceManagerTags: Resource manager tags to be bound to the
- // instance. Tag keys and values have the same definition as resource
- // manager tags. Keys must be in the format `tagKeys/{tag_key_id}`, and
- // values are in the format `tagValues/456`. The field is ignored (both
- // PUT & PATCH) when empty.
+ // ResourceManagerTags: Resource manager tags to be bound to the instance. Tag
+ // keys and values have the same definition as resource manager tags. Keys must
+ // be in the format `tagKeys/{tag_key_id}`, and values are in the format
+ // `tagValues/456`. The field is ignored (both PUT & PATCH) when empty.
ResourceManagerTags map[string]string `json:"resourceManagerTags,omitempty"`
-
- // ResourcePolicies: Resource policies (names, not URLs) applied to
- // instances created from these properties. Note that for MachineImage,
- // this is not supported yet.
+ // ResourcePolicies: Resource policies (names, not URLs) applied to instances
+ // created from these properties. Note that for MachineImage, this is not
+ // supported yet.
ResourcePolicies []string `json:"resourcePolicies,omitempty"`
-
- // Scheduling: Specifies the scheduling options for the instances that
- // are created from these properties.
+ // Scheduling: Specifies the scheduling options for the instances that are
+ // created from these properties.
Scheduling *Scheduling `json:"scheduling,omitempty"`
-
- // ServiceAccounts: A list of service accounts with specified scopes.
- // Access tokens for these service accounts are available to the
- // instances that are created from these properties. Use metadata
- // queries to obtain the access tokens for these instances.
+ // ServiceAccounts: A list of service accounts with specified scopes. Access
+ // tokens for these service accounts are available to the instances that are
+ // created from these properties. Use metadata queries to obtain the access
+ // tokens for these instances.
ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"`
-
- // ShieldedInstanceConfig: Note that for MachineImage, this is not
- // supported yet.
+ // ShieldedInstanceConfig: Note that for MachineImage, this is not supported
+ // yet.
ShieldedInstanceConfig *ShieldedInstanceConfig `json:"shieldedInstanceConfig,omitempty"`
-
- // Tags: A list of tags to apply to the instances that are created from
- // these properties. The tags identify valid sources or targets for
- // network firewalls. The setTags method can modify this list of tags.
- // Each tag within the list must comply with RFC1035.
+ // Tags: A list of tags to apply to the instances that are created from these
+ // properties. The tags identify valid sources or targets for network
+ // firewalls. The setTags method can modify this list of tags. Each tag within
+ // the list must comply with RFC1035.
Tags *Tags `json:"tags,omitempty"`
-
- // ForceSendFields is a list of field names (e.g.
- // "AdvancedMachineFeatures") to unconditionally include in API
- // requests. By default, fields with empty or default 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. "AdvancedMachineFeatures")
- // 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.
+ // ForceSendFields is a list of field names (e.g. "AdvancedMachineFeatures") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "AdvancedMachineFeatures") to
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceProperties) MarshalJSON() ([]byte, error) {
+func (s InstanceProperties) MarshalJSON() ([]byte, error) {
type NoMethod InstanceProperties
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+// InstancePropertiesPatch: Represents the change that you want to make to the
+// instance properties.
+type InstancePropertiesPatch struct {
+ // Labels: The label key-value pairs that you want to patch onto the instance.
+ Labels map[string]string `json:"labels,omitempty"`
+ // Metadata: The metadata key-value pairs that you want to patch onto the
+ // instance. For more information, see Project and instance metadata.
+ Metadata map[string]string `json:"metadata,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Labels") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Labels") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s InstancePropertiesPatch) MarshalJSON() ([]byte, error) {
+ type NoMethod InstancePropertiesPatch
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceReference struct {
// Instance: The URL for a specific instance. @required
// compute.instancegroups.addInstances/removeInstances
Instance string `json:"instance,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Instance") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Instance") 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. "Instance") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceReference) MarshalJSON() ([]byte, error) {
+func (s InstanceReference) MarshalJSON() ([]byte, error) {
type NoMethod InstanceReference
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+// InstanceSettings: Represents a Instance Settings resource. You can use
+// instance settings to configure default settings for Compute Engine VM
+// instances. For example, you can use it to configure default machine type of
+// Compute Engine VM instances.
+type InstanceSettings struct {
+ // Fingerprint: Specifies a fingerprint for instance settings, which is
+ // essentially a hash of the instance settings resource's contents and used for
+ // optimistic locking. The fingerprint is initially generated by Compute Engine
+ // and changes after every request to modify or update the instance settings
+ // resource. You must always provide an up-to-date fingerprint hash in order to
+ // update or change the resource, otherwise the request will fail with error
+ // 412 conditionNotMet. To see the latest fingerprint, make a get() request to
+ // retrieve the resource.
+ Fingerprint string `json:"fingerprint,omitempty"`
+ // Kind: [Output Only] Type of the resource. Always compute#instance_settings
+ // for instance settings.
+ Kind string `json:"kind,omitempty"`
+ // Metadata: The metadata key/value pairs assigned to all the instances in the
+ // corresponding scope.
+ Metadata *InstanceSettingsMetadata `json:"metadata,omitempty"`
+ // Zone: [Output Only] URL of the zone where the resource resides You must
+ // specify this field as part of the HTTP request URL. It is not settable as a
+ // field in the request body.
+ Zone string `json:"zone,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "Fingerprint") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Fingerprint") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
}
-// InstanceTemplate: Represents an Instance Template resource. Google
-// Compute Engine has two Instance Template resources: * Global
-// (/compute/docs/reference/rest/v1/instanceTemplates) * Regional
-// (/compute/docs/reference/rest/v1/regionInstanceTemplates) You can
-// reuse a global instance template in different regions whereas you can
-// use a regional instance template in a specified region only. If you
-// want to reduce cross-region dependency or achieve data residency, use
-// a regional instance template. To create VMs, managed instance groups,
-// and reservations, you can use either global or regional instance
-// templates. For more information, read Instance Templates.
-type InstanceTemplate struct {
- // CreationTimestamp: [Output Only] The creation timestamp for this
- // instance template in RFC3339 text format.
- CreationTimestamp string `json:"creationTimestamp,omitempty"`
+func (s InstanceSettings) MarshalJSON() ([]byte, error) {
+ type NoMethod InstanceSettings
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
- Description string `json:"description,omitempty"`
+type InstanceSettingsMetadata struct {
+ // Items: A metadata key/value items map. The total size of all keys and values
+ // must be less than 512KB.
+ Items map[string]string `json:"items,omitempty"`
+ // Kind: [Output Only] Type of the resource. Always compute#metadata for
+ // metadata.
+ Kind string `json:"kind,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Items") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Items") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
- // Id: [Output Only] A unique identifier for this instance template. The
- // server defines this identifier.
- Id uint64 `json:"id,omitempty,string"`
+func (s InstanceSettingsMetadata) MarshalJSON() ([]byte, error) {
+ type NoMethod InstanceSettingsMetadata
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+// InstanceTemplate: Represents an Instance Template resource. Google Compute
+// Engine has two Instance Template resources: * Global
+// (/compute/docs/reference/rest/v1/instanceTemplates) * Regional
+// (/compute/docs/reference/rest/v1/regionInstanceTemplates) You can reuse a
+// global instance template in different regions whereas you can use a regional
+// instance template in a specified region only. If you want to reduce
+// cross-region dependency or achieve data residency, use a regional instance
+// template. To create VMs, managed instance groups, and reservations, you can
+// use either global or regional instance templates. For more information, read
+// Instance Templates.
+type InstanceTemplate struct {
+ // CreationTimestamp: [Output Only] The creation timestamp for this instance
+ // template in RFC3339 text format.
+ CreationTimestamp string `json:"creationTimestamp,omitempty"`
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
+ Description string `json:"description,omitempty"`
+ // Id: [Output Only] A unique identifier for this instance template. The server
+ // defines this identifier.
+ Id uint64 `json:"id,omitempty,string"`
// Kind: [Output Only] The resource type, which is always
// compute#instanceTemplate for instance templates.
Kind string `json:"kind,omitempty"`
-
- // Name: Name of the resource; provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
- // the first character must be a lowercase letter, and all following
- // characters must be a dash, lowercase letter, or digit, except the
- // last character, which cannot be a dash.
+ // Name: Name of the resource; provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must
+ // be a lowercase letter, and all following characters must be a dash,
+ // lowercase letter, or digit, except the last character, which cannot be a
+ // dash.
Name string `json:"name,omitempty"`
-
// Properties: The instance properties for this instance template.
Properties *InstanceProperties `json:"properties,omitempty"`
-
- // Region: [Output Only] URL of the region where the instance template
- // resides. Only applicable for regional resources.
+ // Region: [Output Only] URL of the region where the instance template resides.
+ // Only applicable for regional resources.
Region string `json:"region,omitempty"`
-
- // SelfLink: [Output Only] The URL for this instance template. The
- // server defines this URL.
+ // SelfLink: [Output Only] The URL for this instance template. The server
+ // defines this URL.
SelfLink string `json:"selfLink,omitempty"`
-
- // SourceInstance: The source instance used to create the template. You
- // can provide this as a partial or full URL to the resource. For
- // example, the following are valid values: -
+ // SourceInstance: The source instance used to create the template. You can
+ // provide this as a partial or full URL to the resource. For example, the
+ // following are valid values: -
// https://www.googleapis.com/compute/v1/projects/project/zones/zone
// /instances/instance - projects/project/zones/zone/instances/instance
SourceInstance string `json:"sourceInstance,omitempty"`
-
- // SourceInstanceParams: The source instance params to use to create
- // this instance template.
+ // SourceInstanceParams: The source instance params to use to create this
+ // instance template.
SourceInstanceParams *SourceInstanceParams `json:"sourceInstanceParams,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "CreationTimestamp") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CreationTimestamp") 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. "CreationTimestamp") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceTemplate) MarshalJSON() ([]byte, error) {
+func (s InstanceTemplate) MarshalJSON() ([]byte, error) {
type NoMethod InstanceTemplate
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// InstanceTemplateAggregatedList: Contains a list of
// InstanceTemplatesScopedList.
type InstanceTemplateAggregatedList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of InstanceTemplatesScopedList resources.
Items map[string]InstanceTemplatesScopedList `json:"items,omitempty"`
-
// Kind: Type of resource.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *InstanceTemplateAggregatedListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceTemplateAggregatedList) MarshalJSON() ([]byte, error) {
+func (s InstanceTemplateAggregatedList) MarshalJSON() ([]byte, error) {
type NoMethod InstanceTemplateAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// InstanceTemplateAggregatedListWarning: [Output Only] Informational
-// warning message.
+// InstanceTemplateAggregatedListWarning: [Output Only] Informational warning
+// message.
type InstanceTemplateAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*InstanceTemplateAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceTemplateAggregatedListWarning) MarshalJSON() ([]byte, error) {
+func (s InstanceTemplateAggregatedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod InstanceTemplateAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceTemplateAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceTemplateAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+func (s InstanceTemplateAggregatedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod InstanceTemplateAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// InstanceTemplateList: A list of instance templates.
type InstanceTemplateList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of InstanceTemplate resources.
Items []*InstanceTemplate `json:"items,omitempty"`
-
// Kind: [Output Only] The resource type, which is always
// compute#instanceTemplatesListResponse for instance template lists.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *InstanceTemplateListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceTemplateList) MarshalJSON() ([]byte, error) {
+func (s InstanceTemplateList) MarshalJSON() ([]byte, error) {
type NoMethod InstanceTemplateList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// InstanceTemplateListWarning: [Output Only] Informational warning
-// message.
+// InstanceTemplateListWarning: [Output Only] Informational warning message.
type InstanceTemplateListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*InstanceTemplateListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceTemplateListWarning) MarshalJSON() ([]byte, error) {
+func (s InstanceTemplateListWarning) MarshalJSON() ([]byte, error) {
type NoMethod InstanceTemplateListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceTemplateListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceTemplateListWarningData) MarshalJSON() ([]byte, error) {
+func (s InstanceTemplateListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod InstanceTemplateListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceTemplatesScopedList struct {
- // InstanceTemplates: [Output Only] A list of instance templates that
- // are contained within the specified project and zone.
+ // InstanceTemplates: [Output Only] A list of instance templates that are
+ // contained within the specified project and zone.
InstanceTemplates []*InstanceTemplate `json:"instanceTemplates,omitempty"`
-
- // Warning: [Output Only] An informational warning that replaces the
- // list of instance templates when the list is empty.
+ // Warning: [Output Only] An informational warning that replaces the list of
+ // instance templates when the list is empty.
Warning *InstanceTemplatesScopedListWarning `json:"warning,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "InstanceTemplates")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "InstanceTemplates") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "InstanceTemplates") 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. "InstanceTemplates") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceTemplatesScopedList) MarshalJSON() ([]byte, error) {
+func (s InstanceTemplatesScopedList) MarshalJSON() ([]byte, error) {
type NoMethod InstanceTemplatesScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// InstanceTemplatesScopedListWarning: [Output Only] An informational
-// warning that replaces the list of instance templates when the list is
-// empty.
+// InstanceTemplatesScopedListWarning: [Output Only] An informational warning
+// that replaces the list of instance templates when the list is empty.
type InstanceTemplatesScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*InstanceTemplatesScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceTemplatesScopedListWarning) MarshalJSON() ([]byte, error) {
+func (s InstanceTemplatesScopedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod InstanceTemplatesScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceTemplatesScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceTemplatesScopedListWarningData) MarshalJSON() ([]byte, error) {
+func (s InstanceTemplatesScopedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod InstanceTemplatesScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstanceWithNamedPorts struct {
// Instance: [Output Only] The URL of the instance.
Instance string `json:"instance,omitempty"`
-
- // NamedPorts: [Output Only] The named ports that belong to this
- // instance group.
+ // NamedPorts: [Output Only] The named ports that belong to this instance
+ // group.
NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
-
// Status: [Output Only] The status of the instance.
//
// Possible values:
- // "DEPROVISIONING" - The instance is halted and we are performing
- // tear down tasks like network deprogramming, releasing quota, IP,
- // tearing down disks etc.
+ // "DEPROVISIONING" - The instance is halted and we are performing tear down
+ // tasks like network deprogramming, releasing quota, IP, tearing down disks
+ // etc.
// "PROVISIONING" - Resources are being allocated for the instance.
// "REPAIRING" - The instance is in repair.
// "RUNNING" - The instance is running.
- // "STAGING" - All required resources have been allocated and the
- // instance is being started.
+ // "STAGING" - All required resources have been allocated and the instance is
+ // being started.
// "STOPPED" - The instance has stopped successfully.
- // "STOPPING" - The instance is currently stopping (either being
- // deleted or killed).
+ // "STOPPING" - The instance is currently stopping (either being deleted or
+ // killed).
// "SUSPENDED" - The instance has suspended.
// "SUSPENDING" - The instance is suspending.
- // "TERMINATED" - The instance has stopped (either by explicit action
- // or underlying failure).
+ // "TERMINATED" - The instance has stopped (either by explicit action or
+ // underlying failure).
Status string `json:"status,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Instance") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Instance") 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. "Instance") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstanceWithNamedPorts) MarshalJSON() ([]byte, error) {
+func (s InstanceWithNamedPorts) MarshalJSON() ([]byte, error) {
type NoMethod InstanceWithNamedPorts
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstancesAddResourcePoliciesRequest struct {
// ResourcePolicies: Resource policies to be added to this instance.
ResourcePolicies []string `json:"resourcePolicies,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "ResourcePolicies") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "ResourcePolicies") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstancesAddResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
+func (s InstancesAddResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
type NoMethod InstancesAddResourcePoliciesRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstancesBulkInsertOperationMetadata struct {
- // PerLocationStatus: Status information per location (location name is
- // key). Example key: zones/us-central1-a
+ // PerLocationStatus: Status information per location (location name is key).
+ // Example key: zones/us-central1-a
PerLocationStatus map[string]BulkInsertOperationStatus `json:"perLocationStatus,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "PerLocationStatus")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "PerLocationStatus") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "PerLocationStatus") 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. "PerLocationStatus") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstancesBulkInsertOperationMetadata) MarshalJSON() ([]byte, error) {
+func (s InstancesBulkInsertOperationMetadata) MarshalJSON() ([]byte, error) {
type NoMethod InstancesBulkInsertOperationMetadata
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstancesGetEffectiveFirewallsResponse struct {
- // FirewallPolicys: Effective firewalls from firewall policies.
+ // FirewallPolicys: [Output Only] Effective firewalls from firewall policies.
FirewallPolicys []*InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy `json:"firewallPolicys,omitempty"`
-
// Firewalls: Effective firewalls on the instance.
Firewalls []*Firewall `json:"firewalls,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
// ForceSendFields is a list of field names (e.g. "FirewallPolicys") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "FirewallPolicys") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "FirewallPolicys") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstancesGetEffectiveFirewallsResponse) MarshalJSON() ([]byte, error) {
+func (s InstancesGetEffectiveFirewallsResponse) MarshalJSON() ([]byte, error) {
type NoMethod InstancesGetEffectiveFirewallsResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy struct {
- // DisplayName: [Output Only] Deprecated, please use short name instead.
- // The display name of the firewall policy.
+ // DisplayName: [Output Only] Deprecated, please use short name instead. The
+ // display name of the firewall policy.
DisplayName string `json:"displayName,omitempty"`
-
// Name: [Output Only] The name of the firewall policy.
Name string `json:"name,omitempty"`
-
- // Rules: The rules that apply to the network.
+ // Priority: [Output only] Priority of firewall policy association. Not
+ // applicable for type=HIERARCHY.
+ Priority int64 `json:"priority,omitempty"`
+ // Rules: [Output Only] The rules that apply to the instance. Only rules that
+ // target the specific VM instance are returned if target service accounts or
+ // target secure tags are specified in the rules.
Rules []*FirewallPolicyRule `json:"rules,omitempty"`
-
// ShortName: [Output Only] The short name of the firewall policy.
ShortName string `json:"shortName,omitempty"`
-
// Type: [Output Only] The type of the firewall policy. Can be one of
- // HIERARCHY, NETWORK, NETWORK_REGIONAL.
+ // HIERARCHY, NETWORK, NETWORK_REGIONAL, SYSTEM_GLOBAL, SYSTEM_REGIONAL.
//
// Possible values:
// "HIERARCHY"
// "NETWORK"
// "NETWORK_REGIONAL"
+ // "SYSTEM_GLOBAL"
+ // "SYSTEM_REGIONAL"
// "UNSPECIFIED"
Type string `json:"type,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "DisplayName") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
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. "DisplayName") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy) MarshalJSON() ([]byte, error) {
+func (s InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy) MarshalJSON() ([]byte, error) {
type NoMethod InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstancesRemoveResourcePoliciesRequest struct {
// ResourcePolicies: Resource policies to be removed from this instance.
ResourcePolicies []string `json:"resourcePolicies,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "ResourcePolicies") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "ResourcePolicies") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstancesRemoveResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
+func (s InstancesRemoveResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
type NoMethod InstancesRemoveResourcePoliciesRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstancesScopedList struct {
// Instances: [Output Only] A list of instances contained in this scope.
Instances []*Instance `json:"instances,omitempty"`
-
- // Warning: [Output Only] Informational warning which replaces the list
- // of instances when the list is empty.
+ // Warning: [Output Only] Informational warning which replaces the list of
+ // instances when the list is empty.
Warning *InstancesScopedListWarning `json:"warning,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Instances") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Instances") 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. "Instances") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstancesScopedList) MarshalJSON() ([]byte, error) {
+func (s InstancesScopedList) MarshalJSON() ([]byte, error) {
type NoMethod InstancesScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// InstancesScopedListWarning: [Output Only] Informational warning which
// replaces the list of instances when the list is empty.
type InstancesScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*InstancesScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstancesScopedListWarning) MarshalJSON() ([]byte, error) {
+func (s InstancesScopedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod InstancesScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstancesScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstancesScopedListWarningData) MarshalJSON() ([]byte, error) {
+func (s InstancesScopedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod InstancesScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstancesSetLabelsRequest struct {
// LabelFingerprint: Fingerprint of the previous set of labels for this
- // resource, used to prevent conflicts. Provide the latest fingerprint
- // value when making a request to add or change labels.
- LabelFingerprint string `json:"labelFingerprint,omitempty"`
-
- Labels map[string]string `json:"labels,omitempty"`
-
+ // resource, used to prevent conflicts. Provide the latest fingerprint value
+ // when making a request to add or change labels.
+ LabelFingerprint string `json:"labelFingerprint,omitempty"`
+ Labels map[string]string `json:"labels,omitempty"`
// ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "LabelFingerprint") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "LabelFingerprint") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstancesSetLabelsRequest) MarshalJSON() ([]byte, error) {
+func (s InstancesSetLabelsRequest) MarshalJSON() ([]byte, error) {
type NoMethod InstancesSetLabelsRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstancesSetMachineResourcesRequest struct {
// GuestAccelerators: A list of the type and count of accelerator cards
// attached to the instance.
GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "GuestAccelerators")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "GuestAccelerators") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "GuestAccelerators") 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. "GuestAccelerators") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstancesSetMachineResourcesRequest) MarshalJSON() ([]byte, error) {
+func (s InstancesSetMachineResourcesRequest) MarshalJSON() ([]byte, error) {
type NoMethod InstancesSetMachineResourcesRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstancesSetMachineTypeRequest struct {
- // MachineType: Full or partial URL of the machine type resource. See
- // Machine Types for a full list of machine types. For example:
+ // MachineType: Full or partial URL of the machine type resource. See Machine
+ // Types for a full list of machine types. For example:
// zones/us-central1-f/machineTypes/n1-standard-1
MachineType string `json:"machineType,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "MachineType") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "MachineType") 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. "MachineType") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstancesSetMachineTypeRequest) MarshalJSON() ([]byte, error) {
+func (s InstancesSetMachineTypeRequest) MarshalJSON() ([]byte, error) {
type NoMethod InstancesSetMachineTypeRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstancesSetMinCpuPlatformRequest struct {
- // MinCpuPlatform: Minimum cpu/platform this instance should be started
- // at.
+ // MinCpuPlatform: Minimum cpu/platform this instance should be started at.
MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "MinCpuPlatform") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "MinCpuPlatform") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "MinCpuPlatform") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstancesSetMinCpuPlatformRequest) MarshalJSON() ([]byte, error) {
+func (s InstancesSetMinCpuPlatformRequest) MarshalJSON() ([]byte, error) {
type NoMethod InstancesSetMinCpuPlatformRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstancesSetNameRequest struct {
- // CurrentName: The current name of this resource, used to prevent
- // conflicts. Provide the latest name when making a request to change
- // name.
+ // CurrentName: The current name of this resource, used to prevent conflicts.
+ // Provide the latest name when making a request to change name.
CurrentName string `json:"currentName,omitempty"`
-
// Name: The name to be applied to the instance. Needs to be RFC 1035
// compliant.
Name string `json:"name,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "CurrentName") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CurrentName") 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. "CurrentName") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstancesSetNameRequest) MarshalJSON() ([]byte, error) {
+func (s InstancesSetNameRequest) MarshalJSON() ([]byte, error) {
type NoMethod InstancesSetNameRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstancesSetSecurityPolicyRequest struct {
- // NetworkInterfaces: The network interfaces that the security policy
- // will be applied to. Network interfaces use the nicN naming format.
- // You can only set a security policy for network interfaces with an
- // access config.
+ // NetworkInterfaces: The network interfaces that the security policy will be
+ // applied to. Network interfaces use the nicN naming format. You can only set
+ // a security policy for network interfaces with an access config.
NetworkInterfaces []string `json:"networkInterfaces,omitempty"`
-
- // SecurityPolicy: A full or partial URL to a security policy to add to
- // this instance. If this field is set to an empty string it will remove
- // the associated security policy.
+ // SecurityPolicy: A full or partial URL to a security policy to add to this
+ // instance. If this field is set to an empty string it will remove the
+ // associated security policy.
SecurityPolicy string `json:"securityPolicy,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "NetworkInterfaces")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "NetworkInterfaces") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "NetworkInterfaces") 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. "NetworkInterfaces") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstancesSetSecurityPolicyRequest) MarshalJSON() ([]byte, error) {
+func (s InstancesSetSecurityPolicyRequest) MarshalJSON() ([]byte, error) {
type NoMethod InstancesSetSecurityPolicyRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstancesSetServiceAccountRequest struct {
// Email: Email address of the service account.
Email string `json:"email,omitempty"`
-
- // Scopes: The list of scopes to be made available for this service
- // account.
+ // Scopes: The list of scopes to be made available for this service account.
Scopes []string `json:"scopes,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Email") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Email") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Email") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstancesSetServiceAccountRequest) MarshalJSON() ([]byte, error) {
+func (s InstancesSetServiceAccountRequest) MarshalJSON() ([]byte, error) {
type NoMethod InstancesSetServiceAccountRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InstancesStartWithEncryptionKeyRequest struct {
- // Disks: Array of disks associated with this instance that are
- // protected with a customer-supplied encryption key. In order to start
- // the instance, the disk url and its corresponding key must be
- // provided. If the disk is not protected with a customer-supplied
- // encryption key it should not be specified.
+ // Disks: Array of disks associated with this instance that are protected with
+ // a customer-supplied encryption key. In order to start the instance, the disk
+ // url and its corresponding key must be provided. If the disk is not protected
+ // with a customer-supplied encryption key it should not be specified.
Disks []*CustomerEncryptionKeyProtectedDisk `json:"disks,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Disks") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Disks") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Disks") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InstancesStartWithEncryptionKeyRequest) MarshalJSON() ([]byte, error) {
+func (s InstancesStartWithEncryptionKeyRequest) MarshalJSON() ([]byte, error) {
type NoMethod InstancesStartWithEncryptionKeyRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// Int64RangeMatch: HttpRouteRuleMatch criteria for field values that
-// must stay within the specified integer range.
-type Int64RangeMatch struct {
- // RangeEnd: The end of the range (exclusive) in signed long integer
- // format.
- RangeEnd int64 `json:"rangeEnd,omitempty,string"`
-
- // RangeStart: The start of the range (inclusive) in signed long integer
- // format.
- RangeStart int64 `json:"rangeStart,omitempty,string"`
-
- // ForceSendFields is a list of field names (e.g. "RangeEnd") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "RangeEnd") 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 *Int64RangeMatch) MarshalJSON() ([]byte, error) {
- type NoMethod Int64RangeMatch
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// Interconnect: Represents an Interconnect resource. An Interconnect
-// resource is a dedicated connection between the Google Cloud network
-// and your on-premises network. For more information, read the
-// Dedicated Interconnect Overview.
-type Interconnect struct {
- // AdminEnabled: Administrative status of the interconnect. When this is
- // set to true, the Interconnect is functional and can carry traffic.
- // When set to false, no packets can be carried over the interconnect
- // and no BGP routes are exchanged over it. By default, the status is
- // set to true.
- AdminEnabled bool `json:"adminEnabled,omitempty"`
-
- // AvailableFeatures: [Output only] List of features available for this
- // Interconnect connection, which can take one of the following values:
- // - MACSEC If present then the Interconnect connection is provisioned
- // on MACsec capable hardware ports. If not present then the
- // Interconnect connection is provisioned on non-MACsec capable ports
- // and MACsec isn't supported and enabling MACsec fails.
+// InstantSnapshot: Represents a InstantSnapshot resource. You can use instant
+// snapshots to create disk rollback points quickly..
+type InstantSnapshot struct {
+ // Architecture: [Output Only] The architecture of the instant snapshot. Valid
+ // values are ARM64 or X86_64.
//
// Possible values:
- // "IF_MACSEC" - Media Access Control security (MACsec)
- AvailableFeatures []string `json:"availableFeatures,omitempty"`
-
- // CircuitInfos: [Output Only] A list of CircuitInfo objects, that
- // describe the individual circuits in this LAG.
- CircuitInfos []*InterconnectCircuitInfo `json:"circuitInfos,omitempty"`
-
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // "ARCHITECTURE_UNSPECIFIED" - Default value indicating Architecture is not
+ // set.
+ // "ARM64" - Machines with architecture ARM64
+ // "X86_64" - Machines with architecture X86_64
+ Architecture string `json:"architecture,omitempty"`
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // CustomerName: Customer name, to put in the Letter of Authorization as
- // the party authorized to request a crossconnect.
- CustomerName string `json:"customerName,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // ExpectedOutages: [Output Only] A list of outages expected for this
- // Interconnect.
- ExpectedOutages []*InterconnectOutageNotification `json:"expectedOutages,omitempty"`
-
- // GoogleIpAddress: [Output Only] IP address configured on the Google
- // side of the Interconnect link. This can be used only for ping tests.
- GoogleIpAddress string `json:"googleIpAddress,omitempty"`
-
- // GoogleReferenceId: [Output Only] Google reference ID to be used when
- // raising support tickets with Google or otherwise to debug backend
- // connectivity issues.
- GoogleReferenceId string `json:"googleReferenceId,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // DiskSizeGb: [Output Only] Size of the source disk, specified in GB.
+ DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
- // InterconnectAttachments: [Output Only] A list of the URLs of all
- // InterconnectAttachments configured to use this Interconnect.
- InterconnectAttachments []string `json:"interconnectAttachments,omitempty"`
-
- // InterconnectType: Type of interconnect, which can take one of the
- // following values: - PARTNER: A partner-managed interconnection shared
- // between customers though a partner. - DEDICATED: A dedicated physical
- // interconnection with the customer. Note that a value IT_PRIVATE has
- // been deprecated in favor of DEDICATED.
- //
- // Possible values:
- // "DEDICATED" - A dedicated physical interconnection with the
- // customer.
- // "IT_PRIVATE" - [Deprecated] A private, physical interconnection
- // with the customer.
- // "PARTNER" - A partner-managed interconnection shared between
- // customers via partner.
- InterconnectType string `json:"interconnectType,omitempty"`
-
- // Kind: [Output Only] Type of the resource. Always compute#interconnect
- // for interconnects.
+ // Kind: [Output Only] Type of the resource. Always compute#instantSnapshot for
+ // InstantSnapshot resources.
Kind string `json:"kind,omitempty"`
-
// LabelFingerprint: A fingerprint for the labels being applied to this
- // Interconnect, which is essentially a hash of the labels set used for
- // optimistic locking. The fingerprint is initially generated by Compute
- // Engine and changes after every request to modify or update labels.
- // You must always provide an up-to-date fingerprint hash in order to
- // update or change labels, otherwise the request will fail with error
- // 412 conditionNotMet. To see the latest fingerprint, make a get()
- // request to retrieve an Interconnect.
+ // InstantSnapshot, which is essentially a hash of the labels set used for
+ // optimistic locking. The fingerprint is initially generated by Compute Engine
+ // and changes after every request to modify or update labels. You must always
+ // provide an up-to-date fingerprint hash in order to update or change labels,
+ // otherwise the request will fail with error 412 conditionNotMet. To see the
+ // latest fingerprint, make a get() request to retrieve a InstantSnapshot.
LabelFingerprint string `json:"labelFingerprint,omitempty"`
-
- // Labels: Labels for this resource. These can only be added or modified
- // by the setLabels method. Each label key/value pair must comply with
- // RFC1035. Label values may be empty.
+ // Labels: Labels to apply to this InstantSnapshot. These can be later modified
+ // by the setLabels method. Label values may be empty.
Labels map[string]string `json:"labels,omitempty"`
-
- // LinkType: Type of link requested, which can take one of the following
- // values: - LINK_TYPE_ETHERNET_10G_LR: A 10G Ethernet with LR optics -
- // LINK_TYPE_ETHERNET_100G_LR: A 100G Ethernet with LR optics. Note that
- // this field indicates the speed of each of the links in the bundle,
- // not the speed of the entire bundle.
+ // Name: Name of the resource; provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must
+ // be a lowercase letter, and all following characters must be a dash,
+ // lowercase letter, or digit, except the last character, which cannot be a
+ // dash.
+ Name string `json:"name,omitempty"`
+ // Region: [Output Only] URL of the region where the instant snapshot resides.
+ // You must specify this field as part of the HTTP request URL. It is not
+ // settable as a field in the request body.
+ Region string `json:"region,omitempty"`
+ // ResourceStatus: [Output Only] Status information for the instant snapshot
+ // resource.
+ ResourceStatus *InstantSnapshotResourceStatus `json:"resourceStatus,omitempty"`
+ // SatisfiesPzi: Output only. Reserved for future use.
+ SatisfiesPzi bool `json:"satisfiesPzi,omitempty"`
+ // SatisfiesPzs: [Output Only] Reserved for future use.
+ SatisfiesPzs bool `json:"satisfiesPzs,omitempty"`
+ // SelfLink: [Output Only] Server-defined URL for the resource.
+ SelfLink string `json:"selfLink,omitempty"`
+ // SelfLinkWithId: [Output Only] Server-defined URL for this resource's
+ // resource id.
+ SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
+ // SourceDisk: URL of the source disk used to create this instant snapshot.
+ // Note that the source disk must be in the same zone/region as the instant
+ // snapshot to be created. This can be a full or valid partial URL. For
+ // example, the following are valid values: -
+ // https://www.googleapis.com/compute/v1/projects/project/zones/zone
+ // /disks/disk -
+ // https://www.googleapis.com/compute/v1/projects/project/regions/region
+ // /disks/disk - projects/project/zones/zone/disks/disk -
+ // projects/project/regions/region/disks/disk - zones/zone/disks/disk -
+ // regions/region/disks/disk
+ SourceDisk string `json:"sourceDisk,omitempty"`
+ // SourceDiskId: [Output Only] The ID value of the disk used to create this
+ // InstantSnapshot. This value may be used to determine whether the
+ // InstantSnapshot was taken from the current or a previous instance of a given
+ // disk name.
+ SourceDiskId string `json:"sourceDiskId,omitempty"`
+ // Status: [Output Only] The status of the instantSnapshot. This can be
+ // CREATING, DELETING, FAILED, or READY.
//
// Possible values:
- // "LINK_TYPE_ETHERNET_100G_LR" - 100G Ethernet, LR Optics.
- // "LINK_TYPE_ETHERNET_10G_LR" - 10G Ethernet, LR Optics. [(rate_bps)
- // = 10000000000];
- LinkType string `json:"linkType,omitempty"`
+ // "CREATING" - InstantSnapshot creation is in progress.
+ // "DELETING" - InstantSnapshot is currently being deleted.
+ // "FAILED" - InstantSnapshot creation failed.
+ // "READY" - InstantSnapshot has been created successfully.
+ // "UNAVAILABLE" - InstantSnapshot is currently unavailable and cannot be
+ // used for Disk restoration
+ Status string `json:"status,omitempty"`
+ // Zone: [Output Only] URL of the zone where the instant snapshot resides. You
+ // must specify this field as part of the HTTP request URL. It is not settable
+ // as a field in the request body.
+ Zone string `json:"zone,omitempty"`
- // Location: URL of the InterconnectLocation object that represents
- // where this connection is to be provisioned.
- Location string `json:"location,omitempty"`
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "Architecture") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Architecture") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
- // Macsec: Configuration that enables Media Access Control security
- // (MACsec) on the Cloud Interconnect connection between Google and your
- // on-premises router.
- Macsec *InterconnectMacsec `json:"macsec,omitempty"`
+func (s InstantSnapshot) MarshalJSON() ([]byte, error) {
+ type NoMethod InstantSnapshot
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
- // MacsecEnabled: Enable or disable MACsec on this Interconnect
- // connection. MACsec enablement fails if the MACsec object is not
- // specified.
- MacsecEnabled bool `json:"macsecEnabled,omitempty"`
+type InstantSnapshotAggregatedList struct {
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
+ Id string `json:"id,omitempty"`
+ // Items: A list of InstantSnapshotsScopedList resources.
+ Items map[string]InstantSnapshotsScopedList `json:"items,omitempty"`
+ // Kind: [Output Only] Type of resource. Always
+ // compute#instantSnapshotAggregatedList for aggregated lists of
+ // instantSnapshots.
+ Kind string `json:"kind,omitempty"`
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
+ NextPageToken string `json:"nextPageToken,omitempty"`
+ // SelfLink: [Output Only] Server-defined URL for this resource.
+ SelfLink string `json:"selfLink,omitempty"`
+ // Unreachables: [Output Only] Unreachable resources.
+ Unreachables []string `json:"unreachables,omitempty"`
+ // Warning: [Output Only] Informational warning message.
+ Warning *InstantSnapshotAggregatedListWarning `json:"warning,omitempty"`
- // Name: Name of the resource. Provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
- // the first character must be a lowercase letter, and all following
- // characters must be a dash, lowercase letter, or digit, except the
- // last character, which cannot be a dash.
- Name string `json:"name,omitempty"`
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
- // NocContactEmail: Email address to contact the customer NOC for
- // operations and maintenance notifications regarding this Interconnect.
- // If specified, this will be used for notifications in addition to all
- // other forms described, such as Cloud Monitoring logs alerting and
- // Cloud Notifications. This field is required for users who sign up for
- // Cloud Interconnect using workforce identity federation.
- NocContactEmail string `json:"nocContactEmail,omitempty"`
+func (s InstantSnapshotAggregatedList) MarshalJSON() ([]byte, error) {
+ type NoMethod InstantSnapshotAggregatedList
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+// InstantSnapshotAggregatedListWarning: [Output Only] Informational warning
+// message.
+type InstantSnapshotAggregatedListWarning struct {
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
+ //
+ // Possible values:
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
+ // "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
+ // resources has a type marked as experimental
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
+ // "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
+ // overridden. Deprecated unused field.
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
+ // HTTP/HTTPS/HTTP2.
+ // "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
+ // exceedingly large number of resources
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
+ // "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
+ // "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
+ // ignored.
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
+ // "UNREACHABLE" - A given scope cannot be reached.
+ Code string `json:"code,omitempty"`
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
+ Data []*InstantSnapshotAggregatedListWarningData `json:"data,omitempty"`
+ // Message: [Output Only] A human-readable description of the warning code.
+ Message string `json:"message,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s InstantSnapshotAggregatedListWarning) MarshalJSON() ([]byte, error) {
+ type NoMethod InstantSnapshotAggregatedListWarning
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+type InstantSnapshotAggregatedListWarningData struct {
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
+ Key string `json:"key,omitempty"`
+ // Value: [Output Only] A warning data value corresponding to the key.
+ Value string `json:"value,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s InstantSnapshotAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+ type NoMethod InstantSnapshotAggregatedListWarningData
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+// InstantSnapshotList: Contains a list of InstantSnapshot resources.
+type InstantSnapshotList struct {
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
+ Id string `json:"id,omitempty"`
+ // Items: A list of InstantSnapshot resources.
+ Items []*InstantSnapshot `json:"items,omitempty"`
+ // Kind: Type of resource.
+ Kind string `json:"kind,omitempty"`
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
+ NextPageToken string `json:"nextPageToken,omitempty"`
+ // SelfLink: [Output Only] Server-defined URL for this resource.
+ SelfLink string `json:"selfLink,omitempty"`
+ // Warning: [Output Only] Informational warning message.
+ Warning *InstantSnapshotListWarning `json:"warning,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s InstantSnapshotList) MarshalJSON() ([]byte, error) {
+ type NoMethod InstantSnapshotList
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+// InstantSnapshotListWarning: [Output Only] Informational warning message.
+type InstantSnapshotListWarning struct {
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
+ //
+ // Possible values:
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
+ // "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
+ // resources has a type marked as experimental
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
+ // "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
+ // overridden. Deprecated unused field.
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
+ // HTTP/HTTPS/HTTP2.
+ // "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
+ // exceedingly large number of resources
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
+ // "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
+ // "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
+ // ignored.
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
+ // "UNREACHABLE" - A given scope cannot be reached.
+ Code string `json:"code,omitempty"`
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
+ Data []*InstantSnapshotListWarningData `json:"data,omitempty"`
+ // Message: [Output Only] A human-readable description of the warning code.
+ Message string `json:"message,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s InstantSnapshotListWarning) MarshalJSON() ([]byte, error) {
+ type NoMethod InstantSnapshotListWarning
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+type InstantSnapshotListWarningData struct {
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
+ Key string `json:"key,omitempty"`
+ // Value: [Output Only] A warning data value corresponding to the key.
+ Value string `json:"value,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s InstantSnapshotListWarningData) MarshalJSON() ([]byte, error) {
+ type NoMethod InstantSnapshotListWarningData
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+type InstantSnapshotResourceStatus struct {
+ // StorageSizeBytes: [Output Only] The storage size of this instant snapshot.
+ StorageSizeBytes int64 `json:"storageSizeBytes,omitempty,string"`
+ // ForceSendFields is a list of field names (e.g. "StorageSizeBytes") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "StorageSizeBytes") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s InstantSnapshotResourceStatus) MarshalJSON() ([]byte, error) {
+ type NoMethod InstantSnapshotResourceStatus
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+type InstantSnapshotsScopedList struct {
+ // InstantSnapshots: [Output Only] A list of instantSnapshots contained in this
+ // scope.
+ InstantSnapshots []*InstantSnapshot `json:"instantSnapshots,omitempty"`
+ // Warning: [Output Only] Informational warning which replaces the list of
+ // instantSnapshots when the list is empty.
+ Warning *InstantSnapshotsScopedListWarning `json:"warning,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "InstantSnapshots") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "InstantSnapshots") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s InstantSnapshotsScopedList) MarshalJSON() ([]byte, error) {
+ type NoMethod InstantSnapshotsScopedList
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+// InstantSnapshotsScopedListWarning: [Output Only] Informational warning which
+// replaces the list of instantSnapshots when the list is empty.
+type InstantSnapshotsScopedListWarning struct {
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
+ //
+ // Possible values:
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
+ // "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
+ // resources has a type marked as experimental
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
+ // "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
+ // overridden. Deprecated unused field.
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
+ // HTTP/HTTPS/HTTP2.
+ // "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
+ // exceedingly large number of resources
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
+ // "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
+ // "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
+ // ignored.
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
+ // "UNREACHABLE" - A given scope cannot be reached.
+ Code string `json:"code,omitempty"`
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
+ Data []*InstantSnapshotsScopedListWarningData `json:"data,omitempty"`
+ // Message: [Output Only] A human-readable description of the warning code.
+ Message string `json:"message,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s InstantSnapshotsScopedListWarning) MarshalJSON() ([]byte, error) {
+ type NoMethod InstantSnapshotsScopedListWarning
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+type InstantSnapshotsScopedListWarningData struct {
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
+ Key string `json:"key,omitempty"`
+ // Value: [Output Only] A warning data value corresponding to the key.
+ Value string `json:"value,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s InstantSnapshotsScopedListWarningData) MarshalJSON() ([]byte, error) {
+ type NoMethod InstantSnapshotsScopedListWarningData
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+// Int64RangeMatch: HttpRouteRuleMatch criteria for field values that must stay
+// within the specified integer range.
+type Int64RangeMatch struct {
+ // RangeEnd: The end of the range (exclusive) in signed long integer format.
+ RangeEnd int64 `json:"rangeEnd,omitempty,string"`
+ // RangeStart: The start of the range (inclusive) in signed long integer
+ // format.
+ RangeStart int64 `json:"rangeStart,omitempty,string"`
+ // ForceSendFields is a list of field names (e.g. "RangeEnd") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "RangeEnd") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
- // OperationalStatus: [Output Only] The current status of this
- // Interconnect's functionality, which can take one of the following
- // values: - OS_ACTIVE: A valid Interconnect, which is turned up and is
- // ready to use. Attachments may be provisioned on this Interconnect. -
- // OS_UNPROVISIONED: An Interconnect that has not completed turnup. No
- // attachments may be provisioned on this Interconnect. -
- // OS_UNDER_MAINTENANCE: An Interconnect that is undergoing internal
- // maintenance. No attachments may be provisioned or updated on this
+func (s Int64RangeMatch) MarshalJSON() ([]byte, error) {
+ type NoMethod Int64RangeMatch
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+// Interconnect: Represents an Interconnect resource. An Interconnect resource
+// is a dedicated connection between the Google Cloud network and your
+// on-premises network. For more information, read the Dedicated Interconnect
+// Overview.
+type Interconnect struct {
+ // AdminEnabled: Administrative status of the interconnect. When this is set to
+ // true, the Interconnect is functional and can carry traffic. When set to
+ // false, no packets can be carried over the interconnect and no BGP routes are
+ // exchanged over it. By default, the status is set to true.
+ AdminEnabled bool `json:"adminEnabled,omitempty"`
+ // AvailableFeatures: [Output only] List of features available for this
+ // Interconnect connection, which can take one of the following values: -
+ // IF_MACSEC If present then the Interconnect connection is provisioned on
+ // MACsec capable hardware ports. If not present then the Interconnect
+ // connection is provisioned on non-MACsec capable ports and MACsec isn't
+ // supported and enabling MACsec fails.
+ //
+ // Possible values:
+ // "IF_MACSEC" - Media Access Control security (MACsec)
+ AvailableFeatures []string `json:"availableFeatures,omitempty"`
+ // CircuitInfos: [Output Only] A list of CircuitInfo objects, that describe the
+ // individual circuits in this LAG.
+ CircuitInfos []*InterconnectCircuitInfo `json:"circuitInfos,omitempty"`
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
+ CreationTimestamp string `json:"creationTimestamp,omitempty"`
+ // CustomerName: Customer name, to put in the Letter of Authorization as the
+ // party authorized to request a crossconnect.
+ CustomerName string `json:"customerName,omitempty"`
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
+ Description string `json:"description,omitempty"`
+ // ExpectedOutages: [Output Only] A list of outages expected for this
+ // Interconnect.
+ ExpectedOutages []*InterconnectOutageNotification `json:"expectedOutages,omitempty"`
+ // GoogleIpAddress: [Output Only] IP address configured on the Google side of
+ // the Interconnect link. This can be used only for ping tests.
+ GoogleIpAddress string `json:"googleIpAddress,omitempty"`
+ // GoogleReferenceId: [Output Only] Google reference ID to be used when raising
+ // support tickets with Google or otherwise to debug backend connectivity
+ // issues.
+ GoogleReferenceId string `json:"googleReferenceId,omitempty"`
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
+ Id uint64 `json:"id,omitempty,string"`
+ // InterconnectAttachments: [Output Only] A list of the URLs of all
+ // InterconnectAttachments configured to use this Interconnect.
+ InterconnectAttachments []string `json:"interconnectAttachments,omitempty"`
+ // InterconnectType: Type of interconnect, which can take one of the following
+ // values: - PARTNER: A partner-managed interconnection shared between
+ // customers though a partner. - DEDICATED: A dedicated physical
+ // interconnection with the customer. Note that a value IT_PRIVATE has been
+ // deprecated in favor of DEDICATED.
+ //
+ // Possible values:
+ // "DEDICATED" - A dedicated physical interconnection with the customer.
+ // "IT_PRIVATE" - [Deprecated] A private, physical interconnection with the
+ // customer.
+ // "PARTNER" - A partner-managed interconnection shared between customers via
+ // partner.
+ InterconnectType string `json:"interconnectType,omitempty"`
+ // Kind: [Output Only] Type of the resource. Always compute#interconnect for
+ // interconnects.
+ Kind string `json:"kind,omitempty"`
+ // LabelFingerprint: A fingerprint for the labels being applied to this
+ // Interconnect, which is essentially a hash of the labels set used for
+ // optimistic locking. The fingerprint is initially generated by Compute Engine
+ // and changes after every request to modify or update labels. You must always
+ // provide an up-to-date fingerprint hash in order to update or change labels,
+ // otherwise the request will fail with error 412 conditionNotMet. To see the
+ // latest fingerprint, make a get() request to retrieve an Interconnect.
+ LabelFingerprint string `json:"labelFingerprint,omitempty"`
+ // Labels: Labels for this resource. These can only be added or modified by the
+ // setLabels method. Each label key/value pair must comply with RFC1035. Label
+ // values may be empty.
+ Labels map[string]string `json:"labels,omitempty"`
+ // LinkType: Type of link requested, which can take one of the following
+ // values: - LINK_TYPE_ETHERNET_10G_LR: A 10G Ethernet with LR optics -
+ // LINK_TYPE_ETHERNET_100G_LR: A 100G Ethernet with LR optics. Note that this
+ // field indicates the speed of each of the links in the bundle, not the speed
+ // of the entire bundle.
+ //
+ // Possible values:
+ // "LINK_TYPE_ETHERNET_100G_LR" - 100G Ethernet, LR Optics.
+ // "LINK_TYPE_ETHERNET_10G_LR" - 10G Ethernet, LR Optics. [(rate_bps) =
+ // 10000000000];
+ LinkType string `json:"linkType,omitempty"`
+ // Location: URL of the InterconnectLocation object that represents where this
+ // connection is to be provisioned.
+ Location string `json:"location,omitempty"`
+ // Macsec: Configuration that enables Media Access Control security (MACsec) on
+ // the Cloud Interconnect connection between Google and your on-premises
+ // router.
+ Macsec *InterconnectMacsec `json:"macsec,omitempty"`
+ // MacsecEnabled: Enable or disable MACsec on this Interconnect connection.
+ // MACsec enablement fails if the MACsec object is not specified.
+ MacsecEnabled bool `json:"macsecEnabled,omitempty"`
+ // Name: Name of the resource. Provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must
+ // be a lowercase letter, and all following characters must be a dash,
+ // lowercase letter, or digit, except the last character, which cannot be a
+ // dash.
+ Name string `json:"name,omitempty"`
+ // NocContactEmail: Email address to contact the customer NOC for operations
+ // and maintenance notifications regarding this Interconnect. If specified,
+ // this will be used for notifications in addition to all other forms
+ // described, such as Cloud Monitoring logs alerting and Cloud Notifications.
+ // This field is required for users who sign up for Cloud Interconnect using
+ // workforce identity federation.
+ NocContactEmail string `json:"nocContactEmail,omitempty"`
+ // OperationalStatus: [Output Only] The current status of this Interconnect's
+ // functionality, which can take one of the following values: - OS_ACTIVE: A
+ // valid Interconnect, which is turned up and is ready to use. Attachments may
+ // be provisioned on this Interconnect. - OS_UNPROVISIONED: An Interconnect
+ // that has not completed turnup. No attachments may be provisioned on this
+ // Interconnect. - OS_UNDER_MAINTENANCE: An Interconnect that is undergoing
+ // internal maintenance. No attachments may be provisioned or updated on this
// Interconnect.
//
// Possible values:
- // "OS_ACTIVE" - The interconnect is valid, turned up, and ready to
- // use. Attachments may be provisioned on this interconnect.
+ // "OS_ACTIVE" - The interconnect is valid, turned up, and ready to use.
+ // Attachments may be provisioned on this interconnect.
// "OS_UNPROVISIONED" - The interconnect has not completed turnup. No
// attachments may be provisioned on this interconnect.
OperationalStatus string `json:"operationalStatus,omitempty"`
-
- // PeerIpAddress: [Output Only] IP address configured on the customer
- // side of the Interconnect link. The customer should configure this IP
- // address during turnup when prompted by Google NOC. This can be used
- // only for ping tests.
+ // PeerIpAddress: [Output Only] IP address configured on the customer side of
+ // the Interconnect link. The customer should configure this IP address during
+ // turnup when prompted by Google NOC. This can be used only for ping tests.
PeerIpAddress string `json:"peerIpAddress,omitempty"`
-
- // ProvisionedLinkCount: [Output Only] Number of links actually
- // provisioned in this interconnect.
+ // ProvisionedLinkCount: [Output Only] Number of links actually provisioned in
+ // this interconnect.
ProvisionedLinkCount int64 `json:"provisionedLinkCount,omitempty"`
-
- // RemoteLocation: Indicates that this is a Cross-Cloud Interconnect.
- // This field specifies the location outside of Google's network that
- // the interconnect is connected to.
+ // RemoteLocation: Indicates that this is a Cross-Cloud Interconnect. This
+ // field specifies the location outside of Google's network that the
+ // interconnect is connected to.
RemoteLocation string `json:"remoteLocation,omitempty"`
-
// RequestedFeatures: Optional. List of features requested for this
- // Interconnect connection, which can take one of the following values:
- // - MACSEC If specified then the connection is created on MACsec
- // capable hardware ports. If not specified, the default value is false,
- // which allocates non-MACsec capable ports first if available. This
- // parameter can be provided only with Interconnect INSERT. It isn't
- // valid for Interconnect PATCH.
+ // Interconnect connection, which can take one of the following values: -
+ // IF_MACSEC If specified then the connection is created on MACsec capable
+ // hardware ports. If not specified, the default value is false, which
+ // allocates non-MACsec capable ports first if available. This parameter can be
+ // provided only with Interconnect INSERT. It isn't valid for Interconnect
+ // PATCH.
//
// Possible values:
// "IF_MACSEC" - Media Access Control security (MACsec)
RequestedFeatures []string `json:"requestedFeatures,omitempty"`
-
- // RequestedLinkCount: Target number of physical links in the link
- // bundle, as requested by the customer.
+ // RequestedLinkCount: Target number of physical links in the link bundle, as
+ // requested by the customer.
RequestedLinkCount int64 `json:"requestedLinkCount,omitempty"`
-
// SatisfiesPzs: [Output Only] Reserved for future use.
SatisfiesPzs bool `json:"satisfiesPzs,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // State: [Output Only] The current state of Interconnect functionality,
- // which can take one of the following values: - ACTIVE: The
- // Interconnect is valid, turned up and ready to use. Attachments may be
- // provisioned on this Interconnect. - UNPROVISIONED: The Interconnect
- // has not completed turnup. No attachments may be provisioned on this
- // Interconnect. - UNDER_MAINTENANCE: The Interconnect is undergoing
- // internal maintenance. No attachments may be provisioned or updated on
- // this Interconnect.
+ // State: [Output Only] The current state of Interconnect functionality, which
+ // can take one of the following values: - ACTIVE: The Interconnect is valid,
+ // turned up and ready to use. Attachments may be provisioned on this
+ // Interconnect. - UNPROVISIONED: The Interconnect has not completed turnup. No
+ // attachments may be provisioned on this Interconnect. - UNDER_MAINTENANCE:
+ // The Interconnect is undergoing internal maintenance. No attachments may be
+ // provisioned or updated on this Interconnect.
//
// Possible values:
// "ACTIVE" - The interconnect is valid, turned up, and ready to use.
@@ -24111,53 +21135,43 @@ type Interconnect struct {
// attachments may be provisioned on this interconnect.
State string `json:"state,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
// ForceSendFields is a list of field names (e.g. "AdminEnabled") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "AdminEnabled") 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. "AdminEnabled") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *Interconnect) MarshalJSON() ([]byte, error) {
+func (s Interconnect) MarshalJSON() ([]byte, error) {
type NoMethod Interconnect
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// InterconnectAttachment: Represents an Interconnect Attachment (VLAN)
-// resource. You can use Interconnect attachments (VLANS) to connect
-// your Virtual Private Cloud networks to your on-premises networks
-// through an Interconnect. For more information, read Creating VLAN
-// Attachments.
+// resource. You can use Interconnect attachments (VLANS) to connect your
+// Virtual Private Cloud networks to your on-premises networks through an
+// Interconnect. For more information, read Creating VLAN Attachments.
type InterconnectAttachment struct {
- // AdminEnabled: Determines whether this Attachment will carry packets.
- // Not present for PARTNER_PROVIDER.
+ // AdminEnabled: Determines whether this Attachment will carry packets. Not
+ // present for PARTNER_PROVIDER.
AdminEnabled bool `json:"adminEnabled,omitempty"`
-
- // Bandwidth: Provisioned bandwidth capacity for the interconnect
- // attachment. For attachments of type DEDICATED, the user can set the
- // bandwidth. For attachments of type PARTNER, the Google Partner that
- // is operating the interconnect must set the bandwidth. Output only for
- // PARTNER type, mutable for PARTNER_PROVIDER and DEDICATED, and can
- // take one of the following values: - BPS_50M: 50 Mbit/s - BPS_100M:
- // 100 Mbit/s - BPS_200M: 200 Mbit/s - BPS_300M: 300 Mbit/s - BPS_400M:
- // 400 Mbit/s - BPS_500M: 500 Mbit/s - BPS_1G: 1 Gbit/s - BPS_2G: 2
- // Gbit/s - BPS_5G: 5 Gbit/s - BPS_10G: 10 Gbit/s - BPS_20G: 20 Gbit/s -
- // BPS_50G: 50 Gbit/s
+ // Bandwidth: Provisioned bandwidth capacity for the interconnect attachment.
+ // For attachments of type DEDICATED, the user can set the bandwidth. For
+ // attachments of type PARTNER, the Google Partner that is operating the
+ // interconnect must set the bandwidth. Output only for PARTNER type, mutable
+ // for PARTNER_PROVIDER and DEDICATED, and can take one of the following
+ // values: - BPS_50M: 50 Mbit/s - BPS_100M: 100 Mbit/s - BPS_200M: 200 Mbit/s -
+ // BPS_300M: 300 Mbit/s - BPS_400M: 400 Mbit/s - BPS_500M: 500 Mbit/s - BPS_1G:
+ // 1 Gbit/s - BPS_2G: 2 Gbit/s - BPS_5G: 5 Gbit/s - BPS_10G: 10 Gbit/s -
+ // BPS_20G: 20 Gbit/s - BPS_50G: 50 Gbit/s
//
// Possible values:
// "BPS_100M" - 100 Mbit/s
@@ -24173,1282 +21187,1027 @@ type InterconnectAttachment struct {
// "BPS_50M" - 50 Mbit/s
// "BPS_5G" - 5 Gbit/s
Bandwidth string `json:"bandwidth,omitempty"`
-
// CandidateIpv6Subnets: This field is not available.
CandidateIpv6Subnets []string `json:"candidateIpv6Subnets,omitempty"`
-
- // CandidateSubnets: Up to 16 candidate prefixes that can be used to
- // restrict the allocation of cloudRouterIpAddress and
- // customerRouterIpAddress for this attachment. All prefixes must be
- // within link-local address space (169.254.0.0/16) and must be /29 or
- // shorter (/28, /27, etc). Google will attempt to select an unused /29
- // from the supplied candidate prefix(es). The request will fail if all
- // possible /29s are in use on Google's edge. If not supplied, Google
- // will randomly select an unused /29 from all of link-local space.
+ // CandidateSubnets: Up to 16 candidate prefixes that can be used to restrict
+ // the allocation of cloudRouterIpAddress and customerRouterIpAddress for this
+ // attachment. All prefixes must be within link-local address space
+ // (169.254.0.0/16) and must be /29 or shorter (/28, /27, etc). Google will
+ // attempt to select an unused /29 from the supplied candidate prefix(es). The
+ // request will fail if all possible /29s are in use on Google's edge. If not
+ // supplied, Google will randomly select an unused /29 from all of link-local
+ // space.
CandidateSubnets []string `json:"candidateSubnets,omitempty"`
-
- // CloudRouterIpAddress: [Output Only] IPv4 address + prefix length to
- // be configured on Cloud Router Interface for this interconnect
- // attachment.
+ // CloudRouterIpAddress: [Output Only] IPv4 address + prefix length to be
+ // configured on Cloud Router Interface for this interconnect attachment.
CloudRouterIpAddress string `json:"cloudRouterIpAddress,omitempty"`
-
- // CloudRouterIpv6Address: [Output Only] IPv6 address + prefix length to
- // be configured on Cloud Router Interface for this interconnect
- // attachment.
+ // CloudRouterIpv6Address: [Output Only] IPv6 address + prefix length to be
+ // configured on Cloud Router Interface for this interconnect attachment.
CloudRouterIpv6Address string `json:"cloudRouterIpv6Address,omitempty"`
-
// CloudRouterIpv6InterfaceId: This field is not available.
CloudRouterIpv6InterfaceId string `json:"cloudRouterIpv6InterfaceId,omitempty"`
-
- // ConfigurationConstraints: [Output Only] Constraints for this
- // attachment, if any. The attachment does not work if these constraints
- // are not met.
+ // ConfigurationConstraints: [Output Only] Constraints for this attachment, if
+ // any. The attachment does not work if these constraints are not met.
ConfigurationConstraints *InterconnectAttachmentConfigurationConstraints `json:"configurationConstraints,omitempty"`
-
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // CustomerRouterIpAddress: [Output Only] IPv4 address + prefix length
- // to be configured on the customer router subinterface for this
- // interconnect attachment.
+ // CustomerRouterIpAddress: [Output Only] IPv4 address + prefix length to be
+ // configured on the customer router subinterface for this interconnect
+ // attachment.
CustomerRouterIpAddress string `json:"customerRouterIpAddress,omitempty"`
-
- // CustomerRouterIpv6Address: [Output Only] IPv6 address + prefix length
- // to be configured on the customer router subinterface for this
- // interconnect attachment.
+ // CustomerRouterIpv6Address: [Output Only] IPv6 address + prefix length to be
+ // configured on the customer router subinterface for this interconnect
+ // attachment.
CustomerRouterIpv6Address string `json:"customerRouterIpv6Address,omitempty"`
-
// CustomerRouterIpv6InterfaceId: This field is not available.
CustomerRouterIpv6InterfaceId string `json:"customerRouterIpv6InterfaceId,omitempty"`
-
// DataplaneVersion: [Output Only] Dataplane version for this
- // InterconnectAttachment. This field is only present for Dataplane
- // version 2 and higher. Absence of this field in the API output
- // indicates that the Dataplane is version 1.
+ // InterconnectAttachment. This field is only present for Dataplane version 2
+ // and higher. Absence of this field in the API output indicates that the
+ // Dataplane is version 1.
DataplaneVersion int64 `json:"dataplaneVersion,omitempty"`
-
// Description: An optional description of this resource.
Description string `json:"description,omitempty"`
-
- // EdgeAvailabilityDomain: Desired availability domain for the
- // attachment. Only available for type PARTNER, at creation time, and
- // can take one of the following values: - AVAILABILITY_DOMAIN_ANY -
- // AVAILABILITY_DOMAIN_1 - AVAILABILITY_DOMAIN_2 For improved
- // reliability, customers should configure a pair of attachments, one
- // per availability domain. The selected availability domain will be
- // provided to the Partner via the pairing key, so that the provisioned
- // circuit will lie in the specified domain. If not specified, the value
- // will default to AVAILABILITY_DOMAIN_ANY.
+ // EdgeAvailabilityDomain: Desired availability domain for the attachment. Only
+ // available for type PARTNER, at creation time, and can take one of the
+ // following values: - AVAILABILITY_DOMAIN_ANY - AVAILABILITY_DOMAIN_1 -
+ // AVAILABILITY_DOMAIN_2 For improved reliability, customers should configure a
+ // pair of attachments, one per availability domain. The selected availability
+ // domain will be provided to the Partner via the pairing key, so that the
+ // provisioned circuit will lie in the specified domain. If not specified, the
+ // value will default to AVAILABILITY_DOMAIN_ANY.
//
// Possible values:
// "AVAILABILITY_DOMAIN_1"
// "AVAILABILITY_DOMAIN_2"
// "AVAILABILITY_DOMAIN_ANY"
EdgeAvailabilityDomain string `json:"edgeAvailabilityDomain,omitempty"`
-
- // Encryption: Indicates the user-supplied encryption option of this
- // VLAN attachment (interconnectAttachment). Can only be specified at
- // attachment creation for PARTNER or DEDICATED attachments. Possible
- // values are: - NONE - This is the default value, which means that the
- // VLAN attachment carries unencrypted traffic. VMs are able to send
- // traffic to, or receive traffic from, such a VLAN attachment. - IPSEC
- // - The VLAN attachment carries only encrypted traffic that is
- // encrypted by an IPsec device, such as an HA VPN gateway or
- // third-party IPsec VPN. VMs cannot directly send traffic to, or
- // receive traffic from, such a VLAN attachment. To use *HA VPN over
- // Cloud Interconnect*, the VLAN attachment must be created with this
- // option.
- //
- // Possible values:
- // "IPSEC" - The interconnect attachment will carry only encrypted
- // traffic that is encrypted by an IPsec device such as HA VPN gateway;
- // VMs cannot directly send traffic to or receive traffic from such an
- // interconnect attachment. To use HA VPN over Cloud Interconnect, the
- // interconnect attachment must be created with this option.
+ // Encryption: Indicates the user-supplied encryption option of this VLAN
+ // attachment (interconnectAttachment). Can only be specified at attachment
+ // creation for PARTNER or DEDICATED attachments. Possible values are: - NONE -
+ // This is the default value, which means that the VLAN attachment carries
+ // unencrypted traffic. VMs are able to send traffic to, or receive traffic
+ // from, such a VLAN attachment. - IPSEC - The VLAN attachment carries only
+ // encrypted traffic that is encrypted by an IPsec device, such as an HA VPN
+ // gateway or third-party IPsec VPN. VMs cannot directly send traffic to, or
+ // receive traffic from, such a VLAN attachment. To use *HA VPN over Cloud
+ // Interconnect*, the VLAN attachment must be created with this option.
+ //
+ // Possible values:
+ // "IPSEC" - The interconnect attachment will carry only encrypted traffic
+ // that is encrypted by an IPsec device such as HA VPN gateway; VMs cannot
+ // directly send traffic to or receive traffic from such an interconnect
+ // attachment. To use HA VPN over Cloud Interconnect, the interconnect
+ // attachment must be created with this option.
// "NONE" - This is the default value, which means the Interconnect
- // Attachment will carry unencrypted traffic. VMs will be able to send
- // traffic to or receive traffic from such interconnect attachment.
+ // Attachment will carry unencrypted traffic. VMs will be able to send traffic
+ // to or receive traffic from such interconnect attachment.
Encryption string `json:"encryption,omitempty"`
-
// GoogleReferenceId: [Output Only] Google reference ID, to be used when
// raising support tickets with Google or otherwise to debug backend
// connectivity issues. [Deprecated] This field is not used.
GoogleReferenceId string `json:"googleReferenceId,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
// Interconnect: URL of the underlying Interconnect object that this
// attachment's traffic will traverse through.
Interconnect string `json:"interconnect,omitempty"`
-
- // IpsecInternalAddresses: A list of URLs of addresses that have been
- // reserved for the VLAN attachment. Used only for the VLAN attachment
- // that has the encryption option as IPSEC. The addresses must be
- // regional internal IP address ranges. When creating an HA VPN gateway
- // over the VLAN attachment, if the attachment is configured to use a
- // regional internal IP address, then the VPN gateway's IP address is
- // allocated from the IP address range specified here. For example, if
- // the HA VPN gateway's interface 0 is paired to this VLAN attachment,
- // then a regional internal IP address for the VPN gateway interface 0
- // will be allocated from the IP address specified for this VLAN
+ // IpsecInternalAddresses: A list of URLs of addresses that have been reserved
+ // for the VLAN attachment. Used only for the VLAN attachment that has the
+ // encryption option as IPSEC. The addresses must be regional internal IP
+ // address ranges. When creating an HA VPN gateway over the VLAN attachment, if
+ // the attachment is configured to use a regional internal IP address, then the
+ // VPN gateway's IP address is allocated from the IP address range specified
+ // here. For example, if the HA VPN gateway's interface 0 is paired to this
+ // VLAN attachment, then a regional internal IP address for the VPN gateway
+ // interface 0 will be allocated from the IP address specified for this VLAN
// attachment. If this field is not specified when creating the VLAN
- // attachment, then later on when creating an HA VPN gateway on this
- // VLAN attachment, the HA VPN gateway's IP address is allocated from
- // the regional external IP address pool.
+ // attachment, then later on when creating an HA VPN gateway on this VLAN
+ // attachment, the HA VPN gateway's IP address is allocated from the regional
+ // external IP address pool.
IpsecInternalAddresses []string `json:"ipsecInternalAddresses,omitempty"`
-
// Kind: [Output Only] Type of the resource. Always
// compute#interconnectAttachment for interconnect attachments.
Kind string `json:"kind,omitempty"`
-
// LabelFingerprint: A fingerprint for the labels being applied to this
- // InterconnectAttachment, which is essentially a hash of the labels set
- // used for optimistic locking. The fingerprint is initially generated
- // by Compute Engine and changes after every request to modify or update
- // labels. You must always provide an up-to-date fingerprint hash in
- // order to update or change labels, otherwise the request will fail
- // with error 412 conditionNotMet. To see the latest fingerprint, make a
- // get() request to retrieve an InterconnectAttachment.
+ // InterconnectAttachment, which is essentially a hash of the labels set used
+ // for optimistic locking. The fingerprint is initially generated by Compute
+ // Engine and changes after every request to modify or update labels. You must
+ // always provide an up-to-date fingerprint hash in order to update or change
+ // labels, otherwise the request will fail with error 412 conditionNotMet. To
+ // see the latest fingerprint, make a get() request to retrieve an
+ // InterconnectAttachment.
LabelFingerprint string `json:"labelFingerprint,omitempty"`
-
- // Labels: Labels for this resource. These can only be added or modified
- // by the setLabels method. Each label key/value pair must comply with
- // RFC1035. Label values may be empty.
+ // Labels: Labels for this resource. These can only be added or modified by the
+ // setLabels method. Each label key/value pair must comply with RFC1035. Label
+ // values may be empty.
Labels map[string]string `json:"labels,omitempty"`
-
- // Mtu: Maximum Transmission Unit (MTU), in bytes, of packets passing
- // through this interconnect attachment. Only 1440 and 1500 are allowed.
- // If not specified, the value will default to 1440.
+ // Mtu: Maximum Transmission Unit (MTU), in bytes, of packets passing through
+ // this interconnect attachment. Only 1440 and 1500 are allowed. If not
+ // specified, the value will default to 1440.
Mtu int64 `json:"mtu,omitempty"`
-
- // Name: Name of the resource. Provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
- // the first character must be a lowercase letter, and all following
- // characters must be a dash, lowercase letter, or digit, except the
- // last character, which cannot be a dash.
+ // Name: Name of the resource. Provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must
+ // be a lowercase letter, and all following characters must be a dash,
+ // lowercase letter, or digit, except the last character, which cannot be a
+ // dash.
Name string `json:"name,omitempty"`
-
- // OperationalStatus: [Output Only] The current status of whether or not
- // this interconnect attachment is functional, which can take one of the
- // following values: - OS_ACTIVE: The attachment has been turned up and
- // is ready to use. - OS_UNPROVISIONED: The attachment is not ready to
- // use yet, because turnup is not complete.
+ // OperationalStatus: [Output Only] The current status of whether or not this
+ // interconnect attachment is functional, which can take one of the following
+ // values: - OS_ACTIVE: The attachment has been turned up and is ready to use.
+ // - OS_UNPROVISIONED: The attachment is not ready to use yet, because turnup
+ // is not complete.
//
// Possible values:
- // "OS_ACTIVE" - Indicates that attachment has been turned up and is
- // ready to use.
- // "OS_UNPROVISIONED" - Indicates that attachment is not ready to use
- // yet, because turnup is not complete.
+ // "OS_ACTIVE" - Indicates that attachment has been turned up and is ready to
+ // use.
+ // "OS_UNPROVISIONED" - Indicates that attachment is not ready to use yet,
+ // because turnup is not complete.
OperationalStatus string `json:"operationalStatus,omitempty"`
-
- // PairingKey: [Output only for type PARTNER. Input only for
- // PARTNER_PROVIDER. Not present for DEDICATED]. The opaque identifier
- // of a PARTNER attachment used to initiate provisioning with a selected
- // partner. Of the form "XXXXX/region/domain"
+ // PairingKey: [Output only for type PARTNER. Input only for PARTNER_PROVIDER.
+ // Not present for DEDICATED]. The opaque identifier of a PARTNER attachment
+ // used to initiate provisioning with a selected partner. Of the form
+ // "XXXXX/region/domain"
PairingKey string `json:"pairingKey,omitempty"`
-
- // PartnerAsn: Optional BGP ASN for the router supplied by a Layer 3
- // Partner if they configured BGP on behalf of the customer. Output only
- // for PARTNER type, input only for PARTNER_PROVIDER, not available for
- // DEDICATED.
+ // PartnerAsn: Optional BGP ASN for the router supplied by a Layer 3 Partner if
+ // they configured BGP on behalf of the customer. Output only for PARTNER type,
+ // input only for PARTNER_PROVIDER, not available for DEDICATED.
PartnerAsn int64 `json:"partnerAsn,omitempty,string"`
-
- // PartnerMetadata: Informational metadata about Partner attachments
- // from Partners to display to customers. Output only for PARTNER type,
- // mutable for PARTNER_PROVIDER, not available for DEDICATED.
+ // PartnerMetadata: Informational metadata about Partner attachments from
+ // Partners to display to customers. Output only for PARTNER type, mutable for
+ // PARTNER_PROVIDER, not available for DEDICATED.
PartnerMetadata *InterconnectAttachmentPartnerMetadata `json:"partnerMetadata,omitempty"`
-
// PrivateInterconnectInfo: [Output Only] Information specific to an
- // InterconnectAttachment. This property is populated if the
- // interconnect that this is attached to is of type DEDICATED.
+ // InterconnectAttachment. This property is populated if the interconnect that
+ // this is attached to is of type DEDICATED.
PrivateInterconnectInfo *InterconnectAttachmentPrivateInfo `json:"privateInterconnectInfo,omitempty"`
-
- // Region: [Output Only] URL of the region where the regional
- // interconnect attachment resides. You must specify this field as part
- // of the HTTP request URL. It is not settable as a field in the request
- // body.
+ // Region: [Output Only] URL of the region where the regional interconnect
+ // attachment resides. You must specify this field as part of the HTTP request
+ // URL. It is not settable as a field in the request body.
Region string `json:"region,omitempty"`
-
// RemoteService: [Output Only] If the attachment is on a Cross-Cloud
- // Interconnect connection, this field contains the interconnect's
- // remote location service provider. Example values: "Amazon Web
- // Services" "Microsoft Azure". The field is set only for attachments on
- // Cross-Cloud Interconnect connections. Its value is copied from the
- // InterconnectRemoteLocation remoteService field.
+ // Interconnect connection, this field contains the interconnect's remote
+ // location service provider. Example values: "Amazon Web Services" "Microsoft
+ // Azure". The field is set only for attachments on Cross-Cloud Interconnect
+ // connections. Its value is copied from the InterconnectRemoteLocation
+ // remoteService field.
RemoteService string `json:"remoteService,omitempty"`
-
- // Router: URL of the Cloud Router to be used for dynamic routing. This
- // router must be in the same region as this InterconnectAttachment. The
- // InterconnectAttachment will automatically connect the Interconnect to
- // the network & region within which the Cloud Router is configured.
+ // Router: URL of the Cloud Router to be used for dynamic routing. This router
+ // must be in the same region as this InterconnectAttachment. The
+ // InterconnectAttachment will automatically connect the Interconnect to the
+ // network & region within which the Cloud Router is configured.
Router string `json:"router,omitempty"`
-
// SatisfiesPzs: [Output Only] Reserved for future use.
SatisfiesPzs bool `json:"satisfiesPzs,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // StackType: The stack type for this interconnect attachment to
- // identify whether the IPv6 feature is enabled or not. If not
- // specified, IPV4_ONLY will be used. This field can be both set at
- // interconnect attachments creation and update interconnect attachment
- // operations.
+ // StackType: The stack type for this interconnect attachment to identify
+ // whether the IPv6 feature is enabled or not. If not specified, IPV4_ONLY will
+ // be used. This field can be both set at interconnect attachments creation and
+ // update interconnect attachment operations.
//
// Possible values:
- // "IPV4_IPV6" - The interconnect attachment can have both IPv4 and
- // IPv6 addresses.
- // "IPV4_ONLY" - The interconnect attachment will only be assigned
- // IPv4 addresses.
+ // "IPV4_IPV6" - The interconnect attachment can have both IPv4 and IPv6
+ // addresses.
+ // "IPV4_ONLY" - The interconnect attachment will only be assigned IPv4
+ // addresses.
StackType string `json:"stackType,omitempty"`
-
- // State: [Output Only] The current state of this attachment's
- // functionality. Enum values ACTIVE and UNPROVISIONED are shared by
- // DEDICATED/PRIVATE, PARTNER, and PARTNER_PROVIDER interconnect
- // attachments, while enum values PENDING_PARTNER,
- // PARTNER_REQUEST_RECEIVED, and PENDING_CUSTOMER are used for only
- // PARTNER and PARTNER_PROVIDER interconnect attachments. This state can
- // take one of the following values: - ACTIVE: The attachment has been
- // turned up and is ready to use. - UNPROVISIONED: The attachment is not
- // ready to use yet, because turnup is not complete. - PENDING_PARTNER:
- // A newly-created PARTNER attachment that has not yet been configured
- // on the Partner side. - PARTNER_REQUEST_RECEIVED: A PARTNER attachment
- // is in the process of provisioning after a PARTNER_PROVIDER attachment
- // was created that references it. - PENDING_CUSTOMER: A PARTNER or
- // PARTNER_PROVIDER attachment that is waiting for a customer to
- // activate it. - DEFUNCT: The attachment was deleted externally and is
- // no longer functional. This could be because the associated
- // Interconnect was removed, or because the other side of a Partner
- // attachment was deleted.
- //
- // Possible values:
- // "ACTIVE" - Indicates that attachment has been turned up and is
- // ready to use.
+ // State: [Output Only] The current state of this attachment's functionality.
+ // Enum values ACTIVE and UNPROVISIONED are shared by DEDICATED/PRIVATE,
+ // PARTNER, and PARTNER_PROVIDER interconnect attachments, while enum values
+ // PENDING_PARTNER, PARTNER_REQUEST_RECEIVED, and PENDING_CUSTOMER are used for
+ // only PARTNER and PARTNER_PROVIDER interconnect attachments. This state can
+ // take one of the following values: - ACTIVE: The attachment has been turned
+ // up and is ready to use. - UNPROVISIONED: The attachment is not ready to use
+ // yet, because turnup is not complete. - PENDING_PARTNER: A newly-created
+ // PARTNER attachment that has not yet been configured on the Partner side. -
+ // PARTNER_REQUEST_RECEIVED: A PARTNER attachment is in the process of
+ // provisioning after a PARTNER_PROVIDER attachment was created that references
+ // it. - PENDING_CUSTOMER: A PARTNER or PARTNER_PROVIDER attachment that is
+ // waiting for a customer to activate it. - DEFUNCT: The attachment was deleted
+ // externally and is no longer functional. This could be because the associated
+ // Interconnect was removed, or because the other side of a Partner attachment
+ // was deleted.
+ //
+ // Possible values:
+ // "ACTIVE" - Indicates that attachment has been turned up and is ready to
+ // use.
// "DEFUNCT" - The attachment was deleted externally and is no longer
- // functional. This could be because the associated Interconnect was
- // wiped out, or because the other side of a Partner attachment was
- // deleted.
- // "PARTNER_REQUEST_RECEIVED" - A PARTNER attachment is in the process
- // of provisioning after a PARTNER_PROVIDER attachment was created that
- // references it.
+ // functional. This could be because the associated Interconnect was wiped out,
+ // or because the other side of a Partner attachment was deleted.
+ // "PARTNER_REQUEST_RECEIVED" - A PARTNER attachment is in the process of
+ // provisioning after a PARTNER_PROVIDER attachment was created that references
+ // it.
// "PENDING_CUSTOMER" - PARTNER or PARTNER_PROVIDER attachment that is
// waiting for the customer to activate.
- // "PENDING_PARTNER" - A newly created PARTNER attachment that has not
- // yet been configured on the Partner side.
+ // "PENDING_PARTNER" - A newly created PARTNER attachment that has not yet
+ // been configured on the Partner side.
// "STATE_UNSPECIFIED"
- // "UNPROVISIONED" - Indicates that attachment is not ready to use
- // yet, because turnup is not complete.
+ // "UNPROVISIONED" - Indicates that attachment is not ready to use yet,
+ // because turnup is not complete.
State string `json:"state,omitempty"`
-
- // SubnetLength: Length of the IPv4 subnet mask. Allowed values: - 29
- // (default) - 30 The default value is 29, except for Cross-Cloud
- // Interconnect connections that use an InterconnectRemoteLocation with
- // a constraints.subnetLengthRange.min equal to 30. For example,
- // connections that use an Azure remote location fall into this
- // category. In these cases, the default value is 30, and requesting 29
- // returns an error. Where both 29 and 30 are allowed, 29 is preferred,
- // because it gives Google Cloud Support more debugging visibility.
+ // SubnetLength: Length of the IPv4 subnet mask. Allowed values: - 29 (default)
+ // - 30 The default value is 29, except for Cross-Cloud Interconnect
+ // connections that use an InterconnectRemoteLocation with a
+ // constraints.subnetLengthRange.min equal to 30. For example, connections that
+ // use an Azure remote location fall into this category. In these cases, the
+ // default value is 30, and requesting 29 returns an error. Where both 29 and
+ // 30 are allowed, 29 is preferred, because it gives Google Cloud Support more
+ // debugging visibility.
SubnetLength int64 `json:"subnetLength,omitempty"`
-
- // Type: The type of interconnect attachment this is, which can take one
- // of the following values: - DEDICATED: an attachment to a Dedicated
- // Interconnect. - PARTNER: an attachment to a Partner Interconnect,
- // created by the customer. - PARTNER_PROVIDER: an attachment to a
- // Partner Interconnect, created by the partner.
+ // Type: The type of interconnect attachment this is, which can take one of the
+ // following values: - DEDICATED: an attachment to a Dedicated Interconnect. -
+ // PARTNER: an attachment to a Partner Interconnect, created by the customer. -
+ // PARTNER_PROVIDER: an attachment to a Partner Interconnect, created by the
+ // partner.
//
// Possible values:
// "DEDICATED" - Attachment to a dedicated interconnect.
- // "PARTNER" - Attachment to a partner interconnect, created by the
- // customer.
- // "PARTNER_PROVIDER" - Attachment to a partner interconnect, created
- // by the partner.
+ // "PARTNER" - Attachment to a partner interconnect, created by the customer.
+ // "PARTNER_PROVIDER" - Attachment to a partner interconnect, created by the
+ // partner.
Type string `json:"type,omitempty"`
-
- // VlanTag8021q: The IEEE 802.1Q VLAN tag for this attachment, in the
- // range 2-4093. Only specified at creation time.
+ // VlanTag8021q: The IEEE 802.1Q VLAN tag for this attachment, in the range
+ // 2-4093. Only specified at creation time.
VlanTag8021q int64 `json:"vlanTag8021q,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
// ForceSendFields is a list of field names (e.g. "AdminEnabled") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "AdminEnabled") 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. "AdminEnabled") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectAttachment) MarshalJSON() ([]byte, error) {
+func (s InterconnectAttachment) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectAttachment
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InterconnectAttachmentAggregatedList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of InterconnectAttachmentsScopedList resources.
Items map[string]InterconnectAttachmentsScopedList `json:"items,omitempty"`
-
// Kind: [Output Only] Type of resource. Always
// compute#interconnectAttachmentAggregatedList for aggregated lists of
// interconnect attachments.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Unreachables: [Output Only] Unreachable resources.
Unreachables []string `json:"unreachables,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *InterconnectAttachmentAggregatedListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectAttachmentAggregatedList) MarshalJSON() ([]byte, error) {
+func (s InterconnectAttachmentAggregatedList) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectAttachmentAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// InterconnectAttachmentAggregatedListWarning: [Output Only]
-// Informational warning message.
+// InterconnectAttachmentAggregatedListWarning: [Output Only] Informational
+// warning message.
type InterconnectAttachmentAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*InterconnectAttachmentAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectAttachmentAggregatedListWarning) MarshalJSON() ([]byte, error) {
+func (s InterconnectAttachmentAggregatedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectAttachmentAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InterconnectAttachmentAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectAttachmentAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+func (s InterconnectAttachmentAggregatedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectAttachmentAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InterconnectAttachmentConfigurationConstraints struct {
// BgpMd5: [Output Only] Whether the attachment's BGP session
- // requires/allows/disallows BGP MD5 authentication. This can take one
- // of the following values: MD5_OPTIONAL, MD5_REQUIRED, MD5_UNSUPPORTED.
- // For example, a Cross-Cloud Interconnect connection to a remote cloud
- // provider that requires BGP MD5 authentication has the
- // interconnectRemoteLocation
- // attachment_configuration_constraints.bgp_md5 field set to
- // MD5_REQUIRED, and that property is propagated to the attachment.
- // Similarly, if BGP MD5 is MD5_UNSUPPORTED, an error is returned if MD5
- // is requested.
- //
- // Possible values:
- // "MD5_OPTIONAL" - MD5_OPTIONAL: BGP MD5 authentication is supported
- // and can optionally be configured.
- // "MD5_REQUIRED" - MD5_REQUIRED: BGP MD5 authentication must be
- // configured.
- // "MD5_UNSUPPORTED" - MD5_UNSUPPORTED: BGP MD5 authentication must
- // not be configured
+ // requires/allows/disallows BGP MD5 authentication. This can take one of the
+ // following values: MD5_OPTIONAL, MD5_REQUIRED, MD5_UNSUPPORTED. For example,
+ // a Cross-Cloud Interconnect connection to a remote cloud provider that
+ // requires BGP MD5 authentication has the interconnectRemoteLocation
+ // attachment_configuration_constraints.bgp_md5 field set to MD5_REQUIRED, and
+ // that property is propagated to the attachment. Similarly, if BGP MD5 is
+ // MD5_UNSUPPORTED, an error is returned if MD5 is requested.
+ //
+ // Possible values:
+ // "MD5_OPTIONAL" - MD5_OPTIONAL: BGP MD5 authentication is supported and can
+ // optionally be configured.
+ // "MD5_REQUIRED" - MD5_REQUIRED: BGP MD5 authentication must be configured.
+ // "MD5_UNSUPPORTED" - MD5_UNSUPPORTED: BGP MD5 authentication must not be
+ // configured
BgpMd5 string `json:"bgpMd5,omitempty"`
-
- // BgpPeerAsnRanges: [Output Only] List of ASN ranges that the remote
- // location is known to support. Formatted as an array of inclusive
- // ranges {min: min-value, max: max-value}. For example, [{min: 123,
- // max: 123}, {min: 64512, max: 65534}] allows the peer ASN to be 123 or
- // anything in the range 64512-65534. This field is only advisory.
- // Although the API accepts other ranges, these are the ranges that we
- // recommend.
+ // BgpPeerAsnRanges: [Output Only] List of ASN ranges that the remote location
+ // is known to support. Formatted as an array of inclusive ranges {min:
+ // min-value, max: max-value}. For example, [{min: 123, max: 123}, {min: 64512,
+ // max: 65534}] allows the peer ASN to be 123 or anything in the range
+ // 64512-65534. This field is only advisory. Although the API accepts other
+ // ranges, these are the ranges that we recommend.
BgpPeerAsnRanges []*InterconnectAttachmentConfigurationConstraintsBgpPeerASNRange `json:"bgpPeerAsnRanges,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "BgpMd5") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "BgpMd5") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "BgpMd5") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectAttachmentConfigurationConstraints) MarshalJSON() ([]byte, error) {
+func (s InterconnectAttachmentConfigurationConstraints) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectAttachmentConfigurationConstraints
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InterconnectAttachmentConfigurationConstraintsBgpPeerASNRange struct {
Max int64 `json:"max,omitempty"`
-
Min int64 `json:"min,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Max") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Max") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Max") 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. "Max") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectAttachmentConfigurationConstraintsBgpPeerASNRange) MarshalJSON() ([]byte, error) {
+func (s InterconnectAttachmentConfigurationConstraintsBgpPeerASNRange) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectAttachmentConfigurationConstraintsBgpPeerASNRange
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// InterconnectAttachmentList: Response to the list request, and
-// contains a list of interconnect attachments.
+// InterconnectAttachmentList: Response to the list request, and contains a
+// list of interconnect attachments.
type InterconnectAttachmentList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of InterconnectAttachment resources.
Items []*InterconnectAttachment `json:"items,omitempty"`
-
// Kind: [Output Only] Type of resource. Always
- // compute#interconnectAttachmentList for lists of interconnect
- // attachments.
+ // compute#interconnectAttachmentList for lists of interconnect attachments.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *InterconnectAttachmentListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectAttachmentList) MarshalJSON() ([]byte, error) {
+func (s InterconnectAttachmentList) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectAttachmentList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// InterconnectAttachmentListWarning: [Output Only] Informational
-// warning message.
+// InterconnectAttachmentListWarning: [Output Only] Informational warning
+// message.
type InterconnectAttachmentListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*InterconnectAttachmentListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectAttachmentListWarning) MarshalJSON() ([]byte, error) {
+func (s InterconnectAttachmentListWarning) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectAttachmentListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InterconnectAttachmentListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectAttachmentListWarningData) MarshalJSON() ([]byte, error) {
+func (s InterconnectAttachmentListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectAttachmentListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// InterconnectAttachmentPartnerMetadata: Informational metadata about
-// Partner attachments from Partners to display to customers. These
-// fields are propagated from PARTNER_PROVIDER attachments to their
-// corresponding PARTNER attachments.
+// InterconnectAttachmentPartnerMetadata: Informational metadata about Partner
+// attachments from Partners to display to customers. These fields are
+// propagated from PARTNER_PROVIDER attachments to their corresponding PARTNER
+// attachments.
type InterconnectAttachmentPartnerMetadata struct {
- // InterconnectName: Plain text name of the Interconnect this attachment
- // is connected to, as displayed in the Partner's portal. For instance
- // "Chicago 1". This value may be validated to match approved Partner
- // values.
+ // InterconnectName: Plain text name of the Interconnect this attachment is
+ // connected to, as displayed in the Partner's portal. For instance "Chicago
+ // 1". This value may be validated to match approved Partner values.
InterconnectName string `json:"interconnectName,omitempty"`
-
- // PartnerName: Plain text name of the Partner providing this
- // attachment. This value may be validated to match approved Partner
- // values.
+ // PartnerName: Plain text name of the Partner providing this attachment. This
+ // value may be validated to match approved Partner values.
PartnerName string `json:"partnerName,omitempty"`
-
- // PortalUrl: URL of the Partner's portal for this Attachment. Partners
- // may customise this to be a deep link to the specific resource on the
- // Partner portal. This value may be validated to match approved Partner
- // values.
+ // PortalUrl: URL of the Partner's portal for this Attachment. Partners may
+ // customise this to be a deep link to the specific resource on the Partner
+ // portal. This value may be validated to match approved Partner values.
PortalUrl string `json:"portalUrl,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "InterconnectName") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "InterconnectName") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "InterconnectName") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectAttachmentPartnerMetadata) MarshalJSON() ([]byte, error) {
+func (s InterconnectAttachmentPartnerMetadata) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectAttachmentPartnerMetadata
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// InterconnectAttachmentPrivateInfo: Information for an interconnect
// attachment when this belongs to an interconnect of type DEDICATED.
type InterconnectAttachmentPrivateInfo struct {
- // Tag8021q: [Output Only] 802.1q encapsulation tag to be used for
- // traffic between Google and the customer, going to and from this
- // network and region.
+ // Tag8021q: [Output Only] 802.1q encapsulation tag to be used for traffic
+ // between Google and the customer, going to and from this network and region.
Tag8021q int64 `json:"tag8021q,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Tag8021q") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Tag8021q") 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. "Tag8021q") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectAttachmentPrivateInfo) MarshalJSON() ([]byte, error) {
+func (s InterconnectAttachmentPrivateInfo) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectAttachmentPrivateInfo
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InterconnectAttachmentsScopedList struct {
- // InterconnectAttachments: A list of interconnect attachments contained
- // in this scope.
+ // InterconnectAttachments: A list of interconnect attachments contained in
+ // this scope.
InterconnectAttachments []*InterconnectAttachment `json:"interconnectAttachments,omitempty"`
-
- // Warning: Informational warning which replaces the list of addresses
- // when the list is empty.
+ // Warning: Informational warning which replaces the list of addresses when the
+ // list is empty.
Warning *InterconnectAttachmentsScopedListWarning `json:"warning,omitempty"`
-
- // ForceSendFields is a list of field names (e.g.
- // "InterconnectAttachments") to unconditionally include in API
- // requests. By default, fields with empty or default 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. "InterconnectAttachments")
- // 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.
+ // ForceSendFields is a list of field names (e.g. "InterconnectAttachments") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "InterconnectAttachments") to
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectAttachmentsScopedList) MarshalJSON() ([]byte, error) {
+func (s InterconnectAttachmentsScopedList) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectAttachmentsScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// InterconnectAttachmentsScopedListWarning: Informational warning which
// replaces the list of addresses when the list is empty.
type InterconnectAttachmentsScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*InterconnectAttachmentsScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectAttachmentsScopedListWarning) MarshalJSON() ([]byte, error) {
+func (s InterconnectAttachmentsScopedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectAttachmentsScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InterconnectAttachmentsScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectAttachmentsScopedListWarningData) MarshalJSON() ([]byte, error) {
+func (s InterconnectAttachmentsScopedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectAttachmentsScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// InterconnectCircuitInfo: Describes a single physical circuit between
-// the Customer and Google. CircuitInfo objects are created by Google,
-// so all fields are output only.
+// InterconnectCircuitInfo: Describes a single physical circuit between the
+// Customer and Google. CircuitInfo objects are created by Google, so all
+// fields are output only.
type InterconnectCircuitInfo struct {
// CustomerDemarcId: Customer-side demarc ID for this circuit.
CustomerDemarcId string `json:"customerDemarcId,omitempty"`
-
- // GoogleCircuitId: Google-assigned unique ID for this circuit. Assigned
- // at circuit turn-up.
+ // GoogleCircuitId: Google-assigned unique ID for this circuit. Assigned at
+ // circuit turn-up.
GoogleCircuitId string `json:"googleCircuitId,omitempty"`
-
- // GoogleDemarcId: Google-side demarc ID for this circuit. Assigned at
- // circuit turn-up and provided by Google to the customer in the LOA.
+ // GoogleDemarcId: Google-side demarc ID for this circuit. Assigned at circuit
+ // turn-up and provided by Google to the customer in the LOA.
GoogleDemarcId string `json:"googleDemarcId,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "CustomerDemarcId") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "CustomerDemarcId") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "CustomerDemarcId") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectCircuitInfo) MarshalJSON() ([]byte, error) {
+func (s InterconnectCircuitInfo) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectCircuitInfo
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// InterconnectDiagnostics: Diagnostics information about the
-// Interconnect connection, which contains detailed and current
-// technical information about Google's side of the connection.
+// InterconnectDiagnostics: Diagnostics information about the Interconnect
+// connection, which contains detailed and current technical information about
+// Google's side of the connection.
type InterconnectDiagnostics struct {
- // ArpCaches: A list of InterconnectDiagnostics.ARPEntry objects,
- // describing individual neighbors currently seen by the Google router
- // in the ARP cache for the Interconnect. This will be empty when the
- // Interconnect is not bundled.
+ // ArpCaches: A list of InterconnectDiagnostics.ARPEntry objects, describing
+ // individual neighbors currently seen by the Google router in the ARP cache
+ // for the Interconnect. This will be empty when the Interconnect is not
+ // bundled.
ArpCaches []*InterconnectDiagnosticsARPEntry `json:"arpCaches,omitempty"`
-
// BundleAggregationType: The aggregation type of the bundle interface.
//
// Possible values:
// "BUNDLE_AGGREGATION_TYPE_LACP" - LACP is enabled.
// "BUNDLE_AGGREGATION_TYPE_STATIC" - LACP is disabled.
BundleAggregationType string `json:"bundleAggregationType,omitempty"`
-
- // BundleOperationalStatus: The operational status of the bundle
- // interface.
+ // BundleOperationalStatus: The operational status of the bundle interface.
//
// Possible values:
- // "BUNDLE_OPERATIONAL_STATUS_DOWN" - If bundleAggregationType is
- // LACP: LACP is not established and/or all links in the bundle have
- // DOWN operational status. If bundleAggregationType is STATIC: one or
- // more links in the bundle has DOWN operational status.
- // "BUNDLE_OPERATIONAL_STATUS_UP" - If bundleAggregationType is LACP:
- // LACP is established and at least one link in the bundle has UP
- // operational status. If bundleAggregationType is STATIC: all links in
- // the bundle (typically just one) have UP operational status.
+ // "BUNDLE_OPERATIONAL_STATUS_DOWN" - If bundleAggregationType is LACP: LACP
+ // is not established and/or all links in the bundle have DOWN operational
+ // status. If bundleAggregationType is STATIC: one or more links in the bundle
+ // has DOWN operational status.
+ // "BUNDLE_OPERATIONAL_STATUS_UP" - If bundleAggregationType is LACP: LACP is
+ // established and at least one link in the bundle has UP operational status.
+ // If bundleAggregationType is STATIC: all links in the bundle (typically just
+ // one) have UP operational status.
BundleOperationalStatus string `json:"bundleOperationalStatus,omitempty"`
-
- // Links: A list of InterconnectDiagnostics.LinkStatus objects,
- // describing the status for each link on the Interconnect.
+ // Links: A list of InterconnectDiagnostics.LinkStatus objects, describing the
+ // status for each link on the Interconnect.
Links []*InterconnectDiagnosticsLinkStatus `json:"links,omitempty"`
-
// MacAddress: The MAC address of the Interconnect's bundle interface.
MacAddress string `json:"macAddress,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "ArpCaches") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "ArpCaches") 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. "ArpCaches") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectDiagnostics) MarshalJSON() ([]byte, error) {
+func (s InterconnectDiagnostics) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectDiagnostics
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// InterconnectDiagnosticsARPEntry: Describing the ARP neighbor entries
-// seen on this link
+// InterconnectDiagnosticsARPEntry: Describing the ARP neighbor entries seen on
+// this link
type InterconnectDiagnosticsARPEntry struct {
// IpAddress: The IP address of this ARP neighbor.
IpAddress string `json:"ipAddress,omitempty"`
-
// MacAddress: The MAC address of this ARP neighbor.
MacAddress string `json:"macAddress,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "IpAddress") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "IpAddress") 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. "IpAddress") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectDiagnosticsARPEntry) MarshalJSON() ([]byte, error) {
+func (s InterconnectDiagnosticsARPEntry) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectDiagnosticsARPEntry
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InterconnectDiagnosticsLinkLACPStatus struct {
- // GoogleSystemId: System ID of the port on Google's side of the LACP
- // exchange.
+ // GoogleSystemId: System ID of the port on Google's side of the LACP exchange.
GoogleSystemId string `json:"googleSystemId,omitempty"`
-
- // NeighborSystemId: System ID of the port on the neighbor's side of the
- // LACP exchange.
+ // NeighborSystemId: System ID of the port on the neighbor's side of the LACP
+ // exchange.
NeighborSystemId string `json:"neighborSystemId,omitempty"`
-
- // State: The state of a LACP link, which can take one of the following
- // values: - ACTIVE: The link is configured and active within the
- // bundle. - DETACHED: The link is not configured within the bundle.
- // This means that the rest of the object should be empty.
+ // State: The state of a LACP link, which can take one of the following values:
+ // - ACTIVE: The link is configured and active within the bundle. - DETACHED:
+ // The link is not configured within the bundle. This means that the rest of
+ // the object should be empty.
//
// Possible values:
// "ACTIVE" - The link is configured and active within the bundle.
- // "DETACHED" - The link is not configured within the bundle, this
- // means the rest of the object should be empty.
+ // "DETACHED" - The link is not configured within the bundle, this means the
+ // rest of the object should be empty.
State string `json:"state,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "GoogleSystemId") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "GoogleSystemId") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "GoogleSystemId") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectDiagnosticsLinkLACPStatus) MarshalJSON() ([]byte, error) {
+func (s InterconnectDiagnosticsLinkLACPStatus) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectDiagnosticsLinkLACPStatus
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InterconnectDiagnosticsLinkOpticalPower struct {
- // State: The status of the current value when compared to the warning
- // and alarm levels for the receiving or transmitting transceiver.
- // Possible states include: - OK: The value has not crossed a warning
- // threshold. - LOW_WARNING: The value has crossed below the low warning
- // threshold. - HIGH_WARNING: The value has crossed above the high
- // warning threshold. - LOW_ALARM: The value has crossed below the low
- // alarm threshold. - HIGH_ALARM: The value has crossed above the high
- // alarm threshold.
- //
- // Possible values:
- // "HIGH_ALARM" - The value has crossed above the high alarm
+ // State: The status of the current value when compared to the warning and
+ // alarm levels for the receiving or transmitting transceiver. Possible states
+ // include: - OK: The value has not crossed a warning threshold. - LOW_WARNING:
+ // The value has crossed below the low warning threshold. - HIGH_WARNING: The
+ // value has crossed above the high warning threshold. - LOW_ALARM: The value
+ // has crossed below the low alarm threshold. - HIGH_ALARM: The value has
+ // crossed above the high alarm threshold.
+ //
+ // Possible values:
+ // "HIGH_ALARM" - The value has crossed above the high alarm threshold.
+ // "HIGH_WARNING" - The value of the current optical power has crossed above
+ // the high warning threshold.
+ // "LOW_ALARM" - The value of the current optical power has crossed below the
+ // low alarm threshold.
+ // "LOW_WARNING" - The value of the current optical power has crossed below
+ // the low warning threshold.
+ // "OK" - The value of the current optical power has not crossed a warning
// threshold.
- // "HIGH_WARNING" - The value of the current optical power has crossed
- // above the high warning threshold.
- // "LOW_ALARM" - The value of the current optical power has crossed
- // below the low alarm threshold.
- // "LOW_WARNING" - The value of the current optical power has crossed
- // below the low warning threshold.
- // "OK" - The value of the current optical power has not crossed a
- // warning threshold.
State string `json:"state,omitempty"`
-
- // Value: Value of the current receiving or transmitting optical power,
- // read in dBm. Take a known good optical value, give it a 10% margin
- // and trigger warnings relative to that value. In general, a -7dBm
- // warning and a -11dBm alarm are good optical value estimates for most
- // links.
+ // Value: Value of the current receiving or transmitting optical power, read in
+ // dBm. Take a known good optical value, give it a 10% margin and trigger
+ // warnings relative to that value. In general, a -7dBm warning and a -11dBm
+ // alarm are good optical value estimates for most links.
Value float64 `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "State") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "State") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "State") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectDiagnosticsLinkOpticalPower) MarshalJSON() ([]byte, error) {
+func (s InterconnectDiagnosticsLinkOpticalPower) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectDiagnosticsLinkOpticalPower
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
func (s *InterconnectDiagnosticsLinkOpticalPower) UnmarshalJSON(data []byte) error {
@@ -25466,334 +22225,266 @@ func (s *InterconnectDiagnosticsLinkOpticalPower) UnmarshalJSON(data []byte) err
}
type InterconnectDiagnosticsLinkStatus struct {
- // ArpCaches: A list of InterconnectDiagnostics.ARPEntry objects,
- // describing the ARP neighbor entries seen on this link. This will be
- // empty if the link is bundled
+ // ArpCaches: A list of InterconnectDiagnostics.ARPEntry objects, describing
+ // the ARP neighbor entries seen on this link. This will be empty if the link
+ // is bundled
ArpCaches []*InterconnectDiagnosticsARPEntry `json:"arpCaches,omitempty"`
-
- // CircuitId: The unique ID for this link assigned during turn up by
- // Google.
+ // CircuitId: The unique ID for this link assigned during turn up by Google.
CircuitId string `json:"circuitId,omitempty"`
-
- // GoogleDemarc: The Demarc address assigned by Google and provided in
- // the LoA.
- GoogleDemarc string `json:"googleDemarc,omitempty"`
-
- LacpStatus *InterconnectDiagnosticsLinkLACPStatus `json:"lacpStatus,omitempty"`
-
+ // GoogleDemarc: The Demarc address assigned by Google and provided in the LoA.
+ GoogleDemarc string `json:"googleDemarc,omitempty"`
+ LacpStatus *InterconnectDiagnosticsLinkLACPStatus `json:"lacpStatus,omitempty"`
// Macsec: Describes the status of MACsec encryption on this link.
Macsec *InterconnectDiagnosticsMacsecStatus `json:"macsec,omitempty"`
-
// OperationalStatus: The operational status of the link.
//
// Possible values:
- // "LINK_OPERATIONAL_STATUS_DOWN" - The interface is unable to
- // communicate with the remote end.
- // "LINK_OPERATIONAL_STATUS_UP" - The interface has low level
- // communication with the remote end.
+ // "LINK_OPERATIONAL_STATUS_DOWN" - The interface is unable to communicate
+ // with the remote end.
+ // "LINK_OPERATIONAL_STATUS_UP" - The interface has low level communication
+ // with the remote end.
OperationalStatus string `json:"operationalStatus,omitempty"`
-
- // ReceivingOpticalPower: An InterconnectDiagnostics.LinkOpticalPower
- // object, describing the current value and status of the received light
- // level.
+ // ReceivingOpticalPower: An InterconnectDiagnostics.LinkOpticalPower object,
+ // describing the current value and status of the received light level.
ReceivingOpticalPower *InterconnectDiagnosticsLinkOpticalPower `json:"receivingOpticalPower,omitempty"`
-
// TransmittingOpticalPower: An InterconnectDiagnostics.LinkOpticalPower
- // object, describing the current value and status of the transmitted
- // light level.
+ // object, describing the current value and status of the transmitted light
+ // level.
TransmittingOpticalPower *InterconnectDiagnosticsLinkOpticalPower `json:"transmittingOpticalPower,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "ArpCaches") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "ArpCaches") 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. "ArpCaches") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectDiagnosticsLinkStatus) MarshalJSON() ([]byte, error) {
+func (s InterconnectDiagnosticsLinkStatus) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectDiagnosticsLinkStatus
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// InterconnectDiagnosticsMacsecStatus: Describes the status of MACsec
// encryption on the link.
type InterconnectDiagnosticsMacsecStatus struct {
- // Ckn: Indicates the Connectivity Association Key Name (CKN) currently
- // being used if MACsec is operational.
+ // Ckn: Indicates the Connectivity Association Key Name (CKN) currently being
+ // used if MACsec is operational.
Ckn string `json:"ckn,omitempty"`
-
- // Operational: Indicates whether or not MACsec is operational on this
- // link.
+ // Operational: Indicates whether or not MACsec is operational on this link.
Operational bool `json:"operational,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Ckn") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Ckn") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Ckn") 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. "Ckn") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectDiagnosticsMacsecStatus) MarshalJSON() ([]byte, error) {
+func (s InterconnectDiagnosticsMacsecStatus) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectDiagnosticsMacsecStatus
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// InterconnectList: Response to the list request, and contains a list
-// of interconnects.
+// InterconnectList: Response to the list request, and contains a list of
+// interconnects.
type InterconnectList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of Interconnect resources.
Items []*Interconnect `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource. Always compute#interconnectList
- // for lists of interconnects.
+ // Kind: [Output Only] Type of resource. Always compute#interconnectList for
+ // lists of interconnects.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *InterconnectListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectList) MarshalJSON() ([]byte, error) {
+func (s InterconnectList) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// InterconnectListWarning: [Output Only] Informational warning message.
type InterconnectListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*InterconnectListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectListWarning) MarshalJSON() ([]byte, error) {
+func (s InterconnectListWarning) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InterconnectListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectListWarningData) MarshalJSON() ([]byte, error) {
+func (s InterconnectListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// InterconnectLocation: Represents an Interconnect Attachment (VLAN)
-// Location resource. You can use this resource to find location details
-// about an Interconnect attachment (VLAN). For more information about
-// interconnect attachments, read Creating VLAN Attachments.
+// InterconnectLocation: Represents an Interconnect Attachment (VLAN) Location
+// resource. You can use this resource to find location details about an
+// Interconnect attachment (VLAN). For more information about interconnect
+// attachments, read Creating VLAN Attachments.
type InterconnectLocation struct {
- // Address: [Output Only] The postal address of the Point of Presence,
- // each line in the address is separated by a newline character.
+ // Address: [Output Only] The postal address of the Point of Presence, each
+ // line in the address is separated by a newline character.
Address string `json:"address,omitempty"`
-
// AvailabilityZone: [Output Only] Availability zone for this
- // InterconnectLocation. Within a metropolitan area (metro), maintenance
- // will not be simultaneously scheduled in more than one availability
- // zone. Example: "zone1" or "zone2".
+ // InterconnectLocation. Within a metropolitan area (metro), maintenance will
+ // not be simultaneously scheduled in more than one availability zone. Example:
+ // "zone1" or "zone2".
AvailabilityZone string `json:"availabilityZone,omitempty"`
-
// AvailableFeatures: [Output only] List of features available at this
- // InterconnectLocation, which can take one of the following values: -
- // MACSEC
+ // InterconnectLocation, which can take one of the following values: - MACSEC
//
// Possible values:
// "IF_MACSEC" - Media Access Control security (MACsec)
AvailableFeatures []string `json:"availableFeatures,omitempty"`
-
- // AvailableLinkTypes: [Output only] List of link types available at
- // this InterconnectLocation, which can take one of the following
- // values: - LINK_TYPE_ETHERNET_10G_LR - LINK_TYPE_ETHERNET_100G_LR
+ // AvailableLinkTypes: [Output only] List of link types available at this
+ // InterconnectLocation, which can take one of the following values: -
+ // LINK_TYPE_ETHERNET_10G_LR - LINK_TYPE_ETHERNET_100G_LR
//
// Possible values:
// "LINK_TYPE_ETHERNET_100G_LR" - 100G Ethernet, LR Optics.
- // "LINK_TYPE_ETHERNET_10G_LR" - 10G Ethernet, LR Optics. [(rate_bps)
- // = 10000000000];
+ // "LINK_TYPE_ETHERNET_10G_LR" - 10G Ethernet, LR Optics. [(rate_bps) =
+ // 10000000000];
AvailableLinkTypes []string `json:"availableLinkTypes,omitempty"`
-
- // City: [Output Only] Metropolitan area designator that indicates which
- // city an interconnect is located. For example: "Chicago, IL",
- // "Amsterdam, Netherlands".
+ // City: [Output Only] Metropolitan area designator that indicates which city
+ // an interconnect is located. For example: "Chicago, IL", "Amsterdam,
+ // Netherlands".
City string `json:"city,omitempty"`
-
- // Continent: [Output Only] Continent for this location, which can take
- // one of the following values: - AFRICA - ASIA_PAC - EUROPE -
- // NORTH_AMERICA - SOUTH_AMERICA
+ // Continent: [Output Only] Continent for this location, which can take one of
+ // the following values: - AFRICA - ASIA_PAC - EUROPE - NORTH_AMERICA -
+ // SOUTH_AMERICA
//
// Possible values:
// "AFRICA"
@@ -25807,280 +22498,221 @@ type InterconnectLocation struct {
// "NORTH_AMERICA"
// "SOUTH_AMERICA"
Continent string `json:"continent,omitempty"`
-
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
// Description: [Output Only] An optional description of the resource.
Description string `json:"description,omitempty"`
-
- // FacilityProvider: [Output Only] The name of the provider for this
- // facility (e.g., EQUINIX).
+ // FacilityProvider: [Output Only] The name of the provider for this facility
+ // (e.g., EQUINIX).
FacilityProvider string `json:"facilityProvider,omitempty"`
-
- // FacilityProviderFacilityId: [Output Only] A provider-assigned
- // Identifier for this facility (e.g., Ashburn-DC1).
+ // FacilityProviderFacilityId: [Output Only] A provider-assigned Identifier for
+ // this facility (e.g., Ashburn-DC1).
FacilityProviderFacilityId string `json:"facilityProviderFacilityId,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
// Kind: [Output Only] Type of the resource. Always
// compute#interconnectLocation for interconnect locations.
Kind string `json:"kind,omitempty"`
-
// Name: [Output Only] Name of the resource.
Name string `json:"name,omitempty"`
-
// PeeringdbFacilityId: [Output Only] The peeringdb identifier for this
// facility (corresponding with a netfac type in peeringdb).
PeeringdbFacilityId string `json:"peeringdbFacilityId,omitempty"`
-
// RegionInfos: [Output Only] A list of InterconnectLocation.RegionInfo
- // objects, that describe parameters pertaining to the relation between
- // this InterconnectLocation and various Google Cloud regions.
+ // objects, that describe parameters pertaining to the relation between this
+ // InterconnectLocation and various Google Cloud regions.
RegionInfos []*InterconnectLocationRegionInfo `json:"regionInfos,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // Status: [Output Only] The status of this InterconnectLocation, which
- // can take one of the following values: - CLOSED: The
- // InterconnectLocation is closed and is unavailable for provisioning
- // new Interconnects. - AVAILABLE: The InterconnectLocation is available
- // for provisioning new Interconnects.
+ // Status: [Output Only] The status of this InterconnectLocation, which can
+ // take one of the following values: - CLOSED: The InterconnectLocation is
+ // closed and is unavailable for provisioning new Interconnects. - AVAILABLE:
+ // The InterconnectLocation is available for provisioning new Interconnects.
//
// Possible values:
- // "AVAILABLE" - The InterconnectLocation is available for
- // provisioning new Interconnects.
+ // "AVAILABLE" - The InterconnectLocation is available for provisioning new
+ // Interconnects.
// "CLOSED" - The InterconnectLocation is closed for provisioning new
// Interconnects.
Status string `json:"status,omitempty"`
-
// SupportsPzs: [Output Only] Reserved for future use.
SupportsPzs bool `json:"supportsPzs,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Address") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Address") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Address") 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. "Address") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectLocation) MarshalJSON() ([]byte, error) {
+func (s InterconnectLocation) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectLocation
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// InterconnectLocationList: Response to the list request, and contains
-// a list of interconnect locations.
+// InterconnectLocationList: Response to the list request, and contains a list
+// of interconnect locations.
type InterconnectLocationList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of InterconnectLocation resources.
Items []*InterconnectLocation `json:"items,omitempty"`
-
// Kind: [Output Only] Type of resource. Always
// compute#interconnectLocationList for lists of interconnect locations.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *InterconnectLocationListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectLocationList) MarshalJSON() ([]byte, error) {
+func (s InterconnectLocationList) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectLocationList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// InterconnectLocationListWarning: [Output Only] Informational warning
// message.
type InterconnectLocationListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*InterconnectLocationListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectLocationListWarning) MarshalJSON() ([]byte, error) {
+func (s InterconnectLocationListWarning) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectLocationListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InterconnectLocationListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectLocationListWarningData) MarshalJSON() ([]byte, error) {
+func (s InterconnectLocationListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectLocationListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// InterconnectLocationRegionInfo: Information about any potential
@@ -26090,334 +22722,264 @@ type InterconnectLocationRegionInfo struct {
// ExpectedRttMs: Expected round-trip time in milliseconds, from this
// InterconnectLocation to a VM in this region.
ExpectedRttMs int64 `json:"expectedRttMs,omitempty,string"`
-
// LocationPresence: Identifies the network presence of this location.
//
// Possible values:
- // "GLOBAL" - This region is not in any common network presence with
+ // "GLOBAL" - This region is not in any common network presence with this
+ // InterconnectLocation.
+ // "LOCAL_REGION" - This region shares the same regional network presence as
// this InterconnectLocation.
- // "LOCAL_REGION" - This region shares the same regional network
- // presence as this InterconnectLocation.
// "LP_GLOBAL" - [Deprecated] This region is not in any common network
// presence with this InterconnectLocation.
- // "LP_LOCAL_REGION" - [Deprecated] This region shares the same
- // regional network presence as this InterconnectLocation.
+ // "LP_LOCAL_REGION" - [Deprecated] This region shares the same regional
+ // network presence as this InterconnectLocation.
LocationPresence string `json:"locationPresence,omitempty"`
-
// Region: URL for the region of this location.
Region string `json:"region,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "ExpectedRttMs") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "ExpectedRttMs") 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. "ExpectedRttMs") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectLocationRegionInfo) MarshalJSON() ([]byte, error) {
+func (s InterconnectLocationRegionInfo) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectLocationRegionInfo
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// InterconnectMacsec: Configuration information for enabling Media
-// Access Control security (MACsec) on this Cloud Interconnect
-// connection between Google and your on-premises router.
+// InterconnectMacsec: Configuration information for enabling Media Access
+// Control security (MACsec) on this Cloud Interconnect connection between
+// Google and your on-premises router.
type InterconnectMacsec struct {
- // FailOpen: If set to true, the Interconnect connection is configured
- // with a should-secure MACsec security policy, that allows the Google
- // router to fallback to cleartext traffic if the MKA session cannot be
- // established. By default, the Interconnect connection is configured
- // with a must-secure security policy that drops all traffic if the MKA
- // session cannot be established with your router.
+ // FailOpen: If set to true, the Interconnect connection is configured with a
+ // should-secure MACsec security policy, that allows the Google router to
+ // fallback to cleartext traffic if the MKA session cannot be established. By
+ // default, the Interconnect connection is configured with a must-secure
+ // security policy that drops all traffic if the MKA session cannot be
+ // established with your router.
FailOpen bool `json:"failOpen,omitempty"`
-
- // PreSharedKeys: Required. A keychain placeholder describing a set of
- // named key objects along with their start times. A MACsec CKN/CAK is
- // generated for each key in the key chain. Google router automatically
- // picks the key with the most recent startTime when establishing or
- // re-establishing a MACsec secure link.
+ // PreSharedKeys: Required. A keychain placeholder describing a set of named
+ // key objects along with their start times. A MACsec CKN/CAK is generated for
+ // each key in the key chain. Google router automatically picks the key with
+ // the most recent startTime when establishing or re-establishing a MACsec
+ // secure link.
PreSharedKeys []*InterconnectMacsecPreSharedKey `json:"preSharedKeys,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "FailOpen") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "FailOpen") 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. "FailOpen") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectMacsec) MarshalJSON() ([]byte, error) {
+func (s InterconnectMacsec) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectMacsec
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// InterconnectMacsecConfig: MACsec configuration information for the
-// Interconnect connection. Contains the generated Connectivity
-// Association Key Name (CKN) and the key (CAK) for this Interconnect
-// connection.
+// Interconnect connection. Contains the generated Connectivity Association Key
+// Name (CKN) and the key (CAK) for this Interconnect connection.
type InterconnectMacsecConfig struct {
- // PreSharedKeys: A keychain placeholder describing a set of named key
- // objects along with their start times. A MACsec CKN/CAK is generated
- // for each key in the key chain. Google router automatically picks the
- // key with the most recent startTime when establishing or
- // re-establishing a MACsec secure link.
+ // PreSharedKeys: A keychain placeholder describing a set of named key objects
+ // along with their start times. A MACsec CKN/CAK is generated for each key in
+ // the key chain. Google router automatically picks the key with the most
+ // recent startTime when establishing or re-establishing a MACsec secure link.
PreSharedKeys []*InterconnectMacsecConfigPreSharedKey `json:"preSharedKeys,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "PreSharedKeys") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "PreSharedKeys") 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. "PreSharedKeys") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectMacsecConfig) MarshalJSON() ([]byte, error) {
+func (s InterconnectMacsecConfig) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectMacsecConfig
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// InterconnectMacsecConfigPreSharedKey: Describes a pre-shared key used
-// to setup MACsec in static connectivity association key (CAK) mode.
+// InterconnectMacsecConfigPreSharedKey: Describes a pre-shared key used to
+// setup MACsec in static connectivity association key (CAK) mode.
type InterconnectMacsecConfigPreSharedKey struct {
- // Cak: An auto-generated Connectivity Association Key (CAK) for this
- // key.
+ // Cak: An auto-generated Connectivity Association Key (CAK) for this key.
Cak string `json:"cak,omitempty"`
-
- // Ckn: An auto-generated Connectivity Association Key Name (CKN) for
- // this key.
+ // Ckn: An auto-generated Connectivity Association Key Name (CKN) for this key.
Ckn string `json:"ckn,omitempty"`
-
// Name: User provided name for this pre-shared key.
Name string `json:"name,omitempty"`
-
- // StartTime: User provided timestamp on or after which this key is
- // valid.
+ // StartTime: User provided timestamp on or after which this key is valid.
StartTime string `json:"startTime,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Cak") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Cak") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Cak") 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. "Cak") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectMacsecConfigPreSharedKey) MarshalJSON() ([]byte, error) {
+func (s InterconnectMacsecConfigPreSharedKey) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectMacsecConfigPreSharedKey
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// InterconnectMacsecPreSharedKey: Describes a pre-shared key used to
-// setup MACsec in static connectivity association key (CAK) mode.
+// InterconnectMacsecPreSharedKey: Describes a pre-shared key used to setup
+// MACsec in static connectivity association key (CAK) mode.
type InterconnectMacsecPreSharedKey struct {
// Name: Required. A name for this pre-shared key. The name must be 1-63
- // characters long, and comply with RFC1035. Specifically, the name must
- // be 1-63 characters long and match the regular expression
- // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
- // a lowercase letter, and all following characters must be a dash,
- // lowercase letter, or digit, except the last character, which cannot
- // be a dash.
+ // characters long, and comply with RFC1035. Specifically, the name must be
+ // 1-63 characters long and match the regular expression
+ // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a
+ // lowercase letter, and all following characters must be a dash, lowercase
+ // letter, or digit, except the last character, which cannot be a dash.
Name string `json:"name,omitempty"`
-
- // StartTime: A RFC3339 timestamp on or after which the key is valid.
- // startTime can be in the future. If the keychain has a single key,
- // startTime can be omitted. If the keychain has multiple keys,
- // startTime is mandatory for each key. The start times of keys must be
- // in increasing order. The start times of two consecutive keys must be
- // at least 6 hours apart.
+ // StartTime: A RFC3339 timestamp on or after which the key is valid. startTime
+ // can be in the future. If the keychain has a single key, startTime can be
+ // omitted. If the keychain has multiple keys, startTime is mandatory for each
+ // key. The start times of keys must be in increasing order. The start times of
+ // two consecutive keys must be at least 6 hours apart.
StartTime string `json:"startTime,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Name") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Name") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
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 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. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectMacsecPreSharedKey) MarshalJSON() ([]byte, error) {
+func (s InterconnectMacsecPreSharedKey) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectMacsecPreSharedKey
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// InterconnectOutageNotification: Description of a planned outage on
-// this Interconnect.
+// InterconnectOutageNotification: Description of a planned outage on this
+// Interconnect.
type InterconnectOutageNotification struct {
// AffectedCircuits: If issue_type is IT_PARTIAL_OUTAGE, a list of the
// Google-side circuit IDs that will be affected.
AffectedCircuits []string `json:"affectedCircuits,omitempty"`
-
// Description: A description about the purpose of the outage.
Description string `json:"description,omitempty"`
-
- // EndTime: Scheduled end time for the outage (milliseconds since Unix
- // epoch).
+ // EndTime: Scheduled end time for the outage (milliseconds since Unix epoch).
EndTime int64 `json:"endTime,omitempty,string"`
-
- // IssueType: Form this outage is expected to take, which can take one
- // of the following values: - OUTAGE: The Interconnect may be completely
- // out of service for some or all of the specified window. -
- // PARTIAL_OUTAGE: Some circuits comprising the Interconnect as a whole
- // should remain up, but with reduced bandwidth. Note that the versions
- // of this enum prefixed with "IT_" have been deprecated in favor of the
- // unprefixed values.
+ // IssueType: Form this outage is expected to take, which can take one of the
+ // following values: - OUTAGE: The Interconnect may be completely out of
+ // service for some or all of the specified window. - PARTIAL_OUTAGE: Some
+ // circuits comprising the Interconnect as a whole should remain up, but with
+ // reduced bandwidth. Note that the versions of this enum prefixed with "IT_"
+ // have been deprecated in favor of the unprefixed values.
//
// Possible values:
- // "IT_OUTAGE" - [Deprecated] The Interconnect may be completely out
- // of service for some or all of the specified window.
+ // "IT_OUTAGE" - [Deprecated] The Interconnect may be completely out of
+ // service for some or all of the specified window.
// "IT_PARTIAL_OUTAGE" - [Deprecated] Some circuits comprising the
// Interconnect will be out of service during the expected window. The
- // interconnect as a whole should remain up, albeit with reduced
- // bandwidth.
- // "OUTAGE" - The Interconnect may be completely out of service for
- // some or all of the specified window.
- // "PARTIAL_OUTAGE" - Some circuits comprising the Interconnect will
- // be out of service during the expected window. The interconnect as a
- // whole should remain up, albeit with reduced bandwidth.
+ // interconnect as a whole should remain up, albeit with reduced bandwidth.
+ // "OUTAGE" - The Interconnect may be completely out of service for some or
+ // all of the specified window.
+ // "PARTIAL_OUTAGE" - Some circuits comprising the Interconnect will be out
+ // of service during the expected window. The interconnect as a whole should
+ // remain up, albeit with reduced bandwidth.
IssueType string `json:"issueType,omitempty"`
-
// Name: Unique identifier for this outage notification.
Name string `json:"name,omitempty"`
-
- // Source: The party that generated this notification, which can take
- // the following value: - GOOGLE: this notification as generated by
- // Google. Note that the value of NSRC_GOOGLE has been deprecated in
- // favor of GOOGLE.
+ // Source: The party that generated this notification, which can take the
+ // following value: - GOOGLE: this notification as generated by Google. Note
+ // that the value of NSRC_GOOGLE has been deprecated in favor of GOOGLE.
//
// Possible values:
// "GOOGLE" - This notification was generated by Google.
- // "NSRC_GOOGLE" - [Deprecated] This notification was generated by
- // Google.
+ // "NSRC_GOOGLE" - [Deprecated] This notification was generated by Google.
Source string `json:"source,omitempty"`
-
- // StartTime: Scheduled start time for the outage (milliseconds since
- // Unix epoch).
+ // StartTime: Scheduled start time for the outage (milliseconds since Unix
+ // epoch).
StartTime int64 `json:"startTime,omitempty,string"`
-
- // State: State of this notification, which can take one of the
- // following values: - ACTIVE: This outage notification is active. The
- // event could be in the past, present, or future. See start_time and
- // end_time for scheduling. - CANCELLED: The outage associated with this
- // notification was cancelled before the outage was due to start. -
- // COMPLETED: The outage associated with this notification is complete.
- // Note that the versions of this enum prefixed with "NS_" have been
- // deprecated in favor of the unprefixed values.
- //
- // Possible values:
- // "ACTIVE" - This outage notification is active. The event could be
- // in the future, present, or past. See start_time and end_time for
+ // State: State of this notification, which can take one of the following
+ // values: - ACTIVE: This outage notification is active. The event could be in
+ // the past, present, or future. See start_time and end_time for scheduling. -
+ // CANCELLED: The outage associated with this notification was cancelled before
+ // the outage was due to start. - COMPLETED: The outage associated with this
+ // notification is complete. Note that the versions of this enum prefixed with
+ // "NS_" have been deprecated in favor of the unprefixed values.
+ //
+ // Possible values:
+ // "ACTIVE" - This outage notification is active. The event could be in the
+ // future, present, or past. See start_time and end_time for scheduling.
+ // "CANCELLED" - The outage associated with this notification was cancelled
+ // before the outage was due to start.
+ // "COMPLETED" - The outage associated with this notification is complete.
+ // "NS_ACTIVE" - [Deprecated] This outage notification is active. The event
+ // could be in the future, present, or past. See start_time and end_time for
// scheduling.
- // "CANCELLED" - The outage associated with this notification was
- // cancelled before the outage was due to start.
- // "COMPLETED" - The outage associated with this notification is
- // complete.
- // "NS_ACTIVE" - [Deprecated] This outage notification is active. The
- // event could be in the future, present, or past. See start_time and
- // end_time for scheduling.
- // "NS_CANCELED" - [Deprecated] The outage associated with this
- // notification was canceled before the outage was due to start.
+ // "NS_CANCELED" - [Deprecated] The outage associated with this notification
+ // was canceled before the outage was due to start.
State string `json:"state,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "AffectedCircuits") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "AffectedCircuits") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "AffectedCircuits") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectOutageNotification) MarshalJSON() ([]byte, error) {
+func (s InterconnectOutageNotification) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectOutageNotification
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// InterconnectRemoteLocation: Represents a Cross-Cloud Interconnect
-// Remote Location resource. You can use this resource to find remote
-// location details about an Interconnect attachment (VLAN).
+// InterconnectRemoteLocation: Represents a Cross-Cloud Interconnect Remote
+// Location resource. You can use this resource to find remote location details
+// about an Interconnect attachment (VLAN).
type InterconnectRemoteLocation struct {
- // Address: [Output Only] The postal address of the Point of Presence,
- // each line in the address is separated by a newline character.
+ // Address: [Output Only] The postal address of the Point of Presence, each
+ // line in the address is separated by a newline character.
Address string `json:"address,omitempty"`
-
- // AttachmentConfigurationConstraints: [Output Only] Subset of fields
- // from InterconnectAttachment's |configurationConstraints| field that
- // apply to all attachments for this remote location.
+ // AttachmentConfigurationConstraints: [Output Only] Subset of fields from
+ // InterconnectAttachment's |configurationConstraints| field that apply to all
+ // attachments for this remote location.
AttachmentConfigurationConstraints *InterconnectAttachmentConfigurationConstraints `json:"attachmentConfigurationConstraints,omitempty"`
-
- // City: [Output Only] Metropolitan area designator that indicates which
- // city an interconnect is located. For example: "Chicago, IL",
- // "Amsterdam, Netherlands".
+ // City: [Output Only] Metropolitan area designator that indicates which city
+ // an interconnect is located. For example: "Chicago, IL", "Amsterdam,
+ // Netherlands".
City string `json:"city,omitempty"`
-
// Constraints: [Output Only] Constraints on the parameters for creating
// Cross-Cloud Interconnect and associated InterconnectAttachments.
Constraints *InterconnectRemoteLocationConstraints `json:"constraints,omitempty"`
-
- // Continent: [Output Only] Continent for this location, which can take
- // one of the following values: - AFRICA - ASIA_PAC - EUROPE -
- // NORTH_AMERICA - SOUTH_AMERICA
+ // Continent: [Output Only] Continent for this location, which can take one of
+ // the following values: - AFRICA - ASIA_PAC - EUROPE - NORTH_AMERICA -
+ // SOUTH_AMERICA
//
// Possible values:
// "AFRICA"
@@ -26426,436 +22988,345 @@ type InterconnectRemoteLocation struct {
// "NORTH_AMERICA"
// "SOUTH_AMERICA"
Continent string `json:"continent,omitempty"`
-
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
// Description: [Output Only] An optional description of the resource.
Description string `json:"description,omitempty"`
-
- // FacilityProvider: [Output Only] The name of the provider for this
- // facility (e.g., EQUINIX).
+ // FacilityProvider: [Output Only] The name of the provider for this facility
+ // (e.g., EQUINIX).
FacilityProvider string `json:"facilityProvider,omitempty"`
-
- // FacilityProviderFacilityId: [Output Only] A provider-assigned
- // Identifier for this facility (e.g., Ashburn-DC1).
+ // FacilityProviderFacilityId: [Output Only] A provider-assigned Identifier for
+ // this facility (e.g., Ashburn-DC1).
FacilityProviderFacilityId string `json:"facilityProviderFacilityId,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
// Kind: [Output Only] Type of the resource. Always
// compute#interconnectRemoteLocation for interconnect remote locations.
Kind string `json:"kind,omitempty"`
-
- // Lacp: [Output Only] Link Aggregation Control Protocol (LACP)
- // constraints, which can take one of the following values:
- // LACP_SUPPORTED, LACP_UNSUPPORTED
+ // Lacp: [Output Only] Link Aggregation Control Protocol (LACP) constraints,
+ // which can take one of the following values: LACP_SUPPORTED, LACP_UNSUPPORTED
//
// Possible values:
- // "LACP_SUPPORTED" - LACP_SUPPORTED: LACP is supported, and enabled
- // by default on the Cross-Cloud Interconnect.
- // "LACP_UNSUPPORTED" - LACP_UNSUPPORTED: LACP is not supported and is
- // not be enabled on this port. GetDiagnostics shows
- // bundleAggregationType as "static". GCP does not support LAGs without
- // LACP, so requestedLinkCount must be 1.
+ // "LACP_SUPPORTED" - LACP_SUPPORTED: LACP is supported, and enabled by
+ // default on the Cross-Cloud Interconnect.
+ // "LACP_UNSUPPORTED" - LACP_UNSUPPORTED: LACP is not supported and is not be
+ // enabled on this port. GetDiagnostics shows bundleAggregationType as
+ // "static". GCP does not support LAGs without LACP, so requestedLinkCount must
+ // be 1.
Lacp string `json:"lacp,omitempty"`
-
// MaxLagSize100Gbps: [Output Only] The maximum number of 100 Gbps ports
- // supported in a link aggregation group (LAG). When linkType is 100
- // Gbps, requestedLinkCount cannot exceed max_lag_size_100_gbps.
+ // supported in a link aggregation group (LAG). When linkType is 100 Gbps,
+ // requestedLinkCount cannot exceed max_lag_size_100_gbps.
MaxLagSize100Gbps int64 `json:"maxLagSize100Gbps,omitempty"`
-
// MaxLagSize10Gbps: [Output Only] The maximum number of 10 Gbps ports
- // supported in a link aggregation group (LAG). When linkType is 10
- // Gbps, requestedLinkCount cannot exceed max_lag_size_10_gbps.
+ // supported in a link aggregation group (LAG). When linkType is 10 Gbps,
+ // requestedLinkCount cannot exceed max_lag_size_10_gbps.
MaxLagSize10Gbps int64 `json:"maxLagSize10Gbps,omitempty"`
-
// Name: [Output Only] Name of the resource.
Name string `json:"name,omitempty"`
-
// PeeringdbFacilityId: [Output Only] The peeringdb identifier for this
// facility (corresponding with a netfac type in peeringdb).
PeeringdbFacilityId string `json:"peeringdbFacilityId,omitempty"`
-
// PermittedConnections: [Output Only] Permitted connections.
PermittedConnections []*InterconnectRemoteLocationPermittedConnections `json:"permittedConnections,omitempty"`
-
- // RemoteService: [Output Only] Indicates the service provider present
- // at the remote location. Example values: "Amazon Web Services",
- // "Microsoft Azure".
+ // RemoteService: [Output Only] Indicates the service provider present at the
+ // remote location. Example values: "Amazon Web Services", "Microsoft Azure".
RemoteService string `json:"remoteService,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // Status: [Output Only] The status of this InterconnectRemoteLocation,
- // which can take one of the following values: - CLOSED: The
- // InterconnectRemoteLocation is closed and is unavailable for
- // provisioning new Cross-Cloud Interconnects. - AVAILABLE: The
- // InterconnectRemoteLocation is available for provisioning new
- // Cross-Cloud Interconnects.
+ // Status: [Output Only] The status of this InterconnectRemoteLocation, which
+ // can take one of the following values: - CLOSED: The
+ // InterconnectRemoteLocation is closed and is unavailable for provisioning new
+ // Cross-Cloud Interconnects. - AVAILABLE: The InterconnectRemoteLocation is
+ // available for provisioning new Cross-Cloud Interconnects.
//
// Possible values:
- // "AVAILABLE" - The InterconnectRemoteLocation is available for
- // provisioning new Cross-Cloud Interconnects.
- // "CLOSED" - The InterconnectRemoteLocation is closed for
- // provisioning new Cross-Cloud Interconnects.
+ // "AVAILABLE" - The InterconnectRemoteLocation is available for provisioning
+ // new Cross-Cloud Interconnects.
+ // "CLOSED" - The InterconnectRemoteLocation is closed for provisioning new
+ // Cross-Cloud Interconnects.
Status string `json:"status,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Address") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Address") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Address") 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. "Address") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectRemoteLocation) MarshalJSON() ([]byte, error) {
+func (s InterconnectRemoteLocation) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectRemoteLocation
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InterconnectRemoteLocationConstraints struct {
- // PortPairRemoteLocation: [Output Only] Port pair remote location
- // constraints, which can take one of the following values:
- // PORT_PAIR_UNCONSTRAINED_REMOTE_LOCATION,
- // PORT_PAIR_MATCHING_REMOTE_LOCATION. GCP's API refers only to
- // individual ports, but the UI uses this field when ordering a pair of
- // ports, to prevent users from accidentally ordering something that is
- // incompatible with their cloud provider. Specifically, when ordering a
- // redundant pair of Cross-Cloud Interconnect ports, and one of them
- // uses a remote location with portPairMatchingRemoteLocation set to
- // matching, the UI requires that both ports use the same remote
- // location.
+ // PortPairRemoteLocation: [Output Only] Port pair remote location constraints,
+ // which can take one of the following values:
+ // PORT_PAIR_UNCONSTRAINED_REMOTE_LOCATION, PORT_PAIR_MATCHING_REMOTE_LOCATION.
+ // Google Cloud API refers only to individual ports, but the UI uses this field
+ // when ordering a pair of ports, to prevent users from accidentally ordering
+ // something that is incompatible with their cloud provider. Specifically, when
+ // ordering a redundant pair of Cross-Cloud Interconnect ports, and one of them
+ // uses a remote location with portPairMatchingRemoteLocation set to matching,
+ // the UI requires that both ports use the same remote location.
//
// Possible values:
// "PORT_PAIR_MATCHING_REMOTE_LOCATION" - If
- // PORT_PAIR_MATCHING_REMOTE_LOCATION, the remote cloud provider
- // allocates ports in pairs, and the user should choose the same remote
- // location for both ports.
+ // PORT_PAIR_MATCHING_REMOTE_LOCATION, the remote cloud provider allocates
+ // ports in pairs, and the user should choose the same remote location for both
+ // ports.
// "PORT_PAIR_UNCONSTRAINED_REMOTE_LOCATION" - If
- // PORT_PAIR_UNCONSTRAINED_REMOTE_LOCATION, a user may opt to provision
- // a redundant pair of Cross-Cloud Interconnects using two different
- // remote locations in the same city.
+ // PORT_PAIR_UNCONSTRAINED_REMOTE_LOCATION, a user may opt to provision a
+ // redundant pair of Cross-Cloud Interconnects using two different remote
+ // locations in the same city.
PortPairRemoteLocation string `json:"portPairRemoteLocation,omitempty"`
-
- // PortPairVlan: [Output Only] Port pair VLAN constraints, which can
- // take one of the following values: PORT_PAIR_UNCONSTRAINED_VLAN,
+ // PortPairVlan: [Output Only] Port pair VLAN constraints, which can take one
+ // of the following values: PORT_PAIR_UNCONSTRAINED_VLAN,
// PORT_PAIR_MATCHING_VLAN
//
// Possible values:
- // "PORT_PAIR_MATCHING_VLAN" - If PORT_PAIR_MATCHING_VLAN, the
- // Interconnect for this attachment is part of a pair of ports that
- // should have matching VLAN allocations. This occurs with Cross-Cloud
- // Interconnect to Azure remote locations. While GCP's API does not
- // explicitly group pairs of ports, the UI uses this field to ensure
- // matching VLAN ids when configuring a redundant VLAN pair.
- // "PORT_PAIR_UNCONSTRAINED_VLAN" - PORT_PAIR_UNCONSTRAINED_VLAN means
- // there is no constraint.
+ // "PORT_PAIR_MATCHING_VLAN" - If PORT_PAIR_MATCHING_VLAN, the Interconnect
+ // for this attachment is part of a pair of ports that should have matching
+ // VLAN allocations. This occurs with Cross-Cloud Interconnect to Azure remote
+ // locations. While GCP's API does not explicitly group pairs of ports, the UI
+ // uses this field to ensure matching VLAN ids when configuring a redundant
+ // VLAN pair.
+ // "PORT_PAIR_UNCONSTRAINED_VLAN" - PORT_PAIR_UNCONSTRAINED_VLAN means there
+ // is no constraint.
PortPairVlan string `json:"portPairVlan,omitempty"`
-
- // SubnetLengthRange: [Output Only] [min-length, max-length] The minimum
- // and maximum value (inclusive) for the IPv4 subnet length. For
- // example, an interconnectRemoteLocation for Azure has {min: 30, max:
- // 30} because Azure requires /30 subnets. This range specifies the
- // values supported by both cloud providers. Interconnect currently
- // supports /29 and /30 IPv4 subnet lengths. If a remote cloud has no
- // constraint on IPv4 subnet length, the range would thus be {min: 29,
- // max: 30}.
+ // SubnetLengthRange: [Output Only] [min-length, max-length] The minimum and
+ // maximum value (inclusive) for the IPv4 subnet length. For example, an
+ // interconnectRemoteLocation for Azure has {min: 30, max: 30} because Azure
+ // requires /30 subnets. This range specifies the values supported by both
+ // cloud providers. Interconnect currently supports /29 and /30 IPv4 subnet
+ // lengths. If a remote cloud has no constraint on IPv4 subnet length, the
+ // range would thus be {min: 29, max: 30}.
SubnetLengthRange *InterconnectRemoteLocationConstraintsSubnetLengthRange `json:"subnetLengthRange,omitempty"`
-
- // ForceSendFields is a list of field names (e.g.
- // "PortPairRemoteLocation") to unconditionally include in API requests.
- // By default, fields with empty or default 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. "PortPairRemoteLocation")
- // 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.
+ // ForceSendFields is a list of field names (e.g. "PortPairRemoteLocation") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "PortPairRemoteLocation") to
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectRemoteLocationConstraints) MarshalJSON() ([]byte, error) {
+func (s InterconnectRemoteLocationConstraints) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectRemoteLocationConstraints
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InterconnectRemoteLocationConstraintsSubnetLengthRange struct {
Max int64 `json:"max,omitempty"`
-
Min int64 `json:"min,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Max") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Max") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Max") 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. "Max") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectRemoteLocationConstraintsSubnetLengthRange) MarshalJSON() ([]byte, error) {
+func (s InterconnectRemoteLocationConstraintsSubnetLengthRange) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectRemoteLocationConstraintsSubnetLengthRange
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// InterconnectRemoteLocationList: Response to the list request, and
-// contains a list of interconnect remote locations.
+// InterconnectRemoteLocationList: Response to the list request, and contains a
+// list of interconnect remote locations.
type InterconnectRemoteLocationList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of InterconnectRemoteLocation resources.
Items []*InterconnectRemoteLocation `json:"items,omitempty"`
-
// Kind: [Output Only] Type of resource. Always
- // compute#interconnectRemoteLocationList for lists of interconnect
- // remote locations.
+ // compute#interconnectRemoteLocationList for lists of interconnect remote
+ // locations.
Kind string `json:"kind,omitempty"`
-
// NextPageToken: [Output Only] This token lets you get the next page of
// results for list requests. If the number of results is larger than
// maxResults, use the nextPageToken as a value for the query parameter
- // pageToken in the next list request. Subsequent list requests will
- // have their own nextPageToken to continue paging through the results.
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *InterconnectRemoteLocationListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectRemoteLocationList) MarshalJSON() ([]byte, error) {
+func (s InterconnectRemoteLocationList) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectRemoteLocationList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// InterconnectRemoteLocationListWarning: [Output Only] Informational
-// warning message.
+// InterconnectRemoteLocationListWarning: [Output Only] Informational warning
+// message.
type InterconnectRemoteLocationListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*InterconnectRemoteLocationListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectRemoteLocationListWarning) MarshalJSON() ([]byte, error) {
+func (s InterconnectRemoteLocationListWarning) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectRemoteLocationListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InterconnectRemoteLocationListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectRemoteLocationListWarningData) MarshalJSON() ([]byte, error) {
+func (s InterconnectRemoteLocationListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectRemoteLocationListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type InterconnectRemoteLocationPermittedConnections struct {
- // InterconnectLocation: [Output Only] URL of an Interconnect location
- // that is permitted to connect to this Interconnect remote location.
+ // InterconnectLocation: [Output Only] URL of an Interconnect location that is
+ // permitted to connect to this Interconnect remote location.
InterconnectLocation string `json:"interconnectLocation,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "InterconnectLocation") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "InterconnectLocation") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
- // ForceSendFields is a list of field names (e.g.
- // "InterconnectLocation") to unconditionally include in API requests.
- // By default, fields with empty or default 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. "InterconnectLocation") 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 *InterconnectRemoteLocationPermittedConnections) MarshalJSON() ([]byte, error) {
+func (s InterconnectRemoteLocationPermittedConnections) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectRemoteLocationPermittedConnections
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// InterconnectsGetDiagnosticsResponse: Response for the
@@ -26863,954 +23334,607 @@ func (s *InterconnectRemoteLocationPermittedConnections) MarshalJSON() ([]byte,
type InterconnectsGetDiagnosticsResponse struct {
Result *InterconnectDiagnostics `json:"result,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Result") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Result") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Result") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectsGetDiagnosticsResponse) MarshalJSON() ([]byte, error) {
+func (s InterconnectsGetDiagnosticsResponse) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectsGetDiagnosticsResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// InterconnectsGetMacsecConfigResponse: Response for the
// InterconnectsGetMacsecConfigRequest.
type InterconnectsGetMacsecConfigResponse struct {
// Etag: end_interface: MixerGetResponseWithEtagBuilder
- Etag string `json:"etag,omitempty"`
-
+ Etag string `json:"etag,omitempty"`
Result *InterconnectMacsecConfig `json:"result,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Etag") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Etag") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Etag") 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. "Etag") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *InterconnectsGetMacsecConfigResponse) MarshalJSON() ([]byte, error) {
+func (s InterconnectsGetMacsecConfigResponse) MarshalJSON() ([]byte, error) {
type NoMethod InterconnectsGetMacsecConfigResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// License: Represents a License resource. A License represents billing
-// and aggregate usage data for public and marketplace images. *Caution*
-// This resource is intended for use only by third-party partners who
-// are creating Cloud Marketplace images.
+// License: Represents a License resource. A License represents billing and
+// aggregate usage data for public and marketplace images. *Caution* This
+// resource is intended for use only by third-party partners who are creating
+// Cloud Marketplace images.
type License struct {
- // ChargesUseFee: [Output Only] Deprecated. This field no longer
- // reflects whether a license charges a usage fee.
+ // ChargesUseFee: [Output Only] Deprecated. This field no longer reflects
+ // whether a license charges a usage fee.
ChargesUseFee bool `json:"chargesUseFee,omitempty"`
-
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Description: An optional textual description of the resource;
- // provided by the client when the resource is created.
+ // Description: An optional textual description of the resource; provided by
+ // the client when the resource is created.
Description string `json:"description,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
- // Kind: [Output Only] Type of resource. Always compute#license for
- // licenses.
+ // Kind: [Output Only] Type of resource. Always compute#license for licenses.
Kind string `json:"kind,omitempty"`
-
- // LicenseCode: [Output Only] The unique code used to attach this
- // license to images, snapshots, and disks.
+ // LicenseCode: [Output Only] The unique code used to attach this license to
+ // images, snapshots, and disks.
LicenseCode uint64 `json:"licenseCode,omitempty,string"`
-
- // Name: Name of the resource. The name must be 1-63 characters long and
- // comply with RFC1035.
- Name string `json:"name,omitempty"`
-
+ // Name: Name of the resource. The name must be 1-63 characters long and comply
+ // with RFC1035.
+ Name string `json:"name,omitempty"`
ResourceRequirements *LicenseResourceRequirements `json:"resourceRequirements,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // Transferable: If false, licenses will not be copied from the source
- // resource when creating an image from a disk, disk from snapshot, or
- // snapshot from disk.
+ // Transferable: If false, licenses will not be copied from the source resource
+ // when creating an image from a disk, disk from snapshot, or snapshot from
+ // disk.
Transferable bool `json:"transferable,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
// ForceSendFields is a list of field names (e.g. "ChargesUseFee") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "ChargesUseFee") 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. "ChargesUseFee") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *License) MarshalJSON() ([]byte, error) {
+func (s License) MarshalJSON() ([]byte, error) {
type NoMethod License
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// LicenseCode: Represents a License Code resource. A License Code is a
-// unique identifier used to represent a license resource. *Caution*
-// This resource is intended for use only by third-party partners who
-// are creating Cloud Marketplace images.
+// LicenseCode: Represents a License Code resource. A License Code is a unique
+// identifier used to represent a license resource. *Caution* This resource is
+// intended for use only by third-party partners who are creating Cloud
+// Marketplace images.
type LicenseCode struct {
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
// Description: [Output Only] Description of this License Code.
Description string `json:"description,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
// Kind: [Output Only] Type of resource. Always compute#licenseCode for
// licenses.
Kind string `json:"kind,omitempty"`
-
- // LicenseAlias: [Output Only] URL and description aliases of Licenses
- // with the same License Code.
+ // LicenseAlias: [Output Only] URL and description aliases of Licenses with the
+ // same License Code.
LicenseAlias []*LicenseCodeLicenseAlias `json:"licenseAlias,omitempty"`
-
- // Name: [Output Only] Name of the resource. The name is 1-20 characters
- // long and must be a valid 64 bit integer.
+ // Name: [Output Only] Name of the resource. The name is 1-20 characters long
+ // and must be a valid 64 bit integer.
Name string `json:"name,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
// State: [Output Only] Current state of this License Code.
//
// Possible values:
- // "DISABLED" - Machines are not allowed to attach boot disks with
- // this License Code. Requests to create new resources with this license
- // will be rejected.
- // "ENABLED" - Use is allowed for anyone with USE_READ_ONLY access to
- // this License Code.
- // "RESTRICTED" - Use of this license is limited to a project
- // whitelist.
+ // "DISABLED" - Machines are not allowed to attach boot disks with this
+ // License Code. Requests to create new resources with this license will be
+ // rejected.
+ // "ENABLED" - Use is allowed for anyone with USE_READ_ONLY access to this
+ // License Code.
+ // "RESTRICTED" - Use of this license is limited to a project whitelist.
// "STATE_UNSPECIFIED"
// "TERMINATED" - Reserved state.
State string `json:"state,omitempty"`
-
- // Transferable: [Output Only] If true, the license will remain attached
- // when creating images or snapshots from disks. Otherwise, the license
- // is not transferred.
+ // Transferable: [Output Only] If true, the license will remain attached when
+ // creating images or snapshots from disks. Otherwise, the license is not
+ // transferred.
Transferable bool `json:"transferable,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "CreationTimestamp") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CreationTimestamp") 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. "CreationTimestamp") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *LicenseCode) MarshalJSON() ([]byte, error) {
+func (s LicenseCode) MarshalJSON() ([]byte, error) {
type NoMethod LicenseCode
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type LicenseCodeLicenseAlias struct {
// Description: [Output Only] Description of this License Code.
Description string `json:"description,omitempty"`
-
- // SelfLink: [Output Only] URL of license corresponding to this License
- // Code.
+ // SelfLink: [Output Only] URL of license corresponding to this License Code.
SelfLink string `json:"selfLink,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Description") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Description") to include
- // in API requests with the JSON null value. By default, fields with
- // empty values are omitted from API requests. However, any field with
- // an empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields 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. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *LicenseCodeLicenseAlias) MarshalJSON() ([]byte, error) {
+func (s LicenseCodeLicenseAlias) MarshalJSON() ([]byte, error) {
type NoMethod LicenseCodeLicenseAlias
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// LicenseResourceCommitment: Commitment for a particular license
-// resource.
+// LicenseResourceCommitment: Commitment for a particular license resource.
type LicenseResourceCommitment struct {
// Amount: The number of licenses purchased.
Amount int64 `json:"amount,omitempty,string"`
-
- // CoresPerLicense: Specifies the core range of the instance for which
- // this license applies.
+ // CoresPerLicense: Specifies the core range of the instance for which this
+ // license applies.
CoresPerLicense string `json:"coresPerLicense,omitempty"`
-
// License: Any applicable license URI.
License string `json:"license,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Amount") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Amount") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Amount") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *LicenseResourceCommitment) MarshalJSON() ([]byte, error) {
+func (s LicenseResourceCommitment) MarshalJSON() ([]byte, error) {
type NoMethod LicenseResourceCommitment
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type LicenseResourceRequirements struct {
- // MinGuestCpuCount: Minimum number of guest cpus required to use the
- // Instance. Enforced at Instance creation and Instance start.
+ // MinGuestCpuCount: Minimum number of guest cpus required to use the Instance.
+ // Enforced at Instance creation and Instance start.
MinGuestCpuCount int64 `json:"minGuestCpuCount,omitempty"`
-
// MinMemoryMb: Minimum memory required to use the Instance. Enforced at
// Instance creation and Instance start.
MinMemoryMb int64 `json:"minMemoryMb,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "MinGuestCpuCount") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "MinGuestCpuCount") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "MinGuestCpuCount") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *LicenseResourceRequirements) MarshalJSON() ([]byte, error) {
+func (s LicenseResourceRequirements) MarshalJSON() ([]byte, error) {
type NoMethod LicenseResourceRequirements
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type LicensesListResponse struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of License resources.
Items []*License `json:"items,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *LicensesListResponseWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *LicensesListResponse) MarshalJSON() ([]byte, error) {
+func (s LicensesListResponse) MarshalJSON() ([]byte, error) {
type NoMethod LicensesListResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// LicensesListResponseWarning: [Output Only] Informational warning
-// message.
+// LicensesListResponseWarning: [Output Only] Informational warning message.
type LicensesListResponseWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*LicensesListResponseWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *LicensesListResponseWarning) MarshalJSON() ([]byte, error) {
+func (s LicensesListResponseWarning) MarshalJSON() ([]byte, error) {
type NoMethod LicensesListResponseWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type LicensesListResponseWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *LicensesListResponseWarningData) MarshalJSON() ([]byte, error) {
+func (s LicensesListResponseWarningData) MarshalJSON() ([]byte, error) {
type NoMethod LicensesListResponseWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type LocalDisk struct {
// DiskCount: Specifies the number of such disks.
DiskCount int64 `json:"diskCount,omitempty"`
-
// DiskSizeGb: Specifies the size of the disk in base-2 GB.
DiskSizeGb int64 `json:"diskSizeGb,omitempty"`
-
- // DiskType: Specifies the desired disk type on the node. This disk type
- // must be a local storage type (e.g.: local-ssd). Note that for
- // nodeTemplates, this should be the name of the disk type and not its
- // URL.
+ // DiskType: Specifies the desired disk type on the node. This disk type must
+ // be a local storage type (e.g.: local-ssd). Note that for nodeTemplates, this
+ // should be the name of the disk type and not its URL.
DiskType string `json:"diskType,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "DiskCount") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "DiskCount") 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. "DiskCount") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *LocalDisk) MarshalJSON() ([]byte, error) {
+func (s LocalDisk) MarshalJSON() ([]byte, error) {
type NoMethod LocalDisk
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// LocalizedMessage: Provides a localized error message that is safe to
-// return to the user which can be attached to an RPC error.
+// LocalizedMessage: Provides a localized error message that is safe to return
+// to the user which can be attached to an RPC error.
type LocalizedMessage struct {
// Locale: The locale used following the specification defined at
// https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Examples are: "en-US",
// "fr-CH", "es-MX"
Locale string `json:"locale,omitempty"`
-
// Message: The localized error message in the above locale.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Locale") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Locale") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Locale") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *LocalizedMessage) MarshalJSON() ([]byte, error) {
+func (s LocalizedMessage) MarshalJSON() ([]byte, error) {
type NoMethod LocalizedMessage
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// LocationPolicy: Configuration for location policy among multiple
-// possible locations (e.g. preferences for zone selection among zones
-// in a single region).
+// LocationPolicy: Configuration for location policy among multiple possible
+// locations (e.g. preferences for zone selection among zones in a single
+// region).
type LocationPolicy struct {
- // Locations: Location configurations mapped by location name. Currently
- // only zone names are supported and must be represented as valid
- // internal URLs, such as zones/us-central1-a.
+ // Locations: Location configurations mapped by location name. Currently only
+ // zone names are supported and must be represented as valid internal URLs,
+ // such as zones/us-central1-a.
Locations map[string]LocationPolicyLocation `json:"locations,omitempty"`
-
// TargetShape: Strategy for distributing VMs across zones in a region.
//
// Possible values:
- // "ANY" - GCE picks zones for creating VM instances to fulfill the
- // requested number of VMs within present resource constraints and to
- // maximize utilization of unused zonal reservations. Recommended for
- // batch workloads that do not require high availability.
- // "ANY_SINGLE_ZONE" - GCE always selects a single zone for all the
- // VMs, optimizing for resource quotas, available reservations and
- // general capacity. Recommended for batch workloads that cannot
- // tollerate distribution over multiple zones. This the default shape in
- // Bulk Insert and Capacity Advisor APIs.
- // "BALANCED" - GCE prioritizes acquisition of resources, scheduling
- // VMs in zones where resources are available while distributing VMs as
- // evenly as possible across allowed zones to minimize the impact of
- // zonal failure. Recommended for highly available serving workloads.
+ // "ANY" - GCE picks zones for creating VM instances to fulfill the requested
+ // number of VMs within present resource constraints and to maximize
+ // utilization of unused zonal reservations. Recommended for batch workloads
+ // that do not require high availability.
+ // "ANY_SINGLE_ZONE" - GCE always selects a single zone for all the VMs,
+ // optimizing for resource quotas, available reservations and general capacity.
+ // Recommended for batch workloads that cannot tollerate distribution over
+ // multiple zones. This the default shape in Bulk Insert and Capacity Advisor
+ // APIs.
+ // "BALANCED" - GCE prioritizes acquisition of resources, scheduling VMs in
+ // zones where resources are available while distributing VMs as evenly as
+ // possible across allowed zones to minimize the impact of zonal failure.
+ // Recommended for highly available serving workloads.
TargetShape string `json:"targetShape,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Locations") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Locations") 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. "Locations") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *LocationPolicy) MarshalJSON() ([]byte, error) {
+func (s LocationPolicy) MarshalJSON() ([]byte, error) {
type NoMethod LocationPolicy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type LocationPolicyLocation struct {
- // Constraints: Constraints that the caller requires on the result
- // distribution in this zone.
+ // Constraints: Constraints that the caller requires on the result distribution
+ // in this zone.
Constraints *LocationPolicyLocationConstraints `json:"constraints,omitempty"`
-
- // Preference: Preference for a given location. Set to either ALLOW or
- // DENY.
+ // Preference: Preference for a given location. Set to either ALLOW or DENY.
//
// Possible values:
// "ALLOW" - Location is allowed for use.
// "DENY" - Location is prohibited.
// "PREFERENCE_UNSPECIFIED" - Default value, unused.
Preference string `json:"preference,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Constraints") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Constraints") 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. "Constraints") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *LocationPolicyLocation) MarshalJSON() ([]byte, error) {
+func (s LocationPolicyLocation) MarshalJSON() ([]byte, error) {
type NoMethod LocationPolicyLocation
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// LocationPolicyLocationConstraints: Per-zone constraints on location
-// policy for this zone.
+// LocationPolicyLocationConstraints: Per-zone constraints on location policy
+// for this zone.
type LocationPolicyLocationConstraints struct {
- // MaxCount: Maximum number of items that are allowed to be placed in
- // this zone. The value must be non-negative.
+ // MaxCount: Maximum number of items that are allowed to be placed in this
+ // zone. The value must be non-negative.
MaxCount int64 `json:"maxCount,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "MaxCount") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "MaxCount") 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. "MaxCount") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *LocationPolicyLocationConstraints) MarshalJSON() ([]byte, error) {
+func (s LocationPolicyLocationConstraints) MarshalJSON() ([]byte, error) {
type NoMethod LocationPolicyLocationConstraints
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// LogConfig: This is deprecated and has no effect. Do not use.
-type LogConfig struct {
- // CloudAudit: This is deprecated and has no effect. Do not use.
- CloudAudit *LogConfigCloudAuditOptions `json:"cloudAudit,omitempty"`
-
- // Counter: This is deprecated and has no effect. Do not use.
- Counter *LogConfigCounterOptions `json:"counter,omitempty"`
-
- // DataAccess: This is deprecated and has no effect. Do not use.
- DataAccess *LogConfigDataAccessOptions `json:"dataAccess,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "CloudAudit") to
- // unconditionally include in API requests. By default, fields with
- // empty or default values are omitted from API requests. However, any
- // non-pointer, non-interface field appearing in ForceSendFields will be
- // sent to the server regardless of whether the field is empty or not.
- // This may be used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CloudAudit") to include in
- // API requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
-}
-
-func (s *LogConfig) MarshalJSON() ([]byte, error) {
- type NoMethod LogConfig
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// LogConfigCloudAuditOptions: This is deprecated and has no effect. Do
-// not use.
-type LogConfigCloudAuditOptions struct {
- // AuthorizationLoggingOptions: This is deprecated and has no effect. Do
- // not use.
- AuthorizationLoggingOptions *AuthorizationLoggingOptions `json:"authorizationLoggingOptions,omitempty"`
-
- // LogName: This is deprecated and has no effect. Do not use.
- //
- // Possible values:
- // "ADMIN_ACTIVITY" - This is deprecated and has no effect. Do not
- // use.
- // "DATA_ACCESS" - This is deprecated and has no effect. Do not use.
- // "UNSPECIFIED_LOG_NAME" - This is deprecated and has no effect. Do
- // not use.
- LogName string `json:"logName,omitempty"`
-
- // ForceSendFields is a list of field names (e.g.
- // "AuthorizationLoggingOptions") to unconditionally include in API
- // requests. By default, fields with empty or default 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.
- // "AuthorizationLoggingOptions") 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 *LogConfigCloudAuditOptions) MarshalJSON() ([]byte, error) {
- type NoMethod LogConfigCloudAuditOptions
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// LogConfigCounterOptions: This is deprecated and has no effect. Do not
-// use.
-type LogConfigCounterOptions struct {
- // CustomFields: This is deprecated and has no effect. Do not use.
- CustomFields []*LogConfigCounterOptionsCustomField `json:"customFields,omitempty"`
-
- // Field: This is deprecated and has no effect. Do not use.
- Field string `json:"field,omitempty"`
-
- // Metric: This is deprecated and has no effect. Do not use.
- Metric string `json:"metric,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "CustomFields") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "CustomFields") 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 *LogConfigCounterOptions) MarshalJSON() ([]byte, error) {
- type NoMethod LogConfigCounterOptions
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// LogConfigCounterOptionsCustomField: This is deprecated and has no
-// effect. Do not use.
-type LogConfigCounterOptionsCustomField struct {
- // Name: This is deprecated and has no effect. Do not use.
- Name string `json:"name,omitempty"`
-
- // Value: This is deprecated and has no effect. Do not use.
- Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Name") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 *LogConfigCounterOptionsCustomField) MarshalJSON() ([]byte, error) {
- type NoMethod LogConfigCounterOptionsCustomField
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// LogConfigDataAccessOptions: This is deprecated and has no effect. Do
-// not use.
-type LogConfigDataAccessOptions struct {
- // LogMode: This is deprecated and has no effect. Do not use.
- //
- // Possible values:
- // "LOG_FAIL_CLOSED" - This is deprecated and has no effect. Do not
- // use.
- // "LOG_MODE_UNSPECIFIED" - This is deprecated and has no effect. Do
- // not use.
- LogMode string `json:"logMode,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "LogMode") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "LogMode") 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 *LogConfigDataAccessOptions) MarshalJSON() ([]byte, error) {
- type NoMethod LogConfigDataAccessOptions
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// MachineImage: Represents a machine image resource. A machine image is
-// a Compute Engine resource that stores all the configuration,
-// metadata, permissions, and data from one or more disks required to
-// create a Virtual machine (VM) instance. For more information, see
-// Machine images.
+// MachineImage: Represents a machine image resource. A machine image is a
+// Compute Engine resource that stores all the configuration, metadata,
+// permissions, and data from one or more disks required to create a Virtual
+// machine (VM) instance. For more information, see Machine images.
type MachineImage struct {
- // CreationTimestamp: [Output Only] The creation timestamp for this
- // machine image in RFC3339 text format.
+ // CreationTimestamp: [Output Only] The creation timestamp for this machine
+ // image in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
// GuestFlush: [Input Only] Whether to attempt an application consistent
- // machine image by informing the OS to prepare for the snapshot
- // process.
+ // machine image by informing the OS to prepare for the snapshot process.
GuestFlush bool `json:"guestFlush,omitempty"`
-
- // Id: [Output Only] A unique identifier for this machine image. The
- // server defines this identifier.
+ // Id: [Output Only] A unique identifier for this machine image. The server
+ // defines this identifier.
Id uint64 `json:"id,omitempty,string"`
-
// InstanceProperties: [Output Only] Properties of source instance
InstanceProperties *InstanceProperties `json:"instanceProperties,omitempty"`
-
- // Kind: [Output Only] The resource type, which is always
- // compute#machineImage for machine image.
+ // Kind: [Output Only] The resource type, which is always compute#machineImage
+ // for machine image.
Kind string `json:"kind,omitempty"`
-
// MachineImageEncryptionKey: Encrypts the machine image using a
- // customer-supplied encryption key. After you encrypt a machine image
- // using a customer-supplied key, you must provide the same key if you
- // use the machine image later. For example, you must provide the
- // encryption key when you create an instance from the encrypted machine
- // image in a future request. Customer-supplied encryption keys do not
- // protect access to metadata of the machine image. If you do not
- // provide an encryption key when creating the machine image, then the
- // machine image will be encrypted using an automatically generated key
- // and you do not need to provide a key to use the machine image later.
+ // customer-supplied encryption key. After you encrypt a machine image using a
+ // customer-supplied key, you must provide the same key if you use the machine
+ // image later. For example, you must provide the encryption key when you
+ // create an instance from the encrypted machine image in a future request.
+ // Customer-supplied encryption keys do not protect access to metadata of the
+ // machine image. If you do not provide an encryption key when creating the
+ // machine image, then the machine image will be encrypted using an
+ // automatically generated key and you do not need to provide a key to use the
+ // machine image later.
MachineImageEncryptionKey *CustomerEncryptionKey `json:"machineImageEncryptionKey,omitempty"`
-
- // Name: Name of the resource; provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
- // the first character must be a lowercase letter, and all following
- // characters must be a dash, lowercase letter, or digit, except the
- // last character, which cannot be a dash.
+ // Name: Name of the resource; provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must
+ // be a lowercase letter, and all following characters must be a dash,
+ // lowercase letter, or digit, except the last character, which cannot be a
+ // dash.
Name string `json:"name,omitempty"`
-
// SatisfiesPzi: Output only. Reserved for future use.
SatisfiesPzi bool `json:"satisfiesPzi,omitempty"`
-
// SatisfiesPzs: [Output Only] Reserved for future use.
SatisfiesPzs bool `json:"satisfiesPzs,omitempty"`
-
- // SavedDisks: An array of Machine Image specific properties for disks
- // attached to the source instance
+ // SavedDisks: An array of Machine Image specific properties for disks attached
+ // to the source instance
SavedDisks []*SavedDisk `json:"savedDisks,omitempty"`
-
- // SelfLink: [Output Only] The URL for this machine image. The server
- // defines this URL.
+ // SelfLink: [Output Only] The URL for this machine image. The server defines
+ // this URL.
SelfLink string `json:"selfLink,omitempty"`
-
- // SourceDiskEncryptionKeys: [Input Only] The customer-supplied
- // encryption key of the disks attached to the source instance. Required
- // if the source disk is protected by a customer-supplied encryption
- // key.
+ // SourceDiskEncryptionKeys: [Input Only] The customer-supplied encryption key
+ // of the disks attached to the source instance. Required if the source disk is
+ // protected by a customer-supplied encryption key.
SourceDiskEncryptionKeys []*SourceDiskEncryptionKey `json:"sourceDiskEncryptionKeys,omitempty"`
-
- // SourceInstance: The source instance used to create the machine image.
- // You can provide this as a partial or full URL to the resource. For
- // example, the following are valid values: -
+ // SourceInstance: The source instance used to create the machine image. You
+ // can provide this as a partial or full URL to the resource. For example, the
+ // following are valid values: -
// https://www.googleapis.com/compute/v1/projects/project/zones/zone
// /instances/instance - projects/project/zones/zone/instances/instance
SourceInstance string `json:"sourceInstance,omitempty"`
-
// SourceInstanceProperties: [Output Only] DEPRECATED: Please use
- // instance_properties instead for source instance related properties.
- // New properties will not be added to this field.
+ // instance_properties instead for source instance related properties. New
+ // properties will not be added to this field.
SourceInstanceProperties *SourceInstanceProperties `json:"sourceInstanceProperties,omitempty"`
-
- // Status: [Output Only] The status of the machine image. One of the
- // following values: INVALID, CREATING, READY, DELETING, and UPLOADING.
+ // Status: [Output Only] The status of the machine image. One of the following
+ // values: INVALID, CREATING, READY, DELETING, and UPLOADING.
//
// Possible values:
// "CREATING"
@@ -27819,1405 +23943,1143 @@ type MachineImage struct {
// "READY"
// "UPLOADING"
Status string `json:"status,omitempty"`
-
// StorageLocations: The regional or multi-regional Cloud Storage bucket
// location where the machine image is stored.
StorageLocations []string `json:"storageLocations,omitempty"`
-
- // TotalStorageBytes: [Output Only] Total size of the storage used by
- // the machine image.
+ // TotalStorageBytes: [Output Only] Total size of the storage used by the
+ // machine image.
TotalStorageBytes int64 `json:"totalStorageBytes,omitempty,string"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "CreationTimestamp") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CreationTimestamp") 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. "CreationTimestamp") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *MachineImage) MarshalJSON() ([]byte, error) {
+func (s MachineImage) MarshalJSON() ([]byte, error) {
type NoMethod MachineImage
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// MachineImageList: A list of machine images.
type MachineImageList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of MachineImage resources.
Items []*MachineImage `json:"items,omitempty"`
-
// Kind: [Output Only] The resource type, which is always
// compute#machineImagesListResponse for machine image lists.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *MachineImageListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *MachineImageList) MarshalJSON() ([]byte, error) {
+func (s MachineImageList) MarshalJSON() ([]byte, error) {
type NoMethod MachineImageList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// MachineImageListWarning: [Output Only] Informational warning message.
type MachineImageListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*MachineImageListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *MachineImageListWarning) MarshalJSON() ([]byte, error) {
+func (s MachineImageListWarning) MarshalJSON() ([]byte, error) {
type NoMethod MachineImageListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type MachineImageListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *MachineImageListWarningData) MarshalJSON() ([]byte, error) {
+func (s MachineImageListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod MachineImageListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// MachineType: Represents a Machine Type resource. You can use specific
// machine types for your VM instances based on performance and pricing
// requirements. For more information, read Machine Types.
type MachineType struct {
- // Accelerators: [Output Only] A list of accelerator configurations
- // assigned to this machine type.
+ // Accelerators: [Output Only] A list of accelerator configurations assigned to
+ // this machine type.
Accelerators []*MachineTypeAccelerators `json:"accelerators,omitempty"`
-
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // Architecture: [Output Only] The architecture of the machine type.
+ //
+ // Possible values:
+ // "ARCHITECTURE_UNSPECIFIED" - Default value indicating Architecture is not
+ // set.
+ // "ARM64" - Machines with architecture ARM64
+ // "X86_64" - Machines with architecture X86_64
+ Architecture string `json:"architecture,omitempty"`
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Deprecated -- [Output Only] The deprecation status associated with
- // this machine type. Only applicable if the machine type is
- // unavailable.
+ // Deprecated -- [Output Only] The deprecation status associated with this
+ // machine type. Only applicable if the machine type is unavailable.
Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
-
- // Description: [Output Only] An optional textual description of the
- // resource.
+ // Description: [Output Only] An optional textual description of the resource.
Description string `json:"description,omitempty"`
-
- // GuestCpus: [Output Only] The number of virtual CPUs that are
- // available to the instance.
+ // GuestCpus: [Output Only] The number of virtual CPUs that are available to
+ // the instance.
GuestCpus int64 `json:"guestCpus,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
- // ImageSpaceGb: [Deprecated] This property is deprecated and will never
- // be populated with any relevant values.
+ // ImageSpaceGb: [Deprecated] This property is deprecated and will never be
+ // populated with any relevant values.
ImageSpaceGb int64 `json:"imageSpaceGb,omitempty"`
-
- // IsSharedCpu: [Output Only] Whether this machine type has a shared
- // CPU. See Shared-core machine types for more information.
+ // IsSharedCpu: [Output Only] Whether this machine type has a shared CPU. See
+ // Shared-core machine types for more information.
IsSharedCpu bool `json:"isSharedCpu,omitempty"`
-
- // Kind: [Output Only] The type of the resource. Always
- // compute#machineType for machine types.
+ // Kind: [Output Only] The type of the resource. Always compute#machineType for
+ // machine types.
Kind string `json:"kind,omitempty"`
-
- // MaximumPersistentDisks: [Output Only] Maximum persistent disks
- // allowed.
+ // MaximumPersistentDisks: [Output Only] Maximum persistent disks allowed.
MaximumPersistentDisks int64 `json:"maximumPersistentDisks,omitempty"`
-
- // MaximumPersistentDisksSizeGb: [Output Only] Maximum total persistent
- // disks size (GB) allowed.
+ // MaximumPersistentDisksSizeGb: [Output Only] Maximum total persistent disks
+ // size (GB) allowed.
MaximumPersistentDisksSizeGb int64 `json:"maximumPersistentDisksSizeGb,omitempty,string"`
-
- // MemoryMb: [Output Only] The amount of physical memory available to
- // the instance, defined in MB.
+ // MemoryMb: [Output Only] The amount of physical memory available to the
+ // instance, defined in MB.
MemoryMb int64 `json:"memoryMb,omitempty"`
-
// Name: [Output Only] Name of the resource.
Name string `json:"name,omitempty"`
-
- // ScratchDisks: [Output Only] A list of extended scratch disks assigned
- // to the instance.
+ // ScratchDisks: [Output Only] A list of extended scratch disks assigned to the
+ // instance.
ScratchDisks []*MachineTypeScratchDisks `json:"scratchDisks,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // Zone: [Output Only] The name of the zone where the machine type
- // resides, such as us-central1-a.
+ // Zone: [Output Only] The name of the zone where the machine type resides,
+ // such as us-central1-a.
Zone string `json:"zone,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
// ForceSendFields is a list of field names (e.g. "Accelerators") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Accelerators") 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. "Accelerators") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *MachineType) MarshalJSON() ([]byte, error) {
+func (s MachineType) MarshalJSON() ([]byte, error) {
type NoMethod MachineType
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type MachineTypeAccelerators struct {
- // GuestAcceleratorCount: Number of accelerator cards exposed to the
- // guest.
+ // GuestAcceleratorCount: Number of accelerator cards exposed to the guest.
GuestAcceleratorCount int64 `json:"guestAcceleratorCount,omitempty"`
-
- // GuestAcceleratorType: The accelerator type resource name, not a full
- // URL, e.g. nvidia-tesla-t4.
+ // GuestAcceleratorType: The accelerator type resource name, not a full URL,
+ // e.g. nvidia-tesla-t4.
GuestAcceleratorType string `json:"guestAcceleratorType,omitempty"`
-
- // ForceSendFields is a list of field names (e.g.
- // "GuestAcceleratorCount") to unconditionally include in API requests.
- // By default, fields with empty or default 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 is a list of field names (e.g. "GuestAcceleratorCount") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "GuestAcceleratorCount") 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.
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *MachineTypeAccelerators) MarshalJSON() ([]byte, error) {
+func (s MachineTypeAccelerators) MarshalJSON() ([]byte, error) {
type NoMethod MachineTypeAccelerators
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type MachineTypeScratchDisks struct {
// DiskGb: Size of the scratch disk, defined in GB.
DiskGb int64 `json:"diskGb,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "DiskGb") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "DiskGb") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "DiskGb") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *MachineTypeScratchDisks) MarshalJSON() ([]byte, error) {
+func (s MachineTypeScratchDisks) MarshalJSON() ([]byte, error) {
type NoMethod MachineTypeScratchDisks
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type MachineTypeAggregatedList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of MachineTypesScopedList resources.
Items map[string]MachineTypesScopedList `json:"items,omitempty"`
-
// Kind: [Output Only] Type of resource. Always
- // compute#machineTypeAggregatedList for aggregated lists of machine
- // types.
+ // compute#machineTypeAggregatedList for aggregated lists of machine types.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Unreachables: [Output Only] Unreachable resources.
Unreachables []string `json:"unreachables,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *MachineTypeAggregatedListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *MachineTypeAggregatedList) MarshalJSON() ([]byte, error) {
+func (s MachineTypeAggregatedList) MarshalJSON() ([]byte, error) {
type NoMethod MachineTypeAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// MachineTypeAggregatedListWarning: [Output Only] Informational warning
// message.
type MachineTypeAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*MachineTypeAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *MachineTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
+func (s MachineTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod MachineTypeAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type MachineTypeAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *MachineTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+func (s MachineTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod MachineTypeAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// MachineTypeList: Contains a list of machine types.
type MachineTypeList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of MachineType resources.
Items []*MachineType `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource. Always compute#machineTypeList
- // for lists of machine types.
+ // Kind: [Output Only] Type of resource. Always compute#machineTypeList for
+ // lists of machine types.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *MachineTypeListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *MachineTypeList) MarshalJSON() ([]byte, error) {
+func (s MachineTypeList) MarshalJSON() ([]byte, error) {
type NoMethod MachineTypeList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// MachineTypeListWarning: [Output Only] Informational warning message.
type MachineTypeListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*MachineTypeListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *MachineTypeListWarning) MarshalJSON() ([]byte, error) {
+func (s MachineTypeListWarning) MarshalJSON() ([]byte, error) {
type NoMethod MachineTypeListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type MachineTypeListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *MachineTypeListWarningData) MarshalJSON() ([]byte, error) {
+func (s MachineTypeListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod MachineTypeListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type MachineTypesScopedList struct {
- // MachineTypes: [Output Only] A list of machine types contained in this
- // scope.
+ // MachineTypes: [Output Only] A list of machine types contained in this scope.
MachineTypes []*MachineType `json:"machineTypes,omitempty"`
-
// Warning: [Output Only] An informational warning that appears when the
// machine types list is empty.
Warning *MachineTypesScopedListWarning `json:"warning,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "MachineTypes") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "MachineTypes") 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. "MachineTypes") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *MachineTypesScopedList) MarshalJSON() ([]byte, error) {
+func (s MachineTypesScopedList) MarshalJSON() ([]byte, error) {
type NoMethod MachineTypesScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// MachineTypesScopedListWarning: [Output Only] An informational warning
-// that appears when the machine types list is empty.
+// MachineTypesScopedListWarning: [Output Only] An informational warning that
+// appears when the machine types list is empty.
type MachineTypesScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*MachineTypesScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *MachineTypesScopedListWarning) MarshalJSON() ([]byte, error) {
+func (s MachineTypesScopedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod MachineTypesScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type MachineTypesScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *MachineTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
+func (s MachineTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod MachineTypesScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// ManagedInstance: A Managed Instance resource.
type ManagedInstance struct {
- // CurrentAction: [Output Only] The current action that the managed
- // instance group has scheduled for the instance. Possible values: -
- // NONE The instance is running, and the managed instance group does not
- // have any scheduled actions for this instance. - CREATING The managed
- // instance group is creating this instance. If the group fails to
- // create this instance, it will try again until it is successful. -
- // CREATING_WITHOUT_RETRIES The managed instance group is attempting to
- // create this instance only once. If the group fails to create this
- // instance, it does not try again and the group's targetSize value is
- // decreased instead. - RECREATING The managed instance group is
- // recreating this instance. - DELETING The managed instance group is
- // permanently deleting this instance. - ABANDONING The managed instance
- // group is abandoning this instance. The instance will be removed from
- // the instance group and from any target pools that are associated with
- // this group. - RESTARTING The managed instance group is restarting the
- // instance. - REFRESHING The managed instance group is applying
- // configuration changes to the instance without stopping it. For
- // example, the group can update the target pool list for an instance
- // without stopping that instance. - VERIFYING The managed instance
- // group has created the instance and it is in the process of being
- // verified.
- //
- // Possible values:
- // "ABANDONING" - The managed instance group is abandoning this
- // instance. The instance will be removed from the instance group and
- // from any target pools that are associated with this group.
- // "CREATING" - The managed instance group is creating this instance.
- // If the group fails to create this instance, it will try again until
- // it is successful.
- // "CREATING_WITHOUT_RETRIES" - The managed instance group is
- // attempting to create this instance only once. If the group fails to
- // create this instance, it does not try again and the group's
- // targetSize value is decreased.
- // "DELETING" - The managed instance group is permanently deleting
- // this instance.
- // "NONE" - The managed instance group has not scheduled any actions
- // for this instance.
- // "RECREATING" - The managed instance group is recreating this
- // instance.
- // "REFRESHING" - The managed instance group is applying configuration
- // changes to the instance without stopping it. For example, the group
- // can update the target pool list for an instance without stopping that
+ // CurrentAction: [Output Only] The current action that the managed instance
+ // group has scheduled for the instance. Possible values: - NONE The instance
+ // is running, and the managed instance group does not have any scheduled
+ // actions for this instance. - CREATING The managed instance group is creating
+ // this instance. If the group fails to create this instance, it will try again
+ // until it is successful. - CREATING_WITHOUT_RETRIES The managed instance
+ // group is attempting to create this instance only once. If the group fails to
+ // create this instance, it does not try again and the group's targetSize value
+ // is decreased instead. - RECREATING The managed instance group is recreating
+ // this instance. - DELETING The managed instance group is permanently deleting
+ // this instance. - ABANDONING The managed instance group is abandoning this
+ // instance. The instance will be removed from the instance group and from any
+ // target pools that are associated with this group. - RESTARTING The managed
+ // instance group is restarting the instance. - REFRESHING The managed instance
+ // group is applying configuration changes to the instance without stopping it.
+ // For example, the group can update the target pool list for an instance
+ // without stopping that instance. - VERIFYING The managed instance group has
+ // created the instance and it is in the process of being verified.
+ //
+ // Possible values:
+ // "ABANDONING" - The managed instance group is abandoning this instance. The
+ // instance will be removed from the instance group and from any target pools
+ // that are associated with this group.
+ // "CREATING" - The managed instance group is creating this instance. If the
+ // group fails to create this instance, it will try again until it is
+ // successful.
+ // "CREATING_WITHOUT_RETRIES" - The managed instance group is attempting to
+ // create this instance only once. If the group fails to create this instance,
+ // it does not try again and the group's targetSize value is decreased.
+ // "DELETING" - The managed instance group is permanently deleting this
// instance.
- // "RESTARTING" - The managed instance group is restarting this
+ // "NONE" - The managed instance group has not scheduled any actions for this
// instance.
+ // "RECREATING" - The managed instance group is recreating this instance.
+ // "REFRESHING" - The managed instance group is applying configuration
+ // changes to the instance without stopping it. For example, the group can
+ // update the target pool list for an instance without stopping that instance.
+ // "RESTARTING" - The managed instance group is restarting this instance.
// "RESUMING" - The managed instance group is resuming this instance.
// "STARTING" - The managed instance group is starting this instance.
// "STOPPING" - The managed instance group is stopping this instance.
- // "SUSPENDING" - The managed instance group is suspending this
- // instance.
- // "VERIFYING" - The managed instance group is verifying this already
- // created instance. Verification happens every time the instance is
- // (re)created or restarted and consists of: 1. Waiting until health
- // check specified as part of this managed instance group's autohealing
- // policy reports HEALTHY. Note: Applies only if autohealing policy has
- // a health check specified 2. Waiting for addition verification steps
- // performed as post-instance creation (subject to future extensions).
+ // "SUSPENDING" - The managed instance group is suspending this instance.
+ // "VERIFYING" - The managed instance group is verifying this already created
+ // instance. Verification happens every time the instance is (re)created or
+ // restarted and consists of: 1. Waiting until health check specified as part
+ // of this managed instance group's autohealing policy reports HEALTHY. Note:
+ // Applies only if autohealing policy has a health check specified 2. Waiting
+ // for addition verification steps performed as post-instance creation (subject
+ // to future extensions).
CurrentAction string `json:"currentAction,omitempty"`
-
- // Id: [Output only] The unique identifier for this resource. This field
- // is empty when instance does not exist.
+ // Id: [Output only] The unique identifier for this resource. This field is
+ // empty when instance does not exist.
Id uint64 `json:"id,omitempty,string"`
-
- // Instance: [Output Only] The URL of the instance. The URL can exist
- // even if the instance has not yet been created.
+ // Instance: [Output Only] The URL of the instance. The URL can exist even if
+ // the instance has not yet been created.
Instance string `json:"instance,omitempty"`
-
- // InstanceHealth: [Output Only] Health state of the instance per
- // health-check.
+ // InstanceHealth: [Output Only] Health state of the instance per health-check.
InstanceHealth []*ManagedInstanceInstanceHealth `json:"instanceHealth,omitempty"`
-
- // InstanceStatus: [Output Only] The status of the instance. This field
- // is empty when the instance does not exist.
+ // InstanceStatus: [Output Only] The status of the instance. This field is
+ // empty when the instance does not exist.
//
// Possible values:
- // "DEPROVISIONING" - The instance is halted and we are performing
- // tear down tasks like network deprogramming, releasing quota, IP,
- // tearing down disks etc.
+ // "DEPROVISIONING" - The instance is halted and we are performing tear down
+ // tasks like network deprogramming, releasing quota, IP, tearing down disks
+ // etc.
// "PROVISIONING" - Resources are being allocated for the instance.
// "REPAIRING" - The instance is in repair.
// "RUNNING" - The instance is running.
- // "STAGING" - All required resources have been allocated and the
- // instance is being started.
+ // "STAGING" - All required resources have been allocated and the instance is
+ // being started.
// "STOPPED" - The instance has stopped successfully.
- // "STOPPING" - The instance is currently stopping (either being
- // deleted or killed).
+ // "STOPPING" - The instance is currently stopping (either being deleted or
+ // killed).
// "SUSPENDED" - The instance has suspended.
// "SUSPENDING" - The instance is suspending.
- // "TERMINATED" - The instance has stopped (either by explicit action
- // or underlying failure).
+ // "TERMINATED" - The instance has stopped (either by explicit action or
+ // underlying failure).
InstanceStatus string `json:"instanceStatus,omitempty"`
-
- // LastAttempt: [Output Only] Information about the last attempt to
- // create or delete the instance.
+ // LastAttempt: [Output Only] Information about the last attempt to create or
+ // delete the instance.
LastAttempt *ManagedInstanceLastAttempt `json:"lastAttempt,omitempty"`
-
- // Name: [Output Only] The name of the instance. The name always exists
- // even if the instance has not yet been created.
+ // Name: [Output Only] The name of the instance. The name always exists even if
+ // the instance has not yet been created.
Name string `json:"name,omitempty"`
-
// PreservedStateFromConfig: [Output Only] Preserved state applied from
// per-instance config for this instance.
PreservedStateFromConfig *PreservedState `json:"preservedStateFromConfig,omitempty"`
-
- // PreservedStateFromPolicy: [Output Only] Preserved state generated
- // based on stateful policy for this instance.
+ // PreservedStateFromPolicy: [Output Only] Preserved state generated based on
+ // stateful policy for this instance.
PreservedStateFromPolicy *PreservedState `json:"preservedStateFromPolicy,omitempty"`
-
+ // PropertiesFromFlexibilityPolicy: [Output Only] Instance properties selected
+ // for this instance resulting from InstanceFlexibilityPolicy.
+ PropertiesFromFlexibilityPolicy *ManagedInstancePropertiesFromFlexibilityPolicy `json:"propertiesFromFlexibilityPolicy,omitempty"`
// Version: [Output Only] Intended version of this instance.
Version *ManagedInstanceVersion `json:"version,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "CurrentAction") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CurrentAction") 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. "CurrentAction") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ManagedInstance) MarshalJSON() ([]byte, error) {
+func (s ManagedInstance) MarshalJSON() ([]byte, error) {
type NoMethod ManagedInstance
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ManagedInstanceInstanceHealth struct {
- // DetailedHealthState: [Output Only] The current detailed instance
- // health state.
+ // DetailedHealthState: [Output Only] The current detailed instance health
+ // state.
//
// Possible values:
- // "DRAINING" - The instance is being drained. The existing
- // connections to the instance have time to complete, but the new ones
- // are being refused.
- // "HEALTHY" - The instance is reachable i.e. a connection to the
- // application health checking endpoint can be established, and conforms
- // to the requirements defined by the health check.
+ // "DRAINING" - The instance is being drained. The existing connections to
+ // the instance have time to complete, but the new ones are being refused.
+ // "HEALTHY" - The instance is reachable i.e. a connection to the application
+ // health checking endpoint can be established, and conforms to the
+ // requirements defined by the health check.
// "TIMEOUT" - The instance is unreachable i.e. a connection to the
- // application health checking endpoint cannot be established, or the
- // server does not respond within the specified timeout.
- // "UNHEALTHY" - The instance is reachable, but does not conform to
- // the requirements defined by the health check.
- // "UNKNOWN" - The health checking system is aware of the instance but
- // its health is not known at the moment.
+ // application health checking endpoint cannot be established, or the server
+ // does not respond within the specified timeout.
+ // "UNHEALTHY" - The instance is reachable, but does not conform to the
+ // requirements defined by the health check.
+ // "UNKNOWN" - The health checking system is aware of the instance but its
+ // health is not known at the moment.
DetailedHealthState string `json:"detailedHealthState,omitempty"`
-
// HealthCheck: [Output Only] The URL for the health check that verifies
// whether the instance is healthy.
HealthCheck string `json:"healthCheck,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "DetailedHealthState")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "DetailedHealthState") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "DetailedHealthState") 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. "DetailedHealthState") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ManagedInstanceInstanceHealth) MarshalJSON() ([]byte, error) {
+func (s ManagedInstanceInstanceHealth) MarshalJSON() ([]byte, error) {
type NoMethod ManagedInstanceInstanceHealth
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ManagedInstanceLastAttempt struct {
- // Errors: [Output Only] Encountered errors during the last attempt to
- // create or delete the instance.
+ // Errors: [Output Only] Encountered errors during the last attempt to create
+ // or delete the instance.
Errors *ManagedInstanceLastAttemptErrors `json:"errors,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Errors") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Errors") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Errors") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ManagedInstanceLastAttempt) MarshalJSON() ([]byte, error) {
+func (s ManagedInstanceLastAttempt) MarshalJSON() ([]byte, error) {
type NoMethod ManagedInstanceLastAttempt
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// ManagedInstanceLastAttemptErrors: [Output Only] Encountered errors
-// during the last attempt to create or delete the instance.
+// ManagedInstanceLastAttemptErrors: [Output Only] Encountered errors during
+// the last attempt to create or delete the instance.
type ManagedInstanceLastAttemptErrors struct {
- // Errors: [Output Only] The array of errors encountered while
- // processing this operation.
+ // Errors: [Output Only] The array of errors encountered while processing this
+ // operation.
Errors []*ManagedInstanceLastAttemptErrorsErrors `json:"errors,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Errors") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Errors") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Errors") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ManagedInstanceLastAttemptErrors) MarshalJSON() ([]byte, error) {
+func (s ManagedInstanceLastAttemptErrors) MarshalJSON() ([]byte, error) {
type NoMethod ManagedInstanceLastAttemptErrors
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ManagedInstanceLastAttemptErrorsErrors struct {
// Code: [Output Only] The error type identifier for this error.
Code string `json:"code,omitempty"`
-
- // ErrorDetails: [Output Only] An optional list of messages that contain
- // the error details. There is a set of defined message types to use for
- // providing details.The syntax depends on the error code. For example,
- // QuotaExceededInfo will have details when the error code is
- // QUOTA_EXCEEDED.
+ // ErrorDetails: [Output Only] An optional list of messages that contain the
+ // error details. There is a set of defined message types to use for providing
+ // details.The syntax depends on the error code. For example, QuotaExceededInfo
+ // will have details when the error code is QUOTA_EXCEEDED.
ErrorDetails []*ManagedInstanceLastAttemptErrorsErrorsErrorDetails `json:"errorDetails,omitempty"`
-
- // Location: [Output Only] Indicates the field in the request that
- // caused the error. This property is optional.
+ // Location: [Output Only] Indicates the field in the request that caused the
+ // error. This property is optional.
Location string `json:"location,omitempty"`
-
// Message: [Output Only] An optional, human-readable error message.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ManagedInstanceLastAttemptErrorsErrors) MarshalJSON() ([]byte, error) {
+func (s ManagedInstanceLastAttemptErrorsErrors) MarshalJSON() ([]byte, error) {
type NoMethod ManagedInstanceLastAttemptErrorsErrors
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ManagedInstanceLastAttemptErrorsErrorsErrorDetails struct {
- ErrorInfo *ErrorInfo `json:"errorInfo,omitempty"`
-
- Help *Help `json:"help,omitempty"`
-
- LocalizedMessage *LocalizedMessage `json:"localizedMessage,omitempty"`
-
- QuotaInfo *QuotaExceededInfo `json:"quotaInfo,omitempty"`
-
+ ErrorInfo *ErrorInfo `json:"errorInfo,omitempty"`
+ Help *Help `json:"help,omitempty"`
+ LocalizedMessage *LocalizedMessage `json:"localizedMessage,omitempty"`
+ QuotaInfo *QuotaExceededInfo `json:"quotaInfo,omitempty"`
// ForceSendFields is a list of field names (e.g. "ErrorInfo") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "ErrorInfo") 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. "ErrorInfo") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ManagedInstanceLastAttemptErrorsErrorsErrorDetails) MarshalJSON() ([]byte, error) {
+func (s ManagedInstanceLastAttemptErrorsErrorsErrorDetails) MarshalJSON() ([]byte, error) {
type NoMethod ManagedInstanceLastAttemptErrorsErrorsErrorDetails
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+type ManagedInstancePropertiesFromFlexibilityPolicy struct {
+ // MachineType: The machine type to be used for this instance.
+ MachineType string `json:"machineType,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "MachineType") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "MachineType") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s ManagedInstancePropertiesFromFlexibilityPolicy) MarshalJSON() ([]byte, error) {
+ type NoMethod ManagedInstancePropertiesFromFlexibilityPolicy
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ManagedInstanceVersion struct {
- // InstanceTemplate: [Output Only] The intended template of the
- // instance. This field is empty when current_action is one of {
- // DELETING, ABANDONING }.
+ // InstanceTemplate: [Output Only] The intended template of the instance. This
+ // field is empty when current_action is one of { DELETING, ABANDONING }.
InstanceTemplate string `json:"instanceTemplate,omitempty"`
-
// Name: [Output Only] Name of the version.
Name string `json:"name,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "InstanceTemplate") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "InstanceTemplate") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ManagedInstanceVersion) MarshalJSON() ([]byte, error) {
+func (s ManagedInstanceVersion) MarshalJSON() ([]byte, error) {
type NoMethod ManagedInstanceVersion
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// Metadata: A metadata key/value entry.
type Metadata struct {
- // Fingerprint: Specifies a fingerprint for this request, which is
- // essentially a hash of the metadata's contents and used for optimistic
- // locking. The fingerprint is initially generated by Compute Engine and
- // changes after every request to modify or update metadata. You must
- // always provide an up-to-date fingerprint hash in order to update or
- // change metadata, otherwise the request will fail with error 412
- // conditionNotMet. To see the latest fingerprint, make a get() request
- // to retrieve the resource.
+ // Fingerprint: Specifies a fingerprint for this request, which is essentially
+ // a hash of the metadata's contents and used for optimistic locking. The
+ // fingerprint is initially generated by Compute Engine and changes after every
+ // request to modify or update metadata. You must always provide an up-to-date
+ // fingerprint hash in order to update or change metadata, otherwise the
+ // request will fail with error 412 conditionNotMet. To see the latest
+ // fingerprint, make a get() request to retrieve the resource.
Fingerprint string `json:"fingerprint,omitempty"`
-
- // Items: Array of key/value pairs. The total size of all keys and
- // values must be less than 512 KB.
+ // Items: Array of key/value pairs. The total size of all keys and values must
+ // be less than 512 KB.
Items []*MetadataItems `json:"items,omitempty"`
-
// Kind: [Output Only] Type of the resource. Always compute#metadata for
// metadata.
Kind string `json:"kind,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Fingerprint") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Fingerprint") 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. "Fingerprint") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *Metadata) MarshalJSON() ([]byte, error) {
+func (s Metadata) MarshalJSON() ([]byte, error) {
type NoMethod Metadata
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// MetadataItems: Metadata
type MetadataItems struct {
- // Key: Key for the metadata entry. Keys must conform to the following
- // regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is
- // reflected as part of a URL in the metadata server. Additionally, to
- // avoid ambiguity, keys must not conflict with any other metadata keys
- // for the project.
+ // Key: Key for the metadata entry. Keys must conform to the following regexp:
+ // [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is reflected as
+ // part of a URL in the metadata server. Additionally, to avoid ambiguity, keys
+ // must not conflict with any other metadata keys for the project.
Key string `json:"key,omitempty"`
-
- // Value: Value for the metadata entry. These are free-form strings, and
- // only have meaning as interpreted by the image running in the
- // instance. The only restriction placed on values is that their size
- // must be less than or equal to 262144 bytes (256 KiB).
+ // Value: Value for the metadata entry. These are free-form strings, and only
+ // have meaning as interpreted by the image running in the instance. The only
+ // restriction placed on values is that their size must be less than or equal
+ // to 262144 bytes (256 KiB).
Value *string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *MetadataItems) MarshalJSON() ([]byte, error) {
+func (s MetadataItems) MarshalJSON() ([]byte, error) {
type NoMethod MetadataItems
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// MetadataFilter: Opaque filter criteria used by load balancers to
-// restrict routing configuration to a limited set of load balancing
-// proxies. Proxies and sidecars involved in load balancing would
-// typically present metadata to the load balancers that need to match
-// criteria specified here. If a match takes place, the relevant
-// configuration is made available to those proxies. For each
-// metadataFilter in this list, if its filterMatchCriteria is set to
-// MATCH_ANY, at least one of the filterLabels must match the
-// corresponding label provided in the metadata. If its
-// filterMatchCriteria is set to MATCH_ALL, then all of its filterLabels
-// must match with corresponding labels provided in the metadata. An
-// example for using metadataFilters would be: if load balancing
-// involves Envoys, they receive routing configuration when values in
-// metadataFilters match values supplied in of their XDS requests to
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+// MetadataFilter: Opaque filter criteria used by load balancers to restrict
+// routing configuration to a limited set of load balancing proxies. Proxies
+// and sidecars involved in load balancing would typically present metadata to
+// the load balancers that need to match criteria specified here. If a match
+// takes place, the relevant configuration is made available to those proxies.
+// For each metadataFilter in this list, if its filterMatchCriteria is set to
+// MATCH_ANY, at least one of the filterLabels must match the corresponding
+// label provided in the metadata. If its filterMatchCriteria is set to
+// MATCH_ALL, then all of its filterLabels must match with corresponding labels
+// provided in the metadata. An example for using metadataFilters would be: if
+// load balancing involves Envoys, they receive routing configuration when
+// values in metadataFilters match values supplied in of their XDS requests to
// loadbalancers.
type MetadataFilter struct {
- // FilterLabels: The list of label value pairs that must match labels in
- // the provided metadata based on filterMatchCriteria This list must not
- // be empty and can have at the most 64 entries.
+ // FilterLabels: The list of label value pairs that must match labels in the
+ // provided metadata based on filterMatchCriteria This list must not be empty
+ // and can have at the most 64 entries.
FilterLabels []*MetadataFilterLabelMatch `json:"filterLabels,omitempty"`
-
- // FilterMatchCriteria: Specifies how individual filter label matches
- // within the list of filterLabels and contributes toward the overall
- // metadataFilter match. Supported values are: - MATCH_ANY: at least one
- // of the filterLabels must have a matching label in the provided
- // metadata. - MATCH_ALL: all filterLabels must have matching labels in
- // the provided metadata.
+ // FilterMatchCriteria: Specifies how individual filter label matches within
+ // the list of filterLabels and contributes toward the overall metadataFilter
+ // match. Supported values are: - MATCH_ANY: at least one of the filterLabels
+ // must have a matching label in the provided metadata. - MATCH_ALL: all
+ // filterLabels must have matching labels in the provided metadata.
//
// Possible values:
// "MATCH_ALL" - Specifies that all filterLabels must match for the
@@ -29227,128 +25089,100 @@ type MetadataFilter struct {
// "NOT_SET" - Indicates that the match criteria was not set. A
// metadataFilter must never be created with this value.
FilterMatchCriteria string `json:"filterMatchCriteria,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "FilterLabels") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "FilterLabels") 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. "FilterLabels") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *MetadataFilter) MarshalJSON() ([]byte, error) {
+func (s MetadataFilter) MarshalJSON() ([]byte, error) {
type NoMethod MetadataFilter
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// MetadataFilterLabelMatch: MetadataFilter label name value pairs that
-// are expected to match corresponding labels presented as metadata to
-// the load balancer.
+// MetadataFilterLabelMatch: MetadataFilter label name value pairs that are
+// expected to match corresponding labels presented as metadata to the load
+// balancer.
type MetadataFilterLabelMatch struct {
- // Name: Name of metadata label. The name can have a maximum length of
- // 1024 characters and must be at least 1 character long.
+ // Name: Name of metadata label. The name can have a maximum length of 1024
+ // characters and must be at least 1 character long.
Name string `json:"name,omitempty"`
-
- // Value: The value of the label must match the specified value. value
- // can have a maximum length of 1024 characters.
+ // Value: The value of the label must match the specified value. value can have
+ // a maximum length of 1024 characters.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Name") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Name") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
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 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. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *MetadataFilterLabelMatch) MarshalJSON() ([]byte, error) {
+func (s MetadataFilterLabelMatch) MarshalJSON() ([]byte, error) {
type NoMethod MetadataFilterLabelMatch
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// NamedPort: The named port. For example: <"http", 80>.
type NamedPort struct {
- // Name: The name for this named port. The name must be 1-63 characters
- // long, and comply with RFC1035.
+ // Name: The name for this named port. The name must be 1-63 characters long,
+ // and comply with RFC1035.
Name string `json:"name,omitempty"`
-
// Port: The port number, which can be a value between 1 and 65535.
Port int64 `json:"port,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Name") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Name") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
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 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. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NamedPort) MarshalJSON() ([]byte, error) {
+func (s NamedPort) MarshalJSON() ([]byte, error) {
type NoMethod NamedPort
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// NatIpInfo: Contains NAT IP information of a NAT config (i.e. usage
-// status, mode).
+// NatIpInfo: Contains NAT IP information of a NAT config (i.e. usage status,
+// mode).
type NatIpInfo struct {
// NatIpInfoMappings: A list of all NAT IPs assigned to this NAT config.
NatIpInfoMappings []*NatIpInfoNatIpInfoMapping `json:"natIpInfoMappings,omitempty"`
-
// NatName: Name of the NAT config which the NAT IP belongs to.
NatName string `json:"natName,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "NatIpInfoMappings")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "NatIpInfoMappings") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "NatIpInfoMappings") 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. "NatIpInfoMappings") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NatIpInfo) MarshalJSON() ([]byte, error) {
+func (s NatIpInfo) MarshalJSON() ([]byte, error) {
type NoMethod NatIpInfo
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// NatIpInfoNatIpInfoMapping: Contains information of a NAT IP.
@@ -29359,3070 +25193,2468 @@ type NatIpInfoNatIpInfoMapping struct {
// "AUTO"
// "MANUAL"
Mode string `json:"mode,omitempty"`
-
// NatIp: NAT IP address. For example: 203.0.113.11.
NatIp string `json:"natIp,omitempty"`
-
- // Usage: Specifies whether NAT IP is currently serving at least one
- // endpoint or not.
+ // Usage: Specifies whether NAT IP is currently serving at least one endpoint
+ // or not.
//
// Possible values:
// "IN_USE"
// "UNUSED"
Usage string `json:"usage,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Mode") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Mode") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Mode") 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. "Mode") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NatIpInfoNatIpInfoMapping) MarshalJSON() ([]byte, error) {
+func (s NatIpInfoNatIpInfoMapping) MarshalJSON() ([]byte, error) {
type NoMethod NatIpInfoNatIpInfoMapping
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NatIpInfoResponse struct {
// Result: [Output Only] A list of NAT IP information.
Result []*NatIpInfo `json:"result,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Result") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Result") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Result") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NatIpInfoResponse) MarshalJSON() ([]byte, error) {
+func (s NatIpInfoResponse) MarshalJSON() ([]byte, error) {
type NoMethod NatIpInfoResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// Network: Represents a VPC Network resource. Networks connect
-// resources to each other and to the internet. For more information,
-// read Virtual Private Cloud (VPC) Network.
+// Network: Represents a VPC Network resource. Networks connect resources to
+// each other and to the internet. For more information, read Virtual Private
+// Cloud (VPC) Network.
type Network struct {
// IPv4Range: Deprecated in favor of subnet mode networks. The range of
- // internal addresses that are legal on this network. This range is a
- // CIDR specification, for example: 192.168.0.0/16. Provided by the
- // client when the network is created.
+ // internal addresses that are legal on this network. This range is a CIDR
+ // specification, for example: 192.168.0.0/16. Provided by the client when the
+ // network is created.
IPv4Range string `json:"IPv4Range,omitempty"`
-
- // AutoCreateSubnetworks: Must be set to create a VPC network. If not
- // set, a legacy network is created. When set to true, the VPC network
- // is created in auto mode. When set to false, the VPC network is
- // created in custom mode. An auto mode VPC network starts with one
- // subnet per region. Each subnet has a predetermined range as described
- // in Auto mode VPC network IP ranges. For custom mode VPC networks, you
- // can add subnets using the subnetworks insert method.
+ // AutoCreateSubnetworks: Must be set to create a VPC network. If not set, a
+ // legacy network is created. When set to true, the VPC network is created in
+ // auto mode. When set to false, the VPC network is created in custom mode. An
+ // auto mode VPC network starts with one subnet per region. Each subnet has a
+ // predetermined range as described in Auto mode VPC network IP ranges. For
+ // custom mode VPC networks, you can add subnets using the subnetworks insert
+ // method.
AutoCreateSubnetworks bool `json:"autoCreateSubnetworks,omitempty"`
-
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // field when you create the resource.
+ // Description: An optional description of this resource. Provide this field
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // EnableUlaInternalIpv6: Enable ULA internal ipv6 on this network.
- // Enabling this feature will assign a /48 from google defined ULA
- // prefix fd20::/20. .
+ // EnableUlaInternalIpv6: Enable ULA internal ipv6 on this network. Enabling
+ // this feature will assign a /48 from google defined ULA prefix fd20::/20. .
EnableUlaInternalIpv6 bool `json:"enableUlaInternalIpv6,omitempty"`
-
- // FirewallPolicy: [Output Only] URL of the firewall policy the network
- // is associated with.
+ // FirewallPolicy: [Output Only] URL of the firewall policy the network is
+ // associated with.
FirewallPolicy string `json:"firewallPolicy,omitempty"`
-
- // GatewayIPv4: [Output Only] The gateway address for default routing
- // out of the network, selected by Google Cloud.
+ // GatewayIPv4: [Output Only] The gateway address for default routing out of
+ // the network, selected by Google Cloud.
GatewayIPv4 string `json:"gatewayIPv4,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
- // InternalIpv6Range: When enabling ula internal ipv6, caller optionally
- // can specify the /48 range they want from the google defined ULA
- // prefix fd20::/20. The input must be a valid /48 ULA IPv6 address and
- // must be within the fd20::/20. Operation will fail if the speficied
- // /48 is already in used by another resource. If the field is not
- // speficied, then a /48 range will be randomly allocated from fd20::/20
- // and returned via this field. .
+ // InternalIpv6Range: When enabling ula internal ipv6, caller optionally can
+ // specify the /48 range they want from the google defined ULA prefix
+ // fd20::/20. The input must be a valid /48 ULA IPv6 address and must be within
+ // the fd20::/20. Operation will fail if the speficied /48 is already in used
+ // by another resource. If the field is not speficied, then a /48 range will be
+ // randomly allocated from fd20::/20 and returned via this field. .
InternalIpv6Range string `json:"internalIpv6Range,omitempty"`
-
// Kind: [Output Only] Type of the resource. Always compute#network for
// networks.
Kind string `json:"kind,omitempty"`
-
- // Mtu: Maximum Transmission Unit in bytes. The minimum value for this
- // field is 1300 and the maximum value is 8896. The suggested value is
- // 1500, which is the default MTU used on the Internet, or 8896 if you
- // want to use Jumbo frames. If unspecified, the value defaults to 1460.
+ // Mtu: Maximum Transmission Unit in bytes. The minimum value for this field is
+ // 1300 and the maximum value is 8896. The suggested value is 1500, which is
+ // the default MTU used on the Internet, or 8896 if you want to use Jumbo
+ // frames. If unspecified, the value defaults to 1460.
Mtu int64 `json:"mtu,omitempty"`
-
- // Name: Name of the resource. Provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`. The first
- // character must be a lowercase letter, and all following characters
- // (except for the last character) must be a dash, lowercase letter, or
- // digit. The last character must be a lowercase letter or digit.
+ // Name: Name of the resource. Provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?`. The first character must be a
+ // lowercase letter, and all following characters (except for the last
+ // character) must be a dash, lowercase letter, or digit. The last character
+ // must be a lowercase letter or digit.
Name string `json:"name,omitempty"`
-
// NetworkFirewallPolicyEnforcementOrder: The network firewall policy
// enforcement order. Can be either AFTER_CLASSIC_FIREWALL or
- // BEFORE_CLASSIC_FIREWALL. Defaults to AFTER_CLASSIC_FIREWALL if the
- // field is not specified.
+ // BEFORE_CLASSIC_FIREWALL. Defaults to AFTER_CLASSIC_FIREWALL if the field is
+ // not specified.
//
// Possible values:
// "AFTER_CLASSIC_FIREWALL"
// "BEFORE_CLASSIC_FIREWALL"
NetworkFirewallPolicyEnforcementOrder string `json:"networkFirewallPolicyEnforcementOrder,omitempty"`
-
// Peerings: [Output Only] A list of network peerings for the resource.
Peerings []*NetworkPeering `json:"peerings,omitempty"`
-
- // RoutingConfig: The network-level routing configuration for this
- // network. Used by Cloud Router to determine what type of network-wide
- // routing behavior to enforce.
+ // RoutingConfig: The network-level routing configuration for this network.
+ // Used by Cloud Router to determine what type of network-wide routing behavior
+ // to enforce.
RoutingConfig *NetworkRoutingConfig `json:"routingConfig,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // SelfLinkWithId: [Output Only] Server-defined URL for this resource
- // with the resource id.
+ // SelfLinkWithId: [Output Only] Server-defined URL for this resource with the
+ // resource id.
SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
-
- // Subnetworks: [Output Only] Server-defined fully-qualified URLs for
- // all subnetworks in this VPC network.
+ // Subnetworks: [Output Only] Server-defined fully-qualified URLs for all
+ // subnetworks in this VPC network.
Subnetworks []string `json:"subnetworks,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
// ForceSendFields is a list of field names (e.g. "IPv4Range") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "IPv4Range") 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. "IPv4Range") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *Network) MarshalJSON() ([]byte, error) {
+func (s Network) MarshalJSON() ([]byte, error) {
type NoMethod Network
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// NetworkAttachment: NetworkAttachments A network attachment resource
-// ...
+// NetworkAttachment: NetworkAttachments A network attachment resource ...
type NetworkAttachment struct {
- // ConnectionEndpoints: [Output Only] An array of connections for all
- // the producers connected to this network attachment.
+ // ConnectionEndpoints: [Output Only] An array of connections for all the
+ // producers connected to this network attachment.
ConnectionEndpoints []*NetworkAttachmentConnectedEndpoint `json:"connectionEndpoints,omitempty"`
-
// Possible values:
// "ACCEPT_AUTOMATIC"
// "ACCEPT_MANUAL"
// "INVALID"
ConnectionPreference string `json:"connectionPreference,omitempty"`
-
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // Fingerprint: Fingerprint of this resource. A hash of the contents
- // stored in this object. This field is used in optimistic locking. An
- // up-to-date fingerprint must be provided in order to patch.
+ // Fingerprint: Fingerprint of this resource. A hash of the contents stored in
+ // this object. This field is used in optimistic locking. An up-to-date
+ // fingerprint must be provided in order to patch.
Fingerprint string `json:"fingerprint,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource type. The
- // server generates this identifier.
+ // Id: [Output Only] The unique identifier for the resource type. The server
+ // generates this identifier.
Id uint64 `json:"id,omitempty,string"`
-
// Kind: [Output Only] Type of the resource.
Kind string `json:"kind,omitempty"`
-
- // Name: Name of the resource. Provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
- // the first character must be a lowercase letter, and all following
- // characters must be a dash, lowercase letter, or digit, except the
- // last character, which cannot be a dash.
+ // Name: Name of the resource. Provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must
+ // be a lowercase letter, and all following characters must be a dash,
+ // lowercase letter, or digit, except the last character, which cannot be a
+ // dash.
Name string `json:"name,omitempty"`
-
- // Network: [Output Only] The URL of the network which the Network
- // Attachment belongs to. Practically it is inferred by fetching the
- // network of the first subnetwork associated. Because it is required
- // that all the subnetworks must be from the same network, it is assured
- // that the Network Attachment belongs to the same network as all the
- // subnetworks.
+ // Network: [Output Only] The URL of the network which the Network Attachment
+ // belongs to. Practically it is inferred by fetching the network of the first
+ // subnetwork associated. Because it is required that all the subnetworks must
+ // be from the same network, it is assured that the Network Attachment belongs
+ // to the same network as all the subnetworks.
Network string `json:"network,omitempty"`
-
- // ProducerAcceptLists: Projects that are allowed to connect to this
- // network attachment. The project can be specified using its id or
- // number.
+ // ProducerAcceptLists: Projects that are allowed to connect to this network
+ // attachment. The project can be specified using its id or number.
ProducerAcceptLists []string `json:"producerAcceptLists,omitempty"`
-
// ProducerRejectLists: Projects that are not allowed to connect to this
- // network attachment. The project can be specified using its id or
- // number.
+ // network attachment. The project can be specified using its id or number.
ProducerRejectLists []string `json:"producerRejectLists,omitempty"`
-
// Region: [Output Only] URL of the region where the network attachment
- // resides. This field applies only to the region resource. You must
- // specify this field as part of the HTTP request URL. It is not
- // settable as a field in the request body.
+ // resides. This field applies only to the region resource. You must specify
+ // this field as part of the HTTP request URL. It is not settable as a field in
+ // the request body.
Region string `json:"region,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
// SelfLinkWithId: [Output Only] Server-defined URL for this resource's
// resource id.
SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
-
// Subnetworks: An array of URLs where each entry is the URL of a subnet
- // provided by the service consumer to use for endpoints in the
- // producers that connect to this network attachment.
+ // provided by the service consumer to use for endpoints in the producers that
+ // connect to this network attachment.
Subnetworks []string `json:"subnetworks,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "ConnectionEndpoints")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "ConnectionEndpoints") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "ConnectionEndpoints") 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. "ConnectionEndpoints") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkAttachment) MarshalJSON() ([]byte, error) {
+func (s NetworkAttachment) MarshalJSON() ([]byte, error) {
type NoMethod NetworkAttachment
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// NetworkAttachmentAggregatedList: Contains a list of
// NetworkAttachmentsScopedList.
type NetworkAttachmentAggregatedList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of NetworkAttachmentsScopedList resources.
Items map[string]NetworkAttachmentsScopedList `json:"items,omitempty"`
-
- Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ Kind string `json:"kind,omitempty"`
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *NetworkAttachmentAggregatedListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkAttachmentAggregatedList) MarshalJSON() ([]byte, error) {
+func (s NetworkAttachmentAggregatedList) MarshalJSON() ([]byte, error) {
type NoMethod NetworkAttachmentAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// NetworkAttachmentAggregatedListWarning: [Output Only] Informational
-// warning message.
+// NetworkAttachmentAggregatedListWarning: [Output Only] Informational warning
+// message.
type NetworkAttachmentAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*NetworkAttachmentAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkAttachmentAggregatedListWarning) MarshalJSON() ([]byte, error) {
+func (s NetworkAttachmentAggregatedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod NetworkAttachmentAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NetworkAttachmentAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkAttachmentAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+func (s NetworkAttachmentAggregatedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod NetworkAttachmentAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// NetworkAttachmentConnectedEndpoint: [Output Only] A connection
-// connected to this network attachment.
+// NetworkAttachmentConnectedEndpoint: [Output Only] A connection connected to
+// this network attachment.
type NetworkAttachmentConnectedEndpoint struct {
// IpAddress: The IPv4 address assigned to the producer instance network
// interface. This value will be a range in case of Serverless.
IpAddress string `json:"ipAddress,omitempty"`
-
- // Ipv6Address: The IPv6 address assigned to the producer instance
- // network interface. This is only assigned when the stack types of both
- // the instance network interface and the consumer subnet are IPv4_IPv6.
+ // Ipv6Address: The IPv6 address assigned to the producer instance network
+ // interface. This is only assigned when the stack types of both the instance
+ // network interface and the consumer subnet are IPv4_IPv6.
Ipv6Address string `json:"ipv6Address,omitempty"`
-
- // ProjectIdOrNum: The project id or number of the interface to which
- // the IP was assigned.
+ // ProjectIdOrNum: The project id or number of the interface to which the IP
+ // was assigned.
ProjectIdOrNum string `json:"projectIdOrNum,omitempty"`
-
// SecondaryIpCidrRanges: Alias IP ranges from the same subnetwork.
SecondaryIpCidrRanges []string `json:"secondaryIpCidrRanges,omitempty"`
-
- // Status: The status of a connected endpoint to this network
- // attachment.
+ // Status: The status of a connected endpoint to this network attachment.
//
// Possible values:
- // "ACCEPTED" - The consumer allows traffic from the producer to reach
- // its VPC.
+ // "ACCEPTED" - The consumer allows traffic from the producer to reach its
+ // VPC.
// "CLOSED" - The consumer network attachment no longer exists.
- // "NEEDS_ATTENTION" - The consumer needs to take further action
- // before traffic can be served.
- // "PENDING" - The consumer neither allows nor prohibits traffic from
- // the producer to reach its VPC.
- // "REJECTED" - The consumer prohibits traffic from the producer to
- // reach its VPC.
+ // "NEEDS_ATTENTION" - The consumer needs to take further action before
+ // traffic can be served.
+ // "PENDING" - The consumer neither allows nor prohibits traffic from the
+ // producer to reach its VPC.
+ // "REJECTED" - The consumer prohibits traffic from the producer to reach its
+ // VPC.
// "STATUS_UNSPECIFIED"
Status string `json:"status,omitempty"`
-
- // Subnetwork: The subnetwork used to assign the IP to the producer
- // instance network interface.
+ // Subnetwork: The subnetwork used to assign the IP to the producer instance
+ // network interface.
Subnetwork string `json:"subnetwork,omitempty"`
-
- // SubnetworkCidrRange: [Output Only] The CIDR range of the subnet from
- // which the IPv4 internal IP was allocated from.
+ // SubnetworkCidrRange: [Output Only] The CIDR range of the subnet from which
+ // the IPv4 internal IP was allocated from.
SubnetworkCidrRange string `json:"subnetworkCidrRange,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "IpAddress") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "IpAddress") 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. "IpAddress") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkAttachmentConnectedEndpoint) MarshalJSON() ([]byte, error) {
+func (s NetworkAttachmentConnectedEndpoint) MarshalJSON() ([]byte, error) {
type NoMethod NetworkAttachmentConnectedEndpoint
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NetworkAttachmentList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of NetworkAttachment resources.
Items []*NetworkAttachment `json:"items,omitempty"`
-
- Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ Kind string `json:"kind,omitempty"`
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *NetworkAttachmentListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkAttachmentList) MarshalJSON() ([]byte, error) {
+func (s NetworkAttachmentList) MarshalJSON() ([]byte, error) {
type NoMethod NetworkAttachmentList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// NetworkAttachmentListWarning: [Output Only] Informational warning
-// message.
+// NetworkAttachmentListWarning: [Output Only] Informational warning message.
type NetworkAttachmentListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*NetworkAttachmentListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkAttachmentListWarning) MarshalJSON() ([]byte, error) {
+func (s NetworkAttachmentListWarning) MarshalJSON() ([]byte, error) {
type NoMethod NetworkAttachmentListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NetworkAttachmentListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkAttachmentListWarningData) MarshalJSON() ([]byte, error) {
+func (s NetworkAttachmentListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod NetworkAttachmentListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NetworkAttachmentsScopedList struct {
- // NetworkAttachments: A list of NetworkAttachments contained in this
- // scope.
+ // NetworkAttachments: A list of NetworkAttachments contained in this scope.
NetworkAttachments []*NetworkAttachment `json:"networkAttachments,omitempty"`
-
// Warning: Informational warning which replaces the list of network
// attachments when the list is empty.
Warning *NetworkAttachmentsScopedListWarning `json:"warning,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "NetworkAttachments")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "NetworkAttachments") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "NetworkAttachments") 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. "NetworkAttachments") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkAttachmentsScopedList) MarshalJSON() ([]byte, error) {
+func (s NetworkAttachmentsScopedList) MarshalJSON() ([]byte, error) {
type NoMethod NetworkAttachmentsScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// NetworkAttachmentsScopedListWarning: Informational warning which
-// replaces the list of network attachments when the list is empty.
+// NetworkAttachmentsScopedListWarning: Informational warning which replaces
+// the list of network attachments when the list is empty.
type NetworkAttachmentsScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*NetworkAttachmentsScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkAttachmentsScopedListWarning) MarshalJSON() ([]byte, error) {
+func (s NetworkAttachmentsScopedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod NetworkAttachmentsScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NetworkAttachmentsScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkAttachmentsScopedListWarningData) MarshalJSON() ([]byte, error) {
+func (s NetworkAttachmentsScopedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod NetworkAttachmentsScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// NetworkEdgeSecurityService: Represents a Google Cloud Armor network
-// edge security service resource.
+// NetworkEdgeSecurityService: Represents a Google Cloud Armor network edge
+// security service resource.
type NetworkEdgeSecurityService struct {
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // Fingerprint: Fingerprint of this resource. A hash of the contents
- // stored in this object. This field is used in optimistic locking. This
- // field will be ignored when inserting a NetworkEdgeSecurityService. An
- // up-to-date fingerprint must be provided in order to update the
- // NetworkEdgeSecurityService, otherwise the request will fail with
- // error 412 conditionNotMet. To see the latest fingerprint, make a
- // get() request to retrieve a NetworkEdgeSecurityService.
+ // Fingerprint: Fingerprint of this resource. A hash of the contents stored in
+ // this object. This field is used in optimistic locking. This field will be
+ // ignored when inserting a NetworkEdgeSecurityService. An up-to-date
+ // fingerprint must be provided in order to update the
+ // NetworkEdgeSecurityService, otherwise the request will fail with error 412
+ // conditionNotMet. To see the latest fingerprint, make a get() request to
+ // retrieve a NetworkEdgeSecurityService.
Fingerprint string `json:"fingerprint,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
// Kind: [Output only] Type of the resource. Always
// compute#networkEdgeSecurityService for NetworkEdgeSecurityServices
Kind string `json:"kind,omitempty"`
-
- // Name: Name of the resource. Provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
- // the first character must be a lowercase letter, and all following
- // characters must be a dash, lowercase letter, or digit, except the
- // last character, which cannot be a dash.
+ // Name: Name of the resource. Provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must
+ // be a lowercase letter, and all following characters must be a dash,
+ // lowercase letter, or digit, except the last character, which cannot be a
+ // dash.
Name string `json:"name,omitempty"`
-
- // Region: [Output Only] URL of the region where the resource resides.
- // You must specify this field as part of the HTTP request URL. It is
- // not settable as a field in the request body.
+ // Region: [Output Only] URL of the region where the resource resides. You must
+ // specify this field as part of the HTTP request URL. It is not settable as a
+ // field in the request body.
Region string `json:"region,omitempty"`
-
- // SecurityPolicy: The resource URL for the network edge security
- // service associated with this network edge security service.
+ // SecurityPolicy: The resource URL for the network edge security service
+ // associated with this network edge security service.
SecurityPolicy string `json:"securityPolicy,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // SelfLinkWithId: [Output Only] Server-defined URL for this resource
- // with the resource id.
+ // SelfLinkWithId: [Output Only] Server-defined URL for this resource with the
+ // resource id.
SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "CreationTimestamp") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CreationTimestamp") 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. "CreationTimestamp") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkEdgeSecurityService) MarshalJSON() ([]byte, error) {
+func (s NetworkEdgeSecurityService) MarshalJSON() ([]byte, error) {
type NoMethod NetworkEdgeSecurityService
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NetworkEdgeSecurityServiceAggregatedList struct {
Etag string `json:"etag,omitempty"`
-
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of NetworkEdgeSecurityServicesScopedList resources.
Items map[string]NetworkEdgeSecurityServicesScopedList `json:"items,omitempty"`
-
// Kind: [Output Only] Type of resource. Always
- // compute#networkEdgeSecurityServiceAggregatedList for lists of Network
- // Edge Security Services.
+ // compute#networkEdgeSecurityServiceAggregatedList for lists of Network Edge
+ // Security Services.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Unreachables: [Output Only] Unreachable resources.
Unreachables []string `json:"unreachables,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *NetworkEdgeSecurityServiceAggregatedListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Etag") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Etag") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Etag") 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. "Etag") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkEdgeSecurityServiceAggregatedList) MarshalJSON() ([]byte, error) {
+func (s NetworkEdgeSecurityServiceAggregatedList) MarshalJSON() ([]byte, error) {
type NoMethod NetworkEdgeSecurityServiceAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// NetworkEdgeSecurityServiceAggregatedListWarning: [Output Only]
-// Informational warning message.
+// NetworkEdgeSecurityServiceAggregatedListWarning: [Output Only] Informational
+// warning message.
type NetworkEdgeSecurityServiceAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*NetworkEdgeSecurityServiceAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkEdgeSecurityServiceAggregatedListWarning) MarshalJSON() ([]byte, error) {
+func (s NetworkEdgeSecurityServiceAggregatedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod NetworkEdgeSecurityServiceAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NetworkEdgeSecurityServiceAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkEdgeSecurityServiceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+func (s NetworkEdgeSecurityServiceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod NetworkEdgeSecurityServiceAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NetworkEdgeSecurityServicesScopedList struct {
- // NetworkEdgeSecurityServices: A list of NetworkEdgeSecurityServices
- // contained in this scope.
+ // NetworkEdgeSecurityServices: A list of NetworkEdgeSecurityServices contained
+ // in this scope.
NetworkEdgeSecurityServices []*NetworkEdgeSecurityService `json:"networkEdgeSecurityServices,omitempty"`
-
- // Warning: Informational warning which replaces the list of security
- // policies when the list is empty.
+ // Warning: Informational warning which replaces the list of security policies
+ // when the list is empty.
Warning *NetworkEdgeSecurityServicesScopedListWarning `json:"warning,omitempty"`
-
// ForceSendFields is a list of field names (e.g.
- // "NetworkEdgeSecurityServices") to unconditionally include in API
- // requests. By default, fields with empty or default 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.
+ // "NetworkEdgeSecurityServices") to unconditionally include in API requests.
+ // By default, fields with empty or default values are omitted from API
+ // requests. See https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields
+ // for more details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g.
- // "NetworkEdgeSecurityServices") 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. "NetworkEdgeSecurityServices") to
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkEdgeSecurityServicesScopedList) MarshalJSON() ([]byte, error) {
+func (s NetworkEdgeSecurityServicesScopedList) MarshalJSON() ([]byte, error) {
type NoMethod NetworkEdgeSecurityServicesScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// NetworkEdgeSecurityServicesScopedListWarning: Informational warning
-// which replaces the list of security policies when the list is empty.
+// NetworkEdgeSecurityServicesScopedListWarning: Informational warning which
+// replaces the list of security policies when the list is empty.
type NetworkEdgeSecurityServicesScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*NetworkEdgeSecurityServicesScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkEdgeSecurityServicesScopedListWarning) MarshalJSON() ([]byte, error) {
+func (s NetworkEdgeSecurityServicesScopedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod NetworkEdgeSecurityServicesScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NetworkEdgeSecurityServicesScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkEdgeSecurityServicesScopedListWarningData) MarshalJSON() ([]byte, error) {
+func (s NetworkEdgeSecurityServicesScopedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod NetworkEdgeSecurityServicesScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// NetworkEndpoint: The network endpoint.
type NetworkEndpoint struct {
// Annotations: Metadata defined as annotations on the network endpoint.
Annotations map[string]string `json:"annotations,omitempty"`
-
- // Fqdn: Optional fully qualified domain name of network endpoint. This
- // can only be specified when NetworkEndpointGroup.network_endpoint_type
- // is NON_GCP_FQDN_PORT.
+ // ClientDestinationPort: Represents the port number to which PSC consumer
+ // sends packets. Only valid for network endpoint groups created with
+ // GCE_VM_IP_PORTMAP endpoint type.
+ ClientDestinationPort int64 `json:"clientDestinationPort,omitempty"`
+ // Fqdn: Optional fully qualified domain name of network endpoint. This can
+ // only be specified when NetworkEndpointGroup.network_endpoint_type is
+ // NON_GCP_FQDN_PORT.
Fqdn string `json:"fqdn,omitempty"`
-
- // Instance: The name or a URL of a specific VM instance that the IP
- // address belongs to. This is required for network endpoints of type
- // GCE_VM_IP_PORT. The instance must be in the same zone of network
- // endpoint group (for zonal NEGs) or in the zone within the region of
- // the NEG (for regional NEGs). The name must be 1-63 characters long,
- // and comply with RFC1035 or be a valid URL pointing to an existing
- // instance.
+ // Instance: The name or a URL of VM instance of this network endpoint. This
+ // field is required for network endpoints of type GCE_VM_IP and
+ // GCE_VM_IP_PORT. The instance must be in the same zone of network endpoint
+ // group (for zonal NEGs) or in the zone within the region of the NEG (for
+ // regional NEGs). If the ipAddress is specified, it must belongs to the VM
+ // instance. The name must be 1-63 characters long, and comply with RFC1035 or
+ // be a valid URL pointing to an existing instance.
Instance string `json:"instance,omitempty"`
-
- // IpAddress: Optional IPv4 address of network endpoint. The IP address
- // must belong to a VM in Compute Engine (either the primary IP or as
- // part of an aliased IP range). If the IP address is not specified,
- // then the primary IP address for the VM instance in the network that
- // the network endpoint group belongs to will be used.
+ // IpAddress: Optional IPv4 address of network endpoint. The IP address must
+ // belong to a VM in Compute Engine (either the primary IP or as part of an
+ // aliased IP range). If the IP address is not specified, then the primary IP
+ // address for the VM instance in the network that the network endpoint group
+ // belongs to will be used. This field is redundant and need not be set for
+ // network endpoints of type GCE_VM_IP. If set, it must be set to the primary
+ // internal IP address of the attached VM instance that matches the subnetwork
+ // of the NEG. The primary internal IP address from any NIC of a multi-NIC VM
+ // instance can be added to a NEG as long as it matches the NEG subnetwork.
IpAddress string `json:"ipAddress,omitempty"`
-
+ // Ipv6Address: Optional IPv6 address of network endpoint.
+ Ipv6Address string `json:"ipv6Address,omitempty"`
// Port: Optional port number of network endpoint. If not specified, the
- // defaultPort for the network endpoint group will be used.
+ // defaultPort for the network endpoint group will be used. This field can not
+ // be set for network endpoints of type GCE_VM_IP.
Port int64 `json:"port,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Annotations") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Annotations") 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. "Annotations") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkEndpoint) MarshalJSON() ([]byte, error) {
+func (s NetworkEndpoint) MarshalJSON() ([]byte, error) {
type NoMethod NetworkEndpoint
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// NetworkEndpointGroup: Represents a collection of network endpoints. A
// network endpoint group (NEG) defines how a set of endpoints should be
-// reached, whether they are reachable, and where they are located. For
-// more information about using NEGs for different use cases, see
-// Network endpoint groups overview.
+// reached, whether they are reachable, and where they are located. For more
+// information about using NEGs for different use cases, see Network endpoint
+// groups overview.
type NetworkEndpointGroup struct {
- // Annotations: Metadata defined as annotations on the network endpoint
- // group.
+ // Annotations: Metadata defined as annotations on the network endpoint group.
Annotations map[string]string `json:"annotations,omitempty"`
-
- // AppEngine: Only valid when networkEndpointType is "SERVERLESS". Only
- // one of cloudRun, appEngine or cloudFunction may be set.
+ // AppEngine: Only valid when networkEndpointType is SERVERLESS. Only one of
+ // cloudRun, appEngine or cloudFunction may be set.
AppEngine *NetworkEndpointGroupAppEngine `json:"appEngine,omitempty"`
-
- // CloudFunction: Only valid when networkEndpointType is "SERVERLESS".
- // Only one of cloudRun, appEngine or cloudFunction may be set.
+ // CloudFunction: Only valid when networkEndpointType is SERVERLESS. Only one
+ // of cloudRun, appEngine or cloudFunction may be set.
CloudFunction *NetworkEndpointGroupCloudFunction `json:"cloudFunction,omitempty"`
-
- // CloudRun: Only valid when networkEndpointType is "SERVERLESS". Only
- // one of cloudRun, appEngine or cloudFunction may be set.
+ // CloudRun: Only valid when networkEndpointType is SERVERLESS. Only one of
+ // cloudRun, appEngine or cloudFunction may be set.
CloudRun *NetworkEndpointGroupCloudRun `json:"cloudRun,omitempty"`
-
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // DefaultPort: The default port used if the port number is not
- // specified in the network endpoint.
+ // DefaultPort: The default port used if the port number is not specified in
+ // the network endpoint. If the network endpoint type is either GCE_VM_IP,
+ // SERVERLESS or PRIVATE_SERVICE_CONNECT, this field must not be specified.
DefaultPort int64 `json:"defaultPort,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
// Kind: [Output Only] Type of the resource. Always
// compute#networkEndpointGroup for network endpoint group.
Kind string `json:"kind,omitempty"`
-
- // Name: Name of the resource; provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
- // the first character must be a lowercase letter, and all following
- // characters must be a dash, lowercase letter, or digit, except the
- // last character, which cannot be a dash.
+ // Name: Name of the resource; provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must
+ // be a lowercase letter, and all following characters must be a dash,
+ // lowercase letter, or digit, except the last character, which cannot be a
+ // dash.
Name string `json:"name,omitempty"`
-
- // Network: The URL of the network to which all network endpoints in the
- // NEG belong. Uses "default" project network if unspecified.
+ // Network: The URL of the network to which all network endpoints in the NEG
+ // belong. Uses default project network if unspecified.
Network string `json:"network,omitempty"`
-
- // NetworkEndpointType: Type of network endpoints in this network
- // endpoint group. Can be one of GCE_VM_IP, GCE_VM_IP_PORT,
- // NON_GCP_PRIVATE_IP_PORT, INTERNET_FQDN_PORT, INTERNET_IP_PORT,
- // SERVERLESS, PRIVATE_SERVICE_CONNECT.
+ // NetworkEndpointType: Type of network endpoints in this network endpoint
+ // group. Can be one of GCE_VM_IP, GCE_VM_IP_PORT, NON_GCP_PRIVATE_IP_PORT,
+ // INTERNET_FQDN_PORT, INTERNET_IP_PORT, SERVERLESS, PRIVATE_SERVICE_CONNECT,
+ // GCE_VM_IP_PORTMAP.
//
// Possible values:
// "GCE_VM_IP" - The network endpoint is represented by an IP address.
- // "GCE_VM_IP_PORT" - The network endpoint is represented by IP
- // address and port pair.
+ // "GCE_VM_IP_PORT" - The network endpoint is represented by IP address and
+ // port pair.
+ // "GCE_VM_IP_PORTMAP" - The network endpoint is represented by an IP, Port
+ // and Client Destination Port.
// "INTERNET_FQDN_PORT" - The network endpoint is represented by fully
// qualified domain name and port.
- // "INTERNET_IP_PORT" - The network endpoint is represented by an
- // internet IP address and port.
- // "NON_GCP_PRIVATE_IP_PORT" - The network endpoint is represented by
- // an IP address and port. The endpoint belongs to a VM or pod running
- // in a customer's on-premises.
- // "PRIVATE_SERVICE_CONNECT" - The network endpoint is either public
- // Google APIs or services exposed by other GCP Project with a Service
- // Attachment. The connection is set up by private service connect
- // "SERVERLESS" - The network endpoint is handled by specified
- // serverless infrastructure.
- NetworkEndpointType string `json:"networkEndpointType,omitempty"`
-
- PscData *NetworkEndpointGroupPscData `json:"pscData,omitempty"`
-
- // PscTargetService: The target service url used to set up private
- // service connection to a Google API or a PSC Producer Service
- // Attachment. An example value is:
- // "asia-northeast3-cloudkms.googleapis.com"
+ // "INTERNET_IP_PORT" - The network endpoint is represented by an internet IP
+ // address and port.
+ // "NON_GCP_PRIVATE_IP_PORT" - The network endpoint is represented by an IP
+ // address and port. The endpoint belongs to a VM or pod running in a
+ // customer's on-premises.
+ // "PRIVATE_SERVICE_CONNECT" - The network endpoint is either public Google
+ // APIs or services exposed by other GCP Project with a Service Attachment. The
+ // connection is set up by private service connect
+ // "SERVERLESS" - The network endpoint is handled by specified serverless
+ // infrastructure.
+ NetworkEndpointType string `json:"networkEndpointType,omitempty"`
+ PscData *NetworkEndpointGroupPscData `json:"pscData,omitempty"`
+ // PscTargetService: The target service url used to set up private service
+ // connection to a Google API or a PSC Producer Service Attachment. An example
+ // value is: asia-northeast3-cloudkms.googleapis.com
PscTargetService string `json:"pscTargetService,omitempty"`
-
- // Region: [Output Only] The URL of the region where the network
- // endpoint group is located.
+ // Region: [Output Only] The URL of the region where the network endpoint group
+ // is located.
Region string `json:"region,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // Size: [Output only] Number of network endpoints in the network
- // endpoint group.
+ // Size: [Output only] Number of network endpoints in the network endpoint
+ // group.
Size int64 `json:"size,omitempty"`
-
- // Subnetwork: Optional URL of the subnetwork to which all network
- // endpoints in the NEG belong.
+ // Subnetwork: Optional URL of the subnetwork to which all network endpoints in
+ // the NEG belong.
Subnetwork string `json:"subnetwork,omitempty"`
-
- // Zone: [Output Only] The URL of the zone where the network endpoint
- // group is located.
+ // Zone: [Output Only] The URL of the zone where the network endpoint group is
+ // located.
Zone string `json:"zone,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
// ForceSendFields is a list of field names (e.g. "Annotations") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Annotations") 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. "Annotations") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkEndpointGroup) MarshalJSON() ([]byte, error) {
+func (s NetworkEndpointGroup) MarshalJSON() ([]byte, error) {
type NoMethod NetworkEndpointGroup
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NetworkEndpointGroupAggregatedList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of NetworkEndpointGroupsScopedList resources.
Items map[string]NetworkEndpointGroupsScopedList `json:"items,omitempty"`
-
// Kind: [Output Only] The resource type, which is always
- // compute#networkEndpointGroupAggregatedList for aggregated lists of
- // network endpoint groups.
+ // compute#networkEndpointGroupAggregatedList for aggregated lists of network
+ // endpoint groups.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Unreachables: [Output Only] Unreachable resources.
Unreachables []string `json:"unreachables,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *NetworkEndpointGroupAggregatedListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkEndpointGroupAggregatedList) MarshalJSON() ([]byte, error) {
+func (s NetworkEndpointGroupAggregatedList) MarshalJSON() ([]byte, error) {
type NoMethod NetworkEndpointGroupAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// NetworkEndpointGroupAggregatedListWarning: [Output Only]
-// Informational warning message.
+// NetworkEndpointGroupAggregatedListWarning: [Output Only] Informational
+// warning message.
type NetworkEndpointGroupAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*NetworkEndpointGroupAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkEndpointGroupAggregatedListWarning) MarshalJSON() ([]byte, error) {
+func (s NetworkEndpointGroupAggregatedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod NetworkEndpointGroupAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NetworkEndpointGroupAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkEndpointGroupAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+func (s NetworkEndpointGroupAggregatedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod NetworkEndpointGroupAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// NetworkEndpointGroupAppEngine: Configuration for an App Engine
-// network endpoint group (NEG). The service is optional, may be
-// provided explicitly or in the URL mask. The version is optional and
-// can only be provided explicitly or in the URL mask when service is
-// present. Note: App Engine service must be in the same project and
-// located in the same region as the Serverless NEG.
+// NetworkEndpointGroupAppEngine: Configuration for an App Engine network
+// endpoint group (NEG). The service is optional, may be provided explicitly or
+// in the URL mask. The version is optional and can only be provided explicitly
+// or in the URL mask when service is present. Note: App Engine service must be
+// in the same project and located in the same region as the Serverless NEG.
type NetworkEndpointGroupAppEngine struct {
- // Service: Optional serving service. The service name is case-sensitive
- // and must be 1-63 characters long. Example value: "default",
- // "my-service".
+ // Service: Optional serving service. The service name is case-sensitive and
+ // must be 1-63 characters long. Example value: default, my-service.
Service string `json:"service,omitempty"`
-
- // UrlMask: A template to parse service and version fields from a
- // request URL. URL mask allows for routing to multiple App Engine
- // services without having to create multiple Network Endpoint Groups
- // and backend services. For example, the request URLs
- // "foo1-dot-appname.appspot.com/v1" and
- // "foo1-dot-appname.appspot.com/v2" can be backed by the same
- // Serverless NEG with URL mask
- // "-dot-appname.appspot.com/". The URL mask will
- // parse them to { service = "foo1", version = "v1" } and { service =
- // "foo1", version = "v2" } respectively.
+ // UrlMask: An URL mask is one of the main components of the Cloud Function. A
+ // template to parse service and version fields from a request URL. URL mask
+ // allows for routing to multiple App Engine services without having to create
+ // multiple Network Endpoint Groups and backend services. For example, the
+ // request URLs foo1-dot-appname.appspot.com/v1 and
+ // foo1-dot-appname.appspot.com/v2 can be backed by the same Serverless NEG
+ // with URL mask -dot-appname.appspot.com/. The URL mask will
+ // parse them to { service = "foo1", version = "v1" } and { service = "foo1",
+ // version = "v2" } respectively.
UrlMask string `json:"urlMask,omitempty"`
-
- // Version: Optional serving version. The version name is case-sensitive
- // and must be 1-100 characters long. Example value: "v1", "v2".
+ // Version: Optional serving version. The version name is case-sensitive and
+ // must be 1-100 characters long. Example value: v1, v2.
Version string `json:"version,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Service") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Service") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Service") 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. "Service") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkEndpointGroupAppEngine) MarshalJSON() ([]byte, error) {
+func (s NetworkEndpointGroupAppEngine) MarshalJSON() ([]byte, error) {
type NoMethod NetworkEndpointGroupAppEngine
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// NetworkEndpointGroupCloudFunction: Configuration for a Cloud Function
-// network endpoint group (NEG). The function must be provided
-// explicitly or in the URL mask. Note: Cloud Function must be in the
-// same project and located in the same region as the Serverless NEG.
+// network endpoint group (NEG). The function must be provided explicitly or in
+// the URL mask. Note: Cloud Function must be in the same project and located
+// in the same region as the Serverless NEG.
type NetworkEndpointGroupCloudFunction struct {
- // Function: A user-defined name of the Cloud Function. The function
- // name is case-sensitive and must be 1-63 characters long. Example
- // value: "func1".
+ // Function: A user-defined name of the Cloud Function. The function name is
+ // case-sensitive and must be 1-63 characters long. Example value: func1.
Function string `json:"function,omitempty"`
-
- // UrlMask: A template to parse function field from a request URL. URL
- // mask allows for routing to multiple Cloud Functions without having to
- // create multiple Network Endpoint Groups and backend services. For
- // example, request URLs " mydomain.com/function1" and
- // "mydomain.com/function2" can be backed by the same Serverless NEG
- // with URL mask "/". The URL mask will parse them to {
+ // UrlMask: An URL mask is one of the main components of the Cloud Function. A
+ // template to parse function field from a request URL. URL mask allows for
+ // routing to multiple Cloud Functions without having to create multiple
+ // Network Endpoint Groups and backend services. For example, request URLs
+ // mydomain.com/function1 and mydomain.com/function2 can be backed by the same
+ // Serverless NEG with URL mask /. The URL mask will parse them to {
// function = "function1" } and { function = "function2" } respectively.
UrlMask string `json:"urlMask,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Function") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Function") 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. "Function") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkEndpointGroupCloudFunction) MarshalJSON() ([]byte, error) {
+func (s NetworkEndpointGroupCloudFunction) MarshalJSON() ([]byte, error) {
type NoMethod NetworkEndpointGroupCloudFunction
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// NetworkEndpointGroupCloudRun: Configuration for a Cloud Run network
-// endpoint group (NEG). The service must be provided explicitly or in
-// the URL mask. The tag is optional, may be provided explicitly or in
-// the URL mask. Note: Cloud Run service must be in the same project and
-// located in the same region as the Serverless NEG.
+// NetworkEndpointGroupCloudRun: Configuration for a Cloud Run network endpoint
+// group (NEG). The service must be provided explicitly or in the URL mask. The
+// tag is optional, may be provided explicitly or in the URL mask. Note: Cloud
+// Run service must be in the same project and located in the same region as
+// the Serverless NEG.
type NetworkEndpointGroupCloudRun struct {
- // Service: Cloud Run service is the main resource of Cloud Run. The
- // service must be 1-63 characters long, and comply with RFC1035.
- // Example value: "run-service".
- Service string `json:"service,omitempty"`
-
- // Tag: Optional Cloud Run tag represents the "named-revision" to
- // provide additional fine-grained traffic routing information. The tag
+ // Service: Cloud Run service is the main resource of Cloud Run. The service
// must be 1-63 characters long, and comply with RFC1035. Example value:
- // "revision-0010".
+ // "run-service".
+ Service string `json:"service,omitempty"`
+ // Tag: Optional Cloud Run tag represents the "named-revision" to provide
+ // additional fine-grained traffic routing information. The tag must be 1-63
+ // characters long, and comply with RFC1035. Example value: "revision-0010".
Tag string `json:"tag,omitempty"`
-
- // UrlMask: A template to parse and fields from a
- // request URL. URL mask allows for routing to multiple Run services
- // without having to create multiple network endpoint groups and backend
- // services. For example, request URLs "foo1.domain.com/bar1" and
- // "foo1.domain.com/bar2" can be backed by the same Serverless Network
- // Endpoint Group (NEG) with URL mask ".domain.com/". The
- // URL mask will parse them to { service="bar1", tag="foo1" } and {
- // service="bar2", tag="foo2" } respectively.
+ // UrlMask: An URL mask is one of the main components of the Cloud Function. A
+ // template to parse and fields from a request URL. URL mask
+ // allows for routing to multiple Run services without having to create
+ // multiple network endpoint groups and backend services. For example, request
+ // URLs foo1.domain.com/bar1 and foo1.domain.com/bar2 can be backed by the same
+ // Serverless Network Endpoint Group (NEG) with URL mask
+ // .domain.com/. The URL mask will parse them to {
+ // service="bar1", tag="foo1" } and { service="bar2", tag="foo2" }
+ // respectively.
UrlMask string `json:"urlMask,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Service") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Service") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Service") 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. "Service") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkEndpointGroupCloudRun) MarshalJSON() ([]byte, error) {
+func (s NetworkEndpointGroupCloudRun) MarshalJSON() ([]byte, error) {
type NoMethod NetworkEndpointGroupCloudRun
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NetworkEndpointGroupList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of NetworkEndpointGroup resources.
Items []*NetworkEndpointGroup `json:"items,omitempty"`
-
// Kind: [Output Only] The resource type, which is always
// compute#networkEndpointGroupList for network endpoint group lists.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *NetworkEndpointGroupListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkEndpointGroupList) MarshalJSON() ([]byte, error) {
+func (s NetworkEndpointGroupList) MarshalJSON() ([]byte, error) {
type NoMethod NetworkEndpointGroupList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// NetworkEndpointGroupListWarning: [Output Only] Informational warning
// message.
type NetworkEndpointGroupListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*NetworkEndpointGroupListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkEndpointGroupListWarning) MarshalJSON() ([]byte, error) {
+func (s NetworkEndpointGroupListWarning) MarshalJSON() ([]byte, error) {
type NoMethod NetworkEndpointGroupListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NetworkEndpointGroupListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkEndpointGroupListWarningData) MarshalJSON() ([]byte, error) {
+func (s NetworkEndpointGroupListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod NetworkEndpointGroupListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// NetworkEndpointGroupPscData: All data that is specifically relevant
-// to only network endpoint groups of type PRIVATE_SERVICE_CONNECT.
+// NetworkEndpointGroupPscData: All data that is specifically relevant to only
+// network endpoint groups of type PRIVATE_SERVICE_CONNECT.
type NetworkEndpointGroupPscData struct {
- // ConsumerPscAddress: [Output Only] Address allocated from given
- // subnetwork for PSC. This IP address acts as a VIP for a PSC NEG,
- // allowing it to act as an endpoint in L7 PSC-XLB.
+ // ConsumerPscAddress: [Output Only] Address allocated from given subnetwork
+ // for PSC. This IP address acts as a VIP for a PSC NEG, allowing it to act as
+ // an endpoint in L7 PSC-XLB.
ConsumerPscAddress string `json:"consumerPscAddress,omitempty"`
-
- // PscConnectionId: [Output Only] The PSC connection id of the PSC
- // Network Endpoint Group Consumer.
+ // ProducerPort: The psc producer port is used to connect PSC NEG with specific
+ // port on the PSC Producer side; should only be used for the
+ // PRIVATE_SERVICE_CONNECT NEG type
+ ProducerPort int64 `json:"producerPort,omitempty"`
+ // PscConnectionId: [Output Only] The PSC connection id of the PSC Network
+ // Endpoint Group Consumer.
PscConnectionId uint64 `json:"pscConnectionId,omitempty,string"`
-
// PscConnectionStatus: [Output Only] The connection status of the PSC
// Forwarding Rule.
//
// Possible values:
// "ACCEPTED" - The connection has been accepted by the producer.
- // "CLOSED" - The connection has been closed by the producer and will
- // not serve traffic going forward.
- // "NEEDS_ATTENTION" - The connection has been accepted by the
- // producer, but the producer needs to take further action before the
- // forwarding rule can serve traffic.
+ // "CLOSED" - The connection has been closed by the producer and will not
+ // serve traffic going forward.
+ // "NEEDS_ATTENTION" - The connection has been accepted by the producer, but
+ // the producer needs to take further action before the forwarding rule can
+ // serve traffic.
// "PENDING" - The connection is pending acceptance by the producer.
// "REJECTED" - The connection has been rejected by the producer.
// "STATUS_UNSPECIFIED"
PscConnectionStatus string `json:"pscConnectionStatus,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "ConsumerPscAddress")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "ConsumerPscAddress") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "ConsumerPscAddress") 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. "ConsumerPscAddress") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkEndpointGroupPscData) MarshalJSON() ([]byte, error) {
+func (s NetworkEndpointGroupPscData) MarshalJSON() ([]byte, error) {
type NoMethod NetworkEndpointGroupPscData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NetworkEndpointGroupsAttachEndpointsRequest struct {
// NetworkEndpoints: The list of network endpoints to be attached.
NetworkEndpoints []*NetworkEndpoint `json:"networkEndpoints,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "NetworkEndpoints") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "NetworkEndpoints") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "NetworkEndpoints") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkEndpointGroupsAttachEndpointsRequest) MarshalJSON() ([]byte, error) {
+func (s NetworkEndpointGroupsAttachEndpointsRequest) MarshalJSON() ([]byte, error) {
type NoMethod NetworkEndpointGroupsAttachEndpointsRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NetworkEndpointGroupsDetachEndpointsRequest struct {
// NetworkEndpoints: The list of network endpoints to be detached.
NetworkEndpoints []*NetworkEndpoint `json:"networkEndpoints,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "NetworkEndpoints") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "NetworkEndpoints") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "NetworkEndpoints") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkEndpointGroupsDetachEndpointsRequest) MarshalJSON() ([]byte, error) {
+func (s NetworkEndpointGroupsDetachEndpointsRequest) MarshalJSON() ([]byte, error) {
type NoMethod NetworkEndpointGroupsDetachEndpointsRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NetworkEndpointGroupsListEndpointsRequest struct {
- // HealthStatus: Optional query parameter for showing the health status
- // of each network endpoint. Valid options are SKIP or SHOW. If you
- // don't specify this parameter, the health status of network endpoints
- // will not be provided.
+ // HealthStatus: Optional query parameter for showing the health status of each
+ // network endpoint. Valid options are SKIP or SHOW. If you don't specify this
+ // parameter, the health status of network endpoints will not be provided.
//
// Possible values:
- // "SHOW" - Show the health status for each network endpoint. Impacts
- // latency of the call.
+ // "SHOW" - Show the health status for each network endpoint. Impacts latency
+ // of the call.
// "SKIP" - Health status for network endpoints will not be provided.
HealthStatus string `json:"healthStatus,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "HealthStatus") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "HealthStatus") 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. "HealthStatus") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkEndpointGroupsListEndpointsRequest) MarshalJSON() ([]byte, error) {
+func (s NetworkEndpointGroupsListEndpointsRequest) MarshalJSON() ([]byte, error) {
type NoMethod NetworkEndpointGroupsListEndpointsRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NetworkEndpointGroupsListNetworkEndpoints struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of NetworkEndpointWithHealthStatus resources.
Items []*NetworkEndpointWithHealthStatus `json:"items,omitempty"`
-
// Kind: [Output Only] The resource type, which is always
- // compute#networkEndpointGroupsListNetworkEndpoints for the list of
- // network endpoints in the specified network endpoint group.
+ // compute#networkEndpointGroupsListNetworkEndpoints for the list of network
+ // endpoints in the specified network endpoint group.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *NetworkEndpointGroupsListNetworkEndpointsWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkEndpointGroupsListNetworkEndpoints) MarshalJSON() ([]byte, error) {
+func (s NetworkEndpointGroupsListNetworkEndpoints) MarshalJSON() ([]byte, error) {
type NoMethod NetworkEndpointGroupsListNetworkEndpoints
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// NetworkEndpointGroupsListNetworkEndpointsWarning: [Output Only]
// Informational warning message.
type NetworkEndpointGroupsListNetworkEndpointsWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*NetworkEndpointGroupsListNetworkEndpointsWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkEndpointGroupsListNetworkEndpointsWarning) MarshalJSON() ([]byte, error) {
+func (s NetworkEndpointGroupsListNetworkEndpointsWarning) MarshalJSON() ([]byte, error) {
type NoMethod NetworkEndpointGroupsListNetworkEndpointsWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NetworkEndpointGroupsListNetworkEndpointsWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkEndpointGroupsListNetworkEndpointsWarningData) MarshalJSON() ([]byte, error) {
+func (s NetworkEndpointGroupsListNetworkEndpointsWarningData) MarshalJSON() ([]byte, error) {
type NoMethod NetworkEndpointGroupsListNetworkEndpointsWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NetworkEndpointGroupsScopedList struct {
- // NetworkEndpointGroups: [Output Only] The list of network endpoint
- // groups that are contained in this scope.
+ // NetworkEndpointGroups: [Output Only] The list of network endpoint groups
+ // that are contained in this scope.
NetworkEndpointGroups []*NetworkEndpointGroup `json:"networkEndpointGroups,omitempty"`
-
- // Warning: [Output Only] An informational warning that replaces the
- // list of network endpoint groups when the list is empty.
+ // Warning: [Output Only] An informational warning that replaces the list of
+ // network endpoint groups when the list is empty.
Warning *NetworkEndpointGroupsScopedListWarning `json:"warning,omitempty"`
-
- // ForceSendFields is a list of field names (e.g.
- // "NetworkEndpointGroups") to unconditionally include in API requests.
- // By default, fields with empty or default 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 is a list of field names (e.g. "NetworkEndpointGroups") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "NetworkEndpointGroups") 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.
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkEndpointGroupsScopedList) MarshalJSON() ([]byte, error) {
+func (s NetworkEndpointGroupsScopedList) MarshalJSON() ([]byte, error) {
type NoMethod NetworkEndpointGroupsScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// NetworkEndpointGroupsScopedListWarning: [Output Only] An
-// informational warning that replaces the list of network endpoint
-// groups when the list is empty.
+// NetworkEndpointGroupsScopedListWarning: [Output Only] An informational
+// warning that replaces the list of network endpoint groups when the list is
+// empty.
type NetworkEndpointGroupsScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*NetworkEndpointGroupsScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkEndpointGroupsScopedListWarning) MarshalJSON() ([]byte, error) {
+func (s NetworkEndpointGroupsScopedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod NetworkEndpointGroupsScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NetworkEndpointGroupsScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkEndpointGroupsScopedListWarningData) MarshalJSON() ([]byte, error) {
+func (s NetworkEndpointGroupsScopedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod NetworkEndpointGroupsScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NetworkEndpointWithHealthStatus struct {
// Healths: [Output only] The health status of network endpoint;
Healths []*HealthStatusForNetworkEndpoint `json:"healths,omitempty"`
-
// NetworkEndpoint: [Output only] The network endpoint;
NetworkEndpoint *NetworkEndpoint `json:"networkEndpoint,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Healths") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Healths") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Healths") 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. "Healths") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkEndpointWithHealthStatus) MarshalJSON() ([]byte, error) {
+func (s NetworkEndpointWithHealthStatus) MarshalJSON() ([]byte, error) {
type NoMethod NetworkEndpointWithHealthStatus
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// NetworkInterface: A network interface resource attached to an
-// instance.
+// NetworkInterface: A network interface resource attached to an instance.
type NetworkInterface struct {
- // AccessConfigs: An array of configurations for this interface.
- // Currently, only one access config, ONE_TO_ONE_NAT, is supported. If
- // there are no accessConfigs specified, then this instance will have no
- // external internet access.
+ // AccessConfigs: An array of configurations for this interface. Currently,
+ // only one access config, ONE_TO_ONE_NAT, is supported. If there are no
+ // accessConfigs specified, then this instance will have no external internet
+ // access.
AccessConfigs []*AccessConfig `json:"accessConfigs,omitempty"`
-
- // AliasIpRanges: An array of alias IP ranges for this network
- // interface. You can only specify this field for network interfaces in
- // VPC networks.
+ // AliasIpRanges: An array of alias IP ranges for this network interface. You
+ // can only specify this field for network interfaces in VPC networks.
AliasIpRanges []*AliasIpRange `json:"aliasIpRanges,omitempty"`
-
- // Fingerprint: Fingerprint hash of contents stored in this network
- // interface. This field will be ignored when inserting an Instance or
- // adding a NetworkInterface. An up-to-date fingerprint must be provided
- // in order to update the NetworkInterface. The request will fail with
- // error 400 Bad Request if the fingerprint is not provided, or 412
- // Precondition Failed if the fingerprint is out of date.
+ // Fingerprint: Fingerprint hash of contents stored in this network interface.
+ // This field will be ignored when inserting an Instance or adding a
+ // NetworkInterface. An up-to-date fingerprint must be provided in order to
+ // update the NetworkInterface. The request will fail with error 400 Bad
+ // Request if the fingerprint is not provided, or 412 Precondition Failed if
+ // the fingerprint is out of date.
Fingerprint string `json:"fingerprint,omitempty"`
-
- // InternalIpv6PrefixLength: The prefix length of the primary internal
- // IPv6 range.
+ // InternalIpv6PrefixLength: The prefix length of the primary internal IPv6
+ // range.
InternalIpv6PrefixLength int64 `json:"internalIpv6PrefixLength,omitempty"`
-
// Ipv6AccessConfigs: An array of IPv6 access configurations for this
// interface. Currently, only one IPv6 access config, DIRECT_IPV6, is
- // supported. If there is no ipv6AccessConfig specified, then this
- // instance will have no external IPv6 Internet access.
+ // supported. If there is no ipv6AccessConfig specified, then this instance
+ // will have no external IPv6 Internet access.
Ipv6AccessConfigs []*AccessConfig `json:"ipv6AccessConfigs,omitempty"`
-
- // Ipv6AccessType: [Output Only] One of EXTERNAL, INTERNAL to indicate
- // whether the IP can be accessed from the Internet. This field is
- // always inherited from its subnetwork. Valid only if stackType is
- // IPV4_IPV6.
+ // Ipv6AccessType: [Output Only] One of EXTERNAL, INTERNAL to indicate whether
+ // the IP can be accessed from the Internet. This field is always inherited
+ // from its subnetwork. Valid only if stackType is IPV4_IPV6.
//
// Possible values:
// "EXTERNAL" - This network interface can have external IPv6.
// "INTERNAL" - This network interface can have internal IPv6.
Ipv6AccessType string `json:"ipv6AccessType,omitempty"`
-
- // Ipv6Address: An IPv6 internal network address for this network
- // interface. To use a static internal IP address, it must be unused and
- // in the same region as the instance's zone. If not specified, Google
- // Cloud will automatically assign an internal IPv6 address from the
- // instance's subnetwork.
+ // Ipv6Address: An IPv6 internal network address for this network interface. To
+ // use a static internal IP address, it must be unused and in the same region
+ // as the instance's zone. If not specified, Google Cloud will automatically
+ // assign an internal IPv6 address from the instance's subnetwork.
Ipv6Address string `json:"ipv6Address,omitempty"`
-
- // Kind: [Output Only] Type of the resource. Always
- // compute#networkInterface for network interfaces.
+ // Kind: [Output Only] Type of the resource. Always compute#networkInterface
+ // for network interfaces.
Kind string `json:"kind,omitempty"`
-
- // Name: [Output Only] The name of the network interface, which is
- // generated by the server. For a VM, the network interface uses the
- // nicN naming format. Where N is a value between 0 and 7. The default
- // interface value is nic0.
+ // Name: [Output Only] The name of the network interface, which is generated by
+ // the server. For a VM, the network interface uses the nicN naming format.
+ // Where N is a value between 0 and 7. The default interface value is nic0.
Name string `json:"name,omitempty"`
-
- // Network: URL of the VPC network resource for this instance. When
- // creating an instance, if neither the network nor the subnetwork is
- // specified, the default network global/networks/default is used. If
- // the selected project doesn't have the default network, you must
- // specify a network or subnet. If the network is not specified but the
- // subnetwork is specified, the network is inferred. If you specify this
- // property, you can specify the network as a full or partial URL. For
- // example, the following are all valid URLs: -
+ // Network: URL of the VPC network resource for this instance. When creating an
+ // instance, if neither the network nor the subnetwork is specified, the
+ // default network global/networks/default is used. If the selected project
+ // doesn't have the default network, you must specify a network or subnet. If
+ // the network is not specified but the subnetwork is specified, the network is
+ // inferred. If you specify this property, you can specify the network as a
+ // full or partial URL. For example, the following are all valid URLs: -
// https://www.googleapis.com/compute/v1/projects/project/global/networks/
- // network - projects/project/global/networks/network -
- // global/networks/default
+ // network - projects/project/global/networks/network - global/networks/default
Network string `json:"network,omitempty"`
-
- // NetworkAttachment: The URL of the network attachment that this
- // interface should connect to in the following format:
- // projects/{project_number}/regions/{region_name}/networkAttachments/{ne
- // twork_attachment_name}.
+ // NetworkAttachment: The URL of the network attachment that this interface
+ // should connect to in the following format:
+ // projects/{project_number}/regions/{region_name}/networkAttachments/{network_a
+ // ttachment_name}.
NetworkAttachment string `json:"networkAttachment,omitempty"`
-
- // NetworkIP: An IPv4 internal IP address to assign to the instance for
- // this network interface. If not specified by the user, an unused
- // internal IP is assigned by the system.
+ // NetworkIP: An IPv4 internal IP address to assign to the instance for this
+ // network interface. If not specified by the user, an unused internal IP is
+ // assigned by the system.
NetworkIP string `json:"networkIP,omitempty"`
-
- // NicType: The type of vNIC to be used on this interface. This may be
- // gVNIC or VirtioNet.
+ // NicType: The type of vNIC to be used on this interface. This may be gVNIC or
+ // VirtioNet.
//
// Possible values:
// "GVNIC" - GVNIC
+ // "IDPF" - IDPF
// "UNSPECIFIED_NIC_TYPE" - No type specified.
// "VIRTIO_NET" - VIRTIO
NicType string `json:"nicType,omitempty"`
-
- // QueueCount: The networking queue count that's specified by users for
- // the network interface. Both Rx and Tx queues will be set to this
- // number. It'll be empty if not specified by the users.
+ // QueueCount: The networking queue count that's specified by users for the
+ // network interface. Both Rx and Tx queues will be set to this number. It'll
+ // be empty if not specified by the users.
QueueCount int64 `json:"queueCount,omitempty"`
-
- // StackType: The stack type for this network interface. To assign only
- // IPv4 addresses, use IPV4_ONLY. To assign both IPv4 and IPv6
- // addresses, use IPV4_IPV6. If not specified, IPV4_ONLY is used. This
- // field can be both set at instance creation and update network
- // interface operations.
+ // StackType: The stack type for this network interface. To assign only IPv4
+ // addresses, use IPV4_ONLY. To assign both IPv4 and IPv6 addresses, use
+ // IPV4_IPV6. If not specified, IPV4_ONLY is used. This field can be both set
+ // at instance creation and update network interface operations.
//
// Possible values:
- // "IPV4_IPV6" - The network interface can have both IPv4 and IPv6
- // addresses.
- // "IPV4_ONLY" - The network interface will be assigned IPv4 address.
+ // "IPV4_IPV6" - The network interface can have both IPv4 and IPv6 addresses.
+ // "IPV4_ONLY" - The network interface will only be assigned IPv4 addresses.
+ // "IPV6_ONLY" - The network interface will only be assigned IPv6 addresses.
StackType string `json:"stackType,omitempty"`
-
- // Subnetwork: The URL of the Subnetwork resource for this instance. If
- // the network resource is in legacy mode, do not specify this field. If
- // the network is in auto subnet mode, specifying the subnetwork is
- // optional. If the network is in custom subnet mode, specifying the
- // subnetwork is required. If you specify this field, you can specify
- // the subnetwork as a full or partial URL. For example, the following
- // are all valid URLs: -
+ // Subnetwork: The URL of the Subnetwork resource for this instance. If the
+ // network resource is in legacy mode, do not specify this field. If the
+ // network is in auto subnet mode, specifying the subnetwork is optional. If
+ // the network is in custom subnet mode, specifying the subnetwork is required.
+ // If you specify this field, you can specify the subnetwork as a full or
+ // partial URL. For example, the following are all valid URLs: -
// https://www.googleapis.com/compute/v1/projects/project/regions/region
// /subnetworks/subnetwork - regions/region/subnetworks/subnetwork
Subnetwork string `json:"subnetwork,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "AccessConfigs") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "AccessConfigs") 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. "AccessConfigs") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkInterface) MarshalJSON() ([]byte, error) {
+func (s NetworkInterface) MarshalJSON() ([]byte, error) {
type NoMethod NetworkInterface
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// NetworkList: Contains a list of networks.
type NetworkList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of Network resources.
Items []*Network `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource. Always compute#networkList for
- // lists of networks.
+ // Kind: [Output Only] Type of resource. Always compute#networkList for lists
+ // of networks.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *NetworkListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkList) MarshalJSON() ([]byte, error) {
+func (s NetworkList) MarshalJSON() ([]byte, error) {
type NoMethod NetworkList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// NetworkListWarning: [Output Only] Informational warning message.
type NetworkListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*NetworkListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkListWarning) MarshalJSON() ([]byte, error) {
+func (s NetworkListWarning) MarshalJSON() ([]byte, error) {
type NoMethod NetworkListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NetworkListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkListWarningData) MarshalJSON() ([]byte, error) {
+func (s NetworkListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod NetworkListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// NetworkPeering: A network peering attached to a network resource. The
-// message includes the peering name, peer network, peering state, and a
-// flag indicating whether Google Compute Engine should automatically
-// create routes for the peering.
+// message includes the peering name, peer network, peering state, and a flag
+// indicating whether Google Compute Engine should automatically create routes
+// for the peering.
type NetworkPeering struct {
// AutoCreateRoutes: This field will be deprecated soon. Use the
// exchange_subnet_routes field instead. Indicates whether full mesh
- // connectivity is created and managed automatically between peered
- // networks. Currently this field should always be true since Google
- // Compute Engine will automatically create and manage subnetwork routes
- // between two networks when peering state is ACTIVE.
+ // connectivity is created and managed automatically between peered networks.
+ // Currently this field should always be true since Google Compute Engine will
+ // automatically create and manage subnetwork routes between two networks when
+ // peering state is ACTIVE.
AutoCreateRoutes bool `json:"autoCreateRoutes,omitempty"`
-
- // ExchangeSubnetRoutes: Indicates whether full mesh connectivity is
- // created and managed automatically between peered networks. Currently
- // this field should always be true since Google Compute Engine will
- // automatically create and manage subnetwork routes between two
- // networks when peering state is ACTIVE.
+ // ExchangeSubnetRoutes: Indicates whether full mesh connectivity is created
+ // and managed automatically between peered networks. Currently this field
+ // should always be true since Google Compute Engine will automatically create
+ // and manage subnetwork routes between two networks when peering state is
+ // ACTIVE.
ExchangeSubnetRoutes bool `json:"exchangeSubnetRoutes,omitempty"`
-
- // ExportCustomRoutes: Whether to export the custom routes to peer
- // network. The default value is false.
+ // ExportCustomRoutes: Whether to export the custom routes to peer network. The
+ // default value is false.
ExportCustomRoutes bool `json:"exportCustomRoutes,omitempty"`
-
- // ExportSubnetRoutesWithPublicIp: Whether subnet routes with public IP
- // range are exported. The default value is true, all subnet routes are
- // exported. IPv4 special-use ranges are always exported to peers and
- // are not controlled by this field.
+ // ExportSubnetRoutesWithPublicIp: Whether subnet routes with public IP range
+ // are exported. The default value is true, all subnet routes are exported.
+ // IPv4 special-use ranges are always exported to peers and are not controlled
+ // by this field.
ExportSubnetRoutesWithPublicIp bool `json:"exportSubnetRoutesWithPublicIp,omitempty"`
-
- // ImportCustomRoutes: Whether to import the custom routes from peer
- // network. The default value is false.
+ // ImportCustomRoutes: Whether to import the custom routes from peer network.
+ // The default value is false.
ImportCustomRoutes bool `json:"importCustomRoutes,omitempty"`
-
- // ImportSubnetRoutesWithPublicIp: Whether subnet routes with public IP
- // range are imported. The default value is false. IPv4 special-use
- // ranges are always imported from peers and are not controlled by this
- // field.
+ // ImportSubnetRoutesWithPublicIp: Whether subnet routes with public IP range
+ // are imported. The default value is false. IPv4 special-use ranges are always
+ // imported from peers and are not controlled by this field.
ImportSubnetRoutesWithPublicIp bool `json:"importSubnetRoutesWithPublicIp,omitempty"`
-
- // Name: Name of this peering. Provided by the client when the peering
- // is created. The name must comply with RFC1035. Specifically, the name
- // must be 1-63 characters long and match regular expression
+ // Name: Name of this peering. Provided by the client when the peering is
+ // created. The name must comply with RFC1035. Specifically, the name must be
+ // 1-63 characters long and match regular expression
// `[a-z]([-a-z0-9]*[a-z0-9])?`. The first character must be a lowercase
- // letter, and all the following characters must be a dash, lowercase
- // letter, or digit, except the last character, which cannot be a dash.
+ // letter, and all the following characters must be a dash, lowercase letter,
+ // or digit, except the last character, which cannot be a dash.
Name string `json:"name,omitempty"`
-
- // Network: The URL of the peer network. It can be either full URL or
- // partial URL. The peer network may belong to a different project. If
- // the partial URL does not contain project, it is assumed that the peer
- // network is in the same project as the current network.
+ // Network: The URL of the peer network. It can be either full URL or partial
+ // URL. The peer network may belong to a different project. If the partial URL
+ // does not contain project, it is assumed that the peer network is in the same
+ // project as the current network.
Network string `json:"network,omitempty"`
-
// PeerMtu: Maximum Transmission Unit in bytes.
PeerMtu int64 `json:"peerMtu,omitempty"`
-
- // StackType: Which IP version(s) of traffic and routes are allowed to
- // be imported or exported between peer networks. The default value is
- // IPV4_ONLY.
+ // StackType: Which IP version(s) of traffic and routes are allowed to be
+ // imported or exported between peer networks. The default value is IPV4_ONLY.
//
// Possible values:
// "IPV4_IPV6" - This Peering will allow IPv4 traffic and routes to be
- // exchanged. Additionally if the matching peering is IPV4_IPV6, IPv6
- // traffic and routes will be exchanged as well.
- // "IPV4_ONLY" - This Peering will only allow IPv4 traffic and routes
- // to be exchanged, even if the matching peering is IPV4_IPV6.
+ // exchanged. Additionally if the matching peering is IPV4_IPV6, IPv6 traffic
+ // and routes will be exchanged as well.
+ // "IPV4_ONLY" - This Peering will only allow IPv4 traffic and routes to be
+ // exchanged, even if the matching peering is IPV4_IPV6.
StackType string `json:"stackType,omitempty"`
-
- // State: [Output Only] State for the peering, either `ACTIVE` or
- // `INACTIVE`. The peering is `ACTIVE` when there's a matching
- // configuration in the peer network.
+ // State: [Output Only] State for the peering, either `ACTIVE` or `INACTIVE`.
+ // The peering is `ACTIVE` when there's a matching configuration in the peer
+ // network.
//
// Possible values:
// "ACTIVE" - Matching configuration exists on the peer.
- // "INACTIVE" - There is no matching configuration on the peer,
- // including the case when peer does not exist.
+ // "INACTIVE" - There is no matching configuration on the peer, including the
+ // case when peer does not exist.
State string `json:"state,omitempty"`
-
- // StateDetails: [Output Only] Details about the current state of the
- // peering.
+ // StateDetails: [Output Only] Details about the current state of the peering.
StateDetails string `json:"stateDetails,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "AutoCreateRoutes") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "AutoCreateRoutes") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "AutoCreateRoutes") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkPeering) MarshalJSON() ([]byte, error) {
+func (s NetworkPeering) MarshalJSON() ([]byte, error) {
type NoMethod NetworkPeering
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NetworkPerformanceConfig struct {
@@ -32430,847 +27662,687 @@ type NetworkPerformanceConfig struct {
// "DEFAULT"
// "TIER_1"
TotalEgressBandwidthTier string `json:"totalEgressBandwidthTier,omitempty"`
-
- // ForceSendFields is a list of field names (e.g.
- // "TotalEgressBandwidthTier") to unconditionally include in API
- // requests. By default, fields with empty or default 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. "TotalEgressBandwidthTier")
- // 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.
+ // ForceSendFields is a list of field names (e.g. "TotalEgressBandwidthTier")
+ // to unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "TotalEgressBandwidthTier") to
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkPerformanceConfig) MarshalJSON() ([]byte, error) {
+func (s NetworkPerformanceConfig) MarshalJSON() ([]byte, error) {
type NoMethod NetworkPerformanceConfig
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// NetworkRoutingConfig: A routing configuration attached to a network
-// resource. The message includes the list of routers associated with
-// the network, and a flag indicating the type of routing behavior to
-// enforce network-wide.
+// resource. The message includes the list of routers associated with the
+// network, and a flag indicating the type of routing behavior to enforce
+// network-wide.
type NetworkRoutingConfig struct {
- // RoutingMode: The network-wide routing mode to use. If set to
- // REGIONAL, this network's Cloud Routers will only advertise routes
- // with subnets of this network in the same region as the router. If set
- // to GLOBAL, this network's Cloud Routers will advertise routes with
- // all subnets of this network, across regions.
+ // RoutingMode: The network-wide routing mode to use. If set to REGIONAL, this
+ // network's Cloud Routers will only advertise routes with subnets of this
+ // network in the same region as the router. If set to GLOBAL, this network's
+ // Cloud Routers will advertise routes with all subnets of this network, across
+ // regions.
//
// Possible values:
// "GLOBAL"
// "REGIONAL"
RoutingMode string `json:"routingMode,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "RoutingMode") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "RoutingMode") 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. "RoutingMode") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworkRoutingConfig) MarshalJSON() ([]byte, error) {
+func (s NetworkRoutingConfig) MarshalJSON() ([]byte, error) {
type NoMethod NetworkRoutingConfig
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NetworksAddPeeringRequest struct {
// AutoCreateRoutes: This field will be deprecated soon. Use
- // exchange_subnet_routes in network_peering instead. Indicates whether
- // full mesh connectivity is created and managed automatically between
- // peered networks. Currently this field should always be true since
- // Google Compute Engine will automatically create and manage subnetwork
- // routes between two networks when peering state is ACTIVE.
+ // exchange_subnet_routes in network_peering instead. Indicates whether full
+ // mesh connectivity is created and managed automatically between peered
+ // networks. Currently this field should always be true since Google Compute
+ // Engine will automatically create and manage subnetwork routes between two
+ // networks when peering state is ACTIVE.
AutoCreateRoutes bool `json:"autoCreateRoutes,omitempty"`
-
// Name: Name of the peering, which should conform to RFC1035.
Name string `json:"name,omitempty"`
-
// NetworkPeering: Network peering parameters. In order to specify route
- // policies for peering using import and export custom routes, you must
- // specify all peering related parameters (name, peer network,
- // exchange_subnet_routes) in the network_peering field. The
- // corresponding fields in NetworksAddPeeringRequest will be deprecated
- // soon.
+ // policies for peering using import and export custom routes, you must specify
+ // all peering related parameters (name, peer network, exchange_subnet_routes)
+ // in the network_peering field. The corresponding fields in
+ // NetworksAddPeeringRequest will be deprecated soon.
NetworkPeering *NetworkPeering `json:"networkPeering,omitempty"`
-
- // PeerNetwork: URL of the peer network. It can be either full URL or
- // partial URL. The peer network may belong to a different project. If
- // the partial URL does not contain project, it is assumed that the peer
- // network is in the same project as the current network.
+ // PeerNetwork: URL of the peer network. It can be either full URL or partial
+ // URL. The peer network may belong to a different project. If the partial URL
+ // does not contain project, it is assumed that the peer network is in the same
+ // project as the current network.
PeerNetwork string `json:"peerNetwork,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "AutoCreateRoutes") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "AutoCreateRoutes") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "AutoCreateRoutes") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworksAddPeeringRequest) MarshalJSON() ([]byte, error) {
+func (s NetworksAddPeeringRequest) MarshalJSON() ([]byte, error) {
type NoMethod NetworksAddPeeringRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NetworksGetEffectiveFirewallsResponse struct {
- // FirewallPolicys: Effective firewalls from firewall policy.
+ // FirewallPolicys: [Output Only] Effective firewalls from firewall policy. It
+ // returns Global Network Firewall Policies and Hierarchical Firewall Policies.
+ // Use regionNetworkFirewallPolicies.getEffectiveFirewalls to get Regional
+ // Network Firewall Policies as well.
FirewallPolicys []*NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy `json:"firewallPolicys,omitempty"`
-
// Firewalls: Effective firewalls on the network.
Firewalls []*Firewall `json:"firewalls,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
// ForceSendFields is a list of field names (e.g. "FirewallPolicys") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "FirewallPolicys") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "FirewallPolicys") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworksGetEffectiveFirewallsResponse) MarshalJSON() ([]byte, error) {
+func (s NetworksGetEffectiveFirewallsResponse) MarshalJSON() ([]byte, error) {
type NoMethod NetworksGetEffectiveFirewallsResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy struct {
- // DisplayName: [Output Only] Deprecated, please use short name instead.
- // The display name of the firewall policy.
+ // DisplayName: [Output Only] Deprecated, please use short name instead. The
+ // display name of the firewall policy.
DisplayName string `json:"displayName,omitempty"`
-
// Name: [Output Only] The name of the firewall policy.
Name string `json:"name,omitempty"`
-
- // Rules: The rules that apply to the network.
+ // Priority: [Output only] Priority of firewall policy association. Not
+ // applicable for type=HIERARCHY.
+ Priority int64 `json:"priority,omitempty"`
+ // Rules: [Output Only] The rules that apply to the network.
Rules []*FirewallPolicyRule `json:"rules,omitempty"`
-
// ShortName: [Output Only] The short name of the firewall policy.
ShortName string `json:"shortName,omitempty"`
-
// Type: [Output Only] The type of the firewall policy.
//
// Possible values:
// "HIERARCHY"
// "NETWORK"
+ // "SYSTEM"
// "UNSPECIFIED"
Type string `json:"type,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "DisplayName") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
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. "DisplayName") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy) MarshalJSON() ([]byte, error) {
+func (s NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy) MarshalJSON() ([]byte, error) {
type NoMethod NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NetworksRemovePeeringRequest struct {
// Name: Name of the peering, which should conform to RFC1035.
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 or default 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 is a list of field names (e.g. "Name") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
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 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. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworksRemovePeeringRequest) MarshalJSON() ([]byte, error) {
+func (s NetworksRemovePeeringRequest) MarshalJSON() ([]byte, error) {
type NoMethod NetworksRemovePeeringRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NetworksUpdatePeeringRequest struct {
NetworkPeering *NetworkPeering `json:"networkPeering,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "NetworkPeering") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "NetworkPeering") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "NetworkPeering") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NetworksUpdatePeeringRequest) MarshalJSON() ([]byte, error) {
+func (s NetworksUpdatePeeringRequest) MarshalJSON() ([]byte, error) {
type NoMethod NetworksUpdatePeeringRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// NodeGroup: Represents a sole-tenant Node Group resource. A
-// sole-tenant node is a physical server that is dedicated to hosting VM
-// instances only for your specific project. Use sole-tenant nodes to
-// keep your instances physically separated from instances in other
-// projects, or to group your instances together on the same host
-// hardware. For more information, read Sole-tenant nodes.
+// NodeGroup: Represents a sole-tenant Node Group resource. A sole-tenant node
+// is a physical server that is dedicated to hosting VM instances only for your
+// specific project. Use sole-tenant nodes to keep your instances physically
+// separated from instances in other projects, or to group your instances
+// together on the same host hardware. For more information, read Sole-tenant
+// nodes.
type NodeGroup struct {
// AutoscalingPolicy: Specifies how autoscaling should behave.
AutoscalingPolicy *NodeGroupAutoscalingPolicy `json:"autoscalingPolicy,omitempty"`
-
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
Fingerprint string `json:"fingerprint,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
- // Kind: [Output Only] The type of the resource. Always
- // compute#nodeGroup for node group.
+ // Kind: [Output Only] The type of the resource. Always compute#nodeGroup for
+ // node group.
Kind string `json:"kind,omitempty"`
-
- // LocationHint: An opaque location hint used to place the Node close to
- // other resources. This field is for use by internal tools that use the
- // public API. The location hint here on the NodeGroup overrides any
- // location_hint present in the NodeTemplate.
+ // LocationHint: An opaque location hint used to place the Node close to other
+ // resources. This field is for use by internal tools that use the public API.
+ // The location hint here on the NodeGroup overrides any location_hint present
+ // in the NodeTemplate.
LocationHint string `json:"locationHint,omitempty"`
-
- // MaintenancePolicy: Specifies how to handle instances when a node in
- // the group undergoes maintenance. Set to one of: DEFAULT,
- // RESTART_IN_PLACE, or MIGRATE_WITHIN_NODE_GROUP. The default value is
- // DEFAULT. For more information, see Maintenance policies.
- //
- // Possible values:
- // "DEFAULT" - Allow the node and corresponding instances to retain
- // default maintenance behavior.
+ // MaintenanceInterval: Specifies the frequency of planned maintenance events.
+ // The accepted values are: `AS_NEEDED` and `RECURRENT`.
+ //
+ // Possible values:
+ // "AS_NEEDED" - VMs are eligible to receive infrastructure and hypervisor
+ // updates as they become available. This may result in more maintenance
+ // operations (live migrations or terminations) for the VM than the PERIODIC
+ // and RECURRENT options.
+ // "RECURRENT" - VMs receive infrastructure and hypervisor updates on a
+ // periodic basis, minimizing the number of maintenance operations (live
+ // migrations or terminations) on an individual VM. This may mean a VM will
+ // take longer to receive an update than if it was configured for AS_NEEDED.
+ // Security updates will still be applied as soon as they are available.
+ // RECURRENT is used for GEN3 and Slice of Hardware VMs.
+ MaintenanceInterval string `json:"maintenanceInterval,omitempty"`
+ // MaintenancePolicy: Specifies how to handle instances when a node in the
+ // group undergoes maintenance. Set to one of: DEFAULT, RESTART_IN_PLACE, or
+ // MIGRATE_WITHIN_NODE_GROUP. The default value is DEFAULT. For more
+ // information, see Maintenance policies.
+ //
+ // Possible values:
+ // "DEFAULT" - Allow the node and corresponding instances to retain default
+ // maintenance behavior.
// "MAINTENANCE_POLICY_UNSPECIFIED"
- // "MIGRATE_WITHIN_NODE_GROUP" - When maintenance must be done on a
- // node, the instances on that node will be moved to other nodes in the
- // group. Instances with onHostMaintenance = MIGRATE will live migrate
- // to their destinations while instances with onHostMaintenance =
- // TERMINATE will terminate and then restart on their destination nodes
- // if automaticRestart = true.
- // "RESTART_IN_PLACE" - Instances in this group will restart on the
- // same node when maintenance has completed. Instances must have
- // onHostMaintenance = TERMINATE, and they will only restart if
- // automaticRestart = true.
- MaintenancePolicy string `json:"maintenancePolicy,omitempty"`
-
+ // "MIGRATE_WITHIN_NODE_GROUP" - When maintenance must be done on a node, the
+ // instances on that node will be moved to other nodes in the group. Instances
+ // with onHostMaintenance = MIGRATE will live migrate to their destinations
+ // while instances with onHostMaintenance = TERMINATE will terminate and then
+ // restart on their destination nodes if automaticRestart = true.
+ // "RESTART_IN_PLACE" - Instances in this group will restart on the same node
+ // when maintenance has completed. Instances must have onHostMaintenance =
+ // TERMINATE, and they will only restart if automaticRestart = true.
+ MaintenancePolicy string `json:"maintenancePolicy,omitempty"`
MaintenanceWindow *NodeGroupMaintenanceWindow `json:"maintenanceWindow,omitempty"`
-
// Name: The name of the resource, provided by the client when initially
- // creating the resource. The resource name must be 1-63 characters
- // long, and comply with RFC1035. Specifically, the name must be 1-63
- // characters long and match the regular expression
- // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
- // a lowercase letter, and all following characters must be a dash,
- // lowercase letter, or digit, except the last character, which cannot
- // be a dash.
+ // creating the resource. The resource name must be 1-63 characters long, and
+ // comply with RFC1035. Specifically, the name must be 1-63 characters long and
+ // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the
+ // first character must be a lowercase letter, and all following characters
+ // must be a dash, lowercase letter, or digit, except the last character, which
+ // cannot be a dash.
Name string `json:"name,omitempty"`
-
// NodeTemplate: URL of the node template to create the node group from.
NodeTemplate string `json:"nodeTemplate,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
// ShareSettings: Share-settings for the node group
ShareSettings *ShareSettings `json:"shareSettings,omitempty"`
-
// Size: [Output Only] The total number of nodes in the node group.
Size int64 `json:"size,omitempty"`
-
// Possible values:
// "CREATING"
// "DELETING"
// "INVALID"
// "READY"
Status string `json:"status,omitempty"`
-
- // Zone: [Output Only] The name of the zone where the node group
- // resides, such as us-central1-a.
+ // Zone: [Output Only] The name of the zone where the node group resides, such
+ // as us-central1-a.
Zone string `json:"zone,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "AutoscalingPolicy")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "AutoscalingPolicy") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "AutoscalingPolicy") 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. "AutoscalingPolicy") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeGroup) MarshalJSON() ([]byte, error) {
+func (s NodeGroup) MarshalJSON() ([]byte, error) {
type NoMethod NodeGroup
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NodeGroupAggregatedList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of NodeGroupsScopedList resources.
Items map[string]NodeGroupsScopedList `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource.Always
- // compute#nodeGroupAggregatedList for aggregated lists of node groups.
+ // Kind: [Output Only] Type of resource.Always compute#nodeGroupAggregatedList
+ // for aggregated lists of node groups.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Unreachables: [Output Only] Unreachable resources.
Unreachables []string `json:"unreachables,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *NodeGroupAggregatedListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeGroupAggregatedList) MarshalJSON() ([]byte, error) {
+func (s NodeGroupAggregatedList) MarshalJSON() ([]byte, error) {
type NoMethod NodeGroupAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// NodeGroupAggregatedListWarning: [Output Only] Informational warning
-// message.
+// NodeGroupAggregatedListWarning: [Output Only] Informational warning message.
type NodeGroupAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*NodeGroupAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeGroupAggregatedListWarning) MarshalJSON() ([]byte, error) {
+func (s NodeGroupAggregatedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod NodeGroupAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NodeGroupAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeGroupAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+func (s NodeGroupAggregatedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod NodeGroupAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NodeGroupAutoscalingPolicy struct {
- // MaxNodes: The maximum number of nodes that the group should have.
- // Must be set if autoscaling is enabled. Maximum value allowed is 100.
+ // MaxNodes: The maximum number of nodes that the group should have. Must be
+ // set if autoscaling is enabled. Maximum value allowed is 100.
MaxNodes int64 `json:"maxNodes,omitempty"`
-
// MinNodes: The minimum number of nodes that the group should have.
MinNodes int64 `json:"minNodes,omitempty"`
-
- // Mode: The autoscaling mode. Set to one of: ON, OFF, or
- // ONLY_SCALE_OUT. For more information, see Autoscaler modes.
+ // Mode: The autoscaling mode. Set to one of: ON, OFF, or ONLY_SCALE_OUT. For
+ // more information, see Autoscaler modes.
//
// Possible values:
// "MODE_UNSPECIFIED"
// "OFF" - Autoscaling is disabled.
// "ON" - Autocaling is fully enabled.
- // "ONLY_SCALE_OUT" - Autoscaling will only scale out and will not
- // remove nodes.
+ // "ONLY_SCALE_OUT" - Autoscaling will only scale out and will not remove
+ // nodes.
Mode string `json:"mode,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "MaxNodes") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "MaxNodes") 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. "MaxNodes") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeGroupAutoscalingPolicy) MarshalJSON() ([]byte, error) {
+func (s NodeGroupAutoscalingPolicy) MarshalJSON() ([]byte, error) {
type NoMethod NodeGroupAutoscalingPolicy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// NodeGroupList: Contains a list of nodeGroups.
type NodeGroupList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of NodeGroup resources.
Items []*NodeGroup `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource.Always compute#nodeGroupList for
- // lists of node groups.
+ // Kind: [Output Only] Type of resource.Always compute#nodeGroupList for lists
+ // of node groups.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *NodeGroupListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeGroupList) MarshalJSON() ([]byte, error) {
+func (s NodeGroupList) MarshalJSON() ([]byte, error) {
type NoMethod NodeGroupList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// NodeGroupListWarning: [Output Only] Informational warning message.
type NodeGroupListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*NodeGroupListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeGroupListWarning) MarshalJSON() ([]byte, error) {
+func (s NodeGroupListWarning) MarshalJSON() ([]byte, error) {
type NoMethod NodeGroupListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NodeGroupListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeGroupListWarningData) MarshalJSON() ([]byte, error) {
+func (s NodeGroupListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod NodeGroupListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// NodeGroupMaintenanceWindow: Time window specified for daily
-// maintenance operations. GCE's internal maintenance will be performed
-// within this window.
+// NodeGroupMaintenanceWindow: Time window specified for daily maintenance
+// operations. GCE's internal maintenance will be performed within this window.
type NodeGroupMaintenanceWindow struct {
- // MaintenanceDuration: [Output only] A predetermined duration for the
- // window, automatically chosen to be the smallest possible in the given
- // scenario.
+ // MaintenanceDuration: [Output only] A predetermined duration for the window,
+ // automatically chosen to be the smallest possible in the given scenario.
MaintenanceDuration *Duration `json:"maintenanceDuration,omitempty"`
-
// StartTime: Start time of the window. This must be in UTC format that
- // resolves to one of 00:00, 04:00, 08:00, 12:00, 16:00, or 20:00. For
- // example, both 13:00-5 and 08:00 are valid.
+ // resolves to one of 00:00, 04:00, 08:00, 12:00, 16:00, or 20:00. For example,
+ // both 13:00-5 and 08:00 are valid.
StartTime string `json:"startTime,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "MaintenanceDuration")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "MaintenanceDuration") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "MaintenanceDuration") 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. "MaintenanceDuration") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeGroupMaintenanceWindow) MarshalJSON() ([]byte, error) {
+func (s NodeGroupMaintenanceWindow) MarshalJSON() ([]byte, error) {
type NoMethod NodeGroupMaintenanceWindow
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NodeGroupNode struct {
// Accelerators: Accelerators for this node.
Accelerators []*AcceleratorConfig `json:"accelerators,omitempty"`
-
// ConsumedResources: Node resources that are reserved by all instances.
ConsumedResources *InstanceConsumptionInfo `json:"consumedResources,omitempty"`
-
// CpuOvercommitType: CPU overcommit.
//
// Possible values:
@@ -33278,32 +28350,23 @@ type NodeGroupNode struct {
// "ENABLED"
// "NONE"
CpuOvercommitType string `json:"cpuOvercommitType,omitempty"`
-
// Disks: Local disk configurations.
Disks []*LocalDisk `json:"disks,omitempty"`
-
- // InstanceConsumptionData: Instance data that shows consumed resources
- // on the node.
+ // InstanceConsumptionData: Instance data that shows consumed resources on the
+ // node.
InstanceConsumptionData []*InstanceConsumptionData `json:"instanceConsumptionData,omitempty"`
-
// Instances: Instances scheduled on this node.
Instances []string `json:"instances,omitempty"`
-
// Name: The name of the node.
Name string `json:"name,omitempty"`
-
// NodeType: The type of this node.
NodeType string `json:"nodeType,omitempty"`
-
// SatisfiesPzs: [Output Only] Reserved for future use.
SatisfiesPzs bool `json:"satisfiesPzs,omitempty"`
-
// ServerBinding: Binding properties for the physical server.
ServerBinding *ServerBinding `json:"serverBinding,omitempty"`
-
// ServerId: Server ID associated with this node.
ServerId string `json:"serverId,omitempty"`
-
// Possible values:
// "CREATING"
// "DELETING"
@@ -33311,514 +28374,437 @@ type NodeGroupNode struct {
// "READY"
// "REPAIRING"
Status string `json:"status,omitempty"`
-
// TotalResources: Total amount of available resources on the node.
TotalResources *InstanceConsumptionInfo `json:"totalResources,omitempty"`
-
+ // UpcomingMaintenance: [Output Only] The information about an upcoming
+ // maintenance event.
+ UpcomingMaintenance *UpcomingMaintenance `json:"upcomingMaintenance,omitempty"`
// ForceSendFields is a list of field names (e.g. "Accelerators") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Accelerators") 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. "Accelerators") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeGroupNode) MarshalJSON() ([]byte, error) {
+func (s NodeGroupNode) MarshalJSON() ([]byte, error) {
type NoMethod NodeGroupNode
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NodeGroupsAddNodesRequest struct {
- // AdditionalNodeCount: Count of additional nodes to be added to the
- // node group.
+ // AdditionalNodeCount: Count of additional nodes to be added to the node
+ // group.
AdditionalNodeCount int64 `json:"additionalNodeCount,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "AdditionalNodeCount")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "AdditionalNodeCount") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "AdditionalNodeCount") 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. "AdditionalNodeCount") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeGroupsAddNodesRequest) MarshalJSON() ([]byte, error) {
+func (s NodeGroupsAddNodesRequest) MarshalJSON() ([]byte, error) {
type NoMethod NodeGroupsAddNodesRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NodeGroupsDeleteNodesRequest struct {
// Nodes: Names of the nodes to delete.
Nodes []string `json:"nodes,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Nodes") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Nodes") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Nodes") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeGroupsDeleteNodesRequest) MarshalJSON() ([]byte, error) {
+func (s NodeGroupsDeleteNodesRequest) MarshalJSON() ([]byte, error) {
type NoMethod NodeGroupsDeleteNodesRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NodeGroupsListNodes struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of Node resources.
Items []*NodeGroupNode `json:"items,omitempty"`
-
// Kind: [Output Only] The resource type, which is always
- // compute.nodeGroupsListNodes for the list of nodes in the specified
- // node group.
+ // compute.nodeGroupsListNodes for the list of nodes in the specified node
+ // group.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *NodeGroupsListNodesWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeGroupsListNodes) MarshalJSON() ([]byte, error) {
+func (s NodeGroupsListNodes) MarshalJSON() ([]byte, error) {
type NoMethod NodeGroupsListNodes
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// NodeGroupsListNodesWarning: [Output Only] Informational warning
-// message.
+// NodeGroupsListNodesWarning: [Output Only] Informational warning message.
type NodeGroupsListNodesWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*NodeGroupsListNodesWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeGroupsListNodesWarning) MarshalJSON() ([]byte, error) {
+func (s NodeGroupsListNodesWarning) MarshalJSON() ([]byte, error) {
type NoMethod NodeGroupsListNodesWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NodeGroupsListNodesWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeGroupsListNodesWarningData) MarshalJSON() ([]byte, error) {
+func (s NodeGroupsListNodesWarningData) MarshalJSON() ([]byte, error) {
type NoMethod NodeGroupsListNodesWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+type NodeGroupsPerformMaintenanceRequest struct {
+ // Nodes: [Required] List of nodes affected by the call.
+ Nodes []string `json:"nodes,omitempty"`
+ // StartTime: The start time of the schedule. The timestamp is an RFC3339
+ // string.
+ StartTime string `json:"startTime,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Nodes") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Nodes") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s NodeGroupsPerformMaintenanceRequest) MarshalJSON() ([]byte, error) {
+ type NoMethod NodeGroupsPerformMaintenanceRequest
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NodeGroupsScopedList struct {
- // NodeGroups: [Output Only] A list of node groups contained in this
- // scope.
+ // NodeGroups: [Output Only] A list of node groups contained in this scope.
NodeGroups []*NodeGroup `json:"nodeGroups,omitempty"`
-
// Warning: [Output Only] An informational warning that appears when the
// nodeGroup list is empty.
Warning *NodeGroupsScopedListWarning `json:"warning,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "NodeGroups") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "NodeGroups") 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. "NodeGroups") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeGroupsScopedList) MarshalJSON() ([]byte, error) {
+func (s NodeGroupsScopedList) MarshalJSON() ([]byte, error) {
type NoMethod NodeGroupsScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// NodeGroupsScopedListWarning: [Output Only] An informational warning
-// that appears when the nodeGroup list is empty.
+// NodeGroupsScopedListWarning: [Output Only] An informational warning that
+// appears when the nodeGroup list is empty.
type NodeGroupsScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*NodeGroupsScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeGroupsScopedListWarning) MarshalJSON() ([]byte, error) {
+func (s NodeGroupsScopedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod NodeGroupsScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NodeGroupsScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeGroupsScopedListWarningData) MarshalJSON() ([]byte, error) {
+func (s NodeGroupsScopedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod NodeGroupsScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NodeGroupsSetNodeTemplateRequest struct {
// NodeTemplate: Full or partial URL of the node template resource to be
// updated for this node group.
NodeTemplate string `json:"nodeTemplate,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "NodeTemplate") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "NodeTemplate") 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. "NodeTemplate") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeGroupsSetNodeTemplateRequest) MarshalJSON() ([]byte, error) {
+func (s NodeGroupsSetNodeTemplateRequest) MarshalJSON() ([]byte, error) {
type NoMethod NodeGroupsSetNodeTemplateRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NodeGroupsSimulateMaintenanceEventRequest struct {
// Nodes: Names of the nodes to go under maintenance simulation.
Nodes []string `json:"nodes,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Nodes") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Nodes") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Nodes") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeGroupsSimulateMaintenanceEventRequest) MarshalJSON() ([]byte, error) {
+func (s NodeGroupsSimulateMaintenanceEventRequest) MarshalJSON() ([]byte, error) {
type NoMethod NodeGroupsSimulateMaintenanceEventRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// NodeTemplate: Represent a sole-tenant Node Template resource. You can
-// use a template to define properties for nodes in a node group. For
-// more information, read Creating node groups and instances.
+// NodeTemplate: Represent a sole-tenant Node Template resource. You can use a
+// template to define properties for nodes in a node group. For more
+// information, read Creating node groups and instances.
type NodeTemplate struct {
Accelerators []*AcceleratorConfig `json:"accelerators,omitempty"`
-
// CpuOvercommitType: CPU overcommit.
//
// Possible values:
@@ -33826,63 +28812,47 @@ type NodeTemplate struct {
// "ENABLED"
// "NONE"
CpuOvercommitType string `json:"cpuOvercommitType,omitempty"`
-
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
- Description string `json:"description,omitempty"`
-
- Disks []*LocalDisk `json:"disks,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
+ Description string `json:"description,omitempty"`
+ Disks []*LocalDisk `json:"disks,omitempty"`
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
- // Kind: [Output Only] The type of the resource. Always
- // compute#nodeTemplate for node templates.
+ // Kind: [Output Only] The type of the resource. Always compute#nodeTemplate
+ // for node templates.
Kind string `json:"kind,omitempty"`
-
// Name: The name of the resource, provided by the client when initially
- // creating the resource. The resource name must be 1-63 characters
- // long, and comply with RFC1035. Specifically, the name must be 1-63
- // characters long and match the regular expression
- // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
- // a lowercase letter, and all following characters must be a dash,
- // lowercase letter, or digit, except the last character, which cannot
- // be a dash.
+ // creating the resource. The resource name must be 1-63 characters long, and
+ // comply with RFC1035. Specifically, the name must be 1-63 characters long and
+ // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the
+ // first character must be a lowercase letter, and all following characters
+ // must be a dash, lowercase letter, or digit, except the last character, which
+ // cannot be a dash.
Name string `json:"name,omitempty"`
-
- // NodeAffinityLabels: Labels to use for node affinity, which will be
- // used in instance scheduling.
+ // NodeAffinityLabels: Labels to use for node affinity, which will be used in
+ // instance scheduling.
NodeAffinityLabels map[string]string `json:"nodeAffinityLabels,omitempty"`
-
- // NodeType: The node type to use for nodes group that are created from
- // this template.
+ // NodeType: The node type to use for nodes group that are created from this
+ // template.
NodeType string `json:"nodeType,omitempty"`
-
// NodeTypeFlexibility: Do not use. Instead, use the node_type property.
NodeTypeFlexibility *NodeTemplateNodeTypeFlexibility `json:"nodeTypeFlexibility,omitempty"`
-
// Region: [Output Only] The name of the region where the node template
// resides, such as us-central1.
Region string `json:"region,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // ServerBinding: Sets the binding properties for the physical server.
- // Valid values include: - *[Default]* RESTART_NODE_ON_ANY_SERVER:
- // Restarts VMs on any available physical server -
- // RESTART_NODE_ON_MINIMAL_SERVER: Restarts VMs on the same physical
- // server whenever possible See Sole-tenant node options for more
- // information.
+ // ServerBinding: Sets the binding properties for the physical server. Valid
+ // values include: - *[Default]* RESTART_NODE_ON_ANY_SERVER: Restarts VMs on
+ // any available physical server - RESTART_NODE_ON_MINIMAL_SERVER: Restarts VMs
+ // on the same physical server whenever possible See Sole-tenant node options
+ // for more information.
ServerBinding *ServerBinding `json:"serverBinding,omitempty"`
-
- // Status: [Output Only] The status of the node template. One of the
- // following values: CREATING, READY, and DELETING.
+ // Status: [Output Only] The status of the node template. One of the following
+ // values: CREATING, READY, and DELETING.
//
// Possible values:
// "CREATING" - Resources are being allocated.
@@ -33890,2646 +28860,2108 @@ type NodeTemplate struct {
// "INVALID" - Invalid status.
// "READY" - The node template is ready.
Status string `json:"status,omitempty"`
-
- // StatusMessage: [Output Only] An optional, human-readable explanation
- // of the status.
+ // StatusMessage: [Output Only] An optional, human-readable explanation of the
+ // status.
StatusMessage string `json:"statusMessage,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
// ForceSendFields is a list of field names (e.g. "Accelerators") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Accelerators") 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. "Accelerators") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeTemplate) MarshalJSON() ([]byte, error) {
+func (s NodeTemplate) MarshalJSON() ([]byte, error) {
type NoMethod NodeTemplate
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NodeTemplateAggregatedList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of NodeTemplatesScopedList resources.
Items map[string]NodeTemplatesScopedList `json:"items,omitempty"`
-
// Kind: [Output Only] Type of resource.Always
- // compute#nodeTemplateAggregatedList for aggregated lists of node
- // templates.
+ // compute#nodeTemplateAggregatedList for aggregated lists of node templates.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Unreachables: [Output Only] Unreachable resources.
Unreachables []string `json:"unreachables,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *NodeTemplateAggregatedListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeTemplateAggregatedList) MarshalJSON() ([]byte, error) {
+func (s NodeTemplateAggregatedList) MarshalJSON() ([]byte, error) {
type NoMethod NodeTemplateAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// NodeTemplateAggregatedListWarning: [Output Only] Informational
-// warning message.
+// NodeTemplateAggregatedListWarning: [Output Only] Informational warning
+// message.
type NodeTemplateAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*NodeTemplateAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeTemplateAggregatedListWarning) MarshalJSON() ([]byte, error) {
+func (s NodeTemplateAggregatedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod NodeTemplateAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NodeTemplateAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeTemplateAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+func (s NodeTemplateAggregatedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod NodeTemplateAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// NodeTemplateList: Contains a list of node templates.
type NodeTemplateList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of NodeTemplate resources.
Items []*NodeTemplate `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource.Always compute#nodeTemplateList
- // for lists of node templates.
+ // Kind: [Output Only] Type of resource.Always compute#nodeTemplateList for
+ // lists of node templates.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *NodeTemplateListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeTemplateList) MarshalJSON() ([]byte, error) {
+func (s NodeTemplateList) MarshalJSON() ([]byte, error) {
type NoMethod NodeTemplateList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// NodeTemplateListWarning: [Output Only] Informational warning message.
type NodeTemplateListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*NodeTemplateListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeTemplateListWarning) MarshalJSON() ([]byte, error) {
+func (s NodeTemplateListWarning) MarshalJSON() ([]byte, error) {
type NoMethod NodeTemplateListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NodeTemplateListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeTemplateListWarningData) MarshalJSON() ([]byte, error) {
+func (s NodeTemplateListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod NodeTemplateListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NodeTemplateNodeTypeFlexibility struct {
- Cpus string `json:"cpus,omitempty"`
-
+ Cpus string `json:"cpus,omitempty"`
LocalSsd string `json:"localSsd,omitempty"`
-
- Memory string `json:"memory,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Cpus") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ Memory string `json:"memory,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Cpus") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Cpus") 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. "Cpus") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeTemplateNodeTypeFlexibility) MarshalJSON() ([]byte, error) {
+func (s NodeTemplateNodeTypeFlexibility) MarshalJSON() ([]byte, error) {
type NoMethod NodeTemplateNodeTypeFlexibility
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NodeTemplatesScopedList struct {
- // NodeTemplates: [Output Only] A list of node templates contained in
- // this scope.
+ // NodeTemplates: [Output Only] A list of node templates contained in this
+ // scope.
NodeTemplates []*NodeTemplate `json:"nodeTemplates,omitempty"`
-
- // Warning: [Output Only] An informational warning that appears when the
- // node templates list is empty.
+ // Warning: [Output Only] An informational warning that appears when the node
+ // templates list is empty.
Warning *NodeTemplatesScopedListWarning `json:"warning,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "NodeTemplates") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "NodeTemplates") 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. "NodeTemplates") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeTemplatesScopedList) MarshalJSON() ([]byte, error) {
+func (s NodeTemplatesScopedList) MarshalJSON() ([]byte, error) {
type NoMethod NodeTemplatesScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// NodeTemplatesScopedListWarning: [Output Only] An informational
-// warning that appears when the node templates list is empty.
+// NodeTemplatesScopedListWarning: [Output Only] An informational warning that
+// appears when the node templates list is empty.
type NodeTemplatesScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*NodeTemplatesScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeTemplatesScopedListWarning) MarshalJSON() ([]byte, error) {
+func (s NodeTemplatesScopedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod NodeTemplatesScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NodeTemplatesScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeTemplatesScopedListWarningData) MarshalJSON() ([]byte, error) {
+func (s NodeTemplatesScopedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod NodeTemplatesScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// NodeType: Represent a sole-tenant Node Type resource. Each node
-// within a node group must have a node type. A node type specifies the
-// total amount of cores and memory for that node. Currently, the only
-// available node type is n1-node-96-624 node type that has 96 vCPUs and
-// 624 GB of memory, available in multiple zones. For more information
-// read Node types.
+// NodeType: Represent a sole-tenant Node Type resource. Each node within a
+// node group must have a node type. A node type specifies the total amount of
+// cores and memory for that node. Currently, the only available node type is
+// n1-node-96-624 node type that has 96 vCPUs and 624 GB of memory, available
+// in multiple zones. For more information read Node types.
type NodeType struct {
// CpuPlatform: [Output Only] The CPU platform used by this node type.
CpuPlatform string `json:"cpuPlatform,omitempty"`
-
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Deprecated -- [Output Only] The deprecation status associated with
- // this node type.
+ // Deprecated -- [Output Only] The deprecation status associated with this node
+ // type.
Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
-
- // Description: [Output Only] An optional textual description of the
- // resource.
+ // Description: [Output Only] An optional textual description of the resource.
Description string `json:"description,omitempty"`
-
- // GuestCpus: [Output Only] The number of virtual CPUs that are
- // available to the node type.
+ // GuestCpus: [Output Only] The number of virtual CPUs that are available to
+ // the node type.
GuestCpus int64 `json:"guestCpus,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
- // Kind: [Output Only] The type of the resource. Always compute#nodeType
- // for node types.
+ // Kind: [Output Only] The type of the resource. Always compute#nodeType for
+ // node types.
Kind string `json:"kind,omitempty"`
-
- // LocalSsdGb: [Output Only] Local SSD available to the node type,
- // defined in GB.
+ // LocalSsdGb: [Output Only] Local SSD available to the node type, defined in
+ // GB.
LocalSsdGb int64 `json:"localSsdGb,omitempty"`
-
- // MemoryMb: [Output Only] The amount of physical memory available to
- // the node type, defined in MB.
+ // MemoryMb: [Output Only] The amount of physical memory available to the node
+ // type, defined in MB.
MemoryMb int64 `json:"memoryMb,omitempty"`
-
// Name: [Output Only] Name of the resource.
Name string `json:"name,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // Zone: [Output Only] The name of the zone where the node type resides,
- // such as us-central1-a.
+ // Zone: [Output Only] The name of the zone where the node type resides, such
+ // as us-central1-a.
Zone string `json:"zone,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
// ForceSendFields is a list of field names (e.g. "CpuPlatform") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CpuPlatform") 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. "CpuPlatform") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeType) MarshalJSON() ([]byte, error) {
+func (s NodeType) MarshalJSON() ([]byte, error) {
type NoMethod NodeType
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NodeTypeAggregatedList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of NodeTypesScopedList resources.
Items map[string]NodeTypesScopedList `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource.Always
- // compute#nodeTypeAggregatedList for aggregated lists of node types.
+ // Kind: [Output Only] Type of resource.Always compute#nodeTypeAggregatedList
+ // for aggregated lists of node types.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Unreachables: [Output Only] Unreachable resources.
Unreachables []string `json:"unreachables,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *NodeTypeAggregatedListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeTypeAggregatedList) MarshalJSON() ([]byte, error) {
+func (s NodeTypeAggregatedList) MarshalJSON() ([]byte, error) {
type NoMethod NodeTypeAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// NodeTypeAggregatedListWarning: [Output Only] Informational warning
-// message.
+// NodeTypeAggregatedListWarning: [Output Only] Informational warning message.
type NodeTypeAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*NodeTypeAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
+func (s NodeTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod NodeTypeAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NodeTypeAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+func (s NodeTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod NodeTypeAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// NodeTypeList: Contains a list of node types.
type NodeTypeList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of NodeType resources.
Items []*NodeType `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource.Always compute#nodeTypeList for
- // lists of node types.
+ // Kind: [Output Only] Type of resource.Always compute#nodeTypeList for lists
+ // of node types.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *NodeTypeListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeTypeList) MarshalJSON() ([]byte, error) {
+func (s NodeTypeList) MarshalJSON() ([]byte, error) {
type NoMethod NodeTypeList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// NodeTypeListWarning: [Output Only] Informational warning message.
type NodeTypeListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*NodeTypeListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeTypeListWarning) MarshalJSON() ([]byte, error) {
+func (s NodeTypeListWarning) MarshalJSON() ([]byte, error) {
type NoMethod NodeTypeListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NodeTypeListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeTypeListWarningData) MarshalJSON() ([]byte, error) {
+func (s NodeTypeListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod NodeTypeListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NodeTypesScopedList struct {
- // NodeTypes: [Output Only] A list of node types contained in this
- // scope.
+ // NodeTypes: [Output Only] A list of node types contained in this scope.
NodeTypes []*NodeType `json:"nodeTypes,omitempty"`
-
- // Warning: [Output Only] An informational warning that appears when the
- // node types list is empty.
+ // Warning: [Output Only] An informational warning that appears when the node
+ // types list is empty.
Warning *NodeTypesScopedListWarning `json:"warning,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "NodeTypes") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "NodeTypes") 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. "NodeTypes") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeTypesScopedList) MarshalJSON() ([]byte, error) {
+func (s NodeTypesScopedList) MarshalJSON() ([]byte, error) {
type NoMethod NodeTypesScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// NodeTypesScopedListWarning: [Output Only] An informational warning
-// that appears when the node types list is empty.
+// NodeTypesScopedListWarning: [Output Only] An informational warning that
+// appears when the node types list is empty.
type NodeTypesScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*NodeTypesScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeTypesScopedListWarning) MarshalJSON() ([]byte, error) {
+func (s NodeTypesScopedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod NodeTypesScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NodeTypesScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NodeTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
+func (s NodeTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod NodeTypesScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// NotificationEndpoint: Represents a notification endpoint. A
-// notification endpoint resource defines an endpoint to receive
-// notifications when there are status changes detected by the
-// associated health check service. For more information, see Health
-// checks overview.
+// NotificationEndpoint: Represents a notification endpoint. A notification
+// endpoint resource defines an endpoint to receive notifications when there
+// are status changes detected by the associated health check service. For more
+// information, see Health checks overview.
type NotificationEndpoint struct {
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // GrpcSettings: Settings of the gRPC notification endpoint including
- // the endpoint URL and the retry duration.
+ // GrpcSettings: Settings of the gRPC notification endpoint including the
+ // endpoint URL and the retry duration.
GrpcSettings *NotificationEndpointGrpcSettings `json:"grpcSettings,omitempty"`
-
- // Id: [Output Only] A unique identifier for this resource type. The
- // server generates this identifier.
+ // Id: [Output Only] A unique identifier for this resource type. The server
+ // generates this identifier.
Id uint64 `json:"id,omitempty,string"`
-
// Kind: [Output Only] Type of the resource. Always
// compute#notificationEndpoint for notification endpoints.
Kind string `json:"kind,omitempty"`
-
- // Name: Name of the resource. Provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
- // the first character must be a lowercase letter, and all following
- // characters must be a dash, lowercase letter, or digit, except the
- // last character, which cannot be a dash.
+ // Name: Name of the resource. Provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must
+ // be a lowercase letter, and all following characters must be a dash,
+ // lowercase letter, or digit, except the last character, which cannot be a
+ // dash.
Name string `json:"name,omitempty"`
-
- // Region: [Output Only] URL of the region where the notification
- // endpoint resides. This field applies only to the regional resource.
- // You must specify this field as part of the HTTP request URL. It is
- // not settable as a field in the request body.
+ // Region: [Output Only] URL of the region where the notification endpoint
+ // resides. This field applies only to the regional resource. You must specify
+ // this field as part of the HTTP request URL. It is not settable as a field in
+ // the request body.
Region string `json:"region,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "CreationTimestamp") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CreationTimestamp") 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. "CreationTimestamp") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NotificationEndpoint) MarshalJSON() ([]byte, error) {
+func (s NotificationEndpoint) MarshalJSON() ([]byte, error) {
type NoMethod NotificationEndpoint
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// NotificationEndpointGrpcSettings: Represents a gRPC setting that
-// describes one gRPC notification endpoint and the retry duration
-// attempting to send notification to this endpoint.
+// NotificationEndpointGrpcSettings: Represents a gRPC setting that describes
+// one gRPC notification endpoint and the retry duration attempting to send
+// notification to this endpoint.
type NotificationEndpointGrpcSettings struct {
- // Authority: Optional. If specified, this field is used to set the
- // authority header by the sender of notifications. See
+ // Authority: Optional. If specified, this field is used to set the authority
+ // header by the sender of notifications. See
// https://tools.ietf.org/html/rfc7540#section-8.1.2.3
Authority string `json:"authority,omitempty"`
-
- // Endpoint: Endpoint to which gRPC notifications are sent. This must be
- // a valid gRPCLB DNS name.
+ // Endpoint: Endpoint to which gRPC notifications are sent. This must be a
+ // valid gRPCLB DNS name.
Endpoint string `json:"endpoint,omitempty"`
-
- // PayloadName: Optional. If specified, this field is used to populate
- // the "name" field in gRPC requests.
+ // PayloadName: Optional. If specified, this field is used to populate the
+ // "name" field in gRPC requests.
PayloadName string `json:"payloadName,omitempty"`
-
- // ResendInterval: Optional. This field is used to configure how often
- // to send a full update of all non-healthy backends. If unspecified,
- // full updates are not sent. If specified, must be in the range between
- // 600 seconds to 3600 seconds. Nanos are disallowed. Can only be set
- // for regional notification endpoints.
+ // ResendInterval: Optional. This field is used to configure how often to send
+ // a full update of all non-healthy backends. If unspecified, full updates are
+ // not sent. If specified, must be in the range between 600 seconds to 3600
+ // seconds. Nanos are disallowed. Can only be set for regional notification
+ // endpoints.
ResendInterval *Duration `json:"resendInterval,omitempty"`
-
// RetryDurationSec: How much time (in seconds) is spent attempting
- // notification retries until a successful response is received. Default
- // is 30s. Limit is 20m (1200s). Must be a positive number.
+ // notification retries until a successful response is received. Default is
+ // 30s. Limit is 20m (1200s). Must be a positive number.
RetryDurationSec int64 `json:"retryDurationSec,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Authority") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Authority") 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. "Authority") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NotificationEndpointGrpcSettings) MarshalJSON() ([]byte, error) {
+func (s NotificationEndpointGrpcSettings) MarshalJSON() ([]byte, error) {
type NoMethod NotificationEndpointGrpcSettings
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NotificationEndpointList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of NotificationEndpoint resources.
Items []*NotificationEndpoint `json:"items,omitempty"`
-
// Kind: [Output Only] Type of the resource. Always
// compute#notificationEndpoint for notification endpoints.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
- NextPageToken string `json:"nextPageToken,omitempty"`
-
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
+ NextPageToken string `json:"nextPageToken,omitempty"`
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *NotificationEndpointListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NotificationEndpointList) MarshalJSON() ([]byte, error) {
+func (s NotificationEndpointList) MarshalJSON() ([]byte, error) {
type NoMethod NotificationEndpointList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// NotificationEndpointListWarning: [Output Only] Informational warning
// message.
type NotificationEndpointListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*NotificationEndpointListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NotificationEndpointListWarning) MarshalJSON() ([]byte, error) {
+func (s NotificationEndpointListWarning) MarshalJSON() ([]byte, error) {
type NoMethod NotificationEndpointListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type NotificationEndpointListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *NotificationEndpointListWarningData) MarshalJSON() ([]byte, error) {
+func (s NotificationEndpointListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod NotificationEndpointListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// Operation: Represents an Operation resource. Google Compute Engine
-// has three Operation resources: * Global
+// Operation: Represents an Operation resource. Google Compute Engine has three
+// Operation resources: * Global
// (/compute/docs/reference/rest/v1/globalOperations) * Regional
// (/compute/docs/reference/rest/v1/regionOperations) * Zonal
-// (/compute/docs/reference/rest/v1/zoneOperations) You can use an
-// operation resource to manage asynchronous API requests. For more
-// information, read Handling API responses. Operations can be global,
-// regional or zonal. - For global operations, use the
-// `globalOperations` resource. - For regional operations, use the
-// `regionOperations` resource. - For zonal operations, use the
-// `zoneOperations` resource. For more information, read Global,
-// Regional, and Zonal Resources. Note that completed Operation
-// resources have a limited retention period.
+// (/compute/docs/reference/rest/v1/zoneOperations) You can use an operation
+// resource to manage asynchronous API requests. For more information, read
+// Handling API responses. Operations can be global, regional or zonal. - For
+// global operations, use the `globalOperations` resource. - For regional
+// operations, use the `regionOperations` resource. - For zonal operations, use
+// the `zoneOperations` resource. For more information, read Global, Regional,
+// and Zonal Resources. Note that completed Operation resources have a limited
+// retention period.
type Operation struct {
- // ClientOperationId: [Output Only] The value of `requestId` if you
- // provided it in the request. Not present otherwise.
+ // ClientOperationId: [Output Only] The value of `requestId` if you provided it
+ // in the request. Not present otherwise.
ClientOperationId string `json:"clientOperationId,omitempty"`
-
// CreationTimestamp: [Deprecated] This field is deprecated.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Description: [Output Only] A textual description of the operation,
- // which is set when the operation is created.
+ // Description: [Output Only] A textual description of the operation, which is
+ // set when the operation is created.
Description string `json:"description,omitempty"`
-
- // EndTime: [Output Only] The time that this operation was completed.
- // This value is in RFC3339 text format.
+ // EndTime: [Output Only] The time that this operation was completed. This
+ // value is in RFC3339 text format.
EndTime string `json:"endTime,omitempty"`
-
// Error: [Output Only] If errors are generated during processing of the
// operation, this field will be populated.
Error *OperationError `json:"error,omitempty"`
-
- // HttpErrorMessage: [Output Only] If the operation fails, this field
- // contains the HTTP error message that was returned, such as `NOT
- // FOUND`.
+ // HttpErrorMessage: [Output Only] If the operation fails, this field contains
+ // the HTTP error message that was returned, such as `NOT FOUND`.
HttpErrorMessage string `json:"httpErrorMessage,omitempty"`
-
// HttpErrorStatusCode: [Output Only] If the operation fails, this field
- // contains the HTTP error status code that was returned. For example, a
- // `404` means the resource was not found.
+ // contains the HTTP error status code that was returned. For example, a `404`
+ // means the resource was not found.
HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"`
-
- // Id: [Output Only] The unique identifier for the operation. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the operation. This identifier
+ // is defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
- // InsertTime: [Output Only] The time that this operation was requested.
- // This value is in RFC3339 text format.
- InsertTime string `json:"insertTime,omitempty"`
-
+ // InsertTime: [Output Only] The time that this operation was requested. This
+ // value is in RFC3339 text format.
+ InsertTime string `json:"insertTime,omitempty"`
InstancesBulkInsertOperationMetadata *InstancesBulkInsertOperationMetadata `json:"instancesBulkInsertOperationMetadata,omitempty"`
-
- // Kind: [Output Only] Type of the resource. Always `compute#operation`
- // for Operation resources.
+ // Kind: [Output Only] Type of the resource. Always `compute#operation` for
+ // Operation resources.
Kind string `json:"kind,omitempty"`
-
// Name: [Output Only] Name of the operation.
Name string `json:"name,omitempty"`
-
- // OperationGroupId: [Output Only] An ID that represents a group of
- // operations, such as when a group of operations results from a
- // `bulkInsert` API request.
+ // OperationGroupId: [Output Only] An ID that represents a group of operations,
+ // such as when a group of operations results from a `bulkInsert` API request.
OperationGroupId string `json:"operationGroupId,omitempty"`
-
// OperationType: [Output Only] The type of operation, such as `insert`,
// `update`, or `delete`, and so on.
OperationType string `json:"operationType,omitempty"`
-
- // Progress: [Output Only] An optional progress indicator that ranges
- // from 0 to 100. There is no requirement that this be linear or support
- // any granularity of operations. This should not be used to guess when
- // the operation will be complete. This number should monotonically
- // increase as the operation progresses.
+ // Progress: [Output Only] An optional progress indicator that ranges from 0 to
+ // 100. There is no requirement that this be linear or support any granularity
+ // of operations. This should not be used to guess when the operation will be
+ // complete. This number should monotonically increase as the operation
+ // progresses.
Progress int64 `json:"progress,omitempty"`
-
- // Region: [Output Only] The URL of the region where the operation
- // resides. Only applicable when performing regional operations.
+ // Region: [Output Only] The URL of the region where the operation resides.
+ // Only applicable when performing regional operations.
Region string `json:"region,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // SetCommonInstanceMetadataOperationMetadata: [Output Only] If the
- // operation is for projects.setCommonInstanceMetadata, this field will
- // contain information on all underlying zonal actions and their state.
+ // SetCommonInstanceMetadataOperationMetadata: [Output Only] If the operation
+ // is for projects.setCommonInstanceMetadata, this field will contain
+ // information on all underlying zonal actions and their state.
SetCommonInstanceMetadataOperationMetadata *SetCommonInstanceMetadataOperationMetadata `json:"setCommonInstanceMetadataOperationMetadata,omitempty"`
-
- // StartTime: [Output Only] The time that this operation was started by
- // the server. This value is in RFC3339 text format.
+ // StartTime: [Output Only] The time that this operation was started by the
+ // server. This value is in RFC3339 text format.
StartTime string `json:"startTime,omitempty"`
-
- // Status: [Output Only] The status of the operation, which can be one
- // of the following: `PENDING`, `RUNNING`, or `DONE`.
+ // Status: [Output Only] The status of the operation, which can be one of the
+ // following: `PENDING`, `RUNNING`, or `DONE`.
//
// Possible values:
// "DONE"
// "PENDING"
// "RUNNING"
Status string `json:"status,omitempty"`
-
- // StatusMessage: [Output Only] An optional textual description of the
- // current status of the operation.
+ // StatusMessage: [Output Only] An optional textual description of the current
+ // status of the operation.
StatusMessage string `json:"statusMessage,omitempty"`
-
- // TargetId: [Output Only] The unique target ID, which identifies a
- // specific incarnation of the target resource.
+ // TargetId: [Output Only] The unique target ID, which identifies a specific
+ // incarnation of the target resource.
TargetId uint64 `json:"targetId,omitempty,string"`
-
// TargetLink: [Output Only] The URL of the resource that the operation
- // modifies. For operations related to creating a snapshot, this points
- // to the persistent disk that the snapshot was created from.
+ // modifies. For operations related to creating a snapshot, this points to the
+ // disk that the snapshot was created from.
TargetLink string `json:"targetLink,omitempty"`
-
// User: [Output Only] User who requested the operation, for example:
// `user@example.com` or `alice_smith_identifier
// (global/workforcePools/example-com-us-employees)`.
User string `json:"user,omitempty"`
-
- // Warnings: [Output Only] If warning messages are generated during
- // processing of the operation, this field will be populated.
+ // Warnings: [Output Only] If warning messages are generated during processing
+ // of the operation, this field will be populated.
Warnings []*OperationWarnings `json:"warnings,omitempty"`
-
- // Zone: [Output Only] The URL of the zone where the operation resides.
- // Only applicable when performing per-zone operations.
+ // Zone: [Output Only] The URL of the zone where the operation resides. Only
+ // applicable when performing per-zone operations.
Zone string `json:"zone,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "ClientOperationId")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "ClientOperationId") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "ClientOperationId") 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. "ClientOperationId") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *Operation) MarshalJSON() ([]byte, error) {
+func (s Operation) MarshalJSON() ([]byte, error) {
type NoMethod Operation
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// OperationError: [Output Only] If errors are generated during
-// processing of the operation, this field will be populated.
+// OperationError: [Output Only] If errors are generated during processing of
+// the operation, this field will be populated.
type OperationError struct {
- // Errors: [Output Only] The array of errors encountered while
- // processing this operation.
+ // Errors: [Output Only] The array of errors encountered while processing this
+ // operation.
Errors []*OperationErrorErrors `json:"errors,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Errors") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Errors") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Errors") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *OperationError) MarshalJSON() ([]byte, error) {
+func (s OperationError) MarshalJSON() ([]byte, error) {
type NoMethod OperationError
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type OperationErrorErrors struct {
// Code: [Output Only] The error type identifier for this error.
Code string `json:"code,omitempty"`
-
- // ErrorDetails: [Output Only] An optional list of messages that contain
- // the error details. There is a set of defined message types to use for
- // providing details.The syntax depends on the error code. For example,
- // QuotaExceededInfo will have details when the error code is
- // QUOTA_EXCEEDED.
+ // ErrorDetails: [Output Only] An optional list of messages that contain the
+ // error details. There is a set of defined message types to use for providing
+ // details.The syntax depends on the error code. For example, QuotaExceededInfo
+ // will have details when the error code is QUOTA_EXCEEDED.
ErrorDetails []*OperationErrorErrorsErrorDetails `json:"errorDetails,omitempty"`
-
- // Location: [Output Only] Indicates the field in the request that
- // caused the error. This property is optional.
+ // Location: [Output Only] Indicates the field in the request that caused the
+ // error. This property is optional.
Location string `json:"location,omitempty"`
-
// Message: [Output Only] An optional, human-readable error message.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *OperationErrorErrors) MarshalJSON() ([]byte, error) {
+func (s OperationErrorErrors) MarshalJSON() ([]byte, error) {
type NoMethod OperationErrorErrors
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type OperationErrorErrorsErrorDetails struct {
- ErrorInfo *ErrorInfo `json:"errorInfo,omitempty"`
-
- Help *Help `json:"help,omitempty"`
-
- LocalizedMessage *LocalizedMessage `json:"localizedMessage,omitempty"`
-
- QuotaInfo *QuotaExceededInfo `json:"quotaInfo,omitempty"`
-
+ ErrorInfo *ErrorInfo `json:"errorInfo,omitempty"`
+ Help *Help `json:"help,omitempty"`
+ LocalizedMessage *LocalizedMessage `json:"localizedMessage,omitempty"`
+ QuotaInfo *QuotaExceededInfo `json:"quotaInfo,omitempty"`
// ForceSendFields is a list of field names (e.g. "ErrorInfo") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "ErrorInfo") 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. "ErrorInfo") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *OperationErrorErrorsErrorDetails) MarshalJSON() ([]byte, error) {
+func (s OperationErrorErrorsErrorDetails) MarshalJSON() ([]byte, error) {
type NoMethod OperationErrorErrorsErrorDetails
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type OperationWarnings struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*OperationWarningsData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *OperationWarnings) MarshalJSON() ([]byte, error) {
+func (s OperationWarnings) MarshalJSON() ([]byte, error) {
type NoMethod OperationWarnings
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type OperationWarningsData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *OperationWarningsData) MarshalJSON() ([]byte, error) {
+func (s OperationWarningsData) MarshalJSON() ([]byte, error) {
type NoMethod OperationWarningsData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type OperationAggregatedList struct {
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id string `json:"id,omitempty"`
-
// Items: [Output Only] A map of scoped operation lists.
Items map[string]OperationsScopedList `json:"items,omitempty"`
-
// Kind: [Output Only] Type of resource. Always
// `compute#operationAggregatedList` for aggregated lists of operations.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than `maxResults`, use the `nextPageToken` as a value for the query
- // parameter `pageToken` in the next list request. Subsequent list
- // requests will have their own `nextPageToken` to continue paging
- // through the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // `maxResults`, use the `nextPageToken` as a value for the query parameter
+ // `pageToken` in the next list request. Subsequent list requests will have
+ // their own `nextPageToken` to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Unreachables: [Output Only] Unreachable resources.
Unreachables []string `json:"unreachables,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *OperationAggregatedListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *OperationAggregatedList) MarshalJSON() ([]byte, error) {
+func (s OperationAggregatedList) MarshalJSON() ([]byte, error) {
type NoMethod OperationAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// OperationAggregatedListWarning: [Output Only] Informational warning
-// message.
+// OperationAggregatedListWarning: [Output Only] Informational warning message.
type OperationAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*OperationAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *OperationAggregatedListWarning) MarshalJSON() ([]byte, error) {
+func (s OperationAggregatedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod OperationAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type OperationAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *OperationAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+func (s OperationAggregatedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod OperationAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// OperationList: Contains a list of Operation resources.
type OperationList struct {
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id string `json:"id,omitempty"`
-
// Items: [Output Only] A list of Operation resources.
Items []*Operation `json:"items,omitempty"`
-
// Kind: [Output Only] Type of resource. Always `compute#operations` for
// Operations resource.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than `maxResults`, use the `nextPageToken` as a value for the query
- // parameter `pageToken` in the next list request. Subsequent list
- // requests will have their own `nextPageToken` to continue paging
- // through the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // `maxResults`, use the `nextPageToken` as a value for the query parameter
+ // `pageToken` in the next list request. Subsequent list requests will have
+ // their own `nextPageToken` to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *OperationListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *OperationList) MarshalJSON() ([]byte, error) {
+func (s OperationList) MarshalJSON() ([]byte, error) {
type NoMethod OperationList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// OperationListWarning: [Output Only] Informational warning message.
type OperationListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*OperationListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *OperationListWarning) MarshalJSON() ([]byte, error) {
+func (s OperationListWarning) MarshalJSON() ([]byte, error) {
type NoMethod OperationListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type OperationListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *OperationListWarningData) MarshalJSON() ([]byte, error) {
+func (s OperationListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod OperationListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type OperationsScopedList struct {
- // Operations: [Output Only] A list of operations contained in this
- // scope.
+ // Operations: [Output Only] A list of operations contained in this scope.
Operations []*Operation `json:"operations,omitempty"`
-
- // Warning: [Output Only] Informational warning which replaces the list
- // of operations when the list is empty.
+ // Warning: [Output Only] Informational warning which replaces the list of
+ // operations when the list is empty.
Warning *OperationsScopedListWarning `json:"warning,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Operations") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Operations") 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. "Operations") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *OperationsScopedList) MarshalJSON() ([]byte, error) {
+func (s OperationsScopedList) MarshalJSON() ([]byte, error) {
type NoMethod OperationsScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// OperationsScopedListWarning: [Output Only] Informational warning
-// which replaces the list of operations when the list is empty.
+// OperationsScopedListWarning: [Output Only] Informational warning which
+// replaces the list of operations when the list is empty.
type OperationsScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*OperationsScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *OperationsScopedListWarning) MarshalJSON() ([]byte, error) {
+func (s OperationsScopedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod OperationsScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type OperationsScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *OperationsScopedListWarningData) MarshalJSON() ([]byte, error) {
+func (s OperationsScopedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod OperationsScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// OutlierDetection: Settings controlling the eviction of unhealthy
-// hosts from the load balancing pool for the backend service.
+// OutlierDetection: Settings controlling the eviction of unhealthy hosts from
+// the load balancing pool for the backend service.
type OutlierDetection struct {
- // BaseEjectionTime: The base time that a backend endpoint is ejected
- // for. Defaults to 30000ms or 30s. After a backend endpoint is returned
- // back to the load balancing pool, it can be ejected again in another
- // ejection analysis. Thus, the total ejection time is equal to the base
- // ejection time multiplied by the number of times the backend endpoint
- // has been ejected. Defaults to 30000ms or 30s.
+ // BaseEjectionTime: The base time that a backend endpoint is ejected for.
+ // Defaults to 30000ms or 30s. After a backend endpoint is returned back to the
+ // load balancing pool, it can be ejected again in another ejection analysis.
+ // Thus, the total ejection time is equal to the base ejection time multiplied
+ // by the number of times the backend endpoint has been ejected. Defaults to
+ // 30000ms or 30s.
BaseEjectionTime *Duration `json:"baseEjectionTime,omitempty"`
-
- // ConsecutiveErrors: Number of consecutive errors before a backend
- // endpoint is ejected from the load balancing pool. When the backend
- // endpoint is accessed over HTTP, a 5xx return code qualifies as an
- // error. Defaults to 5.
+ // ConsecutiveErrors: Number of consecutive errors before a backend endpoint is
+ // ejected from the load balancing pool. When the backend endpoint is accessed
+ // over HTTP, a 5xx return code qualifies as an error. Defaults to 5.
ConsecutiveErrors int64 `json:"consecutiveErrors,omitempty"`
-
- // ConsecutiveGatewayFailure: The number of consecutive gateway failures
- // (502, 503, 504 status or connection errors that are mapped to one of
- // those status codes) before a consecutive gateway failure ejection
- // occurs. Defaults to 3.
+ // ConsecutiveGatewayFailure: The number of consecutive gateway failures (502,
+ // 503, 504 status or connection errors that are mapped to one of those status
+ // codes) before a consecutive gateway failure ejection occurs. Defaults to 3.
ConsecutiveGatewayFailure int64 `json:"consecutiveGatewayFailure,omitempty"`
-
- // EnforcingConsecutiveErrors: The percentage chance that a backend
- // endpoint will be ejected when an outlier status is detected through
- // consecutive 5xx. This setting can be used to disable ejection or to
- // ramp it up slowly. Defaults to 0.
+ // EnforcingConsecutiveErrors: The percentage chance that a backend endpoint
+ // will be ejected when an outlier status is detected through consecutive 5xx.
+ // This setting can be used to disable ejection or to ramp it up slowly.
+ // Defaults to 0.
EnforcingConsecutiveErrors int64 `json:"enforcingConsecutiveErrors,omitempty"`
-
- // EnforcingConsecutiveGatewayFailure: The percentage chance that a
- // backend endpoint will be ejected when an outlier status is detected
- // through consecutive gateway failures. This setting can be used to
- // disable ejection or to ramp it up slowly. Defaults to 100.
+ // EnforcingConsecutiveGatewayFailure: The percentage chance that a backend
+ // endpoint will be ejected when an outlier status is detected through
+ // consecutive gateway failures. This setting can be used to disable ejection
+ // or to ramp it up slowly. Defaults to 100.
EnforcingConsecutiveGatewayFailure int64 `json:"enforcingConsecutiveGatewayFailure,omitempty"`
-
- // EnforcingSuccessRate: The percentage chance that a backend endpoint
- // will be ejected when an outlier status is detected through success
- // rate statistics. This setting can be used to disable ejection or to
- // ramp it up slowly. Defaults to 100. Not supported when the backend
- // service uses Serverless NEG.
+ // EnforcingSuccessRate: The percentage chance that a backend endpoint will be
+ // ejected when an outlier status is detected through success rate statistics.
+ // This setting can be used to disable ejection or to ramp it up slowly.
+ // Defaults to 100. Not supported when the backend service uses Serverless NEG.
EnforcingSuccessRate int64 `json:"enforcingSuccessRate,omitempty"`
-
- // Interval: Time interval between ejection analysis sweeps. This can
- // result in both new ejections and backend endpoints being returned to
- // service. The interval is equal to the number of seconds as defined in
- // outlierDetection.interval.seconds plus the number of nanoseconds as
- // defined in outlierDetection.interval.nanos. Defaults to 1 second.
+ // Interval: Time interval between ejection analysis sweeps. This can result in
+ // both new ejections and backend endpoints being returned to service. The
+ // interval is equal to the number of seconds as defined in
+ // outlierDetection.interval.seconds plus the number of nanoseconds as defined
+ // in outlierDetection.interval.nanos. Defaults to 1 second.
Interval *Duration `json:"interval,omitempty"`
-
- // MaxEjectionPercent: Maximum percentage of backend endpoints in the
- // load balancing pool for the backend service that can be ejected if
- // the ejection conditions are met. Defaults to 50%.
+ // MaxEjectionPercent: Maximum percentage of backend endpoints in the load
+ // balancing pool for the backend service that can be ejected if the ejection
+ // conditions are met. Defaults to 50%.
MaxEjectionPercent int64 `json:"maxEjectionPercent,omitempty"`
-
// SuccessRateMinimumHosts: The number of backend endpoints in the load
- // balancing pool that must have enough request volume to detect success
- // rate outliers. If the number of backend endpoints is fewer than this
- // setting, outlier detection via success rate statistics is not
- // performed for any backend endpoint in the load balancing pool.
- // Defaults to 5. Not supported when the backend service uses Serverless
- // NEG.
+ // balancing pool that must have enough request volume to detect success rate
+ // outliers. If the number of backend endpoints is fewer than this setting,
+ // outlier detection via success rate statistics is not performed for any
+ // backend endpoint in the load balancing pool. Defaults to 5. Not supported
+ // when the backend service uses Serverless NEG.
SuccessRateMinimumHosts int64 `json:"successRateMinimumHosts,omitempty"`
-
- // SuccessRateRequestVolume: The minimum number of total requests that
- // must be collected in one interval (as defined by the interval
- // duration above) to include this backend endpoint in success rate
- // based outlier detection. If the volume is lower than this setting,
- // outlier detection via success rate statistics is not performed for
- // that backend endpoint. Defaults to 100. Not supported when the
- // backend service uses Serverless NEG.
+ // SuccessRateRequestVolume: The minimum number of total requests that must be
+ // collected in one interval (as defined by the interval duration above) to
+ // include this backend endpoint in success rate based outlier detection. If
+ // the volume is lower than this setting, outlier detection via success rate
+ // statistics is not performed for that backend endpoint. Defaults to 100. Not
+ // supported when the backend service uses Serverless NEG.
SuccessRateRequestVolume int64 `json:"successRateRequestVolume,omitempty"`
-
// SuccessRateStdevFactor: This factor is used to determine the ejection
- // threshold for success rate outlier ejection. The ejection threshold
- // is the difference between the mean success rate, and the product of
- // this factor and the standard deviation of the mean success rate: mean
- // - (stdev * successRateStdevFactor). This factor is divided by a
- // thousand to get a double. That is, if the desired factor is 1.9, the
- // runtime value should be 1900. Defaults to 1900. Not supported when
- // the backend service uses Serverless NEG.
+ // threshold for success rate outlier ejection. The ejection threshold is the
+ // difference between the mean success rate, and the product of this factor and
+ // the standard deviation of the mean success rate: mean - (stdev *
+ // successRateStdevFactor). This factor is divided by a thousand to get a
+ // double. That is, if the desired factor is 1.9, the runtime value should be
+ // 1900. Defaults to 1900. Not supported when the backend service uses
+ // Serverless NEG.
SuccessRateStdevFactor int64 `json:"successRateStdevFactor,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "BaseEjectionTime") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "BaseEjectionTime") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "BaseEjectionTime") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *OutlierDetection) MarshalJSON() ([]byte, error) {
+func (s OutlierDetection) MarshalJSON() ([]byte, error) {
type NoMethod OutlierDetection
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// PacketIntervals: Next free: 7
type PacketIntervals struct {
// AvgMs: Average observed inter-packet interval in milliseconds.
AvgMs int64 `json:"avgMs,omitempty,string"`
-
- // Duration: From how long ago in the past these intervals were
- // observed.
+ // Duration: From how long ago in the past these intervals were observed.
//
// Possible values:
// "DURATION_UNSPECIFIED"
@@ -36537,19 +30969,14 @@ type PacketIntervals struct {
// "MAX" - From BfdSession object creation time.
// "MINUTE"
Duration string `json:"duration,omitempty"`
-
// MaxMs: Maximum observed inter-packet interval in milliseconds.
MaxMs int64 `json:"maxMs,omitempty,string"`
-
// MinMs: Minimum observed inter-packet interval in milliseconds.
MinMs int64 `json:"minMs,omitempty,string"`
-
- // NumIntervals: Number of inter-packet intervals from which these
- // statistics were derived.
+ // NumIntervals: Number of inter-packet intervals from which these statistics
+ // were derived.
NumIntervals int64 `json:"numIntervals,omitempty,string"`
-
- // Type: The type of packets for which inter-packet intervals were
- // computed.
+ // Type: The type of packets for which inter-packet intervals were computed.
//
// Possible values:
// "LOOPBACK" - Only applies to Echo packets. This shows the intervals
@@ -36558,1501 +30985,1256 @@ type PacketIntervals struct {
// "TRANSMIT" - Intervals between transmitted packets.
// "TYPE_UNSPECIFIED"
Type string `json:"type,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "AvgMs") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "AvgMs") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "AvgMs") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *PacketIntervals) MarshalJSON() ([]byte, error) {
+func (s PacketIntervals) MarshalJSON() ([]byte, error) {
type NoMethod PacketIntervals
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// PacketMirroring: Represents a Packet Mirroring resource. Packet
-// Mirroring clones the traffic of specified instances in your Virtual
-// Private Cloud (VPC) network and forwards it to a collector
-// destination, such as an instance group of an internal TCP/UDP load
-// balancer, for analysis or examination. For more information about
-// setting up Packet Mirroring, see Using Packet Mirroring.
+// PacketMirroring: Represents a Packet Mirroring resource. Packet Mirroring
+// clones the traffic of specified instances in your Virtual Private Cloud
+// (VPC) network and forwards it to a collector destination, such as an
+// instance group of an internal TCP/UDP load balancer, for analysis or
+// examination. For more information about setting up Packet Mirroring, see
+// Using Packet Mirroring.
type PacketMirroring struct {
// CollectorIlb: The Forwarding Rule resource of type
- // loadBalancingScheme=INTERNAL that will be used as collector for
- // mirrored traffic. The specified forwarding rule must have
- // isMirroringCollector set to true.
+ // loadBalancingScheme=INTERNAL that will be used as collector for mirrored
+ // traffic. The specified forwarding rule must have isMirroringCollector set to
+ // true.
CollectorIlb *PacketMirroringForwardingRuleInfo `json:"collectorIlb,omitempty"`
-
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // Enable: Indicates whether or not this packet mirroring takes effect.
- // If set to FALSE, this packet mirroring policy will not be enforced on
- // the network. The default is TRUE.
+ // Enable: Indicates whether or not this packet mirroring takes effect. If set
+ // to FALSE, this packet mirroring policy will not be enforced on the network.
+ // The default is TRUE.
//
// Possible values:
// "FALSE"
// "TRUE"
Enable string `json:"enable,omitempty"`
-
- // Filter: Filter for mirrored traffic. If unspecified, all traffic is
+ // Filter: Filter for mirrored traffic. If unspecified, all IPv4 traffic is
// mirrored.
Filter *PacketMirroringFilter `json:"filter,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
- // Kind: [Output Only] Type of the resource. Always
- // compute#packetMirroring for packet mirrorings.
+ // Kind: [Output Only] Type of the resource. Always compute#packetMirroring for
+ // packet mirrorings.
Kind string `json:"kind,omitempty"`
-
// MirroredResources: PacketMirroring mirroredResourceInfos.
- // MirroredResourceInfo specifies a set of mirrored VM instances,
- // subnetworks and/or tags for which traffic from/to all VM instances
- // will be mirrored.
+ // MirroredResourceInfo specifies a set of mirrored VM instances, subnetworks
+ // and/or tags for which traffic from/to all VM instances will be mirrored.
MirroredResources *PacketMirroringMirroredResourceInfo `json:"mirroredResources,omitempty"`
-
- // Name: Name of the resource; provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
- // the first character must be a lowercase letter, and all following
- // characters must be a dash, lowercase letter, or digit, except the
- // last character, which cannot be a dash.
+ // Name: Name of the resource; provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must
+ // be a lowercase letter, and all following characters must be a dash,
+ // lowercase letter, or digit, except the last character, which cannot be a
+ // dash.
Name string `json:"name,omitempty"`
-
- // Network: Specifies the mirrored VPC network. Only packets in this
- // network will be mirrored. All mirrored VMs should have a NIC in the
- // given network. All mirrored subnetworks should belong to the given
- // network.
+ // Network: Specifies the mirrored VPC network. Only packets in this network
+ // will be mirrored. All mirrored VMs should have a NIC in the given network.
+ // All mirrored subnetworks should belong to the given network.
Network *PacketMirroringNetworkInfo `json:"network,omitempty"`
-
- // Priority: The priority of applying this configuration. Priority is
- // used to break ties in cases where there is more than one matching
- // rule. In the case of two rules that apply for a given Instance, the
- // one with the lowest-numbered priority value wins. Default value is
- // 1000. Valid range is 0 through 65535.
+ // Priority: The priority of applying this configuration. Priority is used to
+ // break ties in cases where there is more than one matching rule. In the case
+ // of two rules that apply for a given Instance, the one with the
+ // lowest-numbered priority value wins. Default value is 1000. Valid range is 0
+ // through 65535.
Priority int64 `json:"priority,omitempty"`
-
- // Region: [Output Only] URI of the region where the packetMirroring
- // resides.
+ // Region: [Output Only] URI of the region where the packetMirroring resides.
Region string `json:"region,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
// ForceSendFields is a list of field names (e.g. "CollectorIlb") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CollectorIlb") 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. "CollectorIlb") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *PacketMirroring) MarshalJSON() ([]byte, error) {
+func (s PacketMirroring) MarshalJSON() ([]byte, error) {
type NoMethod PacketMirroring
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// PacketMirroringAggregatedList: Contains a list of packetMirrorings.
type PacketMirroringAggregatedList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of PacketMirroring resources.
Items map[string]PacketMirroringsScopedList `json:"items,omitempty"`
-
// Kind: Type of resource.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Unreachables: [Output Only] Unreachable resources.
Unreachables []string `json:"unreachables,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *PacketMirroringAggregatedListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *PacketMirroringAggregatedList) MarshalJSON() ([]byte, error) {
+func (s PacketMirroringAggregatedList) MarshalJSON() ([]byte, error) {
type NoMethod PacketMirroringAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// PacketMirroringAggregatedListWarning: [Output Only] Informational
-// warning message.
+// PacketMirroringAggregatedListWarning: [Output Only] Informational warning
+// message.
type PacketMirroringAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*PacketMirroringAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *PacketMirroringAggregatedListWarning) MarshalJSON() ([]byte, error) {
+func (s PacketMirroringAggregatedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod PacketMirroringAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type PacketMirroringAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *PacketMirroringAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+func (s PacketMirroringAggregatedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod PacketMirroringAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type PacketMirroringFilter struct {
- // IPProtocols: Protocols that apply as filter on mirrored traffic. If
- // no protocols are specified, all traffic that matches the specified
- // CIDR ranges is mirrored. If neither cidrRanges nor IPProtocols is
- // specified, all IPv4 traffic is mirrored.
+ // IPProtocols: Protocols that apply as filter on mirrored traffic. If no
+ // protocols are specified, all traffic that matches the specified CIDR ranges
+ // is mirrored. If neither cidrRanges nor IPProtocols is specified, all IPv4
+ // traffic is mirrored.
IPProtocols []string `json:"IPProtocols,omitempty"`
-
- // CidrRanges: One or more IPv4 or IPv6 CIDR ranges that apply as filter
- // on the source (ingress) or destination (egress) IP in the IP header.
- // If no ranges are specified, all IPv4 traffic that matches the
- // specified IPProtocols is mirrored. If neither cidrRanges nor
- // IPProtocols is specified, all IPv4 traffic is mirrored. To mirror all
- // IPv4 and IPv6 traffic, use "0.0.0.0/0,::/0". Note: Support for IPv6
- // traffic is in preview.
+ // CidrRanges: One or more IPv4 or IPv6 CIDR ranges that apply as filters on
+ // the source (ingress) or destination (egress) IP in the IP header. If no
+ // ranges are specified, all IPv4 traffic that matches the specified
+ // IPProtocols is mirrored. If neither cidrRanges nor IPProtocols is specified,
+ // all IPv4 traffic is mirrored. To mirror all IPv4 and IPv6 traffic, use
+ // "0.0.0.0/0,::/0".
CidrRanges []string `json:"cidrRanges,omitempty"`
-
- // Direction: Direction of traffic to mirror, either INGRESS, EGRESS, or
- // BOTH. The default is BOTH.
+ // Direction: Direction of traffic to mirror, either INGRESS, EGRESS, or BOTH.
+ // The default is BOTH.
//
// Possible values:
// "BOTH" - Default, both directions are mirrored.
// "EGRESS" - Only egress traffic is mirrored.
// "INGRESS" - Only ingress traffic is mirrored.
Direction string `json:"direction,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "IPProtocols") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "IPProtocols") 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. "IPProtocols") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *PacketMirroringFilter) MarshalJSON() ([]byte, error) {
+func (s PacketMirroringFilter) MarshalJSON() ([]byte, error) {
type NoMethod PacketMirroringFilter
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type PacketMirroringForwardingRuleInfo struct {
- // CanonicalUrl: [Output Only] Unique identifier for the forwarding
- // rule; defined by the server.
+ // CanonicalUrl: [Output Only] Unique identifier for the forwarding rule;
+ // defined by the server.
CanonicalUrl string `json:"canonicalUrl,omitempty"`
-
- // Url: Resource URL to the forwarding rule representing the ILB
- // configured as destination of the mirrored traffic.
+ // Url: Resource URL to the forwarding rule representing the ILB configured as
+ // destination of the mirrored traffic.
Url string `json:"url,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "CanonicalUrl") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CanonicalUrl") 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. "CanonicalUrl") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *PacketMirroringForwardingRuleInfo) MarshalJSON() ([]byte, error) {
+func (s PacketMirroringForwardingRuleInfo) MarshalJSON() ([]byte, error) {
type NoMethod PacketMirroringForwardingRuleInfo
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// PacketMirroringList: Contains a list of PacketMirroring resources.
type PacketMirroringList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of PacketMirroring resources.
Items []*PacketMirroring `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource. Always compute#packetMirroring
- // for packetMirrorings.
+ // Kind: [Output Only] Type of resource. Always compute#packetMirroring for
+ // packetMirrorings.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *PacketMirroringListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *PacketMirroringList) MarshalJSON() ([]byte, error) {
+func (s PacketMirroringList) MarshalJSON() ([]byte, error) {
type NoMethod PacketMirroringList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// PacketMirroringListWarning: [Output Only] Informational warning
-// message.
+// PacketMirroringListWarning: [Output Only] Informational warning message.
type PacketMirroringListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*PacketMirroringListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *PacketMirroringListWarning) MarshalJSON() ([]byte, error) {
+func (s PacketMirroringListWarning) MarshalJSON() ([]byte, error) {
type NoMethod PacketMirroringListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type PacketMirroringListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *PacketMirroringListWarningData) MarshalJSON() ([]byte, error) {
+func (s PacketMirroringListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod PacketMirroringListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type PacketMirroringMirroredResourceInfo struct {
- // Instances: A set of virtual machine instances that are being
- // mirrored. They must live in zones contained in the same region as
- // this packetMirroring. Note that this config will apply only to those
- // network interfaces of the Instances that belong to the network
- // specified in this packetMirroring. You may specify a maximum of 50
- // Instances.
+ // Instances: A set of virtual machine instances that are being mirrored. They
+ // must live in zones contained in the same region as this packetMirroring.
+ // Note that this config will apply only to those network interfaces of the
+ // Instances that belong to the network specified in this packetMirroring. You
+ // may specify a maximum of 50 Instances.
Instances []*PacketMirroringMirroredResourceInfoInstanceInfo `json:"instances,omitempty"`
-
- // Subnetworks: A set of subnetworks for which traffic from/to all VM
- // instances will be mirrored. They must live in the same region as this
- // packetMirroring. You may specify a maximum of 5 subnetworks.
+ // Subnetworks: A set of subnetworks for which traffic from/to all VM instances
+ // will be mirrored. They must live in the same region as this packetMirroring.
+ // You may specify a maximum of 5 subnetworks.
Subnetworks []*PacketMirroringMirroredResourceInfoSubnetInfo `json:"subnetworks,omitempty"`
-
- // Tags: A set of mirrored tags. Traffic from/to all VM instances that
- // have one or more of these tags will be mirrored.
+ // Tags: A set of mirrored tags. Traffic from/to all VM instances that have one
+ // or more of these tags will be mirrored.
Tags []string `json:"tags,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Instances") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Instances") 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. "Instances") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *PacketMirroringMirroredResourceInfo) MarshalJSON() ([]byte, error) {
+func (s PacketMirroringMirroredResourceInfo) MarshalJSON() ([]byte, error) {
type NoMethod PacketMirroringMirroredResourceInfo
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type PacketMirroringMirroredResourceInfoInstanceInfo struct {
- // CanonicalUrl: [Output Only] Unique identifier for the instance;
- // defined by the server.
+ // CanonicalUrl: [Output Only] Unique identifier for the instance; defined by
+ // the server.
CanonicalUrl string `json:"canonicalUrl,omitempty"`
-
- // Url: Resource URL to the virtual machine instance which is being
- // mirrored.
+ // Url: Resource URL to the virtual machine instance which is being mirrored.
Url string `json:"url,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "CanonicalUrl") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CanonicalUrl") 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. "CanonicalUrl") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *PacketMirroringMirroredResourceInfoInstanceInfo) MarshalJSON() ([]byte, error) {
+func (s PacketMirroringMirroredResourceInfoInstanceInfo) MarshalJSON() ([]byte, error) {
type NoMethod PacketMirroringMirroredResourceInfoInstanceInfo
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type PacketMirroringMirroredResourceInfoSubnetInfo struct {
- // CanonicalUrl: [Output Only] Unique identifier for the subnetwork;
- // defined by the server.
+ // CanonicalUrl: [Output Only] Unique identifier for the subnetwork; defined by
+ // the server.
CanonicalUrl string `json:"canonicalUrl,omitempty"`
-
// Url: Resource URL to the subnetwork for which traffic from/to all VM
// instances will be mirrored.
Url string `json:"url,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "CanonicalUrl") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CanonicalUrl") 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. "CanonicalUrl") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *PacketMirroringMirroredResourceInfoSubnetInfo) MarshalJSON() ([]byte, error) {
+func (s PacketMirroringMirroredResourceInfoSubnetInfo) MarshalJSON() ([]byte, error) {
type NoMethod PacketMirroringMirroredResourceInfoSubnetInfo
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type PacketMirroringNetworkInfo struct {
- // CanonicalUrl: [Output Only] Unique identifier for the network;
- // defined by the server.
+ // CanonicalUrl: [Output Only] Unique identifier for the network; defined by
+ // the server.
CanonicalUrl string `json:"canonicalUrl,omitempty"`
-
// Url: URL of the network resource.
Url string `json:"url,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "CanonicalUrl") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CanonicalUrl") 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. "CanonicalUrl") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *PacketMirroringNetworkInfo) MarshalJSON() ([]byte, error) {
+func (s PacketMirroringNetworkInfo) MarshalJSON() ([]byte, error) {
type NoMethod PacketMirroringNetworkInfo
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type PacketMirroringsScopedList struct {
// PacketMirrorings: A list of packetMirrorings contained in this scope.
PacketMirrorings []*PacketMirroring `json:"packetMirrorings,omitempty"`
-
- // Warning: Informational warning which replaces the list of
- // packetMirrorings when the list is empty.
+ // Warning: Informational warning which replaces the list of packetMirrorings
+ // when the list is empty.
Warning *PacketMirroringsScopedListWarning `json:"warning,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "PacketMirrorings") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "PacketMirrorings") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "PacketMirrorings") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *PacketMirroringsScopedList) MarshalJSON() ([]byte, error) {
+func (s PacketMirroringsScopedList) MarshalJSON() ([]byte, error) {
type NoMethod PacketMirroringsScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// PacketMirroringsScopedListWarning: Informational warning which
-// replaces the list of packetMirrorings when the list is empty.
+// PacketMirroringsScopedListWarning: Informational warning which replaces the
+// list of packetMirrorings when the list is empty.
type PacketMirroringsScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*PacketMirroringsScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *PacketMirroringsScopedListWarning) MarshalJSON() ([]byte, error) {
+func (s PacketMirroringsScopedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod PacketMirroringsScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type PacketMirroringsScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *PacketMirroringsScopedListWarningData) MarshalJSON() ([]byte, error) {
+func (s PacketMirroringsScopedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod PacketMirroringsScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// PathMatcher: A matcher for the path portion of the URL. The
-// BackendService from the longest-matched rule will serve the URL. If
-// no rule was matched, the default service is used.
+// PathMatcher: A matcher for the path portion of the URL. The BackendService
+// from the longest-matched rule will serve the URL. If no rule was matched,
+// the default service is used.
type PathMatcher struct {
+ // DefaultCustomErrorResponsePolicy: defaultCustomErrorResponsePolicy specifies
+ // how the Load Balancer returns error responses when BackendServiceor
+ // BackendBucket responds with an error. This policy takes effect at the
+ // PathMatcher level and applies only when no policy has been defined for the
+ // error code at lower levels like RouteRule and PathRule within this
+ // PathMatcher. If an error code does not have a policy defined in
+ // defaultCustomErrorResponsePolicy, then a policy defined for the error code
+ // in UrlMap.defaultCustomErrorResponsePolicy takes effect. For example,
+ // consider a UrlMap with the following configuration: -
+ // UrlMap.defaultCustomErrorResponsePolicy is configured with policies for 5xx
+ // and 4xx errors - A RouteRule for /coming_soon/ is configured for the error
+ // code 404. If the request is for www.myotherdomain.com and a 404 is
+ // encountered, the policy under UrlMap.defaultCustomErrorResponsePolicy takes
+ // effect. If a 404 response is encountered for the request
+ // www.example.com/current_events/, the pathMatcher's policy takes effect. If
+ // however, the request for www.example.com/coming_soon/ encounters a 404, the
+ // policy in RouteRule.customErrorResponsePolicy takes effect. If any of the
+ // requests in this example encounter a 500 error code, the policy at
+ // UrlMap.defaultCustomErrorResponsePolicy takes effect. When used in
+ // conjunction with pathMatcher.defaultRouteAction.retryPolicy, retries take
+ // precedence. Only once all retries are exhausted, the
+ // defaultCustomErrorResponsePolicy is applied. While attempting a retry, if
+ // load balancer is successful in reaching the service, the
+ // defaultCustomErrorResponsePolicy is ignored and the response from the
+ // service is returned to the client. defaultCustomErrorResponsePolicy is
+ // supported only for global external Application Load Balancers.
+ DefaultCustomErrorResponsePolicy *CustomErrorResponsePolicy `json:"defaultCustomErrorResponsePolicy,omitempty"`
// DefaultRouteAction: defaultRouteAction takes effect when none of the
- // pathRules or routeRules match. The load balancer performs advanced
- // routing actions, such as URL rewrites and header transformations,
- // before forwarding the request to the selected backend. If
- // defaultRouteAction specifies any weightedBackendServices,
- // defaultService must not be set. Conversely if defaultService is set,
- // defaultRouteAction cannot contain any weightedBackendServices. Only
- // one of defaultRouteAction or defaultUrlRedirect must be set. URL maps
- // for classic Application Load Balancers only support the urlRewrite
- // action within a path matcher's defaultRouteAction.
+ // pathRules or routeRules match. The load balancer performs advanced routing
+ // actions, such as URL rewrites and header transformations, before forwarding
+ // the request to the selected backend. If defaultRouteAction specifies any
+ // weightedBackendServices, defaultService must not be set. Conversely if
+ // defaultService is set, defaultRouteAction cannot contain any
+ // weightedBackendServices. If defaultRouteAction is specified, don't set
+ // defaultUrlRedirect. If defaultRouteAction.weightedBackendServices is
+ // specified, don't set defaultService. URL maps for classic Application Load
+ // Balancers only support the urlRewrite action within a path matcher's
+ // defaultRouteAction.
DefaultRouteAction *HttpRouteAction `json:"defaultRouteAction,omitempty"`
-
- // DefaultService: The full or partial URL to the BackendService
- // resource. This URL is used if none of the pathRules or routeRules
- // defined by this PathMatcher are matched. For example, the following
- // are all valid URLs to a BackendService resource: -
+ // DefaultService: The full or partial URL to the BackendService resource. This
+ // URL is used if none of the pathRules or routeRules defined by this
+ // PathMatcher are matched. For example, the following are all valid URLs to a
+ // BackendService resource: -
// https://www.googleapis.com/compute/v1/projects/project
// /global/backendServices/backendService -
// compute/v1/projects/project/global/backendServices/backendService -
// global/backendServices/backendService If defaultRouteAction is also
- // specified, advanced routing actions, such as URL rewrites, take
- // effect before sending the request to the backend. However, if
- // defaultService is specified, defaultRouteAction cannot contain any
- // weightedBackendServices. Conversely, if defaultRouteAction specifies
- // any weightedBackendServices, defaultService must not be specified.
- // Only one of defaultService, defaultUrlRedirect , or
- // defaultRouteAction.weightedBackendService must be set. Authorization
- // requires one or more of the following Google IAM permissions on the
- // specified resource default_service: - compute.backendBuckets.use -
- // compute.backendServices.use
+ // specified, advanced routing actions, such as URL rewrites, take effect
+ // before sending the request to the backend. However, if defaultService is
+ // specified, defaultRouteAction cannot contain any weightedBackendServices.
+ // Conversely, if defaultRouteAction specifies any weightedBackendServices,
+ // defaultService must not be specified. If defaultService is specified, then
+ // set either defaultUrlRedirect or defaultRouteAction.weightedBackendService.
+ // Don't set both. Authorization requires one or more of the following Google
+ // IAM permissions on the specified resource default_service: -
+ // compute.backendBuckets.use - compute.backendServices.use
DefaultService string `json:"defaultService,omitempty"`
-
- // DefaultUrlRedirect: When none of the specified pathRules or
- // routeRules match, the request is redirected to a URL specified by
- // defaultUrlRedirect. If defaultUrlRedirect is specified,
- // defaultService or defaultRouteAction must not be set. Not supported
- // when the URL map is bound to a target gRPC proxy.
+ // DefaultUrlRedirect: When none of the specified pathRules or routeRules
+ // match, the request is redirected to a URL specified by defaultUrlRedirect.
+ // If defaultUrlRedirect is specified, then set either defaultService or
+ // defaultRouteAction. Don't set both. Not supported when the URL map is bound
+ // to a target gRPC proxy.
DefaultUrlRedirect *HttpRedirectAction `json:"defaultUrlRedirect,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // HeaderAction: Specifies changes to request and response headers that
- // need to take effect for the selected backend service. HeaderAction
- // specified here are applied after the matching HttpRouteRule
- // HeaderAction and before the HeaderAction in the UrlMap HeaderAction
- // is not supported for load balancers that have their
- // loadBalancingScheme set to EXTERNAL. Not supported when the URL map
- // is bound to a target gRPC proxy that has validateForProxyless field
+ // HeaderAction: Specifies changes to request and response headers that need to
+ // take effect for the selected backend service. HeaderAction specified here
+ // are applied after the matching HttpRouteRule HeaderAction and before the
+ // HeaderAction in the UrlMap HeaderAction is not supported for load balancers
+ // that have their loadBalancingScheme set to EXTERNAL. Not supported when the
+ // URL map is bound to a target gRPC proxy that has validateForProxyless field
// set to true.
HeaderAction *HttpHeaderAction `json:"headerAction,omitempty"`
-
// Name: The name to which this PathMatcher is referred by the HostRule.
Name string `json:"name,omitempty"`
-
- // PathRules: The list of path rules. Use this list instead of
- // routeRules when routing based on simple path matching is all that's
- // required. The order by which path rules are specified does not
- // matter. Matches are always done on the longest-path-first basis. For
- // example: a pathRule with a path /a/b/c/* will match before /a/b/*
- // irrespective of the order in which those paths appear in this list.
- // Within a given pathMatcher, only one of pathRules or routeRules must
- // be set.
+ // PathRules: The list of path rules. Use this list instead of routeRules when
+ // routing based on simple path matching is all that's required. The order by
+ // which path rules are specified does not matter. Matches are always done on
+ // the longest-path-first basis. For example: a pathRule with a path /a/b/c/*
+ // will match before /a/b/* irrespective of the order in which those paths
+ // appear in this list. Within a given pathMatcher, only one of pathRules or
+ // routeRules must be set.
PathRules []*PathRule `json:"pathRules,omitempty"`
-
- // RouteRules: The list of HTTP route rules. Use this list instead of
- // pathRules when advanced route matching and routing actions are
- // desired. routeRules are evaluated in order of priority, from the
- // lowest to highest number. Within a given pathMatcher, you can set
- // only one of pathRules or routeRules.
+ // RouteRules: The list of HTTP route rules. Use this list instead of pathRules
+ // when advanced route matching and routing actions are desired. routeRules are
+ // evaluated in order of priority, from the lowest to highest number. Within a
+ // given pathMatcher, you can set only one of pathRules or routeRules.
RouteRules []*HttpRouteRule `json:"routeRules,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "DefaultRouteAction")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g.
+ // "DefaultCustomErrorResponsePolicy") to unconditionally include in API
+ // requests. By default, fields with empty or default values are omitted from
+ // API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "DefaultRouteAction") 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.
+ // "DefaultCustomErrorResponsePolicy") to include in API requests with the JSON
+ // null value. By default, fields with empty values are omitted from API
+ // requests. See https://pkg.go.dev/google.golang.org/api#hdr-NullFields for
+ // more details.
NullFields []string `json:"-"`
}
-func (s *PathMatcher) MarshalJSON() ([]byte, error) {
+func (s PathMatcher) MarshalJSON() ([]byte, error) {
type NoMethod PathMatcher
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// PathRule: A path-matching rule for a URL. If matched, will use the
-// specified BackendService to handle the traffic arriving at this URL.
+// PathRule: A path-matching rule for a URL. If matched, will use the specified
+// BackendService to handle the traffic arriving at this URL.
type PathRule struct {
- // Paths: The list of path patterns to match. Each must start with / and
- // the only place a * is allowed is at the end following a /. The string
- // fed to the path matcher does not include any text after the first ?
- // or #, and those chars are not allowed here.
+ // CustomErrorResponsePolicy: customErrorResponsePolicy specifies how the Load
+ // Balancer returns error responses when BackendServiceor BackendBucket
+ // responds with an error. If a policy for an error code is not configured for
+ // the PathRule, a policy for the error code configured in
+ // pathMatcher.defaultCustomErrorResponsePolicy is applied. If one is not
+ // specified in pathMatcher.defaultCustomErrorResponsePolicy, the policy
+ // configured in UrlMap.defaultCustomErrorResponsePolicy takes effect. For
+ // example, consider a UrlMap with the following configuration: -
+ // UrlMap.defaultCustomErrorResponsePolicy are configured with policies for 5xx
+ // and 4xx errors - A PathRule for /coming_soon/ is configured for the error
+ // code 404. If the request is for www.myotherdomain.com and a 404 is
+ // encountered, the policy under UrlMap.defaultCustomErrorResponsePolicy takes
+ // effect. If a 404 response is encountered for the request
+ // www.example.com/current_events/, the pathMatcher's policy takes effect. If
+ // however, the request for www.example.com/coming_soon/ encounters a 404, the
+ // policy in PathRule.customErrorResponsePolicy takes effect. If any of the
+ // requests in this example encounter a 500 error code, the policy at
+ // UrlMap.defaultCustomErrorResponsePolicy takes effect.
+ // customErrorResponsePolicy is supported only for global external Application
+ // Load Balancers.
+ CustomErrorResponsePolicy *CustomErrorResponsePolicy `json:"customErrorResponsePolicy,omitempty"`
+ // Paths: The list of path patterns to match. Each must start with / and the
+ // only place a * is allowed is at the end following a /. The string fed to the
+ // path matcher does not include any text after the first ? or #, and those
+ // chars are not allowed here.
Paths []string `json:"paths,omitempty"`
-
- // RouteAction: In response to a matching path, the load balancer
- // performs advanced routing actions, such as URL rewrites and header
- // transformations, before forwarding the request to the selected
- // backend. If routeAction specifies any weightedBackendServices,
- // service must not be set. Conversely if service is set, routeAction
- // cannot contain any weightedBackendServices. Only one of routeAction
- // or urlRedirect must be set. URL maps for classic Application Load
- // Balancers only support the urlRewrite action within a path rule's
- // routeAction.
+ // RouteAction: In response to a matching path, the load balancer performs
+ // advanced routing actions, such as URL rewrites and header transformations,
+ // before forwarding the request to the selected backend. If routeAction
+ // specifies any weightedBackendServices, service must not be set. Conversely
+ // if service is set, routeAction cannot contain any weightedBackendServices.
+ // Only one of routeAction or urlRedirect must be set. URL maps for classic
+ // Application Load Balancers only support the urlRewrite action within a path
+ // rule's routeAction.
RouteAction *HttpRouteAction `json:"routeAction,omitempty"`
-
- // Service: The full or partial URL of the backend service resource to
- // which traffic is directed if this rule is matched. If routeAction is
- // also specified, advanced routing actions, such as URL rewrites, take
- // effect before sending the request to the backend. However, if service
- // is specified, routeAction cannot contain any weightedBackendServices.
- // Conversely, if routeAction specifies any weightedBackendServices,
- // service must not be specified. Only one of urlRedirect, service or
+ // Service: The full or partial URL of the backend service resource to which
+ // traffic is directed if this rule is matched. If routeAction is also
+ // specified, advanced routing actions, such as URL rewrites, take effect
+ // before sending the request to the backend. However, if service is specified,
+ // routeAction cannot contain any weightedBackendServices. Conversely, if
+ // routeAction specifies any weightedBackendServices, service must not be
+ // specified. Only one of urlRedirect, service or
// routeAction.weightedBackendService must be set.
Service string `json:"service,omitempty"`
-
- // UrlRedirect: When a path pattern is matched, the request is
- // redirected to a URL specified by urlRedirect. If urlRedirect is
- // specified, service or routeAction must not be set. Not supported when
- // the URL map is bound to a target gRPC proxy.
+ // UrlRedirect: When a path pattern is matched, the request is redirected to a
+ // URL specified by urlRedirect. If urlRedirect is specified, service or
+ // routeAction must not be set. Not supported when the URL map is bound to a
+ // target gRPC proxy.
UrlRedirect *HttpRedirectAction `json:"urlRedirect,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Paths") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "CustomErrorResponsePolicy")
+ // to unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Paths") 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. "CustomErrorResponsePolicy") to
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *PathRule) MarshalJSON() ([]byte, error) {
+func (s PathRule) MarshalJSON() ([]byte, error) {
type NoMethod PathRule
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type PerInstanceConfig struct {
- // Fingerprint: Fingerprint of this per-instance config. This field can
- // be used in optimistic locking. It is ignored when inserting a
- // per-instance config. An up-to-date fingerprint must be provided in
- // order to update an existing per-instance configuration or the field
- // needs to be unset.
+ // Fingerprint: Fingerprint of this per-instance config. This field can be used
+ // in optimistic locking. It is ignored when inserting a per-instance config.
+ // An up-to-date fingerprint must be provided in order to update an existing
+ // per-instance configuration or the field needs to be unset.
Fingerprint string `json:"fingerprint,omitempty"`
-
// Name: The name of a per-instance configuration and its corresponding
- // instance. Serves as a merge key during UpdatePerInstanceConfigs
- // operations, that is, if a per-instance configuration with the same
- // name exists then it will be updated, otherwise a new one will be
- // created for the VM instance with the same name. An attempt to create
- // a per-instance configconfiguration for a VM instance that either
- // doesn't exist or is not part of the group will result in an error.
+ // instance. Serves as a merge key during UpdatePerInstanceConfigs operations,
+ // that is, if a per-instance configuration with the same name exists then it
+ // will be updated, otherwise a new one will be created for the VM instance
+ // with the same name. An attempt to create a per-instance configconfiguration
+ // for a VM instance that either doesn't exist or is not part of the group will
+ // result in an error.
Name string `json:"name,omitempty"`
-
- // PreservedState: The intended preserved state for the given instance.
- // Does not contain preserved state generated from a stateful policy.
+ // PreservedState: The intended preserved state for the given instance. Does
+ // not contain preserved state generated from a stateful policy.
PreservedState *PreservedState `json:"preservedState,omitempty"`
-
// Status: The status of applying this per-instance configuration on the
// corresponding managed instance.
//
// Possible values:
// "APPLYING" - The per-instance configuration is being applied to the
- // instance, but is not yet effective, possibly waiting for the instance
- // to, for example, REFRESH.
- // "DELETING" - The per-instance configuration deletion is being
- // applied on the instance, possibly waiting for the instance to, for
- // example, REFRESH.
- // "EFFECTIVE" - The per-instance configuration is effective on the
- // instance, meaning that all disks, ips and metadata specified in this
- // configuration are attached or set on the instance.
+ // instance, but is not yet effective, possibly waiting for the instance to,
+ // for example, REFRESH.
+ // "DELETING" - The per-instance configuration deletion is being applied on
+ // the instance, possibly waiting for the instance to, for example, REFRESH.
+ // "EFFECTIVE" - The per-instance configuration is effective on the instance,
+ // meaning that all disks, ips and metadata specified in this configuration are
+ // attached or set on the instance.
// "NONE" - *[Default]* The default status, when no per-instance
// configuration exists.
- // "UNAPPLIED" - The per-instance configuration is set on an instance
- // but not been applied yet.
- // "UNAPPLIED_DELETION" - The per-instance configuration has been
- // deleted, but the deletion is not yet applied.
+ // "UNAPPLIED" - The per-instance configuration is set on an instance but not
+ // been applied yet.
+ // "UNAPPLIED_DELETION" - The per-instance configuration has been deleted,
+ // but the deletion is not yet applied.
Status string `json:"status,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Fingerprint") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Fingerprint") 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. "Fingerprint") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *PerInstanceConfig) MarshalJSON() ([]byte, error) {
+func (s PerInstanceConfig) MarshalJSON() ([]byte, error) {
type NoMethod PerInstanceConfig
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// Policy: An Identity and Access Management (IAM) policy, which
-// specifies access controls for Google Cloud resources. A `Policy` is a
-// collection of `bindings`. A `binding` binds one or more `members`, or
-// principals, to a single `role`. Principals can be user accounts,
-// service accounts, Google groups, and domains (such as G Suite). A
-// `role` is a named list of permissions; each `role` can be an IAM
-// predefined role or a user-created custom role. For some types of
-// Google Cloud resources, a `binding` can also specify a `condition`,
-// which is a logical expression that allows access to a resource only
-// if the expression evaluates to `true`. A condition can add
-// constraints based on attributes of the request, the resource, or
-// both. To learn which resources support conditions in their IAM
-// policies, see the IAM documentation
-// (https://cloud.google.com/iam/help/conditions/resource-policies).
-// **JSON example:** ``` { "bindings": [ { "role":
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+// Policy: An Identity and Access Management (IAM) policy, which specifies
+// access controls for Google Cloud resources. A `Policy` is a collection of
+// `bindings`. A `binding` binds one or more `members`, or principals, to a
+// single `role`. Principals can be user accounts, service accounts, Google
+// groups, and domains (such as G Suite). A `role` is a named list of
+// permissions; each `role` can be an IAM predefined role or a user-created
+// custom role. For some types of Google Cloud resources, a `binding` can also
+// specify a `condition`, which is a logical expression that allows access to a
+// resource only if the expression evaluates to `true`. A condition can add
+// constraints based on attributes of the request, the resource, or both. To
+// learn which resources support conditions in their IAM policies, see the IAM
+// documentation
+// (https://cloud.google.com/iam/help/conditions/resource-policies). **JSON
+// example:** ``` { "bindings": [ { "role":
// "roles/resourcemanager.organizationAdmin", "members": [
-// "user:mike@example.com", "group:admins@example.com",
-// "domain:google.com",
-// "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, {
-// "role": "roles/resourcemanager.organizationViewer", "members": [
+// "user:mike@example.com", "group:admins@example.com", "domain:google.com",
+// "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role":
+// "roles/resourcemanager.organizationViewer", "members": [
// "user:eve@example.com" ], "condition": { "title": "expirable access",
// "description": "Does not grant access after Sep 2020", "expression":
-// "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ],
-// "etag": "BwWWja0YfJA=", "version": 3 } ``` **YAML example:** ```
-// bindings: - members: - user:mike@example.com -
-// group:admins@example.com - domain:google.com -
-// serviceAccount:my-project-id@appspot.gserviceaccount.com role:
-// roles/resourcemanager.organizationAdmin - members: -
+// "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag":
+// "BwWWja0YfJA=", "version": 3 } ``` **YAML example:** ``` bindings: -
+// members: - user:mike@example.com - group:admins@example.com -
+// domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com
+// role: roles/resourcemanager.organizationAdmin - members: -
// user:eve@example.com role: roles/resourcemanager.organizationViewer
-// condition: title: expirable access description: Does not grant access
-// after Sep 2020 expression: request.time <
-// timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3
-// ``` For a description of IAM and its features, see the IAM
-// documentation (https://cloud.google.com/iam/docs/).
+// condition: title: expirable access description: Does not grant access after
+// Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z')
+// etag: BwWWja0YfJA= version: 3 ``` For a description of IAM and its features,
+// see the IAM documentation (https://cloud.google.com/iam/docs/).
type Policy struct {
- // AuditConfigs: Specifies cloud audit logging configuration for this
- // policy.
+ // AuditConfigs: Specifies cloud audit logging configuration for this policy.
AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
-
- // Bindings: Associates a list of `members`, or principals, with a
- // `role`. Optionally, may specify a `condition` that determines how and
- // when the `bindings` are applied. Each of the `bindings` must contain
- // at least one principal. The `bindings` in a `Policy` can refer to up
- // to 1,500 principals; up to 250 of these principals can be Google
- // groups. Each occurrence of a principal counts towards these limits.
- // For example, if the `bindings` grant 50 different roles to
- // `user:alice@example.com`, and not to any other principal, then you
- // can add another 1,450 principals to the `bindings` in the `Policy`.
+ // Bindings: Associates a list of `members`, or principals, with a `role`.
+ // Optionally, may specify a `condition` that determines how and when the
+ // `bindings` are applied. Each of the `bindings` must contain at least one
+ // principal. The `bindings` in a `Policy` can refer to up to 1,500 principals;
+ // up to 250 of these principals can be Google groups. Each occurrence of a
+ // principal counts towards these limits. For example, if the `bindings` grant
+ // 50 different roles to `user:alice@example.com`, and not to any other
+ // principal, then you can add another 1,450 principals to the `bindings` in
+ // the `Policy`.
Bindings []*Binding `json:"bindings,omitempty"`
-
- // Etag: `etag` is used for optimistic concurrency control as a way to
- // help prevent simultaneous updates of a policy from overwriting each
- // other. It is strongly suggested that systems make use of the `etag`
- // in the read-modify-write cycle to perform policy updates in order to
- // avoid race conditions: An `etag` is returned in the response to
- // `getIamPolicy`, and systems are expected to put that etag in the
- // request to `setIamPolicy` to ensure that their change will be applied
- // to the same version of the policy. **Important:** If you use IAM
- // Conditions, you must include the `etag` field whenever you call
- // `setIamPolicy`. If you omit this field, then IAM allows you to
- // overwrite a version `3` policy with a version `1` policy, and all of
+ // Etag: `etag` is used for optimistic concurrency control as a way to help
+ // prevent simultaneous updates of a policy from overwriting each other. It is
+ // strongly suggested that systems make use of the `etag` in the
+ // read-modify-write cycle to perform policy updates in order to avoid race
+ // conditions: An `etag` is returned in the response to `getIamPolicy`, and
+ // systems are expected to put that etag in the request to `setIamPolicy` to
+ // ensure that their change will be applied to the same version of the policy.
+ // **Important:** If you use IAM Conditions, you must include the `etag` field
+ // whenever you call `setIamPolicy`. If you omit this field, then IAM allows
+ // you to overwrite a version `3` policy with a version `1` policy, and all of
// the conditions in the version `3` policy are lost.
Etag string `json:"etag,omitempty"`
-
- // Rules: This is deprecated and has no effect. Do not use.
- Rules []*Rule `json:"rules,omitempty"`
-
- // Version: Specifies the format of the policy. Valid values are `0`,
- // `1`, and `3`. Requests that specify an invalid value are rejected.
- // Any operation that affects conditional role bindings must specify
- // version `3`. This requirement applies to the following operations: *
- // Getting a policy that includes a conditional role binding * Adding a
- // conditional role binding to a policy * Changing a conditional role
- // binding in a policy * Removing any role binding, with or without a
- // condition, from a policy that includes conditions **Important:** If
- // you use IAM Conditions, you must include the `etag` field whenever
- // you call `setIamPolicy`. If you omit this field, then IAM allows you
- // to overwrite a version `3` policy with a version `1` policy, and all
- // of the conditions in the version `3` policy are lost. If a policy
- // does not include any conditions, operations on that policy may
- // specify any valid version or leave the field unset. To learn which
- // resources support conditions in their IAM policies, see the IAM
- // documentation
+ // Version: Specifies the format of the policy. Valid values are `0`, `1`, and
+ // `3`. Requests that specify an invalid value are rejected. Any operation that
+ // affects conditional role bindings must specify version `3`. This requirement
+ // applies to the following operations: * Getting a policy that includes a
+ // conditional role binding * Adding a conditional role binding to a policy *
+ // Changing a conditional role binding in a policy * Removing any role binding,
+ // with or without a condition, from a policy that includes conditions
+ // **Important:** If you use IAM Conditions, you must include the `etag` field
+ // whenever you call `setIamPolicy`. If you omit this field, then IAM allows
+ // you to overwrite a version `3` policy with a version `1` policy, and all of
+ // the conditions in the version `3` policy are lost. If a policy does not
+ // include any conditions, operations on that policy may specify any valid
+ // version or leave the field unset. To learn which resources support
+ // conditions in their IAM policies, see the IAM documentation
// (https://cloud.google.com/iam/help/conditions/resource-policies).
Version int64 `json:"version,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
// ForceSendFields is a list of field names (e.g. "AuditConfigs") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "AuditConfigs") 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. "AuditConfigs") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *Policy) MarshalJSON() ([]byte, error) {
+func (s Policy) MarshalJSON() ([]byte, error) {
type NoMethod Policy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type PreconfiguredWafSet struct {
- // ExpressionSets: List of entities that are currently supported for WAF
- // rules.
+ // ExpressionSets: List of entities that are currently supported for WAF rules.
ExpressionSets []*WafExpressionSet `json:"expressionSets,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "ExpressionSets") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "ExpressionSets") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "ExpressionSets") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *PreconfiguredWafSet) MarshalJSON() ([]byte, error) {
+func (s PreconfiguredWafSet) MarshalJSON() ([]byte, error) {
type NoMethod PreconfiguredWafSet
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// PreservedState: Preserved state for a given instance.
type PreservedState struct {
- // Disks: Preserved disks defined for this instance. This map is keyed
- // with the device names of the disks.
+ // Disks: Preserved disks defined for this instance. This map is keyed with the
+ // device names of the disks.
Disks map[string]PreservedStatePreservedDisk `json:"disks,omitempty"`
-
- // ExternalIPs: Preserved external IPs defined for this instance. This
- // map is keyed with the name of the network interface.
+ // ExternalIPs: Preserved external IPs defined for this instance. This map is
+ // keyed with the name of the network interface.
ExternalIPs map[string]PreservedStatePreservedNetworkIp `json:"externalIPs,omitempty"`
-
- // InternalIPs: Preserved internal IPs defined for this instance. This
- // map is keyed with the name of the network interface.
+ // InternalIPs: Preserved internal IPs defined for this instance. This map is
+ // keyed with the name of the network interface.
InternalIPs map[string]PreservedStatePreservedNetworkIp `json:"internalIPs,omitempty"`
-
// Metadata: Preserved metadata defined for this instance.
Metadata map[string]string `json:"metadata,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Disks") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Disks") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Disks") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *PreservedState) MarshalJSON() ([]byte, error) {
+func (s PreservedState) MarshalJSON() ([]byte, error) {
type NoMethod PreservedState
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type PreservedStatePreservedDisk struct {
- // AutoDelete: These stateful disks will never be deleted during
- // autohealing, update, instance recreate operations. This flag is used
- // to configure if the disk should be deleted after it is no longer used
- // by the group, e.g. when the given instance or the whole MIG is
- // deleted. Note: disks attached in READ_ONLY mode cannot be
- // auto-deleted.
+ // AutoDelete: These stateful disks will never be deleted during autohealing,
+ // update, instance recreate operations. This flag is used to configure if the
+ // disk should be deleted after it is no longer used by the group, e.g. when
+ // the given instance or the whole MIG is deleted. Note: disks attached in
+ // READ_ONLY mode cannot be auto-deleted.
//
// Possible values:
// "NEVER"
// "ON_PERMANENT_INSTANCE_DELETION"
AutoDelete string `json:"autoDelete,omitempty"`
-
- // Mode: The mode in which to attach this disk, either READ_WRITE or
- // READ_ONLY. If not specified, the default is to attach the disk in
- // READ_WRITE mode.
+ // Mode: The mode in which to attach this disk, either READ_WRITE or READ_ONLY.
+ // If not specified, the default is to attach the disk in READ_WRITE mode.
//
// Possible values:
- // "READ_ONLY" - Attaches this disk in read-only mode. Multiple VM
- // instances can use a disk in READ_ONLY mode at a time.
- // "READ_WRITE" - *[Default]* Attaches this disk in READ_WRITE mode.
- // Only one VM instance at a time can be attached to a disk in
- // READ_WRITE mode.
+ // "READ_ONLY" - Attaches this disk in read-only mode. Multiple VM instances
+ // can use a disk in READ_ONLY mode at a time.
+ // "READ_WRITE" - *[Default]* Attaches this disk in READ_WRITE mode. Only one
+ // VM instance at a time can be attached to a disk in READ_WRITE mode.
Mode string `json:"mode,omitempty"`
-
- // Source: The URL of the disk resource that is stateful and should be
- // attached to the VM instance.
+ // Source: The URL of the disk resource that is stateful and should be attached
+ // to the VM instance.
Source string `json:"source,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "AutoDelete") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "AutoDelete") 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. "AutoDelete") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *PreservedStatePreservedDisk) MarshalJSON() ([]byte, error) {
+func (s PreservedStatePreservedDisk) MarshalJSON() ([]byte, error) {
type NoMethod PreservedStatePreservedDisk
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type PreservedStatePreservedNetworkIp struct {
- // AutoDelete: These stateful IPs will never be released during
- // autohealing, update or VM instance recreate operations. This flag is
- // used to configure if the IP reservation should be deleted after it is
- // no longer used by the group, e.g. when the given instance or the
- // whole group is deleted.
+ // AutoDelete: These stateful IPs will never be released during autohealing,
+ // update or VM instance recreate operations. This flag is used to configure if
+ // the IP reservation should be deleted after it is no longer used by the
+ // group, e.g. when the given instance or the whole group is deleted.
//
// Possible values:
// "NEVER"
// "ON_PERMANENT_INSTANCE_DELETION"
AutoDelete string `json:"autoDelete,omitempty"`
-
// IpAddress: Ip address representation
IpAddress *PreservedStatePreservedNetworkIpIpAddress `json:"ipAddress,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "AutoDelete") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "AutoDelete") 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. "AutoDelete") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *PreservedStatePreservedNetworkIp) MarshalJSON() ([]byte, error) {
+func (s PreservedStatePreservedNetworkIp) MarshalJSON() ([]byte, error) {
type NoMethod PreservedStatePreservedNetworkIp
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type PreservedStatePreservedNetworkIpIpAddress struct {
// Address: The URL of the reservation for this IP address.
Address string `json:"address,omitempty"`
-
- // Literal: An IPv4 internal network address to assign to the instance
- // for this network interface.
+ // Literal: An IPv4 internal network address to assign to the instance for this
+ // network interface.
Literal string `json:"literal,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Address") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Address") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Address") 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. "Address") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *PreservedStatePreservedNetworkIpIpAddress) MarshalJSON() ([]byte, error) {
+func (s PreservedStatePreservedNetworkIpIpAddress) MarshalJSON() ([]byte, error) {
type NoMethod PreservedStatePreservedNetworkIpIpAddress
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// Project: Represents a Project resource. A project is used to organize
-// resources in a Google Cloud Platform environment. For more
-// information, read about the Resource Hierarchy.
+// resources in a Google Cloud Platform environment. For more information, read
+// about the Resource Hierarchy.
type Project struct {
- // CommonInstanceMetadata: Metadata key/value pairs available to all
- // instances contained in this project. See Custom metadata for more
- // information.
+ // CloudArmorTier: [Output Only] The Cloud Armor tier for this project. It can
+ // be one of the following values: CA_STANDARD, CA_ENTERPRISE_PAYGO. If this
+ // field is not specified, it is assumed to be CA_STANDARD.
+ //
+ // Possible values:
+ // "CA_ENTERPRISE_ANNUAL" - Enterprise tier protection billed annually.
+ // "CA_ENTERPRISE_PAYGO" - Enterprise tier protection billed monthly.
+ // "CA_STANDARD" - Standard protection.
+ CloudArmorTier string `json:"cloudArmorTier,omitempty"`
+ // CommonInstanceMetadata: Metadata key/value pairs available to all instances
+ // contained in this project. See Custom metadata for more information.
CommonInstanceMetadata *Metadata `json:"commonInstanceMetadata,omitempty"`
-
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
// DefaultNetworkTier: This signifies the default network tier used for
- // configuring resources of the project and can only take the following
- // values: PREMIUM, STANDARD. Initially the default network tier is
- // PREMIUM.
+ // configuring resources of the project and can only take the following values:
+ // PREMIUM, STANDARD. Initially the default network tier is PREMIUM.
//
// Possible values:
// "FIXED_STANDARD" - Public internet quality with fixed bandwidth.
- // "PREMIUM" - High quality, Google-grade network tier, support for
- // all networking products.
- // "STANDARD" - Public internet quality, only limited support for
- // other networking products.
- // "STANDARD_OVERRIDES_FIXED_STANDARD" - (Output only) Temporary tier
- // for FIXED_STANDARD when fixed standard tier is expired or not
- // configured.
+ // "PREMIUM" - High quality, Google-grade network tier, support for all
+ // networking products.
+ // "STANDARD" - Public internet quality, only limited support for other
+ // networking products.
+ // "STANDARD_OVERRIDES_FIXED_STANDARD" - (Output only) Temporary tier for
+ // FIXED_STANDARD when fixed standard tier is expired or not configured.
DefaultNetworkTier string `json:"defaultNetworkTier,omitempty"`
-
- // DefaultServiceAccount: [Output Only] Default service account used by
- // VMs running in this project.
+ // DefaultServiceAccount: [Output Only] Default service account used by VMs
+ // running in this project.
DefaultServiceAccount string `json:"defaultServiceAccount,omitempty"`
-
// Description: An optional textual description of the resource.
Description string `json:"description,omitempty"`
-
// EnabledFeatures: Restricted features enabled for use on this project.
EnabledFeatures []string `json:"enabledFeatures,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server. This is *not* the project ID,
- // and is just a unique ID used by Compute Engine to identify resources.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server. This is *not* the project ID, and is just a unique ID
+ // used by Compute Engine to identify resources.
Id uint64 `json:"id,omitempty,string"`
-
// Kind: [Output Only] Type of the resource. Always compute#project for
// projects.
Kind string `json:"kind,omitempty"`
-
- // Name: The project ID. For example: my-example-project. Use the
- // project ID to make requests to Compute Engine.
+ // Name: The project ID. For example: my-example-project. Use the project ID to
+ // make requests to Compute Engine.
Name string `json:"name,omitempty"`
-
// Quotas: [Output Only] Quotas assigned to this project.
Quotas []*Quota `json:"quotas,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // UsageExportLocation: The naming prefix for daily usage reports and
- // the Google Cloud Storage bucket where they are stored.
+ // UsageExportLocation: The naming prefix for daily usage reports and the
+ // Google Cloud Storage bucket where they are stored.
UsageExportLocation *UsageExportLocation `json:"usageExportLocation,omitempty"`
-
- // VmDnsSetting: [Output Only] Default internal DNS setting used by VMs
- // running in this project.
+ // VmDnsSetting: [Output Only] Default internal DNS setting used by VMs running
+ // in this project.
//
// Possible values:
// "GLOBAL_DEFAULT"
@@ -38060,171 +32242,158 @@ type Project struct {
// "ZONAL_DEFAULT"
// "ZONAL_ONLY"
VmDnsSetting string `json:"vmDnsSetting,omitempty"`
-
- // XpnProjectStatus: [Output Only] The role this project has in a shared
- // VPC configuration. Currently, only projects with the host role, which
- // is specified by the value HOST, are differentiated.
+ // XpnProjectStatus: [Output Only] The role this project has in a shared VPC
+ // configuration. Currently, only projects with the host role, which is
+ // specified by the value HOST, are differentiated.
//
// Possible values:
// "HOST"
// "UNSPECIFIED_XPN_PROJECT_STATUS"
XpnProjectStatus string `json:"xpnProjectStatus,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g.
- // "CommonInstanceMetadata") to unconditionally include in API requests.
- // By default, fields with empty or default 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. "CommonInstanceMetadata")
- // 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.
+ // ForceSendFields is a list of field names (e.g. "CloudArmorTier") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "CloudArmorTier") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *Project) MarshalJSON() ([]byte, error) {
+func (s Project) MarshalJSON() ([]byte, error) {
type NoMethod Project
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ProjectsDisableXpnResourceRequest struct {
// XpnResource: Service resource (a.k.a service project) ID.
XpnResource *XpnResourceId `json:"xpnResource,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "XpnResource") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "XpnResource") 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. "XpnResource") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ProjectsDisableXpnResourceRequest) MarshalJSON() ([]byte, error) {
+func (s ProjectsDisableXpnResourceRequest) MarshalJSON() ([]byte, error) {
type NoMethod ProjectsDisableXpnResourceRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ProjectsEnableXpnResourceRequest struct {
// XpnResource: Service resource (a.k.a service project) ID.
XpnResource *XpnResourceId `json:"xpnResource,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "XpnResource") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "XpnResource") 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. "XpnResource") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ProjectsEnableXpnResourceRequest) MarshalJSON() ([]byte, error) {
+func (s ProjectsEnableXpnResourceRequest) MarshalJSON() ([]byte, error) {
type NoMethod ProjectsEnableXpnResourceRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ProjectsGetXpnResources struct {
- // Kind: [Output Only] Type of resource. Always
- // compute#projectsGetXpnResources for lists of service resources (a.k.a
- // service projects)
+ // Kind: [Output Only] Type of resource. Always compute#projectsGetXpnResources
+ // for lists of service resources (a.k.a service projects)
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
- // Resources: Service resources (a.k.a service projects) attached to
- // this project as their shared VPC host.
+ // Resources: Service resources (a.k.a service projects) attached to this
+ // project as their shared VPC host.
Resources []*XpnResourceId `json:"resources,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Kind") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Kind") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
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 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. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ProjectsGetXpnResources) MarshalJSON() ([]byte, error) {
+func (s ProjectsGetXpnResources) MarshalJSON() ([]byte, error) {
type NoMethod ProjectsGetXpnResources
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ProjectsListXpnHostsRequest struct {
- // Organization: Optional organization ID managed by Cloud Resource
- // Manager, for which to list shared VPC host projects. If not
- // specified, the organization will be inferred from the project.
+ // Organization: Optional organization ID managed by Cloud Resource Manager,
+ // for which to list shared VPC host projects. If not specified, the
+ // organization will be inferred from the project.
Organization string `json:"organization,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Organization") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Organization") 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. "Organization") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ProjectsListXpnHostsRequest) MarshalJSON() ([]byte, error) {
+func (s ProjectsListXpnHostsRequest) MarshalJSON() ([]byte, error) {
type NoMethod ProjectsListXpnHostsRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+type ProjectsSetCloudArmorTierRequest struct {
+ // CloudArmorTier: Managed protection tier to be set.
+ //
+ // Possible values:
+ // "CA_ENTERPRISE_ANNUAL" - Enterprise tier protection billed annually.
+ // "CA_ENTERPRISE_PAYGO" - Enterprise tier protection billed monthly.
+ // "CA_STANDARD" - Standard protection.
+ CloudArmorTier string `json:"cloudArmorTier,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "CloudArmorTier") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "CloudArmorTier") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s ProjectsSetCloudArmorTierRequest) MarshalJSON() ([]byte, error) {
+ type NoMethod ProjectsSetCloudArmorTierRequest
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ProjectsSetDefaultNetworkTierRequest struct {
@@ -38232,1163 +32401,955 @@ type ProjectsSetDefaultNetworkTierRequest struct {
//
// Possible values:
// "FIXED_STANDARD" - Public internet quality with fixed bandwidth.
- // "PREMIUM" - High quality, Google-grade network tier, support for
- // all networking products.
- // "STANDARD" - Public internet quality, only limited support for
- // other networking products.
- // "STANDARD_OVERRIDES_FIXED_STANDARD" - (Output only) Temporary tier
- // for FIXED_STANDARD when fixed standard tier is expired or not
- // configured.
+ // "PREMIUM" - High quality, Google-grade network tier, support for all
+ // networking products.
+ // "STANDARD" - Public internet quality, only limited support for other
+ // networking products.
+ // "STANDARD_OVERRIDES_FIXED_STANDARD" - (Output only) Temporary tier for
+ // FIXED_STANDARD when fixed standard tier is expired or not configured.
NetworkTier string `json:"networkTier,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "NetworkTier") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "NetworkTier") 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. "NetworkTier") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ProjectsSetDefaultNetworkTierRequest) MarshalJSON() ([]byte, error) {
+func (s ProjectsSetDefaultNetworkTierRequest) MarshalJSON() ([]byte, error) {
type NoMethod ProjectsSetDefaultNetworkTierRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// PublicAdvertisedPrefix: A public advertised prefix represents an
-// aggregated IP prefix or netblock which customers bring to cloud. The
-// IP prefix is a single unit of route advertisement and is announced
-// globally to the internet.
+// PublicAdvertisedPrefix: A public advertised prefix represents an aggregated
+// IP prefix or netblock which customers bring to cloud. The IP prefix is a
+// single unit of route advertisement and is announced globally to the
+// internet.
type PublicAdvertisedPrefix struct {
// ByoipApiVersion: [Output Only] The version of BYOIP API.
//
// Possible values:
- // "V1" - This public advertised prefix can be used to create both
- // regional and global public delegated prefixes. It usually takes 4
- // weeks to create or delete a public delegated prefix. The BGP status
- // cannot be changed.
- // "V2" - This public advertised prefix can only be used to create
- // regional public delegated prefixes. Public delegated prefix creation
- // and deletion takes minutes and the BGP status can be modified.
+ // "V1" - This public advertised prefix can be used to create both regional
+ // and global public delegated prefixes. It usually takes 4 weeks to create or
+ // delete a public delegated prefix. The BGP status cannot be changed.
+ // "V2" - This public advertised prefix can only be used to create regional
+ // public delegated prefixes. Public delegated prefix creation and deletion
+ // takes minutes and the BGP status can be modified.
ByoipApiVersion string `json:"byoipApiVersion,omitempty"`
-
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // DnsVerificationIp: The address to be used for reverse DNS
- // verification.
+ // DnsVerificationIp: The address to be used for reverse DNS verification.
DnsVerificationIp string `json:"dnsVerificationIp,omitempty"`
-
- // Fingerprint: Fingerprint of this resource. A hash of the contents
- // stored in this object. This field is used in optimistic locking. This
- // field will be ignored when inserting a new PublicAdvertisedPrefix. An
- // up-to-date fingerprint must be provided in order to update the
- // PublicAdvertisedPrefix, otherwise the request will fail with error
- // 412 conditionNotMet. To see the latest fingerprint, make a get()
- // request to retrieve a PublicAdvertisedPrefix.
+ // Fingerprint: Fingerprint of this resource. A hash of the contents stored in
+ // this object. This field is used in optimistic locking. This field will be
+ // ignored when inserting a new PublicAdvertisedPrefix. An up-to-date
+ // fingerprint must be provided in order to update the PublicAdvertisedPrefix,
+ // otherwise the request will fail with error 412 conditionNotMet. To see the
+ // latest fingerprint, make a get() request to retrieve a
+ // PublicAdvertisedPrefix.
Fingerprint string `json:"fingerprint,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource type. The
- // server generates this identifier.
+ // Id: [Output Only] The unique identifier for the resource type. The server
+ // generates this identifier.
Id uint64 `json:"id,omitempty,string"`
-
- // IpCidrRange: The address range, in CIDR format, represented by this
- // public advertised prefix.
+ // IpCidrRange: The address range, in CIDR format, represented by this public
+ // advertised prefix.
IpCidrRange string `json:"ipCidrRange,omitempty"`
-
// Kind: [Output Only] Type of the resource. Always
// compute#publicAdvertisedPrefix for public advertised prefixes.
Kind string `json:"kind,omitempty"`
-
- // Name: Name of the resource. Provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
- // the first character must be a lowercase letter, and all following
- // characters must be a dash, lowercase letter, or digit, except the
- // last character, which cannot be a dash.
+ // Name: Name of the resource. Provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must
+ // be a lowercase letter, and all following characters must be a dash,
+ // lowercase letter, or digit, except the last character, which cannot be a
+ // dash.
Name string `json:"name,omitempty"`
-
- // PdpScope: Specifies how child public delegated prefix will be scoped.
- // It could be one of following values: - `REGIONAL`: The public
- // delegated prefix is regional only. The provisioning will take a few
- // minutes. - `GLOBAL`: The public delegated prefix is global only. The
- // provisioning will take ~4 weeks. - `GLOBAL_AND_REGIONAL` [output
- // only]: The public delegated prefixes is BYOIP V1 legacy prefix. This
- // is output only value and no longer supported in BYOIP V2.
+ // PdpScope: Specifies how child public delegated prefix will be scoped. It
+ // could be one of following values: - `REGIONAL`: The public delegated prefix
+ // is regional only. The provisioning will take a few minutes. - `GLOBAL`: The
+ // public delegated prefix is global only. The provisioning will take ~4 weeks.
+ // - `GLOBAL_AND_REGIONAL` [output only]: The public delegated prefixes is
+ // BYOIP V1 legacy prefix. This is output only value and no longer supported in
+ // BYOIP V2.
//
// Possible values:
- // "GLOBAL" - The public delegated prefix is global only. The
- // provisioning will take ~4 weeks.
- // "GLOBAL_AND_REGIONAL" - The public delegated prefixes is BYOIP V1
- // legacy prefix. This is output only value and no longer supported in
- // BYOIP V2.
+ // "GLOBAL" - The public delegated prefix is global only. The provisioning
+ // will take ~4 weeks.
+ // "GLOBAL_AND_REGIONAL" - The public delegated prefixes is BYOIP V1 legacy
+ // prefix. This is output only value and no longer supported in BYOIP V2.
// "REGIONAL" - The public delegated prefix is regional only. The
// provisioning will take a few minutes.
PdpScope string `json:"pdpScope,omitempty"`
-
- // PublicDelegatedPrefixs: [Output Only] The list of public delegated
- // prefixes that exist for this public advertised prefix.
+ // PublicDelegatedPrefixs: [Output Only] The list of public delegated prefixes
+ // that exist for this public advertised prefix.
PublicDelegatedPrefixs []*PublicAdvertisedPrefixPublicDelegatedPrefix `json:"publicDelegatedPrefixs,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // SharedSecret: [Output Only] The shared secret to be used for reverse
- // DNS verification.
+ // SharedSecret: [Output Only] The shared secret to be used for reverse DNS
+ // verification.
SharedSecret string `json:"sharedSecret,omitempty"`
-
- // Status: The status of the public advertised prefix. Possible values
- // include: - `INITIAL`: RPKI validation is complete. -
- // `PTR_CONFIGURED`: User has configured the PTR. - `VALIDATED`: Reverse
- // DNS lookup is successful. - `REVERSE_DNS_LOOKUP_FAILED`: Reverse DNS
- // lookup failed. - `PREFIX_CONFIGURATION_IN_PROGRESS`: The prefix is
- // being configured. - `PREFIX_CONFIGURATION_COMPLETE`: The prefix is
- // fully configured. - `PREFIX_REMOVAL_IN_PROGRESS`: The prefix is being
- // removed.
+ // Status: The status of the public advertised prefix. Possible values include:
+ // - `INITIAL`: RPKI validation is complete. - `PTR_CONFIGURED`: User has
+ // configured the PTR. - `VALIDATED`: Reverse DNS lookup is successful. -
+ // `REVERSE_DNS_LOOKUP_FAILED`: Reverse DNS lookup failed. -
+ // `PREFIX_CONFIGURATION_IN_PROGRESS`: The prefix is being configured. -
+ // `PREFIX_CONFIGURATION_COMPLETE`: The prefix is fully configured. -
+ // `PREFIX_REMOVAL_IN_PROGRESS`: The prefix is being removed.
//
// Possible values:
// "ANNOUNCED_TO_INTERNET" - The prefix is announced to Internet.
// "INITIAL" - RPKI validation is complete.
// "PREFIX_CONFIGURATION_COMPLETE" - The prefix is fully configured.
- // "PREFIX_CONFIGURATION_IN_PROGRESS" - The prefix is being
- // configured.
+ // "PREFIX_CONFIGURATION_IN_PROGRESS" - The prefix is being configured.
// "PREFIX_REMOVAL_IN_PROGRESS" - The prefix is being removed.
// "PTR_CONFIGURED" - User has configured the PTR.
- // "READY_TO_ANNOUNCE" - The prefix is currently withdrawn but ready
- // to be announced.
+ // "READY_TO_ANNOUNCE" - The prefix is currently withdrawn but ready to be
+ // announced.
// "REVERSE_DNS_LOOKUP_FAILED" - Reverse DNS lookup failed.
// "VALIDATED" - Reverse DNS lookup is successful.
Status string `json:"status,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
// ForceSendFields is a list of field names (e.g. "ByoipApiVersion") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "ByoipApiVersion") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "ByoipApiVersion") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *PublicAdvertisedPrefix) MarshalJSON() ([]byte, error) {
+func (s PublicAdvertisedPrefix) MarshalJSON() ([]byte, error) {
type NoMethod PublicAdvertisedPrefix
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type PublicAdvertisedPrefixList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of PublicAdvertisedPrefix resources.
Items []*PublicAdvertisedPrefix `json:"items,omitempty"`
-
// Kind: [Output Only] Type of the resource. Always
// compute#publicAdvertisedPrefix for public advertised prefixes.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *PublicAdvertisedPrefixListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *PublicAdvertisedPrefixList) MarshalJSON() ([]byte, error) {
+func (s PublicAdvertisedPrefixList) MarshalJSON() ([]byte, error) {
type NoMethod PublicAdvertisedPrefixList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// PublicAdvertisedPrefixListWarning: [Output Only] Informational
-// warning message.
+// PublicAdvertisedPrefixListWarning: [Output Only] Informational warning
+// message.
type PublicAdvertisedPrefixListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*PublicAdvertisedPrefixListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *PublicAdvertisedPrefixListWarning) MarshalJSON() ([]byte, error) {
+func (s PublicAdvertisedPrefixListWarning) MarshalJSON() ([]byte, error) {
type NoMethod PublicAdvertisedPrefixListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type PublicAdvertisedPrefixListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *PublicAdvertisedPrefixListWarningData) MarshalJSON() ([]byte, error) {
+func (s PublicAdvertisedPrefixListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod PublicAdvertisedPrefixListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// PublicAdvertisedPrefixPublicDelegatedPrefix: Represents a CIDR range
-// which can be used to assign addresses.
+// PublicAdvertisedPrefixPublicDelegatedPrefix: Represents a CIDR range which
+// can be used to assign addresses.
type PublicAdvertisedPrefixPublicDelegatedPrefix struct {
// IpRange: The IP address range of the public delegated prefix
IpRange string `json:"ipRange,omitempty"`
-
// Name: The name of the public delegated prefix
Name string `json:"name,omitempty"`
-
// Project: The project number of the public delegated prefix
Project string `json:"project,omitempty"`
-
- // Region: The region of the public delegated prefix if it is regional.
- // If absent, the prefix is global.
+ // Region: The region of the public delegated prefix if it is regional. If
+ // absent, the prefix is global.
Region string `json:"region,omitempty"`
-
- // Status: The status of the public delegated prefix. Possible values
- // are: INITIALIZING: The public delegated prefix is being initialized
- // and addresses cannot be created yet. ANNOUNCED: The public delegated
- // prefix is active.
+ // Status: The status of the public delegated prefix. Possible values are:
+ // INITIALIZING: The public delegated prefix is being initialized and addresses
+ // cannot be created yet. ANNOUNCED: The public delegated prefix is active.
Status string `json:"status,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "IpRange") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "IpRange") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "IpRange") 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. "IpRange") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *PublicAdvertisedPrefixPublicDelegatedPrefix) MarshalJSON() ([]byte, error) {
+func (s PublicAdvertisedPrefixPublicDelegatedPrefix) MarshalJSON() ([]byte, error) {
type NoMethod PublicAdvertisedPrefixPublicDelegatedPrefix
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// PublicDelegatedPrefix: A PublicDelegatedPrefix resource represents an
-// IP block within a PublicAdvertisedPrefix that is configured within a
-// single cloud scope (global or region). IPs in the block can be
-// allocated to resources within that scope. Public delegated prefixes
-// may be further broken up into smaller IP blocks in the same scope as
-// the parent block.
+// PublicDelegatedPrefix: A PublicDelegatedPrefix resource represents an IP
+// block within a PublicAdvertisedPrefix that is configured within a single
+// cloud scope (global or region). IPs in the block can be allocated to
+// resources within that scope. Public delegated prefixes may be further broken
+// up into smaller IP blocks in the same scope as the parent block.
type PublicDelegatedPrefix struct {
+ // AllocatablePrefixLength: The allocatable prefix length supported by this
+ // public delegated prefix. This field is optional and cannot be set for
+ // prefixes in DELEGATION mode. It cannot be set for IPv4 prefixes either, and
+ // it always defaults to 32.
+ AllocatablePrefixLength int64 `json:"allocatablePrefixLength,omitempty"`
// ByoipApiVersion: [Output Only] The version of BYOIP API.
//
// Possible values:
- // "V1" - This public delegated prefix usually takes 4 weeks to
- // delete, and the BGP status cannot be changed. Announce and Withdraw
- // APIs can not be used on this prefix.
- // "V2" - This public delegated prefix takes minutes to delete.
- // Announce and Withdraw APIs can be used on this prefix to change the
- // BGP status.
+ // "V1" - This public delegated prefix usually takes 4 weeks to delete, and
+ // the BGP status cannot be changed. Announce and Withdraw APIs can not be used
+ // on this prefix.
+ // "V2" - This public delegated prefix takes minutes to delete. Announce and
+ // Withdraw APIs can be used on this prefix to change the BGP status.
ByoipApiVersion string `json:"byoipApiVersion,omitempty"`
-
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // Fingerprint: Fingerprint of this resource. A hash of the contents
- // stored in this object. This field is used in optimistic locking. This
- // field will be ignored when inserting a new PublicDelegatedPrefix. An
- // up-to-date fingerprint must be provided in order to update the
- // PublicDelegatedPrefix, otherwise the request will fail with error 412
- // conditionNotMet. To see the latest fingerprint, make a get() request
- // to retrieve a PublicDelegatedPrefix.
+ // Fingerprint: Fingerprint of this resource. A hash of the contents stored in
+ // this object. This field is used in optimistic locking. This field will be
+ // ignored when inserting a new PublicDelegatedPrefix. An up-to-date
+ // fingerprint must be provided in order to update the PublicDelegatedPrefix,
+ // otherwise the request will fail with error 412 conditionNotMet. To see the
+ // latest fingerprint, make a get() request to retrieve a
+ // PublicDelegatedPrefix.
Fingerprint string `json:"fingerprint,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource type. The
- // server generates this identifier.
+ // Id: [Output Only] The unique identifier for the resource type. The server
+ // generates this identifier.
Id uint64 `json:"id,omitempty,string"`
-
- // IpCidrRange: The IP address range, in CIDR format, represented by
- // this public delegated prefix.
+ // IpCidrRange: The IP address range, in CIDR format, represented by this
+ // public delegated prefix.
IpCidrRange string `json:"ipCidrRange,omitempty"`
-
// IsLiveMigration: If true, the prefix will be live migrated.
IsLiveMigration bool `json:"isLiveMigration,omitempty"`
-
// Kind: [Output Only] Type of the resource. Always
// compute#publicDelegatedPrefix for public delegated prefixes.
Kind string `json:"kind,omitempty"`
-
- // Name: Name of the resource. Provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
- // the first character must be a lowercase letter, and all following
- // characters must be a dash, lowercase letter, or digit, except the
- // last character, which cannot be a dash.
+ // Mode: The public delegated prefix mode for IPv6 only.
+ //
+ // Possible values:
+ // "DELEGATION" - The public delegated prefix is used for further
+ // sub-delegation only. Such prefixes cannot set allocatablePrefixLength.
+ // "EXTERNAL_IPV6_FORWARDING_RULE_CREATION" - The public delegated prefix is
+ // used for creating forwarding rules only. Such prefixes cannot set
+ // publicDelegatedSubPrefixes.
+ Mode string `json:"mode,omitempty"`
+ // Name: Name of the resource. Provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must
+ // be a lowercase letter, and all following characters must be a dash,
+ // lowercase letter, or digit, except the last character, which cannot be a
+ // dash.
Name string `json:"name,omitempty"`
-
- // ParentPrefix: The URL of parent prefix. Either PublicAdvertisedPrefix
- // or PublicDelegatedPrefix.
+ // ParentPrefix: The URL of parent prefix. Either PublicAdvertisedPrefix or
+ // PublicDelegatedPrefix.
ParentPrefix string `json:"parentPrefix,omitempty"`
-
- // PublicDelegatedSubPrefixs: The list of sub public delegated prefixes
- // that exist for this public delegated prefix.
+ // PublicDelegatedSubPrefixs: The list of sub public delegated prefixes that
+ // exist for this public delegated prefix.
PublicDelegatedSubPrefixs []*PublicDelegatedPrefixPublicDelegatedSubPrefix `json:"publicDelegatedSubPrefixs,omitempty"`
-
- // Region: [Output Only] URL of the region where the public delegated
- // prefix resides. This field applies only to the region resource. You
- // must specify this field as part of the HTTP request URL. It is not
- // settable as a field in the request body.
+ // Region: [Output Only] URL of the region where the public delegated prefix
+ // resides. This field applies only to the region resource. You must specify
+ // this field as part of the HTTP request URL. It is not settable as a field in
+ // the request body.
Region string `json:"region,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // Status: [Output Only] The status of the public delegated prefix,
- // which can be one of following values: - `INITIALIZING` The public
- // delegated prefix is being initialized and addresses cannot be created
- // yet. - `READY_TO_ANNOUNCE` The public delegated prefix is a live
- // migration prefix and is active. - `ANNOUNCED` The public delegated
- // prefix is active. - `DELETING` The public delegated prefix is being
- // deprovsioned.
+ // Status: [Output Only] The status of the public delegated prefix, which can
+ // be one of following values: - `INITIALIZING` The public delegated prefix is
+ // being initialized and addresses cannot be created yet. - `READY_TO_ANNOUNCE`
+ // The public delegated prefix is a live migration prefix and is active. -
+ // `ANNOUNCED` The public delegated prefix is active. - `DELETING` The public
+ // delegated prefix is being deprovsioned.
//
// Possible values:
// "ANNOUNCED" - The public delegated prefix is active.
- // "ANNOUNCED_TO_GOOGLE" - The prefix is announced within Google
- // network.
- // "ANNOUNCED_TO_INTERNET" - The prefix is announced to Internet and
- // within Google.
+ // "ANNOUNCED_TO_GOOGLE" - The prefix is announced within Google network.
+ // "ANNOUNCED_TO_INTERNET" - The prefix is announced to Internet and within
+ // Google.
// "DELETING" - The public delegated prefix is being deprovsioned.
- // "INITIALIZING" - The public delegated prefix is being initialized
- // and addresses cannot be created yet.
- // "READY_TO_ANNOUNCE" - The public delegated prefix is currently
- // withdrawn but ready to be announced.
+ // "INITIALIZING" - The public delegated prefix is being initialized and
+ // addresses cannot be created yet.
+ // "READY_TO_ANNOUNCE" - The public delegated prefix is currently withdrawn
+ // but ready to be announced.
Status string `json:"status,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "ByoipApiVersion") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "ByoipApiVersion") 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.
+ // ForceSendFields is a list of field names (e.g. "AllocatablePrefixLength") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "AllocatablePrefixLength") to
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *PublicDelegatedPrefix) MarshalJSON() ([]byte, error) {
+func (s PublicDelegatedPrefix) MarshalJSON() ([]byte, error) {
type NoMethod PublicDelegatedPrefix
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type PublicDelegatedPrefixAggregatedList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of PublicDelegatedPrefixesScopedList resources.
Items map[string]PublicDelegatedPrefixesScopedList `json:"items,omitempty"`
-
// Kind: [Output Only] Type of the resource. Always
- // compute#publicDelegatedPrefixAggregatedList for aggregated lists of
- // public delegated prefixes.
+ // compute#publicDelegatedPrefixAggregatedList for aggregated lists of public
+ // delegated prefixes.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Unreachables: [Output Only] Unreachable resources.
Unreachables []string `json:"unreachables,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *PublicDelegatedPrefixAggregatedListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *PublicDelegatedPrefixAggregatedList) MarshalJSON() ([]byte, error) {
+func (s PublicDelegatedPrefixAggregatedList) MarshalJSON() ([]byte, error) {
type NoMethod PublicDelegatedPrefixAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// PublicDelegatedPrefixAggregatedListWarning: [Output Only]
-// Informational warning message.
+// PublicDelegatedPrefixAggregatedListWarning: [Output Only] Informational
+// warning message.
type PublicDelegatedPrefixAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*PublicDelegatedPrefixAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *PublicDelegatedPrefixAggregatedListWarning) MarshalJSON() ([]byte, error) {
+func (s PublicDelegatedPrefixAggregatedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod PublicDelegatedPrefixAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type PublicDelegatedPrefixAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *PublicDelegatedPrefixAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+func (s PublicDelegatedPrefixAggregatedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod PublicDelegatedPrefixAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type PublicDelegatedPrefixList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of PublicDelegatedPrefix resources.
Items []*PublicDelegatedPrefix `json:"items,omitempty"`
-
// Kind: [Output Only] Type of the resource. Always
// compute#publicDelegatedPrefixList for public delegated prefixes.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *PublicDelegatedPrefixListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *PublicDelegatedPrefixList) MarshalJSON() ([]byte, error) {
+func (s PublicDelegatedPrefixList) MarshalJSON() ([]byte, error) {
type NoMethod PublicDelegatedPrefixList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// PublicDelegatedPrefixListWarning: [Output Only] Informational warning
// message.
type PublicDelegatedPrefixListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*PublicDelegatedPrefixListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *PublicDelegatedPrefixListWarning) MarshalJSON() ([]byte, error) {
+func (s PublicDelegatedPrefixListWarning) MarshalJSON() ([]byte, error) {
type NoMethod PublicDelegatedPrefixListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type PublicDelegatedPrefixListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *PublicDelegatedPrefixListWarningData) MarshalJSON() ([]byte, error) {
+func (s PublicDelegatedPrefixListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod PublicDelegatedPrefixListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// PublicDelegatedPrefixPublicDelegatedSubPrefix: Represents a sub
// PublicDelegatedPrefix.
type PublicDelegatedPrefixPublicDelegatedSubPrefix struct {
- // DelegateeProject: Name of the project scoping this
+ // AllocatablePrefixLength: The allocatable prefix length supported by this
// PublicDelegatedSubPrefix.
+ AllocatablePrefixLength int64 `json:"allocatablePrefixLength,omitempty"`
+ // DelegateeProject: Name of the project scoping this PublicDelegatedSubPrefix.
DelegateeProject string `json:"delegateeProject,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // IpCidrRange: The IP address range, in CIDR format, represented by
- // this sub public delegated prefix.
+ // IpCidrRange: The IP address range, in CIDR format, represented by this sub
+ // public delegated prefix.
IpCidrRange string `json:"ipCidrRange,omitempty"`
-
- // IsAddress: Whether the sub prefix is delegated to create Address
- // resources in the delegatee project.
+ // IsAddress: Whether the sub prefix is delegated to create Address resources
+ // in the delegatee project.
IsAddress bool `json:"isAddress,omitempty"`
-
+ // Mode: The PublicDelegatedSubPrefix mode for IPv6 only.
+ //
+ // Possible values:
+ // "DELEGATION" - The public delegated prefix is used for further
+ // sub-delegation only. Such prefixes cannot set allocatablePrefixLength.
+ // "EXTERNAL_IPV6_FORWARDING_RULE_CREATION" - The public delegated prefix is
+ // used for creating forwarding rules only. Such prefixes cannot set
+ // publicDelegatedSubPrefixes.
+ Mode string `json:"mode,omitempty"`
// Name: The name of the sub public delegated prefix.
Name string `json:"name,omitempty"`
-
- // Region: [Output Only] The region of the sub public delegated prefix
- // if it is regional. If absent, the sub prefix is global.
+ // Region: [Output Only] The region of the sub public delegated prefix if it is
+ // regional. If absent, the sub prefix is global.
Region string `json:"region,omitempty"`
-
// Status: [Output Only] The status of the sub public delegated prefix.
//
// Possible values:
// "ACTIVE"
// "INACTIVE"
Status string `json:"status,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "DelegateeProject") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "AllocatablePrefixLength") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "DelegateeProject") 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. "AllocatablePrefixLength") to
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *PublicDelegatedPrefixPublicDelegatedSubPrefix) MarshalJSON() ([]byte, error) {
+func (s PublicDelegatedPrefixPublicDelegatedSubPrefix) MarshalJSON() ([]byte, error) {
type NoMethod PublicDelegatedPrefixPublicDelegatedSubPrefix
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type PublicDelegatedPrefixesScopedList struct {
- // PublicDelegatedPrefixes: [Output Only] A list of
- // PublicDelegatedPrefixes contained in this scope.
+ // PublicDelegatedPrefixes: [Output Only] A list of PublicDelegatedPrefixes
+ // contained in this scope.
PublicDelegatedPrefixes []*PublicDelegatedPrefix `json:"publicDelegatedPrefixes,omitempty"`
-
- // Warning: [Output Only] Informational warning which replaces the list
- // of public delegated prefixes when the list is empty.
+ // Warning: [Output Only] Informational warning which replaces the list of
+ // public delegated prefixes when the list is empty.
Warning *PublicDelegatedPrefixesScopedListWarning `json:"warning,omitempty"`
-
- // ForceSendFields is a list of field names (e.g.
- // "PublicDelegatedPrefixes") to unconditionally include in API
- // requests. By default, fields with empty or default 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. "PublicDelegatedPrefixes")
- // 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.
+ // ForceSendFields is a list of field names (e.g. "PublicDelegatedPrefixes") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "PublicDelegatedPrefixes") to
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *PublicDelegatedPrefixesScopedList) MarshalJSON() ([]byte, error) {
+func (s PublicDelegatedPrefixesScopedList) MarshalJSON() ([]byte, error) {
type NoMethod PublicDelegatedPrefixesScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// PublicDelegatedPrefixesScopedListWarning: [Output Only] Informational
-// warning which replaces the list of public delegated prefixes when the
-// list is empty.
+// warning which replaces the list of public delegated prefixes when the list
+// is empty.
type PublicDelegatedPrefixesScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*PublicDelegatedPrefixesScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *PublicDelegatedPrefixesScopedListWarning) MarshalJSON() ([]byte, error) {
+func (s PublicDelegatedPrefixesScopedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod PublicDelegatedPrefixesScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type PublicDelegatedPrefixesScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *PublicDelegatedPrefixesScopedListWarningData) MarshalJSON() ([]byte, error) {
+func (s PublicDelegatedPrefixesScopedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod PublicDelegatedPrefixesScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// Quota: A quotas entry.
type Quota struct {
// Limit: [Output Only] Quota limit for this metric.
Limit float64 `json:"limit,omitempty"`
-
// Metric: [Output Only] Name of the quota metric.
//
// Possible values:
@@ -39425,6 +33386,7 @@ type Quota struct {
// "COMMITTED_NVIDIA_V100_GPUS"
// "COMMITTED_T2A_CPUS"
// "COMMITTED_T2D_CPUS"
+ // "COMMITTED_Z3_CPUS"
// "CPUS" - Guest CPUs
// "CPUS_ALL_REGIONS"
// "DISKS_TOTAL_GB"
@@ -39442,6 +33404,9 @@ type Quota struct {
// "GLOBAL_INTERNAL_MANAGED_BACKEND_SERVICES"
// "GLOBAL_INTERNAL_TRAFFIC_DIRECTOR_BACKEND_SERVICES"
// "GPUS_ALL_REGIONS"
+ // "HDB_TOTAL_GB"
+ // "HDB_TOTAL_IOPS"
+ // "HDB_TOTAL_THROUGHPUT"
// "HEALTH_CHECKS"
// "IMAGES"
// "INSTANCES"
@@ -39515,6 +33480,7 @@ type Quota struct {
// "REGIONAL_INSTANCE_GROUP_MANAGERS"
// "REGIONAL_INTERNAL_LB_BACKEND_SERVICES"
// "REGIONAL_INTERNAL_MANAGED_BACKEND_SERVICES"
+ // "REGIONAL_INTERNAL_TRAFFIC_DIRECTOR_BACKEND_SERVICES"
// "RESERVATIONS"
// "RESOURCE_POLICIES"
// "ROUTERS"
@@ -39526,10 +33492,10 @@ type Quota struct {
// "SECURITY_POLICY_RULES"
// "SECURITY_POLICY_RULES_PER_REGION"
// "SERVICE_ATTACHMENTS"
- // "SNAPSHOTS" - The total number of snapshots allowed for a single
- // project.
+ // "SNAPSHOTS" - The total number of snapshots allowed for a single project.
// "SSD_TOTAL_GB"
// "SSL_CERTIFICATES"
+ // "SSL_POLICIES"
// "STATIC_ADDRESSES"
// "STATIC_BYOIP_ADDRESSES"
// "STATIC_EXTERNAL_IPV6_ADDRESS_RANGES"
@@ -39547,39 +33513,32 @@ type Quota struct {
// "TPU_LITE_PODSLICE_V5"
// "TPU_PODSLICE_V4"
// "URL_MAPS"
+ // "VARIABLE_IPV6_PUBLIC_DELEGATED_PREFIXES"
// "VPN_GATEWAYS"
// "VPN_TUNNELS"
// "XPN_SERVICE_PROJECTS"
Metric string `json:"metric,omitempty"`
-
- // Owner: [Output Only] Owning resource. This is the resource on which
- // this quota is applied.
+ // Owner: [Output Only] Owning resource. This is the resource on which this
+ // quota is applied.
Owner string `json:"owner,omitempty"`
-
// Usage: [Output Only] Current usage of this metric.
Usage float64 `json:"usage,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Limit") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Limit") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Limit") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *Quota) MarshalJSON() ([]byte, error) {
+func (s Quota) MarshalJSON() ([]byte, error) {
type NoMethod Quota
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
func (s *Quota) UnmarshalJSON(data []byte) error {
@@ -39598,56 +33557,45 @@ func (s *Quota) UnmarshalJSON(data []byte) error {
return nil
}
-// QuotaExceededInfo: Additional details for quota exceeded error for
-// resource quota.
+// QuotaExceededInfo: Additional details for quota exceeded error for resource
+// quota.
type QuotaExceededInfo struct {
// Dimensions: The map holding related quota dimensions.
Dimensions map[string]string `json:"dimensions,omitempty"`
-
- // FutureLimit: Future quota limit being rolled out. The limit's unit
- // depends on the quota type or metric.
+ // FutureLimit: Future quota limit being rolled out. The limit's unit depends
+ // on the quota type or metric.
FutureLimit float64 `json:"futureLimit,omitempty"`
-
- // Limit: Current effective quota limit. The limit's unit depends on the
- // quota type or metric.
+ // Limit: Current effective quota limit. The limit's unit depends on the quota
+ // type or metric.
Limit float64 `json:"limit,omitempty"`
-
// LimitName: The name of the quota limit.
LimitName string `json:"limitName,omitempty"`
-
// MetricName: The Compute Engine quota metric name.
MetricName string `json:"metricName,omitempty"`
-
// RolloutStatus: Rollout status of the future quota limit.
//
// Possible values:
- // "IN_PROGRESS" - IN_PROGRESS - A rollout is in process which will
- // change the limit value to future limit.
- // "ROLLOUT_STATUS_UNSPECIFIED" - ROLLOUT_STATUS_UNSPECIFIED - Rollout
- // status is not specified. The default value.
+ // "IN_PROGRESS" - IN_PROGRESS - A rollout is in process which will change
+ // the limit value to future limit.
+ // "ROLLOUT_STATUS_UNSPECIFIED" - ROLLOUT_STATUS_UNSPECIFIED - Rollout status
+ // is not specified. The default value.
RolloutStatus string `json:"rolloutStatus,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Dimensions") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Dimensions") 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. "Dimensions") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *QuotaExceededInfo) MarshalJSON() ([]byte, error) {
+func (s QuotaExceededInfo) MarshalJSON() ([]byte, error) {
type NoMethod QuotaExceededInfo
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
func (s *QuotaExceededInfo) UnmarshalJSON(data []byte) error {
@@ -39668,627 +33616,611 @@ func (s *QuotaExceededInfo) UnmarshalJSON(data []byte) error {
// Reference: Represents a reference to a resource.
type Reference struct {
- // Kind: [Output Only] Type of the resource. Always compute#reference
- // for references.
+ // Kind: [Output Only] Type of the resource. Always compute#reference for
+ // references.
Kind string `json:"kind,omitempty"`
-
// ReferenceType: A description of the reference type with no implied
// semantics. Possible values include: 1. MEMBER_OF
ReferenceType string `json:"referenceType,omitempty"`
-
// Referrer: URL of the resource which refers to the target.
Referrer string `json:"referrer,omitempty"`
-
// Target: URL of the resource to which this reference points.
Target string `json:"target,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Kind") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Kind") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
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 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. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *Reference) MarshalJSON() ([]byte, error) {
+func (s Reference) MarshalJSON() ([]byte, error) {
type NoMethod Reference
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// Region: Represents a Region resource. A region is a geographical area
-// where a resource is located. For more information, read Regions and
-// Zones.
+// Region: Represents a Region resource. A region is a geographical area where
+// a resource is located. For more information, read Regions and Zones.
type Region struct {
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Deprecated -- [Output Only] The deprecation status associated with
- // this region.
+ // Deprecated -- [Output Only] The deprecation status associated with this
+ // region.
Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
-
// Description: [Output Only] Textual description of the resource.
Description string `json:"description,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
- // Kind: [Output Only] Type of the resource. Always compute#region for
- // regions.
+ // Kind: [Output Only] Type of the resource. Always compute#region for regions.
Kind string `json:"kind,omitempty"`
-
// Name: [Output Only] Name of the resource.
Name string `json:"name,omitempty"`
-
+ // QuotaStatusWarning: [Output Only] Warning of fetching the `quotas` field for
+ // this region. This field is populated only if fetching of the `quotas` field
+ // fails.
+ QuotaStatusWarning *RegionQuotaStatusWarning `json:"quotaStatusWarning,omitempty"`
// Quotas: [Output Only] Quotas assigned to this region.
Quotas []*Quota `json:"quotas,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Status: [Output Only] Status of the region, either UP or DOWN.
//
// Possible values:
// "DOWN"
// "UP"
Status string `json:"status,omitempty"`
-
// SupportsPzs: [Output Only] Reserved for future use.
SupportsPzs bool `json:"supportsPzs,omitempty"`
-
- // Zones: [Output Only] A list of zones available in this region, in the
- // form of resource URLs.
+ // Zones: [Output Only] A list of zones available in this region, in the form
+ // of resource URLs.
Zones []string `json:"zones,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "CreationTimestamp") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CreationTimestamp") 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. "CreationTimestamp") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *Region) MarshalJSON() ([]byte, error) {
+func (s Region) MarshalJSON() ([]byte, error) {
type NoMethod Region
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type RegionAddressesMoveRequest struct {
- // Description: An optional destination address description if intended
- // to be different from the source.
- Description string `json:"description,omitempty"`
-
- // DestinationAddress: The URL of the destination address to move to.
- // This can be a full or partial URL. For example, the following are all
- // valid URLs to a address: -
- // https://www.googleapis.com/compute/v1/projects/project/regions/region
- // /addresses/address -
- // projects/project/regions/region/addresses/address Note that
- // destination project must be different from the source project. So
- // /regions/region/addresses/address is not valid partial url.
- DestinationAddress string `json:"destinationAddress,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Description") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+// RegionQuotaStatusWarning: [Output Only] Warning of fetching the `quotas`
+// field for this region. This field is populated only if fetching of the
+// `quotas` field fails.
+type RegionQuotaStatusWarning struct {
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
+ //
+ // Possible values:
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
+ // "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
+ // resources has a type marked as experimental
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
+ // "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
+ // overridden. Deprecated unused field.
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
+ // HTTP/HTTPS/HTTP2.
+ // "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
+ // exceedingly large number of resources
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
+ // "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
+ // "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
+ // ignored.
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
+ // "UNREACHABLE" - A given scope cannot be reached.
+ Code string `json:"code,omitempty"`
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
+ Data []*RegionQuotaStatusWarningData `json:"data,omitempty"`
+ // Message: [Output Only] A human-readable description of the warning code.
+ Message string `json:"message,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s RegionQuotaStatusWarning) MarshalJSON() ([]byte, error) {
+ type NoMethod RegionQuotaStatusWarning
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+type RegionQuotaStatusWarningData struct {
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
+ Key string `json:"key,omitempty"`
+ // Value: [Output Only] A warning data value corresponding to the key.
+ Value string `json:"value,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s RegionQuotaStatusWarningData) MarshalJSON() ([]byte, error) {
+ type NoMethod RegionQuotaStatusWarningData
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
- // NullFields is a list of field names (e.g. "Description") to include
- // in API requests with the JSON null value. By default, fields with
- // empty values are omitted from API requests. However, any field with
- // an empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+type RegionAddressesMoveRequest struct {
+ // Description: An optional destination address description if intended to be
+ // different from the source.
+ Description string `json:"description,omitempty"`
+ // DestinationAddress: The URL of the destination address to move to. This can
+ // be a full or partial URL. For example, the following are all valid URLs to a
+ // address: -
+ // https://www.googleapis.com/compute/v1/projects/project/regions/region
+ // /addresses/address - projects/project/regions/region/addresses/address Note
+ // that destination project must be different from the source project. So
+ // /regions/region/addresses/address is not valid partial url.
+ DestinationAddress string `json:"destinationAddress,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Description") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ 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. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionAddressesMoveRequest) MarshalJSON() ([]byte, error) {
+func (s RegionAddressesMoveRequest) MarshalJSON() ([]byte, error) {
type NoMethod RegionAddressesMoveRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// RegionAutoscalerList: Contains a list of autoscalers.
type RegionAutoscalerList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of Autoscaler resources.
Items []*Autoscaler `json:"items,omitempty"`
-
// Kind: Type of resource.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *RegionAutoscalerListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionAutoscalerList) MarshalJSON() ([]byte, error) {
+func (s RegionAutoscalerList) MarshalJSON() ([]byte, error) {
type NoMethod RegionAutoscalerList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// RegionAutoscalerListWarning: [Output Only] Informational warning
-// message.
+// RegionAutoscalerListWarning: [Output Only] Informational warning message.
type RegionAutoscalerListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*RegionAutoscalerListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionAutoscalerListWarning) MarshalJSON() ([]byte, error) {
+func (s RegionAutoscalerListWarning) MarshalJSON() ([]byte, error) {
type NoMethod RegionAutoscalerListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RegionAutoscalerListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionAutoscalerListWarningData) MarshalJSON() ([]byte, error) {
+func (s RegionAutoscalerListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod RegionAutoscalerListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RegionDiskTypeList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of DiskType resources.
Items []*DiskType `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource. Always
- // compute#regionDiskTypeList for region disk types.
+ // Kind: [Output Only] Type of resource. Always compute#regionDiskTypeList for
+ // region disk types.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *RegionDiskTypeListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionDiskTypeList) MarshalJSON() ([]byte, error) {
+func (s RegionDiskTypeList) MarshalJSON() ([]byte, error) {
type NoMethod RegionDiskTypeList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// RegionDiskTypeListWarning: [Output Only] Informational warning
-// message.
+// RegionDiskTypeListWarning: [Output Only] Informational warning message.
type RegionDiskTypeListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*RegionDiskTypeListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionDiskTypeListWarning) MarshalJSON() ([]byte, error) {
+func (s RegionDiskTypeListWarning) MarshalJSON() ([]byte, error) {
type NoMethod RegionDiskTypeListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RegionDiskTypeListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionDiskTypeListWarningData) MarshalJSON() ([]byte, error) {
+func (s RegionDiskTypeListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod RegionDiskTypeListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RegionDisksAddResourcePoliciesRequest struct {
// ResourcePolicies: Resource policies to be added to this disk.
ResourcePolicies []string `json:"resourcePolicies,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "ResourcePolicies") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "ResourcePolicies") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionDisksAddResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
+func (s RegionDisksAddResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
type NoMethod RegionDisksAddResourcePoliciesRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RegionDisksRemoveResourcePoliciesRequest struct {
// ResourcePolicies: Resource policies to be removed from this disk.
ResourcePolicies []string `json:"resourcePolicies,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "ResourcePolicies") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "ResourcePolicies") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionDisksRemoveResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
+func (s RegionDisksRemoveResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
type NoMethod RegionDisksRemoveResourcePoliciesRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RegionDisksResizeRequest struct {
- // SizeGb: The new size of the regional persistent disk, which is
- // specified in GB.
+ // SizeGb: The new size of the regional persistent disk, which is specified in
+ // GB.
SizeGb int64 `json:"sizeGb,omitempty,string"`
-
- // ForceSendFields is a list of field names (e.g. "SizeGb") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "SizeGb") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "SizeGb") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionDisksResizeRequest) MarshalJSON() ([]byte, error) {
+func (s RegionDisksResizeRequest) MarshalJSON() ([]byte, error) {
type NoMethod RegionDisksResizeRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RegionDisksStartAsyncReplicationRequest struct {
- // AsyncSecondaryDisk: The secondary disk to start asynchronous
- // replication to. You can provide this as a partial or full URL to the
- // resource. For example, the following are valid values: -
+ // AsyncSecondaryDisk: The secondary disk to start asynchronous replication to.
+ // You can provide this as a partial or full URL to the resource. For example,
+ // the following are valid values: -
// https://www.googleapis.com/compute/v1/projects/project/zones/zone
// /disks/disk -
// https://www.googleapis.com/compute/v1/projects/project/regions/region
@@ -40296,607 +34228,484 @@ type RegionDisksStartAsyncReplicationRequest struct {
// projects/project/regions/region/disks/disk - zones/zone/disks/disk -
// regions/region/disks/disk
AsyncSecondaryDisk string `json:"asyncSecondaryDisk,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "AsyncSecondaryDisk")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "AsyncSecondaryDisk") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "AsyncSecondaryDisk") 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. "AsyncSecondaryDisk") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionDisksStartAsyncReplicationRequest) MarshalJSON() ([]byte, error) {
+func (s RegionDisksStartAsyncReplicationRequest) MarshalJSON() ([]byte, error) {
type NoMethod RegionDisksStartAsyncReplicationRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// RegionInstanceGroupList: Contains a list of InstanceGroup resources.
type RegionInstanceGroupList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of InstanceGroup resources.
Items []*InstanceGroup `json:"items,omitempty"`
-
// Kind: The resource type.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *RegionInstanceGroupListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionInstanceGroupList) MarshalJSON() ([]byte, error) {
+func (s RegionInstanceGroupList) MarshalJSON() ([]byte, error) {
type NoMethod RegionInstanceGroupList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// RegionInstanceGroupListWarning: [Output Only] Informational warning
-// message.
+// RegionInstanceGroupListWarning: [Output Only] Informational warning message.
type RegionInstanceGroupListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*RegionInstanceGroupListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionInstanceGroupListWarning) MarshalJSON() ([]byte, error) {
+func (s RegionInstanceGroupListWarning) MarshalJSON() ([]byte, error) {
type NoMethod RegionInstanceGroupListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RegionInstanceGroupListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionInstanceGroupListWarningData) MarshalJSON() ([]byte, error) {
+func (s RegionInstanceGroupListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod RegionInstanceGroupListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// RegionInstanceGroupManagerDeleteInstanceConfigReq:
// RegionInstanceGroupManagers.deletePerInstanceConfigs
type RegionInstanceGroupManagerDeleteInstanceConfigReq struct {
- // Names: The list of instance names for which we want to delete
- // per-instance configs on this managed instance group.
+ // Names: The list of instance names for which we want to delete per-instance
+ // configs on this managed instance group.
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 or default 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 is a list of field names (e.g. "Names") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionInstanceGroupManagerDeleteInstanceConfigReq) MarshalJSON() ([]byte, error) {
+func (s RegionInstanceGroupManagerDeleteInstanceConfigReq) MarshalJSON() ([]byte, error) {
type NoMethod RegionInstanceGroupManagerDeleteInstanceConfigReq
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// RegionInstanceGroupManagerList: Contains a list of managed instance
-// groups.
+// RegionInstanceGroupManagerList: Contains a list of managed instance groups.
type RegionInstanceGroupManagerList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of InstanceGroupManager resources.
Items []*InstanceGroupManager `json:"items,omitempty"`
-
// Kind: [Output Only] The resource type, which is always
- // compute#instanceGroupManagerList for a list of managed instance
- // groups that exist in th regional scope.
+ // compute#instanceGroupManagerList for a list of managed instance groups that
+ // exist in th regional scope.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *RegionInstanceGroupManagerListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionInstanceGroupManagerList) MarshalJSON() ([]byte, error) {
+func (s RegionInstanceGroupManagerList) MarshalJSON() ([]byte, error) {
type NoMethod RegionInstanceGroupManagerList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// RegionInstanceGroupManagerListWarning: [Output Only] Informational
-// warning message.
+// RegionInstanceGroupManagerListWarning: [Output Only] Informational warning
+// message.
type RegionInstanceGroupManagerListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*RegionInstanceGroupManagerListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionInstanceGroupManagerListWarning) MarshalJSON() ([]byte, error) {
+func (s RegionInstanceGroupManagerListWarning) MarshalJSON() ([]byte, error) {
type NoMethod RegionInstanceGroupManagerListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RegionInstanceGroupManagerListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionInstanceGroupManagerListWarningData) MarshalJSON() ([]byte, error) {
+func (s RegionInstanceGroupManagerListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod RegionInstanceGroupManagerListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// RegionInstanceGroupManagerPatchInstanceConfigReq:
// RegionInstanceGroupManagers.patchPerInstanceConfigs
type RegionInstanceGroupManagerPatchInstanceConfigReq struct {
- // PerInstanceConfigs: The list of per-instance configurations to insert
- // or patch on this managed instance group.
+ // PerInstanceConfigs: The list of per-instance configurations to insert or
+ // patch on this managed instance group.
PerInstanceConfigs []*PerInstanceConfig `json:"perInstanceConfigs,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "PerInstanceConfigs")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "PerInstanceConfigs") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "PerInstanceConfigs") 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. "PerInstanceConfigs") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionInstanceGroupManagerPatchInstanceConfigReq) MarshalJSON() ([]byte, error) {
+func (s RegionInstanceGroupManagerPatchInstanceConfigReq) MarshalJSON() ([]byte, error) {
type NoMethod RegionInstanceGroupManagerPatchInstanceConfigReq
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// RegionInstanceGroupManagerUpdateInstanceConfigReq:
// RegionInstanceGroupManagers.updatePerInstanceConfigs
type RegionInstanceGroupManagerUpdateInstanceConfigReq struct {
- // PerInstanceConfigs: The list of per-instance configurations to insert
- // or patch on this managed instance group.
+ // PerInstanceConfigs: The list of per-instance configurations to insert or
+ // patch on this managed instance group.
PerInstanceConfigs []*PerInstanceConfig `json:"perInstanceConfigs,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "PerInstanceConfigs")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "PerInstanceConfigs") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "PerInstanceConfigs") 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. "PerInstanceConfigs") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionInstanceGroupManagerUpdateInstanceConfigReq) MarshalJSON() ([]byte, error) {
+func (s RegionInstanceGroupManagerUpdateInstanceConfigReq) MarshalJSON() ([]byte, error) {
type NoMethod RegionInstanceGroupManagerUpdateInstanceConfigReq
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RegionInstanceGroupManagersAbandonInstancesRequest struct {
- // Instances: The URLs of one or more instances to abandon. This can be
- // a full URL or a partial URL, such as
- // zones/[ZONE]/instances/[INSTANCE_NAME].
+ // Instances: The URLs of one or more instances to abandon. This can be a full
+ // URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME].
Instances []string `json:"instances,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Instances") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Instances") 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. "Instances") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionInstanceGroupManagersAbandonInstancesRequest) MarshalJSON() ([]byte, error) {
+func (s RegionInstanceGroupManagersAbandonInstancesRequest) MarshalJSON() ([]byte, error) {
type NoMethod RegionInstanceGroupManagersAbandonInstancesRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// RegionInstanceGroupManagersApplyUpdatesRequest:
// RegionInstanceGroupManagers.applyUpdatesToInstances
type RegionInstanceGroupManagersApplyUpdatesRequest struct {
- // AllInstances: Flag to update all instances instead of specified list
- // of “instances”. If the flag is set to true then the instances may
- // not be specified in the request.
+ // AllInstances: Flag to update all instances instead of specified list of
+ // “instances”. If the flag is set to true then the instances may not be
+ // specified in the request.
AllInstances bool `json:"allInstances,omitempty"`
-
- // Instances: The list of URLs of one or more instances for which you
- // want to apply updates. Each URL can be a full URL or a partial URL,
- // such as zones/[ZONE]/instances/[INSTANCE_NAME].
+ // Instances: The list of URLs of one or more instances for which you want to
+ // apply updates. Each URL can be a full URL or a partial URL, such as
+ // zones/[ZONE]/instances/[INSTANCE_NAME].
Instances []string `json:"instances,omitempty"`
-
- // MinimalAction: The minimal action that you want to perform on each
- // instance during the update: - REPLACE: At minimum, delete the
- // instance and create it again. - RESTART: Stop the instance and start
- // it again. - REFRESH: Do not stop the instance and limit disruption as
- // much as possible. - NONE: Do not disrupt the instance at all. By
- // default, the minimum action is NONE. If your update requires a more
- // disruptive action than you set with this flag, the necessary action
- // is performed to execute the update.
+ // MinimalAction: The minimal action that you want to perform on each instance
+ // during the update: - REPLACE: At minimum, delete the instance and create it
+ // again. - RESTART: Stop the instance and start it again. - REFRESH: Do not
+ // stop the instance and limit disruption as much as possible. - NONE: Do not
+ // disrupt the instance at all. By default, the minimum action is NONE. If your
+ // update requires a more disruptive action than you set with this flag, the
+ // necessary action is performed to execute the update.
//
// Possible values:
// "NONE" - Do not perform any action.
// "REFRESH" - Do not stop the instance.
- // "REPLACE" - (Default.) Replace the instance according to the
- // replacement method option.
+ // "REPLACE" - (Default.) Replace the instance according to the replacement
+ // method option.
// "RESTART" - Stop the instance and start it again.
MinimalAction string `json:"minimalAction,omitempty"`
-
- // MostDisruptiveAllowedAction: The most disruptive action that you want
- // to perform on each instance during the update: - REPLACE: Delete the
- // instance and create it again. - RESTART: Stop the instance and start
- // it again. - REFRESH: Do not stop the instance and limit disruption as
- // much as possible. - NONE: Do not disrupt the instance at all. By
- // default, the most disruptive allowed action is REPLACE. If your
- // update requires a more disruptive action than you set with this flag,
- // the update request will fail.
+ // MostDisruptiveAllowedAction: The most disruptive action that you want to
+ // perform on each instance during the update: - REPLACE: Delete the instance
+ // and create it again. - RESTART: Stop the instance and start it again. -
+ // REFRESH: Do not stop the instance and limit disruption as much as possible.
+ // - NONE: Do not disrupt the instance at all. By default, the most disruptive
+ // allowed action is REPLACE. If your update requires a more disruptive action
+ // than you set with this flag, the update request will fail.
//
// Possible values:
// "NONE" - Do not perform any action.
// "REFRESH" - Do not stop the instance.
- // "REPLACE" - (Default.) Replace the instance according to the
- // replacement method option.
+ // "REPLACE" - (Default.) Replace the instance according to the replacement
+ // method option.
// "RESTART" - Stop the instance and start it again.
MostDisruptiveAllowedAction string `json:"mostDisruptiveAllowedAction,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "AllInstances") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "AllInstances") 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. "AllInstances") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionInstanceGroupManagersApplyUpdatesRequest) MarshalJSON() ([]byte, error) {
+func (s RegionInstanceGroupManagersApplyUpdatesRequest) MarshalJSON() ([]byte, error) {
type NoMethod RegionInstanceGroupManagersApplyUpdatesRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// RegionInstanceGroupManagersCreateInstancesRequest:
@@ -40904,982 +34713,778 @@ func (s *RegionInstanceGroupManagersApplyUpdatesRequest) MarshalJSON() ([]byte,
type RegionInstanceGroupManagersCreateInstancesRequest struct {
// Instances: [Required] List of specifications of per-instance configs.
Instances []*PerInstanceConfig `json:"instances,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Instances") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Instances") 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. "Instances") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionInstanceGroupManagersCreateInstancesRequest) MarshalJSON() ([]byte, error) {
+func (s RegionInstanceGroupManagersCreateInstancesRequest) MarshalJSON() ([]byte, error) {
type NoMethod RegionInstanceGroupManagersCreateInstancesRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RegionInstanceGroupManagersDeleteInstancesRequest struct {
- // Instances: The URLs of one or more instances to delete. This can be a
- // full URL or a partial URL, such as
- // zones/[ZONE]/instances/[INSTANCE_NAME].
+ // Instances: The URLs of one or more instances to delete. This can be a full
+ // URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME].
Instances []string `json:"instances,omitempty"`
-
- // SkipInstancesOnValidationError: Specifies whether the request should
- // proceed despite the inclusion of instances that are not members of
- // the group or that are already in the process of being deleted or
- // abandoned. If this field is set to `false` and such an instance is
- // specified in the request, the operation fails. The operation always
- // fails if the request contains a malformed instance URL or a reference
- // to an instance that exists in a zone or region other than the group's
- // zone or region.
+ // SkipInstancesOnValidationError: Specifies whether the request should proceed
+ // despite the inclusion of instances that are not members of the group or that
+ // are already in the process of being deleted or abandoned. If this field is
+ // set to `false` and such an instance is specified in the request, the
+ // operation fails. The operation always fails if the request contains a
+ // malformed instance URL or a reference to an instance that exists in a zone
+ // or region other than the group's zone or region.
SkipInstancesOnValidationError bool `json:"skipInstancesOnValidationError,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Instances") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Instances") 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. "Instances") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionInstanceGroupManagersDeleteInstancesRequest) MarshalJSON() ([]byte, error) {
+func (s RegionInstanceGroupManagersDeleteInstancesRequest) MarshalJSON() ([]byte, error) {
type NoMethod RegionInstanceGroupManagersDeleteInstancesRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RegionInstanceGroupManagersListErrorsResponse struct {
- // Items: [Output Only] The list of errors of the managed instance
- // group.
+ // Items: [Output Only] The list of errors of the managed instance group.
Items []*InstanceManagedByIgmError `json:"items,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Items") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Items") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Items") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionInstanceGroupManagersListErrorsResponse) MarshalJSON() ([]byte, error) {
+func (s RegionInstanceGroupManagersListErrorsResponse) MarshalJSON() ([]byte, error) {
type NoMethod RegionInstanceGroupManagersListErrorsResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RegionInstanceGroupManagersListInstanceConfigsResp struct {
// Items: [Output Only] The list of PerInstanceConfig.
Items []*PerInstanceConfig `json:"items,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *RegionInstanceGroupManagersListInstanceConfigsRespWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Items") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Items") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Items") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionInstanceGroupManagersListInstanceConfigsResp) MarshalJSON() ([]byte, error) {
+func (s RegionInstanceGroupManagersListInstanceConfigsResp) MarshalJSON() ([]byte, error) {
type NoMethod RegionInstanceGroupManagersListInstanceConfigsResp
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// RegionInstanceGroupManagersListInstanceConfigsRespWarning: [Output
-// Only] Informational warning message.
+// RegionInstanceGroupManagersListInstanceConfigsRespWarning: [Output Only]
+// Informational warning message.
type RegionInstanceGroupManagersListInstanceConfigsRespWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*RegionInstanceGroupManagersListInstanceConfigsRespWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionInstanceGroupManagersListInstanceConfigsRespWarning) MarshalJSON() ([]byte, error) {
+func (s RegionInstanceGroupManagersListInstanceConfigsRespWarning) MarshalJSON() ([]byte, error) {
type NoMethod RegionInstanceGroupManagersListInstanceConfigsRespWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RegionInstanceGroupManagersListInstanceConfigsRespWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionInstanceGroupManagersListInstanceConfigsRespWarningData) MarshalJSON() ([]byte, error) {
+func (s RegionInstanceGroupManagersListInstanceConfigsRespWarningData) MarshalJSON() ([]byte, error) {
type NoMethod RegionInstanceGroupManagersListInstanceConfigsRespWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RegionInstanceGroupManagersListInstancesResponse struct {
// ManagedInstances: A list of managed instances.
ManagedInstances []*ManagedInstance `json:"managedInstances,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
// ForceSendFields is a list of field names (e.g. "ManagedInstances") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "ManagedInstances") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "ManagedInstances") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionInstanceGroupManagersListInstancesResponse) MarshalJSON() ([]byte, error) {
+func (s RegionInstanceGroupManagersListInstancesResponse) MarshalJSON() ([]byte, error) {
type NoMethod RegionInstanceGroupManagersListInstancesResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RegionInstanceGroupManagersRecreateRequest struct {
- // Instances: The URLs of one or more instances to recreate. This can be
- // a full URL or a partial URL, such as
- // zones/[ZONE]/instances/[INSTANCE_NAME].
+ // Instances: The URLs of one or more instances to recreate. This can be a full
+ // URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME].
Instances []string `json:"instances,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Instances") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Instances") 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. "Instances") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionInstanceGroupManagersRecreateRequest) MarshalJSON() ([]byte, error) {
+func (s RegionInstanceGroupManagersRecreateRequest) MarshalJSON() ([]byte, error) {
type NoMethod RegionInstanceGroupManagersRecreateRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RegionInstanceGroupManagersSetTargetPoolsRequest struct {
- // Fingerprint: Fingerprint of the target pools information, which is a
- // hash of the contents. This field is used for optimistic locking when
- // you update the target pool entries. This field is optional.
+ // Fingerprint: Fingerprint of the target pools information, which is a hash of
+ // the contents. This field is used for optimistic locking when you update the
+ // target pool entries. This field is optional.
Fingerprint string `json:"fingerprint,omitempty"`
-
- // TargetPools: The URL of all TargetPool resources to which instances
- // in the instanceGroup field are added. The target pools automatically
- // apply to all of the instances in the managed instance group.
+ // TargetPools: The URL of all TargetPool resources to which instances in the
+ // instanceGroup field are added. The target pools automatically apply to all
+ // of the instances in the managed instance group.
TargetPools []string `json:"targetPools,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Fingerprint") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Fingerprint") 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. "Fingerprint") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionInstanceGroupManagersSetTargetPoolsRequest) MarshalJSON() ([]byte, error) {
+func (s RegionInstanceGroupManagersSetTargetPoolsRequest) MarshalJSON() ([]byte, error) {
type NoMethod RegionInstanceGroupManagersSetTargetPoolsRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RegionInstanceGroupManagersSetTemplateRequest struct {
- // InstanceTemplate: URL of the InstanceTemplate resource from which all
- // new instances will be created.
+ // InstanceTemplate: URL of the InstanceTemplate resource from which all new
+ // instances will be created.
InstanceTemplate string `json:"instanceTemplate,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "InstanceTemplate") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "InstanceTemplate") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionInstanceGroupManagersSetTemplateRequest) MarshalJSON() ([]byte, error) {
+func (s RegionInstanceGroupManagersSetTemplateRequest) MarshalJSON() ([]byte, error) {
type NoMethod RegionInstanceGroupManagersSetTemplateRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RegionInstanceGroupsListInstances struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of InstanceWithNamedPorts resources.
Items []*InstanceWithNamedPorts `json:"items,omitempty"`
-
// Kind: The resource type.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *RegionInstanceGroupsListInstancesWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionInstanceGroupsListInstances) MarshalJSON() ([]byte, error) {
+func (s RegionInstanceGroupsListInstances) MarshalJSON() ([]byte, error) {
type NoMethod RegionInstanceGroupsListInstances
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// RegionInstanceGroupsListInstancesWarning: [Output Only] Informational
// warning message.
type RegionInstanceGroupsListInstancesWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*RegionInstanceGroupsListInstancesWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionInstanceGroupsListInstancesWarning) MarshalJSON() ([]byte, error) {
+func (s RegionInstanceGroupsListInstancesWarning) MarshalJSON() ([]byte, error) {
type NoMethod RegionInstanceGroupsListInstancesWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RegionInstanceGroupsListInstancesWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionInstanceGroupsListInstancesWarningData) MarshalJSON() ([]byte, error) {
+func (s RegionInstanceGroupsListInstancesWarningData) MarshalJSON() ([]byte, error) {
type NoMethod RegionInstanceGroupsListInstancesWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RegionInstanceGroupsListInstancesRequest struct {
- // InstanceState: Instances in which state should be returned. Valid
- // options are: 'ALL', 'RUNNING'. By default, it lists all instances.
+ // InstanceState: Instances in which state should be returned. Valid options
+ // are: 'ALL', 'RUNNING'. By default, it lists all instances.
//
// Possible values:
- // "ALL" - Matches any status of the instances, running, non-running
- // and others.
+ // "ALL" - Matches any status of the instances, running, non-running and
+ // others.
// "RUNNING" - Instance is in RUNNING state if it is running.
InstanceState string `json:"instanceState,omitempty"`
-
- // PortName: Name of port user is interested in. It is optional. If it
- // is set, only information about this ports will be returned. If it is
- // not set, all the named ports will be returned. Always lists all
- // instances.
+ // PortName: Name of port user is interested in. It is optional. If it is set,
+ // only information about this ports will be returned. If it is not set, all
+ // the named ports will be returned. Always lists all instances.
PortName string `json:"portName,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "InstanceState") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "InstanceState") 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. "InstanceState") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionInstanceGroupsListInstancesRequest) MarshalJSON() ([]byte, error) {
+func (s RegionInstanceGroupsListInstancesRequest) MarshalJSON() ([]byte, error) {
type NoMethod RegionInstanceGroupsListInstancesRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RegionInstanceGroupsSetNamedPortsRequest struct {
// Fingerprint: The fingerprint of the named ports information for this
// instance group. Use this optional property to prevent conflicts when
- // multiple users change the named ports settings concurrently. Obtain
- // the fingerprint with the instanceGroups.get method. Then, include the
- // fingerprint in your request to ensure that you do not overwrite
- // changes that were applied from another concurrent request.
+ // multiple users change the named ports settings concurrently. Obtain the
+ // fingerprint with the instanceGroups.get method. Then, include the
+ // fingerprint in your request to ensure that you do not overwrite changes that
+ // were applied from another concurrent request.
Fingerprint string `json:"fingerprint,omitempty"`
-
// NamedPorts: The list of named ports to set for this instance group.
NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Fingerprint") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Fingerprint") 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. "Fingerprint") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionInstanceGroupsSetNamedPortsRequest) MarshalJSON() ([]byte, error) {
+func (s RegionInstanceGroupsSetNamedPortsRequest) MarshalJSON() ([]byte, error) {
type NoMethod RegionInstanceGroupsSetNamedPortsRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// RegionList: Contains a list of region resources.
type RegionList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of Region resources.
Items []*Region `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource. Always compute#regionList for
- // lists of regions.
+ // Kind: [Output Only] Type of resource. Always compute#regionList for lists of
+ // regions.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *RegionListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionList) MarshalJSON() ([]byte, error) {
+func (s RegionList) MarshalJSON() ([]byte, error) {
type NoMethod RegionList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// RegionListWarning: [Output Only] Informational warning message.
type RegionListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*RegionListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionListWarning) MarshalJSON() ([]byte, error) {
+func (s RegionListWarning) MarshalJSON() ([]byte, error) {
type NoMethod RegionListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RegionListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionListWarningData) MarshalJSON() ([]byte, error) {
+func (s RegionListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod RegionListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RegionNetworkEndpointGroupsAttachEndpointsRequest struct {
// NetworkEndpoints: The list of network endpoints to be attached.
NetworkEndpoints []*NetworkEndpoint `json:"networkEndpoints,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "NetworkEndpoints") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "NetworkEndpoints") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "NetworkEndpoints") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionNetworkEndpointGroupsAttachEndpointsRequest) MarshalJSON() ([]byte, error) {
+func (s RegionNetworkEndpointGroupsAttachEndpointsRequest) MarshalJSON() ([]byte, error) {
type NoMethod RegionNetworkEndpointGroupsAttachEndpointsRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RegionNetworkEndpointGroupsDetachEndpointsRequest struct {
// NetworkEndpoints: The list of network endpoints to be detached.
NetworkEndpoints []*NetworkEndpoint `json:"networkEndpoints,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "NetworkEndpoints") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "NetworkEndpoints") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "NetworkEndpoints") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionNetworkEndpointGroupsDetachEndpointsRequest) MarshalJSON() ([]byte, error) {
+func (s RegionNetworkEndpointGroupsDetachEndpointsRequest) MarshalJSON() ([]byte, error) {
type NoMethod RegionNetworkEndpointGroupsDetachEndpointsRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponse struct {
- // FirewallPolicys: Effective firewalls from firewall policy.
+ // FirewallPolicys: [Output only] Effective firewalls from firewall policy. It
+ // applies to Regional Network Firewall Policies in the specified region,
+ // Global Network Firewall Policies and Hierachial Firewall Policies which are
+ // associated with the network.
FirewallPolicys []*RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy `json:"firewallPolicys,omitempty"`
-
// Firewalls: Effective firewalls on the network.
Firewalls []*Firewall `json:"firewalls,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
// ForceSendFields is a list of field names (e.g. "FirewallPolicys") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "FirewallPolicys") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "FirewallPolicys") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponse) MarshalJSON() ([]byte, error) {
+func (s RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponse) MarshalJSON() ([]byte, error) {
type NoMethod RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy struct {
// DisplayName: [Output Only] The display name of the firewall policy.
DisplayName string `json:"displayName,omitempty"`
-
// Name: [Output Only] The name of the firewall policy.
Name string `json:"name,omitempty"`
-
- // Rules: The rules that apply to the network.
+ // Rules: [Output only] The rules that apply to the network.
Rules []*FirewallPolicyRule `json:"rules,omitempty"`
-
// Type: [Output Only] The type of the firewall policy. Can be one of
- // HIERARCHY, NETWORK, NETWORK_REGIONAL.
+ // HIERARCHY, NETWORK, NETWORK_REGIONAL, SYSTEM_GLOBAL, SYSTEM_REGIONAL.
//
// Possible values:
// "HIERARCHY"
@@ -41887,964 +35492,770 @@ type RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewall
// "NETWORK_REGIONAL"
// "UNSPECIFIED"
Type string `json:"type,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "DisplayName") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
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. "DisplayName") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy) MarshalJSON() ([]byte, error) {
+func (s RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy) MarshalJSON() ([]byte, error) {
type NoMethod RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RegionSetLabelsRequest struct {
- // LabelFingerprint: The fingerprint of the previous set of labels for
- // this resource, used to detect conflicts. The fingerprint is initially
- // generated by Compute Engine and changes after every request to modify
- // or update labels. You must always provide an up-to-date fingerprint
- // hash in order to update or change labels. Make a get() request to the
- // resource to get the latest fingerprint.
+ // LabelFingerprint: The fingerprint of the previous set of labels for this
+ // resource, used to detect conflicts. The fingerprint is initially generated
+ // by Compute Engine and changes after every request to modify or update
+ // labels. You must always provide an up-to-date fingerprint hash in order to
+ // update or change labels. Make a get() request to the resource to get the
+ // latest fingerprint.
LabelFingerprint string `json:"labelFingerprint,omitempty"`
-
// Labels: The labels to set for this resource.
Labels map[string]string `json:"labels,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "LabelFingerprint") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "LabelFingerprint") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionSetLabelsRequest) MarshalJSON() ([]byte, error) {
+func (s RegionSetLabelsRequest) MarshalJSON() ([]byte, error) {
type NoMethod RegionSetLabelsRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RegionSetPolicyRequest struct {
// Bindings: Flatten Policy to create a backwacd compatible wire-format.
// Deprecated. Use 'policy' to specify bindings.
Bindings []*Binding `json:"bindings,omitempty"`
-
// Etag: Flatten Policy to create a backward compatible wire-format.
// Deprecated. Use 'policy' to specify the etag.
Etag string `json:"etag,omitempty"`
-
- // Policy: REQUIRED: The complete policy to be applied to the
- // 'resource'. The size of the policy is limited to a few 10s of KB. An
- // empty policy is in general a valid policy but certain services (like
- // Projects) might reject them.
+ // Policy: REQUIRED: The complete policy to be applied to the 'resource'. The
+ // size of the policy is limited to a few 10s of KB. An empty policy is in
+ // general a valid policy but certain services (like Projects) might reject
+ // them.
Policy *Policy `json:"policy,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Bindings") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Bindings") 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. "Bindings") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionSetPolicyRequest) MarshalJSON() ([]byte, error) {
+func (s RegionSetPolicyRequest) MarshalJSON() ([]byte, error) {
type NoMethod RegionSetPolicyRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RegionTargetHttpsProxiesSetSslCertificatesRequest struct {
- // SslCertificates: New set of SslCertificate resources to associate
- // with this TargetHttpsProxy resource.
+ // SslCertificates: New set of SslCertificate resources to associate with this
+ // TargetHttpsProxy resource.
SslCertificates []string `json:"sslCertificates,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "SslCertificates") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "SslCertificates") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "SslCertificates") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionTargetHttpsProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, error) {
+func (s RegionTargetHttpsProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, error) {
type NoMethod RegionTargetHttpsProxiesSetSslCertificatesRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RegionUrlMapsValidateRequest struct {
// Resource: Content of the UrlMap to be validated.
Resource *UrlMap `json:"resource,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Resource") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Resource") 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. "Resource") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RegionUrlMapsValidateRequest) MarshalJSON() ([]byte, error) {
+func (s RegionUrlMapsValidateRequest) MarshalJSON() ([]byte, error) {
type NoMethod RegionUrlMapsValidateRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// RequestMirrorPolicy: A policy that specifies how requests intended
-// for the route's backends are shadowed to a separate mirrored backend
-// service. The load balancer doesn't wait for responses from the shadow
-// service. Before sending traffic to the shadow service, the host or
-// authority header is suffixed with -shadow.
+// RequestMirrorPolicy: A policy that specifies how requests intended for the
+// route's backends are shadowed to a separate mirrored backend service. The
+// load balancer doesn't wait for responses from the shadow service. Before
+// sending traffic to the shadow service, the host or authority header is
+// suffixed with -shadow.
type RequestMirrorPolicy struct {
- // BackendService: The full or partial URL to the BackendService
- // resource being mirrored to. The backend service configured for a
- // mirroring policy must reference backends that are of the same type as
- // the original backend service matched in the URL map. Serverless NEG
- // backends are not currently supported as a mirrored backend service.
+ // BackendService: The full or partial URL to the BackendService resource being
+ // mirrored to. The backend service configured for a mirroring policy must
+ // reference backends that are of the same type as the original backend service
+ // matched in the URL map. Serverless NEG backends are not currently supported
+ // as a mirrored backend service.
BackendService string `json:"backendService,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "BackendService") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "BackendService") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "BackendService") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RequestMirrorPolicy) MarshalJSON() ([]byte, error) {
+func (s RequestMirrorPolicy) MarshalJSON() ([]byte, error) {
type NoMethod RequestMirrorPolicy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// Reservation: Represents a reservation resource. A reservation ensures
-// that capacity is held in a specific zone even if the reserved VMs are
-// not running. For more information, read Reserving zonal resources.
+// Reservation: Represents a reservation resource. A reservation ensures that
+// capacity is held in a specific zone even if the reserved VMs are not
+// running. For more information, read Reserving zonal resources.
type Reservation struct {
- // AggregateReservation: Reservation for aggregated resources, providing
- // shape flexibility.
+ // AggregateReservation: Reservation for aggregated resources, providing shape
+ // flexibility.
AggregateReservation *AllocationAggregateReservation `json:"aggregateReservation,omitempty"`
-
- // Commitment: [Output Only] Full or partial URL to a parent commitment.
- // This field displays for reservations that are tied to a commitment.
+ // Commitment: [Output Only] Full or partial URL to a parent commitment. This
+ // field displays for reservations that are tied to a commitment.
Commitment string `json:"commitment,omitempty"`
-
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
- // Kind: [Output Only] Type of the resource. Always compute#reservations
- // for reservations.
+ // Kind: [Output Only] Type of the resource. Always compute#reservations for
+ // reservations.
Kind string `json:"kind,omitempty"`
-
// Name: The name of the resource, provided by the client when initially
- // creating the resource. The resource name must be 1-63 characters
- // long, and comply with RFC1035. Specifically, the name must be 1-63
- // characters long and match the regular expression
- // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
- // a lowercase letter, and all following characters must be a dash,
- // lowercase letter, or digit, except the last character, which cannot
- // be a dash.
+ // creating the resource. The resource name must be 1-63 characters long, and
+ // comply with RFC1035. Specifically, the name must be 1-63 characters long and
+ // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the
+ // first character must be a lowercase letter, and all following characters
+ // must be a dash, lowercase letter, or digit, except the last character, which
+ // cannot be a dash.
Name string `json:"name,omitempty"`
-
- // ResourcePolicies: Resource policies to be added to this reservation.
- // The key is defined by user, and the value is resource policy url.
- // This is to define placement policy with reservation.
+ // ResourcePolicies: Resource policies to be added to this reservation. The key
+ // is defined by user, and the value is resource policy url. This is to define
+ // placement policy with reservation.
ResourcePolicies map[string]string `json:"resourcePolicies,omitempty"`
-
- // ResourceStatus: [Output Only] Status information for Reservation
- // resource.
+ // ResourceStatus: [Output Only] Status information for Reservation resource.
ResourceStatus *AllocationResourceStatus `json:"resourceStatus,omitempty"`
-
// SatisfiesPzs: [Output Only] Reserved for future use.
SatisfiesPzs bool `json:"satisfiesPzs,omitempty"`
-
// SelfLink: [Output Only] Server-defined fully-qualified URL for this
// resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // ShareSettings: Specify share-settings to create a shared reservation.
- // This property is optional. For more information about the syntax and
- // options for this field and its subfields, see the guide for creating
- // a shared reservation.
+ // ShareSettings: Specify share-settings to create a shared reservation. This
+ // property is optional. For more information about the syntax and options for
+ // this field and its subfields, see the guide for creating a shared
+ // reservation.
ShareSettings *ShareSettings `json:"shareSettings,omitempty"`
-
- // SpecificReservation: Reservation for instances with specific machine
- // shapes.
+ // SpecificReservation: Reservation for instances with specific machine shapes.
SpecificReservation *AllocationSpecificSKUReservation `json:"specificReservation,omitempty"`
-
// SpecificReservationRequired: Indicates whether the reservation can be
- // consumed by VMs with affinity for "any" reservation. If the field is
- // set, then only VMs that target the reservation by name can consume
- // from this reservation.
+ // consumed by VMs with affinity for "any" reservation. If the field is set,
+ // then only VMs that target the reservation by name can consume from this
+ // reservation.
SpecificReservationRequired bool `json:"specificReservationRequired,omitempty"`
-
- // Status: [Output Only] The status of the reservation.
+ // Status: [Output Only] The status of the reservation. - CREATING: Reservation
+ // resources are being allocated. - READY: Reservation resources have been
+ // allocated, and the reservation is ready for use. - DELETING: Reservation
+ // deletion is in progress. - UPDATING: Reservation update is in progress.
//
// Possible values:
- // "CREATING" - Resources are being allocated for the reservation.
- // "DELETING" - Reservation is currently being deleted.
+ // "CREATING" - Reservation resources are being allocated.
+ // "DELETING" - Reservation deletion is in progress.
// "INVALID"
- // "READY" - Reservation has allocated all its resources.
- // "UPDATING" - Reservation is currently being resized.
+ // "READY" - Reservation resources have been allocated, and the reservation
+ // is ready for use.
+ // "UPDATING" - Reservation update is in progress.
Status string `json:"status,omitempty"`
-
- // Zone: Zone in which the reservation resides. A zone must be provided
- // if the reservation is created within a commitment.
+ // Zone: Zone in which the reservation resides. A zone must be provided if the
+ // reservation is created within a commitment.
Zone string `json:"zone,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g.
- // "AggregateReservation") to unconditionally include in API requests.
- // By default, fields with empty or default 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. "AggregateReservation") 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.
+ // ForceSendFields is a list of field names (e.g. "AggregateReservation") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "AggregateReservation") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *Reservation) MarshalJSON() ([]byte, error) {
+func (s Reservation) MarshalJSON() ([]byte, error) {
type NoMethod Reservation
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// ReservationAffinity: Specifies the reservations that this instance
-// can consume from.
+// ReservationAffinity: Specifies the reservations that this instance can
+// consume from.
type ReservationAffinity struct {
- // ConsumeReservationType: Specifies the type of reservation from which
- // this instance can consume resources: ANY_RESERVATION (default),
- // SPECIFIC_RESERVATION, or NO_RESERVATION. See Consuming reserved
- // instances for examples.
+ // ConsumeReservationType: Specifies the type of reservation from which this
+ // instance can consume resources: ANY_RESERVATION (default),
+ // SPECIFIC_RESERVATION, or NO_RESERVATION. See Consuming reserved instances
+ // for examples.
//
// Possible values:
// "ANY_RESERVATION" - Consume any allocation available.
// "NO_RESERVATION" - Do not consume from any allocated capacity.
- // "SPECIFIC_RESERVATION" - Must consume from a specific reservation.
- // Must specify key value fields for specifying the reservations.
+ // "SPECIFIC_RESERVATION" - Must consume from a specific reservation. Must
+ // specify key value fields for specifying the reservations.
// "UNSPECIFIED"
ConsumeReservationType string `json:"consumeReservationType,omitempty"`
-
- // Key: Corresponds to the label key of a reservation resource. To
- // target a SPECIFIC_RESERVATION by name, specify
- // googleapis.com/reservation-name as the key and specify the name of
- // your reservation as its value.
+ // Key: Corresponds to the label key of a reservation resource. To target a
+ // SPECIFIC_RESERVATION by name, specify googleapis.com/reservation-name as the
+ // key and specify the name of your reservation as its value.
Key string `json:"key,omitempty"`
-
- // Values: Corresponds to the label values of a reservation resource.
- // This can be either a name to a reservation in the same project or
- // "projects/different-project/reservations/some-reservation-name" to
- // target a shared reservation in the same zone but in a different
- // project.
+ // Values: Corresponds to the label values of a reservation resource. This can
+ // be either a name to a reservation in the same project or
+ // "projects/different-project/reservations/some-reservation-name" to target a
+ // shared reservation in the same zone but in a different project.
Values []string `json:"values,omitempty"`
-
- // ForceSendFields is a list of field names (e.g.
- // "ConsumeReservationType") to unconditionally include in API requests.
- // By default, fields with empty or default 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. "ConsumeReservationType")
- // 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.
+ // ForceSendFields is a list of field names (e.g. "ConsumeReservationType") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "ConsumeReservationType") to
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ReservationAffinity) MarshalJSON() ([]byte, error) {
+func (s ReservationAffinity) MarshalJSON() ([]byte, error) {
type NoMethod ReservationAffinity
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// ReservationAggregatedList: Contains a list of reservations.
type ReservationAggregatedList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of Allocation resources.
Items map[string]ReservationsScopedList `json:"items,omitempty"`
-
// Kind: Type of resource.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Unreachables: [Output Only] Unreachable resources.
Unreachables []string `json:"unreachables,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *ReservationAggregatedListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ReservationAggregatedList) MarshalJSON() ([]byte, error) {
+func (s ReservationAggregatedList) MarshalJSON() ([]byte, error) {
type NoMethod ReservationAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// ReservationAggregatedListWarning: [Output Only] Informational warning
// message.
type ReservationAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*ReservationAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ReservationAggregatedListWarning) MarshalJSON() ([]byte, error) {
+func (s ReservationAggregatedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod ReservationAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ReservationAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ReservationAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+func (s ReservationAggregatedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod ReservationAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ReservationList struct {
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id string `json:"id,omitempty"`
-
// Items: [Output Only] A list of Allocation resources.
Items []*Reservation `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource.Always compute#reservationsList
- // for listsof reservations
+ // Kind: [Output Only] Type of resource.Always compute#reservationsList for
+ // listsof reservations
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *ReservationListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ReservationList) MarshalJSON() ([]byte, error) {
+func (s ReservationList) MarshalJSON() ([]byte, error) {
type NoMethod ReservationList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// ReservationListWarning: [Output Only] Informational warning message.
type ReservationListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*ReservationListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ReservationListWarning) MarshalJSON() ([]byte, error) {
+func (s ReservationListWarning) MarshalJSON() ([]byte, error) {
type NoMethod ReservationListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ReservationListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ReservationListWarningData) MarshalJSON() ([]byte, error) {
+func (s ReservationListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod ReservationListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ReservationsResizeRequest struct {
- // SpecificSkuCount: Number of allocated resources can be resized with
- // minimum = 1 and maximum = 1000.
+ // SpecificSkuCount: Number of allocated resources can be resized with minimum
+ // = 1 and maximum = 1000.
SpecificSkuCount int64 `json:"specificSkuCount,omitempty,string"`
-
// ForceSendFields is a list of field names (e.g. "SpecificSkuCount") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "SpecificSkuCount") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "SpecificSkuCount") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ReservationsResizeRequest) MarshalJSON() ([]byte, error) {
+func (s ReservationsResizeRequest) MarshalJSON() ([]byte, error) {
type NoMethod ReservationsResizeRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ReservationsScopedList struct {
// Reservations: A list of reservations contained in this scope.
Reservations []*Reservation `json:"reservations,omitempty"`
-
- // Warning: Informational warning which replaces the list of
- // reservations when the list is empty.
+ // Warning: Informational warning which replaces the list of reservations when
+ // the list is empty.
Warning *ReservationsScopedListWarning `json:"warning,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Reservations") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Reservations") 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. "Reservations") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ReservationsScopedList) MarshalJSON() ([]byte, error) {
+func (s ReservationsScopedList) MarshalJSON() ([]byte, error) {
type NoMethod ReservationsScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// ReservationsScopedListWarning: Informational warning which replaces
-// the list of reservations when the list is empty.
+// ReservationsScopedListWarning: Informational warning which replaces the list
+// of reservations when the list is empty.
type ReservationsScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*ReservationsScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ReservationsScopedListWarning) MarshalJSON() ([]byte, error) {
+func (s ReservationsScopedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod ReservationsScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ReservationsScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ReservationsScopedListWarningData) MarshalJSON() ([]byte, error) {
+func (s ReservationsScopedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod ReservationsScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// ResourceCommitment: Commitment for a particular resource (a
-// Commitment is composed of one or more of these).
+// ResourceCommitment: Commitment for a particular resource (a Commitment is
+// composed of one or more of these).
type ResourceCommitment struct {
- // AcceleratorType: Name of the accelerator type resource. Applicable
- // only when the type is ACCELERATOR.
+ // AcceleratorType: Name of the accelerator type resource. Applicable only when
+ // the type is ACCELERATOR.
AcceleratorType string `json:"acceleratorType,omitempty"`
-
- // Amount: The amount of the resource purchased (in a type-dependent
- // unit, such as bytes). For vCPUs, this can just be an integer. For
- // memory, this must be provided in MB. Memory must be a multiple of 256
- // MB, with up to 6.5GB of memory per every vCPU.
+ // Amount: The amount of the resource purchased (in a type-dependent unit, such
+ // as bytes). For vCPUs, this can just be an integer. For memory, this must be
+ // provided in MB. Memory must be a multiple of 256 MB, with up to 6.5GB of
+ // memory per every vCPU.
Amount int64 `json:"amount,omitempty,string"`
-
- // Type: Type of resource for which this commitment applies. Possible
- // values are VCPU, MEMORY, LOCAL_SSD, and ACCELERATOR.
+ // Type: Type of resource for which this commitment applies. Possible values
+ // are VCPU, MEMORY, LOCAL_SSD, and ACCELERATOR.
//
// Possible values:
// "ACCELERATOR"
@@ -42853,285 +36264,222 @@ type ResourceCommitment struct {
// "UNSPECIFIED"
// "VCPU"
Type string `json:"type,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "AcceleratorType") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "AcceleratorType") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "AcceleratorType") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ResourceCommitment) MarshalJSON() ([]byte, error) {
+func (s ResourceCommitment) MarshalJSON() ([]byte, error) {
type NoMethod ResourceCommitment
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ResourceGroupReference struct {
- // Group: A URI referencing one of the instance groups or network
- // endpoint groups listed in the backend service.
+ // Group: A URI referencing one of the instance groups or network endpoint
+ // groups listed in the backend service.
Group string `json:"group,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Group") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Group") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Group") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ResourceGroupReference) MarshalJSON() ([]byte, error) {
+func (s ResourceGroupReference) MarshalJSON() ([]byte, error) {
type NoMethod ResourceGroupReference
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ResourcePoliciesScopedList struct {
// ResourcePolicies: A list of resourcePolicies contained in this scope.
ResourcePolicies []*ResourcePolicy `json:"resourcePolicies,omitempty"`
-
- // Warning: Informational warning which replaces the list of
- // resourcePolicies when the list is empty.
+ // Warning: Informational warning which replaces the list of resourcePolicies
+ // when the list is empty.
Warning *ResourcePoliciesScopedListWarning `json:"warning,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "ResourcePolicies") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "ResourcePolicies") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ResourcePoliciesScopedList) MarshalJSON() ([]byte, error) {
+func (s ResourcePoliciesScopedList) MarshalJSON() ([]byte, error) {
type NoMethod ResourcePoliciesScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// ResourcePoliciesScopedListWarning: Informational warning which
-// replaces the list of resourcePolicies when the list is empty.
+// ResourcePoliciesScopedListWarning: Informational warning which replaces the
+// list of resourcePolicies when the list is empty.
type ResourcePoliciesScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*ResourcePoliciesScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ResourcePoliciesScopedListWarning) MarshalJSON() ([]byte, error) {
+func (s ResourcePoliciesScopedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod ResourcePoliciesScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ResourcePoliciesScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ResourcePoliciesScopedListWarningData) MarshalJSON() ([]byte, error) {
+func (s ResourcePoliciesScopedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod ResourcePoliciesScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// ResourcePolicy: Represents a Resource Policy resource. You can use
-// resource policies to schedule actions for some Compute Engine
-// resources. For example, you can use them to schedule persistent disk
-// snapshots.
+// ResourcePolicy: Represents a Resource Policy resource. You can use resource
+// policies to schedule actions for some Compute Engine resources. For example,
+// you can use them to schedule persistent disk snapshots.
type ResourcePolicy struct {
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- Description string `json:"description,omitempty"`
-
- // DiskConsistencyGroupPolicy: Resource policy for disk consistency
- // groups.
+ Description string `json:"description,omitempty"`
+ // DiskConsistencyGroupPolicy: Resource policy for disk consistency groups.
DiskConsistencyGroupPolicy *ResourcePolicyDiskConsistencyGroupPolicy `json:"diskConsistencyGroupPolicy,omitempty"`
-
// GroupPlacementPolicy: Resource policy for instances for placement
// configuration.
GroupPlacementPolicy *ResourcePolicyGroupPlacementPolicy `json:"groupPlacementPolicy,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
- // InstanceSchedulePolicy: Resource policy for scheduling instance
- // operations.
+ // InstanceSchedulePolicy: Resource policy for scheduling instance operations.
InstanceSchedulePolicy *ResourcePolicyInstanceSchedulePolicy `json:"instanceSchedulePolicy,omitempty"`
-
- // Kind: [Output Only] Type of the resource. Always
- // compute#resource_policies for resource policies.
+ // Kind: [Output Only] Type of the resource. Always compute#resource_policies
+ // for resource policies.
Kind string `json:"kind,omitempty"`
-
// Name: The name of the resource, provided by the client when initially
- // creating the resource. The resource name must be 1-63 characters
- // long, and comply with RFC1035. Specifically, the name must be 1-63
- // characters long and match the regular expression
- // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
- // a lowercase letter, and all following characters must be a dash,
- // lowercase letter, or digit, except the last character, which cannot
- // be a dash.
- Name string `json:"name,omitempty"`
-
+ // creating the resource. The resource name must be 1-63 characters long, and
+ // comply with RFC1035. Specifically, the name must be 1-63 characters long and
+ // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the
+ // first character must be a lowercase letter, and all following characters
+ // must be a dash, lowercase letter, or digit, except the last character, which
+ // cannot be a dash.
+ Name string `json:"name,omitempty"`
Region string `json:"region,omitempty"`
-
- // ResourceStatus: [Output Only] The system status of the resource
- // policy.
+ // ResourceStatus: [Output Only] The system status of the resource policy.
ResourceStatus *ResourcePolicyResourceStatus `json:"resourceStatus,omitempty"`
-
// SelfLink: [Output Only] Server-defined fully-qualified URL for this
// resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // SnapshotSchedulePolicy: Resource policy for persistent disks for
- // creating snapshots.
+ // SnapshotSchedulePolicy: Resource policy for persistent disks for creating
+ // snapshots.
SnapshotSchedulePolicy *ResourcePolicySnapshotSchedulePolicy `json:"snapshotSchedulePolicy,omitempty"`
-
// Status: [Output Only] The status of resource policy creation.
//
// Possible values:
@@ -43142,268 +36490,211 @@ type ResourcePolicy struct {
// "READY" - Resource policy is ready to be used.
Status string `json:"status,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "CreationTimestamp") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CreationTimestamp") 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. "CreationTimestamp") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ResourcePolicy) MarshalJSON() ([]byte, error) {
+func (s ResourcePolicy) MarshalJSON() ([]byte, error) {
type NoMethod ResourcePolicy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// ResourcePolicyAggregatedList: Contains a list of resourcePolicies.
type ResourcePolicyAggregatedList struct {
Etag string `json:"etag,omitempty"`
-
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of ResourcePolicy resources.
Items map[string]ResourcePoliciesScopedList `json:"items,omitempty"`
-
// Kind: Type of resource.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Unreachables: [Output Only] Unreachable resources.
Unreachables []string `json:"unreachables,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *ResourcePolicyAggregatedListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Etag") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Etag") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Etag") 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. "Etag") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ResourcePolicyAggregatedList) MarshalJSON() ([]byte, error) {
+func (s ResourcePolicyAggregatedList) MarshalJSON() ([]byte, error) {
type NoMethod ResourcePolicyAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// ResourcePolicyAggregatedListWarning: [Output Only] Informational
-// warning message.
+// ResourcePolicyAggregatedListWarning: [Output Only] Informational warning
+// message.
type ResourcePolicyAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*ResourcePolicyAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ResourcePolicyAggregatedListWarning) MarshalJSON() ([]byte, error) {
+func (s ResourcePolicyAggregatedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod ResourcePolicyAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ResourcePolicyAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ResourcePolicyAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+func (s ResourcePolicyAggregatedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod ResourcePolicyAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// ResourcePolicyDailyCycle: Time window specified for daily operations.
type ResourcePolicyDailyCycle struct {
- // DaysInCycle: Defines a schedule with units measured in days. The
- // value determines how many days pass between the start of each cycle.
+ // DaysInCycle: Defines a schedule with units measured in days. The value
+ // determines how many days pass between the start of each cycle.
DaysInCycle int64 `json:"daysInCycle,omitempty"`
-
// Duration: [Output only] A predetermined duration for the window,
- // automatically chosen to be the smallest possible in the given
- // scenario.
+ // automatically chosen to be the smallest possible in the given scenario.
Duration string `json:"duration,omitempty"`
-
// StartTime: Start time of the window. This must be in UTC format that
- // resolves to one of 00:00, 04:00, 08:00, 12:00, 16:00, or 20:00. For
- // example, both 13:00-5 and 08:00 are valid.
+ // resolves to one of 00:00, 04:00, 08:00, 12:00, 16:00, or 20:00. For example,
+ // both 13:00-5 and 08:00 are valid.
StartTime string `json:"startTime,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "DaysInCycle") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "DaysInCycle") 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. "DaysInCycle") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ResourcePolicyDailyCycle) MarshalJSON() ([]byte, error) {
+func (s ResourcePolicyDailyCycle) MarshalJSON() ([]byte, error) {
type NoMethod ResourcePolicyDailyCycle
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// ResourcePolicyDiskConsistencyGroupPolicy: Resource policy for disk
@@ -43412,359 +36703,281 @@ type ResourcePolicyDiskConsistencyGroupPolicy struct {
}
// ResourcePolicyGroupPlacementPolicy: A GroupPlacementPolicy specifies
-// resource placement configuration. It specifies the failure bucket
-// separation as well as network locality
+// resource placement configuration. It specifies the failure bucket separation
type ResourcePolicyGroupPlacementPolicy struct {
// AvailabilityDomainCount: The number of availability domains to spread
- // instances across. If two instances are in different availability
- // domain, they are not in the same low latency network.
+ // instances across. If two instances are in different availability domain,
+ // they are not in the same low latency network.
AvailabilityDomainCount int64 `json:"availabilityDomainCount,omitempty"`
-
// Collocation: Specifies network collocation
//
// Possible values:
// "COLLOCATED"
// "UNSPECIFIED_COLLOCATION"
Collocation string `json:"collocation,omitempty"`
-
- // VmCount: Number of VMs in this placement group. Google does not
- // recommend that you use this field unless you use a compact policy and
- // you want your policy to work only if it contains this exact number of
- // VMs.
+ // VmCount: Number of VMs in this placement group. Google does not recommend
+ // that you use this field unless you use a compact policy and you want your
+ // policy to work only if it contains this exact number of VMs.
VmCount int64 `json:"vmCount,omitempty"`
-
- // ForceSendFields is a list of field names (e.g.
- // "AvailabilityDomainCount") to unconditionally include in API
- // requests. By default, fields with empty or default 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. "AvailabilityDomainCount")
- // 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.
+ // ForceSendFields is a list of field names (e.g. "AvailabilityDomainCount") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "AvailabilityDomainCount") to
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ResourcePolicyGroupPlacementPolicy) MarshalJSON() ([]byte, error) {
+func (s ResourcePolicyGroupPlacementPolicy) MarshalJSON() ([]byte, error) {
type NoMethod ResourcePolicyGroupPlacementPolicy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// ResourcePolicyHourlyCycle: Time window specified for hourly
-// operations.
+// ResourcePolicyHourlyCycle: Time window specified for hourly operations.
type ResourcePolicyHourlyCycle struct {
- // Duration: [Output only] Duration of the time window, automatically
- // chosen to be smallest possible in the given scenario.
+ // Duration: [Output only] Duration of the time window, automatically chosen to
+ // be smallest possible in the given scenario.
Duration string `json:"duration,omitempty"`
-
- // HoursInCycle: Defines a schedule with units measured in hours. The
- // value determines how many hours pass between the start of each cycle.
+ // HoursInCycle: Defines a schedule with units measured in hours. The value
+ // determines how many hours pass between the start of each cycle.
HoursInCycle int64 `json:"hoursInCycle,omitempty"`
-
- // StartTime: Time within the window to start the operations. It must be
- // in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT.
+ // StartTime: Time within the window to start the operations. It must be in
+ // format "HH:MM", where HH : [00-23] and MM : [00-00] GMT.
StartTime string `json:"startTime,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Duration") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Duration") 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. "Duration") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ResourcePolicyHourlyCycle) MarshalJSON() ([]byte, error) {
+func (s ResourcePolicyHourlyCycle) MarshalJSON() ([]byte, error) {
type NoMethod ResourcePolicyHourlyCycle
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// ResourcePolicyInstanceSchedulePolicy: An InstanceSchedulePolicy
-// specifies when and how frequent certain operations are performed on
-// the instance.
+// ResourcePolicyInstanceSchedulePolicy: An InstanceSchedulePolicy specifies
+// when and how frequent certain operations are performed on the instance.
type ResourcePolicyInstanceSchedulePolicy struct {
- // ExpirationTime: The expiration time of the schedule. The timestamp is
- // an RFC3339 string.
- ExpirationTime string `json:"expirationTime,omitempty"`
-
- // StartTime: The start time of the schedule. The timestamp is an
+ // ExpirationTime: The expiration time of the schedule. The timestamp is an
// RFC3339 string.
+ ExpirationTime string `json:"expirationTime,omitempty"`
+ // StartTime: The start time of the schedule. The timestamp is an RFC3339
+ // string.
StartTime string `json:"startTime,omitempty"`
-
// TimeZone: Specifies the time zone to be used in interpreting
- // Schedule.schedule. The value of this field must be a time zone name
- // from the tz database: https://wikipedia.org/wiki/Tz_database.
+ // Schedule.schedule. The value of this field must be a time zone name from the
+ // tz database: https://wikipedia.org/wiki/Tz_database.
TimeZone string `json:"timeZone,omitempty"`
-
// VmStartSchedule: Specifies the schedule for starting instances.
VmStartSchedule *ResourcePolicyInstanceSchedulePolicySchedule `json:"vmStartSchedule,omitempty"`
-
// VmStopSchedule: Specifies the schedule for stopping instances.
VmStopSchedule *ResourcePolicyInstanceSchedulePolicySchedule `json:"vmStopSchedule,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "ExpirationTime") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "ExpirationTime") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "ExpirationTime") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ResourcePolicyInstanceSchedulePolicy) MarshalJSON() ([]byte, error) {
+func (s ResourcePolicyInstanceSchedulePolicy) MarshalJSON() ([]byte, error) {
type NoMethod ResourcePolicyInstanceSchedulePolicy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// ResourcePolicyInstanceSchedulePolicySchedule: Schedule for an
-// instance operation.
+// ResourcePolicyInstanceSchedulePolicySchedule: Schedule for an instance
+// operation.
type ResourcePolicyInstanceSchedulePolicySchedule struct {
- // Schedule: Specifies the frequency for the operation, using the
- // unix-cron format.
+ // Schedule: Specifies the frequency for the operation, using the unix-cron
+ // format.
Schedule string `json:"schedule,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Schedule") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Schedule") 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. "Schedule") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ResourcePolicyInstanceSchedulePolicySchedule) MarshalJSON() ([]byte, error) {
+func (s ResourcePolicyInstanceSchedulePolicySchedule) MarshalJSON() ([]byte, error) {
type NoMethod ResourcePolicyInstanceSchedulePolicySchedule
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ResourcePolicyList struct {
Etag string `json:"etag,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id string `json:"id,omitempty"`
-
// Items: [Output Only] A list of ResourcePolicy resources.
Items []*ResourcePolicy `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource.Always
- // compute#resourcePoliciesList for listsof resourcePolicies
+ // Kind: [Output Only] Type of resource.Always compute#resourcePoliciesList for
+ // listsof resourcePolicies
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *ResourcePolicyListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Etag") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Etag") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Etag") 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. "Etag") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ResourcePolicyList) MarshalJSON() ([]byte, error) {
+func (s ResourcePolicyList) MarshalJSON() ([]byte, error) {
type NoMethod ResourcePolicyList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// ResourcePolicyListWarning: [Output Only] Informational warning
-// message.
+// ResourcePolicyListWarning: [Output Only] Informational warning message.
type ResourcePolicyListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*ResourcePolicyListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ResourcePolicyListWarning) MarshalJSON() ([]byte, error) {
+func (s ResourcePolicyListWarning) MarshalJSON() ([]byte, error) {
type NoMethod ResourcePolicyListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ResourcePolicyListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ResourcePolicyListWarningData) MarshalJSON() ([]byte, error) {
+func (s ResourcePolicyListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod ResourcePolicyListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// ResourcePolicyResourceStatus: Contains output only fields. Use this
@@ -43772,257 +36985,199 @@ func (s *ResourcePolicyListWarningData) MarshalJSON() ([]byte, error) {
// structure of this "status" field should mimic the structure of
// ResourcePolicy proto specification.
type ResourcePolicyResourceStatus struct {
- // InstanceSchedulePolicy: [Output Only] Specifies a set of output
- // values reffering to the instance_schedule_policy system status. This
- // field should have the same name as corresponding policy field.
+ // InstanceSchedulePolicy: [Output Only] Specifies a set of output values
+ // reffering to the instance_schedule_policy system status. This field should
+ // have the same name as corresponding policy field.
InstanceSchedulePolicy *ResourcePolicyResourceStatusInstanceSchedulePolicyStatus `json:"instanceSchedulePolicy,omitempty"`
-
- // ForceSendFields is a list of field names (e.g.
- // "InstanceSchedulePolicy") to unconditionally include in API requests.
- // By default, fields with empty or default 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. "InstanceSchedulePolicy")
- // 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.
+ // ForceSendFields is a list of field names (e.g. "InstanceSchedulePolicy") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "InstanceSchedulePolicy") to
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ResourcePolicyResourceStatus) MarshalJSON() ([]byte, error) {
+func (s ResourcePolicyResourceStatus) MarshalJSON() ([]byte, error) {
type NoMethod ResourcePolicyResourceStatus
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ResourcePolicyResourceStatusInstanceSchedulePolicyStatus struct {
- // LastRunStartTime: [Output Only] The last time the schedule
- // successfully ran. The timestamp is an RFC3339 string.
+ // LastRunStartTime: [Output Only] The last time the schedule successfully ran.
+ // The timestamp is an RFC3339 string.
LastRunStartTime string `json:"lastRunStartTime,omitempty"`
-
- // NextRunStartTime: [Output Only] The next time the schedule is planned
- // to run. The actual time might be slightly different. The timestamp is
- // an RFC3339 string.
+ // NextRunStartTime: [Output Only] The next time the schedule is planned to
+ // run. The actual time might be slightly different. The timestamp is an
+ // RFC3339 string.
NextRunStartTime string `json:"nextRunStartTime,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "LastRunStartTime") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "LastRunStartTime") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "LastRunStartTime") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ResourcePolicyResourceStatusInstanceSchedulePolicyStatus) MarshalJSON() ([]byte, error) {
+func (s ResourcePolicyResourceStatusInstanceSchedulePolicyStatus) MarshalJSON() ([]byte, error) {
type NoMethod ResourcePolicyResourceStatusInstanceSchedulePolicyStatus
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// ResourcePolicySnapshotSchedulePolicy: A snapshot schedule policy
-// specifies when and how frequently snapshots are to be created for the
-// target disk. Also specifies how many and how long these scheduled
-// snapshots should be retained.
+// ResourcePolicySnapshotSchedulePolicy: A snapshot schedule policy specifies
+// when and how frequently snapshots are to be created for the target disk.
+// Also specifies how many and how long these scheduled snapshots should be
+// retained.
type ResourcePolicySnapshotSchedulePolicy struct {
- // RetentionPolicy: Retention policy applied to snapshots created by
- // this resource policy.
+ // RetentionPolicy: Retention policy applied to snapshots created by this
+ // resource policy.
RetentionPolicy *ResourcePolicySnapshotSchedulePolicyRetentionPolicy `json:"retentionPolicy,omitempty"`
-
- // Schedule: A Vm Maintenance Policy specifies what kind of
- // infrastructure maintenance we are allowed to perform on this VM and
- // when. Schedule that is applied to disks covered by this policy.
+ // Schedule: A Vm Maintenance Policy specifies what kind of infrastructure
+ // maintenance we are allowed to perform on this VM and when. Schedule that is
+ // applied to disks covered by this policy.
Schedule *ResourcePolicySnapshotSchedulePolicySchedule `json:"schedule,omitempty"`
-
- // SnapshotProperties: Properties with which snapshots are created such
- // as labels, encryption keys.
+ // SnapshotProperties: Properties with which snapshots are created such as
+ // labels, encryption keys.
SnapshotProperties *ResourcePolicySnapshotSchedulePolicySnapshotProperties `json:"snapshotProperties,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "RetentionPolicy") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "RetentionPolicy") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "RetentionPolicy") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ResourcePolicySnapshotSchedulePolicy) MarshalJSON() ([]byte, error) {
+func (s ResourcePolicySnapshotSchedulePolicy) MarshalJSON() ([]byte, error) {
type NoMethod ResourcePolicySnapshotSchedulePolicy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// ResourcePolicySnapshotSchedulePolicyRetentionPolicy: Policy for
-// retention of scheduled snapshots.
+// ResourcePolicySnapshotSchedulePolicyRetentionPolicy: Policy for retention of
+// scheduled snapshots.
type ResourcePolicySnapshotSchedulePolicyRetentionPolicy struct {
- // MaxRetentionDays: Maximum age of the snapshot that is allowed to be
- // kept.
+ // MaxRetentionDays: Maximum age of the snapshot that is allowed to be kept.
MaxRetentionDays int64 `json:"maxRetentionDays,omitempty"`
-
- // OnSourceDiskDelete: Specifies the behavior to apply to scheduled
- // snapshots when the source disk is deleted.
+ // OnSourceDiskDelete: Specifies the behavior to apply to scheduled snapshots
+ // when the source disk is deleted.
//
// Possible values:
// "APPLY_RETENTION_POLICY"
// "KEEP_AUTO_SNAPSHOTS"
// "UNSPECIFIED_ON_SOURCE_DISK_DELETE"
OnSourceDiskDelete string `json:"onSourceDiskDelete,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "MaxRetentionDays") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "MaxRetentionDays") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "MaxRetentionDays") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ResourcePolicySnapshotSchedulePolicyRetentionPolicy) MarshalJSON() ([]byte, error) {
+func (s ResourcePolicySnapshotSchedulePolicyRetentionPolicy) MarshalJSON() ([]byte, error) {
type NoMethod ResourcePolicySnapshotSchedulePolicyRetentionPolicy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// ResourcePolicySnapshotSchedulePolicySchedule: A schedule for disks
-// where the schedueled operations are performed.
+// ResourcePolicySnapshotSchedulePolicySchedule: A schedule for disks where the
+// schedueled operations are performed.
type ResourcePolicySnapshotSchedulePolicySchedule struct {
- DailySchedule *ResourcePolicyDailyCycle `json:"dailySchedule,omitempty"`
-
+ DailySchedule *ResourcePolicyDailyCycle `json:"dailySchedule,omitempty"`
HourlySchedule *ResourcePolicyHourlyCycle `json:"hourlySchedule,omitempty"`
-
WeeklySchedule *ResourcePolicyWeeklyCycle `json:"weeklySchedule,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "DailySchedule") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "DailySchedule") 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. "DailySchedule") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ResourcePolicySnapshotSchedulePolicySchedule) MarshalJSON() ([]byte, error) {
+func (s ResourcePolicySnapshotSchedulePolicySchedule) MarshalJSON() ([]byte, error) {
type NoMethod ResourcePolicySnapshotSchedulePolicySchedule
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// ResourcePolicySnapshotSchedulePolicySnapshotProperties: Specified
-// snapshot properties for scheduled snapshots created by this policy.
+// ResourcePolicySnapshotSchedulePolicySnapshotProperties: Specified snapshot
+// properties for scheduled snapshots created by this policy.
type ResourcePolicySnapshotSchedulePolicySnapshotProperties struct {
// ChainName: Chain name that the snapshot is created in.
ChainName string `json:"chainName,omitempty"`
-
// GuestFlush: Indication to perform a 'guest aware' snapshot.
GuestFlush bool `json:"guestFlush,omitempty"`
-
- // Labels: Labels to apply to scheduled snapshots. These can be later
- // modified by the setLabels method. Label values may be empty.
+ // Labels: Labels to apply to scheduled snapshots. These can be later modified
+ // by the setLabels method. Label values may be empty.
Labels map[string]string `json:"labels,omitempty"`
-
- // StorageLocations: Cloud Storage bucket storage location of the auto
- // snapshot (regional or multi-regional).
+ // StorageLocations: Cloud Storage bucket storage location of the auto snapshot
+ // (regional or multi-regional).
StorageLocations []string `json:"storageLocations,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "ChainName") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "ChainName") 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. "ChainName") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ResourcePolicySnapshotSchedulePolicySnapshotProperties) MarshalJSON() ([]byte, error) {
+func (s ResourcePolicySnapshotSchedulePolicySnapshotProperties) MarshalJSON() ([]byte, error) {
type NoMethod ResourcePolicySnapshotSchedulePolicySnapshotProperties
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// ResourcePolicyWeeklyCycle: Time window specified for weekly
-// operations.
+// ResourcePolicyWeeklyCycle: Time window specified for weekly operations.
type ResourcePolicyWeeklyCycle struct {
// DayOfWeeks: Up to 7 intervals/windows, one for each day of the week.
DayOfWeeks []*ResourcePolicyWeeklyCycleDayOfWeek `json:"dayOfWeeks,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "DayOfWeeks") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "DayOfWeeks") 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. "DayOfWeeks") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ResourcePolicyWeeklyCycle) MarshalJSON() ([]byte, error) {
+func (s ResourcePolicyWeeklyCycle) MarshalJSON() ([]byte, error) {
type NoMethod ResourcePolicyWeeklyCycle
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ResourcePolicyWeeklyCycleDayOfWeek struct {
- // Day: Defines a schedule that runs on specific days of the week.
- // Specify one or more days. The following options are available:
- // MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY.
+ // Day: Defines a schedule that runs on specific days of the week. Specify one
+ // or more days. The following options are available: MONDAY, TUESDAY,
+ // WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY.
//
// Possible values:
// "FRIDAY"
@@ -44034,186 +37189,175 @@ type ResourcePolicyWeeklyCycleDayOfWeek struct {
// "TUESDAY"
// "WEDNESDAY"
Day string `json:"day,omitempty"`
-
- // Duration: [Output only] Duration of the time window, automatically
- // chosen to be smallest possible in the given scenario.
+ // Duration: [Output only] Duration of the time window, automatically chosen to
+ // be smallest possible in the given scenario.
Duration string `json:"duration,omitempty"`
-
- // StartTime: Time within the window to start the operations. It must be
- // in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT.
+ // StartTime: Time within the window to start the operations. It must be in
+ // format "HH:MM", where HH : [00-23] and MM : [00-00] GMT.
StartTime string `json:"startTime,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Day") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Day") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Day") 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. "Day") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ResourcePolicyWeeklyCycleDayOfWeek) MarshalJSON() ([]byte, error) {
+func (s ResourcePolicyWeeklyCycleDayOfWeek) MarshalJSON() ([]byte, error) {
type NoMethod ResourcePolicyWeeklyCycleDayOfWeek
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// ResourceStatus: Contains output only fields. Use this sub-message for
-// actual values set on Instance attributes as compared to the value
-// requested by the user (intent) in their instance CRUD calls.
+// ResourceStatus: Contains output only fields. Use this sub-message for actual
+// values set on Instance attributes as compared to the value requested by the
+// user (intent) in their instance CRUD calls.
type ResourceStatus struct {
- // PhysicalHost: [Output Only] An opaque ID of the host on which the VM
- // is running.
- PhysicalHost string `json:"physicalHost,omitempty"`
-
- UpcomingMaintenance *UpcomingMaintenance `json:"upcomingMaintenance,omitempty"`
-
+ // PhysicalHost: [Output Only] An opaque ID of the host on which the VM is
+ // running.
+ PhysicalHost string `json:"physicalHost,omitempty"`
+ Scheduling *ResourceStatusScheduling `json:"scheduling,omitempty"`
+ UpcomingMaintenance *UpcomingMaintenance `json:"upcomingMaintenance,omitempty"`
// ForceSendFields is a list of field names (e.g. "PhysicalHost") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "PhysicalHost") 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. "PhysicalHost") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ResourceStatus) MarshalJSON() ([]byte, error) {
+func (s ResourceStatus) MarshalJSON() ([]byte, error) {
type NoMethod ResourceStatus
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+type ResourceStatusScheduling struct {
+ // AvailabilityDomain: Specifies the availability domain to place the instance
+ // in. The value must be a number between 1 and the number of availability
+ // domains specified in the spread placement policy attached to the instance.
+ AvailabilityDomain int64 `json:"availabilityDomain,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "AvailabilityDomain") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "AvailabilityDomain") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s ResourceStatusScheduling) MarshalJSON() ([]byte, error) {
+ type NoMethod ResourceStatusScheduling
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// Route: Represents a Route resource. A route defines a path from VM
-// instances in the VPC network to a specific destination. This
-// destination can be inside or outside the VPC network. For more
-// information, read the Routes overview.
+// Route: Represents a Route resource. A route defines a path from VM instances
+// in the VPC network to a specific destination. This destination can be inside
+// or outside the VPC network. For more information, read the Routes overview.
type Route struct {
// AsPaths: [Output Only] AS path.
AsPaths []*RouteAsPath `json:"asPaths,omitempty"`
-
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // field when you create the resource.
+ // Description: An optional description of this resource. Provide this field
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // DestRange: The destination range of outgoing packets that this route
- // applies to. Both IPv4 and IPv6 are supported. Must specify an IPv4
- // range (e.g. 192.0.2.0/24) or an IPv6 range in RFC 4291 format (e.g.
- // 2001:db8::/32). IPv6 range will be displayed using RFC 5952
- // compressed format.
+ // DestRange: The destination range of outgoing packets that this route applies
+ // to. Both IPv4 and IPv6 are supported. Must specify an IPv4 range (e.g.
+ // 192.0.2.0/24) or an IPv6 range in RFC 4291 format (e.g. 2001:db8::/32). IPv6
+ // range will be displayed using RFC 5952 compressed format.
DestRange string `json:"destRange,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
- // Kind: [Output Only] Type of this resource. Always compute#routes for
- // Route resources.
+ // Kind: [Output Only] Type of this resource. Always compute#routes for Route
+ // resources.
Kind string `json:"kind,omitempty"`
-
- // Name: Name of the resource. Provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`. The first
- // character must be a lowercase letter, and all following characters
- // (except for the last character) must be a dash, lowercase letter, or
- // digit. The last character must be a lowercase letter or digit.
+ // Name: Name of the resource. Provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?`. The first character must be a
+ // lowercase letter, and all following characters (except for the last
+ // character) must be a dash, lowercase letter, or digit. The last character
+ // must be a lowercase letter or digit.
Name string `json:"name,omitempty"`
-
- // Network: Fully-qualified URL of the network that this route applies
- // to.
+ // Network: Fully-qualified URL of the network that this route applies to.
Network string `json:"network,omitempty"`
-
- // NextHopGateway: The URL to a gateway that should handle matching
- // packets. You can only specify the internet gateway using a full or
- // partial valid URL: projects/
- // project/global/gateways/default-internet-gateway
+ // NextHopGateway: The URL to a gateway that should handle matching packets.
+ // You can only specify the internet gateway using a full or partial valid URL:
+ // projects/ project/global/gateways/default-internet-gateway
NextHopGateway string `json:"nextHopGateway,omitempty"`
-
- // NextHopHub: [Output Only] The full resource name of the Network
- // Connectivity Center hub that will handle matching packets.
+ // NextHopHub: [Output Only] The full resource name of the Network Connectivity
+ // Center hub that will handle matching packets.
NextHopHub string `json:"nextHopHub,omitempty"`
-
// NextHopIlb: The URL to a forwarding rule of type
- // loadBalancingScheme=INTERNAL that should handle matching packets or
- // the IP address of the forwarding Rule. For example, the following are
- // all valid URLs: - 10.128.0.56 -
+ // loadBalancingScheme=INTERNAL that should handle matching packets or the IP
+ // address of the forwarding Rule. For example, the following are all valid
+ // URLs: -
// https://www.googleapis.com/compute/v1/projects/project/regions/region
// /forwardingRules/forwardingRule -
- // regions/region/forwardingRules/forwardingRule
+ // regions/region/forwardingRules/forwardingRule If an IP address is provided,
+ // must specify an IPv4 address in dot-decimal notation or an IPv6 address in
+ // RFC 4291 format. For example, the following are all valid IP addresses: -
+ // 10.128.0.56 - 2001:db8::2d9:51:0:0 - 2001:db8:0:0:2d9:51:0:0 IPv6 addresses
+ // will be displayed using RFC 5952 compressed format (e.g.
+ // 2001:db8::2d9:51:0:0). Should never be an IPv4-mapped IPv6 address.
NextHopIlb string `json:"nextHopIlb,omitempty"`
-
- // NextHopInstance: The URL to an instance that should handle matching
- // packets. You can specify this as a full or partial URL. For example:
+ // NextHopInstance: The URL to an instance that should handle matching packets.
+ // You can specify this as a full or partial URL. For example:
// https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/
NextHopInstance string `json:"nextHopInstance,omitempty"`
-
- // NextHopIp: The network IP address of an instance that should handle
- // matching packets. Both IPv6 address and IPv4 addresses are supported.
- // Must specify an IPv4 address in dot-decimal notation (e.g.
- // 192.0.2.99) or an IPv6 address in RFC 4291 format (e.g.
- // 2001:db8::2d9:51:0:0 or 2001:db8:0:0:2d9:51:0:0). IPv6 addresses will
- // be displayed using RFC 5952 compressed format (e.g.
+ // NextHopIp: The network IP address of an instance that should handle matching
+ // packets. Both IPv6 address and IPv4 addresses are supported. Must specify an
+ // IPv4 address in dot-decimal notation (e.g. 192.0.2.99) or an IPv6 address in
+ // RFC 4291 format (e.g. 2001:db8::2d9:51:0:0 or 2001:db8:0:0:2d9:51:0:0). IPv6
+ // addresses will be displayed using RFC 5952 compressed format (e.g.
// 2001:db8::2d9:51:0:0). Should never be an IPv4-mapped IPv6 address.
NextHopIp string `json:"nextHopIp,omitempty"`
-
- // NextHopNetwork: The URL of the local network if it should handle
- // matching packets.
+ // NextHopNetwork: The URL of the local network if it should handle matching
+ // packets.
NextHopNetwork string `json:"nextHopNetwork,omitempty"`
-
- // NextHopPeering: [Output Only] The network peering name that should
- // handle matching packets, which should conform to RFC1035.
+ // NextHopPeering: [Output Only] The network peering name that should handle
+ // matching packets, which should conform to RFC1035.
NextHopPeering string `json:"nextHopPeering,omitempty"`
-
// NextHopVpnTunnel: The URL to a VpnTunnel that should handle matching
// packets.
NextHopVpnTunnel string `json:"nextHopVpnTunnel,omitempty"`
-
- // Priority: The priority of this route. Priority is used to break ties
- // in cases where there is more than one matching route of equal prefix
- // length. In cases where multiple routes have equal prefix length, the
- // one with the lowest-numbered priority value wins. The default value
- // is `1000`. The priority value must be from `0` to `65535`, inclusive.
+ // Priority: The priority of this route. Priority is used to break ties in
+ // cases where there is more than one matching route of equal prefix length. In
+ // cases where multiple routes have equal prefix length, the one with the
+ // lowest-numbered priority value wins. The default value is `1000`. The
+ // priority value must be from `0` to `65535`, inclusive.
Priority int64 `json:"priority,omitempty"`
-
// RouteStatus: [Output only] The status of the route.
//
// Possible values:
// "ACTIVE" - This route is processed and active.
- // "DROPPED" - The route is dropped due to the VPC exceeding the
- // dynamic route limit. For dynamic route limit, please refer to the
- // Learned route example
- // "INACTIVE" - This route is processed but inactive due to failure
- // from the backend. The backend may have rejected the route
- // "PENDING" - This route is being processed internally. The status
- // will change once processed.
+ // "DROPPED" - The route is dropped due to the VPC exceeding the dynamic
+ // route limit. For dynamic route limit, please refer to the Learned route
+ // example
+ // "INACTIVE" - This route is processed but inactive due to failure from the
+ // backend. The backend may have rejected the route
+ // "PENDING" - This route is being processed internally. The status will
+ // change once processed.
RouteStatus string `json:"routeStatus,omitempty"`
-
- // RouteType: [Output Only] The type of this route, which can be one of
- // the following values: - 'TRANSIT' for a transit route that this
- // router learned from another Cloud Router and will readvertise to one
- // of its BGP peers - 'SUBNET' for a route from a subnet of the VPC -
- // 'BGP' for a route learned from a BGP peer of this router - 'STATIC'
- // for a static route
+ // RouteType: [Output Only] The type of this route, which can be one of the
+ // following values: - 'TRANSIT' for a transit route that this router learned
+ // from another Cloud Router and will readvertise to one of its BGP peers -
+ // 'SUBNET' for a route from a subnet of the VPC - 'BGP' for a route learned
+ // from a BGP peer of this router - 'STATIC' for a static route
//
// Possible values:
// "BGP"
@@ -44221,194 +37365,158 @@ type Route struct {
// "SUBNET"
// "TRANSIT"
RouteType string `json:"routeType,omitempty"`
-
// SelfLink: [Output Only] Server-defined fully-qualified URL for this
// resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Tags: A list of instance tags to which this route applies.
Tags []string `json:"tags,omitempty"`
-
- // Warnings: [Output Only] If potential misconfigurations are detected
- // for this route, this field will be populated with warning messages.
+ // Warnings: [Output Only] If potential misconfigurations are detected for this
+ // route, this field will be populated with warning messages.
Warnings []*RouteWarnings `json:"warnings,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "AsPaths") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "AsPaths") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "AsPaths") 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. "AsPaths") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *Route) MarshalJSON() ([]byte, error) {
+func (s Route) MarshalJSON() ([]byte, error) {
type NoMethod Route
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RouteWarnings struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*RouteWarningsData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RouteWarnings) MarshalJSON() ([]byte, error) {
+func (s RouteWarnings) MarshalJSON() ([]byte, error) {
type NoMethod RouteWarnings
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RouteWarningsData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RouteWarningsData) MarshalJSON() ([]byte, error) {
+func (s RouteWarningsData) MarshalJSON() ([]byte, error) {
type NoMethod RouteWarningsData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RouteAsPath struct {
// AsLists: [Output Only] The AS numbers of the AS Path.
AsLists []int64 `json:"asLists,omitempty"`
-
- // PathSegmentType: [Output Only] The type of the AS Path, which can be
- // one of the following values: - 'AS_SET': unordered set of autonomous
- // systems that the route in has traversed - 'AS_SEQUENCE': ordered set
- // of autonomous systems that the route has traversed -
- // 'AS_CONFED_SEQUENCE': ordered set of Member Autonomous Systems in the
- // local confederation that the route has traversed - 'AS_CONFED_SET':
- // unordered set of Member Autonomous Systems in the local confederation
- // that the route has traversed
+ // PathSegmentType: [Output Only] The type of the AS Path, which can be one of
+ // the following values: - 'AS_SET': unordered set of autonomous systems that
+ // the route in has traversed - 'AS_SEQUENCE': ordered set of autonomous
+ // systems that the route has traversed - 'AS_CONFED_SEQUENCE': ordered set of
+ // Member Autonomous Systems in the local confederation that the route has
+ // traversed - 'AS_CONFED_SET': unordered set of Member Autonomous Systems in
+ // the local confederation that the route has traversed
//
// Possible values:
// "AS_CONFED_SEQUENCE"
@@ -44416,540 +37524,424 @@ type RouteAsPath struct {
// "AS_SEQUENCE"
// "AS_SET"
PathSegmentType string `json:"pathSegmentType,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "AsLists") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "AsLists") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "AsLists") 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. "AsLists") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RouteAsPath) MarshalJSON() ([]byte, error) {
+func (s RouteAsPath) MarshalJSON() ([]byte, error) {
type NoMethod RouteAsPath
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// RouteList: Contains a list of Route resources.
type RouteList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of Route resources.
Items []*Route `json:"items,omitempty"`
-
// Kind: Type of resource.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *RouteListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RouteList) MarshalJSON() ([]byte, error) {
+func (s RouteList) MarshalJSON() ([]byte, error) {
type NoMethod RouteList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// RouteListWarning: [Output Only] Informational warning message.
type RouteListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*RouteListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RouteListWarning) MarshalJSON() ([]byte, error) {
+func (s RouteListWarning) MarshalJSON() ([]byte, error) {
type NoMethod RouteListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RouteListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RouteListWarningData) MarshalJSON() ([]byte, error) {
+func (s RouteListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod RouteListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// Router: Represents a Cloud Router resource. For more information
-// about Cloud Router, read the Cloud Router overview.
+// Router: Represents a Cloud Router resource. For more information about Cloud
+// Router, read the Cloud Router overview.
type Router struct {
// Bgp: BGP information specific to this router.
Bgp *RouterBgp `json:"bgp,omitempty"`
-
- // BgpPeers: BGP information that must be configured into the routing
- // stack to establish BGP peering. This information must specify the
- // peer ASN and either the interface name, IP address, or peer IP
- // address. Please refer to RFC4273.
+ // BgpPeers: BGP information that must be configured into the routing stack to
+ // establish BGP peering. This information must specify the peer ASN and either
+ // the interface name, IP address, or peer IP address. Please refer to RFC4273.
BgpPeers []*RouterBgpPeer `json:"bgpPeers,omitempty"`
-
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // EncryptedInterconnectRouter: Indicates if a router is dedicated for
- // use with encrypted VLAN attachments (interconnectAttachments).
+ // EncryptedInterconnectRouter: Indicates if a router is dedicated for use with
+ // encrypted VLAN attachments (interconnectAttachments).
EncryptedInterconnectRouter bool `json:"encryptedInterconnectRouter,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
- // Interfaces: Router interfaces. To create a BGP peer that uses a
- // router interface, the interface must have one of the following fields
- // specified: - linkedVpnTunnel - linkedInterconnectAttachment -
- // subnetwork You can create a router interface without any of these
- // fields specified. However, you cannot create a BGP peer that uses
- // that interface.
+ // Interfaces: Router interfaces. To create a BGP peer that uses a router
+ // interface, the interface must have one of the following fields specified: -
+ // linkedVpnTunnel - linkedInterconnectAttachment - subnetwork You can create a
+ // router interface without any of these fields specified. However, you cannot
+ // create a BGP peer that uses that interface.
Interfaces []*RouterInterface `json:"interfaces,omitempty"`
-
- // Kind: [Output Only] Type of resource. Always compute#router for
- // routers.
+ // Kind: [Output Only] Type of resource. Always compute#router for routers.
Kind string `json:"kind,omitempty"`
-
// Md5AuthenticationKeys: Keys used for MD5 authentication.
Md5AuthenticationKeys []*RouterMd5AuthenticationKey `json:"md5AuthenticationKeys,omitempty"`
-
- // Name: Name of the resource. Provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
- // the first character must be a lowercase letter, and all following
- // characters must be a dash, lowercase letter, or digit, except the
- // last character, which cannot be a dash.
+ // Name: Name of the resource. Provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must
+ // be a lowercase letter, and all following characters must be a dash,
+ // lowercase letter, or digit, except the last character, which cannot be a
+ // dash.
Name string `json:"name,omitempty"`
-
// Nats: A list of NAT services created in this router.
Nats []*RouterNat `json:"nats,omitempty"`
-
// Network: URI of the network to which this router belongs.
Network string `json:"network,omitempty"`
-
- // Region: [Output Only] URI of the region where the router resides. You
- // must specify this field as part of the HTTP request URL. It is not
- // settable as a field in the request body.
+ // Region: [Output Only] URI of the region where the router resides. You must
+ // specify this field as part of the HTTP request URL. It is not settable as a
+ // field in the request body.
Region string `json:"region,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Bgp") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Bgp") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Bgp") 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. "Bgp") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *Router) MarshalJSON() ([]byte, error) {
+func (s Router) MarshalJSON() ([]byte, error) {
type NoMethod Router
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// RouterAdvertisedIpRange: Description-tagged IP ranges for the router
-// to advertise.
+// RouterAdvertisedIpRange: Description-tagged IP ranges for the router to
+// advertise.
type RouterAdvertisedIpRange struct {
// Description: User-specified description for the IP range.
Description string `json:"description,omitempty"`
-
- // Range: The IP range to advertise. The value must be a CIDR-formatted
- // string.
+ // Range: The IP range to advertise. The value must be a CIDR-formatted string.
Range string `json:"range,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Description") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Description") to include
- // in API requests with the JSON null value. By default, fields with
- // empty values are omitted from API requests. However, any field with
- // an empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields 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. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RouterAdvertisedIpRange) MarshalJSON() ([]byte, error) {
+func (s RouterAdvertisedIpRange) MarshalJSON() ([]byte, error) {
type NoMethod RouterAdvertisedIpRange
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// RouterAggregatedList: Contains a list of routers.
type RouterAggregatedList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of Router resources.
Items map[string]RoutersScopedList `json:"items,omitempty"`
-
// Kind: Type of resource.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Unreachables: [Output Only] Unreachable resources.
Unreachables []string `json:"unreachables,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *RouterAggregatedListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RouterAggregatedList) MarshalJSON() ([]byte, error) {
+func (s RouterAggregatedList) MarshalJSON() ([]byte, error) {
type NoMethod RouterAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// RouterAggregatedListWarning: [Output Only] Informational warning
-// message.
+// RouterAggregatedListWarning: [Output Only] Informational warning message.
type RouterAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*RouterAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RouterAggregatedListWarning) MarshalJSON() ([]byte, error) {
+func (s RouterAggregatedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod RouterAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RouterAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RouterAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+func (s RouterAggregatedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod RouterAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RouterBgp struct {
@@ -44960,63 +37952,58 @@ type RouterBgp struct {
// "CUSTOM"
// "DEFAULT"
AdvertiseMode string `json:"advertiseMode,omitempty"`
-
- // AdvertisedGroups: User-specified list of prefix groups to advertise
- // in custom mode. This field can only be populated if advertise_mode is
- // CUSTOM and is advertised to all peers of the router. These groups
- // will be advertised in addition to any specified prefixes. Leave this
- // field blank to advertise no custom groups.
+ // AdvertisedGroups: User-specified list of prefix groups to advertise in
+ // custom mode. This field can only be populated if advertise_mode is CUSTOM
+ // and is advertised to all peers of the router. These groups will be
+ // advertised in addition to any specified prefixes. Leave this field blank to
+ // advertise no custom groups.
//
// Possible values:
// "ALL_SUBNETS" - Advertise all available subnets (including peer VPC
// subnets).
AdvertisedGroups []string `json:"advertisedGroups,omitempty"`
-
- // AdvertisedIpRanges: User-specified list of individual IP ranges to
- // advertise in custom mode. This field can only be populated if
- // advertise_mode is CUSTOM and is advertised to all peers of the
- // router. These IP ranges will be advertised in addition to any
- // specified groups. Leave this field blank to advertise no custom IP
- // ranges.
+ // AdvertisedIpRanges: User-specified list of individual IP ranges to advertise
+ // in custom mode. This field can only be populated if advertise_mode is CUSTOM
+ // and is advertised to all peers of the router. These IP ranges will be
+ // advertised in addition to any specified groups. Leave this field blank to
+ // advertise no custom IP ranges.
AdvertisedIpRanges []*RouterAdvertisedIpRange `json:"advertisedIpRanges,omitempty"`
-
- // Asn: Local BGP Autonomous System Number (ASN). Must be an RFC6996
- // private ASN, either 16-bit or 32-bit. The value will be fixed for
- // this router resource. All VPN tunnels that link to this router will
- // have the same local ASN.
+ // Asn: Local BGP Autonomous System Number (ASN). Must be an RFC6996 private
+ // ASN, either 16-bit or 32-bit. The value will be fixed for this router
+ // resource. All VPN tunnels that link to this router will have the same local
+ // ASN.
Asn int64 `json:"asn,omitempty"`
-
- // KeepaliveInterval: The interval in seconds between BGP keepalive
- // messages that are sent to the peer. Hold time is three times the
- // interval at which keepalive messages are sent, and the hold time is
- // the maximum number of seconds allowed to elapse between successive
- // keepalive messages that BGP receives from a peer. BGP will use the
- // smaller of either the local hold time value or the peer's hold time
- // value as the hold time for the BGP connection between the two peers.
- // If set, this value must be between 20 and 60. The default is 20.
+ // IdentifierRange: Explicitly specifies a range of valid BGP Identifiers for
+ // this Router. It is provided as a link-local IPv4 range (from
+ // 169.254.0.0/16), of size at least /30, even if the BGP sessions are over
+ // IPv6. It must not overlap with any IPv4 BGP session ranges. Other vendors
+ // commonly call this "router ID".
+ IdentifierRange string `json:"identifierRange,omitempty"`
+ // KeepaliveInterval: The interval in seconds between BGP keepalive messages
+ // that are sent to the peer. Hold time is three times the interval at which
+ // keepalive messages are sent, and the hold time is the maximum number of
+ // seconds allowed to elapse between successive keepalive messages that BGP
+ // receives from a peer. BGP will use the smaller of either the local hold time
+ // value or the peer's hold time value as the hold time for the BGP connection
+ // between the two peers. If set, this value must be between 20 and 60. The
+ // default is 20.
KeepaliveInterval int64 `json:"keepaliveInterval,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "AdvertiseMode") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "AdvertiseMode") 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. "AdvertiseMode") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RouterBgp) MarshalJSON() ([]byte, error) {
+func (s RouterBgp) MarshalJSON() ([]byte, error) {
type NoMethod RouterBgp
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RouterBgpPeer struct {
@@ -45027,701 +38014,593 @@ type RouterBgpPeer struct {
// "CUSTOM"
// "DEFAULT"
AdvertiseMode string `json:"advertiseMode,omitempty"`
-
- // AdvertisedGroups: User-specified list of prefix groups to advertise
- // in custom mode, which currently supports the following option: -
- // ALL_SUBNETS: Advertises all of the router's own VPC subnets. This
- // excludes any routes learned for subnets that use VPC Network Peering.
- // Note that this field can only be populated if advertise_mode is
- // CUSTOM and overrides the list defined for the router (in the "bgp"
- // message). These groups are advertised in addition to any specified
- // prefixes. Leave this field blank to advertise no custom groups.
+ // AdvertisedGroups: User-specified list of prefix groups to advertise in
+ // custom mode, which currently supports the following option: - ALL_SUBNETS:
+ // Advertises all of the router's own VPC subnets. This excludes any routes
+ // learned for subnets that use VPC Network Peering. Note that this field can
+ // only be populated if advertise_mode is CUSTOM and overrides the list defined
+ // for the router (in the "bgp" message). These groups are advertised in
+ // addition to any specified prefixes. Leave this field blank to advertise no
+ // custom groups.
//
// Possible values:
// "ALL_SUBNETS" - Advertise all available subnets (including peer VPC
// subnets).
AdvertisedGroups []string `json:"advertisedGroups,omitempty"`
-
- // AdvertisedIpRanges: User-specified list of individual IP ranges to
- // advertise in custom mode. This field can only be populated if
- // advertise_mode is CUSTOM and overrides the list defined for the
- // router (in the "bgp" message). These IP ranges are advertised in
- // addition to any specified groups. Leave this field blank to advertise
- // no custom IP ranges.
+ // AdvertisedIpRanges: User-specified list of individual IP ranges to advertise
+ // in custom mode. This field can only be populated if advertise_mode is CUSTOM
+ // and overrides the list defined for the router (in the "bgp" message). These
+ // IP ranges are advertised in addition to any specified groups. Leave this
+ // field blank to advertise no custom IP ranges.
AdvertisedIpRanges []*RouterAdvertisedIpRange `json:"advertisedIpRanges,omitempty"`
-
- // AdvertisedRoutePriority: The priority of routes advertised to this
- // BGP peer. Where there is more than one matching route of maximum
- // length, the routes with the lowest priority value win.
+ // AdvertisedRoutePriority: The priority of routes advertised to this BGP peer.
+ // Where there is more than one matching route of maximum length, the routes
+ // with the lowest priority value win.
AdvertisedRoutePriority int64 `json:"advertisedRoutePriority,omitempty"`
-
// Bfd: BFD configuration for the BGP peering.
Bfd *RouterBgpPeerBfd `json:"bfd,omitempty"`
-
// CustomLearnedIpRanges: A list of user-defined custom learned route IP
// address ranges for a BGP session.
CustomLearnedIpRanges []*RouterBgpPeerCustomLearnedIpRange `json:"customLearnedIpRanges,omitempty"`
-
- // CustomLearnedRoutePriority: The user-defined custom learned route
- // priority for a BGP session. This value is applied to all custom
- // learned route ranges for the session. You can choose a value from `0`
- // to `65335`. If you don't provide a value, Google Cloud assigns a
- // priority of `100` to the ranges.
+ // CustomLearnedRoutePriority: The user-defined custom learned route priority
+ // for a BGP session. This value is applied to all custom learned route ranges
+ // for the session. You can choose a value from `0` to `65335`. If you don't
+ // provide a value, Google Cloud assigns a priority of `100` to the ranges.
CustomLearnedRoutePriority int64 `json:"customLearnedRoutePriority,omitempty"`
-
- // Enable: The status of the BGP peer connection. If set to FALSE, any
- // active session with the peer is terminated and all associated routing
- // information is removed. If set to TRUE, the peer connection can be
- // established with routing information. The default is TRUE.
+ // Enable: The status of the BGP peer connection. If set to FALSE, any active
+ // session with the peer is terminated and all associated routing information
+ // is removed. If set to TRUE, the peer connection can be established with
+ // routing information. The default is TRUE.
//
// Possible values:
// "FALSE"
// "TRUE"
Enable string `json:"enable,omitempty"`
-
- // EnableIpv6: Enable IPv6 traffic over BGP Peer. If not specified, it
- // is disabled by default.
+ // EnableIpv4: Enable IPv4 traffic over BGP Peer. It is enabled by default if
+ // the peerIpAddress is version 4.
+ EnableIpv4 bool `json:"enableIpv4,omitempty"`
+ // EnableIpv6: Enable IPv6 traffic over BGP Peer. It is enabled by default if
+ // the peerIpAddress is version 6.
EnableIpv6 bool `json:"enableIpv6,omitempty"`
-
+ // ExportPolicies: List of export policies applied to this peer, in the order
+ // they must be evaluated. The name must correspond to an existing policy that
+ // has ROUTE_POLICY_TYPE_EXPORT type. Note that Route Policies are currently
+ // available in preview. Please use Beta API to use Route Policies.
+ ExportPolicies []string `json:"exportPolicies,omitempty"`
+ // ImportPolicies: List of import policies applied to this peer, in the order
+ // they must be evaluated. The name must correspond to an existing policy that
+ // has ROUTE_POLICY_TYPE_IMPORT type. Note that Route Policies are currently
+ // available in preview. Please use Beta API to use Route Policies.
+ ImportPolicies []string `json:"importPolicies,omitempty"`
// InterfaceName: Name of the interface the BGP peer is associated with.
InterfaceName string `json:"interfaceName,omitempty"`
-
// IpAddress: IP address of the interface inside Google Cloud Platform.
- // Only IPv4 is supported.
IpAddress string `json:"ipAddress,omitempty"`
-
+ // Ipv4NexthopAddress: IPv4 address of the interface inside Google Cloud
+ // Platform.
+ Ipv4NexthopAddress string `json:"ipv4NexthopAddress,omitempty"`
// Ipv6NexthopAddress: IPv6 address of the interface inside Google Cloud
// Platform.
Ipv6NexthopAddress string `json:"ipv6NexthopAddress,omitempty"`
-
- // ManagementType: [Output Only] The resource that configures and
- // manages this BGP peer. - MANAGED_BY_USER is the default value and can
- // be managed by you or other users - MANAGED_BY_ATTACHMENT is a BGP
- // peer that is configured and managed by Cloud Interconnect,
- // specifically by an InterconnectAttachment of type PARTNER. Google
- // automatically creates, updates, and deletes this type of BGP peer
- // when the PARTNER InterconnectAttachment is created, updated, or
+ // ManagementType: [Output Only] The resource that configures and manages this
+ // BGP peer. - MANAGED_BY_USER is the default value and can be managed by you
+ // or other users - MANAGED_BY_ATTACHMENT is a BGP peer that is configured and
+ // managed by Cloud Interconnect, specifically by an InterconnectAttachment of
+ // type PARTNER. Google automatically creates, updates, and deletes this type
+ // of BGP peer when the PARTNER InterconnectAttachment is created, updated, or
// deleted.
//
// Possible values:
// "MANAGED_BY_ATTACHMENT" - The BGP peer is automatically created for
- // PARTNER type InterconnectAttachment; Google will automatically
- // create/delete this BGP peer when the PARTNER InterconnectAttachment
- // is created/deleted, and Google will update the ipAddress and
- // peerIpAddress when the PARTNER InterconnectAttachment is provisioned.
- // This type of BGP peer cannot be created or deleted, but can be
- // modified for all fields except for name, ipAddress and peerIpAddress.
- // "MANAGED_BY_USER" - Default value, the BGP peer is manually created
- // and managed by user.
+ // PARTNER type InterconnectAttachment; Google will automatically create/delete
+ // this BGP peer when the PARTNER InterconnectAttachment is created/deleted,
+ // and Google will update the ipAddress and peerIpAddress when the PARTNER
+ // InterconnectAttachment is provisioned. This type of BGP peer cannot be
+ // created or deleted, but can be modified for all fields except for name,
+ // ipAddress and peerIpAddress.
+ // "MANAGED_BY_USER" - Default value, the BGP peer is manually created and
+ // managed by user.
ManagementType string `json:"managementType,omitempty"`
-
- // Md5AuthenticationKeyName: Present if MD5 authentication is enabled
- // for the peering. Must be the name of one of the entries in the
+ // Md5AuthenticationKeyName: Present if MD5 authentication is enabled for the
+ // peering. Must be the name of one of the entries in the
// Router.md5_authentication_keys. The field must comply with RFC1035.
Md5AuthenticationKeyName string `json:"md5AuthenticationKeyName,omitempty"`
-
- // Name: Name of this BGP peer. The name must be 1-63 characters long,
- // and comply with RFC1035. Specifically, the name must be 1-63
- // characters long and match the regular expression
- // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
- // a lowercase letter, and all following characters must be a dash,
- // lowercase letter, or digit, except the last character, which cannot
- // be a dash.
+ // Name: Name of this BGP peer. The name must be 1-63 characters long, and
+ // comply with RFC1035. Specifically, the name must be 1-63 characters long and
+ // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the
+ // first character must be a lowercase letter, and all following characters
+ // must be a dash, lowercase letter, or digit, except the last character, which
+ // cannot be a dash.
Name string `json:"name,omitempty"`
-
- // PeerAsn: Peer BGP Autonomous System Number (ASN). Each BGP interface
- // may use a different value.
+ // PeerAsn: Peer BGP Autonomous System Number (ASN). Each BGP interface may use
+ // a different value.
PeerAsn int64 `json:"peerAsn,omitempty"`
-
// PeerIpAddress: IP address of the BGP interface outside Google Cloud
- // Platform. Only IPv4 is supported.
+ // Platform.
PeerIpAddress string `json:"peerIpAddress,omitempty"`
-
- // PeerIpv6NexthopAddress: IPv6 address of the BGP interface outside
- // Google Cloud Platform.
+ // PeerIpv4NexthopAddress: IPv4 address of the BGP interface outside Google
+ // Cloud Platform.
+ PeerIpv4NexthopAddress string `json:"peerIpv4NexthopAddress,omitempty"`
+ // PeerIpv6NexthopAddress: IPv6 address of the BGP interface outside Google
+ // Cloud Platform.
PeerIpv6NexthopAddress string `json:"peerIpv6NexthopAddress,omitempty"`
-
- // RouterApplianceInstance: URI of the VM instance that is used as
- // third-party router appliances such as Next Gen Firewalls, Virtual
- // Routers, or Router Appliances. The VM instance must be located in
- // zones contained in the same region as this Cloud Router. The VM
- // instance is the peer side of the BGP session.
+ // RouterApplianceInstance: URI of the VM instance that is used as third-party
+ // router appliances such as Next Gen Firewalls, Virtual Routers, or Router
+ // Appliances. The VM instance must be located in zones contained in the same
+ // region as this Cloud Router. The VM instance is the peer side of the BGP
+ // session.
RouterApplianceInstance string `json:"routerApplianceInstance,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "AdvertiseMode") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "AdvertiseMode") 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. "AdvertiseMode") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RouterBgpPeer) MarshalJSON() ([]byte, error) {
+func (s RouterBgpPeer) MarshalJSON() ([]byte, error) {
type NoMethod RouterBgpPeer
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RouterBgpPeerBfd struct {
- // MinReceiveInterval: The minimum interval, in milliseconds, between
- // BFD control packets received from the peer router. The actual value
- // is negotiated between the two routers and is equal to the greater of
- // this value and the transmit interval of the other router. If set,
- // this value must be between 1000 and 30000. The default is 1000.
+ // MinReceiveInterval: The minimum interval, in milliseconds, between BFD
+ // control packets received from the peer router. The actual value is
+ // negotiated between the two routers and is equal to the greater of this value
+ // and the transmit interval of the other router. If set, this value must be
+ // between 1000 and 30000. The default is 1000.
MinReceiveInterval int64 `json:"minReceiveInterval,omitempty"`
-
- // MinTransmitInterval: The minimum interval, in milliseconds, between
- // BFD control packets transmitted to the peer router. The actual value
- // is negotiated between the two routers and is equal to the greater of
- // this value and the corresponding receive interval of the other
- // router. If set, this value must be between 1000 and 30000. The
- // default is 1000.
+ // MinTransmitInterval: The minimum interval, in milliseconds, between BFD
+ // control packets transmitted to the peer router. The actual value is
+ // negotiated between the two routers and is equal to the greater of this value
+ // and the corresponding receive interval of the other router. If set, this
+ // value must be between 1000 and 30000. The default is 1000.
MinTransmitInterval int64 `json:"minTransmitInterval,omitempty"`
-
- // Multiplier: The number of consecutive BFD packets that must be missed
- // before BFD declares that a peer is unavailable. If set, the value
- // must be a value between 5 and 16. The default is 5.
+ // Multiplier: The number of consecutive BFD packets that must be missed before
+ // BFD declares that a peer is unavailable. If set, the value must be a value
+ // between 5 and 16. The default is 5.
Multiplier int64 `json:"multiplier,omitempty"`
-
- // SessionInitializationMode: The BFD session initialization mode for
- // this BGP peer. If set to ACTIVE, the Cloud Router will initiate the
- // BFD session for this BGP peer. If set to PASSIVE, the Cloud Router
- // will wait for the peer router to initiate the BFD session for this
- // BGP peer. If set to DISABLED, BFD is disabled for this BGP peer. The
- // default is DISABLED.
+ // SessionInitializationMode: The BFD session initialization mode for this BGP
+ // peer. If set to ACTIVE, the Cloud Router will initiate the BFD session for
+ // this BGP peer. If set to PASSIVE, the Cloud Router will wait for the peer
+ // router to initiate the BFD session for this BGP peer. If set to DISABLED,
+ // BFD is disabled for this BGP peer. The default is DISABLED.
//
// Possible values:
// "ACTIVE"
// "DISABLED"
// "PASSIVE"
SessionInitializationMode string `json:"sessionInitializationMode,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "MinReceiveInterval")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "MinReceiveInterval") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "MinReceiveInterval") 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. "MinReceiveInterval") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RouterBgpPeerBfd) MarshalJSON() ([]byte, error) {
+func (s RouterBgpPeerBfd) MarshalJSON() ([]byte, error) {
type NoMethod RouterBgpPeerBfd
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RouterBgpPeerCustomLearnedIpRange struct {
// Range: The custom learned route IP address range. Must be a valid
- // CIDR-formatted prefix. If an IP address is provided without a subnet
- // mask, it is interpreted as, for IPv4, a `/32` singular IP address
- // range, and, for IPv6, `/128`.
+ // CIDR-formatted prefix. If an IP address is provided without a subnet mask,
+ // it is interpreted as, for IPv4, a `/32` singular IP address range, and, for
+ // IPv6, `/128`.
Range string `json:"range,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Range") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Range") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Range") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RouterBgpPeerCustomLearnedIpRange) MarshalJSON() ([]byte, error) {
+func (s RouterBgpPeerCustomLearnedIpRange) MarshalJSON() ([]byte, error) {
type NoMethod RouterBgpPeerCustomLearnedIpRange
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RouterInterface struct {
- // IpRange: IP address and range of the interface. The IP range must be
- // in the RFC3927 link-local IP address space. The value must be a
- // CIDR-formatted string, for example: 169.254.0.1/30. NOTE: Do not
- // truncate the address as it represents the IP address of the
- // interface.
+ // IpRange: IP address and range of the interface. - For Internet Protocol
+ // version 4 (IPv4), the IP range must be in the RFC3927 link-local IP address
+ // space. The value must be a CIDR-formatted string, for example,
+ // 169.254.0.1/30. Note: Do not truncate the IP address, as it represents the
+ // IP address of the interface. - For Internet Protocol version 6 (IPv6), the
+ // value must be a unique local address (ULA) range from fdff:1::/64 with a
+ // mask length of 126 or less. This value should be a CIDR-formatted string,
+ // for example, fc00:0:1:1::1/112. Within the router's VPC, this IPv6 prefix
+ // will be reserved exclusively for this connection and cannot be used for any
+ // other purpose.
IpRange string `json:"ipRange,omitempty"`
-
- // LinkedInterconnectAttachment: URI of the linked Interconnect
- // attachment. It must be in the same region as the router. Each
- // interface can have one linked resource, which can be a VPN tunnel, an
- // Interconnect attachment, or a subnetwork.
- LinkedInterconnectAttachment string `json:"linkedInterconnectAttachment,omitempty"`
-
- // LinkedVpnTunnel: URI of the linked VPN tunnel, which must be in the
- // same region as the router. Each interface can have one linked
+ // IpVersion: IP version of this interface.
+ //
+ // Possible values:
+ // "IPV4"
+ // "IPV6"
+ IpVersion string `json:"ipVersion,omitempty"`
+ // LinkedInterconnectAttachment: URI of the linked Interconnect attachment. It
+ // must be in the same region as the router. Each interface can have one linked
// resource, which can be a VPN tunnel, an Interconnect attachment, or a
// subnetwork.
+ LinkedInterconnectAttachment string `json:"linkedInterconnectAttachment,omitempty"`
+ // LinkedVpnTunnel: URI of the linked VPN tunnel, which must be in the same
+ // region as the router. Each interface can have one linked resource, which can
+ // be a VPN tunnel, an Interconnect attachment, or a subnetwork.
LinkedVpnTunnel string `json:"linkedVpnTunnel,omitempty"`
-
- // ManagementType: [Output Only] The resource that configures and
- // manages this interface. - MANAGED_BY_USER is the default value and
- // can be managed directly by users. - MANAGED_BY_ATTACHMENT is an
- // interface that is configured and managed by Cloud Interconnect,
- // specifically, by an InterconnectAttachment of type PARTNER. Google
- // automatically creates, updates, and deletes this type of interface
- // when the PARTNER InterconnectAttachment is created, updated, or
- // deleted.
- //
- // Possible values:
- // "MANAGED_BY_ATTACHMENT" - The interface is automatically created
- // for PARTNER type InterconnectAttachment, Google will automatically
- // create/update/delete this interface when the PARTNER
- // InterconnectAttachment is created/provisioned/deleted. This type of
- // interface cannot be manually managed by user.
- // "MANAGED_BY_USER" - Default value, the interface is manually
- // created and managed by user.
+ // ManagementType: [Output Only] The resource that configures and manages this
+ // interface. - MANAGED_BY_USER is the default value and can be managed
+ // directly by users. - MANAGED_BY_ATTACHMENT is an interface that is
+ // configured and managed by Cloud Interconnect, specifically, by an
+ // InterconnectAttachment of type PARTNER. Google automatically creates,
+ // updates, and deletes this type of interface when the PARTNER
+ // InterconnectAttachment is created, updated, or deleted.
+ //
+ // Possible values:
+ // "MANAGED_BY_ATTACHMENT" - The interface is automatically created for
+ // PARTNER type InterconnectAttachment, Google will automatically
+ // create/update/delete this interface when the PARTNER InterconnectAttachment
+ // is created/provisioned/deleted. This type of interface cannot be manually
+ // managed by user.
+ // "MANAGED_BY_USER" - Default value, the interface is manually created and
+ // managed by user.
ManagementType string `json:"managementType,omitempty"`
-
- // Name: Name of this interface entry. The name must be 1-63 characters
- // long, and comply with RFC1035. Specifically, the name must be 1-63
- // characters long and match the regular expression
- // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
- // a lowercase letter, and all following characters must be a dash,
- // lowercase letter, or digit, except the last character, which cannot
- // be a dash.
+ // Name: Name of this interface entry. The name must be 1-63 characters long,
+ // and comply with RFC1035. Specifically, the name must be 1-63 characters long
+ // and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
+ // the first character must be a lowercase letter, and all following characters
+ // must be a dash, lowercase letter, or digit, except the last character, which
+ // cannot be a dash.
Name string `json:"name,omitempty"`
-
- // PrivateIpAddress: The regional private internal IP address that is
- // used to establish BGP sessions to a VM instance acting as a
- // third-party Router Appliance, such as a Next Gen Firewall, a Virtual
- // Router, or an SD-WAN VM.
+ // PrivateIpAddress: The regional private internal IP address that is used to
+ // establish BGP sessions to a VM instance acting as a third-party Router
+ // Appliance, such as a Next Gen Firewall, a Virtual Router, or an SD-WAN VM.
PrivateIpAddress string `json:"privateIpAddress,omitempty"`
-
- // RedundantInterface: Name of the interface that will be redundant with
- // the current interface you are creating. The redundantInterface must
- // belong to the same Cloud Router as the interface here. To establish
- // the BGP session to a Router Appliance VM, you must create two BGP
- // peers. The two BGP peers must be attached to two separate interfaces
- // that are redundant with each other. The redundant_interface must be
- // 1-63 characters long, and comply with RFC1035. Specifically, the
- // redundant_interface must be 1-63 characters long and match the
- // regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first
- // character must be a lowercase letter, and all following characters
- // must be a dash, lowercase letter, or digit, except the last
- // character, which cannot be a dash.
+ // RedundantInterface: Name of the interface that will be redundant with the
+ // current interface you are creating. The redundantInterface must belong to
+ // the same Cloud Router as the interface here. To establish the BGP session to
+ // a Router Appliance VM, you must create two BGP peers. The two BGP peers must
+ // be attached to two separate interfaces that are redundant with each other.
+ // The redundant_interface must be 1-63 characters long, and comply with
+ // RFC1035. Specifically, the redundant_interface must be 1-63 characters long
+ // and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
+ // the first character must be a lowercase letter, and all following characters
+ // must be a dash, lowercase letter, or digit, except the last character, which
+ // cannot be a dash.
RedundantInterface string `json:"redundantInterface,omitempty"`
-
- // Subnetwork: The URI of the subnetwork resource that this interface
- // belongs to, which must be in the same region as the Cloud Router.
- // When you establish a BGP session to a VM instance using this
- // interface, the VM instance must belong to the same subnetwork as the
- // subnetwork specified here.
+ // Subnetwork: The URI of the subnetwork resource that this interface belongs
+ // to, which must be in the same region as the Cloud Router. When you establish
+ // a BGP session to a VM instance using this interface, the VM instance must
+ // belong to the same subnetwork as the subnetwork specified here.
Subnetwork string `json:"subnetwork,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "IpRange") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "IpRange") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "IpRange") 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. "IpRange") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RouterInterface) MarshalJSON() ([]byte, error) {
+func (s RouterInterface) MarshalJSON() ([]byte, error) {
type NoMethod RouterInterface
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// RouterList: Contains a list of Router resources.
type RouterList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of Router resources.
Items []*Router `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource. Always compute#router for
- // routers.
+ // Kind: [Output Only] Type of resource. Always compute#router for routers.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *RouterListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RouterList) MarshalJSON() ([]byte, error) {
+func (s RouterList) MarshalJSON() ([]byte, error) {
type NoMethod RouterList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// RouterListWarning: [Output Only] Informational warning message.
type RouterListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*RouterListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RouterListWarning) MarshalJSON() ([]byte, error) {
+func (s RouterListWarning) MarshalJSON() ([]byte, error) {
type NoMethod RouterListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RouterListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RouterListWarningData) MarshalJSON() ([]byte, error) {
+func (s RouterListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod RouterListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RouterMd5AuthenticationKey struct {
- // Key: [Input only] Value of the key. For patch and update calls, it
- // can be skipped to copy the value from the previous configuration.
- // This is allowed if the key with the same name existed before the
- // operation. Maximum length is 80 characters. Can only contain
- // printable ASCII characters.
+ // Key: [Input only] Value of the key. For patch and update calls, it can be
+ // skipped to copy the value from the previous configuration. This is allowed
+ // if the key with the same name existed before the operation. Maximum length
+ // is 80 characters. Can only contain printable ASCII characters.
Key string `json:"key,omitempty"`
-
- // Name: Name used to identify the key. Must be unique within a router.
- // Must be referenced by exactly one bgpPeer. Must comply with RFC1035.
+ // Name: Name used to identify the key. Must be unique within a router. Must be
+ // referenced by exactly one bgpPeer. Must comply with RFC1035.
Name string `json:"name,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RouterMd5AuthenticationKey) MarshalJSON() ([]byte, error) {
+func (s RouterMd5AuthenticationKey) MarshalJSON() ([]byte, error) {
type NoMethod RouterMd5AuthenticationKey
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// RouterNat: Represents a Nat resource. It enables the VMs within the
-// specified subnetworks to access Internet without external IP
-// addresses. It specifies a list of subnetworks (and the ranges within)
-// that want to use NAT. Customers can also provide the external IPs
-// that would be used for NAT. GCP would auto-allocate ephemeral IPs if
-// no external IPs are provided.
+// specified subnetworks to access Internet without external IP addresses. It
+// specifies a list of subnetworks (and the ranges within) that want to use
+// NAT. Customers can also provide the external IPs that would be used for NAT.
+// GCP would auto-allocate ephemeral IPs if no external IPs are provided.
type RouterNat struct {
- // AutoNetworkTier: The network tier to use when automatically reserving
- // NAT IP addresses. Must be one of: PREMIUM, STANDARD. If not
- // specified, then the current project-level default tier is used.
+ // AutoNetworkTier: The network tier to use when automatically reserving NAT IP
+ // addresses. Must be one of: PREMIUM, STANDARD. If not specified, then the
+ // current project-level default tier is used.
//
// Possible values:
// "FIXED_STANDARD" - Public internet quality with fixed bandwidth.
- // "PREMIUM" - High quality, Google-grade network tier, support for
- // all networking products.
- // "STANDARD" - Public internet quality, only limited support for
- // other networking products.
- // "STANDARD_OVERRIDES_FIXED_STANDARD" - (Output only) Temporary tier
- // for FIXED_STANDARD when fixed standard tier is expired or not
- // configured.
+ // "PREMIUM" - High quality, Google-grade network tier, support for all
+ // networking products.
+ // "STANDARD" - Public internet quality, only limited support for other
+ // networking products.
+ // "STANDARD_OVERRIDES_FIXED_STANDARD" - (Output only) Temporary tier for
+ // FIXED_STANDARD when fixed standard tier is expired or not configured.
AutoNetworkTier string `json:"autoNetworkTier,omitempty"`
-
- // DrainNatIps: A list of URLs of the IP resources to be drained. These
- // IPs must be valid static external IPs that have been assigned to the
- // NAT. These IPs should be used for updating/patching a NAT only.
+ // DrainNatIps: A list of URLs of the IP resources to be drained. These IPs
+ // must be valid static external IPs that have been assigned to the NAT. These
+ // IPs should be used for updating/patching a NAT only.
DrainNatIps []string `json:"drainNatIps,omitempty"`
-
// EnableDynamicPortAllocation: Enable Dynamic Port Allocation. If not
// specified, it is disabled by default. If set to true, - Dynamic Port
// Allocation will be enabled on this NAT config. -
- // enableEndpointIndependentMapping cannot be set to true. - If minPorts
- // is set, minPortsPerVm must be set to a power of two greater than or
- // equal to 32. If minPortsPerVm is not set, a minimum of 32 ports will
- // be allocated to a VM from this NAT config.
- EnableDynamicPortAllocation bool `json:"enableDynamicPortAllocation,omitempty"`
-
+ // enableEndpointIndependentMapping cannot be set to true. - If minPorts is
+ // set, minPortsPerVm must be set to a power of two greater than or equal to
+ // 32. If minPortsPerVm is not set, a minimum of 32 ports will be allocated to
+ // a VM from this NAT config.
+ EnableDynamicPortAllocation bool `json:"enableDynamicPortAllocation,omitempty"`
EnableEndpointIndependentMapping bool `json:"enableEndpointIndependentMapping,omitempty"`
-
- // EndpointTypes: List of NAT-ted endpoint types supported by the Nat
- // Gateway. If the list is empty, then it will be equivalent to include
- // ENDPOINT_TYPE_VM
+ // EndpointTypes: List of NAT-ted endpoint types supported by the Nat Gateway.
+ // If the list is empty, then it will be equivalent to include ENDPOINT_TYPE_VM
//
// Possible values:
- // "ENDPOINT_TYPE_MANAGED_PROXY_LB" - This is used for regional
- // Application Load Balancers (internal and external) and regional proxy
- // Network Load Balancers (internal and external) endpoints.
- // "ENDPOINT_TYPE_SWG" - This is used for Secure Web Gateway
- // endpoints.
+ // "ENDPOINT_TYPE_MANAGED_PROXY_LB" - This is used for regional Application
+ // Load Balancers (internal and external) and regional proxy Network Load
+ // Balancers (internal and external) endpoints.
+ // "ENDPOINT_TYPE_SWG" - This is used for Secure Web Gateway endpoints.
// "ENDPOINT_TYPE_VM" - This is the default.
EndpointTypes []string `json:"endpointTypes,omitempty"`
-
- // IcmpIdleTimeoutSec: Timeout (in seconds) for ICMP connections.
- // Defaults to 30s if not set.
+ // IcmpIdleTimeoutSec: Timeout (in seconds) for ICMP connections. Defaults to
+ // 30s if not set.
IcmpIdleTimeoutSec int64 `json:"icmpIdleTimeoutSec,omitempty"`
-
// LogConfig: Configure logging on this NAT.
LogConfig *RouterNatLogConfig `json:"logConfig,omitempty"`
-
- // MaxPortsPerVm: Maximum number of ports allocated to a VM from this
- // NAT config when Dynamic Port Allocation is enabled. If Dynamic Port
- // Allocation is not enabled, this field has no effect. If Dynamic Port
- // Allocation is enabled, and this field is set, it must be set to a
- // power of two greater than minPortsPerVm, or 64 if minPortsPerVm is
- // not set. If Dynamic Port Allocation is enabled and this field is not
- // set, a maximum of 65536 ports will be allocated to a VM from this NAT
- // config.
+ // MaxPortsPerVm: Maximum number of ports allocated to a VM from this NAT
+ // config when Dynamic Port Allocation is enabled. If Dynamic Port Allocation
+ // is not enabled, this field has no effect. If Dynamic Port Allocation is
+ // enabled, and this field is set, it must be set to a power of two greater
+ // than minPortsPerVm, or 64 if minPortsPerVm is not set. If Dynamic Port
+ // Allocation is enabled and this field is not set, a maximum of 65536 ports
+ // will be allocated to a VM from this NAT config.
MaxPortsPerVm int64 `json:"maxPortsPerVm,omitempty"`
-
- // MinPortsPerVm: Minimum number of ports allocated to a VM from this
- // NAT config. If not set, a default number of ports is allocated to a
- // VM. This is rounded up to the nearest power of 2. For example, if the
- // value of this field is 50, at least 64 ports are allocated to a VM.
+ // MinPortsPerVm: Minimum number of ports allocated to a VM from this NAT
+ // config. If not set, a default number of ports is allocated to a VM. This is
+ // rounded up to the nearest power of 2. For example, if the value of this
+ // field is 50, at least 64 ports are allocated to a VM.
MinPortsPerVm int64 `json:"minPortsPerVm,omitempty"`
-
- // Name: Unique name of this Nat service. The name must be 1-63
- // characters long and comply with RFC1035.
+ // Name: Unique name of this Nat service. The name must be 1-63 characters long
+ // and comply with RFC1035.
Name string `json:"name,omitempty"`
-
- // NatIpAllocateOption: Specify the NatIpAllocateOption, which can take
- // one of the following values: - MANUAL_ONLY: Uses only Nat IP
- // addresses provided by customers. When there are not enough specified
- // Nat IPs, the Nat service fails for new VMs. - AUTO_ONLY: Nat IPs are
- // allocated by Google Cloud Platform; customers can't specify any Nat
- // IPs. When choosing AUTO_ONLY, then nat_ip should be empty.
- //
- // Possible values:
- // "AUTO_ONLY" - Nat IPs are allocated by GCP; customers can not
- // specify any Nat IPs.
- // "MANUAL_ONLY" - Only use Nat IPs provided by customers. When
- // specified Nat IPs are not enough then the Nat service fails for new
- // VMs.
+ // NatIpAllocateOption: Specify the NatIpAllocateOption, which can take one of
+ // the following values: - MANUAL_ONLY: Uses only Nat IP addresses provided by
+ // customers. When there are not enough specified Nat IPs, the Nat service
+ // fails for new VMs. - AUTO_ONLY: Nat IPs are allocated by Google Cloud
+ // Platform; customers can't specify any Nat IPs. When choosing AUTO_ONLY, then
+ // nat_ip should be empty.
+ //
+ // Possible values:
+ // "AUTO_ONLY" - Nat IPs are allocated by GCP; customers can not specify any
+ // Nat IPs.
+ // "MANUAL_ONLY" - Only use Nat IPs provided by customers. When specified Nat
+ // IPs are not enough then the Nat service fails for new VMs.
NatIpAllocateOption string `json:"natIpAllocateOption,omitempty"`
-
- // NatIps: A list of URLs of the IP resources used for this Nat service.
- // These IP addresses must be valid static external IP addresses
- // assigned to the project.
+ // NatIps: A list of URLs of the IP resources used for this Nat service. These
+ // IP addresses must be valid static external IP addresses assigned to the
+ // project.
NatIps []string `json:"natIps,omitempty"`
-
// Rules: A list of rules associated with this NAT.
Rules []*RouterNatRule `json:"rules,omitempty"`
-
- // SourceSubnetworkIpRangesToNat: Specify the Nat option, which can take
- // one of the following values: - ALL_SUBNETWORKS_ALL_IP_RANGES: All of
- // the IP ranges in every Subnetwork are allowed to Nat. -
- // ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES: All of the primary IP ranges
- // in every Subnetwork are allowed to Nat. - LIST_OF_SUBNETWORKS: A list
- // of Subnetworks are allowed to Nat (specified in the field subnetwork
- // below) The default is SUBNETWORK_IP_RANGE_TO_NAT_OPTION_UNSPECIFIED.
- // Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES then
- // there should not be any other Router.Nat section in any Router for
- // this network in this region.
- //
- // Possible values:
- // "ALL_SUBNETWORKS_ALL_IP_RANGES" - All the IP ranges in every
- // Subnetwork are allowed to Nat.
- // "ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES" - All the primary IP ranges
- // in every Subnetwork are allowed to Nat.
+ // SourceSubnetworkIpRangesToNat: Specify the Nat option, which can take one of
+ // the following values: - ALL_SUBNETWORKS_ALL_IP_RANGES: All of the IP ranges
+ // in every Subnetwork are allowed to Nat. -
+ // ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES: All of the primary IP ranges in every
+ // Subnetwork are allowed to Nat. - LIST_OF_SUBNETWORKS: A list of Subnetworks
+ // are allowed to Nat (specified in the field subnetwork below) The default is
+ // SUBNETWORK_IP_RANGE_TO_NAT_OPTION_UNSPECIFIED. Note that if this field
+ // contains ALL_SUBNETWORKS_ALL_IP_RANGES then there should not be any other
+ // Router.Nat section in any Router for this network in this region.
+ //
+ // Possible values:
+ // "ALL_SUBNETWORKS_ALL_IP_RANGES" - All the IP ranges in every Subnetwork
+ // are allowed to Nat.
+ // "ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES" - All the primary IP ranges in
+ // every Subnetwork are allowed to Nat.
// "LIST_OF_SUBNETWORKS" - A list of Subnetworks are allowed to Nat
// (specified in the field subnetwork below)
SourceSubnetworkIpRangesToNat string `json:"sourceSubnetworkIpRangesToNat,omitempty"`
-
// Subnetworks: A list of Subnetwork resources whose traffic should be
- // translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS
- // is selected for the SubnetworkIpRangeToNatOption above.
+ // translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is
+ // selected for the SubnetworkIpRangeToNatOption above.
Subnetworks []*RouterNatSubnetworkToNat `json:"subnetworks,omitempty"`
-
- // TcpEstablishedIdleTimeoutSec: Timeout (in seconds) for TCP
- // established connections. Defaults to 1200s if not set.
+ // TcpEstablishedIdleTimeoutSec: Timeout (in seconds) for TCP established
+ // connections. Defaults to 1200s if not set.
TcpEstablishedIdleTimeoutSec int64 `json:"tcpEstablishedIdleTimeoutSec,omitempty"`
-
- // TcpTimeWaitTimeoutSec: Timeout (in seconds) for TCP connections that
- // are in TIME_WAIT state. Defaults to 120s if not set.
+ // TcpTimeWaitTimeoutSec: Timeout (in seconds) for TCP connections that are in
+ // TIME_WAIT state. Defaults to 120s if not set.
TcpTimeWaitTimeoutSec int64 `json:"tcpTimeWaitTimeoutSec,omitempty"`
-
// TcpTransitoryIdleTimeoutSec: Timeout (in seconds) for TCP transitory
// connections. Defaults to 30s if not set.
TcpTransitoryIdleTimeoutSec int64 `json:"tcpTransitoryIdleTimeoutSec,omitempty"`
-
// Type: Indicates whether this NAT is used for public or private IP
// translation. If unspecified, it defaults to PUBLIC.
//
@@ -45729,303 +38608,250 @@ type RouterNat struct {
// "PRIVATE" - NAT used for private IP translation.
// "PUBLIC" - NAT used for public IP translation. This is the default.
Type string `json:"type,omitempty"`
-
- // UdpIdleTimeoutSec: Timeout (in seconds) for UDP connections. Defaults
- // to 30s if not set.
+ // UdpIdleTimeoutSec: Timeout (in seconds) for UDP connections. Defaults to 30s
+ // if not set.
UdpIdleTimeoutSec int64 `json:"udpIdleTimeoutSec,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "AutoNetworkTier") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "AutoNetworkTier") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "AutoNetworkTier") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RouterNat) MarshalJSON() ([]byte, error) {
+func (s RouterNat) MarshalJSON() ([]byte, error) {
type NoMethod RouterNat
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// RouterNatLogConfig: Configuration of logging on a NAT.
type RouterNatLogConfig struct {
- // Enable: Indicates whether or not to export logs. This is false by
- // default.
+ // Enable: Indicates whether or not to export logs. This is false by default.
Enable bool `json:"enable,omitempty"`
-
- // Filter: Specify the desired filtering of logs on this NAT. If
- // unspecified, logs are exported for all connections handled by this
- // NAT. This option can take one of the following values: - ERRORS_ONLY:
- // Export logs only for connection failures. - TRANSLATIONS_ONLY: Export
- // logs only for successful connections. - ALL: Export logs for all
- // connections, successful and unsuccessful.
+ // Filter: Specify the desired filtering of logs on this NAT. If unspecified,
+ // logs are exported for all connections handled by this NAT. This option can
+ // take one of the following values: - ERRORS_ONLY: Export logs only for
+ // connection failures. - TRANSLATIONS_ONLY: Export logs only for successful
+ // connections. - ALL: Export logs for all connections, successful and
+ // unsuccessful.
//
// Possible values:
- // "ALL" - Export logs for all (successful and unsuccessful)
- // connections.
+ // "ALL" - Export logs for all (successful and unsuccessful) connections.
// "ERRORS_ONLY" - Export logs for connection failures only.
// "TRANSLATIONS_ONLY" - Export logs for successful connections only.
Filter string `json:"filter,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Enable") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Enable") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Enable") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RouterNatLogConfig) MarshalJSON() ([]byte, error) {
+func (s RouterNatLogConfig) MarshalJSON() ([]byte, error) {
type NoMethod RouterNatLogConfig
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RouterNatRule struct {
// Action: The action to be enforced for traffic that matches this rule.
Action *RouterNatRuleAction `json:"action,omitempty"`
-
// Description: An optional description of this rule.
Description string `json:"description,omitempty"`
-
- // Match: CEL expression that specifies the match condition that egress
- // traffic from a VM is evaluated against. If it evaluates to true, the
- // corresponding `action` is enforced. The following examples are valid
- // match expressions for public NAT: "inIpRange(destination.ip,
- // '1.1.0.0/16') || inIpRange(destination.ip, '2.2.0.0/16')"
- // "destination.ip == '1.1.0.1' || destination.ip == '8.8.8.8'" The
- // following example is a valid match expression for private NAT:
- // "nexthop.hub ==
- // '//networkconnectivity.googleapis.com/projects/my-project/locations/gl
- // obal/hubs/hub-1'"
+ // Match: CEL expression that specifies the match condition that egress traffic
+ // from a VM is evaluated against. If it evaluates to true, the corresponding
+ // `action` is enforced. The following examples are valid match expressions for
+ // public NAT: `inIpRange(destination.ip, '1.1.0.0/16') ||
+ // inIpRange(destination.ip, '2.2.0.0/16')` `destination.ip == '1.1.0.1' ||
+ // destination.ip == '8.8.8.8'` The following example is a valid match
+ // expression for private NAT: `nexthop.hub ==
+ // '//networkconnectivity.googleapis.com/projects/my-project/locations/global/hu
+ // bs/hub-1'`
Match string `json:"match,omitempty"`
-
- // RuleNumber: An integer uniquely identifying a rule in the list. The
- // rule number must be a positive value between 0 and 65000, and must be
- // unique among rules within a NAT.
+ // RuleNumber: An integer uniquely identifying a rule in the list. The rule
+ // number must be a positive value between 0 and 65000, and must be unique
+ // among rules within a NAT.
RuleNumber int64 `json:"ruleNumber,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Action") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Action") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Action") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RouterNatRule) MarshalJSON() ([]byte, error) {
+func (s RouterNatRule) MarshalJSON() ([]byte, error) {
type NoMethod RouterNatRule
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RouterNatRuleAction struct {
- // SourceNatActiveIps: A list of URLs of the IP resources used for this
- // NAT rule. These IP addresses must be valid static external IP
- // addresses assigned to the project. This field is used for public NAT.
+ // SourceNatActiveIps: A list of URLs of the IP resources used for this NAT
+ // rule. These IP addresses must be valid static external IP addresses assigned
+ // to the project. This field is used for public NAT.
SourceNatActiveIps []string `json:"sourceNatActiveIps,omitempty"`
-
- // SourceNatActiveRanges: A list of URLs of the subnetworks used as
- // source ranges for this NAT Rule. These subnetworks must have purpose
- // set to PRIVATE_NAT. This field is used for private NAT.
+ // SourceNatActiveRanges: A list of URLs of the subnetworks used as source
+ // ranges for this NAT Rule. These subnetworks must have purpose set to
+ // PRIVATE_NAT. This field is used for private NAT.
SourceNatActiveRanges []string `json:"sourceNatActiveRanges,omitempty"`
-
- // SourceNatDrainIps: A list of URLs of the IP resources to be drained.
- // These IPs must be valid static external IPs that have been assigned
- // to the NAT. These IPs should be used for updating/patching a NAT rule
- // only. This field is used for public NAT.
+ // SourceNatDrainIps: A list of URLs of the IP resources to be drained. These
+ // IPs must be valid static external IPs that have been assigned to the NAT.
+ // These IPs should be used for updating/patching a NAT rule only. This field
+ // is used for public NAT.
SourceNatDrainIps []string `json:"sourceNatDrainIps,omitempty"`
-
- // SourceNatDrainRanges: A list of URLs of subnetworks representing
- // source ranges to be drained. This is only supported on patch/update,
- // and these subnetworks must have previously been used as active ranges
- // in this NAT Rule. This field is used for private NAT.
+ // SourceNatDrainRanges: A list of URLs of subnetworks representing source
+ // ranges to be drained. This is only supported on patch/update, and these
+ // subnetworks must have previously been used as active ranges in this NAT
+ // Rule. This field is used for private NAT.
SourceNatDrainRanges []string `json:"sourceNatDrainRanges,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "SourceNatActiveIps")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "SourceNatActiveIps") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "SourceNatActiveIps") 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. "SourceNatActiveIps") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RouterNatRuleAction) MarshalJSON() ([]byte, error) {
+func (s RouterNatRuleAction) MarshalJSON() ([]byte, error) {
type NoMethod RouterNatRuleAction
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// RouterNatSubnetworkToNat: Defines the IP ranges that want to use NAT
-// for a subnetwork.
+// RouterNatSubnetworkToNat: Defines the IP ranges that want to use NAT for a
+// subnetwork.
type RouterNatSubnetworkToNat struct {
// Name: URL for the subnetwork resource that will use NAT.
Name string `json:"name,omitempty"`
-
- // SecondaryIpRangeNames: A list of the secondary ranges of the
- // Subnetwork that are allowed to use NAT. This can be populated only if
+ // SecondaryIpRangeNames: A list of the secondary ranges of the Subnetwork that
+ // are allowed to use NAT. This can be populated only if
// "LIST_OF_SECONDARY_IP_RANGES" is one of the values in
// source_ip_ranges_to_nat.
SecondaryIpRangeNames []string `json:"secondaryIpRangeNames,omitempty"`
-
- // SourceIpRangesToNat: Specify the options for NAT ranges in the
- // Subnetwork. All options of a single value are valid except
- // NAT_IP_RANGE_OPTION_UNSPECIFIED. The only valid option with multiple
- // values is: ["PRIMARY_IP_RANGE", "LIST_OF_SECONDARY_IP_RANGES"]
- // Default: [ALL_IP_RANGES]
+ // SourceIpRangesToNat: Specify the options for NAT ranges in the Subnetwork.
+ // All options of a single value are valid except
+ // NAT_IP_RANGE_OPTION_UNSPECIFIED. The only valid option with multiple values
+ // is: ["PRIMARY_IP_RANGE", "LIST_OF_SECONDARY_IP_RANGES"] Default:
+ // [ALL_IP_RANGES]
//
// Possible values:
- // "ALL_IP_RANGES" - The primary and all the secondary ranges are
- // allowed to Nat.
- // "LIST_OF_SECONDARY_IP_RANGES" - A list of secondary ranges are
- // allowed to Nat.
+ // "ALL_IP_RANGES" - The primary and all the secondary ranges are allowed to
+ // Nat.
+ // "LIST_OF_SECONDARY_IP_RANGES" - A list of secondary ranges are allowed to
+ // Nat.
// "PRIMARY_IP_RANGE" - The primary range is allowed to Nat.
SourceIpRangesToNat []string `json:"sourceIpRangesToNat,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Name") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Name") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
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 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. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RouterNatSubnetworkToNat) MarshalJSON() ([]byte, error) {
+func (s RouterNatSubnetworkToNat) MarshalJSON() ([]byte, error) {
type NoMethod RouterNatSubnetworkToNat
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RouterStatus struct {
- // BestRoutes: Best routes for this router's network.
+ // BestRoutes: A list of the best dynamic routes for this Cloud Router's
+ // Virtual Private Cloud (VPC) network in the same region as this Cloud Router.
+ // Lists all of the best routes per prefix that are programmed into this
+ // region's VPC data plane. When global dynamic routing mode is turned on in
+ // the VPC network, this list can include cross-region dynamic routes from
+ // Cloud Routers in other regions.
BestRoutes []*Route `json:"bestRoutes,omitempty"`
-
- // BestRoutesForRouter: Best routes learned by this router.
- BestRoutesForRouter []*Route `json:"bestRoutesForRouter,omitempty"`
-
- BgpPeerStatus []*RouterStatusBgpPeerStatus `json:"bgpPeerStatus,omitempty"`
-
- NatStatus []*RouterStatusNatStatus `json:"natStatus,omitempty"`
-
+ // BestRoutesForRouter: A list of the best BGP routes learned by this Cloud
+ // Router. It is possible that routes listed might not be programmed into the
+ // data plane, if the Google Cloud control plane finds a more optimal route for
+ // a prefix than a route learned by this Cloud Router.
+ BestRoutesForRouter []*Route `json:"bestRoutesForRouter,omitempty"`
+ BgpPeerStatus []*RouterStatusBgpPeerStatus `json:"bgpPeerStatus,omitempty"`
+ NatStatus []*RouterStatusNatStatus `json:"natStatus,omitempty"`
// Network: URI of the network to which this router belongs.
Network string `json:"network,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "BestRoutes") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "BestRoutes") 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. "BestRoutes") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RouterStatus) MarshalJSON() ([]byte, error) {
+func (s RouterStatus) MarshalJSON() ([]byte, error) {
type NoMethod RouterStatus
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RouterStatusBgpPeerStatus struct {
// AdvertisedRoutes: Routes that were advertised to the remote BGP peer
- AdvertisedRoutes []*Route `json:"advertisedRoutes,omitempty"`
-
- BfdStatus *BfdStatus `json:"bfdStatus,omitempty"`
-
- // EnableIpv6: Enable IPv6 traffic over BGP Peer. If not specified, it
- // is disabled by default.
+ AdvertisedRoutes []*Route `json:"advertisedRoutes,omitempty"`
+ BfdStatus *BfdStatus `json:"bfdStatus,omitempty"`
+ // EnableIpv4: Enable IPv4 traffic over BGP Peer. It is enabled by default if
+ // the peerIpAddress is version 4.
+ EnableIpv4 bool `json:"enableIpv4,omitempty"`
+ // EnableIpv6: Enable IPv6 traffic over BGP Peer. It is enabled by default if
+ // the peerIpAddress is version 6.
EnableIpv6 bool `json:"enableIpv6,omitempty"`
-
// IpAddress: IP address of the local BGP interface.
IpAddress string `json:"ipAddress,omitempty"`
-
+ // Ipv4NexthopAddress: IPv4 address of the local BGP interface.
+ Ipv4NexthopAddress string `json:"ipv4NexthopAddress,omitempty"`
// Ipv6NexthopAddress: IPv6 address of the local BGP interface.
Ipv6NexthopAddress string `json:"ipv6NexthopAddress,omitempty"`
-
// LinkedVpnTunnel: URL of the VPN tunnel that this BGP peer controls.
LinkedVpnTunnel string `json:"linkedVpnTunnel,omitempty"`
-
- // Md5AuthEnabled: Informs whether MD5 authentication is enabled on this
- // BGP peer.
+ // Md5AuthEnabled: Informs whether MD5 authentication is enabled on this BGP
+ // peer.
Md5AuthEnabled bool `json:"md5AuthEnabled,omitempty"`
-
// Name: Name of this BGP peer. Unique within the Routers resource.
Name string `json:"name,omitempty"`
-
// NumLearnedRoutes: Number of routes learned from the remote BGP Peer.
NumLearnedRoutes int64 `json:"numLearnedRoutes,omitempty"`
-
// PeerIpAddress: IP address of the remote BGP interface.
PeerIpAddress string `json:"peerIpAddress,omitempty"`
-
+ // PeerIpv4NexthopAddress: IPv4 address of the remote BGP interface.
+ PeerIpv4NexthopAddress string `json:"peerIpv4NexthopAddress,omitempty"`
// PeerIpv6NexthopAddress: IPv6 address of the remote BGP interface.
PeerIpv6NexthopAddress string `json:"peerIpv6NexthopAddress,omitempty"`
-
- // RouterApplianceInstance: [Output only] URI of the VM instance that is
- // used as third-party router appliances such as Next Gen Firewalls,
- // Virtual Routers, or Router Appliances. The VM instance is the peer
- // side of the BGP session.
+ // RouterApplianceInstance: [Output only] URI of the VM instance that is used
+ // as third-party router appliances such as Next Gen Firewalls, Virtual
+ // Routers, or Router Appliances. The VM instance is the peer side of the BGP
+ // session.
RouterApplianceInstance string `json:"routerApplianceInstance,omitempty"`
-
- // State: The state of the BGP session. For a list of possible values
- // for this field, see BGP session states.
+ // State: The state of the BGP session. For a list of possible values for this
+ // field, see BGP session states.
State string `json:"state,omitempty"`
-
// Status: Status of the BGP peer: {UP, DOWN}
//
// Possible values:
@@ -46033,45 +38859,39 @@ type RouterStatusBgpPeerStatus struct {
// "UNKNOWN"
// "UP"
Status string `json:"status,omitempty"`
-
// StatusReason: Indicates why particular status was returned.
//
// Possible values:
+ // "IPV4_PEER_ON_IPV6_ONLY_CONNECTION" - BGP peer disabled because it
+ // requires IPv4 but the underlying connection is IPv6-only.
+ // "IPV6_PEER_ON_IPV4_ONLY_CONNECTION" - BGP peer disabled because it
+ // requires IPv6 but the underlying connection is IPv4-only.
// "MD5_AUTH_INTERNAL_PROBLEM" - Indicates internal problems with
- // configuration of MD5 authentication. This particular reason can only
- // be returned when md5AuthEnabled is true and status is DOWN.
+ // configuration of MD5 authentication. This particular reason can only be
+ // returned when md5AuthEnabled is true and status is DOWN.
// "STATUS_REASON_UNSPECIFIED"
StatusReason string `json:"statusReason,omitempty"`
-
- // Uptime: Time this session has been up. Format: 14 years, 51 weeks, 6
- // days, 23 hours, 59 minutes, 59 seconds
+ // Uptime: Time this session has been up. Format: 14 years, 51 weeks, 6 days,
+ // 23 hours, 59 minutes, 59 seconds
Uptime string `json:"uptime,omitempty"`
-
// UptimeSeconds: Time this session has been up, in seconds. Format: 145
UptimeSeconds string `json:"uptimeSeconds,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "AdvertisedRoutes") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "AdvertisedRoutes") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "AdvertisedRoutes") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RouterStatusBgpPeerStatus) MarshalJSON() ([]byte, error) {
+func (s RouterStatusBgpPeerStatus) MarshalJSON() ([]byte, error) {
type NoMethod RouterStatusBgpPeerStatus
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// RouterStatusNatStatus: Status of a NAT contained in this router.
@@ -46079,593 +38899,426 @@ type RouterStatusNatStatus struct {
// AutoAllocatedNatIps: A list of IPs auto-allocated for NAT. Example:
// ["1.1.1.1", "129.2.16.89"]
AutoAllocatedNatIps []string `json:"autoAllocatedNatIps,omitempty"`
-
- // DrainAutoAllocatedNatIps: A list of IPs auto-allocated for NAT that
- // are in drain mode. Example: ["1.1.1.1", "179.12.26.133"].
+ // DrainAutoAllocatedNatIps: A list of IPs auto-allocated for NAT that are in
+ // drain mode. Example: ["1.1.1.1", "179.12.26.133"].
DrainAutoAllocatedNatIps []string `json:"drainAutoAllocatedNatIps,omitempty"`
-
- // DrainUserAllocatedNatIps: A list of IPs user-allocated for NAT that
- // are in drain mode. Example: ["1.1.1.1", "179.12.26.133"].
+ // DrainUserAllocatedNatIps: A list of IPs user-allocated for NAT that are in
+ // drain mode. Example: ["1.1.1.1", "179.12.26.133"].
DrainUserAllocatedNatIps []string `json:"drainUserAllocatedNatIps,omitempty"`
-
- // MinExtraNatIpsNeeded: The number of extra IPs to allocate. This will
- // be greater than 0 only if user-specified IPs are NOT enough to allow
- // all configured VMs to use NAT. This value is meaningful only when
+ // MinExtraNatIpsNeeded: The number of extra IPs to allocate. This will be
+ // greater than 0 only if user-specified IPs are NOT enough to allow all
+ // configured VMs to use NAT. This value is meaningful only when
// auto-allocation of NAT IPs is *not* used.
MinExtraNatIpsNeeded int64 `json:"minExtraNatIpsNeeded,omitempty"`
-
// Name: Unique name of this NAT.
Name string `json:"name,omitempty"`
-
- // NumVmEndpointsWithNatMappings: Number of VM endpoints (i.e., Nics)
- // that can use NAT.
+ // NumVmEndpointsWithNatMappings: Number of VM endpoints (i.e., Nics) that can
+ // use NAT.
NumVmEndpointsWithNatMappings int64 `json:"numVmEndpointsWithNatMappings,omitempty"`
-
// RuleStatus: Status of rules in this NAT.
RuleStatus []*RouterStatusNatStatusNatRuleStatus `json:"ruleStatus,omitempty"`
-
- // UserAllocatedNatIpResources: A list of fully qualified URLs of
- // reserved IP address resources.
+ // UserAllocatedNatIpResources: A list of fully qualified URLs of reserved IP
+ // address resources.
UserAllocatedNatIpResources []string `json:"userAllocatedNatIpResources,omitempty"`
-
- // UserAllocatedNatIps: A list of IPs user-allocated for NAT. They will
- // be raw IP strings like "179.12.26.133".
+ // UserAllocatedNatIps: A list of IPs user-allocated for NAT. They will be raw
+ // IP strings like "179.12.26.133".
UserAllocatedNatIps []string `json:"userAllocatedNatIps,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "AutoAllocatedNatIps")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "AutoAllocatedNatIps") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "AutoAllocatedNatIps") 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. "AutoAllocatedNatIps") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RouterStatusNatStatus) MarshalJSON() ([]byte, error) {
+func (s RouterStatusNatStatus) MarshalJSON() ([]byte, error) {
type NoMethod RouterStatusNatStatus
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// RouterStatusNatStatusNatRuleStatus: Status of a NAT Rule contained in
-// this NAT.
+// RouterStatusNatStatusNatRuleStatus: Status of a NAT Rule contained in this
+// NAT.
type RouterStatusNatStatusNatRuleStatus struct {
// ActiveNatIps: A list of active IPs for NAT. Example: ["1.1.1.1",
// "179.12.26.133"].
ActiveNatIps []string `json:"activeNatIps,omitempty"`
-
// DrainNatIps: A list of IPs for NAT that are in drain mode. Example:
// ["1.1.1.1", "179.12.26.133"].
DrainNatIps []string `json:"drainNatIps,omitempty"`
-
- // MinExtraIpsNeeded: The number of extra IPs to allocate. This will be
- // greater than 0 only if the existing IPs in this NAT Rule are NOT
- // enough to allow all configured VMs to use NAT.
+ // MinExtraIpsNeeded: The number of extra IPs to allocate. This will be greater
+ // than 0 only if the existing IPs in this NAT Rule are NOT enough to allow all
+ // configured VMs to use NAT.
MinExtraIpsNeeded int64 `json:"minExtraIpsNeeded,omitempty"`
-
- // NumVmEndpointsWithNatMappings: Number of VM endpoints (i.e., NICs)
- // that have NAT Mappings from this NAT Rule.
+ // NumVmEndpointsWithNatMappings: Number of VM endpoints (i.e., NICs) that have
+ // NAT Mappings from this NAT Rule.
NumVmEndpointsWithNatMappings int64 `json:"numVmEndpointsWithNatMappings,omitempty"`
-
// RuleNumber: Rule number of the rule.
RuleNumber int64 `json:"ruleNumber,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "ActiveNatIps") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "ActiveNatIps") 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. "ActiveNatIps") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RouterStatusNatStatusNatRuleStatus) MarshalJSON() ([]byte, error) {
+func (s RouterStatusNatStatusNatRuleStatus) MarshalJSON() ([]byte, error) {
type NoMethod RouterStatusNatStatusNatRuleStatus
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RouterStatusResponse struct {
// Kind: Type of resource.
- Kind string `json:"kind,omitempty"`
-
+ Kind string `json:"kind,omitempty"`
Result *RouterStatus `json:"result,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Kind") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Kind") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
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 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. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RouterStatusResponse) MarshalJSON() ([]byte, error) {
+func (s RouterStatusResponse) MarshalJSON() ([]byte, error) {
type NoMethod RouterStatusResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RoutersPreviewResponse struct {
// Resource: Preview of given router.
Resource *Router `json:"resource,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
// ForceSendFields is a list of field names (e.g. "Resource") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Resource") 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. "Resource") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RoutersPreviewResponse) MarshalJSON() ([]byte, error) {
+func (s RoutersPreviewResponse) MarshalJSON() ([]byte, error) {
type NoMethod RoutersPreviewResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RoutersScopedList struct {
// Routers: A list of routers contained in this scope.
Routers []*Router `json:"routers,omitempty"`
-
- // Warning: Informational warning which replaces the list of routers
- // when the list is empty.
+ // Warning: Informational warning which replaces the list of routers when the
+ // list is empty.
Warning *RoutersScopedListWarning `json:"warning,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Routers") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Routers") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Routers") 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. "Routers") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RoutersScopedList) MarshalJSON() ([]byte, error) {
+func (s RoutersScopedList) MarshalJSON() ([]byte, error) {
type NoMethod RoutersScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// RoutersScopedListWarning: Informational warning which replaces the
-// list of routers when the list is empty.
+// RoutersScopedListWarning: Informational warning which replaces the list of
+// routers when the list is empty.
type RoutersScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*RoutersScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RoutersScopedListWarning) MarshalJSON() ([]byte, error) {
+func (s RoutersScopedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod RoutersScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type RoutersScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *RoutersScopedListWarningData) MarshalJSON() ([]byte, error) {
+func (s RoutersScopedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod RoutersScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// Rule: This is deprecated and has no effect. Do not use.
-type Rule struct {
- // Action: This is deprecated and has no effect. Do not use.
- //
- // Possible values:
- // "ALLOW" - This is deprecated and has no effect. Do not use.
- // "ALLOW_WITH_LOG" - This is deprecated and has no effect. Do not
- // use.
- // "DENY" - This is deprecated and has no effect. Do not use.
- // "DENY_WITH_LOG" - This is deprecated and has no effect. Do not use.
- // "LOG" - This is deprecated and has no effect. Do not use.
- // "NO_ACTION" - This is deprecated and has no effect. Do not use.
- Action string `json:"action,omitempty"`
-
- // Conditions: This is deprecated and has no effect. Do not use.
- Conditions []*Condition `json:"conditions,omitempty"`
-
- // Description: This is deprecated and has no effect. Do not use.
- Description string `json:"description,omitempty"`
-
- // Ins: This is deprecated and has no effect. Do not use.
- Ins []string `json:"ins,omitempty"`
-
- // LogConfigs: This is deprecated and has no effect. Do not use.
- LogConfigs []*LogConfig `json:"logConfigs,omitempty"`
-
- // NotIns: This is deprecated and has no effect. Do not use.
- NotIns []string `json:"notIns,omitempty"`
-
- // Permissions: This is deprecated and has no effect. Do not use.
- Permissions []string `json:"permissions,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Action") to
- // unconditionally include in API requests. By default, fields with
- // empty or default values are omitted from API requests. However, any
- // non-pointer, non-interface field appearing in ForceSendFields will be
- // sent to the server regardless of whether the field is empty or not.
- // This may be used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Action") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
-}
-
-func (s *Rule) MarshalJSON() ([]byte, error) {
- type NoMethod Rule
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SSLHealthCheck struct {
- // Port: The TCP port number to which the health check prober sends
- // packets. The default value is 443. Valid values are 1 through 65535.
+ // Port: The TCP port number to which the health check prober sends packets.
+ // The default value is 443. Valid values are 1 through 65535.
Port int64 `json:"port,omitempty"`
-
// PortName: Not supported.
PortName string `json:"portName,omitempty"`
-
- // PortSpecification: Specifies how a port is selected for health
- // checking. Can be one of the following values: USE_FIXED_PORT:
- // Specifies a port number explicitly using the port field in the health
- // check. Supported by backend services for passthrough load balancers
- // and backend services for proxy load balancers. Not supported by
- // target pools. The health check supports all backends supported by the
- // backend service provided the backend can be health checked. For
- // example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT network
- // endpoint groups, and instance group backends. USE_NAMED_PORT: Not
- // supported. USE_SERVING_PORT: Provides an indirect method of
- // specifying the health check port by referring to the backend service.
- // Only supported by backend services for proxy load balancers. Not
- // supported by target pools. Not supported by backend services for
- // passthrough load balancers. Supports all backends that can be health
- // checked; for example, GCE_VM_IP_PORT network endpoint groups and
- // instance group backends. For GCE_VM_IP_PORT network endpoint group
- // backends, the health check uses the port number specified for each
- // endpoint in the network endpoint group. For instance group backends,
- // the health check uses the port number determined by looking up the
- // backend service's named port in the instance group's list of named
- // ports.
- //
- // Possible values:
- // "USE_FIXED_PORT" - The port number in the health check's port is
- // used for health checking. Applies to network endpoint group and
- // instance group backends.
+ // PortSpecification: Specifies how a port is selected for health checking. Can
+ // be one of the following values: USE_FIXED_PORT: Specifies a port number
+ // explicitly using the port field in the health check. Supported by backend
+ // services for passthrough load balancers and backend services for proxy load
+ // balancers. Not supported by target pools. The health check supports all
+ // backends supported by the backend service provided the backend can be health
+ // checked. For example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT
+ // network endpoint groups, and instance group backends. USE_NAMED_PORT: Not
+ // supported. USE_SERVING_PORT: Provides an indirect method of specifying the
+ // health check port by referring to the backend service. Only supported by
+ // backend services for proxy load balancers. Not supported by target pools.
+ // Not supported by backend services for passthrough load balancers. Supports
+ // all backends that can be health checked; for example, GCE_VM_IP_PORT network
+ // endpoint groups and instance group backends. For GCE_VM_IP_PORT network
+ // endpoint group backends, the health check uses the port number specified for
+ // each endpoint in the network endpoint group. For instance group backends,
+ // the health check uses the port number determined by looking up the backend
+ // service's named port in the instance group's list of named ports.
+ //
+ // Possible values:
+ // "USE_FIXED_PORT" - The port number in the health check's port is used for
+ // health checking. Applies to network endpoint group and instance group
+ // backends.
// "USE_NAMED_PORT" - Not supported.
- // "USE_SERVING_PORT" - For network endpoint group backends, the
- // health check uses the port number specified on each endpoint in the
- // network endpoint group. For instance group backends, the health check
- // uses the port number specified for the backend service's named port
- // defined in the instance group's named ports.
+ // "USE_SERVING_PORT" - For network endpoint group backends, the health check
+ // uses the port number specified on each endpoint in the network endpoint
+ // group. For instance group backends, the health check uses the port number
+ // specified for the backend service's named port defined in the instance
+ // group's named ports.
PortSpecification string `json:"portSpecification,omitempty"`
-
- // ProxyHeader: Specifies the type of proxy header to append before
- // sending data to the backend, either NONE or PROXY_V1. The default is
- // NONE.
+ // ProxyHeader: Specifies the type of proxy header to append before sending
+ // data to the backend, either NONE or PROXY_V1. The default is NONE.
//
// Possible values:
// "NONE"
// "PROXY_V1"
ProxyHeader string `json:"proxyHeader,omitempty"`
-
- // Request: Instructs the health check prober to send this exact ASCII
- // string, up to 1024 bytes in length, after establishing the TCP
- // connection and SSL handshake.
+ // Request: Instructs the health check prober to send this exact ASCII string,
+ // up to 1024 bytes in length, after establishing the TCP connection and SSL
+ // handshake.
Request string `json:"request,omitempty"`
-
// Response: Creates a content-based SSL health check. In addition to
- // establishing a TCP connection and the TLS handshake, you can
- // configure the health check to pass only when the backend sends this
- // exact response ASCII string, up to 1024 bytes in length. For details,
- // see:
+ // establishing a TCP connection and the TLS handshake, you can configure the
+ // health check to pass only when the backend sends this exact response ASCII
+ // string, up to 1024 bytes in length. For details, see:
// https://cloud.google.com/load-balancing/docs/health-check-concepts#criteria-protocol-ssl-tcp
Response string `json:"response,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Port") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Port") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Port") 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. "Port") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SSLHealthCheck) MarshalJSON() ([]byte, error) {
+func (s SSLHealthCheck) MarshalJSON() ([]byte, error) {
type NoMethod SSLHealthCheck
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// SavedAttachedDisk: DEPRECATED: Please use compute#savedDisk instead.
-// An instance-attached disk resource.
+// SavedAttachedDisk: DEPRECATED: Please use compute#savedDisk instead. An
+// instance-attached disk resource.
type SavedAttachedDisk struct {
// AutoDelete: Specifies whether the disk will be auto-deleted when the
- // instance is deleted (but not when the disk is detached from the
- // instance).
+ // instance is deleted (but not when the disk is detached from the instance).
AutoDelete bool `json:"autoDelete,omitempty"`
-
- // Boot: Indicates that this is a boot disk. The virtual machine will
- // use the first partition of the disk for its root filesystem.
+ // Boot: Indicates that this is a boot disk. The virtual machine will use the
+ // first partition of the disk for its root filesystem.
Boot bool `json:"boot,omitempty"`
-
- // DeviceName: Specifies the name of the disk attached to the source
- // instance.
+ // DeviceName: Specifies the name of the disk attached to the source instance.
DeviceName string `json:"deviceName,omitempty"`
-
// DiskEncryptionKey: The encryption key for the disk.
DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
-
// DiskSizeGb: The size of the disk in base-2 GB.
DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
-
// DiskType: [Output Only] URL of the disk type resource. For example:
// projects/project /zones/zone/diskTypes/pd-standard or pd-ssd
DiskType string `json:"diskType,omitempty"`
-
- // GuestOsFeatures: A list of features to enable on the guest operating
- // system. Applicable only for bootable images. Read Enabling guest
- // operating system features to see a list of available options.
+ // GuestOsFeatures: A list of features to enable on the guest operating system.
+ // Applicable only for bootable images. Read Enabling guest operating system
+ // features to see a list of available options.
GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
-
- // Index: Specifies zero-based index of the disk that is attached to the
- // source instance.
+ // Index: Specifies zero-based index of the disk that is attached to the source
+ // instance.
Index int64 `json:"index,omitempty"`
-
- // Interface: Specifies the disk interface to use for attaching this
- // disk, which is either SCSI or NVME.
+ // Interface: Specifies the disk interface to use for attaching this disk,
+ // which is either SCSI or NVME.
//
// Possible values:
// "NVME"
// "SCSI"
Interface string `json:"interface,omitempty"`
-
- // Kind: [Output Only] Type of the resource. Always compute#attachedDisk
- // for attached disks.
+ // Kind: [Output Only] Type of the resource. Always compute#attachedDisk for
+ // attached disks.
Kind string `json:"kind,omitempty"`
-
// Licenses: [Output Only] Any valid publicly visible licenses.
Licenses []string `json:"licenses,omitempty"`
-
- // Mode: The mode in which this disk is attached to the source instance,
- // either READ_WRITE or READ_ONLY.
+ // Mode: The mode in which this disk is attached to the source instance, either
+ // READ_WRITE or READ_ONLY.
//
// Possible values:
- // "READ_ONLY" - Attaches this disk in read-only mode. Multiple
- // virtual machines can use a disk in read-only mode at a time.
- // "READ_WRITE" - *[Default]* Attaches this disk in read-write mode.
- // Only one virtual machine at a time can be attached to a disk in
- // read-write mode.
+ // "READ_ONLY" - Attaches this disk in read-only mode. Multiple virtual
+ // machines can use a disk in read-only mode at a time.
+ // "READ_WRITE" - *[Default]* Attaches this disk in read-write mode. Only one
+ // virtual machine at a time can be attached to a disk in read-write mode.
Mode string `json:"mode,omitempty"`
-
// Source: Specifies a URL of the disk attached to the source instance.
Source string `json:"source,omitempty"`
-
// StorageBytes: [Output Only] A size of the storage used by the disk's
// snapshot by this machine image.
StorageBytes int64 `json:"storageBytes,omitempty,string"`
-
- // StorageBytesStatus: [Output Only] An indicator whether storageBytes
- // is in a stable state or it is being adjusted as a result of shared
- // storage reallocation. This status can either be UPDATING, meaning the
- // size of the snapshot is being updated, or UP_TO_DATE, meaning the
- // size of the snapshot is up-to-date.
+ // StorageBytesStatus: [Output Only] An indicator whether storageBytes is in a
+ // stable state or it is being adjusted as a result of shared storage
+ // reallocation. This status can either be UPDATING, meaning the size of the
+ // snapshot is being updated, or UP_TO_DATE, meaning the size of the snapshot
+ // is up-to-date.
//
// Possible values:
// "UPDATING"
// "UP_TO_DATE"
StorageBytesStatus string `json:"storageBytesStatus,omitempty"`
-
- // Type: Specifies the type of the attached disk, either SCRATCH or
- // PERSISTENT.
+ // Type: Specifies the type of the attached disk, either SCRATCH or PERSISTENT.
//
// Possible values:
// "PERSISTENT"
// "SCRATCH"
Type string `json:"type,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "AutoDelete") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "AutoDelete") 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. "AutoDelete") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SavedAttachedDisk) MarshalJSON() ([]byte, error) {
+func (s SavedAttachedDisk) MarshalJSON() ([]byte, error) {
type NoMethod SavedAttachedDisk
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// SavedDisk: An instance-attached disk resource.
@@ -46673,167 +39326,147 @@ type SavedDisk struct {
// Architecture: [Output Only] The architecture of the attached disk.
//
// Possible values:
- // "ARCHITECTURE_UNSPECIFIED" - Default value indicating Architecture
- // is not set.
+ // "ARCHITECTURE_UNSPECIFIED" - Default value indicating Architecture is not
+ // set.
// "ARM64" - Machines with architecture ARM64
// "X86_64" - Machines with architecture X86_64
Architecture string `json:"architecture,omitempty"`
-
- // Kind: [Output Only] Type of the resource. Always compute#savedDisk
- // for attached disks.
+ // Kind: [Output Only] Type of the resource. Always compute#savedDisk for
+ // attached disks.
Kind string `json:"kind,omitempty"`
-
- // SourceDisk: Specifies a URL of the disk attached to the source
- // instance.
+ // SourceDisk: Specifies a URL of the disk attached to the source instance.
SourceDisk string `json:"sourceDisk,omitempty"`
-
- // StorageBytes: [Output Only] Size of the individual disk snapshot used
- // by this machine image.
+ // StorageBytes: [Output Only] Size of the individual disk snapshot used by
+ // this machine image.
StorageBytes int64 `json:"storageBytes,omitempty,string"`
-
- // StorageBytesStatus: [Output Only] An indicator whether storageBytes
- // is in a stable state or it is being adjusted as a result of shared
- // storage reallocation. This status can either be UPDATING, meaning the
- // size of the snapshot is being updated, or UP_TO_DATE, meaning the
- // size of the snapshot is up-to-date.
+ // StorageBytesStatus: [Output Only] An indicator whether storageBytes is in a
+ // stable state or it is being adjusted as a result of shared storage
+ // reallocation. This status can either be UPDATING, meaning the size of the
+ // snapshot is being updated, or UP_TO_DATE, meaning the size of the snapshot
+ // is up-to-date.
//
// Possible values:
// "UPDATING"
// "UP_TO_DATE"
StorageBytesStatus string `json:"storageBytesStatus,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Architecture") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Architecture") 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. "Architecture") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SavedDisk) MarshalJSON() ([]byte, error) {
+func (s SavedDisk) MarshalJSON() ([]byte, error) {
type NoMethod SavedDisk
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ScalingScheduleStatus struct {
- // LastStartTime: [Output Only] The last time the scaling schedule
- // became active. Note: this is a timestamp when a schedule actually
- // became active, not when it was planned to do so. The timestamp is in
- // RFC3339 text format.
+ // LastStartTime: [Output Only] The last time the scaling schedule became
+ // active. Note: this is a timestamp when a schedule actually became active,
+ // not when it was planned to do so. The timestamp is in RFC3339 text format.
LastStartTime string `json:"lastStartTime,omitempty"`
-
- // NextStartTime: [Output Only] The next time the scaling schedule is to
- // become active. Note: this is a timestamp when a schedule is planned
- // to run, but the actual time might be slightly different. The
- // timestamp is in RFC3339 text format.
+ // NextStartTime: [Output Only] The next time the scaling schedule is to become
+ // active. Note: this is a timestamp when a schedule is planned to run, but the
+ // actual time might be slightly different. The timestamp is in RFC3339 text
+ // format.
NextStartTime string `json:"nextStartTime,omitempty"`
-
// State: [Output Only] The current state of a scaling schedule.
//
// Possible values:
- // "ACTIVE" - The current autoscaling recommendation is influenced by
- // this scaling schedule.
+ // "ACTIVE" - The current autoscaling recommendation is influenced by this
+ // scaling schedule.
// "DISABLED" - This scaling schedule has been disabled by the user.
// "OBSOLETE" - This scaling schedule will never become active again.
- // "READY" - The current autoscaling recommendation is not influenced
- // by this scaling schedule.
+ // "READY" - The current autoscaling recommendation is not influenced by this
+ // scaling schedule.
State string `json:"state,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "LastStartTime") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "LastStartTime") 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. "LastStartTime") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ScalingScheduleStatus) MarshalJSON() ([]byte, error) {
+func (s ScalingScheduleStatus) MarshalJSON() ([]byte, error) {
type NoMethod ScalingScheduleStatus
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// Scheduling: Sets the scheduling options for an Instance.
type Scheduling struct {
- // AutomaticRestart: Specifies whether the instance should be
- // automatically restarted if it is terminated by Compute Engine (not
- // terminated by a user). You can only set the automatic restart option
- // for standard instances. Preemptible instances cannot be automatically
- // restarted. By default, this is set to true so an instance is
- // automatically restarted if it is terminated by Compute Engine.
+ // AutomaticRestart: Specifies whether the instance should be automatically
+ // restarted if it is terminated by Compute Engine (not terminated by a user).
+ // You can only set the automatic restart option for standard instances.
+ // Preemptible instances cannot be automatically restarted. By default, this is
+ // set to true so an instance is automatically restarted if it is terminated by
+ // Compute Engine.
AutomaticRestart *bool `json:"automaticRestart,omitempty"`
-
+ // AvailabilityDomain: Specifies the availability domain to place the instance
+ // in. The value must be a number between 1 and the number of availability
+ // domains specified in the spread placement policy attached to the instance.
+ AvailabilityDomain int64 `json:"availabilityDomain,omitempty"`
// InstanceTerminationAction: Specifies the termination action for the
// instance.
//
// Possible values:
// "DELETE" - Delete the VM.
- // "INSTANCE_TERMINATION_ACTION_UNSPECIFIED" - Default value. This
- // value is unused.
- // "STOP" - Stop the VM without storing in-memory content. default
- // action.
+ // "INSTANCE_TERMINATION_ACTION_UNSPECIFIED" - Default value. This value is
+ // unused.
+ // "STOP" - Stop the VM without storing in-memory content. default action.
InstanceTerminationAction string `json:"instanceTerminationAction,omitempty"`
-
- // LocalSsdRecoveryTimeout: Specifies the maximum amount of time a Local
- // Ssd Vm should wait while recovery of the Local Ssd state is
- // attempted. Its value should be in between 0 and 168 hours with hour
- // granularity and the default value being 1 hour.
+ // LocalSsdRecoveryTimeout: Specifies the maximum amount of time a Local Ssd Vm
+ // should wait while recovery of the Local Ssd state is attempted. Its value
+ // should be in between 0 and 168 hours with hour granularity and the default
+ // value being 1 hour.
LocalSsdRecoveryTimeout *Duration `json:"localSsdRecoveryTimeout,omitempty"`
-
- // LocationHint: An opaque location hint used to place the instance
- // close to other resources. This field is for use by internal tools
- // that use the public API.
+ // LocationHint: An opaque location hint used to place the instance close to
+ // other resources. This field is for use by internal tools that use the public
+ // API.
LocationHint string `json:"locationHint,omitempty"`
-
- // MinNodeCpus: The minimum number of virtual CPUs this instance will
- // consume when running on a sole-tenant node.
+ // MaxRunDuration: Specifies the max run duration for the given instance. If
+ // specified, the instance termination action will be performed at the end of
+ // the run duration.
+ MaxRunDuration *Duration `json:"maxRunDuration,omitempty"`
+ // MinNodeCpus: The minimum number of virtual CPUs this instance will consume
+ // when running on a sole-tenant node.
MinNodeCpus int64 `json:"minNodeCpus,omitempty"`
-
- // NodeAffinities: A set of node affinity and anti-affinity
- // configurations. Refer to Configuring node affinity for more
- // information. Overrides reservationAffinity.
+ // NodeAffinities: A set of node affinity and anti-affinity configurations.
+ // Refer to Configuring node affinity for more information. Overrides
+ // reservationAffinity.
NodeAffinities []*SchedulingNodeAffinity `json:"nodeAffinities,omitempty"`
-
- // OnHostMaintenance: Defines the maintenance behavior for this
- // instance. For standard instances, the default behavior is MIGRATE.
- // For preemptible instances, the default and only possible behavior is
- // TERMINATE. For more information, see Set VM host maintenance policy.
- //
- // Possible values:
- // "MIGRATE" - *[Default]* Allows Compute Engine to automatically
- // migrate instances out of the way of maintenance events.
- // "TERMINATE" - Tells Compute Engine to terminate and (optionally)
- // restart the instance away from the maintenance activity. If you would
- // like your instance to be restarted, set the automaticRestart flag to
- // true. Your instance may be restarted more than once, and it may be
- // restarted outside the window of maintenance events.
- OnHostMaintenance string `json:"onHostMaintenance,omitempty"`
-
- // Preemptible: Defines whether the instance is preemptible. This can
- // only be set during instance creation or while the instance is stopped
- // and therefore, in a `TERMINATED` state. See Instance Life Cycle for
- // more information on the possible instance states.
+ // OnHostMaintenance: Defines the maintenance behavior for this instance. For
+ // standard instances, the default behavior is MIGRATE. For preemptible
+ // instances, the default and only possible behavior is TERMINATE. For more
+ // information, see Set VM host maintenance policy.
+ //
+ // Possible values:
+ // "MIGRATE" - *[Default]* Allows Compute Engine to automatically migrate
+ // instances out of the way of maintenance events.
+ // "TERMINATE" - Tells Compute Engine to terminate and (optionally) restart
+ // the instance away from the maintenance activity. If you would like your
+ // instance to be restarted, set the automaticRestart flag to true. Your
+ // instance may be restarted more than once, and it may be restarted outside
+ // the window of maintenance events.
+ OnHostMaintenance string `json:"onHostMaintenance,omitempty"`
+ OnInstanceStopAction *SchedulingOnInstanceStopAction `json:"onInstanceStopAction,omitempty"`
+ // Preemptible: Defines whether the instance is preemptible. This can only be
+ // set during instance creation or while the instance is stopped and therefore,
+ // in a `TERMINATED` state. See Instance Life Cycle for more information on the
+ // possible instance states.
Preemptible bool `json:"preemptible,omitempty"`
-
// ProvisioningModel: Specifies the provisioning model of the instance.
//
// Possible values:
@@ -46841,788 +39474,652 @@ type Scheduling struct {
// "STANDARD" - Standard provisioning with user controlled runtime, no
// discounts.
ProvisioningModel string `json:"provisioningModel,omitempty"`
-
+ // TerminationTime: Specifies the timestamp, when the instance will be
+ // terminated, in RFC3339 text format. If specified, the instance termination
+ // action will be performed at the termination time.
+ TerminationTime string `json:"terminationTime,omitempty"`
// ForceSendFields is a list of field names (e.g. "AutomaticRestart") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "AutomaticRestart") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "AutomaticRestart") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *Scheduling) MarshalJSON() ([]byte, error) {
+func (s Scheduling) MarshalJSON() ([]byte, error) {
type NoMethod Scheduling
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// SchedulingNodeAffinity: Node Affinity: the configuration of desired
-// nodes onto which this Instance could be scheduled.
+// SchedulingNodeAffinity: Node Affinity: the configuration of desired nodes
+// onto which this Instance could be scheduled.
type SchedulingNodeAffinity struct {
// Key: Corresponds to the label key of Node resource.
Key string `json:"key,omitempty"`
-
- // Operator: Defines the operation of node selection. Valid operators
- // are IN for affinity and NOT_IN for anti-affinity.
+ // Operator: Defines the operation of node selection. Valid operators are IN
+ // for affinity and NOT_IN for anti-affinity.
//
// Possible values:
// "IN" - Requires Compute Engine to seek for matched nodes.
// "NOT_IN" - Requires Compute Engine to avoid certain nodes.
// "OPERATOR_UNSPECIFIED"
Operator string `json:"operator,omitempty"`
-
// Values: Corresponds to the label values of Node resource.
Values []string `json:"values,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SchedulingNodeAffinity) MarshalJSON() ([]byte, error) {
+func (s SchedulingNodeAffinity) MarshalJSON() ([]byte, error) {
type NoMethod SchedulingNodeAffinity
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+// SchedulingOnInstanceStopAction: Defines the behaviour for instances with the
+// instance_termination_action STOP.
+type SchedulingOnInstanceStopAction struct {
+ // DiscardLocalSsd: If true, the contents of any attached Local SSD disks will
+ // be discarded else, the Local SSD data will be preserved when the instance is
+ // stopped at the end of the run duration/termination time.
+ DiscardLocalSsd bool `json:"discardLocalSsd,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "DiscardLocalSsd") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "DiscardLocalSsd") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s SchedulingOnInstanceStopAction) MarshalJSON() ([]byte, error) {
+ type NoMethod SchedulingOnInstanceStopAction
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// Screenshot: An instance's screenshot.
type Screenshot struct {
// Contents: [Output Only] The Base64-encoded screenshot data.
Contents string `json:"contents,omitempty"`
-
- // Kind: [Output Only] Type of the resource. Always compute#screenshot
- // for the screenshots.
+ // Kind: [Output Only] Type of the resource. Always compute#screenshot for the
+ // screenshots.
Kind string `json:"kind,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
// ForceSendFields is a list of field names (e.g. "Contents") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Contents") 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. "Contents") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *Screenshot) MarshalJSON() ([]byte, error) {
+func (s Screenshot) MarshalJSON() ([]byte, error) {
type NoMethod Screenshot
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SecurityPoliciesAggregatedList struct {
Etag string `json:"etag,omitempty"`
-
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of SecurityPoliciesScopedList resources.
Items map[string]SecurityPoliciesScopedList `json:"items,omitempty"`
-
// Kind: [Output Only] Type of resource. Always
// compute#securityPolicyAggregatedList for lists of Security Policies.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Unreachables: [Output Only] Unreachable resources.
Unreachables []string `json:"unreachables,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *SecurityPoliciesAggregatedListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Etag") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Etag") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Etag") 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. "Etag") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SecurityPoliciesAggregatedList) MarshalJSON() ([]byte, error) {
+func (s SecurityPoliciesAggregatedList) MarshalJSON() ([]byte, error) {
type NoMethod SecurityPoliciesAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// SecurityPoliciesAggregatedListWarning: [Output Only] Informational
-// warning message.
+// SecurityPoliciesAggregatedListWarning: [Output Only] Informational warning
+// message.
type SecurityPoliciesAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*SecurityPoliciesAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SecurityPoliciesAggregatedListWarning) MarshalJSON() ([]byte, error) {
+func (s SecurityPoliciesAggregatedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod SecurityPoliciesAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SecurityPoliciesAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SecurityPoliciesAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+func (s SecurityPoliciesAggregatedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod SecurityPoliciesAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SecurityPoliciesListPreconfiguredExpressionSetsResponse struct {
PreconfiguredExpressionSets *SecurityPoliciesWafConfig `json:"preconfiguredExpressionSets,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
// ForceSendFields is a list of field names (e.g.
- // "PreconfiguredExpressionSets") to unconditionally include in API
- // requests. By default, fields with empty or default 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.
+ // "PreconfiguredExpressionSets") to unconditionally include in API requests.
+ // By default, fields with empty or default values are omitted from API
+ // requests. See https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields
+ // for more details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g.
- // "PreconfiguredExpressionSets") 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. "PreconfiguredExpressionSets") to
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SecurityPoliciesListPreconfiguredExpressionSetsResponse) MarshalJSON() ([]byte, error) {
+func (s SecurityPoliciesListPreconfiguredExpressionSetsResponse) MarshalJSON() ([]byte, error) {
type NoMethod SecurityPoliciesListPreconfiguredExpressionSetsResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SecurityPoliciesScopedList struct {
// SecurityPolicies: A list of SecurityPolicies contained in this scope.
SecurityPolicies []*SecurityPolicy `json:"securityPolicies,omitempty"`
-
- // Warning: Informational warning which replaces the list of security
- // policies when the list is empty.
+ // Warning: Informational warning which replaces the list of security policies
+ // when the list is empty.
Warning *SecurityPoliciesScopedListWarning `json:"warning,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "SecurityPolicies") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "SecurityPolicies") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "SecurityPolicies") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SecurityPoliciesScopedList) MarshalJSON() ([]byte, error) {
+func (s SecurityPoliciesScopedList) MarshalJSON() ([]byte, error) {
type NoMethod SecurityPoliciesScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// SecurityPoliciesScopedListWarning: Informational warning which
-// replaces the list of security policies when the list is empty.
+// SecurityPoliciesScopedListWarning: Informational warning which replaces the
+// list of security policies when the list is empty.
type SecurityPoliciesScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*SecurityPoliciesScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SecurityPoliciesScopedListWarning) MarshalJSON() ([]byte, error) {
+func (s SecurityPoliciesScopedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod SecurityPoliciesScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SecurityPoliciesScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SecurityPoliciesScopedListWarningData) MarshalJSON() ([]byte, error) {
+func (s SecurityPoliciesScopedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod SecurityPoliciesScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SecurityPoliciesWafConfig struct {
WafRules *PreconfiguredWafSet `json:"wafRules,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "WafRules") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "WafRules") 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. "WafRules") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SecurityPoliciesWafConfig) MarshalJSON() ([]byte, error) {
+func (s SecurityPoliciesWafConfig) MarshalJSON() ([]byte, error) {
type NoMethod SecurityPoliciesWafConfig
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// SecurityPolicy: Represents a Google Cloud Armor security policy
-// resource. Only external backend services that use load balancers can
-// reference a security policy. For more information, see Google Cloud
-// Armor security policy overview.
+// SecurityPolicy: Represents a Google Cloud Armor security policy resource.
+// Only external backend services that use load balancers can reference a
+// security policy. For more information, see Google Cloud Armor security
+// policy overview.
type SecurityPolicy struct {
AdaptiveProtectionConfig *SecurityPolicyAdaptiveProtectionConfig `json:"adaptiveProtectionConfig,omitempty"`
-
- AdvancedOptionsConfig *SecurityPolicyAdvancedOptionsConfig `json:"advancedOptionsConfig,omitempty"`
-
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
- CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
+ AdvancedOptionsConfig *SecurityPolicyAdvancedOptionsConfig `json:"advancedOptionsConfig,omitempty"`
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
+ CreationTimestamp string `json:"creationTimestamp,omitempty"`
DdosProtectionConfig *SecurityPolicyDdosProtectionConfig `json:"ddosProtectionConfig,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // Fingerprint: Specifies a fingerprint for this resource, which is
- // essentially a hash of the metadata's contents and used for optimistic
- // locking. The fingerprint is initially generated by Compute Engine and
- // changes after every request to modify or update metadata. You must
- // always provide an up-to-date fingerprint hash in order to update or
- // change metadata, otherwise the request will fail with error 412
- // conditionNotMet. To see the latest fingerprint, make get() request to
- // the security policy.
+ // Fingerprint: Specifies a fingerprint for this resource, which is essentially
+ // a hash of the metadata's contents and used for optimistic locking. The
+ // fingerprint is initially generated by Compute Engine and changes after every
+ // request to modify or update metadata. You must always provide an up-to-date
+ // fingerprint hash in order to update or change metadata, otherwise the
+ // request will fail with error 412 conditionNotMet. To see the latest
+ // fingerprint, make get() request to the security policy.
Fingerprint string `json:"fingerprint,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
- // Kind: [Output only] Type of the resource. Always
- // compute#securityPolicyfor security policies
+ // Kind: [Output only] Type of the resource. Always compute#securityPolicyfor
+ // security policies
Kind string `json:"kind,omitempty"`
-
// LabelFingerprint: A fingerprint for the labels being applied to this
- // security policy, which is essentially a hash of the labels set used
- // for optimistic locking. The fingerprint is initially generated by
- // Compute Engine and changes after every request to modify or update
- // labels. You must always provide an up-to-date fingerprint hash in
- // order to update or change labels. To see the latest fingerprint, make
- // get() request to the security policy.
+ // security policy, which is essentially a hash of the labels set used for
+ // optimistic locking. The fingerprint is initially generated by Compute Engine
+ // and changes after every request to modify or update labels. You must always
+ // provide an up-to-date fingerprint hash in order to update or change labels.
+ // To see the latest fingerprint, make get() request to the security policy.
LabelFingerprint string `json:"labelFingerprint,omitempty"`
-
- // Labels: Labels for this resource. These can only be added or modified
- // by the setLabels method. Each label key/value pair must comply with
- // RFC1035. Label values may be empty.
+ // Labels: Labels for this resource. These can only be added or modified by the
+ // setLabels method. Each label key/value pair must comply with RFC1035. Label
+ // values may be empty.
Labels map[string]string `json:"labels,omitempty"`
-
- // Name: Name of the resource. Provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
- // the first character must be a lowercase letter, and all following
- // characters must be a dash, lowercase letter, or digit, except the
- // last character, which cannot be a dash.
- Name string `json:"name,omitempty"`
-
+ // Name: Name of the resource. Provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must
+ // be a lowercase letter, and all following characters must be a dash,
+ // lowercase letter, or digit, except the last character, which cannot be a
+ // dash.
+ Name string `json:"name,omitempty"`
RecaptchaOptionsConfig *SecurityPolicyRecaptchaOptionsConfig `json:"recaptchaOptionsConfig,omitempty"`
-
- // Region: [Output Only] URL of the region where the regional security
- // policy resides. This field is not applicable to global security
- // policies.
+ // Region: [Output Only] URL of the region where the regional security policy
+ // resides. This field is not applicable to global security policies.
Region string `json:"region,omitempty"`
-
- // Rules: A list of rules that belong to this policy. There must always
- // be a default rule which is a rule with priority 2147483647 and match
- // all condition (for the match condition this means match "*" for
- // srcIpRanges and for the networkMatch condition every field must be
- // either match "*" or not set). If no rules are provided when creating
- // a security policy, a default rule with action "allow" will be added.
+ // Rules: A list of rules that belong to this policy. There must always be a
+ // default rule which is a rule with priority 2147483647 and match all
+ // condition (for the match condition this means match "*" for srcIpRanges and
+ // for the networkMatch condition every field must be either match "*" or not
+ // set). If no rules are provided when creating a security policy, a default
+ // rule with action "allow" will be added.
Rules []*SecurityPolicyRule `json:"rules,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Type: The type indicates the intended use of the security policy. -
- // CLOUD_ARMOR: Cloud Armor backend security policies can be configured
- // to filter incoming HTTP requests targeting backend services. They
- // filter requests before they hit the origin servers. -
- // CLOUD_ARMOR_EDGE: Cloud Armor edge security policies can be
- // configured to filter incoming HTTP requests targeting backend
- // services (including Cloud CDN-enabled) as well as backend buckets
- // (Cloud Storage). They filter requests before the request is served
- // from Google's cache. - CLOUD_ARMOR_INTERNAL_SERVICE: Cloud Armor
- // internal service policies can be configured to filter HTTP requests
- // targeting services managed by Traffic Director in a service mesh.
- // They filter requests before the request is served from the
- // application. - CLOUD_ARMOR_NETWORK: Cloud Armor network policies can
- // be configured to filter packets targeting network load balancing
- // resources such as backend services, target pools, target instances,
- // and instances with external IPs. They filter requests before the
- // request is served from the application. This field can be set only at
- // resource creation time.
+ // CLOUD_ARMOR: Cloud Armor backend security policies can be configured to
+ // filter incoming HTTP requests targeting backend services. They filter
+ // requests before they hit the origin servers. - CLOUD_ARMOR_EDGE: Cloud Armor
+ // edge security policies can be configured to filter incoming HTTP requests
+ // targeting backend services (including Cloud CDN-enabled) as well as backend
+ // buckets (Cloud Storage). They filter requests before the request is served
+ // from Google's cache. - CLOUD_ARMOR_INTERNAL_SERVICE: Cloud Armor internal
+ // service policies can be configured to filter HTTP requests targeting
+ // services managed by Traffic Director in a service mesh. They filter requests
+ // before the request is served from the application. - CLOUD_ARMOR_NETWORK:
+ // Cloud Armor network policies can be configured to filter packets targeting
+ // network load balancing resources such as backend services, target pools,
+ // target instances, and instances with external IPs. They filter requests
+ // before the request is served from the application. This field can be set
+ // only at resource creation time.
//
// Possible values:
// "CLOUD_ARMOR"
// "CLOUD_ARMOR_EDGE"
// "CLOUD_ARMOR_NETWORK"
Type string `json:"type,omitempty"`
-
// UserDefinedFields: Definitions of user-defined fields for
- // CLOUD_ARMOR_NETWORK policies. A user-defined field consists of up to
- // 4 bytes extracted from a fixed offset in the packet, relative to the
- // IPv4, IPv6, TCP, or UDP header, with an optional mask to select
- // certain bits. Rules may then specify matching values for these
- // fields. Example: userDefinedFields: - name: "ipv4_fragment_offset"
- // base: IPV4 offset: 6 size: 2 mask: "0x1fff"
+ // CLOUD_ARMOR_NETWORK policies. A user-defined field consists of up to 4 bytes
+ // extracted from a fixed offset in the packet, relative to the IPv4, IPv6,
+ // TCP, or UDP header, with an optional mask to select certain bits. Rules may
+ // then specify matching values for these fields. Example: userDefinedFields: -
+ // name: "ipv4_fragment_offset" base: IPV4 offset: 6 size: 2 mask: "0x1fff"
UserDefinedFields []*SecurityPolicyUserDefinedField `json:"userDefinedFields,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g.
- // "AdaptiveProtectionConfig") to unconditionally include in API
- // requests. By default, fields with empty or default 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. "AdaptiveProtectionConfig")
- // 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.
+ // ForceSendFields is a list of field names (e.g. "AdaptiveProtectionConfig")
+ // to unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "AdaptiveProtectionConfig") to
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SecurityPolicy) MarshalJSON() ([]byte, error) {
+func (s SecurityPolicy) MarshalJSON() ([]byte, error) {
type NoMethod SecurityPolicy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// SecurityPolicyAdaptiveProtectionConfig: Configuration options for
-// Cloud Armor Adaptive Protection (CAAP).
+// SecurityPolicyAdaptiveProtectionConfig: Configuration options for Cloud
+// Armor Adaptive Protection (CAAP).
type SecurityPolicyAdaptiveProtectionConfig struct {
// Layer7DdosDefenseConfig: If set to true, enables Cloud Armor Machine
// Learning.
Layer7DdosDefenseConfig *SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfig `json:"layer7DdosDefenseConfig,omitempty"`
-
- // ForceSendFields is a list of field names (e.g.
- // "Layer7DdosDefenseConfig") to unconditionally include in API
- // requests. By default, fields with empty or default 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. "Layer7DdosDefenseConfig")
- // 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.
+ // ForceSendFields is a list of field names (e.g. "Layer7DdosDefenseConfig") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Layer7DdosDefenseConfig") to
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SecurityPolicyAdaptiveProtectionConfig) MarshalJSON() ([]byte, error) {
+func (s SecurityPolicyAdaptiveProtectionConfig) MarshalJSON() ([]byte, error) {
type NoMethod SecurityPolicyAdaptiveProtectionConfig
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfig:
-// Configuration options for L7 DDoS detection. This field is only
-// supported in Global Security Policies of type CLOUD_ARMOR.
+// SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfig: Configuration
+// options for L7 DDoS detection. This field is only supported in Global
+// Security Policies of type CLOUD_ARMOR.
type SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfig struct {
- // Enable: If set to true, enables CAAP for L7 DDoS detection. This
- // field is only supported in Global Security Policies of type
- // CLOUD_ARMOR.
- Enable bool `json:"enable,omitempty"`
-
- // RuleVisibility: Rule visibility can be one of the following: STANDARD
- // - opaque rules. (default) PREMIUM - transparent rules. This field is
+ // Enable: If set to true, enables CAAP for L7 DDoS detection. This field is
// only supported in Global Security Policies of type CLOUD_ARMOR.
+ Enable bool `json:"enable,omitempty"`
+ // RuleVisibility: Rule visibility can be one of the following: STANDARD -
+ // opaque rules. (default) PREMIUM - transparent rules. This field is only
+ // supported in Global Security Policies of type CLOUD_ARMOR.
//
// Possible values:
// "PREMIUM"
// "STANDARD"
RuleVisibility string `json:"ruleVisibility,omitempty"`
-
- // ThresholdConfigs: Configuration options for layer7 adaptive
- // protection for various customizable thresholds.
+ // ThresholdConfigs: Configuration options for layer7 adaptive protection for
+ // various customizable thresholds.
ThresholdConfigs []*SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfig `json:"thresholdConfigs,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Enable") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Enable") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Enable") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfig) MarshalJSON() ([]byte, error) {
+func (s SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfig) MarshalJSON() ([]byte, error) {
type NoMethod SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfig
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfig struct {
- AutoDeployConfidenceThreshold float64 `json:"autoDeployConfidenceThreshold,omitempty"`
-
- AutoDeployExpirationSec int64 `json:"autoDeployExpirationSec,omitempty"`
-
+ AutoDeployConfidenceThreshold float64 `json:"autoDeployConfidenceThreshold,omitempty"`
+ AutoDeployExpirationSec int64 `json:"autoDeployExpirationSec,omitempty"`
AutoDeployImpactedBaselineThreshold float64 `json:"autoDeployImpactedBaselineThreshold,omitempty"`
-
- AutoDeployLoadThreshold float64 `json:"autoDeployLoadThreshold,omitempty"`
-
- // Name: The name must be 1-63 characters long, and comply with RFC1035.
- // The name must be unique within the security policy.
+ AutoDeployLoadThreshold float64 `json:"autoDeployLoadThreshold,omitempty"`
+ DetectionAbsoluteQps float64 `json:"detectionAbsoluteQps,omitempty"`
+ DetectionLoadThreshold float64 `json:"detectionLoadThreshold,omitempty"`
+ DetectionRelativeToBaselineQps float64 `json:"detectionRelativeToBaselineQps,omitempty"`
+ // Name: The name must be 1-63 characters long, and comply with RFC1035. The
+ // name must be unique within the security policy.
Name string `json:"name,omitempty"`
-
+ // TrafficGranularityConfigs: Configuration options for enabling Adaptive
+ // Protection to operate on specified granular traffic units.
+ TrafficGranularityConfigs []*SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfigTrafficGranularityConfig `json:"trafficGranularityConfigs,omitempty"`
// ForceSendFields is a list of field names (e.g.
- // "AutoDeployConfidenceThreshold") to unconditionally include in API
- // requests. By default, fields with empty or default 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.
+ // "AutoDeployConfidenceThreshold") to unconditionally include in API requests.
+ // By default, fields with empty or default values are omitted from API
+ // requests. See https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields
+ // for more details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g.
- // "AutoDeployConfidenceThreshold") 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. "AutoDeployConfidenceThreshold")
+ // to include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfig) MarshalJSON() ([]byte, error) {
+func (s SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfig) MarshalJSON() ([]byte, error) {
type NoMethod SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfig
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
func (s *SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfig) UnmarshalJSON(data []byte) error {
@@ -47631,6 +40128,9 @@ func (s *SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdC
AutoDeployConfidenceThreshold gensupport.JSONFloat64 `json:"autoDeployConfidenceThreshold"`
AutoDeployImpactedBaselineThreshold gensupport.JSONFloat64 `json:"autoDeployImpactedBaselineThreshold"`
AutoDeployLoadThreshold gensupport.JSONFloat64 `json:"autoDeployLoadThreshold"`
+ DetectionAbsoluteQps gensupport.JSONFloat64 `json:"detectionAbsoluteQps"`
+ DetectionLoadThreshold gensupport.JSONFloat64 `json:"detectionLoadThreshold"`
+ DetectionRelativeToBaselineQps gensupport.JSONFloat64 `json:"detectionRelativeToBaselineQps"`
*NoMethod
}
s1.NoMethod = (*NoMethod)(s)
@@ -47640,83 +40140,104 @@ func (s *SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdC
s.AutoDeployConfidenceThreshold = float64(s1.AutoDeployConfidenceThreshold)
s.AutoDeployImpactedBaselineThreshold = float64(s1.AutoDeployImpactedBaselineThreshold)
s.AutoDeployLoadThreshold = float64(s1.AutoDeployLoadThreshold)
+ s.DetectionAbsoluteQps = float64(s1.DetectionAbsoluteQps)
+ s.DetectionLoadThreshold = float64(s1.DetectionLoadThreshold)
+ s.DetectionRelativeToBaselineQps = float64(s1.DetectionRelativeToBaselineQps)
return nil
}
+// SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfigT
+// rafficGranularityConfig: Configurations to specifc granular traffic units
+// processed by Adaptive Protection.
+type SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfigTrafficGranularityConfig struct {
+ // EnableEachUniqueValue: If enabled, traffic matching each unique value for
+ // the specified type constitutes a separate traffic unit. It can only be set
+ // to true if `value` is empty.
+ EnableEachUniqueValue bool `json:"enableEachUniqueValue,omitempty"`
+ // Type: Type of this configuration.
+ //
+ // Possible values:
+ // "HTTP_HEADER_HOST"
+ // "HTTP_PATH"
+ // "UNSPECIFIED_TYPE"
+ Type string `json:"type,omitempty"`
+ // Value: Requests that match this value constitute a granular traffic unit.
+ Value string `json:"value,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "EnableEachUniqueValue") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "EnableEachUniqueValue") to
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfigTrafficGranularityConfig) MarshalJSON() ([]byte, error) {
+ type NoMethod SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfigTrafficGranularityConfig
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
type SecurityPolicyAdvancedOptionsConfig struct {
- // JsonCustomConfig: Custom configuration to apply the JSON parsing.
- // Only applicable when json_parsing is set to STANDARD.
+ // JsonCustomConfig: Custom configuration to apply the JSON parsing. Only
+ // applicable when json_parsing is set to STANDARD.
JsonCustomConfig *SecurityPolicyAdvancedOptionsConfigJsonCustomConfig `json:"jsonCustomConfig,omitempty"`
-
// Possible values:
// "DISABLED"
// "STANDARD"
// "STANDARD_WITH_GRAPHQL"
JsonParsing string `json:"jsonParsing,omitempty"`
-
// Possible values:
// "NORMAL"
// "VERBOSE"
LogLevel string `json:"logLevel,omitempty"`
-
- // UserIpRequestHeaders: An optional list of case-insensitive request
- // header names to use for resolving the callers client IP address.
+ // UserIpRequestHeaders: An optional list of case-insensitive request header
+ // names to use for resolving the callers client IP address.
UserIpRequestHeaders []string `json:"userIpRequestHeaders,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "JsonCustomConfig") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "JsonCustomConfig") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "JsonCustomConfig") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SecurityPolicyAdvancedOptionsConfig) MarshalJSON() ([]byte, error) {
+func (s SecurityPolicyAdvancedOptionsConfig) MarshalJSON() ([]byte, error) {
type NoMethod SecurityPolicyAdvancedOptionsConfig
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SecurityPolicyAdvancedOptionsConfigJsonCustomConfig struct {
- // ContentTypes: A list of custom Content-Type header values to apply
- // the JSON parsing. As per RFC 1341, a Content-Type header value has
- // the following format: Content-Type := type "/" subtype *[";"
- // parameter] When configuring a custom Content-Type header value, only
- // the type/subtype needs to be specified, and the parameters should be
- // excluded.
+ // ContentTypes: A list of custom Content-Type header values to apply the JSON
+ // parsing. As per RFC 1341, a Content-Type header value has the following
+ // format: Content-Type := type "/" subtype *[";" parameter] When configuring a
+ // custom Content-Type header value, only the type/subtype needs to be
+ // specified, and the parameters should be excluded.
ContentTypes []string `json:"contentTypes,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "ContentTypes") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "ContentTypes") 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. "ContentTypes") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SecurityPolicyAdvancedOptionsConfigJsonCustomConfig) MarshalJSON() ([]byte, error) {
+func (s SecurityPolicyAdvancedOptionsConfigJsonCustomConfig) MarshalJSON() ([]byte, error) {
type NoMethod SecurityPolicyAdvancedOptionsConfigJsonCustomConfig
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SecurityPolicyDdosProtectionConfig struct {
@@ -47724,779 +40245,606 @@ type SecurityPolicyDdosProtectionConfig struct {
// "ADVANCED"
// "STANDARD"
DdosProtection string `json:"ddosProtection,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "DdosProtection") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "DdosProtection") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "DdosProtection") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SecurityPolicyDdosProtectionConfig) MarshalJSON() ([]byte, error) {
+func (s SecurityPolicyDdosProtectionConfig) MarshalJSON() ([]byte, error) {
type NoMethod SecurityPolicyDdosProtectionConfig
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SecurityPolicyList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of SecurityPolicy resources.
Items []*SecurityPolicy `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource. Always
- // compute#securityPolicyList for listsof securityPolicies
+ // Kind: [Output Only] Type of resource. Always compute#securityPolicyList for
+ // listsof securityPolicies
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *SecurityPolicyListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SecurityPolicyList) MarshalJSON() ([]byte, error) {
+func (s SecurityPolicyList) MarshalJSON() ([]byte, error) {
type NoMethod SecurityPolicyList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// SecurityPolicyListWarning: [Output Only] Informational warning
-// message.
+// SecurityPolicyListWarning: [Output Only] Informational warning message.
type SecurityPolicyListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*SecurityPolicyListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SecurityPolicyListWarning) MarshalJSON() ([]byte, error) {
+func (s SecurityPolicyListWarning) MarshalJSON() ([]byte, error) {
type NoMethod SecurityPolicyListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SecurityPolicyListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SecurityPolicyListWarningData) MarshalJSON() ([]byte, error) {
+func (s SecurityPolicyListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod SecurityPolicyListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SecurityPolicyRecaptchaOptionsConfig struct {
- // RedirectSiteKey: An optional field to supply a reCAPTCHA site key to
- // be used for all the rules using the redirect action with the type of
- // GOOGLE_RECAPTCHA under the security policy. The specified site key
- // needs to be created from the reCAPTCHA API. The user is responsible
- // for the validity of the specified site key. If not specified, a
- // Google-managed site key is used. This field is only supported in
- // Global Security Policies of type CLOUD_ARMOR.
+ // RedirectSiteKey: An optional field to supply a reCAPTCHA site key to be used
+ // for all the rules using the redirect action with the type of
+ // GOOGLE_RECAPTCHA under the security policy. The specified site key needs to
+ // be created from the reCAPTCHA API. The user is responsible for the validity
+ // of the specified site key. If not specified, a Google-managed site key is
+ // used. This field is only supported in Global Security Policies of type
+ // CLOUD_ARMOR.
RedirectSiteKey string `json:"redirectSiteKey,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "RedirectSiteKey") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "RedirectSiteKey") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "RedirectSiteKey") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SecurityPolicyRecaptchaOptionsConfig) MarshalJSON() ([]byte, error) {
+func (s SecurityPolicyRecaptchaOptionsConfig) MarshalJSON() ([]byte, error) {
type NoMethod SecurityPolicyRecaptchaOptionsConfig
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SecurityPolicyReference struct {
SecurityPolicy string `json:"securityPolicy,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "SecurityPolicy") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "SecurityPolicy") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "SecurityPolicy") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SecurityPolicyReference) MarshalJSON() ([]byte, error) {
+func (s SecurityPolicyReference) MarshalJSON() ([]byte, error) {
type NoMethod SecurityPolicyReference
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// SecurityPolicyRule: Represents a rule that describes one or more
-// match conditions along with the action to be taken when traffic
-// matches this condition (allow or deny).
+// SecurityPolicyRule: Represents a rule that describes one or more match
+// conditions along with the action to be taken when traffic matches this
+// condition (allow or deny).
type SecurityPolicyRule struct {
- // Action: The Action to perform when the rule is matched. The following
- // are the valid actions: - allow: allow access to target. -
- // deny(STATUS): deny access to target, returns the HTTP response code
- // specified. Valid values for `STATUS` are 403, 404, and 502. -
- // rate_based_ban: limit client traffic to the configured threshold and
- // ban the client if the traffic exceeds the threshold. Configure
- // parameters for this action in RateLimitOptions. Requires
- // rate_limit_options to be set. - redirect: redirect to a different
- // target. This can either be an internal reCAPTCHA redirect, or an
- // external URL-based redirect via a 302 response. Parameters for this
- // action can be configured via redirectOptions. This action is only
- // supported in Global Security Policies of type CLOUD_ARMOR. -
- // throttle: limit client traffic to the configured threshold. Configure
- // parameters for this action in rateLimitOptions. Requires
- // rate_limit_options to be set for this.
+ // Action: The Action to perform when the rule is matched. The following are
+ // the valid actions: - allow: allow access to target. - deny(STATUS): deny
+ // access to target, returns the HTTP response code specified. Valid values for
+ // `STATUS` are 403, 404, and 502. - rate_based_ban: limit client traffic to
+ // the configured threshold and ban the client if the traffic exceeds the
+ // threshold. Configure parameters for this action in RateLimitOptions.
+ // Requires rate_limit_options to be set. - redirect: redirect to a different
+ // target. This can either be an internal reCAPTCHA redirect, or an external
+ // URL-based redirect via a 302 response. Parameters for this action can be
+ // configured via redirectOptions. This action is only supported in Global
+ // Security Policies of type CLOUD_ARMOR. - throttle: limit client traffic to
+ // the configured threshold. Configure parameters for this action in
+ // rateLimitOptions. Requires rate_limit_options to be set for this.
Action string `json:"action,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // HeaderAction: Optional, additional actions that are performed on
- // headers. This field is only supported in Global Security Policies of
- // type CLOUD_ARMOR.
+ // HeaderAction: Optional, additional actions that are performed on headers.
+ // This field is only supported in Global Security Policies of type
+ // CLOUD_ARMOR.
HeaderAction *SecurityPolicyRuleHttpHeaderAction `json:"headerAction,omitempty"`
-
- // Kind: [Output only] Type of the resource. Always
- // compute#securityPolicyRule for security policy rules
+ // Kind: [Output only] Type of the resource. Always compute#securityPolicyRule
+ // for security policy rules
Kind string `json:"kind,omitempty"`
-
- // Match: A match condition that incoming traffic is evaluated against.
- // If it evaluates to true, the corresponding 'action' is enforced.
+ // Match: A match condition that incoming traffic is evaluated against. If it
+ // evaluates to true, the corresponding 'action' is enforced.
Match *SecurityPolicyRuleMatcher `json:"match,omitempty"`
-
- // NetworkMatch: A match condition that incoming packets are evaluated
- // against for CLOUD_ARMOR_NETWORK security policies. If it matches, the
- // corresponding 'action' is enforced. The match criteria for a rule
- // consists of built-in match fields (like 'srcIpRanges') and
- // potentially multiple user-defined match fields ('userDefinedFields').
- // Field values may be extracted directly from the packet or derived
- // from it (e.g. 'srcRegionCodes'). Some fields may not be present in
- // every packet (e.g. 'srcPorts'). A user-defined field is only present
- // if the base header is found in the packet and the entire field is in
- // bounds. Each match field may specify which values can match it,
- // listing one or more ranges, prefixes, or exact values that are
- // considered a match for the field. A field value must be present in
- // order to match a specified match field. If no match values are
- // specified for a match field, then any field value is considered to
- // match it, and it's not required to be present. For strings specifying
- // '*' is also equivalent to match all. For a packet to match a rule,
- // all specified match fields must match the corresponding field values
- // derived from the packet. Example: networkMatch: srcIpRanges: -
- // "192.0.2.0/24" - "198.51.100.0/24" userDefinedFields: - name:
+ // NetworkMatch: A match condition that incoming packets are evaluated against
+ // for CLOUD_ARMOR_NETWORK security policies. If it matches, the corresponding
+ // 'action' is enforced. The match criteria for a rule consists of built-in
+ // match fields (like 'srcIpRanges') and potentially multiple user-defined
+ // match fields ('userDefinedFields'). Field values may be extracted directly
+ // from the packet or derived from it (e.g. 'srcRegionCodes'). Some fields may
+ // not be present in every packet (e.g. 'srcPorts'). A user-defined field is
+ // only present if the base header is found in the packet and the entire field
+ // is in bounds. Each match field may specify which values can match it,
+ // listing one or more ranges, prefixes, or exact values that are considered a
+ // match for the field. A field value must be present in order to match a
+ // specified match field. If no match values are specified for a match field,
+ // then any field value is considered to match it, and it's not required to be
+ // present. For strings specifying '*' is also equivalent to match all. For a
+ // packet to match a rule, all specified match fields must match the
+ // corresponding field values derived from the packet. Example: networkMatch:
+ // srcIpRanges: - "192.0.2.0/24" - "198.51.100.0/24" userDefinedFields: - name:
// "ipv4_fragment_offset" values: - "1-0x1fff" The above match condition
- // matches packets with a source IP in 192.0.2.0/24 or 198.51.100.0/24
- // and a user-defined field named "ipv4_fragment_offset" with a value
- // between 1 and 0x1fff inclusive.
+ // matches packets with a source IP in 192.0.2.0/24 or 198.51.100.0/24 and a
+ // user-defined field named "ipv4_fragment_offset" with a value between 1 and
+ // 0x1fff inclusive.
NetworkMatch *SecurityPolicyRuleNetworkMatcher `json:"networkMatch,omitempty"`
-
- // PreconfiguredWafConfig: Preconfigured WAF configuration to be applied
- // for the rule. If the rule does not evaluate preconfigured WAF rules,
- // i.e., if evaluatePreconfiguredWaf() is not used, this field will have
- // no effect.
+ // PreconfiguredWafConfig: Preconfigured WAF configuration to be applied for
+ // the rule. If the rule does not evaluate preconfigured WAF rules, i.e., if
+ // evaluatePreconfiguredWaf() is not used, this field will have no effect.
PreconfiguredWafConfig *SecurityPolicyRulePreconfiguredWafConfig `json:"preconfiguredWafConfig,omitempty"`
-
// Preview: If set to true, the specified action is not enforced.
Preview bool `json:"preview,omitempty"`
-
- // Priority: An integer indicating the priority of a rule in the list.
- // The priority must be a positive value between 0 and 2147483647. Rules
- // are evaluated from highest to lowest priority where 0 is the highest
- // priority and 2147483647 is the lowest priority.
+ // Priority: An integer indicating the priority of a rule in the list. The
+ // priority must be a positive value between 0 and 2147483647. Rules are
+ // evaluated from highest to lowest priority where 0 is the highest priority
+ // and 2147483647 is the lowest priority.
Priority int64 `json:"priority,omitempty"`
-
- // RateLimitOptions: Must be specified if the action is "rate_based_ban"
- // or "throttle". Cannot be specified for any other actions.
+ // RateLimitOptions: Must be specified if the action is "rate_based_ban" or
+ // "throttle". Cannot be specified for any other actions.
RateLimitOptions *SecurityPolicyRuleRateLimitOptions `json:"rateLimitOptions,omitempty"`
-
// RedirectOptions: Parameters defining the redirect action. Cannot be
- // specified for any other actions. This field is only supported in
- // Global Security Policies of type CLOUD_ARMOR.
+ // specified for any other actions. This field is only supported in Global
+ // Security Policies of type CLOUD_ARMOR.
RedirectOptions *SecurityPolicyRuleRedirectOptions `json:"redirectOptions,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Action") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Action") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Action") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SecurityPolicyRule) MarshalJSON() ([]byte, error) {
+func (s SecurityPolicyRule) MarshalJSON() ([]byte, error) {
type NoMethod SecurityPolicyRule
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SecurityPolicyRuleHttpHeaderAction struct {
- // RequestHeadersToAdds: The list of request headers to add or overwrite
- // if they're already present.
+ // RequestHeadersToAdds: The list of request headers to add or overwrite if
+ // they're already present.
RequestHeadersToAdds []*SecurityPolicyRuleHttpHeaderActionHttpHeaderOption `json:"requestHeadersToAdds,omitempty"`
-
- // ForceSendFields is a list of field names (e.g.
- // "RequestHeadersToAdds") to unconditionally include in API requests.
- // By default, fields with empty or default 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. "RequestHeadersToAdds") 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.
+ // ForceSendFields is a list of field names (e.g. "RequestHeadersToAdds") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "RequestHeadersToAdds") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SecurityPolicyRuleHttpHeaderAction) MarshalJSON() ([]byte, error) {
+func (s SecurityPolicyRuleHttpHeaderAction) MarshalJSON() ([]byte, error) {
type NoMethod SecurityPolicyRuleHttpHeaderAction
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SecurityPolicyRuleHttpHeaderActionHttpHeaderOption struct {
// HeaderName: The name of the header to set.
HeaderName string `json:"headerName,omitempty"`
-
// HeaderValue: The value to set the named header to.
HeaderValue string `json:"headerValue,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "HeaderName") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "HeaderName") 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. "HeaderName") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SecurityPolicyRuleHttpHeaderActionHttpHeaderOption) MarshalJSON() ([]byte, error) {
+func (s SecurityPolicyRuleHttpHeaderActionHttpHeaderOption) MarshalJSON() ([]byte, error) {
type NoMethod SecurityPolicyRuleHttpHeaderActionHttpHeaderOption
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// SecurityPolicyRuleMatcher: Represents a match condition that incoming
// traffic is evaluated against. Exactly one field must be specified.
type SecurityPolicyRuleMatcher struct {
- // Config: The configuration options available when specifying
- // versioned_expr. This field must be specified if versioned_expr is
- // specified and cannot be specified if versioned_expr is not specified.
+ // Config: The configuration options available when specifying versioned_expr.
+ // This field must be specified if versioned_expr is specified and cannot be
+ // specified if versioned_expr is not specified.
Config *SecurityPolicyRuleMatcherConfig `json:"config,omitempty"`
-
- // Expr: User defined CEVAL expression. A CEVAL expression is used to
- // specify match criteria such as origin.ip, source.region_code and
- // contents in the request header. Expressions containing
- // `evaluateThreatIntelligence` require Cloud Armor Managed Protection
- // Plus tier and are not supported in Edge Policies nor in Regional
- // Policies. Expressions containing
- // `evaluatePreconfiguredExpr('sourceiplist-*')` require Cloud Armor
- // Managed Protection Plus tier and are only supported in Global
- // Security Policies.
+ // Expr: User defined CEVAL expression. A CEVAL expression is used to specify
+ // match criteria such as origin.ip, source.region_code and contents in the
+ // request header. Expressions containing `evaluateThreatIntelligence` require
+ // Cloud Armor Managed Protection Plus tier and are not supported in Edge
+ // Policies nor in Regional Policies. Expressions containing
+ // `evaluatePreconfiguredExpr('sourceiplist-*')` require Cloud Armor Managed
+ // Protection Plus tier and are only supported in Global Security Policies.
Expr *Expr `json:"expr,omitempty"`
-
- // ExprOptions: The configuration options available when specifying a
- // user defined CEVAL expression (i.e., 'expr').
+ // ExprOptions: The configuration options available when specifying a user
+ // defined CEVAL expression (i.e., 'expr').
ExprOptions *SecurityPolicyRuleMatcherExprOptions `json:"exprOptions,omitempty"`
-
// VersionedExpr: Preconfigured versioned expression. If this field is
// specified, config must also be specified. Available preconfigured
- // expressions along with their requirements are: SRC_IPS_V1 - must
- // specify the corresponding src_ip_range field in config.
+ // expressions along with their requirements are: SRC_IPS_V1 - must specify the
+ // corresponding src_ip_range field in config.
//
// Possible values:
- // "SRC_IPS_V1" - Matches the source IP address of a request to the IP
- // ranges supplied in config.
+ // "SRC_IPS_V1" - Matches the source IP address of a request to the IP ranges
+ // supplied in config.
VersionedExpr string `json:"versionedExpr,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Config") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Config") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Config") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SecurityPolicyRuleMatcher) MarshalJSON() ([]byte, error) {
+func (s SecurityPolicyRuleMatcher) MarshalJSON() ([]byte, error) {
type NoMethod SecurityPolicyRuleMatcher
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SecurityPolicyRuleMatcherConfig struct {
- // SrcIpRanges: CIDR IP address range. Maximum number of src_ip_ranges
- // allowed is 10.
+ // SrcIpRanges: CIDR IP address range. Maximum number of src_ip_ranges allowed
+ // is 10.
SrcIpRanges []string `json:"srcIpRanges,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "SrcIpRanges") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "SrcIpRanges") 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. "SrcIpRanges") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SecurityPolicyRuleMatcherConfig) MarshalJSON() ([]byte, error) {
+func (s SecurityPolicyRuleMatcherConfig) MarshalJSON() ([]byte, error) {
type NoMethod SecurityPolicyRuleMatcherConfig
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SecurityPolicyRuleMatcherExprOptions struct {
- // RecaptchaOptions: reCAPTCHA configuration options to be applied for
- // the rule. If the rule does not evaluate reCAPTCHA tokens, this field
- // has no effect.
+ // RecaptchaOptions: reCAPTCHA configuration options to be applied for the
+ // rule. If the rule does not evaluate reCAPTCHA tokens, this field has no
+ // effect.
RecaptchaOptions *SecurityPolicyRuleMatcherExprOptionsRecaptchaOptions `json:"recaptchaOptions,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "RecaptchaOptions") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "RecaptchaOptions") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "RecaptchaOptions") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SecurityPolicyRuleMatcherExprOptions) MarshalJSON() ([]byte, error) {
+func (s SecurityPolicyRuleMatcherExprOptions) MarshalJSON() ([]byte, error) {
type NoMethod SecurityPolicyRuleMatcherExprOptions
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SecurityPolicyRuleMatcherExprOptionsRecaptchaOptions struct {
- // ActionTokenSiteKeys: A list of site keys to be used during the
- // validation of reCAPTCHA action-tokens. The provided site keys need to
- // be created from reCAPTCHA API under the same project where the
- // security policy is created.
+ // ActionTokenSiteKeys: A list of site keys to be used during the validation of
+ // reCAPTCHA action-tokens. The provided site keys need to be created from
+ // reCAPTCHA API under the same project where the security policy is created.
ActionTokenSiteKeys []string `json:"actionTokenSiteKeys,omitempty"`
-
- // SessionTokenSiteKeys: A list of site keys to be used during the
- // validation of reCAPTCHA session-tokens. The provided site keys need
- // to be created from reCAPTCHA API under the same project where the
- // security policy is created.
+ // SessionTokenSiteKeys: A list of site keys to be used during the validation
+ // of reCAPTCHA session-tokens. The provided site keys need to be created from
+ // reCAPTCHA API under the same project where the security policy is created.
SessionTokenSiteKeys []string `json:"sessionTokenSiteKeys,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "ActionTokenSiteKeys")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "ActionTokenSiteKeys") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "ActionTokenSiteKeys") 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. "ActionTokenSiteKeys") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SecurityPolicyRuleMatcherExprOptionsRecaptchaOptions) MarshalJSON() ([]byte, error) {
+func (s SecurityPolicyRuleMatcherExprOptionsRecaptchaOptions) MarshalJSON() ([]byte, error) {
type NoMethod SecurityPolicyRuleMatcherExprOptionsRecaptchaOptions
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// SecurityPolicyRuleNetworkMatcher: Represents a match condition that
-// incoming network traffic is evaluated against.
+// SecurityPolicyRuleNetworkMatcher: Represents a match condition that incoming
+// network traffic is evaluated against.
type SecurityPolicyRuleNetworkMatcher struct {
- // DestIpRanges: Destination IPv4/IPv6 addresses or CIDR prefixes, in
- // standard text format.
+ // DestIpRanges: Destination IPv4/IPv6 addresses or CIDR prefixes, in standard
+ // text format.
DestIpRanges []string `json:"destIpRanges,omitempty"`
-
- // DestPorts: Destination port numbers for TCP/UDP/SCTP. Each element
- // can be a 16-bit unsigned decimal number (e.g. "80") or range (e.g.
- // "0-1023").
+ // DestPorts: Destination port numbers for TCP/UDP/SCTP. Each element can be a
+ // 16-bit unsigned decimal number (e.g. "80") or range (e.g. "0-1023").
DestPorts []string `json:"destPorts,omitempty"`
-
- // IpProtocols: IPv4 protocol / IPv6 next header (after extension
- // headers). Each element can be an 8-bit unsigned decimal number (e.g.
- // "6"), range (e.g. "253-254"), or one of the following protocol names:
- // "tcp", "udp", "icmp", "esp", "ah", "ipip", or "sctp".
+ // IpProtocols: IPv4 protocol / IPv6 next header (after extension headers).
+ // Each element can be an 8-bit unsigned decimal number (e.g. "6"), range (e.g.
+ // "253-254"), or one of the following protocol names: "tcp", "udp", "icmp",
+ // "esp", "ah", "ipip", or "sctp".
IpProtocols []string `json:"ipProtocols,omitempty"`
-
- // SrcAsns: BGP Autonomous System Number associated with the source IP
- // address.
+ // SrcAsns: BGP Autonomous System Number associated with the source IP address.
SrcAsns []int64 `json:"srcAsns,omitempty"`
-
- // SrcIpRanges: Source IPv4/IPv6 addresses or CIDR prefixes, in standard
- // text format.
+ // SrcIpRanges: Source IPv4/IPv6 addresses or CIDR prefixes, in standard text
+ // format.
SrcIpRanges []string `json:"srcIpRanges,omitempty"`
-
- // SrcPorts: Source port numbers for TCP/UDP/SCTP. Each element can be a
- // 16-bit unsigned decimal number (e.g. "80") or range (e.g. "0-1023").
+ // SrcPorts: Source port numbers for TCP/UDP/SCTP. Each element can be a 16-bit
+ // unsigned decimal number (e.g. "80") or range (e.g. "0-1023").
SrcPorts []string `json:"srcPorts,omitempty"`
-
- // SrcRegionCodes: Two-letter ISO 3166-1 alpha-2 country code associated
- // with the source IP address.
+ // SrcRegionCodes: Two-letter ISO 3166-1 alpha-2 country code associated with
+ // the source IP address.
SrcRegionCodes []string `json:"srcRegionCodes,omitempty"`
-
- // UserDefinedFields: User-defined fields. Each element names a defined
- // field and lists the matching values for that field.
+ // UserDefinedFields: User-defined fields. Each element names a defined field
+ // and lists the matching values for that field.
UserDefinedFields []*SecurityPolicyRuleNetworkMatcherUserDefinedFieldMatch `json:"userDefinedFields,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "DestIpRanges") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "DestIpRanges") 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. "DestIpRanges") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SecurityPolicyRuleNetworkMatcher) MarshalJSON() ([]byte, error) {
+func (s SecurityPolicyRuleNetworkMatcher) MarshalJSON() ([]byte, error) {
type NoMethod SecurityPolicyRuleNetworkMatcher
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SecurityPolicyRuleNetworkMatcherUserDefinedFieldMatch struct {
// Name: Name of the user-defined field, as given in the definition.
Name string `json:"name,omitempty"`
-
- // Values: Matching values of the field. Each element can be a 32-bit
- // unsigned decimal or hexadecimal (starting with "0x") number (e.g.
- // "64") or range (e.g. "0x400-0x7ff").
+ // Values: Matching values of the field. Each element can be a 32-bit unsigned
+ // decimal or hexadecimal (starting with "0x") number (e.g. "64") or range
+ // (e.g. "0x400-0x7ff").
Values []string `json:"values,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Name") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Name") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
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 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. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SecurityPolicyRuleNetworkMatcherUserDefinedFieldMatch) MarshalJSON() ([]byte, error) {
+func (s SecurityPolicyRuleNetworkMatcherUserDefinedFieldMatch) MarshalJSON() ([]byte, error) {
type NoMethod SecurityPolicyRuleNetworkMatcherUserDefinedFieldMatch
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SecurityPolicyRulePreconfiguredWafConfig struct {
// Exclusions: A list of exclusions to apply during preconfigured WAF
// evaluation.
Exclusions []*SecurityPolicyRulePreconfiguredWafConfigExclusion `json:"exclusions,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Exclusions") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
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 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. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SecurityPolicyRulePreconfiguredWafConfig) MarshalJSON() ([]byte, error) {
+func (s SecurityPolicyRulePreconfiguredWafConfig) MarshalJSON() ([]byte, error) {
type NoMethod SecurityPolicyRulePreconfiguredWafConfig
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SecurityPolicyRulePreconfiguredWafConfigExclusion struct {
- // RequestCookiesToExclude: A list of request cookie names whose value
- // will be excluded from inspection during preconfigured WAF evaluation.
+ // RequestCookiesToExclude: A list of request cookie names whose value will be
+ // excluded from inspection during preconfigured WAF evaluation.
RequestCookiesToExclude []*SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams `json:"requestCookiesToExclude,omitempty"`
-
- // RequestHeadersToExclude: A list of request header names whose value
- // will be excluded from inspection during preconfigured WAF evaluation.
+ // RequestHeadersToExclude: A list of request header names whose value will be
+ // excluded from inspection during preconfigured WAF evaluation.
RequestHeadersToExclude []*SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams `json:"requestHeadersToExclude,omitempty"`
-
- // RequestQueryParamsToExclude: A list of request query parameter names
- // whose value will be excluded from inspection during preconfigured WAF
- // evaluation. Note that the parameter can be in the query string or in
- // the POST body.
+ // RequestQueryParamsToExclude: A list of request query parameter names whose
+ // value will be excluded from inspection during preconfigured WAF evaluation.
+ // Note that the parameter can be in the query string or in the POST body.
RequestQueryParamsToExclude []*SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams `json:"requestQueryParamsToExclude,omitempty"`
-
- // RequestUrisToExclude: A list of request URIs from the request line to
- // be excluded from inspection during preconfigured WAF evaluation. When
+ // RequestUrisToExclude: A list of request URIs from the request line to be
+ // excluded from inspection during preconfigured WAF evaluation. When
// specifying this field, the query or fragment part should be excluded.
RequestUrisToExclude []*SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams `json:"requestUrisToExclude,omitempty"`
-
- // TargetRuleIds: A list of target rule IDs under the WAF rule set to
- // apply the preconfigured WAF exclusion. If omitted, it refers to all
- // the rule IDs under the WAF rule set.
+ // TargetRuleIds: A list of target rule IDs under the WAF rule set to apply the
+ // preconfigured WAF exclusion. If omitted, it refers to all the rule IDs under
+ // the WAF rule set.
TargetRuleIds []string `json:"targetRuleIds,omitempty"`
-
- // TargetRuleSet: Target WAF rule set to apply the preconfigured WAF
- // exclusion.
+ // TargetRuleSet: Target WAF rule set to apply the preconfigured WAF exclusion.
TargetRuleSet string `json:"targetRuleSet,omitempty"`
-
- // ForceSendFields is a list of field names (e.g.
- // "RequestCookiesToExclude") to unconditionally include in API
- // requests. By default, fields with empty or default 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. "RequestCookiesToExclude")
- // 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.
+ // ForceSendFields is a list of field names (e.g. "RequestCookiesToExclude") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "RequestCookiesToExclude") to
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SecurityPolicyRulePreconfiguredWafConfigExclusion) MarshalJSON() ([]byte, error) {
+func (s SecurityPolicyRulePreconfiguredWafConfigExclusion) MarshalJSON() ([]byte, error) {
type NoMethod SecurityPolicyRulePreconfiguredWafConfigExclusion
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams struct {
@@ -48507,85 +40855,71 @@ type SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams struct {
// specified value.
// "ENDS_WITH" - The operator matches if the field value ends with the
// specified value.
- // "EQUALS" - The operator matches if the field value equals the
- // specified value.
- // "EQUALS_ANY" - The operator matches if the field value is any
+ // "EQUALS" - The operator matches if the field value equals the specified
// value.
- // "STARTS_WITH" - The operator matches if the field value starts with
- // the specified value.
+ // "EQUALS_ANY" - The operator matches if the field value is any value.
+ // "STARTS_WITH" - The operator matches if the field value starts with the
+ // specified value.
Op string `json:"op,omitempty"`
-
// Val: The value of the field.
Val string `json:"val,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Op") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Op") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Op") 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. "Op") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams) MarshalJSON() ([]byte, error) {
+func (s SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams) MarshalJSON() ([]byte, error) {
type NoMethod SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SecurityPolicyRuleRateLimitOptions struct {
// BanDurationSec: Can only be specified if the action for the rule is
- // "rate_based_ban". If specified, determines the time (in seconds) the
- // traffic will continue to be banned by the rate limit after the rate
- // falls below the threshold.
+ // "rate_based_ban". If specified, determines the time (in seconds) the traffic
+ // will continue to be banned by the rate limit after the rate falls below the
+ // threshold.
BanDurationSec int64 `json:"banDurationSec,omitempty"`
-
// BanThreshold: Can only be specified if the action for the rule is
- // "rate_based_ban". If specified, the key will be banned for the
- // configured 'ban_duration_sec' when the number of requests that exceed
- // the 'rate_limit_threshold' also exceed this 'ban_threshold'.
+ // "rate_based_ban". If specified, the key will be banned for the configured
+ // 'ban_duration_sec' when the number of requests that exceed the
+ // 'rate_limit_threshold' also exceed this 'ban_threshold'.
BanThreshold *SecurityPolicyRuleRateLimitOptionsThreshold `json:"banThreshold,omitempty"`
-
- // ConformAction: Action to take for requests that are under the
- // configured rate limit threshold. Valid option is "allow" only.
+ // ConformAction: Action to take for requests that are under the configured
+ // rate limit threshold. Valid option is "allow" only.
ConformAction string `json:"conformAction,omitempty"`
-
- // EnforceOnKey: Determines the key to enforce the rate_limit_threshold
- // on. Possible values are: - ALL: A single rate limit threshold is
- // applied to all the requests matching this rule. This is the default
- // value if "enforceOnKey" is not configured. - IP: The source IP
- // address of the request is the key. Each IP has this limit enforced
- // separately. - HTTP_HEADER: The value of the HTTP header whose name is
- // configured under "enforceOnKeyName". The key value is truncated to
- // the first 128 bytes of the header value. If no such header is present
- // in the request, the key type defaults to ALL. - XFF_IP: The first IP
- // address (i.e. the originating client IP address) specified in the
- // list of IPs under X-Forwarded-For HTTP header. If no such header is
- // present or the value is not a valid IP, the key defaults to the
- // source IP address of the request i.e. key type IP. - HTTP_COOKIE: The
- // value of the HTTP cookie whose name is configured under
- // "enforceOnKeyName". The key value is truncated to the first 128 bytes
- // of the cookie value. If no such cookie is present in the request, the
- // key type defaults to ALL. - HTTP_PATH: The URL path of the HTTP
- // request. The key value is truncated to the first 128 bytes. - SNI:
- // Server name indication in the TLS session of the HTTPS request. The
- // key value is truncated to the first 128 bytes. The key type defaults
- // to ALL on a HTTP session. - REGION_CODE: The country/region from
- // which the request originates. - TLS_JA3_FINGERPRINT: JA3 TLS/SSL
- // fingerprint if the client connects using HTTPS, HTTP/2 or HTTP/3. If
- // not available, the key type defaults to ALL. - USER_IP: The IP
- // address of the originating client, which is resolved based on
- // "userIpRequestHeaders" configured with the security policy. If there
- // is no "userIpRequestHeaders" configuration or an IP address cannot be
- // resolved from it, the key type defaults to IP.
+ // EnforceOnKey: Determines the key to enforce the rate_limit_threshold on.
+ // Possible values are: - ALL: A single rate limit threshold is applied to all
+ // the requests matching this rule. This is the default value if "enforceOnKey"
+ // is not configured. - IP: The source IP address of the request is the key.
+ // Each IP has this limit enforced separately. - HTTP_HEADER: The value of the
+ // HTTP header whose name is configured under "enforceOnKeyName". The key value
+ // is truncated to the first 128 bytes of the header value. If no such header
+ // is present in the request, the key type defaults to ALL. - XFF_IP: The first
+ // IP address (i.e. the originating client IP address) specified in the list of
+ // IPs under X-Forwarded-For HTTP header. If no such header is present or the
+ // value is not a valid IP, the key defaults to the source IP address of the
+ // request i.e. key type IP. - HTTP_COOKIE: The value of the HTTP cookie whose
+ // name is configured under "enforceOnKeyName". The key value is truncated to
+ // the first 128 bytes of the cookie value. If no such cookie is present in the
+ // request, the key type defaults to ALL. - HTTP_PATH: The URL path of the HTTP
+ // request. The key value is truncated to the first 128 bytes. - SNI: Server
+ // name indication in the TLS session of the HTTPS request. The key value is
+ // truncated to the first 128 bytes. The key type defaults to ALL on a HTTP
+ // session. - REGION_CODE: The country/region from which the request
+ // originates. - TLS_JA3_FINGERPRINT: JA3 TLS/SSL fingerprint if the client
+ // connects using HTTPS, HTTP/2 or HTTP/3. If not available, the key type
+ // defaults to ALL. - USER_IP: The IP address of the originating client, which
+ // is resolved based on "userIpRequestHeaders" configured with the security
+ // policy. If there is no "userIpRequestHeaders" configuration or an IP address
+ // cannot be resolved from it, the key type defaults to IP.
//
// Possible values:
// "ALL"
@@ -48599,98 +40933,82 @@ type SecurityPolicyRuleRateLimitOptions struct {
// "USER_IP"
// "XFF_IP"
EnforceOnKey string `json:"enforceOnKey,omitempty"`
-
// EnforceOnKeyConfigs: If specified, any combination of values of
- // enforce_on_key_type/enforce_on_key_name is treated as the key on
- // which ratelimit threshold/action is enforced. You can specify up to 3
+ // enforce_on_key_type/enforce_on_key_name is treated as the key on which
+ // ratelimit threshold/action is enforced. You can specify up to 3
// enforce_on_key_configs. If enforce_on_key_configs is specified,
// enforce_on_key must not be specified.
EnforceOnKeyConfigs []*SecurityPolicyRuleRateLimitOptionsEnforceOnKeyConfig `json:"enforceOnKeyConfigs,omitempty"`
-
- // EnforceOnKeyName: Rate limit key name applicable only for the
- // following key types: HTTP_HEADER -- Name of the HTTP header whose
- // value is taken as the key value. HTTP_COOKIE -- Name of the HTTP
- // cookie whose value is taken as the key value.
+ // EnforceOnKeyName: Rate limit key name applicable only for the following key
+ // types: HTTP_HEADER -- Name of the HTTP header whose value is taken as the
+ // key value. HTTP_COOKIE -- Name of the HTTP cookie whose value is taken as
+ // the key value.
EnforceOnKeyName string `json:"enforceOnKeyName,omitempty"`
-
- // ExceedAction: Action to take for requests that are above the
- // configured rate limit threshold, to either deny with a specified HTTP
- // response code, or redirect to a different endpoint. Valid options are
- // `deny(STATUS)`, where valid values for `STATUS` are 403, 404, 429,
- // and 502, and `redirect`, where the redirect parameters come from
- // `exceedRedirectOptions` below. The `redirect` action is only
- // supported in Global Security Policies of type CLOUD_ARMOR.
+ // ExceedAction: Action to take for requests that are above the configured rate
+ // limit threshold, to either deny with a specified HTTP response code, or
+ // redirect to a different endpoint. Valid options are `deny(STATUS)`, where
+ // valid values for `STATUS` are 403, 404, 429, and 502, and `redirect`, where
+ // the redirect parameters come from `exceedRedirectOptions` below. The
+ // `redirect` action is only supported in Global Security Policies of type
+ // CLOUD_ARMOR.
ExceedAction string `json:"exceedAction,omitempty"`
-
- // ExceedRedirectOptions: Parameters defining the redirect action that
- // is used as the exceed action. Cannot be specified if the exceed
- // action is not redirect. This field is only supported in Global
- // Security Policies of type CLOUD_ARMOR.
+ // ExceedRedirectOptions: Parameters defining the redirect action that is used
+ // as the exceed action. Cannot be specified if the exceed action is not
+ // redirect. This field is only supported in Global Security Policies of type
+ // CLOUD_ARMOR.
ExceedRedirectOptions *SecurityPolicyRuleRedirectOptions `json:"exceedRedirectOptions,omitempty"`
-
// RateLimitThreshold: Threshold at which to begin ratelimiting.
RateLimitThreshold *SecurityPolicyRuleRateLimitOptionsThreshold `json:"rateLimitThreshold,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "BanDurationSec") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "BanDurationSec") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "BanDurationSec") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SecurityPolicyRuleRateLimitOptions) MarshalJSON() ([]byte, error) {
+func (s SecurityPolicyRuleRateLimitOptions) MarshalJSON() ([]byte, error) {
type NoMethod SecurityPolicyRuleRateLimitOptions
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SecurityPolicyRuleRateLimitOptionsEnforceOnKeyConfig struct {
- // EnforceOnKeyName: Rate limit key name applicable only for the
- // following key types: HTTP_HEADER -- Name of the HTTP header whose
- // value is taken as the key value. HTTP_COOKIE -- Name of the HTTP
- // cookie whose value is taken as the key value.
+ // EnforceOnKeyName: Rate limit key name applicable only for the following key
+ // types: HTTP_HEADER -- Name of the HTTP header whose value is taken as the
+ // key value. HTTP_COOKIE -- Name of the HTTP cookie whose value is taken as
+ // the key value.
EnforceOnKeyName string `json:"enforceOnKeyName,omitempty"`
-
- // EnforceOnKeyType: Determines the key to enforce the
- // rate_limit_threshold on. Possible values are: - ALL: A single rate
- // limit threshold is applied to all the requests matching this rule.
- // This is the default value if "enforceOnKeyConfigs" is not configured.
- // - IP: The source IP address of the request is the key. Each IP has
- // this limit enforced separately. - HTTP_HEADER: The value of the HTTP
- // header whose name is configured under "enforceOnKeyName". The key
- // value is truncated to the first 128 bytes of the header value. If no
- // such header is present in the request, the key type defaults to ALL.
- // - XFF_IP: The first IP address (i.e. the originating client IP
- // address) specified in the list of IPs under X-Forwarded-For HTTP
- // header. If no such header is present or the value is not a valid IP,
- // the key defaults to the source IP address of the request i.e. key
- // type IP. - HTTP_COOKIE: The value of the HTTP cookie whose name is
- // configured under "enforceOnKeyName". The key value is truncated to
- // the first 128 bytes of the cookie value. If no such cookie is present
- // in the request, the key type defaults to ALL. - HTTP_PATH: The URL
- // path of the HTTP request. The key value is truncated to the first 128
- // bytes. - SNI: Server name indication in the TLS session of the HTTPS
- // request. The key value is truncated to the first 128 bytes. The key
- // type defaults to ALL on a HTTP session. - REGION_CODE: The
- // country/region from which the request originates. -
- // TLS_JA3_FINGERPRINT: JA3 TLS/SSL fingerprint if the client connects
- // using HTTPS, HTTP/2 or HTTP/3. If not available, the key type
- // defaults to ALL. - USER_IP: The IP address of the originating client,
- // which is resolved based on "userIpRequestHeaders" configured with the
- // security policy. If there is no "userIpRequestHeaders" configuration
- // or an IP address cannot be resolved from it, the key type defaults to
- // IP.
+ // EnforceOnKeyType: Determines the key to enforce the rate_limit_threshold on.
+ // Possible values are: - ALL: A single rate limit threshold is applied to all
+ // the requests matching this rule. This is the default value if
+ // "enforceOnKeyConfigs" is not configured. - IP: The source IP address of the
+ // request is the key. Each IP has this limit enforced separately. -
+ // HTTP_HEADER: The value of the HTTP header whose name is configured under
+ // "enforceOnKeyName". The key value is truncated to the first 128 bytes of the
+ // header value. If no such header is present in the request, the key type
+ // defaults to ALL. - XFF_IP: The first IP address (i.e. the originating client
+ // IP address) specified in the list of IPs under X-Forwarded-For HTTP header.
+ // If no such header is present or the value is not a valid IP, the key
+ // defaults to the source IP address of the request i.e. key type IP. -
+ // HTTP_COOKIE: The value of the HTTP cookie whose name is configured under
+ // "enforceOnKeyName". The key value is truncated to the first 128 bytes of the
+ // cookie value. If no such cookie is present in the request, the key type
+ // defaults to ALL. - HTTP_PATH: The URL path of the HTTP request. The key
+ // value is truncated to the first 128 bytes. - SNI: Server name indication in
+ // the TLS session of the HTTPS request. The key value is truncated to the
+ // first 128 bytes. The key type defaults to ALL on a HTTP session. -
+ // REGION_CODE: The country/region from which the request originates. -
+ // TLS_JA3_FINGERPRINT: JA3 TLS/SSL fingerprint if the client connects using
+ // HTTPS, HTTP/2 or HTTP/3. If not available, the key type defaults to ALL. -
+ // USER_IP: The IP address of the originating client, which is resolved based
+ // on "userIpRequestHeaders" configured with the security policy. If there is
+ // no "userIpRequestHeaders" configuration or an IP address cannot be resolved
+ // from it, the key type defaults to IP.
//
// Possible values:
// "ALL"
@@ -48704,105 +41022,83 @@ type SecurityPolicyRuleRateLimitOptionsEnforceOnKeyConfig struct {
// "USER_IP"
// "XFF_IP"
EnforceOnKeyType string `json:"enforceOnKeyType,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "EnforceOnKeyName") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "EnforceOnKeyName") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "EnforceOnKeyName") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SecurityPolicyRuleRateLimitOptionsEnforceOnKeyConfig) MarshalJSON() ([]byte, error) {
+func (s SecurityPolicyRuleRateLimitOptionsEnforceOnKeyConfig) MarshalJSON() ([]byte, error) {
type NoMethod SecurityPolicyRuleRateLimitOptionsEnforceOnKeyConfig
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SecurityPolicyRuleRateLimitOptionsThreshold struct {
// Count: Number of HTTP(S) requests for calculating the threshold.
Count int64 `json:"count,omitempty"`
-
// IntervalSec: Interval over which the threshold is computed.
IntervalSec int64 `json:"intervalSec,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Count") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Count") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Count") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SecurityPolicyRuleRateLimitOptionsThreshold) MarshalJSON() ([]byte, error) {
+func (s SecurityPolicyRuleRateLimitOptionsThreshold) MarshalJSON() ([]byte, error) {
type NoMethod SecurityPolicyRuleRateLimitOptionsThreshold
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SecurityPolicyRuleRedirectOptions struct {
- // Target: Target for the redirect action. This is required if the type
- // is EXTERNAL_302 and cannot be specified for GOOGLE_RECAPTCHA.
+ // Target: Target for the redirect action. This is required if the type is
+ // EXTERNAL_302 and cannot be specified for GOOGLE_RECAPTCHA.
Target string `json:"target,omitempty"`
-
// Type: Type of the redirect action.
//
// Possible values:
// "EXTERNAL_302"
// "GOOGLE_RECAPTCHA"
Type string `json:"type,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Target") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Target") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Target") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SecurityPolicyRuleRedirectOptions) MarshalJSON() ([]byte, error) {
+func (s SecurityPolicyRuleRedirectOptions) MarshalJSON() ([]byte, error) {
type NoMethod SecurityPolicyRuleRedirectOptions
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SecurityPolicyUserDefinedField struct {
- // Base: The base relative to which 'offset' is measured. Possible
- // values are: - IPV4: Points to the beginning of the IPv4 header. -
- // IPV6: Points to the beginning of the IPv6 header. - TCP: Points to
- // the beginning of the TCP header, skipping over any IPv4 options or
- // IPv6 extension headers. Not present for non-first fragments. - UDP:
- // Points to the beginning of the UDP header, skipping over any IPv4
- // options or IPv6 extension headers. Not present for non-first
- // fragments. required
+ // Base: The base relative to which 'offset' is measured. Possible values are:
+ // - IPV4: Points to the beginning of the IPv4 header. - IPV6: Points to the
+ // beginning of the IPv6 header. - TCP: Points to the beginning of the TCP
+ // header, skipping over any IPv4 options or IPv6 extension headers. Not
+ // present for non-first fragments. - UDP: Points to the beginning of the UDP
+ // header, skipping over any IPv4 options or IPv6 extension headers. Not
+ // present for non-first fragments. required
//
// Possible values:
// "IPV4"
@@ -48810,1151 +41106,932 @@ type SecurityPolicyUserDefinedField struct {
// "TCP"
// "UDP"
Base string `json:"base,omitempty"`
-
- // Mask: If specified, apply this mask (bitwise AND) to the field to
- // ignore bits before matching. Encoded as a hexadecimal number
- // (starting with "0x"). The last byte of the field (in network byte
- // order) corresponds to the least significant byte of the mask.
+ // Mask: If specified, apply this mask (bitwise AND) to the field to ignore
+ // bits before matching. Encoded as a hexadecimal number (starting with "0x").
+ // The last byte of the field (in network byte order) corresponds to the least
+ // significant byte of the mask.
Mask string `json:"mask,omitempty"`
-
// Name: The name of this field. Must be unique within the policy.
Name string `json:"name,omitempty"`
-
// Offset: Offset of the first byte of the field (in network byte order)
// relative to 'base'.
Offset int64 `json:"offset,omitempty"`
-
// Size: Size of the field in bytes. Valid values: 1-4.
Size int64 `json:"size,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Base") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Base") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Base") 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. "Base") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SecurityPolicyUserDefinedField) MarshalJSON() ([]byte, error) {
+func (s SecurityPolicyUserDefinedField) MarshalJSON() ([]byte, error) {
type NoMethod SecurityPolicyUserDefinedField
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// SecuritySettings: The authentication and authorization settings for a
// BackendService.
type SecuritySettings struct {
- // AwsV4Authentication: The configuration needed to generate a signature
- // for access to private storage buckets that support AWS's Signature
- // Version 4 for authentication. Allowed only for INTERNET_IP_PORT and
- // INTERNET_FQDN_PORT NEG backends.
+ // AwsV4Authentication: The configuration needed to generate a signature for
+ // access to private storage buckets that support AWS's Signature Version 4 for
+ // authentication. Allowed only for INTERNET_IP_PORT and INTERNET_FQDN_PORT NEG
+ // backends.
AwsV4Authentication *AWSV4Signature `json:"awsV4Authentication,omitempty"`
-
// ClientTlsPolicy: Optional. A URL referring to a
- // networksecurity.ClientTlsPolicy resource that describes how clients
- // should authenticate with this service's backends. clientTlsPolicy
- // only applies to a global BackendService with the loadBalancingScheme
- // set to INTERNAL_SELF_MANAGED. If left blank, communications are not
- // encrypted.
+ // networksecurity.ClientTlsPolicy resource that describes how clients should
+ // authenticate with this service's backends. clientTlsPolicy only applies to a
+ // global BackendService with the loadBalancingScheme set to
+ // INTERNAL_SELF_MANAGED. If left blank, communications are not encrypted.
ClientTlsPolicy string `json:"clientTlsPolicy,omitempty"`
-
- // SubjectAltNames: Optional. A list of Subject Alternative Names (SANs)
- // that the client verifies during a mutual TLS handshake with an
- // server/endpoint for this BackendService. When the server presents its
- // X.509 certificate to the client, the client inspects the
- // certificate's subjectAltName field. If the field contains one of the
- // specified values, the communication continues. Otherwise, it fails.
- // This additional check enables the client to verify that the server is
- // authorized to run the requested service. Note that the contents of
- // the server certificate's subjectAltName field are configured by the
- // Public Key Infrastructure which provisions server identities. Only
+ // SubjectAltNames: Optional. A list of Subject Alternative Names (SANs) that
+ // the client verifies during a mutual TLS handshake with an server/endpoint
+ // for this BackendService. When the server presents its X.509 certificate to
+ // the client, the client inspects the certificate's subjectAltName field. If
+ // the field contains one of the specified values, the communication continues.
+ // Otherwise, it fails. This additional check enables the client to verify that
+ // the server is authorized to run the requested service. Note that the
+ // contents of the server certificate's subjectAltName field are configured by
+ // the Public Key Infrastructure which provisions server identities. Only
// applies to a global BackendService with loadBalancingScheme set to
- // INTERNAL_SELF_MANAGED. Only applies when BackendService has an
- // attached clientTlsPolicy with clientCertificate (mTLS mode).
+ // INTERNAL_SELF_MANAGED. Only applies when BackendService has an attached
+ // clientTlsPolicy with clientCertificate (mTLS mode).
SubjectAltNames []string `json:"subjectAltNames,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "AwsV4Authentication")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "AwsV4Authentication") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "AwsV4Authentication") 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. "AwsV4Authentication") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SecuritySettings) MarshalJSON() ([]byte, error) {
+func (s SecuritySettings) MarshalJSON() ([]byte, error) {
type NoMethod SecuritySettings
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// SerialPortOutput: An instance serial console output.
type SerialPortOutput struct {
// Contents: [Output Only] The contents of the console output.
Contents string `json:"contents,omitempty"`
-
- // Kind: [Output Only] Type of the resource. Always
- // compute#serialPortOutput for serial port output.
+ // Kind: [Output Only] Type of the resource. Always compute#serialPortOutput
+ // for serial port output.
Kind string `json:"kind,omitempty"`
-
- // Next: [Output Only] The position of the next byte of content,
- // regardless of whether the content exists, following the output
- // returned in the `contents` property. Use this value in the next
- // request as the start parameter.
+ // Next: [Output Only] The position of the next byte of content, regardless of
+ // whether the content exists, following the output returned in the `contents`
+ // property. Use this value in the next request as the start parameter.
Next int64 `json:"next,omitempty,string"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // Start: The starting byte position of the output that was returned.
- // This should match the start parameter sent with the request. If the
- // serial console output exceeds the size of the buffer (1 MB), older
- // output is overwritten by newer content. The output start value will
- // indicate the byte position of the output that was returned, which
- // might be different than the `start` value that was specified in the
- // request.
+ // Start: The starting byte position of the output that was returned. This
+ // should match the start parameter sent with the request. If the serial
+ // console output exceeds the size of the buffer (1 MB), older output is
+ // overwritten by newer content. The output start value will indicate the byte
+ // position of the output that was returned, which might be different than the
+ // `start` value that was specified in the request.
Start int64 `json:"start,omitempty,string"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
// ForceSendFields is a list of field names (e.g. "Contents") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Contents") 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. "Contents") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SerialPortOutput) MarshalJSON() ([]byte, error) {
+func (s SerialPortOutput) MarshalJSON() ([]byte, error) {
type NoMethod SerialPortOutput
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ServerBinding struct {
// Possible values:
- // "RESTART_NODE_ON_ANY_SERVER" - Node may associate with any physical
- // server over its lifetime.
+ // "RESTART_NODE_ON_ANY_SERVER" - Node may associate with any physical server
+ // over its lifetime.
// "RESTART_NODE_ON_MINIMAL_SERVERS" - Node may associate with minimal
// physical servers over its lifetime.
// "SERVER_BINDING_TYPE_UNSPECIFIED"
Type string `json:"type,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Type") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Type") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Type") 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. "Type") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ServerBinding) MarshalJSON() ([]byte, error) {
+func (s ServerBinding) MarshalJSON() ([]byte, error) {
type NoMethod ServerBinding
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// ServiceAccount: A service account.
type ServiceAccount struct {
// Email: Email address of the service account.
Email string `json:"email,omitempty"`
-
- // Scopes: The list of scopes to be made available for this service
- // account.
+ // Scopes: The list of scopes to be made available for this service account.
Scopes []string `json:"scopes,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Email") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Email") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Email") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ServiceAccount) MarshalJSON() ([]byte, error) {
+func (s ServiceAccount) MarshalJSON() ([]byte, error) {
type NoMethod ServiceAccount
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// ServiceAttachment: Represents a ServiceAttachment resource. A service
-// attachment represents a service that a producer has exposed. It
-// encapsulates the load balancer which fronts the service runs and a
-// list of NAT IP ranges that the producers uses to represent the
-// consumers connecting to the service.
+// attachment represents a service that a producer has exposed. It encapsulates
+// the load balancer which fronts the service runs and a list of NAT IP ranges
+// that the producers uses to represent the consumers connecting to the
+// service.
type ServiceAttachment struct {
// ConnectedEndpoints: [Output Only] An array of connections for all the
// consumers connected to this service attachment.
ConnectedEndpoints []*ServiceAttachmentConnectedEndpoint `json:"connectedEndpoints,omitempty"`
-
- // ConnectionPreference: The connection preference of service
- // attachment. The value can be set to ACCEPT_AUTOMATIC. An
- // ACCEPT_AUTOMATIC service attachment is one that always accepts the
- // connection from consumer forwarding rules.
+ // ConnectionPreference: The connection preference of service attachment. The
+ // value can be set to ACCEPT_AUTOMATIC. An ACCEPT_AUTOMATIC service attachment
+ // is one that always accepts the connection from consumer forwarding rules.
//
// Possible values:
// "ACCEPT_AUTOMATIC"
// "ACCEPT_MANUAL"
// "CONNECTION_PREFERENCE_UNSPECIFIED"
ConnectionPreference string `json:"connectionPreference,omitempty"`
-
- // ConsumerAcceptLists: Projects that are allowed to connect to this
- // service attachment.
+ // ConsumerAcceptLists: Specifies which consumer projects or networks are
+ // allowed to connect to the service attachment. Each project or network has a
+ // connection limit. A given service attachment can manage connections at
+ // either the project or network level. Therefore, both the accept and reject
+ // lists for a given service attachment must contain either only projects or
+ // only networks.
ConsumerAcceptLists []*ServiceAttachmentConsumerProjectLimit `json:"consumerAcceptLists,omitempty"`
-
- // ConsumerRejectLists: Projects that are not allowed to connect to this
- // service attachment. The project can be specified using its id or
- // number.
+ // ConsumerRejectLists: Specifies a list of projects or networks that are not
+ // allowed to connect to this service attachment. The project can be specified
+ // using its project ID or project number and the network can be specified
+ // using its URL. A given service attachment can manage connections at either
+ // the project or network level. Therefore, both the reject and accept lists
+ // for a given service attachment must contain either only projects or only
+ // networks.
ConsumerRejectLists []string `json:"consumerRejectLists,omitempty"`
-
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
// DomainNames: If specified, the domain name will be used during the
- // integration between the PSC connected endpoints and the Cloud DNS.
- // For example, this is a valid domain name: "p.mycompany.com.". Current
- // max number of domain names supported is 1.
+ // integration between the PSC connected endpoints and the Cloud DNS. For
+ // example, this is a valid domain name: "p.mycompany.com.". Current max number
+ // of domain names supported is 1.
DomainNames []string `json:"domainNames,omitempty"`
-
// EnableProxyProtocol: If true, enable the proxy protocol which is for
// supplying client TCP/IP address data in TCP connections that traverse
// proxies on their way to destination servers.
EnableProxyProtocol bool `json:"enableProxyProtocol,omitempty"`
-
- // Fingerprint: Fingerprint of this resource. A hash of the contents
- // stored in this object. This field is used in optimistic locking. This
- // field will be ignored when inserting a ServiceAttachment. An
- // up-to-date fingerprint must be provided in order to patch/update the
- // ServiceAttachment; otherwise, the request will fail with error 412
- // conditionNotMet. To see the latest fingerprint, make a get() request
- // to retrieve the ServiceAttachment.
+ // Fingerprint: Fingerprint of this resource. A hash of the contents stored in
+ // this object. This field is used in optimistic locking. This field will be
+ // ignored when inserting a ServiceAttachment. An up-to-date fingerprint must
+ // be provided in order to patch/update the ServiceAttachment; otherwise, the
+ // request will fail with error 412 conditionNotMet. To see the latest
+ // fingerprint, make a get() request to retrieve the ServiceAttachment.
Fingerprint string `json:"fingerprint,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource type. The
- // server generates this identifier.
+ // Id: [Output Only] The unique identifier for the resource type. The server
+ // generates this identifier.
Id uint64 `json:"id,omitempty,string"`
-
- // Kind: [Output Only] Type of the resource. Always
- // compute#serviceAttachment for service attachments.
+ // Kind: [Output Only] Type of the resource. Always compute#serviceAttachment
+ // for service attachments.
Kind string `json:"kind,omitempty"`
-
- // Name: Name of the resource. Provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
- // the first character must be a lowercase letter, and all following
- // characters must be a dash, lowercase letter, or digit, except the
- // last character, which cannot be a dash.
+ // Name: Name of the resource. Provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must
+ // be a lowercase letter, and all following characters must be a dash,
+ // lowercase letter, or digit, except the last character, which cannot be a
+ // dash.
Name string `json:"name,omitempty"`
-
// NatSubnets: An array of URLs where each entry is the URL of a subnet
- // provided by the service producer to use for NAT in this service
- // attachment.
+ // provided by the service producer to use for NAT in this service attachment.
NatSubnets []string `json:"natSubnets,omitempty"`
-
// ProducerForwardingRule: The URL of a forwarding rule with
- // loadBalancingScheme INTERNAL* that is serving the endpoint identified
- // by this service attachment.
+ // loadBalancingScheme INTERNAL* that is serving the endpoint identified by
+ // this service attachment.
ProducerForwardingRule string `json:"producerForwardingRule,omitempty"`
-
- // PscServiceAttachmentId: [Output Only] An 128-bit global unique ID of
- // the PSC service attachment.
+ // PropagatedConnectionLimit: The number of consumer spokes that connected
+ // Private Service Connect endpoints can be propagated to through Network
+ // Connectivity Center. This limit lets the service producer limit how many
+ // propagated Private Service Connect connections can be established to this
+ // service attachment from a single consumer. If the connection preference of
+ // the service attachment is ACCEPT_MANUAL, the limit applies to each project
+ // or network that is listed in the consumer accept list. If the connection
+ // preference of the service attachment is ACCEPT_AUTOMATIC, the limit applies
+ // to each project that contains a connected endpoint. If unspecified, the
+ // default propagated connection limit is 250.
+ PropagatedConnectionLimit int64 `json:"propagatedConnectionLimit,omitempty"`
+ // PscServiceAttachmentId: [Output Only] An 128-bit global unique ID of the PSC
+ // service attachment.
PscServiceAttachmentId *Uint128 `json:"pscServiceAttachmentId,omitempty"`
-
- // ReconcileConnections: This flag determines whether a consumer
- // accept/reject list change can reconcile the statuses of existing
- // ACCEPTED or REJECTED PSC endpoints. - If false, connection policy
- // update will only affect existing PENDING PSC endpoints. Existing
- // ACCEPTED/REJECTED endpoints will remain untouched regardless how the
- // connection policy is modified . - If true, update will affect both
- // PENDING and ACCEPTED/REJECTED PSC endpoints. For example, an ACCEPTED
- // PSC endpoint will be moved to REJECTED if its project is added to the
- // reject list. For newly created service attachment, this boolean
- // defaults to false.
+ // ReconcileConnections: This flag determines whether a consumer accept/reject
+ // list change can reconcile the statuses of existing ACCEPTED or REJECTED PSC
+ // endpoints. - If false, connection policy update will only affect existing
+ // PENDING PSC endpoints. Existing ACCEPTED/REJECTED endpoints will remain
+ // untouched regardless how the connection policy is modified . - If true,
+ // update will affect both PENDING and ACCEPTED/REJECTED PSC endpoints. For
+ // example, an ACCEPTED PSC endpoint will be moved to REJECTED if its project
+ // is added to the reject list. For newly created service attachment, this
+ // boolean defaults to false.
ReconcileConnections bool `json:"reconcileConnections,omitempty"`
-
// Region: [Output Only] URL of the region where the service attachment
- // resides. This field applies only to the region resource. You must
- // specify this field as part of the HTTP request URL. It is not
- // settable as a field in the request body.
+ // resides. This field applies only to the region resource. You must specify
+ // this field as part of the HTTP request URL. It is not settable as a field in
+ // the request body.
Region string `json:"region,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // TargetService: The URL of a service serving the endpoint identified
- // by this service attachment.
+ // TargetService: The URL of a service serving the endpoint identified by this
+ // service attachment.
TargetService string `json:"targetService,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "ConnectedEndpoints")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "ConnectedEndpoints") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "ConnectedEndpoints") 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. "ConnectedEndpoints") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ServiceAttachment) MarshalJSON() ([]byte, error) {
+func (s ServiceAttachment) MarshalJSON() ([]byte, error) {
type NoMethod ServiceAttachment
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// ServiceAttachmentAggregatedList: Contains a list of
// ServiceAttachmentsScopedList.
type ServiceAttachmentAggregatedList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of ServiceAttachmentsScopedList resources.
Items map[string]ServiceAttachmentsScopedList `json:"items,omitempty"`
-
// Kind: Type of resource.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Unreachables: [Output Only] Unreachable resources.
Unreachables []string `json:"unreachables,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *ServiceAttachmentAggregatedListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ServiceAttachmentAggregatedList) MarshalJSON() ([]byte, error) {
+func (s ServiceAttachmentAggregatedList) MarshalJSON() ([]byte, error) {
type NoMethod ServiceAttachmentAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// ServiceAttachmentAggregatedListWarning: [Output Only] Informational
-// warning message.
+// ServiceAttachmentAggregatedListWarning: [Output Only] Informational warning
+// message.
type ServiceAttachmentAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*ServiceAttachmentAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ServiceAttachmentAggregatedListWarning) MarshalJSON() ([]byte, error) {
+func (s ServiceAttachmentAggregatedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod ServiceAttachmentAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ServiceAttachmentAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ServiceAttachmentAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+func (s ServiceAttachmentAggregatedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod ServiceAttachmentAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// ServiceAttachmentConnectedEndpoint: [Output Only] A connection
-// connected to this service attachment.
+// ServiceAttachmentConnectedEndpoint: [Output Only] A connection connected to
+// this service attachment.
type ServiceAttachmentConnectedEndpoint struct {
// ConsumerNetwork: The url of the consumer network.
ConsumerNetwork string `json:"consumerNetwork,omitempty"`
-
// Endpoint: The url of a connected endpoint.
Endpoint string `json:"endpoint,omitempty"`
-
+ // PropagatedConnectionCount: The number of consumer Network Connectivity
+ // Center spokes that the connected Private Service Connect endpoint has
+ // propagated to.
+ PropagatedConnectionCount int64 `json:"propagatedConnectionCount,omitempty"`
// PscConnectionId: The PSC connection id of the connected endpoint.
PscConnectionId uint64 `json:"pscConnectionId,omitempty,string"`
-
- // Status: The status of a connected endpoint to this service
- // attachment.
+ // Status: The status of a connected endpoint to this service attachment.
//
// Possible values:
// "ACCEPTED" - The connection has been accepted by the producer.
// "CLOSED" - The connection has been closed by the producer.
- // "NEEDS_ATTENTION" - The connection has been accepted by the
- // producer, but the producer needs to take further action before the
- // forwarding rule can serve traffic.
+ // "NEEDS_ATTENTION" - The connection has been accepted by the producer, but
+ // the producer needs to take further action before the forwarding rule can
+ // serve traffic.
// "PENDING" - The connection is pending acceptance by the producer.
- // "REJECTED" - The consumer is still connected but not using the
- // connection.
+ // "REJECTED" - The consumer is still connected but not using the connection.
// "STATUS_UNSPECIFIED"
Status string `json:"status,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "ConsumerNetwork") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "ConsumerNetwork") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "ConsumerNetwork") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ServiceAttachmentConnectedEndpoint) MarshalJSON() ([]byte, error) {
+func (s ServiceAttachmentConnectedEndpoint) MarshalJSON() ([]byte, error) {
type NoMethod ServiceAttachmentConnectedEndpoint
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ServiceAttachmentConsumerProjectLimit struct {
// ConnectionLimit: The value of the limit to set.
ConnectionLimit int64 `json:"connectionLimit,omitempty"`
-
// NetworkUrl: The network URL for the network to set the limit for.
NetworkUrl string `json:"networkUrl,omitempty"`
-
- // ProjectIdOrNum: The project id or number for the project to set the
- // limit for.
+ // ProjectIdOrNum: The project id or number for the project to set the limit
+ // for.
ProjectIdOrNum string `json:"projectIdOrNum,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "ConnectionLimit") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "ConnectionLimit") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "ConnectionLimit") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ServiceAttachmentConsumerProjectLimit) MarshalJSON() ([]byte, error) {
+func (s ServiceAttachmentConsumerProjectLimit) MarshalJSON() ([]byte, error) {
type NoMethod ServiceAttachmentConsumerProjectLimit
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ServiceAttachmentList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of ServiceAttachment resources.
Items []*ServiceAttachment `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of the resource. Always
- // compute#serviceAttachment for service attachments.
+ // Kind: [Output Only] Type of the resource. Always compute#serviceAttachment
+ // for service attachments.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *ServiceAttachmentListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ServiceAttachmentList) MarshalJSON() ([]byte, error) {
+func (s ServiceAttachmentList) MarshalJSON() ([]byte, error) {
type NoMethod ServiceAttachmentList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// ServiceAttachmentListWarning: [Output Only] Informational warning
-// message.
+// ServiceAttachmentListWarning: [Output Only] Informational warning message.
type ServiceAttachmentListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*ServiceAttachmentListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ServiceAttachmentListWarning) MarshalJSON() ([]byte, error) {
+func (s ServiceAttachmentListWarning) MarshalJSON() ([]byte, error) {
type NoMethod ServiceAttachmentListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ServiceAttachmentListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ServiceAttachmentListWarningData) MarshalJSON() ([]byte, error) {
+func (s ServiceAttachmentListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod ServiceAttachmentListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ServiceAttachmentsScopedList struct {
- // ServiceAttachments: A list of ServiceAttachments contained in this
- // scope.
+ // ServiceAttachments: A list of ServiceAttachments contained in this scope.
ServiceAttachments []*ServiceAttachment `json:"serviceAttachments,omitempty"`
-
// Warning: Informational warning which replaces the list of service
// attachments when the list is empty.
Warning *ServiceAttachmentsScopedListWarning `json:"warning,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "ServiceAttachments")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "ServiceAttachments") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "ServiceAttachments") 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. "ServiceAttachments") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ServiceAttachmentsScopedList) MarshalJSON() ([]byte, error) {
+func (s ServiceAttachmentsScopedList) MarshalJSON() ([]byte, error) {
type NoMethod ServiceAttachmentsScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// ServiceAttachmentsScopedListWarning: Informational warning which
-// replaces the list of service attachments when the list is empty.
+// ServiceAttachmentsScopedListWarning: Informational warning which replaces
+// the list of service attachments when the list is empty.
type ServiceAttachmentsScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*ServiceAttachmentsScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ServiceAttachmentsScopedListWarning) MarshalJSON() ([]byte, error) {
+func (s ServiceAttachmentsScopedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod ServiceAttachmentsScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ServiceAttachmentsScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ServiceAttachmentsScopedListWarningData) MarshalJSON() ([]byte, error) {
+func (s ServiceAttachmentsScopedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod ServiceAttachmentsScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SetCommonInstanceMetadataOperationMetadata struct {
// ClientOperationId: [Output Only] The client operation id.
ClientOperationId string `json:"clientOperationId,omitempty"`
-
// PerLocationOperations: [Output Only] Status information per location
// (location name is key). Example key: zones/us-central1-a
PerLocationOperations map[string]SetCommonInstanceMetadataOperationMetadataPerLocationOperationInfo `json:"perLocationOperations,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "ClientOperationId")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "ClientOperationId") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "ClientOperationId") 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. "ClientOperationId") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SetCommonInstanceMetadataOperationMetadata) MarshalJSON() ([]byte, error) {
+func (s SetCommonInstanceMetadataOperationMetadata) MarshalJSON() ([]byte, error) {
type NoMethod SetCommonInstanceMetadataOperationMetadata
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SetCommonInstanceMetadataOperationMetadataPerLocationOperationInfo struct {
- // Error: [Output Only] If state is `ABANDONED` or `FAILED`, this field
- // is populated.
+ // Error: [Output Only] If state is `ABANDONED` or `FAILED`, this field is
+ // populated.
Error *Status `json:"error,omitempty"`
-
// State: [Output Only] Status of the action, which can be one of the
- // following: `PROPAGATING`, `PROPAGATED`, `ABANDONED`, `FAILED`, or
- // `DONE`.
+ // following: `PROPAGATING`, `PROPAGATED`, `ABANDONED`, `FAILED`, or `DONE`.
//
// Possible values:
- // "ABANDONED" - Operation not tracked in this location e.g. zone is
- // marked as DOWN.
+ // "ABANDONED" - Operation not tracked in this location e.g. zone is marked
+ // as DOWN.
// "DONE" - Operation has completed successfully.
// "FAILED" - Operation is in an error state.
// "PROPAGATED" - Operation is confirmed to be in the location.
- // "PROPAGATING" - Operation is not yet confirmed to have been created
- // in the location.
+ // "PROPAGATING" - Operation is not yet confirmed to have been created in the
+ // location.
// "UNSPECIFIED"
State string `json:"state,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Error") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Error") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Error") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SetCommonInstanceMetadataOperationMetadataPerLocationOperationInfo) MarshalJSON() ([]byte, error) {
+func (s SetCommonInstanceMetadataOperationMetadataPerLocationOperationInfo) MarshalJSON() ([]byte, error) {
type NoMethod SetCommonInstanceMetadataOperationMetadataPerLocationOperationInfo
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// ShareSettings: The share setting for reservations and sole tenancy
-// node groups.
+// ShareSettings: The share setting for reservations and sole tenancy node
+// groups.
type ShareSettings struct {
- // ProjectMap: A map of project id and project config. This is only
- // valid when share_type's value is SPECIFIC_PROJECTS.
+ // ProjectMap: A map of project id and project config. This is only valid when
+ // share_type's value is SPECIFIC_PROJECTS.
ProjectMap map[string]ShareSettingsProjectConfig `json:"projectMap,omitempty"`
-
// ShareType: Type of sharing for this shared-reservation
//
// Possible values:
// "LOCAL" - Default value.
// "ORGANIZATION" - Shared-reservation is open to entire Organization
// "SHARE_TYPE_UNSPECIFIED" - Default value. This value is unused.
- // "SPECIFIC_PROJECTS" - Shared-reservation is open to specific
- // projects
+ // "SPECIFIC_PROJECTS" - Shared-reservation is open to specific projects
ShareType string `json:"shareType,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "ProjectMap") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "ProjectMap") 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. "ProjectMap") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ShareSettings) MarshalJSON() ([]byte, error) {
+func (s ShareSettings) MarshalJSON() ([]byte, error) {
type NoMethod ShareSettings
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// ShareSettingsProjectConfig: Config for each project in the share
-// settings.
+// ShareSettingsProjectConfig: Config for each project in the share settings.
type ShareSettingsProjectConfig struct {
- // ProjectId: The project ID, should be same as the key of this project
- // config in the parent map.
+ // ProjectId: The project ID, should be same as the key of this project config
+ // in the parent map.
ProjectId string `json:"projectId,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "ProjectId") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "ProjectId") 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. "ProjectId") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ShareSettingsProjectConfig) MarshalJSON() ([]byte, error) {
+func (s ShareSettingsProjectConfig) MarshalJSON() ([]byte, error) {
type NoMethod ShareSettingsProjectConfig
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// ShieldedInstanceConfig: A set of Shielded Instance options.
@@ -49962,340 +42039,282 @@ type ShieldedInstanceConfig struct {
// EnableIntegrityMonitoring: Defines whether the instance has integrity
// monitoring enabled. Enabled by default.
EnableIntegrityMonitoring bool `json:"enableIntegrityMonitoring,omitempty"`
-
- // EnableSecureBoot: Defines whether the instance has Secure Boot
- // enabled. Disabled by default.
+ // EnableSecureBoot: Defines whether the instance has Secure Boot enabled.
+ // Disabled by default.
EnableSecureBoot bool `json:"enableSecureBoot,omitempty"`
-
- // EnableVtpm: Defines whether the instance has the vTPM enabled.
- // Enabled by default.
+ // EnableVtpm: Defines whether the instance has the vTPM enabled. Enabled by
+ // default.
EnableVtpm bool `json:"enableVtpm,omitempty"`
-
- // ForceSendFields is a list of field names (e.g.
- // "EnableIntegrityMonitoring") to unconditionally include in API
- // requests. By default, fields with empty or default 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 is a list of field names (e.g. "EnableIntegrityMonitoring")
+ // to unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g.
- // "EnableIntegrityMonitoring") 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. "EnableIntegrityMonitoring") to
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ShieldedInstanceConfig) MarshalJSON() ([]byte, error) {
+func (s ShieldedInstanceConfig) MarshalJSON() ([]byte, error) {
type NoMethod ShieldedInstanceConfig
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// ShieldedInstanceIdentity: A Shielded Instance Identity.
type ShieldedInstanceIdentity struct {
- // EncryptionKey: An Endorsement Key (EK) made by the RSA 2048 algorithm
- // issued to the Shielded Instance's vTPM.
+ // EncryptionKey: An Endorsement Key (EK) made by the RSA 2048 algorithm issued
+ // to the Shielded Instance's vTPM.
EncryptionKey *ShieldedInstanceIdentityEntry `json:"encryptionKey,omitempty"`
-
// Kind: [Output Only] Type of the resource. Always
- // compute#shieldedInstanceIdentity for shielded Instance identity
- // entry.
+ // compute#shieldedInstanceIdentity for shielded Instance identity entry.
Kind string `json:"kind,omitempty"`
-
- // SigningKey: An Attestation Key (AK) made by the RSA 2048 algorithm
- // issued to the Shielded Instance's vTPM.
+ // SigningKey: An Attestation Key (AK) made by the RSA 2048 algorithm issued to
+ // the Shielded Instance's vTPM.
SigningKey *ShieldedInstanceIdentityEntry `json:"signingKey,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
// ForceSendFields is a list of field names (e.g. "EncryptionKey") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "EncryptionKey") 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. "EncryptionKey") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ShieldedInstanceIdentity) MarshalJSON() ([]byte, error) {
+func (s ShieldedInstanceIdentity) MarshalJSON() ([]byte, error) {
type NoMethod ShieldedInstanceIdentity
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// ShieldedInstanceIdentityEntry: A Shielded Instance Identity Entry.
type ShieldedInstanceIdentityEntry struct {
// EkCert: A PEM-encoded X.509 certificate. This field can be empty.
EkCert string `json:"ekCert,omitempty"`
-
// EkPub: A PEM-encoded public key.
EkPub string `json:"ekPub,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "EkCert") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "EkCert") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "EkCert") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ShieldedInstanceIdentityEntry) MarshalJSON() ([]byte, error) {
+func (s ShieldedInstanceIdentityEntry) MarshalJSON() ([]byte, error) {
type NoMethod ShieldedInstanceIdentityEntry
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// ShieldedInstanceIntegrityPolicy: The policy describes the baseline
-// against which Instance boot integrity is measured.
+// ShieldedInstanceIntegrityPolicy: The policy describes the baseline against
+// which Instance boot integrity is measured.
type ShieldedInstanceIntegrityPolicy struct {
- // UpdateAutoLearnPolicy: Updates the integrity policy baseline using
- // the measurements from the VM instance's most recent boot.
+ // UpdateAutoLearnPolicy: Updates the integrity policy baseline using the
+ // measurements from the VM instance's most recent boot.
UpdateAutoLearnPolicy bool `json:"updateAutoLearnPolicy,omitempty"`
-
- // ForceSendFields is a list of field names (e.g.
- // "UpdateAutoLearnPolicy") to unconditionally include in API requests.
- // By default, fields with empty or default 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 is a list of field names (e.g. "UpdateAutoLearnPolicy") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "UpdateAutoLearnPolicy") 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.
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ShieldedInstanceIntegrityPolicy) MarshalJSON() ([]byte, error) {
+func (s ShieldedInstanceIntegrityPolicy) MarshalJSON() ([]byte, error) {
type NoMethod ShieldedInstanceIntegrityPolicy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// SignedUrlKey: Represents a customer-supplied Signing Key used by
-// Cloud CDN Signed URLs
+// SignedUrlKey: Represents a customer-supplied Signing Key used by Cloud CDN
+// Signed URLs
type SignedUrlKey struct {
- // KeyName: Name of the key. The name must be 1-63 characters long, and
- // comply with RFC1035. Specifically, the name must be 1-63 characters
- // long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`
- // which means the first character must be a lowercase letter, and all
- // following characters must be a dash, lowercase letter, or digit,
- // except the last character, which cannot be a dash.
+ // KeyName: Name of the key. The name must be 1-63 characters long, and comply
+ // with RFC1035. Specifically, the name must be 1-63 characters long and match
+ // the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first
+ // character must be a lowercase letter, and all following characters must be a
+ // dash, lowercase letter, or digit, except the last character, which cannot be
+ // a dash.
KeyName string `json:"keyName,omitempty"`
-
- // KeyValue: 128-bit key value used for signing the URL. The key value
- // must be a valid RFC 4648 Section 5 base64url encoded string.
+ // KeyValue: 128-bit key value used for signing the URL. The key value must be
+ // a valid RFC 4648 Section 5 base64url encoded string.
KeyValue string `json:"keyValue,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "KeyName") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "KeyName") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "KeyName") 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. "KeyName") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SignedUrlKey) MarshalJSON() ([]byte, error) {
+func (s SignedUrlKey) MarshalJSON() ([]byte, error) {
type NoMethod SignedUrlKey
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// Snapshot: Represents a Persistent Disk Snapshot resource. You can use
-// snapshots to back up data on a regular interval. For more
-// information, read Creating persistent disk snapshots.
+// snapshots to back up data on a regular interval. For more information, read
+// Creating persistent disk snapshots.
type Snapshot struct {
- // Architecture: [Output Only] The architecture of the snapshot. Valid
- // values are ARM64 or X86_64.
+ // Architecture: [Output Only] The architecture of the snapshot. Valid values
+ // are ARM64 or X86_64.
//
// Possible values:
- // "ARCHITECTURE_UNSPECIFIED" - Default value indicating Architecture
- // is not set.
+ // "ARCHITECTURE_UNSPECIFIED" - Default value indicating Architecture is not
+ // set.
// "ARM64" - Machines with architecture ARM64
// "X86_64" - Machines with architecture X86_64
Architecture string `json:"architecture,omitempty"`
-
// AutoCreated: [Output Only] Set to true if snapshots are automatically
// created by applying resource policy on the target disk.
AutoCreated bool `json:"autoCreated,omitempty"`
-
- // ChainName: Creates the new snapshot in the snapshot chain labeled
- // with the specified name. The chain name must be 1-63 characters long
- // and comply with RFC1035. This is an uncommon option only for advanced
- // service owners who needs to create separate snapshot chains, for
- // example, for chargeback tracking. When you describe your snapshot
- // resource, this field is visible only if it has a non-empty value.
+ // ChainName: Creates the new snapshot in the snapshot chain labeled with the
+ // specified name. The chain name must be 1-63 characters long and comply with
+ // RFC1035. This is an uncommon option only for advanced service owners who
+ // needs to create separate snapshot chains, for example, for chargeback
+ // tracking. When you describe your snapshot resource, this field is visible
+ // only if it has a non-empty value.
ChainName string `json:"chainName,omitempty"`
-
- // CreationSizeBytes: [Output Only] Size in bytes of the snapshot at
- // creation time.
+ // CreationSizeBytes: [Output Only] Size in bytes of the snapshot at creation
+ // time.
CreationSizeBytes int64 `json:"creationSizeBytes,omitempty,string"`
-
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
// DiskSizeGb: [Output Only] Size of the source disk, specified in GB.
DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
-
// DownloadBytes: [Output Only] Number of bytes downloaded to restore a
// snapshot to a disk.
DownloadBytes int64 `json:"downloadBytes,omitempty,string"`
-
// EnableConfidentialCompute: Whether this snapshot is created from a
- // confidential compute mode disk. [Output Only]: This field is not set
- // by user, but from source disk.
+ // confidential compute mode disk. [Output Only]: This field is not set by
+ // user, but from source disk.
EnableConfidentialCompute bool `json:"enableConfidentialCompute,omitempty"`
-
- // GuestOsFeatures: [Output Only] A list of features to enable on the
- // guest operating system. Applicable only for bootable images. Read
- // Enabling guest operating system features to see a list of available
- // options.
+ // GuestOsFeatures: [Output Only] A list of features to enable on the guest
+ // operating system. Applicable only for bootable images. Read Enabling guest
+ // operating system features to see a list of available options.
GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
// Kind: [Output Only] Type of the resource. Always compute#snapshot for
// Snapshot resources.
Kind string `json:"kind,omitempty"`
-
// LabelFingerprint: A fingerprint for the labels being applied to this
- // snapshot, which is essentially a hash of the labels set used for
- // optimistic locking. The fingerprint is initially generated by Compute
- // Engine and changes after every request to modify or update labels.
- // You must always provide an up-to-date fingerprint hash in order to
- // update or change labels, otherwise the request will fail with error
- // 412 conditionNotMet. To see the latest fingerprint, make a get()
- // request to retrieve a snapshot.
+ // snapshot, which is essentially a hash of the labels set used for optimistic
+ // locking. The fingerprint is initially generated by Compute Engine and
+ // changes after every request to modify or update labels. You must always
+ // provide an up-to-date fingerprint hash in order to update or change labels,
+ // otherwise the request will fail with error 412 conditionNotMet. To see the
+ // latest fingerprint, make a get() request to retrieve a snapshot.
LabelFingerprint string `json:"labelFingerprint,omitempty"`
-
- // Labels: Labels to apply to this snapshot. These can be later modified
- // by the setLabels method. Label values may be empty.
+ // Labels: Labels to apply to this snapshot. These can be later modified by the
+ // setLabels method. Label values may be empty.
Labels map[string]string `json:"labels,omitempty"`
-
- // LicenseCodes: [Output Only] Integer license codes indicating which
- // licenses are attached to this snapshot.
+ // LicenseCodes: [Output Only] Integer license codes indicating which licenses
+ // are attached to this snapshot.
LicenseCodes googleapi.Int64s `json:"licenseCodes,omitempty"`
-
- // Licenses: [Output Only] A list of public visible licenses that apply
- // to this snapshot. This can be because the original image had licenses
- // attached (such as a Windows image).
+ // Licenses: [Output Only] A list of public visible licenses that apply to this
+ // snapshot. This can be because the original image had licenses attached (such
+ // as a Windows image).
Licenses []string `json:"licenses,omitempty"`
-
- // LocationHint: An opaque location hint used to place the snapshot
- // close to other resources. This field is for use by internal tools
- // that use the public API.
+ // LocationHint: An opaque location hint used to place the snapshot close to
+ // other resources. This field is for use by internal tools that use the public
+ // API.
LocationHint string `json:"locationHint,omitempty"`
-
- // Name: Name of the resource; provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
- // the first character must be a lowercase letter, and all following
- // characters must be a dash, lowercase letter, or digit, except the
- // last character, which cannot be a dash.
+ // Name: Name of the resource; provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must
+ // be a lowercase letter, and all following characters must be a dash,
+ // lowercase letter, or digit, except the last character, which cannot be a
+ // dash.
Name string `json:"name,omitempty"`
-
// SatisfiesPzi: Output only. Reserved for future use.
SatisfiesPzi bool `json:"satisfiesPzi,omitempty"`
-
// SatisfiesPzs: [Output Only] Reserved for future use.
SatisfiesPzs bool `json:"satisfiesPzs,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // SnapshotEncryptionKey: Encrypts the snapshot using a
- // customer-supplied encryption key. After you encrypt a snapshot using
- // a customer-supplied key, you must provide the same key if you use the
- // snapshot later. For example, you must provide the encryption key when
- // you create a disk from the encrypted snapshot in a future request.
- // Customer-supplied encryption keys do not protect access to metadata
- // of the snapshot. If you do not provide an encryption key when
- // creating the snapshot, then the snapshot will be encrypted using an
- // automatically generated key and you do not need to provide a key to
- // use the snapshot later.
+ // SnapshotEncryptionKey: Encrypts the snapshot using a customer-supplied
+ // encryption key. After you encrypt a snapshot using a customer-supplied key,
+ // you must provide the same key if you use the snapshot later. For example,
+ // you must provide the encryption key when you create a disk from the
+ // encrypted snapshot in a future request. Customer-supplied encryption keys do
+ // not protect access to metadata of the snapshot. If you do not provide an
+ // encryption key when creating the snapshot, then the snapshot will be
+ // encrypted using an automatically generated key and you do not need to
+ // provide a key to use the snapshot later.
SnapshotEncryptionKey *CustomerEncryptionKey `json:"snapshotEncryptionKey,omitempty"`
-
// SnapshotType: Indicates the type of the snapshot.
//
// Possible values:
// "ARCHIVE"
// "STANDARD"
SnapshotType string `json:"snapshotType,omitempty"`
-
// SourceDisk: The source disk used to create this snapshot.
SourceDisk string `json:"sourceDisk,omitempty"`
-
- // SourceDiskEncryptionKey: The customer-supplied encryption key of the
- // source disk. Required if the source disk is protected by a
- // customer-supplied encryption key.
+ // SourceDiskEncryptionKey: The customer-supplied encryption key of the source
+ // disk. Required if the source disk is protected by a customer-supplied
+ // encryption key.
SourceDiskEncryptionKey *CustomerEncryptionKey `json:"sourceDiskEncryptionKey,omitempty"`
-
- // SourceDiskForRecoveryCheckpoint: The source disk whose recovery
- // checkpoint will be used to create this snapshot.
+ // SourceDiskForRecoveryCheckpoint: The source disk whose recovery checkpoint
+ // will be used to create this snapshot.
SourceDiskForRecoveryCheckpoint string `json:"sourceDiskForRecoveryCheckpoint,omitempty"`
-
- // SourceDiskId: [Output Only] The ID value of the disk used to create
- // this snapshot. This value may be used to determine whether the
- // snapshot was taken from the current or a previous instance of a given
- // disk name.
+ // SourceDiskId: [Output Only] The ID value of the disk used to create this
+ // snapshot. This value may be used to determine whether the snapshot was taken
+ // from the current or a previous instance of a given disk name.
SourceDiskId string `json:"sourceDiskId,omitempty"`
-
- // SourceSnapshotSchedulePolicy: [Output Only] URL of the resource
- // policy which created this scheduled snapshot.
+ // SourceInstantSnapshot: The source instant snapshot used to create this
+ // snapshot. You can provide this as a partial or full URL to the resource. For
+ // example, the following are valid values: -
+ // https://www.googleapis.com/compute/v1/projects/project/zones/zone
+ // /instantSnapshots/instantSnapshot -
+ // projects/project/zones/zone/instantSnapshots/instantSnapshot -
+ // zones/zone/instantSnapshots/instantSnapshot
+ SourceInstantSnapshot string `json:"sourceInstantSnapshot,omitempty"`
+ // SourceInstantSnapshotEncryptionKey: Customer provided encryption key when
+ // creating Snapshot from Instant Snapshot.
+ SourceInstantSnapshotEncryptionKey *CustomerEncryptionKey `json:"sourceInstantSnapshotEncryptionKey,omitempty"`
+ // SourceInstantSnapshotId: [Output Only] The unique ID of the instant snapshot
+ // used to create this snapshot. This value identifies the exact instant
+ // snapshot that was used to create this persistent disk. For example, if you
+ // created the persistent disk from an instant snapshot that was later deleted
+ // and recreated under the same name, the source instant snapshot ID would
+ // identify the exact instant snapshot that was used.
+ SourceInstantSnapshotId string `json:"sourceInstantSnapshotId,omitempty"`
+ // SourceSnapshotSchedulePolicy: [Output Only] URL of the resource policy which
+ // created this scheduled snapshot.
SourceSnapshotSchedulePolicy string `json:"sourceSnapshotSchedulePolicy,omitempty"`
-
- // SourceSnapshotSchedulePolicyId: [Output Only] ID of the resource
- // policy which created this scheduled snapshot.
+ // SourceSnapshotSchedulePolicyId: [Output Only] ID of the resource policy
+ // which created this scheduled snapshot.
SourceSnapshotSchedulePolicyId string `json:"sourceSnapshotSchedulePolicyId,omitempty"`
-
- // Status: [Output Only] The status of the snapshot. This can be
- // CREATING, DELETING, FAILED, READY, or UPLOADING.
+ // Status: [Output Only] The status of the snapshot. This can be CREATING,
+ // DELETING, FAILED, READY, or UPLOADING.
//
// Possible values:
// "CREATING" - Snapshot creation is in progress.
@@ -50304,603 +42323,477 @@ type Snapshot struct {
// "READY" - Snapshot has been created successfully.
// "UPLOADING" - Snapshot is being uploaded.
Status string `json:"status,omitempty"`
-
- // StorageBytes: [Output Only] A size of the storage used by the
- // snapshot. As snapshots share storage, this number is expected to
- // change with snapshot creation/deletion.
+ // StorageBytes: [Output Only] A size of the storage used by the snapshot. As
+ // snapshots share storage, this number is expected to change with snapshot
+ // creation/deletion.
StorageBytes int64 `json:"storageBytes,omitempty,string"`
-
- // StorageBytesStatus: [Output Only] An indicator whether storageBytes
- // is in a stable state or it is being adjusted as a result of shared
- // storage reallocation. This status can either be UPDATING, meaning the
- // size of the snapshot is being updated, or UP_TO_DATE, meaning the
- // size of the snapshot is up-to-date.
+ // StorageBytesStatus: [Output Only] An indicator whether storageBytes is in a
+ // stable state or it is being adjusted as a result of shared storage
+ // reallocation. This status can either be UPDATING, meaning the size of the
+ // snapshot is being updated, or UP_TO_DATE, meaning the size of the snapshot
+ // is up-to-date.
//
// Possible values:
// "UPDATING"
// "UP_TO_DATE"
StorageBytesStatus string `json:"storageBytesStatus,omitempty"`
-
- // StorageLocations: Cloud Storage bucket storage location of the
- // snapshot (regional or multi-regional).
+ // StorageLocations: Cloud Storage bucket storage location of the snapshot
+ // (regional or multi-regional).
StorageLocations []string `json:"storageLocations,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
// ForceSendFields is a list of field names (e.g. "Architecture") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Architecture") 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. "Architecture") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *Snapshot) MarshalJSON() ([]byte, error) {
+func (s Snapshot) MarshalJSON() ([]byte, error) {
type NoMethod Snapshot
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// SnapshotList: Contains a list of Snapshot resources.
type SnapshotList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of Snapshot resources.
Items []*Snapshot `json:"items,omitempty"`
-
// Kind: Type of resource.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *SnapshotListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SnapshotList) MarshalJSON() ([]byte, error) {
+func (s SnapshotList) MarshalJSON() ([]byte, error) {
type NoMethod SnapshotList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// SnapshotListWarning: [Output Only] Informational warning message.
type SnapshotListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*SnapshotListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SnapshotListWarning) MarshalJSON() ([]byte, error) {
+func (s SnapshotListWarning) MarshalJSON() ([]byte, error) {
type NoMethod SnapshotListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SnapshotListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SnapshotListWarningData) MarshalJSON() ([]byte, error) {
+func (s SnapshotListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod SnapshotListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SnapshotSettings struct {
- // StorageLocation: Policy of which storage location is going to be
- // resolved, and additional data that particularizes how the policy is
- // going to be carried out.
+ // StorageLocation: Policy of which storage location is going to be resolved,
+ // and additional data that particularizes how the policy is going to be
+ // carried out.
StorageLocation *SnapshotSettingsStorageLocationSettings `json:"storageLocation,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
// ForceSendFields is a list of field names (e.g. "StorageLocation") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "StorageLocation") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "StorageLocation") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SnapshotSettings) MarshalJSON() ([]byte, error) {
+func (s SnapshotSettings) MarshalJSON() ([]byte, error) {
type NoMethod SnapshotSettings
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SnapshotSettingsStorageLocationSettings struct {
- // Locations: When the policy is SPECIFIC_LOCATIONS, snapshots will be
- // stored in the locations listed in this field. Keys are GCS bucket
- // locations.
+ // Locations: When the policy is SPECIFIC_LOCATIONS, snapshots will be stored
+ // in the locations listed in this field. Keys are Cloud Storage bucket
+ // locations. Only one location can be specified.
Locations map[string]SnapshotSettingsStorageLocationSettingsStorageLocationPreference `json:"locations,omitempty"`
-
// Policy: The chosen location policy.
//
// Possible values:
- // "LOCAL_REGION" - Store snapshot in the same region as with the
- // originating disk. No additional parameters are needed.
- // "NEAREST_MULTI_REGION" - Store snapshot to the nearest multi region
- // GCS bucket, relative to the originating disk. No additional
- // parameters are needed.
+ // "LOCAL_REGION" - Store snapshot in the same region as with the originating
+ // disk. No additional parameters are needed.
+ // "NEAREST_MULTI_REGION" - Store snapshot in the nearest multi region Cloud
+ // Storage bucket, relative to the originating disk. No additional parameters
+ // are needed.
// "SPECIFIC_LOCATIONS" - Store snapshot in the specific locations, as
- // specified by the user. The list of regions to store must be defined
- // under the `locations` field.
+ // specified by the user. The list of regions to store must be defined under
+ // the `locations` field.
// "STORAGE_LOCATION_POLICY_UNSPECIFIED"
Policy string `json:"policy,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Locations") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Locations") 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. "Locations") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SnapshotSettingsStorageLocationSettings) MarshalJSON() ([]byte, error) {
+func (s SnapshotSettingsStorageLocationSettings) MarshalJSON() ([]byte, error) {
type NoMethod SnapshotSettingsStorageLocationSettings
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// SnapshotSettingsStorageLocationSettingsStorageLocationPreference: A
// structure for specifying storage locations.
type SnapshotSettingsStorageLocationSettingsStorageLocationPreference struct {
- // Name: Name of the location. It should be one of the GCS buckets.
+ // Name: Name of the location. It should be one of the Cloud Storage buckets.
+ // Only one location can be specified.
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 or default 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 is a list of field names (e.g. "Name") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
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 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. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SnapshotSettingsStorageLocationSettingsStorageLocationPreference) MarshalJSON() ([]byte, error) {
+func (s SnapshotSettingsStorageLocationSettingsStorageLocationPreference) MarshalJSON() ([]byte, error) {
type NoMethod SnapshotSettingsStorageLocationSettingsStorageLocationPreference
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SourceDiskEncryptionKey struct {
- // DiskEncryptionKey: The customer-supplied encryption key of the source
- // disk. Required if the source disk is protected by a customer-supplied
- // encryption key.
+ // DiskEncryptionKey: The customer-supplied encryption key of the source disk.
+ // Required if the source disk is protected by a customer-supplied encryption
+ // key.
DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
-
- // SourceDisk: URL of the disk attached to the source instance. This can
- // be a full or valid partial URL. For example, the following are valid
- // values: -
+ // SourceDisk: URL of the disk attached to the source instance. This can be a
+ // full or valid partial URL. For example, the following are valid values: -
// https://www.googleapis.com/compute/v1/projects/project/zones/zone
- // /disks/disk - projects/project/zones/zone/disks/disk -
- // zones/zone/disks/disk
+ // /disks/disk - projects/project/zones/zone/disks/disk - zones/zone/disks/disk
SourceDisk string `json:"sourceDisk,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "DiskEncryptionKey")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "DiskEncryptionKey") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "DiskEncryptionKey") 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. "DiskEncryptionKey") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SourceDiskEncryptionKey) MarshalJSON() ([]byte, error) {
+func (s SourceDiskEncryptionKey) MarshalJSON() ([]byte, error) {
type NoMethod SourceDiskEncryptionKey
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// SourceInstanceParams: A specification of the parameters to use when
-// creating the instance template from a source instance.
+// SourceInstanceParams: A specification of the parameters to use when creating
+// the instance template from a source instance.
type SourceInstanceParams struct {
- // DiskConfigs: Attached disks configuration. If not provided, defaults
- // are applied: For boot disk and any other R/W disks, the source images
- // for each disk will be used. For read-only disks, they will be
- // attached in read-only mode. Local SSD disks will be created as blank
- // volumes.
+ // DiskConfigs: Attached disks configuration. If not provided, defaults are
+ // applied: For boot disk and any other R/W disks, the source images for each
+ // disk will be used. For read-only disks, they will be attached in read-only
+ // mode. Local SSD disks will be created as blank volumes.
DiskConfigs []*DiskInstantiationConfig `json:"diskConfigs,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "DiskConfigs") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "DiskConfigs") 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. "DiskConfigs") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SourceInstanceParams) MarshalJSON() ([]byte, error) {
+func (s SourceInstanceParams) MarshalJSON() ([]byte, error) {
type NoMethod SourceInstanceParams
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// SourceInstanceProperties: DEPRECATED: Please use
-// compute#instanceProperties instead. New properties will not be added
-// to this field.
+// SourceInstanceProperties: DEPRECATED: Please use compute#instanceProperties
+// instead. New properties will not be added to this field.
type SourceInstanceProperties struct {
- // CanIpForward: Enables instances created based on this machine image
- // to send packets with source IP addresses other than their own and
- // receive packets with destination IP addresses other than their own.
- // If these instances will be used as an IP gateway or it will be set as
- // the next-hop in a Route resource, specify true. If unsure, leave this
- // set to false. See the Enable IP forwarding documentation for more
- // information.
+ // CanIpForward: Enables instances created based on this machine image to send
+ // packets with source IP addresses other than their own and receive packets
+ // with destination IP addresses other than their own. If these instances will
+ // be used as an IP gateway or it will be set as the next-hop in a Route
+ // resource, specify true. If unsure, leave this set to false. See the Enable
+ // IP forwarding documentation for more information.
CanIpForward bool `json:"canIpForward,omitempty"`
-
- // DeletionProtection: Whether the instance created from this machine
- // image should be protected against deletion.
+ // DeletionProtection: Whether the instance created from this machine image
+ // should be protected against deletion.
DeletionProtection bool `json:"deletionProtection,omitempty"`
-
- // Description: An optional text description for the instances that are
- // created from this machine image.
+ // Description: An optional text description for the instances that are created
+ // from this machine image.
Description string `json:"description,omitempty"`
-
- // Disks: An array of disks that are associated with the instances that
- // are created from this machine image.
+ // Disks: An array of disks that are associated with the instances that are
+ // created from this machine image.
Disks []*SavedAttachedDisk `json:"disks,omitempty"`
-
- // GuestAccelerators: A list of guest accelerator cards' type and count
- // to use for instances created from this machine image.
+ // GuestAccelerators: A list of guest accelerator cards' type and count to use
+ // for instances created from this machine image.
GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
-
- // KeyRevocationActionType: KeyRevocationActionType of the instance.
- // Supported options are "STOP" and "NONE". The default value is "NONE"
- // if it is not specified.
+ // KeyRevocationActionType: KeyRevocationActionType of the instance. Supported
+ // options are "STOP" and "NONE". The default value is "NONE" if it is not
+ // specified.
//
// Possible values:
- // "KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED" - Default value. This
- // value is unused.
+ // "KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED" - Default value. This value is
+ // unused.
// "NONE" - Indicates user chose no operation.
- // "STOP" - Indicates user chose to opt for VM shutdown on key
- // revocation.
+ // "STOP" - Indicates user chose to opt for VM shutdown on key revocation.
KeyRevocationActionType string `json:"keyRevocationActionType,omitempty"`
-
- // Labels: Labels to apply to instances that are created from this
- // machine image.
+ // Labels: Labels to apply to instances that are created from this machine
+ // image.
Labels map[string]string `json:"labels,omitempty"`
-
- // MachineType: The machine type to use for instances that are created
- // from this machine image.
+ // MachineType: The machine type to use for instances that are created from
+ // this machine image.
MachineType string `json:"machineType,omitempty"`
-
- // Metadata: The metadata key/value pairs to assign to instances that
- // are created from this machine image. These pairs can consist of
- // custom metadata or predefined keys. See Project and instance metadata
- // for more information.
+ // Metadata: The metadata key/value pairs to assign to instances that are
+ // created from this machine image. These pairs can consist of custom metadata
+ // or predefined keys. See Project and instance metadata for more information.
Metadata *Metadata `json:"metadata,omitempty"`
-
- // MinCpuPlatform: Minimum cpu/platform to be used by instances created
- // from this machine image. The instance may be scheduled on the
- // specified or newer cpu/platform. Applicable values are the friendly
- // names of CPU platforms, such as minCpuPlatform: "Intel Haswell" or
- // minCpuPlatform: "Intel Sandy Bridge". For more information, read
- // Specifying a Minimum CPU Platform.
+ // MinCpuPlatform: Minimum cpu/platform to be used by instances created from
+ // this machine image. The instance may be scheduled on the specified or newer
+ // cpu/platform. Applicable values are the friendly names of CPU platforms,
+ // such as minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy
+ // Bridge". For more information, read Specifying a Minimum CPU Platform.
MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
-
// NetworkInterfaces: An array of network access configurations for this
// interface.
NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"`
-
- // Scheduling: Specifies the scheduling options for the instances that
- // are created from this machine image.
+ // Scheduling: Specifies the scheduling options for the instances that are
+ // created from this machine image.
Scheduling *Scheduling `json:"scheduling,omitempty"`
-
- // ServiceAccounts: A list of service accounts with specified scopes.
- // Access tokens for these service accounts are available to the
- // instances that are created from this machine image. Use metadata
- // queries to obtain the access tokens for these instances.
+ // ServiceAccounts: A list of service accounts with specified scopes. Access
+ // tokens for these service accounts are available to the instances that are
+ // created from this machine image. Use metadata queries to obtain the access
+ // tokens for these instances.
ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"`
-
- // Tags: A list of tags to apply to the instances that are created from
- // this machine image. The tags identify valid sources or targets for
- // network firewalls. The setTags method can modify this list of tags.
- // Each tag within the list must comply with RFC1035.
+ // Tags: A list of tags to apply to the instances that are created from this
+ // machine image. The tags identify valid sources or targets for network
+ // firewalls. The setTags method can modify this list of tags. Each tag within
+ // the list must comply with RFC1035.
Tags *Tags `json:"tags,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "CanIpForward") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CanIpForward") 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. "CanIpForward") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SourceInstanceProperties) MarshalJSON() ([]byte, error) {
+func (s SourceInstanceProperties) MarshalJSON() ([]byte, error) {
type NoMethod SourceInstanceProperties
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// SslCertificate: Represents an SSL certificate resource. Google
-// Compute Engine has two SSL certificate resources: * Global
+// SslCertificate: Represents an SSL certificate resource. Google Compute
+// Engine has two SSL certificate resources: * Global
// (/compute/docs/reference/rest/v1/sslCertificates) * Regional
-// (/compute/docs/reference/rest/v1/regionSslCertificates) The global
-// SSL certificates (sslCertificates) are used by: - Global external
-// Application Load Balancers - Classic Application Load Balancers -
-// Proxy Network Load Balancers (with target SSL proxies) The regional
-// SSL certificates (regionSslCertificates) are used by: - Regional
-// external Application Load Balancers - Regional internal Application
-// Load Balancers Optionally, certificate file contents that you upload
-// can contain a set of up to five PEM-encoded certificates. The API
-// call creates an object (sslCertificate) that holds this data. You can
-// use SSL keys and certificates to secure connections to a load
-// balancer. For more information, read Creating and using SSL
-// certificates, SSL certificates quotas and limits, and Troubleshooting
-// SSL certificates.
+// (/compute/docs/reference/rest/v1/regionSslCertificates) The global SSL
+// certificates (sslCertificates) are used by: - Global external Application
+// Load Balancers - Classic Application Load Balancers - Proxy Network Load
+// Balancers (with target SSL proxies) The regional SSL certificates
+// (regionSslCertificates) are used by: - Regional external Application Load
+// Balancers - Regional internal Application Load Balancers Optionally,
+// certificate file contents that you upload can contain a set of up to five
+// PEM-encoded certificates. The API call creates an object (sslCertificate)
+// that holds this data. You can use SSL keys and certificates to secure
+// connections to a load balancer. For more information, read Creating and
+// using SSL certificates, SSL certificates quotas and limits, and
+// Troubleshooting SSL certificates.
type SslCertificate struct {
// Certificate: A value read into memory from a certificate file. The
- // certificate file must be in PEM format. The certificate chain must be
- // no greater than 5 certs long. The chain must include at least one
- // intermediate cert.
+ // certificate file must be in PEM format. The certificate chain must be no
+ // greater than 5 certs long. The chain must include at least one intermediate
+ // cert.
Certificate string `json:"certificate,omitempty"`
-
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
// ExpireTime: [Output Only] Expire time of the certificate. RFC3339
ExpireTime string `json:"expireTime,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
- // Kind: [Output Only] Type of the resource. Always
- // compute#sslCertificate for SSL certificates.
+ // Kind: [Output Only] Type of the resource. Always compute#sslCertificate for
+ // SSL certificates.
Kind string `json:"kind,omitempty"`
-
// Managed: Configuration and status of a managed SSL certificate.
Managed *SslCertificateManagedSslCertificate `json:"managed,omitempty"`
-
- // Name: Name of the resource. Provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
- // the first character must be a lowercase letter, and all following
- // characters must be a dash, lowercase letter, or digit, except the
- // last character, which cannot be a dash.
+ // Name: Name of the resource. Provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must
+ // be a lowercase letter, and all following characters must be a dash,
+ // lowercase letter, or digit, except the last character, which cannot be a
+ // dash.
Name string `json:"name,omitempty"`
-
- // PrivateKey: A value read into memory from a write-only private key
- // file. The private key file must be in PEM format. For security, only
- // insert requests include this field.
+ // PrivateKey: A value read into memory from a write-only private key file. The
+ // private key file must be in PEM format. For security, only insert requests
+ // include this field.
PrivateKey string `json:"privateKey,omitempty"`
-
- // Region: [Output Only] URL of the region where the regional SSL
- // Certificate resides. This field is not applicable to global SSL
- // Certificate.
+ // Region: [Output Only] URL of the region where the regional SSL Certificate
+ // resides. This field is not applicable to global SSL Certificate.
Region string `json:"region,omitempty"`
-
// SelfLink: [Output only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // SelfManaged: Configuration and status of a self-managed SSL
- // certificate.
+ // SelfManaged: Configuration and status of a self-managed SSL certificate.
SelfManaged *SslCertificateSelfManagedSslCertificate `json:"selfManaged,omitempty"`
-
// SubjectAlternativeNames: [Output Only] Domains associated with the
// certificate via Subject Alternative Name.
SubjectAlternativeNames []string `json:"subjectAlternativeNames,omitempty"`
-
// Type: (Optional) Specifies the type of SSL certificate, either
// "SELF_MANAGED" or "MANAGED". If not specified, the certificate is
// self-managed and the fields certificate and private_key are used.
@@ -50911,7249 +42804,7178 @@ type SslCertificate struct {
// "TYPE_UNSPECIFIED"
Type string `json:"type,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
// ForceSendFields is a list of field names (e.g. "Certificate") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Certificate") 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. "Certificate") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SslCertificate) MarshalJSON() ([]byte, error) {
+func (s SslCertificate) MarshalJSON() ([]byte, error) {
type NoMethod SslCertificate
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SslCertificateAggregatedList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of SslCertificatesScopedList resources.
Items map[string]SslCertificatesScopedList `json:"items,omitempty"`
-
// Kind: [Output Only] Type of resource. Always
// compute#sslCertificateAggregatedList for lists of SSL Certificates.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Unreachables: [Output Only] Unreachable resources.
Unreachables []string `json:"unreachables,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *SslCertificateAggregatedListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SslCertificateAggregatedList) MarshalJSON() ([]byte, error) {
+func (s SslCertificateAggregatedList) MarshalJSON() ([]byte, error) {
type NoMethod SslCertificateAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// SslCertificateAggregatedListWarning: [Output Only] Informational
-// warning message.
+// SslCertificateAggregatedListWarning: [Output Only] Informational warning
+// message.
type SslCertificateAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*SslCertificateAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SslCertificateAggregatedListWarning) MarshalJSON() ([]byte, error) {
+func (s SslCertificateAggregatedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod SslCertificateAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SslCertificateAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SslCertificateAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+func (s SslCertificateAggregatedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod SslCertificateAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// SslCertificateList: Contains a list of SslCertificate resources.
type SslCertificateList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of SslCertificate resources.
Items []*SslCertificate `json:"items,omitempty"`
-
// Kind: Type of resource.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *SslCertificateListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SslCertificateList) MarshalJSON() ([]byte, error) {
+func (s SslCertificateList) MarshalJSON() ([]byte, error) {
type NoMethod SslCertificateList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// SslCertificateListWarning: [Output Only] Informational warning
-// message.
+// SslCertificateListWarning: [Output Only] Informational warning message.
type SslCertificateListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*SslCertificateListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SslCertificateListWarning) MarshalJSON() ([]byte, error) {
+func (s SslCertificateListWarning) MarshalJSON() ([]byte, error) {
type NoMethod SslCertificateListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SslCertificateListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SslCertificateListWarningData) MarshalJSON() ([]byte, error) {
+func (s SslCertificateListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod SslCertificateListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// SslCertificateManagedSslCertificate: Configuration and status of a
-// managed SSL certificate.
+// SslCertificateManagedSslCertificate: Configuration and status of a managed
+// SSL certificate.
type SslCertificateManagedSslCertificate struct {
- // DomainStatus: [Output only] Detailed statuses of the domains
- // specified for managed certificate resource.
+ // DomainStatus: [Output only] Detailed statuses of the domains specified for
+ // managed certificate resource.
DomainStatus map[string]string `json:"domainStatus,omitempty"`
-
- // Domains: The domains for which a managed SSL certificate will be
- // generated. Each Google-managed SSL certificate supports up to the
- // maximum number of domains per Google-managed SSL certificate
+ // Domains: The domains for which a managed SSL certificate will be generated.
+ // Each Google-managed SSL certificate supports up to the maximum number of
+ // domains per Google-managed SSL certificate
// (/load-balancing/docs/quotas#ssl_certificates).
Domains []string `json:"domains,omitempty"`
-
// Status: [Output only] Status of the managed certificate resource.
//
// Possible values:
- // "ACTIVE" - The certificate management is working, and a certificate
- // has been provisioned.
+ // "ACTIVE" - The certificate management is working, and a certificate has
+ // been provisioned.
// "MANAGED_CERTIFICATE_STATUS_UNSPECIFIED"
- // "PROVISIONING" - The certificate management is working. GCP will
- // attempt to provision the first certificate.
- // "PROVISIONING_FAILED" - Certificate provisioning failed due to an
- // issue with the DNS or load balancing configuration. For details of
- // which domain failed, consult domain_status field.
- // "PROVISIONING_FAILED_PERMANENTLY" - Certificate provisioning failed
- // due to an issue with the DNS or load balancing configuration. It
- // won't be retried. To try again delete and create a new managed
- // SslCertificate resource. For details of which domain failed, consult
- // domain_status field.
- // "RENEWAL_FAILED" - Renewal of the certificate has failed due to an
- // issue with the DNS or load balancing configuration. The existing cert
- // is still serving; however, it will expire shortly. To provision a
- // renewed certificate, delete and create a new managed SslCertificate
- // resource. For details on which domain failed, consult domain_status
- // field.
+ // "PROVISIONING" - The certificate management is working. GCP will attempt
+ // to provision the first certificate.
+ // "PROVISIONING_FAILED" - Certificate provisioning failed due to an issue
+ // with the DNS or load balancing configuration. For details of which domain
+ // failed, consult domain_status field.
+ // "PROVISIONING_FAILED_PERMANENTLY" - Certificate provisioning failed due to
+ // an issue with the DNS or load balancing configuration. It won't be retried.
+ // To try again delete and create a new managed SslCertificate resource. For
+ // details of which domain failed, consult domain_status field.
+ // "RENEWAL_FAILED" - Renewal of the certificate has failed due to an issue
+ // with the DNS or load balancing configuration. The existing cert is still
+ // serving; however, it will expire shortly. To provision a renewed
+ // certificate, delete and create a new managed SslCertificate resource. For
+ // details on which domain failed, consult domain_status field.
Status string `json:"status,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "DomainStatus") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "DomainStatus") 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. "DomainStatus") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SslCertificateManagedSslCertificate) MarshalJSON() ([]byte, error) {
+func (s SslCertificateManagedSslCertificate) MarshalJSON() ([]byte, error) {
type NoMethod SslCertificateManagedSslCertificate
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// SslCertificateSelfManagedSslCertificate: Configuration and status of
-// a self-managed SSL certificate.
+// SslCertificateSelfManagedSslCertificate: Configuration and status of a
+// self-managed SSL certificate.
type SslCertificateSelfManagedSslCertificate struct {
// Certificate: A local certificate file. The certificate must be in PEM
- // format. The certificate chain must be no greater than 5 certs long.
- // The chain must include at least one intermediate cert.
+ // format. The certificate chain must be no greater than 5 certs long. The
+ // chain must include at least one intermediate cert.
Certificate string `json:"certificate,omitempty"`
-
- // PrivateKey: A write-only private key in PEM format. Only insert
- // requests will include this field.
+ // PrivateKey: A write-only private key in PEM format. Only insert requests
+ // will include this field.
PrivateKey string `json:"privateKey,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Certificate") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Certificate") 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. "Certificate") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SslCertificateSelfManagedSslCertificate) MarshalJSON() ([]byte, error) {
+func (s SslCertificateSelfManagedSslCertificate) MarshalJSON() ([]byte, error) {
type NoMethod SslCertificateSelfManagedSslCertificate
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SslCertificatesScopedList struct {
// SslCertificates: List of SslCertificates contained in this scope.
SslCertificates []*SslCertificate `json:"sslCertificates,omitempty"`
-
- // Warning: Informational warning which replaces the list of backend
- // services when the list is empty.
+ // Warning: Informational warning which replaces the list of backend services
+ // when the list is empty.
Warning *SslCertificatesScopedListWarning `json:"warning,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "SslCertificates") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "SslCertificates") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "SslCertificates") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SslCertificatesScopedList) MarshalJSON() ([]byte, error) {
+func (s SslCertificatesScopedList) MarshalJSON() ([]byte, error) {
type NoMethod SslCertificatesScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// SslCertificatesScopedListWarning: Informational warning which
-// replaces the list of backend services when the list is empty.
+// SslCertificatesScopedListWarning: Informational warning which replaces the
+// list of backend services when the list is empty.
type SslCertificatesScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*SslCertificatesScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SslCertificatesScopedListWarning) MarshalJSON() ([]byte, error) {
+func (s SslCertificatesScopedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod SslCertificatesScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SslCertificatesScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SslCertificatesScopedListWarningData) MarshalJSON() ([]byte, error) {
+func (s SslCertificatesScopedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod SslCertificatesScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SslPoliciesAggregatedList struct {
Etag string `json:"etag,omitempty"`
-
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of SslPoliciesScopedList resources.
Items map[string]SslPoliciesScopedList `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource. Always
- // compute#sslPolicyAggregatedList for lists of SSL Policies.
+ // Kind: [Output Only] Type of resource. Always compute#sslPolicyAggregatedList
+ // for lists of SSL Policies.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Unreachables: [Output Only] Unreachable resources.
Unreachables []string `json:"unreachables,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *SslPoliciesAggregatedListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Etag") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Etag") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Etag") 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. "Etag") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SslPoliciesAggregatedList) MarshalJSON() ([]byte, error) {
+func (s SslPoliciesAggregatedList) MarshalJSON() ([]byte, error) {
type NoMethod SslPoliciesAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// SslPoliciesAggregatedListWarning: [Output Only] Informational warning
// message.
type SslPoliciesAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*SslPoliciesAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SslPoliciesAggregatedListWarning) MarshalJSON() ([]byte, error) {
+func (s SslPoliciesAggregatedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod SslPoliciesAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SslPoliciesAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SslPoliciesAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+func (s SslPoliciesAggregatedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod SslPoliciesAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SslPoliciesList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of SslPolicy resources.
Items []*SslPolicy `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of the resource. Always
- // compute#sslPoliciesList for lists of sslPolicies.
+ // Kind: [Output Only] Type of the resource. Always compute#sslPoliciesList for
+ // lists of sslPolicies.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *SslPoliciesListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SslPoliciesList) MarshalJSON() ([]byte, error) {
+func (s SslPoliciesList) MarshalJSON() ([]byte, error) {
type NoMethod SslPoliciesList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// SslPoliciesListWarning: [Output Only] Informational warning message.
type SslPoliciesListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*SslPoliciesListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SslPoliciesListWarning) MarshalJSON() ([]byte, error) {
+func (s SslPoliciesListWarning) MarshalJSON() ([]byte, error) {
type NoMethod SslPoliciesListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SslPoliciesListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SslPoliciesListWarningData) MarshalJSON() ([]byte, error) {
+func (s SslPoliciesListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod SslPoliciesListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SslPoliciesListAvailableFeaturesResponse struct {
Features []string `json:"features,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
// ForceSendFields is a list of field names (e.g. "Features") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Features") 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. "Features") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SslPoliciesListAvailableFeaturesResponse) MarshalJSON() ([]byte, error) {
+func (s SslPoliciesListAvailableFeaturesResponse) MarshalJSON() ([]byte, error) {
type NoMethod SslPoliciesListAvailableFeaturesResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SslPoliciesScopedList struct {
// SslPolicies: A list of SslPolicies contained in this scope.
SslPolicies []*SslPolicy `json:"sslPolicies,omitempty"`
-
- // Warning: Informational warning which replaces the list of SSL
- // policies when the list is empty.
+ // Warning: Informational warning which replaces the list of SSL policies when
+ // the list is empty.
Warning *SslPoliciesScopedListWarning `json:"warning,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "SslPolicies") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "SslPolicies") 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. "SslPolicies") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SslPoliciesScopedList) MarshalJSON() ([]byte, error) {
+func (s SslPoliciesScopedList) MarshalJSON() ([]byte, error) {
type NoMethod SslPoliciesScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// SslPoliciesScopedListWarning: Informational warning which replaces
-// the list of SSL policies when the list is empty.
+// SslPoliciesScopedListWarning: Informational warning which replaces the list
+// of SSL policies when the list is empty.
type SslPoliciesScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*SslPoliciesScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SslPoliciesScopedListWarning) MarshalJSON() ([]byte, error) {
+func (s SslPoliciesScopedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod SslPoliciesScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SslPoliciesScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SslPoliciesScopedListWarningData) MarshalJSON() ([]byte, error) {
+func (s SslPoliciesScopedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod SslPoliciesScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// SslPolicy: Represents an SSL Policy resource. Use SSL policies to
-// control SSL features, such as versions and cipher suites, that are
-// offered by Application Load Balancers and proxy Network Load
-// Balancers. For more information, read SSL policies overview.
+// SslPolicy: Represents an SSL Policy resource. Use SSL policies to control
+// SSL features, such as versions and cipher suites, that are offered by
+// Application Load Balancers and proxy Network Load Balancers. For more
+// information, read SSL policies overview.
type SslPolicy struct {
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // CustomFeatures: A list of features enabled when the selected profile
- // is CUSTOM. The method returns the set of features that can be
- // specified in this list. This field must be empty if the profile is
- // not CUSTOM.
+ // CustomFeatures: A list of features enabled when the selected profile is
+ // CUSTOM. The method returns the set of features that can be specified in this
+ // list. This field must be empty if the profile is not CUSTOM.
CustomFeatures []string `json:"customFeatures,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // EnabledFeatures: [Output Only] The list of features enabled in the
- // SSL policy.
+ // EnabledFeatures: [Output Only] The list of features enabled in the SSL
+ // policy.
EnabledFeatures []string `json:"enabledFeatures,omitempty"`
-
- // Fingerprint: Fingerprint of this resource. A hash of the contents
- // stored in this object. This field is used in optimistic locking. This
- // field will be ignored when inserting a SslPolicy. An up-to-date
- // fingerprint must be provided in order to update the SslPolicy,
- // otherwise the request will fail with error 412 conditionNotMet. To
- // see the latest fingerprint, make a get() request to retrieve an
- // SslPolicy.
+ // Fingerprint: Fingerprint of this resource. A hash of the contents stored in
+ // this object. This field is used in optimistic locking. This field will be
+ // ignored when inserting a SslPolicy. An up-to-date fingerprint must be
+ // provided in order to update the SslPolicy, otherwise the request will fail
+ // with error 412 conditionNotMet. To see the latest fingerprint, make a get()
+ // request to retrieve an SslPolicy.
Fingerprint string `json:"fingerprint,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
- // Kind: [Output only] Type of the resource. Always compute#sslPolicyfor
- // SSL policies.
+ // Kind: [Output only] Type of the resource. Always compute#sslPolicyfor SSL
+ // policies.
Kind string `json:"kind,omitempty"`
-
- // MinTlsVersion: The minimum version of SSL protocol that can be used
- // by the clients to establish a connection with the load balancer. This
- // can be one of TLS_1_0, TLS_1_1, TLS_1_2.
+ // MinTlsVersion: The minimum version of SSL protocol that can be used by the
+ // clients to establish a connection with the load balancer. This can be one of
+ // TLS_1_0, TLS_1_1, TLS_1_2.
//
// Possible values:
// "TLS_1_0" - TLS 1.0
// "TLS_1_1" - TLS 1.1
// "TLS_1_2" - TLS 1.2
MinTlsVersion string `json:"minTlsVersion,omitempty"`
-
- // Name: Name of the resource. The name must be 1-63 characters long,
- // and comply with RFC1035. Specifically, the name must be 1-63
- // characters long and match the regular expression
- // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
- // a lowercase letter, and all following characters must be a dash,
- // lowercase letter, or digit, except the last character, which cannot
- // be a dash.
+ // Name: Name of the resource. The name must be 1-63 characters long, and
+ // comply with RFC1035. Specifically, the name must be 1-63 characters long and
+ // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the
+ // first character must be a lowercase letter, and all following characters
+ // must be a dash, lowercase letter, or digit, except the last character, which
+ // cannot be a dash.
Name string `json:"name,omitempty"`
-
- // Profile: Profile specifies the set of SSL features that can be used
- // by the load balancer when negotiating SSL with clients. This can be
- // one of COMPATIBLE, MODERN, RESTRICTED, or CUSTOM. If using CUSTOM,
- // the set of SSL features to enable must be specified in the
- // customFeatures field.
- //
- // Possible values:
- // "COMPATIBLE" - Compatible profile. Allows the broadset set of
- // clients, even those which support only out-of-date SSL features to
- // negotiate with the load balancer.
- // "CUSTOM" - Custom profile. Allow only the set of allowed SSL
- // features specified in the customFeatures field.
- // "MODERN" - Modern profile. Supports a wide set of SSL features,
- // allowing modern clients to negotiate SSL with the load balancer.
- // "RESTRICTED" - Restricted profile. Supports a reduced set of SSL
- // features, intended to meet stricter compliance requirements.
+ // Profile: Profile specifies the set of SSL features that can be used by the
+ // load balancer when negotiating SSL with clients. This can be one of
+ // COMPATIBLE, MODERN, RESTRICTED, or CUSTOM. If using CUSTOM, the set of SSL
+ // features to enable must be specified in the customFeatures field.
+ //
+ // Possible values:
+ // "COMPATIBLE" - Compatible profile. Allows the broadset set of clients,
+ // even those which support only out-of-date SSL features to negotiate with the
+ // load balancer.
+ // "CUSTOM" - Custom profile. Allow only the set of allowed SSL features
+ // specified in the customFeatures field.
+ // "MODERN" - Modern profile. Supports a wide set of SSL features, allowing
+ // modern clients to negotiate SSL with the load balancer.
+ // "RESTRICTED" - Restricted profile. Supports a reduced set of SSL features,
+ // intended to meet stricter compliance requirements.
Profile string `json:"profile,omitempty"`
-
// Region: [Output Only] URL of the region where the regional SSL policy
// resides. This field is not applicable to global SSL policies.
Region string `json:"region,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // Warnings: [Output Only] If potential misconfigurations are detected
- // for this SSL policy, this field will be populated with warning
- // messages.
+ // Warnings: [Output Only] If potential misconfigurations are detected for this
+ // SSL policy, this field will be populated with warning messages.
Warnings []*SslPolicyWarnings `json:"warnings,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "CreationTimestamp") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CreationTimestamp") 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. "CreationTimestamp") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SslPolicy) MarshalJSON() ([]byte, error) {
+func (s SslPolicy) MarshalJSON() ([]byte, error) {
type NoMethod SslPolicy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SslPolicyWarnings struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*SslPolicyWarningsData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SslPolicyWarnings) MarshalJSON() ([]byte, error) {
+func (s SslPolicyWarnings) MarshalJSON() ([]byte, error) {
type NoMethod SslPolicyWarnings
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SslPolicyWarningsData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SslPolicyWarningsData) MarshalJSON() ([]byte, error) {
+func (s SslPolicyWarningsData) MarshalJSON() ([]byte, error) {
type NoMethod SslPolicyWarningsData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type SslPolicyReference struct {
- // SslPolicy: URL of the SSL policy resource. Set this to empty string
- // to clear any existing SSL policy associated with the target proxy
- // resource.
+ // SslPolicy: URL of the SSL policy resource. Set this to empty string to clear
+ // any existing SSL policy associated with the target proxy resource.
SslPolicy string `json:"sslPolicy,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "SslPolicy") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "SslPolicy") 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. "SslPolicy") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SslPolicyReference) MarshalJSON() ([]byte, error) {
+func (s SslPolicyReference) MarshalJSON() ([]byte, error) {
type NoMethod SslPolicyReference
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type StatefulPolicy struct {
PreservedState *StatefulPolicyPreservedState `json:"preservedState,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "PreservedState") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "PreservedState") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "PreservedState") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *StatefulPolicy) MarshalJSON() ([]byte, error) {
+func (s StatefulPolicy) MarshalJSON() ([]byte, error) {
type NoMethod StatefulPolicy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// StatefulPolicyPreservedState: Configuration of preserved resources.
type StatefulPolicyPreservedState struct {
- // Disks: Disks created on the instances that will be preserved on
- // instance delete, update, etc. This map is keyed with the device names
- // of the disks.
+ // Disks: Disks created on the instances that will be preserved on instance
+ // delete, update, etc. This map is keyed with the device names of the disks.
Disks map[string]StatefulPolicyPreservedStateDiskDevice `json:"disks,omitempty"`
-
- // ExternalIPs: External network IPs assigned to the instances that will
- // be preserved on instance delete, update, etc. This map is keyed with
- // the network interface name.
+ // ExternalIPs: External network IPs assigned to the instances that will be
+ // preserved on instance delete, update, etc. This map is keyed with the
+ // network interface name.
ExternalIPs map[string]StatefulPolicyPreservedStateNetworkIp `json:"externalIPs,omitempty"`
-
- // InternalIPs: Internal network IPs assigned to the instances that will
- // be preserved on instance delete, update, etc. This map is keyed with
- // the network interface name.
+ // InternalIPs: Internal network IPs assigned to the instances that will be
+ // preserved on instance delete, update, etc. This map is keyed with the
+ // network interface name.
InternalIPs map[string]StatefulPolicyPreservedStateNetworkIp `json:"internalIPs,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Disks") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Disks") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Disks") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *StatefulPolicyPreservedState) MarshalJSON() ([]byte, error) {
+func (s StatefulPolicyPreservedState) MarshalJSON() ([]byte, error) {
type NoMethod StatefulPolicyPreservedState
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type StatefulPolicyPreservedStateDiskDevice struct {
- // AutoDelete: These stateful disks will never be deleted during
- // autohealing, update or VM instance recreate operations. This flag is
- // used to configure if the disk should be deleted after it is no longer
- // used by the group, e.g. when the given instance or the whole group is
- // deleted. Note: disks attached in READ_ONLY mode cannot be
- // auto-deleted.
+ // AutoDelete: These stateful disks will never be deleted during autohealing,
+ // update or VM instance recreate operations. This flag is used to configure if
+ // the disk should be deleted after it is no longer used by the group, e.g.
+ // when the given instance or the whole group is deleted. Note: disks attached
+ // in READ_ONLY mode cannot be auto-deleted.
//
// Possible values:
// "NEVER"
// "ON_PERMANENT_INSTANCE_DELETION"
AutoDelete string `json:"autoDelete,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "AutoDelete") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "AutoDelete") 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. "AutoDelete") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *StatefulPolicyPreservedStateDiskDevice) MarshalJSON() ([]byte, error) {
+func (s StatefulPolicyPreservedStateDiskDevice) MarshalJSON() ([]byte, error) {
type NoMethod StatefulPolicyPreservedStateDiskDevice
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type StatefulPolicyPreservedStateNetworkIp struct {
- // AutoDelete: These stateful IPs will never be released during
- // autohealing, update or VM instance recreate operations. This flag is
- // used to configure if the IP reservation should be deleted after it is
- // no longer used by the group, e.g. when the given instance or the
- // whole group is deleted.
+ // AutoDelete: These stateful IPs will never be released during autohealing,
+ // update or VM instance recreate operations. This flag is used to configure if
+ // the IP reservation should be deleted after it is no longer used by the
+ // group, e.g. when the given instance or the whole group is deleted.
//
// Possible values:
// "NEVER"
// "ON_PERMANENT_INSTANCE_DELETION"
AutoDelete string `json:"autoDelete,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "AutoDelete") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "AutoDelete") 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. "AutoDelete") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *StatefulPolicyPreservedStateNetworkIp) MarshalJSON() ([]byte, error) {
+func (s StatefulPolicyPreservedStateNetworkIp) MarshalJSON() ([]byte, error) {
type NoMethod StatefulPolicyPreservedStateNetworkIp
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// Status: The `Status` type defines a logical error model that is
-// suitable for different programming environments, including REST APIs
-// and RPC APIs. It is used by gRPC (https://github.com/grpc). Each
-// `Status` message contains three pieces of data: error code, error
-// message, and error details. You can find out more about this error
-// model and how to work with it in the API Design Guide
-// (https://cloud.google.com/apis/design/errors).
+// 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). Each `Status` message contains three
+// pieces of data: error code, error message, and error details. You can find
+// out more about this error model and how to work with it in the API Design
+// Guide (https://cloud.google.com/apis/design/errors).
type Status struct {
- // Code: The status code, which should be an enum value of
- // google.rpc.Code.
+ // Code: The status code, which should be an enum value of google.rpc.Code.
Code int64 `json:"code,omitempty"`
-
- // Details: A list of messages that carry the error details. There is a
- // common set of message types for APIs to use.
+ // Details: A list of messages that carry the error details. There is a common
+ // set of message types for APIs to use.
Details []googleapi.RawMessage `json:"details,omitempty"`
-
- // Message: A developer-facing error message, which should be in
- // English. Any user-facing error message should be localized and sent
- // in the google.rpc.Status.details field, or localized by the client.
+ // Message: A developer-facing error message, which should be in English. Any
+ // user-facing error message should be localized and sent in the
+ // google.rpc.Status.details field, or localized by the client.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *Status) MarshalJSON() ([]byte, error) {
+func (s Status) MarshalJSON() ([]byte, error) {
type NoMethod Status
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// Subnetwork: Represents a Subnetwork resource. A subnetwork (also
-// known as a subnet) is a logical partition of a Virtual Private Cloud
-// network with one primary IP range and zero or more secondary IP
-// ranges. For more information, read Virtual Private Cloud (VPC)
-// Network.
-type Subnetwork struct {
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+// StoragePool: Represents a zonal storage pool resource.
+type StoragePool struct {
+ // CapacityProvisioningType: Provisioning type of the byte capacity of the
+ // pool.
+ //
+ // Possible values:
+ // "ADVANCED" - Advanced provisioning "thinly" allocates the related
+ // resource.
+ // "STANDARD" - Standard provisioning allocates the related resource for the
+ // pool disks' exclusive use.
+ // "UNSPECIFIED"
+ CapacityProvisioningType string `json:"capacityProvisioningType,omitempty"`
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource. This field can be set only at
- // resource creation time.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // EnableFlowLogs: Whether to enable flow logging for this subnetwork.
- // If this field is not explicitly set, it will not appear in get
- // listings. If not set the default behavior is determined by the org
- // policy, if there is no org policy specified, then it will default to
- // disabled. This field isn't supported if the subnet purpose field is
- // set to REGIONAL_MANAGED_PROXY.
- EnableFlowLogs bool `json:"enableFlowLogs,omitempty"`
-
- // ExternalIpv6Prefix: The external IPv6 address range that is owned by
- // this subnetwork.
- ExternalIpv6Prefix string `json:"externalIpv6Prefix,omitempty"`
-
- // Fingerprint: Fingerprint of this resource. A hash of the contents
- // stored in this object. This field is used in optimistic locking. This
- // field will be ignored when inserting a Subnetwork. An up-to-date
- // fingerprint must be provided in order to update the Subnetwork,
- // otherwise the request will fail with error 412 conditionNotMet. To
- // see the latest fingerprint, make a get() request to retrieve a
- // Subnetwork.
- Fingerprint string `json:"fingerprint,omitempty"`
-
- // GatewayAddress: [Output Only] The gateway address for default routes
- // to reach destination addresses outside this subnetwork.
- GatewayAddress string `json:"gatewayAddress,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
- // InternalIpv6Prefix: [Output Only] The internal IPv6 address range
- // that is assigned to this subnetwork.
- InternalIpv6Prefix string `json:"internalIpv6Prefix,omitempty"`
-
- // IpCidrRange: The range of internal addresses that are owned by this
- // subnetwork. Provide this property when you create the subnetwork. For
- // example, 10.0.0.0/8 or 100.64.0.0/10. Ranges must be unique and
- // non-overlapping within a network. Only IPv4 is supported. This field
- // is set at resource creation time. The range can be any range listed
- // in the Valid ranges list. The range can be expanded after creation
- // using expandIpCidrRange.
- IpCidrRange string `json:"ipCidrRange,omitempty"`
-
- // Ipv6AccessType: The access type of IPv6 address this subnet holds.
- // It's immutable and can only be specified during creation or the first
- // time the subnet is updated into IPV4_IPV6 dual stack.
- //
- // Possible values:
- // "EXTERNAL" - VMs on this subnet will be assigned IPv6 addresses
- // that are accessible via the Internet, as well as the VPC network.
- // "INTERNAL" - VMs on this subnet will be assigned IPv6 addresses
- // that are only accessible over the VPC network.
- Ipv6AccessType string `json:"ipv6AccessType,omitempty"`
-
- // Ipv6CidrRange: [Output Only] This field is for internal use.
- Ipv6CidrRange string `json:"ipv6CidrRange,omitempty"`
-
- // Kind: [Output Only] Type of the resource. Always compute#subnetwork
- // for Subnetwork resources.
+ // Kind: [Output Only] Type of the resource. Always compute#storagePool for
+ // storage pools.
Kind string `json:"kind,omitempty"`
-
- // LogConfig: This field denotes the VPC flow logging options for this
- // subnetwork. If logging is enabled, logs are exported to Cloud
- // Logging.
- LogConfig *SubnetworkLogConfig `json:"logConfig,omitempty"`
-
- // Name: The name of the resource, provided by the client when initially
- // creating the resource. The name must be 1-63 characters long, and
- // comply with RFC1035. Specifically, the name must be 1-63 characters
- // long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`
- // which means the first character must be a lowercase letter, and all
- // following characters must be a dash, lowercase letter, or digit,
- // except the last character, which cannot be a dash.
+ // LabelFingerprint: A fingerprint for the labels being applied to this storage
+ // pool, which is essentially a hash of the labels set used for optimistic
+ // locking. The fingerprint is initially generated by Compute Engine and
+ // changes after every request to modify or update labels. You must always
+ // provide an up-to-date fingerprint hash in order to update or change labels,
+ // otherwise the request will fail with error 412 conditionNotMet. To see the
+ // latest fingerprint, make a get() request to retrieve a storage pool.
+ LabelFingerprint string `json:"labelFingerprint,omitempty"`
+ // Labels: Labels to apply to this storage pool. These can be later modified by
+ // the setLabels method.
+ Labels map[string]string `json:"labels,omitempty"`
+ // Name: Name of the resource. Provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must
+ // be a lowercase letter, and all following characters must be a dash,
+ // lowercase letter, or digit, except the last character, which cannot be a
+ // dash.
Name string `json:"name,omitempty"`
-
- // Network: The URL of the network to which this subnetwork belongs,
- // provided by the client when initially creating the subnetwork. This
- // field can be set only at resource creation time.
- Network string `json:"network,omitempty"`
-
- // PrivateIpGoogleAccess: Whether the VMs in this subnet can access
- // Google services without assigned external IP addresses. This field
- // can be both set at resource creation time and updated using
- // setPrivateIpGoogleAccess.
- PrivateIpGoogleAccess bool `json:"privateIpGoogleAccess,omitempty"`
-
- // PrivateIpv6GoogleAccess: This field is for internal use. This field
- // can be both set at resource creation time and updated using patch.
- //
- // Possible values:
- // "DISABLE_GOOGLE_ACCESS" - Disable private IPv6 access to/from
- // Google services.
- // "ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE" - Bidirectional private
- // IPv6 access to/from Google services.
- // "ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE" - Outbound private IPv6
- // access from VMs in this subnet to Google services.
- PrivateIpv6GoogleAccess string `json:"privateIpv6GoogleAccess,omitempty"`
-
- // Purpose: The purpose of the resource. This field can be either
- // PRIVATE, GLOBAL_MANAGED_PROXY, REGIONAL_MANAGED_PROXY,
- // PRIVATE_SERVICE_CONNECT, or PRIVATE is the default purpose for
- // user-created subnets or subnets that are automatically created in
- // auto mode networks. Subnets with purpose set to GLOBAL_MANAGED_PROXY
- // or REGIONAL_MANAGED_PROXY are user-created subnetworks that are
- // reserved for Envoy-based load balancers. A subnet with purpose set to
- // PRIVATE_SERVICE_CONNECT is used to publish services using Private
- // Service Connect. If unspecified, the subnet purpose defaults to
- // PRIVATE. The enableFlowLogs field isn't supported if the subnet
- // purpose field is set to GLOBAL_MANAGED_PROXY or
- // REGIONAL_MANAGED_PROXY.
- //
- // Possible values:
- // "GLOBAL_MANAGED_PROXY" - Subnet reserved for Global Envoy-based
- // Load Balancing.
- // "INTERNAL_HTTPS_LOAD_BALANCER" - Subnet reserved for Internal
- // HTTP(S) Load Balancing. This is a legacy purpose, please use
- // REGIONAL_MANAGED_PROXY instead.
- // "PRIVATE" - Regular user created or automatically created subnet.
- // "PRIVATE_NAT" - Subnetwork used as source range for Private NAT
- // Gateways.
- // "PRIVATE_RFC_1918" - Regular user created or automatically created
- // subnet.
- // "PRIVATE_SERVICE_CONNECT" - Subnetworks created for Private Service
- // Connect in the producer network.
- // "REGIONAL_MANAGED_PROXY" - Subnetwork used for Regional Envoy-based
- // Load Balancing.
- Purpose string `json:"purpose,omitempty"`
-
- // Region: URL of the region where the Subnetwork resides. This field
- // can be set only at resource creation time.
- Region string `json:"region,omitempty"`
-
- // ReservedInternalRange: The URL of the reserved internal range.
- ReservedInternalRange string `json:"reservedInternalRange,omitempty"`
-
- // Role: The role of subnetwork. Currently, this field is only used when
- // purpose is set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY. The
- // value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one
- // that is currently being used for Envoy-based load balancers in a
- // region. A BACKUP subnetwork is one that is ready to be promoted to
- // ACTIVE or is currently draining. This field can be updated with a
- // patch request.
+ // PerformanceProvisioningType: Provisioning type of the performance-related
+ // parameters of the pool, such as throughput and IOPS.
//
// Possible values:
- // "ACTIVE" - The ACTIVE subnet that is currently used.
- // "BACKUP" - The BACKUP subnet that could be promoted to ACTIVE.
- Role string `json:"role,omitempty"`
-
- // SecondaryIpRanges: An array of configurations for secondary IP ranges
- // for VM instances contained in this subnetwork. The primary IP of such
- // VM must belong to the primary ipCidrRange of the subnetwork. The
- // alias IPs may belong to either primary or secondary ranges. This
- // field can be updated with a patch request.
- SecondaryIpRanges []*SubnetworkSecondaryRange `json:"secondaryIpRanges,omitempty"`
-
- // SelfLink: [Output Only] Server-defined URL for the resource.
+ // "ADVANCED" - Advanced provisioning "thinly" allocates the related
+ // resource.
+ // "STANDARD" - Standard provisioning allocates the related resource for the
+ // pool disks' exclusive use.
+ // "UNSPECIFIED"
+ PerformanceProvisioningType string `json:"performanceProvisioningType,omitempty"`
+ // PoolProvisionedCapacityGb: Size, in GiB, of the storage pool. For more
+ // information about the size limits, see
+ // https://cloud.google.com/compute/docs/disks/storage-pools.
+ PoolProvisionedCapacityGb int64 `json:"poolProvisionedCapacityGb,omitempty,string"`
+ // PoolProvisionedIops: Provisioned IOPS of the storage pool. Only relevant if
+ // the storage pool type is hyperdisk-balanced.
+ PoolProvisionedIops int64 `json:"poolProvisionedIops,omitempty,string"`
+ // PoolProvisionedThroughput: Provisioned throughput of the storage pool. Only
+ // relevant if the storage pool type is hyperdisk-balanced or
+ // hyperdisk-throughput.
+ PoolProvisionedThroughput int64 `json:"poolProvisionedThroughput,omitempty,string"`
+ // ResourceStatus: [Output Only] Status information for the storage pool
+ // resource.
+ ResourceStatus *StoragePoolResourceStatus `json:"resourceStatus,omitempty"`
+ // SelfLink: [Output Only] Server-defined fully-qualified URL for this
+ // resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // StackType: The stack type for the subnet. If set to IPV4_ONLY, new
- // VMs in the subnet are assigned IPv4 addresses only. If set to
- // IPV4_IPV6, new VMs in the subnet can be assigned both IPv4 and IPv6
- // addresses. If not specified, IPV4_ONLY is used. This field can be
- // both set at resource creation time and updated using patch.
- //
- // Possible values:
- // "IPV4_IPV6" - New VMs in this subnet can have both IPv4 and IPv6
- // addresses.
- // "IPV4_ONLY" - New VMs in this subnet will only be assigned IPv4
- // addresses.
- StackType string `json:"stackType,omitempty"`
-
- // State: [Output Only] The state of the subnetwork, which can be one of
- // the following values: READY: Subnetwork is created and ready to use
- // DRAINING: only applicable to subnetworks that have the purpose set to
- // INTERNAL_HTTPS_LOAD_BALANCER and indicates that connections to the
- // load balancer are being drained. A subnetwork that is draining cannot
- // be used or modified until it reaches a status of READY
+ // SelfLinkWithId: [Output Only] Server-defined URL for this resource's
+ // resource id.
+ SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
+ // State: [Output Only] The status of storage pool creation. - CREATING:
+ // Storage pool is provisioning. storagePool. - FAILED: Storage pool creation
+ // failed. - READY: Storage pool is ready for use. - DELETING: Storage pool is
+ // deleting.
//
// Possible values:
- // "DRAINING" - Subnetwork is being drained.
- // "READY" - Subnetwork is ready for use.
+ // "CREATING" - StoragePool is provisioning
+ // "DELETING" - StoragePool is deleting.
+ // "FAILED" - StoragePool creation failed.
+ // "READY" - StoragePool is ready for use.
State string `json:"state,omitempty"`
+ // Status: [Output Only] Status information for the storage pool resource.
+ Status *StoragePoolResourceStatus `json:"status,omitempty"`
+ // StoragePoolType: Type of the storage pool.
+ StoragePoolType string `json:"storagePoolType,omitempty"`
+ // Zone: [Output Only] URL of the zone where the storage pool resides. You must
+ // specify this field as part of the HTTP request URL. It is not settable as a
+ // field in the request body.
+ Zone string `json:"zone,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "CapacityProvisioningType")
+ // to unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CreationTimestamp") 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. "CapacityProvisioningType") to
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *Subnetwork) MarshalJSON() ([]byte, error) {
- type NoMethod Subnetwork
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s StoragePool) MarshalJSON() ([]byte, error) {
+ type NoMethod StoragePool
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type SubnetworkAggregatedList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+type StoragePoolAggregatedList struct {
+ Etag string `json:"etag,omitempty"`
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
- // Items: A list of SubnetworksScopedList resources.
- Items map[string]SubnetworksScopedList `json:"items,omitempty"`
-
+ // Items: A list of StoragePoolsScopedList resources.
+ Items map[string]StoragePoolsScopedList `json:"items,omitempty"`
// Kind: [Output Only] Type of resource. Always
- // compute#subnetworkAggregatedList for aggregated lists of subnetworks.
+ // compute#storagePoolAggregatedList for aggregated lists of storage pools.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Unreachables: [Output Only] Unreachable resources.
Unreachables []string `json:"unreachables,omitempty"`
-
// Warning: [Output Only] Informational warning message.
- Warning *SubnetworkAggregatedListWarning `json:"warning,omitempty"`
+ Warning *StoragePoolAggregatedListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Etag") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Etag") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SubnetworkAggregatedList) MarshalJSON() ([]byte, error) {
- type NoMethod SubnetworkAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s StoragePoolAggregatedList) MarshalJSON() ([]byte, error) {
+ type NoMethod StoragePoolAggregatedList
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// SubnetworkAggregatedListWarning: [Output Only] Informational warning
+// StoragePoolAggregatedListWarning: [Output Only] Informational warning
// message.
-type SubnetworkAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
- //
- // Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+type StoragePoolAggregatedListWarning struct {
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
+ //
+ // Possible values:
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
- Data []*SubnetworkAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
+ Data []*StoragePoolAggregatedListWarningData `json:"data,omitempty"`
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SubnetworkAggregatedListWarning) MarshalJSON() ([]byte, error) {
- type NoMethod SubnetworkAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s StoragePoolAggregatedListWarning) MarshalJSON() ([]byte, error) {
+ type NoMethod StoragePoolAggregatedListWarning
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type SubnetworkAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+type StoragePoolAggregatedListWarningData struct {
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SubnetworkAggregatedListWarningData) MarshalJSON() ([]byte, error) {
- type NoMethod SubnetworkAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s StoragePoolAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+ type NoMethod StoragePoolAggregatedListWarningData
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// SubnetworkList: Contains a list of Subnetwork resources.
-type SubnetworkList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
- Id string `json:"id,omitempty"`
+type StoragePoolDisk struct {
+ // AttachedInstances: [Output Only] Instances this disk is attached to.
+ AttachedInstances []string `json:"attachedInstances,omitempty"`
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
+ CreationTimestamp string `json:"creationTimestamp,omitempty"`
+ // Disk: [Output Only] The URL of the disk.
+ Disk string `json:"disk,omitempty"`
+ // Name: [Output Only] The name of the disk.
+ Name string `json:"name,omitempty"`
+ // ProvisionedIops: [Output Only] The number of IOPS provisioned for the disk.
+ ProvisionedIops int64 `json:"provisionedIops,omitempty,string"`
+ // ProvisionedThroughput: [Output Only] The throughput provisioned for the
+ // disk.
+ ProvisionedThroughput int64 `json:"provisionedThroughput,omitempty,string"`
+ // ResourcePolicies: [Output Only] Resource policies applied to disk for
+ // automatic snapshot creations.
+ ResourcePolicies []string `json:"resourcePolicies,omitempty"`
+ // SizeGb: [Output Only] The disk size, in GB.
+ SizeGb int64 `json:"sizeGb,omitempty,string"`
+ // Status: [Output Only] The disk status.
+ //
+ // Possible values:
+ // "CREATING" - Disk is provisioning
+ // "DELETING" - Disk is deleting.
+ // "FAILED" - Disk creation failed.
+ // "READY" - Disk is ready for use.
+ // "RESTORING" - Source data is being copied into the disk.
+ // "UNAVAILABLE" - Disk is currently unavailable and cannot be accessed,
+ // attached or detached.
+ Status string `json:"status,omitempty"`
+ // Type: [Output Only] The disk type.
+ Type string `json:"type,omitempty"`
+ // UsedBytes: [Output Only] Amount of disk space used.
+ UsedBytes int64 `json:"usedBytes,omitempty,string"`
+ // ForceSendFields is a list of field names (e.g. "AttachedInstances") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "AttachedInstances") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
- // Items: A list of Subnetwork resources.
- Items []*Subnetwork `json:"items,omitempty"`
+func (s StoragePoolDisk) MarshalJSON() ([]byte, error) {
+ type NoMethod StoragePoolDisk
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
- // Kind: [Output Only] Type of resource. Always compute#subnetworkList
- // for lists of subnetworks.
+// StoragePoolList: A list of StoragePool resources.
+type StoragePoolList struct {
+ Etag string `json:"etag,omitempty"`
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
+ Id string `json:"id,omitempty"`
+ // Items: A list of StoragePool resources.
+ Items []*StoragePool `json:"items,omitempty"`
+ // Kind: [Output Only] Type of resource. Always compute#storagePoolList for
+ // lists of storagePools.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
+ // Unreachables: [Output Only] Unreachable resources. end_interface:
+ // MixerListResponseWithEtagBuilder
+ Unreachables []string `json:"unreachables,omitempty"`
// Warning: [Output Only] Informational warning message.
- Warning *SubnetworkListWarning `json:"warning,omitempty"`
+ Warning *StoragePoolListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Etag") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Etag") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SubnetworkList) MarshalJSON() ([]byte, error) {
- type NoMethod SubnetworkList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s StoragePoolList) MarshalJSON() ([]byte, error) {
+ type NoMethod StoragePoolList
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// SubnetworkListWarning: [Output Only] Informational warning message.
-type SubnetworkListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+// StoragePoolListWarning: [Output Only] Informational warning message.
+type StoragePoolListWarning struct {
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
- Data []*SubnetworkListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
+ Data []*StoragePoolListWarningData `json:"data,omitempty"`
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SubnetworkListWarning) MarshalJSON() ([]byte, error) {
- type NoMethod SubnetworkListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s StoragePoolListWarning) MarshalJSON() ([]byte, error) {
+ type NoMethod StoragePoolListWarning
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type SubnetworkListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+type StoragePoolListWarningData struct {
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SubnetworkListWarningData) MarshalJSON() ([]byte, error) {
- type NoMethod SubnetworkListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s StoragePoolListWarningData) MarshalJSON() ([]byte, error) {
+ type NoMethod StoragePoolListWarningData
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// SubnetworkLogConfig: The available logging options for this
-// subnetwork.
-type SubnetworkLogConfig struct {
- // AggregationInterval: Can only be specified if VPC flow logging for
- // this subnetwork is enabled. Toggles the aggregation interval for
- // collecting flow logs. Increasing the interval time will reduce the
- // amount of generated flow logs for long lasting connections. Default
- // is an interval of 5 seconds per connection.
- //
- // Possible values:
- // "INTERVAL_10_MIN"
- // "INTERVAL_15_MIN"
- // "INTERVAL_1_MIN"
- // "INTERVAL_30_SEC"
- // "INTERVAL_5_MIN"
- // "INTERVAL_5_SEC"
- AggregationInterval string `json:"aggregationInterval,omitempty"`
-
- // Enable: Whether to enable flow logging for this subnetwork. If this
- // field is not explicitly set, it will not appear in get listings. If
- // not set the default behavior is determined by the org policy, if
- // there is no org policy specified, then it will default to disabled.
- // Flow logging isn't supported if the subnet purpose field is set to
- // REGIONAL_MANAGED_PROXY.
- Enable bool `json:"enable,omitempty"`
+type StoragePoolListDisks struct {
+ Etag string `json:"etag,omitempty"`
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
+ Id string `json:"id,omitempty"`
+ // Items: A list of StoragePoolDisk resources.
+ Items []*StoragePoolDisk `json:"items,omitempty"`
+ // Kind: [Output Only] Type of resource. Always compute#storagePoolListDisks
+ // for lists of disks in a storagePool.
+ Kind string `json:"kind,omitempty"`
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
+ NextPageToken string `json:"nextPageToken,omitempty"`
+ // SelfLink: [Output Only] Server-defined URL for this resource.
+ SelfLink string `json:"selfLink,omitempty"`
+ // Unreachables: [Output Only] Unreachable resources. end_interface:
+ // MixerListResponseWithEtagBuilder
+ Unreachables []string `json:"unreachables,omitempty"`
+ // Warning: [Output Only] Informational warning message.
+ Warning *StoragePoolListDisksWarning `json:"warning,omitempty"`
- // FilterExpr: Can only be specified if VPC flow logs for this
- // subnetwork is enabled. The filter expression is used to define which
- // VPC flow logs should be exported to Cloud Logging.
- FilterExpr string `json:"filterExpr,omitempty"`
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Etag") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
- // FlowSampling: Can only be specified if VPC flow logging for this
- // subnetwork is enabled. The value of the field must be in [0, 1]. Set
- // the sampling rate of VPC flow logs within the subnetwork where 1.0
- // means all collected logs are reported and 0.0 means no logs are
- // reported. Default is 0.5 unless otherwise specified by the org
- // policy, which means half of all collected logs are reported.
- FlowSampling float64 `json:"flowSampling,omitempty"`
+func (s StoragePoolListDisks) MarshalJSON() ([]byte, error) {
+ type NoMethod StoragePoolListDisks
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
- // Metadata: Can only be specified if VPC flow logs for this subnetwork
- // is enabled. Configures whether all, none or a subset of metadata
- // fields should be added to the reported VPC flow logs. Default is
- // EXCLUDE_ALL_METADATA.
+// StoragePoolListDisksWarning: [Output Only] Informational warning message.
+type StoragePoolListDisksWarning struct {
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CUSTOM_METADATA"
- // "EXCLUDE_ALL_METADATA"
- // "INCLUDE_ALL_METADATA"
- Metadata string `json:"metadata,omitempty"`
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
+ // "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
+ // resources has a type marked as experimental
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
+ // "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
+ // overridden. Deprecated unused field.
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
+ // HTTP/HTTPS/HTTP2.
+ // "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
+ // exceedingly large number of resources
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
+ // "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
+ // "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
+ // ignored.
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
+ // "UNREACHABLE" - A given scope cannot be reached.
+ Code string `json:"code,omitempty"`
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
+ Data []*StoragePoolListDisksWarningData `json:"data,omitempty"`
+ // Message: [Output Only] A human-readable description of the warning code.
+ Message string `json:"message,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
- // MetadataFields: Can only be specified if VPC flow logs for this
- // subnetwork is enabled and "metadata" was set to CUSTOM_METADATA.
- MetadataFields []string `json:"metadataFields,omitempty"`
+func (s StoragePoolListDisksWarning) MarshalJSON() ([]byte, error) {
+ type NoMethod StoragePoolListDisksWarning
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
- // ForceSendFields is a list of field names (e.g. "AggregationInterval")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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.
+type StoragePoolListDisksWarningData struct {
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
+ Key string `json:"key,omitempty"`
+ // Value: [Output Only] A warning data value corresponding to the key.
+ Value string `json:"value,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s StoragePoolListDisksWarningData) MarshalJSON() ([]byte, error) {
+ type NoMethod StoragePoolListDisksWarningData
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+// StoragePoolResourceStatus: [Output Only] Contains output only fields.
+type StoragePoolResourceStatus struct {
+ // DiskCount: [Output Only] Number of disks used.
+ DiskCount int64 `json:"diskCount,omitempty,string"`
+ // LastResizeTimestamp: [Output Only] Timestamp of the last successful resize
+ // in RFC3339 text format.
+ LastResizeTimestamp string `json:"lastResizeTimestamp,omitempty"`
+ // MaxTotalProvisionedDiskCapacityGb: [Output Only] Maximum allowed aggregate
+ // disk size in gigabytes.
+ MaxTotalProvisionedDiskCapacityGb int64 `json:"maxTotalProvisionedDiskCapacityGb,omitempty,string"`
+ // PoolUsedCapacityBytes: [Output Only] Space used by data stored in disks
+ // within the storage pool (in bytes). This will reflect the total number of
+ // bytes written to the disks in the pool, in contrast to the capacity of those
+ // disks.
+ PoolUsedCapacityBytes int64 `json:"poolUsedCapacityBytes,omitempty,string"`
+ // PoolUsedIops: [Output Only] Sum of all the disks' provisioned IOPS, minus
+ // some amount that is allowed per disk that is not counted towards pool's IOPS
+ // capacity. For more information, see
+ // https://cloud.google.com/compute/docs/disks/storage-pools.
+ PoolUsedIops int64 `json:"poolUsedIops,omitempty,string"`
+ // PoolUsedThroughput: [Output Only] Sum of all the disks' provisioned
+ // throughput in MB/s.
+ PoolUsedThroughput int64 `json:"poolUsedThroughput,omitempty,string"`
+ // PoolUserWrittenBytes: [Output Only] Amount of data written into the pool,
+ // before it is compacted.
+ PoolUserWrittenBytes int64 `json:"poolUserWrittenBytes,omitempty,string"`
+ // TotalProvisionedDiskCapacityGb: [Output Only] Sum of all the capacity
+ // provisioned in disks in this storage pool. A disk's provisioned capacity is
+ // the same as its total capacity.
+ TotalProvisionedDiskCapacityGb int64 `json:"totalProvisionedDiskCapacityGb,omitempty,string"`
+ // TotalProvisionedDiskIops: [Output Only] Sum of all the disks' provisioned
+ // IOPS.
+ TotalProvisionedDiskIops int64 `json:"totalProvisionedDiskIops,omitempty,string"`
+ // TotalProvisionedDiskThroughput: [Output Only] Sum of all the disks'
+ // provisioned throughput in MB/s, minus some amount that is allowed per disk
+ // that is not counted towards pool's throughput capacity.
+ TotalProvisionedDiskThroughput int64 `json:"totalProvisionedDiskThroughput,omitempty,string"`
+ // ForceSendFields is a list of field names (e.g. "DiskCount") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "AggregationInterval") 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. "DiskCount") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SubnetworkLogConfig) MarshalJSON() ([]byte, error) {
- type NoMethod SubnetworkLogConfig
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s StoragePoolResourceStatus) MarshalJSON() ([]byte, error) {
+ type NoMethod StoragePoolResourceStatus
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-func (s *SubnetworkLogConfig) UnmarshalJSON(data []byte) error {
- type NoMethod SubnetworkLogConfig
- var s1 struct {
- FlowSampling gensupport.JSONFloat64 `json:"flowSampling"`
- *NoMethod
- }
- s1.NoMethod = (*NoMethod)(s)
- if err := json.Unmarshal(data, &s1); err != nil {
- return err
- }
- s.FlowSampling = float64(s1.FlowSampling)
- return nil
-}
-
-// SubnetworkSecondaryRange: Represents a secondary IP range of a
-// subnetwork.
-type SubnetworkSecondaryRange struct {
- // IpCidrRange: The range of IP addresses belonging to this subnetwork
- // secondary range. Provide this property when you create the
- // subnetwork. Ranges must be unique and non-overlapping with all
- // primary and secondary IP ranges within a network. Only IPv4 is
- // supported. The range can be any range listed in the Valid ranges
- // list.
- IpCidrRange string `json:"ipCidrRange,omitempty"`
-
- // RangeName: The name associated with this subnetwork secondary range,
- // used when adding an alias IP range to a VM instance. The name must be
- // 1-63 characters long, and comply with RFC1035. The name must be
- // unique within the subnetwork.
- RangeName string `json:"rangeName,omitempty"`
-
- // ReservedInternalRange: The URL of the reserved internal range.
- ReservedInternalRange string `json:"reservedInternalRange,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "IpCidrRange") 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 *SubnetworkSecondaryRange) MarshalJSON() ([]byte, error) {
- type NoMethod SubnetworkSecondaryRange
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-type SubnetworksExpandIpCidrRangeRequest struct {
- // IpCidrRange: The IP (in CIDR format or netmask) of internal addresses
- // that are legal on this Subnetwork. This range should be disjoint from
- // other subnetworks within this network. This range can only be larger
- // than (i.e. a superset of) the range previously defined before the
- // update.
- IpCidrRange string `json:"ipCidrRange,omitempty"`
+type StoragePoolType struct {
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
+ CreationTimestamp string `json:"creationTimestamp,omitempty"`
+ // Deprecated -- [Output Only] The deprecation status associated with this
+ // storage pool type.
+ Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
+ // Description: [Output Only] An optional description of this resource.
+ Description string `json:"description,omitempty"`
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
+ Id uint64 `json:"id,omitempty,string"`
+ // Kind: [Output Only] Type of the resource. Always compute#storagePoolType for
+ // storage pool types.
+ Kind string `json:"kind,omitempty"`
+ // MaxPoolProvisionedCapacityGb: [Output Only] Maximum storage pool size in GB.
+ MaxPoolProvisionedCapacityGb int64 `json:"maxPoolProvisionedCapacityGb,omitempty,string"`
+ // MaxPoolProvisionedIops: [Output Only] Maximum provisioned IOPS.
+ MaxPoolProvisionedIops int64 `json:"maxPoolProvisionedIops,omitempty,string"`
+ // MaxPoolProvisionedThroughput: [Output Only] Maximum provisioned throughput.
+ MaxPoolProvisionedThroughput int64 `json:"maxPoolProvisionedThroughput,omitempty,string"`
+ // MinPoolProvisionedCapacityGb: [Output Only] Minimum storage pool size in GB.
+ MinPoolProvisionedCapacityGb int64 `json:"minPoolProvisionedCapacityGb,omitempty,string"`
+ // MinPoolProvisionedIops: [Output Only] Minimum provisioned IOPS.
+ MinPoolProvisionedIops int64 `json:"minPoolProvisionedIops,omitempty,string"`
+ // MinPoolProvisionedThroughput: [Output Only] Minimum provisioned throughput.
+ MinPoolProvisionedThroughput int64 `json:"minPoolProvisionedThroughput,omitempty,string"`
+ // MinSizeGb: [Deprecated] This field is deprecated. Use
+ // minPoolProvisionedCapacityGb instead.
+ MinSizeGb int64 `json:"minSizeGb,omitempty,string"`
+ // Name: [Output Only] Name of the resource.
+ Name string `json:"name,omitempty"`
+ // SelfLink: [Output Only] Server-defined URL for the resource.
+ SelfLink string `json:"selfLink,omitempty"`
+ // SelfLinkWithId: [Output Only] Server-defined URL for this resource with the
+ // resource id.
+ SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
+ // SupportedDiskTypes: [Output Only] The list of disk types supported in this
+ // storage pool type.
+ SupportedDiskTypes []string `json:"supportedDiskTypes,omitempty"`
+ // Zone: [Output Only] URL of the zone where the storage pool type resides. You
+ // must specify this field as part of the HTTP request URL. It is not settable
+ // as a field in the request body.
+ Zone string `json:"zone,omitempty"`
- // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "CreationTimestamp") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "IpCidrRange") 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. "CreationTimestamp") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SubnetworksExpandIpCidrRangeRequest) MarshalJSON() ([]byte, error) {
- type NoMethod SubnetworksExpandIpCidrRangeRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s StoragePoolType) MarshalJSON() ([]byte, error) {
+ type NoMethod StoragePoolType
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type SubnetworksScopedList struct {
- // Subnetworks: A list of subnetworks contained in this scope.
- Subnetworks []*Subnetwork `json:"subnetworks,omitempty"`
-
- // Warning: An informational warning that appears when the list of
- // addresses is empty.
- Warning *SubnetworksScopedListWarning `json:"warning,omitempty"`
+type StoragePoolTypeAggregatedList struct {
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
+ Id string `json:"id,omitempty"`
+ // Items: A list of StoragePoolTypesScopedList resources.
+ Items map[string]StoragePoolTypesScopedList `json:"items,omitempty"`
+ // Kind: [Output Only] Type of resource. Always
+ // compute#storagePoolTypeAggregatedList .
+ Kind string `json:"kind,omitempty"`
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
+ NextPageToken string `json:"nextPageToken,omitempty"`
+ // SelfLink: [Output Only] Server-defined URL for this resource.
+ SelfLink string `json:"selfLink,omitempty"`
+ // Warning: [Output Only] Informational warning message.
+ Warning *StoragePoolTypeAggregatedListWarning `json:"warning,omitempty"`
- // ForceSendFields is a list of field names (e.g. "Subnetworks") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Subnetworks") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SubnetworksScopedList) MarshalJSON() ([]byte, error) {
- type NoMethod SubnetworksScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s StoragePoolTypeAggregatedList) MarshalJSON() ([]byte, error) {
+ type NoMethod StoragePoolTypeAggregatedList
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// SubnetworksScopedListWarning: An informational warning that appears
-// when the list of addresses is empty.
-type SubnetworksScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
- //
- // Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+// StoragePoolTypeAggregatedListWarning: [Output Only] Informational warning
+// message.
+type StoragePoolTypeAggregatedListWarning struct {
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
+ //
+ // Possible values:
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
- Data []*SubnetworksScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
+ Data []*StoragePoolTypeAggregatedListWarningData `json:"data,omitempty"`
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *SubnetworksScopedListWarning) MarshalJSON() ([]byte, error) {
- type NoMethod SubnetworksScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s StoragePoolTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
+ type NoMethod StoragePoolTypeAggregatedListWarning
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type SubnetworksScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+type StoragePoolTypeAggregatedListWarningData struct {
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "Key") 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 *SubnetworksScopedListWarningData) MarshalJSON() ([]byte, error) {
- type NoMethod SubnetworksScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-type SubnetworksSetPrivateIpGoogleAccessRequest struct {
- PrivateIpGoogleAccess bool `json:"privateIpGoogleAccess,omitempty"`
-
- // ForceSendFields is a list of field names (e.g.
- // "PrivateIpGoogleAccess") to unconditionally include in API requests.
- // By default, fields with empty or default 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. "PrivateIpGoogleAccess") 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 *SubnetworksSetPrivateIpGoogleAccessRequest) MarshalJSON() ([]byte, error) {
- type NoMethod SubnetworksSetPrivateIpGoogleAccessRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// Subsetting: Subsetting configuration for this BackendService.
-// Currently this is applicable only for Internal TCP/UDP load
-// balancing, Internal HTTP(S) load balancing and Traffic Director.
-type Subsetting struct {
- // Possible values:
- // "CONSISTENT_HASH_SUBSETTING" - Subsetting based on consistent
- // hashing. For Traffic Director, the number of backends per backend
- // group (the subset size) is based on the `subset_size` parameter. For
- // Internal HTTP(S) load balancing, the number of backends per backend
- // group (the subset size) is dynamically adjusted in two cases: - As
- // the number of proxy instances participating in Internal HTTP(S) load
- // balancing increases, the subset size decreases. - When the total
- // number of backends in a network exceeds the capacity of a single
- // proxy instance, subset sizes are reduced automatically for each
- // service that has backend subsetting enabled.
- // "NONE" - No Subsetting. Clients may open connections and send
- // traffic to all backends of this backend service. This can lead to
- // performance issues if there is substantial imbalance in the count of
- // clients and backends.
- Policy string `json:"policy,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Policy") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "Policy") 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 *Subsetting) MarshalJSON() ([]byte, error) {
- type NoMethod Subsetting
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-type TCPHealthCheck struct {
- // Port: The TCP port number to which the health check prober sends
- // packets. The default value is 80. Valid values are 1 through 65535.
- Port int64 `json:"port,omitempty"`
-
- // PortName: Not supported.
- PortName string `json:"portName,omitempty"`
-
- // PortSpecification: Specifies how a port is selected for health
- // checking. Can be one of the following values: USE_FIXED_PORT:
- // Specifies a port number explicitly using the port field in the health
- // check. Supported by backend services for passthrough load balancers
- // and backend services for proxy load balancers. Not supported by
- // target pools. The health check supports all backends supported by the
- // backend service provided the backend can be health checked. For
- // example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT network
- // endpoint groups, and instance group backends. USE_NAMED_PORT: Not
- // supported. USE_SERVING_PORT: Provides an indirect method of
- // specifying the health check port by referring to the backend service.
- // Only supported by backend services for proxy load balancers. Not
- // supported by target pools. Not supported by backend services for
- // passthrough load balancers. Supports all backends that can be health
- // checked; for example, GCE_VM_IP_PORT network endpoint groups and
- // instance group backends. For GCE_VM_IP_PORT network endpoint group
- // backends, the health check uses the port number specified for each
- // endpoint in the network endpoint group. For instance group backends,
- // the health check uses the port number determined by looking up the
- // backend service's named port in the instance group's list of named
- // ports.
- //
- // Possible values:
- // "USE_FIXED_PORT" - The port number in the health check's port is
- // used for health checking. Applies to network endpoint group and
- // instance group backends.
- // "USE_NAMED_PORT" - Not supported.
- // "USE_SERVING_PORT" - For network endpoint group backends, the
- // health check uses the port number specified on each endpoint in the
- // network endpoint group. For instance group backends, the health check
- // uses the port number specified for the backend service's named port
- // defined in the instance group's named ports.
- PortSpecification string `json:"portSpecification,omitempty"`
-
- // ProxyHeader: Specifies the type of proxy header to append before
- // sending data to the backend, either NONE or PROXY_V1. The default is
- // NONE.
- //
- // Possible values:
- // "NONE"
- // "PROXY_V1"
- ProxyHeader string `json:"proxyHeader,omitempty"`
-
- // Request: Instructs the health check prober to send this exact ASCII
- // string, up to 1024 bytes in length, after establishing the TCP
- // connection.
- Request string `json:"request,omitempty"`
-
- // Response: Creates a content-based TCP health check. In addition to
- // establishing a TCP connection, you can configure the health check to
- // pass only when the backend sends this exact response ASCII string, up
- // to 1024 bytes in length. For details, see:
- // https://cloud.google.com/load-balancing/docs/health-check-concepts#criteria-protocol-ssl-tcp
- Response string `json:"response,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Port") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "Port") 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 *TCPHealthCheck) MarshalJSON() ([]byte, error) {
- type NoMethod TCPHealthCheck
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// Tags: A set of instance tags.
-type Tags struct {
- // Fingerprint: Specifies a fingerprint for this request, which is
- // essentially a hash of the tags' contents and used for optimistic
- // locking. The fingerprint is initially generated by Compute Engine and
- // changes after every request to modify or update tags. You must always
- // provide an up-to-date fingerprint hash in order to update or change
- // tags. To see the latest fingerprint, make get() request to the
- // instance.
- Fingerprint string `json:"fingerprint,omitempty"`
-
- // Items: An array of tags. Each tag must be 1-63 characters long, and
- // comply with RFC1035.
- Items []string `json:"items,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Fingerprint") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "Fingerprint") 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 *Tags) MarshalJSON() ([]byte, error) {
- type NoMethod Tags
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// TargetGrpcProxy: Represents a Target gRPC Proxy resource. A target
-// gRPC proxy is a component of load balancers intended for load
-// balancing gRPC traffic. Only global forwarding rules with load
-// balancing scheme INTERNAL_SELF_MANAGED can reference a target gRPC
-// proxy. The target gRPC Proxy references a URL map that specifies how
-// traffic is routed to gRPC backend services.
-type TargetGrpcProxy struct {
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
- CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
- Description string `json:"description,omitempty"`
-
- // Fingerprint: Fingerprint of this resource. A hash of the contents
- // stored in this object. This field is used in optimistic locking. This
- // field will be ignored when inserting a TargetGrpcProxy. An up-to-date
- // fingerprint must be provided in order to patch/update the
- // TargetGrpcProxy; otherwise, the request will fail with error 412
- // conditionNotMet. To see the latest fingerprint, make a get() request
- // to retrieve the TargetGrpcProxy.
- Fingerprint string `json:"fingerprint,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource type. The
- // server generates this identifier.
- Id uint64 `json:"id,omitempty,string"`
-
- // Kind: [Output Only] Type of the resource. Always
- // compute#targetGrpcProxy for target grpc proxies.
- Kind string `json:"kind,omitempty"`
-
- // Name: Name of the resource. Provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
- // the first character must be a lowercase letter, and all following
- // characters must be a dash, lowercase letter, or digit, except the
- // last character, which cannot be a dash.
- Name string `json:"name,omitempty"`
-
- // SelfLink: [Output Only] Server-defined URL for the resource.
- SelfLink string `json:"selfLink,omitempty"`
-
- // SelfLinkWithId: [Output Only] Server-defined URL with id for the
- // resource.
- SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
-
- // UrlMap: URL to the UrlMap resource that defines the mapping from URL
- // to the BackendService. The protocol field in the BackendService must
- // be set to GRPC.
- UrlMap string `json:"urlMap,omitempty"`
-
- // ValidateForProxyless: If true, indicates that the BackendServices
- // referenced by the urlMap may be accessed by gRPC applications without
- // using a sidecar proxy. This will enable configuration checks on
- // urlMap and its referenced BackendServices to not allow unsupported
- // features. A gRPC application must use "xds:///" scheme in the target
- // URI of the service it is connecting to. If false, indicates that the
- // BackendServices referenced by the urlMap will be accessed by gRPC
- // applications via a sidecar proxy. In this case, a gRPC application
- // must not use "xds:///" scheme in the target URI of the service it is
- // connecting to
- ValidateForProxyless bool `json:"validateForProxyless,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CreationTimestamp") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetGrpcProxy) MarshalJSON() ([]byte, error) {
- type NoMethod TargetGrpcProxy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s StoragePoolTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+ type NoMethod StoragePoolTypeAggregatedListWarningData
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type TargetGrpcProxyList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+// StoragePoolTypeList: Contains a list of storage pool types.
+type StoragePoolTypeList struct {
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
- // Items: A list of TargetGrpcProxy resources.
- Items []*TargetGrpcProxy `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of the resource. Always
- // compute#targetGrpcProxy for target grpc proxies.
+ // Items: A list of StoragePoolType resources.
+ Items []*StoragePoolType `json:"items,omitempty"`
+ // Kind: [Output Only] Type of resource. Always compute#storagePoolTypeList for
+ // storage pool types.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
- Warning *TargetGrpcProxyListWarning `json:"warning,omitempty"`
+ Warning *StoragePoolTypeListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetGrpcProxyList) MarshalJSON() ([]byte, error) {
- type NoMethod TargetGrpcProxyList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s StoragePoolTypeList) MarshalJSON() ([]byte, error) {
+ type NoMethod StoragePoolTypeList
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// TargetGrpcProxyListWarning: [Output Only] Informational warning
-// message.
-type TargetGrpcProxyListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+// StoragePoolTypeListWarning: [Output Only] Informational warning message.
+type StoragePoolTypeListWarning struct {
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
- Data []*TargetGrpcProxyListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
+ Data []*StoragePoolTypeListWarningData `json:"data,omitempty"`
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetGrpcProxyListWarning) MarshalJSON() ([]byte, error) {
- type NoMethod TargetGrpcProxyListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s StoragePoolTypeListWarning) MarshalJSON() ([]byte, error) {
+ type NoMethod StoragePoolTypeListWarning
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type TargetGrpcProxyListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+type StoragePoolTypeListWarningData struct {
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "Key") 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 *TargetGrpcProxyListWarningData) MarshalJSON() ([]byte, error) {
- type NoMethod TargetGrpcProxyListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-type TargetHttpProxiesScopedList struct {
- // TargetHttpProxies: A list of TargetHttpProxies contained in this
- // scope.
- TargetHttpProxies []*TargetHttpProxy `json:"targetHttpProxies,omitempty"`
-
- // Warning: Informational warning which replaces the list of backend
- // services when the list is empty.
- Warning *TargetHttpProxiesScopedListWarning `json:"warning,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "TargetHttpProxies")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "TargetHttpProxies") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetHttpProxiesScopedList) MarshalJSON() ([]byte, error) {
- type NoMethod TargetHttpProxiesScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s StoragePoolTypeListWarningData) MarshalJSON() ([]byte, error) {
+ type NoMethod StoragePoolTypeListWarningData
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// TargetHttpProxiesScopedListWarning: Informational warning which
-// replaces the list of backend services when the list is empty.
-type TargetHttpProxiesScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
- //
- // Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+type StoragePoolTypesScopedList struct {
+ // StoragePoolTypes: [Output Only] A list of storage pool types contained in
+ // this scope.
+ StoragePoolTypes []*StoragePoolType `json:"storagePoolTypes,omitempty"`
+ // Warning: [Output Only] Informational warning which replaces the list of
+ // storage pool types when the list is empty.
+ Warning *StoragePoolTypesScopedListWarning `json:"warning,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "StoragePoolTypes") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "StoragePoolTypes") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s StoragePoolTypesScopedList) MarshalJSON() ([]byte, error) {
+ type NoMethod StoragePoolTypesScopedList
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+// StoragePoolTypesScopedListWarning: [Output Only] Informational warning which
+// replaces the list of storage pool types when the list is empty.
+type StoragePoolTypesScopedListWarning struct {
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
+ //
+ // Possible values:
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
- Data []*TargetHttpProxiesScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
+ Data []*StoragePoolTypesScopedListWarningData `json:"data,omitempty"`
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetHttpProxiesScopedListWarning) MarshalJSON() ([]byte, error) {
- type NoMethod TargetHttpProxiesScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s StoragePoolTypesScopedListWarning) MarshalJSON() ([]byte, error) {
+ type NoMethod StoragePoolTypesScopedListWarning
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type TargetHttpProxiesScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+type StoragePoolTypesScopedListWarningData struct {
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetHttpProxiesScopedListWarningData) MarshalJSON() ([]byte, error) {
- type NoMethod TargetHttpProxiesScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s StoragePoolTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
+ type NoMethod StoragePoolTypesScopedListWarningData
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// TargetHttpProxy: Represents a Target HTTP Proxy resource. Google
-// Compute Engine has two Target HTTP Proxy resources: * Global
-// (/compute/docs/reference/rest/v1/targetHttpProxies) * Regional
-// (/compute/docs/reference/rest/v1/regionTargetHttpProxies) A target
-// HTTP proxy is a component of Google Cloud HTTP load balancers. *
-// targetHttpProxies are used by global external Application Load
-// Balancers, classic Application Load Balancers, cross-region internal
-// Application Load Balancers, and Traffic Director. *
-// regionTargetHttpProxies are used by regional internal Application
-// Load Balancers and regional external Application Load Balancers.
-// Forwarding rules reference a target HTTP proxy, and the target proxy
-// then references a URL map. For more information, read Using Target
-// Proxies and Forwarding rule concepts.
-type TargetHttpProxy struct {
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
- CreationTimestamp string `json:"creationTimestamp,omitempty"`
+type StoragePoolsScopedList struct {
+ // StoragePools: [Output Only] A list of storage pool contained in this scope.
+ StoragePools []*StoragePool `json:"storagePools,omitempty"`
+ // Warning: [Output Only] Informational warning which replaces the list of
+ // storage pool when the list is empty.
+ Warning *StoragePoolsScopedListWarning `json:"warning,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "StoragePools") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "StoragePools") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
- Description string `json:"description,omitempty"`
+func (s StoragePoolsScopedList) MarshalJSON() ([]byte, error) {
+ type NoMethod StoragePoolsScopedList
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
- // Fingerprint: Fingerprint of this resource. A hash of the contents
- // stored in this object. This field is used in optimistic locking. This
- // field will be ignored when inserting a TargetHttpProxy. An up-to-date
- // fingerprint must be provided in order to patch/update the
- // TargetHttpProxy; otherwise, the request will fail with error 412
- // conditionNotMet. To see the latest fingerprint, make a get() request
- // to retrieve the TargetHttpProxy.
- Fingerprint string `json:"fingerprint,omitempty"`
+// StoragePoolsScopedListWarning: [Output Only] Informational warning which
+// replaces the list of storage pool when the list is empty.
+type StoragePoolsScopedListWarning struct {
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
+ //
+ // Possible values:
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
+ // "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
+ // resources has a type marked as experimental
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
+ // "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
+ // overridden. Deprecated unused field.
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
+ // HTTP/HTTPS/HTTP2.
+ // "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
+ // exceedingly large number of resources
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
+ // "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
+ // "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
+ // ignored.
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
+ // "UNREACHABLE" - A given scope cannot be reached.
+ Code string `json:"code,omitempty"`
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
+ Data []*StoragePoolsScopedListWarningData `json:"data,omitempty"`
+ // Message: [Output Only] A human-readable description of the warning code.
+ Message string `json:"message,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
- // HttpKeepAliveTimeoutSec: Specifies how long to keep a connection
- // open, after completing a response, while there is no matching traffic
- // (in seconds). If an HTTP keep-alive is not specified, a default value
- // (610 seconds) will be used. For global external Application Load
- // Balancers, the minimum allowed value is 5 seconds and the maximum
- // allowed value is 1200 seconds. For classic Application Load
- // Balancers, this option is not supported.
- HttpKeepAliveTimeoutSec int64 `json:"httpKeepAliveTimeoutSec,omitempty"`
+func (s StoragePoolsScopedListWarning) MarshalJSON() ([]byte, error) {
+ type NoMethod StoragePoolsScopedListWarning
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
- Id uint64 `json:"id,omitempty,string"`
+type StoragePoolsScopedListWarningData struct {
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
+ Key string `json:"key,omitempty"`
+ // Value: [Output Only] A warning data value corresponding to the key.
+ Value string `json:"value,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
- // Kind: [Output Only] Type of resource. Always compute#targetHttpProxy
- // for target HTTP proxies.
- Kind string `json:"kind,omitempty"`
+func (s StoragePoolsScopedListWarningData) MarshalJSON() ([]byte, error) {
+ type NoMethod StoragePoolsScopedListWarningData
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
- // Name: Name of the resource. Provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
- // the first character must be a lowercase letter, and all following
- // characters must be a dash, lowercase letter, or digit, except the
- // last character, which cannot be a dash.
+// Subnetwork: Represents a Subnetwork resource. A subnetwork (also known as a
+// subnet) is a logical partition of a Virtual Private Cloud network with one
+// primary IP range and zero or more secondary IP ranges. For more information,
+// read Virtual Private Cloud (VPC) Network.
+type Subnetwork struct {
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
+ CreationTimestamp string `json:"creationTimestamp,omitempty"`
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource. This field can be set only at resource
+ // creation time.
+ Description string `json:"description,omitempty"`
+ // EnableFlowLogs: Whether to enable flow logging for this subnetwork. If this
+ // field is not explicitly set, it will not appear in get listings. If not set
+ // the default behavior is determined by the org policy, if there is no org
+ // policy specified, then it will default to disabled. This field isn't
+ // supported if the subnet purpose field is set to REGIONAL_MANAGED_PROXY.
+ EnableFlowLogs bool `json:"enableFlowLogs,omitempty"`
+ // ExternalIpv6Prefix: The external IPv6 address range that is owned by this
+ // subnetwork.
+ ExternalIpv6Prefix string `json:"externalIpv6Prefix,omitempty"`
+ // Fingerprint: Fingerprint of this resource. A hash of the contents stored in
+ // this object. This field is used in optimistic locking. This field will be
+ // ignored when inserting a Subnetwork. An up-to-date fingerprint must be
+ // provided in order to update the Subnetwork, otherwise the request will fail
+ // with error 412 conditionNotMet. To see the latest fingerprint, make a get()
+ // request to retrieve a Subnetwork.
+ Fingerprint string `json:"fingerprint,omitempty"`
+ // GatewayAddress: [Output Only] The gateway address for default routes to
+ // reach destination addresses outside this subnetwork.
+ GatewayAddress string `json:"gatewayAddress,omitempty"`
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
+ Id uint64 `json:"id,omitempty,string"`
+ // InternalIpv6Prefix: The internal IPv6 address range that is owned by this
+ // subnetwork.
+ InternalIpv6Prefix string `json:"internalIpv6Prefix,omitempty"`
+ // IpCidrRange: The range of internal addresses that are owned by this
+ // subnetwork. Provide this property when you create the subnetwork. For
+ // example, 10.0.0.0/8 or 100.64.0.0/10. Ranges must be unique and
+ // non-overlapping within a network. Only IPv4 is supported. This field is set
+ // at resource creation time. The range can be any range listed in the Valid
+ // ranges list. The range can be expanded after creation using
+ // expandIpCidrRange.
+ IpCidrRange string `json:"ipCidrRange,omitempty"`
+ // Ipv6AccessType: The access type of IPv6 address this subnet holds. It's
+ // immutable and can only be specified during creation or the first time the
+ // subnet is updated into IPV4_IPV6 dual stack.
+ //
+ // Possible values:
+ // "EXTERNAL" - VMs on this subnet will be assigned IPv6 addresses that are
+ // accessible via the Internet, as well as the VPC network.
+ // "INTERNAL" - VMs on this subnet will be assigned IPv6 addresses that are
+ // only accessible over the VPC network.
+ Ipv6AccessType string `json:"ipv6AccessType,omitempty"`
+ // Ipv6CidrRange: [Output Only] This field is for internal use.
+ Ipv6CidrRange string `json:"ipv6CidrRange,omitempty"`
+ // Kind: [Output Only] Type of the resource. Always compute#subnetwork for
+ // Subnetwork resources.
+ Kind string `json:"kind,omitempty"`
+ // LogConfig: This field denotes the VPC flow logging options for this
+ // subnetwork. If logging is enabled, logs are exported to Cloud Logging.
+ LogConfig *SubnetworkLogConfig `json:"logConfig,omitempty"`
+ // Name: The name of the resource, provided by the client when initially
+ // creating the resource. The name must be 1-63 characters long, and comply
+ // with RFC1035. Specifically, the name must be 1-63 characters long and match
+ // the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first
+ // character must be a lowercase letter, and all following characters must be a
+ // dash, lowercase letter, or digit, except the last character, which cannot be
+ // a dash.
Name string `json:"name,omitempty"`
-
- // ProxyBind: This field only applies when the forwarding rule that
- // references this target proxy has a loadBalancingScheme set to
- // INTERNAL_SELF_MANAGED. When this field is set to true, Envoy proxies
- // set up inbound traffic interception and bind to the IP address and
- // port specified in the forwarding rule. This is generally useful when
- // using Traffic Director to configure Envoy as a gateway or middle
- // proxy (in other words, not a sidecar proxy). The Envoy proxy listens
- // for inbound requests and handles requests when it receives them. The
- // default is false.
- ProxyBind bool `json:"proxyBind,omitempty"`
-
- // Region: [Output Only] URL of the region where the regional Target
- // HTTP Proxy resides. This field is not applicable to global Target
- // HTTP Proxies.
+ // Network: The URL of the network to which this subnetwork belongs, provided
+ // by the client when initially creating the subnetwork. This field can be set
+ // only at resource creation time.
+ Network string `json:"network,omitempty"`
+ // PrivateIpGoogleAccess: Whether the VMs in this subnet can access Google
+ // services without assigned external IP addresses. This field can be both set
+ // at resource creation time and updated using setPrivateIpGoogleAccess.
+ PrivateIpGoogleAccess bool `json:"privateIpGoogleAccess,omitempty"`
+ // PrivateIpv6GoogleAccess: This field is for internal use. This field can be
+ // both set at resource creation time and updated using patch.
+ //
+ // Possible values:
+ // "DISABLE_GOOGLE_ACCESS" - Disable private IPv6 access to/from Google
+ // services.
+ // "ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE" - Bidirectional private IPv6
+ // access to/from Google services.
+ // "ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE" - Outbound private IPv6 access from
+ // VMs in this subnet to Google services.
+ PrivateIpv6GoogleAccess string `json:"privateIpv6GoogleAccess,omitempty"`
+ // Purpose: The purpose of the resource. This field can be either PRIVATE,
+ // GLOBAL_MANAGED_PROXY, REGIONAL_MANAGED_PROXY, PRIVATE_SERVICE_CONNECT, or
+ // PRIVATE is the default purpose for user-created subnets or subnets that are
+ // automatically created in auto mode networks. Subnets with purpose set to
+ // GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY are user-created subnetworks
+ // that are reserved for Envoy-based load balancers. A subnet with purpose set
+ // to PRIVATE_SERVICE_CONNECT is used to publish services using Private Service
+ // Connect. If unspecified, the subnet purpose defaults to PRIVATE. The
+ // enableFlowLogs field isn't supported if the subnet purpose field is set to
+ // GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY.
+ //
+ // Possible values:
+ // "GLOBAL_MANAGED_PROXY" - Subnet reserved for Global Envoy-based Load
+ // Balancing.
+ // "INTERNAL_HTTPS_LOAD_BALANCER" - Subnet reserved for Internal HTTP(S) Load
+ // Balancing. This is a legacy purpose, please use REGIONAL_MANAGED_PROXY
+ // instead.
+ // "PRIVATE" - Regular user created or automatically created subnet.
+ // "PRIVATE_NAT" - Subnetwork used as source range for Private NAT Gateways.
+ // "PRIVATE_RFC_1918" - Regular user created or automatically created subnet.
+ // "PRIVATE_SERVICE_CONNECT" - Subnetworks created for Private Service
+ // Connect in the producer network.
+ // "REGIONAL_MANAGED_PROXY" - Subnetwork used for Regional Envoy-based Load
+ // Balancing.
+ Purpose string `json:"purpose,omitempty"`
+ // Region: URL of the region where the Subnetwork resides. This field can be
+ // set only at resource creation time.
Region string `json:"region,omitempty"`
-
+ // ReservedInternalRange: The URL of the reserved internal range.
+ ReservedInternalRange string `json:"reservedInternalRange,omitempty"`
+ // Role: The role of subnetwork. Currently, this field is only used when
+ // purpose is set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY. The value
+ // can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is
+ // currently being used for Envoy-based load balancers in a region. A BACKUP
+ // subnetwork is one that is ready to be promoted to ACTIVE or is currently
+ // draining. This field can be updated with a patch request.
+ //
+ // Possible values:
+ // "ACTIVE" - The ACTIVE subnet that is currently used.
+ // "BACKUP" - The BACKUP subnet that could be promoted to ACTIVE.
+ Role string `json:"role,omitempty"`
+ // SecondaryIpRanges: An array of configurations for secondary IP ranges for VM
+ // instances contained in this subnetwork. The primary IP of such VM must
+ // belong to the primary ipCidrRange of the subnetwork. The alias IPs may
+ // belong to either primary or secondary ranges. This field can be updated with
+ // a patch request.
+ SecondaryIpRanges []*SubnetworkSecondaryRange `json:"secondaryIpRanges,omitempty"`
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
+ // StackType: The stack type for the subnet. If set to IPV4_ONLY, new VMs in
+ // the subnet are assigned IPv4 addresses only. If set to IPV4_IPV6, new VMs in
+ // the subnet can be assigned both IPv4 and IPv6 addresses. If not specified,
+ // IPV4_ONLY is used. This field can be both set at resource creation time and
+ // updated using patch.
+ //
+ // Possible values:
+ // "IPV4_IPV6" - New VMs in this subnet can have both IPv4 and IPv6
+ // addresses.
+ // "IPV4_ONLY" - New VMs in this subnet will only be assigned IPv4 addresses.
+ // "IPV6_ONLY" - New VMs in this subnet will only be assigned IPv6 addresses.
+ StackType string `json:"stackType,omitempty"`
+ // State: [Output Only] The state of the subnetwork, which can be one of the
+ // following values: READY: Subnetwork is created and ready to use DRAINING:
+ // only applicable to subnetworks that have the purpose set to
+ // INTERNAL_HTTPS_LOAD_BALANCER and indicates that connections to the load
+ // balancer are being drained. A subnetwork that is draining cannot be used or
+ // modified until it reaches a status of READY
+ //
+ // Possible values:
+ // "DRAINING" - Subnetwork is being drained.
+ // "READY" - Subnetwork is ready for use.
+ State string `json:"state,omitempty"`
- // UrlMap: URL to the UrlMap resource that defines the mapping from URL
- // to the BackendService.
- UrlMap string `json:"urlMap,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "CreationTimestamp") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CreationTimestamp") 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. "CreationTimestamp") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetHttpProxy) MarshalJSON() ([]byte, error) {
- type NoMethod TargetHttpProxy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s Subnetwork) MarshalJSON() ([]byte, error) {
+ type NoMethod Subnetwork
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type TargetHttpProxyAggregatedList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+type SubnetworkAggregatedList struct {
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
- // Items: A list of TargetHttpProxiesScopedList resources.
- Items map[string]TargetHttpProxiesScopedList `json:"items,omitempty"`
-
+ // Items: A list of SubnetworksScopedList resources.
+ Items map[string]SubnetworksScopedList `json:"items,omitempty"`
// Kind: [Output Only] Type of resource. Always
- // compute#targetHttpProxyAggregatedList for lists of Target HTTP
- // Proxies.
+ // compute#subnetworkAggregatedList for aggregated lists of subnetworks.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Unreachables: [Output Only] Unreachable resources.
Unreachables []string `json:"unreachables,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "Id") 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 *TargetHttpProxyAggregatedList) MarshalJSON() ([]byte, error) {
- type NoMethod TargetHttpProxyAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// TargetHttpProxyList: A list of TargetHttpProxy resources.
-type TargetHttpProxyList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
- Id string `json:"id,omitempty"`
-
- // Items: A list of TargetHttpProxy resources.
- Items []*TargetHttpProxy `json:"items,omitempty"`
-
- // Kind: Type of resource. Always compute#targetHttpProxyList for lists
- // of target HTTP proxies.
- Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
- NextPageToken string `json:"nextPageToken,omitempty"`
-
- // SelfLink: [Output Only] Server-defined URL for this resource.
- SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
- Warning *TargetHttpProxyListWarning `json:"warning,omitempty"`
+ Warning *SubnetworkAggregatedListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetHttpProxyList) MarshalJSON() ([]byte, error) {
- type NoMethod TargetHttpProxyList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s SubnetworkAggregatedList) MarshalJSON() ([]byte, error) {
+ type NoMethod SubnetworkAggregatedList
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// TargetHttpProxyListWarning: [Output Only] Informational warning
+// SubnetworkAggregatedListWarning: [Output Only] Informational warning
// message.
-type TargetHttpProxyListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+type SubnetworkAggregatedListWarning struct {
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
- Data []*TargetHttpProxyListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
+ Data []*SubnetworkAggregatedListWarningData `json:"data,omitempty"`
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetHttpProxyListWarning) MarshalJSON() ([]byte, error) {
- type NoMethod TargetHttpProxyListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s SubnetworkAggregatedListWarning) MarshalJSON() ([]byte, error) {
+ type NoMethod SubnetworkAggregatedListWarning
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type TargetHttpProxyListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+type SubnetworkAggregatedListWarningData struct {
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetHttpProxyListWarningData) MarshalJSON() ([]byte, error) {
- type NoMethod TargetHttpProxyListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s SubnetworkAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+ type NoMethod SubnetworkAggregatedListWarningData
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type TargetHttpsProxiesScopedList struct {
- // TargetHttpsProxies: A list of TargetHttpsProxies contained in this
- // scope.
- TargetHttpsProxies []*TargetHttpsProxy `json:"targetHttpsProxies,omitempty"`
-
- // Warning: Informational warning which replaces the list of backend
- // services when the list is empty.
- Warning *TargetHttpsProxiesScopedListWarning `json:"warning,omitempty"`
+// SubnetworkList: Contains a list of Subnetwork resources.
+type SubnetworkList struct {
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
+ Id string `json:"id,omitempty"`
+ // Items: A list of Subnetwork resources.
+ Items []*Subnetwork `json:"items,omitempty"`
+ // Kind: [Output Only] Type of resource. Always compute#subnetworkList for
+ // lists of subnetworks.
+ Kind string `json:"kind,omitempty"`
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
+ NextPageToken string `json:"nextPageToken,omitempty"`
+ // SelfLink: [Output Only] Server-defined URL for this resource.
+ SelfLink string `json:"selfLink,omitempty"`
+ // Warning: [Output Only] Informational warning message.
+ Warning *SubnetworkListWarning `json:"warning,omitempty"`
- // ForceSendFields is a list of field names (e.g. "TargetHttpsProxies")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "TargetHttpsProxies") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetHttpsProxiesScopedList) MarshalJSON() ([]byte, error) {
- type NoMethod TargetHttpsProxiesScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s SubnetworkList) MarshalJSON() ([]byte, error) {
+ type NoMethod SubnetworkList
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// TargetHttpsProxiesScopedListWarning: Informational warning which
-// replaces the list of backend services when the list is empty.
-type TargetHttpsProxiesScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+// SubnetworkListWarning: [Output Only] Informational warning message.
+type SubnetworkListWarning struct {
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
- Data []*TargetHttpsProxiesScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
+ Data []*SubnetworkListWarningData `json:"data,omitempty"`
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetHttpsProxiesScopedListWarning) MarshalJSON() ([]byte, error) {
- type NoMethod TargetHttpsProxiesScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s SubnetworkListWarning) MarshalJSON() ([]byte, error) {
+ type NoMethod SubnetworkListWarning
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type TargetHttpsProxiesScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+type SubnetworkListWarningData struct {
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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 *TargetHttpsProxiesScopedListWarningData) MarshalJSON() ([]byte, error) {
- type NoMethod TargetHttpsProxiesScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-type TargetHttpsProxiesSetCertificateMapRequest struct {
- // CertificateMap: URL of the Certificate Map to associate with this
- // TargetHttpsProxy. Accepted format is
- // //certificatemanager.googleapis.com/projects/{project
- // }/locations/{location}/certificateMaps/{resourceName}.
- CertificateMap string `json:"certificateMap,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "CertificateMap") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "CertificateMap") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetHttpsProxiesSetCertificateMapRequest) MarshalJSON() ([]byte, error) {
- type NoMethod TargetHttpsProxiesSetCertificateMapRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s SubnetworkListWarningData) MarshalJSON() ([]byte, error) {
+ type NoMethod SubnetworkListWarningData
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type TargetHttpsProxiesSetQuicOverrideRequest struct {
- // QuicOverride: QUIC policy for the TargetHttpsProxy resource.
+// SubnetworkLogConfig: The available logging options for this subnetwork.
+type SubnetworkLogConfig struct {
+ // AggregationInterval: Can only be specified if VPC flow logging for this
+ // subnetwork is enabled. Toggles the aggregation interval for collecting flow
+ // logs. Increasing the interval time will reduce the amount of generated flow
+ // logs for long lasting connections. Default is an interval of 5 seconds per
+ // connection.
//
// Possible values:
- // "DISABLE" - The load balancer will not attempt to negotiate QUIC
- // with clients.
- // "ENABLE" - The load balancer will attempt to negotiate QUIC with
- // clients.
- // "NONE" - No overrides to the default QUIC policy. This option is
- // implicit if no QUIC override has been specified in the request.
- QuicOverride string `json:"quicOverride,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "QuicOverride") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // "INTERVAL_10_MIN"
+ // "INTERVAL_15_MIN"
+ // "INTERVAL_1_MIN"
+ // "INTERVAL_30_SEC"
+ // "INTERVAL_5_MIN"
+ // "INTERVAL_5_SEC"
+ AggregationInterval string `json:"aggregationInterval,omitempty"`
+ // Enable: Whether to enable flow logging for this subnetwork. If this field is
+ // not explicitly set, it will not appear in get listings. If not set the
+ // default behavior is determined by the org policy, if there is no org policy
+ // specified, then it will default to disabled. Flow logging isn't supported if
+ // the subnet purpose field is set to REGIONAL_MANAGED_PROXY.
+ Enable bool `json:"enable,omitempty"`
+ // FilterExpr: Can only be specified if VPC flow logs for this subnetwork is
+ // enabled. The filter expression is used to define which VPC flow logs should
+ // be exported to Cloud Logging.
+ FilterExpr string `json:"filterExpr,omitempty"`
+ // FlowSampling: Can only be specified if VPC flow logging for this subnetwork
+ // is enabled. The value of the field must be in [0, 1]. Set the sampling rate
+ // of VPC flow logs within the subnetwork where 1.0 means all collected logs
+ // are reported and 0.0 means no logs are reported. Default is 0.5 unless
+ // otherwise specified by the org policy, which means half of all collected
+ // logs are reported.
+ FlowSampling float64 `json:"flowSampling,omitempty"`
+ // Metadata: Can only be specified if VPC flow logs for this subnetwork is
+ // enabled. Configures whether all, none or a subset of metadata fields should
+ // be added to the reported VPC flow logs. Default is EXCLUDE_ALL_METADATA.
+ //
+ // Possible values:
+ // "CUSTOM_METADATA"
+ // "EXCLUDE_ALL_METADATA"
+ // "INCLUDE_ALL_METADATA"
+ Metadata string `json:"metadata,omitempty"`
+ // MetadataFields: Can only be specified if VPC flow logs for this subnetwork
+ // is enabled and "metadata" was set to CUSTOM_METADATA.
+ MetadataFields []string `json:"metadataFields,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "AggregationInterval") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "QuicOverride") 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. "AggregationInterval") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetHttpsProxiesSetQuicOverrideRequest) MarshalJSON() ([]byte, error) {
- type NoMethod TargetHttpsProxiesSetQuicOverrideRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s SubnetworkLogConfig) MarshalJSON() ([]byte, error) {
+ type NoMethod SubnetworkLogConfig
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type TargetHttpsProxiesSetSslCertificatesRequest struct {
- // SslCertificates: New set of SslCertificate resources to associate
- // with this TargetHttpsProxy resource. At least one SSL certificate
- // must be specified. Currently, you may specify up to 15 SSL
- // certificates.
- SslCertificates []string `json:"sslCertificates,omitempty"`
+func (s *SubnetworkLogConfig) UnmarshalJSON(data []byte) error {
+ type NoMethod SubnetworkLogConfig
+ var s1 struct {
+ FlowSampling gensupport.JSONFloat64 `json:"flowSampling"`
+ *NoMethod
+ }
+ s1.NoMethod = (*NoMethod)(s)
+ if err := json.Unmarshal(data, &s1); err != nil {
+ return err
+ }
+ s.FlowSampling = float64(s1.FlowSampling)
+ return nil
+}
- // ForceSendFields is a list of field names (e.g. "SslCertificates") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "SslCertificates") 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.
+// SubnetworkSecondaryRange: Represents a secondary IP range of a subnetwork.
+type SubnetworkSecondaryRange struct {
+ // IpCidrRange: The range of IP addresses belonging to this subnetwork
+ // secondary range. Provide this property when you create the subnetwork.
+ // Ranges must be unique and non-overlapping with all primary and secondary IP
+ // ranges within a network. Only IPv4 is supported. The range can be any range
+ // listed in the Valid ranges list.
+ IpCidrRange string `json:"ipCidrRange,omitempty"`
+ // RangeName: The name associated with this subnetwork secondary range, used
+ // when adding an alias IP range to a VM instance. The name must be 1-63
+ // characters long, and comply with RFC1035. The name must be unique within the
+ // subnetwork.
+ RangeName string `json:"rangeName,omitempty"`
+ // ReservedInternalRange: The URL of the reserved internal range.
+ ReservedInternalRange string `json:"reservedInternalRange,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "IpCidrRange") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetHttpsProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, error) {
- type NoMethod TargetHttpsProxiesSetSslCertificatesRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s SubnetworkSecondaryRange) MarshalJSON() ([]byte, error) {
+ type NoMethod SubnetworkSecondaryRange
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// TargetHttpsProxy: Represents a Target HTTPS Proxy resource. Google
-// Compute Engine has two Target HTTPS Proxy resources: * Global
-// (/compute/docs/reference/rest/v1/targetHttpsProxies) * Regional
-// (/compute/docs/reference/rest/v1/regionTargetHttpsProxies) A target
-// HTTPS proxy is a component of GCP HTTPS load balancers. *
-// targetHttpProxies are used by global external Application Load
-// Balancers, classic Application Load Balancers, cross-region internal
-// Application Load Balancers, and Traffic Director. *
-// regionTargetHttpProxies are used by regional internal Application
-// Load Balancers and regional external Application Load Balancers.
-// Forwarding rules reference a target HTTPS proxy, and the target proxy
-// then references a URL map. For more information, read Using Target
-// Proxies and Forwarding rule concepts.
-type TargetHttpsProxy struct {
- // AuthorizationPolicy: Optional. A URL referring to a
- // networksecurity.AuthorizationPolicy resource that describes how the
- // proxy should authorize inbound traffic. If left blank, access will
- // not be restricted by an authorization policy. Refer to the
- // AuthorizationPolicy resource for additional details.
- // authorizationPolicy only applies to a global TargetHttpsProxy
- // attached to globalForwardingRules with the loadBalancingScheme set to
- // INTERNAL_SELF_MANAGED. Note: This field currently has no impact.
- AuthorizationPolicy string `json:"authorizationPolicy,omitempty"`
+type SubnetworksExpandIpCidrRangeRequest struct {
+ // IpCidrRange: The IP (in CIDR format or netmask) of internal addresses that
+ // are legal on this Subnetwork. This range should be disjoint from other
+ // subnetworks within this network. This range can only be larger than (i.e. a
+ // superset of) the range previously defined before the update.
+ IpCidrRange string `json:"ipCidrRange,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "IpCidrRange") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
- // CertificateMap: URL of a certificate map that identifies a
- // certificate map associated with the given target proxy. This field
- // can only be set for global target proxies. If set, sslCertificates
- // will be ignored. Accepted format is
- // //certificatemanager.googleapis.com/projects/{project
- // }/locations/{location}/certificateMaps/{resourceName}.
- CertificateMap string `json:"certificateMap,omitempty"`
+func (s SubnetworksExpandIpCidrRangeRequest) MarshalJSON() ([]byte, error) {
+ type NoMethod SubnetworksExpandIpCidrRangeRequest
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
- CreationTimestamp string `json:"creationTimestamp,omitempty"`
+type SubnetworksScopedList struct {
+ // Subnetworks: A list of subnetworks contained in this scope.
+ Subnetworks []*Subnetwork `json:"subnetworks,omitempty"`
+ // Warning: An informational warning that appears when the list of addresses is
+ // empty.
+ Warning *SubnetworksScopedListWarning `json:"warning,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Subnetworks") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Subnetworks") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
- Description string `json:"description,omitempty"`
+func (s SubnetworksScopedList) MarshalJSON() ([]byte, error) {
+ type NoMethod SubnetworksScopedList
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
- // Fingerprint: Fingerprint of this resource. A hash of the contents
- // stored in this object. This field is used in optimistic locking. This
- // field will be ignored when inserting a TargetHttpsProxy. An
- // up-to-date fingerprint must be provided in order to patch the
- // TargetHttpsProxy; otherwise, the request will fail with error 412
- // conditionNotMet. To see the latest fingerprint, make a get() request
- // to retrieve the TargetHttpsProxy.
- Fingerprint string `json:"fingerprint,omitempty"`
+// SubnetworksScopedListWarning: An informational warning that appears when the
+// list of addresses is empty.
+type SubnetworksScopedListWarning struct {
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
+ //
+ // Possible values:
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
+ // "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
+ // resources has a type marked as experimental
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
+ // "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
+ // overridden. Deprecated unused field.
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
+ // HTTP/HTTPS/HTTP2.
+ // "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
+ // exceedingly large number of resources
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
+ // "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
+ // "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
+ // ignored.
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
+ // "UNREACHABLE" - A given scope cannot be reached.
+ Code string `json:"code,omitempty"`
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
+ Data []*SubnetworksScopedListWarningData `json:"data,omitempty"`
+ // Message: [Output Only] A human-readable description of the warning code.
+ Message string `json:"message,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
- // HttpKeepAliveTimeoutSec: Specifies how long to keep a connection
- // open, after completing a response, while there is no matching traffic
- // (in seconds). If an HTTP keep-alive is not specified, a default value
- // (610 seconds) will be used. For global external Application Load
- // Balancers, the minimum allowed value is 5 seconds and the maximum
- // allowed value is 1200 seconds. For classic Application Load
- // Balancers, this option is not supported.
- HttpKeepAliveTimeoutSec int64 `json:"httpKeepAliveTimeoutSec,omitempty"`
+func (s SubnetworksScopedListWarning) MarshalJSON() ([]byte, error) {
+ type NoMethod SubnetworksScopedListWarning
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
- Id uint64 `json:"id,omitempty,string"`
+type SubnetworksScopedListWarningData struct {
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
+ Key string `json:"key,omitempty"`
+ // Value: [Output Only] A warning data value corresponding to the key.
+ Value string `json:"value,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
- // Kind: [Output Only] Type of resource. Always compute#targetHttpsProxy
- // for target HTTPS proxies.
- Kind string `json:"kind,omitempty"`
+func (s SubnetworksScopedListWarningData) MarshalJSON() ([]byte, error) {
+ type NoMethod SubnetworksScopedListWarningData
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
- // Name: Name of the resource. Provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
- // the first character must be a lowercase letter, and all following
- // characters must be a dash, lowercase letter, or digit, except the
- // last character, which cannot be a dash.
- Name string `json:"name,omitempty"`
+type SubnetworksSetPrivateIpGoogleAccessRequest struct {
+ PrivateIpGoogleAccess bool `json:"privateIpGoogleAccess,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "PrivateIpGoogleAccess") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "PrivateIpGoogleAccess") to
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
- // ProxyBind: This field only applies when the forwarding rule that
- // references this target proxy has a loadBalancingScheme set to
- // INTERNAL_SELF_MANAGED. When this field is set to true, Envoy proxies
- // set up inbound traffic interception and bind to the IP address and
- // port specified in the forwarding rule. This is generally useful when
- // using Traffic Director to configure Envoy as a gateway or middle
- // proxy (in other words, not a sidecar proxy). The Envoy proxy listens
- // for inbound requests and handles requests when it receives them. The
- // default is false.
- ProxyBind bool `json:"proxyBind,omitempty"`
+func (s SubnetworksSetPrivateIpGoogleAccessRequest) MarshalJSON() ([]byte, error) {
+ type NoMethod SubnetworksSetPrivateIpGoogleAccessRequest
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
- // QuicOverride: Specifies the QUIC override policy for this
- // TargetHttpsProxy resource. This setting determines whether the load
- // balancer attempts to negotiate QUIC with clients. You can specify
- // NONE, ENABLE, or DISABLE. - When quic-override is set to NONE, Google
- // manages whether QUIC is used. - When quic-override is set to ENABLE,
- // the load balancer uses QUIC when possible. - When quic-override is
- // set to DISABLE, the load balancer doesn't use QUIC. - If the
- // quic-override flag is not specified, NONE is implied.
- //
+// Subsetting: Subsetting configuration for this BackendService. Currently this
+// is applicable only for Internal TCP/UDP load balancing, Internal HTTP(S)
+// load balancing and Traffic Director.
+type Subsetting struct {
// Possible values:
- // "DISABLE" - The load balancer will not attempt to negotiate QUIC
- // with clients.
- // "ENABLE" - The load balancer will attempt to negotiate QUIC with
- // clients.
- // "NONE" - No overrides to the default QUIC policy. This option is
- // implicit if no QUIC override has been specified in the request.
- QuicOverride string `json:"quicOverride,omitempty"`
+ // "CONSISTENT_HASH_SUBSETTING" - Subsetting based on consistent hashing. For
+ // Traffic Director, the number of backends per backend group (the subset size)
+ // is based on the `subset_size` parameter. For Internal HTTP(S) load
+ // balancing, the number of backends per backend group (the subset size) is
+ // dynamically adjusted in two cases: - As the number of proxy instances
+ // participating in Internal HTTP(S) load balancing increases, the subset size
+ // decreases. - When the total number of backends in a network exceeds the
+ // capacity of a single proxy instance, subset sizes are reduced automatically
+ // for each service that has backend subsetting enabled.
+ // "NONE" - No Subsetting. Clients may open connections and send traffic to
+ // all backends of this backend service. This can lead to performance issues if
+ // there is substantial imbalance in the count of clients and backends.
+ Policy string `json:"policy,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Policy") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Policy") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
- // Region: [Output Only] URL of the region where the regional
- // TargetHttpsProxy resides. This field is not applicable to global
- // TargetHttpsProxies.
- Region string `json:"region,omitempty"`
+func (s Subsetting) MarshalJSON() ([]byte, error) {
+ type NoMethod Subsetting
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
- // SelfLink: [Output Only] Server-defined URL for the resource.
- SelfLink string `json:"selfLink,omitempty"`
+type TCPHealthCheck struct {
+ // Port: The TCP port number to which the health check prober sends packets.
+ // The default value is 80. Valid values are 1 through 65535.
+ Port int64 `json:"port,omitempty"`
+ // PortName: Not supported.
+ PortName string `json:"portName,omitempty"`
+ // PortSpecification: Specifies how a port is selected for health checking. Can
+ // be one of the following values: USE_FIXED_PORT: Specifies a port number
+ // explicitly using the port field in the health check. Supported by backend
+ // services for passthrough load balancers and backend services for proxy load
+ // balancers. Not supported by target pools. The health check supports all
+ // backends supported by the backend service provided the backend can be health
+ // checked. For example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT
+ // network endpoint groups, and instance group backends. USE_NAMED_PORT: Not
+ // supported. USE_SERVING_PORT: Provides an indirect method of specifying the
+ // health check port by referring to the backend service. Only supported by
+ // backend services for proxy load balancers. Not supported by target pools.
+ // Not supported by backend services for passthrough load balancers. Supports
+ // all backends that can be health checked; for example, GCE_VM_IP_PORT network
+ // endpoint groups and instance group backends. For GCE_VM_IP_PORT network
+ // endpoint group backends, the health check uses the port number specified for
+ // each endpoint in the network endpoint group. For instance group backends,
+ // the health check uses the port number determined by looking up the backend
+ // service's named port in the instance group's list of named ports.
+ //
+ // Possible values:
+ // "USE_FIXED_PORT" - The port number in the health check's port is used for
+ // health checking. Applies to network endpoint group and instance group
+ // backends.
+ // "USE_NAMED_PORT" - Not supported.
+ // "USE_SERVING_PORT" - For network endpoint group backends, the health check
+ // uses the port number specified on each endpoint in the network endpoint
+ // group. For instance group backends, the health check uses the port number
+ // specified for the backend service's named port defined in the instance
+ // group's named ports.
+ PortSpecification string `json:"portSpecification,omitempty"`
+ // ProxyHeader: Specifies the type of proxy header to append before sending
+ // data to the backend, either NONE or PROXY_V1. The default is NONE.
+ //
+ // Possible values:
+ // "NONE"
+ // "PROXY_V1"
+ ProxyHeader string `json:"proxyHeader,omitempty"`
+ // Request: Instructs the health check prober to send this exact ASCII string,
+ // up to 1024 bytes in length, after establishing the TCP connection.
+ Request string `json:"request,omitempty"`
+ // Response: Creates a content-based TCP health check. In addition to
+ // establishing a TCP connection, you can configure the health check to pass
+ // only when the backend sends this exact response ASCII string, up to 1024
+ // bytes in length. For details, see:
+ // https://cloud.google.com/load-balancing/docs/health-check-concepts#criteria-protocol-ssl-tcp
+ Response string `json:"response,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Port") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Port") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
- // ServerTlsPolicy: Optional. A URL referring to a
- // networksecurity.ServerTlsPolicy resource that describes how the proxy
- // should authenticate inbound traffic. serverTlsPolicy only applies to
- // a global TargetHttpsProxy attached to globalForwardingRules with the
- // loadBalancingScheme set to INTERNAL_SELF_MANAGED or EXTERNAL or
- // EXTERNAL_MANAGED. For details which ServerTlsPolicy resources are
- // accepted with INTERNAL_SELF_MANAGED and which with EXTERNAL,
- // EXTERNAL_MANAGED loadBalancingScheme consult ServerTlsPolicy
- // documentation. If left blank, communications are not encrypted.
- ServerTlsPolicy string `json:"serverTlsPolicy,omitempty"`
+func (s TCPHealthCheck) MarshalJSON() ([]byte, error) {
+ type NoMethod TCPHealthCheck
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
- // SslCertificates: URLs to SslCertificate resources that are used to
- // authenticate connections between users and the load balancer. At
- // least one SSL certificate must be specified. Currently, you may
- // specify up to 15 SSL certificates. sslCertificates do not apply when
- // the load balancing scheme is set to INTERNAL_SELF_MANAGED.
- SslCertificates []string `json:"sslCertificates,omitempty"`
+// Tags: A set of instance tags.
+type Tags struct {
+ // Fingerprint: Specifies a fingerprint for this request, which is essentially
+ // a hash of the tags' contents and used for optimistic locking. The
+ // fingerprint is initially generated by Compute Engine and changes after every
+ // request to modify or update tags. You must always provide an up-to-date
+ // fingerprint hash in order to update or change tags. To see the latest
+ // fingerprint, make get() request to the instance.
+ Fingerprint string `json:"fingerprint,omitempty"`
+ // Items: An array of tags. Each tag must be 1-63 characters long, and comply
+ // with RFC1035.
+ Items []string `json:"items,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Fingerprint") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Fingerprint") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
- // SslPolicy: URL of SslPolicy resource that will be associated with the
- // TargetHttpsProxy resource. If not set, the TargetHttpsProxy resource
- // has no SSL policy configured.
- SslPolicy string `json:"sslPolicy,omitempty"`
+func (s Tags) MarshalJSON() ([]byte, error) {
+ type NoMethod Tags
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
- // UrlMap: A fully-qualified or valid partial URL to the UrlMap resource
- // that defines the mapping from URL to the BackendService. For example,
- // the following are all valid URLs for specifying a URL map: -
- // https://www.googleapis.compute/v1/projects/project/global/urlMaps/
- // url-map - projects/project/global/urlMaps/url-map -
- // global/urlMaps/url-map
+// TargetGrpcProxy: Represents a Target gRPC Proxy resource. A target gRPC
+// proxy is a component of load balancers intended for load balancing gRPC
+// traffic. Only global forwarding rules with load balancing scheme
+// INTERNAL_SELF_MANAGED can reference a target gRPC proxy. The target gRPC
+// Proxy references a URL map that specifies how traffic is routed to gRPC
+// backend services.
+type TargetGrpcProxy struct {
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
+ CreationTimestamp string `json:"creationTimestamp,omitempty"`
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
+ Description string `json:"description,omitempty"`
+ // Fingerprint: Fingerprint of this resource. A hash of the contents stored in
+ // this object. This field is used in optimistic locking. This field will be
+ // ignored when inserting a TargetGrpcProxy. An up-to-date fingerprint must be
+ // provided in order to patch/update the TargetGrpcProxy; otherwise, the
+ // request will fail with error 412 conditionNotMet. To see the latest
+ // fingerprint, make a get() request to retrieve the TargetGrpcProxy.
+ Fingerprint string `json:"fingerprint,omitempty"`
+ // Id: [Output Only] The unique identifier for the resource type. The server
+ // generates this identifier.
+ Id uint64 `json:"id,omitempty,string"`
+ // Kind: [Output Only] Type of the resource. Always compute#targetGrpcProxy for
+ // target grpc proxies.
+ Kind string `json:"kind,omitempty"`
+ // Name: Name of the resource. Provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must
+ // be a lowercase letter, and all following characters must be a dash,
+ // lowercase letter, or digit, except the last character, which cannot be a
+ // dash.
+ Name string `json:"name,omitempty"`
+ // SelfLink: [Output Only] Server-defined URL for the resource.
+ SelfLink string `json:"selfLink,omitempty"`
+ // SelfLinkWithId: [Output Only] Server-defined URL with id for the resource.
+ SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
+ // UrlMap: URL to the UrlMap resource that defines the mapping from URL to the
+ // BackendService. The protocol field in the BackendService must be set to
+ // GRPC.
UrlMap string `json:"urlMap,omitempty"`
+ // ValidateForProxyless: If true, indicates that the BackendServices referenced
+ // by the urlMap may be accessed by gRPC applications without using a sidecar
+ // proxy. This will enable configuration checks on urlMap and its referenced
+ // BackendServices to not allow unsupported features. A gRPC application must
+ // use "xds:///" scheme in the target URI of the service it is connecting to.
+ // If false, indicates that the BackendServices referenced by the urlMap will
+ // be accessed by gRPC applications via a sidecar proxy. In this case, a gRPC
+ // application must not use "xds:///" scheme in the target URI of the service
+ // it is connecting to
+ ValidateForProxyless bool `json:"validateForProxyless,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "AuthorizationPolicy")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "CreationTimestamp") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "AuthorizationPolicy") 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. "CreationTimestamp") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetHttpsProxy) MarshalJSON() ([]byte, error) {
- type NoMethod TargetHttpsProxy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetGrpcProxy) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetGrpcProxy
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type TargetHttpsProxyAggregatedList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+type TargetGrpcProxyList struct {
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
- // Items: A list of TargetHttpsProxiesScopedList resources.
- Items map[string]TargetHttpsProxiesScopedList `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource. Always
- // compute#targetHttpsProxyAggregatedList for lists of Target HTTP
- // Proxies.
+ // Items: A list of TargetGrpcProxy resources.
+ Items []*TargetGrpcProxy `json:"items,omitempty"`
+ // Kind: [Output Only] Type of the resource. Always compute#targetGrpcProxy for
+ // target grpc proxies.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // Unreachables: [Output Only] Unreachable resources.
- Unreachables []string `json:"unreachables,omitempty"`
-
// Warning: [Output Only] Informational warning message.
- Warning *TargetHttpsProxyAggregatedListWarning `json:"warning,omitempty"`
+ Warning *TargetGrpcProxyListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetHttpsProxyAggregatedList) MarshalJSON() ([]byte, error) {
- type NoMethod TargetHttpsProxyAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetGrpcProxyList) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetGrpcProxyList
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// TargetHttpsProxyAggregatedListWarning: [Output Only] Informational
-// warning message.
-type TargetHttpsProxyAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+// TargetGrpcProxyListWarning: [Output Only] Informational warning message.
+type TargetGrpcProxyListWarning struct {
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
- Data []*TargetHttpsProxyAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
+ Data []*TargetGrpcProxyListWarningData `json:"data,omitempty"`
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetHttpsProxyAggregatedListWarning) MarshalJSON() ([]byte, error) {
- type NoMethod TargetHttpsProxyAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetGrpcProxyListWarning) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetGrpcProxyListWarning
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type TargetHttpsProxyAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+type TargetGrpcProxyListWarningData struct {
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetHttpsProxyAggregatedListWarningData) MarshalJSON() ([]byte, error) {
- type NoMethod TargetHttpsProxyAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetGrpcProxyListWarningData) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetGrpcProxyListWarningData
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// TargetHttpsProxyList: Contains a list of TargetHttpsProxy resources.
-type TargetHttpsProxyList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
- Id string `json:"id,omitempty"`
-
- // Items: A list of TargetHttpsProxy resources.
- Items []*TargetHttpsProxy `json:"items,omitempty"`
-
- // Kind: Type of resource. Always compute#targetHttpsProxyList for lists
- // of target HTTPS proxies.
- Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
- NextPageToken string `json:"nextPageToken,omitempty"`
-
- // SelfLink: [Output Only] Server-defined URL for this resource.
- SelfLink string `json:"selfLink,omitempty"`
-
- // Warning: [Output Only] Informational warning message.
- Warning *TargetHttpsProxyListWarning `json:"warning,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+type TargetHttpProxiesScopedList struct {
+ // TargetHttpProxies: A list of TargetHttpProxies contained in this scope.
+ TargetHttpProxies []*TargetHttpProxy `json:"targetHttpProxies,omitempty"`
+ // Warning: Informational warning which replaces the list of backend services
+ // when the list is empty.
+ Warning *TargetHttpProxiesScopedListWarning `json:"warning,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "TargetHttpProxies") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "TargetHttpProxies") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetHttpsProxyList) MarshalJSON() ([]byte, error) {
- type NoMethod TargetHttpsProxyList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetHttpProxiesScopedList) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetHttpProxiesScopedList
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// TargetHttpsProxyListWarning: [Output Only] Informational warning
-// message.
-type TargetHttpsProxyListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+// TargetHttpProxiesScopedListWarning: Informational warning which replaces the
+// list of backend services when the list is empty.
+type TargetHttpProxiesScopedListWarning struct {
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
- Data []*TargetHttpsProxyListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
+ Data []*TargetHttpProxiesScopedListWarningData `json:"data,omitempty"`
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetHttpsProxyListWarning) MarshalJSON() ([]byte, error) {
- type NoMethod TargetHttpsProxyListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetHttpProxiesScopedListWarning) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetHttpProxiesScopedListWarning
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type TargetHttpsProxyListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+type TargetHttpProxiesScopedListWarningData struct {
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetHttpsProxyListWarningData) MarshalJSON() ([]byte, error) {
- type NoMethod TargetHttpsProxyListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetHttpProxiesScopedListWarningData) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetHttpProxiesScopedListWarningData
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// TargetInstance: Represents a Target Instance resource. You can use a
-// target instance to handle traffic for one or more forwarding rules,
-// which is ideal for forwarding protocol traffic that is managed by a
-// single source. For example, ESP, AH, TCP, or UDP. For more
-// information, read Target instances.
-type TargetInstance struct {
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+// TargetHttpProxy: Represents a Target HTTP Proxy resource. Google Compute
+// Engine has two Target HTTP Proxy resources: * Global
+// (/compute/docs/reference/rest/v1/targetHttpProxies) * Regional
+// (/compute/docs/reference/rest/v1/regionTargetHttpProxies) A target HTTP
+// proxy is a component of Google Cloud HTTP load balancers. *
+// targetHttpProxies are used by global external Application Load Balancers,
+// classic Application Load Balancers, cross-region internal Application Load
+// Balancers, and Traffic Director. * regionTargetHttpProxies are used by
+// regional internal Application Load Balancers and regional external
+// Application Load Balancers. Forwarding rules reference a target HTTP proxy,
+// and the target proxy then references a URL map. For more information, read
+// Using Target Proxies and Forwarding rule concepts.
+type TargetHttpProxy struct {
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Fingerprint: Fingerprint of this resource. A hash of the contents stored in
+ // this object. This field is used in optimistic locking. This field will be
+ // ignored when inserting a TargetHttpProxy. An up-to-date fingerprint must be
+ // provided in order to patch/update the TargetHttpProxy; otherwise, the
+ // request will fail with error 412 conditionNotMet. To see the latest
+ // fingerprint, make a get() request to retrieve the TargetHttpProxy.
+ Fingerprint string `json:"fingerprint,omitempty"`
+ // HttpKeepAliveTimeoutSec: Specifies how long to keep a connection open, after
+ // completing a response, while there is no matching traffic (in seconds). If
+ // an HTTP keep-alive is not specified, a default value (610 seconds) will be
+ // used. For global external Application Load Balancers, the minimum allowed
+ // value is 5 seconds and the maximum allowed value is 1200 seconds. For
+ // classic Application Load Balancers, this option is not supported.
+ HttpKeepAliveTimeoutSec int64 `json:"httpKeepAliveTimeoutSec,omitempty"`
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
- // Instance: A URL to the virtual machine instance that handles traffic
- // for this target instance. When creating a target instance, you can
- // provide the fully-qualified URL or a valid partial URL to the desired
- // virtual machine. For example, the following are all valid URLs: -
- // https://www.googleapis.com/compute/v1/projects/project/zones/zone
- // /instances/instance - projects/project/zones/zone/instances/instance
- // - zones/zone/instances/instance
- Instance string `json:"instance,omitempty"`
-
- // Kind: [Output Only] The type of the resource. Always
- // compute#targetInstance for target instances.
+ // Kind: [Output Only] Type of resource. Always compute#targetHttpProxy for
+ // target HTTP proxies.
Kind string `json:"kind,omitempty"`
-
- // Name: Name of the resource. Provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
- // the first character must be a lowercase letter, and all following
- // characters must be a dash, lowercase letter, or digit, except the
- // last character, which cannot be a dash.
+ // Name: Name of the resource. Provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must
+ // be a lowercase letter, and all following characters must be a dash,
+ // lowercase letter, or digit, except the last character, which cannot be a
+ // dash.
Name string `json:"name,omitempty"`
-
- // NatPolicy: Must have a value of NO_NAT. Protocol forwarding delivers
- // packets while preserving the destination IP address of the forwarding
- // rule referencing the target instance.
- //
- // Possible values:
- // "NO_NAT" - No NAT performed.
- NatPolicy string `json:"natPolicy,omitempty"`
-
- // Network: The URL of the network this target instance uses to forward
- // traffic. If not specified, the traffic will be forwarded to the
- // network that the default network interface belongs to.
- Network string `json:"network,omitempty"`
-
- // SecurityPolicy: [Output Only] The resource URL for the security
- // policy associated with this target instance.
- SecurityPolicy string `json:"securityPolicy,omitempty"`
-
+ // ProxyBind: This field only applies when the forwarding rule that references
+ // this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED.
+ // When this field is set to true, Envoy proxies set up inbound traffic
+ // interception and bind to the IP address and port specified in the forwarding
+ // rule. This is generally useful when using Traffic Director to configure
+ // Envoy as a gateway or middle proxy (in other words, not a sidecar proxy).
+ // The Envoy proxy listens for inbound requests and handles requests when it
+ // receives them. The default is false.
+ ProxyBind bool `json:"proxyBind,omitempty"`
+ // Region: [Output Only] URL of the region where the regional Target HTTP Proxy
+ // resides. This field is not applicable to global Target HTTP Proxies.
+ Region string `json:"region,omitempty"`
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
+ // UrlMap: URL to the UrlMap resource that defines the mapping from URL to the
+ // BackendService.
+ UrlMap string `json:"urlMap,omitempty"`
- // Zone: [Output Only] URL of the zone where the target instance
- // resides. You must specify this field as part of the HTTP request URL.
- // It is not settable as a field in the request body.
- Zone string `json:"zone,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "CreationTimestamp") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CreationTimestamp") 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. "CreationTimestamp") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetInstance) MarshalJSON() ([]byte, error) {
- type NoMethod TargetInstance
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetHttpProxy) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetHttpProxy
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type TargetInstanceAggregatedList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+type TargetHttpProxyAggregatedList struct {
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
- // Items: A list of TargetInstance resources.
- Items map[string]TargetInstancesScopedList `json:"items,omitempty"`
-
- // Kind: Type of resource.
+ // Items: A list of TargetHttpProxiesScopedList resources.
+ Items map[string]TargetHttpProxiesScopedList `json:"items,omitempty"`
+ // Kind: [Output Only] Type of resource. Always
+ // compute#targetHttpProxyAggregatedList for lists of Target HTTP Proxies.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Unreachables: [Output Only] Unreachable resources.
Unreachables []string `json:"unreachables,omitempty"`
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s TargetHttpProxyAggregatedList) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetHttpProxyAggregatedList
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+// TargetHttpProxyList: A list of TargetHttpProxy resources.
+type TargetHttpProxyList struct {
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
+ Id string `json:"id,omitempty"`
+ // Items: A list of TargetHttpProxy resources.
+ Items []*TargetHttpProxy `json:"items,omitempty"`
+ // Kind: Type of resource. Always compute#targetHttpProxyList for lists of
+ // target HTTP proxies.
+ Kind string `json:"kind,omitempty"`
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
+ NextPageToken string `json:"nextPageToken,omitempty"`
+ // SelfLink: [Output Only] Server-defined URL for this resource.
+ SelfLink string `json:"selfLink,omitempty"`
// Warning: [Output Only] Informational warning message.
- Warning *TargetInstanceAggregatedListWarning `json:"warning,omitempty"`
+ Warning *TargetHttpProxyListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetInstanceAggregatedList) MarshalJSON() ([]byte, error) {
- type NoMethod TargetInstanceAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetHttpProxyList) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetHttpProxyList
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// TargetInstanceAggregatedListWarning: [Output Only] Informational
-// warning message.
-type TargetInstanceAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+// TargetHttpProxyListWarning: [Output Only] Informational warning message.
+type TargetHttpProxyListWarning struct {
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
- Data []*TargetInstanceAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
+ Data []*TargetHttpProxyListWarningData `json:"data,omitempty"`
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetInstanceAggregatedListWarning) MarshalJSON() ([]byte, error) {
- type NoMethod TargetInstanceAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetHttpProxyListWarning) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetHttpProxyListWarning
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type TargetInstanceAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+type TargetHttpProxyListWarningData struct {
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetInstanceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
- type NoMethod TargetInstanceAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetHttpProxyListWarningData) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetHttpProxyListWarningData
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// TargetInstanceList: Contains a list of TargetInstance resources.
-type TargetInstanceList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
- Id string `json:"id,omitempty"`
-
- // Items: A list of TargetInstance resources.
- Items []*TargetInstance `json:"items,omitempty"`
-
- // Kind: Type of resource.
- Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
- NextPageToken string `json:"nextPageToken,omitempty"`
-
- // SelfLink: [Output Only] Server-defined URL for this resource.
- SelfLink string `json:"selfLink,omitempty"`
-
- // Warning: [Output Only] Informational warning message.
- Warning *TargetInstanceListWarning `json:"warning,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+type TargetHttpsProxiesScopedList struct {
+ // TargetHttpsProxies: A list of TargetHttpsProxies contained in this scope.
+ TargetHttpsProxies []*TargetHttpsProxy `json:"targetHttpsProxies,omitempty"`
+ // Warning: Informational warning which replaces the list of backend services
+ // when the list is empty.
+ Warning *TargetHttpsProxiesScopedListWarning `json:"warning,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "TargetHttpsProxies") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "TargetHttpsProxies") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetInstanceList) MarshalJSON() ([]byte, error) {
- type NoMethod TargetInstanceList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetHttpsProxiesScopedList) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetHttpsProxiesScopedList
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// TargetInstanceListWarning: [Output Only] Informational warning
-// message.
-type TargetInstanceListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+// TargetHttpsProxiesScopedListWarning: Informational warning which replaces
+// the list of backend services when the list is empty.
+type TargetHttpsProxiesScopedListWarning struct {
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
- Data []*TargetInstanceListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
+ Data []*TargetHttpsProxiesScopedListWarningData `json:"data,omitempty"`
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetInstanceListWarning) MarshalJSON() ([]byte, error) {
- type NoMethod TargetInstanceListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetHttpsProxiesScopedListWarning) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetHttpsProxiesScopedListWarning
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type TargetInstanceListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+type TargetHttpsProxiesScopedListWarningData struct {
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetInstanceListWarningData) MarshalJSON() ([]byte, error) {
- type NoMethod TargetInstanceListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetHttpsProxiesScopedListWarningData) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetHttpsProxiesScopedListWarningData
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type TargetInstancesScopedList struct {
- // TargetInstances: A list of target instances contained in this scope.
- TargetInstances []*TargetInstance `json:"targetInstances,omitempty"`
-
- // Warning: Informational warning which replaces the list of addresses
- // when the list is empty.
- Warning *TargetInstancesScopedListWarning `json:"warning,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "TargetInstances") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "TargetInstances") 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.
+type TargetHttpsProxiesSetCertificateMapRequest struct {
+ // CertificateMap: URL of the Certificate Map to associate with this
+ // TargetHttpsProxy. Accepted format is
+ // //certificatemanager.googleapis.com/projects/{project
+ // }/locations/{location}/certificateMaps/{resourceName}.
+ CertificateMap string `json:"certificateMap,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "CertificateMap") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "CertificateMap") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetInstancesScopedList) MarshalJSON() ([]byte, error) {
- type NoMethod TargetInstancesScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetHttpsProxiesSetCertificateMapRequest) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetHttpsProxiesSetCertificateMapRequest
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// TargetInstancesScopedListWarning: Informational warning which
-// replaces the list of addresses when the list is empty.
-type TargetInstancesScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+type TargetHttpsProxiesSetQuicOverrideRequest struct {
+ // QuicOverride: QUIC policy for the TargetHttpsProxy resource.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
- // "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
- // "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
- // overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
- // HTTP/HTTPS/HTTP2.
- // "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
- // exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
- // "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
- // "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
- // ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
- // "UNREACHABLE" - A given scope cannot be reached.
- Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
- Data []*TargetInstancesScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
- Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // "DISABLE" - The load balancer will not attempt to negotiate QUIC with
+ // clients.
+ // "ENABLE" - The load balancer will attempt to negotiate QUIC with clients.
+ // "NONE" - No overrides to the default QUIC policy. This option is implicit
+ // if no QUIC override has been specified in the request.
+ QuicOverride string `json:"quicOverride,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "QuicOverride") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "QuicOverride") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetInstancesScopedListWarning) MarshalJSON() ([]byte, error) {
- type NoMethod TargetInstancesScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetHttpsProxiesSetQuicOverrideRequest) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetHttpsProxiesSetQuicOverrideRequest
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type TargetInstancesScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
- Key string `json:"key,omitempty"`
-
- // Value: [Output Only] A warning data value corresponding to the key.
- Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+type TargetHttpsProxiesSetSslCertificatesRequest struct {
+ // SslCertificates: New set of SslCertificate resources to associate with this
+ // TargetHttpsProxy resource. At least one SSL certificate must be specified.
+ // Currently, you may specify up to 15 SSL certificates.
+ SslCertificates []string `json:"sslCertificates,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "SslCertificates") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "SslCertificates") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetInstancesScopedListWarningData) MarshalJSON() ([]byte, error) {
- type NoMethod TargetInstancesScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetHttpsProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetHttpsProxiesSetSslCertificatesRequest
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// TargetPool: Represents a Target Pool resource. Target pools are used
-// with external passthrough Network Load Balancers. A target pool
-// references member instances, an associated legacy HttpHealthCheck
-// resource, and, optionally, a backup target pool. For more
-// information, read Using target pools.
-type TargetPool struct {
- // BackupPool: The server-defined URL for the resource. This field is
- // applicable only when the containing target pool is serving a
- // forwarding rule as the primary pool, and its failoverRatio field is
- // properly set to a value between [0, 1]. backupPool and failoverRatio
- // together define the fallback behavior of the primary target pool: if
- // the ratio of the healthy instances in the primary pool is at or below
- // failoverRatio, traffic arriving at the load-balanced IP will be
- // directed to the backup pool. In case where failoverRatio and
- // backupPool are not set, or all the instances in the backup pool are
- // unhealthy, the traffic will be directed back to the primary pool in
- // the "force" mode, where traffic will be spread to the healthy
- // instances with the best effort, or to all instances when no instance
- // is healthy.
- BackupPool string `json:"backupPool,omitempty"`
-
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+// TargetHttpsProxy: Represents a Target HTTPS Proxy resource. Google Compute
+// Engine has two Target HTTPS Proxy resources: * Global
+// (/compute/docs/reference/rest/v1/targetHttpsProxies) * Regional
+// (/compute/docs/reference/rest/v1/regionTargetHttpsProxies) A target HTTPS
+// proxy is a component of GCP HTTPS load balancers. * targetHttpProxies are
+// used by global external Application Load Balancers, classic Application Load
+// Balancers, cross-region internal Application Load Balancers, and Traffic
+// Director. * regionTargetHttpProxies are used by regional internal
+// Application Load Balancers and regional external Application Load Balancers.
+// Forwarding rules reference a target HTTPS proxy, and the target proxy then
+// references a URL map. For more information, read Using Target Proxies and
+// Forwarding rule concepts.
+type TargetHttpsProxy struct {
+ // AuthorizationPolicy: Optional. A URL referring to a
+ // networksecurity.AuthorizationPolicy resource that describes how the proxy
+ // should authorize inbound traffic. If left blank, access will not be
+ // restricted by an authorization policy. Refer to the AuthorizationPolicy
+ // resource for additional details. authorizationPolicy only applies to a
+ // global TargetHttpsProxy attached to globalForwardingRules with the
+ // loadBalancingScheme set to INTERNAL_SELF_MANAGED. Note: This field currently
+ // has no impact.
+ AuthorizationPolicy string `json:"authorizationPolicy,omitempty"`
+ // CertificateMap: URL of a certificate map that identifies a certificate map
+ // associated with the given target proxy. This field can only be set for
+ // Global external Application Load Balancer or Classic Application Load
+ // Balancer. For other products use Certificate Manager Certificates instead.
+ // If set, sslCertificates will be ignored. Accepted format is
+ // //certificatemanager.googleapis.com/projects/{project
+ // }/locations/{location}/certificateMaps/{resourceName}.
+ CertificateMap string `json:"certificateMap,omitempty"`
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // FailoverRatio: This field is applicable only when the containing
- // target pool is serving a forwarding rule as the primary pool (i.e.,
- // not as a backup pool to some other target pool). The value of the
- // field must be in [0, 1]. If set, backupPool must also be set. They
- // together define the fallback behavior of the primary target pool: if
- // the ratio of the healthy instances in the primary pool is at or below
- // this number, traffic arriving at the load-balanced IP will be
- // directed to the backup pool. In case where failoverRatio is not set
- // or all the instances in the backup pool are unhealthy, the traffic
- // will be directed back to the primary pool in the "force" mode, where
- // traffic will be spread to the healthy instances with the best effort,
- // or to all instances when no instance is healthy.
- FailoverRatio float64 `json:"failoverRatio,omitempty"`
-
- // HealthChecks: The URL of the HttpHealthCheck resource. A member
- // instance in this pool is considered healthy if and only if the health
- // checks pass. Only legacy HttpHealthChecks are supported. Only one
- // health check may be specified.
- HealthChecks []string `json:"healthChecks,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Fingerprint: Fingerprint of this resource. A hash of the contents stored in
+ // this object. This field is used in optimistic locking. This field will be
+ // ignored when inserting a TargetHttpsProxy. An up-to-date fingerprint must be
+ // provided in order to patch the TargetHttpsProxy; otherwise, the request will
+ // fail with error 412 conditionNotMet. To see the latest fingerprint, make a
+ // get() request to retrieve the TargetHttpsProxy.
+ Fingerprint string `json:"fingerprint,omitempty"`
+ // HttpKeepAliveTimeoutSec: Specifies how long to keep a connection open, after
+ // completing a response, while there is no matching traffic (in seconds). If
+ // an HTTP keep-alive is not specified, a default value (610 seconds) will be
+ // used. For global external Application Load Balancers, the minimum allowed
+ // value is 5 seconds and the maximum allowed value is 1200 seconds. For
+ // classic Application Load Balancers, this option is not supported.
+ HttpKeepAliveTimeoutSec int64 `json:"httpKeepAliveTimeoutSec,omitempty"`
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
- // Instances: A list of resource URLs to the virtual machine instances
- // serving this pool. They must live in zones contained in the same
- // region as this pool.
- Instances []string `json:"instances,omitempty"`
-
- // Kind: [Output Only] Type of the resource. Always compute#targetPool
- // for target pools.
+ // Kind: [Output Only] Type of resource. Always compute#targetHttpsProxy for
+ // target HTTPS proxies.
Kind string `json:"kind,omitempty"`
-
- // Name: Name of the resource. Provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
- // the first character must be a lowercase letter, and all following
- // characters must be a dash, lowercase letter, or digit, except the
- // last character, which cannot be a dash.
+ // Name: Name of the resource. Provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must
+ // be a lowercase letter, and all following characters must be a dash,
+ // lowercase letter, or digit, except the last character, which cannot be a
+ // dash.
Name string `json:"name,omitempty"`
-
- // Region: [Output Only] URL of the region where the target pool
- // resides.
+ // ProxyBind: This field only applies when the forwarding rule that references
+ // this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED.
+ // When this field is set to true, Envoy proxies set up inbound traffic
+ // interception and bind to the IP address and port specified in the forwarding
+ // rule. This is generally useful when using Traffic Director to configure
+ // Envoy as a gateway or middle proxy (in other words, not a sidecar proxy).
+ // The Envoy proxy listens for inbound requests and handles requests when it
+ // receives them. The default is false.
+ ProxyBind bool `json:"proxyBind,omitempty"`
+ // QuicOverride: Specifies the QUIC override policy for this TargetHttpsProxy
+ // resource. This setting determines whether the load balancer attempts to
+ // negotiate QUIC with clients. You can specify NONE, ENABLE, or DISABLE. -
+ // When quic-override is set to NONE, Google manages whether QUIC is used. -
+ // When quic-override is set to ENABLE, the load balancer uses QUIC when
+ // possible. - When quic-override is set to DISABLE, the load balancer doesn't
+ // use QUIC. - If the quic-override flag is not specified, NONE is implied.
+ //
+ // Possible values:
+ // "DISABLE" - The load balancer will not attempt to negotiate QUIC with
+ // clients.
+ // "ENABLE" - The load balancer will attempt to negotiate QUIC with clients.
+ // "NONE" - No overrides to the default QUIC policy. This option is implicit
+ // if no QUIC override has been specified in the request.
+ QuicOverride string `json:"quicOverride,omitempty"`
+ // Region: [Output Only] URL of the region where the regional TargetHttpsProxy
+ // resides. This field is not applicable to global TargetHttpsProxies.
Region string `json:"region,omitempty"`
-
- // SecurityPolicy: [Output Only] The resource URL for the security
- // policy associated with this target pool.
- SecurityPolicy string `json:"securityPolicy,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
+ // ServerTlsPolicy: Optional. A URL referring to a
+ // networksecurity.ServerTlsPolicy resource that describes how the proxy should
+ // authenticate inbound traffic. serverTlsPolicy only applies to a global
+ // TargetHttpsProxy attached to globalForwardingRules with the
+ // loadBalancingScheme set to INTERNAL_SELF_MANAGED or EXTERNAL or
+ // EXTERNAL_MANAGED. For details which ServerTlsPolicy resources are accepted
+ // with INTERNAL_SELF_MANAGED and which with EXTERNAL, EXTERNAL_MANAGED
+ // loadBalancingScheme consult ServerTlsPolicy documentation. If left blank,
+ // communications are not encrypted.
+ ServerTlsPolicy string `json:"serverTlsPolicy,omitempty"`
+ // SslCertificates: URLs to SslCertificate resources that are used to
+ // authenticate connections between users and the load balancer. At least one
+ // SSL certificate must be specified. SslCertificates do not apply when the
+ // load balancing scheme is set to INTERNAL_SELF_MANAGED. The URLs should refer
+ // to a SSL Certificate resource or Certificate Manager Certificate resource.
+ // Mixing Classic Certificates and Certificate Manager Certificates is not
+ // allowed. Certificate Manager Certificates must include the
+ // certificatemanager API. Certificate Manager Certificates are not supported
+ // by Global external Application Load Balancer or Classic Application Load
+ // Balancer, use certificate_map instead. Currently, you may specify up to 15
+ // Classic SSL Certificates. Certificate Manager Certificates accepted formats
+ // are: - //certificatemanager.googleapis.com/projects/{project}/locations/{
+ // location}/certificates/{resourceName}. -
+ // https://certificatemanager.googleapis.com/v1alpha1/projects/{project
+ // }/locations/{location}/certificates/{resourceName}.
+ SslCertificates []string `json:"sslCertificates,omitempty"`
+ // SslPolicy: URL of SslPolicy resource that will be associated with the
+ // TargetHttpsProxy resource. If not set, the TargetHttpsProxy resource has no
+ // SSL policy configured.
+ SslPolicy string `json:"sslPolicy,omitempty"`
+ // TlsEarlyData: Specifies whether TLS 1.3 0-RTT Data ("Early Data") should be
+ // accepted for this service. Early Data allows a TLS resumption handshake to
+ // include the initial application payload (a HTTP request) alongside the
+ // handshake, reducing the effective round trips to "zero". This applies to TLS
+ // 1.3 connections over TCP (HTTP/2) as well as over UDP (QUIC/h3). This can
+ // improve application performance, especially on networks where interruptions
+ // may be common, such as on mobile. Requests with Early Data will have the
+ // "Early-Data" HTTP header set on the request, with a value of "1", to allow
+ // the backend to determine whether Early Data was included. Note: TLS Early
+ // Data may allow requests to be replayed, as the data is sent to the backend
+ // before the handshake has fully completed. Applications that allow idempotent
+ // HTTP methods to make non-idempotent changes, such as a GET request updating
+ // a database, should not accept Early Data on those requests, and reject
+ // requests with the "Early-Data: 1" HTTP header by returning a HTTP 425 (Too
+ // Early) status code, in order to remain RFC compliant. The default value is
+ // DISABLED.
+ //
+ // Possible values:
+ // "DISABLED" - TLS 1.3 Early Data is not advertised, and any (invalid)
+ // attempts to send Early Data will be rejected by closing the connection.
+ // "PERMISSIVE" - This enables TLS 1.3 0-RTT, and only allows Early Data to
+ // be included on requests with safe HTTP methods (GET, HEAD, OPTIONS, TRACE).
+ // This mode does not enforce any other limitations for requests with Early
+ // Data. The application owner should validate that Early Data is acceptable
+ // for a given request path.
+ // "STRICT" - This enables TLS 1.3 0-RTT, and only allows Early Data to be
+ // included on requests with safe HTTP methods (GET, HEAD, OPTIONS, TRACE)
+ // without query parameters. Requests that send Early Data with non-idempotent
+ // HTTP methods or with query parameters will be rejected with a HTTP 425.
+ TlsEarlyData string `json:"tlsEarlyData,omitempty"`
+ // UrlMap: A fully-qualified or valid partial URL to the UrlMap resource that
+ // defines the mapping from URL to the BackendService. For example, the
+ // following are all valid URLs for specifying a URL map: -
+ // https://www.googleapis.compute/v1/projects/project/global/urlMaps/ url-map -
+ // projects/project/global/urlMaps/url-map - global/urlMaps/url-map
+ UrlMap string `json:"urlMap,omitempty"`
- // SessionAffinity: Session affinity option, must be one of the
- // following values: NONE: Connections from the same client IP may go to
- // any instance in the pool. CLIENT_IP: Connections from the same client
- // IP will go to the same instance in the pool while that instance
- // remains healthy. CLIENT_IP_PROTO: Connections from the same client IP
- // with the same IP protocol will go to the same instance in the pool
- // while that instance remains healthy.
- //
- // Possible values:
- // "CLIENT_IP" - 2-tuple hash on packet's source and destination IP
- // addresses. Connections from the same source IP address to the same
- // destination IP address will be served by the same backend VM while
- // that VM remains healthy.
- // "CLIENT_IP_NO_DESTINATION" - 1-tuple hash only on packet's source
- // IP address. Connections from the same source IP address will be
- // served by the same backend VM while that VM remains healthy. This
- // option can only be used for Internal TCP/UDP Load Balancing.
- // "CLIENT_IP_PORT_PROTO" - 5-tuple hash on packet's source and
- // destination IP addresses, IP protocol, and source and destination
- // ports. Connections for the same IP protocol from the same source IP
- // address and port to the same destination IP address and port will be
- // served by the same backend VM while that VM remains healthy. This
- // option cannot be used for HTTP(S) load balancing.
- // "CLIENT_IP_PROTO" - 3-tuple hash on packet's source and destination
- // IP addresses, and IP protocol. Connections for the same IP protocol
- // from the same source IP address to the same destination IP address
- // will be served by the same backend VM while that VM remains healthy.
- // This option cannot be used for HTTP(S) load balancing.
- // "GENERATED_COOKIE" - Hash based on a cookie generated by the L7
- // loadbalancer. Only valid for HTTP(S) load balancing.
- // "HEADER_FIELD" - The hash is based on a user specified header
- // field.
- // "HTTP_COOKIE" - The hash is based on a user provided cookie.
- // "NONE" - No session affinity. Connections from the same client IP
- // may go to any instance in the pool.
- SessionAffinity string `json:"sessionAffinity,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "BackupPool") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "AuthorizationPolicy") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "BackupPool") 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. "AuthorizationPolicy") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetPool) MarshalJSON() ([]byte, error) {
- type NoMethod TargetPool
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-func (s *TargetPool) UnmarshalJSON(data []byte) error {
- type NoMethod TargetPool
- var s1 struct {
- FailoverRatio gensupport.JSONFloat64 `json:"failoverRatio"`
- *NoMethod
- }
- s1.NoMethod = (*NoMethod)(s)
- if err := json.Unmarshal(data, &s1); err != nil {
- return err
- }
- s.FailoverRatio = float64(s1.FailoverRatio)
- return nil
+func (s TargetHttpsProxy) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetHttpsProxy
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type TargetPoolAggregatedList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+type TargetHttpsProxyAggregatedList struct {
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
- // Items: A list of TargetPool resources.
- Items map[string]TargetPoolsScopedList `json:"items,omitempty"`
-
+ // Items: A list of TargetHttpsProxiesScopedList resources.
+ Items map[string]TargetHttpsProxiesScopedList `json:"items,omitempty"`
// Kind: [Output Only] Type of resource. Always
- // compute#targetPoolAggregatedList for aggregated lists of target
- // pools.
+ // compute#targetHttpsProxyAggregatedList for lists of Target HTTP Proxies.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Unreachables: [Output Only] Unreachable resources.
Unreachables []string `json:"unreachables,omitempty"`
-
// Warning: [Output Only] Informational warning message.
- Warning *TargetPoolAggregatedListWarning `json:"warning,omitempty"`
+ Warning *TargetHttpsProxyAggregatedListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetPoolAggregatedList) MarshalJSON() ([]byte, error) {
- type NoMethod TargetPoolAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetHttpsProxyAggregatedList) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetHttpsProxyAggregatedList
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// TargetPoolAggregatedListWarning: [Output Only] Informational warning
+// TargetHttpsProxyAggregatedListWarning: [Output Only] Informational warning
// message.
-type TargetPoolAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+type TargetHttpsProxyAggregatedListWarning struct {
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
- Data []*TargetPoolAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
+ Data []*TargetHttpsProxyAggregatedListWarningData `json:"data,omitempty"`
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetPoolAggregatedListWarning) MarshalJSON() ([]byte, error) {
- type NoMethod TargetPoolAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetHttpsProxyAggregatedListWarning) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetHttpsProxyAggregatedListWarning
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type TargetPoolAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+type TargetHttpsProxyAggregatedListWarningData struct {
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "Key") 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 *TargetPoolAggregatedListWarningData) MarshalJSON() ([]byte, error) {
- type NoMethod TargetPoolAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-type TargetPoolInstanceHealth struct {
- HealthStatus []*HealthStatus `json:"healthStatus,omitempty"`
-
- // Kind: [Output Only] Type of resource. Always
- // compute#targetPoolInstanceHealth when checking the health of an
- // instance.
- Kind string `json:"kind,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "HealthStatus") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "HealthStatus") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetPoolInstanceHealth) MarshalJSON() ([]byte, error) {
- type NoMethod TargetPoolInstanceHealth
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetHttpsProxyAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetHttpsProxyAggregatedListWarningData
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// TargetPoolList: Contains a list of TargetPool resources.
-type TargetPoolList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+// TargetHttpsProxyList: Contains a list of TargetHttpsProxy resources.
+type TargetHttpsProxyList struct {
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
- // Items: A list of TargetPool resources.
- Items []*TargetPool `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource. Always compute#targetPoolList
- // for lists of target pools.
+ // Items: A list of TargetHttpsProxy resources.
+ Items []*TargetHttpsProxy `json:"items,omitempty"`
+ // Kind: Type of resource. Always compute#targetHttpsProxyList for lists of
+ // target HTTPS proxies.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
- Warning *TargetPoolListWarning `json:"warning,omitempty"`
+ Warning *TargetHttpsProxyListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetPoolList) MarshalJSON() ([]byte, error) {
- type NoMethod TargetPoolList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetHttpsProxyList) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetHttpsProxyList
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// TargetPoolListWarning: [Output Only] Informational warning message.
-type TargetPoolListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+// TargetHttpsProxyListWarning: [Output Only] Informational warning message.
+type TargetHttpsProxyListWarning struct {
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
- Data []*TargetPoolListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
+ Data []*TargetHttpsProxyListWarningData `json:"data,omitempty"`
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetPoolListWarning) MarshalJSON() ([]byte, error) {
- type NoMethod TargetPoolListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetHttpsProxyListWarning) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetHttpsProxyListWarning
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type TargetPoolListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+type TargetHttpsProxyListWarningData struct {
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetPoolListWarningData) MarshalJSON() ([]byte, error) {
- type NoMethod TargetPoolListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetHttpsProxyListWarningData) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetHttpsProxyListWarningData
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type TargetPoolsAddHealthCheckRequest struct {
- // HealthChecks: The HttpHealthCheck to add to the target pool.
- HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"`
+// TargetInstance: Represents a Target Instance resource. You can use a target
+// instance to handle traffic for one or more forwarding rules, which is ideal
+// for forwarding protocol traffic that is managed by a single source. For
+// example, ESP, AH, TCP, or UDP. For more information, read Target instances.
+type TargetInstance struct {
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
+ CreationTimestamp string `json:"creationTimestamp,omitempty"`
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
+ Description string `json:"description,omitempty"`
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
+ Id uint64 `json:"id,omitempty,string"`
+ // Instance: A URL to the virtual machine instance that handles traffic for
+ // this target instance. When creating a target instance, you can provide the
+ // fully-qualified URL or a valid partial URL to the desired virtual machine.
+ // For example, the following are all valid URLs: -
+ // https://www.googleapis.com/compute/v1/projects/project/zones/zone
+ // /instances/instance - projects/project/zones/zone/instances/instance -
+ // zones/zone/instances/instance
+ Instance string `json:"instance,omitempty"`
+ // Kind: [Output Only] The type of the resource. Always compute#targetInstance
+ // for target instances.
+ Kind string `json:"kind,omitempty"`
+ // Name: Name of the resource. Provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must
+ // be a lowercase letter, and all following characters must be a dash,
+ // lowercase letter, or digit, except the last character, which cannot be a
+ // dash.
+ Name string `json:"name,omitempty"`
+ // NatPolicy: Must have a value of NO_NAT. Protocol forwarding delivers packets
+ // while preserving the destination IP address of the forwarding rule
+ // referencing the target instance.
+ //
+ // Possible values:
+ // "NO_NAT" - No NAT performed.
+ NatPolicy string `json:"natPolicy,omitempty"`
+ // Network: The URL of the network this target instance uses to forward
+ // traffic. If not specified, the traffic will be forwarded to the network that
+ // the default network interface belongs to.
+ Network string `json:"network,omitempty"`
+ // SecurityPolicy: [Output Only] The resource URL for the security policy
+ // associated with this target instance.
+ SecurityPolicy string `json:"securityPolicy,omitempty"`
+ // SelfLink: [Output Only] Server-defined URL for the resource.
+ SelfLink string `json:"selfLink,omitempty"`
+ // Zone: [Output Only] URL of the zone where the target instance resides. You
+ // must specify this field as part of the HTTP request URL. It is not settable
+ // as a field in the request body.
+ Zone string `json:"zone,omitempty"`
- // ForceSendFields is a list of field names (e.g. "HealthChecks") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "CreationTimestamp") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "HealthChecks") 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. "CreationTimestamp") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetPoolsAddHealthCheckRequest) MarshalJSON() ([]byte, error) {
- type NoMethod TargetPoolsAddHealthCheckRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetInstance) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetInstance
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type TargetPoolsAddInstanceRequest struct {
- // Instances: A full or partial URL to an instance to add to this target
- // pool. This can be a full or partial URL. For example, the following
- // are valid URLs: -
- // https://www.googleapis.com/compute/v1/projects/project-id/zones/zone
- // /instances/instance-name -
- // projects/project-id/zones/zone/instances/instance-name -
- // zones/zone/instances/instance-name
- Instances []*InstanceReference `json:"instances,omitempty"`
+type TargetInstanceAggregatedList struct {
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
+ Id string `json:"id,omitempty"`
+ // Items: A list of TargetInstance resources.
+ Items map[string]TargetInstancesScopedList `json:"items,omitempty"`
+ // Kind: Type of resource.
+ Kind string `json:"kind,omitempty"`
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
+ NextPageToken string `json:"nextPageToken,omitempty"`
+ // SelfLink: [Output Only] Server-defined URL for this resource.
+ SelfLink string `json:"selfLink,omitempty"`
+ // Unreachables: [Output Only] Unreachable resources.
+ Unreachables []string `json:"unreachables,omitempty"`
+ // Warning: [Output Only] Informational warning message.
+ Warning *TargetInstanceAggregatedListWarning `json:"warning,omitempty"`
- // ForceSendFields is a list of field names (e.g. "Instances") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Instances") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetPoolsAddInstanceRequest) MarshalJSON() ([]byte, error) {
- type NoMethod TargetPoolsAddInstanceRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetInstanceAggregatedList) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetInstanceAggregatedList
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type TargetPoolsRemoveHealthCheckRequest struct {
- // HealthChecks: Health check URL to be removed. This can be a full or
- // valid partial URL. For example, the following are valid URLs: -
- // https://www.googleapis.com/compute/beta/projects/project
- // /global/httpHealthChecks/health-check -
- // projects/project/global/httpHealthChecks/health-check -
- // global/httpHealthChecks/health-check
- HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "HealthChecks") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+// TargetInstanceAggregatedListWarning: [Output Only] Informational warning
+// message.
+type TargetInstanceAggregatedListWarning struct {
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
+ //
+ // Possible values:
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
+ // "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
+ // resources has a type marked as experimental
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
+ // "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
+ // overridden. Deprecated unused field.
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
+ // HTTP/HTTPS/HTTP2.
+ // "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
+ // exceedingly large number of resources
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
+ // "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
+ // "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
+ // ignored.
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
+ // "UNREACHABLE" - A given scope cannot be reached.
+ Code string `json:"code,omitempty"`
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
+ Data []*TargetInstanceAggregatedListWarningData `json:"data,omitempty"`
+ // Message: [Output Only] A human-readable description of the warning code.
+ Message string `json:"message,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "HealthChecks") 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. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetPoolsRemoveHealthCheckRequest) MarshalJSON() ([]byte, error) {
- type NoMethod TargetPoolsRemoveHealthCheckRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetInstanceAggregatedListWarning) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetInstanceAggregatedListWarning
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type TargetPoolsRemoveInstanceRequest struct {
- // Instances: URLs of the instances to be removed from target pool.
- Instances []*InstanceReference `json:"instances,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Instances") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+type TargetInstanceAggregatedListWarningData struct {
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
+ Key string `json:"key,omitempty"`
+ // Value: [Output Only] A warning data value corresponding to the key.
+ Value string `json:"value,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Instances") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetPoolsRemoveInstanceRequest) MarshalJSON() ([]byte, error) {
- type NoMethod TargetPoolsRemoveInstanceRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetInstanceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetInstanceAggregatedListWarningData
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type TargetPoolsScopedList struct {
- // TargetPools: A list of target pools contained in this scope.
- TargetPools []*TargetPool `json:"targetPools,omitempty"`
-
- // Warning: Informational warning which replaces the list of addresses
- // when the list is empty.
- Warning *TargetPoolsScopedListWarning `json:"warning,omitempty"`
+// TargetInstanceList: Contains a list of TargetInstance resources.
+type TargetInstanceList struct {
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
+ Id string `json:"id,omitempty"`
+ // Items: A list of TargetInstance resources.
+ Items []*TargetInstance `json:"items,omitempty"`
+ // Kind: Type of resource.
+ Kind string `json:"kind,omitempty"`
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
+ NextPageToken string `json:"nextPageToken,omitempty"`
+ // SelfLink: [Output Only] Server-defined URL for this resource.
+ SelfLink string `json:"selfLink,omitempty"`
+ // Warning: [Output Only] Informational warning message.
+ Warning *TargetInstanceListWarning `json:"warning,omitempty"`
- // ForceSendFields is a list of field names (e.g. "TargetPools") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "TargetPools") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetPoolsScopedList) MarshalJSON() ([]byte, error) {
- type NoMethod TargetPoolsScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetInstanceList) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetInstanceList
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// TargetPoolsScopedListWarning: Informational warning which replaces
-// the list of addresses when the list is empty.
-type TargetPoolsScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+// TargetInstanceListWarning: [Output Only] Informational warning message.
+type TargetInstanceListWarning struct {
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
- Data []*TargetPoolsScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
+ Data []*TargetInstanceListWarningData `json:"data,omitempty"`
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetPoolsScopedListWarning) MarshalJSON() ([]byte, error) {
- type NoMethod TargetPoolsScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetInstanceListWarning) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetInstanceListWarning
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type TargetPoolsScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+type TargetInstanceListWarningData struct {
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetPoolsScopedListWarningData) MarshalJSON() ([]byte, error) {
- type NoMethod TargetPoolsScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetInstanceListWarningData) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetInstanceListWarningData
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type TargetReference struct {
- Target string `json:"target,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Target") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "Target") 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 *TargetReference) MarshalJSON() ([]byte, error) {
- type NoMethod TargetReference
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-type TargetSslProxiesSetBackendServiceRequest struct {
- // Service: The URL of the new BackendService resource for the
- // targetSslProxy.
- Service string `json:"service,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Service") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+type TargetInstancesScopedList struct {
+ // TargetInstances: A list of target instances contained in this scope.
+ TargetInstances []*TargetInstance `json:"targetInstances,omitempty"`
+ // Warning: Informational warning which replaces the list of addresses when the
+ // list is empty.
+ Warning *TargetInstancesScopedListWarning `json:"warning,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "TargetInstances") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Service") 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 *TargetSslProxiesSetBackendServiceRequest) MarshalJSON() ([]byte, error) {
- type NoMethod TargetSslProxiesSetBackendServiceRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-type TargetSslProxiesSetCertificateMapRequest struct {
- // CertificateMap: URL of the Certificate Map to associate with this
- // TargetSslProxy. Accepted format is
- // //certificatemanager.googleapis.com/projects/{project
- // }/locations/{location}/certificateMaps/{resourceName}.
- CertificateMap string `json:"certificateMap,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "CertificateMap") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "CertificateMap") 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. "TargetInstances") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetSslProxiesSetCertificateMapRequest) MarshalJSON() ([]byte, error) {
- type NoMethod TargetSslProxiesSetCertificateMapRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetInstancesScopedList) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetInstancesScopedList
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type TargetSslProxiesSetProxyHeaderRequest struct {
- // ProxyHeader: The new type of proxy header to append before sending
- // data to the backend. NONE or PROXY_V1 are allowed.
+// TargetInstancesScopedListWarning: Informational warning which replaces the
+// list of addresses when the list is empty.
+type TargetInstancesScopedListWarning struct {
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "NONE"
- // "PROXY_V1"
- ProxyHeader string `json:"proxyHeader,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "ProxyHeader") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
+ // "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
+ // resources has a type marked as experimental
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
+ // "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
+ // overridden. Deprecated unused field.
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
+ // HTTP/HTTPS/HTTP2.
+ // "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
+ // exceedingly large number of resources
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
+ // "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
+ // "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
+ // ignored.
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
+ // "UNREACHABLE" - A given scope cannot be reached.
+ Code string `json:"code,omitempty"`
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
+ Data []*TargetInstancesScopedListWarningData `json:"data,omitempty"`
+ // Message: [Output Only] A human-readable description of the warning code.
+ Message string `json:"message,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "ProxyHeader") 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. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetSslProxiesSetProxyHeaderRequest) MarshalJSON() ([]byte, error) {
- type NoMethod TargetSslProxiesSetProxyHeaderRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetInstancesScopedListWarning) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetInstancesScopedListWarning
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type TargetSslProxiesSetSslCertificatesRequest struct {
- // SslCertificates: New set of URLs to SslCertificate resources to
- // associate with this TargetSslProxy. At least one SSL certificate must
- // be specified. Currently, you may specify up to 15 SSL certificates.
- SslCertificates []string `json:"sslCertificates,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "SslCertificates") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "SslCertificates") 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.
+type TargetInstancesScopedListWarningData struct {
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
+ Key string `json:"key,omitempty"`
+ // Value: [Output Only] A warning data value corresponding to the key.
+ Value string `json:"value,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetSslProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, error) {
- type NoMethod TargetSslProxiesSetSslCertificatesRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetInstancesScopedListWarningData) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetInstancesScopedListWarningData
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// TargetSslProxy: Represents a Target SSL Proxy resource. A target SSL
-// proxy is a component of a Proxy Network Load Balancer. The forwarding
-// rule references the target SSL proxy, and the target proxy then
-// references a backend service. For more information, read Proxy
-// Network Load Balancer overview.
-type TargetSslProxy struct {
- // CertificateMap: URL of a certificate map that identifies a
- // certificate map associated with the given target proxy. This field
- // can only be set for global target proxies. If set, sslCertificates
- // will be ignored. Accepted format is
- // //certificatemanager.googleapis.com/projects/{project
- // }/locations/{location}/certificateMaps/{resourceName}.
- CertificateMap string `json:"certificateMap,omitempty"`
-
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+// TargetPool: Represents a Target Pool resource. Target pools are used with
+// external passthrough Network Load Balancers. A target pool references member
+// instances, an associated legacy HttpHealthCheck resource, and, optionally, a
+// backup target pool. For more information, read Using target pools.
+type TargetPool struct {
+ // BackupPool: The server-defined URL for the resource. This field is
+ // applicable only when the containing target pool is serving a forwarding rule
+ // as the primary pool, and its failoverRatio field is properly set to a value
+ // between [0, 1]. backupPool and failoverRatio together define the fallback
+ // behavior of the primary target pool: if the ratio of the healthy instances
+ // in the primary pool is at or below failoverRatio, traffic arriving at the
+ // load-balanced IP will be directed to the backup pool. In case where
+ // failoverRatio and backupPool are not set, or all the instances in the backup
+ // pool are unhealthy, the traffic will be directed back to the primary pool in
+ // the "force" mode, where traffic will be spread to the healthy instances with
+ // the best effort, or to all instances when no instance is healthy.
+ BackupPool string `json:"backupPool,omitempty"`
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // FailoverRatio: This field is applicable only when the containing target pool
+ // is serving a forwarding rule as the primary pool (i.e., not as a backup pool
+ // to some other target pool). The value of the field must be in [0, 1]. If
+ // set, backupPool must also be set. They together define the fallback behavior
+ // of the primary target pool: if the ratio of the healthy instances in the
+ // primary pool is at or below this number, traffic arriving at the
+ // load-balanced IP will be directed to the backup pool. In case where
+ // failoverRatio is not set or all the instances in the backup pool are
+ // unhealthy, the traffic will be directed back to the primary pool in the
+ // "force" mode, where traffic will be spread to the healthy instances with the
+ // best effort, or to all instances when no instance is healthy.
+ FailoverRatio float64 `json:"failoverRatio,omitempty"`
+ // HealthChecks: The URL of the HttpHealthCheck resource. A member instance in
+ // this pool is considered healthy if and only if the health checks pass. Only
+ // legacy HttpHealthChecks are supported. Only one health check may be
+ // specified.
+ HealthChecks []string `json:"healthChecks,omitempty"`
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
- // Kind: [Output Only] Type of the resource. Always
- // compute#targetSslProxy for target SSL proxies.
+ // Instances: A list of resource URLs to the virtual machine instances serving
+ // this pool. They must live in zones contained in the same region as this
+ // pool.
+ Instances []string `json:"instances,omitempty"`
+ // Kind: [Output Only] Type of the resource. Always compute#targetPool for
+ // target pools.
Kind string `json:"kind,omitempty"`
-
- // Name: Name of the resource. Provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
- // the first character must be a lowercase letter, and all following
- // characters must be a dash, lowercase letter, or digit, except the
- // last character, which cannot be a dash.
+ // Name: Name of the resource. Provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must
+ // be a lowercase letter, and all following characters must be a dash,
+ // lowercase letter, or digit, except the last character, which cannot be a
+ // dash.
Name string `json:"name,omitempty"`
-
- // ProxyHeader: Specifies the type of proxy header to append before
- // sending data to the backend, either NONE or PROXY_V1. The default is
- // NONE.
- //
- // Possible values:
- // "NONE"
- // "PROXY_V1"
- ProxyHeader string `json:"proxyHeader,omitempty"`
-
+ // Region: [Output Only] URL of the region where the target pool resides.
+ Region string `json:"region,omitempty"`
+ // SecurityPolicy: [Output Only] The resource URL for the security policy
+ // associated with this target pool.
+ SecurityPolicy string `json:"securityPolicy,omitempty"`
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
+ // SessionAffinity: Session affinity option, must be one of the following
+ // values: NONE: Connections from the same client IP may go to any instance in
+ // the pool. CLIENT_IP: Connections from the same client IP will go to the same
+ // instance in the pool while that instance remains healthy. CLIENT_IP_PROTO:
+ // Connections from the same client IP with the same IP protocol will go to the
+ // same instance in the pool while that instance remains healthy.
+ //
+ // Possible values:
+ // "CLIENT_IP" - 2-tuple hash on packet's source and destination IP
+ // addresses. Connections from the same source IP address to the same
+ // destination IP address will be served by the same backend VM while that VM
+ // remains healthy.
+ // "CLIENT_IP_NO_DESTINATION" - 1-tuple hash only on packet's source IP
+ // address. Connections from the same source IP address will be served by the
+ // same backend VM while that VM remains healthy. This option can only be used
+ // for Internal TCP/UDP Load Balancing.
+ // "CLIENT_IP_PORT_PROTO" - 5-tuple hash on packet's source and destination
+ // IP addresses, IP protocol, and source and destination ports. Connections for
+ // the same IP protocol from the same source IP address and port to the same
+ // destination IP address and port will be served by the same backend VM while
+ // that VM remains healthy. This option cannot be used for HTTP(S) load
+ // balancing.
+ // "CLIENT_IP_PROTO" - 3-tuple hash on packet's source and destination IP
+ // addresses, and IP protocol. Connections for the same IP protocol from the
+ // same source IP address to the same destination IP address will be served by
+ // the same backend VM while that VM remains healthy. This option cannot be
+ // used for HTTP(S) load balancing.
+ // "GENERATED_COOKIE" - Hash based on a cookie generated by the L7
+ // loadbalancer. Only valid for HTTP(S) load balancing.
+ // "HEADER_FIELD" - The hash is based on a user specified header field.
+ // "HTTP_COOKIE" - The hash is based on a user provided cookie.
+ // "NONE" - No session affinity. Connections from the same client IP may go
+ // to any instance in the pool.
+ // "STRONG_COOKIE_AFFINITY" - Strong cookie-based affinity. Connections
+ // bearing the same cookie will be served by the same backend VM while that VM
+ // remains healthy, as long as the cookie has not expired.
+ SessionAffinity string `json:"sessionAffinity,omitempty"`
- // Service: URL to the BackendService resource.
- Service string `json:"service,omitempty"`
-
- // SslCertificates: URLs to SslCertificate resources that are used to
- // authenticate connections to Backends. At least one SSL certificate
- // must be specified. Currently, you may specify up to 15 SSL
- // certificates. sslCertificates do not apply when the load balancing
- // scheme is set to INTERNAL_SELF_MANAGED.
- SslCertificates []string `json:"sslCertificates,omitempty"`
-
- // SslPolicy: URL of SslPolicy resource that will be associated with the
- // TargetSslProxy resource. If not set, the TargetSslProxy resource will
- // not have any SSL policy configured.
- SslPolicy string `json:"sslPolicy,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "CertificateMap") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "CertificateMap") 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.
+ // ForceSendFields is a list of field names (e.g. "BackupPool") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "BackupPool") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetSslProxy) MarshalJSON() ([]byte, error) {
- type NoMethod TargetSslProxy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetPool) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetPool
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// TargetSslProxyList: Contains a list of TargetSslProxy resources.
-type TargetSslProxyList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
- Id string `json:"id,omitempty"`
-
- // Items: A list of TargetSslProxy resources.
- Items []*TargetSslProxy `json:"items,omitempty"`
+func (s *TargetPool) UnmarshalJSON(data []byte) error {
+ type NoMethod TargetPool
+ var s1 struct {
+ FailoverRatio gensupport.JSONFloat64 `json:"failoverRatio"`
+ *NoMethod
+ }
+ s1.NoMethod = (*NoMethod)(s)
+ if err := json.Unmarshal(data, &s1); err != nil {
+ return err
+ }
+ s.FailoverRatio = float64(s1.FailoverRatio)
+ return nil
+}
- // Kind: Type of resource.
+type TargetPoolAggregatedList struct {
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
+ Id string `json:"id,omitempty"`
+ // Items: A list of TargetPool resources.
+ Items map[string]TargetPoolsScopedList `json:"items,omitempty"`
+ // Kind: [Output Only] Type of resource. Always
+ // compute#targetPoolAggregatedList for aggregated lists of target pools.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
+ // Unreachables: [Output Only] Unreachable resources.
+ Unreachables []string `json:"unreachables,omitempty"`
// Warning: [Output Only] Informational warning message.
- Warning *TargetSslProxyListWarning `json:"warning,omitempty"`
+ Warning *TargetPoolAggregatedListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetSslProxyList) MarshalJSON() ([]byte, error) {
- type NoMethod TargetSslProxyList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetPoolAggregatedList) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetPoolAggregatedList
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// TargetSslProxyListWarning: [Output Only] Informational warning
+// TargetPoolAggregatedListWarning: [Output Only] Informational warning
// message.
-type TargetSslProxyListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+type TargetPoolAggregatedListWarning struct {
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
- Data []*TargetSslProxyListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
+ Data []*TargetPoolAggregatedListWarningData `json:"data,omitempty"`
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetSslProxyListWarning) MarshalJSON() ([]byte, error) {
- type NoMethod TargetSslProxyListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetPoolAggregatedListWarning) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetPoolAggregatedListWarning
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type TargetSslProxyListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+type TargetPoolAggregatedListWarningData struct {
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetSslProxyListWarningData) MarshalJSON() ([]byte, error) {
- type NoMethod TargetSslProxyListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetPoolAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetPoolAggregatedListWarningData
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type TargetTcpProxiesScopedList struct {
- // TargetTcpProxies: A list of TargetTcpProxies contained in this scope.
- TargetTcpProxies []*TargetTcpProxy `json:"targetTcpProxies,omitempty"`
+type TargetPoolInstanceHealth struct {
+ HealthStatus []*HealthStatus `json:"healthStatus,omitempty"`
+ // Kind: [Output Only] Type of resource. Always
+ // compute#targetPoolInstanceHealth when checking the health of an instance.
+ Kind string `json:"kind,omitempty"`
- // Warning: Informational warning which replaces the list of backend
- // services when the list is empty.
- Warning *TargetTcpProxiesScopedListWarning `json:"warning,omitempty"`
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "HealthStatus") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "HealthStatus") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
- // ForceSendFields is a list of field names (e.g. "TargetTcpProxies") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "TargetTcpProxies") 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.
+func (s TargetPoolInstanceHealth) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetPoolInstanceHealth
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+// TargetPoolList: Contains a list of TargetPool resources.
+type TargetPoolList struct {
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
+ Id string `json:"id,omitempty"`
+ // Items: A list of TargetPool resources.
+ Items []*TargetPool `json:"items,omitempty"`
+ // Kind: [Output Only] Type of resource. Always compute#targetPoolList for
+ // lists of target pools.
+ Kind string `json:"kind,omitempty"`
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
+ NextPageToken string `json:"nextPageToken,omitempty"`
+ // SelfLink: [Output Only] Server-defined URL for this resource.
+ SelfLink string `json:"selfLink,omitempty"`
+ // Warning: [Output Only] Informational warning message.
+ Warning *TargetPoolListWarning `json:"warning,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetTcpProxiesScopedList) MarshalJSON() ([]byte, error) {
- type NoMethod TargetTcpProxiesScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetPoolList) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetPoolList
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// TargetTcpProxiesScopedListWarning: Informational warning which
-// replaces the list of backend services when the list is empty.
-type TargetTcpProxiesScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+// TargetPoolListWarning: [Output Only] Informational warning message.
+type TargetPoolListWarning struct {
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
- Data []*TargetTcpProxiesScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
+ Data []*TargetPoolListWarningData `json:"data,omitempty"`
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetTcpProxiesScopedListWarning) MarshalJSON() ([]byte, error) {
- type NoMethod TargetTcpProxiesScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetPoolListWarning) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetPoolListWarning
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type TargetTcpProxiesScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+type TargetPoolListWarningData struct {
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetTcpProxiesScopedListWarningData) MarshalJSON() ([]byte, error) {
- type NoMethod TargetTcpProxiesScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetPoolListWarningData) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetPoolListWarningData
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type TargetTcpProxiesSetBackendServiceRequest struct {
- // Service: The URL of the new BackendService resource for the
- // targetTcpProxy.
- Service string `json:"service,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Service") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+type TargetPoolsAddHealthCheckRequest struct {
+ // HealthChecks: The HttpHealthCheck to add to the target pool.
+ HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "HealthChecks") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "HealthChecks") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s TargetPoolsAddHealthCheckRequest) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetPoolsAddHealthCheckRequest
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
- // NullFields is a list of field names (e.g. "Service") 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.
+type TargetPoolsAddInstanceRequest struct {
+ // Instances: A full or partial URL to an instance to add to this target pool.
+ // This can be a full or partial URL. For example, the following are valid
+ // URLs: - https://www.googleapis.com/compute/v1/projects/project-id/zones/zone
+ // /instances/instance-name -
+ // projects/project-id/zones/zone/instances/instance-name -
+ // zones/zone/instances/instance-name
+ Instances []*InstanceReference `json:"instances,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Instances") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Instances") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetTcpProxiesSetBackendServiceRequest) MarshalJSON() ([]byte, error) {
- type NoMethod TargetTcpProxiesSetBackendServiceRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetPoolsAddInstanceRequest) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetPoolsAddInstanceRequest
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type TargetTcpProxiesSetProxyHeaderRequest struct {
- // ProxyHeader: The new type of proxy header to append before sending
- // data to the backend. NONE or PROXY_V1 are allowed.
+type TargetPoolsRemoveHealthCheckRequest struct {
+ // HealthChecks: Health check URL to be removed. This can be a full or valid
+ // partial URL. For example, the following are valid URLs: -
+ // https://www.googleapis.com/compute/beta/projects/project
+ // /global/httpHealthChecks/health-check -
+ // projects/project/global/httpHealthChecks/health-check -
+ // global/httpHealthChecks/health-check
+ HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "HealthChecks") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "HealthChecks") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s TargetPoolsRemoveHealthCheckRequest) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetPoolsRemoveHealthCheckRequest
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+type TargetPoolsRemoveInstanceRequest struct {
+ // Instances: URLs of the instances to be removed from target pool.
+ Instances []*InstanceReference `json:"instances,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Instances") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Instances") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s TargetPoolsRemoveInstanceRequest) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetPoolsRemoveInstanceRequest
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+type TargetPoolsScopedList struct {
+ // TargetPools: A list of target pools contained in this scope.
+ TargetPools []*TargetPool `json:"targetPools,omitempty"`
+ // Warning: Informational warning which replaces the list of addresses when the
+ // list is empty.
+ Warning *TargetPoolsScopedListWarning `json:"warning,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "TargetPools") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "TargetPools") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s TargetPoolsScopedList) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetPoolsScopedList
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+// TargetPoolsScopedListWarning: Informational warning which replaces the list
+// of addresses when the list is empty.
+type TargetPoolsScopedListWarning struct {
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
+ //
+ // Possible values:
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
+ // "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
+ // resources has a type marked as experimental
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
+ // "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
+ // overridden. Deprecated unused field.
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
+ // HTTP/HTTPS/HTTP2.
+ // "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
+ // exceedingly large number of resources
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
+ // "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
+ // "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
+ // ignored.
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
+ // "UNREACHABLE" - A given scope cannot be reached.
+ Code string `json:"code,omitempty"`
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
+ Data []*TargetPoolsScopedListWarningData `json:"data,omitempty"`
+ // Message: [Output Only] A human-readable description of the warning code.
+ Message string `json:"message,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s TargetPoolsScopedListWarning) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetPoolsScopedListWarning
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+type TargetPoolsScopedListWarningData struct {
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
+ Key string `json:"key,omitempty"`
+ // Value: [Output Only] A warning data value corresponding to the key.
+ Value string `json:"value,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s TargetPoolsScopedListWarningData) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetPoolsScopedListWarningData
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+type TargetReference struct {
+ Target string `json:"target,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Target") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Target") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s TargetReference) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetReference
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+type TargetSslProxiesSetBackendServiceRequest struct {
+ // Service: The URL of the new BackendService resource for the targetSslProxy.
+ Service string `json:"service,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Service") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Service") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s TargetSslProxiesSetBackendServiceRequest) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetSslProxiesSetBackendServiceRequest
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+type TargetSslProxiesSetCertificateMapRequest struct {
+ // CertificateMap: URL of the Certificate Map to associate with this
+ // TargetSslProxy. Accepted format is
+ // //certificatemanager.googleapis.com/projects/{project
+ // }/locations/{location}/certificateMaps/{resourceName}.
+ CertificateMap string `json:"certificateMap,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "CertificateMap") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "CertificateMap") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s TargetSslProxiesSetCertificateMapRequest) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetSslProxiesSetCertificateMapRequest
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+type TargetSslProxiesSetProxyHeaderRequest struct {
+ // ProxyHeader: The new type of proxy header to append before sending data to
+ // the backend. NONE or PROXY_V1 are allowed.
//
// Possible values:
// "NONE"
// "PROXY_V1"
ProxyHeader string `json:"proxyHeader,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "ProxyHeader") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "ProxyHeader") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s TargetSslProxiesSetProxyHeaderRequest) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetSslProxiesSetProxyHeaderRequest
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
- // NullFields is a list of field names (e.g. "ProxyHeader") 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.
+type TargetSslProxiesSetSslCertificatesRequest struct {
+ // SslCertificates: New set of URLs to SslCertificate resources to associate
+ // with this TargetSslProxy. At least one SSL certificate must be specified.
+ // Currently, you may specify up to 15 SSL certificates.
+ SslCertificates []string `json:"sslCertificates,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "SslCertificates") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "SslCertificates") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetTcpProxiesSetProxyHeaderRequest) MarshalJSON() ([]byte, error) {
- type NoMethod TargetTcpProxiesSetProxyHeaderRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetSslProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetSslProxiesSetSslCertificatesRequest
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// TargetTcpProxy: Represents a Target TCP Proxy resource. A target TCP
-// proxy is a component of a Proxy Network Load Balancer. The forwarding
-// rule references the target TCP proxy, and the target proxy then
-// references a backend service. For more information, read Proxy
-// Network Load Balancer overview.
-type TargetTcpProxy struct {
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+// TargetSslProxy: Represents a Target SSL Proxy resource. A target SSL proxy
+// is a component of a Proxy Network Load Balancer. The forwarding rule
+// references the target SSL proxy, and the target proxy then references a
+// backend service. For more information, read Proxy Network Load Balancer
+// overview.
+type TargetSslProxy struct {
+ // CertificateMap: URL of a certificate map that identifies a certificate map
+ // associated with the given target proxy. This field can only be set for
+ // global target proxies. If set, sslCertificates will be ignored. Accepted
+ // format is //certificatemanager.googleapis.com/projects/{project
+ // }/locations/{location}/certificateMaps/{resourceName}.
+ CertificateMap string `json:"certificateMap,omitempty"`
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
- // Kind: [Output Only] Type of the resource. Always
- // compute#targetTcpProxy for target TCP proxies.
+ // Kind: [Output Only] Type of the resource. Always compute#targetSslProxy for
+ // target SSL proxies.
Kind string `json:"kind,omitempty"`
-
- // Name: Name of the resource. Provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
- // the first character must be a lowercase letter, and all following
- // characters must be a dash, lowercase letter, or digit, except the
- // last character, which cannot be a dash.
+ // Name: Name of the resource. Provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must
+ // be a lowercase letter, and all following characters must be a dash,
+ // lowercase letter, or digit, except the last character, which cannot be a
+ // dash.
Name string `json:"name,omitempty"`
-
- // ProxyBind: This field only applies when the forwarding rule that
- // references this target proxy has a loadBalancingScheme set to
- // INTERNAL_SELF_MANAGED. When this field is set to true, Envoy proxies
- // set up inbound traffic interception and bind to the IP address and
- // port specified in the forwarding rule. This is generally useful when
- // using Traffic Director to configure Envoy as a gateway or middle
- // proxy (in other words, not a sidecar proxy). The Envoy proxy listens
- // for inbound requests and handles requests when it receives them. The
- // default is false.
- ProxyBind bool `json:"proxyBind,omitempty"`
-
- // ProxyHeader: Specifies the type of proxy header to append before
- // sending data to the backend, either NONE or PROXY_V1. The default is
- // NONE.
+ // ProxyHeader: Specifies the type of proxy header to append before sending
+ // data to the backend, either NONE or PROXY_V1. The default is NONE.
//
// Possible values:
// "NONE"
// "PROXY_V1"
ProxyHeader string `json:"proxyHeader,omitempty"`
-
- // Region: [Output Only] URL of the region where the regional TCP proxy
- // resides. This field is not applicable to global TCP proxy.
- Region string `json:"region,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Service: URL to the BackendService resource.
Service string `json:"service,omitempty"`
+ // SslCertificates: URLs to SslCertificate resources that are used to
+ // authenticate connections to Backends. At least one SSL certificate must be
+ // specified. Currently, you may specify up to 15 SSL certificates.
+ // sslCertificates do not apply when the load balancing scheme is set to
+ // INTERNAL_SELF_MANAGED.
+ SslCertificates []string `json:"sslCertificates,omitempty"`
+ // SslPolicy: URL of SslPolicy resource that will be associated with the
+ // TargetSslProxy resource. If not set, the TargetSslProxy resource will not
+ // have any SSL policy configured.
+ SslPolicy string `json:"sslPolicy,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "CertificateMap") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CreationTimestamp") 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. "CertificateMap") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetTcpProxy) MarshalJSON() ([]byte, error) {
- type NoMethod TargetTcpProxy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetSslProxy) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetSslProxy
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type TargetTcpProxyAggregatedList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+// TargetSslProxyList: Contains a list of TargetSslProxy resources.
+type TargetSslProxyList struct {
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
- // Items: A list of TargetTcpProxiesScopedList resources.
- Items map[string]TargetTcpProxiesScopedList `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource. Always
- // compute#targetTcpProxyAggregatedList for lists of Target TCP Proxies.
+ // Items: A list of TargetSslProxy resources.
+ Items []*TargetSslProxy `json:"items,omitempty"`
+ // Kind: Type of resource.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // Unreachables: [Output Only] Unreachable resources.
- Unreachables []string `json:"unreachables,omitempty"`
-
// Warning: [Output Only] Informational warning message.
- Warning *TargetTcpProxyAggregatedListWarning `json:"warning,omitempty"`
+ Warning *TargetSslProxyListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetTcpProxyAggregatedList) MarshalJSON() ([]byte, error) {
- type NoMethod TargetTcpProxyAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetSslProxyList) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetSslProxyList
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// TargetTcpProxyAggregatedListWarning: [Output Only] Informational
-// warning message.
-type TargetTcpProxyAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+// TargetSslProxyListWarning: [Output Only] Informational warning message.
+type TargetSslProxyListWarning struct {
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
- Data []*TargetTcpProxyAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
+ Data []*TargetSslProxyListWarningData `json:"data,omitempty"`
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetTcpProxyAggregatedListWarning) MarshalJSON() ([]byte, error) {
- type NoMethod TargetTcpProxyAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetSslProxyListWarning) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetSslProxyListWarning
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type TargetTcpProxyAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+type TargetSslProxyListWarningData struct {
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetTcpProxyAggregatedListWarningData) MarshalJSON() ([]byte, error) {
- type NoMethod TargetTcpProxyAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetSslProxyListWarningData) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetSslProxyListWarningData
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// TargetTcpProxyList: Contains a list of TargetTcpProxy resources.
-type TargetTcpProxyList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
- Id string `json:"id,omitempty"`
-
- // Items: A list of TargetTcpProxy resources.
- Items []*TargetTcpProxy `json:"items,omitempty"`
-
- // Kind: Type of resource.
- Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
- NextPageToken string `json:"nextPageToken,omitempty"`
-
- // SelfLink: [Output Only] Server-defined URL for this resource.
- SelfLink string `json:"selfLink,omitempty"`
-
- // Warning: [Output Only] Informational warning message.
- Warning *TargetTcpProxyListWarning `json:"warning,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+type TargetTcpProxiesScopedList struct {
+ // TargetTcpProxies: A list of TargetTcpProxies contained in this scope.
+ TargetTcpProxies []*TargetTcpProxy `json:"targetTcpProxies,omitempty"`
+ // Warning: Informational warning which replaces the list of backend services
+ // when the list is empty.
+ Warning *TargetTcpProxiesScopedListWarning `json:"warning,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "TargetTcpProxies") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "TargetTcpProxies") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetTcpProxyList) MarshalJSON() ([]byte, error) {
- type NoMethod TargetTcpProxyList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetTcpProxiesScopedList) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetTcpProxiesScopedList
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// TargetTcpProxyListWarning: [Output Only] Informational warning
-// message.
-type TargetTcpProxyListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+// TargetTcpProxiesScopedListWarning: Informational warning which replaces the
+// list of backend services when the list is empty.
+type TargetTcpProxiesScopedListWarning struct {
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
- Data []*TargetTcpProxyListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
+ Data []*TargetTcpProxiesScopedListWarningData `json:"data,omitempty"`
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetTcpProxyListWarning) MarshalJSON() ([]byte, error) {
- type NoMethod TargetTcpProxyListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetTcpProxiesScopedListWarning) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetTcpProxiesScopedListWarning
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-type TargetTcpProxyListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+type TargetTcpProxiesScopedListWarningData struct {
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetTcpProxyListWarningData) MarshalJSON() ([]byte, error) {
- type NoMethod TargetTcpProxyListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+func (s TargetTcpProxiesScopedListWarningData) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetTcpProxiesScopedListWarningData
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// TargetVpnGateway: Represents a Target VPN Gateway resource. The
-// target VPN gateway resource represents a Classic Cloud VPN gateway.
-// For more information, read the the Cloud VPN Overview.
-type TargetVpnGateway struct {
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
- CreationTimestamp string `json:"creationTimestamp,omitempty"`
+type TargetTcpProxiesSetBackendServiceRequest struct {
+ // Service: The URL of the new BackendService resource for the targetTcpProxy.
+ Service string `json:"service,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Service") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Service") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
- Description string `json:"description,omitempty"`
+func (s TargetTcpProxiesSetBackendServiceRequest) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetTcpProxiesSetBackendServiceRequest
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
- // ForwardingRules: [Output Only] A list of URLs to the ForwardingRule
- // resources. ForwardingRules are created using
- // compute.forwardingRules.insert and associated with a VPN gateway.
- ForwardingRules []string `json:"forwardingRules,omitempty"`
+type TargetTcpProxiesSetProxyHeaderRequest struct {
+ // ProxyHeader: The new type of proxy header to append before sending data to
+ // the backend. NONE or PROXY_V1 are allowed.
+ //
+ // Possible values:
+ // "NONE"
+ // "PROXY_V1"
+ ProxyHeader string `json:"proxyHeader,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "ProxyHeader") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "ProxyHeader") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s TargetTcpProxiesSetProxyHeaderRequest) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetTcpProxiesSetProxyHeaderRequest
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+// TargetTcpProxy: Represents a Target TCP Proxy resource. A target TCP proxy
+// is a component of a Proxy Network Load Balancer. The forwarding rule
+// references the target TCP proxy, and the target proxy then references a
+// backend service. For more information, read Proxy Network Load Balancer
+// overview.
+type TargetTcpProxy struct {
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
+ CreationTimestamp string `json:"creationTimestamp,omitempty"`
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
+ Description string `json:"description,omitempty"`
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
+ // Kind: [Output Only] Type of the resource. Always compute#targetTcpProxy for
+ // target TCP proxies.
+ Kind string `json:"kind,omitempty"`
+ // Name: Name of the resource. Provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must
+ // be a lowercase letter, and all following characters must be a dash,
+ // lowercase letter, or digit, except the last character, which cannot be a
+ // dash.
+ Name string `json:"name,omitempty"`
+ // ProxyBind: This field only applies when the forwarding rule that references
+ // this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED.
+ // When this field is set to true, Envoy proxies set up inbound traffic
+ // interception and bind to the IP address and port specified in the forwarding
+ // rule. This is generally useful when using Traffic Director to configure
+ // Envoy as a gateway or middle proxy (in other words, not a sidecar proxy).
+ // The Envoy proxy listens for inbound requests and handles requests when it
+ // receives them. The default is false.
+ ProxyBind bool `json:"proxyBind,omitempty"`
+ // ProxyHeader: Specifies the type of proxy header to append before sending
+ // data to the backend, either NONE or PROXY_V1. The default is NONE.
+ //
+ // Possible values:
+ // "NONE"
+ // "PROXY_V1"
+ ProxyHeader string `json:"proxyHeader,omitempty"`
+ // Region: [Output Only] URL of the region where the regional TCP proxy
+ // resides. This field is not applicable to global TCP proxy.
+ Region string `json:"region,omitempty"`
+ // SelfLink: [Output Only] Server-defined URL for the resource.
+ SelfLink string `json:"selfLink,omitempty"`
+ // Service: URL to the BackendService resource.
+ Service string `json:"service,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "CreationTimestamp") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "CreationTimestamp") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s TargetTcpProxy) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetTcpProxy
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+type TargetTcpProxyAggregatedList struct {
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
+ Id string `json:"id,omitempty"`
+ // Items: A list of TargetTcpProxiesScopedList resources.
+ Items map[string]TargetTcpProxiesScopedList `json:"items,omitempty"`
+ // Kind: [Output Only] Type of resource. Always
+ // compute#targetTcpProxyAggregatedList for lists of Target TCP Proxies.
+ Kind string `json:"kind,omitempty"`
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
+ NextPageToken string `json:"nextPageToken,omitempty"`
+ // SelfLink: [Output Only] Server-defined URL for this resource.
+ SelfLink string `json:"selfLink,omitempty"`
+ // Unreachables: [Output Only] Unreachable resources.
+ Unreachables []string `json:"unreachables,omitempty"`
+ // Warning: [Output Only] Informational warning message.
+ Warning *TargetTcpProxyAggregatedListWarning `json:"warning,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
- // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
- // for target VPN gateways.
+func (s TargetTcpProxyAggregatedList) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetTcpProxyAggregatedList
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+// TargetTcpProxyAggregatedListWarning: [Output Only] Informational warning
+// message.
+type TargetTcpProxyAggregatedListWarning struct {
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
+ //
+ // Possible values:
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
+ // "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
+ // resources has a type marked as experimental
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
+ // "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
+ // overridden. Deprecated unused field.
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
+ // HTTP/HTTPS/HTTP2.
+ // "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
+ // exceedingly large number of resources
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
+ // "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
+ // "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
+ // ignored.
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
+ // "UNREACHABLE" - A given scope cannot be reached.
+ Code string `json:"code,omitempty"`
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
+ Data []*TargetTcpProxyAggregatedListWarningData `json:"data,omitempty"`
+ // Message: [Output Only] A human-readable description of the warning code.
+ Message string `json:"message,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s TargetTcpProxyAggregatedListWarning) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetTcpProxyAggregatedListWarning
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+type TargetTcpProxyAggregatedListWarningData struct {
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
+ Key string `json:"key,omitempty"`
+ // Value: [Output Only] A warning data value corresponding to the key.
+ Value string `json:"value,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s TargetTcpProxyAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetTcpProxyAggregatedListWarningData
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+// TargetTcpProxyList: Contains a list of TargetTcpProxy resources.
+type TargetTcpProxyList struct {
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
+ Id string `json:"id,omitempty"`
+ // Items: A list of TargetTcpProxy resources.
+ Items []*TargetTcpProxy `json:"items,omitempty"`
+ // Kind: Type of resource.
Kind string `json:"kind,omitempty"`
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
+ NextPageToken string `json:"nextPageToken,omitempty"`
+ // SelfLink: [Output Only] Server-defined URL for this resource.
+ SelfLink string `json:"selfLink,omitempty"`
+ // Warning: [Output Only] Informational warning message.
+ Warning *TargetTcpProxyListWarning `json:"warning,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s TargetTcpProxyList) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetTcpProxyList
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+// TargetTcpProxyListWarning: [Output Only] Informational warning message.
+type TargetTcpProxyListWarning struct {
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
+ //
+ // Possible values:
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
+ // "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
+ // resources has a type marked as experimental
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
+ // "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
+ // overridden. Deprecated unused field.
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
+ // HTTP/HTTPS/HTTP2.
+ // "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
+ // exceedingly large number of resources
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
+ // "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
+ // "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
+ // ignored.
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
+ // "UNREACHABLE" - A given scope cannot be reached.
+ Code string `json:"code,omitempty"`
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
+ Data []*TargetTcpProxyListWarningData `json:"data,omitempty"`
+ // Message: [Output Only] A human-readable description of the warning code.
+ Message string `json:"message,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s TargetTcpProxyListWarning) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetTcpProxyListWarning
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+type TargetTcpProxyListWarningData struct {
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
+ Key string `json:"key,omitempty"`
+ // Value: [Output Only] A warning data value corresponding to the key.
+ Value string `json:"value,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+func (s TargetTcpProxyListWarningData) MarshalJSON() ([]byte, error) {
+ type NoMethod TargetTcpProxyListWarningData
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+// TargetVpnGateway: Represents a Target VPN Gateway resource. The target VPN
+// gateway resource represents a Classic Cloud VPN gateway. For more
+// information, read the the Cloud VPN Overview.
+type TargetVpnGateway struct {
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
+ CreationTimestamp string `json:"creationTimestamp,omitempty"`
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
+ Description string `json:"description,omitempty"`
+ // ForwardingRules: [Output Only] A list of URLs to the ForwardingRule
+ // resources. ForwardingRules are created using compute.forwardingRules.insert
+ // and associated with a VPN gateway.
+ ForwardingRules []string `json:"forwardingRules,omitempty"`
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
+ Id uint64 `json:"id,omitempty,string"`
+ // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway for
+ // target VPN gateways.
+ Kind string `json:"kind,omitempty"`
// LabelFingerprint: A fingerprint for the labels being applied to this
- // TargetVpnGateway, which is essentially a hash of the labels set used
- // for optimistic locking. The fingerprint is initially generated by
- // Compute Engine and changes after every request to modify or update
- // labels. You must always provide an up-to-date fingerprint hash in
- // order to update or change labels, otherwise the request will fail
- // with error 412 conditionNotMet. To see the latest fingerprint, make a
- // get() request to retrieve a TargetVpnGateway.
+ // TargetVpnGateway, which is essentially a hash of the labels set used for
+ // optimistic locking. The fingerprint is initially generated by Compute Engine
+ // and changes after every request to modify or update labels. You must always
+ // provide an up-to-date fingerprint hash in order to update or change labels,
+ // otherwise the request will fail with error 412 conditionNotMet. To see the
+ // latest fingerprint, make a get() request to retrieve a TargetVpnGateway.
LabelFingerprint string `json:"labelFingerprint,omitempty"`
-
- // Labels: Labels for this resource. These can only be added or modified
- // by the setLabels method. Each label key/value pair must comply with
- // RFC1035. Label values may be empty.
+ // Labels: Labels for this resource. These can only be added or modified by the
+ // setLabels method. Each label key/value pair must comply with RFC1035. Label
+ // values may be empty.
Labels map[string]string `json:"labels,omitempty"`
-
- // Name: Name of the resource. Provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
- // the first character must be a lowercase letter, and all following
- // characters must be a dash, lowercase letter, or digit, except the
- // last character, which cannot be a dash.
+ // Name: Name of the resource. Provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must
+ // be a lowercase letter, and all following characters must be a dash,
+ // lowercase letter, or digit, except the last character, which cannot be a
+ // dash.
Name string `json:"name,omitempty"`
-
- // Network: URL of the network to which this VPN gateway is attached.
- // Provided by the client when the VPN gateway is created.
+ // Network: URL of the network to which this VPN gateway is attached. Provided
+ // by the client when the VPN gateway is created.
Network string `json:"network,omitempty"`
-
// Region: [Output Only] URL of the region where the target VPN gateway
- // resides. You must specify this field as part of the HTTP request URL.
- // It is not settable as a field in the request body.
+ // resides. You must specify this field as part of the HTTP request URL. It is
+ // not settable as a field in the request body.
Region string `json:"region,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // Status: [Output Only] The status of the VPN gateway, which can be one
- // of the following: CREATING, READY, FAILED, or DELETING.
+ // Status: [Output Only] The status of the VPN gateway, which can be one of the
+ // following: CREATING, READY, FAILED, or DELETING.
//
// Possible values:
// "CREATING"
@@ -58161,3098 +49983,2498 @@ type TargetVpnGateway struct {
// "FAILED"
// "READY"
Status string `json:"status,omitempty"`
-
- // Tunnels: [Output Only] A list of URLs to VpnTunnel resources.
- // VpnTunnels are created using the compute.vpntunnels.insert method and
- // associated with a VPN gateway.
+ // Tunnels: [Output Only] A list of URLs to VpnTunnel resources. VpnTunnels are
+ // created using the compute.vpntunnels.insert method and associated with a VPN
+ // gateway.
Tunnels []string `json:"tunnels,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "CreationTimestamp") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CreationTimestamp") 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. "CreationTimestamp") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetVpnGateway) MarshalJSON() ([]byte, error) {
+func (s TargetVpnGateway) MarshalJSON() ([]byte, error) {
type NoMethod TargetVpnGateway
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type TargetVpnGatewayAggregatedList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of TargetVpnGateway resources.
Items map[string]TargetVpnGatewaysScopedList `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
- // for target VPN gateways.
+ // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway for
+ // target VPN gateways.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Unreachables: [Output Only] Unreachable resources.
Unreachables []string `json:"unreachables,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *TargetVpnGatewayAggregatedListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetVpnGatewayAggregatedList) MarshalJSON() ([]byte, error) {
+func (s TargetVpnGatewayAggregatedList) MarshalJSON() ([]byte, error) {
type NoMethod TargetVpnGatewayAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// TargetVpnGatewayAggregatedListWarning: [Output Only] Informational
-// warning message.
+// TargetVpnGatewayAggregatedListWarning: [Output Only] Informational warning
+// message.
type TargetVpnGatewayAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*TargetVpnGatewayAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetVpnGatewayAggregatedListWarning) MarshalJSON() ([]byte, error) {
+func (s TargetVpnGatewayAggregatedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod TargetVpnGatewayAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type TargetVpnGatewayAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetVpnGatewayAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+func (s TargetVpnGatewayAggregatedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod TargetVpnGatewayAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// TargetVpnGatewayList: Contains a list of TargetVpnGateway resources.
type TargetVpnGatewayList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of TargetVpnGateway resources.
Items []*TargetVpnGateway `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
- // for target VPN gateways.
+ // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway for
+ // target VPN gateways.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *TargetVpnGatewayListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetVpnGatewayList) MarshalJSON() ([]byte, error) {
+func (s TargetVpnGatewayList) MarshalJSON() ([]byte, error) {
type NoMethod TargetVpnGatewayList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// TargetVpnGatewayListWarning: [Output Only] Informational warning
-// message.
+// TargetVpnGatewayListWarning: [Output Only] Informational warning message.
type TargetVpnGatewayListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*TargetVpnGatewayListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetVpnGatewayListWarning) MarshalJSON() ([]byte, error) {
+func (s TargetVpnGatewayListWarning) MarshalJSON() ([]byte, error) {
type NoMethod TargetVpnGatewayListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type TargetVpnGatewayListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetVpnGatewayListWarningData) MarshalJSON() ([]byte, error) {
+func (s TargetVpnGatewayListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod TargetVpnGatewayListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type TargetVpnGatewaysScopedList struct {
- // TargetVpnGateways: [Output Only] A list of target VPN gateways
- // contained in this scope.
+ // TargetVpnGateways: [Output Only] A list of target VPN gateways contained in
+ // this scope.
TargetVpnGateways []*TargetVpnGateway `json:"targetVpnGateways,omitempty"`
-
- // Warning: [Output Only] Informational warning which replaces the list
- // of addresses when the list is empty.
+ // Warning: [Output Only] Informational warning which replaces the list of
+ // addresses when the list is empty.
Warning *TargetVpnGatewaysScopedListWarning `json:"warning,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "TargetVpnGateways")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "TargetVpnGateways") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "TargetVpnGateways") 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. "TargetVpnGateways") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetVpnGatewaysScopedList) MarshalJSON() ([]byte, error) {
+func (s TargetVpnGatewaysScopedList) MarshalJSON() ([]byte, error) {
type NoMethod TargetVpnGatewaysScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// TargetVpnGatewaysScopedListWarning: [Output Only] Informational
-// warning which replaces the list of addresses when the list is empty.
+// TargetVpnGatewaysScopedListWarning: [Output Only] Informational warning
+// which replaces the list of addresses when the list is empty.
type TargetVpnGatewaysScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*TargetVpnGatewaysScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetVpnGatewaysScopedListWarning) MarshalJSON() ([]byte, error) {
+func (s TargetVpnGatewaysScopedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod TargetVpnGatewaysScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type TargetVpnGatewaysScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TargetVpnGatewaysScopedListWarningData) MarshalJSON() ([]byte, error) {
+func (s TargetVpnGatewaysScopedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod TargetVpnGatewaysScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type TestFailure struct {
// ActualOutputUrl: The actual output URL evaluated by a load balancer
// containing the scheme, host, path and query parameters.
ActualOutputUrl string `json:"actualOutputUrl,omitempty"`
-
// ActualRedirectResponseCode: Actual HTTP status code for rule with
// `urlRedirect` calculated by load balancer
ActualRedirectResponseCode int64 `json:"actualRedirectResponseCode,omitempty"`
-
- // ActualService: BackendService or BackendBucket returned by load
- // balancer.
+ // ActualService: BackendService or BackendBucket returned by load balancer.
ActualService string `json:"actualService,omitempty"`
-
- // ExpectedOutputUrl: The expected output URL evaluated by a load
- // balancer containing the scheme, host, path and query parameters.
+ // ExpectedOutputUrl: The expected output URL evaluated by a load balancer
+ // containing the scheme, host, path and query parameters.
ExpectedOutputUrl string `json:"expectedOutputUrl,omitempty"`
-
// ExpectedRedirectResponseCode: Expected HTTP status code for rule with
// `urlRedirect` calculated by load balancer
ExpectedRedirectResponseCode int64 `json:"expectedRedirectResponseCode,omitempty"`
-
- // ExpectedService: Expected BackendService or BackendBucket resource
- // the given URL should be mapped to.
+ // ExpectedService: Expected BackendService or BackendBucket resource the given
+ // URL should be mapped to.
ExpectedService string `json:"expectedService,omitempty"`
-
// Headers: HTTP headers of the request.
Headers []*UrlMapTestHeader `json:"headers,omitempty"`
-
// Host: Host portion of the URL.
Host string `json:"host,omitempty"`
-
// Path: Path portion including query parameters in the URL.
Path string `json:"path,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "ActualOutputUrl") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "ActualOutputUrl") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "ActualOutputUrl") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TestFailure) MarshalJSON() ([]byte, error) {
+func (s TestFailure) MarshalJSON() ([]byte, error) {
type NoMethod TestFailure
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type TestPermissionsRequest struct {
- // Permissions: The set of permissions to check for the 'resource'.
- // Permissions with wildcards (such as '*' or 'storage.*') are not
- // allowed.
+ // Permissions: The set of permissions to check for the 'resource'. Permissions
+ // with wildcards (such as '*' or 'storage.*') are not allowed.
Permissions []string `json:"permissions,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Permissions") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Permissions") 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. "Permissions") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TestPermissionsRequest) MarshalJSON() ([]byte, error) {
+func (s TestPermissionsRequest) MarshalJSON() ([]byte, error) {
type NoMethod TestPermissionsRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type TestPermissionsResponse struct {
- // Permissions: A subset of `TestPermissionsRequest.permissions` that
- // the caller is allowed.
+ // Permissions: A subset of `TestPermissionsRequest.permissions` that the
+ // caller is allowed.
Permissions []string `json:"permissions,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
// ForceSendFields is a list of field names (e.g. "Permissions") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Permissions") 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. "Permissions") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *TestPermissionsResponse) MarshalJSON() ([]byte, error) {
+func (s TestPermissionsResponse) MarshalJSON() ([]byte, error) {
type NoMethod TestPermissionsResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type Uint128 struct {
High uint64 `json:"high,omitempty,string"`
-
- Low uint64 `json:"low,omitempty,string"`
-
- // ForceSendFields is a list of field names (e.g. "High") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ Low uint64 `json:"low,omitempty,string"`
+ // ForceSendFields is a list of field names (e.g. "High") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "High") 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. "High") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *Uint128) MarshalJSON() ([]byte, error) {
+func (s Uint128) MarshalJSON() ([]byte, error) {
type NoMethod Uint128
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// UpcomingMaintenance: Upcoming Maintenance notification information.
type UpcomingMaintenance struct {
- // CanReschedule: Indicates if the maintenance can be customer
- // triggered.
+ // CanReschedule: Indicates if the maintenance can be customer triggered.
CanReschedule bool `json:"canReschedule,omitempty"`
-
- // LatestWindowStartTime: The latest time for the planned maintenance
- // window to start. This timestamp value is in RFC3339 text format.
+ // LatestWindowStartTime: The latest time for the planned maintenance window to
+ // start. This timestamp value is in RFC3339 text format.
LatestWindowStartTime string `json:"latestWindowStartTime,omitempty"`
-
// Possible values:
// "ONGOING" - There is ongoing maintenance on this VM.
// "PENDING" - There is pending maintenance.
// "UNKNOWN" - Unknown maintenance status. Do not use this value.
MaintenanceStatus string `json:"maintenanceStatus,omitempty"`
-
// Type: Defines the type of maintenance.
//
// Possible values:
// "SCHEDULED" - Scheduled maintenance (e.g. maintenance after uptime
// guarantee is complete).
// "UNKNOWN_TYPE" - No type specified. Do not use this value.
- // "UNSCHEDULED" - Unscheduled maintenance (e.g. emergency maintenance
- // during uptime guarantee).
+ // "UNSCHEDULED" - Unscheduled maintenance (e.g. emergency maintenance during
+ // uptime guarantee).
Type string `json:"type,omitempty"`
-
// WindowEndTime: The time by which the maintenance disruption will be
// completed. This timestamp value is in RFC3339 text format.
WindowEndTime string `json:"windowEndTime,omitempty"`
-
- // WindowStartTime: The current start time of the maintenance window.
- // This timestamp value is in RFC3339 text format.
+ // WindowStartTime: The current start time of the maintenance window. This
+ // timestamp value is in RFC3339 text format.
WindowStartTime string `json:"windowStartTime,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "CanReschedule") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CanReschedule") 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. "CanReschedule") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *UpcomingMaintenance) MarshalJSON() ([]byte, error) {
+func (s UpcomingMaintenance) MarshalJSON() ([]byte, error) {
type NoMethod UpcomingMaintenance
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// UrlMap: Represents a URL Map resource. Compute Engine has two URL Map
-// resources: * Global (/compute/docs/reference/rest/v1/urlMaps) *
-// Regional (/compute/docs/reference/rest/v1/regionUrlMaps) A URL map
-// resource is a component of certain types of cloud load balancers and
-// Traffic Director: * urlMaps are used by global external Application
-// Load Balancers, classic Application Load Balancers, and cross-region
-// internal Application Load Balancers. * regionUrlMaps are used by
-// internal Application Load Balancers, regional external Application
-// Load Balancers and regional internal Application Load Balancers. For
-// a list of supported URL map features by the load balancer type, see
-// the Load balancing features: Routing and traffic management table.
-// For a list of supported URL map features for Traffic Director, see
-// the Traffic Director features: Routing and traffic management table.
-// This resource defines mappings from hostnames and URL paths to either
-// a backend service or a backend bucket. To use the global urlMaps
-// resource, the backend service must have a loadBalancingScheme of
-// either EXTERNAL or INTERNAL_SELF_MANAGED. To use the regionUrlMaps
+// resources: * Global (/compute/docs/reference/rest/v1/urlMaps) * Regional
+// (/compute/docs/reference/rest/v1/regionUrlMaps) A URL map resource is a
+// component of certain types of cloud load balancers and Traffic Director: *
+// urlMaps are used by global external Application Load Balancers, classic
+// Application Load Balancers, and cross-region internal Application Load
+// Balancers. * regionUrlMaps are used by internal Application Load Balancers,
+// regional external Application Load Balancers and regional internal
+// Application Load Balancers. For a list of supported URL map features by the
+// load balancer type, see the Load balancing features: Routing and traffic
+// management table. For a list of supported URL map features for Traffic
+// Director, see the Traffic Director features: Routing and traffic management
+// table. This resource defines mappings from hostnames and URL paths to either
+// a backend service or a backend bucket. To use the global urlMaps resource,
+// the backend service must have a loadBalancingScheme of either EXTERNAL,
+// EXTERNAL_MANAGED, or INTERNAL_SELF_MANAGED. To use the regionUrlMaps
// resource, the backend service must have a loadBalancingScheme of
// INTERNAL_MANAGED. For more information, read URL Map Concepts.
type UrlMap struct {
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
+ // DefaultCustomErrorResponsePolicy: defaultCustomErrorResponsePolicy specifies
+ // how the Load Balancer returns error responses when BackendServiceor
+ // BackendBucket responds with an error. This policy takes effect at the load
+ // balancer level and applies only when no policy has been defined for the
+ // error code at lower levels like PathMatcher, RouteRule and PathRule within
+ // this UrlMap. For example, consider a UrlMap with the following
+ // configuration: - defaultCustomErrorResponsePolicy containing policies for
+ // responding to 5xx and 4xx errors - A PathMatcher configured for
+ // *.example.com has defaultCustomErrorResponsePolicy for 4xx. If a request for
+ // http://www.example.com/ encounters a 404, the policy in
+ // pathMatcher.defaultCustomErrorResponsePolicy will be enforced. When the
+ // request for http://www.example.com/ encounters a 502, the policy in
+ // UrlMap.defaultCustomErrorResponsePolicy will be enforced. When a request
+ // that does not match any host in *.example.com such as
+ // http://www.myotherexample.com/, encounters a 404,
+ // UrlMap.defaultCustomErrorResponsePolicy takes effect. When used in
+ // conjunction with defaultRouteAction.retryPolicy, retries take precedence.
+ // Only once all retries are exhausted, the defaultCustomErrorResponsePolicy is
+ // applied. While attempting a retry, if load balancer is successful in
+ // reaching the service, the defaultCustomErrorResponsePolicy is ignored and
+ // the response from the service is returned to the client.
+ // defaultCustomErrorResponsePolicy is supported only for global external
+ // Application Load Balancers.
+ DefaultCustomErrorResponsePolicy *CustomErrorResponsePolicy `json:"defaultCustomErrorResponsePolicy,omitempty"`
// DefaultRouteAction: defaultRouteAction takes effect when none of the
- // hostRules match. The load balancer performs advanced routing actions,
- // such as URL rewrites and header transformations, before forwarding
- // the request to the selected backend. If defaultRouteAction specifies
- // any weightedBackendServices, defaultService must not be set.
- // Conversely if defaultService is set, defaultRouteAction cannot
- // contain any weightedBackendServices. Only one of defaultRouteAction
- // or defaultUrlRedirect must be set. URL maps for classic Application
- // Load Balancers only support the urlRewrite action within
- // defaultRouteAction. defaultRouteAction has no effect when the URL map
- // is bound to a target gRPC proxy that has the validateForProxyless
- // field set to true.
+ // hostRules match. The load balancer performs advanced routing actions, such
+ // as URL rewrites and header transformations, before forwarding the request to
+ // the selected backend. If defaultRouteAction specifies any
+ // weightedBackendServices, defaultService must not be set. Conversely if
+ // defaultService is set, defaultRouteAction cannot contain any
+ // weightedBackendServices. Only one of defaultRouteAction or
+ // defaultUrlRedirect must be set. URL maps for classic Application Load
+ // Balancers only support the urlRewrite action within defaultRouteAction.
+ // defaultRouteAction has no effect when the URL map is bound to a target gRPC
+ // proxy that has the validateForProxyless field set to true.
DefaultRouteAction *HttpRouteAction `json:"defaultRouteAction,omitempty"`
-
- // DefaultService: The full or partial URL of the defaultService
- // resource to which traffic is directed if none of the hostRules match.
- // If defaultRouteAction is also specified, advanced routing actions,
- // such as URL rewrites, take effect before sending the request to the
- // backend. However, if defaultService is specified, defaultRouteAction
- // cannot contain any weightedBackendServices. Conversely, if
- // routeAction specifies any weightedBackendServices, service must not
- // be specified. Only one of defaultService, defaultUrlRedirect , or
- // defaultRouteAction.weightedBackendService must be set. defaultService
- // has no effect when the URL map is bound to a target gRPC proxy that
- // has the validateForProxyless field set to true.
+ // DefaultService: The full or partial URL of the defaultService resource to
+ // which traffic is directed if none of the hostRules match. If
+ // defaultRouteAction is also specified, advanced routing actions, such as URL
+ // rewrites, take effect before sending the request to the backend. However, if
+ // defaultService is specified, defaultRouteAction cannot contain any
+ // defaultRouteAction.weightedBackendServices. Conversely, if
+ // defaultRouteAction specifies any defaultRouteAction.weightedBackendServices,
+ // defaultService must not be specified. If defaultService is specified, then
+ // set either defaultUrlRedirect , or defaultRouteAction.weightedBackendService
+ // Don't set both. defaultService has no effect when the URL map is bound to a
+ // target gRPC proxy that has the validateForProxyless field set to true.
DefaultService string `json:"defaultService,omitempty"`
-
- // DefaultUrlRedirect: When none of the specified hostRules match, the
- // request is redirected to a URL specified by defaultUrlRedirect. If
- // defaultUrlRedirect is specified, defaultService or defaultRouteAction
- // must not be set. Not supported when the URL map is bound to a target
- // gRPC proxy.
+ // DefaultUrlRedirect: When none of the specified hostRules match, the request
+ // is redirected to a URL specified by defaultUrlRedirect. If
+ // defaultUrlRedirect is specified, defaultService or defaultRouteAction must
+ // not be set. Not supported when the URL map is bound to a target gRPC proxy.
DefaultUrlRedirect *HttpRedirectAction `json:"defaultUrlRedirect,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // Fingerprint: Fingerprint of this resource. A hash of the contents
- // stored in this object. This field is used in optimistic locking. This
- // field is ignored when inserting a UrlMap. An up-to-date fingerprint
- // must be provided in order to update the UrlMap, otherwise the request
- // will fail with error 412 conditionNotMet. To see the latest
- // fingerprint, make a get() request to retrieve a UrlMap.
+ // Fingerprint: Fingerprint of this resource. A hash of the contents stored in
+ // this object. This field is used in optimistic locking. This field is ignored
+ // when inserting a UrlMap. An up-to-date fingerprint must be provided in order
+ // to update the UrlMap, otherwise the request will fail with error 412
+ // conditionNotMet. To see the latest fingerprint, make a get() request to
+ // retrieve a UrlMap.
Fingerprint string `json:"fingerprint,omitempty"`
-
- // HeaderAction: Specifies changes to request and response headers that
- // need to take effect for the selected backendService. The headerAction
- // specified here take effect after headerAction specified under
- // pathMatcher. headerAction is not supported for load balancers that
- // have their loadBalancingScheme set to EXTERNAL. Not supported when
- // the URL map is bound to a target gRPC proxy that has
- // validateForProxyless field set to true.
+ // HeaderAction: Specifies changes to request and response headers that need to
+ // take effect for the selected backendService. The headerAction specified here
+ // take effect after headerAction specified under pathMatcher. headerAction is
+ // not supported for load balancers that have their loadBalancingScheme set to
+ // EXTERNAL. Not supported when the URL map is bound to a target gRPC proxy
+ // that has validateForProxyless field set to true.
HeaderAction *HttpHeaderAction `json:"headerAction,omitempty"`
-
// HostRules: The list of host rules to use against the URL.
HostRules []*HostRule `json:"hostRules,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
- // Kind: [Output Only] Type of the resource. Always compute#urlMaps for
- // url maps.
+ // Kind: [Output Only] Type of the resource. Always compute#urlMaps for url
+ // maps.
Kind string `json:"kind,omitempty"`
-
- // Name: Name of the resource. Provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
- // the first character must be a lowercase letter, and all following
- // characters must be a dash, lowercase letter, or digit, except the
- // last character, which cannot be a dash.
+ // Name: Name of the resource. Provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must
+ // be a lowercase letter, and all following characters must be a dash,
+ // lowercase letter, or digit, except the last character, which cannot be a
+ // dash.
Name string `json:"name,omitempty"`
-
// PathMatchers: The list of named PathMatchers to use against the URL.
PathMatchers []*PathMatcher `json:"pathMatchers,omitempty"`
-
- // Region: [Output Only] URL of the region where the regional URL map
- // resides. This field is not applicable to global URL maps. You must
- // specify this field as part of the HTTP request URL. It is not
- // settable as a field in the request body.
+ // Region: [Output Only] URL of the region where the regional URL map resides.
+ // This field is not applicable to global URL maps. You must specify this field
+ // as part of the HTTP request URL. It is not settable as a field in the
+ // request body.
Region string `json:"region,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // Tests: The list of expected URL mapping tests. Request to update the
- // UrlMap succeeds only if all test cases pass. You can specify a
- // maximum of 100 tests per UrlMap. Not supported when the URL map is
- // bound to a target gRPC proxy that has validateForProxyless field set
- // to true.
+ // Tests: The list of expected URL mapping tests. Request to update the UrlMap
+ // succeeds only if all test cases pass. You can specify a maximum of 100 tests
+ // per UrlMap. Not supported when the URL map is bound to a target gRPC proxy
+ // that has validateForProxyless field set to true.
Tests []*UrlMapTest `json:"tests,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "CreationTimestamp") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CreationTimestamp") 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. "CreationTimestamp") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *UrlMap) MarshalJSON() ([]byte, error) {
+func (s UrlMap) MarshalJSON() ([]byte, error) {
type NoMethod UrlMap
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// UrlMapList: Contains a list of UrlMap resources.
type UrlMapList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of UrlMap resources.
Items []*UrlMap `json:"items,omitempty"`
-
// Kind: Type of resource.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *UrlMapListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *UrlMapList) MarshalJSON() ([]byte, error) {
+func (s UrlMapList) MarshalJSON() ([]byte, error) {
type NoMethod UrlMapList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// UrlMapListWarning: [Output Only] Informational warning message.
type UrlMapListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*UrlMapListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *UrlMapListWarning) MarshalJSON() ([]byte, error) {
+func (s UrlMapListWarning) MarshalJSON() ([]byte, error) {
type NoMethod UrlMapListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type UrlMapListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *UrlMapListWarningData) MarshalJSON() ([]byte, error) {
+func (s UrlMapListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod UrlMapListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type UrlMapReference struct {
UrlMap string `json:"urlMap,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "UrlMap") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "UrlMap") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "UrlMap") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *UrlMapReference) MarshalJSON() ([]byte, error) {
+func (s UrlMapReference) MarshalJSON() ([]byte, error) {
type NoMethod UrlMapReference
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// UrlMapTest: Message for the expected URL mappings.
type UrlMapTest struct {
// Description: Description of this test case.
Description string `json:"description,omitempty"`
-
- // ExpectedOutputUrl: The expected output URL evaluated by the load
- // balancer containing the scheme, host, path and query parameters. For
- // rules that forward requests to backends, the test passes only when
- // expectedOutputUrl matches the request forwarded by the load balancer
- // to backends. For rules with urlRewrite, the test verifies that the
- // forwarded request matches hostRewrite and pathPrefixRewrite in the
- // urlRewrite action. When service is specified, expectedOutputUrl`s
- // scheme is ignored. For rules with urlRedirect, the test passes only
- // if expectedOutputUrl matches the URL in the load balancer's redirect
- // response. If urlRedirect specifies https_redirect, the test passes
- // only if the scheme in expectedOutputUrl is also set to HTTPS. If
- // urlRedirect specifies strip_query, the test passes only if
- // expectedOutputUrl does not contain any query parameters.
+ // ExpectedOutputUrl: The expected output URL evaluated by the load balancer
+ // containing the scheme, host, path and query parameters. For rules that
+ // forward requests to backends, the test passes only when expectedOutputUrl
+ // matches the request forwarded by the load balancer to backends. For rules
+ // with urlRewrite, the test verifies that the forwarded request matches
+ // hostRewrite and pathPrefixRewrite in the urlRewrite action. When service is
+ // specified, expectedOutputUrl`s scheme is ignored. For rules with
+ // urlRedirect, the test passes only if expectedOutputUrl matches the URL in
+ // the load balancer's redirect response. If urlRedirect specifies
+ // https_redirect, the test passes only if the scheme in expectedOutputUrl is
+ // also set to HTTPS. If urlRedirect specifies strip_query, the test passes
+ // only if expectedOutputUrl does not contain any query parameters.
// expectedOutputUrl is optional when service is specified.
ExpectedOutputUrl string `json:"expectedOutputUrl,omitempty"`
-
- // ExpectedRedirectResponseCode: For rules with urlRedirect, the test
- // passes only if expectedRedirectResponseCode matches the HTTP status
- // code in load balancer's redirect response.
- // expectedRedirectResponseCode cannot be set when service is set.
+ // ExpectedRedirectResponseCode: For rules with urlRedirect, the test passes
+ // only if expectedRedirectResponseCode matches the HTTP status code in load
+ // balancer's redirect response. expectedRedirectResponseCode cannot be set
+ // when service is set.
ExpectedRedirectResponseCode int64 `json:"expectedRedirectResponseCode,omitempty"`
-
- // Headers: HTTP headers for this request. If headers contains a host
- // header, then host must also match the header value.
- Headers []*UrlMapTestHeader `json:"headers,omitempty"`
-
- // Host: Host portion of the URL. If headers contains a host header,
+ // Headers: HTTP headers for this request. If headers contains a host header,
// then host must also match the header value.
+ Headers []*UrlMapTestHeader `json:"headers,omitempty"`
+ // Host: Host portion of the URL. If headers contains a host header, then host
+ // must also match the header value.
Host string `json:"host,omitempty"`
-
// Path: Path portion of the URL.
Path string `json:"path,omitempty"`
-
- // Service: Expected BackendService or BackendBucket resource the given
- // URL should be mapped to. The service field cannot be set if
+ // Service: Expected BackendService or BackendBucket resource the given URL
+ // should be mapped to. The service field cannot be set if
// expectedRedirectResponseCode is set.
Service string `json:"service,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Description") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Description") to include
- // in API requests with the JSON null value. By default, fields with
- // empty values are omitted from API requests. However, any field with
- // an empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields 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. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *UrlMapTest) MarshalJSON() ([]byte, error) {
+func (s UrlMapTest) MarshalJSON() ([]byte, error) {
type NoMethod UrlMapTest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// UrlMapTestHeader: HTTP headers used in UrlMapTests.
type UrlMapTestHeader struct {
// Name: Header name.
Name string `json:"name,omitempty"`
-
// Value: Header value.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Name") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Name") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
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 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. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *UrlMapTestHeader) MarshalJSON() ([]byte, error) {
+func (s UrlMapTestHeader) MarshalJSON() ([]byte, error) {
type NoMethod UrlMapTestHeader
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// UrlMapValidationResult: Message representing the validation result
-// for a UrlMap.
+// UrlMapValidationResult: Message representing the validation result for a
+// UrlMap.
type UrlMapValidationResult struct {
LoadErrors []string `json:"loadErrors,omitempty"`
-
- // LoadSucceeded: Whether the given UrlMap can be successfully loaded.
- // If false, 'loadErrors' indicates the reasons.
- LoadSucceeded bool `json:"loadSucceeded,omitempty"`
-
- TestFailures []*TestFailure `json:"testFailures,omitempty"`
-
- // TestPassed: If successfully loaded, this field indicates whether the
- // test passed. If false, 'testFailures's indicate the reason of
- // failure.
+ // LoadSucceeded: Whether the given UrlMap can be successfully loaded. If
+ // false, 'loadErrors' indicates the reasons.
+ LoadSucceeded bool `json:"loadSucceeded,omitempty"`
+ TestFailures []*TestFailure `json:"testFailures,omitempty"`
+ // TestPassed: If successfully loaded, this field indicates whether the test
+ // passed. If false, 'testFailures's indicate the reason of failure.
TestPassed bool `json:"testPassed,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "LoadErrors") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "LoadErrors") 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. "LoadErrors") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *UrlMapValidationResult) MarshalJSON() ([]byte, error) {
+func (s UrlMapValidationResult) MarshalJSON() ([]byte, error) {
type NoMethod UrlMapValidationResult
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type UrlMapsAggregatedList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of UrlMapsScopedList resources.
Items map[string]UrlMapsScopedList `json:"items,omitempty"`
-
// Kind: Type of resource.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Unreachables: [Output Only] Unreachable resources.
Unreachables []string `json:"unreachables,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *UrlMapsAggregatedListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *UrlMapsAggregatedList) MarshalJSON() ([]byte, error) {
+func (s UrlMapsAggregatedList) MarshalJSON() ([]byte, error) {
type NoMethod UrlMapsAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// UrlMapsAggregatedListWarning: [Output Only] Informational warning
-// message.
+// UrlMapsAggregatedListWarning: [Output Only] Informational warning message.
type UrlMapsAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*UrlMapsAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *UrlMapsAggregatedListWarning) MarshalJSON() ([]byte, error) {
+func (s UrlMapsAggregatedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod UrlMapsAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type UrlMapsAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *UrlMapsAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+func (s UrlMapsAggregatedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod UrlMapsAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type UrlMapsScopedList struct {
// UrlMaps: A list of UrlMaps contained in this scope.
UrlMaps []*UrlMap `json:"urlMaps,omitempty"`
-
- // Warning: Informational warning which replaces the list of backend
- // services when the list is empty.
+ // Warning: Informational warning which replaces the list of backend services
+ // when the list is empty.
Warning *UrlMapsScopedListWarning `json:"warning,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "UrlMaps") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "UrlMaps") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "UrlMaps") 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. "UrlMaps") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *UrlMapsScopedList) MarshalJSON() ([]byte, error) {
+func (s UrlMapsScopedList) MarshalJSON() ([]byte, error) {
type NoMethod UrlMapsScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// UrlMapsScopedListWarning: Informational warning which replaces the
-// list of backend services when the list is empty.
+// UrlMapsScopedListWarning: Informational warning which replaces the list of
+// backend services when the list is empty.
type UrlMapsScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*UrlMapsScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *UrlMapsScopedListWarning) MarshalJSON() ([]byte, error) {
+func (s UrlMapsScopedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod UrlMapsScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type UrlMapsScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *UrlMapsScopedListWarningData) MarshalJSON() ([]byte, error) {
+func (s UrlMapsScopedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod UrlMapsScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type UrlMapsValidateRequest struct {
- // LoadBalancingSchemes: Specifies the load balancer type(s) this
- // validation request is for. Use EXTERNAL_MANAGED for global external
- // Application Load Balancers and regional external Application Load
- // Balancers. Use EXTERNAL for classic Application Load Balancers. Use
- // INTERNAL_MANAGED for internal Application Load Balancers. For more
- // information, refer to Choosing a load balancer. If unspecified, the
- // load balancing scheme will be inferred from the backend service
- // resources this URL map references. If that can not be inferred (for
- // example, this URL map only references backend buckets, or this Url
- // map is for rewrites and redirects only and doesn't reference any
- // backends), EXTERNAL will be used as the default type. If specified,
- // the scheme(s) must not conflict with the load balancing scheme of the
- // backend service resources this Url map references.
- //
- // Possible values:
- // "EXTERNAL" - Signifies that this will be used for classic
- // Application Load Balancers.
- // "EXTERNAL_MANAGED" - Signifies that this will be used for
- // Envoy-based global external Application Load Balancers.
- // "LOAD_BALANCING_SCHEME_UNSPECIFIED" - If unspecified, the
- // validation will try to infer the scheme from the backend service
- // resources this Url map references. If the inference is not possible,
- // EXTERNAL will be used as the default type.
+ // LoadBalancingSchemes: Specifies the load balancer type(s) this validation
+ // request is for. Use EXTERNAL_MANAGED for global external Application Load
+ // Balancers and regional external Application Load Balancers. Use EXTERNAL for
+ // classic Application Load Balancers. Use INTERNAL_MANAGED for internal
+ // Application Load Balancers. For more information, refer to Choosing a load
+ // balancer. If unspecified, the load balancing scheme will be inferred from
+ // the backend service resources this URL map references. If that can not be
+ // inferred (for example, this URL map only references backend buckets, or this
+ // Url map is for rewrites and redirects only and doesn't reference any
+ // backends), EXTERNAL will be used as the default type. If specified, the
+ // scheme(s) must not conflict with the load balancing scheme of the backend
+ // service resources this Url map references.
+ //
+ // Possible values:
+ // "EXTERNAL" - Signifies that this will be used for classic Application Load
+ // Balancers.
+ // "EXTERNAL_MANAGED" - Signifies that this will be used for Envoy-based
+ // global external Application Load Balancers.
+ // "LOAD_BALANCING_SCHEME_UNSPECIFIED" - If unspecified, the validation will
+ // try to infer the scheme from the backend service resources this Url map
+ // references. If the inference is not possible, EXTERNAL will be used as the
+ // default type.
LoadBalancingSchemes []string `json:"loadBalancingSchemes,omitempty"`
-
// Resource: Content of the UrlMap to be validated.
Resource *UrlMap `json:"resource,omitempty"`
-
- // ForceSendFields is a list of field names (e.g.
- // "LoadBalancingSchemes") to unconditionally include in API requests.
- // By default, fields with empty or default 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. "LoadBalancingSchemes") 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.
+ // ForceSendFields is a list of field names (e.g. "LoadBalancingSchemes") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "LoadBalancingSchemes") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *UrlMapsValidateRequest) MarshalJSON() ([]byte, error) {
+func (s UrlMapsValidateRequest) MarshalJSON() ([]byte, error) {
type NoMethod UrlMapsValidateRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type UrlMapsValidateResponse struct {
Result *UrlMapValidationResult `json:"result,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Result") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Result") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Result") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *UrlMapsValidateResponse) MarshalJSON() ([]byte, error) {
+func (s UrlMapsValidateResponse) MarshalJSON() ([]byte, error) {
type NoMethod UrlMapsValidateResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// UrlRewrite: The spec for modifying the path before sending the
-// request to the matched backend service.
+// UrlRewrite: The spec for modifying the path before sending the request to
+// the matched backend service.
type UrlRewrite struct {
- // HostRewrite: Before forwarding the request to the selected service,
- // the request's host header is replaced with contents of hostRewrite.
- // The value must be from 1 to 255 characters.
+ // HostRewrite: Before forwarding the request to the selected service, the
+ // request's host header is replaced with contents of hostRewrite. The value
+ // must be from 1 to 255 characters.
HostRewrite string `json:"hostRewrite,omitempty"`
-
- // PathPrefixRewrite: Before forwarding the request to the selected
- // backend service, the matching portion of the request's path is
- // replaced by pathPrefixRewrite. The value must be from 1 to 1024
- // characters.
+ // PathPrefixRewrite: Before forwarding the request to the selected backend
+ // service, the matching portion of the request's path is replaced by
+ // pathPrefixRewrite. The value must be from 1 to 1024 characters.
PathPrefixRewrite string `json:"pathPrefixRewrite,omitempty"`
-
- // PathTemplateRewrite: If specified, the pattern rewrites the URL path
- // (based on the :path header) using the HTTP template syntax. A
- // corresponding path_template_match must be specified. Any template
- // variables must exist in the path_template_match field. - -At least
- // one variable must be specified in the path_template_match field - You
- // can omit variables from the rewritten URL - The * and ** operators
- // cannot be matched unless they have a corresponding variable name -
- // e.g. {format=*} or {var=**}. For example, a path_template_match of
- // /static/{format=**} could be rewritten as /static/content/{format} to
- // prefix /content to the URL. Variables can also be re-ordered in a
- // rewrite, so that /{country}/{format}/{suffix=**} can be rewritten as
- // /content/{format}/{country}/{suffix}. At least one non-empty
- // routeRules[].matchRules[].path_template_match is required. Only one
- // of path_prefix_rewrite or path_template_rewrite may be specified.
+ // PathTemplateRewrite: If specified, the pattern rewrites the URL path (based
+ // on the :path header) using the HTTP template syntax. A corresponding
+ // path_template_match must be specified. Any template variables must exist in
+ // the path_template_match field. - -At least one variable must be specified in
+ // the path_template_match field - You can omit variables from the rewritten
+ // URL - The * and ** operators cannot be matched unless they have a
+ // corresponding variable name - e.g. {format=*} or {var=**}. For example, a
+ // path_template_match of /static/{format=**} could be rewritten as
+ // /static/content/{format} to prefix /content to the URL. Variables can also
+ // be re-ordered in a rewrite, so that /{country}/{format}/{suffix=**} can be
+ // rewritten as /content/{format}/{country}/{suffix}. At least one non-empty
+ // routeRules[].matchRules[].path_template_match is required. Only one of
+ // path_prefix_rewrite or path_template_rewrite may be specified.
PathTemplateRewrite string `json:"pathTemplateRewrite,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "HostRewrite") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "HostRewrite") 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. "HostRewrite") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *UrlRewrite) MarshalJSON() ([]byte, error) {
+func (s UrlRewrite) MarshalJSON() ([]byte, error) {
type NoMethod UrlRewrite
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// UsableSubnetwork: Subnetwork which the current user has
// compute.subnetworks.use permission on.
type UsableSubnetwork struct {
- // ExternalIpv6Prefix: [Output Only] The external IPv6 address range
- // that is assigned to this subnetwork.
+ // ExternalIpv6Prefix: [Output Only] The external IPv6 address range that is
+ // assigned to this subnetwork.
ExternalIpv6Prefix string `json:"externalIpv6Prefix,omitempty"`
-
- // InternalIpv6Prefix: [Output Only] The internal IPv6 address range
- // that is assigned to this subnetwork.
+ // InternalIpv6Prefix: [Output Only] The internal IPv6 address range that is
+ // assigned to this subnetwork.
InternalIpv6Prefix string `json:"internalIpv6Prefix,omitempty"`
-
// IpCidrRange: The range of internal addresses that are owned by this
// subnetwork.
IpCidrRange string `json:"ipCidrRange,omitempty"`
-
- // Ipv6AccessType: The access type of IPv6 address this subnet holds.
- // It's immutable and can only be specified during creation or the first
- // time the subnet is updated into IPV4_IPV6 dual stack.
+ // Ipv6AccessType: The access type of IPv6 address this subnet holds. It's
+ // immutable and can only be specified during creation or the first time the
+ // subnet is updated into IPV4_IPV6 dual stack.
//
// Possible values:
- // "EXTERNAL" - VMs on this subnet will be assigned IPv6 addresses
- // that are accessible via the Internet, as well as the VPC network.
- // "INTERNAL" - VMs on this subnet will be assigned IPv6 addresses
- // that are only accessible over the VPC network.
+ // "EXTERNAL" - VMs on this subnet will be assigned IPv6 addresses that are
+ // accessible via the Internet, as well as the VPC network.
+ // "INTERNAL" - VMs on this subnet will be assigned IPv6 addresses that are
+ // only accessible over the VPC network.
Ipv6AccessType string `json:"ipv6AccessType,omitempty"`
-
// Network: Network URL.
Network string `json:"network,omitempty"`
-
- // Purpose: The purpose of the resource. This field can be either
- // PRIVATE, GLOBAL_MANAGED_PROXY, REGIONAL_MANAGED_PROXY,
- // PRIVATE_SERVICE_CONNECT, or PRIVATE is the default purpose for
- // user-created subnets or subnets that are automatically created in
- // auto mode networks. Subnets with purpose set to GLOBAL_MANAGED_PROXY
- // or REGIONAL_MANAGED_PROXY are user-created subnetworks that are
- // reserved for Envoy-based load balancers. A subnet with purpose set to
- // PRIVATE_SERVICE_CONNECT is used to publish services using Private
- // Service Connect. If unspecified, the subnet purpose defaults to
- // PRIVATE. The enableFlowLogs field isn't supported if the subnet
- // purpose field is set to GLOBAL_MANAGED_PROXY or
- // REGIONAL_MANAGED_PROXY.
- //
- // Possible values:
- // "GLOBAL_MANAGED_PROXY" - Subnet reserved for Global Envoy-based
- // Load Balancing.
- // "INTERNAL_HTTPS_LOAD_BALANCER" - Subnet reserved for Internal
- // HTTP(S) Load Balancing. This is a legacy purpose, please use
- // REGIONAL_MANAGED_PROXY instead.
+ // Purpose: The purpose of the resource. This field can be either PRIVATE,
+ // GLOBAL_MANAGED_PROXY, REGIONAL_MANAGED_PROXY, PRIVATE_SERVICE_CONNECT, or
+ // PRIVATE is the default purpose for user-created subnets or subnets that are
+ // automatically created in auto mode networks. Subnets with purpose set to
+ // GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY are user-created subnetworks
+ // that are reserved for Envoy-based load balancers. A subnet with purpose set
+ // to PRIVATE_SERVICE_CONNECT is used to publish services using Private Service
+ // Connect. If unspecified, the subnet purpose defaults to PRIVATE. The
+ // enableFlowLogs field isn't supported if the subnet purpose field is set to
+ // GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY.
+ //
+ // Possible values:
+ // "GLOBAL_MANAGED_PROXY" - Subnet reserved for Global Envoy-based Load
+ // Balancing.
+ // "INTERNAL_HTTPS_LOAD_BALANCER" - Subnet reserved for Internal HTTP(S) Load
+ // Balancing. This is a legacy purpose, please use REGIONAL_MANAGED_PROXY
+ // instead.
// "PRIVATE" - Regular user created or automatically created subnet.
- // "PRIVATE_NAT" - Subnetwork used as source range for Private NAT
- // Gateways.
- // "PRIVATE_RFC_1918" - Regular user created or automatically created
- // subnet.
+ // "PRIVATE_NAT" - Subnetwork used as source range for Private NAT Gateways.
+ // "PRIVATE_RFC_1918" - Regular user created or automatically created subnet.
// "PRIVATE_SERVICE_CONNECT" - Subnetworks created for Private Service
// Connect in the producer network.
- // "REGIONAL_MANAGED_PROXY" - Subnetwork used for Regional Envoy-based
- // Load Balancing.
+ // "REGIONAL_MANAGED_PROXY" - Subnetwork used for Regional Envoy-based Load
+ // Balancing.
Purpose string `json:"purpose,omitempty"`
-
// Role: The role of subnetwork. Currently, this field is only used when
- // purpose is set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY. The
- // value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one
- // that is currently being used for Envoy-based load balancers in a
- // region. A BACKUP subnetwork is one that is ready to be promoted to
- // ACTIVE or is currently draining. This field can be updated with a
- // patch request.
+ // purpose is set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY. The value
+ // can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is
+ // currently being used for Envoy-based load balancers in a region. A BACKUP
+ // subnetwork is one that is ready to be promoted to ACTIVE or is currently
+ // draining. This field can be updated with a patch request.
//
// Possible values:
// "ACTIVE" - The ACTIVE subnet that is currently used.
// "BACKUP" - The BACKUP subnet that could be promoted to ACTIVE.
Role string `json:"role,omitempty"`
-
// SecondaryIpRanges: Secondary IP ranges.
SecondaryIpRanges []*UsableSubnetworkSecondaryRange `json:"secondaryIpRanges,omitempty"`
-
- // StackType: The stack type for the subnet. If set to IPV4_ONLY, new
- // VMs in the subnet are assigned IPv4 addresses only. If set to
- // IPV4_IPV6, new VMs in the subnet can be assigned both IPv4 and IPv6
- // addresses. If not specified, IPV4_ONLY is used. This field can be
- // both set at resource creation time and updated using patch.
+ // StackType: The stack type for the subnet. If set to IPV4_ONLY, new VMs in
+ // the subnet are assigned IPv4 addresses only. If set to IPV4_IPV6, new VMs in
+ // the subnet can be assigned both IPv4 and IPv6 addresses. If not specified,
+ // IPV4_ONLY is used. This field can be both set at resource creation time and
+ // updated using patch.
//
// Possible values:
// "IPV4_IPV6" - New VMs in this subnet can have both IPv4 and IPv6
// addresses.
- // "IPV4_ONLY" - New VMs in this subnet will only be assigned IPv4
- // addresses.
+ // "IPV4_ONLY" - New VMs in this subnet will only be assigned IPv4 addresses.
+ // "IPV6_ONLY" - New VMs in this subnet will only be assigned IPv6 addresses.
StackType string `json:"stackType,omitempty"`
-
// Subnetwork: Subnetwork URL.
Subnetwork string `json:"subnetwork,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "ExternalIpv6Prefix")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "ExternalIpv6Prefix") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "ExternalIpv6Prefix") 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. "ExternalIpv6Prefix") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *UsableSubnetwork) MarshalJSON() ([]byte, error) {
+func (s UsableSubnetwork) MarshalJSON() ([]byte, error) {
type NoMethod UsableSubnetwork
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// UsableSubnetworkSecondaryRange: Secondary IP range of a usable
-// subnetwork.
+// UsableSubnetworkSecondaryRange: Secondary IP range of a usable subnetwork.
type UsableSubnetworkSecondaryRange struct {
// IpCidrRange: The range of IP addresses belonging to this subnetwork
// secondary range.
IpCidrRange string `json:"ipCidrRange,omitempty"`
-
- // RangeName: The name associated with this subnetwork secondary range,
- // used when adding an alias IP range to a VM instance. The name must be
- // 1-63 characters long, and comply with RFC1035. The name must be
- // unique within the subnetwork.
+ // RangeName: The name associated with this subnetwork secondary range, used
+ // when adding an alias IP range to a VM instance. The name must be 1-63
+ // characters long, and comply with RFC1035. The name must be unique within the
+ // subnetwork.
RangeName string `json:"rangeName,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "IpCidrRange") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "IpCidrRange") 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. "IpCidrRange") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *UsableSubnetworkSecondaryRange) MarshalJSON() ([]byte, error) {
+func (s UsableSubnetworkSecondaryRange) MarshalJSON() ([]byte, error) {
type NoMethod UsableSubnetworkSecondaryRange
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type UsableSubnetworksAggregatedList struct {
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id string `json:"id,omitempty"`
-
// Items: [Output] A list of usable subnetwork URLs.
Items []*UsableSubnetwork `json:"items,omitempty"`
-
// Kind: [Output Only] Type of resource. Always
- // compute#usableSubnetworksAggregatedList for aggregated lists of
- // usable subnetworks.
+ // compute#usableSubnetworksAggregatedList for aggregated lists of usable
+ // subnetworks.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results. In special cases listUsable may return 0 subnetworks and
- // nextPageToken which still should be used to get the next page of
- // results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results. In special cases
+ // listUsable may return 0 subnetworks and nextPageToken which still should be
+ // used to get the next page of results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *UsableSubnetworksAggregatedListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *UsableSubnetworksAggregatedList) MarshalJSON() ([]byte, error) {
+func (s UsableSubnetworksAggregatedList) MarshalJSON() ([]byte, error) {
type NoMethod UsableSubnetworksAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// UsableSubnetworksAggregatedListWarning: [Output Only] Informational
-// warning message.
+// UsableSubnetworksAggregatedListWarning: [Output Only] Informational warning
+// message.
type UsableSubnetworksAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*UsableSubnetworksAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *UsableSubnetworksAggregatedListWarning) MarshalJSON() ([]byte, error) {
+func (s UsableSubnetworksAggregatedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod UsableSubnetworksAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type UsableSubnetworksAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *UsableSubnetworksAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+func (s UsableSubnetworksAggregatedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod UsableSubnetworksAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// UsageExportLocation: The location in Cloud Storage and naming method
-// of the daily usage report. Contains bucket_name and report_name
-// prefix.
+// UsageExportLocation: The location in Cloud Storage and naming method of the
+// daily usage report. Contains bucket_name and report_name prefix.
type UsageExportLocation struct {
- // BucketName: The name of an existing bucket in Cloud Storage where the
- // usage report object is stored. The Google Service Account is granted
- // write access to this bucket. This can either be the bucket name by
- // itself, such as example-bucket, or the bucket name with gs:// or
- // https://storage.googleapis.com/ in front of it, such as
- // gs://example-bucket.
+ // BucketName: The name of an existing bucket in Cloud Storage where the usage
+ // report object is stored. The Google Service Account is granted write access
+ // to this bucket. This can either be the bucket name by itself, such as
+ // example-bucket, or the bucket name with gs:// or
+ // https://storage.googleapis.com/ in front of it, such as gs://example-bucket.
BucketName string `json:"bucketName,omitempty"`
-
- // ReportNamePrefix: An optional prefix for the name of the usage report
- // object stored in bucketName. If not supplied, defaults to usage_gce.
- // The report is stored as a CSV file named
- // report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the day of the
- // usage according to Pacific Time. If you supply a prefix, it should
- // conform to Cloud Storage object naming conventions.
+ // ReportNamePrefix: An optional prefix for the name of the usage report object
+ // stored in bucketName. If not supplied, defaults to usage_gce. The report is
+ // stored as a CSV file named report_name_prefix_gce_YYYYMMDD.csv where
+ // YYYYMMDD is the day of the usage according to Pacific Time. If you supply a
+ // prefix, it should conform to Cloud Storage object naming conventions.
ReportNamePrefix string `json:"reportNamePrefix,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "BucketName") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "BucketName") 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. "BucketName") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *UsageExportLocation) MarshalJSON() ([]byte, error) {
+func (s UsageExportLocation) MarshalJSON() ([]byte, error) {
type NoMethod UsageExportLocation
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// VmEndpointNatMappings: Contain information of Nat mapping for a VM
-// endpoint (i.e., NIC).
+// VmEndpointNatMappings: Contain information of Nat mapping for a VM endpoint
+// (i.e., NIC).
type VmEndpointNatMappings struct {
// InstanceName: Name of the VM instance which the endpoint belongs to
- InstanceName string `json:"instanceName,omitempty"`
-
+ InstanceName string `json:"instanceName,omitempty"`
InterfaceNatMappings []*VmEndpointNatMappingsInterfaceNatMappings `json:"interfaceNatMappings,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "InstanceName") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "InstanceName") 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. "InstanceName") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *VmEndpointNatMappings) MarshalJSON() ([]byte, error) {
+func (s VmEndpointNatMappings) MarshalJSON() ([]byte, error) {
type NoMethod VmEndpointNatMappings
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// VmEndpointNatMappingsInterfaceNatMappings: Contain information of Nat
// mapping for an interface of this endpoint.
type VmEndpointNatMappingsInterfaceNatMappings struct {
- // DrainNatIpPortRanges: List of all drain IP:port-range mappings
- // assigned to this interface. These ranges are inclusive, that is, both
- // the first and the last ports can be used for NAT. Example:
- // ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"].
+ // DrainNatIpPortRanges: List of all drain IP:port-range mappings assigned to
+ // this interface. These ranges are inclusive, that is, both the first and the
+ // last ports can be used for NAT. Example: ["2.2.2.2:12345-12355",
+ // "1.1.1.1:2234-2234"].
DrainNatIpPortRanges []string `json:"drainNatIpPortRanges,omitempty"`
-
- // NatIpPortRanges: A list of all IP:port-range mappings assigned to
- // this interface. These ranges are inclusive, that is, both the first
- // and the last ports can be used for NAT. Example:
- // ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"].
+ // NatIpPortRanges: A list of all IP:port-range mappings assigned to this
+ // interface. These ranges are inclusive, that is, both the first and the last
+ // ports can be used for NAT. Example: ["2.2.2.2:12345-12355",
+ // "1.1.1.1:2234-2234"].
NatIpPortRanges []string `json:"natIpPortRanges,omitempty"`
-
// NumTotalDrainNatPorts: Total number of drain ports across all NAT IPs
- // allocated to this interface. It equals to the aggregated port number
- // in the field drain_nat_ip_port_ranges.
+ // allocated to this interface. It equals to the aggregated port number in the
+ // field drain_nat_ip_port_ranges.
NumTotalDrainNatPorts int64 `json:"numTotalDrainNatPorts,omitempty"`
-
- // NumTotalNatPorts: Total number of ports across all NAT IPs allocated
- // to this interface. It equals to the aggregated port number in the
- // field nat_ip_port_ranges.
+ // NumTotalNatPorts: Total number of ports across all NAT IPs allocated to this
+ // interface. It equals to the aggregated port number in the field
+ // nat_ip_port_ranges.
NumTotalNatPorts int64 `json:"numTotalNatPorts,omitempty"`
-
- // RuleMappings: Information about mappings provided by rules in this
- // NAT.
+ // RuleMappings: Information about mappings provided by rules in this NAT.
RuleMappings []*VmEndpointNatMappingsInterfaceNatMappingsNatRuleMappings `json:"ruleMappings,omitempty"`
-
- // SourceAliasIpRange: Alias IP range for this interface endpoint. It
- // will be a private (RFC 1918) IP range. Examples: "10.33.4.55/32", or
- // "192.168.5.0/24".
+ // SourceAliasIpRange: Alias IP range for this interface endpoint. It will be a
+ // private (RFC 1918) IP range. Examples: "10.33.4.55/32", or "192.168.5.0/24".
SourceAliasIpRange string `json:"sourceAliasIpRange,omitempty"`
-
// SourceVirtualIp: Primary IP of the VM for this NIC.
SourceVirtualIp string `json:"sourceVirtualIp,omitempty"`
-
- // ForceSendFields is a list of field names (e.g.
- // "DrainNatIpPortRanges") to unconditionally include in API requests.
- // By default, fields with empty or default 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. "DrainNatIpPortRanges") 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.
+ // ForceSendFields is a list of field names (e.g. "DrainNatIpPortRanges") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "DrainNatIpPortRanges") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *VmEndpointNatMappingsInterfaceNatMappings) MarshalJSON() ([]byte, error) {
+func (s VmEndpointNatMappingsInterfaceNatMappings) MarshalJSON() ([]byte, error) {
type NoMethod VmEndpointNatMappingsInterfaceNatMappings
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// VmEndpointNatMappingsInterfaceNatMappingsNatRuleMappings: Contains
// information of NAT Mappings provided by a NAT Rule.
type VmEndpointNatMappingsInterfaceNatMappingsNatRuleMappings struct {
- // DrainNatIpPortRanges: List of all drain IP:port-range mappings
- // assigned to this interface by this rule. These ranges are inclusive,
- // that is, both the first and the last ports can be used for NAT.
- // Example: ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"].
- DrainNatIpPortRanges []string `json:"drainNatIpPortRanges,omitempty"`
-
- // NatIpPortRanges: A list of all IP:port-range mappings assigned to
- // this interface by this rule. These ranges are inclusive, that is,
- // both the first and the last ports can be used for NAT. Example:
+ // DrainNatIpPortRanges: List of all drain IP:port-range mappings assigned to
+ // this interface by this rule. These ranges are inclusive, that is, both the
+ // first and the last ports can be used for NAT. Example:
// ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"].
+ DrainNatIpPortRanges []string `json:"drainNatIpPortRanges,omitempty"`
+ // NatIpPortRanges: A list of all IP:port-range mappings assigned to this
+ // interface by this rule. These ranges are inclusive, that is, both the first
+ // and the last ports can be used for NAT. Example: ["2.2.2.2:12345-12355",
+ // "1.1.1.1:2234-2234"].
NatIpPortRanges []string `json:"natIpPortRanges,omitempty"`
-
// NumTotalDrainNatPorts: Total number of drain ports across all NAT IPs
- // allocated to this interface by this rule. It equals the aggregated
- // port number in the field drain_nat_ip_port_ranges.
+ // allocated to this interface by this rule. It equals the aggregated port
+ // number in the field drain_nat_ip_port_ranges.
NumTotalDrainNatPorts int64 `json:"numTotalDrainNatPorts,omitempty"`
-
- // NumTotalNatPorts: Total number of ports across all NAT IPs allocated
- // to this interface by this rule. It equals the aggregated port number
- // in the field nat_ip_port_ranges.
+ // NumTotalNatPorts: Total number of ports across all NAT IPs allocated to this
+ // interface by this rule. It equals the aggregated port number in the field
+ // nat_ip_port_ranges.
NumTotalNatPorts int64 `json:"numTotalNatPorts,omitempty"`
-
// RuleNumber: Rule number of the NAT Rule.
RuleNumber int64 `json:"ruleNumber,omitempty"`
-
- // ForceSendFields is a list of field names (e.g.
- // "DrainNatIpPortRanges") to unconditionally include in API requests.
- // By default, fields with empty or default 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. "DrainNatIpPortRanges") 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.
+ // ForceSendFields is a list of field names (e.g. "DrainNatIpPortRanges") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "DrainNatIpPortRanges") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *VmEndpointNatMappingsInterfaceNatMappingsNatRuleMappings) MarshalJSON() ([]byte, error) {
+func (s VmEndpointNatMappingsInterfaceNatMappingsNatRuleMappings) MarshalJSON() ([]byte, error) {
type NoMethod VmEndpointNatMappingsInterfaceNatMappingsNatRuleMappings
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// VmEndpointNatMappingsList: Contains a list of VmEndpointNatMappings.
type VmEndpointNatMappingsList struct {
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id string `json:"id,omitempty"`
-
// Kind: [Output Only] Type of resource. Always
- // compute#vmEndpointNatMappingsList for lists of Nat mappings of VM
- // endpoints.
+ // compute#vmEndpointNatMappingsList for lists of Nat mappings of VM endpoints.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
- // Result: [Output Only] A list of Nat mapping information of VM
- // endpoints.
+ // Result: [Output Only] A list of Nat mapping information of VM endpoints.
Result []*VmEndpointNatMappings `json:"result,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *VmEndpointNatMappingsListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *VmEndpointNatMappingsList) MarshalJSON() ([]byte, error) {
+func (s VmEndpointNatMappingsList) MarshalJSON() ([]byte, error) {
type NoMethod VmEndpointNatMappingsList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// VmEndpointNatMappingsListWarning: [Output Only] Informational warning
// message.
type VmEndpointNatMappingsListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*VmEndpointNatMappingsListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *VmEndpointNatMappingsListWarning) MarshalJSON() ([]byte, error) {
+func (s VmEndpointNatMappingsListWarning) MarshalJSON() ([]byte, error) {
type NoMethod VmEndpointNatMappingsListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type VmEndpointNatMappingsListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *VmEndpointNatMappingsListWarningData) MarshalJSON() ([]byte, error) {
+func (s VmEndpointNatMappingsListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod VmEndpointNatMappingsListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// VpnGateway: Represents a HA VPN gateway. HA VPN is a
-// high-availability (HA) Cloud VPN solution that lets you securely
-// connect your on-premises network to your Google Cloud Virtual Private
-// Cloud network through an IPsec VPN connection in a single region. For
-// more information about Cloud HA VPN solutions, see Cloud VPN
-// topologies .
+// VpnGateway: Represents a HA VPN gateway. HA VPN is a high-availability (HA)
+// Cloud VPN solution that lets you securely connect your on-premises network
+// to your Google Cloud Virtual Private Cloud network through an IPsec VPN
+// connection in a single region. For more information about Cloud HA VPN
+// solutions, see Cloud VPN topologies .
type VpnGateway struct {
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // GatewayIpVersion: The IP family of the gateway IPs for the HA-VPN gateway
+ // interfaces. If not specified, IPV4 will be used.
+ //
+ // Possible values:
+ // "IPV4" - Every HA-VPN gateway interface is configured with an IPv4
+ // address.
+ // "IPV6" - Every HA-VPN gateway interface is configured with an IPv6
+ // address.
+ GatewayIpVersion string `json:"gatewayIpVersion,omitempty"`
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
- // Kind: [Output Only] Type of resource. Always compute#vpnGateway for
- // VPN gateways.
+ // Kind: [Output Only] Type of resource. Always compute#vpnGateway for VPN
+ // gateways.
Kind string `json:"kind,omitempty"`
-
// LabelFingerprint: A fingerprint for the labels being applied to this
// VpnGateway, which is essentially a hash of the labels set used for
- // optimistic locking. The fingerprint is initially generated by Compute
- // Engine and changes after every request to modify or update labels.
- // You must always provide an up-to-date fingerprint hash in order to
- // update or change labels, otherwise the request will fail with error
- // 412 conditionNotMet. To see the latest fingerprint, make a get()
- // request to retrieve a VpnGateway.
+ // optimistic locking. The fingerprint is initially generated by Compute Engine
+ // and changes after every request to modify or update labels. You must always
+ // provide an up-to-date fingerprint hash in order to update or change labels,
+ // otherwise the request will fail with error 412 conditionNotMet. To see the
+ // latest fingerprint, make a get() request to retrieve a VpnGateway.
LabelFingerprint string `json:"labelFingerprint,omitempty"`
-
- // Labels: Labels for this resource. These can only be added or modified
- // by the setLabels method. Each label key/value pair must comply with
- // RFC1035. Label values may be empty.
+ // Labels: Labels for this resource. These can only be added or modified by the
+ // setLabels method. Each label key/value pair must comply with RFC1035. Label
+ // values may be empty.
Labels map[string]string `json:"labels,omitempty"`
-
- // Name: Name of the resource. Provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
- // the first character must be a lowercase letter, and all following
- // characters must be a dash, lowercase letter, or digit, except the
- // last character, which cannot be a dash.
+ // Name: Name of the resource. Provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must
+ // be a lowercase letter, and all following characters must be a dash,
+ // lowercase letter, or digit, except the last character, which cannot be a
+ // dash.
Name string `json:"name,omitempty"`
-
- // Network: URL of the network to which this VPN gateway is attached.
- // Provided by the client when the VPN gateway is created.
+ // Network: URL of the network to which this VPN gateway is attached. Provided
+ // by the client when the VPN gateway is created.
Network string `json:"network,omitempty"`
-
- // Region: [Output Only] URL of the region where the VPN gateway
- // resides.
+ // Region: [Output Only] URL of the region where the VPN gateway resides.
Region string `json:"region,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // StackType: The stack type for this VPN gateway to identify the IP
- // protocols that are enabled. Possible values are: IPV4_ONLY,
- // IPV4_IPV6. If not specified, IPV4_ONLY will be used.
+ // StackType: The stack type for this VPN gateway to identify the IP protocols
+ // that are enabled. Possible values are: IPV4_ONLY, IPV4_IPV6, IPV6_ONLY. If
+ // not specified, IPV4_ONLY is used if the gateway IP version is IPV4, or
+ // IPV4_IPV6 if the gateway IP version is IPV6.
//
// Possible values:
// "IPV4_IPV6" - Enable VPN gateway with both IPv4 and IPv6 protocols.
// "IPV4_ONLY" - Enable VPN gateway with only IPv4 protocol.
+ // "IPV6_ONLY" - Enable VPN gateway with only IPv6 protocol.
StackType string `json:"stackType,omitempty"`
-
- // VpnInterfaces: The list of VPN interfaces associated with this VPN
- // gateway.
+ // VpnInterfaces: The list of VPN interfaces associated with this VPN gateway.
VpnInterfaces []*VpnGatewayVpnGatewayInterface `json:"vpnInterfaces,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "CreationTimestamp") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CreationTimestamp") 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. "CreationTimestamp") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *VpnGateway) MarshalJSON() ([]byte, error) {
+func (s VpnGateway) MarshalJSON() ([]byte, error) {
type NoMethod VpnGateway
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type VpnGatewayAggregatedList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of VpnGateway resources.
Items map[string]VpnGatewaysScopedList `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource. Always compute#vpnGateway for
- // VPN gateways.
+ // Kind: [Output Only] Type of resource. Always compute#vpnGateway for VPN
+ // gateways.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Unreachables: [Output Only] Unreachable resources.
Unreachables []string `json:"unreachables,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *VpnGatewayAggregatedListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *VpnGatewayAggregatedList) MarshalJSON() ([]byte, error) {
+func (s VpnGatewayAggregatedList) MarshalJSON() ([]byte, error) {
type NoMethod VpnGatewayAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// VpnGatewayAggregatedListWarning: [Output Only] Informational warning
// message.
type VpnGatewayAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*VpnGatewayAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *VpnGatewayAggregatedListWarning) MarshalJSON() ([]byte, error) {
+func (s VpnGatewayAggregatedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod VpnGatewayAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type VpnGatewayAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *VpnGatewayAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+func (s VpnGatewayAggregatedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod VpnGatewayAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// VpnGatewayList: Contains a list of VpnGateway resources.
type VpnGatewayList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of VpnGateway resources.
Items []*VpnGateway `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource. Always compute#vpnGateway for
- // VPN gateways.
+ // Kind: [Output Only] Type of resource. Always compute#vpnGateway for VPN
+ // gateways.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *VpnGatewayListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *VpnGatewayList) MarshalJSON() ([]byte, error) {
+func (s VpnGatewayList) MarshalJSON() ([]byte, error) {
type NoMethod VpnGatewayList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// VpnGatewayListWarning: [Output Only] Informational warning message.
type VpnGatewayListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*VpnGatewayListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *VpnGatewayListWarning) MarshalJSON() ([]byte, error) {
+func (s VpnGatewayListWarning) MarshalJSON() ([]byte, error) {
type NoMethod VpnGatewayListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type VpnGatewayListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *VpnGatewayListWarningData) MarshalJSON() ([]byte, error) {
+func (s VpnGatewayListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod VpnGatewayListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type VpnGatewayStatus struct {
// VpnConnections: List of VPN connection for this VpnGateway.
VpnConnections []*VpnGatewayStatusVpnConnection `json:"vpnConnections,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "VpnConnections") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "VpnConnections") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "VpnConnections") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *VpnGatewayStatus) MarshalJSON() ([]byte, error) {
+func (s VpnGatewayStatus) MarshalJSON() ([]byte, error) {
type NoMethod VpnGatewayStatus
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// VpnGatewayStatusHighAvailabilityRequirementState: Describes the high
-// availability requirement state for the VPN connection between this
-// Cloud VPN gateway and a peer gateway.
+// availability requirement state for the VPN connection between this Cloud VPN
+// gateway and a peer gateway.
type VpnGatewayStatusHighAvailabilityRequirementState struct {
// State: Indicates the high availability requirement state for the VPN
// connection. Valid values are CONNECTION_REDUNDANCY_MET,
// CONNECTION_REDUNDANCY_NOT_MET.
//
// Possible values:
- // "CONNECTION_REDUNDANCY_MET" - VPN tunnels are configured with
- // adequate redundancy from Cloud VPN gateway to the peer VPN gateway.
- // For both GCP-to-non-GCP and GCP-to-GCP connections, the adequate
- // redundancy is a pre-requirement for users to get 99.99% availability
- // on GCP side; please note that for any connection, end-to-end 99.99%
- // availability is subject to proper configuration on the peer VPN
- // gateway.
- // "CONNECTION_REDUNDANCY_NOT_MET" - VPN tunnels are not configured
- // with adequate redundancy from the Cloud VPN gateway to the peer
- // gateway
+ // "CONNECTION_REDUNDANCY_MET" - VPN tunnels are configured with adequate
+ // redundancy from Cloud VPN gateway to the peer VPN gateway. For both
+ // GCP-to-non-GCP and GCP-to-GCP connections, the adequate redundancy is a
+ // pre-requirement for users to get 99.99% availability on GCP side; please
+ // note that for any connection, end-to-end 99.99% availability is subject to
+ // proper configuration on the peer VPN gateway.
+ // "CONNECTION_REDUNDANCY_NOT_MET" - VPN tunnels are not configured with
+ // adequate redundancy from the Cloud VPN gateway to the peer gateway
State string `json:"state,omitempty"`
-
- // UnsatisfiedReason: Indicates the reason why the VPN connection does
- // not meet the high availability redundancy criteria/requirement. Valid
- // values is INCOMPLETE_TUNNELS_COVERAGE.
+ // UnsatisfiedReason: Indicates the reason why the VPN connection does not meet
+ // the high availability redundancy criteria/requirement. Valid values is
+ // INCOMPLETE_TUNNELS_COVERAGE.
//
// Possible values:
// "INCOMPLETE_TUNNELS_COVERAGE"
UnsatisfiedReason string `json:"unsatisfiedReason,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "State") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "State") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "State") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *VpnGatewayStatusHighAvailabilityRequirementState) MarshalJSON() ([]byte, error) {
+func (s VpnGatewayStatusHighAvailabilityRequirementState) MarshalJSON() ([]byte, error) {
type NoMethod VpnGatewayStatusHighAvailabilityRequirementState
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// VpnGatewayStatusTunnel: Contains some information about a VPN tunnel.
@@ -61260,149995 +52482,1424 @@ type VpnGatewayStatusTunnel struct {
// LocalGatewayInterface: The VPN gateway interface this VPN tunnel is
// associated with.
LocalGatewayInterface int64 `json:"localGatewayInterface,omitempty"`
-
// PeerGatewayInterface: The peer gateway interface this VPN tunnel is
- // connected to, the peer gateway could either be an external VPN
- // gateway or a Google Cloud VPN gateway.
+ // connected to, the peer gateway could either be an external VPN gateway or a
+ // Google Cloud VPN gateway.
PeerGatewayInterface int64 `json:"peerGatewayInterface,omitempty"`
-
// TunnelUrl: URL reference to the VPN tunnel.
TunnelUrl string `json:"tunnelUrl,omitempty"`
-
- // ForceSendFields is a list of field names (e.g.
- // "LocalGatewayInterface") to unconditionally include in API requests.
- // By default, fields with empty or default 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 is a list of field names (e.g. "LocalGatewayInterface") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "LocalGatewayInterface") 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.
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *VpnGatewayStatusTunnel) MarshalJSON() ([]byte, error) {
+func (s VpnGatewayStatusTunnel) MarshalJSON() ([]byte, error) {
type NoMethod VpnGatewayStatusTunnel
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// VpnGatewayStatusVpnConnection: A VPN connection contains all VPN
-// tunnels connected from this VpnGateway to the same peer gateway. The
-// peer gateway could either be an external VPN gateway or a Google
-// Cloud VPN gateway.
+// VpnGatewayStatusVpnConnection: A VPN connection contains all VPN tunnels
+// connected from this VpnGateway to the same peer gateway. The peer gateway
+// could either be an external VPN gateway or a Google Cloud VPN gateway.
type VpnGatewayStatusVpnConnection struct {
- // PeerExternalGateway: URL reference to the peer external VPN gateways
- // to which the VPN tunnels in this VPN connection are connected. This
- // field is mutually exclusive with peer_gcp_gateway.
- PeerExternalGateway string `json:"peerExternalGateway,omitempty"`
-
- // PeerGcpGateway: URL reference to the peer side VPN gateways to which
- // the VPN tunnels in this VPN connection are connected. This field is
+ // PeerExternalGateway: URL reference to the peer external VPN gateways to
+ // which the VPN tunnels in this VPN connection are connected. This field is
// mutually exclusive with peer_gcp_gateway.
+ PeerExternalGateway string `json:"peerExternalGateway,omitempty"`
+ // PeerGcpGateway: URL reference to the peer side VPN gateways to which the VPN
+ // tunnels in this VPN connection are connected. This field is mutually
+ // exclusive with peer_gcp_gateway.
PeerGcpGateway string `json:"peerGcpGateway,omitempty"`
-
// State: HighAvailabilityRequirementState for the VPN connection.
State *VpnGatewayStatusHighAvailabilityRequirementState `json:"state,omitempty"`
-
// Tunnels: List of VPN tunnels that are in this VPN connection.
Tunnels []*VpnGatewayStatusTunnel `json:"tunnels,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "PeerExternalGateway")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "PeerExternalGateway") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "PeerExternalGateway") 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. "PeerExternalGateway") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *VpnGatewayStatusVpnConnection) MarshalJSON() ([]byte, error) {
+func (s VpnGatewayStatusVpnConnection) MarshalJSON() ([]byte, error) {
type NoMethod VpnGatewayStatusVpnConnection
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// VpnGatewayVpnGatewayInterface: A VPN gateway interface.
type VpnGatewayVpnGatewayInterface struct {
- // Id: [Output Only] Numeric identifier for this VPN interface
- // associated with the VPN gateway.
+ // Id: [Output Only] Numeric identifier for this VPN interface associated with
+ // the VPN gateway.
Id int64 `json:"id,omitempty"`
-
- // InterconnectAttachment: URL of the VLAN attachment
- // (interconnectAttachment) resource for this VPN gateway interface.
- // When the value of this field is present, the VPN gateway is used for
- // HA VPN over Cloud Interconnect; all egress or ingress traffic for
- // this VPN gateway interface goes through the specified VLAN attachment
- // resource.
+ // InterconnectAttachment: URL of the VLAN attachment (interconnectAttachment)
+ // resource for this VPN gateway interface. When the value of this field is
+ // present, the VPN gateway is used for HA VPN over Cloud Interconnect; all
+ // egress or ingress traffic for this VPN gateway interface goes through the
+ // specified VLAN attachment resource.
InterconnectAttachment string `json:"interconnectAttachment,omitempty"`
-
- // IpAddress: [Output Only] IP address for this VPN interface associated
- // with the VPN gateway. The IP address could be either a regional
- // external IP address or a regional internal IP address. The two IP
- // addresses for a VPN gateway must be all regional external or regional
- // internal IP addresses. There cannot be a mix of regional external IP
- // addresses and regional internal IP addresses. For HA VPN over Cloud
- // Interconnect, the IP addresses for both interfaces could either be
- // regional internal IP addresses or regional external IP addresses. For
- // regular (non HA VPN over Cloud Interconnect) HA VPN tunnels, the IP
- // address must be a regional external IP address.
+ // IpAddress: [Output Only] IP address for this VPN interface associated with
+ // the VPN gateway. The IP address could be either a regional external IP
+ // address or a regional internal IP address. The two IP addresses for a VPN
+ // gateway must be all regional external or regional internal IP addresses.
+ // There cannot be a mix of regional external IP addresses and regional
+ // internal IP addresses. For HA VPN over Cloud Interconnect, the IP addresses
+ // for both interfaces could either be regional internal IP addresses or
+ // regional external IP addresses. For regular (non HA VPN over Cloud
+ // Interconnect) HA VPN tunnels, the IP address must be a regional external IP
+ // address.
IpAddress string `json:"ipAddress,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // Ipv6Address: [Output Only] IPv6 address for this VPN interface associated
+ // with the VPN gateway. The IPv6 address must be a regional external IPv6
+ // address. The format is RFC 5952 format (e.g. 2001:db8::2d9:51:0:0).
+ Ipv6Address string `json:"ipv6Address,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *VpnGatewayVpnGatewayInterface) MarshalJSON() ([]byte, error) {
+func (s VpnGatewayVpnGatewayInterface) MarshalJSON() ([]byte, error) {
type NoMethod VpnGatewayVpnGatewayInterface
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type VpnGatewaysGetStatusResponse struct {
Result *VpnGatewayStatus `json:"result,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Result") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Result") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "Result") 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.
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *VpnGatewaysGetStatusResponse) MarshalJSON() ([]byte, error) {
+func (s VpnGatewaysGetStatusResponse) MarshalJSON() ([]byte, error) {
type NoMethod VpnGatewaysGetStatusResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type VpnGatewaysScopedList struct {
- // VpnGateways: [Output Only] A list of VPN gateways contained in this
- // scope.
+ // VpnGateways: [Output Only] A list of VPN gateways contained in this scope.
VpnGateways []*VpnGateway `json:"vpnGateways,omitempty"`
-
- // Warning: [Output Only] Informational warning which replaces the list
- // of addresses when the list is empty.
+ // Warning: [Output Only] Informational warning which replaces the list of
+ // addresses when the list is empty.
Warning *VpnGatewaysScopedListWarning `json:"warning,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "VpnGateways") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "VpnGateways") 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. "VpnGateways") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *VpnGatewaysScopedList) MarshalJSON() ([]byte, error) {
+func (s VpnGatewaysScopedList) MarshalJSON() ([]byte, error) {
type NoMethod VpnGatewaysScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// VpnGatewaysScopedListWarning: [Output Only] Informational warning
-// which replaces the list of addresses when the list is empty.
+// VpnGatewaysScopedListWarning: [Output Only] Informational warning which
+// replaces the list of addresses when the list is empty.
type VpnGatewaysScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*VpnGatewaysScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *VpnGatewaysScopedListWarning) MarshalJSON() ([]byte, error) {
+func (s VpnGatewaysScopedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod VpnGatewaysScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type VpnGatewaysScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *VpnGatewaysScopedListWarningData) MarshalJSON() ([]byte, error) {
+func (s VpnGatewaysScopedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod VpnGatewaysScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// VpnTunnel: Represents a Cloud VPN Tunnel resource. For more
-// information about VPN, read the the Cloud VPN Overview.
+// VpnTunnel: Represents a Cloud VPN Tunnel resource. For more information
+// about VPN, read the the Cloud VPN Overview.
type VpnTunnel struct {
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Description: An optional description of this resource. Provide this
- // property when you create the resource.
+ // Description: An optional description of this resource. Provide this property
+ // when you create the resource.
Description string `json:"description,omitempty"`
-
- // DetailedStatus: [Output Only] Detailed status message for the VPN
- // tunnel.
+ // DetailedStatus: [Output Only] Detailed status message for the VPN tunnel.
DetailedStatus string `json:"detailedStatus,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
- // IkeVersion: IKE protocol version to use when establishing the VPN
- // tunnel with the peer VPN gateway. Acceptable IKE versions are 1 or 2.
- // The default version is 2.
+ // IkeVersion: IKE protocol version to use when establishing the VPN tunnel
+ // with the peer VPN gateway. Acceptable IKE versions are 1 or 2. The default
+ // version is 2.
IkeVersion int64 `json:"ikeVersion,omitempty"`
-
- // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
- // VPN tunnels.
+ // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for VPN
+ // tunnels.
Kind string `json:"kind,omitempty"`
-
// LabelFingerprint: A fingerprint for the labels being applied to this
- // VpnTunnel, which is essentially a hash of the labels set used for
- // optimistic locking. The fingerprint is initially generated by Compute
- // Engine and changes after every request to modify or update labels.
- // You must always provide an up-to-date fingerprint hash in order to
- // update or change labels, otherwise the request will fail with error
- // 412 conditionNotMet. To see the latest fingerprint, make a get()
- // request to retrieve a VpnTunnel.
+ // VpnTunnel, which is essentially a hash of the labels set used for optimistic
+ // locking. The fingerprint is initially generated by Compute Engine and
+ // changes after every request to modify or update labels. You must always
+ // provide an up-to-date fingerprint hash in order to update or change labels,
+ // otherwise the request will fail with error 412 conditionNotMet. To see the
+ // latest fingerprint, make a get() request to retrieve a VpnTunnel.
LabelFingerprint string `json:"labelFingerprint,omitempty"`
-
- // Labels: Labels for this resource. These can only be added or modified
- // by the setLabels method. Each label key/value pair must comply with
- // RFC1035. Label values may be empty.
+ // Labels: Labels for this resource. These can only be added or modified by the
+ // setLabels method. Each label key/value pair must comply with RFC1035. Label
+ // values may be empty.
Labels map[string]string `json:"labels,omitempty"`
-
- // LocalTrafficSelector: Local traffic selector to use when establishing
- // the VPN tunnel with the peer VPN gateway. The value should be a CIDR
- // formatted string, for example: 192.168.0.0/16. The ranges must be
- // disjoint. Only IPv4 is supported.
+ // LocalTrafficSelector: Local traffic selector to use when establishing the
+ // VPN tunnel with the peer VPN gateway. The value should be a CIDR formatted
+ // string, for example: 192.168.0.0/16. The ranges must be disjoint. Only IPv4
+ // is supported for Classic VPN tunnels. This field is output only for HA VPN
+ // tunnels.
LocalTrafficSelector []string `json:"localTrafficSelector,omitempty"`
-
- // Name: Name of the resource. Provided by the client when the resource
- // is created. The name must be 1-63 characters long, and comply with
- // RFC1035. Specifically, the name must be 1-63 characters long and
- // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
- // the first character must be a lowercase letter, and all following
- // characters must be a dash, lowercase letter, or digit, except the
- // last character, which cannot be a dash.
+ // Name: Name of the resource. Provided by the client when the resource is
+ // created. The name must be 1-63 characters long, and comply with RFC1035.
+ // Specifically, the name must be 1-63 characters long and match the regular
+ // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must
+ // be a lowercase letter, and all following characters must be a dash,
+ // lowercase letter, or digit, except the last character, which cannot be a
+ // dash.
Name string `json:"name,omitempty"`
-
- // PeerExternalGateway: URL of the peer side external VPN gateway to
- // which this VPN tunnel is connected. Provided by the client when the
- // VPN tunnel is created. This field is exclusive with the field
- // peerGcpGateway.
+ // PeerExternalGateway: URL of the peer side external VPN gateway to which this
+ // VPN tunnel is connected. Provided by the client when the VPN tunnel is
+ // created. This field is exclusive with the field peerGcpGateway.
PeerExternalGateway string `json:"peerExternalGateway,omitempty"`
-
- // PeerExternalGatewayInterface: The interface ID of the external VPN
- // gateway to which this VPN tunnel is connected. Provided by the client
- // when the VPN tunnel is created. Possible values are: `0`, `1`, `2`,
- // `3`. The number of IDs in use depends on the external VPN gateway
- // redundancy type.
+ // PeerExternalGatewayInterface: The interface ID of the external VPN gateway
+ // to which this VPN tunnel is connected. Provided by the client when the VPN
+ // tunnel is created. Possible values are: `0`, `1`, `2`, `3`. The number of
+ // IDs in use depends on the external VPN gateway redundancy type.
PeerExternalGatewayInterface int64 `json:"peerExternalGatewayInterface,omitempty"`
-
- // PeerGcpGateway: URL of the peer side HA VPN gateway to which this VPN
- // tunnel is connected. Provided by the client when the VPN tunnel is
- // created. This field can be used when creating highly available VPN
- // from VPC network to VPC network, the field is exclusive with the
- // field peerExternalGateway. If provided, the VPN tunnel will
- // automatically use the same vpnGatewayInterface ID in the peer Google
- // Cloud VPN gateway.
+ // PeerGcpGateway: URL of the peer side HA VPN gateway to which this VPN tunnel
+ // is connected. Provided by the client when the VPN tunnel is created. This
+ // field can be used when creating highly available VPN from VPC network to VPC
+ // network, the field is exclusive with the field peerExternalGateway. If
+ // provided, the VPN tunnel will automatically use the same vpnGatewayInterface
+ // ID in the peer Google Cloud VPN gateway.
PeerGcpGateway string `json:"peerGcpGateway,omitempty"`
-
- // PeerIp: IP address of the peer VPN gateway. Only IPv4 is supported.
+ // PeerIp: IP address of the peer VPN gateway. Only IPv4 is supported. This
+ // field can be set only for Classic VPN tunnels.
PeerIp string `json:"peerIp,omitempty"`
-
- // Region: [Output Only] URL of the region where the VPN tunnel resides.
- // You must specify this field as part of the HTTP request URL. It is
- // not settable as a field in the request body.
+ // Region: [Output Only] URL of the region where the VPN tunnel resides. You
+ // must specify this field as part of the HTTP request URL. It is not settable
+ // as a field in the request body.
Region string `json:"region,omitempty"`
-
- // RemoteTrafficSelector: Remote traffic selectors to use when
- // establishing the VPN tunnel with the peer VPN gateway. The value
- // should be a CIDR formatted string, for example: 192.168.0.0/16. The
- // ranges should be disjoint. Only IPv4 is supported.
+ // RemoteTrafficSelector: Remote traffic selectors to use when establishing the
+ // VPN tunnel with the peer VPN gateway. The value should be a CIDR formatted
+ // string, for example: 192.168.0.0/16. The ranges should be disjoint. Only
+ // IPv4 is supported for Classic VPN tunnels. This field is output only for HA
+ // VPN tunnels.
RemoteTrafficSelector []string `json:"remoteTrafficSelector,omitempty"`
-
// Router: URL of the router resource to be used for dynamic routing.
Router string `json:"router,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
- // SharedSecret: Shared secret used to set the secure session between
- // the Cloud VPN gateway and the peer VPN gateway.
+ // SharedSecret: Shared secret used to set the secure session between the Cloud
+ // VPN gateway and the peer VPN gateway.
SharedSecret string `json:"sharedSecret,omitempty"`
-
// SharedSecretHash: Hash of the shared secret.
SharedSecretHash string `json:"sharedSecretHash,omitempty"`
-
- // Status: [Output Only] The status of the VPN tunnel, which can be one
- // of the following: - PROVISIONING: Resource is being allocated for the
- // VPN tunnel. - WAITING_FOR_FULL_CONFIG: Waiting to receive all
- // VPN-related configs from the user. Network, TargetVpnGateway,
- // VpnTunnel, ForwardingRule, and Route resources are needed to setup
- // the VPN tunnel. - FIRST_HANDSHAKE: Successful first handshake with
- // the peer VPN. - ESTABLISHED: Secure session is successfully
- // established with the peer VPN. - NETWORK_ERROR: Deprecated, replaced
- // by NO_INCOMING_PACKETS - AUTHORIZATION_ERROR: Auth error (for
- // example, bad shared secret). - NEGOTIATION_FAILURE: Handshake failed.
- // - DEPROVISIONING: Resources are being deallocated for the VPN tunnel.
- // - FAILED: Tunnel creation has failed and the tunnel is not ready to
- // be used. - NO_INCOMING_PACKETS: No incoming packets from peer. -
- // REJECTED: Tunnel configuration was rejected, can be result of being
- // denied access. - ALLOCATING_RESOURCES: Cloud VPN is in the process of
- // allocating all required resources. - STOPPED: Tunnel is stopped due
- // to its Forwarding Rules being deleted for Classic VPN tunnels or the
- // project is in frozen state. - PEER_IDENTITY_MISMATCH: Peer identity
- // does not match peer IP, probably behind NAT. -
- // TS_NARROWING_NOT_ALLOWED: Traffic selector narrowing not allowed for
- // an HA-VPN tunnel.
- //
- // Possible values:
- // "ALLOCATING_RESOURCES" - Cloud VPN is in the process of allocating
- // all required resources (specifically, a borg task).
+ // Status: [Output Only] The status of the VPN tunnel, which can be one of the
+ // following: - PROVISIONING: Resource is being allocated for the VPN tunnel. -
+ // WAITING_FOR_FULL_CONFIG: Waiting to receive all VPN-related configs from the
+ // user. Network, TargetVpnGateway, VpnTunnel, ForwardingRule, and Route
+ // resources are needed to setup the VPN tunnel. - FIRST_HANDSHAKE: Successful
+ // first handshake with the peer VPN. - ESTABLISHED: Secure session is
+ // successfully established with the peer VPN. - NETWORK_ERROR: Deprecated,
+ // replaced by NO_INCOMING_PACKETS - AUTHORIZATION_ERROR: Auth error (for
+ // example, bad shared secret). - NEGOTIATION_FAILURE: Handshake failed. -
+ // DEPROVISIONING: Resources are being deallocated for the VPN tunnel. -
+ // FAILED: Tunnel creation has failed and the tunnel is not ready to be used. -
+ // NO_INCOMING_PACKETS: No incoming packets from peer. - REJECTED: Tunnel
+ // configuration was rejected, can be result of being denied access. -
+ // ALLOCATING_RESOURCES: Cloud VPN is in the process of allocating all required
+ // resources. - STOPPED: Tunnel is stopped due to its Forwarding Rules being
+ // deleted for Classic VPN tunnels or the project is in frozen state. -
+ // PEER_IDENTITY_MISMATCH: Peer identity does not match peer IP, probably
+ // behind NAT. - TS_NARROWING_NOT_ALLOWED: Traffic selector narrowing not
+ // allowed for an HA-VPN tunnel.
+ //
+ // Possible values:
+ // "ALLOCATING_RESOURCES" - Cloud VPN is in the process of allocating all
+ // required resources (specifically, a borg task).
// "AUTHORIZATION_ERROR" - Auth error (e.g. bad shared secret).
- // "DEPROVISIONING" - Resources is being deallocated for the VPN
- // tunnel.
- // "ESTABLISHED" - Secure session is successfully established with
- // peer VPN.
- // "FAILED" - Tunnel creation has failed and the tunnel is not ready
- // to be used.
+ // "DEPROVISIONING" - Resources is being deallocated for the VPN tunnel.
+ // "ESTABLISHED" - Secure session is successfully established with peer VPN.
+ // "FAILED" - Tunnel creation has failed and the tunnel is not ready to be
+ // used.
// "FIRST_HANDSHAKE" - Successful first handshake with peer VPN.
// "NEGOTIATION_FAILURE" - Handshake failed.
// "NETWORK_ERROR" - Deprecated, replaced by NO_INCOMING_PACKETS
// "NO_INCOMING_PACKETS" - No incoming packets from peer
// "PROVISIONING" - Resource is being allocated for the VPN tunnel.
- // "REJECTED" - Tunnel configuration was rejected, can be result of
- // being denylisted.
- // "STOPPED" - Tunnel is stopped due to its Forwarding Rules being
- // deleted.
- // "WAITING_FOR_FULL_CONFIG" - Waiting to receive all VPN-related
- // configs from user. Network, TargetVpnGateway, VpnTunnel,
- // ForwardingRule and Route resources are needed to setup VPN tunnel.
+ // "REJECTED" - Tunnel configuration was rejected, can be result of being
+ // denylisted.
+ // "STOPPED" - Tunnel is stopped due to its Forwarding Rules being deleted.
+ // "WAITING_FOR_FULL_CONFIG" - Waiting to receive all VPN-related configs
+ // from user. Network, TargetVpnGateway, VpnTunnel, ForwardingRule and Route
+ // resources are needed to setup VPN tunnel.
Status string `json:"status,omitempty"`
-
- // TargetVpnGateway: URL of the Target VPN gateway with which this VPN
- // tunnel is associated. Provided by the client when the VPN tunnel is
- // created.
+ // TargetVpnGateway: URL of the Target VPN gateway with which this VPN tunnel
+ // is associated. Provided by the client when the VPN tunnel is created. This
+ // field can be set only for Classic VPN tunnels.
TargetVpnGateway string `json:"targetVpnGateway,omitempty"`
-
- // VpnGateway: URL of the VPN gateway with which this VPN tunnel is
- // associated. Provided by the client when the VPN tunnel is created.
- // This must be used (instead of target_vpn_gateway) if a High
- // Availability VPN gateway resource is created.
+ // VpnGateway: URL of the VPN gateway with which this VPN tunnel is associated.
+ // Provided by the client when the VPN tunnel is created. This must be used
+ // (instead of target_vpn_gateway) if a High Availability VPN gateway resource
+ // is created.
VpnGateway string `json:"vpnGateway,omitempty"`
-
- // VpnGatewayInterface: The interface ID of the VPN gateway with which
- // this VPN tunnel is associated. Possible values are: `0`, `1`.
+ // VpnGatewayInterface: The interface ID of the VPN gateway with which this VPN
+ // tunnel is associated. Possible values are: `0`, `1`.
VpnGatewayInterface int64 `json:"vpnGatewayInterface,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
- // to unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "CreationTimestamp") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "CreationTimestamp") 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. "CreationTimestamp") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *VpnTunnel) MarshalJSON() ([]byte, error) {
+func (s VpnTunnel) MarshalJSON() ([]byte, error) {
type NoMethod VpnTunnel
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type VpnTunnelAggregatedList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of VpnTunnelsScopedList resources.
Items map[string]VpnTunnelsScopedList `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
- // VPN tunnels.
+ // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for VPN
+ // tunnels.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Unreachables: [Output Only] Unreachable resources.
Unreachables []string `json:"unreachables,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *VpnTunnelAggregatedListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *VpnTunnelAggregatedList) MarshalJSON() ([]byte, error) {
+func (s VpnTunnelAggregatedList) MarshalJSON() ([]byte, error) {
type NoMethod VpnTunnelAggregatedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// VpnTunnelAggregatedListWarning: [Output Only] Informational warning
-// message.
+// VpnTunnelAggregatedListWarning: [Output Only] Informational warning message.
type VpnTunnelAggregatedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*VpnTunnelAggregatedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *VpnTunnelAggregatedListWarning) MarshalJSON() ([]byte, error) {
+func (s VpnTunnelAggregatedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod VpnTunnelAggregatedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type VpnTunnelAggregatedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *VpnTunnelAggregatedListWarningData) MarshalJSON() ([]byte, error) {
+func (s VpnTunnelAggregatedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod VpnTunnelAggregatedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// VpnTunnelList: Contains a list of VpnTunnel resources.
type VpnTunnelList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of VpnTunnel resources.
Items []*VpnTunnel `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
- // VPN tunnels.
+ // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for VPN
+ // tunnels.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *VpnTunnelListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *VpnTunnelList) MarshalJSON() ([]byte, error) {
+func (s VpnTunnelList) MarshalJSON() ([]byte, error) {
type NoMethod VpnTunnelList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// VpnTunnelListWarning: [Output Only] Informational warning message.
type VpnTunnelListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*VpnTunnelListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *VpnTunnelListWarning) MarshalJSON() ([]byte, error) {
+func (s VpnTunnelListWarning) MarshalJSON() ([]byte, error) {
type NoMethod VpnTunnelListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type VpnTunnelListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *VpnTunnelListWarningData) MarshalJSON() ([]byte, error) {
+func (s VpnTunnelListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod VpnTunnelListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type VpnTunnelsScopedList struct {
// VpnTunnels: A list of VPN tunnels contained in this scope.
VpnTunnels []*VpnTunnel `json:"vpnTunnels,omitempty"`
-
- // Warning: Informational warning which replaces the list of addresses
- // when the list is empty.
+ // Warning: Informational warning which replaces the list of addresses when the
+ // list is empty.
Warning *VpnTunnelsScopedListWarning `json:"warning,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "VpnTunnels") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "VpnTunnels") 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. "VpnTunnels") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *VpnTunnelsScopedList) MarshalJSON() ([]byte, error) {
+func (s VpnTunnelsScopedList) MarshalJSON() ([]byte, error) {
type NoMethod VpnTunnelsScopedList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
-// VpnTunnelsScopedListWarning: Informational warning which replaces the
-// list of addresses when the list is empty.
+// VpnTunnelsScopedListWarning: Informational warning which replaces the list
+// of addresses when the list is empty.
type VpnTunnelsScopedListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*VpnTunnelsScopedListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *VpnTunnelsScopedListWarning) MarshalJSON() ([]byte, error) {
+func (s VpnTunnelsScopedListWarning) MarshalJSON() ([]byte, error) {
type NoMethod VpnTunnelsScopedListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type VpnTunnelsScopedListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *VpnTunnelsScopedListWarningData) MarshalJSON() ([]byte, error) {
+func (s VpnTunnelsScopedListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod VpnTunnelsScopedListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type WafExpressionSet struct {
- // Aliases: A list of alternate IDs. The format should be: - E.g.
- // XSS-stable Generic suffix like "stable" is particularly useful if a
- // policy likes to avail newer set of expressions without having to
- // change the policy. A given alias name can't be used for more than one
- // entity set.
+ // Aliases: A list of alternate IDs. The format should be: - E.g. XSS-stable
+ // Generic suffix like "stable" is particularly useful if a policy likes to
+ // avail newer set of expressions without having to change the policy. A given
+ // alias name can't be used for more than one entity set.
Aliases []string `json:"aliases,omitempty"`
-
// Expressions: List of available expressions.
Expressions []*WafExpressionSetExpression `json:"expressions,omitempty"`
-
// Id: Google specified expression set ID. The format should be: - E.g.
// XSS-20170329 required
Id string `json:"id,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Aliases") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Aliases") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Aliases") 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. "Aliases") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *WafExpressionSet) MarshalJSON() ([]byte, error) {
+func (s WafExpressionSet) MarshalJSON() ([]byte, error) {
type NoMethod WafExpressionSet
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type WafExpressionSetExpression struct {
- // Id: Expression ID should uniquely identify the origin of the
- // expression. E.g. owasp-crs-v020901-id973337 identifies Owasp core
- // rule set version 2.9.1 rule id 973337. The ID could be used to
- // determine the individual attack definition that has been detected. It
- // could also be used to exclude it from the policy in case of false
- // positive. required
+ // Id: Expression ID should uniquely identify the origin of the expression.
+ // E.g. owasp-crs-v020901-id973337 identifies Owasp core rule set version 2.9.1
+ // rule id 973337. The ID could be used to determine the individual attack
+ // definition that has been detected. It could also be used to exclude it from
+ // the policy in case of false positive. required
Id string `json:"id,omitempty"`
-
- // Sensitivity: The sensitivity value associated with the WAF rule ID.
- // This corresponds to the ModSecurity paranoia level, ranging from 1 to
- // 4. 0 is reserved for opt-in only rules.
+ // Sensitivity: The sensitivity value associated with the WAF rule ID. This
+ // corresponds to the ModSecurity paranoia level, ranging from 1 to 4. 0 is
+ // reserved for opt-in only rules.
Sensitivity int64 `json:"sensitivity,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *WafExpressionSetExpression) MarshalJSON() ([]byte, error) {
+func (s WafExpressionSetExpression) MarshalJSON() ([]byte, error) {
type NoMethod WafExpressionSetExpression
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// WeightedBackendService: In contrast to a single BackendService in
// HttpRouteAction to which all matching traffic is directed to,
-// WeightedBackendService allows traffic to be split across multiple
-// backend services. The volume of traffic for each backend service is
-// proportional to the weight specified in each WeightedBackendService
+// WeightedBackendService allows traffic to be split across multiple backend
+// services. The volume of traffic for each backend service is proportional to
+// the weight specified in each WeightedBackendService
type WeightedBackendService struct {
// BackendService: The full or partial URL to the default BackendService
- // resource. Before forwarding the request to backendService, the load
- // balancer applies any relevant headerActions specified as part of this
+ // resource. Before forwarding the request to backendService, the load balancer
+ // applies any relevant headerActions specified as part of this
// backendServiceWeight.
BackendService string `json:"backendService,omitempty"`
-
- // HeaderAction: Specifies changes to request and response headers that
- // need to take effect for the selected backendService. headerAction
- // specified here take effect before headerAction in the enclosing
- // HttpRouteRule, PathMatcher and UrlMap. headerAction is not supported
- // for load balancers that have their loadBalancingScheme set to
- // EXTERNAL. Not supported when the URL map is bound to a target gRPC
- // proxy that has validateForProxyless field set to true.
+ // HeaderAction: Specifies changes to request and response headers that need to
+ // take effect for the selected backendService. headerAction specified here
+ // take effect before headerAction in the enclosing HttpRouteRule, PathMatcher
+ // and UrlMap. headerAction is not supported for load balancers that have their
+ // loadBalancingScheme set to EXTERNAL. Not supported when the URL map is bound
+ // to a target gRPC proxy that has validateForProxyless field set to true.
HeaderAction *HttpHeaderAction `json:"headerAction,omitempty"`
-
// Weight: Specifies the fraction of traffic sent to a backend service,
// computed as weight / (sum of all weightedBackendService weights in
- // routeAction) . The selection of a backend service is determined only
- // for new traffic. Once a user's request has been directed to a backend
- // service, subsequent requests are sent to the same backend service as
- // determined by the backend service's session affinity policy. The
- // value must be from 0 to 1000.
+ // routeAction) . The selection of a backend service is determined only for new
+ // traffic. Once a user's request has been directed to a backend service,
+ // subsequent requests are sent to the same backend service as determined by
+ // the backend service's session affinity policy. Don't configure session
+ // affinity if you're using weighted traffic splitting. If you do, the weighted
+ // traffic splitting configuration takes precedence. The value must be from 0
+ // to 1000.
Weight int64 `json:"weight,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "BackendService") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "BackendService") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "BackendService") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *WeightedBackendService) MarshalJSON() ([]byte, error) {
+func (s WeightedBackendService) MarshalJSON() ([]byte, error) {
type NoMethod WeightedBackendService
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type XpnHostList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: [Output Only] A list of shared VPC host project URLs.
Items []*Project `json:"items,omitempty"`
-
- // Kind: [Output Only] Type of resource. Always compute#xpnHostList for
- // lists of shared VPC hosts.
+ // Kind: [Output Only] Type of resource. Always compute#xpnHostList for lists
+ // of shared VPC hosts.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *XpnHostListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *XpnHostList) MarshalJSON() ([]byte, error) {
+func (s XpnHostList) MarshalJSON() ([]byte, error) {
type NoMethod XpnHostList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// XpnHostListWarning: [Output Only] Informational warning message.
type XpnHostListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*XpnHostListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *XpnHostListWarning) MarshalJSON() ([]byte, error) {
+func (s XpnHostListWarning) MarshalJSON() ([]byte, error) {
type NoMethod XpnHostListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type XpnHostListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *XpnHostListWarningData) MarshalJSON() ([]byte, error) {
+func (s XpnHostListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod XpnHostListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// XpnResourceId: Service resource (a.k.a service project) ID.
type XpnResourceId struct {
- // Id: The ID of the service resource. In the case of projects, this
- // field supports project id (e.g., my-project-123) and project number
- // (e.g. 12345678).
+ // Id: The ID of the service resource. In the case of projects, this field
+ // supports project id (e.g., my-project-123) and project number (e.g.
+ // 12345678).
Id string `json:"id,omitempty"`
-
// Type: The type of the service resource.
//
// Possible values:
// "PROJECT"
// "XPN_RESOURCE_TYPE_UNSPECIFIED"
Type string `json:"type,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *XpnResourceId) MarshalJSON() ([]byte, error) {
+func (s XpnResourceId) MarshalJSON() ([]byte, error) {
type NoMethod XpnResourceId
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// Zone: Represents a Zone resource. A zone is a deployment area. These
-// deployment areas are subsets of a region. For example the zone
-// us-east1-a is located in the us-east1 region. For more information,
-// read Regions and Zones.
+// deployment areas are subsets of a region. For example the zone us-east1-b is
+// located in the us-east1 region. For more information, read Regions and
+// Zones.
type Zone struct {
- // AvailableCpuPlatforms: [Output Only] Available cpu/platform
- // selections for the zone.
+ // AvailableCpuPlatforms: [Output Only] Available cpu/platform selections for
+ // the zone.
AvailableCpuPlatforms []string `json:"availableCpuPlatforms,omitempty"`
-
- // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
- // format.
+ // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format.
CreationTimestamp string `json:"creationTimestamp,omitempty"`
-
- // Deprecated -- [Output Only] The deprecation status associated with
- // this zone.
+ // Deprecated -- [Output Only] The deprecation status associated with this
+ // zone.
Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
-
// Description: [Output Only] Textual description of the resource.
Description string `json:"description,omitempty"`
-
- // Id: [Output Only] The unique identifier for the resource. This
- // identifier is defined by the server.
+ // Id: [Output Only] The unique identifier for the resource. This identifier is
+ // defined by the server.
Id uint64 `json:"id,omitempty,string"`
-
- // Kind: [Output Only] Type of the resource. Always compute#zone for
- // zones.
+ // Kind: [Output Only] Type of the resource. Always compute#zone for zones.
Kind string `json:"kind,omitempty"`
-
// Name: [Output Only] Name of the resource.
Name string `json:"name,omitempty"`
-
- // Region: [Output Only] Full URL reference to the region which hosts
- // the zone.
+ // Region: [Output Only] Full URL reference to the region which hosts the zone.
Region string `json:"region,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for the resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Status: [Output Only] Status of the zone, either UP or DOWN.
//
// Possible values:
// "DOWN"
// "UP"
Status string `json:"status,omitempty"`
-
// SupportsPzs: [Output Only] Reserved for future use.
SupportsPzs bool `json:"supportsPzs,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g.
- // "AvailableCpuPlatforms") to unconditionally include in API requests.
- // By default, fields with empty or default 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 is a list of field names (e.g. "AvailableCpuPlatforms") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
// NullFields is a list of field names (e.g. "AvailableCpuPlatforms") 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.
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *Zone) MarshalJSON() ([]byte, error) {
+func (s Zone) MarshalJSON() ([]byte, error) {
type NoMethod Zone
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// ZoneList: Contains a list of zone resources.
type ZoneList struct {
- // Id: [Output Only] Unique identifier for the resource; defined by the
- // server.
+ // Id: [Output Only] Unique identifier for the resource; defined by the server.
Id string `json:"id,omitempty"`
-
// Items: A list of Zone resources.
Items []*Zone `json:"items,omitempty"`
-
// Kind: Type of resource.
Kind string `json:"kind,omitempty"`
-
- // NextPageToken: [Output Only] This token allows you to get the next
- // page of results for list requests. If the number of results is larger
- // than maxResults, use the nextPageToken as a value for the query
- // parameter pageToken in the next list request. Subsequent list
- // requests will have their own nextPageToken to continue paging through
- // the results.
+ // NextPageToken: [Output Only] This token allows you to get the next page of
+ // results for list requests. If the number of results is larger than
+ // maxResults, use the nextPageToken as a value for the query parameter
+ // pageToken in the next list request. Subsequent list requests will have their
+ // own nextPageToken to continue paging through the results.
NextPageToken string `json:"nextPageToken,omitempty"`
-
// SelfLink: [Output Only] Server-defined URL for this resource.
SelfLink string `json:"selfLink,omitempty"`
-
// Warning: [Output Only] Informational warning message.
Warning *ZoneListWarning `json:"warning,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
+ // ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Id") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Id") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Id") 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. "Id") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ZoneList) MarshalJSON() ([]byte, error) {
+func (s ZoneList) MarshalJSON() ([]byte, error) {
type NoMethod ZoneList
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// ZoneListWarning: [Output Only] Informational warning message.
type ZoneListWarning struct {
- // Code: [Output Only] A warning code, if applicable. For example,
- // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
- // the response.
+ // Code: [Output Only] A warning code, if applicable. For example, Compute
+ // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
//
// Possible values:
- // "CLEANUP_FAILED" - Warning about failed cleanup of transient
- // changes made by a failed operation.
- // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was
- // created.
- // "DEPRECATED_TYPE_USED" - When deploying and at least one of the
- // resources has a type marked as deprecated
- // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk
- // that is larger than image size.
+ // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made
+ // by a failed operation.
+ // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created.
+ // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources
+ // has a type marked as deprecated
+ // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is
+ // larger than image size.
// "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the
// resources has a type marked as experimental
- // "EXTERNAL_API_WARNING" - Warning that is present in an external api
- // call
+ // "EXTERNAL_API_WARNING" - Warning that is present in an external api call
// "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been
// overridden. Deprecated unused field.
- // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an
- // injected kernel, which is deprecated.
- // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV
- // backend service is associated with a health check that is not of type
+ // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected
+ // kernel, which is deprecated.
+ // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend
+ // service is associated with a health check that is not of type
// HTTP/HTTPS/HTTP2.
// "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a
// exceedingly large number of resources
- // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to
- // list overhead quota exceed which captures the amount of resources
- // filtered out by user-defined list filter.
+ // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list
+ // overhead quota exceed which captures the amount of resources filtered out by
+ // user-defined list filter.
// "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type
- // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is
- // not assigned to an instance on the network.
- // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot
- // ip forward.
- // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's
- // nextHopInstance URL refers to an instance that does not have an ipv6
- // interface on the same network as the route.
- // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL
- // refers to an instance that does not exist.
- // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance
- // URL refers to an instance that is not on the same network as the
- // route.
- // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not
- // have a status of RUNNING.
- // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to
- // continue the process despite the mentioned error.
- // "NO_RESULTS_ON_PAGE" - No results are present on a particular list
- // page.
- // "PARTIAL_SUCCESS" - Success is reported, but some results may be
- // missing due to errors
- // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource
- // that requires a TOS they have not accepted.
- // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a
- // resource is in use.
- // "RESOURCE_NOT_DELETED" - One or more of the resources set to
- // auto-delete could not be deleted because they were in use.
+ // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not
+ // assigned to an instance on the network.
+ // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip
+ // forward.
+ // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance
+ // URL refers to an instance that does not have an ipv6 interface on the same
+ // network as the route.
+ // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to
+ // an instance that does not exist.
+ // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL
+ // refers to an instance that is not on the same network as the route.
+ // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a
+ // status of RUNNING.
+ // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue
+ // the process despite the mentioned error.
+ // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page.
+ // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing
+ // due to errors
+ // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that
+ // requires a TOS they have not accepted.
+ // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is
+ // in use.
+ // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete
+ // could not be deleted because they were in use.
// "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is
// ignored.
- // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in
- // instance group manager is valid as such, but its application does not
- // make a lot of sense, because it allows only single instance in
- // instance group.
- // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema
- // are present
+ // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance
+ // group manager is valid as such, but its application does not make a lot of
+ // sense, because it allows only single instance in instance group.
+ // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are
+ // present
// "UNREACHABLE" - A given scope cannot be reached.
Code string `json:"code,omitempty"`
-
- // Data: [Output Only] Metadata about this warning in key: value format.
- // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d"
- // }
+ // Data: [Output Only] Metadata about this warning in key: value format. For
+ // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Data []*ZoneListWarningData `json:"data,omitempty"`
-
- // Message: [Output Only] A human-readable description of the warning
- // code.
+ // Message: [Output Only] A human-readable description of the warning code.
Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ZoneListWarning) MarshalJSON() ([]byte, error) {
+func (s ZoneListWarning) MarshalJSON() ([]byte, error) {
type NoMethod ZoneListWarning
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ZoneListWarningData struct {
- // Key: [Output Only] A key that provides more detail on the warning
- // being returned. For example, for warnings where there are no results
- // in a list request for a particular zone, this key might be scope and
- // the key value might be the zone name. Other examples might be a key
- // indicating a deprecated resource and a suggested replacement, or a
- // warning about invalid network settings (for example, if an instance
- // attempts to perform IP forwarding but is not enabled for IP
- // forwarding).
+ // Key: [Output Only] A key that provides more detail on the warning being
+ // returned. For example, for warnings where there are no results in a list
+ // request for a particular zone, this key might be scope and the key value
+ // might be the zone name. Other examples might be a key indicating a
+ // deprecated resource and a suggested replacement, or a warning about invalid
+ // network settings (for example, if an instance attempts to perform IP
+ // forwarding but is not enabled for IP forwarding).
Key string `json:"key,omitempty"`
-
// Value: [Output Only] A warning data value corresponding to the key.
Value string `json:"value,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Key") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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 is a list of field names (e.g. "Key") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Key") 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. "Key") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ZoneListWarningData) MarshalJSON() ([]byte, error) {
+func (s ZoneListWarningData) MarshalJSON() ([]byte, error) {
type NoMethod ZoneListWarningData
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ZoneSetLabelsRequest struct {
- // LabelFingerprint: The fingerprint of the previous set of labels for
- // this resource, used to detect conflicts. The fingerprint is initially
- // generated by Compute Engine and changes after every request to modify
- // or update labels. You must always provide an up-to-date fingerprint
- // hash in order to update or change labels. Make a get() request to the
- // resource to get the latest fingerprint.
+ // LabelFingerprint: The fingerprint of the previous set of labels for this
+ // resource, used to detect conflicts. The fingerprint is initially generated
+ // by Compute Engine and changes after every request to modify or update
+ // labels. You must always provide an up-to-date fingerprint hash in order to
+ // update or change labels. Make a get() request to the resource to get the
+ // latest fingerprint.
LabelFingerprint string `json:"labelFingerprint,omitempty"`
-
// Labels: The labels to set for this resource.
Labels map[string]string `json:"labels,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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. "LabelFingerprint") 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "LabelFingerprint") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ZoneSetLabelsRequest) MarshalJSON() ([]byte, error) {
+func (s ZoneSetLabelsRequest) MarshalJSON() ([]byte, error) {
type NoMethod ZoneSetLabelsRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ZoneSetPolicyRequest struct {
// Bindings: Flatten Policy to create a backwacd compatible wire-format.
// Deprecated. Use 'policy' to specify bindings.
Bindings []*Binding `json:"bindings,omitempty"`
-
// Etag: Flatten Policy to create a backward compatible wire-format.
// Deprecated. Use 'policy' to specify the etag.
Etag string `json:"etag,omitempty"`
-
- // Policy: REQUIRED: The complete policy to be applied to the
- // 'resource'. The size of the policy is limited to a few 10s of KB. An
- // empty policy is in general a valid policy but certain services (like
- // Projects) might reject them.
+ // Policy: REQUIRED: The complete policy to be applied to the 'resource'. The
+ // size of the policy is limited to a few 10s of KB. An empty policy is in
+ // general a valid policy but certain services (like Projects) might reject
+ // them.
Policy *Policy `json:"policy,omitempty"`
-
// ForceSendFields is a list of field names (e.g. "Bindings") to
- // unconditionally include in API requests. By default, fields with
- // empty or default 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.
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Bindings") 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. "Bindings") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *ZoneSetPolicyRequest) MarshalJSON() ([]byte, error) {
+func (s ZoneSetPolicyRequest) MarshalJSON() ([]byte, error) {
type NoMethod ZoneSetPolicyRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// method id "compute.acceleratorTypes.aggregatedList":
-
-type AcceleratorTypesAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Retrieves an aggregated list of accelerator types.
-//
-// - project: Project ID for this request.
-func (r *AcceleratorTypesService) AggregatedList(project string) *AcceleratorTypesAggregatedListCall {
- c := &AcceleratorTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *AcceleratorTypesAggregatedListCall) Filter(filter string) *AcceleratorTypesAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *AcceleratorTypesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *AcceleratorTypesAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *AcceleratorTypesAggregatedListCall) MaxResults(maxResults int64) *AcceleratorTypesAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *AcceleratorTypesAggregatedListCall) OrderBy(orderBy string) *AcceleratorTypesAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *AcceleratorTypesAggregatedListCall) PageToken(pageToken string) *AcceleratorTypesAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *AcceleratorTypesAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *AcceleratorTypesAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *AcceleratorTypesAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *AcceleratorTypesAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *AcceleratorTypesAggregatedListCall) Fields(s ...googleapi.Field) *AcceleratorTypesAggregatedListCall {
- 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 *AcceleratorTypesAggregatedListCall) IfNoneMatch(entityTag string) *AcceleratorTypesAggregatedListCall {
- 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 *AcceleratorTypesAggregatedListCall) Context(ctx context.Context) *AcceleratorTypesAggregatedListCall {
- 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 *AcceleratorTypesAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *AcceleratorTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/acceleratorTypes")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.acceleratorTypes.aggregatedList" call.
-// Exactly one of *AcceleratorTypeAggregatedList or error will be
-// non-nil. Any non-2xx status code is an error. Response headers are in
-// either *AcceleratorTypeAggregatedList.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 *AcceleratorTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*AcceleratorTypeAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &AcceleratorTypeAggregatedList{
- 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": "Retrieves an aggregated list of accelerator types.",
- // "flatPath": "projects/{project}/aggregated/acceleratorTypes",
- // "httpMethod": "GET",
- // "id": "compute.acceleratorTypes.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/acceleratorTypes",
- // "response": {
- // "$ref": "AcceleratorTypeAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *AcceleratorTypesAggregatedListCall) Pages(ctx context.Context, f func(*AcceleratorTypeAggregatedList) 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 "compute.acceleratorTypes.get":
-
-type AcceleratorTypesGetCall struct {
- s *Service
- project string
- zone string
- acceleratorType string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified accelerator type.
-//
-// - acceleratorType: Name of the accelerator type to return.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *AcceleratorTypesService) Get(project string, zone string, acceleratorType string) *AcceleratorTypesGetCall {
- c := &AcceleratorTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.acceleratorType = acceleratorType
- 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 *AcceleratorTypesGetCall) Fields(s ...googleapi.Field) *AcceleratorTypesGetCall {
- 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 *AcceleratorTypesGetCall) IfNoneMatch(entityTag string) *AcceleratorTypesGetCall {
- 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 *AcceleratorTypesGetCall) Context(ctx context.Context) *AcceleratorTypesGetCall {
- 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 *AcceleratorTypesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *AcceleratorTypesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}/acceleratorTypes/{acceleratorType}")
- 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{
- "project": c.project,
- "zone": c.zone,
- "acceleratorType": c.acceleratorType,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.acceleratorTypes.get" call.
-// Exactly one of *AcceleratorType or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *AcceleratorType.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 *AcceleratorTypesGetCall) Do(opts ...googleapi.CallOption) (*AcceleratorType, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &AcceleratorType{
- 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": "Returns the specified accelerator type.",
- // "flatPath": "projects/{project}/zones/{zone}/acceleratorTypes/{acceleratorType}",
- // "httpMethod": "GET",
- // "id": "compute.acceleratorTypes.get",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "acceleratorType"
- // ],
- // "parameters": {
- // "acceleratorType": {
- // "description": "Name of the accelerator type to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/acceleratorTypes/{acceleratorType}",
- // "response": {
- // "$ref": "AcceleratorType"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.acceleratorTypes.list":
-
-type AcceleratorTypesListCall struct {
- s *Service
- project string
- zone string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves a list of accelerator types that are available to the
-// specified project.
-//
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *AcceleratorTypesService) List(project string, zone string) *AcceleratorTypesListCall {
- c := &AcceleratorTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *AcceleratorTypesListCall) Filter(filter string) *AcceleratorTypesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *AcceleratorTypesListCall) MaxResults(maxResults int64) *AcceleratorTypesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *AcceleratorTypesListCall) OrderBy(orderBy string) *AcceleratorTypesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *AcceleratorTypesListCall) PageToken(pageToken string) *AcceleratorTypesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *AcceleratorTypesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *AcceleratorTypesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *AcceleratorTypesListCall) Fields(s ...googleapi.Field) *AcceleratorTypesListCall {
- 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 *AcceleratorTypesListCall) IfNoneMatch(entityTag string) *AcceleratorTypesListCall {
- 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 *AcceleratorTypesListCall) Context(ctx context.Context) *AcceleratorTypesListCall {
- 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 *AcceleratorTypesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *AcceleratorTypesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}/acceleratorTypes")
- 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{
- "project": c.project,
- "zone": c.zone,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.acceleratorTypes.list" call.
-// Exactly one of *AcceleratorTypeList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *AcceleratorTypeList.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 *AcceleratorTypesListCall) Do(opts ...googleapi.CallOption) (*AcceleratorTypeList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &AcceleratorTypeList{
- 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": "Retrieves a list of accelerator types that are available to the specified project.",
- // "flatPath": "projects/{project}/zones/{zone}/acceleratorTypes",
- // "httpMethod": "GET",
- // "id": "compute.acceleratorTypes.list",
- // "parameterOrder": [
- // "project",
- // "zone"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/acceleratorTypes",
- // "response": {
- // "$ref": "AcceleratorTypeList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *AcceleratorTypesListCall) Pages(ctx context.Context, f func(*AcceleratorTypeList) 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 "compute.addresses.aggregatedList":
-
-type AddressesAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Retrieves an aggregated list of addresses.
-//
-// - project: Project ID for this request.
-func (r *AddressesService) AggregatedList(project string) *AddressesAggregatedListCall {
- c := &AddressesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *AddressesAggregatedListCall) Filter(filter string) *AddressesAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *AddressesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *AddressesAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *AddressesAggregatedListCall) MaxResults(maxResults int64) *AddressesAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *AddressesAggregatedListCall) OrderBy(orderBy string) *AddressesAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *AddressesAggregatedListCall) PageToken(pageToken string) *AddressesAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *AddressesAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *AddressesAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *AddressesAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *AddressesAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *AddressesAggregatedListCall) Fields(s ...googleapi.Field) *AddressesAggregatedListCall {
- 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 *AddressesAggregatedListCall) IfNoneMatch(entityTag string) *AddressesAggregatedListCall {
- 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 *AddressesAggregatedListCall) Context(ctx context.Context) *AddressesAggregatedListCall {
- 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 *AddressesAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *AddressesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/addresses")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.addresses.aggregatedList" call.
-// Exactly one of *AddressAggregatedList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *AddressAggregatedList.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 *AddressesAggregatedListCall) Do(opts ...googleapi.CallOption) (*AddressAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &AddressAggregatedList{
- 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": "Retrieves an aggregated list of addresses.",
- // "flatPath": "projects/{project}/aggregated/addresses",
- // "httpMethod": "GET",
- // "id": "compute.addresses.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/addresses",
- // "response": {
- // "$ref": "AddressAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *AddressesAggregatedListCall) Pages(ctx context.Context, f func(*AddressAggregatedList) 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 "compute.addresses.delete":
-
-type AddressesDeleteCall struct {
- s *Service
- project string
- region string
- address string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified address resource.
-//
-// - address: Name of the address resource to delete.
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-func (r *AddressesService) Delete(project string, region string, address string) *AddressesDeleteCall {
- c := &AddressesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.address = address
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *AddressesDeleteCall) RequestId(requestId string) *AddressesDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *AddressesDeleteCall) Fields(s ...googleapi.Field) *AddressesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *AddressesDeleteCall) Context(ctx context.Context) *AddressesDeleteCall {
- 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 *AddressesDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *AddressesDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/addresses/{address}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "address": c.address,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.addresses.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *AddressesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified address resource.",
- // "flatPath": "projects/{project}/regions/{region}/addresses/{address}",
- // "httpMethod": "DELETE",
- // "id": "compute.addresses.delete",
- // "parameterOrder": [
- // "project",
- // "region",
- // "address"
- // ],
- // "parameters": {
- // "address": {
- // "description": "Name of the address resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/addresses/{address}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.addresses.get":
-
-type AddressesGetCall struct {
- s *Service
- project string
- region string
- address string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified address resource.
-//
-// - address: Name of the address resource to return.
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-func (r *AddressesService) Get(project string, region string, address string) *AddressesGetCall {
- c := &AddressesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.address = address
- 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 *AddressesGetCall) Fields(s ...googleapi.Field) *AddressesGetCall {
- 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 *AddressesGetCall) IfNoneMatch(entityTag string) *AddressesGetCall {
- 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 *AddressesGetCall) Context(ctx context.Context) *AddressesGetCall {
- 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 *AddressesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *AddressesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/addresses/{address}")
- 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{
- "project": c.project,
- "region": c.region,
- "address": c.address,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.addresses.get" call.
-// Exactly one of *Address or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Address.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 *AddressesGetCall) Do(opts ...googleapi.CallOption) (*Address, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Address{
- 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": "Returns the specified address resource.",
- // "flatPath": "projects/{project}/regions/{region}/addresses/{address}",
- // "httpMethod": "GET",
- // "id": "compute.addresses.get",
- // "parameterOrder": [
- // "project",
- // "region",
- // "address"
- // ],
- // "parameters": {
- // "address": {
- // "description": "Name of the address resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/addresses/{address}",
- // "response": {
- // "$ref": "Address"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.addresses.insert":
-
-type AddressesInsertCall struct {
- s *Service
- project string
- region string
- address *Address
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates an address resource in the specified project by using
-// the data included in the request.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-func (r *AddressesService) Insert(project string, region string, address *Address) *AddressesInsertCall {
- c := &AddressesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.address = address
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *AddressesInsertCall) RequestId(requestId string) *AddressesInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *AddressesInsertCall) Fields(s ...googleapi.Field) *AddressesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *AddressesInsertCall) Context(ctx context.Context) *AddressesInsertCall {
- 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 *AddressesInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *AddressesInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.address)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/addresses")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.addresses.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *AddressesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates an address resource in the specified project by using the data included in the request.",
- // "flatPath": "projects/{project}/regions/{region}/addresses",
- // "httpMethod": "POST",
- // "id": "compute.addresses.insert",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/addresses",
- // "request": {
- // "$ref": "Address"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.addresses.list":
-
-type AddressesListCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves a list of addresses contained within the specified
-// region.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-func (r *AddressesService) List(project string, region string) *AddressesListCall {
- c := &AddressesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *AddressesListCall) Filter(filter string) *AddressesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *AddressesListCall) MaxResults(maxResults int64) *AddressesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *AddressesListCall) OrderBy(orderBy string) *AddressesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *AddressesListCall) PageToken(pageToken string) *AddressesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *AddressesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *AddressesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *AddressesListCall) Fields(s ...googleapi.Field) *AddressesListCall {
- 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 *AddressesListCall) IfNoneMatch(entityTag string) *AddressesListCall {
- 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 *AddressesListCall) Context(ctx context.Context) *AddressesListCall {
- 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 *AddressesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *AddressesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/addresses")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.addresses.list" call.
-// Exactly one of *AddressList or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *AddressList.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 *AddressesListCall) Do(opts ...googleapi.CallOption) (*AddressList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &AddressList{
- 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": "Retrieves a list of addresses contained within the specified region.",
- // "flatPath": "projects/{project}/regions/{region}/addresses",
- // "httpMethod": "GET",
- // "id": "compute.addresses.list",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/addresses",
- // "response": {
- // "$ref": "AddressList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *AddressesListCall) Pages(ctx context.Context, f func(*AddressList) 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 "compute.addresses.move":
-
-type AddressesMoveCall struct {
- s *Service
- project string
- region string
- address string
- regionaddressesmoverequest *RegionAddressesMoveRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Move: Moves the specified address resource.
-//
-// - address: Name of the address resource to move.
-// - project: Source project ID which the Address is moved from.
-// - region: Name of the region for this request.
-func (r *AddressesService) Move(project string, region string, address string, regionaddressesmoverequest *RegionAddressesMoveRequest) *AddressesMoveCall {
- c := &AddressesMoveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.address = address
- c.regionaddressesmoverequest = regionaddressesmoverequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *AddressesMoveCall) RequestId(requestId string) *AddressesMoveCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *AddressesMoveCall) Fields(s ...googleapi.Field) *AddressesMoveCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *AddressesMoveCall) Context(ctx context.Context) *AddressesMoveCall {
- 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 *AddressesMoveCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *AddressesMoveCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionaddressesmoverequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/addresses/{address}/move")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "address": c.address,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.addresses.move" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *AddressesMoveCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Moves the specified address resource.",
- // "flatPath": "projects/{project}/regions/{region}/addresses/{address}/move",
- // "httpMethod": "POST",
- // "id": "compute.addresses.move",
- // "parameterOrder": [
- // "project",
- // "region",
- // "address"
- // ],
- // "parameters": {
- // "address": {
- // "description": "Name of the address resource to move.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Source project ID which the Address is moved from.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/addresses/{address}/move",
- // "request": {
- // "$ref": "RegionAddressesMoveRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.addresses.setLabels":
-
-type AddressesSetLabelsCall struct {
- s *Service
- project string
- region string
- resource string
- regionsetlabelsrequest *RegionSetLabelsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetLabels: Sets the labels on an Address. To learn more about labels,
-// read the Labeling Resources documentation.
-//
-// - project: Project ID for this request.
-// - region: The region for this request.
-// - resource: Name or id of the resource for this request.
-func (r *AddressesService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *AddressesSetLabelsCall {
- c := &AddressesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.resource = resource
- c.regionsetlabelsrequest = regionsetlabelsrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *AddressesSetLabelsCall) RequestId(requestId string) *AddressesSetLabelsCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *AddressesSetLabelsCall) Fields(s ...googleapi.Field) *AddressesSetLabelsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *AddressesSetLabelsCall) Context(ctx context.Context) *AddressesSetLabelsCall {
- 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 *AddressesSetLabelsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *AddressesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/addresses/{resource}/setLabels")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.addresses.setLabels" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *AddressesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Sets the labels on an Address. To learn more about labels, read the Labeling Resources documentation.",
- // "flatPath": "projects/{project}/regions/{region}/addresses/{resource}/setLabels",
- // "httpMethod": "POST",
- // "id": "compute.addresses.setLabels",
- // "parameterOrder": [
- // "project",
- // "region",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/addresses/{resource}/setLabels",
- // "request": {
- // "$ref": "RegionSetLabelsRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.autoscalers.aggregatedList":
-
-type AutoscalersAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Retrieves an aggregated list of autoscalers.
-//
-// - project: Project ID for this request.
-func (r *AutoscalersService) AggregatedList(project string) *AutoscalersAggregatedListCall {
- c := &AutoscalersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *AutoscalersAggregatedListCall) Filter(filter string) *AutoscalersAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *AutoscalersAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *AutoscalersAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *AutoscalersAggregatedListCall) MaxResults(maxResults int64) *AutoscalersAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *AutoscalersAggregatedListCall) OrderBy(orderBy string) *AutoscalersAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *AutoscalersAggregatedListCall) PageToken(pageToken string) *AutoscalersAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *AutoscalersAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *AutoscalersAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *AutoscalersAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *AutoscalersAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *AutoscalersAggregatedListCall) Fields(s ...googleapi.Field) *AutoscalersAggregatedListCall {
- 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 *AutoscalersAggregatedListCall) IfNoneMatch(entityTag string) *AutoscalersAggregatedListCall {
- 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 *AutoscalersAggregatedListCall) Context(ctx context.Context) *AutoscalersAggregatedListCall {
- 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 *AutoscalersAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *AutoscalersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/autoscalers")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.autoscalers.aggregatedList" call.
-// Exactly one of *AutoscalerAggregatedList or error will be non-nil.
-// Any non-2xx status code is an error. Response headers are in either
-// *AutoscalerAggregatedList.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 *AutoscalersAggregatedListCall) Do(opts ...googleapi.CallOption) (*AutoscalerAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &AutoscalerAggregatedList{
- 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": "Retrieves an aggregated list of autoscalers.",
- // "flatPath": "projects/{project}/aggregated/autoscalers",
- // "httpMethod": "GET",
- // "id": "compute.autoscalers.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/autoscalers",
- // "response": {
- // "$ref": "AutoscalerAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *AutoscalersAggregatedListCall) Pages(ctx context.Context, f func(*AutoscalerAggregatedList) 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 "compute.autoscalers.delete":
-
-type AutoscalersDeleteCall struct {
- s *Service
- project string
- zone string
- autoscaler string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified autoscaler.
-//
-// - autoscaler: Name of the autoscaler to delete.
-// - project: Project ID for this request.
-// - zone: Name of the zone for this request.
-func (r *AutoscalersService) Delete(project string, zone string, autoscaler string) *AutoscalersDeleteCall {
- c := &AutoscalersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.autoscaler = autoscaler
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *AutoscalersDeleteCall) RequestId(requestId string) *AutoscalersDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *AutoscalersDeleteCall) Fields(s ...googleapi.Field) *AutoscalersDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *AutoscalersDeleteCall) Context(ctx context.Context) *AutoscalersDeleteCall {
- 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 *AutoscalersDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *AutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/autoscalers/{autoscaler}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "autoscaler": c.autoscaler,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.autoscalers.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *AutoscalersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified autoscaler.",
- // "flatPath": "projects/{project}/zones/{zone}/autoscalers/{autoscaler}",
- // "httpMethod": "DELETE",
- // "id": "compute.autoscalers.delete",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "autoscaler"
- // ],
- // "parameters": {
- // "autoscaler": {
- // "description": "Name of the autoscaler to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "Name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/autoscalers/{autoscaler}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.autoscalers.get":
-
-type AutoscalersGetCall struct {
- s *Service
- project string
- zone string
- autoscaler string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified autoscaler resource.
-//
-// - autoscaler: Name of the autoscaler to return.
-// - project: Project ID for this request.
-// - zone: Name of the zone for this request.
-func (r *AutoscalersService) Get(project string, zone string, autoscaler string) *AutoscalersGetCall {
- c := &AutoscalersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.autoscaler = autoscaler
- 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 *AutoscalersGetCall) Fields(s ...googleapi.Field) *AutoscalersGetCall {
- 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 *AutoscalersGetCall) IfNoneMatch(entityTag string) *AutoscalersGetCall {
- 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 *AutoscalersGetCall) Context(ctx context.Context) *AutoscalersGetCall {
- 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 *AutoscalersGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *AutoscalersGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}/autoscalers/{autoscaler}")
- 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{
- "project": c.project,
- "zone": c.zone,
- "autoscaler": c.autoscaler,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.autoscalers.get" call.
-// Exactly one of *Autoscaler or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Autoscaler.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 *AutoscalersGetCall) Do(opts ...googleapi.CallOption) (*Autoscaler, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Autoscaler{
- 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": "Returns the specified autoscaler resource.",
- // "flatPath": "projects/{project}/zones/{zone}/autoscalers/{autoscaler}",
- // "httpMethod": "GET",
- // "id": "compute.autoscalers.get",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "autoscaler"
- // ],
- // "parameters": {
- // "autoscaler": {
- // "description": "Name of the autoscaler to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "Name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/autoscalers/{autoscaler}",
- // "response": {
- // "$ref": "Autoscaler"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.autoscalers.insert":
-
-type AutoscalersInsertCall struct {
- s *Service
- project string
- zone string
- autoscaler *Autoscaler
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates an autoscaler in the specified project using the data
-// included in the request.
-//
-// - project: Project ID for this request.
-// - zone: Name of the zone for this request.
-func (r *AutoscalersService) Insert(project string, zone string, autoscaler *Autoscaler) *AutoscalersInsertCall {
- c := &AutoscalersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.autoscaler = autoscaler
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *AutoscalersInsertCall) RequestId(requestId string) *AutoscalersInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *AutoscalersInsertCall) Fields(s ...googleapi.Field) *AutoscalersInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *AutoscalersInsertCall) Context(ctx context.Context) *AutoscalersInsertCall {
- 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 *AutoscalersInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *AutoscalersInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/autoscalers")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.autoscalers.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *AutoscalersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates an autoscaler in the specified project using the data included in the request.",
- // "flatPath": "projects/{project}/zones/{zone}/autoscalers",
- // "httpMethod": "POST",
- // "id": "compute.autoscalers.insert",
- // "parameterOrder": [
- // "project",
- // "zone"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "Name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/autoscalers",
- // "request": {
- // "$ref": "Autoscaler"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.autoscalers.list":
-
-type AutoscalersListCall struct {
- s *Service
- project string
- zone string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves a list of autoscalers contained within the specified
-// zone.
-//
-// - project: Project ID for this request.
-// - zone: Name of the zone for this request.
-func (r *AutoscalersService) List(project string, zone string) *AutoscalersListCall {
- c := &AutoscalersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *AutoscalersListCall) Filter(filter string) *AutoscalersListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *AutoscalersListCall) MaxResults(maxResults int64) *AutoscalersListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *AutoscalersListCall) OrderBy(orderBy string) *AutoscalersListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *AutoscalersListCall) PageToken(pageToken string) *AutoscalersListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *AutoscalersListCall) ReturnPartialSuccess(returnPartialSuccess bool) *AutoscalersListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *AutoscalersListCall) Fields(s ...googleapi.Field) *AutoscalersListCall {
- 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 *AutoscalersListCall) IfNoneMatch(entityTag string) *AutoscalersListCall {
- 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 *AutoscalersListCall) Context(ctx context.Context) *AutoscalersListCall {
- 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 *AutoscalersListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *AutoscalersListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}/autoscalers")
- 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{
- "project": c.project,
- "zone": c.zone,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.autoscalers.list" call.
-// Exactly one of *AutoscalerList or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *AutoscalerList.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 *AutoscalersListCall) Do(opts ...googleapi.CallOption) (*AutoscalerList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &AutoscalerList{
- 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": "Retrieves a list of autoscalers contained within the specified zone.",
- // "flatPath": "projects/{project}/zones/{zone}/autoscalers",
- // "httpMethod": "GET",
- // "id": "compute.autoscalers.list",
- // "parameterOrder": [
- // "project",
- // "zone"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "zone": {
- // "description": "Name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/autoscalers",
- // "response": {
- // "$ref": "AutoscalerList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *AutoscalersListCall) Pages(ctx context.Context, f func(*AutoscalerList) 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 "compute.autoscalers.patch":
-
-type AutoscalersPatchCall struct {
- s *Service
- project string
- zone string
- autoscaler *Autoscaler
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Updates an autoscaler in the specified project using the data
-// included in the request. This method supports PATCH semantics and
-// uses the JSON merge patch format and processing rules.
-//
-// - project: Project ID for this request.
-// - zone: Name of the zone for this request.
-func (r *AutoscalersService) Patch(project string, zone string, autoscaler *Autoscaler) *AutoscalersPatchCall {
- c := &AutoscalersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.autoscaler = autoscaler
- return c
-}
-
-// Autoscaler sets the optional parameter "autoscaler": Name of the
-// autoscaler to patch.
-func (c *AutoscalersPatchCall) Autoscaler(autoscaler string) *AutoscalersPatchCall {
- c.urlParams_.Set("autoscaler", autoscaler)
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *AutoscalersPatchCall) RequestId(requestId string) *AutoscalersPatchCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *AutoscalersPatchCall) Fields(s ...googleapi.Field) *AutoscalersPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *AutoscalersPatchCall) Context(ctx context.Context) *AutoscalersPatchCall {
- 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 *AutoscalersPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *AutoscalersPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/autoscalers")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.autoscalers.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *AutoscalersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
- // "flatPath": "projects/{project}/zones/{zone}/autoscalers",
- // "httpMethod": "PATCH",
- // "id": "compute.autoscalers.patch",
- // "parameterOrder": [
- // "project",
- // "zone"
- // ],
- // "parameters": {
- // "autoscaler": {
- // "description": "Name of the autoscaler to patch.",
- // "location": "query",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "Name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/autoscalers",
- // "request": {
- // "$ref": "Autoscaler"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.autoscalers.update":
-
-type AutoscalersUpdateCall struct {
- s *Service
- project string
- zone string
- autoscaler *Autoscaler
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Update: Updates an autoscaler in the specified project using the data
-// included in the request.
-//
-// - project: Project ID for this request.
-// - zone: Name of the zone for this request.
-func (r *AutoscalersService) Update(project string, zone string, autoscaler *Autoscaler) *AutoscalersUpdateCall {
- c := &AutoscalersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.autoscaler = autoscaler
- return c
-}
-
-// Autoscaler sets the optional parameter "autoscaler": Name of the
-// autoscaler to update.
-func (c *AutoscalersUpdateCall) Autoscaler(autoscaler string) *AutoscalersUpdateCall {
- c.urlParams_.Set("autoscaler", autoscaler)
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *AutoscalersUpdateCall) RequestId(requestId string) *AutoscalersUpdateCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *AutoscalersUpdateCall) Fields(s ...googleapi.Field) *AutoscalersUpdateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *AutoscalersUpdateCall) Context(ctx context.Context) *AutoscalersUpdateCall {
- 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 *AutoscalersUpdateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *AutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/autoscalers")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PUT", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.autoscalers.update" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *AutoscalersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Updates an autoscaler in the specified project using the data included in the request.",
- // "flatPath": "projects/{project}/zones/{zone}/autoscalers",
- // "httpMethod": "PUT",
- // "id": "compute.autoscalers.update",
- // "parameterOrder": [
- // "project",
- // "zone"
- // ],
- // "parameters": {
- // "autoscaler": {
- // "description": "Name of the autoscaler to update.",
- // "location": "query",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "Name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/autoscalers",
- // "request": {
- // "$ref": "Autoscaler"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.backendBuckets.addSignedUrlKey":
-
-type BackendBucketsAddSignedUrlKeyCall struct {
- s *Service
- project string
- backendBucket string
- signedurlkey *SignedUrlKey
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// AddSignedUrlKey: Adds a key for validating requests with signed URLs
-// for this backend bucket.
-//
-// - backendBucket: Name of the BackendBucket resource to which the
-// Signed URL Key should be added. The name should conform to RFC1035.
-// - project: Project ID for this request.
-func (r *BackendBucketsService) AddSignedUrlKey(project string, backendBucket string, signedurlkey *SignedUrlKey) *BackendBucketsAddSignedUrlKeyCall {
- c := &BackendBucketsAddSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.backendBucket = backendBucket
- c.signedurlkey = signedurlkey
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *BackendBucketsAddSignedUrlKeyCall) RequestId(requestId string) *BackendBucketsAddSignedUrlKeyCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *BackendBucketsAddSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendBucketsAddSignedUrlKeyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *BackendBucketsAddSignedUrlKeyCall) Context(ctx context.Context) *BackendBucketsAddSignedUrlKeyCall {
- 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 *BackendBucketsAddSignedUrlKeyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BackendBucketsAddSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.signedurlkey)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendBuckets/{backendBucket}/addSignedUrlKey")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "backendBucket": c.backendBucket,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.backendBuckets.addSignedUrlKey" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *BackendBucketsAddSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Adds a key for validating requests with signed URLs for this backend bucket.",
- // "flatPath": "projects/{project}/global/backendBuckets/{backendBucket}/addSignedUrlKey",
- // "httpMethod": "POST",
- // "id": "compute.backendBuckets.addSignedUrlKey",
- // "parameterOrder": [
- // "project",
- // "backendBucket"
- // ],
- // "parameters": {
- // "backendBucket": {
- // "description": "Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/backendBuckets/{backendBucket}/addSignedUrlKey",
- // "request": {
- // "$ref": "SignedUrlKey"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.backendBuckets.delete":
-
-type BackendBucketsDeleteCall struct {
- s *Service
- project string
- backendBucket string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified BackendBucket resource.
-//
-// - backendBucket: Name of the BackendBucket resource to delete.
-// - project: Project ID for this request.
-func (r *BackendBucketsService) Delete(project string, backendBucket string) *BackendBucketsDeleteCall {
- c := &BackendBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.backendBucket = backendBucket
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *BackendBucketsDeleteCall) RequestId(requestId string) *BackendBucketsDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *BackendBucketsDeleteCall) Fields(s ...googleapi.Field) *BackendBucketsDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *BackendBucketsDeleteCall) Context(ctx context.Context) *BackendBucketsDeleteCall {
- 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 *BackendBucketsDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BackendBucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendBuckets/{backendBucket}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "backendBucket": c.backendBucket,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.backendBuckets.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *BackendBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified BackendBucket resource.",
- // "flatPath": "projects/{project}/global/backendBuckets/{backendBucket}",
- // "httpMethod": "DELETE",
- // "id": "compute.backendBuckets.delete",
- // "parameterOrder": [
- // "project",
- // "backendBucket"
- // ],
- // "parameters": {
- // "backendBucket": {
- // "description": "Name of the BackendBucket resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/backendBuckets/{backendBucket}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.backendBuckets.deleteSignedUrlKey":
-
-type BackendBucketsDeleteSignedUrlKeyCall struct {
- s *Service
- project string
- backendBucket string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// DeleteSignedUrlKey: Deletes a key for validating requests with signed
-// URLs for this backend bucket.
-//
-// - backendBucket: Name of the BackendBucket resource to which the
-// Signed URL Key should be added. The name should conform to RFC1035.
-// - keyName: The name of the Signed URL Key to delete.
-// - project: Project ID for this request.
-func (r *BackendBucketsService) DeleteSignedUrlKey(project string, backendBucket string, keyName string) *BackendBucketsDeleteSignedUrlKeyCall {
- c := &BackendBucketsDeleteSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.backendBucket = backendBucket
- c.urlParams_.Set("keyName", keyName)
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *BackendBucketsDeleteSignedUrlKeyCall) RequestId(requestId string) *BackendBucketsDeleteSignedUrlKeyCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *BackendBucketsDeleteSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendBucketsDeleteSignedUrlKeyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *BackendBucketsDeleteSignedUrlKeyCall) Context(ctx context.Context) *BackendBucketsDeleteSignedUrlKeyCall {
- 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 *BackendBucketsDeleteSignedUrlKeyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BackendBucketsDeleteSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendBuckets/{backendBucket}/deleteSignedUrlKey")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "backendBucket": c.backendBucket,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.backendBuckets.deleteSignedUrlKey" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *BackendBucketsDeleteSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes a key for validating requests with signed URLs for this backend bucket.",
- // "flatPath": "projects/{project}/global/backendBuckets/{backendBucket}/deleteSignedUrlKey",
- // "httpMethod": "POST",
- // "id": "compute.backendBuckets.deleteSignedUrlKey",
- // "parameterOrder": [
- // "project",
- // "backendBucket",
- // "keyName"
- // ],
- // "parameters": {
- // "backendBucket": {
- // "description": "Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "keyName": {
- // "description": "The name of the Signed URL Key to delete.",
- // "location": "query",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/backendBuckets/{backendBucket}/deleteSignedUrlKey",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.backendBuckets.get":
-
-type BackendBucketsGetCall struct {
- s *Service
- project string
- backendBucket string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified BackendBucket resource.
-//
-// - backendBucket: Name of the BackendBucket resource to return.
-// - project: Project ID for this request.
-func (r *BackendBucketsService) Get(project string, backendBucket string) *BackendBucketsGetCall {
- c := &BackendBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.backendBucket = backendBucket
- 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 *BackendBucketsGetCall) Fields(s ...googleapi.Field) *BackendBucketsGetCall {
- 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 *BackendBucketsGetCall) IfNoneMatch(entityTag string) *BackendBucketsGetCall {
- 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 *BackendBucketsGetCall) Context(ctx context.Context) *BackendBucketsGetCall {
- 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 *BackendBucketsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BackendBucketsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/backendBuckets/{backendBucket}")
- 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{
- "project": c.project,
- "backendBucket": c.backendBucket,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.backendBuckets.get" call.
-// Exactly one of *BackendBucket or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *BackendBucket.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 *BackendBucketsGetCall) Do(opts ...googleapi.CallOption) (*BackendBucket, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &BackendBucket{
- 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": "Returns the specified BackendBucket resource.",
- // "flatPath": "projects/{project}/global/backendBuckets/{backendBucket}",
- // "httpMethod": "GET",
- // "id": "compute.backendBuckets.get",
- // "parameterOrder": [
- // "project",
- // "backendBucket"
- // ],
- // "parameters": {
- // "backendBucket": {
- // "description": "Name of the BackendBucket resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/backendBuckets/{backendBucket}",
- // "response": {
- // "$ref": "BackendBucket"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.backendBuckets.getIamPolicy":
-
-type BackendBucketsGetIamPolicyCall struct {
- s *Service
- project string
- resource string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetIamPolicy: Gets the access control policy for a resource. May be
-// empty if no such policy or resource exists.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-func (r *BackendBucketsService) GetIamPolicy(project string, resource string) *BackendBucketsGetIamPolicyCall {
- c := &BackendBucketsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.resource = resource
- return c
-}
-
-// OptionsRequestedPolicyVersion sets the optional parameter
-// "optionsRequestedPolicyVersion": Requested IAM Policy version.
-func (c *BackendBucketsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *BackendBucketsGetIamPolicyCall {
- c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
- 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 *BackendBucketsGetIamPolicyCall) Fields(s ...googleapi.Field) *BackendBucketsGetIamPolicyCall {
- 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 *BackendBucketsGetIamPolicyCall) IfNoneMatch(entityTag string) *BackendBucketsGetIamPolicyCall {
- 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 *BackendBucketsGetIamPolicyCall) Context(ctx context.Context) *BackendBucketsGetIamPolicyCall {
- 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 *BackendBucketsGetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BackendBucketsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/backendBuckets/{resource}/getIamPolicy")
- 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{
- "project": c.project,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.backendBuckets.getIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *BackendBucketsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
- // "flatPath": "projects/{project}/global/backendBuckets/{resource}/getIamPolicy",
- // "httpMethod": "GET",
- // "id": "compute.backendBuckets.getIamPolicy",
- // "parameterOrder": [
- // "project",
- // "resource"
- // ],
- // "parameters": {
- // "optionsRequestedPolicyVersion": {
- // "description": "Requested IAM Policy version.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/backendBuckets/{resource}/getIamPolicy",
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.backendBuckets.insert":
-
-type BackendBucketsInsertCall struct {
- s *Service
- project string
- backendbucket *BackendBucket
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a BackendBucket resource in the specified project
-// using the data included in the request.
-//
-// - project: Project ID for this request.
-func (r *BackendBucketsService) Insert(project string, backendbucket *BackendBucket) *BackendBucketsInsertCall {
- c := &BackendBucketsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.backendbucket = backendbucket
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *BackendBucketsInsertCall) RequestId(requestId string) *BackendBucketsInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *BackendBucketsInsertCall) Fields(s ...googleapi.Field) *BackendBucketsInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *BackendBucketsInsertCall) Context(ctx context.Context) *BackendBucketsInsertCall {
- 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 *BackendBucketsInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BackendBucketsInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendBuckets")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.backendBuckets.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *BackendBucketsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a BackendBucket resource in the specified project using the data included in the request.",
- // "flatPath": "projects/{project}/global/backendBuckets",
- // "httpMethod": "POST",
- // "id": "compute.backendBuckets.insert",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/backendBuckets",
- // "request": {
- // "$ref": "BackendBucket"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.backendBuckets.list":
-
-type BackendBucketsListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves the list of BackendBucket resources available to the
-// specified project.
-//
-// - project: Project ID for this request.
-func (r *BackendBucketsService) List(project string) *BackendBucketsListCall {
- c := &BackendBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *BackendBucketsListCall) Filter(filter string) *BackendBucketsListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *BackendBucketsListCall) MaxResults(maxResults int64) *BackendBucketsListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *BackendBucketsListCall) OrderBy(orderBy string) *BackendBucketsListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *BackendBucketsListCall) PageToken(pageToken string) *BackendBucketsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *BackendBucketsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *BackendBucketsListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *BackendBucketsListCall) Fields(s ...googleapi.Field) *BackendBucketsListCall {
- 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 *BackendBucketsListCall) IfNoneMatch(entityTag string) *BackendBucketsListCall {
- 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 *BackendBucketsListCall) Context(ctx context.Context) *BackendBucketsListCall {
- 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 *BackendBucketsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BackendBucketsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/backendBuckets")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.backendBuckets.list" call.
-// Exactly one of *BackendBucketList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *BackendBucketList.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 *BackendBucketsListCall) Do(opts ...googleapi.CallOption) (*BackendBucketList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &BackendBucketList{
- 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": "Retrieves the list of BackendBucket resources available to the specified project.",
- // "flatPath": "projects/{project}/global/backendBuckets",
- // "httpMethod": "GET",
- // "id": "compute.backendBuckets.list",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/backendBuckets",
- // "response": {
- // "$ref": "BackendBucketList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *BackendBucketsListCall) Pages(ctx context.Context, f func(*BackendBucketList) 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 "compute.backendBuckets.patch":
-
-type BackendBucketsPatchCall struct {
- s *Service
- project string
- backendBucket string
- backendbucket *BackendBucket
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Updates the specified BackendBucket resource with the data
-// included in the request. This method supports PATCH semantics and
-// uses the JSON merge patch format and processing rules.
-//
-// - backendBucket: Name of the BackendBucket resource to patch.
-// - project: Project ID for this request.
-func (r *BackendBucketsService) Patch(project string, backendBucket string, backendbucket *BackendBucket) *BackendBucketsPatchCall {
- c := &BackendBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.backendBucket = backendBucket
- c.backendbucket = backendbucket
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *BackendBucketsPatchCall) RequestId(requestId string) *BackendBucketsPatchCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *BackendBucketsPatchCall) Fields(s ...googleapi.Field) *BackendBucketsPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *BackendBucketsPatchCall) Context(ctx context.Context) *BackendBucketsPatchCall {
- 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 *BackendBucketsPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BackendBucketsPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendBuckets/{backendBucket}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "backendBucket": c.backendBucket,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.backendBuckets.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *BackendBucketsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Updates the specified BackendBucket resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
- // "flatPath": "projects/{project}/global/backendBuckets/{backendBucket}",
- // "httpMethod": "PATCH",
- // "id": "compute.backendBuckets.patch",
- // "parameterOrder": [
- // "project",
- // "backendBucket"
- // ],
- // "parameters": {
- // "backendBucket": {
- // "description": "Name of the BackendBucket resource to patch.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/backendBuckets/{backendBucket}",
- // "request": {
- // "$ref": "BackendBucket"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.backendBuckets.setEdgeSecurityPolicy":
-
-type BackendBucketsSetEdgeSecurityPolicyCall struct {
- s *Service
- project string
- backendBucket string
- securitypolicyreference *SecurityPolicyReference
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetEdgeSecurityPolicy: Sets the edge security policy for the
-// specified backend bucket.
-//
-// - backendBucket: Name of the BackendBucket resource to which the
-// security policy should be set. The name should conform to RFC1035.
-// - project: Project ID for this request.
-func (r *BackendBucketsService) SetEdgeSecurityPolicy(project string, backendBucket string, securitypolicyreference *SecurityPolicyReference) *BackendBucketsSetEdgeSecurityPolicyCall {
- c := &BackendBucketsSetEdgeSecurityPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.backendBucket = backendBucket
- c.securitypolicyreference = securitypolicyreference
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *BackendBucketsSetEdgeSecurityPolicyCall) RequestId(requestId string) *BackendBucketsSetEdgeSecurityPolicyCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *BackendBucketsSetEdgeSecurityPolicyCall) Fields(s ...googleapi.Field) *BackendBucketsSetEdgeSecurityPolicyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *BackendBucketsSetEdgeSecurityPolicyCall) Context(ctx context.Context) *BackendBucketsSetEdgeSecurityPolicyCall {
- 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 *BackendBucketsSetEdgeSecurityPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BackendBucketsSetEdgeSecurityPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyreference)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendBuckets/{backendBucket}/setEdgeSecurityPolicy")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "backendBucket": c.backendBucket,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.backendBuckets.setEdgeSecurityPolicy" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *BackendBucketsSetEdgeSecurityPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Sets the edge security policy for the specified backend bucket.",
- // "flatPath": "projects/{project}/global/backendBuckets/{backendBucket}/setEdgeSecurityPolicy",
- // "httpMethod": "POST",
- // "id": "compute.backendBuckets.setEdgeSecurityPolicy",
- // "parameterOrder": [
- // "project",
- // "backendBucket"
- // ],
- // "parameters": {
- // "backendBucket": {
- // "description": "Name of the BackendBucket resource to which the security policy should be set. The name should conform to RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/backendBuckets/{backendBucket}/setEdgeSecurityPolicy",
- // "request": {
- // "$ref": "SecurityPolicyReference"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.backendBuckets.setIamPolicy":
-
-type BackendBucketsSetIamPolicyCall struct {
- s *Service
- project string
- resource string
- globalsetpolicyrequest *GlobalSetPolicyRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetIamPolicy: Sets the access control policy on the specified
-// resource. Replaces any existing policy.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-func (r *BackendBucketsService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *BackendBucketsSetIamPolicyCall {
- c := &BackendBucketsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.resource = resource
- c.globalsetpolicyrequest = globalsetpolicyrequest
- 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 *BackendBucketsSetIamPolicyCall) Fields(s ...googleapi.Field) *BackendBucketsSetIamPolicyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *BackendBucketsSetIamPolicyCall) Context(ctx context.Context) *BackendBucketsSetIamPolicyCall {
- 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 *BackendBucketsSetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BackendBucketsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendBuckets/{resource}/setIamPolicy")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.backendBuckets.setIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *BackendBucketsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Sets the access control policy on the specified resource. Replaces any existing policy.",
- // "flatPath": "projects/{project}/global/backendBuckets/{resource}/setIamPolicy",
- // "httpMethod": "POST",
- // "id": "compute.backendBuckets.setIamPolicy",
- // "parameterOrder": [
- // "project",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/backendBuckets/{resource}/setIamPolicy",
- // "request": {
- // "$ref": "GlobalSetPolicyRequest"
- // },
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.backendBuckets.testIamPermissions":
-
-type BackendBucketsTestIamPermissionsCall struct {
- s *Service
- project string
- resource string
- testpermissionsrequest *TestPermissionsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// TestIamPermissions: Returns permissions that a caller has on the
-// specified resource.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-func (r *BackendBucketsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *BackendBucketsTestIamPermissionsCall {
- c := &BackendBucketsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.resource = resource
- c.testpermissionsrequest = testpermissionsrequest
- 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 *BackendBucketsTestIamPermissionsCall) Fields(s ...googleapi.Field) *BackendBucketsTestIamPermissionsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *BackendBucketsTestIamPermissionsCall) Context(ctx context.Context) *BackendBucketsTestIamPermissionsCall {
- 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 *BackendBucketsTestIamPermissionsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BackendBucketsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendBuckets/{resource}/testIamPermissions")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.backendBuckets.testIamPermissions" call.
-// Exactly one of *TestPermissionsResponse or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *TestPermissionsResponse.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 *BackendBucketsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TestPermissionsResponse{
- 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": "Returns permissions that a caller has on the specified resource.",
- // "flatPath": "projects/{project}/global/backendBuckets/{resource}/testIamPermissions",
- // "httpMethod": "POST",
- // "id": "compute.backendBuckets.testIamPermissions",
- // "parameterOrder": [
- // "project",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/backendBuckets/{resource}/testIamPermissions",
- // "request": {
- // "$ref": "TestPermissionsRequest"
- // },
- // "response": {
- // "$ref": "TestPermissionsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.backendBuckets.update":
-
-type BackendBucketsUpdateCall struct {
- s *Service
- project string
- backendBucket string
- backendbucket *BackendBucket
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Update: Updates the specified BackendBucket resource with the data
-// included in the request.
-//
-// - backendBucket: Name of the BackendBucket resource to update.
-// - project: Project ID for this request.
-func (r *BackendBucketsService) Update(project string, backendBucket string, backendbucket *BackendBucket) *BackendBucketsUpdateCall {
- c := &BackendBucketsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.backendBucket = backendBucket
- c.backendbucket = backendbucket
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *BackendBucketsUpdateCall) RequestId(requestId string) *BackendBucketsUpdateCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *BackendBucketsUpdateCall) Fields(s ...googleapi.Field) *BackendBucketsUpdateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *BackendBucketsUpdateCall) Context(ctx context.Context) *BackendBucketsUpdateCall {
- 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 *BackendBucketsUpdateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BackendBucketsUpdateCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendBuckets/{backendBucket}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PUT", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "backendBucket": c.backendBucket,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.backendBuckets.update" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *BackendBucketsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Updates the specified BackendBucket resource with the data included in the request.",
- // "flatPath": "projects/{project}/global/backendBuckets/{backendBucket}",
- // "httpMethod": "PUT",
- // "id": "compute.backendBuckets.update",
- // "parameterOrder": [
- // "project",
- // "backendBucket"
- // ],
- // "parameters": {
- // "backendBucket": {
- // "description": "Name of the BackendBucket resource to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/backendBuckets/{backendBucket}",
- // "request": {
- // "$ref": "BackendBucket"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.backendServices.addSignedUrlKey":
-
-type BackendServicesAddSignedUrlKeyCall struct {
- s *Service
- project string
- backendService string
- signedurlkey *SignedUrlKey
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// AddSignedUrlKey: Adds a key for validating requests with signed URLs
-// for this backend service.
-//
-// - backendService: Name of the BackendService resource to which the
-// Signed URL Key should be added. The name should conform to RFC1035.
-// - project: Project ID for this request.
-func (r *BackendServicesService) AddSignedUrlKey(project string, backendService string, signedurlkey *SignedUrlKey) *BackendServicesAddSignedUrlKeyCall {
- c := &BackendServicesAddSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.backendService = backendService
- c.signedurlkey = signedurlkey
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *BackendServicesAddSignedUrlKeyCall) RequestId(requestId string) *BackendServicesAddSignedUrlKeyCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *BackendServicesAddSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendServicesAddSignedUrlKeyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *BackendServicesAddSignedUrlKeyCall) Context(ctx context.Context) *BackendServicesAddSignedUrlKeyCall {
- 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 *BackendServicesAddSignedUrlKeyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BackendServicesAddSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.signedurlkey)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices/{backendService}/addSignedUrlKey")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "backendService": c.backendService,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.backendServices.addSignedUrlKey" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *BackendServicesAddSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Adds a key for validating requests with signed URLs for this backend service.",
- // "flatPath": "projects/{project}/global/backendServices/{backendService}/addSignedUrlKey",
- // "httpMethod": "POST",
- // "id": "compute.backendServices.addSignedUrlKey",
- // "parameterOrder": [
- // "project",
- // "backendService"
- // ],
- // "parameters": {
- // "backendService": {
- // "description": "Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/backendServices/{backendService}/addSignedUrlKey",
- // "request": {
- // "$ref": "SignedUrlKey"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.backendServices.aggregatedList":
-
-type BackendServicesAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Retrieves the list of all BackendService resources,
-// regional and global, available to the specified project.
-//
-// - project: Name of the project scoping this request.
-func (r *BackendServicesService) AggregatedList(project string) *BackendServicesAggregatedListCall {
- c := &BackendServicesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *BackendServicesAggregatedListCall) Filter(filter string) *BackendServicesAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *BackendServicesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *BackendServicesAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *BackendServicesAggregatedListCall) MaxResults(maxResults int64) *BackendServicesAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *BackendServicesAggregatedListCall) OrderBy(orderBy string) *BackendServicesAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *BackendServicesAggregatedListCall) PageToken(pageToken string) *BackendServicesAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *BackendServicesAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *BackendServicesAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *BackendServicesAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *BackendServicesAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *BackendServicesAggregatedListCall) Fields(s ...googleapi.Field) *BackendServicesAggregatedListCall {
- 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 *BackendServicesAggregatedListCall) IfNoneMatch(entityTag string) *BackendServicesAggregatedListCall {
- 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 *BackendServicesAggregatedListCall) Context(ctx context.Context) *BackendServicesAggregatedListCall {
- 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 *BackendServicesAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BackendServicesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/backendServices")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.backendServices.aggregatedList" call.
-// Exactly one of *BackendServiceAggregatedList or error will be
-// non-nil. Any non-2xx status code is an error. Response headers are in
-// either *BackendServiceAggregatedList.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 *BackendServicesAggregatedListCall) Do(opts ...googleapi.CallOption) (*BackendServiceAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &BackendServiceAggregatedList{
- 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": "Retrieves the list of all BackendService resources, regional and global, available to the specified project.",
- // "flatPath": "projects/{project}/aggregated/backendServices",
- // "httpMethod": "GET",
- // "id": "compute.backendServices.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Name of the project scoping this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/backendServices",
- // "response": {
- // "$ref": "BackendServiceAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *BackendServicesAggregatedListCall) Pages(ctx context.Context, f func(*BackendServiceAggregatedList) 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 "compute.backendServices.delete":
-
-type BackendServicesDeleteCall struct {
- s *Service
- project string
- backendService string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified BackendService resource.
-//
-// - backendService: Name of the BackendService resource to delete.
-// - project: Project ID for this request.
-func (r *BackendServicesService) Delete(project string, backendService string) *BackendServicesDeleteCall {
- c := &BackendServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.backendService = backendService
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *BackendServicesDeleteCall) RequestId(requestId string) *BackendServicesDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *BackendServicesDeleteCall) Fields(s ...googleapi.Field) *BackendServicesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *BackendServicesDeleteCall) Context(ctx context.Context) *BackendServicesDeleteCall {
- 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 *BackendServicesDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices/{backendService}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "backendService": c.backendService,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.backendServices.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *BackendServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified BackendService resource.",
- // "flatPath": "projects/{project}/global/backendServices/{backendService}",
- // "httpMethod": "DELETE",
- // "id": "compute.backendServices.delete",
- // "parameterOrder": [
- // "project",
- // "backendService"
- // ],
- // "parameters": {
- // "backendService": {
- // "description": "Name of the BackendService resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/backendServices/{backendService}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.backendServices.deleteSignedUrlKey":
-
-type BackendServicesDeleteSignedUrlKeyCall struct {
- s *Service
- project string
- backendService string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// DeleteSignedUrlKey: Deletes a key for validating requests with signed
-// URLs for this backend service.
-//
-// - backendService: Name of the BackendService resource to which the
-// Signed URL Key should be added. The name should conform to RFC1035.
-// - keyName: The name of the Signed URL Key to delete.
-// - project: Project ID for this request.
-func (r *BackendServicesService) DeleteSignedUrlKey(project string, backendService string, keyName string) *BackendServicesDeleteSignedUrlKeyCall {
- c := &BackendServicesDeleteSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.backendService = backendService
- c.urlParams_.Set("keyName", keyName)
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *BackendServicesDeleteSignedUrlKeyCall) RequestId(requestId string) *BackendServicesDeleteSignedUrlKeyCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *BackendServicesDeleteSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendServicesDeleteSignedUrlKeyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *BackendServicesDeleteSignedUrlKeyCall) Context(ctx context.Context) *BackendServicesDeleteSignedUrlKeyCall {
- 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 *BackendServicesDeleteSignedUrlKeyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BackendServicesDeleteSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices/{backendService}/deleteSignedUrlKey")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "backendService": c.backendService,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.backendServices.deleteSignedUrlKey" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *BackendServicesDeleteSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes a key for validating requests with signed URLs for this backend service.",
- // "flatPath": "projects/{project}/global/backendServices/{backendService}/deleteSignedUrlKey",
- // "httpMethod": "POST",
- // "id": "compute.backendServices.deleteSignedUrlKey",
- // "parameterOrder": [
- // "project",
- // "backendService",
- // "keyName"
- // ],
- // "parameters": {
- // "backendService": {
- // "description": "Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "keyName": {
- // "description": "The name of the Signed URL Key to delete.",
- // "location": "query",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/backendServices/{backendService}/deleteSignedUrlKey",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.backendServices.get":
-
-type BackendServicesGetCall struct {
- s *Service
- project string
- backendService string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified BackendService resource.
-//
-// - backendService: Name of the BackendService resource to return.
-// - project: Project ID for this request.
-func (r *BackendServicesService) Get(project string, backendService string) *BackendServicesGetCall {
- c := &BackendServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.backendService = backendService
- 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 *BackendServicesGetCall) Fields(s ...googleapi.Field) *BackendServicesGetCall {
- 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 *BackendServicesGetCall) IfNoneMatch(entityTag string) *BackendServicesGetCall {
- 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 *BackendServicesGetCall) Context(ctx context.Context) *BackendServicesGetCall {
- 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 *BackendServicesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BackendServicesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/backendServices/{backendService}")
- 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{
- "project": c.project,
- "backendService": c.backendService,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.backendServices.get" call.
-// Exactly one of *BackendService or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *BackendService.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 *BackendServicesGetCall) Do(opts ...googleapi.CallOption) (*BackendService, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &BackendService{
- 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": "Returns the specified BackendService resource.",
- // "flatPath": "projects/{project}/global/backendServices/{backendService}",
- // "httpMethod": "GET",
- // "id": "compute.backendServices.get",
- // "parameterOrder": [
- // "project",
- // "backendService"
- // ],
- // "parameters": {
- // "backendService": {
- // "description": "Name of the BackendService resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/backendServices/{backendService}",
- // "response": {
- // "$ref": "BackendService"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.backendServices.getHealth":
-
-type BackendServicesGetHealthCall struct {
- s *Service
- project string
- backendService string
- resourcegroupreference *ResourceGroupReference
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetHealth: Gets the most recent health check results for this
-// BackendService. Example request body: { "group":
-// "/zones/us-east1-b/instanceGroups/lb-backend-example" }
-//
-// - backendService: Name of the BackendService resource to which the
-// queried instance belongs.
-// - project: .
-func (r *BackendServicesService) GetHealth(project string, backendService string, resourcegroupreference *ResourceGroupReference) *BackendServicesGetHealthCall {
- c := &BackendServicesGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.backendService = backendService
- c.resourcegroupreference = resourcegroupreference
- 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 *BackendServicesGetHealthCall) Fields(s ...googleapi.Field) *BackendServicesGetHealthCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *BackendServicesGetHealthCall) Context(ctx context.Context) *BackendServicesGetHealthCall {
- 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 *BackendServicesGetHealthCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BackendServicesGetHealthCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices/{backendService}/getHealth")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "backendService": c.backendService,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.backendServices.getHealth" call.
-// Exactly one of *BackendServiceGroupHealth or error will be non-nil.
-// Any non-2xx status code is an error. Response headers are in either
-// *BackendServiceGroupHealth.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 *BackendServicesGetHealthCall) Do(opts ...googleapi.CallOption) (*BackendServiceGroupHealth, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &BackendServiceGroupHealth{
- 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": "Gets the most recent health check results for this BackendService. Example request body: { \"group\": \"/zones/us-east1-b/instanceGroups/lb-backend-example\" }",
- // "flatPath": "projects/{project}/global/backendServices/{backendService}/getHealth",
- // "httpMethod": "POST",
- // "id": "compute.backendServices.getHealth",
- // "parameterOrder": [
- // "project",
- // "backendService"
- // ],
- // "parameters": {
- // "backendService": {
- // "description": "Name of the BackendService resource to which the queried instance belongs.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/backendServices/{backendService}/getHealth",
- // "request": {
- // "$ref": "ResourceGroupReference"
- // },
- // "response": {
- // "$ref": "BackendServiceGroupHealth"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.backendServices.getIamPolicy":
-
-type BackendServicesGetIamPolicyCall struct {
- s *Service
- project string
- resource string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetIamPolicy: Gets the access control policy for a resource. May be
-// empty if no such policy or resource exists.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-func (r *BackendServicesService) GetIamPolicy(project string, resource string) *BackendServicesGetIamPolicyCall {
- c := &BackendServicesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.resource = resource
- return c
-}
-
-// OptionsRequestedPolicyVersion sets the optional parameter
-// "optionsRequestedPolicyVersion": Requested IAM Policy version.
-func (c *BackendServicesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *BackendServicesGetIamPolicyCall {
- c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
- 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 *BackendServicesGetIamPolicyCall) Fields(s ...googleapi.Field) *BackendServicesGetIamPolicyCall {
- 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 *BackendServicesGetIamPolicyCall) IfNoneMatch(entityTag string) *BackendServicesGetIamPolicyCall {
- 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 *BackendServicesGetIamPolicyCall) Context(ctx context.Context) *BackendServicesGetIamPolicyCall {
- 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 *BackendServicesGetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BackendServicesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/backendServices/{resource}/getIamPolicy")
- 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{
- "project": c.project,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.backendServices.getIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *BackendServicesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
- // "flatPath": "projects/{project}/global/backendServices/{resource}/getIamPolicy",
- // "httpMethod": "GET",
- // "id": "compute.backendServices.getIamPolicy",
- // "parameterOrder": [
- // "project",
- // "resource"
- // ],
- // "parameters": {
- // "optionsRequestedPolicyVersion": {
- // "description": "Requested IAM Policy version.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/backendServices/{resource}/getIamPolicy",
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.backendServices.insert":
-
-type BackendServicesInsertCall struct {
- s *Service
- project string
- backendservice *BackendService
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a BackendService resource in the specified project
-// using the data included in the request. For more information, see
-// Backend services overview .
-//
-// - project: Project ID for this request.
-func (r *BackendServicesService) Insert(project string, backendservice *BackendService) *BackendServicesInsertCall {
- c := &BackendServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.backendservice = backendservice
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *BackendServicesInsertCall) RequestId(requestId string) *BackendServicesInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *BackendServicesInsertCall) Fields(s ...googleapi.Field) *BackendServicesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *BackendServicesInsertCall) Context(ctx context.Context) *BackendServicesInsertCall {
- 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 *BackendServicesInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BackendServicesInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.backendServices.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *BackendServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a BackendService resource in the specified project using the data included in the request. For more information, see Backend services overview .",
- // "flatPath": "projects/{project}/global/backendServices",
- // "httpMethod": "POST",
- // "id": "compute.backendServices.insert",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/backendServices",
- // "request": {
- // "$ref": "BackendService"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.backendServices.list":
-
-type BackendServicesListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves the list of BackendService resources available to the
-// specified project.
-//
-// - project: Project ID for this request.
-func (r *BackendServicesService) List(project string) *BackendServicesListCall {
- c := &BackendServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *BackendServicesListCall) Filter(filter string) *BackendServicesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *BackendServicesListCall) MaxResults(maxResults int64) *BackendServicesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *BackendServicesListCall) OrderBy(orderBy string) *BackendServicesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *BackendServicesListCall) PageToken(pageToken string) *BackendServicesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *BackendServicesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *BackendServicesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *BackendServicesListCall) Fields(s ...googleapi.Field) *BackendServicesListCall {
- 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 *BackendServicesListCall) IfNoneMatch(entityTag string) *BackendServicesListCall {
- 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 *BackendServicesListCall) Context(ctx context.Context) *BackendServicesListCall {
- 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 *BackendServicesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BackendServicesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/backendServices")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.backendServices.list" call.
-// Exactly one of *BackendServiceList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *BackendServiceList.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 *BackendServicesListCall) Do(opts ...googleapi.CallOption) (*BackendServiceList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &BackendServiceList{
- 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": "Retrieves the list of BackendService resources available to the specified project.",
- // "flatPath": "projects/{project}/global/backendServices",
- // "httpMethod": "GET",
- // "id": "compute.backendServices.list",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/backendServices",
- // "response": {
- // "$ref": "BackendServiceList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *BackendServicesListCall) Pages(ctx context.Context, f func(*BackendServiceList) 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 "compute.backendServices.listUsable":
-
-type BackendServicesListUsableCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// ListUsable: Retrieves an aggregated list of all usable backend
-// services in the specified project.
-//
-// - project: Project ID for this request.
-func (r *BackendServicesService) ListUsable(project string) *BackendServicesListUsableCall {
- c := &BackendServicesListUsableCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *BackendServicesListUsableCall) Filter(filter string) *BackendServicesListUsableCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *BackendServicesListUsableCall) MaxResults(maxResults int64) *BackendServicesListUsableCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *BackendServicesListUsableCall) OrderBy(orderBy string) *BackendServicesListUsableCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *BackendServicesListUsableCall) PageToken(pageToken string) *BackendServicesListUsableCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *BackendServicesListUsableCall) ReturnPartialSuccess(returnPartialSuccess bool) *BackendServicesListUsableCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *BackendServicesListUsableCall) Fields(s ...googleapi.Field) *BackendServicesListUsableCall {
- 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 *BackendServicesListUsableCall) IfNoneMatch(entityTag string) *BackendServicesListUsableCall {
- 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 *BackendServicesListUsableCall) Context(ctx context.Context) *BackendServicesListUsableCall {
- 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 *BackendServicesListUsableCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BackendServicesListUsableCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/backendServices/listUsable")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.backendServices.listUsable" call.
-// Exactly one of *BackendServiceListUsable or error will be non-nil.
-// Any non-2xx status code is an error. Response headers are in either
-// *BackendServiceListUsable.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 *BackendServicesListUsableCall) Do(opts ...googleapi.CallOption) (*BackendServiceListUsable, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &BackendServiceListUsable{
- 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": "Retrieves an aggregated list of all usable backend services in the specified project.",
- // "flatPath": "projects/{project}/global/backendServices/listUsable",
- // "httpMethod": "GET",
- // "id": "compute.backendServices.listUsable",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/backendServices/listUsable",
- // "response": {
- // "$ref": "BackendServiceListUsable"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *BackendServicesListUsableCall) Pages(ctx context.Context, f func(*BackendServiceListUsable) 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 "compute.backendServices.patch":
-
-type BackendServicesPatchCall struct {
- s *Service
- project string
- backendService string
- backendservice *BackendService
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Patches the specified BackendService resource with the data
-// included in the request. For more information, see Backend services
-// overview. This method supports PATCH semantics and uses the JSON
-// merge patch format and processing rules.
-//
-// - backendService: Name of the BackendService resource to patch.
-// - project: Project ID for this request.
-func (r *BackendServicesService) Patch(project string, backendService string, backendservice *BackendService) *BackendServicesPatchCall {
- c := &BackendServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.backendService = backendService
- c.backendservice = backendservice
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *BackendServicesPatchCall) RequestId(requestId string) *BackendServicesPatchCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *BackendServicesPatchCall) Fields(s ...googleapi.Field) *BackendServicesPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *BackendServicesPatchCall) Context(ctx context.Context) *BackendServicesPatchCall {
- 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 *BackendServicesPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BackendServicesPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices/{backendService}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "backendService": c.backendService,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.backendServices.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *BackendServicesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Patches the specified BackendService resource with the data included in the request. For more information, see Backend services overview. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
- // "flatPath": "projects/{project}/global/backendServices/{backendService}",
- // "httpMethod": "PATCH",
- // "id": "compute.backendServices.patch",
- // "parameterOrder": [
- // "project",
- // "backendService"
- // ],
- // "parameters": {
- // "backendService": {
- // "description": "Name of the BackendService resource to patch.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/backendServices/{backendService}",
- // "request": {
- // "$ref": "BackendService"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.backendServices.setEdgeSecurityPolicy":
-
-type BackendServicesSetEdgeSecurityPolicyCall struct {
- s *Service
- project string
- backendService string
- securitypolicyreference *SecurityPolicyReference
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetEdgeSecurityPolicy: Sets the edge security policy for the
-// specified backend service.
-//
-// - backendService: Name of the BackendService resource to which the
-// edge security policy should be set. The name should conform to
-// RFC1035.
-// - project: Project ID for this request.
-func (r *BackendServicesService) SetEdgeSecurityPolicy(project string, backendService string, securitypolicyreference *SecurityPolicyReference) *BackendServicesSetEdgeSecurityPolicyCall {
- c := &BackendServicesSetEdgeSecurityPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.backendService = backendService
- c.securitypolicyreference = securitypolicyreference
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *BackendServicesSetEdgeSecurityPolicyCall) RequestId(requestId string) *BackendServicesSetEdgeSecurityPolicyCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *BackendServicesSetEdgeSecurityPolicyCall) Fields(s ...googleapi.Field) *BackendServicesSetEdgeSecurityPolicyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *BackendServicesSetEdgeSecurityPolicyCall) Context(ctx context.Context) *BackendServicesSetEdgeSecurityPolicyCall {
- 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 *BackendServicesSetEdgeSecurityPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BackendServicesSetEdgeSecurityPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyreference)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices/{backendService}/setEdgeSecurityPolicy")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "backendService": c.backendService,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.backendServices.setEdgeSecurityPolicy" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *BackendServicesSetEdgeSecurityPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Sets the edge security policy for the specified backend service.",
- // "flatPath": "projects/{project}/global/backendServices/{backendService}/setEdgeSecurityPolicy",
- // "httpMethod": "POST",
- // "id": "compute.backendServices.setEdgeSecurityPolicy",
- // "parameterOrder": [
- // "project",
- // "backendService"
- // ],
- // "parameters": {
- // "backendService": {
- // "description": "Name of the BackendService resource to which the edge security policy should be set. The name should conform to RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/backendServices/{backendService}/setEdgeSecurityPolicy",
- // "request": {
- // "$ref": "SecurityPolicyReference"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.backendServices.setIamPolicy":
-
-type BackendServicesSetIamPolicyCall struct {
- s *Service
- project string
- resource string
- globalsetpolicyrequest *GlobalSetPolicyRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetIamPolicy: Sets the access control policy on the specified
-// resource. Replaces any existing policy.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-func (r *BackendServicesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *BackendServicesSetIamPolicyCall {
- c := &BackendServicesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.resource = resource
- c.globalsetpolicyrequest = globalsetpolicyrequest
- 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 *BackendServicesSetIamPolicyCall) Fields(s ...googleapi.Field) *BackendServicesSetIamPolicyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *BackendServicesSetIamPolicyCall) Context(ctx context.Context) *BackendServicesSetIamPolicyCall {
- 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 *BackendServicesSetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BackendServicesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices/{resource}/setIamPolicy")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.backendServices.setIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *BackendServicesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Sets the access control policy on the specified resource. Replaces any existing policy.",
- // "flatPath": "projects/{project}/global/backendServices/{resource}/setIamPolicy",
- // "httpMethod": "POST",
- // "id": "compute.backendServices.setIamPolicy",
- // "parameterOrder": [
- // "project",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/backendServices/{resource}/setIamPolicy",
- // "request": {
- // "$ref": "GlobalSetPolicyRequest"
- // },
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.backendServices.setSecurityPolicy":
-
-type BackendServicesSetSecurityPolicyCall struct {
- s *Service
- project string
- backendService string
- securitypolicyreference *SecurityPolicyReference
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetSecurityPolicy: Sets the Google Cloud Armor security policy for
-// the specified backend service. For more information, see Google Cloud
-// Armor Overview
-//
-// - backendService: Name of the BackendService resource to which the
-// security policy should be set. The name should conform to RFC1035.
-// - project: Project ID for this request.
-func (r *BackendServicesService) SetSecurityPolicy(project string, backendService string, securitypolicyreference *SecurityPolicyReference) *BackendServicesSetSecurityPolicyCall {
- c := &BackendServicesSetSecurityPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.backendService = backendService
- c.securitypolicyreference = securitypolicyreference
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *BackendServicesSetSecurityPolicyCall) RequestId(requestId string) *BackendServicesSetSecurityPolicyCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *BackendServicesSetSecurityPolicyCall) Fields(s ...googleapi.Field) *BackendServicesSetSecurityPolicyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *BackendServicesSetSecurityPolicyCall) Context(ctx context.Context) *BackendServicesSetSecurityPolicyCall {
- 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 *BackendServicesSetSecurityPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BackendServicesSetSecurityPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyreference)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices/{backendService}/setSecurityPolicy")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "backendService": c.backendService,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.backendServices.setSecurityPolicy" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *BackendServicesSetSecurityPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Sets the Google Cloud Armor security policy for the specified backend service. For more information, see Google Cloud Armor Overview",
- // "flatPath": "projects/{project}/global/backendServices/{backendService}/setSecurityPolicy",
- // "httpMethod": "POST",
- // "id": "compute.backendServices.setSecurityPolicy",
- // "parameterOrder": [
- // "project",
- // "backendService"
- // ],
- // "parameters": {
- // "backendService": {
- // "description": "Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/backendServices/{backendService}/setSecurityPolicy",
- // "request": {
- // "$ref": "SecurityPolicyReference"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.backendServices.testIamPermissions":
-
-type BackendServicesTestIamPermissionsCall struct {
- s *Service
- project string
- resource string
- testpermissionsrequest *TestPermissionsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// TestIamPermissions: Returns permissions that a caller has on the
-// specified resource.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-func (r *BackendServicesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *BackendServicesTestIamPermissionsCall {
- c := &BackendServicesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.resource = resource
- c.testpermissionsrequest = testpermissionsrequest
- 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 *BackendServicesTestIamPermissionsCall) Fields(s ...googleapi.Field) *BackendServicesTestIamPermissionsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *BackendServicesTestIamPermissionsCall) Context(ctx context.Context) *BackendServicesTestIamPermissionsCall {
- 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 *BackendServicesTestIamPermissionsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BackendServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices/{resource}/testIamPermissions")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.backendServices.testIamPermissions" call.
-// Exactly one of *TestPermissionsResponse or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *TestPermissionsResponse.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 *BackendServicesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TestPermissionsResponse{
- 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": "Returns permissions that a caller has on the specified resource.",
- // "flatPath": "projects/{project}/global/backendServices/{resource}/testIamPermissions",
- // "httpMethod": "POST",
- // "id": "compute.backendServices.testIamPermissions",
- // "parameterOrder": [
- // "project",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/backendServices/{resource}/testIamPermissions",
- // "request": {
- // "$ref": "TestPermissionsRequest"
- // },
- // "response": {
- // "$ref": "TestPermissionsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.backendServices.update":
-
-type BackendServicesUpdateCall struct {
- s *Service
- project string
- backendService string
- backendservice *BackendService
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Update: Updates the specified BackendService resource with the data
-// included in the request. For more information, see Backend services
-// overview.
-//
-// - backendService: Name of the BackendService resource to update.
-// - project: Project ID for this request.
-func (r *BackendServicesService) Update(project string, backendService string, backendservice *BackendService) *BackendServicesUpdateCall {
- c := &BackendServicesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.backendService = backendService
- c.backendservice = backendservice
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *BackendServicesUpdateCall) RequestId(requestId string) *BackendServicesUpdateCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *BackendServicesUpdateCall) Fields(s ...googleapi.Field) *BackendServicesUpdateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *BackendServicesUpdateCall) Context(ctx context.Context) *BackendServicesUpdateCall {
- 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 *BackendServicesUpdateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BackendServicesUpdateCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices/{backendService}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PUT", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "backendService": c.backendService,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.backendServices.update" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *BackendServicesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Updates the specified BackendService resource with the data included in the request. For more information, see Backend services overview.",
- // "flatPath": "projects/{project}/global/backendServices/{backendService}",
- // "httpMethod": "PUT",
- // "id": "compute.backendServices.update",
- // "parameterOrder": [
- // "project",
- // "backendService"
- // ],
- // "parameters": {
- // "backendService": {
- // "description": "Name of the BackendService resource to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/backendServices/{backendService}",
- // "request": {
- // "$ref": "BackendService"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.diskTypes.aggregatedList":
-
-type DiskTypesAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Retrieves an aggregated list of disk types.
-//
-// - project: Project ID for this request.
-func (r *DiskTypesService) AggregatedList(project string) *DiskTypesAggregatedListCall {
- c := &DiskTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *DiskTypesAggregatedListCall) Filter(filter string) *DiskTypesAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *DiskTypesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *DiskTypesAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *DiskTypesAggregatedListCall) MaxResults(maxResults int64) *DiskTypesAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *DiskTypesAggregatedListCall) OrderBy(orderBy string) *DiskTypesAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *DiskTypesAggregatedListCall) PageToken(pageToken string) *DiskTypesAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *DiskTypesAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *DiskTypesAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *DiskTypesAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *DiskTypesAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *DiskTypesAggregatedListCall) Fields(s ...googleapi.Field) *DiskTypesAggregatedListCall {
- 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 *DiskTypesAggregatedListCall) IfNoneMatch(entityTag string) *DiskTypesAggregatedListCall {
- 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 *DiskTypesAggregatedListCall) Context(ctx context.Context) *DiskTypesAggregatedListCall {
- 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 *DiskTypesAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *DiskTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/diskTypes")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.diskTypes.aggregatedList" call.
-// Exactly one of *DiskTypeAggregatedList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *DiskTypeAggregatedList.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 *DiskTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*DiskTypeAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &DiskTypeAggregatedList{
- 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": "Retrieves an aggregated list of disk types.",
- // "flatPath": "projects/{project}/aggregated/diskTypes",
- // "httpMethod": "GET",
- // "id": "compute.diskTypes.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/diskTypes",
- // "response": {
- // "$ref": "DiskTypeAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *DiskTypesAggregatedListCall) Pages(ctx context.Context, f func(*DiskTypeAggregatedList) 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 "compute.diskTypes.get":
-
-type DiskTypesGetCall struct {
- s *Service
- project string
- zone string
- diskType string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified disk type.
-//
-// - diskType: Name of the disk type to return.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *DiskTypesService) Get(project string, zone string, diskType string) *DiskTypesGetCall {
- c := &DiskTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.diskType = diskType
- 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 *DiskTypesGetCall) Fields(s ...googleapi.Field) *DiskTypesGetCall {
- 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 *DiskTypesGetCall) IfNoneMatch(entityTag string) *DiskTypesGetCall {
- 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 *DiskTypesGetCall) Context(ctx context.Context) *DiskTypesGetCall {
- 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 *DiskTypesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *DiskTypesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}/diskTypes/{diskType}")
- 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{
- "project": c.project,
- "zone": c.zone,
- "diskType": c.diskType,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.diskTypes.get" call.
-// Exactly one of *DiskType or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *DiskType.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 *DiskTypesGetCall) Do(opts ...googleapi.CallOption) (*DiskType, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &DiskType{
- 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": "Returns the specified disk type.",
- // "flatPath": "projects/{project}/zones/{zone}/diskTypes/{diskType}",
- // "httpMethod": "GET",
- // "id": "compute.diskTypes.get",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "diskType"
- // ],
- // "parameters": {
- // "diskType": {
- // "description": "Name of the disk type to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/diskTypes/{diskType}",
- // "response": {
- // "$ref": "DiskType"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.diskTypes.list":
-
-type DiskTypesListCall struct {
- s *Service
- project string
- zone string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves a list of disk types available to the specified
-// project.
-//
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *DiskTypesService) List(project string, zone string) *DiskTypesListCall {
- c := &DiskTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *DiskTypesListCall) Filter(filter string) *DiskTypesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *DiskTypesListCall) MaxResults(maxResults int64) *DiskTypesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *DiskTypesListCall) OrderBy(orderBy string) *DiskTypesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *DiskTypesListCall) PageToken(pageToken string) *DiskTypesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *DiskTypesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *DiskTypesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *DiskTypesListCall) Fields(s ...googleapi.Field) *DiskTypesListCall {
- 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 *DiskTypesListCall) IfNoneMatch(entityTag string) *DiskTypesListCall {
- 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 *DiskTypesListCall) Context(ctx context.Context) *DiskTypesListCall {
- 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 *DiskTypesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *DiskTypesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}/diskTypes")
- 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{
- "project": c.project,
- "zone": c.zone,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.diskTypes.list" call.
-// Exactly one of *DiskTypeList or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *DiskTypeList.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 *DiskTypesListCall) Do(opts ...googleapi.CallOption) (*DiskTypeList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &DiskTypeList{
- 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": "Retrieves a list of disk types available to the specified project.",
- // "flatPath": "projects/{project}/zones/{zone}/diskTypes",
- // "httpMethod": "GET",
- // "id": "compute.diskTypes.list",
- // "parameterOrder": [
- // "project",
- // "zone"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/diskTypes",
- // "response": {
- // "$ref": "DiskTypeList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *DiskTypesListCall) Pages(ctx context.Context, f func(*DiskTypeList) 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 "compute.disks.addResourcePolicies":
-
-type DisksAddResourcePoliciesCall struct {
- s *Service
- project string
- zone string
- disk string
- disksaddresourcepoliciesrequest *DisksAddResourcePoliciesRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// AddResourcePolicies: Adds existing resource policies to a disk. You
-// can only add one policy which will be applied to this disk for
-// scheduling snapshot creation.
-//
-// - disk: The disk name for this request.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *DisksService) AddResourcePolicies(project string, zone string, disk string, disksaddresourcepoliciesrequest *DisksAddResourcePoliciesRequest) *DisksAddResourcePoliciesCall {
- c := &DisksAddResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.disk = disk
- c.disksaddresourcepoliciesrequest = disksaddresourcepoliciesrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *DisksAddResourcePoliciesCall) RequestId(requestId string) *DisksAddResourcePoliciesCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *DisksAddResourcePoliciesCall) Fields(s ...googleapi.Field) *DisksAddResourcePoliciesCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *DisksAddResourcePoliciesCall) Context(ctx context.Context) *DisksAddResourcePoliciesCall {
- 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 *DisksAddResourcePoliciesCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *DisksAddResourcePoliciesCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksaddresourcepoliciesrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks/{disk}/addResourcePolicies")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "disk": c.disk,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.disks.addResourcePolicies" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *DisksAddResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Adds existing resource policies to a disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation.",
- // "flatPath": "projects/{project}/zones/{zone}/disks/{disk}/addResourcePolicies",
- // "httpMethod": "POST",
- // "id": "compute.disks.addResourcePolicies",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "disk"
- // ],
- // "parameters": {
- // "disk": {
- // "description": "The disk name for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/disks/{disk}/addResourcePolicies",
- // "request": {
- // "$ref": "DisksAddResourcePoliciesRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.disks.aggregatedList":
-
-type DisksAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Retrieves an aggregated list of persistent disks.
-//
-// - project: Project ID for this request.
-func (r *DisksService) AggregatedList(project string) *DisksAggregatedListCall {
- c := &DisksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *DisksAggregatedListCall) Filter(filter string) *DisksAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *DisksAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *DisksAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *DisksAggregatedListCall) MaxResults(maxResults int64) *DisksAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *DisksAggregatedListCall) OrderBy(orderBy string) *DisksAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *DisksAggregatedListCall) PageToken(pageToken string) *DisksAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *DisksAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *DisksAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *DisksAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *DisksAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *DisksAggregatedListCall) Fields(s ...googleapi.Field) *DisksAggregatedListCall {
- 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 *DisksAggregatedListCall) IfNoneMatch(entityTag string) *DisksAggregatedListCall {
- 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 *DisksAggregatedListCall) Context(ctx context.Context) *DisksAggregatedListCall {
- 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 *DisksAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *DisksAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/disks")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.disks.aggregatedList" call.
-// Exactly one of *DiskAggregatedList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *DiskAggregatedList.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 *DisksAggregatedListCall) Do(opts ...googleapi.CallOption) (*DiskAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &DiskAggregatedList{
- 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": "Retrieves an aggregated list of persistent disks.",
- // "flatPath": "projects/{project}/aggregated/disks",
- // "httpMethod": "GET",
- // "id": "compute.disks.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/disks",
- // "response": {
- // "$ref": "DiskAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *DisksAggregatedListCall) Pages(ctx context.Context, f func(*DiskAggregatedList) 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 "compute.disks.bulkInsert":
-
-type DisksBulkInsertCall struct {
- s *Service
- project string
- zone string
- bulkinsertdiskresource *BulkInsertDiskResource
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// BulkInsert: Bulk create a set of disks.
-//
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *DisksService) BulkInsert(project string, zone string, bulkinsertdiskresource *BulkInsertDiskResource) *DisksBulkInsertCall {
- c := &DisksBulkInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.bulkinsertdiskresource = bulkinsertdiskresource
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *DisksBulkInsertCall) RequestId(requestId string) *DisksBulkInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *DisksBulkInsertCall) Fields(s ...googleapi.Field) *DisksBulkInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *DisksBulkInsertCall) Context(ctx context.Context) *DisksBulkInsertCall {
- 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 *DisksBulkInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *DisksBulkInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkinsertdiskresource)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks/bulkInsert")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.disks.bulkInsert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *DisksBulkInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Bulk create a set of disks.",
- // "flatPath": "projects/{project}/zones/{zone}/disks/bulkInsert",
- // "httpMethod": "POST",
- // "id": "compute.disks.bulkInsert",
- // "parameterOrder": [
- // "project",
- // "zone"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/disks/bulkInsert",
- // "request": {
- // "$ref": "BulkInsertDiskResource"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.disks.createSnapshot":
-
-type DisksCreateSnapshotCall struct {
- s *Service
- project string
- zone string
- disk string
- snapshot *Snapshot
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// CreateSnapshot: Creates a snapshot of a specified persistent disk.
-// For regular snapshot creation, consider using snapshots.insert
-// instead, as that method supports more features, such as creating
-// snapshots in a project different from the source disk project.
-//
-// - disk: Name of the persistent disk to snapshot.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *DisksService) CreateSnapshot(project string, zone string, disk string, snapshot *Snapshot) *DisksCreateSnapshotCall {
- c := &DisksCreateSnapshotCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.disk = disk
- c.snapshot = snapshot
- return c
-}
-
-// GuestFlush sets the optional parameter "guestFlush": [Input Only]
-// Whether to attempt an application consistent snapshot by informing
-// the OS to prepare for the snapshot process.
-func (c *DisksCreateSnapshotCall) GuestFlush(guestFlush bool) *DisksCreateSnapshotCall {
- c.urlParams_.Set("guestFlush", fmt.Sprint(guestFlush))
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *DisksCreateSnapshotCall) RequestId(requestId string) *DisksCreateSnapshotCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *DisksCreateSnapshotCall) Fields(s ...googleapi.Field) *DisksCreateSnapshotCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *DisksCreateSnapshotCall) Context(ctx context.Context) *DisksCreateSnapshotCall {
- 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 *DisksCreateSnapshotCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *DisksCreateSnapshotCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks/{disk}/createSnapshot")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "disk": c.disk,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.disks.createSnapshot" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *DisksCreateSnapshotCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a snapshot of a specified persistent disk. For regular snapshot creation, consider using snapshots.insert instead, as that method supports more features, such as creating snapshots in a project different from the source disk project.",
- // "flatPath": "projects/{project}/zones/{zone}/disks/{disk}/createSnapshot",
- // "httpMethod": "POST",
- // "id": "compute.disks.createSnapshot",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "disk"
- // ],
- // "parameters": {
- // "disk": {
- // "description": "Name of the persistent disk to snapshot.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "guestFlush": {
- // "description": "[Input Only] Whether to attempt an application consistent snapshot by informing the OS to prepare for the snapshot process.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/disks/{disk}/createSnapshot",
- // "request": {
- // "$ref": "Snapshot"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.disks.delete":
-
-type DisksDeleteCall struct {
- s *Service
- project string
- zone string
- disk string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified persistent disk. Deleting a disk
-// removes its data permanently and is irreversible. However, deleting a
-// disk does not delete any snapshots previously made from the disk. You
-// must separately delete snapshots.
-//
-// - disk: Name of the persistent disk to delete.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *DisksService) Delete(project string, zone string, disk string) *DisksDeleteCall {
- c := &DisksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.disk = disk
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *DisksDeleteCall) RequestId(requestId string) *DisksDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *DisksDeleteCall) Fields(s ...googleapi.Field) *DisksDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *DisksDeleteCall) Context(ctx context.Context) *DisksDeleteCall {
- 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 *DisksDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *DisksDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks/{disk}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "disk": c.disk,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.disks.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *DisksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified persistent disk. Deleting a disk removes its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots.",
- // "flatPath": "projects/{project}/zones/{zone}/disks/{disk}",
- // "httpMethod": "DELETE",
- // "id": "compute.disks.delete",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "disk"
- // ],
- // "parameters": {
- // "disk": {
- // "description": "Name of the persistent disk to delete.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/disks/{disk}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.disks.get":
-
-type DisksGetCall struct {
- s *Service
- project string
- zone string
- disk string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified persistent disk.
-//
-// - disk: Name of the persistent disk to return.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *DisksService) Get(project string, zone string, disk string) *DisksGetCall {
- c := &DisksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.disk = disk
- 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 *DisksGetCall) Fields(s ...googleapi.Field) *DisksGetCall {
- 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 *DisksGetCall) IfNoneMatch(entityTag string) *DisksGetCall {
- 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 *DisksGetCall) Context(ctx context.Context) *DisksGetCall {
- 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 *DisksGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *DisksGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}/disks/{disk}")
- 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{
- "project": c.project,
- "zone": c.zone,
- "disk": c.disk,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.disks.get" call.
-// Exactly one of *Disk or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Disk.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 *DisksGetCall) Do(opts ...googleapi.CallOption) (*Disk, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Disk{
- 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": "Returns the specified persistent disk.",
- // "flatPath": "projects/{project}/zones/{zone}/disks/{disk}",
- // "httpMethod": "GET",
- // "id": "compute.disks.get",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "disk"
- // ],
- // "parameters": {
- // "disk": {
- // "description": "Name of the persistent disk to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/disks/{disk}",
- // "response": {
- // "$ref": "Disk"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.disks.getIamPolicy":
-
-type DisksGetIamPolicyCall struct {
- s *Service
- project string
- zone string
- resource string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetIamPolicy: Gets the access control policy for a resource. May be
-// empty if no such policy or resource exists.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-// - zone: The name of the zone for this request.
-func (r *DisksService) GetIamPolicy(project string, zone string, resource string) *DisksGetIamPolicyCall {
- c := &DisksGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.resource = resource
- return c
-}
-
-// OptionsRequestedPolicyVersion sets the optional parameter
-// "optionsRequestedPolicyVersion": Requested IAM Policy version.
-func (c *DisksGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *DisksGetIamPolicyCall {
- c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
- 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 *DisksGetIamPolicyCall) Fields(s ...googleapi.Field) *DisksGetIamPolicyCall {
- 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 *DisksGetIamPolicyCall) IfNoneMatch(entityTag string) *DisksGetIamPolicyCall {
- 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 *DisksGetIamPolicyCall) Context(ctx context.Context) *DisksGetIamPolicyCall {
- 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 *DisksGetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *DisksGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}/disks/{resource}/getIamPolicy")
- 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{
- "project": c.project,
- "zone": c.zone,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.disks.getIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *DisksGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
- // "flatPath": "projects/{project}/zones/{zone}/disks/{resource}/getIamPolicy",
- // "httpMethod": "GET",
- // "id": "compute.disks.getIamPolicy",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "resource"
- // ],
- // "parameters": {
- // "optionsRequestedPolicyVersion": {
- // "description": "Requested IAM Policy version.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/disks/{resource}/getIamPolicy",
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.disks.insert":
-
-type DisksInsertCall struct {
- s *Service
- project string
- zone string
- disk *Disk
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a persistent disk in the specified project using the
-// data in the request. You can create a disk from a source
-// (sourceImage, sourceSnapshot, or sourceDisk) or create an empty 500
-// GB data disk by omitting all properties. You can also create a disk
-// that is larger than the default size by specifying the sizeGb
-// property.
-//
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *DisksService) Insert(project string, zone string, disk *Disk) *DisksInsertCall {
- c := &DisksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.disk = disk
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *DisksInsertCall) RequestId(requestId string) *DisksInsertCall {
- c.urlParams_.Set("requestId", requestId)
- return c
-}
-
-// SourceImage sets the optional parameter "sourceImage": Source image
-// to restore onto a disk. This field is optional.
-func (c *DisksInsertCall) SourceImage(sourceImage string) *DisksInsertCall {
- c.urlParams_.Set("sourceImage", sourceImage)
- 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 *DisksInsertCall) Fields(s ...googleapi.Field) *DisksInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *DisksInsertCall) Context(ctx context.Context) *DisksInsertCall {
- 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 *DisksInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *DisksInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.disks.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *DisksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a persistent disk in the specified project using the data in the request. You can create a disk from a source (sourceImage, sourceSnapshot, or sourceDisk) or create an empty 500 GB data disk by omitting all properties. You can also create a disk that is larger than the default size by specifying the sizeGb property.",
- // "flatPath": "projects/{project}/zones/{zone}/disks",
- // "httpMethod": "POST",
- // "id": "compute.disks.insert",
- // "parameterOrder": [
- // "project",
- // "zone"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "sourceImage": {
- // "description": "Source image to restore onto a disk. This field is optional.",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/disks",
- // "request": {
- // "$ref": "Disk"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.disks.list":
-
-type DisksListCall struct {
- s *Service
- project string
- zone string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves a list of persistent disks contained within the
-// specified zone.
-//
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *DisksService) List(project string, zone string) *DisksListCall {
- c := &DisksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *DisksListCall) Filter(filter string) *DisksListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *DisksListCall) MaxResults(maxResults int64) *DisksListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *DisksListCall) OrderBy(orderBy string) *DisksListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *DisksListCall) PageToken(pageToken string) *DisksListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *DisksListCall) ReturnPartialSuccess(returnPartialSuccess bool) *DisksListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *DisksListCall) Fields(s ...googleapi.Field) *DisksListCall {
- 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 *DisksListCall) IfNoneMatch(entityTag string) *DisksListCall {
- 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 *DisksListCall) Context(ctx context.Context) *DisksListCall {
- 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 *DisksListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *DisksListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}/disks")
- 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{
- "project": c.project,
- "zone": c.zone,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.disks.list" call.
-// Exactly one of *DiskList or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *DiskList.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 *DisksListCall) Do(opts ...googleapi.CallOption) (*DiskList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &DiskList{
- 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": "Retrieves a list of persistent disks contained within the specified zone.",
- // "flatPath": "projects/{project}/zones/{zone}/disks",
- // "httpMethod": "GET",
- // "id": "compute.disks.list",
- // "parameterOrder": [
- // "project",
- // "zone"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/disks",
- // "response": {
- // "$ref": "DiskList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *DisksListCall) Pages(ctx context.Context, f func(*DiskList) 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 "compute.disks.removeResourcePolicies":
-
-type DisksRemoveResourcePoliciesCall struct {
- s *Service
- project string
- zone string
- disk string
- disksremoveresourcepoliciesrequest *DisksRemoveResourcePoliciesRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// RemoveResourcePolicies: Removes resource policies from a disk.
-//
-// - disk: The disk name for this request.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *DisksService) RemoveResourcePolicies(project string, zone string, disk string, disksremoveresourcepoliciesrequest *DisksRemoveResourcePoliciesRequest) *DisksRemoveResourcePoliciesCall {
- c := &DisksRemoveResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.disk = disk
- c.disksremoveresourcepoliciesrequest = disksremoveresourcepoliciesrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *DisksRemoveResourcePoliciesCall) RequestId(requestId string) *DisksRemoveResourcePoliciesCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *DisksRemoveResourcePoliciesCall) Fields(s ...googleapi.Field) *DisksRemoveResourcePoliciesCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *DisksRemoveResourcePoliciesCall) Context(ctx context.Context) *DisksRemoveResourcePoliciesCall {
- 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 *DisksRemoveResourcePoliciesCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *DisksRemoveResourcePoliciesCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksremoveresourcepoliciesrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks/{disk}/removeResourcePolicies")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "disk": c.disk,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.disks.removeResourcePolicies" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *DisksRemoveResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Removes resource policies from a disk.",
- // "flatPath": "projects/{project}/zones/{zone}/disks/{disk}/removeResourcePolicies",
- // "httpMethod": "POST",
- // "id": "compute.disks.removeResourcePolicies",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "disk"
- // ],
- // "parameters": {
- // "disk": {
- // "description": "The disk name for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/disks/{disk}/removeResourcePolicies",
- // "request": {
- // "$ref": "DisksRemoveResourcePoliciesRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.disks.resize":
-
-type DisksResizeCall struct {
- s *Service
- project string
- zone string
- disk string
- disksresizerequest *DisksResizeRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Resize: Resizes the specified persistent disk. You can only increase
-// the size of the disk.
-//
-// - disk: The name of the persistent disk.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *DisksService) Resize(project string, zone string, disk string, disksresizerequest *DisksResizeRequest) *DisksResizeCall {
- c := &DisksResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.disk = disk
- c.disksresizerequest = disksresizerequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *DisksResizeCall) RequestId(requestId string) *DisksResizeCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *DisksResizeCall) Fields(s ...googleapi.Field) *DisksResizeCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *DisksResizeCall) Context(ctx context.Context) *DisksResizeCall {
- 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 *DisksResizeCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *DisksResizeCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksresizerequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks/{disk}/resize")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "disk": c.disk,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.disks.resize" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *DisksResizeCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Resizes the specified persistent disk. You can only increase the size of the disk.",
- // "flatPath": "projects/{project}/zones/{zone}/disks/{disk}/resize",
- // "httpMethod": "POST",
- // "id": "compute.disks.resize",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "disk"
- // ],
- // "parameters": {
- // "disk": {
- // "description": "The name of the persistent disk.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/disks/{disk}/resize",
- // "request": {
- // "$ref": "DisksResizeRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.disks.setIamPolicy":
-
-type DisksSetIamPolicyCall struct {
- s *Service
- project string
- zone string
- resource string
- zonesetpolicyrequest *ZoneSetPolicyRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetIamPolicy: Sets the access control policy on the specified
-// resource. Replaces any existing policy.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-// - zone: The name of the zone for this request.
-func (r *DisksService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *DisksSetIamPolicyCall {
- c := &DisksSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.resource = resource
- c.zonesetpolicyrequest = zonesetpolicyrequest
- 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 *DisksSetIamPolicyCall) Fields(s ...googleapi.Field) *DisksSetIamPolicyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *DisksSetIamPolicyCall) Context(ctx context.Context) *DisksSetIamPolicyCall {
- 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 *DisksSetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *DisksSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks/{resource}/setIamPolicy")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.disks.setIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *DisksSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Sets the access control policy on the specified resource. Replaces any existing policy.",
- // "flatPath": "projects/{project}/zones/{zone}/disks/{resource}/setIamPolicy",
- // "httpMethod": "POST",
- // "id": "compute.disks.setIamPolicy",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/disks/{resource}/setIamPolicy",
- // "request": {
- // "$ref": "ZoneSetPolicyRequest"
- // },
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.disks.setLabels":
-
-type DisksSetLabelsCall struct {
- s *Service
- project string
- zone string
- resource string
- zonesetlabelsrequest *ZoneSetLabelsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetLabels: Sets the labels on a disk. To learn more about labels,
-// read the Labeling Resources documentation.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-// - zone: The name of the zone for this request.
-func (r *DisksService) SetLabels(project string, zone string, resource string, zonesetlabelsrequest *ZoneSetLabelsRequest) *DisksSetLabelsCall {
- c := &DisksSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.resource = resource
- c.zonesetlabelsrequest = zonesetlabelsrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *DisksSetLabelsCall) RequestId(requestId string) *DisksSetLabelsCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *DisksSetLabelsCall) Fields(s ...googleapi.Field) *DisksSetLabelsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *DisksSetLabelsCall) Context(ctx context.Context) *DisksSetLabelsCall {
- 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 *DisksSetLabelsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *DisksSetLabelsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetlabelsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks/{resource}/setLabels")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.disks.setLabels" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *DisksSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation.",
- // "flatPath": "projects/{project}/zones/{zone}/disks/{resource}/setLabels",
- // "httpMethod": "POST",
- // "id": "compute.disks.setLabels",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/disks/{resource}/setLabels",
- // "request": {
- // "$ref": "ZoneSetLabelsRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.disks.startAsyncReplication":
-
-type DisksStartAsyncReplicationCall struct {
- s *Service
- project string
- zone string
- disk string
- disksstartasyncreplicationrequest *DisksStartAsyncReplicationRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// StartAsyncReplication: Starts asynchronous replication. Must be
-// invoked on the primary disk.
-//
-// - disk: The name of the persistent disk.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *DisksService) StartAsyncReplication(project string, zone string, disk string, disksstartasyncreplicationrequest *DisksStartAsyncReplicationRequest) *DisksStartAsyncReplicationCall {
- c := &DisksStartAsyncReplicationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.disk = disk
- c.disksstartasyncreplicationrequest = disksstartasyncreplicationrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *DisksStartAsyncReplicationCall) RequestId(requestId string) *DisksStartAsyncReplicationCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *DisksStartAsyncReplicationCall) Fields(s ...googleapi.Field) *DisksStartAsyncReplicationCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *DisksStartAsyncReplicationCall) Context(ctx context.Context) *DisksStartAsyncReplicationCall {
- 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 *DisksStartAsyncReplicationCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *DisksStartAsyncReplicationCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksstartasyncreplicationrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks/{disk}/startAsyncReplication")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "disk": c.disk,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.disks.startAsyncReplication" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *DisksStartAsyncReplicationCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Starts asynchronous replication. Must be invoked on the primary disk.",
- // "flatPath": "projects/{project}/zones/{zone}/disks/{disk}/startAsyncReplication",
- // "httpMethod": "POST",
- // "id": "compute.disks.startAsyncReplication",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "disk"
- // ],
- // "parameters": {
- // "disk": {
- // "description": "The name of the persistent disk.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/disks/{disk}/startAsyncReplication",
- // "request": {
- // "$ref": "DisksStartAsyncReplicationRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.disks.stopAsyncReplication":
-
-type DisksStopAsyncReplicationCall struct {
- s *Service
- project string
- zone string
- disk string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// StopAsyncReplication: Stops asynchronous replication. Can be invoked
-// either on the primary or on the secondary disk.
-//
-// - disk: The name of the persistent disk.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *DisksService) StopAsyncReplication(project string, zone string, disk string) *DisksStopAsyncReplicationCall {
- c := &DisksStopAsyncReplicationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.disk = disk
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *DisksStopAsyncReplicationCall) RequestId(requestId string) *DisksStopAsyncReplicationCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *DisksStopAsyncReplicationCall) Fields(s ...googleapi.Field) *DisksStopAsyncReplicationCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *DisksStopAsyncReplicationCall) Context(ctx context.Context) *DisksStopAsyncReplicationCall {
- 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 *DisksStopAsyncReplicationCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *DisksStopAsyncReplicationCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks/{disk}/stopAsyncReplication")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "disk": c.disk,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.disks.stopAsyncReplication" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *DisksStopAsyncReplicationCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Stops asynchronous replication. Can be invoked either on the primary or on the secondary disk.",
- // "flatPath": "projects/{project}/zones/{zone}/disks/{disk}/stopAsyncReplication",
- // "httpMethod": "POST",
- // "id": "compute.disks.stopAsyncReplication",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "disk"
- // ],
- // "parameters": {
- // "disk": {
- // "description": "The name of the persistent disk.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/disks/{disk}/stopAsyncReplication",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.disks.stopGroupAsyncReplication":
-
-type DisksStopGroupAsyncReplicationCall struct {
- s *Service
- project string
- zone string
- disksstopgroupasyncreplicationresource *DisksStopGroupAsyncReplicationResource
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// StopGroupAsyncReplication: Stops asynchronous replication for a
-// consistency group of disks. Can be invoked either in the primary or
-// secondary scope.
-//
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request. This must be the zone
-// of the primary or secondary disks in the consistency group.
-func (r *DisksService) StopGroupAsyncReplication(project string, zone string, disksstopgroupasyncreplicationresource *DisksStopGroupAsyncReplicationResource) *DisksStopGroupAsyncReplicationCall {
- c := &DisksStopGroupAsyncReplicationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.disksstopgroupasyncreplicationresource = disksstopgroupasyncreplicationresource
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *DisksStopGroupAsyncReplicationCall) RequestId(requestId string) *DisksStopGroupAsyncReplicationCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *DisksStopGroupAsyncReplicationCall) Fields(s ...googleapi.Field) *DisksStopGroupAsyncReplicationCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *DisksStopGroupAsyncReplicationCall) Context(ctx context.Context) *DisksStopGroupAsyncReplicationCall {
- 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 *DisksStopGroupAsyncReplicationCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *DisksStopGroupAsyncReplicationCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksstopgroupasyncreplicationresource)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks/stopGroupAsyncReplication")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.disks.stopGroupAsyncReplication" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *DisksStopGroupAsyncReplicationCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Stops asynchronous replication for a consistency group of disks. Can be invoked either in the primary or secondary scope.",
- // "flatPath": "projects/{project}/zones/{zone}/disks/stopGroupAsyncReplication",
- // "httpMethod": "POST",
- // "id": "compute.disks.stopGroupAsyncReplication",
- // "parameterOrder": [
- // "project",
- // "zone"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request. This must be the zone of the primary or secondary disks in the consistency group.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/disks/stopGroupAsyncReplication",
- // "request": {
- // "$ref": "DisksStopGroupAsyncReplicationResource"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.disks.testIamPermissions":
-
-type DisksTestIamPermissionsCall struct {
- s *Service
- project string
- zone string
- resource string
- testpermissionsrequest *TestPermissionsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// TestIamPermissions: Returns permissions that a caller has on the
-// specified resource.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-// - zone: The name of the zone for this request.
-func (r *DisksService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *DisksTestIamPermissionsCall {
- c := &DisksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.resource = resource
- c.testpermissionsrequest = testpermissionsrequest
- 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 *DisksTestIamPermissionsCall) Fields(s ...googleapi.Field) *DisksTestIamPermissionsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *DisksTestIamPermissionsCall) Context(ctx context.Context) *DisksTestIamPermissionsCall {
- 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 *DisksTestIamPermissionsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *DisksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks/{resource}/testIamPermissions")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.disks.testIamPermissions" call.
-// Exactly one of *TestPermissionsResponse or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *TestPermissionsResponse.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 *DisksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TestPermissionsResponse{
- 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": "Returns permissions that a caller has on the specified resource.",
- // "flatPath": "projects/{project}/zones/{zone}/disks/{resource}/testIamPermissions",
- // "httpMethod": "POST",
- // "id": "compute.disks.testIamPermissions",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/disks/{resource}/testIamPermissions",
- // "request": {
- // "$ref": "TestPermissionsRequest"
- // },
- // "response": {
- // "$ref": "TestPermissionsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.disks.update":
-
-type DisksUpdateCall struct {
- s *Service
- project string
- zone string
- disk string
- disk2 *Disk
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Update: Updates the specified disk with the data included in the
-// request. The update is performed only on selected fields included as
-// part of update-mask. Only the following fields can be modified:
-// user_license.
-//
-// - disk: The disk name for this request.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *DisksService) Update(project string, zone string, disk string, disk2 *Disk) *DisksUpdateCall {
- c := &DisksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.disk = disk
- c.disk2 = disk2
- return c
-}
-
-// Paths sets the optional parameter "paths":
-func (c *DisksUpdateCall) Paths(paths ...string) *DisksUpdateCall {
- c.urlParams_.SetMulti("paths", append([]string{}, paths...))
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *DisksUpdateCall) RequestId(requestId string) *DisksUpdateCall {
- c.urlParams_.Set("requestId", requestId)
- return c
-}
-
-// UpdateMask sets the optional parameter "updateMask": update_mask
-// indicates fields to be updated as part of this request.
-func (c *DisksUpdateCall) UpdateMask(updateMask string) *DisksUpdateCall {
- c.urlParams_.Set("updateMask", updateMask)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *DisksUpdateCall) Fields(s ...googleapi.Field) *DisksUpdateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *DisksUpdateCall) Context(ctx context.Context) *DisksUpdateCall {
- 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 *DisksUpdateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *DisksUpdateCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk2)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks/{disk}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "disk": c.disk,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.disks.update" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *DisksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Updates the specified disk with the data included in the request. The update is performed only on selected fields included as part of update-mask. Only the following fields can be modified: user_license.",
- // "flatPath": "projects/{project}/zones/{zone}/disks/{disk}",
- // "httpMethod": "PATCH",
- // "id": "compute.disks.update",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "disk"
- // ],
- // "parameters": {
- // "disk": {
- // "description": "The disk name for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "paths": {
- // "location": "query",
- // "repeated": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "updateMask": {
- // "description": "update_mask indicates fields to be updated as part of this request.",
- // "format": "google-fieldmask",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/disks/{disk}",
- // "request": {
- // "$ref": "Disk"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.externalVpnGateways.delete":
-
-type ExternalVpnGatewaysDeleteCall struct {
- s *Service
- project string
- externalVpnGateway string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified externalVpnGateway.
-//
-// - externalVpnGateway: Name of the externalVpnGateways to delete.
-// - project: Project ID for this request.
-func (r *ExternalVpnGatewaysService) Delete(project string, externalVpnGateway string) *ExternalVpnGatewaysDeleteCall {
- c := &ExternalVpnGatewaysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.externalVpnGateway = externalVpnGateway
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *ExternalVpnGatewaysDeleteCall) RequestId(requestId string) *ExternalVpnGatewaysDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *ExternalVpnGatewaysDeleteCall) Fields(s ...googleapi.Field) *ExternalVpnGatewaysDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ExternalVpnGatewaysDeleteCall) Context(ctx context.Context) *ExternalVpnGatewaysDeleteCall {
- 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 *ExternalVpnGatewaysDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ExternalVpnGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/externalVpnGateways/{externalVpnGateway}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "externalVpnGateway": c.externalVpnGateway,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.externalVpnGateways.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *ExternalVpnGatewaysDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified externalVpnGateway.",
- // "flatPath": "projects/{project}/global/externalVpnGateways/{externalVpnGateway}",
- // "httpMethod": "DELETE",
- // "id": "compute.externalVpnGateways.delete",
- // "parameterOrder": [
- // "project",
- // "externalVpnGateway"
- // ],
- // "parameters": {
- // "externalVpnGateway": {
- // "description": "Name of the externalVpnGateways to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/externalVpnGateways/{externalVpnGateway}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.externalVpnGateways.get":
-
-type ExternalVpnGatewaysGetCall struct {
- s *Service
- project string
- externalVpnGateway string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified externalVpnGateway. Get a list of
-// available externalVpnGateways by making a list() request.
-//
-// - externalVpnGateway: Name of the externalVpnGateway to return.
-// - project: Project ID for this request.
-func (r *ExternalVpnGatewaysService) Get(project string, externalVpnGateway string) *ExternalVpnGatewaysGetCall {
- c := &ExternalVpnGatewaysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.externalVpnGateway = externalVpnGateway
- 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 *ExternalVpnGatewaysGetCall) Fields(s ...googleapi.Field) *ExternalVpnGatewaysGetCall {
- 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 *ExternalVpnGatewaysGetCall) IfNoneMatch(entityTag string) *ExternalVpnGatewaysGetCall {
- 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 *ExternalVpnGatewaysGetCall) Context(ctx context.Context) *ExternalVpnGatewaysGetCall {
- 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 *ExternalVpnGatewaysGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ExternalVpnGatewaysGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/externalVpnGateways/{externalVpnGateway}")
- 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{
- "project": c.project,
- "externalVpnGateway": c.externalVpnGateway,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.externalVpnGateways.get" call.
-// Exactly one of *ExternalVpnGateway or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *ExternalVpnGateway.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 *ExternalVpnGatewaysGetCall) Do(opts ...googleapi.CallOption) (*ExternalVpnGateway, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &ExternalVpnGateway{
- 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": "Returns the specified externalVpnGateway. Get a list of available externalVpnGateways by making a list() request.",
- // "flatPath": "projects/{project}/global/externalVpnGateways/{externalVpnGateway}",
- // "httpMethod": "GET",
- // "id": "compute.externalVpnGateways.get",
- // "parameterOrder": [
- // "project",
- // "externalVpnGateway"
- // ],
- // "parameters": {
- // "externalVpnGateway": {
- // "description": "Name of the externalVpnGateway to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/externalVpnGateways/{externalVpnGateway}",
- // "response": {
- // "$ref": "ExternalVpnGateway"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.externalVpnGateways.insert":
-
-type ExternalVpnGatewaysInsertCall struct {
- s *Service
- project string
- externalvpngateway *ExternalVpnGateway
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a ExternalVpnGateway in the specified project using
-// the data included in the request.
-//
-// - project: Project ID for this request.
-func (r *ExternalVpnGatewaysService) Insert(project string, externalvpngateway *ExternalVpnGateway) *ExternalVpnGatewaysInsertCall {
- c := &ExternalVpnGatewaysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.externalvpngateway = externalvpngateway
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *ExternalVpnGatewaysInsertCall) RequestId(requestId string) *ExternalVpnGatewaysInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *ExternalVpnGatewaysInsertCall) Fields(s ...googleapi.Field) *ExternalVpnGatewaysInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ExternalVpnGatewaysInsertCall) Context(ctx context.Context) *ExternalVpnGatewaysInsertCall {
- 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 *ExternalVpnGatewaysInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ExternalVpnGatewaysInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.externalvpngateway)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/externalVpnGateways")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.externalVpnGateways.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *ExternalVpnGatewaysInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a ExternalVpnGateway in the specified project using the data included in the request.",
- // "flatPath": "projects/{project}/global/externalVpnGateways",
- // "httpMethod": "POST",
- // "id": "compute.externalVpnGateways.insert",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/externalVpnGateways",
- // "request": {
- // "$ref": "ExternalVpnGateway"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.externalVpnGateways.list":
-
-type ExternalVpnGatewaysListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves the list of ExternalVpnGateway available to the
-// specified project.
-//
-// - project: Project ID for this request.
-func (r *ExternalVpnGatewaysService) List(project string) *ExternalVpnGatewaysListCall {
- c := &ExternalVpnGatewaysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *ExternalVpnGatewaysListCall) Filter(filter string) *ExternalVpnGatewaysListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *ExternalVpnGatewaysListCall) MaxResults(maxResults int64) *ExternalVpnGatewaysListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *ExternalVpnGatewaysListCall) OrderBy(orderBy string) *ExternalVpnGatewaysListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *ExternalVpnGatewaysListCall) PageToken(pageToken string) *ExternalVpnGatewaysListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *ExternalVpnGatewaysListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ExternalVpnGatewaysListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *ExternalVpnGatewaysListCall) Fields(s ...googleapi.Field) *ExternalVpnGatewaysListCall {
- 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 *ExternalVpnGatewaysListCall) IfNoneMatch(entityTag string) *ExternalVpnGatewaysListCall {
- 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 *ExternalVpnGatewaysListCall) Context(ctx context.Context) *ExternalVpnGatewaysListCall {
- 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 *ExternalVpnGatewaysListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ExternalVpnGatewaysListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/externalVpnGateways")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.externalVpnGateways.list" call.
-// Exactly one of *ExternalVpnGatewayList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *ExternalVpnGatewayList.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 *ExternalVpnGatewaysListCall) Do(opts ...googleapi.CallOption) (*ExternalVpnGatewayList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &ExternalVpnGatewayList{
- 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": "Retrieves the list of ExternalVpnGateway available to the specified project.",
- // "flatPath": "projects/{project}/global/externalVpnGateways",
- // "httpMethod": "GET",
- // "id": "compute.externalVpnGateways.list",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/externalVpnGateways",
- // "response": {
- // "$ref": "ExternalVpnGatewayList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *ExternalVpnGatewaysListCall) Pages(ctx context.Context, f func(*ExternalVpnGatewayList) 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 "compute.externalVpnGateways.setLabels":
-
-type ExternalVpnGatewaysSetLabelsCall struct {
- s *Service
- project string
- resource string
- globalsetlabelsrequest *GlobalSetLabelsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetLabels: Sets the labels on an ExternalVpnGateway. To learn more
-// about labels, read the Labeling Resources documentation.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-func (r *ExternalVpnGatewaysService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *ExternalVpnGatewaysSetLabelsCall {
- c := &ExternalVpnGatewaysSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.resource = resource
- c.globalsetlabelsrequest = globalsetlabelsrequest
- 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 *ExternalVpnGatewaysSetLabelsCall) Fields(s ...googleapi.Field) *ExternalVpnGatewaysSetLabelsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ExternalVpnGatewaysSetLabelsCall) Context(ctx context.Context) *ExternalVpnGatewaysSetLabelsCall {
- 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 *ExternalVpnGatewaysSetLabelsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ExternalVpnGatewaysSetLabelsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/externalVpnGateways/{resource}/setLabels")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.externalVpnGateways.setLabels" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *ExternalVpnGatewaysSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Sets the labels on an ExternalVpnGateway. To learn more about labels, read the Labeling Resources documentation.",
- // "flatPath": "projects/{project}/global/externalVpnGateways/{resource}/setLabels",
- // "httpMethod": "POST",
- // "id": "compute.externalVpnGateways.setLabels",
- // "parameterOrder": [
- // "project",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/externalVpnGateways/{resource}/setLabels",
- // "request": {
- // "$ref": "GlobalSetLabelsRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.externalVpnGateways.testIamPermissions":
-
-type ExternalVpnGatewaysTestIamPermissionsCall struct {
- s *Service
- project string
- resource string
- testpermissionsrequest *TestPermissionsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// TestIamPermissions: Returns permissions that a caller has on the
-// specified resource.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-func (r *ExternalVpnGatewaysService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *ExternalVpnGatewaysTestIamPermissionsCall {
- c := &ExternalVpnGatewaysTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.resource = resource
- c.testpermissionsrequest = testpermissionsrequest
- 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 *ExternalVpnGatewaysTestIamPermissionsCall) Fields(s ...googleapi.Field) *ExternalVpnGatewaysTestIamPermissionsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ExternalVpnGatewaysTestIamPermissionsCall) Context(ctx context.Context) *ExternalVpnGatewaysTestIamPermissionsCall {
- 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 *ExternalVpnGatewaysTestIamPermissionsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ExternalVpnGatewaysTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/externalVpnGateways/{resource}/testIamPermissions")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.externalVpnGateways.testIamPermissions" call.
-// Exactly one of *TestPermissionsResponse or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *TestPermissionsResponse.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 *ExternalVpnGatewaysTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TestPermissionsResponse{
- 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": "Returns permissions that a caller has on the specified resource.",
- // "flatPath": "projects/{project}/global/externalVpnGateways/{resource}/testIamPermissions",
- // "httpMethod": "POST",
- // "id": "compute.externalVpnGateways.testIamPermissions",
- // "parameterOrder": [
- // "project",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/externalVpnGateways/{resource}/testIamPermissions",
- // "request": {
- // "$ref": "TestPermissionsRequest"
- // },
- // "response": {
- // "$ref": "TestPermissionsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.firewallPolicies.addAssociation":
-
-type FirewallPoliciesAddAssociationCall struct {
- s *Service
- firewallPolicy string
- firewallpolicyassociation *FirewallPolicyAssociation
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// AddAssociation: Inserts an association for the specified firewall
-// policy.
-//
-// - firewallPolicy: Name of the firewall policy to update.
-func (r *FirewallPoliciesService) AddAssociation(firewallPolicy string, firewallpolicyassociation *FirewallPolicyAssociation) *FirewallPoliciesAddAssociationCall {
- c := &FirewallPoliciesAddAssociationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.firewallPolicy = firewallPolicy
- c.firewallpolicyassociation = firewallpolicyassociation
- return c
-}
-
-// ReplaceExistingAssociation sets the optional parameter
-// "replaceExistingAssociation": Indicates whether or not to replace it
-// if an association of the attachment already exists. This is false by
-// default, in which case an error will be returned if an association
-// already exists.
-func (c *FirewallPoliciesAddAssociationCall) ReplaceExistingAssociation(replaceExistingAssociation bool) *FirewallPoliciesAddAssociationCall {
- c.urlParams_.Set("replaceExistingAssociation", fmt.Sprint(replaceExistingAssociation))
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *FirewallPoliciesAddAssociationCall) RequestId(requestId string) *FirewallPoliciesAddAssociationCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *FirewallPoliciesAddAssociationCall) Fields(s ...googleapi.Field) *FirewallPoliciesAddAssociationCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *FirewallPoliciesAddAssociationCall) Context(ctx context.Context) *FirewallPoliciesAddAssociationCall {
- 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 *FirewallPoliciesAddAssociationCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *FirewallPoliciesAddAssociationCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyassociation)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}/addAssociation")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "firewallPolicy": c.firewallPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.firewallPolicies.addAssociation" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *FirewallPoliciesAddAssociationCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Inserts an association for the specified firewall policy.",
- // "flatPath": "locations/global/firewallPolicies/{firewallPolicy}/addAssociation",
- // "httpMethod": "POST",
- // "id": "compute.firewallPolicies.addAssociation",
- // "parameterOrder": [
- // "firewallPolicy"
- // ],
- // "parameters": {
- // "firewallPolicy": {
- // "description": "Name of the firewall policy to update.",
- // "location": "path",
- // "pattern": "(firewallPolicies/)?[0-9]{0,20}",
- // "required": true,
- // "type": "string"
- // },
- // "replaceExistingAssociation": {
- // "description": "Indicates whether or not to replace it if an association of the attachment already exists. This is false by default, in which case an error will be returned if an association already exists.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "locations/global/firewallPolicies/{firewallPolicy}/addAssociation",
- // "request": {
- // "$ref": "FirewallPolicyAssociation"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.firewallPolicies.addRule":
-
-type FirewallPoliciesAddRuleCall struct {
- s *Service
- firewallPolicy string
- firewallpolicyrule *FirewallPolicyRule
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// AddRule: Inserts a rule into a firewall policy.
-//
-// - firewallPolicy: Name of the firewall policy to update.
-func (r *FirewallPoliciesService) AddRule(firewallPolicy string, firewallpolicyrule *FirewallPolicyRule) *FirewallPoliciesAddRuleCall {
- c := &FirewallPoliciesAddRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.firewallPolicy = firewallPolicy
- c.firewallpolicyrule = firewallpolicyrule
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *FirewallPoliciesAddRuleCall) RequestId(requestId string) *FirewallPoliciesAddRuleCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *FirewallPoliciesAddRuleCall) Fields(s ...googleapi.Field) *FirewallPoliciesAddRuleCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *FirewallPoliciesAddRuleCall) Context(ctx context.Context) *FirewallPoliciesAddRuleCall {
- 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 *FirewallPoliciesAddRuleCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *FirewallPoliciesAddRuleCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyrule)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}/addRule")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "firewallPolicy": c.firewallPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.firewallPolicies.addRule" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *FirewallPoliciesAddRuleCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Inserts a rule into a firewall policy.",
- // "flatPath": "locations/global/firewallPolicies/{firewallPolicy}/addRule",
- // "httpMethod": "POST",
- // "id": "compute.firewallPolicies.addRule",
- // "parameterOrder": [
- // "firewallPolicy"
- // ],
- // "parameters": {
- // "firewallPolicy": {
- // "description": "Name of the firewall policy to update.",
- // "location": "path",
- // "pattern": "(firewallPolicies/)?[0-9]{0,20}",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "locations/global/firewallPolicies/{firewallPolicy}/addRule",
- // "request": {
- // "$ref": "FirewallPolicyRule"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.firewallPolicies.cloneRules":
-
-type FirewallPoliciesCloneRulesCall struct {
- s *Service
- firewallPolicy string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// CloneRules: Copies rules to the specified firewall policy.
-//
-// - firewallPolicy: Name of the firewall policy to update.
-func (r *FirewallPoliciesService) CloneRules(firewallPolicy string) *FirewallPoliciesCloneRulesCall {
- c := &FirewallPoliciesCloneRulesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.firewallPolicy = firewallPolicy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *FirewallPoliciesCloneRulesCall) RequestId(requestId string) *FirewallPoliciesCloneRulesCall {
- c.urlParams_.Set("requestId", requestId)
- return c
-}
-
-// SourceFirewallPolicy sets the optional parameter
-// "sourceFirewallPolicy": The firewall policy from which to copy rules.
-func (c *FirewallPoliciesCloneRulesCall) SourceFirewallPolicy(sourceFirewallPolicy string) *FirewallPoliciesCloneRulesCall {
- c.urlParams_.Set("sourceFirewallPolicy", sourceFirewallPolicy)
- 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 *FirewallPoliciesCloneRulesCall) Fields(s ...googleapi.Field) *FirewallPoliciesCloneRulesCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *FirewallPoliciesCloneRulesCall) Context(ctx context.Context) *FirewallPoliciesCloneRulesCall {
- 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 *FirewallPoliciesCloneRulesCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *FirewallPoliciesCloneRulesCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}/cloneRules")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "firewallPolicy": c.firewallPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.firewallPolicies.cloneRules" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *FirewallPoliciesCloneRulesCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Copies rules to the specified firewall policy.",
- // "flatPath": "locations/global/firewallPolicies/{firewallPolicy}/cloneRules",
- // "httpMethod": "POST",
- // "id": "compute.firewallPolicies.cloneRules",
- // "parameterOrder": [
- // "firewallPolicy"
- // ],
- // "parameters": {
- // "firewallPolicy": {
- // "description": "Name of the firewall policy to update.",
- // "location": "path",
- // "pattern": "(firewallPolicies/)?[0-9]{0,20}",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "sourceFirewallPolicy": {
- // "description": "The firewall policy from which to copy rules.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "locations/global/firewallPolicies/{firewallPolicy}/cloneRules",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.firewallPolicies.delete":
-
-type FirewallPoliciesDeleteCall struct {
- s *Service
- firewallPolicy string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified policy.
-//
-// - firewallPolicy: Name of the firewall policy to delete.
-func (r *FirewallPoliciesService) Delete(firewallPolicy string) *FirewallPoliciesDeleteCall {
- c := &FirewallPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.firewallPolicy = firewallPolicy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *FirewallPoliciesDeleteCall) RequestId(requestId string) *FirewallPoliciesDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *FirewallPoliciesDeleteCall) Fields(s ...googleapi.Field) *FirewallPoliciesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *FirewallPoliciesDeleteCall) Context(ctx context.Context) *FirewallPoliciesDeleteCall {
- 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 *FirewallPoliciesDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *FirewallPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "firewallPolicy": c.firewallPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.firewallPolicies.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *FirewallPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified policy.",
- // "flatPath": "locations/global/firewallPolicies/{firewallPolicy}",
- // "httpMethod": "DELETE",
- // "id": "compute.firewallPolicies.delete",
- // "parameterOrder": [
- // "firewallPolicy"
- // ],
- // "parameters": {
- // "firewallPolicy": {
- // "description": "Name of the firewall policy to delete.",
- // "location": "path",
- // "pattern": "(firewallPolicies/)?[0-9]{0,20}",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "locations/global/firewallPolicies/{firewallPolicy}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.firewallPolicies.get":
-
-type FirewallPoliciesGetCall struct {
- s *Service
- firewallPolicy string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified firewall policy.
-//
-// - firewallPolicy: Name of the firewall policy to get.
-func (r *FirewallPoliciesService) Get(firewallPolicy string) *FirewallPoliciesGetCall {
- c := &FirewallPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.firewallPolicy = firewallPolicy
- 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 *FirewallPoliciesGetCall) Fields(s ...googleapi.Field) *FirewallPoliciesGetCall {
- 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 *FirewallPoliciesGetCall) IfNoneMatch(entityTag string) *FirewallPoliciesGetCall {
- 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 *FirewallPoliciesGetCall) Context(ctx context.Context) *FirewallPoliciesGetCall {
- 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 *FirewallPoliciesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *FirewallPoliciesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "locations/global/firewallPolicies/{firewallPolicy}")
- 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{
- "firewallPolicy": c.firewallPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.firewallPolicies.get" call.
-// Exactly one of *FirewallPolicy or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *FirewallPolicy.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 *FirewallPoliciesGetCall) Do(opts ...googleapi.CallOption) (*FirewallPolicy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &FirewallPolicy{
- 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": "Returns the specified firewall policy.",
- // "flatPath": "locations/global/firewallPolicies/{firewallPolicy}",
- // "httpMethod": "GET",
- // "id": "compute.firewallPolicies.get",
- // "parameterOrder": [
- // "firewallPolicy"
- // ],
- // "parameters": {
- // "firewallPolicy": {
- // "description": "Name of the firewall policy to get.",
- // "location": "path",
- // "pattern": "(firewallPolicies/)?[0-9]{0,20}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "locations/global/firewallPolicies/{firewallPolicy}",
- // "response": {
- // "$ref": "FirewallPolicy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.firewallPolicies.getAssociation":
-
-type FirewallPoliciesGetAssociationCall struct {
- s *Service
- firewallPolicy string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetAssociation: Gets an association with the specified name.
-//
-// - firewallPolicy: Name of the firewall policy to which the queried
-// rule belongs.
-func (r *FirewallPoliciesService) GetAssociation(firewallPolicy string) *FirewallPoliciesGetAssociationCall {
- c := &FirewallPoliciesGetAssociationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.firewallPolicy = firewallPolicy
- return c
-}
-
-// Name sets the optional parameter "name": The name of the association
-// to get from the firewall policy.
-func (c *FirewallPoliciesGetAssociationCall) Name(name string) *FirewallPoliciesGetAssociationCall {
- c.urlParams_.Set("name", name)
- 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 *FirewallPoliciesGetAssociationCall) Fields(s ...googleapi.Field) *FirewallPoliciesGetAssociationCall {
- 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 *FirewallPoliciesGetAssociationCall) IfNoneMatch(entityTag string) *FirewallPoliciesGetAssociationCall {
- 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 *FirewallPoliciesGetAssociationCall) Context(ctx context.Context) *FirewallPoliciesGetAssociationCall {
- 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 *FirewallPoliciesGetAssociationCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *FirewallPoliciesGetAssociationCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "locations/global/firewallPolicies/{firewallPolicy}/getAssociation")
- 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{
- "firewallPolicy": c.firewallPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.firewallPolicies.getAssociation" call.
-// Exactly one of *FirewallPolicyAssociation or error will be non-nil.
-// Any non-2xx status code is an error. Response headers are in either
-// *FirewallPolicyAssociation.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 *FirewallPoliciesGetAssociationCall) Do(opts ...googleapi.CallOption) (*FirewallPolicyAssociation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &FirewallPolicyAssociation{
- 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": "Gets an association with the specified name.",
- // "flatPath": "locations/global/firewallPolicies/{firewallPolicy}/getAssociation",
- // "httpMethod": "GET",
- // "id": "compute.firewallPolicies.getAssociation",
- // "parameterOrder": [
- // "firewallPolicy"
- // ],
- // "parameters": {
- // "firewallPolicy": {
- // "description": "Name of the firewall policy to which the queried rule belongs.",
- // "location": "path",
- // "pattern": "(firewallPolicies/)?[0-9]{0,20}",
- // "required": true,
- // "type": "string"
- // },
- // "name": {
- // "description": "The name of the association to get from the firewall policy.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "locations/global/firewallPolicies/{firewallPolicy}/getAssociation",
- // "response": {
- // "$ref": "FirewallPolicyAssociation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.firewallPolicies.getIamPolicy":
-
-type FirewallPoliciesGetIamPolicyCall struct {
- s *Service
- resource string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetIamPolicy: Gets the access control policy for a resource. May be
-// empty if no such policy or resource exists.
-//
-// - resource: Name or id of the resource for this request.
-func (r *FirewallPoliciesService) GetIamPolicy(resource string) *FirewallPoliciesGetIamPolicyCall {
- c := &FirewallPoliciesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.resource = resource
- return c
-}
-
-// OptionsRequestedPolicyVersion sets the optional parameter
-// "optionsRequestedPolicyVersion": Requested IAM Policy version.
-func (c *FirewallPoliciesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *FirewallPoliciesGetIamPolicyCall {
- c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
- 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 *FirewallPoliciesGetIamPolicyCall) Fields(s ...googleapi.Field) *FirewallPoliciesGetIamPolicyCall {
- 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 *FirewallPoliciesGetIamPolicyCall) IfNoneMatch(entityTag string) *FirewallPoliciesGetIamPolicyCall {
- 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 *FirewallPoliciesGetIamPolicyCall) Context(ctx context.Context) *FirewallPoliciesGetIamPolicyCall {
- 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 *FirewallPoliciesGetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *FirewallPoliciesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "locations/global/firewallPolicies/{resource}/getIamPolicy")
- 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{
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.firewallPolicies.getIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *FirewallPoliciesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
- // "flatPath": "locations/global/firewallPolicies/{resource}/getIamPolicy",
- // "httpMethod": "GET",
- // "id": "compute.firewallPolicies.getIamPolicy",
- // "parameterOrder": [
- // "resource"
- // ],
- // "parameters": {
- // "optionsRequestedPolicyVersion": {
- // "description": "Requested IAM Policy version.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "(firewallPolicies/)?[0-9]{0,20}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "locations/global/firewallPolicies/{resource}/getIamPolicy",
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.firewallPolicies.getRule":
-
-type FirewallPoliciesGetRuleCall struct {
- s *Service
- firewallPolicy string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetRule: Gets a rule of the specified priority.
-//
-// - firewallPolicy: Name of the firewall policy to which the queried
-// rule belongs.
-func (r *FirewallPoliciesService) GetRule(firewallPolicy string) *FirewallPoliciesGetRuleCall {
- c := &FirewallPoliciesGetRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.firewallPolicy = firewallPolicy
- return c
-}
-
-// Priority sets the optional parameter "priority": The priority of the
-// rule to get from the firewall policy.
-func (c *FirewallPoliciesGetRuleCall) Priority(priority int64) *FirewallPoliciesGetRuleCall {
- c.urlParams_.Set("priority", fmt.Sprint(priority))
- 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 *FirewallPoliciesGetRuleCall) Fields(s ...googleapi.Field) *FirewallPoliciesGetRuleCall {
- 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 *FirewallPoliciesGetRuleCall) IfNoneMatch(entityTag string) *FirewallPoliciesGetRuleCall {
- 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 *FirewallPoliciesGetRuleCall) Context(ctx context.Context) *FirewallPoliciesGetRuleCall {
- 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 *FirewallPoliciesGetRuleCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *FirewallPoliciesGetRuleCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "locations/global/firewallPolicies/{firewallPolicy}/getRule")
- 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{
- "firewallPolicy": c.firewallPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.firewallPolicies.getRule" call.
-// Exactly one of *FirewallPolicyRule or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *FirewallPolicyRule.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 *FirewallPoliciesGetRuleCall) Do(opts ...googleapi.CallOption) (*FirewallPolicyRule, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &FirewallPolicyRule{
- 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": "Gets a rule of the specified priority.",
- // "flatPath": "locations/global/firewallPolicies/{firewallPolicy}/getRule",
- // "httpMethod": "GET",
- // "id": "compute.firewallPolicies.getRule",
- // "parameterOrder": [
- // "firewallPolicy"
- // ],
- // "parameters": {
- // "firewallPolicy": {
- // "description": "Name of the firewall policy to which the queried rule belongs.",
- // "location": "path",
- // "pattern": "(firewallPolicies/)?[0-9]{0,20}",
- // "required": true,
- // "type": "string"
- // },
- // "priority": {
- // "description": "The priority of the rule to get from the firewall policy.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // }
- // },
- // "path": "locations/global/firewallPolicies/{firewallPolicy}/getRule",
- // "response": {
- // "$ref": "FirewallPolicyRule"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.firewallPolicies.insert":
-
-type FirewallPoliciesInsertCall struct {
- s *Service
- firewallpolicy *FirewallPolicy
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a new policy in the specified project using the data
-// included in the request.
-func (r *FirewallPoliciesService) Insert(firewallpolicy *FirewallPolicy) *FirewallPoliciesInsertCall {
- c := &FirewallPoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.firewallpolicy = firewallpolicy
- return c
-}
-
-// ParentId sets the optional parameter "parentId": Parent ID for this
-// request. The ID can be either be "folders/[FOLDER_ID]" if the parent
-// is a folder or "organizations/[ORGANIZATION_ID]" if the parent is an
-// organization.
-func (c *FirewallPoliciesInsertCall) ParentId(parentId string) *FirewallPoliciesInsertCall {
- c.urlParams_.Set("parentId", parentId)
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *FirewallPoliciesInsertCall) RequestId(requestId string) *FirewallPoliciesInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *FirewallPoliciesInsertCall) Fields(s ...googleapi.Field) *FirewallPoliciesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *FirewallPoliciesInsertCall) Context(ctx context.Context) *FirewallPoliciesInsertCall {
- 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 *FirewallPoliciesInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *FirewallPoliciesInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicy)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.firewallPolicies.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *FirewallPoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a new policy in the specified project using the data included in the request.",
- // "flatPath": "locations/global/firewallPolicies",
- // "httpMethod": "POST",
- // "id": "compute.firewallPolicies.insert",
- // "parameters": {
- // "parentId": {
- // "description": "Parent ID for this request. The ID can be either be \"folders/[FOLDER_ID]\" if the parent is a folder or \"organizations/[ORGANIZATION_ID]\" if the parent is an organization.",
- // "location": "query",
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "locations/global/firewallPolicies",
- // "request": {
- // "$ref": "FirewallPolicy"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.firewallPolicies.list":
-
-type FirewallPoliciesListCall struct {
- s *Service
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Lists all the policies that have been configured for the
-// specified folder or organization.
-func (r *FirewallPoliciesService) List() *FirewallPoliciesListCall {
- c := &FirewallPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *FirewallPoliciesListCall) Filter(filter string) *FirewallPoliciesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *FirewallPoliciesListCall) MaxResults(maxResults int64) *FirewallPoliciesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *FirewallPoliciesListCall) OrderBy(orderBy string) *FirewallPoliciesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *FirewallPoliciesListCall) PageToken(pageToken string) *FirewallPoliciesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ParentId sets the optional parameter "parentId": Parent ID for this
-// request. The ID can be either be "folders/[FOLDER_ID]" if the parent
-// is a folder or "organizations/[ORGANIZATION_ID]" if the parent is an
-// organization.
-func (c *FirewallPoliciesListCall) ParentId(parentId string) *FirewallPoliciesListCall {
- c.urlParams_.Set("parentId", parentId)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *FirewallPoliciesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *FirewallPoliciesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *FirewallPoliciesListCall) Fields(s ...googleapi.Field) *FirewallPoliciesListCall {
- 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 *FirewallPoliciesListCall) IfNoneMatch(entityTag string) *FirewallPoliciesListCall {
- 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 *FirewallPoliciesListCall) Context(ctx context.Context) *FirewallPoliciesListCall {
- 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 *FirewallPoliciesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *FirewallPoliciesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "locations/global/firewallPolicies")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("GET", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.firewallPolicies.list" call.
-// Exactly one of *FirewallPolicyList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *FirewallPolicyList.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 *FirewallPoliciesListCall) Do(opts ...googleapi.CallOption) (*FirewallPolicyList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &FirewallPolicyList{
- 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": "Lists all the policies that have been configured for the specified folder or organization.",
- // "flatPath": "locations/global/firewallPolicies",
- // "httpMethod": "GET",
- // "id": "compute.firewallPolicies.list",
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "parentId": {
- // "description": "Parent ID for this request. The ID can be either be \"folders/[FOLDER_ID]\" if the parent is a folder or \"organizations/[ORGANIZATION_ID]\" if the parent is an organization.",
- // "location": "query",
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "locations/global/firewallPolicies",
- // "response": {
- // "$ref": "FirewallPolicyList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *FirewallPoliciesListCall) Pages(ctx context.Context, f func(*FirewallPolicyList) 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 "compute.firewallPolicies.listAssociations":
-
-type FirewallPoliciesListAssociationsCall struct {
- s *Service
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// ListAssociations: Lists associations of a specified target, i.e.,
-// organization or folder.
-func (r *FirewallPoliciesService) ListAssociations() *FirewallPoliciesListAssociationsCall {
- c := &FirewallPoliciesListAssociationsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- return c
-}
-
-// TargetResource sets the optional parameter "targetResource": The
-// target resource to list associations. It is an organization, or a
-// folder.
-func (c *FirewallPoliciesListAssociationsCall) TargetResource(targetResource string) *FirewallPoliciesListAssociationsCall {
- c.urlParams_.Set("targetResource", targetResource)
- 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 *FirewallPoliciesListAssociationsCall) Fields(s ...googleapi.Field) *FirewallPoliciesListAssociationsCall {
- 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 *FirewallPoliciesListAssociationsCall) IfNoneMatch(entityTag string) *FirewallPoliciesListAssociationsCall {
- 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 *FirewallPoliciesListAssociationsCall) Context(ctx context.Context) *FirewallPoliciesListAssociationsCall {
- 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 *FirewallPoliciesListAssociationsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *FirewallPoliciesListAssociationsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "locations/global/firewallPolicies/listAssociations")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("GET", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.firewallPolicies.listAssociations" call.
-// Exactly one of *FirewallPoliciesListAssociationsResponse or error
-// will be non-nil. Any non-2xx status code is an error. Response
-// headers are in either
-// *FirewallPoliciesListAssociationsResponse.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 *FirewallPoliciesListAssociationsCall) Do(opts ...googleapi.CallOption) (*FirewallPoliciesListAssociationsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &FirewallPoliciesListAssociationsResponse{
- 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": "Lists associations of a specified target, i.e., organization or folder.",
- // "flatPath": "locations/global/firewallPolicies/listAssociations",
- // "httpMethod": "GET",
- // "id": "compute.firewallPolicies.listAssociations",
- // "parameters": {
- // "targetResource": {
- // "description": "The target resource to list associations. It is an organization, or a folder.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "locations/global/firewallPolicies/listAssociations",
- // "response": {
- // "$ref": "FirewallPoliciesListAssociationsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.firewallPolicies.move":
-
-type FirewallPoliciesMoveCall struct {
- s *Service
- firewallPolicy string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Move: Moves the specified firewall policy.
-//
-// - firewallPolicy: Name of the firewall policy to update.
-func (r *FirewallPoliciesService) Move(firewallPolicy string) *FirewallPoliciesMoveCall {
- c := &FirewallPoliciesMoveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.firewallPolicy = firewallPolicy
- return c
-}
-
-// ParentId sets the optional parameter "parentId": The new parent of
-// the firewall policy. The ID can be either be "folders/[FOLDER_ID]" if
-// the parent is a folder or "organizations/[ORGANIZATION_ID]" if the
-// parent is an organization.
-func (c *FirewallPoliciesMoveCall) ParentId(parentId string) *FirewallPoliciesMoveCall {
- c.urlParams_.Set("parentId", parentId)
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *FirewallPoliciesMoveCall) RequestId(requestId string) *FirewallPoliciesMoveCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *FirewallPoliciesMoveCall) Fields(s ...googleapi.Field) *FirewallPoliciesMoveCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *FirewallPoliciesMoveCall) Context(ctx context.Context) *FirewallPoliciesMoveCall {
- 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 *FirewallPoliciesMoveCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *FirewallPoliciesMoveCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}/move")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "firewallPolicy": c.firewallPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.firewallPolicies.move" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *FirewallPoliciesMoveCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Moves the specified firewall policy.",
- // "flatPath": "locations/global/firewallPolicies/{firewallPolicy}/move",
- // "httpMethod": "POST",
- // "id": "compute.firewallPolicies.move",
- // "parameterOrder": [
- // "firewallPolicy"
- // ],
- // "parameters": {
- // "firewallPolicy": {
- // "description": "Name of the firewall policy to update.",
- // "location": "path",
- // "pattern": "(firewallPolicies/)?[0-9]{0,20}",
- // "required": true,
- // "type": "string"
- // },
- // "parentId": {
- // "description": "The new parent of the firewall policy. The ID can be either be \"folders/[FOLDER_ID]\" if the parent is a folder or \"organizations/[ORGANIZATION_ID]\" if the parent is an organization.",
- // "location": "query",
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "locations/global/firewallPolicies/{firewallPolicy}/move",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.firewallPolicies.patch":
-
-type FirewallPoliciesPatchCall struct {
- s *Service
- firewallPolicy string
- firewallpolicy *FirewallPolicy
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Patches the specified policy with the data included in the
-// request.
-//
-// - firewallPolicy: Name of the firewall policy to update.
-func (r *FirewallPoliciesService) Patch(firewallPolicy string, firewallpolicy *FirewallPolicy) *FirewallPoliciesPatchCall {
- c := &FirewallPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.firewallPolicy = firewallPolicy
- c.firewallpolicy = firewallpolicy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *FirewallPoliciesPatchCall) RequestId(requestId string) *FirewallPoliciesPatchCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *FirewallPoliciesPatchCall) Fields(s ...googleapi.Field) *FirewallPoliciesPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *FirewallPoliciesPatchCall) Context(ctx context.Context) *FirewallPoliciesPatchCall {
- 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 *FirewallPoliciesPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *FirewallPoliciesPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicy)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "firewallPolicy": c.firewallPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.firewallPolicies.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *FirewallPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Patches the specified policy with the data included in the request.",
- // "flatPath": "locations/global/firewallPolicies/{firewallPolicy}",
- // "httpMethod": "PATCH",
- // "id": "compute.firewallPolicies.patch",
- // "parameterOrder": [
- // "firewallPolicy"
- // ],
- // "parameters": {
- // "firewallPolicy": {
- // "description": "Name of the firewall policy to update.",
- // "location": "path",
- // "pattern": "(firewallPolicies/)?[0-9]{0,20}",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "locations/global/firewallPolicies/{firewallPolicy}",
- // "request": {
- // "$ref": "FirewallPolicy"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.firewallPolicies.patchRule":
-
-type FirewallPoliciesPatchRuleCall struct {
- s *Service
- firewallPolicy string
- firewallpolicyrule *FirewallPolicyRule
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// PatchRule: Patches a rule of the specified priority.
-//
-// - firewallPolicy: Name of the firewall policy to update.
-func (r *FirewallPoliciesService) PatchRule(firewallPolicy string, firewallpolicyrule *FirewallPolicyRule) *FirewallPoliciesPatchRuleCall {
- c := &FirewallPoliciesPatchRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.firewallPolicy = firewallPolicy
- c.firewallpolicyrule = firewallpolicyrule
- return c
-}
-
-// Priority sets the optional parameter "priority": The priority of the
-// rule to patch.
-func (c *FirewallPoliciesPatchRuleCall) Priority(priority int64) *FirewallPoliciesPatchRuleCall {
- c.urlParams_.Set("priority", fmt.Sprint(priority))
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *FirewallPoliciesPatchRuleCall) RequestId(requestId string) *FirewallPoliciesPatchRuleCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *FirewallPoliciesPatchRuleCall) Fields(s ...googleapi.Field) *FirewallPoliciesPatchRuleCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *FirewallPoliciesPatchRuleCall) Context(ctx context.Context) *FirewallPoliciesPatchRuleCall {
- 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 *FirewallPoliciesPatchRuleCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *FirewallPoliciesPatchRuleCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyrule)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}/patchRule")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "firewallPolicy": c.firewallPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.firewallPolicies.patchRule" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *FirewallPoliciesPatchRuleCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Patches a rule of the specified priority.",
- // "flatPath": "locations/global/firewallPolicies/{firewallPolicy}/patchRule",
- // "httpMethod": "POST",
- // "id": "compute.firewallPolicies.patchRule",
- // "parameterOrder": [
- // "firewallPolicy"
- // ],
- // "parameters": {
- // "firewallPolicy": {
- // "description": "Name of the firewall policy to update.",
- // "location": "path",
- // "pattern": "(firewallPolicies/)?[0-9]{0,20}",
- // "required": true,
- // "type": "string"
- // },
- // "priority": {
- // "description": "The priority of the rule to patch.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "locations/global/firewallPolicies/{firewallPolicy}/patchRule",
- // "request": {
- // "$ref": "FirewallPolicyRule"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.firewallPolicies.removeAssociation":
-
-type FirewallPoliciesRemoveAssociationCall struct {
- s *Service
- firewallPolicy string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// RemoveAssociation: Removes an association for the specified firewall
-// policy.
-//
-// - firewallPolicy: Name of the firewall policy to update.
-func (r *FirewallPoliciesService) RemoveAssociation(firewallPolicy string) *FirewallPoliciesRemoveAssociationCall {
- c := &FirewallPoliciesRemoveAssociationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.firewallPolicy = firewallPolicy
- return c
-}
-
-// Name sets the optional parameter "name": Name for the attachment that
-// will be removed.
-func (c *FirewallPoliciesRemoveAssociationCall) Name(name string) *FirewallPoliciesRemoveAssociationCall {
- c.urlParams_.Set("name", name)
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *FirewallPoliciesRemoveAssociationCall) RequestId(requestId string) *FirewallPoliciesRemoveAssociationCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *FirewallPoliciesRemoveAssociationCall) Fields(s ...googleapi.Field) *FirewallPoliciesRemoveAssociationCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *FirewallPoliciesRemoveAssociationCall) Context(ctx context.Context) *FirewallPoliciesRemoveAssociationCall {
- 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 *FirewallPoliciesRemoveAssociationCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *FirewallPoliciesRemoveAssociationCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}/removeAssociation")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "firewallPolicy": c.firewallPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.firewallPolicies.removeAssociation" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *FirewallPoliciesRemoveAssociationCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Removes an association for the specified firewall policy.",
- // "flatPath": "locations/global/firewallPolicies/{firewallPolicy}/removeAssociation",
- // "httpMethod": "POST",
- // "id": "compute.firewallPolicies.removeAssociation",
- // "parameterOrder": [
- // "firewallPolicy"
- // ],
- // "parameters": {
- // "firewallPolicy": {
- // "description": "Name of the firewall policy to update.",
- // "location": "path",
- // "pattern": "(firewallPolicies/)?[0-9]{0,20}",
- // "required": true,
- // "type": "string"
- // },
- // "name": {
- // "description": "Name for the attachment that will be removed.",
- // "location": "query",
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "locations/global/firewallPolicies/{firewallPolicy}/removeAssociation",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.firewallPolicies.removeRule":
-
-type FirewallPoliciesRemoveRuleCall struct {
- s *Service
- firewallPolicy string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// RemoveRule: Deletes a rule of the specified priority.
-//
-// - firewallPolicy: Name of the firewall policy to update.
-func (r *FirewallPoliciesService) RemoveRule(firewallPolicy string) *FirewallPoliciesRemoveRuleCall {
- c := &FirewallPoliciesRemoveRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.firewallPolicy = firewallPolicy
- return c
-}
-
-// Priority sets the optional parameter "priority": The priority of the
-// rule to remove from the firewall policy.
-func (c *FirewallPoliciesRemoveRuleCall) Priority(priority int64) *FirewallPoliciesRemoveRuleCall {
- c.urlParams_.Set("priority", fmt.Sprint(priority))
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *FirewallPoliciesRemoveRuleCall) RequestId(requestId string) *FirewallPoliciesRemoveRuleCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *FirewallPoliciesRemoveRuleCall) Fields(s ...googleapi.Field) *FirewallPoliciesRemoveRuleCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *FirewallPoliciesRemoveRuleCall) Context(ctx context.Context) *FirewallPoliciesRemoveRuleCall {
- 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 *FirewallPoliciesRemoveRuleCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *FirewallPoliciesRemoveRuleCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}/removeRule")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "firewallPolicy": c.firewallPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.firewallPolicies.removeRule" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *FirewallPoliciesRemoveRuleCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes a rule of the specified priority.",
- // "flatPath": "locations/global/firewallPolicies/{firewallPolicy}/removeRule",
- // "httpMethod": "POST",
- // "id": "compute.firewallPolicies.removeRule",
- // "parameterOrder": [
- // "firewallPolicy"
- // ],
- // "parameters": {
- // "firewallPolicy": {
- // "description": "Name of the firewall policy to update.",
- // "location": "path",
- // "pattern": "(firewallPolicies/)?[0-9]{0,20}",
- // "required": true,
- // "type": "string"
- // },
- // "priority": {
- // "description": "The priority of the rule to remove from the firewall policy.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "locations/global/firewallPolicies/{firewallPolicy}/removeRule",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.firewallPolicies.setIamPolicy":
-
-type FirewallPoliciesSetIamPolicyCall struct {
- s *Service
- resource string
- globalorganizationsetpolicyrequest *GlobalOrganizationSetPolicyRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetIamPolicy: Sets the access control policy on the specified
-// resource. Replaces any existing policy.
-//
-// - resource: Name or id of the resource for this request.
-func (r *FirewallPoliciesService) SetIamPolicy(resource string, globalorganizationsetpolicyrequest *GlobalOrganizationSetPolicyRequest) *FirewallPoliciesSetIamPolicyCall {
- c := &FirewallPoliciesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.resource = resource
- c.globalorganizationsetpolicyrequest = globalorganizationsetpolicyrequest
- 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 *FirewallPoliciesSetIamPolicyCall) Fields(s ...googleapi.Field) *FirewallPoliciesSetIamPolicyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *FirewallPoliciesSetIamPolicyCall) Context(ctx context.Context) *FirewallPoliciesSetIamPolicyCall {
- 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 *FirewallPoliciesSetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *FirewallPoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalorganizationsetpolicyrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{resource}/setIamPolicy")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.firewallPolicies.setIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *FirewallPoliciesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Sets the access control policy on the specified resource. Replaces any existing policy.",
- // "flatPath": "locations/global/firewallPolicies/{resource}/setIamPolicy",
- // "httpMethod": "POST",
- // "id": "compute.firewallPolicies.setIamPolicy",
- // "parameterOrder": [
- // "resource"
- // ],
- // "parameters": {
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "(firewallPolicies/)?[0-9]{0,20}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "locations/global/firewallPolicies/{resource}/setIamPolicy",
- // "request": {
- // "$ref": "GlobalOrganizationSetPolicyRequest"
- // },
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.firewallPolicies.testIamPermissions":
-
-type FirewallPoliciesTestIamPermissionsCall struct {
- s *Service
- resource string
- testpermissionsrequest *TestPermissionsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// TestIamPermissions: Returns permissions that a caller has on the
-// specified resource.
-//
-// - resource: Name or id of the resource for this request.
-func (r *FirewallPoliciesService) TestIamPermissions(resource string, testpermissionsrequest *TestPermissionsRequest) *FirewallPoliciesTestIamPermissionsCall {
- c := &FirewallPoliciesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.resource = resource
- c.testpermissionsrequest = testpermissionsrequest
- 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 *FirewallPoliciesTestIamPermissionsCall) Fields(s ...googleapi.Field) *FirewallPoliciesTestIamPermissionsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *FirewallPoliciesTestIamPermissionsCall) Context(ctx context.Context) *FirewallPoliciesTestIamPermissionsCall {
- 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 *FirewallPoliciesTestIamPermissionsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *FirewallPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{resource}/testIamPermissions")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.firewallPolicies.testIamPermissions" call.
-// Exactly one of *TestPermissionsResponse or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *TestPermissionsResponse.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 *FirewallPoliciesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TestPermissionsResponse{
- 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": "Returns permissions that a caller has on the specified resource.",
- // "flatPath": "locations/global/firewallPolicies/{resource}/testIamPermissions",
- // "httpMethod": "POST",
- // "id": "compute.firewallPolicies.testIamPermissions",
- // "parameterOrder": [
- // "resource"
- // ],
- // "parameters": {
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "(firewallPolicies/)?[0-9]{0,20}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "locations/global/firewallPolicies/{resource}/testIamPermissions",
- // "request": {
- // "$ref": "TestPermissionsRequest"
- // },
- // "response": {
- // "$ref": "TestPermissionsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.firewalls.delete":
-
-type FirewallsDeleteCall struct {
- s *Service
- project string
- firewall string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified firewall.
-//
-// - firewall: Name of the firewall rule to delete.
-// - project: Project ID for this request.
-func (r *FirewallsService) Delete(project string, firewall string) *FirewallsDeleteCall {
- c := &FirewallsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.firewall = firewall
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *FirewallsDeleteCall) RequestId(requestId string) *FirewallsDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *FirewallsDeleteCall) Fields(s ...googleapi.Field) *FirewallsDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *FirewallsDeleteCall) Context(ctx context.Context) *FirewallsDeleteCall {
- 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 *FirewallsDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *FirewallsDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewalls/{firewall}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "firewall": c.firewall,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.firewalls.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *FirewallsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified firewall.",
- // "flatPath": "projects/{project}/global/firewalls/{firewall}",
- // "httpMethod": "DELETE",
- // "id": "compute.firewalls.delete",
- // "parameterOrder": [
- // "project",
- // "firewall"
- // ],
- // "parameters": {
- // "firewall": {
- // "description": "Name of the firewall rule to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/firewalls/{firewall}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.firewalls.get":
-
-type FirewallsGetCall struct {
- s *Service
- project string
- firewall string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified firewall.
-//
-// - firewall: Name of the firewall rule to return.
-// - project: Project ID for this request.
-func (r *FirewallsService) Get(project string, firewall string) *FirewallsGetCall {
- c := &FirewallsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.firewall = firewall
- 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 *FirewallsGetCall) Fields(s ...googleapi.Field) *FirewallsGetCall {
- 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 *FirewallsGetCall) IfNoneMatch(entityTag string) *FirewallsGetCall {
- 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 *FirewallsGetCall) Context(ctx context.Context) *FirewallsGetCall {
- 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 *FirewallsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *FirewallsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/firewalls/{firewall}")
- 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{
- "project": c.project,
- "firewall": c.firewall,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.firewalls.get" call.
-// Exactly one of *Firewall or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Firewall.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 *FirewallsGetCall) Do(opts ...googleapi.CallOption) (*Firewall, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Firewall{
- 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": "Returns the specified firewall.",
- // "flatPath": "projects/{project}/global/firewalls/{firewall}",
- // "httpMethod": "GET",
- // "id": "compute.firewalls.get",
- // "parameterOrder": [
- // "project",
- // "firewall"
- // ],
- // "parameters": {
- // "firewall": {
- // "description": "Name of the firewall rule to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/firewalls/{firewall}",
- // "response": {
- // "$ref": "Firewall"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.firewalls.insert":
-
-type FirewallsInsertCall struct {
- s *Service
- project string
- firewall *Firewall
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a firewall rule in the specified project using the
-// data included in the request.
-//
-// - project: Project ID for this request.
-func (r *FirewallsService) Insert(project string, firewall *Firewall) *FirewallsInsertCall {
- c := &FirewallsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.firewall = firewall
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *FirewallsInsertCall) RequestId(requestId string) *FirewallsInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *FirewallsInsertCall) Fields(s ...googleapi.Field) *FirewallsInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *FirewallsInsertCall) Context(ctx context.Context) *FirewallsInsertCall {
- 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 *FirewallsInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *FirewallsInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewalls")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.firewalls.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *FirewallsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a firewall rule in the specified project using the data included in the request.",
- // "flatPath": "projects/{project}/global/firewalls",
- // "httpMethod": "POST",
- // "id": "compute.firewalls.insert",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/firewalls",
- // "request": {
- // "$ref": "Firewall"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.firewalls.list":
-
-type FirewallsListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves the list of firewall rules available to the specified
-// project.
-//
-// - project: Project ID for this request.
-func (r *FirewallsService) List(project string) *FirewallsListCall {
- c := &FirewallsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *FirewallsListCall) Filter(filter string) *FirewallsListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *FirewallsListCall) MaxResults(maxResults int64) *FirewallsListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *FirewallsListCall) OrderBy(orderBy string) *FirewallsListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *FirewallsListCall) PageToken(pageToken string) *FirewallsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *FirewallsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *FirewallsListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *FirewallsListCall) Fields(s ...googleapi.Field) *FirewallsListCall {
- 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 *FirewallsListCall) IfNoneMatch(entityTag string) *FirewallsListCall {
- 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 *FirewallsListCall) Context(ctx context.Context) *FirewallsListCall {
- 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 *FirewallsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *FirewallsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/firewalls")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.firewalls.list" call.
-// Exactly one of *FirewallList or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *FirewallList.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 *FirewallsListCall) Do(opts ...googleapi.CallOption) (*FirewallList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &FirewallList{
- 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": "Retrieves the list of firewall rules available to the specified project.",
- // "flatPath": "projects/{project}/global/firewalls",
- // "httpMethod": "GET",
- // "id": "compute.firewalls.list",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/firewalls",
- // "response": {
- // "$ref": "FirewallList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *FirewallsListCall) Pages(ctx context.Context, f func(*FirewallList) 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 "compute.firewalls.patch":
-
-type FirewallsPatchCall struct {
- s *Service
- project string
- firewall string
- firewall2 *Firewall
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Updates the specified firewall rule with the data included in
-// the request. This method supports PATCH semantics and uses the JSON
-// merge patch format and processing rules.
-//
-// - firewall: Name of the firewall rule to patch.
-// - project: Project ID for this request.
-func (r *FirewallsService) Patch(project string, firewall string, firewall2 *Firewall) *FirewallsPatchCall {
- c := &FirewallsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.firewall = firewall
- c.firewall2 = firewall2
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *FirewallsPatchCall) RequestId(requestId string) *FirewallsPatchCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *FirewallsPatchCall) Fields(s ...googleapi.Field) *FirewallsPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *FirewallsPatchCall) Context(ctx context.Context) *FirewallsPatchCall {
- 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 *FirewallsPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *FirewallsPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewalls/{firewall}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "firewall": c.firewall,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.firewalls.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *FirewallsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Updates the specified firewall rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
- // "flatPath": "projects/{project}/global/firewalls/{firewall}",
- // "httpMethod": "PATCH",
- // "id": "compute.firewalls.patch",
- // "parameterOrder": [
- // "project",
- // "firewall"
- // ],
- // "parameters": {
- // "firewall": {
- // "description": "Name of the firewall rule to patch.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/firewalls/{firewall}",
- // "request": {
- // "$ref": "Firewall"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.firewalls.update":
-
-type FirewallsUpdateCall struct {
- s *Service
- project string
- firewall string
- firewall2 *Firewall
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Update: Updates the specified firewall rule with the data included in
-// the request. Note that all fields will be updated if using PUT, even
-// fields that are not specified. To update individual fields, please
-// use PATCH instead.
-//
-// - firewall: Name of the firewall rule to update.
-// - project: Project ID for this request.
-func (r *FirewallsService) Update(project string, firewall string, firewall2 *Firewall) *FirewallsUpdateCall {
- c := &FirewallsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.firewall = firewall
- c.firewall2 = firewall2
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *FirewallsUpdateCall) RequestId(requestId string) *FirewallsUpdateCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *FirewallsUpdateCall) Fields(s ...googleapi.Field) *FirewallsUpdateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *FirewallsUpdateCall) Context(ctx context.Context) *FirewallsUpdateCall {
- 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 *FirewallsUpdateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *FirewallsUpdateCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewalls/{firewall}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PUT", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "firewall": c.firewall,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.firewalls.update" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *FirewallsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Updates the specified firewall rule with the data included in the request. Note that all fields will be updated if using PUT, even fields that are not specified. To update individual fields, please use PATCH instead.",
- // "flatPath": "projects/{project}/global/firewalls/{firewall}",
- // "httpMethod": "PUT",
- // "id": "compute.firewalls.update",
- // "parameterOrder": [
- // "project",
- // "firewall"
- // ],
- // "parameters": {
- // "firewall": {
- // "description": "Name of the firewall rule to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/firewalls/{firewall}",
- // "request": {
- // "$ref": "Firewall"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.forwardingRules.aggregatedList":
-
-type ForwardingRulesAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Retrieves an aggregated list of forwarding rules.
-//
-// - project: Project ID for this request.
-func (r *ForwardingRulesService) AggregatedList(project string) *ForwardingRulesAggregatedListCall {
- c := &ForwardingRulesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *ForwardingRulesAggregatedListCall) Filter(filter string) *ForwardingRulesAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *ForwardingRulesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *ForwardingRulesAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *ForwardingRulesAggregatedListCall) MaxResults(maxResults int64) *ForwardingRulesAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *ForwardingRulesAggregatedListCall) OrderBy(orderBy string) *ForwardingRulesAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *ForwardingRulesAggregatedListCall) PageToken(pageToken string) *ForwardingRulesAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *ForwardingRulesAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ForwardingRulesAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *ForwardingRulesAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *ForwardingRulesAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *ForwardingRulesAggregatedListCall) Fields(s ...googleapi.Field) *ForwardingRulesAggregatedListCall {
- 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 *ForwardingRulesAggregatedListCall) IfNoneMatch(entityTag string) *ForwardingRulesAggregatedListCall {
- 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 *ForwardingRulesAggregatedListCall) Context(ctx context.Context) *ForwardingRulesAggregatedListCall {
- 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 *ForwardingRulesAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ForwardingRulesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/forwardingRules")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.forwardingRules.aggregatedList" call.
-// Exactly one of *ForwardingRuleAggregatedList or error will be
-// non-nil. Any non-2xx status code is an error. Response headers are in
-// either *ForwardingRuleAggregatedList.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 *ForwardingRulesAggregatedListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &ForwardingRuleAggregatedList{
- 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": "Retrieves an aggregated list of forwarding rules.",
- // "flatPath": "projects/{project}/aggregated/forwardingRules",
- // "httpMethod": "GET",
- // "id": "compute.forwardingRules.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/forwardingRules",
- // "response": {
- // "$ref": "ForwardingRuleAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *ForwardingRulesAggregatedListCall) Pages(ctx context.Context, f func(*ForwardingRuleAggregatedList) 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 "compute.forwardingRules.delete":
-
-type ForwardingRulesDeleteCall struct {
- s *Service
- project string
- region string
- forwardingRule string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified ForwardingRule resource.
-//
-// - forwardingRule: Name of the ForwardingRule resource to delete.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *ForwardingRulesService) Delete(project string, region string, forwardingRule string) *ForwardingRulesDeleteCall {
- c := &ForwardingRulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.forwardingRule = forwardingRule
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *ForwardingRulesDeleteCall) RequestId(requestId string) *ForwardingRulesDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *ForwardingRulesDeleteCall) Fields(s ...googleapi.Field) *ForwardingRulesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ForwardingRulesDeleteCall) Context(ctx context.Context) *ForwardingRulesDeleteCall {
- 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 *ForwardingRulesDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/forwardingRules/{forwardingRule}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "forwardingRule": c.forwardingRule,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.forwardingRules.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *ForwardingRulesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified ForwardingRule resource.",
- // "flatPath": "projects/{project}/regions/{region}/forwardingRules/{forwardingRule}",
- // "httpMethod": "DELETE",
- // "id": "compute.forwardingRules.delete",
- // "parameterOrder": [
- // "project",
- // "region",
- // "forwardingRule"
- // ],
- // "parameters": {
- // "forwardingRule": {
- // "description": "Name of the ForwardingRule resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/forwardingRules/{forwardingRule}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.forwardingRules.get":
-
-type ForwardingRulesGetCall struct {
- s *Service
- project string
- region string
- forwardingRule string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified ForwardingRule resource.
-//
-// - forwardingRule: Name of the ForwardingRule resource to return.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *ForwardingRulesService) Get(project string, region string, forwardingRule string) *ForwardingRulesGetCall {
- c := &ForwardingRulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.forwardingRule = forwardingRule
- 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 *ForwardingRulesGetCall) Fields(s ...googleapi.Field) *ForwardingRulesGetCall {
- 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 *ForwardingRulesGetCall) IfNoneMatch(entityTag string) *ForwardingRulesGetCall {
- 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 *ForwardingRulesGetCall) Context(ctx context.Context) *ForwardingRulesGetCall {
- 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 *ForwardingRulesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/forwardingRules/{forwardingRule}")
- 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{
- "project": c.project,
- "region": c.region,
- "forwardingRule": c.forwardingRule,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.forwardingRules.get" call.
-// Exactly one of *ForwardingRule or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *ForwardingRule.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 *ForwardingRulesGetCall) Do(opts ...googleapi.CallOption) (*ForwardingRule, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &ForwardingRule{
- 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": "Returns the specified ForwardingRule resource.",
- // "flatPath": "projects/{project}/regions/{region}/forwardingRules/{forwardingRule}",
- // "httpMethod": "GET",
- // "id": "compute.forwardingRules.get",
- // "parameterOrder": [
- // "project",
- // "region",
- // "forwardingRule"
- // ],
- // "parameters": {
- // "forwardingRule": {
- // "description": "Name of the ForwardingRule resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/forwardingRules/{forwardingRule}",
- // "response": {
- // "$ref": "ForwardingRule"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.forwardingRules.insert":
-
-type ForwardingRulesInsertCall struct {
- s *Service
- project string
- region string
- forwardingrule *ForwardingRule
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a ForwardingRule resource in the specified project
-// and region using the data included in the request.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *ForwardingRulesService) Insert(project string, region string, forwardingrule *ForwardingRule) *ForwardingRulesInsertCall {
- c := &ForwardingRulesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.forwardingrule = forwardingrule
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *ForwardingRulesInsertCall) RequestId(requestId string) *ForwardingRulesInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *ForwardingRulesInsertCall) Fields(s ...googleapi.Field) *ForwardingRulesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ForwardingRulesInsertCall) Context(ctx context.Context) *ForwardingRulesInsertCall {
- 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 *ForwardingRulesInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ForwardingRulesInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/forwardingRules")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.forwardingRules.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *ForwardingRulesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a ForwardingRule resource in the specified project and region using the data included in the request.",
- // "flatPath": "projects/{project}/regions/{region}/forwardingRules",
- // "httpMethod": "POST",
- // "id": "compute.forwardingRules.insert",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/forwardingRules",
- // "request": {
- // "$ref": "ForwardingRule"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.forwardingRules.list":
-
-type ForwardingRulesListCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves a list of ForwardingRule resources available to the
-// specified project and region.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *ForwardingRulesService) List(project string, region string) *ForwardingRulesListCall {
- c := &ForwardingRulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *ForwardingRulesListCall) Filter(filter string) *ForwardingRulesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *ForwardingRulesListCall) MaxResults(maxResults int64) *ForwardingRulesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *ForwardingRulesListCall) OrderBy(orderBy string) *ForwardingRulesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *ForwardingRulesListCall) PageToken(pageToken string) *ForwardingRulesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *ForwardingRulesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ForwardingRulesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *ForwardingRulesListCall) Fields(s ...googleapi.Field) *ForwardingRulesListCall {
- 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 *ForwardingRulesListCall) IfNoneMatch(entityTag string) *ForwardingRulesListCall {
- 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 *ForwardingRulesListCall) Context(ctx context.Context) *ForwardingRulesListCall {
- 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 *ForwardingRulesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ForwardingRulesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/forwardingRules")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.forwardingRules.list" call.
-// Exactly one of *ForwardingRuleList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *ForwardingRuleList.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 *ForwardingRulesListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &ForwardingRuleList{
- 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": "Retrieves a list of ForwardingRule resources available to the specified project and region.",
- // "flatPath": "projects/{project}/regions/{region}/forwardingRules",
- // "httpMethod": "GET",
- // "id": "compute.forwardingRules.list",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/forwardingRules",
- // "response": {
- // "$ref": "ForwardingRuleList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *ForwardingRulesListCall) Pages(ctx context.Context, f func(*ForwardingRuleList) 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 "compute.forwardingRules.patch":
-
-type ForwardingRulesPatchCall struct {
- s *Service
- project string
- region string
- forwardingRule string
- forwardingrule *ForwardingRule
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Updates the specified forwarding rule with the data included
-// in the request. This method supports PATCH semantics and uses the
-// JSON merge patch format and processing rules. Currently, you can only
-// patch the network_tier field.
-//
-// - forwardingRule: Name of the ForwardingRule resource to patch.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *ForwardingRulesService) Patch(project string, region string, forwardingRule string, forwardingrule *ForwardingRule) *ForwardingRulesPatchCall {
- c := &ForwardingRulesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.forwardingRule = forwardingRule
- c.forwardingrule = forwardingrule
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *ForwardingRulesPatchCall) RequestId(requestId string) *ForwardingRulesPatchCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *ForwardingRulesPatchCall) Fields(s ...googleapi.Field) *ForwardingRulesPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ForwardingRulesPatchCall) Context(ctx context.Context) *ForwardingRulesPatchCall {
- 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 *ForwardingRulesPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ForwardingRulesPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/forwardingRules/{forwardingRule}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "forwardingRule": c.forwardingRule,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.forwardingRules.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *ForwardingRulesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Updates the specified forwarding rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. Currently, you can only patch the network_tier field.",
- // "flatPath": "projects/{project}/regions/{region}/forwardingRules/{forwardingRule}",
- // "httpMethod": "PATCH",
- // "id": "compute.forwardingRules.patch",
- // "parameterOrder": [
- // "project",
- // "region",
- // "forwardingRule"
- // ],
- // "parameters": {
- // "forwardingRule": {
- // "description": "Name of the ForwardingRule resource to patch.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/forwardingRules/{forwardingRule}",
- // "request": {
- // "$ref": "ForwardingRule"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.forwardingRules.setLabels":
-
-type ForwardingRulesSetLabelsCall struct {
- s *Service
- project string
- region string
- resource string
- regionsetlabelsrequest *RegionSetLabelsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetLabels: Sets the labels on the specified resource. To learn more
-// about labels, read the Labeling Resources documentation.
-//
-// - project: Project ID for this request.
-// - region: The region for this request.
-// - resource: Name or id of the resource for this request.
-func (r *ForwardingRulesService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *ForwardingRulesSetLabelsCall {
- c := &ForwardingRulesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.resource = resource
- c.regionsetlabelsrequest = regionsetlabelsrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *ForwardingRulesSetLabelsCall) RequestId(requestId string) *ForwardingRulesSetLabelsCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *ForwardingRulesSetLabelsCall) Fields(s ...googleapi.Field) *ForwardingRulesSetLabelsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ForwardingRulesSetLabelsCall) Context(ctx context.Context) *ForwardingRulesSetLabelsCall {
- 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 *ForwardingRulesSetLabelsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ForwardingRulesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/forwardingRules/{resource}/setLabels")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.forwardingRules.setLabels" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *ForwardingRulesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Sets the labels on the specified resource. To learn more about labels, read the Labeling Resources documentation.",
- // "flatPath": "projects/{project}/regions/{region}/forwardingRules/{resource}/setLabels",
- // "httpMethod": "POST",
- // "id": "compute.forwardingRules.setLabels",
- // "parameterOrder": [
- // "project",
- // "region",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/forwardingRules/{resource}/setLabels",
- // "request": {
- // "$ref": "RegionSetLabelsRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.forwardingRules.setTarget":
-
-type ForwardingRulesSetTargetCall struct {
- s *Service
- project string
- region string
- forwardingRule string
- targetreference *TargetReference
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetTarget: Changes target URL for forwarding rule. The new target
-// should be of the same type as the old target.
-//
-// - forwardingRule: Name of the ForwardingRule resource in which target
-// is to be set.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *ForwardingRulesService) SetTarget(project string, region string, forwardingRule string, targetreference *TargetReference) *ForwardingRulesSetTargetCall {
- c := &ForwardingRulesSetTargetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.forwardingRule = forwardingRule
- c.targetreference = targetreference
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *ForwardingRulesSetTargetCall) RequestId(requestId string) *ForwardingRulesSetTargetCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *ForwardingRulesSetTargetCall) Fields(s ...googleapi.Field) *ForwardingRulesSetTargetCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ForwardingRulesSetTargetCall) Context(ctx context.Context) *ForwardingRulesSetTargetCall {
- 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 *ForwardingRulesSetTargetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "forwardingRule": c.forwardingRule,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.forwardingRules.setTarget" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *ForwardingRulesSetTargetCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Changes target URL for forwarding rule. The new target should be of the same type as the old target.",
- // "flatPath": "projects/{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget",
- // "httpMethod": "POST",
- // "id": "compute.forwardingRules.setTarget",
- // "parameterOrder": [
- // "project",
- // "region",
- // "forwardingRule"
- // ],
- // "parameters": {
- // "forwardingRule": {
- // "description": "Name of the ForwardingRule resource in which target is to be set.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget",
- // "request": {
- // "$ref": "TargetReference"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.globalAddresses.delete":
-
-type GlobalAddressesDeleteCall struct {
- s *Service
- project string
- address string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified address resource.
-//
-// - address: Name of the address resource to delete.
-// - project: Project ID for this request.
-func (r *GlobalAddressesService) Delete(project string, address string) *GlobalAddressesDeleteCall {
- c := &GlobalAddressesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.address = address
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *GlobalAddressesDeleteCall) RequestId(requestId string) *GlobalAddressesDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *GlobalAddressesDeleteCall) Fields(s ...googleapi.Field) *GlobalAddressesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *GlobalAddressesDeleteCall) Context(ctx context.Context) *GlobalAddressesDeleteCall {
- 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 *GlobalAddressesDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *GlobalAddressesDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/addresses/{address}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "address": c.address,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.globalAddresses.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *GlobalAddressesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified address resource.",
- // "flatPath": "projects/{project}/global/addresses/{address}",
- // "httpMethod": "DELETE",
- // "id": "compute.globalAddresses.delete",
- // "parameterOrder": [
- // "project",
- // "address"
- // ],
- // "parameters": {
- // "address": {
- // "description": "Name of the address resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/addresses/{address}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.globalAddresses.get":
-
-type GlobalAddressesGetCall struct {
- s *Service
- project string
- address string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified address resource.
-//
-// - address: Name of the address resource to return.
-// - project: Project ID for this request.
-func (r *GlobalAddressesService) Get(project string, address string) *GlobalAddressesGetCall {
- c := &GlobalAddressesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.address = address
- 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 *GlobalAddressesGetCall) Fields(s ...googleapi.Field) *GlobalAddressesGetCall {
- 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 *GlobalAddressesGetCall) IfNoneMatch(entityTag string) *GlobalAddressesGetCall {
- 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 *GlobalAddressesGetCall) Context(ctx context.Context) *GlobalAddressesGetCall {
- 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 *GlobalAddressesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *GlobalAddressesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/addresses/{address}")
- 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{
- "project": c.project,
- "address": c.address,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.globalAddresses.get" call.
-// Exactly one of *Address or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Address.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 *GlobalAddressesGetCall) Do(opts ...googleapi.CallOption) (*Address, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Address{
- 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": "Returns the specified address resource.",
- // "flatPath": "projects/{project}/global/addresses/{address}",
- // "httpMethod": "GET",
- // "id": "compute.globalAddresses.get",
- // "parameterOrder": [
- // "project",
- // "address"
- // ],
- // "parameters": {
- // "address": {
- // "description": "Name of the address resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/addresses/{address}",
- // "response": {
- // "$ref": "Address"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.globalAddresses.insert":
-
-type GlobalAddressesInsertCall struct {
- s *Service
- project string
- address *Address
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates an address resource in the specified project by using
-// the data included in the request.
-//
-// - project: Project ID for this request.
-func (r *GlobalAddressesService) Insert(project string, address *Address) *GlobalAddressesInsertCall {
- c := &GlobalAddressesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.address = address
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *GlobalAddressesInsertCall) RequestId(requestId string) *GlobalAddressesInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *GlobalAddressesInsertCall) Fields(s ...googleapi.Field) *GlobalAddressesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *GlobalAddressesInsertCall) Context(ctx context.Context) *GlobalAddressesInsertCall {
- 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 *GlobalAddressesInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *GlobalAddressesInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.address)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/addresses")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.globalAddresses.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *GlobalAddressesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates an address resource in the specified project by using the data included in the request.",
- // "flatPath": "projects/{project}/global/addresses",
- // "httpMethod": "POST",
- // "id": "compute.globalAddresses.insert",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/addresses",
- // "request": {
- // "$ref": "Address"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.globalAddresses.list":
-
-type GlobalAddressesListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves a list of global addresses.
-//
-// - project: Project ID for this request.
-func (r *GlobalAddressesService) List(project string) *GlobalAddressesListCall {
- c := &GlobalAddressesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *GlobalAddressesListCall) Filter(filter string) *GlobalAddressesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *GlobalAddressesListCall) MaxResults(maxResults int64) *GlobalAddressesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *GlobalAddressesListCall) OrderBy(orderBy string) *GlobalAddressesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *GlobalAddressesListCall) PageToken(pageToken string) *GlobalAddressesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *GlobalAddressesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *GlobalAddressesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *GlobalAddressesListCall) Fields(s ...googleapi.Field) *GlobalAddressesListCall {
- 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 *GlobalAddressesListCall) IfNoneMatch(entityTag string) *GlobalAddressesListCall {
- 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 *GlobalAddressesListCall) Context(ctx context.Context) *GlobalAddressesListCall {
- 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 *GlobalAddressesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *GlobalAddressesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/addresses")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.globalAddresses.list" call.
-// Exactly one of *AddressList or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *AddressList.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 *GlobalAddressesListCall) Do(opts ...googleapi.CallOption) (*AddressList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &AddressList{
- 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": "Retrieves a list of global addresses.",
- // "flatPath": "projects/{project}/global/addresses",
- // "httpMethod": "GET",
- // "id": "compute.globalAddresses.list",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/addresses",
- // "response": {
- // "$ref": "AddressList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *GlobalAddressesListCall) Pages(ctx context.Context, f func(*AddressList) 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 "compute.globalAddresses.move":
-
-type GlobalAddressesMoveCall struct {
- s *Service
- project string
- address string
- globaladdressesmoverequest *GlobalAddressesMoveRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Move: Moves the specified address resource from one project to
-// another project.
-//
-// - address: Name of the address resource to move.
-// - project: Source project ID which the Address is moved from.
-func (r *GlobalAddressesService) Move(project string, address string, globaladdressesmoverequest *GlobalAddressesMoveRequest) *GlobalAddressesMoveCall {
- c := &GlobalAddressesMoveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.address = address
- c.globaladdressesmoverequest = globaladdressesmoverequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *GlobalAddressesMoveCall) RequestId(requestId string) *GlobalAddressesMoveCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *GlobalAddressesMoveCall) Fields(s ...googleapi.Field) *GlobalAddressesMoveCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *GlobalAddressesMoveCall) Context(ctx context.Context) *GlobalAddressesMoveCall {
- 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 *GlobalAddressesMoveCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *GlobalAddressesMoveCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.globaladdressesmoverequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/addresses/{address}/move")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "address": c.address,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.globalAddresses.move" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *GlobalAddressesMoveCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Moves the specified address resource from one project to another project.",
- // "flatPath": "projects/{project}/global/addresses/{address}/move",
- // "httpMethod": "POST",
- // "id": "compute.globalAddresses.move",
- // "parameterOrder": [
- // "project",
- // "address"
- // ],
- // "parameters": {
- // "address": {
- // "description": "Name of the address resource to move.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Source project ID which the Address is moved from.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/addresses/{address}/move",
- // "request": {
- // "$ref": "GlobalAddressesMoveRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.globalAddresses.setLabels":
-
-type GlobalAddressesSetLabelsCall struct {
- s *Service
- project string
- resource string
- globalsetlabelsrequest *GlobalSetLabelsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetLabels: Sets the labels on a GlobalAddress. To learn more about
-// labels, read the Labeling Resources documentation.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-func (r *GlobalAddressesService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *GlobalAddressesSetLabelsCall {
- c := &GlobalAddressesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.resource = resource
- c.globalsetlabelsrequest = globalsetlabelsrequest
- 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 *GlobalAddressesSetLabelsCall) Fields(s ...googleapi.Field) *GlobalAddressesSetLabelsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *GlobalAddressesSetLabelsCall) Context(ctx context.Context) *GlobalAddressesSetLabelsCall {
- 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 *GlobalAddressesSetLabelsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *GlobalAddressesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/addresses/{resource}/setLabels")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.globalAddresses.setLabels" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *GlobalAddressesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Sets the labels on a GlobalAddress. To learn more about labels, read the Labeling Resources documentation.",
- // "flatPath": "projects/{project}/global/addresses/{resource}/setLabels",
- // "httpMethod": "POST",
- // "id": "compute.globalAddresses.setLabels",
- // "parameterOrder": [
- // "project",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/addresses/{resource}/setLabels",
- // "request": {
- // "$ref": "GlobalSetLabelsRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.globalForwardingRules.delete":
-
-type GlobalForwardingRulesDeleteCall struct {
- s *Service
- project string
- forwardingRule string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified GlobalForwardingRule resource.
-//
-// - forwardingRule: Name of the ForwardingRule resource to delete.
-// - project: Project ID for this request.
-func (r *GlobalForwardingRulesService) Delete(project string, forwardingRule string) *GlobalForwardingRulesDeleteCall {
- c := &GlobalForwardingRulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.forwardingRule = forwardingRule
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *GlobalForwardingRulesDeleteCall) RequestId(requestId string) *GlobalForwardingRulesDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *GlobalForwardingRulesDeleteCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *GlobalForwardingRulesDeleteCall) Context(ctx context.Context) *GlobalForwardingRulesDeleteCall {
- 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 *GlobalForwardingRulesDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *GlobalForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/forwardingRules/{forwardingRule}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "forwardingRule": c.forwardingRule,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.globalForwardingRules.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *GlobalForwardingRulesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified GlobalForwardingRule resource.",
- // "flatPath": "projects/{project}/global/forwardingRules/{forwardingRule}",
- // "httpMethod": "DELETE",
- // "id": "compute.globalForwardingRules.delete",
- // "parameterOrder": [
- // "project",
- // "forwardingRule"
- // ],
- // "parameters": {
- // "forwardingRule": {
- // "description": "Name of the ForwardingRule resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/forwardingRules/{forwardingRule}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.globalForwardingRules.get":
-
-type GlobalForwardingRulesGetCall struct {
- s *Service
- project string
- forwardingRule string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified GlobalForwardingRule resource. Gets a list
-// of available forwarding rules by making a list() request.
-//
-// - forwardingRule: Name of the ForwardingRule resource to return.
-// - project: Project ID for this request.
-func (r *GlobalForwardingRulesService) Get(project string, forwardingRule string) *GlobalForwardingRulesGetCall {
- c := &GlobalForwardingRulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.forwardingRule = forwardingRule
- 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 *GlobalForwardingRulesGetCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesGetCall {
- 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 *GlobalForwardingRulesGetCall) IfNoneMatch(entityTag string) *GlobalForwardingRulesGetCall {
- 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 *GlobalForwardingRulesGetCall) Context(ctx context.Context) *GlobalForwardingRulesGetCall {
- 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 *GlobalForwardingRulesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *GlobalForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/forwardingRules/{forwardingRule}")
- 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{
- "project": c.project,
- "forwardingRule": c.forwardingRule,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.globalForwardingRules.get" call.
-// Exactly one of *ForwardingRule or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *ForwardingRule.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 *GlobalForwardingRulesGetCall) Do(opts ...googleapi.CallOption) (*ForwardingRule, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &ForwardingRule{
- 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": "Returns the specified GlobalForwardingRule resource. Gets a list of available forwarding rules by making a list() request.",
- // "flatPath": "projects/{project}/global/forwardingRules/{forwardingRule}",
- // "httpMethod": "GET",
- // "id": "compute.globalForwardingRules.get",
- // "parameterOrder": [
- // "project",
- // "forwardingRule"
- // ],
- // "parameters": {
- // "forwardingRule": {
- // "description": "Name of the ForwardingRule resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/forwardingRules/{forwardingRule}",
- // "response": {
- // "$ref": "ForwardingRule"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.globalForwardingRules.insert":
-
-type GlobalForwardingRulesInsertCall struct {
- s *Service
- project string
- forwardingrule *ForwardingRule
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a GlobalForwardingRule resource in the specified
-// project using the data included in the request.
-//
-// - project: Project ID for this request.
-func (r *GlobalForwardingRulesService) Insert(project string, forwardingrule *ForwardingRule) *GlobalForwardingRulesInsertCall {
- c := &GlobalForwardingRulesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.forwardingrule = forwardingrule
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *GlobalForwardingRulesInsertCall) RequestId(requestId string) *GlobalForwardingRulesInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *GlobalForwardingRulesInsertCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *GlobalForwardingRulesInsertCall) Context(ctx context.Context) *GlobalForwardingRulesInsertCall {
- 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 *GlobalForwardingRulesInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *GlobalForwardingRulesInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/forwardingRules")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.globalForwardingRules.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *GlobalForwardingRulesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a GlobalForwardingRule resource in the specified project using the data included in the request.",
- // "flatPath": "projects/{project}/global/forwardingRules",
- // "httpMethod": "POST",
- // "id": "compute.globalForwardingRules.insert",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/forwardingRules",
- // "request": {
- // "$ref": "ForwardingRule"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.globalForwardingRules.list":
-
-type GlobalForwardingRulesListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves a list of GlobalForwardingRule resources available to
-// the specified project.
-//
-// - project: Project ID for this request.
-func (r *GlobalForwardingRulesService) List(project string) *GlobalForwardingRulesListCall {
- c := &GlobalForwardingRulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *GlobalForwardingRulesListCall) Filter(filter string) *GlobalForwardingRulesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *GlobalForwardingRulesListCall) MaxResults(maxResults int64) *GlobalForwardingRulesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *GlobalForwardingRulesListCall) OrderBy(orderBy string) *GlobalForwardingRulesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *GlobalForwardingRulesListCall) PageToken(pageToken string) *GlobalForwardingRulesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *GlobalForwardingRulesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *GlobalForwardingRulesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *GlobalForwardingRulesListCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesListCall {
- 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 *GlobalForwardingRulesListCall) IfNoneMatch(entityTag string) *GlobalForwardingRulesListCall {
- 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 *GlobalForwardingRulesListCall) Context(ctx context.Context) *GlobalForwardingRulesListCall {
- 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 *GlobalForwardingRulesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *GlobalForwardingRulesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/forwardingRules")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.globalForwardingRules.list" call.
-// Exactly one of *ForwardingRuleList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *ForwardingRuleList.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 *GlobalForwardingRulesListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &ForwardingRuleList{
- 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": "Retrieves a list of GlobalForwardingRule resources available to the specified project.",
- // "flatPath": "projects/{project}/global/forwardingRules",
- // "httpMethod": "GET",
- // "id": "compute.globalForwardingRules.list",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/forwardingRules",
- // "response": {
- // "$ref": "ForwardingRuleList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *GlobalForwardingRulesListCall) Pages(ctx context.Context, f func(*ForwardingRuleList) 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 "compute.globalForwardingRules.patch":
-
-type GlobalForwardingRulesPatchCall struct {
- s *Service
- project string
- forwardingRule string
- forwardingrule *ForwardingRule
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Updates the specified forwarding rule with the data included
-// in the request. This method supports PATCH semantics and uses the
-// JSON merge patch format and processing rules. Currently, you can only
-// patch the network_tier field.
-//
-// - forwardingRule: Name of the ForwardingRule resource to patch.
-// - project: Project ID for this request.
-func (r *GlobalForwardingRulesService) Patch(project string, forwardingRule string, forwardingrule *ForwardingRule) *GlobalForwardingRulesPatchCall {
- c := &GlobalForwardingRulesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.forwardingRule = forwardingRule
- c.forwardingrule = forwardingrule
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *GlobalForwardingRulesPatchCall) RequestId(requestId string) *GlobalForwardingRulesPatchCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *GlobalForwardingRulesPatchCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *GlobalForwardingRulesPatchCall) Context(ctx context.Context) *GlobalForwardingRulesPatchCall {
- 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 *GlobalForwardingRulesPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *GlobalForwardingRulesPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/forwardingRules/{forwardingRule}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "forwardingRule": c.forwardingRule,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.globalForwardingRules.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *GlobalForwardingRulesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Updates the specified forwarding rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. Currently, you can only patch the network_tier field.",
- // "flatPath": "projects/{project}/global/forwardingRules/{forwardingRule}",
- // "httpMethod": "PATCH",
- // "id": "compute.globalForwardingRules.patch",
- // "parameterOrder": [
- // "project",
- // "forwardingRule"
- // ],
- // "parameters": {
- // "forwardingRule": {
- // "description": "Name of the ForwardingRule resource to patch.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/forwardingRules/{forwardingRule}",
- // "request": {
- // "$ref": "ForwardingRule"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.globalForwardingRules.setLabels":
-
-type GlobalForwardingRulesSetLabelsCall struct {
- s *Service
- project string
- resource string
- globalsetlabelsrequest *GlobalSetLabelsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetLabels: Sets the labels on the specified resource. To learn more
-// about labels, read the Labeling resources documentation.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-func (r *GlobalForwardingRulesService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *GlobalForwardingRulesSetLabelsCall {
- c := &GlobalForwardingRulesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.resource = resource
- c.globalsetlabelsrequest = globalsetlabelsrequest
- 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 *GlobalForwardingRulesSetLabelsCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesSetLabelsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *GlobalForwardingRulesSetLabelsCall) Context(ctx context.Context) *GlobalForwardingRulesSetLabelsCall {
- 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 *GlobalForwardingRulesSetLabelsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *GlobalForwardingRulesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/forwardingRules/{resource}/setLabels")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.globalForwardingRules.setLabels" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *GlobalForwardingRulesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Sets the labels on the specified resource. To learn more about labels, read the Labeling resources documentation.",
- // "flatPath": "projects/{project}/global/forwardingRules/{resource}/setLabels",
- // "httpMethod": "POST",
- // "id": "compute.globalForwardingRules.setLabels",
- // "parameterOrder": [
- // "project",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/forwardingRules/{resource}/setLabels",
- // "request": {
- // "$ref": "GlobalSetLabelsRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.globalForwardingRules.setTarget":
-
-type GlobalForwardingRulesSetTargetCall struct {
- s *Service
- project string
- forwardingRule string
- targetreference *TargetReference
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetTarget: Changes target URL for the GlobalForwardingRule resource.
-// The new target should be of the same type as the old target.
-//
-// - forwardingRule: Name of the ForwardingRule resource in which target
-// is to be set.
-// - project: Project ID for this request.
-func (r *GlobalForwardingRulesService) SetTarget(project string, forwardingRule string, targetreference *TargetReference) *GlobalForwardingRulesSetTargetCall {
- c := &GlobalForwardingRulesSetTargetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.forwardingRule = forwardingRule
- c.targetreference = targetreference
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *GlobalForwardingRulesSetTargetCall) RequestId(requestId string) *GlobalForwardingRulesSetTargetCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *GlobalForwardingRulesSetTargetCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesSetTargetCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *GlobalForwardingRulesSetTargetCall) Context(ctx context.Context) *GlobalForwardingRulesSetTargetCall {
- 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 *GlobalForwardingRulesSetTargetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *GlobalForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/forwardingRules/{forwardingRule}/setTarget")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "forwardingRule": c.forwardingRule,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.globalForwardingRules.setTarget" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *GlobalForwardingRulesSetTargetCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target.",
- // "flatPath": "projects/{project}/global/forwardingRules/{forwardingRule}/setTarget",
- // "httpMethod": "POST",
- // "id": "compute.globalForwardingRules.setTarget",
- // "parameterOrder": [
- // "project",
- // "forwardingRule"
- // ],
- // "parameters": {
- // "forwardingRule": {
- // "description": "Name of the ForwardingRule resource in which target is to be set.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/forwardingRules/{forwardingRule}/setTarget",
- // "request": {
- // "$ref": "TargetReference"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.globalNetworkEndpointGroups.attachNetworkEndpoints":
-
-type GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall struct {
- s *Service
- project string
- networkEndpointGroup string
- globalnetworkendpointgroupsattachendpointsrequest *GlobalNetworkEndpointGroupsAttachEndpointsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// AttachNetworkEndpoints: Attach a network endpoint to the specified
-// network endpoint group.
-//
-// - networkEndpointGroup: The name of the network endpoint group where
-// you are attaching network endpoints to. It should comply with
-// RFC1035.
-// - project: Project ID for this request.
-func (r *GlobalNetworkEndpointGroupsService) AttachNetworkEndpoints(project string, networkEndpointGroup string, globalnetworkendpointgroupsattachendpointsrequest *GlobalNetworkEndpointGroupsAttachEndpointsRequest) *GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall {
- c := &GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.networkEndpointGroup = networkEndpointGroup
- c.globalnetworkendpointgroupsattachendpointsrequest = globalnetworkendpointgroupsattachendpointsrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall) RequestId(requestId string) *GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall) Fields(s ...googleapi.Field) *GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall) Context(ctx context.Context) *GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall {
- 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 *GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalnetworkendpointgroupsattachendpointsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networkEndpointGroups/{networkEndpointGroup}/attachNetworkEndpoints")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "networkEndpointGroup": c.networkEndpointGroup,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.globalNetworkEndpointGroups.attachNetworkEndpoints" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Attach a network endpoint to the specified network endpoint group.",
- // "flatPath": "projects/{project}/global/networkEndpointGroups/{networkEndpointGroup}/attachNetworkEndpoints",
- // "httpMethod": "POST",
- // "id": "compute.globalNetworkEndpointGroups.attachNetworkEndpoints",
- // "parameterOrder": [
- // "project",
- // "networkEndpointGroup"
- // ],
- // "parameters": {
- // "networkEndpointGroup": {
- // "description": "The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/networkEndpointGroups/{networkEndpointGroup}/attachNetworkEndpoints",
- // "request": {
- // "$ref": "GlobalNetworkEndpointGroupsAttachEndpointsRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.globalNetworkEndpointGroups.delete":
-
-type GlobalNetworkEndpointGroupsDeleteCall struct {
- s *Service
- project string
- networkEndpointGroup string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified network endpoint group.Note that the
-// NEG cannot be deleted if there are backend services referencing it.
-//
-// - networkEndpointGroup: The name of the network endpoint group to
-// delete. It should comply with RFC1035.
-// - project: Project ID for this request.
-func (r *GlobalNetworkEndpointGroupsService) Delete(project string, networkEndpointGroup string) *GlobalNetworkEndpointGroupsDeleteCall {
- c := &GlobalNetworkEndpointGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.networkEndpointGroup = networkEndpointGroup
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *GlobalNetworkEndpointGroupsDeleteCall) RequestId(requestId string) *GlobalNetworkEndpointGroupsDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *GlobalNetworkEndpointGroupsDeleteCall) Fields(s ...googleapi.Field) *GlobalNetworkEndpointGroupsDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *GlobalNetworkEndpointGroupsDeleteCall) Context(ctx context.Context) *GlobalNetworkEndpointGroupsDeleteCall {
- 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 *GlobalNetworkEndpointGroupsDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *GlobalNetworkEndpointGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networkEndpointGroups/{networkEndpointGroup}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "networkEndpointGroup": c.networkEndpointGroup,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.globalNetworkEndpointGroups.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *GlobalNetworkEndpointGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified network endpoint group.Note that the NEG cannot be deleted if there are backend services referencing it.",
- // "flatPath": "projects/{project}/global/networkEndpointGroups/{networkEndpointGroup}",
- // "httpMethod": "DELETE",
- // "id": "compute.globalNetworkEndpointGroups.delete",
- // "parameterOrder": [
- // "project",
- // "networkEndpointGroup"
- // ],
- // "parameters": {
- // "networkEndpointGroup": {
- // "description": "The name of the network endpoint group to delete. It should comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/networkEndpointGroups/{networkEndpointGroup}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.globalNetworkEndpointGroups.detachNetworkEndpoints":
-
-type GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall struct {
- s *Service
- project string
- networkEndpointGroup string
- globalnetworkendpointgroupsdetachendpointsrequest *GlobalNetworkEndpointGroupsDetachEndpointsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// DetachNetworkEndpoints: Detach the network endpoint from the
-// specified network endpoint group.
-//
-// - networkEndpointGroup: The name of the network endpoint group where
-// you are removing network endpoints. It should comply with RFC1035.
-// - project: Project ID for this request.
-func (r *GlobalNetworkEndpointGroupsService) DetachNetworkEndpoints(project string, networkEndpointGroup string, globalnetworkendpointgroupsdetachendpointsrequest *GlobalNetworkEndpointGroupsDetachEndpointsRequest) *GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall {
- c := &GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.networkEndpointGroup = networkEndpointGroup
- c.globalnetworkendpointgroupsdetachendpointsrequest = globalnetworkendpointgroupsdetachendpointsrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall) RequestId(requestId string) *GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall) Fields(s ...googleapi.Field) *GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall) Context(ctx context.Context) *GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall {
- 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 *GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalnetworkendpointgroupsdetachendpointsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networkEndpointGroups/{networkEndpointGroup}/detachNetworkEndpoints")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "networkEndpointGroup": c.networkEndpointGroup,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.globalNetworkEndpointGroups.detachNetworkEndpoints" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Detach the network endpoint from the specified network endpoint group.",
- // "flatPath": "projects/{project}/global/networkEndpointGroups/{networkEndpointGroup}/detachNetworkEndpoints",
- // "httpMethod": "POST",
- // "id": "compute.globalNetworkEndpointGroups.detachNetworkEndpoints",
- // "parameterOrder": [
- // "project",
- // "networkEndpointGroup"
- // ],
- // "parameters": {
- // "networkEndpointGroup": {
- // "description": "The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/networkEndpointGroups/{networkEndpointGroup}/detachNetworkEndpoints",
- // "request": {
- // "$ref": "GlobalNetworkEndpointGroupsDetachEndpointsRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.globalNetworkEndpointGroups.get":
-
-type GlobalNetworkEndpointGroupsGetCall struct {
- s *Service
- project string
- networkEndpointGroup string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified network endpoint group.
-//
-// - networkEndpointGroup: The name of the network endpoint group. It
-// should comply with RFC1035.
-// - project: Project ID for this request.
-func (r *GlobalNetworkEndpointGroupsService) Get(project string, networkEndpointGroup string) *GlobalNetworkEndpointGroupsGetCall {
- c := &GlobalNetworkEndpointGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.networkEndpointGroup = networkEndpointGroup
- 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 *GlobalNetworkEndpointGroupsGetCall) Fields(s ...googleapi.Field) *GlobalNetworkEndpointGroupsGetCall {
- 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 *GlobalNetworkEndpointGroupsGetCall) IfNoneMatch(entityTag string) *GlobalNetworkEndpointGroupsGetCall {
- 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 *GlobalNetworkEndpointGroupsGetCall) Context(ctx context.Context) *GlobalNetworkEndpointGroupsGetCall {
- 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 *GlobalNetworkEndpointGroupsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *GlobalNetworkEndpointGroupsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/networkEndpointGroups/{networkEndpointGroup}")
- 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{
- "project": c.project,
- "networkEndpointGroup": c.networkEndpointGroup,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.globalNetworkEndpointGroups.get" call.
-// Exactly one of *NetworkEndpointGroup or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *NetworkEndpointGroup.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 *GlobalNetworkEndpointGroupsGetCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroup, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &NetworkEndpointGroup{
- 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": "Returns the specified network endpoint group.",
- // "flatPath": "projects/{project}/global/networkEndpointGroups/{networkEndpointGroup}",
- // "httpMethod": "GET",
- // "id": "compute.globalNetworkEndpointGroups.get",
- // "parameterOrder": [
- // "project",
- // "networkEndpointGroup"
- // ],
- // "parameters": {
- // "networkEndpointGroup": {
- // "description": "The name of the network endpoint group. It should comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/networkEndpointGroups/{networkEndpointGroup}",
- // "response": {
- // "$ref": "NetworkEndpointGroup"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.globalNetworkEndpointGroups.insert":
-
-type GlobalNetworkEndpointGroupsInsertCall struct {
- s *Service
- project string
- networkendpointgroup *NetworkEndpointGroup
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a network endpoint group in the specified project
-// using the parameters that are included in the request.
-//
-// - project: Project ID for this request.
-func (r *GlobalNetworkEndpointGroupsService) Insert(project string, networkendpointgroup *NetworkEndpointGroup) *GlobalNetworkEndpointGroupsInsertCall {
- c := &GlobalNetworkEndpointGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.networkendpointgroup = networkendpointgroup
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *GlobalNetworkEndpointGroupsInsertCall) RequestId(requestId string) *GlobalNetworkEndpointGroupsInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *GlobalNetworkEndpointGroupsInsertCall) Fields(s ...googleapi.Field) *GlobalNetworkEndpointGroupsInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *GlobalNetworkEndpointGroupsInsertCall) Context(ctx context.Context) *GlobalNetworkEndpointGroupsInsertCall {
- 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 *GlobalNetworkEndpointGroupsInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *GlobalNetworkEndpointGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroup)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networkEndpointGroups")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.globalNetworkEndpointGroups.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *GlobalNetworkEndpointGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a network endpoint group in the specified project using the parameters that are included in the request.",
- // "flatPath": "projects/{project}/global/networkEndpointGroups",
- // "httpMethod": "POST",
- // "id": "compute.globalNetworkEndpointGroups.insert",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/networkEndpointGroups",
- // "request": {
- // "$ref": "NetworkEndpointGroup"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.globalNetworkEndpointGroups.list":
-
-type GlobalNetworkEndpointGroupsListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves the list of network endpoint groups that are located
-// in the specified project.
-//
-// - project: Project ID for this request.
-func (r *GlobalNetworkEndpointGroupsService) List(project string) *GlobalNetworkEndpointGroupsListCall {
- c := &GlobalNetworkEndpointGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *GlobalNetworkEndpointGroupsListCall) Filter(filter string) *GlobalNetworkEndpointGroupsListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *GlobalNetworkEndpointGroupsListCall) MaxResults(maxResults int64) *GlobalNetworkEndpointGroupsListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *GlobalNetworkEndpointGroupsListCall) OrderBy(orderBy string) *GlobalNetworkEndpointGroupsListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *GlobalNetworkEndpointGroupsListCall) PageToken(pageToken string) *GlobalNetworkEndpointGroupsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *GlobalNetworkEndpointGroupsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *GlobalNetworkEndpointGroupsListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *GlobalNetworkEndpointGroupsListCall) Fields(s ...googleapi.Field) *GlobalNetworkEndpointGroupsListCall {
- 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 *GlobalNetworkEndpointGroupsListCall) IfNoneMatch(entityTag string) *GlobalNetworkEndpointGroupsListCall {
- 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 *GlobalNetworkEndpointGroupsListCall) Context(ctx context.Context) *GlobalNetworkEndpointGroupsListCall {
- 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 *GlobalNetworkEndpointGroupsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *GlobalNetworkEndpointGroupsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/networkEndpointGroups")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.globalNetworkEndpointGroups.list" call.
-// Exactly one of *NetworkEndpointGroupList or error will be non-nil.
-// Any non-2xx status code is an error. Response headers are in either
-// *NetworkEndpointGroupList.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 *GlobalNetworkEndpointGroupsListCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &NetworkEndpointGroupList{
- 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": "Retrieves the list of network endpoint groups that are located in the specified project.",
- // "flatPath": "projects/{project}/global/networkEndpointGroups",
- // "httpMethod": "GET",
- // "id": "compute.globalNetworkEndpointGroups.list",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/networkEndpointGroups",
- // "response": {
- // "$ref": "NetworkEndpointGroupList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *GlobalNetworkEndpointGroupsListCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupList) 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 "compute.globalNetworkEndpointGroups.listNetworkEndpoints":
-
-type GlobalNetworkEndpointGroupsListNetworkEndpointsCall struct {
- s *Service
- project string
- networkEndpointGroup string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// ListNetworkEndpoints: Lists the network endpoints in the specified
-// network endpoint group.
-//
-// - networkEndpointGroup: The name of the network endpoint group from
-// which you want to generate a list of included network endpoints. It
-// should comply with RFC1035.
-// - project: Project ID for this request.
-func (r *GlobalNetworkEndpointGroupsService) ListNetworkEndpoints(project string, networkEndpointGroup string) *GlobalNetworkEndpointGroupsListNetworkEndpointsCall {
- c := &GlobalNetworkEndpointGroupsListNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.networkEndpointGroup = networkEndpointGroup
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *GlobalNetworkEndpointGroupsListNetworkEndpointsCall) Filter(filter string) *GlobalNetworkEndpointGroupsListNetworkEndpointsCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *GlobalNetworkEndpointGroupsListNetworkEndpointsCall) MaxResults(maxResults int64) *GlobalNetworkEndpointGroupsListNetworkEndpointsCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *GlobalNetworkEndpointGroupsListNetworkEndpointsCall) OrderBy(orderBy string) *GlobalNetworkEndpointGroupsListNetworkEndpointsCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *GlobalNetworkEndpointGroupsListNetworkEndpointsCall) PageToken(pageToken string) *GlobalNetworkEndpointGroupsListNetworkEndpointsCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *GlobalNetworkEndpointGroupsListNetworkEndpointsCall) ReturnPartialSuccess(returnPartialSuccess bool) *GlobalNetworkEndpointGroupsListNetworkEndpointsCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *GlobalNetworkEndpointGroupsListNetworkEndpointsCall) Fields(s ...googleapi.Field) *GlobalNetworkEndpointGroupsListNetworkEndpointsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *GlobalNetworkEndpointGroupsListNetworkEndpointsCall) Context(ctx context.Context) *GlobalNetworkEndpointGroupsListNetworkEndpointsCall {
- 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 *GlobalNetworkEndpointGroupsListNetworkEndpointsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *GlobalNetworkEndpointGroupsListNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networkEndpointGroups/{networkEndpointGroup}/listNetworkEndpoints")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "networkEndpointGroup": c.networkEndpointGroup,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.globalNetworkEndpointGroups.listNetworkEndpoints" call.
-// Exactly one of *NetworkEndpointGroupsListNetworkEndpoints or error
-// will be non-nil. Any non-2xx status code is an error. Response
-// headers are in either
-// *NetworkEndpointGroupsListNetworkEndpoints.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 *GlobalNetworkEndpointGroupsListNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupsListNetworkEndpoints, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &NetworkEndpointGroupsListNetworkEndpoints{
- 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": "Lists the network endpoints in the specified network endpoint group.",
- // "flatPath": "projects/{project}/global/networkEndpointGroups/{networkEndpointGroup}/listNetworkEndpoints",
- // "httpMethod": "POST",
- // "id": "compute.globalNetworkEndpointGroups.listNetworkEndpoints",
- // "parameterOrder": [
- // "project",
- // "networkEndpointGroup"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "networkEndpointGroup": {
- // "description": "The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/networkEndpointGroups/{networkEndpointGroup}/listNetworkEndpoints",
- // "response": {
- // "$ref": "NetworkEndpointGroupsListNetworkEndpoints"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *GlobalNetworkEndpointGroupsListNetworkEndpointsCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupsListNetworkEndpoints) 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 "compute.globalOperations.aggregatedList":
-
-type GlobalOperationsAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Retrieves an aggregated list of all operations.
-//
-// - project: Project ID for this request.
-func (r *GlobalOperationsService) AggregatedList(project string) *GlobalOperationsAggregatedListCall {
- c := &GlobalOperationsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *GlobalOperationsAggregatedListCall) Filter(filter string) *GlobalOperationsAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *GlobalOperationsAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *GlobalOperationsAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *GlobalOperationsAggregatedListCall) MaxResults(maxResults int64) *GlobalOperationsAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *GlobalOperationsAggregatedListCall) OrderBy(orderBy string) *GlobalOperationsAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *GlobalOperationsAggregatedListCall) PageToken(pageToken string) *GlobalOperationsAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *GlobalOperationsAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *GlobalOperationsAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *GlobalOperationsAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *GlobalOperationsAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *GlobalOperationsAggregatedListCall) Fields(s ...googleapi.Field) *GlobalOperationsAggregatedListCall {
- 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 *GlobalOperationsAggregatedListCall) IfNoneMatch(entityTag string) *GlobalOperationsAggregatedListCall {
- 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 *GlobalOperationsAggregatedListCall) Context(ctx context.Context) *GlobalOperationsAggregatedListCall {
- 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 *GlobalOperationsAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *GlobalOperationsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/operations")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.globalOperations.aggregatedList" call.
-// Exactly one of *OperationAggregatedList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *OperationAggregatedList.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 *GlobalOperationsAggregatedListCall) Do(opts ...googleapi.CallOption) (*OperationAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &OperationAggregatedList{
- 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": "Retrieves an aggregated list of all operations.",
- // "flatPath": "projects/{project}/aggregated/operations",
- // "httpMethod": "GET",
- // "id": "compute.globalOperations.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/operations",
- // "response": {
- // "$ref": "OperationAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *GlobalOperationsAggregatedListCall) Pages(ctx context.Context, f func(*OperationAggregatedList) 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 "compute.globalOperations.delete":
-
-type GlobalOperationsDeleteCall struct {
- s *Service
- project string
- operation string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified Operations resource.
-//
-// - operation: Name of the Operations resource to delete.
-// - project: Project ID for this request.
-func (r *GlobalOperationsService) Delete(project string, operation string) *GlobalOperationsDeleteCall {
- c := &GlobalOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.operation = operation
- 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 *GlobalOperationsDeleteCall) Fields(s ...googleapi.Field) *GlobalOperationsDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *GlobalOperationsDeleteCall) Context(ctx context.Context) *GlobalOperationsDeleteCall {
- 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 *GlobalOperationsDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *GlobalOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/operations/{operation}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "operation": c.operation,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.globalOperations.delete" call.
-func (c *GlobalOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if err != nil {
- return err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return gensupport.WrapError(err)
- }
- return nil
- // {
- // "description": "Deletes the specified Operations resource.",
- // "flatPath": "projects/{project}/global/operations/{operation}",
- // "httpMethod": "DELETE",
- // "id": "compute.globalOperations.delete",
- // "parameterOrder": [
- // "project",
- // "operation"
- // ],
- // "parameters": {
- // "operation": {
- // "description": "Name of the Operations resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/operations/{operation}",
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.globalOperations.get":
-
-type GlobalOperationsGetCall struct {
- s *Service
- project string
- operation string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Retrieves the specified Operations resource.
-//
-// - operation: Name of the Operations resource to return.
-// - project: Project ID for this request.
-func (r *GlobalOperationsService) Get(project string, operation string) *GlobalOperationsGetCall {
- c := &GlobalOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.operation = operation
- 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 *GlobalOperationsGetCall) Fields(s ...googleapi.Field) *GlobalOperationsGetCall {
- 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 *GlobalOperationsGetCall) IfNoneMatch(entityTag string) *GlobalOperationsGetCall {
- 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 *GlobalOperationsGetCall) Context(ctx context.Context) *GlobalOperationsGetCall {
- 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 *GlobalOperationsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *GlobalOperationsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/operations/{operation}")
- 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{
- "project": c.project,
- "operation": c.operation,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.globalOperations.get" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *GlobalOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Retrieves the specified Operations resource.",
- // "flatPath": "projects/{project}/global/operations/{operation}",
- // "httpMethod": "GET",
- // "id": "compute.globalOperations.get",
- // "parameterOrder": [
- // "project",
- // "operation"
- // ],
- // "parameters": {
- // "operation": {
- // "description": "Name of the Operations resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/operations/{operation}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.globalOperations.list":
-
-type GlobalOperationsListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves a list of Operation resources contained within the
-// specified project.
-//
-// - project: Project ID for this request.
-func (r *GlobalOperationsService) List(project string) *GlobalOperationsListCall {
- c := &GlobalOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *GlobalOperationsListCall) Filter(filter string) *GlobalOperationsListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *GlobalOperationsListCall) MaxResults(maxResults int64) *GlobalOperationsListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *GlobalOperationsListCall) OrderBy(orderBy string) *GlobalOperationsListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *GlobalOperationsListCall) PageToken(pageToken string) *GlobalOperationsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *GlobalOperationsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *GlobalOperationsListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *GlobalOperationsListCall) Fields(s ...googleapi.Field) *GlobalOperationsListCall {
- 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 *GlobalOperationsListCall) IfNoneMatch(entityTag string) *GlobalOperationsListCall {
- 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 *GlobalOperationsListCall) Context(ctx context.Context) *GlobalOperationsListCall {
- 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 *GlobalOperationsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *GlobalOperationsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/operations")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.globalOperations.list" call.
-// Exactly one of *OperationList or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *OperationList.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 *GlobalOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &OperationList{
- 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": "Retrieves a list of Operation resources contained within the specified project.",
- // "flatPath": "projects/{project}/global/operations",
- // "httpMethod": "GET",
- // "id": "compute.globalOperations.list",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/operations",
- // "response": {
- // "$ref": "OperationList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *GlobalOperationsListCall) Pages(ctx context.Context, f func(*OperationList) 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 "compute.globalOperations.wait":
-
-type GlobalOperationsWaitCall struct {
- s *Service
- project string
- operation string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Wait: Waits for the specified Operation resource to return as `DONE`
-// or for the request to approach the 2 minute deadline, and retrieves
-// the specified Operation resource. This method differs from the `GET`
-// method in that it waits for no more than the default deadline (2
-// minutes) and then returns the current state of the operation, which
-// might be `DONE` or still in progress. This method is called on a
-// best-effort basis. Specifically: - In uncommon cases, when the server
-// is overloaded, the request might return before the default deadline
-// is reached, or might return after zero seconds. - If the default
-// deadline is reached, there is no guarantee that the operation is
-// actually done when the method returns. Be prepared to retry if the
-// operation is not `DONE`.
-//
-// - operation: Name of the Operations resource to return.
-// - project: Project ID for this request.
-func (r *GlobalOperationsService) Wait(project string, operation string) *GlobalOperationsWaitCall {
- c := &GlobalOperationsWaitCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.operation = operation
- 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 *GlobalOperationsWaitCall) Fields(s ...googleapi.Field) *GlobalOperationsWaitCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *GlobalOperationsWaitCall) Context(ctx context.Context) *GlobalOperationsWaitCall {
- 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 *GlobalOperationsWaitCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *GlobalOperationsWaitCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/operations/{operation}/wait")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "operation": c.operation,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.globalOperations.wait" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *GlobalOperationsWaitCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the `GET` method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be `DONE` or still in progress. This method is called on a best-effort basis. Specifically: - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not `DONE`. ",
- // "flatPath": "projects/{project}/global/operations/{operation}/wait",
- // "httpMethod": "POST",
- // "id": "compute.globalOperations.wait",
- // "parameterOrder": [
- // "project",
- // "operation"
- // ],
- // "parameters": {
- // "operation": {
- // "description": "Name of the Operations resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/operations/{operation}/wait",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.globalOrganizationOperations.delete":
-
-type GlobalOrganizationOperationsDeleteCall struct {
- s *Service
- operation string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified Operations resource.
-//
-// - operation: Name of the Operations resource to delete.
-func (r *GlobalOrganizationOperationsService) Delete(operation string) *GlobalOrganizationOperationsDeleteCall {
- c := &GlobalOrganizationOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.operation = operation
- return c
-}
-
-// ParentId sets the optional parameter "parentId": Parent ID for this
-// request.
-func (c *GlobalOrganizationOperationsDeleteCall) ParentId(parentId string) *GlobalOrganizationOperationsDeleteCall {
- c.urlParams_.Set("parentId", parentId)
- 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 *GlobalOrganizationOperationsDeleteCall) Fields(s ...googleapi.Field) *GlobalOrganizationOperationsDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *GlobalOrganizationOperationsDeleteCall) Context(ctx context.Context) *GlobalOrganizationOperationsDeleteCall {
- 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 *GlobalOrganizationOperationsDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *GlobalOrganizationOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/operations/{operation}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "operation": c.operation,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.globalOrganizationOperations.delete" call.
-func (c *GlobalOrganizationOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if err != nil {
- return err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return gensupport.WrapError(err)
- }
- return nil
- // {
- // "description": "Deletes the specified Operations resource.",
- // "flatPath": "locations/global/operations/{operation}",
- // "httpMethod": "DELETE",
- // "id": "compute.globalOrganizationOperations.delete",
- // "parameterOrder": [
- // "operation"
- // ],
- // "parameters": {
- // "operation": {
- // "description": "Name of the Operations resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "parentId": {
- // "description": "Parent ID for this request.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "locations/global/operations/{operation}",
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.globalOrganizationOperations.get":
-
-type GlobalOrganizationOperationsGetCall struct {
- s *Service
- operation string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Retrieves the specified Operations resource. Gets a list of
-// operations by making a `list()` request.
-//
-// - operation: Name of the Operations resource to return.
-func (r *GlobalOrganizationOperationsService) Get(operation string) *GlobalOrganizationOperationsGetCall {
- c := &GlobalOrganizationOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.operation = operation
- return c
-}
-
-// ParentId sets the optional parameter "parentId": Parent ID for this
-// request.
-func (c *GlobalOrganizationOperationsGetCall) ParentId(parentId string) *GlobalOrganizationOperationsGetCall {
- c.urlParams_.Set("parentId", parentId)
- 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 *GlobalOrganizationOperationsGetCall) Fields(s ...googleapi.Field) *GlobalOrganizationOperationsGetCall {
- 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 *GlobalOrganizationOperationsGetCall) IfNoneMatch(entityTag string) *GlobalOrganizationOperationsGetCall {
- 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 *GlobalOrganizationOperationsGetCall) Context(ctx context.Context) *GlobalOrganizationOperationsGetCall {
- 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 *GlobalOrganizationOperationsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *GlobalOrganizationOperationsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "locations/global/operations/{operation}")
- 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{
- "operation": c.operation,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.globalOrganizationOperations.get" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *GlobalOrganizationOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Retrieves the specified Operations resource. Gets a list of operations by making a `list()` request.",
- // "flatPath": "locations/global/operations/{operation}",
- // "httpMethod": "GET",
- // "id": "compute.globalOrganizationOperations.get",
- // "parameterOrder": [
- // "operation"
- // ],
- // "parameters": {
- // "operation": {
- // "description": "Name of the Operations resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "parentId": {
- // "description": "Parent ID for this request.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "locations/global/operations/{operation}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.globalOrganizationOperations.list":
-
-type GlobalOrganizationOperationsListCall struct {
- s *Service
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves a list of Operation resources contained within the
-// specified organization.
-func (r *GlobalOrganizationOperationsService) List() *GlobalOrganizationOperationsListCall {
- c := &GlobalOrganizationOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *GlobalOrganizationOperationsListCall) Filter(filter string) *GlobalOrganizationOperationsListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *GlobalOrganizationOperationsListCall) MaxResults(maxResults int64) *GlobalOrganizationOperationsListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *GlobalOrganizationOperationsListCall) OrderBy(orderBy string) *GlobalOrganizationOperationsListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *GlobalOrganizationOperationsListCall) PageToken(pageToken string) *GlobalOrganizationOperationsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ParentId sets the optional parameter "parentId": Parent ID for this
-// request.
-func (c *GlobalOrganizationOperationsListCall) ParentId(parentId string) *GlobalOrganizationOperationsListCall {
- c.urlParams_.Set("parentId", parentId)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *GlobalOrganizationOperationsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *GlobalOrganizationOperationsListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *GlobalOrganizationOperationsListCall) Fields(s ...googleapi.Field) *GlobalOrganizationOperationsListCall {
- 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 *GlobalOrganizationOperationsListCall) IfNoneMatch(entityTag string) *GlobalOrganizationOperationsListCall {
- 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 *GlobalOrganizationOperationsListCall) Context(ctx context.Context) *GlobalOrganizationOperationsListCall {
- 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 *GlobalOrganizationOperationsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *GlobalOrganizationOperationsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "locations/global/operations")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("GET", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.globalOrganizationOperations.list" call.
-// Exactly one of *OperationList or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *OperationList.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 *GlobalOrganizationOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &OperationList{
- 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": "Retrieves a list of Operation resources contained within the specified organization.",
- // "flatPath": "locations/global/operations",
- // "httpMethod": "GET",
- // "id": "compute.globalOrganizationOperations.list",
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "parentId": {
- // "description": "Parent ID for this request.",
- // "location": "query",
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "locations/global/operations",
- // "response": {
- // "$ref": "OperationList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *GlobalOrganizationOperationsListCall) Pages(ctx context.Context, f func(*OperationList) 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 "compute.globalPublicDelegatedPrefixes.delete":
-
-type GlobalPublicDelegatedPrefixesDeleteCall struct {
- s *Service
- project string
- publicDelegatedPrefix string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified global PublicDelegatedPrefix.
-//
-// - project: Project ID for this request.
-// - publicDelegatedPrefix: Name of the PublicDelegatedPrefix resource
-// to delete.
-func (r *GlobalPublicDelegatedPrefixesService) Delete(project string, publicDelegatedPrefix string) *GlobalPublicDelegatedPrefixesDeleteCall {
- c := &GlobalPublicDelegatedPrefixesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.publicDelegatedPrefix = publicDelegatedPrefix
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *GlobalPublicDelegatedPrefixesDeleteCall) RequestId(requestId string) *GlobalPublicDelegatedPrefixesDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *GlobalPublicDelegatedPrefixesDeleteCall) Fields(s ...googleapi.Field) *GlobalPublicDelegatedPrefixesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *GlobalPublicDelegatedPrefixesDeleteCall) Context(ctx context.Context) *GlobalPublicDelegatedPrefixesDeleteCall {
- 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 *GlobalPublicDelegatedPrefixesDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *GlobalPublicDelegatedPrefixesDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicDelegatedPrefixes/{publicDelegatedPrefix}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "publicDelegatedPrefix": c.publicDelegatedPrefix,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.globalPublicDelegatedPrefixes.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *GlobalPublicDelegatedPrefixesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified global PublicDelegatedPrefix.",
- // "flatPath": "projects/{project}/global/publicDelegatedPrefixes/{publicDelegatedPrefix}",
- // "httpMethod": "DELETE",
- // "id": "compute.globalPublicDelegatedPrefixes.delete",
- // "parameterOrder": [
- // "project",
- // "publicDelegatedPrefix"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "publicDelegatedPrefix": {
- // "description": "Name of the PublicDelegatedPrefix resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/publicDelegatedPrefixes/{publicDelegatedPrefix}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.globalPublicDelegatedPrefixes.get":
-
-type GlobalPublicDelegatedPrefixesGetCall struct {
- s *Service
- project string
- publicDelegatedPrefix string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified global PublicDelegatedPrefix resource.
-//
-// - project: Project ID for this request.
-// - publicDelegatedPrefix: Name of the PublicDelegatedPrefix resource
-// to return.
-func (r *GlobalPublicDelegatedPrefixesService) Get(project string, publicDelegatedPrefix string) *GlobalPublicDelegatedPrefixesGetCall {
- c := &GlobalPublicDelegatedPrefixesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.publicDelegatedPrefix = publicDelegatedPrefix
- 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 *GlobalPublicDelegatedPrefixesGetCall) Fields(s ...googleapi.Field) *GlobalPublicDelegatedPrefixesGetCall {
- 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 *GlobalPublicDelegatedPrefixesGetCall) IfNoneMatch(entityTag string) *GlobalPublicDelegatedPrefixesGetCall {
- 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 *GlobalPublicDelegatedPrefixesGetCall) Context(ctx context.Context) *GlobalPublicDelegatedPrefixesGetCall {
- 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 *GlobalPublicDelegatedPrefixesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *GlobalPublicDelegatedPrefixesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/publicDelegatedPrefixes/{publicDelegatedPrefix}")
- 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{
- "project": c.project,
- "publicDelegatedPrefix": c.publicDelegatedPrefix,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.globalPublicDelegatedPrefixes.get" call.
-// Exactly one of *PublicDelegatedPrefix or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *PublicDelegatedPrefix.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 *GlobalPublicDelegatedPrefixesGetCall) Do(opts ...googleapi.CallOption) (*PublicDelegatedPrefix, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &PublicDelegatedPrefix{
- 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": "Returns the specified global PublicDelegatedPrefix resource.",
- // "flatPath": "projects/{project}/global/publicDelegatedPrefixes/{publicDelegatedPrefix}",
- // "httpMethod": "GET",
- // "id": "compute.globalPublicDelegatedPrefixes.get",
- // "parameterOrder": [
- // "project",
- // "publicDelegatedPrefix"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "publicDelegatedPrefix": {
- // "description": "Name of the PublicDelegatedPrefix resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/publicDelegatedPrefixes/{publicDelegatedPrefix}",
- // "response": {
- // "$ref": "PublicDelegatedPrefix"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.globalPublicDelegatedPrefixes.insert":
-
-type GlobalPublicDelegatedPrefixesInsertCall struct {
- s *Service
- project string
- publicdelegatedprefix *PublicDelegatedPrefix
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a global PublicDelegatedPrefix in the specified
-// project using the parameters that are included in the request.
-//
-// - project: Project ID for this request.
-func (r *GlobalPublicDelegatedPrefixesService) Insert(project string, publicdelegatedprefix *PublicDelegatedPrefix) *GlobalPublicDelegatedPrefixesInsertCall {
- c := &GlobalPublicDelegatedPrefixesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.publicdelegatedprefix = publicdelegatedprefix
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *GlobalPublicDelegatedPrefixesInsertCall) RequestId(requestId string) *GlobalPublicDelegatedPrefixesInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *GlobalPublicDelegatedPrefixesInsertCall) Fields(s ...googleapi.Field) *GlobalPublicDelegatedPrefixesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *GlobalPublicDelegatedPrefixesInsertCall) Context(ctx context.Context) *GlobalPublicDelegatedPrefixesInsertCall {
- 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 *GlobalPublicDelegatedPrefixesInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *GlobalPublicDelegatedPrefixesInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.publicdelegatedprefix)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicDelegatedPrefixes")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.globalPublicDelegatedPrefixes.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *GlobalPublicDelegatedPrefixesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a global PublicDelegatedPrefix in the specified project using the parameters that are included in the request.",
- // "flatPath": "projects/{project}/global/publicDelegatedPrefixes",
- // "httpMethod": "POST",
- // "id": "compute.globalPublicDelegatedPrefixes.insert",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/publicDelegatedPrefixes",
- // "request": {
- // "$ref": "PublicDelegatedPrefix"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.globalPublicDelegatedPrefixes.list":
-
-type GlobalPublicDelegatedPrefixesListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Lists the global PublicDelegatedPrefixes for a project.
-//
-// - project: Project ID for this request.
-func (r *GlobalPublicDelegatedPrefixesService) List(project string) *GlobalPublicDelegatedPrefixesListCall {
- c := &GlobalPublicDelegatedPrefixesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *GlobalPublicDelegatedPrefixesListCall) Filter(filter string) *GlobalPublicDelegatedPrefixesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *GlobalPublicDelegatedPrefixesListCall) MaxResults(maxResults int64) *GlobalPublicDelegatedPrefixesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *GlobalPublicDelegatedPrefixesListCall) OrderBy(orderBy string) *GlobalPublicDelegatedPrefixesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *GlobalPublicDelegatedPrefixesListCall) PageToken(pageToken string) *GlobalPublicDelegatedPrefixesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *GlobalPublicDelegatedPrefixesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *GlobalPublicDelegatedPrefixesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *GlobalPublicDelegatedPrefixesListCall) Fields(s ...googleapi.Field) *GlobalPublicDelegatedPrefixesListCall {
- 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 *GlobalPublicDelegatedPrefixesListCall) IfNoneMatch(entityTag string) *GlobalPublicDelegatedPrefixesListCall {
- 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 *GlobalPublicDelegatedPrefixesListCall) Context(ctx context.Context) *GlobalPublicDelegatedPrefixesListCall {
- 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 *GlobalPublicDelegatedPrefixesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *GlobalPublicDelegatedPrefixesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/publicDelegatedPrefixes")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.globalPublicDelegatedPrefixes.list" call.
-// Exactly one of *PublicDelegatedPrefixList or error will be non-nil.
-// Any non-2xx status code is an error. Response headers are in either
-// *PublicDelegatedPrefixList.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 *GlobalPublicDelegatedPrefixesListCall) Do(opts ...googleapi.CallOption) (*PublicDelegatedPrefixList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &PublicDelegatedPrefixList{
- 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": "Lists the global PublicDelegatedPrefixes for a project.",
- // "flatPath": "projects/{project}/global/publicDelegatedPrefixes",
- // "httpMethod": "GET",
- // "id": "compute.globalPublicDelegatedPrefixes.list",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/publicDelegatedPrefixes",
- // "response": {
- // "$ref": "PublicDelegatedPrefixList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *GlobalPublicDelegatedPrefixesListCall) Pages(ctx context.Context, f func(*PublicDelegatedPrefixList) 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 "compute.globalPublicDelegatedPrefixes.patch":
-
-type GlobalPublicDelegatedPrefixesPatchCall struct {
- s *Service
- project string
- publicDelegatedPrefix string
- publicdelegatedprefix *PublicDelegatedPrefix
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Patches the specified global PublicDelegatedPrefix resource
-// with the data included in the request. This method supports PATCH
-// semantics and uses JSON merge patch format and processing rules.
-//
-// - project: Project ID for this request.
-// - publicDelegatedPrefix: Name of the PublicDelegatedPrefix resource
-// to patch.
-func (r *GlobalPublicDelegatedPrefixesService) Patch(project string, publicDelegatedPrefix string, publicdelegatedprefix *PublicDelegatedPrefix) *GlobalPublicDelegatedPrefixesPatchCall {
- c := &GlobalPublicDelegatedPrefixesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.publicDelegatedPrefix = publicDelegatedPrefix
- c.publicdelegatedprefix = publicdelegatedprefix
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *GlobalPublicDelegatedPrefixesPatchCall) RequestId(requestId string) *GlobalPublicDelegatedPrefixesPatchCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *GlobalPublicDelegatedPrefixesPatchCall) Fields(s ...googleapi.Field) *GlobalPublicDelegatedPrefixesPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *GlobalPublicDelegatedPrefixesPatchCall) Context(ctx context.Context) *GlobalPublicDelegatedPrefixesPatchCall {
- 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 *GlobalPublicDelegatedPrefixesPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *GlobalPublicDelegatedPrefixesPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.publicdelegatedprefix)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicDelegatedPrefixes/{publicDelegatedPrefix}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "publicDelegatedPrefix": c.publicDelegatedPrefix,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.globalPublicDelegatedPrefixes.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *GlobalPublicDelegatedPrefixesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Patches the specified global PublicDelegatedPrefix resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules.",
- // "flatPath": "projects/{project}/global/publicDelegatedPrefixes/{publicDelegatedPrefix}",
- // "httpMethod": "PATCH",
- // "id": "compute.globalPublicDelegatedPrefixes.patch",
- // "parameterOrder": [
- // "project",
- // "publicDelegatedPrefix"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "publicDelegatedPrefix": {
- // "description": "Name of the PublicDelegatedPrefix resource to patch.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/publicDelegatedPrefixes/{publicDelegatedPrefix}",
- // "request": {
- // "$ref": "PublicDelegatedPrefix"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.healthChecks.aggregatedList":
-
-type HealthChecksAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Retrieves the list of all HealthCheck resources,
-// regional and global, available to the specified project.
-//
-// - project: Name of the project scoping this request.
-func (r *HealthChecksService) AggregatedList(project string) *HealthChecksAggregatedListCall {
- c := &HealthChecksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *HealthChecksAggregatedListCall) Filter(filter string) *HealthChecksAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *HealthChecksAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *HealthChecksAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *HealthChecksAggregatedListCall) MaxResults(maxResults int64) *HealthChecksAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *HealthChecksAggregatedListCall) OrderBy(orderBy string) *HealthChecksAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *HealthChecksAggregatedListCall) PageToken(pageToken string) *HealthChecksAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *HealthChecksAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *HealthChecksAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *HealthChecksAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *HealthChecksAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *HealthChecksAggregatedListCall) Fields(s ...googleapi.Field) *HealthChecksAggregatedListCall {
- 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 *HealthChecksAggregatedListCall) IfNoneMatch(entityTag string) *HealthChecksAggregatedListCall {
- 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 *HealthChecksAggregatedListCall) Context(ctx context.Context) *HealthChecksAggregatedListCall {
- 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 *HealthChecksAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *HealthChecksAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/healthChecks")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.healthChecks.aggregatedList" call.
-// Exactly one of *HealthChecksAggregatedList or error will be non-nil.
-// Any non-2xx status code is an error. Response headers are in either
-// *HealthChecksAggregatedList.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 *HealthChecksAggregatedListCall) Do(opts ...googleapi.CallOption) (*HealthChecksAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &HealthChecksAggregatedList{
- 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": "Retrieves the list of all HealthCheck resources, regional and global, available to the specified project.",
- // "flatPath": "projects/{project}/aggregated/healthChecks",
- // "httpMethod": "GET",
- // "id": "compute.healthChecks.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Name of the project scoping this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/healthChecks",
- // "response": {
- // "$ref": "HealthChecksAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *HealthChecksAggregatedListCall) Pages(ctx context.Context, f func(*HealthChecksAggregatedList) 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 "compute.healthChecks.delete":
-
-type HealthChecksDeleteCall struct {
- s *Service
- project string
- healthCheck string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified HealthCheck resource.
-//
-// - healthCheck: Name of the HealthCheck resource to delete.
-// - project: Project ID for this request.
-func (r *HealthChecksService) Delete(project string, healthCheck string) *HealthChecksDeleteCall {
- c := &HealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.healthCheck = healthCheck
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *HealthChecksDeleteCall) RequestId(requestId string) *HealthChecksDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *HealthChecksDeleteCall) Fields(s ...googleapi.Field) *HealthChecksDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *HealthChecksDeleteCall) Context(ctx context.Context) *HealthChecksDeleteCall {
- 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 *HealthChecksDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *HealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/healthChecks/{healthCheck}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "healthCheck": c.healthCheck,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.healthChecks.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *HealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified HealthCheck resource.",
- // "flatPath": "projects/{project}/global/healthChecks/{healthCheck}",
- // "httpMethod": "DELETE",
- // "id": "compute.healthChecks.delete",
- // "parameterOrder": [
- // "project",
- // "healthCheck"
- // ],
- // "parameters": {
- // "healthCheck": {
- // "description": "Name of the HealthCheck resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/healthChecks/{healthCheck}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.healthChecks.get":
-
-type HealthChecksGetCall struct {
- s *Service
- project string
- healthCheck string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified HealthCheck resource.
-//
-// - healthCheck: Name of the HealthCheck resource to return.
-// - project: Project ID for this request.
-func (r *HealthChecksService) Get(project string, healthCheck string) *HealthChecksGetCall {
- c := &HealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.healthCheck = healthCheck
- 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 *HealthChecksGetCall) Fields(s ...googleapi.Field) *HealthChecksGetCall {
- 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 *HealthChecksGetCall) IfNoneMatch(entityTag string) *HealthChecksGetCall {
- 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 *HealthChecksGetCall) Context(ctx context.Context) *HealthChecksGetCall {
- 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 *HealthChecksGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *HealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/healthChecks/{healthCheck}")
- 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{
- "project": c.project,
- "healthCheck": c.healthCheck,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.healthChecks.get" call.
-// Exactly one of *HealthCheck or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *HealthCheck.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 *HealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HealthCheck, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &HealthCheck{
- 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": "Returns the specified HealthCheck resource.",
- // "flatPath": "projects/{project}/global/healthChecks/{healthCheck}",
- // "httpMethod": "GET",
- // "id": "compute.healthChecks.get",
- // "parameterOrder": [
- // "project",
- // "healthCheck"
- // ],
- // "parameters": {
- // "healthCheck": {
- // "description": "Name of the HealthCheck resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/healthChecks/{healthCheck}",
- // "response": {
- // "$ref": "HealthCheck"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.healthChecks.insert":
-
-type HealthChecksInsertCall struct {
- s *Service
- project string
- healthcheck *HealthCheck
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a HealthCheck resource in the specified project using
-// the data included in the request.
-//
-// - project: Project ID for this request.
-func (r *HealthChecksService) Insert(project string, healthcheck *HealthCheck) *HealthChecksInsertCall {
- c := &HealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.healthcheck = healthcheck
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *HealthChecksInsertCall) RequestId(requestId string) *HealthChecksInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *HealthChecksInsertCall) Fields(s ...googleapi.Field) *HealthChecksInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *HealthChecksInsertCall) Context(ctx context.Context) *HealthChecksInsertCall {
- 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 *HealthChecksInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *HealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/healthChecks")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.healthChecks.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *HealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a HealthCheck resource in the specified project using the data included in the request.",
- // "flatPath": "projects/{project}/global/healthChecks",
- // "httpMethod": "POST",
- // "id": "compute.healthChecks.insert",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/healthChecks",
- // "request": {
- // "$ref": "HealthCheck"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.healthChecks.list":
-
-type HealthChecksListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves the list of HealthCheck resources available to the
-// specified project.
-//
-// - project: Project ID for this request.
-func (r *HealthChecksService) List(project string) *HealthChecksListCall {
- c := &HealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *HealthChecksListCall) Filter(filter string) *HealthChecksListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *HealthChecksListCall) MaxResults(maxResults int64) *HealthChecksListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *HealthChecksListCall) OrderBy(orderBy string) *HealthChecksListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *HealthChecksListCall) PageToken(pageToken string) *HealthChecksListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *HealthChecksListCall) ReturnPartialSuccess(returnPartialSuccess bool) *HealthChecksListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *HealthChecksListCall) Fields(s ...googleapi.Field) *HealthChecksListCall {
- 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 *HealthChecksListCall) IfNoneMatch(entityTag string) *HealthChecksListCall {
- 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 *HealthChecksListCall) Context(ctx context.Context) *HealthChecksListCall {
- 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 *HealthChecksListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *HealthChecksListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/healthChecks")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.healthChecks.list" call.
-// Exactly one of *HealthCheckList or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *HealthCheckList.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 *HealthChecksListCall) Do(opts ...googleapi.CallOption) (*HealthCheckList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &HealthCheckList{
- 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": "Retrieves the list of HealthCheck resources available to the specified project.",
- // "flatPath": "projects/{project}/global/healthChecks",
- // "httpMethod": "GET",
- // "id": "compute.healthChecks.list",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/healthChecks",
- // "response": {
- // "$ref": "HealthCheckList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *HealthChecksListCall) Pages(ctx context.Context, f func(*HealthCheckList) 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 "compute.healthChecks.patch":
-
-type HealthChecksPatchCall struct {
- s *Service
- project string
- healthCheck string
- healthcheck *HealthCheck
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Updates a HealthCheck resource in the specified project using
-// the data included in the request. This method supports PATCH
-// semantics and uses the JSON merge patch format and processing rules.
-//
-// - healthCheck: Name of the HealthCheck resource to patch.
-// - project: Project ID for this request.
-func (r *HealthChecksService) Patch(project string, healthCheck string, healthcheck *HealthCheck) *HealthChecksPatchCall {
- c := &HealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.healthCheck = healthCheck
- c.healthcheck = healthcheck
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *HealthChecksPatchCall) RequestId(requestId string) *HealthChecksPatchCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *HealthChecksPatchCall) Fields(s ...googleapi.Field) *HealthChecksPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *HealthChecksPatchCall) Context(ctx context.Context) *HealthChecksPatchCall {
- 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 *HealthChecksPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *HealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/healthChecks/{healthCheck}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "healthCheck": c.healthCheck,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.healthChecks.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *HealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
- // "flatPath": "projects/{project}/global/healthChecks/{healthCheck}",
- // "httpMethod": "PATCH",
- // "id": "compute.healthChecks.patch",
- // "parameterOrder": [
- // "project",
- // "healthCheck"
- // ],
- // "parameters": {
- // "healthCheck": {
- // "description": "Name of the HealthCheck resource to patch.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/healthChecks/{healthCheck}",
- // "request": {
- // "$ref": "HealthCheck"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.healthChecks.update":
-
-type HealthChecksUpdateCall struct {
- s *Service
- project string
- healthCheck string
- healthcheck *HealthCheck
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Update: Updates a HealthCheck resource in the specified project using
-// the data included in the request.
-//
-// - healthCheck: Name of the HealthCheck resource to update.
-// - project: Project ID for this request.
-func (r *HealthChecksService) Update(project string, healthCheck string, healthcheck *HealthCheck) *HealthChecksUpdateCall {
- c := &HealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.healthCheck = healthCheck
- c.healthcheck = healthcheck
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *HealthChecksUpdateCall) RequestId(requestId string) *HealthChecksUpdateCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *HealthChecksUpdateCall) Fields(s ...googleapi.Field) *HealthChecksUpdateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *HealthChecksUpdateCall) Context(ctx context.Context) *HealthChecksUpdateCall {
- 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 *HealthChecksUpdateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *HealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/healthChecks/{healthCheck}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PUT", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "healthCheck": c.healthCheck,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.healthChecks.update" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *HealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Updates a HealthCheck resource in the specified project using the data included in the request.",
- // "flatPath": "projects/{project}/global/healthChecks/{healthCheck}",
- // "httpMethod": "PUT",
- // "id": "compute.healthChecks.update",
- // "parameterOrder": [
- // "project",
- // "healthCheck"
- // ],
- // "parameters": {
- // "healthCheck": {
- // "description": "Name of the HealthCheck resource to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/healthChecks/{healthCheck}",
- // "request": {
- // "$ref": "HealthCheck"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.httpHealthChecks.delete":
-
-type HttpHealthChecksDeleteCall struct {
- s *Service
- project string
- httpHealthCheck string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified HttpHealthCheck resource.
-//
-// - httpHealthCheck: Name of the HttpHealthCheck resource to delete.
-// - project: Project ID for this request.
-func (r *HttpHealthChecksService) Delete(project string, httpHealthCheck string) *HttpHealthChecksDeleteCall {
- c := &HttpHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.httpHealthCheck = httpHealthCheck
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *HttpHealthChecksDeleteCall) RequestId(requestId string) *HttpHealthChecksDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *HttpHealthChecksDeleteCall) Fields(s ...googleapi.Field) *HttpHealthChecksDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *HttpHealthChecksDeleteCall) Context(ctx context.Context) *HttpHealthChecksDeleteCall {
- 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 *HttpHealthChecksDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *HttpHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/httpHealthChecks/{httpHealthCheck}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "httpHealthCheck": c.httpHealthCheck,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.httpHealthChecks.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *HttpHealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified HttpHealthCheck resource.",
- // "flatPath": "projects/{project}/global/httpHealthChecks/{httpHealthCheck}",
- // "httpMethod": "DELETE",
- // "id": "compute.httpHealthChecks.delete",
- // "parameterOrder": [
- // "project",
- // "httpHealthCheck"
- // ],
- // "parameters": {
- // "httpHealthCheck": {
- // "description": "Name of the HttpHealthCheck resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/httpHealthChecks/{httpHealthCheck}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.httpHealthChecks.get":
-
-type HttpHealthChecksGetCall struct {
- s *Service
- project string
- httpHealthCheck string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified HttpHealthCheck resource.
-//
-// - httpHealthCheck: Name of the HttpHealthCheck resource to return.
-// - project: Project ID for this request.
-func (r *HttpHealthChecksService) Get(project string, httpHealthCheck string) *HttpHealthChecksGetCall {
- c := &HttpHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.httpHealthCheck = httpHealthCheck
- 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 *HttpHealthChecksGetCall) Fields(s ...googleapi.Field) *HttpHealthChecksGetCall {
- 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 *HttpHealthChecksGetCall) IfNoneMatch(entityTag string) *HttpHealthChecksGetCall {
- 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 *HttpHealthChecksGetCall) Context(ctx context.Context) *HttpHealthChecksGetCall {
- 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 *HttpHealthChecksGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *HttpHealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/httpHealthChecks/{httpHealthCheck}")
- 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{
- "project": c.project,
- "httpHealthCheck": c.httpHealthCheck,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.httpHealthChecks.get" call.
-// Exactly one of *HttpHealthCheck or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *HttpHealthCheck.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 *HttpHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HttpHealthCheck, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &HttpHealthCheck{
- 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": "Returns the specified HttpHealthCheck resource.",
- // "flatPath": "projects/{project}/global/httpHealthChecks/{httpHealthCheck}",
- // "httpMethod": "GET",
- // "id": "compute.httpHealthChecks.get",
- // "parameterOrder": [
- // "project",
- // "httpHealthCheck"
- // ],
- // "parameters": {
- // "httpHealthCheck": {
- // "description": "Name of the HttpHealthCheck resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/httpHealthChecks/{httpHealthCheck}",
- // "response": {
- // "$ref": "HttpHealthCheck"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.httpHealthChecks.insert":
-
-type HttpHealthChecksInsertCall struct {
- s *Service
- project string
- httphealthcheck *HttpHealthCheck
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a HttpHealthCheck resource in the specified project
-// using the data included in the request.
-//
-// - project: Project ID for this request.
-func (r *HttpHealthChecksService) Insert(project string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksInsertCall {
- c := &HttpHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.httphealthcheck = httphealthcheck
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *HttpHealthChecksInsertCall) RequestId(requestId string) *HttpHealthChecksInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *HttpHealthChecksInsertCall) Fields(s ...googleapi.Field) *HttpHealthChecksInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *HttpHealthChecksInsertCall) Context(ctx context.Context) *HttpHealthChecksInsertCall {
- 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 *HttpHealthChecksInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *HttpHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/httpHealthChecks")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.httpHealthChecks.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *HttpHealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a HttpHealthCheck resource in the specified project using the data included in the request.",
- // "flatPath": "projects/{project}/global/httpHealthChecks",
- // "httpMethod": "POST",
- // "id": "compute.httpHealthChecks.insert",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/httpHealthChecks",
- // "request": {
- // "$ref": "HttpHealthCheck"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.httpHealthChecks.list":
-
-type HttpHealthChecksListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves the list of HttpHealthCheck resources available to
-// the specified project.
-//
-// - project: Project ID for this request.
-func (r *HttpHealthChecksService) List(project string) *HttpHealthChecksListCall {
- c := &HttpHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *HttpHealthChecksListCall) Filter(filter string) *HttpHealthChecksListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *HttpHealthChecksListCall) MaxResults(maxResults int64) *HttpHealthChecksListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *HttpHealthChecksListCall) OrderBy(orderBy string) *HttpHealthChecksListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *HttpHealthChecksListCall) PageToken(pageToken string) *HttpHealthChecksListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *HttpHealthChecksListCall) ReturnPartialSuccess(returnPartialSuccess bool) *HttpHealthChecksListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *HttpHealthChecksListCall) Fields(s ...googleapi.Field) *HttpHealthChecksListCall {
- 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 *HttpHealthChecksListCall) IfNoneMatch(entityTag string) *HttpHealthChecksListCall {
- 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 *HttpHealthChecksListCall) Context(ctx context.Context) *HttpHealthChecksListCall {
- 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 *HttpHealthChecksListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *HttpHealthChecksListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/httpHealthChecks")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.httpHealthChecks.list" call.
-// Exactly one of *HttpHealthCheckList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *HttpHealthCheckList.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 *HttpHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HttpHealthCheckList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &HttpHealthCheckList{
- 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": "Retrieves the list of HttpHealthCheck resources available to the specified project.",
- // "flatPath": "projects/{project}/global/httpHealthChecks",
- // "httpMethod": "GET",
- // "id": "compute.httpHealthChecks.list",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/httpHealthChecks",
- // "response": {
- // "$ref": "HttpHealthCheckList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *HttpHealthChecksListCall) Pages(ctx context.Context, f func(*HttpHealthCheckList) 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 "compute.httpHealthChecks.patch":
-
-type HttpHealthChecksPatchCall struct {
- s *Service
- project string
- httpHealthCheck string
- httphealthcheck *HttpHealthCheck
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Updates a HttpHealthCheck resource in the specified project
-// using the data included in the request. This method supports PATCH
-// semantics and uses the JSON merge patch format and processing rules.
-//
-// - httpHealthCheck: Name of the HttpHealthCheck resource to patch.
-// - project: Project ID for this request.
-func (r *HttpHealthChecksService) Patch(project string, httpHealthCheck string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksPatchCall {
- c := &HttpHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.httpHealthCheck = httpHealthCheck
- c.httphealthcheck = httphealthcheck
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *HttpHealthChecksPatchCall) RequestId(requestId string) *HttpHealthChecksPatchCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *HttpHealthChecksPatchCall) Fields(s ...googleapi.Field) *HttpHealthChecksPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *HttpHealthChecksPatchCall) Context(ctx context.Context) *HttpHealthChecksPatchCall {
- 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 *HttpHealthChecksPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *HttpHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/httpHealthChecks/{httpHealthCheck}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "httpHealthCheck": c.httpHealthCheck,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.httpHealthChecks.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *HttpHealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Updates a HttpHealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
- // "flatPath": "projects/{project}/global/httpHealthChecks/{httpHealthCheck}",
- // "httpMethod": "PATCH",
- // "id": "compute.httpHealthChecks.patch",
- // "parameterOrder": [
- // "project",
- // "httpHealthCheck"
- // ],
- // "parameters": {
- // "httpHealthCheck": {
- // "description": "Name of the HttpHealthCheck resource to patch.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/httpHealthChecks/{httpHealthCheck}",
- // "request": {
- // "$ref": "HttpHealthCheck"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.httpHealthChecks.update":
-
-type HttpHealthChecksUpdateCall struct {
- s *Service
- project string
- httpHealthCheck string
- httphealthcheck *HttpHealthCheck
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Update: Updates a HttpHealthCheck resource in the specified project
-// using the data included in the request.
-//
-// - httpHealthCheck: Name of the HttpHealthCheck resource to update.
-// - project: Project ID for this request.
-func (r *HttpHealthChecksService) Update(project string, httpHealthCheck string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksUpdateCall {
- c := &HttpHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.httpHealthCheck = httpHealthCheck
- c.httphealthcheck = httphealthcheck
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *HttpHealthChecksUpdateCall) RequestId(requestId string) *HttpHealthChecksUpdateCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *HttpHealthChecksUpdateCall) Fields(s ...googleapi.Field) *HttpHealthChecksUpdateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *HttpHealthChecksUpdateCall) Context(ctx context.Context) *HttpHealthChecksUpdateCall {
- 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 *HttpHealthChecksUpdateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *HttpHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/httpHealthChecks/{httpHealthCheck}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PUT", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "httpHealthCheck": c.httpHealthCheck,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.httpHealthChecks.update" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *HttpHealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Updates a HttpHealthCheck resource in the specified project using the data included in the request.",
- // "flatPath": "projects/{project}/global/httpHealthChecks/{httpHealthCheck}",
- // "httpMethod": "PUT",
- // "id": "compute.httpHealthChecks.update",
- // "parameterOrder": [
- // "project",
- // "httpHealthCheck"
- // ],
- // "parameters": {
- // "httpHealthCheck": {
- // "description": "Name of the HttpHealthCheck resource to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/httpHealthChecks/{httpHealthCheck}",
- // "request": {
- // "$ref": "HttpHealthCheck"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.httpsHealthChecks.delete":
-
-type HttpsHealthChecksDeleteCall struct {
- s *Service
- project string
- httpsHealthCheck string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified HttpsHealthCheck resource.
-//
-// - httpsHealthCheck: Name of the HttpsHealthCheck resource to delete.
-// - project: Project ID for this request.
-func (r *HttpsHealthChecksService) Delete(project string, httpsHealthCheck string) *HttpsHealthChecksDeleteCall {
- c := &HttpsHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.httpsHealthCheck = httpsHealthCheck
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *HttpsHealthChecksDeleteCall) RequestId(requestId string) *HttpsHealthChecksDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *HttpsHealthChecksDeleteCall) Fields(s ...googleapi.Field) *HttpsHealthChecksDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *HttpsHealthChecksDeleteCall) Context(ctx context.Context) *HttpsHealthChecksDeleteCall {
- 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 *HttpsHealthChecksDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *HttpsHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "httpsHealthCheck": c.httpsHealthCheck,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.httpsHealthChecks.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *HttpsHealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified HttpsHealthCheck resource.",
- // "flatPath": "projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}",
- // "httpMethod": "DELETE",
- // "id": "compute.httpsHealthChecks.delete",
- // "parameterOrder": [
- // "project",
- // "httpsHealthCheck"
- // ],
- // "parameters": {
- // "httpsHealthCheck": {
- // "description": "Name of the HttpsHealthCheck resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.httpsHealthChecks.get":
-
-type HttpsHealthChecksGetCall struct {
- s *Service
- project string
- httpsHealthCheck string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified HttpsHealthCheck resource.
-//
-// - httpsHealthCheck: Name of the HttpsHealthCheck resource to return.
-// - project: Project ID for this request.
-func (r *HttpsHealthChecksService) Get(project string, httpsHealthCheck string) *HttpsHealthChecksGetCall {
- c := &HttpsHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.httpsHealthCheck = httpsHealthCheck
- 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 *HttpsHealthChecksGetCall) Fields(s ...googleapi.Field) *HttpsHealthChecksGetCall {
- 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 *HttpsHealthChecksGetCall) IfNoneMatch(entityTag string) *HttpsHealthChecksGetCall {
- 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 *HttpsHealthChecksGetCall) Context(ctx context.Context) *HttpsHealthChecksGetCall {
- 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 *HttpsHealthChecksGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *HttpsHealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}")
- 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{
- "project": c.project,
- "httpsHealthCheck": c.httpsHealthCheck,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.httpsHealthChecks.get" call.
-// Exactly one of *HttpsHealthCheck or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *HttpsHealthCheck.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 *HttpsHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HttpsHealthCheck, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &HttpsHealthCheck{
- 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": "Returns the specified HttpsHealthCheck resource.",
- // "flatPath": "projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}",
- // "httpMethod": "GET",
- // "id": "compute.httpsHealthChecks.get",
- // "parameterOrder": [
- // "project",
- // "httpsHealthCheck"
- // ],
- // "parameters": {
- // "httpsHealthCheck": {
- // "description": "Name of the HttpsHealthCheck resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}",
- // "response": {
- // "$ref": "HttpsHealthCheck"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.httpsHealthChecks.insert":
-
-type HttpsHealthChecksInsertCall struct {
- s *Service
- project string
- httpshealthcheck *HttpsHealthCheck
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a HttpsHealthCheck resource in the specified project
-// using the data included in the request.
-//
-// - project: Project ID for this request.
-func (r *HttpsHealthChecksService) Insert(project string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksInsertCall {
- c := &HttpsHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.httpshealthcheck = httpshealthcheck
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *HttpsHealthChecksInsertCall) RequestId(requestId string) *HttpsHealthChecksInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *HttpsHealthChecksInsertCall) Fields(s ...googleapi.Field) *HttpsHealthChecksInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *HttpsHealthChecksInsertCall) Context(ctx context.Context) *HttpsHealthChecksInsertCall {
- 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 *HttpsHealthChecksInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *HttpsHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/httpsHealthChecks")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.httpsHealthChecks.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *HttpsHealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a HttpsHealthCheck resource in the specified project using the data included in the request.",
- // "flatPath": "projects/{project}/global/httpsHealthChecks",
- // "httpMethod": "POST",
- // "id": "compute.httpsHealthChecks.insert",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/httpsHealthChecks",
- // "request": {
- // "$ref": "HttpsHealthCheck"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.httpsHealthChecks.list":
-
-type HttpsHealthChecksListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves the list of HttpsHealthCheck resources available to
-// the specified project.
-//
-// - project: Project ID for this request.
-func (r *HttpsHealthChecksService) List(project string) *HttpsHealthChecksListCall {
- c := &HttpsHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *HttpsHealthChecksListCall) Filter(filter string) *HttpsHealthChecksListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *HttpsHealthChecksListCall) MaxResults(maxResults int64) *HttpsHealthChecksListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *HttpsHealthChecksListCall) OrderBy(orderBy string) *HttpsHealthChecksListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *HttpsHealthChecksListCall) PageToken(pageToken string) *HttpsHealthChecksListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *HttpsHealthChecksListCall) ReturnPartialSuccess(returnPartialSuccess bool) *HttpsHealthChecksListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *HttpsHealthChecksListCall) Fields(s ...googleapi.Field) *HttpsHealthChecksListCall {
- 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 *HttpsHealthChecksListCall) IfNoneMatch(entityTag string) *HttpsHealthChecksListCall {
- 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 *HttpsHealthChecksListCall) Context(ctx context.Context) *HttpsHealthChecksListCall {
- 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 *HttpsHealthChecksListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *HttpsHealthChecksListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/httpsHealthChecks")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.httpsHealthChecks.list" call.
-// Exactly one of *HttpsHealthCheckList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *HttpsHealthCheckList.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 *HttpsHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HttpsHealthCheckList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &HttpsHealthCheckList{
- 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": "Retrieves the list of HttpsHealthCheck resources available to the specified project.",
- // "flatPath": "projects/{project}/global/httpsHealthChecks",
- // "httpMethod": "GET",
- // "id": "compute.httpsHealthChecks.list",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/httpsHealthChecks",
- // "response": {
- // "$ref": "HttpsHealthCheckList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *HttpsHealthChecksListCall) Pages(ctx context.Context, f func(*HttpsHealthCheckList) 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 "compute.httpsHealthChecks.patch":
-
-type HttpsHealthChecksPatchCall struct {
- s *Service
- project string
- httpsHealthCheck string
- httpshealthcheck *HttpsHealthCheck
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Updates a HttpsHealthCheck resource in the specified project
-// using the data included in the request. This method supports PATCH
-// semantics and uses the JSON merge patch format and processing rules.
-//
-// - httpsHealthCheck: Name of the HttpsHealthCheck resource to patch.
-// - project: Project ID for this request.
-func (r *HttpsHealthChecksService) Patch(project string, httpsHealthCheck string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksPatchCall {
- c := &HttpsHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.httpsHealthCheck = httpsHealthCheck
- c.httpshealthcheck = httpshealthcheck
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *HttpsHealthChecksPatchCall) RequestId(requestId string) *HttpsHealthChecksPatchCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *HttpsHealthChecksPatchCall) Fields(s ...googleapi.Field) *HttpsHealthChecksPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *HttpsHealthChecksPatchCall) Context(ctx context.Context) *HttpsHealthChecksPatchCall {
- 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 *HttpsHealthChecksPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *HttpsHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "httpsHealthCheck": c.httpsHealthCheck,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.httpsHealthChecks.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *HttpsHealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Updates a HttpsHealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
- // "flatPath": "projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}",
- // "httpMethod": "PATCH",
- // "id": "compute.httpsHealthChecks.patch",
- // "parameterOrder": [
- // "project",
- // "httpsHealthCheck"
- // ],
- // "parameters": {
- // "httpsHealthCheck": {
- // "description": "Name of the HttpsHealthCheck resource to patch.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}",
- // "request": {
- // "$ref": "HttpsHealthCheck"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.httpsHealthChecks.update":
-
-type HttpsHealthChecksUpdateCall struct {
- s *Service
- project string
- httpsHealthCheck string
- httpshealthcheck *HttpsHealthCheck
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Update: Updates a HttpsHealthCheck resource in the specified project
-// using the data included in the request.
-//
-// - httpsHealthCheck: Name of the HttpsHealthCheck resource to update.
-// - project: Project ID for this request.
-func (r *HttpsHealthChecksService) Update(project string, httpsHealthCheck string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksUpdateCall {
- c := &HttpsHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.httpsHealthCheck = httpsHealthCheck
- c.httpshealthcheck = httpshealthcheck
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *HttpsHealthChecksUpdateCall) RequestId(requestId string) *HttpsHealthChecksUpdateCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *HttpsHealthChecksUpdateCall) Fields(s ...googleapi.Field) *HttpsHealthChecksUpdateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *HttpsHealthChecksUpdateCall) Context(ctx context.Context) *HttpsHealthChecksUpdateCall {
- 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 *HttpsHealthChecksUpdateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *HttpsHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PUT", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "httpsHealthCheck": c.httpsHealthCheck,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.httpsHealthChecks.update" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *HttpsHealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Updates a HttpsHealthCheck resource in the specified project using the data included in the request.",
- // "flatPath": "projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}",
- // "httpMethod": "PUT",
- // "id": "compute.httpsHealthChecks.update",
- // "parameterOrder": [
- // "project",
- // "httpsHealthCheck"
- // ],
- // "parameters": {
- // "httpsHealthCheck": {
- // "description": "Name of the HttpsHealthCheck resource to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}",
- // "request": {
- // "$ref": "HttpsHealthCheck"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.imageFamilyViews.get":
-
-type ImageFamilyViewsGetCall struct {
- s *Service
- project string
- zone string
- family string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the latest image that is part of an image family, is not
-// deprecated and is rolled out in the specified zone.
-//
-// - family: Name of the image family to search for.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *ImageFamilyViewsService) Get(project string, zone string, family string) *ImageFamilyViewsGetCall {
- c := &ImageFamilyViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.family = family
- 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 *ImageFamilyViewsGetCall) Fields(s ...googleapi.Field) *ImageFamilyViewsGetCall {
- 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 *ImageFamilyViewsGetCall) IfNoneMatch(entityTag string) *ImageFamilyViewsGetCall {
- 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 *ImageFamilyViewsGetCall) Context(ctx context.Context) *ImageFamilyViewsGetCall {
- 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 *ImageFamilyViewsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ImageFamilyViewsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}/imageFamilyViews/{family}")
- 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{
- "project": c.project,
- "zone": c.zone,
- "family": c.family,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.imageFamilyViews.get" call.
-// Exactly one of *ImageFamilyView or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *ImageFamilyView.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 *ImageFamilyViewsGetCall) Do(opts ...googleapi.CallOption) (*ImageFamilyView, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &ImageFamilyView{
- 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": "Returns the latest image that is part of an image family, is not deprecated and is rolled out in the specified zone.",
- // "flatPath": "projects/{project}/zones/{zone}/imageFamilyViews/{family}",
- // "httpMethod": "GET",
- // "id": "compute.imageFamilyViews.get",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "family"
- // ],
- // "parameters": {
- // "family": {
- // "description": "Name of the image family to search for.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/imageFamilyViews/{family}",
- // "response": {
- // "$ref": "ImageFamilyView"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.images.delete":
-
-type ImagesDeleteCall struct {
- s *Service
- project string
- image string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified image.
-//
-// - image: Name of the image resource to delete.
-// - project: Project ID for this request.
-func (r *ImagesService) Delete(project string, image string) *ImagesDeleteCall {
- c := &ImagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.image = image
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *ImagesDeleteCall) RequestId(requestId string) *ImagesDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *ImagesDeleteCall) Fields(s ...googleapi.Field) *ImagesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ImagesDeleteCall) Context(ctx context.Context) *ImagesDeleteCall {
- 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 *ImagesDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ImagesDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/images/{image}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "image": c.image,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.images.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *ImagesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified image.",
- // "flatPath": "projects/{project}/global/images/{image}",
- // "httpMethod": "DELETE",
- // "id": "compute.images.delete",
- // "parameterOrder": [
- // "project",
- // "image"
- // ],
- // "parameters": {
- // "image": {
- // "description": "Name of the image resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/images/{image}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.images.deprecate":
-
-type ImagesDeprecateCall struct {
- s *Service
- project string
- image string
- deprecationstatus *DeprecationStatus
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Deprecate: Sets the deprecation status of an image. If an empty
-// request body is given, clears the deprecation status instead.
-//
-// - image: Image name.
-// - project: Project ID for this request.
-func (r *ImagesService) Deprecate(project string, image string, deprecationstatus *DeprecationStatus) *ImagesDeprecateCall {
- c := &ImagesDeprecateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.image = image
- c.deprecationstatus = deprecationstatus
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *ImagesDeprecateCall) RequestId(requestId string) *ImagesDeprecateCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *ImagesDeprecateCall) Fields(s ...googleapi.Field) *ImagesDeprecateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ImagesDeprecateCall) Context(ctx context.Context) *ImagesDeprecateCall {
- 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 *ImagesDeprecateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ImagesDeprecateCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.deprecationstatus)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/images/{image}/deprecate")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "image": c.image,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.images.deprecate" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *ImagesDeprecateCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Sets the deprecation status of an image. If an empty request body is given, clears the deprecation status instead.",
- // "flatPath": "projects/{project}/global/images/{image}/deprecate",
- // "httpMethod": "POST",
- // "id": "compute.images.deprecate",
- // "parameterOrder": [
- // "project",
- // "image"
- // ],
- // "parameters": {
- // "image": {
- // "description": "Image name.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/images/{image}/deprecate",
- // "request": {
- // "$ref": "DeprecationStatus"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.images.get":
-
-type ImagesGetCall struct {
- s *Service
- project string
- image string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified image.
-//
-// - image: Name of the image resource to return.
-// - project: Project ID for this request.
-func (r *ImagesService) Get(project string, image string) *ImagesGetCall {
- c := &ImagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.image = image
- 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 *ImagesGetCall) Fields(s ...googleapi.Field) *ImagesGetCall {
- 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 *ImagesGetCall) IfNoneMatch(entityTag string) *ImagesGetCall {
- 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 *ImagesGetCall) Context(ctx context.Context) *ImagesGetCall {
- 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 *ImagesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ImagesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/images/{image}")
- 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{
- "project": c.project,
- "image": c.image,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.images.get" call.
-// Exactly one of *Image or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Image.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 *ImagesGetCall) Do(opts ...googleapi.CallOption) (*Image, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Image{
- 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": "Returns the specified image.",
- // "flatPath": "projects/{project}/global/images/{image}",
- // "httpMethod": "GET",
- // "id": "compute.images.get",
- // "parameterOrder": [
- // "project",
- // "image"
- // ],
- // "parameters": {
- // "image": {
- // "description": "Name of the image resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/images/{image}",
- // "response": {
- // "$ref": "Image"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.images.getFromFamily":
-
-type ImagesGetFromFamilyCall struct {
- s *Service
- project string
- family string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetFromFamily: Returns the latest image that is part of an image
-// family and is not deprecated. For more information on image families,
-// see Public image families documentation.
-//
-// - family: Name of the image family to search for.
-// - project: The image project that the image belongs to. For example,
-// to get a CentOS image, specify centos-cloud as the image project.
-func (r *ImagesService) GetFromFamily(project string, family string) *ImagesGetFromFamilyCall {
- c := &ImagesGetFromFamilyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.family = family
- 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 *ImagesGetFromFamilyCall) Fields(s ...googleapi.Field) *ImagesGetFromFamilyCall {
- 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 *ImagesGetFromFamilyCall) IfNoneMatch(entityTag string) *ImagesGetFromFamilyCall {
- 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 *ImagesGetFromFamilyCall) Context(ctx context.Context) *ImagesGetFromFamilyCall {
- 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 *ImagesGetFromFamilyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ImagesGetFromFamilyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/images/family/{family}")
- 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{
- "project": c.project,
- "family": c.family,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.images.getFromFamily" call.
-// Exactly one of *Image or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Image.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 *ImagesGetFromFamilyCall) Do(opts ...googleapi.CallOption) (*Image, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Image{
- 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": "Returns the latest image that is part of an image family and is not deprecated. For more information on image families, see Public image families documentation.",
- // "flatPath": "projects/{project}/global/images/family/{family}",
- // "httpMethod": "GET",
- // "id": "compute.images.getFromFamily",
- // "parameterOrder": [
- // "project",
- // "family"
- // ],
- // "parameters": {
- // "family": {
- // "description": "Name of the image family to search for.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "The image project that the image belongs to. For example, to get a CentOS image, specify centos-cloud as the image project.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/images/family/{family}",
- // "response": {
- // "$ref": "Image"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.images.getIamPolicy":
-
-type ImagesGetIamPolicyCall struct {
- s *Service
- project string
- resource string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetIamPolicy: Gets the access control policy for a resource. May be
-// empty if no such policy or resource exists.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-func (r *ImagesService) GetIamPolicy(project string, resource string) *ImagesGetIamPolicyCall {
- c := &ImagesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.resource = resource
- return c
-}
-
-// OptionsRequestedPolicyVersion sets the optional parameter
-// "optionsRequestedPolicyVersion": Requested IAM Policy version.
-func (c *ImagesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ImagesGetIamPolicyCall {
- c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
- 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 *ImagesGetIamPolicyCall) Fields(s ...googleapi.Field) *ImagesGetIamPolicyCall {
- 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 *ImagesGetIamPolicyCall) IfNoneMatch(entityTag string) *ImagesGetIamPolicyCall {
- 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 *ImagesGetIamPolicyCall) Context(ctx context.Context) *ImagesGetIamPolicyCall {
- 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 *ImagesGetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ImagesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/images/{resource}/getIamPolicy")
- 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{
- "project": c.project,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.images.getIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *ImagesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
- // "flatPath": "projects/{project}/global/images/{resource}/getIamPolicy",
- // "httpMethod": "GET",
- // "id": "compute.images.getIamPolicy",
- // "parameterOrder": [
- // "project",
- // "resource"
- // ],
- // "parameters": {
- // "optionsRequestedPolicyVersion": {
- // "description": "Requested IAM Policy version.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/images/{resource}/getIamPolicy",
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.images.insert":
-
-type ImagesInsertCall struct {
- s *Service
- project string
- image *Image
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates an image in the specified project using the data
-// included in the request.
-//
-// - project: Project ID for this request.
-func (r *ImagesService) Insert(project string, image *Image) *ImagesInsertCall {
- c := &ImagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.image = image
- return c
-}
-
-// ForceCreate sets the optional parameter "forceCreate": Force image
-// creation if true.
-func (c *ImagesInsertCall) ForceCreate(forceCreate bool) *ImagesInsertCall {
- c.urlParams_.Set("forceCreate", fmt.Sprint(forceCreate))
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *ImagesInsertCall) RequestId(requestId string) *ImagesInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *ImagesInsertCall) Fields(s ...googleapi.Field) *ImagesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ImagesInsertCall) Context(ctx context.Context) *ImagesInsertCall {
- 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 *ImagesInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ImagesInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.image)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/images")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.images.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *ImagesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates an image in the specified project using the data included in the request.",
- // "flatPath": "projects/{project}/global/images",
- // "httpMethod": "POST",
- // "id": "compute.images.insert",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "forceCreate": {
- // "description": "Force image creation if true.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/images",
- // "request": {
- // "$ref": "Image"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/devstorage.full_control",
- // "https://www.googleapis.com/auth/devstorage.read_only",
- // "https://www.googleapis.com/auth/devstorage.read_write"
- // ]
- // }
-
-}
-
-// method id "compute.images.list":
-
-type ImagesListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves the list of custom images available to the specified
-// project. Custom images are images you create that belong to your
-// project. This method does not get any images that belong to other
-// projects, including publicly-available images, like Debian 8. If you
-// want to get a list of publicly-available images, use this method to
-// make a request to the respective image project, such as debian-cloud
-// or windows-cloud.
-//
-// - project: Project ID for this request.
-func (r *ImagesService) List(project string) *ImagesListCall {
- c := &ImagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *ImagesListCall) Filter(filter string) *ImagesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *ImagesListCall) MaxResults(maxResults int64) *ImagesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *ImagesListCall) OrderBy(orderBy string) *ImagesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *ImagesListCall) PageToken(pageToken string) *ImagesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *ImagesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ImagesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *ImagesListCall) Fields(s ...googleapi.Field) *ImagesListCall {
- 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 *ImagesListCall) IfNoneMatch(entityTag string) *ImagesListCall {
- 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 *ImagesListCall) Context(ctx context.Context) *ImagesListCall {
- 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 *ImagesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ImagesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/images")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.images.list" call.
-// Exactly one of *ImageList or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *ImageList.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 *ImagesListCall) Do(opts ...googleapi.CallOption) (*ImageList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &ImageList{
- 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": "Retrieves the list of custom images available to the specified project. Custom images are images you create that belong to your project. This method does not get any images that belong to other projects, including publicly-available images, like Debian 8. If you want to get a list of publicly-available images, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud.",
- // "flatPath": "projects/{project}/global/images",
- // "httpMethod": "GET",
- // "id": "compute.images.list",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/images",
- // "response": {
- // "$ref": "ImageList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *ImagesListCall) Pages(ctx context.Context, f func(*ImageList) 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 "compute.images.patch":
-
-type ImagesPatchCall struct {
- s *Service
- project string
- image string
- image2 *Image
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Patches the specified image with the data included in the
-// request. Only the following fields can be modified: family,
-// description, deprecation status.
-//
-// - image: Name of the image resource to patch.
-// - project: Project ID for this request.
-func (r *ImagesService) Patch(project string, image string, image2 *Image) *ImagesPatchCall {
- c := &ImagesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.image = image
- c.image2 = image2
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *ImagesPatchCall) RequestId(requestId string) *ImagesPatchCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *ImagesPatchCall) Fields(s ...googleapi.Field) *ImagesPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ImagesPatchCall) Context(ctx context.Context) *ImagesPatchCall {
- 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 *ImagesPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ImagesPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.image2)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/images/{image}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "image": c.image,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.images.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *ImagesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Patches the specified image with the data included in the request. Only the following fields can be modified: family, description, deprecation status.",
- // "flatPath": "projects/{project}/global/images/{image}",
- // "httpMethod": "PATCH",
- // "id": "compute.images.patch",
- // "parameterOrder": [
- // "project",
- // "image"
- // ],
- // "parameters": {
- // "image": {
- // "description": "Name of the image resource to patch.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/images/{image}",
- // "request": {
- // "$ref": "Image"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.images.setIamPolicy":
-
-type ImagesSetIamPolicyCall struct {
- s *Service
- project string
- resource string
- globalsetpolicyrequest *GlobalSetPolicyRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetIamPolicy: Sets the access control policy on the specified
-// resource. Replaces any existing policy.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-func (r *ImagesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *ImagesSetIamPolicyCall {
- c := &ImagesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.resource = resource
- c.globalsetpolicyrequest = globalsetpolicyrequest
- 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 *ImagesSetIamPolicyCall) Fields(s ...googleapi.Field) *ImagesSetIamPolicyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ImagesSetIamPolicyCall) Context(ctx context.Context) *ImagesSetIamPolicyCall {
- 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 *ImagesSetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ImagesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/images/{resource}/setIamPolicy")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.images.setIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *ImagesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Sets the access control policy on the specified resource. Replaces any existing policy.",
- // "flatPath": "projects/{project}/global/images/{resource}/setIamPolicy",
- // "httpMethod": "POST",
- // "id": "compute.images.setIamPolicy",
- // "parameterOrder": [
- // "project",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/images/{resource}/setIamPolicy",
- // "request": {
- // "$ref": "GlobalSetPolicyRequest"
- // },
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.images.setLabels":
-
-type ImagesSetLabelsCall struct {
- s *Service
- project string
- resource string
- globalsetlabelsrequest *GlobalSetLabelsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetLabels: Sets the labels on an image. To learn more about labels,
-// read the Labeling Resources documentation.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-func (r *ImagesService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *ImagesSetLabelsCall {
- c := &ImagesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.resource = resource
- c.globalsetlabelsrequest = globalsetlabelsrequest
- 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 *ImagesSetLabelsCall) Fields(s ...googleapi.Field) *ImagesSetLabelsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ImagesSetLabelsCall) Context(ctx context.Context) *ImagesSetLabelsCall {
- 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 *ImagesSetLabelsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ImagesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/images/{resource}/setLabels")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.images.setLabels" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *ImagesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation.",
- // "flatPath": "projects/{project}/global/images/{resource}/setLabels",
- // "httpMethod": "POST",
- // "id": "compute.images.setLabels",
- // "parameterOrder": [
- // "project",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/images/{resource}/setLabels",
- // "request": {
- // "$ref": "GlobalSetLabelsRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.images.testIamPermissions":
-
-type ImagesTestIamPermissionsCall struct {
- s *Service
- project string
- resource string
- testpermissionsrequest *TestPermissionsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// TestIamPermissions: Returns permissions that a caller has on the
-// specified resource.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-func (r *ImagesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *ImagesTestIamPermissionsCall {
- c := &ImagesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.resource = resource
- c.testpermissionsrequest = testpermissionsrequest
- 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 *ImagesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ImagesTestIamPermissionsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ImagesTestIamPermissionsCall) Context(ctx context.Context) *ImagesTestIamPermissionsCall {
- 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 *ImagesTestIamPermissionsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ImagesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/images/{resource}/testIamPermissions")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.images.testIamPermissions" call.
-// Exactly one of *TestPermissionsResponse or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *TestPermissionsResponse.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 *ImagesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TestPermissionsResponse{
- 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": "Returns permissions that a caller has on the specified resource.",
- // "flatPath": "projects/{project}/global/images/{resource}/testIamPermissions",
- // "httpMethod": "POST",
- // "id": "compute.images.testIamPermissions",
- // "parameterOrder": [
- // "project",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/images/{resource}/testIamPermissions",
- // "request": {
- // "$ref": "TestPermissionsRequest"
- // },
- // "response": {
- // "$ref": "TestPermissionsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.instanceGroupManagers.abandonInstances":
-
-type InstanceGroupManagersAbandonInstancesCall struct {
- s *Service
- project string
- zone string
- instanceGroupManager string
- instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// AbandonInstances: Flags the specified instances to be removed from
-// the managed instance group. Abandoning an instance does not delete
-// the instance, but it does remove the instance from any target pools
-// that are applied by the managed instance group. This method reduces
-// the targetSize of the managed instance group by the number of
-// instances that you abandon. This operation is marked as DONE when the
-// action is scheduled even if the instances have not yet been removed
-// from the group. You must separately verify the status of the
-// abandoning action with the listmanagedinstances method. If the group
-// is part of a backend service that has enabled connection draining, it
-// can take up to 60 seconds after the connection draining duration has
-// elapsed before the VM instance is removed or deleted. You can specify
-// a maximum of 1000 instances with this method per request.
-//
-// - instanceGroupManager: The name of the managed instance group.
-// - project: Project ID for this request.
-// - zone: The name of the zone where the managed instance group is
-// located.
-func (r *InstanceGroupManagersService) AbandonInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest) *InstanceGroupManagersAbandonInstancesCall {
- c := &InstanceGroupManagersAbandonInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instanceGroupManager = instanceGroupManager
- c.instancegroupmanagersabandoninstancesrequest = instancegroupmanagersabandoninstancesrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstanceGroupManagersAbandonInstancesCall) RequestId(requestId string) *InstanceGroupManagersAbandonInstancesCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstanceGroupManagersAbandonInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersAbandonInstancesCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstanceGroupManagersAbandonInstancesCall) Context(ctx context.Context) *InstanceGroupManagersAbandonInstancesCall {
- 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 *InstanceGroupManagersAbandonInstancesCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersabandoninstancesrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instanceGroupManager": c.instanceGroupManager,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instanceGroupManagers.abandonInstances" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstanceGroupManagersAbandonInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Flags the specified instances to be removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request.",
- // "flatPath": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances",
- // "httpMethod": "POST",
- // "id": "compute.instanceGroupManagers.abandonInstances",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instanceGroupManager"
- // ],
- // "parameters": {
- // "instanceGroupManager": {
- // "description": "The name of the managed instance group.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone where the managed instance group is located.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances",
- // "request": {
- // "$ref": "InstanceGroupManagersAbandonInstancesRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instanceGroupManagers.aggregatedList":
-
-type InstanceGroupManagersAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Retrieves the list of managed instance groups and
-// groups them by zone.
-//
-// - project: Project ID for this request.
-func (r *InstanceGroupManagersService) AggregatedList(project string) *InstanceGroupManagersAggregatedListCall {
- c := &InstanceGroupManagersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *InstanceGroupManagersAggregatedListCall) Filter(filter string) *InstanceGroupManagersAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *InstanceGroupManagersAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *InstanceGroupManagersAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *InstanceGroupManagersAggregatedListCall) MaxResults(maxResults int64) *InstanceGroupManagersAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *InstanceGroupManagersAggregatedListCall) OrderBy(orderBy string) *InstanceGroupManagersAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *InstanceGroupManagersAggregatedListCall) PageToken(pageToken string) *InstanceGroupManagersAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *InstanceGroupManagersAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InstanceGroupManagersAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *InstanceGroupManagersAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *InstanceGroupManagersAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *InstanceGroupManagersAggregatedListCall) Fields(s ...googleapi.Field) *InstanceGroupManagersAggregatedListCall {
- 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 *InstanceGroupManagersAggregatedListCall) IfNoneMatch(entityTag string) *InstanceGroupManagersAggregatedListCall {
- 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 *InstanceGroupManagersAggregatedListCall) Context(ctx context.Context) *InstanceGroupManagersAggregatedListCall {
- 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 *InstanceGroupManagersAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstanceGroupManagersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/instanceGroupManagers")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instanceGroupManagers.aggregatedList" call.
-// Exactly one of *InstanceGroupManagerAggregatedList or error will be
-// non-nil. Any non-2xx status code is an error. Response headers are in
-// either *InstanceGroupManagerAggregatedList.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 *InstanceGroupManagersAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagerAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &InstanceGroupManagerAggregatedList{
- 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": "Retrieves the list of managed instance groups and groups them by zone.",
- // "flatPath": "projects/{project}/aggregated/instanceGroupManagers",
- // "httpMethod": "GET",
- // "id": "compute.instanceGroupManagers.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/instanceGroupManagers",
- // "response": {
- // "$ref": "InstanceGroupManagerAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *InstanceGroupManagersAggregatedListCall) Pages(ctx context.Context, f func(*InstanceGroupManagerAggregatedList) 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 "compute.instanceGroupManagers.applyUpdatesToInstances":
-
-type InstanceGroupManagersApplyUpdatesToInstancesCall struct {
- s *Service
- project string
- zone string
- instanceGroupManager string
- instancegroupmanagersapplyupdatesrequest *InstanceGroupManagersApplyUpdatesRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// ApplyUpdatesToInstances: Applies changes to selected instances on the
-// managed instance group. This method can be used to apply new
-// overrides and/or new versions.
-//
-// - instanceGroupManager: The name of the managed instance group,
-// should conform to RFC1035.
-// - project: Project ID for this request.
-// - zone: The name of the zone where the managed instance group is
-// located. Should conform to RFC1035.
-func (r *InstanceGroupManagersService) ApplyUpdatesToInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersapplyupdatesrequest *InstanceGroupManagersApplyUpdatesRequest) *InstanceGroupManagersApplyUpdatesToInstancesCall {
- c := &InstanceGroupManagersApplyUpdatesToInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instanceGroupManager = instanceGroupManager
- c.instancegroupmanagersapplyupdatesrequest = instancegroupmanagersapplyupdatesrequest
- 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 *InstanceGroupManagersApplyUpdatesToInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersApplyUpdatesToInstancesCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstanceGroupManagersApplyUpdatesToInstancesCall) Context(ctx context.Context) *InstanceGroupManagersApplyUpdatesToInstancesCall {
- 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 *InstanceGroupManagersApplyUpdatesToInstancesCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstanceGroupManagersApplyUpdatesToInstancesCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersapplyupdatesrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/applyUpdatesToInstances")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instanceGroupManager": c.instanceGroupManager,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instanceGroupManagers.applyUpdatesToInstances" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstanceGroupManagersApplyUpdatesToInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Applies changes to selected instances on the managed instance group. This method can be used to apply new overrides and/or new versions.",
- // "flatPath": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/applyUpdatesToInstances",
- // "httpMethod": "POST",
- // "id": "compute.instanceGroupManagers.applyUpdatesToInstances",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instanceGroupManager"
- // ],
- // "parameters": {
- // "instanceGroupManager": {
- // "description": "The name of the managed instance group, should conform to RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone where the managed instance group is located. Should conform to RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/applyUpdatesToInstances",
- // "request": {
- // "$ref": "InstanceGroupManagersApplyUpdatesRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instanceGroupManagers.createInstances":
-
-type InstanceGroupManagersCreateInstancesCall struct {
- s *Service
- project string
- zone string
- instanceGroupManager string
- instancegroupmanagerscreateinstancesrequest *InstanceGroupManagersCreateInstancesRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// CreateInstances: Creates instances with per-instance configurations
-// in this managed instance group. Instances are created using the
-// current instance template. The create instances operation is marked
-// DONE if the createInstances request is successful. The underlying
-// actions take additional time. You must separately verify the status
-// of the creating or actions with the listmanagedinstances method.
-//
-// - instanceGroupManager: The name of the managed instance group. It
-// should conform to RFC1035.
-// - project: Project ID for this request.
-// - zone: The name of the zone where the managed instance group is
-// located. It should conform to RFC1035.
-func (r *InstanceGroupManagersService) CreateInstances(project string, zone string, instanceGroupManager string, instancegroupmanagerscreateinstancesrequest *InstanceGroupManagersCreateInstancesRequest) *InstanceGroupManagersCreateInstancesCall {
- c := &InstanceGroupManagersCreateInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instanceGroupManager = instanceGroupManager
- c.instancegroupmanagerscreateinstancesrequest = instancegroupmanagerscreateinstancesrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. The request ID
-// must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstanceGroupManagersCreateInstancesCall) RequestId(requestId string) *InstanceGroupManagersCreateInstancesCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstanceGroupManagersCreateInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersCreateInstancesCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstanceGroupManagersCreateInstancesCall) Context(ctx context.Context) *InstanceGroupManagersCreateInstancesCall {
- 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 *InstanceGroupManagersCreateInstancesCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstanceGroupManagersCreateInstancesCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerscreateinstancesrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/createInstances")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instanceGroupManager": c.instanceGroupManager,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instanceGroupManagers.createInstances" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstanceGroupManagersCreateInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates instances with per-instance configurations in this managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method.",
- // "flatPath": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/createInstances",
- // "httpMethod": "POST",
- // "id": "compute.instanceGroupManagers.createInstances",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instanceGroupManager"
- // ],
- // "parameters": {
- // "instanceGroupManager": {
- // "description": "The name of the managed instance group. It should conform to RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone where the managed instance group is located. It should conform to RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/createInstances",
- // "request": {
- // "$ref": "InstanceGroupManagersCreateInstancesRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instanceGroupManagers.delete":
-
-type InstanceGroupManagersDeleteCall struct {
- s *Service
- project string
- zone string
- instanceGroupManager string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified managed instance group and all of the
-// instances in that group. Note that the instance group must not belong
-// to a backend service. Read Deleting an instance group for more
-// information.
-//
-// - instanceGroupManager: The name of the managed instance group to
-// delete.
-// - project: Project ID for this request.
-// - zone: The name of the zone where the managed instance group is
-// located.
-func (r *InstanceGroupManagersService) Delete(project string, zone string, instanceGroupManager string) *InstanceGroupManagersDeleteCall {
- c := &InstanceGroupManagersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instanceGroupManager = instanceGroupManager
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstanceGroupManagersDeleteCall) RequestId(requestId string) *InstanceGroupManagersDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstanceGroupManagersDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstanceGroupManagersDeleteCall) Context(ctx context.Context) *InstanceGroupManagersDeleteCall {
- 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 *InstanceGroupManagersDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstanceGroupManagersDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instanceGroupManager": c.instanceGroupManager,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instanceGroupManagers.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstanceGroupManagersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified managed instance group and all of the instances in that group. Note that the instance group must not belong to a backend service. Read Deleting an instance group for more information.",
- // "flatPath": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
- // "httpMethod": "DELETE",
- // "id": "compute.instanceGroupManagers.delete",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instanceGroupManager"
- // ],
- // "parameters": {
- // "instanceGroupManager": {
- // "description": "The name of the managed instance group to delete.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone where the managed instance group is located.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instanceGroupManagers.deleteInstances":
-
-type InstanceGroupManagersDeleteInstancesCall struct {
- s *Service
- project string
- zone string
- instanceGroupManager string
- instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// DeleteInstances: Flags the specified instances in the managed
-// instance group for immediate deletion. The instances are also removed
-// from any target pools of which they were a member. This method
-// reduces the targetSize of the managed instance group by the number of
-// instances that you delete. This operation is marked as DONE when the
-// action is scheduled even if the instances are still being deleted.
-// You must separately verify the status of the deleting action with the
-// listmanagedinstances method. If the group is part of a backend
-// service that has enabled connection draining, it can take up to 60
-// seconds after the connection draining duration has elapsed before the
-// VM instance is removed or deleted. You can specify a maximum of 1000
-// instances with this method per request.
-//
-// - instanceGroupManager: The name of the managed instance group.
-// - project: Project ID for this request.
-// - zone: The name of the zone where the managed instance group is
-// located.
-func (r *InstanceGroupManagersService) DeleteInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest) *InstanceGroupManagersDeleteInstancesCall {
- c := &InstanceGroupManagersDeleteInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instanceGroupManager = instanceGroupManager
- c.instancegroupmanagersdeleteinstancesrequest = instancegroupmanagersdeleteinstancesrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstanceGroupManagersDeleteInstancesCall) RequestId(requestId string) *InstanceGroupManagersDeleteInstancesCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstanceGroupManagersDeleteInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeleteInstancesCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstanceGroupManagersDeleteInstancesCall) Context(ctx context.Context) *InstanceGroupManagersDeleteInstancesCall {
- 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 *InstanceGroupManagersDeleteInstancesCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstanceGroupManagersDeleteInstancesCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersdeleteinstancesrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instanceGroupManager": c.instanceGroupManager,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instanceGroupManagers.deleteInstances" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstanceGroupManagersDeleteInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Flags the specified instances in the managed instance group for immediate deletion. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request.",
- // "flatPath": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances",
- // "httpMethod": "POST",
- // "id": "compute.instanceGroupManagers.deleteInstances",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instanceGroupManager"
- // ],
- // "parameters": {
- // "instanceGroupManager": {
- // "description": "The name of the managed instance group.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone where the managed instance group is located.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances",
- // "request": {
- // "$ref": "InstanceGroupManagersDeleteInstancesRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instanceGroupManagers.deletePerInstanceConfigs":
-
-type InstanceGroupManagersDeletePerInstanceConfigsCall struct {
- s *Service
- project string
- zone string
- instanceGroupManager string
- instancegroupmanagersdeleteperinstanceconfigsreq *InstanceGroupManagersDeletePerInstanceConfigsReq
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// DeletePerInstanceConfigs: Deletes selected per-instance
-// configurations for the managed instance group.
-//
-// - instanceGroupManager: The name of the managed instance group. It
-// should conform to RFC1035.
-// - project: Project ID for this request.
-// - zone: The name of the zone where the managed instance group is
-// located. It should conform to RFC1035.
-func (r *InstanceGroupManagersService) DeletePerInstanceConfigs(project string, zone string, instanceGroupManager string, instancegroupmanagersdeleteperinstanceconfigsreq *InstanceGroupManagersDeletePerInstanceConfigsReq) *InstanceGroupManagersDeletePerInstanceConfigsCall {
- c := &InstanceGroupManagersDeletePerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instanceGroupManager = instanceGroupManager
- c.instancegroupmanagersdeleteperinstanceconfigsreq = instancegroupmanagersdeleteperinstanceconfigsreq
- 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 *InstanceGroupManagersDeletePerInstanceConfigsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeletePerInstanceConfigsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstanceGroupManagersDeletePerInstanceConfigsCall) Context(ctx context.Context) *InstanceGroupManagersDeletePerInstanceConfigsCall {
- 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 *InstanceGroupManagersDeletePerInstanceConfigsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstanceGroupManagersDeletePerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersdeleteperinstanceconfigsreq)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deletePerInstanceConfigs")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instanceGroupManager": c.instanceGroupManager,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instanceGroupManagers.deletePerInstanceConfigs" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstanceGroupManagersDeletePerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes selected per-instance configurations for the managed instance group.",
- // "flatPath": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deletePerInstanceConfigs",
- // "httpMethod": "POST",
- // "id": "compute.instanceGroupManagers.deletePerInstanceConfigs",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instanceGroupManager"
- // ],
- // "parameters": {
- // "instanceGroupManager": {
- // "description": "The name of the managed instance group. It should conform to RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone where the managed instance group is located. It should conform to RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deletePerInstanceConfigs",
- // "request": {
- // "$ref": "InstanceGroupManagersDeletePerInstanceConfigsReq"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instanceGroupManagers.get":
-
-type InstanceGroupManagersGetCall struct {
- s *Service
- project string
- zone string
- instanceGroupManager string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns all of the details about the specified managed instance
-// group.
-//
-// - instanceGroupManager: The name of the managed instance group.
-// - project: Project ID for this request.
-// - zone: The name of the zone where the managed instance group is
-// located.
-func (r *InstanceGroupManagersService) Get(project string, zone string, instanceGroupManager string) *InstanceGroupManagersGetCall {
- c := &InstanceGroupManagersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instanceGroupManager = instanceGroupManager
- 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 *InstanceGroupManagersGetCall) Fields(s ...googleapi.Field) *InstanceGroupManagersGetCall {
- 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 *InstanceGroupManagersGetCall) IfNoneMatch(entityTag string) *InstanceGroupManagersGetCall {
- 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 *InstanceGroupManagersGetCall) Context(ctx context.Context) *InstanceGroupManagersGetCall {
- 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 *InstanceGroupManagersGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstanceGroupManagersGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
- 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{
- "project": c.project,
- "zone": c.zone,
- "instanceGroupManager": c.instanceGroupManager,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instanceGroupManagers.get" call.
-// Exactly one of *InstanceGroupManager or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *InstanceGroupManager.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 *InstanceGroupManagersGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManager, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &InstanceGroupManager{
- 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": "Returns all of the details about the specified managed instance group.",
- // "flatPath": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
- // "httpMethod": "GET",
- // "id": "compute.instanceGroupManagers.get",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instanceGroupManager"
- // ],
- // "parameters": {
- // "instanceGroupManager": {
- // "description": "The name of the managed instance group.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone where the managed instance group is located.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
- // "response": {
- // "$ref": "InstanceGroupManager"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.instanceGroupManagers.insert":
-
-type InstanceGroupManagersInsertCall struct {
- s *Service
- project string
- zone string
- instancegroupmanager *InstanceGroupManager
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a managed instance group using the information that
-// you specify in the request. After the group is created, instances in
-// the group are created using the specified instance template. This
-// operation is marked as DONE when the group is created even if the
-// instances in the group have not yet been created. You must separately
-// verify the status of the individual instances with the
-// listmanagedinstances method. A managed instance group can have up to
-// 1000 VM instances per group. Please contact Cloud Support if you need
-// an increase in this limit.
-//
-// - project: Project ID for this request.
-// - zone: The name of the zone where you want to create the managed
-// instance group.
-func (r *InstanceGroupManagersService) Insert(project string, zone string, instancegroupmanager *InstanceGroupManager) *InstanceGroupManagersInsertCall {
- c := &InstanceGroupManagersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instancegroupmanager = instancegroupmanager
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstanceGroupManagersInsertCall) RequestId(requestId string) *InstanceGroupManagersInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstanceGroupManagersInsertCall) Fields(s ...googleapi.Field) *InstanceGroupManagersInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstanceGroupManagersInsertCall) Context(ctx context.Context) *InstanceGroupManagersInsertCall {
- 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 *InstanceGroupManagersInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstanceGroupManagersInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instanceGroupManagers.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstanceGroupManagersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. A managed instance group can have up to 1000 VM instances per group. Please contact Cloud Support if you need an increase in this limit.",
- // "flatPath": "projects/{project}/zones/{zone}/instanceGroupManagers",
- // "httpMethod": "POST",
- // "id": "compute.instanceGroupManagers.insert",
- // "parameterOrder": [
- // "project",
- // "zone"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone where you want to create the managed instance group.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instanceGroupManagers",
- // "request": {
- // "$ref": "InstanceGroupManager"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instanceGroupManagers.list":
-
-type InstanceGroupManagersListCall struct {
- s *Service
- project string
- zone string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves a list of managed instance groups that are contained
-// within the specified project and zone.
-//
-// - project: Project ID for this request.
-// - zone: The name of the zone where the managed instance group is
-// located.
-func (r *InstanceGroupManagersService) List(project string, zone string) *InstanceGroupManagersListCall {
- c := &InstanceGroupManagersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *InstanceGroupManagersListCall) Filter(filter string) *InstanceGroupManagersListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *InstanceGroupManagersListCall) MaxResults(maxResults int64) *InstanceGroupManagersListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *InstanceGroupManagersListCall) OrderBy(orderBy string) *InstanceGroupManagersListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *InstanceGroupManagersListCall) PageToken(pageToken string) *InstanceGroupManagersListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *InstanceGroupManagersListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InstanceGroupManagersListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *InstanceGroupManagersListCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListCall {
- 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 *InstanceGroupManagersListCall) IfNoneMatch(entityTag string) *InstanceGroupManagersListCall {
- 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 *InstanceGroupManagersListCall) Context(ctx context.Context) *InstanceGroupManagersListCall {
- 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 *InstanceGroupManagersListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstanceGroupManagersListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}/instanceGroupManagers")
- 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{
- "project": c.project,
- "zone": c.zone,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instanceGroupManagers.list" call.
-// Exactly one of *InstanceGroupManagerList or error will be non-nil.
-// Any non-2xx status code is an error. Response headers are in either
-// *InstanceGroupManagerList.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 *InstanceGroupManagersListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagerList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &InstanceGroupManagerList{
- 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": "Retrieves a list of managed instance groups that are contained within the specified project and zone.",
- // "flatPath": "projects/{project}/zones/{zone}/instanceGroupManagers",
- // "httpMethod": "GET",
- // "id": "compute.instanceGroupManagers.list",
- // "parameterOrder": [
- // "project",
- // "zone"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "zone": {
- // "description": "The name of the zone where the managed instance group is located.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instanceGroupManagers",
- // "response": {
- // "$ref": "InstanceGroupManagerList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *InstanceGroupManagersListCall) Pages(ctx context.Context, f func(*InstanceGroupManagerList) 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 "compute.instanceGroupManagers.listErrors":
-
-type InstanceGroupManagersListErrorsCall struct {
- s *Service
- project string
- zone string
- instanceGroupManager string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// ListErrors: Lists all errors thrown by actions on instances for a
-// given managed instance group. The filter and orderBy query parameters
-// are not supported.
-//
-// - instanceGroupManager: The name of the managed instance group. It
-// must be a string that meets the requirements in RFC1035, or an
-// unsigned long integer: must match regexp pattern: (?:a-z
-// (?:[-a-z0-9]{0,61}[a-z0-9])?)|1-9{0,19}.
-// - project: Project ID for this request.
-// - zone: The name of the zone where the managed instance group is
-// located. It should conform to RFC1035.
-func (r *InstanceGroupManagersService) ListErrors(project string, zone string, instanceGroupManager string) *InstanceGroupManagersListErrorsCall {
- c := &InstanceGroupManagersListErrorsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instanceGroupManager = instanceGroupManager
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *InstanceGroupManagersListErrorsCall) Filter(filter string) *InstanceGroupManagersListErrorsCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *InstanceGroupManagersListErrorsCall) MaxResults(maxResults int64) *InstanceGroupManagersListErrorsCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *InstanceGroupManagersListErrorsCall) OrderBy(orderBy string) *InstanceGroupManagersListErrorsCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *InstanceGroupManagersListErrorsCall) PageToken(pageToken string) *InstanceGroupManagersListErrorsCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *InstanceGroupManagersListErrorsCall) ReturnPartialSuccess(returnPartialSuccess bool) *InstanceGroupManagersListErrorsCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *InstanceGroupManagersListErrorsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListErrorsCall {
- 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 *InstanceGroupManagersListErrorsCall) IfNoneMatch(entityTag string) *InstanceGroupManagersListErrorsCall {
- 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 *InstanceGroupManagersListErrorsCall) Context(ctx context.Context) *InstanceGroupManagersListErrorsCall {
- 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 *InstanceGroupManagersListErrorsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstanceGroupManagersListErrorsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listErrors")
- 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{
- "project": c.project,
- "zone": c.zone,
- "instanceGroupManager": c.instanceGroupManager,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instanceGroupManagers.listErrors" call.
-// Exactly one of *InstanceGroupManagersListErrorsResponse or error will
-// be non-nil. Any non-2xx status code is an error. Response headers are
-// in either
-// *InstanceGroupManagersListErrorsResponse.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 *InstanceGroupManagersListErrorsCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagersListErrorsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &InstanceGroupManagersListErrorsResponse{
- 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": "Lists all errors thrown by actions on instances for a given managed instance group. The filter and orderBy query parameters are not supported.",
- // "flatPath": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listErrors",
- // "httpMethod": "GET",
- // "id": "compute.instanceGroupManagers.listErrors",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instanceGroupManager"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "instanceGroupManager": {
- // "description": "The name of the managed instance group. It must be a string that meets the requirements in RFC1035, or an unsigned long integer: must match regexp pattern: (?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|1-9{0,19}.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "zone": {
- // "description": "The name of the zone where the managed instance group is located. It should conform to RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listErrors",
- // "response": {
- // "$ref": "InstanceGroupManagersListErrorsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *InstanceGroupManagersListErrorsCall) Pages(ctx context.Context, f func(*InstanceGroupManagersListErrorsResponse) 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 "compute.instanceGroupManagers.listManagedInstances":
-
-type InstanceGroupManagersListManagedInstancesCall struct {
- s *Service
- project string
- zone string
- instanceGroupManager string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// ListManagedInstances: Lists all of the instances in the managed
-// instance group. Each instance in the list has a currentAction, which
-// indicates the action that the managed instance group is performing on
-// the instance. For example, if the group is still creating an
-// instance, the currentAction is CREATING. If a previous action failed,
-// the list displays the errors for that failed action. The orderBy
-// query parameter is not supported. The `pageToken` query parameter is
-// supported only if the group's `listManagedInstancesResults` field is
-// set to `PAGINATED`.
-//
-// - instanceGroupManager: The name of the managed instance group.
-// - project: Project ID for this request.
-// - zone: The name of the zone where the managed instance group is
-// located.
-func (r *InstanceGroupManagersService) ListManagedInstances(project string, zone string, instanceGroupManager string) *InstanceGroupManagersListManagedInstancesCall {
- c := &InstanceGroupManagersListManagedInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instanceGroupManager = instanceGroupManager
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *InstanceGroupManagersListManagedInstancesCall) Filter(filter string) *InstanceGroupManagersListManagedInstancesCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *InstanceGroupManagersListManagedInstancesCall) MaxResults(maxResults int64) *InstanceGroupManagersListManagedInstancesCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *InstanceGroupManagersListManagedInstancesCall) OrderBy(orderBy string) *InstanceGroupManagersListManagedInstancesCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *InstanceGroupManagersListManagedInstancesCall) PageToken(pageToken string) *InstanceGroupManagersListManagedInstancesCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *InstanceGroupManagersListManagedInstancesCall) ReturnPartialSuccess(returnPartialSuccess bool) *InstanceGroupManagersListManagedInstancesCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *InstanceGroupManagersListManagedInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListManagedInstancesCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstanceGroupManagersListManagedInstancesCall) Context(ctx context.Context) *InstanceGroupManagersListManagedInstancesCall {
- 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 *InstanceGroupManagersListManagedInstancesCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstanceGroupManagersListManagedInstancesCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instanceGroupManager": c.instanceGroupManager,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instanceGroupManagers.listManagedInstances" call.
-// Exactly one of *InstanceGroupManagersListManagedInstancesResponse or
-// error will be non-nil. Any non-2xx status code is an error. Response
-// headers are in either
-// *InstanceGroupManagersListManagedInstancesResponse.ServerResponse.Head
-// er 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 *InstanceGroupManagersListManagedInstancesCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagersListManagedInstancesResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &InstanceGroupManagersListManagedInstancesResponse{
- 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": "Lists all of the instances in the managed instance group. Each instance in the list has a currentAction, which indicates the action that the managed instance group is performing on the instance. For example, if the group is still creating an instance, the currentAction is CREATING. If a previous action failed, the list displays the errors for that failed action. The orderBy query parameter is not supported. The `pageToken` query parameter is supported only if the group's `listManagedInstancesResults` field is set to `PAGINATED`.",
- // "flatPath": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances",
- // "httpMethod": "POST",
- // "id": "compute.instanceGroupManagers.listManagedInstances",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instanceGroupManager"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "instanceGroupManager": {
- // "description": "The name of the managed instance group.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "zone": {
- // "description": "The name of the zone where the managed instance group is located.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances",
- // "response": {
- // "$ref": "InstanceGroupManagersListManagedInstancesResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *InstanceGroupManagersListManagedInstancesCall) Pages(ctx context.Context, f func(*InstanceGroupManagersListManagedInstancesResponse) 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 "compute.instanceGroupManagers.listPerInstanceConfigs":
-
-type InstanceGroupManagersListPerInstanceConfigsCall struct {
- s *Service
- project string
- zone string
- instanceGroupManager string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// ListPerInstanceConfigs: Lists all of the per-instance configurations
-// defined for the managed instance group. The orderBy query parameter
-// is not supported.
-//
-// - instanceGroupManager: The name of the managed instance group. It
-// should conform to RFC1035.
-// - project: Project ID for this request.
-// - zone: The name of the zone where the managed instance group is
-// located. It should conform to RFC1035.
-func (r *InstanceGroupManagersService) ListPerInstanceConfigs(project string, zone string, instanceGroupManager string) *InstanceGroupManagersListPerInstanceConfigsCall {
- c := &InstanceGroupManagersListPerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instanceGroupManager = instanceGroupManager
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *InstanceGroupManagersListPerInstanceConfigsCall) Filter(filter string) *InstanceGroupManagersListPerInstanceConfigsCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *InstanceGroupManagersListPerInstanceConfigsCall) MaxResults(maxResults int64) *InstanceGroupManagersListPerInstanceConfigsCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *InstanceGroupManagersListPerInstanceConfigsCall) OrderBy(orderBy string) *InstanceGroupManagersListPerInstanceConfigsCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *InstanceGroupManagersListPerInstanceConfigsCall) PageToken(pageToken string) *InstanceGroupManagersListPerInstanceConfigsCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *InstanceGroupManagersListPerInstanceConfigsCall) ReturnPartialSuccess(returnPartialSuccess bool) *InstanceGroupManagersListPerInstanceConfigsCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *InstanceGroupManagersListPerInstanceConfigsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListPerInstanceConfigsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstanceGroupManagersListPerInstanceConfigsCall) Context(ctx context.Context) *InstanceGroupManagersListPerInstanceConfigsCall {
- 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 *InstanceGroupManagersListPerInstanceConfigsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstanceGroupManagersListPerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listPerInstanceConfigs")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instanceGroupManager": c.instanceGroupManager,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instanceGroupManagers.listPerInstanceConfigs" call.
-// Exactly one of *InstanceGroupManagersListPerInstanceConfigsResp or
-// error will be non-nil. Any non-2xx status code is an error. Response
-// headers are in either
-// *InstanceGroupManagersListPerInstanceConfigsResp.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 *InstanceGroupManagersListPerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagersListPerInstanceConfigsResp, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &InstanceGroupManagersListPerInstanceConfigsResp{
- 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": "Lists all of the per-instance configurations defined for the managed instance group. The orderBy query parameter is not supported.",
- // "flatPath": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listPerInstanceConfigs",
- // "httpMethod": "POST",
- // "id": "compute.instanceGroupManagers.listPerInstanceConfigs",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instanceGroupManager"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "instanceGroupManager": {
- // "description": "The name of the managed instance group. It should conform to RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "zone": {
- // "description": "The name of the zone where the managed instance group is located. It should conform to RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listPerInstanceConfigs",
- // "response": {
- // "$ref": "InstanceGroupManagersListPerInstanceConfigsResp"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *InstanceGroupManagersListPerInstanceConfigsCall) Pages(ctx context.Context, f func(*InstanceGroupManagersListPerInstanceConfigsResp) 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 "compute.instanceGroupManagers.patch":
-
-type InstanceGroupManagersPatchCall struct {
- s *Service
- project string
- zone string
- instanceGroupManager string
- instancegroupmanager *InstanceGroupManager
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Updates a managed instance group using the information that
-// you specify in the request. This operation is marked as DONE when the
-// group is patched even if the instances in the group are still in the
-// process of being patched. You must separately verify the status of
-// the individual instances with the listManagedInstances method. This
-// method supports PATCH semantics and uses the JSON merge patch format
-// and processing rules. If you update your group to specify a new
-// template or instance configuration, it's possible that your intended
-// specification for each VM in the group is different from the current
-// state of that VM. To learn how to apply an updated configuration to
-// the VMs in a MIG, see Updating instances in a MIG.
-//
-// - instanceGroupManager: The name of the instance group manager.
-// - project: Project ID for this request.
-// - zone: The name of the zone where you want to create the managed
-// instance group.
-func (r *InstanceGroupManagersService) Patch(project string, zone string, instanceGroupManager string, instancegroupmanager *InstanceGroupManager) *InstanceGroupManagersPatchCall {
- c := &InstanceGroupManagersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instanceGroupManager = instanceGroupManager
- c.instancegroupmanager = instancegroupmanager
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstanceGroupManagersPatchCall) RequestId(requestId string) *InstanceGroupManagersPatchCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstanceGroupManagersPatchCall) Fields(s ...googleapi.Field) *InstanceGroupManagersPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstanceGroupManagersPatchCall) Context(ctx context.Context) *InstanceGroupManagersPatchCall {
- 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 *InstanceGroupManagersPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstanceGroupManagersPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instanceGroupManager": c.instanceGroupManager,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instanceGroupManagers.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstanceGroupManagersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listManagedInstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. If you update your group to specify a new template or instance configuration, it's possible that your intended specification for each VM in the group is different from the current state of that VM. To learn how to apply an updated configuration to the VMs in a MIG, see Updating instances in a MIG.",
- // "flatPath": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
- // "httpMethod": "PATCH",
- // "id": "compute.instanceGroupManagers.patch",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instanceGroupManager"
- // ],
- // "parameters": {
- // "instanceGroupManager": {
- // "description": "The name of the instance group manager.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone where you want to create the managed instance group.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
- // "request": {
- // "$ref": "InstanceGroupManager"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instanceGroupManagers.patchPerInstanceConfigs":
-
-type InstanceGroupManagersPatchPerInstanceConfigsCall struct {
- s *Service
- project string
- zone string
- instanceGroupManager string
- instancegroupmanagerspatchperinstanceconfigsreq *InstanceGroupManagersPatchPerInstanceConfigsReq
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// PatchPerInstanceConfigs: Inserts or patches per-instance
-// configurations for the managed instance group. perInstanceConfig.name
-// serves as a key used to distinguish whether to perform insert or
-// patch.
-//
-// - instanceGroupManager: The name of the managed instance group. It
-// should conform to RFC1035.
-// - project: Project ID for this request.
-// - zone: The name of the zone where the managed instance group is
-// located. It should conform to RFC1035.
-func (r *InstanceGroupManagersService) PatchPerInstanceConfigs(project string, zone string, instanceGroupManager string, instancegroupmanagerspatchperinstanceconfigsreq *InstanceGroupManagersPatchPerInstanceConfigsReq) *InstanceGroupManagersPatchPerInstanceConfigsCall {
- c := &InstanceGroupManagersPatchPerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instanceGroupManager = instanceGroupManager
- c.instancegroupmanagerspatchperinstanceconfigsreq = instancegroupmanagerspatchperinstanceconfigsreq
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstanceGroupManagersPatchPerInstanceConfigsCall) RequestId(requestId string) *InstanceGroupManagersPatchPerInstanceConfigsCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstanceGroupManagersPatchPerInstanceConfigsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersPatchPerInstanceConfigsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstanceGroupManagersPatchPerInstanceConfigsCall) Context(ctx context.Context) *InstanceGroupManagersPatchPerInstanceConfigsCall {
- 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 *InstanceGroupManagersPatchPerInstanceConfigsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstanceGroupManagersPatchPerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerspatchperinstanceconfigsreq)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/patchPerInstanceConfigs")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instanceGroupManager": c.instanceGroupManager,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instanceGroupManagers.patchPerInstanceConfigs" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstanceGroupManagersPatchPerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Inserts or patches per-instance configurations for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch.",
- // "flatPath": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/patchPerInstanceConfigs",
- // "httpMethod": "POST",
- // "id": "compute.instanceGroupManagers.patchPerInstanceConfigs",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instanceGroupManager"
- // ],
- // "parameters": {
- // "instanceGroupManager": {
- // "description": "The name of the managed instance group. It should conform to RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone where the managed instance group is located. It should conform to RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/patchPerInstanceConfigs",
- // "request": {
- // "$ref": "InstanceGroupManagersPatchPerInstanceConfigsReq"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instanceGroupManagers.recreateInstances":
-
-type InstanceGroupManagersRecreateInstancesCall struct {
- s *Service
- project string
- zone string
- instanceGroupManager string
- instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// RecreateInstances: Flags the specified VM instances in the managed
-// instance group to be immediately recreated. Each instance is
-// recreated using the group's current configuration. This operation is
-// marked as DONE when the flag is set even if the instances have not
-// yet been recreated. You must separately verify the status of each
-// instance by checking its currentAction field; for more information,
-// see Checking the status of managed instances. If the group is part of
-// a backend service that has enabled connection draining, it can take
-// up to 60 seconds after the connection draining duration has elapsed
-// before the VM instance is removed or deleted. You can specify a
-// maximum of 1000 instances with this method per request.
-//
-// - instanceGroupManager: The name of the managed instance group.
-// - project: Project ID for this request.
-// - zone: The name of the zone where the managed instance group is
-// located.
-func (r *InstanceGroupManagersService) RecreateInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest) *InstanceGroupManagersRecreateInstancesCall {
- c := &InstanceGroupManagersRecreateInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instanceGroupManager = instanceGroupManager
- c.instancegroupmanagersrecreateinstancesrequest = instancegroupmanagersrecreateinstancesrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstanceGroupManagersRecreateInstancesCall) RequestId(requestId string) *InstanceGroupManagersRecreateInstancesCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstanceGroupManagersRecreateInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersRecreateInstancesCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstanceGroupManagersRecreateInstancesCall) Context(ctx context.Context) *InstanceGroupManagersRecreateInstancesCall {
- 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 *InstanceGroupManagersRecreateInstancesCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstanceGroupManagersRecreateInstancesCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersrecreateinstancesrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instanceGroupManager": c.instanceGroupManager,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instanceGroupManagers.recreateInstances" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstanceGroupManagersRecreateInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Flags the specified VM instances in the managed instance group to be immediately recreated. Each instance is recreated using the group's current configuration. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of each instance by checking its currentAction field; for more information, see Checking the status of managed instances. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request.",
- // "flatPath": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances",
- // "httpMethod": "POST",
- // "id": "compute.instanceGroupManagers.recreateInstances",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instanceGroupManager"
- // ],
- // "parameters": {
- // "instanceGroupManager": {
- // "description": "The name of the managed instance group.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone where the managed instance group is located.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances",
- // "request": {
- // "$ref": "InstanceGroupManagersRecreateInstancesRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instanceGroupManagers.resize":
-
-type InstanceGroupManagersResizeCall struct {
- s *Service
- project string
- zone string
- instanceGroupManager string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Resize: Resizes the managed instance group. If you increase the size,
-// the group creates new instances using the current instance template.
-// If you decrease the size, the group deletes instances. The resize
-// operation is marked DONE when the resize actions are scheduled even
-// if the group has not yet added or deleted any instances. You must
-// separately verify the status of the creating or deleting actions with
-// the listmanagedinstances method. When resizing down, the instance
-// group arbitrarily chooses the order in which VMs are deleted. The
-// group takes into account some VM attributes when making the selection
-// including: + The status of the VM instance. + The health of the VM
-// instance. + The instance template version the VM is based on. + For
-// regional managed instance groups, the location of the VM instance.
-// This list is subject to change. If the group is part of a backend
-// service that has enabled connection draining, it can take up to 60
-// seconds after the connection draining duration has elapsed before the
-// VM instance is removed or deleted.
-//
-// - instanceGroupManager: The name of the managed instance group.
-// - project: Project ID for this request.
-// - size: The number of running instances that the managed instance
-// group should maintain at any given time. The group automatically
-// adds or removes instances to maintain the number of instances
-// specified by this parameter.
-// - zone: The name of the zone where the managed instance group is
-// located.
-func (r *InstanceGroupManagersService) Resize(project string, zone string, instanceGroupManager string, size int64) *InstanceGroupManagersResizeCall {
- c := &InstanceGroupManagersResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instanceGroupManager = instanceGroupManager
- c.urlParams_.Set("size", fmt.Sprint(size))
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstanceGroupManagersResizeCall) RequestId(requestId string) *InstanceGroupManagersResizeCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstanceGroupManagersResizeCall) Fields(s ...googleapi.Field) *InstanceGroupManagersResizeCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstanceGroupManagersResizeCall) Context(ctx context.Context) *InstanceGroupManagersResizeCall {
- 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 *InstanceGroupManagersResizeCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstanceGroupManagersResizeCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instanceGroupManager": c.instanceGroupManager,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instanceGroupManagers.resize" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstanceGroupManagersResizeCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. When resizing down, the instance group arbitrarily chooses the order in which VMs are deleted. The group takes into account some VM attributes when making the selection including: + The status of the VM instance. + The health of the VM instance. + The instance template version the VM is based on. + For regional managed instance groups, the location of the VM instance. This list is subject to change. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.",
- // "flatPath": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize",
- // "httpMethod": "POST",
- // "id": "compute.instanceGroupManagers.resize",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instanceGroupManager",
- // "size"
- // ],
- // "parameters": {
- // "instanceGroupManager": {
- // "description": "The name of the managed instance group.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "size": {
- // "description": "The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter.",
- // "format": "int32",
- // "location": "query",
- // "required": true,
- // "type": "integer"
- // },
- // "zone": {
- // "description": "The name of the zone where the managed instance group is located.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instanceGroupManagers.setInstanceTemplate":
-
-type InstanceGroupManagersSetInstanceTemplateCall struct {
- s *Service
- project string
- zone string
- instanceGroupManager string
- instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetInstanceTemplate: Specifies the instance template to use when
-// creating new instances in this group. The templates for existing
-// instances in the group do not change unless you run
-// recreateInstances, run applyUpdatesToInstances, or set the group's
-// updatePolicy.type to PROACTIVE.
-//
-// - instanceGroupManager: The name of the managed instance group.
-// - project: Project ID for this request.
-// - zone: The name of the zone where the managed instance group is
-// located.
-func (r *InstanceGroupManagersService) SetInstanceTemplate(project string, zone string, instanceGroupManager string, instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest) *InstanceGroupManagersSetInstanceTemplateCall {
- c := &InstanceGroupManagersSetInstanceTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instanceGroupManager = instanceGroupManager
- c.instancegroupmanagerssetinstancetemplaterequest = instancegroupmanagerssetinstancetemplaterequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstanceGroupManagersSetInstanceTemplateCall) RequestId(requestId string) *InstanceGroupManagersSetInstanceTemplateCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstanceGroupManagersSetInstanceTemplateCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetInstanceTemplateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstanceGroupManagersSetInstanceTemplateCall) Context(ctx context.Context) *InstanceGroupManagersSetInstanceTemplateCall {
- 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 *InstanceGroupManagersSetInstanceTemplateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstanceGroupManagersSetInstanceTemplateCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssetinstancetemplaterequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instanceGroupManager": c.instanceGroupManager,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instanceGroupManagers.setInstanceTemplate" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstanceGroupManagersSetInstanceTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Specifies the instance template to use when creating new instances in this group. The templates for existing instances in the group do not change unless you run recreateInstances, run applyUpdatesToInstances, or set the group's updatePolicy.type to PROACTIVE.",
- // "flatPath": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate",
- // "httpMethod": "POST",
- // "id": "compute.instanceGroupManagers.setInstanceTemplate",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instanceGroupManager"
- // ],
- // "parameters": {
- // "instanceGroupManager": {
- // "description": "The name of the managed instance group.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone where the managed instance group is located.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate",
- // "request": {
- // "$ref": "InstanceGroupManagersSetInstanceTemplateRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instanceGroupManagers.setTargetPools":
-
-type InstanceGroupManagersSetTargetPoolsCall struct {
- s *Service
- project string
- zone string
- instanceGroupManager string
- instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetTargetPools: Modifies the target pools to which all instances in
-// this managed instance group are assigned. The target pools
-// automatically apply to all of the instances in the managed instance
-// group. This operation is marked DONE when you make the request even
-// if the instances have not yet been added to their target pools. The
-// change might take some time to apply to all of the instances in the
-// group depending on the size of the group.
-//
-// - instanceGroupManager: The name of the managed instance group.
-// - project: Project ID for this request.
-// - zone: The name of the zone where the managed instance group is
-// located.
-func (r *InstanceGroupManagersService) SetTargetPools(project string, zone string, instanceGroupManager string, instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest) *InstanceGroupManagersSetTargetPoolsCall {
- c := &InstanceGroupManagersSetTargetPoolsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instanceGroupManager = instanceGroupManager
- c.instancegroupmanagerssettargetpoolsrequest = instancegroupmanagerssettargetpoolsrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstanceGroupManagersSetTargetPoolsCall) RequestId(requestId string) *InstanceGroupManagersSetTargetPoolsCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstanceGroupManagersSetTargetPoolsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetTargetPoolsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstanceGroupManagersSetTargetPoolsCall) Context(ctx context.Context) *InstanceGroupManagersSetTargetPoolsCall {
- 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 *InstanceGroupManagersSetTargetPoolsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssettargetpoolsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instanceGroupManager": c.instanceGroupManager,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instanceGroupManagers.setTargetPools" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstanceGroupManagersSetTargetPoolsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Modifies the target pools to which all instances in this managed instance group are assigned. The target pools automatically apply to all of the instances in the managed instance group. This operation is marked DONE when you make the request even if the instances have not yet been added to their target pools. The change might take some time to apply to all of the instances in the group depending on the size of the group.",
- // "flatPath": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools",
- // "httpMethod": "POST",
- // "id": "compute.instanceGroupManagers.setTargetPools",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instanceGroupManager"
- // ],
- // "parameters": {
- // "instanceGroupManager": {
- // "description": "The name of the managed instance group.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone where the managed instance group is located.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools",
- // "request": {
- // "$ref": "InstanceGroupManagersSetTargetPoolsRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instanceGroupManagers.updatePerInstanceConfigs":
-
-type InstanceGroupManagersUpdatePerInstanceConfigsCall struct {
- s *Service
- project string
- zone string
- instanceGroupManager string
- instancegroupmanagersupdateperinstanceconfigsreq *InstanceGroupManagersUpdatePerInstanceConfigsReq
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// UpdatePerInstanceConfigs: Inserts or updates per-instance
-// configurations for the managed instance group. perInstanceConfig.name
-// serves as a key used to distinguish whether to perform insert or
-// patch.
-//
-// - instanceGroupManager: The name of the managed instance group. It
-// should conform to RFC1035.
-// - project: Project ID for this request.
-// - zone: The name of the zone where the managed instance group is
-// located. It should conform to RFC1035.
-func (r *InstanceGroupManagersService) UpdatePerInstanceConfigs(project string, zone string, instanceGroupManager string, instancegroupmanagersupdateperinstanceconfigsreq *InstanceGroupManagersUpdatePerInstanceConfigsReq) *InstanceGroupManagersUpdatePerInstanceConfigsCall {
- c := &InstanceGroupManagersUpdatePerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instanceGroupManager = instanceGroupManager
- c.instancegroupmanagersupdateperinstanceconfigsreq = instancegroupmanagersupdateperinstanceconfigsreq
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) RequestId(requestId string) *InstanceGroupManagersUpdatePerInstanceConfigsCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstanceGroupManagersUpdatePerInstanceConfigsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersUpdatePerInstanceConfigsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstanceGroupManagersUpdatePerInstanceConfigsCall) Context(ctx context.Context) *InstanceGroupManagersUpdatePerInstanceConfigsCall {
- 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 *InstanceGroupManagersUpdatePerInstanceConfigsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersupdateperinstanceconfigsreq)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/updatePerInstanceConfigs")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instanceGroupManager": c.instanceGroupManager,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instanceGroupManagers.updatePerInstanceConfigs" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstanceGroupManagersUpdatePerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Inserts or updates per-instance configurations for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch.",
- // "flatPath": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/updatePerInstanceConfigs",
- // "httpMethod": "POST",
- // "id": "compute.instanceGroupManagers.updatePerInstanceConfigs",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instanceGroupManager"
- // ],
- // "parameters": {
- // "instanceGroupManager": {
- // "description": "The name of the managed instance group. It should conform to RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone where the managed instance group is located. It should conform to RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/updatePerInstanceConfigs",
- // "request": {
- // "$ref": "InstanceGroupManagersUpdatePerInstanceConfigsReq"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instanceGroups.addInstances":
-
-type InstanceGroupsAddInstancesCall struct {
- s *Service
- project string
- zone string
- instanceGroup string
- instancegroupsaddinstancesrequest *InstanceGroupsAddInstancesRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// AddInstances: Adds a list of instances to the specified instance
-// group. All of the instances in the instance group must be in the same
-// network/subnetwork. Read Adding instances for more information.
-//
-// - instanceGroup: The name of the instance group where you are adding
-// instances.
-// - project: Project ID for this request.
-// - zone: The name of the zone where the instance group is located.
-func (r *InstanceGroupsService) AddInstances(project string, zone string, instanceGroup string, instancegroupsaddinstancesrequest *InstanceGroupsAddInstancesRequest) *InstanceGroupsAddInstancesCall {
- c := &InstanceGroupsAddInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instanceGroup = instanceGroup
- c.instancegroupsaddinstancesrequest = instancegroupsaddinstancesrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstanceGroupsAddInstancesCall) RequestId(requestId string) *InstanceGroupsAddInstancesCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstanceGroupsAddInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsAddInstancesCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstanceGroupsAddInstancesCall) Context(ctx context.Context) *InstanceGroupsAddInstancesCall {
- 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 *InstanceGroupsAddInstancesCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstanceGroupsAddInstancesCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsaddinstancesrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instanceGroup": c.instanceGroup,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instanceGroups.addInstances" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstanceGroupsAddInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Adds a list of instances to the specified instance group. All of the instances in the instance group must be in the same network/subnetwork. Read Adding instances for more information.",
- // "flatPath": "projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances",
- // "httpMethod": "POST",
- // "id": "compute.instanceGroups.addInstances",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instanceGroup"
- // ],
- // "parameters": {
- // "instanceGroup": {
- // "description": "The name of the instance group where you are adding instances.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone where the instance group is located.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances",
- // "request": {
- // "$ref": "InstanceGroupsAddInstancesRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instanceGroups.aggregatedList":
-
-type InstanceGroupsAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Retrieves the list of instance groups and sorts them
-// by zone.
-//
-// - project: Project ID for this request.
-func (r *InstanceGroupsService) AggregatedList(project string) *InstanceGroupsAggregatedListCall {
- c := &InstanceGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *InstanceGroupsAggregatedListCall) Filter(filter string) *InstanceGroupsAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *InstanceGroupsAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *InstanceGroupsAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *InstanceGroupsAggregatedListCall) MaxResults(maxResults int64) *InstanceGroupsAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *InstanceGroupsAggregatedListCall) OrderBy(orderBy string) *InstanceGroupsAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *InstanceGroupsAggregatedListCall) PageToken(pageToken string) *InstanceGroupsAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *InstanceGroupsAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InstanceGroupsAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *InstanceGroupsAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *InstanceGroupsAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *InstanceGroupsAggregatedListCall) Fields(s ...googleapi.Field) *InstanceGroupsAggregatedListCall {
- 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 *InstanceGroupsAggregatedListCall) IfNoneMatch(entityTag string) *InstanceGroupsAggregatedListCall {
- 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 *InstanceGroupsAggregatedListCall) Context(ctx context.Context) *InstanceGroupsAggregatedListCall {
- 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 *InstanceGroupsAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstanceGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/instanceGroups")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instanceGroups.aggregatedList" call.
-// Exactly one of *InstanceGroupAggregatedList or error will be non-nil.
-// Any non-2xx status code is an error. Response headers are in either
-// *InstanceGroupAggregatedList.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 *InstanceGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &InstanceGroupAggregatedList{
- 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": "Retrieves the list of instance groups and sorts them by zone.",
- // "flatPath": "projects/{project}/aggregated/instanceGroups",
- // "httpMethod": "GET",
- // "id": "compute.instanceGroups.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/instanceGroups",
- // "response": {
- // "$ref": "InstanceGroupAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *InstanceGroupsAggregatedListCall) Pages(ctx context.Context, f func(*InstanceGroupAggregatedList) 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 "compute.instanceGroups.delete":
-
-type InstanceGroupsDeleteCall struct {
- s *Service
- project string
- zone string
- instanceGroup string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified instance group. The instances in the
-// group are not deleted. Note that instance group must not belong to a
-// backend service. Read Deleting an instance group for more
-// information.
-//
-// - instanceGroup: The name of the instance group to delete.
-// - project: Project ID for this request.
-// - zone: The name of the zone where the instance group is located.
-func (r *InstanceGroupsService) Delete(project string, zone string, instanceGroup string) *InstanceGroupsDeleteCall {
- c := &InstanceGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instanceGroup = instanceGroup
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstanceGroupsDeleteCall) RequestId(requestId string) *InstanceGroupsDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstanceGroupsDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupsDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstanceGroupsDeleteCall) Context(ctx context.Context) *InstanceGroupsDeleteCall {
- 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 *InstanceGroupsDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstanceGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instanceGroup": c.instanceGroup,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instanceGroups.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstanceGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified instance group. The instances in the group are not deleted. Note that instance group must not belong to a backend service. Read Deleting an instance group for more information.",
- // "flatPath": "projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}",
- // "httpMethod": "DELETE",
- // "id": "compute.instanceGroups.delete",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instanceGroup"
- // ],
- // "parameters": {
- // "instanceGroup": {
- // "description": "The name of the instance group to delete.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone where the instance group is located.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instanceGroups.get":
-
-type InstanceGroupsGetCall struct {
- s *Service
- project string
- zone string
- instanceGroup string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified zonal instance group. Get a list of
-// available zonal instance groups by making a list() request. For
-// managed instance groups, use the instanceGroupManagers or
-// regionInstanceGroupManagers methods instead.
-//
-// - instanceGroup: The name of the instance group.
-// - project: Project ID for this request.
-// - zone: The name of the zone where the instance group is located.
-func (r *InstanceGroupsService) Get(project string, zone string, instanceGroup string) *InstanceGroupsGetCall {
- c := &InstanceGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instanceGroup = instanceGroup
- 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 *InstanceGroupsGetCall) Fields(s ...googleapi.Field) *InstanceGroupsGetCall {
- 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 *InstanceGroupsGetCall) IfNoneMatch(entityTag string) *InstanceGroupsGetCall {
- 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 *InstanceGroupsGetCall) Context(ctx context.Context) *InstanceGroupsGetCall {
- 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 *InstanceGroupsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstanceGroupsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}")
- 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{
- "project": c.project,
- "zone": c.zone,
- "instanceGroup": c.instanceGroup,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instanceGroups.get" call.
-// Exactly one of *InstanceGroup or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *InstanceGroup.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 *InstanceGroupsGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroup, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &InstanceGroup{
- 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": "Returns the specified zonal instance group. Get a list of available zonal instance groups by making a list() request. For managed instance groups, use the instanceGroupManagers or regionInstanceGroupManagers methods instead.",
- // "flatPath": "projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}",
- // "httpMethod": "GET",
- // "id": "compute.instanceGroups.get",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instanceGroup"
- // ],
- // "parameters": {
- // "instanceGroup": {
- // "description": "The name of the instance group.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone where the instance group is located.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}",
- // "response": {
- // "$ref": "InstanceGroup"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.instanceGroups.insert":
-
-type InstanceGroupsInsertCall struct {
- s *Service
- project string
- zone string
- instancegroup *InstanceGroup
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates an instance group in the specified project using the
-// parameters that are included in the request.
-//
-// - project: Project ID for this request.
-// - zone: The name of the zone where you want to create the instance
-// group.
-func (r *InstanceGroupsService) Insert(project string, zone string, instancegroup *InstanceGroup) *InstanceGroupsInsertCall {
- c := &InstanceGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instancegroup = instancegroup
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstanceGroupsInsertCall) RequestId(requestId string) *InstanceGroupsInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstanceGroupsInsertCall) Fields(s ...googleapi.Field) *InstanceGroupsInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstanceGroupsInsertCall) Context(ctx context.Context) *InstanceGroupsInsertCall {
- 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 *InstanceGroupsInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstanceGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroup)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroups")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instanceGroups.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstanceGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates an instance group in the specified project using the parameters that are included in the request.",
- // "flatPath": "projects/{project}/zones/{zone}/instanceGroups",
- // "httpMethod": "POST",
- // "id": "compute.instanceGroups.insert",
- // "parameterOrder": [
- // "project",
- // "zone"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone where you want to create the instance group.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instanceGroups",
- // "request": {
- // "$ref": "InstanceGroup"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instanceGroups.list":
-
-type InstanceGroupsListCall struct {
- s *Service
- project string
- zone string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves the list of zonal instance group resources contained
-// within the specified zone. For managed instance groups, use the
-// instanceGroupManagers or regionInstanceGroupManagers methods instead.
-//
-// - project: Project ID for this request.
-// - zone: The name of the zone where the instance group is located.
-func (r *InstanceGroupsService) List(project string, zone string) *InstanceGroupsListCall {
- c := &InstanceGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *InstanceGroupsListCall) Filter(filter string) *InstanceGroupsListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *InstanceGroupsListCall) MaxResults(maxResults int64) *InstanceGroupsListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *InstanceGroupsListCall) OrderBy(orderBy string) *InstanceGroupsListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *InstanceGroupsListCall) PageToken(pageToken string) *InstanceGroupsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *InstanceGroupsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InstanceGroupsListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *InstanceGroupsListCall) Fields(s ...googleapi.Field) *InstanceGroupsListCall {
- 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 *InstanceGroupsListCall) IfNoneMatch(entityTag string) *InstanceGroupsListCall {
- 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 *InstanceGroupsListCall) Context(ctx context.Context) *InstanceGroupsListCall {
- 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 *InstanceGroupsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstanceGroupsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}/instanceGroups")
- 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{
- "project": c.project,
- "zone": c.zone,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instanceGroups.list" call.
-// Exactly one of *InstanceGroupList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *InstanceGroupList.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 *InstanceGroupsListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &InstanceGroupList{
- 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": "Retrieves the list of zonal instance group resources contained within the specified zone. For managed instance groups, use the instanceGroupManagers or regionInstanceGroupManagers methods instead.",
- // "flatPath": "projects/{project}/zones/{zone}/instanceGroups",
- // "httpMethod": "GET",
- // "id": "compute.instanceGroups.list",
- // "parameterOrder": [
- // "project",
- // "zone"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "zone": {
- // "description": "The name of the zone where the instance group is located.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instanceGroups",
- // "response": {
- // "$ref": "InstanceGroupList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *InstanceGroupsListCall) Pages(ctx context.Context, f func(*InstanceGroupList) 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 "compute.instanceGroups.listInstances":
-
-type InstanceGroupsListInstancesCall struct {
- s *Service
- project string
- zone string
- instanceGroup string
- instancegroupslistinstancesrequest *InstanceGroupsListInstancesRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// ListInstances: Lists the instances in the specified instance group.
-// The orderBy query parameter is not supported. The filter query
-// parameter is supported, but only for expressions that use `eq`
-// (equal) or `ne` (not equal) operators.
-//
-// - instanceGroup: The name of the instance group from which you want
-// to generate a list of included instances.
-// - project: Project ID for this request.
-// - zone: The name of the zone where the instance group is located.
-func (r *InstanceGroupsService) ListInstances(project string, zone string, instanceGroup string, instancegroupslistinstancesrequest *InstanceGroupsListInstancesRequest) *InstanceGroupsListInstancesCall {
- c := &InstanceGroupsListInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instanceGroup = instanceGroup
- c.instancegroupslistinstancesrequest = instancegroupslistinstancesrequest
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *InstanceGroupsListInstancesCall) Filter(filter string) *InstanceGroupsListInstancesCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *InstanceGroupsListInstancesCall) MaxResults(maxResults int64) *InstanceGroupsListInstancesCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *InstanceGroupsListInstancesCall) OrderBy(orderBy string) *InstanceGroupsListInstancesCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *InstanceGroupsListInstancesCall) PageToken(pageToken string) *InstanceGroupsListInstancesCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *InstanceGroupsListInstancesCall) ReturnPartialSuccess(returnPartialSuccess bool) *InstanceGroupsListInstancesCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *InstanceGroupsListInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsListInstancesCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstanceGroupsListInstancesCall) Context(ctx context.Context) *InstanceGroupsListInstancesCall {
- 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 *InstanceGroupsListInstancesCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstanceGroupsListInstancesCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupslistinstancesrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instanceGroup": c.instanceGroup,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instanceGroups.listInstances" call.
-// Exactly one of *InstanceGroupsListInstances or error will be non-nil.
-// Any non-2xx status code is an error. Response headers are in either
-// *InstanceGroupsListInstances.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 *InstanceGroupsListInstancesCall) Do(opts ...googleapi.CallOption) (*InstanceGroupsListInstances, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &InstanceGroupsListInstances{
- 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": "Lists the instances in the specified instance group. The orderBy query parameter is not supported. The filter query parameter is supported, but only for expressions that use `eq` (equal) or `ne` (not equal) operators.",
- // "flatPath": "projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances",
- // "httpMethod": "POST",
- // "id": "compute.instanceGroups.listInstances",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instanceGroup"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "instanceGroup": {
- // "description": "The name of the instance group from which you want to generate a list of included instances.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "zone": {
- // "description": "The name of the zone where the instance group is located.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances",
- // "request": {
- // "$ref": "InstanceGroupsListInstancesRequest"
- // },
- // "response": {
- // "$ref": "InstanceGroupsListInstances"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *InstanceGroupsListInstancesCall) Pages(ctx context.Context, f func(*InstanceGroupsListInstances) 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 "compute.instanceGroups.removeInstances":
-
-type InstanceGroupsRemoveInstancesCall struct {
- s *Service
- project string
- zone string
- instanceGroup string
- instancegroupsremoveinstancesrequest *InstanceGroupsRemoveInstancesRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// RemoveInstances: Removes one or more instances from the specified
-// instance group, but does not delete those instances. If the group is
-// part of a backend service that has enabled connection draining, it
-// can take up to 60 seconds after the connection draining duration
-// before the VM instance is removed or deleted.
-//
-// - instanceGroup: The name of the instance group where the specified
-// instances will be removed.
-// - project: Project ID for this request.
-// - zone: The name of the zone where the instance group is located.
-func (r *InstanceGroupsService) RemoveInstances(project string, zone string, instanceGroup string, instancegroupsremoveinstancesrequest *InstanceGroupsRemoveInstancesRequest) *InstanceGroupsRemoveInstancesCall {
- c := &InstanceGroupsRemoveInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instanceGroup = instanceGroup
- c.instancegroupsremoveinstancesrequest = instancegroupsremoveinstancesrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstanceGroupsRemoveInstancesCall) RequestId(requestId string) *InstanceGroupsRemoveInstancesCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstanceGroupsRemoveInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsRemoveInstancesCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstanceGroupsRemoveInstancesCall) Context(ctx context.Context) *InstanceGroupsRemoveInstancesCall {
- 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 *InstanceGroupsRemoveInstancesCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstanceGroupsRemoveInstancesCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsremoveinstancesrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instanceGroup": c.instanceGroup,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instanceGroups.removeInstances" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstanceGroupsRemoveInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Removes one or more instances from the specified instance group, but does not delete those instances. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration before the VM instance is removed or deleted.",
- // "flatPath": "projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances",
- // "httpMethod": "POST",
- // "id": "compute.instanceGroups.removeInstances",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instanceGroup"
- // ],
- // "parameters": {
- // "instanceGroup": {
- // "description": "The name of the instance group where the specified instances will be removed.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone where the instance group is located.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances",
- // "request": {
- // "$ref": "InstanceGroupsRemoveInstancesRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instanceGroups.setNamedPorts":
-
-type InstanceGroupsSetNamedPortsCall struct {
- s *Service
- project string
- zone string
- instanceGroup string
- instancegroupssetnamedportsrequest *InstanceGroupsSetNamedPortsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetNamedPorts: Sets the named ports for the specified instance group.
-//
-// - instanceGroup: The name of the instance group where the named ports
-// are updated.
-// - project: Project ID for this request.
-// - zone: The name of the zone where the instance group is located.
-func (r *InstanceGroupsService) SetNamedPorts(project string, zone string, instanceGroup string, instancegroupssetnamedportsrequest *InstanceGroupsSetNamedPortsRequest) *InstanceGroupsSetNamedPortsCall {
- c := &InstanceGroupsSetNamedPortsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instanceGroup = instanceGroup
- c.instancegroupssetnamedportsrequest = instancegroupssetnamedportsrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstanceGroupsSetNamedPortsCall) RequestId(requestId string) *InstanceGroupsSetNamedPortsCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstanceGroupsSetNamedPortsCall) Fields(s ...googleapi.Field) *InstanceGroupsSetNamedPortsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstanceGroupsSetNamedPortsCall) Context(ctx context.Context) *InstanceGroupsSetNamedPortsCall {
- 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 *InstanceGroupsSetNamedPortsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstanceGroupsSetNamedPortsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupssetnamedportsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instanceGroup": c.instanceGroup,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instanceGroups.setNamedPorts" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstanceGroupsSetNamedPortsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Sets the named ports for the specified instance group.",
- // "flatPath": "projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts",
- // "httpMethod": "POST",
- // "id": "compute.instanceGroups.setNamedPorts",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instanceGroup"
- // ],
- // "parameters": {
- // "instanceGroup": {
- // "description": "The name of the instance group where the named ports are updated.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone where the instance group is located.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts",
- // "request": {
- // "$ref": "InstanceGroupsSetNamedPortsRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instanceTemplates.aggregatedList":
-
-type InstanceTemplatesAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Retrieves the list of all InstanceTemplates
-// resources, regional and global, available to the specified project.
-//
-// - project: Name of the project scoping this request.
-func (r *InstanceTemplatesService) AggregatedList(project string) *InstanceTemplatesAggregatedListCall {
- c := &InstanceTemplatesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *InstanceTemplatesAggregatedListCall) Filter(filter string) *InstanceTemplatesAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *InstanceTemplatesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *InstanceTemplatesAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *InstanceTemplatesAggregatedListCall) MaxResults(maxResults int64) *InstanceTemplatesAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *InstanceTemplatesAggregatedListCall) OrderBy(orderBy string) *InstanceTemplatesAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *InstanceTemplatesAggregatedListCall) PageToken(pageToken string) *InstanceTemplatesAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *InstanceTemplatesAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InstanceTemplatesAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *InstanceTemplatesAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *InstanceTemplatesAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *InstanceTemplatesAggregatedListCall) Fields(s ...googleapi.Field) *InstanceTemplatesAggregatedListCall {
- 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 *InstanceTemplatesAggregatedListCall) IfNoneMatch(entityTag string) *InstanceTemplatesAggregatedListCall {
- 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 *InstanceTemplatesAggregatedListCall) Context(ctx context.Context) *InstanceTemplatesAggregatedListCall {
- 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 *InstanceTemplatesAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstanceTemplatesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/instanceTemplates")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instanceTemplates.aggregatedList" call.
-// Exactly one of *InstanceTemplateAggregatedList or error will be
-// non-nil. Any non-2xx status code is an error. Response headers are in
-// either *InstanceTemplateAggregatedList.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 *InstanceTemplatesAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceTemplateAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &InstanceTemplateAggregatedList{
- 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": "Retrieves the list of all InstanceTemplates resources, regional and global, available to the specified project.",
- // "flatPath": "projects/{project}/aggregated/instanceTemplates",
- // "httpMethod": "GET",
- // "id": "compute.instanceTemplates.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Name of the project scoping this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/instanceTemplates",
- // "response": {
- // "$ref": "InstanceTemplateAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *InstanceTemplatesAggregatedListCall) Pages(ctx context.Context, f func(*InstanceTemplateAggregatedList) 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 "compute.instanceTemplates.delete":
-
-type InstanceTemplatesDeleteCall struct {
- s *Service
- project string
- instanceTemplate string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified instance template. Deleting an instance
-// template is permanent and cannot be undone. It is not possible to
-// delete templates that are already in use by a managed instance group.
-//
-// - instanceTemplate: The name of the instance template to delete.
-// - project: Project ID for this request.
-func (r *InstanceTemplatesService) Delete(project string, instanceTemplate string) *InstanceTemplatesDeleteCall {
- c := &InstanceTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instanceTemplate = instanceTemplate
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstanceTemplatesDeleteCall) RequestId(requestId string) *InstanceTemplatesDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstanceTemplatesDeleteCall) Fields(s ...googleapi.Field) *InstanceTemplatesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstanceTemplatesDeleteCall) Context(ctx context.Context) *InstanceTemplatesDeleteCall {
- 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 *InstanceTemplatesDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstanceTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/instanceTemplates/{instanceTemplate}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "instanceTemplate": c.instanceTemplate,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instanceTemplates.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstanceTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone. It is not possible to delete templates that are already in use by a managed instance group.",
- // "flatPath": "projects/{project}/global/instanceTemplates/{instanceTemplate}",
- // "httpMethod": "DELETE",
- // "id": "compute.instanceTemplates.delete",
- // "parameterOrder": [
- // "project",
- // "instanceTemplate"
- // ],
- // "parameters": {
- // "instanceTemplate": {
- // "description": "The name of the instance template to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/instanceTemplates/{instanceTemplate}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instanceTemplates.get":
-
-type InstanceTemplatesGetCall struct {
- s *Service
- project string
- instanceTemplate string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified instance template.
-//
-// - instanceTemplate: The name of the instance template.
-// - project: Project ID for this request.
-func (r *InstanceTemplatesService) Get(project string, instanceTemplate string) *InstanceTemplatesGetCall {
- c := &InstanceTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instanceTemplate = instanceTemplate
- 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 *InstanceTemplatesGetCall) Fields(s ...googleapi.Field) *InstanceTemplatesGetCall {
- 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 *InstanceTemplatesGetCall) IfNoneMatch(entityTag string) *InstanceTemplatesGetCall {
- 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 *InstanceTemplatesGetCall) Context(ctx context.Context) *InstanceTemplatesGetCall {
- 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 *InstanceTemplatesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstanceTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/instanceTemplates/{instanceTemplate}")
- 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{
- "project": c.project,
- "instanceTemplate": c.instanceTemplate,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instanceTemplates.get" call.
-// Exactly one of *InstanceTemplate or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *InstanceTemplate.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 *InstanceTemplatesGetCall) Do(opts ...googleapi.CallOption) (*InstanceTemplate, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &InstanceTemplate{
- 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": "Returns the specified instance template.",
- // "flatPath": "projects/{project}/global/instanceTemplates/{instanceTemplate}",
- // "httpMethod": "GET",
- // "id": "compute.instanceTemplates.get",
- // "parameterOrder": [
- // "project",
- // "instanceTemplate"
- // ],
- // "parameters": {
- // "instanceTemplate": {
- // "description": "The name of the instance template.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/instanceTemplates/{instanceTemplate}",
- // "response": {
- // "$ref": "InstanceTemplate"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.instanceTemplates.getIamPolicy":
-
-type InstanceTemplatesGetIamPolicyCall struct {
- s *Service
- project string
- resource string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetIamPolicy: Gets the access control policy for a resource. May be
-// empty if no such policy or resource exists.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-func (r *InstanceTemplatesService) GetIamPolicy(project string, resource string) *InstanceTemplatesGetIamPolicyCall {
- c := &InstanceTemplatesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.resource = resource
- return c
-}
-
-// OptionsRequestedPolicyVersion sets the optional parameter
-// "optionsRequestedPolicyVersion": Requested IAM Policy version.
-func (c *InstanceTemplatesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *InstanceTemplatesGetIamPolicyCall {
- c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
- 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 *InstanceTemplatesGetIamPolicyCall) Fields(s ...googleapi.Field) *InstanceTemplatesGetIamPolicyCall {
- 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 *InstanceTemplatesGetIamPolicyCall) IfNoneMatch(entityTag string) *InstanceTemplatesGetIamPolicyCall {
- 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 *InstanceTemplatesGetIamPolicyCall) Context(ctx context.Context) *InstanceTemplatesGetIamPolicyCall {
- 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 *InstanceTemplatesGetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstanceTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/instanceTemplates/{resource}/getIamPolicy")
- 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{
- "project": c.project,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instanceTemplates.getIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *InstanceTemplatesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
- // "flatPath": "projects/{project}/global/instanceTemplates/{resource}/getIamPolicy",
- // "httpMethod": "GET",
- // "id": "compute.instanceTemplates.getIamPolicy",
- // "parameterOrder": [
- // "project",
- // "resource"
- // ],
- // "parameters": {
- // "optionsRequestedPolicyVersion": {
- // "description": "Requested IAM Policy version.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/instanceTemplates/{resource}/getIamPolicy",
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.instanceTemplates.insert":
-
-type InstanceTemplatesInsertCall struct {
- s *Service
- project string
- instancetemplate *InstanceTemplate
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates an instance template in the specified project using
-// the data that is included in the request. If you are creating a new
-// template to update an existing instance group, your new instance
-// template must use the same network or, if applicable, the same
-// subnetwork as the original template.
-//
-// - project: Project ID for this request.
-func (r *InstanceTemplatesService) Insert(project string, instancetemplate *InstanceTemplate) *InstanceTemplatesInsertCall {
- c := &InstanceTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instancetemplate = instancetemplate
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstanceTemplatesInsertCall) RequestId(requestId string) *InstanceTemplatesInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstanceTemplatesInsertCall) Fields(s ...googleapi.Field) *InstanceTemplatesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstanceTemplatesInsertCall) Context(ctx context.Context) *InstanceTemplatesInsertCall {
- 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 *InstanceTemplatesInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstanceTemplatesInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancetemplate)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/instanceTemplates")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instanceTemplates.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstanceTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates an instance template in the specified project using the data that is included in the request. If you are creating a new template to update an existing instance group, your new instance template must use the same network or, if applicable, the same subnetwork as the original template.",
- // "flatPath": "projects/{project}/global/instanceTemplates",
- // "httpMethod": "POST",
- // "id": "compute.instanceTemplates.insert",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/instanceTemplates",
- // "request": {
- // "$ref": "InstanceTemplate"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instanceTemplates.list":
-
-type InstanceTemplatesListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves a list of instance templates that are contained
-// within the specified project.
-//
-// - project: Project ID for this request.
-func (r *InstanceTemplatesService) List(project string) *InstanceTemplatesListCall {
- c := &InstanceTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *InstanceTemplatesListCall) Filter(filter string) *InstanceTemplatesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *InstanceTemplatesListCall) MaxResults(maxResults int64) *InstanceTemplatesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *InstanceTemplatesListCall) OrderBy(orderBy string) *InstanceTemplatesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *InstanceTemplatesListCall) PageToken(pageToken string) *InstanceTemplatesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *InstanceTemplatesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InstanceTemplatesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *InstanceTemplatesListCall) Fields(s ...googleapi.Field) *InstanceTemplatesListCall {
- 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 *InstanceTemplatesListCall) IfNoneMatch(entityTag string) *InstanceTemplatesListCall {
- 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 *InstanceTemplatesListCall) Context(ctx context.Context) *InstanceTemplatesListCall {
- 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 *InstanceTemplatesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstanceTemplatesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/instanceTemplates")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instanceTemplates.list" call.
-// Exactly one of *InstanceTemplateList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *InstanceTemplateList.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 *InstanceTemplatesListCall) Do(opts ...googleapi.CallOption) (*InstanceTemplateList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &InstanceTemplateList{
- 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": "Retrieves a list of instance templates that are contained within the specified project.",
- // "flatPath": "projects/{project}/global/instanceTemplates",
- // "httpMethod": "GET",
- // "id": "compute.instanceTemplates.list",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/instanceTemplates",
- // "response": {
- // "$ref": "InstanceTemplateList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *InstanceTemplatesListCall) Pages(ctx context.Context, f func(*InstanceTemplateList) 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 "compute.instanceTemplates.setIamPolicy":
-
-type InstanceTemplatesSetIamPolicyCall struct {
- s *Service
- project string
- resource string
- globalsetpolicyrequest *GlobalSetPolicyRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetIamPolicy: Sets the access control policy on the specified
-// resource. Replaces any existing policy.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-func (r *InstanceTemplatesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *InstanceTemplatesSetIamPolicyCall {
- c := &InstanceTemplatesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.resource = resource
- c.globalsetpolicyrequest = globalsetpolicyrequest
- 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 *InstanceTemplatesSetIamPolicyCall) Fields(s ...googleapi.Field) *InstanceTemplatesSetIamPolicyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstanceTemplatesSetIamPolicyCall) Context(ctx context.Context) *InstanceTemplatesSetIamPolicyCall {
- 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 *InstanceTemplatesSetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstanceTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/instanceTemplates/{resource}/setIamPolicy")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instanceTemplates.setIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *InstanceTemplatesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Sets the access control policy on the specified resource. Replaces any existing policy.",
- // "flatPath": "projects/{project}/global/instanceTemplates/{resource}/setIamPolicy",
- // "httpMethod": "POST",
- // "id": "compute.instanceTemplates.setIamPolicy",
- // "parameterOrder": [
- // "project",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/instanceTemplates/{resource}/setIamPolicy",
- // "request": {
- // "$ref": "GlobalSetPolicyRequest"
- // },
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instanceTemplates.testIamPermissions":
-
-type InstanceTemplatesTestIamPermissionsCall struct {
- s *Service
- project string
- resource string
- testpermissionsrequest *TestPermissionsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// TestIamPermissions: Returns permissions that a caller has on the
-// specified resource.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-func (r *InstanceTemplatesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstanceTemplatesTestIamPermissionsCall {
- c := &InstanceTemplatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.resource = resource
- c.testpermissionsrequest = testpermissionsrequest
- 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 *InstanceTemplatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstanceTemplatesTestIamPermissionsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstanceTemplatesTestIamPermissionsCall) Context(ctx context.Context) *InstanceTemplatesTestIamPermissionsCall {
- 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 *InstanceTemplatesTestIamPermissionsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstanceTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/instanceTemplates/{resource}/testIamPermissions")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instanceTemplates.testIamPermissions" call.
-// Exactly one of *TestPermissionsResponse or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *TestPermissionsResponse.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 *InstanceTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TestPermissionsResponse{
- 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": "Returns permissions that a caller has on the specified resource.",
- // "flatPath": "projects/{project}/global/instanceTemplates/{resource}/testIamPermissions",
- // "httpMethod": "POST",
- // "id": "compute.instanceTemplates.testIamPermissions",
- // "parameterOrder": [
- // "project",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/instanceTemplates/{resource}/testIamPermissions",
- // "request": {
- // "$ref": "TestPermissionsRequest"
- // },
- // "response": {
- // "$ref": "TestPermissionsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.instances.addAccessConfig":
-
-type InstancesAddAccessConfigCall struct {
- s *Service
- project string
- zone string
- instance string
- accessconfig *AccessConfig
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// AddAccessConfig: Adds an access config to an instance's network
-// interface.
-//
-// - instance: The instance name for this request.
-// - networkInterface: The name of the network interface to add to this
-// instance.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) AddAccessConfig(project string, zone string, instance string, networkInterface string, accessconfig *AccessConfig) *InstancesAddAccessConfigCall {
- c := &InstancesAddAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- c.urlParams_.Set("networkInterface", networkInterface)
- c.accessconfig = accessconfig
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstancesAddAccessConfigCall) RequestId(requestId string) *InstancesAddAccessConfigCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstancesAddAccessConfigCall) Fields(s ...googleapi.Field) *InstancesAddAccessConfigCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstancesAddAccessConfigCall) Context(ctx context.Context) *InstancesAddAccessConfigCall {
- 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 *InstancesAddAccessConfigCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesAddAccessConfigCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/addAccessConfig")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.addAccessConfig" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstancesAddAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Adds an access config to an instance's network interface.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{instance}/addAccessConfig",
- // "httpMethod": "POST",
- // "id": "compute.instances.addAccessConfig",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instance",
- // "networkInterface"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "The instance name for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "networkInterface": {
- // "description": "The name of the network interface to add to this instance.",
- // "location": "query",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{instance}/addAccessConfig",
- // "request": {
- // "$ref": "AccessConfig"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instances.addResourcePolicies":
-
-type InstancesAddResourcePoliciesCall struct {
- s *Service
- project string
- zone string
- instance string
- instancesaddresourcepoliciesrequest *InstancesAddResourcePoliciesRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// AddResourcePolicies: Adds existing resource policies to an instance.
-// You can only add one policy right now which will be applied to this
-// instance for scheduling live migrations.
-//
-// - instance: The instance name for this request.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) AddResourcePolicies(project string, zone string, instance string, instancesaddresourcepoliciesrequest *InstancesAddResourcePoliciesRequest) *InstancesAddResourcePoliciesCall {
- c := &InstancesAddResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- c.instancesaddresourcepoliciesrequest = instancesaddresourcepoliciesrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstancesAddResourcePoliciesCall) RequestId(requestId string) *InstancesAddResourcePoliciesCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstancesAddResourcePoliciesCall) Fields(s ...googleapi.Field) *InstancesAddResourcePoliciesCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstancesAddResourcePoliciesCall) Context(ctx context.Context) *InstancesAddResourcePoliciesCall {
- 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 *InstancesAddResourcePoliciesCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesAddResourcePoliciesCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesaddresourcepoliciesrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/addResourcePolicies")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.addResourcePolicies" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstancesAddResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Adds existing resource policies to an instance. You can only add one policy right now which will be applied to this instance for scheduling live migrations.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{instance}/addResourcePolicies",
- // "httpMethod": "POST",
- // "id": "compute.instances.addResourcePolicies",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "The instance name for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{instance}/addResourcePolicies",
- // "request": {
- // "$ref": "InstancesAddResourcePoliciesRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instances.aggregatedList":
-
-type InstancesAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Retrieves an aggregated list of all of the instances
-// in your project across all regions and zones. The performance of this
-// method degrades when a filter is specified on a project that has a
-// very large number of instances.
-//
-// - project: Project ID for this request.
-func (r *InstancesService) AggregatedList(project string) *InstancesAggregatedListCall {
- c := &InstancesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *InstancesAggregatedListCall) Filter(filter string) *InstancesAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *InstancesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *InstancesAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *InstancesAggregatedListCall) MaxResults(maxResults int64) *InstancesAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *InstancesAggregatedListCall) OrderBy(orderBy string) *InstancesAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *InstancesAggregatedListCall) PageToken(pageToken string) *InstancesAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *InstancesAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InstancesAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *InstancesAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *InstancesAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *InstancesAggregatedListCall) Fields(s ...googleapi.Field) *InstancesAggregatedListCall {
- 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 *InstancesAggregatedListCall) IfNoneMatch(entityTag string) *InstancesAggregatedListCall {
- 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 *InstancesAggregatedListCall) Context(ctx context.Context) *InstancesAggregatedListCall {
- 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 *InstancesAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/instances")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.aggregatedList" call.
-// Exactly one of *InstanceAggregatedList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *InstanceAggregatedList.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 *InstancesAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &InstanceAggregatedList{
- 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": "Retrieves an aggregated list of all of the instances in your project across all regions and zones. The performance of this method degrades when a filter is specified on a project that has a very large number of instances.",
- // "flatPath": "projects/{project}/aggregated/instances",
- // "httpMethod": "GET",
- // "id": "compute.instances.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/instances",
- // "response": {
- // "$ref": "InstanceAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *InstancesAggregatedListCall) Pages(ctx context.Context, f func(*InstanceAggregatedList) 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 "compute.instances.attachDisk":
-
-type InstancesAttachDiskCall struct {
- s *Service
- project string
- zone string
- instance string
- attacheddisk *AttachedDisk
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// AttachDisk: Attaches an existing Disk resource to an instance. You
-// must first create the disk before you can attach it. It is not
-// possible to create and attach a disk at the same time. For more
-// information, read Adding a persistent disk to your instance.
-//
-// - instance: The instance name for this request.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) AttachDisk(project string, zone string, instance string, attacheddisk *AttachedDisk) *InstancesAttachDiskCall {
- c := &InstancesAttachDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- c.attacheddisk = attacheddisk
- return c
-}
-
-// ForceAttach sets the optional parameter "forceAttach": Whether to
-// force attach the regional disk even if it's currently attached to
-// another instance. If you try to force attach a zonal disk to an
-// instance, you will receive an error.
-func (c *InstancesAttachDiskCall) ForceAttach(forceAttach bool) *InstancesAttachDiskCall {
- c.urlParams_.Set("forceAttach", fmt.Sprint(forceAttach))
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstancesAttachDiskCall) RequestId(requestId string) *InstancesAttachDiskCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstancesAttachDiskCall) Fields(s ...googleapi.Field) *InstancesAttachDiskCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstancesAttachDiskCall) Context(ctx context.Context) *InstancesAttachDiskCall {
- 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 *InstancesAttachDiskCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesAttachDiskCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.attacheddisk)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/attachDisk")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.attachDisk" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstancesAttachDiskCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Attaches an existing Disk resource to an instance. You must first create the disk before you can attach it. It is not possible to create and attach a disk at the same time. For more information, read Adding a persistent disk to your instance.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{instance}/attachDisk",
- // "httpMethod": "POST",
- // "id": "compute.instances.attachDisk",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instance"
- // ],
- // "parameters": {
- // "forceAttach": {
- // "description": "Whether to force attach the regional disk even if it's currently attached to another instance. If you try to force attach a zonal disk to an instance, you will receive an error.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "instance": {
- // "description": "The instance name for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{instance}/attachDisk",
- // "request": {
- // "$ref": "AttachedDisk"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instances.bulkInsert":
-
-type InstancesBulkInsertCall struct {
- s *Service
- project string
- zone string
- bulkinsertinstanceresource *BulkInsertInstanceResource
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// BulkInsert: Creates multiple instances. Count specifies the number of
-// instances to create. For more information, see About bulk creation of
-// VMs.
-//
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) BulkInsert(project string, zone string, bulkinsertinstanceresource *BulkInsertInstanceResource) *InstancesBulkInsertCall {
- c := &InstancesBulkInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.bulkinsertinstanceresource = bulkinsertinstanceresource
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstancesBulkInsertCall) RequestId(requestId string) *InstancesBulkInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstancesBulkInsertCall) Fields(s ...googleapi.Field) *InstancesBulkInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstancesBulkInsertCall) Context(ctx context.Context) *InstancesBulkInsertCall {
- 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 *InstancesBulkInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesBulkInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkinsertinstanceresource)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/bulkInsert")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.bulkInsert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstancesBulkInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates multiple instances. Count specifies the number of instances to create. For more information, see About bulk creation of VMs.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/bulkInsert",
- // "httpMethod": "POST",
- // "id": "compute.instances.bulkInsert",
- // "parameterOrder": [
- // "project",
- // "zone"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/bulkInsert",
- // "request": {
- // "$ref": "BulkInsertInstanceResource"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instances.delete":
-
-type InstancesDeleteCall struct {
- s *Service
- project string
- zone string
- instance string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified Instance resource. For more
-// information, see Deleting an instance.
-//
-// - instance: Name of the instance resource to delete.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) Delete(project string, zone string, instance string) *InstancesDeleteCall {
- c := &InstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstancesDeleteCall) RequestId(requestId string) *InstancesDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstancesDeleteCall) Fields(s ...googleapi.Field) *InstancesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstancesDeleteCall) Context(ctx context.Context) *InstancesDeleteCall {
- 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 *InstancesDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified Instance resource. For more information, see Deleting an instance.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{instance}",
- // "httpMethod": "DELETE",
- // "id": "compute.instances.delete",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Name of the instance resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{instance}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instances.deleteAccessConfig":
-
-type InstancesDeleteAccessConfigCall struct {
- s *Service
- project string
- zone string
- instance string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// DeleteAccessConfig: Deletes an access config from an instance's
-// network interface.
-//
-// - accessConfig: The name of the access config to delete.
-// - instance: The instance name for this request.
-// - networkInterface: The name of the network interface.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) DeleteAccessConfig(project string, zone string, instance string, accessConfig string, networkInterface string) *InstancesDeleteAccessConfigCall {
- c := &InstancesDeleteAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- c.urlParams_.Set("accessConfig", accessConfig)
- c.urlParams_.Set("networkInterface", networkInterface)
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstancesDeleteAccessConfigCall) RequestId(requestId string) *InstancesDeleteAccessConfigCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstancesDeleteAccessConfigCall) Fields(s ...googleapi.Field) *InstancesDeleteAccessConfigCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstancesDeleteAccessConfigCall) Context(ctx context.Context) *InstancesDeleteAccessConfigCall {
- 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 *InstancesDeleteAccessConfigCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesDeleteAccessConfigCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/deleteAccessConfig")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.deleteAccessConfig" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstancesDeleteAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes an access config from an instance's network interface.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{instance}/deleteAccessConfig",
- // "httpMethod": "POST",
- // "id": "compute.instances.deleteAccessConfig",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instance",
- // "accessConfig",
- // "networkInterface"
- // ],
- // "parameters": {
- // "accessConfig": {
- // "description": "The name of the access config to delete.",
- // "location": "query",
- // "required": true,
- // "type": "string"
- // },
- // "instance": {
- // "description": "The instance name for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "networkInterface": {
- // "description": "The name of the network interface.",
- // "location": "query",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{instance}/deleteAccessConfig",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instances.detachDisk":
-
-type InstancesDetachDiskCall struct {
- s *Service
- project string
- zone string
- instance string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// DetachDisk: Detaches a disk from an instance.
-//
-// - deviceName: The device name of the disk to detach. Make a get()
-// request on the instance to view currently attached disks and device
-// names.
-// - instance: Instance name for this request.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) DetachDisk(project string, zone string, instance string, deviceName string) *InstancesDetachDiskCall {
- c := &InstancesDetachDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- c.urlParams_.Set("deviceName", deviceName)
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstancesDetachDiskCall) RequestId(requestId string) *InstancesDetachDiskCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstancesDetachDiskCall) Fields(s ...googleapi.Field) *InstancesDetachDiskCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstancesDetachDiskCall) Context(ctx context.Context) *InstancesDetachDiskCall {
- 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 *InstancesDetachDiskCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesDetachDiskCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/detachDisk")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.detachDisk" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstancesDetachDiskCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Detaches a disk from an instance.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{instance}/detachDisk",
- // "httpMethod": "POST",
- // "id": "compute.instances.detachDisk",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instance",
- // "deviceName"
- // ],
- // "parameters": {
- // "deviceName": {
- // "description": "The device name of the disk to detach. Make a get() request on the instance to view currently attached disks and device names.",
- // "location": "query",
- // "required": true,
- // "type": "string"
- // },
- // "instance": {
- // "description": "Instance name for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{instance}/detachDisk",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instances.get":
-
-type InstancesGetCall struct {
- s *Service
- project string
- zone string
- instance string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified Instance resource.
-//
-// - instance: Name of the instance resource to return.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) Get(project string, zone string, instance string) *InstancesGetCall {
- c := &InstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- 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 *InstancesGetCall) Fields(s ...googleapi.Field) *InstancesGetCall {
- 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 *InstancesGetCall) IfNoneMatch(entityTag string) *InstancesGetCall {
- 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 *InstancesGetCall) Context(ctx context.Context) *InstancesGetCall {
- 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 *InstancesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}/instances/{instance}")
- 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{
- "project": c.project,
- "zone": c.zone,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.get" call.
-// Exactly one of *Instance or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Instance.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 *InstancesGetCall) Do(opts ...googleapi.CallOption) (*Instance, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Instance{
- 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": "Returns the specified Instance resource.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{instance}",
- // "httpMethod": "GET",
- // "id": "compute.instances.get",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Name of the instance resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{instance}",
- // "response": {
- // "$ref": "Instance"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.instances.getEffectiveFirewalls":
-
-type InstancesGetEffectiveFirewallsCall struct {
- s *Service
- project string
- zone string
- instance string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetEffectiveFirewalls: Returns effective firewalls applied to an
-// interface of the instance.
-//
-// - instance: Name of the instance scoping this request.
-// - networkInterface: The name of the network interface to get the
-// effective firewalls.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) GetEffectiveFirewalls(project string, zone string, instance string, networkInterface string) *InstancesGetEffectiveFirewallsCall {
- c := &InstancesGetEffectiveFirewallsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- c.urlParams_.Set("networkInterface", networkInterface)
- 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 *InstancesGetEffectiveFirewallsCall) Fields(s ...googleapi.Field) *InstancesGetEffectiveFirewallsCall {
- 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 *InstancesGetEffectiveFirewallsCall) IfNoneMatch(entityTag string) *InstancesGetEffectiveFirewallsCall {
- 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 *InstancesGetEffectiveFirewallsCall) Context(ctx context.Context) *InstancesGetEffectiveFirewallsCall {
- 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 *InstancesGetEffectiveFirewallsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesGetEffectiveFirewallsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}/instances/{instance}/getEffectiveFirewalls")
- 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{
- "project": c.project,
- "zone": c.zone,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.getEffectiveFirewalls" call.
-// Exactly one of *InstancesGetEffectiveFirewallsResponse or error will
-// be non-nil. Any non-2xx status code is an error. Response headers are
-// in either
-// *InstancesGetEffectiveFirewallsResponse.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 *InstancesGetEffectiveFirewallsCall) Do(opts ...googleapi.CallOption) (*InstancesGetEffectiveFirewallsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &InstancesGetEffectiveFirewallsResponse{
- 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": "Returns effective firewalls applied to an interface of the instance.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{instance}/getEffectiveFirewalls",
- // "httpMethod": "GET",
- // "id": "compute.instances.getEffectiveFirewalls",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instance",
- // "networkInterface"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Name of the instance scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "networkInterface": {
- // "description": "The name of the network interface to get the effective firewalls.",
- // "location": "query",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{instance}/getEffectiveFirewalls",
- // "response": {
- // "$ref": "InstancesGetEffectiveFirewallsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.instances.getGuestAttributes":
-
-type InstancesGetGuestAttributesCall struct {
- s *Service
- project string
- zone string
- instance string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetGuestAttributes: Returns the specified guest attributes entry.
-//
-// - instance: Name of the instance scoping this request.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) GetGuestAttributes(project string, zone string, instance string) *InstancesGetGuestAttributesCall {
- c := &InstancesGetGuestAttributesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- return c
-}
-
-// QueryPath sets the optional parameter "queryPath": Specifies the
-// guest attributes path to be queried.
-func (c *InstancesGetGuestAttributesCall) QueryPath(queryPath string) *InstancesGetGuestAttributesCall {
- c.urlParams_.Set("queryPath", queryPath)
- return c
-}
-
-// VariableKey sets the optional parameter "variableKey": Specifies the
-// key for the guest attributes entry.
-func (c *InstancesGetGuestAttributesCall) VariableKey(variableKey string) *InstancesGetGuestAttributesCall {
- c.urlParams_.Set("variableKey", variableKey)
- 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 *InstancesGetGuestAttributesCall) Fields(s ...googleapi.Field) *InstancesGetGuestAttributesCall {
- 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 *InstancesGetGuestAttributesCall) IfNoneMatch(entityTag string) *InstancesGetGuestAttributesCall {
- 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 *InstancesGetGuestAttributesCall) Context(ctx context.Context) *InstancesGetGuestAttributesCall {
- 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 *InstancesGetGuestAttributesCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesGetGuestAttributesCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}/instances/{instance}/getGuestAttributes")
- 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{
- "project": c.project,
- "zone": c.zone,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.getGuestAttributes" call.
-// Exactly one of *GuestAttributes or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *GuestAttributes.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 *InstancesGetGuestAttributesCall) Do(opts ...googleapi.CallOption) (*GuestAttributes, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &GuestAttributes{
- 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": "Returns the specified guest attributes entry.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{instance}/getGuestAttributes",
- // "httpMethod": "GET",
- // "id": "compute.instances.getGuestAttributes",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Name of the instance scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "queryPath": {
- // "description": "Specifies the guest attributes path to be queried.",
- // "location": "query",
- // "type": "string"
- // },
- // "variableKey": {
- // "description": "Specifies the key for the guest attributes entry.",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{instance}/getGuestAttributes",
- // "response": {
- // "$ref": "GuestAttributes"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.instances.getIamPolicy":
-
-type InstancesGetIamPolicyCall struct {
- s *Service
- project string
- zone string
- resource string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetIamPolicy: Gets the access control policy for a resource. May be
-// empty if no such policy or resource exists.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) GetIamPolicy(project string, zone string, resource string) *InstancesGetIamPolicyCall {
- c := &InstancesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.resource = resource
- return c
-}
-
-// OptionsRequestedPolicyVersion sets the optional parameter
-// "optionsRequestedPolicyVersion": Requested IAM Policy version.
-func (c *InstancesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *InstancesGetIamPolicyCall {
- c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
- 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 *InstancesGetIamPolicyCall) Fields(s ...googleapi.Field) *InstancesGetIamPolicyCall {
- 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 *InstancesGetIamPolicyCall) IfNoneMatch(entityTag string) *InstancesGetIamPolicyCall {
- 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 *InstancesGetIamPolicyCall) Context(ctx context.Context) *InstancesGetIamPolicyCall {
- 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 *InstancesGetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}/instances/{resource}/getIamPolicy")
- 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{
- "project": c.project,
- "zone": c.zone,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.getIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *InstancesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{resource}/getIamPolicy",
- // "httpMethod": "GET",
- // "id": "compute.instances.getIamPolicy",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "resource"
- // ],
- // "parameters": {
- // "optionsRequestedPolicyVersion": {
- // "description": "Requested IAM Policy version.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{resource}/getIamPolicy",
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.instances.getScreenshot":
-
-type InstancesGetScreenshotCall struct {
- s *Service
- project string
- zone string
- instance string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetScreenshot: Returns the screenshot from the specified instance.
-//
-// - instance: Name of the instance scoping this request.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) GetScreenshot(project string, zone string, instance string) *InstancesGetScreenshotCall {
- c := &InstancesGetScreenshotCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- 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 *InstancesGetScreenshotCall) Fields(s ...googleapi.Field) *InstancesGetScreenshotCall {
- 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 *InstancesGetScreenshotCall) IfNoneMatch(entityTag string) *InstancesGetScreenshotCall {
- 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 *InstancesGetScreenshotCall) Context(ctx context.Context) *InstancesGetScreenshotCall {
- 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 *InstancesGetScreenshotCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesGetScreenshotCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}/instances/{instance}/screenshot")
- 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{
- "project": c.project,
- "zone": c.zone,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.getScreenshot" call.
-// Exactly one of *Screenshot or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Screenshot.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 *InstancesGetScreenshotCall) Do(opts ...googleapi.CallOption) (*Screenshot, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Screenshot{
- 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": "Returns the screenshot from the specified instance.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{instance}/screenshot",
- // "httpMethod": "GET",
- // "id": "compute.instances.getScreenshot",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Name of the instance scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{instance}/screenshot",
- // "response": {
- // "$ref": "Screenshot"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.instances.getSerialPortOutput":
-
-type InstancesGetSerialPortOutputCall struct {
- s *Service
- project string
- zone string
- instance string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetSerialPortOutput: Returns the last 1 MB of serial port output from
-// the specified instance.
-//
-// - instance: Name of the instance for this request.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) GetSerialPortOutput(project string, zone string, instance string) *InstancesGetSerialPortOutputCall {
- c := &InstancesGetSerialPortOutputCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- return c
-}
-
-// Port sets the optional parameter "port": Specifies which COM or
-// serial port to retrieve data from.
-func (c *InstancesGetSerialPortOutputCall) Port(port int64) *InstancesGetSerialPortOutputCall {
- c.urlParams_.Set("port", fmt.Sprint(port))
- return c
-}
-
-// Start sets the optional parameter "start": Specifies the starting
-// byte position of the output to return. To start with the first byte
-// of output to the specified port, omit this field or set it to `0`. If
-// the output for that byte position is available, this field matches
-// the `start` parameter sent with the request. If the amount of serial
-// console output exceeds the size of the buffer (1 MB), the oldest
-// output is discarded and is no longer available. If the requested
-// start position refers to discarded output, the start position is
-// adjusted to the oldest output still available, and the adjusted start
-// position is returned as the `start` property value. You can also
-// provide a negative start position, which translates to the most
-// recent number of bytes written to the serial port. For example, -3 is
-// interpreted as the most recent 3 bytes written to the serial console.
-func (c *InstancesGetSerialPortOutputCall) Start(start int64) *InstancesGetSerialPortOutputCall {
- c.urlParams_.Set("start", fmt.Sprint(start))
- 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 *InstancesGetSerialPortOutputCall) Fields(s ...googleapi.Field) *InstancesGetSerialPortOutputCall {
- 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 *InstancesGetSerialPortOutputCall) IfNoneMatch(entityTag string) *InstancesGetSerialPortOutputCall {
- 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 *InstancesGetSerialPortOutputCall) Context(ctx context.Context) *InstancesGetSerialPortOutputCall {
- 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 *InstancesGetSerialPortOutputCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesGetSerialPortOutputCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}/instances/{instance}/serialPort")
- 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{
- "project": c.project,
- "zone": c.zone,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.getSerialPortOutput" call.
-// Exactly one of *SerialPortOutput or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *SerialPortOutput.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 *InstancesGetSerialPortOutputCall) Do(opts ...googleapi.CallOption) (*SerialPortOutput, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &SerialPortOutput{
- 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": "Returns the last 1 MB of serial port output from the specified instance.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{instance}/serialPort",
- // "httpMethod": "GET",
- // "id": "compute.instances.getSerialPortOutput",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Name of the instance for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "port": {
- // "default": "1",
- // "description": "Specifies which COM or serial port to retrieve data from.",
- // "format": "int32",
- // "location": "query",
- // "maximum": "4",
- // "minimum": "1",
- // "type": "integer"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "start": {
- // "description": "Specifies the starting byte position of the output to return. To start with the first byte of output to the specified port, omit this field or set it to `0`. If the output for that byte position is available, this field matches the `start` parameter sent with the request. If the amount of serial console output exceeds the size of the buffer (1 MB), the oldest output is discarded and is no longer available. If the requested start position refers to discarded output, the start position is adjusted to the oldest output still available, and the adjusted start position is returned as the `start` property value. You can also provide a negative start position, which translates to the most recent number of bytes written to the serial port. For example, -3 is interpreted as the most recent 3 bytes written to the serial console.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{instance}/serialPort",
- // "response": {
- // "$ref": "SerialPortOutput"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.instances.getShieldedInstanceIdentity":
-
-type InstancesGetShieldedInstanceIdentityCall struct {
- s *Service
- project string
- zone string
- instance string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetShieldedInstanceIdentity: Returns the Shielded Instance Identity
-// of an instance
-//
-// - instance: Name or id of the instance scoping this request.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) GetShieldedInstanceIdentity(project string, zone string, instance string) *InstancesGetShieldedInstanceIdentityCall {
- c := &InstancesGetShieldedInstanceIdentityCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- 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 *InstancesGetShieldedInstanceIdentityCall) Fields(s ...googleapi.Field) *InstancesGetShieldedInstanceIdentityCall {
- 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 *InstancesGetShieldedInstanceIdentityCall) IfNoneMatch(entityTag string) *InstancesGetShieldedInstanceIdentityCall {
- 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 *InstancesGetShieldedInstanceIdentityCall) Context(ctx context.Context) *InstancesGetShieldedInstanceIdentityCall {
- 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 *InstancesGetShieldedInstanceIdentityCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesGetShieldedInstanceIdentityCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}/instances/{instance}/getShieldedInstanceIdentity")
- 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{
- "project": c.project,
- "zone": c.zone,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.getShieldedInstanceIdentity" call.
-// Exactly one of *ShieldedInstanceIdentity or error will be non-nil.
-// Any non-2xx status code is an error. Response headers are in either
-// *ShieldedInstanceIdentity.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 *InstancesGetShieldedInstanceIdentityCall) Do(opts ...googleapi.CallOption) (*ShieldedInstanceIdentity, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &ShieldedInstanceIdentity{
- 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": "Returns the Shielded Instance Identity of an instance",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{instance}/getShieldedInstanceIdentity",
- // "httpMethod": "GET",
- // "id": "compute.instances.getShieldedInstanceIdentity",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Name or id of the instance scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{instance}/getShieldedInstanceIdentity",
- // "response": {
- // "$ref": "ShieldedInstanceIdentity"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.instances.insert":
-
-type InstancesInsertCall struct {
- s *Service
- project string
- zone string
- instance *Instance
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates an instance resource in the specified project using
-// the data included in the request.
-//
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) Insert(project string, zone string, instance *Instance) *InstancesInsertCall {
- c := &InstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstancesInsertCall) RequestId(requestId string) *InstancesInsertCall {
- c.urlParams_.Set("requestId", requestId)
- return c
-}
-
-// SourceInstanceTemplate sets the optional parameter
-// "sourceInstanceTemplate": Specifies instance template to create the
-// instance. This field is optional. It can be a full or partial URL.
-// For example, the following are all valid URLs to an instance
-// template: - https://www.googleapis.com/compute/v1/projects/project
-// /global/instanceTemplates/instanceTemplate -
-// projects/project/global/instanceTemplates/instanceTemplate -
-// global/instanceTemplates/instanceTemplate
-func (c *InstancesInsertCall) SourceInstanceTemplate(sourceInstanceTemplate string) *InstancesInsertCall {
- c.urlParams_.Set("sourceInstanceTemplate", sourceInstanceTemplate)
- return c
-}
-
-// SourceMachineImage sets the optional parameter "sourceMachineImage":
-// Specifies the machine image to use to create the instance. This field
-// is optional. It can be a full or partial URL. For example, the
-// following are all valid URLs to a machine image: -
-// https://www.googleapis.com/compute/v1/projects/project/global/global
-// /machineImages/machineImage -
-// projects/project/global/global/machineImages/machineImage -
-// global/machineImages/machineImage
-func (c *InstancesInsertCall) SourceMachineImage(sourceMachineImage string) *InstancesInsertCall {
- c.urlParams_.Set("sourceMachineImage", sourceMachineImage)
- 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 *InstancesInsertCall) Fields(s ...googleapi.Field) *InstancesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstancesInsertCall) Context(ctx context.Context) *InstancesInsertCall {
- 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 *InstancesInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates an instance resource in the specified project using the data included in the request.",
- // "flatPath": "projects/{project}/zones/{zone}/instances",
- // "httpMethod": "POST",
- // "id": "compute.instances.insert",
- // "parameterOrder": [
- // "project",
- // "zone"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "sourceInstanceTemplate": {
- // "description": "Specifies instance template to create the instance. This field is optional. It can be a full or partial URL. For example, the following are all valid URLs to an instance template: - https://www.googleapis.com/compute/v1/projects/project /global/instanceTemplates/instanceTemplate - projects/project/global/instanceTemplates/instanceTemplate - global/instanceTemplates/instanceTemplate ",
- // "location": "query",
- // "type": "string"
- // },
- // "sourceMachineImage": {
- // "description": "Specifies the machine image to use to create the instance. This field is optional. It can be a full or partial URL. For example, the following are all valid URLs to a machine image: - https://www.googleapis.com/compute/v1/projects/project/global/global /machineImages/machineImage - projects/project/global/global/machineImages/machineImage - global/machineImages/machineImage ",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances",
- // "request": {
- // "$ref": "Instance"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instances.list":
-
-type InstancesListCall struct {
- s *Service
- project string
- zone string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves the list of instances contained within the specified
-// zone.
-//
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) List(project string, zone string) *InstancesListCall {
- c := &InstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *InstancesListCall) Filter(filter string) *InstancesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *InstancesListCall) MaxResults(maxResults int64) *InstancesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *InstancesListCall) OrderBy(orderBy string) *InstancesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *InstancesListCall) PageToken(pageToken string) *InstancesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *InstancesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InstancesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *InstancesListCall) Fields(s ...googleapi.Field) *InstancesListCall {
- 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 *InstancesListCall) IfNoneMatch(entityTag string) *InstancesListCall {
- 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 *InstancesListCall) Context(ctx context.Context) *InstancesListCall {
- 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 *InstancesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}/instances")
- 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{
- "project": c.project,
- "zone": c.zone,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.list" call.
-// Exactly one of *InstanceList or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *InstanceList.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 *InstancesListCall) Do(opts ...googleapi.CallOption) (*InstanceList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &InstanceList{
- 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": "Retrieves the list of instances contained within the specified zone.",
- // "flatPath": "projects/{project}/zones/{zone}/instances",
- // "httpMethod": "GET",
- // "id": "compute.instances.list",
- // "parameterOrder": [
- // "project",
- // "zone"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances",
- // "response": {
- // "$ref": "InstanceList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *InstancesListCall) Pages(ctx context.Context, f func(*InstanceList) 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 "compute.instances.listReferrers":
-
-type InstancesListReferrersCall struct {
- s *Service
- project string
- zone string
- instance string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// ListReferrers: Retrieves a list of resources that refer to the VM
-// instance specified in the request. For example, if the VM instance is
-// part of a managed or unmanaged instance group, the referrers list
-// includes the instance group. For more information, read Viewing
-// referrers to VM instances.
-//
-// - instance: Name of the target instance scoping this request, or '-'
-// if the request should span over all instances in the container.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) ListReferrers(project string, zone string, instance string) *InstancesListReferrersCall {
- c := &InstancesListReferrersCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *InstancesListReferrersCall) Filter(filter string) *InstancesListReferrersCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *InstancesListReferrersCall) MaxResults(maxResults int64) *InstancesListReferrersCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *InstancesListReferrersCall) OrderBy(orderBy string) *InstancesListReferrersCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *InstancesListReferrersCall) PageToken(pageToken string) *InstancesListReferrersCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *InstancesListReferrersCall) ReturnPartialSuccess(returnPartialSuccess bool) *InstancesListReferrersCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *InstancesListReferrersCall) Fields(s ...googleapi.Field) *InstancesListReferrersCall {
- 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 *InstancesListReferrersCall) IfNoneMatch(entityTag string) *InstancesListReferrersCall {
- 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 *InstancesListReferrersCall) Context(ctx context.Context) *InstancesListReferrersCall {
- 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 *InstancesListReferrersCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesListReferrersCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}/instances/{instance}/referrers")
- 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{
- "project": c.project,
- "zone": c.zone,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.listReferrers" call.
-// Exactly one of *InstanceListReferrers or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *InstanceListReferrers.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 *InstancesListReferrersCall) Do(opts ...googleapi.CallOption) (*InstanceListReferrers, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &InstanceListReferrers{
- 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": "Retrieves a list of resources that refer to the VM instance specified in the request. For example, if the VM instance is part of a managed or unmanaged instance group, the referrers list includes the instance group. For more information, read Viewing referrers to VM instances.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{instance}/referrers",
- // "httpMethod": "GET",
- // "id": "compute.instances.listReferrers",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instance"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "instance": {
- // "description": "Name of the target instance scoping this request, or '-' if the request should span over all instances in the container.",
- // "location": "path",
- // "pattern": "-|[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{instance}/referrers",
- // "response": {
- // "$ref": "InstanceListReferrers"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *InstancesListReferrersCall) Pages(ctx context.Context, f func(*InstanceListReferrers) 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 "compute.instances.performMaintenance":
-
-type InstancesPerformMaintenanceCall struct {
- s *Service
- project string
- zone string
- instance string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// PerformMaintenance: Perform a manual maintenance on the instance.
-//
-// - instance: Name of the instance scoping this request.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) PerformMaintenance(project string, zone string, instance string) *InstancesPerformMaintenanceCall {
- c := &InstancesPerformMaintenanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstancesPerformMaintenanceCall) RequestId(requestId string) *InstancesPerformMaintenanceCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstancesPerformMaintenanceCall) Fields(s ...googleapi.Field) *InstancesPerformMaintenanceCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstancesPerformMaintenanceCall) Context(ctx context.Context) *InstancesPerformMaintenanceCall {
- 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 *InstancesPerformMaintenanceCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesPerformMaintenanceCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/performMaintenance")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.performMaintenance" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstancesPerformMaintenanceCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Perform a manual maintenance on the instance.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{instance}/performMaintenance",
- // "httpMethod": "POST",
- // "id": "compute.instances.performMaintenance",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Name of the instance scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{instance}/performMaintenance",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instances.removeResourcePolicies":
-
-type InstancesRemoveResourcePoliciesCall struct {
- s *Service
- project string
- zone string
- instance string
- instancesremoveresourcepoliciesrequest *InstancesRemoveResourcePoliciesRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// RemoveResourcePolicies: Removes resource policies from an instance.
-//
-// - instance: The instance name for this request.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) RemoveResourcePolicies(project string, zone string, instance string, instancesremoveresourcepoliciesrequest *InstancesRemoveResourcePoliciesRequest) *InstancesRemoveResourcePoliciesCall {
- c := &InstancesRemoveResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- c.instancesremoveresourcepoliciesrequest = instancesremoveresourcepoliciesrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstancesRemoveResourcePoliciesCall) RequestId(requestId string) *InstancesRemoveResourcePoliciesCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstancesRemoveResourcePoliciesCall) Fields(s ...googleapi.Field) *InstancesRemoveResourcePoliciesCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstancesRemoveResourcePoliciesCall) Context(ctx context.Context) *InstancesRemoveResourcePoliciesCall {
- 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 *InstancesRemoveResourcePoliciesCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesRemoveResourcePoliciesCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesremoveresourcepoliciesrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/removeResourcePolicies")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.removeResourcePolicies" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstancesRemoveResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Removes resource policies from an instance.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{instance}/removeResourcePolicies",
- // "httpMethod": "POST",
- // "id": "compute.instances.removeResourcePolicies",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "The instance name for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{instance}/removeResourcePolicies",
- // "request": {
- // "$ref": "InstancesRemoveResourcePoliciesRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instances.reset":
-
-type InstancesResetCall struct {
- s *Service
- project string
- zone string
- instance string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Reset: Performs a reset on the instance. This is a hard reset. The VM
-// does not do a graceful shutdown. For more information, see Resetting
-// an instance.
-//
-// - instance: Name of the instance scoping this request.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) Reset(project string, zone string, instance string) *InstancesResetCall {
- c := &InstancesResetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstancesResetCall) RequestId(requestId string) *InstancesResetCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstancesResetCall) Fields(s ...googleapi.Field) *InstancesResetCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstancesResetCall) Context(ctx context.Context) *InstancesResetCall {
- 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 *InstancesResetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesResetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/reset")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.reset" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstancesResetCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Performs a reset on the instance. This is a hard reset. The VM does not do a graceful shutdown. For more information, see Resetting an instance.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{instance}/reset",
- // "httpMethod": "POST",
- // "id": "compute.instances.reset",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Name of the instance scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{instance}/reset",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instances.resume":
-
-type InstancesResumeCall struct {
- s *Service
- project string
- zone string
- instance string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Resume: Resumes an instance that was suspended using the
-// instances().suspend method.
-//
-// - instance: Name of the instance resource to resume.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) Resume(project string, zone string, instance string) *InstancesResumeCall {
- c := &InstancesResumeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstancesResumeCall) RequestId(requestId string) *InstancesResumeCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstancesResumeCall) Fields(s ...googleapi.Field) *InstancesResumeCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstancesResumeCall) Context(ctx context.Context) *InstancesResumeCall {
- 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 *InstancesResumeCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesResumeCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/resume")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.resume" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstancesResumeCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Resumes an instance that was suspended using the instances().suspend method.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{instance}/resume",
- // "httpMethod": "POST",
- // "id": "compute.instances.resume",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Name of the instance resource to resume.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{instance}/resume",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instances.sendDiagnosticInterrupt":
-
-type InstancesSendDiagnosticInterruptCall struct {
- s *Service
- project string
- zone string
- instance string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SendDiagnosticInterrupt: Sends diagnostic interrupt to the instance.
-//
-// - instance: Name of the instance scoping this request.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) SendDiagnosticInterrupt(project string, zone string, instance string) *InstancesSendDiagnosticInterruptCall {
- c := &InstancesSendDiagnosticInterruptCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- 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 *InstancesSendDiagnosticInterruptCall) Fields(s ...googleapi.Field) *InstancesSendDiagnosticInterruptCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstancesSendDiagnosticInterruptCall) Context(ctx context.Context) *InstancesSendDiagnosticInterruptCall {
- 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 *InstancesSendDiagnosticInterruptCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesSendDiagnosticInterruptCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/sendDiagnosticInterrupt")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.sendDiagnosticInterrupt" call.
-func (c *InstancesSendDiagnosticInterruptCall) Do(opts ...googleapi.CallOption) error {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if err != nil {
- return err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return gensupport.WrapError(err)
- }
- return nil
- // {
- // "description": "Sends diagnostic interrupt to the instance.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{instance}/sendDiagnosticInterrupt",
- // "httpMethod": "POST",
- // "id": "compute.instances.sendDiagnosticInterrupt",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Name of the instance scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{instance}/sendDiagnosticInterrupt",
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instances.setDeletionProtection":
-
-type InstancesSetDeletionProtectionCall struct {
- s *Service
- project string
- zone string
- resource string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetDeletionProtection: Sets deletion protection on the instance.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) SetDeletionProtection(project string, zone string, resource string) *InstancesSetDeletionProtectionCall {
- c := &InstancesSetDeletionProtectionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.resource = resource
- return c
-}
-
-// DeletionProtection sets the optional parameter "deletionProtection":
-// Whether the resource should be protected against deletion.
-func (c *InstancesSetDeletionProtectionCall) DeletionProtection(deletionProtection bool) *InstancesSetDeletionProtectionCall {
- c.urlParams_.Set("deletionProtection", fmt.Sprint(deletionProtection))
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstancesSetDeletionProtectionCall) RequestId(requestId string) *InstancesSetDeletionProtectionCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstancesSetDeletionProtectionCall) Fields(s ...googleapi.Field) *InstancesSetDeletionProtectionCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstancesSetDeletionProtectionCall) Context(ctx context.Context) *InstancesSetDeletionProtectionCall {
- 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 *InstancesSetDeletionProtectionCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesSetDeletionProtectionCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{resource}/setDeletionProtection")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.setDeletionProtection" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstancesSetDeletionProtectionCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Sets deletion protection on the instance.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{resource}/setDeletionProtection",
- // "httpMethod": "POST",
- // "id": "compute.instances.setDeletionProtection",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "resource"
- // ],
- // "parameters": {
- // "deletionProtection": {
- // "default": "true",
- // "description": "Whether the resource should be protected against deletion.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{resource}/setDeletionProtection",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instances.setDiskAutoDelete":
-
-type InstancesSetDiskAutoDeleteCall struct {
- s *Service
- project string
- zone string
- instance string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetDiskAutoDelete: Sets the auto-delete flag for a disk attached to
-// an instance.
-//
-// - autoDelete: Whether to auto-delete the disk when the instance is
-// deleted.
-// - deviceName: The device name of the disk to modify. Make a get()
-// request on the instance to view currently attached disks and device
-// names.
-// - instance: The instance name for this request.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) SetDiskAutoDelete(project string, zone string, instance string, autoDelete bool, deviceName string) *InstancesSetDiskAutoDeleteCall {
- c := &InstancesSetDiskAutoDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- c.urlParams_.Set("autoDelete", fmt.Sprint(autoDelete))
- c.urlParams_.Set("deviceName", deviceName)
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstancesSetDiskAutoDeleteCall) RequestId(requestId string) *InstancesSetDiskAutoDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstancesSetDiskAutoDeleteCall) Fields(s ...googleapi.Field) *InstancesSetDiskAutoDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstancesSetDiskAutoDeleteCall) Context(ctx context.Context) *InstancesSetDiskAutoDeleteCall {
- 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 *InstancesSetDiskAutoDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesSetDiskAutoDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.setDiskAutoDelete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstancesSetDiskAutoDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Sets the auto-delete flag for a disk attached to an instance.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete",
- // "httpMethod": "POST",
- // "id": "compute.instances.setDiskAutoDelete",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instance",
- // "autoDelete",
- // "deviceName"
- // ],
- // "parameters": {
- // "autoDelete": {
- // "description": "Whether to auto-delete the disk when the instance is deleted.",
- // "location": "query",
- // "required": true,
- // "type": "boolean"
- // },
- // "deviceName": {
- // "description": "The device name of the disk to modify. Make a get() request on the instance to view currently attached disks and device names.",
- // "location": "query",
- // "pattern": "\\w[\\w.-]{0,254}",
- // "required": true,
- // "type": "string"
- // },
- // "instance": {
- // "description": "The instance name for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instances.setIamPolicy":
-
-type InstancesSetIamPolicyCall struct {
- s *Service
- project string
- zone string
- resource string
- zonesetpolicyrequest *ZoneSetPolicyRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetIamPolicy: Sets the access control policy on the specified
-// resource. Replaces any existing policy.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *InstancesSetIamPolicyCall {
- c := &InstancesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.resource = resource
- c.zonesetpolicyrequest = zonesetpolicyrequest
- 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 *InstancesSetIamPolicyCall) Fields(s ...googleapi.Field) *InstancesSetIamPolicyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstancesSetIamPolicyCall) Context(ctx context.Context) *InstancesSetIamPolicyCall {
- 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 *InstancesSetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{resource}/setIamPolicy")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.setIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *InstancesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Sets the access control policy on the specified resource. Replaces any existing policy.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{resource}/setIamPolicy",
- // "httpMethod": "POST",
- // "id": "compute.instances.setIamPolicy",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{resource}/setIamPolicy",
- // "request": {
- // "$ref": "ZoneSetPolicyRequest"
- // },
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instances.setLabels":
-
-type InstancesSetLabelsCall struct {
- s *Service
- project string
- zone string
- instance string
- instancessetlabelsrequest *InstancesSetLabelsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetLabels: Sets labels on an instance. To learn more about labels,
-// read the Labeling Resources documentation.
-//
-// - instance: Name of the instance scoping this request.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) SetLabels(project string, zone string, instance string, instancessetlabelsrequest *InstancesSetLabelsRequest) *InstancesSetLabelsCall {
- c := &InstancesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- c.instancessetlabelsrequest = instancessetlabelsrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstancesSetLabelsCall) RequestId(requestId string) *InstancesSetLabelsCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstancesSetLabelsCall) Fields(s ...googleapi.Field) *InstancesSetLabelsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstancesSetLabelsCall) Context(ctx context.Context) *InstancesSetLabelsCall {
- 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 *InstancesSetLabelsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetlabelsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/setLabels")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.setLabels" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstancesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{instance}/setLabels",
- // "httpMethod": "POST",
- // "id": "compute.instances.setLabels",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Name of the instance scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{instance}/setLabels",
- // "request": {
- // "$ref": "InstancesSetLabelsRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instances.setMachineResources":
-
-type InstancesSetMachineResourcesCall struct {
- s *Service
- project string
- zone string
- instance string
- instancessetmachineresourcesrequest *InstancesSetMachineResourcesRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetMachineResources: Changes the number and/or type of accelerator
-// for a stopped instance to the values specified in the request.
-//
-// - instance: Name of the instance scoping this request.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) SetMachineResources(project string, zone string, instance string, instancessetmachineresourcesrequest *InstancesSetMachineResourcesRequest) *InstancesSetMachineResourcesCall {
- c := &InstancesSetMachineResourcesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- c.instancessetmachineresourcesrequest = instancessetmachineresourcesrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstancesSetMachineResourcesCall) RequestId(requestId string) *InstancesSetMachineResourcesCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstancesSetMachineResourcesCall) Fields(s ...googleapi.Field) *InstancesSetMachineResourcesCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstancesSetMachineResourcesCall) Context(ctx context.Context) *InstancesSetMachineResourcesCall {
- 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 *InstancesSetMachineResourcesCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesSetMachineResourcesCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmachineresourcesrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/setMachineResources")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.setMachineResources" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstancesSetMachineResourcesCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Changes the number and/or type of accelerator for a stopped instance to the values specified in the request.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{instance}/setMachineResources",
- // "httpMethod": "POST",
- // "id": "compute.instances.setMachineResources",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Name of the instance scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{instance}/setMachineResources",
- // "request": {
- // "$ref": "InstancesSetMachineResourcesRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instances.setMachineType":
-
-type InstancesSetMachineTypeCall struct {
- s *Service
- project string
- zone string
- instance string
- instancessetmachinetyperequest *InstancesSetMachineTypeRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetMachineType: Changes the machine type for a stopped instance to
-// the machine type specified in the request.
-//
-// - instance: Name of the instance scoping this request.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) SetMachineType(project string, zone string, instance string, instancessetmachinetyperequest *InstancesSetMachineTypeRequest) *InstancesSetMachineTypeCall {
- c := &InstancesSetMachineTypeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- c.instancessetmachinetyperequest = instancessetmachinetyperequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstancesSetMachineTypeCall) RequestId(requestId string) *InstancesSetMachineTypeCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstancesSetMachineTypeCall) Fields(s ...googleapi.Field) *InstancesSetMachineTypeCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstancesSetMachineTypeCall) Context(ctx context.Context) *InstancesSetMachineTypeCall {
- 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 *InstancesSetMachineTypeCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesSetMachineTypeCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmachinetyperequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/setMachineType")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.setMachineType" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstancesSetMachineTypeCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Changes the machine type for a stopped instance to the machine type specified in the request.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{instance}/setMachineType",
- // "httpMethod": "POST",
- // "id": "compute.instances.setMachineType",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Name of the instance scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{instance}/setMachineType",
- // "request": {
- // "$ref": "InstancesSetMachineTypeRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instances.setMetadata":
-
-type InstancesSetMetadataCall struct {
- s *Service
- project string
- zone string
- instance string
- metadata *Metadata
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetMetadata: Sets metadata for the specified instance to the data
-// included in the request.
-//
-// - instance: Name of the instance scoping this request.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) SetMetadata(project string, zone string, instance string, metadata *Metadata) *InstancesSetMetadataCall {
- c := &InstancesSetMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- c.metadata = metadata
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstancesSetMetadataCall) RequestId(requestId string) *InstancesSetMetadataCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstancesSetMetadataCall) Fields(s ...googleapi.Field) *InstancesSetMetadataCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstancesSetMetadataCall) Context(ctx context.Context) *InstancesSetMetadataCall {
- 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 *InstancesSetMetadataCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesSetMetadataCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/setMetadata")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.setMetadata" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstancesSetMetadataCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Sets metadata for the specified instance to the data included in the request.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{instance}/setMetadata",
- // "httpMethod": "POST",
- // "id": "compute.instances.setMetadata",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Name of the instance scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{instance}/setMetadata",
- // "request": {
- // "$ref": "Metadata"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instances.setMinCpuPlatform":
-
-type InstancesSetMinCpuPlatformCall struct {
- s *Service
- project string
- zone string
- instance string
- instancessetmincpuplatformrequest *InstancesSetMinCpuPlatformRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetMinCpuPlatform: Changes the minimum CPU platform that this
-// instance should use. This method can only be called on a stopped
-// instance. For more information, read Specifying a Minimum CPU
-// Platform.
-//
-// - instance: Name of the instance scoping this request.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) SetMinCpuPlatform(project string, zone string, instance string, instancessetmincpuplatformrequest *InstancesSetMinCpuPlatformRequest) *InstancesSetMinCpuPlatformCall {
- c := &InstancesSetMinCpuPlatformCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- c.instancessetmincpuplatformrequest = instancessetmincpuplatformrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstancesSetMinCpuPlatformCall) RequestId(requestId string) *InstancesSetMinCpuPlatformCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstancesSetMinCpuPlatformCall) Fields(s ...googleapi.Field) *InstancesSetMinCpuPlatformCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstancesSetMinCpuPlatformCall) Context(ctx context.Context) *InstancesSetMinCpuPlatformCall {
- 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 *InstancesSetMinCpuPlatformCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesSetMinCpuPlatformCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmincpuplatformrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.setMinCpuPlatform" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstancesSetMinCpuPlatformCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Changes the minimum CPU platform that this instance should use. This method can only be called on a stopped instance. For more information, read Specifying a Minimum CPU Platform.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform",
- // "httpMethod": "POST",
- // "id": "compute.instances.setMinCpuPlatform",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Name of the instance scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform",
- // "request": {
- // "$ref": "InstancesSetMinCpuPlatformRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instances.setName":
-
-type InstancesSetNameCall struct {
- s *Service
- project string
- zone string
- instance string
- instancessetnamerequest *InstancesSetNameRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetName: Sets name of an instance.
-//
-// - instance: The instance name for this request.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) SetName(project string, zone string, instance string, instancessetnamerequest *InstancesSetNameRequest) *InstancesSetNameCall {
- c := &InstancesSetNameCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- c.instancessetnamerequest = instancessetnamerequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstancesSetNameCall) RequestId(requestId string) *InstancesSetNameCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstancesSetNameCall) Fields(s ...googleapi.Field) *InstancesSetNameCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstancesSetNameCall) Context(ctx context.Context) *InstancesSetNameCall {
- 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 *InstancesSetNameCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesSetNameCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetnamerequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/setName")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.setName" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstancesSetNameCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Sets name of an instance.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{instance}/setName",
- // "httpMethod": "POST",
- // "id": "compute.instances.setName",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "The instance name for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{instance}/setName",
- // "request": {
- // "$ref": "InstancesSetNameRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instances.setScheduling":
-
-type InstancesSetSchedulingCall struct {
- s *Service
- project string
- zone string
- instance string
- scheduling *Scheduling
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetScheduling: Sets an instance's scheduling options. You can only
-// call this method on a stopped instance, that is, a VM instance that
-// is in a `TERMINATED` state. See Instance Life Cycle for more
-// information on the possible instance states. For more information
-// about setting scheduling options for a VM, see Set VM host
-// maintenance policy.
-//
-// - instance: Instance name for this request.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) SetScheduling(project string, zone string, instance string, scheduling *Scheduling) *InstancesSetSchedulingCall {
- c := &InstancesSetSchedulingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- c.scheduling = scheduling
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstancesSetSchedulingCall) RequestId(requestId string) *InstancesSetSchedulingCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstancesSetSchedulingCall) Fields(s ...googleapi.Field) *InstancesSetSchedulingCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstancesSetSchedulingCall) Context(ctx context.Context) *InstancesSetSchedulingCall {
- 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 *InstancesSetSchedulingCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesSetSchedulingCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.scheduling)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/setScheduling")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.setScheduling" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstancesSetSchedulingCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Sets an instance's scheduling options. You can only call this method on a stopped instance, that is, a VM instance that is in a `TERMINATED` state. See Instance Life Cycle for more information on the possible instance states. For more information about setting scheduling options for a VM, see Set VM host maintenance policy.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{instance}/setScheduling",
- // "httpMethod": "POST",
- // "id": "compute.instances.setScheduling",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Instance name for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{instance}/setScheduling",
- // "request": {
- // "$ref": "Scheduling"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instances.setSecurityPolicy":
-
-type InstancesSetSecurityPolicyCall struct {
- s *Service
- project string
- zone string
- instance string
- instancessetsecuritypolicyrequest *InstancesSetSecurityPolicyRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetSecurityPolicy: Sets the Google Cloud Armor security policy for
-// the specified instance. For more information, see Google Cloud Armor
-// Overview
-//
-// - instance: Name of the Instance resource to which the security
-// policy should be set. The name should conform to RFC1035.
-// - project: Project ID for this request.
-// - zone: Name of the zone scoping this request.
-func (r *InstancesService) SetSecurityPolicy(project string, zone string, instance string, instancessetsecuritypolicyrequest *InstancesSetSecurityPolicyRequest) *InstancesSetSecurityPolicyCall {
- c := &InstancesSetSecurityPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- c.instancessetsecuritypolicyrequest = instancessetsecuritypolicyrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstancesSetSecurityPolicyCall) RequestId(requestId string) *InstancesSetSecurityPolicyCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstancesSetSecurityPolicyCall) Fields(s ...googleapi.Field) *InstancesSetSecurityPolicyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstancesSetSecurityPolicyCall) Context(ctx context.Context) *InstancesSetSecurityPolicyCall {
- 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 *InstancesSetSecurityPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesSetSecurityPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetsecuritypolicyrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/setSecurityPolicy")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.setSecurityPolicy" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstancesSetSecurityPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Sets the Google Cloud Armor security policy for the specified instance. For more information, see Google Cloud Armor Overview",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{instance}/setSecurityPolicy",
- // "httpMethod": "POST",
- // "id": "compute.instances.setSecurityPolicy",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Name of the Instance resource to which the security policy should be set. The name should conform to RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "Name of the zone scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{instance}/setSecurityPolicy",
- // "request": {
- // "$ref": "InstancesSetSecurityPolicyRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instances.setServiceAccount":
-
-type InstancesSetServiceAccountCall struct {
- s *Service
- project string
- zone string
- instance string
- instancessetserviceaccountrequest *InstancesSetServiceAccountRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetServiceAccount: Sets the service account on the instance. For more
-// information, read Changing the service account and access scopes for
-// an instance.
-//
-// - instance: Name of the instance resource to start.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) SetServiceAccount(project string, zone string, instance string, instancessetserviceaccountrequest *InstancesSetServiceAccountRequest) *InstancesSetServiceAccountCall {
- c := &InstancesSetServiceAccountCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- c.instancessetserviceaccountrequest = instancessetserviceaccountrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstancesSetServiceAccountCall) RequestId(requestId string) *InstancesSetServiceAccountCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstancesSetServiceAccountCall) Fields(s ...googleapi.Field) *InstancesSetServiceAccountCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstancesSetServiceAccountCall) Context(ctx context.Context) *InstancesSetServiceAccountCall {
- 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 *InstancesSetServiceAccountCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesSetServiceAccountCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetserviceaccountrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/setServiceAccount")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.setServiceAccount" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstancesSetServiceAccountCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{instance}/setServiceAccount",
- // "httpMethod": "POST",
- // "id": "compute.instances.setServiceAccount",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Name of the instance resource to start.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{instance}/setServiceAccount",
- // "request": {
- // "$ref": "InstancesSetServiceAccountRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instances.setShieldedInstanceIntegrityPolicy":
-
-type InstancesSetShieldedInstanceIntegrityPolicyCall struct {
- s *Service
- project string
- zone string
- instance string
- shieldedinstanceintegritypolicy *ShieldedInstanceIntegrityPolicy
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetShieldedInstanceIntegrityPolicy: Sets the Shielded Instance
-// integrity policy for an instance. You can only use this method on a
-// running instance. This method supports PATCH semantics and uses the
-// JSON merge patch format and processing rules.
-//
-// - instance: Name or id of the instance scoping this request.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) SetShieldedInstanceIntegrityPolicy(project string, zone string, instance string, shieldedinstanceintegritypolicy *ShieldedInstanceIntegrityPolicy) *InstancesSetShieldedInstanceIntegrityPolicyCall {
- c := &InstancesSetShieldedInstanceIntegrityPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- c.shieldedinstanceintegritypolicy = shieldedinstanceintegritypolicy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) RequestId(requestId string) *InstancesSetShieldedInstanceIntegrityPolicyCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstancesSetShieldedInstanceIntegrityPolicyCall) Fields(s ...googleapi.Field) *InstancesSetShieldedInstanceIntegrityPolicyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstancesSetShieldedInstanceIntegrityPolicyCall) Context(ctx context.Context) *InstancesSetShieldedInstanceIntegrityPolicyCall {
- 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 *InstancesSetShieldedInstanceIntegrityPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.shieldedinstanceintegritypolicy)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/setShieldedInstanceIntegrityPolicy")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.setShieldedInstanceIntegrityPolicy" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstancesSetShieldedInstanceIntegrityPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Sets the Shielded Instance integrity policy for an instance. You can only use this method on a running instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{instance}/setShieldedInstanceIntegrityPolicy",
- // "httpMethod": "PATCH",
- // "id": "compute.instances.setShieldedInstanceIntegrityPolicy",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Name or id of the instance scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{instance}/setShieldedInstanceIntegrityPolicy",
- // "request": {
- // "$ref": "ShieldedInstanceIntegrityPolicy"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instances.setTags":
-
-type InstancesSetTagsCall struct {
- s *Service
- project string
- zone string
- instance string
- tags *Tags
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetTags: Sets network tags for the specified instance to the data
-// included in the request.
-//
-// - instance: Name of the instance scoping this request.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) SetTags(project string, zone string, instance string, tags *Tags) *InstancesSetTagsCall {
- c := &InstancesSetTagsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- c.tags = tags
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstancesSetTagsCall) RequestId(requestId string) *InstancesSetTagsCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstancesSetTagsCall) Fields(s ...googleapi.Field) *InstancesSetTagsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstancesSetTagsCall) Context(ctx context.Context) *InstancesSetTagsCall {
- 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 *InstancesSetTagsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesSetTagsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.tags)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/setTags")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.setTags" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstancesSetTagsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Sets network tags for the specified instance to the data included in the request.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{instance}/setTags",
- // "httpMethod": "POST",
- // "id": "compute.instances.setTags",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Name of the instance scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{instance}/setTags",
- // "request": {
- // "$ref": "Tags"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instances.simulateMaintenanceEvent":
-
-type InstancesSimulateMaintenanceEventCall struct {
- s *Service
- project string
- zone string
- instance string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SimulateMaintenanceEvent: Simulates a host maintenance event on a VM.
-// For more information, see Simulate a host maintenance event.
-//
-// - instance: Name of the instance scoping this request.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) SimulateMaintenanceEvent(project string, zone string, instance string) *InstancesSimulateMaintenanceEventCall {
- c := &InstancesSimulateMaintenanceEventCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstancesSimulateMaintenanceEventCall) RequestId(requestId string) *InstancesSimulateMaintenanceEventCall {
- c.urlParams_.Set("requestId", requestId)
- return c
-}
-
-// WithExtendedNotifications sets the optional parameter
-// "withExtendedNotifications": Determines whether the customers receive
-// notifications before migration. Only applicable to SF vms.
-func (c *InstancesSimulateMaintenanceEventCall) WithExtendedNotifications(withExtendedNotifications bool) *InstancesSimulateMaintenanceEventCall {
- c.urlParams_.Set("withExtendedNotifications", fmt.Sprint(withExtendedNotifications))
- 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 *InstancesSimulateMaintenanceEventCall) Fields(s ...googleapi.Field) *InstancesSimulateMaintenanceEventCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstancesSimulateMaintenanceEventCall) Context(ctx context.Context) *InstancesSimulateMaintenanceEventCall {
- 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 *InstancesSimulateMaintenanceEventCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesSimulateMaintenanceEventCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/simulateMaintenanceEvent")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.simulateMaintenanceEvent" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstancesSimulateMaintenanceEventCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Simulates a host maintenance event on a VM. For more information, see Simulate a host maintenance event.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{instance}/simulateMaintenanceEvent",
- // "httpMethod": "POST",
- // "id": "compute.instances.simulateMaintenanceEvent",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Name of the instance scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "withExtendedNotifications": {
- // "description": "Determines whether the customers receive notifications before migration. Only applicable to SF vms.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{instance}/simulateMaintenanceEvent",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instances.start":
-
-type InstancesStartCall struct {
- s *Service
- project string
- zone string
- instance string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Start: Starts an instance that was stopped using the instances().stop
-// method. For more information, see Restart an instance.
-//
-// - instance: Name of the instance resource to start.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) Start(project string, zone string, instance string) *InstancesStartCall {
- c := &InstancesStartCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstancesStartCall) RequestId(requestId string) *InstancesStartCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstancesStartCall) Fields(s ...googleapi.Field) *InstancesStartCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstancesStartCall) Context(ctx context.Context) *InstancesStartCall {
- 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 *InstancesStartCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesStartCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/start")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.start" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstancesStartCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{instance}/start",
- // "httpMethod": "POST",
- // "id": "compute.instances.start",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Name of the instance resource to start.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{instance}/start",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instances.startWithEncryptionKey":
-
-type InstancesStartWithEncryptionKeyCall struct {
- s *Service
- project string
- zone string
- instance string
- instancesstartwithencryptionkeyrequest *InstancesStartWithEncryptionKeyRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// StartWithEncryptionKey: Starts an instance that was stopped using the
-// instances().stop method. For more information, see Restart an
-// instance.
-//
-// - instance: Name of the instance resource to start.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) StartWithEncryptionKey(project string, zone string, instance string, instancesstartwithencryptionkeyrequest *InstancesStartWithEncryptionKeyRequest) *InstancesStartWithEncryptionKeyCall {
- c := &InstancesStartWithEncryptionKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- c.instancesstartwithencryptionkeyrequest = instancesstartwithencryptionkeyrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstancesStartWithEncryptionKeyCall) RequestId(requestId string) *InstancesStartWithEncryptionKeyCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstancesStartWithEncryptionKeyCall) Fields(s ...googleapi.Field) *InstancesStartWithEncryptionKeyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstancesStartWithEncryptionKeyCall) Context(ctx context.Context) *InstancesStartWithEncryptionKeyCall {
- 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 *InstancesStartWithEncryptionKeyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesStartWithEncryptionKeyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesstartwithencryptionkeyrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.startWithEncryptionKey" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstancesStartWithEncryptionKeyCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey",
- // "httpMethod": "POST",
- // "id": "compute.instances.startWithEncryptionKey",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Name of the instance resource to start.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey",
- // "request": {
- // "$ref": "InstancesStartWithEncryptionKeyRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instances.stop":
-
-type InstancesStopCall struct {
- s *Service
- project string
- zone string
- instance string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Stop: Stops a running instance, shutting it down cleanly, and allows
-// you to restart the instance at a later time. Stopped instances do not
-// incur VM usage charges while they are stopped. However, resources
-// that the VM is using, such as persistent disks and static IP
-// addresses, will continue to be charged until they are deleted. For
-// more information, see Stopping an instance.
-//
-// - instance: Name of the instance resource to stop.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) Stop(project string, zone string, instance string) *InstancesStopCall {
- c := &InstancesStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- return c
-}
-
-// DiscardLocalSsd sets the optional parameter "discardLocalSsd": This
-// property is required if the instance has any attached Local SSD
-// disks. If false, Local SSD data will be preserved when the instance
-// is suspended. If true, the contents of any attached Local SSD disks
-// will be discarded.
-func (c *InstancesStopCall) DiscardLocalSsd(discardLocalSsd bool) *InstancesStopCall {
- c.urlParams_.Set("discardLocalSsd", fmt.Sprint(discardLocalSsd))
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstancesStopCall) RequestId(requestId string) *InstancesStopCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstancesStopCall) Fields(s ...googleapi.Field) *InstancesStopCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstancesStopCall) Context(ctx context.Context) *InstancesStopCall {
- 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 *InstancesStopCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesStopCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/stop")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.stop" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstancesStopCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur VM usage charges while they are stopped. However, resources that the VM is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{instance}/stop",
- // "httpMethod": "POST",
- // "id": "compute.instances.stop",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instance"
- // ],
- // "parameters": {
- // "discardLocalSsd": {
- // "description": "This property is required if the instance has any attached Local SSD disks. If false, Local SSD data will be preserved when the instance is suspended. If true, the contents of any attached Local SSD disks will be discarded.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "instance": {
- // "description": "Name of the instance resource to stop.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{instance}/stop",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instances.suspend":
-
-type InstancesSuspendCall struct {
- s *Service
- project string
- zone string
- instance string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Suspend: This method suspends a running instance, saving its state to
-// persistent storage, and allows you to resume the instance at a later
-// time. Suspended instances have no compute costs (cores or RAM), and
-// incur only storage charges for the saved VM memory and localSSD data.
-// Any charged resources the virtual machine was using, such as
-// persistent disks and static IP addresses, will continue to be charged
-// while the instance is suspended. For more information, see Suspending
-// and resuming an instance.
-//
-// - instance: Name of the instance resource to suspend.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) Suspend(project string, zone string, instance string) *InstancesSuspendCall {
- c := &InstancesSuspendCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- return c
-}
-
-// DiscardLocalSsd sets the optional parameter "discardLocalSsd": This
-// property is required if the instance has any attached Local SSD
-// disks. If false, Local SSD data will be preserved when the instance
-// is suspended. If true, the contents of any attached Local SSD disks
-// will be discarded.
-func (c *InstancesSuspendCall) DiscardLocalSsd(discardLocalSsd bool) *InstancesSuspendCall {
- c.urlParams_.Set("discardLocalSsd", fmt.Sprint(discardLocalSsd))
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstancesSuspendCall) RequestId(requestId string) *InstancesSuspendCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstancesSuspendCall) Fields(s ...googleapi.Field) *InstancesSuspendCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstancesSuspendCall) Context(ctx context.Context) *InstancesSuspendCall {
- 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 *InstancesSuspendCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesSuspendCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/suspend")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.suspend" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstancesSuspendCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "This method suspends a running instance, saving its state to persistent storage, and allows you to resume the instance at a later time. Suspended instances have no compute costs (cores or RAM), and incur only storage charges for the saved VM memory and localSSD data. Any charged resources the virtual machine was using, such as persistent disks and static IP addresses, will continue to be charged while the instance is suspended. For more information, see Suspending and resuming an instance.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{instance}/suspend",
- // "httpMethod": "POST",
- // "id": "compute.instances.suspend",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instance"
- // ],
- // "parameters": {
- // "discardLocalSsd": {
- // "description": "This property is required if the instance has any attached Local SSD disks. If false, Local SSD data will be preserved when the instance is suspended. If true, the contents of any attached Local SSD disks will be discarded.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "instance": {
- // "description": "Name of the instance resource to suspend.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{instance}/suspend",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instances.testIamPermissions":
-
-type InstancesTestIamPermissionsCall struct {
- s *Service
- project string
- zone string
- resource string
- testpermissionsrequest *TestPermissionsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// TestIamPermissions: Returns permissions that a caller has on the
-// specified resource.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstancesTestIamPermissionsCall {
- c := &InstancesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.resource = resource
- c.testpermissionsrequest = testpermissionsrequest
- 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 *InstancesTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstancesTestIamPermissionsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstancesTestIamPermissionsCall) Context(ctx context.Context) *InstancesTestIamPermissionsCall {
- 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 *InstancesTestIamPermissionsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{resource}/testIamPermissions")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.testIamPermissions" call.
-// Exactly one of *TestPermissionsResponse or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *TestPermissionsResponse.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 *InstancesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TestPermissionsResponse{
- 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": "Returns permissions that a caller has on the specified resource.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{resource}/testIamPermissions",
- // "httpMethod": "POST",
- // "id": "compute.instances.testIamPermissions",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{resource}/testIamPermissions",
- // "request": {
- // "$ref": "TestPermissionsRequest"
- // },
- // "response": {
- // "$ref": "TestPermissionsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.instances.update":
-
-type InstancesUpdateCall struct {
- s *Service
- project string
- zone string
- instance string
- instance2 *Instance
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Update: Updates an instance only if the necessary resources are
-// available. This method can update only a specific set of instance
-// properties. See Updating a running instance for a list of updatable
-// instance properties.
-//
-// - instance: Name of the instance resource to update.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) Update(project string, zone string, instance string, instance2 *Instance) *InstancesUpdateCall {
- c := &InstancesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- c.instance2 = instance2
- return c
-}
-
-// MinimalAction sets the optional parameter "minimalAction": Specifies
-// the action to take when updating an instance even if the updated
-// properties do not require it. If not specified, then Compute Engine
-// acts based on the minimum action that the updated properties require.
-//
-// Possible values:
-//
-// "INVALID"
-// "NO_EFFECT" - No changes can be made to the instance.
-// "REFRESH" - The instance will not restart.
-// "RESTART" - The instance will restart.
-func (c *InstancesUpdateCall) MinimalAction(minimalAction string) *InstancesUpdateCall {
- c.urlParams_.Set("minimalAction", minimalAction)
- return c
-}
-
-// MostDisruptiveAllowedAction sets the optional parameter
-// "mostDisruptiveAllowedAction": Specifies the most disruptive action
-// that can be taken on the instance as part of the update. Compute
-// Engine returns an error if the instance properties require a more
-// disruptive action as part of the instance update. Valid options from
-// lowest to highest are NO_EFFECT, REFRESH, and RESTART.
-//
-// Possible values:
-//
-// "INVALID"
-// "NO_EFFECT" - No changes can be made to the instance.
-// "REFRESH" - The instance will not restart.
-// "RESTART" - The instance will restart.
-func (c *InstancesUpdateCall) MostDisruptiveAllowedAction(mostDisruptiveAllowedAction string) *InstancesUpdateCall {
- c.urlParams_.Set("mostDisruptiveAllowedAction", mostDisruptiveAllowedAction)
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstancesUpdateCall) RequestId(requestId string) *InstancesUpdateCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstancesUpdateCall) Fields(s ...googleapi.Field) *InstancesUpdateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstancesUpdateCall) Context(ctx context.Context) *InstancesUpdateCall {
- 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 *InstancesUpdateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesUpdateCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance2)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PUT", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.update" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstancesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Updates an instance only if the necessary resources are available. This method can update only a specific set of instance properties. See Updating a running instance for a list of updatable instance properties.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{instance}",
- // "httpMethod": "PUT",
- // "id": "compute.instances.update",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Name of the instance resource to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "minimalAction": {
- // "description": "Specifies the action to take when updating an instance even if the updated properties do not require it. If not specified, then Compute Engine acts based on the minimum action that the updated properties require.",
- // "enum": [
- // "INVALID",
- // "NO_EFFECT",
- // "REFRESH",
- // "RESTART"
- // ],
- // "enumDescriptions": [
- // "",
- // "No changes can be made to the instance.",
- // "The instance will not restart.",
- // "The instance will restart."
- // ],
- // "location": "query",
- // "type": "string"
- // },
- // "mostDisruptiveAllowedAction": {
- // "description": "Specifies the most disruptive action that can be taken on the instance as part of the update. Compute Engine returns an error if the instance properties require a more disruptive action as part of the instance update. Valid options from lowest to highest are NO_EFFECT, REFRESH, and RESTART.",
- // "enum": [
- // "INVALID",
- // "NO_EFFECT",
- // "REFRESH",
- // "RESTART"
- // ],
- // "enumDescriptions": [
- // "",
- // "No changes can be made to the instance.",
- // "The instance will not restart.",
- // "The instance will restart."
- // ],
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{instance}",
- // "request": {
- // "$ref": "Instance"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instances.updateAccessConfig":
-
-type InstancesUpdateAccessConfigCall struct {
- s *Service
- project string
- zone string
- instance string
- accessconfig *AccessConfig
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// UpdateAccessConfig: Updates the specified access config from an
-// instance's network interface with the data included in the request.
-// This method supports PATCH semantics and uses the JSON merge patch
-// format and processing rules.
-//
-// - instance: The instance name for this request.
-// - networkInterface: The name of the network interface where the
-// access config is attached.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) UpdateAccessConfig(project string, zone string, instance string, networkInterface string, accessconfig *AccessConfig) *InstancesUpdateAccessConfigCall {
- c := &InstancesUpdateAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- c.urlParams_.Set("networkInterface", networkInterface)
- c.accessconfig = accessconfig
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstancesUpdateAccessConfigCall) RequestId(requestId string) *InstancesUpdateAccessConfigCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstancesUpdateAccessConfigCall) Fields(s ...googleapi.Field) *InstancesUpdateAccessConfigCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstancesUpdateAccessConfigCall) Context(ctx context.Context) *InstancesUpdateAccessConfigCall {
- 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 *InstancesUpdateAccessConfigCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesUpdateAccessConfigCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/updateAccessConfig")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.updateAccessConfig" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstancesUpdateAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Updates the specified access config from an instance's network interface with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{instance}/updateAccessConfig",
- // "httpMethod": "POST",
- // "id": "compute.instances.updateAccessConfig",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instance",
- // "networkInterface"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "The instance name for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "networkInterface": {
- // "description": "The name of the network interface where the access config is attached.",
- // "location": "query",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{instance}/updateAccessConfig",
- // "request": {
- // "$ref": "AccessConfig"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instances.updateDisplayDevice":
-
-type InstancesUpdateDisplayDeviceCall struct {
- s *Service
- project string
- zone string
- instance string
- displaydevice *DisplayDevice
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// UpdateDisplayDevice: Updates the Display config for a VM instance.
-// You can only use this method on a stopped VM instance. This method
-// supports PATCH semantics and uses the JSON merge patch format and
-// processing rules.
-//
-// - instance: Name of the instance scoping this request.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) UpdateDisplayDevice(project string, zone string, instance string, displaydevice *DisplayDevice) *InstancesUpdateDisplayDeviceCall {
- c := &InstancesUpdateDisplayDeviceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- c.displaydevice = displaydevice
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstancesUpdateDisplayDeviceCall) RequestId(requestId string) *InstancesUpdateDisplayDeviceCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstancesUpdateDisplayDeviceCall) Fields(s ...googleapi.Field) *InstancesUpdateDisplayDeviceCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstancesUpdateDisplayDeviceCall) Context(ctx context.Context) *InstancesUpdateDisplayDeviceCall {
- 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 *InstancesUpdateDisplayDeviceCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesUpdateDisplayDeviceCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.displaydevice)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/updateDisplayDevice")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.updateDisplayDevice" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstancesUpdateDisplayDeviceCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Updates the Display config for a VM instance. You can only use this method on a stopped VM instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{instance}/updateDisplayDevice",
- // "httpMethod": "PATCH",
- // "id": "compute.instances.updateDisplayDevice",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Name of the instance scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{instance}/updateDisplayDevice",
- // "request": {
- // "$ref": "DisplayDevice"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instances.updateNetworkInterface":
-
-type InstancesUpdateNetworkInterfaceCall struct {
- s *Service
- project string
- zone string
- instance string
- networkinterface *NetworkInterface
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// UpdateNetworkInterface: Updates an instance's network interface. This
-// method can only update an interface's alias IP range and attached
-// network. See Modifying alias IP ranges for an existing instance for
-// instructions on changing alias IP ranges. See Migrating a VM between
-// networks for instructions on migrating an interface. This method
-// follows PATCH semantics.
-//
-// - instance: The instance name for this request.
-// - networkInterface: The name of the network interface to update.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) UpdateNetworkInterface(project string, zone string, instance string, networkInterface string, networkinterface *NetworkInterface) *InstancesUpdateNetworkInterfaceCall {
- c := &InstancesUpdateNetworkInterfaceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- c.urlParams_.Set("networkInterface", networkInterface)
- c.networkinterface = networkinterface
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstancesUpdateNetworkInterfaceCall) RequestId(requestId string) *InstancesUpdateNetworkInterfaceCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstancesUpdateNetworkInterfaceCall) Fields(s ...googleapi.Field) *InstancesUpdateNetworkInterfaceCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstancesUpdateNetworkInterfaceCall) Context(ctx context.Context) *InstancesUpdateNetworkInterfaceCall {
- 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 *InstancesUpdateNetworkInterfaceCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesUpdateNetworkInterfaceCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkinterface)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/updateNetworkInterface")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.updateNetworkInterface" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstancesUpdateNetworkInterfaceCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Updates an instance's network interface. This method can only update an interface's alias IP range and attached network. See Modifying alias IP ranges for an existing instance for instructions on changing alias IP ranges. See Migrating a VM between networks for instructions on migrating an interface. This method follows PATCH semantics.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{instance}/updateNetworkInterface",
- // "httpMethod": "PATCH",
- // "id": "compute.instances.updateNetworkInterface",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instance",
- // "networkInterface"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "The instance name for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "networkInterface": {
- // "description": "The name of the network interface to update.",
- // "location": "query",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{instance}/updateNetworkInterface",
- // "request": {
- // "$ref": "NetworkInterface"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.instances.updateShieldedInstanceConfig":
-
-type InstancesUpdateShieldedInstanceConfigCall struct {
- s *Service
- project string
- zone string
- instance string
- shieldedinstanceconfig *ShieldedInstanceConfig
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// UpdateShieldedInstanceConfig: Updates the Shielded Instance config
-// for an instance. You can only use this method on a stopped instance.
-// This method supports PATCH semantics and uses the JSON merge patch
-// format and processing rules.
-//
-// - instance: Name or id of the instance scoping this request.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *InstancesService) UpdateShieldedInstanceConfig(project string, zone string, instance string, shieldedinstanceconfig *ShieldedInstanceConfig) *InstancesUpdateShieldedInstanceConfigCall {
- c := &InstancesUpdateShieldedInstanceConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.instance = instance
- c.shieldedinstanceconfig = shieldedinstanceconfig
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InstancesUpdateShieldedInstanceConfigCall) RequestId(requestId string) *InstancesUpdateShieldedInstanceConfigCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InstancesUpdateShieldedInstanceConfigCall) Fields(s ...googleapi.Field) *InstancesUpdateShieldedInstanceConfigCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InstancesUpdateShieldedInstanceConfigCall) Context(ctx context.Context) *InstancesUpdateShieldedInstanceConfigCall {
- 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 *InstancesUpdateShieldedInstanceConfigCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InstancesUpdateShieldedInstanceConfigCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.shieldedinstanceconfig)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/updateShieldedInstanceConfig")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "instance": c.instance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.instances.updateShieldedInstanceConfig" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InstancesUpdateShieldedInstanceConfigCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Updates the Shielded Instance config for an instance. You can only use this method on a stopped instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
- // "flatPath": "projects/{project}/zones/{zone}/instances/{instance}/updateShieldedInstanceConfig",
- // "httpMethod": "PATCH",
- // "id": "compute.instances.updateShieldedInstanceConfig",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "instance"
- // ],
- // "parameters": {
- // "instance": {
- // "description": "Name or id of the instance scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/instances/{instance}/updateShieldedInstanceConfig",
- // "request": {
- // "$ref": "ShieldedInstanceConfig"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.interconnectAttachments.aggregatedList":
-
-type InterconnectAttachmentsAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Retrieves an aggregated list of interconnect
-// attachments.
-//
-// - project: Project ID for this request.
-func (r *InterconnectAttachmentsService) AggregatedList(project string) *InterconnectAttachmentsAggregatedListCall {
- c := &InterconnectAttachmentsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *InterconnectAttachmentsAggregatedListCall) Filter(filter string) *InterconnectAttachmentsAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *InterconnectAttachmentsAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *InterconnectAttachmentsAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *InterconnectAttachmentsAggregatedListCall) MaxResults(maxResults int64) *InterconnectAttachmentsAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *InterconnectAttachmentsAggregatedListCall) OrderBy(orderBy string) *InterconnectAttachmentsAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *InterconnectAttachmentsAggregatedListCall) PageToken(pageToken string) *InterconnectAttachmentsAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *InterconnectAttachmentsAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InterconnectAttachmentsAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *InterconnectAttachmentsAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *InterconnectAttachmentsAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *InterconnectAttachmentsAggregatedListCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsAggregatedListCall {
- 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 *InterconnectAttachmentsAggregatedListCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsAggregatedListCall {
- 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 *InterconnectAttachmentsAggregatedListCall) Context(ctx context.Context) *InterconnectAttachmentsAggregatedListCall {
- 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 *InterconnectAttachmentsAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InterconnectAttachmentsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/interconnectAttachments")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.interconnectAttachments.aggregatedList" call.
-// Exactly one of *InterconnectAttachmentAggregatedList or error will be
-// non-nil. Any non-2xx status code is an error. Response headers are in
-// either *InterconnectAttachmentAggregatedList.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 *InterconnectAttachmentsAggregatedListCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachmentAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &InterconnectAttachmentAggregatedList{
- 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": "Retrieves an aggregated list of interconnect attachments.",
- // "flatPath": "projects/{project}/aggregated/interconnectAttachments",
- // "httpMethod": "GET",
- // "id": "compute.interconnectAttachments.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/interconnectAttachments",
- // "response": {
- // "$ref": "InterconnectAttachmentAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *InterconnectAttachmentsAggregatedListCall) Pages(ctx context.Context, f func(*InterconnectAttachmentAggregatedList) 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 "compute.interconnectAttachments.delete":
-
-type InterconnectAttachmentsDeleteCall struct {
- s *Service
- project string
- region string
- interconnectAttachment string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified interconnect attachment.
-//
-// - interconnectAttachment: Name of the interconnect attachment to
-// delete.
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-func (r *InterconnectAttachmentsService) Delete(project string, region string, interconnectAttachment string) *InterconnectAttachmentsDeleteCall {
- c := &InterconnectAttachmentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.interconnectAttachment = interconnectAttachment
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InterconnectAttachmentsDeleteCall) RequestId(requestId string) *InterconnectAttachmentsDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InterconnectAttachmentsDeleteCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InterconnectAttachmentsDeleteCall) Context(ctx context.Context) *InterconnectAttachmentsDeleteCall {
- 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 *InterconnectAttachmentsDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InterconnectAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "interconnectAttachment": c.interconnectAttachment,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.interconnectAttachments.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InterconnectAttachmentsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified interconnect attachment.",
- // "flatPath": "projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}",
- // "httpMethod": "DELETE",
- // "id": "compute.interconnectAttachments.delete",
- // "parameterOrder": [
- // "project",
- // "region",
- // "interconnectAttachment"
- // ],
- // "parameters": {
- // "interconnectAttachment": {
- // "description": "Name of the interconnect attachment to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.interconnectAttachments.get":
-
-type InterconnectAttachmentsGetCall struct {
- s *Service
- project string
- region string
- interconnectAttachment string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified interconnect attachment.
-//
-// - interconnectAttachment: Name of the interconnect attachment to
-// return.
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-func (r *InterconnectAttachmentsService) Get(project string, region string, interconnectAttachment string) *InterconnectAttachmentsGetCall {
- c := &InterconnectAttachmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.interconnectAttachment = interconnectAttachment
- 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 *InterconnectAttachmentsGetCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsGetCall {
- 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 *InterconnectAttachmentsGetCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsGetCall {
- 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 *InterconnectAttachmentsGetCall) Context(ctx context.Context) *InterconnectAttachmentsGetCall {
- 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 *InterconnectAttachmentsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InterconnectAttachmentsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")
- 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{
- "project": c.project,
- "region": c.region,
- "interconnectAttachment": c.interconnectAttachment,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.interconnectAttachments.get" call.
-// Exactly one of *InterconnectAttachment or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *InterconnectAttachment.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 *InterconnectAttachmentsGetCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachment, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &InterconnectAttachment{
- 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": "Returns the specified interconnect attachment.",
- // "flatPath": "projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}",
- // "httpMethod": "GET",
- // "id": "compute.interconnectAttachments.get",
- // "parameterOrder": [
- // "project",
- // "region",
- // "interconnectAttachment"
- // ],
- // "parameters": {
- // "interconnectAttachment": {
- // "description": "Name of the interconnect attachment to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}",
- // "response": {
- // "$ref": "InterconnectAttachment"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.interconnectAttachments.insert":
-
-type InterconnectAttachmentsInsertCall struct {
- s *Service
- project string
- region string
- interconnectattachment *InterconnectAttachment
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates an InterconnectAttachment in the specified project
-// using the data included in the request.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-func (r *InterconnectAttachmentsService) Insert(project string, region string, interconnectattachment *InterconnectAttachment) *InterconnectAttachmentsInsertCall {
- c := &InterconnectAttachmentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.interconnectattachment = interconnectattachment
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InterconnectAttachmentsInsertCall) RequestId(requestId string) *InterconnectAttachmentsInsertCall {
- c.urlParams_.Set("requestId", requestId)
- return c
-}
-
-// ValidateOnly sets the optional parameter "validateOnly": If true, the
-// request will not be committed.
-func (c *InterconnectAttachmentsInsertCall) ValidateOnly(validateOnly bool) *InterconnectAttachmentsInsertCall {
- c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
- 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 *InterconnectAttachmentsInsertCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InterconnectAttachmentsInsertCall) Context(ctx context.Context) *InterconnectAttachmentsInsertCall {
- 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 *InterconnectAttachmentsInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InterconnectAttachmentsInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnectattachment)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/interconnectAttachments")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.interconnectAttachments.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InterconnectAttachmentsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates an InterconnectAttachment in the specified project using the data included in the request.",
- // "flatPath": "projects/{project}/regions/{region}/interconnectAttachments",
- // "httpMethod": "POST",
- // "id": "compute.interconnectAttachments.insert",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "validateOnly": {
- // "description": "If true, the request will not be committed.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/interconnectAttachments",
- // "request": {
- // "$ref": "InterconnectAttachment"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.interconnectAttachments.list":
-
-type InterconnectAttachmentsListCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves the list of interconnect attachments contained within
-// the specified region.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-func (r *InterconnectAttachmentsService) List(project string, region string) *InterconnectAttachmentsListCall {
- c := &InterconnectAttachmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *InterconnectAttachmentsListCall) Filter(filter string) *InterconnectAttachmentsListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *InterconnectAttachmentsListCall) MaxResults(maxResults int64) *InterconnectAttachmentsListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *InterconnectAttachmentsListCall) OrderBy(orderBy string) *InterconnectAttachmentsListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *InterconnectAttachmentsListCall) PageToken(pageToken string) *InterconnectAttachmentsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *InterconnectAttachmentsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InterconnectAttachmentsListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *InterconnectAttachmentsListCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsListCall {
- 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 *InterconnectAttachmentsListCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsListCall {
- 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 *InterconnectAttachmentsListCall) Context(ctx context.Context) *InterconnectAttachmentsListCall {
- 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 *InterconnectAttachmentsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InterconnectAttachmentsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/interconnectAttachments")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.interconnectAttachments.list" call.
-// Exactly one of *InterconnectAttachmentList or error will be non-nil.
-// Any non-2xx status code is an error. Response headers are in either
-// *InterconnectAttachmentList.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 *InterconnectAttachmentsListCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachmentList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &InterconnectAttachmentList{
- 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": "Retrieves the list of interconnect attachments contained within the specified region.",
- // "flatPath": "projects/{project}/regions/{region}/interconnectAttachments",
- // "httpMethod": "GET",
- // "id": "compute.interconnectAttachments.list",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/interconnectAttachments",
- // "response": {
- // "$ref": "InterconnectAttachmentList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *InterconnectAttachmentsListCall) Pages(ctx context.Context, f func(*InterconnectAttachmentList) 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 "compute.interconnectAttachments.patch":
-
-type InterconnectAttachmentsPatchCall struct {
- s *Service
- project string
- region string
- interconnectAttachment string
- interconnectattachment *InterconnectAttachment
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Updates the specified interconnect attachment with the data
-// included in the request. This method supports PATCH semantics and
-// uses the JSON merge patch format and processing rules.
-//
-// - interconnectAttachment: Name of the interconnect attachment to
-// patch.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *InterconnectAttachmentsService) Patch(project string, region string, interconnectAttachment string, interconnectattachment *InterconnectAttachment) *InterconnectAttachmentsPatchCall {
- c := &InterconnectAttachmentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.interconnectAttachment = interconnectAttachment
- c.interconnectattachment = interconnectattachment
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InterconnectAttachmentsPatchCall) RequestId(requestId string) *InterconnectAttachmentsPatchCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InterconnectAttachmentsPatchCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InterconnectAttachmentsPatchCall) Context(ctx context.Context) *InterconnectAttachmentsPatchCall {
- 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 *InterconnectAttachmentsPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InterconnectAttachmentsPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnectattachment)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "interconnectAttachment": c.interconnectAttachment,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.interconnectAttachments.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InterconnectAttachmentsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Updates the specified interconnect attachment with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
- // "flatPath": "projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}",
- // "httpMethod": "PATCH",
- // "id": "compute.interconnectAttachments.patch",
- // "parameterOrder": [
- // "project",
- // "region",
- // "interconnectAttachment"
- // ],
- // "parameters": {
- // "interconnectAttachment": {
- // "description": "Name of the interconnect attachment to patch.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}",
- // "request": {
- // "$ref": "InterconnectAttachment"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.interconnectAttachments.setLabels":
-
-type InterconnectAttachmentsSetLabelsCall struct {
- s *Service
- project string
- region string
- resource string
- regionsetlabelsrequest *RegionSetLabelsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetLabels: Sets the labels on an InterconnectAttachment. To learn
-// more about labels, read the Labeling Resources documentation.
-//
-// - project: Project ID for this request.
-// - region: The region for this request.
-// - resource: Name or id of the resource for this request.
-func (r *InterconnectAttachmentsService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *InterconnectAttachmentsSetLabelsCall {
- c := &InterconnectAttachmentsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.resource = resource
- c.regionsetlabelsrequest = regionsetlabelsrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InterconnectAttachmentsSetLabelsCall) RequestId(requestId string) *InterconnectAttachmentsSetLabelsCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InterconnectAttachmentsSetLabelsCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsSetLabelsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InterconnectAttachmentsSetLabelsCall) Context(ctx context.Context) *InterconnectAttachmentsSetLabelsCall {
- 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 *InterconnectAttachmentsSetLabelsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InterconnectAttachmentsSetLabelsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/interconnectAttachments/{resource}/setLabels")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.interconnectAttachments.setLabels" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InterconnectAttachmentsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Sets the labels on an InterconnectAttachment. To learn more about labels, read the Labeling Resources documentation.",
- // "flatPath": "projects/{project}/regions/{region}/interconnectAttachments/{resource}/setLabels",
- // "httpMethod": "POST",
- // "id": "compute.interconnectAttachments.setLabels",
- // "parameterOrder": [
- // "project",
- // "region",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/interconnectAttachments/{resource}/setLabels",
- // "request": {
- // "$ref": "RegionSetLabelsRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.interconnectLocations.get":
-
-type InterconnectLocationsGetCall struct {
- s *Service
- project string
- interconnectLocation string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the details for the specified interconnect location.
-// Gets a list of available interconnect locations by making a list()
-// request.
-//
-// - interconnectLocation: Name of the interconnect location to return.
-// - project: Project ID for this request.
-func (r *InterconnectLocationsService) Get(project string, interconnectLocation string) *InterconnectLocationsGetCall {
- c := &InterconnectLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.interconnectLocation = interconnectLocation
- 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 *InterconnectLocationsGetCall) Fields(s ...googleapi.Field) *InterconnectLocationsGetCall {
- 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 *InterconnectLocationsGetCall) IfNoneMatch(entityTag string) *InterconnectLocationsGetCall {
- 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 *InterconnectLocationsGetCall) Context(ctx context.Context) *InterconnectLocationsGetCall {
- 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 *InterconnectLocationsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InterconnectLocationsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/interconnectLocations/{interconnectLocation}")
- 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{
- "project": c.project,
- "interconnectLocation": c.interconnectLocation,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.interconnectLocations.get" call.
-// Exactly one of *InterconnectLocation or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *InterconnectLocation.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 *InterconnectLocationsGetCall) Do(opts ...googleapi.CallOption) (*InterconnectLocation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &InterconnectLocation{
- 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": "Returns the details for the specified interconnect location. Gets a list of available interconnect locations by making a list() request.",
- // "flatPath": "projects/{project}/global/interconnectLocations/{interconnectLocation}",
- // "httpMethod": "GET",
- // "id": "compute.interconnectLocations.get",
- // "parameterOrder": [
- // "project",
- // "interconnectLocation"
- // ],
- // "parameters": {
- // "interconnectLocation": {
- // "description": "Name of the interconnect location to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/interconnectLocations/{interconnectLocation}",
- // "response": {
- // "$ref": "InterconnectLocation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.interconnectLocations.list":
-
-type InterconnectLocationsListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves the list of interconnect locations available to the
-// specified project.
-//
-// - project: Project ID for this request.
-func (r *InterconnectLocationsService) List(project string) *InterconnectLocationsListCall {
- c := &InterconnectLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *InterconnectLocationsListCall) Filter(filter string) *InterconnectLocationsListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *InterconnectLocationsListCall) MaxResults(maxResults int64) *InterconnectLocationsListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *InterconnectLocationsListCall) OrderBy(orderBy string) *InterconnectLocationsListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *InterconnectLocationsListCall) PageToken(pageToken string) *InterconnectLocationsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *InterconnectLocationsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InterconnectLocationsListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *InterconnectLocationsListCall) Fields(s ...googleapi.Field) *InterconnectLocationsListCall {
- 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 *InterconnectLocationsListCall) IfNoneMatch(entityTag string) *InterconnectLocationsListCall {
- 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 *InterconnectLocationsListCall) Context(ctx context.Context) *InterconnectLocationsListCall {
- 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 *InterconnectLocationsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InterconnectLocationsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/interconnectLocations")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.interconnectLocations.list" call.
-// Exactly one of *InterconnectLocationList or error will be non-nil.
-// Any non-2xx status code is an error. Response headers are in either
-// *InterconnectLocationList.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 *InterconnectLocationsListCall) Do(opts ...googleapi.CallOption) (*InterconnectLocationList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &InterconnectLocationList{
- 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": "Retrieves the list of interconnect locations available to the specified project.",
- // "flatPath": "projects/{project}/global/interconnectLocations",
- // "httpMethod": "GET",
- // "id": "compute.interconnectLocations.list",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/interconnectLocations",
- // "response": {
- // "$ref": "InterconnectLocationList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *InterconnectLocationsListCall) Pages(ctx context.Context, f func(*InterconnectLocationList) 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 "compute.interconnectRemoteLocations.get":
-
-type InterconnectRemoteLocationsGetCall struct {
- s *Service
- project string
- interconnectRemoteLocation string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the details for the specified interconnect remote
-// location. Gets a list of available interconnect remote locations by
-// making a list() request.
-//
-// - interconnectRemoteLocation: Name of the interconnect remote
-// location to return.
-// - project: Project ID for this request.
-func (r *InterconnectRemoteLocationsService) Get(project string, interconnectRemoteLocation string) *InterconnectRemoteLocationsGetCall {
- c := &InterconnectRemoteLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.interconnectRemoteLocation = interconnectRemoteLocation
- 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 *InterconnectRemoteLocationsGetCall) Fields(s ...googleapi.Field) *InterconnectRemoteLocationsGetCall {
- 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 *InterconnectRemoteLocationsGetCall) IfNoneMatch(entityTag string) *InterconnectRemoteLocationsGetCall {
- 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 *InterconnectRemoteLocationsGetCall) Context(ctx context.Context) *InterconnectRemoteLocationsGetCall {
- 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 *InterconnectRemoteLocationsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InterconnectRemoteLocationsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/interconnectRemoteLocations/{interconnectRemoteLocation}")
- 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{
- "project": c.project,
- "interconnectRemoteLocation": c.interconnectRemoteLocation,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.interconnectRemoteLocations.get" call.
-// Exactly one of *InterconnectRemoteLocation or error will be non-nil.
-// Any non-2xx status code is an error. Response headers are in either
-// *InterconnectRemoteLocation.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 *InterconnectRemoteLocationsGetCall) Do(opts ...googleapi.CallOption) (*InterconnectRemoteLocation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &InterconnectRemoteLocation{
- 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": "Returns the details for the specified interconnect remote location. Gets a list of available interconnect remote locations by making a list() request.",
- // "flatPath": "projects/{project}/global/interconnectRemoteLocations/{interconnectRemoteLocation}",
- // "httpMethod": "GET",
- // "id": "compute.interconnectRemoteLocations.get",
- // "parameterOrder": [
- // "project",
- // "interconnectRemoteLocation"
- // ],
- // "parameters": {
- // "interconnectRemoteLocation": {
- // "description": "Name of the interconnect remote location to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/interconnectRemoteLocations/{interconnectRemoteLocation}",
- // "response": {
- // "$ref": "InterconnectRemoteLocation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.interconnectRemoteLocations.list":
-
-type InterconnectRemoteLocationsListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves the list of interconnect remote locations available
-// to the specified project.
-//
-// - project: Project ID for this request.
-func (r *InterconnectRemoteLocationsService) List(project string) *InterconnectRemoteLocationsListCall {
- c := &InterconnectRemoteLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *InterconnectRemoteLocationsListCall) Filter(filter string) *InterconnectRemoteLocationsListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *InterconnectRemoteLocationsListCall) MaxResults(maxResults int64) *InterconnectRemoteLocationsListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *InterconnectRemoteLocationsListCall) OrderBy(orderBy string) *InterconnectRemoteLocationsListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *InterconnectRemoteLocationsListCall) PageToken(pageToken string) *InterconnectRemoteLocationsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *InterconnectRemoteLocationsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InterconnectRemoteLocationsListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *InterconnectRemoteLocationsListCall) Fields(s ...googleapi.Field) *InterconnectRemoteLocationsListCall {
- 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 *InterconnectRemoteLocationsListCall) IfNoneMatch(entityTag string) *InterconnectRemoteLocationsListCall {
- 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 *InterconnectRemoteLocationsListCall) Context(ctx context.Context) *InterconnectRemoteLocationsListCall {
- 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 *InterconnectRemoteLocationsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InterconnectRemoteLocationsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/interconnectRemoteLocations")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.interconnectRemoteLocations.list" call.
-// Exactly one of *InterconnectRemoteLocationList or error will be
-// non-nil. Any non-2xx status code is an error. Response headers are in
-// either *InterconnectRemoteLocationList.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 *InterconnectRemoteLocationsListCall) Do(opts ...googleapi.CallOption) (*InterconnectRemoteLocationList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &InterconnectRemoteLocationList{
- 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": "Retrieves the list of interconnect remote locations available to the specified project.",
- // "flatPath": "projects/{project}/global/interconnectRemoteLocations",
- // "httpMethod": "GET",
- // "id": "compute.interconnectRemoteLocations.list",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/interconnectRemoteLocations",
- // "response": {
- // "$ref": "InterconnectRemoteLocationList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *InterconnectRemoteLocationsListCall) Pages(ctx context.Context, f func(*InterconnectRemoteLocationList) 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 "compute.interconnects.delete":
-
-type InterconnectsDeleteCall struct {
- s *Service
- project string
- interconnect string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified Interconnect.
-//
-// - interconnect: Name of the interconnect to delete.
-// - project: Project ID for this request.
-func (r *InterconnectsService) Delete(project string, interconnect string) *InterconnectsDeleteCall {
- c := &InterconnectsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.interconnect = interconnect
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InterconnectsDeleteCall) RequestId(requestId string) *InterconnectsDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InterconnectsDeleteCall) Fields(s ...googleapi.Field) *InterconnectsDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InterconnectsDeleteCall) Context(ctx context.Context) *InterconnectsDeleteCall {
- 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 *InterconnectsDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InterconnectsDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnects/{interconnect}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "interconnect": c.interconnect,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.interconnects.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InterconnectsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified Interconnect.",
- // "flatPath": "projects/{project}/global/interconnects/{interconnect}",
- // "httpMethod": "DELETE",
- // "id": "compute.interconnects.delete",
- // "parameterOrder": [
- // "project",
- // "interconnect"
- // ],
- // "parameters": {
- // "interconnect": {
- // "description": "Name of the interconnect to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/interconnects/{interconnect}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.interconnects.get":
-
-type InterconnectsGetCall struct {
- s *Service
- project string
- interconnect string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified Interconnect. Get a list of available
-// Interconnects by making a list() request.
-//
-// - interconnect: Name of the interconnect to return.
-// - project: Project ID for this request.
-func (r *InterconnectsService) Get(project string, interconnect string) *InterconnectsGetCall {
- c := &InterconnectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.interconnect = interconnect
- 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 *InterconnectsGetCall) Fields(s ...googleapi.Field) *InterconnectsGetCall {
- 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 *InterconnectsGetCall) IfNoneMatch(entityTag string) *InterconnectsGetCall {
- 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 *InterconnectsGetCall) Context(ctx context.Context) *InterconnectsGetCall {
- 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 *InterconnectsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InterconnectsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/interconnects/{interconnect}")
- 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{
- "project": c.project,
- "interconnect": c.interconnect,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.interconnects.get" call.
-// Exactly one of *Interconnect or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Interconnect.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 *InterconnectsGetCall) Do(opts ...googleapi.CallOption) (*Interconnect, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Interconnect{
- 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": "Returns the specified Interconnect. Get a list of available Interconnects by making a list() request.",
- // "flatPath": "projects/{project}/global/interconnects/{interconnect}",
- // "httpMethod": "GET",
- // "id": "compute.interconnects.get",
- // "parameterOrder": [
- // "project",
- // "interconnect"
- // ],
- // "parameters": {
- // "interconnect": {
- // "description": "Name of the interconnect to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/interconnects/{interconnect}",
- // "response": {
- // "$ref": "Interconnect"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.interconnects.getDiagnostics":
-
-type InterconnectsGetDiagnosticsCall struct {
- s *Service
- project string
- interconnect string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetDiagnostics: Returns the interconnectDiagnostics for the specified
-// Interconnect. In the event of a global outage, do not use this API to
-// make decisions about where to redirect your network traffic. Unlike a
-// VLAN attachment, which is regional, a Cloud Interconnect connection
-// is a global resource. A global outage can prevent this API from
-// functioning properly.
-//
-// - interconnect: Name of the interconnect resource to query.
-// - project: Project ID for this request.
-func (r *InterconnectsService) GetDiagnostics(project string, interconnect string) *InterconnectsGetDiagnosticsCall {
- c := &InterconnectsGetDiagnosticsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.interconnect = interconnect
- 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 *InterconnectsGetDiagnosticsCall) Fields(s ...googleapi.Field) *InterconnectsGetDiagnosticsCall {
- 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 *InterconnectsGetDiagnosticsCall) IfNoneMatch(entityTag string) *InterconnectsGetDiagnosticsCall {
- 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 *InterconnectsGetDiagnosticsCall) Context(ctx context.Context) *InterconnectsGetDiagnosticsCall {
- 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 *InterconnectsGetDiagnosticsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InterconnectsGetDiagnosticsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/interconnects/{interconnect}/getDiagnostics")
- 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{
- "project": c.project,
- "interconnect": c.interconnect,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.interconnects.getDiagnostics" call.
-// Exactly one of *InterconnectsGetDiagnosticsResponse or error will be
-// non-nil. Any non-2xx status code is an error. Response headers are in
-// either *InterconnectsGetDiagnosticsResponse.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 *InterconnectsGetDiagnosticsCall) Do(opts ...googleapi.CallOption) (*InterconnectsGetDiagnosticsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &InterconnectsGetDiagnosticsResponse{
- 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": "Returns the interconnectDiagnostics for the specified Interconnect. In the event of a global outage, do not use this API to make decisions about where to redirect your network traffic. Unlike a VLAN attachment, which is regional, a Cloud Interconnect connection is a global resource. A global outage can prevent this API from functioning properly.",
- // "flatPath": "projects/{project}/global/interconnects/{interconnect}/getDiagnostics",
- // "httpMethod": "GET",
- // "id": "compute.interconnects.getDiagnostics",
- // "parameterOrder": [
- // "project",
- // "interconnect"
- // ],
- // "parameters": {
- // "interconnect": {
- // "description": "Name of the interconnect resource to query.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/interconnects/{interconnect}/getDiagnostics",
- // "response": {
- // "$ref": "InterconnectsGetDiagnosticsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.interconnects.getMacsecConfig":
-
-type InterconnectsGetMacsecConfigCall struct {
- s *Service
- project string
- interconnect string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetMacsecConfig: Returns the interconnectMacsecConfig for the
-// specified Interconnect.
-//
-// - interconnect: Name of the interconnect resource to query.
-// - project: Project ID for this request.
-func (r *InterconnectsService) GetMacsecConfig(project string, interconnect string) *InterconnectsGetMacsecConfigCall {
- c := &InterconnectsGetMacsecConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.interconnect = interconnect
- 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 *InterconnectsGetMacsecConfigCall) Fields(s ...googleapi.Field) *InterconnectsGetMacsecConfigCall {
- 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 *InterconnectsGetMacsecConfigCall) IfNoneMatch(entityTag string) *InterconnectsGetMacsecConfigCall {
- 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 *InterconnectsGetMacsecConfigCall) Context(ctx context.Context) *InterconnectsGetMacsecConfigCall {
- 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 *InterconnectsGetMacsecConfigCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InterconnectsGetMacsecConfigCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/interconnects/{interconnect}/getMacsecConfig")
- 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{
- "project": c.project,
- "interconnect": c.interconnect,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.interconnects.getMacsecConfig" call.
-// Exactly one of *InterconnectsGetMacsecConfigResponse or error will be
-// non-nil. Any non-2xx status code is an error. Response headers are in
-// either *InterconnectsGetMacsecConfigResponse.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 *InterconnectsGetMacsecConfigCall) Do(opts ...googleapi.CallOption) (*InterconnectsGetMacsecConfigResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &InterconnectsGetMacsecConfigResponse{
- 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": "Returns the interconnectMacsecConfig for the specified Interconnect.",
- // "flatPath": "projects/{project}/global/interconnects/{interconnect}/getMacsecConfig",
- // "httpMethod": "GET",
- // "id": "compute.interconnects.getMacsecConfig",
- // "parameterOrder": [
- // "project",
- // "interconnect"
- // ],
- // "parameters": {
- // "interconnect": {
- // "description": "Name of the interconnect resource to query.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/interconnects/{interconnect}/getMacsecConfig",
- // "response": {
- // "$ref": "InterconnectsGetMacsecConfigResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.interconnects.insert":
-
-type InterconnectsInsertCall struct {
- s *Service
- project string
- interconnect *Interconnect
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates an Interconnect in the specified project using the
-// data included in the request.
-//
-// - project: Project ID for this request.
-func (r *InterconnectsService) Insert(project string, interconnect *Interconnect) *InterconnectsInsertCall {
- c := &InterconnectsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.interconnect = interconnect
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InterconnectsInsertCall) RequestId(requestId string) *InterconnectsInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InterconnectsInsertCall) Fields(s ...googleapi.Field) *InterconnectsInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InterconnectsInsertCall) Context(ctx context.Context) *InterconnectsInsertCall {
- 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 *InterconnectsInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InterconnectsInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnect)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnects")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.interconnects.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InterconnectsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates an Interconnect in the specified project using the data included in the request.",
- // "flatPath": "projects/{project}/global/interconnects",
- // "httpMethod": "POST",
- // "id": "compute.interconnects.insert",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/interconnects",
- // "request": {
- // "$ref": "Interconnect"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.interconnects.list":
-
-type InterconnectsListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves the list of Interconnects available to the specified
-// project.
-//
-// - project: Project ID for this request.
-func (r *InterconnectsService) List(project string) *InterconnectsListCall {
- c := &InterconnectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *InterconnectsListCall) Filter(filter string) *InterconnectsListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *InterconnectsListCall) MaxResults(maxResults int64) *InterconnectsListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *InterconnectsListCall) OrderBy(orderBy string) *InterconnectsListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *InterconnectsListCall) PageToken(pageToken string) *InterconnectsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *InterconnectsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InterconnectsListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *InterconnectsListCall) Fields(s ...googleapi.Field) *InterconnectsListCall {
- 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 *InterconnectsListCall) IfNoneMatch(entityTag string) *InterconnectsListCall {
- 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 *InterconnectsListCall) Context(ctx context.Context) *InterconnectsListCall {
- 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 *InterconnectsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InterconnectsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/interconnects")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.interconnects.list" call.
-// Exactly one of *InterconnectList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *InterconnectList.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 *InterconnectsListCall) Do(opts ...googleapi.CallOption) (*InterconnectList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &InterconnectList{
- 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": "Retrieves the list of Interconnects available to the specified project.",
- // "flatPath": "projects/{project}/global/interconnects",
- // "httpMethod": "GET",
- // "id": "compute.interconnects.list",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/interconnects",
- // "response": {
- // "$ref": "InterconnectList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *InterconnectsListCall) Pages(ctx context.Context, f func(*InterconnectList) 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 "compute.interconnects.patch":
-
-type InterconnectsPatchCall struct {
- s *Service
- project string
- interconnect string
- interconnect2 *Interconnect
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Updates the specified Interconnect with the data included in
-// the request. This method supports PATCH semantics and uses the JSON
-// merge patch format and processing rules.
-//
-// - interconnect: Name of the interconnect to update.
-// - project: Project ID for this request.
-func (r *InterconnectsService) Patch(project string, interconnect string, interconnect2 *Interconnect) *InterconnectsPatchCall {
- c := &InterconnectsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.interconnect = interconnect
- c.interconnect2 = interconnect2
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *InterconnectsPatchCall) RequestId(requestId string) *InterconnectsPatchCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *InterconnectsPatchCall) Fields(s ...googleapi.Field) *InterconnectsPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InterconnectsPatchCall) Context(ctx context.Context) *InterconnectsPatchCall {
- 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 *InterconnectsPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InterconnectsPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnect2)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnects/{interconnect}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "interconnect": c.interconnect,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.interconnects.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InterconnectsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Updates the specified Interconnect with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
- // "flatPath": "projects/{project}/global/interconnects/{interconnect}",
- // "httpMethod": "PATCH",
- // "id": "compute.interconnects.patch",
- // "parameterOrder": [
- // "project",
- // "interconnect"
- // ],
- // "parameters": {
- // "interconnect": {
- // "description": "Name of the interconnect to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/interconnects/{interconnect}",
- // "request": {
- // "$ref": "Interconnect"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.interconnects.setLabels":
-
-type InterconnectsSetLabelsCall struct {
- s *Service
- project string
- resource string
- globalsetlabelsrequest *GlobalSetLabelsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetLabels: Sets the labels on an Interconnect. To learn more about
-// labels, read the Labeling Resources documentation.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-func (r *InterconnectsService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *InterconnectsSetLabelsCall {
- c := &InterconnectsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.resource = resource
- c.globalsetlabelsrequest = globalsetlabelsrequest
- 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 *InterconnectsSetLabelsCall) Fields(s ...googleapi.Field) *InterconnectsSetLabelsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *InterconnectsSetLabelsCall) Context(ctx context.Context) *InterconnectsSetLabelsCall {
- 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 *InterconnectsSetLabelsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *InterconnectsSetLabelsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnects/{resource}/setLabels")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.interconnects.setLabels" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *InterconnectsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Sets the labels on an Interconnect. To learn more about labels, read the Labeling Resources documentation.",
- // "flatPath": "projects/{project}/global/interconnects/{resource}/setLabels",
- // "httpMethod": "POST",
- // "id": "compute.interconnects.setLabels",
- // "parameterOrder": [
- // "project",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/interconnects/{resource}/setLabels",
- // "request": {
- // "$ref": "GlobalSetLabelsRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.licenseCodes.get":
-
-type LicenseCodesGetCall struct {
- s *Service
- project string
- licenseCode string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Return a specified license code. License codes are mirrored
-// across all projects that have permissions to read the License Code.
-// *Caution* This resource is intended for use only by third-party
-// partners who are creating Cloud Marketplace images.
-//
-// - licenseCode: Number corresponding to the License code resource to
-// return.
-// - project: Project ID for this request.
-func (r *LicenseCodesService) Get(project string, licenseCode string) *LicenseCodesGetCall {
- c := &LicenseCodesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.licenseCode = licenseCode
- 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 *LicenseCodesGetCall) Fields(s ...googleapi.Field) *LicenseCodesGetCall {
- 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 *LicenseCodesGetCall) IfNoneMatch(entityTag string) *LicenseCodesGetCall {
- 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 *LicenseCodesGetCall) Context(ctx context.Context) *LicenseCodesGetCall {
- 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 *LicenseCodesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *LicenseCodesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/licenseCodes/{licenseCode}")
- 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{
- "project": c.project,
- "licenseCode": c.licenseCode,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.licenseCodes.get" call.
-// Exactly one of *LicenseCode or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *LicenseCode.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 *LicenseCodesGetCall) Do(opts ...googleapi.CallOption) (*LicenseCode, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &LicenseCode{
- 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": "Return a specified license code. License codes are mirrored across all projects that have permissions to read the License Code. *Caution* This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. ",
- // "flatPath": "projects/{project}/global/licenseCodes/{licenseCode}",
- // "httpMethod": "GET",
- // "id": "compute.licenseCodes.get",
- // "parameterOrder": [
- // "project",
- // "licenseCode"
- // ],
- // "parameters": {
- // "licenseCode": {
- // "description": "Number corresponding to the License code resource to return.",
- // "location": "path",
- // "pattern": "[0-9]{0,61}?",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/licenseCodes/{licenseCode}",
- // "response": {
- // "$ref": "LicenseCode"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.licenseCodes.testIamPermissions":
-
-type LicenseCodesTestIamPermissionsCall struct {
- s *Service
- project string
- resource string
- testpermissionsrequest *TestPermissionsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// TestIamPermissions: Returns permissions that a caller has on the
-// specified resource. *Caution* This resource is intended for use only
-// by third-party partners who are creating Cloud Marketplace images.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-func (r *LicenseCodesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *LicenseCodesTestIamPermissionsCall {
- c := &LicenseCodesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.resource = resource
- c.testpermissionsrequest = testpermissionsrequest
- 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 *LicenseCodesTestIamPermissionsCall) Fields(s ...googleapi.Field) *LicenseCodesTestIamPermissionsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *LicenseCodesTestIamPermissionsCall) Context(ctx context.Context) *LicenseCodesTestIamPermissionsCall {
- 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 *LicenseCodesTestIamPermissionsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *LicenseCodesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/licenseCodes/{resource}/testIamPermissions")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.licenseCodes.testIamPermissions" call.
-// Exactly one of *TestPermissionsResponse or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *TestPermissionsResponse.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 *LicenseCodesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TestPermissionsResponse{
- 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": "Returns permissions that a caller has on the specified resource. *Caution* This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. ",
- // "flatPath": "projects/{project}/global/licenseCodes/{resource}/testIamPermissions",
- // "httpMethod": "POST",
- // "id": "compute.licenseCodes.testIamPermissions",
- // "parameterOrder": [
- // "project",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/licenseCodes/{resource}/testIamPermissions",
- // "request": {
- // "$ref": "TestPermissionsRequest"
- // },
- // "response": {
- // "$ref": "TestPermissionsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.licenses.delete":
-
-type LicensesDeleteCall struct {
- s *Service
- project string
- license string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified license. *Caution* This resource is
-// intended for use only by third-party partners who are creating Cloud
-// Marketplace images.
-//
-// - license: Name of the license resource to delete.
-// - project: Project ID for this request.
-func (r *LicensesService) Delete(project string, license string) *LicensesDeleteCall {
- c := &LicensesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.license = license
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *LicensesDeleteCall) RequestId(requestId string) *LicensesDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *LicensesDeleteCall) Fields(s ...googleapi.Field) *LicensesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *LicensesDeleteCall) Context(ctx context.Context) *LicensesDeleteCall {
- 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 *LicensesDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *LicensesDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/licenses/{license}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "license": c.license,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.licenses.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *LicensesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified license. *Caution* This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. ",
- // "flatPath": "projects/{project}/global/licenses/{license}",
- // "httpMethod": "DELETE",
- // "id": "compute.licenses.delete",
- // "parameterOrder": [
- // "project",
- // "license"
- // ],
- // "parameters": {
- // "license": {
- // "description": "Name of the license resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/licenses/{license}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.licenses.get":
-
-type LicensesGetCall struct {
- s *Service
- project string
- license string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified License resource. *Caution* This resource
-// is intended for use only by third-party partners who are creating
-// Cloud Marketplace images.
-//
-// - license: Name of the License resource to return.
-// - project: Project ID for this request.
-func (r *LicensesService) Get(project string, license string) *LicensesGetCall {
- c := &LicensesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.license = license
- 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 *LicensesGetCall) Fields(s ...googleapi.Field) *LicensesGetCall {
- 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 *LicensesGetCall) IfNoneMatch(entityTag string) *LicensesGetCall {
- 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 *LicensesGetCall) Context(ctx context.Context) *LicensesGetCall {
- 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 *LicensesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *LicensesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/licenses/{license}")
- 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{
- "project": c.project,
- "license": c.license,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.licenses.get" call.
-// Exactly one of *License or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *License.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 *LicensesGetCall) Do(opts ...googleapi.CallOption) (*License, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &License{
- 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": "Returns the specified License resource. *Caution* This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. ",
- // "flatPath": "projects/{project}/global/licenses/{license}",
- // "httpMethod": "GET",
- // "id": "compute.licenses.get",
- // "parameterOrder": [
- // "project",
- // "license"
- // ],
- // "parameters": {
- // "license": {
- // "description": "Name of the License resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/licenses/{license}",
- // "response": {
- // "$ref": "License"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.licenses.getIamPolicy":
-
-type LicensesGetIamPolicyCall struct {
- s *Service
- project string
- resource string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetIamPolicy: Gets the access control policy for a resource. May be
-// empty if no such policy or resource exists. *Caution* This resource
-// is intended for use only by third-party partners who are creating
-// Cloud Marketplace images.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-func (r *LicensesService) GetIamPolicy(project string, resource string) *LicensesGetIamPolicyCall {
- c := &LicensesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.resource = resource
- return c
-}
-
-// OptionsRequestedPolicyVersion sets the optional parameter
-// "optionsRequestedPolicyVersion": Requested IAM Policy version.
-func (c *LicensesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *LicensesGetIamPolicyCall {
- c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
- 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 *LicensesGetIamPolicyCall) Fields(s ...googleapi.Field) *LicensesGetIamPolicyCall {
- 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 *LicensesGetIamPolicyCall) IfNoneMatch(entityTag string) *LicensesGetIamPolicyCall {
- 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 *LicensesGetIamPolicyCall) Context(ctx context.Context) *LicensesGetIamPolicyCall {
- 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 *LicensesGetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *LicensesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/licenses/{resource}/getIamPolicy")
- 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{
- "project": c.project,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.licenses.getIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *LicensesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Gets the access control policy for a resource. May be empty if no such policy or resource exists. *Caution* This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. ",
- // "flatPath": "projects/{project}/global/licenses/{resource}/getIamPolicy",
- // "httpMethod": "GET",
- // "id": "compute.licenses.getIamPolicy",
- // "parameterOrder": [
- // "project",
- // "resource"
- // ],
- // "parameters": {
- // "optionsRequestedPolicyVersion": {
- // "description": "Requested IAM Policy version.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/licenses/{resource}/getIamPolicy",
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.licenses.insert":
-
-type LicensesInsertCall struct {
- s *Service
- project string
- license *License
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Create a License resource in the specified project. *Caution*
-// This resource is intended for use only by third-party partners who
-// are creating Cloud Marketplace images.
-//
-// - project: Project ID for this request.
-func (r *LicensesService) Insert(project string, license *License) *LicensesInsertCall {
- c := &LicensesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.license = license
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *LicensesInsertCall) RequestId(requestId string) *LicensesInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *LicensesInsertCall) Fields(s ...googleapi.Field) *LicensesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *LicensesInsertCall) Context(ctx context.Context) *LicensesInsertCall {
- 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 *LicensesInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *LicensesInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.license)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/licenses")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.licenses.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *LicensesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Create a License resource in the specified project. *Caution* This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. ",
- // "flatPath": "projects/{project}/global/licenses",
- // "httpMethod": "POST",
- // "id": "compute.licenses.insert",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/licenses",
- // "request": {
- // "$ref": "License"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/devstorage.full_control",
- // "https://www.googleapis.com/auth/devstorage.read_only",
- // "https://www.googleapis.com/auth/devstorage.read_write"
- // ]
- // }
-
-}
-
-// method id "compute.licenses.list":
-
-type LicensesListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves the list of licenses available in the specified
-// project. This method does not get any licenses that belong to other
-// projects, including licenses attached to publicly-available images,
-// like Debian 9. If you want to get a list of publicly-available
-// licenses, use this method to make a request to the respective image
-// project, such as debian-cloud or windows-cloud. *Caution* This
-// resource is intended for use only by third-party partners who are
-// creating Cloud Marketplace images.
-//
-// - project: Project ID for this request.
-func (r *LicensesService) List(project string) *LicensesListCall {
- c := &LicensesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *LicensesListCall) Filter(filter string) *LicensesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *LicensesListCall) MaxResults(maxResults int64) *LicensesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *LicensesListCall) OrderBy(orderBy string) *LicensesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *LicensesListCall) PageToken(pageToken string) *LicensesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *LicensesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *LicensesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *LicensesListCall) Fields(s ...googleapi.Field) *LicensesListCall {
- 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 *LicensesListCall) IfNoneMatch(entityTag string) *LicensesListCall {
- 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 *LicensesListCall) Context(ctx context.Context) *LicensesListCall {
- 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 *LicensesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *LicensesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/licenses")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.licenses.list" call.
-// Exactly one of *LicensesListResponse or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *LicensesListResponse.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 *LicensesListCall) Do(opts ...googleapi.CallOption) (*LicensesListResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &LicensesListResponse{
- 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": "Retrieves the list of licenses available in the specified project. This method does not get any licenses that belong to other projects, including licenses attached to publicly-available images, like Debian 9. If you want to get a list of publicly-available licenses, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud. *Caution* This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. ",
- // "flatPath": "projects/{project}/global/licenses",
- // "httpMethod": "GET",
- // "id": "compute.licenses.list",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/licenses",
- // "response": {
- // "$ref": "LicensesListResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *LicensesListCall) Pages(ctx context.Context, f func(*LicensesListResponse) 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 "compute.licenses.setIamPolicy":
-
-type LicensesSetIamPolicyCall struct {
- s *Service
- project string
- resource string
- globalsetpolicyrequest *GlobalSetPolicyRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetIamPolicy: Sets the access control policy on the specified
-// resource. Replaces any existing policy. *Caution* This resource is
-// intended for use only by third-party partners who are creating Cloud
-// Marketplace images.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-func (r *LicensesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *LicensesSetIamPolicyCall {
- c := &LicensesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.resource = resource
- c.globalsetpolicyrequest = globalsetpolicyrequest
- 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 *LicensesSetIamPolicyCall) Fields(s ...googleapi.Field) *LicensesSetIamPolicyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *LicensesSetIamPolicyCall) Context(ctx context.Context) *LicensesSetIamPolicyCall {
- 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 *LicensesSetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *LicensesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/licenses/{resource}/setIamPolicy")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.licenses.setIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *LicensesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Sets the access control policy on the specified resource. Replaces any existing policy. *Caution* This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. ",
- // "flatPath": "projects/{project}/global/licenses/{resource}/setIamPolicy",
- // "httpMethod": "POST",
- // "id": "compute.licenses.setIamPolicy",
- // "parameterOrder": [
- // "project",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/licenses/{resource}/setIamPolicy",
- // "request": {
- // "$ref": "GlobalSetPolicyRequest"
- // },
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.licenses.testIamPermissions":
-
-type LicensesTestIamPermissionsCall struct {
- s *Service
- project string
- resource string
- testpermissionsrequest *TestPermissionsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// TestIamPermissions: Returns permissions that a caller has on the
-// specified resource. *Caution* This resource is intended for use only
-// by third-party partners who are creating Cloud Marketplace images.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-func (r *LicensesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *LicensesTestIamPermissionsCall {
- c := &LicensesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.resource = resource
- c.testpermissionsrequest = testpermissionsrequest
- 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 *LicensesTestIamPermissionsCall) Fields(s ...googleapi.Field) *LicensesTestIamPermissionsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *LicensesTestIamPermissionsCall) Context(ctx context.Context) *LicensesTestIamPermissionsCall {
- 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 *LicensesTestIamPermissionsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *LicensesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/licenses/{resource}/testIamPermissions")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.licenses.testIamPermissions" call.
-// Exactly one of *TestPermissionsResponse or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *TestPermissionsResponse.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 *LicensesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TestPermissionsResponse{
- 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": "Returns permissions that a caller has on the specified resource. *Caution* This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. ",
- // "flatPath": "projects/{project}/global/licenses/{resource}/testIamPermissions",
- // "httpMethod": "POST",
- // "id": "compute.licenses.testIamPermissions",
- // "parameterOrder": [
- // "project",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/licenses/{resource}/testIamPermissions",
- // "request": {
- // "$ref": "TestPermissionsRequest"
- // },
- // "response": {
- // "$ref": "TestPermissionsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.machineImages.delete":
-
-type MachineImagesDeleteCall struct {
- s *Service
- project string
- machineImage string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified machine image. Deleting a machine image
-// is permanent and cannot be undone.
-//
-// - machineImage: The name of the machine image to delete.
-// - project: Project ID for this request.
-func (r *MachineImagesService) Delete(project string, machineImage string) *MachineImagesDeleteCall {
- c := &MachineImagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.machineImage = machineImage
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *MachineImagesDeleteCall) RequestId(requestId string) *MachineImagesDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *MachineImagesDeleteCall) Fields(s ...googleapi.Field) *MachineImagesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *MachineImagesDeleteCall) Context(ctx context.Context) *MachineImagesDeleteCall {
- 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 *MachineImagesDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *MachineImagesDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/machineImages/{machineImage}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "machineImage": c.machineImage,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.machineImages.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *MachineImagesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified machine image. Deleting a machine image is permanent and cannot be undone.",
- // "flatPath": "projects/{project}/global/machineImages/{machineImage}",
- // "httpMethod": "DELETE",
- // "id": "compute.machineImages.delete",
- // "parameterOrder": [
- // "project",
- // "machineImage"
- // ],
- // "parameters": {
- // "machineImage": {
- // "description": "The name of the machine image to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/machineImages/{machineImage}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.machineImages.get":
-
-type MachineImagesGetCall struct {
- s *Service
- project string
- machineImage string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified machine image.
-//
-// - machineImage: The name of the machine image.
-// - project: Project ID for this request.
-func (r *MachineImagesService) Get(project string, machineImage string) *MachineImagesGetCall {
- c := &MachineImagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.machineImage = machineImage
- 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 *MachineImagesGetCall) Fields(s ...googleapi.Field) *MachineImagesGetCall {
- 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 *MachineImagesGetCall) IfNoneMatch(entityTag string) *MachineImagesGetCall {
- 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 *MachineImagesGetCall) Context(ctx context.Context) *MachineImagesGetCall {
- 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 *MachineImagesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *MachineImagesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/machineImages/{machineImage}")
- 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{
- "project": c.project,
- "machineImage": c.machineImage,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.machineImages.get" call.
-// Exactly one of *MachineImage or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *MachineImage.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 *MachineImagesGetCall) Do(opts ...googleapi.CallOption) (*MachineImage, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &MachineImage{
- 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": "Returns the specified machine image.",
- // "flatPath": "projects/{project}/global/machineImages/{machineImage}",
- // "httpMethod": "GET",
- // "id": "compute.machineImages.get",
- // "parameterOrder": [
- // "project",
- // "machineImage"
- // ],
- // "parameters": {
- // "machineImage": {
- // "description": "The name of the machine image.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/machineImages/{machineImage}",
- // "response": {
- // "$ref": "MachineImage"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.machineImages.getIamPolicy":
-
-type MachineImagesGetIamPolicyCall struct {
- s *Service
- project string
- resource string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetIamPolicy: Gets the access control policy for a resource. May be
-// empty if no such policy or resource exists.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-func (r *MachineImagesService) GetIamPolicy(project string, resource string) *MachineImagesGetIamPolicyCall {
- c := &MachineImagesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.resource = resource
- return c
-}
-
-// OptionsRequestedPolicyVersion sets the optional parameter
-// "optionsRequestedPolicyVersion": Requested IAM Policy version.
-func (c *MachineImagesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *MachineImagesGetIamPolicyCall {
- c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
- 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 *MachineImagesGetIamPolicyCall) Fields(s ...googleapi.Field) *MachineImagesGetIamPolicyCall {
- 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 *MachineImagesGetIamPolicyCall) IfNoneMatch(entityTag string) *MachineImagesGetIamPolicyCall {
- 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 *MachineImagesGetIamPolicyCall) Context(ctx context.Context) *MachineImagesGetIamPolicyCall {
- 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 *MachineImagesGetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *MachineImagesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/machineImages/{resource}/getIamPolicy")
- 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{
- "project": c.project,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.machineImages.getIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *MachineImagesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
- // "flatPath": "projects/{project}/global/machineImages/{resource}/getIamPolicy",
- // "httpMethod": "GET",
- // "id": "compute.machineImages.getIamPolicy",
- // "parameterOrder": [
- // "project",
- // "resource"
- // ],
- // "parameters": {
- // "optionsRequestedPolicyVersion": {
- // "description": "Requested IAM Policy version.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/machineImages/{resource}/getIamPolicy",
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.machineImages.insert":
-
-type MachineImagesInsertCall struct {
- s *Service
- project string
- machineimage *MachineImage
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a machine image in the specified project using the
-// data that is included in the request. If you are creating a new
-// machine image to update an existing instance, your new machine image
-// should use the same network or, if applicable, the same subnetwork as
-// the original instance.
-//
-// - project: Project ID for this request.
-func (r *MachineImagesService) Insert(project string, machineimage *MachineImage) *MachineImagesInsertCall {
- c := &MachineImagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.machineimage = machineimage
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *MachineImagesInsertCall) RequestId(requestId string) *MachineImagesInsertCall {
- c.urlParams_.Set("requestId", requestId)
- return c
-}
-
-// SourceInstance sets the optional parameter "sourceInstance":
-// Required. Source instance that is used to create the machine image
-// from.
-func (c *MachineImagesInsertCall) SourceInstance(sourceInstance string) *MachineImagesInsertCall {
- c.urlParams_.Set("sourceInstance", sourceInstance)
- 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 *MachineImagesInsertCall) Fields(s ...googleapi.Field) *MachineImagesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *MachineImagesInsertCall) Context(ctx context.Context) *MachineImagesInsertCall {
- 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 *MachineImagesInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *MachineImagesInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.machineimage)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/machineImages")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.machineImages.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *MachineImagesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a machine image in the specified project using the data that is included in the request. If you are creating a new machine image to update an existing instance, your new machine image should use the same network or, if applicable, the same subnetwork as the original instance.",
- // "flatPath": "projects/{project}/global/machineImages",
- // "httpMethod": "POST",
- // "id": "compute.machineImages.insert",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "sourceInstance": {
- // "description": "Required. Source instance that is used to create the machine image from.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/machineImages",
- // "request": {
- // "$ref": "MachineImage"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.machineImages.list":
-
-type MachineImagesListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves a list of machine images that are contained within
-// the specified project.
-//
-// - project: Project ID for this request.
-func (r *MachineImagesService) List(project string) *MachineImagesListCall {
- c := &MachineImagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *MachineImagesListCall) Filter(filter string) *MachineImagesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *MachineImagesListCall) MaxResults(maxResults int64) *MachineImagesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *MachineImagesListCall) OrderBy(orderBy string) *MachineImagesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *MachineImagesListCall) PageToken(pageToken string) *MachineImagesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *MachineImagesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *MachineImagesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *MachineImagesListCall) Fields(s ...googleapi.Field) *MachineImagesListCall {
- 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 *MachineImagesListCall) IfNoneMatch(entityTag string) *MachineImagesListCall {
- 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 *MachineImagesListCall) Context(ctx context.Context) *MachineImagesListCall {
- 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 *MachineImagesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *MachineImagesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/machineImages")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.machineImages.list" call.
-// Exactly one of *MachineImageList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *MachineImageList.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 *MachineImagesListCall) Do(opts ...googleapi.CallOption) (*MachineImageList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &MachineImageList{
- 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": "Retrieves a list of machine images that are contained within the specified project.",
- // "flatPath": "projects/{project}/global/machineImages",
- // "httpMethod": "GET",
- // "id": "compute.machineImages.list",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/machineImages",
- // "response": {
- // "$ref": "MachineImageList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *MachineImagesListCall) Pages(ctx context.Context, f func(*MachineImageList) 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 "compute.machineImages.setIamPolicy":
-
-type MachineImagesSetIamPolicyCall struct {
- s *Service
- project string
- resource string
- globalsetpolicyrequest *GlobalSetPolicyRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetIamPolicy: Sets the access control policy on the specified
-// resource. Replaces any existing policy.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-func (r *MachineImagesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *MachineImagesSetIamPolicyCall {
- c := &MachineImagesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.resource = resource
- c.globalsetpolicyrequest = globalsetpolicyrequest
- 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 *MachineImagesSetIamPolicyCall) Fields(s ...googleapi.Field) *MachineImagesSetIamPolicyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *MachineImagesSetIamPolicyCall) Context(ctx context.Context) *MachineImagesSetIamPolicyCall {
- 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 *MachineImagesSetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *MachineImagesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/machineImages/{resource}/setIamPolicy")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.machineImages.setIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *MachineImagesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Sets the access control policy on the specified resource. Replaces any existing policy.",
- // "flatPath": "projects/{project}/global/machineImages/{resource}/setIamPolicy",
- // "httpMethod": "POST",
- // "id": "compute.machineImages.setIamPolicy",
- // "parameterOrder": [
- // "project",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/machineImages/{resource}/setIamPolicy",
- // "request": {
- // "$ref": "GlobalSetPolicyRequest"
- // },
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.machineImages.testIamPermissions":
-
-type MachineImagesTestIamPermissionsCall struct {
- s *Service
- project string
- resource string
- testpermissionsrequest *TestPermissionsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// TestIamPermissions: Returns permissions that a caller has on the
-// specified resource.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-func (r *MachineImagesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *MachineImagesTestIamPermissionsCall {
- c := &MachineImagesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.resource = resource
- c.testpermissionsrequest = testpermissionsrequest
- 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 *MachineImagesTestIamPermissionsCall) Fields(s ...googleapi.Field) *MachineImagesTestIamPermissionsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *MachineImagesTestIamPermissionsCall) Context(ctx context.Context) *MachineImagesTestIamPermissionsCall {
- 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 *MachineImagesTestIamPermissionsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *MachineImagesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/machineImages/{resource}/testIamPermissions")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.machineImages.testIamPermissions" call.
-// Exactly one of *TestPermissionsResponse or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *TestPermissionsResponse.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 *MachineImagesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TestPermissionsResponse{
- 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": "Returns permissions that a caller has on the specified resource.",
- // "flatPath": "projects/{project}/global/machineImages/{resource}/testIamPermissions",
- // "httpMethod": "POST",
- // "id": "compute.machineImages.testIamPermissions",
- // "parameterOrder": [
- // "project",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/machineImages/{resource}/testIamPermissions",
- // "request": {
- // "$ref": "TestPermissionsRequest"
- // },
- // "response": {
- // "$ref": "TestPermissionsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.machineTypes.aggregatedList":
-
-type MachineTypesAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Retrieves an aggregated list of machine types.
-//
-// - project: Project ID for this request.
-func (r *MachineTypesService) AggregatedList(project string) *MachineTypesAggregatedListCall {
- c := &MachineTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *MachineTypesAggregatedListCall) Filter(filter string) *MachineTypesAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *MachineTypesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *MachineTypesAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *MachineTypesAggregatedListCall) MaxResults(maxResults int64) *MachineTypesAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *MachineTypesAggregatedListCall) OrderBy(orderBy string) *MachineTypesAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *MachineTypesAggregatedListCall) PageToken(pageToken string) *MachineTypesAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *MachineTypesAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *MachineTypesAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *MachineTypesAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *MachineTypesAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *MachineTypesAggregatedListCall) Fields(s ...googleapi.Field) *MachineTypesAggregatedListCall {
- 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 *MachineTypesAggregatedListCall) IfNoneMatch(entityTag string) *MachineTypesAggregatedListCall {
- 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 *MachineTypesAggregatedListCall) Context(ctx context.Context) *MachineTypesAggregatedListCall {
- 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 *MachineTypesAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *MachineTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/machineTypes")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.machineTypes.aggregatedList" call.
-// Exactly one of *MachineTypeAggregatedList or error will be non-nil.
-// Any non-2xx status code is an error. Response headers are in either
-// *MachineTypeAggregatedList.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 *MachineTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*MachineTypeAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &MachineTypeAggregatedList{
- 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": "Retrieves an aggregated list of machine types.",
- // "flatPath": "projects/{project}/aggregated/machineTypes",
- // "httpMethod": "GET",
- // "id": "compute.machineTypes.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/machineTypes",
- // "response": {
- // "$ref": "MachineTypeAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *MachineTypesAggregatedListCall) Pages(ctx context.Context, f func(*MachineTypeAggregatedList) 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 "compute.machineTypes.get":
-
-type MachineTypesGetCall struct {
- s *Service
- project string
- zone string
- machineType string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified machine type.
-//
-// - machineType: Name of the machine type to return.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *MachineTypesService) Get(project string, zone string, machineType string) *MachineTypesGetCall {
- c := &MachineTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.machineType = machineType
- 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 *MachineTypesGetCall) Fields(s ...googleapi.Field) *MachineTypesGetCall {
- 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 *MachineTypesGetCall) IfNoneMatch(entityTag string) *MachineTypesGetCall {
- 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 *MachineTypesGetCall) Context(ctx context.Context) *MachineTypesGetCall {
- 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 *MachineTypesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *MachineTypesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}/machineTypes/{machineType}")
- 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{
- "project": c.project,
- "zone": c.zone,
- "machineType": c.machineType,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.machineTypes.get" call.
-// Exactly one of *MachineType or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *MachineType.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 *MachineTypesGetCall) Do(opts ...googleapi.CallOption) (*MachineType, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &MachineType{
- 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": "Returns the specified machine type.",
- // "flatPath": "projects/{project}/zones/{zone}/machineTypes/{machineType}",
- // "httpMethod": "GET",
- // "id": "compute.machineTypes.get",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "machineType"
- // ],
- // "parameters": {
- // "machineType": {
- // "description": "Name of the machine type to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/machineTypes/{machineType}",
- // "response": {
- // "$ref": "MachineType"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.machineTypes.list":
-
-type MachineTypesListCall struct {
- s *Service
- project string
- zone string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves a list of machine types available to the specified
-// project.
-//
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *MachineTypesService) List(project string, zone string) *MachineTypesListCall {
- c := &MachineTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *MachineTypesListCall) Filter(filter string) *MachineTypesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *MachineTypesListCall) MaxResults(maxResults int64) *MachineTypesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *MachineTypesListCall) OrderBy(orderBy string) *MachineTypesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *MachineTypesListCall) PageToken(pageToken string) *MachineTypesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *MachineTypesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *MachineTypesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *MachineTypesListCall) Fields(s ...googleapi.Field) *MachineTypesListCall {
- 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 *MachineTypesListCall) IfNoneMatch(entityTag string) *MachineTypesListCall {
- 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 *MachineTypesListCall) Context(ctx context.Context) *MachineTypesListCall {
- 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 *MachineTypesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *MachineTypesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}/machineTypes")
- 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{
- "project": c.project,
- "zone": c.zone,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.machineTypes.list" call.
-// Exactly one of *MachineTypeList or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *MachineTypeList.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 *MachineTypesListCall) Do(opts ...googleapi.CallOption) (*MachineTypeList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &MachineTypeList{
- 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": "Retrieves a list of machine types available to the specified project.",
- // "flatPath": "projects/{project}/zones/{zone}/machineTypes",
- // "httpMethod": "GET",
- // "id": "compute.machineTypes.list",
- // "parameterOrder": [
- // "project",
- // "zone"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/machineTypes",
- // "response": {
- // "$ref": "MachineTypeList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *MachineTypesListCall) Pages(ctx context.Context, f func(*MachineTypeList) 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 "compute.networkAttachments.aggregatedList":
-
-type NetworkAttachmentsAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Retrieves the list of all NetworkAttachment
-// resources, regional and global, available to the specified project.
-//
-// - project: Project ID for this request.
-func (r *NetworkAttachmentsService) AggregatedList(project string) *NetworkAttachmentsAggregatedListCall {
- c := &NetworkAttachmentsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *NetworkAttachmentsAggregatedListCall) Filter(filter string) *NetworkAttachmentsAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *NetworkAttachmentsAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *NetworkAttachmentsAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *NetworkAttachmentsAggregatedListCall) MaxResults(maxResults int64) *NetworkAttachmentsAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *NetworkAttachmentsAggregatedListCall) OrderBy(orderBy string) *NetworkAttachmentsAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *NetworkAttachmentsAggregatedListCall) PageToken(pageToken string) *NetworkAttachmentsAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *NetworkAttachmentsAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *NetworkAttachmentsAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *NetworkAttachmentsAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *NetworkAttachmentsAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *NetworkAttachmentsAggregatedListCall) Fields(s ...googleapi.Field) *NetworkAttachmentsAggregatedListCall {
- 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 *NetworkAttachmentsAggregatedListCall) IfNoneMatch(entityTag string) *NetworkAttachmentsAggregatedListCall {
- 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 *NetworkAttachmentsAggregatedListCall) Context(ctx context.Context) *NetworkAttachmentsAggregatedListCall {
- 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 *NetworkAttachmentsAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworkAttachmentsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/networkAttachments")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networkAttachments.aggregatedList" call.
-// Exactly one of *NetworkAttachmentAggregatedList or error will be
-// non-nil. Any non-2xx status code is an error. Response headers are in
-// either *NetworkAttachmentAggregatedList.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 *NetworkAttachmentsAggregatedListCall) Do(opts ...googleapi.CallOption) (*NetworkAttachmentAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &NetworkAttachmentAggregatedList{
- 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": "Retrieves the list of all NetworkAttachment resources, regional and global, available to the specified project.",
- // "flatPath": "projects/{project}/aggregated/networkAttachments",
- // "httpMethod": "GET",
- // "id": "compute.networkAttachments.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/networkAttachments",
- // "response": {
- // "$ref": "NetworkAttachmentAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *NetworkAttachmentsAggregatedListCall) Pages(ctx context.Context, f func(*NetworkAttachmentAggregatedList) 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 "compute.networkAttachments.delete":
-
-type NetworkAttachmentsDeleteCall struct {
- s *Service
- project string
- region string
- networkAttachment string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified NetworkAttachment in the given scope
-//
-// - networkAttachment: Name of the NetworkAttachment resource to
-// delete.
-// - project: Project ID for this request.
-// - region: Name of the region of this request.
-func (r *NetworkAttachmentsService) Delete(project string, region string, networkAttachment string) *NetworkAttachmentsDeleteCall {
- c := &NetworkAttachmentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.networkAttachment = networkAttachment
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000). end_interface:
-// MixerMutationRequestBuilder
-func (c *NetworkAttachmentsDeleteCall) RequestId(requestId string) *NetworkAttachmentsDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *NetworkAttachmentsDeleteCall) Fields(s ...googleapi.Field) *NetworkAttachmentsDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NetworkAttachmentsDeleteCall) Context(ctx context.Context) *NetworkAttachmentsDeleteCall {
- 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 *NetworkAttachmentsDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworkAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkAttachments/{networkAttachment}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "networkAttachment": c.networkAttachment,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networkAttachments.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *NetworkAttachmentsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified NetworkAttachment in the given scope",
- // "flatPath": "projects/{project}/regions/{region}/networkAttachments/{networkAttachment}",
- // "httpMethod": "DELETE",
- // "id": "compute.networkAttachments.delete",
- // "parameterOrder": [
- // "project",
- // "region",
- // "networkAttachment"
- // ],
- // "parameters": {
- // "networkAttachment": {
- // "description": "Name of the NetworkAttachment resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region of this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000). end_interface: MixerMutationRequestBuilder",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/networkAttachments/{networkAttachment}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.networkAttachments.get":
-
-type NetworkAttachmentsGetCall struct {
- s *Service
- project string
- region string
- networkAttachment string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified NetworkAttachment resource in the given
-// scope.
-//
-// - networkAttachment: Name of the NetworkAttachment resource to
-// return.
-// - project: Project ID for this request.
-// - region: Name of the region of this request.
-func (r *NetworkAttachmentsService) Get(project string, region string, networkAttachment string) *NetworkAttachmentsGetCall {
- c := &NetworkAttachmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.networkAttachment = networkAttachment
- 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 *NetworkAttachmentsGetCall) Fields(s ...googleapi.Field) *NetworkAttachmentsGetCall {
- 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 *NetworkAttachmentsGetCall) IfNoneMatch(entityTag string) *NetworkAttachmentsGetCall {
- 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 *NetworkAttachmentsGetCall) Context(ctx context.Context) *NetworkAttachmentsGetCall {
- 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 *NetworkAttachmentsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworkAttachmentsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/networkAttachments/{networkAttachment}")
- 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{
- "project": c.project,
- "region": c.region,
- "networkAttachment": c.networkAttachment,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networkAttachments.get" call.
-// Exactly one of *NetworkAttachment or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *NetworkAttachment.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 *NetworkAttachmentsGetCall) Do(opts ...googleapi.CallOption) (*NetworkAttachment, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &NetworkAttachment{
- 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": "Returns the specified NetworkAttachment resource in the given scope.",
- // "flatPath": "projects/{project}/regions/{region}/networkAttachments/{networkAttachment}",
- // "httpMethod": "GET",
- // "id": "compute.networkAttachments.get",
- // "parameterOrder": [
- // "project",
- // "region",
- // "networkAttachment"
- // ],
- // "parameters": {
- // "networkAttachment": {
- // "description": "Name of the NetworkAttachment resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region of this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/networkAttachments/{networkAttachment}",
- // "response": {
- // "$ref": "NetworkAttachment"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.networkAttachments.getIamPolicy":
-
-type NetworkAttachmentsGetIamPolicyCall struct {
- s *Service
- project string
- region string
- resource string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetIamPolicy: Gets the access control policy for a resource. May be
-// empty if no such policy or resource exists.
-//
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-// - resource: Name or id of the resource for this request.
-func (r *NetworkAttachmentsService) GetIamPolicy(project string, region string, resource string) *NetworkAttachmentsGetIamPolicyCall {
- c := &NetworkAttachmentsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.resource = resource
- return c
-}
-
-// OptionsRequestedPolicyVersion sets the optional parameter
-// "optionsRequestedPolicyVersion": Requested IAM Policy version.
-func (c *NetworkAttachmentsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *NetworkAttachmentsGetIamPolicyCall {
- c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
- 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 *NetworkAttachmentsGetIamPolicyCall) Fields(s ...googleapi.Field) *NetworkAttachmentsGetIamPolicyCall {
- 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 *NetworkAttachmentsGetIamPolicyCall) IfNoneMatch(entityTag string) *NetworkAttachmentsGetIamPolicyCall {
- 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 *NetworkAttachmentsGetIamPolicyCall) Context(ctx context.Context) *NetworkAttachmentsGetIamPolicyCall {
- 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 *NetworkAttachmentsGetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworkAttachmentsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/networkAttachments/{resource}/getIamPolicy")
- 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{
- "project": c.project,
- "region": c.region,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networkAttachments.getIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *NetworkAttachmentsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
- // "flatPath": "projects/{project}/regions/{region}/networkAttachments/{resource}/getIamPolicy",
- // "httpMethod": "GET",
- // "id": "compute.networkAttachments.getIamPolicy",
- // "parameterOrder": [
- // "project",
- // "region",
- // "resource"
- // ],
- // "parameters": {
- // "optionsRequestedPolicyVersion": {
- // "description": "Requested IAM Policy version.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/networkAttachments/{resource}/getIamPolicy",
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.networkAttachments.insert":
-
-type NetworkAttachmentsInsertCall struct {
- s *Service
- project string
- region string
- networkattachment *NetworkAttachment
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a NetworkAttachment in the specified project in the
-// given scope using the parameters that are included in the request.
-//
-// - project: Project ID for this request.
-// - region: Name of the region of this request.
-func (r *NetworkAttachmentsService) Insert(project string, region string, networkattachment *NetworkAttachment) *NetworkAttachmentsInsertCall {
- c := &NetworkAttachmentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.networkattachment = networkattachment
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000). end_interface:
-// MixerMutationRequestBuilder
-func (c *NetworkAttachmentsInsertCall) RequestId(requestId string) *NetworkAttachmentsInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *NetworkAttachmentsInsertCall) Fields(s ...googleapi.Field) *NetworkAttachmentsInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NetworkAttachmentsInsertCall) Context(ctx context.Context) *NetworkAttachmentsInsertCall {
- 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 *NetworkAttachmentsInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworkAttachmentsInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkattachment)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkAttachments")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networkAttachments.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *NetworkAttachmentsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a NetworkAttachment in the specified project in the given scope using the parameters that are included in the request.",
- // "flatPath": "projects/{project}/regions/{region}/networkAttachments",
- // "httpMethod": "POST",
- // "id": "compute.networkAttachments.insert",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region of this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000). end_interface: MixerMutationRequestBuilder",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/networkAttachments",
- // "request": {
- // "$ref": "NetworkAttachment"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.networkAttachments.list":
-
-type NetworkAttachmentsListCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Lists the NetworkAttachments for a project in the given scope.
-//
-// - project: Project ID for this request.
-// - region: Name of the region of this request.
-func (r *NetworkAttachmentsService) List(project string, region string) *NetworkAttachmentsListCall {
- c := &NetworkAttachmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *NetworkAttachmentsListCall) Filter(filter string) *NetworkAttachmentsListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *NetworkAttachmentsListCall) MaxResults(maxResults int64) *NetworkAttachmentsListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *NetworkAttachmentsListCall) OrderBy(orderBy string) *NetworkAttachmentsListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *NetworkAttachmentsListCall) PageToken(pageToken string) *NetworkAttachmentsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *NetworkAttachmentsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *NetworkAttachmentsListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *NetworkAttachmentsListCall) Fields(s ...googleapi.Field) *NetworkAttachmentsListCall {
- 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 *NetworkAttachmentsListCall) IfNoneMatch(entityTag string) *NetworkAttachmentsListCall {
- 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 *NetworkAttachmentsListCall) Context(ctx context.Context) *NetworkAttachmentsListCall {
- 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 *NetworkAttachmentsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworkAttachmentsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/networkAttachments")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networkAttachments.list" call.
-// Exactly one of *NetworkAttachmentList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *NetworkAttachmentList.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 *NetworkAttachmentsListCall) Do(opts ...googleapi.CallOption) (*NetworkAttachmentList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &NetworkAttachmentList{
- 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": "Lists the NetworkAttachments for a project in the given scope.",
- // "flatPath": "projects/{project}/regions/{region}/networkAttachments",
- // "httpMethod": "GET",
- // "id": "compute.networkAttachments.list",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region of this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/networkAttachments",
- // "response": {
- // "$ref": "NetworkAttachmentList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *NetworkAttachmentsListCall) Pages(ctx context.Context, f func(*NetworkAttachmentList) 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 "compute.networkAttachments.patch":
-
-type NetworkAttachmentsPatchCall struct {
- s *Service
- project string
- region string
- networkAttachment string
- networkattachment *NetworkAttachment
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Patches the specified NetworkAttachment resource with the data
-// included in the request. This method supports PATCH semantics and
-// uses JSON merge patch format and processing rules.
-//
-// - networkAttachment: Name of the NetworkAttachment resource to patch.
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-func (r *NetworkAttachmentsService) Patch(project string, region string, networkAttachment string, networkattachment *NetworkAttachment) *NetworkAttachmentsPatchCall {
- c := &NetworkAttachmentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.networkAttachment = networkAttachment
- c.networkattachment = networkattachment
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000). end_interface:
-// MixerMutationRequestBuilder
-func (c *NetworkAttachmentsPatchCall) RequestId(requestId string) *NetworkAttachmentsPatchCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *NetworkAttachmentsPatchCall) Fields(s ...googleapi.Field) *NetworkAttachmentsPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NetworkAttachmentsPatchCall) Context(ctx context.Context) *NetworkAttachmentsPatchCall {
- 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 *NetworkAttachmentsPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworkAttachmentsPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkattachment)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkAttachments/{networkAttachment}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "networkAttachment": c.networkAttachment,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networkAttachments.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *NetworkAttachmentsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Patches the specified NetworkAttachment resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules.",
- // "flatPath": "projects/{project}/regions/{region}/networkAttachments/{networkAttachment}",
- // "httpMethod": "PATCH",
- // "id": "compute.networkAttachments.patch",
- // "parameterOrder": [
- // "project",
- // "region",
- // "networkAttachment"
- // ],
- // "parameters": {
- // "networkAttachment": {
- // "description": "Name of the NetworkAttachment resource to patch.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000). end_interface: MixerMutationRequestBuilder",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/networkAttachments/{networkAttachment}",
- // "request": {
- // "$ref": "NetworkAttachment"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.networkAttachments.setIamPolicy":
-
-type NetworkAttachmentsSetIamPolicyCall struct {
- s *Service
- project string
- region string
- resource string
- regionsetpolicyrequest *RegionSetPolicyRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetIamPolicy: Sets the access control policy on the specified
-// resource. Replaces any existing policy.
-//
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-// - resource: Name or id of the resource for this request.
-func (r *NetworkAttachmentsService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *NetworkAttachmentsSetIamPolicyCall {
- c := &NetworkAttachmentsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.resource = resource
- c.regionsetpolicyrequest = regionsetpolicyrequest
- 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 *NetworkAttachmentsSetIamPolicyCall) Fields(s ...googleapi.Field) *NetworkAttachmentsSetIamPolicyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NetworkAttachmentsSetIamPolicyCall) Context(ctx context.Context) *NetworkAttachmentsSetIamPolicyCall {
- 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 *NetworkAttachmentsSetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworkAttachmentsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkAttachments/{resource}/setIamPolicy")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networkAttachments.setIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *NetworkAttachmentsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Sets the access control policy on the specified resource. Replaces any existing policy.",
- // "flatPath": "projects/{project}/regions/{region}/networkAttachments/{resource}/setIamPolicy",
- // "httpMethod": "POST",
- // "id": "compute.networkAttachments.setIamPolicy",
- // "parameterOrder": [
- // "project",
- // "region",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/networkAttachments/{resource}/setIamPolicy",
- // "request": {
- // "$ref": "RegionSetPolicyRequest"
- // },
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.networkAttachments.testIamPermissions":
-
-type NetworkAttachmentsTestIamPermissionsCall struct {
- s *Service
- project string
- region string
- resource string
- testpermissionsrequest *TestPermissionsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// TestIamPermissions: Returns permissions that a caller has on the
-// specified resource.
-//
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-// - resource: Name or id of the resource for this request.
-func (r *NetworkAttachmentsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *NetworkAttachmentsTestIamPermissionsCall {
- c := &NetworkAttachmentsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.resource = resource
- c.testpermissionsrequest = testpermissionsrequest
- 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 *NetworkAttachmentsTestIamPermissionsCall) Fields(s ...googleapi.Field) *NetworkAttachmentsTestIamPermissionsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NetworkAttachmentsTestIamPermissionsCall) Context(ctx context.Context) *NetworkAttachmentsTestIamPermissionsCall {
- 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 *NetworkAttachmentsTestIamPermissionsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworkAttachmentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkAttachments/{resource}/testIamPermissions")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networkAttachments.testIamPermissions" call.
-// Exactly one of *TestPermissionsResponse or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *TestPermissionsResponse.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 *NetworkAttachmentsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TestPermissionsResponse{
- 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": "Returns permissions that a caller has on the specified resource.",
- // "flatPath": "projects/{project}/regions/{region}/networkAttachments/{resource}/testIamPermissions",
- // "httpMethod": "POST",
- // "id": "compute.networkAttachments.testIamPermissions",
- // "parameterOrder": [
- // "project",
- // "region",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/networkAttachments/{resource}/testIamPermissions",
- // "request": {
- // "$ref": "TestPermissionsRequest"
- // },
- // "response": {
- // "$ref": "TestPermissionsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.networkEdgeSecurityServices.aggregatedList":
-
-type NetworkEdgeSecurityServicesAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Retrieves the list of all NetworkEdgeSecurityService
-// resources available to the specified project.
-//
-// - project: Name of the project scoping this request.
-func (r *NetworkEdgeSecurityServicesService) AggregatedList(project string) *NetworkEdgeSecurityServicesAggregatedListCall {
- c := &NetworkEdgeSecurityServicesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *NetworkEdgeSecurityServicesAggregatedListCall) Filter(filter string) *NetworkEdgeSecurityServicesAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *NetworkEdgeSecurityServicesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *NetworkEdgeSecurityServicesAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *NetworkEdgeSecurityServicesAggregatedListCall) MaxResults(maxResults int64) *NetworkEdgeSecurityServicesAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *NetworkEdgeSecurityServicesAggregatedListCall) OrderBy(orderBy string) *NetworkEdgeSecurityServicesAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *NetworkEdgeSecurityServicesAggregatedListCall) PageToken(pageToken string) *NetworkEdgeSecurityServicesAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *NetworkEdgeSecurityServicesAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *NetworkEdgeSecurityServicesAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *NetworkEdgeSecurityServicesAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *NetworkEdgeSecurityServicesAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *NetworkEdgeSecurityServicesAggregatedListCall) Fields(s ...googleapi.Field) *NetworkEdgeSecurityServicesAggregatedListCall {
- 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 *NetworkEdgeSecurityServicesAggregatedListCall) IfNoneMatch(entityTag string) *NetworkEdgeSecurityServicesAggregatedListCall {
- 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 *NetworkEdgeSecurityServicesAggregatedListCall) Context(ctx context.Context) *NetworkEdgeSecurityServicesAggregatedListCall {
- 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 *NetworkEdgeSecurityServicesAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworkEdgeSecurityServicesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/networkEdgeSecurityServices")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networkEdgeSecurityServices.aggregatedList" call.
-// Exactly one of *NetworkEdgeSecurityServiceAggregatedList or error
-// will be non-nil. Any non-2xx status code is an error. Response
-// headers are in either
-// *NetworkEdgeSecurityServiceAggregatedList.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 *NetworkEdgeSecurityServicesAggregatedListCall) Do(opts ...googleapi.CallOption) (*NetworkEdgeSecurityServiceAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &NetworkEdgeSecurityServiceAggregatedList{
- 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": "Retrieves the list of all NetworkEdgeSecurityService resources available to the specified project.",
- // "flatPath": "projects/{project}/aggregated/networkEdgeSecurityServices",
- // "httpMethod": "GET",
- // "id": "compute.networkEdgeSecurityServices.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Name of the project scoping this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/networkEdgeSecurityServices",
- // "response": {
- // "$ref": "NetworkEdgeSecurityServiceAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *NetworkEdgeSecurityServicesAggregatedListCall) Pages(ctx context.Context, f func(*NetworkEdgeSecurityServiceAggregatedList) 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 "compute.networkEdgeSecurityServices.delete":
-
-type NetworkEdgeSecurityServicesDeleteCall struct {
- s *Service
- project string
- region string
- networkEdgeSecurityService string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified service.
-//
-// - networkEdgeSecurityService: Name of the network edge security
-// service to delete.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *NetworkEdgeSecurityServicesService) Delete(project string, region string, networkEdgeSecurityService string) *NetworkEdgeSecurityServicesDeleteCall {
- c := &NetworkEdgeSecurityServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.networkEdgeSecurityService = networkEdgeSecurityService
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *NetworkEdgeSecurityServicesDeleteCall) RequestId(requestId string) *NetworkEdgeSecurityServicesDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *NetworkEdgeSecurityServicesDeleteCall) Fields(s ...googleapi.Field) *NetworkEdgeSecurityServicesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NetworkEdgeSecurityServicesDeleteCall) Context(ctx context.Context) *NetworkEdgeSecurityServicesDeleteCall {
- 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 *NetworkEdgeSecurityServicesDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworkEdgeSecurityServicesDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkEdgeSecurityServices/{networkEdgeSecurityService}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "networkEdgeSecurityService": c.networkEdgeSecurityService,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networkEdgeSecurityServices.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *NetworkEdgeSecurityServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified service.",
- // "flatPath": "projects/{project}/regions/{region}/networkEdgeSecurityServices/{networkEdgeSecurityService}",
- // "httpMethod": "DELETE",
- // "id": "compute.networkEdgeSecurityServices.delete",
- // "parameterOrder": [
- // "project",
- // "region",
- // "networkEdgeSecurityService"
- // ],
- // "parameters": {
- // "networkEdgeSecurityService": {
- // "description": "Name of the network edge security service to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/networkEdgeSecurityServices/{networkEdgeSecurityService}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.networkEdgeSecurityServices.get":
-
-type NetworkEdgeSecurityServicesGetCall struct {
- s *Service
- project string
- region string
- networkEdgeSecurityService string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Gets a specified NetworkEdgeSecurityService.
-//
-// - networkEdgeSecurityService: Name of the network edge security
-// service to get.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *NetworkEdgeSecurityServicesService) Get(project string, region string, networkEdgeSecurityService string) *NetworkEdgeSecurityServicesGetCall {
- c := &NetworkEdgeSecurityServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.networkEdgeSecurityService = networkEdgeSecurityService
- 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 *NetworkEdgeSecurityServicesGetCall) Fields(s ...googleapi.Field) *NetworkEdgeSecurityServicesGetCall {
- 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 *NetworkEdgeSecurityServicesGetCall) IfNoneMatch(entityTag string) *NetworkEdgeSecurityServicesGetCall {
- 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 *NetworkEdgeSecurityServicesGetCall) Context(ctx context.Context) *NetworkEdgeSecurityServicesGetCall {
- 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 *NetworkEdgeSecurityServicesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworkEdgeSecurityServicesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/networkEdgeSecurityServices/{networkEdgeSecurityService}")
- 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{
- "project": c.project,
- "region": c.region,
- "networkEdgeSecurityService": c.networkEdgeSecurityService,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networkEdgeSecurityServices.get" call.
-// Exactly one of *NetworkEdgeSecurityService or error will be non-nil.
-// Any non-2xx status code is an error. Response headers are in either
-// *NetworkEdgeSecurityService.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 *NetworkEdgeSecurityServicesGetCall) Do(opts ...googleapi.CallOption) (*NetworkEdgeSecurityService, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &NetworkEdgeSecurityService{
- 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": "Gets a specified NetworkEdgeSecurityService.",
- // "flatPath": "projects/{project}/regions/{region}/networkEdgeSecurityServices/{networkEdgeSecurityService}",
- // "httpMethod": "GET",
- // "id": "compute.networkEdgeSecurityServices.get",
- // "parameterOrder": [
- // "project",
- // "region",
- // "networkEdgeSecurityService"
- // ],
- // "parameters": {
- // "networkEdgeSecurityService": {
- // "description": "Name of the network edge security service to get.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/networkEdgeSecurityServices/{networkEdgeSecurityService}",
- // "response": {
- // "$ref": "NetworkEdgeSecurityService"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.networkEdgeSecurityServices.insert":
-
-type NetworkEdgeSecurityServicesInsertCall struct {
- s *Service
- project string
- region string
- networkedgesecurityservice *NetworkEdgeSecurityService
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a new service in the specified project using the data
-// included in the request.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *NetworkEdgeSecurityServicesService) Insert(project string, region string, networkedgesecurityservice *NetworkEdgeSecurityService) *NetworkEdgeSecurityServicesInsertCall {
- c := &NetworkEdgeSecurityServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.networkedgesecurityservice = networkedgesecurityservice
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *NetworkEdgeSecurityServicesInsertCall) RequestId(requestId string) *NetworkEdgeSecurityServicesInsertCall {
- c.urlParams_.Set("requestId", requestId)
- return c
-}
-
-// ValidateOnly sets the optional parameter "validateOnly": If true, the
-// request will not be committed.
-func (c *NetworkEdgeSecurityServicesInsertCall) ValidateOnly(validateOnly bool) *NetworkEdgeSecurityServicesInsertCall {
- c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
- 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 *NetworkEdgeSecurityServicesInsertCall) Fields(s ...googleapi.Field) *NetworkEdgeSecurityServicesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NetworkEdgeSecurityServicesInsertCall) Context(ctx context.Context) *NetworkEdgeSecurityServicesInsertCall {
- 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 *NetworkEdgeSecurityServicesInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworkEdgeSecurityServicesInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkedgesecurityservice)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkEdgeSecurityServices")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networkEdgeSecurityServices.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *NetworkEdgeSecurityServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a new service in the specified project using the data included in the request.",
- // "flatPath": "projects/{project}/regions/{region}/networkEdgeSecurityServices",
- // "httpMethod": "POST",
- // "id": "compute.networkEdgeSecurityServices.insert",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "validateOnly": {
- // "description": "If true, the request will not be committed.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/networkEdgeSecurityServices",
- // "request": {
- // "$ref": "NetworkEdgeSecurityService"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.networkEdgeSecurityServices.patch":
-
-type NetworkEdgeSecurityServicesPatchCall struct {
- s *Service
- project string
- region string
- networkEdgeSecurityService string
- networkedgesecurityservice *NetworkEdgeSecurityService
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Patches the specified policy with the data included in the
-// request.
-//
-// - networkEdgeSecurityService: Name of the network edge security
-// service to update.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *NetworkEdgeSecurityServicesService) Patch(project string, region string, networkEdgeSecurityService string, networkedgesecurityservice *NetworkEdgeSecurityService) *NetworkEdgeSecurityServicesPatchCall {
- c := &NetworkEdgeSecurityServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.networkEdgeSecurityService = networkEdgeSecurityService
- c.networkedgesecurityservice = networkedgesecurityservice
- return c
-}
-
-// Paths sets the optional parameter "paths":
-func (c *NetworkEdgeSecurityServicesPatchCall) Paths(paths ...string) *NetworkEdgeSecurityServicesPatchCall {
- c.urlParams_.SetMulti("paths", append([]string{}, paths...))
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *NetworkEdgeSecurityServicesPatchCall) RequestId(requestId string) *NetworkEdgeSecurityServicesPatchCall {
- c.urlParams_.Set("requestId", requestId)
- return c
-}
-
-// UpdateMask sets the optional parameter "updateMask": Indicates fields
-// to be updated as part of this request.
-func (c *NetworkEdgeSecurityServicesPatchCall) UpdateMask(updateMask string) *NetworkEdgeSecurityServicesPatchCall {
- c.urlParams_.Set("updateMask", updateMask)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *NetworkEdgeSecurityServicesPatchCall) Fields(s ...googleapi.Field) *NetworkEdgeSecurityServicesPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NetworkEdgeSecurityServicesPatchCall) Context(ctx context.Context) *NetworkEdgeSecurityServicesPatchCall {
- 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 *NetworkEdgeSecurityServicesPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworkEdgeSecurityServicesPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkedgesecurityservice)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkEdgeSecurityServices/{networkEdgeSecurityService}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "networkEdgeSecurityService": c.networkEdgeSecurityService,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networkEdgeSecurityServices.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *NetworkEdgeSecurityServicesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Patches the specified policy with the data included in the request.",
- // "flatPath": "projects/{project}/regions/{region}/networkEdgeSecurityServices/{networkEdgeSecurityService}",
- // "httpMethod": "PATCH",
- // "id": "compute.networkEdgeSecurityServices.patch",
- // "parameterOrder": [
- // "project",
- // "region",
- // "networkEdgeSecurityService"
- // ],
- // "parameters": {
- // "networkEdgeSecurityService": {
- // "description": "Name of the network edge security service to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "paths": {
- // "location": "query",
- // "repeated": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "updateMask": {
- // "description": "Indicates fields to be updated as part of this request.",
- // "format": "google-fieldmask",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/networkEdgeSecurityServices/{networkEdgeSecurityService}",
- // "request": {
- // "$ref": "NetworkEdgeSecurityService"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.networkEndpointGroups.aggregatedList":
-
-type NetworkEndpointGroupsAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Retrieves the list of network endpoint groups and
-// sorts them by zone.
-//
-// - project: Project ID for this request.
-func (r *NetworkEndpointGroupsService) AggregatedList(project string) *NetworkEndpointGroupsAggregatedListCall {
- c := &NetworkEndpointGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *NetworkEndpointGroupsAggregatedListCall) Filter(filter string) *NetworkEndpointGroupsAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *NetworkEndpointGroupsAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *NetworkEndpointGroupsAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *NetworkEndpointGroupsAggregatedListCall) MaxResults(maxResults int64) *NetworkEndpointGroupsAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *NetworkEndpointGroupsAggregatedListCall) OrderBy(orderBy string) *NetworkEndpointGroupsAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *NetworkEndpointGroupsAggregatedListCall) PageToken(pageToken string) *NetworkEndpointGroupsAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *NetworkEndpointGroupsAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *NetworkEndpointGroupsAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *NetworkEndpointGroupsAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *NetworkEndpointGroupsAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *NetworkEndpointGroupsAggregatedListCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsAggregatedListCall {
- 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 *NetworkEndpointGroupsAggregatedListCall) IfNoneMatch(entityTag string) *NetworkEndpointGroupsAggregatedListCall {
- 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 *NetworkEndpointGroupsAggregatedListCall) Context(ctx context.Context) *NetworkEndpointGroupsAggregatedListCall {
- 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 *NetworkEndpointGroupsAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworkEndpointGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/networkEndpointGroups")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networkEndpointGroups.aggregatedList" call.
-// Exactly one of *NetworkEndpointGroupAggregatedList or error will be
-// non-nil. Any non-2xx status code is an error. Response headers are in
-// either *NetworkEndpointGroupAggregatedList.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 *NetworkEndpointGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &NetworkEndpointGroupAggregatedList{
- 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": "Retrieves the list of network endpoint groups and sorts them by zone.",
- // "flatPath": "projects/{project}/aggregated/networkEndpointGroups",
- // "httpMethod": "GET",
- // "id": "compute.networkEndpointGroups.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/networkEndpointGroups",
- // "response": {
- // "$ref": "NetworkEndpointGroupAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *NetworkEndpointGroupsAggregatedListCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupAggregatedList) 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 "compute.networkEndpointGroups.attachNetworkEndpoints":
-
-type NetworkEndpointGroupsAttachNetworkEndpointsCall struct {
- s *Service
- project string
- zone string
- networkEndpointGroup string
- networkendpointgroupsattachendpointsrequest *NetworkEndpointGroupsAttachEndpointsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// AttachNetworkEndpoints: Attach a list of network endpoints to the
-// specified network endpoint group.
-//
-// - networkEndpointGroup: The name of the network endpoint group where
-// you are attaching network endpoints to. It should comply with
-// RFC1035.
-// - project: Project ID for this request.
-// - zone: The name of the zone where the network endpoint group is
-// located. It should comply with RFC1035.
-func (r *NetworkEndpointGroupsService) AttachNetworkEndpoints(project string, zone string, networkEndpointGroup string, networkendpointgroupsattachendpointsrequest *NetworkEndpointGroupsAttachEndpointsRequest) *NetworkEndpointGroupsAttachNetworkEndpointsCall {
- c := &NetworkEndpointGroupsAttachNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.networkEndpointGroup = networkEndpointGroup
- c.networkendpointgroupsattachendpointsrequest = networkendpointgroupsattachendpointsrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) RequestId(requestId string) *NetworkEndpointGroupsAttachNetworkEndpointsCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *NetworkEndpointGroupsAttachNetworkEndpointsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsAttachNetworkEndpointsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NetworkEndpointGroupsAttachNetworkEndpointsCall) Context(ctx context.Context) *NetworkEndpointGroupsAttachNetworkEndpointsCall {
- 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 *NetworkEndpointGroupsAttachNetworkEndpointsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupsattachendpointsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/attachNetworkEndpoints")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "networkEndpointGroup": c.networkEndpointGroup,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networkEndpointGroups.attachNetworkEndpoints" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *NetworkEndpointGroupsAttachNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Attach a list of network endpoints to the specified network endpoint group.",
- // "flatPath": "projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/attachNetworkEndpoints",
- // "httpMethod": "POST",
- // "id": "compute.networkEndpointGroups.attachNetworkEndpoints",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "networkEndpointGroup"
- // ],
- // "parameters": {
- // "networkEndpointGroup": {
- // "description": "The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/attachNetworkEndpoints",
- // "request": {
- // "$ref": "NetworkEndpointGroupsAttachEndpointsRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.networkEndpointGroups.delete":
-
-type NetworkEndpointGroupsDeleteCall struct {
- s *Service
- project string
- zone string
- networkEndpointGroup string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified network endpoint group. The network
-// endpoints in the NEG and the VM instances they belong to are not
-// terminated when the NEG is deleted. Note that the NEG cannot be
-// deleted if there are backend services referencing it.
-//
-// - networkEndpointGroup: The name of the network endpoint group to
-// delete. It should comply with RFC1035.
-// - project: Project ID for this request.
-// - zone: The name of the zone where the network endpoint group is
-// located. It should comply with RFC1035.
-func (r *NetworkEndpointGroupsService) Delete(project string, zone string, networkEndpointGroup string) *NetworkEndpointGroupsDeleteCall {
- c := &NetworkEndpointGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.networkEndpointGroup = networkEndpointGroup
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *NetworkEndpointGroupsDeleteCall) RequestId(requestId string) *NetworkEndpointGroupsDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *NetworkEndpointGroupsDeleteCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NetworkEndpointGroupsDeleteCall) Context(ctx context.Context) *NetworkEndpointGroupsDeleteCall {
- 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 *NetworkEndpointGroupsDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworkEndpointGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "networkEndpointGroup": c.networkEndpointGroup,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networkEndpointGroups.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *NetworkEndpointGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified network endpoint group. The network endpoints in the NEG and the VM instances they belong to are not terminated when the NEG is deleted. Note that the NEG cannot be deleted if there are backend services referencing it.",
- // "flatPath": "projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}",
- // "httpMethod": "DELETE",
- // "id": "compute.networkEndpointGroups.delete",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "networkEndpointGroup"
- // ],
- // "parameters": {
- // "networkEndpointGroup": {
- // "description": "The name of the network endpoint group to delete. It should comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.networkEndpointGroups.detachNetworkEndpoints":
-
-type NetworkEndpointGroupsDetachNetworkEndpointsCall struct {
- s *Service
- project string
- zone string
- networkEndpointGroup string
- networkendpointgroupsdetachendpointsrequest *NetworkEndpointGroupsDetachEndpointsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// DetachNetworkEndpoints: Detach a list of network endpoints from the
-// specified network endpoint group.
-//
-// - networkEndpointGroup: The name of the network endpoint group where
-// you are removing network endpoints. It should comply with RFC1035.
-// - project: Project ID for this request.
-// - zone: The name of the zone where the network endpoint group is
-// located. It should comply with RFC1035.
-func (r *NetworkEndpointGroupsService) DetachNetworkEndpoints(project string, zone string, networkEndpointGroup string, networkendpointgroupsdetachendpointsrequest *NetworkEndpointGroupsDetachEndpointsRequest) *NetworkEndpointGroupsDetachNetworkEndpointsCall {
- c := &NetworkEndpointGroupsDetachNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.networkEndpointGroup = networkEndpointGroup
- c.networkendpointgroupsdetachendpointsrequest = networkendpointgroupsdetachendpointsrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) RequestId(requestId string) *NetworkEndpointGroupsDetachNetworkEndpointsCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *NetworkEndpointGroupsDetachNetworkEndpointsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsDetachNetworkEndpointsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NetworkEndpointGroupsDetachNetworkEndpointsCall) Context(ctx context.Context) *NetworkEndpointGroupsDetachNetworkEndpointsCall {
- 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 *NetworkEndpointGroupsDetachNetworkEndpointsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupsdetachendpointsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/detachNetworkEndpoints")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "networkEndpointGroup": c.networkEndpointGroup,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networkEndpointGroups.detachNetworkEndpoints" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *NetworkEndpointGroupsDetachNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Detach a list of network endpoints from the specified network endpoint group.",
- // "flatPath": "projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/detachNetworkEndpoints",
- // "httpMethod": "POST",
- // "id": "compute.networkEndpointGroups.detachNetworkEndpoints",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "networkEndpointGroup"
- // ],
- // "parameters": {
- // "networkEndpointGroup": {
- // "description": "The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/detachNetworkEndpoints",
- // "request": {
- // "$ref": "NetworkEndpointGroupsDetachEndpointsRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.networkEndpointGroups.get":
-
-type NetworkEndpointGroupsGetCall struct {
- s *Service
- project string
- zone string
- networkEndpointGroup string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified network endpoint group.
-//
-// - networkEndpointGroup: The name of the network endpoint group. It
-// should comply with RFC1035.
-// - project: Project ID for this request.
-// - zone: The name of the zone where the network endpoint group is
-// located. It should comply with RFC1035.
-func (r *NetworkEndpointGroupsService) Get(project string, zone string, networkEndpointGroup string) *NetworkEndpointGroupsGetCall {
- c := &NetworkEndpointGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.networkEndpointGroup = networkEndpointGroup
- 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 *NetworkEndpointGroupsGetCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsGetCall {
- 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 *NetworkEndpointGroupsGetCall) IfNoneMatch(entityTag string) *NetworkEndpointGroupsGetCall {
- 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 *NetworkEndpointGroupsGetCall) Context(ctx context.Context) *NetworkEndpointGroupsGetCall {
- 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 *NetworkEndpointGroupsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworkEndpointGroupsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}")
- 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{
- "project": c.project,
- "zone": c.zone,
- "networkEndpointGroup": c.networkEndpointGroup,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networkEndpointGroups.get" call.
-// Exactly one of *NetworkEndpointGroup or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *NetworkEndpointGroup.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 *NetworkEndpointGroupsGetCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroup, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &NetworkEndpointGroup{
- 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": "Returns the specified network endpoint group.",
- // "flatPath": "projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}",
- // "httpMethod": "GET",
- // "id": "compute.networkEndpointGroups.get",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "networkEndpointGroup"
- // ],
- // "parameters": {
- // "networkEndpointGroup": {
- // "description": "The name of the network endpoint group. It should comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}",
- // "response": {
- // "$ref": "NetworkEndpointGroup"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.networkEndpointGroups.insert":
-
-type NetworkEndpointGroupsInsertCall struct {
- s *Service
- project string
- zone string
- networkendpointgroup *NetworkEndpointGroup
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a network endpoint group in the specified project
-// using the parameters that are included in the request.
-//
-// - project: Project ID for this request.
-// - zone: The name of the zone where you want to create the network
-// endpoint group. It should comply with RFC1035.
-func (r *NetworkEndpointGroupsService) Insert(project string, zone string, networkendpointgroup *NetworkEndpointGroup) *NetworkEndpointGroupsInsertCall {
- c := &NetworkEndpointGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.networkendpointgroup = networkendpointgroup
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *NetworkEndpointGroupsInsertCall) RequestId(requestId string) *NetworkEndpointGroupsInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *NetworkEndpointGroupsInsertCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NetworkEndpointGroupsInsertCall) Context(ctx context.Context) *NetworkEndpointGroupsInsertCall {
- 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 *NetworkEndpointGroupsInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworkEndpointGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroup)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/networkEndpointGroups")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networkEndpointGroups.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *NetworkEndpointGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a network endpoint group in the specified project using the parameters that are included in the request.",
- // "flatPath": "projects/{project}/zones/{zone}/networkEndpointGroups",
- // "httpMethod": "POST",
- // "id": "compute.networkEndpointGroups.insert",
- // "parameterOrder": [
- // "project",
- // "zone"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone where you want to create the network endpoint group. It should comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/networkEndpointGroups",
- // "request": {
- // "$ref": "NetworkEndpointGroup"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.networkEndpointGroups.list":
-
-type NetworkEndpointGroupsListCall struct {
- s *Service
- project string
- zone string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves the list of network endpoint groups that are located
-// in the specified project and zone.
-//
-// - project: Project ID for this request.
-// - zone: The name of the zone where the network endpoint group is
-// located. It should comply with RFC1035.
-func (r *NetworkEndpointGroupsService) List(project string, zone string) *NetworkEndpointGroupsListCall {
- c := &NetworkEndpointGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *NetworkEndpointGroupsListCall) Filter(filter string) *NetworkEndpointGroupsListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *NetworkEndpointGroupsListCall) MaxResults(maxResults int64) *NetworkEndpointGroupsListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *NetworkEndpointGroupsListCall) OrderBy(orderBy string) *NetworkEndpointGroupsListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *NetworkEndpointGroupsListCall) PageToken(pageToken string) *NetworkEndpointGroupsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *NetworkEndpointGroupsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *NetworkEndpointGroupsListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *NetworkEndpointGroupsListCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsListCall {
- 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 *NetworkEndpointGroupsListCall) IfNoneMatch(entityTag string) *NetworkEndpointGroupsListCall {
- 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 *NetworkEndpointGroupsListCall) Context(ctx context.Context) *NetworkEndpointGroupsListCall {
- 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 *NetworkEndpointGroupsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworkEndpointGroupsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}/networkEndpointGroups")
- 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{
- "project": c.project,
- "zone": c.zone,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networkEndpointGroups.list" call.
-// Exactly one of *NetworkEndpointGroupList or error will be non-nil.
-// Any non-2xx status code is an error. Response headers are in either
-// *NetworkEndpointGroupList.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 *NetworkEndpointGroupsListCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &NetworkEndpointGroupList{
- 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": "Retrieves the list of network endpoint groups that are located in the specified project and zone.",
- // "flatPath": "projects/{project}/zones/{zone}/networkEndpointGroups",
- // "httpMethod": "GET",
- // "id": "compute.networkEndpointGroups.list",
- // "parameterOrder": [
- // "project",
- // "zone"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "zone": {
- // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/networkEndpointGroups",
- // "response": {
- // "$ref": "NetworkEndpointGroupList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *NetworkEndpointGroupsListCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupList) 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 "compute.networkEndpointGroups.listNetworkEndpoints":
-
-type NetworkEndpointGroupsListNetworkEndpointsCall struct {
- s *Service
- project string
- zone string
- networkEndpointGroup string
- networkendpointgroupslistendpointsrequest *NetworkEndpointGroupsListEndpointsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// ListNetworkEndpoints: Lists the network endpoints in the specified
-// network endpoint group.
-//
-// - networkEndpointGroup: The name of the network endpoint group from
-// which you want to generate a list of included network endpoints. It
-// should comply with RFC1035.
-// - project: Project ID for this request.
-// - zone: The name of the zone where the network endpoint group is
-// located. It should comply with RFC1035.
-func (r *NetworkEndpointGroupsService) ListNetworkEndpoints(project string, zone string, networkEndpointGroup string, networkendpointgroupslistendpointsrequest *NetworkEndpointGroupsListEndpointsRequest) *NetworkEndpointGroupsListNetworkEndpointsCall {
- c := &NetworkEndpointGroupsListNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.networkEndpointGroup = networkEndpointGroup
- c.networkendpointgroupslistendpointsrequest = networkendpointgroupslistendpointsrequest
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Filter(filter string) *NetworkEndpointGroupsListNetworkEndpointsCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *NetworkEndpointGroupsListNetworkEndpointsCall) MaxResults(maxResults int64) *NetworkEndpointGroupsListNetworkEndpointsCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *NetworkEndpointGroupsListNetworkEndpointsCall) OrderBy(orderBy string) *NetworkEndpointGroupsListNetworkEndpointsCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *NetworkEndpointGroupsListNetworkEndpointsCall) PageToken(pageToken string) *NetworkEndpointGroupsListNetworkEndpointsCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *NetworkEndpointGroupsListNetworkEndpointsCall) ReturnPartialSuccess(returnPartialSuccess bool) *NetworkEndpointGroupsListNetworkEndpointsCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *NetworkEndpointGroupsListNetworkEndpointsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsListNetworkEndpointsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NetworkEndpointGroupsListNetworkEndpointsCall) Context(ctx context.Context) *NetworkEndpointGroupsListNetworkEndpointsCall {
- 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 *NetworkEndpointGroupsListNetworkEndpointsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworkEndpointGroupsListNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupslistendpointsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/listNetworkEndpoints")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "networkEndpointGroup": c.networkEndpointGroup,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networkEndpointGroups.listNetworkEndpoints" call.
-// Exactly one of *NetworkEndpointGroupsListNetworkEndpoints or error
-// will be non-nil. Any non-2xx status code is an error. Response
-// headers are in either
-// *NetworkEndpointGroupsListNetworkEndpoints.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 *NetworkEndpointGroupsListNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupsListNetworkEndpoints, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &NetworkEndpointGroupsListNetworkEndpoints{
- 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": "Lists the network endpoints in the specified network endpoint group.",
- // "flatPath": "projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/listNetworkEndpoints",
- // "httpMethod": "POST",
- // "id": "compute.networkEndpointGroups.listNetworkEndpoints",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "networkEndpointGroup"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "networkEndpointGroup": {
- // "description": "The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "zone": {
- // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/listNetworkEndpoints",
- // "request": {
- // "$ref": "NetworkEndpointGroupsListEndpointsRequest"
- // },
- // "response": {
- // "$ref": "NetworkEndpointGroupsListNetworkEndpoints"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *NetworkEndpointGroupsListNetworkEndpointsCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupsListNetworkEndpoints) 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 "compute.networkEndpointGroups.testIamPermissions":
-
-type NetworkEndpointGroupsTestIamPermissionsCall struct {
- s *Service
- project string
- zone string
- resource string
- testpermissionsrequest *TestPermissionsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// TestIamPermissions: Returns permissions that a caller has on the
-// specified resource.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-// - zone: The name of the zone for this request.
-func (r *NetworkEndpointGroupsService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *NetworkEndpointGroupsTestIamPermissionsCall {
- c := &NetworkEndpointGroupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.resource = resource
- c.testpermissionsrequest = testpermissionsrequest
- 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 *NetworkEndpointGroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsTestIamPermissionsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NetworkEndpointGroupsTestIamPermissionsCall) Context(ctx context.Context) *NetworkEndpointGroupsTestIamPermissionsCall {
- 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 *NetworkEndpointGroupsTestIamPermissionsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworkEndpointGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/networkEndpointGroups/{resource}/testIamPermissions")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networkEndpointGroups.testIamPermissions" call.
-// Exactly one of *TestPermissionsResponse or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *TestPermissionsResponse.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 *NetworkEndpointGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TestPermissionsResponse{
- 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": "Returns permissions that a caller has on the specified resource.",
- // "flatPath": "projects/{project}/zones/{zone}/networkEndpointGroups/{resource}/testIamPermissions",
- // "httpMethod": "POST",
- // "id": "compute.networkEndpointGroups.testIamPermissions",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/networkEndpointGroups/{resource}/testIamPermissions",
- // "request": {
- // "$ref": "TestPermissionsRequest"
- // },
- // "response": {
- // "$ref": "TestPermissionsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.networkFirewallPolicies.addAssociation":
-
-type NetworkFirewallPoliciesAddAssociationCall struct {
- s *Service
- project string
- firewallPolicy string
- firewallpolicyassociation *FirewallPolicyAssociation
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// AddAssociation: Inserts an association for the specified firewall
-// policy.
-//
-// - firewallPolicy: Name of the firewall policy to update.
-// - project: Project ID for this request.
-func (r *NetworkFirewallPoliciesService) AddAssociation(project string, firewallPolicy string, firewallpolicyassociation *FirewallPolicyAssociation) *NetworkFirewallPoliciesAddAssociationCall {
- c := &NetworkFirewallPoliciesAddAssociationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.firewallPolicy = firewallPolicy
- c.firewallpolicyassociation = firewallpolicyassociation
- return c
-}
-
-// ReplaceExistingAssociation sets the optional parameter
-// "replaceExistingAssociation": Indicates whether or not to replace it
-// if an association of the attachment already exists. This is false by
-// default, in which case an error will be returned if an association
-// already exists.
-func (c *NetworkFirewallPoliciesAddAssociationCall) ReplaceExistingAssociation(replaceExistingAssociation bool) *NetworkFirewallPoliciesAddAssociationCall {
- c.urlParams_.Set("replaceExistingAssociation", fmt.Sprint(replaceExistingAssociation))
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *NetworkFirewallPoliciesAddAssociationCall) RequestId(requestId string) *NetworkFirewallPoliciesAddAssociationCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *NetworkFirewallPoliciesAddAssociationCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesAddAssociationCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NetworkFirewallPoliciesAddAssociationCall) Context(ctx context.Context) *NetworkFirewallPoliciesAddAssociationCall {
- 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 *NetworkFirewallPoliciesAddAssociationCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworkFirewallPoliciesAddAssociationCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyassociation)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/addAssociation")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "firewallPolicy": c.firewallPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networkFirewallPolicies.addAssociation" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *NetworkFirewallPoliciesAddAssociationCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Inserts an association for the specified firewall policy.",
- // "flatPath": "projects/{project}/global/firewallPolicies/{firewallPolicy}/addAssociation",
- // "httpMethod": "POST",
- // "id": "compute.networkFirewallPolicies.addAssociation",
- // "parameterOrder": [
- // "project",
- // "firewallPolicy"
- // ],
- // "parameters": {
- // "firewallPolicy": {
- // "description": "Name of the firewall policy to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "replaceExistingAssociation": {
- // "description": "Indicates whether or not to replace it if an association of the attachment already exists. This is false by default, in which case an error will be returned if an association already exists.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/firewallPolicies/{firewallPolicy}/addAssociation",
- // "request": {
- // "$ref": "FirewallPolicyAssociation"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.networkFirewallPolicies.addRule":
-
-type NetworkFirewallPoliciesAddRuleCall struct {
- s *Service
- project string
- firewallPolicy string
- firewallpolicyrule *FirewallPolicyRule
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// AddRule: Inserts a rule into a firewall policy.
-//
-// - firewallPolicy: Name of the firewall policy to update.
-// - project: Project ID for this request.
-func (r *NetworkFirewallPoliciesService) AddRule(project string, firewallPolicy string, firewallpolicyrule *FirewallPolicyRule) *NetworkFirewallPoliciesAddRuleCall {
- c := &NetworkFirewallPoliciesAddRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.firewallPolicy = firewallPolicy
- c.firewallpolicyrule = firewallpolicyrule
- return c
-}
-
-// MaxPriority sets the optional parameter "maxPriority": When
-// rule.priority is not specified, auto choose a unused priority between
-// minPriority and maxPriority>. This field is exclusive with
-// rule.priority.
-func (c *NetworkFirewallPoliciesAddRuleCall) MaxPriority(maxPriority int64) *NetworkFirewallPoliciesAddRuleCall {
- c.urlParams_.Set("maxPriority", fmt.Sprint(maxPriority))
- return c
-}
-
-// MinPriority sets the optional parameter "minPriority": When
-// rule.priority is not specified, auto choose a unused priority between
-// minPriority and maxPriority>. This field is exclusive with
-// rule.priority.
-func (c *NetworkFirewallPoliciesAddRuleCall) MinPriority(minPriority int64) *NetworkFirewallPoliciesAddRuleCall {
- c.urlParams_.Set("minPriority", fmt.Sprint(minPriority))
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *NetworkFirewallPoliciesAddRuleCall) RequestId(requestId string) *NetworkFirewallPoliciesAddRuleCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *NetworkFirewallPoliciesAddRuleCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesAddRuleCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NetworkFirewallPoliciesAddRuleCall) Context(ctx context.Context) *NetworkFirewallPoliciesAddRuleCall {
- 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 *NetworkFirewallPoliciesAddRuleCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworkFirewallPoliciesAddRuleCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyrule)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/addRule")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "firewallPolicy": c.firewallPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networkFirewallPolicies.addRule" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *NetworkFirewallPoliciesAddRuleCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Inserts a rule into a firewall policy.",
- // "flatPath": "projects/{project}/global/firewallPolicies/{firewallPolicy}/addRule",
- // "httpMethod": "POST",
- // "id": "compute.networkFirewallPolicies.addRule",
- // "parameterOrder": [
- // "project",
- // "firewallPolicy"
- // ],
- // "parameters": {
- // "firewallPolicy": {
- // "description": "Name of the firewall policy to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "maxPriority": {
- // "description": "When rule.priority is not specified, auto choose a unused priority between minPriority and maxPriority\u003e. This field is exclusive with rule.priority.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "minPriority": {
- // "description": "When rule.priority is not specified, auto choose a unused priority between minPriority and maxPriority\u003e. This field is exclusive with rule.priority.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/firewallPolicies/{firewallPolicy}/addRule",
- // "request": {
- // "$ref": "FirewallPolicyRule"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.networkFirewallPolicies.cloneRules":
-
-type NetworkFirewallPoliciesCloneRulesCall struct {
- s *Service
- project string
- firewallPolicy string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// CloneRules: Copies rules to the specified firewall policy.
-//
-// - firewallPolicy: Name of the firewall policy to update.
-// - project: Project ID for this request.
-func (r *NetworkFirewallPoliciesService) CloneRules(project string, firewallPolicy string) *NetworkFirewallPoliciesCloneRulesCall {
- c := &NetworkFirewallPoliciesCloneRulesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.firewallPolicy = firewallPolicy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *NetworkFirewallPoliciesCloneRulesCall) RequestId(requestId string) *NetworkFirewallPoliciesCloneRulesCall {
- c.urlParams_.Set("requestId", requestId)
- return c
-}
-
-// SourceFirewallPolicy sets the optional parameter
-// "sourceFirewallPolicy": The firewall policy from which to copy rules.
-func (c *NetworkFirewallPoliciesCloneRulesCall) SourceFirewallPolicy(sourceFirewallPolicy string) *NetworkFirewallPoliciesCloneRulesCall {
- c.urlParams_.Set("sourceFirewallPolicy", sourceFirewallPolicy)
- 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 *NetworkFirewallPoliciesCloneRulesCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesCloneRulesCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NetworkFirewallPoliciesCloneRulesCall) Context(ctx context.Context) *NetworkFirewallPoliciesCloneRulesCall {
- 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 *NetworkFirewallPoliciesCloneRulesCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworkFirewallPoliciesCloneRulesCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/cloneRules")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "firewallPolicy": c.firewallPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networkFirewallPolicies.cloneRules" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *NetworkFirewallPoliciesCloneRulesCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Copies rules to the specified firewall policy.",
- // "flatPath": "projects/{project}/global/firewallPolicies/{firewallPolicy}/cloneRules",
- // "httpMethod": "POST",
- // "id": "compute.networkFirewallPolicies.cloneRules",
- // "parameterOrder": [
- // "project",
- // "firewallPolicy"
- // ],
- // "parameters": {
- // "firewallPolicy": {
- // "description": "Name of the firewall policy to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "sourceFirewallPolicy": {
- // "description": "The firewall policy from which to copy rules.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/firewallPolicies/{firewallPolicy}/cloneRules",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.networkFirewallPolicies.delete":
-
-type NetworkFirewallPoliciesDeleteCall struct {
- s *Service
- project string
- firewallPolicy string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified policy.
-//
-// - firewallPolicy: Name of the firewall policy to delete.
-// - project: Project ID for this request.
-func (r *NetworkFirewallPoliciesService) Delete(project string, firewallPolicy string) *NetworkFirewallPoliciesDeleteCall {
- c := &NetworkFirewallPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.firewallPolicy = firewallPolicy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *NetworkFirewallPoliciesDeleteCall) RequestId(requestId string) *NetworkFirewallPoliciesDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *NetworkFirewallPoliciesDeleteCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NetworkFirewallPoliciesDeleteCall) Context(ctx context.Context) *NetworkFirewallPoliciesDeleteCall {
- 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 *NetworkFirewallPoliciesDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworkFirewallPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "firewallPolicy": c.firewallPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networkFirewallPolicies.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *NetworkFirewallPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified policy.",
- // "flatPath": "projects/{project}/global/firewallPolicies/{firewallPolicy}",
- // "httpMethod": "DELETE",
- // "id": "compute.networkFirewallPolicies.delete",
- // "parameterOrder": [
- // "project",
- // "firewallPolicy"
- // ],
- // "parameters": {
- // "firewallPolicy": {
- // "description": "Name of the firewall policy to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/firewallPolicies/{firewallPolicy}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.networkFirewallPolicies.get":
-
-type NetworkFirewallPoliciesGetCall struct {
- s *Service
- project string
- firewallPolicy string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified network firewall policy.
-//
-// - firewallPolicy: Name of the firewall policy to get.
-// - project: Project ID for this request.
-func (r *NetworkFirewallPoliciesService) Get(project string, firewallPolicy string) *NetworkFirewallPoliciesGetCall {
- c := &NetworkFirewallPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.firewallPolicy = firewallPolicy
- 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 *NetworkFirewallPoliciesGetCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesGetCall {
- 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 *NetworkFirewallPoliciesGetCall) IfNoneMatch(entityTag string) *NetworkFirewallPoliciesGetCall {
- 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 *NetworkFirewallPoliciesGetCall) Context(ctx context.Context) *NetworkFirewallPoliciesGetCall {
- 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 *NetworkFirewallPoliciesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworkFirewallPoliciesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/firewallPolicies/{firewallPolicy}")
- 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{
- "project": c.project,
- "firewallPolicy": c.firewallPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networkFirewallPolicies.get" call.
-// Exactly one of *FirewallPolicy or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *FirewallPolicy.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 *NetworkFirewallPoliciesGetCall) Do(opts ...googleapi.CallOption) (*FirewallPolicy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &FirewallPolicy{
- 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": "Returns the specified network firewall policy.",
- // "flatPath": "projects/{project}/global/firewallPolicies/{firewallPolicy}",
- // "httpMethod": "GET",
- // "id": "compute.networkFirewallPolicies.get",
- // "parameterOrder": [
- // "project",
- // "firewallPolicy"
- // ],
- // "parameters": {
- // "firewallPolicy": {
- // "description": "Name of the firewall policy to get.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/firewallPolicies/{firewallPolicy}",
- // "response": {
- // "$ref": "FirewallPolicy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.networkFirewallPolicies.getAssociation":
-
-type NetworkFirewallPoliciesGetAssociationCall struct {
- s *Service
- project string
- firewallPolicy string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetAssociation: Gets an association with the specified name.
-//
-// - firewallPolicy: Name of the firewall policy to which the queried
-// association belongs.
-// - project: Project ID for this request.
-func (r *NetworkFirewallPoliciesService) GetAssociation(project string, firewallPolicy string) *NetworkFirewallPoliciesGetAssociationCall {
- c := &NetworkFirewallPoliciesGetAssociationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.firewallPolicy = firewallPolicy
- return c
-}
-
-// Name sets the optional parameter "name": The name of the association
-// to get from the firewall policy.
-func (c *NetworkFirewallPoliciesGetAssociationCall) Name(name string) *NetworkFirewallPoliciesGetAssociationCall {
- c.urlParams_.Set("name", name)
- 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 *NetworkFirewallPoliciesGetAssociationCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesGetAssociationCall {
- 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 *NetworkFirewallPoliciesGetAssociationCall) IfNoneMatch(entityTag string) *NetworkFirewallPoliciesGetAssociationCall {
- 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 *NetworkFirewallPoliciesGetAssociationCall) Context(ctx context.Context) *NetworkFirewallPoliciesGetAssociationCall {
- 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 *NetworkFirewallPoliciesGetAssociationCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworkFirewallPoliciesGetAssociationCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/firewallPolicies/{firewallPolicy}/getAssociation")
- 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{
- "project": c.project,
- "firewallPolicy": c.firewallPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networkFirewallPolicies.getAssociation" call.
-// Exactly one of *FirewallPolicyAssociation or error will be non-nil.
-// Any non-2xx status code is an error. Response headers are in either
-// *FirewallPolicyAssociation.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 *NetworkFirewallPoliciesGetAssociationCall) Do(opts ...googleapi.CallOption) (*FirewallPolicyAssociation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &FirewallPolicyAssociation{
- 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": "Gets an association with the specified name.",
- // "flatPath": "projects/{project}/global/firewallPolicies/{firewallPolicy}/getAssociation",
- // "httpMethod": "GET",
- // "id": "compute.networkFirewallPolicies.getAssociation",
- // "parameterOrder": [
- // "project",
- // "firewallPolicy"
- // ],
- // "parameters": {
- // "firewallPolicy": {
- // "description": "Name of the firewall policy to which the queried association belongs.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "name": {
- // "description": "The name of the association to get from the firewall policy.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/firewallPolicies/{firewallPolicy}/getAssociation",
- // "response": {
- // "$ref": "FirewallPolicyAssociation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.networkFirewallPolicies.getIamPolicy":
-
-type NetworkFirewallPoliciesGetIamPolicyCall struct {
- s *Service
- project string
- resource string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetIamPolicy: Gets the access control policy for a resource. May be
-// empty if no such policy or resource exists.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-func (r *NetworkFirewallPoliciesService) GetIamPolicy(project string, resource string) *NetworkFirewallPoliciesGetIamPolicyCall {
- c := &NetworkFirewallPoliciesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.resource = resource
- return c
-}
-
-// OptionsRequestedPolicyVersion sets the optional parameter
-// "optionsRequestedPolicyVersion": Requested IAM Policy version.
-func (c *NetworkFirewallPoliciesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *NetworkFirewallPoliciesGetIamPolicyCall {
- c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
- 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 *NetworkFirewallPoliciesGetIamPolicyCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesGetIamPolicyCall {
- 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 *NetworkFirewallPoliciesGetIamPolicyCall) IfNoneMatch(entityTag string) *NetworkFirewallPoliciesGetIamPolicyCall {
- 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 *NetworkFirewallPoliciesGetIamPolicyCall) Context(ctx context.Context) *NetworkFirewallPoliciesGetIamPolicyCall {
- 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 *NetworkFirewallPoliciesGetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworkFirewallPoliciesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/firewallPolicies/{resource}/getIamPolicy")
- 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{
- "project": c.project,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networkFirewallPolicies.getIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *NetworkFirewallPoliciesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
- // "flatPath": "projects/{project}/global/firewallPolicies/{resource}/getIamPolicy",
- // "httpMethod": "GET",
- // "id": "compute.networkFirewallPolicies.getIamPolicy",
- // "parameterOrder": [
- // "project",
- // "resource"
- // ],
- // "parameters": {
- // "optionsRequestedPolicyVersion": {
- // "description": "Requested IAM Policy version.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/firewallPolicies/{resource}/getIamPolicy",
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.networkFirewallPolicies.getRule":
-
-type NetworkFirewallPoliciesGetRuleCall struct {
- s *Service
- project string
- firewallPolicy string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetRule: Gets a rule of the specified priority.
-//
-// - firewallPolicy: Name of the firewall policy to which the queried
-// rule belongs.
-// - project: Project ID for this request.
-func (r *NetworkFirewallPoliciesService) GetRule(project string, firewallPolicy string) *NetworkFirewallPoliciesGetRuleCall {
- c := &NetworkFirewallPoliciesGetRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.firewallPolicy = firewallPolicy
- return c
-}
-
-// Priority sets the optional parameter "priority": The priority of the
-// rule to get from the firewall policy.
-func (c *NetworkFirewallPoliciesGetRuleCall) Priority(priority int64) *NetworkFirewallPoliciesGetRuleCall {
- c.urlParams_.Set("priority", fmt.Sprint(priority))
- 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 *NetworkFirewallPoliciesGetRuleCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesGetRuleCall {
- 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 *NetworkFirewallPoliciesGetRuleCall) IfNoneMatch(entityTag string) *NetworkFirewallPoliciesGetRuleCall {
- 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 *NetworkFirewallPoliciesGetRuleCall) Context(ctx context.Context) *NetworkFirewallPoliciesGetRuleCall {
- 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 *NetworkFirewallPoliciesGetRuleCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworkFirewallPoliciesGetRuleCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/firewallPolicies/{firewallPolicy}/getRule")
- 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{
- "project": c.project,
- "firewallPolicy": c.firewallPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networkFirewallPolicies.getRule" call.
-// Exactly one of *FirewallPolicyRule or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *FirewallPolicyRule.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 *NetworkFirewallPoliciesGetRuleCall) Do(opts ...googleapi.CallOption) (*FirewallPolicyRule, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &FirewallPolicyRule{
- 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": "Gets a rule of the specified priority.",
- // "flatPath": "projects/{project}/global/firewallPolicies/{firewallPolicy}/getRule",
- // "httpMethod": "GET",
- // "id": "compute.networkFirewallPolicies.getRule",
- // "parameterOrder": [
- // "project",
- // "firewallPolicy"
- // ],
- // "parameters": {
- // "firewallPolicy": {
- // "description": "Name of the firewall policy to which the queried rule belongs.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "priority": {
- // "description": "The priority of the rule to get from the firewall policy.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/firewallPolicies/{firewallPolicy}/getRule",
- // "response": {
- // "$ref": "FirewallPolicyRule"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.networkFirewallPolicies.insert":
-
-type NetworkFirewallPoliciesInsertCall struct {
- s *Service
- project string
- firewallpolicy *FirewallPolicy
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a new policy in the specified project using the data
-// included in the request.
-//
-// - project: Project ID for this request.
-func (r *NetworkFirewallPoliciesService) Insert(project string, firewallpolicy *FirewallPolicy) *NetworkFirewallPoliciesInsertCall {
- c := &NetworkFirewallPoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.firewallpolicy = firewallpolicy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *NetworkFirewallPoliciesInsertCall) RequestId(requestId string) *NetworkFirewallPoliciesInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *NetworkFirewallPoliciesInsertCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NetworkFirewallPoliciesInsertCall) Context(ctx context.Context) *NetworkFirewallPoliciesInsertCall {
- 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 *NetworkFirewallPoliciesInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworkFirewallPoliciesInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicy)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networkFirewallPolicies.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *NetworkFirewallPoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a new policy in the specified project using the data included in the request.",
- // "flatPath": "projects/{project}/global/firewallPolicies",
- // "httpMethod": "POST",
- // "id": "compute.networkFirewallPolicies.insert",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/firewallPolicies",
- // "request": {
- // "$ref": "FirewallPolicy"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.networkFirewallPolicies.list":
-
-type NetworkFirewallPoliciesListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Lists all the policies that have been configured for the
-// specified project.
-//
-// - project: Project ID for this request.
-func (r *NetworkFirewallPoliciesService) List(project string) *NetworkFirewallPoliciesListCall {
- c := &NetworkFirewallPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *NetworkFirewallPoliciesListCall) Filter(filter string) *NetworkFirewallPoliciesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *NetworkFirewallPoliciesListCall) MaxResults(maxResults int64) *NetworkFirewallPoliciesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *NetworkFirewallPoliciesListCall) OrderBy(orderBy string) *NetworkFirewallPoliciesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *NetworkFirewallPoliciesListCall) PageToken(pageToken string) *NetworkFirewallPoliciesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *NetworkFirewallPoliciesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *NetworkFirewallPoliciesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *NetworkFirewallPoliciesListCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesListCall {
- 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 *NetworkFirewallPoliciesListCall) IfNoneMatch(entityTag string) *NetworkFirewallPoliciesListCall {
- 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 *NetworkFirewallPoliciesListCall) Context(ctx context.Context) *NetworkFirewallPoliciesListCall {
- 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 *NetworkFirewallPoliciesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworkFirewallPoliciesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/firewallPolicies")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networkFirewallPolicies.list" call.
-// Exactly one of *FirewallPolicyList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *FirewallPolicyList.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 *NetworkFirewallPoliciesListCall) Do(opts ...googleapi.CallOption) (*FirewallPolicyList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &FirewallPolicyList{
- 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": "Lists all the policies that have been configured for the specified project.",
- // "flatPath": "projects/{project}/global/firewallPolicies",
- // "httpMethod": "GET",
- // "id": "compute.networkFirewallPolicies.list",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/firewallPolicies",
- // "response": {
- // "$ref": "FirewallPolicyList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *NetworkFirewallPoliciesListCall) Pages(ctx context.Context, f func(*FirewallPolicyList) 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 "compute.networkFirewallPolicies.patch":
-
-type NetworkFirewallPoliciesPatchCall struct {
- s *Service
- project string
- firewallPolicy string
- firewallpolicy *FirewallPolicy
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Patches the specified policy with the data included in the
-// request.
-//
-// - firewallPolicy: Name of the firewall policy to update.
-// - project: Project ID for this request.
-func (r *NetworkFirewallPoliciesService) Patch(project string, firewallPolicy string, firewallpolicy *FirewallPolicy) *NetworkFirewallPoliciesPatchCall {
- c := &NetworkFirewallPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.firewallPolicy = firewallPolicy
- c.firewallpolicy = firewallpolicy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *NetworkFirewallPoliciesPatchCall) RequestId(requestId string) *NetworkFirewallPoliciesPatchCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *NetworkFirewallPoliciesPatchCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NetworkFirewallPoliciesPatchCall) Context(ctx context.Context) *NetworkFirewallPoliciesPatchCall {
- 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 *NetworkFirewallPoliciesPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworkFirewallPoliciesPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicy)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "firewallPolicy": c.firewallPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networkFirewallPolicies.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *NetworkFirewallPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Patches the specified policy with the data included in the request.",
- // "flatPath": "projects/{project}/global/firewallPolicies/{firewallPolicy}",
- // "httpMethod": "PATCH",
- // "id": "compute.networkFirewallPolicies.patch",
- // "parameterOrder": [
- // "project",
- // "firewallPolicy"
- // ],
- // "parameters": {
- // "firewallPolicy": {
- // "description": "Name of the firewall policy to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/firewallPolicies/{firewallPolicy}",
- // "request": {
- // "$ref": "FirewallPolicy"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.networkFirewallPolicies.patchRule":
-
-type NetworkFirewallPoliciesPatchRuleCall struct {
- s *Service
- project string
- firewallPolicy string
- firewallpolicyrule *FirewallPolicyRule
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// PatchRule: Patches a rule of the specified priority.
-//
-// - firewallPolicy: Name of the firewall policy to update.
-// - project: Project ID for this request.
-func (r *NetworkFirewallPoliciesService) PatchRule(project string, firewallPolicy string, firewallpolicyrule *FirewallPolicyRule) *NetworkFirewallPoliciesPatchRuleCall {
- c := &NetworkFirewallPoliciesPatchRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.firewallPolicy = firewallPolicy
- c.firewallpolicyrule = firewallpolicyrule
- return c
-}
-
-// Priority sets the optional parameter "priority": The priority of the
-// rule to patch.
-func (c *NetworkFirewallPoliciesPatchRuleCall) Priority(priority int64) *NetworkFirewallPoliciesPatchRuleCall {
- c.urlParams_.Set("priority", fmt.Sprint(priority))
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *NetworkFirewallPoliciesPatchRuleCall) RequestId(requestId string) *NetworkFirewallPoliciesPatchRuleCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *NetworkFirewallPoliciesPatchRuleCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesPatchRuleCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NetworkFirewallPoliciesPatchRuleCall) Context(ctx context.Context) *NetworkFirewallPoliciesPatchRuleCall {
- 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 *NetworkFirewallPoliciesPatchRuleCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworkFirewallPoliciesPatchRuleCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyrule)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/patchRule")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "firewallPolicy": c.firewallPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networkFirewallPolicies.patchRule" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *NetworkFirewallPoliciesPatchRuleCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Patches a rule of the specified priority.",
- // "flatPath": "projects/{project}/global/firewallPolicies/{firewallPolicy}/patchRule",
- // "httpMethod": "POST",
- // "id": "compute.networkFirewallPolicies.patchRule",
- // "parameterOrder": [
- // "project",
- // "firewallPolicy"
- // ],
- // "parameters": {
- // "firewallPolicy": {
- // "description": "Name of the firewall policy to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "priority": {
- // "description": "The priority of the rule to patch.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/firewallPolicies/{firewallPolicy}/patchRule",
- // "request": {
- // "$ref": "FirewallPolicyRule"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.networkFirewallPolicies.removeAssociation":
-
-type NetworkFirewallPoliciesRemoveAssociationCall struct {
- s *Service
- project string
- firewallPolicy string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// RemoveAssociation: Removes an association for the specified firewall
-// policy.
-//
-// - firewallPolicy: Name of the firewall policy to update.
-// - project: Project ID for this request.
-func (r *NetworkFirewallPoliciesService) RemoveAssociation(project string, firewallPolicy string) *NetworkFirewallPoliciesRemoveAssociationCall {
- c := &NetworkFirewallPoliciesRemoveAssociationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.firewallPolicy = firewallPolicy
- return c
-}
-
-// Name sets the optional parameter "name": Name for the attachment that
-// will be removed.
-func (c *NetworkFirewallPoliciesRemoveAssociationCall) Name(name string) *NetworkFirewallPoliciesRemoveAssociationCall {
- c.urlParams_.Set("name", name)
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *NetworkFirewallPoliciesRemoveAssociationCall) RequestId(requestId string) *NetworkFirewallPoliciesRemoveAssociationCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *NetworkFirewallPoliciesRemoveAssociationCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesRemoveAssociationCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NetworkFirewallPoliciesRemoveAssociationCall) Context(ctx context.Context) *NetworkFirewallPoliciesRemoveAssociationCall {
- 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 *NetworkFirewallPoliciesRemoveAssociationCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworkFirewallPoliciesRemoveAssociationCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/removeAssociation")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "firewallPolicy": c.firewallPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networkFirewallPolicies.removeAssociation" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *NetworkFirewallPoliciesRemoveAssociationCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Removes an association for the specified firewall policy.",
- // "flatPath": "projects/{project}/global/firewallPolicies/{firewallPolicy}/removeAssociation",
- // "httpMethod": "POST",
- // "id": "compute.networkFirewallPolicies.removeAssociation",
- // "parameterOrder": [
- // "project",
- // "firewallPolicy"
- // ],
- // "parameters": {
- // "firewallPolicy": {
- // "description": "Name of the firewall policy to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "name": {
- // "description": "Name for the attachment that will be removed.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/firewallPolicies/{firewallPolicy}/removeAssociation",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.networkFirewallPolicies.removeRule":
-
-type NetworkFirewallPoliciesRemoveRuleCall struct {
- s *Service
- project string
- firewallPolicy string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// RemoveRule: Deletes a rule of the specified priority.
-//
-// - firewallPolicy: Name of the firewall policy to update.
-// - project: Project ID for this request.
-func (r *NetworkFirewallPoliciesService) RemoveRule(project string, firewallPolicy string) *NetworkFirewallPoliciesRemoveRuleCall {
- c := &NetworkFirewallPoliciesRemoveRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.firewallPolicy = firewallPolicy
- return c
-}
-
-// Priority sets the optional parameter "priority": The priority of the
-// rule to remove from the firewall policy.
-func (c *NetworkFirewallPoliciesRemoveRuleCall) Priority(priority int64) *NetworkFirewallPoliciesRemoveRuleCall {
- c.urlParams_.Set("priority", fmt.Sprint(priority))
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *NetworkFirewallPoliciesRemoveRuleCall) RequestId(requestId string) *NetworkFirewallPoliciesRemoveRuleCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *NetworkFirewallPoliciesRemoveRuleCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesRemoveRuleCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NetworkFirewallPoliciesRemoveRuleCall) Context(ctx context.Context) *NetworkFirewallPoliciesRemoveRuleCall {
- 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 *NetworkFirewallPoliciesRemoveRuleCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworkFirewallPoliciesRemoveRuleCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/removeRule")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "firewallPolicy": c.firewallPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networkFirewallPolicies.removeRule" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *NetworkFirewallPoliciesRemoveRuleCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes a rule of the specified priority.",
- // "flatPath": "projects/{project}/global/firewallPolicies/{firewallPolicy}/removeRule",
- // "httpMethod": "POST",
- // "id": "compute.networkFirewallPolicies.removeRule",
- // "parameterOrder": [
- // "project",
- // "firewallPolicy"
- // ],
- // "parameters": {
- // "firewallPolicy": {
- // "description": "Name of the firewall policy to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "priority": {
- // "description": "The priority of the rule to remove from the firewall policy.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/firewallPolicies/{firewallPolicy}/removeRule",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.networkFirewallPolicies.setIamPolicy":
-
-type NetworkFirewallPoliciesSetIamPolicyCall struct {
- s *Service
- project string
- resource string
- globalsetpolicyrequest *GlobalSetPolicyRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetIamPolicy: Sets the access control policy on the specified
-// resource. Replaces any existing policy.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-func (r *NetworkFirewallPoliciesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *NetworkFirewallPoliciesSetIamPolicyCall {
- c := &NetworkFirewallPoliciesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.resource = resource
- c.globalsetpolicyrequest = globalsetpolicyrequest
- 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 *NetworkFirewallPoliciesSetIamPolicyCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesSetIamPolicyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NetworkFirewallPoliciesSetIamPolicyCall) Context(ctx context.Context) *NetworkFirewallPoliciesSetIamPolicyCall {
- 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 *NetworkFirewallPoliciesSetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworkFirewallPoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{resource}/setIamPolicy")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networkFirewallPolicies.setIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *NetworkFirewallPoliciesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Sets the access control policy on the specified resource. Replaces any existing policy.",
- // "flatPath": "projects/{project}/global/firewallPolicies/{resource}/setIamPolicy",
- // "httpMethod": "POST",
- // "id": "compute.networkFirewallPolicies.setIamPolicy",
- // "parameterOrder": [
- // "project",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/firewallPolicies/{resource}/setIamPolicy",
- // "request": {
- // "$ref": "GlobalSetPolicyRequest"
- // },
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.networkFirewallPolicies.testIamPermissions":
-
-type NetworkFirewallPoliciesTestIamPermissionsCall struct {
- s *Service
- project string
- resource string
- testpermissionsrequest *TestPermissionsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// TestIamPermissions: Returns permissions that a caller has on the
-// specified resource.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-func (r *NetworkFirewallPoliciesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *NetworkFirewallPoliciesTestIamPermissionsCall {
- c := &NetworkFirewallPoliciesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.resource = resource
- c.testpermissionsrequest = testpermissionsrequest
- 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 *NetworkFirewallPoliciesTestIamPermissionsCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesTestIamPermissionsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NetworkFirewallPoliciesTestIamPermissionsCall) Context(ctx context.Context) *NetworkFirewallPoliciesTestIamPermissionsCall {
- 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 *NetworkFirewallPoliciesTestIamPermissionsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworkFirewallPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{resource}/testIamPermissions")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networkFirewallPolicies.testIamPermissions" call.
-// Exactly one of *TestPermissionsResponse or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *TestPermissionsResponse.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 *NetworkFirewallPoliciesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TestPermissionsResponse{
- 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": "Returns permissions that a caller has on the specified resource.",
- // "flatPath": "projects/{project}/global/firewallPolicies/{resource}/testIamPermissions",
- // "httpMethod": "POST",
- // "id": "compute.networkFirewallPolicies.testIamPermissions",
- // "parameterOrder": [
- // "project",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/firewallPolicies/{resource}/testIamPermissions",
- // "request": {
- // "$ref": "TestPermissionsRequest"
- // },
- // "response": {
- // "$ref": "TestPermissionsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.networks.addPeering":
-
-type NetworksAddPeeringCall struct {
- s *Service
- project string
- network string
- networksaddpeeringrequest *NetworksAddPeeringRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// AddPeering: Adds a peering to the specified network.
-//
-// - network: Name of the network resource to add peering to.
-// - project: Project ID for this request.
-func (r *NetworksService) AddPeering(project string, network string, networksaddpeeringrequest *NetworksAddPeeringRequest) *NetworksAddPeeringCall {
- c := &NetworksAddPeeringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.network = network
- c.networksaddpeeringrequest = networksaddpeeringrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *NetworksAddPeeringCall) RequestId(requestId string) *NetworksAddPeeringCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *NetworksAddPeeringCall) Fields(s ...googleapi.Field) *NetworksAddPeeringCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NetworksAddPeeringCall) Context(ctx context.Context) *NetworksAddPeeringCall {
- 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 *NetworksAddPeeringCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworksAddPeeringCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksaddpeeringrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks/{network}/addPeering")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "network": c.network,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networks.addPeering" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *NetworksAddPeeringCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Adds a peering to the specified network.",
- // "flatPath": "projects/{project}/global/networks/{network}/addPeering",
- // "httpMethod": "POST",
- // "id": "compute.networks.addPeering",
- // "parameterOrder": [
- // "project",
- // "network"
- // ],
- // "parameters": {
- // "network": {
- // "description": "Name of the network resource to add peering to.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/networks/{network}/addPeering",
- // "request": {
- // "$ref": "NetworksAddPeeringRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.networks.delete":
-
-type NetworksDeleteCall struct {
- s *Service
- project string
- network string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified network.
-//
-// - network: Name of the network to delete.
-// - project: Project ID for this request.
-func (r *NetworksService) Delete(project string, network string) *NetworksDeleteCall {
- c := &NetworksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.network = network
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *NetworksDeleteCall) RequestId(requestId string) *NetworksDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *NetworksDeleteCall) Fields(s ...googleapi.Field) *NetworksDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NetworksDeleteCall) Context(ctx context.Context) *NetworksDeleteCall {
- 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 *NetworksDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworksDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks/{network}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "network": c.network,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networks.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *NetworksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified network.",
- // "flatPath": "projects/{project}/global/networks/{network}",
- // "httpMethod": "DELETE",
- // "id": "compute.networks.delete",
- // "parameterOrder": [
- // "project",
- // "network"
- // ],
- // "parameters": {
- // "network": {
- // "description": "Name of the network to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/networks/{network}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.networks.get":
-
-type NetworksGetCall struct {
- s *Service
- project string
- network string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified network.
-//
-// - network: Name of the network to return.
-// - project: Project ID for this request.
-func (r *NetworksService) Get(project string, network string) *NetworksGetCall {
- c := &NetworksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.network = network
- 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 *NetworksGetCall) Fields(s ...googleapi.Field) *NetworksGetCall {
- 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 *NetworksGetCall) IfNoneMatch(entityTag string) *NetworksGetCall {
- 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 *NetworksGetCall) Context(ctx context.Context) *NetworksGetCall {
- 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 *NetworksGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworksGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/networks/{network}")
- 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{
- "project": c.project,
- "network": c.network,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networks.get" call.
-// Exactly one of *Network or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Network.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 *NetworksGetCall) Do(opts ...googleapi.CallOption) (*Network, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Network{
- 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": "Returns the specified network.",
- // "flatPath": "projects/{project}/global/networks/{network}",
- // "httpMethod": "GET",
- // "id": "compute.networks.get",
- // "parameterOrder": [
- // "project",
- // "network"
- // ],
- // "parameters": {
- // "network": {
- // "description": "Name of the network to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/networks/{network}",
- // "response": {
- // "$ref": "Network"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.networks.getEffectiveFirewalls":
-
-type NetworksGetEffectiveFirewallsCall struct {
- s *Service
- project string
- network string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetEffectiveFirewalls: Returns the effective firewalls on a given
-// network.
-//
-// - network: Name of the network for this request.
-// - project: Project ID for this request.
-func (r *NetworksService) GetEffectiveFirewalls(project string, network string) *NetworksGetEffectiveFirewallsCall {
- c := &NetworksGetEffectiveFirewallsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.network = network
- 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 *NetworksGetEffectiveFirewallsCall) Fields(s ...googleapi.Field) *NetworksGetEffectiveFirewallsCall {
- 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 *NetworksGetEffectiveFirewallsCall) IfNoneMatch(entityTag string) *NetworksGetEffectiveFirewallsCall {
- 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 *NetworksGetEffectiveFirewallsCall) Context(ctx context.Context) *NetworksGetEffectiveFirewallsCall {
- 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 *NetworksGetEffectiveFirewallsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworksGetEffectiveFirewallsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/networks/{network}/getEffectiveFirewalls")
- 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{
- "project": c.project,
- "network": c.network,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networks.getEffectiveFirewalls" call.
-// Exactly one of *NetworksGetEffectiveFirewallsResponse or error will
-// be non-nil. Any non-2xx status code is an error. Response headers are
-// in either
-// *NetworksGetEffectiveFirewallsResponse.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 *NetworksGetEffectiveFirewallsCall) Do(opts ...googleapi.CallOption) (*NetworksGetEffectiveFirewallsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &NetworksGetEffectiveFirewallsResponse{
- 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": "Returns the effective firewalls on a given network.",
- // "flatPath": "projects/{project}/global/networks/{network}/getEffectiveFirewalls",
- // "httpMethod": "GET",
- // "id": "compute.networks.getEffectiveFirewalls",
- // "parameterOrder": [
- // "project",
- // "network"
- // ],
- // "parameters": {
- // "network": {
- // "description": "Name of the network for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/networks/{network}/getEffectiveFirewalls",
- // "response": {
- // "$ref": "NetworksGetEffectiveFirewallsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.networks.insert":
-
-type NetworksInsertCall struct {
- s *Service
- project string
- network *Network
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a network in the specified project using the data
-// included in the request.
-//
-// - project: Project ID for this request.
-func (r *NetworksService) Insert(project string, network *Network) *NetworksInsertCall {
- c := &NetworksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.network = network
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *NetworksInsertCall) RequestId(requestId string) *NetworksInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *NetworksInsertCall) Fields(s ...googleapi.Field) *NetworksInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NetworksInsertCall) Context(ctx context.Context) *NetworksInsertCall {
- 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 *NetworksInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworksInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.network)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networks.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *NetworksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a network in the specified project using the data included in the request.",
- // "flatPath": "projects/{project}/global/networks",
- // "httpMethod": "POST",
- // "id": "compute.networks.insert",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/networks",
- // "request": {
- // "$ref": "Network"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.networks.list":
-
-type NetworksListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves the list of networks available to the specified
-// project.
-//
-// - project: Project ID for this request.
-func (r *NetworksService) List(project string) *NetworksListCall {
- c := &NetworksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *NetworksListCall) Filter(filter string) *NetworksListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *NetworksListCall) MaxResults(maxResults int64) *NetworksListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *NetworksListCall) OrderBy(orderBy string) *NetworksListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *NetworksListCall) PageToken(pageToken string) *NetworksListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *NetworksListCall) ReturnPartialSuccess(returnPartialSuccess bool) *NetworksListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *NetworksListCall) Fields(s ...googleapi.Field) *NetworksListCall {
- 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 *NetworksListCall) IfNoneMatch(entityTag string) *NetworksListCall {
- 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 *NetworksListCall) Context(ctx context.Context) *NetworksListCall {
- 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 *NetworksListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworksListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/networks")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networks.list" call.
-// Exactly one of *NetworkList or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *NetworkList.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 *NetworksListCall) Do(opts ...googleapi.CallOption) (*NetworkList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &NetworkList{
- 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": "Retrieves the list of networks available to the specified project.",
- // "flatPath": "projects/{project}/global/networks",
- // "httpMethod": "GET",
- // "id": "compute.networks.list",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/networks",
- // "response": {
- // "$ref": "NetworkList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *NetworksListCall) Pages(ctx context.Context, f func(*NetworkList) 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 "compute.networks.listPeeringRoutes":
-
-type NetworksListPeeringRoutesCall struct {
- s *Service
- project string
- network string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// ListPeeringRoutes: Lists the peering routes exchanged over peering
-// connection.
-//
-// - network: Name of the network for this request.
-// - project: Project ID for this request.
-func (r *NetworksService) ListPeeringRoutes(project string, network string) *NetworksListPeeringRoutesCall {
- c := &NetworksListPeeringRoutesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.network = network
- return c
-}
-
-// Direction sets the optional parameter "direction": The direction of
-// the exchanged routes.
-//
-// Possible values:
-//
-// "INCOMING" - For routes exported from peer network.
-// "OUTGOING" - For routes exported from local network.
-func (c *NetworksListPeeringRoutesCall) Direction(direction string) *NetworksListPeeringRoutesCall {
- c.urlParams_.Set("direction", direction)
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *NetworksListPeeringRoutesCall) Filter(filter string) *NetworksListPeeringRoutesCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *NetworksListPeeringRoutesCall) MaxResults(maxResults int64) *NetworksListPeeringRoutesCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *NetworksListPeeringRoutesCall) OrderBy(orderBy string) *NetworksListPeeringRoutesCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *NetworksListPeeringRoutesCall) PageToken(pageToken string) *NetworksListPeeringRoutesCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// PeeringName sets the optional parameter "peeringName": The response
-// will show routes exchanged over the given peering connection.
-func (c *NetworksListPeeringRoutesCall) PeeringName(peeringName string) *NetworksListPeeringRoutesCall {
- c.urlParams_.Set("peeringName", peeringName)
- return c
-}
-
-// Region sets the optional parameter "region": The region of the
-// request. The response will include all subnet routes, static routes
-// and dynamic routes in the region.
-func (c *NetworksListPeeringRoutesCall) Region(region string) *NetworksListPeeringRoutesCall {
- c.urlParams_.Set("region", region)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *NetworksListPeeringRoutesCall) ReturnPartialSuccess(returnPartialSuccess bool) *NetworksListPeeringRoutesCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *NetworksListPeeringRoutesCall) Fields(s ...googleapi.Field) *NetworksListPeeringRoutesCall {
- 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 *NetworksListPeeringRoutesCall) IfNoneMatch(entityTag string) *NetworksListPeeringRoutesCall {
- 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 *NetworksListPeeringRoutesCall) Context(ctx context.Context) *NetworksListPeeringRoutesCall {
- 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 *NetworksListPeeringRoutesCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworksListPeeringRoutesCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/networks/{network}/listPeeringRoutes")
- 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{
- "project": c.project,
- "network": c.network,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networks.listPeeringRoutes" call.
-// Exactly one of *ExchangedPeeringRoutesList or error will be non-nil.
-// Any non-2xx status code is an error. Response headers are in either
-// *ExchangedPeeringRoutesList.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 *NetworksListPeeringRoutesCall) Do(opts ...googleapi.CallOption) (*ExchangedPeeringRoutesList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &ExchangedPeeringRoutesList{
- 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": "Lists the peering routes exchanged over peering connection.",
- // "flatPath": "projects/{project}/global/networks/{network}/listPeeringRoutes",
- // "httpMethod": "GET",
- // "id": "compute.networks.listPeeringRoutes",
- // "parameterOrder": [
- // "project",
- // "network"
- // ],
- // "parameters": {
- // "direction": {
- // "description": "The direction of the exchanged routes.",
- // "enum": [
- // "INCOMING",
- // "OUTGOING"
- // ],
- // "enumDescriptions": [
- // "For routes exported from peer network.",
- // "For routes exported from local network."
- // ],
- // "location": "query",
- // "type": "string"
- // },
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "network": {
- // "description": "Name of the network for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "peeringName": {
- // "description": "The response will show routes exchanged over the given peering connection.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The region of the request. The response will include all subnet routes, static routes and dynamic routes in the region.",
- // "location": "query",
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/networks/{network}/listPeeringRoutes",
- // "response": {
- // "$ref": "ExchangedPeeringRoutesList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *NetworksListPeeringRoutesCall) Pages(ctx context.Context, f func(*ExchangedPeeringRoutesList) 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 "compute.networks.patch":
-
-type NetworksPatchCall struct {
- s *Service
- project string
- network string
- network2 *Network
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Patches the specified network with the data included in the
-// request. Only the following fields can be modified:
-// routingConfig.routingMode.
-//
-// - network: Name of the network to update.
-// - project: Project ID for this request.
-func (r *NetworksService) Patch(project string, network string, network2 *Network) *NetworksPatchCall {
- c := &NetworksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.network = network
- c.network2 = network2
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *NetworksPatchCall) RequestId(requestId string) *NetworksPatchCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *NetworksPatchCall) Fields(s ...googleapi.Field) *NetworksPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NetworksPatchCall) Context(ctx context.Context) *NetworksPatchCall {
- 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 *NetworksPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworksPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.network2)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks/{network}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "network": c.network,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networks.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *NetworksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Patches the specified network with the data included in the request. Only the following fields can be modified: routingConfig.routingMode.",
- // "flatPath": "projects/{project}/global/networks/{network}",
- // "httpMethod": "PATCH",
- // "id": "compute.networks.patch",
- // "parameterOrder": [
- // "project",
- // "network"
- // ],
- // "parameters": {
- // "network": {
- // "description": "Name of the network to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/networks/{network}",
- // "request": {
- // "$ref": "Network"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.networks.removePeering":
-
-type NetworksRemovePeeringCall struct {
- s *Service
- project string
- network string
- networksremovepeeringrequest *NetworksRemovePeeringRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// RemovePeering: Removes a peering from the specified network.
-//
-// - network: Name of the network resource to remove peering from.
-// - project: Project ID for this request.
-func (r *NetworksService) RemovePeering(project string, network string, networksremovepeeringrequest *NetworksRemovePeeringRequest) *NetworksRemovePeeringCall {
- c := &NetworksRemovePeeringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.network = network
- c.networksremovepeeringrequest = networksremovepeeringrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *NetworksRemovePeeringCall) RequestId(requestId string) *NetworksRemovePeeringCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *NetworksRemovePeeringCall) Fields(s ...googleapi.Field) *NetworksRemovePeeringCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NetworksRemovePeeringCall) Context(ctx context.Context) *NetworksRemovePeeringCall {
- 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 *NetworksRemovePeeringCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworksRemovePeeringCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksremovepeeringrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks/{network}/removePeering")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "network": c.network,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networks.removePeering" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *NetworksRemovePeeringCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Removes a peering from the specified network.",
- // "flatPath": "projects/{project}/global/networks/{network}/removePeering",
- // "httpMethod": "POST",
- // "id": "compute.networks.removePeering",
- // "parameterOrder": [
- // "project",
- // "network"
- // ],
- // "parameters": {
- // "network": {
- // "description": "Name of the network resource to remove peering from.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/networks/{network}/removePeering",
- // "request": {
- // "$ref": "NetworksRemovePeeringRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.networks.switchToCustomMode":
-
-type NetworksSwitchToCustomModeCall struct {
- s *Service
- project string
- network string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SwitchToCustomMode: Switches the network mode from auto subnet mode
-// to custom subnet mode.
-//
-// - network: Name of the network to be updated.
-// - project: Project ID for this request.
-func (r *NetworksService) SwitchToCustomMode(project string, network string) *NetworksSwitchToCustomModeCall {
- c := &NetworksSwitchToCustomModeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.network = network
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *NetworksSwitchToCustomModeCall) RequestId(requestId string) *NetworksSwitchToCustomModeCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *NetworksSwitchToCustomModeCall) Fields(s ...googleapi.Field) *NetworksSwitchToCustomModeCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NetworksSwitchToCustomModeCall) Context(ctx context.Context) *NetworksSwitchToCustomModeCall {
- 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 *NetworksSwitchToCustomModeCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworksSwitchToCustomModeCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks/{network}/switchToCustomMode")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "network": c.network,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networks.switchToCustomMode" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *NetworksSwitchToCustomModeCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Switches the network mode from auto subnet mode to custom subnet mode.",
- // "flatPath": "projects/{project}/global/networks/{network}/switchToCustomMode",
- // "httpMethod": "POST",
- // "id": "compute.networks.switchToCustomMode",
- // "parameterOrder": [
- // "project",
- // "network"
- // ],
- // "parameters": {
- // "network": {
- // "description": "Name of the network to be updated.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/networks/{network}/switchToCustomMode",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.networks.updatePeering":
-
-type NetworksUpdatePeeringCall struct {
- s *Service
- project string
- network string
- networksupdatepeeringrequest *NetworksUpdatePeeringRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// UpdatePeering: Updates the specified network peering with the data
-// included in the request. You can only modify the
-// NetworkPeering.export_custom_routes field and the
-// NetworkPeering.import_custom_routes field.
-//
-// - network: Name of the network resource which the updated peering is
-// belonging to.
-// - project: Project ID for this request.
-func (r *NetworksService) UpdatePeering(project string, network string, networksupdatepeeringrequest *NetworksUpdatePeeringRequest) *NetworksUpdatePeeringCall {
- c := &NetworksUpdatePeeringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.network = network
- c.networksupdatepeeringrequest = networksupdatepeeringrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *NetworksUpdatePeeringCall) RequestId(requestId string) *NetworksUpdatePeeringCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *NetworksUpdatePeeringCall) Fields(s ...googleapi.Field) *NetworksUpdatePeeringCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NetworksUpdatePeeringCall) Context(ctx context.Context) *NetworksUpdatePeeringCall {
- 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 *NetworksUpdatePeeringCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NetworksUpdatePeeringCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksupdatepeeringrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks/{network}/updatePeering")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "network": c.network,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.networks.updatePeering" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *NetworksUpdatePeeringCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Updates the specified network peering with the data included in the request. You can only modify the NetworkPeering.export_custom_routes field and the NetworkPeering.import_custom_routes field.",
- // "flatPath": "projects/{project}/global/networks/{network}/updatePeering",
- // "httpMethod": "PATCH",
- // "id": "compute.networks.updatePeering",
- // "parameterOrder": [
- // "project",
- // "network"
- // ],
- // "parameters": {
- // "network": {
- // "description": "Name of the network resource which the updated peering is belonging to.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/networks/{network}/updatePeering",
- // "request": {
- // "$ref": "NetworksUpdatePeeringRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.nodeGroups.addNodes":
-
-type NodeGroupsAddNodesCall struct {
- s *Service
- project string
- zone string
- nodeGroup string
- nodegroupsaddnodesrequest *NodeGroupsAddNodesRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// AddNodes: Adds specified number of nodes to the node group.
-//
-// - nodeGroup: Name of the NodeGroup resource.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *NodeGroupsService) AddNodes(project string, zone string, nodeGroup string, nodegroupsaddnodesrequest *NodeGroupsAddNodesRequest) *NodeGroupsAddNodesCall {
- c := &NodeGroupsAddNodesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.nodeGroup = nodeGroup
- c.nodegroupsaddnodesrequest = nodegroupsaddnodesrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *NodeGroupsAddNodesCall) RequestId(requestId string) *NodeGroupsAddNodesCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *NodeGroupsAddNodesCall) Fields(s ...googleapi.Field) *NodeGroupsAddNodesCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NodeGroupsAddNodesCall) Context(ctx context.Context) *NodeGroupsAddNodesCall {
- 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 *NodeGroupsAddNodesCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NodeGroupsAddNodesCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupsaddnodesrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}/addNodes")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "nodeGroup": c.nodeGroup,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.nodeGroups.addNodes" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *NodeGroupsAddNodesCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Adds specified number of nodes to the node group.",
- // "flatPath": "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}/addNodes",
- // "httpMethod": "POST",
- // "id": "compute.nodeGroups.addNodes",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "nodeGroup"
- // ],
- // "parameters": {
- // "nodeGroup": {
- // "description": "Name of the NodeGroup resource.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}/addNodes",
- // "request": {
- // "$ref": "NodeGroupsAddNodesRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.nodeGroups.aggregatedList":
-
-type NodeGroupsAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Retrieves an aggregated list of node groups. Note:
-// use nodeGroups.listNodes for more details about each group.
-//
-// - project: Project ID for this request.
-func (r *NodeGroupsService) AggregatedList(project string) *NodeGroupsAggregatedListCall {
- c := &NodeGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *NodeGroupsAggregatedListCall) Filter(filter string) *NodeGroupsAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *NodeGroupsAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *NodeGroupsAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *NodeGroupsAggregatedListCall) MaxResults(maxResults int64) *NodeGroupsAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *NodeGroupsAggregatedListCall) OrderBy(orderBy string) *NodeGroupsAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *NodeGroupsAggregatedListCall) PageToken(pageToken string) *NodeGroupsAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *NodeGroupsAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *NodeGroupsAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *NodeGroupsAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *NodeGroupsAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *NodeGroupsAggregatedListCall) Fields(s ...googleapi.Field) *NodeGroupsAggregatedListCall {
- 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 *NodeGroupsAggregatedListCall) IfNoneMatch(entityTag string) *NodeGroupsAggregatedListCall {
- 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 *NodeGroupsAggregatedListCall) Context(ctx context.Context) *NodeGroupsAggregatedListCall {
- 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 *NodeGroupsAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NodeGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/nodeGroups")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.nodeGroups.aggregatedList" call.
-// Exactly one of *NodeGroupAggregatedList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *NodeGroupAggregatedList.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 *NodeGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeGroupAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &NodeGroupAggregatedList{
- 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": "Retrieves an aggregated list of node groups. Note: use nodeGroups.listNodes for more details about each group.",
- // "flatPath": "projects/{project}/aggregated/nodeGroups",
- // "httpMethod": "GET",
- // "id": "compute.nodeGroups.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/nodeGroups",
- // "response": {
- // "$ref": "NodeGroupAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *NodeGroupsAggregatedListCall) Pages(ctx context.Context, f func(*NodeGroupAggregatedList) 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 "compute.nodeGroups.delete":
-
-type NodeGroupsDeleteCall struct {
- s *Service
- project string
- zone string
- nodeGroup string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified NodeGroup resource.
-//
-// - nodeGroup: Name of the NodeGroup resource to delete.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *NodeGroupsService) Delete(project string, zone string, nodeGroup string) *NodeGroupsDeleteCall {
- c := &NodeGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.nodeGroup = nodeGroup
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *NodeGroupsDeleteCall) RequestId(requestId string) *NodeGroupsDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *NodeGroupsDeleteCall) Fields(s ...googleapi.Field) *NodeGroupsDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NodeGroupsDeleteCall) Context(ctx context.Context) *NodeGroupsDeleteCall {
- 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 *NodeGroupsDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NodeGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "nodeGroup": c.nodeGroup,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.nodeGroups.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *NodeGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified NodeGroup resource.",
- // "flatPath": "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}",
- // "httpMethod": "DELETE",
- // "id": "compute.nodeGroups.delete",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "nodeGroup"
- // ],
- // "parameters": {
- // "nodeGroup": {
- // "description": "Name of the NodeGroup resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.nodeGroups.deleteNodes":
-
-type NodeGroupsDeleteNodesCall struct {
- s *Service
- project string
- zone string
- nodeGroup string
- nodegroupsdeletenodesrequest *NodeGroupsDeleteNodesRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// DeleteNodes: Deletes specified nodes from the node group.
-//
-// - nodeGroup: Name of the NodeGroup resource whose nodes will be
-// deleted.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *NodeGroupsService) DeleteNodes(project string, zone string, nodeGroup string, nodegroupsdeletenodesrequest *NodeGroupsDeleteNodesRequest) *NodeGroupsDeleteNodesCall {
- c := &NodeGroupsDeleteNodesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.nodeGroup = nodeGroup
- c.nodegroupsdeletenodesrequest = nodegroupsdeletenodesrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *NodeGroupsDeleteNodesCall) RequestId(requestId string) *NodeGroupsDeleteNodesCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *NodeGroupsDeleteNodesCall) Fields(s ...googleapi.Field) *NodeGroupsDeleteNodesCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NodeGroupsDeleteNodesCall) Context(ctx context.Context) *NodeGroupsDeleteNodesCall {
- 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 *NodeGroupsDeleteNodesCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NodeGroupsDeleteNodesCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupsdeletenodesrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}/deleteNodes")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "nodeGroup": c.nodeGroup,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.nodeGroups.deleteNodes" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *NodeGroupsDeleteNodesCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes specified nodes from the node group.",
- // "flatPath": "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}/deleteNodes",
- // "httpMethod": "POST",
- // "id": "compute.nodeGroups.deleteNodes",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "nodeGroup"
- // ],
- // "parameters": {
- // "nodeGroup": {
- // "description": "Name of the NodeGroup resource whose nodes will be deleted.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}/deleteNodes",
- // "request": {
- // "$ref": "NodeGroupsDeleteNodesRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.nodeGroups.get":
-
-type NodeGroupsGetCall struct {
- s *Service
- project string
- zone string
- nodeGroup string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified NodeGroup. Get a list of available
-// NodeGroups by making a list() request. Note: the "nodes" field should
-// not be used. Use nodeGroups.listNodes instead.
-//
-// - nodeGroup: Name of the node group to return.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *NodeGroupsService) Get(project string, zone string, nodeGroup string) *NodeGroupsGetCall {
- c := &NodeGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.nodeGroup = nodeGroup
- 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 *NodeGroupsGetCall) Fields(s ...googleapi.Field) *NodeGroupsGetCall {
- 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 *NodeGroupsGetCall) IfNoneMatch(entityTag string) *NodeGroupsGetCall {
- 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 *NodeGroupsGetCall) Context(ctx context.Context) *NodeGroupsGetCall {
- 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 *NodeGroupsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NodeGroupsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}")
- 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{
- "project": c.project,
- "zone": c.zone,
- "nodeGroup": c.nodeGroup,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.nodeGroups.get" call.
-// Exactly one of *NodeGroup or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *NodeGroup.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 *NodeGroupsGetCall) Do(opts ...googleapi.CallOption) (*NodeGroup, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &NodeGroup{
- 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": "Returns the specified NodeGroup. Get a list of available NodeGroups by making a list() request. Note: the \"nodes\" field should not be used. Use nodeGroups.listNodes instead.",
- // "flatPath": "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}",
- // "httpMethod": "GET",
- // "id": "compute.nodeGroups.get",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "nodeGroup"
- // ],
- // "parameters": {
- // "nodeGroup": {
- // "description": "Name of the node group to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}",
- // "response": {
- // "$ref": "NodeGroup"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.nodeGroups.getIamPolicy":
-
-type NodeGroupsGetIamPolicyCall struct {
- s *Service
- project string
- zone string
- resource string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetIamPolicy: Gets the access control policy for a resource. May be
-// empty if no such policy or resource exists.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-// - zone: The name of the zone for this request.
-func (r *NodeGroupsService) GetIamPolicy(project string, zone string, resource string) *NodeGroupsGetIamPolicyCall {
- c := &NodeGroupsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.resource = resource
- return c
-}
-
-// OptionsRequestedPolicyVersion sets the optional parameter
-// "optionsRequestedPolicyVersion": Requested IAM Policy version.
-func (c *NodeGroupsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *NodeGroupsGetIamPolicyCall {
- c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
- 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 *NodeGroupsGetIamPolicyCall) Fields(s ...googleapi.Field) *NodeGroupsGetIamPolicyCall {
- 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 *NodeGroupsGetIamPolicyCall) IfNoneMatch(entityTag string) *NodeGroupsGetIamPolicyCall {
- 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 *NodeGroupsGetIamPolicyCall) Context(ctx context.Context) *NodeGroupsGetIamPolicyCall {
- 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 *NodeGroupsGetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NodeGroupsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}/nodeGroups/{resource}/getIamPolicy")
- 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{
- "project": c.project,
- "zone": c.zone,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.nodeGroups.getIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *NodeGroupsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
- // "flatPath": "projects/{project}/zones/{zone}/nodeGroups/{resource}/getIamPolicy",
- // "httpMethod": "GET",
- // "id": "compute.nodeGroups.getIamPolicy",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "resource"
- // ],
- // "parameters": {
- // "optionsRequestedPolicyVersion": {
- // "description": "Requested IAM Policy version.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/nodeGroups/{resource}/getIamPolicy",
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.nodeGroups.insert":
-
-type NodeGroupsInsertCall struct {
- s *Service
- project string
- zone string
- nodegroup *NodeGroup
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a NodeGroup resource in the specified project using
-// the data included in the request.
-//
-// - initialNodeCount: Initial count of nodes in the node group.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *NodeGroupsService) Insert(project string, zone string, initialNodeCount int64, nodegroup *NodeGroup) *NodeGroupsInsertCall {
- c := &NodeGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.urlParams_.Set("initialNodeCount", fmt.Sprint(initialNodeCount))
- c.nodegroup = nodegroup
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *NodeGroupsInsertCall) RequestId(requestId string) *NodeGroupsInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *NodeGroupsInsertCall) Fields(s ...googleapi.Field) *NodeGroupsInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NodeGroupsInsertCall) Context(ctx context.Context) *NodeGroupsInsertCall {
- 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 *NodeGroupsInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NodeGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroup)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.nodeGroups.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *NodeGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a NodeGroup resource in the specified project using the data included in the request.",
- // "flatPath": "projects/{project}/zones/{zone}/nodeGroups",
- // "httpMethod": "POST",
- // "id": "compute.nodeGroups.insert",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "initialNodeCount"
- // ],
- // "parameters": {
- // "initialNodeCount": {
- // "description": "Initial count of nodes in the node group.",
- // "format": "int32",
- // "location": "query",
- // "required": true,
- // "type": "integer"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/nodeGroups",
- // "request": {
- // "$ref": "NodeGroup"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.nodeGroups.list":
-
-type NodeGroupsListCall struct {
- s *Service
- project string
- zone string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves a list of node groups available to the specified
-// project. Note: use nodeGroups.listNodes for more details about each
-// group.
-//
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *NodeGroupsService) List(project string, zone string) *NodeGroupsListCall {
- c := &NodeGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *NodeGroupsListCall) Filter(filter string) *NodeGroupsListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *NodeGroupsListCall) MaxResults(maxResults int64) *NodeGroupsListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *NodeGroupsListCall) OrderBy(orderBy string) *NodeGroupsListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *NodeGroupsListCall) PageToken(pageToken string) *NodeGroupsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *NodeGroupsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *NodeGroupsListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *NodeGroupsListCall) Fields(s ...googleapi.Field) *NodeGroupsListCall {
- 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 *NodeGroupsListCall) IfNoneMatch(entityTag string) *NodeGroupsListCall {
- 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 *NodeGroupsListCall) Context(ctx context.Context) *NodeGroupsListCall {
- 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 *NodeGroupsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NodeGroupsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}/nodeGroups")
- 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{
- "project": c.project,
- "zone": c.zone,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.nodeGroups.list" call.
-// Exactly one of *NodeGroupList or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *NodeGroupList.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 *NodeGroupsListCall) Do(opts ...googleapi.CallOption) (*NodeGroupList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &NodeGroupList{
- 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": "Retrieves a list of node groups available to the specified project. Note: use nodeGroups.listNodes for more details about each group.",
- // "flatPath": "projects/{project}/zones/{zone}/nodeGroups",
- // "httpMethod": "GET",
- // "id": "compute.nodeGroups.list",
- // "parameterOrder": [
- // "project",
- // "zone"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/nodeGroups",
- // "response": {
- // "$ref": "NodeGroupList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *NodeGroupsListCall) Pages(ctx context.Context, f func(*NodeGroupList) 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 "compute.nodeGroups.listNodes":
-
-type NodeGroupsListNodesCall struct {
- s *Service
- project string
- zone string
- nodeGroup string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// ListNodes: Lists nodes in the node group.
-//
-// - nodeGroup: Name of the NodeGroup resource whose nodes you want to
-// list.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *NodeGroupsService) ListNodes(project string, zone string, nodeGroup string) *NodeGroupsListNodesCall {
- c := &NodeGroupsListNodesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.nodeGroup = nodeGroup
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *NodeGroupsListNodesCall) Filter(filter string) *NodeGroupsListNodesCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *NodeGroupsListNodesCall) MaxResults(maxResults int64) *NodeGroupsListNodesCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *NodeGroupsListNodesCall) OrderBy(orderBy string) *NodeGroupsListNodesCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *NodeGroupsListNodesCall) PageToken(pageToken string) *NodeGroupsListNodesCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *NodeGroupsListNodesCall) ReturnPartialSuccess(returnPartialSuccess bool) *NodeGroupsListNodesCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *NodeGroupsListNodesCall) Fields(s ...googleapi.Field) *NodeGroupsListNodesCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NodeGroupsListNodesCall) Context(ctx context.Context) *NodeGroupsListNodesCall {
- 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 *NodeGroupsListNodesCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NodeGroupsListNodesCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}/listNodes")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "nodeGroup": c.nodeGroup,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.nodeGroups.listNodes" call.
-// Exactly one of *NodeGroupsListNodes or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *NodeGroupsListNodes.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 *NodeGroupsListNodesCall) Do(opts ...googleapi.CallOption) (*NodeGroupsListNodes, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &NodeGroupsListNodes{
- 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": "Lists nodes in the node group.",
- // "flatPath": "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}/listNodes",
- // "httpMethod": "POST",
- // "id": "compute.nodeGroups.listNodes",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "nodeGroup"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "nodeGroup": {
- // "description": "Name of the NodeGroup resource whose nodes you want to list.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}/listNodes",
- // "response": {
- // "$ref": "NodeGroupsListNodes"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *NodeGroupsListNodesCall) Pages(ctx context.Context, f func(*NodeGroupsListNodes) 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 "compute.nodeGroups.patch":
-
-type NodeGroupsPatchCall struct {
- s *Service
- project string
- zone string
- nodeGroup string
- nodegroup *NodeGroup
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Updates the specified node group.
-//
-// - nodeGroup: Name of the NodeGroup resource to update.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *NodeGroupsService) Patch(project string, zone string, nodeGroup string, nodegroup *NodeGroup) *NodeGroupsPatchCall {
- c := &NodeGroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.nodeGroup = nodeGroup
- c.nodegroup = nodegroup
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *NodeGroupsPatchCall) RequestId(requestId string) *NodeGroupsPatchCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *NodeGroupsPatchCall) Fields(s ...googleapi.Field) *NodeGroupsPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NodeGroupsPatchCall) Context(ctx context.Context) *NodeGroupsPatchCall {
- 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 *NodeGroupsPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NodeGroupsPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroup)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "nodeGroup": c.nodeGroup,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.nodeGroups.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *NodeGroupsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Updates the specified node group.",
- // "flatPath": "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}",
- // "httpMethod": "PATCH",
- // "id": "compute.nodeGroups.patch",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "nodeGroup"
- // ],
- // "parameters": {
- // "nodeGroup": {
- // "description": "Name of the NodeGroup resource to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}",
- // "request": {
- // "$ref": "NodeGroup"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.nodeGroups.setIamPolicy":
-
-type NodeGroupsSetIamPolicyCall struct {
- s *Service
- project string
- zone string
- resource string
- zonesetpolicyrequest *ZoneSetPolicyRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetIamPolicy: Sets the access control policy on the specified
-// resource. Replaces any existing policy.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-// - zone: The name of the zone for this request.
-func (r *NodeGroupsService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *NodeGroupsSetIamPolicyCall {
- c := &NodeGroupsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.resource = resource
- c.zonesetpolicyrequest = zonesetpolicyrequest
- 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 *NodeGroupsSetIamPolicyCall) Fields(s ...googleapi.Field) *NodeGroupsSetIamPolicyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NodeGroupsSetIamPolicyCall) Context(ctx context.Context) *NodeGroupsSetIamPolicyCall {
- 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 *NodeGroupsSetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NodeGroupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{resource}/setIamPolicy")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.nodeGroups.setIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *NodeGroupsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Sets the access control policy on the specified resource. Replaces any existing policy.",
- // "flatPath": "projects/{project}/zones/{zone}/nodeGroups/{resource}/setIamPolicy",
- // "httpMethod": "POST",
- // "id": "compute.nodeGroups.setIamPolicy",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/nodeGroups/{resource}/setIamPolicy",
- // "request": {
- // "$ref": "ZoneSetPolicyRequest"
- // },
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.nodeGroups.setNodeTemplate":
-
-type NodeGroupsSetNodeTemplateCall struct {
- s *Service
- project string
- zone string
- nodeGroup string
- nodegroupssetnodetemplaterequest *NodeGroupsSetNodeTemplateRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetNodeTemplate: Updates the node template of the node group.
-//
-// - nodeGroup: Name of the NodeGroup resource to update.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *NodeGroupsService) SetNodeTemplate(project string, zone string, nodeGroup string, nodegroupssetnodetemplaterequest *NodeGroupsSetNodeTemplateRequest) *NodeGroupsSetNodeTemplateCall {
- c := &NodeGroupsSetNodeTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.nodeGroup = nodeGroup
- c.nodegroupssetnodetemplaterequest = nodegroupssetnodetemplaterequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *NodeGroupsSetNodeTemplateCall) RequestId(requestId string) *NodeGroupsSetNodeTemplateCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *NodeGroupsSetNodeTemplateCall) Fields(s ...googleapi.Field) *NodeGroupsSetNodeTemplateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NodeGroupsSetNodeTemplateCall) Context(ctx context.Context) *NodeGroupsSetNodeTemplateCall {
- 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 *NodeGroupsSetNodeTemplateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NodeGroupsSetNodeTemplateCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupssetnodetemplaterequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}/setNodeTemplate")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "nodeGroup": c.nodeGroup,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.nodeGroups.setNodeTemplate" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *NodeGroupsSetNodeTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Updates the node template of the node group.",
- // "flatPath": "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}/setNodeTemplate",
- // "httpMethod": "POST",
- // "id": "compute.nodeGroups.setNodeTemplate",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "nodeGroup"
- // ],
- // "parameters": {
- // "nodeGroup": {
- // "description": "Name of the NodeGroup resource to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}/setNodeTemplate",
- // "request": {
- // "$ref": "NodeGroupsSetNodeTemplateRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.nodeGroups.simulateMaintenanceEvent":
-
-type NodeGroupsSimulateMaintenanceEventCall struct {
- s *Service
- project string
- zone string
- nodeGroup string
- nodegroupssimulatemaintenanceeventrequest *NodeGroupsSimulateMaintenanceEventRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SimulateMaintenanceEvent: Simulates maintenance event on specified
-// nodes from the node group.
-//
-// - nodeGroup: Name of the NodeGroup resource whose nodes will go under
-// maintenance simulation.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *NodeGroupsService) SimulateMaintenanceEvent(project string, zone string, nodeGroup string, nodegroupssimulatemaintenanceeventrequest *NodeGroupsSimulateMaintenanceEventRequest) *NodeGroupsSimulateMaintenanceEventCall {
- c := &NodeGroupsSimulateMaintenanceEventCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.nodeGroup = nodeGroup
- c.nodegroupssimulatemaintenanceeventrequest = nodegroupssimulatemaintenanceeventrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *NodeGroupsSimulateMaintenanceEventCall) RequestId(requestId string) *NodeGroupsSimulateMaintenanceEventCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *NodeGroupsSimulateMaintenanceEventCall) Fields(s ...googleapi.Field) *NodeGroupsSimulateMaintenanceEventCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NodeGroupsSimulateMaintenanceEventCall) Context(ctx context.Context) *NodeGroupsSimulateMaintenanceEventCall {
- 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 *NodeGroupsSimulateMaintenanceEventCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NodeGroupsSimulateMaintenanceEventCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupssimulatemaintenanceeventrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}/simulateMaintenanceEvent")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "nodeGroup": c.nodeGroup,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.nodeGroups.simulateMaintenanceEvent" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *NodeGroupsSimulateMaintenanceEventCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Simulates maintenance event on specified nodes from the node group.",
- // "flatPath": "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}/simulateMaintenanceEvent",
- // "httpMethod": "POST",
- // "id": "compute.nodeGroups.simulateMaintenanceEvent",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "nodeGroup"
- // ],
- // "parameters": {
- // "nodeGroup": {
- // "description": "Name of the NodeGroup resource whose nodes will go under maintenance simulation.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}/simulateMaintenanceEvent",
- // "request": {
- // "$ref": "NodeGroupsSimulateMaintenanceEventRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.nodeGroups.testIamPermissions":
-
-type NodeGroupsTestIamPermissionsCall struct {
- s *Service
- project string
- zone string
- resource string
- testpermissionsrequest *TestPermissionsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// TestIamPermissions: Returns permissions that a caller has on the
-// specified resource.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-// - zone: The name of the zone for this request.
-func (r *NodeGroupsService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *NodeGroupsTestIamPermissionsCall {
- c := &NodeGroupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.resource = resource
- c.testpermissionsrequest = testpermissionsrequest
- 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 *NodeGroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *NodeGroupsTestIamPermissionsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NodeGroupsTestIamPermissionsCall) Context(ctx context.Context) *NodeGroupsTestIamPermissionsCall {
- 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 *NodeGroupsTestIamPermissionsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NodeGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{resource}/testIamPermissions")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.nodeGroups.testIamPermissions" call.
-// Exactly one of *TestPermissionsResponse or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *TestPermissionsResponse.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 *NodeGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TestPermissionsResponse{
- 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": "Returns permissions that a caller has on the specified resource.",
- // "flatPath": "projects/{project}/zones/{zone}/nodeGroups/{resource}/testIamPermissions",
- // "httpMethod": "POST",
- // "id": "compute.nodeGroups.testIamPermissions",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/nodeGroups/{resource}/testIamPermissions",
- // "request": {
- // "$ref": "TestPermissionsRequest"
- // },
- // "response": {
- // "$ref": "TestPermissionsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.nodeTemplates.aggregatedList":
-
-type NodeTemplatesAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Retrieves an aggregated list of node templates.
-//
-// - project: Project ID for this request.
-func (r *NodeTemplatesService) AggregatedList(project string) *NodeTemplatesAggregatedListCall {
- c := &NodeTemplatesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *NodeTemplatesAggregatedListCall) Filter(filter string) *NodeTemplatesAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *NodeTemplatesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *NodeTemplatesAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *NodeTemplatesAggregatedListCall) MaxResults(maxResults int64) *NodeTemplatesAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *NodeTemplatesAggregatedListCall) OrderBy(orderBy string) *NodeTemplatesAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *NodeTemplatesAggregatedListCall) PageToken(pageToken string) *NodeTemplatesAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *NodeTemplatesAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *NodeTemplatesAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *NodeTemplatesAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *NodeTemplatesAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *NodeTemplatesAggregatedListCall) Fields(s ...googleapi.Field) *NodeTemplatesAggregatedListCall {
- 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 *NodeTemplatesAggregatedListCall) IfNoneMatch(entityTag string) *NodeTemplatesAggregatedListCall {
- 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 *NodeTemplatesAggregatedListCall) Context(ctx context.Context) *NodeTemplatesAggregatedListCall {
- 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 *NodeTemplatesAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NodeTemplatesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/nodeTemplates")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.nodeTemplates.aggregatedList" call.
-// Exactly one of *NodeTemplateAggregatedList or error will be non-nil.
-// Any non-2xx status code is an error. Response headers are in either
-// *NodeTemplateAggregatedList.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 *NodeTemplatesAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeTemplateAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &NodeTemplateAggregatedList{
- 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": "Retrieves an aggregated list of node templates.",
- // "flatPath": "projects/{project}/aggregated/nodeTemplates",
- // "httpMethod": "GET",
- // "id": "compute.nodeTemplates.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/nodeTemplates",
- // "response": {
- // "$ref": "NodeTemplateAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *NodeTemplatesAggregatedListCall) Pages(ctx context.Context, f func(*NodeTemplateAggregatedList) 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 "compute.nodeTemplates.delete":
-
-type NodeTemplatesDeleteCall struct {
- s *Service
- project string
- region string
- nodeTemplate string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified NodeTemplate resource.
-//
-// - nodeTemplate: Name of the NodeTemplate resource to delete.
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-func (r *NodeTemplatesService) Delete(project string, region string, nodeTemplate string) *NodeTemplatesDeleteCall {
- c := &NodeTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.nodeTemplate = nodeTemplate
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *NodeTemplatesDeleteCall) RequestId(requestId string) *NodeTemplatesDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *NodeTemplatesDeleteCall) Fields(s ...googleapi.Field) *NodeTemplatesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NodeTemplatesDeleteCall) Context(ctx context.Context) *NodeTemplatesDeleteCall {
- 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 *NodeTemplatesDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NodeTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/nodeTemplates/{nodeTemplate}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "nodeTemplate": c.nodeTemplate,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.nodeTemplates.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *NodeTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified NodeTemplate resource.",
- // "flatPath": "projects/{project}/regions/{region}/nodeTemplates/{nodeTemplate}",
- // "httpMethod": "DELETE",
- // "id": "compute.nodeTemplates.delete",
- // "parameterOrder": [
- // "project",
- // "region",
- // "nodeTemplate"
- // ],
- // "parameters": {
- // "nodeTemplate": {
- // "description": "Name of the NodeTemplate resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/nodeTemplates/{nodeTemplate}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.nodeTemplates.get":
-
-type NodeTemplatesGetCall struct {
- s *Service
- project string
- region string
- nodeTemplate string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified node template.
-//
-// - nodeTemplate: Name of the node template to return.
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-func (r *NodeTemplatesService) Get(project string, region string, nodeTemplate string) *NodeTemplatesGetCall {
- c := &NodeTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.nodeTemplate = nodeTemplate
- 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 *NodeTemplatesGetCall) Fields(s ...googleapi.Field) *NodeTemplatesGetCall {
- 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 *NodeTemplatesGetCall) IfNoneMatch(entityTag string) *NodeTemplatesGetCall {
- 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 *NodeTemplatesGetCall) Context(ctx context.Context) *NodeTemplatesGetCall {
- 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 *NodeTemplatesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NodeTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/nodeTemplates/{nodeTemplate}")
- 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{
- "project": c.project,
- "region": c.region,
- "nodeTemplate": c.nodeTemplate,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.nodeTemplates.get" call.
-// Exactly one of *NodeTemplate or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *NodeTemplate.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 *NodeTemplatesGetCall) Do(opts ...googleapi.CallOption) (*NodeTemplate, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &NodeTemplate{
- 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": "Returns the specified node template.",
- // "flatPath": "projects/{project}/regions/{region}/nodeTemplates/{nodeTemplate}",
- // "httpMethod": "GET",
- // "id": "compute.nodeTemplates.get",
- // "parameterOrder": [
- // "project",
- // "region",
- // "nodeTemplate"
- // ],
- // "parameters": {
- // "nodeTemplate": {
- // "description": "Name of the node template to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/nodeTemplates/{nodeTemplate}",
- // "response": {
- // "$ref": "NodeTemplate"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.nodeTemplates.getIamPolicy":
-
-type NodeTemplatesGetIamPolicyCall struct {
- s *Service
- project string
- region string
- resource string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetIamPolicy: Gets the access control policy for a resource. May be
-// empty if no such policy or resource exists.
-//
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-// - resource: Name or id of the resource for this request.
-func (r *NodeTemplatesService) GetIamPolicy(project string, region string, resource string) *NodeTemplatesGetIamPolicyCall {
- c := &NodeTemplatesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.resource = resource
- return c
-}
-
-// OptionsRequestedPolicyVersion sets the optional parameter
-// "optionsRequestedPolicyVersion": Requested IAM Policy version.
-func (c *NodeTemplatesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *NodeTemplatesGetIamPolicyCall {
- c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
- 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 *NodeTemplatesGetIamPolicyCall) Fields(s ...googleapi.Field) *NodeTemplatesGetIamPolicyCall {
- 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 *NodeTemplatesGetIamPolicyCall) IfNoneMatch(entityTag string) *NodeTemplatesGetIamPolicyCall {
- 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 *NodeTemplatesGetIamPolicyCall) Context(ctx context.Context) *NodeTemplatesGetIamPolicyCall {
- 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 *NodeTemplatesGetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NodeTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/nodeTemplates/{resource}/getIamPolicy")
- 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{
- "project": c.project,
- "region": c.region,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.nodeTemplates.getIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *NodeTemplatesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
- // "flatPath": "projects/{project}/regions/{region}/nodeTemplates/{resource}/getIamPolicy",
- // "httpMethod": "GET",
- // "id": "compute.nodeTemplates.getIamPolicy",
- // "parameterOrder": [
- // "project",
- // "region",
- // "resource"
- // ],
- // "parameters": {
- // "optionsRequestedPolicyVersion": {
- // "description": "Requested IAM Policy version.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/nodeTemplates/{resource}/getIamPolicy",
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.nodeTemplates.insert":
-
-type NodeTemplatesInsertCall struct {
- s *Service
- project string
- region string
- nodetemplate *NodeTemplate
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a NodeTemplate resource in the specified project
-// using the data included in the request.
-//
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-func (r *NodeTemplatesService) Insert(project string, region string, nodetemplate *NodeTemplate) *NodeTemplatesInsertCall {
- c := &NodeTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.nodetemplate = nodetemplate
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *NodeTemplatesInsertCall) RequestId(requestId string) *NodeTemplatesInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *NodeTemplatesInsertCall) Fields(s ...googleapi.Field) *NodeTemplatesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NodeTemplatesInsertCall) Context(ctx context.Context) *NodeTemplatesInsertCall {
- 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 *NodeTemplatesInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NodeTemplatesInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodetemplate)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/nodeTemplates")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.nodeTemplates.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *NodeTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a NodeTemplate resource in the specified project using the data included in the request.",
- // "flatPath": "projects/{project}/regions/{region}/nodeTemplates",
- // "httpMethod": "POST",
- // "id": "compute.nodeTemplates.insert",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/nodeTemplates",
- // "request": {
- // "$ref": "NodeTemplate"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.nodeTemplates.list":
-
-type NodeTemplatesListCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves a list of node templates available to the specified
-// project.
-//
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-func (r *NodeTemplatesService) List(project string, region string) *NodeTemplatesListCall {
- c := &NodeTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *NodeTemplatesListCall) Filter(filter string) *NodeTemplatesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *NodeTemplatesListCall) MaxResults(maxResults int64) *NodeTemplatesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *NodeTemplatesListCall) OrderBy(orderBy string) *NodeTemplatesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *NodeTemplatesListCall) PageToken(pageToken string) *NodeTemplatesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *NodeTemplatesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *NodeTemplatesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *NodeTemplatesListCall) Fields(s ...googleapi.Field) *NodeTemplatesListCall {
- 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 *NodeTemplatesListCall) IfNoneMatch(entityTag string) *NodeTemplatesListCall {
- 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 *NodeTemplatesListCall) Context(ctx context.Context) *NodeTemplatesListCall {
- 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 *NodeTemplatesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NodeTemplatesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/nodeTemplates")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.nodeTemplates.list" call.
-// Exactly one of *NodeTemplateList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *NodeTemplateList.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 *NodeTemplatesListCall) Do(opts ...googleapi.CallOption) (*NodeTemplateList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &NodeTemplateList{
- 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": "Retrieves a list of node templates available to the specified project.",
- // "flatPath": "projects/{project}/regions/{region}/nodeTemplates",
- // "httpMethod": "GET",
- // "id": "compute.nodeTemplates.list",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/nodeTemplates",
- // "response": {
- // "$ref": "NodeTemplateList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *NodeTemplatesListCall) Pages(ctx context.Context, f func(*NodeTemplateList) 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 "compute.nodeTemplates.setIamPolicy":
-
-type NodeTemplatesSetIamPolicyCall struct {
- s *Service
- project string
- region string
- resource string
- regionsetpolicyrequest *RegionSetPolicyRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetIamPolicy: Sets the access control policy on the specified
-// resource. Replaces any existing policy.
-//
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-// - resource: Name or id of the resource for this request.
-func (r *NodeTemplatesService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *NodeTemplatesSetIamPolicyCall {
- c := &NodeTemplatesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.resource = resource
- c.regionsetpolicyrequest = regionsetpolicyrequest
- 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 *NodeTemplatesSetIamPolicyCall) Fields(s ...googleapi.Field) *NodeTemplatesSetIamPolicyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NodeTemplatesSetIamPolicyCall) Context(ctx context.Context) *NodeTemplatesSetIamPolicyCall {
- 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 *NodeTemplatesSetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NodeTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/nodeTemplates/{resource}/setIamPolicy")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.nodeTemplates.setIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *NodeTemplatesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Sets the access control policy on the specified resource. Replaces any existing policy.",
- // "flatPath": "projects/{project}/regions/{region}/nodeTemplates/{resource}/setIamPolicy",
- // "httpMethod": "POST",
- // "id": "compute.nodeTemplates.setIamPolicy",
- // "parameterOrder": [
- // "project",
- // "region",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/nodeTemplates/{resource}/setIamPolicy",
- // "request": {
- // "$ref": "RegionSetPolicyRequest"
- // },
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.nodeTemplates.testIamPermissions":
-
-type NodeTemplatesTestIamPermissionsCall struct {
- s *Service
- project string
- region string
- resource string
- testpermissionsrequest *TestPermissionsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// TestIamPermissions: Returns permissions that a caller has on the
-// specified resource.
-//
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-// - resource: Name or id of the resource for this request.
-func (r *NodeTemplatesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *NodeTemplatesTestIamPermissionsCall {
- c := &NodeTemplatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.resource = resource
- c.testpermissionsrequest = testpermissionsrequest
- 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 *NodeTemplatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *NodeTemplatesTestIamPermissionsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *NodeTemplatesTestIamPermissionsCall) Context(ctx context.Context) *NodeTemplatesTestIamPermissionsCall {
- 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 *NodeTemplatesTestIamPermissionsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NodeTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/nodeTemplates/{resource}/testIamPermissions")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.nodeTemplates.testIamPermissions" call.
-// Exactly one of *TestPermissionsResponse or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *TestPermissionsResponse.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 *NodeTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TestPermissionsResponse{
- 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": "Returns permissions that a caller has on the specified resource.",
- // "flatPath": "projects/{project}/regions/{region}/nodeTemplates/{resource}/testIamPermissions",
- // "httpMethod": "POST",
- // "id": "compute.nodeTemplates.testIamPermissions",
- // "parameterOrder": [
- // "project",
- // "region",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/nodeTemplates/{resource}/testIamPermissions",
- // "request": {
- // "$ref": "TestPermissionsRequest"
- // },
- // "response": {
- // "$ref": "TestPermissionsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.nodeTypes.aggregatedList":
-
-type NodeTypesAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Retrieves an aggregated list of node types.
-//
-// - project: Project ID for this request.
-func (r *NodeTypesService) AggregatedList(project string) *NodeTypesAggregatedListCall {
- c := &NodeTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *NodeTypesAggregatedListCall) Filter(filter string) *NodeTypesAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *NodeTypesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *NodeTypesAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *NodeTypesAggregatedListCall) MaxResults(maxResults int64) *NodeTypesAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *NodeTypesAggregatedListCall) OrderBy(orderBy string) *NodeTypesAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *NodeTypesAggregatedListCall) PageToken(pageToken string) *NodeTypesAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *NodeTypesAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *NodeTypesAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *NodeTypesAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *NodeTypesAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *NodeTypesAggregatedListCall) Fields(s ...googleapi.Field) *NodeTypesAggregatedListCall {
- 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 *NodeTypesAggregatedListCall) IfNoneMatch(entityTag string) *NodeTypesAggregatedListCall {
- 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 *NodeTypesAggregatedListCall) Context(ctx context.Context) *NodeTypesAggregatedListCall {
- 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 *NodeTypesAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NodeTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/nodeTypes")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.nodeTypes.aggregatedList" call.
-// Exactly one of *NodeTypeAggregatedList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *NodeTypeAggregatedList.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 *NodeTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeTypeAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &NodeTypeAggregatedList{
- 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": "Retrieves an aggregated list of node types.",
- // "flatPath": "projects/{project}/aggregated/nodeTypes",
- // "httpMethod": "GET",
- // "id": "compute.nodeTypes.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/nodeTypes",
- // "response": {
- // "$ref": "NodeTypeAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *NodeTypesAggregatedListCall) Pages(ctx context.Context, f func(*NodeTypeAggregatedList) 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 "compute.nodeTypes.get":
-
-type NodeTypesGetCall struct {
- s *Service
- project string
- zone string
- nodeType string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified node type.
-//
-// - nodeType: Name of the node type to return.
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *NodeTypesService) Get(project string, zone string, nodeType string) *NodeTypesGetCall {
- c := &NodeTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.nodeType = nodeType
- 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 *NodeTypesGetCall) Fields(s ...googleapi.Field) *NodeTypesGetCall {
- 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 *NodeTypesGetCall) IfNoneMatch(entityTag string) *NodeTypesGetCall {
- 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 *NodeTypesGetCall) Context(ctx context.Context) *NodeTypesGetCall {
- 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 *NodeTypesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NodeTypesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}/nodeTypes/{nodeType}")
- 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{
- "project": c.project,
- "zone": c.zone,
- "nodeType": c.nodeType,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.nodeTypes.get" call.
-// Exactly one of *NodeType or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *NodeType.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 *NodeTypesGetCall) Do(opts ...googleapi.CallOption) (*NodeType, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &NodeType{
- 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": "Returns the specified node type.",
- // "flatPath": "projects/{project}/zones/{zone}/nodeTypes/{nodeType}",
- // "httpMethod": "GET",
- // "id": "compute.nodeTypes.get",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "nodeType"
- // ],
- // "parameters": {
- // "nodeType": {
- // "description": "Name of the node type to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/nodeTypes/{nodeType}",
- // "response": {
- // "$ref": "NodeType"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.nodeTypes.list":
-
-type NodeTypesListCall struct {
- s *Service
- project string
- zone string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves a list of node types available to the specified
-// project.
-//
-// - project: Project ID for this request.
-// - zone: The name of the zone for this request.
-func (r *NodeTypesService) List(project string, zone string) *NodeTypesListCall {
- c := &NodeTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *NodeTypesListCall) Filter(filter string) *NodeTypesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *NodeTypesListCall) MaxResults(maxResults int64) *NodeTypesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *NodeTypesListCall) OrderBy(orderBy string) *NodeTypesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *NodeTypesListCall) PageToken(pageToken string) *NodeTypesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *NodeTypesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *NodeTypesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *NodeTypesListCall) Fields(s ...googleapi.Field) *NodeTypesListCall {
- 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 *NodeTypesListCall) IfNoneMatch(entityTag string) *NodeTypesListCall {
- 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 *NodeTypesListCall) Context(ctx context.Context) *NodeTypesListCall {
- 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 *NodeTypesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NodeTypesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}/nodeTypes")
- 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{
- "project": c.project,
- "zone": c.zone,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.nodeTypes.list" call.
-// Exactly one of *NodeTypeList or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *NodeTypeList.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 *NodeTypesListCall) Do(opts ...googleapi.CallOption) (*NodeTypeList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &NodeTypeList{
- 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": "Retrieves a list of node types available to the specified project.",
- // "flatPath": "projects/{project}/zones/{zone}/nodeTypes",
- // "httpMethod": "GET",
- // "id": "compute.nodeTypes.list",
- // "parameterOrder": [
- // "project",
- // "zone"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/nodeTypes",
- // "response": {
- // "$ref": "NodeTypeList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *NodeTypesListCall) Pages(ctx context.Context, f func(*NodeTypeList) 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 "compute.packetMirrorings.aggregatedList":
-
-type PacketMirroringsAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Retrieves an aggregated list of packetMirrorings.
-//
-// - project: Project ID for this request.
-func (r *PacketMirroringsService) AggregatedList(project string) *PacketMirroringsAggregatedListCall {
- c := &PacketMirroringsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *PacketMirroringsAggregatedListCall) Filter(filter string) *PacketMirroringsAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *PacketMirroringsAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *PacketMirroringsAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *PacketMirroringsAggregatedListCall) MaxResults(maxResults int64) *PacketMirroringsAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *PacketMirroringsAggregatedListCall) OrderBy(orderBy string) *PacketMirroringsAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *PacketMirroringsAggregatedListCall) PageToken(pageToken string) *PacketMirroringsAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *PacketMirroringsAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *PacketMirroringsAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *PacketMirroringsAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *PacketMirroringsAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *PacketMirroringsAggregatedListCall) Fields(s ...googleapi.Field) *PacketMirroringsAggregatedListCall {
- 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 *PacketMirroringsAggregatedListCall) IfNoneMatch(entityTag string) *PacketMirroringsAggregatedListCall {
- 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 *PacketMirroringsAggregatedListCall) Context(ctx context.Context) *PacketMirroringsAggregatedListCall {
- 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 *PacketMirroringsAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *PacketMirroringsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/packetMirrorings")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.packetMirrorings.aggregatedList" call.
-// Exactly one of *PacketMirroringAggregatedList or error will be
-// non-nil. Any non-2xx status code is an error. Response headers are in
-// either *PacketMirroringAggregatedList.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 *PacketMirroringsAggregatedListCall) Do(opts ...googleapi.CallOption) (*PacketMirroringAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &PacketMirroringAggregatedList{
- 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": "Retrieves an aggregated list of packetMirrorings.",
- // "flatPath": "projects/{project}/aggregated/packetMirrorings",
- // "httpMethod": "GET",
- // "id": "compute.packetMirrorings.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/packetMirrorings",
- // "response": {
- // "$ref": "PacketMirroringAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *PacketMirroringsAggregatedListCall) Pages(ctx context.Context, f func(*PacketMirroringAggregatedList) 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 "compute.packetMirrorings.delete":
-
-type PacketMirroringsDeleteCall struct {
- s *Service
- project string
- region string
- packetMirroring string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified PacketMirroring resource.
-//
-// - packetMirroring: Name of the PacketMirroring resource to delete.
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-func (r *PacketMirroringsService) Delete(project string, region string, packetMirroring string) *PacketMirroringsDeleteCall {
- c := &PacketMirroringsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.packetMirroring = packetMirroring
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *PacketMirroringsDeleteCall) RequestId(requestId string) *PacketMirroringsDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *PacketMirroringsDeleteCall) Fields(s ...googleapi.Field) *PacketMirroringsDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *PacketMirroringsDeleteCall) Context(ctx context.Context) *PacketMirroringsDeleteCall {
- 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 *PacketMirroringsDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *PacketMirroringsDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/packetMirrorings/{packetMirroring}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "packetMirroring": c.packetMirroring,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.packetMirrorings.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *PacketMirroringsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified PacketMirroring resource.",
- // "flatPath": "projects/{project}/regions/{region}/packetMirrorings/{packetMirroring}",
- // "httpMethod": "DELETE",
- // "id": "compute.packetMirrorings.delete",
- // "parameterOrder": [
- // "project",
- // "region",
- // "packetMirroring"
- // ],
- // "parameters": {
- // "packetMirroring": {
- // "description": "Name of the PacketMirroring resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/packetMirrorings/{packetMirroring}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.packetMirrorings.get":
-
-type PacketMirroringsGetCall struct {
- s *Service
- project string
- region string
- packetMirroring string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified PacketMirroring resource.
-//
-// - packetMirroring: Name of the PacketMirroring resource to return.
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-func (r *PacketMirroringsService) Get(project string, region string, packetMirroring string) *PacketMirroringsGetCall {
- c := &PacketMirroringsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.packetMirroring = packetMirroring
- 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 *PacketMirroringsGetCall) Fields(s ...googleapi.Field) *PacketMirroringsGetCall {
- 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 *PacketMirroringsGetCall) IfNoneMatch(entityTag string) *PacketMirroringsGetCall {
- 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 *PacketMirroringsGetCall) Context(ctx context.Context) *PacketMirroringsGetCall {
- 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 *PacketMirroringsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *PacketMirroringsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/packetMirrorings/{packetMirroring}")
- 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{
- "project": c.project,
- "region": c.region,
- "packetMirroring": c.packetMirroring,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.packetMirrorings.get" call.
-// Exactly one of *PacketMirroring or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *PacketMirroring.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 *PacketMirroringsGetCall) Do(opts ...googleapi.CallOption) (*PacketMirroring, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &PacketMirroring{
- 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": "Returns the specified PacketMirroring resource.",
- // "flatPath": "projects/{project}/regions/{region}/packetMirrorings/{packetMirroring}",
- // "httpMethod": "GET",
- // "id": "compute.packetMirrorings.get",
- // "parameterOrder": [
- // "project",
- // "region",
- // "packetMirroring"
- // ],
- // "parameters": {
- // "packetMirroring": {
- // "description": "Name of the PacketMirroring resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/packetMirrorings/{packetMirroring}",
- // "response": {
- // "$ref": "PacketMirroring"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.packetMirrorings.insert":
-
-type PacketMirroringsInsertCall struct {
- s *Service
- project string
- region string
- packetmirroring *PacketMirroring
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a PacketMirroring resource in the specified project
-// and region using the data included in the request.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-func (r *PacketMirroringsService) Insert(project string, region string, packetmirroring *PacketMirroring) *PacketMirroringsInsertCall {
- c := &PacketMirroringsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.packetmirroring = packetmirroring
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *PacketMirroringsInsertCall) RequestId(requestId string) *PacketMirroringsInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *PacketMirroringsInsertCall) Fields(s ...googleapi.Field) *PacketMirroringsInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *PacketMirroringsInsertCall) Context(ctx context.Context) *PacketMirroringsInsertCall {
- 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 *PacketMirroringsInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *PacketMirroringsInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.packetmirroring)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/packetMirrorings")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.packetMirrorings.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *PacketMirroringsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a PacketMirroring resource in the specified project and region using the data included in the request.",
- // "flatPath": "projects/{project}/regions/{region}/packetMirrorings",
- // "httpMethod": "POST",
- // "id": "compute.packetMirrorings.insert",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/packetMirrorings",
- // "request": {
- // "$ref": "PacketMirroring"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.packetMirrorings.list":
-
-type PacketMirroringsListCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves a list of PacketMirroring resources available to the
-// specified project and region.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-func (r *PacketMirroringsService) List(project string, region string) *PacketMirroringsListCall {
- c := &PacketMirroringsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *PacketMirroringsListCall) Filter(filter string) *PacketMirroringsListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *PacketMirroringsListCall) MaxResults(maxResults int64) *PacketMirroringsListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *PacketMirroringsListCall) OrderBy(orderBy string) *PacketMirroringsListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *PacketMirroringsListCall) PageToken(pageToken string) *PacketMirroringsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *PacketMirroringsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *PacketMirroringsListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *PacketMirroringsListCall) Fields(s ...googleapi.Field) *PacketMirroringsListCall {
- 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 *PacketMirroringsListCall) IfNoneMatch(entityTag string) *PacketMirroringsListCall {
- 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 *PacketMirroringsListCall) Context(ctx context.Context) *PacketMirroringsListCall {
- 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 *PacketMirroringsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *PacketMirroringsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/packetMirrorings")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.packetMirrorings.list" call.
-// Exactly one of *PacketMirroringList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *PacketMirroringList.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 *PacketMirroringsListCall) Do(opts ...googleapi.CallOption) (*PacketMirroringList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &PacketMirroringList{
- 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": "Retrieves a list of PacketMirroring resources available to the specified project and region.",
- // "flatPath": "projects/{project}/regions/{region}/packetMirrorings",
- // "httpMethod": "GET",
- // "id": "compute.packetMirrorings.list",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/packetMirrorings",
- // "response": {
- // "$ref": "PacketMirroringList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *PacketMirroringsListCall) Pages(ctx context.Context, f func(*PacketMirroringList) 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 "compute.packetMirrorings.patch":
-
-type PacketMirroringsPatchCall struct {
- s *Service
- project string
- region string
- packetMirroring string
- packetmirroring *PacketMirroring
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Patches the specified PacketMirroring resource with the data
-// included in the request. This method supports PATCH semantics and
-// uses JSON merge patch format and processing rules.
-//
-// - packetMirroring: Name of the PacketMirroring resource to patch.
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-func (r *PacketMirroringsService) Patch(project string, region string, packetMirroring string, packetmirroring *PacketMirroring) *PacketMirroringsPatchCall {
- c := &PacketMirroringsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.packetMirroring = packetMirroring
- c.packetmirroring = packetmirroring
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *PacketMirroringsPatchCall) RequestId(requestId string) *PacketMirroringsPatchCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *PacketMirroringsPatchCall) Fields(s ...googleapi.Field) *PacketMirroringsPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *PacketMirroringsPatchCall) Context(ctx context.Context) *PacketMirroringsPatchCall {
- 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 *PacketMirroringsPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *PacketMirroringsPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.packetmirroring)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/packetMirrorings/{packetMirroring}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "packetMirroring": c.packetMirroring,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.packetMirrorings.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *PacketMirroringsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Patches the specified PacketMirroring resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules.",
- // "flatPath": "projects/{project}/regions/{region}/packetMirrorings/{packetMirroring}",
- // "httpMethod": "PATCH",
- // "id": "compute.packetMirrorings.patch",
- // "parameterOrder": [
- // "project",
- // "region",
- // "packetMirroring"
- // ],
- // "parameters": {
- // "packetMirroring": {
- // "description": "Name of the PacketMirroring resource to patch.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/packetMirrorings/{packetMirroring}",
- // "request": {
- // "$ref": "PacketMirroring"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.packetMirrorings.testIamPermissions":
-
-type PacketMirroringsTestIamPermissionsCall struct {
- s *Service
- project string
- region string
- resource string
- testpermissionsrequest *TestPermissionsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// TestIamPermissions: Returns permissions that a caller has on the
-// specified resource.
-//
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-// - resource: Name or id of the resource for this request.
-func (r *PacketMirroringsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *PacketMirroringsTestIamPermissionsCall {
- c := &PacketMirroringsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.resource = resource
- c.testpermissionsrequest = testpermissionsrequest
- 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 *PacketMirroringsTestIamPermissionsCall) Fields(s ...googleapi.Field) *PacketMirroringsTestIamPermissionsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *PacketMirroringsTestIamPermissionsCall) Context(ctx context.Context) *PacketMirroringsTestIamPermissionsCall {
- 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 *PacketMirroringsTestIamPermissionsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *PacketMirroringsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/packetMirrorings/{resource}/testIamPermissions")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.packetMirrorings.testIamPermissions" call.
-// Exactly one of *TestPermissionsResponse or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *TestPermissionsResponse.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 *PacketMirroringsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TestPermissionsResponse{
- 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": "Returns permissions that a caller has on the specified resource.",
- // "flatPath": "projects/{project}/regions/{region}/packetMirrorings/{resource}/testIamPermissions",
- // "httpMethod": "POST",
- // "id": "compute.packetMirrorings.testIamPermissions",
- // "parameterOrder": [
- // "project",
- // "region",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/packetMirrorings/{resource}/testIamPermissions",
- // "request": {
- // "$ref": "TestPermissionsRequest"
- // },
- // "response": {
- // "$ref": "TestPermissionsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.projects.disableXpnHost":
-
-type ProjectsDisableXpnHostCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// DisableXpnHost: Disable this project as a shared VPC host project.
-//
-// - project: Project ID for this request.
-func (r *ProjectsService) DisableXpnHost(project string) *ProjectsDisableXpnHostCall {
- c := &ProjectsDisableXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *ProjectsDisableXpnHostCall) RequestId(requestId string) *ProjectsDisableXpnHostCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *ProjectsDisableXpnHostCall) Fields(s ...googleapi.Field) *ProjectsDisableXpnHostCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ProjectsDisableXpnHostCall) Context(ctx context.Context) *ProjectsDisableXpnHostCall {
- 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 *ProjectsDisableXpnHostCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ProjectsDisableXpnHostCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/disableXpnHost")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.projects.disableXpnHost" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *ProjectsDisableXpnHostCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Disable this project as a shared VPC host project.",
- // "flatPath": "projects/{project}/disableXpnHost",
- // "httpMethod": "POST",
- // "id": "compute.projects.disableXpnHost",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/disableXpnHost",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.projects.disableXpnResource":
-
-type ProjectsDisableXpnResourceCall struct {
- s *Service
- project string
- projectsdisablexpnresourcerequest *ProjectsDisableXpnResourceRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// DisableXpnResource: Disable a service resource (also known as service
-// project) associated with this host project.
-//
-// - project: Project ID for this request.
-func (r *ProjectsService) DisableXpnResource(project string, projectsdisablexpnresourcerequest *ProjectsDisableXpnResourceRequest) *ProjectsDisableXpnResourceCall {
- c := &ProjectsDisableXpnResourceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.projectsdisablexpnresourcerequest = projectsdisablexpnresourcerequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *ProjectsDisableXpnResourceCall) RequestId(requestId string) *ProjectsDisableXpnResourceCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *ProjectsDisableXpnResourceCall) Fields(s ...googleapi.Field) *ProjectsDisableXpnResourceCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ProjectsDisableXpnResourceCall) Context(ctx context.Context) *ProjectsDisableXpnResourceCall {
- 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 *ProjectsDisableXpnResourceCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ProjectsDisableXpnResourceCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectsdisablexpnresourcerequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/disableXpnResource")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.projects.disableXpnResource" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *ProjectsDisableXpnResourceCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Disable a service resource (also known as service project) associated with this host project.",
- // "flatPath": "projects/{project}/disableXpnResource",
- // "httpMethod": "POST",
- // "id": "compute.projects.disableXpnResource",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/disableXpnResource",
- // "request": {
- // "$ref": "ProjectsDisableXpnResourceRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.projects.enableXpnHost":
-
-type ProjectsEnableXpnHostCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// EnableXpnHost: Enable this project as a shared VPC host project.
-//
-// - project: Project ID for this request.
-func (r *ProjectsService) EnableXpnHost(project string) *ProjectsEnableXpnHostCall {
- c := &ProjectsEnableXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *ProjectsEnableXpnHostCall) RequestId(requestId string) *ProjectsEnableXpnHostCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *ProjectsEnableXpnHostCall) Fields(s ...googleapi.Field) *ProjectsEnableXpnHostCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ProjectsEnableXpnHostCall) Context(ctx context.Context) *ProjectsEnableXpnHostCall {
- 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 *ProjectsEnableXpnHostCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ProjectsEnableXpnHostCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/enableXpnHost")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.projects.enableXpnHost" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *ProjectsEnableXpnHostCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Enable this project as a shared VPC host project.",
- // "flatPath": "projects/{project}/enableXpnHost",
- // "httpMethod": "POST",
- // "id": "compute.projects.enableXpnHost",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/enableXpnHost",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.projects.enableXpnResource":
-
-type ProjectsEnableXpnResourceCall struct {
- s *Service
- project string
- projectsenablexpnresourcerequest *ProjectsEnableXpnResourceRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// EnableXpnResource: Enable service resource (a.k.a service project)
-// for a host project, so that subnets in the host project can be used
-// by instances in the service project.
-//
-// - project: Project ID for this request.
-func (r *ProjectsService) EnableXpnResource(project string, projectsenablexpnresourcerequest *ProjectsEnableXpnResourceRequest) *ProjectsEnableXpnResourceCall {
- c := &ProjectsEnableXpnResourceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.projectsenablexpnresourcerequest = projectsenablexpnresourcerequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *ProjectsEnableXpnResourceCall) RequestId(requestId string) *ProjectsEnableXpnResourceCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *ProjectsEnableXpnResourceCall) Fields(s ...googleapi.Field) *ProjectsEnableXpnResourceCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ProjectsEnableXpnResourceCall) Context(ctx context.Context) *ProjectsEnableXpnResourceCall {
- 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 *ProjectsEnableXpnResourceCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ProjectsEnableXpnResourceCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectsenablexpnresourcerequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/enableXpnResource")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.projects.enableXpnResource" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *ProjectsEnableXpnResourceCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Enable service resource (a.k.a service project) for a host project, so that subnets in the host project can be used by instances in the service project.",
- // "flatPath": "projects/{project}/enableXpnResource",
- // "httpMethod": "POST",
- // "id": "compute.projects.enableXpnResource",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/enableXpnResource",
- // "request": {
- // "$ref": "ProjectsEnableXpnResourceRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.projects.get":
-
-type ProjectsGetCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified Project resource. To decrease latency for
-// this method, you can optionally omit any unneeded information from
-// the response by using a field mask. This practice is especially
-// recommended for unused quota information (the `quotas` field). To
-// exclude one or more fields, set your request's `fields` query
-// parameter to only include the fields you need. For example, to only
-// include the `id` and `selfLink` fields, add the query parameter
-// `?fields=id,selfLink` to your request.
-//
-// - project: Project ID for this request.
-func (r *ProjectsService) Get(project string) *ProjectsGetCall {
- c := &ProjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- 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 *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall {
- 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 *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall {
- 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 *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall {
- 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 *ProjectsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.projects.get" call.
-// Exactly one of *Project or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Project.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 *ProjectsGetCall) Do(opts ...googleapi.CallOption) (*Project, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Project{
- 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": "Returns the specified Project resource. To decrease latency for this method, you can optionally omit any unneeded information from the response by using a field mask. This practice is especially recommended for unused quota information (the `quotas` field). To exclude one or more fields, set your request's `fields` query parameter to only include the fields you need. For example, to only include the `id` and `selfLink` fields, add the query parameter `?fields=id,selfLink` to your request.",
- // "flatPath": "projects/{project}",
- // "httpMethod": "GET",
- // "id": "compute.projects.get",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}",
- // "response": {
- // "$ref": "Project"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.projects.getXpnHost":
-
-type ProjectsGetXpnHostCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetXpnHost: Gets the shared VPC host project that this project links
-// to. May be empty if no link exists.
-//
-// - project: Project ID for this request.
-func (r *ProjectsService) GetXpnHost(project string) *ProjectsGetXpnHostCall {
- c := &ProjectsGetXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- 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 *ProjectsGetXpnHostCall) Fields(s ...googleapi.Field) *ProjectsGetXpnHostCall {
- 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 *ProjectsGetXpnHostCall) IfNoneMatch(entityTag string) *ProjectsGetXpnHostCall {
- 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 *ProjectsGetXpnHostCall) Context(ctx context.Context) *ProjectsGetXpnHostCall {
- 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 *ProjectsGetXpnHostCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ProjectsGetXpnHostCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/getXpnHost")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.projects.getXpnHost" call.
-// Exactly one of *Project or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Project.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 *ProjectsGetXpnHostCall) Do(opts ...googleapi.CallOption) (*Project, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Project{
- 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": "Gets the shared VPC host project that this project links to. May be empty if no link exists.",
- // "flatPath": "projects/{project}/getXpnHost",
- // "httpMethod": "GET",
- // "id": "compute.projects.getXpnHost",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/getXpnHost",
- // "response": {
- // "$ref": "Project"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.projects.getXpnResources":
-
-type ProjectsGetXpnResourcesCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetXpnResources: Gets service resources (a.k.a service project)
-// associated with this host project.
-//
-// - project: Project ID for this request.
-func (r *ProjectsService) GetXpnResources(project string) *ProjectsGetXpnResourcesCall {
- c := &ProjectsGetXpnResourcesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *ProjectsGetXpnResourcesCall) Filter(filter string) *ProjectsGetXpnResourcesCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *ProjectsGetXpnResourcesCall) MaxResults(maxResults int64) *ProjectsGetXpnResourcesCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *ProjectsGetXpnResourcesCall) OrderBy(orderBy string) *ProjectsGetXpnResourcesCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *ProjectsGetXpnResourcesCall) PageToken(pageToken string) *ProjectsGetXpnResourcesCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *ProjectsGetXpnResourcesCall) ReturnPartialSuccess(returnPartialSuccess bool) *ProjectsGetXpnResourcesCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *ProjectsGetXpnResourcesCall) Fields(s ...googleapi.Field) *ProjectsGetXpnResourcesCall {
- 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 *ProjectsGetXpnResourcesCall) IfNoneMatch(entityTag string) *ProjectsGetXpnResourcesCall {
- 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 *ProjectsGetXpnResourcesCall) Context(ctx context.Context) *ProjectsGetXpnResourcesCall {
- 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 *ProjectsGetXpnResourcesCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ProjectsGetXpnResourcesCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/getXpnResources")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.projects.getXpnResources" call.
-// Exactly one of *ProjectsGetXpnResources or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *ProjectsGetXpnResources.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 *ProjectsGetXpnResourcesCall) Do(opts ...googleapi.CallOption) (*ProjectsGetXpnResources, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &ProjectsGetXpnResources{
- 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": "Gets service resources (a.k.a service project) associated with this host project.",
- // "flatPath": "projects/{project}/getXpnResources",
- // "httpMethod": "GET",
- // "id": "compute.projects.getXpnResources",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/getXpnResources",
- // "response": {
- // "$ref": "ProjectsGetXpnResources"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// 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 *ProjectsGetXpnResourcesCall) Pages(ctx context.Context, f func(*ProjectsGetXpnResources) 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 "compute.projects.listXpnHosts":
-
-type ProjectsListXpnHostsCall struct {
- s *Service
- project string
- projectslistxpnhostsrequest *ProjectsListXpnHostsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// ListXpnHosts: Lists all shared VPC host projects visible to the user
-// in an organization.
-//
-// - project: Project ID for this request.
-func (r *ProjectsService) ListXpnHosts(project string, projectslistxpnhostsrequest *ProjectsListXpnHostsRequest) *ProjectsListXpnHostsCall {
- c := &ProjectsListXpnHostsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.projectslistxpnhostsrequest = projectslistxpnhostsrequest
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *ProjectsListXpnHostsCall) Filter(filter string) *ProjectsListXpnHostsCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *ProjectsListXpnHostsCall) MaxResults(maxResults int64) *ProjectsListXpnHostsCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *ProjectsListXpnHostsCall) OrderBy(orderBy string) *ProjectsListXpnHostsCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *ProjectsListXpnHostsCall) PageToken(pageToken string) *ProjectsListXpnHostsCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *ProjectsListXpnHostsCall) ReturnPartialSuccess(returnPartialSuccess bool) *ProjectsListXpnHostsCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *ProjectsListXpnHostsCall) Fields(s ...googleapi.Field) *ProjectsListXpnHostsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ProjectsListXpnHostsCall) Context(ctx context.Context) *ProjectsListXpnHostsCall {
- 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 *ProjectsListXpnHostsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ProjectsListXpnHostsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectslistxpnhostsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/listXpnHosts")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.projects.listXpnHosts" call.
-// Exactly one of *XpnHostList or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *XpnHostList.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 *ProjectsListXpnHostsCall) Do(opts ...googleapi.CallOption) (*XpnHostList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &XpnHostList{
- 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": "Lists all shared VPC host projects visible to the user in an organization.",
- // "flatPath": "projects/{project}/listXpnHosts",
- // "httpMethod": "POST",
- // "id": "compute.projects.listXpnHosts",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/listXpnHosts",
- // "request": {
- // "$ref": "ProjectsListXpnHostsRequest"
- // },
- // "response": {
- // "$ref": "XpnHostList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// 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 *ProjectsListXpnHostsCall) Pages(ctx context.Context, f func(*XpnHostList) 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 "compute.projects.moveDisk":
-
-type ProjectsMoveDiskCall struct {
- s *Service
- project string
- diskmoverequest *DiskMoveRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// MoveDisk: Moves a persistent disk from one zone to another.
-//
-// - project: Project ID for this request.
-func (r *ProjectsService) MoveDisk(project string, diskmoverequest *DiskMoveRequest) *ProjectsMoveDiskCall {
- c := &ProjectsMoveDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.diskmoverequest = diskmoverequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *ProjectsMoveDiskCall) RequestId(requestId string) *ProjectsMoveDiskCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *ProjectsMoveDiskCall) Fields(s ...googleapi.Field) *ProjectsMoveDiskCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ProjectsMoveDiskCall) Context(ctx context.Context) *ProjectsMoveDiskCall {
- 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 *ProjectsMoveDiskCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ProjectsMoveDiskCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.diskmoverequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/moveDisk")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.projects.moveDisk" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *ProjectsMoveDiskCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Moves a persistent disk from one zone to another.",
- // "flatPath": "projects/{project}/moveDisk",
- // "httpMethod": "POST",
- // "id": "compute.projects.moveDisk",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/moveDisk",
- // "request": {
- // "$ref": "DiskMoveRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.projects.moveInstance":
-
-type ProjectsMoveInstanceCall struct {
- s *Service
- project string
- instancemoverequest *InstanceMoveRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// MoveInstance: Moves an instance and its attached persistent disks
-// from one zone to another. *Note*: Moving VMs or disks by using this
-// method might cause unexpected behavior. For more information, see the
-// known issue
-// (/compute/docs/troubleshooting/known-issues#moving_vms_or_disks_using_
-// the_moveinstance_api_or_the_causes_unexpected_behavior). [Deprecated]
-// This method is deprecated. See moving instance across zones
-// (/compute/docs/instances/moving-instance-across-zones) instead.
-//
-// - project: Project ID for this request.
-func (r *ProjectsService) MoveInstance(project string, instancemoverequest *InstanceMoveRequest) *ProjectsMoveInstanceCall {
- c := &ProjectsMoveInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.instancemoverequest = instancemoverequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *ProjectsMoveInstanceCall) RequestId(requestId string) *ProjectsMoveInstanceCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *ProjectsMoveInstanceCall) Fields(s ...googleapi.Field) *ProjectsMoveInstanceCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ProjectsMoveInstanceCall) Context(ctx context.Context) *ProjectsMoveInstanceCall {
- 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 *ProjectsMoveInstanceCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ProjectsMoveInstanceCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancemoverequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/moveInstance")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.projects.moveInstance" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *ProjectsMoveInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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
- // {
- // "deprecated": true,
- // "description": "Moves an instance and its attached persistent disks from one zone to another. *Note*: Moving VMs or disks by using this method might cause unexpected behavior. For more information, see the [known issue](/compute/docs/troubleshooting/known-issues#moving_vms_or_disks_using_the_moveinstance_api_or_the_causes_unexpected_behavior). [Deprecated] This method is deprecated. See [moving instance across zones](/compute/docs/instances/moving-instance-across-zones) instead.",
- // "flatPath": "projects/{project}/moveInstance",
- // "httpMethod": "POST",
- // "id": "compute.projects.moveInstance",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/moveInstance",
- // "request": {
- // "$ref": "InstanceMoveRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.projects.setCommonInstanceMetadata":
-
-type ProjectsSetCommonInstanceMetadataCall struct {
- s *Service
- project string
- metadata *Metadata
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetCommonInstanceMetadata: Sets metadata common to all instances
-// within the specified project using the data included in the request.
-//
-// - project: Project ID for this request.
-func (r *ProjectsService) SetCommonInstanceMetadata(project string, metadata *Metadata) *ProjectsSetCommonInstanceMetadataCall {
- c := &ProjectsSetCommonInstanceMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.metadata = metadata
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *ProjectsSetCommonInstanceMetadataCall) RequestId(requestId string) *ProjectsSetCommonInstanceMetadataCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *ProjectsSetCommonInstanceMetadataCall) Fields(s ...googleapi.Field) *ProjectsSetCommonInstanceMetadataCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ProjectsSetCommonInstanceMetadataCall) Context(ctx context.Context) *ProjectsSetCommonInstanceMetadataCall {
- 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 *ProjectsSetCommonInstanceMetadataCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ProjectsSetCommonInstanceMetadataCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/setCommonInstanceMetadata")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.projects.setCommonInstanceMetadata" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *ProjectsSetCommonInstanceMetadataCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Sets metadata common to all instances within the specified project using the data included in the request.",
- // "flatPath": "projects/{project}/setCommonInstanceMetadata",
- // "httpMethod": "POST",
- // "id": "compute.projects.setCommonInstanceMetadata",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/setCommonInstanceMetadata",
- // "request": {
- // "$ref": "Metadata"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.projects.setDefaultNetworkTier":
-
-type ProjectsSetDefaultNetworkTierCall struct {
- s *Service
- project string
- projectssetdefaultnetworktierrequest *ProjectsSetDefaultNetworkTierRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetDefaultNetworkTier: Sets the default network tier of the project.
-// The default network tier is used when an
-// address/forwardingRule/instance is created without specifying the
-// network tier field.
-//
-// - project: Project ID for this request.
-func (r *ProjectsService) SetDefaultNetworkTier(project string, projectssetdefaultnetworktierrequest *ProjectsSetDefaultNetworkTierRequest) *ProjectsSetDefaultNetworkTierCall {
- c := &ProjectsSetDefaultNetworkTierCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.projectssetdefaultnetworktierrequest = projectssetdefaultnetworktierrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *ProjectsSetDefaultNetworkTierCall) RequestId(requestId string) *ProjectsSetDefaultNetworkTierCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *ProjectsSetDefaultNetworkTierCall) Fields(s ...googleapi.Field) *ProjectsSetDefaultNetworkTierCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ProjectsSetDefaultNetworkTierCall) Context(ctx context.Context) *ProjectsSetDefaultNetworkTierCall {
- 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 *ProjectsSetDefaultNetworkTierCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ProjectsSetDefaultNetworkTierCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectssetdefaultnetworktierrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/setDefaultNetworkTier")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.projects.setDefaultNetworkTier" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *ProjectsSetDefaultNetworkTierCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Sets the default network tier of the project. The default network tier is used when an address/forwardingRule/instance is created without specifying the network tier field.",
- // "flatPath": "projects/{project}/setDefaultNetworkTier",
- // "httpMethod": "POST",
- // "id": "compute.projects.setDefaultNetworkTier",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/setDefaultNetworkTier",
- // "request": {
- // "$ref": "ProjectsSetDefaultNetworkTierRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.projects.setUsageExportBucket":
-
-type ProjectsSetUsageExportBucketCall struct {
- s *Service
- project string
- usageexportlocation *UsageExportLocation
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetUsageExportBucket: Enables the usage export feature and sets the
-// usage export bucket where reports are stored. If you provide an empty
-// request body using this method, the usage export feature will be
-// disabled.
-//
-// - project: Project ID for this request.
-func (r *ProjectsService) SetUsageExportBucket(project string, usageexportlocation *UsageExportLocation) *ProjectsSetUsageExportBucketCall {
- c := &ProjectsSetUsageExportBucketCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.usageexportlocation = usageexportlocation
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *ProjectsSetUsageExportBucketCall) RequestId(requestId string) *ProjectsSetUsageExportBucketCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *ProjectsSetUsageExportBucketCall) Fields(s ...googleapi.Field) *ProjectsSetUsageExportBucketCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ProjectsSetUsageExportBucketCall) Context(ctx context.Context) *ProjectsSetUsageExportBucketCall {
- 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 *ProjectsSetUsageExportBucketCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ProjectsSetUsageExportBucketCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.usageexportlocation)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/setUsageExportBucket")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.projects.setUsageExportBucket" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *ProjectsSetUsageExportBucketCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Enables the usage export feature and sets the usage export bucket where reports are stored. If you provide an empty request body using this method, the usage export feature will be disabled.",
- // "flatPath": "projects/{project}/setUsageExportBucket",
- // "httpMethod": "POST",
- // "id": "compute.projects.setUsageExportBucket",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/setUsageExportBucket",
- // "request": {
- // "$ref": "UsageExportLocation"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/devstorage.full_control",
- // "https://www.googleapis.com/auth/devstorage.read_only",
- // "https://www.googleapis.com/auth/devstorage.read_write"
- // ]
- // }
-
-}
-
-// method id "compute.publicAdvertisedPrefixes.announce":
-
-type PublicAdvertisedPrefixesAnnounceCall struct {
- s *Service
- project string
- publicAdvertisedPrefix string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Announce: Announces the specified PublicAdvertisedPrefix
-//
-// - project: Project ID for this request.
-// - publicAdvertisedPrefix: The name of the public advertised prefix.
-// It should comply with RFC1035.
-func (r *PublicAdvertisedPrefixesService) Announce(project string, publicAdvertisedPrefix string) *PublicAdvertisedPrefixesAnnounceCall {
- c := &PublicAdvertisedPrefixesAnnounceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.publicAdvertisedPrefix = publicAdvertisedPrefix
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *PublicAdvertisedPrefixesAnnounceCall) RequestId(requestId string) *PublicAdvertisedPrefixesAnnounceCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *PublicAdvertisedPrefixesAnnounceCall) Fields(s ...googleapi.Field) *PublicAdvertisedPrefixesAnnounceCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *PublicAdvertisedPrefixesAnnounceCall) Context(ctx context.Context) *PublicAdvertisedPrefixesAnnounceCall {
- 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 *PublicAdvertisedPrefixesAnnounceCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *PublicAdvertisedPrefixesAnnounceCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}/announce")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "publicAdvertisedPrefix": c.publicAdvertisedPrefix,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.publicAdvertisedPrefixes.announce" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *PublicAdvertisedPrefixesAnnounceCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Announces the specified PublicAdvertisedPrefix",
- // "flatPath": "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}/announce",
- // "httpMethod": "POST",
- // "id": "compute.publicAdvertisedPrefixes.announce",
- // "parameterOrder": [
- // "project",
- // "publicAdvertisedPrefix"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "publicAdvertisedPrefix": {
- // "description": "The name of the public advertised prefix. It should comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}/announce",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.publicAdvertisedPrefixes.delete":
-
-type PublicAdvertisedPrefixesDeleteCall struct {
- s *Service
- project string
- publicAdvertisedPrefix string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified PublicAdvertisedPrefix
-//
-// - project: Project ID for this request.
-// - publicAdvertisedPrefix: Name of the PublicAdvertisedPrefix resource
-// to delete.
-func (r *PublicAdvertisedPrefixesService) Delete(project string, publicAdvertisedPrefix string) *PublicAdvertisedPrefixesDeleteCall {
- c := &PublicAdvertisedPrefixesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.publicAdvertisedPrefix = publicAdvertisedPrefix
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *PublicAdvertisedPrefixesDeleteCall) RequestId(requestId string) *PublicAdvertisedPrefixesDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *PublicAdvertisedPrefixesDeleteCall) Fields(s ...googleapi.Field) *PublicAdvertisedPrefixesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *PublicAdvertisedPrefixesDeleteCall) Context(ctx context.Context) *PublicAdvertisedPrefixesDeleteCall {
- 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 *PublicAdvertisedPrefixesDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *PublicAdvertisedPrefixesDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "publicAdvertisedPrefix": c.publicAdvertisedPrefix,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.publicAdvertisedPrefixes.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *PublicAdvertisedPrefixesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified PublicAdvertisedPrefix",
- // "flatPath": "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}",
- // "httpMethod": "DELETE",
- // "id": "compute.publicAdvertisedPrefixes.delete",
- // "parameterOrder": [
- // "project",
- // "publicAdvertisedPrefix"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "publicAdvertisedPrefix": {
- // "description": "Name of the PublicAdvertisedPrefix resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.publicAdvertisedPrefixes.get":
-
-type PublicAdvertisedPrefixesGetCall struct {
- s *Service
- project string
- publicAdvertisedPrefix string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified PublicAdvertisedPrefix resource.
-//
-// - project: Project ID for this request.
-// - publicAdvertisedPrefix: Name of the PublicAdvertisedPrefix resource
-// to return.
-func (r *PublicAdvertisedPrefixesService) Get(project string, publicAdvertisedPrefix string) *PublicAdvertisedPrefixesGetCall {
- c := &PublicAdvertisedPrefixesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.publicAdvertisedPrefix = publicAdvertisedPrefix
- 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 *PublicAdvertisedPrefixesGetCall) Fields(s ...googleapi.Field) *PublicAdvertisedPrefixesGetCall {
- 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 *PublicAdvertisedPrefixesGetCall) IfNoneMatch(entityTag string) *PublicAdvertisedPrefixesGetCall {
- 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 *PublicAdvertisedPrefixesGetCall) Context(ctx context.Context) *PublicAdvertisedPrefixesGetCall {
- 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 *PublicAdvertisedPrefixesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *PublicAdvertisedPrefixesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}")
- 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{
- "project": c.project,
- "publicAdvertisedPrefix": c.publicAdvertisedPrefix,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.publicAdvertisedPrefixes.get" call.
-// Exactly one of *PublicAdvertisedPrefix or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *PublicAdvertisedPrefix.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 *PublicAdvertisedPrefixesGetCall) Do(opts ...googleapi.CallOption) (*PublicAdvertisedPrefix, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &PublicAdvertisedPrefix{
- 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": "Returns the specified PublicAdvertisedPrefix resource.",
- // "flatPath": "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}",
- // "httpMethod": "GET",
- // "id": "compute.publicAdvertisedPrefixes.get",
- // "parameterOrder": [
- // "project",
- // "publicAdvertisedPrefix"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "publicAdvertisedPrefix": {
- // "description": "Name of the PublicAdvertisedPrefix resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}",
- // "response": {
- // "$ref": "PublicAdvertisedPrefix"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.publicAdvertisedPrefixes.insert":
-
-type PublicAdvertisedPrefixesInsertCall struct {
- s *Service
- project string
- publicadvertisedprefix *PublicAdvertisedPrefix
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a PublicAdvertisedPrefix in the specified project
-// using the parameters that are included in the request.
-//
-// - project: Project ID for this request.
-func (r *PublicAdvertisedPrefixesService) Insert(project string, publicadvertisedprefix *PublicAdvertisedPrefix) *PublicAdvertisedPrefixesInsertCall {
- c := &PublicAdvertisedPrefixesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.publicadvertisedprefix = publicadvertisedprefix
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *PublicAdvertisedPrefixesInsertCall) RequestId(requestId string) *PublicAdvertisedPrefixesInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *PublicAdvertisedPrefixesInsertCall) Fields(s ...googleapi.Field) *PublicAdvertisedPrefixesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *PublicAdvertisedPrefixesInsertCall) Context(ctx context.Context) *PublicAdvertisedPrefixesInsertCall {
- 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 *PublicAdvertisedPrefixesInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *PublicAdvertisedPrefixesInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.publicadvertisedprefix)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicAdvertisedPrefixes")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.publicAdvertisedPrefixes.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *PublicAdvertisedPrefixesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a PublicAdvertisedPrefix in the specified project using the parameters that are included in the request.",
- // "flatPath": "projects/{project}/global/publicAdvertisedPrefixes",
- // "httpMethod": "POST",
- // "id": "compute.publicAdvertisedPrefixes.insert",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/publicAdvertisedPrefixes",
- // "request": {
- // "$ref": "PublicAdvertisedPrefix"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.publicAdvertisedPrefixes.list":
-
-type PublicAdvertisedPrefixesListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Lists the PublicAdvertisedPrefixes for a project.
-//
-// - project: Project ID for this request.
-func (r *PublicAdvertisedPrefixesService) List(project string) *PublicAdvertisedPrefixesListCall {
- c := &PublicAdvertisedPrefixesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *PublicAdvertisedPrefixesListCall) Filter(filter string) *PublicAdvertisedPrefixesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *PublicAdvertisedPrefixesListCall) MaxResults(maxResults int64) *PublicAdvertisedPrefixesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *PublicAdvertisedPrefixesListCall) OrderBy(orderBy string) *PublicAdvertisedPrefixesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *PublicAdvertisedPrefixesListCall) PageToken(pageToken string) *PublicAdvertisedPrefixesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *PublicAdvertisedPrefixesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *PublicAdvertisedPrefixesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *PublicAdvertisedPrefixesListCall) Fields(s ...googleapi.Field) *PublicAdvertisedPrefixesListCall {
- 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 *PublicAdvertisedPrefixesListCall) IfNoneMatch(entityTag string) *PublicAdvertisedPrefixesListCall {
- 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 *PublicAdvertisedPrefixesListCall) Context(ctx context.Context) *PublicAdvertisedPrefixesListCall {
- 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 *PublicAdvertisedPrefixesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *PublicAdvertisedPrefixesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/publicAdvertisedPrefixes")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.publicAdvertisedPrefixes.list" call.
-// Exactly one of *PublicAdvertisedPrefixList or error will be non-nil.
-// Any non-2xx status code is an error. Response headers are in either
-// *PublicAdvertisedPrefixList.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 *PublicAdvertisedPrefixesListCall) Do(opts ...googleapi.CallOption) (*PublicAdvertisedPrefixList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &PublicAdvertisedPrefixList{
- 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": "Lists the PublicAdvertisedPrefixes for a project.",
- // "flatPath": "projects/{project}/global/publicAdvertisedPrefixes",
- // "httpMethod": "GET",
- // "id": "compute.publicAdvertisedPrefixes.list",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/publicAdvertisedPrefixes",
- // "response": {
- // "$ref": "PublicAdvertisedPrefixList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *PublicAdvertisedPrefixesListCall) Pages(ctx context.Context, f func(*PublicAdvertisedPrefixList) 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 "compute.publicAdvertisedPrefixes.patch":
-
-type PublicAdvertisedPrefixesPatchCall struct {
- s *Service
- project string
- publicAdvertisedPrefix string
- publicadvertisedprefix *PublicAdvertisedPrefix
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Patches the specified Router resource with the data included
-// in the request. This method supports PATCH semantics and uses JSON
-// merge patch format and processing rules.
-//
-// - project: Project ID for this request.
-// - publicAdvertisedPrefix: Name of the PublicAdvertisedPrefix resource
-// to patch.
-func (r *PublicAdvertisedPrefixesService) Patch(project string, publicAdvertisedPrefix string, publicadvertisedprefix *PublicAdvertisedPrefix) *PublicAdvertisedPrefixesPatchCall {
- c := &PublicAdvertisedPrefixesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.publicAdvertisedPrefix = publicAdvertisedPrefix
- c.publicadvertisedprefix = publicadvertisedprefix
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *PublicAdvertisedPrefixesPatchCall) RequestId(requestId string) *PublicAdvertisedPrefixesPatchCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *PublicAdvertisedPrefixesPatchCall) Fields(s ...googleapi.Field) *PublicAdvertisedPrefixesPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *PublicAdvertisedPrefixesPatchCall) Context(ctx context.Context) *PublicAdvertisedPrefixesPatchCall {
- 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 *PublicAdvertisedPrefixesPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *PublicAdvertisedPrefixesPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.publicadvertisedprefix)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "publicAdvertisedPrefix": c.publicAdvertisedPrefix,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.publicAdvertisedPrefixes.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *PublicAdvertisedPrefixesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules.",
- // "flatPath": "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}",
- // "httpMethod": "PATCH",
- // "id": "compute.publicAdvertisedPrefixes.patch",
- // "parameterOrder": [
- // "project",
- // "publicAdvertisedPrefix"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "publicAdvertisedPrefix": {
- // "description": "Name of the PublicAdvertisedPrefix resource to patch.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}",
- // "request": {
- // "$ref": "PublicAdvertisedPrefix"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.publicAdvertisedPrefixes.withdraw":
-
-type PublicAdvertisedPrefixesWithdrawCall struct {
- s *Service
- project string
- publicAdvertisedPrefix string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Withdraw: Withdraws the specified PublicAdvertisedPrefix
-//
-// - project: Project ID for this request.
-// - publicAdvertisedPrefix: The name of the public advertised prefix.
-// It should comply with RFC1035.
-func (r *PublicAdvertisedPrefixesService) Withdraw(project string, publicAdvertisedPrefix string) *PublicAdvertisedPrefixesWithdrawCall {
- c := &PublicAdvertisedPrefixesWithdrawCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.publicAdvertisedPrefix = publicAdvertisedPrefix
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *PublicAdvertisedPrefixesWithdrawCall) RequestId(requestId string) *PublicAdvertisedPrefixesWithdrawCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *PublicAdvertisedPrefixesWithdrawCall) Fields(s ...googleapi.Field) *PublicAdvertisedPrefixesWithdrawCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *PublicAdvertisedPrefixesWithdrawCall) Context(ctx context.Context) *PublicAdvertisedPrefixesWithdrawCall {
- 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 *PublicAdvertisedPrefixesWithdrawCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *PublicAdvertisedPrefixesWithdrawCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}/withdraw")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "publicAdvertisedPrefix": c.publicAdvertisedPrefix,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.publicAdvertisedPrefixes.withdraw" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *PublicAdvertisedPrefixesWithdrawCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Withdraws the specified PublicAdvertisedPrefix",
- // "flatPath": "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}/withdraw",
- // "httpMethod": "POST",
- // "id": "compute.publicAdvertisedPrefixes.withdraw",
- // "parameterOrder": [
- // "project",
- // "publicAdvertisedPrefix"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "publicAdvertisedPrefix": {
- // "description": "The name of the public advertised prefix. It should comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}/withdraw",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.publicDelegatedPrefixes.aggregatedList":
-
-type PublicDelegatedPrefixesAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Lists all PublicDelegatedPrefix resources owned by
-// the specific project across all scopes.
-//
-// - project: Name of the project scoping this request.
-func (r *PublicDelegatedPrefixesService) AggregatedList(project string) *PublicDelegatedPrefixesAggregatedListCall {
- c := &PublicDelegatedPrefixesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *PublicDelegatedPrefixesAggregatedListCall) Filter(filter string) *PublicDelegatedPrefixesAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *PublicDelegatedPrefixesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *PublicDelegatedPrefixesAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *PublicDelegatedPrefixesAggregatedListCall) MaxResults(maxResults int64) *PublicDelegatedPrefixesAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *PublicDelegatedPrefixesAggregatedListCall) OrderBy(orderBy string) *PublicDelegatedPrefixesAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *PublicDelegatedPrefixesAggregatedListCall) PageToken(pageToken string) *PublicDelegatedPrefixesAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *PublicDelegatedPrefixesAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *PublicDelegatedPrefixesAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *PublicDelegatedPrefixesAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *PublicDelegatedPrefixesAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *PublicDelegatedPrefixesAggregatedListCall) Fields(s ...googleapi.Field) *PublicDelegatedPrefixesAggregatedListCall {
- 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 *PublicDelegatedPrefixesAggregatedListCall) IfNoneMatch(entityTag string) *PublicDelegatedPrefixesAggregatedListCall {
- 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 *PublicDelegatedPrefixesAggregatedListCall) Context(ctx context.Context) *PublicDelegatedPrefixesAggregatedListCall {
- 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 *PublicDelegatedPrefixesAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *PublicDelegatedPrefixesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/publicDelegatedPrefixes")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.publicDelegatedPrefixes.aggregatedList" call.
-// Exactly one of *PublicDelegatedPrefixAggregatedList or error will be
-// non-nil. Any non-2xx status code is an error. Response headers are in
-// either *PublicDelegatedPrefixAggregatedList.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 *PublicDelegatedPrefixesAggregatedListCall) Do(opts ...googleapi.CallOption) (*PublicDelegatedPrefixAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &PublicDelegatedPrefixAggregatedList{
- 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": "Lists all PublicDelegatedPrefix resources owned by the specific project across all scopes.",
- // "flatPath": "projects/{project}/aggregated/publicDelegatedPrefixes",
- // "httpMethod": "GET",
- // "id": "compute.publicDelegatedPrefixes.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Name of the project scoping this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/publicDelegatedPrefixes",
- // "response": {
- // "$ref": "PublicDelegatedPrefixAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *PublicDelegatedPrefixesAggregatedListCall) Pages(ctx context.Context, f func(*PublicDelegatedPrefixAggregatedList) 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 "compute.publicDelegatedPrefixes.announce":
-
-type PublicDelegatedPrefixesAnnounceCall struct {
- s *Service
- project string
- region string
- publicDelegatedPrefix string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Announce: Announces the specified PublicDelegatedPrefix in the given
-// region.
-//
-// - project: Project ID for this request.
-// - publicDelegatedPrefix: The name of the public delegated prefix. It
-// should comply with RFC1035.
-// - region: The name of the region where the public delegated prefix is
-// located. It should comply with RFC1035.
-func (r *PublicDelegatedPrefixesService) Announce(project string, region string, publicDelegatedPrefix string) *PublicDelegatedPrefixesAnnounceCall {
- c := &PublicDelegatedPrefixesAnnounceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.publicDelegatedPrefix = publicDelegatedPrefix
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *PublicDelegatedPrefixesAnnounceCall) RequestId(requestId string) *PublicDelegatedPrefixesAnnounceCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *PublicDelegatedPrefixesAnnounceCall) Fields(s ...googleapi.Field) *PublicDelegatedPrefixesAnnounceCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *PublicDelegatedPrefixesAnnounceCall) Context(ctx context.Context) *PublicDelegatedPrefixesAnnounceCall {
- 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 *PublicDelegatedPrefixesAnnounceCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *PublicDelegatedPrefixesAnnounceCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}/announce")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "publicDelegatedPrefix": c.publicDelegatedPrefix,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.publicDelegatedPrefixes.announce" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *PublicDelegatedPrefixesAnnounceCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Announces the specified PublicDelegatedPrefix in the given region.",
- // "flatPath": "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}/announce",
- // "httpMethod": "POST",
- // "id": "compute.publicDelegatedPrefixes.announce",
- // "parameterOrder": [
- // "project",
- // "region",
- // "publicDelegatedPrefix"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "publicDelegatedPrefix": {
- // "description": "The name of the public delegated prefix. It should comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region where the public delegated prefix is located. It should comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}/announce",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.publicDelegatedPrefixes.delete":
-
-type PublicDelegatedPrefixesDeleteCall struct {
- s *Service
- project string
- region string
- publicDelegatedPrefix string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified PublicDelegatedPrefix in the given
-// region.
-//
-// - project: Project ID for this request.
-// - publicDelegatedPrefix: Name of the PublicDelegatedPrefix resource
-// to delete.
-// - region: Name of the region of this request.
-func (r *PublicDelegatedPrefixesService) Delete(project string, region string, publicDelegatedPrefix string) *PublicDelegatedPrefixesDeleteCall {
- c := &PublicDelegatedPrefixesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.publicDelegatedPrefix = publicDelegatedPrefix
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *PublicDelegatedPrefixesDeleteCall) RequestId(requestId string) *PublicDelegatedPrefixesDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *PublicDelegatedPrefixesDeleteCall) Fields(s ...googleapi.Field) *PublicDelegatedPrefixesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *PublicDelegatedPrefixesDeleteCall) Context(ctx context.Context) *PublicDelegatedPrefixesDeleteCall {
- 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 *PublicDelegatedPrefixesDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *PublicDelegatedPrefixesDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "publicDelegatedPrefix": c.publicDelegatedPrefix,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.publicDelegatedPrefixes.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *PublicDelegatedPrefixesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified PublicDelegatedPrefix in the given region.",
- // "flatPath": "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}",
- // "httpMethod": "DELETE",
- // "id": "compute.publicDelegatedPrefixes.delete",
- // "parameterOrder": [
- // "project",
- // "region",
- // "publicDelegatedPrefix"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "publicDelegatedPrefix": {
- // "description": "Name of the PublicDelegatedPrefix resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region of this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.publicDelegatedPrefixes.get":
-
-type PublicDelegatedPrefixesGetCall struct {
- s *Service
- project string
- region string
- publicDelegatedPrefix string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified PublicDelegatedPrefix resource in the
-// given region.
-//
-// - project: Project ID for this request.
-// - publicDelegatedPrefix: Name of the PublicDelegatedPrefix resource
-// to return.
-// - region: Name of the region of this request.
-func (r *PublicDelegatedPrefixesService) Get(project string, region string, publicDelegatedPrefix string) *PublicDelegatedPrefixesGetCall {
- c := &PublicDelegatedPrefixesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.publicDelegatedPrefix = publicDelegatedPrefix
- 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 *PublicDelegatedPrefixesGetCall) Fields(s ...googleapi.Field) *PublicDelegatedPrefixesGetCall {
- 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 *PublicDelegatedPrefixesGetCall) IfNoneMatch(entityTag string) *PublicDelegatedPrefixesGetCall {
- 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 *PublicDelegatedPrefixesGetCall) Context(ctx context.Context) *PublicDelegatedPrefixesGetCall {
- 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 *PublicDelegatedPrefixesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *PublicDelegatedPrefixesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}")
- 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{
- "project": c.project,
- "region": c.region,
- "publicDelegatedPrefix": c.publicDelegatedPrefix,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.publicDelegatedPrefixes.get" call.
-// Exactly one of *PublicDelegatedPrefix or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *PublicDelegatedPrefix.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 *PublicDelegatedPrefixesGetCall) Do(opts ...googleapi.CallOption) (*PublicDelegatedPrefix, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &PublicDelegatedPrefix{
- 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": "Returns the specified PublicDelegatedPrefix resource in the given region.",
- // "flatPath": "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}",
- // "httpMethod": "GET",
- // "id": "compute.publicDelegatedPrefixes.get",
- // "parameterOrder": [
- // "project",
- // "region",
- // "publicDelegatedPrefix"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "publicDelegatedPrefix": {
- // "description": "Name of the PublicDelegatedPrefix resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region of this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}",
- // "response": {
- // "$ref": "PublicDelegatedPrefix"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.publicDelegatedPrefixes.insert":
-
-type PublicDelegatedPrefixesInsertCall struct {
- s *Service
- project string
- region string
- publicdelegatedprefix *PublicDelegatedPrefix
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a PublicDelegatedPrefix in the specified project in
-// the given region using the parameters that are included in the
-// request.
-//
-// - project: Project ID for this request.
-// - region: Name of the region of this request.
-func (r *PublicDelegatedPrefixesService) Insert(project string, region string, publicdelegatedprefix *PublicDelegatedPrefix) *PublicDelegatedPrefixesInsertCall {
- c := &PublicDelegatedPrefixesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.publicdelegatedprefix = publicdelegatedprefix
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *PublicDelegatedPrefixesInsertCall) RequestId(requestId string) *PublicDelegatedPrefixesInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *PublicDelegatedPrefixesInsertCall) Fields(s ...googleapi.Field) *PublicDelegatedPrefixesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *PublicDelegatedPrefixesInsertCall) Context(ctx context.Context) *PublicDelegatedPrefixesInsertCall {
- 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 *PublicDelegatedPrefixesInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *PublicDelegatedPrefixesInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.publicdelegatedprefix)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/publicDelegatedPrefixes")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.publicDelegatedPrefixes.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *PublicDelegatedPrefixesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a PublicDelegatedPrefix in the specified project in the given region using the parameters that are included in the request.",
- // "flatPath": "projects/{project}/regions/{region}/publicDelegatedPrefixes",
- // "httpMethod": "POST",
- // "id": "compute.publicDelegatedPrefixes.insert",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region of this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/publicDelegatedPrefixes",
- // "request": {
- // "$ref": "PublicDelegatedPrefix"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.publicDelegatedPrefixes.list":
-
-type PublicDelegatedPrefixesListCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Lists the PublicDelegatedPrefixes for a project in the given
-// region.
-//
-// - project: Project ID for this request.
-// - region: Name of the region of this request.
-func (r *PublicDelegatedPrefixesService) List(project string, region string) *PublicDelegatedPrefixesListCall {
- c := &PublicDelegatedPrefixesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *PublicDelegatedPrefixesListCall) Filter(filter string) *PublicDelegatedPrefixesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *PublicDelegatedPrefixesListCall) MaxResults(maxResults int64) *PublicDelegatedPrefixesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *PublicDelegatedPrefixesListCall) OrderBy(orderBy string) *PublicDelegatedPrefixesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *PublicDelegatedPrefixesListCall) PageToken(pageToken string) *PublicDelegatedPrefixesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *PublicDelegatedPrefixesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *PublicDelegatedPrefixesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *PublicDelegatedPrefixesListCall) Fields(s ...googleapi.Field) *PublicDelegatedPrefixesListCall {
- 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 *PublicDelegatedPrefixesListCall) IfNoneMatch(entityTag string) *PublicDelegatedPrefixesListCall {
- 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 *PublicDelegatedPrefixesListCall) Context(ctx context.Context) *PublicDelegatedPrefixesListCall {
- 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 *PublicDelegatedPrefixesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *PublicDelegatedPrefixesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/publicDelegatedPrefixes")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.publicDelegatedPrefixes.list" call.
-// Exactly one of *PublicDelegatedPrefixList or error will be non-nil.
-// Any non-2xx status code is an error. Response headers are in either
-// *PublicDelegatedPrefixList.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 *PublicDelegatedPrefixesListCall) Do(opts ...googleapi.CallOption) (*PublicDelegatedPrefixList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &PublicDelegatedPrefixList{
- 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": "Lists the PublicDelegatedPrefixes for a project in the given region.",
- // "flatPath": "projects/{project}/regions/{region}/publicDelegatedPrefixes",
- // "httpMethod": "GET",
- // "id": "compute.publicDelegatedPrefixes.list",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region of this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/publicDelegatedPrefixes",
- // "response": {
- // "$ref": "PublicDelegatedPrefixList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *PublicDelegatedPrefixesListCall) Pages(ctx context.Context, f func(*PublicDelegatedPrefixList) 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 "compute.publicDelegatedPrefixes.patch":
-
-type PublicDelegatedPrefixesPatchCall struct {
- s *Service
- project string
- region string
- publicDelegatedPrefix string
- publicdelegatedprefix *PublicDelegatedPrefix
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Patches the specified PublicDelegatedPrefix resource with the
-// data included in the request. This method supports PATCH semantics
-// and uses JSON merge patch format and processing rules.
-//
-// - project: Project ID for this request.
-// - publicDelegatedPrefix: Name of the PublicDelegatedPrefix resource
-// to patch.
-// - region: Name of the region for this request.
-func (r *PublicDelegatedPrefixesService) Patch(project string, region string, publicDelegatedPrefix string, publicdelegatedprefix *PublicDelegatedPrefix) *PublicDelegatedPrefixesPatchCall {
- c := &PublicDelegatedPrefixesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.publicDelegatedPrefix = publicDelegatedPrefix
- c.publicdelegatedprefix = publicdelegatedprefix
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *PublicDelegatedPrefixesPatchCall) RequestId(requestId string) *PublicDelegatedPrefixesPatchCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *PublicDelegatedPrefixesPatchCall) Fields(s ...googleapi.Field) *PublicDelegatedPrefixesPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *PublicDelegatedPrefixesPatchCall) Context(ctx context.Context) *PublicDelegatedPrefixesPatchCall {
- 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 *PublicDelegatedPrefixesPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *PublicDelegatedPrefixesPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.publicdelegatedprefix)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "publicDelegatedPrefix": c.publicDelegatedPrefix,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.publicDelegatedPrefixes.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *PublicDelegatedPrefixesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Patches the specified PublicDelegatedPrefix resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules.",
- // "flatPath": "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}",
- // "httpMethod": "PATCH",
- // "id": "compute.publicDelegatedPrefixes.patch",
- // "parameterOrder": [
- // "project",
- // "region",
- // "publicDelegatedPrefix"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "publicDelegatedPrefix": {
- // "description": "Name of the PublicDelegatedPrefix resource to patch.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}",
- // "request": {
- // "$ref": "PublicDelegatedPrefix"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.publicDelegatedPrefixes.withdraw":
-
-type PublicDelegatedPrefixesWithdrawCall struct {
- s *Service
- project string
- region string
- publicDelegatedPrefix string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Withdraw: Withdraws the specified PublicDelegatedPrefix in the given
-// region.
-//
-// - project: Project ID for this request.
-// - publicDelegatedPrefix: The name of the public delegated prefix. It
-// should comply with RFC1035.
-// - region: The name of the region where the public delegated prefix is
-// located. It should comply with RFC1035.
-func (r *PublicDelegatedPrefixesService) Withdraw(project string, region string, publicDelegatedPrefix string) *PublicDelegatedPrefixesWithdrawCall {
- c := &PublicDelegatedPrefixesWithdrawCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.publicDelegatedPrefix = publicDelegatedPrefix
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *PublicDelegatedPrefixesWithdrawCall) RequestId(requestId string) *PublicDelegatedPrefixesWithdrawCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *PublicDelegatedPrefixesWithdrawCall) Fields(s ...googleapi.Field) *PublicDelegatedPrefixesWithdrawCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *PublicDelegatedPrefixesWithdrawCall) Context(ctx context.Context) *PublicDelegatedPrefixesWithdrawCall {
- 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 *PublicDelegatedPrefixesWithdrawCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *PublicDelegatedPrefixesWithdrawCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}/withdraw")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "publicDelegatedPrefix": c.publicDelegatedPrefix,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.publicDelegatedPrefixes.withdraw" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *PublicDelegatedPrefixesWithdrawCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Withdraws the specified PublicDelegatedPrefix in the given region.",
- // "flatPath": "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}/withdraw",
- // "httpMethod": "POST",
- // "id": "compute.publicDelegatedPrefixes.withdraw",
- // "parameterOrder": [
- // "project",
- // "region",
- // "publicDelegatedPrefix"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "publicDelegatedPrefix": {
- // "description": "The name of the public delegated prefix. It should comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region where the public delegated prefix is located. It should comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}/withdraw",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionAutoscalers.delete":
-
-type RegionAutoscalersDeleteCall struct {
- s *Service
- project string
- region string
- autoscaler string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified autoscaler.
-//
-// - autoscaler: Name of the autoscaler to delete.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionAutoscalersService) Delete(project string, region string, autoscaler string) *RegionAutoscalersDeleteCall {
- c := &RegionAutoscalersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.autoscaler = autoscaler
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionAutoscalersDeleteCall) RequestId(requestId string) *RegionAutoscalersDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionAutoscalersDeleteCall) Fields(s ...googleapi.Field) *RegionAutoscalersDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionAutoscalersDeleteCall) Context(ctx context.Context) *RegionAutoscalersDeleteCall {
- 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 *RegionAutoscalersDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionAutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/autoscalers/{autoscaler}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "autoscaler": c.autoscaler,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionAutoscalers.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionAutoscalersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified autoscaler.",
- // "flatPath": "projects/{project}/regions/{region}/autoscalers/{autoscaler}",
- // "httpMethod": "DELETE",
- // "id": "compute.regionAutoscalers.delete",
- // "parameterOrder": [
- // "project",
- // "region",
- // "autoscaler"
- // ],
- // "parameters": {
- // "autoscaler": {
- // "description": "Name of the autoscaler to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/autoscalers/{autoscaler}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionAutoscalers.get":
-
-type RegionAutoscalersGetCall struct {
- s *Service
- project string
- region string
- autoscaler string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified autoscaler.
-//
-// - autoscaler: Name of the autoscaler to return.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionAutoscalersService) Get(project string, region string, autoscaler string) *RegionAutoscalersGetCall {
- c := &RegionAutoscalersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.autoscaler = autoscaler
- 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 *RegionAutoscalersGetCall) Fields(s ...googleapi.Field) *RegionAutoscalersGetCall {
- 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 *RegionAutoscalersGetCall) IfNoneMatch(entityTag string) *RegionAutoscalersGetCall {
- 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 *RegionAutoscalersGetCall) Context(ctx context.Context) *RegionAutoscalersGetCall {
- 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 *RegionAutoscalersGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionAutoscalersGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/autoscalers/{autoscaler}")
- 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{
- "project": c.project,
- "region": c.region,
- "autoscaler": c.autoscaler,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionAutoscalers.get" call.
-// Exactly one of *Autoscaler or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Autoscaler.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 *RegionAutoscalersGetCall) Do(opts ...googleapi.CallOption) (*Autoscaler, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Autoscaler{
- 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": "Returns the specified autoscaler.",
- // "flatPath": "projects/{project}/regions/{region}/autoscalers/{autoscaler}",
- // "httpMethod": "GET",
- // "id": "compute.regionAutoscalers.get",
- // "parameterOrder": [
- // "project",
- // "region",
- // "autoscaler"
- // ],
- // "parameters": {
- // "autoscaler": {
- // "description": "Name of the autoscaler to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/autoscalers/{autoscaler}",
- // "response": {
- // "$ref": "Autoscaler"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.regionAutoscalers.insert":
-
-type RegionAutoscalersInsertCall struct {
- s *Service
- project string
- region string
- autoscaler *Autoscaler
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates an autoscaler in the specified project using the data
-// included in the request.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionAutoscalersService) Insert(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersInsertCall {
- c := &RegionAutoscalersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.autoscaler = autoscaler
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionAutoscalersInsertCall) RequestId(requestId string) *RegionAutoscalersInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionAutoscalersInsertCall) Fields(s ...googleapi.Field) *RegionAutoscalersInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionAutoscalersInsertCall) Context(ctx context.Context) *RegionAutoscalersInsertCall {
- 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 *RegionAutoscalersInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionAutoscalersInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/autoscalers")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionAutoscalers.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionAutoscalersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates an autoscaler in the specified project using the data included in the request.",
- // "flatPath": "projects/{project}/regions/{region}/autoscalers",
- // "httpMethod": "POST",
- // "id": "compute.regionAutoscalers.insert",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/autoscalers",
- // "request": {
- // "$ref": "Autoscaler"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionAutoscalers.list":
-
-type RegionAutoscalersListCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves a list of autoscalers contained within the specified
-// region.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionAutoscalersService) List(project string, region string) *RegionAutoscalersListCall {
- c := &RegionAutoscalersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *RegionAutoscalersListCall) Filter(filter string) *RegionAutoscalersListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *RegionAutoscalersListCall) MaxResults(maxResults int64) *RegionAutoscalersListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *RegionAutoscalersListCall) OrderBy(orderBy string) *RegionAutoscalersListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *RegionAutoscalersListCall) PageToken(pageToken string) *RegionAutoscalersListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *RegionAutoscalersListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionAutoscalersListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *RegionAutoscalersListCall) Fields(s ...googleapi.Field) *RegionAutoscalersListCall {
- 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 *RegionAutoscalersListCall) IfNoneMatch(entityTag string) *RegionAutoscalersListCall {
- 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 *RegionAutoscalersListCall) Context(ctx context.Context) *RegionAutoscalersListCall {
- 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 *RegionAutoscalersListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionAutoscalersListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/autoscalers")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionAutoscalers.list" call.
-// Exactly one of *RegionAutoscalerList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *RegionAutoscalerList.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 *RegionAutoscalersListCall) Do(opts ...googleapi.CallOption) (*RegionAutoscalerList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &RegionAutoscalerList{
- 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": "Retrieves a list of autoscalers contained within the specified region.",
- // "flatPath": "projects/{project}/regions/{region}/autoscalers",
- // "httpMethod": "GET",
- // "id": "compute.regionAutoscalers.list",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/autoscalers",
- // "response": {
- // "$ref": "RegionAutoscalerList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *RegionAutoscalersListCall) Pages(ctx context.Context, f func(*RegionAutoscalerList) 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 "compute.regionAutoscalers.patch":
-
-type RegionAutoscalersPatchCall struct {
- s *Service
- project string
- region string
- autoscaler *Autoscaler
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Updates an autoscaler in the specified project using the data
-// included in the request. This method supports PATCH semantics and
-// uses the JSON merge patch format and processing rules.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionAutoscalersService) Patch(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersPatchCall {
- c := &RegionAutoscalersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.autoscaler = autoscaler
- return c
-}
-
-// Autoscaler sets the optional parameter "autoscaler": Name of the
-// autoscaler to patch.
-func (c *RegionAutoscalersPatchCall) Autoscaler(autoscaler string) *RegionAutoscalersPatchCall {
- c.urlParams_.Set("autoscaler", autoscaler)
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionAutoscalersPatchCall) RequestId(requestId string) *RegionAutoscalersPatchCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionAutoscalersPatchCall) Fields(s ...googleapi.Field) *RegionAutoscalersPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionAutoscalersPatchCall) Context(ctx context.Context) *RegionAutoscalersPatchCall {
- 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 *RegionAutoscalersPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionAutoscalersPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/autoscalers")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionAutoscalers.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionAutoscalersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
- // "flatPath": "projects/{project}/regions/{region}/autoscalers",
- // "httpMethod": "PATCH",
- // "id": "compute.regionAutoscalers.patch",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "autoscaler": {
- // "description": "Name of the autoscaler to patch.",
- // "location": "query",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/autoscalers",
- // "request": {
- // "$ref": "Autoscaler"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionAutoscalers.update":
-
-type RegionAutoscalersUpdateCall struct {
- s *Service
- project string
- region string
- autoscaler *Autoscaler
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Update: Updates an autoscaler in the specified project using the data
-// included in the request.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionAutoscalersService) Update(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersUpdateCall {
- c := &RegionAutoscalersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.autoscaler = autoscaler
- return c
-}
-
-// Autoscaler sets the optional parameter "autoscaler": Name of the
-// autoscaler to update.
-func (c *RegionAutoscalersUpdateCall) Autoscaler(autoscaler string) *RegionAutoscalersUpdateCall {
- c.urlParams_.Set("autoscaler", autoscaler)
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionAutoscalersUpdateCall) RequestId(requestId string) *RegionAutoscalersUpdateCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionAutoscalersUpdateCall) Fields(s ...googleapi.Field) *RegionAutoscalersUpdateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionAutoscalersUpdateCall) Context(ctx context.Context) *RegionAutoscalersUpdateCall {
- 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 *RegionAutoscalersUpdateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionAutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/autoscalers")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PUT", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionAutoscalers.update" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionAutoscalersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Updates an autoscaler in the specified project using the data included in the request.",
- // "flatPath": "projects/{project}/regions/{region}/autoscalers",
- // "httpMethod": "PUT",
- // "id": "compute.regionAutoscalers.update",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "autoscaler": {
- // "description": "Name of the autoscaler to update.",
- // "location": "query",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/autoscalers",
- // "request": {
- // "$ref": "Autoscaler"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionBackendServices.delete":
-
-type RegionBackendServicesDeleteCall struct {
- s *Service
- project string
- region string
- backendService string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified regional BackendService resource.
-//
-// - backendService: Name of the BackendService resource to delete.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionBackendServicesService) Delete(project string, region string, backendService string) *RegionBackendServicesDeleteCall {
- c := &RegionBackendServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.backendService = backendService
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionBackendServicesDeleteCall) RequestId(requestId string) *RegionBackendServicesDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionBackendServicesDeleteCall) Fields(s ...googleapi.Field) *RegionBackendServicesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionBackendServicesDeleteCall) Context(ctx context.Context) *RegionBackendServicesDeleteCall {
- 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 *RegionBackendServicesDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionBackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/{backendService}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "backendService": c.backendService,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionBackendServices.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionBackendServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified regional BackendService resource.",
- // "flatPath": "projects/{project}/regions/{region}/backendServices/{backendService}",
- // "httpMethod": "DELETE",
- // "id": "compute.regionBackendServices.delete",
- // "parameterOrder": [
- // "project",
- // "region",
- // "backendService"
- // ],
- // "parameters": {
- // "backendService": {
- // "description": "Name of the BackendService resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/backendServices/{backendService}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionBackendServices.get":
-
-type RegionBackendServicesGetCall struct {
- s *Service
- project string
- region string
- backendService string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified regional BackendService resource.
-//
-// - backendService: Name of the BackendService resource to return.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionBackendServicesService) Get(project string, region string, backendService string) *RegionBackendServicesGetCall {
- c := &RegionBackendServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.backendService = backendService
- 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 *RegionBackendServicesGetCall) Fields(s ...googleapi.Field) *RegionBackendServicesGetCall {
- 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 *RegionBackendServicesGetCall) IfNoneMatch(entityTag string) *RegionBackendServicesGetCall {
- 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 *RegionBackendServicesGetCall) Context(ctx context.Context) *RegionBackendServicesGetCall {
- 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 *RegionBackendServicesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionBackendServicesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/backendServices/{backendService}")
- 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{
- "project": c.project,
- "region": c.region,
- "backendService": c.backendService,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionBackendServices.get" call.
-// Exactly one of *BackendService or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *BackendService.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 *RegionBackendServicesGetCall) Do(opts ...googleapi.CallOption) (*BackendService, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &BackendService{
- 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": "Returns the specified regional BackendService resource.",
- // "flatPath": "projects/{project}/regions/{region}/backendServices/{backendService}",
- // "httpMethod": "GET",
- // "id": "compute.regionBackendServices.get",
- // "parameterOrder": [
- // "project",
- // "region",
- // "backendService"
- // ],
- // "parameters": {
- // "backendService": {
- // "description": "Name of the BackendService resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/backendServices/{backendService}",
- // "response": {
- // "$ref": "BackendService"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.regionBackendServices.getHealth":
-
-type RegionBackendServicesGetHealthCall struct {
- s *Service
- project string
- region string
- backendService string
- resourcegroupreference *ResourceGroupReference
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetHealth: Gets the most recent health check results for this
-// regional BackendService.
-//
-// - backendService: Name of the BackendService resource for which to
-// get health.
-// - project: .
-// - region: Name of the region scoping this request.
-func (r *RegionBackendServicesService) GetHealth(project string, region string, backendService string, resourcegroupreference *ResourceGroupReference) *RegionBackendServicesGetHealthCall {
- c := &RegionBackendServicesGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.backendService = backendService
- c.resourcegroupreference = resourcegroupreference
- 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 *RegionBackendServicesGetHealthCall) Fields(s ...googleapi.Field) *RegionBackendServicesGetHealthCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionBackendServicesGetHealthCall) Context(ctx context.Context) *RegionBackendServicesGetHealthCall {
- 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 *RegionBackendServicesGetHealthCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionBackendServicesGetHealthCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/{backendService}/getHealth")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "backendService": c.backendService,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionBackendServices.getHealth" call.
-// Exactly one of *BackendServiceGroupHealth or error will be non-nil.
-// Any non-2xx status code is an error. Response headers are in either
-// *BackendServiceGroupHealth.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 *RegionBackendServicesGetHealthCall) Do(opts ...googleapi.CallOption) (*BackendServiceGroupHealth, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &BackendServiceGroupHealth{
- 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": "Gets the most recent health check results for this regional BackendService.",
- // "flatPath": "projects/{project}/regions/{region}/backendServices/{backendService}/getHealth",
- // "httpMethod": "POST",
- // "id": "compute.regionBackendServices.getHealth",
- // "parameterOrder": [
- // "project",
- // "region",
- // "backendService"
- // ],
- // "parameters": {
- // "backendService": {
- // "description": "Name of the BackendService resource for which to get health.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/backendServices/{backendService}/getHealth",
- // "request": {
- // "$ref": "ResourceGroupReference"
- // },
- // "response": {
- // "$ref": "BackendServiceGroupHealth"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.regionBackendServices.getIamPolicy":
-
-type RegionBackendServicesGetIamPolicyCall struct {
- s *Service
- project string
- region string
- resource string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetIamPolicy: Gets the access control policy for a resource. May be
-// empty if no such policy or resource exists.
-//
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-// - resource: Name or id of the resource for this request.
-func (r *RegionBackendServicesService) GetIamPolicy(project string, region string, resource string) *RegionBackendServicesGetIamPolicyCall {
- c := &RegionBackendServicesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.resource = resource
- return c
-}
-
-// OptionsRequestedPolicyVersion sets the optional parameter
-// "optionsRequestedPolicyVersion": Requested IAM Policy version.
-func (c *RegionBackendServicesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *RegionBackendServicesGetIamPolicyCall {
- c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
- 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 *RegionBackendServicesGetIamPolicyCall) Fields(s ...googleapi.Field) *RegionBackendServicesGetIamPolicyCall {
- 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 *RegionBackendServicesGetIamPolicyCall) IfNoneMatch(entityTag string) *RegionBackendServicesGetIamPolicyCall {
- 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 *RegionBackendServicesGetIamPolicyCall) Context(ctx context.Context) *RegionBackendServicesGetIamPolicyCall {
- 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 *RegionBackendServicesGetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionBackendServicesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/backendServices/{resource}/getIamPolicy")
- 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{
- "project": c.project,
- "region": c.region,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionBackendServices.getIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *RegionBackendServicesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
- // "flatPath": "projects/{project}/regions/{region}/backendServices/{resource}/getIamPolicy",
- // "httpMethod": "GET",
- // "id": "compute.regionBackendServices.getIamPolicy",
- // "parameterOrder": [
- // "project",
- // "region",
- // "resource"
- // ],
- // "parameters": {
- // "optionsRequestedPolicyVersion": {
- // "description": "Requested IAM Policy version.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/backendServices/{resource}/getIamPolicy",
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.regionBackendServices.insert":
-
-type RegionBackendServicesInsertCall struct {
- s *Service
- project string
- region string
- backendservice *BackendService
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a regional BackendService resource in the specified
-// project using the data included in the request. For more information,
-// see Backend services overview.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionBackendServicesService) Insert(project string, region string, backendservice *BackendService) *RegionBackendServicesInsertCall {
- c := &RegionBackendServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.backendservice = backendservice
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionBackendServicesInsertCall) RequestId(requestId string) *RegionBackendServicesInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionBackendServicesInsertCall) Fields(s ...googleapi.Field) *RegionBackendServicesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionBackendServicesInsertCall) Context(ctx context.Context) *RegionBackendServicesInsertCall {
- 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 *RegionBackendServicesInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionBackendServicesInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionBackendServices.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionBackendServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a regional BackendService resource in the specified project using the data included in the request. For more information, see Backend services overview.",
- // "flatPath": "projects/{project}/regions/{region}/backendServices",
- // "httpMethod": "POST",
- // "id": "compute.regionBackendServices.insert",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/backendServices",
- // "request": {
- // "$ref": "BackendService"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionBackendServices.list":
-
-type RegionBackendServicesListCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves the list of regional BackendService resources
-// available to the specified project in the given region.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionBackendServicesService) List(project string, region string) *RegionBackendServicesListCall {
- c := &RegionBackendServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *RegionBackendServicesListCall) Filter(filter string) *RegionBackendServicesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *RegionBackendServicesListCall) MaxResults(maxResults int64) *RegionBackendServicesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *RegionBackendServicesListCall) OrderBy(orderBy string) *RegionBackendServicesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *RegionBackendServicesListCall) PageToken(pageToken string) *RegionBackendServicesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *RegionBackendServicesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionBackendServicesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *RegionBackendServicesListCall) Fields(s ...googleapi.Field) *RegionBackendServicesListCall {
- 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 *RegionBackendServicesListCall) IfNoneMatch(entityTag string) *RegionBackendServicesListCall {
- 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 *RegionBackendServicesListCall) Context(ctx context.Context) *RegionBackendServicesListCall {
- 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 *RegionBackendServicesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionBackendServicesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/backendServices")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionBackendServices.list" call.
-// Exactly one of *BackendServiceList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *BackendServiceList.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 *RegionBackendServicesListCall) Do(opts ...googleapi.CallOption) (*BackendServiceList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &BackendServiceList{
- 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": "Retrieves the list of regional BackendService resources available to the specified project in the given region.",
- // "flatPath": "projects/{project}/regions/{region}/backendServices",
- // "httpMethod": "GET",
- // "id": "compute.regionBackendServices.list",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/backendServices",
- // "response": {
- // "$ref": "BackendServiceList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *RegionBackendServicesListCall) Pages(ctx context.Context, f func(*BackendServiceList) 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 "compute.regionBackendServices.listUsable":
-
-type RegionBackendServicesListUsableCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// ListUsable: Retrieves an aggregated list of all usable backend
-// services in the specified project in the given region.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request. It must be a
-// string that meets the requirements in RFC1035.
-func (r *RegionBackendServicesService) ListUsable(project string, region string) *RegionBackendServicesListUsableCall {
- c := &RegionBackendServicesListUsableCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *RegionBackendServicesListUsableCall) Filter(filter string) *RegionBackendServicesListUsableCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *RegionBackendServicesListUsableCall) MaxResults(maxResults int64) *RegionBackendServicesListUsableCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *RegionBackendServicesListUsableCall) OrderBy(orderBy string) *RegionBackendServicesListUsableCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *RegionBackendServicesListUsableCall) PageToken(pageToken string) *RegionBackendServicesListUsableCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *RegionBackendServicesListUsableCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionBackendServicesListUsableCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *RegionBackendServicesListUsableCall) Fields(s ...googleapi.Field) *RegionBackendServicesListUsableCall {
- 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 *RegionBackendServicesListUsableCall) IfNoneMatch(entityTag string) *RegionBackendServicesListUsableCall {
- 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 *RegionBackendServicesListUsableCall) Context(ctx context.Context) *RegionBackendServicesListUsableCall {
- 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 *RegionBackendServicesListUsableCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionBackendServicesListUsableCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/backendServices/listUsable")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionBackendServices.listUsable" call.
-// Exactly one of *BackendServiceListUsable or error will be non-nil.
-// Any non-2xx status code is an error. Response headers are in either
-// *BackendServiceListUsable.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 *RegionBackendServicesListUsableCall) Do(opts ...googleapi.CallOption) (*BackendServiceListUsable, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &BackendServiceListUsable{
- 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": "Retrieves an aggregated list of all usable backend services in the specified project in the given region.",
- // "flatPath": "projects/{project}/regions/{region}/backendServices/listUsable",
- // "httpMethod": "GET",
- // "id": "compute.regionBackendServices.listUsable",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request. It must be a string that meets the requirements in RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/backendServices/listUsable",
- // "response": {
- // "$ref": "BackendServiceListUsable"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *RegionBackendServicesListUsableCall) Pages(ctx context.Context, f func(*BackendServiceListUsable) 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 "compute.regionBackendServices.patch":
-
-type RegionBackendServicesPatchCall struct {
- s *Service
- project string
- region string
- backendService string
- backendservice *BackendService
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Updates the specified regional BackendService resource with
-// the data included in the request. For more information, see
-// Understanding backend services This method supports PATCH semantics
-// and uses the JSON merge patch format and processing rules.
-//
-// - backendService: Name of the BackendService resource to patch.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionBackendServicesService) Patch(project string, region string, backendService string, backendservice *BackendService) *RegionBackendServicesPatchCall {
- c := &RegionBackendServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.backendService = backendService
- c.backendservice = backendservice
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionBackendServicesPatchCall) RequestId(requestId string) *RegionBackendServicesPatchCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionBackendServicesPatchCall) Fields(s ...googleapi.Field) *RegionBackendServicesPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionBackendServicesPatchCall) Context(ctx context.Context) *RegionBackendServicesPatchCall {
- 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 *RegionBackendServicesPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionBackendServicesPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/{backendService}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "backendService": c.backendService,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionBackendServices.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionBackendServicesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Updates the specified regional BackendService resource with the data included in the request. For more information, see Understanding backend services This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
- // "flatPath": "projects/{project}/regions/{region}/backendServices/{backendService}",
- // "httpMethod": "PATCH",
- // "id": "compute.regionBackendServices.patch",
- // "parameterOrder": [
- // "project",
- // "region",
- // "backendService"
- // ],
- // "parameters": {
- // "backendService": {
- // "description": "Name of the BackendService resource to patch.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/backendServices/{backendService}",
- // "request": {
- // "$ref": "BackendService"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionBackendServices.setIamPolicy":
-
-type RegionBackendServicesSetIamPolicyCall struct {
- s *Service
- project string
- region string
- resource string
- regionsetpolicyrequest *RegionSetPolicyRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetIamPolicy: Sets the access control policy on the specified
-// resource. Replaces any existing policy.
-//
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-// - resource: Name or id of the resource for this request.
-func (r *RegionBackendServicesService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *RegionBackendServicesSetIamPolicyCall {
- c := &RegionBackendServicesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.resource = resource
- c.regionsetpolicyrequest = regionsetpolicyrequest
- 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 *RegionBackendServicesSetIamPolicyCall) Fields(s ...googleapi.Field) *RegionBackendServicesSetIamPolicyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionBackendServicesSetIamPolicyCall) Context(ctx context.Context) *RegionBackendServicesSetIamPolicyCall {
- 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 *RegionBackendServicesSetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionBackendServicesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/{resource}/setIamPolicy")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionBackendServices.setIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *RegionBackendServicesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Sets the access control policy on the specified resource. Replaces any existing policy.",
- // "flatPath": "projects/{project}/regions/{region}/backendServices/{resource}/setIamPolicy",
- // "httpMethod": "POST",
- // "id": "compute.regionBackendServices.setIamPolicy",
- // "parameterOrder": [
- // "project",
- // "region",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/backendServices/{resource}/setIamPolicy",
- // "request": {
- // "$ref": "RegionSetPolicyRequest"
- // },
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionBackendServices.setSecurityPolicy":
-
-type RegionBackendServicesSetSecurityPolicyCall struct {
- s *Service
- project string
- region string
- backendService string
- securitypolicyreference *SecurityPolicyReference
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetSecurityPolicy: Sets the Google Cloud Armor security policy for
-// the specified backend service. For more information, see Google Cloud
-// Armor Overview
-//
-// - backendService: Name of the BackendService resource to which the
-// security policy should be set. The name should conform to RFC1035.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionBackendServicesService) SetSecurityPolicy(project string, region string, backendService string, securitypolicyreference *SecurityPolicyReference) *RegionBackendServicesSetSecurityPolicyCall {
- c := &RegionBackendServicesSetSecurityPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.backendService = backendService
- c.securitypolicyreference = securitypolicyreference
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionBackendServicesSetSecurityPolicyCall) RequestId(requestId string) *RegionBackendServicesSetSecurityPolicyCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionBackendServicesSetSecurityPolicyCall) Fields(s ...googleapi.Field) *RegionBackendServicesSetSecurityPolicyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionBackendServicesSetSecurityPolicyCall) Context(ctx context.Context) *RegionBackendServicesSetSecurityPolicyCall {
- 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 *RegionBackendServicesSetSecurityPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionBackendServicesSetSecurityPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyreference)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/{backendService}/setSecurityPolicy")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "backendService": c.backendService,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionBackendServices.setSecurityPolicy" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionBackendServicesSetSecurityPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Sets the Google Cloud Armor security policy for the specified backend service. For more information, see Google Cloud Armor Overview",
- // "flatPath": "projects/{project}/regions/{region}/backendServices/{backendService}/setSecurityPolicy",
- // "httpMethod": "POST",
- // "id": "compute.regionBackendServices.setSecurityPolicy",
- // "parameterOrder": [
- // "project",
- // "region",
- // "backendService"
- // ],
- // "parameters": {
- // "backendService": {
- // "description": "Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/backendServices/{backendService}/setSecurityPolicy",
- // "request": {
- // "$ref": "SecurityPolicyReference"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionBackendServices.testIamPermissions":
-
-type RegionBackendServicesTestIamPermissionsCall struct {
- s *Service
- project string
- region string
- resource string
- testpermissionsrequest *TestPermissionsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// TestIamPermissions: Returns permissions that a caller has on the
-// specified resource.
-//
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-// - resource: Name or id of the resource for this request.
-func (r *RegionBackendServicesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionBackendServicesTestIamPermissionsCall {
- c := &RegionBackendServicesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.resource = resource
- c.testpermissionsrequest = testpermissionsrequest
- 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 *RegionBackendServicesTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionBackendServicesTestIamPermissionsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionBackendServicesTestIamPermissionsCall) Context(ctx context.Context) *RegionBackendServicesTestIamPermissionsCall {
- 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 *RegionBackendServicesTestIamPermissionsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionBackendServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/{resource}/testIamPermissions")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionBackendServices.testIamPermissions" call.
-// Exactly one of *TestPermissionsResponse or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *TestPermissionsResponse.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 *RegionBackendServicesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TestPermissionsResponse{
- 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": "Returns permissions that a caller has on the specified resource.",
- // "flatPath": "projects/{project}/regions/{region}/backendServices/{resource}/testIamPermissions",
- // "httpMethod": "POST",
- // "id": "compute.regionBackendServices.testIamPermissions",
- // "parameterOrder": [
- // "project",
- // "region",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/backendServices/{resource}/testIamPermissions",
- // "request": {
- // "$ref": "TestPermissionsRequest"
- // },
- // "response": {
- // "$ref": "TestPermissionsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.regionBackendServices.update":
-
-type RegionBackendServicesUpdateCall struct {
- s *Service
- project string
- region string
- backendService string
- backendservice *BackendService
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Update: Updates the specified regional BackendService resource with
-// the data included in the request. For more information, see Backend
-// services overview .
-//
-// - backendService: Name of the BackendService resource to update.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionBackendServicesService) Update(project string, region string, backendService string, backendservice *BackendService) *RegionBackendServicesUpdateCall {
- c := &RegionBackendServicesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.backendService = backendService
- c.backendservice = backendservice
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionBackendServicesUpdateCall) RequestId(requestId string) *RegionBackendServicesUpdateCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionBackendServicesUpdateCall) Fields(s ...googleapi.Field) *RegionBackendServicesUpdateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionBackendServicesUpdateCall) Context(ctx context.Context) *RegionBackendServicesUpdateCall {
- 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 *RegionBackendServicesUpdateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionBackendServicesUpdateCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/{backendService}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PUT", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "backendService": c.backendService,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionBackendServices.update" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionBackendServicesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Updates the specified regional BackendService resource with the data included in the request. For more information, see Backend services overview .",
- // "flatPath": "projects/{project}/regions/{region}/backendServices/{backendService}",
- // "httpMethod": "PUT",
- // "id": "compute.regionBackendServices.update",
- // "parameterOrder": [
- // "project",
- // "region",
- // "backendService"
- // ],
- // "parameters": {
- // "backendService": {
- // "description": "Name of the BackendService resource to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/backendServices/{backendService}",
- // "request": {
- // "$ref": "BackendService"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionCommitments.aggregatedList":
-
-type RegionCommitmentsAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Retrieves an aggregated list of commitments by
-// region.
-//
-// - project: Project ID for this request.
-func (r *RegionCommitmentsService) AggregatedList(project string) *RegionCommitmentsAggregatedListCall {
- c := &RegionCommitmentsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *RegionCommitmentsAggregatedListCall) Filter(filter string) *RegionCommitmentsAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *RegionCommitmentsAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *RegionCommitmentsAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *RegionCommitmentsAggregatedListCall) MaxResults(maxResults int64) *RegionCommitmentsAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *RegionCommitmentsAggregatedListCall) OrderBy(orderBy string) *RegionCommitmentsAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *RegionCommitmentsAggregatedListCall) PageToken(pageToken string) *RegionCommitmentsAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *RegionCommitmentsAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionCommitmentsAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *RegionCommitmentsAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *RegionCommitmentsAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *RegionCommitmentsAggregatedListCall) Fields(s ...googleapi.Field) *RegionCommitmentsAggregatedListCall {
- 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 *RegionCommitmentsAggregatedListCall) IfNoneMatch(entityTag string) *RegionCommitmentsAggregatedListCall {
- 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 *RegionCommitmentsAggregatedListCall) Context(ctx context.Context) *RegionCommitmentsAggregatedListCall {
- 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 *RegionCommitmentsAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionCommitmentsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/commitments")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionCommitments.aggregatedList" call.
-// Exactly one of *CommitmentAggregatedList or error will be non-nil.
-// Any non-2xx status code is an error. Response headers are in either
-// *CommitmentAggregatedList.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 *RegionCommitmentsAggregatedListCall) Do(opts ...googleapi.CallOption) (*CommitmentAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &CommitmentAggregatedList{
- 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": "Retrieves an aggregated list of commitments by region.",
- // "flatPath": "projects/{project}/aggregated/commitments",
- // "httpMethod": "GET",
- // "id": "compute.regionCommitments.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/commitments",
- // "response": {
- // "$ref": "CommitmentAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *RegionCommitmentsAggregatedListCall) Pages(ctx context.Context, f func(*CommitmentAggregatedList) 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 "compute.regionCommitments.get":
-
-type RegionCommitmentsGetCall struct {
- s *Service
- project string
- region string
- commitment string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified commitment resource.
-//
-// - commitment: Name of the commitment to return.
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-func (r *RegionCommitmentsService) Get(project string, region string, commitment string) *RegionCommitmentsGetCall {
- c := &RegionCommitmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.commitment = commitment
- 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 *RegionCommitmentsGetCall) Fields(s ...googleapi.Field) *RegionCommitmentsGetCall {
- 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 *RegionCommitmentsGetCall) IfNoneMatch(entityTag string) *RegionCommitmentsGetCall {
- 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 *RegionCommitmentsGetCall) Context(ctx context.Context) *RegionCommitmentsGetCall {
- 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 *RegionCommitmentsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionCommitmentsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/commitments/{commitment}")
- 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{
- "project": c.project,
- "region": c.region,
- "commitment": c.commitment,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionCommitments.get" call.
-// Exactly one of *Commitment or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Commitment.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 *RegionCommitmentsGetCall) Do(opts ...googleapi.CallOption) (*Commitment, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Commitment{
- 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": "Returns the specified commitment resource.",
- // "flatPath": "projects/{project}/regions/{region}/commitments/{commitment}",
- // "httpMethod": "GET",
- // "id": "compute.regionCommitments.get",
- // "parameterOrder": [
- // "project",
- // "region",
- // "commitment"
- // ],
- // "parameters": {
- // "commitment": {
- // "description": "Name of the commitment to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/commitments/{commitment}",
- // "response": {
- // "$ref": "Commitment"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.regionCommitments.insert":
-
-type RegionCommitmentsInsertCall struct {
- s *Service
- project string
- region string
- commitment *Commitment
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a commitment in the specified project using the data
-// included in the request.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-func (r *RegionCommitmentsService) Insert(project string, region string, commitment *Commitment) *RegionCommitmentsInsertCall {
- c := &RegionCommitmentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.commitment = commitment
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionCommitmentsInsertCall) RequestId(requestId string) *RegionCommitmentsInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionCommitmentsInsertCall) Fields(s ...googleapi.Field) *RegionCommitmentsInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionCommitmentsInsertCall) Context(ctx context.Context) *RegionCommitmentsInsertCall {
- 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 *RegionCommitmentsInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionCommitmentsInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitment)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/commitments")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionCommitments.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionCommitmentsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a commitment in the specified project using the data included in the request.",
- // "flatPath": "projects/{project}/regions/{region}/commitments",
- // "httpMethod": "POST",
- // "id": "compute.regionCommitments.insert",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/commitments",
- // "request": {
- // "$ref": "Commitment"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionCommitments.list":
-
-type RegionCommitmentsListCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves a list of commitments contained within the specified
-// region.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-func (r *RegionCommitmentsService) List(project string, region string) *RegionCommitmentsListCall {
- c := &RegionCommitmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *RegionCommitmentsListCall) Filter(filter string) *RegionCommitmentsListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *RegionCommitmentsListCall) MaxResults(maxResults int64) *RegionCommitmentsListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *RegionCommitmentsListCall) OrderBy(orderBy string) *RegionCommitmentsListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *RegionCommitmentsListCall) PageToken(pageToken string) *RegionCommitmentsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *RegionCommitmentsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionCommitmentsListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *RegionCommitmentsListCall) Fields(s ...googleapi.Field) *RegionCommitmentsListCall {
- 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 *RegionCommitmentsListCall) IfNoneMatch(entityTag string) *RegionCommitmentsListCall {
- 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 *RegionCommitmentsListCall) Context(ctx context.Context) *RegionCommitmentsListCall {
- 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 *RegionCommitmentsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionCommitmentsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/commitments")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionCommitments.list" call.
-// Exactly one of *CommitmentList or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *CommitmentList.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 *RegionCommitmentsListCall) Do(opts ...googleapi.CallOption) (*CommitmentList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &CommitmentList{
- 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": "Retrieves a list of commitments contained within the specified region.",
- // "flatPath": "projects/{project}/regions/{region}/commitments",
- // "httpMethod": "GET",
- // "id": "compute.regionCommitments.list",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/commitments",
- // "response": {
- // "$ref": "CommitmentList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *RegionCommitmentsListCall) Pages(ctx context.Context, f func(*CommitmentList) 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 "compute.regionCommitments.update":
-
-type RegionCommitmentsUpdateCall struct {
- s *Service
- project string
- region string
- commitment string
- commitment2 *Commitment
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Update: Updates the specified commitment with the data included in
-// the request. Update is performed only on selected fields included as
-// part of update-mask. Only the following fields can be modified:
-// auto_renew.
-//
-// - commitment: Name of the commitment for which auto renew is being
-// updated.
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-func (r *RegionCommitmentsService) Update(project string, region string, commitment string, commitment2 *Commitment) *RegionCommitmentsUpdateCall {
- c := &RegionCommitmentsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.commitment = commitment
- c.commitment2 = commitment2
- return c
-}
-
-// Paths sets the optional parameter "paths":
-func (c *RegionCommitmentsUpdateCall) Paths(paths ...string) *RegionCommitmentsUpdateCall {
- c.urlParams_.SetMulti("paths", append([]string{}, paths...))
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionCommitmentsUpdateCall) RequestId(requestId string) *RegionCommitmentsUpdateCall {
- c.urlParams_.Set("requestId", requestId)
- return c
-}
-
-// UpdateMask sets the optional parameter "updateMask": update_mask
-// indicates fields to be updated as part of this request.
-func (c *RegionCommitmentsUpdateCall) UpdateMask(updateMask string) *RegionCommitmentsUpdateCall {
- c.urlParams_.Set("updateMask", updateMask)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *RegionCommitmentsUpdateCall) Fields(s ...googleapi.Field) *RegionCommitmentsUpdateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionCommitmentsUpdateCall) Context(ctx context.Context) *RegionCommitmentsUpdateCall {
- 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 *RegionCommitmentsUpdateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionCommitmentsUpdateCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitment2)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/commitments/{commitment}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "commitment": c.commitment,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionCommitments.update" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionCommitmentsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Updates the specified commitment with the data included in the request. Update is performed only on selected fields included as part of update-mask. Only the following fields can be modified: auto_renew.",
- // "flatPath": "projects/{project}/regions/{region}/commitments/{commitment}",
- // "httpMethod": "PATCH",
- // "id": "compute.regionCommitments.update",
- // "parameterOrder": [
- // "project",
- // "region",
- // "commitment"
- // ],
- // "parameters": {
- // "commitment": {
- // "description": "Name of the commitment for which auto renew is being updated.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "paths": {
- // "location": "query",
- // "repeated": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "updateMask": {
- // "description": "update_mask indicates fields to be updated as part of this request.",
- // "format": "google-fieldmask",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/commitments/{commitment}",
- // "request": {
- // "$ref": "Commitment"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionDiskTypes.get":
-
-type RegionDiskTypesGetCall struct {
- s *Service
- project string
- region string
- diskType string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified regional disk type.
-//
-// - diskType: Name of the disk type to return.
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-func (r *RegionDiskTypesService) Get(project string, region string, diskType string) *RegionDiskTypesGetCall {
- c := &RegionDiskTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.diskType = diskType
- 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 *RegionDiskTypesGetCall) Fields(s ...googleapi.Field) *RegionDiskTypesGetCall {
- 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 *RegionDiskTypesGetCall) IfNoneMatch(entityTag string) *RegionDiskTypesGetCall {
- 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 *RegionDiskTypesGetCall) Context(ctx context.Context) *RegionDiskTypesGetCall {
- 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 *RegionDiskTypesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionDiskTypesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/diskTypes/{diskType}")
- 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{
- "project": c.project,
- "region": c.region,
- "diskType": c.diskType,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionDiskTypes.get" call.
-// Exactly one of *DiskType or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *DiskType.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 *RegionDiskTypesGetCall) Do(opts ...googleapi.CallOption) (*DiskType, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &DiskType{
- 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": "Returns the specified regional disk type.",
- // "flatPath": "projects/{project}/regions/{region}/diskTypes/{diskType}",
- // "httpMethod": "GET",
- // "id": "compute.regionDiskTypes.get",
- // "parameterOrder": [
- // "project",
- // "region",
- // "diskType"
- // ],
- // "parameters": {
- // "diskType": {
- // "description": "Name of the disk type to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/diskTypes/{diskType}",
- // "response": {
- // "$ref": "DiskType"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.regionDiskTypes.list":
-
-type RegionDiskTypesListCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves a list of regional disk types available to the
-// specified project.
-//
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-func (r *RegionDiskTypesService) List(project string, region string) *RegionDiskTypesListCall {
- c := &RegionDiskTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *RegionDiskTypesListCall) Filter(filter string) *RegionDiskTypesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *RegionDiskTypesListCall) MaxResults(maxResults int64) *RegionDiskTypesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *RegionDiskTypesListCall) OrderBy(orderBy string) *RegionDiskTypesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *RegionDiskTypesListCall) PageToken(pageToken string) *RegionDiskTypesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *RegionDiskTypesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionDiskTypesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *RegionDiskTypesListCall) Fields(s ...googleapi.Field) *RegionDiskTypesListCall {
- 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 *RegionDiskTypesListCall) IfNoneMatch(entityTag string) *RegionDiskTypesListCall {
- 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 *RegionDiskTypesListCall) Context(ctx context.Context) *RegionDiskTypesListCall {
- 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 *RegionDiskTypesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionDiskTypesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/diskTypes")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionDiskTypes.list" call.
-// Exactly one of *RegionDiskTypeList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *RegionDiskTypeList.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 *RegionDiskTypesListCall) Do(opts ...googleapi.CallOption) (*RegionDiskTypeList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &RegionDiskTypeList{
- 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": "Retrieves a list of regional disk types available to the specified project.",
- // "flatPath": "projects/{project}/regions/{region}/diskTypes",
- // "httpMethod": "GET",
- // "id": "compute.regionDiskTypes.list",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/diskTypes",
- // "response": {
- // "$ref": "RegionDiskTypeList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *RegionDiskTypesListCall) Pages(ctx context.Context, f func(*RegionDiskTypeList) 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 "compute.regionDisks.addResourcePolicies":
-
-type RegionDisksAddResourcePoliciesCall struct {
- s *Service
- project string
- region string
- disk string
- regiondisksaddresourcepoliciesrequest *RegionDisksAddResourcePoliciesRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// AddResourcePolicies: Adds existing resource policies to a regional
-// disk. You can only add one policy which will be applied to this disk
-// for scheduling snapshot creation.
-//
-// - disk: The disk name for this request.
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-func (r *RegionDisksService) AddResourcePolicies(project string, region string, disk string, regiondisksaddresourcepoliciesrequest *RegionDisksAddResourcePoliciesRequest) *RegionDisksAddResourcePoliciesCall {
- c := &RegionDisksAddResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.disk = disk
- c.regiondisksaddresourcepoliciesrequest = regiondisksaddresourcepoliciesrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionDisksAddResourcePoliciesCall) RequestId(requestId string) *RegionDisksAddResourcePoliciesCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionDisksAddResourcePoliciesCall) Fields(s ...googleapi.Field) *RegionDisksAddResourcePoliciesCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionDisksAddResourcePoliciesCall) Context(ctx context.Context) *RegionDisksAddResourcePoliciesCall {
- 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 *RegionDisksAddResourcePoliciesCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionDisksAddResourcePoliciesCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksaddresourcepoliciesrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{disk}/addResourcePolicies")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "disk": c.disk,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionDisks.addResourcePolicies" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionDisksAddResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Adds existing resource policies to a regional disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation.",
- // "flatPath": "projects/{project}/regions/{region}/disks/{disk}/addResourcePolicies",
- // "httpMethod": "POST",
- // "id": "compute.regionDisks.addResourcePolicies",
- // "parameterOrder": [
- // "project",
- // "region",
- // "disk"
- // ],
- // "parameters": {
- // "disk": {
- // "description": "The disk name for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/disks/{disk}/addResourcePolicies",
- // "request": {
- // "$ref": "RegionDisksAddResourcePoliciesRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionDisks.bulkInsert":
-
-type RegionDisksBulkInsertCall struct {
- s *Service
- project string
- region string
- bulkinsertdiskresource *BulkInsertDiskResource
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// BulkInsert: Bulk create a set of disks.
-//
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-func (r *RegionDisksService) BulkInsert(project string, region string, bulkinsertdiskresource *BulkInsertDiskResource) *RegionDisksBulkInsertCall {
- c := &RegionDisksBulkInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.bulkinsertdiskresource = bulkinsertdiskresource
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionDisksBulkInsertCall) RequestId(requestId string) *RegionDisksBulkInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionDisksBulkInsertCall) Fields(s ...googleapi.Field) *RegionDisksBulkInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionDisksBulkInsertCall) Context(ctx context.Context) *RegionDisksBulkInsertCall {
- 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 *RegionDisksBulkInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionDisksBulkInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkinsertdiskresource)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/bulkInsert")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionDisks.bulkInsert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionDisksBulkInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Bulk create a set of disks.",
- // "flatPath": "projects/{project}/regions/{region}/disks/bulkInsert",
- // "httpMethod": "POST",
- // "id": "compute.regionDisks.bulkInsert",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/disks/bulkInsert",
- // "request": {
- // "$ref": "BulkInsertDiskResource"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionDisks.createSnapshot":
-
-type RegionDisksCreateSnapshotCall struct {
- s *Service
- project string
- region string
- disk string
- snapshot *Snapshot
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// CreateSnapshot: Creates a snapshot of a specified persistent disk.
-// For regular snapshot creation, consider using snapshots.insert
-// instead, as that method supports more features, such as creating
-// snapshots in a project different from the source disk project.
-//
-// - disk: Name of the regional persistent disk to snapshot.
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-func (r *RegionDisksService) CreateSnapshot(project string, region string, disk string, snapshot *Snapshot) *RegionDisksCreateSnapshotCall {
- c := &RegionDisksCreateSnapshotCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.disk = disk
- c.snapshot = snapshot
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionDisksCreateSnapshotCall) RequestId(requestId string) *RegionDisksCreateSnapshotCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionDisksCreateSnapshotCall) Fields(s ...googleapi.Field) *RegionDisksCreateSnapshotCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionDisksCreateSnapshotCall) Context(ctx context.Context) *RegionDisksCreateSnapshotCall {
- 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 *RegionDisksCreateSnapshotCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionDisksCreateSnapshotCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{disk}/createSnapshot")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "disk": c.disk,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionDisks.createSnapshot" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionDisksCreateSnapshotCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a snapshot of a specified persistent disk. For regular snapshot creation, consider using snapshots.insert instead, as that method supports more features, such as creating snapshots in a project different from the source disk project.",
- // "flatPath": "projects/{project}/regions/{region}/disks/{disk}/createSnapshot",
- // "httpMethod": "POST",
- // "id": "compute.regionDisks.createSnapshot",
- // "parameterOrder": [
- // "project",
- // "region",
- // "disk"
- // ],
- // "parameters": {
- // "disk": {
- // "description": "Name of the regional persistent disk to snapshot.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/disks/{disk}/createSnapshot",
- // "request": {
- // "$ref": "Snapshot"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionDisks.delete":
-
-type RegionDisksDeleteCall struct {
- s *Service
- project string
- region string
- disk string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified regional persistent disk. Deleting a
-// regional disk removes all the replicas of its data permanently and is
-// irreversible. However, deleting a disk does not delete any snapshots
-// previously made from the disk. You must separately delete snapshots.
-//
-// - disk: Name of the regional persistent disk to delete.
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-func (r *RegionDisksService) Delete(project string, region string, disk string) *RegionDisksDeleteCall {
- c := &RegionDisksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.disk = disk
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionDisksDeleteCall) RequestId(requestId string) *RegionDisksDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionDisksDeleteCall) Fields(s ...googleapi.Field) *RegionDisksDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionDisksDeleteCall) Context(ctx context.Context) *RegionDisksDeleteCall {
- 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 *RegionDisksDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionDisksDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{disk}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "disk": c.disk,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionDisks.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionDisksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified regional persistent disk. Deleting a regional disk removes all the replicas of its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots.",
- // "flatPath": "projects/{project}/regions/{region}/disks/{disk}",
- // "httpMethod": "DELETE",
- // "id": "compute.regionDisks.delete",
- // "parameterOrder": [
- // "project",
- // "region",
- // "disk"
- // ],
- // "parameters": {
- // "disk": {
- // "description": "Name of the regional persistent disk to delete.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/disks/{disk}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionDisks.get":
-
-type RegionDisksGetCall struct {
- s *Service
- project string
- region string
- disk string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns a specified regional persistent disk.
-//
-// - disk: Name of the regional persistent disk to return.
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-func (r *RegionDisksService) Get(project string, region string, disk string) *RegionDisksGetCall {
- c := &RegionDisksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.disk = disk
- 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 *RegionDisksGetCall) Fields(s ...googleapi.Field) *RegionDisksGetCall {
- 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 *RegionDisksGetCall) IfNoneMatch(entityTag string) *RegionDisksGetCall {
- 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 *RegionDisksGetCall) Context(ctx context.Context) *RegionDisksGetCall {
- 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 *RegionDisksGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionDisksGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/disks/{disk}")
- 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{
- "project": c.project,
- "region": c.region,
- "disk": c.disk,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionDisks.get" call.
-// Exactly one of *Disk or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Disk.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 *RegionDisksGetCall) Do(opts ...googleapi.CallOption) (*Disk, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Disk{
- 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": "Returns a specified regional persistent disk.",
- // "flatPath": "projects/{project}/regions/{region}/disks/{disk}",
- // "httpMethod": "GET",
- // "id": "compute.regionDisks.get",
- // "parameterOrder": [
- // "project",
- // "region",
- // "disk"
- // ],
- // "parameters": {
- // "disk": {
- // "description": "Name of the regional persistent disk to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/disks/{disk}",
- // "response": {
- // "$ref": "Disk"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.regionDisks.getIamPolicy":
-
-type RegionDisksGetIamPolicyCall struct {
- s *Service
- project string
- region string
- resource string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetIamPolicy: Gets the access control policy for a resource. May be
-// empty if no such policy or resource exists.
-//
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-// - resource: Name or id of the resource for this request.
-func (r *RegionDisksService) GetIamPolicy(project string, region string, resource string) *RegionDisksGetIamPolicyCall {
- c := &RegionDisksGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.resource = resource
- return c
-}
-
-// OptionsRequestedPolicyVersion sets the optional parameter
-// "optionsRequestedPolicyVersion": Requested IAM Policy version.
-func (c *RegionDisksGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *RegionDisksGetIamPolicyCall {
- c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
- 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 *RegionDisksGetIamPolicyCall) Fields(s ...googleapi.Field) *RegionDisksGetIamPolicyCall {
- 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 *RegionDisksGetIamPolicyCall) IfNoneMatch(entityTag string) *RegionDisksGetIamPolicyCall {
- 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 *RegionDisksGetIamPolicyCall) Context(ctx context.Context) *RegionDisksGetIamPolicyCall {
- 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 *RegionDisksGetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionDisksGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/disks/{resource}/getIamPolicy")
- 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{
- "project": c.project,
- "region": c.region,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionDisks.getIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *RegionDisksGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
- // "flatPath": "projects/{project}/regions/{region}/disks/{resource}/getIamPolicy",
- // "httpMethod": "GET",
- // "id": "compute.regionDisks.getIamPolicy",
- // "parameterOrder": [
- // "project",
- // "region",
- // "resource"
- // ],
- // "parameters": {
- // "optionsRequestedPolicyVersion": {
- // "description": "Requested IAM Policy version.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/disks/{resource}/getIamPolicy",
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.regionDisks.insert":
-
-type RegionDisksInsertCall struct {
- s *Service
- project string
- region string
- disk *Disk
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a persistent regional disk in the specified project
-// using the data included in the request.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-func (r *RegionDisksService) Insert(project string, region string, disk *Disk) *RegionDisksInsertCall {
- c := &RegionDisksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.disk = disk
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionDisksInsertCall) RequestId(requestId string) *RegionDisksInsertCall {
- c.urlParams_.Set("requestId", requestId)
- return c
-}
-
-// SourceImage sets the optional parameter "sourceImage": Source image
-// to restore onto a disk. This field is optional.
-func (c *RegionDisksInsertCall) SourceImage(sourceImage string) *RegionDisksInsertCall {
- c.urlParams_.Set("sourceImage", sourceImage)
- 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 *RegionDisksInsertCall) Fields(s ...googleapi.Field) *RegionDisksInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionDisksInsertCall) Context(ctx context.Context) *RegionDisksInsertCall {
- 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 *RegionDisksInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionDisksInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionDisks.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionDisksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a persistent regional disk in the specified project using the data included in the request.",
- // "flatPath": "projects/{project}/regions/{region}/disks",
- // "httpMethod": "POST",
- // "id": "compute.regionDisks.insert",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "sourceImage": {
- // "description": "Source image to restore onto a disk. This field is optional.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/disks",
- // "request": {
- // "$ref": "Disk"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionDisks.list":
-
-type RegionDisksListCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves the list of persistent disks contained within the
-// specified region.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-func (r *RegionDisksService) List(project string, region string) *RegionDisksListCall {
- c := &RegionDisksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *RegionDisksListCall) Filter(filter string) *RegionDisksListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *RegionDisksListCall) MaxResults(maxResults int64) *RegionDisksListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *RegionDisksListCall) OrderBy(orderBy string) *RegionDisksListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *RegionDisksListCall) PageToken(pageToken string) *RegionDisksListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *RegionDisksListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionDisksListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *RegionDisksListCall) Fields(s ...googleapi.Field) *RegionDisksListCall {
- 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 *RegionDisksListCall) IfNoneMatch(entityTag string) *RegionDisksListCall {
- 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 *RegionDisksListCall) Context(ctx context.Context) *RegionDisksListCall {
- 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 *RegionDisksListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionDisksListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/disks")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionDisks.list" call.
-// Exactly one of *DiskList or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *DiskList.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 *RegionDisksListCall) Do(opts ...googleapi.CallOption) (*DiskList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &DiskList{
- 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": "Retrieves the list of persistent disks contained within the specified region.",
- // "flatPath": "projects/{project}/regions/{region}/disks",
- // "httpMethod": "GET",
- // "id": "compute.regionDisks.list",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/disks",
- // "response": {
- // "$ref": "DiskList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *RegionDisksListCall) Pages(ctx context.Context, f func(*DiskList) 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 "compute.regionDisks.removeResourcePolicies":
-
-type RegionDisksRemoveResourcePoliciesCall struct {
- s *Service
- project string
- region string
- disk string
- regiondisksremoveresourcepoliciesrequest *RegionDisksRemoveResourcePoliciesRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// RemoveResourcePolicies: Removes resource policies from a regional
-// disk.
-//
-// - disk: The disk name for this request.
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-func (r *RegionDisksService) RemoveResourcePolicies(project string, region string, disk string, regiondisksremoveresourcepoliciesrequest *RegionDisksRemoveResourcePoliciesRequest) *RegionDisksRemoveResourcePoliciesCall {
- c := &RegionDisksRemoveResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.disk = disk
- c.regiondisksremoveresourcepoliciesrequest = regiondisksremoveresourcepoliciesrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionDisksRemoveResourcePoliciesCall) RequestId(requestId string) *RegionDisksRemoveResourcePoliciesCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionDisksRemoveResourcePoliciesCall) Fields(s ...googleapi.Field) *RegionDisksRemoveResourcePoliciesCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionDisksRemoveResourcePoliciesCall) Context(ctx context.Context) *RegionDisksRemoveResourcePoliciesCall {
- 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 *RegionDisksRemoveResourcePoliciesCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionDisksRemoveResourcePoliciesCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksremoveresourcepoliciesrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{disk}/removeResourcePolicies")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "disk": c.disk,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionDisks.removeResourcePolicies" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionDisksRemoveResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Removes resource policies from a regional disk.",
- // "flatPath": "projects/{project}/regions/{region}/disks/{disk}/removeResourcePolicies",
- // "httpMethod": "POST",
- // "id": "compute.regionDisks.removeResourcePolicies",
- // "parameterOrder": [
- // "project",
- // "region",
- // "disk"
- // ],
- // "parameters": {
- // "disk": {
- // "description": "The disk name for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/disks/{disk}/removeResourcePolicies",
- // "request": {
- // "$ref": "RegionDisksRemoveResourcePoliciesRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionDisks.resize":
-
-type RegionDisksResizeCall struct {
- s *Service
- project string
- region string
- disk string
- regiondisksresizerequest *RegionDisksResizeRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Resize: Resizes the specified regional persistent disk.
-//
-// - disk: Name of the regional persistent disk.
-// - project: The project ID for this request.
-// - region: Name of the region for this request.
-func (r *RegionDisksService) Resize(project string, region string, disk string, regiondisksresizerequest *RegionDisksResizeRequest) *RegionDisksResizeCall {
- c := &RegionDisksResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.disk = disk
- c.regiondisksresizerequest = regiondisksresizerequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionDisksResizeCall) RequestId(requestId string) *RegionDisksResizeCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionDisksResizeCall) Fields(s ...googleapi.Field) *RegionDisksResizeCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionDisksResizeCall) Context(ctx context.Context) *RegionDisksResizeCall {
- 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 *RegionDisksResizeCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionDisksResizeCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksresizerequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{disk}/resize")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "disk": c.disk,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionDisks.resize" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionDisksResizeCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Resizes the specified regional persistent disk.",
- // "flatPath": "projects/{project}/regions/{region}/disks/{disk}/resize",
- // "httpMethod": "POST",
- // "id": "compute.regionDisks.resize",
- // "parameterOrder": [
- // "project",
- // "region",
- // "disk"
- // ],
- // "parameters": {
- // "disk": {
- // "description": "Name of the regional persistent disk.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "The project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/disks/{disk}/resize",
- // "request": {
- // "$ref": "RegionDisksResizeRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionDisks.setIamPolicy":
-
-type RegionDisksSetIamPolicyCall struct {
- s *Service
- project string
- region string
- resource string
- regionsetpolicyrequest *RegionSetPolicyRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetIamPolicy: Sets the access control policy on the specified
-// resource. Replaces any existing policy.
-//
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-// - resource: Name or id of the resource for this request.
-func (r *RegionDisksService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *RegionDisksSetIamPolicyCall {
- c := &RegionDisksSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.resource = resource
- c.regionsetpolicyrequest = regionsetpolicyrequest
- 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 *RegionDisksSetIamPolicyCall) Fields(s ...googleapi.Field) *RegionDisksSetIamPolicyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionDisksSetIamPolicyCall) Context(ctx context.Context) *RegionDisksSetIamPolicyCall {
- 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 *RegionDisksSetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionDisksSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{resource}/setIamPolicy")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionDisks.setIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *RegionDisksSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Sets the access control policy on the specified resource. Replaces any existing policy.",
- // "flatPath": "projects/{project}/regions/{region}/disks/{resource}/setIamPolicy",
- // "httpMethod": "POST",
- // "id": "compute.regionDisks.setIamPolicy",
- // "parameterOrder": [
- // "project",
- // "region",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/disks/{resource}/setIamPolicy",
- // "request": {
- // "$ref": "RegionSetPolicyRequest"
- // },
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionDisks.setLabels":
-
-type RegionDisksSetLabelsCall struct {
- s *Service
- project string
- region string
- resource string
- regionsetlabelsrequest *RegionSetLabelsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetLabels: Sets the labels on the target regional disk.
-//
-// - project: Project ID for this request.
-// - region: The region for this request.
-// - resource: Name or id of the resource for this request.
-func (r *RegionDisksService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *RegionDisksSetLabelsCall {
- c := &RegionDisksSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.resource = resource
- c.regionsetlabelsrequest = regionsetlabelsrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionDisksSetLabelsCall) RequestId(requestId string) *RegionDisksSetLabelsCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionDisksSetLabelsCall) Fields(s ...googleapi.Field) *RegionDisksSetLabelsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionDisksSetLabelsCall) Context(ctx context.Context) *RegionDisksSetLabelsCall {
- 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 *RegionDisksSetLabelsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionDisksSetLabelsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{resource}/setLabels")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionDisks.setLabels" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionDisksSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Sets the labels on the target regional disk.",
- // "flatPath": "projects/{project}/regions/{region}/disks/{resource}/setLabels",
- // "httpMethod": "POST",
- // "id": "compute.regionDisks.setLabels",
- // "parameterOrder": [
- // "project",
- // "region",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/disks/{resource}/setLabels",
- // "request": {
- // "$ref": "RegionSetLabelsRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionDisks.startAsyncReplication":
-
-type RegionDisksStartAsyncReplicationCall struct {
- s *Service
- project string
- region string
- disk string
- regiondisksstartasyncreplicationrequest *RegionDisksStartAsyncReplicationRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// StartAsyncReplication: Starts asynchronous replication. Must be
-// invoked on the primary disk.
-//
-// - disk: The name of the persistent disk.
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-func (r *RegionDisksService) StartAsyncReplication(project string, region string, disk string, regiondisksstartasyncreplicationrequest *RegionDisksStartAsyncReplicationRequest) *RegionDisksStartAsyncReplicationCall {
- c := &RegionDisksStartAsyncReplicationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.disk = disk
- c.regiondisksstartasyncreplicationrequest = regiondisksstartasyncreplicationrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionDisksStartAsyncReplicationCall) RequestId(requestId string) *RegionDisksStartAsyncReplicationCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionDisksStartAsyncReplicationCall) Fields(s ...googleapi.Field) *RegionDisksStartAsyncReplicationCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionDisksStartAsyncReplicationCall) Context(ctx context.Context) *RegionDisksStartAsyncReplicationCall {
- 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 *RegionDisksStartAsyncReplicationCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionDisksStartAsyncReplicationCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksstartasyncreplicationrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{disk}/startAsyncReplication")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "disk": c.disk,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionDisks.startAsyncReplication" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionDisksStartAsyncReplicationCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Starts asynchronous replication. Must be invoked on the primary disk.",
- // "flatPath": "projects/{project}/regions/{region}/disks/{disk}/startAsyncReplication",
- // "httpMethod": "POST",
- // "id": "compute.regionDisks.startAsyncReplication",
- // "parameterOrder": [
- // "project",
- // "region",
- // "disk"
- // ],
- // "parameters": {
- // "disk": {
- // "description": "The name of the persistent disk.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/disks/{disk}/startAsyncReplication",
- // "request": {
- // "$ref": "RegionDisksStartAsyncReplicationRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionDisks.stopAsyncReplication":
-
-type RegionDisksStopAsyncReplicationCall struct {
- s *Service
- project string
- region string
- disk string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// StopAsyncReplication: Stops asynchronous replication. Can be invoked
-// either on the primary or on the secondary disk.
-//
-// - disk: The name of the persistent disk.
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-func (r *RegionDisksService) StopAsyncReplication(project string, region string, disk string) *RegionDisksStopAsyncReplicationCall {
- c := &RegionDisksStopAsyncReplicationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.disk = disk
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionDisksStopAsyncReplicationCall) RequestId(requestId string) *RegionDisksStopAsyncReplicationCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionDisksStopAsyncReplicationCall) Fields(s ...googleapi.Field) *RegionDisksStopAsyncReplicationCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionDisksStopAsyncReplicationCall) Context(ctx context.Context) *RegionDisksStopAsyncReplicationCall {
- 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 *RegionDisksStopAsyncReplicationCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionDisksStopAsyncReplicationCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{disk}/stopAsyncReplication")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "disk": c.disk,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionDisks.stopAsyncReplication" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionDisksStopAsyncReplicationCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Stops asynchronous replication. Can be invoked either on the primary or on the secondary disk.",
- // "flatPath": "projects/{project}/regions/{region}/disks/{disk}/stopAsyncReplication",
- // "httpMethod": "POST",
- // "id": "compute.regionDisks.stopAsyncReplication",
- // "parameterOrder": [
- // "project",
- // "region",
- // "disk"
- // ],
- // "parameters": {
- // "disk": {
- // "description": "The name of the persistent disk.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/disks/{disk}/stopAsyncReplication",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionDisks.stopGroupAsyncReplication":
-
-type RegionDisksStopGroupAsyncReplicationCall struct {
- s *Service
- project string
- region string
- disksstopgroupasyncreplicationresource *DisksStopGroupAsyncReplicationResource
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// StopGroupAsyncReplication: Stops asynchronous replication for a
-// consistency group of disks. Can be invoked either in the primary or
-// secondary scope.
-//
-// - project: Project ID for this request.
-// - region: The name of the region for this request. This must be the
-// region of the primary or secondary disks in the consistency group.
-func (r *RegionDisksService) StopGroupAsyncReplication(project string, region string, disksstopgroupasyncreplicationresource *DisksStopGroupAsyncReplicationResource) *RegionDisksStopGroupAsyncReplicationCall {
- c := &RegionDisksStopGroupAsyncReplicationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.disksstopgroupasyncreplicationresource = disksstopgroupasyncreplicationresource
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionDisksStopGroupAsyncReplicationCall) RequestId(requestId string) *RegionDisksStopGroupAsyncReplicationCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionDisksStopGroupAsyncReplicationCall) Fields(s ...googleapi.Field) *RegionDisksStopGroupAsyncReplicationCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionDisksStopGroupAsyncReplicationCall) Context(ctx context.Context) *RegionDisksStopGroupAsyncReplicationCall {
- 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 *RegionDisksStopGroupAsyncReplicationCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionDisksStopGroupAsyncReplicationCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksstopgroupasyncreplicationresource)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/stopGroupAsyncReplication")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionDisks.stopGroupAsyncReplication" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionDisksStopGroupAsyncReplicationCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Stops asynchronous replication for a consistency group of disks. Can be invoked either in the primary or secondary scope.",
- // "flatPath": "projects/{project}/regions/{region}/disks/stopGroupAsyncReplication",
- // "httpMethod": "POST",
- // "id": "compute.regionDisks.stopGroupAsyncReplication",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request. This must be the region of the primary or secondary disks in the consistency group.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/disks/stopGroupAsyncReplication",
- // "request": {
- // "$ref": "DisksStopGroupAsyncReplicationResource"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionDisks.testIamPermissions":
-
-type RegionDisksTestIamPermissionsCall struct {
- s *Service
- project string
- region string
- resource string
- testpermissionsrequest *TestPermissionsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// TestIamPermissions: Returns permissions that a caller has on the
-// specified resource.
-//
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-// - resource: Name or id of the resource for this request.
-func (r *RegionDisksService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionDisksTestIamPermissionsCall {
- c := &RegionDisksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.resource = resource
- c.testpermissionsrequest = testpermissionsrequest
- 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 *RegionDisksTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionDisksTestIamPermissionsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionDisksTestIamPermissionsCall) Context(ctx context.Context) *RegionDisksTestIamPermissionsCall {
- 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 *RegionDisksTestIamPermissionsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionDisksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{resource}/testIamPermissions")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionDisks.testIamPermissions" call.
-// Exactly one of *TestPermissionsResponse or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *TestPermissionsResponse.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 *RegionDisksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TestPermissionsResponse{
- 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": "Returns permissions that a caller has on the specified resource.",
- // "flatPath": "projects/{project}/regions/{region}/disks/{resource}/testIamPermissions",
- // "httpMethod": "POST",
- // "id": "compute.regionDisks.testIamPermissions",
- // "parameterOrder": [
- // "project",
- // "region",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/disks/{resource}/testIamPermissions",
- // "request": {
- // "$ref": "TestPermissionsRequest"
- // },
- // "response": {
- // "$ref": "TestPermissionsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.regionDisks.update":
-
-type RegionDisksUpdateCall struct {
- s *Service
- project string
- region string
- disk string
- disk2 *Disk
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Update: Update the specified disk with the data included in the
-// request. Update is performed only on selected fields included as part
-// of update-mask. Only the following fields can be modified:
-// user_license.
-//
-// - disk: The disk name for this request.
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-func (r *RegionDisksService) Update(project string, region string, disk string, disk2 *Disk) *RegionDisksUpdateCall {
- c := &RegionDisksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.disk = disk
- c.disk2 = disk2
- return c
-}
-
-// Paths sets the optional parameter "paths":
-func (c *RegionDisksUpdateCall) Paths(paths ...string) *RegionDisksUpdateCall {
- c.urlParams_.SetMulti("paths", append([]string{}, paths...))
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionDisksUpdateCall) RequestId(requestId string) *RegionDisksUpdateCall {
- c.urlParams_.Set("requestId", requestId)
- return c
-}
-
-// UpdateMask sets the optional parameter "updateMask": update_mask
-// indicates fields to be updated as part of this request.
-func (c *RegionDisksUpdateCall) UpdateMask(updateMask string) *RegionDisksUpdateCall {
- c.urlParams_.Set("updateMask", updateMask)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *RegionDisksUpdateCall) Fields(s ...googleapi.Field) *RegionDisksUpdateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionDisksUpdateCall) Context(ctx context.Context) *RegionDisksUpdateCall {
- 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 *RegionDisksUpdateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionDisksUpdateCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk2)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{disk}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "disk": c.disk,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionDisks.update" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionDisksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Update the specified disk with the data included in the request. Update is performed only on selected fields included as part of update-mask. Only the following fields can be modified: user_license.",
- // "flatPath": "projects/{project}/regions/{region}/disks/{disk}",
- // "httpMethod": "PATCH",
- // "id": "compute.regionDisks.update",
- // "parameterOrder": [
- // "project",
- // "region",
- // "disk"
- // ],
- // "parameters": {
- // "disk": {
- // "description": "The disk name for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "paths": {
- // "location": "query",
- // "repeated": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "updateMask": {
- // "description": "update_mask indicates fields to be updated as part of this request.",
- // "format": "google-fieldmask",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/disks/{disk}",
- // "request": {
- // "$ref": "Disk"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionHealthCheckServices.delete":
-
-type RegionHealthCheckServicesDeleteCall struct {
- s *Service
- project string
- region string
- healthCheckService string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified regional HealthCheckService.
-//
-// - healthCheckService: Name of the HealthCheckService to delete. The
-// name must be 1-63 characters long, and comply with RFC1035.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionHealthCheckServicesService) Delete(project string, region string, healthCheckService string) *RegionHealthCheckServicesDeleteCall {
- c := &RegionHealthCheckServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.healthCheckService = healthCheckService
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionHealthCheckServicesDeleteCall) RequestId(requestId string) *RegionHealthCheckServicesDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionHealthCheckServicesDeleteCall) Fields(s ...googleapi.Field) *RegionHealthCheckServicesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionHealthCheckServicesDeleteCall) Context(ctx context.Context) *RegionHealthCheckServicesDeleteCall {
- 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 *RegionHealthCheckServicesDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionHealthCheckServicesDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthCheckServices/{healthCheckService}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "healthCheckService": c.healthCheckService,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionHealthCheckServices.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionHealthCheckServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified regional HealthCheckService.",
- // "flatPath": "projects/{project}/regions/{region}/healthCheckServices/{healthCheckService}",
- // "httpMethod": "DELETE",
- // "id": "compute.regionHealthCheckServices.delete",
- // "parameterOrder": [
- // "project",
- // "region",
- // "healthCheckService"
- // ],
- // "parameters": {
- // "healthCheckService": {
- // "description": "Name of the HealthCheckService to delete. The name must be 1-63 characters long, and comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/healthCheckServices/{healthCheckService}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionHealthCheckServices.get":
-
-type RegionHealthCheckServicesGetCall struct {
- s *Service
- project string
- region string
- healthCheckService string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified regional HealthCheckService resource.
-//
-// - healthCheckService: Name of the HealthCheckService to update. The
-// name must be 1-63 characters long, and comply with RFC1035.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionHealthCheckServicesService) Get(project string, region string, healthCheckService string) *RegionHealthCheckServicesGetCall {
- c := &RegionHealthCheckServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.healthCheckService = healthCheckService
- 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 *RegionHealthCheckServicesGetCall) Fields(s ...googleapi.Field) *RegionHealthCheckServicesGetCall {
- 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 *RegionHealthCheckServicesGetCall) IfNoneMatch(entityTag string) *RegionHealthCheckServicesGetCall {
- 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 *RegionHealthCheckServicesGetCall) Context(ctx context.Context) *RegionHealthCheckServicesGetCall {
- 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 *RegionHealthCheckServicesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionHealthCheckServicesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/healthCheckServices/{healthCheckService}")
- 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{
- "project": c.project,
- "region": c.region,
- "healthCheckService": c.healthCheckService,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionHealthCheckServices.get" call.
-// Exactly one of *HealthCheckService or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *HealthCheckService.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 *RegionHealthCheckServicesGetCall) Do(opts ...googleapi.CallOption) (*HealthCheckService, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &HealthCheckService{
- 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": "Returns the specified regional HealthCheckService resource.",
- // "flatPath": "projects/{project}/regions/{region}/healthCheckServices/{healthCheckService}",
- // "httpMethod": "GET",
- // "id": "compute.regionHealthCheckServices.get",
- // "parameterOrder": [
- // "project",
- // "region",
- // "healthCheckService"
- // ],
- // "parameters": {
- // "healthCheckService": {
- // "description": "Name of the HealthCheckService to update. The name must be 1-63 characters long, and comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/healthCheckServices/{healthCheckService}",
- // "response": {
- // "$ref": "HealthCheckService"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.regionHealthCheckServices.insert":
-
-type RegionHealthCheckServicesInsertCall struct {
- s *Service
- project string
- region string
- healthcheckservice *HealthCheckService
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a regional HealthCheckService resource in the
-// specified project and region using the data included in the request.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionHealthCheckServicesService) Insert(project string, region string, healthcheckservice *HealthCheckService) *RegionHealthCheckServicesInsertCall {
- c := &RegionHealthCheckServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.healthcheckservice = healthcheckservice
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionHealthCheckServicesInsertCall) RequestId(requestId string) *RegionHealthCheckServicesInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionHealthCheckServicesInsertCall) Fields(s ...googleapi.Field) *RegionHealthCheckServicesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionHealthCheckServicesInsertCall) Context(ctx context.Context) *RegionHealthCheckServicesInsertCall {
- 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 *RegionHealthCheckServicesInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionHealthCheckServicesInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheckservice)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthCheckServices")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionHealthCheckServices.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionHealthCheckServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a regional HealthCheckService resource in the specified project and region using the data included in the request.",
- // "flatPath": "projects/{project}/regions/{region}/healthCheckServices",
- // "httpMethod": "POST",
- // "id": "compute.regionHealthCheckServices.insert",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/healthCheckServices",
- // "request": {
- // "$ref": "HealthCheckService"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionHealthCheckServices.list":
-
-type RegionHealthCheckServicesListCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Lists all the HealthCheckService resources that have been
-// configured for the specified project in the given region.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionHealthCheckServicesService) List(project string, region string) *RegionHealthCheckServicesListCall {
- c := &RegionHealthCheckServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *RegionHealthCheckServicesListCall) Filter(filter string) *RegionHealthCheckServicesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *RegionHealthCheckServicesListCall) MaxResults(maxResults int64) *RegionHealthCheckServicesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *RegionHealthCheckServicesListCall) OrderBy(orderBy string) *RegionHealthCheckServicesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *RegionHealthCheckServicesListCall) PageToken(pageToken string) *RegionHealthCheckServicesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *RegionHealthCheckServicesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionHealthCheckServicesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *RegionHealthCheckServicesListCall) Fields(s ...googleapi.Field) *RegionHealthCheckServicesListCall {
- 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 *RegionHealthCheckServicesListCall) IfNoneMatch(entityTag string) *RegionHealthCheckServicesListCall {
- 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 *RegionHealthCheckServicesListCall) Context(ctx context.Context) *RegionHealthCheckServicesListCall {
- 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 *RegionHealthCheckServicesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionHealthCheckServicesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/healthCheckServices")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionHealthCheckServices.list" call.
-// Exactly one of *HealthCheckServicesList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *HealthCheckServicesList.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 *RegionHealthCheckServicesListCall) Do(opts ...googleapi.CallOption) (*HealthCheckServicesList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &HealthCheckServicesList{
- 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": "Lists all the HealthCheckService resources that have been configured for the specified project in the given region.",
- // "flatPath": "projects/{project}/regions/{region}/healthCheckServices",
- // "httpMethod": "GET",
- // "id": "compute.regionHealthCheckServices.list",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/healthCheckServices",
- // "response": {
- // "$ref": "HealthCheckServicesList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *RegionHealthCheckServicesListCall) Pages(ctx context.Context, f func(*HealthCheckServicesList) 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 "compute.regionHealthCheckServices.patch":
-
-type RegionHealthCheckServicesPatchCall struct {
- s *Service
- project string
- region string
- healthCheckService string
- healthcheckservice *HealthCheckService
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Updates the specified regional HealthCheckService resource
-// with the data included in the request. This method supports PATCH
-// semantics and uses the JSON merge patch format and processing rules.
-//
-// - healthCheckService: Name of the HealthCheckService to update. The
-// name must be 1-63 characters long, and comply with RFC1035.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionHealthCheckServicesService) Patch(project string, region string, healthCheckService string, healthcheckservice *HealthCheckService) *RegionHealthCheckServicesPatchCall {
- c := &RegionHealthCheckServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.healthCheckService = healthCheckService
- c.healthcheckservice = healthcheckservice
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionHealthCheckServicesPatchCall) RequestId(requestId string) *RegionHealthCheckServicesPatchCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionHealthCheckServicesPatchCall) Fields(s ...googleapi.Field) *RegionHealthCheckServicesPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionHealthCheckServicesPatchCall) Context(ctx context.Context) *RegionHealthCheckServicesPatchCall {
- 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 *RegionHealthCheckServicesPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionHealthCheckServicesPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheckservice)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthCheckServices/{healthCheckService}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "healthCheckService": c.healthCheckService,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionHealthCheckServices.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionHealthCheckServicesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Updates the specified regional HealthCheckService resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
- // "flatPath": "projects/{project}/regions/{region}/healthCheckServices/{healthCheckService}",
- // "httpMethod": "PATCH",
- // "id": "compute.regionHealthCheckServices.patch",
- // "parameterOrder": [
- // "project",
- // "region",
- // "healthCheckService"
- // ],
- // "parameters": {
- // "healthCheckService": {
- // "description": "Name of the HealthCheckService to update. The name must be 1-63 characters long, and comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/healthCheckServices/{healthCheckService}",
- // "request": {
- // "$ref": "HealthCheckService"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionHealthChecks.delete":
-
-type RegionHealthChecksDeleteCall struct {
- s *Service
- project string
- region string
- healthCheck string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified HealthCheck resource.
-//
-// - healthCheck: Name of the HealthCheck resource to delete.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionHealthChecksService) Delete(project string, region string, healthCheck string) *RegionHealthChecksDeleteCall {
- c := &RegionHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.healthCheck = healthCheck
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionHealthChecksDeleteCall) RequestId(requestId string) *RegionHealthChecksDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionHealthChecksDeleteCall) Fields(s ...googleapi.Field) *RegionHealthChecksDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionHealthChecksDeleteCall) Context(ctx context.Context) *RegionHealthChecksDeleteCall {
- 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 *RegionHealthChecksDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthChecks/{healthCheck}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "healthCheck": c.healthCheck,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionHealthChecks.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionHealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified HealthCheck resource.",
- // "flatPath": "projects/{project}/regions/{region}/healthChecks/{healthCheck}",
- // "httpMethod": "DELETE",
- // "id": "compute.regionHealthChecks.delete",
- // "parameterOrder": [
- // "project",
- // "region",
- // "healthCheck"
- // ],
- // "parameters": {
- // "healthCheck": {
- // "description": "Name of the HealthCheck resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/healthChecks/{healthCheck}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionHealthChecks.get":
-
-type RegionHealthChecksGetCall struct {
- s *Service
- project string
- region string
- healthCheck string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified HealthCheck resource.
-//
-// - healthCheck: Name of the HealthCheck resource to return.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionHealthChecksService) Get(project string, region string, healthCheck string) *RegionHealthChecksGetCall {
- c := &RegionHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.healthCheck = healthCheck
- 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 *RegionHealthChecksGetCall) Fields(s ...googleapi.Field) *RegionHealthChecksGetCall {
- 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 *RegionHealthChecksGetCall) IfNoneMatch(entityTag string) *RegionHealthChecksGetCall {
- 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 *RegionHealthChecksGetCall) Context(ctx context.Context) *RegionHealthChecksGetCall {
- 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 *RegionHealthChecksGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionHealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/healthChecks/{healthCheck}")
- 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{
- "project": c.project,
- "region": c.region,
- "healthCheck": c.healthCheck,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionHealthChecks.get" call.
-// Exactly one of *HealthCheck or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *HealthCheck.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 *RegionHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HealthCheck, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &HealthCheck{
- 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": "Returns the specified HealthCheck resource.",
- // "flatPath": "projects/{project}/regions/{region}/healthChecks/{healthCheck}",
- // "httpMethod": "GET",
- // "id": "compute.regionHealthChecks.get",
- // "parameterOrder": [
- // "project",
- // "region",
- // "healthCheck"
- // ],
- // "parameters": {
- // "healthCheck": {
- // "description": "Name of the HealthCheck resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/healthChecks/{healthCheck}",
- // "response": {
- // "$ref": "HealthCheck"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.regionHealthChecks.insert":
-
-type RegionHealthChecksInsertCall struct {
- s *Service
- project string
- region string
- healthcheck *HealthCheck
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a HealthCheck resource in the specified project using
-// the data included in the request.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionHealthChecksService) Insert(project string, region string, healthcheck *HealthCheck) *RegionHealthChecksInsertCall {
- c := &RegionHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.healthcheck = healthcheck
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionHealthChecksInsertCall) RequestId(requestId string) *RegionHealthChecksInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionHealthChecksInsertCall) Fields(s ...googleapi.Field) *RegionHealthChecksInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionHealthChecksInsertCall) Context(ctx context.Context) *RegionHealthChecksInsertCall {
- 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 *RegionHealthChecksInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthChecks")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionHealthChecks.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionHealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a HealthCheck resource in the specified project using the data included in the request.",
- // "flatPath": "projects/{project}/regions/{region}/healthChecks",
- // "httpMethod": "POST",
- // "id": "compute.regionHealthChecks.insert",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/healthChecks",
- // "request": {
- // "$ref": "HealthCheck"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionHealthChecks.list":
-
-type RegionHealthChecksListCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves the list of HealthCheck resources available to the
-// specified project.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionHealthChecksService) List(project string, region string) *RegionHealthChecksListCall {
- c := &RegionHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *RegionHealthChecksListCall) Filter(filter string) *RegionHealthChecksListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *RegionHealthChecksListCall) MaxResults(maxResults int64) *RegionHealthChecksListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *RegionHealthChecksListCall) OrderBy(orderBy string) *RegionHealthChecksListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *RegionHealthChecksListCall) PageToken(pageToken string) *RegionHealthChecksListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *RegionHealthChecksListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionHealthChecksListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *RegionHealthChecksListCall) Fields(s ...googleapi.Field) *RegionHealthChecksListCall {
- 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 *RegionHealthChecksListCall) IfNoneMatch(entityTag string) *RegionHealthChecksListCall {
- 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 *RegionHealthChecksListCall) Context(ctx context.Context) *RegionHealthChecksListCall {
- 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 *RegionHealthChecksListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionHealthChecksListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/healthChecks")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionHealthChecks.list" call.
-// Exactly one of *HealthCheckList or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *HealthCheckList.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 *RegionHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HealthCheckList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &HealthCheckList{
- 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": "Retrieves the list of HealthCheck resources available to the specified project.",
- // "flatPath": "projects/{project}/regions/{region}/healthChecks",
- // "httpMethod": "GET",
- // "id": "compute.regionHealthChecks.list",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/healthChecks",
- // "response": {
- // "$ref": "HealthCheckList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *RegionHealthChecksListCall) Pages(ctx context.Context, f func(*HealthCheckList) 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 "compute.regionHealthChecks.patch":
-
-type RegionHealthChecksPatchCall struct {
- s *Service
- project string
- region string
- healthCheck string
- healthcheck *HealthCheck
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Updates a HealthCheck resource in the specified project using
-// the data included in the request. This method supports PATCH
-// semantics and uses the JSON merge patch format and processing rules.
-//
-// - healthCheck: Name of the HealthCheck resource to patch.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionHealthChecksService) Patch(project string, region string, healthCheck string, healthcheck *HealthCheck) *RegionHealthChecksPatchCall {
- c := &RegionHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.healthCheck = healthCheck
- c.healthcheck = healthcheck
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionHealthChecksPatchCall) RequestId(requestId string) *RegionHealthChecksPatchCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionHealthChecksPatchCall) Fields(s ...googleapi.Field) *RegionHealthChecksPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionHealthChecksPatchCall) Context(ctx context.Context) *RegionHealthChecksPatchCall {
- 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 *RegionHealthChecksPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthChecks/{healthCheck}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "healthCheck": c.healthCheck,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionHealthChecks.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionHealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
- // "flatPath": "projects/{project}/regions/{region}/healthChecks/{healthCheck}",
- // "httpMethod": "PATCH",
- // "id": "compute.regionHealthChecks.patch",
- // "parameterOrder": [
- // "project",
- // "region",
- // "healthCheck"
- // ],
- // "parameters": {
- // "healthCheck": {
- // "description": "Name of the HealthCheck resource to patch.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/healthChecks/{healthCheck}",
- // "request": {
- // "$ref": "HealthCheck"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionHealthChecks.update":
-
-type RegionHealthChecksUpdateCall struct {
- s *Service
- project string
- region string
- healthCheck string
- healthcheck *HealthCheck
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Update: Updates a HealthCheck resource in the specified project using
-// the data included in the request.
-//
-// - healthCheck: Name of the HealthCheck resource to update.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionHealthChecksService) Update(project string, region string, healthCheck string, healthcheck *HealthCheck) *RegionHealthChecksUpdateCall {
- c := &RegionHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.healthCheck = healthCheck
- c.healthcheck = healthcheck
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionHealthChecksUpdateCall) RequestId(requestId string) *RegionHealthChecksUpdateCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionHealthChecksUpdateCall) Fields(s ...googleapi.Field) *RegionHealthChecksUpdateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionHealthChecksUpdateCall) Context(ctx context.Context) *RegionHealthChecksUpdateCall {
- 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 *RegionHealthChecksUpdateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthChecks/{healthCheck}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PUT", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "healthCheck": c.healthCheck,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionHealthChecks.update" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionHealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Updates a HealthCheck resource in the specified project using the data included in the request.",
- // "flatPath": "projects/{project}/regions/{region}/healthChecks/{healthCheck}",
- // "httpMethod": "PUT",
- // "id": "compute.regionHealthChecks.update",
- // "parameterOrder": [
- // "project",
- // "region",
- // "healthCheck"
- // ],
- // "parameters": {
- // "healthCheck": {
- // "description": "Name of the HealthCheck resource to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/healthChecks/{healthCheck}",
- // "request": {
- // "$ref": "HealthCheck"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionInstanceGroupManagers.abandonInstances":
-
-type RegionInstanceGroupManagersAbandonInstancesCall struct {
- s *Service
- project string
- region string
- instanceGroupManager string
- regioninstancegroupmanagersabandoninstancesrequest *RegionInstanceGroupManagersAbandonInstancesRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// AbandonInstances: Flags the specified instances to be immediately
-// removed from the managed instance group. Abandoning an instance does
-// not delete the instance, but it does remove the instance from any
-// target pools that are applied by the managed instance group. This
-// method reduces the targetSize of the managed instance group by the
-// number of instances that you abandon. This operation is marked as
-// DONE when the action is scheduled even if the instances have not yet
-// been removed from the group. You must separately verify the status of
-// the abandoning action with the listmanagedinstances method. If the
-// group is part of a backend service that has enabled connection
-// draining, it can take up to 60 seconds after the connection draining
-// duration has elapsed before the VM instance is removed or deleted.
-// You can specify a maximum of 1000 instances with this method per
-// request.
-//
-// - instanceGroupManager: Name of the managed instance group.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionInstanceGroupManagersService) AbandonInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersabandoninstancesrequest *RegionInstanceGroupManagersAbandonInstancesRequest) *RegionInstanceGroupManagersAbandonInstancesCall {
- c := &RegionInstanceGroupManagersAbandonInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.instanceGroupManager = instanceGroupManager
- c.regioninstancegroupmanagersabandoninstancesrequest = regioninstancegroupmanagersabandoninstancesrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionInstanceGroupManagersAbandonInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersAbandonInstancesCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionInstanceGroupManagersAbandonInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersAbandonInstancesCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionInstanceGroupManagersAbandonInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersAbandonInstancesCall {
- 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 *RegionInstanceGroupManagersAbandonInstancesCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionInstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersabandoninstancesrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "instanceGroupManager": c.instanceGroupManager,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionInstanceGroupManagers.abandonInstances" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionInstanceGroupManagersAbandonInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Flags the specified instances to be immediately removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request.",
- // "flatPath": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances",
- // "httpMethod": "POST",
- // "id": "compute.regionInstanceGroupManagers.abandonInstances",
- // "parameterOrder": [
- // "project",
- // "region",
- // "instanceGroupManager"
- // ],
- // "parameters": {
- // "instanceGroupManager": {
- // "description": "Name of the managed instance group.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances",
- // "request": {
- // "$ref": "RegionInstanceGroupManagersAbandonInstancesRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionInstanceGroupManagers.applyUpdatesToInstances":
-
-type RegionInstanceGroupManagersApplyUpdatesToInstancesCall struct {
- s *Service
- project string
- region string
- instanceGroupManager string
- regioninstancegroupmanagersapplyupdatesrequest *RegionInstanceGroupManagersApplyUpdatesRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// ApplyUpdatesToInstances: Apply updates to selected instances the
-// managed instance group.
-//
-// - instanceGroupManager: The name of the managed instance group,
-// should conform to RFC1035.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request, should conform to
-// RFC1035.
-func (r *RegionInstanceGroupManagersService) ApplyUpdatesToInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersapplyupdatesrequest *RegionInstanceGroupManagersApplyUpdatesRequest) *RegionInstanceGroupManagersApplyUpdatesToInstancesCall {
- c := &RegionInstanceGroupManagersApplyUpdatesToInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.instanceGroupManager = instanceGroupManager
- c.regioninstancegroupmanagersapplyupdatesrequest = regioninstancegroupmanagersapplyupdatesrequest
- 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 *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersApplyUpdatesToInstancesCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersApplyUpdatesToInstancesCall {
- 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 *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersapplyupdatesrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/applyUpdatesToInstances")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "instanceGroupManager": c.instanceGroupManager,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionInstanceGroupManagers.applyUpdatesToInstances" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Apply updates to selected instances the managed instance group.",
- // "flatPath": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/applyUpdatesToInstances",
- // "httpMethod": "POST",
- // "id": "compute.regionInstanceGroupManagers.applyUpdatesToInstances",
- // "parameterOrder": [
- // "project",
- // "region",
- // "instanceGroupManager"
- // ],
- // "parameters": {
- // "instanceGroupManager": {
- // "description": "The name of the managed instance group, should conform to RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request, should conform to RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/applyUpdatesToInstances",
- // "request": {
- // "$ref": "RegionInstanceGroupManagersApplyUpdatesRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionInstanceGroupManagers.createInstances":
-
-type RegionInstanceGroupManagersCreateInstancesCall struct {
- s *Service
- project string
- region string
- instanceGroupManager string
- regioninstancegroupmanagerscreateinstancesrequest *RegionInstanceGroupManagersCreateInstancesRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// CreateInstances: Creates instances with per-instance configurations
-// in this regional managed instance group. Instances are created using
-// the current instance template. The create instances operation is
-// marked DONE if the createInstances request is successful. The
-// underlying actions take additional time. You must separately verify
-// the status of the creating or actions with the listmanagedinstances
-// method.
-//
-// - instanceGroupManager: The name of the managed instance group. It
-// should conform to RFC1035.
-// - project: Project ID for this request.
-// - region: The name of the region where the managed instance group is
-// located. It should conform to RFC1035.
-func (r *RegionInstanceGroupManagersService) CreateInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagerscreateinstancesrequest *RegionInstanceGroupManagersCreateInstancesRequest) *RegionInstanceGroupManagersCreateInstancesCall {
- c := &RegionInstanceGroupManagersCreateInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.instanceGroupManager = instanceGroupManager
- c.regioninstancegroupmanagerscreateinstancesrequest = regioninstancegroupmanagerscreateinstancesrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. The request ID
-// must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionInstanceGroupManagersCreateInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersCreateInstancesCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionInstanceGroupManagersCreateInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersCreateInstancesCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionInstanceGroupManagersCreateInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersCreateInstancesCall {
- 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 *RegionInstanceGroupManagersCreateInstancesCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionInstanceGroupManagersCreateInstancesCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerscreateinstancesrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/createInstances")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "instanceGroupManager": c.instanceGroupManager,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionInstanceGroupManagers.createInstances" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionInstanceGroupManagersCreateInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates instances with per-instance configurations in this regional managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method.",
- // "flatPath": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/createInstances",
- // "httpMethod": "POST",
- // "id": "compute.regionInstanceGroupManagers.createInstances",
- // "parameterOrder": [
- // "project",
- // "region",
- // "instanceGroupManager"
- // ],
- // "parameters": {
- // "instanceGroupManager": {
- // "description": "The name of the managed instance group. It should conform to RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region where the managed instance group is located. It should conform to RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/createInstances",
- // "request": {
- // "$ref": "RegionInstanceGroupManagersCreateInstancesRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionInstanceGroupManagers.delete":
-
-type RegionInstanceGroupManagersDeleteCall struct {
- s *Service
- project string
- region string
- instanceGroupManager string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified managed instance group and all of the
-// instances in that group.
-//
-// - instanceGroupManager: Name of the managed instance group to delete.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionInstanceGroupManagersService) Delete(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersDeleteCall {
- c := &RegionInstanceGroupManagersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.instanceGroupManager = instanceGroupManager
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionInstanceGroupManagersDeleteCall) RequestId(requestId string) *RegionInstanceGroupManagersDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionInstanceGroupManagersDeleteCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionInstanceGroupManagersDeleteCall) Context(ctx context.Context) *RegionInstanceGroupManagersDeleteCall {
- 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 *RegionInstanceGroupManagersDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionInstanceGroupManagersDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "instanceGroupManager": c.instanceGroupManager,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionInstanceGroupManagers.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionInstanceGroupManagersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified managed instance group and all of the instances in that group.",
- // "flatPath": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
- // "httpMethod": "DELETE",
- // "id": "compute.regionInstanceGroupManagers.delete",
- // "parameterOrder": [
- // "project",
- // "region",
- // "instanceGroupManager"
- // ],
- // "parameters": {
- // "instanceGroupManager": {
- // "description": "Name of the managed instance group to delete.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionInstanceGroupManagers.deleteInstances":
-
-type RegionInstanceGroupManagersDeleteInstancesCall struct {
- s *Service
- project string
- region string
- instanceGroupManager string
- regioninstancegroupmanagersdeleteinstancesrequest *RegionInstanceGroupManagersDeleteInstancesRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// DeleteInstances: Flags the specified instances in the managed
-// instance group to be immediately deleted. The instances are also
-// removed from any target pools of which they were a member. This
-// method reduces the targetSize of the managed instance group by the
-// number of instances that you delete. The deleteInstances operation is
-// marked DONE if the deleteInstances request is successful. The
-// underlying actions take additional time. You must separately verify
-// the status of the deleting action with the listmanagedinstances
-// method. If the group is part of a backend service that has enabled
-// connection draining, it can take up to 60 seconds after the
-// connection draining duration has elapsed before the VM instance is
-// removed or deleted. You can specify a maximum of 1000 instances with
-// this method per request.
-//
-// - instanceGroupManager: Name of the managed instance group.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionInstanceGroupManagersService) DeleteInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersdeleteinstancesrequest *RegionInstanceGroupManagersDeleteInstancesRequest) *RegionInstanceGroupManagersDeleteInstancesCall {
- c := &RegionInstanceGroupManagersDeleteInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.instanceGroupManager = instanceGroupManager
- c.regioninstancegroupmanagersdeleteinstancesrequest = regioninstancegroupmanagersdeleteinstancesrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionInstanceGroupManagersDeleteInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersDeleteInstancesCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionInstanceGroupManagersDeleteInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersDeleteInstancesCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionInstanceGroupManagersDeleteInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersDeleteInstancesCall {
- 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 *RegionInstanceGroupManagersDeleteInstancesCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionInstanceGroupManagersDeleteInstancesCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersdeleteinstancesrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "instanceGroupManager": c.instanceGroupManager,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionInstanceGroupManagers.deleteInstances" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionInstanceGroupManagersDeleteInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Flags the specified instances in the managed instance group to be immediately deleted. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. The deleteInstances operation is marked DONE if the deleteInstances request is successful. The underlying actions take additional time. You must separately verify the status of the deleting action with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request.",
- // "flatPath": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances",
- // "httpMethod": "POST",
- // "id": "compute.regionInstanceGroupManagers.deleteInstances",
- // "parameterOrder": [
- // "project",
- // "region",
- // "instanceGroupManager"
- // ],
- // "parameters": {
- // "instanceGroupManager": {
- // "description": "Name of the managed instance group.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances",
- // "request": {
- // "$ref": "RegionInstanceGroupManagersDeleteInstancesRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionInstanceGroupManagers.deletePerInstanceConfigs":
-
-type RegionInstanceGroupManagersDeletePerInstanceConfigsCall struct {
- s *Service
- project string
- region string
- instanceGroupManager string
- regioninstancegroupmanagerdeleteinstanceconfigreq *RegionInstanceGroupManagerDeleteInstanceConfigReq
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// DeletePerInstanceConfigs: Deletes selected per-instance
-// configurations for the managed instance group.
-//
-// - instanceGroupManager: The name of the managed instance group. It
-// should conform to RFC1035.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request, should conform to
-// RFC1035.
-func (r *RegionInstanceGroupManagersService) DeletePerInstanceConfigs(project string, region string, instanceGroupManager string, regioninstancegroupmanagerdeleteinstanceconfigreq *RegionInstanceGroupManagerDeleteInstanceConfigReq) *RegionInstanceGroupManagersDeletePerInstanceConfigsCall {
- c := &RegionInstanceGroupManagersDeletePerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.instanceGroupManager = instanceGroupManager
- c.regioninstancegroupmanagerdeleteinstanceconfigreq = regioninstancegroupmanagerdeleteinstanceconfigreq
- 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 *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersDeletePerInstanceConfigsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) Context(ctx context.Context) *RegionInstanceGroupManagersDeletePerInstanceConfigsCall {
- 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 *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerdeleteinstanceconfigreq)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deletePerInstanceConfigs")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "instanceGroupManager": c.instanceGroupManager,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionInstanceGroupManagers.deletePerInstanceConfigs" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes selected per-instance configurations for the managed instance group.",
- // "flatPath": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deletePerInstanceConfigs",
- // "httpMethod": "POST",
- // "id": "compute.regionInstanceGroupManagers.deletePerInstanceConfigs",
- // "parameterOrder": [
- // "project",
- // "region",
- // "instanceGroupManager"
- // ],
- // "parameters": {
- // "instanceGroupManager": {
- // "description": "The name of the managed instance group. It should conform to RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request, should conform to RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deletePerInstanceConfigs",
- // "request": {
- // "$ref": "RegionInstanceGroupManagerDeleteInstanceConfigReq"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionInstanceGroupManagers.get":
-
-type RegionInstanceGroupManagersGetCall struct {
- s *Service
- project string
- region string
- instanceGroupManager string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns all of the details about the specified managed instance
-// group.
-//
-// - instanceGroupManager: Name of the managed instance group to return.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionInstanceGroupManagersService) Get(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersGetCall {
- c := &RegionInstanceGroupManagersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.instanceGroupManager = instanceGroupManager
- 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 *RegionInstanceGroupManagersGetCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersGetCall {
- 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 *RegionInstanceGroupManagersGetCall) IfNoneMatch(entityTag string) *RegionInstanceGroupManagersGetCall {
- 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 *RegionInstanceGroupManagersGetCall) Context(ctx context.Context) *RegionInstanceGroupManagersGetCall {
- 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 *RegionInstanceGroupManagersGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionInstanceGroupManagersGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
- 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{
- "project": c.project,
- "region": c.region,
- "instanceGroupManager": c.instanceGroupManager,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionInstanceGroupManagers.get" call.
-// Exactly one of *InstanceGroupManager or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *InstanceGroupManager.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 *RegionInstanceGroupManagersGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManager, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &InstanceGroupManager{
- 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": "Returns all of the details about the specified managed instance group.",
- // "flatPath": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
- // "httpMethod": "GET",
- // "id": "compute.regionInstanceGroupManagers.get",
- // "parameterOrder": [
- // "project",
- // "region",
- // "instanceGroupManager"
- // ],
- // "parameters": {
- // "instanceGroupManager": {
- // "description": "Name of the managed instance group to return.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
- // "response": {
- // "$ref": "InstanceGroupManager"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.regionInstanceGroupManagers.insert":
-
-type RegionInstanceGroupManagersInsertCall struct {
- s *Service
- project string
- region string
- instancegroupmanager *InstanceGroupManager
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a managed instance group using the information that
-// you specify in the request. After the group is created, instances in
-// the group are created using the specified instance template. This
-// operation is marked as DONE when the group is created even if the
-// instances in the group have not yet been created. You must separately
-// verify the status of the individual instances with the
-// listmanagedinstances method. A regional managed instance group can
-// contain up to 2000 instances.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionInstanceGroupManagersService) Insert(project string, region string, instancegroupmanager *InstanceGroupManager) *RegionInstanceGroupManagersInsertCall {
- c := &RegionInstanceGroupManagersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.instancegroupmanager = instancegroupmanager
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionInstanceGroupManagersInsertCall) RequestId(requestId string) *RegionInstanceGroupManagersInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionInstanceGroupManagersInsertCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionInstanceGroupManagersInsertCall) Context(ctx context.Context) *RegionInstanceGroupManagersInsertCall {
- 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 *RegionInstanceGroupManagersInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionInstanceGroupManagersInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionInstanceGroupManagers.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionInstanceGroupManagersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. A regional managed instance group can contain up to 2000 instances.",
- // "flatPath": "projects/{project}/regions/{region}/instanceGroupManagers",
- // "httpMethod": "POST",
- // "id": "compute.regionInstanceGroupManagers.insert",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/instanceGroupManagers",
- // "request": {
- // "$ref": "InstanceGroupManager"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionInstanceGroupManagers.list":
-
-type RegionInstanceGroupManagersListCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves the list of managed instance groups that are
-// contained within the specified region.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionInstanceGroupManagersService) List(project string, region string) *RegionInstanceGroupManagersListCall {
- c := &RegionInstanceGroupManagersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *RegionInstanceGroupManagersListCall) Filter(filter string) *RegionInstanceGroupManagersListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *RegionInstanceGroupManagersListCall) MaxResults(maxResults int64) *RegionInstanceGroupManagersListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *RegionInstanceGroupManagersListCall) OrderBy(orderBy string) *RegionInstanceGroupManagersListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *RegionInstanceGroupManagersListCall) PageToken(pageToken string) *RegionInstanceGroupManagersListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *RegionInstanceGroupManagersListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionInstanceGroupManagersListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *RegionInstanceGroupManagersListCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersListCall {
- 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 *RegionInstanceGroupManagersListCall) IfNoneMatch(entityTag string) *RegionInstanceGroupManagersListCall {
- 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 *RegionInstanceGroupManagersListCall) Context(ctx context.Context) *RegionInstanceGroupManagersListCall {
- 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 *RegionInstanceGroupManagersListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionInstanceGroupManagersListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/instanceGroupManagers")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionInstanceGroupManagers.list" call.
-// Exactly one of *RegionInstanceGroupManagerList or error will be
-// non-nil. Any non-2xx status code is an error. Response headers are in
-// either *RegionInstanceGroupManagerList.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 *RegionInstanceGroupManagersListCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupManagerList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &RegionInstanceGroupManagerList{
- 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": "Retrieves the list of managed instance groups that are contained within the specified region.",
- // "flatPath": "projects/{project}/regions/{region}/instanceGroupManagers",
- // "httpMethod": "GET",
- // "id": "compute.regionInstanceGroupManagers.list",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/instanceGroupManagers",
- // "response": {
- // "$ref": "RegionInstanceGroupManagerList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *RegionInstanceGroupManagersListCall) Pages(ctx context.Context, f func(*RegionInstanceGroupManagerList) 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 "compute.regionInstanceGroupManagers.listErrors":
-
-type RegionInstanceGroupManagersListErrorsCall struct {
- s *Service
- project string
- region string
- instanceGroupManager string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// ListErrors: Lists all errors thrown by actions on instances for a
-// given regional managed instance group. The filter and orderBy query
-// parameters are not supported.
-//
-// - instanceGroupManager: The name of the managed instance group. It
-// must be a string that meets the requirements in RFC1035, or an
-// unsigned long integer: must match regexp pattern: (?:a-z
-// (?:[-a-z0-9]{0,61}[a-z0-9])?)|1-9{0,19}.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request. This should
-// conform to RFC1035.
-func (r *RegionInstanceGroupManagersService) ListErrors(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersListErrorsCall {
- c := &RegionInstanceGroupManagersListErrorsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.instanceGroupManager = instanceGroupManager
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *RegionInstanceGroupManagersListErrorsCall) Filter(filter string) *RegionInstanceGroupManagersListErrorsCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *RegionInstanceGroupManagersListErrorsCall) MaxResults(maxResults int64) *RegionInstanceGroupManagersListErrorsCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *RegionInstanceGroupManagersListErrorsCall) OrderBy(orderBy string) *RegionInstanceGroupManagersListErrorsCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *RegionInstanceGroupManagersListErrorsCall) PageToken(pageToken string) *RegionInstanceGroupManagersListErrorsCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *RegionInstanceGroupManagersListErrorsCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionInstanceGroupManagersListErrorsCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *RegionInstanceGroupManagersListErrorsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersListErrorsCall {
- 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 *RegionInstanceGroupManagersListErrorsCall) IfNoneMatch(entityTag string) *RegionInstanceGroupManagersListErrorsCall {
- 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 *RegionInstanceGroupManagersListErrorsCall) Context(ctx context.Context) *RegionInstanceGroupManagersListErrorsCall {
- 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 *RegionInstanceGroupManagersListErrorsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionInstanceGroupManagersListErrorsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listErrors")
- 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{
- "project": c.project,
- "region": c.region,
- "instanceGroupManager": c.instanceGroupManager,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionInstanceGroupManagers.listErrors" call.
-// Exactly one of *RegionInstanceGroupManagersListErrorsResponse or
-// error will be non-nil. Any non-2xx status code is an error. Response
-// headers are in either
-// *RegionInstanceGroupManagersListErrorsResponse.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 *RegionInstanceGroupManagersListErrorsCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupManagersListErrorsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &RegionInstanceGroupManagersListErrorsResponse{
- 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": "Lists all errors thrown by actions on instances for a given regional managed instance group. The filter and orderBy query parameters are not supported.",
- // "flatPath": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listErrors",
- // "httpMethod": "GET",
- // "id": "compute.regionInstanceGroupManagers.listErrors",
- // "parameterOrder": [
- // "project",
- // "region",
- // "instanceGroupManager"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "instanceGroupManager": {
- // "description": "The name of the managed instance group. It must be a string that meets the requirements in RFC1035, or an unsigned long integer: must match regexp pattern: (?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|1-9{0,19}.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request. This should conform to RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listErrors",
- // "response": {
- // "$ref": "RegionInstanceGroupManagersListErrorsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *RegionInstanceGroupManagersListErrorsCall) Pages(ctx context.Context, f func(*RegionInstanceGroupManagersListErrorsResponse) 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 "compute.regionInstanceGroupManagers.listManagedInstances":
-
-type RegionInstanceGroupManagersListManagedInstancesCall struct {
- s *Service
- project string
- region string
- instanceGroupManager string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// ListManagedInstances: Lists the instances in the managed instance
-// group and instances that are scheduled to be created. The list
-// includes any current actions that the group has scheduled for its
-// instances. The orderBy query parameter is not supported. The
-// `pageToken` query parameter is supported only if the group's
-// `listManagedInstancesResults` field is set to `PAGINATED`.
-//
-// - instanceGroupManager: The name of the managed instance group.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionInstanceGroupManagersService) ListManagedInstances(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersListManagedInstancesCall {
- c := &RegionInstanceGroupManagersListManagedInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.instanceGroupManager = instanceGroupManager
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *RegionInstanceGroupManagersListManagedInstancesCall) Filter(filter string) *RegionInstanceGroupManagersListManagedInstancesCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *RegionInstanceGroupManagersListManagedInstancesCall) MaxResults(maxResults int64) *RegionInstanceGroupManagersListManagedInstancesCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *RegionInstanceGroupManagersListManagedInstancesCall) OrderBy(orderBy string) *RegionInstanceGroupManagersListManagedInstancesCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *RegionInstanceGroupManagersListManagedInstancesCall) PageToken(pageToken string) *RegionInstanceGroupManagersListManagedInstancesCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *RegionInstanceGroupManagersListManagedInstancesCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionInstanceGroupManagersListManagedInstancesCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *RegionInstanceGroupManagersListManagedInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersListManagedInstancesCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionInstanceGroupManagersListManagedInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersListManagedInstancesCall {
- 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 *RegionInstanceGroupManagersListManagedInstancesCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionInstanceGroupManagersListManagedInstancesCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "instanceGroupManager": c.instanceGroupManager,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionInstanceGroupManagers.listManagedInstances" call.
-// Exactly one of *RegionInstanceGroupManagersListInstancesResponse or
-// error will be non-nil. Any non-2xx status code is an error. Response
-// headers are in either
-// *RegionInstanceGroupManagersListInstancesResponse.ServerResponse.Heade
-// r 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 *RegionInstanceGroupManagersListManagedInstancesCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupManagersListInstancesResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &RegionInstanceGroupManagersListInstancesResponse{
- 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": "Lists the instances in the managed instance group and instances that are scheduled to be created. The list includes any current actions that the group has scheduled for its instances. The orderBy query parameter is not supported. The `pageToken` query parameter is supported only if the group's `listManagedInstancesResults` field is set to `PAGINATED`.",
- // "flatPath": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances",
- // "httpMethod": "POST",
- // "id": "compute.regionInstanceGroupManagers.listManagedInstances",
- // "parameterOrder": [
- // "project",
- // "region",
- // "instanceGroupManager"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "instanceGroupManager": {
- // "description": "The name of the managed instance group.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances",
- // "response": {
- // "$ref": "RegionInstanceGroupManagersListInstancesResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *RegionInstanceGroupManagersListManagedInstancesCall) Pages(ctx context.Context, f func(*RegionInstanceGroupManagersListInstancesResponse) 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 "compute.regionInstanceGroupManagers.listPerInstanceConfigs":
-
-type RegionInstanceGroupManagersListPerInstanceConfigsCall struct {
- s *Service
- project string
- region string
- instanceGroupManager string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// ListPerInstanceConfigs: Lists all of the per-instance configurations
-// defined for the managed instance group. The orderBy query parameter
-// is not supported.
-//
-// - instanceGroupManager: The name of the managed instance group. It
-// should conform to RFC1035.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request, should conform to
-// RFC1035.
-func (r *RegionInstanceGroupManagersService) ListPerInstanceConfigs(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersListPerInstanceConfigsCall {
- c := &RegionInstanceGroupManagersListPerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.instanceGroupManager = instanceGroupManager
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Filter(filter string) *RegionInstanceGroupManagersListPerInstanceConfigsCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) MaxResults(maxResults int64) *RegionInstanceGroupManagersListPerInstanceConfigsCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) OrderBy(orderBy string) *RegionInstanceGroupManagersListPerInstanceConfigsCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) PageToken(pageToken string) *RegionInstanceGroupManagersListPerInstanceConfigsCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionInstanceGroupManagersListPerInstanceConfigsCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *RegionInstanceGroupManagersListPerInstanceConfigsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersListPerInstanceConfigsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionInstanceGroupManagersListPerInstanceConfigsCall) Context(ctx context.Context) *RegionInstanceGroupManagersListPerInstanceConfigsCall {
- 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 *RegionInstanceGroupManagersListPerInstanceConfigsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listPerInstanceConfigs")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "instanceGroupManager": c.instanceGroupManager,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionInstanceGroupManagers.listPerInstanceConfigs" call.
-// Exactly one of *RegionInstanceGroupManagersListInstanceConfigsResp or
-// error will be non-nil. Any non-2xx status code is an error. Response
-// headers are in either
-// *RegionInstanceGroupManagersListInstanceConfigsResp.ServerResponse.Hea
-// der 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 *RegionInstanceGroupManagersListPerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupManagersListInstanceConfigsResp, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &RegionInstanceGroupManagersListInstanceConfigsResp{
- 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": "Lists all of the per-instance configurations defined for the managed instance group. The orderBy query parameter is not supported.",
- // "flatPath": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listPerInstanceConfigs",
- // "httpMethod": "POST",
- // "id": "compute.regionInstanceGroupManagers.listPerInstanceConfigs",
- // "parameterOrder": [
- // "project",
- // "region",
- // "instanceGroupManager"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "instanceGroupManager": {
- // "description": "The name of the managed instance group. It should conform to RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request, should conform to RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listPerInstanceConfigs",
- // "response": {
- // "$ref": "RegionInstanceGroupManagersListInstanceConfigsResp"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *RegionInstanceGroupManagersListPerInstanceConfigsCall) Pages(ctx context.Context, f func(*RegionInstanceGroupManagersListInstanceConfigsResp) 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 "compute.regionInstanceGroupManagers.patch":
-
-type RegionInstanceGroupManagersPatchCall struct {
- s *Service
- project string
- region string
- instanceGroupManager string
- instancegroupmanager *InstanceGroupManager
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Updates a managed instance group using the information that
-// you specify in the request. This operation is marked as DONE when the
-// group is patched even if the instances in the group are still in the
-// process of being patched. You must separately verify the status of
-// the individual instances with the listmanagedinstances method. This
-// method supports PATCH semantics and uses the JSON merge patch format
-// and processing rules. If you update your group to specify a new
-// template or instance configuration, it's possible that your intended
-// specification for each VM in the group is different from the current
-// state of that VM. To learn how to apply an updated configuration to
-// the VMs in a MIG, see Updating instances in a MIG.
-//
-// - instanceGroupManager: The name of the instance group manager.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionInstanceGroupManagersService) Patch(project string, region string, instanceGroupManager string, instancegroupmanager *InstanceGroupManager) *RegionInstanceGroupManagersPatchCall {
- c := &RegionInstanceGroupManagersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.instanceGroupManager = instanceGroupManager
- c.instancegroupmanager = instancegroupmanager
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionInstanceGroupManagersPatchCall) RequestId(requestId string) *RegionInstanceGroupManagersPatchCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionInstanceGroupManagersPatchCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionInstanceGroupManagersPatchCall) Context(ctx context.Context) *RegionInstanceGroupManagersPatchCall {
- 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 *RegionInstanceGroupManagersPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionInstanceGroupManagersPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "instanceGroupManager": c.instanceGroupManager,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionInstanceGroupManagers.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionInstanceGroupManagersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listmanagedinstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. If you update your group to specify a new template or instance configuration, it's possible that your intended specification for each VM in the group is different from the current state of that VM. To learn how to apply an updated configuration to the VMs in a MIG, see Updating instances in a MIG.",
- // "flatPath": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
- // "httpMethod": "PATCH",
- // "id": "compute.regionInstanceGroupManagers.patch",
- // "parameterOrder": [
- // "project",
- // "region",
- // "instanceGroupManager"
- // ],
- // "parameters": {
- // "instanceGroupManager": {
- // "description": "The name of the instance group manager.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
- // "request": {
- // "$ref": "InstanceGroupManager"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionInstanceGroupManagers.patchPerInstanceConfigs":
-
-type RegionInstanceGroupManagersPatchPerInstanceConfigsCall struct {
- s *Service
- project string
- region string
- instanceGroupManager string
- regioninstancegroupmanagerpatchinstanceconfigreq *RegionInstanceGroupManagerPatchInstanceConfigReq
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// PatchPerInstanceConfigs: Inserts or patches per-instance
-// configurations for the managed instance group. perInstanceConfig.name
-// serves as a key used to distinguish whether to perform insert or
-// patch.
-//
-// - instanceGroupManager: The name of the managed instance group. It
-// should conform to RFC1035.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request, should conform to
-// RFC1035.
-func (r *RegionInstanceGroupManagersService) PatchPerInstanceConfigs(project string, region string, instanceGroupManager string, regioninstancegroupmanagerpatchinstanceconfigreq *RegionInstanceGroupManagerPatchInstanceConfigReq) *RegionInstanceGroupManagersPatchPerInstanceConfigsCall {
- c := &RegionInstanceGroupManagersPatchPerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.instanceGroupManager = instanceGroupManager
- c.regioninstancegroupmanagerpatchinstanceconfigreq = regioninstancegroupmanagerpatchinstanceconfigreq
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionInstanceGroupManagersPatchPerInstanceConfigsCall) RequestId(requestId string) *RegionInstanceGroupManagersPatchPerInstanceConfigsCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionInstanceGroupManagersPatchPerInstanceConfigsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersPatchPerInstanceConfigsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionInstanceGroupManagersPatchPerInstanceConfigsCall) Context(ctx context.Context) *RegionInstanceGroupManagersPatchPerInstanceConfigsCall {
- 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 *RegionInstanceGroupManagersPatchPerInstanceConfigsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionInstanceGroupManagersPatchPerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerpatchinstanceconfigreq)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/patchPerInstanceConfigs")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "instanceGroupManager": c.instanceGroupManager,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionInstanceGroupManagers.patchPerInstanceConfigs" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionInstanceGroupManagersPatchPerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Inserts or patches per-instance configurations for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch.",
- // "flatPath": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/patchPerInstanceConfigs",
- // "httpMethod": "POST",
- // "id": "compute.regionInstanceGroupManagers.patchPerInstanceConfigs",
- // "parameterOrder": [
- // "project",
- // "region",
- // "instanceGroupManager"
- // ],
- // "parameters": {
- // "instanceGroupManager": {
- // "description": "The name of the managed instance group. It should conform to RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request, should conform to RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/patchPerInstanceConfigs",
- // "request": {
- // "$ref": "RegionInstanceGroupManagerPatchInstanceConfigReq"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionInstanceGroupManagers.recreateInstances":
-
-type RegionInstanceGroupManagersRecreateInstancesCall struct {
- s *Service
- project string
- region string
- instanceGroupManager string
- regioninstancegroupmanagersrecreaterequest *RegionInstanceGroupManagersRecreateRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// RecreateInstances: Flags the specified VM instances in the managed
-// instance group to be immediately recreated. Each instance is
-// recreated using the group's current configuration. This operation is
-// marked as DONE when the flag is set even if the instances have not
-// yet been recreated. You must separately verify the status of each
-// instance by checking its currentAction field; for more information,
-// see Checking the status of managed instances. If the group is part of
-// a backend service that has enabled connection draining, it can take
-// up to 60 seconds after the connection draining duration has elapsed
-// before the VM instance is removed or deleted. You can specify a
-// maximum of 1000 instances with this method per request.
-//
-// - instanceGroupManager: Name of the managed instance group.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionInstanceGroupManagersService) RecreateInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersrecreaterequest *RegionInstanceGroupManagersRecreateRequest) *RegionInstanceGroupManagersRecreateInstancesCall {
- c := &RegionInstanceGroupManagersRecreateInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.instanceGroupManager = instanceGroupManager
- c.regioninstancegroupmanagersrecreaterequest = regioninstancegroupmanagersrecreaterequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionInstanceGroupManagersRecreateInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersRecreateInstancesCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionInstanceGroupManagersRecreateInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersRecreateInstancesCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionInstanceGroupManagersRecreateInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersRecreateInstancesCall {
- 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 *RegionInstanceGroupManagersRecreateInstancesCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionInstanceGroupManagersRecreateInstancesCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersrecreaterequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "instanceGroupManager": c.instanceGroupManager,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionInstanceGroupManagers.recreateInstances" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionInstanceGroupManagersRecreateInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Flags the specified VM instances in the managed instance group to be immediately recreated. Each instance is recreated using the group's current configuration. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of each instance by checking its currentAction field; for more information, see Checking the status of managed instances. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request.",
- // "flatPath": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances",
- // "httpMethod": "POST",
- // "id": "compute.regionInstanceGroupManagers.recreateInstances",
- // "parameterOrder": [
- // "project",
- // "region",
- // "instanceGroupManager"
- // ],
- // "parameters": {
- // "instanceGroupManager": {
- // "description": "Name of the managed instance group.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances",
- // "request": {
- // "$ref": "RegionInstanceGroupManagersRecreateRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionInstanceGroupManagers.resize":
-
-type RegionInstanceGroupManagersResizeCall struct {
- s *Service
- project string
- region string
- instanceGroupManager string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Resize: Changes the intended size of the managed instance group. If
-// you increase the size, the group creates new instances using the
-// current instance template. If you decrease the size, the group
-// deletes one or more instances. The resize operation is marked DONE if
-// the resize request is successful. The underlying actions take
-// additional time. You must separately verify the status of the
-// creating or deleting actions with the listmanagedinstances method. If
-// the group is part of a backend service that has enabled connection
-// draining, it can take up to 60 seconds after the connection draining
-// duration has elapsed before the VM instance is removed or deleted.
-//
-// - instanceGroupManager: Name of the managed instance group.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-// - size: Number of instances that should exist in this instance group
-// manager.
-func (r *RegionInstanceGroupManagersService) Resize(project string, region string, instanceGroupManager string, size int64) *RegionInstanceGroupManagersResizeCall {
- c := &RegionInstanceGroupManagersResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.instanceGroupManager = instanceGroupManager
- c.urlParams_.Set("size", fmt.Sprint(size))
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionInstanceGroupManagersResizeCall) RequestId(requestId string) *RegionInstanceGroupManagersResizeCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionInstanceGroupManagersResizeCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersResizeCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionInstanceGroupManagersResizeCall) Context(ctx context.Context) *RegionInstanceGroupManagersResizeCall {
- 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 *RegionInstanceGroupManagersResizeCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionInstanceGroupManagersResizeCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "instanceGroupManager": c.instanceGroupManager,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionInstanceGroupManagers.resize" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionInstanceGroupManagersResizeCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Changes the intended size of the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes one or more instances. The resize operation is marked DONE if the resize request is successful. The underlying actions take additional time. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.",
- // "flatPath": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize",
- // "httpMethod": "POST",
- // "id": "compute.regionInstanceGroupManagers.resize",
- // "parameterOrder": [
- // "project",
- // "region",
- // "instanceGroupManager",
- // "size"
- // ],
- // "parameters": {
- // "instanceGroupManager": {
- // "description": "Name of the managed instance group.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "size": {
- // "description": "Number of instances that should exist in this instance group manager.",
- // "format": "int32",
- // "location": "query",
- // "minimum": "0",
- // "required": true,
- // "type": "integer"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionInstanceGroupManagers.setInstanceTemplate":
-
-type RegionInstanceGroupManagersSetInstanceTemplateCall struct {
- s *Service
- project string
- region string
- instanceGroupManager string
- regioninstancegroupmanagerssettemplaterequest *RegionInstanceGroupManagersSetTemplateRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetInstanceTemplate: Sets the instance template to use when creating
-// new instances or recreating instances in this group. Existing
-// instances are not affected.
-//
-// - instanceGroupManager: The name of the managed instance group.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionInstanceGroupManagersService) SetInstanceTemplate(project string, region string, instanceGroupManager string, regioninstancegroupmanagerssettemplaterequest *RegionInstanceGroupManagersSetTemplateRequest) *RegionInstanceGroupManagersSetInstanceTemplateCall {
- c := &RegionInstanceGroupManagersSetInstanceTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.instanceGroupManager = instanceGroupManager
- c.regioninstancegroupmanagerssettemplaterequest = regioninstancegroupmanagerssettemplaterequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) RequestId(requestId string) *RegionInstanceGroupManagersSetInstanceTemplateCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionInstanceGroupManagersSetInstanceTemplateCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersSetInstanceTemplateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionInstanceGroupManagersSetInstanceTemplateCall) Context(ctx context.Context) *RegionInstanceGroupManagersSetInstanceTemplateCall {
- 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 *RegionInstanceGroupManagersSetInstanceTemplateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssettemplaterequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "instanceGroupManager": c.instanceGroupManager,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionInstanceGroupManagers.setInstanceTemplate" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionInstanceGroupManagersSetInstanceTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected.",
- // "flatPath": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate",
- // "httpMethod": "POST",
- // "id": "compute.regionInstanceGroupManagers.setInstanceTemplate",
- // "parameterOrder": [
- // "project",
- // "region",
- // "instanceGroupManager"
- // ],
- // "parameters": {
- // "instanceGroupManager": {
- // "description": "The name of the managed instance group.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate",
- // "request": {
- // "$ref": "RegionInstanceGroupManagersSetTemplateRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionInstanceGroupManagers.setTargetPools":
-
-type RegionInstanceGroupManagersSetTargetPoolsCall struct {
- s *Service
- project string
- region string
- instanceGroupManager string
- regioninstancegroupmanagerssettargetpoolsrequest *RegionInstanceGroupManagersSetTargetPoolsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetTargetPools: Modifies the target pools to which all new instances
-// in this group are assigned. Existing instances in the group are not
-// affected.
-//
-// - instanceGroupManager: Name of the managed instance group.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionInstanceGroupManagersService) SetTargetPools(project string, region string, instanceGroupManager string, regioninstancegroupmanagerssettargetpoolsrequest *RegionInstanceGroupManagersSetTargetPoolsRequest) *RegionInstanceGroupManagersSetTargetPoolsCall {
- c := &RegionInstanceGroupManagersSetTargetPoolsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.instanceGroupManager = instanceGroupManager
- c.regioninstancegroupmanagerssettargetpoolsrequest = regioninstancegroupmanagerssettargetpoolsrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionInstanceGroupManagersSetTargetPoolsCall) RequestId(requestId string) *RegionInstanceGroupManagersSetTargetPoolsCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionInstanceGroupManagersSetTargetPoolsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersSetTargetPoolsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionInstanceGroupManagersSetTargetPoolsCall) Context(ctx context.Context) *RegionInstanceGroupManagersSetTargetPoolsCall {
- 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 *RegionInstanceGroupManagersSetTargetPoolsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionInstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssettargetpoolsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "instanceGroupManager": c.instanceGroupManager,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionInstanceGroupManagers.setTargetPools" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionInstanceGroupManagersSetTargetPoolsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected.",
- // "flatPath": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools",
- // "httpMethod": "POST",
- // "id": "compute.regionInstanceGroupManagers.setTargetPools",
- // "parameterOrder": [
- // "project",
- // "region",
- // "instanceGroupManager"
- // ],
- // "parameters": {
- // "instanceGroupManager": {
- // "description": "Name of the managed instance group.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools",
- // "request": {
- // "$ref": "RegionInstanceGroupManagersSetTargetPoolsRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionInstanceGroupManagers.updatePerInstanceConfigs":
-
-type RegionInstanceGroupManagersUpdatePerInstanceConfigsCall struct {
- s *Service
- project string
- region string
- instanceGroupManager string
- regioninstancegroupmanagerupdateinstanceconfigreq *RegionInstanceGroupManagerUpdateInstanceConfigReq
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// UpdatePerInstanceConfigs: Inserts or updates per-instance
-// configurations for the managed instance group. perInstanceConfig.name
-// serves as a key used to distinguish whether to perform insert or
-// patch.
-//
-// - instanceGroupManager: The name of the managed instance group. It
-// should conform to RFC1035.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request, should conform to
-// RFC1035.
-func (r *RegionInstanceGroupManagersService) UpdatePerInstanceConfigs(project string, region string, instanceGroupManager string, regioninstancegroupmanagerupdateinstanceconfigreq *RegionInstanceGroupManagerUpdateInstanceConfigReq) *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall {
- c := &RegionInstanceGroupManagersUpdatePerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.instanceGroupManager = instanceGroupManager
- c.regioninstancegroupmanagerupdateinstanceconfigreq = regioninstancegroupmanagerupdateinstanceconfigreq
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall) RequestId(requestId string) *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall) Context(ctx context.Context) *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall {
- 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 *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerupdateinstanceconfigreq)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/updatePerInstanceConfigs")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "instanceGroupManager": c.instanceGroupManager,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionInstanceGroupManagers.updatePerInstanceConfigs" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Inserts or updates per-instance configurations for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch.",
- // "flatPath": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/updatePerInstanceConfigs",
- // "httpMethod": "POST",
- // "id": "compute.regionInstanceGroupManagers.updatePerInstanceConfigs",
- // "parameterOrder": [
- // "project",
- // "region",
- // "instanceGroupManager"
- // ],
- // "parameters": {
- // "instanceGroupManager": {
- // "description": "The name of the managed instance group. It should conform to RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request, should conform to RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/updatePerInstanceConfigs",
- // "request": {
- // "$ref": "RegionInstanceGroupManagerUpdateInstanceConfigReq"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionInstanceGroups.get":
-
-type RegionInstanceGroupsGetCall struct {
- s *Service
- project string
- region string
- instanceGroup string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified instance group resource.
-//
-// - instanceGroup: Name of the instance group resource to return.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionInstanceGroupsService) Get(project string, region string, instanceGroup string) *RegionInstanceGroupsGetCall {
- c := &RegionInstanceGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.instanceGroup = instanceGroup
- 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 *RegionInstanceGroupsGetCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsGetCall {
- 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 *RegionInstanceGroupsGetCall) IfNoneMatch(entityTag string) *RegionInstanceGroupsGetCall {
- 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 *RegionInstanceGroupsGetCall) Context(ctx context.Context) *RegionInstanceGroupsGetCall {
- 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 *RegionInstanceGroupsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionInstanceGroupsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/instanceGroups/{instanceGroup}")
- 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{
- "project": c.project,
- "region": c.region,
- "instanceGroup": c.instanceGroup,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionInstanceGroups.get" call.
-// Exactly one of *InstanceGroup or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *InstanceGroup.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 *RegionInstanceGroupsGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroup, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &InstanceGroup{
- 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": "Returns the specified instance group resource.",
- // "flatPath": "projects/{project}/regions/{region}/instanceGroups/{instanceGroup}",
- // "httpMethod": "GET",
- // "id": "compute.regionInstanceGroups.get",
- // "parameterOrder": [
- // "project",
- // "region",
- // "instanceGroup"
- // ],
- // "parameters": {
- // "instanceGroup": {
- // "description": "Name of the instance group resource to return.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/instanceGroups/{instanceGroup}",
- // "response": {
- // "$ref": "InstanceGroup"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.regionInstanceGroups.list":
-
-type RegionInstanceGroupsListCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves the list of instance group resources contained within
-// the specified region.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionInstanceGroupsService) List(project string, region string) *RegionInstanceGroupsListCall {
- c := &RegionInstanceGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *RegionInstanceGroupsListCall) Filter(filter string) *RegionInstanceGroupsListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *RegionInstanceGroupsListCall) MaxResults(maxResults int64) *RegionInstanceGroupsListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *RegionInstanceGroupsListCall) OrderBy(orderBy string) *RegionInstanceGroupsListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *RegionInstanceGroupsListCall) PageToken(pageToken string) *RegionInstanceGroupsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *RegionInstanceGroupsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionInstanceGroupsListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *RegionInstanceGroupsListCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsListCall {
- 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 *RegionInstanceGroupsListCall) IfNoneMatch(entityTag string) *RegionInstanceGroupsListCall {
- 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 *RegionInstanceGroupsListCall) Context(ctx context.Context) *RegionInstanceGroupsListCall {
- 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 *RegionInstanceGroupsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionInstanceGroupsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/instanceGroups")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionInstanceGroups.list" call.
-// Exactly one of *RegionInstanceGroupList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *RegionInstanceGroupList.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 *RegionInstanceGroupsListCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &RegionInstanceGroupList{
- 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": "Retrieves the list of instance group resources contained within the specified region.",
- // "flatPath": "projects/{project}/regions/{region}/instanceGroups",
- // "httpMethod": "GET",
- // "id": "compute.regionInstanceGroups.list",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/instanceGroups",
- // "response": {
- // "$ref": "RegionInstanceGroupList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *RegionInstanceGroupsListCall) Pages(ctx context.Context, f func(*RegionInstanceGroupList) 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 "compute.regionInstanceGroups.listInstances":
-
-type RegionInstanceGroupsListInstancesCall struct {
- s *Service
- project string
- region string
- instanceGroup string
- regioninstancegroupslistinstancesrequest *RegionInstanceGroupsListInstancesRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// ListInstances: Lists the instances in the specified instance group
-// and displays information about the named ports. Depending on the
-// specified options, this method can list all instances or only the
-// instances that are running. The orderBy query parameter is not
-// supported.
-//
-// - instanceGroup: Name of the regional instance group for which we
-// want to list the instances.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionInstanceGroupsService) ListInstances(project string, region string, instanceGroup string, regioninstancegroupslistinstancesrequest *RegionInstanceGroupsListInstancesRequest) *RegionInstanceGroupsListInstancesCall {
- c := &RegionInstanceGroupsListInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.instanceGroup = instanceGroup
- c.regioninstancegroupslistinstancesrequest = regioninstancegroupslistinstancesrequest
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *RegionInstanceGroupsListInstancesCall) Filter(filter string) *RegionInstanceGroupsListInstancesCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *RegionInstanceGroupsListInstancesCall) MaxResults(maxResults int64) *RegionInstanceGroupsListInstancesCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *RegionInstanceGroupsListInstancesCall) OrderBy(orderBy string) *RegionInstanceGroupsListInstancesCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *RegionInstanceGroupsListInstancesCall) PageToken(pageToken string) *RegionInstanceGroupsListInstancesCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *RegionInstanceGroupsListInstancesCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionInstanceGroupsListInstancesCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *RegionInstanceGroupsListInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsListInstancesCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionInstanceGroupsListInstancesCall) Context(ctx context.Context) *RegionInstanceGroupsListInstancesCall {
- 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 *RegionInstanceGroupsListInstancesCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionInstanceGroupsListInstancesCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupslistinstancesrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "instanceGroup": c.instanceGroup,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionInstanceGroups.listInstances" call.
-// Exactly one of *RegionInstanceGroupsListInstances or error will be
-// non-nil. Any non-2xx status code is an error. Response headers are in
-// either *RegionInstanceGroupsListInstances.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 *RegionInstanceGroupsListInstancesCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupsListInstances, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &RegionInstanceGroupsListInstances{
- 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": "Lists the instances in the specified instance group and displays information about the named ports. Depending on the specified options, this method can list all instances or only the instances that are running. The orderBy query parameter is not supported.",
- // "flatPath": "projects/{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances",
- // "httpMethod": "POST",
- // "id": "compute.regionInstanceGroups.listInstances",
- // "parameterOrder": [
- // "project",
- // "region",
- // "instanceGroup"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "instanceGroup": {
- // "description": "Name of the regional instance group for which we want to list the instances.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances",
- // "request": {
- // "$ref": "RegionInstanceGroupsListInstancesRequest"
- // },
- // "response": {
- // "$ref": "RegionInstanceGroupsListInstances"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *RegionInstanceGroupsListInstancesCall) Pages(ctx context.Context, f func(*RegionInstanceGroupsListInstances) 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 "compute.regionInstanceGroups.setNamedPorts":
-
-type RegionInstanceGroupsSetNamedPortsCall struct {
- s *Service
- project string
- region string
- instanceGroup string
- regioninstancegroupssetnamedportsrequest *RegionInstanceGroupsSetNamedPortsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetNamedPorts: Sets the named ports for the specified regional
-// instance group.
-//
-// - instanceGroup: The name of the regional instance group where the
-// named ports are updated.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionInstanceGroupsService) SetNamedPorts(project string, region string, instanceGroup string, regioninstancegroupssetnamedportsrequest *RegionInstanceGroupsSetNamedPortsRequest) *RegionInstanceGroupsSetNamedPortsCall {
- c := &RegionInstanceGroupsSetNamedPortsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.instanceGroup = instanceGroup
- c.regioninstancegroupssetnamedportsrequest = regioninstancegroupssetnamedportsrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionInstanceGroupsSetNamedPortsCall) RequestId(requestId string) *RegionInstanceGroupsSetNamedPortsCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionInstanceGroupsSetNamedPortsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsSetNamedPortsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionInstanceGroupsSetNamedPortsCall) Context(ctx context.Context) *RegionInstanceGroupsSetNamedPortsCall {
- 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 *RegionInstanceGroupsSetNamedPortsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionInstanceGroupsSetNamedPortsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupssetnamedportsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "instanceGroup": c.instanceGroup,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionInstanceGroups.setNamedPorts" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionInstanceGroupsSetNamedPortsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Sets the named ports for the specified regional instance group.",
- // "flatPath": "projects/{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts",
- // "httpMethod": "POST",
- // "id": "compute.regionInstanceGroups.setNamedPorts",
- // "parameterOrder": [
- // "project",
- // "region",
- // "instanceGroup"
- // ],
- // "parameters": {
- // "instanceGroup": {
- // "description": "The name of the regional instance group where the named ports are updated.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts",
- // "request": {
- // "$ref": "RegionInstanceGroupsSetNamedPortsRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionInstanceTemplates.delete":
-
-type RegionInstanceTemplatesDeleteCall struct {
- s *Service
- project string
- region string
- instanceTemplate string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified instance template. Deleting an instance
-// template is permanent and cannot be undone.
-//
-// - instanceTemplate: The name of the instance template to delete.
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-func (r *RegionInstanceTemplatesService) Delete(project string, region string, instanceTemplate string) *RegionInstanceTemplatesDeleteCall {
- c := &RegionInstanceTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.instanceTemplate = instanceTemplate
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionInstanceTemplatesDeleteCall) RequestId(requestId string) *RegionInstanceTemplatesDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionInstanceTemplatesDeleteCall) Fields(s ...googleapi.Field) *RegionInstanceTemplatesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionInstanceTemplatesDeleteCall) Context(ctx context.Context) *RegionInstanceTemplatesDeleteCall {
- 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 *RegionInstanceTemplatesDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionInstanceTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceTemplates/{instanceTemplate}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "instanceTemplate": c.instanceTemplate,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionInstanceTemplates.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionInstanceTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone.",
- // "flatPath": "projects/{project}/regions/{region}/instanceTemplates/{instanceTemplate}",
- // "httpMethod": "DELETE",
- // "id": "compute.regionInstanceTemplates.delete",
- // "parameterOrder": [
- // "project",
- // "region",
- // "instanceTemplate"
- // ],
- // "parameters": {
- // "instanceTemplate": {
- // "description": "The name of the instance template to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/instanceTemplates/{instanceTemplate}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionInstanceTemplates.get":
-
-type RegionInstanceTemplatesGetCall struct {
- s *Service
- project string
- region string
- instanceTemplate string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified instance template.
-//
-// - instanceTemplate: The name of the instance template.
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-func (r *RegionInstanceTemplatesService) Get(project string, region string, instanceTemplate string) *RegionInstanceTemplatesGetCall {
- c := &RegionInstanceTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.instanceTemplate = instanceTemplate
- 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 *RegionInstanceTemplatesGetCall) Fields(s ...googleapi.Field) *RegionInstanceTemplatesGetCall {
- 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 *RegionInstanceTemplatesGetCall) IfNoneMatch(entityTag string) *RegionInstanceTemplatesGetCall {
- 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 *RegionInstanceTemplatesGetCall) Context(ctx context.Context) *RegionInstanceTemplatesGetCall {
- 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 *RegionInstanceTemplatesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionInstanceTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/instanceTemplates/{instanceTemplate}")
- 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{
- "project": c.project,
- "region": c.region,
- "instanceTemplate": c.instanceTemplate,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionInstanceTemplates.get" call.
-// Exactly one of *InstanceTemplate or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *InstanceTemplate.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 *RegionInstanceTemplatesGetCall) Do(opts ...googleapi.CallOption) (*InstanceTemplate, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &InstanceTemplate{
- 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": "Returns the specified instance template.",
- // "flatPath": "projects/{project}/regions/{region}/instanceTemplates/{instanceTemplate}",
- // "httpMethod": "GET",
- // "id": "compute.regionInstanceTemplates.get",
- // "parameterOrder": [
- // "project",
- // "region",
- // "instanceTemplate"
- // ],
- // "parameters": {
- // "instanceTemplate": {
- // "description": "The name of the instance template.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/instanceTemplates/{instanceTemplate}",
- // "response": {
- // "$ref": "InstanceTemplate"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.regionInstanceTemplates.insert":
-
-type RegionInstanceTemplatesInsertCall struct {
- s *Service
- project string
- region string
- instancetemplate *InstanceTemplate
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates an instance template in the specified project and
-// region using the global instance template whose URL is included in
-// the request.
-//
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-func (r *RegionInstanceTemplatesService) Insert(project string, region string, instancetemplate *InstanceTemplate) *RegionInstanceTemplatesInsertCall {
- c := &RegionInstanceTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.instancetemplate = instancetemplate
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionInstanceTemplatesInsertCall) RequestId(requestId string) *RegionInstanceTemplatesInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionInstanceTemplatesInsertCall) Fields(s ...googleapi.Field) *RegionInstanceTemplatesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionInstanceTemplatesInsertCall) Context(ctx context.Context) *RegionInstanceTemplatesInsertCall {
- 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 *RegionInstanceTemplatesInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionInstanceTemplatesInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancetemplate)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceTemplates")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionInstanceTemplates.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionInstanceTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates an instance template in the specified project and region using the global instance template whose URL is included in the request.",
- // "flatPath": "projects/{project}/regions/{region}/instanceTemplates",
- // "httpMethod": "POST",
- // "id": "compute.regionInstanceTemplates.insert",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/instanceTemplates",
- // "request": {
- // "$ref": "InstanceTemplate"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionInstanceTemplates.list":
-
-type RegionInstanceTemplatesListCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves a list of instance templates that are contained
-// within the specified project and region.
-//
-// - project: Project ID for this request.
-// - region: The name of the regions for this request.
-func (r *RegionInstanceTemplatesService) List(project string, region string) *RegionInstanceTemplatesListCall {
- c := &RegionInstanceTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *RegionInstanceTemplatesListCall) Filter(filter string) *RegionInstanceTemplatesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *RegionInstanceTemplatesListCall) MaxResults(maxResults int64) *RegionInstanceTemplatesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *RegionInstanceTemplatesListCall) OrderBy(orderBy string) *RegionInstanceTemplatesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *RegionInstanceTemplatesListCall) PageToken(pageToken string) *RegionInstanceTemplatesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *RegionInstanceTemplatesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionInstanceTemplatesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *RegionInstanceTemplatesListCall) Fields(s ...googleapi.Field) *RegionInstanceTemplatesListCall {
- 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 *RegionInstanceTemplatesListCall) IfNoneMatch(entityTag string) *RegionInstanceTemplatesListCall {
- 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 *RegionInstanceTemplatesListCall) Context(ctx context.Context) *RegionInstanceTemplatesListCall {
- 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 *RegionInstanceTemplatesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionInstanceTemplatesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/instanceTemplates")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionInstanceTemplates.list" call.
-// Exactly one of *InstanceTemplateList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *InstanceTemplateList.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 *RegionInstanceTemplatesListCall) Do(opts ...googleapi.CallOption) (*InstanceTemplateList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &InstanceTemplateList{
- 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": "Retrieves a list of instance templates that are contained within the specified project and region.",
- // "flatPath": "projects/{project}/regions/{region}/instanceTemplates",
- // "httpMethod": "GET",
- // "id": "compute.regionInstanceTemplates.list",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the regions for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/instanceTemplates",
- // "response": {
- // "$ref": "InstanceTemplateList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *RegionInstanceTemplatesListCall) Pages(ctx context.Context, f func(*InstanceTemplateList) 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 "compute.regionInstances.bulkInsert":
-
-type RegionInstancesBulkInsertCall struct {
- s *Service
- project string
- region string
- bulkinsertinstanceresource *BulkInsertInstanceResource
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// BulkInsert: Creates multiple instances in a given region. Count
-// specifies the number of instances to create.
-//
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-func (r *RegionInstancesService) BulkInsert(project string, region string, bulkinsertinstanceresource *BulkInsertInstanceResource) *RegionInstancesBulkInsertCall {
- c := &RegionInstancesBulkInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.bulkinsertinstanceresource = bulkinsertinstanceresource
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionInstancesBulkInsertCall) RequestId(requestId string) *RegionInstancesBulkInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionInstancesBulkInsertCall) Fields(s ...googleapi.Field) *RegionInstancesBulkInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionInstancesBulkInsertCall) Context(ctx context.Context) *RegionInstancesBulkInsertCall {
- 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 *RegionInstancesBulkInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionInstancesBulkInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkinsertinstanceresource)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instances/bulkInsert")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionInstances.bulkInsert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionInstancesBulkInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates multiple instances in a given region. Count specifies the number of instances to create.",
- // "flatPath": "projects/{project}/regions/{region}/instances/bulkInsert",
- // "httpMethod": "POST",
- // "id": "compute.regionInstances.bulkInsert",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/instances/bulkInsert",
- // "request": {
- // "$ref": "BulkInsertInstanceResource"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionNetworkEndpointGroups.attachNetworkEndpoints":
-
-type RegionNetworkEndpointGroupsAttachNetworkEndpointsCall struct {
- s *Service
- project string
- region string
- networkEndpointGroup string
- regionnetworkendpointgroupsattachendpointsrequest *RegionNetworkEndpointGroupsAttachEndpointsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// AttachNetworkEndpoints: Attach a list of network endpoints to the
-// specified network endpoint group.
-//
-// - networkEndpointGroup: The name of the network endpoint group where
-// you are attaching network endpoints to. It should comply with
-// RFC1035.
-// - project: Project ID for this request.
-// - region: The name of the region where you want to create the network
-// endpoint group. It should comply with RFC1035.
-func (r *RegionNetworkEndpointGroupsService) AttachNetworkEndpoints(project string, region string, networkEndpointGroup string, regionnetworkendpointgroupsattachendpointsrequest *RegionNetworkEndpointGroupsAttachEndpointsRequest) *RegionNetworkEndpointGroupsAttachNetworkEndpointsCall {
- c := &RegionNetworkEndpointGroupsAttachNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.networkEndpointGroup = networkEndpointGroup
- c.regionnetworkendpointgroupsattachendpointsrequest = regionnetworkendpointgroupsattachendpointsrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionNetworkEndpointGroupsAttachNetworkEndpointsCall) RequestId(requestId string) *RegionNetworkEndpointGroupsAttachNetworkEndpointsCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionNetworkEndpointGroupsAttachNetworkEndpointsCall) Fields(s ...googleapi.Field) *RegionNetworkEndpointGroupsAttachNetworkEndpointsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionNetworkEndpointGroupsAttachNetworkEndpointsCall) Context(ctx context.Context) *RegionNetworkEndpointGroupsAttachNetworkEndpointsCall {
- 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 *RegionNetworkEndpointGroupsAttachNetworkEndpointsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionNetworkEndpointGroupsAttachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionnetworkendpointgroupsattachendpointsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkEndpointGroups/{networkEndpointGroup}/attachNetworkEndpoints")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "networkEndpointGroup": c.networkEndpointGroup,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionNetworkEndpointGroups.attachNetworkEndpoints" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionNetworkEndpointGroupsAttachNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Attach a list of network endpoints to the specified network endpoint group.",
- // "flatPath": "projects/{project}/regions/{region}/networkEndpointGroups/{networkEndpointGroup}/attachNetworkEndpoints",
- // "httpMethod": "POST",
- // "id": "compute.regionNetworkEndpointGroups.attachNetworkEndpoints",
- // "parameterOrder": [
- // "project",
- // "region",
- // "networkEndpointGroup"
- // ],
- // "parameters": {
- // "networkEndpointGroup": {
- // "description": "The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region where you want to create the network endpoint group. It should comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/networkEndpointGroups/{networkEndpointGroup}/attachNetworkEndpoints",
- // "request": {
- // "$ref": "RegionNetworkEndpointGroupsAttachEndpointsRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionNetworkEndpointGroups.delete":
-
-type RegionNetworkEndpointGroupsDeleteCall struct {
- s *Service
- project string
- region string
- networkEndpointGroup string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified network endpoint group. Note that the
-// NEG cannot be deleted if it is configured as a backend of a backend
-// service.
-//
-// - networkEndpointGroup: The name of the network endpoint group to
-// delete. It should comply with RFC1035.
-// - project: Project ID for this request.
-// - region: The name of the region where the network endpoint group is
-// located. It should comply with RFC1035.
-func (r *RegionNetworkEndpointGroupsService) Delete(project string, region string, networkEndpointGroup string) *RegionNetworkEndpointGroupsDeleteCall {
- c := &RegionNetworkEndpointGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.networkEndpointGroup = networkEndpointGroup
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionNetworkEndpointGroupsDeleteCall) RequestId(requestId string) *RegionNetworkEndpointGroupsDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionNetworkEndpointGroupsDeleteCall) Fields(s ...googleapi.Field) *RegionNetworkEndpointGroupsDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionNetworkEndpointGroupsDeleteCall) Context(ctx context.Context) *RegionNetworkEndpointGroupsDeleteCall {
- 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 *RegionNetworkEndpointGroupsDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionNetworkEndpointGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkEndpointGroups/{networkEndpointGroup}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "networkEndpointGroup": c.networkEndpointGroup,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionNetworkEndpointGroups.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionNetworkEndpointGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified network endpoint group. Note that the NEG cannot be deleted if it is configured as a backend of a backend service.",
- // "flatPath": "projects/{project}/regions/{region}/networkEndpointGroups/{networkEndpointGroup}",
- // "httpMethod": "DELETE",
- // "id": "compute.regionNetworkEndpointGroups.delete",
- // "parameterOrder": [
- // "project",
- // "region",
- // "networkEndpointGroup"
- // ],
- // "parameters": {
- // "networkEndpointGroup": {
- // "description": "The name of the network endpoint group to delete. It should comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region where the network endpoint group is located. It should comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/networkEndpointGroups/{networkEndpointGroup}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionNetworkEndpointGroups.detachNetworkEndpoints":
-
-type RegionNetworkEndpointGroupsDetachNetworkEndpointsCall struct {
- s *Service
- project string
- region string
- networkEndpointGroup string
- regionnetworkendpointgroupsdetachendpointsrequest *RegionNetworkEndpointGroupsDetachEndpointsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// DetachNetworkEndpoints: Detach the network endpoint from the
-// specified network endpoint group.
-//
-// - networkEndpointGroup: The name of the network endpoint group you
-// are detaching network endpoints from. It should comply with
-// RFC1035.
-// - project: Project ID for this request.
-// - region: The name of the region where the network endpoint group is
-// located. It should comply with RFC1035.
-func (r *RegionNetworkEndpointGroupsService) DetachNetworkEndpoints(project string, region string, networkEndpointGroup string, regionnetworkendpointgroupsdetachendpointsrequest *RegionNetworkEndpointGroupsDetachEndpointsRequest) *RegionNetworkEndpointGroupsDetachNetworkEndpointsCall {
- c := &RegionNetworkEndpointGroupsDetachNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.networkEndpointGroup = networkEndpointGroup
- c.regionnetworkendpointgroupsdetachendpointsrequest = regionnetworkendpointgroupsdetachendpointsrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000). end_interface:
-// MixerMutationRequestBuilder
-func (c *RegionNetworkEndpointGroupsDetachNetworkEndpointsCall) RequestId(requestId string) *RegionNetworkEndpointGroupsDetachNetworkEndpointsCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionNetworkEndpointGroupsDetachNetworkEndpointsCall) Fields(s ...googleapi.Field) *RegionNetworkEndpointGroupsDetachNetworkEndpointsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionNetworkEndpointGroupsDetachNetworkEndpointsCall) Context(ctx context.Context) *RegionNetworkEndpointGroupsDetachNetworkEndpointsCall {
- 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 *RegionNetworkEndpointGroupsDetachNetworkEndpointsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionNetworkEndpointGroupsDetachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionnetworkendpointgroupsdetachendpointsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkEndpointGroups/{networkEndpointGroup}/detachNetworkEndpoints")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "networkEndpointGroup": c.networkEndpointGroup,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionNetworkEndpointGroups.detachNetworkEndpoints" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionNetworkEndpointGroupsDetachNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Detach the network endpoint from the specified network endpoint group.",
- // "flatPath": "projects/{project}/regions/{region}/networkEndpointGroups/{networkEndpointGroup}/detachNetworkEndpoints",
- // "httpMethod": "POST",
- // "id": "compute.regionNetworkEndpointGroups.detachNetworkEndpoints",
- // "parameterOrder": [
- // "project",
- // "region",
- // "networkEndpointGroup"
- // ],
- // "parameters": {
- // "networkEndpointGroup": {
- // "description": "The name of the network endpoint group you are detaching network endpoints from. It should comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region where the network endpoint group is located. It should comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000). end_interface: MixerMutationRequestBuilder",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/networkEndpointGroups/{networkEndpointGroup}/detachNetworkEndpoints",
- // "request": {
- // "$ref": "RegionNetworkEndpointGroupsDetachEndpointsRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionNetworkEndpointGroups.get":
-
-type RegionNetworkEndpointGroupsGetCall struct {
- s *Service
- project string
- region string
- networkEndpointGroup string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified network endpoint group.
-//
-// - networkEndpointGroup: The name of the network endpoint group. It
-// should comply with RFC1035.
-// - project: Project ID for this request.
-// - region: The name of the region where the network endpoint group is
-// located. It should comply with RFC1035.
-func (r *RegionNetworkEndpointGroupsService) Get(project string, region string, networkEndpointGroup string) *RegionNetworkEndpointGroupsGetCall {
- c := &RegionNetworkEndpointGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.networkEndpointGroup = networkEndpointGroup
- 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 *RegionNetworkEndpointGroupsGetCall) Fields(s ...googleapi.Field) *RegionNetworkEndpointGroupsGetCall {
- 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 *RegionNetworkEndpointGroupsGetCall) IfNoneMatch(entityTag string) *RegionNetworkEndpointGroupsGetCall {
- 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 *RegionNetworkEndpointGroupsGetCall) Context(ctx context.Context) *RegionNetworkEndpointGroupsGetCall {
- 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 *RegionNetworkEndpointGroupsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionNetworkEndpointGroupsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/networkEndpointGroups/{networkEndpointGroup}")
- 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{
- "project": c.project,
- "region": c.region,
- "networkEndpointGroup": c.networkEndpointGroup,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionNetworkEndpointGroups.get" call.
-// Exactly one of *NetworkEndpointGroup or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *NetworkEndpointGroup.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 *RegionNetworkEndpointGroupsGetCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroup, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &NetworkEndpointGroup{
- 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": "Returns the specified network endpoint group.",
- // "flatPath": "projects/{project}/regions/{region}/networkEndpointGroups/{networkEndpointGroup}",
- // "httpMethod": "GET",
- // "id": "compute.regionNetworkEndpointGroups.get",
- // "parameterOrder": [
- // "project",
- // "region",
- // "networkEndpointGroup"
- // ],
- // "parameters": {
- // "networkEndpointGroup": {
- // "description": "The name of the network endpoint group. It should comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region where the network endpoint group is located. It should comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/networkEndpointGroups/{networkEndpointGroup}",
- // "response": {
- // "$ref": "NetworkEndpointGroup"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.regionNetworkEndpointGroups.insert":
-
-type RegionNetworkEndpointGroupsInsertCall struct {
- s *Service
- project string
- region string
- networkendpointgroup *NetworkEndpointGroup
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a network endpoint group in the specified project
-// using the parameters that are included in the request.
-//
-// - project: Project ID for this request.
-// - region: The name of the region where you want to create the network
-// endpoint group. It should comply with RFC1035.
-func (r *RegionNetworkEndpointGroupsService) Insert(project string, region string, networkendpointgroup *NetworkEndpointGroup) *RegionNetworkEndpointGroupsInsertCall {
- c := &RegionNetworkEndpointGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.networkendpointgroup = networkendpointgroup
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionNetworkEndpointGroupsInsertCall) RequestId(requestId string) *RegionNetworkEndpointGroupsInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionNetworkEndpointGroupsInsertCall) Fields(s ...googleapi.Field) *RegionNetworkEndpointGroupsInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionNetworkEndpointGroupsInsertCall) Context(ctx context.Context) *RegionNetworkEndpointGroupsInsertCall {
- 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 *RegionNetworkEndpointGroupsInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionNetworkEndpointGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroup)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkEndpointGroups")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionNetworkEndpointGroups.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionNetworkEndpointGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a network endpoint group in the specified project using the parameters that are included in the request.",
- // "flatPath": "projects/{project}/regions/{region}/networkEndpointGroups",
- // "httpMethod": "POST",
- // "id": "compute.regionNetworkEndpointGroups.insert",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region where you want to create the network endpoint group. It should comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/networkEndpointGroups",
- // "request": {
- // "$ref": "NetworkEndpointGroup"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionNetworkEndpointGroups.list":
-
-type RegionNetworkEndpointGroupsListCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves the list of regional network endpoint groups
-// available to the specified project in the given region.
-//
-// - project: Project ID for this request.
-// - region: The name of the region where the network endpoint group is
-// located. It should comply with RFC1035.
-func (r *RegionNetworkEndpointGroupsService) List(project string, region string) *RegionNetworkEndpointGroupsListCall {
- c := &RegionNetworkEndpointGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *RegionNetworkEndpointGroupsListCall) Filter(filter string) *RegionNetworkEndpointGroupsListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *RegionNetworkEndpointGroupsListCall) MaxResults(maxResults int64) *RegionNetworkEndpointGroupsListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *RegionNetworkEndpointGroupsListCall) OrderBy(orderBy string) *RegionNetworkEndpointGroupsListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *RegionNetworkEndpointGroupsListCall) PageToken(pageToken string) *RegionNetworkEndpointGroupsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *RegionNetworkEndpointGroupsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionNetworkEndpointGroupsListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *RegionNetworkEndpointGroupsListCall) Fields(s ...googleapi.Field) *RegionNetworkEndpointGroupsListCall {
- 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 *RegionNetworkEndpointGroupsListCall) IfNoneMatch(entityTag string) *RegionNetworkEndpointGroupsListCall {
- 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 *RegionNetworkEndpointGroupsListCall) Context(ctx context.Context) *RegionNetworkEndpointGroupsListCall {
- 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 *RegionNetworkEndpointGroupsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionNetworkEndpointGroupsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/networkEndpointGroups")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionNetworkEndpointGroups.list" call.
-// Exactly one of *NetworkEndpointGroupList or error will be non-nil.
-// Any non-2xx status code is an error. Response headers are in either
-// *NetworkEndpointGroupList.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 *RegionNetworkEndpointGroupsListCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &NetworkEndpointGroupList{
- 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": "Retrieves the list of regional network endpoint groups available to the specified project in the given region.",
- // "flatPath": "projects/{project}/regions/{region}/networkEndpointGroups",
- // "httpMethod": "GET",
- // "id": "compute.regionNetworkEndpointGroups.list",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region where the network endpoint group is located. It should comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/networkEndpointGroups",
- // "response": {
- // "$ref": "NetworkEndpointGroupList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *RegionNetworkEndpointGroupsListCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupList) 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 "compute.regionNetworkEndpointGroups.listNetworkEndpoints":
-
-type RegionNetworkEndpointGroupsListNetworkEndpointsCall struct {
- s *Service
- project string
- region string
- networkEndpointGroup string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// ListNetworkEndpoints: Lists the network endpoints in the specified
-// network endpoint group.
-//
-// - networkEndpointGroup: The name of the network endpoint group from
-// which you want to generate a list of included network endpoints. It
-// should comply with RFC1035.
-// - project: Project ID for this request.
-// - region: The name of the region where the network endpoint group is
-// located. It should comply with RFC1035.
-func (r *RegionNetworkEndpointGroupsService) ListNetworkEndpoints(project string, region string, networkEndpointGroup string) *RegionNetworkEndpointGroupsListNetworkEndpointsCall {
- c := &RegionNetworkEndpointGroupsListNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.networkEndpointGroup = networkEndpointGroup
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *RegionNetworkEndpointGroupsListNetworkEndpointsCall) Filter(filter string) *RegionNetworkEndpointGroupsListNetworkEndpointsCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *RegionNetworkEndpointGroupsListNetworkEndpointsCall) MaxResults(maxResults int64) *RegionNetworkEndpointGroupsListNetworkEndpointsCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *RegionNetworkEndpointGroupsListNetworkEndpointsCall) OrderBy(orderBy string) *RegionNetworkEndpointGroupsListNetworkEndpointsCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *RegionNetworkEndpointGroupsListNetworkEndpointsCall) PageToken(pageToken string) *RegionNetworkEndpointGroupsListNetworkEndpointsCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *RegionNetworkEndpointGroupsListNetworkEndpointsCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionNetworkEndpointGroupsListNetworkEndpointsCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *RegionNetworkEndpointGroupsListNetworkEndpointsCall) Fields(s ...googleapi.Field) *RegionNetworkEndpointGroupsListNetworkEndpointsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionNetworkEndpointGroupsListNetworkEndpointsCall) Context(ctx context.Context) *RegionNetworkEndpointGroupsListNetworkEndpointsCall {
- 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 *RegionNetworkEndpointGroupsListNetworkEndpointsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionNetworkEndpointGroupsListNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkEndpointGroups/{networkEndpointGroup}/listNetworkEndpoints")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "networkEndpointGroup": c.networkEndpointGroup,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionNetworkEndpointGroups.listNetworkEndpoints" call.
-// Exactly one of *NetworkEndpointGroupsListNetworkEndpoints or error
-// will be non-nil. Any non-2xx status code is an error. Response
-// headers are in either
-// *NetworkEndpointGroupsListNetworkEndpoints.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 *RegionNetworkEndpointGroupsListNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupsListNetworkEndpoints, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &NetworkEndpointGroupsListNetworkEndpoints{
- 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": "Lists the network endpoints in the specified network endpoint group.",
- // "flatPath": "projects/{project}/regions/{region}/networkEndpointGroups/{networkEndpointGroup}/listNetworkEndpoints",
- // "httpMethod": "POST",
- // "id": "compute.regionNetworkEndpointGroups.listNetworkEndpoints",
- // "parameterOrder": [
- // "project",
- // "region",
- // "networkEndpointGroup"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "networkEndpointGroup": {
- // "description": "The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region where the network endpoint group is located. It should comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/networkEndpointGroups/{networkEndpointGroup}/listNetworkEndpoints",
- // "response": {
- // "$ref": "NetworkEndpointGroupsListNetworkEndpoints"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *RegionNetworkEndpointGroupsListNetworkEndpointsCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupsListNetworkEndpoints) 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 "compute.regionNetworkFirewallPolicies.addAssociation":
-
-type RegionNetworkFirewallPoliciesAddAssociationCall struct {
- s *Service
- project string
- region string
- firewallPolicy string
- firewallpolicyassociation *FirewallPolicyAssociation
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// AddAssociation: Inserts an association for the specified network
-// firewall policy.
-//
-// - firewallPolicy: Name of the firewall policy to update.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionNetworkFirewallPoliciesService) AddAssociation(project string, region string, firewallPolicy string, firewallpolicyassociation *FirewallPolicyAssociation) *RegionNetworkFirewallPoliciesAddAssociationCall {
- c := &RegionNetworkFirewallPoliciesAddAssociationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.firewallPolicy = firewallPolicy
- c.firewallpolicyassociation = firewallpolicyassociation
- return c
-}
-
-// ReplaceExistingAssociation sets the optional parameter
-// "replaceExistingAssociation": Indicates whether or not to replace it
-// if an association already exists. This is false by default, in which
-// case an error will be returned if an association already exists.
-func (c *RegionNetworkFirewallPoliciesAddAssociationCall) ReplaceExistingAssociation(replaceExistingAssociation bool) *RegionNetworkFirewallPoliciesAddAssociationCall {
- c.urlParams_.Set("replaceExistingAssociation", fmt.Sprint(replaceExistingAssociation))
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionNetworkFirewallPoliciesAddAssociationCall) RequestId(requestId string) *RegionNetworkFirewallPoliciesAddAssociationCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionNetworkFirewallPoliciesAddAssociationCall) Fields(s ...googleapi.Field) *RegionNetworkFirewallPoliciesAddAssociationCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionNetworkFirewallPoliciesAddAssociationCall) Context(ctx context.Context) *RegionNetworkFirewallPoliciesAddAssociationCall {
- 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 *RegionNetworkFirewallPoliciesAddAssociationCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionNetworkFirewallPoliciesAddAssociationCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyassociation)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}/addAssociation")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "firewallPolicy": c.firewallPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionNetworkFirewallPolicies.addAssociation" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionNetworkFirewallPoliciesAddAssociationCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Inserts an association for the specified network firewall policy.",
- // "flatPath": "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}/addAssociation",
- // "httpMethod": "POST",
- // "id": "compute.regionNetworkFirewallPolicies.addAssociation",
- // "parameterOrder": [
- // "project",
- // "region",
- // "firewallPolicy"
- // ],
- // "parameters": {
- // "firewallPolicy": {
- // "description": "Name of the firewall policy to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "replaceExistingAssociation": {
- // "description": "Indicates whether or not to replace it if an association already exists. This is false by default, in which case an error will be returned if an association already exists.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}/addAssociation",
- // "request": {
- // "$ref": "FirewallPolicyAssociation"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionNetworkFirewallPolicies.addRule":
-
-type RegionNetworkFirewallPoliciesAddRuleCall struct {
- s *Service
- project string
- region string
- firewallPolicy string
- firewallpolicyrule *FirewallPolicyRule
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// AddRule: Inserts a rule into a network firewall policy.
-//
-// - firewallPolicy: Name of the firewall policy to update.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionNetworkFirewallPoliciesService) AddRule(project string, region string, firewallPolicy string, firewallpolicyrule *FirewallPolicyRule) *RegionNetworkFirewallPoliciesAddRuleCall {
- c := &RegionNetworkFirewallPoliciesAddRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.firewallPolicy = firewallPolicy
- c.firewallpolicyrule = firewallpolicyrule
- return c
-}
-
-// MaxPriority sets the optional parameter "maxPriority": When
-// rule.priority is not specified, auto choose a unused priority between
-// minPriority and maxPriority>. This field is exclusive with
-// rule.priority.
-func (c *RegionNetworkFirewallPoliciesAddRuleCall) MaxPriority(maxPriority int64) *RegionNetworkFirewallPoliciesAddRuleCall {
- c.urlParams_.Set("maxPriority", fmt.Sprint(maxPriority))
- return c
-}
-
-// MinPriority sets the optional parameter "minPriority": When
-// rule.priority is not specified, auto choose a unused priority between
-// minPriority and maxPriority>. This field is exclusive with
-// rule.priority.
-func (c *RegionNetworkFirewallPoliciesAddRuleCall) MinPriority(minPriority int64) *RegionNetworkFirewallPoliciesAddRuleCall {
- c.urlParams_.Set("minPriority", fmt.Sprint(minPriority))
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionNetworkFirewallPoliciesAddRuleCall) RequestId(requestId string) *RegionNetworkFirewallPoliciesAddRuleCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionNetworkFirewallPoliciesAddRuleCall) Fields(s ...googleapi.Field) *RegionNetworkFirewallPoliciesAddRuleCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionNetworkFirewallPoliciesAddRuleCall) Context(ctx context.Context) *RegionNetworkFirewallPoliciesAddRuleCall {
- 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 *RegionNetworkFirewallPoliciesAddRuleCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionNetworkFirewallPoliciesAddRuleCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyrule)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}/addRule")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "firewallPolicy": c.firewallPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionNetworkFirewallPolicies.addRule" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionNetworkFirewallPoliciesAddRuleCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Inserts a rule into a network firewall policy.",
- // "flatPath": "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}/addRule",
- // "httpMethod": "POST",
- // "id": "compute.regionNetworkFirewallPolicies.addRule",
- // "parameterOrder": [
- // "project",
- // "region",
- // "firewallPolicy"
- // ],
- // "parameters": {
- // "firewallPolicy": {
- // "description": "Name of the firewall policy to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "maxPriority": {
- // "description": "When rule.priority is not specified, auto choose a unused priority between minPriority and maxPriority\u003e. This field is exclusive with rule.priority.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "minPriority": {
- // "description": "When rule.priority is not specified, auto choose a unused priority between minPriority and maxPriority\u003e. This field is exclusive with rule.priority.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}/addRule",
- // "request": {
- // "$ref": "FirewallPolicyRule"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionNetworkFirewallPolicies.cloneRules":
-
-type RegionNetworkFirewallPoliciesCloneRulesCall struct {
- s *Service
- project string
- region string
- firewallPolicy string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// CloneRules: Copies rules to the specified network firewall policy.
-//
-// - firewallPolicy: Name of the firewall policy to update.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionNetworkFirewallPoliciesService) CloneRules(project string, region string, firewallPolicy string) *RegionNetworkFirewallPoliciesCloneRulesCall {
- c := &RegionNetworkFirewallPoliciesCloneRulesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.firewallPolicy = firewallPolicy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionNetworkFirewallPoliciesCloneRulesCall) RequestId(requestId string) *RegionNetworkFirewallPoliciesCloneRulesCall {
- c.urlParams_.Set("requestId", requestId)
- return c
-}
-
-// SourceFirewallPolicy sets the optional parameter
-// "sourceFirewallPolicy": The firewall policy from which to copy rules.
-func (c *RegionNetworkFirewallPoliciesCloneRulesCall) SourceFirewallPolicy(sourceFirewallPolicy string) *RegionNetworkFirewallPoliciesCloneRulesCall {
- c.urlParams_.Set("sourceFirewallPolicy", sourceFirewallPolicy)
- 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 *RegionNetworkFirewallPoliciesCloneRulesCall) Fields(s ...googleapi.Field) *RegionNetworkFirewallPoliciesCloneRulesCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionNetworkFirewallPoliciesCloneRulesCall) Context(ctx context.Context) *RegionNetworkFirewallPoliciesCloneRulesCall {
- 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 *RegionNetworkFirewallPoliciesCloneRulesCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionNetworkFirewallPoliciesCloneRulesCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}/cloneRules")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "firewallPolicy": c.firewallPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionNetworkFirewallPolicies.cloneRules" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionNetworkFirewallPoliciesCloneRulesCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Copies rules to the specified network firewall policy.",
- // "flatPath": "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}/cloneRules",
- // "httpMethod": "POST",
- // "id": "compute.regionNetworkFirewallPolicies.cloneRules",
- // "parameterOrder": [
- // "project",
- // "region",
- // "firewallPolicy"
- // ],
- // "parameters": {
- // "firewallPolicy": {
- // "description": "Name of the firewall policy to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "sourceFirewallPolicy": {
- // "description": "The firewall policy from which to copy rules.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}/cloneRules",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionNetworkFirewallPolicies.delete":
-
-type RegionNetworkFirewallPoliciesDeleteCall struct {
- s *Service
- project string
- region string
- firewallPolicy string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified network firewall policy.
-//
-// - firewallPolicy: Name of the firewall policy to delete.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionNetworkFirewallPoliciesService) Delete(project string, region string, firewallPolicy string) *RegionNetworkFirewallPoliciesDeleteCall {
- c := &RegionNetworkFirewallPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.firewallPolicy = firewallPolicy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionNetworkFirewallPoliciesDeleteCall) RequestId(requestId string) *RegionNetworkFirewallPoliciesDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionNetworkFirewallPoliciesDeleteCall) Fields(s ...googleapi.Field) *RegionNetworkFirewallPoliciesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionNetworkFirewallPoliciesDeleteCall) Context(ctx context.Context) *RegionNetworkFirewallPoliciesDeleteCall {
- 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 *RegionNetworkFirewallPoliciesDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionNetworkFirewallPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "firewallPolicy": c.firewallPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionNetworkFirewallPolicies.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionNetworkFirewallPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified network firewall policy.",
- // "flatPath": "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}",
- // "httpMethod": "DELETE",
- // "id": "compute.regionNetworkFirewallPolicies.delete",
- // "parameterOrder": [
- // "project",
- // "region",
- // "firewallPolicy"
- // ],
- // "parameters": {
- // "firewallPolicy": {
- // "description": "Name of the firewall policy to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionNetworkFirewallPolicies.get":
-
-type RegionNetworkFirewallPoliciesGetCall struct {
- s *Service
- project string
- region string
- firewallPolicy string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified network firewall policy.
-//
-// - firewallPolicy: Name of the firewall policy to get.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionNetworkFirewallPoliciesService) Get(project string, region string, firewallPolicy string) *RegionNetworkFirewallPoliciesGetCall {
- c := &RegionNetworkFirewallPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.firewallPolicy = firewallPolicy
- 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 *RegionNetworkFirewallPoliciesGetCall) Fields(s ...googleapi.Field) *RegionNetworkFirewallPoliciesGetCall {
- 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 *RegionNetworkFirewallPoliciesGetCall) IfNoneMatch(entityTag string) *RegionNetworkFirewallPoliciesGetCall {
- 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 *RegionNetworkFirewallPoliciesGetCall) Context(ctx context.Context) *RegionNetworkFirewallPoliciesGetCall {
- 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 *RegionNetworkFirewallPoliciesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionNetworkFirewallPoliciesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}")
- 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{
- "project": c.project,
- "region": c.region,
- "firewallPolicy": c.firewallPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionNetworkFirewallPolicies.get" call.
-// Exactly one of *FirewallPolicy or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *FirewallPolicy.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 *RegionNetworkFirewallPoliciesGetCall) Do(opts ...googleapi.CallOption) (*FirewallPolicy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &FirewallPolicy{
- 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": "Returns the specified network firewall policy.",
- // "flatPath": "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}",
- // "httpMethod": "GET",
- // "id": "compute.regionNetworkFirewallPolicies.get",
- // "parameterOrder": [
- // "project",
- // "region",
- // "firewallPolicy"
- // ],
- // "parameters": {
- // "firewallPolicy": {
- // "description": "Name of the firewall policy to get.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}",
- // "response": {
- // "$ref": "FirewallPolicy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.regionNetworkFirewallPolicies.getAssociation":
-
-type RegionNetworkFirewallPoliciesGetAssociationCall struct {
- s *Service
- project string
- region string
- firewallPolicy string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetAssociation: Gets an association with the specified name.
-//
-// - firewallPolicy: Name of the firewall policy to which the queried
-// association belongs.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionNetworkFirewallPoliciesService) GetAssociation(project string, region string, firewallPolicy string) *RegionNetworkFirewallPoliciesGetAssociationCall {
- c := &RegionNetworkFirewallPoliciesGetAssociationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.firewallPolicy = firewallPolicy
- return c
-}
-
-// Name sets the optional parameter "name": The name of the association
-// to get from the firewall policy.
-func (c *RegionNetworkFirewallPoliciesGetAssociationCall) Name(name string) *RegionNetworkFirewallPoliciesGetAssociationCall {
- c.urlParams_.Set("name", name)
- 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 *RegionNetworkFirewallPoliciesGetAssociationCall) Fields(s ...googleapi.Field) *RegionNetworkFirewallPoliciesGetAssociationCall {
- 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 *RegionNetworkFirewallPoliciesGetAssociationCall) IfNoneMatch(entityTag string) *RegionNetworkFirewallPoliciesGetAssociationCall {
- 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 *RegionNetworkFirewallPoliciesGetAssociationCall) Context(ctx context.Context) *RegionNetworkFirewallPoliciesGetAssociationCall {
- 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 *RegionNetworkFirewallPoliciesGetAssociationCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionNetworkFirewallPoliciesGetAssociationCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}/getAssociation")
- 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{
- "project": c.project,
- "region": c.region,
- "firewallPolicy": c.firewallPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionNetworkFirewallPolicies.getAssociation" call.
-// Exactly one of *FirewallPolicyAssociation or error will be non-nil.
-// Any non-2xx status code is an error. Response headers are in either
-// *FirewallPolicyAssociation.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 *RegionNetworkFirewallPoliciesGetAssociationCall) Do(opts ...googleapi.CallOption) (*FirewallPolicyAssociation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &FirewallPolicyAssociation{
- 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": "Gets an association with the specified name.",
- // "flatPath": "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}/getAssociation",
- // "httpMethod": "GET",
- // "id": "compute.regionNetworkFirewallPolicies.getAssociation",
- // "parameterOrder": [
- // "project",
- // "region",
- // "firewallPolicy"
- // ],
- // "parameters": {
- // "firewallPolicy": {
- // "description": "Name of the firewall policy to which the queried association belongs.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "name": {
- // "description": "The name of the association to get from the firewall policy.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}/getAssociation",
- // "response": {
- // "$ref": "FirewallPolicyAssociation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.regionNetworkFirewallPolicies.getEffectiveFirewalls":
-
-type RegionNetworkFirewallPoliciesGetEffectiveFirewallsCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetEffectiveFirewalls: Returns the effective firewalls on a given
-// network.
-//
-// - network: Network reference.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionNetworkFirewallPoliciesService) GetEffectiveFirewalls(project string, region string, network string) *RegionNetworkFirewallPoliciesGetEffectiveFirewallsCall {
- c := &RegionNetworkFirewallPoliciesGetEffectiveFirewallsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.urlParams_.Set("network", network)
- 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 *RegionNetworkFirewallPoliciesGetEffectiveFirewallsCall) Fields(s ...googleapi.Field) *RegionNetworkFirewallPoliciesGetEffectiveFirewallsCall {
- 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 *RegionNetworkFirewallPoliciesGetEffectiveFirewallsCall) IfNoneMatch(entityTag string) *RegionNetworkFirewallPoliciesGetEffectiveFirewallsCall {
- 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 *RegionNetworkFirewallPoliciesGetEffectiveFirewallsCall) Context(ctx context.Context) *RegionNetworkFirewallPoliciesGetEffectiveFirewallsCall {
- 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 *RegionNetworkFirewallPoliciesGetEffectiveFirewallsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionNetworkFirewallPoliciesGetEffectiveFirewallsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/firewallPolicies/getEffectiveFirewalls")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionNetworkFirewallPolicies.getEffectiveFirewalls" call.
-// Exactly one of
-// *RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponse or error
-// will be non-nil. Any non-2xx status code is an error. Response
-// headers are in either
-// *RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponse.ServerResp
-// onse.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 *RegionNetworkFirewallPoliciesGetEffectiveFirewallsCall) Do(opts ...googleapi.CallOption) (*RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponse{
- 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": "Returns the effective firewalls on a given network.",
- // "flatPath": "projects/{project}/regions/{region}/firewallPolicies/getEffectiveFirewalls",
- // "httpMethod": "GET",
- // "id": "compute.regionNetworkFirewallPolicies.getEffectiveFirewalls",
- // "parameterOrder": [
- // "project",
- // "region",
- // "network"
- // ],
- // "parameters": {
- // "network": {
- // "description": "Network reference",
- // "location": "query",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/firewallPolicies/getEffectiveFirewalls",
- // "response": {
- // "$ref": "RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.regionNetworkFirewallPolicies.getIamPolicy":
-
-type RegionNetworkFirewallPoliciesGetIamPolicyCall struct {
- s *Service
- project string
- region string
- resource string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetIamPolicy: Gets the access control policy for a resource. May be
-// empty if no such policy or resource exists.
-//
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-// - resource: Name or id of the resource for this request.
-func (r *RegionNetworkFirewallPoliciesService) GetIamPolicy(project string, region string, resource string) *RegionNetworkFirewallPoliciesGetIamPolicyCall {
- c := &RegionNetworkFirewallPoliciesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.resource = resource
- return c
-}
-
-// OptionsRequestedPolicyVersion sets the optional parameter
-// "optionsRequestedPolicyVersion": Requested IAM Policy version.
-func (c *RegionNetworkFirewallPoliciesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *RegionNetworkFirewallPoliciesGetIamPolicyCall {
- c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
- 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 *RegionNetworkFirewallPoliciesGetIamPolicyCall) Fields(s ...googleapi.Field) *RegionNetworkFirewallPoliciesGetIamPolicyCall {
- 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 *RegionNetworkFirewallPoliciesGetIamPolicyCall) IfNoneMatch(entityTag string) *RegionNetworkFirewallPoliciesGetIamPolicyCall {
- 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 *RegionNetworkFirewallPoliciesGetIamPolicyCall) Context(ctx context.Context) *RegionNetworkFirewallPoliciesGetIamPolicyCall {
- 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 *RegionNetworkFirewallPoliciesGetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionNetworkFirewallPoliciesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/firewallPolicies/{resource}/getIamPolicy")
- 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{
- "project": c.project,
- "region": c.region,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionNetworkFirewallPolicies.getIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *RegionNetworkFirewallPoliciesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
- // "flatPath": "projects/{project}/regions/{region}/firewallPolicies/{resource}/getIamPolicy",
- // "httpMethod": "GET",
- // "id": "compute.regionNetworkFirewallPolicies.getIamPolicy",
- // "parameterOrder": [
- // "project",
- // "region",
- // "resource"
- // ],
- // "parameters": {
- // "optionsRequestedPolicyVersion": {
- // "description": "Requested IAM Policy version.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/firewallPolicies/{resource}/getIamPolicy",
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.regionNetworkFirewallPolicies.getRule":
-
-type RegionNetworkFirewallPoliciesGetRuleCall struct {
- s *Service
- project string
- region string
- firewallPolicy string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetRule: Gets a rule of the specified priority.
-//
-// - firewallPolicy: Name of the firewall policy to which the queried
-// rule belongs.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionNetworkFirewallPoliciesService) GetRule(project string, region string, firewallPolicy string) *RegionNetworkFirewallPoliciesGetRuleCall {
- c := &RegionNetworkFirewallPoliciesGetRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.firewallPolicy = firewallPolicy
- return c
-}
-
-// Priority sets the optional parameter "priority": The priority of the
-// rule to get from the firewall policy.
-func (c *RegionNetworkFirewallPoliciesGetRuleCall) Priority(priority int64) *RegionNetworkFirewallPoliciesGetRuleCall {
- c.urlParams_.Set("priority", fmt.Sprint(priority))
- 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 *RegionNetworkFirewallPoliciesGetRuleCall) Fields(s ...googleapi.Field) *RegionNetworkFirewallPoliciesGetRuleCall {
- 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 *RegionNetworkFirewallPoliciesGetRuleCall) IfNoneMatch(entityTag string) *RegionNetworkFirewallPoliciesGetRuleCall {
- 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 *RegionNetworkFirewallPoliciesGetRuleCall) Context(ctx context.Context) *RegionNetworkFirewallPoliciesGetRuleCall {
- 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 *RegionNetworkFirewallPoliciesGetRuleCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionNetworkFirewallPoliciesGetRuleCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}/getRule")
- 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{
- "project": c.project,
- "region": c.region,
- "firewallPolicy": c.firewallPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionNetworkFirewallPolicies.getRule" call.
-// Exactly one of *FirewallPolicyRule or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *FirewallPolicyRule.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 *RegionNetworkFirewallPoliciesGetRuleCall) Do(opts ...googleapi.CallOption) (*FirewallPolicyRule, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &FirewallPolicyRule{
- 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": "Gets a rule of the specified priority.",
- // "flatPath": "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}/getRule",
- // "httpMethod": "GET",
- // "id": "compute.regionNetworkFirewallPolicies.getRule",
- // "parameterOrder": [
- // "project",
- // "region",
- // "firewallPolicy"
- // ],
- // "parameters": {
- // "firewallPolicy": {
- // "description": "Name of the firewall policy to which the queried rule belongs.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "priority": {
- // "description": "The priority of the rule to get from the firewall policy.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}/getRule",
- // "response": {
- // "$ref": "FirewallPolicyRule"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.regionNetworkFirewallPolicies.insert":
-
-type RegionNetworkFirewallPoliciesInsertCall struct {
- s *Service
- project string
- region string
- firewallpolicy *FirewallPolicy
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a new network firewall policy in the specified
-// project and region.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionNetworkFirewallPoliciesService) Insert(project string, region string, firewallpolicy *FirewallPolicy) *RegionNetworkFirewallPoliciesInsertCall {
- c := &RegionNetworkFirewallPoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.firewallpolicy = firewallpolicy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionNetworkFirewallPoliciesInsertCall) RequestId(requestId string) *RegionNetworkFirewallPoliciesInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionNetworkFirewallPoliciesInsertCall) Fields(s ...googleapi.Field) *RegionNetworkFirewallPoliciesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionNetworkFirewallPoliciesInsertCall) Context(ctx context.Context) *RegionNetworkFirewallPoliciesInsertCall {
- 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 *RegionNetworkFirewallPoliciesInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionNetworkFirewallPoliciesInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicy)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionNetworkFirewallPolicies.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionNetworkFirewallPoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a new network firewall policy in the specified project and region.",
- // "flatPath": "projects/{project}/regions/{region}/firewallPolicies",
- // "httpMethod": "POST",
- // "id": "compute.regionNetworkFirewallPolicies.insert",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/firewallPolicies",
- // "request": {
- // "$ref": "FirewallPolicy"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionNetworkFirewallPolicies.list":
-
-type RegionNetworkFirewallPoliciesListCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Lists all the network firewall policies that have been
-// configured for the specified project in the given region.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionNetworkFirewallPoliciesService) List(project string, region string) *RegionNetworkFirewallPoliciesListCall {
- c := &RegionNetworkFirewallPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *RegionNetworkFirewallPoliciesListCall) Filter(filter string) *RegionNetworkFirewallPoliciesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *RegionNetworkFirewallPoliciesListCall) MaxResults(maxResults int64) *RegionNetworkFirewallPoliciesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *RegionNetworkFirewallPoliciesListCall) OrderBy(orderBy string) *RegionNetworkFirewallPoliciesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *RegionNetworkFirewallPoliciesListCall) PageToken(pageToken string) *RegionNetworkFirewallPoliciesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *RegionNetworkFirewallPoliciesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionNetworkFirewallPoliciesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *RegionNetworkFirewallPoliciesListCall) Fields(s ...googleapi.Field) *RegionNetworkFirewallPoliciesListCall {
- 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 *RegionNetworkFirewallPoliciesListCall) IfNoneMatch(entityTag string) *RegionNetworkFirewallPoliciesListCall {
- 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 *RegionNetworkFirewallPoliciesListCall) Context(ctx context.Context) *RegionNetworkFirewallPoliciesListCall {
- 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 *RegionNetworkFirewallPoliciesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionNetworkFirewallPoliciesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/firewallPolicies")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionNetworkFirewallPolicies.list" call.
-// Exactly one of *FirewallPolicyList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *FirewallPolicyList.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 *RegionNetworkFirewallPoliciesListCall) Do(opts ...googleapi.CallOption) (*FirewallPolicyList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &FirewallPolicyList{
- 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": "Lists all the network firewall policies that have been configured for the specified project in the given region.",
- // "flatPath": "projects/{project}/regions/{region}/firewallPolicies",
- // "httpMethod": "GET",
- // "id": "compute.regionNetworkFirewallPolicies.list",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/firewallPolicies",
- // "response": {
- // "$ref": "FirewallPolicyList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *RegionNetworkFirewallPoliciesListCall) Pages(ctx context.Context, f func(*FirewallPolicyList) 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 "compute.regionNetworkFirewallPolicies.patch":
-
-type RegionNetworkFirewallPoliciesPatchCall struct {
- s *Service
- project string
- region string
- firewallPolicy string
- firewallpolicy *FirewallPolicy
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Patches the specified network firewall policy.
-//
-// - firewallPolicy: Name of the firewall policy to update.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionNetworkFirewallPoliciesService) Patch(project string, region string, firewallPolicy string, firewallpolicy *FirewallPolicy) *RegionNetworkFirewallPoliciesPatchCall {
- c := &RegionNetworkFirewallPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.firewallPolicy = firewallPolicy
- c.firewallpolicy = firewallpolicy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionNetworkFirewallPoliciesPatchCall) RequestId(requestId string) *RegionNetworkFirewallPoliciesPatchCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionNetworkFirewallPoliciesPatchCall) Fields(s ...googleapi.Field) *RegionNetworkFirewallPoliciesPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionNetworkFirewallPoliciesPatchCall) Context(ctx context.Context) *RegionNetworkFirewallPoliciesPatchCall {
- 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 *RegionNetworkFirewallPoliciesPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionNetworkFirewallPoliciesPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicy)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "firewallPolicy": c.firewallPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionNetworkFirewallPolicies.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionNetworkFirewallPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Patches the specified network firewall policy.",
- // "flatPath": "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}",
- // "httpMethod": "PATCH",
- // "id": "compute.regionNetworkFirewallPolicies.patch",
- // "parameterOrder": [
- // "project",
- // "region",
- // "firewallPolicy"
- // ],
- // "parameters": {
- // "firewallPolicy": {
- // "description": "Name of the firewall policy to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}",
- // "request": {
- // "$ref": "FirewallPolicy"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionNetworkFirewallPolicies.patchRule":
-
-type RegionNetworkFirewallPoliciesPatchRuleCall struct {
- s *Service
- project string
- region string
- firewallPolicy string
- firewallpolicyrule *FirewallPolicyRule
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// PatchRule: Patches a rule of the specified priority.
-//
-// - firewallPolicy: Name of the firewall policy to update.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionNetworkFirewallPoliciesService) PatchRule(project string, region string, firewallPolicy string, firewallpolicyrule *FirewallPolicyRule) *RegionNetworkFirewallPoliciesPatchRuleCall {
- c := &RegionNetworkFirewallPoliciesPatchRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.firewallPolicy = firewallPolicy
- c.firewallpolicyrule = firewallpolicyrule
- return c
-}
-
-// Priority sets the optional parameter "priority": The priority of the
-// rule to patch.
-func (c *RegionNetworkFirewallPoliciesPatchRuleCall) Priority(priority int64) *RegionNetworkFirewallPoliciesPatchRuleCall {
- c.urlParams_.Set("priority", fmt.Sprint(priority))
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionNetworkFirewallPoliciesPatchRuleCall) RequestId(requestId string) *RegionNetworkFirewallPoliciesPatchRuleCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionNetworkFirewallPoliciesPatchRuleCall) Fields(s ...googleapi.Field) *RegionNetworkFirewallPoliciesPatchRuleCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionNetworkFirewallPoliciesPatchRuleCall) Context(ctx context.Context) *RegionNetworkFirewallPoliciesPatchRuleCall {
- 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 *RegionNetworkFirewallPoliciesPatchRuleCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionNetworkFirewallPoliciesPatchRuleCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyrule)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}/patchRule")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "firewallPolicy": c.firewallPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionNetworkFirewallPolicies.patchRule" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionNetworkFirewallPoliciesPatchRuleCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Patches a rule of the specified priority.",
- // "flatPath": "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}/patchRule",
- // "httpMethod": "POST",
- // "id": "compute.regionNetworkFirewallPolicies.patchRule",
- // "parameterOrder": [
- // "project",
- // "region",
- // "firewallPolicy"
- // ],
- // "parameters": {
- // "firewallPolicy": {
- // "description": "Name of the firewall policy to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "priority": {
- // "description": "The priority of the rule to patch.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}/patchRule",
- // "request": {
- // "$ref": "FirewallPolicyRule"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionNetworkFirewallPolicies.removeAssociation":
-
-type RegionNetworkFirewallPoliciesRemoveAssociationCall struct {
- s *Service
- project string
- region string
- firewallPolicy string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// RemoveAssociation: Removes an association for the specified network
-// firewall policy.
-//
-// - firewallPolicy: Name of the firewall policy to update.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionNetworkFirewallPoliciesService) RemoveAssociation(project string, region string, firewallPolicy string) *RegionNetworkFirewallPoliciesRemoveAssociationCall {
- c := &RegionNetworkFirewallPoliciesRemoveAssociationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.firewallPolicy = firewallPolicy
- return c
-}
-
-// Name sets the optional parameter "name": Name for the association
-// that will be removed.
-func (c *RegionNetworkFirewallPoliciesRemoveAssociationCall) Name(name string) *RegionNetworkFirewallPoliciesRemoveAssociationCall {
- c.urlParams_.Set("name", name)
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionNetworkFirewallPoliciesRemoveAssociationCall) RequestId(requestId string) *RegionNetworkFirewallPoliciesRemoveAssociationCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionNetworkFirewallPoliciesRemoveAssociationCall) Fields(s ...googleapi.Field) *RegionNetworkFirewallPoliciesRemoveAssociationCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionNetworkFirewallPoliciesRemoveAssociationCall) Context(ctx context.Context) *RegionNetworkFirewallPoliciesRemoveAssociationCall {
- 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 *RegionNetworkFirewallPoliciesRemoveAssociationCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionNetworkFirewallPoliciesRemoveAssociationCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}/removeAssociation")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "firewallPolicy": c.firewallPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionNetworkFirewallPolicies.removeAssociation" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionNetworkFirewallPoliciesRemoveAssociationCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Removes an association for the specified network firewall policy.",
- // "flatPath": "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}/removeAssociation",
- // "httpMethod": "POST",
- // "id": "compute.regionNetworkFirewallPolicies.removeAssociation",
- // "parameterOrder": [
- // "project",
- // "region",
- // "firewallPolicy"
- // ],
- // "parameters": {
- // "firewallPolicy": {
- // "description": "Name of the firewall policy to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "name": {
- // "description": "Name for the association that will be removed.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}/removeAssociation",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionNetworkFirewallPolicies.removeRule":
-
-type RegionNetworkFirewallPoliciesRemoveRuleCall struct {
- s *Service
- project string
- region string
- firewallPolicy string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// RemoveRule: Deletes a rule of the specified priority.
-//
-// - firewallPolicy: Name of the firewall policy to update.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionNetworkFirewallPoliciesService) RemoveRule(project string, region string, firewallPolicy string) *RegionNetworkFirewallPoliciesRemoveRuleCall {
- c := &RegionNetworkFirewallPoliciesRemoveRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.firewallPolicy = firewallPolicy
- return c
-}
-
-// Priority sets the optional parameter "priority": The priority of the
-// rule to remove from the firewall policy.
-func (c *RegionNetworkFirewallPoliciesRemoveRuleCall) Priority(priority int64) *RegionNetworkFirewallPoliciesRemoveRuleCall {
- c.urlParams_.Set("priority", fmt.Sprint(priority))
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionNetworkFirewallPoliciesRemoveRuleCall) RequestId(requestId string) *RegionNetworkFirewallPoliciesRemoveRuleCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionNetworkFirewallPoliciesRemoveRuleCall) Fields(s ...googleapi.Field) *RegionNetworkFirewallPoliciesRemoveRuleCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionNetworkFirewallPoliciesRemoveRuleCall) Context(ctx context.Context) *RegionNetworkFirewallPoliciesRemoveRuleCall {
- 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 *RegionNetworkFirewallPoliciesRemoveRuleCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionNetworkFirewallPoliciesRemoveRuleCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}/removeRule")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "firewallPolicy": c.firewallPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionNetworkFirewallPolicies.removeRule" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionNetworkFirewallPoliciesRemoveRuleCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes a rule of the specified priority.",
- // "flatPath": "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}/removeRule",
- // "httpMethod": "POST",
- // "id": "compute.regionNetworkFirewallPolicies.removeRule",
- // "parameterOrder": [
- // "project",
- // "region",
- // "firewallPolicy"
- // ],
- // "parameters": {
- // "firewallPolicy": {
- // "description": "Name of the firewall policy to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "priority": {
- // "description": "The priority of the rule to remove from the firewall policy.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/firewallPolicies/{firewallPolicy}/removeRule",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionNetworkFirewallPolicies.setIamPolicy":
-
-type RegionNetworkFirewallPoliciesSetIamPolicyCall struct {
- s *Service
- project string
- region string
- resource string
- regionsetpolicyrequest *RegionSetPolicyRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetIamPolicy: Sets the access control policy on the specified
-// resource. Replaces any existing policy.
-//
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-// - resource: Name or id of the resource for this request.
-func (r *RegionNetworkFirewallPoliciesService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *RegionNetworkFirewallPoliciesSetIamPolicyCall {
- c := &RegionNetworkFirewallPoliciesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.resource = resource
- c.regionsetpolicyrequest = regionsetpolicyrequest
- 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 *RegionNetworkFirewallPoliciesSetIamPolicyCall) Fields(s ...googleapi.Field) *RegionNetworkFirewallPoliciesSetIamPolicyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionNetworkFirewallPoliciesSetIamPolicyCall) Context(ctx context.Context) *RegionNetworkFirewallPoliciesSetIamPolicyCall {
- 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 *RegionNetworkFirewallPoliciesSetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionNetworkFirewallPoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies/{resource}/setIamPolicy")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionNetworkFirewallPolicies.setIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *RegionNetworkFirewallPoliciesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Sets the access control policy on the specified resource. Replaces any existing policy.",
- // "flatPath": "projects/{project}/regions/{region}/firewallPolicies/{resource}/setIamPolicy",
- // "httpMethod": "POST",
- // "id": "compute.regionNetworkFirewallPolicies.setIamPolicy",
- // "parameterOrder": [
- // "project",
- // "region",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/firewallPolicies/{resource}/setIamPolicy",
- // "request": {
- // "$ref": "RegionSetPolicyRequest"
- // },
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionNetworkFirewallPolicies.testIamPermissions":
-
-type RegionNetworkFirewallPoliciesTestIamPermissionsCall struct {
- s *Service
- project string
- region string
- resource string
- testpermissionsrequest *TestPermissionsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// TestIamPermissions: Returns permissions that a caller has on the
-// specified resource.
-//
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-// - resource: Name or id of the resource for this request.
-func (r *RegionNetworkFirewallPoliciesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionNetworkFirewallPoliciesTestIamPermissionsCall {
- c := &RegionNetworkFirewallPoliciesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.resource = resource
- c.testpermissionsrequest = testpermissionsrequest
- 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 *RegionNetworkFirewallPoliciesTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionNetworkFirewallPoliciesTestIamPermissionsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionNetworkFirewallPoliciesTestIamPermissionsCall) Context(ctx context.Context) *RegionNetworkFirewallPoliciesTestIamPermissionsCall {
- 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 *RegionNetworkFirewallPoliciesTestIamPermissionsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionNetworkFirewallPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/firewallPolicies/{resource}/testIamPermissions")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionNetworkFirewallPolicies.testIamPermissions" call.
-// Exactly one of *TestPermissionsResponse or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *TestPermissionsResponse.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 *RegionNetworkFirewallPoliciesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TestPermissionsResponse{
- 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": "Returns permissions that a caller has on the specified resource.",
- // "flatPath": "projects/{project}/regions/{region}/firewallPolicies/{resource}/testIamPermissions",
- // "httpMethod": "POST",
- // "id": "compute.regionNetworkFirewallPolicies.testIamPermissions",
- // "parameterOrder": [
- // "project",
- // "region",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/firewallPolicies/{resource}/testIamPermissions",
- // "request": {
- // "$ref": "TestPermissionsRequest"
- // },
- // "response": {
- // "$ref": "TestPermissionsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.regionNotificationEndpoints.delete":
-
-type RegionNotificationEndpointsDeleteCall struct {
- s *Service
- project string
- region string
- notificationEndpoint string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified NotificationEndpoint in the given
-// region
-//
-// - notificationEndpoint: Name of the NotificationEndpoint resource to
-// delete.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionNotificationEndpointsService) Delete(project string, region string, notificationEndpoint string) *RegionNotificationEndpointsDeleteCall {
- c := &RegionNotificationEndpointsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.notificationEndpoint = notificationEndpoint
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionNotificationEndpointsDeleteCall) RequestId(requestId string) *RegionNotificationEndpointsDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionNotificationEndpointsDeleteCall) Fields(s ...googleapi.Field) *RegionNotificationEndpointsDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionNotificationEndpointsDeleteCall) Context(ctx context.Context) *RegionNotificationEndpointsDeleteCall {
- 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 *RegionNotificationEndpointsDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionNotificationEndpointsDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/notificationEndpoints/{notificationEndpoint}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "notificationEndpoint": c.notificationEndpoint,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionNotificationEndpoints.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionNotificationEndpointsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified NotificationEndpoint in the given region",
- // "flatPath": "projects/{project}/regions/{region}/notificationEndpoints/{notificationEndpoint}",
- // "httpMethod": "DELETE",
- // "id": "compute.regionNotificationEndpoints.delete",
- // "parameterOrder": [
- // "project",
- // "region",
- // "notificationEndpoint"
- // ],
- // "parameters": {
- // "notificationEndpoint": {
- // "description": "Name of the NotificationEndpoint resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/notificationEndpoints/{notificationEndpoint}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionNotificationEndpoints.get":
-
-type RegionNotificationEndpointsGetCall struct {
- s *Service
- project string
- region string
- notificationEndpoint string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified NotificationEndpoint resource in the given
-// region.
-//
-// - notificationEndpoint: Name of the NotificationEndpoint resource to
-// return.
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionNotificationEndpointsService) Get(project string, region string, notificationEndpoint string) *RegionNotificationEndpointsGetCall {
- c := &RegionNotificationEndpointsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.notificationEndpoint = notificationEndpoint
- 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 *RegionNotificationEndpointsGetCall) Fields(s ...googleapi.Field) *RegionNotificationEndpointsGetCall {
- 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 *RegionNotificationEndpointsGetCall) IfNoneMatch(entityTag string) *RegionNotificationEndpointsGetCall {
- 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 *RegionNotificationEndpointsGetCall) Context(ctx context.Context) *RegionNotificationEndpointsGetCall {
- 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 *RegionNotificationEndpointsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionNotificationEndpointsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/notificationEndpoints/{notificationEndpoint}")
- 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{
- "project": c.project,
- "region": c.region,
- "notificationEndpoint": c.notificationEndpoint,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionNotificationEndpoints.get" call.
-// Exactly one of *NotificationEndpoint or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *NotificationEndpoint.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 *RegionNotificationEndpointsGetCall) Do(opts ...googleapi.CallOption) (*NotificationEndpoint, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &NotificationEndpoint{
- 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": "Returns the specified NotificationEndpoint resource in the given region.",
- // "flatPath": "projects/{project}/regions/{region}/notificationEndpoints/{notificationEndpoint}",
- // "httpMethod": "GET",
- // "id": "compute.regionNotificationEndpoints.get",
- // "parameterOrder": [
- // "project",
- // "region",
- // "notificationEndpoint"
- // ],
- // "parameters": {
- // "notificationEndpoint": {
- // "description": "Name of the NotificationEndpoint resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/notificationEndpoints/{notificationEndpoint}",
- // "response": {
- // "$ref": "NotificationEndpoint"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.regionNotificationEndpoints.insert":
-
-type RegionNotificationEndpointsInsertCall struct {
- s *Service
- project string
- region string
- notificationendpoint *NotificationEndpoint
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Create a NotificationEndpoint in the specified project in the
-// given region using the parameters that are included in the request.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionNotificationEndpointsService) Insert(project string, region string, notificationendpoint *NotificationEndpoint) *RegionNotificationEndpointsInsertCall {
- c := &RegionNotificationEndpointsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.notificationendpoint = notificationendpoint
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionNotificationEndpointsInsertCall) RequestId(requestId string) *RegionNotificationEndpointsInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionNotificationEndpointsInsertCall) Fields(s ...googleapi.Field) *RegionNotificationEndpointsInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionNotificationEndpointsInsertCall) Context(ctx context.Context) *RegionNotificationEndpointsInsertCall {
- 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 *RegionNotificationEndpointsInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionNotificationEndpointsInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.notificationendpoint)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/notificationEndpoints")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionNotificationEndpoints.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionNotificationEndpointsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Create a NotificationEndpoint in the specified project in the given region using the parameters that are included in the request.",
- // "flatPath": "projects/{project}/regions/{region}/notificationEndpoints",
- // "httpMethod": "POST",
- // "id": "compute.regionNotificationEndpoints.insert",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/notificationEndpoints",
- // "request": {
- // "$ref": "NotificationEndpoint"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionNotificationEndpoints.list":
-
-type RegionNotificationEndpointsListCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Lists the NotificationEndpoints for a project in the given
-// region.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionNotificationEndpointsService) List(project string, region string) *RegionNotificationEndpointsListCall {
- c := &RegionNotificationEndpointsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *RegionNotificationEndpointsListCall) Filter(filter string) *RegionNotificationEndpointsListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *RegionNotificationEndpointsListCall) MaxResults(maxResults int64) *RegionNotificationEndpointsListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *RegionNotificationEndpointsListCall) OrderBy(orderBy string) *RegionNotificationEndpointsListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *RegionNotificationEndpointsListCall) PageToken(pageToken string) *RegionNotificationEndpointsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *RegionNotificationEndpointsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionNotificationEndpointsListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *RegionNotificationEndpointsListCall) Fields(s ...googleapi.Field) *RegionNotificationEndpointsListCall {
- 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 *RegionNotificationEndpointsListCall) IfNoneMatch(entityTag string) *RegionNotificationEndpointsListCall {
- 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 *RegionNotificationEndpointsListCall) Context(ctx context.Context) *RegionNotificationEndpointsListCall {
- 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 *RegionNotificationEndpointsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionNotificationEndpointsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/notificationEndpoints")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionNotificationEndpoints.list" call.
-// Exactly one of *NotificationEndpointList or error will be non-nil.
-// Any non-2xx status code is an error. Response headers are in either
-// *NotificationEndpointList.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 *RegionNotificationEndpointsListCall) Do(opts ...googleapi.CallOption) (*NotificationEndpointList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &NotificationEndpointList{
- 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": "Lists the NotificationEndpoints for a project in the given region.",
- // "flatPath": "projects/{project}/regions/{region}/notificationEndpoints",
- // "httpMethod": "GET",
- // "id": "compute.regionNotificationEndpoints.list",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/notificationEndpoints",
- // "response": {
- // "$ref": "NotificationEndpointList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *RegionNotificationEndpointsListCall) Pages(ctx context.Context, f func(*NotificationEndpointList) 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 "compute.regionOperations.delete":
-
-type RegionOperationsDeleteCall struct {
- s *Service
- project string
- region string
- operation string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified region-specific Operations resource.
-//
-// - operation: Name of the Operations resource to delete.
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-func (r *RegionOperationsService) Delete(project string, region string, operation string) *RegionOperationsDeleteCall {
- c := &RegionOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.operation = operation
- 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 *RegionOperationsDeleteCall) Fields(s ...googleapi.Field) *RegionOperationsDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionOperationsDeleteCall) Context(ctx context.Context) *RegionOperationsDeleteCall {
- 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 *RegionOperationsDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/operations/{operation}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "operation": c.operation,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionOperations.delete" call.
-func (c *RegionOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if err != nil {
- return err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return gensupport.WrapError(err)
- }
- return nil
- // {
- // "description": "Deletes the specified region-specific Operations resource.",
- // "flatPath": "projects/{project}/regions/{region}/operations/{operation}",
- // "httpMethod": "DELETE",
- // "id": "compute.regionOperations.delete",
- // "parameterOrder": [
- // "project",
- // "region",
- // "operation"
- // ],
- // "parameters": {
- // "operation": {
- // "description": "Name of the Operations resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/operations/{operation}",
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionOperations.get":
-
-type RegionOperationsGetCall struct {
- s *Service
- project string
- region string
- operation string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Retrieves the specified region-specific Operations resource.
-//
-// - operation: Name of the Operations resource to return.
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-func (r *RegionOperationsService) Get(project string, region string, operation string) *RegionOperationsGetCall {
- c := &RegionOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.operation = operation
- 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 *RegionOperationsGetCall) Fields(s ...googleapi.Field) *RegionOperationsGetCall {
- 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 *RegionOperationsGetCall) IfNoneMatch(entityTag string) *RegionOperationsGetCall {
- 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 *RegionOperationsGetCall) Context(ctx context.Context) *RegionOperationsGetCall {
- 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 *RegionOperationsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionOperationsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/operations/{operation}")
- 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{
- "project": c.project,
- "region": c.region,
- "operation": c.operation,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionOperations.get" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Retrieves the specified region-specific Operations resource.",
- // "flatPath": "projects/{project}/regions/{region}/operations/{operation}",
- // "httpMethod": "GET",
- // "id": "compute.regionOperations.get",
- // "parameterOrder": [
- // "project",
- // "region",
- // "operation"
- // ],
- // "parameters": {
- // "operation": {
- // "description": "Name of the Operations resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/operations/{operation}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.regionOperations.list":
-
-type RegionOperationsListCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves a list of Operation resources contained within the
-// specified region.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-func (r *RegionOperationsService) List(project string, region string) *RegionOperationsListCall {
- c := &RegionOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *RegionOperationsListCall) Filter(filter string) *RegionOperationsListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *RegionOperationsListCall) MaxResults(maxResults int64) *RegionOperationsListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *RegionOperationsListCall) OrderBy(orderBy string) *RegionOperationsListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *RegionOperationsListCall) PageToken(pageToken string) *RegionOperationsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *RegionOperationsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionOperationsListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *RegionOperationsListCall) Fields(s ...googleapi.Field) *RegionOperationsListCall {
- 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 *RegionOperationsListCall) IfNoneMatch(entityTag string) *RegionOperationsListCall {
- 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 *RegionOperationsListCall) Context(ctx context.Context) *RegionOperationsListCall {
- 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 *RegionOperationsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionOperationsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/operations")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionOperations.list" call.
-// Exactly one of *OperationList or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *OperationList.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 *RegionOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &OperationList{
- 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": "Retrieves a list of Operation resources contained within the specified region.",
- // "flatPath": "projects/{project}/regions/{region}/operations",
- // "httpMethod": "GET",
- // "id": "compute.regionOperations.list",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/operations",
- // "response": {
- // "$ref": "OperationList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *RegionOperationsListCall) Pages(ctx context.Context, f func(*OperationList) 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 "compute.regionOperations.wait":
-
-type RegionOperationsWaitCall struct {
- s *Service
- project string
- region string
- operation string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Wait: Waits for the specified Operation resource to return as `DONE`
-// or for the request to approach the 2 minute deadline, and retrieves
-// the specified Operation resource. This method differs from the `GET`
-// method in that it waits for no more than the default deadline (2
-// minutes) and then returns the current state of the operation, which
-// might be `DONE` or still in progress. This method is called on a
-// best-effort basis. Specifically: - In uncommon cases, when the server
-// is overloaded, the request might return before the default deadline
-// is reached, or might return after zero seconds. - If the default
-// deadline is reached, there is no guarantee that the operation is
-// actually done when the method returns. Be prepared to retry if the
-// operation is not `DONE`.
-//
-// - operation: Name of the Operations resource to return.
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-func (r *RegionOperationsService) Wait(project string, region string, operation string) *RegionOperationsWaitCall {
- c := &RegionOperationsWaitCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.operation = operation
- 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 *RegionOperationsWaitCall) Fields(s ...googleapi.Field) *RegionOperationsWaitCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionOperationsWaitCall) Context(ctx context.Context) *RegionOperationsWaitCall {
- 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 *RegionOperationsWaitCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionOperationsWaitCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/operations/{operation}/wait")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "operation": c.operation,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionOperations.wait" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionOperationsWaitCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the `GET` method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be `DONE` or still in progress. This method is called on a best-effort basis. Specifically: - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not `DONE`. ",
- // "flatPath": "projects/{project}/regions/{region}/operations/{operation}/wait",
- // "httpMethod": "POST",
- // "id": "compute.regionOperations.wait",
- // "parameterOrder": [
- // "project",
- // "region",
- // "operation"
- // ],
- // "parameters": {
- // "operation": {
- // "description": "Name of the Operations resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/operations/{operation}/wait",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.regionSecurityPolicies.addRule":
-
-type RegionSecurityPoliciesAddRuleCall struct {
- s *Service
- project string
- region string
- securityPolicy string
- securitypolicyrule *SecurityPolicyRule
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// AddRule: Inserts a rule into a security policy.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-// - securityPolicy: Name of the security policy to update.
-func (r *RegionSecurityPoliciesService) AddRule(project string, region string, securityPolicy string, securitypolicyrule *SecurityPolicyRule) *RegionSecurityPoliciesAddRuleCall {
- c := &RegionSecurityPoliciesAddRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.securityPolicy = securityPolicy
- c.securitypolicyrule = securitypolicyrule
- return c
-}
-
-// ValidateOnly sets the optional parameter "validateOnly": If true, the
-// request will not be committed.
-func (c *RegionSecurityPoliciesAddRuleCall) ValidateOnly(validateOnly bool) *RegionSecurityPoliciesAddRuleCall {
- c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
- 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 *RegionSecurityPoliciesAddRuleCall) Fields(s ...googleapi.Field) *RegionSecurityPoliciesAddRuleCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionSecurityPoliciesAddRuleCall) Context(ctx context.Context) *RegionSecurityPoliciesAddRuleCall {
- 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 *RegionSecurityPoliciesAddRuleCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionSecurityPoliciesAddRuleCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/securityPolicies/{securityPolicy}/addRule")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "securityPolicy": c.securityPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionSecurityPolicies.addRule" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionSecurityPoliciesAddRuleCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Inserts a rule into a security policy.",
- // "flatPath": "projects/{project}/regions/{region}/securityPolicies/{securityPolicy}/addRule",
- // "httpMethod": "POST",
- // "id": "compute.regionSecurityPolicies.addRule",
- // "parameterOrder": [
- // "project",
- // "region",
- // "securityPolicy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "securityPolicy": {
- // "description": "Name of the security policy to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "validateOnly": {
- // "description": "If true, the request will not be committed.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/securityPolicies/{securityPolicy}/addRule",
- // "request": {
- // "$ref": "SecurityPolicyRule"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionSecurityPolicies.delete":
-
-type RegionSecurityPoliciesDeleteCall struct {
- s *Service
- project string
- region string
- securityPolicy string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified policy.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-// - securityPolicy: Name of the security policy to delete.
-func (r *RegionSecurityPoliciesService) Delete(project string, region string, securityPolicy string) *RegionSecurityPoliciesDeleteCall {
- c := &RegionSecurityPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.securityPolicy = securityPolicy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionSecurityPoliciesDeleteCall) RequestId(requestId string) *RegionSecurityPoliciesDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionSecurityPoliciesDeleteCall) Fields(s ...googleapi.Field) *RegionSecurityPoliciesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionSecurityPoliciesDeleteCall) Context(ctx context.Context) *RegionSecurityPoliciesDeleteCall {
- 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 *RegionSecurityPoliciesDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionSecurityPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/securityPolicies/{securityPolicy}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "securityPolicy": c.securityPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionSecurityPolicies.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionSecurityPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified policy.",
- // "flatPath": "projects/{project}/regions/{region}/securityPolicies/{securityPolicy}",
- // "httpMethod": "DELETE",
- // "id": "compute.regionSecurityPolicies.delete",
- // "parameterOrder": [
- // "project",
- // "region",
- // "securityPolicy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "securityPolicy": {
- // "description": "Name of the security policy to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/securityPolicies/{securityPolicy}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionSecurityPolicies.get":
-
-type RegionSecurityPoliciesGetCall struct {
- s *Service
- project string
- region string
- securityPolicy string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: List all of the ordered rules present in a single specified
-// policy.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-// - securityPolicy: Name of the security policy to get.
-func (r *RegionSecurityPoliciesService) Get(project string, region string, securityPolicy string) *RegionSecurityPoliciesGetCall {
- c := &RegionSecurityPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.securityPolicy = securityPolicy
- 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 *RegionSecurityPoliciesGetCall) Fields(s ...googleapi.Field) *RegionSecurityPoliciesGetCall {
- 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 *RegionSecurityPoliciesGetCall) IfNoneMatch(entityTag string) *RegionSecurityPoliciesGetCall {
- 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 *RegionSecurityPoliciesGetCall) Context(ctx context.Context) *RegionSecurityPoliciesGetCall {
- 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 *RegionSecurityPoliciesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionSecurityPoliciesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/securityPolicies/{securityPolicy}")
- 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{
- "project": c.project,
- "region": c.region,
- "securityPolicy": c.securityPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionSecurityPolicies.get" call.
-// Exactly one of *SecurityPolicy or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *SecurityPolicy.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 *RegionSecurityPoliciesGetCall) Do(opts ...googleapi.CallOption) (*SecurityPolicy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &SecurityPolicy{
- 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 all of the ordered rules present in a single specified policy.",
- // "flatPath": "projects/{project}/regions/{region}/securityPolicies/{securityPolicy}",
- // "httpMethod": "GET",
- // "id": "compute.regionSecurityPolicies.get",
- // "parameterOrder": [
- // "project",
- // "region",
- // "securityPolicy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "securityPolicy": {
- // "description": "Name of the security policy to get.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/securityPolicies/{securityPolicy}",
- // "response": {
- // "$ref": "SecurityPolicy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.regionSecurityPolicies.getRule":
-
-type RegionSecurityPoliciesGetRuleCall struct {
- s *Service
- project string
- region string
- securityPolicy string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetRule: Gets a rule at the specified priority.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-// - securityPolicy: Name of the security policy to which the queried
-// rule belongs.
-func (r *RegionSecurityPoliciesService) GetRule(project string, region string, securityPolicy string) *RegionSecurityPoliciesGetRuleCall {
- c := &RegionSecurityPoliciesGetRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.securityPolicy = securityPolicy
- return c
-}
-
-// Priority sets the optional parameter "priority": The priority of the
-// rule to get from the security policy.
-func (c *RegionSecurityPoliciesGetRuleCall) Priority(priority int64) *RegionSecurityPoliciesGetRuleCall {
- c.urlParams_.Set("priority", fmt.Sprint(priority))
- 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 *RegionSecurityPoliciesGetRuleCall) Fields(s ...googleapi.Field) *RegionSecurityPoliciesGetRuleCall {
- 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 *RegionSecurityPoliciesGetRuleCall) IfNoneMatch(entityTag string) *RegionSecurityPoliciesGetRuleCall {
- 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 *RegionSecurityPoliciesGetRuleCall) Context(ctx context.Context) *RegionSecurityPoliciesGetRuleCall {
- 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 *RegionSecurityPoliciesGetRuleCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionSecurityPoliciesGetRuleCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/securityPolicies/{securityPolicy}/getRule")
- 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{
- "project": c.project,
- "region": c.region,
- "securityPolicy": c.securityPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionSecurityPolicies.getRule" call.
-// Exactly one of *SecurityPolicyRule or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *SecurityPolicyRule.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 *RegionSecurityPoliciesGetRuleCall) Do(opts ...googleapi.CallOption) (*SecurityPolicyRule, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &SecurityPolicyRule{
- 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": "Gets a rule at the specified priority.",
- // "flatPath": "projects/{project}/regions/{region}/securityPolicies/{securityPolicy}/getRule",
- // "httpMethod": "GET",
- // "id": "compute.regionSecurityPolicies.getRule",
- // "parameterOrder": [
- // "project",
- // "region",
- // "securityPolicy"
- // ],
- // "parameters": {
- // "priority": {
- // "description": "The priority of the rule to get from the security policy.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "securityPolicy": {
- // "description": "Name of the security policy to which the queried rule belongs.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/securityPolicies/{securityPolicy}/getRule",
- // "response": {
- // "$ref": "SecurityPolicyRule"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.regionSecurityPolicies.insert":
-
-type RegionSecurityPoliciesInsertCall struct {
- s *Service
- project string
- region string
- securitypolicy *SecurityPolicy
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a new policy in the specified project using the data
-// included in the request.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionSecurityPoliciesService) Insert(project string, region string, securitypolicy *SecurityPolicy) *RegionSecurityPoliciesInsertCall {
- c := &RegionSecurityPoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.securitypolicy = securitypolicy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionSecurityPoliciesInsertCall) RequestId(requestId string) *RegionSecurityPoliciesInsertCall {
- c.urlParams_.Set("requestId", requestId)
- return c
-}
-
-// ValidateOnly sets the optional parameter "validateOnly": If true, the
-// request will not be committed.
-func (c *RegionSecurityPoliciesInsertCall) ValidateOnly(validateOnly bool) *RegionSecurityPoliciesInsertCall {
- c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
- 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 *RegionSecurityPoliciesInsertCall) Fields(s ...googleapi.Field) *RegionSecurityPoliciesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionSecurityPoliciesInsertCall) Context(ctx context.Context) *RegionSecurityPoliciesInsertCall {
- 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 *RegionSecurityPoliciesInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionSecurityPoliciesInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/securityPolicies")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionSecurityPolicies.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionSecurityPoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a new policy in the specified project using the data included in the request.",
- // "flatPath": "projects/{project}/regions/{region}/securityPolicies",
- // "httpMethod": "POST",
- // "id": "compute.regionSecurityPolicies.insert",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "validateOnly": {
- // "description": "If true, the request will not be committed.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/securityPolicies",
- // "request": {
- // "$ref": "SecurityPolicy"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionSecurityPolicies.list":
-
-type RegionSecurityPoliciesListCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: List all the policies that have been configured for the
-// specified project and region.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionSecurityPoliciesService) List(project string, region string) *RegionSecurityPoliciesListCall {
- c := &RegionSecurityPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *RegionSecurityPoliciesListCall) Filter(filter string) *RegionSecurityPoliciesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *RegionSecurityPoliciesListCall) MaxResults(maxResults int64) *RegionSecurityPoliciesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *RegionSecurityPoliciesListCall) OrderBy(orderBy string) *RegionSecurityPoliciesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *RegionSecurityPoliciesListCall) PageToken(pageToken string) *RegionSecurityPoliciesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *RegionSecurityPoliciesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionSecurityPoliciesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *RegionSecurityPoliciesListCall) Fields(s ...googleapi.Field) *RegionSecurityPoliciesListCall {
- 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 *RegionSecurityPoliciesListCall) IfNoneMatch(entityTag string) *RegionSecurityPoliciesListCall {
- 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 *RegionSecurityPoliciesListCall) Context(ctx context.Context) *RegionSecurityPoliciesListCall {
- 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 *RegionSecurityPoliciesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionSecurityPoliciesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/securityPolicies")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionSecurityPolicies.list" call.
-// Exactly one of *SecurityPolicyList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *SecurityPolicyList.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 *RegionSecurityPoliciesListCall) Do(opts ...googleapi.CallOption) (*SecurityPolicyList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &SecurityPolicyList{
- 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 all the policies that have been configured for the specified project and region.",
- // "flatPath": "projects/{project}/regions/{region}/securityPolicies",
- // "httpMethod": "GET",
- // "id": "compute.regionSecurityPolicies.list",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/securityPolicies",
- // "response": {
- // "$ref": "SecurityPolicyList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *RegionSecurityPoliciesListCall) Pages(ctx context.Context, f func(*SecurityPolicyList) 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 "compute.regionSecurityPolicies.patch":
-
-type RegionSecurityPoliciesPatchCall struct {
- s *Service
- project string
- region string
- securityPolicy string
- securitypolicy *SecurityPolicy
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Patches the specified policy with the data included in the
-// request. To clear fields in the policy, leave the fields empty and
-// specify them in the updateMask. This cannot be used to be update the
-// rules in the policy. Please use the per rule methods like addRule,
-// patchRule, and removeRule instead.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-// - securityPolicy: Name of the security policy to update.
-func (r *RegionSecurityPoliciesService) Patch(project string, region string, securityPolicy string, securitypolicy *SecurityPolicy) *RegionSecurityPoliciesPatchCall {
- c := &RegionSecurityPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.securityPolicy = securityPolicy
- c.securitypolicy = securitypolicy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionSecurityPoliciesPatchCall) RequestId(requestId string) *RegionSecurityPoliciesPatchCall {
- c.urlParams_.Set("requestId", requestId)
- return c
-}
-
-// UpdateMask sets the optional parameter "updateMask": Indicates fields
-// to be cleared as part of this request.
-func (c *RegionSecurityPoliciesPatchCall) UpdateMask(updateMask string) *RegionSecurityPoliciesPatchCall {
- c.urlParams_.Set("updateMask", updateMask)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *RegionSecurityPoliciesPatchCall) Fields(s ...googleapi.Field) *RegionSecurityPoliciesPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionSecurityPoliciesPatchCall) Context(ctx context.Context) *RegionSecurityPoliciesPatchCall {
- 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 *RegionSecurityPoliciesPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionSecurityPoliciesPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/securityPolicies/{securityPolicy}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "securityPolicy": c.securityPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionSecurityPolicies.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionSecurityPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Patches the specified policy with the data included in the request. To clear fields in the policy, leave the fields empty and specify them in the updateMask. This cannot be used to be update the rules in the policy. Please use the per rule methods like addRule, patchRule, and removeRule instead.",
- // "flatPath": "projects/{project}/regions/{region}/securityPolicies/{securityPolicy}",
- // "httpMethod": "PATCH",
- // "id": "compute.regionSecurityPolicies.patch",
- // "parameterOrder": [
- // "project",
- // "region",
- // "securityPolicy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "securityPolicy": {
- // "description": "Name of the security policy to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "updateMask": {
- // "description": "Indicates fields to be cleared as part of this request.",
- // "format": "google-fieldmask",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/securityPolicies/{securityPolicy}",
- // "request": {
- // "$ref": "SecurityPolicy"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionSecurityPolicies.patchRule":
-
-type RegionSecurityPoliciesPatchRuleCall struct {
- s *Service
- project string
- region string
- securityPolicy string
- securitypolicyrule *SecurityPolicyRule
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// PatchRule: Patches a rule at the specified priority. To clear fields
-// in the rule, leave the fields empty and specify them in the
-// updateMask.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-// - securityPolicy: Name of the security policy to update.
-func (r *RegionSecurityPoliciesService) PatchRule(project string, region string, securityPolicy string, securitypolicyrule *SecurityPolicyRule) *RegionSecurityPoliciesPatchRuleCall {
- c := &RegionSecurityPoliciesPatchRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.securityPolicy = securityPolicy
- c.securitypolicyrule = securitypolicyrule
- return c
-}
-
-// Priority sets the optional parameter "priority": The priority of the
-// rule to patch.
-func (c *RegionSecurityPoliciesPatchRuleCall) Priority(priority int64) *RegionSecurityPoliciesPatchRuleCall {
- c.urlParams_.Set("priority", fmt.Sprint(priority))
- return c
-}
-
-// UpdateMask sets the optional parameter "updateMask": Indicates fields
-// to be cleared as part of this request.
-func (c *RegionSecurityPoliciesPatchRuleCall) UpdateMask(updateMask string) *RegionSecurityPoliciesPatchRuleCall {
- c.urlParams_.Set("updateMask", updateMask)
- return c
-}
-
-// ValidateOnly sets the optional parameter "validateOnly": If true, the
-// request will not be committed.
-func (c *RegionSecurityPoliciesPatchRuleCall) ValidateOnly(validateOnly bool) *RegionSecurityPoliciesPatchRuleCall {
- c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
- 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 *RegionSecurityPoliciesPatchRuleCall) Fields(s ...googleapi.Field) *RegionSecurityPoliciesPatchRuleCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionSecurityPoliciesPatchRuleCall) Context(ctx context.Context) *RegionSecurityPoliciesPatchRuleCall {
- 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 *RegionSecurityPoliciesPatchRuleCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionSecurityPoliciesPatchRuleCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/securityPolicies/{securityPolicy}/patchRule")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "securityPolicy": c.securityPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionSecurityPolicies.patchRule" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionSecurityPoliciesPatchRuleCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Patches a rule at the specified priority. To clear fields in the rule, leave the fields empty and specify them in the updateMask.",
- // "flatPath": "projects/{project}/regions/{region}/securityPolicies/{securityPolicy}/patchRule",
- // "httpMethod": "POST",
- // "id": "compute.regionSecurityPolicies.patchRule",
- // "parameterOrder": [
- // "project",
- // "region",
- // "securityPolicy"
- // ],
- // "parameters": {
- // "priority": {
- // "description": "The priority of the rule to patch.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "securityPolicy": {
- // "description": "Name of the security policy to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "updateMask": {
- // "description": "Indicates fields to be cleared as part of this request.",
- // "format": "google-fieldmask",
- // "location": "query",
- // "type": "string"
- // },
- // "validateOnly": {
- // "description": "If true, the request will not be committed.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/securityPolicies/{securityPolicy}/patchRule",
- // "request": {
- // "$ref": "SecurityPolicyRule"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionSecurityPolicies.removeRule":
-
-type RegionSecurityPoliciesRemoveRuleCall struct {
- s *Service
- project string
- region string
- securityPolicy string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// RemoveRule: Deletes a rule at the specified priority.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-// - securityPolicy: Name of the security policy to update.
-func (r *RegionSecurityPoliciesService) RemoveRule(project string, region string, securityPolicy string) *RegionSecurityPoliciesRemoveRuleCall {
- c := &RegionSecurityPoliciesRemoveRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.securityPolicy = securityPolicy
- return c
-}
-
-// Priority sets the optional parameter "priority": The priority of the
-// rule to remove from the security policy.
-func (c *RegionSecurityPoliciesRemoveRuleCall) Priority(priority int64) *RegionSecurityPoliciesRemoveRuleCall {
- c.urlParams_.Set("priority", fmt.Sprint(priority))
- 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 *RegionSecurityPoliciesRemoveRuleCall) Fields(s ...googleapi.Field) *RegionSecurityPoliciesRemoveRuleCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionSecurityPoliciesRemoveRuleCall) Context(ctx context.Context) *RegionSecurityPoliciesRemoveRuleCall {
- 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 *RegionSecurityPoliciesRemoveRuleCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionSecurityPoliciesRemoveRuleCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/securityPolicies/{securityPolicy}/removeRule")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "securityPolicy": c.securityPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionSecurityPolicies.removeRule" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionSecurityPoliciesRemoveRuleCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes a rule at the specified priority.",
- // "flatPath": "projects/{project}/regions/{region}/securityPolicies/{securityPolicy}/removeRule",
- // "httpMethod": "POST",
- // "id": "compute.regionSecurityPolicies.removeRule",
- // "parameterOrder": [
- // "project",
- // "region",
- // "securityPolicy"
- // ],
- // "parameters": {
- // "priority": {
- // "description": "The priority of the rule to remove from the security policy.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "securityPolicy": {
- // "description": "Name of the security policy to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/securityPolicies/{securityPolicy}/removeRule",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionSslCertificates.delete":
-
-type RegionSslCertificatesDeleteCall struct {
- s *Service
- project string
- region string
- sslCertificate string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified SslCertificate resource in the region.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-// - sslCertificate: Name of the SslCertificate resource to delete.
-func (r *RegionSslCertificatesService) Delete(project string, region string, sslCertificate string) *RegionSslCertificatesDeleteCall {
- c := &RegionSslCertificatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.sslCertificate = sslCertificate
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionSslCertificatesDeleteCall) RequestId(requestId string) *RegionSslCertificatesDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionSslCertificatesDeleteCall) Fields(s ...googleapi.Field) *RegionSslCertificatesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionSslCertificatesDeleteCall) Context(ctx context.Context) *RegionSslCertificatesDeleteCall {
- 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 *RegionSslCertificatesDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionSslCertificatesDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/sslCertificates/{sslCertificate}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "sslCertificate": c.sslCertificate,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionSslCertificates.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionSslCertificatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified SslCertificate resource in the region.",
- // "flatPath": "projects/{project}/regions/{region}/sslCertificates/{sslCertificate}",
- // "httpMethod": "DELETE",
- // "id": "compute.regionSslCertificates.delete",
- // "parameterOrder": [
- // "project",
- // "region",
- // "sslCertificate"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "sslCertificate": {
- // "description": "Name of the SslCertificate resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/sslCertificates/{sslCertificate}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionSslCertificates.get":
-
-type RegionSslCertificatesGetCall struct {
- s *Service
- project string
- region string
- sslCertificate string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified SslCertificate resource in the specified
-// region. Get a list of available SSL certificates by making a list()
-// request.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-// - sslCertificate: Name of the SslCertificate resource to return.
-func (r *RegionSslCertificatesService) Get(project string, region string, sslCertificate string) *RegionSslCertificatesGetCall {
- c := &RegionSslCertificatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.sslCertificate = sslCertificate
- 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 *RegionSslCertificatesGetCall) Fields(s ...googleapi.Field) *RegionSslCertificatesGetCall {
- 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 *RegionSslCertificatesGetCall) IfNoneMatch(entityTag string) *RegionSslCertificatesGetCall {
- 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 *RegionSslCertificatesGetCall) Context(ctx context.Context) *RegionSslCertificatesGetCall {
- 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 *RegionSslCertificatesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionSslCertificatesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/sslCertificates/{sslCertificate}")
- 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{
- "project": c.project,
- "region": c.region,
- "sslCertificate": c.sslCertificate,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionSslCertificates.get" call.
-// Exactly one of *SslCertificate or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *SslCertificate.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 *RegionSslCertificatesGetCall) Do(opts ...googleapi.CallOption) (*SslCertificate, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &SslCertificate{
- 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": "Returns the specified SslCertificate resource in the specified region. Get a list of available SSL certificates by making a list() request.",
- // "flatPath": "projects/{project}/regions/{region}/sslCertificates/{sslCertificate}",
- // "httpMethod": "GET",
- // "id": "compute.regionSslCertificates.get",
- // "parameterOrder": [
- // "project",
- // "region",
- // "sslCertificate"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "sslCertificate": {
- // "description": "Name of the SslCertificate resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/sslCertificates/{sslCertificate}",
- // "response": {
- // "$ref": "SslCertificate"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.regionSslCertificates.insert":
-
-type RegionSslCertificatesInsertCall struct {
- s *Service
- project string
- region string
- sslcertificate *SslCertificate
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a SslCertificate resource in the specified project
-// and region using the data included in the request
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionSslCertificatesService) Insert(project string, region string, sslcertificate *SslCertificate) *RegionSslCertificatesInsertCall {
- c := &RegionSslCertificatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.sslcertificate = sslcertificate
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionSslCertificatesInsertCall) RequestId(requestId string) *RegionSslCertificatesInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionSslCertificatesInsertCall) Fields(s ...googleapi.Field) *RegionSslCertificatesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionSslCertificatesInsertCall) Context(ctx context.Context) *RegionSslCertificatesInsertCall {
- 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 *RegionSslCertificatesInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionSslCertificatesInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertificate)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/sslCertificates")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionSslCertificates.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionSslCertificatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a SslCertificate resource in the specified project and region using the data included in the request",
- // "flatPath": "projects/{project}/regions/{region}/sslCertificates",
- // "httpMethod": "POST",
- // "id": "compute.regionSslCertificates.insert",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/sslCertificates",
- // "request": {
- // "$ref": "SslCertificate"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionSslCertificates.list":
-
-type RegionSslCertificatesListCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves the list of SslCertificate resources available to the
-// specified project in the specified region.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionSslCertificatesService) List(project string, region string) *RegionSslCertificatesListCall {
- c := &RegionSslCertificatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *RegionSslCertificatesListCall) Filter(filter string) *RegionSslCertificatesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *RegionSslCertificatesListCall) MaxResults(maxResults int64) *RegionSslCertificatesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *RegionSslCertificatesListCall) OrderBy(orderBy string) *RegionSslCertificatesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *RegionSslCertificatesListCall) PageToken(pageToken string) *RegionSslCertificatesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *RegionSslCertificatesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionSslCertificatesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *RegionSslCertificatesListCall) Fields(s ...googleapi.Field) *RegionSslCertificatesListCall {
- 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 *RegionSslCertificatesListCall) IfNoneMatch(entityTag string) *RegionSslCertificatesListCall {
- 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 *RegionSslCertificatesListCall) Context(ctx context.Context) *RegionSslCertificatesListCall {
- 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 *RegionSslCertificatesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionSslCertificatesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/sslCertificates")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionSslCertificates.list" call.
-// Exactly one of *SslCertificateList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *SslCertificateList.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 *RegionSslCertificatesListCall) Do(opts ...googleapi.CallOption) (*SslCertificateList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &SslCertificateList{
- 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": "Retrieves the list of SslCertificate resources available to the specified project in the specified region.",
- // "flatPath": "projects/{project}/regions/{region}/sslCertificates",
- // "httpMethod": "GET",
- // "id": "compute.regionSslCertificates.list",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/sslCertificates",
- // "response": {
- // "$ref": "SslCertificateList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *RegionSslCertificatesListCall) Pages(ctx context.Context, f func(*SslCertificateList) 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 "compute.regionSslPolicies.delete":
-
-type RegionSslPoliciesDeleteCall struct {
- s *Service
- project string
- region string
- sslPolicy string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified SSL policy. The SSL policy resource can
-// be deleted only if it is not in use by any TargetHttpsProxy or
-// TargetSslProxy resources.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-// - sslPolicy: Name of the SSL policy to delete. The name must be 1-63
-// characters long, and comply with RFC1035.
-func (r *RegionSslPoliciesService) Delete(project string, region string, sslPolicy string) *RegionSslPoliciesDeleteCall {
- c := &RegionSslPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.sslPolicy = sslPolicy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionSslPoliciesDeleteCall) RequestId(requestId string) *RegionSslPoliciesDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionSslPoliciesDeleteCall) Fields(s ...googleapi.Field) *RegionSslPoliciesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionSslPoliciesDeleteCall) Context(ctx context.Context) *RegionSslPoliciesDeleteCall {
- 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 *RegionSslPoliciesDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionSslPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/sslPolicies/{sslPolicy}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "sslPolicy": c.sslPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionSslPolicies.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionSslPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified SSL policy. The SSL policy resource can be deleted only if it is not in use by any TargetHttpsProxy or TargetSslProxy resources.",
- // "flatPath": "projects/{project}/regions/{region}/sslPolicies/{sslPolicy}",
- // "httpMethod": "DELETE",
- // "id": "compute.regionSslPolicies.delete",
- // "parameterOrder": [
- // "project",
- // "region",
- // "sslPolicy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "sslPolicy": {
- // "description": "Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/sslPolicies/{sslPolicy}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionSslPolicies.get":
-
-type RegionSslPoliciesGetCall struct {
- s *Service
- project string
- region string
- sslPolicy string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Lists all of the ordered rules present in a single specified
-// policy.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-// - sslPolicy: Name of the SSL policy to update. The name must be 1-63
-// characters long, and comply with RFC1035.
-func (r *RegionSslPoliciesService) Get(project string, region string, sslPolicy string) *RegionSslPoliciesGetCall {
- c := &RegionSslPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.sslPolicy = sslPolicy
- 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 *RegionSslPoliciesGetCall) Fields(s ...googleapi.Field) *RegionSslPoliciesGetCall {
- 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 *RegionSslPoliciesGetCall) IfNoneMatch(entityTag string) *RegionSslPoliciesGetCall {
- 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 *RegionSslPoliciesGetCall) Context(ctx context.Context) *RegionSslPoliciesGetCall {
- 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 *RegionSslPoliciesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionSslPoliciesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/sslPolicies/{sslPolicy}")
- 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{
- "project": c.project,
- "region": c.region,
- "sslPolicy": c.sslPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionSslPolicies.get" call.
-// Exactly one of *SslPolicy or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *SslPolicy.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 *RegionSslPoliciesGetCall) Do(opts ...googleapi.CallOption) (*SslPolicy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &SslPolicy{
- 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": "Lists all of the ordered rules present in a single specified policy.",
- // "flatPath": "projects/{project}/regions/{region}/sslPolicies/{sslPolicy}",
- // "httpMethod": "GET",
- // "id": "compute.regionSslPolicies.get",
- // "parameterOrder": [
- // "project",
- // "region",
- // "sslPolicy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "sslPolicy": {
- // "description": "Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/sslPolicies/{sslPolicy}",
- // "response": {
- // "$ref": "SslPolicy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.regionSslPolicies.insert":
-
-type RegionSslPoliciesInsertCall struct {
- s *Service
- project string
- region string
- sslpolicy *SslPolicy
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a new policy in the specified project and region
-// using the data included in the request.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionSslPoliciesService) Insert(project string, region string, sslpolicy *SslPolicy) *RegionSslPoliciesInsertCall {
- c := &RegionSslPoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.sslpolicy = sslpolicy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionSslPoliciesInsertCall) RequestId(requestId string) *RegionSslPoliciesInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionSslPoliciesInsertCall) Fields(s ...googleapi.Field) *RegionSslPoliciesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionSslPoliciesInsertCall) Context(ctx context.Context) *RegionSslPoliciesInsertCall {
- 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 *RegionSslPoliciesInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionSslPoliciesInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicy)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/sslPolicies")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionSslPolicies.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionSslPoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a new policy in the specified project and region using the data included in the request.",
- // "flatPath": "projects/{project}/regions/{region}/sslPolicies",
- // "httpMethod": "POST",
- // "id": "compute.regionSslPolicies.insert",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/sslPolicies",
- // "request": {
- // "$ref": "SslPolicy"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionSslPolicies.list":
-
-type RegionSslPoliciesListCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Lists all the SSL policies that have been configured for the
-// specified project and region.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionSslPoliciesService) List(project string, region string) *RegionSslPoliciesListCall {
- c := &RegionSslPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *RegionSslPoliciesListCall) Filter(filter string) *RegionSslPoliciesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *RegionSslPoliciesListCall) MaxResults(maxResults int64) *RegionSslPoliciesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *RegionSslPoliciesListCall) OrderBy(orderBy string) *RegionSslPoliciesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *RegionSslPoliciesListCall) PageToken(pageToken string) *RegionSslPoliciesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *RegionSslPoliciesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionSslPoliciesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *RegionSslPoliciesListCall) Fields(s ...googleapi.Field) *RegionSslPoliciesListCall {
- 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 *RegionSslPoliciesListCall) IfNoneMatch(entityTag string) *RegionSslPoliciesListCall {
- 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 *RegionSslPoliciesListCall) Context(ctx context.Context) *RegionSslPoliciesListCall {
- 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 *RegionSslPoliciesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionSslPoliciesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/sslPolicies")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionSslPolicies.list" call.
-// Exactly one of *SslPoliciesList or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *SslPoliciesList.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 *RegionSslPoliciesListCall) Do(opts ...googleapi.CallOption) (*SslPoliciesList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &SslPoliciesList{
- 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": "Lists all the SSL policies that have been configured for the specified project and region.",
- // "flatPath": "projects/{project}/regions/{region}/sslPolicies",
- // "httpMethod": "GET",
- // "id": "compute.regionSslPolicies.list",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/sslPolicies",
- // "response": {
- // "$ref": "SslPoliciesList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *RegionSslPoliciesListCall) Pages(ctx context.Context, f func(*SslPoliciesList) 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 "compute.regionSslPolicies.listAvailableFeatures":
-
-type RegionSslPoliciesListAvailableFeaturesCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// ListAvailableFeatures: Lists all features that can be specified in
-// the SSL policy when using custom profile.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionSslPoliciesService) ListAvailableFeatures(project string, region string) *RegionSslPoliciesListAvailableFeaturesCall {
- c := &RegionSslPoliciesListAvailableFeaturesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *RegionSslPoliciesListAvailableFeaturesCall) Filter(filter string) *RegionSslPoliciesListAvailableFeaturesCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *RegionSslPoliciesListAvailableFeaturesCall) MaxResults(maxResults int64) *RegionSslPoliciesListAvailableFeaturesCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *RegionSslPoliciesListAvailableFeaturesCall) OrderBy(orderBy string) *RegionSslPoliciesListAvailableFeaturesCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *RegionSslPoliciesListAvailableFeaturesCall) PageToken(pageToken string) *RegionSslPoliciesListAvailableFeaturesCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *RegionSslPoliciesListAvailableFeaturesCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionSslPoliciesListAvailableFeaturesCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *RegionSslPoliciesListAvailableFeaturesCall) Fields(s ...googleapi.Field) *RegionSslPoliciesListAvailableFeaturesCall {
- 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 *RegionSslPoliciesListAvailableFeaturesCall) IfNoneMatch(entityTag string) *RegionSslPoliciesListAvailableFeaturesCall {
- 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 *RegionSslPoliciesListAvailableFeaturesCall) Context(ctx context.Context) *RegionSslPoliciesListAvailableFeaturesCall {
- 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 *RegionSslPoliciesListAvailableFeaturesCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionSslPoliciesListAvailableFeaturesCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/sslPolicies/listAvailableFeatures")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionSslPolicies.listAvailableFeatures" call.
-// Exactly one of *SslPoliciesListAvailableFeaturesResponse or error
-// will be non-nil. Any non-2xx status code is an error. Response
-// headers are in either
-// *SslPoliciesListAvailableFeaturesResponse.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 *RegionSslPoliciesListAvailableFeaturesCall) Do(opts ...googleapi.CallOption) (*SslPoliciesListAvailableFeaturesResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &SslPoliciesListAvailableFeaturesResponse{
- 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": "Lists all features that can be specified in the SSL policy when using custom profile.",
- // "flatPath": "projects/{project}/regions/{region}/sslPolicies/listAvailableFeatures",
- // "httpMethod": "GET",
- // "id": "compute.regionSslPolicies.listAvailableFeatures",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/sslPolicies/listAvailableFeatures",
- // "response": {
- // "$ref": "SslPoliciesListAvailableFeaturesResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.regionSslPolicies.patch":
-
-type RegionSslPoliciesPatchCall struct {
- s *Service
- project string
- region string
- sslPolicy string
- sslpolicy *SslPolicy
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Patches the specified SSL policy with the data included in the
-// request.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-// - sslPolicy: Name of the SSL policy to update. The name must be 1-63
-// characters long, and comply with RFC1035.
-func (r *RegionSslPoliciesService) Patch(project string, region string, sslPolicy string, sslpolicy *SslPolicy) *RegionSslPoliciesPatchCall {
- c := &RegionSslPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.sslPolicy = sslPolicy
- c.sslpolicy = sslpolicy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionSslPoliciesPatchCall) RequestId(requestId string) *RegionSslPoliciesPatchCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionSslPoliciesPatchCall) Fields(s ...googleapi.Field) *RegionSslPoliciesPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionSslPoliciesPatchCall) Context(ctx context.Context) *RegionSslPoliciesPatchCall {
- 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 *RegionSslPoliciesPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionSslPoliciesPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicy)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/sslPolicies/{sslPolicy}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "sslPolicy": c.sslPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionSslPolicies.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionSslPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Patches the specified SSL policy with the data included in the request.",
- // "flatPath": "projects/{project}/regions/{region}/sslPolicies/{sslPolicy}",
- // "httpMethod": "PATCH",
- // "id": "compute.regionSslPolicies.patch",
- // "parameterOrder": [
- // "project",
- // "region",
- // "sslPolicy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "sslPolicy": {
- // "description": "Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/sslPolicies/{sslPolicy}",
- // "request": {
- // "$ref": "SslPolicy"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionTargetHttpProxies.delete":
-
-type RegionTargetHttpProxiesDeleteCall struct {
- s *Service
- project string
- region string
- targetHttpProxy string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified TargetHttpProxy resource.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-// - targetHttpProxy: Name of the TargetHttpProxy resource to delete.
-func (r *RegionTargetHttpProxiesService) Delete(project string, region string, targetHttpProxy string) *RegionTargetHttpProxiesDeleteCall {
- c := &RegionTargetHttpProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.targetHttpProxy = targetHttpProxy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionTargetHttpProxiesDeleteCall) RequestId(requestId string) *RegionTargetHttpProxiesDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionTargetHttpProxiesDeleteCall) Fields(s ...googleapi.Field) *RegionTargetHttpProxiesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionTargetHttpProxiesDeleteCall) Context(ctx context.Context) *RegionTargetHttpProxiesDeleteCall {
- 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 *RegionTargetHttpProxiesDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionTargetHttpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "targetHttpProxy": c.targetHttpProxy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionTargetHttpProxies.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionTargetHttpProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified TargetHttpProxy resource.",
- // "flatPath": "projects/{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}",
- // "httpMethod": "DELETE",
- // "id": "compute.regionTargetHttpProxies.delete",
- // "parameterOrder": [
- // "project",
- // "region",
- // "targetHttpProxy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "targetHttpProxy": {
- // "description": "Name of the TargetHttpProxy resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionTargetHttpProxies.get":
-
-type RegionTargetHttpProxiesGetCall struct {
- s *Service
- project string
- region string
- targetHttpProxy string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified TargetHttpProxy resource in the specified
-// region.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-// - targetHttpProxy: Name of the TargetHttpProxy resource to return.
-func (r *RegionTargetHttpProxiesService) Get(project string, region string, targetHttpProxy string) *RegionTargetHttpProxiesGetCall {
- c := &RegionTargetHttpProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.targetHttpProxy = targetHttpProxy
- 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 *RegionTargetHttpProxiesGetCall) Fields(s ...googleapi.Field) *RegionTargetHttpProxiesGetCall {
- 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 *RegionTargetHttpProxiesGetCall) IfNoneMatch(entityTag string) *RegionTargetHttpProxiesGetCall {
- 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 *RegionTargetHttpProxiesGetCall) Context(ctx context.Context) *RegionTargetHttpProxiesGetCall {
- 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 *RegionTargetHttpProxiesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionTargetHttpProxiesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}")
- 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{
- "project": c.project,
- "region": c.region,
- "targetHttpProxy": c.targetHttpProxy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionTargetHttpProxies.get" call.
-// Exactly one of *TargetHttpProxy or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *TargetHttpProxy.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 *RegionTargetHttpProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TargetHttpProxy{
- 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": "Returns the specified TargetHttpProxy resource in the specified region.",
- // "flatPath": "projects/{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}",
- // "httpMethod": "GET",
- // "id": "compute.regionTargetHttpProxies.get",
- // "parameterOrder": [
- // "project",
- // "region",
- // "targetHttpProxy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "targetHttpProxy": {
- // "description": "Name of the TargetHttpProxy resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}",
- // "response": {
- // "$ref": "TargetHttpProxy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.regionTargetHttpProxies.insert":
-
-type RegionTargetHttpProxiesInsertCall struct {
- s *Service
- project string
- region string
- targethttpproxy *TargetHttpProxy
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a TargetHttpProxy resource in the specified project
-// and region using the data included in the request.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionTargetHttpProxiesService) Insert(project string, region string, targethttpproxy *TargetHttpProxy) *RegionTargetHttpProxiesInsertCall {
- c := &RegionTargetHttpProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.targethttpproxy = targethttpproxy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionTargetHttpProxiesInsertCall) RequestId(requestId string) *RegionTargetHttpProxiesInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionTargetHttpProxiesInsertCall) Fields(s ...googleapi.Field) *RegionTargetHttpProxiesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionTargetHttpProxiesInsertCall) Context(ctx context.Context) *RegionTargetHttpProxiesInsertCall {
- 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 *RegionTargetHttpProxiesInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionTargetHttpProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpproxy)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetHttpProxies")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionTargetHttpProxies.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionTargetHttpProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a TargetHttpProxy resource in the specified project and region using the data included in the request.",
- // "flatPath": "projects/{project}/regions/{region}/targetHttpProxies",
- // "httpMethod": "POST",
- // "id": "compute.regionTargetHttpProxies.insert",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/targetHttpProxies",
- // "request": {
- // "$ref": "TargetHttpProxy"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionTargetHttpProxies.list":
-
-type RegionTargetHttpProxiesListCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves the list of TargetHttpProxy resources available to
-// the specified project in the specified region.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionTargetHttpProxiesService) List(project string, region string) *RegionTargetHttpProxiesListCall {
- c := &RegionTargetHttpProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *RegionTargetHttpProxiesListCall) Filter(filter string) *RegionTargetHttpProxiesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *RegionTargetHttpProxiesListCall) MaxResults(maxResults int64) *RegionTargetHttpProxiesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *RegionTargetHttpProxiesListCall) OrderBy(orderBy string) *RegionTargetHttpProxiesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *RegionTargetHttpProxiesListCall) PageToken(pageToken string) *RegionTargetHttpProxiesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *RegionTargetHttpProxiesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionTargetHttpProxiesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *RegionTargetHttpProxiesListCall) Fields(s ...googleapi.Field) *RegionTargetHttpProxiesListCall {
- 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 *RegionTargetHttpProxiesListCall) IfNoneMatch(entityTag string) *RegionTargetHttpProxiesListCall {
- 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 *RegionTargetHttpProxiesListCall) Context(ctx context.Context) *RegionTargetHttpProxiesListCall {
- 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 *RegionTargetHttpProxiesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionTargetHttpProxiesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/targetHttpProxies")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionTargetHttpProxies.list" call.
-// Exactly one of *TargetHttpProxyList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *TargetHttpProxyList.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 *RegionTargetHttpProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxyList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TargetHttpProxyList{
- 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": "Retrieves the list of TargetHttpProxy resources available to the specified project in the specified region.",
- // "flatPath": "projects/{project}/regions/{region}/targetHttpProxies",
- // "httpMethod": "GET",
- // "id": "compute.regionTargetHttpProxies.list",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/targetHttpProxies",
- // "response": {
- // "$ref": "TargetHttpProxyList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *RegionTargetHttpProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpProxyList) 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 "compute.regionTargetHttpProxies.setUrlMap":
-
-type RegionTargetHttpProxiesSetUrlMapCall struct {
- s *Service
- project string
- region string
- targetHttpProxy string
- urlmapreference *UrlMapReference
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetUrlMap: Changes the URL map for TargetHttpProxy.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-// - targetHttpProxy: Name of the TargetHttpProxy to set a URL map for.
-func (r *RegionTargetHttpProxiesService) SetUrlMap(project string, region string, targetHttpProxy string, urlmapreference *UrlMapReference) *RegionTargetHttpProxiesSetUrlMapCall {
- c := &RegionTargetHttpProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.targetHttpProxy = targetHttpProxy
- c.urlmapreference = urlmapreference
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionTargetHttpProxiesSetUrlMapCall) RequestId(requestId string) *RegionTargetHttpProxiesSetUrlMapCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionTargetHttpProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *RegionTargetHttpProxiesSetUrlMapCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionTargetHttpProxiesSetUrlMapCall) Context(ctx context.Context) *RegionTargetHttpProxiesSetUrlMapCall {
- 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 *RegionTargetHttpProxiesSetUrlMapCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionTargetHttpProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}/setUrlMap")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "targetHttpProxy": c.targetHttpProxy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionTargetHttpProxies.setUrlMap" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionTargetHttpProxiesSetUrlMapCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Changes the URL map for TargetHttpProxy.",
- // "flatPath": "projects/{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}/setUrlMap",
- // "httpMethod": "POST",
- // "id": "compute.regionTargetHttpProxies.setUrlMap",
- // "parameterOrder": [
- // "project",
- // "region",
- // "targetHttpProxy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "targetHttpProxy": {
- // "description": "Name of the TargetHttpProxy to set a URL map for.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}/setUrlMap",
- // "request": {
- // "$ref": "UrlMapReference"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionTargetHttpsProxies.delete":
-
-type RegionTargetHttpsProxiesDeleteCall struct {
- s *Service
- project string
- region string
- targetHttpsProxy string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified TargetHttpsProxy resource.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-// - targetHttpsProxy: Name of the TargetHttpsProxy resource to delete.
-func (r *RegionTargetHttpsProxiesService) Delete(project string, region string, targetHttpsProxy string) *RegionTargetHttpsProxiesDeleteCall {
- c := &RegionTargetHttpsProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.targetHttpsProxy = targetHttpsProxy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionTargetHttpsProxiesDeleteCall) RequestId(requestId string) *RegionTargetHttpsProxiesDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionTargetHttpsProxiesDeleteCall) Fields(s ...googleapi.Field) *RegionTargetHttpsProxiesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionTargetHttpsProxiesDeleteCall) Context(ctx context.Context) *RegionTargetHttpsProxiesDeleteCall {
- 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 *RegionTargetHttpsProxiesDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionTargetHttpsProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "targetHttpsProxy": c.targetHttpsProxy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionTargetHttpsProxies.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionTargetHttpsProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified TargetHttpsProxy resource.",
- // "flatPath": "projects/{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}",
- // "httpMethod": "DELETE",
- // "id": "compute.regionTargetHttpsProxies.delete",
- // "parameterOrder": [
- // "project",
- // "region",
- // "targetHttpsProxy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "targetHttpsProxy": {
- // "description": "Name of the TargetHttpsProxy resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionTargetHttpsProxies.get":
-
-type RegionTargetHttpsProxiesGetCall struct {
- s *Service
- project string
- region string
- targetHttpsProxy string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified TargetHttpsProxy resource in the specified
-// region.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-// - targetHttpsProxy: Name of the TargetHttpsProxy resource to return.
-func (r *RegionTargetHttpsProxiesService) Get(project string, region string, targetHttpsProxy string) *RegionTargetHttpsProxiesGetCall {
- c := &RegionTargetHttpsProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.targetHttpsProxy = targetHttpsProxy
- 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 *RegionTargetHttpsProxiesGetCall) Fields(s ...googleapi.Field) *RegionTargetHttpsProxiesGetCall {
- 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 *RegionTargetHttpsProxiesGetCall) IfNoneMatch(entityTag string) *RegionTargetHttpsProxiesGetCall {
- 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 *RegionTargetHttpsProxiesGetCall) Context(ctx context.Context) *RegionTargetHttpsProxiesGetCall {
- 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 *RegionTargetHttpsProxiesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionTargetHttpsProxiesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}")
- 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{
- "project": c.project,
- "region": c.region,
- "targetHttpsProxy": c.targetHttpsProxy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionTargetHttpsProxies.get" call.
-// Exactly one of *TargetHttpsProxy or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *TargetHttpsProxy.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 *RegionTargetHttpsProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TargetHttpsProxy{
- 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": "Returns the specified TargetHttpsProxy resource in the specified region.",
- // "flatPath": "projects/{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}",
- // "httpMethod": "GET",
- // "id": "compute.regionTargetHttpsProxies.get",
- // "parameterOrder": [
- // "project",
- // "region",
- // "targetHttpsProxy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "targetHttpsProxy": {
- // "description": "Name of the TargetHttpsProxy resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}",
- // "response": {
- // "$ref": "TargetHttpsProxy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.regionTargetHttpsProxies.insert":
-
-type RegionTargetHttpsProxiesInsertCall struct {
- s *Service
- project string
- region string
- targethttpsproxy *TargetHttpsProxy
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a TargetHttpsProxy resource in the specified project
-// and region using the data included in the request.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionTargetHttpsProxiesService) Insert(project string, region string, targethttpsproxy *TargetHttpsProxy) *RegionTargetHttpsProxiesInsertCall {
- c := &RegionTargetHttpsProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.targethttpsproxy = targethttpsproxy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionTargetHttpsProxiesInsertCall) RequestId(requestId string) *RegionTargetHttpsProxiesInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionTargetHttpsProxiesInsertCall) Fields(s ...googleapi.Field) *RegionTargetHttpsProxiesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionTargetHttpsProxiesInsertCall) Context(ctx context.Context) *RegionTargetHttpsProxiesInsertCall {
- 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 *RegionTargetHttpsProxiesInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionTargetHttpsProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxy)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetHttpsProxies")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionTargetHttpsProxies.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionTargetHttpsProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a TargetHttpsProxy resource in the specified project and region using the data included in the request.",
- // "flatPath": "projects/{project}/regions/{region}/targetHttpsProxies",
- // "httpMethod": "POST",
- // "id": "compute.regionTargetHttpsProxies.insert",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/targetHttpsProxies",
- // "request": {
- // "$ref": "TargetHttpsProxy"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionTargetHttpsProxies.list":
-
-type RegionTargetHttpsProxiesListCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves the list of TargetHttpsProxy resources available to
-// the specified project in the specified region.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionTargetHttpsProxiesService) List(project string, region string) *RegionTargetHttpsProxiesListCall {
- c := &RegionTargetHttpsProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *RegionTargetHttpsProxiesListCall) Filter(filter string) *RegionTargetHttpsProxiesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *RegionTargetHttpsProxiesListCall) MaxResults(maxResults int64) *RegionTargetHttpsProxiesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *RegionTargetHttpsProxiesListCall) OrderBy(orderBy string) *RegionTargetHttpsProxiesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *RegionTargetHttpsProxiesListCall) PageToken(pageToken string) *RegionTargetHttpsProxiesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *RegionTargetHttpsProxiesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionTargetHttpsProxiesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *RegionTargetHttpsProxiesListCall) Fields(s ...googleapi.Field) *RegionTargetHttpsProxiesListCall {
- 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 *RegionTargetHttpsProxiesListCall) IfNoneMatch(entityTag string) *RegionTargetHttpsProxiesListCall {
- 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 *RegionTargetHttpsProxiesListCall) Context(ctx context.Context) *RegionTargetHttpsProxiesListCall {
- 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 *RegionTargetHttpsProxiesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionTargetHttpsProxiesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/targetHttpsProxies")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionTargetHttpsProxies.list" call.
-// Exactly one of *TargetHttpsProxyList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *TargetHttpsProxyList.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 *RegionTargetHttpsProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxyList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TargetHttpsProxyList{
- 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": "Retrieves the list of TargetHttpsProxy resources available to the specified project in the specified region.",
- // "flatPath": "projects/{project}/regions/{region}/targetHttpsProxies",
- // "httpMethod": "GET",
- // "id": "compute.regionTargetHttpsProxies.list",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/targetHttpsProxies",
- // "response": {
- // "$ref": "TargetHttpsProxyList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *RegionTargetHttpsProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpsProxyList) 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 "compute.regionTargetHttpsProxies.patch":
-
-type RegionTargetHttpsProxiesPatchCall struct {
- s *Service
- project string
- region string
- targetHttpsProxy string
- targethttpsproxy *TargetHttpsProxy
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Patches the specified regional TargetHttpsProxy resource with
-// the data included in the request. This method supports PATCH
-// semantics and uses JSON merge patch format and processing rules.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-// - targetHttpsProxy: Name of the TargetHttpsProxy resource to patch.
-func (r *RegionTargetHttpsProxiesService) Patch(project string, region string, targetHttpsProxy string, targethttpsproxy *TargetHttpsProxy) *RegionTargetHttpsProxiesPatchCall {
- c := &RegionTargetHttpsProxiesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.targetHttpsProxy = targetHttpsProxy
- c.targethttpsproxy = targethttpsproxy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionTargetHttpsProxiesPatchCall) RequestId(requestId string) *RegionTargetHttpsProxiesPatchCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionTargetHttpsProxiesPatchCall) Fields(s ...googleapi.Field) *RegionTargetHttpsProxiesPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionTargetHttpsProxiesPatchCall) Context(ctx context.Context) *RegionTargetHttpsProxiesPatchCall {
- 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 *RegionTargetHttpsProxiesPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionTargetHttpsProxiesPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxy)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "targetHttpsProxy": c.targetHttpsProxy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionTargetHttpsProxies.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionTargetHttpsProxiesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Patches the specified regional TargetHttpsProxy resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules.",
- // "flatPath": "projects/{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}",
- // "httpMethod": "PATCH",
- // "id": "compute.regionTargetHttpsProxies.patch",
- // "parameterOrder": [
- // "project",
- // "region",
- // "targetHttpsProxy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "targetHttpsProxy": {
- // "description": "Name of the TargetHttpsProxy resource to patch.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}",
- // "request": {
- // "$ref": "TargetHttpsProxy"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionTargetHttpsProxies.setSslCertificates":
-
-type RegionTargetHttpsProxiesSetSslCertificatesCall struct {
- s *Service
- project string
- region string
- targetHttpsProxy string
- regiontargethttpsproxiessetsslcertificatesrequest *RegionTargetHttpsProxiesSetSslCertificatesRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetSslCertificates: Replaces SslCertificates for TargetHttpsProxy.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-// - targetHttpsProxy: Name of the TargetHttpsProxy resource to set an
-// SslCertificates resource for.
-func (r *RegionTargetHttpsProxiesService) SetSslCertificates(project string, region string, targetHttpsProxy string, regiontargethttpsproxiessetsslcertificatesrequest *RegionTargetHttpsProxiesSetSslCertificatesRequest) *RegionTargetHttpsProxiesSetSslCertificatesCall {
- c := &RegionTargetHttpsProxiesSetSslCertificatesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.targetHttpsProxy = targetHttpsProxy
- c.regiontargethttpsproxiessetsslcertificatesrequest = regiontargethttpsproxiessetsslcertificatesrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionTargetHttpsProxiesSetSslCertificatesCall) RequestId(requestId string) *RegionTargetHttpsProxiesSetSslCertificatesCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionTargetHttpsProxiesSetSslCertificatesCall) Fields(s ...googleapi.Field) *RegionTargetHttpsProxiesSetSslCertificatesCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionTargetHttpsProxiesSetSslCertificatesCall) Context(ctx context.Context) *RegionTargetHttpsProxiesSetSslCertificatesCall {
- 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 *RegionTargetHttpsProxiesSetSslCertificatesCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionTargetHttpsProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiontargethttpsproxiessetsslcertificatesrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "targetHttpsProxy": c.targetHttpsProxy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionTargetHttpsProxies.setSslCertificates" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionTargetHttpsProxiesSetSslCertificatesCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Replaces SslCertificates for TargetHttpsProxy.",
- // "flatPath": "projects/{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates",
- // "httpMethod": "POST",
- // "id": "compute.regionTargetHttpsProxies.setSslCertificates",
- // "parameterOrder": [
- // "project",
- // "region",
- // "targetHttpsProxy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "targetHttpsProxy": {
- // "description": "Name of the TargetHttpsProxy resource to set an SslCertificates resource for.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates",
- // "request": {
- // "$ref": "RegionTargetHttpsProxiesSetSslCertificatesRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionTargetHttpsProxies.setUrlMap":
-
-type RegionTargetHttpsProxiesSetUrlMapCall struct {
- s *Service
- project string
- region string
- targetHttpsProxy string
- urlmapreference *UrlMapReference
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetUrlMap: Changes the URL map for TargetHttpsProxy.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-// - targetHttpsProxy: Name of the TargetHttpsProxy to set a URL map
-// for.
-func (r *RegionTargetHttpsProxiesService) SetUrlMap(project string, region string, targetHttpsProxy string, urlmapreference *UrlMapReference) *RegionTargetHttpsProxiesSetUrlMapCall {
- c := &RegionTargetHttpsProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.targetHttpsProxy = targetHttpsProxy
- c.urlmapreference = urlmapreference
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionTargetHttpsProxiesSetUrlMapCall) RequestId(requestId string) *RegionTargetHttpsProxiesSetUrlMapCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionTargetHttpsProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *RegionTargetHttpsProxiesSetUrlMapCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionTargetHttpsProxiesSetUrlMapCall) Context(ctx context.Context) *RegionTargetHttpsProxiesSetUrlMapCall {
- 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 *RegionTargetHttpsProxiesSetUrlMapCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionTargetHttpsProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "targetHttpsProxy": c.targetHttpsProxy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionTargetHttpsProxies.setUrlMap" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionTargetHttpsProxiesSetUrlMapCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Changes the URL map for TargetHttpsProxy.",
- // "flatPath": "projects/{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap",
- // "httpMethod": "POST",
- // "id": "compute.regionTargetHttpsProxies.setUrlMap",
- // "parameterOrder": [
- // "project",
- // "region",
- // "targetHttpsProxy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "targetHttpsProxy": {
- // "description": "Name of the TargetHttpsProxy to set a URL map for.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap",
- // "request": {
- // "$ref": "UrlMapReference"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionTargetTcpProxies.delete":
-
-type RegionTargetTcpProxiesDeleteCall struct {
- s *Service
- project string
- region string
- targetTcpProxy string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified TargetTcpProxy resource.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-// - targetTcpProxy: Name of the TargetTcpProxy resource to delete.
-func (r *RegionTargetTcpProxiesService) Delete(project string, region string, targetTcpProxy string) *RegionTargetTcpProxiesDeleteCall {
- c := &RegionTargetTcpProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.targetTcpProxy = targetTcpProxy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionTargetTcpProxiesDeleteCall) RequestId(requestId string) *RegionTargetTcpProxiesDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionTargetTcpProxiesDeleteCall) Fields(s ...googleapi.Field) *RegionTargetTcpProxiesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionTargetTcpProxiesDeleteCall) Context(ctx context.Context) *RegionTargetTcpProxiesDeleteCall {
- 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 *RegionTargetTcpProxiesDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionTargetTcpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetTcpProxies/{targetTcpProxy}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "targetTcpProxy": c.targetTcpProxy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionTargetTcpProxies.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionTargetTcpProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified TargetTcpProxy resource.",
- // "flatPath": "projects/{project}/regions/{region}/targetTcpProxies/{targetTcpProxy}",
- // "httpMethod": "DELETE",
- // "id": "compute.regionTargetTcpProxies.delete",
- // "parameterOrder": [
- // "project",
- // "region",
- // "targetTcpProxy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "targetTcpProxy": {
- // "description": "Name of the TargetTcpProxy resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/targetTcpProxies/{targetTcpProxy}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionTargetTcpProxies.get":
-
-type RegionTargetTcpProxiesGetCall struct {
- s *Service
- project string
- region string
- targetTcpProxy string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified TargetTcpProxy resource.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-// - targetTcpProxy: Name of the TargetTcpProxy resource to return.
-func (r *RegionTargetTcpProxiesService) Get(project string, region string, targetTcpProxy string) *RegionTargetTcpProxiesGetCall {
- c := &RegionTargetTcpProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.targetTcpProxy = targetTcpProxy
- 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 *RegionTargetTcpProxiesGetCall) Fields(s ...googleapi.Field) *RegionTargetTcpProxiesGetCall {
- 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 *RegionTargetTcpProxiesGetCall) IfNoneMatch(entityTag string) *RegionTargetTcpProxiesGetCall {
- 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 *RegionTargetTcpProxiesGetCall) Context(ctx context.Context) *RegionTargetTcpProxiesGetCall {
- 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 *RegionTargetTcpProxiesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionTargetTcpProxiesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/targetTcpProxies/{targetTcpProxy}")
- 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{
- "project": c.project,
- "region": c.region,
- "targetTcpProxy": c.targetTcpProxy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionTargetTcpProxies.get" call.
-// Exactly one of *TargetTcpProxy or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *TargetTcpProxy.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 *RegionTargetTcpProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetTcpProxy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TargetTcpProxy{
- 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": "Returns the specified TargetTcpProxy resource.",
- // "flatPath": "projects/{project}/regions/{region}/targetTcpProxies/{targetTcpProxy}",
- // "httpMethod": "GET",
- // "id": "compute.regionTargetTcpProxies.get",
- // "parameterOrder": [
- // "project",
- // "region",
- // "targetTcpProxy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "targetTcpProxy": {
- // "description": "Name of the TargetTcpProxy resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/targetTcpProxies/{targetTcpProxy}",
- // "response": {
- // "$ref": "TargetTcpProxy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.regionTargetTcpProxies.insert":
-
-type RegionTargetTcpProxiesInsertCall struct {
- s *Service
- project string
- region string
- targettcpproxy *TargetTcpProxy
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a TargetTcpProxy resource in the specified project
-// and region using the data included in the request.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionTargetTcpProxiesService) Insert(project string, region string, targettcpproxy *TargetTcpProxy) *RegionTargetTcpProxiesInsertCall {
- c := &RegionTargetTcpProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.targettcpproxy = targettcpproxy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RegionTargetTcpProxiesInsertCall) RequestId(requestId string) *RegionTargetTcpProxiesInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionTargetTcpProxiesInsertCall) Fields(s ...googleapi.Field) *RegionTargetTcpProxiesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionTargetTcpProxiesInsertCall) Context(ctx context.Context) *RegionTargetTcpProxiesInsertCall {
- 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 *RegionTargetTcpProxiesInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionTargetTcpProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxy)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetTcpProxies")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionTargetTcpProxies.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionTargetTcpProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a TargetTcpProxy resource in the specified project and region using the data included in the request.",
- // "flatPath": "projects/{project}/regions/{region}/targetTcpProxies",
- // "httpMethod": "POST",
- // "id": "compute.regionTargetTcpProxies.insert",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/targetTcpProxies",
- // "request": {
- // "$ref": "TargetTcpProxy"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionTargetTcpProxies.list":
-
-type RegionTargetTcpProxiesListCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves a list of TargetTcpProxy resources available to the
-// specified project in a given region.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionTargetTcpProxiesService) List(project string, region string) *RegionTargetTcpProxiesListCall {
- c := &RegionTargetTcpProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *RegionTargetTcpProxiesListCall) Filter(filter string) *RegionTargetTcpProxiesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *RegionTargetTcpProxiesListCall) MaxResults(maxResults int64) *RegionTargetTcpProxiesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *RegionTargetTcpProxiesListCall) OrderBy(orderBy string) *RegionTargetTcpProxiesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *RegionTargetTcpProxiesListCall) PageToken(pageToken string) *RegionTargetTcpProxiesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *RegionTargetTcpProxiesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionTargetTcpProxiesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *RegionTargetTcpProxiesListCall) Fields(s ...googleapi.Field) *RegionTargetTcpProxiesListCall {
- 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 *RegionTargetTcpProxiesListCall) IfNoneMatch(entityTag string) *RegionTargetTcpProxiesListCall {
- 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 *RegionTargetTcpProxiesListCall) Context(ctx context.Context) *RegionTargetTcpProxiesListCall {
- 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 *RegionTargetTcpProxiesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionTargetTcpProxiesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/targetTcpProxies")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionTargetTcpProxies.list" call.
-// Exactly one of *TargetTcpProxyList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *TargetTcpProxyList.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 *RegionTargetTcpProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetTcpProxyList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TargetTcpProxyList{
- 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": "Retrieves a list of TargetTcpProxy resources available to the specified project in a given region.",
- // "flatPath": "projects/{project}/regions/{region}/targetTcpProxies",
- // "httpMethod": "GET",
- // "id": "compute.regionTargetTcpProxies.list",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/targetTcpProxies",
- // "response": {
- // "$ref": "TargetTcpProxyList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *RegionTargetTcpProxiesListCall) Pages(ctx context.Context, f func(*TargetTcpProxyList) 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 "compute.regionUrlMaps.delete":
-
-type RegionUrlMapsDeleteCall struct {
- s *Service
- project string
- region string
- urlMap string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified UrlMap resource.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-// - urlMap: Name of the UrlMap resource to delete.
-func (r *RegionUrlMapsService) Delete(project string, region string, urlMap string) *RegionUrlMapsDeleteCall {
- c := &RegionUrlMapsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.urlMap = urlMap
- return c
-}
-
-// RequestId sets the optional parameter "requestId": begin_interface:
-// MixerMutationRequestBuilder Request ID to support idempotency.
-func (c *RegionUrlMapsDeleteCall) RequestId(requestId string) *RegionUrlMapsDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionUrlMapsDeleteCall) Fields(s ...googleapi.Field) *RegionUrlMapsDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionUrlMapsDeleteCall) Context(ctx context.Context) *RegionUrlMapsDeleteCall {
- 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 *RegionUrlMapsDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionUrlMapsDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/urlMaps/{urlMap}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "urlMap": c.urlMap,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionUrlMaps.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionUrlMapsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified UrlMap resource.",
- // "flatPath": "projects/{project}/regions/{region}/urlMaps/{urlMap}",
- // "httpMethod": "DELETE",
- // "id": "compute.regionUrlMaps.delete",
- // "parameterOrder": [
- // "project",
- // "region",
- // "urlMap"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.",
- // "location": "query",
- // "type": "string"
- // },
- // "urlMap": {
- // "description": "Name of the UrlMap resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/urlMaps/{urlMap}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionUrlMaps.get":
-
-type RegionUrlMapsGetCall struct {
- s *Service
- project string
- region string
- urlMap string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified UrlMap resource.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-// - urlMap: Name of the UrlMap resource to return.
-func (r *RegionUrlMapsService) Get(project string, region string, urlMap string) *RegionUrlMapsGetCall {
- c := &RegionUrlMapsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.urlMap = urlMap
- 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 *RegionUrlMapsGetCall) Fields(s ...googleapi.Field) *RegionUrlMapsGetCall {
- 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 *RegionUrlMapsGetCall) IfNoneMatch(entityTag string) *RegionUrlMapsGetCall {
- 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 *RegionUrlMapsGetCall) Context(ctx context.Context) *RegionUrlMapsGetCall {
- 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 *RegionUrlMapsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionUrlMapsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/urlMaps/{urlMap}")
- 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{
- "project": c.project,
- "region": c.region,
- "urlMap": c.urlMap,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionUrlMaps.get" call.
-// Exactly one of *UrlMap or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *UrlMap.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 *RegionUrlMapsGetCall) Do(opts ...googleapi.CallOption) (*UrlMap, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &UrlMap{
- 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": "Returns the specified UrlMap resource.",
- // "flatPath": "projects/{project}/regions/{region}/urlMaps/{urlMap}",
- // "httpMethod": "GET",
- // "id": "compute.regionUrlMaps.get",
- // "parameterOrder": [
- // "project",
- // "region",
- // "urlMap"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "urlMap": {
- // "description": "Name of the UrlMap resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/urlMaps/{urlMap}",
- // "response": {
- // "$ref": "UrlMap"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.regionUrlMaps.insert":
-
-type RegionUrlMapsInsertCall struct {
- s *Service
- project string
- region string
- urlmap *UrlMap
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a UrlMap resource in the specified project using the
-// data included in the request.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionUrlMapsService) Insert(project string, region string, urlmap *UrlMap) *RegionUrlMapsInsertCall {
- c := &RegionUrlMapsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.urlmap = urlmap
- return c
-}
-
-// RequestId sets the optional parameter "requestId": begin_interface:
-// MixerMutationRequestBuilder Request ID to support idempotency.
-func (c *RegionUrlMapsInsertCall) RequestId(requestId string) *RegionUrlMapsInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionUrlMapsInsertCall) Fields(s ...googleapi.Field) *RegionUrlMapsInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionUrlMapsInsertCall) Context(ctx context.Context) *RegionUrlMapsInsertCall {
- 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 *RegionUrlMapsInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionUrlMapsInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/urlMaps")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionUrlMaps.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionUrlMapsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a UrlMap resource in the specified project using the data included in the request.",
- // "flatPath": "projects/{project}/regions/{region}/urlMaps",
- // "httpMethod": "POST",
- // "id": "compute.regionUrlMaps.insert",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/urlMaps",
- // "request": {
- // "$ref": "UrlMap"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionUrlMaps.list":
-
-type RegionUrlMapsListCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves the list of UrlMap resources available to the
-// specified project in the specified region.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *RegionUrlMapsService) List(project string, region string) *RegionUrlMapsListCall {
- c := &RegionUrlMapsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *RegionUrlMapsListCall) Filter(filter string) *RegionUrlMapsListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *RegionUrlMapsListCall) MaxResults(maxResults int64) *RegionUrlMapsListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *RegionUrlMapsListCall) OrderBy(orderBy string) *RegionUrlMapsListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *RegionUrlMapsListCall) PageToken(pageToken string) *RegionUrlMapsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *RegionUrlMapsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionUrlMapsListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *RegionUrlMapsListCall) Fields(s ...googleapi.Field) *RegionUrlMapsListCall {
- 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 *RegionUrlMapsListCall) IfNoneMatch(entityTag string) *RegionUrlMapsListCall {
- 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 *RegionUrlMapsListCall) Context(ctx context.Context) *RegionUrlMapsListCall {
- 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 *RegionUrlMapsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionUrlMapsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/urlMaps")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionUrlMaps.list" call.
-// Exactly one of *UrlMapList or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *UrlMapList.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 *RegionUrlMapsListCall) Do(opts ...googleapi.CallOption) (*UrlMapList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &UrlMapList{
- 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": "Retrieves the list of UrlMap resources available to the specified project in the specified region.",
- // "flatPath": "projects/{project}/regions/{region}/urlMaps",
- // "httpMethod": "GET",
- // "id": "compute.regionUrlMaps.list",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/urlMaps",
- // "response": {
- // "$ref": "UrlMapList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *RegionUrlMapsListCall) Pages(ctx context.Context, f func(*UrlMapList) 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 "compute.regionUrlMaps.patch":
-
-type RegionUrlMapsPatchCall struct {
- s *Service
- project string
- region string
- urlMap string
- urlmap *UrlMap
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Patches the specified UrlMap resource with the data included
-// in the request. This method supports PATCH semantics and uses JSON
-// merge patch format and processing rules.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-// - urlMap: Name of the UrlMap resource to patch.
-func (r *RegionUrlMapsService) Patch(project string, region string, urlMap string, urlmap *UrlMap) *RegionUrlMapsPatchCall {
- c := &RegionUrlMapsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.urlMap = urlMap
- c.urlmap = urlmap
- return c
-}
-
-// RequestId sets the optional parameter "requestId": begin_interface:
-// MixerMutationRequestBuilder Request ID to support idempotency.
-func (c *RegionUrlMapsPatchCall) RequestId(requestId string) *RegionUrlMapsPatchCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionUrlMapsPatchCall) Fields(s ...googleapi.Field) *RegionUrlMapsPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionUrlMapsPatchCall) Context(ctx context.Context) *RegionUrlMapsPatchCall {
- 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 *RegionUrlMapsPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionUrlMapsPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/urlMaps/{urlMap}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "urlMap": c.urlMap,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionUrlMaps.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionUrlMapsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules.",
- // "flatPath": "projects/{project}/regions/{region}/urlMaps/{urlMap}",
- // "httpMethod": "PATCH",
- // "id": "compute.regionUrlMaps.patch",
- // "parameterOrder": [
- // "project",
- // "region",
- // "urlMap"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.",
- // "location": "query",
- // "type": "string"
- // },
- // "urlMap": {
- // "description": "Name of the UrlMap resource to patch.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/urlMaps/{urlMap}",
- // "request": {
- // "$ref": "UrlMap"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionUrlMaps.update":
-
-type RegionUrlMapsUpdateCall struct {
- s *Service
- project string
- region string
- urlMap string
- urlmap *UrlMap
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Update: Updates the specified UrlMap resource with the data included
-// in the request.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-// - urlMap: Name of the UrlMap resource to update.
-func (r *RegionUrlMapsService) Update(project string, region string, urlMap string, urlmap *UrlMap) *RegionUrlMapsUpdateCall {
- c := &RegionUrlMapsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.urlMap = urlMap
- c.urlmap = urlmap
- return c
-}
-
-// RequestId sets the optional parameter "requestId": begin_interface:
-// MixerMutationRequestBuilder Request ID to support idempotency.
-func (c *RegionUrlMapsUpdateCall) RequestId(requestId string) *RegionUrlMapsUpdateCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RegionUrlMapsUpdateCall) Fields(s ...googleapi.Field) *RegionUrlMapsUpdateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionUrlMapsUpdateCall) Context(ctx context.Context) *RegionUrlMapsUpdateCall {
- 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 *RegionUrlMapsUpdateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionUrlMapsUpdateCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/urlMaps/{urlMap}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PUT", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "urlMap": c.urlMap,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionUrlMaps.update" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RegionUrlMapsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Updates the specified UrlMap resource with the data included in the request.",
- // "flatPath": "projects/{project}/regions/{region}/urlMaps/{urlMap}",
- // "httpMethod": "PUT",
- // "id": "compute.regionUrlMaps.update",
- // "parameterOrder": [
- // "project",
- // "region",
- // "urlMap"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.",
- // "location": "query",
- // "type": "string"
- // },
- // "urlMap": {
- // "description": "Name of the UrlMap resource to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/urlMaps/{urlMap}",
- // "request": {
- // "$ref": "UrlMap"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionUrlMaps.validate":
-
-type RegionUrlMapsValidateCall struct {
- s *Service
- project string
- region string
- urlMap string
- regionurlmapsvalidaterequest *RegionUrlMapsValidateRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Validate: Runs static validation for the UrlMap. In particular, the
-// tests of the provided UrlMap will be run. Calling this method does
-// NOT create the UrlMap.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-// - urlMap: Name of the UrlMap resource to be validated as.
-func (r *RegionUrlMapsService) Validate(project string, region string, urlMap string, regionurlmapsvalidaterequest *RegionUrlMapsValidateRequest) *RegionUrlMapsValidateCall {
- c := &RegionUrlMapsValidateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.urlMap = urlMap
- c.regionurlmapsvalidaterequest = regionurlmapsvalidaterequest
- 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 *RegionUrlMapsValidateCall) Fields(s ...googleapi.Field) *RegionUrlMapsValidateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RegionUrlMapsValidateCall) Context(ctx context.Context) *RegionUrlMapsValidateCall {
- 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 *RegionUrlMapsValidateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionUrlMapsValidateCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionurlmapsvalidaterequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/urlMaps/{urlMap}/validate")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "urlMap": c.urlMap,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionUrlMaps.validate" call.
-// Exactly one of *UrlMapsValidateResponse or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *UrlMapsValidateResponse.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 *RegionUrlMapsValidateCall) Do(opts ...googleapi.CallOption) (*UrlMapsValidateResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &UrlMapsValidateResponse{
- 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": "Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap.",
- // "flatPath": "projects/{project}/regions/{region}/urlMaps/{urlMap}/validate",
- // "httpMethod": "POST",
- // "id": "compute.regionUrlMaps.validate",
- // "parameterOrder": [
- // "project",
- // "region",
- // "urlMap"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "urlMap": {
- // "description": "Name of the UrlMap resource to be validated as.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/urlMaps/{urlMap}/validate",
- // "request": {
- // "$ref": "RegionUrlMapsValidateRequest"
- // },
- // "response": {
- // "$ref": "UrlMapsValidateResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.regionZones.list":
-
-type RegionZonesListCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves the list of Zone resources under the specific region
-// available to the specified project.
-//
-// - project: Project ID for this request.
-// - region: Region for this request.
-func (r *RegionZonesService) List(project string, region string) *RegionZonesListCall {
- c := &RegionZonesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *RegionZonesListCall) Filter(filter string) *RegionZonesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *RegionZonesListCall) MaxResults(maxResults int64) *RegionZonesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *RegionZonesListCall) OrderBy(orderBy string) *RegionZonesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *RegionZonesListCall) PageToken(pageToken string) *RegionZonesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *RegionZonesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionZonesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *RegionZonesListCall) Fields(s ...googleapi.Field) *RegionZonesListCall {
- 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 *RegionZonesListCall) IfNoneMatch(entityTag string) *RegionZonesListCall {
- 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 *RegionZonesListCall) Context(ctx context.Context) *RegionZonesListCall {
- 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 *RegionZonesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionZonesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/zones")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regionZones.list" call.
-// Exactly one of *ZoneList or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *ZoneList.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 *RegionZonesListCall) Do(opts ...googleapi.CallOption) (*ZoneList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &ZoneList{
- 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": "Retrieves the list of Zone resources under the specific region available to the specified project.",
- // "flatPath": "projects/{project}/regions/{region}/zones",
- // "httpMethod": "GET",
- // "id": "compute.regionZones.list",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/zones",
- // "response": {
- // "$ref": "ZoneList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *RegionZonesListCall) Pages(ctx context.Context, f func(*ZoneList) 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 "compute.regions.get":
-
-type RegionsGetCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified Region resource. To decrease latency for
-// this method, you can optionally omit any unneeded information from
-// the response by using a field mask. This practice is especially
-// recommended for unused quota information (the `quotas` field). To
-// exclude one or more fields, set your request's `fields` query
-// parameter to only include the fields you need. For example, to only
-// include the `id` and `selfLink` fields, add the query parameter
-// `?fields=id,selfLink` to your request.
-//
-// - project: Project ID for this request.
-// - region: Name of the region resource to return.
-func (r *RegionsService) Get(project string, region string) *RegionsGetCall {
- c := &RegionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- 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 *RegionsGetCall) Fields(s ...googleapi.Field) *RegionsGetCall {
- 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 *RegionsGetCall) IfNoneMatch(entityTag string) *RegionsGetCall {
- 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 *RegionsGetCall) Context(ctx context.Context) *RegionsGetCall {
- 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 *RegionsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regions.get" call.
-// Exactly one of *Region or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Region.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 *RegionsGetCall) Do(opts ...googleapi.CallOption) (*Region, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Region{
- 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": "Returns the specified Region resource. To decrease latency for this method, you can optionally omit any unneeded information from the response by using a field mask. This practice is especially recommended for unused quota information (the `quotas` field). To exclude one or more fields, set your request's `fields` query parameter to only include the fields you need. For example, to only include the `id` and `selfLink` fields, add the query parameter `?fields=id,selfLink` to your request.",
- // "flatPath": "projects/{project}/regions/{region}",
- // "httpMethod": "GET",
- // "id": "compute.regions.get",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}",
- // "response": {
- // "$ref": "Region"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.regions.list":
-
-type RegionsListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves the list of region resources available to the
-// specified project. To decrease latency for this method, you can
-// optionally omit any unneeded information from the response by using a
-// field mask. This practice is especially recommended for unused quota
-// information (the `items.quotas` field). To exclude one or more
-// fields, set your request's `fields` query parameter to only include
-// the fields you need. For example, to only include the `id` and
-// `selfLink` fields, add the query parameter `?fields=id,selfLink` to
-// your request.
-//
-// - project: Project ID for this request.
-func (r *RegionsService) List(project string) *RegionsListCall {
- c := &RegionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *RegionsListCall) Filter(filter string) *RegionsListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *RegionsListCall) MaxResults(maxResults int64) *RegionsListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *RegionsListCall) OrderBy(orderBy string) *RegionsListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *RegionsListCall) PageToken(pageToken string) *RegionsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *RegionsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionsListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *RegionsListCall) Fields(s ...googleapi.Field) *RegionsListCall {
- 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 *RegionsListCall) IfNoneMatch(entityTag string) *RegionsListCall {
- 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 *RegionsListCall) Context(ctx context.Context) *RegionsListCall {
- 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 *RegionsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RegionsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.regions.list" call.
-// Exactly one of *RegionList or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *RegionList.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 *RegionsListCall) Do(opts ...googleapi.CallOption) (*RegionList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &RegionList{
- 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": "Retrieves the list of region resources available to the specified project. To decrease latency for this method, you can optionally omit any unneeded information from the response by using a field mask. This practice is especially recommended for unused quota information (the `items.quotas` field). To exclude one or more fields, set your request's `fields` query parameter to only include the fields you need. For example, to only include the `id` and `selfLink` fields, add the query parameter `?fields=id,selfLink` to your request.",
- // "flatPath": "projects/{project}/regions",
- // "httpMethod": "GET",
- // "id": "compute.regions.list",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions",
- // "response": {
- // "$ref": "RegionList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *RegionsListCall) Pages(ctx context.Context, f func(*RegionList) 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 "compute.reservations.aggregatedList":
-
-type ReservationsAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Retrieves an aggregated list of reservations.
-//
-// - project: Project ID for this request.
-func (r *ReservationsService) AggregatedList(project string) *ReservationsAggregatedListCall {
- c := &ReservationsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *ReservationsAggregatedListCall) Filter(filter string) *ReservationsAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *ReservationsAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *ReservationsAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *ReservationsAggregatedListCall) MaxResults(maxResults int64) *ReservationsAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *ReservationsAggregatedListCall) OrderBy(orderBy string) *ReservationsAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *ReservationsAggregatedListCall) PageToken(pageToken string) *ReservationsAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *ReservationsAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ReservationsAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *ReservationsAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *ReservationsAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *ReservationsAggregatedListCall) Fields(s ...googleapi.Field) *ReservationsAggregatedListCall {
- 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 *ReservationsAggregatedListCall) IfNoneMatch(entityTag string) *ReservationsAggregatedListCall {
- 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 *ReservationsAggregatedListCall) Context(ctx context.Context) *ReservationsAggregatedListCall {
- 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 *ReservationsAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ReservationsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/reservations")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.reservations.aggregatedList" call.
-// Exactly one of *ReservationAggregatedList or error will be non-nil.
-// Any non-2xx status code is an error. Response headers are in either
-// *ReservationAggregatedList.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 *ReservationsAggregatedListCall) Do(opts ...googleapi.CallOption) (*ReservationAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &ReservationAggregatedList{
- 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": "Retrieves an aggregated list of reservations.",
- // "flatPath": "projects/{project}/aggregated/reservations",
- // "httpMethod": "GET",
- // "id": "compute.reservations.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/reservations",
- // "response": {
- // "$ref": "ReservationAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *ReservationsAggregatedListCall) Pages(ctx context.Context, f func(*ReservationAggregatedList) 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 "compute.reservations.delete":
-
-type ReservationsDeleteCall struct {
- s *Service
- project string
- zone string
- reservation string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified reservation.
-//
-// - project: Project ID for this request.
-// - reservation: Name of the reservation to delete.
-// - zone: Name of the zone for this request.
-func (r *ReservationsService) Delete(project string, zone string, reservation string) *ReservationsDeleteCall {
- c := &ReservationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.reservation = reservation
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *ReservationsDeleteCall) RequestId(requestId string) *ReservationsDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *ReservationsDeleteCall) Fields(s ...googleapi.Field) *ReservationsDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ReservationsDeleteCall) Context(ctx context.Context) *ReservationsDeleteCall {
- 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 *ReservationsDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ReservationsDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/reservations/{reservation}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "reservation": c.reservation,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.reservations.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *ReservationsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified reservation.",
- // "flatPath": "projects/{project}/zones/{zone}/reservations/{reservation}",
- // "httpMethod": "DELETE",
- // "id": "compute.reservations.delete",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "reservation"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "reservation": {
- // "description": "Name of the reservation to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "Name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/reservations/{reservation}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.reservations.get":
-
-type ReservationsGetCall struct {
- s *Service
- project string
- zone string
- reservation string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Retrieves information about the specified reservation.
-//
-// - project: Project ID for this request.
-// - reservation: Name of the reservation to retrieve.
-// - zone: Name of the zone for this request.
-func (r *ReservationsService) Get(project string, zone string, reservation string) *ReservationsGetCall {
- c := &ReservationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.reservation = reservation
- 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 *ReservationsGetCall) Fields(s ...googleapi.Field) *ReservationsGetCall {
- 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 *ReservationsGetCall) IfNoneMatch(entityTag string) *ReservationsGetCall {
- 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 *ReservationsGetCall) Context(ctx context.Context) *ReservationsGetCall {
- 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 *ReservationsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ReservationsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}/reservations/{reservation}")
- 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{
- "project": c.project,
- "zone": c.zone,
- "reservation": c.reservation,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.reservations.get" call.
-// Exactly one of *Reservation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Reservation.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 *ReservationsGetCall) Do(opts ...googleapi.CallOption) (*Reservation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Reservation{
- 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": "Retrieves information about the specified reservation.",
- // "flatPath": "projects/{project}/zones/{zone}/reservations/{reservation}",
- // "httpMethod": "GET",
- // "id": "compute.reservations.get",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "reservation"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "reservation": {
- // "description": "Name of the reservation to retrieve.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "Name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/reservations/{reservation}",
- // "response": {
- // "$ref": "Reservation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.reservations.getIamPolicy":
-
-type ReservationsGetIamPolicyCall struct {
- s *Service
- project string
- zone string
- resource string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetIamPolicy: Gets the access control policy for a resource. May be
-// empty if no such policy or resource exists.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-// - zone: The name of the zone for this request.
-func (r *ReservationsService) GetIamPolicy(project string, zone string, resource string) *ReservationsGetIamPolicyCall {
- c := &ReservationsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.resource = resource
- return c
-}
-
-// OptionsRequestedPolicyVersion sets the optional parameter
-// "optionsRequestedPolicyVersion": Requested IAM Policy version.
-func (c *ReservationsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ReservationsGetIamPolicyCall {
- c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
- 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 *ReservationsGetIamPolicyCall) Fields(s ...googleapi.Field) *ReservationsGetIamPolicyCall {
- 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 *ReservationsGetIamPolicyCall) IfNoneMatch(entityTag string) *ReservationsGetIamPolicyCall {
- 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 *ReservationsGetIamPolicyCall) Context(ctx context.Context) *ReservationsGetIamPolicyCall {
- 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 *ReservationsGetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ReservationsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}/reservations/{resource}/getIamPolicy")
- 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{
- "project": c.project,
- "zone": c.zone,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.reservations.getIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *ReservationsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
- // "flatPath": "projects/{project}/zones/{zone}/reservations/{resource}/getIamPolicy",
- // "httpMethod": "GET",
- // "id": "compute.reservations.getIamPolicy",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "resource"
- // ],
- // "parameters": {
- // "optionsRequestedPolicyVersion": {
- // "description": "Requested IAM Policy version.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/reservations/{resource}/getIamPolicy",
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.reservations.insert":
-
-type ReservationsInsertCall struct {
- s *Service
- project string
- zone string
- reservation *Reservation
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a new reservation. For more information, read
-// Reserving zonal resources.
-//
-// - project: Project ID for this request.
-// - zone: Name of the zone for this request.
-func (r *ReservationsService) Insert(project string, zone string, reservation *Reservation) *ReservationsInsertCall {
- c := &ReservationsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.reservation = reservation
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *ReservationsInsertCall) RequestId(requestId string) *ReservationsInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *ReservationsInsertCall) Fields(s ...googleapi.Field) *ReservationsInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ReservationsInsertCall) Context(ctx context.Context) *ReservationsInsertCall {
- 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 *ReservationsInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ReservationsInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.reservation)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/reservations")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.reservations.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *ReservationsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a new reservation. For more information, read Reserving zonal resources.",
- // "flatPath": "projects/{project}/zones/{zone}/reservations",
- // "httpMethod": "POST",
- // "id": "compute.reservations.insert",
- // "parameterOrder": [
- // "project",
- // "zone"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "Name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/reservations",
- // "request": {
- // "$ref": "Reservation"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.reservations.list":
-
-type ReservationsListCall struct {
- s *Service
- project string
- zone string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: A list of all the reservations that have been configured for
-// the specified project in specified zone.
-//
-// - project: Project ID for this request.
-// - zone: Name of the zone for this request.
-func (r *ReservationsService) List(project string, zone string) *ReservationsListCall {
- c := &ReservationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *ReservationsListCall) Filter(filter string) *ReservationsListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *ReservationsListCall) MaxResults(maxResults int64) *ReservationsListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *ReservationsListCall) OrderBy(orderBy string) *ReservationsListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *ReservationsListCall) PageToken(pageToken string) *ReservationsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *ReservationsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ReservationsListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *ReservationsListCall) Fields(s ...googleapi.Field) *ReservationsListCall {
- 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 *ReservationsListCall) IfNoneMatch(entityTag string) *ReservationsListCall {
- 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 *ReservationsListCall) Context(ctx context.Context) *ReservationsListCall {
- 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 *ReservationsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ReservationsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}/reservations")
- 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{
- "project": c.project,
- "zone": c.zone,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.reservations.list" call.
-// Exactly one of *ReservationList or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *ReservationList.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 *ReservationsListCall) Do(opts ...googleapi.CallOption) (*ReservationList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &ReservationList{
- 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": "A list of all the reservations that have been configured for the specified project in specified zone.",
- // "flatPath": "projects/{project}/zones/{zone}/reservations",
- // "httpMethod": "GET",
- // "id": "compute.reservations.list",
- // "parameterOrder": [
- // "project",
- // "zone"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "zone": {
- // "description": "Name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/reservations",
- // "response": {
- // "$ref": "ReservationList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *ReservationsListCall) Pages(ctx context.Context, f func(*ReservationList) 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 "compute.reservations.resize":
-
-type ReservationsResizeCall struct {
- s *Service
- project string
- zone string
- reservation string
- reservationsresizerequest *ReservationsResizeRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Resize: Resizes the reservation (applicable to standalone
-// reservations only). For more information, read Modifying
-// reservations.
-//
-// - project: Project ID for this request.
-// - reservation: Name of the reservation to update.
-// - zone: Name of the zone for this request.
-func (r *ReservationsService) Resize(project string, zone string, reservation string, reservationsresizerequest *ReservationsResizeRequest) *ReservationsResizeCall {
- c := &ReservationsResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.reservation = reservation
- c.reservationsresizerequest = reservationsresizerequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *ReservationsResizeCall) RequestId(requestId string) *ReservationsResizeCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *ReservationsResizeCall) Fields(s ...googleapi.Field) *ReservationsResizeCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ReservationsResizeCall) Context(ctx context.Context) *ReservationsResizeCall {
- 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 *ReservationsResizeCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ReservationsResizeCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.reservationsresizerequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/reservations/{reservation}/resize")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "reservation": c.reservation,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.reservations.resize" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *ReservationsResizeCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Resizes the reservation (applicable to standalone reservations only). For more information, read Modifying reservations.",
- // "flatPath": "projects/{project}/zones/{zone}/reservations/{reservation}/resize",
- // "httpMethod": "POST",
- // "id": "compute.reservations.resize",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "reservation"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "reservation": {
- // "description": "Name of the reservation to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "Name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/reservations/{reservation}/resize",
- // "request": {
- // "$ref": "ReservationsResizeRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.reservations.setIamPolicy":
-
-type ReservationsSetIamPolicyCall struct {
- s *Service
- project string
- zone string
- resource string
- zonesetpolicyrequest *ZoneSetPolicyRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetIamPolicy: Sets the access control policy on the specified
-// resource. Replaces any existing policy.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-// - zone: The name of the zone for this request.
-func (r *ReservationsService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *ReservationsSetIamPolicyCall {
- c := &ReservationsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.resource = resource
- c.zonesetpolicyrequest = zonesetpolicyrequest
- 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 *ReservationsSetIamPolicyCall) Fields(s ...googleapi.Field) *ReservationsSetIamPolicyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ReservationsSetIamPolicyCall) Context(ctx context.Context) *ReservationsSetIamPolicyCall {
- 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 *ReservationsSetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ReservationsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/reservations/{resource}/setIamPolicy")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.reservations.setIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *ReservationsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Sets the access control policy on the specified resource. Replaces any existing policy.",
- // "flatPath": "projects/{project}/zones/{zone}/reservations/{resource}/setIamPolicy",
- // "httpMethod": "POST",
- // "id": "compute.reservations.setIamPolicy",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/reservations/{resource}/setIamPolicy",
- // "request": {
- // "$ref": "ZoneSetPolicyRequest"
- // },
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.reservations.testIamPermissions":
-
-type ReservationsTestIamPermissionsCall struct {
- s *Service
- project string
- zone string
- resource string
- testpermissionsrequest *TestPermissionsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// TestIamPermissions: Returns permissions that a caller has on the
-// specified resource.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-// - zone: The name of the zone for this request.
-func (r *ReservationsService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *ReservationsTestIamPermissionsCall {
- c := &ReservationsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.resource = resource
- c.testpermissionsrequest = testpermissionsrequest
- 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 *ReservationsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ReservationsTestIamPermissionsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ReservationsTestIamPermissionsCall) Context(ctx context.Context) *ReservationsTestIamPermissionsCall {
- 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 *ReservationsTestIamPermissionsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ReservationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/reservations/{resource}/testIamPermissions")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.reservations.testIamPermissions" call.
-// Exactly one of *TestPermissionsResponse or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *TestPermissionsResponse.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 *ReservationsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TestPermissionsResponse{
- 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": "Returns permissions that a caller has on the specified resource.",
- // "flatPath": "projects/{project}/zones/{zone}/reservations/{resource}/testIamPermissions",
- // "httpMethod": "POST",
- // "id": "compute.reservations.testIamPermissions",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "The name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/reservations/{resource}/testIamPermissions",
- // "request": {
- // "$ref": "TestPermissionsRequest"
- // },
- // "response": {
- // "$ref": "TestPermissionsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.reservations.update":
-
-type ReservationsUpdateCall struct {
- s *Service
- project string
- zone string
- reservation string
- reservation2 *Reservation
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Update: Update share settings of the reservation.
-//
-// - project: Project ID for this request.
-// - reservation: Name of the reservation to update.
-// - zone: Name of the zone for this request.
-func (r *ReservationsService) Update(project string, zone string, reservation string, reservation2 *Reservation) *ReservationsUpdateCall {
- c := &ReservationsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.reservation = reservation
- c.reservation2 = reservation2
- return c
-}
-
-// Paths sets the optional parameter "paths":
-func (c *ReservationsUpdateCall) Paths(paths ...string) *ReservationsUpdateCall {
- c.urlParams_.SetMulti("paths", append([]string{}, paths...))
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *ReservationsUpdateCall) RequestId(requestId string) *ReservationsUpdateCall {
- c.urlParams_.Set("requestId", requestId)
- return c
-}
-
-// UpdateMask sets the optional parameter "updateMask": Update_mask
-// indicates fields to be updated as part of this request.
-func (c *ReservationsUpdateCall) UpdateMask(updateMask string) *ReservationsUpdateCall {
- c.urlParams_.Set("updateMask", updateMask)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *ReservationsUpdateCall) Fields(s ...googleapi.Field) *ReservationsUpdateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ReservationsUpdateCall) Context(ctx context.Context) *ReservationsUpdateCall {
- 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 *ReservationsUpdateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ReservationsUpdateCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.reservation2)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/reservations/{reservation}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "reservation": c.reservation,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.reservations.update" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *ReservationsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Update share settings of the reservation.",
- // "flatPath": "projects/{project}/zones/{zone}/reservations/{reservation}",
- // "httpMethod": "PATCH",
- // "id": "compute.reservations.update",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "reservation"
- // ],
- // "parameters": {
- // "paths": {
- // "location": "query",
- // "repeated": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "reservation": {
- // "description": "Name of the reservation to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "updateMask": {
- // "description": "Update_mask indicates fields to be updated as part of this request.",
- // "format": "google-fieldmask",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "Name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/reservations/{reservation}",
- // "request": {
- // "$ref": "Reservation"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.resourcePolicies.aggregatedList":
-
-type ResourcePoliciesAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Retrieves an aggregated list of resource policies.
-//
-// - project: Project ID for this request.
-func (r *ResourcePoliciesService) AggregatedList(project string) *ResourcePoliciesAggregatedListCall {
- c := &ResourcePoliciesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *ResourcePoliciesAggregatedListCall) Filter(filter string) *ResourcePoliciesAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *ResourcePoliciesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *ResourcePoliciesAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *ResourcePoliciesAggregatedListCall) MaxResults(maxResults int64) *ResourcePoliciesAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *ResourcePoliciesAggregatedListCall) OrderBy(orderBy string) *ResourcePoliciesAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *ResourcePoliciesAggregatedListCall) PageToken(pageToken string) *ResourcePoliciesAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *ResourcePoliciesAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ResourcePoliciesAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *ResourcePoliciesAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *ResourcePoliciesAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *ResourcePoliciesAggregatedListCall) Fields(s ...googleapi.Field) *ResourcePoliciesAggregatedListCall {
- 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 *ResourcePoliciesAggregatedListCall) IfNoneMatch(entityTag string) *ResourcePoliciesAggregatedListCall {
- 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 *ResourcePoliciesAggregatedListCall) Context(ctx context.Context) *ResourcePoliciesAggregatedListCall {
- 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 *ResourcePoliciesAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ResourcePoliciesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/resourcePolicies")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.resourcePolicies.aggregatedList" call.
-// Exactly one of *ResourcePolicyAggregatedList or error will be
-// non-nil. Any non-2xx status code is an error. Response headers are in
-// either *ResourcePolicyAggregatedList.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 *ResourcePoliciesAggregatedListCall) Do(opts ...googleapi.CallOption) (*ResourcePolicyAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &ResourcePolicyAggregatedList{
- 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": "Retrieves an aggregated list of resource policies.",
- // "flatPath": "projects/{project}/aggregated/resourcePolicies",
- // "httpMethod": "GET",
- // "id": "compute.resourcePolicies.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/resourcePolicies",
- // "response": {
- // "$ref": "ResourcePolicyAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *ResourcePoliciesAggregatedListCall) Pages(ctx context.Context, f func(*ResourcePolicyAggregatedList) 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 "compute.resourcePolicies.delete":
-
-type ResourcePoliciesDeleteCall struct {
- s *Service
- project string
- region string
- resourcePolicy string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified resource policy.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-// - resourcePolicy: Name of the resource policy to delete.
-func (r *ResourcePoliciesService) Delete(project string, region string, resourcePolicy string) *ResourcePoliciesDeleteCall {
- c := &ResourcePoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.resourcePolicy = resourcePolicy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *ResourcePoliciesDeleteCall) RequestId(requestId string) *ResourcePoliciesDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *ResourcePoliciesDeleteCall) Fields(s ...googleapi.Field) *ResourcePoliciesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ResourcePoliciesDeleteCall) Context(ctx context.Context) *ResourcePoliciesDeleteCall {
- 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 *ResourcePoliciesDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ResourcePoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/resourcePolicies/{resourcePolicy}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "resourcePolicy": c.resourcePolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.resourcePolicies.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *ResourcePoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified resource policy.",
- // "flatPath": "projects/{project}/regions/{region}/resourcePolicies/{resourcePolicy}",
- // "httpMethod": "DELETE",
- // "id": "compute.resourcePolicies.delete",
- // "parameterOrder": [
- // "project",
- // "region",
- // "resourcePolicy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "resourcePolicy": {
- // "description": "Name of the resource policy to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/resourcePolicies/{resourcePolicy}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.resourcePolicies.get":
-
-type ResourcePoliciesGetCall struct {
- s *Service
- project string
- region string
- resourcePolicy string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Retrieves all information of the specified resource policy.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-// - resourcePolicy: Name of the resource policy to retrieve.
-func (r *ResourcePoliciesService) Get(project string, region string, resourcePolicy string) *ResourcePoliciesGetCall {
- c := &ResourcePoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.resourcePolicy = resourcePolicy
- 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 *ResourcePoliciesGetCall) Fields(s ...googleapi.Field) *ResourcePoliciesGetCall {
- 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 *ResourcePoliciesGetCall) IfNoneMatch(entityTag string) *ResourcePoliciesGetCall {
- 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 *ResourcePoliciesGetCall) Context(ctx context.Context) *ResourcePoliciesGetCall {
- 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 *ResourcePoliciesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ResourcePoliciesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/resourcePolicies/{resourcePolicy}")
- 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{
- "project": c.project,
- "region": c.region,
- "resourcePolicy": c.resourcePolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.resourcePolicies.get" call.
-// Exactly one of *ResourcePolicy or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *ResourcePolicy.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 *ResourcePoliciesGetCall) Do(opts ...googleapi.CallOption) (*ResourcePolicy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &ResourcePolicy{
- 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": "Retrieves all information of the specified resource policy.",
- // "flatPath": "projects/{project}/regions/{region}/resourcePolicies/{resourcePolicy}",
- // "httpMethod": "GET",
- // "id": "compute.resourcePolicies.get",
- // "parameterOrder": [
- // "project",
- // "region",
- // "resourcePolicy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "resourcePolicy": {
- // "description": "Name of the resource policy to retrieve.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/resourcePolicies/{resourcePolicy}",
- // "response": {
- // "$ref": "ResourcePolicy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.resourcePolicies.getIamPolicy":
-
-type ResourcePoliciesGetIamPolicyCall struct {
- s *Service
- project string
- region string
- resource string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetIamPolicy: Gets the access control policy for a resource. May be
-// empty if no such policy or resource exists.
-//
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-// - resource: Name or id of the resource for this request.
-func (r *ResourcePoliciesService) GetIamPolicy(project string, region string, resource string) *ResourcePoliciesGetIamPolicyCall {
- c := &ResourcePoliciesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.resource = resource
- return c
-}
-
-// OptionsRequestedPolicyVersion sets the optional parameter
-// "optionsRequestedPolicyVersion": Requested IAM Policy version.
-func (c *ResourcePoliciesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ResourcePoliciesGetIamPolicyCall {
- c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
- 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 *ResourcePoliciesGetIamPolicyCall) Fields(s ...googleapi.Field) *ResourcePoliciesGetIamPolicyCall {
- 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 *ResourcePoliciesGetIamPolicyCall) IfNoneMatch(entityTag string) *ResourcePoliciesGetIamPolicyCall {
- 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 *ResourcePoliciesGetIamPolicyCall) Context(ctx context.Context) *ResourcePoliciesGetIamPolicyCall {
- 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 *ResourcePoliciesGetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ResourcePoliciesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/resourcePolicies/{resource}/getIamPolicy")
- 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{
- "project": c.project,
- "region": c.region,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.resourcePolicies.getIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *ResourcePoliciesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
- // "flatPath": "projects/{project}/regions/{region}/resourcePolicies/{resource}/getIamPolicy",
- // "httpMethod": "GET",
- // "id": "compute.resourcePolicies.getIamPolicy",
- // "parameterOrder": [
- // "project",
- // "region",
- // "resource"
- // ],
- // "parameters": {
- // "optionsRequestedPolicyVersion": {
- // "description": "Requested IAM Policy version.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/resourcePolicies/{resource}/getIamPolicy",
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.resourcePolicies.insert":
-
-type ResourcePoliciesInsertCall struct {
- s *Service
- project string
- region string
- resourcepolicy *ResourcePolicy
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a new resource policy.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-func (r *ResourcePoliciesService) Insert(project string, region string, resourcepolicy *ResourcePolicy) *ResourcePoliciesInsertCall {
- c := &ResourcePoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.resourcepolicy = resourcepolicy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *ResourcePoliciesInsertCall) RequestId(requestId string) *ResourcePoliciesInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *ResourcePoliciesInsertCall) Fields(s ...googleapi.Field) *ResourcePoliciesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ResourcePoliciesInsertCall) Context(ctx context.Context) *ResourcePoliciesInsertCall {
- 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 *ResourcePoliciesInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ResourcePoliciesInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcepolicy)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/resourcePolicies")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.resourcePolicies.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *ResourcePoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a new resource policy.",
- // "flatPath": "projects/{project}/regions/{region}/resourcePolicies",
- // "httpMethod": "POST",
- // "id": "compute.resourcePolicies.insert",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/resourcePolicies",
- // "request": {
- // "$ref": "ResourcePolicy"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.resourcePolicies.list":
-
-type ResourcePoliciesListCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: A list all the resource policies that have been configured for
-// the specified project in specified region.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-func (r *ResourcePoliciesService) List(project string, region string) *ResourcePoliciesListCall {
- c := &ResourcePoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *ResourcePoliciesListCall) Filter(filter string) *ResourcePoliciesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *ResourcePoliciesListCall) MaxResults(maxResults int64) *ResourcePoliciesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *ResourcePoliciesListCall) OrderBy(orderBy string) *ResourcePoliciesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *ResourcePoliciesListCall) PageToken(pageToken string) *ResourcePoliciesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *ResourcePoliciesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ResourcePoliciesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *ResourcePoliciesListCall) Fields(s ...googleapi.Field) *ResourcePoliciesListCall {
- 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 *ResourcePoliciesListCall) IfNoneMatch(entityTag string) *ResourcePoliciesListCall {
- 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 *ResourcePoliciesListCall) Context(ctx context.Context) *ResourcePoliciesListCall {
- 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 *ResourcePoliciesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ResourcePoliciesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/resourcePolicies")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.resourcePolicies.list" call.
-// Exactly one of *ResourcePolicyList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *ResourcePolicyList.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 *ResourcePoliciesListCall) Do(opts ...googleapi.CallOption) (*ResourcePolicyList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &ResourcePolicyList{
- 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": "A list all the resource policies that have been configured for the specified project in specified region.",
- // "flatPath": "projects/{project}/regions/{region}/resourcePolicies",
- // "httpMethod": "GET",
- // "id": "compute.resourcePolicies.list",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/resourcePolicies",
- // "response": {
- // "$ref": "ResourcePolicyList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *ResourcePoliciesListCall) Pages(ctx context.Context, f func(*ResourcePolicyList) 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 "compute.resourcePolicies.patch":
-
-type ResourcePoliciesPatchCall struct {
- s *Service
- project string
- region string
- resourcePolicy string
- resourcepolicy *ResourcePolicy
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Modify the specified resource policy.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-// - resourcePolicy: Id of the resource policy to patch.
-func (r *ResourcePoliciesService) Patch(project string, region string, resourcePolicy string, resourcepolicy *ResourcePolicy) *ResourcePoliciesPatchCall {
- c := &ResourcePoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.resourcePolicy = resourcePolicy
- c.resourcepolicy = resourcepolicy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *ResourcePoliciesPatchCall) RequestId(requestId string) *ResourcePoliciesPatchCall {
- c.urlParams_.Set("requestId", requestId)
- return c
-}
-
-// UpdateMask sets the optional parameter "updateMask": update_mask
-// indicates fields to be updated as part of this request.
-func (c *ResourcePoliciesPatchCall) UpdateMask(updateMask string) *ResourcePoliciesPatchCall {
- c.urlParams_.Set("updateMask", updateMask)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *ResourcePoliciesPatchCall) Fields(s ...googleapi.Field) *ResourcePoliciesPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ResourcePoliciesPatchCall) Context(ctx context.Context) *ResourcePoliciesPatchCall {
- 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 *ResourcePoliciesPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ResourcePoliciesPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcepolicy)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/resourcePolicies/{resourcePolicy}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "resourcePolicy": c.resourcePolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.resourcePolicies.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *ResourcePoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Modify the specified resource policy.",
- // "flatPath": "projects/{project}/regions/{region}/resourcePolicies/{resourcePolicy}",
- // "httpMethod": "PATCH",
- // "id": "compute.resourcePolicies.patch",
- // "parameterOrder": [
- // "project",
- // "region",
- // "resourcePolicy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "resourcePolicy": {
- // "description": "Id of the resource policy to patch.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "updateMask": {
- // "description": "update_mask indicates fields to be updated as part of this request.",
- // "format": "google-fieldmask",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/resourcePolicies/{resourcePolicy}",
- // "request": {
- // "$ref": "ResourcePolicy"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.resourcePolicies.setIamPolicy":
-
-type ResourcePoliciesSetIamPolicyCall struct {
- s *Service
- project string
- region string
- resource string
- regionsetpolicyrequest *RegionSetPolicyRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetIamPolicy: Sets the access control policy on the specified
-// resource. Replaces any existing policy.
-//
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-// - resource: Name or id of the resource for this request.
-func (r *ResourcePoliciesService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *ResourcePoliciesSetIamPolicyCall {
- c := &ResourcePoliciesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.resource = resource
- c.regionsetpolicyrequest = regionsetpolicyrequest
- 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 *ResourcePoliciesSetIamPolicyCall) Fields(s ...googleapi.Field) *ResourcePoliciesSetIamPolicyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ResourcePoliciesSetIamPolicyCall) Context(ctx context.Context) *ResourcePoliciesSetIamPolicyCall {
- 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 *ResourcePoliciesSetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ResourcePoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/resourcePolicies/{resource}/setIamPolicy")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.resourcePolicies.setIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *ResourcePoliciesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Sets the access control policy on the specified resource. Replaces any existing policy.",
- // "flatPath": "projects/{project}/regions/{region}/resourcePolicies/{resource}/setIamPolicy",
- // "httpMethod": "POST",
- // "id": "compute.resourcePolicies.setIamPolicy",
- // "parameterOrder": [
- // "project",
- // "region",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/resourcePolicies/{resource}/setIamPolicy",
- // "request": {
- // "$ref": "RegionSetPolicyRequest"
- // },
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.resourcePolicies.testIamPermissions":
-
-type ResourcePoliciesTestIamPermissionsCall struct {
- s *Service
- project string
- region string
- resource string
- testpermissionsrequest *TestPermissionsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// TestIamPermissions: Returns permissions that a caller has on the
-// specified resource.
-//
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-// - resource: Name or id of the resource for this request.
-func (r *ResourcePoliciesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *ResourcePoliciesTestIamPermissionsCall {
- c := &ResourcePoliciesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.resource = resource
- c.testpermissionsrequest = testpermissionsrequest
- 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 *ResourcePoliciesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ResourcePoliciesTestIamPermissionsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ResourcePoliciesTestIamPermissionsCall) Context(ctx context.Context) *ResourcePoliciesTestIamPermissionsCall {
- 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 *ResourcePoliciesTestIamPermissionsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ResourcePoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/resourcePolicies/{resource}/testIamPermissions")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.resourcePolicies.testIamPermissions" call.
-// Exactly one of *TestPermissionsResponse or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *TestPermissionsResponse.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 *ResourcePoliciesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TestPermissionsResponse{
- 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": "Returns permissions that a caller has on the specified resource.",
- // "flatPath": "projects/{project}/regions/{region}/resourcePolicies/{resource}/testIamPermissions",
- // "httpMethod": "POST",
- // "id": "compute.resourcePolicies.testIamPermissions",
- // "parameterOrder": [
- // "project",
- // "region",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/resourcePolicies/{resource}/testIamPermissions",
- // "request": {
- // "$ref": "TestPermissionsRequest"
- // },
- // "response": {
- // "$ref": "TestPermissionsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.routers.aggregatedList":
-
-type RoutersAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Retrieves an aggregated list of routers.
-//
-// - project: Project ID for this request.
-func (r *RoutersService) AggregatedList(project string) *RoutersAggregatedListCall {
- c := &RoutersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *RoutersAggregatedListCall) Filter(filter string) *RoutersAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *RoutersAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *RoutersAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *RoutersAggregatedListCall) MaxResults(maxResults int64) *RoutersAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *RoutersAggregatedListCall) OrderBy(orderBy string) *RoutersAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *RoutersAggregatedListCall) PageToken(pageToken string) *RoutersAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *RoutersAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RoutersAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *RoutersAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *RoutersAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *RoutersAggregatedListCall) Fields(s ...googleapi.Field) *RoutersAggregatedListCall {
- 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 *RoutersAggregatedListCall) IfNoneMatch(entityTag string) *RoutersAggregatedListCall {
- 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 *RoutersAggregatedListCall) Context(ctx context.Context) *RoutersAggregatedListCall {
- 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 *RoutersAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RoutersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/routers")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.routers.aggregatedList" call.
-// Exactly one of *RouterAggregatedList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *RouterAggregatedList.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 *RoutersAggregatedListCall) Do(opts ...googleapi.CallOption) (*RouterAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &RouterAggregatedList{
- 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": "Retrieves an aggregated list of routers.",
- // "flatPath": "projects/{project}/aggregated/routers",
- // "httpMethod": "GET",
- // "id": "compute.routers.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/routers",
- // "response": {
- // "$ref": "RouterAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *RoutersAggregatedListCall) Pages(ctx context.Context, f func(*RouterAggregatedList) 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 "compute.routers.delete":
-
-type RoutersDeleteCall struct {
- s *Service
- project string
- region string
- router string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified Router resource.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-// - router: Name of the Router resource to delete.
-func (r *RoutersService) Delete(project string, region string, router string) *RoutersDeleteCall {
- c := &RoutersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.router = router
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RoutersDeleteCall) RequestId(requestId string) *RoutersDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RoutersDeleteCall) Fields(s ...googleapi.Field) *RoutersDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RoutersDeleteCall) Context(ctx context.Context) *RoutersDeleteCall {
- 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 *RoutersDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RoutersDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/routers/{router}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "router": c.router,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.routers.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RoutersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified Router resource.",
- // "flatPath": "projects/{project}/regions/{region}/routers/{router}",
- // "httpMethod": "DELETE",
- // "id": "compute.routers.delete",
- // "parameterOrder": [
- // "project",
- // "region",
- // "router"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "router": {
- // "description": "Name of the Router resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/routers/{router}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.routers.get":
-
-type RoutersGetCall struct {
- s *Service
- project string
- region string
- router string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified Router resource.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-// - router: Name of the Router resource to return.
-func (r *RoutersService) Get(project string, region string, router string) *RoutersGetCall {
- c := &RoutersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.router = router
- 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 *RoutersGetCall) Fields(s ...googleapi.Field) *RoutersGetCall {
- 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 *RoutersGetCall) IfNoneMatch(entityTag string) *RoutersGetCall {
- 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 *RoutersGetCall) Context(ctx context.Context) *RoutersGetCall {
- 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 *RoutersGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RoutersGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/routers/{router}")
- 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{
- "project": c.project,
- "region": c.region,
- "router": c.router,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.routers.get" call.
-// Exactly one of *Router or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Router.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 *RoutersGetCall) Do(opts ...googleapi.CallOption) (*Router, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Router{
- 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": "Returns the specified Router resource.",
- // "flatPath": "projects/{project}/regions/{region}/routers/{router}",
- // "httpMethod": "GET",
- // "id": "compute.routers.get",
- // "parameterOrder": [
- // "project",
- // "region",
- // "router"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "router": {
- // "description": "Name of the Router resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/routers/{router}",
- // "response": {
- // "$ref": "Router"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.routers.getNatIpInfo":
-
-type RoutersGetNatIpInfoCall struct {
- s *Service
- project string
- region string
- router string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetNatIpInfo: Retrieves runtime NAT IP information.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-// - router: Name of the Router resource to query for Nat IP
-// information. The name should conform to RFC1035.
-func (r *RoutersService) GetNatIpInfo(project string, region string, router string) *RoutersGetNatIpInfoCall {
- c := &RoutersGetNatIpInfoCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.router = router
- return c
-}
-
-// NatName sets the optional parameter "natName": Name of the nat
-// service to filter the NAT IP information. If it is omitted, all nats
-// for this router will be returned. Name should conform to RFC1035.
-func (c *RoutersGetNatIpInfoCall) NatName(natName string) *RoutersGetNatIpInfoCall {
- c.urlParams_.Set("natName", natName)
- 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 *RoutersGetNatIpInfoCall) Fields(s ...googleapi.Field) *RoutersGetNatIpInfoCall {
- 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 *RoutersGetNatIpInfoCall) IfNoneMatch(entityTag string) *RoutersGetNatIpInfoCall {
- 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 *RoutersGetNatIpInfoCall) Context(ctx context.Context) *RoutersGetNatIpInfoCall {
- 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 *RoutersGetNatIpInfoCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RoutersGetNatIpInfoCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/routers/{router}/getNatIpInfo")
- 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{
- "project": c.project,
- "region": c.region,
- "router": c.router,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.routers.getNatIpInfo" call.
-// Exactly one of *NatIpInfoResponse or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *NatIpInfoResponse.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 *RoutersGetNatIpInfoCall) Do(opts ...googleapi.CallOption) (*NatIpInfoResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &NatIpInfoResponse{
- 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": "Retrieves runtime NAT IP information.",
- // "flatPath": "projects/{project}/regions/{region}/routers/{router}/getNatIpInfo",
- // "httpMethod": "GET",
- // "id": "compute.routers.getNatIpInfo",
- // "parameterOrder": [
- // "project",
- // "region",
- // "router"
- // ],
- // "parameters": {
- // "natName": {
- // "description": "Name of the nat service to filter the NAT IP information. If it is omitted, all nats for this router will be returned. Name should conform to RFC1035.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "router": {
- // "description": "Name of the Router resource to query for Nat IP information. The name should conform to RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/routers/{router}/getNatIpInfo",
- // "response": {
- // "$ref": "NatIpInfoResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.routers.getNatMappingInfo":
-
-type RoutersGetNatMappingInfoCall struct {
- s *Service
- project string
- region string
- router string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetNatMappingInfo: Retrieves runtime Nat mapping information of VM
-// endpoints.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-// - router: Name of the Router resource to query for Nat Mapping
-// information of VM endpoints.
-func (r *RoutersService) GetNatMappingInfo(project string, region string, router string) *RoutersGetNatMappingInfoCall {
- c := &RoutersGetNatMappingInfoCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.router = router
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *RoutersGetNatMappingInfoCall) Filter(filter string) *RoutersGetNatMappingInfoCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *RoutersGetNatMappingInfoCall) MaxResults(maxResults int64) *RoutersGetNatMappingInfoCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// NatName sets the optional parameter "natName": Name of the nat
-// service to filter the Nat Mapping information. If it is omitted, all
-// nats for this router will be returned. Name should conform to
-// RFC1035.
-func (c *RoutersGetNatMappingInfoCall) NatName(natName string) *RoutersGetNatMappingInfoCall {
- c.urlParams_.Set("natName", natName)
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *RoutersGetNatMappingInfoCall) OrderBy(orderBy string) *RoutersGetNatMappingInfoCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *RoutersGetNatMappingInfoCall) PageToken(pageToken string) *RoutersGetNatMappingInfoCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *RoutersGetNatMappingInfoCall) ReturnPartialSuccess(returnPartialSuccess bool) *RoutersGetNatMappingInfoCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *RoutersGetNatMappingInfoCall) Fields(s ...googleapi.Field) *RoutersGetNatMappingInfoCall {
- 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 *RoutersGetNatMappingInfoCall) IfNoneMatch(entityTag string) *RoutersGetNatMappingInfoCall {
- 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 *RoutersGetNatMappingInfoCall) Context(ctx context.Context) *RoutersGetNatMappingInfoCall {
- 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 *RoutersGetNatMappingInfoCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RoutersGetNatMappingInfoCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/routers/{router}/getNatMappingInfo")
- 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{
- "project": c.project,
- "region": c.region,
- "router": c.router,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.routers.getNatMappingInfo" call.
-// Exactly one of *VmEndpointNatMappingsList or error will be non-nil.
-// Any non-2xx status code is an error. Response headers are in either
-// *VmEndpointNatMappingsList.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 *RoutersGetNatMappingInfoCall) Do(opts ...googleapi.CallOption) (*VmEndpointNatMappingsList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &VmEndpointNatMappingsList{
- 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": "Retrieves runtime Nat mapping information of VM endpoints.",
- // "flatPath": "projects/{project}/regions/{region}/routers/{router}/getNatMappingInfo",
- // "httpMethod": "GET",
- // "id": "compute.routers.getNatMappingInfo",
- // "parameterOrder": [
- // "project",
- // "region",
- // "router"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "natName": {
- // "description": "Name of the nat service to filter the Nat Mapping information. If it is omitted, all nats for this router will be returned. Name should conform to RFC1035.",
- // "location": "query",
- // "type": "string"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "router": {
- // "description": "Name of the Router resource to query for Nat Mapping information of VM endpoints.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/routers/{router}/getNatMappingInfo",
- // "response": {
- // "$ref": "VmEndpointNatMappingsList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *RoutersGetNatMappingInfoCall) Pages(ctx context.Context, f func(*VmEndpointNatMappingsList) 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 "compute.routers.getRouterStatus":
-
-type RoutersGetRouterStatusCall struct {
- s *Service
- project string
- region string
- router string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetRouterStatus: Retrieves runtime information of the specified
-// router.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-// - router: Name of the Router resource to query.
-func (r *RoutersService) GetRouterStatus(project string, region string, router string) *RoutersGetRouterStatusCall {
- c := &RoutersGetRouterStatusCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.router = router
- 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 *RoutersGetRouterStatusCall) Fields(s ...googleapi.Field) *RoutersGetRouterStatusCall {
- 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 *RoutersGetRouterStatusCall) IfNoneMatch(entityTag string) *RoutersGetRouterStatusCall {
- 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 *RoutersGetRouterStatusCall) Context(ctx context.Context) *RoutersGetRouterStatusCall {
- 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 *RoutersGetRouterStatusCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RoutersGetRouterStatusCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/routers/{router}/getRouterStatus")
- 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{
- "project": c.project,
- "region": c.region,
- "router": c.router,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.routers.getRouterStatus" call.
-// Exactly one of *RouterStatusResponse or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *RouterStatusResponse.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 *RoutersGetRouterStatusCall) Do(opts ...googleapi.CallOption) (*RouterStatusResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &RouterStatusResponse{
- 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": "Retrieves runtime information of the specified router.",
- // "flatPath": "projects/{project}/regions/{region}/routers/{router}/getRouterStatus",
- // "httpMethod": "GET",
- // "id": "compute.routers.getRouterStatus",
- // "parameterOrder": [
- // "project",
- // "region",
- // "router"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "router": {
- // "description": "Name of the Router resource to query.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/routers/{router}/getRouterStatus",
- // "response": {
- // "$ref": "RouterStatusResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.routers.insert":
-
-type RoutersInsertCall struct {
- s *Service
- project string
- region string
- router *Router
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a Router resource in the specified project and region
-// using the data included in the request.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-func (r *RoutersService) Insert(project string, region string, router *Router) *RoutersInsertCall {
- c := &RoutersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.router = router
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RoutersInsertCall) RequestId(requestId string) *RoutersInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RoutersInsertCall) Fields(s ...googleapi.Field) *RoutersInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RoutersInsertCall) Context(ctx context.Context) *RoutersInsertCall {
- 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 *RoutersInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RoutersInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.router)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/routers")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.routers.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RoutersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a Router resource in the specified project and region using the data included in the request.",
- // "flatPath": "projects/{project}/regions/{region}/routers",
- // "httpMethod": "POST",
- // "id": "compute.routers.insert",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/routers",
- // "request": {
- // "$ref": "Router"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.routers.list":
-
-type RoutersListCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves a list of Router resources available to the specified
-// project.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-func (r *RoutersService) List(project string, region string) *RoutersListCall {
- c := &RoutersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *RoutersListCall) Filter(filter string) *RoutersListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *RoutersListCall) MaxResults(maxResults int64) *RoutersListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *RoutersListCall) OrderBy(orderBy string) *RoutersListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *RoutersListCall) PageToken(pageToken string) *RoutersListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *RoutersListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RoutersListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *RoutersListCall) Fields(s ...googleapi.Field) *RoutersListCall {
- 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 *RoutersListCall) IfNoneMatch(entityTag string) *RoutersListCall {
- 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 *RoutersListCall) Context(ctx context.Context) *RoutersListCall {
- 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 *RoutersListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RoutersListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/routers")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.routers.list" call.
-// Exactly one of *RouterList or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *RouterList.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 *RoutersListCall) Do(opts ...googleapi.CallOption) (*RouterList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &RouterList{
- 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": "Retrieves a list of Router resources available to the specified project.",
- // "flatPath": "projects/{project}/regions/{region}/routers",
- // "httpMethod": "GET",
- // "id": "compute.routers.list",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/routers",
- // "response": {
- // "$ref": "RouterList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *RoutersListCall) Pages(ctx context.Context, f func(*RouterList) 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 "compute.routers.patch":
-
-type RoutersPatchCall struct {
- s *Service
- project string
- region string
- router string
- router2 *Router
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Patches the specified Router resource with the data included
-// in the request. This method supports PATCH semantics and uses JSON
-// merge patch format and processing rules.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-// - router: Name of the Router resource to patch.
-func (r *RoutersService) Patch(project string, region string, router string, router2 *Router) *RoutersPatchCall {
- c := &RoutersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.router = router
- c.router2 = router2
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RoutersPatchCall) RequestId(requestId string) *RoutersPatchCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RoutersPatchCall) Fields(s ...googleapi.Field) *RoutersPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RoutersPatchCall) Context(ctx context.Context) *RoutersPatchCall {
- 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 *RoutersPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RoutersPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/routers/{router}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "router": c.router,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.routers.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RoutersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules.",
- // "flatPath": "projects/{project}/regions/{region}/routers/{router}",
- // "httpMethod": "PATCH",
- // "id": "compute.routers.patch",
- // "parameterOrder": [
- // "project",
- // "region",
- // "router"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "router": {
- // "description": "Name of the Router resource to patch.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/routers/{router}",
- // "request": {
- // "$ref": "Router"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.routers.preview":
-
-type RoutersPreviewCall struct {
- s *Service
- project string
- region string
- router string
- router2 *Router
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Preview: Preview fields auto-generated during router create and
-// update operations. Calling this method does NOT create or update the
-// router.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-// - router: Name of the Router resource to query.
-func (r *RoutersService) Preview(project string, region string, router string, router2 *Router) *RoutersPreviewCall {
- c := &RoutersPreviewCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.router = router
- c.router2 = router2
- 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 *RoutersPreviewCall) Fields(s ...googleapi.Field) *RoutersPreviewCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RoutersPreviewCall) Context(ctx context.Context) *RoutersPreviewCall {
- 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 *RoutersPreviewCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RoutersPreviewCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/routers/{router}/preview")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "router": c.router,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.routers.preview" call.
-// Exactly one of *RoutersPreviewResponse or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *RoutersPreviewResponse.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 *RoutersPreviewCall) Do(opts ...googleapi.CallOption) (*RoutersPreviewResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &RoutersPreviewResponse{
- 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": "Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router.",
- // "flatPath": "projects/{project}/regions/{region}/routers/{router}/preview",
- // "httpMethod": "POST",
- // "id": "compute.routers.preview",
- // "parameterOrder": [
- // "project",
- // "region",
- // "router"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "router": {
- // "description": "Name of the Router resource to query.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/routers/{router}/preview",
- // "request": {
- // "$ref": "Router"
- // },
- // "response": {
- // "$ref": "RoutersPreviewResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.routers.update":
-
-type RoutersUpdateCall struct {
- s *Service
- project string
- region string
- router string
- router2 *Router
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Update: Updates the specified Router resource with the data included
-// in the request. This method conforms to PUT semantics, which requests
-// that the state of the target resource be created or replaced with the
-// state defined by the representation enclosed in the request message
-// payload.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-// - router: Name of the Router resource to update.
-func (r *RoutersService) Update(project string, region string, router string, router2 *Router) *RoutersUpdateCall {
- c := &RoutersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.router = router
- c.router2 = router2
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RoutersUpdateCall) RequestId(requestId string) *RoutersUpdateCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RoutersUpdateCall) Fields(s ...googleapi.Field) *RoutersUpdateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RoutersUpdateCall) Context(ctx context.Context) *RoutersUpdateCall {
- 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 *RoutersUpdateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RoutersUpdateCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/routers/{router}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PUT", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "router": c.router,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.routers.update" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RoutersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Updates the specified Router resource with the data included in the request. This method conforms to PUT semantics, which requests that the state of the target resource be created or replaced with the state defined by the representation enclosed in the request message payload.",
- // "flatPath": "projects/{project}/regions/{region}/routers/{router}",
- // "httpMethod": "PUT",
- // "id": "compute.routers.update",
- // "parameterOrder": [
- // "project",
- // "region",
- // "router"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "router": {
- // "description": "Name of the Router resource to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/routers/{router}",
- // "request": {
- // "$ref": "Router"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.routes.delete":
-
-type RoutesDeleteCall struct {
- s *Service
- project string
- route string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified Route resource.
-//
-// - project: Project ID for this request.
-// - route: Name of the Route resource to delete.
-func (r *RoutesService) Delete(project string, route string) *RoutesDeleteCall {
- c := &RoutesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.route = route
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RoutesDeleteCall) RequestId(requestId string) *RoutesDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RoutesDeleteCall) Fields(s ...googleapi.Field) *RoutesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RoutesDeleteCall) Context(ctx context.Context) *RoutesDeleteCall {
- 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 *RoutesDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RoutesDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/routes/{route}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "route": c.route,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.routes.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RoutesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified Route resource.",
- // "flatPath": "projects/{project}/global/routes/{route}",
- // "httpMethod": "DELETE",
- // "id": "compute.routes.delete",
- // "parameterOrder": [
- // "project",
- // "route"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "route": {
- // "description": "Name of the Route resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/routes/{route}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.routes.get":
-
-type RoutesGetCall struct {
- s *Service
- project string
- route string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified Route resource.
-//
-// - project: Project ID for this request.
-// - route: Name of the Route resource to return.
-func (r *RoutesService) Get(project string, route string) *RoutesGetCall {
- c := &RoutesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.route = route
- 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 *RoutesGetCall) Fields(s ...googleapi.Field) *RoutesGetCall {
- 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 *RoutesGetCall) IfNoneMatch(entityTag string) *RoutesGetCall {
- 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 *RoutesGetCall) Context(ctx context.Context) *RoutesGetCall {
- 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 *RoutesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RoutesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/routes/{route}")
- 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{
- "project": c.project,
- "route": c.route,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.routes.get" call.
-// Exactly one of *Route or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Route.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 *RoutesGetCall) Do(opts ...googleapi.CallOption) (*Route, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Route{
- 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": "Returns the specified Route resource.",
- // "flatPath": "projects/{project}/global/routes/{route}",
- // "httpMethod": "GET",
- // "id": "compute.routes.get",
- // "parameterOrder": [
- // "project",
- // "route"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "route": {
- // "description": "Name of the Route resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/routes/{route}",
- // "response": {
- // "$ref": "Route"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.routes.insert":
-
-type RoutesInsertCall struct {
- s *Service
- project string
- route *Route
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a Route resource in the specified project using the
-// data included in the request.
-//
-// - project: Project ID for this request.
-func (r *RoutesService) Insert(project string, route *Route) *RoutesInsertCall {
- c := &RoutesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.route = route
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *RoutesInsertCall) RequestId(requestId string) *RoutesInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *RoutesInsertCall) Fields(s ...googleapi.Field) *RoutesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *RoutesInsertCall) Context(ctx context.Context) *RoutesInsertCall {
- 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 *RoutesInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RoutesInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.route)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/routes")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.routes.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *RoutesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a Route resource in the specified project using the data included in the request.",
- // "flatPath": "projects/{project}/global/routes",
- // "httpMethod": "POST",
- // "id": "compute.routes.insert",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/routes",
- // "request": {
- // "$ref": "Route"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.routes.list":
-
-type RoutesListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves the list of Route resources available to the
-// specified project.
-//
-// - project: Project ID for this request.
-func (r *RoutesService) List(project string) *RoutesListCall {
- c := &RoutesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *RoutesListCall) Filter(filter string) *RoutesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *RoutesListCall) MaxResults(maxResults int64) *RoutesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *RoutesListCall) OrderBy(orderBy string) *RoutesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *RoutesListCall) PageToken(pageToken string) *RoutesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *RoutesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RoutesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *RoutesListCall) Fields(s ...googleapi.Field) *RoutesListCall {
- 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 *RoutesListCall) IfNoneMatch(entityTag string) *RoutesListCall {
- 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 *RoutesListCall) Context(ctx context.Context) *RoutesListCall {
- 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 *RoutesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *RoutesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/routes")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.routes.list" call.
-// Exactly one of *RouteList or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *RouteList.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 *RoutesListCall) Do(opts ...googleapi.CallOption) (*RouteList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &RouteList{
- 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": "Retrieves the list of Route resources available to the specified project.",
- // "flatPath": "projects/{project}/global/routes",
- // "httpMethod": "GET",
- // "id": "compute.routes.list",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/routes",
- // "response": {
- // "$ref": "RouteList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *RoutesListCall) Pages(ctx context.Context, f func(*RouteList) 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 "compute.securityPolicies.addRule":
-
-type SecurityPoliciesAddRuleCall struct {
- s *Service
- project string
- securityPolicy string
- securitypolicyrule *SecurityPolicyRule
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// AddRule: Inserts a rule into a security policy.
-//
-// - project: Project ID for this request.
-// - securityPolicy: Name of the security policy to update.
-func (r *SecurityPoliciesService) AddRule(project string, securityPolicy string, securitypolicyrule *SecurityPolicyRule) *SecurityPoliciesAddRuleCall {
- c := &SecurityPoliciesAddRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.securityPolicy = securityPolicy
- c.securitypolicyrule = securitypolicyrule
- return c
-}
-
-// ValidateOnly sets the optional parameter "validateOnly": If true, the
-// request will not be committed.
-func (c *SecurityPoliciesAddRuleCall) ValidateOnly(validateOnly bool) *SecurityPoliciesAddRuleCall {
- c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
- 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 *SecurityPoliciesAddRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesAddRuleCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *SecurityPoliciesAddRuleCall) Context(ctx context.Context) *SecurityPoliciesAddRuleCall {
- 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 *SecurityPoliciesAddRuleCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SecurityPoliciesAddRuleCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/securityPolicies/{securityPolicy}/addRule")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "securityPolicy": c.securityPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.securityPolicies.addRule" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *SecurityPoliciesAddRuleCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Inserts a rule into a security policy.",
- // "flatPath": "projects/{project}/global/securityPolicies/{securityPolicy}/addRule",
- // "httpMethod": "POST",
- // "id": "compute.securityPolicies.addRule",
- // "parameterOrder": [
- // "project",
- // "securityPolicy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "securityPolicy": {
- // "description": "Name of the security policy to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "validateOnly": {
- // "description": "If true, the request will not be committed.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/securityPolicies/{securityPolicy}/addRule",
- // "request": {
- // "$ref": "SecurityPolicyRule"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.securityPolicies.aggregatedList":
-
-type SecurityPoliciesAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Retrieves the list of all SecurityPolicy resources,
-// regional and global, available to the specified project.
-//
-// - project: Name of the project scoping this request.
-func (r *SecurityPoliciesService) AggregatedList(project string) *SecurityPoliciesAggregatedListCall {
- c := &SecurityPoliciesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *SecurityPoliciesAggregatedListCall) Filter(filter string) *SecurityPoliciesAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *SecurityPoliciesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *SecurityPoliciesAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *SecurityPoliciesAggregatedListCall) MaxResults(maxResults int64) *SecurityPoliciesAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *SecurityPoliciesAggregatedListCall) OrderBy(orderBy string) *SecurityPoliciesAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *SecurityPoliciesAggregatedListCall) PageToken(pageToken string) *SecurityPoliciesAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *SecurityPoliciesAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *SecurityPoliciesAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *SecurityPoliciesAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *SecurityPoliciesAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *SecurityPoliciesAggregatedListCall) Fields(s ...googleapi.Field) *SecurityPoliciesAggregatedListCall {
- 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 *SecurityPoliciesAggregatedListCall) IfNoneMatch(entityTag string) *SecurityPoliciesAggregatedListCall {
- 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 *SecurityPoliciesAggregatedListCall) Context(ctx context.Context) *SecurityPoliciesAggregatedListCall {
- 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 *SecurityPoliciesAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SecurityPoliciesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/securityPolicies")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.securityPolicies.aggregatedList" call.
-// Exactly one of *SecurityPoliciesAggregatedList or error will be
-// non-nil. Any non-2xx status code is an error. Response headers are in
-// either *SecurityPoliciesAggregatedList.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 *SecurityPoliciesAggregatedListCall) Do(opts ...googleapi.CallOption) (*SecurityPoliciesAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &SecurityPoliciesAggregatedList{
- 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": "Retrieves the list of all SecurityPolicy resources, regional and global, available to the specified project.",
- // "flatPath": "projects/{project}/aggregated/securityPolicies",
- // "httpMethod": "GET",
- // "id": "compute.securityPolicies.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Name of the project scoping this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/securityPolicies",
- // "response": {
- // "$ref": "SecurityPoliciesAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *SecurityPoliciesAggregatedListCall) Pages(ctx context.Context, f func(*SecurityPoliciesAggregatedList) 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 "compute.securityPolicies.delete":
-
-type SecurityPoliciesDeleteCall struct {
- s *Service
- project string
- securityPolicy string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified policy.
-//
-// - project: Project ID for this request.
-// - securityPolicy: Name of the security policy to delete.
-func (r *SecurityPoliciesService) Delete(project string, securityPolicy string) *SecurityPoliciesDeleteCall {
- c := &SecurityPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.securityPolicy = securityPolicy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *SecurityPoliciesDeleteCall) RequestId(requestId string) *SecurityPoliciesDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *SecurityPoliciesDeleteCall) Fields(s ...googleapi.Field) *SecurityPoliciesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *SecurityPoliciesDeleteCall) Context(ctx context.Context) *SecurityPoliciesDeleteCall {
- 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 *SecurityPoliciesDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SecurityPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/securityPolicies/{securityPolicy}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "securityPolicy": c.securityPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.securityPolicies.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *SecurityPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified policy.",
- // "flatPath": "projects/{project}/global/securityPolicies/{securityPolicy}",
- // "httpMethod": "DELETE",
- // "id": "compute.securityPolicies.delete",
- // "parameterOrder": [
- // "project",
- // "securityPolicy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "securityPolicy": {
- // "description": "Name of the security policy to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/securityPolicies/{securityPolicy}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.securityPolicies.get":
-
-type SecurityPoliciesGetCall struct {
- s *Service
- project string
- securityPolicy string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: List all of the ordered rules present in a single specified
-// policy.
-//
-// - project: Project ID for this request.
-// - securityPolicy: Name of the security policy to get.
-func (r *SecurityPoliciesService) Get(project string, securityPolicy string) *SecurityPoliciesGetCall {
- c := &SecurityPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.securityPolicy = securityPolicy
- 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 *SecurityPoliciesGetCall) Fields(s ...googleapi.Field) *SecurityPoliciesGetCall {
- 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 *SecurityPoliciesGetCall) IfNoneMatch(entityTag string) *SecurityPoliciesGetCall {
- 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 *SecurityPoliciesGetCall) Context(ctx context.Context) *SecurityPoliciesGetCall {
- 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 *SecurityPoliciesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SecurityPoliciesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/securityPolicies/{securityPolicy}")
- 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{
- "project": c.project,
- "securityPolicy": c.securityPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.securityPolicies.get" call.
-// Exactly one of *SecurityPolicy or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *SecurityPolicy.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 *SecurityPoliciesGetCall) Do(opts ...googleapi.CallOption) (*SecurityPolicy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &SecurityPolicy{
- 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 all of the ordered rules present in a single specified policy.",
- // "flatPath": "projects/{project}/global/securityPolicies/{securityPolicy}",
- // "httpMethod": "GET",
- // "id": "compute.securityPolicies.get",
- // "parameterOrder": [
- // "project",
- // "securityPolicy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "securityPolicy": {
- // "description": "Name of the security policy to get.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/securityPolicies/{securityPolicy}",
- // "response": {
- // "$ref": "SecurityPolicy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.securityPolicies.getRule":
-
-type SecurityPoliciesGetRuleCall struct {
- s *Service
- project string
- securityPolicy string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetRule: Gets a rule at the specified priority.
-//
-// - project: Project ID for this request.
-// - securityPolicy: Name of the security policy to which the queried
-// rule belongs.
-func (r *SecurityPoliciesService) GetRule(project string, securityPolicy string) *SecurityPoliciesGetRuleCall {
- c := &SecurityPoliciesGetRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.securityPolicy = securityPolicy
- return c
-}
-
-// Priority sets the optional parameter "priority": The priority of the
-// rule to get from the security policy.
-func (c *SecurityPoliciesGetRuleCall) Priority(priority int64) *SecurityPoliciesGetRuleCall {
- c.urlParams_.Set("priority", fmt.Sprint(priority))
- 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 *SecurityPoliciesGetRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesGetRuleCall {
- 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 *SecurityPoliciesGetRuleCall) IfNoneMatch(entityTag string) *SecurityPoliciesGetRuleCall {
- 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 *SecurityPoliciesGetRuleCall) Context(ctx context.Context) *SecurityPoliciesGetRuleCall {
- 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 *SecurityPoliciesGetRuleCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SecurityPoliciesGetRuleCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/securityPolicies/{securityPolicy}/getRule")
- 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{
- "project": c.project,
- "securityPolicy": c.securityPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.securityPolicies.getRule" call.
-// Exactly one of *SecurityPolicyRule or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *SecurityPolicyRule.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 *SecurityPoliciesGetRuleCall) Do(opts ...googleapi.CallOption) (*SecurityPolicyRule, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &SecurityPolicyRule{
- 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": "Gets a rule at the specified priority.",
- // "flatPath": "projects/{project}/global/securityPolicies/{securityPolicy}/getRule",
- // "httpMethod": "GET",
- // "id": "compute.securityPolicies.getRule",
- // "parameterOrder": [
- // "project",
- // "securityPolicy"
- // ],
- // "parameters": {
- // "priority": {
- // "description": "The priority of the rule to get from the security policy.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "securityPolicy": {
- // "description": "Name of the security policy to which the queried rule belongs.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/securityPolicies/{securityPolicy}/getRule",
- // "response": {
- // "$ref": "SecurityPolicyRule"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.securityPolicies.insert":
-
-type SecurityPoliciesInsertCall struct {
- s *Service
- project string
- securitypolicy *SecurityPolicy
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a new policy in the specified project using the data
-// included in the request.
-//
-// - project: Project ID for this request.
-func (r *SecurityPoliciesService) Insert(project string, securitypolicy *SecurityPolicy) *SecurityPoliciesInsertCall {
- c := &SecurityPoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.securitypolicy = securitypolicy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *SecurityPoliciesInsertCall) RequestId(requestId string) *SecurityPoliciesInsertCall {
- c.urlParams_.Set("requestId", requestId)
- return c
-}
-
-// ValidateOnly sets the optional parameter "validateOnly": If true, the
-// request will not be committed.
-func (c *SecurityPoliciesInsertCall) ValidateOnly(validateOnly bool) *SecurityPoliciesInsertCall {
- c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
- 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 *SecurityPoliciesInsertCall) Fields(s ...googleapi.Field) *SecurityPoliciesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *SecurityPoliciesInsertCall) Context(ctx context.Context) *SecurityPoliciesInsertCall {
- 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 *SecurityPoliciesInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SecurityPoliciesInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/securityPolicies")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.securityPolicies.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *SecurityPoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a new policy in the specified project using the data included in the request.",
- // "flatPath": "projects/{project}/global/securityPolicies",
- // "httpMethod": "POST",
- // "id": "compute.securityPolicies.insert",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "validateOnly": {
- // "description": "If true, the request will not be committed.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/securityPolicies",
- // "request": {
- // "$ref": "SecurityPolicy"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.securityPolicies.list":
-
-type SecurityPoliciesListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: List all the policies that have been configured for the
-// specified project.
-//
-// - project: Project ID for this request.
-func (r *SecurityPoliciesService) List(project string) *SecurityPoliciesListCall {
- c := &SecurityPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *SecurityPoliciesListCall) Filter(filter string) *SecurityPoliciesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *SecurityPoliciesListCall) MaxResults(maxResults int64) *SecurityPoliciesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *SecurityPoliciesListCall) OrderBy(orderBy string) *SecurityPoliciesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *SecurityPoliciesListCall) PageToken(pageToken string) *SecurityPoliciesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *SecurityPoliciesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *SecurityPoliciesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *SecurityPoliciesListCall) Fields(s ...googleapi.Field) *SecurityPoliciesListCall {
- 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 *SecurityPoliciesListCall) IfNoneMatch(entityTag string) *SecurityPoliciesListCall {
- 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 *SecurityPoliciesListCall) Context(ctx context.Context) *SecurityPoliciesListCall {
- 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 *SecurityPoliciesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SecurityPoliciesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/securityPolicies")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.securityPolicies.list" call.
-// Exactly one of *SecurityPolicyList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *SecurityPolicyList.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 *SecurityPoliciesListCall) Do(opts ...googleapi.CallOption) (*SecurityPolicyList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &SecurityPolicyList{
- 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 all the policies that have been configured for the specified project.",
- // "flatPath": "projects/{project}/global/securityPolicies",
- // "httpMethod": "GET",
- // "id": "compute.securityPolicies.list",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/securityPolicies",
- // "response": {
- // "$ref": "SecurityPolicyList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *SecurityPoliciesListCall) Pages(ctx context.Context, f func(*SecurityPolicyList) 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 "compute.securityPolicies.listPreconfiguredExpressionSets":
-
-type SecurityPoliciesListPreconfiguredExpressionSetsCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// ListPreconfiguredExpressionSets: Gets the current list of
-// preconfigured Web Application Firewall (WAF) expressions.
-//
-// - project: Project ID for this request.
-func (r *SecurityPoliciesService) ListPreconfiguredExpressionSets(project string) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
- c := &SecurityPoliciesListPreconfiguredExpressionSetsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) Filter(filter string) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) MaxResults(maxResults int64) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) OrderBy(orderBy string) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) PageToken(pageToken string) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) ReturnPartialSuccess(returnPartialSuccess bool) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *SecurityPoliciesListPreconfiguredExpressionSetsCall) Fields(s ...googleapi.Field) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
- 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 *SecurityPoliciesListPreconfiguredExpressionSetsCall) IfNoneMatch(entityTag string) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
- 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 *SecurityPoliciesListPreconfiguredExpressionSetsCall) Context(ctx context.Context) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
- 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 *SecurityPoliciesListPreconfiguredExpressionSetsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/securityPolicies/listPreconfiguredExpressionSets")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.securityPolicies.listPreconfiguredExpressionSets" call.
-// Exactly one of
-// *SecurityPoliciesListPreconfiguredExpressionSetsResponse or error
-// will be non-nil. Any non-2xx status code is an error. Response
-// headers are in either
-// *SecurityPoliciesListPreconfiguredExpressionSetsResponse.ServerRespons
-// e.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 *SecurityPoliciesListPreconfiguredExpressionSetsCall) Do(opts ...googleapi.CallOption) (*SecurityPoliciesListPreconfiguredExpressionSetsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &SecurityPoliciesListPreconfiguredExpressionSetsResponse{
- 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": "Gets the current list of preconfigured Web Application Firewall (WAF) expressions.",
- // "flatPath": "projects/{project}/global/securityPolicies/listPreconfiguredExpressionSets",
- // "httpMethod": "GET",
- // "id": "compute.securityPolicies.listPreconfiguredExpressionSets",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/securityPolicies/listPreconfiguredExpressionSets",
- // "response": {
- // "$ref": "SecurityPoliciesListPreconfiguredExpressionSetsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.securityPolicies.patch":
-
-type SecurityPoliciesPatchCall struct {
- s *Service
- project string
- securityPolicy string
- securitypolicy *SecurityPolicy
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Patches the specified policy with the data included in the
-// request. To clear fields in the policy, leave the fields empty and
-// specify them in the updateMask. This cannot be used to be update the
-// rules in the policy. Please use the per rule methods like addRule,
-// patchRule, and removeRule instead.
-//
-// - project: Project ID for this request.
-// - securityPolicy: Name of the security policy to update.
-func (r *SecurityPoliciesService) Patch(project string, securityPolicy string, securitypolicy *SecurityPolicy) *SecurityPoliciesPatchCall {
- c := &SecurityPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.securityPolicy = securityPolicy
- c.securitypolicy = securitypolicy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *SecurityPoliciesPatchCall) RequestId(requestId string) *SecurityPoliciesPatchCall {
- c.urlParams_.Set("requestId", requestId)
- return c
-}
-
-// UpdateMask sets the optional parameter "updateMask": Indicates fields
-// to be cleared as part of this request.
-func (c *SecurityPoliciesPatchCall) UpdateMask(updateMask string) *SecurityPoliciesPatchCall {
- c.urlParams_.Set("updateMask", updateMask)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *SecurityPoliciesPatchCall) Fields(s ...googleapi.Field) *SecurityPoliciesPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *SecurityPoliciesPatchCall) Context(ctx context.Context) *SecurityPoliciesPatchCall {
- 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 *SecurityPoliciesPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SecurityPoliciesPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/securityPolicies/{securityPolicy}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "securityPolicy": c.securityPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.securityPolicies.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *SecurityPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Patches the specified policy with the data included in the request. To clear fields in the policy, leave the fields empty and specify them in the updateMask. This cannot be used to be update the rules in the policy. Please use the per rule methods like addRule, patchRule, and removeRule instead.",
- // "flatPath": "projects/{project}/global/securityPolicies/{securityPolicy}",
- // "httpMethod": "PATCH",
- // "id": "compute.securityPolicies.patch",
- // "parameterOrder": [
- // "project",
- // "securityPolicy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "securityPolicy": {
- // "description": "Name of the security policy to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "updateMask": {
- // "description": "Indicates fields to be cleared as part of this request.",
- // "format": "google-fieldmask",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/securityPolicies/{securityPolicy}",
- // "request": {
- // "$ref": "SecurityPolicy"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.securityPolicies.patchRule":
-
-type SecurityPoliciesPatchRuleCall struct {
- s *Service
- project string
- securityPolicy string
- securitypolicyrule *SecurityPolicyRule
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// PatchRule: Patches a rule at the specified priority. To clear fields
-// in the rule, leave the fields empty and specify them in the
-// updateMask.
-//
-// - project: Project ID for this request.
-// - securityPolicy: Name of the security policy to update.
-func (r *SecurityPoliciesService) PatchRule(project string, securityPolicy string, securitypolicyrule *SecurityPolicyRule) *SecurityPoliciesPatchRuleCall {
- c := &SecurityPoliciesPatchRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.securityPolicy = securityPolicy
- c.securitypolicyrule = securitypolicyrule
- return c
-}
-
-// Priority sets the optional parameter "priority": The priority of the
-// rule to patch.
-func (c *SecurityPoliciesPatchRuleCall) Priority(priority int64) *SecurityPoliciesPatchRuleCall {
- c.urlParams_.Set("priority", fmt.Sprint(priority))
- return c
-}
-
-// UpdateMask sets the optional parameter "updateMask": Indicates fields
-// to be cleared as part of this request.
-func (c *SecurityPoliciesPatchRuleCall) UpdateMask(updateMask string) *SecurityPoliciesPatchRuleCall {
- c.urlParams_.Set("updateMask", updateMask)
- return c
-}
-
-// ValidateOnly sets the optional parameter "validateOnly": If true, the
-// request will not be committed.
-func (c *SecurityPoliciesPatchRuleCall) ValidateOnly(validateOnly bool) *SecurityPoliciesPatchRuleCall {
- c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
- 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 *SecurityPoliciesPatchRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesPatchRuleCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *SecurityPoliciesPatchRuleCall) Context(ctx context.Context) *SecurityPoliciesPatchRuleCall {
- 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 *SecurityPoliciesPatchRuleCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SecurityPoliciesPatchRuleCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/securityPolicies/{securityPolicy}/patchRule")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "securityPolicy": c.securityPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.securityPolicies.patchRule" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *SecurityPoliciesPatchRuleCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Patches a rule at the specified priority. To clear fields in the rule, leave the fields empty and specify them in the updateMask.",
- // "flatPath": "projects/{project}/global/securityPolicies/{securityPolicy}/patchRule",
- // "httpMethod": "POST",
- // "id": "compute.securityPolicies.patchRule",
- // "parameterOrder": [
- // "project",
- // "securityPolicy"
- // ],
- // "parameters": {
- // "priority": {
- // "description": "The priority of the rule to patch.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "securityPolicy": {
- // "description": "Name of the security policy to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "updateMask": {
- // "description": "Indicates fields to be cleared as part of this request.",
- // "format": "google-fieldmask",
- // "location": "query",
- // "type": "string"
- // },
- // "validateOnly": {
- // "description": "If true, the request will not be committed.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/securityPolicies/{securityPolicy}/patchRule",
- // "request": {
- // "$ref": "SecurityPolicyRule"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.securityPolicies.removeRule":
-
-type SecurityPoliciesRemoveRuleCall struct {
- s *Service
- project string
- securityPolicy string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// RemoveRule: Deletes a rule at the specified priority.
-//
-// - project: Project ID for this request.
-// - securityPolicy: Name of the security policy to update.
-func (r *SecurityPoliciesService) RemoveRule(project string, securityPolicy string) *SecurityPoliciesRemoveRuleCall {
- c := &SecurityPoliciesRemoveRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.securityPolicy = securityPolicy
- return c
-}
-
-// Priority sets the optional parameter "priority": The priority of the
-// rule to remove from the security policy.
-func (c *SecurityPoliciesRemoveRuleCall) Priority(priority int64) *SecurityPoliciesRemoveRuleCall {
- c.urlParams_.Set("priority", fmt.Sprint(priority))
- 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 *SecurityPoliciesRemoveRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesRemoveRuleCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *SecurityPoliciesRemoveRuleCall) Context(ctx context.Context) *SecurityPoliciesRemoveRuleCall {
- 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 *SecurityPoliciesRemoveRuleCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SecurityPoliciesRemoveRuleCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/securityPolicies/{securityPolicy}/removeRule")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "securityPolicy": c.securityPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.securityPolicies.removeRule" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *SecurityPoliciesRemoveRuleCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes a rule at the specified priority.",
- // "flatPath": "projects/{project}/global/securityPolicies/{securityPolicy}/removeRule",
- // "httpMethod": "POST",
- // "id": "compute.securityPolicies.removeRule",
- // "parameterOrder": [
- // "project",
- // "securityPolicy"
- // ],
- // "parameters": {
- // "priority": {
- // "description": "The priority of the rule to remove from the security policy.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "securityPolicy": {
- // "description": "Name of the security policy to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/securityPolicies/{securityPolicy}/removeRule",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.securityPolicies.setLabels":
-
-type SecurityPoliciesSetLabelsCall struct {
- s *Service
- project string
- resource string
- globalsetlabelsrequest *GlobalSetLabelsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetLabels: Sets the labels on a security policy. To learn more about
-// labels, read the Labeling Resources documentation.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-func (r *SecurityPoliciesService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *SecurityPoliciesSetLabelsCall {
- c := &SecurityPoliciesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.resource = resource
- c.globalsetlabelsrequest = globalsetlabelsrequest
- 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 *SecurityPoliciesSetLabelsCall) Fields(s ...googleapi.Field) *SecurityPoliciesSetLabelsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *SecurityPoliciesSetLabelsCall) Context(ctx context.Context) *SecurityPoliciesSetLabelsCall {
- 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 *SecurityPoliciesSetLabelsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SecurityPoliciesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/securityPolicies/{resource}/setLabels")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.securityPolicies.setLabels" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *SecurityPoliciesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Sets the labels on a security policy. To learn more about labels, read the Labeling Resources documentation.",
- // "flatPath": "projects/{project}/global/securityPolicies/{resource}/setLabels",
- // "httpMethod": "POST",
- // "id": "compute.securityPolicies.setLabels",
- // "parameterOrder": [
- // "project",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/securityPolicies/{resource}/setLabels",
- // "request": {
- // "$ref": "GlobalSetLabelsRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.serviceAttachments.aggregatedList":
-
-type ServiceAttachmentsAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Retrieves the list of all ServiceAttachment
-// resources, regional and global, available to the specified project.
-//
-// - project: Name of the project scoping this request.
-func (r *ServiceAttachmentsService) AggregatedList(project string) *ServiceAttachmentsAggregatedListCall {
- c := &ServiceAttachmentsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *ServiceAttachmentsAggregatedListCall) Filter(filter string) *ServiceAttachmentsAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *ServiceAttachmentsAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *ServiceAttachmentsAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *ServiceAttachmentsAggregatedListCall) MaxResults(maxResults int64) *ServiceAttachmentsAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *ServiceAttachmentsAggregatedListCall) OrderBy(orderBy string) *ServiceAttachmentsAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *ServiceAttachmentsAggregatedListCall) PageToken(pageToken string) *ServiceAttachmentsAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *ServiceAttachmentsAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ServiceAttachmentsAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *ServiceAttachmentsAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *ServiceAttachmentsAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *ServiceAttachmentsAggregatedListCall) Fields(s ...googleapi.Field) *ServiceAttachmentsAggregatedListCall {
- 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 *ServiceAttachmentsAggregatedListCall) IfNoneMatch(entityTag string) *ServiceAttachmentsAggregatedListCall {
- 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 *ServiceAttachmentsAggregatedListCall) Context(ctx context.Context) *ServiceAttachmentsAggregatedListCall {
- 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 *ServiceAttachmentsAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ServiceAttachmentsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/serviceAttachments")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.serviceAttachments.aggregatedList" call.
-// Exactly one of *ServiceAttachmentAggregatedList or error will be
-// non-nil. Any non-2xx status code is an error. Response headers are in
-// either *ServiceAttachmentAggregatedList.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 *ServiceAttachmentsAggregatedListCall) Do(opts ...googleapi.CallOption) (*ServiceAttachmentAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &ServiceAttachmentAggregatedList{
- 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": "Retrieves the list of all ServiceAttachment resources, regional and global, available to the specified project.",
- // "flatPath": "projects/{project}/aggregated/serviceAttachments",
- // "httpMethod": "GET",
- // "id": "compute.serviceAttachments.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Name of the project scoping this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/serviceAttachments",
- // "response": {
- // "$ref": "ServiceAttachmentAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *ServiceAttachmentsAggregatedListCall) Pages(ctx context.Context, f func(*ServiceAttachmentAggregatedList) 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 "compute.serviceAttachments.delete":
-
-type ServiceAttachmentsDeleteCall struct {
- s *Service
- project string
- region string
- serviceAttachment string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified ServiceAttachment in the given scope
-//
-// - project: Project ID for this request.
-// - region: Name of the region of this request.
-// - serviceAttachment: Name of the ServiceAttachment resource to
-// delete.
-func (r *ServiceAttachmentsService) Delete(project string, region string, serviceAttachment string) *ServiceAttachmentsDeleteCall {
- c := &ServiceAttachmentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.serviceAttachment = serviceAttachment
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *ServiceAttachmentsDeleteCall) RequestId(requestId string) *ServiceAttachmentsDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *ServiceAttachmentsDeleteCall) Fields(s ...googleapi.Field) *ServiceAttachmentsDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ServiceAttachmentsDeleteCall) Context(ctx context.Context) *ServiceAttachmentsDeleteCall {
- 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 *ServiceAttachmentsDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ServiceAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/serviceAttachments/{serviceAttachment}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "serviceAttachment": c.serviceAttachment,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.serviceAttachments.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *ServiceAttachmentsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified ServiceAttachment in the given scope",
- // "flatPath": "projects/{project}/regions/{region}/serviceAttachments/{serviceAttachment}",
- // "httpMethod": "DELETE",
- // "id": "compute.serviceAttachments.delete",
- // "parameterOrder": [
- // "project",
- // "region",
- // "serviceAttachment"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region of this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "serviceAttachment": {
- // "description": "Name of the ServiceAttachment resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/serviceAttachments/{serviceAttachment}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.serviceAttachments.get":
-
-type ServiceAttachmentsGetCall struct {
- s *Service
- project string
- region string
- serviceAttachment string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified ServiceAttachment resource in the given
-// scope.
-//
-// - project: Project ID for this request.
-// - region: Name of the region of this request.
-// - serviceAttachment: Name of the ServiceAttachment resource to
-// return.
-func (r *ServiceAttachmentsService) Get(project string, region string, serviceAttachment string) *ServiceAttachmentsGetCall {
- c := &ServiceAttachmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.serviceAttachment = serviceAttachment
- 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 *ServiceAttachmentsGetCall) Fields(s ...googleapi.Field) *ServiceAttachmentsGetCall {
- 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 *ServiceAttachmentsGetCall) IfNoneMatch(entityTag string) *ServiceAttachmentsGetCall {
- 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 *ServiceAttachmentsGetCall) Context(ctx context.Context) *ServiceAttachmentsGetCall {
- 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 *ServiceAttachmentsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ServiceAttachmentsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/serviceAttachments/{serviceAttachment}")
- 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{
- "project": c.project,
- "region": c.region,
- "serviceAttachment": c.serviceAttachment,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.serviceAttachments.get" call.
-// Exactly one of *ServiceAttachment or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *ServiceAttachment.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 *ServiceAttachmentsGetCall) Do(opts ...googleapi.CallOption) (*ServiceAttachment, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &ServiceAttachment{
- 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": "Returns the specified ServiceAttachment resource in the given scope.",
- // "flatPath": "projects/{project}/regions/{region}/serviceAttachments/{serviceAttachment}",
- // "httpMethod": "GET",
- // "id": "compute.serviceAttachments.get",
- // "parameterOrder": [
- // "project",
- // "region",
- // "serviceAttachment"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region of this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "serviceAttachment": {
- // "description": "Name of the ServiceAttachment resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/serviceAttachments/{serviceAttachment}",
- // "response": {
- // "$ref": "ServiceAttachment"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.serviceAttachments.getIamPolicy":
-
-type ServiceAttachmentsGetIamPolicyCall struct {
- s *Service
- project string
- region string
- resource string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetIamPolicy: Gets the access control policy for a resource. May be
-// empty if no such policy or resource exists.
-//
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-// - resource: Name or id of the resource for this request.
-func (r *ServiceAttachmentsService) GetIamPolicy(project string, region string, resource string) *ServiceAttachmentsGetIamPolicyCall {
- c := &ServiceAttachmentsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.resource = resource
- return c
-}
-
-// OptionsRequestedPolicyVersion sets the optional parameter
-// "optionsRequestedPolicyVersion": Requested IAM Policy version.
-func (c *ServiceAttachmentsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ServiceAttachmentsGetIamPolicyCall {
- c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
- 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 *ServiceAttachmentsGetIamPolicyCall) Fields(s ...googleapi.Field) *ServiceAttachmentsGetIamPolicyCall {
- 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 *ServiceAttachmentsGetIamPolicyCall) IfNoneMatch(entityTag string) *ServiceAttachmentsGetIamPolicyCall {
- 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 *ServiceAttachmentsGetIamPolicyCall) Context(ctx context.Context) *ServiceAttachmentsGetIamPolicyCall {
- 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 *ServiceAttachmentsGetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ServiceAttachmentsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/serviceAttachments/{resource}/getIamPolicy")
- 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{
- "project": c.project,
- "region": c.region,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.serviceAttachments.getIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *ServiceAttachmentsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
- // "flatPath": "projects/{project}/regions/{region}/serviceAttachments/{resource}/getIamPolicy",
- // "httpMethod": "GET",
- // "id": "compute.serviceAttachments.getIamPolicy",
- // "parameterOrder": [
- // "project",
- // "region",
- // "resource"
- // ],
- // "parameters": {
- // "optionsRequestedPolicyVersion": {
- // "description": "Requested IAM Policy version.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/serviceAttachments/{resource}/getIamPolicy",
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.serviceAttachments.insert":
-
-type ServiceAttachmentsInsertCall struct {
- s *Service
- project string
- region string
- serviceattachment *ServiceAttachment
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a ServiceAttachment in the specified project in the
-// given scope using the parameters that are included in the request.
-//
-// - project: Project ID for this request.
-// - region: Name of the region of this request.
-func (r *ServiceAttachmentsService) Insert(project string, region string, serviceattachment *ServiceAttachment) *ServiceAttachmentsInsertCall {
- c := &ServiceAttachmentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.serviceattachment = serviceattachment
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *ServiceAttachmentsInsertCall) RequestId(requestId string) *ServiceAttachmentsInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *ServiceAttachmentsInsertCall) Fields(s ...googleapi.Field) *ServiceAttachmentsInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ServiceAttachmentsInsertCall) Context(ctx context.Context) *ServiceAttachmentsInsertCall {
- 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 *ServiceAttachmentsInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ServiceAttachmentsInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.serviceattachment)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/serviceAttachments")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.serviceAttachments.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *ServiceAttachmentsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a ServiceAttachment in the specified project in the given scope using the parameters that are included in the request.",
- // "flatPath": "projects/{project}/regions/{region}/serviceAttachments",
- // "httpMethod": "POST",
- // "id": "compute.serviceAttachments.insert",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region of this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/serviceAttachments",
- // "request": {
- // "$ref": "ServiceAttachment"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.serviceAttachments.list":
-
-type ServiceAttachmentsListCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Lists the ServiceAttachments for a project in the given scope.
-//
-// - project: Project ID for this request.
-// - region: Name of the region of this request.
-func (r *ServiceAttachmentsService) List(project string, region string) *ServiceAttachmentsListCall {
- c := &ServiceAttachmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *ServiceAttachmentsListCall) Filter(filter string) *ServiceAttachmentsListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *ServiceAttachmentsListCall) MaxResults(maxResults int64) *ServiceAttachmentsListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *ServiceAttachmentsListCall) OrderBy(orderBy string) *ServiceAttachmentsListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *ServiceAttachmentsListCall) PageToken(pageToken string) *ServiceAttachmentsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *ServiceAttachmentsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ServiceAttachmentsListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *ServiceAttachmentsListCall) Fields(s ...googleapi.Field) *ServiceAttachmentsListCall {
- 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 *ServiceAttachmentsListCall) IfNoneMatch(entityTag string) *ServiceAttachmentsListCall {
- 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 *ServiceAttachmentsListCall) Context(ctx context.Context) *ServiceAttachmentsListCall {
- 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 *ServiceAttachmentsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ServiceAttachmentsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/serviceAttachments")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.serviceAttachments.list" call.
-// Exactly one of *ServiceAttachmentList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *ServiceAttachmentList.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 *ServiceAttachmentsListCall) Do(opts ...googleapi.CallOption) (*ServiceAttachmentList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &ServiceAttachmentList{
- 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": "Lists the ServiceAttachments for a project in the given scope.",
- // "flatPath": "projects/{project}/regions/{region}/serviceAttachments",
- // "httpMethod": "GET",
- // "id": "compute.serviceAttachments.list",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region of this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/serviceAttachments",
- // "response": {
- // "$ref": "ServiceAttachmentList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *ServiceAttachmentsListCall) Pages(ctx context.Context, f func(*ServiceAttachmentList) 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 "compute.serviceAttachments.patch":
-
-type ServiceAttachmentsPatchCall struct {
- s *Service
- project string
- region string
- serviceAttachment string
- serviceattachment *ServiceAttachment
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Patches the specified ServiceAttachment resource with the data
-// included in the request. This method supports PATCH semantics and
-// uses JSON merge patch format and processing rules.
-//
-// - project: Project ID for this request.
-// - region: The region scoping this request and should conform to
-// RFC1035.
-// - serviceAttachment: The resource id of the ServiceAttachment to
-// patch. It should conform to RFC1035 resource name or be a string
-// form on an unsigned long number.
-func (r *ServiceAttachmentsService) Patch(project string, region string, serviceAttachment string, serviceattachment *ServiceAttachment) *ServiceAttachmentsPatchCall {
- c := &ServiceAttachmentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.serviceAttachment = serviceAttachment
- c.serviceattachment = serviceattachment
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *ServiceAttachmentsPatchCall) RequestId(requestId string) *ServiceAttachmentsPatchCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *ServiceAttachmentsPatchCall) Fields(s ...googleapi.Field) *ServiceAttachmentsPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ServiceAttachmentsPatchCall) Context(ctx context.Context) *ServiceAttachmentsPatchCall {
- 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 *ServiceAttachmentsPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ServiceAttachmentsPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.serviceattachment)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/serviceAttachments/{serviceAttachment}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "serviceAttachment": c.serviceAttachment,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.serviceAttachments.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *ServiceAttachmentsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Patches the specified ServiceAttachment resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules.",
- // "flatPath": "projects/{project}/regions/{region}/serviceAttachments/{serviceAttachment}",
- // "httpMethod": "PATCH",
- // "id": "compute.serviceAttachments.patch",
- // "parameterOrder": [
- // "project",
- // "region",
- // "serviceAttachment"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The region scoping this request and should conform to RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "serviceAttachment": {
- // "description": "The resource id of the ServiceAttachment to patch. It should conform to RFC1035 resource name or be a string form on an unsigned long number.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/serviceAttachments/{serviceAttachment}",
- // "request": {
- // "$ref": "ServiceAttachment"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.serviceAttachments.setIamPolicy":
-
-type ServiceAttachmentsSetIamPolicyCall struct {
- s *Service
- project string
- region string
- resource string
- regionsetpolicyrequest *RegionSetPolicyRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetIamPolicy: Sets the access control policy on the specified
-// resource. Replaces any existing policy.
-//
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-// - resource: Name or id of the resource for this request.
-func (r *ServiceAttachmentsService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *ServiceAttachmentsSetIamPolicyCall {
- c := &ServiceAttachmentsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.resource = resource
- c.regionsetpolicyrequest = regionsetpolicyrequest
- 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 *ServiceAttachmentsSetIamPolicyCall) Fields(s ...googleapi.Field) *ServiceAttachmentsSetIamPolicyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ServiceAttachmentsSetIamPolicyCall) Context(ctx context.Context) *ServiceAttachmentsSetIamPolicyCall {
- 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 *ServiceAttachmentsSetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ServiceAttachmentsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/serviceAttachments/{resource}/setIamPolicy")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.serviceAttachments.setIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *ServiceAttachmentsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Sets the access control policy on the specified resource. Replaces any existing policy.",
- // "flatPath": "projects/{project}/regions/{region}/serviceAttachments/{resource}/setIamPolicy",
- // "httpMethod": "POST",
- // "id": "compute.serviceAttachments.setIamPolicy",
- // "parameterOrder": [
- // "project",
- // "region",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/serviceAttachments/{resource}/setIamPolicy",
- // "request": {
- // "$ref": "RegionSetPolicyRequest"
- // },
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.serviceAttachments.testIamPermissions":
-
-type ServiceAttachmentsTestIamPermissionsCall struct {
- s *Service
- project string
- region string
- resource string
- testpermissionsrequest *TestPermissionsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// TestIamPermissions: Returns permissions that a caller has on the
-// specified resource.
-//
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-// - resource: Name or id of the resource for this request.
-func (r *ServiceAttachmentsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *ServiceAttachmentsTestIamPermissionsCall {
- c := &ServiceAttachmentsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.resource = resource
- c.testpermissionsrequest = testpermissionsrequest
- 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 *ServiceAttachmentsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ServiceAttachmentsTestIamPermissionsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ServiceAttachmentsTestIamPermissionsCall) Context(ctx context.Context) *ServiceAttachmentsTestIamPermissionsCall {
- 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 *ServiceAttachmentsTestIamPermissionsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ServiceAttachmentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/serviceAttachments/{resource}/testIamPermissions")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.serviceAttachments.testIamPermissions" call.
-// Exactly one of *TestPermissionsResponse or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *TestPermissionsResponse.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 *ServiceAttachmentsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TestPermissionsResponse{
- 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": "Returns permissions that a caller has on the specified resource.",
- // "flatPath": "projects/{project}/regions/{region}/serviceAttachments/{resource}/testIamPermissions",
- // "httpMethod": "POST",
- // "id": "compute.serviceAttachments.testIamPermissions",
- // "parameterOrder": [
- // "project",
- // "region",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/serviceAttachments/{resource}/testIamPermissions",
- // "request": {
- // "$ref": "TestPermissionsRequest"
- // },
- // "response": {
- // "$ref": "TestPermissionsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.snapshotSettings.get":
-
-type SnapshotSettingsGetCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Get snapshot settings.
-//
-// - project: Project ID for this request.
-func (r *SnapshotSettingsService) Get(project string) *SnapshotSettingsGetCall {
- c := &SnapshotSettingsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- 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 *SnapshotSettingsGetCall) Fields(s ...googleapi.Field) *SnapshotSettingsGetCall {
- 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 *SnapshotSettingsGetCall) IfNoneMatch(entityTag string) *SnapshotSettingsGetCall {
- 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 *SnapshotSettingsGetCall) Context(ctx context.Context) *SnapshotSettingsGetCall {
- 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 *SnapshotSettingsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SnapshotSettingsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/snapshotSettings")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.snapshotSettings.get" call.
-// Exactly one of *SnapshotSettings or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *SnapshotSettings.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 *SnapshotSettingsGetCall) Do(opts ...googleapi.CallOption) (*SnapshotSettings, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &SnapshotSettings{
- 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": "Get snapshot settings.",
- // "flatPath": "projects/{project}/global/snapshotSettings",
- // "httpMethod": "GET",
- // "id": "compute.snapshotSettings.get",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/snapshotSettings",
- // "response": {
- // "$ref": "SnapshotSettings"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.snapshotSettings.patch":
-
-type SnapshotSettingsPatchCall struct {
- s *Service
- project string
- snapshotsettings *SnapshotSettings
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Patch snapshot settings.
-//
-// - project: Project ID for this request.
-func (r *SnapshotSettingsService) Patch(project string, snapshotsettings *SnapshotSettings) *SnapshotSettingsPatchCall {
- c := &SnapshotSettingsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.snapshotsettings = snapshotsettings
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *SnapshotSettingsPatchCall) RequestId(requestId string) *SnapshotSettingsPatchCall {
- c.urlParams_.Set("requestId", requestId)
- return c
-}
-
-// UpdateMask sets the optional parameter "updateMask": update_mask
-// indicates fields to be updated as part of this request.
-func (c *SnapshotSettingsPatchCall) UpdateMask(updateMask string) *SnapshotSettingsPatchCall {
- c.urlParams_.Set("updateMask", updateMask)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *SnapshotSettingsPatchCall) Fields(s ...googleapi.Field) *SnapshotSettingsPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *SnapshotSettingsPatchCall) Context(ctx context.Context) *SnapshotSettingsPatchCall {
- 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 *SnapshotSettingsPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SnapshotSettingsPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshotsettings)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/snapshotSettings")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.snapshotSettings.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *SnapshotSettingsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Patch snapshot settings.",
- // "flatPath": "projects/{project}/global/snapshotSettings",
- // "httpMethod": "PATCH",
- // "id": "compute.snapshotSettings.patch",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "updateMask": {
- // "description": "update_mask indicates fields to be updated as part of this request.",
- // "format": "google-fieldmask",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/snapshotSettings",
- // "request": {
- // "$ref": "SnapshotSettings"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.snapshots.delete":
-
-type SnapshotsDeleteCall struct {
- s *Service
- project string
- snapshot string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified Snapshot resource. Keep in mind that
-// deleting a single snapshot might not necessarily delete all the data
-// on that snapshot. If any data on the snapshot that is marked for
-// deletion is needed for subsequent snapshots, the data will be moved
-// to the next corresponding snapshot. For more information, see
-// Deleting snapshots.
-//
-// - project: Project ID for this request.
-// - snapshot: Name of the Snapshot resource to delete.
-func (r *SnapshotsService) Delete(project string, snapshot string) *SnapshotsDeleteCall {
- c := &SnapshotsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.snapshot = snapshot
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *SnapshotsDeleteCall) RequestId(requestId string) *SnapshotsDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *SnapshotsDeleteCall) Fields(s ...googleapi.Field) *SnapshotsDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *SnapshotsDeleteCall) Context(ctx context.Context) *SnapshotsDeleteCall {
- 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 *SnapshotsDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SnapshotsDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/snapshots/{snapshot}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "snapshot": c.snapshot,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.snapshots.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *SnapshotsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot. For more information, see Deleting snapshots.",
- // "flatPath": "projects/{project}/global/snapshots/{snapshot}",
- // "httpMethod": "DELETE",
- // "id": "compute.snapshots.delete",
- // "parameterOrder": [
- // "project",
- // "snapshot"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "snapshot": {
- // "description": "Name of the Snapshot resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/snapshots/{snapshot}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.snapshots.get":
-
-type SnapshotsGetCall struct {
- s *Service
- project string
- snapshot string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified Snapshot resource.
-//
-// - project: Project ID for this request.
-// - snapshot: Name of the Snapshot resource to return.
-func (r *SnapshotsService) Get(project string, snapshot string) *SnapshotsGetCall {
- c := &SnapshotsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.snapshot = snapshot
- 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 *SnapshotsGetCall) Fields(s ...googleapi.Field) *SnapshotsGetCall {
- 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 *SnapshotsGetCall) IfNoneMatch(entityTag string) *SnapshotsGetCall {
- 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 *SnapshotsGetCall) Context(ctx context.Context) *SnapshotsGetCall {
- 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 *SnapshotsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SnapshotsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/snapshots/{snapshot}")
- 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{
- "project": c.project,
- "snapshot": c.snapshot,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.snapshots.get" call.
-// Exactly one of *Snapshot or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Snapshot.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 *SnapshotsGetCall) Do(opts ...googleapi.CallOption) (*Snapshot, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Snapshot{
- 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": "Returns the specified Snapshot resource.",
- // "flatPath": "projects/{project}/global/snapshots/{snapshot}",
- // "httpMethod": "GET",
- // "id": "compute.snapshots.get",
- // "parameterOrder": [
- // "project",
- // "snapshot"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "snapshot": {
- // "description": "Name of the Snapshot resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/snapshots/{snapshot}",
- // "response": {
- // "$ref": "Snapshot"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.snapshots.getIamPolicy":
-
-type SnapshotsGetIamPolicyCall struct {
- s *Service
- project string
- resource string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetIamPolicy: Gets the access control policy for a resource. May be
-// empty if no such policy or resource exists.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-func (r *SnapshotsService) GetIamPolicy(project string, resource string) *SnapshotsGetIamPolicyCall {
- c := &SnapshotsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.resource = resource
- return c
-}
-
-// OptionsRequestedPolicyVersion sets the optional parameter
-// "optionsRequestedPolicyVersion": Requested IAM Policy version.
-func (c *SnapshotsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *SnapshotsGetIamPolicyCall {
- c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
- 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 *SnapshotsGetIamPolicyCall) Fields(s ...googleapi.Field) *SnapshotsGetIamPolicyCall {
- 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 *SnapshotsGetIamPolicyCall) IfNoneMatch(entityTag string) *SnapshotsGetIamPolicyCall {
- 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 *SnapshotsGetIamPolicyCall) Context(ctx context.Context) *SnapshotsGetIamPolicyCall {
- 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 *SnapshotsGetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SnapshotsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/snapshots/{resource}/getIamPolicy")
- 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{
- "project": c.project,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.snapshots.getIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *SnapshotsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
- // "flatPath": "projects/{project}/global/snapshots/{resource}/getIamPolicy",
- // "httpMethod": "GET",
- // "id": "compute.snapshots.getIamPolicy",
- // "parameterOrder": [
- // "project",
- // "resource"
- // ],
- // "parameters": {
- // "optionsRequestedPolicyVersion": {
- // "description": "Requested IAM Policy version.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/snapshots/{resource}/getIamPolicy",
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.snapshots.insert":
-
-type SnapshotsInsertCall struct {
- s *Service
- project string
- snapshot *Snapshot
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a snapshot in the specified project using the data
-// included in the request. For regular snapshot creation, consider
-// using this method instead of disks.createSnapshot, as this method
-// supports more features, such as creating snapshots in a project
-// different from the source disk project.
-//
-// - project: Project ID for this request.
-func (r *SnapshotsService) Insert(project string, snapshot *Snapshot) *SnapshotsInsertCall {
- c := &SnapshotsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.snapshot = snapshot
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *SnapshotsInsertCall) RequestId(requestId string) *SnapshotsInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *SnapshotsInsertCall) Fields(s ...googleapi.Field) *SnapshotsInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *SnapshotsInsertCall) Context(ctx context.Context) *SnapshotsInsertCall {
- 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 *SnapshotsInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SnapshotsInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/snapshots")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.snapshots.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *SnapshotsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a snapshot in the specified project using the data included in the request. For regular snapshot creation, consider using this method instead of disks.createSnapshot, as this method supports more features, such as creating snapshots in a project different from the source disk project.",
- // "flatPath": "projects/{project}/global/snapshots",
- // "httpMethod": "POST",
- // "id": "compute.snapshots.insert",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/snapshots",
- // "request": {
- // "$ref": "Snapshot"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.snapshots.list":
-
-type SnapshotsListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves the list of Snapshot resources contained within the
-// specified project.
-//
-// - project: Project ID for this request.
-func (r *SnapshotsService) List(project string) *SnapshotsListCall {
- c := &SnapshotsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *SnapshotsListCall) Filter(filter string) *SnapshotsListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *SnapshotsListCall) MaxResults(maxResults int64) *SnapshotsListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *SnapshotsListCall) OrderBy(orderBy string) *SnapshotsListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *SnapshotsListCall) PageToken(pageToken string) *SnapshotsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *SnapshotsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *SnapshotsListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *SnapshotsListCall) Fields(s ...googleapi.Field) *SnapshotsListCall {
- 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 *SnapshotsListCall) IfNoneMatch(entityTag string) *SnapshotsListCall {
- 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 *SnapshotsListCall) Context(ctx context.Context) *SnapshotsListCall {
- 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 *SnapshotsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SnapshotsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/snapshots")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.snapshots.list" call.
-// Exactly one of *SnapshotList or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *SnapshotList.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 *SnapshotsListCall) Do(opts ...googleapi.CallOption) (*SnapshotList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &SnapshotList{
- 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": "Retrieves the list of Snapshot resources contained within the specified project.",
- // "flatPath": "projects/{project}/global/snapshots",
- // "httpMethod": "GET",
- // "id": "compute.snapshots.list",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/snapshots",
- // "response": {
- // "$ref": "SnapshotList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *SnapshotsListCall) Pages(ctx context.Context, f func(*SnapshotList) 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 "compute.snapshots.setIamPolicy":
-
-type SnapshotsSetIamPolicyCall struct {
- s *Service
- project string
- resource string
- globalsetpolicyrequest *GlobalSetPolicyRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetIamPolicy: Sets the access control policy on the specified
-// resource. Replaces any existing policy.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-func (r *SnapshotsService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *SnapshotsSetIamPolicyCall {
- c := &SnapshotsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.resource = resource
- c.globalsetpolicyrequest = globalsetpolicyrequest
- 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 *SnapshotsSetIamPolicyCall) Fields(s ...googleapi.Field) *SnapshotsSetIamPolicyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *SnapshotsSetIamPolicyCall) Context(ctx context.Context) *SnapshotsSetIamPolicyCall {
- 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 *SnapshotsSetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SnapshotsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/snapshots/{resource}/setIamPolicy")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.snapshots.setIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *SnapshotsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Sets the access control policy on the specified resource. Replaces any existing policy.",
- // "flatPath": "projects/{project}/global/snapshots/{resource}/setIamPolicy",
- // "httpMethod": "POST",
- // "id": "compute.snapshots.setIamPolicy",
- // "parameterOrder": [
- // "project",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/snapshots/{resource}/setIamPolicy",
- // "request": {
- // "$ref": "GlobalSetPolicyRequest"
- // },
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.snapshots.setLabels":
-
-type SnapshotsSetLabelsCall struct {
- s *Service
- project string
- resource string
- globalsetlabelsrequest *GlobalSetLabelsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetLabels: Sets the labels on a snapshot. To learn more about labels,
-// read the Labeling Resources documentation.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-func (r *SnapshotsService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *SnapshotsSetLabelsCall {
- c := &SnapshotsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.resource = resource
- c.globalsetlabelsrequest = globalsetlabelsrequest
- 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 *SnapshotsSetLabelsCall) Fields(s ...googleapi.Field) *SnapshotsSetLabelsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *SnapshotsSetLabelsCall) Context(ctx context.Context) *SnapshotsSetLabelsCall {
- 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 *SnapshotsSetLabelsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SnapshotsSetLabelsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/snapshots/{resource}/setLabels")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.snapshots.setLabels" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *SnapshotsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation.",
- // "flatPath": "projects/{project}/global/snapshots/{resource}/setLabels",
- // "httpMethod": "POST",
- // "id": "compute.snapshots.setLabels",
- // "parameterOrder": [
- // "project",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/snapshots/{resource}/setLabels",
- // "request": {
- // "$ref": "GlobalSetLabelsRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.snapshots.testIamPermissions":
-
-type SnapshotsTestIamPermissionsCall struct {
- s *Service
- project string
- resource string
- testpermissionsrequest *TestPermissionsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// TestIamPermissions: Returns permissions that a caller has on the
-// specified resource.
-//
-// - project: Project ID for this request.
-// - resource: Name or id of the resource for this request.
-func (r *SnapshotsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *SnapshotsTestIamPermissionsCall {
- c := &SnapshotsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.resource = resource
- c.testpermissionsrequest = testpermissionsrequest
- 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 *SnapshotsTestIamPermissionsCall) Fields(s ...googleapi.Field) *SnapshotsTestIamPermissionsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *SnapshotsTestIamPermissionsCall) Context(ctx context.Context) *SnapshotsTestIamPermissionsCall {
- 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 *SnapshotsTestIamPermissionsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SnapshotsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/snapshots/{resource}/testIamPermissions")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.snapshots.testIamPermissions" call.
-// Exactly one of *TestPermissionsResponse or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *TestPermissionsResponse.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 *SnapshotsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TestPermissionsResponse{
- 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": "Returns permissions that a caller has on the specified resource.",
- // "flatPath": "projects/{project}/global/snapshots/{resource}/testIamPermissions",
- // "httpMethod": "POST",
- // "id": "compute.snapshots.testIamPermissions",
- // "parameterOrder": [
- // "project",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/snapshots/{resource}/testIamPermissions",
- // "request": {
- // "$ref": "TestPermissionsRequest"
- // },
- // "response": {
- // "$ref": "TestPermissionsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.sslCertificates.aggregatedList":
-
-type SslCertificatesAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Retrieves the list of all SslCertificate resources,
-// regional and global, available to the specified project.
-//
-// - project: Name of the project scoping this request.
-func (r *SslCertificatesService) AggregatedList(project string) *SslCertificatesAggregatedListCall {
- c := &SslCertificatesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *SslCertificatesAggregatedListCall) Filter(filter string) *SslCertificatesAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *SslCertificatesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *SslCertificatesAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *SslCertificatesAggregatedListCall) MaxResults(maxResults int64) *SslCertificatesAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *SslCertificatesAggregatedListCall) OrderBy(orderBy string) *SslCertificatesAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *SslCertificatesAggregatedListCall) PageToken(pageToken string) *SslCertificatesAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *SslCertificatesAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *SslCertificatesAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *SslCertificatesAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *SslCertificatesAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *SslCertificatesAggregatedListCall) Fields(s ...googleapi.Field) *SslCertificatesAggregatedListCall {
- 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 *SslCertificatesAggregatedListCall) IfNoneMatch(entityTag string) *SslCertificatesAggregatedListCall {
- 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 *SslCertificatesAggregatedListCall) Context(ctx context.Context) *SslCertificatesAggregatedListCall {
- 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 *SslCertificatesAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SslCertificatesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/sslCertificates")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.sslCertificates.aggregatedList" call.
-// Exactly one of *SslCertificateAggregatedList or error will be
-// non-nil. Any non-2xx status code is an error. Response headers are in
-// either *SslCertificateAggregatedList.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 *SslCertificatesAggregatedListCall) Do(opts ...googleapi.CallOption) (*SslCertificateAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &SslCertificateAggregatedList{
- 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": "Retrieves the list of all SslCertificate resources, regional and global, available to the specified project.",
- // "flatPath": "projects/{project}/aggregated/sslCertificates",
- // "httpMethod": "GET",
- // "id": "compute.sslCertificates.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Name of the project scoping this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/sslCertificates",
- // "response": {
- // "$ref": "SslCertificateAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *SslCertificatesAggregatedListCall) Pages(ctx context.Context, f func(*SslCertificateAggregatedList) 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 "compute.sslCertificates.delete":
-
-type SslCertificatesDeleteCall struct {
- s *Service
- project string
- sslCertificate string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified SslCertificate resource.
-//
-// - project: Project ID for this request.
-// - sslCertificate: Name of the SslCertificate resource to delete.
-func (r *SslCertificatesService) Delete(project string, sslCertificate string) *SslCertificatesDeleteCall {
- c := &SslCertificatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.sslCertificate = sslCertificate
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *SslCertificatesDeleteCall) RequestId(requestId string) *SslCertificatesDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *SslCertificatesDeleteCall) Fields(s ...googleapi.Field) *SslCertificatesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *SslCertificatesDeleteCall) Context(ctx context.Context) *SslCertificatesDeleteCall {
- 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 *SslCertificatesDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SslCertificatesDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/sslCertificates/{sslCertificate}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "sslCertificate": c.sslCertificate,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.sslCertificates.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *SslCertificatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified SslCertificate resource.",
- // "flatPath": "projects/{project}/global/sslCertificates/{sslCertificate}",
- // "httpMethod": "DELETE",
- // "id": "compute.sslCertificates.delete",
- // "parameterOrder": [
- // "project",
- // "sslCertificate"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "sslCertificate": {
- // "description": "Name of the SslCertificate resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/sslCertificates/{sslCertificate}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.sslCertificates.get":
-
-type SslCertificatesGetCall struct {
- s *Service
- project string
- sslCertificate string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified SslCertificate resource.
-//
-// - project: Project ID for this request.
-// - sslCertificate: Name of the SslCertificate resource to return.
-func (r *SslCertificatesService) Get(project string, sslCertificate string) *SslCertificatesGetCall {
- c := &SslCertificatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.sslCertificate = sslCertificate
- 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 *SslCertificatesGetCall) Fields(s ...googleapi.Field) *SslCertificatesGetCall {
- 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 *SslCertificatesGetCall) IfNoneMatch(entityTag string) *SslCertificatesGetCall {
- 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 *SslCertificatesGetCall) Context(ctx context.Context) *SslCertificatesGetCall {
- 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 *SslCertificatesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SslCertificatesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/sslCertificates/{sslCertificate}")
- 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{
- "project": c.project,
- "sslCertificate": c.sslCertificate,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.sslCertificates.get" call.
-// Exactly one of *SslCertificate or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *SslCertificate.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 *SslCertificatesGetCall) Do(opts ...googleapi.CallOption) (*SslCertificate, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &SslCertificate{
- 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": "Returns the specified SslCertificate resource.",
- // "flatPath": "projects/{project}/global/sslCertificates/{sslCertificate}",
- // "httpMethod": "GET",
- // "id": "compute.sslCertificates.get",
- // "parameterOrder": [
- // "project",
- // "sslCertificate"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "sslCertificate": {
- // "description": "Name of the SslCertificate resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/sslCertificates/{sslCertificate}",
- // "response": {
- // "$ref": "SslCertificate"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.sslCertificates.insert":
-
-type SslCertificatesInsertCall struct {
- s *Service
- project string
- sslcertificate *SslCertificate
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a SslCertificate resource in the specified project
-// using the data included in the request.
-//
-// - project: Project ID for this request.
-func (r *SslCertificatesService) Insert(project string, sslcertificate *SslCertificate) *SslCertificatesInsertCall {
- c := &SslCertificatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.sslcertificate = sslcertificate
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *SslCertificatesInsertCall) RequestId(requestId string) *SslCertificatesInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *SslCertificatesInsertCall) Fields(s ...googleapi.Field) *SslCertificatesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *SslCertificatesInsertCall) Context(ctx context.Context) *SslCertificatesInsertCall {
- 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 *SslCertificatesInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SslCertificatesInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertificate)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/sslCertificates")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.sslCertificates.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *SslCertificatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a SslCertificate resource in the specified project using the data included in the request.",
- // "flatPath": "projects/{project}/global/sslCertificates",
- // "httpMethod": "POST",
- // "id": "compute.sslCertificates.insert",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/sslCertificates",
- // "request": {
- // "$ref": "SslCertificate"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.sslCertificates.list":
-
-type SslCertificatesListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves the list of SslCertificate resources available to the
-// specified project.
-//
-// - project: Project ID for this request.
-func (r *SslCertificatesService) List(project string) *SslCertificatesListCall {
- c := &SslCertificatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *SslCertificatesListCall) Filter(filter string) *SslCertificatesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *SslCertificatesListCall) MaxResults(maxResults int64) *SslCertificatesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *SslCertificatesListCall) OrderBy(orderBy string) *SslCertificatesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *SslCertificatesListCall) PageToken(pageToken string) *SslCertificatesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *SslCertificatesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *SslCertificatesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *SslCertificatesListCall) Fields(s ...googleapi.Field) *SslCertificatesListCall {
- 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 *SslCertificatesListCall) IfNoneMatch(entityTag string) *SslCertificatesListCall {
- 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 *SslCertificatesListCall) Context(ctx context.Context) *SslCertificatesListCall {
- 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 *SslCertificatesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SslCertificatesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/sslCertificates")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.sslCertificates.list" call.
-// Exactly one of *SslCertificateList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *SslCertificateList.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 *SslCertificatesListCall) Do(opts ...googleapi.CallOption) (*SslCertificateList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &SslCertificateList{
- 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": "Retrieves the list of SslCertificate resources available to the specified project.",
- // "flatPath": "projects/{project}/global/sslCertificates",
- // "httpMethod": "GET",
- // "id": "compute.sslCertificates.list",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/sslCertificates",
- // "response": {
- // "$ref": "SslCertificateList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *SslCertificatesListCall) Pages(ctx context.Context, f func(*SslCertificateList) 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 "compute.sslPolicies.aggregatedList":
-
-type SslPoliciesAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Retrieves the list of all SslPolicy resources,
-// regional and global, available to the specified project.
-//
-// - project: Name of the project scoping this request.
-func (r *SslPoliciesService) AggregatedList(project string) *SslPoliciesAggregatedListCall {
- c := &SslPoliciesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *SslPoliciesAggregatedListCall) Filter(filter string) *SslPoliciesAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *SslPoliciesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *SslPoliciesAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *SslPoliciesAggregatedListCall) MaxResults(maxResults int64) *SslPoliciesAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *SslPoliciesAggregatedListCall) OrderBy(orderBy string) *SslPoliciesAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *SslPoliciesAggregatedListCall) PageToken(pageToken string) *SslPoliciesAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *SslPoliciesAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *SslPoliciesAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *SslPoliciesAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *SslPoliciesAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *SslPoliciesAggregatedListCall) Fields(s ...googleapi.Field) *SslPoliciesAggregatedListCall {
- 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 *SslPoliciesAggregatedListCall) IfNoneMatch(entityTag string) *SslPoliciesAggregatedListCall {
- 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 *SslPoliciesAggregatedListCall) Context(ctx context.Context) *SslPoliciesAggregatedListCall {
- 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 *SslPoliciesAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SslPoliciesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/sslPolicies")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.sslPolicies.aggregatedList" call.
-// Exactly one of *SslPoliciesAggregatedList or error will be non-nil.
-// Any non-2xx status code is an error. Response headers are in either
-// *SslPoliciesAggregatedList.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 *SslPoliciesAggregatedListCall) Do(opts ...googleapi.CallOption) (*SslPoliciesAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &SslPoliciesAggregatedList{
- 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": "Retrieves the list of all SslPolicy resources, regional and global, available to the specified project.",
- // "flatPath": "projects/{project}/aggregated/sslPolicies",
- // "httpMethod": "GET",
- // "id": "compute.sslPolicies.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Name of the project scoping this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/sslPolicies",
- // "response": {
- // "$ref": "SslPoliciesAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *SslPoliciesAggregatedListCall) Pages(ctx context.Context, f func(*SslPoliciesAggregatedList) 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 "compute.sslPolicies.delete":
-
-type SslPoliciesDeleteCall struct {
- s *Service
- project string
- sslPolicy string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified SSL policy. The SSL policy resource can
-// be deleted only if it is not in use by any TargetHttpsProxy or
-// TargetSslProxy resources.
-//
-// - project: Project ID for this request.
-// - sslPolicy: Name of the SSL policy to delete. The name must be 1-63
-// characters long, and comply with RFC1035.
-func (r *SslPoliciesService) Delete(project string, sslPolicy string) *SslPoliciesDeleteCall {
- c := &SslPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.sslPolicy = sslPolicy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *SslPoliciesDeleteCall) RequestId(requestId string) *SslPoliciesDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *SslPoliciesDeleteCall) Fields(s ...googleapi.Field) *SslPoliciesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *SslPoliciesDeleteCall) Context(ctx context.Context) *SslPoliciesDeleteCall {
- 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 *SslPoliciesDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SslPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/sslPolicies/{sslPolicy}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "sslPolicy": c.sslPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.sslPolicies.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *SslPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified SSL policy. The SSL policy resource can be deleted only if it is not in use by any TargetHttpsProxy or TargetSslProxy resources.",
- // "flatPath": "projects/{project}/global/sslPolicies/{sslPolicy}",
- // "httpMethod": "DELETE",
- // "id": "compute.sslPolicies.delete",
- // "parameterOrder": [
- // "project",
- // "sslPolicy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "sslPolicy": {
- // "description": "Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/sslPolicies/{sslPolicy}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.sslPolicies.get":
-
-type SslPoliciesGetCall struct {
- s *Service
- project string
- sslPolicy string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Lists all of the ordered rules present in a single specified
-// policy.
-//
-// - project: Project ID for this request.
-// - sslPolicy: Name of the SSL policy to update. The name must be 1-63
-// characters long, and comply with RFC1035.
-func (r *SslPoliciesService) Get(project string, sslPolicy string) *SslPoliciesGetCall {
- c := &SslPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.sslPolicy = sslPolicy
- 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 *SslPoliciesGetCall) Fields(s ...googleapi.Field) *SslPoliciesGetCall {
- 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 *SslPoliciesGetCall) IfNoneMatch(entityTag string) *SslPoliciesGetCall {
- 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 *SslPoliciesGetCall) Context(ctx context.Context) *SslPoliciesGetCall {
- 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 *SslPoliciesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SslPoliciesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/sslPolicies/{sslPolicy}")
- 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{
- "project": c.project,
- "sslPolicy": c.sslPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.sslPolicies.get" call.
-// Exactly one of *SslPolicy or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *SslPolicy.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 *SslPoliciesGetCall) Do(opts ...googleapi.CallOption) (*SslPolicy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &SslPolicy{
- 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": "Lists all of the ordered rules present in a single specified policy.",
- // "flatPath": "projects/{project}/global/sslPolicies/{sslPolicy}",
- // "httpMethod": "GET",
- // "id": "compute.sslPolicies.get",
- // "parameterOrder": [
- // "project",
- // "sslPolicy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "sslPolicy": {
- // "description": "Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/sslPolicies/{sslPolicy}",
- // "response": {
- // "$ref": "SslPolicy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.sslPolicies.insert":
-
-type SslPoliciesInsertCall struct {
- s *Service
- project string
- sslpolicy *SslPolicy
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Returns the specified SSL policy resource.
-//
-// - project: Project ID for this request.
-func (r *SslPoliciesService) Insert(project string, sslpolicy *SslPolicy) *SslPoliciesInsertCall {
- c := &SslPoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.sslpolicy = sslpolicy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *SslPoliciesInsertCall) RequestId(requestId string) *SslPoliciesInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *SslPoliciesInsertCall) Fields(s ...googleapi.Field) *SslPoliciesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *SslPoliciesInsertCall) Context(ctx context.Context) *SslPoliciesInsertCall {
- 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 *SslPoliciesInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SslPoliciesInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicy)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/sslPolicies")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.sslPolicies.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *SslPoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Returns the specified SSL policy resource.",
- // "flatPath": "projects/{project}/global/sslPolicies",
- // "httpMethod": "POST",
- // "id": "compute.sslPolicies.insert",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/sslPolicies",
- // "request": {
- // "$ref": "SslPolicy"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.sslPolicies.list":
-
-type SslPoliciesListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Lists all the SSL policies that have been configured for the
-// specified project.
-//
-// - project: Project ID for this request.
-func (r *SslPoliciesService) List(project string) *SslPoliciesListCall {
- c := &SslPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *SslPoliciesListCall) Filter(filter string) *SslPoliciesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *SslPoliciesListCall) MaxResults(maxResults int64) *SslPoliciesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *SslPoliciesListCall) OrderBy(orderBy string) *SslPoliciesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *SslPoliciesListCall) PageToken(pageToken string) *SslPoliciesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *SslPoliciesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *SslPoliciesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *SslPoliciesListCall) Fields(s ...googleapi.Field) *SslPoliciesListCall {
- 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 *SslPoliciesListCall) IfNoneMatch(entityTag string) *SslPoliciesListCall {
- 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 *SslPoliciesListCall) Context(ctx context.Context) *SslPoliciesListCall {
- 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 *SslPoliciesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SslPoliciesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/sslPolicies")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.sslPolicies.list" call.
-// Exactly one of *SslPoliciesList or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *SslPoliciesList.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 *SslPoliciesListCall) Do(opts ...googleapi.CallOption) (*SslPoliciesList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &SslPoliciesList{
- 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": "Lists all the SSL policies that have been configured for the specified project.",
- // "flatPath": "projects/{project}/global/sslPolicies",
- // "httpMethod": "GET",
- // "id": "compute.sslPolicies.list",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/sslPolicies",
- // "response": {
- // "$ref": "SslPoliciesList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *SslPoliciesListCall) Pages(ctx context.Context, f func(*SslPoliciesList) 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 "compute.sslPolicies.listAvailableFeatures":
-
-type SslPoliciesListAvailableFeaturesCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// ListAvailableFeatures: Lists all features that can be specified in
-// the SSL policy when using custom profile.
-//
-// - project: Project ID for this request.
-func (r *SslPoliciesService) ListAvailableFeatures(project string) *SslPoliciesListAvailableFeaturesCall {
- c := &SslPoliciesListAvailableFeaturesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *SslPoliciesListAvailableFeaturesCall) Filter(filter string) *SslPoliciesListAvailableFeaturesCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *SslPoliciesListAvailableFeaturesCall) MaxResults(maxResults int64) *SslPoliciesListAvailableFeaturesCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *SslPoliciesListAvailableFeaturesCall) OrderBy(orderBy string) *SslPoliciesListAvailableFeaturesCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *SslPoliciesListAvailableFeaturesCall) PageToken(pageToken string) *SslPoliciesListAvailableFeaturesCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *SslPoliciesListAvailableFeaturesCall) ReturnPartialSuccess(returnPartialSuccess bool) *SslPoliciesListAvailableFeaturesCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *SslPoliciesListAvailableFeaturesCall) Fields(s ...googleapi.Field) *SslPoliciesListAvailableFeaturesCall {
- 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 *SslPoliciesListAvailableFeaturesCall) IfNoneMatch(entityTag string) *SslPoliciesListAvailableFeaturesCall {
- 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 *SslPoliciesListAvailableFeaturesCall) Context(ctx context.Context) *SslPoliciesListAvailableFeaturesCall {
- 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 *SslPoliciesListAvailableFeaturesCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SslPoliciesListAvailableFeaturesCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/sslPolicies/listAvailableFeatures")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.sslPolicies.listAvailableFeatures" call.
-// Exactly one of *SslPoliciesListAvailableFeaturesResponse or error
-// will be non-nil. Any non-2xx status code is an error. Response
-// headers are in either
-// *SslPoliciesListAvailableFeaturesResponse.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 *SslPoliciesListAvailableFeaturesCall) Do(opts ...googleapi.CallOption) (*SslPoliciesListAvailableFeaturesResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &SslPoliciesListAvailableFeaturesResponse{
- 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": "Lists all features that can be specified in the SSL policy when using custom profile.",
- // "flatPath": "projects/{project}/global/sslPolicies/listAvailableFeatures",
- // "httpMethod": "GET",
- // "id": "compute.sslPolicies.listAvailableFeatures",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/sslPolicies/listAvailableFeatures",
- // "response": {
- // "$ref": "SslPoliciesListAvailableFeaturesResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.sslPolicies.patch":
-
-type SslPoliciesPatchCall struct {
- s *Service
- project string
- sslPolicy string
- sslpolicy *SslPolicy
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Patches the specified SSL policy with the data included in the
-// request.
-//
-// - project: Project ID for this request.
-// - sslPolicy: Name of the SSL policy to update. The name must be 1-63
-// characters long, and comply with RFC1035.
-func (r *SslPoliciesService) Patch(project string, sslPolicy string, sslpolicy *SslPolicy) *SslPoliciesPatchCall {
- c := &SslPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.sslPolicy = sslPolicy
- c.sslpolicy = sslpolicy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *SslPoliciesPatchCall) RequestId(requestId string) *SslPoliciesPatchCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *SslPoliciesPatchCall) Fields(s ...googleapi.Field) *SslPoliciesPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *SslPoliciesPatchCall) Context(ctx context.Context) *SslPoliciesPatchCall {
- 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 *SslPoliciesPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SslPoliciesPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicy)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/sslPolicies/{sslPolicy}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "sslPolicy": c.sslPolicy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.sslPolicies.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *SslPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Patches the specified SSL policy with the data included in the request.",
- // "flatPath": "projects/{project}/global/sslPolicies/{sslPolicy}",
- // "httpMethod": "PATCH",
- // "id": "compute.sslPolicies.patch",
- // "parameterOrder": [
- // "project",
- // "sslPolicy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "sslPolicy": {
- // "description": "Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/sslPolicies/{sslPolicy}",
- // "request": {
- // "$ref": "SslPolicy"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.subnetworks.aggregatedList":
-
-type SubnetworksAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Retrieves an aggregated list of subnetworks.
-//
-// - project: Project ID for this request.
-func (r *SubnetworksService) AggregatedList(project string) *SubnetworksAggregatedListCall {
- c := &SubnetworksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *SubnetworksAggregatedListCall) Filter(filter string) *SubnetworksAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *SubnetworksAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *SubnetworksAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *SubnetworksAggregatedListCall) MaxResults(maxResults int64) *SubnetworksAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *SubnetworksAggregatedListCall) OrderBy(orderBy string) *SubnetworksAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *SubnetworksAggregatedListCall) PageToken(pageToken string) *SubnetworksAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *SubnetworksAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *SubnetworksAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *SubnetworksAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *SubnetworksAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *SubnetworksAggregatedListCall) Fields(s ...googleapi.Field) *SubnetworksAggregatedListCall {
- 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 *SubnetworksAggregatedListCall) IfNoneMatch(entityTag string) *SubnetworksAggregatedListCall {
- 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 *SubnetworksAggregatedListCall) Context(ctx context.Context) *SubnetworksAggregatedListCall {
- 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 *SubnetworksAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SubnetworksAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/subnetworks")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.subnetworks.aggregatedList" call.
-// Exactly one of *SubnetworkAggregatedList or error will be non-nil.
-// Any non-2xx status code is an error. Response headers are in either
-// *SubnetworkAggregatedList.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 *SubnetworksAggregatedListCall) Do(opts ...googleapi.CallOption) (*SubnetworkAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &SubnetworkAggregatedList{
- 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": "Retrieves an aggregated list of subnetworks.",
- // "flatPath": "projects/{project}/aggregated/subnetworks",
- // "httpMethod": "GET",
- // "id": "compute.subnetworks.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/subnetworks",
- // "response": {
- // "$ref": "SubnetworkAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *SubnetworksAggregatedListCall) Pages(ctx context.Context, f func(*SubnetworkAggregatedList) 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 "compute.subnetworks.delete":
-
-type SubnetworksDeleteCall struct {
- s *Service
- project string
- region string
- subnetwork string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified subnetwork.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-// - subnetwork: Name of the Subnetwork resource to delete.
-func (r *SubnetworksService) Delete(project string, region string, subnetwork string) *SubnetworksDeleteCall {
- c := &SubnetworksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.subnetwork = subnetwork
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *SubnetworksDeleteCall) RequestId(requestId string) *SubnetworksDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *SubnetworksDeleteCall) Fields(s ...googleapi.Field) *SubnetworksDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *SubnetworksDeleteCall) Context(ctx context.Context) *SubnetworksDeleteCall {
- 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 *SubnetworksDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SubnetworksDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/subnetworks/{subnetwork}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "subnetwork": c.subnetwork,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.subnetworks.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *SubnetworksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified subnetwork.",
- // "flatPath": "projects/{project}/regions/{region}/subnetworks/{subnetwork}",
- // "httpMethod": "DELETE",
- // "id": "compute.subnetworks.delete",
- // "parameterOrder": [
- // "project",
- // "region",
- // "subnetwork"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "subnetwork": {
- // "description": "Name of the Subnetwork resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/subnetworks/{subnetwork}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.subnetworks.expandIpCidrRange":
-
-type SubnetworksExpandIpCidrRangeCall struct {
- s *Service
- project string
- region string
- subnetwork string
- subnetworksexpandipcidrrangerequest *SubnetworksExpandIpCidrRangeRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// ExpandIpCidrRange: Expands the IP CIDR range of the subnetwork to a
-// specified value.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-// - subnetwork: Name of the Subnetwork resource to update.
-func (r *SubnetworksService) ExpandIpCidrRange(project string, region string, subnetwork string, subnetworksexpandipcidrrangerequest *SubnetworksExpandIpCidrRangeRequest) *SubnetworksExpandIpCidrRangeCall {
- c := &SubnetworksExpandIpCidrRangeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.subnetwork = subnetwork
- c.subnetworksexpandipcidrrangerequest = subnetworksexpandipcidrrangerequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *SubnetworksExpandIpCidrRangeCall) RequestId(requestId string) *SubnetworksExpandIpCidrRangeCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *SubnetworksExpandIpCidrRangeCall) Fields(s ...googleapi.Field) *SubnetworksExpandIpCidrRangeCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *SubnetworksExpandIpCidrRangeCall) Context(ctx context.Context) *SubnetworksExpandIpCidrRangeCall {
- 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 *SubnetworksExpandIpCidrRangeCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SubnetworksExpandIpCidrRangeCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetworksexpandipcidrrangerequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "subnetwork": c.subnetwork,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.subnetworks.expandIpCidrRange" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *SubnetworksExpandIpCidrRangeCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Expands the IP CIDR range of the subnetwork to a specified value.",
- // "flatPath": "projects/{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange",
- // "httpMethod": "POST",
- // "id": "compute.subnetworks.expandIpCidrRange",
- // "parameterOrder": [
- // "project",
- // "region",
- // "subnetwork"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "subnetwork": {
- // "description": "Name of the Subnetwork resource to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange",
- // "request": {
- // "$ref": "SubnetworksExpandIpCidrRangeRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.subnetworks.get":
-
-type SubnetworksGetCall struct {
- s *Service
- project string
- region string
- subnetwork string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified subnetwork.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-// - subnetwork: Name of the Subnetwork resource to return.
-func (r *SubnetworksService) Get(project string, region string, subnetwork string) *SubnetworksGetCall {
- c := &SubnetworksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.subnetwork = subnetwork
- 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 *SubnetworksGetCall) Fields(s ...googleapi.Field) *SubnetworksGetCall {
- 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 *SubnetworksGetCall) IfNoneMatch(entityTag string) *SubnetworksGetCall {
- 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 *SubnetworksGetCall) Context(ctx context.Context) *SubnetworksGetCall {
- 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 *SubnetworksGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SubnetworksGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/subnetworks/{subnetwork}")
- 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{
- "project": c.project,
- "region": c.region,
- "subnetwork": c.subnetwork,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.subnetworks.get" call.
-// Exactly one of *Subnetwork or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Subnetwork.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 *SubnetworksGetCall) Do(opts ...googleapi.CallOption) (*Subnetwork, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Subnetwork{
- 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": "Returns the specified subnetwork.",
- // "flatPath": "projects/{project}/regions/{region}/subnetworks/{subnetwork}",
- // "httpMethod": "GET",
- // "id": "compute.subnetworks.get",
- // "parameterOrder": [
- // "project",
- // "region",
- // "subnetwork"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "subnetwork": {
- // "description": "Name of the Subnetwork resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/subnetworks/{subnetwork}",
- // "response": {
- // "$ref": "Subnetwork"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.subnetworks.getIamPolicy":
-
-type SubnetworksGetIamPolicyCall struct {
- s *Service
- project string
- region string
- resource string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetIamPolicy: Gets the access control policy for a resource. May be
-// empty if no such policy or resource exists.
-//
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-// - resource: Name or id of the resource for this request.
-func (r *SubnetworksService) GetIamPolicy(project string, region string, resource string) *SubnetworksGetIamPolicyCall {
- c := &SubnetworksGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.resource = resource
- return c
-}
-
-// OptionsRequestedPolicyVersion sets the optional parameter
-// "optionsRequestedPolicyVersion": Requested IAM Policy version.
-func (c *SubnetworksGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *SubnetworksGetIamPolicyCall {
- c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
- 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 *SubnetworksGetIamPolicyCall) Fields(s ...googleapi.Field) *SubnetworksGetIamPolicyCall {
- 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 *SubnetworksGetIamPolicyCall) IfNoneMatch(entityTag string) *SubnetworksGetIamPolicyCall {
- 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 *SubnetworksGetIamPolicyCall) Context(ctx context.Context) *SubnetworksGetIamPolicyCall {
- 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 *SubnetworksGetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SubnetworksGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/subnetworks/{resource}/getIamPolicy")
- 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{
- "project": c.project,
- "region": c.region,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.subnetworks.getIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *SubnetworksGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
- // "flatPath": "projects/{project}/regions/{region}/subnetworks/{resource}/getIamPolicy",
- // "httpMethod": "GET",
- // "id": "compute.subnetworks.getIamPolicy",
- // "parameterOrder": [
- // "project",
- // "region",
- // "resource"
- // ],
- // "parameters": {
- // "optionsRequestedPolicyVersion": {
- // "description": "Requested IAM Policy version.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/subnetworks/{resource}/getIamPolicy",
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.subnetworks.insert":
-
-type SubnetworksInsertCall struct {
- s *Service
- project string
- region string
- subnetwork *Subnetwork
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a subnetwork in the specified project using the data
-// included in the request.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *SubnetworksService) Insert(project string, region string, subnetwork *Subnetwork) *SubnetworksInsertCall {
- c := &SubnetworksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.subnetwork = subnetwork
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *SubnetworksInsertCall) RequestId(requestId string) *SubnetworksInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *SubnetworksInsertCall) Fields(s ...googleapi.Field) *SubnetworksInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *SubnetworksInsertCall) Context(ctx context.Context) *SubnetworksInsertCall {
- 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 *SubnetworksInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SubnetworksInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetwork)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/subnetworks")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.subnetworks.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *SubnetworksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a subnetwork in the specified project using the data included in the request.",
- // "flatPath": "projects/{project}/regions/{region}/subnetworks",
- // "httpMethod": "POST",
- // "id": "compute.subnetworks.insert",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/subnetworks",
- // "request": {
- // "$ref": "Subnetwork"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.subnetworks.list":
-
-type SubnetworksListCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves a list of subnetworks available to the specified
-// project.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *SubnetworksService) List(project string, region string) *SubnetworksListCall {
- c := &SubnetworksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *SubnetworksListCall) Filter(filter string) *SubnetworksListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *SubnetworksListCall) MaxResults(maxResults int64) *SubnetworksListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *SubnetworksListCall) OrderBy(orderBy string) *SubnetworksListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *SubnetworksListCall) PageToken(pageToken string) *SubnetworksListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *SubnetworksListCall) ReturnPartialSuccess(returnPartialSuccess bool) *SubnetworksListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *SubnetworksListCall) Fields(s ...googleapi.Field) *SubnetworksListCall {
- 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 *SubnetworksListCall) IfNoneMatch(entityTag string) *SubnetworksListCall {
- 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 *SubnetworksListCall) Context(ctx context.Context) *SubnetworksListCall {
- 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 *SubnetworksListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SubnetworksListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/subnetworks")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.subnetworks.list" call.
-// Exactly one of *SubnetworkList or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *SubnetworkList.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 *SubnetworksListCall) Do(opts ...googleapi.CallOption) (*SubnetworkList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &SubnetworkList{
- 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": "Retrieves a list of subnetworks available to the specified project.",
- // "flatPath": "projects/{project}/regions/{region}/subnetworks",
- // "httpMethod": "GET",
- // "id": "compute.subnetworks.list",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/subnetworks",
- // "response": {
- // "$ref": "SubnetworkList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *SubnetworksListCall) Pages(ctx context.Context, f func(*SubnetworkList) 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 "compute.subnetworks.listUsable":
-
-type SubnetworksListUsableCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// ListUsable: Retrieves an aggregated list of all usable subnetworks in
-// the project.
-//
-// - project: Project ID for this request.
-func (r *SubnetworksService) ListUsable(project string) *SubnetworksListUsableCall {
- c := &SubnetworksListUsableCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *SubnetworksListUsableCall) Filter(filter string) *SubnetworksListUsableCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *SubnetworksListUsableCall) MaxResults(maxResults int64) *SubnetworksListUsableCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *SubnetworksListUsableCall) OrderBy(orderBy string) *SubnetworksListUsableCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *SubnetworksListUsableCall) PageToken(pageToken string) *SubnetworksListUsableCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *SubnetworksListUsableCall) ReturnPartialSuccess(returnPartialSuccess bool) *SubnetworksListUsableCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *SubnetworksListUsableCall) Fields(s ...googleapi.Field) *SubnetworksListUsableCall {
- 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 *SubnetworksListUsableCall) IfNoneMatch(entityTag string) *SubnetworksListUsableCall {
- 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 *SubnetworksListUsableCall) Context(ctx context.Context) *SubnetworksListUsableCall {
- 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 *SubnetworksListUsableCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SubnetworksListUsableCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/subnetworks/listUsable")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.subnetworks.listUsable" call.
-// Exactly one of *UsableSubnetworksAggregatedList or error will be
-// non-nil. Any non-2xx status code is an error. Response headers are in
-// either *UsableSubnetworksAggregatedList.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 *SubnetworksListUsableCall) Do(opts ...googleapi.CallOption) (*UsableSubnetworksAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &UsableSubnetworksAggregatedList{
- 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": "Retrieves an aggregated list of all usable subnetworks in the project.",
- // "flatPath": "projects/{project}/aggregated/subnetworks/listUsable",
- // "httpMethod": "GET",
- // "id": "compute.subnetworks.listUsable",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/aggregated/subnetworks/listUsable",
- // "response": {
- // "$ref": "UsableSubnetworksAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *SubnetworksListUsableCall) Pages(ctx context.Context, f func(*UsableSubnetworksAggregatedList) 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 "compute.subnetworks.patch":
-
-type SubnetworksPatchCall struct {
- s *Service
- project string
- region string
- subnetwork string
- subnetwork2 *Subnetwork
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Patches the specified subnetwork with the data included in the
-// request. Only certain fields can be updated with a patch request as
-// indicated in the field descriptions. You must specify the current
-// fingerprint of the subnetwork resource being patched.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-// - subnetwork: Name of the Subnetwork resource to patch.
-func (r *SubnetworksService) Patch(project string, region string, subnetwork string, subnetwork2 *Subnetwork) *SubnetworksPatchCall {
- c := &SubnetworksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.subnetwork = subnetwork
- c.subnetwork2 = subnetwork2
- return c
-}
-
-// DrainTimeoutSeconds sets the optional parameter
-// "drainTimeoutSeconds": The drain timeout specifies the upper bound in
-// seconds on the amount of time allowed to drain connections from the
-// current ACTIVE subnetwork to the current BACKUP subnetwork. The drain
-// timeout is only applicable when the following conditions are true: -
-// the subnetwork being patched has purpose =
-// INTERNAL_HTTPS_LOAD_BALANCER - the subnetwork being patched has role
-// = BACKUP - the patch request is setting the role to ACTIVE. Note that
-// after this patch operation the roles of the ACTIVE and BACKUP
-// subnetworks will be swapped.
-func (c *SubnetworksPatchCall) DrainTimeoutSeconds(drainTimeoutSeconds int64) *SubnetworksPatchCall {
- c.urlParams_.Set("drainTimeoutSeconds", fmt.Sprint(drainTimeoutSeconds))
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *SubnetworksPatchCall) RequestId(requestId string) *SubnetworksPatchCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *SubnetworksPatchCall) Fields(s ...googleapi.Field) *SubnetworksPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *SubnetworksPatchCall) Context(ctx context.Context) *SubnetworksPatchCall {
- 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 *SubnetworksPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SubnetworksPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetwork2)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/subnetworks/{subnetwork}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "subnetwork": c.subnetwork,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.subnetworks.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *SubnetworksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Patches the specified subnetwork with the data included in the request. Only certain fields can be updated with a patch request as indicated in the field descriptions. You must specify the current fingerprint of the subnetwork resource being patched.",
- // "flatPath": "projects/{project}/regions/{region}/subnetworks/{subnetwork}",
- // "httpMethod": "PATCH",
- // "id": "compute.subnetworks.patch",
- // "parameterOrder": [
- // "project",
- // "region",
- // "subnetwork"
- // ],
- // "parameters": {
- // "drainTimeoutSeconds": {
- // "description": "The drain timeout specifies the upper bound in seconds on the amount of time allowed to drain connections from the current ACTIVE subnetwork to the current BACKUP subnetwork. The drain timeout is only applicable when the following conditions are true: - the subnetwork being patched has purpose = INTERNAL_HTTPS_LOAD_BALANCER - the subnetwork being patched has role = BACKUP - the patch request is setting the role to ACTIVE. Note that after this patch operation the roles of the ACTIVE and BACKUP subnetworks will be swapped.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "subnetwork": {
- // "description": "Name of the Subnetwork resource to patch.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/subnetworks/{subnetwork}",
- // "request": {
- // "$ref": "Subnetwork"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.subnetworks.setIamPolicy":
-
-type SubnetworksSetIamPolicyCall struct {
- s *Service
- project string
- region string
- resource string
- regionsetpolicyrequest *RegionSetPolicyRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetIamPolicy: Sets the access control policy on the specified
-// resource. Replaces any existing policy.
-//
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-// - resource: Name or id of the resource for this request.
-func (r *SubnetworksService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *SubnetworksSetIamPolicyCall {
- c := &SubnetworksSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.resource = resource
- c.regionsetpolicyrequest = regionsetpolicyrequest
- 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 *SubnetworksSetIamPolicyCall) Fields(s ...googleapi.Field) *SubnetworksSetIamPolicyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *SubnetworksSetIamPolicyCall) Context(ctx context.Context) *SubnetworksSetIamPolicyCall {
- 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 *SubnetworksSetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SubnetworksSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/subnetworks/{resource}/setIamPolicy")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.subnetworks.setIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.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 *SubnetworksSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Policy{
- 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": "Sets the access control policy on the specified resource. Replaces any existing policy.",
- // "flatPath": "projects/{project}/regions/{region}/subnetworks/{resource}/setIamPolicy",
- // "httpMethod": "POST",
- // "id": "compute.subnetworks.setIamPolicy",
- // "parameterOrder": [
- // "project",
- // "region",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/subnetworks/{resource}/setIamPolicy",
- // "request": {
- // "$ref": "RegionSetPolicyRequest"
- // },
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.subnetworks.setPrivateIpGoogleAccess":
-
-type SubnetworksSetPrivateIpGoogleAccessCall struct {
- s *Service
- project string
- region string
- subnetwork string
- subnetworkssetprivateipgoogleaccessrequest *SubnetworksSetPrivateIpGoogleAccessRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetPrivateIpGoogleAccess: Set whether VMs in this subnet can access
-// Google services without assigning external IP addresses through
-// Private Google Access.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-// - subnetwork: Name of the Subnetwork resource.
-func (r *SubnetworksService) SetPrivateIpGoogleAccess(project string, region string, subnetwork string, subnetworkssetprivateipgoogleaccessrequest *SubnetworksSetPrivateIpGoogleAccessRequest) *SubnetworksSetPrivateIpGoogleAccessCall {
- c := &SubnetworksSetPrivateIpGoogleAccessCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.subnetwork = subnetwork
- c.subnetworkssetprivateipgoogleaccessrequest = subnetworkssetprivateipgoogleaccessrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *SubnetworksSetPrivateIpGoogleAccessCall) RequestId(requestId string) *SubnetworksSetPrivateIpGoogleAccessCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *SubnetworksSetPrivateIpGoogleAccessCall) Fields(s ...googleapi.Field) *SubnetworksSetPrivateIpGoogleAccessCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *SubnetworksSetPrivateIpGoogleAccessCall) Context(ctx context.Context) *SubnetworksSetPrivateIpGoogleAccessCall {
- 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 *SubnetworksSetPrivateIpGoogleAccessCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SubnetworksSetPrivateIpGoogleAccessCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetworkssetprivateipgoogleaccessrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "subnetwork": c.subnetwork,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.subnetworks.setPrivateIpGoogleAccess" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *SubnetworksSetPrivateIpGoogleAccessCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access.",
- // "flatPath": "projects/{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess",
- // "httpMethod": "POST",
- // "id": "compute.subnetworks.setPrivateIpGoogleAccess",
- // "parameterOrder": [
- // "project",
- // "region",
- // "subnetwork"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "subnetwork": {
- // "description": "Name of the Subnetwork resource.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess",
- // "request": {
- // "$ref": "SubnetworksSetPrivateIpGoogleAccessRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.subnetworks.testIamPermissions":
-
-type SubnetworksTestIamPermissionsCall struct {
- s *Service
- project string
- region string
- resource string
- testpermissionsrequest *TestPermissionsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// TestIamPermissions: Returns permissions that a caller has on the
-// specified resource.
-//
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-// - resource: Name or id of the resource for this request.
-func (r *SubnetworksService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *SubnetworksTestIamPermissionsCall {
- c := &SubnetworksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.resource = resource
- c.testpermissionsrequest = testpermissionsrequest
- 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 *SubnetworksTestIamPermissionsCall) Fields(s ...googleapi.Field) *SubnetworksTestIamPermissionsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *SubnetworksTestIamPermissionsCall) Context(ctx context.Context) *SubnetworksTestIamPermissionsCall {
- 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 *SubnetworksTestIamPermissionsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *SubnetworksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/subnetworks/{resource}/testIamPermissions")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.subnetworks.testIamPermissions" call.
-// Exactly one of *TestPermissionsResponse or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *TestPermissionsResponse.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 *SubnetworksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TestPermissionsResponse{
- 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": "Returns permissions that a caller has on the specified resource.",
- // "flatPath": "projects/{project}/regions/{region}/subnetworks/{resource}/testIamPermissions",
- // "httpMethod": "POST",
- // "id": "compute.subnetworks.testIamPermissions",
- // "parameterOrder": [
- // "project",
- // "region",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/subnetworks/{resource}/testIamPermissions",
- // "request": {
- // "$ref": "TestPermissionsRequest"
- // },
- // "response": {
- // "$ref": "TestPermissionsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.targetGrpcProxies.delete":
-
-type TargetGrpcProxiesDeleteCall struct {
- s *Service
- project string
- targetGrpcProxy string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified TargetGrpcProxy in the given scope
-//
-// - project: Project ID for this request.
-// - targetGrpcProxy: Name of the TargetGrpcProxy resource to delete.
-func (r *TargetGrpcProxiesService) Delete(project string, targetGrpcProxy string) *TargetGrpcProxiesDeleteCall {
- c := &TargetGrpcProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.targetGrpcProxy = targetGrpcProxy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *TargetGrpcProxiesDeleteCall) RequestId(requestId string) *TargetGrpcProxiesDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *TargetGrpcProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetGrpcProxiesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetGrpcProxiesDeleteCall) Context(ctx context.Context) *TargetGrpcProxiesDeleteCall {
- 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 *TargetGrpcProxiesDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetGrpcProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetGrpcProxies/{targetGrpcProxy}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "targetGrpcProxy": c.targetGrpcProxy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetGrpcProxies.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *TargetGrpcProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified TargetGrpcProxy in the given scope",
- // "flatPath": "projects/{project}/global/targetGrpcProxies/{targetGrpcProxy}",
- // "httpMethod": "DELETE",
- // "id": "compute.targetGrpcProxies.delete",
- // "parameterOrder": [
- // "project",
- // "targetGrpcProxy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "targetGrpcProxy": {
- // "description": "Name of the TargetGrpcProxy resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/targetGrpcProxies/{targetGrpcProxy}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.targetGrpcProxies.get":
-
-type TargetGrpcProxiesGetCall struct {
- s *Service
- project string
- targetGrpcProxy string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified TargetGrpcProxy resource in the given
-// scope.
-//
-// - project: Project ID for this request.
-// - targetGrpcProxy: Name of the TargetGrpcProxy resource to return.
-func (r *TargetGrpcProxiesService) Get(project string, targetGrpcProxy string) *TargetGrpcProxiesGetCall {
- c := &TargetGrpcProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.targetGrpcProxy = targetGrpcProxy
- 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 *TargetGrpcProxiesGetCall) Fields(s ...googleapi.Field) *TargetGrpcProxiesGetCall {
- 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 *TargetGrpcProxiesGetCall) IfNoneMatch(entityTag string) *TargetGrpcProxiesGetCall {
- 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 *TargetGrpcProxiesGetCall) Context(ctx context.Context) *TargetGrpcProxiesGetCall {
- 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 *TargetGrpcProxiesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetGrpcProxiesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/targetGrpcProxies/{targetGrpcProxy}")
- 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{
- "project": c.project,
- "targetGrpcProxy": c.targetGrpcProxy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetGrpcProxies.get" call.
-// Exactly one of *TargetGrpcProxy or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *TargetGrpcProxy.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 *TargetGrpcProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetGrpcProxy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TargetGrpcProxy{
- 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": "Returns the specified TargetGrpcProxy resource in the given scope.",
- // "flatPath": "projects/{project}/global/targetGrpcProxies/{targetGrpcProxy}",
- // "httpMethod": "GET",
- // "id": "compute.targetGrpcProxies.get",
- // "parameterOrder": [
- // "project",
- // "targetGrpcProxy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "targetGrpcProxy": {
- // "description": "Name of the TargetGrpcProxy resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/targetGrpcProxies/{targetGrpcProxy}",
- // "response": {
- // "$ref": "TargetGrpcProxy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.targetGrpcProxies.insert":
-
-type TargetGrpcProxiesInsertCall struct {
- s *Service
- project string
- targetgrpcproxy *TargetGrpcProxy
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a TargetGrpcProxy in the specified project in the
-// given scope using the parameters that are included in the request.
-//
-// - project: Project ID for this request.
-func (r *TargetGrpcProxiesService) Insert(project string, targetgrpcproxy *TargetGrpcProxy) *TargetGrpcProxiesInsertCall {
- c := &TargetGrpcProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.targetgrpcproxy = targetgrpcproxy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *TargetGrpcProxiesInsertCall) RequestId(requestId string) *TargetGrpcProxiesInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *TargetGrpcProxiesInsertCall) Fields(s ...googleapi.Field) *TargetGrpcProxiesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetGrpcProxiesInsertCall) Context(ctx context.Context) *TargetGrpcProxiesInsertCall {
- 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 *TargetGrpcProxiesInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetGrpcProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetgrpcproxy)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetGrpcProxies")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetGrpcProxies.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *TargetGrpcProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a TargetGrpcProxy in the specified project in the given scope using the parameters that are included in the request.",
- // "flatPath": "projects/{project}/global/targetGrpcProxies",
- // "httpMethod": "POST",
- // "id": "compute.targetGrpcProxies.insert",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/targetGrpcProxies",
- // "request": {
- // "$ref": "TargetGrpcProxy"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.targetGrpcProxies.list":
-
-type TargetGrpcProxiesListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Lists the TargetGrpcProxies for a project in the given scope.
-//
-// - project: Project ID for this request.
-func (r *TargetGrpcProxiesService) List(project string) *TargetGrpcProxiesListCall {
- c := &TargetGrpcProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *TargetGrpcProxiesListCall) Filter(filter string) *TargetGrpcProxiesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *TargetGrpcProxiesListCall) MaxResults(maxResults int64) *TargetGrpcProxiesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *TargetGrpcProxiesListCall) OrderBy(orderBy string) *TargetGrpcProxiesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *TargetGrpcProxiesListCall) PageToken(pageToken string) *TargetGrpcProxiesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *TargetGrpcProxiesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *TargetGrpcProxiesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *TargetGrpcProxiesListCall) Fields(s ...googleapi.Field) *TargetGrpcProxiesListCall {
- 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 *TargetGrpcProxiesListCall) IfNoneMatch(entityTag string) *TargetGrpcProxiesListCall {
- 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 *TargetGrpcProxiesListCall) Context(ctx context.Context) *TargetGrpcProxiesListCall {
- 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 *TargetGrpcProxiesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetGrpcProxiesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/targetGrpcProxies")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetGrpcProxies.list" call.
-// Exactly one of *TargetGrpcProxyList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *TargetGrpcProxyList.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 *TargetGrpcProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetGrpcProxyList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TargetGrpcProxyList{
- 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": "Lists the TargetGrpcProxies for a project in the given scope.",
- // "flatPath": "projects/{project}/global/targetGrpcProxies",
- // "httpMethod": "GET",
- // "id": "compute.targetGrpcProxies.list",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/targetGrpcProxies",
- // "response": {
- // "$ref": "TargetGrpcProxyList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *TargetGrpcProxiesListCall) Pages(ctx context.Context, f func(*TargetGrpcProxyList) 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 "compute.targetGrpcProxies.patch":
-
-type TargetGrpcProxiesPatchCall struct {
- s *Service
- project string
- targetGrpcProxy string
- targetgrpcproxy *TargetGrpcProxy
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Patches the specified TargetGrpcProxy resource with the data
-// included in the request. This method supports PATCH semantics and
-// uses JSON merge patch format and processing rules.
-//
-// - project: Project ID for this request.
-// - targetGrpcProxy: Name of the TargetGrpcProxy resource to patch.
-func (r *TargetGrpcProxiesService) Patch(project string, targetGrpcProxy string, targetgrpcproxy *TargetGrpcProxy) *TargetGrpcProxiesPatchCall {
- c := &TargetGrpcProxiesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.targetGrpcProxy = targetGrpcProxy
- c.targetgrpcproxy = targetgrpcproxy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *TargetGrpcProxiesPatchCall) RequestId(requestId string) *TargetGrpcProxiesPatchCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *TargetGrpcProxiesPatchCall) Fields(s ...googleapi.Field) *TargetGrpcProxiesPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetGrpcProxiesPatchCall) Context(ctx context.Context) *TargetGrpcProxiesPatchCall {
- 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 *TargetGrpcProxiesPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetGrpcProxiesPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetgrpcproxy)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetGrpcProxies/{targetGrpcProxy}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "targetGrpcProxy": c.targetGrpcProxy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetGrpcProxies.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *TargetGrpcProxiesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Patches the specified TargetGrpcProxy resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules.",
- // "flatPath": "projects/{project}/global/targetGrpcProxies/{targetGrpcProxy}",
- // "httpMethod": "PATCH",
- // "id": "compute.targetGrpcProxies.patch",
- // "parameterOrder": [
- // "project",
- // "targetGrpcProxy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "targetGrpcProxy": {
- // "description": "Name of the TargetGrpcProxy resource to patch.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/targetGrpcProxies/{targetGrpcProxy}",
- // "request": {
- // "$ref": "TargetGrpcProxy"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.targetHttpProxies.aggregatedList":
-
-type TargetHttpProxiesAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Retrieves the list of all TargetHttpProxy resources,
-// regional and global, available to the specified project.
-//
-// - project: Name of the project scoping this request.
-func (r *TargetHttpProxiesService) AggregatedList(project string) *TargetHttpProxiesAggregatedListCall {
- c := &TargetHttpProxiesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *TargetHttpProxiesAggregatedListCall) Filter(filter string) *TargetHttpProxiesAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *TargetHttpProxiesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *TargetHttpProxiesAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *TargetHttpProxiesAggregatedListCall) MaxResults(maxResults int64) *TargetHttpProxiesAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *TargetHttpProxiesAggregatedListCall) OrderBy(orderBy string) *TargetHttpProxiesAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *TargetHttpProxiesAggregatedListCall) PageToken(pageToken string) *TargetHttpProxiesAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *TargetHttpProxiesAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *TargetHttpProxiesAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *TargetHttpProxiesAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *TargetHttpProxiesAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *TargetHttpProxiesAggregatedListCall) Fields(s ...googleapi.Field) *TargetHttpProxiesAggregatedListCall {
- 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 *TargetHttpProxiesAggregatedListCall) IfNoneMatch(entityTag string) *TargetHttpProxiesAggregatedListCall {
- 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 *TargetHttpProxiesAggregatedListCall) Context(ctx context.Context) *TargetHttpProxiesAggregatedListCall {
- 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 *TargetHttpProxiesAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetHttpProxiesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/targetHttpProxies")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetHttpProxies.aggregatedList" call.
-// Exactly one of *TargetHttpProxyAggregatedList or error will be
-// non-nil. Any non-2xx status code is an error. Response headers are in
-// either *TargetHttpProxyAggregatedList.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 *TargetHttpProxiesAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxyAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TargetHttpProxyAggregatedList{
- 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": "Retrieves the list of all TargetHttpProxy resources, regional and global, available to the specified project.",
- // "flatPath": "projects/{project}/aggregated/targetHttpProxies",
- // "httpMethod": "GET",
- // "id": "compute.targetHttpProxies.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Name of the project scoping this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/targetHttpProxies",
- // "response": {
- // "$ref": "TargetHttpProxyAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *TargetHttpProxiesAggregatedListCall) Pages(ctx context.Context, f func(*TargetHttpProxyAggregatedList) 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 "compute.targetHttpProxies.delete":
-
-type TargetHttpProxiesDeleteCall struct {
- s *Service
- project string
- targetHttpProxy string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified TargetHttpProxy resource.
-//
-// - project: Project ID for this request.
-// - targetHttpProxy: Name of the TargetHttpProxy resource to delete.
-func (r *TargetHttpProxiesService) Delete(project string, targetHttpProxy string) *TargetHttpProxiesDeleteCall {
- c := &TargetHttpProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.targetHttpProxy = targetHttpProxy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *TargetHttpProxiesDeleteCall) RequestId(requestId string) *TargetHttpProxiesDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *TargetHttpProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetHttpProxiesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetHttpProxiesDeleteCall) Context(ctx context.Context) *TargetHttpProxiesDeleteCall {
- 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 *TargetHttpProxiesDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetHttpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetHttpProxies/{targetHttpProxy}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "targetHttpProxy": c.targetHttpProxy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetHttpProxies.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *TargetHttpProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified TargetHttpProxy resource.",
- // "flatPath": "projects/{project}/global/targetHttpProxies/{targetHttpProxy}",
- // "httpMethod": "DELETE",
- // "id": "compute.targetHttpProxies.delete",
- // "parameterOrder": [
- // "project",
- // "targetHttpProxy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "targetHttpProxy": {
- // "description": "Name of the TargetHttpProxy resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/targetHttpProxies/{targetHttpProxy}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.targetHttpProxies.get":
-
-type TargetHttpProxiesGetCall struct {
- s *Service
- project string
- targetHttpProxy string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified TargetHttpProxy resource.
-//
-// - project: Project ID for this request.
-// - targetHttpProxy: Name of the TargetHttpProxy resource to return.
-func (r *TargetHttpProxiesService) Get(project string, targetHttpProxy string) *TargetHttpProxiesGetCall {
- c := &TargetHttpProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.targetHttpProxy = targetHttpProxy
- 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 *TargetHttpProxiesGetCall) Fields(s ...googleapi.Field) *TargetHttpProxiesGetCall {
- 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 *TargetHttpProxiesGetCall) IfNoneMatch(entityTag string) *TargetHttpProxiesGetCall {
- 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 *TargetHttpProxiesGetCall) Context(ctx context.Context) *TargetHttpProxiesGetCall {
- 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 *TargetHttpProxiesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetHttpProxiesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/targetHttpProxies/{targetHttpProxy}")
- 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{
- "project": c.project,
- "targetHttpProxy": c.targetHttpProxy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetHttpProxies.get" call.
-// Exactly one of *TargetHttpProxy or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *TargetHttpProxy.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 *TargetHttpProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TargetHttpProxy{
- 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": "Returns the specified TargetHttpProxy resource.",
- // "flatPath": "projects/{project}/global/targetHttpProxies/{targetHttpProxy}",
- // "httpMethod": "GET",
- // "id": "compute.targetHttpProxies.get",
- // "parameterOrder": [
- // "project",
- // "targetHttpProxy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "targetHttpProxy": {
- // "description": "Name of the TargetHttpProxy resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/targetHttpProxies/{targetHttpProxy}",
- // "response": {
- // "$ref": "TargetHttpProxy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.targetHttpProxies.insert":
-
-type TargetHttpProxiesInsertCall struct {
- s *Service
- project string
- targethttpproxy *TargetHttpProxy
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a TargetHttpProxy resource in the specified project
-// using the data included in the request.
-//
-// - project: Project ID for this request.
-func (r *TargetHttpProxiesService) Insert(project string, targethttpproxy *TargetHttpProxy) *TargetHttpProxiesInsertCall {
- c := &TargetHttpProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.targethttpproxy = targethttpproxy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *TargetHttpProxiesInsertCall) RequestId(requestId string) *TargetHttpProxiesInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *TargetHttpProxiesInsertCall) Fields(s ...googleapi.Field) *TargetHttpProxiesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetHttpProxiesInsertCall) Context(ctx context.Context) *TargetHttpProxiesInsertCall {
- 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 *TargetHttpProxiesInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetHttpProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpproxy)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetHttpProxies")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetHttpProxies.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *TargetHttpProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a TargetHttpProxy resource in the specified project using the data included in the request.",
- // "flatPath": "projects/{project}/global/targetHttpProxies",
- // "httpMethod": "POST",
- // "id": "compute.targetHttpProxies.insert",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/targetHttpProxies",
- // "request": {
- // "$ref": "TargetHttpProxy"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.targetHttpProxies.list":
-
-type TargetHttpProxiesListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves the list of TargetHttpProxy resources available to
-// the specified project.
-//
-// - project: Project ID for this request.
-func (r *TargetHttpProxiesService) List(project string) *TargetHttpProxiesListCall {
- c := &TargetHttpProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *TargetHttpProxiesListCall) Filter(filter string) *TargetHttpProxiesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *TargetHttpProxiesListCall) MaxResults(maxResults int64) *TargetHttpProxiesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *TargetHttpProxiesListCall) OrderBy(orderBy string) *TargetHttpProxiesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *TargetHttpProxiesListCall) PageToken(pageToken string) *TargetHttpProxiesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *TargetHttpProxiesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *TargetHttpProxiesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *TargetHttpProxiesListCall) Fields(s ...googleapi.Field) *TargetHttpProxiesListCall {
- 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 *TargetHttpProxiesListCall) IfNoneMatch(entityTag string) *TargetHttpProxiesListCall {
- 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 *TargetHttpProxiesListCall) Context(ctx context.Context) *TargetHttpProxiesListCall {
- 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 *TargetHttpProxiesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetHttpProxiesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/targetHttpProxies")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetHttpProxies.list" call.
-// Exactly one of *TargetHttpProxyList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *TargetHttpProxyList.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 *TargetHttpProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxyList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TargetHttpProxyList{
- 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": "Retrieves the list of TargetHttpProxy resources available to the specified project.",
- // "flatPath": "projects/{project}/global/targetHttpProxies",
- // "httpMethod": "GET",
- // "id": "compute.targetHttpProxies.list",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/targetHttpProxies",
- // "response": {
- // "$ref": "TargetHttpProxyList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *TargetHttpProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpProxyList) 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 "compute.targetHttpProxies.patch":
-
-type TargetHttpProxiesPatchCall struct {
- s *Service
- project string
- targetHttpProxy string
- targethttpproxy *TargetHttpProxy
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Patches the specified TargetHttpProxy resource with the data
-// included in the request. This method supports PATCH semantics and
-// uses JSON merge patch format and processing rules.
-//
-// - project: Project ID for this request.
-// - targetHttpProxy: Name of the TargetHttpProxy resource to patch.
-func (r *TargetHttpProxiesService) Patch(project string, targetHttpProxy string, targethttpproxy *TargetHttpProxy) *TargetHttpProxiesPatchCall {
- c := &TargetHttpProxiesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.targetHttpProxy = targetHttpProxy
- c.targethttpproxy = targethttpproxy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *TargetHttpProxiesPatchCall) RequestId(requestId string) *TargetHttpProxiesPatchCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *TargetHttpProxiesPatchCall) Fields(s ...googleapi.Field) *TargetHttpProxiesPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetHttpProxiesPatchCall) Context(ctx context.Context) *TargetHttpProxiesPatchCall {
- 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 *TargetHttpProxiesPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetHttpProxiesPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpproxy)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetHttpProxies/{targetHttpProxy}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "targetHttpProxy": c.targetHttpProxy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetHttpProxies.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *TargetHttpProxiesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Patches the specified TargetHttpProxy resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules.",
- // "flatPath": "projects/{project}/global/targetHttpProxies/{targetHttpProxy}",
- // "httpMethod": "PATCH",
- // "id": "compute.targetHttpProxies.patch",
- // "parameterOrder": [
- // "project",
- // "targetHttpProxy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "targetHttpProxy": {
- // "description": "Name of the TargetHttpProxy resource to patch.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/targetHttpProxies/{targetHttpProxy}",
- // "request": {
- // "$ref": "TargetHttpProxy"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.targetHttpProxies.setUrlMap":
-
-type TargetHttpProxiesSetUrlMapCall struct {
- s *Service
- project string
- targetHttpProxy string
- urlmapreference *UrlMapReference
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetUrlMap: Changes the URL map for TargetHttpProxy.
-//
-// - project: Project ID for this request.
-// - targetHttpProxy: Name of the TargetHttpProxy to set a URL map for.
-func (r *TargetHttpProxiesService) SetUrlMap(project string, targetHttpProxy string, urlmapreference *UrlMapReference) *TargetHttpProxiesSetUrlMapCall {
- c := &TargetHttpProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.targetHttpProxy = targetHttpProxy
- c.urlmapreference = urlmapreference
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *TargetHttpProxiesSetUrlMapCall) RequestId(requestId string) *TargetHttpProxiesSetUrlMapCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *TargetHttpProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *TargetHttpProxiesSetUrlMapCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetHttpProxiesSetUrlMapCall) Context(ctx context.Context) *TargetHttpProxiesSetUrlMapCall {
- 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 *TargetHttpProxiesSetUrlMapCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetHttpProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "targetHttpProxy": c.targetHttpProxy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetHttpProxies.setUrlMap" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *TargetHttpProxiesSetUrlMapCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Changes the URL map for TargetHttpProxy.",
- // "flatPath": "projects/{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap",
- // "httpMethod": "POST",
- // "id": "compute.targetHttpProxies.setUrlMap",
- // "parameterOrder": [
- // "project",
- // "targetHttpProxy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "targetHttpProxy": {
- // "description": "Name of the TargetHttpProxy to set a URL map for.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap",
- // "request": {
- // "$ref": "UrlMapReference"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.targetHttpsProxies.aggregatedList":
-
-type TargetHttpsProxiesAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Retrieves the list of all TargetHttpsProxy resources,
-// regional and global, available to the specified project.
-//
-// - project: Name of the project scoping this request.
-func (r *TargetHttpsProxiesService) AggregatedList(project string) *TargetHttpsProxiesAggregatedListCall {
- c := &TargetHttpsProxiesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *TargetHttpsProxiesAggregatedListCall) Filter(filter string) *TargetHttpsProxiesAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *TargetHttpsProxiesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *TargetHttpsProxiesAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *TargetHttpsProxiesAggregatedListCall) MaxResults(maxResults int64) *TargetHttpsProxiesAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *TargetHttpsProxiesAggregatedListCall) OrderBy(orderBy string) *TargetHttpsProxiesAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *TargetHttpsProxiesAggregatedListCall) PageToken(pageToken string) *TargetHttpsProxiesAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *TargetHttpsProxiesAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *TargetHttpsProxiesAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *TargetHttpsProxiesAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *TargetHttpsProxiesAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *TargetHttpsProxiesAggregatedListCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesAggregatedListCall {
- 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 *TargetHttpsProxiesAggregatedListCall) IfNoneMatch(entityTag string) *TargetHttpsProxiesAggregatedListCall {
- 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 *TargetHttpsProxiesAggregatedListCall) Context(ctx context.Context) *TargetHttpsProxiesAggregatedListCall {
- 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 *TargetHttpsProxiesAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetHttpsProxiesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/targetHttpsProxies")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetHttpsProxies.aggregatedList" call.
-// Exactly one of *TargetHttpsProxyAggregatedList or error will be
-// non-nil. Any non-2xx status code is an error. Response headers are in
-// either *TargetHttpsProxyAggregatedList.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 *TargetHttpsProxiesAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxyAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TargetHttpsProxyAggregatedList{
- 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": "Retrieves the list of all TargetHttpsProxy resources, regional and global, available to the specified project.",
- // "flatPath": "projects/{project}/aggregated/targetHttpsProxies",
- // "httpMethod": "GET",
- // "id": "compute.targetHttpsProxies.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Name of the project scoping this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/targetHttpsProxies",
- // "response": {
- // "$ref": "TargetHttpsProxyAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *TargetHttpsProxiesAggregatedListCall) Pages(ctx context.Context, f func(*TargetHttpsProxyAggregatedList) 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 "compute.targetHttpsProxies.delete":
-
-type TargetHttpsProxiesDeleteCall struct {
- s *Service
- project string
- targetHttpsProxy string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified TargetHttpsProxy resource.
-//
-// - project: Project ID for this request.
-// - targetHttpsProxy: Name of the TargetHttpsProxy resource to delete.
-func (r *TargetHttpsProxiesService) Delete(project string, targetHttpsProxy string) *TargetHttpsProxiesDeleteCall {
- c := &TargetHttpsProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.targetHttpsProxy = targetHttpsProxy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *TargetHttpsProxiesDeleteCall) RequestId(requestId string) *TargetHttpsProxiesDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *TargetHttpsProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetHttpsProxiesDeleteCall) Context(ctx context.Context) *TargetHttpsProxiesDeleteCall {
- 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 *TargetHttpsProxiesDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetHttpsProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "targetHttpsProxy": c.targetHttpsProxy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetHttpsProxies.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *TargetHttpsProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified TargetHttpsProxy resource.",
- // "flatPath": "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}",
- // "httpMethod": "DELETE",
- // "id": "compute.targetHttpsProxies.delete",
- // "parameterOrder": [
- // "project",
- // "targetHttpsProxy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "targetHttpsProxy": {
- // "description": "Name of the TargetHttpsProxy resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.targetHttpsProxies.get":
-
-type TargetHttpsProxiesGetCall struct {
- s *Service
- project string
- targetHttpsProxy string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified TargetHttpsProxy resource.
-//
-// - project: Project ID for this request.
-// - targetHttpsProxy: Name of the TargetHttpsProxy resource to return.
-func (r *TargetHttpsProxiesService) Get(project string, targetHttpsProxy string) *TargetHttpsProxiesGetCall {
- c := &TargetHttpsProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.targetHttpsProxy = targetHttpsProxy
- 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 *TargetHttpsProxiesGetCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesGetCall {
- 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 *TargetHttpsProxiesGetCall) IfNoneMatch(entityTag string) *TargetHttpsProxiesGetCall {
- 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 *TargetHttpsProxiesGetCall) Context(ctx context.Context) *TargetHttpsProxiesGetCall {
- 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 *TargetHttpsProxiesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetHttpsProxiesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}")
- 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{
- "project": c.project,
- "targetHttpsProxy": c.targetHttpsProxy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetHttpsProxies.get" call.
-// Exactly one of *TargetHttpsProxy or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *TargetHttpsProxy.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 *TargetHttpsProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TargetHttpsProxy{
- 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": "Returns the specified TargetHttpsProxy resource.",
- // "flatPath": "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}",
- // "httpMethod": "GET",
- // "id": "compute.targetHttpsProxies.get",
- // "parameterOrder": [
- // "project",
- // "targetHttpsProxy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "targetHttpsProxy": {
- // "description": "Name of the TargetHttpsProxy resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}",
- // "response": {
- // "$ref": "TargetHttpsProxy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.targetHttpsProxies.insert":
-
-type TargetHttpsProxiesInsertCall struct {
- s *Service
- project string
- targethttpsproxy *TargetHttpsProxy
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a TargetHttpsProxy resource in the specified project
-// using the data included in the request.
-//
-// - project: Project ID for this request.
-func (r *TargetHttpsProxiesService) Insert(project string, targethttpsproxy *TargetHttpsProxy) *TargetHttpsProxiesInsertCall {
- c := &TargetHttpsProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.targethttpsproxy = targethttpsproxy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *TargetHttpsProxiesInsertCall) RequestId(requestId string) *TargetHttpsProxiesInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *TargetHttpsProxiesInsertCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetHttpsProxiesInsertCall) Context(ctx context.Context) *TargetHttpsProxiesInsertCall {
- 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 *TargetHttpsProxiesInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetHttpsProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxy)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetHttpsProxies")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetHttpsProxies.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *TargetHttpsProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a TargetHttpsProxy resource in the specified project using the data included in the request.",
- // "flatPath": "projects/{project}/global/targetHttpsProxies",
- // "httpMethod": "POST",
- // "id": "compute.targetHttpsProxies.insert",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/targetHttpsProxies",
- // "request": {
- // "$ref": "TargetHttpsProxy"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.targetHttpsProxies.list":
-
-type TargetHttpsProxiesListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves the list of TargetHttpsProxy resources available to
-// the specified project.
-//
-// - project: Project ID for this request.
-func (r *TargetHttpsProxiesService) List(project string) *TargetHttpsProxiesListCall {
- c := &TargetHttpsProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *TargetHttpsProxiesListCall) Filter(filter string) *TargetHttpsProxiesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *TargetHttpsProxiesListCall) MaxResults(maxResults int64) *TargetHttpsProxiesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *TargetHttpsProxiesListCall) OrderBy(orderBy string) *TargetHttpsProxiesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *TargetHttpsProxiesListCall) PageToken(pageToken string) *TargetHttpsProxiesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *TargetHttpsProxiesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *TargetHttpsProxiesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *TargetHttpsProxiesListCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesListCall {
- 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 *TargetHttpsProxiesListCall) IfNoneMatch(entityTag string) *TargetHttpsProxiesListCall {
- 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 *TargetHttpsProxiesListCall) Context(ctx context.Context) *TargetHttpsProxiesListCall {
- 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 *TargetHttpsProxiesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetHttpsProxiesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/targetHttpsProxies")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetHttpsProxies.list" call.
-// Exactly one of *TargetHttpsProxyList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *TargetHttpsProxyList.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 *TargetHttpsProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxyList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TargetHttpsProxyList{
- 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": "Retrieves the list of TargetHttpsProxy resources available to the specified project.",
- // "flatPath": "projects/{project}/global/targetHttpsProxies",
- // "httpMethod": "GET",
- // "id": "compute.targetHttpsProxies.list",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/targetHttpsProxies",
- // "response": {
- // "$ref": "TargetHttpsProxyList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *TargetHttpsProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpsProxyList) 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 "compute.targetHttpsProxies.patch":
-
-type TargetHttpsProxiesPatchCall struct {
- s *Service
- project string
- targetHttpsProxy string
- targethttpsproxy *TargetHttpsProxy
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Patches the specified TargetHttpsProxy resource with the data
-// included in the request. This method supports PATCH semantics and
-// uses JSON merge patch format and processing rules.
-//
-// - project: Project ID for this request.
-// - targetHttpsProxy: Name of the TargetHttpsProxy resource to patch.
-func (r *TargetHttpsProxiesService) Patch(project string, targetHttpsProxy string, targethttpsproxy *TargetHttpsProxy) *TargetHttpsProxiesPatchCall {
- c := &TargetHttpsProxiesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.targetHttpsProxy = targetHttpsProxy
- c.targethttpsproxy = targethttpsproxy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *TargetHttpsProxiesPatchCall) RequestId(requestId string) *TargetHttpsProxiesPatchCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *TargetHttpsProxiesPatchCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetHttpsProxiesPatchCall) Context(ctx context.Context) *TargetHttpsProxiesPatchCall {
- 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 *TargetHttpsProxiesPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetHttpsProxiesPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxy)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "targetHttpsProxy": c.targetHttpsProxy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetHttpsProxies.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *TargetHttpsProxiesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Patches the specified TargetHttpsProxy resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules.",
- // "flatPath": "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}",
- // "httpMethod": "PATCH",
- // "id": "compute.targetHttpsProxies.patch",
- // "parameterOrder": [
- // "project",
- // "targetHttpsProxy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "targetHttpsProxy": {
- // "description": "Name of the TargetHttpsProxy resource to patch.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}",
- // "request": {
- // "$ref": "TargetHttpsProxy"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.targetHttpsProxies.setCertificateMap":
-
-type TargetHttpsProxiesSetCertificateMapCall struct {
- s *Service
- project string
- targetHttpsProxy string
- targethttpsproxiessetcertificatemaprequest *TargetHttpsProxiesSetCertificateMapRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetCertificateMap: Changes the Certificate Map for TargetHttpsProxy.
-//
-// - project: Project ID for this request.
-// - targetHttpsProxy: Name of the TargetHttpsProxy resource whose
-// CertificateMap is to be set. The name must be 1-63 characters long,
-// and comply with RFC1035.
-func (r *TargetHttpsProxiesService) SetCertificateMap(project string, targetHttpsProxy string, targethttpsproxiessetcertificatemaprequest *TargetHttpsProxiesSetCertificateMapRequest) *TargetHttpsProxiesSetCertificateMapCall {
- c := &TargetHttpsProxiesSetCertificateMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.targetHttpsProxy = targetHttpsProxy
- c.targethttpsproxiessetcertificatemaprequest = targethttpsproxiessetcertificatemaprequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *TargetHttpsProxiesSetCertificateMapCall) RequestId(requestId string) *TargetHttpsProxiesSetCertificateMapCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *TargetHttpsProxiesSetCertificateMapCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetCertificateMapCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetHttpsProxiesSetCertificateMapCall) Context(ctx context.Context) *TargetHttpsProxiesSetCertificateMapCall {
- 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 *TargetHttpsProxiesSetCertificateMapCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetHttpsProxiesSetCertificateMapCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxiessetcertificatemaprequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}/setCertificateMap")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "targetHttpsProxy": c.targetHttpsProxy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetHttpsProxies.setCertificateMap" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *TargetHttpsProxiesSetCertificateMapCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Changes the Certificate Map for TargetHttpsProxy.",
- // "flatPath": "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}/setCertificateMap",
- // "httpMethod": "POST",
- // "id": "compute.targetHttpsProxies.setCertificateMap",
- // "parameterOrder": [
- // "project",
- // "targetHttpsProxy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "targetHttpsProxy": {
- // "description": "Name of the TargetHttpsProxy resource whose CertificateMap is to be set. The name must be 1-63 characters long, and comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}/setCertificateMap",
- // "request": {
- // "$ref": "TargetHttpsProxiesSetCertificateMapRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.targetHttpsProxies.setQuicOverride":
-
-type TargetHttpsProxiesSetQuicOverrideCall struct {
- s *Service
- project string
- targetHttpsProxy string
- targethttpsproxiessetquicoverriderequest *TargetHttpsProxiesSetQuicOverrideRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetQuicOverride: Sets the QUIC override policy for TargetHttpsProxy.
-//
-// - project: Project ID for this request.
-// - targetHttpsProxy: Name of the TargetHttpsProxy resource to set the
-// QUIC override policy for. The name should conform to RFC1035.
-func (r *TargetHttpsProxiesService) SetQuicOverride(project string, targetHttpsProxy string, targethttpsproxiessetquicoverriderequest *TargetHttpsProxiesSetQuicOverrideRequest) *TargetHttpsProxiesSetQuicOverrideCall {
- c := &TargetHttpsProxiesSetQuicOverrideCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.targetHttpsProxy = targetHttpsProxy
- c.targethttpsproxiessetquicoverriderequest = targethttpsproxiessetquicoverriderequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *TargetHttpsProxiesSetQuicOverrideCall) RequestId(requestId string) *TargetHttpsProxiesSetQuicOverrideCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *TargetHttpsProxiesSetQuicOverrideCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetQuicOverrideCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetHttpsProxiesSetQuicOverrideCall) Context(ctx context.Context) *TargetHttpsProxiesSetQuicOverrideCall {
- 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 *TargetHttpsProxiesSetQuicOverrideCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetHttpsProxiesSetQuicOverrideCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxiessetquicoverriderequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}/setQuicOverride")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "targetHttpsProxy": c.targetHttpsProxy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetHttpsProxies.setQuicOverride" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *TargetHttpsProxiesSetQuicOverrideCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Sets the QUIC override policy for TargetHttpsProxy.",
- // "flatPath": "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}/setQuicOverride",
- // "httpMethod": "POST",
- // "id": "compute.targetHttpsProxies.setQuicOverride",
- // "parameterOrder": [
- // "project",
- // "targetHttpsProxy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "targetHttpsProxy": {
- // "description": "Name of the TargetHttpsProxy resource to set the QUIC override policy for. The name should conform to RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}/setQuicOverride",
- // "request": {
- // "$ref": "TargetHttpsProxiesSetQuicOverrideRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.targetHttpsProxies.setSslCertificates":
-
-type TargetHttpsProxiesSetSslCertificatesCall struct {
- s *Service
- project string
- targetHttpsProxy string
- targethttpsproxiessetsslcertificatesrequest *TargetHttpsProxiesSetSslCertificatesRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetSslCertificates: Replaces SslCertificates for TargetHttpsProxy.
-//
-// - project: Project ID for this request.
-// - targetHttpsProxy: Name of the TargetHttpsProxy resource to set an
-// SslCertificates resource for.
-func (r *TargetHttpsProxiesService) SetSslCertificates(project string, targetHttpsProxy string, targethttpsproxiessetsslcertificatesrequest *TargetHttpsProxiesSetSslCertificatesRequest) *TargetHttpsProxiesSetSslCertificatesCall {
- c := &TargetHttpsProxiesSetSslCertificatesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.targetHttpsProxy = targetHttpsProxy
- c.targethttpsproxiessetsslcertificatesrequest = targethttpsproxiessetsslcertificatesrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *TargetHttpsProxiesSetSslCertificatesCall) RequestId(requestId string) *TargetHttpsProxiesSetSslCertificatesCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *TargetHttpsProxiesSetSslCertificatesCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetSslCertificatesCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetHttpsProxiesSetSslCertificatesCall) Context(ctx context.Context) *TargetHttpsProxiesSetSslCertificatesCall {
- 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 *TargetHttpsProxiesSetSslCertificatesCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetHttpsProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxiessetsslcertificatesrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "targetHttpsProxy": c.targetHttpsProxy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetHttpsProxies.setSslCertificates" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *TargetHttpsProxiesSetSslCertificatesCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Replaces SslCertificates for TargetHttpsProxy.",
- // "flatPath": "projects/{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates",
- // "httpMethod": "POST",
- // "id": "compute.targetHttpsProxies.setSslCertificates",
- // "parameterOrder": [
- // "project",
- // "targetHttpsProxy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "targetHttpsProxy": {
- // "description": "Name of the TargetHttpsProxy resource to set an SslCertificates resource for.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates",
- // "request": {
- // "$ref": "TargetHttpsProxiesSetSslCertificatesRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.targetHttpsProxies.setSslPolicy":
-
-type TargetHttpsProxiesSetSslPolicyCall struct {
- s *Service
- project string
- targetHttpsProxy string
- sslpolicyreference *SslPolicyReference
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetSslPolicy: Sets the SSL policy for TargetHttpsProxy. The SSL
-// policy specifies the server-side support for SSL features. This
-// affects connections between clients and the HTTPS proxy load
-// balancer. They do not affect the connection between the load balancer
-// and the backends.
-//
-// - project: Project ID for this request.
-// - targetHttpsProxy: Name of the TargetHttpsProxy resource whose SSL
-// policy is to be set. The name must be 1-63 characters long, and
-// comply with RFC1035.
-func (r *TargetHttpsProxiesService) SetSslPolicy(project string, targetHttpsProxy string, sslpolicyreference *SslPolicyReference) *TargetHttpsProxiesSetSslPolicyCall {
- c := &TargetHttpsProxiesSetSslPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.targetHttpsProxy = targetHttpsProxy
- c.sslpolicyreference = sslpolicyreference
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *TargetHttpsProxiesSetSslPolicyCall) RequestId(requestId string) *TargetHttpsProxiesSetSslPolicyCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *TargetHttpsProxiesSetSslPolicyCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetSslPolicyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetHttpsProxiesSetSslPolicyCall) Context(ctx context.Context) *TargetHttpsProxiesSetSslPolicyCall {
- 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 *TargetHttpsProxiesSetSslPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetHttpsProxiesSetSslPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicyreference)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}/setSslPolicy")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "targetHttpsProxy": c.targetHttpsProxy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetHttpsProxies.setSslPolicy" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *TargetHttpsProxiesSetSslPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Sets the SSL policy for TargetHttpsProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the HTTPS proxy load balancer. They do not affect the connection between the load balancer and the backends.",
- // "flatPath": "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}/setSslPolicy",
- // "httpMethod": "POST",
- // "id": "compute.targetHttpsProxies.setSslPolicy",
- // "parameterOrder": [
- // "project",
- // "targetHttpsProxy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "targetHttpsProxy": {
- // "description": "Name of the TargetHttpsProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}/setSslPolicy",
- // "request": {
- // "$ref": "SslPolicyReference"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.targetHttpsProxies.setUrlMap":
-
-type TargetHttpsProxiesSetUrlMapCall struct {
- s *Service
- project string
- targetHttpsProxy string
- urlmapreference *UrlMapReference
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetUrlMap: Changes the URL map for TargetHttpsProxy.
-//
-// - project: Project ID for this request.
-// - targetHttpsProxy: Name of the TargetHttpsProxy resource whose URL
-// map is to be set.
-func (r *TargetHttpsProxiesService) SetUrlMap(project string, targetHttpsProxy string, urlmapreference *UrlMapReference) *TargetHttpsProxiesSetUrlMapCall {
- c := &TargetHttpsProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.targetHttpsProxy = targetHttpsProxy
- c.urlmapreference = urlmapreference
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *TargetHttpsProxiesSetUrlMapCall) RequestId(requestId string) *TargetHttpsProxiesSetUrlMapCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *TargetHttpsProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetUrlMapCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetHttpsProxiesSetUrlMapCall) Context(ctx context.Context) *TargetHttpsProxiesSetUrlMapCall {
- 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 *TargetHttpsProxiesSetUrlMapCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetHttpsProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "targetHttpsProxy": c.targetHttpsProxy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetHttpsProxies.setUrlMap" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *TargetHttpsProxiesSetUrlMapCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Changes the URL map for TargetHttpsProxy.",
- // "flatPath": "projects/{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap",
- // "httpMethod": "POST",
- // "id": "compute.targetHttpsProxies.setUrlMap",
- // "parameterOrder": [
- // "project",
- // "targetHttpsProxy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "targetHttpsProxy": {
- // "description": "Name of the TargetHttpsProxy resource whose URL map is to be set.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap",
- // "request": {
- // "$ref": "UrlMapReference"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.targetInstances.aggregatedList":
-
-type TargetInstancesAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Retrieves an aggregated list of target instances.
-//
-// - project: Project ID for this request.
-func (r *TargetInstancesService) AggregatedList(project string) *TargetInstancesAggregatedListCall {
- c := &TargetInstancesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *TargetInstancesAggregatedListCall) Filter(filter string) *TargetInstancesAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *TargetInstancesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *TargetInstancesAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *TargetInstancesAggregatedListCall) MaxResults(maxResults int64) *TargetInstancesAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *TargetInstancesAggregatedListCall) OrderBy(orderBy string) *TargetInstancesAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *TargetInstancesAggregatedListCall) PageToken(pageToken string) *TargetInstancesAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *TargetInstancesAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *TargetInstancesAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *TargetInstancesAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *TargetInstancesAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *TargetInstancesAggregatedListCall) Fields(s ...googleapi.Field) *TargetInstancesAggregatedListCall {
- 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 *TargetInstancesAggregatedListCall) IfNoneMatch(entityTag string) *TargetInstancesAggregatedListCall {
- 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 *TargetInstancesAggregatedListCall) Context(ctx context.Context) *TargetInstancesAggregatedListCall {
- 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 *TargetInstancesAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetInstancesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/targetInstances")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetInstances.aggregatedList" call.
-// Exactly one of *TargetInstanceAggregatedList or error will be
-// non-nil. Any non-2xx status code is an error. Response headers are in
-// either *TargetInstanceAggregatedList.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 *TargetInstancesAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetInstanceAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TargetInstanceAggregatedList{
- 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": "Retrieves an aggregated list of target instances.",
- // "flatPath": "projects/{project}/aggregated/targetInstances",
- // "httpMethod": "GET",
- // "id": "compute.targetInstances.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/targetInstances",
- // "response": {
- // "$ref": "TargetInstanceAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *TargetInstancesAggregatedListCall) Pages(ctx context.Context, f func(*TargetInstanceAggregatedList) 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 "compute.targetInstances.delete":
-
-type TargetInstancesDeleteCall struct {
- s *Service
- project string
- zone string
- targetInstance string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified TargetInstance resource.
-//
-// - project: Project ID for this request.
-// - targetInstance: Name of the TargetInstance resource to delete.
-// - zone: Name of the zone scoping this request.
-func (r *TargetInstancesService) Delete(project string, zone string, targetInstance string) *TargetInstancesDeleteCall {
- c := &TargetInstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.targetInstance = targetInstance
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *TargetInstancesDeleteCall) RequestId(requestId string) *TargetInstancesDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *TargetInstancesDeleteCall) Fields(s ...googleapi.Field) *TargetInstancesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetInstancesDeleteCall) Context(ctx context.Context) *TargetInstancesDeleteCall {
- 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 *TargetInstancesDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetInstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/targetInstances/{targetInstance}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "targetInstance": c.targetInstance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetInstances.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *TargetInstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified TargetInstance resource.",
- // "flatPath": "projects/{project}/zones/{zone}/targetInstances/{targetInstance}",
- // "httpMethod": "DELETE",
- // "id": "compute.targetInstances.delete",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "targetInstance"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "targetInstance": {
- // "description": "Name of the TargetInstance resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "Name of the zone scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/targetInstances/{targetInstance}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.targetInstances.get":
-
-type TargetInstancesGetCall struct {
- s *Service
- project string
- zone string
- targetInstance string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified TargetInstance resource.
-//
-// - project: Project ID for this request.
-// - targetInstance: Name of the TargetInstance resource to return.
-// - zone: Name of the zone scoping this request.
-func (r *TargetInstancesService) Get(project string, zone string, targetInstance string) *TargetInstancesGetCall {
- c := &TargetInstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.targetInstance = targetInstance
- 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 *TargetInstancesGetCall) Fields(s ...googleapi.Field) *TargetInstancesGetCall {
- 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 *TargetInstancesGetCall) IfNoneMatch(entityTag string) *TargetInstancesGetCall {
- 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 *TargetInstancesGetCall) Context(ctx context.Context) *TargetInstancesGetCall {
- 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 *TargetInstancesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetInstancesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}/targetInstances/{targetInstance}")
- 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{
- "project": c.project,
- "zone": c.zone,
- "targetInstance": c.targetInstance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetInstances.get" call.
-// Exactly one of *TargetInstance or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *TargetInstance.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 *TargetInstancesGetCall) Do(opts ...googleapi.CallOption) (*TargetInstance, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TargetInstance{
- 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": "Returns the specified TargetInstance resource.",
- // "flatPath": "projects/{project}/zones/{zone}/targetInstances/{targetInstance}",
- // "httpMethod": "GET",
- // "id": "compute.targetInstances.get",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "targetInstance"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "targetInstance": {
- // "description": "Name of the TargetInstance resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "Name of the zone scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/targetInstances/{targetInstance}",
- // "response": {
- // "$ref": "TargetInstance"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.targetInstances.insert":
-
-type TargetInstancesInsertCall struct {
- s *Service
- project string
- zone string
- targetinstance *TargetInstance
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a TargetInstance resource in the specified project
-// and zone using the data included in the request.
-//
-// - project: Project ID for this request.
-// - zone: Name of the zone scoping this request.
-func (r *TargetInstancesService) Insert(project string, zone string, targetinstance *TargetInstance) *TargetInstancesInsertCall {
- c := &TargetInstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.targetinstance = targetinstance
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *TargetInstancesInsertCall) RequestId(requestId string) *TargetInstancesInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *TargetInstancesInsertCall) Fields(s ...googleapi.Field) *TargetInstancesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetInstancesInsertCall) Context(ctx context.Context) *TargetInstancesInsertCall {
- 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 *TargetInstancesInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetInstancesInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetinstance)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/targetInstances")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetInstances.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *TargetInstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a TargetInstance resource in the specified project and zone using the data included in the request.",
- // "flatPath": "projects/{project}/zones/{zone}/targetInstances",
- // "httpMethod": "POST",
- // "id": "compute.targetInstances.insert",
- // "parameterOrder": [
- // "project",
- // "zone"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "zone": {
- // "description": "Name of the zone scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/targetInstances",
- // "request": {
- // "$ref": "TargetInstance"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.targetInstances.list":
-
-type TargetInstancesListCall struct {
- s *Service
- project string
- zone string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves a list of TargetInstance resources available to the
-// specified project and zone.
-//
-// - project: Project ID for this request.
-// - zone: Name of the zone scoping this request.
-func (r *TargetInstancesService) List(project string, zone string) *TargetInstancesListCall {
- c := &TargetInstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *TargetInstancesListCall) Filter(filter string) *TargetInstancesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *TargetInstancesListCall) MaxResults(maxResults int64) *TargetInstancesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *TargetInstancesListCall) OrderBy(orderBy string) *TargetInstancesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *TargetInstancesListCall) PageToken(pageToken string) *TargetInstancesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *TargetInstancesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *TargetInstancesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *TargetInstancesListCall) Fields(s ...googleapi.Field) *TargetInstancesListCall {
- 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 *TargetInstancesListCall) IfNoneMatch(entityTag string) *TargetInstancesListCall {
- 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 *TargetInstancesListCall) Context(ctx context.Context) *TargetInstancesListCall {
- 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 *TargetInstancesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetInstancesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}/targetInstances")
- 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{
- "project": c.project,
- "zone": c.zone,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetInstances.list" call.
-// Exactly one of *TargetInstanceList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *TargetInstanceList.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 *TargetInstancesListCall) Do(opts ...googleapi.CallOption) (*TargetInstanceList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TargetInstanceList{
- 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": "Retrieves a list of TargetInstance resources available to the specified project and zone.",
- // "flatPath": "projects/{project}/zones/{zone}/targetInstances",
- // "httpMethod": "GET",
- // "id": "compute.targetInstances.list",
- // "parameterOrder": [
- // "project",
- // "zone"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "zone": {
- // "description": "Name of the zone scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/targetInstances",
- // "response": {
- // "$ref": "TargetInstanceList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *TargetInstancesListCall) Pages(ctx context.Context, f func(*TargetInstanceList) 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 "compute.targetInstances.setSecurityPolicy":
-
-type TargetInstancesSetSecurityPolicyCall struct {
- s *Service
- project string
- zone string
- targetInstance string
- securitypolicyreference *SecurityPolicyReference
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetSecurityPolicy: Sets the Google Cloud Armor security policy for
-// the specified target instance. For more information, see Google Cloud
-// Armor Overview
-//
-// - project: Project ID for this request.
-// - targetInstance: Name of the TargetInstance resource to which the
-// security policy should be set. The name should conform to RFC1035.
-// - zone: Name of the zone scoping this request.
-func (r *TargetInstancesService) SetSecurityPolicy(project string, zone string, targetInstance string, securitypolicyreference *SecurityPolicyReference) *TargetInstancesSetSecurityPolicyCall {
- c := &TargetInstancesSetSecurityPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.targetInstance = targetInstance
- c.securitypolicyreference = securitypolicyreference
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *TargetInstancesSetSecurityPolicyCall) RequestId(requestId string) *TargetInstancesSetSecurityPolicyCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *TargetInstancesSetSecurityPolicyCall) Fields(s ...googleapi.Field) *TargetInstancesSetSecurityPolicyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetInstancesSetSecurityPolicyCall) Context(ctx context.Context) *TargetInstancesSetSecurityPolicyCall {
- 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 *TargetInstancesSetSecurityPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetInstancesSetSecurityPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyreference)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/targetInstances/{targetInstance}/setSecurityPolicy")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "targetInstance": c.targetInstance,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetInstances.setSecurityPolicy" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *TargetInstancesSetSecurityPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Sets the Google Cloud Armor security policy for the specified target instance. For more information, see Google Cloud Armor Overview",
- // "flatPath": "projects/{project}/zones/{zone}/targetInstances/{targetInstance}/setSecurityPolicy",
- // "httpMethod": "POST",
- // "id": "compute.targetInstances.setSecurityPolicy",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "targetInstance"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "targetInstance": {
- // "description": "Name of the TargetInstance resource to which the security policy should be set. The name should conform to RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "Name of the zone scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/targetInstances/{targetInstance}/setSecurityPolicy",
- // "request": {
- // "$ref": "SecurityPolicyReference"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.targetPools.addHealthCheck":
-
-type TargetPoolsAddHealthCheckCall struct {
- s *Service
- project string
- region string
- targetPool string
- targetpoolsaddhealthcheckrequest *TargetPoolsAddHealthCheckRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// AddHealthCheck: Adds health check URLs to a target pool.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-// - targetPool: Name of the target pool to add a health check to.
-func (r *TargetPoolsService) AddHealthCheck(project string, region string, targetPool string, targetpoolsaddhealthcheckrequest *TargetPoolsAddHealthCheckRequest) *TargetPoolsAddHealthCheckCall {
- c := &TargetPoolsAddHealthCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.targetPool = targetPool
- c.targetpoolsaddhealthcheckrequest = targetpoolsaddhealthcheckrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *TargetPoolsAddHealthCheckCall) RequestId(requestId string) *TargetPoolsAddHealthCheckCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *TargetPoolsAddHealthCheckCall) Fields(s ...googleapi.Field) *TargetPoolsAddHealthCheckCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetPoolsAddHealthCheckCall) Context(ctx context.Context) *TargetPoolsAddHealthCheckCall {
- 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 *TargetPoolsAddHealthCheckCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetPoolsAddHealthCheckCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddhealthcheckrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "targetPool": c.targetPool,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetPools.addHealthCheck" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *TargetPoolsAddHealthCheckCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Adds health check URLs to a target pool.",
- // "flatPath": "projects/{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck",
- // "httpMethod": "POST",
- // "id": "compute.targetPools.addHealthCheck",
- // "parameterOrder": [
- // "project",
- // "region",
- // "targetPool"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "targetPool": {
- // "description": "Name of the target pool to add a health check to.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck",
- // "request": {
- // "$ref": "TargetPoolsAddHealthCheckRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.targetPools.addInstance":
-
-type TargetPoolsAddInstanceCall struct {
- s *Service
- project string
- region string
- targetPool string
- targetpoolsaddinstancerequest *TargetPoolsAddInstanceRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// AddInstance: Adds an instance to a target pool.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-// - targetPool: Name of the TargetPool resource to add instances to.
-func (r *TargetPoolsService) AddInstance(project string, region string, targetPool string, targetpoolsaddinstancerequest *TargetPoolsAddInstanceRequest) *TargetPoolsAddInstanceCall {
- c := &TargetPoolsAddInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.targetPool = targetPool
- c.targetpoolsaddinstancerequest = targetpoolsaddinstancerequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *TargetPoolsAddInstanceCall) RequestId(requestId string) *TargetPoolsAddInstanceCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *TargetPoolsAddInstanceCall) Fields(s ...googleapi.Field) *TargetPoolsAddInstanceCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetPoolsAddInstanceCall) Context(ctx context.Context) *TargetPoolsAddInstanceCall {
- 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 *TargetPoolsAddInstanceCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetPoolsAddInstanceCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddinstancerequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetPools/{targetPool}/addInstance")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "targetPool": c.targetPool,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetPools.addInstance" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *TargetPoolsAddInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Adds an instance to a target pool.",
- // "flatPath": "projects/{project}/regions/{region}/targetPools/{targetPool}/addInstance",
- // "httpMethod": "POST",
- // "id": "compute.targetPools.addInstance",
- // "parameterOrder": [
- // "project",
- // "region",
- // "targetPool"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "targetPool": {
- // "description": "Name of the TargetPool resource to add instances to.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/targetPools/{targetPool}/addInstance",
- // "request": {
- // "$ref": "TargetPoolsAddInstanceRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.targetPools.aggregatedList":
-
-type TargetPoolsAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Retrieves an aggregated list of target pools.
-//
-// - project: Project ID for this request.
-func (r *TargetPoolsService) AggregatedList(project string) *TargetPoolsAggregatedListCall {
- c := &TargetPoolsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *TargetPoolsAggregatedListCall) Filter(filter string) *TargetPoolsAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *TargetPoolsAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *TargetPoolsAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *TargetPoolsAggregatedListCall) MaxResults(maxResults int64) *TargetPoolsAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *TargetPoolsAggregatedListCall) OrderBy(orderBy string) *TargetPoolsAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *TargetPoolsAggregatedListCall) PageToken(pageToken string) *TargetPoolsAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *TargetPoolsAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *TargetPoolsAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *TargetPoolsAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *TargetPoolsAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *TargetPoolsAggregatedListCall) Fields(s ...googleapi.Field) *TargetPoolsAggregatedListCall {
- 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 *TargetPoolsAggregatedListCall) IfNoneMatch(entityTag string) *TargetPoolsAggregatedListCall {
- 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 *TargetPoolsAggregatedListCall) Context(ctx context.Context) *TargetPoolsAggregatedListCall {
- 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 *TargetPoolsAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetPoolsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/targetPools")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetPools.aggregatedList" call.
-// Exactly one of *TargetPoolAggregatedList or error will be non-nil.
-// Any non-2xx status code is an error. Response headers are in either
-// *TargetPoolAggregatedList.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 *TargetPoolsAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetPoolAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TargetPoolAggregatedList{
- 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": "Retrieves an aggregated list of target pools.",
- // "flatPath": "projects/{project}/aggregated/targetPools",
- // "httpMethod": "GET",
- // "id": "compute.targetPools.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/targetPools",
- // "response": {
- // "$ref": "TargetPoolAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *TargetPoolsAggregatedListCall) Pages(ctx context.Context, f func(*TargetPoolAggregatedList) 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 "compute.targetPools.delete":
-
-type TargetPoolsDeleteCall struct {
- s *Service
- project string
- region string
- targetPool string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified target pool.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-// - targetPool: Name of the TargetPool resource to delete.
-func (r *TargetPoolsService) Delete(project string, region string, targetPool string) *TargetPoolsDeleteCall {
- c := &TargetPoolsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.targetPool = targetPool
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *TargetPoolsDeleteCall) RequestId(requestId string) *TargetPoolsDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *TargetPoolsDeleteCall) Fields(s ...googleapi.Field) *TargetPoolsDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetPoolsDeleteCall) Context(ctx context.Context) *TargetPoolsDeleteCall {
- 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 *TargetPoolsDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetPoolsDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetPools/{targetPool}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "targetPool": c.targetPool,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetPools.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *TargetPoolsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified target pool.",
- // "flatPath": "projects/{project}/regions/{region}/targetPools/{targetPool}",
- // "httpMethod": "DELETE",
- // "id": "compute.targetPools.delete",
- // "parameterOrder": [
- // "project",
- // "region",
- // "targetPool"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "targetPool": {
- // "description": "Name of the TargetPool resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/targetPools/{targetPool}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.targetPools.get":
-
-type TargetPoolsGetCall struct {
- s *Service
- project string
- region string
- targetPool string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified target pool.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-// - targetPool: Name of the TargetPool resource to return.
-func (r *TargetPoolsService) Get(project string, region string, targetPool string) *TargetPoolsGetCall {
- c := &TargetPoolsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.targetPool = targetPool
- 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 *TargetPoolsGetCall) Fields(s ...googleapi.Field) *TargetPoolsGetCall {
- 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 *TargetPoolsGetCall) IfNoneMatch(entityTag string) *TargetPoolsGetCall {
- 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 *TargetPoolsGetCall) Context(ctx context.Context) *TargetPoolsGetCall {
- 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 *TargetPoolsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetPoolsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/targetPools/{targetPool}")
- 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{
- "project": c.project,
- "region": c.region,
- "targetPool": c.targetPool,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetPools.get" call.
-// Exactly one of *TargetPool or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *TargetPool.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 *TargetPoolsGetCall) Do(opts ...googleapi.CallOption) (*TargetPool, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TargetPool{
- 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": "Returns the specified target pool.",
- // "flatPath": "projects/{project}/regions/{region}/targetPools/{targetPool}",
- // "httpMethod": "GET",
- // "id": "compute.targetPools.get",
- // "parameterOrder": [
- // "project",
- // "region",
- // "targetPool"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "targetPool": {
- // "description": "Name of the TargetPool resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/targetPools/{targetPool}",
- // "response": {
- // "$ref": "TargetPool"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.targetPools.getHealth":
-
-type TargetPoolsGetHealthCall struct {
- s *Service
- project string
- region string
- targetPool string
- instancereference *InstanceReference
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetHealth: Gets the most recent health check results for each IP for
-// the instance that is referenced by the given target pool.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-// - targetPool: Name of the TargetPool resource to which the queried
-// instance belongs.
-func (r *TargetPoolsService) GetHealth(project string, region string, targetPool string, instancereference *InstanceReference) *TargetPoolsGetHealthCall {
- c := &TargetPoolsGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.targetPool = targetPool
- c.instancereference = instancereference
- 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 *TargetPoolsGetHealthCall) Fields(s ...googleapi.Field) *TargetPoolsGetHealthCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetPoolsGetHealthCall) Context(ctx context.Context) *TargetPoolsGetHealthCall {
- 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 *TargetPoolsGetHealthCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetPoolsGetHealthCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancereference)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetPools/{targetPool}/getHealth")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "targetPool": c.targetPool,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetPools.getHealth" call.
-// Exactly one of *TargetPoolInstanceHealth or error will be non-nil.
-// Any non-2xx status code is an error. Response headers are in either
-// *TargetPoolInstanceHealth.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 *TargetPoolsGetHealthCall) Do(opts ...googleapi.CallOption) (*TargetPoolInstanceHealth, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TargetPoolInstanceHealth{
- 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": "Gets the most recent health check results for each IP for the instance that is referenced by the given target pool.",
- // "flatPath": "projects/{project}/regions/{region}/targetPools/{targetPool}/getHealth",
- // "httpMethod": "POST",
- // "id": "compute.targetPools.getHealth",
- // "parameterOrder": [
- // "project",
- // "region",
- // "targetPool"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "targetPool": {
- // "description": "Name of the TargetPool resource to which the queried instance belongs.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/targetPools/{targetPool}/getHealth",
- // "request": {
- // "$ref": "InstanceReference"
- // },
- // "response": {
- // "$ref": "TargetPoolInstanceHealth"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.targetPools.insert":
-
-type TargetPoolsInsertCall struct {
- s *Service
- project string
- region string
- targetpool *TargetPool
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a target pool in the specified project and region
-// using the data included in the request.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *TargetPoolsService) Insert(project string, region string, targetpool *TargetPool) *TargetPoolsInsertCall {
- c := &TargetPoolsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.targetpool = targetpool
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *TargetPoolsInsertCall) RequestId(requestId string) *TargetPoolsInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *TargetPoolsInsertCall) Fields(s ...googleapi.Field) *TargetPoolsInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetPoolsInsertCall) Context(ctx context.Context) *TargetPoolsInsertCall {
- 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 *TargetPoolsInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetPoolsInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpool)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetPools")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetPools.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *TargetPoolsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a target pool in the specified project and region using the data included in the request.",
- // "flatPath": "projects/{project}/regions/{region}/targetPools",
- // "httpMethod": "POST",
- // "id": "compute.targetPools.insert",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/targetPools",
- // "request": {
- // "$ref": "TargetPool"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.targetPools.list":
-
-type TargetPoolsListCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves a list of target pools available to the specified
-// project and region.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-func (r *TargetPoolsService) List(project string, region string) *TargetPoolsListCall {
- c := &TargetPoolsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *TargetPoolsListCall) Filter(filter string) *TargetPoolsListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *TargetPoolsListCall) MaxResults(maxResults int64) *TargetPoolsListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *TargetPoolsListCall) OrderBy(orderBy string) *TargetPoolsListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *TargetPoolsListCall) PageToken(pageToken string) *TargetPoolsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *TargetPoolsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *TargetPoolsListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *TargetPoolsListCall) Fields(s ...googleapi.Field) *TargetPoolsListCall {
- 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 *TargetPoolsListCall) IfNoneMatch(entityTag string) *TargetPoolsListCall {
- 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 *TargetPoolsListCall) Context(ctx context.Context) *TargetPoolsListCall {
- 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 *TargetPoolsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetPoolsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/targetPools")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetPools.list" call.
-// Exactly one of *TargetPoolList or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *TargetPoolList.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 *TargetPoolsListCall) Do(opts ...googleapi.CallOption) (*TargetPoolList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TargetPoolList{
- 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": "Retrieves a list of target pools available to the specified project and region.",
- // "flatPath": "projects/{project}/regions/{region}/targetPools",
- // "httpMethod": "GET",
- // "id": "compute.targetPools.list",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/targetPools",
- // "response": {
- // "$ref": "TargetPoolList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *TargetPoolsListCall) Pages(ctx context.Context, f func(*TargetPoolList) 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 "compute.targetPools.removeHealthCheck":
-
-type TargetPoolsRemoveHealthCheckCall struct {
- s *Service
- project string
- region string
- targetPool string
- targetpoolsremovehealthcheckrequest *TargetPoolsRemoveHealthCheckRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// RemoveHealthCheck: Removes health check URL from a target pool.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-// - targetPool: Name of the target pool to remove health checks from.
-func (r *TargetPoolsService) RemoveHealthCheck(project string, region string, targetPool string, targetpoolsremovehealthcheckrequest *TargetPoolsRemoveHealthCheckRequest) *TargetPoolsRemoveHealthCheckCall {
- c := &TargetPoolsRemoveHealthCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.targetPool = targetPool
- c.targetpoolsremovehealthcheckrequest = targetpoolsremovehealthcheckrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *TargetPoolsRemoveHealthCheckCall) RequestId(requestId string) *TargetPoolsRemoveHealthCheckCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *TargetPoolsRemoveHealthCheckCall) Fields(s ...googleapi.Field) *TargetPoolsRemoveHealthCheckCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetPoolsRemoveHealthCheckCall) Context(ctx context.Context) *TargetPoolsRemoveHealthCheckCall {
- 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 *TargetPoolsRemoveHealthCheckCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetPoolsRemoveHealthCheckCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremovehealthcheckrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "targetPool": c.targetPool,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetPools.removeHealthCheck" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *TargetPoolsRemoveHealthCheckCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Removes health check URL from a target pool.",
- // "flatPath": "projects/{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck",
- // "httpMethod": "POST",
- // "id": "compute.targetPools.removeHealthCheck",
- // "parameterOrder": [
- // "project",
- // "region",
- // "targetPool"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "targetPool": {
- // "description": "Name of the target pool to remove health checks from.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck",
- // "request": {
- // "$ref": "TargetPoolsRemoveHealthCheckRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.targetPools.removeInstance":
-
-type TargetPoolsRemoveInstanceCall struct {
- s *Service
- project string
- region string
- targetPool string
- targetpoolsremoveinstancerequest *TargetPoolsRemoveInstanceRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// RemoveInstance: Removes instance URL from a target pool.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-// - targetPool: Name of the TargetPool resource to remove instances
-// from.
-func (r *TargetPoolsService) RemoveInstance(project string, region string, targetPool string, targetpoolsremoveinstancerequest *TargetPoolsRemoveInstanceRequest) *TargetPoolsRemoveInstanceCall {
- c := &TargetPoolsRemoveInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.targetPool = targetPool
- c.targetpoolsremoveinstancerequest = targetpoolsremoveinstancerequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *TargetPoolsRemoveInstanceCall) RequestId(requestId string) *TargetPoolsRemoveInstanceCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *TargetPoolsRemoveInstanceCall) Fields(s ...googleapi.Field) *TargetPoolsRemoveInstanceCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetPoolsRemoveInstanceCall) Context(ctx context.Context) *TargetPoolsRemoveInstanceCall {
- 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 *TargetPoolsRemoveInstanceCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetPoolsRemoveInstanceCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremoveinstancerequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetPools/{targetPool}/removeInstance")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "targetPool": c.targetPool,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetPools.removeInstance" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *TargetPoolsRemoveInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Removes instance URL from a target pool.",
- // "flatPath": "projects/{project}/regions/{region}/targetPools/{targetPool}/removeInstance",
- // "httpMethod": "POST",
- // "id": "compute.targetPools.removeInstance",
- // "parameterOrder": [
- // "project",
- // "region",
- // "targetPool"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "targetPool": {
- // "description": "Name of the TargetPool resource to remove instances from.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/targetPools/{targetPool}/removeInstance",
- // "request": {
- // "$ref": "TargetPoolsRemoveInstanceRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.targetPools.setBackup":
-
-type TargetPoolsSetBackupCall struct {
- s *Service
- project string
- region string
- targetPool string
- targetreference *TargetReference
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetBackup: Changes a backup target pool's configurations.
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-// - targetPool: Name of the TargetPool resource to set a backup pool
-// for.
-func (r *TargetPoolsService) SetBackup(project string, region string, targetPool string, targetreference *TargetReference) *TargetPoolsSetBackupCall {
- c := &TargetPoolsSetBackupCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.targetPool = targetPool
- c.targetreference = targetreference
- return c
-}
-
-// FailoverRatio sets the optional parameter "failoverRatio": New
-// failoverRatio value for the target pool.
-func (c *TargetPoolsSetBackupCall) FailoverRatio(failoverRatio float64) *TargetPoolsSetBackupCall {
- c.urlParams_.Set("failoverRatio", fmt.Sprint(failoverRatio))
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *TargetPoolsSetBackupCall) RequestId(requestId string) *TargetPoolsSetBackupCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *TargetPoolsSetBackupCall) Fields(s ...googleapi.Field) *TargetPoolsSetBackupCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetPoolsSetBackupCall) Context(ctx context.Context) *TargetPoolsSetBackupCall {
- 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 *TargetPoolsSetBackupCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetPoolsSetBackupCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetPools/{targetPool}/setBackup")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "targetPool": c.targetPool,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetPools.setBackup" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *TargetPoolsSetBackupCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Changes a backup target pool's configurations.",
- // "flatPath": "projects/{project}/regions/{region}/targetPools/{targetPool}/setBackup",
- // "httpMethod": "POST",
- // "id": "compute.targetPools.setBackup",
- // "parameterOrder": [
- // "project",
- // "region",
- // "targetPool"
- // ],
- // "parameters": {
- // "failoverRatio": {
- // "description": "New failoverRatio value for the target pool.",
- // "format": "float",
- // "location": "query",
- // "type": "number"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "targetPool": {
- // "description": "Name of the TargetPool resource to set a backup pool for.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/targetPools/{targetPool}/setBackup",
- // "request": {
- // "$ref": "TargetReference"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.targetPools.setSecurityPolicy":
-
-type TargetPoolsSetSecurityPolicyCall struct {
- s *Service
- project string
- region string
- targetPool string
- securitypolicyreference *SecurityPolicyReference
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetSecurityPolicy: Sets the Google Cloud Armor security policy for
-// the specified target pool. For more information, see Google Cloud
-// Armor Overview
-//
-// - project: Project ID for this request.
-// - region: Name of the region scoping this request.
-// - targetPool: Name of the TargetPool resource to which the security
-// policy should be set. The name should conform to RFC1035.
-func (r *TargetPoolsService) SetSecurityPolicy(project string, region string, targetPool string, securitypolicyreference *SecurityPolicyReference) *TargetPoolsSetSecurityPolicyCall {
- c := &TargetPoolsSetSecurityPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.targetPool = targetPool
- c.securitypolicyreference = securitypolicyreference
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *TargetPoolsSetSecurityPolicyCall) RequestId(requestId string) *TargetPoolsSetSecurityPolicyCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *TargetPoolsSetSecurityPolicyCall) Fields(s ...googleapi.Field) *TargetPoolsSetSecurityPolicyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetPoolsSetSecurityPolicyCall) Context(ctx context.Context) *TargetPoolsSetSecurityPolicyCall {
- 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 *TargetPoolsSetSecurityPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetPoolsSetSecurityPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyreference)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetPools/{targetPool}/setSecurityPolicy")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "targetPool": c.targetPool,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetPools.setSecurityPolicy" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *TargetPoolsSetSecurityPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Sets the Google Cloud Armor security policy for the specified target pool. For more information, see Google Cloud Armor Overview",
- // "flatPath": "projects/{project}/regions/{region}/targetPools/{targetPool}/setSecurityPolicy",
- // "httpMethod": "POST",
- // "id": "compute.targetPools.setSecurityPolicy",
- // "parameterOrder": [
- // "project",
- // "region",
- // "targetPool"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "targetPool": {
- // "description": "Name of the TargetPool resource to which the security policy should be set. The name should conform to RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/targetPools/{targetPool}/setSecurityPolicy",
- // "request": {
- // "$ref": "SecurityPolicyReference"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.targetSslProxies.delete":
-
-type TargetSslProxiesDeleteCall struct {
- s *Service
- project string
- targetSslProxy string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified TargetSslProxy resource.
-//
-// - project: Project ID for this request.
-// - targetSslProxy: Name of the TargetSslProxy resource to delete.
-func (r *TargetSslProxiesService) Delete(project string, targetSslProxy string) *TargetSslProxiesDeleteCall {
- c := &TargetSslProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.targetSslProxy = targetSslProxy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *TargetSslProxiesDeleteCall) RequestId(requestId string) *TargetSslProxiesDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *TargetSslProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetSslProxiesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetSslProxiesDeleteCall) Context(ctx context.Context) *TargetSslProxiesDeleteCall {
- 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 *TargetSslProxiesDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetSslProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetSslProxies/{targetSslProxy}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "targetSslProxy": c.targetSslProxy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetSslProxies.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *TargetSslProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified TargetSslProxy resource.",
- // "flatPath": "projects/{project}/global/targetSslProxies/{targetSslProxy}",
- // "httpMethod": "DELETE",
- // "id": "compute.targetSslProxies.delete",
- // "parameterOrder": [
- // "project",
- // "targetSslProxy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "targetSslProxy": {
- // "description": "Name of the TargetSslProxy resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/targetSslProxies/{targetSslProxy}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.targetSslProxies.get":
-
-type TargetSslProxiesGetCall struct {
- s *Service
- project string
- targetSslProxy string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified TargetSslProxy resource.
-//
-// - project: Project ID for this request.
-// - targetSslProxy: Name of the TargetSslProxy resource to return.
-func (r *TargetSslProxiesService) Get(project string, targetSslProxy string) *TargetSslProxiesGetCall {
- c := &TargetSslProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.targetSslProxy = targetSslProxy
- 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 *TargetSslProxiesGetCall) Fields(s ...googleapi.Field) *TargetSslProxiesGetCall {
- 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 *TargetSslProxiesGetCall) IfNoneMatch(entityTag string) *TargetSslProxiesGetCall {
- 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 *TargetSslProxiesGetCall) Context(ctx context.Context) *TargetSslProxiesGetCall {
- 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 *TargetSslProxiesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetSslProxiesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/targetSslProxies/{targetSslProxy}")
- 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{
- "project": c.project,
- "targetSslProxy": c.targetSslProxy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetSslProxies.get" call.
-// Exactly one of *TargetSslProxy or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *TargetSslProxy.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 *TargetSslProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetSslProxy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TargetSslProxy{
- 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": "Returns the specified TargetSslProxy resource.",
- // "flatPath": "projects/{project}/global/targetSslProxies/{targetSslProxy}",
- // "httpMethod": "GET",
- // "id": "compute.targetSslProxies.get",
- // "parameterOrder": [
- // "project",
- // "targetSslProxy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "targetSslProxy": {
- // "description": "Name of the TargetSslProxy resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/targetSslProxies/{targetSslProxy}",
- // "response": {
- // "$ref": "TargetSslProxy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.targetSslProxies.insert":
-
-type TargetSslProxiesInsertCall struct {
- s *Service
- project string
- targetsslproxy *TargetSslProxy
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a TargetSslProxy resource in the specified project
-// using the data included in the request.
-//
-// - project: Project ID for this request.
-func (r *TargetSslProxiesService) Insert(project string, targetsslproxy *TargetSslProxy) *TargetSslProxiesInsertCall {
- c := &TargetSslProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.targetsslproxy = targetsslproxy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *TargetSslProxiesInsertCall) RequestId(requestId string) *TargetSslProxiesInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *TargetSslProxiesInsertCall) Fields(s ...googleapi.Field) *TargetSslProxiesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetSslProxiesInsertCall) Context(ctx context.Context) *TargetSslProxiesInsertCall {
- 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 *TargetSslProxiesInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetSslProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxy)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetSslProxies")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetSslProxies.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *TargetSslProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a TargetSslProxy resource in the specified project using the data included in the request.",
- // "flatPath": "projects/{project}/global/targetSslProxies",
- // "httpMethod": "POST",
- // "id": "compute.targetSslProxies.insert",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/targetSslProxies",
- // "request": {
- // "$ref": "TargetSslProxy"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.targetSslProxies.list":
-
-type TargetSslProxiesListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves the list of TargetSslProxy resources available to the
-// specified project.
-//
-// - project: Project ID for this request.
-func (r *TargetSslProxiesService) List(project string) *TargetSslProxiesListCall {
- c := &TargetSslProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *TargetSslProxiesListCall) Filter(filter string) *TargetSslProxiesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *TargetSslProxiesListCall) MaxResults(maxResults int64) *TargetSslProxiesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *TargetSslProxiesListCall) OrderBy(orderBy string) *TargetSslProxiesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *TargetSslProxiesListCall) PageToken(pageToken string) *TargetSslProxiesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *TargetSslProxiesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *TargetSslProxiesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *TargetSslProxiesListCall) Fields(s ...googleapi.Field) *TargetSslProxiesListCall {
- 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 *TargetSslProxiesListCall) IfNoneMatch(entityTag string) *TargetSslProxiesListCall {
- 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 *TargetSslProxiesListCall) Context(ctx context.Context) *TargetSslProxiesListCall {
- 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 *TargetSslProxiesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetSslProxiesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/targetSslProxies")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetSslProxies.list" call.
-// Exactly one of *TargetSslProxyList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *TargetSslProxyList.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 *TargetSslProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetSslProxyList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TargetSslProxyList{
- 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": "Retrieves the list of TargetSslProxy resources available to the specified project.",
- // "flatPath": "projects/{project}/global/targetSslProxies",
- // "httpMethod": "GET",
- // "id": "compute.targetSslProxies.list",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/targetSslProxies",
- // "response": {
- // "$ref": "TargetSslProxyList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *TargetSslProxiesListCall) Pages(ctx context.Context, f func(*TargetSslProxyList) 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 "compute.targetSslProxies.setBackendService":
-
-type TargetSslProxiesSetBackendServiceCall struct {
- s *Service
- project string
- targetSslProxy string
- targetsslproxiessetbackendservicerequest *TargetSslProxiesSetBackendServiceRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetBackendService: Changes the BackendService for TargetSslProxy.
-//
-// - project: Project ID for this request.
-// - targetSslProxy: Name of the TargetSslProxy resource whose
-// BackendService resource is to be set.
-func (r *TargetSslProxiesService) SetBackendService(project string, targetSslProxy string, targetsslproxiessetbackendservicerequest *TargetSslProxiesSetBackendServiceRequest) *TargetSslProxiesSetBackendServiceCall {
- c := &TargetSslProxiesSetBackendServiceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.targetSslProxy = targetSslProxy
- c.targetsslproxiessetbackendservicerequest = targetsslproxiessetbackendservicerequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *TargetSslProxiesSetBackendServiceCall) RequestId(requestId string) *TargetSslProxiesSetBackendServiceCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *TargetSslProxiesSetBackendServiceCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetBackendServiceCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetSslProxiesSetBackendServiceCall) Context(ctx context.Context) *TargetSslProxiesSetBackendServiceCall {
- 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 *TargetSslProxiesSetBackendServiceCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetSslProxiesSetBackendServiceCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetbackendservicerequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetSslProxies/{targetSslProxy}/setBackendService")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "targetSslProxy": c.targetSslProxy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetSslProxies.setBackendService" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *TargetSslProxiesSetBackendServiceCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Changes the BackendService for TargetSslProxy.",
- // "flatPath": "projects/{project}/global/targetSslProxies/{targetSslProxy}/setBackendService",
- // "httpMethod": "POST",
- // "id": "compute.targetSslProxies.setBackendService",
- // "parameterOrder": [
- // "project",
- // "targetSslProxy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "targetSslProxy": {
- // "description": "Name of the TargetSslProxy resource whose BackendService resource is to be set.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/targetSslProxies/{targetSslProxy}/setBackendService",
- // "request": {
- // "$ref": "TargetSslProxiesSetBackendServiceRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.targetSslProxies.setCertificateMap":
-
-type TargetSslProxiesSetCertificateMapCall struct {
- s *Service
- project string
- targetSslProxy string
- targetsslproxiessetcertificatemaprequest *TargetSslProxiesSetCertificateMapRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetCertificateMap: Changes the Certificate Map for TargetSslProxy.
-//
-// - project: Project ID for this request.
-// - targetSslProxy: Name of the TargetSslProxy resource whose
-// CertificateMap is to be set. The name must be 1-63 characters long,
-// and comply with RFC1035.
-func (r *TargetSslProxiesService) SetCertificateMap(project string, targetSslProxy string, targetsslproxiessetcertificatemaprequest *TargetSslProxiesSetCertificateMapRequest) *TargetSslProxiesSetCertificateMapCall {
- c := &TargetSslProxiesSetCertificateMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.targetSslProxy = targetSslProxy
- c.targetsslproxiessetcertificatemaprequest = targetsslproxiessetcertificatemaprequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *TargetSslProxiesSetCertificateMapCall) RequestId(requestId string) *TargetSslProxiesSetCertificateMapCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *TargetSslProxiesSetCertificateMapCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetCertificateMapCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetSslProxiesSetCertificateMapCall) Context(ctx context.Context) *TargetSslProxiesSetCertificateMapCall {
- 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 *TargetSslProxiesSetCertificateMapCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetSslProxiesSetCertificateMapCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetcertificatemaprequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetSslProxies/{targetSslProxy}/setCertificateMap")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "targetSslProxy": c.targetSslProxy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetSslProxies.setCertificateMap" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *TargetSslProxiesSetCertificateMapCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Changes the Certificate Map for TargetSslProxy.",
- // "flatPath": "projects/{project}/global/targetSslProxies/{targetSslProxy}/setCertificateMap",
- // "httpMethod": "POST",
- // "id": "compute.targetSslProxies.setCertificateMap",
- // "parameterOrder": [
- // "project",
- // "targetSslProxy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "targetSslProxy": {
- // "description": "Name of the TargetSslProxy resource whose CertificateMap is to be set. The name must be 1-63 characters long, and comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/targetSslProxies/{targetSslProxy}/setCertificateMap",
- // "request": {
- // "$ref": "TargetSslProxiesSetCertificateMapRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.targetSslProxies.setProxyHeader":
-
-type TargetSslProxiesSetProxyHeaderCall struct {
- s *Service
- project string
- targetSslProxy string
- targetsslproxiessetproxyheaderrequest *TargetSslProxiesSetProxyHeaderRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetProxyHeader: Changes the ProxyHeaderType for TargetSslProxy.
-//
-// - project: Project ID for this request.
-// - targetSslProxy: Name of the TargetSslProxy resource whose
-// ProxyHeader is to be set.
-func (r *TargetSslProxiesService) SetProxyHeader(project string, targetSslProxy string, targetsslproxiessetproxyheaderrequest *TargetSslProxiesSetProxyHeaderRequest) *TargetSslProxiesSetProxyHeaderCall {
- c := &TargetSslProxiesSetProxyHeaderCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.targetSslProxy = targetSslProxy
- c.targetsslproxiessetproxyheaderrequest = targetsslproxiessetproxyheaderrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *TargetSslProxiesSetProxyHeaderCall) RequestId(requestId string) *TargetSslProxiesSetProxyHeaderCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *TargetSslProxiesSetProxyHeaderCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetProxyHeaderCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetSslProxiesSetProxyHeaderCall) Context(ctx context.Context) *TargetSslProxiesSetProxyHeaderCall {
- 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 *TargetSslProxiesSetProxyHeaderCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetSslProxiesSetProxyHeaderCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetproxyheaderrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "targetSslProxy": c.targetSslProxy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetSslProxies.setProxyHeader" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *TargetSslProxiesSetProxyHeaderCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Changes the ProxyHeaderType for TargetSslProxy.",
- // "flatPath": "projects/{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader",
- // "httpMethod": "POST",
- // "id": "compute.targetSslProxies.setProxyHeader",
- // "parameterOrder": [
- // "project",
- // "targetSslProxy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "targetSslProxy": {
- // "description": "Name of the TargetSslProxy resource whose ProxyHeader is to be set.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader",
- // "request": {
- // "$ref": "TargetSslProxiesSetProxyHeaderRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.targetSslProxies.setSslCertificates":
-
-type TargetSslProxiesSetSslCertificatesCall struct {
- s *Service
- project string
- targetSslProxy string
- targetsslproxiessetsslcertificatesrequest *TargetSslProxiesSetSslCertificatesRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetSslCertificates: Changes SslCertificates for TargetSslProxy.
-//
-// - project: Project ID for this request.
-// - targetSslProxy: Name of the TargetSslProxy resource whose
-// SslCertificate resource is to be set.
-func (r *TargetSslProxiesService) SetSslCertificates(project string, targetSslProxy string, targetsslproxiessetsslcertificatesrequest *TargetSslProxiesSetSslCertificatesRequest) *TargetSslProxiesSetSslCertificatesCall {
- c := &TargetSslProxiesSetSslCertificatesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.targetSslProxy = targetSslProxy
- c.targetsslproxiessetsslcertificatesrequest = targetsslproxiessetsslcertificatesrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *TargetSslProxiesSetSslCertificatesCall) RequestId(requestId string) *TargetSslProxiesSetSslCertificatesCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *TargetSslProxiesSetSslCertificatesCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetSslCertificatesCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetSslProxiesSetSslCertificatesCall) Context(ctx context.Context) *TargetSslProxiesSetSslCertificatesCall {
- 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 *TargetSslProxiesSetSslCertificatesCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetSslProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetsslcertificatesrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "targetSslProxy": c.targetSslProxy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetSslProxies.setSslCertificates" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *TargetSslProxiesSetSslCertificatesCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Changes SslCertificates for TargetSslProxy.",
- // "flatPath": "projects/{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates",
- // "httpMethod": "POST",
- // "id": "compute.targetSslProxies.setSslCertificates",
- // "parameterOrder": [
- // "project",
- // "targetSslProxy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "targetSslProxy": {
- // "description": "Name of the TargetSslProxy resource whose SslCertificate resource is to be set.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates",
- // "request": {
- // "$ref": "TargetSslProxiesSetSslCertificatesRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.targetSslProxies.setSslPolicy":
-
-type TargetSslProxiesSetSslPolicyCall struct {
- s *Service
- project string
- targetSslProxy string
- sslpolicyreference *SslPolicyReference
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetSslPolicy: Sets the SSL policy for TargetSslProxy. The SSL policy
-// specifies the server-side support for SSL features. This affects
-// connections between clients and the load balancer. They do not affect
-// the connection between the load balancer and the backends.
-//
-// - project: Project ID for this request.
-// - targetSslProxy: Name of the TargetSslProxy resource whose SSL
-// policy is to be set. The name must be 1-63 characters long, and
-// comply with RFC1035.
-func (r *TargetSslProxiesService) SetSslPolicy(project string, targetSslProxy string, sslpolicyreference *SslPolicyReference) *TargetSslProxiesSetSslPolicyCall {
- c := &TargetSslProxiesSetSslPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.targetSslProxy = targetSslProxy
- c.sslpolicyreference = sslpolicyreference
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *TargetSslProxiesSetSslPolicyCall) RequestId(requestId string) *TargetSslProxiesSetSslPolicyCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *TargetSslProxiesSetSslPolicyCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetSslPolicyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetSslProxiesSetSslPolicyCall) Context(ctx context.Context) *TargetSslProxiesSetSslPolicyCall {
- 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 *TargetSslProxiesSetSslPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetSslProxiesSetSslPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicyreference)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetSslProxies/{targetSslProxy}/setSslPolicy")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "targetSslProxy": c.targetSslProxy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetSslProxies.setSslPolicy" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *TargetSslProxiesSetSslPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Sets the SSL policy for TargetSslProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the load balancer. They do not affect the connection between the load balancer and the backends.",
- // "flatPath": "projects/{project}/global/targetSslProxies/{targetSslProxy}/setSslPolicy",
- // "httpMethod": "POST",
- // "id": "compute.targetSslProxies.setSslPolicy",
- // "parameterOrder": [
- // "project",
- // "targetSslProxy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "targetSslProxy": {
- // "description": "Name of the TargetSslProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/targetSslProxies/{targetSslProxy}/setSslPolicy",
- // "request": {
- // "$ref": "SslPolicyReference"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.targetTcpProxies.aggregatedList":
-
-type TargetTcpProxiesAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Retrieves the list of all TargetTcpProxy resources,
-// regional and global, available to the specified project.
-//
-// - project: Name of the project scoping this request.
-func (r *TargetTcpProxiesService) AggregatedList(project string) *TargetTcpProxiesAggregatedListCall {
- c := &TargetTcpProxiesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *TargetTcpProxiesAggregatedListCall) Filter(filter string) *TargetTcpProxiesAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *TargetTcpProxiesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *TargetTcpProxiesAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *TargetTcpProxiesAggregatedListCall) MaxResults(maxResults int64) *TargetTcpProxiesAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *TargetTcpProxiesAggregatedListCall) OrderBy(orderBy string) *TargetTcpProxiesAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *TargetTcpProxiesAggregatedListCall) PageToken(pageToken string) *TargetTcpProxiesAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *TargetTcpProxiesAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *TargetTcpProxiesAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *TargetTcpProxiesAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *TargetTcpProxiesAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *TargetTcpProxiesAggregatedListCall) Fields(s ...googleapi.Field) *TargetTcpProxiesAggregatedListCall {
- 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 *TargetTcpProxiesAggregatedListCall) IfNoneMatch(entityTag string) *TargetTcpProxiesAggregatedListCall {
- 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 *TargetTcpProxiesAggregatedListCall) Context(ctx context.Context) *TargetTcpProxiesAggregatedListCall {
- 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 *TargetTcpProxiesAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetTcpProxiesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/targetTcpProxies")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetTcpProxies.aggregatedList" call.
-// Exactly one of *TargetTcpProxyAggregatedList or error will be
-// non-nil. Any non-2xx status code is an error. Response headers are in
-// either *TargetTcpProxyAggregatedList.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 *TargetTcpProxiesAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetTcpProxyAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TargetTcpProxyAggregatedList{
- 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": "Retrieves the list of all TargetTcpProxy resources, regional and global, available to the specified project.",
- // "flatPath": "projects/{project}/aggregated/targetTcpProxies",
- // "httpMethod": "GET",
- // "id": "compute.targetTcpProxies.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Name of the project scoping this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/targetTcpProxies",
- // "response": {
- // "$ref": "TargetTcpProxyAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *TargetTcpProxiesAggregatedListCall) Pages(ctx context.Context, f func(*TargetTcpProxyAggregatedList) 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 "compute.targetTcpProxies.delete":
-
-type TargetTcpProxiesDeleteCall struct {
- s *Service
- project string
- targetTcpProxy string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified TargetTcpProxy resource.
-//
-// - project: Project ID for this request.
-// - targetTcpProxy: Name of the TargetTcpProxy resource to delete.
-func (r *TargetTcpProxiesService) Delete(project string, targetTcpProxy string) *TargetTcpProxiesDeleteCall {
- c := &TargetTcpProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.targetTcpProxy = targetTcpProxy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *TargetTcpProxiesDeleteCall) RequestId(requestId string) *TargetTcpProxiesDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *TargetTcpProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetTcpProxiesDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetTcpProxiesDeleteCall) Context(ctx context.Context) *TargetTcpProxiesDeleteCall {
- 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 *TargetTcpProxiesDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetTcpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetTcpProxies/{targetTcpProxy}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "targetTcpProxy": c.targetTcpProxy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetTcpProxies.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *TargetTcpProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified TargetTcpProxy resource.",
- // "flatPath": "projects/{project}/global/targetTcpProxies/{targetTcpProxy}",
- // "httpMethod": "DELETE",
- // "id": "compute.targetTcpProxies.delete",
- // "parameterOrder": [
- // "project",
- // "targetTcpProxy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "targetTcpProxy": {
- // "description": "Name of the TargetTcpProxy resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/targetTcpProxies/{targetTcpProxy}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.targetTcpProxies.get":
-
-type TargetTcpProxiesGetCall struct {
- s *Service
- project string
- targetTcpProxy string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified TargetTcpProxy resource.
-//
-// - project: Project ID for this request.
-// - targetTcpProxy: Name of the TargetTcpProxy resource to return.
-func (r *TargetTcpProxiesService) Get(project string, targetTcpProxy string) *TargetTcpProxiesGetCall {
- c := &TargetTcpProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.targetTcpProxy = targetTcpProxy
- 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 *TargetTcpProxiesGetCall) Fields(s ...googleapi.Field) *TargetTcpProxiesGetCall {
- 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 *TargetTcpProxiesGetCall) IfNoneMatch(entityTag string) *TargetTcpProxiesGetCall {
- 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 *TargetTcpProxiesGetCall) Context(ctx context.Context) *TargetTcpProxiesGetCall {
- 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 *TargetTcpProxiesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetTcpProxiesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/targetTcpProxies/{targetTcpProxy}")
- 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{
- "project": c.project,
- "targetTcpProxy": c.targetTcpProxy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetTcpProxies.get" call.
-// Exactly one of *TargetTcpProxy or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *TargetTcpProxy.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 *TargetTcpProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetTcpProxy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TargetTcpProxy{
- 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": "Returns the specified TargetTcpProxy resource.",
- // "flatPath": "projects/{project}/global/targetTcpProxies/{targetTcpProxy}",
- // "httpMethod": "GET",
- // "id": "compute.targetTcpProxies.get",
- // "parameterOrder": [
- // "project",
- // "targetTcpProxy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "targetTcpProxy": {
- // "description": "Name of the TargetTcpProxy resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/targetTcpProxies/{targetTcpProxy}",
- // "response": {
- // "$ref": "TargetTcpProxy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.targetTcpProxies.insert":
-
-type TargetTcpProxiesInsertCall struct {
- s *Service
- project string
- targettcpproxy *TargetTcpProxy
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a TargetTcpProxy resource in the specified project
-// using the data included in the request.
-//
-// - project: Project ID for this request.
-func (r *TargetTcpProxiesService) Insert(project string, targettcpproxy *TargetTcpProxy) *TargetTcpProxiesInsertCall {
- c := &TargetTcpProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.targettcpproxy = targettcpproxy
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *TargetTcpProxiesInsertCall) RequestId(requestId string) *TargetTcpProxiesInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *TargetTcpProxiesInsertCall) Fields(s ...googleapi.Field) *TargetTcpProxiesInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetTcpProxiesInsertCall) Context(ctx context.Context) *TargetTcpProxiesInsertCall {
- 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 *TargetTcpProxiesInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetTcpProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxy)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetTcpProxies")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetTcpProxies.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *TargetTcpProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a TargetTcpProxy resource in the specified project using the data included in the request.",
- // "flatPath": "projects/{project}/global/targetTcpProxies",
- // "httpMethod": "POST",
- // "id": "compute.targetTcpProxies.insert",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/targetTcpProxies",
- // "request": {
- // "$ref": "TargetTcpProxy"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.targetTcpProxies.list":
-
-type TargetTcpProxiesListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves the list of TargetTcpProxy resources available to the
-// specified project.
-//
-// - project: Project ID for this request.
-func (r *TargetTcpProxiesService) List(project string) *TargetTcpProxiesListCall {
- c := &TargetTcpProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *TargetTcpProxiesListCall) Filter(filter string) *TargetTcpProxiesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *TargetTcpProxiesListCall) MaxResults(maxResults int64) *TargetTcpProxiesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *TargetTcpProxiesListCall) OrderBy(orderBy string) *TargetTcpProxiesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *TargetTcpProxiesListCall) PageToken(pageToken string) *TargetTcpProxiesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *TargetTcpProxiesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *TargetTcpProxiesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *TargetTcpProxiesListCall) Fields(s ...googleapi.Field) *TargetTcpProxiesListCall {
- 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 *TargetTcpProxiesListCall) IfNoneMatch(entityTag string) *TargetTcpProxiesListCall {
- 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 *TargetTcpProxiesListCall) Context(ctx context.Context) *TargetTcpProxiesListCall {
- 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 *TargetTcpProxiesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetTcpProxiesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/targetTcpProxies")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetTcpProxies.list" call.
-// Exactly one of *TargetTcpProxyList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *TargetTcpProxyList.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 *TargetTcpProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetTcpProxyList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TargetTcpProxyList{
- 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": "Retrieves the list of TargetTcpProxy resources available to the specified project.",
- // "flatPath": "projects/{project}/global/targetTcpProxies",
- // "httpMethod": "GET",
- // "id": "compute.targetTcpProxies.list",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/targetTcpProxies",
- // "response": {
- // "$ref": "TargetTcpProxyList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *TargetTcpProxiesListCall) Pages(ctx context.Context, f func(*TargetTcpProxyList) 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 "compute.targetTcpProxies.setBackendService":
-
-type TargetTcpProxiesSetBackendServiceCall struct {
- s *Service
- project string
- targetTcpProxy string
- targettcpproxiessetbackendservicerequest *TargetTcpProxiesSetBackendServiceRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetBackendService: Changes the BackendService for TargetTcpProxy.
-//
-// - project: Project ID for this request.
-// - targetTcpProxy: Name of the TargetTcpProxy resource whose
-// BackendService resource is to be set.
-func (r *TargetTcpProxiesService) SetBackendService(project string, targetTcpProxy string, targettcpproxiessetbackendservicerequest *TargetTcpProxiesSetBackendServiceRequest) *TargetTcpProxiesSetBackendServiceCall {
- c := &TargetTcpProxiesSetBackendServiceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.targetTcpProxy = targetTcpProxy
- c.targettcpproxiessetbackendservicerequest = targettcpproxiessetbackendservicerequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *TargetTcpProxiesSetBackendServiceCall) RequestId(requestId string) *TargetTcpProxiesSetBackendServiceCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *TargetTcpProxiesSetBackendServiceCall) Fields(s ...googleapi.Field) *TargetTcpProxiesSetBackendServiceCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetTcpProxiesSetBackendServiceCall) Context(ctx context.Context) *TargetTcpProxiesSetBackendServiceCall {
- 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 *TargetTcpProxiesSetBackendServiceCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetTcpProxiesSetBackendServiceCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxiessetbackendservicerequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "targetTcpProxy": c.targetTcpProxy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetTcpProxies.setBackendService" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *TargetTcpProxiesSetBackendServiceCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Changes the BackendService for TargetTcpProxy.",
- // "flatPath": "projects/{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService",
- // "httpMethod": "POST",
- // "id": "compute.targetTcpProxies.setBackendService",
- // "parameterOrder": [
- // "project",
- // "targetTcpProxy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "targetTcpProxy": {
- // "description": "Name of the TargetTcpProxy resource whose BackendService resource is to be set.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService",
- // "request": {
- // "$ref": "TargetTcpProxiesSetBackendServiceRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.targetTcpProxies.setProxyHeader":
-
-type TargetTcpProxiesSetProxyHeaderCall struct {
- s *Service
- project string
- targetTcpProxy string
- targettcpproxiessetproxyheaderrequest *TargetTcpProxiesSetProxyHeaderRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetProxyHeader: Changes the ProxyHeaderType for TargetTcpProxy.
-//
-// - project: Project ID for this request.
-// - targetTcpProxy: Name of the TargetTcpProxy resource whose
-// ProxyHeader is to be set.
-func (r *TargetTcpProxiesService) SetProxyHeader(project string, targetTcpProxy string, targettcpproxiessetproxyheaderrequest *TargetTcpProxiesSetProxyHeaderRequest) *TargetTcpProxiesSetProxyHeaderCall {
- c := &TargetTcpProxiesSetProxyHeaderCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.targetTcpProxy = targetTcpProxy
- c.targettcpproxiessetproxyheaderrequest = targettcpproxiessetproxyheaderrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *TargetTcpProxiesSetProxyHeaderCall) RequestId(requestId string) *TargetTcpProxiesSetProxyHeaderCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *TargetTcpProxiesSetProxyHeaderCall) Fields(s ...googleapi.Field) *TargetTcpProxiesSetProxyHeaderCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetTcpProxiesSetProxyHeaderCall) Context(ctx context.Context) *TargetTcpProxiesSetProxyHeaderCall {
- 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 *TargetTcpProxiesSetProxyHeaderCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetTcpProxiesSetProxyHeaderCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxiessetproxyheaderrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "targetTcpProxy": c.targetTcpProxy,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetTcpProxies.setProxyHeader" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *TargetTcpProxiesSetProxyHeaderCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Changes the ProxyHeaderType for TargetTcpProxy.",
- // "flatPath": "projects/{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader",
- // "httpMethod": "POST",
- // "id": "compute.targetTcpProxies.setProxyHeader",
- // "parameterOrder": [
- // "project",
- // "targetTcpProxy"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "targetTcpProxy": {
- // "description": "Name of the TargetTcpProxy resource whose ProxyHeader is to be set.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader",
- // "request": {
- // "$ref": "TargetTcpProxiesSetProxyHeaderRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.targetVpnGateways.aggregatedList":
-
-type TargetVpnGatewaysAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Retrieves an aggregated list of target VPN gateways.
-//
-// - project: Project ID for this request.
-func (r *TargetVpnGatewaysService) AggregatedList(project string) *TargetVpnGatewaysAggregatedListCall {
- c := &TargetVpnGatewaysAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *TargetVpnGatewaysAggregatedListCall) Filter(filter string) *TargetVpnGatewaysAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *TargetVpnGatewaysAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *TargetVpnGatewaysAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *TargetVpnGatewaysAggregatedListCall) MaxResults(maxResults int64) *TargetVpnGatewaysAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *TargetVpnGatewaysAggregatedListCall) OrderBy(orderBy string) *TargetVpnGatewaysAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *TargetVpnGatewaysAggregatedListCall) PageToken(pageToken string) *TargetVpnGatewaysAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *TargetVpnGatewaysAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *TargetVpnGatewaysAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *TargetVpnGatewaysAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *TargetVpnGatewaysAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *TargetVpnGatewaysAggregatedListCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysAggregatedListCall {
- 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 *TargetVpnGatewaysAggregatedListCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysAggregatedListCall {
- 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 *TargetVpnGatewaysAggregatedListCall) Context(ctx context.Context) *TargetVpnGatewaysAggregatedListCall {
- 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 *TargetVpnGatewaysAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetVpnGatewaysAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/targetVpnGateways")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetVpnGateways.aggregatedList" call.
-// Exactly one of *TargetVpnGatewayAggregatedList or error will be
-// non-nil. Any non-2xx status code is an error. Response headers are in
-// either *TargetVpnGatewayAggregatedList.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 *TargetVpnGatewaysAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetVpnGatewayAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TargetVpnGatewayAggregatedList{
- 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": "Retrieves an aggregated list of target VPN gateways.",
- // "flatPath": "projects/{project}/aggregated/targetVpnGateways",
- // "httpMethod": "GET",
- // "id": "compute.targetVpnGateways.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/targetVpnGateways",
- // "response": {
- // "$ref": "TargetVpnGatewayAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *TargetVpnGatewaysAggregatedListCall) Pages(ctx context.Context, f func(*TargetVpnGatewayAggregatedList) 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 "compute.targetVpnGateways.delete":
-
-type TargetVpnGatewaysDeleteCall struct {
- s *Service
- project string
- region string
- targetVpnGateway string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified target VPN gateway.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-// - targetVpnGateway: Name of the target VPN gateway to delete.
-func (r *TargetVpnGatewaysService) Delete(project string, region string, targetVpnGateway string) *TargetVpnGatewaysDeleteCall {
- c := &TargetVpnGatewaysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.targetVpnGateway = targetVpnGateway
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *TargetVpnGatewaysDeleteCall) RequestId(requestId string) *TargetVpnGatewaysDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *TargetVpnGatewaysDeleteCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetVpnGatewaysDeleteCall) Context(ctx context.Context) *TargetVpnGatewaysDeleteCall {
- 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 *TargetVpnGatewaysDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetVpnGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "targetVpnGateway": c.targetVpnGateway,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetVpnGateways.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *TargetVpnGatewaysDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified target VPN gateway.",
- // "flatPath": "projects/{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}",
- // "httpMethod": "DELETE",
- // "id": "compute.targetVpnGateways.delete",
- // "parameterOrder": [
- // "project",
- // "region",
- // "targetVpnGateway"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "targetVpnGateway": {
- // "description": "Name of the target VPN gateway to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.targetVpnGateways.get":
-
-type TargetVpnGatewaysGetCall struct {
- s *Service
- project string
- region string
- targetVpnGateway string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified target VPN gateway.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-// - targetVpnGateway: Name of the target VPN gateway to return.
-func (r *TargetVpnGatewaysService) Get(project string, region string, targetVpnGateway string) *TargetVpnGatewaysGetCall {
- c := &TargetVpnGatewaysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.targetVpnGateway = targetVpnGateway
- 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 *TargetVpnGatewaysGetCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysGetCall {
- 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 *TargetVpnGatewaysGetCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysGetCall {
- 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 *TargetVpnGatewaysGetCall) Context(ctx context.Context) *TargetVpnGatewaysGetCall {
- 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 *TargetVpnGatewaysGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetVpnGatewaysGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")
- 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{
- "project": c.project,
- "region": c.region,
- "targetVpnGateway": c.targetVpnGateway,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetVpnGateways.get" call.
-// Exactly one of *TargetVpnGateway or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *TargetVpnGateway.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 *TargetVpnGatewaysGetCall) Do(opts ...googleapi.CallOption) (*TargetVpnGateway, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TargetVpnGateway{
- 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": "Returns the specified target VPN gateway.",
- // "flatPath": "projects/{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}",
- // "httpMethod": "GET",
- // "id": "compute.targetVpnGateways.get",
- // "parameterOrder": [
- // "project",
- // "region",
- // "targetVpnGateway"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "targetVpnGateway": {
- // "description": "Name of the target VPN gateway to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}",
- // "response": {
- // "$ref": "TargetVpnGateway"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.targetVpnGateways.insert":
-
-type TargetVpnGatewaysInsertCall struct {
- s *Service
- project string
- region string
- targetvpngateway *TargetVpnGateway
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a target VPN gateway in the specified project and
-// region using the data included in the request.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-func (r *TargetVpnGatewaysService) Insert(project string, region string, targetvpngateway *TargetVpnGateway) *TargetVpnGatewaysInsertCall {
- c := &TargetVpnGatewaysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.targetvpngateway = targetvpngateway
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *TargetVpnGatewaysInsertCall) RequestId(requestId string) *TargetVpnGatewaysInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *TargetVpnGatewaysInsertCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetVpnGatewaysInsertCall) Context(ctx context.Context) *TargetVpnGatewaysInsertCall {
- 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 *TargetVpnGatewaysInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetVpnGatewaysInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetvpngateway)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetVpnGateways")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetVpnGateways.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *TargetVpnGatewaysInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a target VPN gateway in the specified project and region using the data included in the request.",
- // "flatPath": "projects/{project}/regions/{region}/targetVpnGateways",
- // "httpMethod": "POST",
- // "id": "compute.targetVpnGateways.insert",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/targetVpnGateways",
- // "request": {
- // "$ref": "TargetVpnGateway"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.targetVpnGateways.list":
-
-type TargetVpnGatewaysListCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves a list of target VPN gateways available to the
-// specified project and region.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-func (r *TargetVpnGatewaysService) List(project string, region string) *TargetVpnGatewaysListCall {
- c := &TargetVpnGatewaysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *TargetVpnGatewaysListCall) Filter(filter string) *TargetVpnGatewaysListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *TargetVpnGatewaysListCall) MaxResults(maxResults int64) *TargetVpnGatewaysListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *TargetVpnGatewaysListCall) OrderBy(orderBy string) *TargetVpnGatewaysListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *TargetVpnGatewaysListCall) PageToken(pageToken string) *TargetVpnGatewaysListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *TargetVpnGatewaysListCall) ReturnPartialSuccess(returnPartialSuccess bool) *TargetVpnGatewaysListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *TargetVpnGatewaysListCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysListCall {
- 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 *TargetVpnGatewaysListCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysListCall {
- 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 *TargetVpnGatewaysListCall) Context(ctx context.Context) *TargetVpnGatewaysListCall {
- 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 *TargetVpnGatewaysListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetVpnGatewaysListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/targetVpnGateways")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetVpnGateways.list" call.
-// Exactly one of *TargetVpnGatewayList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *TargetVpnGatewayList.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 *TargetVpnGatewaysListCall) Do(opts ...googleapi.CallOption) (*TargetVpnGatewayList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TargetVpnGatewayList{
- 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": "Retrieves a list of target VPN gateways available to the specified project and region.",
- // "flatPath": "projects/{project}/regions/{region}/targetVpnGateways",
- // "httpMethod": "GET",
- // "id": "compute.targetVpnGateways.list",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/targetVpnGateways",
- // "response": {
- // "$ref": "TargetVpnGatewayList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *TargetVpnGatewaysListCall) Pages(ctx context.Context, f func(*TargetVpnGatewayList) 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 "compute.targetVpnGateways.setLabels":
-
-type TargetVpnGatewaysSetLabelsCall struct {
- s *Service
- project string
- region string
- resource string
- regionsetlabelsrequest *RegionSetLabelsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetLabels: Sets the labels on a TargetVpnGateway. To learn more about
-// labels, read the Labeling Resources documentation.
-//
-// - project: Project ID for this request.
-// - region: The region for this request.
-// - resource: Name or id of the resource for this request.
-func (r *TargetVpnGatewaysService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *TargetVpnGatewaysSetLabelsCall {
- c := &TargetVpnGatewaysSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.resource = resource
- c.regionsetlabelsrequest = regionsetlabelsrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *TargetVpnGatewaysSetLabelsCall) RequestId(requestId string) *TargetVpnGatewaysSetLabelsCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *TargetVpnGatewaysSetLabelsCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysSetLabelsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *TargetVpnGatewaysSetLabelsCall) Context(ctx context.Context) *TargetVpnGatewaysSetLabelsCall {
- 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 *TargetVpnGatewaysSetLabelsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TargetVpnGatewaysSetLabelsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/targetVpnGateways/{resource}/setLabels")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.targetVpnGateways.setLabels" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *TargetVpnGatewaysSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Sets the labels on a TargetVpnGateway. To learn more about labels, read the Labeling Resources documentation.",
- // "flatPath": "projects/{project}/regions/{region}/targetVpnGateways/{resource}/setLabels",
- // "httpMethod": "POST",
- // "id": "compute.targetVpnGateways.setLabels",
- // "parameterOrder": [
- // "project",
- // "region",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/targetVpnGateways/{resource}/setLabels",
- // "request": {
- // "$ref": "RegionSetLabelsRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.urlMaps.aggregatedList":
-
-type UrlMapsAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Retrieves the list of all UrlMap resources, regional
-// and global, available to the specified project.
-//
-// - project: Name of the project scoping this request.
-func (r *UrlMapsService) AggregatedList(project string) *UrlMapsAggregatedListCall {
- c := &UrlMapsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *UrlMapsAggregatedListCall) Filter(filter string) *UrlMapsAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *UrlMapsAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *UrlMapsAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *UrlMapsAggregatedListCall) MaxResults(maxResults int64) *UrlMapsAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *UrlMapsAggregatedListCall) OrderBy(orderBy string) *UrlMapsAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *UrlMapsAggregatedListCall) PageToken(pageToken string) *UrlMapsAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *UrlMapsAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *UrlMapsAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *UrlMapsAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *UrlMapsAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *UrlMapsAggregatedListCall) Fields(s ...googleapi.Field) *UrlMapsAggregatedListCall {
- 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 *UrlMapsAggregatedListCall) IfNoneMatch(entityTag string) *UrlMapsAggregatedListCall {
- 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 *UrlMapsAggregatedListCall) Context(ctx context.Context) *UrlMapsAggregatedListCall {
- 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 *UrlMapsAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *UrlMapsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/urlMaps")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.urlMaps.aggregatedList" call.
-// Exactly one of *UrlMapsAggregatedList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *UrlMapsAggregatedList.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 *UrlMapsAggregatedListCall) Do(opts ...googleapi.CallOption) (*UrlMapsAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &UrlMapsAggregatedList{
- 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": "Retrieves the list of all UrlMap resources, regional and global, available to the specified project.",
- // "flatPath": "projects/{project}/aggregated/urlMaps",
- // "httpMethod": "GET",
- // "id": "compute.urlMaps.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Name of the project scoping this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/urlMaps",
- // "response": {
- // "$ref": "UrlMapsAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *UrlMapsAggregatedListCall) Pages(ctx context.Context, f func(*UrlMapsAggregatedList) 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 "compute.urlMaps.delete":
-
-type UrlMapsDeleteCall struct {
- s *Service
- project string
- urlMap string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified UrlMap resource.
-//
-// - project: Project ID for this request.
-// - urlMap: Name of the UrlMap resource to delete.
-func (r *UrlMapsService) Delete(project string, urlMap string) *UrlMapsDeleteCall {
- c := &UrlMapsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.urlMap = urlMap
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *UrlMapsDeleteCall) RequestId(requestId string) *UrlMapsDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *UrlMapsDeleteCall) Fields(s ...googleapi.Field) *UrlMapsDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *UrlMapsDeleteCall) Context(ctx context.Context) *UrlMapsDeleteCall {
- 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 *UrlMapsDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *UrlMapsDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/urlMaps/{urlMap}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "urlMap": c.urlMap,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.urlMaps.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *UrlMapsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified UrlMap resource.",
- // "flatPath": "projects/{project}/global/urlMaps/{urlMap}",
- // "httpMethod": "DELETE",
- // "id": "compute.urlMaps.delete",
- // "parameterOrder": [
- // "project",
- // "urlMap"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "urlMap": {
- // "description": "Name of the UrlMap resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/urlMaps/{urlMap}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.urlMaps.get":
-
-type UrlMapsGetCall struct {
- s *Service
- project string
- urlMap string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified UrlMap resource.
-//
-// - project: Project ID for this request.
-// - urlMap: Name of the UrlMap resource to return.
-func (r *UrlMapsService) Get(project string, urlMap string) *UrlMapsGetCall {
- c := &UrlMapsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.urlMap = urlMap
- 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 *UrlMapsGetCall) Fields(s ...googleapi.Field) *UrlMapsGetCall {
- 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 *UrlMapsGetCall) IfNoneMatch(entityTag string) *UrlMapsGetCall {
- 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 *UrlMapsGetCall) Context(ctx context.Context) *UrlMapsGetCall {
- 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 *UrlMapsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *UrlMapsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/urlMaps/{urlMap}")
- 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{
- "project": c.project,
- "urlMap": c.urlMap,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.urlMaps.get" call.
-// Exactly one of *UrlMap or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *UrlMap.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 *UrlMapsGetCall) Do(opts ...googleapi.CallOption) (*UrlMap, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &UrlMap{
- 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": "Returns the specified UrlMap resource.",
- // "flatPath": "projects/{project}/global/urlMaps/{urlMap}",
- // "httpMethod": "GET",
- // "id": "compute.urlMaps.get",
- // "parameterOrder": [
- // "project",
- // "urlMap"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "urlMap": {
- // "description": "Name of the UrlMap resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/urlMaps/{urlMap}",
- // "response": {
- // "$ref": "UrlMap"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.urlMaps.insert":
-
-type UrlMapsInsertCall struct {
- s *Service
- project string
- urlmap *UrlMap
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a UrlMap resource in the specified project using the
-// data included in the request.
-//
-// - project: Project ID for this request.
-func (r *UrlMapsService) Insert(project string, urlmap *UrlMap) *UrlMapsInsertCall {
- c := &UrlMapsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.urlmap = urlmap
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *UrlMapsInsertCall) RequestId(requestId string) *UrlMapsInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *UrlMapsInsertCall) Fields(s ...googleapi.Field) *UrlMapsInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *UrlMapsInsertCall) Context(ctx context.Context) *UrlMapsInsertCall {
- 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 *UrlMapsInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *UrlMapsInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/urlMaps")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.urlMaps.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *UrlMapsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a UrlMap resource in the specified project using the data included in the request.",
- // "flatPath": "projects/{project}/global/urlMaps",
- // "httpMethod": "POST",
- // "id": "compute.urlMaps.insert",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/urlMaps",
- // "request": {
- // "$ref": "UrlMap"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.urlMaps.invalidateCache":
-
-type UrlMapsInvalidateCacheCall struct {
- s *Service
- project string
- urlMap string
- cacheinvalidationrule *CacheInvalidationRule
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// InvalidateCache: Initiates a cache invalidation operation,
-// invalidating the specified path, scoped to the specified UrlMap. For
-// more information, see Invalidating cached content
-// (/cdn/docs/invalidating-cached-content).
-//
-// - project: Project ID for this request.
-// - urlMap: Name of the UrlMap scoping this request.
-func (r *UrlMapsService) InvalidateCache(project string, urlMap string, cacheinvalidationrule *CacheInvalidationRule) *UrlMapsInvalidateCacheCall {
- c := &UrlMapsInvalidateCacheCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.urlMap = urlMap
- c.cacheinvalidationrule = cacheinvalidationrule
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *UrlMapsInvalidateCacheCall) RequestId(requestId string) *UrlMapsInvalidateCacheCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *UrlMapsInvalidateCacheCall) Fields(s ...googleapi.Field) *UrlMapsInvalidateCacheCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *UrlMapsInvalidateCacheCall) Context(ctx context.Context) *UrlMapsInvalidateCacheCall {
- 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 *UrlMapsInvalidateCacheCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *UrlMapsInvalidateCacheCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.cacheinvalidationrule)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/urlMaps/{urlMap}/invalidateCache")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "urlMap": c.urlMap,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.urlMaps.invalidateCache" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *UrlMapsInvalidateCacheCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap. For more information, see [Invalidating cached content](/cdn/docs/invalidating-cached-content).",
- // "flatPath": "projects/{project}/global/urlMaps/{urlMap}/invalidateCache",
- // "httpMethod": "POST",
- // "id": "compute.urlMaps.invalidateCache",
- // "parameterOrder": [
- // "project",
- // "urlMap"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "urlMap": {
- // "description": "Name of the UrlMap scoping this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/urlMaps/{urlMap}/invalidateCache",
- // "request": {
- // "$ref": "CacheInvalidationRule"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.urlMaps.list":
-
-type UrlMapsListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves the list of UrlMap resources available to the
-// specified project.
-//
-// - project: Project ID for this request.
-func (r *UrlMapsService) List(project string) *UrlMapsListCall {
- c := &UrlMapsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *UrlMapsListCall) Filter(filter string) *UrlMapsListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *UrlMapsListCall) MaxResults(maxResults int64) *UrlMapsListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *UrlMapsListCall) OrderBy(orderBy string) *UrlMapsListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *UrlMapsListCall) PageToken(pageToken string) *UrlMapsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *UrlMapsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *UrlMapsListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *UrlMapsListCall) Fields(s ...googleapi.Field) *UrlMapsListCall {
- 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 *UrlMapsListCall) IfNoneMatch(entityTag string) *UrlMapsListCall {
- 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 *UrlMapsListCall) Context(ctx context.Context) *UrlMapsListCall {
- 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 *UrlMapsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *UrlMapsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/global/urlMaps")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.urlMaps.list" call.
-// Exactly one of *UrlMapList or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *UrlMapList.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 *UrlMapsListCall) Do(opts ...googleapi.CallOption) (*UrlMapList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &UrlMapList{
- 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": "Retrieves the list of UrlMap resources available to the specified project.",
- // "flatPath": "projects/{project}/global/urlMaps",
- // "httpMethod": "GET",
- // "id": "compute.urlMaps.list",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/global/urlMaps",
- // "response": {
- // "$ref": "UrlMapList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *UrlMapsListCall) Pages(ctx context.Context, f func(*UrlMapList) 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 "compute.urlMaps.patch":
-
-type UrlMapsPatchCall struct {
- s *Service
- project string
- urlMap string
- urlmap *UrlMap
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Patches the specified UrlMap resource with the data included
-// in the request. This method supports PATCH semantics and uses the
-// JSON merge patch format and processing rules.
-//
-// - project: Project ID for this request.
-// - urlMap: Name of the UrlMap resource to patch.
-func (r *UrlMapsService) Patch(project string, urlMap string, urlmap *UrlMap) *UrlMapsPatchCall {
- c := &UrlMapsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.urlMap = urlMap
- c.urlmap = urlmap
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *UrlMapsPatchCall) RequestId(requestId string) *UrlMapsPatchCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *UrlMapsPatchCall) Fields(s ...googleapi.Field) *UrlMapsPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *UrlMapsPatchCall) Context(ctx context.Context) *UrlMapsPatchCall {
- 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 *UrlMapsPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *UrlMapsPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/urlMaps/{urlMap}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PATCH", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "urlMap": c.urlMap,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.urlMaps.patch" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *UrlMapsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
- // "flatPath": "projects/{project}/global/urlMaps/{urlMap}",
- // "httpMethod": "PATCH",
- // "id": "compute.urlMaps.patch",
- // "parameterOrder": [
- // "project",
- // "urlMap"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "urlMap": {
- // "description": "Name of the UrlMap resource to patch.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/urlMaps/{urlMap}",
- // "request": {
- // "$ref": "UrlMap"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.urlMaps.update":
-
-type UrlMapsUpdateCall struct {
- s *Service
- project string
- urlMap string
- urlmap *UrlMap
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Update: Updates the specified UrlMap resource with the data included
-// in the request.
-//
-// - project: Project ID for this request.
-// - urlMap: Name of the UrlMap resource to update.
-func (r *UrlMapsService) Update(project string, urlMap string, urlmap *UrlMap) *UrlMapsUpdateCall {
- c := &UrlMapsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.urlMap = urlMap
- c.urlmap = urlmap
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *UrlMapsUpdateCall) RequestId(requestId string) *UrlMapsUpdateCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *UrlMapsUpdateCall) Fields(s ...googleapi.Field) *UrlMapsUpdateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *UrlMapsUpdateCall) Context(ctx context.Context) *UrlMapsUpdateCall {
- 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 *UrlMapsUpdateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *UrlMapsUpdateCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/urlMaps/{urlMap}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("PUT", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "urlMap": c.urlMap,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.urlMaps.update" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *UrlMapsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Updates the specified UrlMap resource with the data included in the request.",
- // "flatPath": "projects/{project}/global/urlMaps/{urlMap}",
- // "httpMethod": "PUT",
- // "id": "compute.urlMaps.update",
- // "parameterOrder": [
- // "project",
- // "urlMap"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "urlMap": {
- // "description": "Name of the UrlMap resource to update.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/urlMaps/{urlMap}",
- // "request": {
- // "$ref": "UrlMap"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.urlMaps.validate":
-
-type UrlMapsValidateCall struct {
- s *Service
- project string
- urlMap string
- urlmapsvalidaterequest *UrlMapsValidateRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Validate: Runs static validation for the UrlMap. In particular, the
-// tests of the provided UrlMap will be run. Calling this method does
-// NOT create the UrlMap.
-//
-// - project: Project ID for this request.
-// - urlMap: Name of the UrlMap resource to be validated as.
-func (r *UrlMapsService) Validate(project string, urlMap string, urlmapsvalidaterequest *UrlMapsValidateRequest) *UrlMapsValidateCall {
- c := &UrlMapsValidateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.urlMap = urlMap
- c.urlmapsvalidaterequest = urlmapsvalidaterequest
- 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 *UrlMapsValidateCall) Fields(s ...googleapi.Field) *UrlMapsValidateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *UrlMapsValidateCall) Context(ctx context.Context) *UrlMapsValidateCall {
- 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 *UrlMapsValidateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *UrlMapsValidateCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapsvalidaterequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/urlMaps/{urlMap}/validate")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "urlMap": c.urlMap,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.urlMaps.validate" call.
-// Exactly one of *UrlMapsValidateResponse or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *UrlMapsValidateResponse.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 *UrlMapsValidateCall) Do(opts ...googleapi.CallOption) (*UrlMapsValidateResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &UrlMapsValidateResponse{
- 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": "Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap.",
- // "flatPath": "projects/{project}/global/urlMaps/{urlMap}/validate",
- // "httpMethod": "POST",
- // "id": "compute.urlMaps.validate",
- // "parameterOrder": [
- // "project",
- // "urlMap"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "urlMap": {
- // "description": "Name of the UrlMap resource to be validated as.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/global/urlMaps/{urlMap}/validate",
- // "request": {
- // "$ref": "UrlMapsValidateRequest"
- // },
- // "response": {
- // "$ref": "UrlMapsValidateResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.vpnGateways.aggregatedList":
-
-type VpnGatewaysAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Retrieves an aggregated list of VPN gateways.
-//
-// - project: Project ID for this request.
-func (r *VpnGatewaysService) AggregatedList(project string) *VpnGatewaysAggregatedListCall {
- c := &VpnGatewaysAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *VpnGatewaysAggregatedListCall) Filter(filter string) *VpnGatewaysAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *VpnGatewaysAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *VpnGatewaysAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *VpnGatewaysAggregatedListCall) MaxResults(maxResults int64) *VpnGatewaysAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *VpnGatewaysAggregatedListCall) OrderBy(orderBy string) *VpnGatewaysAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *VpnGatewaysAggregatedListCall) PageToken(pageToken string) *VpnGatewaysAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *VpnGatewaysAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *VpnGatewaysAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *VpnGatewaysAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *VpnGatewaysAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *VpnGatewaysAggregatedListCall) Fields(s ...googleapi.Field) *VpnGatewaysAggregatedListCall {
- 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 *VpnGatewaysAggregatedListCall) IfNoneMatch(entityTag string) *VpnGatewaysAggregatedListCall {
- 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 *VpnGatewaysAggregatedListCall) Context(ctx context.Context) *VpnGatewaysAggregatedListCall {
- 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 *VpnGatewaysAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *VpnGatewaysAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/vpnGateways")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.vpnGateways.aggregatedList" call.
-// Exactly one of *VpnGatewayAggregatedList or error will be non-nil.
-// Any non-2xx status code is an error. Response headers are in either
-// *VpnGatewayAggregatedList.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 *VpnGatewaysAggregatedListCall) Do(opts ...googleapi.CallOption) (*VpnGatewayAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &VpnGatewayAggregatedList{
- 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": "Retrieves an aggregated list of VPN gateways.",
- // "flatPath": "projects/{project}/aggregated/vpnGateways",
- // "httpMethod": "GET",
- // "id": "compute.vpnGateways.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/vpnGateways",
- // "response": {
- // "$ref": "VpnGatewayAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *VpnGatewaysAggregatedListCall) Pages(ctx context.Context, f func(*VpnGatewayAggregatedList) 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 "compute.vpnGateways.delete":
-
-type VpnGatewaysDeleteCall struct {
- s *Service
- project string
- region string
- vpnGateway string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified VPN gateway.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-// - vpnGateway: Name of the VPN gateway to delete.
-func (r *VpnGatewaysService) Delete(project string, region string, vpnGateway string) *VpnGatewaysDeleteCall {
- c := &VpnGatewaysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.vpnGateway = vpnGateway
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *VpnGatewaysDeleteCall) RequestId(requestId string) *VpnGatewaysDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *VpnGatewaysDeleteCall) Fields(s ...googleapi.Field) *VpnGatewaysDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *VpnGatewaysDeleteCall) Context(ctx context.Context) *VpnGatewaysDeleteCall {
- 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 *VpnGatewaysDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *VpnGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/vpnGateways/{vpnGateway}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "vpnGateway": c.vpnGateway,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.vpnGateways.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *VpnGatewaysDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified VPN gateway.",
- // "flatPath": "projects/{project}/regions/{region}/vpnGateways/{vpnGateway}",
- // "httpMethod": "DELETE",
- // "id": "compute.vpnGateways.delete",
- // "parameterOrder": [
- // "project",
- // "region",
- // "vpnGateway"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "vpnGateway": {
- // "description": "Name of the VPN gateway to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/vpnGateways/{vpnGateway}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.vpnGateways.get":
-
-type VpnGatewaysGetCall struct {
- s *Service
- project string
- region string
- vpnGateway string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified VPN gateway.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-// - vpnGateway: Name of the VPN gateway to return.
-func (r *VpnGatewaysService) Get(project string, region string, vpnGateway string) *VpnGatewaysGetCall {
- c := &VpnGatewaysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.vpnGateway = vpnGateway
- 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 *VpnGatewaysGetCall) Fields(s ...googleapi.Field) *VpnGatewaysGetCall {
- 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 *VpnGatewaysGetCall) IfNoneMatch(entityTag string) *VpnGatewaysGetCall {
- 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 *VpnGatewaysGetCall) Context(ctx context.Context) *VpnGatewaysGetCall {
- 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 *VpnGatewaysGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *VpnGatewaysGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/vpnGateways/{vpnGateway}")
- 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{
- "project": c.project,
- "region": c.region,
- "vpnGateway": c.vpnGateway,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.vpnGateways.get" call.
-// Exactly one of *VpnGateway or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *VpnGateway.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 *VpnGatewaysGetCall) Do(opts ...googleapi.CallOption) (*VpnGateway, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &VpnGateway{
- 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": "Returns the specified VPN gateway.",
- // "flatPath": "projects/{project}/regions/{region}/vpnGateways/{vpnGateway}",
- // "httpMethod": "GET",
- // "id": "compute.vpnGateways.get",
- // "parameterOrder": [
- // "project",
- // "region",
- // "vpnGateway"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "vpnGateway": {
- // "description": "Name of the VPN gateway to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/vpnGateways/{vpnGateway}",
- // "response": {
- // "$ref": "VpnGateway"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.vpnGateways.getStatus":
-
-type VpnGatewaysGetStatusCall struct {
- s *Service
- project string
- region string
- vpnGateway string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetStatus: Returns the status for the specified VPN gateway.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-// - vpnGateway: Name of the VPN gateway to return.
-func (r *VpnGatewaysService) GetStatus(project string, region string, vpnGateway string) *VpnGatewaysGetStatusCall {
- c := &VpnGatewaysGetStatusCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.vpnGateway = vpnGateway
- 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 *VpnGatewaysGetStatusCall) Fields(s ...googleapi.Field) *VpnGatewaysGetStatusCall {
- 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 *VpnGatewaysGetStatusCall) IfNoneMatch(entityTag string) *VpnGatewaysGetStatusCall {
- 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 *VpnGatewaysGetStatusCall) Context(ctx context.Context) *VpnGatewaysGetStatusCall {
- 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 *VpnGatewaysGetStatusCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *VpnGatewaysGetStatusCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/vpnGateways/{vpnGateway}/getStatus")
- 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{
- "project": c.project,
- "region": c.region,
- "vpnGateway": c.vpnGateway,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.vpnGateways.getStatus" call.
-// Exactly one of *VpnGatewaysGetStatusResponse or error will be
-// non-nil. Any non-2xx status code is an error. Response headers are in
-// either *VpnGatewaysGetStatusResponse.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 *VpnGatewaysGetStatusCall) Do(opts ...googleapi.CallOption) (*VpnGatewaysGetStatusResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &VpnGatewaysGetStatusResponse{
- 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": "Returns the status for the specified VPN gateway.",
- // "flatPath": "projects/{project}/regions/{region}/vpnGateways/{vpnGateway}/getStatus",
- // "httpMethod": "GET",
- // "id": "compute.vpnGateways.getStatus",
- // "parameterOrder": [
- // "project",
- // "region",
- // "vpnGateway"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "vpnGateway": {
- // "description": "Name of the VPN gateway to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/vpnGateways/{vpnGateway}/getStatus",
- // "response": {
- // "$ref": "VpnGatewaysGetStatusResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.vpnGateways.insert":
-
-type VpnGatewaysInsertCall struct {
- s *Service
- project string
- region string
- vpngateway *VpnGateway
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a VPN gateway in the specified project and region
-// using the data included in the request.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-func (r *VpnGatewaysService) Insert(project string, region string, vpngateway *VpnGateway) *VpnGatewaysInsertCall {
- c := &VpnGatewaysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.vpngateway = vpngateway
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *VpnGatewaysInsertCall) RequestId(requestId string) *VpnGatewaysInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *VpnGatewaysInsertCall) Fields(s ...googleapi.Field) *VpnGatewaysInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *VpnGatewaysInsertCall) Context(ctx context.Context) *VpnGatewaysInsertCall {
- 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 *VpnGatewaysInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *VpnGatewaysInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.vpngateway)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/vpnGateways")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.vpnGateways.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *VpnGatewaysInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a VPN gateway in the specified project and region using the data included in the request.",
- // "flatPath": "projects/{project}/regions/{region}/vpnGateways",
- // "httpMethod": "POST",
- // "id": "compute.vpnGateways.insert",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/vpnGateways",
- // "request": {
- // "$ref": "VpnGateway"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.vpnGateways.list":
-
-type VpnGatewaysListCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves a list of VPN gateways available to the specified
-// project and region.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-func (r *VpnGatewaysService) List(project string, region string) *VpnGatewaysListCall {
- c := &VpnGatewaysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *VpnGatewaysListCall) Filter(filter string) *VpnGatewaysListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *VpnGatewaysListCall) MaxResults(maxResults int64) *VpnGatewaysListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *VpnGatewaysListCall) OrderBy(orderBy string) *VpnGatewaysListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *VpnGatewaysListCall) PageToken(pageToken string) *VpnGatewaysListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *VpnGatewaysListCall) ReturnPartialSuccess(returnPartialSuccess bool) *VpnGatewaysListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *VpnGatewaysListCall) Fields(s ...googleapi.Field) *VpnGatewaysListCall {
- 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 *VpnGatewaysListCall) IfNoneMatch(entityTag string) *VpnGatewaysListCall {
- 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 *VpnGatewaysListCall) Context(ctx context.Context) *VpnGatewaysListCall {
- 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 *VpnGatewaysListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *VpnGatewaysListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/vpnGateways")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.vpnGateways.list" call.
-// Exactly one of *VpnGatewayList or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *VpnGatewayList.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 *VpnGatewaysListCall) Do(opts ...googleapi.CallOption) (*VpnGatewayList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &VpnGatewayList{
- 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": "Retrieves a list of VPN gateways available to the specified project and region.",
- // "flatPath": "projects/{project}/regions/{region}/vpnGateways",
- // "httpMethod": "GET",
- // "id": "compute.vpnGateways.list",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/vpnGateways",
- // "response": {
- // "$ref": "VpnGatewayList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *VpnGatewaysListCall) Pages(ctx context.Context, f func(*VpnGatewayList) 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 "compute.vpnGateways.setLabels":
-
-type VpnGatewaysSetLabelsCall struct {
- s *Service
- project string
- region string
- resource string
- regionsetlabelsrequest *RegionSetLabelsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetLabels: Sets the labels on a VpnGateway. To learn more about
-// labels, read the Labeling Resources documentation.
-//
-// - project: Project ID for this request.
-// - region: The region for this request.
-// - resource: Name or id of the resource for this request.
-func (r *VpnGatewaysService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *VpnGatewaysSetLabelsCall {
- c := &VpnGatewaysSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.resource = resource
- c.regionsetlabelsrequest = regionsetlabelsrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *VpnGatewaysSetLabelsCall) RequestId(requestId string) *VpnGatewaysSetLabelsCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *VpnGatewaysSetLabelsCall) Fields(s ...googleapi.Field) *VpnGatewaysSetLabelsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *VpnGatewaysSetLabelsCall) Context(ctx context.Context) *VpnGatewaysSetLabelsCall {
- 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 *VpnGatewaysSetLabelsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *VpnGatewaysSetLabelsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/vpnGateways/{resource}/setLabels")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.vpnGateways.setLabels" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *VpnGatewaysSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Sets the labels on a VpnGateway. To learn more about labels, read the Labeling Resources documentation.",
- // "flatPath": "projects/{project}/regions/{region}/vpnGateways/{resource}/setLabels",
- // "httpMethod": "POST",
- // "id": "compute.vpnGateways.setLabels",
- // "parameterOrder": [
- // "project",
- // "region",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/vpnGateways/{resource}/setLabels",
- // "request": {
- // "$ref": "RegionSetLabelsRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.vpnGateways.testIamPermissions":
-
-type VpnGatewaysTestIamPermissionsCall struct {
- s *Service
- project string
- region string
- resource string
- testpermissionsrequest *TestPermissionsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// TestIamPermissions: Returns permissions that a caller has on the
-// specified resource.
-//
-// - project: Project ID for this request.
-// - region: The name of the region for this request.
-// - resource: Name or id of the resource for this request.
-func (r *VpnGatewaysService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *VpnGatewaysTestIamPermissionsCall {
- c := &VpnGatewaysTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.resource = resource
- c.testpermissionsrequest = testpermissionsrequest
- 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 *VpnGatewaysTestIamPermissionsCall) Fields(s ...googleapi.Field) *VpnGatewaysTestIamPermissionsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *VpnGatewaysTestIamPermissionsCall) Context(ctx context.Context) *VpnGatewaysTestIamPermissionsCall {
- 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 *VpnGatewaysTestIamPermissionsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *VpnGatewaysTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/vpnGateways/{resource}/testIamPermissions")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.vpnGateways.testIamPermissions" call.
-// Exactly one of *TestPermissionsResponse or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *TestPermissionsResponse.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 *VpnGatewaysTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &TestPermissionsResponse{
- 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": "Returns permissions that a caller has on the specified resource.",
- // "flatPath": "projects/{project}/regions/{region}/vpnGateways/{resource}/testIamPermissions",
- // "httpMethod": "POST",
- // "id": "compute.vpnGateways.testIamPermissions",
- // "parameterOrder": [
- // "project",
- // "region",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/vpnGateways/{resource}/testIamPermissions",
- // "request": {
- // "$ref": "TestPermissionsRequest"
- // },
- // "response": {
- // "$ref": "TestPermissionsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.vpnTunnels.aggregatedList":
-
-type VpnTunnelsAggregatedListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// AggregatedList: Retrieves an aggregated list of VPN tunnels.
-//
-// - project: Project ID for this request.
-func (r *VpnTunnelsService) AggregatedList(project string) *VpnTunnelsAggregatedListCall {
- c := &VpnTunnelsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *VpnTunnelsAggregatedListCall) Filter(filter string) *VpnTunnelsAggregatedListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// IncludeAllScopes sets the optional parameter "includeAllScopes":
-// Indicates whether every visible scope for each scope type (zone,
-// region, global) should be included in the response. For new resource
-// types added after this field, the flag has no effect as new resource
-// types will always include every visible scope for each scope type in
-// response. For resource types which predate this field, if this flag
-// is omitted or false, only scopes of the scope types where the
-// resource type is expected to be found will be included.
-func (c *VpnTunnelsAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *VpnTunnelsAggregatedListCall {
- c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *VpnTunnelsAggregatedListCall) MaxResults(maxResults int64) *VpnTunnelsAggregatedListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *VpnTunnelsAggregatedListCall) OrderBy(orderBy string) *VpnTunnelsAggregatedListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *VpnTunnelsAggregatedListCall) PageToken(pageToken string) *VpnTunnelsAggregatedListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *VpnTunnelsAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *VpnTunnelsAggregatedListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- return c
-}
-
-// ServiceProjectNumber sets the optional parameter
-// "serviceProjectNumber":
-func (c *VpnTunnelsAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *VpnTunnelsAggregatedListCall {
- c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
- 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 *VpnTunnelsAggregatedListCall) Fields(s ...googleapi.Field) *VpnTunnelsAggregatedListCall {
- 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 *VpnTunnelsAggregatedListCall) IfNoneMatch(entityTag string) *VpnTunnelsAggregatedListCall {
- 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 *VpnTunnelsAggregatedListCall) Context(ctx context.Context) *VpnTunnelsAggregatedListCall {
- 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 *VpnTunnelsAggregatedListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *VpnTunnelsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/aggregated/vpnTunnels")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.vpnTunnels.aggregatedList" call.
-// Exactly one of *VpnTunnelAggregatedList or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *VpnTunnelAggregatedList.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 *VpnTunnelsAggregatedListCall) Do(opts ...googleapi.CallOption) (*VpnTunnelAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &VpnTunnelAggregatedList{
- 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": "Retrieves an aggregated list of VPN tunnels.",
- // "flatPath": "projects/{project}/aggregated/vpnTunnels",
- // "httpMethod": "GET",
- // "id": "compute.vpnTunnels.aggregatedList",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeAllScopes": {
- // "description": "Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "serviceProjectNumber": {
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/aggregated/vpnTunnels",
- // "response": {
- // "$ref": "VpnTunnelAggregatedList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *VpnTunnelsAggregatedListCall) Pages(ctx context.Context, f func(*VpnTunnelAggregatedList) 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 "compute.vpnTunnels.delete":
-
-type VpnTunnelsDeleteCall struct {
- s *Service
- project string
- region string
- vpnTunnel string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified VpnTunnel resource.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-// - vpnTunnel: Name of the VpnTunnel resource to delete.
-func (r *VpnTunnelsService) Delete(project string, region string, vpnTunnel string) *VpnTunnelsDeleteCall {
- c := &VpnTunnelsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.vpnTunnel = vpnTunnel
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *VpnTunnelsDeleteCall) RequestId(requestId string) *VpnTunnelsDeleteCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *VpnTunnelsDeleteCall) Fields(s ...googleapi.Field) *VpnTunnelsDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *VpnTunnelsDeleteCall) Context(ctx context.Context) *VpnTunnelsDeleteCall {
- 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 *VpnTunnelsDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *VpnTunnelsDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/vpnTunnels/{vpnTunnel}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "vpnTunnel": c.vpnTunnel,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.vpnTunnels.delete" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *VpnTunnelsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Deletes the specified VpnTunnel resource.",
- // "flatPath": "projects/{project}/regions/{region}/vpnTunnels/{vpnTunnel}",
- // "httpMethod": "DELETE",
- // "id": "compute.vpnTunnels.delete",
- // "parameterOrder": [
- // "project",
- // "region",
- // "vpnTunnel"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "vpnTunnel": {
- // "description": "Name of the VpnTunnel resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/vpnTunnels/{vpnTunnel}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.vpnTunnels.get":
-
-type VpnTunnelsGetCall struct {
- s *Service
- project string
- region string
- vpnTunnel string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified VpnTunnel resource.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-// - vpnTunnel: Name of the VpnTunnel resource to return.
-func (r *VpnTunnelsService) Get(project string, region string, vpnTunnel string) *VpnTunnelsGetCall {
- c := &VpnTunnelsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.vpnTunnel = vpnTunnel
- 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 *VpnTunnelsGetCall) Fields(s ...googleapi.Field) *VpnTunnelsGetCall {
- 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 *VpnTunnelsGetCall) IfNoneMatch(entityTag string) *VpnTunnelsGetCall {
- 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 *VpnTunnelsGetCall) Context(ctx context.Context) *VpnTunnelsGetCall {
- 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 *VpnTunnelsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *VpnTunnelsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/vpnTunnels/{vpnTunnel}")
- 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{
- "project": c.project,
- "region": c.region,
- "vpnTunnel": c.vpnTunnel,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.vpnTunnels.get" call.
-// Exactly one of *VpnTunnel or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *VpnTunnel.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 *VpnTunnelsGetCall) Do(opts ...googleapi.CallOption) (*VpnTunnel, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &VpnTunnel{
- 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": "Returns the specified VpnTunnel resource.",
- // "flatPath": "projects/{project}/regions/{region}/vpnTunnels/{vpnTunnel}",
- // "httpMethod": "GET",
- // "id": "compute.vpnTunnels.get",
- // "parameterOrder": [
- // "project",
- // "region",
- // "vpnTunnel"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "vpnTunnel": {
- // "description": "Name of the VpnTunnel resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/vpnTunnels/{vpnTunnel}",
- // "response": {
- // "$ref": "VpnTunnel"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.vpnTunnels.insert":
-
-type VpnTunnelsInsertCall struct {
- s *Service
- project string
- region string
- vpntunnel *VpnTunnel
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a VpnTunnel resource in the specified project and
-// region using the data included in the request.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-func (r *VpnTunnelsService) Insert(project string, region string, vpntunnel *VpnTunnel) *VpnTunnelsInsertCall {
- c := &VpnTunnelsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.vpntunnel = vpntunnel
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *VpnTunnelsInsertCall) RequestId(requestId string) *VpnTunnelsInsertCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *VpnTunnelsInsertCall) Fields(s ...googleapi.Field) *VpnTunnelsInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *VpnTunnelsInsertCall) Context(ctx context.Context) *VpnTunnelsInsertCall {
- 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 *VpnTunnelsInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *VpnTunnelsInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.vpntunnel)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/vpnTunnels")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.vpnTunnels.insert" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *VpnTunnelsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Creates a VpnTunnel resource in the specified project and region using the data included in the request.",
- // "flatPath": "projects/{project}/regions/{region}/vpnTunnels",
- // "httpMethod": "POST",
- // "id": "compute.vpnTunnels.insert",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/vpnTunnels",
- // "request": {
- // "$ref": "VpnTunnel"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.vpnTunnels.list":
-
-type VpnTunnelsListCall struct {
- s *Service
- project string
- region string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves a list of VpnTunnel resources contained in the
-// specified project and region.
-//
-// - project: Project ID for this request.
-// - region: Name of the region for this request.
-func (r *VpnTunnelsService) List(project string, region string) *VpnTunnelsListCall {
- c := &VpnTunnelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *VpnTunnelsListCall) Filter(filter string) *VpnTunnelsListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *VpnTunnelsListCall) MaxResults(maxResults int64) *VpnTunnelsListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *VpnTunnelsListCall) OrderBy(orderBy string) *VpnTunnelsListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *VpnTunnelsListCall) PageToken(pageToken string) *VpnTunnelsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *VpnTunnelsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *VpnTunnelsListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *VpnTunnelsListCall) Fields(s ...googleapi.Field) *VpnTunnelsListCall {
- 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 *VpnTunnelsListCall) IfNoneMatch(entityTag string) *VpnTunnelsListCall {
- 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 *VpnTunnelsListCall) Context(ctx context.Context) *VpnTunnelsListCall {
- 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 *VpnTunnelsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *VpnTunnelsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/regions/{region}/vpnTunnels")
- 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{
- "project": c.project,
- "region": c.region,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.vpnTunnels.list" call.
-// Exactly one of *VpnTunnelList or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *VpnTunnelList.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 *VpnTunnelsListCall) Do(opts ...googleapi.CallOption) (*VpnTunnelList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &VpnTunnelList{
- 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": "Retrieves a list of VpnTunnel resources contained in the specified project and region.",
- // "flatPath": "projects/{project}/regions/{region}/vpnTunnels",
- // "httpMethod": "GET",
- // "id": "compute.vpnTunnels.list",
- // "parameterOrder": [
- // "project",
- // "region"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "Name of the region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/vpnTunnels",
- // "response": {
- // "$ref": "VpnTunnelList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *VpnTunnelsListCall) Pages(ctx context.Context, f func(*VpnTunnelList) 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 "compute.vpnTunnels.setLabels":
-
-type VpnTunnelsSetLabelsCall struct {
- s *Service
- project string
- region string
- resource string
- regionsetlabelsrequest *RegionSetLabelsRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetLabels: Sets the labels on a VpnTunnel. To learn more about
-// labels, read the Labeling Resources documentation.
-//
-// - project: Project ID for this request.
-// - region: The region for this request.
-// - resource: Name or id of the resource for this request.
-func (r *VpnTunnelsService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *VpnTunnelsSetLabelsCall {
- c := &VpnTunnelsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.region = region
- c.resource = resource
- c.regionsetlabelsrequest = regionsetlabelsrequest
- return c
-}
-
-// RequestId sets the optional parameter "requestId": An optional
-// request ID to identify requests. Specify a unique request ID so that
-// if you must retry your request, the server will know to ignore the
-// request if it has already been completed. For example, consider a
-// situation where you make an initial request and the request times
-// out. If you make the request again with the same request ID, the
-// server can check if original operation with the same request ID was
-// received, and if so, will ignore the second request. This prevents
-// clients from accidentally creating duplicate commitments. The request
-// ID must be a valid UUID with the exception that zero UUID is not
-// supported ( 00000000-0000-0000-0000-000000000000).
-func (c *VpnTunnelsSetLabelsCall) RequestId(requestId string) *VpnTunnelsSetLabelsCall {
- c.urlParams_.Set("requestId", requestId)
- 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 *VpnTunnelsSetLabelsCall) Fields(s ...googleapi.Field) *VpnTunnelsSetLabelsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *VpnTunnelsSetLabelsCall) Context(ctx context.Context) *VpnTunnelsSetLabelsCall {
- 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 *VpnTunnelsSetLabelsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *VpnTunnelsSetLabelsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/vpnTunnels/{resource}/setLabels")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "region": c.region,
- "resource": c.resource,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.vpnTunnels.setLabels" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *VpnTunnelsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Sets the labels on a VpnTunnel. To learn more about labels, read the Labeling Resources documentation.",
- // "flatPath": "projects/{project}/regions/{region}/vpnTunnels/{resource}/setLabels",
- // "httpMethod": "POST",
- // "id": "compute.vpnTunnels.setLabels",
- // "parameterOrder": [
- // "project",
- // "region",
- // "resource"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "region": {
- // "description": "The region for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // },
- // "requestId": {
- // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).",
- // "location": "query",
- // "type": "string"
- // },
- // "resource": {
- // "description": "Name or id of the resource for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/regions/{region}/vpnTunnels/{resource}/setLabels",
- // "request": {
- // "$ref": "RegionSetLabelsRequest"
- // },
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.zoneOperations.delete":
-
-type ZoneOperationsDeleteCall struct {
- s *Service
- project string
- zone string
- operation string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes the specified zone-specific Operations resource.
-//
-// - operation: Name of the Operations resource to delete.
-// - project: Project ID for this request.
-// - zone: Name of the zone for this request.
-func (r *ZoneOperationsService) Delete(project string, zone string, operation string) *ZoneOperationsDeleteCall {
- c := &ZoneOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.operation = operation
- 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 *ZoneOperationsDeleteCall) Fields(s ...googleapi.Field) *ZoneOperationsDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ZoneOperationsDeleteCall) Context(ctx context.Context) *ZoneOperationsDeleteCall {
- 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 *ZoneOperationsDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ZoneOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/operations/{operation}")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("DELETE", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "operation": c.operation,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.zoneOperations.delete" call.
-func (c *ZoneOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if err != nil {
- return err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return gensupport.WrapError(err)
- }
- return nil
- // {
- // "description": "Deletes the specified zone-specific Operations resource.",
- // "flatPath": "projects/{project}/zones/{zone}/operations/{operation}",
- // "httpMethod": "DELETE",
- // "id": "compute.zoneOperations.delete",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "operation"
- // ],
- // "parameters": {
- // "operation": {
- // "description": "Name of the Operations resource to delete.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "Name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/operations/{operation}",
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute"
- // ]
- // }
-
-}
-
-// method id "compute.zoneOperations.get":
-
-type ZoneOperationsGetCall struct {
- s *Service
- project string
- zone string
- operation string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Retrieves the specified zone-specific Operations resource.
-//
-// - operation: Name of the Operations resource to return.
-// - project: Project ID for this request.
-// - zone: Name of the zone for this request.
-func (r *ZoneOperationsService) Get(project string, zone string, operation string) *ZoneOperationsGetCall {
- c := &ZoneOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.operation = operation
- 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 *ZoneOperationsGetCall) Fields(s ...googleapi.Field) *ZoneOperationsGetCall {
- 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 *ZoneOperationsGetCall) IfNoneMatch(entityTag string) *ZoneOperationsGetCall {
- 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 *ZoneOperationsGetCall) Context(ctx context.Context) *ZoneOperationsGetCall {
- 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 *ZoneOperationsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ZoneOperationsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}/operations/{operation}")
- 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{
- "project": c.project,
- "zone": c.zone,
- "operation": c.operation,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.zoneOperations.get" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *ZoneOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Retrieves the specified zone-specific Operations resource.",
- // "flatPath": "projects/{project}/zones/{zone}/operations/{operation}",
- // "httpMethod": "GET",
- // "id": "compute.zoneOperations.get",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "operation"
- // ],
- // "parameters": {
- // "operation": {
- // "description": "Name of the Operations resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "Name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/operations/{operation}",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.zoneOperations.list":
-
-type ZoneOperationsListCall struct {
- s *Service
- project string
- zone string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves a list of Operation resources contained within the
-// specified zone.
-//
-// - project: Project ID for this request.
-// - zone: Name of the zone for request.
-func (r *ZoneOperationsService) List(project string, zone string) *ZoneOperationsListCall {
- c := &ZoneOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *ZoneOperationsListCall) Filter(filter string) *ZoneOperationsListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *ZoneOperationsListCall) MaxResults(maxResults int64) *ZoneOperationsListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *ZoneOperationsListCall) OrderBy(orderBy string) *ZoneOperationsListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *ZoneOperationsListCall) PageToken(pageToken string) *ZoneOperationsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *ZoneOperationsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ZoneOperationsListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *ZoneOperationsListCall) Fields(s ...googleapi.Field) *ZoneOperationsListCall {
- 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 *ZoneOperationsListCall) IfNoneMatch(entityTag string) *ZoneOperationsListCall {
- 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 *ZoneOperationsListCall) Context(ctx context.Context) *ZoneOperationsListCall {
- 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 *ZoneOperationsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ZoneOperationsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}/operations")
- 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{
- "project": c.project,
- "zone": c.zone,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.zoneOperations.list" call.
-// Exactly one of *OperationList or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *OperationList.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 *ZoneOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &OperationList{
- 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": "Retrieves a list of Operation resources contained within the specified zone.",
- // "flatPath": "projects/{project}/zones/{zone}/operations",
- // "httpMethod": "GET",
- // "id": "compute.zoneOperations.list",
- // "parameterOrder": [
- // "project",
- // "zone"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "zone": {
- // "description": "Name of the zone for request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/operations",
- // "response": {
- // "$ref": "OperationList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *ZoneOperationsListCall) Pages(ctx context.Context, f func(*OperationList) 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 "compute.zoneOperations.wait":
-
-type ZoneOperationsWaitCall struct {
- s *Service
- project string
- zone string
- operation string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Wait: Waits for the specified Operation resource to return as `DONE`
-// or for the request to approach the 2 minute deadline, and retrieves
-// the specified Operation resource. This method waits for no more than
-// the 2 minutes and then returns the current state of the operation,
-// which might be `DONE` or still in progress. This method is called on
-// a best-effort basis. Specifically: - In uncommon cases, when the
-// server is overloaded, the request might return before the default
-// deadline is reached, or might return after zero seconds. - If the
-// default deadline is reached, there is no guarantee that the operation
-// is actually done when the method returns. Be prepared to retry if the
-// operation is not `DONE`.
-//
-// - operation: Name of the Operations resource to return.
-// - project: Project ID for this request.
-// - zone: Name of the zone for this request.
-func (r *ZoneOperationsService) Wait(project string, zone string, operation string) *ZoneOperationsWaitCall {
- c := &ZoneOperationsWaitCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- c.operation = operation
- 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 *ZoneOperationsWaitCall) Fields(s ...googleapi.Field) *ZoneOperationsWaitCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- 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 *ZoneOperationsWaitCall) Context(ctx context.Context) *ZoneOperationsWaitCall {
- 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 *ZoneOperationsWaitCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ZoneOperationsWaitCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- c.urlParams_.Set("prettyPrint", "false")
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/operations/{operation}/wait")
- urls += "?" + c.urlParams_.Encode()
- req, err := http.NewRequest("POST", urls, body)
- if err != nil {
- return nil, err
- }
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "zone": c.zone,
- "operation": c.operation,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.zoneOperations.wait" call.
-// Exactly one of *Operation or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Operation.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 *ZoneOperationsWaitCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Operation{
- 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": "Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method waits for no more than the 2 minutes and then returns the current state of the operation, which might be `DONE` or still in progress. This method is called on a best-effort basis. Specifically: - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not `DONE`. ",
- // "flatPath": "projects/{project}/zones/{zone}/operations/{operation}/wait",
- // "httpMethod": "POST",
- // "id": "compute.zoneOperations.wait",
- // "parameterOrder": [
- // "project",
- // "zone",
- // "operation"
- // ],
- // "parameters": {
- // "operation": {
- // "description": "Name of the Operations resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "Name of the zone for this request.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}/operations/{operation}/wait",
- // "response": {
- // "$ref": "Operation"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.zones.get":
-
-type ZonesGetCall struct {
- s *Service
- project string
- zone string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the specified Zone resource.
-//
-// - project: Project ID for this request.
-// - zone: Name of the zone resource to return.
-func (r *ZonesService) Get(project string, zone string) *ZonesGetCall {
- c := &ZonesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.zone = zone
- 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 *ZonesGetCall) Fields(s ...googleapi.Field) *ZonesGetCall {
- 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 *ZonesGetCall) IfNoneMatch(entityTag string) *ZonesGetCall {
- 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 *ZonesGetCall) Context(ctx context.Context) *ZonesGetCall {
- 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 *ZonesGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ZonesGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones/{zone}")
- 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{
- "project": c.project,
- "zone": c.zone,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.zones.get" call.
-// Exactly one of *Zone or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Zone.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 *ZonesGetCall) Do(opts ...googleapi.CallOption) (*Zone, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &Zone{
- 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": "Returns the specified Zone resource.",
- // "flatPath": "projects/{project}/zones/{zone}",
- // "httpMethod": "GET",
- // "id": "compute.zones.get",
- // "parameterOrder": [
- // "project",
- // "zone"
- // ],
- // "parameters": {
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "zone": {
- // "description": "Name of the zone resource to return.",
- // "location": "path",
- // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "projects/{project}/zones/{zone}",
- // "response": {
- // "$ref": "Zone"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// method id "compute.zones.list":
-
-type ZonesListCall struct {
- s *Service
- project string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves the list of Zone resources available to the specified
-// project.
-//
-// - project: Project ID for this request.
-func (r *ZonesService) List(project string) *ZonesListCall {
- c := &ZonesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- return c
-}
-
-// Filter sets the optional parameter "filter": A filter expression that
-// filters resources listed in the response. Most Compute resources
-// support two types of filter expressions: expressions that support
-// regular expressions and expressions that follow API improvement
-// proposal AIP-160. These two types of filter expressions cannot be
-// mixed in one request. If you want to use AIP-160, your expression
-// must specify the field name, an operator, and the value that you want
-// to use for filtering. The value must be a string, a number, or a
-// boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=`
-// or `:`. For example, if you are filtering Compute Engine instances,
-// you can exclude instances named `example-instance` by specifying
-// `name != example-instance`. The `:*` comparison can be used to test
-// whether a key has been defined. For example, to find all objects with
-// `owner` label use: ``` labels.owner:* ``` You can also filter nested
-// fields. For example, you could specify `scheduling.automaticRestart =
-// false` to include instances only if they are not scheduled for
-// automatic restarts. You can use filtering on nested fields to filter
-// based on resource labels. To filter on multiple expressions, provide
-// each separate expression within parentheses. For example: ```
-// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake")
-// ``` By default, each expression is an `AND` expression. However, you
-// can include `AND` and `OR` expressions explicitly. For example: ```
-// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell")
-// AND (scheduling.automaticRestart = true) ``` If you want to use a
-// regular expression, use the `eq` (equal) or `ne` (not equal) operator
-// against a single un-parenthesized expression with or without quotes
-// or against multiple parenthesized expressions. Examples: `fieldname
-// eq unquoted literal` `fieldname eq 'single quoted literal'`
-// `fieldname eq "double quoted literal" `(fieldname1 eq literal)
-// (fieldname2 ne "literal")` The literal value is interpreted as a
-// regular expression using Google RE2 library syntax. The literal value
-// must match the entire field. For example, to filter for instances
-// that do not end with name "instance", you would use `name ne
-// .*instance`. You cannot combine constraints on multiple fields using
-// regular expressions.
-func (c *ZonesListCall) Filter(filter string) *ZonesListCall {
- c.urlParams_.Set("filter", filter)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": The maximum
-// number of results per page that should be returned. If the number of
-// available results is larger than `maxResults`, Compute Engine returns
-// a `nextPageToken` that can be used to get the next page of results in
-// subsequent list requests. Acceptable values are `0` to `500`,
-// inclusive. (Default: `500`)
-func (c *ZonesListCall) MaxResults(maxResults int64) *ZonesListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// OrderBy sets the optional parameter "orderBy": Sorts list results by
-// a certain order. By default, results are returned in alphanumerical
-// order based on the resource name. You can also sort results in
-// descending order based on the creation timestamp using
-// `orderBy="creationTimestamp desc". This sorts results based on the
-// `creationTimestamp` field in reverse chronological order (newest
-// result first). Use this to sort resources like operations so that the
-// newest operation is returned first. Currently, only sorting by `name`
-// or `creationTimestamp desc` is supported.
-func (c *ZonesListCall) OrderBy(orderBy string) *ZonesListCall {
- c.urlParams_.Set("orderBy", orderBy)
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": Specifies a page
-// token to use. Set `pageToken` to the `nextPageToken` returned by a
-// previous list request to get the next page of results.
-func (c *ZonesListCall) PageToken(pageToken string) *ZonesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// ReturnPartialSuccess sets the optional parameter
-// "returnPartialSuccess": Opt-in for partial success behavior which
-// provides partial results in case of failure. The default value is
-// false.
-func (c *ZonesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ZonesListCall {
- c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
- 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 *ZonesListCall) Fields(s ...googleapi.Field) *ZonesListCall {
- 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 *ZonesListCall) IfNoneMatch(entityTag string) *ZonesListCall {
- 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 *ZonesListCall) Context(ctx context.Context) *ZonesListCall {
- 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 *ZonesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ZonesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
- 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, "projects/{project}/zones")
- 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{
- "project": c.project,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "compute.zones.list" call.
-// Exactly one of *ZoneList or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *ZoneList.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 *ZonesListCall) Do(opts ...googleapi.CallOption) (*ZoneList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
- }
- ret := &ZoneList{
- 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": "Retrieves the list of Zone resources available to the specified project.",
- // "flatPath": "projects/{project}/zones",
- // "httpMethod": "GET",
- // "id": "compute.zones.list",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "filter": {
- // "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "default": "500",
- // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderBy": {
- // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "Project ID for this request.",
- // "location": "path",
- // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
- // "required": true,
- // "type": "string"
- // },
- // "returnPartialSuccess": {
- // "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "projects/{project}/zones",
- // "response": {
- // "$ref": "ZoneList"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/compute",
- // "https://www.googleapis.com/auth/compute.readonly"
- // ]
- // }
-
-}
-
-// 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 *ZonesListCall) Pages(ctx context.Context, f func(*ZoneList) 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)
- }
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
diff --git a/vendor/google.golang.org/api/compute/v1/compute2-gen.go b/vendor/google.golang.org/api/compute/v1/compute2-gen.go
new file mode 100644
index 00000000..f66a5b58
--- /dev/null
+++ b/vendor/google.golang.org/api/compute/v1/compute2-gen.go
@@ -0,0 +1,58398 @@
+// Copyright 2024 Google LLC.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Code generated file. DO NOT EDIT.
+
+package compute
+
+import (
+ "context"
+ "fmt"
+ "io"
+ "net/http"
+
+ googleapi "google.golang.org/api/googleapi"
+ gensupport "google.golang.org/api/internal/gensupport"
+)
+
+type AcceleratorTypesAggregatedListCall struct {
+ s *Service
+ project string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// AggregatedList: Retrieves an aggregated list of accelerator types. To
+// prevent failure, Google recommends that you set the `returnPartialSuccess`
+// parameter to `true`.
+//
+// - project: Project ID for this request.
+func (r *AcceleratorTypesService) AggregatedList(project string) *AcceleratorTypesAggregatedListCall {
+ c := &AcceleratorTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ return c
+}
+
+// Filter sets the optional parameter "filter": A filter expression that
+// filters resources listed in the response. Most Compute resources support two
+// types of filter expressions: expressions that support regular expressions
+// and expressions that follow API improvement proposal AIP-160. These two
+// types of filter expressions cannot be mixed in one request. If you want to
+// use AIP-160, your expression must specify the field name, an operator, and
+// the value that you want to use for filtering. The value must be a string, a
+// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
+// `>=` or `:`. For example, if you are filtering Compute Engine instances, you
+// can exclude instances named `example-instance` by specifying `name !=
+// example-instance`. The `:*` comparison can be used to test whether a key has
+// been defined. For example, to find all objects with `owner` label use: ```
+// labels.owner:* ``` You can also filter nested fields. For example, you could
+// specify `scheduling.automaticRestart = false` to include instances only if
+// they are not scheduled for automatic restarts. You can use filtering on
+// nested fields to filter based on resource labels. To filter on multiple
+// expressions, provide each separate expression within parentheses. For
+// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel
+// Skylake") ``` By default, each expression is an `AND` expression. However,
+// you can include `AND` and `OR` expressions explicitly. For example: ```
+// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND
+// (scheduling.automaticRestart = true) ``` If you want to use a regular
+// expression, use the `eq` (equal) or `ne` (not equal) operator against a
+// single un-parenthesized expression with or without quotes or against
+// multiple parenthesized expressions. Examples: `fieldname eq unquoted
+// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted
+// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal
+// value is interpreted as a regular expression using Google RE2 library
+// syntax. The literal value must match the entire field. For example, to
+// filter for instances that do not end with name "instance", you would use
+// `name ne .*instance`. You cannot combine constraints on multiple fields
+// using regular expressions.
+func (c *AcceleratorTypesAggregatedListCall) Filter(filter string) *AcceleratorTypesAggregatedListCall {
+ c.urlParams_.Set("filter", filter)
+ return c
+}
+
+// IncludeAllScopes sets the optional parameter "includeAllScopes": Indicates
+// whether every visible scope for each scope type (zone, region, global)
+// should be included in the response. For new resource types added after this
+// field, the flag has no effect as new resource types will always include
+// every visible scope for each scope type in response. For resource types
+// which predate this field, if this flag is omitted or false, only scopes of
+// the scope types where the resource type is expected to be found will be
+// included.
+func (c *AcceleratorTypesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *AcceleratorTypesAggregatedListCall {
+ c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
+ return c
+}
+
+// MaxResults sets the optional parameter "maxResults": The maximum number of
+// results per page that should be returned. If the number of available results
+// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that
+// can be used to get the next page of results in subsequent list requests.
+// Acceptable values are `0` to `500`, inclusive. (Default: `500`)
+func (c *AcceleratorTypesAggregatedListCall) MaxResults(maxResults int64) *AcceleratorTypesAggregatedListCall {
+ c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
+ return c
+}
+
+// OrderBy sets the optional parameter "orderBy": Sorts list results by a
+// certain order. By default, results are returned in alphanumerical order
+// based on the resource name. You can also sort results in descending order
+// based on the creation timestamp using `orderBy="creationTimestamp desc".
+// This sorts results based on the `creationTimestamp` field in reverse
+// chronological order (newest result first). Use this to sort resources like
+// operations so that the newest operation is returned first. Currently, only
+// sorting by `name` or `creationTimestamp desc` is supported.
+func (c *AcceleratorTypesAggregatedListCall) OrderBy(orderBy string) *AcceleratorTypesAggregatedListCall {
+ c.urlParams_.Set("orderBy", orderBy)
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": Specifies a page token to
+// use. Set `pageToken` to the `nextPageToken` returned by a previous list
+// request to get the next page of results.
+func (c *AcceleratorTypesAggregatedListCall) PageToken(pageToken string) *AcceleratorTypesAggregatedListCall {
+ c.urlParams_.Set("pageToken", pageToken)
+ return c
+}
+
+// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
+// Opt-in for partial success behavior which provides partial results in case
+// of failure. The default value is false. For example, when partial success
+// behavior is enabled, aggregatedList for a single zone scope either returns
+// all resources in the zone or no resources, with an error code.
+func (c *AcceleratorTypesAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *AcceleratorTypesAggregatedListCall {
+ c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
+ return c
+}
+
+// ServiceProjectNumber sets the optional parameter "serviceProjectNumber": The
+// Shared VPC service project id or service project number for which aggregated
+// list request is invoked for subnetworks list-usable api.
+func (c *AcceleratorTypesAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *AcceleratorTypesAggregatedListCall {
+ c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *AcceleratorTypesAggregatedListCall) Fields(s ...googleapi.Field) *AcceleratorTypesAggregatedListCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *AcceleratorTypesAggregatedListCall) IfNoneMatch(entityTag string) *AcceleratorTypesAggregatedListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *AcceleratorTypesAggregatedListCall) Context(ctx context.Context) *AcceleratorTypesAggregatedListCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *AcceleratorTypesAggregatedListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *AcceleratorTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/aggregated/acceleratorTypes")
+ 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{
+ "project": c.project,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.acceleratorTypes.aggregatedList" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *AcceleratorTypeAggregatedList.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 *AcceleratorTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*AcceleratorTypeAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &AcceleratorTypeAggregatedList{
+ 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
+}
+
+// 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 *AcceleratorTypesAggregatedListCall) Pages(ctx context.Context, f func(*AcceleratorTypeAggregatedList) error) error {
+ c.ctx_ = ctx
+ defer c.PageToken(c.urlParams_.Get("pageToken"))
+ 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)
+ }
+}
+
+type AcceleratorTypesGetCall struct {
+ s *Service
+ project string
+ zone string
+ acceleratorType string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Get: Returns the specified accelerator type.
+//
+// - acceleratorType: Name of the accelerator type to return.
+// - project: Project ID for this request.
+// - zone: The name of the zone for this request.
+func (r *AcceleratorTypesService) Get(project string, zone string, acceleratorType string) *AcceleratorTypesGetCall {
+ c := &AcceleratorTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.zone = zone
+ c.acceleratorType = acceleratorType
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *AcceleratorTypesGetCall) Fields(s ...googleapi.Field) *AcceleratorTypesGetCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *AcceleratorTypesGetCall) IfNoneMatch(entityTag string) *AcceleratorTypesGetCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *AcceleratorTypesGetCall) Context(ctx context.Context) *AcceleratorTypesGetCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *AcceleratorTypesGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *AcceleratorTypesGetCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/zones/{zone}/acceleratorTypes/{acceleratorType}")
+ 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{
+ "project": c.project,
+ "zone": c.zone,
+ "acceleratorType": c.acceleratorType,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.acceleratorTypes.get" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *AcceleratorType.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 *AcceleratorTypesGetCall) Do(opts ...googleapi.CallOption) (*AcceleratorType, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &AcceleratorType{
+ 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
+}
+
+type AcceleratorTypesListCall struct {
+ s *Service
+ project string
+ zone string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// List: Retrieves a list of accelerator types that are available to the
+// specified project.
+//
+// - project: Project ID for this request.
+// - zone: The name of the zone for this request.
+func (r *AcceleratorTypesService) List(project string, zone string) *AcceleratorTypesListCall {
+ c := &AcceleratorTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.zone = zone
+ return c
+}
+
+// Filter sets the optional parameter "filter": A filter expression that
+// filters resources listed in the response. Most Compute resources support two
+// types of filter expressions: expressions that support regular expressions
+// and expressions that follow API improvement proposal AIP-160. These two
+// types of filter expressions cannot be mixed in one request. If you want to
+// use AIP-160, your expression must specify the field name, an operator, and
+// the value that you want to use for filtering. The value must be a string, a
+// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
+// `>=` or `:`. For example, if you are filtering Compute Engine instances, you
+// can exclude instances named `example-instance` by specifying `name !=
+// example-instance`. The `:*` comparison can be used to test whether a key has
+// been defined. For example, to find all objects with `owner` label use: ```
+// labels.owner:* ``` You can also filter nested fields. For example, you could
+// specify `scheduling.automaticRestart = false` to include instances only if
+// they are not scheduled for automatic restarts. You can use filtering on
+// nested fields to filter based on resource labels. To filter on multiple
+// expressions, provide each separate expression within parentheses. For
+// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel
+// Skylake") ``` By default, each expression is an `AND` expression. However,
+// you can include `AND` and `OR` expressions explicitly. For example: ```
+// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND
+// (scheduling.automaticRestart = true) ``` If you want to use a regular
+// expression, use the `eq` (equal) or `ne` (not equal) operator against a
+// single un-parenthesized expression with or without quotes or against
+// multiple parenthesized expressions. Examples: `fieldname eq unquoted
+// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted
+// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal
+// value is interpreted as a regular expression using Google RE2 library
+// syntax. The literal value must match the entire field. For example, to
+// filter for instances that do not end with name "instance", you would use
+// `name ne .*instance`. You cannot combine constraints on multiple fields
+// using regular expressions.
+func (c *AcceleratorTypesListCall) Filter(filter string) *AcceleratorTypesListCall {
+ c.urlParams_.Set("filter", filter)
+ return c
+}
+
+// MaxResults sets the optional parameter "maxResults": The maximum number of
+// results per page that should be returned. If the number of available results
+// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that
+// can be used to get the next page of results in subsequent list requests.
+// Acceptable values are `0` to `500`, inclusive. (Default: `500`)
+func (c *AcceleratorTypesListCall) MaxResults(maxResults int64) *AcceleratorTypesListCall {
+ c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
+ return c
+}
+
+// OrderBy sets the optional parameter "orderBy": Sorts list results by a
+// certain order. By default, results are returned in alphanumerical order
+// based on the resource name. You can also sort results in descending order
+// based on the creation timestamp using `orderBy="creationTimestamp desc".
+// This sorts results based on the `creationTimestamp` field in reverse
+// chronological order (newest result first). Use this to sort resources like
+// operations so that the newest operation is returned first. Currently, only
+// sorting by `name` or `creationTimestamp desc` is supported.
+func (c *AcceleratorTypesListCall) OrderBy(orderBy string) *AcceleratorTypesListCall {
+ c.urlParams_.Set("orderBy", orderBy)
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": Specifies a page token to
+// use. Set `pageToken` to the `nextPageToken` returned by a previous list
+// request to get the next page of results.
+func (c *AcceleratorTypesListCall) PageToken(pageToken string) *AcceleratorTypesListCall {
+ c.urlParams_.Set("pageToken", pageToken)
+ return c
+}
+
+// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
+// Opt-in for partial success behavior which provides partial results in case
+// of failure. The default value is false. For example, when partial success
+// behavior is enabled, aggregatedList for a single zone scope either returns
+// all resources in the zone or no resources, with an error code.
+func (c *AcceleratorTypesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *AcceleratorTypesListCall {
+ c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *AcceleratorTypesListCall) Fields(s ...googleapi.Field) *AcceleratorTypesListCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *AcceleratorTypesListCall) IfNoneMatch(entityTag string) *AcceleratorTypesListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *AcceleratorTypesListCall) Context(ctx context.Context) *AcceleratorTypesListCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *AcceleratorTypesListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *AcceleratorTypesListCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/zones/{zone}/acceleratorTypes")
+ 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{
+ "project": c.project,
+ "zone": c.zone,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.acceleratorTypes.list" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *AcceleratorTypeList.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 *AcceleratorTypesListCall) Do(opts ...googleapi.CallOption) (*AcceleratorTypeList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &AcceleratorTypeList{
+ 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
+}
+
+// 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 *AcceleratorTypesListCall) Pages(ctx context.Context, f func(*AcceleratorTypeList) error) error {
+ c.ctx_ = ctx
+ defer c.PageToken(c.urlParams_.Get("pageToken"))
+ 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)
+ }
+}
+
+type AddressesAggregatedListCall struct {
+ s *Service
+ project string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// AggregatedList: Retrieves an aggregated list of addresses. To prevent
+// failure, Google recommends that you set the `returnPartialSuccess` parameter
+// to `true`.
+//
+// - project: Project ID for this request.
+func (r *AddressesService) AggregatedList(project string) *AddressesAggregatedListCall {
+ c := &AddressesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ return c
+}
+
+// Filter sets the optional parameter "filter": A filter expression that
+// filters resources listed in the response. Most Compute resources support two
+// types of filter expressions: expressions that support regular expressions
+// and expressions that follow API improvement proposal AIP-160. These two
+// types of filter expressions cannot be mixed in one request. If you want to
+// use AIP-160, your expression must specify the field name, an operator, and
+// the value that you want to use for filtering. The value must be a string, a
+// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
+// `>=` or `:`. For example, if you are filtering Compute Engine instances, you
+// can exclude instances named `example-instance` by specifying `name !=
+// example-instance`. The `:*` comparison can be used to test whether a key has
+// been defined. For example, to find all objects with `owner` label use: ```
+// labels.owner:* ``` You can also filter nested fields. For example, you could
+// specify `scheduling.automaticRestart = false` to include instances only if
+// they are not scheduled for automatic restarts. You can use filtering on
+// nested fields to filter based on resource labels. To filter on multiple
+// expressions, provide each separate expression within parentheses. For
+// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel
+// Skylake") ``` By default, each expression is an `AND` expression. However,
+// you can include `AND` and `OR` expressions explicitly. For example: ```
+// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND
+// (scheduling.automaticRestart = true) ``` If you want to use a regular
+// expression, use the `eq` (equal) or `ne` (not equal) operator against a
+// single un-parenthesized expression with or without quotes or against
+// multiple parenthesized expressions. Examples: `fieldname eq unquoted
+// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted
+// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal
+// value is interpreted as a regular expression using Google RE2 library
+// syntax. The literal value must match the entire field. For example, to
+// filter for instances that do not end with name "instance", you would use
+// `name ne .*instance`. You cannot combine constraints on multiple fields
+// using regular expressions.
+func (c *AddressesAggregatedListCall) Filter(filter string) *AddressesAggregatedListCall {
+ c.urlParams_.Set("filter", filter)
+ return c
+}
+
+// IncludeAllScopes sets the optional parameter "includeAllScopes": Indicates
+// whether every visible scope for each scope type (zone, region, global)
+// should be included in the response. For new resource types added after this
+// field, the flag has no effect as new resource types will always include
+// every visible scope for each scope type in response. For resource types
+// which predate this field, if this flag is omitted or false, only scopes of
+// the scope types where the resource type is expected to be found will be
+// included.
+func (c *AddressesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *AddressesAggregatedListCall {
+ c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
+ return c
+}
+
+// MaxResults sets the optional parameter "maxResults": The maximum number of
+// results per page that should be returned. If the number of available results
+// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that
+// can be used to get the next page of results in subsequent list requests.
+// Acceptable values are `0` to `500`, inclusive. (Default: `500`)
+func (c *AddressesAggregatedListCall) MaxResults(maxResults int64) *AddressesAggregatedListCall {
+ c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
+ return c
+}
+
+// OrderBy sets the optional parameter "orderBy": Sorts list results by a
+// certain order. By default, results are returned in alphanumerical order
+// based on the resource name. You can also sort results in descending order
+// based on the creation timestamp using `orderBy="creationTimestamp desc".
+// This sorts results based on the `creationTimestamp` field in reverse
+// chronological order (newest result first). Use this to sort resources like
+// operations so that the newest operation is returned first. Currently, only
+// sorting by `name` or `creationTimestamp desc` is supported.
+func (c *AddressesAggregatedListCall) OrderBy(orderBy string) *AddressesAggregatedListCall {
+ c.urlParams_.Set("orderBy", orderBy)
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": Specifies a page token to
+// use. Set `pageToken` to the `nextPageToken` returned by a previous list
+// request to get the next page of results.
+func (c *AddressesAggregatedListCall) PageToken(pageToken string) *AddressesAggregatedListCall {
+ c.urlParams_.Set("pageToken", pageToken)
+ return c
+}
+
+// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
+// Opt-in for partial success behavior which provides partial results in case
+// of failure. The default value is false. For example, when partial success
+// behavior is enabled, aggregatedList for a single zone scope either returns
+// all resources in the zone or no resources, with an error code.
+func (c *AddressesAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *AddressesAggregatedListCall {
+ c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
+ return c
+}
+
+// ServiceProjectNumber sets the optional parameter "serviceProjectNumber": The
+// Shared VPC service project id or service project number for which aggregated
+// list request is invoked for subnetworks list-usable api.
+func (c *AddressesAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *AddressesAggregatedListCall {
+ c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *AddressesAggregatedListCall) Fields(s ...googleapi.Field) *AddressesAggregatedListCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *AddressesAggregatedListCall) IfNoneMatch(entityTag string) *AddressesAggregatedListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *AddressesAggregatedListCall) Context(ctx context.Context) *AddressesAggregatedListCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *AddressesAggregatedListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *AddressesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/aggregated/addresses")
+ 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{
+ "project": c.project,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.addresses.aggregatedList" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *AddressAggregatedList.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 *AddressesAggregatedListCall) Do(opts ...googleapi.CallOption) (*AddressAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &AddressAggregatedList{
+ 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
+}
+
+// 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 *AddressesAggregatedListCall) Pages(ctx context.Context, f func(*AddressAggregatedList) error) error {
+ c.ctx_ = ctx
+ defer c.PageToken(c.urlParams_.Get("pageToken"))
+ 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)
+ }
+}
+
+type AddressesDeleteCall struct {
+ s *Service
+ project string
+ region string
+ address string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Delete: Deletes the specified address resource.
+//
+// - address: Name of the address resource to delete.
+// - project: Project ID for this request.
+// - region: Name of the region for this request.
+func (r *AddressesService) Delete(project string, region string, address string) *AddressesDeleteCall {
+ c := &AddressesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.region = region
+ c.address = address
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *AddressesDeleteCall) RequestId(requestId string) *AddressesDeleteCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *AddressesDeleteCall) Fields(s ...googleapi.Field) *AddressesDeleteCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *AddressesDeleteCall) Context(ctx context.Context) *AddressesDeleteCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *AddressesDeleteCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *AddressesDeleteCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/addresses/{address}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("DELETE", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "region": c.region,
+ "address": c.address,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.addresses.delete" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *AddressesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type AddressesGetCall struct {
+ s *Service
+ project string
+ region string
+ address string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Get: Returns the specified address resource.
+//
+// - address: Name of the address resource to return.
+// - project: Project ID for this request.
+// - region: Name of the region for this request.
+func (r *AddressesService) Get(project string, region string, address string) *AddressesGetCall {
+ c := &AddressesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.region = region
+ c.address = address
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *AddressesGetCall) Fields(s ...googleapi.Field) *AddressesGetCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *AddressesGetCall) IfNoneMatch(entityTag string) *AddressesGetCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *AddressesGetCall) Context(ctx context.Context) *AddressesGetCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *AddressesGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *AddressesGetCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/regions/{region}/addresses/{address}")
+ 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{
+ "project": c.project,
+ "region": c.region,
+ "address": c.address,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.addresses.get" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Address.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 *AddressesGetCall) Do(opts ...googleapi.CallOption) (*Address, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Address{
+ 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
+}
+
+type AddressesInsertCall struct {
+ s *Service
+ project string
+ region string
+ address *Address
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Insert: Creates an address resource in the specified project by using the
+// data included in the request.
+//
+// - project: Project ID for this request.
+// - region: Name of the region for this request.
+func (r *AddressesService) Insert(project string, region string, address *Address) *AddressesInsertCall {
+ c := &AddressesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.region = region
+ c.address = address
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *AddressesInsertCall) RequestId(requestId string) *AddressesInsertCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *AddressesInsertCall) Fields(s ...googleapi.Field) *AddressesInsertCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *AddressesInsertCall) Context(ctx context.Context) *AddressesInsertCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *AddressesInsertCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *AddressesInsertCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.address)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/addresses")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "region": c.region,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.addresses.insert" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *AddressesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type AddressesListCall struct {
+ s *Service
+ project string
+ region string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// List: Retrieves a list of addresses contained within the specified region.
+//
+// - project: Project ID for this request.
+// - region: Name of the region for this request.
+func (r *AddressesService) List(project string, region string) *AddressesListCall {
+ c := &AddressesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.region = region
+ return c
+}
+
+// Filter sets the optional parameter "filter": A filter expression that
+// filters resources listed in the response. Most Compute resources support two
+// types of filter expressions: expressions that support regular expressions
+// and expressions that follow API improvement proposal AIP-160. These two
+// types of filter expressions cannot be mixed in one request. If you want to
+// use AIP-160, your expression must specify the field name, an operator, and
+// the value that you want to use for filtering. The value must be a string, a
+// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
+// `>=` or `:`. For example, if you are filtering Compute Engine instances, you
+// can exclude instances named `example-instance` by specifying `name !=
+// example-instance`. The `:*` comparison can be used to test whether a key has
+// been defined. For example, to find all objects with `owner` label use: ```
+// labels.owner:* ``` You can also filter nested fields. For example, you could
+// specify `scheduling.automaticRestart = false` to include instances only if
+// they are not scheduled for automatic restarts. You can use filtering on
+// nested fields to filter based on resource labels. To filter on multiple
+// expressions, provide each separate expression within parentheses. For
+// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel
+// Skylake") ``` By default, each expression is an `AND` expression. However,
+// you can include `AND` and `OR` expressions explicitly. For example: ```
+// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND
+// (scheduling.automaticRestart = true) ``` If you want to use a regular
+// expression, use the `eq` (equal) or `ne` (not equal) operator against a
+// single un-parenthesized expression with or without quotes or against
+// multiple parenthesized expressions. Examples: `fieldname eq unquoted
+// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted
+// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal
+// value is interpreted as a regular expression using Google RE2 library
+// syntax. The literal value must match the entire field. For example, to
+// filter for instances that do not end with name "instance", you would use
+// `name ne .*instance`. You cannot combine constraints on multiple fields
+// using regular expressions.
+func (c *AddressesListCall) Filter(filter string) *AddressesListCall {
+ c.urlParams_.Set("filter", filter)
+ return c
+}
+
+// MaxResults sets the optional parameter "maxResults": The maximum number of
+// results per page that should be returned. If the number of available results
+// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that
+// can be used to get the next page of results in subsequent list requests.
+// Acceptable values are `0` to `500`, inclusive. (Default: `500`)
+func (c *AddressesListCall) MaxResults(maxResults int64) *AddressesListCall {
+ c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
+ return c
+}
+
+// OrderBy sets the optional parameter "orderBy": Sorts list results by a
+// certain order. By default, results are returned in alphanumerical order
+// based on the resource name. You can also sort results in descending order
+// based on the creation timestamp using `orderBy="creationTimestamp desc".
+// This sorts results based on the `creationTimestamp` field in reverse
+// chronological order (newest result first). Use this to sort resources like
+// operations so that the newest operation is returned first. Currently, only
+// sorting by `name` or `creationTimestamp desc` is supported.
+func (c *AddressesListCall) OrderBy(orderBy string) *AddressesListCall {
+ c.urlParams_.Set("orderBy", orderBy)
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": Specifies a page token to
+// use. Set `pageToken` to the `nextPageToken` returned by a previous list
+// request to get the next page of results.
+func (c *AddressesListCall) PageToken(pageToken string) *AddressesListCall {
+ c.urlParams_.Set("pageToken", pageToken)
+ return c
+}
+
+// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
+// Opt-in for partial success behavior which provides partial results in case
+// of failure. The default value is false. For example, when partial success
+// behavior is enabled, aggregatedList for a single zone scope either returns
+// all resources in the zone or no resources, with an error code.
+func (c *AddressesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *AddressesListCall {
+ c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *AddressesListCall) Fields(s ...googleapi.Field) *AddressesListCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *AddressesListCall) IfNoneMatch(entityTag string) *AddressesListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *AddressesListCall) Context(ctx context.Context) *AddressesListCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *AddressesListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *AddressesListCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/regions/{region}/addresses")
+ 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{
+ "project": c.project,
+ "region": c.region,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.addresses.list" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *AddressList.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 *AddressesListCall) Do(opts ...googleapi.CallOption) (*AddressList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &AddressList{
+ 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
+}
+
+// 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 *AddressesListCall) Pages(ctx context.Context, f func(*AddressList) error) error {
+ c.ctx_ = ctx
+ defer c.PageToken(c.urlParams_.Get("pageToken"))
+ 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)
+ }
+}
+
+type AddressesMoveCall struct {
+ s *Service
+ project string
+ region string
+ address string
+ regionaddressesmoverequest *RegionAddressesMoveRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Move: Moves the specified address resource.
+//
+// - address: Name of the address resource to move.
+// - project: Source project ID which the Address is moved from.
+// - region: Name of the region for this request.
+func (r *AddressesService) Move(project string, region string, address string, regionaddressesmoverequest *RegionAddressesMoveRequest) *AddressesMoveCall {
+ c := &AddressesMoveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.region = region
+ c.address = address
+ c.regionaddressesmoverequest = regionaddressesmoverequest
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *AddressesMoveCall) RequestId(requestId string) *AddressesMoveCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *AddressesMoveCall) Fields(s ...googleapi.Field) *AddressesMoveCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *AddressesMoveCall) Context(ctx context.Context) *AddressesMoveCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *AddressesMoveCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *AddressesMoveCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionaddressesmoverequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/addresses/{address}/move")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "region": c.region,
+ "address": c.address,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.addresses.move" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *AddressesMoveCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type AddressesSetLabelsCall struct {
+ s *Service
+ project string
+ region string
+ resource string
+ regionsetlabelsrequest *RegionSetLabelsRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// SetLabels: Sets the labels on an Address. To learn more about labels, read
+// the Labeling Resources documentation.
+//
+// - project: Project ID for this request.
+// - region: The region for this request.
+// - resource: Name or id of the resource for this request.
+func (r *AddressesService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *AddressesSetLabelsCall {
+ c := &AddressesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.region = region
+ c.resource = resource
+ c.regionsetlabelsrequest = regionsetlabelsrequest
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *AddressesSetLabelsCall) RequestId(requestId string) *AddressesSetLabelsCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *AddressesSetLabelsCall) Fields(s ...googleapi.Field) *AddressesSetLabelsCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *AddressesSetLabelsCall) Context(ctx context.Context) *AddressesSetLabelsCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *AddressesSetLabelsCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *AddressesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/addresses/{resource}/setLabels")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "region": c.region,
+ "resource": c.resource,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.addresses.setLabels" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *AddressesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type AutoscalersAggregatedListCall struct {
+ s *Service
+ project string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// AggregatedList: Retrieves an aggregated list of autoscalers. To prevent
+// failure, Google recommends that you set the `returnPartialSuccess` parameter
+// to `true`.
+//
+// - project: Project ID for this request.
+func (r *AutoscalersService) AggregatedList(project string) *AutoscalersAggregatedListCall {
+ c := &AutoscalersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ return c
+}
+
+// Filter sets the optional parameter "filter": A filter expression that
+// filters resources listed in the response. Most Compute resources support two
+// types of filter expressions: expressions that support regular expressions
+// and expressions that follow API improvement proposal AIP-160. These two
+// types of filter expressions cannot be mixed in one request. If you want to
+// use AIP-160, your expression must specify the field name, an operator, and
+// the value that you want to use for filtering. The value must be a string, a
+// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
+// `>=` or `:`. For example, if you are filtering Compute Engine instances, you
+// can exclude instances named `example-instance` by specifying `name !=
+// example-instance`. The `:*` comparison can be used to test whether a key has
+// been defined. For example, to find all objects with `owner` label use: ```
+// labels.owner:* ``` You can also filter nested fields. For example, you could
+// specify `scheduling.automaticRestart = false` to include instances only if
+// they are not scheduled for automatic restarts. You can use filtering on
+// nested fields to filter based on resource labels. To filter on multiple
+// expressions, provide each separate expression within parentheses. For
+// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel
+// Skylake") ``` By default, each expression is an `AND` expression. However,
+// you can include `AND` and `OR` expressions explicitly. For example: ```
+// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND
+// (scheduling.automaticRestart = true) ``` If you want to use a regular
+// expression, use the `eq` (equal) or `ne` (not equal) operator against a
+// single un-parenthesized expression with or without quotes or against
+// multiple parenthesized expressions. Examples: `fieldname eq unquoted
+// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted
+// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal
+// value is interpreted as a regular expression using Google RE2 library
+// syntax. The literal value must match the entire field. For example, to
+// filter for instances that do not end with name "instance", you would use
+// `name ne .*instance`. You cannot combine constraints on multiple fields
+// using regular expressions.
+func (c *AutoscalersAggregatedListCall) Filter(filter string) *AutoscalersAggregatedListCall {
+ c.urlParams_.Set("filter", filter)
+ return c
+}
+
+// IncludeAllScopes sets the optional parameter "includeAllScopes": Indicates
+// whether every visible scope for each scope type (zone, region, global)
+// should be included in the response. For new resource types added after this
+// field, the flag has no effect as new resource types will always include
+// every visible scope for each scope type in response. For resource types
+// which predate this field, if this flag is omitted or false, only scopes of
+// the scope types where the resource type is expected to be found will be
+// included.
+func (c *AutoscalersAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *AutoscalersAggregatedListCall {
+ c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
+ return c
+}
+
+// MaxResults sets the optional parameter "maxResults": The maximum number of
+// results per page that should be returned. If the number of available results
+// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that
+// can be used to get the next page of results in subsequent list requests.
+// Acceptable values are `0` to `500`, inclusive. (Default: `500`)
+func (c *AutoscalersAggregatedListCall) MaxResults(maxResults int64) *AutoscalersAggregatedListCall {
+ c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
+ return c
+}
+
+// OrderBy sets the optional parameter "orderBy": Sorts list results by a
+// certain order. By default, results are returned in alphanumerical order
+// based on the resource name. You can also sort results in descending order
+// based on the creation timestamp using `orderBy="creationTimestamp desc".
+// This sorts results based on the `creationTimestamp` field in reverse
+// chronological order (newest result first). Use this to sort resources like
+// operations so that the newest operation is returned first. Currently, only
+// sorting by `name` or `creationTimestamp desc` is supported.
+func (c *AutoscalersAggregatedListCall) OrderBy(orderBy string) *AutoscalersAggregatedListCall {
+ c.urlParams_.Set("orderBy", orderBy)
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": Specifies a page token to
+// use. Set `pageToken` to the `nextPageToken` returned by a previous list
+// request to get the next page of results.
+func (c *AutoscalersAggregatedListCall) PageToken(pageToken string) *AutoscalersAggregatedListCall {
+ c.urlParams_.Set("pageToken", pageToken)
+ return c
+}
+
+// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
+// Opt-in for partial success behavior which provides partial results in case
+// of failure. The default value is false. For example, when partial success
+// behavior is enabled, aggregatedList for a single zone scope either returns
+// all resources in the zone or no resources, with an error code.
+func (c *AutoscalersAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *AutoscalersAggregatedListCall {
+ c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
+ return c
+}
+
+// ServiceProjectNumber sets the optional parameter "serviceProjectNumber": The
+// Shared VPC service project id or service project number for which aggregated
+// list request is invoked for subnetworks list-usable api.
+func (c *AutoscalersAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *AutoscalersAggregatedListCall {
+ c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *AutoscalersAggregatedListCall) Fields(s ...googleapi.Field) *AutoscalersAggregatedListCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *AutoscalersAggregatedListCall) IfNoneMatch(entityTag string) *AutoscalersAggregatedListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *AutoscalersAggregatedListCall) Context(ctx context.Context) *AutoscalersAggregatedListCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *AutoscalersAggregatedListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *AutoscalersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/aggregated/autoscalers")
+ 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{
+ "project": c.project,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.autoscalers.aggregatedList" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *AutoscalerAggregatedList.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 *AutoscalersAggregatedListCall) Do(opts ...googleapi.CallOption) (*AutoscalerAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &AutoscalerAggregatedList{
+ 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
+}
+
+// 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 *AutoscalersAggregatedListCall) Pages(ctx context.Context, f func(*AutoscalerAggregatedList) error) error {
+ c.ctx_ = ctx
+ defer c.PageToken(c.urlParams_.Get("pageToken"))
+ 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)
+ }
+}
+
+type AutoscalersDeleteCall struct {
+ s *Service
+ project string
+ zone string
+ autoscaler string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Delete: Deletes the specified autoscaler.
+//
+// - autoscaler: Name of the autoscaler to delete.
+// - project: Project ID for this request.
+// - zone: Name of the zone for this request.
+func (r *AutoscalersService) Delete(project string, zone string, autoscaler string) *AutoscalersDeleteCall {
+ c := &AutoscalersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.zone = zone
+ c.autoscaler = autoscaler
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *AutoscalersDeleteCall) RequestId(requestId string) *AutoscalersDeleteCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *AutoscalersDeleteCall) Fields(s ...googleapi.Field) *AutoscalersDeleteCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *AutoscalersDeleteCall) Context(ctx context.Context) *AutoscalersDeleteCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *AutoscalersDeleteCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *AutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/autoscalers/{autoscaler}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("DELETE", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "zone": c.zone,
+ "autoscaler": c.autoscaler,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.autoscalers.delete" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *AutoscalersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type AutoscalersGetCall struct {
+ s *Service
+ project string
+ zone string
+ autoscaler string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Get: Returns the specified autoscaler resource.
+//
+// - autoscaler: Name of the autoscaler to return.
+// - project: Project ID for this request.
+// - zone: Name of the zone for this request.
+func (r *AutoscalersService) Get(project string, zone string, autoscaler string) *AutoscalersGetCall {
+ c := &AutoscalersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.zone = zone
+ c.autoscaler = autoscaler
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *AutoscalersGetCall) Fields(s ...googleapi.Field) *AutoscalersGetCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *AutoscalersGetCall) IfNoneMatch(entityTag string) *AutoscalersGetCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *AutoscalersGetCall) Context(ctx context.Context) *AutoscalersGetCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *AutoscalersGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *AutoscalersGetCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/zones/{zone}/autoscalers/{autoscaler}")
+ 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{
+ "project": c.project,
+ "zone": c.zone,
+ "autoscaler": c.autoscaler,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.autoscalers.get" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Autoscaler.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 *AutoscalersGetCall) Do(opts ...googleapi.CallOption) (*Autoscaler, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Autoscaler{
+ 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
+}
+
+type AutoscalersInsertCall struct {
+ s *Service
+ project string
+ zone string
+ autoscaler *Autoscaler
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Insert: Creates an autoscaler in the specified project using the data
+// included in the request.
+//
+// - project: Project ID for this request.
+// - zone: Name of the zone for this request.
+func (r *AutoscalersService) Insert(project string, zone string, autoscaler *Autoscaler) *AutoscalersInsertCall {
+ c := &AutoscalersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.zone = zone
+ c.autoscaler = autoscaler
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *AutoscalersInsertCall) RequestId(requestId string) *AutoscalersInsertCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *AutoscalersInsertCall) Fields(s ...googleapi.Field) *AutoscalersInsertCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *AutoscalersInsertCall) Context(ctx context.Context) *AutoscalersInsertCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *AutoscalersInsertCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *AutoscalersInsertCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/autoscalers")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "zone": c.zone,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.autoscalers.insert" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *AutoscalersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type AutoscalersListCall struct {
+ s *Service
+ project string
+ zone string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// List: Retrieves a list of autoscalers contained within the specified zone.
+//
+// - project: Project ID for this request.
+// - zone: Name of the zone for this request.
+func (r *AutoscalersService) List(project string, zone string) *AutoscalersListCall {
+ c := &AutoscalersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.zone = zone
+ return c
+}
+
+// Filter sets the optional parameter "filter": A filter expression that
+// filters resources listed in the response. Most Compute resources support two
+// types of filter expressions: expressions that support regular expressions
+// and expressions that follow API improvement proposal AIP-160. These two
+// types of filter expressions cannot be mixed in one request. If you want to
+// use AIP-160, your expression must specify the field name, an operator, and
+// the value that you want to use for filtering. The value must be a string, a
+// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
+// `>=` or `:`. For example, if you are filtering Compute Engine instances, you
+// can exclude instances named `example-instance` by specifying `name !=
+// example-instance`. The `:*` comparison can be used to test whether a key has
+// been defined. For example, to find all objects with `owner` label use: ```
+// labels.owner:* ``` You can also filter nested fields. For example, you could
+// specify `scheduling.automaticRestart = false` to include instances only if
+// they are not scheduled for automatic restarts. You can use filtering on
+// nested fields to filter based on resource labels. To filter on multiple
+// expressions, provide each separate expression within parentheses. For
+// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel
+// Skylake") ``` By default, each expression is an `AND` expression. However,
+// you can include `AND` and `OR` expressions explicitly. For example: ```
+// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND
+// (scheduling.automaticRestart = true) ``` If you want to use a regular
+// expression, use the `eq` (equal) or `ne` (not equal) operator against a
+// single un-parenthesized expression with or without quotes or against
+// multiple parenthesized expressions. Examples: `fieldname eq unquoted
+// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted
+// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal
+// value is interpreted as a regular expression using Google RE2 library
+// syntax. The literal value must match the entire field. For example, to
+// filter for instances that do not end with name "instance", you would use
+// `name ne .*instance`. You cannot combine constraints on multiple fields
+// using regular expressions.
+func (c *AutoscalersListCall) Filter(filter string) *AutoscalersListCall {
+ c.urlParams_.Set("filter", filter)
+ return c
+}
+
+// MaxResults sets the optional parameter "maxResults": The maximum number of
+// results per page that should be returned. If the number of available results
+// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that
+// can be used to get the next page of results in subsequent list requests.
+// Acceptable values are `0` to `500`, inclusive. (Default: `500`)
+func (c *AutoscalersListCall) MaxResults(maxResults int64) *AutoscalersListCall {
+ c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
+ return c
+}
+
+// OrderBy sets the optional parameter "orderBy": Sorts list results by a
+// certain order. By default, results are returned in alphanumerical order
+// based on the resource name. You can also sort results in descending order
+// based on the creation timestamp using `orderBy="creationTimestamp desc".
+// This sorts results based on the `creationTimestamp` field in reverse
+// chronological order (newest result first). Use this to sort resources like
+// operations so that the newest operation is returned first. Currently, only
+// sorting by `name` or `creationTimestamp desc` is supported.
+func (c *AutoscalersListCall) OrderBy(orderBy string) *AutoscalersListCall {
+ c.urlParams_.Set("orderBy", orderBy)
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": Specifies a page token to
+// use. Set `pageToken` to the `nextPageToken` returned by a previous list
+// request to get the next page of results.
+func (c *AutoscalersListCall) PageToken(pageToken string) *AutoscalersListCall {
+ c.urlParams_.Set("pageToken", pageToken)
+ return c
+}
+
+// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
+// Opt-in for partial success behavior which provides partial results in case
+// of failure. The default value is false. For example, when partial success
+// behavior is enabled, aggregatedList for a single zone scope either returns
+// all resources in the zone or no resources, with an error code.
+func (c *AutoscalersListCall) ReturnPartialSuccess(returnPartialSuccess bool) *AutoscalersListCall {
+ c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *AutoscalersListCall) Fields(s ...googleapi.Field) *AutoscalersListCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *AutoscalersListCall) IfNoneMatch(entityTag string) *AutoscalersListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *AutoscalersListCall) Context(ctx context.Context) *AutoscalersListCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *AutoscalersListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *AutoscalersListCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/zones/{zone}/autoscalers")
+ 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{
+ "project": c.project,
+ "zone": c.zone,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.autoscalers.list" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *AutoscalerList.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 *AutoscalersListCall) Do(opts ...googleapi.CallOption) (*AutoscalerList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &AutoscalerList{
+ 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
+}
+
+// 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 *AutoscalersListCall) Pages(ctx context.Context, f func(*AutoscalerList) error) error {
+ c.ctx_ = ctx
+ defer c.PageToken(c.urlParams_.Get("pageToken"))
+ 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)
+ }
+}
+
+type AutoscalersPatchCall struct {
+ s *Service
+ project string
+ zone string
+ autoscaler *Autoscaler
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Patch: Updates an autoscaler in the specified project using the data
+// included in the request. This method supports PATCH semantics and uses the
+// JSON merge patch format and processing rules.
+//
+// - project: Project ID for this request.
+// - zone: Name of the zone for this request.
+func (r *AutoscalersService) Patch(project string, zone string, autoscaler *Autoscaler) *AutoscalersPatchCall {
+ c := &AutoscalersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.zone = zone
+ c.autoscaler = autoscaler
+ return c
+}
+
+// Autoscaler sets the optional parameter "autoscaler": Name of the autoscaler
+// to patch.
+func (c *AutoscalersPatchCall) Autoscaler(autoscaler string) *AutoscalersPatchCall {
+ c.urlParams_.Set("autoscaler", autoscaler)
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *AutoscalersPatchCall) RequestId(requestId string) *AutoscalersPatchCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *AutoscalersPatchCall) Fields(s ...googleapi.Field) *AutoscalersPatchCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *AutoscalersPatchCall) Context(ctx context.Context) *AutoscalersPatchCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *AutoscalersPatchCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *AutoscalersPatchCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/autoscalers")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("PATCH", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "zone": c.zone,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.autoscalers.patch" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *AutoscalersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type AutoscalersUpdateCall struct {
+ s *Service
+ project string
+ zone string
+ autoscaler *Autoscaler
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Update: Updates an autoscaler in the specified project using the data
+// included in the request.
+//
+// - project: Project ID for this request.
+// - zone: Name of the zone for this request.
+func (r *AutoscalersService) Update(project string, zone string, autoscaler *Autoscaler) *AutoscalersUpdateCall {
+ c := &AutoscalersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.zone = zone
+ c.autoscaler = autoscaler
+ return c
+}
+
+// Autoscaler sets the optional parameter "autoscaler": Name of the autoscaler
+// to update.
+func (c *AutoscalersUpdateCall) Autoscaler(autoscaler string) *AutoscalersUpdateCall {
+ c.urlParams_.Set("autoscaler", autoscaler)
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *AutoscalersUpdateCall) RequestId(requestId string) *AutoscalersUpdateCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *AutoscalersUpdateCall) Fields(s ...googleapi.Field) *AutoscalersUpdateCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *AutoscalersUpdateCall) Context(ctx context.Context) *AutoscalersUpdateCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *AutoscalersUpdateCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *AutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/autoscalers")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("PUT", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "zone": c.zone,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.autoscalers.update" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *AutoscalersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type BackendBucketsAddSignedUrlKeyCall struct {
+ s *Service
+ project string
+ backendBucket string
+ signedurlkey *SignedUrlKey
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// AddSignedUrlKey: Adds a key for validating requests with signed URLs for
+// this backend bucket.
+//
+// - backendBucket: Name of the BackendBucket resource to which the Signed URL
+// Key should be added. The name should conform to RFC1035.
+// - project: Project ID for this request.
+func (r *BackendBucketsService) AddSignedUrlKey(project string, backendBucket string, signedurlkey *SignedUrlKey) *BackendBucketsAddSignedUrlKeyCall {
+ c := &BackendBucketsAddSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.backendBucket = backendBucket
+ c.signedurlkey = signedurlkey
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *BackendBucketsAddSignedUrlKeyCall) RequestId(requestId string) *BackendBucketsAddSignedUrlKeyCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *BackendBucketsAddSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendBucketsAddSignedUrlKeyCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *BackendBucketsAddSignedUrlKeyCall) Context(ctx context.Context) *BackendBucketsAddSignedUrlKeyCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *BackendBucketsAddSignedUrlKeyCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *BackendBucketsAddSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.signedurlkey)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendBuckets/{backendBucket}/addSignedUrlKey")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "backendBucket": c.backendBucket,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.backendBuckets.addSignedUrlKey" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *BackendBucketsAddSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type BackendBucketsDeleteCall struct {
+ s *Service
+ project string
+ backendBucket string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Delete: Deletes the specified BackendBucket resource.
+//
+// - backendBucket: Name of the BackendBucket resource to delete.
+// - project: Project ID for this request.
+func (r *BackendBucketsService) Delete(project string, backendBucket string) *BackendBucketsDeleteCall {
+ c := &BackendBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.backendBucket = backendBucket
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *BackendBucketsDeleteCall) RequestId(requestId string) *BackendBucketsDeleteCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *BackendBucketsDeleteCall) Fields(s ...googleapi.Field) *BackendBucketsDeleteCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *BackendBucketsDeleteCall) Context(ctx context.Context) *BackendBucketsDeleteCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *BackendBucketsDeleteCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *BackendBucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendBuckets/{backendBucket}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("DELETE", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "backendBucket": c.backendBucket,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.backendBuckets.delete" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *BackendBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type BackendBucketsDeleteSignedUrlKeyCall struct {
+ s *Service
+ project string
+ backendBucket string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// DeleteSignedUrlKey: Deletes a key for validating requests with signed URLs
+// for this backend bucket.
+//
+// - backendBucket: Name of the BackendBucket resource to which the Signed URL
+// Key should be added. The name should conform to RFC1035.
+// - keyName: The name of the Signed URL Key to delete.
+// - project: Project ID for this request.
+func (r *BackendBucketsService) DeleteSignedUrlKey(project string, backendBucket string, keyName string) *BackendBucketsDeleteSignedUrlKeyCall {
+ c := &BackendBucketsDeleteSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.backendBucket = backendBucket
+ c.urlParams_.Set("keyName", keyName)
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *BackendBucketsDeleteSignedUrlKeyCall) RequestId(requestId string) *BackendBucketsDeleteSignedUrlKeyCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *BackendBucketsDeleteSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendBucketsDeleteSignedUrlKeyCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *BackendBucketsDeleteSignedUrlKeyCall) Context(ctx context.Context) *BackendBucketsDeleteSignedUrlKeyCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *BackendBucketsDeleteSignedUrlKeyCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *BackendBucketsDeleteSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendBuckets/{backendBucket}/deleteSignedUrlKey")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "backendBucket": c.backendBucket,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.backendBuckets.deleteSignedUrlKey" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *BackendBucketsDeleteSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type BackendBucketsGetCall struct {
+ s *Service
+ project string
+ backendBucket string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Get: Returns the specified BackendBucket resource.
+//
+// - backendBucket: Name of the BackendBucket resource to return.
+// - project: Project ID for this request.
+func (r *BackendBucketsService) Get(project string, backendBucket string) *BackendBucketsGetCall {
+ c := &BackendBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.backendBucket = backendBucket
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *BackendBucketsGetCall) Fields(s ...googleapi.Field) *BackendBucketsGetCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *BackendBucketsGetCall) IfNoneMatch(entityTag string) *BackendBucketsGetCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *BackendBucketsGetCall) Context(ctx context.Context) *BackendBucketsGetCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *BackendBucketsGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *BackendBucketsGetCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/global/backendBuckets/{backendBucket}")
+ 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{
+ "project": c.project,
+ "backendBucket": c.backendBucket,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.backendBuckets.get" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *BackendBucket.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 *BackendBucketsGetCall) Do(opts ...googleapi.CallOption) (*BackendBucket, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &BackendBucket{
+ 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
+}
+
+type BackendBucketsGetIamPolicyCall struct {
+ s *Service
+ project string
+ resource string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// GetIamPolicy: Gets the access control policy for a resource. May be empty if
+// no such policy or resource exists.
+//
+// - project: Project ID for this request.
+// - resource: Name or id of the resource for this request.
+func (r *BackendBucketsService) GetIamPolicy(project string, resource string) *BackendBucketsGetIamPolicyCall {
+ c := &BackendBucketsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.resource = resource
+ return c
+}
+
+// OptionsRequestedPolicyVersion sets the optional parameter
+// "optionsRequestedPolicyVersion": Requested IAM Policy version.
+func (c *BackendBucketsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *BackendBucketsGetIamPolicyCall {
+ c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *BackendBucketsGetIamPolicyCall) Fields(s ...googleapi.Field) *BackendBucketsGetIamPolicyCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *BackendBucketsGetIamPolicyCall) IfNoneMatch(entityTag string) *BackendBucketsGetIamPolicyCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *BackendBucketsGetIamPolicyCall) Context(ctx context.Context) *BackendBucketsGetIamPolicyCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *BackendBucketsGetIamPolicyCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *BackendBucketsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/global/backendBuckets/{resource}/getIamPolicy")
+ 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{
+ "project": c.project,
+ "resource": c.resource,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.backendBuckets.getIamPolicy" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Policy.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 *BackendBucketsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Policy{
+ 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
+}
+
+type BackendBucketsInsertCall struct {
+ s *Service
+ project string
+ backendbucket *BackendBucket
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Insert: Creates a BackendBucket resource in the specified project using the
+// data included in the request.
+//
+// - project: Project ID for this request.
+func (r *BackendBucketsService) Insert(project string, backendbucket *BackendBucket) *BackendBucketsInsertCall {
+ c := &BackendBucketsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.backendbucket = backendbucket
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *BackendBucketsInsertCall) RequestId(requestId string) *BackendBucketsInsertCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *BackendBucketsInsertCall) Fields(s ...googleapi.Field) *BackendBucketsInsertCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *BackendBucketsInsertCall) Context(ctx context.Context) *BackendBucketsInsertCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *BackendBucketsInsertCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *BackendBucketsInsertCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendBuckets")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.backendBuckets.insert" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *BackendBucketsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type BackendBucketsListCall struct {
+ s *Service
+ project string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// List: Retrieves the list of BackendBucket resources available to the
+// specified project.
+//
+// - project: Project ID for this request.
+func (r *BackendBucketsService) List(project string) *BackendBucketsListCall {
+ c := &BackendBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ return c
+}
+
+// Filter sets the optional parameter "filter": A filter expression that
+// filters resources listed in the response. Most Compute resources support two
+// types of filter expressions: expressions that support regular expressions
+// and expressions that follow API improvement proposal AIP-160. These two
+// types of filter expressions cannot be mixed in one request. If you want to
+// use AIP-160, your expression must specify the field name, an operator, and
+// the value that you want to use for filtering. The value must be a string, a
+// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
+// `>=` or `:`. For example, if you are filtering Compute Engine instances, you
+// can exclude instances named `example-instance` by specifying `name !=
+// example-instance`. The `:*` comparison can be used to test whether a key has
+// been defined. For example, to find all objects with `owner` label use: ```
+// labels.owner:* ``` You can also filter nested fields. For example, you could
+// specify `scheduling.automaticRestart = false` to include instances only if
+// they are not scheduled for automatic restarts. You can use filtering on
+// nested fields to filter based on resource labels. To filter on multiple
+// expressions, provide each separate expression within parentheses. For
+// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel
+// Skylake") ``` By default, each expression is an `AND` expression. However,
+// you can include `AND` and `OR` expressions explicitly. For example: ```
+// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND
+// (scheduling.automaticRestart = true) ``` If you want to use a regular
+// expression, use the `eq` (equal) or `ne` (not equal) operator against a
+// single un-parenthesized expression with or without quotes or against
+// multiple parenthesized expressions. Examples: `fieldname eq unquoted
+// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted
+// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal
+// value is interpreted as a regular expression using Google RE2 library
+// syntax. The literal value must match the entire field. For example, to
+// filter for instances that do not end with name "instance", you would use
+// `name ne .*instance`. You cannot combine constraints on multiple fields
+// using regular expressions.
+func (c *BackendBucketsListCall) Filter(filter string) *BackendBucketsListCall {
+ c.urlParams_.Set("filter", filter)
+ return c
+}
+
+// MaxResults sets the optional parameter "maxResults": The maximum number of
+// results per page that should be returned. If the number of available results
+// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that
+// can be used to get the next page of results in subsequent list requests.
+// Acceptable values are `0` to `500`, inclusive. (Default: `500`)
+func (c *BackendBucketsListCall) MaxResults(maxResults int64) *BackendBucketsListCall {
+ c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
+ return c
+}
+
+// OrderBy sets the optional parameter "orderBy": Sorts list results by a
+// certain order. By default, results are returned in alphanumerical order
+// based on the resource name. You can also sort results in descending order
+// based on the creation timestamp using `orderBy="creationTimestamp desc".
+// This sorts results based on the `creationTimestamp` field in reverse
+// chronological order (newest result first). Use this to sort resources like
+// operations so that the newest operation is returned first. Currently, only
+// sorting by `name` or `creationTimestamp desc` is supported.
+func (c *BackendBucketsListCall) OrderBy(orderBy string) *BackendBucketsListCall {
+ c.urlParams_.Set("orderBy", orderBy)
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": Specifies a page token to
+// use. Set `pageToken` to the `nextPageToken` returned by a previous list
+// request to get the next page of results.
+func (c *BackendBucketsListCall) PageToken(pageToken string) *BackendBucketsListCall {
+ c.urlParams_.Set("pageToken", pageToken)
+ return c
+}
+
+// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
+// Opt-in for partial success behavior which provides partial results in case
+// of failure. The default value is false. For example, when partial success
+// behavior is enabled, aggregatedList for a single zone scope either returns
+// all resources in the zone or no resources, with an error code.
+func (c *BackendBucketsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *BackendBucketsListCall {
+ c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *BackendBucketsListCall) Fields(s ...googleapi.Field) *BackendBucketsListCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *BackendBucketsListCall) IfNoneMatch(entityTag string) *BackendBucketsListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *BackendBucketsListCall) Context(ctx context.Context) *BackendBucketsListCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *BackendBucketsListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *BackendBucketsListCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/global/backendBuckets")
+ 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{
+ "project": c.project,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.backendBuckets.list" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *BackendBucketList.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 *BackendBucketsListCall) Do(opts ...googleapi.CallOption) (*BackendBucketList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &BackendBucketList{
+ 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
+}
+
+// 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 *BackendBucketsListCall) Pages(ctx context.Context, f func(*BackendBucketList) error) error {
+ c.ctx_ = ctx
+ defer c.PageToken(c.urlParams_.Get("pageToken"))
+ 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)
+ }
+}
+
+type BackendBucketsPatchCall struct {
+ s *Service
+ project string
+ backendBucket string
+ backendbucket *BackendBucket
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Patch: Updates the specified BackendBucket resource with the data included
+// in the request. This method supports PATCH semantics and uses the JSON merge
+// patch format and processing rules.
+//
+// - backendBucket: Name of the BackendBucket resource to patch.
+// - project: Project ID for this request.
+func (r *BackendBucketsService) Patch(project string, backendBucket string, backendbucket *BackendBucket) *BackendBucketsPatchCall {
+ c := &BackendBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.backendBucket = backendBucket
+ c.backendbucket = backendbucket
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *BackendBucketsPatchCall) RequestId(requestId string) *BackendBucketsPatchCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *BackendBucketsPatchCall) Fields(s ...googleapi.Field) *BackendBucketsPatchCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *BackendBucketsPatchCall) Context(ctx context.Context) *BackendBucketsPatchCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *BackendBucketsPatchCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *BackendBucketsPatchCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendBuckets/{backendBucket}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("PATCH", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "backendBucket": c.backendBucket,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.backendBuckets.patch" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *BackendBucketsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type BackendBucketsSetEdgeSecurityPolicyCall struct {
+ s *Service
+ project string
+ backendBucket string
+ securitypolicyreference *SecurityPolicyReference
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// SetEdgeSecurityPolicy: Sets the edge security policy for the specified
+// backend bucket.
+//
+// - backendBucket: Name of the BackendBucket resource to which the security
+// policy should be set. The name should conform to RFC1035.
+// - project: Project ID for this request.
+func (r *BackendBucketsService) SetEdgeSecurityPolicy(project string, backendBucket string, securitypolicyreference *SecurityPolicyReference) *BackendBucketsSetEdgeSecurityPolicyCall {
+ c := &BackendBucketsSetEdgeSecurityPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.backendBucket = backendBucket
+ c.securitypolicyreference = securitypolicyreference
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *BackendBucketsSetEdgeSecurityPolicyCall) RequestId(requestId string) *BackendBucketsSetEdgeSecurityPolicyCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *BackendBucketsSetEdgeSecurityPolicyCall) Fields(s ...googleapi.Field) *BackendBucketsSetEdgeSecurityPolicyCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *BackendBucketsSetEdgeSecurityPolicyCall) Context(ctx context.Context) *BackendBucketsSetEdgeSecurityPolicyCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *BackendBucketsSetEdgeSecurityPolicyCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *BackendBucketsSetEdgeSecurityPolicyCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyreference)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendBuckets/{backendBucket}/setEdgeSecurityPolicy")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "backendBucket": c.backendBucket,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.backendBuckets.setEdgeSecurityPolicy" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *BackendBucketsSetEdgeSecurityPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type BackendBucketsSetIamPolicyCall struct {
+ s *Service
+ project string
+ resource string
+ globalsetpolicyrequest *GlobalSetPolicyRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// SetIamPolicy: Sets the access control policy on the specified resource.
+// Replaces any existing policy.
+//
+// - project: Project ID for this request.
+// - resource: Name or id of the resource for this request.
+func (r *BackendBucketsService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *BackendBucketsSetIamPolicyCall {
+ c := &BackendBucketsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.resource = resource
+ c.globalsetpolicyrequest = globalsetpolicyrequest
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *BackendBucketsSetIamPolicyCall) Fields(s ...googleapi.Field) *BackendBucketsSetIamPolicyCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *BackendBucketsSetIamPolicyCall) Context(ctx context.Context) *BackendBucketsSetIamPolicyCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *BackendBucketsSetIamPolicyCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *BackendBucketsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendBuckets/{resource}/setIamPolicy")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "resource": c.resource,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.backendBuckets.setIamPolicy" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Policy.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 *BackendBucketsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Policy{
+ 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
+}
+
+type BackendBucketsTestIamPermissionsCall struct {
+ s *Service
+ project string
+ resource string
+ testpermissionsrequest *TestPermissionsRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// TestIamPermissions: Returns permissions that a caller has on the specified
+// resource.
+//
+// - project: Project ID for this request.
+// - resource: Name or id of the resource for this request.
+func (r *BackendBucketsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *BackendBucketsTestIamPermissionsCall {
+ c := &BackendBucketsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.resource = resource
+ c.testpermissionsrequest = testpermissionsrequest
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *BackendBucketsTestIamPermissionsCall) Fields(s ...googleapi.Field) *BackendBucketsTestIamPermissionsCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *BackendBucketsTestIamPermissionsCall) Context(ctx context.Context) *BackendBucketsTestIamPermissionsCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *BackendBucketsTestIamPermissionsCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *BackendBucketsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendBuckets/{resource}/testIamPermissions")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "resource": c.resource,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.backendBuckets.testIamPermissions" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *TestPermissionsResponse.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 *BackendBucketsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &TestPermissionsResponse{
+ 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
+}
+
+type BackendBucketsUpdateCall struct {
+ s *Service
+ project string
+ backendBucket string
+ backendbucket *BackendBucket
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Update: Updates the specified BackendBucket resource with the data included
+// in the request.
+//
+// - backendBucket: Name of the BackendBucket resource to update.
+// - project: Project ID for this request.
+func (r *BackendBucketsService) Update(project string, backendBucket string, backendbucket *BackendBucket) *BackendBucketsUpdateCall {
+ c := &BackendBucketsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.backendBucket = backendBucket
+ c.backendbucket = backendbucket
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *BackendBucketsUpdateCall) RequestId(requestId string) *BackendBucketsUpdateCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *BackendBucketsUpdateCall) Fields(s ...googleapi.Field) *BackendBucketsUpdateCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *BackendBucketsUpdateCall) Context(ctx context.Context) *BackendBucketsUpdateCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *BackendBucketsUpdateCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *BackendBucketsUpdateCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendBuckets/{backendBucket}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("PUT", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "backendBucket": c.backendBucket,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.backendBuckets.update" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *BackendBucketsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type BackendServicesAddSignedUrlKeyCall struct {
+ s *Service
+ project string
+ backendService string
+ signedurlkey *SignedUrlKey
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// AddSignedUrlKey: Adds a key for validating requests with signed URLs for
+// this backend service.
+//
+// - backendService: Name of the BackendService resource to which the Signed
+// URL Key should be added. The name should conform to RFC1035.
+// - project: Project ID for this request.
+func (r *BackendServicesService) AddSignedUrlKey(project string, backendService string, signedurlkey *SignedUrlKey) *BackendServicesAddSignedUrlKeyCall {
+ c := &BackendServicesAddSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.backendService = backendService
+ c.signedurlkey = signedurlkey
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *BackendServicesAddSignedUrlKeyCall) RequestId(requestId string) *BackendServicesAddSignedUrlKeyCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *BackendServicesAddSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendServicesAddSignedUrlKeyCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *BackendServicesAddSignedUrlKeyCall) Context(ctx context.Context) *BackendServicesAddSignedUrlKeyCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *BackendServicesAddSignedUrlKeyCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *BackendServicesAddSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.signedurlkey)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices/{backendService}/addSignedUrlKey")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "backendService": c.backendService,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.backendServices.addSignedUrlKey" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *BackendServicesAddSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type BackendServicesAggregatedListCall struct {
+ s *Service
+ project string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// AggregatedList: Retrieves the list of all BackendService resources, regional
+// and global, available to the specified project. To prevent failure, Google
+// recommends that you set the `returnPartialSuccess` parameter to `true`.
+//
+// - project: Name of the project scoping this request.
+func (r *BackendServicesService) AggregatedList(project string) *BackendServicesAggregatedListCall {
+ c := &BackendServicesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ return c
+}
+
+// Filter sets the optional parameter "filter": A filter expression that
+// filters resources listed in the response. Most Compute resources support two
+// types of filter expressions: expressions that support regular expressions
+// and expressions that follow API improvement proposal AIP-160. These two
+// types of filter expressions cannot be mixed in one request. If you want to
+// use AIP-160, your expression must specify the field name, an operator, and
+// the value that you want to use for filtering. The value must be a string, a
+// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
+// `>=` or `:`. For example, if you are filtering Compute Engine instances, you
+// can exclude instances named `example-instance` by specifying `name !=
+// example-instance`. The `:*` comparison can be used to test whether a key has
+// been defined. For example, to find all objects with `owner` label use: ```
+// labels.owner:* ``` You can also filter nested fields. For example, you could
+// specify `scheduling.automaticRestart = false` to include instances only if
+// they are not scheduled for automatic restarts. You can use filtering on
+// nested fields to filter based on resource labels. To filter on multiple
+// expressions, provide each separate expression within parentheses. For
+// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel
+// Skylake") ``` By default, each expression is an `AND` expression. However,
+// you can include `AND` and `OR` expressions explicitly. For example: ```
+// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND
+// (scheduling.automaticRestart = true) ``` If you want to use a regular
+// expression, use the `eq` (equal) or `ne` (not equal) operator against a
+// single un-parenthesized expression with or without quotes or against
+// multiple parenthesized expressions. Examples: `fieldname eq unquoted
+// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted
+// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal
+// value is interpreted as a regular expression using Google RE2 library
+// syntax. The literal value must match the entire field. For example, to
+// filter for instances that do not end with name "instance", you would use
+// `name ne .*instance`. You cannot combine constraints on multiple fields
+// using regular expressions.
+func (c *BackendServicesAggregatedListCall) Filter(filter string) *BackendServicesAggregatedListCall {
+ c.urlParams_.Set("filter", filter)
+ return c
+}
+
+// IncludeAllScopes sets the optional parameter "includeAllScopes": Indicates
+// whether every visible scope for each scope type (zone, region, global)
+// should be included in the response. For new resource types added after this
+// field, the flag has no effect as new resource types will always include
+// every visible scope for each scope type in response. For resource types
+// which predate this field, if this flag is omitted or false, only scopes of
+// the scope types where the resource type is expected to be found will be
+// included.
+func (c *BackendServicesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *BackendServicesAggregatedListCall {
+ c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
+ return c
+}
+
+// MaxResults sets the optional parameter "maxResults": The maximum number of
+// results per page that should be returned. If the number of available results
+// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that
+// can be used to get the next page of results in subsequent list requests.
+// Acceptable values are `0` to `500`, inclusive. (Default: `500`)
+func (c *BackendServicesAggregatedListCall) MaxResults(maxResults int64) *BackendServicesAggregatedListCall {
+ c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
+ return c
+}
+
+// OrderBy sets the optional parameter "orderBy": Sorts list results by a
+// certain order. By default, results are returned in alphanumerical order
+// based on the resource name. You can also sort results in descending order
+// based on the creation timestamp using `orderBy="creationTimestamp desc".
+// This sorts results based on the `creationTimestamp` field in reverse
+// chronological order (newest result first). Use this to sort resources like
+// operations so that the newest operation is returned first. Currently, only
+// sorting by `name` or `creationTimestamp desc` is supported.
+func (c *BackendServicesAggregatedListCall) OrderBy(orderBy string) *BackendServicesAggregatedListCall {
+ c.urlParams_.Set("orderBy", orderBy)
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": Specifies a page token to
+// use. Set `pageToken` to the `nextPageToken` returned by a previous list
+// request to get the next page of results.
+func (c *BackendServicesAggregatedListCall) PageToken(pageToken string) *BackendServicesAggregatedListCall {
+ c.urlParams_.Set("pageToken", pageToken)
+ return c
+}
+
+// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
+// Opt-in for partial success behavior which provides partial results in case
+// of failure. The default value is false. For example, when partial success
+// behavior is enabled, aggregatedList for a single zone scope either returns
+// all resources in the zone or no resources, with an error code.
+func (c *BackendServicesAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *BackendServicesAggregatedListCall {
+ c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
+ return c
+}
+
+// ServiceProjectNumber sets the optional parameter "serviceProjectNumber": The
+// Shared VPC service project id or service project number for which aggregated
+// list request is invoked for subnetworks list-usable api.
+func (c *BackendServicesAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *BackendServicesAggregatedListCall {
+ c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *BackendServicesAggregatedListCall) Fields(s ...googleapi.Field) *BackendServicesAggregatedListCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *BackendServicesAggregatedListCall) IfNoneMatch(entityTag string) *BackendServicesAggregatedListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *BackendServicesAggregatedListCall) Context(ctx context.Context) *BackendServicesAggregatedListCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *BackendServicesAggregatedListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *BackendServicesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/aggregated/backendServices")
+ 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{
+ "project": c.project,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.backendServices.aggregatedList" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *BackendServiceAggregatedList.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 *BackendServicesAggregatedListCall) Do(opts ...googleapi.CallOption) (*BackendServiceAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &BackendServiceAggregatedList{
+ 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
+}
+
+// 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 *BackendServicesAggregatedListCall) Pages(ctx context.Context, f func(*BackendServiceAggregatedList) error) error {
+ c.ctx_ = ctx
+ defer c.PageToken(c.urlParams_.Get("pageToken"))
+ 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)
+ }
+}
+
+type BackendServicesDeleteCall struct {
+ s *Service
+ project string
+ backendService string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Delete: Deletes the specified BackendService resource.
+//
+// - backendService: Name of the BackendService resource to delete.
+// - project: Project ID for this request.
+func (r *BackendServicesService) Delete(project string, backendService string) *BackendServicesDeleteCall {
+ c := &BackendServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.backendService = backendService
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *BackendServicesDeleteCall) RequestId(requestId string) *BackendServicesDeleteCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *BackendServicesDeleteCall) Fields(s ...googleapi.Field) *BackendServicesDeleteCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *BackendServicesDeleteCall) Context(ctx context.Context) *BackendServicesDeleteCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *BackendServicesDeleteCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *BackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices/{backendService}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("DELETE", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "backendService": c.backendService,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.backendServices.delete" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *BackendServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type BackendServicesDeleteSignedUrlKeyCall struct {
+ s *Service
+ project string
+ backendService string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// DeleteSignedUrlKey: Deletes a key for validating requests with signed URLs
+// for this backend service.
+//
+// - backendService: Name of the BackendService resource to which the Signed
+// URL Key should be added. The name should conform to RFC1035.
+// - keyName: The name of the Signed URL Key to delete.
+// - project: Project ID for this request.
+func (r *BackendServicesService) DeleteSignedUrlKey(project string, backendService string, keyName string) *BackendServicesDeleteSignedUrlKeyCall {
+ c := &BackendServicesDeleteSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.backendService = backendService
+ c.urlParams_.Set("keyName", keyName)
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *BackendServicesDeleteSignedUrlKeyCall) RequestId(requestId string) *BackendServicesDeleteSignedUrlKeyCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *BackendServicesDeleteSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendServicesDeleteSignedUrlKeyCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *BackendServicesDeleteSignedUrlKeyCall) Context(ctx context.Context) *BackendServicesDeleteSignedUrlKeyCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *BackendServicesDeleteSignedUrlKeyCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *BackendServicesDeleteSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices/{backendService}/deleteSignedUrlKey")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "backendService": c.backendService,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.backendServices.deleteSignedUrlKey" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *BackendServicesDeleteSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type BackendServicesGetCall struct {
+ s *Service
+ project string
+ backendService string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Get: Returns the specified BackendService resource.
+//
+// - backendService: Name of the BackendService resource to return.
+// - project: Project ID for this request.
+func (r *BackendServicesService) Get(project string, backendService string) *BackendServicesGetCall {
+ c := &BackendServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.backendService = backendService
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *BackendServicesGetCall) Fields(s ...googleapi.Field) *BackendServicesGetCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *BackendServicesGetCall) IfNoneMatch(entityTag string) *BackendServicesGetCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *BackendServicesGetCall) Context(ctx context.Context) *BackendServicesGetCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *BackendServicesGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *BackendServicesGetCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/global/backendServices/{backendService}")
+ 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{
+ "project": c.project,
+ "backendService": c.backendService,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.backendServices.get" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *BackendService.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 *BackendServicesGetCall) Do(opts ...googleapi.CallOption) (*BackendService, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &BackendService{
+ 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
+}
+
+type BackendServicesGetHealthCall struct {
+ s *Service
+ project string
+ backendService string
+ resourcegroupreference *ResourceGroupReference
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// GetHealth: Gets the most recent health check results for this
+// BackendService. Example request body: { "group":
+// "/zones/us-east1-b/instanceGroups/lb-backend-example" }
+//
+// - backendService: Name of the BackendService resource to which the queried
+// instance belongs.
+// - project: .
+func (r *BackendServicesService) GetHealth(project string, backendService string, resourcegroupreference *ResourceGroupReference) *BackendServicesGetHealthCall {
+ c := &BackendServicesGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.backendService = backendService
+ c.resourcegroupreference = resourcegroupreference
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *BackendServicesGetHealthCall) Fields(s ...googleapi.Field) *BackendServicesGetHealthCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *BackendServicesGetHealthCall) Context(ctx context.Context) *BackendServicesGetHealthCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *BackendServicesGetHealthCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *BackendServicesGetHealthCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices/{backendService}/getHealth")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "backendService": c.backendService,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.backendServices.getHealth" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *BackendServiceGroupHealth.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 *BackendServicesGetHealthCall) Do(opts ...googleapi.CallOption) (*BackendServiceGroupHealth, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &BackendServiceGroupHealth{
+ 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
+}
+
+type BackendServicesGetIamPolicyCall struct {
+ s *Service
+ project string
+ resource string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// GetIamPolicy: Gets the access control policy for a resource. May be empty if
+// no such policy or resource exists.
+//
+// - project: Project ID for this request.
+// - resource: Name or id of the resource for this request.
+func (r *BackendServicesService) GetIamPolicy(project string, resource string) *BackendServicesGetIamPolicyCall {
+ c := &BackendServicesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.resource = resource
+ return c
+}
+
+// OptionsRequestedPolicyVersion sets the optional parameter
+// "optionsRequestedPolicyVersion": Requested IAM Policy version.
+func (c *BackendServicesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *BackendServicesGetIamPolicyCall {
+ c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *BackendServicesGetIamPolicyCall) Fields(s ...googleapi.Field) *BackendServicesGetIamPolicyCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *BackendServicesGetIamPolicyCall) IfNoneMatch(entityTag string) *BackendServicesGetIamPolicyCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *BackendServicesGetIamPolicyCall) Context(ctx context.Context) *BackendServicesGetIamPolicyCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *BackendServicesGetIamPolicyCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *BackendServicesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/global/backendServices/{resource}/getIamPolicy")
+ 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{
+ "project": c.project,
+ "resource": c.resource,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.backendServices.getIamPolicy" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Policy.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 *BackendServicesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Policy{
+ 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
+}
+
+type BackendServicesInsertCall struct {
+ s *Service
+ project string
+ backendservice *BackendService
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Insert: Creates a BackendService resource in the specified project using the
+// data included in the request. For more information, see Backend services
+// overview .
+//
+// - project: Project ID for this request.
+func (r *BackendServicesService) Insert(project string, backendservice *BackendService) *BackendServicesInsertCall {
+ c := &BackendServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.backendservice = backendservice
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *BackendServicesInsertCall) RequestId(requestId string) *BackendServicesInsertCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *BackendServicesInsertCall) Fields(s ...googleapi.Field) *BackendServicesInsertCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *BackendServicesInsertCall) Context(ctx context.Context) *BackendServicesInsertCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *BackendServicesInsertCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *BackendServicesInsertCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.backendServices.insert" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *BackendServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type BackendServicesListCall struct {
+ s *Service
+ project string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// List: Retrieves the list of BackendService resources available to the
+// specified project.
+//
+// - project: Project ID for this request.
+func (r *BackendServicesService) List(project string) *BackendServicesListCall {
+ c := &BackendServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ return c
+}
+
+// Filter sets the optional parameter "filter": A filter expression that
+// filters resources listed in the response. Most Compute resources support two
+// types of filter expressions: expressions that support regular expressions
+// and expressions that follow API improvement proposal AIP-160. These two
+// types of filter expressions cannot be mixed in one request. If you want to
+// use AIP-160, your expression must specify the field name, an operator, and
+// the value that you want to use for filtering. The value must be a string, a
+// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
+// `>=` or `:`. For example, if you are filtering Compute Engine instances, you
+// can exclude instances named `example-instance` by specifying `name !=
+// example-instance`. The `:*` comparison can be used to test whether a key has
+// been defined. For example, to find all objects with `owner` label use: ```
+// labels.owner:* ``` You can also filter nested fields. For example, you could
+// specify `scheduling.automaticRestart = false` to include instances only if
+// they are not scheduled for automatic restarts. You can use filtering on
+// nested fields to filter based on resource labels. To filter on multiple
+// expressions, provide each separate expression within parentheses. For
+// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel
+// Skylake") ``` By default, each expression is an `AND` expression. However,
+// you can include `AND` and `OR` expressions explicitly. For example: ```
+// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND
+// (scheduling.automaticRestart = true) ``` If you want to use a regular
+// expression, use the `eq` (equal) or `ne` (not equal) operator against a
+// single un-parenthesized expression with or without quotes or against
+// multiple parenthesized expressions. Examples: `fieldname eq unquoted
+// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted
+// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal
+// value is interpreted as a regular expression using Google RE2 library
+// syntax. The literal value must match the entire field. For example, to
+// filter for instances that do not end with name "instance", you would use
+// `name ne .*instance`. You cannot combine constraints on multiple fields
+// using regular expressions.
+func (c *BackendServicesListCall) Filter(filter string) *BackendServicesListCall {
+ c.urlParams_.Set("filter", filter)
+ return c
+}
+
+// MaxResults sets the optional parameter "maxResults": The maximum number of
+// results per page that should be returned. If the number of available results
+// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that
+// can be used to get the next page of results in subsequent list requests.
+// Acceptable values are `0` to `500`, inclusive. (Default: `500`)
+func (c *BackendServicesListCall) MaxResults(maxResults int64) *BackendServicesListCall {
+ c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
+ return c
+}
+
+// OrderBy sets the optional parameter "orderBy": Sorts list results by a
+// certain order. By default, results are returned in alphanumerical order
+// based on the resource name. You can also sort results in descending order
+// based on the creation timestamp using `orderBy="creationTimestamp desc".
+// This sorts results based on the `creationTimestamp` field in reverse
+// chronological order (newest result first). Use this to sort resources like
+// operations so that the newest operation is returned first. Currently, only
+// sorting by `name` or `creationTimestamp desc` is supported.
+func (c *BackendServicesListCall) OrderBy(orderBy string) *BackendServicesListCall {
+ c.urlParams_.Set("orderBy", orderBy)
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": Specifies a page token to
+// use. Set `pageToken` to the `nextPageToken` returned by a previous list
+// request to get the next page of results.
+func (c *BackendServicesListCall) PageToken(pageToken string) *BackendServicesListCall {
+ c.urlParams_.Set("pageToken", pageToken)
+ return c
+}
+
+// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
+// Opt-in for partial success behavior which provides partial results in case
+// of failure. The default value is false. For example, when partial success
+// behavior is enabled, aggregatedList for a single zone scope either returns
+// all resources in the zone or no resources, with an error code.
+func (c *BackendServicesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *BackendServicesListCall {
+ c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *BackendServicesListCall) Fields(s ...googleapi.Field) *BackendServicesListCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *BackendServicesListCall) IfNoneMatch(entityTag string) *BackendServicesListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *BackendServicesListCall) Context(ctx context.Context) *BackendServicesListCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *BackendServicesListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *BackendServicesListCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/global/backendServices")
+ 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{
+ "project": c.project,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.backendServices.list" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *BackendServiceList.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 *BackendServicesListCall) Do(opts ...googleapi.CallOption) (*BackendServiceList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &BackendServiceList{
+ 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
+}
+
+// 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 *BackendServicesListCall) Pages(ctx context.Context, f func(*BackendServiceList) error) error {
+ c.ctx_ = ctx
+ defer c.PageToken(c.urlParams_.Get("pageToken"))
+ 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)
+ }
+}
+
+type BackendServicesListUsableCall struct {
+ s *Service
+ project string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// ListUsable: Retrieves a list of all usable backend services in the specified
+// project.
+//
+// - project: Project ID for this request.
+func (r *BackendServicesService) ListUsable(project string) *BackendServicesListUsableCall {
+ c := &BackendServicesListUsableCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ return c
+}
+
+// Filter sets the optional parameter "filter": A filter expression that
+// filters resources listed in the response. Most Compute resources support two
+// types of filter expressions: expressions that support regular expressions
+// and expressions that follow API improvement proposal AIP-160. These two
+// types of filter expressions cannot be mixed in one request. If you want to
+// use AIP-160, your expression must specify the field name, an operator, and
+// the value that you want to use for filtering. The value must be a string, a
+// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
+// `>=` or `:`. For example, if you are filtering Compute Engine instances, you
+// can exclude instances named `example-instance` by specifying `name !=
+// example-instance`. The `:*` comparison can be used to test whether a key has
+// been defined. For example, to find all objects with `owner` label use: ```
+// labels.owner:* ``` You can also filter nested fields. For example, you could
+// specify `scheduling.automaticRestart = false` to include instances only if
+// they are not scheduled for automatic restarts. You can use filtering on
+// nested fields to filter based on resource labels. To filter on multiple
+// expressions, provide each separate expression within parentheses. For
+// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel
+// Skylake") ``` By default, each expression is an `AND` expression. However,
+// you can include `AND` and `OR` expressions explicitly. For example: ```
+// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND
+// (scheduling.automaticRestart = true) ``` If you want to use a regular
+// expression, use the `eq` (equal) or `ne` (not equal) operator against a
+// single un-parenthesized expression with or without quotes or against
+// multiple parenthesized expressions. Examples: `fieldname eq unquoted
+// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted
+// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal
+// value is interpreted as a regular expression using Google RE2 library
+// syntax. The literal value must match the entire field. For example, to
+// filter for instances that do not end with name "instance", you would use
+// `name ne .*instance`. You cannot combine constraints on multiple fields
+// using regular expressions.
+func (c *BackendServicesListUsableCall) Filter(filter string) *BackendServicesListUsableCall {
+ c.urlParams_.Set("filter", filter)
+ return c
+}
+
+// MaxResults sets the optional parameter "maxResults": The maximum number of
+// results per page that should be returned. If the number of available results
+// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that
+// can be used to get the next page of results in subsequent list requests.
+// Acceptable values are `0` to `500`, inclusive. (Default: `500`)
+func (c *BackendServicesListUsableCall) MaxResults(maxResults int64) *BackendServicesListUsableCall {
+ c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
+ return c
+}
+
+// OrderBy sets the optional parameter "orderBy": Sorts list results by a
+// certain order. By default, results are returned in alphanumerical order
+// based on the resource name. You can also sort results in descending order
+// based on the creation timestamp using `orderBy="creationTimestamp desc".
+// This sorts results based on the `creationTimestamp` field in reverse
+// chronological order (newest result first). Use this to sort resources like
+// operations so that the newest operation is returned first. Currently, only
+// sorting by `name` or `creationTimestamp desc` is supported.
+func (c *BackendServicesListUsableCall) OrderBy(orderBy string) *BackendServicesListUsableCall {
+ c.urlParams_.Set("orderBy", orderBy)
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": Specifies a page token to
+// use. Set `pageToken` to the `nextPageToken` returned by a previous list
+// request to get the next page of results.
+func (c *BackendServicesListUsableCall) PageToken(pageToken string) *BackendServicesListUsableCall {
+ c.urlParams_.Set("pageToken", pageToken)
+ return c
+}
+
+// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
+// Opt-in for partial success behavior which provides partial results in case
+// of failure. The default value is false. For example, when partial success
+// behavior is enabled, aggregatedList for a single zone scope either returns
+// all resources in the zone or no resources, with an error code.
+func (c *BackendServicesListUsableCall) ReturnPartialSuccess(returnPartialSuccess bool) *BackendServicesListUsableCall {
+ c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *BackendServicesListUsableCall) Fields(s ...googleapi.Field) *BackendServicesListUsableCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *BackendServicesListUsableCall) IfNoneMatch(entityTag string) *BackendServicesListUsableCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *BackendServicesListUsableCall) Context(ctx context.Context) *BackendServicesListUsableCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *BackendServicesListUsableCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *BackendServicesListUsableCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/global/backendServices/listUsable")
+ 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{
+ "project": c.project,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.backendServices.listUsable" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *BackendServiceListUsable.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 *BackendServicesListUsableCall) Do(opts ...googleapi.CallOption) (*BackendServiceListUsable, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &BackendServiceListUsable{
+ 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
+}
+
+// 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 *BackendServicesListUsableCall) Pages(ctx context.Context, f func(*BackendServiceListUsable) error) error {
+ c.ctx_ = ctx
+ defer c.PageToken(c.urlParams_.Get("pageToken"))
+ 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)
+ }
+}
+
+type BackendServicesPatchCall struct {
+ s *Service
+ project string
+ backendService string
+ backendservice *BackendService
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Patch: Patches the specified BackendService resource with the data included
+// in the request. For more information, see Backend services overview. This
+// method supports PATCH semantics and uses the JSON merge patch format and
+// processing rules.
+//
+// - backendService: Name of the BackendService resource to patch.
+// - project: Project ID for this request.
+func (r *BackendServicesService) Patch(project string, backendService string, backendservice *BackendService) *BackendServicesPatchCall {
+ c := &BackendServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.backendService = backendService
+ c.backendservice = backendservice
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *BackendServicesPatchCall) RequestId(requestId string) *BackendServicesPatchCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *BackendServicesPatchCall) Fields(s ...googleapi.Field) *BackendServicesPatchCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *BackendServicesPatchCall) Context(ctx context.Context) *BackendServicesPatchCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *BackendServicesPatchCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *BackendServicesPatchCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices/{backendService}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("PATCH", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "backendService": c.backendService,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.backendServices.patch" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *BackendServicesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type BackendServicesSetEdgeSecurityPolicyCall struct {
+ s *Service
+ project string
+ backendService string
+ securitypolicyreference *SecurityPolicyReference
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// SetEdgeSecurityPolicy: Sets the edge security policy for the specified
+// backend service.
+//
+// - backendService: Name of the BackendService resource to which the edge
+// security policy should be set. The name should conform to RFC1035.
+// - project: Project ID for this request.
+func (r *BackendServicesService) SetEdgeSecurityPolicy(project string, backendService string, securitypolicyreference *SecurityPolicyReference) *BackendServicesSetEdgeSecurityPolicyCall {
+ c := &BackendServicesSetEdgeSecurityPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.backendService = backendService
+ c.securitypolicyreference = securitypolicyreference
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *BackendServicesSetEdgeSecurityPolicyCall) RequestId(requestId string) *BackendServicesSetEdgeSecurityPolicyCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *BackendServicesSetEdgeSecurityPolicyCall) Fields(s ...googleapi.Field) *BackendServicesSetEdgeSecurityPolicyCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *BackendServicesSetEdgeSecurityPolicyCall) Context(ctx context.Context) *BackendServicesSetEdgeSecurityPolicyCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *BackendServicesSetEdgeSecurityPolicyCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *BackendServicesSetEdgeSecurityPolicyCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyreference)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices/{backendService}/setEdgeSecurityPolicy")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "backendService": c.backendService,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.backendServices.setEdgeSecurityPolicy" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *BackendServicesSetEdgeSecurityPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type BackendServicesSetIamPolicyCall struct {
+ s *Service
+ project string
+ resource string
+ globalsetpolicyrequest *GlobalSetPolicyRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// SetIamPolicy: Sets the access control policy on the specified resource.
+// Replaces any existing policy.
+//
+// - project: Project ID for this request.
+// - resource: Name or id of the resource for this request.
+func (r *BackendServicesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *BackendServicesSetIamPolicyCall {
+ c := &BackendServicesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.resource = resource
+ c.globalsetpolicyrequest = globalsetpolicyrequest
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *BackendServicesSetIamPolicyCall) Fields(s ...googleapi.Field) *BackendServicesSetIamPolicyCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *BackendServicesSetIamPolicyCall) Context(ctx context.Context) *BackendServicesSetIamPolicyCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *BackendServicesSetIamPolicyCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *BackendServicesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices/{resource}/setIamPolicy")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "resource": c.resource,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.backendServices.setIamPolicy" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Policy.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 *BackendServicesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Policy{
+ 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
+}
+
+type BackendServicesSetSecurityPolicyCall struct {
+ s *Service
+ project string
+ backendService string
+ securitypolicyreference *SecurityPolicyReference
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// SetSecurityPolicy: Sets the Google Cloud Armor security policy for the
+// specified backend service. For more information, see Google Cloud Armor
+// Overview
+//
+// - backendService: Name of the BackendService resource to which the security
+// policy should be set. The name should conform to RFC1035.
+// - project: Project ID for this request.
+func (r *BackendServicesService) SetSecurityPolicy(project string, backendService string, securitypolicyreference *SecurityPolicyReference) *BackendServicesSetSecurityPolicyCall {
+ c := &BackendServicesSetSecurityPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.backendService = backendService
+ c.securitypolicyreference = securitypolicyreference
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *BackendServicesSetSecurityPolicyCall) RequestId(requestId string) *BackendServicesSetSecurityPolicyCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *BackendServicesSetSecurityPolicyCall) Fields(s ...googleapi.Field) *BackendServicesSetSecurityPolicyCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *BackendServicesSetSecurityPolicyCall) Context(ctx context.Context) *BackendServicesSetSecurityPolicyCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *BackendServicesSetSecurityPolicyCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *BackendServicesSetSecurityPolicyCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyreference)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices/{backendService}/setSecurityPolicy")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "backendService": c.backendService,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.backendServices.setSecurityPolicy" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *BackendServicesSetSecurityPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type BackendServicesTestIamPermissionsCall struct {
+ s *Service
+ project string
+ resource string
+ testpermissionsrequest *TestPermissionsRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// TestIamPermissions: Returns permissions that a caller has on the specified
+// resource.
+//
+// - project: Project ID for this request.
+// - resource: Name or id of the resource for this request.
+func (r *BackendServicesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *BackendServicesTestIamPermissionsCall {
+ c := &BackendServicesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.resource = resource
+ c.testpermissionsrequest = testpermissionsrequest
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *BackendServicesTestIamPermissionsCall) Fields(s ...googleapi.Field) *BackendServicesTestIamPermissionsCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *BackendServicesTestIamPermissionsCall) Context(ctx context.Context) *BackendServicesTestIamPermissionsCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *BackendServicesTestIamPermissionsCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *BackendServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices/{resource}/testIamPermissions")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "resource": c.resource,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.backendServices.testIamPermissions" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *TestPermissionsResponse.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 *BackendServicesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &TestPermissionsResponse{
+ 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
+}
+
+type BackendServicesUpdateCall struct {
+ s *Service
+ project string
+ backendService string
+ backendservice *BackendService
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Update: Updates the specified BackendService resource with the data included
+// in the request. For more information, see Backend services overview.
+//
+// - backendService: Name of the BackendService resource to update.
+// - project: Project ID for this request.
+func (r *BackendServicesService) Update(project string, backendService string, backendservice *BackendService) *BackendServicesUpdateCall {
+ c := &BackendServicesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.backendService = backendService
+ c.backendservice = backendservice
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *BackendServicesUpdateCall) RequestId(requestId string) *BackendServicesUpdateCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *BackendServicesUpdateCall) Fields(s ...googleapi.Field) *BackendServicesUpdateCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *BackendServicesUpdateCall) Context(ctx context.Context) *BackendServicesUpdateCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *BackendServicesUpdateCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *BackendServicesUpdateCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/backendServices/{backendService}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("PUT", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "backendService": c.backendService,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.backendServices.update" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *BackendServicesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type DiskTypesAggregatedListCall struct {
+ s *Service
+ project string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// AggregatedList: Retrieves an aggregated list of disk types. To prevent
+// failure, Google recommends that you set the `returnPartialSuccess` parameter
+// to `true`.
+//
+// - project: Project ID for this request.
+func (r *DiskTypesService) AggregatedList(project string) *DiskTypesAggregatedListCall {
+ c := &DiskTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ return c
+}
+
+// Filter sets the optional parameter "filter": A filter expression that
+// filters resources listed in the response. Most Compute resources support two
+// types of filter expressions: expressions that support regular expressions
+// and expressions that follow API improvement proposal AIP-160. These two
+// types of filter expressions cannot be mixed in one request. If you want to
+// use AIP-160, your expression must specify the field name, an operator, and
+// the value that you want to use for filtering. The value must be a string, a
+// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
+// `>=` or `:`. For example, if you are filtering Compute Engine instances, you
+// can exclude instances named `example-instance` by specifying `name !=
+// example-instance`. The `:*` comparison can be used to test whether a key has
+// been defined. For example, to find all objects with `owner` label use: ```
+// labels.owner:* ``` You can also filter nested fields. For example, you could
+// specify `scheduling.automaticRestart = false` to include instances only if
+// they are not scheduled for automatic restarts. You can use filtering on
+// nested fields to filter based on resource labels. To filter on multiple
+// expressions, provide each separate expression within parentheses. For
+// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel
+// Skylake") ``` By default, each expression is an `AND` expression. However,
+// you can include `AND` and `OR` expressions explicitly. For example: ```
+// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND
+// (scheduling.automaticRestart = true) ``` If you want to use a regular
+// expression, use the `eq` (equal) or `ne` (not equal) operator against a
+// single un-parenthesized expression with or without quotes or against
+// multiple parenthesized expressions. Examples: `fieldname eq unquoted
+// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted
+// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal
+// value is interpreted as a regular expression using Google RE2 library
+// syntax. The literal value must match the entire field. For example, to
+// filter for instances that do not end with name "instance", you would use
+// `name ne .*instance`. You cannot combine constraints on multiple fields
+// using regular expressions.
+func (c *DiskTypesAggregatedListCall) Filter(filter string) *DiskTypesAggregatedListCall {
+ c.urlParams_.Set("filter", filter)
+ return c
+}
+
+// IncludeAllScopes sets the optional parameter "includeAllScopes": Indicates
+// whether every visible scope for each scope type (zone, region, global)
+// should be included in the response. For new resource types added after this
+// field, the flag has no effect as new resource types will always include
+// every visible scope for each scope type in response. For resource types
+// which predate this field, if this flag is omitted or false, only scopes of
+// the scope types where the resource type is expected to be found will be
+// included.
+func (c *DiskTypesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *DiskTypesAggregatedListCall {
+ c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
+ return c
+}
+
+// MaxResults sets the optional parameter "maxResults": The maximum number of
+// results per page that should be returned. If the number of available results
+// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that
+// can be used to get the next page of results in subsequent list requests.
+// Acceptable values are `0` to `500`, inclusive. (Default: `500`)
+func (c *DiskTypesAggregatedListCall) MaxResults(maxResults int64) *DiskTypesAggregatedListCall {
+ c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
+ return c
+}
+
+// OrderBy sets the optional parameter "orderBy": Sorts list results by a
+// certain order. By default, results are returned in alphanumerical order
+// based on the resource name. You can also sort results in descending order
+// based on the creation timestamp using `orderBy="creationTimestamp desc".
+// This sorts results based on the `creationTimestamp` field in reverse
+// chronological order (newest result first). Use this to sort resources like
+// operations so that the newest operation is returned first. Currently, only
+// sorting by `name` or `creationTimestamp desc` is supported.
+func (c *DiskTypesAggregatedListCall) OrderBy(orderBy string) *DiskTypesAggregatedListCall {
+ c.urlParams_.Set("orderBy", orderBy)
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": Specifies a page token to
+// use. Set `pageToken` to the `nextPageToken` returned by a previous list
+// request to get the next page of results.
+func (c *DiskTypesAggregatedListCall) PageToken(pageToken string) *DiskTypesAggregatedListCall {
+ c.urlParams_.Set("pageToken", pageToken)
+ return c
+}
+
+// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
+// Opt-in for partial success behavior which provides partial results in case
+// of failure. The default value is false. For example, when partial success
+// behavior is enabled, aggregatedList for a single zone scope either returns
+// all resources in the zone or no resources, with an error code.
+func (c *DiskTypesAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *DiskTypesAggregatedListCall {
+ c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
+ return c
+}
+
+// ServiceProjectNumber sets the optional parameter "serviceProjectNumber": The
+// Shared VPC service project id or service project number for which aggregated
+// list request is invoked for subnetworks list-usable api.
+func (c *DiskTypesAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *DiskTypesAggregatedListCall {
+ c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *DiskTypesAggregatedListCall) Fields(s ...googleapi.Field) *DiskTypesAggregatedListCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *DiskTypesAggregatedListCall) IfNoneMatch(entityTag string) *DiskTypesAggregatedListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *DiskTypesAggregatedListCall) Context(ctx context.Context) *DiskTypesAggregatedListCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *DiskTypesAggregatedListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *DiskTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/aggregated/diskTypes")
+ 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{
+ "project": c.project,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.diskTypes.aggregatedList" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *DiskTypeAggregatedList.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 *DiskTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*DiskTypeAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &DiskTypeAggregatedList{
+ 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
+}
+
+// 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 *DiskTypesAggregatedListCall) Pages(ctx context.Context, f func(*DiskTypeAggregatedList) error) error {
+ c.ctx_ = ctx
+ defer c.PageToken(c.urlParams_.Get("pageToken"))
+ 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)
+ }
+}
+
+type DiskTypesGetCall struct {
+ s *Service
+ project string
+ zone string
+ diskType string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Get: Returns the specified disk type.
+//
+// - diskType: Name of the disk type to return.
+// - project: Project ID for this request.
+// - zone: The name of the zone for this request.
+func (r *DiskTypesService) Get(project string, zone string, diskType string) *DiskTypesGetCall {
+ c := &DiskTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.zone = zone
+ c.diskType = diskType
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *DiskTypesGetCall) Fields(s ...googleapi.Field) *DiskTypesGetCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *DiskTypesGetCall) IfNoneMatch(entityTag string) *DiskTypesGetCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *DiskTypesGetCall) Context(ctx context.Context) *DiskTypesGetCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *DiskTypesGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *DiskTypesGetCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/zones/{zone}/diskTypes/{diskType}")
+ 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{
+ "project": c.project,
+ "zone": c.zone,
+ "diskType": c.diskType,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.diskTypes.get" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *DiskType.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 *DiskTypesGetCall) Do(opts ...googleapi.CallOption) (*DiskType, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &DiskType{
+ 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
+}
+
+type DiskTypesListCall struct {
+ s *Service
+ project string
+ zone string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// List: Retrieves a list of disk types available to the specified project.
+//
+// - project: Project ID for this request.
+// - zone: The name of the zone for this request.
+func (r *DiskTypesService) List(project string, zone string) *DiskTypesListCall {
+ c := &DiskTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.zone = zone
+ return c
+}
+
+// Filter sets the optional parameter "filter": A filter expression that
+// filters resources listed in the response. Most Compute resources support two
+// types of filter expressions: expressions that support regular expressions
+// and expressions that follow API improvement proposal AIP-160. These two
+// types of filter expressions cannot be mixed in one request. If you want to
+// use AIP-160, your expression must specify the field name, an operator, and
+// the value that you want to use for filtering. The value must be a string, a
+// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
+// `>=` or `:`. For example, if you are filtering Compute Engine instances, you
+// can exclude instances named `example-instance` by specifying `name !=
+// example-instance`. The `:*` comparison can be used to test whether a key has
+// been defined. For example, to find all objects with `owner` label use: ```
+// labels.owner:* ``` You can also filter nested fields. For example, you could
+// specify `scheduling.automaticRestart = false` to include instances only if
+// they are not scheduled for automatic restarts. You can use filtering on
+// nested fields to filter based on resource labels. To filter on multiple
+// expressions, provide each separate expression within parentheses. For
+// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel
+// Skylake") ``` By default, each expression is an `AND` expression. However,
+// you can include `AND` and `OR` expressions explicitly. For example: ```
+// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND
+// (scheduling.automaticRestart = true) ``` If you want to use a regular
+// expression, use the `eq` (equal) or `ne` (not equal) operator against a
+// single un-parenthesized expression with or without quotes or against
+// multiple parenthesized expressions. Examples: `fieldname eq unquoted
+// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted
+// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal
+// value is interpreted as a regular expression using Google RE2 library
+// syntax. The literal value must match the entire field. For example, to
+// filter for instances that do not end with name "instance", you would use
+// `name ne .*instance`. You cannot combine constraints on multiple fields
+// using regular expressions.
+func (c *DiskTypesListCall) Filter(filter string) *DiskTypesListCall {
+ c.urlParams_.Set("filter", filter)
+ return c
+}
+
+// MaxResults sets the optional parameter "maxResults": The maximum number of
+// results per page that should be returned. If the number of available results
+// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that
+// can be used to get the next page of results in subsequent list requests.
+// Acceptable values are `0` to `500`, inclusive. (Default: `500`)
+func (c *DiskTypesListCall) MaxResults(maxResults int64) *DiskTypesListCall {
+ c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
+ return c
+}
+
+// OrderBy sets the optional parameter "orderBy": Sorts list results by a
+// certain order. By default, results are returned in alphanumerical order
+// based on the resource name. You can also sort results in descending order
+// based on the creation timestamp using `orderBy="creationTimestamp desc".
+// This sorts results based on the `creationTimestamp` field in reverse
+// chronological order (newest result first). Use this to sort resources like
+// operations so that the newest operation is returned first. Currently, only
+// sorting by `name` or `creationTimestamp desc` is supported.
+func (c *DiskTypesListCall) OrderBy(orderBy string) *DiskTypesListCall {
+ c.urlParams_.Set("orderBy", orderBy)
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": Specifies a page token to
+// use. Set `pageToken` to the `nextPageToken` returned by a previous list
+// request to get the next page of results.
+func (c *DiskTypesListCall) PageToken(pageToken string) *DiskTypesListCall {
+ c.urlParams_.Set("pageToken", pageToken)
+ return c
+}
+
+// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
+// Opt-in for partial success behavior which provides partial results in case
+// of failure. The default value is false. For example, when partial success
+// behavior is enabled, aggregatedList for a single zone scope either returns
+// all resources in the zone or no resources, with an error code.
+func (c *DiskTypesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *DiskTypesListCall {
+ c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *DiskTypesListCall) Fields(s ...googleapi.Field) *DiskTypesListCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *DiskTypesListCall) IfNoneMatch(entityTag string) *DiskTypesListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *DiskTypesListCall) Context(ctx context.Context) *DiskTypesListCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *DiskTypesListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *DiskTypesListCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/zones/{zone}/diskTypes")
+ 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{
+ "project": c.project,
+ "zone": c.zone,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.diskTypes.list" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *DiskTypeList.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 *DiskTypesListCall) Do(opts ...googleapi.CallOption) (*DiskTypeList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &DiskTypeList{
+ 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
+}
+
+// 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 *DiskTypesListCall) Pages(ctx context.Context, f func(*DiskTypeList) error) error {
+ c.ctx_ = ctx
+ defer c.PageToken(c.urlParams_.Get("pageToken"))
+ 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)
+ }
+}
+
+type DisksAddResourcePoliciesCall struct {
+ s *Service
+ project string
+ zone string
+ disk string
+ disksaddresourcepoliciesrequest *DisksAddResourcePoliciesRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// AddResourcePolicies: Adds existing resource policies to a disk. You can only
+// add one policy which will be applied to this disk for scheduling snapshot
+// creation.
+//
+// - disk: The disk name for this request.
+// - project: Project ID for this request.
+// - zone: The name of the zone for this request.
+func (r *DisksService) AddResourcePolicies(project string, zone string, disk string, disksaddresourcepoliciesrequest *DisksAddResourcePoliciesRequest) *DisksAddResourcePoliciesCall {
+ c := &DisksAddResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.zone = zone
+ c.disk = disk
+ c.disksaddresourcepoliciesrequest = disksaddresourcepoliciesrequest
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *DisksAddResourcePoliciesCall) RequestId(requestId string) *DisksAddResourcePoliciesCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *DisksAddResourcePoliciesCall) Fields(s ...googleapi.Field) *DisksAddResourcePoliciesCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *DisksAddResourcePoliciesCall) Context(ctx context.Context) *DisksAddResourcePoliciesCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *DisksAddResourcePoliciesCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *DisksAddResourcePoliciesCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksaddresourcepoliciesrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks/{disk}/addResourcePolicies")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "zone": c.zone,
+ "disk": c.disk,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.disks.addResourcePolicies" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *DisksAddResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type DisksAggregatedListCall struct {
+ s *Service
+ project string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// AggregatedList: Retrieves an aggregated list of persistent disks. To prevent
+// failure, Google recommends that you set the `returnPartialSuccess` parameter
+// to `true`.
+//
+// - project: Project ID for this request.
+func (r *DisksService) AggregatedList(project string) *DisksAggregatedListCall {
+ c := &DisksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ return c
+}
+
+// Filter sets the optional parameter "filter": A filter expression that
+// filters resources listed in the response. Most Compute resources support two
+// types of filter expressions: expressions that support regular expressions
+// and expressions that follow API improvement proposal AIP-160. These two
+// types of filter expressions cannot be mixed in one request. If you want to
+// use AIP-160, your expression must specify the field name, an operator, and
+// the value that you want to use for filtering. The value must be a string, a
+// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
+// `>=` or `:`. For example, if you are filtering Compute Engine instances, you
+// can exclude instances named `example-instance` by specifying `name !=
+// example-instance`. The `:*` comparison can be used to test whether a key has
+// been defined. For example, to find all objects with `owner` label use: ```
+// labels.owner:* ``` You can also filter nested fields. For example, you could
+// specify `scheduling.automaticRestart = false` to include instances only if
+// they are not scheduled for automatic restarts. You can use filtering on
+// nested fields to filter based on resource labels. To filter on multiple
+// expressions, provide each separate expression within parentheses. For
+// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel
+// Skylake") ``` By default, each expression is an `AND` expression. However,
+// you can include `AND` and `OR` expressions explicitly. For example: ```
+// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND
+// (scheduling.automaticRestart = true) ``` If you want to use a regular
+// expression, use the `eq` (equal) or `ne` (not equal) operator against a
+// single un-parenthesized expression with or without quotes or against
+// multiple parenthesized expressions. Examples: `fieldname eq unquoted
+// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted
+// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal
+// value is interpreted as a regular expression using Google RE2 library
+// syntax. The literal value must match the entire field. For example, to
+// filter for instances that do not end with name "instance", you would use
+// `name ne .*instance`. You cannot combine constraints on multiple fields
+// using regular expressions.
+func (c *DisksAggregatedListCall) Filter(filter string) *DisksAggregatedListCall {
+ c.urlParams_.Set("filter", filter)
+ return c
+}
+
+// IncludeAllScopes sets the optional parameter "includeAllScopes": Indicates
+// whether every visible scope for each scope type (zone, region, global)
+// should be included in the response. For new resource types added after this
+// field, the flag has no effect as new resource types will always include
+// every visible scope for each scope type in response. For resource types
+// which predate this field, if this flag is omitted or false, only scopes of
+// the scope types where the resource type is expected to be found will be
+// included.
+func (c *DisksAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *DisksAggregatedListCall {
+ c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
+ return c
+}
+
+// MaxResults sets the optional parameter "maxResults": The maximum number of
+// results per page that should be returned. If the number of available results
+// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that
+// can be used to get the next page of results in subsequent list requests.
+// Acceptable values are `0` to `500`, inclusive. (Default: `500`)
+func (c *DisksAggregatedListCall) MaxResults(maxResults int64) *DisksAggregatedListCall {
+ c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
+ return c
+}
+
+// OrderBy sets the optional parameter "orderBy": Sorts list results by a
+// certain order. By default, results are returned in alphanumerical order
+// based on the resource name. You can also sort results in descending order
+// based on the creation timestamp using `orderBy="creationTimestamp desc".
+// This sorts results based on the `creationTimestamp` field in reverse
+// chronological order (newest result first). Use this to sort resources like
+// operations so that the newest operation is returned first. Currently, only
+// sorting by `name` or `creationTimestamp desc` is supported.
+func (c *DisksAggregatedListCall) OrderBy(orderBy string) *DisksAggregatedListCall {
+ c.urlParams_.Set("orderBy", orderBy)
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": Specifies a page token to
+// use. Set `pageToken` to the `nextPageToken` returned by a previous list
+// request to get the next page of results.
+func (c *DisksAggregatedListCall) PageToken(pageToken string) *DisksAggregatedListCall {
+ c.urlParams_.Set("pageToken", pageToken)
+ return c
+}
+
+// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
+// Opt-in for partial success behavior which provides partial results in case
+// of failure. The default value is false. For example, when partial success
+// behavior is enabled, aggregatedList for a single zone scope either returns
+// all resources in the zone or no resources, with an error code.
+func (c *DisksAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *DisksAggregatedListCall {
+ c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
+ return c
+}
+
+// ServiceProjectNumber sets the optional parameter "serviceProjectNumber": The
+// Shared VPC service project id or service project number for which aggregated
+// list request is invoked for subnetworks list-usable api.
+func (c *DisksAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *DisksAggregatedListCall {
+ c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *DisksAggregatedListCall) Fields(s ...googleapi.Field) *DisksAggregatedListCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *DisksAggregatedListCall) IfNoneMatch(entityTag string) *DisksAggregatedListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *DisksAggregatedListCall) Context(ctx context.Context) *DisksAggregatedListCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *DisksAggregatedListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *DisksAggregatedListCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/aggregated/disks")
+ 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{
+ "project": c.project,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.disks.aggregatedList" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *DiskAggregatedList.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 *DisksAggregatedListCall) Do(opts ...googleapi.CallOption) (*DiskAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &DiskAggregatedList{
+ 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
+}
+
+// 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 *DisksAggregatedListCall) Pages(ctx context.Context, f func(*DiskAggregatedList) error) error {
+ c.ctx_ = ctx
+ defer c.PageToken(c.urlParams_.Get("pageToken"))
+ 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)
+ }
+}
+
+type DisksBulkInsertCall struct {
+ s *Service
+ project string
+ zone string
+ bulkinsertdiskresource *BulkInsertDiskResource
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// BulkInsert: Bulk create a set of disks.
+//
+// - project: Project ID for this request.
+// - zone: The name of the zone for this request.
+func (r *DisksService) BulkInsert(project string, zone string, bulkinsertdiskresource *BulkInsertDiskResource) *DisksBulkInsertCall {
+ c := &DisksBulkInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.zone = zone
+ c.bulkinsertdiskresource = bulkinsertdiskresource
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *DisksBulkInsertCall) RequestId(requestId string) *DisksBulkInsertCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *DisksBulkInsertCall) Fields(s ...googleapi.Field) *DisksBulkInsertCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *DisksBulkInsertCall) Context(ctx context.Context) *DisksBulkInsertCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *DisksBulkInsertCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *DisksBulkInsertCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkinsertdiskresource)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks/bulkInsert")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "zone": c.zone,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.disks.bulkInsert" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *DisksBulkInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type DisksCreateSnapshotCall struct {
+ s *Service
+ project string
+ zone string
+ disk string
+ snapshot *Snapshot
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// CreateSnapshot: Creates a snapshot of a specified persistent disk. For
+// regular snapshot creation, consider using snapshots.insert instead, as that
+// method supports more features, such as creating snapshots in a project
+// different from the source disk project.
+//
+// - disk: Name of the persistent disk to snapshot.
+// - project: Project ID for this request.
+// - zone: The name of the zone for this request.
+func (r *DisksService) CreateSnapshot(project string, zone string, disk string, snapshot *Snapshot) *DisksCreateSnapshotCall {
+ c := &DisksCreateSnapshotCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.zone = zone
+ c.disk = disk
+ c.snapshot = snapshot
+ return c
+}
+
+// GuestFlush sets the optional parameter "guestFlush": [Input Only] Whether to
+// attempt an application consistent snapshot by informing the OS to prepare
+// for the snapshot process.
+func (c *DisksCreateSnapshotCall) GuestFlush(guestFlush bool) *DisksCreateSnapshotCall {
+ c.urlParams_.Set("guestFlush", fmt.Sprint(guestFlush))
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *DisksCreateSnapshotCall) RequestId(requestId string) *DisksCreateSnapshotCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *DisksCreateSnapshotCall) Fields(s ...googleapi.Field) *DisksCreateSnapshotCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *DisksCreateSnapshotCall) Context(ctx context.Context) *DisksCreateSnapshotCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *DisksCreateSnapshotCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *DisksCreateSnapshotCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks/{disk}/createSnapshot")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "zone": c.zone,
+ "disk": c.disk,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.disks.createSnapshot" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *DisksCreateSnapshotCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type DisksDeleteCall struct {
+ s *Service
+ project string
+ zone string
+ disk string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Delete: Deletes the specified persistent disk. Deleting a disk removes its
+// data permanently and is irreversible. However, deleting a disk does not
+// delete any snapshots previously made from the disk. You must separately
+// delete snapshots.
+//
+// - disk: Name of the persistent disk to delete.
+// - project: Project ID for this request.
+// - zone: The name of the zone for this request.
+func (r *DisksService) Delete(project string, zone string, disk string) *DisksDeleteCall {
+ c := &DisksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.zone = zone
+ c.disk = disk
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *DisksDeleteCall) RequestId(requestId string) *DisksDeleteCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *DisksDeleteCall) Fields(s ...googleapi.Field) *DisksDeleteCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *DisksDeleteCall) Context(ctx context.Context) *DisksDeleteCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *DisksDeleteCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *DisksDeleteCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks/{disk}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("DELETE", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "zone": c.zone,
+ "disk": c.disk,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.disks.delete" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *DisksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type DisksGetCall struct {
+ s *Service
+ project string
+ zone string
+ disk string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Get: Returns the specified persistent disk.
+//
+// - disk: Name of the persistent disk to return.
+// - project: Project ID for this request.
+// - zone: The name of the zone for this request.
+func (r *DisksService) Get(project string, zone string, disk string) *DisksGetCall {
+ c := &DisksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.zone = zone
+ c.disk = disk
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *DisksGetCall) Fields(s ...googleapi.Field) *DisksGetCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *DisksGetCall) IfNoneMatch(entityTag string) *DisksGetCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *DisksGetCall) Context(ctx context.Context) *DisksGetCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *DisksGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *DisksGetCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/zones/{zone}/disks/{disk}")
+ 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{
+ "project": c.project,
+ "zone": c.zone,
+ "disk": c.disk,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.disks.get" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Disk.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 *DisksGetCall) Do(opts ...googleapi.CallOption) (*Disk, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Disk{
+ 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
+}
+
+type DisksGetIamPolicyCall struct {
+ s *Service
+ project string
+ zone string
+ resource string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// GetIamPolicy: Gets the access control policy for a resource. May be empty if
+// no such policy or resource exists.
+//
+// - project: Project ID for this request.
+// - resource: Name or id of the resource for this request.
+// - zone: The name of the zone for this request.
+func (r *DisksService) GetIamPolicy(project string, zone string, resource string) *DisksGetIamPolicyCall {
+ c := &DisksGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.zone = zone
+ c.resource = resource
+ return c
+}
+
+// OptionsRequestedPolicyVersion sets the optional parameter
+// "optionsRequestedPolicyVersion": Requested IAM Policy version.
+func (c *DisksGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *DisksGetIamPolicyCall {
+ c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *DisksGetIamPolicyCall) Fields(s ...googleapi.Field) *DisksGetIamPolicyCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *DisksGetIamPolicyCall) IfNoneMatch(entityTag string) *DisksGetIamPolicyCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *DisksGetIamPolicyCall) Context(ctx context.Context) *DisksGetIamPolicyCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *DisksGetIamPolicyCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *DisksGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/zones/{zone}/disks/{resource}/getIamPolicy")
+ 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{
+ "project": c.project,
+ "zone": c.zone,
+ "resource": c.resource,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.disks.getIamPolicy" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Policy.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 *DisksGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Policy{
+ 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
+}
+
+type DisksInsertCall struct {
+ s *Service
+ project string
+ zone string
+ disk *Disk
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Insert: Creates a persistent disk in the specified project using the data in
+// the request. You can create a disk from a source (sourceImage,
+// sourceSnapshot, or sourceDisk) or create an empty 500 GB data disk by
+// omitting all properties. You can also create a disk that is larger than the
+// default size by specifying the sizeGb property.
+//
+// - project: Project ID for this request.
+// - zone: The name of the zone for this request.
+func (r *DisksService) Insert(project string, zone string, disk *Disk) *DisksInsertCall {
+ c := &DisksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.zone = zone
+ c.disk = disk
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *DisksInsertCall) RequestId(requestId string) *DisksInsertCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// SourceImage sets the optional parameter "sourceImage": Source image to
+// restore onto a disk. This field is optional.
+func (c *DisksInsertCall) SourceImage(sourceImage string) *DisksInsertCall {
+ c.urlParams_.Set("sourceImage", sourceImage)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *DisksInsertCall) Fields(s ...googleapi.Field) *DisksInsertCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *DisksInsertCall) Context(ctx context.Context) *DisksInsertCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *DisksInsertCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *DisksInsertCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "zone": c.zone,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.disks.insert" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *DisksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type DisksListCall struct {
+ s *Service
+ project string
+ zone string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// List: Retrieves a list of persistent disks contained within the specified
+// zone.
+//
+// - project: Project ID for this request.
+// - zone: The name of the zone for this request.
+func (r *DisksService) List(project string, zone string) *DisksListCall {
+ c := &DisksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.zone = zone
+ return c
+}
+
+// Filter sets the optional parameter "filter": A filter expression that
+// filters resources listed in the response. Most Compute resources support two
+// types of filter expressions: expressions that support regular expressions
+// and expressions that follow API improvement proposal AIP-160. These two
+// types of filter expressions cannot be mixed in one request. If you want to
+// use AIP-160, your expression must specify the field name, an operator, and
+// the value that you want to use for filtering. The value must be a string, a
+// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
+// `>=` or `:`. For example, if you are filtering Compute Engine instances, you
+// can exclude instances named `example-instance` by specifying `name !=
+// example-instance`. The `:*` comparison can be used to test whether a key has
+// been defined. For example, to find all objects with `owner` label use: ```
+// labels.owner:* ``` You can also filter nested fields. For example, you could
+// specify `scheduling.automaticRestart = false` to include instances only if
+// they are not scheduled for automatic restarts. You can use filtering on
+// nested fields to filter based on resource labels. To filter on multiple
+// expressions, provide each separate expression within parentheses. For
+// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel
+// Skylake") ``` By default, each expression is an `AND` expression. However,
+// you can include `AND` and `OR` expressions explicitly. For example: ```
+// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND
+// (scheduling.automaticRestart = true) ``` If you want to use a regular
+// expression, use the `eq` (equal) or `ne` (not equal) operator against a
+// single un-parenthesized expression with or without quotes or against
+// multiple parenthesized expressions. Examples: `fieldname eq unquoted
+// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted
+// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal
+// value is interpreted as a regular expression using Google RE2 library
+// syntax. The literal value must match the entire field. For example, to
+// filter for instances that do not end with name "instance", you would use
+// `name ne .*instance`. You cannot combine constraints on multiple fields
+// using regular expressions.
+func (c *DisksListCall) Filter(filter string) *DisksListCall {
+ c.urlParams_.Set("filter", filter)
+ return c
+}
+
+// MaxResults sets the optional parameter "maxResults": The maximum number of
+// results per page that should be returned. If the number of available results
+// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that
+// can be used to get the next page of results in subsequent list requests.
+// Acceptable values are `0` to `500`, inclusive. (Default: `500`)
+func (c *DisksListCall) MaxResults(maxResults int64) *DisksListCall {
+ c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
+ return c
+}
+
+// OrderBy sets the optional parameter "orderBy": Sorts list results by a
+// certain order. By default, results are returned in alphanumerical order
+// based on the resource name. You can also sort results in descending order
+// based on the creation timestamp using `orderBy="creationTimestamp desc".
+// This sorts results based on the `creationTimestamp` field in reverse
+// chronological order (newest result first). Use this to sort resources like
+// operations so that the newest operation is returned first. Currently, only
+// sorting by `name` or `creationTimestamp desc` is supported.
+func (c *DisksListCall) OrderBy(orderBy string) *DisksListCall {
+ c.urlParams_.Set("orderBy", orderBy)
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": Specifies a page token to
+// use. Set `pageToken` to the `nextPageToken` returned by a previous list
+// request to get the next page of results.
+func (c *DisksListCall) PageToken(pageToken string) *DisksListCall {
+ c.urlParams_.Set("pageToken", pageToken)
+ return c
+}
+
+// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
+// Opt-in for partial success behavior which provides partial results in case
+// of failure. The default value is false. For example, when partial success
+// behavior is enabled, aggregatedList for a single zone scope either returns
+// all resources in the zone or no resources, with an error code.
+func (c *DisksListCall) ReturnPartialSuccess(returnPartialSuccess bool) *DisksListCall {
+ c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *DisksListCall) Fields(s ...googleapi.Field) *DisksListCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *DisksListCall) IfNoneMatch(entityTag string) *DisksListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *DisksListCall) Context(ctx context.Context) *DisksListCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *DisksListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *DisksListCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/zones/{zone}/disks")
+ 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{
+ "project": c.project,
+ "zone": c.zone,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.disks.list" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *DiskList.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 *DisksListCall) Do(opts ...googleapi.CallOption) (*DiskList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &DiskList{
+ 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
+}
+
+// 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 *DisksListCall) Pages(ctx context.Context, f func(*DiskList) error) error {
+ c.ctx_ = ctx
+ defer c.PageToken(c.urlParams_.Get("pageToken"))
+ 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)
+ }
+}
+
+type DisksRemoveResourcePoliciesCall struct {
+ s *Service
+ project string
+ zone string
+ disk string
+ disksremoveresourcepoliciesrequest *DisksRemoveResourcePoliciesRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// RemoveResourcePolicies: Removes resource policies from a disk.
+//
+// - disk: The disk name for this request.
+// - project: Project ID for this request.
+// - zone: The name of the zone for this request.
+func (r *DisksService) RemoveResourcePolicies(project string, zone string, disk string, disksremoveresourcepoliciesrequest *DisksRemoveResourcePoliciesRequest) *DisksRemoveResourcePoliciesCall {
+ c := &DisksRemoveResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.zone = zone
+ c.disk = disk
+ c.disksremoveresourcepoliciesrequest = disksremoveresourcepoliciesrequest
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *DisksRemoveResourcePoliciesCall) RequestId(requestId string) *DisksRemoveResourcePoliciesCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *DisksRemoveResourcePoliciesCall) Fields(s ...googleapi.Field) *DisksRemoveResourcePoliciesCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *DisksRemoveResourcePoliciesCall) Context(ctx context.Context) *DisksRemoveResourcePoliciesCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *DisksRemoveResourcePoliciesCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *DisksRemoveResourcePoliciesCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksremoveresourcepoliciesrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks/{disk}/removeResourcePolicies")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "zone": c.zone,
+ "disk": c.disk,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.disks.removeResourcePolicies" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *DisksRemoveResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type DisksResizeCall struct {
+ s *Service
+ project string
+ zone string
+ disk string
+ disksresizerequest *DisksResizeRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Resize: Resizes the specified persistent disk. You can only increase the
+// size of the disk.
+//
+// - disk: The name of the persistent disk.
+// - project: Project ID for this request.
+// - zone: The name of the zone for this request.
+func (r *DisksService) Resize(project string, zone string, disk string, disksresizerequest *DisksResizeRequest) *DisksResizeCall {
+ c := &DisksResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.zone = zone
+ c.disk = disk
+ c.disksresizerequest = disksresizerequest
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *DisksResizeCall) RequestId(requestId string) *DisksResizeCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *DisksResizeCall) Fields(s ...googleapi.Field) *DisksResizeCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *DisksResizeCall) Context(ctx context.Context) *DisksResizeCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *DisksResizeCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *DisksResizeCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksresizerequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks/{disk}/resize")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "zone": c.zone,
+ "disk": c.disk,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.disks.resize" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *DisksResizeCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type DisksSetIamPolicyCall struct {
+ s *Service
+ project string
+ zone string
+ resource string
+ zonesetpolicyrequest *ZoneSetPolicyRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// SetIamPolicy: Sets the access control policy on the specified resource.
+// Replaces any existing policy.
+//
+// - project: Project ID for this request.
+// - resource: Name or id of the resource for this request.
+// - zone: The name of the zone for this request.
+func (r *DisksService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *DisksSetIamPolicyCall {
+ c := &DisksSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.zone = zone
+ c.resource = resource
+ c.zonesetpolicyrequest = zonesetpolicyrequest
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *DisksSetIamPolicyCall) Fields(s ...googleapi.Field) *DisksSetIamPolicyCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *DisksSetIamPolicyCall) Context(ctx context.Context) *DisksSetIamPolicyCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *DisksSetIamPolicyCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *DisksSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks/{resource}/setIamPolicy")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "zone": c.zone,
+ "resource": c.resource,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.disks.setIamPolicy" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Policy.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 *DisksSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Policy{
+ 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
+}
+
+type DisksSetLabelsCall struct {
+ s *Service
+ project string
+ zone string
+ resource string
+ zonesetlabelsrequest *ZoneSetLabelsRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// SetLabels: Sets the labels on a disk. To learn more about labels, read the
+// Labeling Resources documentation.
+//
+// - project: Project ID for this request.
+// - resource: Name or id of the resource for this request.
+// - zone: The name of the zone for this request.
+func (r *DisksService) SetLabels(project string, zone string, resource string, zonesetlabelsrequest *ZoneSetLabelsRequest) *DisksSetLabelsCall {
+ c := &DisksSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.zone = zone
+ c.resource = resource
+ c.zonesetlabelsrequest = zonesetlabelsrequest
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *DisksSetLabelsCall) RequestId(requestId string) *DisksSetLabelsCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *DisksSetLabelsCall) Fields(s ...googleapi.Field) *DisksSetLabelsCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *DisksSetLabelsCall) Context(ctx context.Context) *DisksSetLabelsCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *DisksSetLabelsCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *DisksSetLabelsCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetlabelsrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks/{resource}/setLabels")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "zone": c.zone,
+ "resource": c.resource,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.disks.setLabels" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *DisksSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type DisksStartAsyncReplicationCall struct {
+ s *Service
+ project string
+ zone string
+ disk string
+ disksstartasyncreplicationrequest *DisksStartAsyncReplicationRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// StartAsyncReplication: Starts asynchronous replication. Must be invoked on
+// the primary disk.
+//
+// - disk: The name of the persistent disk.
+// - project: Project ID for this request.
+// - zone: The name of the zone for this request.
+func (r *DisksService) StartAsyncReplication(project string, zone string, disk string, disksstartasyncreplicationrequest *DisksStartAsyncReplicationRequest) *DisksStartAsyncReplicationCall {
+ c := &DisksStartAsyncReplicationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.zone = zone
+ c.disk = disk
+ c.disksstartasyncreplicationrequest = disksstartasyncreplicationrequest
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *DisksStartAsyncReplicationCall) RequestId(requestId string) *DisksStartAsyncReplicationCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *DisksStartAsyncReplicationCall) Fields(s ...googleapi.Field) *DisksStartAsyncReplicationCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *DisksStartAsyncReplicationCall) Context(ctx context.Context) *DisksStartAsyncReplicationCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *DisksStartAsyncReplicationCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *DisksStartAsyncReplicationCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksstartasyncreplicationrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks/{disk}/startAsyncReplication")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "zone": c.zone,
+ "disk": c.disk,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.disks.startAsyncReplication" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *DisksStartAsyncReplicationCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type DisksStopAsyncReplicationCall struct {
+ s *Service
+ project string
+ zone string
+ disk string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// StopAsyncReplication: Stops asynchronous replication. Can be invoked either
+// on the primary or on the secondary disk.
+//
+// - disk: The name of the persistent disk.
+// - project: Project ID for this request.
+// - zone: The name of the zone for this request.
+func (r *DisksService) StopAsyncReplication(project string, zone string, disk string) *DisksStopAsyncReplicationCall {
+ c := &DisksStopAsyncReplicationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.zone = zone
+ c.disk = disk
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *DisksStopAsyncReplicationCall) RequestId(requestId string) *DisksStopAsyncReplicationCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *DisksStopAsyncReplicationCall) Fields(s ...googleapi.Field) *DisksStopAsyncReplicationCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *DisksStopAsyncReplicationCall) Context(ctx context.Context) *DisksStopAsyncReplicationCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *DisksStopAsyncReplicationCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *DisksStopAsyncReplicationCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks/{disk}/stopAsyncReplication")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "zone": c.zone,
+ "disk": c.disk,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.disks.stopAsyncReplication" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *DisksStopAsyncReplicationCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type DisksStopGroupAsyncReplicationCall struct {
+ s *Service
+ project string
+ zone string
+ disksstopgroupasyncreplicationresource *DisksStopGroupAsyncReplicationResource
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// StopGroupAsyncReplication: Stops asynchronous replication for a consistency
+// group of disks. Can be invoked either in the primary or secondary scope.
+//
+// - project: Project ID for this request.
+// - zone: The name of the zone for this request. This must be the zone of the
+// primary or secondary disks in the consistency group.
+func (r *DisksService) StopGroupAsyncReplication(project string, zone string, disksstopgroupasyncreplicationresource *DisksStopGroupAsyncReplicationResource) *DisksStopGroupAsyncReplicationCall {
+ c := &DisksStopGroupAsyncReplicationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.zone = zone
+ c.disksstopgroupasyncreplicationresource = disksstopgroupasyncreplicationresource
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *DisksStopGroupAsyncReplicationCall) RequestId(requestId string) *DisksStopGroupAsyncReplicationCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *DisksStopGroupAsyncReplicationCall) Fields(s ...googleapi.Field) *DisksStopGroupAsyncReplicationCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *DisksStopGroupAsyncReplicationCall) Context(ctx context.Context) *DisksStopGroupAsyncReplicationCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *DisksStopGroupAsyncReplicationCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *DisksStopGroupAsyncReplicationCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksstopgroupasyncreplicationresource)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks/stopGroupAsyncReplication")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "zone": c.zone,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.disks.stopGroupAsyncReplication" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *DisksStopGroupAsyncReplicationCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type DisksTestIamPermissionsCall struct {
+ s *Service
+ project string
+ zone string
+ resource string
+ testpermissionsrequest *TestPermissionsRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// TestIamPermissions: Returns permissions that a caller has on the specified
+// resource.
+//
+// - project: Project ID for this request.
+// - resource: Name or id of the resource for this request.
+// - zone: The name of the zone for this request.
+func (r *DisksService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *DisksTestIamPermissionsCall {
+ c := &DisksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.zone = zone
+ c.resource = resource
+ c.testpermissionsrequest = testpermissionsrequest
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *DisksTestIamPermissionsCall) Fields(s ...googleapi.Field) *DisksTestIamPermissionsCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *DisksTestIamPermissionsCall) Context(ctx context.Context) *DisksTestIamPermissionsCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *DisksTestIamPermissionsCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *DisksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks/{resource}/testIamPermissions")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "zone": c.zone,
+ "resource": c.resource,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.disks.testIamPermissions" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *TestPermissionsResponse.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 *DisksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &TestPermissionsResponse{
+ 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
+}
+
+type DisksUpdateCall struct {
+ s *Service
+ project string
+ zone string
+ disk string
+ disk2 *Disk
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Update: Updates the specified disk with the data included in the request.
+// The update is performed only on selected fields included as part of
+// update-mask. Only the following fields can be modified: user_license.
+//
+// - disk: The disk name for this request.
+// - project: Project ID for this request.
+// - zone: The name of the zone for this request.
+func (r *DisksService) Update(project string, zone string, disk string, disk2 *Disk) *DisksUpdateCall {
+ c := &DisksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.zone = zone
+ c.disk = disk
+ c.disk2 = disk2
+ return c
+}
+
+// Paths sets the optional parameter "paths":
+func (c *DisksUpdateCall) Paths(paths ...string) *DisksUpdateCall {
+ c.urlParams_.SetMulti("paths", append([]string{}, paths...))
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *DisksUpdateCall) RequestId(requestId string) *DisksUpdateCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// UpdateMask sets the optional parameter "updateMask": update_mask indicates
+// fields to be updated as part of this request.
+func (c *DisksUpdateCall) UpdateMask(updateMask string) *DisksUpdateCall {
+ c.urlParams_.Set("updateMask", updateMask)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *DisksUpdateCall) Fields(s ...googleapi.Field) *DisksUpdateCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *DisksUpdateCall) Context(ctx context.Context) *DisksUpdateCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *DisksUpdateCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *DisksUpdateCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk2)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/disks/{disk}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("PATCH", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "zone": c.zone,
+ "disk": c.disk,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.disks.update" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *DisksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type ExternalVpnGatewaysDeleteCall struct {
+ s *Service
+ project string
+ externalVpnGateway string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Delete: Deletes the specified externalVpnGateway.
+//
+// - externalVpnGateway: Name of the externalVpnGateways to delete.
+// - project: Project ID for this request.
+func (r *ExternalVpnGatewaysService) Delete(project string, externalVpnGateway string) *ExternalVpnGatewaysDeleteCall {
+ c := &ExternalVpnGatewaysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.externalVpnGateway = externalVpnGateway
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *ExternalVpnGatewaysDeleteCall) RequestId(requestId string) *ExternalVpnGatewaysDeleteCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *ExternalVpnGatewaysDeleteCall) Fields(s ...googleapi.Field) *ExternalVpnGatewaysDeleteCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *ExternalVpnGatewaysDeleteCall) Context(ctx context.Context) *ExternalVpnGatewaysDeleteCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *ExternalVpnGatewaysDeleteCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ExternalVpnGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/externalVpnGateways/{externalVpnGateway}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("DELETE", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "externalVpnGateway": c.externalVpnGateway,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.externalVpnGateways.delete" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *ExternalVpnGatewaysDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type ExternalVpnGatewaysGetCall struct {
+ s *Service
+ project string
+ externalVpnGateway string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Get: Returns the specified externalVpnGateway. Get a list of available
+// externalVpnGateways by making a list() request.
+//
+// - externalVpnGateway: Name of the externalVpnGateway to return.
+// - project: Project ID for this request.
+func (r *ExternalVpnGatewaysService) Get(project string, externalVpnGateway string) *ExternalVpnGatewaysGetCall {
+ c := &ExternalVpnGatewaysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.externalVpnGateway = externalVpnGateway
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *ExternalVpnGatewaysGetCall) Fields(s ...googleapi.Field) *ExternalVpnGatewaysGetCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *ExternalVpnGatewaysGetCall) IfNoneMatch(entityTag string) *ExternalVpnGatewaysGetCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *ExternalVpnGatewaysGetCall) Context(ctx context.Context) *ExternalVpnGatewaysGetCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *ExternalVpnGatewaysGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ExternalVpnGatewaysGetCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/global/externalVpnGateways/{externalVpnGateway}")
+ 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{
+ "project": c.project,
+ "externalVpnGateway": c.externalVpnGateway,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.externalVpnGateways.get" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *ExternalVpnGateway.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 *ExternalVpnGatewaysGetCall) Do(opts ...googleapi.CallOption) (*ExternalVpnGateway, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &ExternalVpnGateway{
+ 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
+}
+
+type ExternalVpnGatewaysInsertCall struct {
+ s *Service
+ project string
+ externalvpngateway *ExternalVpnGateway
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Insert: Creates a ExternalVpnGateway in the specified project using the data
+// included in the request.
+//
+// - project: Project ID for this request.
+func (r *ExternalVpnGatewaysService) Insert(project string, externalvpngateway *ExternalVpnGateway) *ExternalVpnGatewaysInsertCall {
+ c := &ExternalVpnGatewaysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.externalvpngateway = externalvpngateway
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *ExternalVpnGatewaysInsertCall) RequestId(requestId string) *ExternalVpnGatewaysInsertCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *ExternalVpnGatewaysInsertCall) Fields(s ...googleapi.Field) *ExternalVpnGatewaysInsertCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *ExternalVpnGatewaysInsertCall) Context(ctx context.Context) *ExternalVpnGatewaysInsertCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *ExternalVpnGatewaysInsertCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ExternalVpnGatewaysInsertCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.externalvpngateway)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/externalVpnGateways")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.externalVpnGateways.insert" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *ExternalVpnGatewaysInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type ExternalVpnGatewaysListCall struct {
+ s *Service
+ project string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// List: Retrieves the list of ExternalVpnGateway available to the specified
+// project.
+//
+// - project: Project ID for this request.
+func (r *ExternalVpnGatewaysService) List(project string) *ExternalVpnGatewaysListCall {
+ c := &ExternalVpnGatewaysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ return c
+}
+
+// Filter sets the optional parameter "filter": A filter expression that
+// filters resources listed in the response. Most Compute resources support two
+// types of filter expressions: expressions that support regular expressions
+// and expressions that follow API improvement proposal AIP-160. These two
+// types of filter expressions cannot be mixed in one request. If you want to
+// use AIP-160, your expression must specify the field name, an operator, and
+// the value that you want to use for filtering. The value must be a string, a
+// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
+// `>=` or `:`. For example, if you are filtering Compute Engine instances, you
+// can exclude instances named `example-instance` by specifying `name !=
+// example-instance`. The `:*` comparison can be used to test whether a key has
+// been defined. For example, to find all objects with `owner` label use: ```
+// labels.owner:* ``` You can also filter nested fields. For example, you could
+// specify `scheduling.automaticRestart = false` to include instances only if
+// they are not scheduled for automatic restarts. You can use filtering on
+// nested fields to filter based on resource labels. To filter on multiple
+// expressions, provide each separate expression within parentheses. For
+// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel
+// Skylake") ``` By default, each expression is an `AND` expression. However,
+// you can include `AND` and `OR` expressions explicitly. For example: ```
+// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND
+// (scheduling.automaticRestart = true) ``` If you want to use a regular
+// expression, use the `eq` (equal) or `ne` (not equal) operator against a
+// single un-parenthesized expression with or without quotes or against
+// multiple parenthesized expressions. Examples: `fieldname eq unquoted
+// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted
+// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal
+// value is interpreted as a regular expression using Google RE2 library
+// syntax. The literal value must match the entire field. For example, to
+// filter for instances that do not end with name "instance", you would use
+// `name ne .*instance`. You cannot combine constraints on multiple fields
+// using regular expressions.
+func (c *ExternalVpnGatewaysListCall) Filter(filter string) *ExternalVpnGatewaysListCall {
+ c.urlParams_.Set("filter", filter)
+ return c
+}
+
+// MaxResults sets the optional parameter "maxResults": The maximum number of
+// results per page that should be returned. If the number of available results
+// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that
+// can be used to get the next page of results in subsequent list requests.
+// Acceptable values are `0` to `500`, inclusive. (Default: `500`)
+func (c *ExternalVpnGatewaysListCall) MaxResults(maxResults int64) *ExternalVpnGatewaysListCall {
+ c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
+ return c
+}
+
+// OrderBy sets the optional parameter "orderBy": Sorts list results by a
+// certain order. By default, results are returned in alphanumerical order
+// based on the resource name. You can also sort results in descending order
+// based on the creation timestamp using `orderBy="creationTimestamp desc".
+// This sorts results based on the `creationTimestamp` field in reverse
+// chronological order (newest result first). Use this to sort resources like
+// operations so that the newest operation is returned first. Currently, only
+// sorting by `name` or `creationTimestamp desc` is supported.
+func (c *ExternalVpnGatewaysListCall) OrderBy(orderBy string) *ExternalVpnGatewaysListCall {
+ c.urlParams_.Set("orderBy", orderBy)
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": Specifies a page token to
+// use. Set `pageToken` to the `nextPageToken` returned by a previous list
+// request to get the next page of results.
+func (c *ExternalVpnGatewaysListCall) PageToken(pageToken string) *ExternalVpnGatewaysListCall {
+ c.urlParams_.Set("pageToken", pageToken)
+ return c
+}
+
+// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
+// Opt-in for partial success behavior which provides partial results in case
+// of failure. The default value is false. For example, when partial success
+// behavior is enabled, aggregatedList for a single zone scope either returns
+// all resources in the zone or no resources, with an error code.
+func (c *ExternalVpnGatewaysListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ExternalVpnGatewaysListCall {
+ c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *ExternalVpnGatewaysListCall) Fields(s ...googleapi.Field) *ExternalVpnGatewaysListCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *ExternalVpnGatewaysListCall) IfNoneMatch(entityTag string) *ExternalVpnGatewaysListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *ExternalVpnGatewaysListCall) Context(ctx context.Context) *ExternalVpnGatewaysListCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *ExternalVpnGatewaysListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ExternalVpnGatewaysListCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/global/externalVpnGateways")
+ 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{
+ "project": c.project,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.externalVpnGateways.list" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *ExternalVpnGatewayList.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 *ExternalVpnGatewaysListCall) Do(opts ...googleapi.CallOption) (*ExternalVpnGatewayList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &ExternalVpnGatewayList{
+ 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
+}
+
+// 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 *ExternalVpnGatewaysListCall) Pages(ctx context.Context, f func(*ExternalVpnGatewayList) error) error {
+ c.ctx_ = ctx
+ defer c.PageToken(c.urlParams_.Get("pageToken"))
+ 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)
+ }
+}
+
+type ExternalVpnGatewaysSetLabelsCall struct {
+ s *Service
+ project string
+ resource string
+ globalsetlabelsrequest *GlobalSetLabelsRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// SetLabels: Sets the labels on an ExternalVpnGateway. To learn more about
+// labels, read the Labeling Resources documentation.
+//
+// - project: Project ID for this request.
+// - resource: Name or id of the resource for this request.
+func (r *ExternalVpnGatewaysService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *ExternalVpnGatewaysSetLabelsCall {
+ c := &ExternalVpnGatewaysSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.resource = resource
+ c.globalsetlabelsrequest = globalsetlabelsrequest
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *ExternalVpnGatewaysSetLabelsCall) Fields(s ...googleapi.Field) *ExternalVpnGatewaysSetLabelsCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *ExternalVpnGatewaysSetLabelsCall) Context(ctx context.Context) *ExternalVpnGatewaysSetLabelsCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *ExternalVpnGatewaysSetLabelsCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ExternalVpnGatewaysSetLabelsCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/externalVpnGateways/{resource}/setLabels")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "resource": c.resource,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.externalVpnGateways.setLabels" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *ExternalVpnGatewaysSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type ExternalVpnGatewaysTestIamPermissionsCall struct {
+ s *Service
+ project string
+ resource string
+ testpermissionsrequest *TestPermissionsRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// TestIamPermissions: Returns permissions that a caller has on the specified
+// resource.
+//
+// - project: Project ID for this request.
+// - resource: Name or id of the resource for this request.
+func (r *ExternalVpnGatewaysService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *ExternalVpnGatewaysTestIamPermissionsCall {
+ c := &ExternalVpnGatewaysTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.resource = resource
+ c.testpermissionsrequest = testpermissionsrequest
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *ExternalVpnGatewaysTestIamPermissionsCall) Fields(s ...googleapi.Field) *ExternalVpnGatewaysTestIamPermissionsCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *ExternalVpnGatewaysTestIamPermissionsCall) Context(ctx context.Context) *ExternalVpnGatewaysTestIamPermissionsCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *ExternalVpnGatewaysTestIamPermissionsCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ExternalVpnGatewaysTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/externalVpnGateways/{resource}/testIamPermissions")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "resource": c.resource,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.externalVpnGateways.testIamPermissions" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *TestPermissionsResponse.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 *ExternalVpnGatewaysTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &TestPermissionsResponse{
+ 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
+}
+
+type FirewallPoliciesAddAssociationCall struct {
+ s *Service
+ firewallPolicy string
+ firewallpolicyassociation *FirewallPolicyAssociation
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// AddAssociation: Inserts an association for the specified firewall policy.
+//
+// - firewallPolicy: Name of the firewall policy to update.
+func (r *FirewallPoliciesService) AddAssociation(firewallPolicy string, firewallpolicyassociation *FirewallPolicyAssociation) *FirewallPoliciesAddAssociationCall {
+ c := &FirewallPoliciesAddAssociationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.firewallPolicy = firewallPolicy
+ c.firewallpolicyassociation = firewallpolicyassociation
+ return c
+}
+
+// ReplaceExistingAssociation sets the optional parameter
+// "replaceExistingAssociation": Indicates whether or not to replace it if an
+// association of the attachment already exists. This is false by default, in
+// which case an error will be returned if an association already exists.
+func (c *FirewallPoliciesAddAssociationCall) ReplaceExistingAssociation(replaceExistingAssociation bool) *FirewallPoliciesAddAssociationCall {
+ c.urlParams_.Set("replaceExistingAssociation", fmt.Sprint(replaceExistingAssociation))
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *FirewallPoliciesAddAssociationCall) RequestId(requestId string) *FirewallPoliciesAddAssociationCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *FirewallPoliciesAddAssociationCall) Fields(s ...googleapi.Field) *FirewallPoliciesAddAssociationCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *FirewallPoliciesAddAssociationCall) Context(ctx context.Context) *FirewallPoliciesAddAssociationCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *FirewallPoliciesAddAssociationCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *FirewallPoliciesAddAssociationCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyassociation)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}/addAssociation")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "firewallPolicy": c.firewallPolicy,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.firewallPolicies.addAssociation" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *FirewallPoliciesAddAssociationCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type FirewallPoliciesAddRuleCall struct {
+ s *Service
+ firewallPolicy string
+ firewallpolicyrule *FirewallPolicyRule
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// AddRule: Inserts a rule into a firewall policy.
+//
+// - firewallPolicy: Name of the firewall policy to update.
+func (r *FirewallPoliciesService) AddRule(firewallPolicy string, firewallpolicyrule *FirewallPolicyRule) *FirewallPoliciesAddRuleCall {
+ c := &FirewallPoliciesAddRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.firewallPolicy = firewallPolicy
+ c.firewallpolicyrule = firewallpolicyrule
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *FirewallPoliciesAddRuleCall) RequestId(requestId string) *FirewallPoliciesAddRuleCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *FirewallPoliciesAddRuleCall) Fields(s ...googleapi.Field) *FirewallPoliciesAddRuleCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *FirewallPoliciesAddRuleCall) Context(ctx context.Context) *FirewallPoliciesAddRuleCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *FirewallPoliciesAddRuleCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *FirewallPoliciesAddRuleCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyrule)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}/addRule")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "firewallPolicy": c.firewallPolicy,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.firewallPolicies.addRule" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *FirewallPoliciesAddRuleCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type FirewallPoliciesCloneRulesCall struct {
+ s *Service
+ firewallPolicy string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// CloneRules: Copies rules to the specified firewall policy.
+//
+// - firewallPolicy: Name of the firewall policy to update.
+func (r *FirewallPoliciesService) CloneRules(firewallPolicy string) *FirewallPoliciesCloneRulesCall {
+ c := &FirewallPoliciesCloneRulesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.firewallPolicy = firewallPolicy
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *FirewallPoliciesCloneRulesCall) RequestId(requestId string) *FirewallPoliciesCloneRulesCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// SourceFirewallPolicy sets the optional parameter "sourceFirewallPolicy": The
+// firewall policy from which to copy rules.
+func (c *FirewallPoliciesCloneRulesCall) SourceFirewallPolicy(sourceFirewallPolicy string) *FirewallPoliciesCloneRulesCall {
+ c.urlParams_.Set("sourceFirewallPolicy", sourceFirewallPolicy)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *FirewallPoliciesCloneRulesCall) Fields(s ...googleapi.Field) *FirewallPoliciesCloneRulesCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *FirewallPoliciesCloneRulesCall) Context(ctx context.Context) *FirewallPoliciesCloneRulesCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *FirewallPoliciesCloneRulesCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *FirewallPoliciesCloneRulesCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}/cloneRules")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "firewallPolicy": c.firewallPolicy,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.firewallPolicies.cloneRules" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *FirewallPoliciesCloneRulesCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type FirewallPoliciesDeleteCall struct {
+ s *Service
+ firewallPolicy string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Delete: Deletes the specified policy.
+//
+// - firewallPolicy: Name of the firewall policy to delete.
+func (r *FirewallPoliciesService) Delete(firewallPolicy string) *FirewallPoliciesDeleteCall {
+ c := &FirewallPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.firewallPolicy = firewallPolicy
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *FirewallPoliciesDeleteCall) RequestId(requestId string) *FirewallPoliciesDeleteCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *FirewallPoliciesDeleteCall) Fields(s ...googleapi.Field) *FirewallPoliciesDeleteCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *FirewallPoliciesDeleteCall) Context(ctx context.Context) *FirewallPoliciesDeleteCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *FirewallPoliciesDeleteCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *FirewallPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("DELETE", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "firewallPolicy": c.firewallPolicy,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.firewallPolicies.delete" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *FirewallPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type FirewallPoliciesGetCall struct {
+ s *Service
+ firewallPolicy string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Get: Returns the specified firewall policy.
+//
+// - firewallPolicy: Name of the firewall policy to get.
+func (r *FirewallPoliciesService) Get(firewallPolicy string) *FirewallPoliciesGetCall {
+ c := &FirewallPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.firewallPolicy = firewallPolicy
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *FirewallPoliciesGetCall) Fields(s ...googleapi.Field) *FirewallPoliciesGetCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *FirewallPoliciesGetCall) IfNoneMatch(entityTag string) *FirewallPoliciesGetCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *FirewallPoliciesGetCall) Context(ctx context.Context) *FirewallPoliciesGetCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *FirewallPoliciesGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *FirewallPoliciesGetCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "locations/global/firewallPolicies/{firewallPolicy}")
+ 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{
+ "firewallPolicy": c.firewallPolicy,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.firewallPolicies.get" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *FirewallPolicy.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 *FirewallPoliciesGetCall) Do(opts ...googleapi.CallOption) (*FirewallPolicy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &FirewallPolicy{
+ 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
+}
+
+type FirewallPoliciesGetAssociationCall struct {
+ s *Service
+ firewallPolicy string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// GetAssociation: Gets an association with the specified name.
+//
+// - firewallPolicy: Name of the firewall policy to which the queried rule
+// belongs.
+func (r *FirewallPoliciesService) GetAssociation(firewallPolicy string) *FirewallPoliciesGetAssociationCall {
+ c := &FirewallPoliciesGetAssociationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.firewallPolicy = firewallPolicy
+ return c
+}
+
+// Name sets the optional parameter "name": The name of the association to get
+// from the firewall policy.
+func (c *FirewallPoliciesGetAssociationCall) Name(name string) *FirewallPoliciesGetAssociationCall {
+ c.urlParams_.Set("name", name)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *FirewallPoliciesGetAssociationCall) Fields(s ...googleapi.Field) *FirewallPoliciesGetAssociationCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *FirewallPoliciesGetAssociationCall) IfNoneMatch(entityTag string) *FirewallPoliciesGetAssociationCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *FirewallPoliciesGetAssociationCall) Context(ctx context.Context) *FirewallPoliciesGetAssociationCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *FirewallPoliciesGetAssociationCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *FirewallPoliciesGetAssociationCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "locations/global/firewallPolicies/{firewallPolicy}/getAssociation")
+ 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{
+ "firewallPolicy": c.firewallPolicy,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.firewallPolicies.getAssociation" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *FirewallPolicyAssociation.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 *FirewallPoliciesGetAssociationCall) Do(opts ...googleapi.CallOption) (*FirewallPolicyAssociation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &FirewallPolicyAssociation{
+ 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
+}
+
+type FirewallPoliciesGetIamPolicyCall struct {
+ s *Service
+ resource string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// GetIamPolicy: Gets the access control policy for a resource. May be empty if
+// no such policy or resource exists.
+//
+// - resource: Name or id of the resource for this request.
+func (r *FirewallPoliciesService) GetIamPolicy(resource string) *FirewallPoliciesGetIamPolicyCall {
+ c := &FirewallPoliciesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.resource = resource
+ return c
+}
+
+// OptionsRequestedPolicyVersion sets the optional parameter
+// "optionsRequestedPolicyVersion": Requested IAM Policy version.
+func (c *FirewallPoliciesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *FirewallPoliciesGetIamPolicyCall {
+ c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *FirewallPoliciesGetIamPolicyCall) Fields(s ...googleapi.Field) *FirewallPoliciesGetIamPolicyCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *FirewallPoliciesGetIamPolicyCall) IfNoneMatch(entityTag string) *FirewallPoliciesGetIamPolicyCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *FirewallPoliciesGetIamPolicyCall) Context(ctx context.Context) *FirewallPoliciesGetIamPolicyCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *FirewallPoliciesGetIamPolicyCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *FirewallPoliciesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "locations/global/firewallPolicies/{resource}/getIamPolicy")
+ 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{
+ "resource": c.resource,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.firewallPolicies.getIamPolicy" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Policy.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 *FirewallPoliciesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Policy{
+ 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
+}
+
+type FirewallPoliciesGetRuleCall struct {
+ s *Service
+ firewallPolicy string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// GetRule: Gets a rule of the specified priority.
+//
+// - firewallPolicy: Name of the firewall policy to which the queried rule
+// belongs.
+func (r *FirewallPoliciesService) GetRule(firewallPolicy string) *FirewallPoliciesGetRuleCall {
+ c := &FirewallPoliciesGetRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.firewallPolicy = firewallPolicy
+ return c
+}
+
+// Priority sets the optional parameter "priority": The priority of the rule to
+// get from the firewall policy.
+func (c *FirewallPoliciesGetRuleCall) Priority(priority int64) *FirewallPoliciesGetRuleCall {
+ c.urlParams_.Set("priority", fmt.Sprint(priority))
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *FirewallPoliciesGetRuleCall) Fields(s ...googleapi.Field) *FirewallPoliciesGetRuleCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *FirewallPoliciesGetRuleCall) IfNoneMatch(entityTag string) *FirewallPoliciesGetRuleCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *FirewallPoliciesGetRuleCall) Context(ctx context.Context) *FirewallPoliciesGetRuleCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *FirewallPoliciesGetRuleCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *FirewallPoliciesGetRuleCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "locations/global/firewallPolicies/{firewallPolicy}/getRule")
+ 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{
+ "firewallPolicy": c.firewallPolicy,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.firewallPolicies.getRule" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *FirewallPolicyRule.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 *FirewallPoliciesGetRuleCall) Do(opts ...googleapi.CallOption) (*FirewallPolicyRule, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &FirewallPolicyRule{
+ 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
+}
+
+type FirewallPoliciesInsertCall struct {
+ s *Service
+ firewallpolicy *FirewallPolicy
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Insert: Creates a new policy in the specified project using the data
+// included in the request.
+func (r *FirewallPoliciesService) Insert(firewallpolicy *FirewallPolicy) *FirewallPoliciesInsertCall {
+ c := &FirewallPoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.firewallpolicy = firewallpolicy
+ return c
+}
+
+// ParentId sets the optional parameter "parentId": Parent ID for this request.
+// The ID can be either be "folders/[FOLDER_ID]" if the parent is a folder or
+// "organizations/[ORGANIZATION_ID]" if the parent is an organization.
+func (c *FirewallPoliciesInsertCall) ParentId(parentId string) *FirewallPoliciesInsertCall {
+ c.urlParams_.Set("parentId", parentId)
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *FirewallPoliciesInsertCall) RequestId(requestId string) *FirewallPoliciesInsertCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *FirewallPoliciesInsertCall) Fields(s ...googleapi.Field) *FirewallPoliciesInsertCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *FirewallPoliciesInsertCall) Context(ctx context.Context) *FirewallPoliciesInsertCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *FirewallPoliciesInsertCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *FirewallPoliciesInsertCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicy)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.firewallPolicies.insert" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *FirewallPoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type FirewallPoliciesListCall struct {
+ s *Service
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// List: Lists all the policies that have been configured for the specified
+// folder or organization.
+func (r *FirewallPoliciesService) List() *FirewallPoliciesListCall {
+ c := &FirewallPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ return c
+}
+
+// Filter sets the optional parameter "filter": A filter expression that
+// filters resources listed in the response. Most Compute resources support two
+// types of filter expressions: expressions that support regular expressions
+// and expressions that follow API improvement proposal AIP-160. These two
+// types of filter expressions cannot be mixed in one request. If you want to
+// use AIP-160, your expression must specify the field name, an operator, and
+// the value that you want to use for filtering. The value must be a string, a
+// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
+// `>=` or `:`. For example, if you are filtering Compute Engine instances, you
+// can exclude instances named `example-instance` by specifying `name !=
+// example-instance`. The `:*` comparison can be used to test whether a key has
+// been defined. For example, to find all objects with `owner` label use: ```
+// labels.owner:* ``` You can also filter nested fields. For example, you could
+// specify `scheduling.automaticRestart = false` to include instances only if
+// they are not scheduled for automatic restarts. You can use filtering on
+// nested fields to filter based on resource labels. To filter on multiple
+// expressions, provide each separate expression within parentheses. For
+// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel
+// Skylake") ``` By default, each expression is an `AND` expression. However,
+// you can include `AND` and `OR` expressions explicitly. For example: ```
+// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND
+// (scheduling.automaticRestart = true) ``` If you want to use a regular
+// expression, use the `eq` (equal) or `ne` (not equal) operator against a
+// single un-parenthesized expression with or without quotes or against
+// multiple parenthesized expressions. Examples: `fieldname eq unquoted
+// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted
+// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal
+// value is interpreted as a regular expression using Google RE2 library
+// syntax. The literal value must match the entire field. For example, to
+// filter for instances that do not end with name "instance", you would use
+// `name ne .*instance`. You cannot combine constraints on multiple fields
+// using regular expressions.
+func (c *FirewallPoliciesListCall) Filter(filter string) *FirewallPoliciesListCall {
+ c.urlParams_.Set("filter", filter)
+ return c
+}
+
+// MaxResults sets the optional parameter "maxResults": The maximum number of
+// results per page that should be returned. If the number of available results
+// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that
+// can be used to get the next page of results in subsequent list requests.
+// Acceptable values are `0` to `500`, inclusive. (Default: `500`)
+func (c *FirewallPoliciesListCall) MaxResults(maxResults int64) *FirewallPoliciesListCall {
+ c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
+ return c
+}
+
+// OrderBy sets the optional parameter "orderBy": Sorts list results by a
+// certain order. By default, results are returned in alphanumerical order
+// based on the resource name. You can also sort results in descending order
+// based on the creation timestamp using `orderBy="creationTimestamp desc".
+// This sorts results based on the `creationTimestamp` field in reverse
+// chronological order (newest result first). Use this to sort resources like
+// operations so that the newest operation is returned first. Currently, only
+// sorting by `name` or `creationTimestamp desc` is supported.
+func (c *FirewallPoliciesListCall) OrderBy(orderBy string) *FirewallPoliciesListCall {
+ c.urlParams_.Set("orderBy", orderBy)
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": Specifies a page token to
+// use. Set `pageToken` to the `nextPageToken` returned by a previous list
+// request to get the next page of results.
+func (c *FirewallPoliciesListCall) PageToken(pageToken string) *FirewallPoliciesListCall {
+ c.urlParams_.Set("pageToken", pageToken)
+ return c
+}
+
+// ParentId sets the optional parameter "parentId": Parent ID for this request.
+// The ID can be either be "folders/[FOLDER_ID]" if the parent is a folder or
+// "organizations/[ORGANIZATION_ID]" if the parent is an organization.
+func (c *FirewallPoliciesListCall) ParentId(parentId string) *FirewallPoliciesListCall {
+ c.urlParams_.Set("parentId", parentId)
+ return c
+}
+
+// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
+// Opt-in for partial success behavior which provides partial results in case
+// of failure. The default value is false. For example, when partial success
+// behavior is enabled, aggregatedList for a single zone scope either returns
+// all resources in the zone or no resources, with an error code.
+func (c *FirewallPoliciesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *FirewallPoliciesListCall {
+ c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *FirewallPoliciesListCall) Fields(s ...googleapi.Field) *FirewallPoliciesListCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *FirewallPoliciesListCall) IfNoneMatch(entityTag string) *FirewallPoliciesListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *FirewallPoliciesListCall) Context(ctx context.Context) *FirewallPoliciesListCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *FirewallPoliciesListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *FirewallPoliciesListCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "locations/global/firewallPolicies")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("GET", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.firewallPolicies.list" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *FirewallPolicyList.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 *FirewallPoliciesListCall) Do(opts ...googleapi.CallOption) (*FirewallPolicyList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &FirewallPolicyList{
+ 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
+}
+
+// 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 *FirewallPoliciesListCall) Pages(ctx context.Context, f func(*FirewallPolicyList) error) error {
+ c.ctx_ = ctx
+ defer c.PageToken(c.urlParams_.Get("pageToken"))
+ 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)
+ }
+}
+
+type FirewallPoliciesListAssociationsCall struct {
+ s *Service
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// ListAssociations: Lists associations of a specified target, i.e.,
+// organization or folder.
+func (r *FirewallPoliciesService) ListAssociations() *FirewallPoliciesListAssociationsCall {
+ c := &FirewallPoliciesListAssociationsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ return c
+}
+
+// TargetResource sets the optional parameter "targetResource": The target
+// resource to list associations. It is an organization, or a folder.
+func (c *FirewallPoliciesListAssociationsCall) TargetResource(targetResource string) *FirewallPoliciesListAssociationsCall {
+ c.urlParams_.Set("targetResource", targetResource)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *FirewallPoliciesListAssociationsCall) Fields(s ...googleapi.Field) *FirewallPoliciesListAssociationsCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *FirewallPoliciesListAssociationsCall) IfNoneMatch(entityTag string) *FirewallPoliciesListAssociationsCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *FirewallPoliciesListAssociationsCall) Context(ctx context.Context) *FirewallPoliciesListAssociationsCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *FirewallPoliciesListAssociationsCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *FirewallPoliciesListAssociationsCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "locations/global/firewallPolicies/listAssociations")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("GET", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.firewallPolicies.listAssociations" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *FirewallPoliciesListAssociationsResponse.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 *FirewallPoliciesListAssociationsCall) Do(opts ...googleapi.CallOption) (*FirewallPoliciesListAssociationsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &FirewallPoliciesListAssociationsResponse{
+ 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
+}
+
+type FirewallPoliciesMoveCall struct {
+ s *Service
+ firewallPolicy string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Move: Moves the specified firewall policy.
+//
+// - firewallPolicy: Name of the firewall policy to update.
+func (r *FirewallPoliciesService) Move(firewallPolicy string) *FirewallPoliciesMoveCall {
+ c := &FirewallPoliciesMoveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.firewallPolicy = firewallPolicy
+ return c
+}
+
+// ParentId sets the optional parameter "parentId": The new parent of the
+// firewall policy. The ID can be either be "folders/[FOLDER_ID]" if the parent
+// is a folder or "organizations/[ORGANIZATION_ID]" if the parent is an
+// organization.
+func (c *FirewallPoliciesMoveCall) ParentId(parentId string) *FirewallPoliciesMoveCall {
+ c.urlParams_.Set("parentId", parentId)
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *FirewallPoliciesMoveCall) RequestId(requestId string) *FirewallPoliciesMoveCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *FirewallPoliciesMoveCall) Fields(s ...googleapi.Field) *FirewallPoliciesMoveCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *FirewallPoliciesMoveCall) Context(ctx context.Context) *FirewallPoliciesMoveCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *FirewallPoliciesMoveCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *FirewallPoliciesMoveCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}/move")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "firewallPolicy": c.firewallPolicy,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.firewallPolicies.move" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *FirewallPoliciesMoveCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type FirewallPoliciesPatchCall struct {
+ s *Service
+ firewallPolicy string
+ firewallpolicy *FirewallPolicy
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Patch: Patches the specified policy with the data included in the request.
+//
+// - firewallPolicy: Name of the firewall policy to update.
+func (r *FirewallPoliciesService) Patch(firewallPolicy string, firewallpolicy *FirewallPolicy) *FirewallPoliciesPatchCall {
+ c := &FirewallPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.firewallPolicy = firewallPolicy
+ c.firewallpolicy = firewallpolicy
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *FirewallPoliciesPatchCall) RequestId(requestId string) *FirewallPoliciesPatchCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *FirewallPoliciesPatchCall) Fields(s ...googleapi.Field) *FirewallPoliciesPatchCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *FirewallPoliciesPatchCall) Context(ctx context.Context) *FirewallPoliciesPatchCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *FirewallPoliciesPatchCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *FirewallPoliciesPatchCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicy)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("PATCH", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "firewallPolicy": c.firewallPolicy,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.firewallPolicies.patch" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *FirewallPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type FirewallPoliciesPatchRuleCall struct {
+ s *Service
+ firewallPolicy string
+ firewallpolicyrule *FirewallPolicyRule
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// PatchRule: Patches a rule of the specified priority.
+//
+// - firewallPolicy: Name of the firewall policy to update.
+func (r *FirewallPoliciesService) PatchRule(firewallPolicy string, firewallpolicyrule *FirewallPolicyRule) *FirewallPoliciesPatchRuleCall {
+ c := &FirewallPoliciesPatchRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.firewallPolicy = firewallPolicy
+ c.firewallpolicyrule = firewallpolicyrule
+ return c
+}
+
+// Priority sets the optional parameter "priority": The priority of the rule to
+// patch.
+func (c *FirewallPoliciesPatchRuleCall) Priority(priority int64) *FirewallPoliciesPatchRuleCall {
+ c.urlParams_.Set("priority", fmt.Sprint(priority))
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *FirewallPoliciesPatchRuleCall) RequestId(requestId string) *FirewallPoliciesPatchRuleCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *FirewallPoliciesPatchRuleCall) Fields(s ...googleapi.Field) *FirewallPoliciesPatchRuleCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *FirewallPoliciesPatchRuleCall) Context(ctx context.Context) *FirewallPoliciesPatchRuleCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *FirewallPoliciesPatchRuleCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *FirewallPoliciesPatchRuleCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyrule)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}/patchRule")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "firewallPolicy": c.firewallPolicy,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.firewallPolicies.patchRule" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *FirewallPoliciesPatchRuleCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type FirewallPoliciesRemoveAssociationCall struct {
+ s *Service
+ firewallPolicy string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// RemoveAssociation: Removes an association for the specified firewall policy.
+//
+// - firewallPolicy: Name of the firewall policy to update.
+func (r *FirewallPoliciesService) RemoveAssociation(firewallPolicy string) *FirewallPoliciesRemoveAssociationCall {
+ c := &FirewallPoliciesRemoveAssociationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.firewallPolicy = firewallPolicy
+ return c
+}
+
+// Name sets the optional parameter "name": Name for the attachment that will
+// be removed.
+func (c *FirewallPoliciesRemoveAssociationCall) Name(name string) *FirewallPoliciesRemoveAssociationCall {
+ c.urlParams_.Set("name", name)
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *FirewallPoliciesRemoveAssociationCall) RequestId(requestId string) *FirewallPoliciesRemoveAssociationCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *FirewallPoliciesRemoveAssociationCall) Fields(s ...googleapi.Field) *FirewallPoliciesRemoveAssociationCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *FirewallPoliciesRemoveAssociationCall) Context(ctx context.Context) *FirewallPoliciesRemoveAssociationCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *FirewallPoliciesRemoveAssociationCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *FirewallPoliciesRemoveAssociationCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}/removeAssociation")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "firewallPolicy": c.firewallPolicy,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.firewallPolicies.removeAssociation" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *FirewallPoliciesRemoveAssociationCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type FirewallPoliciesRemoveRuleCall struct {
+ s *Service
+ firewallPolicy string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// RemoveRule: Deletes a rule of the specified priority.
+//
+// - firewallPolicy: Name of the firewall policy to update.
+func (r *FirewallPoliciesService) RemoveRule(firewallPolicy string) *FirewallPoliciesRemoveRuleCall {
+ c := &FirewallPoliciesRemoveRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.firewallPolicy = firewallPolicy
+ return c
+}
+
+// Priority sets the optional parameter "priority": The priority of the rule to
+// remove from the firewall policy.
+func (c *FirewallPoliciesRemoveRuleCall) Priority(priority int64) *FirewallPoliciesRemoveRuleCall {
+ c.urlParams_.Set("priority", fmt.Sprint(priority))
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *FirewallPoliciesRemoveRuleCall) RequestId(requestId string) *FirewallPoliciesRemoveRuleCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *FirewallPoliciesRemoveRuleCall) Fields(s ...googleapi.Field) *FirewallPoliciesRemoveRuleCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *FirewallPoliciesRemoveRuleCall) Context(ctx context.Context) *FirewallPoliciesRemoveRuleCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *FirewallPoliciesRemoveRuleCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *FirewallPoliciesRemoveRuleCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{firewallPolicy}/removeRule")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "firewallPolicy": c.firewallPolicy,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.firewallPolicies.removeRule" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *FirewallPoliciesRemoveRuleCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type FirewallPoliciesSetIamPolicyCall struct {
+ s *Service
+ resource string
+ globalorganizationsetpolicyrequest *GlobalOrganizationSetPolicyRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// SetIamPolicy: Sets the access control policy on the specified resource.
+// Replaces any existing policy.
+//
+// - resource: Name or id of the resource for this request.
+func (r *FirewallPoliciesService) SetIamPolicy(resource string, globalorganizationsetpolicyrequest *GlobalOrganizationSetPolicyRequest) *FirewallPoliciesSetIamPolicyCall {
+ c := &FirewallPoliciesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.resource = resource
+ c.globalorganizationsetpolicyrequest = globalorganizationsetpolicyrequest
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *FirewallPoliciesSetIamPolicyCall) Fields(s ...googleapi.Field) *FirewallPoliciesSetIamPolicyCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *FirewallPoliciesSetIamPolicyCall) Context(ctx context.Context) *FirewallPoliciesSetIamPolicyCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *FirewallPoliciesSetIamPolicyCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *FirewallPoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalorganizationsetpolicyrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{resource}/setIamPolicy")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "resource": c.resource,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.firewallPolicies.setIamPolicy" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Policy.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 *FirewallPoliciesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Policy{
+ 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
+}
+
+type FirewallPoliciesTestIamPermissionsCall struct {
+ s *Service
+ resource string
+ testpermissionsrequest *TestPermissionsRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// TestIamPermissions: Returns permissions that a caller has on the specified
+// resource.
+//
+// - resource: Name or id of the resource for this request.
+func (r *FirewallPoliciesService) TestIamPermissions(resource string, testpermissionsrequest *TestPermissionsRequest) *FirewallPoliciesTestIamPermissionsCall {
+ c := &FirewallPoliciesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.resource = resource
+ c.testpermissionsrequest = testpermissionsrequest
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *FirewallPoliciesTestIamPermissionsCall) Fields(s ...googleapi.Field) *FirewallPoliciesTestIamPermissionsCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *FirewallPoliciesTestIamPermissionsCall) Context(ctx context.Context) *FirewallPoliciesTestIamPermissionsCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *FirewallPoliciesTestIamPermissionsCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *FirewallPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/firewallPolicies/{resource}/testIamPermissions")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "resource": c.resource,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.firewallPolicies.testIamPermissions" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *TestPermissionsResponse.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 *FirewallPoliciesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &TestPermissionsResponse{
+ 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
+}
+
+type FirewallsDeleteCall struct {
+ s *Service
+ project string
+ firewall string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Delete: Deletes the specified firewall.
+//
+// - firewall: Name of the firewall rule to delete.
+// - project: Project ID for this request.
+func (r *FirewallsService) Delete(project string, firewall string) *FirewallsDeleteCall {
+ c := &FirewallsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.firewall = firewall
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *FirewallsDeleteCall) RequestId(requestId string) *FirewallsDeleteCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *FirewallsDeleteCall) Fields(s ...googleapi.Field) *FirewallsDeleteCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *FirewallsDeleteCall) Context(ctx context.Context) *FirewallsDeleteCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *FirewallsDeleteCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *FirewallsDeleteCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewalls/{firewall}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("DELETE", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "firewall": c.firewall,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.firewalls.delete" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *FirewallsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type FirewallsGetCall struct {
+ s *Service
+ project string
+ firewall string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Get: Returns the specified firewall.
+//
+// - firewall: Name of the firewall rule to return.
+// - project: Project ID for this request.
+func (r *FirewallsService) Get(project string, firewall string) *FirewallsGetCall {
+ c := &FirewallsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.firewall = firewall
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *FirewallsGetCall) Fields(s ...googleapi.Field) *FirewallsGetCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *FirewallsGetCall) IfNoneMatch(entityTag string) *FirewallsGetCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *FirewallsGetCall) Context(ctx context.Context) *FirewallsGetCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *FirewallsGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *FirewallsGetCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/global/firewalls/{firewall}")
+ 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{
+ "project": c.project,
+ "firewall": c.firewall,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.firewalls.get" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Firewall.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 *FirewallsGetCall) Do(opts ...googleapi.CallOption) (*Firewall, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Firewall{
+ 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
+}
+
+type FirewallsInsertCall struct {
+ s *Service
+ project string
+ firewall *Firewall
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Insert: Creates a firewall rule in the specified project using the data
+// included in the request.
+//
+// - project: Project ID for this request.
+func (r *FirewallsService) Insert(project string, firewall *Firewall) *FirewallsInsertCall {
+ c := &FirewallsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.firewall = firewall
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *FirewallsInsertCall) RequestId(requestId string) *FirewallsInsertCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *FirewallsInsertCall) Fields(s ...googleapi.Field) *FirewallsInsertCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *FirewallsInsertCall) Context(ctx context.Context) *FirewallsInsertCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *FirewallsInsertCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *FirewallsInsertCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewalls")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.firewalls.insert" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *FirewallsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type FirewallsListCall struct {
+ s *Service
+ project string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// List: Retrieves the list of firewall rules available to the specified
+// project.
+//
+// - project: Project ID for this request.
+func (r *FirewallsService) List(project string) *FirewallsListCall {
+ c := &FirewallsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ return c
+}
+
+// Filter sets the optional parameter "filter": A filter expression that
+// filters resources listed in the response. Most Compute resources support two
+// types of filter expressions: expressions that support regular expressions
+// and expressions that follow API improvement proposal AIP-160. These two
+// types of filter expressions cannot be mixed in one request. If you want to
+// use AIP-160, your expression must specify the field name, an operator, and
+// the value that you want to use for filtering. The value must be a string, a
+// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
+// `>=` or `:`. For example, if you are filtering Compute Engine instances, you
+// can exclude instances named `example-instance` by specifying `name !=
+// example-instance`. The `:*` comparison can be used to test whether a key has
+// been defined. For example, to find all objects with `owner` label use: ```
+// labels.owner:* ``` You can also filter nested fields. For example, you could
+// specify `scheduling.automaticRestart = false` to include instances only if
+// they are not scheduled for automatic restarts. You can use filtering on
+// nested fields to filter based on resource labels. To filter on multiple
+// expressions, provide each separate expression within parentheses. For
+// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel
+// Skylake") ``` By default, each expression is an `AND` expression. However,
+// you can include `AND` and `OR` expressions explicitly. For example: ```
+// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND
+// (scheduling.automaticRestart = true) ``` If you want to use a regular
+// expression, use the `eq` (equal) or `ne` (not equal) operator against a
+// single un-parenthesized expression with or without quotes or against
+// multiple parenthesized expressions. Examples: `fieldname eq unquoted
+// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted
+// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal
+// value is interpreted as a regular expression using Google RE2 library
+// syntax. The literal value must match the entire field. For example, to
+// filter for instances that do not end with name "instance", you would use
+// `name ne .*instance`. You cannot combine constraints on multiple fields
+// using regular expressions.
+func (c *FirewallsListCall) Filter(filter string) *FirewallsListCall {
+ c.urlParams_.Set("filter", filter)
+ return c
+}
+
+// MaxResults sets the optional parameter "maxResults": The maximum number of
+// results per page that should be returned. If the number of available results
+// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that
+// can be used to get the next page of results in subsequent list requests.
+// Acceptable values are `0` to `500`, inclusive. (Default: `500`)
+func (c *FirewallsListCall) MaxResults(maxResults int64) *FirewallsListCall {
+ c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
+ return c
+}
+
+// OrderBy sets the optional parameter "orderBy": Sorts list results by a
+// certain order. By default, results are returned in alphanumerical order
+// based on the resource name. You can also sort results in descending order
+// based on the creation timestamp using `orderBy="creationTimestamp desc".
+// This sorts results based on the `creationTimestamp` field in reverse
+// chronological order (newest result first). Use this to sort resources like
+// operations so that the newest operation is returned first. Currently, only
+// sorting by `name` or `creationTimestamp desc` is supported.
+func (c *FirewallsListCall) OrderBy(orderBy string) *FirewallsListCall {
+ c.urlParams_.Set("orderBy", orderBy)
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": Specifies a page token to
+// use. Set `pageToken` to the `nextPageToken` returned by a previous list
+// request to get the next page of results.
+func (c *FirewallsListCall) PageToken(pageToken string) *FirewallsListCall {
+ c.urlParams_.Set("pageToken", pageToken)
+ return c
+}
+
+// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
+// Opt-in for partial success behavior which provides partial results in case
+// of failure. The default value is false. For example, when partial success
+// behavior is enabled, aggregatedList for a single zone scope either returns
+// all resources in the zone or no resources, with an error code.
+func (c *FirewallsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *FirewallsListCall {
+ c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *FirewallsListCall) Fields(s ...googleapi.Field) *FirewallsListCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *FirewallsListCall) IfNoneMatch(entityTag string) *FirewallsListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *FirewallsListCall) Context(ctx context.Context) *FirewallsListCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *FirewallsListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *FirewallsListCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/global/firewalls")
+ 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{
+ "project": c.project,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.firewalls.list" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *FirewallList.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 *FirewallsListCall) Do(opts ...googleapi.CallOption) (*FirewallList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &FirewallList{
+ 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
+}
+
+// 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 *FirewallsListCall) Pages(ctx context.Context, f func(*FirewallList) error) error {
+ c.ctx_ = ctx
+ defer c.PageToken(c.urlParams_.Get("pageToken"))
+ 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)
+ }
+}
+
+type FirewallsPatchCall struct {
+ s *Service
+ project string
+ firewall string
+ firewall2 *Firewall
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Patch: Updates the specified firewall rule with the data included in the
+// request. This method supports PATCH semantics and uses the JSON merge patch
+// format and processing rules.
+//
+// - firewall: Name of the firewall rule to patch.
+// - project: Project ID for this request.
+func (r *FirewallsService) Patch(project string, firewall string, firewall2 *Firewall) *FirewallsPatchCall {
+ c := &FirewallsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.firewall = firewall
+ c.firewall2 = firewall2
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *FirewallsPatchCall) RequestId(requestId string) *FirewallsPatchCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *FirewallsPatchCall) Fields(s ...googleapi.Field) *FirewallsPatchCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *FirewallsPatchCall) Context(ctx context.Context) *FirewallsPatchCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *FirewallsPatchCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *FirewallsPatchCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewalls/{firewall}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("PATCH", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "firewall": c.firewall,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.firewalls.patch" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *FirewallsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type FirewallsUpdateCall struct {
+ s *Service
+ project string
+ firewall string
+ firewall2 *Firewall
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Update: Updates the specified firewall rule with the data included in the
+// request. Note that all fields will be updated if using PUT, even fields that
+// are not specified. To update individual fields, please use PATCH instead.
+//
+// - firewall: Name of the firewall rule to update.
+// - project: Project ID for this request.
+func (r *FirewallsService) Update(project string, firewall string, firewall2 *Firewall) *FirewallsUpdateCall {
+ c := &FirewallsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.firewall = firewall
+ c.firewall2 = firewall2
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *FirewallsUpdateCall) RequestId(requestId string) *FirewallsUpdateCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *FirewallsUpdateCall) Fields(s ...googleapi.Field) *FirewallsUpdateCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *FirewallsUpdateCall) Context(ctx context.Context) *FirewallsUpdateCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *FirewallsUpdateCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *FirewallsUpdateCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewalls/{firewall}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("PUT", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "firewall": c.firewall,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.firewalls.update" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *FirewallsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type ForwardingRulesAggregatedListCall struct {
+ s *Service
+ project string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// AggregatedList: Retrieves an aggregated list of forwarding rules. To prevent
+// failure, Google recommends that you set the `returnPartialSuccess` parameter
+// to `true`.
+//
+// - project: Project ID for this request.
+func (r *ForwardingRulesService) AggregatedList(project string) *ForwardingRulesAggregatedListCall {
+ c := &ForwardingRulesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ return c
+}
+
+// Filter sets the optional parameter "filter": A filter expression that
+// filters resources listed in the response. Most Compute resources support two
+// types of filter expressions: expressions that support regular expressions
+// and expressions that follow API improvement proposal AIP-160. These two
+// types of filter expressions cannot be mixed in one request. If you want to
+// use AIP-160, your expression must specify the field name, an operator, and
+// the value that you want to use for filtering. The value must be a string, a
+// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
+// `>=` or `:`. For example, if you are filtering Compute Engine instances, you
+// can exclude instances named `example-instance` by specifying `name !=
+// example-instance`. The `:*` comparison can be used to test whether a key has
+// been defined. For example, to find all objects with `owner` label use: ```
+// labels.owner:* ``` You can also filter nested fields. For example, you could
+// specify `scheduling.automaticRestart = false` to include instances only if
+// they are not scheduled for automatic restarts. You can use filtering on
+// nested fields to filter based on resource labels. To filter on multiple
+// expressions, provide each separate expression within parentheses. For
+// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel
+// Skylake") ``` By default, each expression is an `AND` expression. However,
+// you can include `AND` and `OR` expressions explicitly. For example: ```
+// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND
+// (scheduling.automaticRestart = true) ``` If you want to use a regular
+// expression, use the `eq` (equal) or `ne` (not equal) operator against a
+// single un-parenthesized expression with or without quotes or against
+// multiple parenthesized expressions. Examples: `fieldname eq unquoted
+// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted
+// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal
+// value is interpreted as a regular expression using Google RE2 library
+// syntax. The literal value must match the entire field. For example, to
+// filter for instances that do not end with name "instance", you would use
+// `name ne .*instance`. You cannot combine constraints on multiple fields
+// using regular expressions.
+func (c *ForwardingRulesAggregatedListCall) Filter(filter string) *ForwardingRulesAggregatedListCall {
+ c.urlParams_.Set("filter", filter)
+ return c
+}
+
+// IncludeAllScopes sets the optional parameter "includeAllScopes": Indicates
+// whether every visible scope for each scope type (zone, region, global)
+// should be included in the response. For new resource types added after this
+// field, the flag has no effect as new resource types will always include
+// every visible scope for each scope type in response. For resource types
+// which predate this field, if this flag is omitted or false, only scopes of
+// the scope types where the resource type is expected to be found will be
+// included.
+func (c *ForwardingRulesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *ForwardingRulesAggregatedListCall {
+ c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
+ return c
+}
+
+// MaxResults sets the optional parameter "maxResults": The maximum number of
+// results per page that should be returned. If the number of available results
+// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that
+// can be used to get the next page of results in subsequent list requests.
+// Acceptable values are `0` to `500`, inclusive. (Default: `500`)
+func (c *ForwardingRulesAggregatedListCall) MaxResults(maxResults int64) *ForwardingRulesAggregatedListCall {
+ c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
+ return c
+}
+
+// OrderBy sets the optional parameter "orderBy": Sorts list results by a
+// certain order. By default, results are returned in alphanumerical order
+// based on the resource name. You can also sort results in descending order
+// based on the creation timestamp using `orderBy="creationTimestamp desc".
+// This sorts results based on the `creationTimestamp` field in reverse
+// chronological order (newest result first). Use this to sort resources like
+// operations so that the newest operation is returned first. Currently, only
+// sorting by `name` or `creationTimestamp desc` is supported.
+func (c *ForwardingRulesAggregatedListCall) OrderBy(orderBy string) *ForwardingRulesAggregatedListCall {
+ c.urlParams_.Set("orderBy", orderBy)
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": Specifies a page token to
+// use. Set `pageToken` to the `nextPageToken` returned by a previous list
+// request to get the next page of results.
+func (c *ForwardingRulesAggregatedListCall) PageToken(pageToken string) *ForwardingRulesAggregatedListCall {
+ c.urlParams_.Set("pageToken", pageToken)
+ return c
+}
+
+// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
+// Opt-in for partial success behavior which provides partial results in case
+// of failure. The default value is false. For example, when partial success
+// behavior is enabled, aggregatedList for a single zone scope either returns
+// all resources in the zone or no resources, with an error code.
+func (c *ForwardingRulesAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ForwardingRulesAggregatedListCall {
+ c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
+ return c
+}
+
+// ServiceProjectNumber sets the optional parameter "serviceProjectNumber": The
+// Shared VPC service project id or service project number for which aggregated
+// list request is invoked for subnetworks list-usable api.
+func (c *ForwardingRulesAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *ForwardingRulesAggregatedListCall {
+ c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *ForwardingRulesAggregatedListCall) Fields(s ...googleapi.Field) *ForwardingRulesAggregatedListCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *ForwardingRulesAggregatedListCall) IfNoneMatch(entityTag string) *ForwardingRulesAggregatedListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *ForwardingRulesAggregatedListCall) Context(ctx context.Context) *ForwardingRulesAggregatedListCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *ForwardingRulesAggregatedListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ForwardingRulesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/aggregated/forwardingRules")
+ 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{
+ "project": c.project,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.forwardingRules.aggregatedList" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *ForwardingRuleAggregatedList.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 *ForwardingRulesAggregatedListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &ForwardingRuleAggregatedList{
+ 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
+}
+
+// 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 *ForwardingRulesAggregatedListCall) Pages(ctx context.Context, f func(*ForwardingRuleAggregatedList) error) error {
+ c.ctx_ = ctx
+ defer c.PageToken(c.urlParams_.Get("pageToken"))
+ 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)
+ }
+}
+
+type ForwardingRulesDeleteCall struct {
+ s *Service
+ project string
+ region string
+ forwardingRule string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Delete: Deletes the specified ForwardingRule resource.
+//
+// - forwardingRule: Name of the ForwardingRule resource to delete.
+// - project: Project ID for this request.
+// - region: Name of the region scoping this request.
+func (r *ForwardingRulesService) Delete(project string, region string, forwardingRule string) *ForwardingRulesDeleteCall {
+ c := &ForwardingRulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.region = region
+ c.forwardingRule = forwardingRule
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *ForwardingRulesDeleteCall) RequestId(requestId string) *ForwardingRulesDeleteCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *ForwardingRulesDeleteCall) Fields(s ...googleapi.Field) *ForwardingRulesDeleteCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *ForwardingRulesDeleteCall) Context(ctx context.Context) *ForwardingRulesDeleteCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *ForwardingRulesDeleteCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/forwardingRules/{forwardingRule}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("DELETE", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "region": c.region,
+ "forwardingRule": c.forwardingRule,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.forwardingRules.delete" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *ForwardingRulesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type ForwardingRulesGetCall struct {
+ s *Service
+ project string
+ region string
+ forwardingRule string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Get: Returns the specified ForwardingRule resource.
+//
+// - forwardingRule: Name of the ForwardingRule resource to return.
+// - project: Project ID for this request.
+// - region: Name of the region scoping this request.
+func (r *ForwardingRulesService) Get(project string, region string, forwardingRule string) *ForwardingRulesGetCall {
+ c := &ForwardingRulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.region = region
+ c.forwardingRule = forwardingRule
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *ForwardingRulesGetCall) Fields(s ...googleapi.Field) *ForwardingRulesGetCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *ForwardingRulesGetCall) IfNoneMatch(entityTag string) *ForwardingRulesGetCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *ForwardingRulesGetCall) Context(ctx context.Context) *ForwardingRulesGetCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *ForwardingRulesGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/regions/{region}/forwardingRules/{forwardingRule}")
+ 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{
+ "project": c.project,
+ "region": c.region,
+ "forwardingRule": c.forwardingRule,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.forwardingRules.get" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *ForwardingRule.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 *ForwardingRulesGetCall) Do(opts ...googleapi.CallOption) (*ForwardingRule, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &ForwardingRule{
+ 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
+}
+
+type ForwardingRulesInsertCall struct {
+ s *Service
+ project string
+ region string
+ forwardingrule *ForwardingRule
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Insert: Creates a ForwardingRule resource in the specified project and
+// region using the data included in the request.
+//
+// - project: Project ID for this request.
+// - region: Name of the region scoping this request.
+func (r *ForwardingRulesService) Insert(project string, region string, forwardingrule *ForwardingRule) *ForwardingRulesInsertCall {
+ c := &ForwardingRulesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.region = region
+ c.forwardingrule = forwardingrule
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *ForwardingRulesInsertCall) RequestId(requestId string) *ForwardingRulesInsertCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *ForwardingRulesInsertCall) Fields(s ...googleapi.Field) *ForwardingRulesInsertCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *ForwardingRulesInsertCall) Context(ctx context.Context) *ForwardingRulesInsertCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *ForwardingRulesInsertCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ForwardingRulesInsertCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/forwardingRules")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "region": c.region,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.forwardingRules.insert" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *ForwardingRulesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type ForwardingRulesListCall struct {
+ s *Service
+ project string
+ region string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// List: Retrieves a list of ForwardingRule resources available to the
+// specified project and region.
+//
+// - project: Project ID for this request.
+// - region: Name of the region scoping this request.
+func (r *ForwardingRulesService) List(project string, region string) *ForwardingRulesListCall {
+ c := &ForwardingRulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.region = region
+ return c
+}
+
+// Filter sets the optional parameter "filter": A filter expression that
+// filters resources listed in the response. Most Compute resources support two
+// types of filter expressions: expressions that support regular expressions
+// and expressions that follow API improvement proposal AIP-160. These two
+// types of filter expressions cannot be mixed in one request. If you want to
+// use AIP-160, your expression must specify the field name, an operator, and
+// the value that you want to use for filtering. The value must be a string, a
+// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
+// `>=` or `:`. For example, if you are filtering Compute Engine instances, you
+// can exclude instances named `example-instance` by specifying `name !=
+// example-instance`. The `:*` comparison can be used to test whether a key has
+// been defined. For example, to find all objects with `owner` label use: ```
+// labels.owner:* ``` You can also filter nested fields. For example, you could
+// specify `scheduling.automaticRestart = false` to include instances only if
+// they are not scheduled for automatic restarts. You can use filtering on
+// nested fields to filter based on resource labels. To filter on multiple
+// expressions, provide each separate expression within parentheses. For
+// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel
+// Skylake") ``` By default, each expression is an `AND` expression. However,
+// you can include `AND` and `OR` expressions explicitly. For example: ```
+// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND
+// (scheduling.automaticRestart = true) ``` If you want to use a regular
+// expression, use the `eq` (equal) or `ne` (not equal) operator against a
+// single un-parenthesized expression with or without quotes or against
+// multiple parenthesized expressions. Examples: `fieldname eq unquoted
+// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted
+// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal
+// value is interpreted as a regular expression using Google RE2 library
+// syntax. The literal value must match the entire field. For example, to
+// filter for instances that do not end with name "instance", you would use
+// `name ne .*instance`. You cannot combine constraints on multiple fields
+// using regular expressions.
+func (c *ForwardingRulesListCall) Filter(filter string) *ForwardingRulesListCall {
+ c.urlParams_.Set("filter", filter)
+ return c
+}
+
+// MaxResults sets the optional parameter "maxResults": The maximum number of
+// results per page that should be returned. If the number of available results
+// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that
+// can be used to get the next page of results in subsequent list requests.
+// Acceptable values are `0` to `500`, inclusive. (Default: `500`)
+func (c *ForwardingRulesListCall) MaxResults(maxResults int64) *ForwardingRulesListCall {
+ c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
+ return c
+}
+
+// OrderBy sets the optional parameter "orderBy": Sorts list results by a
+// certain order. By default, results are returned in alphanumerical order
+// based on the resource name. You can also sort results in descending order
+// based on the creation timestamp using `orderBy="creationTimestamp desc".
+// This sorts results based on the `creationTimestamp` field in reverse
+// chronological order (newest result first). Use this to sort resources like
+// operations so that the newest operation is returned first. Currently, only
+// sorting by `name` or `creationTimestamp desc` is supported.
+func (c *ForwardingRulesListCall) OrderBy(orderBy string) *ForwardingRulesListCall {
+ c.urlParams_.Set("orderBy", orderBy)
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": Specifies a page token to
+// use. Set `pageToken` to the `nextPageToken` returned by a previous list
+// request to get the next page of results.
+func (c *ForwardingRulesListCall) PageToken(pageToken string) *ForwardingRulesListCall {
+ c.urlParams_.Set("pageToken", pageToken)
+ return c
+}
+
+// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
+// Opt-in for partial success behavior which provides partial results in case
+// of failure. The default value is false. For example, when partial success
+// behavior is enabled, aggregatedList for a single zone scope either returns
+// all resources in the zone or no resources, with an error code.
+func (c *ForwardingRulesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ForwardingRulesListCall {
+ c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *ForwardingRulesListCall) Fields(s ...googleapi.Field) *ForwardingRulesListCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *ForwardingRulesListCall) IfNoneMatch(entityTag string) *ForwardingRulesListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *ForwardingRulesListCall) Context(ctx context.Context) *ForwardingRulesListCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *ForwardingRulesListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ForwardingRulesListCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/regions/{region}/forwardingRules")
+ 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{
+ "project": c.project,
+ "region": c.region,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.forwardingRules.list" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *ForwardingRuleList.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 *ForwardingRulesListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &ForwardingRuleList{
+ 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
+}
+
+// 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 *ForwardingRulesListCall) Pages(ctx context.Context, f func(*ForwardingRuleList) error) error {
+ c.ctx_ = ctx
+ defer c.PageToken(c.urlParams_.Get("pageToken"))
+ 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)
+ }
+}
+
+type ForwardingRulesPatchCall struct {
+ s *Service
+ project string
+ region string
+ forwardingRule string
+ forwardingrule *ForwardingRule
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Patch: Updates the specified forwarding rule with the data included in the
+// request. This method supports PATCH semantics and uses the JSON merge patch
+// format and processing rules. Currently, you can only patch the network_tier
+// field.
+//
+// - forwardingRule: Name of the ForwardingRule resource to patch.
+// - project: Project ID for this request.
+// - region: Name of the region scoping this request.
+func (r *ForwardingRulesService) Patch(project string, region string, forwardingRule string, forwardingrule *ForwardingRule) *ForwardingRulesPatchCall {
+ c := &ForwardingRulesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.region = region
+ c.forwardingRule = forwardingRule
+ c.forwardingrule = forwardingrule
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *ForwardingRulesPatchCall) RequestId(requestId string) *ForwardingRulesPatchCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *ForwardingRulesPatchCall) Fields(s ...googleapi.Field) *ForwardingRulesPatchCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *ForwardingRulesPatchCall) Context(ctx context.Context) *ForwardingRulesPatchCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *ForwardingRulesPatchCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ForwardingRulesPatchCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/forwardingRules/{forwardingRule}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("PATCH", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "region": c.region,
+ "forwardingRule": c.forwardingRule,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.forwardingRules.patch" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *ForwardingRulesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type ForwardingRulesSetLabelsCall struct {
+ s *Service
+ project string
+ region string
+ resource string
+ regionsetlabelsrequest *RegionSetLabelsRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// SetLabels: Sets the labels on the specified resource. To learn more about
+// labels, read the Labeling Resources documentation.
+//
+// - project: Project ID for this request.
+// - region: The region for this request.
+// - resource: Name or id of the resource for this request.
+func (r *ForwardingRulesService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *ForwardingRulesSetLabelsCall {
+ c := &ForwardingRulesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.region = region
+ c.resource = resource
+ c.regionsetlabelsrequest = regionsetlabelsrequest
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *ForwardingRulesSetLabelsCall) RequestId(requestId string) *ForwardingRulesSetLabelsCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *ForwardingRulesSetLabelsCall) Fields(s ...googleapi.Field) *ForwardingRulesSetLabelsCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *ForwardingRulesSetLabelsCall) Context(ctx context.Context) *ForwardingRulesSetLabelsCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *ForwardingRulesSetLabelsCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ForwardingRulesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/forwardingRules/{resource}/setLabels")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "region": c.region,
+ "resource": c.resource,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.forwardingRules.setLabels" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *ForwardingRulesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type ForwardingRulesSetTargetCall struct {
+ s *Service
+ project string
+ region string
+ forwardingRule string
+ targetreference *TargetReference
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// SetTarget: Changes target URL for forwarding rule. The new target should be
+// of the same type as the old target.
+//
+// - forwardingRule: Name of the ForwardingRule resource in which target is to
+// be set.
+// - project: Project ID for this request.
+// - region: Name of the region scoping this request.
+func (r *ForwardingRulesService) SetTarget(project string, region string, forwardingRule string, targetreference *TargetReference) *ForwardingRulesSetTargetCall {
+ c := &ForwardingRulesSetTargetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.region = region
+ c.forwardingRule = forwardingRule
+ c.targetreference = targetreference
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *ForwardingRulesSetTargetCall) RequestId(requestId string) *ForwardingRulesSetTargetCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *ForwardingRulesSetTargetCall) Fields(s ...googleapi.Field) *ForwardingRulesSetTargetCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *ForwardingRulesSetTargetCall) Context(ctx context.Context) *ForwardingRulesSetTargetCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *ForwardingRulesSetTargetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "region": c.region,
+ "forwardingRule": c.forwardingRule,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.forwardingRules.setTarget" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *ForwardingRulesSetTargetCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type GlobalAddressesDeleteCall struct {
+ s *Service
+ project string
+ address string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Delete: Deletes the specified address resource.
+//
+// - address: Name of the address resource to delete.
+// - project: Project ID for this request.
+func (r *GlobalAddressesService) Delete(project string, address string) *GlobalAddressesDeleteCall {
+ c := &GlobalAddressesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.address = address
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *GlobalAddressesDeleteCall) RequestId(requestId string) *GlobalAddressesDeleteCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *GlobalAddressesDeleteCall) Fields(s ...googleapi.Field) *GlobalAddressesDeleteCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *GlobalAddressesDeleteCall) Context(ctx context.Context) *GlobalAddressesDeleteCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *GlobalAddressesDeleteCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *GlobalAddressesDeleteCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/addresses/{address}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("DELETE", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "address": c.address,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.globalAddresses.delete" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *GlobalAddressesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type GlobalAddressesGetCall struct {
+ s *Service
+ project string
+ address string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Get: Returns the specified address resource.
+//
+// - address: Name of the address resource to return.
+// - project: Project ID for this request.
+func (r *GlobalAddressesService) Get(project string, address string) *GlobalAddressesGetCall {
+ c := &GlobalAddressesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.address = address
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *GlobalAddressesGetCall) Fields(s ...googleapi.Field) *GlobalAddressesGetCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *GlobalAddressesGetCall) IfNoneMatch(entityTag string) *GlobalAddressesGetCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *GlobalAddressesGetCall) Context(ctx context.Context) *GlobalAddressesGetCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *GlobalAddressesGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *GlobalAddressesGetCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/global/addresses/{address}")
+ 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{
+ "project": c.project,
+ "address": c.address,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.globalAddresses.get" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Address.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 *GlobalAddressesGetCall) Do(opts ...googleapi.CallOption) (*Address, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Address{
+ 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
+}
+
+type GlobalAddressesInsertCall struct {
+ s *Service
+ project string
+ address *Address
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Insert: Creates an address resource in the specified project by using the
+// data included in the request.
+//
+// - project: Project ID for this request.
+func (r *GlobalAddressesService) Insert(project string, address *Address) *GlobalAddressesInsertCall {
+ c := &GlobalAddressesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.address = address
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *GlobalAddressesInsertCall) RequestId(requestId string) *GlobalAddressesInsertCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *GlobalAddressesInsertCall) Fields(s ...googleapi.Field) *GlobalAddressesInsertCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *GlobalAddressesInsertCall) Context(ctx context.Context) *GlobalAddressesInsertCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *GlobalAddressesInsertCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *GlobalAddressesInsertCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.address)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/addresses")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.globalAddresses.insert" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *GlobalAddressesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type GlobalAddressesListCall struct {
+ s *Service
+ project string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// List: Retrieves a list of global addresses.
+//
+// - project: Project ID for this request.
+func (r *GlobalAddressesService) List(project string) *GlobalAddressesListCall {
+ c := &GlobalAddressesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ return c
+}
+
+// Filter sets the optional parameter "filter": A filter expression that
+// filters resources listed in the response. Most Compute resources support two
+// types of filter expressions: expressions that support regular expressions
+// and expressions that follow API improvement proposal AIP-160. These two
+// types of filter expressions cannot be mixed in one request. If you want to
+// use AIP-160, your expression must specify the field name, an operator, and
+// the value that you want to use for filtering. The value must be a string, a
+// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
+// `>=` or `:`. For example, if you are filtering Compute Engine instances, you
+// can exclude instances named `example-instance` by specifying `name !=
+// example-instance`. The `:*` comparison can be used to test whether a key has
+// been defined. For example, to find all objects with `owner` label use: ```
+// labels.owner:* ``` You can also filter nested fields. For example, you could
+// specify `scheduling.automaticRestart = false` to include instances only if
+// they are not scheduled for automatic restarts. You can use filtering on
+// nested fields to filter based on resource labels. To filter on multiple
+// expressions, provide each separate expression within parentheses. For
+// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel
+// Skylake") ``` By default, each expression is an `AND` expression. However,
+// you can include `AND` and `OR` expressions explicitly. For example: ```
+// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND
+// (scheduling.automaticRestart = true) ``` If you want to use a regular
+// expression, use the `eq` (equal) or `ne` (not equal) operator against a
+// single un-parenthesized expression with or without quotes or against
+// multiple parenthesized expressions. Examples: `fieldname eq unquoted
+// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted
+// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal
+// value is interpreted as a regular expression using Google RE2 library
+// syntax. The literal value must match the entire field. For example, to
+// filter for instances that do not end with name "instance", you would use
+// `name ne .*instance`. You cannot combine constraints on multiple fields
+// using regular expressions.
+func (c *GlobalAddressesListCall) Filter(filter string) *GlobalAddressesListCall {
+ c.urlParams_.Set("filter", filter)
+ return c
+}
+
+// MaxResults sets the optional parameter "maxResults": The maximum number of
+// results per page that should be returned. If the number of available results
+// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that
+// can be used to get the next page of results in subsequent list requests.
+// Acceptable values are `0` to `500`, inclusive. (Default: `500`)
+func (c *GlobalAddressesListCall) MaxResults(maxResults int64) *GlobalAddressesListCall {
+ c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
+ return c
+}
+
+// OrderBy sets the optional parameter "orderBy": Sorts list results by a
+// certain order. By default, results are returned in alphanumerical order
+// based on the resource name. You can also sort results in descending order
+// based on the creation timestamp using `orderBy="creationTimestamp desc".
+// This sorts results based on the `creationTimestamp` field in reverse
+// chronological order (newest result first). Use this to sort resources like
+// operations so that the newest operation is returned first. Currently, only
+// sorting by `name` or `creationTimestamp desc` is supported.
+func (c *GlobalAddressesListCall) OrderBy(orderBy string) *GlobalAddressesListCall {
+ c.urlParams_.Set("orderBy", orderBy)
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": Specifies a page token to
+// use. Set `pageToken` to the `nextPageToken` returned by a previous list
+// request to get the next page of results.
+func (c *GlobalAddressesListCall) PageToken(pageToken string) *GlobalAddressesListCall {
+ c.urlParams_.Set("pageToken", pageToken)
+ return c
+}
+
+// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
+// Opt-in for partial success behavior which provides partial results in case
+// of failure. The default value is false. For example, when partial success
+// behavior is enabled, aggregatedList for a single zone scope either returns
+// all resources in the zone or no resources, with an error code.
+func (c *GlobalAddressesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *GlobalAddressesListCall {
+ c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *GlobalAddressesListCall) Fields(s ...googleapi.Field) *GlobalAddressesListCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *GlobalAddressesListCall) IfNoneMatch(entityTag string) *GlobalAddressesListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *GlobalAddressesListCall) Context(ctx context.Context) *GlobalAddressesListCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *GlobalAddressesListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *GlobalAddressesListCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/global/addresses")
+ 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{
+ "project": c.project,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.globalAddresses.list" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *AddressList.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 *GlobalAddressesListCall) Do(opts ...googleapi.CallOption) (*AddressList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &AddressList{
+ 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
+}
+
+// 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 *GlobalAddressesListCall) Pages(ctx context.Context, f func(*AddressList) error) error {
+ c.ctx_ = ctx
+ defer c.PageToken(c.urlParams_.Get("pageToken"))
+ 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)
+ }
+}
+
+type GlobalAddressesMoveCall struct {
+ s *Service
+ project string
+ address string
+ globaladdressesmoverequest *GlobalAddressesMoveRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Move: Moves the specified address resource from one project to another
+// project.
+//
+// - address: Name of the address resource to move.
+// - project: Source project ID which the Address is moved from.
+func (r *GlobalAddressesService) Move(project string, address string, globaladdressesmoverequest *GlobalAddressesMoveRequest) *GlobalAddressesMoveCall {
+ c := &GlobalAddressesMoveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.address = address
+ c.globaladdressesmoverequest = globaladdressesmoverequest
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *GlobalAddressesMoveCall) RequestId(requestId string) *GlobalAddressesMoveCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *GlobalAddressesMoveCall) Fields(s ...googleapi.Field) *GlobalAddressesMoveCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *GlobalAddressesMoveCall) Context(ctx context.Context) *GlobalAddressesMoveCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *GlobalAddressesMoveCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *GlobalAddressesMoveCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.globaladdressesmoverequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/addresses/{address}/move")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "address": c.address,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.globalAddresses.move" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *GlobalAddressesMoveCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type GlobalAddressesSetLabelsCall struct {
+ s *Service
+ project string
+ resource string
+ globalsetlabelsrequest *GlobalSetLabelsRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// SetLabels: Sets the labels on a GlobalAddress. To learn more about labels,
+// read the Labeling Resources documentation.
+//
+// - project: Project ID for this request.
+// - resource: Name or id of the resource for this request.
+func (r *GlobalAddressesService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *GlobalAddressesSetLabelsCall {
+ c := &GlobalAddressesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.resource = resource
+ c.globalsetlabelsrequest = globalsetlabelsrequest
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *GlobalAddressesSetLabelsCall) Fields(s ...googleapi.Field) *GlobalAddressesSetLabelsCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *GlobalAddressesSetLabelsCall) Context(ctx context.Context) *GlobalAddressesSetLabelsCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *GlobalAddressesSetLabelsCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *GlobalAddressesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/addresses/{resource}/setLabels")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "resource": c.resource,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.globalAddresses.setLabels" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *GlobalAddressesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type GlobalForwardingRulesDeleteCall struct {
+ s *Service
+ project string
+ forwardingRule string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Delete: Deletes the specified GlobalForwardingRule resource.
+//
+// - forwardingRule: Name of the ForwardingRule resource to delete.
+// - project: Project ID for this request.
+func (r *GlobalForwardingRulesService) Delete(project string, forwardingRule string) *GlobalForwardingRulesDeleteCall {
+ c := &GlobalForwardingRulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.forwardingRule = forwardingRule
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *GlobalForwardingRulesDeleteCall) RequestId(requestId string) *GlobalForwardingRulesDeleteCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *GlobalForwardingRulesDeleteCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesDeleteCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *GlobalForwardingRulesDeleteCall) Context(ctx context.Context) *GlobalForwardingRulesDeleteCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *GlobalForwardingRulesDeleteCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *GlobalForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/forwardingRules/{forwardingRule}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("DELETE", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "forwardingRule": c.forwardingRule,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.globalForwardingRules.delete" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *GlobalForwardingRulesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type GlobalForwardingRulesGetCall struct {
+ s *Service
+ project string
+ forwardingRule string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Get: Returns the specified GlobalForwardingRule resource. Gets a list of
+// available forwarding rules by making a list() request.
+//
+// - forwardingRule: Name of the ForwardingRule resource to return.
+// - project: Project ID for this request.
+func (r *GlobalForwardingRulesService) Get(project string, forwardingRule string) *GlobalForwardingRulesGetCall {
+ c := &GlobalForwardingRulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.forwardingRule = forwardingRule
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *GlobalForwardingRulesGetCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesGetCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *GlobalForwardingRulesGetCall) IfNoneMatch(entityTag string) *GlobalForwardingRulesGetCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *GlobalForwardingRulesGetCall) Context(ctx context.Context) *GlobalForwardingRulesGetCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *GlobalForwardingRulesGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *GlobalForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/global/forwardingRules/{forwardingRule}")
+ 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{
+ "project": c.project,
+ "forwardingRule": c.forwardingRule,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.globalForwardingRules.get" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *ForwardingRule.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 *GlobalForwardingRulesGetCall) Do(opts ...googleapi.CallOption) (*ForwardingRule, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &ForwardingRule{
+ 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
+}
+
+type GlobalForwardingRulesInsertCall struct {
+ s *Service
+ project string
+ forwardingrule *ForwardingRule
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Insert: Creates a GlobalForwardingRule resource in the specified project
+// using the data included in the request.
+//
+// - project: Project ID for this request.
+func (r *GlobalForwardingRulesService) Insert(project string, forwardingrule *ForwardingRule) *GlobalForwardingRulesInsertCall {
+ c := &GlobalForwardingRulesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.forwardingrule = forwardingrule
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *GlobalForwardingRulesInsertCall) RequestId(requestId string) *GlobalForwardingRulesInsertCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *GlobalForwardingRulesInsertCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesInsertCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *GlobalForwardingRulesInsertCall) Context(ctx context.Context) *GlobalForwardingRulesInsertCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *GlobalForwardingRulesInsertCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *GlobalForwardingRulesInsertCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/forwardingRules")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.globalForwardingRules.insert" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *GlobalForwardingRulesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type GlobalForwardingRulesListCall struct {
+ s *Service
+ project string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// List: Retrieves a list of GlobalForwardingRule resources available to the
+// specified project.
+//
+// - project: Project ID for this request.
+func (r *GlobalForwardingRulesService) List(project string) *GlobalForwardingRulesListCall {
+ c := &GlobalForwardingRulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ return c
+}
+
+// Filter sets the optional parameter "filter": A filter expression that
+// filters resources listed in the response. Most Compute resources support two
+// types of filter expressions: expressions that support regular expressions
+// and expressions that follow API improvement proposal AIP-160. These two
+// types of filter expressions cannot be mixed in one request. If you want to
+// use AIP-160, your expression must specify the field name, an operator, and
+// the value that you want to use for filtering. The value must be a string, a
+// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
+// `>=` or `:`. For example, if you are filtering Compute Engine instances, you
+// can exclude instances named `example-instance` by specifying `name !=
+// example-instance`. The `:*` comparison can be used to test whether a key has
+// been defined. For example, to find all objects with `owner` label use: ```
+// labels.owner:* ``` You can also filter nested fields. For example, you could
+// specify `scheduling.automaticRestart = false` to include instances only if
+// they are not scheduled for automatic restarts. You can use filtering on
+// nested fields to filter based on resource labels. To filter on multiple
+// expressions, provide each separate expression within parentheses. For
+// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel
+// Skylake") ``` By default, each expression is an `AND` expression. However,
+// you can include `AND` and `OR` expressions explicitly. For example: ```
+// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND
+// (scheduling.automaticRestart = true) ``` If you want to use a regular
+// expression, use the `eq` (equal) or `ne` (not equal) operator against a
+// single un-parenthesized expression with or without quotes or against
+// multiple parenthesized expressions. Examples: `fieldname eq unquoted
+// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted
+// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal
+// value is interpreted as a regular expression using Google RE2 library
+// syntax. The literal value must match the entire field. For example, to
+// filter for instances that do not end with name "instance", you would use
+// `name ne .*instance`. You cannot combine constraints on multiple fields
+// using regular expressions.
+func (c *GlobalForwardingRulesListCall) Filter(filter string) *GlobalForwardingRulesListCall {
+ c.urlParams_.Set("filter", filter)
+ return c
+}
+
+// MaxResults sets the optional parameter "maxResults": The maximum number of
+// results per page that should be returned. If the number of available results
+// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that
+// can be used to get the next page of results in subsequent list requests.
+// Acceptable values are `0` to `500`, inclusive. (Default: `500`)
+func (c *GlobalForwardingRulesListCall) MaxResults(maxResults int64) *GlobalForwardingRulesListCall {
+ c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
+ return c
+}
+
+// OrderBy sets the optional parameter "orderBy": Sorts list results by a
+// certain order. By default, results are returned in alphanumerical order
+// based on the resource name. You can also sort results in descending order
+// based on the creation timestamp using `orderBy="creationTimestamp desc".
+// This sorts results based on the `creationTimestamp` field in reverse
+// chronological order (newest result first). Use this to sort resources like
+// operations so that the newest operation is returned first. Currently, only
+// sorting by `name` or `creationTimestamp desc` is supported.
+func (c *GlobalForwardingRulesListCall) OrderBy(orderBy string) *GlobalForwardingRulesListCall {
+ c.urlParams_.Set("orderBy", orderBy)
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": Specifies a page token to
+// use. Set `pageToken` to the `nextPageToken` returned by a previous list
+// request to get the next page of results.
+func (c *GlobalForwardingRulesListCall) PageToken(pageToken string) *GlobalForwardingRulesListCall {
+ c.urlParams_.Set("pageToken", pageToken)
+ return c
+}
+
+// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
+// Opt-in for partial success behavior which provides partial results in case
+// of failure. The default value is false. For example, when partial success
+// behavior is enabled, aggregatedList for a single zone scope either returns
+// all resources in the zone or no resources, with an error code.
+func (c *GlobalForwardingRulesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *GlobalForwardingRulesListCall {
+ c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *GlobalForwardingRulesListCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesListCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *GlobalForwardingRulesListCall) IfNoneMatch(entityTag string) *GlobalForwardingRulesListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *GlobalForwardingRulesListCall) Context(ctx context.Context) *GlobalForwardingRulesListCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *GlobalForwardingRulesListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *GlobalForwardingRulesListCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/global/forwardingRules")
+ 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{
+ "project": c.project,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.globalForwardingRules.list" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *ForwardingRuleList.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 *GlobalForwardingRulesListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &ForwardingRuleList{
+ 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
+}
+
+// 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 *GlobalForwardingRulesListCall) Pages(ctx context.Context, f func(*ForwardingRuleList) error) error {
+ c.ctx_ = ctx
+ defer c.PageToken(c.urlParams_.Get("pageToken"))
+ 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)
+ }
+}
+
+type GlobalForwardingRulesPatchCall struct {
+ s *Service
+ project string
+ forwardingRule string
+ forwardingrule *ForwardingRule
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Patch: Updates the specified forwarding rule with the data included in the
+// request. This method supports PATCH semantics and uses the JSON merge patch
+// format and processing rules. Currently, you can only patch the network_tier
+// field.
+//
+// - forwardingRule: Name of the ForwardingRule resource to patch.
+// - project: Project ID for this request.
+func (r *GlobalForwardingRulesService) Patch(project string, forwardingRule string, forwardingrule *ForwardingRule) *GlobalForwardingRulesPatchCall {
+ c := &GlobalForwardingRulesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.forwardingRule = forwardingRule
+ c.forwardingrule = forwardingrule
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *GlobalForwardingRulesPatchCall) RequestId(requestId string) *GlobalForwardingRulesPatchCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *GlobalForwardingRulesPatchCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesPatchCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *GlobalForwardingRulesPatchCall) Context(ctx context.Context) *GlobalForwardingRulesPatchCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *GlobalForwardingRulesPatchCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *GlobalForwardingRulesPatchCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/forwardingRules/{forwardingRule}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("PATCH", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "forwardingRule": c.forwardingRule,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.globalForwardingRules.patch" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *GlobalForwardingRulesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type GlobalForwardingRulesSetLabelsCall struct {
+ s *Service
+ project string
+ resource string
+ globalsetlabelsrequest *GlobalSetLabelsRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// SetLabels: Sets the labels on the specified resource. To learn more about
+// labels, read the Labeling resources documentation.
+//
+// - project: Project ID for this request.
+// - resource: Name or id of the resource for this request.
+func (r *GlobalForwardingRulesService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *GlobalForwardingRulesSetLabelsCall {
+ c := &GlobalForwardingRulesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.resource = resource
+ c.globalsetlabelsrequest = globalsetlabelsrequest
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *GlobalForwardingRulesSetLabelsCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesSetLabelsCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *GlobalForwardingRulesSetLabelsCall) Context(ctx context.Context) *GlobalForwardingRulesSetLabelsCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *GlobalForwardingRulesSetLabelsCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *GlobalForwardingRulesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/forwardingRules/{resource}/setLabels")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "resource": c.resource,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.globalForwardingRules.setLabels" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *GlobalForwardingRulesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type GlobalForwardingRulesSetTargetCall struct {
+ s *Service
+ project string
+ forwardingRule string
+ targetreference *TargetReference
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// SetTarget: Changes target URL for the GlobalForwardingRule resource. The new
+// target should be of the same type as the old target.
+//
+// - forwardingRule: Name of the ForwardingRule resource in which target is to
+// be set.
+// - project: Project ID for this request.
+func (r *GlobalForwardingRulesService) SetTarget(project string, forwardingRule string, targetreference *TargetReference) *GlobalForwardingRulesSetTargetCall {
+ c := &GlobalForwardingRulesSetTargetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.forwardingRule = forwardingRule
+ c.targetreference = targetreference
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *GlobalForwardingRulesSetTargetCall) RequestId(requestId string) *GlobalForwardingRulesSetTargetCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *GlobalForwardingRulesSetTargetCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesSetTargetCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *GlobalForwardingRulesSetTargetCall) Context(ctx context.Context) *GlobalForwardingRulesSetTargetCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *GlobalForwardingRulesSetTargetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *GlobalForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/forwardingRules/{forwardingRule}/setTarget")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "forwardingRule": c.forwardingRule,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.globalForwardingRules.setTarget" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *GlobalForwardingRulesSetTargetCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall struct {
+ s *Service
+ project string
+ networkEndpointGroup string
+ globalnetworkendpointgroupsattachendpointsrequest *GlobalNetworkEndpointGroupsAttachEndpointsRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// AttachNetworkEndpoints: Attach a network endpoint to the specified network
+// endpoint group.
+//
+// - networkEndpointGroup: The name of the network endpoint group where you are
+// attaching network endpoints to. It should comply with RFC1035.
+// - project: Project ID for this request.
+func (r *GlobalNetworkEndpointGroupsService) AttachNetworkEndpoints(project string, networkEndpointGroup string, globalnetworkendpointgroupsattachendpointsrequest *GlobalNetworkEndpointGroupsAttachEndpointsRequest) *GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall {
+ c := &GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.networkEndpointGroup = networkEndpointGroup
+ c.globalnetworkendpointgroupsattachendpointsrequest = globalnetworkendpointgroupsattachendpointsrequest
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall) RequestId(requestId string) *GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall) Fields(s ...googleapi.Field) *GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall) Context(ctx context.Context) *GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalnetworkendpointgroupsattachendpointsrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networkEndpointGroups/{networkEndpointGroup}/attachNetworkEndpoints")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "networkEndpointGroup": c.networkEndpointGroup,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.globalNetworkEndpointGroups.attachNetworkEndpoints" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *GlobalNetworkEndpointGroupsAttachNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type GlobalNetworkEndpointGroupsDeleteCall struct {
+ s *Service
+ project string
+ networkEndpointGroup string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Delete: Deletes the specified network endpoint group.Note that the NEG
+// cannot be deleted if there are backend services referencing it.
+//
+// - networkEndpointGroup: The name of the network endpoint group to delete. It
+// should comply with RFC1035.
+// - project: Project ID for this request.
+func (r *GlobalNetworkEndpointGroupsService) Delete(project string, networkEndpointGroup string) *GlobalNetworkEndpointGroupsDeleteCall {
+ c := &GlobalNetworkEndpointGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.networkEndpointGroup = networkEndpointGroup
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *GlobalNetworkEndpointGroupsDeleteCall) RequestId(requestId string) *GlobalNetworkEndpointGroupsDeleteCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *GlobalNetworkEndpointGroupsDeleteCall) Fields(s ...googleapi.Field) *GlobalNetworkEndpointGroupsDeleteCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *GlobalNetworkEndpointGroupsDeleteCall) Context(ctx context.Context) *GlobalNetworkEndpointGroupsDeleteCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *GlobalNetworkEndpointGroupsDeleteCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *GlobalNetworkEndpointGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networkEndpointGroups/{networkEndpointGroup}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("DELETE", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "networkEndpointGroup": c.networkEndpointGroup,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.globalNetworkEndpointGroups.delete" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *GlobalNetworkEndpointGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall struct {
+ s *Service
+ project string
+ networkEndpointGroup string
+ globalnetworkendpointgroupsdetachendpointsrequest *GlobalNetworkEndpointGroupsDetachEndpointsRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// DetachNetworkEndpoints: Detach the network endpoint from the specified
+// network endpoint group.
+//
+// - networkEndpointGroup: The name of the network endpoint group where you are
+// removing network endpoints. It should comply with RFC1035.
+// - project: Project ID for this request.
+func (r *GlobalNetworkEndpointGroupsService) DetachNetworkEndpoints(project string, networkEndpointGroup string, globalnetworkendpointgroupsdetachendpointsrequest *GlobalNetworkEndpointGroupsDetachEndpointsRequest) *GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall {
+ c := &GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.networkEndpointGroup = networkEndpointGroup
+ c.globalnetworkendpointgroupsdetachendpointsrequest = globalnetworkendpointgroupsdetachendpointsrequest
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall) RequestId(requestId string) *GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall) Fields(s ...googleapi.Field) *GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall) Context(ctx context.Context) *GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalnetworkendpointgroupsdetachendpointsrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networkEndpointGroups/{networkEndpointGroup}/detachNetworkEndpoints")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "networkEndpointGroup": c.networkEndpointGroup,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.globalNetworkEndpointGroups.detachNetworkEndpoints" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *GlobalNetworkEndpointGroupsDetachNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type GlobalNetworkEndpointGroupsGetCall struct {
+ s *Service
+ project string
+ networkEndpointGroup string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Get: Returns the specified network endpoint group.
+//
+// - networkEndpointGroup: The name of the network endpoint group. It should
+// comply with RFC1035.
+// - project: Project ID for this request.
+func (r *GlobalNetworkEndpointGroupsService) Get(project string, networkEndpointGroup string) *GlobalNetworkEndpointGroupsGetCall {
+ c := &GlobalNetworkEndpointGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.networkEndpointGroup = networkEndpointGroup
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *GlobalNetworkEndpointGroupsGetCall) Fields(s ...googleapi.Field) *GlobalNetworkEndpointGroupsGetCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *GlobalNetworkEndpointGroupsGetCall) IfNoneMatch(entityTag string) *GlobalNetworkEndpointGroupsGetCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *GlobalNetworkEndpointGroupsGetCall) Context(ctx context.Context) *GlobalNetworkEndpointGroupsGetCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *GlobalNetworkEndpointGroupsGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *GlobalNetworkEndpointGroupsGetCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/global/networkEndpointGroups/{networkEndpointGroup}")
+ 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{
+ "project": c.project,
+ "networkEndpointGroup": c.networkEndpointGroup,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.globalNetworkEndpointGroups.get" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *NetworkEndpointGroup.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 *GlobalNetworkEndpointGroupsGetCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroup, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &NetworkEndpointGroup{
+ 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
+}
+
+type GlobalNetworkEndpointGroupsInsertCall struct {
+ s *Service
+ project string
+ networkendpointgroup *NetworkEndpointGroup
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Insert: Creates a network endpoint group in the specified project using the
+// parameters that are included in the request.
+//
+// - project: Project ID for this request.
+func (r *GlobalNetworkEndpointGroupsService) Insert(project string, networkendpointgroup *NetworkEndpointGroup) *GlobalNetworkEndpointGroupsInsertCall {
+ c := &GlobalNetworkEndpointGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.networkendpointgroup = networkendpointgroup
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *GlobalNetworkEndpointGroupsInsertCall) RequestId(requestId string) *GlobalNetworkEndpointGroupsInsertCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *GlobalNetworkEndpointGroupsInsertCall) Fields(s ...googleapi.Field) *GlobalNetworkEndpointGroupsInsertCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *GlobalNetworkEndpointGroupsInsertCall) Context(ctx context.Context) *GlobalNetworkEndpointGroupsInsertCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *GlobalNetworkEndpointGroupsInsertCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *GlobalNetworkEndpointGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroup)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networkEndpointGroups")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.globalNetworkEndpointGroups.insert" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *GlobalNetworkEndpointGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type GlobalNetworkEndpointGroupsListCall struct {
+ s *Service
+ project string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// List: Retrieves the list of network endpoint groups that are located in the
+// specified project.
+//
+// - project: Project ID for this request.
+func (r *GlobalNetworkEndpointGroupsService) List(project string) *GlobalNetworkEndpointGroupsListCall {
+ c := &GlobalNetworkEndpointGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ return c
+}
+
+// Filter sets the optional parameter "filter": A filter expression that
+// filters resources listed in the response. Most Compute resources support two
+// types of filter expressions: expressions that support regular expressions
+// and expressions that follow API improvement proposal AIP-160. These two
+// types of filter expressions cannot be mixed in one request. If you want to
+// use AIP-160, your expression must specify the field name, an operator, and
+// the value that you want to use for filtering. The value must be a string, a
+// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
+// `>=` or `:`. For example, if you are filtering Compute Engine instances, you
+// can exclude instances named `example-instance` by specifying `name !=
+// example-instance`. The `:*` comparison can be used to test whether a key has
+// been defined. For example, to find all objects with `owner` label use: ```
+// labels.owner:* ``` You can also filter nested fields. For example, you could
+// specify `scheduling.automaticRestart = false` to include instances only if
+// they are not scheduled for automatic restarts. You can use filtering on
+// nested fields to filter based on resource labels. To filter on multiple
+// expressions, provide each separate expression within parentheses. For
+// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel
+// Skylake") ``` By default, each expression is an `AND` expression. However,
+// you can include `AND` and `OR` expressions explicitly. For example: ```
+// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND
+// (scheduling.automaticRestart = true) ``` If you want to use a regular
+// expression, use the `eq` (equal) or `ne` (not equal) operator against a
+// single un-parenthesized expression with or without quotes or against
+// multiple parenthesized expressions. Examples: `fieldname eq unquoted
+// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted
+// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal
+// value is interpreted as a regular expression using Google RE2 library
+// syntax. The literal value must match the entire field. For example, to
+// filter for instances that do not end with name "instance", you would use
+// `name ne .*instance`. You cannot combine constraints on multiple fields
+// using regular expressions.
+func (c *GlobalNetworkEndpointGroupsListCall) Filter(filter string) *GlobalNetworkEndpointGroupsListCall {
+ c.urlParams_.Set("filter", filter)
+ return c
+}
+
+// MaxResults sets the optional parameter "maxResults": The maximum number of
+// results per page that should be returned. If the number of available results
+// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that
+// can be used to get the next page of results in subsequent list requests.
+// Acceptable values are `0` to `500`, inclusive. (Default: `500`)
+func (c *GlobalNetworkEndpointGroupsListCall) MaxResults(maxResults int64) *GlobalNetworkEndpointGroupsListCall {
+ c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
+ return c
+}
+
+// OrderBy sets the optional parameter "orderBy": Sorts list results by a
+// certain order. By default, results are returned in alphanumerical order
+// based on the resource name. You can also sort results in descending order
+// based on the creation timestamp using `orderBy="creationTimestamp desc".
+// This sorts results based on the `creationTimestamp` field in reverse
+// chronological order (newest result first). Use this to sort resources like
+// operations so that the newest operation is returned first. Currently, only
+// sorting by `name` or `creationTimestamp desc` is supported.
+func (c *GlobalNetworkEndpointGroupsListCall) OrderBy(orderBy string) *GlobalNetworkEndpointGroupsListCall {
+ c.urlParams_.Set("orderBy", orderBy)
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": Specifies a page token to
+// use. Set `pageToken` to the `nextPageToken` returned by a previous list
+// request to get the next page of results.
+func (c *GlobalNetworkEndpointGroupsListCall) PageToken(pageToken string) *GlobalNetworkEndpointGroupsListCall {
+ c.urlParams_.Set("pageToken", pageToken)
+ return c
+}
+
+// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
+// Opt-in for partial success behavior which provides partial results in case
+// of failure. The default value is false. For example, when partial success
+// behavior is enabled, aggregatedList for a single zone scope either returns
+// all resources in the zone or no resources, with an error code.
+func (c *GlobalNetworkEndpointGroupsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *GlobalNetworkEndpointGroupsListCall {
+ c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *GlobalNetworkEndpointGroupsListCall) Fields(s ...googleapi.Field) *GlobalNetworkEndpointGroupsListCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *GlobalNetworkEndpointGroupsListCall) IfNoneMatch(entityTag string) *GlobalNetworkEndpointGroupsListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *GlobalNetworkEndpointGroupsListCall) Context(ctx context.Context) *GlobalNetworkEndpointGroupsListCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *GlobalNetworkEndpointGroupsListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *GlobalNetworkEndpointGroupsListCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/global/networkEndpointGroups")
+ 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{
+ "project": c.project,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.globalNetworkEndpointGroups.list" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *NetworkEndpointGroupList.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 *GlobalNetworkEndpointGroupsListCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &NetworkEndpointGroupList{
+ 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
+}
+
+// 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 *GlobalNetworkEndpointGroupsListCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupList) error) error {
+ c.ctx_ = ctx
+ defer c.PageToken(c.urlParams_.Get("pageToken"))
+ 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)
+ }
+}
+
+type GlobalNetworkEndpointGroupsListNetworkEndpointsCall struct {
+ s *Service
+ project string
+ networkEndpointGroup string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// ListNetworkEndpoints: Lists the network endpoints in the specified network
+// endpoint group.
+//
+// - networkEndpointGroup: The name of the network endpoint group from which
+// you want to generate a list of included network endpoints. It should
+// comply with RFC1035.
+// - project: Project ID for this request.
+func (r *GlobalNetworkEndpointGroupsService) ListNetworkEndpoints(project string, networkEndpointGroup string) *GlobalNetworkEndpointGroupsListNetworkEndpointsCall {
+ c := &GlobalNetworkEndpointGroupsListNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.networkEndpointGroup = networkEndpointGroup
+ return c
+}
+
+// Filter sets the optional parameter "filter": A filter expression that
+// filters resources listed in the response. Most Compute resources support two
+// types of filter expressions: expressions that support regular expressions
+// and expressions that follow API improvement proposal AIP-160. These two
+// types of filter expressions cannot be mixed in one request. If you want to
+// use AIP-160, your expression must specify the field name, an operator, and
+// the value that you want to use for filtering. The value must be a string, a
+// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
+// `>=` or `:`. For example, if you are filtering Compute Engine instances, you
+// can exclude instances named `example-instance` by specifying `name !=
+// example-instance`. The `:*` comparison can be used to test whether a key has
+// been defined. For example, to find all objects with `owner` label use: ```
+// labels.owner:* ``` You can also filter nested fields. For example, you could
+// specify `scheduling.automaticRestart = false` to include instances only if
+// they are not scheduled for automatic restarts. You can use filtering on
+// nested fields to filter based on resource labels. To filter on multiple
+// expressions, provide each separate expression within parentheses. For
+// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel
+// Skylake") ``` By default, each expression is an `AND` expression. However,
+// you can include `AND` and `OR` expressions explicitly. For example: ```
+// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND
+// (scheduling.automaticRestart = true) ``` If you want to use a regular
+// expression, use the `eq` (equal) or `ne` (not equal) operator against a
+// single un-parenthesized expression with or without quotes or against
+// multiple parenthesized expressions. Examples: `fieldname eq unquoted
+// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted
+// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal
+// value is interpreted as a regular expression using Google RE2 library
+// syntax. The literal value must match the entire field. For example, to
+// filter for instances that do not end with name "instance", you would use
+// `name ne .*instance`. You cannot combine constraints on multiple fields
+// using regular expressions.
+func (c *GlobalNetworkEndpointGroupsListNetworkEndpointsCall) Filter(filter string) *GlobalNetworkEndpointGroupsListNetworkEndpointsCall {
+ c.urlParams_.Set("filter", filter)
+ return c
+}
+
+// MaxResults sets the optional parameter "maxResults": The maximum number of
+// results per page that should be returned. If the number of available results
+// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that
+// can be used to get the next page of results in subsequent list requests.
+// Acceptable values are `0` to `500`, inclusive. (Default: `500`)
+func (c *GlobalNetworkEndpointGroupsListNetworkEndpointsCall) MaxResults(maxResults int64) *GlobalNetworkEndpointGroupsListNetworkEndpointsCall {
+ c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
+ return c
+}
+
+// OrderBy sets the optional parameter "orderBy": Sorts list results by a
+// certain order. By default, results are returned in alphanumerical order
+// based on the resource name. You can also sort results in descending order
+// based on the creation timestamp using `orderBy="creationTimestamp desc".
+// This sorts results based on the `creationTimestamp` field in reverse
+// chronological order (newest result first). Use this to sort resources like
+// operations so that the newest operation is returned first. Currently, only
+// sorting by `name` or `creationTimestamp desc` is supported.
+func (c *GlobalNetworkEndpointGroupsListNetworkEndpointsCall) OrderBy(orderBy string) *GlobalNetworkEndpointGroupsListNetworkEndpointsCall {
+ c.urlParams_.Set("orderBy", orderBy)
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": Specifies a page token to
+// use. Set `pageToken` to the `nextPageToken` returned by a previous list
+// request to get the next page of results.
+func (c *GlobalNetworkEndpointGroupsListNetworkEndpointsCall) PageToken(pageToken string) *GlobalNetworkEndpointGroupsListNetworkEndpointsCall {
+ c.urlParams_.Set("pageToken", pageToken)
+ return c
+}
+
+// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
+// Opt-in for partial success behavior which provides partial results in case
+// of failure. The default value is false. For example, when partial success
+// behavior is enabled, aggregatedList for a single zone scope either returns
+// all resources in the zone or no resources, with an error code.
+func (c *GlobalNetworkEndpointGroupsListNetworkEndpointsCall) ReturnPartialSuccess(returnPartialSuccess bool) *GlobalNetworkEndpointGroupsListNetworkEndpointsCall {
+ c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *GlobalNetworkEndpointGroupsListNetworkEndpointsCall) Fields(s ...googleapi.Field) *GlobalNetworkEndpointGroupsListNetworkEndpointsCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *GlobalNetworkEndpointGroupsListNetworkEndpointsCall) Context(ctx context.Context) *GlobalNetworkEndpointGroupsListNetworkEndpointsCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *GlobalNetworkEndpointGroupsListNetworkEndpointsCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *GlobalNetworkEndpointGroupsListNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networkEndpointGroups/{networkEndpointGroup}/listNetworkEndpoints")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "networkEndpointGroup": c.networkEndpointGroup,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.globalNetworkEndpointGroups.listNetworkEndpoints" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *NetworkEndpointGroupsListNetworkEndpoints.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 *GlobalNetworkEndpointGroupsListNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupsListNetworkEndpoints, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &NetworkEndpointGroupsListNetworkEndpoints{
+ 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
+}
+
+// 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 *GlobalNetworkEndpointGroupsListNetworkEndpointsCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupsListNetworkEndpoints) error) error {
+ c.ctx_ = ctx
+ defer c.PageToken(c.urlParams_.Get("pageToken"))
+ 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)
+ }
+}
+
+type GlobalOperationsAggregatedListCall struct {
+ s *Service
+ project string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// AggregatedList: Retrieves an aggregated list of all operations. To prevent
+// failure, Google recommends that you set the `returnPartialSuccess` parameter
+// to `true`.
+//
+// - project: Project ID for this request.
+func (r *GlobalOperationsService) AggregatedList(project string) *GlobalOperationsAggregatedListCall {
+ c := &GlobalOperationsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ return c
+}
+
+// Filter sets the optional parameter "filter": A filter expression that
+// filters resources listed in the response. Most Compute resources support two
+// types of filter expressions: expressions that support regular expressions
+// and expressions that follow API improvement proposal AIP-160. These two
+// types of filter expressions cannot be mixed in one request. If you want to
+// use AIP-160, your expression must specify the field name, an operator, and
+// the value that you want to use for filtering. The value must be a string, a
+// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
+// `>=` or `:`. For example, if you are filtering Compute Engine instances, you
+// can exclude instances named `example-instance` by specifying `name !=
+// example-instance`. The `:*` comparison can be used to test whether a key has
+// been defined. For example, to find all objects with `owner` label use: ```
+// labels.owner:* ``` You can also filter nested fields. For example, you could
+// specify `scheduling.automaticRestart = false` to include instances only if
+// they are not scheduled for automatic restarts. You can use filtering on
+// nested fields to filter based on resource labels. To filter on multiple
+// expressions, provide each separate expression within parentheses. For
+// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel
+// Skylake") ``` By default, each expression is an `AND` expression. However,
+// you can include `AND` and `OR` expressions explicitly. For example: ```
+// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND
+// (scheduling.automaticRestart = true) ``` If you want to use a regular
+// expression, use the `eq` (equal) or `ne` (not equal) operator against a
+// single un-parenthesized expression with or without quotes or against
+// multiple parenthesized expressions. Examples: `fieldname eq unquoted
+// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted
+// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal
+// value is interpreted as a regular expression using Google RE2 library
+// syntax. The literal value must match the entire field. For example, to
+// filter for instances that do not end with name "instance", you would use
+// `name ne .*instance`. You cannot combine constraints on multiple fields
+// using regular expressions.
+func (c *GlobalOperationsAggregatedListCall) Filter(filter string) *GlobalOperationsAggregatedListCall {
+ c.urlParams_.Set("filter", filter)
+ return c
+}
+
+// IncludeAllScopes sets the optional parameter "includeAllScopes": Indicates
+// whether every visible scope for each scope type (zone, region, global)
+// should be included in the response. For new resource types added after this
+// field, the flag has no effect as new resource types will always include
+// every visible scope for each scope type in response. For resource types
+// which predate this field, if this flag is omitted or false, only scopes of
+// the scope types where the resource type is expected to be found will be
+// included.
+func (c *GlobalOperationsAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *GlobalOperationsAggregatedListCall {
+ c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
+ return c
+}
+
+// MaxResults sets the optional parameter "maxResults": The maximum number of
+// results per page that should be returned. If the number of available results
+// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that
+// can be used to get the next page of results in subsequent list requests.
+// Acceptable values are `0` to `500`, inclusive. (Default: `500`)
+func (c *GlobalOperationsAggregatedListCall) MaxResults(maxResults int64) *GlobalOperationsAggregatedListCall {
+ c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
+ return c
+}
+
+// OrderBy sets the optional parameter "orderBy": Sorts list results by a
+// certain order. By default, results are returned in alphanumerical order
+// based on the resource name. You can also sort results in descending order
+// based on the creation timestamp using `orderBy="creationTimestamp desc".
+// This sorts results based on the `creationTimestamp` field in reverse
+// chronological order (newest result first). Use this to sort resources like
+// operations so that the newest operation is returned first. Currently, only
+// sorting by `name` or `creationTimestamp desc` is supported.
+func (c *GlobalOperationsAggregatedListCall) OrderBy(orderBy string) *GlobalOperationsAggregatedListCall {
+ c.urlParams_.Set("orderBy", orderBy)
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": Specifies a page token to
+// use. Set `pageToken` to the `nextPageToken` returned by a previous list
+// request to get the next page of results.
+func (c *GlobalOperationsAggregatedListCall) PageToken(pageToken string) *GlobalOperationsAggregatedListCall {
+ c.urlParams_.Set("pageToken", pageToken)
+ return c
+}
+
+// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
+// Opt-in for partial success behavior which provides partial results in case
+// of failure. The default value is false. For example, when partial success
+// behavior is enabled, aggregatedList for a single zone scope either returns
+// all resources in the zone or no resources, with an error code.
+func (c *GlobalOperationsAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *GlobalOperationsAggregatedListCall {
+ c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
+ return c
+}
+
+// ServiceProjectNumber sets the optional parameter "serviceProjectNumber": The
+// Shared VPC service project id or service project number for which aggregated
+// list request is invoked for subnetworks list-usable api.
+func (c *GlobalOperationsAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *GlobalOperationsAggregatedListCall {
+ c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *GlobalOperationsAggregatedListCall) Fields(s ...googleapi.Field) *GlobalOperationsAggregatedListCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *GlobalOperationsAggregatedListCall) IfNoneMatch(entityTag string) *GlobalOperationsAggregatedListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *GlobalOperationsAggregatedListCall) Context(ctx context.Context) *GlobalOperationsAggregatedListCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *GlobalOperationsAggregatedListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *GlobalOperationsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/aggregated/operations")
+ 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{
+ "project": c.project,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.globalOperations.aggregatedList" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *OperationAggregatedList.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 *GlobalOperationsAggregatedListCall) Do(opts ...googleapi.CallOption) (*OperationAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &OperationAggregatedList{
+ 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
+}
+
+// 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 *GlobalOperationsAggregatedListCall) Pages(ctx context.Context, f func(*OperationAggregatedList) error) error {
+ c.ctx_ = ctx
+ defer c.PageToken(c.urlParams_.Get("pageToken"))
+ 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)
+ }
+}
+
+type GlobalOperationsDeleteCall struct {
+ s *Service
+ project string
+ operationid string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Delete: Deletes the specified Operations resource.
+//
+// - operation: Name of the Operations resource to delete, or its unique
+// numeric identifier.
+// - project: Project ID for this request.
+func (r *GlobalOperationsService) Delete(project string, operationid string) *GlobalOperationsDeleteCall {
+ c := &GlobalOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.operationid = operationid
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *GlobalOperationsDeleteCall) Fields(s ...googleapi.Field) *GlobalOperationsDeleteCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *GlobalOperationsDeleteCall) Context(ctx context.Context) *GlobalOperationsDeleteCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *GlobalOperationsDeleteCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *GlobalOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/operations/{operation}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("DELETE", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "operation": c.operationid,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.globalOperations.delete" call.
+func (c *GlobalOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
+ gensupport.SetOptions(c.urlParams_, opts...)
+ res, err := c.doRequest("json")
+ if err != nil {
+ return err
+ }
+ defer googleapi.CloseBody(res)
+ if err := googleapi.CheckResponse(res); err != nil {
+ return gensupport.WrapError(err)
+ }
+ return nil
+}
+
+type GlobalOperationsGetCall struct {
+ s *Service
+ project string
+ operationid string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Get: Retrieves the specified Operations resource.
+//
+// - operation: Name of the Operations resource to return, or its unique
+// numeric identifier.
+// - project: Project ID for this request.
+func (r *GlobalOperationsService) Get(project string, operationid string) *GlobalOperationsGetCall {
+ c := &GlobalOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.operationid = operationid
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *GlobalOperationsGetCall) Fields(s ...googleapi.Field) *GlobalOperationsGetCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *GlobalOperationsGetCall) IfNoneMatch(entityTag string) *GlobalOperationsGetCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *GlobalOperationsGetCall) Context(ctx context.Context) *GlobalOperationsGetCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *GlobalOperationsGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *GlobalOperationsGetCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/global/operations/{operation}")
+ 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{
+ "project": c.project,
+ "operation": c.operationid,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.globalOperations.get" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *GlobalOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type GlobalOperationsListCall struct {
+ s *Service
+ project string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// List: Retrieves a list of Operation resources contained within the specified
+// project.
+//
+// - project: Project ID for this request.
+func (r *GlobalOperationsService) List(project string) *GlobalOperationsListCall {
+ c := &GlobalOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ return c
+}
+
+// Filter sets the optional parameter "filter": A filter expression that
+// filters resources listed in the response. Most Compute resources support two
+// types of filter expressions: expressions that support regular expressions
+// and expressions that follow API improvement proposal AIP-160. These two
+// types of filter expressions cannot be mixed in one request. If you want to
+// use AIP-160, your expression must specify the field name, an operator, and
+// the value that you want to use for filtering. The value must be a string, a
+// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
+// `>=` or `:`. For example, if you are filtering Compute Engine instances, you
+// can exclude instances named `example-instance` by specifying `name !=
+// example-instance`. The `:*` comparison can be used to test whether a key has
+// been defined. For example, to find all objects with `owner` label use: ```
+// labels.owner:* ``` You can also filter nested fields. For example, you could
+// specify `scheduling.automaticRestart = false` to include instances only if
+// they are not scheduled for automatic restarts. You can use filtering on
+// nested fields to filter based on resource labels. To filter on multiple
+// expressions, provide each separate expression within parentheses. For
+// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel
+// Skylake") ``` By default, each expression is an `AND` expression. However,
+// you can include `AND` and `OR` expressions explicitly. For example: ```
+// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND
+// (scheduling.automaticRestart = true) ``` If you want to use a regular
+// expression, use the `eq` (equal) or `ne` (not equal) operator against a
+// single un-parenthesized expression with or without quotes or against
+// multiple parenthesized expressions. Examples: `fieldname eq unquoted
+// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted
+// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal
+// value is interpreted as a regular expression using Google RE2 library
+// syntax. The literal value must match the entire field. For example, to
+// filter for instances that do not end with name "instance", you would use
+// `name ne .*instance`. You cannot combine constraints on multiple fields
+// using regular expressions.
+func (c *GlobalOperationsListCall) Filter(filter string) *GlobalOperationsListCall {
+ c.urlParams_.Set("filter", filter)
+ return c
+}
+
+// MaxResults sets the optional parameter "maxResults": The maximum number of
+// results per page that should be returned. If the number of available results
+// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that
+// can be used to get the next page of results in subsequent list requests.
+// Acceptable values are `0` to `500`, inclusive. (Default: `500`)
+func (c *GlobalOperationsListCall) MaxResults(maxResults int64) *GlobalOperationsListCall {
+ c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
+ return c
+}
+
+// OrderBy sets the optional parameter "orderBy": Sorts list results by a
+// certain order. By default, results are returned in alphanumerical order
+// based on the resource name. You can also sort results in descending order
+// based on the creation timestamp using `orderBy="creationTimestamp desc".
+// This sorts results based on the `creationTimestamp` field in reverse
+// chronological order (newest result first). Use this to sort resources like
+// operations so that the newest operation is returned first. Currently, only
+// sorting by `name` or `creationTimestamp desc` is supported.
+func (c *GlobalOperationsListCall) OrderBy(orderBy string) *GlobalOperationsListCall {
+ c.urlParams_.Set("orderBy", orderBy)
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": Specifies a page token to
+// use. Set `pageToken` to the `nextPageToken` returned by a previous list
+// request to get the next page of results.
+func (c *GlobalOperationsListCall) PageToken(pageToken string) *GlobalOperationsListCall {
+ c.urlParams_.Set("pageToken", pageToken)
+ return c
+}
+
+// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
+// Opt-in for partial success behavior which provides partial results in case
+// of failure. The default value is false. For example, when partial success
+// behavior is enabled, aggregatedList for a single zone scope either returns
+// all resources in the zone or no resources, with an error code.
+func (c *GlobalOperationsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *GlobalOperationsListCall {
+ c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *GlobalOperationsListCall) Fields(s ...googleapi.Field) *GlobalOperationsListCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *GlobalOperationsListCall) IfNoneMatch(entityTag string) *GlobalOperationsListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *GlobalOperationsListCall) Context(ctx context.Context) *GlobalOperationsListCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *GlobalOperationsListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *GlobalOperationsListCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/global/operations")
+ 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{
+ "project": c.project,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.globalOperations.list" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *OperationList.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 *GlobalOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &OperationList{
+ 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
+}
+
+// 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 *GlobalOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
+ c.ctx_ = ctx
+ defer c.PageToken(c.urlParams_.Get("pageToken"))
+ 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)
+ }
+}
+
+type GlobalOperationsWaitCall struct {
+ s *Service
+ project string
+ operationid string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Wait: Waits for the specified Operation resource to return as `DONE` or for
+// the request to approach the 2 minute deadline, and retrieves the specified
+// Operation resource. This method differs from the `GET` method in that it
+// waits for no more than the default deadline (2 minutes) and then returns the
+// current state of the operation, which might be `DONE` or still in progress.
+// This method is called on a best-effort basis. Specifically: - In uncommon
+// cases, when the server is overloaded, the request might return before the
+// default deadline is reached, or might return after zero seconds. - If the
+// default deadline is reached, there is no guarantee that the operation is
+// actually done when the method returns. Be prepared to retry if the operation
+// is not `DONE`.
+//
+// - operation: Name of the Operations resource to return, or its unique
+// numeric identifier.
+// - project: Project ID for this request.
+func (r *GlobalOperationsService) Wait(project string, operationid string) *GlobalOperationsWaitCall {
+ c := &GlobalOperationsWaitCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.operationid = operationid
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *GlobalOperationsWaitCall) Fields(s ...googleapi.Field) *GlobalOperationsWaitCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *GlobalOperationsWaitCall) Context(ctx context.Context) *GlobalOperationsWaitCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *GlobalOperationsWaitCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *GlobalOperationsWaitCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/operations/{operation}/wait")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "operation": c.operationid,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.globalOperations.wait" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *GlobalOperationsWaitCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type GlobalOrganizationOperationsDeleteCall struct {
+ s *Service
+ operationid string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Delete: Deletes the specified Operations resource.
+//
+// - operation: Name of the Operations resource to delete, or its unique
+// numeric identifier.
+func (r *GlobalOrganizationOperationsService) Delete(operationid string) *GlobalOrganizationOperationsDeleteCall {
+ c := &GlobalOrganizationOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.operationid = operationid
+ return c
+}
+
+// ParentId sets the optional parameter "parentId": Parent ID for this request.
+func (c *GlobalOrganizationOperationsDeleteCall) ParentId(parentId string) *GlobalOrganizationOperationsDeleteCall {
+ c.urlParams_.Set("parentId", parentId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *GlobalOrganizationOperationsDeleteCall) Fields(s ...googleapi.Field) *GlobalOrganizationOperationsDeleteCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *GlobalOrganizationOperationsDeleteCall) Context(ctx context.Context) *GlobalOrganizationOperationsDeleteCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *GlobalOrganizationOperationsDeleteCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *GlobalOrganizationOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/operations/{operation}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("DELETE", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "operation": c.operationid,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.globalOrganizationOperations.delete" call.
+func (c *GlobalOrganizationOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
+ gensupport.SetOptions(c.urlParams_, opts...)
+ res, err := c.doRequest("json")
+ if err != nil {
+ return err
+ }
+ defer googleapi.CloseBody(res)
+ if err := googleapi.CheckResponse(res); err != nil {
+ return gensupport.WrapError(err)
+ }
+ return nil
+}
+
+type GlobalOrganizationOperationsGetCall struct {
+ s *Service
+ operationid string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Get: Retrieves the specified Operations resource. Gets a list of operations
+// by making a `list()` request.
+//
+// - operation: Name of the Operations resource to return, or its unique
+// numeric identifier.
+func (r *GlobalOrganizationOperationsService) Get(operationid string) *GlobalOrganizationOperationsGetCall {
+ c := &GlobalOrganizationOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.operationid = operationid
+ return c
+}
+
+// ParentId sets the optional parameter "parentId": Parent ID for this request.
+func (c *GlobalOrganizationOperationsGetCall) ParentId(parentId string) *GlobalOrganizationOperationsGetCall {
+ c.urlParams_.Set("parentId", parentId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *GlobalOrganizationOperationsGetCall) Fields(s ...googleapi.Field) *GlobalOrganizationOperationsGetCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *GlobalOrganizationOperationsGetCall) IfNoneMatch(entityTag string) *GlobalOrganizationOperationsGetCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *GlobalOrganizationOperationsGetCall) Context(ctx context.Context) *GlobalOrganizationOperationsGetCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *GlobalOrganizationOperationsGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *GlobalOrganizationOperationsGetCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "locations/global/operations/{operation}")
+ 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{
+ "operation": c.operationid,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.globalOrganizationOperations.get" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *GlobalOrganizationOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type GlobalOrganizationOperationsListCall struct {
+ s *Service
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// List: Retrieves a list of Operation resources contained within the specified
+// organization.
+func (r *GlobalOrganizationOperationsService) List() *GlobalOrganizationOperationsListCall {
+ c := &GlobalOrganizationOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ return c
+}
+
+// Filter sets the optional parameter "filter": A filter expression that
+// filters resources listed in the response. Most Compute resources support two
+// types of filter expressions: expressions that support regular expressions
+// and expressions that follow API improvement proposal AIP-160. These two
+// types of filter expressions cannot be mixed in one request. If you want to
+// use AIP-160, your expression must specify the field name, an operator, and
+// the value that you want to use for filtering. The value must be a string, a
+// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
+// `>=` or `:`. For example, if you are filtering Compute Engine instances, you
+// can exclude instances named `example-instance` by specifying `name !=
+// example-instance`. The `:*` comparison can be used to test whether a key has
+// been defined. For example, to find all objects with `owner` label use: ```
+// labels.owner:* ``` You can also filter nested fields. For example, you could
+// specify `scheduling.automaticRestart = false` to include instances only if
+// they are not scheduled for automatic restarts. You can use filtering on
+// nested fields to filter based on resource labels. To filter on multiple
+// expressions, provide each separate expression within parentheses. For
+// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel
+// Skylake") ``` By default, each expression is an `AND` expression. However,
+// you can include `AND` and `OR` expressions explicitly. For example: ```
+// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND
+// (scheduling.automaticRestart = true) ``` If you want to use a regular
+// expression, use the `eq` (equal) or `ne` (not equal) operator against a
+// single un-parenthesized expression with or without quotes or against
+// multiple parenthesized expressions. Examples: `fieldname eq unquoted
+// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted
+// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal
+// value is interpreted as a regular expression using Google RE2 library
+// syntax. The literal value must match the entire field. For example, to
+// filter for instances that do not end with name "instance", you would use
+// `name ne .*instance`. You cannot combine constraints on multiple fields
+// using regular expressions.
+func (c *GlobalOrganizationOperationsListCall) Filter(filter string) *GlobalOrganizationOperationsListCall {
+ c.urlParams_.Set("filter", filter)
+ return c
+}
+
+// MaxResults sets the optional parameter "maxResults": The maximum number of
+// results per page that should be returned. If the number of available results
+// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that
+// can be used to get the next page of results in subsequent list requests.
+// Acceptable values are `0` to `500`, inclusive. (Default: `500`)
+func (c *GlobalOrganizationOperationsListCall) MaxResults(maxResults int64) *GlobalOrganizationOperationsListCall {
+ c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
+ return c
+}
+
+// OrderBy sets the optional parameter "orderBy": Sorts list results by a
+// certain order. By default, results are returned in alphanumerical order
+// based on the resource name. You can also sort results in descending order
+// based on the creation timestamp using `orderBy="creationTimestamp desc".
+// This sorts results based on the `creationTimestamp` field in reverse
+// chronological order (newest result first). Use this to sort resources like
+// operations so that the newest operation is returned first. Currently, only
+// sorting by `name` or `creationTimestamp desc` is supported.
+func (c *GlobalOrganizationOperationsListCall) OrderBy(orderBy string) *GlobalOrganizationOperationsListCall {
+ c.urlParams_.Set("orderBy", orderBy)
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": Specifies a page token to
+// use. Set `pageToken` to the `nextPageToken` returned by a previous list
+// request to get the next page of results.
+func (c *GlobalOrganizationOperationsListCall) PageToken(pageToken string) *GlobalOrganizationOperationsListCall {
+ c.urlParams_.Set("pageToken", pageToken)
+ return c
+}
+
+// ParentId sets the optional parameter "parentId": Parent ID for this request.
+func (c *GlobalOrganizationOperationsListCall) ParentId(parentId string) *GlobalOrganizationOperationsListCall {
+ c.urlParams_.Set("parentId", parentId)
+ return c
+}
+
+// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
+// Opt-in for partial success behavior which provides partial results in case
+// of failure. The default value is false. For example, when partial success
+// behavior is enabled, aggregatedList for a single zone scope either returns
+// all resources in the zone or no resources, with an error code.
+func (c *GlobalOrganizationOperationsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *GlobalOrganizationOperationsListCall {
+ c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *GlobalOrganizationOperationsListCall) Fields(s ...googleapi.Field) *GlobalOrganizationOperationsListCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *GlobalOrganizationOperationsListCall) IfNoneMatch(entityTag string) *GlobalOrganizationOperationsListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *GlobalOrganizationOperationsListCall) Context(ctx context.Context) *GlobalOrganizationOperationsListCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *GlobalOrganizationOperationsListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *GlobalOrganizationOperationsListCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "locations/global/operations")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("GET", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.globalOrganizationOperations.list" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *OperationList.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 *GlobalOrganizationOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &OperationList{
+ 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
+}
+
+// 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 *GlobalOrganizationOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
+ c.ctx_ = ctx
+ defer c.PageToken(c.urlParams_.Get("pageToken"))
+ 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)
+ }
+}
+
+type GlobalPublicDelegatedPrefixesDeleteCall struct {
+ s *Service
+ project string
+ publicDelegatedPrefix string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Delete: Deletes the specified global PublicDelegatedPrefix.
+//
+// - project: Project ID for this request.
+// - publicDelegatedPrefix: Name of the PublicDelegatedPrefix resource to
+// delete.
+func (r *GlobalPublicDelegatedPrefixesService) Delete(project string, publicDelegatedPrefix string) *GlobalPublicDelegatedPrefixesDeleteCall {
+ c := &GlobalPublicDelegatedPrefixesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.publicDelegatedPrefix = publicDelegatedPrefix
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *GlobalPublicDelegatedPrefixesDeleteCall) RequestId(requestId string) *GlobalPublicDelegatedPrefixesDeleteCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *GlobalPublicDelegatedPrefixesDeleteCall) Fields(s ...googleapi.Field) *GlobalPublicDelegatedPrefixesDeleteCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *GlobalPublicDelegatedPrefixesDeleteCall) Context(ctx context.Context) *GlobalPublicDelegatedPrefixesDeleteCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *GlobalPublicDelegatedPrefixesDeleteCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *GlobalPublicDelegatedPrefixesDeleteCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicDelegatedPrefixes/{publicDelegatedPrefix}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("DELETE", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "publicDelegatedPrefix": c.publicDelegatedPrefix,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.globalPublicDelegatedPrefixes.delete" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *GlobalPublicDelegatedPrefixesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type GlobalPublicDelegatedPrefixesGetCall struct {
+ s *Service
+ project string
+ publicDelegatedPrefix string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Get: Returns the specified global PublicDelegatedPrefix resource.
+//
+// - project: Project ID for this request.
+// - publicDelegatedPrefix: Name of the PublicDelegatedPrefix resource to
+// return.
+func (r *GlobalPublicDelegatedPrefixesService) Get(project string, publicDelegatedPrefix string) *GlobalPublicDelegatedPrefixesGetCall {
+ c := &GlobalPublicDelegatedPrefixesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.publicDelegatedPrefix = publicDelegatedPrefix
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *GlobalPublicDelegatedPrefixesGetCall) Fields(s ...googleapi.Field) *GlobalPublicDelegatedPrefixesGetCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *GlobalPublicDelegatedPrefixesGetCall) IfNoneMatch(entityTag string) *GlobalPublicDelegatedPrefixesGetCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *GlobalPublicDelegatedPrefixesGetCall) Context(ctx context.Context) *GlobalPublicDelegatedPrefixesGetCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *GlobalPublicDelegatedPrefixesGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *GlobalPublicDelegatedPrefixesGetCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/global/publicDelegatedPrefixes/{publicDelegatedPrefix}")
+ 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{
+ "project": c.project,
+ "publicDelegatedPrefix": c.publicDelegatedPrefix,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.globalPublicDelegatedPrefixes.get" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *PublicDelegatedPrefix.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 *GlobalPublicDelegatedPrefixesGetCall) Do(opts ...googleapi.CallOption) (*PublicDelegatedPrefix, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &PublicDelegatedPrefix{
+ 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
+}
+
+type GlobalPublicDelegatedPrefixesInsertCall struct {
+ s *Service
+ project string
+ publicdelegatedprefix *PublicDelegatedPrefix
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Insert: Creates a global PublicDelegatedPrefix in the specified project
+// using the parameters that are included in the request.
+//
+// - project: Project ID for this request.
+func (r *GlobalPublicDelegatedPrefixesService) Insert(project string, publicdelegatedprefix *PublicDelegatedPrefix) *GlobalPublicDelegatedPrefixesInsertCall {
+ c := &GlobalPublicDelegatedPrefixesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.publicdelegatedprefix = publicdelegatedprefix
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *GlobalPublicDelegatedPrefixesInsertCall) RequestId(requestId string) *GlobalPublicDelegatedPrefixesInsertCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *GlobalPublicDelegatedPrefixesInsertCall) Fields(s ...googleapi.Field) *GlobalPublicDelegatedPrefixesInsertCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *GlobalPublicDelegatedPrefixesInsertCall) Context(ctx context.Context) *GlobalPublicDelegatedPrefixesInsertCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *GlobalPublicDelegatedPrefixesInsertCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *GlobalPublicDelegatedPrefixesInsertCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.publicdelegatedprefix)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicDelegatedPrefixes")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.globalPublicDelegatedPrefixes.insert" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *GlobalPublicDelegatedPrefixesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type GlobalPublicDelegatedPrefixesListCall struct {
+ s *Service
+ project string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// List: Lists the global PublicDelegatedPrefixes for a project.
+//
+// - project: Project ID for this request.
+func (r *GlobalPublicDelegatedPrefixesService) List(project string) *GlobalPublicDelegatedPrefixesListCall {
+ c := &GlobalPublicDelegatedPrefixesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ return c
+}
+
+// Filter sets the optional parameter "filter": A filter expression that
+// filters resources listed in the response. Most Compute resources support two
+// types of filter expressions: expressions that support regular expressions
+// and expressions that follow API improvement proposal AIP-160. These two
+// types of filter expressions cannot be mixed in one request. If you want to
+// use AIP-160, your expression must specify the field name, an operator, and
+// the value that you want to use for filtering. The value must be a string, a
+// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
+// `>=` or `:`. For example, if you are filtering Compute Engine instances, you
+// can exclude instances named `example-instance` by specifying `name !=
+// example-instance`. The `:*` comparison can be used to test whether a key has
+// been defined. For example, to find all objects with `owner` label use: ```
+// labels.owner:* ``` You can also filter nested fields. For example, you could
+// specify `scheduling.automaticRestart = false` to include instances only if
+// they are not scheduled for automatic restarts. You can use filtering on
+// nested fields to filter based on resource labels. To filter on multiple
+// expressions, provide each separate expression within parentheses. For
+// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel
+// Skylake") ``` By default, each expression is an `AND` expression. However,
+// you can include `AND` and `OR` expressions explicitly. For example: ```
+// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND
+// (scheduling.automaticRestart = true) ``` If you want to use a regular
+// expression, use the `eq` (equal) or `ne` (not equal) operator against a
+// single un-parenthesized expression with or without quotes or against
+// multiple parenthesized expressions. Examples: `fieldname eq unquoted
+// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted
+// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal
+// value is interpreted as a regular expression using Google RE2 library
+// syntax. The literal value must match the entire field. For example, to
+// filter for instances that do not end with name "instance", you would use
+// `name ne .*instance`. You cannot combine constraints on multiple fields
+// using regular expressions.
+func (c *GlobalPublicDelegatedPrefixesListCall) Filter(filter string) *GlobalPublicDelegatedPrefixesListCall {
+ c.urlParams_.Set("filter", filter)
+ return c
+}
+
+// MaxResults sets the optional parameter "maxResults": The maximum number of
+// results per page that should be returned. If the number of available results
+// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that
+// can be used to get the next page of results in subsequent list requests.
+// Acceptable values are `0` to `500`, inclusive. (Default: `500`)
+func (c *GlobalPublicDelegatedPrefixesListCall) MaxResults(maxResults int64) *GlobalPublicDelegatedPrefixesListCall {
+ c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
+ return c
+}
+
+// OrderBy sets the optional parameter "orderBy": Sorts list results by a
+// certain order. By default, results are returned in alphanumerical order
+// based on the resource name. You can also sort results in descending order
+// based on the creation timestamp using `orderBy="creationTimestamp desc".
+// This sorts results based on the `creationTimestamp` field in reverse
+// chronological order (newest result first). Use this to sort resources like
+// operations so that the newest operation is returned first. Currently, only
+// sorting by `name` or `creationTimestamp desc` is supported.
+func (c *GlobalPublicDelegatedPrefixesListCall) OrderBy(orderBy string) *GlobalPublicDelegatedPrefixesListCall {
+ c.urlParams_.Set("orderBy", orderBy)
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": Specifies a page token to
+// use. Set `pageToken` to the `nextPageToken` returned by a previous list
+// request to get the next page of results.
+func (c *GlobalPublicDelegatedPrefixesListCall) PageToken(pageToken string) *GlobalPublicDelegatedPrefixesListCall {
+ c.urlParams_.Set("pageToken", pageToken)
+ return c
+}
+
+// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
+// Opt-in for partial success behavior which provides partial results in case
+// of failure. The default value is false. For example, when partial success
+// behavior is enabled, aggregatedList for a single zone scope either returns
+// all resources in the zone or no resources, with an error code.
+func (c *GlobalPublicDelegatedPrefixesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *GlobalPublicDelegatedPrefixesListCall {
+ c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *GlobalPublicDelegatedPrefixesListCall) Fields(s ...googleapi.Field) *GlobalPublicDelegatedPrefixesListCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *GlobalPublicDelegatedPrefixesListCall) IfNoneMatch(entityTag string) *GlobalPublicDelegatedPrefixesListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *GlobalPublicDelegatedPrefixesListCall) Context(ctx context.Context) *GlobalPublicDelegatedPrefixesListCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *GlobalPublicDelegatedPrefixesListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *GlobalPublicDelegatedPrefixesListCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/global/publicDelegatedPrefixes")
+ 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{
+ "project": c.project,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.globalPublicDelegatedPrefixes.list" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *PublicDelegatedPrefixList.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 *GlobalPublicDelegatedPrefixesListCall) Do(opts ...googleapi.CallOption) (*PublicDelegatedPrefixList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &PublicDelegatedPrefixList{
+ 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
+}
+
+// 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 *GlobalPublicDelegatedPrefixesListCall) Pages(ctx context.Context, f func(*PublicDelegatedPrefixList) error) error {
+ c.ctx_ = ctx
+ defer c.PageToken(c.urlParams_.Get("pageToken"))
+ 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)
+ }
+}
+
+type GlobalPublicDelegatedPrefixesPatchCall struct {
+ s *Service
+ project string
+ publicDelegatedPrefix string
+ publicdelegatedprefix *PublicDelegatedPrefix
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Patch: Patches the specified global PublicDelegatedPrefix resource with the
+// data included in the request. This method supports PATCH semantics and uses
+// JSON merge patch format and processing rules.
+//
+// - project: Project ID for this request.
+// - publicDelegatedPrefix: Name of the PublicDelegatedPrefix resource to
+// patch.
+func (r *GlobalPublicDelegatedPrefixesService) Patch(project string, publicDelegatedPrefix string, publicdelegatedprefix *PublicDelegatedPrefix) *GlobalPublicDelegatedPrefixesPatchCall {
+ c := &GlobalPublicDelegatedPrefixesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.publicDelegatedPrefix = publicDelegatedPrefix
+ c.publicdelegatedprefix = publicdelegatedprefix
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *GlobalPublicDelegatedPrefixesPatchCall) RequestId(requestId string) *GlobalPublicDelegatedPrefixesPatchCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *GlobalPublicDelegatedPrefixesPatchCall) Fields(s ...googleapi.Field) *GlobalPublicDelegatedPrefixesPatchCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *GlobalPublicDelegatedPrefixesPatchCall) Context(ctx context.Context) *GlobalPublicDelegatedPrefixesPatchCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *GlobalPublicDelegatedPrefixesPatchCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *GlobalPublicDelegatedPrefixesPatchCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.publicdelegatedprefix)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicDelegatedPrefixes/{publicDelegatedPrefix}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("PATCH", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "publicDelegatedPrefix": c.publicDelegatedPrefix,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.globalPublicDelegatedPrefixes.patch" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *GlobalPublicDelegatedPrefixesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type HealthChecksAggregatedListCall struct {
+ s *Service
+ project string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// AggregatedList: Retrieves the list of all HealthCheck resources, regional
+// and global, available to the specified project. To prevent failure, Google
+// recommends that you set the `returnPartialSuccess` parameter to `true`.
+//
+// - project: Name of the project scoping this request.
+func (r *HealthChecksService) AggregatedList(project string) *HealthChecksAggregatedListCall {
+ c := &HealthChecksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ return c
+}
+
+// Filter sets the optional parameter "filter": A filter expression that
+// filters resources listed in the response. Most Compute resources support two
+// types of filter expressions: expressions that support regular expressions
+// and expressions that follow API improvement proposal AIP-160. These two
+// types of filter expressions cannot be mixed in one request. If you want to
+// use AIP-160, your expression must specify the field name, an operator, and
+// the value that you want to use for filtering. The value must be a string, a
+// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
+// `>=` or `:`. For example, if you are filtering Compute Engine instances, you
+// can exclude instances named `example-instance` by specifying `name !=
+// example-instance`. The `:*` comparison can be used to test whether a key has
+// been defined. For example, to find all objects with `owner` label use: ```
+// labels.owner:* ``` You can also filter nested fields. For example, you could
+// specify `scheduling.automaticRestart = false` to include instances only if
+// they are not scheduled for automatic restarts. You can use filtering on
+// nested fields to filter based on resource labels. To filter on multiple
+// expressions, provide each separate expression within parentheses. For
+// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel
+// Skylake") ``` By default, each expression is an `AND` expression. However,
+// you can include `AND` and `OR` expressions explicitly. For example: ```
+// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND
+// (scheduling.automaticRestart = true) ``` If you want to use a regular
+// expression, use the `eq` (equal) or `ne` (not equal) operator against a
+// single un-parenthesized expression with or without quotes or against
+// multiple parenthesized expressions. Examples: `fieldname eq unquoted
+// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted
+// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal
+// value is interpreted as a regular expression using Google RE2 library
+// syntax. The literal value must match the entire field. For example, to
+// filter for instances that do not end with name "instance", you would use
+// `name ne .*instance`. You cannot combine constraints on multiple fields
+// using regular expressions.
+func (c *HealthChecksAggregatedListCall) Filter(filter string) *HealthChecksAggregatedListCall {
+ c.urlParams_.Set("filter", filter)
+ return c
+}
+
+// IncludeAllScopes sets the optional parameter "includeAllScopes": Indicates
+// whether every visible scope for each scope type (zone, region, global)
+// should be included in the response. For new resource types added after this
+// field, the flag has no effect as new resource types will always include
+// every visible scope for each scope type in response. For resource types
+// which predate this field, if this flag is omitted or false, only scopes of
+// the scope types where the resource type is expected to be found will be
+// included.
+func (c *HealthChecksAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *HealthChecksAggregatedListCall {
+ c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes))
+ return c
+}
+
+// MaxResults sets the optional parameter "maxResults": The maximum number of
+// results per page that should be returned. If the number of available results
+// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that
+// can be used to get the next page of results in subsequent list requests.
+// Acceptable values are `0` to `500`, inclusive. (Default: `500`)
+func (c *HealthChecksAggregatedListCall) MaxResults(maxResults int64) *HealthChecksAggregatedListCall {
+ c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
+ return c
+}
+
+// OrderBy sets the optional parameter "orderBy": Sorts list results by a
+// certain order. By default, results are returned in alphanumerical order
+// based on the resource name. You can also sort results in descending order
+// based on the creation timestamp using `orderBy="creationTimestamp desc".
+// This sorts results based on the `creationTimestamp` field in reverse
+// chronological order (newest result first). Use this to sort resources like
+// operations so that the newest operation is returned first. Currently, only
+// sorting by `name` or `creationTimestamp desc` is supported.
+func (c *HealthChecksAggregatedListCall) OrderBy(orderBy string) *HealthChecksAggregatedListCall {
+ c.urlParams_.Set("orderBy", orderBy)
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": Specifies a page token to
+// use. Set `pageToken` to the `nextPageToken` returned by a previous list
+// request to get the next page of results.
+func (c *HealthChecksAggregatedListCall) PageToken(pageToken string) *HealthChecksAggregatedListCall {
+ c.urlParams_.Set("pageToken", pageToken)
+ return c
+}
+
+// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
+// Opt-in for partial success behavior which provides partial results in case
+// of failure. The default value is false. For example, when partial success
+// behavior is enabled, aggregatedList for a single zone scope either returns
+// all resources in the zone or no resources, with an error code.
+func (c *HealthChecksAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *HealthChecksAggregatedListCall {
+ c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
+ return c
+}
+
+// ServiceProjectNumber sets the optional parameter "serviceProjectNumber": The
+// Shared VPC service project id or service project number for which aggregated
+// list request is invoked for subnetworks list-usable api.
+func (c *HealthChecksAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *HealthChecksAggregatedListCall {
+ c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber))
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *HealthChecksAggregatedListCall) Fields(s ...googleapi.Field) *HealthChecksAggregatedListCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *HealthChecksAggregatedListCall) IfNoneMatch(entityTag string) *HealthChecksAggregatedListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *HealthChecksAggregatedListCall) Context(ctx context.Context) *HealthChecksAggregatedListCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *HealthChecksAggregatedListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *HealthChecksAggregatedListCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/aggregated/healthChecks")
+ 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{
+ "project": c.project,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.healthChecks.aggregatedList" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *HealthChecksAggregatedList.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 *HealthChecksAggregatedListCall) Do(opts ...googleapi.CallOption) (*HealthChecksAggregatedList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &HealthChecksAggregatedList{
+ 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
+}
+
+// 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 *HealthChecksAggregatedListCall) Pages(ctx context.Context, f func(*HealthChecksAggregatedList) error) error {
+ c.ctx_ = ctx
+ defer c.PageToken(c.urlParams_.Get("pageToken"))
+ 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)
+ }
+}
+
+type HealthChecksDeleteCall struct {
+ s *Service
+ project string
+ healthCheck string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Delete: Deletes the specified HealthCheck resource.
+//
+// - healthCheck: Name of the HealthCheck resource to delete.
+// - project: Project ID for this request.
+func (r *HealthChecksService) Delete(project string, healthCheck string) *HealthChecksDeleteCall {
+ c := &HealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.healthCheck = healthCheck
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *HealthChecksDeleteCall) RequestId(requestId string) *HealthChecksDeleteCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *HealthChecksDeleteCall) Fields(s ...googleapi.Field) *HealthChecksDeleteCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *HealthChecksDeleteCall) Context(ctx context.Context) *HealthChecksDeleteCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *HealthChecksDeleteCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *HealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/healthChecks/{healthCheck}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("DELETE", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "healthCheck": c.healthCheck,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.healthChecks.delete" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *HealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type HealthChecksGetCall struct {
+ s *Service
+ project string
+ healthCheck string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Get: Returns the specified HealthCheck resource.
+//
+// - healthCheck: Name of the HealthCheck resource to return.
+// - project: Project ID for this request.
+func (r *HealthChecksService) Get(project string, healthCheck string) *HealthChecksGetCall {
+ c := &HealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.healthCheck = healthCheck
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *HealthChecksGetCall) Fields(s ...googleapi.Field) *HealthChecksGetCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *HealthChecksGetCall) IfNoneMatch(entityTag string) *HealthChecksGetCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *HealthChecksGetCall) Context(ctx context.Context) *HealthChecksGetCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *HealthChecksGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *HealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/global/healthChecks/{healthCheck}")
+ 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{
+ "project": c.project,
+ "healthCheck": c.healthCheck,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.healthChecks.get" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *HealthCheck.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 *HealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HealthCheck, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &HealthCheck{
+ 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
+}
+
+type HealthChecksInsertCall struct {
+ s *Service
+ project string
+ healthcheck *HealthCheck
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Insert: Creates a HealthCheck resource in the specified project using the
+// data included in the request.
+//
+// - project: Project ID for this request.
+func (r *HealthChecksService) Insert(project string, healthcheck *HealthCheck) *HealthChecksInsertCall {
+ c := &HealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.healthcheck = healthcheck
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *HealthChecksInsertCall) RequestId(requestId string) *HealthChecksInsertCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *HealthChecksInsertCall) Fields(s ...googleapi.Field) *HealthChecksInsertCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *HealthChecksInsertCall) Context(ctx context.Context) *HealthChecksInsertCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *HealthChecksInsertCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *HealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/healthChecks")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.healthChecks.insert" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *HealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type HealthChecksListCall struct {
+ s *Service
+ project string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// List: Retrieves the list of HealthCheck resources available to the specified
+// project.
+//
+// - project: Project ID for this request.
+func (r *HealthChecksService) List(project string) *HealthChecksListCall {
+ c := &HealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ return c
+}
+
+// Filter sets the optional parameter "filter": A filter expression that
+// filters resources listed in the response. Most Compute resources support two
+// types of filter expressions: expressions that support regular expressions
+// and expressions that follow API improvement proposal AIP-160. These two
+// types of filter expressions cannot be mixed in one request. If you want to
+// use AIP-160, your expression must specify the field name, an operator, and
+// the value that you want to use for filtering. The value must be a string, a
+// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
+// `>=` or `:`. For example, if you are filtering Compute Engine instances, you
+// can exclude instances named `example-instance` by specifying `name !=
+// example-instance`. The `:*` comparison can be used to test whether a key has
+// been defined. For example, to find all objects with `owner` label use: ```
+// labels.owner:* ``` You can also filter nested fields. For example, you could
+// specify `scheduling.automaticRestart = false` to include instances only if
+// they are not scheduled for automatic restarts. You can use filtering on
+// nested fields to filter based on resource labels. To filter on multiple
+// expressions, provide each separate expression within parentheses. For
+// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel
+// Skylake") ``` By default, each expression is an `AND` expression. However,
+// you can include `AND` and `OR` expressions explicitly. For example: ```
+// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND
+// (scheduling.automaticRestart = true) ``` If you want to use a regular
+// expression, use the `eq` (equal) or `ne` (not equal) operator against a
+// single un-parenthesized expression with or without quotes or against
+// multiple parenthesized expressions. Examples: `fieldname eq unquoted
+// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted
+// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal
+// value is interpreted as a regular expression using Google RE2 library
+// syntax. The literal value must match the entire field. For example, to
+// filter for instances that do not end with name "instance", you would use
+// `name ne .*instance`. You cannot combine constraints on multiple fields
+// using regular expressions.
+func (c *HealthChecksListCall) Filter(filter string) *HealthChecksListCall {
+ c.urlParams_.Set("filter", filter)
+ return c
+}
+
+// MaxResults sets the optional parameter "maxResults": The maximum number of
+// results per page that should be returned. If the number of available results
+// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that
+// can be used to get the next page of results in subsequent list requests.
+// Acceptable values are `0` to `500`, inclusive. (Default: `500`)
+func (c *HealthChecksListCall) MaxResults(maxResults int64) *HealthChecksListCall {
+ c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
+ return c
+}
+
+// OrderBy sets the optional parameter "orderBy": Sorts list results by a
+// certain order. By default, results are returned in alphanumerical order
+// based on the resource name. You can also sort results in descending order
+// based on the creation timestamp using `orderBy="creationTimestamp desc".
+// This sorts results based on the `creationTimestamp` field in reverse
+// chronological order (newest result first). Use this to sort resources like
+// operations so that the newest operation is returned first. Currently, only
+// sorting by `name` or `creationTimestamp desc` is supported.
+func (c *HealthChecksListCall) OrderBy(orderBy string) *HealthChecksListCall {
+ c.urlParams_.Set("orderBy", orderBy)
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": Specifies a page token to
+// use. Set `pageToken` to the `nextPageToken` returned by a previous list
+// request to get the next page of results.
+func (c *HealthChecksListCall) PageToken(pageToken string) *HealthChecksListCall {
+ c.urlParams_.Set("pageToken", pageToken)
+ return c
+}
+
+// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
+// Opt-in for partial success behavior which provides partial results in case
+// of failure. The default value is false. For example, when partial success
+// behavior is enabled, aggregatedList for a single zone scope either returns
+// all resources in the zone or no resources, with an error code.
+func (c *HealthChecksListCall) ReturnPartialSuccess(returnPartialSuccess bool) *HealthChecksListCall {
+ c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *HealthChecksListCall) Fields(s ...googleapi.Field) *HealthChecksListCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *HealthChecksListCall) IfNoneMatch(entityTag string) *HealthChecksListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *HealthChecksListCall) Context(ctx context.Context) *HealthChecksListCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *HealthChecksListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *HealthChecksListCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/global/healthChecks")
+ 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{
+ "project": c.project,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.healthChecks.list" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *HealthCheckList.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 *HealthChecksListCall) Do(opts ...googleapi.CallOption) (*HealthCheckList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &HealthCheckList{
+ 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
+}
+
+// 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 *HealthChecksListCall) Pages(ctx context.Context, f func(*HealthCheckList) error) error {
+ c.ctx_ = ctx
+ defer c.PageToken(c.urlParams_.Get("pageToken"))
+ 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)
+ }
+}
+
+type HealthChecksPatchCall struct {
+ s *Service
+ project string
+ healthCheck string
+ healthcheck *HealthCheck
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Patch: Updates a HealthCheck resource in the specified project using the
+// data included in the request. This method supports PATCH semantics and uses
+// the JSON merge patch format and processing rules.
+//
+// - healthCheck: Name of the HealthCheck resource to patch.
+// - project: Project ID for this request.
+func (r *HealthChecksService) Patch(project string, healthCheck string, healthcheck *HealthCheck) *HealthChecksPatchCall {
+ c := &HealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.healthCheck = healthCheck
+ c.healthcheck = healthcheck
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *HealthChecksPatchCall) RequestId(requestId string) *HealthChecksPatchCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *HealthChecksPatchCall) Fields(s ...googleapi.Field) *HealthChecksPatchCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *HealthChecksPatchCall) Context(ctx context.Context) *HealthChecksPatchCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *HealthChecksPatchCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *HealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/healthChecks/{healthCheck}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("PATCH", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "healthCheck": c.healthCheck,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.healthChecks.patch" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *HealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type HealthChecksUpdateCall struct {
+ s *Service
+ project string
+ healthCheck string
+ healthcheck *HealthCheck
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Update: Updates a HealthCheck resource in the specified project using the
+// data included in the request.
+//
+// - healthCheck: Name of the HealthCheck resource to update.
+// - project: Project ID for this request.
+func (r *HealthChecksService) Update(project string, healthCheck string, healthcheck *HealthCheck) *HealthChecksUpdateCall {
+ c := &HealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.healthCheck = healthCheck
+ c.healthcheck = healthcheck
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *HealthChecksUpdateCall) RequestId(requestId string) *HealthChecksUpdateCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *HealthChecksUpdateCall) Fields(s ...googleapi.Field) *HealthChecksUpdateCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *HealthChecksUpdateCall) Context(ctx context.Context) *HealthChecksUpdateCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *HealthChecksUpdateCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *HealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/healthChecks/{healthCheck}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("PUT", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "healthCheck": c.healthCheck,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.healthChecks.update" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *HealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type HttpHealthChecksDeleteCall struct {
+ s *Service
+ project string
+ httpHealthCheck string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Delete: Deletes the specified HttpHealthCheck resource.
+//
+// - httpHealthCheck: Name of the HttpHealthCheck resource to delete.
+// - project: Project ID for this request.
+func (r *HttpHealthChecksService) Delete(project string, httpHealthCheck string) *HttpHealthChecksDeleteCall {
+ c := &HttpHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.httpHealthCheck = httpHealthCheck
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *HttpHealthChecksDeleteCall) RequestId(requestId string) *HttpHealthChecksDeleteCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *HttpHealthChecksDeleteCall) Fields(s ...googleapi.Field) *HttpHealthChecksDeleteCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *HttpHealthChecksDeleteCall) Context(ctx context.Context) *HttpHealthChecksDeleteCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *HttpHealthChecksDeleteCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *HttpHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/httpHealthChecks/{httpHealthCheck}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("DELETE", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "httpHealthCheck": c.httpHealthCheck,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.httpHealthChecks.delete" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *HttpHealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type HttpHealthChecksGetCall struct {
+ s *Service
+ project string
+ httpHealthCheck string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Get: Returns the specified HttpHealthCheck resource.
+//
+// - httpHealthCheck: Name of the HttpHealthCheck resource to return.
+// - project: Project ID for this request.
+func (r *HttpHealthChecksService) Get(project string, httpHealthCheck string) *HttpHealthChecksGetCall {
+ c := &HttpHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.httpHealthCheck = httpHealthCheck
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *HttpHealthChecksGetCall) Fields(s ...googleapi.Field) *HttpHealthChecksGetCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *HttpHealthChecksGetCall) IfNoneMatch(entityTag string) *HttpHealthChecksGetCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *HttpHealthChecksGetCall) Context(ctx context.Context) *HttpHealthChecksGetCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *HttpHealthChecksGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *HttpHealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/global/httpHealthChecks/{httpHealthCheck}")
+ 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{
+ "project": c.project,
+ "httpHealthCheck": c.httpHealthCheck,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.httpHealthChecks.get" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *HttpHealthCheck.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 *HttpHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HttpHealthCheck, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &HttpHealthCheck{
+ 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
+}
+
+type HttpHealthChecksInsertCall struct {
+ s *Service
+ project string
+ httphealthcheck *HttpHealthCheck
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Insert: Creates a HttpHealthCheck resource in the specified project using
+// the data included in the request.
+//
+// - project: Project ID for this request.
+func (r *HttpHealthChecksService) Insert(project string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksInsertCall {
+ c := &HttpHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.httphealthcheck = httphealthcheck
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *HttpHealthChecksInsertCall) RequestId(requestId string) *HttpHealthChecksInsertCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *HttpHealthChecksInsertCall) Fields(s ...googleapi.Field) *HttpHealthChecksInsertCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *HttpHealthChecksInsertCall) Context(ctx context.Context) *HttpHealthChecksInsertCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *HttpHealthChecksInsertCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *HttpHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/httpHealthChecks")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.httpHealthChecks.insert" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *HttpHealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type HttpHealthChecksListCall struct {
+ s *Service
+ project string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// List: Retrieves the list of HttpHealthCheck resources available to the
+// specified project.
+//
+// - project: Project ID for this request.
+func (r *HttpHealthChecksService) List(project string) *HttpHealthChecksListCall {
+ c := &HttpHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ return c
+}
+
+// Filter sets the optional parameter "filter": A filter expression that
+// filters resources listed in the response. Most Compute resources support two
+// types of filter expressions: expressions that support regular expressions
+// and expressions that follow API improvement proposal AIP-160. These two
+// types of filter expressions cannot be mixed in one request. If you want to
+// use AIP-160, your expression must specify the field name, an operator, and
+// the value that you want to use for filtering. The value must be a string, a
+// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
+// `>=` or `:`. For example, if you are filtering Compute Engine instances, you
+// can exclude instances named `example-instance` by specifying `name !=
+// example-instance`. The `:*` comparison can be used to test whether a key has
+// been defined. For example, to find all objects with `owner` label use: ```
+// labels.owner:* ``` You can also filter nested fields. For example, you could
+// specify `scheduling.automaticRestart = false` to include instances only if
+// they are not scheduled for automatic restarts. You can use filtering on
+// nested fields to filter based on resource labels. To filter on multiple
+// expressions, provide each separate expression within parentheses. For
+// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel
+// Skylake") ``` By default, each expression is an `AND` expression. However,
+// you can include `AND` and `OR` expressions explicitly. For example: ```
+// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND
+// (scheduling.automaticRestart = true) ``` If you want to use a regular
+// expression, use the `eq` (equal) or `ne` (not equal) operator against a
+// single un-parenthesized expression with or without quotes or against
+// multiple parenthesized expressions. Examples: `fieldname eq unquoted
+// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted
+// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal
+// value is interpreted as a regular expression using Google RE2 library
+// syntax. The literal value must match the entire field. For example, to
+// filter for instances that do not end with name "instance", you would use
+// `name ne .*instance`. You cannot combine constraints on multiple fields
+// using regular expressions.
+func (c *HttpHealthChecksListCall) Filter(filter string) *HttpHealthChecksListCall {
+ c.urlParams_.Set("filter", filter)
+ return c
+}
+
+// MaxResults sets the optional parameter "maxResults": The maximum number of
+// results per page that should be returned. If the number of available results
+// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that
+// can be used to get the next page of results in subsequent list requests.
+// Acceptable values are `0` to `500`, inclusive. (Default: `500`)
+func (c *HttpHealthChecksListCall) MaxResults(maxResults int64) *HttpHealthChecksListCall {
+ c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
+ return c
+}
+
+// OrderBy sets the optional parameter "orderBy": Sorts list results by a
+// certain order. By default, results are returned in alphanumerical order
+// based on the resource name. You can also sort results in descending order
+// based on the creation timestamp using `orderBy="creationTimestamp desc".
+// This sorts results based on the `creationTimestamp` field in reverse
+// chronological order (newest result first). Use this to sort resources like
+// operations so that the newest operation is returned first. Currently, only
+// sorting by `name` or `creationTimestamp desc` is supported.
+func (c *HttpHealthChecksListCall) OrderBy(orderBy string) *HttpHealthChecksListCall {
+ c.urlParams_.Set("orderBy", orderBy)
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": Specifies a page token to
+// use. Set `pageToken` to the `nextPageToken` returned by a previous list
+// request to get the next page of results.
+func (c *HttpHealthChecksListCall) PageToken(pageToken string) *HttpHealthChecksListCall {
+ c.urlParams_.Set("pageToken", pageToken)
+ return c
+}
+
+// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
+// Opt-in for partial success behavior which provides partial results in case
+// of failure. The default value is false. For example, when partial success
+// behavior is enabled, aggregatedList for a single zone scope either returns
+// all resources in the zone or no resources, with an error code.
+func (c *HttpHealthChecksListCall) ReturnPartialSuccess(returnPartialSuccess bool) *HttpHealthChecksListCall {
+ c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *HttpHealthChecksListCall) Fields(s ...googleapi.Field) *HttpHealthChecksListCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *HttpHealthChecksListCall) IfNoneMatch(entityTag string) *HttpHealthChecksListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *HttpHealthChecksListCall) Context(ctx context.Context) *HttpHealthChecksListCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *HttpHealthChecksListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *HttpHealthChecksListCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/global/httpHealthChecks")
+ 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{
+ "project": c.project,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.httpHealthChecks.list" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *HttpHealthCheckList.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 *HttpHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HttpHealthCheckList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &HttpHealthCheckList{
+ 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
+}
+
+// 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 *HttpHealthChecksListCall) Pages(ctx context.Context, f func(*HttpHealthCheckList) error) error {
+ c.ctx_ = ctx
+ defer c.PageToken(c.urlParams_.Get("pageToken"))
+ 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)
+ }
+}
+
+type HttpHealthChecksPatchCall struct {
+ s *Service
+ project string
+ httpHealthCheck string
+ httphealthcheck *HttpHealthCheck
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Patch: Updates a HttpHealthCheck resource in the specified project using the
+// data included in the request. This method supports PATCH semantics and uses
+// the JSON merge patch format and processing rules.
+//
+// - httpHealthCheck: Name of the HttpHealthCheck resource to patch.
+// - project: Project ID for this request.
+func (r *HttpHealthChecksService) Patch(project string, httpHealthCheck string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksPatchCall {
+ c := &HttpHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.httpHealthCheck = httpHealthCheck
+ c.httphealthcheck = httphealthcheck
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *HttpHealthChecksPatchCall) RequestId(requestId string) *HttpHealthChecksPatchCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *HttpHealthChecksPatchCall) Fields(s ...googleapi.Field) *HttpHealthChecksPatchCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *HttpHealthChecksPatchCall) Context(ctx context.Context) *HttpHealthChecksPatchCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *HttpHealthChecksPatchCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *HttpHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/httpHealthChecks/{httpHealthCheck}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("PATCH", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "httpHealthCheck": c.httpHealthCheck,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.httpHealthChecks.patch" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *HttpHealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type HttpHealthChecksUpdateCall struct {
+ s *Service
+ project string
+ httpHealthCheck string
+ httphealthcheck *HttpHealthCheck
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Update: Updates a HttpHealthCheck resource in the specified project using
+// the data included in the request.
+//
+// - httpHealthCheck: Name of the HttpHealthCheck resource to update.
+// - project: Project ID for this request.
+func (r *HttpHealthChecksService) Update(project string, httpHealthCheck string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksUpdateCall {
+ c := &HttpHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.httpHealthCheck = httpHealthCheck
+ c.httphealthcheck = httphealthcheck
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *HttpHealthChecksUpdateCall) RequestId(requestId string) *HttpHealthChecksUpdateCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *HttpHealthChecksUpdateCall) Fields(s ...googleapi.Field) *HttpHealthChecksUpdateCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *HttpHealthChecksUpdateCall) Context(ctx context.Context) *HttpHealthChecksUpdateCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *HttpHealthChecksUpdateCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *HttpHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/httpHealthChecks/{httpHealthCheck}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("PUT", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "httpHealthCheck": c.httpHealthCheck,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.httpHealthChecks.update" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *HttpHealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type HttpsHealthChecksDeleteCall struct {
+ s *Service
+ project string
+ httpsHealthCheck string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Delete: Deletes the specified HttpsHealthCheck resource.
+//
+// - httpsHealthCheck: Name of the HttpsHealthCheck resource to delete.
+// - project: Project ID for this request.
+func (r *HttpsHealthChecksService) Delete(project string, httpsHealthCheck string) *HttpsHealthChecksDeleteCall {
+ c := &HttpsHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.httpsHealthCheck = httpsHealthCheck
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *HttpsHealthChecksDeleteCall) RequestId(requestId string) *HttpsHealthChecksDeleteCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *HttpsHealthChecksDeleteCall) Fields(s ...googleapi.Field) *HttpsHealthChecksDeleteCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *HttpsHealthChecksDeleteCall) Context(ctx context.Context) *HttpsHealthChecksDeleteCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *HttpsHealthChecksDeleteCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *HttpsHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("DELETE", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "httpsHealthCheck": c.httpsHealthCheck,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.httpsHealthChecks.delete" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *HttpsHealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type HttpsHealthChecksGetCall struct {
+ s *Service
+ project string
+ httpsHealthCheck string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Get: Returns the specified HttpsHealthCheck resource.
+//
+// - httpsHealthCheck: Name of the HttpsHealthCheck resource to return.
+// - project: Project ID for this request.
+func (r *HttpsHealthChecksService) Get(project string, httpsHealthCheck string) *HttpsHealthChecksGetCall {
+ c := &HttpsHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.httpsHealthCheck = httpsHealthCheck
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *HttpsHealthChecksGetCall) Fields(s ...googleapi.Field) *HttpsHealthChecksGetCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *HttpsHealthChecksGetCall) IfNoneMatch(entityTag string) *HttpsHealthChecksGetCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *HttpsHealthChecksGetCall) Context(ctx context.Context) *HttpsHealthChecksGetCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *HttpsHealthChecksGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *HttpsHealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}")
+ 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{
+ "project": c.project,
+ "httpsHealthCheck": c.httpsHealthCheck,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.httpsHealthChecks.get" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *HttpsHealthCheck.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 *HttpsHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HttpsHealthCheck, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &HttpsHealthCheck{
+ 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
+}
+
+type HttpsHealthChecksInsertCall struct {
+ s *Service
+ project string
+ httpshealthcheck *HttpsHealthCheck
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Insert: Creates a HttpsHealthCheck resource in the specified project using
+// the data included in the request.
+//
+// - project: Project ID for this request.
+func (r *HttpsHealthChecksService) Insert(project string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksInsertCall {
+ c := &HttpsHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.httpshealthcheck = httpshealthcheck
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *HttpsHealthChecksInsertCall) RequestId(requestId string) *HttpsHealthChecksInsertCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *HttpsHealthChecksInsertCall) Fields(s ...googleapi.Field) *HttpsHealthChecksInsertCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *HttpsHealthChecksInsertCall) Context(ctx context.Context) *HttpsHealthChecksInsertCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *HttpsHealthChecksInsertCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *HttpsHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/httpsHealthChecks")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.httpsHealthChecks.insert" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *HttpsHealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type HttpsHealthChecksListCall struct {
+ s *Service
+ project string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// List: Retrieves the list of HttpsHealthCheck resources available to the
+// specified project.
+//
+// - project: Project ID for this request.
+func (r *HttpsHealthChecksService) List(project string) *HttpsHealthChecksListCall {
+ c := &HttpsHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ return c
+}
+
+// Filter sets the optional parameter "filter": A filter expression that
+// filters resources listed in the response. Most Compute resources support two
+// types of filter expressions: expressions that support regular expressions
+// and expressions that follow API improvement proposal AIP-160. These two
+// types of filter expressions cannot be mixed in one request. If you want to
+// use AIP-160, your expression must specify the field name, an operator, and
+// the value that you want to use for filtering. The value must be a string, a
+// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
+// `>=` or `:`. For example, if you are filtering Compute Engine instances, you
+// can exclude instances named `example-instance` by specifying `name !=
+// example-instance`. The `:*` comparison can be used to test whether a key has
+// been defined. For example, to find all objects with `owner` label use: ```
+// labels.owner:* ``` You can also filter nested fields. For example, you could
+// specify `scheduling.automaticRestart = false` to include instances only if
+// they are not scheduled for automatic restarts. You can use filtering on
+// nested fields to filter based on resource labels. To filter on multiple
+// expressions, provide each separate expression within parentheses. For
+// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel
+// Skylake") ``` By default, each expression is an `AND` expression. However,
+// you can include `AND` and `OR` expressions explicitly. For example: ```
+// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND
+// (scheduling.automaticRestart = true) ``` If you want to use a regular
+// expression, use the `eq` (equal) or `ne` (not equal) operator against a
+// single un-parenthesized expression with or without quotes or against
+// multiple parenthesized expressions. Examples: `fieldname eq unquoted
+// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted
+// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal
+// value is interpreted as a regular expression using Google RE2 library
+// syntax. The literal value must match the entire field. For example, to
+// filter for instances that do not end with name "instance", you would use
+// `name ne .*instance`. You cannot combine constraints on multiple fields
+// using regular expressions.
+func (c *HttpsHealthChecksListCall) Filter(filter string) *HttpsHealthChecksListCall {
+ c.urlParams_.Set("filter", filter)
+ return c
+}
+
+// MaxResults sets the optional parameter "maxResults": The maximum number of
+// results per page that should be returned. If the number of available results
+// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that
+// can be used to get the next page of results in subsequent list requests.
+// Acceptable values are `0` to `500`, inclusive. (Default: `500`)
+func (c *HttpsHealthChecksListCall) MaxResults(maxResults int64) *HttpsHealthChecksListCall {
+ c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
+ return c
+}
+
+// OrderBy sets the optional parameter "orderBy": Sorts list results by a
+// certain order. By default, results are returned in alphanumerical order
+// based on the resource name. You can also sort results in descending order
+// based on the creation timestamp using `orderBy="creationTimestamp desc".
+// This sorts results based on the `creationTimestamp` field in reverse
+// chronological order (newest result first). Use this to sort resources like
+// operations so that the newest operation is returned first. Currently, only
+// sorting by `name` or `creationTimestamp desc` is supported.
+func (c *HttpsHealthChecksListCall) OrderBy(orderBy string) *HttpsHealthChecksListCall {
+ c.urlParams_.Set("orderBy", orderBy)
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": Specifies a page token to
+// use. Set `pageToken` to the `nextPageToken` returned by a previous list
+// request to get the next page of results.
+func (c *HttpsHealthChecksListCall) PageToken(pageToken string) *HttpsHealthChecksListCall {
+ c.urlParams_.Set("pageToken", pageToken)
+ return c
+}
+
+// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
+// Opt-in for partial success behavior which provides partial results in case
+// of failure. The default value is false. For example, when partial success
+// behavior is enabled, aggregatedList for a single zone scope either returns
+// all resources in the zone or no resources, with an error code.
+func (c *HttpsHealthChecksListCall) ReturnPartialSuccess(returnPartialSuccess bool) *HttpsHealthChecksListCall {
+ c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *HttpsHealthChecksListCall) Fields(s ...googleapi.Field) *HttpsHealthChecksListCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *HttpsHealthChecksListCall) IfNoneMatch(entityTag string) *HttpsHealthChecksListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *HttpsHealthChecksListCall) Context(ctx context.Context) *HttpsHealthChecksListCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *HttpsHealthChecksListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *HttpsHealthChecksListCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/global/httpsHealthChecks")
+ 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{
+ "project": c.project,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.httpsHealthChecks.list" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *HttpsHealthCheckList.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 *HttpsHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HttpsHealthCheckList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &HttpsHealthCheckList{
+ 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
+}
+
+// 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 *HttpsHealthChecksListCall) Pages(ctx context.Context, f func(*HttpsHealthCheckList) error) error {
+ c.ctx_ = ctx
+ defer c.PageToken(c.urlParams_.Get("pageToken"))
+ 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)
+ }
+}
+
+type HttpsHealthChecksPatchCall struct {
+ s *Service
+ project string
+ httpsHealthCheck string
+ httpshealthcheck *HttpsHealthCheck
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Patch: Updates a HttpsHealthCheck resource in the specified project using
+// the data included in the request. This method supports PATCH semantics and
+// uses the JSON merge patch format and processing rules.
+//
+// - httpsHealthCheck: Name of the HttpsHealthCheck resource to patch.
+// - project: Project ID for this request.
+func (r *HttpsHealthChecksService) Patch(project string, httpsHealthCheck string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksPatchCall {
+ c := &HttpsHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.httpsHealthCheck = httpsHealthCheck
+ c.httpshealthcheck = httpshealthcheck
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *HttpsHealthChecksPatchCall) RequestId(requestId string) *HttpsHealthChecksPatchCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *HttpsHealthChecksPatchCall) Fields(s ...googleapi.Field) *HttpsHealthChecksPatchCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *HttpsHealthChecksPatchCall) Context(ctx context.Context) *HttpsHealthChecksPatchCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *HttpsHealthChecksPatchCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *HttpsHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("PATCH", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "httpsHealthCheck": c.httpsHealthCheck,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.httpsHealthChecks.patch" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *HttpsHealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type HttpsHealthChecksUpdateCall struct {
+ s *Service
+ project string
+ httpsHealthCheck string
+ httpshealthcheck *HttpsHealthCheck
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Update: Updates a HttpsHealthCheck resource in the specified project using
+// the data included in the request.
+//
+// - httpsHealthCheck: Name of the HttpsHealthCheck resource to update.
+// - project: Project ID for this request.
+func (r *HttpsHealthChecksService) Update(project string, httpsHealthCheck string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksUpdateCall {
+ c := &HttpsHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.httpsHealthCheck = httpsHealthCheck
+ c.httpshealthcheck = httpshealthcheck
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *HttpsHealthChecksUpdateCall) RequestId(requestId string) *HttpsHealthChecksUpdateCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *HttpsHealthChecksUpdateCall) Fields(s ...googleapi.Field) *HttpsHealthChecksUpdateCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *HttpsHealthChecksUpdateCall) Context(ctx context.Context) *HttpsHealthChecksUpdateCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *HttpsHealthChecksUpdateCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *HttpsHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("PUT", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "httpsHealthCheck": c.httpsHealthCheck,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.httpsHealthChecks.update" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *HttpsHealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type ImageFamilyViewsGetCall struct {
+ s *Service
+ project string
+ zone string
+ family string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Get: Returns the latest image that is part of an image family, is not
+// deprecated and is rolled out in the specified zone.
+//
+// - family: Name of the image family to search for.
+// - project: Project ID for this request.
+// - zone: The name of the zone for this request.
+func (r *ImageFamilyViewsService) Get(project string, zone string, family string) *ImageFamilyViewsGetCall {
+ c := &ImageFamilyViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.zone = zone
+ c.family = family
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *ImageFamilyViewsGetCall) Fields(s ...googleapi.Field) *ImageFamilyViewsGetCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *ImageFamilyViewsGetCall) IfNoneMatch(entityTag string) *ImageFamilyViewsGetCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *ImageFamilyViewsGetCall) Context(ctx context.Context) *ImageFamilyViewsGetCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *ImageFamilyViewsGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ImageFamilyViewsGetCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/zones/{zone}/imageFamilyViews/{family}")
+ 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{
+ "project": c.project,
+ "zone": c.zone,
+ "family": c.family,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.imageFamilyViews.get" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *ImageFamilyView.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 *ImageFamilyViewsGetCall) Do(opts ...googleapi.CallOption) (*ImageFamilyView, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &ImageFamilyView{
+ 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
+}
+
+type ImagesDeleteCall struct {
+ s *Service
+ project string
+ image string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Delete: Deletes the specified image.
+//
+// - image: Name of the image resource to delete.
+// - project: Project ID for this request.
+func (r *ImagesService) Delete(project string, image string) *ImagesDeleteCall {
+ c := &ImagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.image = image
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *ImagesDeleteCall) RequestId(requestId string) *ImagesDeleteCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *ImagesDeleteCall) Fields(s ...googleapi.Field) *ImagesDeleteCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *ImagesDeleteCall) Context(ctx context.Context) *ImagesDeleteCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *ImagesDeleteCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ImagesDeleteCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/images/{image}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("DELETE", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "image": c.image,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.images.delete" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *ImagesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type ImagesDeprecateCall struct {
+ s *Service
+ project string
+ image string
+ deprecationstatus *DeprecationStatus
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Deprecate: Sets the deprecation status of an image. If an empty request body
+// is given, clears the deprecation status instead.
+//
+// - image: Image name.
+// - project: Project ID for this request.
+func (r *ImagesService) Deprecate(project string, image string, deprecationstatus *DeprecationStatus) *ImagesDeprecateCall {
+ c := &ImagesDeprecateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.image = image
+ c.deprecationstatus = deprecationstatus
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *ImagesDeprecateCall) RequestId(requestId string) *ImagesDeprecateCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *ImagesDeprecateCall) Fields(s ...googleapi.Field) *ImagesDeprecateCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *ImagesDeprecateCall) Context(ctx context.Context) *ImagesDeprecateCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *ImagesDeprecateCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ImagesDeprecateCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.deprecationstatus)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/images/{image}/deprecate")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "image": c.image,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.images.deprecate" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *ImagesDeprecateCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type ImagesGetCall struct {
+ s *Service
+ project string
+ image string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Get: Returns the specified image.
+//
+// - image: Name of the image resource to return.
+// - project: Project ID for this request.
+func (r *ImagesService) Get(project string, image string) *ImagesGetCall {
+ c := &ImagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.image = image
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *ImagesGetCall) Fields(s ...googleapi.Field) *ImagesGetCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *ImagesGetCall) IfNoneMatch(entityTag string) *ImagesGetCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *ImagesGetCall) Context(ctx context.Context) *ImagesGetCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *ImagesGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ImagesGetCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/global/images/{image}")
+ 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{
+ "project": c.project,
+ "image": c.image,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.images.get" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Image.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 *ImagesGetCall) Do(opts ...googleapi.CallOption) (*Image, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Image{
+ 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
+}
+
+type ImagesGetFromFamilyCall struct {
+ s *Service
+ project string
+ family string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// GetFromFamily: Returns the latest image that is part of an image family and
+// is not deprecated. For more information on image families, see Public image
+// families documentation.
+//
+// - family: Name of the image family to search for.
+// - project: The image project that the image belongs to. For example, to get
+// a CentOS image, specify centos-cloud as the image project.
+func (r *ImagesService) GetFromFamily(project string, family string) *ImagesGetFromFamilyCall {
+ c := &ImagesGetFromFamilyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.family = family
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *ImagesGetFromFamilyCall) Fields(s ...googleapi.Field) *ImagesGetFromFamilyCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *ImagesGetFromFamilyCall) IfNoneMatch(entityTag string) *ImagesGetFromFamilyCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *ImagesGetFromFamilyCall) Context(ctx context.Context) *ImagesGetFromFamilyCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *ImagesGetFromFamilyCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ImagesGetFromFamilyCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/global/images/family/{family}")
+ 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{
+ "project": c.project,
+ "family": c.family,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.images.getFromFamily" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Image.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 *ImagesGetFromFamilyCall) Do(opts ...googleapi.CallOption) (*Image, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Image{
+ 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
+}
+
+type ImagesGetIamPolicyCall struct {
+ s *Service
+ project string
+ resource string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// GetIamPolicy: Gets the access control policy for a resource. May be empty if
+// no such policy or resource exists.
+//
+// - project: Project ID for this request.
+// - resource: Name or id of the resource for this request.
+func (r *ImagesService) GetIamPolicy(project string, resource string) *ImagesGetIamPolicyCall {
+ c := &ImagesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.resource = resource
+ return c
+}
+
+// OptionsRequestedPolicyVersion sets the optional parameter
+// "optionsRequestedPolicyVersion": Requested IAM Policy version.
+func (c *ImagesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ImagesGetIamPolicyCall {
+ c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *ImagesGetIamPolicyCall) Fields(s ...googleapi.Field) *ImagesGetIamPolicyCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *ImagesGetIamPolicyCall) IfNoneMatch(entityTag string) *ImagesGetIamPolicyCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *ImagesGetIamPolicyCall) Context(ctx context.Context) *ImagesGetIamPolicyCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *ImagesGetIamPolicyCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ImagesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/global/images/{resource}/getIamPolicy")
+ 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{
+ "project": c.project,
+ "resource": c.resource,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.images.getIamPolicy" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Policy.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 *ImagesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Policy{
+ 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
+}
+
+type ImagesInsertCall struct {
+ s *Service
+ project string
+ image *Image
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Insert: Creates an image in the specified project using the data included in
+// the request.
+//
+// - project: Project ID for this request.
+func (r *ImagesService) Insert(project string, image *Image) *ImagesInsertCall {
+ c := &ImagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.image = image
+ return c
+}
+
+// ForceCreate sets the optional parameter "forceCreate": Force image creation
+// if true.
+func (c *ImagesInsertCall) ForceCreate(forceCreate bool) *ImagesInsertCall {
+ c.urlParams_.Set("forceCreate", fmt.Sprint(forceCreate))
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *ImagesInsertCall) RequestId(requestId string) *ImagesInsertCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *ImagesInsertCall) Fields(s ...googleapi.Field) *ImagesInsertCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *ImagesInsertCall) Context(ctx context.Context) *ImagesInsertCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *ImagesInsertCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ImagesInsertCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.image)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/images")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.images.insert" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *ImagesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type ImagesListCall struct {
+ s *Service
+ project string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// List: Retrieves the list of custom images available to the specified
+// project. Custom images are images you create that belong to your project.
+// This method does not get any images that belong to other projects, including
+// publicly-available images, like Debian 8. If you want to get a list of
+// publicly-available images, use this method to make a request to the
+// respective image project, such as debian-cloud or windows-cloud.
+//
+// - project: Project ID for this request.
+func (r *ImagesService) List(project string) *ImagesListCall {
+ c := &ImagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ return c
+}
+
+// Filter sets the optional parameter "filter": A filter expression that
+// filters resources listed in the response. Most Compute resources support two
+// types of filter expressions: expressions that support regular expressions
+// and expressions that follow API improvement proposal AIP-160. These two
+// types of filter expressions cannot be mixed in one request. If you want to
+// use AIP-160, your expression must specify the field name, an operator, and
+// the value that you want to use for filtering. The value must be a string, a
+// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
+// `>=` or `:`. For example, if you are filtering Compute Engine instances, you
+// can exclude instances named `example-instance` by specifying `name !=
+// example-instance`. The `:*` comparison can be used to test whether a key has
+// been defined. For example, to find all objects with `owner` label use: ```
+// labels.owner:* ``` You can also filter nested fields. For example, you could
+// specify `scheduling.automaticRestart = false` to include instances only if
+// they are not scheduled for automatic restarts. You can use filtering on
+// nested fields to filter based on resource labels. To filter on multiple
+// expressions, provide each separate expression within parentheses. For
+// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel
+// Skylake") ``` By default, each expression is an `AND` expression. However,
+// you can include `AND` and `OR` expressions explicitly. For example: ```
+// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND
+// (scheduling.automaticRestart = true) ``` If you want to use a regular
+// expression, use the `eq` (equal) or `ne` (not equal) operator against a
+// single un-parenthesized expression with or without quotes or against
+// multiple parenthesized expressions. Examples: `fieldname eq unquoted
+// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted
+// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal
+// value is interpreted as a regular expression using Google RE2 library
+// syntax. The literal value must match the entire field. For example, to
+// filter for instances that do not end with name "instance", you would use
+// `name ne .*instance`. You cannot combine constraints on multiple fields
+// using regular expressions.
+func (c *ImagesListCall) Filter(filter string) *ImagesListCall {
+ c.urlParams_.Set("filter", filter)
+ return c
+}
+
+// MaxResults sets the optional parameter "maxResults": The maximum number of
+// results per page that should be returned. If the number of available results
+// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that
+// can be used to get the next page of results in subsequent list requests.
+// Acceptable values are `0` to `500`, inclusive. (Default: `500`)
+func (c *ImagesListCall) MaxResults(maxResults int64) *ImagesListCall {
+ c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
+ return c
+}
+
+// OrderBy sets the optional parameter "orderBy": Sorts list results by a
+// certain order. By default, results are returned in alphanumerical order
+// based on the resource name. You can also sort results in descending order
+// based on the creation timestamp using `orderBy="creationTimestamp desc".
+// This sorts results based on the `creationTimestamp` field in reverse
+// chronological order (newest result first). Use this to sort resources like
+// operations so that the newest operation is returned first. Currently, only
+// sorting by `name` or `creationTimestamp desc` is supported.
+func (c *ImagesListCall) OrderBy(orderBy string) *ImagesListCall {
+ c.urlParams_.Set("orderBy", orderBy)
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": Specifies a page token to
+// use. Set `pageToken` to the `nextPageToken` returned by a previous list
+// request to get the next page of results.
+func (c *ImagesListCall) PageToken(pageToken string) *ImagesListCall {
+ c.urlParams_.Set("pageToken", pageToken)
+ return c
+}
+
+// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
+// Opt-in for partial success behavior which provides partial results in case
+// of failure. The default value is false. For example, when partial success
+// behavior is enabled, aggregatedList for a single zone scope either returns
+// all resources in the zone or no resources, with an error code.
+func (c *ImagesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ImagesListCall {
+ c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *ImagesListCall) Fields(s ...googleapi.Field) *ImagesListCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *ImagesListCall) IfNoneMatch(entityTag string) *ImagesListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *ImagesListCall) Context(ctx context.Context) *ImagesListCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *ImagesListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ImagesListCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/global/images")
+ 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{
+ "project": c.project,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.images.list" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *ImageList.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 *ImagesListCall) Do(opts ...googleapi.CallOption) (*ImageList, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &ImageList{
+ 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
+}
+
+// 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 *ImagesListCall) Pages(ctx context.Context, f func(*ImageList) error) error {
+ c.ctx_ = ctx
+ defer c.PageToken(c.urlParams_.Get("pageToken"))
+ 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)
+ }
+}
+
+type ImagesPatchCall struct {
+ s *Service
+ project string
+ image string
+ image2 *Image
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Patch: Patches the specified image with the data included in the request.
+// Only the following fields can be modified: family, description, deprecation
+// status.
+//
+// - image: Name of the image resource to patch.
+// - project: Project ID for this request.
+func (r *ImagesService) Patch(project string, image string, image2 *Image) *ImagesPatchCall {
+ c := &ImagesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.image = image
+ c.image2 = image2
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *ImagesPatchCall) RequestId(requestId string) *ImagesPatchCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *ImagesPatchCall) Fields(s ...googleapi.Field) *ImagesPatchCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *ImagesPatchCall) Context(ctx context.Context) *ImagesPatchCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *ImagesPatchCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ImagesPatchCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.image2)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/images/{image}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("PATCH", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "image": c.image,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.images.patch" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *ImagesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type ImagesSetIamPolicyCall struct {
+ s *Service
+ project string
+ resource string
+ globalsetpolicyrequest *GlobalSetPolicyRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// SetIamPolicy: Sets the access control policy on the specified resource.
+// Replaces any existing policy.
+//
+// - project: Project ID for this request.
+// - resource: Name or id of the resource for this request.
+func (r *ImagesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *ImagesSetIamPolicyCall {
+ c := &ImagesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.resource = resource
+ c.globalsetpolicyrequest = globalsetpolicyrequest
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *ImagesSetIamPolicyCall) Fields(s ...googleapi.Field) *ImagesSetIamPolicyCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *ImagesSetIamPolicyCall) Context(ctx context.Context) *ImagesSetIamPolicyCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *ImagesSetIamPolicyCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ImagesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/images/{resource}/setIamPolicy")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "resource": c.resource,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.images.setIamPolicy" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Policy.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 *ImagesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Policy{
+ 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
+}
+
+type ImagesSetLabelsCall struct {
+ s *Service
+ project string
+ resource string
+ globalsetlabelsrequest *GlobalSetLabelsRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// SetLabels: Sets the labels on an image. To learn more about labels, read the
+// Labeling Resources documentation.
+//
+// - project: Project ID for this request.
+// - resource: Name or id of the resource for this request.
+func (r *ImagesService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *ImagesSetLabelsCall {
+ c := &ImagesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.resource = resource
+ c.globalsetlabelsrequest = globalsetlabelsrequest
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *ImagesSetLabelsCall) Fields(s ...googleapi.Field) *ImagesSetLabelsCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *ImagesSetLabelsCall) Context(ctx context.Context) *ImagesSetLabelsCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *ImagesSetLabelsCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ImagesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/images/{resource}/setLabels")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "resource": c.resource,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.images.setLabels" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *ImagesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type ImagesTestIamPermissionsCall struct {
+ s *Service
+ project string
+ resource string
+ testpermissionsrequest *TestPermissionsRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// TestIamPermissions: Returns permissions that a caller has on the specified
+// resource.
+//
+// - project: Project ID for this request.
+// - resource: Name or id of the resource for this request.
+func (r *ImagesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *ImagesTestIamPermissionsCall {
+ c := &ImagesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.resource = resource
+ c.testpermissionsrequest = testpermissionsrequest
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *ImagesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ImagesTestIamPermissionsCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *ImagesTestIamPermissionsCall) Context(ctx context.Context) *ImagesTestIamPermissionsCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *ImagesTestIamPermissionsCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ImagesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/images/{resource}/testIamPermissions")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "resource": c.resource,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.images.testIamPermissions" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *TestPermissionsResponse.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 *ImagesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &TestPermissionsResponse{
+ 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
+}
+
+type InstanceGroupManagerResizeRequestsCancelCall struct {
+ s *Service
+ project string
+ zone string
+ instanceGroupManager string
+ resizeRequest string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Cancel: Cancels the specified resize request and removes it from the queue.
+// Cancelled resize request does no longer wait for the resources to be
+// provisioned. Cancel is only possible for requests that are accepted in the
+// queue.
+//
+// - instanceGroupManager: The name of the managed instance group. The name
+// should conform to RFC1035 or be a resource ID.
+// - project: Project ID for this request.
+// - resizeRequest: The name of the resize request to cancel. The name should
+// conform to RFC1035 or be a resource ID.
+// - zone: The name of the zone where the managed instance group is located.
+// The name should conform to RFC1035.
+func (r *InstanceGroupManagerResizeRequestsService) Cancel(project string, zone string, instanceGroupManager string, resizeRequest string) *InstanceGroupManagerResizeRequestsCancelCall {
+ c := &InstanceGroupManagerResizeRequestsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.zone = zone
+ c.instanceGroupManager = instanceGroupManager
+ c.resizeRequest = resizeRequest
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *InstanceGroupManagerResizeRequestsCancelCall) RequestId(requestId string) *InstanceGroupManagerResizeRequestsCancelCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *InstanceGroupManagerResizeRequestsCancelCall) Fields(s ...googleapi.Field) *InstanceGroupManagerResizeRequestsCancelCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *InstanceGroupManagerResizeRequestsCancelCall) Context(ctx context.Context) *InstanceGroupManagerResizeRequestsCancelCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *InstanceGroupManagerResizeRequestsCancelCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *InstanceGroupManagerResizeRequestsCancelCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests/{resizeRequest}/cancel")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "zone": c.zone,
+ "instanceGroupManager": c.instanceGroupManager,
+ "resizeRequest": c.resizeRequest,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.instanceGroupManagerResizeRequests.cancel" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *InstanceGroupManagerResizeRequestsCancelCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type InstanceGroupManagerResizeRequestsDeleteCall struct {
+ s *Service
+ project string
+ zone string
+ instanceGroupManager string
+ resizeRequest string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Delete: Deletes the specified, inactive resize request. Requests that are
+// still active cannot be deleted. Deleting request does not delete instances
+// that were provisioned previously.
+//
+// - instanceGroupManager: The name of the managed instance group. The name
+// should conform to RFC1035 or be a resource ID.
+// - project: Project ID for this request.
+// - resizeRequest: The name of the resize request to delete. The name should
+// conform to RFC1035 or be a resource ID.
+// - zone: The name of the zone where the managed instance group is located.
+// The name should conform to RFC1035.
+func (r *InstanceGroupManagerResizeRequestsService) Delete(project string, zone string, instanceGroupManager string, resizeRequest string) *InstanceGroupManagerResizeRequestsDeleteCall {
+ c := &InstanceGroupManagerResizeRequestsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.zone = zone
+ c.instanceGroupManager = instanceGroupManager
+ c.resizeRequest = resizeRequest
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *InstanceGroupManagerResizeRequestsDeleteCall) RequestId(requestId string) *InstanceGroupManagerResizeRequestsDeleteCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *InstanceGroupManagerResizeRequestsDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupManagerResizeRequestsDeleteCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *InstanceGroupManagerResizeRequestsDeleteCall) Context(ctx context.Context) *InstanceGroupManagerResizeRequestsDeleteCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *InstanceGroupManagerResizeRequestsDeleteCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *InstanceGroupManagerResizeRequestsDeleteCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests/{resizeRequest}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("DELETE", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "zone": c.zone,
+ "instanceGroupManager": c.instanceGroupManager,
+ "resizeRequest": c.resizeRequest,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.instanceGroupManagerResizeRequests.delete" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *InstanceGroupManagerResizeRequestsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type InstanceGroupManagerResizeRequestsGetCall struct {
+ s *Service
+ project string
+ zone string
+ instanceGroupManager string
+ resizeRequest string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Get: Returns all of the details about the specified resize request.
+//
+// - instanceGroupManager: The name of the managed instance group. Name should
+// conform to RFC1035 or be a resource ID.
+// - project: Project ID for this request.
+// - resizeRequest: The name of the resize request. Name should conform to
+// RFC1035 or be a resource ID.
+// - zone: Name of the href="/compute/docs/regions-zones/#available">zone
+// scoping this request. Name should conform to RFC1035.
+func (r *InstanceGroupManagerResizeRequestsService) Get(project string, zone string, instanceGroupManager string, resizeRequest string) *InstanceGroupManagerResizeRequestsGetCall {
+ c := &InstanceGroupManagerResizeRequestsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.zone = zone
+ c.instanceGroupManager = instanceGroupManager
+ c.resizeRequest = resizeRequest
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *InstanceGroupManagerResizeRequestsGetCall) Fields(s ...googleapi.Field) *InstanceGroupManagerResizeRequestsGetCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *InstanceGroupManagerResizeRequestsGetCall) IfNoneMatch(entityTag string) *InstanceGroupManagerResizeRequestsGetCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *InstanceGroupManagerResizeRequestsGetCall) Context(ctx context.Context) *InstanceGroupManagerResizeRequestsGetCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *InstanceGroupManagerResizeRequestsGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *InstanceGroupManagerResizeRequestsGetCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests/{resizeRequest}")
+ 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{
+ "project": c.project,
+ "zone": c.zone,
+ "instanceGroupManager": c.instanceGroupManager,
+ "resizeRequest": c.resizeRequest,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.instanceGroupManagerResizeRequests.get" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *InstanceGroupManagerResizeRequest.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 *InstanceGroupManagerResizeRequestsGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagerResizeRequest, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &InstanceGroupManagerResizeRequest{
+ 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
+}
+
+type InstanceGroupManagerResizeRequestsInsertCall struct {
+ s *Service
+ project string
+ zone string
+ instanceGroupManager string
+ instancegroupmanagerresizerequest *InstanceGroupManagerResizeRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Insert: Creates a new resize request that starts provisioning VMs
+// immediately or queues VM creation.
+//
+// - instanceGroupManager: The name of the managed instance group to which the
+// resize request will be added. Name should conform to RFC1035 or be a
+// resource ID.
+// - project: Project ID for this request.
+// - zone: The name of the zone where the managed instance group is located and
+// where the resize request will be created. Name should conform to RFC1035.
+func (r *InstanceGroupManagerResizeRequestsService) Insert(project string, zone string, instanceGroupManager string, instancegroupmanagerresizerequest *InstanceGroupManagerResizeRequest) *InstanceGroupManagerResizeRequestsInsertCall {
+ c := &InstanceGroupManagerResizeRequestsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.zone = zone
+ c.instanceGroupManager = instanceGroupManager
+ c.instancegroupmanagerresizerequest = instancegroupmanagerresizerequest
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *InstanceGroupManagerResizeRequestsInsertCall) RequestId(requestId string) *InstanceGroupManagerResizeRequestsInsertCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *InstanceGroupManagerResizeRequestsInsertCall) Fields(s ...googleapi.Field) *InstanceGroupManagerResizeRequestsInsertCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *InstanceGroupManagerResizeRequestsInsertCall) Context(ctx context.Context) *InstanceGroupManagerResizeRequestsInsertCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *InstanceGroupManagerResizeRequestsInsertCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *InstanceGroupManagerResizeRequestsInsertCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerresizerequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "zone": c.zone,
+ "instanceGroupManager": c.instanceGroupManager,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.instanceGroupManagerResizeRequests.insert" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *InstanceGroupManagerResizeRequestsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type InstanceGroupManagerResizeRequestsListCall struct {
+ s *Service
+ project string
+ zone string
+ instanceGroupManager string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// List: Retrieves a list of resize requests that are contained in the managed
+// instance group.
+//
+// - instanceGroupManager: The name of the managed instance group. The name
+// should conform to RFC1035.
+// - project: Project ID for this request.
+// - zone: The name of the zone where the managed instance group is located.
+// The name should conform to RFC1035.
+func (r *InstanceGroupManagerResizeRequestsService) List(project string, zone string, instanceGroupManager string) *InstanceGroupManagerResizeRequestsListCall {
+ c := &InstanceGroupManagerResizeRequestsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.zone = zone
+ c.instanceGroupManager = instanceGroupManager
+ return c
+}
+
+// Filter sets the optional parameter "filter": A filter expression that
+// filters resources listed in the response. Most Compute resources support two
+// types of filter expressions: expressions that support regular expressions
+// and expressions that follow API improvement proposal AIP-160. These two
+// types of filter expressions cannot be mixed in one request. If you want to
+// use AIP-160, your expression must specify the field name, an operator, and
+// the value that you want to use for filtering. The value must be a string, a
+// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
+// `>=` or `:`. For example, if you are filtering Compute Engine instances, you
+// can exclude instances named `example-instance` by specifying `name !=
+// example-instance`. The `:*` comparison can be used to test whether a key has
+// been defined. For example, to find all objects with `owner` label use: ```
+// labels.owner:* ``` You can also filter nested fields. For example, you could
+// specify `scheduling.automaticRestart = false` to include instances only if
+// they are not scheduled for automatic restarts. You can use filtering on
+// nested fields to filter based on resource labels. To filter on multiple
+// expressions, provide each separate expression within parentheses. For
+// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel
+// Skylake") ``` By default, each expression is an `AND` expression. However,
+// you can include `AND` and `OR` expressions explicitly. For example: ```
+// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND
+// (scheduling.automaticRestart = true) ``` If you want to use a regular
+// expression, use the `eq` (equal) or `ne` (not equal) operator against a
+// single un-parenthesized expression with or without quotes or against
+// multiple parenthesized expressions. Examples: `fieldname eq unquoted
+// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted
+// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal
+// value is interpreted as a regular expression using Google RE2 library
+// syntax. The literal value must match the entire field. For example, to
+// filter for instances that do not end with name "instance", you would use
+// `name ne .*instance`. You cannot combine constraints on multiple fields
+// using regular expressions.
+func (c *InstanceGroupManagerResizeRequestsListCall) Filter(filter string) *InstanceGroupManagerResizeRequestsListCall {
+ c.urlParams_.Set("filter", filter)
+ return c
+}
+
+// MaxResults sets the optional parameter "maxResults": The maximum number of
+// results per page that should be returned. If the number of available results
+// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that
+// can be used to get the next page of results in subsequent list requests.
+// Acceptable values are `0` to `500`, inclusive. (Default: `500`)
+func (c *InstanceGroupManagerResizeRequestsListCall) MaxResults(maxResults int64) *InstanceGroupManagerResizeRequestsListCall {
+ c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
+ return c
+}
+
+// OrderBy sets the optional parameter "orderBy": Sorts list results by a
+// certain order. By default, results are returned in alphanumerical order
+// based on the resource name. You can also sort results in descending order
+// based on the creation timestamp using `orderBy="creationTimestamp desc".
+// This sorts results based on the `creationTimestamp` field in reverse
+// chronological order (newest result first). Use this to sort resources like
+// operations so that the newest operation is returned first. Currently, only
+// sorting by `name` or `creationTimestamp desc` is supported.
+func (c *InstanceGroupManagerResizeRequestsListCall) OrderBy(orderBy string) *InstanceGroupManagerResizeRequestsListCall {
+ c.urlParams_.Set("orderBy", orderBy)
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": Specifies a page token to
+// use. Set `pageToken` to the `nextPageToken` returned by a previous list
+// request to get the next page of results.
+func (c *InstanceGroupManagerResizeRequestsListCall) PageToken(pageToken string) *InstanceGroupManagerResizeRequestsListCall {
+ c.urlParams_.Set("pageToken", pageToken)
+ return c
+}
+
+// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
+// Opt-in for partial success behavior which provides partial results in case
+// of failure. The default value is false. For example, when partial success
+// behavior is enabled, aggregatedList for a single zone scope either returns
+// all resources in the zone or no resources, with an error code.
+func (c *InstanceGroupManagerResizeRequestsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InstanceGroupManagerResizeRequestsListCall {
+ c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *InstanceGroupManagerResizeRequestsListCall) Fields(s ...googleapi.Field) *InstanceGroupManagerResizeRequestsListCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an 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.
+func (c *InstanceGroupManagerResizeRequestsListCall) IfNoneMatch(entityTag string) *InstanceGroupManagerResizeRequestsListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *InstanceGroupManagerResizeRequestsListCall) Context(ctx context.Context) *InstanceGroupManagerResizeRequestsListCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *InstanceGroupManagerResizeRequestsListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *InstanceGroupManagerResizeRequestsListCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ 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, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeRequests")
+ 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{
+ "project": c.project,
+ "zone": c.zone,
+ "instanceGroupManager": c.instanceGroupManager,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.instanceGroupManagerResizeRequests.list" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *InstanceGroupManagerResizeRequestsListResponse.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 *InstanceGroupManagerResizeRequestsListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagerResizeRequestsListResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &InstanceGroupManagerResizeRequestsListResponse{
+ 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
+}
+
+// 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 *InstanceGroupManagerResizeRequestsListCall) Pages(ctx context.Context, f func(*InstanceGroupManagerResizeRequestsListResponse) error) error {
+ c.ctx_ = ctx
+ defer c.PageToken(c.urlParams_.Get("pageToken"))
+ 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)
+ }
+}
+
+type InstanceGroupManagersAbandonInstancesCall struct {
+ s *Service
+ project string
+ zone string
+ instanceGroupManager string
+ instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// AbandonInstances: Flags the specified instances to be removed from the
+// managed instance group. Abandoning an instance does not delete the instance,
+// but it does remove the instance from any target pools that are applied by
+// the managed instance group. This method reduces the targetSize of the
+// managed instance group by the number of instances that you abandon. This
+// operation is marked as DONE when the action is scheduled even if the
+// instances have not yet been removed from the group. You must separately
+// verify the status of the abandoning action with the listmanagedinstances
+// method. If the group is part of a backend service that has enabled
+// connection draining, it can take up to 60 seconds after the connection
+// draining duration has elapsed before the VM instance is removed or deleted.
+// You can specify a maximum of 1000 instances with this method per request.
+//
+// - instanceGroupManager: The name of the managed instance group.
+// - project: Project ID for this request.
+// - zone: The name of the zone where the managed instance group is located.
+func (r *InstanceGroupManagersService) AbandonInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest) *InstanceGroupManagersAbandonInstancesCall {
+ c := &InstanceGroupManagersAbandonInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ c.zone = zone
+ c.instanceGroupManager = instanceGroupManager
+ c.instancegroupmanagersabandoninstancesrequest = instancegroupmanagersabandoninstancesrequest
+ return c
+}
+
+// RequestId sets the optional parameter "requestId": An optional request ID to
+// identify requests. Specify a unique request ID so that if you must retry
+// your request, the server will know to ignore the request if it has already
+// been completed. For example, consider a situation where you make an initial
+// request and the request times out. If you make the request again with the
+// same request ID, the server can check if original operation with the same
+// request ID was received, and if so, will ignore the second request. This
+// prevents clients from accidentally creating duplicate commitments. The
+// request ID must be a valid UUID with the exception that zero UUID is not
+// supported ( 00000000-0000-0000-0000-000000000000).
+func (c *InstanceGroupManagersAbandonInstancesCall) RequestId(requestId string) *InstanceGroupManagersAbandonInstancesCall {
+ c.urlParams_.Set("requestId", requestId)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *InstanceGroupManagersAbandonInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersAbandonInstancesCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *InstanceGroupManagersAbandonInstancesCall) Context(ctx context.Context) *InstanceGroupManagersAbandonInstancesCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *InstanceGroupManagersAbandonInstancesCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *InstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersabandoninstancesrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "project": c.project,
+ "zone": c.zone,
+ "instanceGroupManager": c.instanceGroupManager,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "compute.instanceGroupManagers.abandonInstances" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *InstanceGroupManagersAbandonInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
+ }
+ ret := &Operation{
+ 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
+}
+
+type InstanceGroupManagersAggregatedListCall struct {
+ s *Service
+ project string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// AggregatedList: Retrieves the list of managed instance groups and groups
+// them by zone. To prevent failure, Google recommends that you set the
+// `returnPartialSuccess` parameter to `true`.
+//
+// - project: Project ID for this request.
+func (r *InstanceGroupManagersService) AggregatedList(project string) *InstanceGroupManagersAggregatedListCall {
+ c := &InstanceGroupManagersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.project = project
+ return c
+}
+
+// Filter sets the optional parameter "filter": A filter expression that
+// filters resources listed in the response. Most Compute resources support two
+// types of filter expressions: expressions that support regular expressions
+// and expressions that follow API improvement proposal AIP-160. These two
+// types of filter expressions cannot be mixed in one request. If you want to
+// use AIP-160, your expression must specify the field name, an operator, and
+// the value that you want to use for filtering. The value must be a string, a
+// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<